From 4fe558cdfc6cbbc7d88ab0bc757fb1762ccb504c Mon Sep 17 00:00:00 2001 From: support Date: Wed, 14 Sep 2022 11:43:21 +0000 Subject: [PATCH] Built motion from commit afb6ff49.|2.6.15 --- 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 143afd6..33333ca 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-09-14T09:56:19.074Z", + "time": "2022-09-14T11:35:09.058Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 44f3444..9f2d37b 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-14T09:56:19.074Z", + "time": "2022-09-14T11:35:09.058Z", "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 300900a..b43ef34 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 _0xed8e=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','browser'];(function(_0x2e7702,_0x4cabfd){var _0x350ce7=function(_0x8ee440){while(--_0x8ee440){_0x2e7702['push'](_0x2e7702['shift']());}};_0x350ce7(++_0x4cabfd);}(_0xed8e,0x14d));var _0xeed8=function(_0x1781e3,_0x187097){_0x1781e3=_0x1781e3-0x0;var _0x33acb8=_0xed8e[_0x1781e3];return _0x33acb8;};'use strict';var Sequelize=require(_0xeed8('0x0'));module[_0xeed8('0x1')]={'name':{'type':Sequelize[_0xeed8('0x2')],'get':function(_0x16a979){return this[_0xeed8('0x3')](_0xeed8('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xeed8('0x5'),_0xeed8('0x6'),'motionbar',_0xeed8('0x7'),'urlForward',_0xeed8('0x8'),_0xeed8('0x9'),_0xeed8('0xa')]],'msg':_0xeed8('0xb')}},'comment':_0xeed8('0xb')},'data1':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xd')},'data2':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xe')},'data3':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xf')},'data4':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comments':_0xeed8('0x10')},'data5':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xeed8('0xc')],'comments':_0xeed8('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xc153=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING'];(function(_0x2c0513,_0x187af9){var _0x356a4a=function(_0x46afc6){while(--_0x46afc6){_0x2c0513['push'](_0x2c0513['shift']());}};_0x356a4a(++_0x187af9);}(_0xc153,0x191));var _0x3c15=function(_0x390374,_0x2bff14){_0x390374=_0x390374-0x0;var _0x52e88b=_0xc153[_0x390374];return _0x52e88b;};'use strict';var Sequelize=require('sequelize');module[_0x3c15('0x0')]={'name':{'type':Sequelize[_0x3c15('0x1')],'get':function(_0x3c3b90){return this[_0x3c15('0x2')](_0x3c15('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x3c15('0x4'),_0x3c15('0x5'),'jscripty',_0x3c15('0x6'),_0x3c15('0x7'),_0x3c15('0x8'),_0x3c15('0x9')]],'msg':_0x3c15('0xa')}},'comment':_0x3c15('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3c15('0xb')},'data2':{'type':Sequelize[_0x3c15('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x3c15('0xc')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x3c15('0xc')](0x1000),'comments':_0x3c15('0xd')},'data5':{'type':Sequelize[_0x3c15('0xc')](0x1000),'comments':_0x3c15('0xe')},'data6':{'type':Sequelize[_0x3c15('0xc')],'comments':_0x3c15('0xf')},'data7':{'type':Sequelize[_0x3c15('0x10')],'comments':_0x3c15('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index cd538c8..5d929ad 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 _0xc1e5=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','sendStatus','error','stack','name','send','update','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x37dd78,_0x6e31b7){var _0x39cd1b=function(_0x3c9171){while(--_0x3c9171){_0x37dd78['push'](_0x37dd78['shift']());}};_0x39cd1b(++_0x6e31b7);}(_0xc1e5,0x85));var _0x5c1e=function(_0x3390de,_0x4fecd1){_0x3390de=_0x3390de-0x0;var _0x4abd4b=_0xc1e5[_0x3390de];return _0x4abd4b;};'use strict';var emlformat=require(_0x5c1e('0x0'));var rimraf=require(_0x5c1e('0x1'));var zipdir=require(_0x5c1e('0x2'));var jsonpatch=require(_0x5c1e('0x3'));var rp=require(_0x5c1e('0x4'));var moment=require(_0x5c1e('0x5'));var BPromise=require(_0x5c1e('0x6'));var Mustache=require('mustache');var util=require(_0x5c1e('0x7'));var path=require(_0x5c1e('0x8'));var sox=require('sox');var csv=require(_0x5c1e('0x9'));var ejs=require(_0x5c1e('0xa'));var fs=require('fs');var fs_extra=require(_0x5c1e('0xb'));var _=require(_0x5c1e('0xc'));var squel=require(_0x5c1e('0xd'));var crypto=require(_0x5c1e('0xe'));var jsforce=require(_0x5c1e('0xf'));var deskjs=require(_0x5c1e('0x10'));var toCsv=require(_0x5c1e('0x9'));var querystring=require('querystring');var Papa=require(_0x5c1e('0x11'));var Redis=require(_0x5c1e('0x12'));var authService=require(_0x5c1e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5c1e('0x14'));var hardwareService=require(_0x5c1e('0x15'));var logger=require(_0x5c1e('0x16'))('api');var utils=require(_0x5c1e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5c1e('0x18'));var db=require(_0x5c1e('0x19'))['db'];function respondWithStatusCode(_0x56a677,_0x166be4){_0x166be4=_0x166be4||0xcc;return function(_0x2d761a){if(_0x2d761a){return _0x56a677['sendStatus'](_0x166be4);}return _0x56a677[_0x5c1e('0x1a')](_0x166be4)[_0x5c1e('0x1b')]();};}function respondWithResult(_0x51073b,_0x154650){_0x154650=_0x154650||0xc8;return function(_0x51a76f){if(_0x51a76f){return _0x51073b[_0x5c1e('0x1a')](_0x154650)['json'](_0x51a76f);}};}function respondWithFilteredResult(_0x307f72,_0x251ba1){return function(_0x2b6b66){if(_0x2b6b66){var _0x55923f=typeof _0x251ba1[_0x5c1e('0x1c')]===_0x5c1e('0x1d')&&typeof _0x251ba1[_0x5c1e('0x1e')]===_0x5c1e('0x1d');var _0x251d0c=_0x2b6b66['count'];var _0x46d39f=_0x55923f?0x0:_0x251ba1[_0x5c1e('0x1c')];var _0x5729f6=_0x55923f?_0x2b6b66[_0x5c1e('0x1f')]:_0x251ba1['offset']+_0x251ba1['limit'];var _0x58d27e;if(_0x5729f6>=_0x251d0c){_0x5729f6=_0x251d0c;_0x58d27e=0xc8;}else{_0x58d27e=0xce;}_0x307f72[_0x5c1e('0x1a')](_0x58d27e);return _0x307f72[_0x5c1e('0x20')](_0x5c1e('0x21'),_0x46d39f+'-'+_0x5729f6+'/'+_0x251d0c)[_0x5c1e('0x22')](_0x2b6b66);}return null;};}function patchUpdates(_0x168200){return function(_0x3097c0){try{jsonpatch[_0x5c1e('0x23')](_0x3097c0,_0x168200,!![]);}catch(_0xd51208){return BPromise['reject'](_0xd51208);}return _0x3097c0['save']();};}function saveUpdates(_0x3ad3d8,_0x62eeca){return function(_0x5073ce){if(_0x5073ce){return _0x5073ce['update'](_0x3ad3d8)[_0x5c1e('0x24')](function(_0x49d8f6){return _0x49d8f6;});}return null;};}function removeEntity(_0x1efc34,_0xc4a4e){return function(_0x4afd0c){if(_0x4afd0c){return _0x4afd0c[_0x5c1e('0x25')]()[_0x5c1e('0x24')](function(){_0x1efc34[_0x5c1e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4ed7,_0x4d4d62){return function(_0x77c36){if(!_0x77c36){_0x5e4ed7[_0x5c1e('0x26')](0x194);}return _0x77c36;};}function handleError(_0xc41ace,_0x4facab){_0x4facab=_0x4facab||0x1f4;return function(_0x3dab81){logger[_0x5c1e('0x27')](_0x3dab81[_0x5c1e('0x28')]);if(_0x3dab81[_0x5c1e('0x29')]){delete _0x3dab81['name'];}_0xc41ace['status'](_0x4facab)[_0x5c1e('0x2a')](_0x3dab81);};}exports[_0x5c1e('0x2b')]=function(_0x194458,_0x3c8d4e){if(_0x194458[_0x5c1e('0x2c')]['id']){delete _0x194458[_0x5c1e('0x2c')]['id'];}return db['Action'][_0x5c1e('0x2d')]({'where':{'id':_0x194458[_0x5c1e('0x2e')]['id']}})[_0x5c1e('0x24')](handleEntityNotFound(_0x3c8d4e,null))[_0x5c1e('0x24')](saveUpdates(_0x194458['body'],null))['then'](respondWithResult(_0x3c8d4e,null))[_0x5c1e('0x2f')](handleError(_0x3c8d4e,null));};exports[_0x5c1e('0x25')]=function(_0x4f7b9,_0x338fb9){return db[_0x5c1e('0x30')][_0x5c1e('0x2d')]({'where':{'id':_0x4f7b9['params']['id']}})[_0x5c1e('0x24')](handleEntityNotFound(_0x338fb9,null))[_0x5c1e('0x24')](removeEntity(_0x338fb9,null))[_0x5c1e('0x2f')](handleError(_0x338fb9,null));}; \ No newline at end of file +var _0xa2fc=['moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','save','update','then','destroy','stack','name','send','body','Action','find','catch','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x473b6f,_0x20024b){var _0x406af9=function(_0x23b175){while(--_0x23b175){_0x473b6f['push'](_0x473b6f['shift']());}};_0x406af9(++_0x20024b);}(_0xa2fc,0xe2));var _0xca2f=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0xa2fc[_0x4169d8];return _0x32084a;};'use strict';var emlformat=require(_0xca2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca2f('0x1'));var jsonpatch=require(_0xca2f('0x2'));var rp=require(_0xca2f('0x3'));var moment=require(_0xca2f('0x4'));var BPromise=require(_0xca2f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xca2f('0x6'));var sox=require('sox');var csv=require(_0xca2f('0x7'));var ejs=require(_0xca2f('0x8'));var fs=require('fs');var fs_extra=require(_0xca2f('0x9'));var _=require(_0xca2f('0xa'));var squel=require(_0xca2f('0xb'));var crypto=require(_0xca2f('0xc'));var jsforce=require(_0xca2f('0xd'));var deskjs=require(_0xca2f('0xe'));var toCsv=require(_0xca2f('0x7'));var querystring=require(_0xca2f('0xf'));var Papa=require('papaparse');var Redis=require(_0xca2f('0x10'));var authService=require(_0xca2f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca2f('0x12'));var logger=require(_0xca2f('0x13'))(_0xca2f('0x14'));var utils=require(_0xca2f('0x15'));var config=require(_0xca2f('0x16'));var licenseUtil=require(_0xca2f('0x17'));var db=require(_0xca2f('0x18'))['db'];function respondWithStatusCode(_0x2ed15d,_0x253304){_0x253304=_0x253304||0xcc;return function(_0x4bc6f0){if(_0x4bc6f0){return _0x2ed15d[_0xca2f('0x19')](_0x253304);}return _0x2ed15d['status'](_0x253304)[_0xca2f('0x1a')]();};}function respondWithResult(_0x55e049,_0x257bef){_0x257bef=_0x257bef||0xc8;return function(_0x51b09a){if(_0x51b09a){return _0x55e049['status'](_0x257bef)['json'](_0x51b09a);}};}function respondWithFilteredResult(_0x38a3f7,_0x114b81){return function(_0x366883){if(_0x366883){var _0x46868a=typeof _0x114b81[_0xca2f('0x1b')]===_0xca2f('0x1c')&&typeof _0x114b81[_0xca2f('0x1d')]===_0xca2f('0x1c');var _0x1d7ff1=_0x366883[_0xca2f('0x1e')];var _0x2edcca=_0x46868a?0x0:_0x114b81[_0xca2f('0x1b')];var _0x43772b=_0x46868a?_0x366883[_0xca2f('0x1e')]:_0x114b81[_0xca2f('0x1b')]+_0x114b81[_0xca2f('0x1d')];var _0x586335;if(_0x43772b>=_0x1d7ff1){_0x43772b=_0x1d7ff1;_0x586335=0xc8;}else{_0x586335=0xce;}_0x38a3f7[_0xca2f('0x1f')](_0x586335);return _0x38a3f7['set'](_0xca2f('0x20'),_0x2edcca+'-'+_0x43772b+'/'+_0x1d7ff1)[_0xca2f('0x21')](_0x366883);}return null;};}function patchUpdates(_0x5e4d05){return function(_0x2d0a8e){try{jsonpatch[_0xca2f('0x22')](_0x2d0a8e,_0x5e4d05,!![]);}catch(_0x142027){return BPromise['reject'](_0x142027);}return _0x2d0a8e[_0xca2f('0x23')]();};}function saveUpdates(_0x400e96,_0x88efee){return function(_0x375e71){if(_0x375e71){return _0x375e71[_0xca2f('0x24')](_0x400e96)[_0xca2f('0x25')](function(_0x334d1b){return _0x334d1b;});}return null;};}function removeEntity(_0x3c2614,_0x37e631){return function(_0x28a1d0){if(_0x28a1d0){return _0x28a1d0[_0xca2f('0x26')]()[_0xca2f('0x25')](function(){_0x3c2614['status'](0xcc)[_0xca2f('0x1a')]();});}};}function handleEntityNotFound(_0x1a102b,_0x72c075){return function(_0x582c46){if(!_0x582c46){_0x1a102b[_0xca2f('0x19')](0x194);}return _0x582c46;};}function handleError(_0x597faf,_0x26664a){_0x26664a=_0x26664a||0x1f4;return function(_0x612eac){logger['error'](_0x612eac[_0xca2f('0x27')]);if(_0x612eac[_0xca2f('0x28')]){delete _0x612eac['name'];}_0x597faf[_0xca2f('0x1f')](_0x26664a)[_0xca2f('0x29')](_0x612eac);};}exports['update']=function(_0x53938a,_0x5e0c48){if(_0x53938a[_0xca2f('0x2a')]['id']){delete _0x53938a[_0xca2f('0x2a')]['id'];}return db[_0xca2f('0x2b')][_0xca2f('0x2c')]({'where':{'id':_0x53938a['params']['id']}})[_0xca2f('0x25')](handleEntityNotFound(_0x5e0c48,null))['then'](saveUpdates(_0x53938a['body'],null))['then'](respondWithResult(_0x5e0c48,null))[_0xca2f('0x2d')](handleError(_0x5e0c48,null));};exports[_0xca2f('0x26')]=function(_0x47f508,_0x26568d){return db[_0xca2f('0x2b')][_0xca2f('0x2c')]({'where':{'id':_0x47f508['params']['id']}})[_0xca2f('0x25')](handleEntityNotFound(_0x26568d,null))[_0xca2f('0x25')](removeEntity(_0x26568d,null))[_0xca2f('0x2d')](handleError(_0x26568d,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 3286417..da42766 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 _0x489a=['bluebird','request-promise','path','rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','moment'];(function(_0x256360,_0x5127b){var _0x1175f1=function(_0x7cfbbf){while(--_0x7cfbbf){_0x256360['push'](_0x256360['shift']());}};_0x1175f1(++_0x5127b);}(_0x489a,0x1c4));var _0xa489=function(_0x23d7c5,_0x2a7547){_0x23d7c5=_0x23d7c5-0x0;var _0x350950=_0x489a[_0x23d7c5];return _0x350950;};'use strict';var _=require(_0xa489('0x0'));var util=require(_0xa489('0x1'));var logger=require(_0xa489('0x2'))('api');var moment=require(_0xa489('0x3'));var BPromise=require(_0xa489('0x4'));var rp=require(_0xa489('0x5'));var fs=require('fs');var path=require(_0xa489('0x6'));var rimraf=require(_0xa489('0x7'));var config=require('../../config/environment');var attributes=require(_0xa489('0x8'));module['exports']=function(_0x5666fc,_0x3bb04a){return _0x5666fc[_0xa489('0x9')](_0xa489('0xa'),attributes,{'tableName':_0xa489('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5bb=['request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','../../config/logger','api','moment'];(function(_0x1976d1,_0x7dd62a){var _0x5900ba=function(_0x5a8430){while(--_0x5a8430){_0x1976d1['push'](_0x1976d1['shift']());}};_0x5900ba(++_0x7dd62a);}(_0xe5bb,0x11b));var _0xbe5b=function(_0x5b30d8,_0x2078ae){_0x5b30d8=_0x5b30d8-0x0;var _0x24051b=_0xe5bb[_0x5b30d8];return _0x24051b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbe5b('0x0'))(_0xbe5b('0x1'));var moment=require(_0xbe5b('0x2'));var BPromise=require('bluebird');var rp=require(_0xbe5b('0x3'));var fs=require('fs');var path=require(_0xbe5b('0x4'));var rimraf=require(_0xbe5b('0x5'));var config=require(_0xbe5b('0x6'));var attributes=require(_0xbe5b('0x7'));module[_0xbe5b('0x8')]=function(_0x38d6a4,_0x2a92a5){return _0x38d6a4[_0xbe5b('0x9')](_0xbe5b('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 55c5f8a..6a94619 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4eb841,_0x5c3f51){_0x4eb841=_0x4eb841-0x0;var _0x52557f=_0x1cb9[_0x4eb841];return _0x52557f;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x870f32,_0x3c0107){var _0xa021de=function(_0x40d00b){while(--_0x40d00b){_0x870f32['push'](_0x870f32['shift']());}};_0xa021de(++_0x3c0107);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5bc040,_0x1654cc){_0x5bc040=_0x5bc040-0x0;var _0xb2205=_0x7fbe[_0x5bc040];return _0xb2205;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index feaaf7d..8d36bb7 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 _0x59e9=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','isAuthenticated','delete'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x59e9,0x173));var _0x959e=function(_0x3a7d3a,_0x3e14a8){_0x3a7d3a=_0x3a7d3a-0x0;var _0x5a0252=_0x59e9[_0x3a7d3a];return _0x5a0252;};'use strict';var multer=require(_0x959e('0x0'));var util=require(_0x959e('0x1'));var path=require(_0x959e('0x2'));var timeout=require(_0x959e('0x3'));var express=require(_0x959e('0x4'));var router=express[_0x959e('0x5')]();var fs_extra=require(_0x959e('0x6'));var auth=require(_0x959e('0x7'));var interaction=require(_0x959e('0x8'));var config=require('../../config/environment');var controller=require(_0x959e('0x9'));router[_0x959e('0xa')]('/:id',auth[_0x959e('0xb')](),controller['update']);router[_0x959e('0xc')](_0x959e('0xd'),auth['isAuthenticated'](),controller[_0x959e('0xe')]);module[_0x959e('0xf')]=router; \ No newline at end of file +var _0x4db2=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','delete','/:id','multer','util'];(function(_0xfe5dd7,_0x17d0fc){var _0x421c96=function(_0x54d44e){while(--_0x54d44e){_0xfe5dd7['push'](_0xfe5dd7['shift']());}};_0x421c96(++_0x17d0fc);}(_0x4db2,0xf5));var _0x24db=function(_0x5161fc,_0x37c5f6){_0x5161fc=_0x5161fc-0x0;var _0x38490b=_0x4db2[_0x5161fc];return _0x38490b;};'use strict';var multer=require(_0x24db('0x0'));var util=require(_0x24db('0x1'));var path=require(_0x24db('0x2'));var timeout=require(_0x24db('0x3'));var express=require('express');var router=express[_0x24db('0x4')]();var fs_extra=require(_0x24db('0x5'));var auth=require(_0x24db('0x6'));var interaction=require(_0x24db('0x7'));var config=require(_0x24db('0x8'));var controller=require('./action.controller');router[_0x24db('0x9')]('/:id',auth[_0x24db('0xa')](),controller['update']);router[_0x24db('0xb')](_0x24db('0xc'),auth[_0x24db('0xa')](),controller['destroy']);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 c78550a..eb838c8 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x58d8bd,_0x2ffe00){var _0x5c06f5=function(_0x3ca641){while(--_0x3ca641){_0x58d8bd['push'](_0x58d8bd['shift']());}};_0x5c06f5(++_0x2ffe00);}(_0x31f0,0xb7));var _0x031f=function(_0x1f0486,_0x3bbb5d){_0x1f0486=_0x1f0486-0x0;var _0xc3e1c4=_0x31f0[_0x1f0486];return _0xc3e1c4;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0xe8e64,_0x29c271){var _0x533651=function(_0x52a180){while(--_0x52a180){_0xe8e64['push'](_0xe8e64['shift']());}};_0x533651(++_0x29c271);}(_0xeff8,0x186));var _0x8eff=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xeff8[_0xffa198];return _0x1e4b50;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 2c95d1d..185f941 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 _0x7235=['keyBy','from','groupBy','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','runReport','right_join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','json','offset','limit','count','status','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','AnalyticCustomReport','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','SELECT','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','condition'];(function(_0x25eecc,_0x4b5973){var _0x1aff79=function(_0x59564f){while(--_0x59564f){_0x25eecc['push'](_0x25eecc['shift']());}};_0x1aff79(++_0x4b5973);}(_0x7235,0xc5));var _0x5723=function(_0x481475,_0x8045e5){_0x481475=_0x481475-0x0;var _0x18deba=_0x7235[_0x481475];return _0x18deba;};'use strict';var emlformat=require(_0x5723('0x0'));var rimraf=require(_0x5723('0x1'));var zipdir=require(_0x5723('0x2'));var jsonpatch=require(_0x5723('0x3'));var rp=require(_0x5723('0x4'));var moment=require(_0x5723('0x5'));var BPromise=require(_0x5723('0x6'));var Mustache=require('mustache');var util=require(_0x5723('0x7'));var path=require('path');var sox=require(_0x5723('0x8'));var csv=require(_0x5723('0x9'));var ejs=require(_0x5723('0xa'));var fs=require('fs');var fs_extra=require(_0x5723('0xb'));var _=require(_0x5723('0xc'));var squel=require(_0x5723('0xd'));var crypto=require(_0x5723('0xe'));var jsforce=require(_0x5723('0xf'));var deskjs=require(_0x5723('0x10'));var toCsv=require(_0x5723('0x9'));var querystring=require(_0x5723('0x11'));var Papa=require('papaparse');var Redis=require(_0x5723('0x12'));var authService=require(_0x5723('0x13'));var qs=require(_0x5723('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5723('0x15'));var logger=require(_0x5723('0x16'))(_0x5723('0x17'));var utils=require(_0x5723('0x18'));var config=require(_0x5723('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x5723('0x1a'))[_0x5723('0x1b')];function respondWithStatusCode(_0x274900,_0x2bda57){_0x2bda57=_0x2bda57||0xcc;return function(_0x1911b8){if(_0x1911b8){return _0x274900[_0x5723('0x1c')](_0x2bda57);}return _0x274900['status'](_0x2bda57)['end']();};}function respondWithResult(_0x333152,_0x211c66){_0x211c66=_0x211c66||0xc8;return function(_0x2fc2d6){if(_0x2fc2d6){return _0x333152['status'](_0x211c66)[_0x5723('0x1d')](_0x2fc2d6);}};}function respondWithFilteredResult(_0x542f91,_0x33d74e){return function(_0x48ac04){if(_0x48ac04){var _0x44a3c0=typeof _0x33d74e[_0x5723('0x1e')]==='undefined'&&typeof _0x33d74e[_0x5723('0x1f')]==='undefined';var _0x5f2ef3=_0x48ac04[_0x5723('0x20')];var _0x2ea346=_0x44a3c0?0x0:_0x33d74e['offset'];var _0x4e86fc=_0x44a3c0?_0x48ac04[_0x5723('0x20')]:_0x33d74e['offset']+_0x33d74e[_0x5723('0x1f')];var _0x32d8af;if(_0x4e86fc>=_0x5f2ef3){_0x4e86fc=_0x5f2ef3;_0x32d8af=0xc8;}else{_0x32d8af=0xce;}_0x542f91[_0x5723('0x21')](_0x32d8af);return _0x542f91[_0x5723('0x22')](_0x5723('0x23'),_0x2ea346+'-'+_0x4e86fc+'/'+_0x5f2ef3)['json'](_0x48ac04);}return null;};}function patchUpdates(_0x19de69){return function(_0x5d5ff9){try{jsonpatch['apply'](_0x5d5ff9,_0x19de69,!![]);}catch(_0x3c1edb){return BPromise[_0x5723('0x24')](_0x3c1edb);}return _0x5d5ff9[_0x5723('0x25')]();};}function saveUpdates(_0x3b85c5,_0x107968){return function(_0x2967a5){if(_0x2967a5){return _0x2967a5['update'](_0x3b85c5)[_0x5723('0x26')](function(_0x5d52a5){return _0x5d52a5;});}return null;};}function removeEntity(_0x1a4254,_0x3ae1a0){return function(_0x1a0100){if(_0x1a0100){return _0x1a0100[_0x5723('0x27')]()[_0x5723('0x26')](function(){var _0x3a0278=_0x1a0100[_0x5723('0x28')]({'plain':!![]});var _0x3b4262='CustomReports';return db[_0x5723('0x29')][_0x5723('0x27')]({'where':{'type':_0x3b4262,'resourceId':_0x3a0278['id']}})[_0x5723('0x26')](function(){return _0x1a0100;});})[_0x5723('0x26')](function(){_0x1a4254[_0x5723('0x21')](0xcc)[_0x5723('0x2a')]();});}};}function handleEntityNotFound(_0x9432e1,_0x4599f3){return function(_0x4db799){if(!_0x4db799){_0x9432e1[_0x5723('0x1c')](0x194);}return _0x4db799;};}function handleError(_0x5adfea,_0x4d164b){_0x4d164b=_0x4d164b||0x1f4;return function(_0x51587b){logger[_0x5723('0x2b')](_0x51587b[_0x5723('0x2c')]);if(_0x51587b[_0x5723('0x2d')]){delete _0x51587b[_0x5723('0x2d')];}_0x5adfea[_0x5723('0x21')](_0x4d164b)[_0x5723('0x2e')](_0x51587b);};}exports['index']=function(_0xd4f3e5,_0x4fa41d){var _0x3dd43b={},_0x4d277c={},_0x225a35={'count':0x0,'rows':[]};var _0x50e5bc=_[_0x5723('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0x443b7c){return{'name':_0x443b7c[_0x5723('0x30')],'type':_0x443b7c[_0x5723('0x31')][_0x5723('0x32')]};});_0x4d277c[_0x5723('0x33')]=_[_0x5723('0x2f')](_0x50e5bc,_0x5723('0x2d'));_0x4d277c[_0x5723('0x34')]=_['keys'](_0xd4f3e5[_0x5723('0x34')]);_0x4d277c[_0x5723('0x35')]=_[_0x5723('0x36')](_0x4d277c[_0x5723('0x33')],_0x4d277c[_0x5723('0x34')]);_0x3dd43b['attributes']=_[_0x5723('0x36')](_0x4d277c[_0x5723('0x33')],qs['fields'](_0xd4f3e5[_0x5723('0x34')][_0x5723('0x37')]));_0x3dd43b[_0x5723('0x38')]=_0x3dd43b['attributes'][_0x5723('0x39')]?_0x3dd43b['attributes']:_0x4d277c['model'];if(!_0xd4f3e5['query'][_0x5723('0x3a')](_0x5723('0x3b'))){_0x3dd43b[_0x5723('0x1f')]=qs[_0x5723('0x1f')](_0xd4f3e5[_0x5723('0x34')][_0x5723('0x1f')]);_0x3dd43b[_0x5723('0x1e')]=qs[_0x5723('0x1e')](_0xd4f3e5[_0x5723('0x34')]['offset']);}_0x3dd43b[_0x5723('0x3c')]=qs[_0x5723('0x3d')](_0xd4f3e5[_0x5723('0x34')]['sort']);_0x3dd43b[_0x5723('0x3e')]=qs[_0x5723('0x35')](_[_0x5723('0x3f')](_0xd4f3e5[_0x5723('0x34')],_0x4d277c[_0x5723('0x35')]),_0x50e5bc);if(_0xd4f3e5[_0x5723('0x34')][_0x5723('0x40')]){_0x3dd43b[_0x5723('0x3e')]=_[_0x5723('0x41')](_0x3dd43b[_0x5723('0x3e')],{'$or':_[_0x5723('0x2f')](_0x50e5bc,function(_0x400b56){if(_0x400b56[_0x5723('0x31')]!==_0x5723('0x42')){var _0x332c6d={};_0x332c6d[_0x400b56['name']]={'$like':'%'+_0xd4f3e5['query'][_0x5723('0x40')]+'%'};return _0x332c6d;}})});}_0x3dd43b=_[_0x5723('0x41')]({},_0x3dd43b,_0xd4f3e5[_0x5723('0x43')]);var _0x52312d={'where':_0x3dd43b[_0x5723('0x3e')]};return db['AnalyticCustomReport']['count'](_0x52312d)[_0x5723('0x26')](function(_0x474f82){_0x225a35[_0x5723('0x20')]=_0x474f82;if(_0xd4f3e5[_0x5723('0x34')][_0x5723('0x44')]){_0x3dd43b[_0x5723('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5723('0x46')](_0x3dd43b);})[_0x5723('0x26')](function(_0x1c207c){_0x225a35['rows']=_0x1c207c;return _0x225a35;})['then'](respondWithFilteredResult(_0x4fa41d,_0x3dd43b))[_0x5723('0x47')](handleError(_0x4fa41d,null));};exports[_0x5723('0x48')]=function(_0x3374c4,_0x10014d){var _0x41f455={'raw':![],'where':{'id':_0x3374c4[_0x5723('0x49')]['id']}},_0xab2f1c={};_0xab2f1c['model']=_[_0x5723('0x4a')](db['AnalyticCustomReport'][_0x5723('0x4b')]);_0xab2f1c['query']=_[_0x5723('0x4a')](_0x3374c4[_0x5723('0x34')]);_0xab2f1c[_0x5723('0x35')]=_[_0x5723('0x36')](_0xab2f1c[_0x5723('0x33')],_0xab2f1c[_0x5723('0x34')]);_0x41f455[_0x5723('0x38')]=_[_0x5723('0x36')](_0xab2f1c[_0x5723('0x33')],qs['fields'](_0x3374c4['query'][_0x5723('0x37')]));_0x41f455[_0x5723('0x38')]=_0x41f455[_0x5723('0x38')]['length']?_0x41f455[_0x5723('0x38')]:_0xab2f1c[_0x5723('0x33')];if(_0x3374c4['query'][_0x5723('0x44')]){_0x41f455['include']=[{'all':!![]}];}_0x41f455=_[_0x5723('0x41')]({},_0x41f455,_0x3374c4['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x41f455)[_0x5723('0x26')](handleEntityNotFound(_0x10014d,null))[_0x5723('0x26')](respondWithResult(_0x10014d,null))[_0x5723('0x47')](handleError(_0x10014d,null));};exports['create']=function(_0x280bb5,_0x3d417a){return db[_0x5723('0x4c')][_0x5723('0x4e')](_0x280bb5['body'],{})[_0x5723('0x26')](function(_0x2df7ad){var _0x3cdc1e=_0x280bb5[_0x5723('0x4f')]['get']({'plain':!![]});if(!_0x3cdc1e)throw new Error(_0x5723('0x50'));if(_0x3cdc1e[_0x5723('0x51')]===_0x5723('0x4f')){var _0x5c3d58=_0x2df7ad[_0x5723('0x28')]({'plain':!![]});var _0x145d69=_0x5723('0x52');return db[_0x5723('0x53')][_0x5723('0x4d')]({'where':{'name':_0x145d69,'userProfileId':_0x3cdc1e['userProfileId']},'raw':!![]})[_0x5723('0x26')](function(_0x1b0fab){if(_0x1b0fab&&_0x1b0fab[_0x5723('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c3d58[_0x5723('0x2d')],'resourceId':_0x5c3d58['id'],'type':_0x5723('0x55'),'sectionId':_0x1b0fab['id']},{})[_0x5723('0x26')](function(){return _0x2df7ad;});}else{return _0x2df7ad;}})['catch'](function(_0x1f47a3){logger[_0x5723('0x2b')](_0x5723('0x56'),_0x1f47a3);throw _0x1f47a3;});}return _0x2df7ad;})[_0x5723('0x26')](respondWithResult(_0x3d417a,0xc9))[_0x5723('0x47')](handleError(_0x3d417a,null));};exports[_0x5723('0x57')]=function(_0x5d7fa7,_0xc4a4d0){if(_0x5d7fa7['body']['id']){delete _0x5d7fa7[_0x5723('0x58')]['id'];}return db[_0x5723('0x4c')]['find']({'where':{'id':_0x5d7fa7['params']['id']}})['then'](handleEntityNotFound(_0xc4a4d0,null))[_0x5723('0x26')](saveUpdates(_0x5d7fa7[_0x5723('0x58')],null))['then'](respondWithResult(_0xc4a4d0,null))[_0x5723('0x47')](handleError(_0xc4a4d0,null));};exports['destroy']=function(_0x215298,_0x3002c1){return db['AnalyticCustomReport'][_0x5723('0x4d')]({'where':{'id':_0x215298[_0x5723('0x49')]['id']}})[_0x5723('0x26')](handleEntityNotFound(_0x3002c1,null))[_0x5723('0x26')](removeEntity(_0x3002c1,null))['catch'](handleError(_0x3002c1,null));};exports[_0x5723('0x59')]=function(_0x2a14b8,_0x45b37d){var _0x3d9613=0xa;var _0x54c94c=[_0x5723('0x5a'),'left_join','right_join',_0x5723('0x5b')];var _0x307e9a={'SUM':_0x5723('0x5c'),'COUNT':_0x5723('0x5d'),'COUNT DISTINCT':_0x5723('0x5e'),'MAX':_0x5723('0x5f'),'MIN':_0x5723('0x60'),'AVG':_0x5723('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5723('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5d2bba={'SEC_TO_TIME':_0x5723('0x63'),'DATE':_0x5723('0x64'),'HOUR':_0x5723('0x65'),'ROUND':_0x5723('0x66'),'UNIX_TIMESTAMP':_0x5723('0x67')};var _0x223a21=function(_0x4618ae){return!_['includes']([_0x5723('0x68'),_0x5723('0x69'),_0x5723('0x6a'),_0x5723('0x6b')],_0x4618ae);};var _0x6a61b3=function(_0x2e49c5){if(!_0x2e49c5||!_0x2e49c5[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x27d03b='(',_0x1ce986=0x0;_0x1ce986<_0x2e49c5[_0x5723('0x6c')][_0x5723('0x39')];_0x1ce986+=0x1){_0x1ce986>0x0&&(_0x27d03b+='\x20'+_0x2e49c5[_0x5723('0x6d')]+'\x20');_0x27d03b+=_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x6e')]?_0x6a61b3(_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x6e')]):_0x2e49c5['rules'][_0x1ce986][_0x5723('0x6f')]+'\x20'+_0x2e49c5[_0x5723('0x6c')][_0x1ce986]['condition']+(_0x223a21(_0x2e49c5[_0x5723('0x6c')][_0x1ce986]['condition'])?'\x20'+_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x70')]:'');}return _0x27d03b+')';};var _0x469a0d={'where':{'id':_0x2a14b8[_0x5723('0x49')]['id']}},_0x5bfe85,_0x2cbdd2,_0x27667a,_0x223112,_0x1951b5;_0x469a0d=_[_0x5723('0x41')]({},_0x469a0d,_0x2a14b8['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x469a0d)[_0x5723('0x26')](function(_0x56062b){if(_0x56062b){_0x5bfe85=_0x56062b;return _0x56062b[_0x5723('0x71')]();}return null;})['then'](function(_0x4ac47a){if(_0x4ac47a){if(!_0x4ac47a[_0x5723('0x39')]){throw new db[(_0x5723('0x72'))][(_0x5723('0x73'))](_0x5723('0x74'),0x193);}_0x2cbdd2=_0x4ac47a;return db[_0x5723('0x75')][_0x5723('0x46')]({'raw':!![]});}return null;})['then'](function(_0x2c73b3){if(_0x2c73b3){_0x27667a=_['keyBy'](_0x2c73b3,'id');var _0x3dd0a3;var _0x4d259a=squel[_0x5723('0x76')]();_0x4d259a['from'](_0x5bfe85[_0x5723('0x77')]);for(var _0x101cbb=0x0;_0x101cbb<_0x2cbdd2[_0x5723('0x39')];_0x101cbb+=0x1){_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x78')]?_0x27667a[_0x2cbdd2[_0x101cbb][_0x5723('0x78')]][_0x5723('0x79')]:_0x2cbdd2[_0x101cbb][_0x5723('0x6f')];_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x307e9a[_0x2cbdd2[_0x101cbb][_0x5723('0x7a')]],'%s',_0x3dd0a3):_0x3dd0a3;_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x7c')]?_['replace'](_0x5d2bba[_0x2cbdd2[_0x101cbb][_0x5723('0x7c')]],'%s',_0x3dd0a3):_0x3dd0a3;if(_0x2cbdd2[_0x101cbb]['groupBy']){_0x4d259a['group'](_0x3dd0a3);}_0x2cbdd2[_0x101cbb][_0x5723('0x7d')]&&_0x4d259a['order'](_0x3dd0a3,_0x2cbdd2[_0x101cbb][_0x5723('0x7d')]===_0x5723('0x7e')?![]:!![]);_0x4d259a[_0x5723('0x6f')](_0x3dd0a3,_0x2cbdd2[_0x101cbb][_0x5723('0x7f')]||_0x3dd0a3);}if(_0x5bfe85[_0x5723('0x80')]){_0x5bfe85['joins']=JSON[_0x5723('0x81')](_0x5bfe85[_0x5723('0x80')]);for(var _0x36d80b=0x0;_0x36d80b<_0x5bfe85[_0x5723('0x80')][_0x5723('0x39')];_0x36d80b+=0x1){if(_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x31')]&&_[_0x5723('0x82')](_0x54c94c,_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x31')])&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x83')]&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x84')]&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x85')]){_0x4d259a[_0x5bfe85[_0x5723('0x80')][_0x36d80b]['type']](_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x84')],null,util['format'](_0x5723('0x86'),_0x5bfe85['table'],_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x83')],_0x5bfe85['joins'][_0x36d80b]['foreignTable'],_0x5bfe85[_0x5723('0x80')][_0x36d80b]['foreignKey']));}}}if(_0x5bfe85[_0x5723('0x87')]){_0x5bfe85[_0x5723('0x87')]=JSON[_0x5723('0x81')](_0x5bfe85[_0x5723('0x87')]);_0x4d259a[_0x5723('0x3e')](_0x6a61b3(_0x5bfe85['conditions']['group']));}_0x1951b5=_0x4d259a[_0x5723('0x88')]();_0x4d259a[_0x5723('0x1f')](_0x3d9613);_0x4d259a[_0x5723('0x1e')](0x0);logger[_0x5723('0x89')](_0x5723('0x8a'),_0x4d259a[_0x5723('0x8b')]());return dbH['sequelize'][_0x5723('0x34')](_0x4d259a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5723('0x8c')]});}})[_0x5723('0x26')](respondWithResult(_0x45b37d,null))['catch'](handleError(_0x45b37d,null));};function runReport(_0x18c056,_0xd3ff58,_0x1c2bf7){var _0x28e148=_0xd3ff58[_0x5723('0x2d')];var _0x577455=0xa;var _0x45b0f6=[_0x5723('0x5a'),_0x5723('0x8d'),'right_join',_0x5723('0x5b')];var _0x369218={'SUM':_0x5723('0x5c'),'COUNT':_0x5723('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5723('0x5f'),'MIN':'MIN(%s)','AVG':_0x5723('0x61'),'GROUP_CONCAT':_0x5723('0x8e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5723('0x8f')};var _0x122d3b={'SEC_TO_TIME':_0x5723('0x63'),'DATE':_0x5723('0x64'),'HOUR':_0x5723('0x65'),'ROUND':_0x5723('0x66'),'UNIX_TIMESTAMP':_0x5723('0x67')};var _0x59e0f7=function(_0x3b3866){return!_[_0x5723('0x82')]([_0x5723('0x68'),_0x5723('0x69'),'IS\x20EMPTY',_0x5723('0x6b')],_0x3b3866);};var _0x46469e=function(_0x25983b){if(!_0x25983b||!_0x25983b[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x4fe8db='(',_0x1e9860=0x0;_0x1e9860<_0x25983b[_0x5723('0x6c')]['length'];_0x1e9860+=0x1){_0x1e9860>0x0&&(_0x4fe8db+='\x20'+_0x25983b[_0x5723('0x6d')]+'\x20');_0x4fe8db+=_0x25983b[_0x5723('0x6c')][_0x1e9860][_0x5723('0x6e')]?_0x46469e(_0x25983b[_0x5723('0x6c')][_0x1e9860]['group']):_0x25983b[_0x5723('0x6c')][_0x1e9860]['field']+'\x20'+_0x25983b['rules'][_0x1e9860][_0x5723('0x90')]+(_0x59e0f7(_0x25983b['rules'][_0x1e9860][_0x5723('0x90')])?'\x20'+_0x25983b['rules'][_0x1e9860][_0x5723('0x70')]:'');}return _0x4fe8db+')';};var _0x41897f={'where':{'id':_0x18c056['id']}},_0x597c2a,_0x2c897a,_0x192218,_0x1fb757,_0x373143;_0x41897f=_[_0x5723('0x41')]({},_0x41897f,_0x1c2bf7);return db['AnalyticCustomReport'][_0x5723('0x4d')](_0x41897f)[_0x5723('0x26')](function(_0x3d03cb){if(_0x3d03cb){_0x597c2a=_0x3d03cb;return _0x3d03cb['getFields']();}return null;})[_0x5723('0x26')](function(_0x26dfad){if(_0x26dfad){if(!_0x26dfad[_0x5723('0x39')]){throw new db[(_0x5723('0x72'))][(_0x5723('0x73'))](_0x5723('0x74'),0x193);}_0x2c897a=_0x26dfad;return db['AnalyticMetric'][_0x5723('0x46')]({'raw':!![]});}return null;})[_0x5723('0x26')](function(_0x15d68d){if(_0x15d68d){_0x192218=_[_0x5723('0x91')](_0x15d68d,'id');var _0x563776;var _0x181e5b=squel[_0x5723('0x76')]();_0x181e5b[_0x5723('0x92')](_0x597c2a[_0x5723('0x77')]);for(var _0x1375bd=0x0;_0x1375bd<_0x2c897a['length'];_0x1375bd+=0x1){_0x563776=_0x2c897a[_0x1375bd]['MetricId']?_0x192218[_0x2c897a[_0x1375bd][_0x5723('0x78')]]['metric']:_0x2c897a[_0x1375bd]['field'];_0x563776=_0x2c897a[_0x1375bd][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x369218[_0x2c897a[_0x1375bd]['function']],'%s',_0x563776):_0x563776;_0x563776=_0x2c897a[_0x1375bd]['format']?_[_0x5723('0x7b')](_0x122d3b[_0x2c897a[_0x1375bd]['format']],'%s',_0x563776):_0x563776;if(_0x2c897a[_0x1375bd][_0x5723('0x93')]){_0x181e5b['group'](_0x563776);}_0x2c897a[_0x1375bd]['orderBy']&&_0x181e5b['order'](_0x563776,_0x2c897a[_0x1375bd][_0x5723('0x7d')]===_0x5723('0x7e')?![]:!![]);_0x181e5b[_0x5723('0x6f')](_0x563776,_0x2c897a[_0x1375bd][_0x5723('0x7f')]||_0x563776);}if(_0x597c2a['joins']){_0x597c2a[_0x5723('0x80')]=JSON['parse'](_0x597c2a[_0x5723('0x80')]);for(var _0xd3934a=0x0;_0xd3934a<_0x597c2a[_0x5723('0x80')]['length'];_0xd3934a+=0x1){if(_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')]&&_['includes'](_0x45b0f6,_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')])&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x83')]&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x84')]&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x85')]){_0x181e5b[_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')]](_0x597c2a['joins'][_0xd3934a][_0x5723('0x84')],null,util[_0x5723('0x7c')](_0x5723('0x86'),_0x597c2a['table'],_0x597c2a[_0x5723('0x80')][_0xd3934a]['parentKey'],_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x84')],_0x597c2a[_0x5723('0x80')][_0xd3934a]['foreignKey']));}}}if(_0x597c2a[_0x5723('0x87')]){_0x597c2a[_0x5723('0x87')]=JSON[_0x5723('0x81')](_0x597c2a[_0x5723('0x87')]);_0x181e5b[_0x5723('0x3e')](_0x46469e(_0x597c2a[_0x5723('0x87')][_0x5723('0x6e')]));}_0x373143=_0x181e5b['clone']();_0x181e5b[_0x5723('0x1f')](_0x577455);_0x181e5b[_0x5723('0x1e')](0x0);return;}})[_0x5723('0x26')](function(){if(_0xd3ff58[_0x5723('0x94')]==='web'){return null;}var _0x4c238f=_['merge'](_0xd3ff58,{'name':_0xd3ff58[_0x5723('0x95')]||_0xd3ff58['name']||_0x597c2a[_0x5723('0x2d')],'basename':_0x28e148,'savename':util[_0x5723('0x7c')](_0x5723('0x96'),_0xd3ff58[_0x5723('0x2d')]||_0x597c2a['name'],require(_0x5723('0x97'))[_0x5723('0x98')](0x4),_0xd3ff58['output']||_0x5723('0x99')),'reportId':_0x597c2a['id'],'reportType':_0x5723('0x9a')});return db[_0x5723('0x9b')]['create'](_0x4c238f,{'raw':!![]});})[_0x5723('0x26')](function(_0x3ebb57){if(_0x597c2a[_0x5723('0x77')]===_0x5723('0x9c')){_0x373143[_0x5723('0x3e')](_0x597c2a['table']+_0x5723('0x9d'),_0xd3ff58[_0x5723('0x9e')],_0xd3ff58[_0x5723('0x9f')]);}else{_0x373143[_0x5723('0x3e')](_0x597c2a[_0x5723('0x77')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xd3ff58[_0x5723('0x9e')],_0xd3ff58['endDate']);}if(_0x3ebb57){logger[_0x5723('0xa0')]('Run\x20Query:',_0x373143[_0x5723('0x8b')]());require(_0x5723('0xa1'))['fork'](path[_0x5723('0x5a')](__dirname,_0x5723('0xa2'),_0x3ebb57[_0x5723('0x94')]),[_0x3ebb57['id'],_0x373143[_0x5723('0x8b')](),path[_0x5723('0x5a')](__dirname,_0x5723('0xa3'),_0x3ebb57[_0x5723('0xa4')]),_0x28e148]);return _0x3ebb57;}else{var _0x2e6b07=squel[_0x5723('0x76')]();_0x2e6b07[_0x5723('0x92')]('('+_0x373143['toString']()+')',_0x5723('0xa5'));_0x2e6b07['field'](_0x5723('0xa6'),_0x5723('0x20'));_0x373143[_0x5723('0x1f')](_0xd3ff58[_0x5723('0x1f')]||_0x577455);_0x373143[_0x5723('0x1e')](_0xd3ff58[_0x5723('0x1e')]||0x0);return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x2e6b07[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')]['QueryTypes']['SELECT']})[_0x5723('0x26')](function(_0x2176a4){if(!_0x2176a4[_0x5723('0x39')]){_0x1fb757=0x0;}else{_0x1fb757=_0x2176a4[0x0][_0x5723('0x20')]||0x0;}return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x373143[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')][_0x5723('0xa8')][_0x5723('0x8c')]});})[_0x5723('0x26')](function(_0xdf28d){return{'rows':_0xdf28d||[],'count':_0x1fb757};});}});}exports['run']=function(_0x1d5c99,_0x42bd1a){return runReport(_0x1d5c99[_0x5723('0x49')],_0x1d5c99[_0x5723('0x34')],_0x1d5c99['options'])[_0x5723('0x26')](respondWithResult(_0x42bd1a,null))['catch'](handleError(_0x42bd1a,null));};exports[_0x5723('0xa9')]=runReport;exports[_0x5723('0x34')]=function(_0x47b801,_0xbd1f26){var _0x45f92d=0xa;var _0x5a0ebb=[_0x5723('0x5a'),_0x5723('0x8d'),_0x5723('0xaa'),_0x5723('0x5b')];var _0x54e981={'SUM':_0x5723('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5723('0x5f'),'MIN':_0x5723('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5723('0x8e'),'GROUP_CONCAT ASC':_0x5723('0x62'),'GROUP_CONCAT DESC':_0x5723('0x8f')};var _0xffeddd={'SEC_TO_TIME':_0x5723('0x63'),'DATE':'DATE(%s)','HOUR':_0x5723('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5723('0x67')};var _0x1e8402=function(_0x3ac53d){return!_[_0x5723('0x82')]([_0x5723('0x68'),'IS\x20NOT\x20NULL',_0x5723('0x6a'),'IS\x20NOT\x20EMPTY'],_0x3ac53d);};var _0x203c9d=function(_0x29da22){if(!_0x29da22||!_0x29da22[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x18ed66='(',_0x21e997=0x0;_0x21e997<_0x29da22[_0x5723('0x6c')][_0x5723('0x39')];_0x21e997+=0x1){_0x21e997>0x0&&(_0x18ed66+='\x20'+_0x29da22[_0x5723('0x6d')]+'\x20');_0x18ed66+=_0x29da22['rules'][_0x21e997][_0x5723('0x6e')]?_0x203c9d(_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x6e')]):_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x6f')]+'\x20'+_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x90')]+(_0x1e8402(_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x90')])?'\x20'+_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x70')]:'');}return _0x18ed66+')';};var _0x5915eb={'where':{'id':_0x47b801[_0x5723('0x49')]['id']}},_0x1bfe29,_0x2996cb,_0x57edae,_0x471df2,_0x1f8d9b;_0x5915eb=_['merge']({},_0x5915eb,_0x47b801['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x5915eb)[_0x5723('0x26')](function(_0x43abe3){if(_0x43abe3){_0x1bfe29=_0x43abe3;return _0x43abe3['getFields']();}return null;})[_0x5723('0x26')](function(_0x1e3bd4){if(_0x1e3bd4){if(!_0x1e3bd4['length']){throw new db[(_0x5723('0x72'))]['ValidationErrorItem'](_0x5723('0x74'),0x193);}_0x2996cb=_0x1e3bd4;return db[_0x5723('0x75')][_0x5723('0x46')]({'raw':!![]});}return null;})['then'](function(_0x40656d){if(_0x40656d){_0x57edae=_['keyBy'](_0x40656d,'id');var _0x5e57c7;var _0x123034=squel['select']();_0x123034[_0x5723('0x92')](_0x1bfe29[_0x5723('0x77')]);for(var _0xa79251=0x0;_0xa79251<_0x2996cb['length'];_0xa79251+=0x1){_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x78')]?_0x57edae[_0x2996cb[_0xa79251][_0x5723('0x78')]][_0x5723('0x79')]:_0x2996cb[_0xa79251]['field'];_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x54e981[_0x2996cb[_0xa79251][_0x5723('0x7a')]],'%s',_0x5e57c7):_0x5e57c7;_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x7c')]?_[_0x5723('0x7b')](_0xffeddd[_0x2996cb[_0xa79251][_0x5723('0x7c')]],'%s',_0x5e57c7):_0x5e57c7;if(_0x2996cb[_0xa79251][_0x5723('0x93')]){_0x123034['group'](_0x5e57c7);}_0x2996cb[_0xa79251][_0x5723('0x7d')]&&_0x123034[_0x5723('0x3c')](_0x5e57c7,_0x2996cb[_0xa79251]['orderBy']==='DESC'?![]:!![]);_0x123034[_0x5723('0x6f')](_0x5e57c7,_0x2996cb[_0xa79251][_0x5723('0x7f')]||_0x5e57c7);}if(_0x1bfe29[_0x5723('0x80')]){_0x1bfe29[_0x5723('0x80')]=JSON['parse'](_0x1bfe29[_0x5723('0x80')]);for(var _0x1b146e=0x0;_0x1b146e<_0x1bfe29['joins'][_0x5723('0x39')];_0x1b146e+=0x1){if(_0x1bfe29['joins'][_0x1b146e][_0x5723('0x31')]&&_['includes'](_0x5a0ebb,_0x1bfe29[_0x5723('0x80')][_0x1b146e]['type'])&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x83')]&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x84')]&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x85')]){_0x123034[_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x31')]](_0x1bfe29['joins'][_0x1b146e]['foreignTable'],null,util[_0x5723('0x7c')](_0x5723('0x86'),_0x1bfe29['table'],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x83')],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x84')],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x85')]));}}}if(_0x1bfe29[_0x5723('0x87')]){_0x1bfe29['conditions']=JSON[_0x5723('0x81')](_0x1bfe29['conditions']);_0x123034[_0x5723('0x3e')](_0x203c9d(_0x1bfe29['conditions'][_0x5723('0x6e')]));}_0x1f8d9b=_0x123034[_0x5723('0x88')]();_0x123034[_0x5723('0x1f')](_0x45f92d);_0x123034['offset'](0x0);logger[_0x5723('0x89')]('Limited\x20Query:',_0x123034[_0x5723('0x8b')]());return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x123034[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')][_0x5723('0xa8')][_0x5723('0x8c')]});}})[_0x5723('0x26')](function(){return{'sql':_0x1f8d9b[_0x5723('0x8b')]()};})['then'](respondWithResult(_0xbd1f26,null))[_0x5723('0x47')](handleError(_0xbd1f26,null));}; \ No newline at end of file +var _0xdab8=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','then','include','findAll','rows','catch','show','params','keys','AnalyticCustomReport','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','table','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','function','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','left_join','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4d88f6,_0x52f758){var _0x2041c8=function(_0x16f556){while(--_0x16f556){_0x4d88f6['push'](_0x4d88f6['shift']());}};_0x2041c8(++_0x52f758);}(_0xdab8,0x1eb));var _0x8dab=function(_0x22d451,_0x3f0d67){_0x22d451=_0x22d451-0x0;var _0x3651ff=_0xdab8[_0x22d451];return _0x3651ff;};'use strict';var emlformat=require(_0x8dab('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8dab('0x1'));var rp=require(_0x8dab('0x2'));var moment=require(_0x8dab('0x3'));var BPromise=require(_0x8dab('0x4'));var Mustache=require('mustache');var util=require(_0x8dab('0x5'));var path=require('path');var sox=require(_0x8dab('0x6'));var csv=require(_0x8dab('0x7'));var ejs=require(_0x8dab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8dab('0x9'));var squel=require('squel');var crypto=require(_0x8dab('0xa'));var jsforce=require(_0x8dab('0xb'));var deskjs=require(_0x8dab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8dab('0xd'));var Papa=require(_0x8dab('0xe'));var Redis=require(_0x8dab('0xf'));var authService=require(_0x8dab('0x10'));var qs=require(_0x8dab('0x11'));var as=require(_0x8dab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8dab('0x13'))(_0x8dab('0x14'));var utils=require(_0x8dab('0x15'));var config=require(_0x8dab('0x16'));var licenseUtil=require(_0x8dab('0x17'));var db=require(_0x8dab('0x18'))['db'];var dbH=require(_0x8dab('0x18'))[_0x8dab('0x19')];function respondWithStatusCode(_0x303e5c,_0x152512){_0x152512=_0x152512||0xcc;return function(_0x3c6c8a){if(_0x3c6c8a){return _0x303e5c['sendStatus'](_0x152512);}return _0x303e5c[_0x8dab('0x1a')](_0x152512)[_0x8dab('0x1b')]();};}function respondWithResult(_0x27321b,_0x52ecd8){_0x52ecd8=_0x52ecd8||0xc8;return function(_0x8e1790){if(_0x8e1790){return _0x27321b['status'](_0x52ecd8)['json'](_0x8e1790);}};}function respondWithFilteredResult(_0x1e702d,_0x2f4e53){return function(_0x41ce74){if(_0x41ce74){var _0x5761c9=typeof _0x2f4e53['offset']===_0x8dab('0x1c')&&typeof _0x2f4e53[_0x8dab('0x1d')]===_0x8dab('0x1c');var _0x29c432=_0x41ce74[_0x8dab('0x1e')];var _0x5dc298=_0x5761c9?0x0:_0x2f4e53[_0x8dab('0x1f')];var _0x3849e7=_0x5761c9?_0x41ce74[_0x8dab('0x1e')]:_0x2f4e53['offset']+_0x2f4e53['limit'];var _0x44daa3;if(_0x3849e7>=_0x29c432){_0x3849e7=_0x29c432;_0x44daa3=0xc8;}else{_0x44daa3=0xce;}_0x1e702d[_0x8dab('0x1a')](_0x44daa3);return _0x1e702d[_0x8dab('0x20')](_0x8dab('0x21'),_0x5dc298+'-'+_0x3849e7+'/'+_0x29c432)[_0x8dab('0x22')](_0x41ce74);}return null;};}function patchUpdates(_0x2935a0){return function(_0x58a6f8){try{jsonpatch[_0x8dab('0x23')](_0x58a6f8,_0x2935a0,!![]);}catch(_0x4b412c){return BPromise['reject'](_0x4b412c);}return _0x58a6f8[_0x8dab('0x24')]();};}function saveUpdates(_0x1ccee2,_0x12306f){return function(_0x4516d7){if(_0x4516d7){return _0x4516d7[_0x8dab('0x25')](_0x1ccee2)['then'](function(_0x33129a){return _0x33129a;});}return null;};}function removeEntity(_0x30a917,_0x16cf58){return function(_0x1da6b1){if(_0x1da6b1){return _0x1da6b1[_0x8dab('0x26')]()['then'](function(){var _0x196c63=_0x1da6b1['get']({'plain':!![]});var _0x3fdea3='CustomReports';return db['UserProfileResource'][_0x8dab('0x26')]({'where':{'type':_0x3fdea3,'resourceId':_0x196c63['id']}})['then'](function(){return _0x1da6b1;});})['then'](function(){_0x30a917[_0x8dab('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x535108,_0x32dd99){return function(_0x5fdb7f){if(!_0x5fdb7f){_0x535108[_0x8dab('0x27')](0x194);}return _0x5fdb7f;};}function handleError(_0x4294cb,_0x1a455c){_0x1a455c=_0x1a455c||0x1f4;return function(_0x380362){logger['error'](_0x380362[_0x8dab('0x28')]);if(_0x380362[_0x8dab('0x29')]){delete _0x380362[_0x8dab('0x29')];}_0x4294cb[_0x8dab('0x1a')](_0x1a455c)[_0x8dab('0x2a')](_0x380362);};}exports[_0x8dab('0x2b')]=function(_0x5f74b1,_0x58d889){var _0x13ac4c={},_0x55d16d={},_0x2f0d38={'count':0x0,'rows':[]};var _0x3b3529=_[_0x8dab('0x2c')](db['AnalyticCustomReport'][_0x8dab('0x2d')],function(_0x28c5aa){return{'name':_0x28c5aa[_0x8dab('0x2e')],'type':_0x28c5aa[_0x8dab('0x2f')][_0x8dab('0x30')]};});_0x55d16d[_0x8dab('0x31')]=_['map'](_0x3b3529,_0x8dab('0x29'));_0x55d16d[_0x8dab('0x32')]=_['keys'](_0x5f74b1['query']);_0x55d16d[_0x8dab('0x33')]=_[_0x8dab('0x34')](_0x55d16d['model'],_0x55d16d[_0x8dab('0x32')]);_0x13ac4c[_0x8dab('0x35')]=_[_0x8dab('0x34')](_0x55d16d['model'],qs[_0x8dab('0x36')](_0x5f74b1['query'][_0x8dab('0x36')]));_0x13ac4c[_0x8dab('0x35')]=_0x13ac4c[_0x8dab('0x35')][_0x8dab('0x37')]?_0x13ac4c[_0x8dab('0x35')]:_0x55d16d[_0x8dab('0x31')];if(!_0x5f74b1[_0x8dab('0x32')][_0x8dab('0x38')]('nolimit')){_0x13ac4c[_0x8dab('0x1d')]=qs[_0x8dab('0x1d')](_0x5f74b1[_0x8dab('0x32')][_0x8dab('0x1d')]);_0x13ac4c[_0x8dab('0x1f')]=qs['offset'](_0x5f74b1[_0x8dab('0x32')]['offset']);}_0x13ac4c['order']=qs[_0x8dab('0x39')](_0x5f74b1[_0x8dab('0x32')][_0x8dab('0x39')]);_0x13ac4c[_0x8dab('0x3a')]=qs[_0x8dab('0x33')](_['pick'](_0x5f74b1['query'],_0x55d16d['filters']),_0x3b3529);if(_0x5f74b1[_0x8dab('0x32')][_0x8dab('0x3b')]){_0x13ac4c[_0x8dab('0x3a')]=_[_0x8dab('0x3c')](_0x13ac4c['where'],{'$or':_['map'](_0x3b3529,function(_0x3b9bb3){if(_0x3b9bb3[_0x8dab('0x2f')]!==_0x8dab('0x3d')){var _0x5ee265={};_0x5ee265[_0x3b9bb3[_0x8dab('0x29')]]={'$like':'%'+_0x5f74b1['query']['filter']+'%'};return _0x5ee265;}})});}_0x13ac4c=_[_0x8dab('0x3c')]({},_0x13ac4c,_0x5f74b1['options']);var _0x3694f5={'where':_0x13ac4c[_0x8dab('0x3a')]};return db['AnalyticCustomReport'][_0x8dab('0x1e')](_0x3694f5)[_0x8dab('0x3e')](function(_0x1e13e8){_0x2f0d38[_0x8dab('0x1e')]=_0x1e13e8;if(_0x5f74b1[_0x8dab('0x32')]['includeAll']){_0x13ac4c[_0x8dab('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x8dab('0x40')](_0x13ac4c);})['then'](function(_0x56afc6){_0x2f0d38[_0x8dab('0x41')]=_0x56afc6;return _0x2f0d38;})[_0x8dab('0x3e')](respondWithFilteredResult(_0x58d889,_0x13ac4c))[_0x8dab('0x42')](handleError(_0x58d889,null));};exports[_0x8dab('0x43')]=function(_0x490227,_0x23a297){var _0x32e819={'raw':![],'where':{'id':_0x490227[_0x8dab('0x44')]['id']}},_0x148f8c={};_0x148f8c[_0x8dab('0x31')]=_[_0x8dab('0x45')](db[_0x8dab('0x46')][_0x8dab('0x2d')]);_0x148f8c[_0x8dab('0x32')]=_[_0x8dab('0x45')](_0x490227[_0x8dab('0x32')]);_0x148f8c['filters']=_[_0x8dab('0x34')](_0x148f8c[_0x8dab('0x31')],_0x148f8c[_0x8dab('0x32')]);_0x32e819['attributes']=_[_0x8dab('0x34')](_0x148f8c[_0x8dab('0x31')],qs[_0x8dab('0x36')](_0x490227[_0x8dab('0x32')][_0x8dab('0x36')]));_0x32e819[_0x8dab('0x35')]=_0x32e819[_0x8dab('0x35')][_0x8dab('0x37')]?_0x32e819[_0x8dab('0x35')]:_0x148f8c[_0x8dab('0x31')];if(_0x490227[_0x8dab('0x32')][_0x8dab('0x47')]){_0x32e819[_0x8dab('0x3f')]=[{'all':!![]}];}_0x32e819=_[_0x8dab('0x3c')]({},_0x32e819,_0x490227['options']);return db[_0x8dab('0x46')][_0x8dab('0x48')](_0x32e819)[_0x8dab('0x3e')](handleEntityNotFound(_0x23a297,null))[_0x8dab('0x3e')](respondWithResult(_0x23a297,null))['catch'](handleError(_0x23a297,null));};exports[_0x8dab('0x49')]=function(_0x3380ef,_0x509dff){return db['AnalyticCustomReport'][_0x8dab('0x49')](_0x3380ef[_0x8dab('0x4a')],{})['then'](function(_0x4f4632){var _0x2bac11=_0x3380ef[_0x8dab('0x4b')][_0x8dab('0x4c')]({'plain':!![]});if(!_0x2bac11)throw new Error(_0x8dab('0x4d'));if(_0x2bac11[_0x8dab('0x4e')]===_0x8dab('0x4b')){var _0x15629e=_0x4f4632[_0x8dab('0x4c')]({'plain':!![]});var _0x4fa6da=_0x8dab('0x4f');return db[_0x8dab('0x50')][_0x8dab('0x48')]({'where':{'name':_0x4fa6da,'userProfileId':_0x2bac11[_0x8dab('0x51')]},'raw':!![]})[_0x8dab('0x3e')](function(_0x27db4c){if(_0x27db4c&&_0x27db4c[_0x8dab('0x52')]===0x0){return db[_0x8dab('0x53')][_0x8dab('0x49')]({'name':_0x15629e[_0x8dab('0x29')],'resourceId':_0x15629e['id'],'type':_0x8dab('0x54'),'sectionId':_0x27db4c['id']},{})['then'](function(){return _0x4f4632;});}else{return _0x4f4632;}})[_0x8dab('0x42')](function(_0x4c0c2b){logger['error'](_0x8dab('0x55'),_0x4c0c2b);throw _0x4c0c2b;});}return _0x4f4632;})[_0x8dab('0x3e')](respondWithResult(_0x509dff,0xc9))[_0x8dab('0x42')](handleError(_0x509dff,null));};exports[_0x8dab('0x25')]=function(_0x463c5f,_0x438ab4){if(_0x463c5f[_0x8dab('0x4a')]['id']){delete _0x463c5f[_0x8dab('0x4a')]['id'];}return db[_0x8dab('0x46')][_0x8dab('0x48')]({'where':{'id':_0x463c5f[_0x8dab('0x44')]['id']}})['then'](handleEntityNotFound(_0x438ab4,null))[_0x8dab('0x3e')](saveUpdates(_0x463c5f['body'],null))[_0x8dab('0x3e')](respondWithResult(_0x438ab4,null))[_0x8dab('0x42')](handleError(_0x438ab4,null));};exports[_0x8dab('0x26')]=function(_0x14a049,_0x55f94c){return db[_0x8dab('0x46')]['find']({'where':{'id':_0x14a049[_0x8dab('0x44')]['id']}})[_0x8dab('0x3e')](handleEntityNotFound(_0x55f94c,null))['then'](removeEntity(_0x55f94c,null))['catch'](handleError(_0x55f94c,null));};exports[_0x8dab('0x56')]=function(_0x4aebdc,_0x1325cd){var _0x2324af=0xa;var _0x1e3364=[_0x8dab('0x57'),'left_join','right_join',_0x8dab('0x58')];var _0xba9b6={'SUM':_0x8dab('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x8dab('0x5a'),'AVG':_0x8dab('0x5b'),'GROUP_CONCAT':_0x8dab('0x5c'),'GROUP_CONCAT ASC':_0x8dab('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25d87a={'SEC_TO_TIME':_0x8dab('0x5e'),'DATE':_0x8dab('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x8dab('0x60'),'UNIX_TIMESTAMP':_0x8dab('0x61')};var _0x57cbdb=function(_0x2efcb4){return!_[_0x8dab('0x62')](['IS\x20NULL',_0x8dab('0x63'),_0x8dab('0x64'),_0x8dab('0x65')],_0x2efcb4);};var _0x19e297=function(_0x48fdb7){if(!_0x48fdb7||!_0x48fdb7[_0x8dab('0x66')][_0x8dab('0x37')]){return'';}for(var _0x4564dc='(',_0x1fddf1=0x0;_0x1fddf1<_0x48fdb7[_0x8dab('0x66')]['length'];_0x1fddf1+=0x1){_0x1fddf1>0x0&&(_0x4564dc+='\x20'+_0x48fdb7[_0x8dab('0x67')]+'\x20');_0x4564dc+=_0x48fdb7[_0x8dab('0x66')][_0x1fddf1][_0x8dab('0x68')]?_0x19e297(_0x48fdb7['rules'][_0x1fddf1][_0x8dab('0x68')]):_0x48fdb7['rules'][_0x1fddf1][_0x8dab('0x69')]+'\x20'+_0x48fdb7[_0x8dab('0x66')][_0x1fddf1][_0x8dab('0x6a')]+(_0x57cbdb(_0x48fdb7[_0x8dab('0x66')][_0x1fddf1][_0x8dab('0x6a')])?'\x20'+_0x48fdb7[_0x8dab('0x66')][_0x1fddf1][_0x8dab('0x6b')]:'');}return _0x4564dc+')';};var _0x2f54c8={'where':{'id':_0x4aebdc[_0x8dab('0x44')]['id']}},_0x43c421,_0x5ed077,_0x1f43fc,_0x2d11cb,_0x2f10cc;_0x2f54c8=_[_0x8dab('0x3c')]({},_0x2f54c8,_0x4aebdc[_0x8dab('0x6c')]);return db[_0x8dab('0x46')][_0x8dab('0x48')](_0x2f54c8)[_0x8dab('0x3e')](function(_0x186992){if(_0x186992){_0x43c421=_0x186992;return _0x186992[_0x8dab('0x6d')]();}return null;})['then'](function(_0x5e2fcf){if(_0x5e2fcf){if(!_0x5e2fcf[_0x8dab('0x37')]){throw new db[(_0x8dab('0x6e'))][(_0x8dab('0x6f'))](_0x8dab('0x70'),0x193);}_0x5ed077=_0x5e2fcf;return db[_0x8dab('0x71')][_0x8dab('0x40')]({'raw':!![]});}return null;})[_0x8dab('0x3e')](function(_0x8de83f){if(_0x8de83f){_0x1f43fc=_[_0x8dab('0x72')](_0x8de83f,'id');var _0x43cc2b;var _0xfbd338=squel[_0x8dab('0x73')]();_0xfbd338[_0x8dab('0x74')](_0x43c421['table']);for(var _0x7bcaf7=0x0;_0x7bcaf7<_0x5ed077[_0x8dab('0x37')];_0x7bcaf7+=0x1){_0x43cc2b=_0x5ed077[_0x7bcaf7][_0x8dab('0x75')]?_0x1f43fc[_0x5ed077[_0x7bcaf7]['MetricId']][_0x8dab('0x76')]:_0x5ed077[_0x7bcaf7][_0x8dab('0x69')];_0x43cc2b=_0x5ed077[_0x7bcaf7]['function']?_[_0x8dab('0x77')](_0xba9b6[_0x5ed077[_0x7bcaf7]['function']],'%s',_0x43cc2b):_0x43cc2b;_0x43cc2b=_0x5ed077[_0x7bcaf7][_0x8dab('0x78')]?_['replace'](_0x25d87a[_0x5ed077[_0x7bcaf7][_0x8dab('0x78')]],'%s',_0x43cc2b):_0x43cc2b;if(_0x5ed077[_0x7bcaf7][_0x8dab('0x79')]){_0xfbd338['group'](_0x43cc2b);}_0x5ed077[_0x7bcaf7][_0x8dab('0x7a')]&&_0xfbd338[_0x8dab('0x7b')](_0x43cc2b,_0x5ed077[_0x7bcaf7][_0x8dab('0x7a')]===_0x8dab('0x7c')?![]:!![]);_0xfbd338['field'](_0x43cc2b,_0x5ed077[_0x7bcaf7][_0x8dab('0x7d')]||_0x43cc2b);}if(_0x43c421[_0x8dab('0x7e')]){_0x43c421[_0x8dab('0x7e')]=JSON[_0x8dab('0x7f')](_0x43c421[_0x8dab('0x7e')]);for(var _0x5f2446=0x0;_0x5f2446<_0x43c421[_0x8dab('0x7e')]['length'];_0x5f2446+=0x1){if(_0x43c421[_0x8dab('0x7e')][_0x5f2446][_0x8dab('0x2f')]&&_[_0x8dab('0x62')](_0x1e3364,_0x43c421[_0x8dab('0x7e')][_0x5f2446][_0x8dab('0x2f')])&&_0x43c421[_0x8dab('0x7e')][_0x5f2446][_0x8dab('0x80')]&&_0x43c421['joins'][_0x5f2446]['foreignTable']&&_0x43c421[_0x8dab('0x7e')][_0x5f2446][_0x8dab('0x81')]){_0xfbd338[_0x43c421[_0x8dab('0x7e')][_0x5f2446]['type']](_0x43c421[_0x8dab('0x7e')][_0x5f2446][_0x8dab('0x82')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x43c421[_0x8dab('0x83')],_0x43c421[_0x8dab('0x7e')][_0x5f2446][_0x8dab('0x80')],_0x43c421[_0x8dab('0x7e')][_0x5f2446]['foreignTable'],_0x43c421['joins'][_0x5f2446][_0x8dab('0x81')]));}}}if(_0x43c421[_0x8dab('0x84')]){_0x43c421[_0x8dab('0x84')]=JSON[_0x8dab('0x7f')](_0x43c421[_0x8dab('0x84')]);_0xfbd338[_0x8dab('0x3a')](_0x19e297(_0x43c421['conditions'][_0x8dab('0x68')]));}_0x2f10cc=_0xfbd338[_0x8dab('0x85')]();_0xfbd338[_0x8dab('0x1d')](_0x2324af);_0xfbd338[_0x8dab('0x1f')](0x0);logger['debug'](_0x8dab('0x86'),_0xfbd338[_0x8dab('0x87')]());return dbH[_0x8dab('0x88')]['query'](_0xfbd338[_0x8dab('0x87')](),{'type':dbH[_0x8dab('0x88')][_0x8dab('0x89')][_0x8dab('0x8a')]});}})[_0x8dab('0x3e')](respondWithResult(_0x1325cd,null))[_0x8dab('0x42')](handleError(_0x1325cd,null));};function runReport(_0x373684,_0x24b6c0,_0x5d96b7){var _0x4d3f71=_0x24b6c0[_0x8dab('0x29')];var _0x3df210=0xa;var _0x15736d=['join','left_join',_0x8dab('0x8b'),_0x8dab('0x58')];var _0x521f04={'SUM':'SUM(%s)','COUNT':_0x8dab('0x8c'),'COUNT DISTINCT':_0x8dab('0x8d'),'MAX':_0x8dab('0x8e'),'MIN':_0x8dab('0x5a'),'AVG':_0x8dab('0x5b'),'GROUP_CONCAT':_0x8dab('0x5c'),'GROUP_CONCAT ASC':_0x8dab('0x5d'),'GROUP_CONCAT DESC':_0x8dab('0x8f')};var _0x51a571={'SEC_TO_TIME':_0x8dab('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x8dab('0x60'),'UNIX_TIMESTAMP':_0x8dab('0x61')};var _0x3ece3a=function(_0x2947cd){return!_[_0x8dab('0x62')]([_0x8dab('0x90'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2947cd);};var _0x3b891e=function(_0x36161a){if(!_0x36161a||!_0x36161a[_0x8dab('0x66')][_0x8dab('0x37')]){return'';}for(var _0x2fb074='(',_0x3f590f=0x0;_0x3f590f<_0x36161a[_0x8dab('0x66')][_0x8dab('0x37')];_0x3f590f+=0x1){_0x3f590f>0x0&&(_0x2fb074+='\x20'+_0x36161a[_0x8dab('0x67')]+'\x20');_0x2fb074+=_0x36161a['rules'][_0x3f590f][_0x8dab('0x68')]?_0x3b891e(_0x36161a[_0x8dab('0x66')][_0x3f590f][_0x8dab('0x68')]):_0x36161a[_0x8dab('0x66')][_0x3f590f][_0x8dab('0x69')]+'\x20'+_0x36161a[_0x8dab('0x66')][_0x3f590f][_0x8dab('0x6a')]+(_0x3ece3a(_0x36161a[_0x8dab('0x66')][_0x3f590f][_0x8dab('0x6a')])?'\x20'+_0x36161a[_0x8dab('0x66')][_0x3f590f]['value']:'');}return _0x2fb074+')';};var _0x59c173={'where':{'id':_0x373684['id']}},_0x8117f4,_0x396fe1,_0x459135,_0x2f4773,_0x3cc339;_0x59c173=_[_0x8dab('0x3c')]({},_0x59c173,_0x5d96b7);return db['AnalyticCustomReport'][_0x8dab('0x48')](_0x59c173)[_0x8dab('0x3e')](function(_0x49517e){if(_0x49517e){_0x8117f4=_0x49517e;return _0x49517e['getFields']();}return null;})['then'](function(_0x45a7c6){if(_0x45a7c6){if(!_0x45a7c6[_0x8dab('0x37')]){throw new db[(_0x8dab('0x6e'))][(_0x8dab('0x6f'))](_0x8dab('0x70'),0x193);}_0x396fe1=_0x45a7c6;return db[_0x8dab('0x71')][_0x8dab('0x40')]({'raw':!![]});}return null;})[_0x8dab('0x3e')](function(_0x12118f){if(_0x12118f){_0x459135=_['keyBy'](_0x12118f,'id');var _0x3ef614;var _0xee35bf=squel[_0x8dab('0x73')]();_0xee35bf['from'](_0x8117f4[_0x8dab('0x83')]);for(var _0x3bf597=0x0;_0x3bf597<_0x396fe1['length'];_0x3bf597+=0x1){_0x3ef614=_0x396fe1[_0x3bf597][_0x8dab('0x75')]?_0x459135[_0x396fe1[_0x3bf597][_0x8dab('0x75')]]['metric']:_0x396fe1[_0x3bf597][_0x8dab('0x69')];_0x3ef614=_0x396fe1[_0x3bf597][_0x8dab('0x91')]?_[_0x8dab('0x77')](_0x521f04[_0x396fe1[_0x3bf597][_0x8dab('0x91')]],'%s',_0x3ef614):_0x3ef614;_0x3ef614=_0x396fe1[_0x3bf597][_0x8dab('0x78')]?_[_0x8dab('0x77')](_0x51a571[_0x396fe1[_0x3bf597][_0x8dab('0x78')]],'%s',_0x3ef614):_0x3ef614;if(_0x396fe1[_0x3bf597][_0x8dab('0x79')]){_0xee35bf[_0x8dab('0x68')](_0x3ef614);}_0x396fe1[_0x3bf597][_0x8dab('0x7a')]&&_0xee35bf[_0x8dab('0x7b')](_0x3ef614,_0x396fe1[_0x3bf597][_0x8dab('0x7a')]==='DESC'?![]:!![]);_0xee35bf[_0x8dab('0x69')](_0x3ef614,_0x396fe1[_0x3bf597][_0x8dab('0x7d')]||_0x3ef614);}if(_0x8117f4[_0x8dab('0x7e')]){_0x8117f4[_0x8dab('0x7e')]=JSON[_0x8dab('0x7f')](_0x8117f4[_0x8dab('0x7e')]);for(var _0x34d70=0x0;_0x34d70<_0x8117f4[_0x8dab('0x7e')][_0x8dab('0x37')];_0x34d70+=0x1){if(_0x8117f4[_0x8dab('0x7e')][_0x34d70]['type']&&_[_0x8dab('0x62')](_0x15736d,_0x8117f4[_0x8dab('0x7e')][_0x34d70][_0x8dab('0x2f')])&&_0x8117f4['joins'][_0x34d70][_0x8dab('0x80')]&&_0x8117f4[_0x8dab('0x7e')][_0x34d70]['foreignTable']&&_0x8117f4[_0x8dab('0x7e')][_0x34d70][_0x8dab('0x81')]){_0xee35bf[_0x8117f4[_0x8dab('0x7e')][_0x34d70][_0x8dab('0x2f')]](_0x8117f4[_0x8dab('0x7e')][_0x34d70]['foreignTable'],null,util[_0x8dab('0x78')](_0x8dab('0x92'),_0x8117f4[_0x8dab('0x83')],_0x8117f4[_0x8dab('0x7e')][_0x34d70][_0x8dab('0x80')],_0x8117f4[_0x8dab('0x7e')][_0x34d70][_0x8dab('0x82')],_0x8117f4[_0x8dab('0x7e')][_0x34d70]['foreignKey']));}}}if(_0x8117f4[_0x8dab('0x84')]){_0x8117f4[_0x8dab('0x84')]=JSON[_0x8dab('0x7f')](_0x8117f4[_0x8dab('0x84')]);_0xee35bf[_0x8dab('0x3a')](_0x3b891e(_0x8117f4[_0x8dab('0x84')][_0x8dab('0x68')]));}_0x3cc339=_0xee35bf[_0x8dab('0x85')]();_0xee35bf[_0x8dab('0x1d')](_0x3df210);_0xee35bf[_0x8dab('0x1f')](0x0);return;}})[_0x8dab('0x3e')](function(){if(_0x24b6c0[_0x8dab('0x93')]===_0x8dab('0x94')){return null;}var _0x24eda2=_[_0x8dab('0x3c')](_0x24b6c0,{'name':_0x24b6c0[_0x8dab('0x95')]||_0x24b6c0[_0x8dab('0x29')]||_0x8117f4[_0x8dab('0x29')],'basename':_0x4d3f71,'savename':util[_0x8dab('0x78')](_0x8dab('0x96'),_0x24b6c0['name']||_0x8117f4[_0x8dab('0x29')],require(_0x8dab('0x97'))[_0x8dab('0x98')](0x4),_0x24b6c0['output']||_0x8dab('0x99')),'reportId':_0x8117f4['id'],'reportType':_0x8dab('0x9a')});return db[_0x8dab('0x9b')][_0x8dab('0x49')](_0x24eda2,{'raw':!![]});})['then'](function(_0x225112){if(_0x8117f4[_0x8dab('0x83')]==='cdr'){_0x3cc339['where'](_0x8117f4['table']+_0x8dab('0x9c'),_0x24b6c0[_0x8dab('0x9d')],_0x24b6c0[_0x8dab('0x9e')]);}else{_0x3cc339['where'](_0x8117f4[_0x8dab('0x83')]+_0x8dab('0x9f'),_0x24b6c0[_0x8dab('0x9d')],_0x24b6c0[_0x8dab('0x9e')]);}if(_0x225112){logger[_0x8dab('0xa0')](_0x8dab('0xa1'),_0x3cc339[_0x8dab('0x87')]());require(_0x8dab('0xa2'))['fork'](path[_0x8dab('0x57')](__dirname,_0x8dab('0xa3'),_0x225112['output']),[_0x225112['id'],_0x3cc339[_0x8dab('0x87')](),path[_0x8dab('0x57')](__dirname,_0x8dab('0xa4'),_0x225112[_0x8dab('0xa5')]),_0x4d3f71]);return _0x225112;}else{var _0x31a3da=squel['select']();_0x31a3da['from']('('+_0x3cc339[_0x8dab('0x87')]()+')','countTable');_0x31a3da[_0x8dab('0x69')](_0x8dab('0xa6'),_0x8dab('0x1e'));_0x3cc339['limit'](_0x24b6c0[_0x8dab('0x1d')]||_0x3df210);_0x3cc339[_0x8dab('0x1f')](_0x24b6c0[_0x8dab('0x1f')]||0x0);return dbH[_0x8dab('0x88')][_0x8dab('0x32')](_0x31a3da[_0x8dab('0x87')](),{'type':dbH[_0x8dab('0x88')]['QueryTypes'][_0x8dab('0x8a')]})[_0x8dab('0x3e')](function(_0x4a2177){if(!_0x4a2177[_0x8dab('0x37')]){_0x2f4773=0x0;}else{_0x2f4773=_0x4a2177[0x0][_0x8dab('0x1e')]||0x0;}return dbH[_0x8dab('0x88')]['query'](_0x3cc339['toString'](),{'type':dbH['sequelize'][_0x8dab('0x89')][_0x8dab('0x8a')]});})[_0x8dab('0x3e')](function(_0x5e23be){return{'rows':_0x5e23be||[],'count':_0x2f4773};});}});}exports[_0x8dab('0xa7')]=function(_0x1beb7e,_0x271925){return runReport(_0x1beb7e['params'],_0x1beb7e[_0x8dab('0x32')],_0x1beb7e[_0x8dab('0x6c')])[_0x8dab('0x3e')](respondWithResult(_0x271925,null))[_0x8dab('0x42')](handleError(_0x271925,null));};exports[_0x8dab('0xa8')]=runReport;exports['query']=function(_0xa7415f,_0x278421){var _0x3c7856=0xa;var _0x50f87a=[_0x8dab('0x57'),_0x8dab('0xa9'),_0x8dab('0x8b'),_0x8dab('0x58')];var _0x10bb0e={'SUM':_0x8dab('0x59'),'COUNT':_0x8dab('0x8c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8dab('0x8e'),'MIN':'MIN(%s)','AVG':_0x8dab('0x5b'),'GROUP_CONCAT':_0x8dab('0x5c'),'GROUP_CONCAT ASC':_0x8dab('0x5d'),'GROUP_CONCAT DESC':_0x8dab('0x8f')};var _0x5a752d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x8dab('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x455d80=function(_0x3efd75){return!_[_0x8dab('0x62')]([_0x8dab('0x90'),_0x8dab('0x63'),_0x8dab('0x64'),'IS\x20NOT\x20EMPTY'],_0x3efd75);};var _0x3abbc8=function(_0x20e0ea){if(!_0x20e0ea||!_0x20e0ea[_0x8dab('0x66')][_0x8dab('0x37')]){return'';}for(var _0x241c3a='(',_0x2706ca=0x0;_0x2706ca<_0x20e0ea[_0x8dab('0x66')][_0x8dab('0x37')];_0x2706ca+=0x1){_0x2706ca>0x0&&(_0x241c3a+='\x20'+_0x20e0ea[_0x8dab('0x67')]+'\x20');_0x241c3a+=_0x20e0ea[_0x8dab('0x66')][_0x2706ca][_0x8dab('0x68')]?_0x3abbc8(_0x20e0ea[_0x8dab('0x66')][_0x2706ca]['group']):_0x20e0ea['rules'][_0x2706ca][_0x8dab('0x69')]+'\x20'+_0x20e0ea[_0x8dab('0x66')][_0x2706ca][_0x8dab('0x6a')]+(_0x455d80(_0x20e0ea[_0x8dab('0x66')][_0x2706ca][_0x8dab('0x6a')])?'\x20'+_0x20e0ea[_0x8dab('0x66')][_0x2706ca][_0x8dab('0x6b')]:'');}return _0x241c3a+')';};var _0x4b2221={'where':{'id':_0xa7415f[_0x8dab('0x44')]['id']}},_0x468297,_0x4104f6,_0x3708df,_0xdecc5d,_0x589101;_0x4b2221=_['merge']({},_0x4b2221,_0xa7415f['options']);return db[_0x8dab('0x46')][_0x8dab('0x48')](_0x4b2221)['then'](function(_0x32c635){if(_0x32c635){_0x468297=_0x32c635;return _0x32c635[_0x8dab('0x6d')]();}return null;})[_0x8dab('0x3e')](function(_0x5e9f97){if(_0x5e9f97){if(!_0x5e9f97[_0x8dab('0x37')]){throw new db[(_0x8dab('0x6e'))][(_0x8dab('0x6f'))](_0x8dab('0x70'),0x193);}_0x4104f6=_0x5e9f97;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x8dab('0x3e')](function(_0x20ddce){if(_0x20ddce){_0x3708df=_[_0x8dab('0x72')](_0x20ddce,'id');var _0x43bff2;var _0x50ca85=squel[_0x8dab('0x73')]();_0x50ca85[_0x8dab('0x74')](_0x468297[_0x8dab('0x83')]);for(var _0x37eea6=0x0;_0x37eea6<_0x4104f6[_0x8dab('0x37')];_0x37eea6+=0x1){_0x43bff2=_0x4104f6[_0x37eea6]['MetricId']?_0x3708df[_0x4104f6[_0x37eea6][_0x8dab('0x75')]]['metric']:_0x4104f6[_0x37eea6][_0x8dab('0x69')];_0x43bff2=_0x4104f6[_0x37eea6][_0x8dab('0x91')]?_[_0x8dab('0x77')](_0x10bb0e[_0x4104f6[_0x37eea6][_0x8dab('0x91')]],'%s',_0x43bff2):_0x43bff2;_0x43bff2=_0x4104f6[_0x37eea6][_0x8dab('0x78')]?_[_0x8dab('0x77')](_0x5a752d[_0x4104f6[_0x37eea6][_0x8dab('0x78')]],'%s',_0x43bff2):_0x43bff2;if(_0x4104f6[_0x37eea6][_0x8dab('0x79')]){_0x50ca85['group'](_0x43bff2);}_0x4104f6[_0x37eea6][_0x8dab('0x7a')]&&_0x50ca85['order'](_0x43bff2,_0x4104f6[_0x37eea6]['orderBy']===_0x8dab('0x7c')?![]:!![]);_0x50ca85[_0x8dab('0x69')](_0x43bff2,_0x4104f6[_0x37eea6][_0x8dab('0x7d')]||_0x43bff2);}if(_0x468297['joins']){_0x468297['joins']=JSON[_0x8dab('0x7f')](_0x468297['joins']);for(var _0x20ea1f=0x0;_0x20ea1f<_0x468297[_0x8dab('0x7e')][_0x8dab('0x37')];_0x20ea1f+=0x1){if(_0x468297[_0x8dab('0x7e')][_0x20ea1f][_0x8dab('0x2f')]&&_[_0x8dab('0x62')](_0x50f87a,_0x468297[_0x8dab('0x7e')][_0x20ea1f][_0x8dab('0x2f')])&&_0x468297['joins'][_0x20ea1f][_0x8dab('0x80')]&&_0x468297[_0x8dab('0x7e')][_0x20ea1f]['foreignTable']&&_0x468297[_0x8dab('0x7e')][_0x20ea1f]['foreignKey']){_0x50ca85[_0x468297[_0x8dab('0x7e')][_0x20ea1f][_0x8dab('0x2f')]](_0x468297['joins'][_0x20ea1f][_0x8dab('0x82')],null,util[_0x8dab('0x78')](_0x8dab('0x92'),_0x468297[_0x8dab('0x83')],_0x468297[_0x8dab('0x7e')][_0x20ea1f][_0x8dab('0x80')],_0x468297[_0x8dab('0x7e')][_0x20ea1f][_0x8dab('0x82')],_0x468297['joins'][_0x20ea1f][_0x8dab('0x81')]));}}}if(_0x468297['conditions']){_0x468297[_0x8dab('0x84')]=JSON[_0x8dab('0x7f')](_0x468297[_0x8dab('0x84')]);_0x50ca85['where'](_0x3abbc8(_0x468297['conditions'][_0x8dab('0x68')]));}_0x589101=_0x50ca85['clone']();_0x50ca85[_0x8dab('0x1d')](_0x3c7856);_0x50ca85['offset'](0x0);logger['debug'](_0x8dab('0x86'),_0x50ca85[_0x8dab('0x87')]());return dbH[_0x8dab('0x88')]['query'](_0x50ca85[_0x8dab('0x87')](),{'type':dbH['sequelize'][_0x8dab('0x89')][_0x8dab('0x8a')]});}})['then'](function(){return{'sql':_0x589101['toString']()};})[_0x8dab('0x3e')](respondWithResult(_0x278421,null))['catch'](handleError(_0x278421,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index cbd4f91..abbf9f9 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 _0x81ee=['exports','define','AnalyticCustomReport','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x511d75,_0x3b50bc){var _0x37a68d=function(_0x49698f){while(--_0x49698f){_0x511d75['push'](_0x511d75['shift']());}};_0x37a68d(++_0x3b50bc);}(_0x81ee,0xdf));var _0xe81e=function(_0x4a503d,_0x1bf7ed){_0x4a503d=_0x4a503d-0x0;var _0x1add04=_0x81ee[_0x4a503d];return _0x1add04;};'use strict';var _=require(_0xe81e('0x0'));var util=require(_0xe81e('0x1'));var logger=require(_0xe81e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe81e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe81e('0x4'));var config=require(_0xe81e('0x5'));var attributes=require(_0xe81e('0x6'));module[_0xe81e('0x7')]=function(_0x187430,_0x566fd0){return _0x187430[_0xe81e('0x8')](_0xe81e('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddce=['analytics_custom_reports','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x21c8a9,_0x5687f4){var _0x1f8a72=function(_0x54f365){while(--_0x54f365){_0x21c8a9['push'](_0x21c8a9['shift']());}};_0x1f8a72(++_0x5687f4);}(_0xddce,0x90));var _0xeddc=function(_0x1d92d2,_0x56816e){_0x1d92d2=_0x1d92d2-0x0;var _0x211bfb=_0xddce[_0x1d92d2];return _0x211bfb;};'use strict';var _=require('lodash');var util=require(_0xeddc('0x0'));var logger=require(_0xeddc('0x1'))(_0xeddc('0x2'));var moment=require(_0xeddc('0x3'));var BPromise=require('bluebird');var rp=require(_0xeddc('0x4'));var fs=require('fs');var path=require(_0xeddc('0x5'));var rimraf=require(_0xeddc('0x6'));var config=require(_0xeddc('0x7'));var attributes=require(_0xeddc('0x8'));module[_0xeddc('0x9')]=function(_0xd6d8ad,_0x4fd616){return _0xd6d8ad[_0xeddc('0xa')](_0xeddc('0xb'),attributes,{'tableName':_0xeddc('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 71291a1..0d9ec9d 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 _0x37d8=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3321f0,_0x507b32){var _0x331846=function(_0x459186){while(--_0x459186){_0x3321f0['push'](_0x3321f0['shift']());}};_0x331846(++_0x507b32);}(_0x37d8,0x171));var _0x837d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x37d8[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x837d('0x0'));var util=require('util');var moment=require(_0x837d('0x1'));var BPromise=require(_0x837d('0x2'));var rs=require(_0x837d('0x3'));var fs=require('fs');var Redis=require(_0x837d('0x4'));var db=require(_0x837d('0x5'))['db'];var utils=require(_0x837d('0x6'));var logger=require('../../config/logger')(_0x837d('0x7'));var config=require('../../config/environment');var jayson=require(_0x837d('0x8'));var client=jayson[_0x837d('0x9')][_0x837d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14d4cc,_0x3f255e,_0x5b6460){return new BPromise(function(_0x11401d,_0x10a2ea){return client[_0x837d('0xb')](_0x14d4cc,_0x5b6460)[_0x837d('0xc')](function(_0x15b48d){logger[_0x837d('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f255e,_0x837d('0xe'));logger[_0x837d('0xf')](_0x837d('0x10'),_0x3f255e,_0x837d('0xe'),JSON[_0x837d('0x11')](_0x15b48d));if(_0x15b48d[_0x837d('0x12')]){if(_0x15b48d['error'][_0x837d('0x13')]===0x1f4){logger[_0x837d('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f255e,_0x15b48d[_0x837d('0x12')][_0x837d('0x14')]);return _0x10a2ea(_0x15b48d['error'][_0x837d('0x14')]);}logger[_0x837d('0x12')](_0x837d('0x15'),_0x3f255e,_0x15b48d[_0x837d('0x12')][_0x837d('0x14')]);return _0x11401d(_0x15b48d[_0x837d('0x12')]['message']);}else{logger['info'](_0x837d('0x15'),_0x3f255e,_0x837d('0xe'));_0x11401d(_0x15b48d[_0x837d('0x16')][_0x837d('0x14')]);}})[_0x837d('0x17')](function(_0x4d6d4d){logger['error'](_0x837d('0x15'),_0x3f255e,_0x4d6d4d);_0x10a2ea(_0x4d6d4d);});});} \ No newline at end of file +var _0xba59=['error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x5d0fda,_0x45fdda){var _0x4fb4ad=function(_0x5d3c1d){while(--_0x5d3c1d){_0x5d0fda['push'](_0x5d0fda['shift']());}};_0x4fb4ad(++_0x45fdda);}(_0xba59,0x14f));var _0x9ba5=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xba59[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x9ba5('0x0'));var util=require(_0x9ba5('0x1'));var moment=require(_0x9ba5('0x2'));var BPromise=require(_0x9ba5('0x3'));var rs=require(_0x9ba5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ba5('0x5'))['db'];var utils=require(_0x9ba5('0x6'));var logger=require(_0x9ba5('0x7'))('rpc');var config=require(_0x9ba5('0x8'));var jayson=require(_0x9ba5('0x9'));var client=jayson[_0x9ba5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f4113,_0x4ef9ad,_0xb86171){return new BPromise(function(_0x1a93e9,_0x372bf3){return client[_0x9ba5('0xb')](_0x2f4113,_0xb86171)[_0x9ba5('0xc')](function(_0x5462cd){logger[_0x9ba5('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ef9ad,_0x9ba5('0xe'));logger[_0x9ba5('0xf')](_0x9ba5('0x10'),_0x4ef9ad,_0x9ba5('0xe'),JSON['stringify'](_0x5462cd));if(_0x5462cd[_0x9ba5('0x11')]){if(_0x5462cd['error'][_0x9ba5('0x12')]===0x1f4){logger[_0x9ba5('0x11')](_0x9ba5('0x13'),_0x4ef9ad,_0x5462cd[_0x9ba5('0x11')]['message']);return _0x372bf3(_0x5462cd[_0x9ba5('0x11')]['message']);}logger[_0x9ba5('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ef9ad,_0x5462cd['error'][_0x9ba5('0x14')]);return _0x1a93e9(_0x5462cd[_0x9ba5('0x11')][_0x9ba5('0x14')]);}else{logger[_0x9ba5('0xd')](_0x9ba5('0x13'),_0x4ef9ad,_0x9ba5('0xe'));_0x1a93e9(_0x5462cd[_0x9ba5('0x15')][_0x9ba5('0x14')]);}})['catch'](function(_0x489088){logger[_0x9ba5('0x11')](_0x9ba5('0x13'),_0x4ef9ad,_0x489088);_0x372bf3(_0x489088);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 328a679..eac7033 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 _0xee54=['get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee54,0x184));var _0x4ee5=function(_0x373dfc,_0x3653d8){_0x373dfc=_0x373dfc-0x0;var _0x19a305=_0xee54[_0x373dfc];return _0x19a305;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee5('0x0'));var timeout=require(_0x4ee5('0x1'));var express=require(_0x4ee5('0x2'));var router=express[_0x4ee5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4ee5('0x4'));var interaction=require(_0x4ee5('0x5'));var config=require(_0x4ee5('0x6'));var controller=require(_0x4ee5('0x7'));router['get']('/',auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x9')]);router['get'](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0xb')]);router[_0x4ee5('0xc')](_0x4ee5('0xd'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0xe')]);router[_0x4ee5('0xc')](_0x4ee5('0xf'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x10')]);router[_0x4ee5('0xc')](_0x4ee5('0x11'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x12')]);router[_0x4ee5('0x13')]('/',auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x14')]);router['put'](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x15')]);router[_0x4ee5('0x16')](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x17')]);module[_0x4ee5('0x18')]=router; \ No newline at end of file +var _0xb0db=['run','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview'];(function(_0x322e63,_0x7280e3){var _0x98d00c=function(_0xd496f5){while(--_0xd496f5){_0x322e63['push'](_0x322e63['shift']());}};_0x98d00c(++_0x7280e3);}(_0xb0db,0x16f));var _0xbb0d=function(_0x251ceb,_0x5db9d8){_0x251ceb=_0x251ceb-0x0;var _0x11e875=_0xb0db[_0x251ceb];return _0x11e875;};'use strict';var multer=require(_0xbb0d('0x0'));var util=require(_0xbb0d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb0d('0x2'));var router=express[_0xbb0d('0x3')]();var fs_extra=require(_0xbb0d('0x4'));var auth=require(_0xbb0d('0x5'));var interaction=require(_0xbb0d('0x6'));var config=require('../../config/environment');var controller=require(_0xbb0d('0x7'));router[_0xbb0d('0x8')]('/',auth[_0xbb0d('0x9')](),controller['index']);router['get'](_0xbb0d('0xa'),auth[_0xbb0d('0x9')](),controller[_0xbb0d('0xb')]);router['get'](_0xbb0d('0xc'),auth[_0xbb0d('0x9')](),controller['preview']);router['get']('/:id/run',auth[_0xbb0d('0x9')](),controller[_0xbb0d('0xd')]);router[_0xbb0d('0x8')]('/:id/query',auth[_0xbb0d('0x9')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller[_0xbb0d('0xe')]);router[_0xbb0d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbb0d('0x10')]);router[_0xbb0d('0x11')](_0xbb0d('0xa'),auth[_0xbb0d('0x9')](),controller[_0xbb0d('0x12')]);module[_0xbb0d('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index ed8c648..420125f 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 _0x6f47=['TEXT','exports','STRING'];(function(_0xe58a55,_0x3bdfcd){var _0x295932=function(_0x211d8d){while(--_0x211d8d){_0xe58a55['push'](_0xe58a55['shift']());}};_0x295932(++_0x3bdfcd);}(_0x6f47,0xc7));var _0x76f4=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x6f47[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x47f1bd,_0x3290bb){var _0x204ef4=function(_0x2b966e){while(--_0x2b966e){_0x47f1bd['push'](_0x47f1bd['shift']());}};_0x204ef4(++_0x3290bb);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x481737,_0x28b277){_0x481737=_0x481737-0x0;var _0x9f399e=_0x3eea[_0x481737];return _0x9f399e;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f5095dc..93f888d 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 _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','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','preview','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','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x383e35,_0x57ebee){_0x383e35=_0x383e35-0x0;var _0x149af8=_0xc6ac[_0x383e35];return _0x149af8;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));}; \ No newline at end of file +var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0xa1775,_0x2015d0){var _0x171fc1=function(_0x141ce0){while(--_0x141ce0){_0xa1775['push'](_0xa1775['shift']());}};_0x171fc1(++_0x2015d0);}(_0x4975,0x86));var _0x5497=function(_0x2d54b8,_0x1c6eee){_0x2d54b8=_0x2d54b8-0x0;var _0x11bc1e=_0x4975[_0x2d54b8];return _0x11bc1e;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 9b487f2..f1ec8f8 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 _0x8f86=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8f86,0x162));var _0x68f8=function(_0x1e804c,_0x47d42d){_0x1e804c=_0x1e804c-0x0;var _0x31b58=_0x8f86[_0x1e804c];return _0x31b58;};'use strict';var _=require(_0x68f8('0x0'));var util=require(_0x68f8('0x1'));var logger=require(_0x68f8('0x2'))(_0x68f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x68f8('0x4'));var fs=require('fs');var path=require(_0x68f8('0x5'));var rimraf=require('rimraf');var config=require(_0x68f8('0x6'));var attributes=require(_0x68f8('0x7'));module[_0x68f8('0x8')]=function(_0x43f8fb,_0x54d672){return _0x43f8fb[_0x68f8('0x9')](_0x68f8('0xa'),attributes,{'tableName':_0x68f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3abc=['analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x1d738c,_0x5314db){var _0x234948=function(_0x3eb3b0){while(--_0x3eb3b0){_0x1d738c['push'](_0x1d738c['shift']());}};_0x234948(++_0x5314db);}(_0x3abc,0x199));var _0xc3ab=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x3abc[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xc3ab('0x0'));var util=require(_0xc3ab('0x1'));var logger=require(_0xc3ab('0x2'))(_0xc3ab('0x3'));var moment=require(_0xc3ab('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ab('0x6'));var config=require(_0xc3ab('0x7'));var attributes=require(_0xc3ab('0x8'));module['exports']=function(_0x30655e,_0x2c3cf9){return _0x30655e[_0xc3ab('0x9')](_0xc3ab('0xa'),attributes,{'tableName':_0xc3ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index bb448a1..ab0c1e6 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 _0x3dc8=['http','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3b27d3,_0x2c4d9b){var _0x247327=function(_0x3d8dd4){while(--_0x3d8dd4){_0x3b27d3['push'](_0x3b27d3['shift']());}};_0x247327(++_0x2c4d9b);}(_0x3dc8,0x162));var _0x83dc=function(_0x41c7d8,_0x7db48c){_0x41c7d8=_0x41c7d8-0x0;var _0x3d46d0=_0x3dc8[_0x41c7d8];return _0x3d46d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83dc('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83dc('0x1'))['db'];var utils=require(_0x83dc('0x2'));var logger=require(_0x83dc('0x3'))('rpc');var config=require(_0x83dc('0x4'));var jayson=require(_0x83dc('0x5'));var client=jayson[_0x83dc('0x6')][_0x83dc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37fd1c,_0x5a337d,_0x36ced2){return new BPromise(function(_0x6c0986,_0x237dba){return client['request'](_0x37fd1c,_0x36ced2)[_0x83dc('0x8')](function(_0x1ec8c0){logger[_0x83dc('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a337d,_0x83dc('0xa'));logger['debug'](_0x83dc('0xb'),_0x5a337d,_0x83dc('0xa'),JSON[_0x83dc('0xc')](_0x1ec8c0));if(_0x1ec8c0[_0x83dc('0xd')]){if(_0x1ec8c0['error'][_0x83dc('0xe')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a337d,_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);return _0x237dba(_0x1ec8c0[_0x83dc('0xd')]['message']);}logger[_0x83dc('0xd')](_0x83dc('0x10'),_0x5a337d,_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);return _0x6c0986(_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);}else{logger['info'](_0x83dc('0x10'),_0x5a337d,_0x83dc('0xa'));_0x6c0986(_0x1ec8c0[_0x83dc('0x11')]['message']);}})[_0x83dc('0x12')](function(_0x5b939d){logger[_0x83dc('0xd')](_0x83dc('0x10'),_0x5a337d,_0x5b939d);_0x237dba(_0x5b939d);});});} \ No newline at end of file +var _0xe8a5=['moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x2647a1,_0x480f61){var _0x501268=function(_0x3f6826){while(--_0x3f6826){_0x2647a1['push'](_0x2647a1['shift']());}};_0x501268(++_0x480f61);}(_0xe8a5,0x1a0));var _0x5e8a=function(_0x3b1ca1,_0xd10c5){_0x3b1ca1=_0x3b1ca1-0x0;var _0x1355c3=_0xe8a5[_0x3b1ca1];return _0x1355c3;};'use strict';var _=require(_0x5e8a('0x0'));var util=require(_0x5e8a('0x1'));var moment=require(_0x5e8a('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(_0x5e8a('0x3'));var logger=require(_0x5e8a('0x4'))(_0x5e8a('0x5'));var config=require(_0x5e8a('0x6'));var jayson=require(_0x5e8a('0x7'));var client=jayson[_0x5e8a('0x8')][_0x5e8a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42d819,_0x5273f3,_0x5894a0){return new BPromise(function(_0x147d86,_0x351d0e){return client[_0x5e8a('0xa')](_0x42d819,_0x5894a0)['then'](function(_0x1013a4){logger[_0x5e8a('0xb')](_0x5e8a('0xc'),_0x5273f3,_0x5e8a('0xd'));logger['debug'](_0x5e8a('0xe'),_0x5273f3,_0x5e8a('0xd'),JSON['stringify'](_0x1013a4));if(_0x1013a4[_0x5e8a('0xf')]){if(_0x1013a4[_0x5e8a('0xf')][_0x5e8a('0x10')]===0x1f4){logger[_0x5e8a('0xf')](_0x5e8a('0xc'),_0x5273f3,_0x1013a4[_0x5e8a('0xf')][_0x5e8a('0x11')]);return _0x351d0e(_0x1013a4[_0x5e8a('0xf')][_0x5e8a('0x11')]);}logger['error'](_0x5e8a('0xc'),_0x5273f3,_0x1013a4[_0x5e8a('0xf')][_0x5e8a('0x11')]);return _0x147d86(_0x1013a4[_0x5e8a('0xf')][_0x5e8a('0x11')]);}else{logger[_0x5e8a('0xb')](_0x5e8a('0xc'),_0x5273f3,_0x5e8a('0xd'));_0x147d86(_0x1013a4['result'][_0x5e8a('0x11')]);}})[_0x5e8a('0x12')](function(_0x12176c){logger['error'](_0x5e8a('0xc'),_0x5273f3,_0x12176c);_0x351d0e(_0x12176c);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 86650cb..8f4c01c 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 _0x2bbb=['index','/:id','show','get','/:id/run','run','/:id/query','query','post','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated'];(function(_0x122509,_0xc1ee11){var _0x1f5220=function(_0x40ff21){while(--_0x40ff21){_0x122509['push'](_0x122509['shift']());}};_0x1f5220(++_0xc1ee11);}(_0x2bbb,0x1d9));var _0xb2bb=function(_0x48df6d,_0x8e91a){_0x48df6d=_0x48df6d-0x0;var _0x2afe14=_0x2bbb[_0x48df6d];return _0x2afe14;};'use strict';var multer=require(_0xb2bb('0x0'));var util=require(_0xb2bb('0x1'));var path=require(_0xb2bb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb2bb('0x3')]();var fs_extra=require(_0xb2bb('0x4'));var auth=require(_0xb2bb('0x5'));var interaction=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var controller=require(_0xb2bb('0x8'));router['get']('/',auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xa')]);router['get'](_0xb2bb('0xb'),auth['isAuthenticated'](),controller[_0xb2bb('0xc')]);router[_0xb2bb('0xd')]('/:id/preview',auth[_0xb2bb('0x9')](),controller['preview']);router[_0xb2bb('0xd')](_0xb2bb('0xe'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xf')]);router[_0xb2bb('0xd')](_0xb2bb('0x10'),auth['isAuthenticated'](),controller[_0xb2bb('0x11')]);router[_0xb2bb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0x13')]);router[_0xb2bb('0x14')](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0x15')]);module[_0xb2bb('0x16')]=router; \ No newline at end of file +var _0x28bf=['query','create','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x28bf,0xc1));var _0xf28b=function(_0x59008b,_0x75ea97){_0x59008b=_0x59008b-0x0;var _0x20359c=_0x28bf[_0x59008b];return _0x20359c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf28b('0x0'));var timeout=require('connect-timeout');var express=require(_0xf28b('0x1'));var router=express[_0xf28b('0x2')]();var fs_extra=require(_0xf28b('0x3'));var auth=require(_0xf28b('0x4'));var interaction=require(_0xf28b('0x5'));var config=require(_0xf28b('0x6'));var controller=require(_0xf28b('0x7'));router[_0xf28b('0x8')]('/',auth[_0xf28b('0x9')](),controller[_0xf28b('0xa')]);router[_0xf28b('0x8')](_0xf28b('0xb'),auth['isAuthenticated'](),controller[_0xf28b('0xc')]);router[_0xf28b('0x8')](_0xf28b('0xd'),auth['isAuthenticated'](),controller[_0xf28b('0xe')]);router[_0xf28b('0x8')](_0xf28b('0xf'),auth['isAuthenticated'](),controller['run']);router['get'](_0xf28b('0x10'),auth[_0xf28b('0x9')](),controller[_0xf28b('0x11')]);router['post']('/',auth[_0xf28b('0x9')](),controller[_0xf28b('0x12')]);router['put'](_0xf28b('0xb'),auth[_0xf28b('0x9')](),controller['update']);router[_0xf28b('0x13')](_0xf28b('0xb'),auth[_0xf28b('0x9')](),controller[_0xf28b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 1e1b372..c06680f 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 _0x9aad=['manual','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','xlsx','DATE','Loading'];(function(_0x1b8524,_0x1bb669){var _0x81418d=function(_0x5f5795){while(--_0x5f5795){_0x1b8524['push'](_0x1b8524['shift']());}};_0x81418d(++_0x1bb669);}(_0x9aad,0x193));var _0xd9aa=function(_0x368b9e,_0x2ae528){_0x368b9e=_0x368b9e-0x0;var _0x8dc3ea=_0x9aad[_0x368b9e];return _0x8dc3ea;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd9aa('0x0')]={'name':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xd9aa('0x2')](_0xd9aa('0x3'),'pdf',_0xd9aa('0x4')),'allowNull':![],'defaultValue':_0xd9aa('0x3')},'savename':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xd9aa('0x5')]},'status':{'type':Sequelize[_0xd9aa('0x1')],'defaultValue':_0xd9aa('0x6')},'type':{'type':Sequelize['ENUM'](_0xd9aa('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0xd9aa('0x7')},'reportId':{'type':Sequelize[_0xd9aa('0x8')](0xb)[_0xd9aa('0x9')]},'reportType':{'type':Sequelize[_0xd9aa('0x1')]}}; \ No newline at end of file +var _0xbd3c=['sequelize','moment','STRING','csv','xlsx','DATE','ENUM','manual','scheduled','UNSIGNED'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0xbd3c,0x6e));var _0xcbd3=function(_0x126109,_0x1b0f06){_0x126109=_0x126109-0x0;var _0x304ee4=_0xbd3c[_0x126109];return _0x304ee4;};'use strict';var Sequelize=require(_0xcbd3('0x0'));var moment=require(_0xcbd3('0x1'));module['exports']={'name':{'type':Sequelize[_0xcbd3('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xcbd3('0x3'),'pdf',_0xcbd3('0x4')),'allowNull':![],'defaultValue':_0xcbd3('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xcbd3('0x5')]},'endDate':{'type':Sequelize[_0xcbd3('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xcbd3('0x6')](_0xcbd3('0x7'),_0xcbd3('0x8')),'allowNull':![],'defaultValue':_0xcbd3('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xcbd3('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8bbd63b..9b16306 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 _0xe9f9=['model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','AnalyticExtractedReport','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','update','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xe9f9,0x91));var _0x9e9f=function(_0x4ed4db,_0x5588fe){_0x4ed4db=_0x4ed4db-0x0;var _0x326691=_0xe9f9[_0x4ed4db];return _0x326691;};'use strict';var emlformat=require(_0x9e9f('0x0'));var rimraf=require(_0x9e9f('0x1'));var zipdir=require(_0x9e9f('0x2'));var jsonpatch=require(_0x9e9f('0x3'));var rp=require(_0x9e9f('0x4'));var moment=require('moment');var BPromise=require(_0x9e9f('0x5'));var Mustache=require(_0x9e9f('0x6'));var util=require(_0x9e9f('0x7'));var path=require('path');var sox=require(_0x9e9f('0x8'));var csv=require('to-csv');var ejs=require(_0x9e9f('0x9'));var fs=require('fs');var fs_extra=require(_0x9e9f('0xa'));var _=require('lodash');var squel=require(_0x9e9f('0xb'));var crypto=require(_0x9e9f('0xc'));var jsforce=require(_0x9e9f('0xd'));var deskjs=require(_0x9e9f('0xe'));var toCsv=require(_0x9e9f('0xf'));var querystring=require(_0x9e9f('0x10'));var Papa=require(_0x9e9f('0x11'));var Redis=require(_0x9e9f('0x12'));var authService=require(_0x9e9f('0x13'));var qs=require(_0x9e9f('0x14'));var as=require(_0x9e9f('0x15'));var hardwareService=require(_0x9e9f('0x16'));var logger=require(_0x9e9f('0x17'))(_0x9e9f('0x18'));var utils=require(_0x9e9f('0x19'));var config=require(_0x9e9f('0x1a'));var licenseUtil=require(_0x9e9f('0x1b'));var db=require(_0x9e9f('0x1c'))['db'];function respondWithStatusCode(_0x25a17b,_0x4635ae){_0x4635ae=_0x4635ae||0xcc;return function(_0x87e89a){if(_0x87e89a){return _0x25a17b['sendStatus'](_0x4635ae);}return _0x25a17b[_0x9e9f('0x1d')](_0x4635ae)[_0x9e9f('0x1e')]();};}function respondWithResult(_0x4f187b,_0x195d8a){_0x195d8a=_0x195d8a||0xc8;return function(_0x208f56){if(_0x208f56){return _0x4f187b[_0x9e9f('0x1d')](_0x195d8a)[_0x9e9f('0x1f')](_0x208f56);}};}function respondWithFilteredResult(_0xb9e7bb,_0x5adc1c){return function(_0x1233a4){if(_0x1233a4){var _0x1dbe8e=typeof _0x5adc1c[_0x9e9f('0x20')]===_0x9e9f('0x21')&&typeof _0x5adc1c[_0x9e9f('0x22')]===_0x9e9f('0x21');var _0x2757ba=_0x1233a4['count'];var _0x3803fb=_0x1dbe8e?0x0:_0x5adc1c['offset'];var _0x3d959a=_0x1dbe8e?_0x1233a4[_0x9e9f('0x23')]:_0x5adc1c[_0x9e9f('0x20')]+_0x5adc1c[_0x9e9f('0x22')];var _0x1c9823;if(_0x3d959a>=_0x2757ba){_0x3d959a=_0x2757ba;_0x1c9823=0xc8;}else{_0x1c9823=0xce;}_0xb9e7bb[_0x9e9f('0x1d')](_0x1c9823);return _0xb9e7bb[_0x9e9f('0x24')](_0x9e9f('0x25'),_0x3803fb+'-'+_0x3d959a+'/'+_0x2757ba)['json'](_0x1233a4);}return null;};}function patchUpdates(_0x588bb1){return function(_0x23fb0){try{jsonpatch['apply'](_0x23fb0,_0x588bb1,!![]);}catch(_0x4d98e1){return BPromise[_0x9e9f('0x26')](_0x4d98e1);}return _0x23fb0['save']();};}function saveUpdates(_0x541433,_0x5b1881){return function(_0x4dfefa){if(_0x4dfefa){return _0x4dfefa['update'](_0x541433)[_0x9e9f('0x27')](function(_0x421b7e){return _0x421b7e;});}return null;};}function removeEntity(_0x50eb50,_0x3de374){return function(_0x450e75){if(_0x450e75){return _0x450e75[_0x9e9f('0x28')]()['then'](function(){var _0x407430=_0x450e75[_0x9e9f('0x29')]({'plain':!![]});var _0x4939d4=_0x9e9f('0x2a');return db[_0x9e9f('0x2b')]['destroy']({'where':{'type':_0x4939d4,'resourceId':_0x407430['id']}})[_0x9e9f('0x27')](function(){return _0x450e75;});})[_0x9e9f('0x27')](function(){_0x50eb50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bdd80,_0x1a9f96){return function(_0x188488){if(!_0x188488){_0x2bdd80[_0x9e9f('0x2c')](0x194);}return _0x188488;};}function handleError(_0x7137d,_0x5a5fb1){_0x5a5fb1=_0x5a5fb1||0x1f4;return function(_0xcfeb26){logger[_0x9e9f('0x2d')](_0xcfeb26[_0x9e9f('0x2e')]);if(_0xcfeb26[_0x9e9f('0x2f')]){delete _0xcfeb26[_0x9e9f('0x2f')];}_0x7137d[_0x9e9f('0x1d')](_0x5a5fb1)[_0x9e9f('0x30')](_0xcfeb26);};}exports[_0x9e9f('0x31')]=function(_0x48bf37,_0x3e2dfa){var _0x4c72d8={},_0xfae401={},_0x100a05={'count':0x0,'rows':[]};var _0x1f8177=_['map'](db['AnalyticExtractedReport']['rawAttributes'],function(_0x5badf3){return{'name':_0x5badf3[_0x9e9f('0x32')],'type':_0x5badf3[_0x9e9f('0x33')][_0x9e9f('0x34')]};});_0xfae401[_0x9e9f('0x35')]=_[_0x9e9f('0x36')](_0x1f8177,_0x9e9f('0x2f'));_0xfae401[_0x9e9f('0x37')]=_[_0x9e9f('0x38')](_0x48bf37['query']);_0xfae401[_0x9e9f('0x39')]=_['intersection'](_0xfae401[_0x9e9f('0x35')],_0xfae401[_0x9e9f('0x37')]);_0x4c72d8[_0x9e9f('0x3a')]=_[_0x9e9f('0x3b')](_0xfae401[_0x9e9f('0x35')],qs[_0x9e9f('0x3c')](_0x48bf37['query'][_0x9e9f('0x3c')]));_0x4c72d8[_0x9e9f('0x3a')]=_0x4c72d8['attributes'][_0x9e9f('0x3d')]?_0x4c72d8['attributes']:_0xfae401[_0x9e9f('0x35')];if(!_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x3e')]('nolimit')){_0x4c72d8[_0x9e9f('0x22')]=qs[_0x9e9f('0x22')](_0x48bf37[_0x9e9f('0x37')]['limit']);_0x4c72d8['offset']=qs[_0x9e9f('0x20')](_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x20')]);}_0x4c72d8[_0x9e9f('0x3f')]=qs[_0x9e9f('0x40')](_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x40')]);_0x4c72d8[_0x9e9f('0x41')]=qs[_0x9e9f('0x39')](_[_0x9e9f('0x42')](_0x48bf37[_0x9e9f('0x37')],_0xfae401[_0x9e9f('0x39')]),_0x1f8177);if(_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x43')]){_0x4c72d8[_0x9e9f('0x41')]=_[_0x9e9f('0x44')](_0x4c72d8[_0x9e9f('0x41')],{'$or':_['map'](_0x1f8177,function(_0x261c2b){if(_0x261c2b[_0x9e9f('0x33')]!==_0x9e9f('0x45')){var _0x333dd5={};_0x333dd5[_0x261c2b[_0x9e9f('0x2f')]]={'$like':'%'+_0x48bf37['query'][_0x9e9f('0x43')]+'%'};return _0x333dd5;}})});}_0x4c72d8=_[_0x9e9f('0x44')]({},_0x4c72d8,_0x48bf37[_0x9e9f('0x46')]);var _0x59c290={'where':_0x4c72d8[_0x9e9f('0x41')]};return db['AnalyticExtractedReport'][_0x9e9f('0x23')](_0x59c290)['then'](function(_0x5da307){_0x100a05[_0x9e9f('0x23')]=_0x5da307;if(_0x48bf37['query'][_0x9e9f('0x47')]){_0x4c72d8[_0x9e9f('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x9e9f('0x49')](_0x4c72d8);})['then'](function(_0x1a0910){_0x100a05[_0x9e9f('0x4a')]=_0x1a0910;return _0x100a05;})['then'](respondWithFilteredResult(_0x3e2dfa,_0x4c72d8))[_0x9e9f('0x4b')](handleError(_0x3e2dfa,null));};exports[_0x9e9f('0x4c')]=function(_0x52e03a,_0x2c128b){var _0x2d6d25={'raw':!![],'where':{'id':_0x52e03a[_0x9e9f('0x4d')]['id']}},_0x4f75ca={};_0x4f75ca[_0x9e9f('0x35')]=_['keys'](db[_0x9e9f('0x4e')]['rawAttributes']);_0x4f75ca[_0x9e9f('0x37')]=_[_0x9e9f('0x38')](_0x52e03a[_0x9e9f('0x37')]);_0x4f75ca[_0x9e9f('0x39')]=_['intersection'](_0x4f75ca[_0x9e9f('0x35')],_0x4f75ca['query']);_0x2d6d25['attributes']=_[_0x9e9f('0x3b')](_0x4f75ca[_0x9e9f('0x35')],qs[_0x9e9f('0x3c')](_0x52e03a['query'][_0x9e9f('0x3c')]));_0x2d6d25['attributes']=_0x2d6d25[_0x9e9f('0x3a')][_0x9e9f('0x3d')]?_0x2d6d25[_0x9e9f('0x3a')]:_0x4f75ca[_0x9e9f('0x35')];if(_0x52e03a[_0x9e9f('0x37')][_0x9e9f('0x47')]){_0x2d6d25[_0x9e9f('0x48')]=[{'all':!![]}];}_0x2d6d25=_[_0x9e9f('0x44')]({},_0x2d6d25,_0x52e03a['options']);return db[_0x9e9f('0x4e')][_0x9e9f('0x4f')](_0x2d6d25)[_0x9e9f('0x27')](handleEntityNotFound(_0x2c128b,null))[_0x9e9f('0x27')](respondWithResult(_0x2c128b,null))['catch'](handleError(_0x2c128b,null));};exports['create']=function(_0x216657,_0x13bbf8){return db[_0x9e9f('0x4e')][_0x9e9f('0x50')](_0x216657[_0x9e9f('0x51')],{})[_0x9e9f('0x27')](function(_0xc8b194){var _0x1d334a=_0x216657[_0x9e9f('0x52')][_0x9e9f('0x29')]({'plain':!![]});if(!_0x1d334a)throw new Error(_0x9e9f('0x53'));if(_0x1d334a[_0x9e9f('0x54')]===_0x9e9f('0x52')){var _0x32aad2=_0xc8b194[_0x9e9f('0x29')]({'plain':!![]});var _0x45ce49='ExtractedReports';return db['UserProfileSection'][_0x9e9f('0x4f')]({'where':{'name':_0x45ce49,'userProfileId':_0x1d334a['userProfileId']},'raw':!![]})[_0x9e9f('0x27')](function(_0x35b2cb){if(_0x35b2cb&&_0x35b2cb[_0x9e9f('0x55')]===0x0){return db[_0x9e9f('0x2b')][_0x9e9f('0x50')]({'name':_0x32aad2[_0x9e9f('0x2f')],'resourceId':_0x32aad2['id'],'type':_0x35b2cb[_0x9e9f('0x2f')],'sectionId':_0x35b2cb['id']},{})['then'](function(){return _0xc8b194;});}else{return _0xc8b194;}})['catch'](function(_0x34eeeb){logger[_0x9e9f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34eeeb);throw _0x34eeeb;});}return _0xc8b194;})['then'](respondWithResult(_0x13bbf8,0xc9))[_0x9e9f('0x4b')](handleError(_0x13bbf8,null));};exports[_0x9e9f('0x56')]=function(_0x2676cc,_0x24c6c7){if(_0x2676cc['body']['id']){delete _0x2676cc[_0x9e9f('0x51')]['id'];}return db[_0x9e9f('0x4e')]['find']({'where':{'id':_0x2676cc[_0x9e9f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24c6c7,null))[_0x9e9f('0x27')](saveUpdates(_0x2676cc[_0x9e9f('0x51')],null))[_0x9e9f('0x27')](respondWithResult(_0x24c6c7,null))[_0x9e9f('0x4b')](handleError(_0x24c6c7,null));};exports[_0x9e9f('0x28')]=function(_0x2abf55,_0x30bfd8){return db[_0x9e9f('0x4e')][_0x9e9f('0x4f')]({'where':{'id':_0x2abf55[_0x9e9f('0x4d')]['id']}})[_0x9e9f('0x27')](handleEntityNotFound(_0x30bfd8,null))[_0x9e9f('0x27')](removeEntity(_0x30bfd8,null))[_0x9e9f('0x4b')](handleError(_0x30bfd8,null));};exports[_0x9e9f('0x57')]=function(_0x27ad1b,_0x5d48e4,_0x1da310){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x27ad1b[_0x9e9f('0x4d')]['id']},'attributes':[_0x9e9f('0x2f'),_0x9e9f('0x58'),_0x9e9f('0x59'),_0x9e9f('0x5a')],'raw':!![]})[_0x9e9f('0x27')](handleEntityNotFound(_0x5d48e4,null))[_0x9e9f('0x27')](function(_0xd80095){if(_0xd80095){if(!fs[_0x9e9f('0x5b')](path[_0x9e9f('0x5c')](config[_0x9e9f('0x5d')],_0x9e9f('0x5e'),_0xd80095[_0x9e9f('0x59')]))){throw new db[(_0x9e9f('0x5f'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x27ad1b[_0x9e9f('0x37')][_0x9e9f('0x60')]){return _0x5d48e4[_0x9e9f('0x2c')](0xc8);}return _0x5d48e4[_0x9e9f('0x57')](path[_0x9e9f('0x5c')](config[_0x9e9f('0x5d')],_0x9e9f('0x5e'),_0xd80095['savename']),util['format'](_0x9e9f('0x61'),_0xd80095[_0x9e9f('0x58')]||_0xd80095[_0x9e9f('0x2f')],_0xd80095['output'][_0x9e9f('0x62')]()));}})[_0x9e9f('0x4b')](handleError(_0x5d48e4,null));}; \ No newline at end of file +var _0x8eb6=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','limit','sort','merge','where','filter','includeAll','findAll','rows','show','params','fields','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3be5cb,_0x6df063){var _0xfa90e9=function(_0x31a6f6){while(--_0x31a6f6){_0x3be5cb['push'](_0x3be5cb['shift']());}};_0xfa90e9(++_0x6df063);}(_0x8eb6,0x1c2));var _0x68eb=function(_0x32efa4,_0x4b16ed){_0x32efa4=_0x32efa4-0x0;var _0x5cd076=_0x8eb6[_0x32efa4];return _0x5cd076;};'use strict';var emlformat=require(_0x68eb('0x0'));var rimraf=require(_0x68eb('0x1'));var zipdir=require(_0x68eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68eb('0x3'));var moment=require(_0x68eb('0x4'));var BPromise=require(_0x68eb('0x5'));var Mustache=require(_0x68eb('0x6'));var util=require(_0x68eb('0x7'));var path=require('path');var sox=require(_0x68eb('0x8'));var csv=require('to-csv');var ejs=require(_0x68eb('0x9'));var fs=require('fs');var fs_extra=require(_0x68eb('0xa'));var _=require(_0x68eb('0xb'));var squel=require(_0x68eb('0xc'));var crypto=require(_0x68eb('0xd'));var jsforce=require(_0x68eb('0xe'));var deskjs=require(_0x68eb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x68eb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x68eb('0x11'));var as=require(_0x68eb('0x12'));var hardwareService=require(_0x68eb('0x13'));var logger=require(_0x68eb('0x14'))(_0x68eb('0x15'));var utils=require(_0x68eb('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x68eb('0x17'))['db'];function respondWithStatusCode(_0x4958a5,_0x115faf){_0x115faf=_0x115faf||0xcc;return function(_0x59634c){if(_0x59634c){return _0x4958a5[_0x68eb('0x18')](_0x115faf);}return _0x4958a5['status'](_0x115faf)[_0x68eb('0x19')]();};}function respondWithResult(_0x129877,_0x8d2db2){_0x8d2db2=_0x8d2db2||0xc8;return function(_0x5492b2){if(_0x5492b2){return _0x129877['status'](_0x8d2db2)[_0x68eb('0x1a')](_0x5492b2);}};}function respondWithFilteredResult(_0x3b7ffa,_0x1df1ce){return function(_0x43349f){if(_0x43349f){var _0x2e6aa8=typeof _0x1df1ce['offset']===_0x68eb('0x1b')&&typeof _0x1df1ce['limit']===_0x68eb('0x1b');var _0x5b9d09=_0x43349f[_0x68eb('0x1c')];var _0x45080a=_0x2e6aa8?0x0:_0x1df1ce['offset'];var _0xcb9c2f=_0x2e6aa8?_0x43349f['count']:_0x1df1ce[_0x68eb('0x1d')]+_0x1df1ce['limit'];var _0x5a7a5e;if(_0xcb9c2f>=_0x5b9d09){_0xcb9c2f=_0x5b9d09;_0x5a7a5e=0xc8;}else{_0x5a7a5e=0xce;}_0x3b7ffa[_0x68eb('0x1e')](_0x5a7a5e);return _0x3b7ffa[_0x68eb('0x1f')](_0x68eb('0x20'),_0x45080a+'-'+_0xcb9c2f+'/'+_0x5b9d09)[_0x68eb('0x1a')](_0x43349f);}return null;};}function patchUpdates(_0x4e2419){return function(_0xffebab){try{jsonpatch[_0x68eb('0x21')](_0xffebab,_0x4e2419,!![]);}catch(_0x314457){return BPromise[_0x68eb('0x22')](_0x314457);}return _0xffebab[_0x68eb('0x23')]();};}function saveUpdates(_0x2565a1,_0x53b6b1){return function(_0x21da62){if(_0x21da62){return _0x21da62[_0x68eb('0x24')](_0x2565a1)['then'](function(_0xf2345f){return _0xf2345f;});}return null;};}function removeEntity(_0xef5022,_0x3227d1){return function(_0x3a2843){if(_0x3a2843){return _0x3a2843[_0x68eb('0x25')]()[_0x68eb('0x26')](function(){var _0x36639b=_0x3a2843[_0x68eb('0x27')]({'plain':!![]});var _0x596b42=_0x68eb('0x28');return db[_0x68eb('0x29')][_0x68eb('0x25')]({'where':{'type':_0x596b42,'resourceId':_0x36639b['id']}})[_0x68eb('0x26')](function(){return _0x3a2843;});})['then'](function(){_0xef5022['status'](0xcc)[_0x68eb('0x19')]();});}};}function handleEntityNotFound(_0x4c91e9,_0x404b36){return function(_0x26dbfe){if(!_0x26dbfe){_0x4c91e9[_0x68eb('0x18')](0x194);}return _0x26dbfe;};}function handleError(_0x215869,_0x169f83){_0x169f83=_0x169f83||0x1f4;return function(_0x35abcf){logger['error'](_0x35abcf[_0x68eb('0x2a')]);if(_0x35abcf[_0x68eb('0x2b')]){delete _0x35abcf[_0x68eb('0x2b')];}_0x215869['status'](_0x169f83)[_0x68eb('0x2c')](_0x35abcf);};}exports['index']=function(_0x5903fd,_0x2711e2){var _0x3cecbb={},_0x3c7702={},_0x19116d={'count':0x0,'rows':[]};var _0x48c427=_[_0x68eb('0x2d')](db[_0x68eb('0x2e')][_0x68eb('0x2f')],function(_0x3eb831){return{'name':_0x3eb831[_0x68eb('0x30')],'type':_0x3eb831[_0x68eb('0x31')]['key']};});_0x3c7702[_0x68eb('0x32')]=_[_0x68eb('0x2d')](_0x48c427,_0x68eb('0x2b'));_0x3c7702[_0x68eb('0x33')]=_[_0x68eb('0x34')](_0x5903fd[_0x68eb('0x33')]);_0x3c7702[_0x68eb('0x35')]=_['intersection'](_0x3c7702[_0x68eb('0x32')],_0x3c7702[_0x68eb('0x33')]);_0x3cecbb[_0x68eb('0x36')]=_[_0x68eb('0x37')](_0x3c7702[_0x68eb('0x32')],qs['fields'](_0x5903fd[_0x68eb('0x33')]['fields']));_0x3cecbb[_0x68eb('0x36')]=_0x3cecbb[_0x68eb('0x36')]['length']?_0x3cecbb[_0x68eb('0x36')]:_0x3c7702['model'];if(!_0x5903fd[_0x68eb('0x33')][_0x68eb('0x38')](_0x68eb('0x39'))){_0x3cecbb[_0x68eb('0x3a')]=qs[_0x68eb('0x3a')](_0x5903fd[_0x68eb('0x33')]['limit']);_0x3cecbb[_0x68eb('0x1d')]=qs[_0x68eb('0x1d')](_0x5903fd['query']['offset']);}_0x3cecbb['order']=qs[_0x68eb('0x3b')](_0x5903fd['query'][_0x68eb('0x3b')]);_0x3cecbb['where']=qs[_0x68eb('0x35')](_['pick'](_0x5903fd[_0x68eb('0x33')],_0x3c7702[_0x68eb('0x35')]),_0x48c427);if(_0x5903fd['query']['filter']){_0x3cecbb['where']=_[_0x68eb('0x3c')](_0x3cecbb[_0x68eb('0x3d')],{'$or':_['map'](_0x48c427,function(_0x5a5f2b){if(_0x5a5f2b[_0x68eb('0x31')]!=='VIRTUAL'){var _0x52bb70={};_0x52bb70[_0x5a5f2b[_0x68eb('0x2b')]]={'$like':'%'+_0x5903fd[_0x68eb('0x33')][_0x68eb('0x3e')]+'%'};return _0x52bb70;}})});}_0x3cecbb=_[_0x68eb('0x3c')]({},_0x3cecbb,_0x5903fd['options']);var _0x364310={'where':_0x3cecbb[_0x68eb('0x3d')]};return db[_0x68eb('0x2e')][_0x68eb('0x1c')](_0x364310)[_0x68eb('0x26')](function(_0x162f33){_0x19116d['count']=_0x162f33;if(_0x5903fd[_0x68eb('0x33')][_0x68eb('0x3f')]){_0x3cecbb['include']=[{'all':!![]}];}return db[_0x68eb('0x2e')][_0x68eb('0x40')](_0x3cecbb);})[_0x68eb('0x26')](function(_0x102623){_0x19116d[_0x68eb('0x41')]=_0x102623;return _0x19116d;})[_0x68eb('0x26')](respondWithFilteredResult(_0x2711e2,_0x3cecbb))['catch'](handleError(_0x2711e2,null));};exports[_0x68eb('0x42')]=function(_0x2d39a8,_0x1c4426){var _0xc8558d={'raw':!![],'where':{'id':_0x2d39a8[_0x68eb('0x43')]['id']}},_0x16021f={};_0x16021f[_0x68eb('0x32')]=_[_0x68eb('0x34')](db[_0x68eb('0x2e')][_0x68eb('0x2f')]);_0x16021f[_0x68eb('0x33')]=_[_0x68eb('0x34')](_0x2d39a8['query']);_0x16021f[_0x68eb('0x35')]=_[_0x68eb('0x37')](_0x16021f[_0x68eb('0x32')],_0x16021f[_0x68eb('0x33')]);_0xc8558d['attributes']=_[_0x68eb('0x37')](_0x16021f['model'],qs['fields'](_0x2d39a8[_0x68eb('0x33')][_0x68eb('0x44')]));_0xc8558d['attributes']=_0xc8558d[_0x68eb('0x36')][_0x68eb('0x45')]?_0xc8558d[_0x68eb('0x36')]:_0x16021f[_0x68eb('0x32')];if(_0x2d39a8[_0x68eb('0x33')][_0x68eb('0x3f')]){_0xc8558d[_0x68eb('0x46')]=[{'all':!![]}];}_0xc8558d=_[_0x68eb('0x3c')]({},_0xc8558d,_0x2d39a8['options']);return db['AnalyticExtractedReport'][_0x68eb('0x47')](_0xc8558d)[_0x68eb('0x26')](handleEntityNotFound(_0x1c4426,null))['then'](respondWithResult(_0x1c4426,null))[_0x68eb('0x48')](handleError(_0x1c4426,null));};exports['create']=function(_0x5d7943,_0x161ea9){return db[_0x68eb('0x2e')][_0x68eb('0x49')](_0x5d7943['body'],{})[_0x68eb('0x26')](function(_0x434bef){var _0x368c01=_0x5d7943[_0x68eb('0x4a')][_0x68eb('0x27')]({'plain':!![]});if(!_0x368c01)throw new Error(_0x68eb('0x4b'));if(_0x368c01[_0x68eb('0x4c')]===_0x68eb('0x4a')){var _0x4367a5=_0x434bef[_0x68eb('0x27')]({'plain':!![]});var _0x3b37c9=_0x68eb('0x28');return db[_0x68eb('0x4d')][_0x68eb('0x47')]({'where':{'name':_0x3b37c9,'userProfileId':_0x368c01['userProfileId']},'raw':!![]})['then'](function(_0x44b925){if(_0x44b925&&_0x44b925['autoAssociation']===0x0){return db[_0x68eb('0x29')][_0x68eb('0x49')]({'name':_0x4367a5[_0x68eb('0x2b')],'resourceId':_0x4367a5['id'],'type':_0x44b925[_0x68eb('0x2b')],'sectionId':_0x44b925['id']},{})['then'](function(){return _0x434bef;});}else{return _0x434bef;}})[_0x68eb('0x48')](function(_0x22c15a){logger[_0x68eb('0x4e')](_0x68eb('0x4f'),_0x22c15a);throw _0x22c15a;});}return _0x434bef;})[_0x68eb('0x26')](respondWithResult(_0x161ea9,0xc9))[_0x68eb('0x48')](handleError(_0x161ea9,null));};exports[_0x68eb('0x24')]=function(_0x5ec04b,_0x51bc8c){if(_0x5ec04b[_0x68eb('0x50')]['id']){delete _0x5ec04b[_0x68eb('0x50')]['id'];}return db[_0x68eb('0x2e')]['find']({'where':{'id':_0x5ec04b[_0x68eb('0x43')]['id']}})[_0x68eb('0x26')](handleEntityNotFound(_0x51bc8c,null))[_0x68eb('0x26')](saveUpdates(_0x5ec04b[_0x68eb('0x50')],null))[_0x68eb('0x26')](respondWithResult(_0x51bc8c,null))[_0x68eb('0x48')](handleError(_0x51bc8c,null));};exports[_0x68eb('0x25')]=function(_0x2b7748,_0x2e5fc9){return db[_0x68eb('0x2e')][_0x68eb('0x47')]({'where':{'id':_0x2b7748[_0x68eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e5fc9,null))['then'](removeEntity(_0x2e5fc9,null))[_0x68eb('0x48')](handleError(_0x2e5fc9,null));};exports['download']=function(_0x4f585e,_0x3fa535,_0x48398f){return db[_0x68eb('0x2e')][_0x68eb('0x47')]({'where':{'id':_0x4f585e['params']['id']},'attributes':[_0x68eb('0x2b'),_0x68eb('0x51'),'savename',_0x68eb('0x52')],'raw':!![]})[_0x68eb('0x26')](handleEntityNotFound(_0x3fa535,null))[_0x68eb('0x26')](function(_0x37091a){if(_0x37091a){if(!fs[_0x68eb('0x53')](path[_0x68eb('0x54')](config[_0x68eb('0x55')],_0x68eb('0x56'),_0x37091a[_0x68eb('0x57')]))){throw new db[(_0x68eb('0x58'))][(_0x68eb('0x59'))](_0x68eb('0x5a'));}if(_0x4f585e[_0x68eb('0x33')][_0x68eb('0x5b')]){return _0x3fa535[_0x68eb('0x18')](0xc8);}return _0x3fa535['download'](path[_0x68eb('0x54')](config[_0x68eb('0x55')],'server/files/reports',_0x37091a[_0x68eb('0x57')]),util['format'](_0x68eb('0x5c'),_0x37091a['basename']||_0x37091a[_0x68eb('0x2b')],_0x37091a[_0x68eb('0x52')][_0x68eb('0x5d')]()));}})[_0x68eb('0x48')](handleError(_0x3fa535,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b076f5b..ecefbe5 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 _0xd4d8=['api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','lodash','../../config/logger'];(function(_0x1f018b,_0x8640d9){var _0x5f39a4=function(_0x3e87c5){while(--_0x3e87c5){_0x1f018b['push'](_0x1f018b['shift']());}};_0x5f39a4(++_0x8640d9);}(_0xd4d8,0xee));var _0x8d4d=function(_0x42ab91,_0x2a0179){_0x42ab91=_0x42ab91-0x0;var _0x259d35=_0xd4d8[_0x42ab91];return _0x259d35;};'use strict';var _=require(_0x8d4d('0x0'));var util=require('util');var logger=require(_0x8d4d('0x1'))(_0x8d4d('0x2'));var moment=require(_0x8d4d('0x3'));var BPromise=require(_0x8d4d('0x4'));var rp=require(_0x8d4d('0x5'));var fs=require('fs');var path=require(_0x8d4d('0x6'));var rimraf=require(_0x8d4d('0x7'));var config=require('../../config/environment');var attributes=require(_0x8d4d('0x8'));module['exports']=function(_0x3db03d,_0x4c396a){return _0x3db03d[_0x8d4d('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa69d=['./analyticExtractedReport.attributes','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x42292d,_0x7e3457){var _0x306751=function(_0x4f2a8d){while(--_0x4f2a8d){_0x42292d['push'](_0x42292d['shift']());}};_0x306751(++_0x7e3457);}(_0xa69d,0x1df));var _0xda69=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa69d[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xda69('0x0'));var util=require(_0xda69('0x1'));var logger=require(_0xda69('0x2'))('api');var moment=require(_0xda69('0x3'));var BPromise=require(_0xda69('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda69('0x5'));var rimraf=require('rimraf');var config=require(_0xda69('0x6'));var attributes=require(_0xda69('0x7'));module['exports']=function(_0xdc4642,_0x525ef2){return _0xdc4642['define']('AnalyticExtractedReport',attributes,{'tableName':_0xda69('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 6d12d59..ceb9c06 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 _0xf263=['rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf263,0x149));var _0x3f26=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0xf263[_0x4cf8d4];return _0x2c1beb;};'use strict';var _=require(_0x3f26('0x0'));var util=require(_0x3f26('0x1'));var moment=require(_0x3f26('0x2'));var BPromise=require(_0x3f26('0x3'));var rs=require(_0x3f26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f26('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f26('0x6'))(_0x3f26('0x7'));var config=require(_0x3f26('0x8'));var jayson=require(_0x3f26('0x9'));var client=jayson['client'][_0x3f26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae1ad,_0x48392a,_0x50fb53){return new BPromise(function(_0x25f9bd,_0x202d88){return client[_0x3f26('0xb')](_0x3ae1ad,_0x50fb53)['then'](function(_0x219fc5){logger[_0x3f26('0xc')](_0x3f26('0xd'),_0x48392a,_0x3f26('0xe'));logger[_0x3f26('0xf')](_0x3f26('0x10'),_0x48392a,_0x3f26('0xe'),JSON[_0x3f26('0x11')](_0x219fc5));if(_0x219fc5[_0x3f26('0x12')]){if(_0x219fc5[_0x3f26('0x12')]['code']===0x1f4){logger['error'](_0x3f26('0xd'),_0x48392a,_0x219fc5[_0x3f26('0x12')][_0x3f26('0x13')]);return _0x202d88(_0x219fc5[_0x3f26('0x12')]['message']);}logger[_0x3f26('0x12')](_0x3f26('0xd'),_0x48392a,_0x219fc5[_0x3f26('0x12')][_0x3f26('0x13')]);return _0x25f9bd(_0x219fc5['error'][_0x3f26('0x13')]);}else{logger[_0x3f26('0xc')](_0x3f26('0xd'),_0x48392a,_0x3f26('0xe'));_0x25f9bd(_0x219fc5['result'][_0x3f26('0x13')]);}})[_0x3f26('0x14')](function(_0x3bcf44){logger[_0x3f26('0x12')](_0x3f26('0xd'),_0x48392a,_0x3bcf44);_0x202d88(_0x3bcf44);});});} \ No newline at end of file +var _0xc529=['http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1e54a7,_0x4e7ea3){var _0x41d78e=function(_0xbf0801){while(--_0xbf0801){_0x1e54a7['push'](_0x1e54a7['shift']());}};_0x41d78e(++_0x4e7ea3);}(_0xc529,0x1ef));var _0x9c52=function(_0x44aa7b,_0x4bfc07){_0x44aa7b=_0x44aa7b-0x0;var _0x202405=_0xc529[_0x44aa7b];return _0x202405;};'use strict';var _=require(_0x9c52('0x0'));var util=require('util');var moment=require(_0x9c52('0x1'));var BPromise=require(_0x9c52('0x2'));var rs=require(_0x9c52('0x3'));var fs=require('fs');var Redis=require(_0x9c52('0x4'));var db=require(_0x9c52('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c52('0x6'))('rpc');var config=require(_0x9c52('0x7'));var jayson=require(_0x9c52('0x8'));var client=jayson['client'][_0x9c52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294c19,_0x18064b,_0x5a1bcc){return new BPromise(function(_0x4bceab,_0x5d6076){return client[_0x9c52('0xa')](_0x294c19,_0x5a1bcc)['then'](function(_0x1b8f29){logger[_0x9c52('0xb')](_0x9c52('0xc'),_0x18064b,_0x9c52('0xd'));logger['debug'](_0x9c52('0xe'),_0x18064b,'request\x20sent',JSON[_0x9c52('0xf')](_0x1b8f29));if(_0x1b8f29[_0x9c52('0x10')]){if(_0x1b8f29[_0x9c52('0x10')][_0x9c52('0x11')]===0x1f4){logger[_0x9c52('0x10')](_0x9c52('0xc'),_0x18064b,_0x1b8f29[_0x9c52('0x10')]['message']);return _0x5d6076(_0x1b8f29['error'][_0x9c52('0x12')]);}logger[_0x9c52('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x18064b,_0x1b8f29['error']['message']);return _0x4bceab(_0x1b8f29['error'][_0x9c52('0x12')]);}else{logger[_0x9c52('0xb')](_0x9c52('0xc'),_0x18064b,_0x9c52('0xd'));_0x4bceab(_0x1b8f29[_0x9c52('0x13')][_0x9c52('0x12')]);}})[_0x9c52('0x14')](function(_0x239632){logger[_0x9c52('0x10')](_0x9c52('0xc'),_0x18064b,_0x239632);_0x5d6076(_0x239632);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index fe2d78d..e17e7f1 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 _0x8ec5=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x582e57,_0x85fded){var _0xfef0e6=function(_0x4b78be){while(--_0x4b78be){_0x582e57['push'](_0x582e57['shift']());}};_0xfef0e6(++_0x85fded);}(_0x8ec5,0x1a1));var _0x58ec=function(_0x3782cb,_0x46f0be){_0x3782cb=_0x3782cb-0x0;var _0x557f9a=_0x8ec5[_0x3782cb];return _0x557f9a;};'use strict';var multer=require('multer');var util=require(_0x58ec('0x0'));var path=require(_0x58ec('0x1'));var timeout=require(_0x58ec('0x2'));var express=require(_0x58ec('0x3'));var router=express[_0x58ec('0x4')]();var fs_extra=require(_0x58ec('0x5'));var auth=require(_0x58ec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x58ec('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x58ec('0x8')]('/',auth[_0x58ec('0x9')](),controller[_0x58ec('0xa')]);router[_0x58ec('0x8')](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0xc')]);router[_0x58ec('0x8')](_0x58ec('0xd'),auth[_0x58ec('0x9')](),controller[_0x58ec('0xe')]);router[_0x58ec('0xf')]('/',auth[_0x58ec('0x9')](),controller[_0x58ec('0x10')]);router[_0x58ec('0x11')](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0x12')]);router['delete'](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0x13')]);module[_0x58ec('0x14')]=router; \ No newline at end of file +var _0x8e47=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','put','update','delete','/:id'];(function(_0x5593be,_0x5c8b96){var _0x597b71=function(_0x2104a3){while(--_0x2104a3){_0x5593be['push'](_0x5593be['shift']());}};_0x597b71(++_0x5c8b96);}(_0x8e47,0xf1));var _0x78e4=function(_0xdc8d8e,_0x3b33a8){_0xdc8d8e=_0xdc8d8e-0x0;var _0xad29da=_0x8e47[_0xdc8d8e];return _0xad29da;};'use strict';var multer=require(_0x78e4('0x0'));var util=require(_0x78e4('0x1'));var path=require(_0x78e4('0x2'));var timeout=require(_0x78e4('0x3'));var express=require(_0x78e4('0x4'));var router=express[_0x78e4('0x5')]();var fs_extra=require(_0x78e4('0x6'));var auth=require(_0x78e4('0x7'));var interaction=require(_0x78e4('0x8'));var config=require(_0x78e4('0x9'));var controller=require(_0x78e4('0xa'));router[_0x78e4('0xb')]('/',auth[_0x78e4('0xc')](),controller['index']);router[_0x78e4('0xb')]('/:id',auth[_0x78e4('0xc')](),controller[_0x78e4('0xd')]);router[_0x78e4('0xb')](_0x78e4('0xe'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x78e4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x78e4('0x10')]);router[_0x78e4('0x11')](_0x78e4('0x12'),auth[_0x78e4('0xc')](),controller['destroy']);module[_0x78e4('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index f4448b8..d86e525 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 _0x3f78=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f78,0x9a));var _0x83f7=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x3f78[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0x83f7('0x0'));module[_0x83f7('0x1')]={'field':{'type':Sequelize[_0x83f7('0x2')]},'alias':{'type':Sequelize[_0x83f7('0x3')]},'function':{'type':Sequelize[_0x83f7('0x3')]},'format':{'type':Sequelize[_0x83f7('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x83f7('0x3')]},'custom':{'type':Sequelize[_0x83f7('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x5771=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x45f3be,_0x5d5df5){var _0x41b0ab=function(_0x3dec21){while(--_0x3dec21){_0x45f3be['push'](_0x45f3be['shift']());}};_0x41b0ab(++_0x5d5df5);}(_0x5771,0x81));var _0x1577=function(_0x4e3145,_0x3d453d){_0x4e3145=_0x4e3145-0x0;var _0x52dc60=_0x5771[_0x4e3145];return _0x52dc60;};'use strict';var Sequelize=require(_0x1577('0x0'));module['exports']={'field':{'type':Sequelize[_0x1577('0x1')]},'alias':{'type':Sequelize[_0x1577('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1577('0x2')]},'groupBy':{'type':Sequelize[_0x1577('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1577('0x2')]},'custom':{'type':Sequelize[_0x1577('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index db27f9d..a0c3349 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 _0xd2cd=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','merge','catch','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x30b9d6,_0x2ad4ea){var _0x5f4d07=function(_0xc507f1){while(--_0xc507f1){_0x30b9d6['push'](_0x30b9d6['shift']());}};_0x5f4d07(++_0x2ad4ea);}(_0xd2cd,0x14f));var _0xdd2c=function(_0xe0dee2,_0x35d2a8){_0xe0dee2=_0xe0dee2-0x0;var _0x568ed0=_0xd2cd[_0xe0dee2];return _0x568ed0;};'use strict';var emlformat=require(_0xdd2c('0x0'));var rimraf=require(_0xdd2c('0x1'));var zipdir=require(_0xdd2c('0x2'));var jsonpatch=require(_0xdd2c('0x3'));var rp=require(_0xdd2c('0x4'));var moment=require(_0xdd2c('0x5'));var BPromise=require(_0xdd2c('0x6'));var Mustache=require(_0xdd2c('0x7'));var util=require(_0xdd2c('0x8'));var path=require('path');var sox=require(_0xdd2c('0x9'));var csv=require('to-csv');var ejs=require(_0xdd2c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd2c('0xb'));var crypto=require(_0xdd2c('0xc'));var jsforce=require(_0xdd2c('0xd'));var deskjs=require(_0xdd2c('0xe'));var toCsv=require(_0xdd2c('0xf'));var querystring=require('querystring');var Papa=require(_0xdd2c('0x10'));var Redis=require(_0xdd2c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd2c('0x12'));var as=require(_0xdd2c('0x13'));var hardwareService=require(_0xdd2c('0x14'));var logger=require(_0xdd2c('0x15'))(_0xdd2c('0x16'));var utils=require(_0xdd2c('0x17'));var config=require(_0xdd2c('0x18'));var licenseUtil=require(_0xdd2c('0x19'));var db=require(_0xdd2c('0x1a'))['db'];function respondWithStatusCode(_0x447453,_0x238934){_0x238934=_0x238934||0xcc;return function(_0x4b505c){if(_0x4b505c){return _0x447453[_0xdd2c('0x1b')](_0x238934);}return _0x447453[_0xdd2c('0x1c')](_0x238934)[_0xdd2c('0x1d')]();};}function respondWithResult(_0x32920c,_0x2524b4){_0x2524b4=_0x2524b4||0xc8;return function(_0x1b4d35){if(_0x1b4d35){return _0x32920c[_0xdd2c('0x1c')](_0x2524b4)[_0xdd2c('0x1e')](_0x1b4d35);}};}function respondWithFilteredResult(_0x550cd6,_0x5a4f82){return function(_0x30d7b8){if(_0x30d7b8){var _0x4321cf=typeof _0x5a4f82[_0xdd2c('0x1f')]===_0xdd2c('0x20')&&typeof _0x5a4f82[_0xdd2c('0x21')]===_0xdd2c('0x20');var _0x1bc142=_0x30d7b8[_0xdd2c('0x22')];var _0x1b69f2=_0x4321cf?0x0:_0x5a4f82[_0xdd2c('0x1f')];var _0x11af89=_0x4321cf?_0x30d7b8['count']:_0x5a4f82[_0xdd2c('0x1f')]+_0x5a4f82[_0xdd2c('0x21')];var _0x48584f;if(_0x11af89>=_0x1bc142){_0x11af89=_0x1bc142;_0x48584f=0xc8;}else{_0x48584f=0xce;}_0x550cd6[_0xdd2c('0x1c')](_0x48584f);return _0x550cd6['set'](_0xdd2c('0x23'),_0x1b69f2+'-'+_0x11af89+'/'+_0x1bc142)[_0xdd2c('0x1e')](_0x30d7b8);}return null;};}function patchUpdates(_0x1cdcc3){return function(_0x2c01a6){try{jsonpatch[_0xdd2c('0x24')](_0x2c01a6,_0x1cdcc3,!![]);}catch(_0x48f473){return BPromise[_0xdd2c('0x25')](_0x48f473);}return _0x2c01a6[_0xdd2c('0x26')]();};}function saveUpdates(_0xecea5a,_0x4c2c90){return function(_0x1049b9){if(_0x1049b9){return _0x1049b9[_0xdd2c('0x27')](_0xecea5a)[_0xdd2c('0x28')](function(_0x40b625){return _0x40b625;});}return null;};}function removeEntity(_0x4d4444,_0x5d44aa){return function(_0x8b670c){if(_0x8b670c){return _0x8b670c[_0xdd2c('0x29')]()[_0xdd2c('0x28')](function(){_0x4d4444['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c043,_0x3b4cfb){return function(_0x3130dd){if(!_0x3130dd){_0x27c043[_0xdd2c('0x1b')](0x194);}return _0x3130dd;};}function handleError(_0x1a2cd0,_0x25f91a){_0x25f91a=_0x25f91a||0x1f4;return function(_0x43b623){logger[_0xdd2c('0x2a')](_0x43b623[_0xdd2c('0x2b')]);if(_0x43b623[_0xdd2c('0x2c')]){delete _0x43b623['name'];}_0x1a2cd0[_0xdd2c('0x1c')](_0x25f91a)['send'](_0x43b623);};}exports[_0xdd2c('0x2d')]=function(_0x2144bd,_0x350c5a){var _0x584168={},_0x3cde73={},_0x33df32={'count':0x0,'rows':[]};var _0x1059ac=_[_0xdd2c('0x2e')](db[_0xdd2c('0x2f')]['rawAttributes'],function(_0x972a97){return{'name':_0x972a97[_0xdd2c('0x30')],'type':_0x972a97[_0xdd2c('0x31')][_0xdd2c('0x32')]};});_0x3cde73[_0xdd2c('0x33')]=_[_0xdd2c('0x2e')](_0x1059ac,_0xdd2c('0x2c'));_0x3cde73['query']=_[_0xdd2c('0x34')](_0x2144bd[_0xdd2c('0x35')]);_0x3cde73[_0xdd2c('0x36')]=_[_0xdd2c('0x37')](_0x3cde73[_0xdd2c('0x33')],_0x3cde73['query']);_0x584168['attributes']=_['intersection'](_0x3cde73[_0xdd2c('0x33')],qs[_0xdd2c('0x38')](_0x2144bd[_0xdd2c('0x35')]['fields']));_0x584168['attributes']=_0x584168[_0xdd2c('0x39')][_0xdd2c('0x3a')]?_0x584168[_0xdd2c('0x39')]:_0x3cde73[_0xdd2c('0x33')];if(!_0x2144bd[_0xdd2c('0x35')]['hasOwnProperty'](_0xdd2c('0x3b'))){_0x584168[_0xdd2c('0x21')]=qs['limit'](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x21')]);_0x584168[_0xdd2c('0x1f')]=qs[_0xdd2c('0x1f')](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x1f')]);}_0x584168[_0xdd2c('0x3c')]=qs[_0xdd2c('0x3d')](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x3d')]);_0x584168[_0xdd2c('0x3e')]=qs[_0xdd2c('0x36')](_[_0xdd2c('0x3f')](_0x2144bd[_0xdd2c('0x35')],_0x3cde73[_0xdd2c('0x36')]),_0x1059ac);if(_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x40')]){_0x584168[_0xdd2c('0x3e')]=_['merge'](_0x584168[_0xdd2c('0x3e')],{'$or':_[_0xdd2c('0x2e')](_0x1059ac,function(_0x3b5393){if(_0x3b5393['type']!==_0xdd2c('0x41')){var _0x324d29={};_0x324d29[_0x3b5393[_0xdd2c('0x2c')]]={'$like':'%'+_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x40')]+'%'};return _0x324d29;}})});}_0x584168=_['merge']({},_0x584168,_0x2144bd[_0xdd2c('0x42')]);var _0x50d5cb={'where':_0x584168[_0xdd2c('0x3e')]};return db[_0xdd2c('0x2f')][_0xdd2c('0x22')](_0x50d5cb)[_0xdd2c('0x28')](function(_0x306a2a){_0x33df32['count']=_0x306a2a;if(_0x2144bd['query'][_0xdd2c('0x43')]){_0x584168[_0xdd2c('0x44')]=[{'all':!![]}];}return db[_0xdd2c('0x2f')][_0xdd2c('0x45')](_0x584168);})[_0xdd2c('0x28')](function(_0x5c3700){_0x33df32[_0xdd2c('0x46')]=_0x5c3700;return _0x33df32;})[_0xdd2c('0x28')](respondWithFilteredResult(_0x350c5a,_0x584168))['catch'](handleError(_0x350c5a,null));};exports[_0xdd2c('0x47')]=function(_0x7e5f72,_0x40aa19){var _0x4e3712={'raw':![],'where':{'id':_0x7e5f72[_0xdd2c('0x48')]['id']}},_0x31e04f={};_0x31e04f[_0xdd2c('0x33')]=_[_0xdd2c('0x34')](db['AnalyticFieldReport'][_0xdd2c('0x49')]);_0x31e04f[_0xdd2c('0x35')]=_[_0xdd2c('0x34')](_0x7e5f72['query']);_0x31e04f[_0xdd2c('0x36')]=_[_0xdd2c('0x37')](_0x31e04f[_0xdd2c('0x33')],_0x31e04f['query']);_0x4e3712[_0xdd2c('0x39')]=_[_0xdd2c('0x37')](_0x31e04f[_0xdd2c('0x33')],qs[_0xdd2c('0x38')](_0x7e5f72['query']['fields']));_0x4e3712[_0xdd2c('0x39')]=_0x4e3712[_0xdd2c('0x39')][_0xdd2c('0x3a')]?_0x4e3712[_0xdd2c('0x39')]:_0x31e04f[_0xdd2c('0x33')];if(_0x7e5f72['query']['includeAll']){_0x4e3712[_0xdd2c('0x44')]=[{'all':!![]}];}_0x4e3712=_[_0xdd2c('0x4a')]({},_0x4e3712,_0x7e5f72['options']);return db[_0xdd2c('0x2f')]['find'](_0x4e3712)['then'](handleEntityNotFound(_0x40aa19,null))[_0xdd2c('0x28')](respondWithResult(_0x40aa19,null))[_0xdd2c('0x4b')](handleError(_0x40aa19,null));};exports[_0xdd2c('0x4c')]=function(_0x9d2248,_0x1e01a6){return db['AnalyticFieldReport']['create'](_0x9d2248[_0xdd2c('0x4d')],{})[_0xdd2c('0x28')](respondWithResult(_0x1e01a6,0xc9))[_0xdd2c('0x4b')](handleError(_0x1e01a6,null));};exports['bulkCreate']=function(_0x38f5a3,_0x1c721d){return db[_0xdd2c('0x2f')][_0xdd2c('0x4e')](_0x38f5a3[_0xdd2c('0x4d')],{'raw':![],'individualHooks':!![]})[_0xdd2c('0x28')](respondWithResult(_0x1c721d,0xc9))[_0xdd2c('0x4b')](handleError(_0x1c721d,null));};exports['update']=function(_0x3120fe,_0x43aa33){if(_0x3120fe[_0xdd2c('0x4d')]['id']){delete _0x3120fe[_0xdd2c('0x4d')]['id'];}return db[_0xdd2c('0x2f')][_0xdd2c('0x4f')]({'where':{'id':_0x3120fe[_0xdd2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x43aa33,null))[_0xdd2c('0x28')](saveUpdates(_0x3120fe['body'],null))['then'](respondWithResult(_0x43aa33,null))[_0xdd2c('0x4b')](handleError(_0x43aa33,null));};exports[_0xdd2c('0x29')]=function(_0x59ec0f,_0x113f19){return db['AnalyticFieldReport'][_0xdd2c('0x4f')]({'where':{'id':_0x59ec0f[_0xdd2c('0x48')]['id']}})[_0xdd2c('0x28')](handleEntityNotFound(_0x113f19,null))[_0xdd2c('0x28')](removeEntity(_0x113f19,null))[_0xdd2c('0x4b')](handleError(_0x113f19,null));};exports[_0xdd2c('0x50')]=function(_0xac54ce,_0x569df1){return db['AnalyticFieldReport'][_0xdd2c('0x29')]({'where':{'id':_0xac54ce['query'][_0xdd2c('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xdd2c('0x28')](respondWithResult(_0x569df1,0xcc))[_0xdd2c('0x4b')](handleError(_0x569df1,null));};exports[_0xdd2c('0x52')]=function(_0x14ed1f,_0x5a651b,_0x149338){return db[_0xdd2c('0x53')][_0xdd2c('0x54')]({'where':{'id':_0x14ed1f[_0xdd2c('0x48')]['id']}})[_0xdd2c('0x28')](handleEntityNotFound(_0x5a651b,null))[_0xdd2c('0x28')](function(_0x3cc5b9){if(_0x3cc5b9){return db[_0xdd2c('0x55')][_0xdd2c('0x56')](function(_0x913ccd){return db[_0xdd2c('0x2f')]['destroy']({'where':{'CustomReportId':_0x14ed1f['params']['id']},'transaction':_0x913ccd})['then'](function(_0x77a343){var _0x255f49=_['map'](_0x14ed1f['body'],function(_0x28f512){delete _0x28f512['id'];_0x28f512[_0xdd2c('0x57')]=_0x14ed1f[_0xdd2c('0x48')]['id'];return _0x28f512;});return db[_0xdd2c('0x2f')][_0xdd2c('0x4e')](_0x255f49,{'transaction':_0x913ccd});});})['then'](function(){return db[_0xdd2c('0x2f')][_0xdd2c('0x45')]({'where':{'CustomReportId':_0x14ed1f['params']['id']}});});}})[_0xdd2c('0x28')](respondWithResult(_0x5a651b,null))[_0xdd2c('0x4b')](handleError(_0x5a651b,null));}; \ No newline at end of file +var _0x99e1=['params','keys','create','bulkCreate','body','find','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','include','catch'];(function(_0x2dbf6d,_0x1ed975){var _0x269475=function(_0x217213){while(--_0x217213){_0x2dbf6d['push'](_0x2dbf6d['shift']());}};_0x269475(++_0x1ed975);}(_0x99e1,0x1dd));var _0x199e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x99e1[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require(_0x199e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x199e('0x1'));var jsonpatch=require(_0x199e('0x2'));var rp=require('request-promise');var moment=require(_0x199e('0x3'));var BPromise=require(_0x199e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x199e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x199e('0x6'));var _=require(_0x199e('0x7'));var squel=require(_0x199e('0x8'));var crypto=require(_0x199e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x199e('0xa'));var toCsv=require(_0x199e('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x199e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x199e('0xd'));var as=require(_0x199e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x199e('0xf'))(_0x199e('0x10'));var utils=require(_0x199e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x199e('0x12'));var db=require(_0x199e('0x13'))['db'];function respondWithStatusCode(_0x5424f6,_0x4c9309){_0x4c9309=_0x4c9309||0xcc;return function(_0x35fa3d){if(_0x35fa3d){return _0x5424f6[_0x199e('0x14')](_0x4c9309);}return _0x5424f6[_0x199e('0x15')](_0x4c9309)[_0x199e('0x16')]();};}function respondWithResult(_0x4c8cbe,_0x4810d5){_0x4810d5=_0x4810d5||0xc8;return function(_0x39cd4d){if(_0x39cd4d){return _0x4c8cbe['status'](_0x4810d5)['json'](_0x39cd4d);}};}function respondWithFilteredResult(_0x5eac9b,_0x250c39){return function(_0x2f82b9){if(_0x2f82b9){var _0x5f2014=typeof _0x250c39['offset']===_0x199e('0x17')&&typeof _0x250c39['limit']===_0x199e('0x17');var _0x28b84e=_0x2f82b9[_0x199e('0x18')];var _0x494b96=_0x5f2014?0x0:_0x250c39[_0x199e('0x19')];var _0x334d14=_0x5f2014?_0x2f82b9[_0x199e('0x18')]:_0x250c39['offset']+_0x250c39[_0x199e('0x1a')];var _0x4a0804;if(_0x334d14>=_0x28b84e){_0x334d14=_0x28b84e;_0x4a0804=0xc8;}else{_0x4a0804=0xce;}_0x5eac9b[_0x199e('0x15')](_0x4a0804);return _0x5eac9b[_0x199e('0x1b')](_0x199e('0x1c'),_0x494b96+'-'+_0x334d14+'/'+_0x28b84e)[_0x199e('0x1d')](_0x2f82b9);}return null;};}function patchUpdates(_0x1e4a32){return function(_0x59eb9a){try{jsonpatch[_0x199e('0x1e')](_0x59eb9a,_0x1e4a32,!![]);}catch(_0x529062){return BPromise['reject'](_0x529062);}return _0x59eb9a[_0x199e('0x1f')]();};}function saveUpdates(_0x311700,_0x16fa37){return function(_0x22d1d3){if(_0x22d1d3){return _0x22d1d3[_0x199e('0x20')](_0x311700)[_0x199e('0x21')](function(_0x10cc21){return _0x10cc21;});}return null;};}function removeEntity(_0xc8ba3e,_0x18d9bc){return function(_0x2f530c){if(_0x2f530c){return _0x2f530c['destroy']()[_0x199e('0x21')](function(){_0xc8ba3e[_0x199e('0x15')](0xcc)[_0x199e('0x16')]();});}};}function handleEntityNotFound(_0x5666ac,_0x3bb3f6){return function(_0x401366){if(!_0x401366){_0x5666ac[_0x199e('0x14')](0x194);}return _0x401366;};}function handleError(_0x47d6f5,_0x392d56){_0x392d56=_0x392d56||0x1f4;return function(_0x223e53){logger['error'](_0x223e53[_0x199e('0x22')]);if(_0x223e53['name']){delete _0x223e53[_0x199e('0x23')];}_0x47d6f5[_0x199e('0x15')](_0x392d56)['send'](_0x223e53);};}exports[_0x199e('0x24')]=function(_0x38caae,_0x7fe93a){var _0x1c70c3={},_0x1b394a={},_0x17c45e={'count':0x0,'rows':[]};var _0x5f2be4=_[_0x199e('0x25')](db['AnalyticFieldReport'][_0x199e('0x26')],function(_0x1b7eed){return{'name':_0x1b7eed[_0x199e('0x27')],'type':_0x1b7eed[_0x199e('0x28')]['key']};});_0x1b394a['model']=_[_0x199e('0x25')](_0x5f2be4,_0x199e('0x23'));_0x1b394a[_0x199e('0x29')]=_['keys'](_0x38caae[_0x199e('0x29')]);_0x1b394a[_0x199e('0x2a')]=_[_0x199e('0x2b')](_0x1b394a[_0x199e('0x2c')],_0x1b394a[_0x199e('0x29')]);_0x1c70c3[_0x199e('0x2d')]=_[_0x199e('0x2b')](_0x1b394a[_0x199e('0x2c')],qs[_0x199e('0x2e')](_0x38caae[_0x199e('0x29')][_0x199e('0x2e')]));_0x1c70c3[_0x199e('0x2d')]=_0x1c70c3[_0x199e('0x2d')][_0x199e('0x2f')]?_0x1c70c3['attributes']:_0x1b394a['model'];if(!_0x38caae['query'][_0x199e('0x30')](_0x199e('0x31'))){_0x1c70c3['limit']=qs[_0x199e('0x1a')](_0x38caae['query'][_0x199e('0x1a')]);_0x1c70c3['offset']=qs[_0x199e('0x19')](_0x38caae[_0x199e('0x29')]['offset']);}_0x1c70c3[_0x199e('0x32')]=qs[_0x199e('0x33')](_0x38caae[_0x199e('0x29')]['sort']);_0x1c70c3[_0x199e('0x34')]=qs[_0x199e('0x2a')](_[_0x199e('0x35')](_0x38caae[_0x199e('0x29')],_0x1b394a['filters']),_0x5f2be4);if(_0x38caae['query'][_0x199e('0x36')]){_0x1c70c3['where']=_[_0x199e('0x37')](_0x1c70c3['where'],{'$or':_[_0x199e('0x25')](_0x5f2be4,function(_0x586797){if(_0x586797[_0x199e('0x28')]!==_0x199e('0x38')){var _0x3bba28={};_0x3bba28[_0x586797['name']]={'$like':'%'+_0x38caae[_0x199e('0x29')]['filter']+'%'};return _0x3bba28;}})});}_0x1c70c3=_['merge']({},_0x1c70c3,_0x38caae[_0x199e('0x39')]);var _0x520cd3={'where':_0x1c70c3[_0x199e('0x34')]};return db[_0x199e('0x3a')][_0x199e('0x18')](_0x520cd3)['then'](function(_0xaa678){_0x17c45e['count']=_0xaa678;if(_0x38caae[_0x199e('0x29')][_0x199e('0x3b')]){_0x1c70c3[_0x199e('0x3c')]=[{'all':!![]}];}return db[_0x199e('0x3a')]['findAll'](_0x1c70c3);})[_0x199e('0x21')](function(_0x147aac){_0x17c45e['rows']=_0x147aac;return _0x17c45e;})[_0x199e('0x21')](respondWithFilteredResult(_0x7fe93a,_0x1c70c3))[_0x199e('0x3d')](handleError(_0x7fe93a,null));};exports['show']=function(_0x1b1496,_0x9af6c3){var _0x2a8bcd={'raw':![],'where':{'id':_0x1b1496[_0x199e('0x3e')]['id']}},_0x4f4ae6={};_0x4f4ae6['model']=_[_0x199e('0x3f')](db[_0x199e('0x3a')][_0x199e('0x26')]);_0x4f4ae6[_0x199e('0x29')]=_[_0x199e('0x3f')](_0x1b1496[_0x199e('0x29')]);_0x4f4ae6[_0x199e('0x2a')]=_[_0x199e('0x2b')](_0x4f4ae6[_0x199e('0x2c')],_0x4f4ae6[_0x199e('0x29')]);_0x2a8bcd[_0x199e('0x2d')]=_[_0x199e('0x2b')](_0x4f4ae6[_0x199e('0x2c')],qs[_0x199e('0x2e')](_0x1b1496[_0x199e('0x29')]['fields']));_0x2a8bcd[_0x199e('0x2d')]=_0x2a8bcd[_0x199e('0x2d')][_0x199e('0x2f')]?_0x2a8bcd[_0x199e('0x2d')]:_0x4f4ae6['model'];if(_0x1b1496[_0x199e('0x29')][_0x199e('0x3b')]){_0x2a8bcd[_0x199e('0x3c')]=[{'all':!![]}];}_0x2a8bcd=_[_0x199e('0x37')]({},_0x2a8bcd,_0x1b1496['options']);return db[_0x199e('0x3a')]['find'](_0x2a8bcd)[_0x199e('0x21')](handleEntityNotFound(_0x9af6c3,null))[_0x199e('0x21')](respondWithResult(_0x9af6c3,null))[_0x199e('0x3d')](handleError(_0x9af6c3,null));};exports[_0x199e('0x40')]=function(_0x40cea4,_0x85ff73){return db['AnalyticFieldReport'][_0x199e('0x40')](_0x40cea4['body'],{})[_0x199e('0x21')](respondWithResult(_0x85ff73,0xc9))['catch'](handleError(_0x85ff73,null));};exports['bulkCreate']=function(_0x2c5b17,_0x2301bf){return db[_0x199e('0x3a')][_0x199e('0x41')](_0x2c5b17[_0x199e('0x42')],{'raw':![],'individualHooks':!![]})[_0x199e('0x21')](respondWithResult(_0x2301bf,0xc9))[_0x199e('0x3d')](handleError(_0x2301bf,null));};exports[_0x199e('0x20')]=function(_0x4644e8,_0x261937){if(_0x4644e8[_0x199e('0x42')]['id']){delete _0x4644e8[_0x199e('0x42')]['id'];}return db[_0x199e('0x3a')][_0x199e('0x43')]({'where':{'id':_0x4644e8['params']['id']}})[_0x199e('0x21')](handleEntityNotFound(_0x261937,null))[_0x199e('0x21')](saveUpdates(_0x4644e8['body'],null))[_0x199e('0x21')](respondWithResult(_0x261937,null))['catch'](handleError(_0x261937,null));};exports[_0x199e('0x44')]=function(_0x4580db,_0x2fc8b6){return db[_0x199e('0x3a')][_0x199e('0x43')]({'where':{'id':_0x4580db[_0x199e('0x3e')]['id']}})[_0x199e('0x21')](handleEntityNotFound(_0x2fc8b6,null))[_0x199e('0x21')](removeEntity(_0x2fc8b6,null))[_0x199e('0x3d')](handleError(_0x2fc8b6,null));};exports[_0x199e('0x45')]=function(_0x59f2a7,_0x228f71){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x59f2a7[_0x199e('0x29')][_0x199e('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x199e('0x21')](respondWithResult(_0x228f71,0xcc))[_0x199e('0x3d')](handleError(_0x228f71,null));};exports[_0x199e('0x47')]=function(_0x9bc759,_0x73f47,_0x12e045){return db[_0x199e('0x48')][_0x199e('0x49')]({'where':{'id':_0x9bc759['params']['id']}})[_0x199e('0x21')](handleEntityNotFound(_0x73f47,null))[_0x199e('0x21')](function(_0x105eed){if(_0x105eed){return db[_0x199e('0x4a')][_0x199e('0x4b')](function(_0x162046){return db['AnalyticFieldReport'][_0x199e('0x44')]({'where':{'CustomReportId':_0x9bc759[_0x199e('0x3e')]['id']},'transaction':_0x162046})['then'](function(_0x35febf){var _0x5f0161=_[_0x199e('0x25')](_0x9bc759[_0x199e('0x42')],function(_0x3b5c43){delete _0x3b5c43['id'];_0x3b5c43['CustomReportId']=_0x9bc759['params']['id'];return _0x3b5c43;});return db[_0x199e('0x3a')][_0x199e('0x41')](_0x5f0161,{'transaction':_0x162046});});})['then'](function(){return db['AnalyticFieldReport'][_0x199e('0x4c')]({'where':{'CustomReportId':_0x9bc759[_0x199e('0x3e')]['id']}});});}})[_0x199e('0x21')](respondWithResult(_0x73f47,null))[_0x199e('0x3d')](handleError(_0x73f47,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ab0f127..e590ac9 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 _0x95a4=['bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','../../config/logger','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x95a4,0x17d));var _0x495a=function(_0xbd97f4,_0x8b5779){_0xbd97f4=_0xbd97f4-0x0;var _0x11ee12=_0x95a4[_0xbd97f4];return _0x11ee12;};'use strict';var _=require(_0x495a('0x0'));var util=require('util');var logger=require(_0x495a('0x1'))(_0x495a('0x2'));var moment=require(_0x495a('0x3'));var BPromise=require(_0x495a('0x4'));var rp=require(_0x495a('0x5'));var fs=require('fs');var path=require(_0x495a('0x6'));var rimraf=require('rimraf');var config=require(_0x495a('0x7'));var attributes=require(_0x495a('0x8'));module['exports']=function(_0x272c8f,_0x3a3ae4){return _0x272c8f[_0x495a('0x9')](_0x495a('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa9a=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xfa9a,0x12c));var _0xafa9=function(_0x2cc8c7,_0xc0fc97){_0x2cc8c7=_0x2cc8c7-0x0;var _0x4709e1=_0xfa9a[_0x2cc8c7];return _0x4709e1;};'use strict';var _=require(_0xafa9('0x0'));var util=require(_0xafa9('0x1'));var logger=require(_0xafa9('0x2'))(_0xafa9('0x3'));var moment=require(_0xafa9('0x4'));var BPromise=require('bluebird');var rp=require(_0xafa9('0x5'));var fs=require('fs');var path=require(_0xafa9('0x6'));var rimraf=require(_0xafa9('0x7'));var config=require(_0xafa9('0x8'));var attributes=require(_0xafa9('0x9'));module[_0xafa9('0xa')]=function(_0x905b7b,_0x5178c7){return _0x905b7b[_0xafa9('0xb')](_0xafa9('0xc'),attributes,{'tableName':_0xafa9('0xd'),'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 917c6a1..8e9974e 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 _0xdb8f=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xdb8f,0x1b3));var _0xfdb8=function(_0x243d52,_0x2d5634){_0x243d52=_0x243d52-0x0;var _0xbbf923=_0xdb8f[_0x243d52];return _0xbbf923;};'use strict';var _=require(_0xfdb8('0x0'));var util=require(_0xfdb8('0x1'));var moment=require(_0xfdb8('0x2'));var BPromise=require('bluebird');var rs=require(_0xfdb8('0x3'));var fs=require('fs');var Redis=require(_0xfdb8('0x4'));var db=require(_0xfdb8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfdb8('0x6'))(_0xfdb8('0x7'));var config=require(_0xfdb8('0x8'));var jayson=require(_0xfdb8('0x9'));var client=jayson['client'][_0xfdb8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34dc69,_0x4ebaef,_0x4aaa53){return new BPromise(function(_0x497403,_0x3d4898){return client[_0xfdb8('0xb')](_0x34dc69,_0x4aaa53)[_0xfdb8('0xc')](function(_0x3a2f83){logger[_0xfdb8('0xd')](_0xfdb8('0xe'),_0x4ebaef,_0xfdb8('0xf'));logger[_0xfdb8('0x10')](_0xfdb8('0x11'),_0x4ebaef,_0xfdb8('0xf'),JSON['stringify'](_0x3a2f83));if(_0x3a2f83[_0xfdb8('0x12')]){if(_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x13')]===0x1f4){logger[_0xfdb8('0x12')](_0xfdb8('0xe'),_0x4ebaef,_0x3a2f83['error'][_0xfdb8('0x14')]);return _0x3d4898(_0x3a2f83['error'][_0xfdb8('0x14')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4ebaef,_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x14')]);return _0x497403(_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x14')]);}else{logger[_0xfdb8('0xd')](_0xfdb8('0xe'),_0x4ebaef,_0xfdb8('0xf'));_0x497403(_0x3a2f83[_0xfdb8('0x15')][_0xfdb8('0x14')]);}})[_0xfdb8('0x16')](function(_0x2c9614){logger[_0xfdb8('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ebaef,_0x2c9614);_0x3d4898(_0x2c9614);});});} \ No newline at end of file +var _0xf962=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x16b334,_0x58bd7f){var _0x54aff2=function(_0x366b0e){while(--_0x366b0e){_0x16b334['push'](_0x16b334['shift']());}};_0x54aff2(++_0x58bd7f);}(_0xf962,0xf0));var _0x2f96=function(_0x57fc51,_0x564993){_0x57fc51=_0x57fc51-0x0;var _0x50f82c=_0xf962[_0x57fc51];return _0x50f82c;};'use strict';var _=require(_0x2f96('0x0'));var util=require('util');var moment=require(_0x2f96('0x1'));var BPromise=require(_0x2f96('0x2'));var rs=require(_0x2f96('0x3'));var fs=require('fs');var Redis=require(_0x2f96('0x4'));var db=require(_0x2f96('0x5'))['db'];var utils=require(_0x2f96('0x6'));var logger=require(_0x2f96('0x7'))(_0x2f96('0x8'));var config=require(_0x2f96('0x9'));var jayson=require(_0x2f96('0xa'));var client=jayson[_0x2f96('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52236e,_0x82c9f9,_0x4794e2){return new BPromise(function(_0x49767c,_0x3fddbf){return client[_0x2f96('0xc')](_0x52236e,_0x4794e2)[_0x2f96('0xd')](function(_0x3413a1){logger['info'](_0x2f96('0xe'),_0x82c9f9,_0x2f96('0xf'));logger[_0x2f96('0x10')](_0x2f96('0x11'),_0x82c9f9,_0x2f96('0xf'),JSON[_0x2f96('0x12')](_0x3413a1));if(_0x3413a1[_0x2f96('0x13')]){if(_0x3413a1[_0x2f96('0x13')][_0x2f96('0x14')]===0x1f4){logger[_0x2f96('0x13')](_0x2f96('0xe'),_0x82c9f9,_0x3413a1[_0x2f96('0x13')][_0x2f96('0x15')]);return _0x3fddbf(_0x3413a1[_0x2f96('0x13')]['message']);}logger[_0x2f96('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x82c9f9,_0x3413a1['error'][_0x2f96('0x15')]);return _0x49767c(_0x3413a1[_0x2f96('0x13')]['message']);}else{logger[_0x2f96('0x16')]('AnalyticFieldReport,\x20%s,\x20%s',_0x82c9f9,_0x2f96('0xf'));_0x49767c(_0x3413a1['result']['message']);}})[_0x2f96('0x17')](function(_0x408e95){logger[_0x2f96('0x13')](_0x2f96('0xe'),_0x82c9f9,_0x408e95);_0x3fddbf(_0x408e95);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 29ba26c..551460d 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(_0x4512c2,_0x4aed17){var _0x22b433=function(_0x5c3099){while(--_0x5c3099){_0x4512c2['push'](_0x4512c2['shift']());}};_0x22b433(++_0x4aed17);}(_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('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(_0x263367,_0xb38b8b){var _0x1d58a0=function(_0x496c80){while(--_0x496c80){_0x263367['push'](_0x263367['shift']());}};_0x1d58a0(++_0xb38b8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 82e7409..808c349 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 _0x195e=['TEXT','sequelize','exports','STRING','name'];(function(_0x44085a,_0x4381c5){var _0xec581a=function(_0x33120b){while(--_0x33120b){_0x44085a['push'](_0x44085a['shift']());}};_0xec581a(++_0x4381c5);}(_0x195e,0xfb));var _0xe195=function(_0x5a77eb,_0x1ed02d){_0x5a77eb=_0x5a77eb-0x0;var _0x1b3299=_0x195e[_0x5a77eb];return _0x1b3299;};'use strict';var Sequelize=require(_0xe195('0x0'));module[_0xe195('0x1')]={'name':{'type':Sequelize[_0xe195('0x2')],'allowNull':![],'unique':_0xe195('0x3')},'table':{'type':Sequelize[_0xe195('0x2')]},'metric':{'type':Sequelize[_0xe195('0x4')]},'description':{'type':Sequelize[_0xe195('0x2')]}}; \ No newline at end of file +var _0xa9e0=['exports','STRING','TEXT','sequelize'];(function(_0x4d42a9,_0x176a04){var _0x43c700=function(_0x42b1f8){while(--_0x42b1f8){_0x4d42a9['push'](_0x4d42a9['shift']());}};_0x43c700(++_0x176a04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0a9e('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b88d09c..5859ae6 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x291f89,_0x337249){var _0x6a2fb9=function(_0x59234e){while(--_0x59234e){_0x291f89['push'](_0x291f89['shift']());}};_0x6a2fb9(++_0x337249);}(_0x5fc3,0xa8));var _0x35fc=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5fc3[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x5b702c,_0x52b6a9){var _0x4ff637=function(_0xf11992){while(--_0xf11992){_0x5b702c['push'](_0x5b702c['shift']());}};_0x4ff637(++_0x52b6a9);}(_0x425d,0x1e0));var _0xd425=function(_0x908eb6,_0x59199b){_0x908eb6=_0x908eb6-0x0;var _0x511a09=_0x425d[_0x908eb6];return _0x511a09;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 8fedbf0..7e3535d 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 _0xd8af=['analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric'];(function(_0x25a048,_0x17f8cc){var _0x5b6d18=function(_0x5c4d6e){while(--_0x5c4d6e){_0x25a048['push'](_0x25a048['shift']());}};_0x5b6d18(++_0x17f8cc);}(_0xd8af,0x18d));var _0xfd8a=function(_0x5a2ad2,_0x5b44ab){_0x5a2ad2=_0x5a2ad2-0x0;var _0x4c0f1a=_0xd8af[_0x5a2ad2];return _0x4c0f1a;};'use strict';var _=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var logger=require(_0xfd8a('0x2'))(_0xfd8a('0x3'));var moment=require(_0xfd8a('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd8a('0x6'));var config=require(_0xfd8a('0x7'));var attributes=require(_0xfd8a('0x8'));module['exports']=function(_0x44c7ed,_0x4c7603){return _0x44c7ed[_0xfd8a('0x9')](_0xfd8a('0xa'),attributes,{'tableName':_0xfd8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5419=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0xc3b301,_0x57b718){var _0x83f31e=function(_0x30ed6a){while(--_0x30ed6a){_0xc3b301['push'](_0xc3b301['shift']());}};_0x83f31e(++_0x57b718);}(_0x5419,0x175));var _0x9541=function(_0x42334c,_0x379771){_0x42334c=_0x42334c-0x0;var _0x4feed7=_0x5419[_0x42334c];return _0x4feed7;};'use strict';var _=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var logger=require(_0x9541('0x2'))(_0x9541('0x3'));var moment=require(_0x9541('0x4'));var BPromise=require(_0x9541('0x5'));var rp=require(_0x9541('0x6'));var fs=require('fs');var path=require(_0x9541('0x7'));var rimraf=require(_0x9541('0x8'));var config=require(_0x9541('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x9541('0xa')]=function(_0x1f9139,_0xbdabaf){return _0x1f9139[_0x9541('0xb')](_0x9541('0xc'),attributes,{'tableName':_0x9541('0xd'),'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 9e4dab1..a02dcbe 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 _0x411b=['../../config/logger','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x142e13,_0x211cde){var _0x51f6e1=function(_0xc4925c){while(--_0xc4925c){_0x142e13['push'](_0x142e13['shift']());}};_0x51f6e1(++_0x211cde);}(_0x411b,0x19d));var _0xb411=function(_0x296796,_0x52dcb8){_0x296796=_0x296796-0x0;var _0x4bf398=_0x411b[_0x296796];return _0x4bf398;};'use strict';var _=require(_0xb411('0x0'));var util=require(_0xb411('0x1'));var moment=require(_0xb411('0x2'));var BPromise=require('bluebird');var rs=require(_0xb411('0x3'));var fs=require('fs');var Redis=require(_0xb411('0x4'));var db=require(_0xb411('0x5'))['db'];var utils=require(_0xb411('0x6'));var logger=require(_0xb411('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb411('0x8'));var client=jayson[_0xb411('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bd33d,_0x20062e,_0x4790f2){return new BPromise(function(_0x55c435,_0x3f0614){return client[_0xb411('0xa')](_0x4bd33d,_0x4790f2)[_0xb411('0xb')](function(_0x4edd54){logger[_0xb411('0xc')](_0xb411('0xd'),_0x20062e,_0xb411('0xe'));logger['debug'](_0xb411('0xf'),_0x20062e,_0xb411('0xe'),JSON['stringify'](_0x4edd54));if(_0x4edd54[_0xb411('0x10')]){if(_0x4edd54[_0xb411('0x10')][_0xb411('0x11')]===0x1f4){logger[_0xb411('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x20062e,_0x4edd54[_0xb411('0x10')][_0xb411('0x12')]);return _0x3f0614(_0x4edd54['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x20062e,_0x4edd54[_0xb411('0x10')][_0xb411('0x12')]);return _0x55c435(_0x4edd54['error'][_0xb411('0x12')]);}else{logger['info'](_0xb411('0xd'),_0x20062e,_0xb411('0xe'));_0x55c435(_0x4edd54[_0xb411('0x13')]['message']);}})['catch'](function(_0x361283){logger['error'](_0xb411('0xd'),_0x20062e,_0x361283);_0x3f0614(_0x361283);});});} \ No newline at end of file +var _0x9ee0=['message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3bbd7c,_0x2adc85){var _0xc596d=function(_0x3541f3){while(--_0x3541f3){_0x3bbd7c['push'](_0x3bbd7c['shift']());}};_0xc596d(++_0x2adc85);}(_0x9ee0,0xc0));var _0x09ee=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9ee0[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x09ee('0x0'));var util=require(_0x09ee('0x1'));var moment=require('moment');var BPromise=require(_0x09ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09ee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09ee('0x4'));var logger=require(_0x09ee('0x5'))(_0x09ee('0x6'));var config=require(_0x09ee('0x7'));var jayson=require(_0x09ee('0x8'));var client=jayson[_0x09ee('0x9')][_0x09ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e35a1,_0x19908f,_0x4efeae){return new BPromise(function(_0x163e69,_0x2e151){return client[_0x09ee('0xb')](_0x1e35a1,_0x4efeae)['then'](function(_0x22f7cb){logger[_0x09ee('0xc')](_0x09ee('0xd'),_0x19908f,_0x09ee('0xe'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x19908f,'request\x20sent',JSON[_0x09ee('0xf')](_0x22f7cb));if(_0x22f7cb[_0x09ee('0x10')]){if(_0x22f7cb[_0x09ee('0x10')][_0x09ee('0x11')]===0x1f4){logger[_0x09ee('0x10')](_0x09ee('0xd'),_0x19908f,_0x22f7cb[_0x09ee('0x10')]['message']);return _0x2e151(_0x22f7cb['error'][_0x09ee('0x12')]);}logger[_0x09ee('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x19908f,_0x22f7cb[_0x09ee('0x10')][_0x09ee('0x12')]);return _0x163e69(_0x22f7cb[_0x09ee('0x10')][_0x09ee('0x12')]);}else{logger['info'](_0x09ee('0xd'),_0x19908f,_0x09ee('0xe'));_0x163e69(_0x22f7cb[_0x09ee('0x13')]['message']);}})[_0x09ee('0x14')](function(_0x3365bd){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x19908f,_0x3365bd);_0x2e151(_0x3365bd);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 1c3579c..f5db293 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 _0x94ba=['isAuthenticated','index','get','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x463dbe,_0x34e39f){var _0x1795d2=function(_0xa46cb5){while(--_0xa46cb5){_0x463dbe['push'](_0x463dbe['shift']());}};_0x1795d2(++_0x34e39f);}(_0x94ba,0xbe));var _0xa94b=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x94ba[_0x47b15f];return _0x55bf25;};'use strict';var multer=require(_0xa94b('0x0'));var util=require(_0xa94b('0x1'));var path=require(_0xa94b('0x2'));var timeout=require(_0xa94b('0x3'));var express=require(_0xa94b('0x4'));var router=express['Router']();var fs_extra=require(_0xa94b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa94b('0x6'));var config=require(_0xa94b('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xa94b('0x8')](),controller[_0xa94b('0x9')]);router[_0xa94b('0xa')](_0xa94b('0xb'),auth['isAuthenticated'](),controller[_0xa94b('0xc')]);router[_0xa94b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa94b('0xe')](_0xa94b('0xb'),auth[_0xa94b('0x8')](),controller['update']);router[_0xa94b('0xf')](_0xa94b('0xb'),auth[_0xa94b('0x8')](),controller[_0xa94b('0x10')]);module[_0xa94b('0x11')]=router; \ No newline at end of file +var _0x88b0=['../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create','update','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x31c796,_0x2e3c7f){var _0x128356=function(_0x35534a){while(--_0x35534a){_0x31c796['push'](_0x31c796['shift']());}};_0x128356(++_0x2e3c7f);}(_0x88b0,0x1cb));var _0x088b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x88b0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x088b('0x0'));var util=require(_0x088b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x088b('0x2'));var router=express[_0x088b('0x3')]();var fs_extra=require(_0x088b('0x4'));var auth=require(_0x088b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x088b('0x6'));var controller=require(_0x088b('0x7'));router[_0x088b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x088b('0x8')](_0x088b('0x9'),auth[_0x088b('0xa')](),controller[_0x088b('0xb')]);router[_0x088b('0xc')]('/',auth[_0x088b('0xa')](),controller[_0x088b('0xd')]);router['put'](_0x088b('0x9'),auth['isAuthenticated'](),controller[_0x088b('0xe')]);router['delete'](_0x088b('0x9'),auth[_0x088b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ecbc61f..10345d6 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 _0x6ff6=['exports','sequelize'];(function(_0x55abba,_0x33640d){var _0x18ffc0=function(_0x1640d0){while(--_0x1640d0){_0x55abba['push'](_0x55abba['shift']());}};_0x18ffc0(++_0x33640d);}(_0x6ff6,0x115));var _0x66ff=function(_0x595c57,_0x415b75){_0x595c57=_0x595c57-0x0;var _0x227198=_0x6ff6[_0x595c57];return _0x227198;};'use strict';var Sequelize=require(_0x66ff('0x0'));module[_0x66ff('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x3097=['sequelize','exports','TEXT'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x3097,0xff));var _0x7309=function(_0x2feaa8,_0x257fef){_0x2feaa8=_0x2feaa8-0x0;var _0xb2144a=_0x3097[_0x2feaa8];return _0xb2144a;};'use strict';var Sequelize=require(_0x7309('0x0'));module[_0x7309('0x1')]={'tree':{'type':Sequelize[_0x7309('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index e8697d1..83ec076 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 _0xe38b=['destroy','end','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','update','then'];(function(_0x30b640,_0x368c12){var _0x67bdb9=function(_0x149d42){while(--_0x149d42){_0x30b640['push'](_0x30b640['shift']());}};_0x67bdb9(++_0x368c12);}(_0xe38b,0x1cb));var _0xbe38=function(_0x24da84,_0x3cdec2){_0x24da84=_0x24da84-0x0;var _0x339545=_0xe38b[_0x24da84];return _0x339545;};'use strict';var emlformat=require(_0xbe38('0x0'));var rimraf=require(_0xbe38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe38('0x2'));var BPromise=require(_0xbe38('0x3'));var Mustache=require(_0xbe38('0x4'));var util=require(_0xbe38('0x5'));var path=require(_0xbe38('0x6'));var sox=require('sox');var csv=require(_0xbe38('0x7'));var ejs=require(_0xbe38('0x8'));var fs=require('fs');var fs_extra=require(_0xbe38('0x9'));var _=require(_0xbe38('0xa'));var squel=require(_0xbe38('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbe38('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe38('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe38('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbe38('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe38('0x10'));var logger=require(_0xbe38('0x11'))(_0xbe38('0x12'));var utils=require('../../config/utils');var config=require(_0xbe38('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe38('0x14'))['db'];function respondWithStatusCode(_0x296b42,_0x446338){_0x446338=_0x446338||0xcc;return function(_0x1b8bf9){if(_0x1b8bf9){return _0x296b42['sendStatus'](_0x446338);}return _0x296b42[_0xbe38('0x15')](_0x446338)['end']();};}function respondWithResult(_0x431f6a,_0x5aad8f){_0x5aad8f=_0x5aad8f||0xc8;return function(_0x2bcdc4){if(_0x2bcdc4){return _0x431f6a[_0xbe38('0x15')](_0x5aad8f)[_0xbe38('0x16')](_0x2bcdc4);}};}function respondWithFilteredResult(_0x2b9b27,_0x2338b5){return function(_0x51d5db){if(_0x51d5db){var _0x336d15=typeof _0x2338b5[_0xbe38('0x17')]===_0xbe38('0x18')&&typeof _0x2338b5['limit']===_0xbe38('0x18');var _0x3aa7ac=_0x51d5db[_0xbe38('0x19')];var _0x5a1b3f=_0x336d15?0x0:_0x2338b5[_0xbe38('0x17')];var _0x1e2eaf=_0x336d15?_0x51d5db[_0xbe38('0x19')]:_0x2338b5[_0xbe38('0x17')]+_0x2338b5['limit'];var _0x3157f0;if(_0x1e2eaf>=_0x3aa7ac){_0x1e2eaf=_0x3aa7ac;_0x3157f0=0xc8;}else{_0x3157f0=0xce;}_0x2b9b27['status'](_0x3157f0);return _0x2b9b27[_0xbe38('0x1a')](_0xbe38('0x1b'),_0x5a1b3f+'-'+_0x1e2eaf+'/'+_0x3aa7ac)[_0xbe38('0x16')](_0x51d5db);}return null;};}function patchUpdates(_0x1797a2){return function(_0x26e4f2){try{jsonpatch[_0xbe38('0x1c')](_0x26e4f2,_0x1797a2,!![]);}catch(_0x36c620){return BPromise['reject'](_0x36c620);}return _0x26e4f2['save']();};}function saveUpdates(_0x4096de,_0x14da9b){return function(_0x264d32){if(_0x264d32){return _0x264d32[_0xbe38('0x1d')](_0x4096de)[_0xbe38('0x1e')](function(_0xea9c0){return _0xea9c0;});}return null;};}function removeEntity(_0x95086c,_0x2cf35a){return function(_0x152cdb){if(_0x152cdb){return _0x152cdb[_0xbe38('0x1f')]()[_0xbe38('0x1e')](function(){_0x95086c[_0xbe38('0x15')](0xcc)[_0xbe38('0x20')]();});}};}function handleEntityNotFound(_0x4cf268,_0x412c34){return function(_0x18a943){if(!_0x18a943){_0x4cf268[_0xbe38('0x21')](0x194);}return _0x18a943;};}function handleError(_0x148d56,_0x4b7e3d){_0x4b7e3d=_0x4b7e3d||0x1f4;return function(_0x4a7a1d){logger['error'](_0x4a7a1d[_0xbe38('0x22')]);if(_0x4a7a1d[_0xbe38('0x23')]){delete _0x4a7a1d[_0xbe38('0x23')];}_0x148d56[_0xbe38('0x15')](_0x4b7e3d)[_0xbe38('0x24')](_0x4a7a1d);};}exports['index']=function(_0x2f4e82,_0x4bede8){var _0x327f4b={},_0x475f36={},_0x23f22e={'count':0x0,'rows':[]};var _0x3c6ee2=_[_0xbe38('0x25')](db[_0xbe38('0x26')][_0xbe38('0x27')],function(_0x48b0a8){return{'name':_0x48b0a8[_0xbe38('0x28')],'type':_0x48b0a8[_0xbe38('0x29')][_0xbe38('0x2a')]};});_0x475f36[_0xbe38('0x2b')]=_[_0xbe38('0x25')](_0x3c6ee2,_0xbe38('0x23'));_0x475f36[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x2f4e82[_0xbe38('0x2c')]);_0x475f36[_0xbe38('0x2e')]=_[_0xbe38('0x2f')](_0x475f36['model'],_0x475f36['query']);_0x327f4b['attributes']=_[_0xbe38('0x2f')](_0x475f36[_0xbe38('0x2b')],qs['fields'](_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x30')]));_0x327f4b[_0xbe38('0x31')]=_0x327f4b[_0xbe38('0x31')][_0xbe38('0x32')]?_0x327f4b['attributes']:_0x475f36[_0xbe38('0x2b')];if(!_0x2f4e82['query'][_0xbe38('0x33')]('nolimit')){_0x327f4b['limit']=qs[_0xbe38('0x34')](_0x2f4e82[_0xbe38('0x2c')]['limit']);_0x327f4b[_0xbe38('0x17')]=qs[_0xbe38('0x17')](_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x17')]);}_0x327f4b[_0xbe38('0x35')]=qs['sort'](_0x2f4e82['query'][_0xbe38('0x36')]);_0x327f4b[_0xbe38('0x37')]=qs['filters'](_[_0xbe38('0x38')](_0x2f4e82[_0xbe38('0x2c')],_0x475f36['filters']),_0x3c6ee2);if(_0x2f4e82['query'][_0xbe38('0x39')]){_0x327f4b[_0xbe38('0x37')]=_[_0xbe38('0x3a')](_0x327f4b[_0xbe38('0x37')],{'$or':_[_0xbe38('0x25')](_0x3c6ee2,function(_0x503264){if(_0x503264[_0xbe38('0x29')]!==_0xbe38('0x3b')){var _0x1c6b22={};_0x1c6b22[_0x503264[_0xbe38('0x23')]]={'$like':'%'+_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x39')]+'%'};return _0x1c6b22;}})});}_0x327f4b=_[_0xbe38('0x3a')]({},_0x327f4b,_0x2f4e82[_0xbe38('0x3c')]);var _0x119e82={'where':_0x327f4b['where']};return db[_0xbe38('0x26')][_0xbe38('0x19')](_0x119e82)['then'](function(_0x1b535c){_0x23f22e[_0xbe38('0x19')]=_0x1b535c;if(_0x2f4e82['query'][_0xbe38('0x3d')]){_0x327f4b[_0xbe38('0x3e')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x327f4b);})[_0xbe38('0x1e')](function(_0x500609){_0x23f22e[_0xbe38('0x3f')]=_0x500609;return _0x23f22e;})[_0xbe38('0x1e')](respondWithFilteredResult(_0x4bede8,_0x327f4b))[_0xbe38('0x40')](handleError(_0x4bede8,null));};exports[_0xbe38('0x41')]=function(_0x22a53c,_0xa7a7f1){var _0x136b6b={'raw':!![],'where':{'id':_0x22a53c[_0xbe38('0x42')]['id']}},_0x556843={};_0x556843['model']=_[_0xbe38('0x2d')](db[_0xbe38('0x26')]['rawAttributes']);_0x556843[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x22a53c['query']);_0x556843['filters']=_[_0xbe38('0x2f')](_0x556843[_0xbe38('0x2b')],_0x556843[_0xbe38('0x2c')]);_0x136b6b['attributes']=_[_0xbe38('0x2f')](_0x556843[_0xbe38('0x2b')],qs[_0xbe38('0x30')](_0x22a53c[_0xbe38('0x2c')][_0xbe38('0x30')]));_0x136b6b[_0xbe38('0x31')]=_0x136b6b['attributes'][_0xbe38('0x32')]?_0x136b6b['attributes']:_0x556843['model'];if(_0x22a53c[_0xbe38('0x2c')][_0xbe38('0x3d')]){_0x136b6b[_0xbe38('0x3e')]=[{'all':!![]}];}_0x136b6b=_[_0xbe38('0x3a')]({},_0x136b6b,_0x22a53c['options']);return db[_0xbe38('0x26')][_0xbe38('0x43')](_0x136b6b)[_0xbe38('0x1e')](handleEntityNotFound(_0xa7a7f1,null))[_0xbe38('0x1e')](respondWithResult(_0xa7a7f1,null))[_0xbe38('0x40')](handleError(_0xa7a7f1,null));};exports[_0xbe38('0x44')]=function(_0x45701a,_0x3b24c4){return db[_0xbe38('0x26')]['create'](_0x45701a[_0xbe38('0x45')],{})[_0xbe38('0x1e')](respondWithResult(_0x3b24c4,0xc9))['catch'](handleError(_0x3b24c4,null));};exports[_0xbe38('0x1d')]=function(_0x2551d8,_0x3b6428){if(_0x2551d8[_0xbe38('0x45')]['id']){delete _0x2551d8[_0xbe38('0x45')]['id'];}return db[_0xbe38('0x26')][_0xbe38('0x43')]({'where':{'id':_0x2551d8[_0xbe38('0x42')]['id']}})[_0xbe38('0x1e')](handleEntityNotFound(_0x3b6428,null))[_0xbe38('0x1e')](saveUpdates(_0x2551d8[_0xbe38('0x45')],null))[_0xbe38('0x1e')](respondWithResult(_0x3b6428,null))[_0xbe38('0x40')](handleError(_0x3b6428,null));};exports['destroy']=function(_0x2240fc,_0x480eff){return db[_0xbe38('0x26')][_0xbe38('0x43')]({'where':{'id':_0x2240fc['params']['id']}})[_0xbe38('0x1e')](handleEntityNotFound(_0x480eff,null))[_0xbe38('0x1e')](removeEntity(_0x480eff,null))['catch'](handleError(_0x480eff,null));}; \ No newline at end of file +var _0x5f29=['status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5f29,0x19e));var _0x95f2=function(_0x361a4d,_0x106561){_0x361a4d=_0x361a4d-0x0;var _0x4a7c9d=_0x5f29[_0x361a4d];return _0x4a7c9d;};'use strict';var emlformat=require(_0x95f2('0x0'));var rimraf=require(_0x95f2('0x1'));var zipdir=require(_0x95f2('0x2'));var jsonpatch=require(_0x95f2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95f2('0x4'));var Mustache=require(_0x95f2('0x5'));var util=require(_0x95f2('0x6'));var path=require('path');var sox=require(_0x95f2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95f2('0x8'));var _=require(_0x95f2('0x9'));var squel=require(_0x95f2('0xa'));var crypto=require(_0x95f2('0xb'));var jsforce=require(_0x95f2('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x95f2('0xd'));var Redis=require(_0x95f2('0xe'));var authService=require(_0x95f2('0xf'));var qs=require(_0x95f2('0x10'));var as=require(_0x95f2('0x11'));var hardwareService=require(_0x95f2('0x12'));var logger=require(_0x95f2('0x13'))(_0x95f2('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x95f2('0x15'));var db=require(_0x95f2('0x16'))['db'];function respondWithStatusCode(_0x49ada8,_0x3c784c){_0x3c784c=_0x3c784c||0xcc;return function(_0x372667){if(_0x372667){return _0x49ada8[_0x95f2('0x17')](_0x3c784c);}return _0x49ada8[_0x95f2('0x18')](_0x3c784c)['end']();};}function respondWithResult(_0x23c75d,_0x14faa9){_0x14faa9=_0x14faa9||0xc8;return function(_0x11b1a0){if(_0x11b1a0){return _0x23c75d[_0x95f2('0x18')](_0x14faa9)['json'](_0x11b1a0);}};}function respondWithFilteredResult(_0x5b6674,_0x2021ff){return function(_0x3e1619){if(_0x3e1619){var _0x469377=typeof _0x2021ff['offset']===_0x95f2('0x19')&&typeof _0x2021ff[_0x95f2('0x1a')]==='undefined';var _0x15b2f4=_0x3e1619[_0x95f2('0x1b')];var _0x33d0c5=_0x469377?0x0:_0x2021ff[_0x95f2('0x1c')];var _0x354383=_0x469377?_0x3e1619['count']:_0x2021ff['offset']+_0x2021ff[_0x95f2('0x1a')];var _0x52a0dd;if(_0x354383>=_0x15b2f4){_0x354383=_0x15b2f4;_0x52a0dd=0xc8;}else{_0x52a0dd=0xce;}_0x5b6674[_0x95f2('0x18')](_0x52a0dd);return _0x5b6674[_0x95f2('0x1d')](_0x95f2('0x1e'),_0x33d0c5+'-'+_0x354383+'/'+_0x15b2f4)[_0x95f2('0x1f')](_0x3e1619);}return null;};}function patchUpdates(_0x39cc41){return function(_0x2b74e7){try{jsonpatch[_0x95f2('0x20')](_0x2b74e7,_0x39cc41,!![]);}catch(_0x3d4867){return BPromise[_0x95f2('0x21')](_0x3d4867);}return _0x2b74e7[_0x95f2('0x22')]();};}function saveUpdates(_0x3faed7,_0x3cb018){return function(_0x8d9bfa){if(_0x8d9bfa){return _0x8d9bfa[_0x95f2('0x23')](_0x3faed7)[_0x95f2('0x24')](function(_0x1d89f8){return _0x1d89f8;});}return null;};}function removeEntity(_0x26c59c,_0x5c0cff){return function(_0x489a45){if(_0x489a45){return _0x489a45[_0x95f2('0x25')]()['then'](function(){_0x26c59c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f0aa,_0x43fc37){return function(_0x4718be){if(!_0x4718be){_0x54f0aa[_0x95f2('0x17')](0x194);}return _0x4718be;};}function handleError(_0x53edd1,_0x359e8c){_0x359e8c=_0x359e8c||0x1f4;return function(_0x3fe764){logger[_0x95f2('0x26')](_0x3fe764['stack']);if(_0x3fe764[_0x95f2('0x27')]){delete _0x3fe764[_0x95f2('0x27')];}_0x53edd1[_0x95f2('0x18')](_0x359e8c)[_0x95f2('0x28')](_0x3fe764);};}exports[_0x95f2('0x29')]=function(_0x4ce9e7,_0x2e179a){var _0x42a30c={},_0x1d3814={},_0x4a9657={'count':0x0,'rows':[]};var _0x534f76=_[_0x95f2('0x2a')](db[_0x95f2('0x2b')][_0x95f2('0x2c')],function(_0x21f81c){return{'name':_0x21f81c['fieldName'],'type':_0x21f81c[_0x95f2('0x2d')][_0x95f2('0x2e')]};});_0x1d3814[_0x95f2('0x2f')]=_['map'](_0x534f76,_0x95f2('0x27'));_0x1d3814[_0x95f2('0x30')]=_[_0x95f2('0x31')](_0x4ce9e7[_0x95f2('0x30')]);_0x1d3814[_0x95f2('0x32')]=_[_0x95f2('0x33')](_0x1d3814[_0x95f2('0x2f')],_0x1d3814[_0x95f2('0x30')]);_0x42a30c[_0x95f2('0x34')]=_[_0x95f2('0x33')](_0x1d3814['model'],qs[_0x95f2('0x35')](_0x4ce9e7[_0x95f2('0x30')][_0x95f2('0x35')]));_0x42a30c[_0x95f2('0x34')]=_0x42a30c['attributes'][_0x95f2('0x36')]?_0x42a30c[_0x95f2('0x34')]:_0x1d3814[_0x95f2('0x2f')];if(!_0x4ce9e7[_0x95f2('0x30')][_0x95f2('0x37')](_0x95f2('0x38'))){_0x42a30c[_0x95f2('0x1a')]=qs[_0x95f2('0x1a')](_0x4ce9e7[_0x95f2('0x30')][_0x95f2('0x1a')]);_0x42a30c['offset']=qs[_0x95f2('0x1c')](_0x4ce9e7[_0x95f2('0x30')][_0x95f2('0x1c')]);}_0x42a30c['order']=qs[_0x95f2('0x39')](_0x4ce9e7[_0x95f2('0x30')][_0x95f2('0x39')]);_0x42a30c[_0x95f2('0x3a')]=qs[_0x95f2('0x32')](_['pick'](_0x4ce9e7[_0x95f2('0x30')],_0x1d3814[_0x95f2('0x32')]),_0x534f76);if(_0x4ce9e7[_0x95f2('0x30')]['filter']){_0x42a30c['where']=_[_0x95f2('0x3b')](_0x42a30c['where'],{'$or':_[_0x95f2('0x2a')](_0x534f76,function(_0x45d410){if(_0x45d410[_0x95f2('0x2d')]!==_0x95f2('0x3c')){var _0x21b0f0={};_0x21b0f0[_0x45d410[_0x95f2('0x27')]]={'$like':'%'+_0x4ce9e7['query'][_0x95f2('0x3d')]+'%'};return _0x21b0f0;}})});}_0x42a30c=_['merge']({},_0x42a30c,_0x4ce9e7[_0x95f2('0x3e')]);var _0x5496fc={'where':_0x42a30c['where']};return db[_0x95f2('0x2b')]['count'](_0x5496fc)[_0x95f2('0x24')](function(_0x132427){_0x4a9657[_0x95f2('0x1b')]=_0x132427;if(_0x4ce9e7['query'][_0x95f2('0x3f')]){_0x42a30c[_0x95f2('0x40')]=[{'all':!![]}];}return db[_0x95f2('0x2b')][_0x95f2('0x41')](_0x42a30c);})['then'](function(_0x48daf2){_0x4a9657[_0x95f2('0x42')]=_0x48daf2;return _0x4a9657;})['then'](respondWithFilteredResult(_0x2e179a,_0x42a30c))['catch'](handleError(_0x2e179a,null));};exports[_0x95f2('0x43')]=function(_0x54e5c4,_0x543712){var _0x1d3052={'raw':!![],'where':{'id':_0x54e5c4['params']['id']}},_0x55ace2={};_0x55ace2[_0x95f2('0x2f')]=_[_0x95f2('0x31')](db[_0x95f2('0x2b')]['rawAttributes']);_0x55ace2[_0x95f2('0x30')]=_[_0x95f2('0x31')](_0x54e5c4[_0x95f2('0x30')]);_0x55ace2[_0x95f2('0x32')]=_[_0x95f2('0x33')](_0x55ace2[_0x95f2('0x2f')],_0x55ace2[_0x95f2('0x30')]);_0x1d3052['attributes']=_[_0x95f2('0x33')](_0x55ace2[_0x95f2('0x2f')],qs[_0x95f2('0x35')](_0x54e5c4['query'][_0x95f2('0x35')]));_0x1d3052[_0x95f2('0x34')]=_0x1d3052[_0x95f2('0x34')][_0x95f2('0x36')]?_0x1d3052['attributes']:_0x55ace2['model'];if(_0x54e5c4[_0x95f2('0x30')][_0x95f2('0x3f')]){_0x1d3052[_0x95f2('0x40')]=[{'all':!![]}];}_0x1d3052=_['merge']({},_0x1d3052,_0x54e5c4['options']);return db['AnalyticTreeReport'][_0x95f2('0x44')](_0x1d3052)[_0x95f2('0x24')](handleEntityNotFound(_0x543712,null))[_0x95f2('0x24')](respondWithResult(_0x543712,null))[_0x95f2('0x45')](handleError(_0x543712,null));};exports[_0x95f2('0x46')]=function(_0x4b73d3,_0x210b59){return db[_0x95f2('0x2b')][_0x95f2('0x46')](_0x4b73d3[_0x95f2('0x47')],{})['then'](respondWithResult(_0x210b59,0xc9))[_0x95f2('0x45')](handleError(_0x210b59,null));};exports[_0x95f2('0x23')]=function(_0x372ab0,_0x57d1cc){if(_0x372ab0['body']['id']){delete _0x372ab0[_0x95f2('0x47')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x372ab0[_0x95f2('0x48')]['id']}})['then'](handleEntityNotFound(_0x57d1cc,null))['then'](saveUpdates(_0x372ab0['body'],null))[_0x95f2('0x24')](respondWithResult(_0x57d1cc,null))[_0x95f2('0x45')](handleError(_0x57d1cc,null));};exports['destroy']=function(_0x23df4b,_0x48d2fb){return db['AnalyticTreeReport']['find']({'where':{'id':_0x23df4b[_0x95f2('0x48')]['id']}})[_0x95f2('0x24')](handleEntityNotFound(_0x48d2fb,null))[_0x95f2('0x24')](removeEntity(_0x48d2fb,null))['catch'](handleError(_0x48d2fb,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index b3f8fa1..b30f4c8 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 _0x1dbe=['request-promise','rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x23a33f,_0x413c03){var _0x56e720=function(_0x21a646){while(--_0x21a646){_0x23a33f['push'](_0x23a33f['shift']());}};_0x56e720(++_0x413c03);}(_0x1dbe,0x102));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1db('0x0'));var util=require(_0xe1db('0x1'));var logger=require(_0xe1db('0x2'))(_0xe1db('0x3'));var moment=require(_0xe1db('0x4'));var BPromise=require(_0xe1db('0x5'));var rp=require(_0xe1db('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1db('0x7'));var config=require(_0xe1db('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x1efcc5,_0x321135){return _0x1efcc5[_0xe1db('0x9')](_0xe1db('0xa'),attributes,{'tableName':_0xe1db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x454e=['../../config/logger','api','bluebird','path','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','lodash'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x454e,0x182));var _0xe454=function(_0x285cc4,_0x32b8b2){_0x285cc4=_0x285cc4-0x0;var _0x49d0e6=_0x454e[_0x285cc4];return _0x49d0e6;};'use strict';var _=require(_0xe454('0x0'));var util=require('util');var logger=require(_0xe454('0x1'))(_0xe454('0x2'));var moment=require('moment');var BPromise=require(_0xe454('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe454('0x4'));var rimraf=require('rimraf');var config=require(_0xe454('0x5'));var attributes=require(_0xe454('0x6'));module[_0xe454('0x7')]=function(_0x42c69c,_0x5cc874){return _0x42c69c['define']('AnalyticTreeReport',attributes,{'tableName':_0xe454('0x8'),'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 3b05a4f..644b20f 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5958bf,_0x4bd0ce){var _0x15c777=function(_0x2a3aa7){while(--_0x2a3aa7){_0x5958bf['push'](_0x5958bf['shift']());}};_0x15c777(++_0x4bd0ce);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x161678,_0x1681f0){var _0x19343b=function(_0x1a0984){while(--_0x1a0984){_0x161678['push'](_0x161678['shift']());}};_0x19343b(++_0x1681f0);}(_0xdb28,0x106));var _0x8db2=function(_0x15d1fe,_0x43baa2){_0x15d1fe=_0x15d1fe-0x0;var _0x5671e7=_0xdb28[_0x15d1fe];return _0x5671e7;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 47c7b78..edae12b 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 _0xd251=['/:id','show','post','create','put','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index'];(function(_0x115a8b,_0x58d048){var _0x193669=function(_0x50a5b4){while(--_0x50a5b4){_0x115a8b['push'](_0x115a8b['shift']());}};_0x193669(++_0x58d048);}(_0xd251,0xca));var _0x1d25=function(_0x5c7a9d,_0x1ec964){_0x5c7a9d=_0x5c7a9d-0x0;var _0x3819a9=_0xd251[_0x5c7a9d];return _0x3819a9;};'use strict';var multer=require('multer');var util=require(_0x1d25('0x0'));var path=require(_0x1d25('0x1'));var timeout=require('connect-timeout');var express=require(_0x1d25('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1d25('0x3'));var interaction=require(_0x1d25('0x4'));var config=require('../../config/environment');var controller=require(_0x1d25('0x5'));router['get']('/',auth[_0x1d25('0x6')](),controller[_0x1d25('0x7')]);router['get'](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller[_0x1d25('0x9')]);router[_0x1d25('0xa')]('/',auth['isAuthenticated'](),controller[_0x1d25('0xb')]);router[_0x1d25('0xc')](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller['update']);router['delete'](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller['destroy']);module[_0x1d25('0xd')]=router; \ No newline at end of file +var _0x2bc1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2bc1,0xb1));var _0x12bc=function(_0xab428c,_0x10813f){_0xab428c=_0xab428c-0x0;var _0x95eb1e=_0x2bc1[_0xab428c];return _0x95eb1e;};'use strict';var multer=require(_0x12bc('0x0'));var util=require(_0x12bc('0x1'));var path=require(_0x12bc('0x2'));var timeout=require(_0x12bc('0x3'));var express=require(_0x12bc('0x4'));var router=express[_0x12bc('0x5')]();var fs_extra=require(_0x12bc('0x6'));var auth=require(_0x12bc('0x7'));var interaction=require(_0x12bc('0x8'));var config=require('../../config/environment');var controller=require(_0x12bc('0x9'));router[_0x12bc('0xa')]('/',auth[_0x12bc('0xb')](),controller['index']);router[_0x12bc('0xa')]('/:id',auth[_0x12bc('0xb')](),controller[_0x12bc('0xc')]);router[_0x12bc('0xd')]('/',auth[_0x12bc('0xb')](),controller[_0x12bc('0xe')]);router[_0x12bc('0xf')](_0x12bc('0x10'),auth[_0x12bc('0xb')](),controller[_0x12bc('0x11')]);router['delete'](_0x12bc('0x10'),auth['isAuthenticated'](),controller[_0x12bc('0x12')]);module[_0x12bc('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 438658e..5af35bc 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 _0xe4b8=['exports','STRING','sequelize'];(function(_0x12dc7b,_0x49d6d1){var _0x1f37ce=function(_0x43c824){while(--_0x43c824){_0x12dc7b['push'](_0x12dc7b['shift']());}};_0x1f37ce(++_0x49d6d1);}(_0xe4b8,0x179));var _0x8e4b=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xe4b8[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x8e4b('0x0'));module[_0x8e4b('0x1')]={'name':{'type':Sequelize[_0x8e4b('0x2')]},'basename':{'type':Sequelize[_0x8e4b('0x2')]},'type':{'type':Sequelize[_0x8e4b('0x2')]}}; \ No newline at end of file +var _0xa7dc=['sequelize','exports','STRING'];(function(_0x398481,_0x3de964){var _0x3a4d22=function(_0x359ad4){while(--_0x359ad4){_0x398481['push'](_0x398481['shift']());}};_0x3a4d22(++_0x3de964);}(_0xa7dc,0x11d));var _0xca7d=function(_0x557b38,_0x5a59bd){_0x557b38=_0x557b38-0x0;var _0x391e31=_0xa7dc[_0x557b38];return _0x391e31;};'use strict';var Sequelize=require(_0xca7d('0x0'));module[_0xca7d('0x1')]={'name':{'type':Sequelize[_0xca7d('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xca7d('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 264a8ac..b56fa16 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 _0xccbb=['map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','show','clone','get','omit','createdAt','updatedAt','body','params','destroy','find','create','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xccbb,0xf0));var _0xbccb=function(_0x385b5c,_0x527ff4){_0x385b5c=_0x385b5c-0x0;var _0x5530fa=_0xccbb[_0x385b5c];return _0x5530fa;};'use strict';var emlformat=require(_0xbccb('0x0'));var rimraf=require(_0xbccb('0x1'));var zipdir=require(_0xbccb('0x2'));var jsonpatch=require(_0xbccb('0x3'));var rp=require(_0xbccb('0x4'));var moment=require(_0xbccb('0x5'));var BPromise=require(_0xbccb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbccb('0x7'));var csv=require(_0xbccb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbccb('0x9'));var _=require(_0xbccb('0xa'));var squel=require(_0xbccb('0xb'));var crypto=require(_0xbccb('0xc'));var jsforce=require(_0xbccb('0xd'));var deskjs=require(_0xbccb('0xe'));var toCsv=require(_0xbccb('0x8'));var querystring=require(_0xbccb('0xf'));var Papa=require(_0xbccb('0x10'));var Redis=require('ioredis');var authService=require(_0xbccb('0x11'));var qs=require(_0xbccb('0x12'));var as=require(_0xbccb('0x13'));var hardwareService=require(_0xbccb('0x14'));var logger=require('../../config/logger')(_0xbccb('0x15'));var utils=require(_0xbccb('0x16'));var config=require(_0xbccb('0x17'));var licenseUtil=require(_0xbccb('0x18'));var db=require(_0xbccb('0x19'))['db'];function respondWithStatusCode(_0x86a6e2,_0x7b663d){_0x7b663d=_0x7b663d||0xcc;return function(_0x2154a3){if(_0x2154a3){return _0x86a6e2[_0xbccb('0x1a')](_0x7b663d);}return _0x86a6e2['status'](_0x7b663d)[_0xbccb('0x1b')]();};}function respondWithResult(_0x156b58,_0x440354){_0x440354=_0x440354||0xc8;return function(_0x217f7c){if(_0x217f7c){return _0x156b58[_0xbccb('0x1c')](_0x440354)['json'](_0x217f7c);}};}function respondWithFilteredResult(_0xf40a9e,_0x2af522){return function(_0x138acb){if(_0x138acb){var _0x4a3ba9=typeof _0x2af522['offset']===_0xbccb('0x1d')&&typeof _0x2af522[_0xbccb('0x1e')]===_0xbccb('0x1d');var _0x12626f=_0x138acb[_0xbccb('0x1f')];var _0x2e3c50=_0x4a3ba9?0x0:_0x2af522[_0xbccb('0x20')];var _0x465f2f=_0x4a3ba9?_0x138acb['count']:_0x2af522['offset']+_0x2af522[_0xbccb('0x1e')];var _0x376692;if(_0x465f2f>=_0x12626f){_0x465f2f=_0x12626f;_0x376692=0xc8;}else{_0x376692=0xce;}_0xf40a9e['status'](_0x376692);return _0xf40a9e[_0xbccb('0x21')](_0xbccb('0x22'),_0x2e3c50+'-'+_0x465f2f+'/'+_0x12626f)[_0xbccb('0x23')](_0x138acb);}return null;};}function patchUpdates(_0x4b5d66){return function(_0x52f09f){try{jsonpatch[_0xbccb('0x24')](_0x52f09f,_0x4b5d66,!![]);}catch(_0xaf04c8){return BPromise[_0xbccb('0x25')](_0xaf04c8);}return _0x52f09f[_0xbccb('0x26')]();};}function saveUpdates(_0x2e81d7,_0x1cb985){return function(_0x19b2a){if(_0x19b2a){return _0x19b2a[_0xbccb('0x27')](_0x2e81d7)[_0xbccb('0x28')](function(_0xd9533a){return _0xd9533a;});}return null;};}function removeEntity(_0x22caa9,_0x495141){return function(_0x2730db){if(_0x2730db){return _0x2730db['destroy']()['then'](function(){_0x22caa9[_0xbccb('0x1c')](0xcc)[_0xbccb('0x1b')]();});}};}function handleEntityNotFound(_0x6a71c8,_0x220fc2){return function(_0x35cd25){if(!_0x35cd25){_0x6a71c8[_0xbccb('0x1a')](0x194);}return _0x35cd25;};}function handleError(_0x29a373,_0x2b13b){_0x2b13b=_0x2b13b||0x1f4;return function(_0x4d075b){logger[_0xbccb('0x29')](_0x4d075b[_0xbccb('0x2a')]);if(_0x4d075b[_0xbccb('0x2b')]){delete _0x4d075b[_0xbccb('0x2b')];}_0x29a373[_0xbccb('0x1c')](_0x2b13b)[_0xbccb('0x2c')](_0x4d075b);};}exports['index']=function(_0x3ed099,_0x246b84){var _0x134864={},_0x34013d={},_0x4650b3={'count':0x0,'rows':[]};var _0x20737a=_[_0xbccb('0x2d')](db['Attachment'][_0xbccb('0x2e')],function(_0x14e20a){return{'name':_0x14e20a[_0xbccb('0x2f')],'type':_0x14e20a[_0xbccb('0x30')][_0xbccb('0x31')]};});_0x34013d['model']=_[_0xbccb('0x2d')](_0x20737a,_0xbccb('0x2b'));_0x34013d[_0xbccb('0x32')]=_[_0xbccb('0x33')](_0x3ed099[_0xbccb('0x32')]);_0x34013d[_0xbccb('0x34')]=_[_0xbccb('0x35')](_0x34013d[_0xbccb('0x36')],_0x34013d[_0xbccb('0x32')]);_0x134864['attributes']=_[_0xbccb('0x35')](_0x34013d['model'],qs[_0xbccb('0x37')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x37')]));_0x134864[_0xbccb('0x38')]=_0x134864[_0xbccb('0x38')][_0xbccb('0x39')]?_0x134864[_0xbccb('0x38')]:_0x34013d['model'];if(!_0x3ed099[_0xbccb('0x32')][_0xbccb('0x3a')](_0xbccb('0x3b'))){_0x134864[_0xbccb('0x1e')]=qs[_0xbccb('0x1e')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x1e')]);_0x134864[_0xbccb('0x20')]=qs[_0xbccb('0x20')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x20')]);}_0x134864[_0xbccb('0x3c')]=qs[_0xbccb('0x3d')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x3d')]);_0x134864[_0xbccb('0x3e')]=qs[_0xbccb('0x34')](_[_0xbccb('0x3f')](_0x3ed099[_0xbccb('0x32')],_0x34013d['filters']),_0x20737a);if(_0x3ed099['query'][_0xbccb('0x40')]){_0x134864[_0xbccb('0x3e')]=_[_0xbccb('0x41')](_0x134864['where'],{'$or':_[_0xbccb('0x2d')](_0x20737a,function(_0x41586b){if(_0x41586b[_0xbccb('0x30')]!==_0xbccb('0x42')){var _0x2e28c6={};_0x2e28c6[_0x41586b[_0xbccb('0x2b')]]={'$like':'%'+_0x3ed099[_0xbccb('0x32')]['filter']+'%'};return _0x2e28c6;}})});}_0x134864=_['merge']({},_0x134864,_0x3ed099[_0xbccb('0x43')]);var _0x1a3039={'where':_0x134864['where']};return db[_0xbccb('0x44')][_0xbccb('0x1f')](_0x1a3039)[_0xbccb('0x28')](function(_0x316a18){_0x4650b3[_0xbccb('0x1f')]=_0x316a18;if(_0x3ed099[_0xbccb('0x32')][_0xbccb('0x45')]){_0x134864[_0xbccb('0x46')]=[{'all':!![]}];}return db[_0xbccb('0x44')][_0xbccb('0x47')](_0x134864);})['then'](function(_0x23c86d){_0x4650b3[_0xbccb('0x48')]=_0x23c86d;return _0x4650b3;})[_0xbccb('0x28')](respondWithFilteredResult(_0x246b84,_0x134864))[_0xbccb('0x49')](handleError(_0x246b84,null));};exports[_0xbccb('0x4a')]=function(_0x1480a4,_0x59d74a){var _0x44e40c={'raw':!![],'where':{'id':_0x1480a4['params']['id']}},_0x18ba29={};_0x18ba29[_0xbccb('0x36')]=_[_0xbccb('0x33')](db[_0xbccb('0x44')][_0xbccb('0x2e')]);_0x18ba29[_0xbccb('0x32')]=_[_0xbccb('0x33')](_0x1480a4[_0xbccb('0x32')]);_0x18ba29[_0xbccb('0x34')]=_[_0xbccb('0x35')](_0x18ba29[_0xbccb('0x36')],_0x18ba29['query']);_0x44e40c[_0xbccb('0x38')]=_[_0xbccb('0x35')](_0x18ba29['model'],qs[_0xbccb('0x37')](_0x1480a4[_0xbccb('0x32')][_0xbccb('0x37')]));_0x44e40c[_0xbccb('0x38')]=_0x44e40c[_0xbccb('0x38')]['length']?_0x44e40c['attributes']:_0x18ba29['model'];if(_0x1480a4['query'][_0xbccb('0x45')]){_0x44e40c[_0xbccb('0x46')]=[{'all':!![]}];}_0x44e40c=_[_0xbccb('0x41')]({},_0x44e40c,_0x1480a4[_0xbccb('0x43')]);return db[_0xbccb('0x44')]['find'](_0x44e40c)[_0xbccb('0x28')](handleEntityNotFound(_0x59d74a,null))[_0xbccb('0x28')](respondWithResult(_0x59d74a,null))['catch'](handleError(_0x59d74a,null));};exports[_0xbccb('0x4b')]=function(_0x14a062,_0x178d5b){var _0x118def={'where':{'id':_0x14a062['params']['id']}},_0x342712={};_0x342712[_0xbccb('0x36')]=_[_0xbccb('0x33')](db[_0xbccb('0x44')][_0xbccb('0x2e')]);_0x118def[_0xbccb('0x38')]=_[_0xbccb('0x35')](_0x342712[_0xbccb('0x36')],qs[_0xbccb('0x37')](_0x14a062[_0xbccb('0x32')][_0xbccb('0x37')]));_0x118def[_0xbccb('0x38')]=_0x118def[_0xbccb('0x38')]['length']?_0x118def[_0xbccb('0x38')]:_0x342712['model'];if(_0x14a062['query']['includeAll']){_0x118def['include']=[{'all':!![]}];}_0x118def=_['merge']({},_0x118def,_0x14a062[_0xbccb('0x43')]);return db['Attachment']['find'](_0x118def)['then'](handleEntityNotFound(_0x178d5b,null))[_0xbccb('0x28')](function(_0x1668b4){if(_0x1668b4){var _0x5ca6b6=_0x1668b4[_0xbccb('0x4c')]({'plain':!![]});_0x5ca6b6=qs[_0xbccb('0x4d')](_0x5ca6b6,['id',_0xbccb('0x4e'),_0xbccb('0x4f')]);_0x14a062['body']=_[_0xbccb('0x4d')](_0x14a062['body'],['id',_0xbccb('0x4e'),_0xbccb('0x4f')]);return db[_0xbccb('0x44')]['create'](_[_0xbccb('0x41')](_0x5ca6b6,_0x14a062[_0xbccb('0x50')]),{'include':_0x14a062[_0xbccb('0x32')][_0xbccb('0x45')]?[{'all':!![]}]:undefined});}})[_0xbccb('0x28')](respondWithResult(_0x178d5b,0xc9))[_0xbccb('0x49')](handleError(_0x178d5b,null));};exports[_0xbccb('0x27')]=function(_0x449a6b,_0x333bad){if(_0x449a6b[_0xbccb('0x50')]['id']){delete _0x449a6b[_0xbccb('0x50')]['id'];}return db[_0xbccb('0x44')]['find']({'where':{'id':_0x449a6b[_0xbccb('0x51')]['id']}})[_0xbccb('0x28')](handleEntityNotFound(_0x333bad,null))[_0xbccb('0x28')](saveUpdates(_0x449a6b[_0xbccb('0x50')],null))[_0xbccb('0x28')](respondWithResult(_0x333bad,null))[_0xbccb('0x49')](handleError(_0x333bad,null));};exports[_0xbccb('0x52')]=function(_0x1b6c2c,_0x271a16){return db['Attachment'][_0xbccb('0x53')]({'where':{'id':_0x1b6c2c['params']['id']}})['then'](handleEntityNotFound(_0x271a16,null))[_0xbccb('0x28')](removeEntity(_0x271a16,null))[_0xbccb('0x49')](handleError(_0x271a16,null));};exports[_0xbccb('0x54')]=function(_0xa83236,_0x1b3d75,_0x41a157){_0xa83236[_0xbccb('0x50')][_0xbccb('0x2b')]=_0xa83236['file'][_0xbccb('0x55')];_0xa83236[_0xbccb('0x50')][_0xbccb('0x56')]=_0xa83236[_0xbccb('0x57')][_0xbccb('0x58')];_0xa83236['body']['type']=_0xa83236[_0xbccb('0x57')]['mimetype'];return db[_0xbccb('0x44')][_0xbccb('0x54')](_0xa83236[_0xbccb('0x50')])[_0xbccb('0x28')](respondWithResult(_0x1b3d75,0xc9))[_0xbccb('0x49')](handleError(_0x1b3d75,null));};exports['download']=function(_0x5cca5a,_0x5990a6,_0x54325e){return db['Attachment'][_0xbccb('0x59')]({'where':{'id':_0x5cca5a[_0xbccb('0x51')]['id']},'raw':!![]})[_0xbccb('0x28')](handleEntityNotFound(_0x5990a6,null))[_0xbccb('0x28')](function(_0x5c7675){if(_0x5c7675){var _0x38b618=_0x5c7675[_0xbccb('0x5a')]!==null;var _0x22a307=path[_0xbccb('0x5b')](config[_0xbccb('0x5c')],'server/files/attachments/');if(_0x38b618){_0x22a307=path[_0xbccb('0x5b')](_0x22a307,_0xbccb('0x5d'));}var _0x26a893=path['join'](_0x22a307,_0x5c7675['basename']);return _0x5990a6[_0xbccb('0x5e')](_0x26a893);}})['catch'](handleError(_0x5990a6,null));}; \ No newline at end of file +var _0x0db8=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','Attachment','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','merge','find','clone','omit','updatedAt','body','createdAt','create','file','originalname','mimetype','download','findOne','join','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise'];(function(_0x3d5a25,_0x3168fd){var _0x1c89df=function(_0x3f2e8a){while(--_0x3f2e8a){_0x3d5a25['push'](_0x3d5a25['shift']());}};_0x1c89df(++_0x3168fd);}(_0x0db8,0x1a6));var _0x80db=function(_0x1e6b4b,_0x304aea){_0x1e6b4b=_0x1e6b4b-0x0;var _0x411aaf=_0x0db8[_0x1e6b4b];return _0x411aaf;};'use strict';var emlformat=require(_0x80db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x80db('0x1'));var rp=require(_0x80db('0x2'));var moment=require(_0x80db('0x3'));var BPromise=require(_0x80db('0x4'));var Mustache=require(_0x80db('0x5'));var util=require(_0x80db('0x6'));var path=require(_0x80db('0x7'));var sox=require('sox');var csv=require(_0x80db('0x8'));var ejs=require(_0x80db('0x9'));var fs=require('fs');var fs_extra=require(_0x80db('0xa'));var _=require('lodash');var squel=require(_0x80db('0xb'));var crypto=require('crypto');var jsforce=require(_0x80db('0xc'));var deskjs=require(_0x80db('0xd'));var toCsv=require(_0x80db('0x8'));var querystring=require('querystring');var Papa=require(_0x80db('0xe'));var Redis=require(_0x80db('0xf'));var authService=require(_0x80db('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x80db('0x11'));var hardwareService=require(_0x80db('0x12'));var logger=require(_0x80db('0x13'))(_0x80db('0x14'));var utils=require(_0x80db('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x80db('0x16'))['db'];function respondWithStatusCode(_0x42467a,_0xec1fcc){_0xec1fcc=_0xec1fcc||0xcc;return function(_0xb4a847){if(_0xb4a847){return _0x42467a[_0x80db('0x17')](_0xec1fcc);}return _0x42467a[_0x80db('0x18')](_0xec1fcc)[_0x80db('0x19')]();};}function respondWithResult(_0x2b50a0,_0xfaca07){_0xfaca07=_0xfaca07||0xc8;return function(_0x34c134){if(_0x34c134){return _0x2b50a0[_0x80db('0x18')](_0xfaca07)[_0x80db('0x1a')](_0x34c134);}};}function respondWithFilteredResult(_0x387222,_0x5e93d5){return function(_0x5d2bd9){if(_0x5d2bd9){var _0x176e3c=typeof _0x5e93d5[_0x80db('0x1b')]===_0x80db('0x1c')&&typeof _0x5e93d5['limit']===_0x80db('0x1c');var _0x4218b0=_0x5d2bd9['count'];var _0x4662fc=_0x176e3c?0x0:_0x5e93d5[_0x80db('0x1b')];var _0x1f338e=_0x176e3c?_0x5d2bd9[_0x80db('0x1d')]:_0x5e93d5[_0x80db('0x1b')]+_0x5e93d5[_0x80db('0x1e')];var _0x18deb6;if(_0x1f338e>=_0x4218b0){_0x1f338e=_0x4218b0;_0x18deb6=0xc8;}else{_0x18deb6=0xce;}_0x387222[_0x80db('0x18')](_0x18deb6);return _0x387222['set'](_0x80db('0x1f'),_0x4662fc+'-'+_0x1f338e+'/'+_0x4218b0)['json'](_0x5d2bd9);}return null;};}function patchUpdates(_0x50b5d8){return function(_0x5a0af2){try{jsonpatch[_0x80db('0x20')](_0x5a0af2,_0x50b5d8,!![]);}catch(_0x54c396){return BPromise[_0x80db('0x21')](_0x54c396);}return _0x5a0af2['save']();};}function saveUpdates(_0x15ca7b,_0x573ad0){return function(_0x2e2eed){if(_0x2e2eed){return _0x2e2eed[_0x80db('0x22')](_0x15ca7b)[_0x80db('0x23')](function(_0xf939d6){return _0xf939d6;});}return null;};}function removeEntity(_0x6ea0cd,_0x530a8c){return function(_0x2fe878){if(_0x2fe878){return _0x2fe878[_0x80db('0x24')]()[_0x80db('0x23')](function(){_0x6ea0cd[_0x80db('0x18')](0xcc)[_0x80db('0x19')]();});}};}function handleEntityNotFound(_0x52d48c,_0x333dea){return function(_0x18a032){if(!_0x18a032){_0x52d48c[_0x80db('0x17')](0x194);}return _0x18a032;};}function handleError(_0x10cf7b,_0x2cf466){_0x2cf466=_0x2cf466||0x1f4;return function(_0x4be3fe){logger[_0x80db('0x25')](_0x4be3fe[_0x80db('0x26')]);if(_0x4be3fe['name']){delete _0x4be3fe[_0x80db('0x27')];}_0x10cf7b[_0x80db('0x18')](_0x2cf466)['send'](_0x4be3fe);};}exports[_0x80db('0x28')]=function(_0x4fe136,_0x4e025c){var _0x699b6b={},_0xc34de3={},_0x5866f8={'count':0x0,'rows':[]};var _0x1c3958=_['map'](db[_0x80db('0x29')]['rawAttributes'],function(_0x15a6f6){return{'name':_0x15a6f6[_0x80db('0x2a')],'type':_0x15a6f6[_0x80db('0x2b')][_0x80db('0x2c')]};});_0xc34de3[_0x80db('0x2d')]=_['map'](_0x1c3958,'name');_0xc34de3[_0x80db('0x2e')]=_[_0x80db('0x2f')](_0x4fe136[_0x80db('0x2e')]);_0xc34de3[_0x80db('0x30')]=_[_0x80db('0x31')](_0xc34de3['model'],_0xc34de3[_0x80db('0x2e')]);_0x699b6b[_0x80db('0x32')]=_[_0x80db('0x31')](_0xc34de3[_0x80db('0x2d')],qs[_0x80db('0x33')](_0x4fe136[_0x80db('0x2e')][_0x80db('0x33')]));_0x699b6b[_0x80db('0x32')]=_0x699b6b[_0x80db('0x32')][_0x80db('0x34')]?_0x699b6b[_0x80db('0x32')]:_0xc34de3[_0x80db('0x2d')];if(!_0x4fe136[_0x80db('0x2e')][_0x80db('0x35')](_0x80db('0x36'))){_0x699b6b[_0x80db('0x1e')]=qs[_0x80db('0x1e')](_0x4fe136['query']['limit']);_0x699b6b[_0x80db('0x1b')]=qs[_0x80db('0x1b')](_0x4fe136[_0x80db('0x2e')][_0x80db('0x1b')]);}_0x699b6b['order']=qs[_0x80db('0x37')](_0x4fe136[_0x80db('0x2e')][_0x80db('0x37')]);_0x699b6b[_0x80db('0x38')]=qs[_0x80db('0x30')](_[_0x80db('0x39')](_0x4fe136[_0x80db('0x2e')],_0xc34de3[_0x80db('0x30')]),_0x1c3958);if(_0x4fe136['query'][_0x80db('0x3a')]){_0x699b6b[_0x80db('0x38')]=_['merge'](_0x699b6b[_0x80db('0x38')],{'$or':_[_0x80db('0x3b')](_0x1c3958,function(_0x37c050){if(_0x37c050['type']!==_0x80db('0x3c')){var _0x440991={};_0x440991[_0x37c050[_0x80db('0x27')]]={'$like':'%'+_0x4fe136[_0x80db('0x2e')][_0x80db('0x3a')]+'%'};return _0x440991;}})});}_0x699b6b=_['merge']({},_0x699b6b,_0x4fe136[_0x80db('0x3d')]);var _0x2c8111={'where':_0x699b6b[_0x80db('0x38')]};return db[_0x80db('0x29')][_0x80db('0x1d')](_0x2c8111)[_0x80db('0x23')](function(_0x7f0a82){_0x5866f8[_0x80db('0x1d')]=_0x7f0a82;if(_0x4fe136['query'][_0x80db('0x3e')]){_0x699b6b['include']=[{'all':!![]}];}return db['Attachment'][_0x80db('0x3f')](_0x699b6b);})[_0x80db('0x23')](function(_0x586d45){_0x5866f8[_0x80db('0x40')]=_0x586d45;return _0x5866f8;})[_0x80db('0x23')](respondWithFilteredResult(_0x4e025c,_0x699b6b))[_0x80db('0x41')](handleError(_0x4e025c,null));};exports['show']=function(_0x2232db,_0x510917){var _0x1205d6={'raw':!![],'where':{'id':_0x2232db[_0x80db('0x42')]['id']}},_0x3aa4ff={};_0x3aa4ff[_0x80db('0x2d')]=_[_0x80db('0x2f')](db[_0x80db('0x29')][_0x80db('0x43')]);_0x3aa4ff[_0x80db('0x2e')]=_[_0x80db('0x2f')](_0x2232db[_0x80db('0x2e')]);_0x3aa4ff['filters']=_[_0x80db('0x31')](_0x3aa4ff[_0x80db('0x2d')],_0x3aa4ff[_0x80db('0x2e')]);_0x1205d6['attributes']=_[_0x80db('0x31')](_0x3aa4ff[_0x80db('0x2d')],qs['fields'](_0x2232db[_0x80db('0x2e')][_0x80db('0x33')]));_0x1205d6[_0x80db('0x32')]=_0x1205d6['attributes']['length']?_0x1205d6['attributes']:_0x3aa4ff[_0x80db('0x2d')];if(_0x2232db['query'][_0x80db('0x3e')]){_0x1205d6[_0x80db('0x44')]=[{'all':!![]}];}_0x1205d6=_[_0x80db('0x45')]({},_0x1205d6,_0x2232db['options']);return db[_0x80db('0x29')][_0x80db('0x46')](_0x1205d6)[_0x80db('0x23')](handleEntityNotFound(_0x510917,null))['then'](respondWithResult(_0x510917,null))[_0x80db('0x41')](handleError(_0x510917,null));};exports[_0x80db('0x47')]=function(_0xfb4344,_0xb8bf6c){var _0x931c56={'where':{'id':_0xfb4344[_0x80db('0x42')]['id']}},_0x69b0e={};_0x69b0e['model']=_[_0x80db('0x2f')](db[_0x80db('0x29')][_0x80db('0x43')]);_0x931c56[_0x80db('0x32')]=_['intersection'](_0x69b0e[_0x80db('0x2d')],qs['fields'](_0xfb4344[_0x80db('0x2e')][_0x80db('0x33')]));_0x931c56[_0x80db('0x32')]=_0x931c56['attributes']['length']?_0x931c56[_0x80db('0x32')]:_0x69b0e[_0x80db('0x2d')];if(_0xfb4344[_0x80db('0x2e')][_0x80db('0x3e')]){_0x931c56[_0x80db('0x44')]=[{'all':!![]}];}_0x931c56=_[_0x80db('0x45')]({},_0x931c56,_0xfb4344[_0x80db('0x3d')]);return db[_0x80db('0x29')][_0x80db('0x46')](_0x931c56)[_0x80db('0x23')](handleEntityNotFound(_0xb8bf6c,null))[_0x80db('0x23')](function(_0xf248f8){if(_0xf248f8){var _0x448c08=_0xf248f8['get']({'plain':!![]});_0x448c08=qs[_0x80db('0x48')](_0x448c08,['id','createdAt',_0x80db('0x49')]);_0xfb4344[_0x80db('0x4a')]=_[_0x80db('0x48')](_0xfb4344[_0x80db('0x4a')],['id',_0x80db('0x4b'),_0x80db('0x49')]);return db['Attachment']['create'](_[_0x80db('0x45')](_0x448c08,_0xfb4344['body']),{'include':_0xfb4344[_0x80db('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x80db('0x23')](respondWithResult(_0xb8bf6c,0xc9))[_0x80db('0x41')](handleError(_0xb8bf6c,null));};exports[_0x80db('0x22')]=function(_0x57a484,_0x3494ff){if(_0x57a484[_0x80db('0x4a')]['id']){delete _0x57a484[_0x80db('0x4a')]['id'];}return db[_0x80db('0x29')]['find']({'where':{'id':_0x57a484[_0x80db('0x42')]['id']}})['then'](handleEntityNotFound(_0x3494ff,null))['then'](saveUpdates(_0x57a484['body'],null))[_0x80db('0x23')](respondWithResult(_0x3494ff,null))[_0x80db('0x41')](handleError(_0x3494ff,null));};exports[_0x80db('0x24')]=function(_0x3bce13,_0x594369){return db[_0x80db('0x29')][_0x80db('0x46')]({'where':{'id':_0x3bce13[_0x80db('0x42')]['id']}})['then'](handleEntityNotFound(_0x594369,null))[_0x80db('0x23')](removeEntity(_0x594369,null))[_0x80db('0x41')](handleError(_0x594369,null));};exports[_0x80db('0x4c')]=function(_0x2d5d2a,_0x5445eb,_0x5b5bd4){_0x2d5d2a[_0x80db('0x4a')][_0x80db('0x27')]=_0x2d5d2a[_0x80db('0x4d')][_0x80db('0x4e')];_0x2d5d2a[_0x80db('0x4a')]['basename']=_0x2d5d2a['file']['filename'];_0x2d5d2a[_0x80db('0x4a')]['type']=_0x2d5d2a[_0x80db('0x4d')][_0x80db('0x4f')];return db[_0x80db('0x29')][_0x80db('0x4c')](_0x2d5d2a['body'])['then'](respondWithResult(_0x5445eb,0xc9))[_0x80db('0x41')](handleError(_0x5445eb,null));};exports[_0x80db('0x50')]=function(_0x4beb50,_0x3658c8,_0x5503bc){return db[_0x80db('0x29')][_0x80db('0x51')]({'where':{'id':_0x4beb50['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3658c8,null))['then'](function(_0x36be93){if(_0x36be93){var _0x685efd=_0x36be93['ChatOfflineMessageId']!==null;var _0x3b934e=path[_0x80db('0x52')](config['root'],_0x80db('0x53'));if(_0x685efd){_0x3b934e=path[_0x80db('0x52')](_0x3b934e,_0x80db('0x54'));}var _0x43e003=path['join'](_0x3b934e,_0x36be93['basename']);return _0x3658c8[_0x80db('0x50')](_0x43e003);}})[_0x80db('0x41')](handleError(_0x3658c8,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 483e204..23f4cd7 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 _0x5ed7=['Attachment','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x354f55,_0x1b2923){var _0x223f6b=function(_0x3ece83){while(--_0x3ece83){_0x354f55['push'](_0x354f55['shift']());}};_0x223f6b(++_0x1b2923);}(_0x5ed7,0xd0));var _0x75ed=function(_0x2204b8,_0xed74f5){_0x2204b8=_0x2204b8-0x0;var _0x3bf14f=_0x5ed7[_0x2204b8];return _0x3bf14f;};'use strict';var _=require(_0x75ed('0x0'));var util=require('util');var logger=require(_0x75ed('0x1'))(_0x75ed('0x2'));var moment=require(_0x75ed('0x3'));var BPromise=require(_0x75ed('0x4'));var rp=require(_0x75ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75ed('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x75ed('0x7')]=function(_0x30c87d,_0x51ed1a){return _0x30c87d['define'](_0x75ed('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ca3=['moment','request-promise','path','../../config/environment','./attachment.attributes','define','Attachment','attachments','util','../../config/logger','api'];(function(_0x55d17b,_0x9aabe8){var _0xf6a458=function(_0x410808){while(--_0x410808){_0x55d17b['push'](_0x55d17b['shift']());}};_0xf6a458(++_0x9aabe8);}(_0x4ca3,0x1e1));var _0x34ca=function(_0x1369be,_0x5f3027){_0x1369be=_0x1369be-0x0;var _0x23355d=_0x4ca3[_0x1369be];return _0x23355d;};'use strict';var _=require('lodash');var util=require(_0x34ca('0x0'));var logger=require(_0x34ca('0x1'))(_0x34ca('0x2'));var moment=require(_0x34ca('0x3'));var BPromise=require('bluebird');var rp=require(_0x34ca('0x4'));var fs=require('fs');var path=require(_0x34ca('0x5'));var rimraf=require('rimraf');var config=require(_0x34ca('0x6'));var attributes=require(_0x34ca('0x7'));module['exports']=function(_0x4bf728,_0x2891de){return _0x4bf728[_0x34ca('0x8')](_0x34ca('0x9'),attributes,{'tableName':_0x34ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index c6843a2..950b467 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 _0xee39=['create','body','options','raw','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment'];(function(_0x29806d,_0x296c13){var _0x3b8361=function(_0x58e84d){while(--_0x58e84d){_0x29806d['push'](_0x29806d['shift']());}};_0x3b8361(++_0x296c13);}(_0xee39,0x1e6));var _0x9ee3=function(_0x244e46,_0x5a2dd3){_0x244e46=_0x244e46-0x0;var _0x1bacd5=_0xee39[_0x244e46];return _0x1bacd5;};'use strict';var _=require(_0x9ee3('0x0'));var util=require(_0x9ee3('0x1'));var moment=require(_0x9ee3('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ee3('0x3'));var fs=require('fs');var Redis=require(_0x9ee3('0x4'));var db=require(_0x9ee3('0x5'))['db'];var utils=require(_0x9ee3('0x6'));var logger=require(_0x9ee3('0x7'))(_0x9ee3('0x8'));var config=require(_0x9ee3('0x9'));var jayson=require(_0x9ee3('0xa'));var client=jayson[_0x9ee3('0xb')][_0x9ee3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dc1eb,_0x10e9e6,_0x22264c){return new BPromise(function(_0x22c8fc,_0x4d1a57){return client[_0x9ee3('0xd')](_0x4dc1eb,_0x22264c)['then'](function(_0x1bde67){logger['info'](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');logger['debug'](_0x9ee3('0xf'),_0x10e9e6,'request\x20sent',JSON[_0x9ee3('0x10')](_0x1bde67));if(_0x1bde67['error']){if(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x12')]===0x1f4){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);return _0x4d1a57(_0x1bde67[_0x9ee3('0x11')]['message']);}logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')]['message']);return _0x22c8fc(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);}else{logger[_0x9ee3('0x14')](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');_0x22c8fc(_0x1bde67['result'][_0x9ee3('0x13')]);}})[_0x9ee3('0x15')](function(_0x456bf7){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x456bf7);_0x4d1a57(_0x456bf7);});});}exports[_0x9ee3('0x16')]=function(_0x4a0de5){var _0x4a987a=this;return new Promise(function(_0x1f937f,_0x1342e2){return db[_0x9ee3('0x17')][_0x9ee3('0x18')](_0x4a0de5[_0x9ee3('0x19')],{'raw':_0x4a0de5[_0x9ee3('0x1a')]?_0x4a0de5[_0x9ee3('0x1a')][_0x9ee3('0x1b')]===undefined?!![]:![]:!![]})[_0x9ee3('0x1c')](function(_0x80671d){logger['info'](_0x9ee3('0x16'),_0x4a0de5);logger[_0x9ee3('0x1d')](_0x9ee3('0x16'),_0x4a0de5,JSON[_0x9ee3('0x10')](_0x80671d));_0x1f937f(_0x80671d);})[_0x9ee3('0x15')](function(_0x44bc5a){logger['error'](_0x9ee3('0x16'),_0x44bc5a[_0x9ee3('0x13')],_0x4a0de5);_0x1342e2(_0x4a987a[_0x9ee3('0x11')](0x1f4,_0x44bc5a[_0x9ee3('0x13')]));});});}; \ No newline at end of file +var _0x03ce=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Attachment','create','body','raw','CreateAttachment','lodash','util','moment'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x03ce,0x1a1));var _0xe03c=function(_0x41e118,_0x413436){_0x41e118=_0x41e118-0x0;var _0xf26001=_0x03ce[_0x41e118];return _0xf26001;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var moment=require(_0xe03c('0x2'));var BPromise=require(_0xe03c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe03c('0x4'));var db=require(_0xe03c('0x5'))['db'];var utils=require(_0xe03c('0x6'));var logger=require('../../config/logger')(_0xe03c('0x7'));var config=require(_0xe03c('0x8'));var jayson=require(_0xe03c('0x9'));var client=jayson[_0xe03c('0xa')][_0xe03c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c54f,_0x89f039,_0x52dda4){return new BPromise(function(_0x53c2b0,_0x3bca56){return client[_0xe03c('0xc')](_0x44c54f,_0x52dda4)[_0xe03c('0xd')](function(_0x267044){logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,_0xe03c('0x10'));logger[_0xe03c('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x89f039,_0xe03c('0x10'),JSON[_0xe03c('0x12')](_0x267044));if(_0x267044[_0xe03c('0x13')]){if(_0x267044['error'][_0xe03c('0x14')]===0x1f4){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);return _0x3bca56(_0x267044['error'][_0xe03c('0x15')]);}logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044['error'][_0xe03c('0x15')]);return _0x53c2b0(_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);}else{logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,'request\x20sent');_0x53c2b0(_0x267044[_0xe03c('0x16')][_0xe03c('0x15')]);}})['catch'](function(_0x7160ac){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x7160ac);_0x3bca56(_0x7160ac);});});}exports['CreateAttachment']=function(_0x56ec58){var _0x23080a=this;return new Promise(function(_0x386cb7,_0x47da2a){return db[_0xe03c('0x17')][_0xe03c('0x18')](_0x56ec58[_0xe03c('0x19')],{'raw':_0x56ec58['options']?_0x56ec58['options'][_0xe03c('0x1a')]===undefined?!![]:![]:!![]})[_0xe03c('0xd')](function(_0x3bf505){logger[_0xe03c('0xe')](_0xe03c('0x1b'),_0x56ec58);logger[_0xe03c('0x11')](_0xe03c('0x1b'),_0x56ec58,JSON[_0xe03c('0x12')](_0x3bf505));_0x386cb7(_0x3bf505);})['catch'](function(_0x1cbf9f){logger['error'](_0xe03c('0x1b'),_0x1cbf9f[_0xe03c('0x15')],_0x56ec58);_0x47da2a(_0x23080a[_0xe03c('0x13')](0x1f4,_0x1cbf9f[_0xe03c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2e2a58d..4cecd39 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0xa7075c,_0x49eae0){var _0x5ca75f=function(_0x2f7982){while(--_0x2f7982){_0xa7075c['push'](_0xa7075c['shift']());}};_0x5ca75f(++_0x49eae0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1eb4e0,_0x4ebc2d){_0x1eb4e0=_0x1eb4e0-0x0;var _0x18ec21=_0xb10b[_0x1eb4e0];return _0x18ec21;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x2c1fe0,_0x52d633){_0x2c1fe0=_0x2c1fe0-0x0;var _0x15eeb8=_0xdb28[_0x2c1fe0];return _0x15eeb8;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 78caf2d..04e5ddf 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 _0x9d94=['activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','admin','user','add','minutes','clearBlockUser','getLicense','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','Strategy'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9d94,0x11e));var _0x49d9=function(_0x56a77e,_0x5f2d5d){_0x56a77e=_0x56a77e-0x0;var _0x2eca06=_0x9d94[_0x56a77e];return _0x2eca06;};'use strict';var passport=require(_0x49d9('0x0'));var LocalStrategy=require('passport-local')[_0x49d9('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x49d9('0x2'));var BPromise=require(_0x49d9('0x3'));var util=require(_0x49d9('0x4'));var db=require(_0x49d9('0x5'))['db'];var authService=require(_0x49d9('0x6'));var utils=require(_0x49d9('0x7'));var config=require(_0x49d9('0x8'));var logger=require(_0x49d9('0x9'))('api');function isActiveDirectoryConfigured(_0x385571){var _0x25a172=![];if(typeof _0x385571['activedirectory']!==_0x49d9('0xa')){_0x25a172=_0x385571[_0x49d9('0xb')][_0x49d9('0xc')]&&_0x385571[_0x49d9('0xb')]['url']&&_0x385571[_0x49d9('0xb')][_0x49d9('0xd')];}return _0x25a172;}function adAuthenticate(_0x4efc8f,_0x590cb3,_0x508230){return new BPromise(function(_0x2950f9,_0x1ac297){try{var _0x336edc=new ActiveDirectory(_0x4efc8f);_0x336edc['authenticate'](_0x590cb3,_0x508230,function(_0x148966,_0x1bbe29){if(_0x148966){logger[_0x49d9('0xe')](_0x49d9('0xf'),_0x590cb3,util[_0x49d9('0x10')](_0x148966,{'showHidden':![],'depth':null}));_0x1ac297(_0x49d9('0x11'));}else if(!_0x1bbe29){logger['error'](_0x49d9('0x12'),_0x590cb3);_0x1ac297(_0x49d9('0x11'));}else{_0x2950f9(_0x1bbe29);}});}catch(_0x5aa85d){_0x1ac297(_0x5aa85d);}});}function ActiveDirectoryAuthenticate(_0x19e258,_0x2254cf,_0x1e4c49,_0x128a37){var _0x1dc822,_0x8d1b1f;if(!isActiveDirectoryConfigured(config)){logger[_0x49d9('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2254cf);return _0x128a37(null,![],{'message':_0x49d9('0x11')});}return db['Setting'][_0x49d9('0x13')]({'where':{'id':0x1},'attributes':[_0x49d9('0x14'),_0x49d9('0x15')],'raw':!![]})[_0x49d9('0x16')](function(_0x238022){_0x1dc822=_0x238022;if(!_0x1dc822['adSsoEnabled']){logger[_0x49d9('0xe')](_0x49d9('0x17'),_0x2254cf);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x19e258[_0x49d9('0x13')]({'attributes':['id',_0x49d9('0x18'),_0x49d9('0x19'),_0x49d9('0x1a'),_0x49d9('0x1b'),_0x49d9('0x1c'),_0x49d9('0x1d'),_0x49d9('0x1e'),'online'],'where':{'name':_0x2254cf,'role':{'$or':[_0x49d9('0x1f'),_0x49d9('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0x49d9('0x16')](function(_0x47291a){if(!_0x47291a||_0x47291a&&_0x47291a['name']!==_0x2254cf){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x8d1b1f=_0x47291a;var _0x11497a=_0x8d1b1f[_0x49d9('0x18')]+'@'+config[_0x49d9('0xb')][_0x49d9('0xd')];return adAuthenticate(config['activedirectory'],_0x11497a,_0x1e4c49);})[_0x49d9('0x16')](function(_0x4b8fbf){if(_0x8d1b1f[_0x49d9('0x1c')]){throw new Error(_0x49d9('0x11'));}if(_0x1dc822[_0x49d9('0x15')]>0x0){if(_0x8d1b1f[_0x49d9('0x1d')]){if(moment(_0x8d1b1f[_0x49d9('0x1e')])[_0x49d9('0x21')](_0x1dc822[_0x49d9('0x15')],_0x49d9('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x49d9('0x23')](_0x8d1b1f,0x0,![],null)[_0x49d9('0x16')](function(){return utils['getLicense'](_0x8d1b1f);})[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}else{return utils['getLicense'](_0x8d1b1f)[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}}else{return utils[_0x49d9('0x24')](_0x8d1b1f)[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}})['catch'](function(_0x33cff8){return _0x128a37(null,![],_0x33cff8);});}function handleError(_0x574fc0,_0x2af378,_0x599bb3){return _0x574fc0['status'](_0x2af378||0x1f4)[_0x49d9('0x25')]({'message':_0x599bb3?_0x599bb3[_0x49d9('0x26')]||_0x599bb3:''});}exports[_0x49d9('0x27')]=function(_0x1f87d5,_0x9db538,_0x5e4ee5){passport[_0x49d9('0x28')](_0x49d9('0x29'),function(_0x33dbbb,_0x1c527d,_0x5448cd){var _0x3afe6f=_0x33dbbb||_0x5448cd;if(_0x3afe6f){return handleError(_0x9db538,0x191,_0x3afe6f);}if(!_0x1c527d){return handleError(_0x9db538,0x194,{'message':_0x49d9('0x2a')});}else{var _0x471499={'payload':{'id':_0x1c527d['id'],'role':_0x1c527d[_0x49d9('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x49d9('0x2b')](_0x471499)[_0x49d9('0x16')](function(_0x222385){_0x9db538[_0x49d9('0x2c')]({'id':_0x1c527d['id'],'token':_0x222385,'statusCall':'','isAlreadyLogged':_0x1c527d[_0x49d9('0x2d')]});});}})(_0x1f87d5,_0x9db538,_0x5e4ee5);};passport[_0x49d9('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0x49d9('0x18'),'passwordField':_0x49d9('0x19')},function(_0x43d975,_0x45faf6,_0x52dd4){return ActiveDirectoryAuthenticate(db[_0x49d9('0x2f')],_0x43d975,_0x45faf6,_0x52dd4);})); \ No newline at end of file +var _0x5888=['send','authenticate','ad-login','role','signToken','json','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','blocked','blockedAt','online','admin','user','agent','disabled','add','minutes','clearBlockUser','getLicense','catch','status'];(function(_0x580969,_0x583da9){var _0x2a9cbd=function(_0x473ffd){while(--_0x473ffd){_0x580969['push'](_0x580969['shift']());}};_0x2a9cbd(++_0x583da9);}(_0x5888,0x15f));var _0x8588=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x5888[_0x44946b];return _0x249bc4;};'use strict';var passport=require(_0x8588('0x0'));var LocalStrategy=require(_0x8588('0x1'))[_0x8588('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x8588('0x3'));var BPromise=require(_0x8588('0x4'));var util=require(_0x8588('0x5'));var db=require(_0x8588('0x6'))['db'];var authService=require(_0x8588('0x7'));var utils=require(_0x8588('0x8'));var config=require('../../config/environment');var logger=require(_0x8588('0x9'))(_0x8588('0xa'));function isActiveDirectoryConfigured(_0x2aef48){var _0x2fede1=![];if(typeof _0x2aef48['activedirectory']!=='undefined'){_0x2fede1=_0x2aef48['activedirectory']['baseDN']&&_0x2aef48[_0x8588('0xb')][_0x8588('0xc')]&&_0x2aef48['activedirectory'][_0x8588('0xd')];}return _0x2fede1;}function adAuthenticate(_0xe2ff91,_0x5d9a51,_0x250688){return new BPromise(function(_0x3a794e,_0x16a646){try{var _0x291f57=new ActiveDirectory(_0xe2ff91);_0x291f57['authenticate'](_0x5d9a51,_0x250688,function(_0x1c9455,_0x3e6ad4){if(_0x1c9455){logger[_0x8588('0xe')](_0x8588('0xf'),_0x5d9a51,util[_0x8588('0x10')](_0x1c9455,{'showHidden':![],'depth':null}));_0x16a646('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3e6ad4){logger[_0x8588('0xe')](_0x8588('0x11'),_0x5d9a51);_0x16a646(_0x8588('0x12'));}else{_0x3a794e(_0x3e6ad4);}});}catch(_0x5ac630){_0x16a646(_0x5ac630);}});}function ActiveDirectoryAuthenticate(_0xb13630,_0x13b255,_0x26feb8,_0x47cda0){var _0x1b3c38,_0x458225;if(!isActiveDirectoryConfigured(config)){logger[_0x8588('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x13b255);return _0x47cda0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x8588('0x13')][_0x8588('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x8588('0x15')],'raw':!![]})[_0x8588('0x16')](function(_0xc5412f){_0x1b3c38=_0xc5412f;if(!_0x1b3c38[_0x8588('0x17')]){logger[_0x8588('0xe')](_0x8588('0x18'),_0x13b255);throw new Error(_0x8588('0x12'));}return _0xb13630[_0x8588('0x14')]({'attributes':['id',_0x8588('0x19'),_0x8588('0x1a'),_0x8588('0x1b'),'role','disabled',_0x8588('0x1c'),_0x8588('0x1d'),_0x8588('0x1e')],'where':{'name':_0x13b255,'role':{'$or':[_0x8588('0x1f'),_0x8588('0x20'),_0x8588('0x21')]},'adSsoEnabled':!![]}});})[_0x8588('0x16')](function(_0x33d3b5){if(!_0x33d3b5||_0x33d3b5&&_0x33d3b5['name']!==_0x13b255){throw new Error(_0x8588('0x12'));}_0x458225=_0x33d3b5;var _0x3a5d57=_0x458225[_0x8588('0x19')]+'@'+config[_0x8588('0xb')][_0x8588('0xd')];return adAuthenticate(config['activedirectory'],_0x3a5d57,_0x26feb8);})['then'](function(_0x50bc96){if(_0x458225[_0x8588('0x22')]){throw new Error(_0x8588('0x12'));}if(_0x1b3c38[_0x8588('0x15')]>0x0){if(_0x458225[_0x8588('0x1c')]){if(moment(_0x458225[_0x8588('0x1d')])[_0x8588('0x23')](_0x1b3c38[_0x8588('0x15')],_0x8588('0x24'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x8588('0x25')](_0x458225,0x0,![],null)[_0x8588('0x16')](function(){return utils['getLicense'](_0x458225);})[_0x8588('0x16')](function(){return _0x47cda0(null,_0x458225);});}else{return utils['getLicense'](_0x458225)['then'](function(){return _0x47cda0(null,_0x458225);});}}else{return utils[_0x8588('0x26')](_0x458225)[_0x8588('0x16')](function(){return _0x47cda0(null,_0x458225);});}})[_0x8588('0x27')](function(_0x51b93d){return _0x47cda0(null,![],_0x51b93d);});}function handleError(_0x30954a,_0x313f6a,_0x5914fb){return _0x30954a[_0x8588('0x28')](_0x313f6a||0x1f4)[_0x8588('0x29')]({'message':_0x5914fb?_0x5914fb['message']||_0x5914fb:''});}exports['login']=function(_0xb2a3f3,_0x287266,_0x1546ab){passport[_0x8588('0x2a')](_0x8588('0x2b'),function(_0x5da0dc,_0x36ed91,_0x324228){var _0x5b119f=_0x5da0dc||_0x324228;if(_0x5b119f){return handleError(_0x287266,0x191,_0x5b119f);}if(!_0x36ed91){return handleError(_0x287266,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x351e44={'payload':{'id':_0x36ed91['id'],'role':_0x36ed91[_0x8588('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0x8588('0x2d')](_0x351e44)[_0x8588('0x16')](function(_0x1be16e){_0x287266[_0x8588('0x2e')]({'id':_0x36ed91['id'],'token':_0x1be16e,'statusCall':'','isAlreadyLogged':_0x36ed91[_0x8588('0x1e')]});});}})(_0xb2a3f3,_0x287266,_0x1546ab);};passport[_0x8588('0x2f')](_0x8588('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x88a0c7,_0x8f8c09,_0x513bbf){return ActiveDirectoryAuthenticate(db[_0x8588('0x30')],_0x88a0c7,_0x8f8c09,_0x513bbf);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index f246e34..a6111fc 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 _0x3bb2=['Router','./authActiveDirectory.controller','login','express'];(function(_0x454cee,_0x47a520){var _0x12e884=function(_0x50d5b7){while(--_0x50d5b7){_0x454cee['push'](_0x454cee['shift']());}};_0x12e884(++_0x47a520);}(_0x3bb2,0xd7));var _0x23bb=function(_0x3ef525,_0xe12832){_0x3ef525=_0x3ef525-0x0;var _0xcb28b0=_0x3bb2[_0x3ef525];return _0xcb28b0;};'use strict';var express=require(_0x23bb('0x0'));var router=express[_0x23bb('0x1')]();var controller=require(_0x23bb('0x2'));router['post']('/',controller[_0x23bb('0x3')]);module['exports']=router; \ No newline at end of file +var _0x8591=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x8591,0x7b));var _0x1859=function(_0x12b016,_0x2da732){_0x12b016=_0x12b016-0x0;var _0x100fa9=_0x8591[_0x12b016];return _0x100fa9;};'use strict';var express=require(_0x1859('0x0'));var router=express[_0x1859('0x1')]();var controller=require(_0x1859('0x2'));router[_0x1859('0x3')]('/',controller[_0x1859('0x4')]);module[_0x1859('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 89b0d23..9f53899 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(_0x1d64b0,_0x4d4725){var _0x28fd02=function(_0x137968){while(--_0x137968){_0x1d64b0['push'](_0x1d64b0['shift']());}};_0x28fd02(++_0x4d4725);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +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(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x7a54,0x106));var _0x47a5=function(_0x34c21d,_0x425c34){_0x34c21d=_0x34c21d-0x0;var _0x49a31d=_0x7a54[_0x34c21d];return _0x49a31d;};'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 3fc3ad6..51a1e08 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 _0x4e92=['../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express','passport','../user/user.controller.js'];(function(_0x5ca5d1,_0x2c27f1){var _0x89feb8=function(_0x4d9eed){while(--_0x4d9eed){_0x5ca5d1['push'](_0x5ca5d1['shift']());}};_0x89feb8(++_0x2c27f1);}(_0x4e92,0xed));var _0x24e9=function(_0x434903,_0x2bae84){_0x434903=_0x434903-0x0;var _0x31021e=_0x4e92[_0x434903];return _0x31021e;};'use strict';var express=require(_0x24e9('0x0'));var passport=require(_0x24e9('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x24e9('0x2'));var authService=require(_0x24e9('0x3'));router[_0x24e9('0x4')]('/',controller[_0x24e9('0x5')]);router['get'](_0x24e9('0x6'),controller[_0x24e9('0x7')],authService['isMiddleware'],userController['login'],authService[_0x24e9('0x8')]);module[_0x24e9('0x9')]=router; \ No newline at end of file +var _0xe6ed=['login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x5e1d62,_0x44a4b0){var _0x31040d=function(_0x368a17){while(--_0x368a17){_0x5e1d62['push'](_0x5e1d62['shift']());}};_0x31040d(++_0x44a4b0);}(_0xe6ed,0x107));var _0xde6e=function(_0x3b1add,_0x2e74e1){_0x3b1add=_0x3b1add-0x0;var _0x3ce724=_0xe6ed[_0x3b1add];return _0x3ce724;};'use strict';var express=require(_0xde6e('0x0'));var passport=require(_0xde6e('0x1'));var router=express[_0xde6e('0x2')]();var controller=require(_0xde6e('0x3'));var userController=require(_0xde6e('0x4'));var authService=require(_0xde6e('0x5'));router[_0xde6e('0x6')]('/',controller['login']);router[_0xde6e('0x6')](_0xde6e('0x7'),controller[_0xde6e('0x8')],authService[_0xde6e('0x9')],userController[_0xde6e('0xa')],authService[_0xde6e('0xb')]);module[_0xde6e('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 9288ffe..7fd4243 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 _0x616e=['now','save','body','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','use','util','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x1b5b4e,_0x14bbd9){var _0x3f4ff4=function(_0x2973a6){while(--_0x2973a6){_0x1b5b4e['push'](_0x1b5b4e['shift']());}};_0x3f4ff4(++_0x14bbd9);}(_0x616e,0x111));var _0xe616=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x616e[_0x1ca890];return _0x3f8e01;};'use strict';var util=require(_0xe616('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xe616('0x1')];var jayson=require(_0xe616('0x2'));var _=require('lodash');var rs=require(_0xe616('0x3'));var moment=require(_0xe616('0x4'));var db=require(_0xe616('0x5'))['db'];var authService=require(_0xe616('0x6'));var utils=require(_0xe616('0x7'));var client=jayson[_0xe616('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4052c6,_0xad3a8,_0x359cc8,_0x2b75dc){var _0x37cdf7,_0x176998;return db[_0xe616('0x9')][_0xe616('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe616('0xb')],'raw':!![]})[_0xe616('0xc')](function(_0x4cf55e){_0x37cdf7=_0x4cf55e;return _0x4052c6['findOne']({'attributes':['id',_0xe616('0xd'),_0xe616('0xe'),_0xe616('0xf'),_0xe616('0x10'),'disabled','blocked',_0xe616('0x11'),_0xe616('0x12')],'where':{'name':_0xad3a8,'role':{'$or':[_0xe616('0x13'),_0xe616('0x14'),_0xe616('0x15')]}}});})[_0xe616('0xc')](function(_0x50753d){if(!_0x50753d||_0x50753d&&_0x50753d[_0xe616('0xd')]!==_0xad3a8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x176998=_0x50753d;return _0x176998;}})[_0xe616('0xc')](function(){_0x176998[_0xe616('0x16')](_0x359cc8,function(_0x9c9e77,_0xbd9f6){var _0x42bdb0=_0x176998['loginAttempts']+0x1;if(_0x9c9e77){return _0x2b75dc(_0x9c9e77);}else if(!_0xbd9f6){if(_0x176998[_0xe616('0x17')]){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else if(_0x37cdf7[_0xe616('0x19')]>0x0){if(_0x176998[_0xe616('0x1a')]){if(_0x37cdf7[_0xe616('0xb')]>0x0){if(moment(_0x176998[_0xe616('0x11')])['add'](_0x37cdf7[_0xe616('0xb')],_0xe616('0x1b'))>moment()){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else{return utils[_0xe616('0x1c')](_0x176998,_0x42bdb0,![],null)[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}}else{return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}}else{if(_0x42bdb0>=_0x37cdf7[_0xe616('0x19')]){return utils[_0xe616('0x1c')](_0x176998,0x0,!![],moment())[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}else{return utils['clearBlockUser'](_0x176998,_0x42bdb0,![],null)[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}}}else{return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}}else{if(_0x176998[_0xe616('0x17')]){return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x37cdf7[_0xe616('0x19')]>0x0){if(_0x176998['blocked']){if(_0x37cdf7['blockDuration']>0x0){if(moment(_0x176998[_0xe616('0x11')])[_0xe616('0x1d')](_0x37cdf7[_0xe616('0xb')],_0xe616('0x1b'))>moment()){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else{return utils[_0xe616('0x1c')](_0x176998,0x0,![],null)[_0xe616('0xc')](function(){return utils[_0xe616('0x1e')](_0x176998);})['then'](function(){return _0x2b75dc(null,_0x176998);});}}else{return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x176998,0x0,![],null)[_0xe616('0xc')](function(){return utils[_0xe616('0x1e')](_0x176998);})[_0xe616('0xc')](function(){return _0x2b75dc(null,_0x176998);})[_0xe616('0x1f')](function(_0x379321){return _0x2b75dc(null,![],_0x379321);});}}else{if(_0x176998[_0xe616('0x1a')]){return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe616('0x1e')](_0x176998)[_0xe616('0xc')](function(){return _0x2b75dc(null,_0x176998);});}}}});})['catch'](function(_0x1b0c3c){return _0x2b75dc(null,![],_0x1b0c3c);});}function sendServiceMail(_0x43f46a){return db[_0xe616('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0xe616('0xd'),_0xe616('0x21')],'include':[{'model':db[_0xe616('0x22')],'as':_0xe616('0x23'),'include':[{'model':db['CloudProvider'],'as':_0xe616('0x24')}]}]})['then'](function(_0x3e5cea){if(!_0x3e5cea){throw new Error(_0xe616('0x25'));}var _0x18402c=_0x3e5cea[_0xe616('0x26')]();var _0x278d59={'account':_0x18402c,'message':_[_0xe616('0x27')]({'from':util[_0xe616('0x28')](_0xe616('0x29'),_0x3e5cea[_0xe616('0xd')],_0x3e5cea[_0xe616('0x21')]||_0x3e5cea['Smtp'][_0xe616('0x14')])},_0x43f46a)};return client[_0xe616('0x2a')](_0xe616('0x2b'),_0x278d59);})[_0xe616('0xc')](function(_0x5c558e){if(_0x5c558e[_0xe616('0x2c')]){throw new Error(util[_0xe616('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5c558e[_0xe616('0x2c')][_0xe616('0x2d')]||JSON['stringify'](_0x5c558e['error'])));}return!![];});}function handleError(_0x45de73,_0xe6ba70,_0x367088){return _0x45de73[_0xe616('0x2e')](_0xe6ba70||0x1f4)[_0xe616('0x2f')]({'message':_0x367088?_0x367088[_0xe616('0x2d')]||_0x367088:''});}exports[_0xe616('0x30')]=function(_0x41d140,_0x9314e0,_0x2fa5e0){passport[_0xe616('0x16')](_0xe616('0x31'),function(_0x3555aa,_0x3df887,_0x39aba4){var _0x559889=_0x3555aa||_0x39aba4;if(_0x559889){return handleError(_0x9314e0,0x191,_0x559889);}if(!_0x3df887){return handleError(_0x9314e0,0x194,{'message':_0xe616('0x32')});}else{var _0x2baffb={'payload':{'id':_0x3df887['id'],'role':_0x3df887[_0xe616('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xe616('0x33')](_0x2baffb)[_0xe616('0xc')](function(_0x7854a5){_0x9314e0[_0xe616('0x34')]({'id':_0x3df887['id'],'token':_0x7854a5,'statusCall':'','isAlreadyLogged':_0x3df887[_0xe616('0x35')]});});}})(_0x41d140,_0x9314e0,_0x2fa5e0);};exports[_0xe616('0x36')]=function(_0x5b1f50,_0x582a4e){if(!_0x5b1f50['body'][_0xe616('0x21')]){return handleError(_0x582a4e,0x1f4,{'message':_0xe616('0x37')});}var _0x5815d7=rs['generate']();_0x5b1f50['body'][_0xe616('0x21')]=_0x5b1f50['body'][_0xe616('0x21')][_0xe616('0x38')]()[_0xe616('0x39')]();var _0x4173c6;return db[_0xe616('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xe616('0x19'),_0xe616('0xb')],'raw':!![]})[_0xe616('0xc')](function(_0x47e1b4){_0x4173c6=_0x47e1b4;return db[_0xe616('0x3a')][_0xe616('0x3b')]({'where':{'email':_0x5b1f50['body']['email']}});})['then'](function(_0x5346fd){if(!_0x5346fd){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5346fd[_0xe616('0x17')]){throw new Error(_0xe616('0x3c'));}if(_0x5346fd[_0xe616('0x1a')]){if(moment(_0x5346fd[_0xe616('0x11')])[_0xe616('0x1d')](_0x4173c6[_0xe616('0xb')],'minutes')>moment()){throw new Error(_0xe616('0x3d'));}else{_0x5346fd['blocked']=![];_0x5346fd['blockedAt']=null;}}_0x5346fd[_0xe616('0x3e')]=_0x5815d7;_0x5346fd['resetPasswordExpires']=Date[_0xe616('0x3f')]()+0x36ee80;return _0x5346fd[_0xe616('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x5b1f50[_0xe616('0x41')]['email'],'subject':_0xe616('0x42'),'text':_0xe616('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe616('0x44')+_0x5b1f50[_0xe616('0x45')][_0xe616('0x46')]+_0xe616('0x47')+_0x5815d7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x582a4e[_0xe616('0x2e')](0xc8)[_0xe616('0x2f')]({'message':_0xe616('0x48')});})[_0xe616('0x1f')](function(_0x32beec){return handleError(_0x582a4e,0x1f4,_0x32beec);});};exports[_0xe616('0x49')]=function(_0x173d02,_0x5079d8){return db['User'][_0xe616('0x3b')]({'where':{'resetPasswordToken':_0x173d02[_0xe616('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x3abc4d){if(!_0x3abc4d){throw new Error(_0xe616('0x4b'));}return db[_0xe616('0x9')][_0xe616('0xa')]({'attributes':['id',_0xe616('0x4c'),_0xe616('0x4d'),_0xe616('0x4e')]})[_0xe616('0xc')](function(_0x41d766){if(_0x41d766[_0xe616('0x4c')])authService[_0xe616('0x4f')](_0x173d02[_0xe616('0x41')][_0xe616('0xe')]);if(!_0x41d766[_0xe616('0x4d')]||!_0x3abc4d[_0xe616('0x50')])return _0x3abc4d;authService[_0xe616('0x51')](_0x173d02['body'][_0xe616('0xe')],_0x3abc4d['previousPasswords'],_0x41d766['passwordHistoryLimit']);return _0x3abc4d;})[_0xe616('0xc')](function(){_0x3abc4d[_0xe616('0xe')]=_0x173d02[_0xe616('0x41')][_0xe616('0xe')];_0x3abc4d[_0xe616('0x3e')]=null;_0x3abc4d[_0xe616('0x52')]=null;return _0x3abc4d['save']();});})['then'](function(){_0x5079d8[_0xe616('0x2e')](0xc8)[_0xe616('0x2f')]({'message':'Password\x20reset!'});})['catch'](function(_0x1bde4c){return handleError(_0x5079d8,0x1f4,_0x1bde4c);});};passport[_0xe616('0x53')](_0xe616('0x31'),new LocalStrategy({'usernameField':_0xe616('0xd'),'passwordField':_0xe616('0xe')},function(_0x4c58f4,_0x185bca,_0x28a9fc){return localAuthenticate(db['User'],_0x4c58f4,_0x185bca,_0x28a9fc);})); \ No newline at end of file +var _0x0bf7=['host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','save','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blocked','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','User','This\x20email\x20is\x20not\x20registered.','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','https://','headers'];(function(_0x5c78f8,_0x2017c6){var _0xb189c6=function(_0x4eddec){while(--_0x4eddec){_0x5c78f8['push'](_0x5c78f8['shift']());}};_0xb189c6(++_0x2017c6);}(_0x0bf7,0x14a));var _0x70bf=function(_0x47ce21,_0x23d7a6){_0x47ce21=_0x47ce21-0x0;var _0x8ca656=_0x0bf7[_0x47ce21];return _0x8ca656;};'use strict';var util=require(_0x70bf('0x0'));var passport=require('passport');var LocalStrategy=require(_0x70bf('0x1'))[_0x70bf('0x2')];var jayson=require(_0x70bf('0x3'));var _=require(_0x70bf('0x4'));var rs=require(_0x70bf('0x5'));var moment=require(_0x70bf('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x70bf('0x7'));var utils=require('../../config/utils');var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x4179e4,_0x410444,_0x12c90d,_0x24b8b0){var _0x2ba2ce,_0x140739;return db[_0x70bf('0x8')][_0x70bf('0x9')]({'where':{'id':0x1},'attributes':[_0x70bf('0xa'),_0x70bf('0xb')],'raw':!![]})['then'](function(_0x52d711){_0x2ba2ce=_0x52d711;return _0x4179e4[_0x70bf('0x9')]({'attributes':['id','name',_0x70bf('0xc'),_0x70bf('0xd'),_0x70bf('0xe'),_0x70bf('0xf'),_0x70bf('0x10'),'blockedAt',_0x70bf('0x11')],'where':{'name':_0x410444,'role':{'$or':[_0x70bf('0x12'),_0x70bf('0x13'),'agent']}}});})[_0x70bf('0x14')](function(_0x5ea42e){if(!_0x5ea42e||_0x5ea42e&&_0x5ea42e['name']!==_0x410444){throw new Error(_0x70bf('0x15'));}else{_0x140739=_0x5ea42e;return _0x140739;}})[_0x70bf('0x14')](function(){_0x140739['authenticate'](_0x12c90d,function(_0x267e1e,_0x595443){var _0x1e0dfc=_0x140739['loginAttempts']+0x1;if(_0x267e1e){return _0x24b8b0(_0x267e1e);}else if(!_0x595443){if(_0x140739['disabled']){return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});}else if(_0x2ba2ce[_0x70bf('0xa')]>0x0){if(_0x140739[_0x70bf('0x10')]){if(_0x2ba2ce[_0x70bf('0xb')]>0x0){if(moment(_0x140739[_0x70bf('0x16')])[_0x70bf('0x17')](_0x2ba2ce['blockDuration'],_0x70bf('0x18'))>moment()){return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});}else{return utils[_0x70bf('0x19')](_0x140739,_0x1e0dfc,![],null)['then'](function(){return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});});}}else{return _0x24b8b0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1e0dfc>=_0x2ba2ce[_0x70bf('0xa')]){return utils[_0x70bf('0x19')](_0x140739,0x0,!![],moment())['then'](function(){return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});});}else{return utils[_0x70bf('0x19')](_0x140739,_0x1e0dfc,![],null)['then'](function(){return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});});}}}else{return _0x24b8b0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x140739[_0x70bf('0xf')]){return _0x24b8b0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2ba2ce[_0x70bf('0xa')]>0x0){if(_0x140739[_0x70bf('0x10')]){if(_0x2ba2ce[_0x70bf('0xb')]>0x0){if(moment(_0x140739[_0x70bf('0x16')])[_0x70bf('0x17')](_0x2ba2ce['blockDuration'],_0x70bf('0x18'))>moment()){return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});}else{return utils[_0x70bf('0x19')](_0x140739,0x0,![],null)['then'](function(){return utils[_0x70bf('0x1a')](_0x140739);})[_0x70bf('0x14')](function(){return _0x24b8b0(null,_0x140739);});}}else{return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});}}else{return utils['clearBlockUser'](_0x140739,0x0,![],null)[_0x70bf('0x14')](function(){return utils['getLicense'](_0x140739);})['then'](function(){return _0x24b8b0(null,_0x140739);})[_0x70bf('0x1b')](function(_0x4413c8){return _0x24b8b0(null,![],_0x4413c8);});}}else{if(_0x140739[_0x70bf('0x10')]){return _0x24b8b0(null,![],{'message':_0x70bf('0x15')});}else{return utils[_0x70bf('0x1a')](_0x140739)[_0x70bf('0x14')](function(){return _0x24b8b0(null,_0x140739);});}}}});})[_0x70bf('0x1b')](function(_0x2fb63e){return _0x24b8b0(null,![],_0x2fb63e);});}function sendServiceMail(_0x57451b){return db[_0x70bf('0x1c')][_0x70bf('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x70bf('0x1e'),_0x70bf('0x1f')],'include':[{'model':db[_0x70bf('0x20')],'as':_0x70bf('0x21'),'include':[{'model':db[_0x70bf('0x22')],'as':_0x70bf('0x22')}]}]})[_0x70bf('0x14')](function(_0x103fdb){if(!_0x103fdb){throw new Error(_0x70bf('0x23'));}var _0x17acbf=_0x103fdb[_0x70bf('0x24')]();var _0x397e76={'account':_0x17acbf,'message':_[_0x70bf('0x25')]({'from':util[_0x70bf('0x26')](_0x70bf('0x27'),_0x103fdb[_0x70bf('0x1e')],_0x103fdb[_0x70bf('0x1f')]||_0x103fdb[_0x70bf('0x21')][_0x70bf('0x13')])},_0x57451b)};return client['request'](_0x70bf('0x28'),_0x397e76);})[_0x70bf('0x14')](function(_0x94d7b){if(_0x94d7b[_0x70bf('0x29')]){throw new Error(util[_0x70bf('0x26')](_0x70bf('0x2a'),_0x94d7b[_0x70bf('0x29')][_0x70bf('0x2b')]||JSON[_0x70bf('0x2c')](_0x94d7b['error'])));}return!![];});}function handleError(_0x2b4c1e,_0x339717,_0x5464b2){return _0x2b4c1e[_0x70bf('0x2d')](_0x339717||0x1f4)[_0x70bf('0x2e')]({'message':_0x5464b2?_0x5464b2['message']||_0x5464b2:''});}exports['login']=function(_0x5b64b3,_0x420681,_0x2ee96a){passport[_0x70bf('0x2f')](_0x70bf('0x30'),function(_0x43f5a8,_0x19daff,_0xab2f7b){var _0x186f15=_0x43f5a8||_0xab2f7b;if(_0x186f15){return handleError(_0x420681,0x191,_0x186f15);}if(!_0x19daff){return handleError(_0x420681,0x194,{'message':_0x70bf('0x31')});}else{var _0x6d7a8a={'payload':{'id':_0x19daff['id'],'role':_0x19daff[_0x70bf('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x70bf('0x32')](_0x6d7a8a)[_0x70bf('0x14')](function(_0x5c85f1){_0x420681[_0x70bf('0x33')]({'id':_0x19daff['id'],'token':_0x5c85f1,'statusCall':'','isAlreadyLogged':_0x19daff['online']});});}})(_0x5b64b3,_0x420681,_0x2ee96a);};exports[_0x70bf('0x34')]=function(_0x2fadb6,_0x2343cd){if(!_0x2fadb6[_0x70bf('0x35')]['email']){return handleError(_0x2343cd,0x1f4,{'message':_0x70bf('0x36')});}var _0xe5ca2e=rs['generate']();_0x2fadb6[_0x70bf('0x35')][_0x70bf('0x1f')]=_0x2fadb6['body'][_0x70bf('0x1f')]['trim']()['toLowerCase']();var _0x3c91e8;return db[_0x70bf('0x8')][_0x70bf('0x9')]({'where':{'id':0x1},'attributes':[_0x70bf('0xa'),_0x70bf('0xb')],'raw':!![]})[_0x70bf('0x14')](function(_0x3c7ae8){_0x3c91e8=_0x3c7ae8;return db[_0x70bf('0x37')]['find']({'where':{'email':_0x2fadb6['body'][_0x70bf('0x1f')]}});})[_0x70bf('0x14')](function(_0x4baf70){if(!_0x4baf70){throw new Error(_0x70bf('0x38'));}if(_0x4baf70[_0x70bf('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4baf70[_0x70bf('0x10')]){if(moment(_0x4baf70[_0x70bf('0x16')])[_0x70bf('0x17')](_0x3c91e8[_0x70bf('0xb')],_0x70bf('0x18'))>moment()){throw new Error(_0x70bf('0x39'));}else{_0x4baf70['blocked']=![];_0x4baf70[_0x70bf('0x16')]=null;}}_0x4baf70[_0x70bf('0x3a')]=_0xe5ca2e;_0x4baf70[_0x70bf('0x3b')]=Date[_0x70bf('0x3c')]()+0x36ee80;return _0x4baf70['save']();})['then'](function(){return sendServiceMail({'to':_0x2fadb6['body'][_0x70bf('0x1f')],'subject':_0x70bf('0x3d'),'text':_0x70bf('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x70bf('0x3f')+_0x2fadb6[_0x70bf('0x40')][_0x70bf('0x41')]+_0x70bf('0x42')+_0xe5ca2e+'\x0a\x0a'+_0x70bf('0x43')});})['then'](function(){_0x2343cd[_0x70bf('0x2d')](0xc8)[_0x70bf('0x2e')]({'message':_0x70bf('0x44')});})[_0x70bf('0x1b')](function(_0x29ab8c){return handleError(_0x2343cd,0x1f4,_0x29ab8c);});};exports[_0x70bf('0x45')]=function(_0x4d48ac,_0x5581a0){return db['User'][_0x70bf('0x1d')]({'where':{'resetPasswordToken':_0x4d48ac[_0x70bf('0x46')][_0x70bf('0x47')],'resetPasswordExpires':{'$gt':Date[_0x70bf('0x3c')]()}}})[_0x70bf('0x14')](function(_0x1d2a81){if(!_0x1d2a81){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x70bf('0x8')][_0x70bf('0x9')]({'attributes':['id',_0x70bf('0x48'),'enforcePasswordHistory',_0x70bf('0x49')]})[_0x70bf('0x14')](function(_0x13a6fb){if(_0x13a6fb[_0x70bf('0x48')])authService['validatePasswordPattern'](_0x4d48ac[_0x70bf('0x35')][_0x70bf('0xc')]);if(!_0x13a6fb[_0x70bf('0x4a')]||!_0x1d2a81[_0x70bf('0x4b')])return _0x1d2a81;authService[_0x70bf('0x4c')](_0x4d48ac[_0x70bf('0x35')]['password'],_0x1d2a81[_0x70bf('0x4b')],_0x13a6fb[_0x70bf('0x49')]);return _0x1d2a81;})['then'](function(){_0x1d2a81['password']=_0x4d48ac[_0x70bf('0x35')][_0x70bf('0xc')];_0x1d2a81[_0x70bf('0x3a')]=null;_0x1d2a81[_0x70bf('0x3b')]=null;return _0x1d2a81[_0x70bf('0x4d')]();});})[_0x70bf('0x14')](function(){_0x5581a0['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0x70bf('0x1b')](function(_0x11dd3b){return handleError(_0x5581a0,0x1f4,_0x11dd3b);});};passport[_0x70bf('0x4e')](_0x70bf('0x30'),new LocalStrategy({'usernameField':_0x70bf('0x1e'),'passwordField':_0x70bf('0xc')},function(_0x58c51b,_0xba41e1,_0x11b98e){return localAuthenticate(db[_0x70bf('0x37')],_0x58c51b,_0xba41e1,_0x11b98e);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 71084b7..5251f01 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 _0x0a9c=['post','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x50b9f9,_0x36909f){var _0x5f3d43=function(_0x3bd6f4){while(--_0x3bd6f4){_0x50b9f9['push'](_0x50b9f9['shift']());}};_0x5f3d43(++_0x36909f);}(_0x0a9c,0x1be));var _0xc0a9=function(_0x431aea,_0x405d3a){_0x431aea=_0x431aea-0x0;var _0x27782b=_0x0a9c[_0x431aea];return _0x27782b;};'use strict';var express=require(_0xc0a9('0x0'));var router=express['Router']();var controller=require(_0xc0a9('0x1'));router[_0xc0a9('0x2')]('/',controller['login']);router[_0xc0a9('0x2')](_0xc0a9('0x3'),controller[_0xc0a9('0x4')]);router[_0xc0a9('0x2')](_0xc0a9('0x5'),controller[_0xc0a9('0x6')]);module[_0xc0a9('0x7')]=router; \ No newline at end of file +var _0xabba=['login','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller','post'];(function(_0x3c03d6,_0x3791d6){var _0x34eab7=function(_0x4def9e){while(--_0x4def9e){_0x3c03d6['push'](_0x3c03d6['shift']());}};_0x34eab7(++_0x3791d6);}(_0xabba,0x114));var _0xaabb=function(_0x1f7684,_0x39b023){_0x1f7684=_0x1f7684-0x0;var _0x91e0e9=_0xabba[_0x1f7684];return _0x91e0e9;};'use strict';var express=require(_0xaabb('0x0'));var router=express['Router']();var controller=require(_0xaabb('0x1'));router[_0xaabb('0x2')]('/',controller[_0xaabb('0x3')]);router[_0xaabb('0x2')](_0xaabb('0x4'),controller[_0xaabb('0x5')]);router[_0xaabb('0x2')](_0xaabb('0x6'),controller[_0xaabb('0x7')]);module[_0xaabb('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 039bf5f..7dbcc15 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 _0xd9d7=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1cf429,_0x4ec40f){var _0x621bbe=function(_0x28e2f7){while(--_0x28e2f7){_0x1cf429['push'](_0x1cf429['shift']());}};_0x621bbe(++_0x4ec40f);}(_0xd9d7,0x173));var _0x7d9d=function(_0x486efc,_0x1cca6a){_0x486efc=_0x486efc-0x0;var _0x42ae7e=_0xd9d7[_0x486efc];return _0x42ae7e;};'use strict';var Sequelize=require(_0x7d9d('0x0'));module[_0x7d9d('0x1')]={'name':{'type':Sequelize[_0x7d9d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7d9d('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7d9d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7d9d('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xf3fa=['STRING','INTEGER','sequelize','exports'];(function(_0x44714c,_0x2ac454){var _0x57d4d5=function(_0x5aca44){while(--_0x5aca44){_0x44714c['push'](_0x44714c['shift']());}};_0x57d4d5(++_0x2ac454);}(_0xf3fa,0xbe));var _0xaf3f=function(_0x22708b,_0x2bee57){_0x22708b=_0x22708b-0x0;var _0x3e0055=_0xf3fa[_0x22708b];return _0x3e0055;};'use strict';var Sequelize=require(_0xaf3f('0x0'));module[_0xaf3f('0x1')]={'name':{'type':Sequelize[_0xaf3f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xaf3f('0x2')]},'description':{'type':Sequelize[_0xaf3f('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xaf3f('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 85210d7..c1b2c7e 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 _0x7c6a=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','addConditions','ids','omit','getConditions','Condition','length','addActions','Action','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3b6cc2,_0x2bbb89){var _0x292300=function(_0x3f02bf){while(--_0x3f02bf){_0x3b6cc2['push'](_0x3b6cc2['shift']());}};_0x292300(++_0x2bbb89);}(_0x7c6a,0x1eb));var _0xa7c6=function(_0x2ea6fe,_0x549575){_0x2ea6fe=_0x2ea6fe-0x0;var _0x368a32=_0x7c6a[_0x2ea6fe];return _0x368a32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7c6('0x0'));var zipdir=require(_0xa7c6('0x1'));var jsonpatch=require(_0xa7c6('0x2'));var rp=require(_0xa7c6('0x3'));var moment=require('moment');var BPromise=require(_0xa7c6('0x4'));var Mustache=require(_0xa7c6('0x5'));var util=require(_0xa7c6('0x6'));var path=require(_0xa7c6('0x7'));var sox=require(_0xa7c6('0x8'));var csv=require(_0xa7c6('0x9'));var ejs=require(_0xa7c6('0xa'));var fs=require('fs');var fs_extra=require(_0xa7c6('0xb'));var _=require(_0xa7c6('0xc'));var squel=require(_0xa7c6('0xd'));var crypto=require(_0xa7c6('0xe'));var jsforce=require(_0xa7c6('0xf'));var deskjs=require(_0xa7c6('0x10'));var toCsv=require(_0xa7c6('0x9'));var querystring=require(_0xa7c6('0x11'));var Papa=require(_0xa7c6('0x12'));var Redis=require('ioredis');var authService=require(_0xa7c6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa7c6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa7c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa7c6('0x16'));var db=require(_0xa7c6('0x17'))['db'];function respondWithStatusCode(_0x16f7d0,_0x101ff3){_0x101ff3=_0x101ff3||0xcc;return function(_0x3379af){if(_0x3379af){return _0x16f7d0[_0xa7c6('0x18')](_0x101ff3);}return _0x16f7d0[_0xa7c6('0x19')](_0x101ff3)['end']();};}function respondWithResult(_0x25ba92,_0x477448){_0x477448=_0x477448||0xc8;return function(_0x5af902){if(_0x5af902){return _0x25ba92['status'](_0x477448)[_0xa7c6('0x1a')](_0x5af902);}};}function respondWithFilteredResult(_0x565bf9,_0x8eec6){return function(_0x2be04f){if(_0x2be04f){var _0x47d8ae=typeof _0x8eec6['offset']===_0xa7c6('0x1b')&&typeof _0x8eec6[_0xa7c6('0x1c')]==='undefined';var _0x3cd46a=_0x2be04f[_0xa7c6('0x1d')];var _0x36b97d=_0x47d8ae?0x0:_0x8eec6['offset'];var _0x3c77a8=_0x47d8ae?_0x2be04f[_0xa7c6('0x1d')]:_0x8eec6[_0xa7c6('0x1e')]+_0x8eec6[_0xa7c6('0x1c')];var _0x19fd91;if(_0x3c77a8>=_0x3cd46a){_0x3c77a8=_0x3cd46a;_0x19fd91=0xc8;}else{_0x19fd91=0xce;}_0x565bf9['status'](_0x19fd91);return _0x565bf9[_0xa7c6('0x1f')]('Content-Range',_0x36b97d+'-'+_0x3c77a8+'/'+_0x3cd46a)[_0xa7c6('0x1a')](_0x2be04f);}return null;};}function patchUpdates(_0x21f20f){return function(_0x33a359){try{jsonpatch['apply'](_0x33a359,_0x21f20f,!![]);}catch(_0xb7c7a7){return BPromise[_0xa7c6('0x20')](_0xb7c7a7);}return _0x33a359['save']();};}function saveUpdates(_0x1a2b9c,_0x5dadda){return function(_0x236c28){if(_0x236c28){return _0x236c28[_0xa7c6('0x21')](_0x1a2b9c)[_0xa7c6('0x22')](function(_0x423c1a){return _0x423c1a;});}return null;};}function removeEntity(_0x44cb77,_0x4ab6ea){return function(_0x3fee84){if(_0x3fee84){return _0x3fee84[_0xa7c6('0x23')]()[_0xa7c6('0x22')](function(){_0x44cb77[_0xa7c6('0x19')](0xcc)[_0xa7c6('0x24')]();});}};}function handleEntityNotFound(_0x2909a0,_0x32bd68){return function(_0x327dbd){if(!_0x327dbd){_0x2909a0[_0xa7c6('0x18')](0x194);}return _0x327dbd;};}function handleError(_0x5ebcab,_0x31335d){_0x31335d=_0x31335d||0x1f4;return function(_0x4a8abb){logger[_0xa7c6('0x25')](_0x4a8abb[_0xa7c6('0x26')]);if(_0x4a8abb[_0xa7c6('0x27')]){delete _0x4a8abb['name'];}_0x5ebcab['status'](_0x31335d)[_0xa7c6('0x28')](_0x4a8abb);};}exports[_0xa7c6('0x29')]=function(_0x143068,_0xacd8ff){var _0x3ee0e8={},_0x38c092={},_0x121365={'count':0x0,'rows':[]};var _0xba3c3f=_[_0xa7c6('0x2a')](db[_0xa7c6('0x2b')]['rawAttributes'],function(_0x13e01f){return{'name':_0x13e01f[_0xa7c6('0x2c')],'type':_0x13e01f[_0xa7c6('0x2d')][_0xa7c6('0x2e')]};});_0x38c092[_0xa7c6('0x2f')]=_[_0xa7c6('0x2a')](_0xba3c3f,'name');_0x38c092[_0xa7c6('0x30')]=_[_0xa7c6('0x31')](_0x143068[_0xa7c6('0x30')]);_0x38c092[_0xa7c6('0x32')]=_['intersection'](_0x38c092[_0xa7c6('0x2f')],_0x38c092[_0xa7c6('0x30')]);_0x3ee0e8[_0xa7c6('0x33')]=_[_0xa7c6('0x34')](_0x38c092['model'],qs[_0xa7c6('0x35')](_0x143068['query'][_0xa7c6('0x35')]));_0x3ee0e8['attributes']=_0x3ee0e8[_0xa7c6('0x33')]['length']?_0x3ee0e8[_0xa7c6('0x33')]:_0x38c092[_0xa7c6('0x2f')];if(!_0x143068[_0xa7c6('0x30')][_0xa7c6('0x36')](_0xa7c6('0x37'))){_0x3ee0e8[_0xa7c6('0x1c')]=qs[_0xa7c6('0x1c')](_0x143068[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0x3ee0e8[_0xa7c6('0x1e')]=qs['offset'](_0x143068[_0xa7c6('0x30')][_0xa7c6('0x1e')]);}_0x3ee0e8[_0xa7c6('0x38')]=qs[_0xa7c6('0x39')](_0x143068['query'][_0xa7c6('0x39')]);_0x3ee0e8[_0xa7c6('0x3a')]=qs['filters'](_[_0xa7c6('0x3b')](_0x143068[_0xa7c6('0x30')],_0x38c092['filters']),_0xba3c3f);if(_0x143068[_0xa7c6('0x30')][_0xa7c6('0x3c')]){_0x3ee0e8[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0x3ee0e8[_0xa7c6('0x3a')],{'$or':_['map'](_0xba3c3f,function(_0x3a808c){if(_0x3a808c[_0xa7c6('0x2d')]!==_0xa7c6('0x3e')){var _0xcefaab={};_0xcefaab[_0x3a808c[_0xa7c6('0x27')]]={'$like':'%'+_0x143068[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0xcefaab;}})});}_0x3ee0e8=_[_0xa7c6('0x3d')]({},_0x3ee0e8,_0x143068[_0xa7c6('0x3f')]);var _0x4c7375={'where':_0x3ee0e8['where']};return db[_0xa7c6('0x2b')][_0xa7c6('0x1d')](_0x4c7375)[_0xa7c6('0x22')](function(_0x3c834b){_0x121365[_0xa7c6('0x1d')]=_0x3c834b;if(_0x143068[_0xa7c6('0x30')][_0xa7c6('0x40')]){_0x3ee0e8[_0xa7c6('0x41')]=[{'all':!![]}];}return db['Automation'][_0xa7c6('0x42')](_0x3ee0e8);})[_0xa7c6('0x22')](function(_0x540d68){_0x121365['rows']=_0x540d68;return _0x121365;})[_0xa7c6('0x22')](respondWithFilteredResult(_0xacd8ff,_0x3ee0e8))[_0xa7c6('0x43')](handleError(_0xacd8ff,null));};exports[_0xa7c6('0x44')]=function(_0x5c6619,_0x286c15){var _0x460610={'raw':![],'where':{'id':_0x5c6619[_0xa7c6('0x45')]['id']}},_0x2f2cc={};_0x2f2cc[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x2b')][_0xa7c6('0x46')]);_0x2f2cc['query']=_[_0xa7c6('0x31')](_0x5c6619['query']);_0x2f2cc['filters']=_[_0xa7c6('0x34')](_0x2f2cc['model'],_0x2f2cc[_0xa7c6('0x30')]);_0x460610[_0xa7c6('0x33')]=_[_0xa7c6('0x34')](_0x2f2cc['model'],qs[_0xa7c6('0x35')](_0x5c6619['query'][_0xa7c6('0x35')]));_0x460610[_0xa7c6('0x33')]=_0x460610[_0xa7c6('0x33')]['length']?_0x460610[_0xa7c6('0x33')]:_0x2f2cc[_0xa7c6('0x2f')];if(_0x5c6619[_0xa7c6('0x30')][_0xa7c6('0x40')]){_0x460610[_0xa7c6('0x41')]=[{'all':!![]}];}_0x460610=_['merge']({},_0x460610,_0x5c6619[_0xa7c6('0x3f')]);return db[_0xa7c6('0x2b')]['find'](_0x460610)[_0xa7c6('0x22')](handleEntityNotFound(_0x286c15,null))[_0xa7c6('0x22')](respondWithResult(_0x286c15,null))[_0xa7c6('0x43')](handleError(_0x286c15,null));};exports[_0xa7c6('0x47')]=function(_0x4066ad,_0x357e12){return db[_0xa7c6('0x2b')][_0xa7c6('0x47')](_0x4066ad['body'],{})[_0xa7c6('0x22')](respondWithResult(_0x357e12,0xc9))['catch'](handleError(_0x357e12,null));};exports[_0xa7c6('0x21')]=function(_0x44b984,_0x273b44){if(_0x44b984[_0xa7c6('0x48')]['id']){delete _0x44b984[_0xa7c6('0x48')]['id'];}return db[_0xa7c6('0x2b')][_0xa7c6('0x49')]({'where':{'id':_0x44b984[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x273b44,null))[_0xa7c6('0x22')](saveUpdates(_0x44b984['body'],null))['then'](respondWithResult(_0x273b44,null))[_0xa7c6('0x43')](handleError(_0x273b44,null));};exports[_0xa7c6('0x23')]=function(_0x406471,_0x24908a){return db[_0xa7c6('0x2b')][_0xa7c6('0x49')]({'where':{'id':_0x406471[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x24908a,null))['then'](removeEntity(_0x24908a,null))[_0xa7c6('0x43')](handleError(_0x24908a,null));};exports[_0xa7c6('0x4a')]=function(_0x299f33,_0x488fd9,_0x5967d8){return db['Condition'][_0xa7c6('0x49')]({'where':{'id':_0x299f33[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x488fd9,null))['then'](function(_0x162937){if(_0x162937){return _0x162937['addConditions'](_0x299f33[_0xa7c6('0x48')][_0xa7c6('0x4b')],_[_0xa7c6('0x4c')](_0x299f33[_0xa7c6('0x48')],['ids','id'])||{});}})[_0xa7c6('0x22')](respondWithResult(_0x488fd9,null))[_0xa7c6('0x43')](handleError(_0x488fd9,null));};exports[_0xa7c6('0x4d')]=function(_0x58e949,_0x354309,_0x25835d){var _0x3983c5={};var _0x262d7b={};var _0x5267d1;var _0x381406;return db['Automation']['findOne']({'where':{'id':_0x58e949[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x354309,null))[_0xa7c6('0x22')](function(_0x3dcade){if(_0x3dcade){_0x5267d1=_0x3dcade;_0x262d7b[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x4e')][_0xa7c6('0x46')]);_0x262d7b['query']=_[_0xa7c6('0x31')](_0x58e949[_0xa7c6('0x30')]);_0x262d7b[_0xa7c6('0x32')]=_['intersection'](_0x262d7b[_0xa7c6('0x2f')],_0x262d7b[_0xa7c6('0x30')]);_0x3983c5[_0xa7c6('0x33')]=_['intersection'](_0x262d7b[_0xa7c6('0x2f')],qs[_0xa7c6('0x35')](_0x58e949['query'][_0xa7c6('0x35')]));_0x3983c5[_0xa7c6('0x33')]=_0x3983c5[_0xa7c6('0x33')][_0xa7c6('0x4f')]?_0x3983c5[_0xa7c6('0x33')]:_0x262d7b['model'];_0x3983c5['order']=qs['sort'](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x39')]);_0x3983c5[_0xa7c6('0x3a')]=qs[_0xa7c6('0x32')](_[_0xa7c6('0x3b')](_0x58e949[_0xa7c6('0x30')],_0x262d7b[_0xa7c6('0x32')]));if(_0x58e949['query'][_0xa7c6('0x3c')]){_0x3983c5[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0x3983c5[_0xa7c6('0x3a')],{'$or':_[_0xa7c6('0x2a')](_0x3983c5['attributes'],function(_0x14dfbf){var _0x557ed2={};_0x557ed2[_0x14dfbf]={'$like':'%'+_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0x557ed2;})});}_0x3983c5=_['merge']({},_0x3983c5,_0x58e949[_0xa7c6('0x3f')]);return _0x5267d1['getConditions'](_0x3983c5);}})[_0xa7c6('0x22')](function(_0x3b70ff){if(_0x3b70ff){_0x381406=_0x3b70ff[_0xa7c6('0x4f')];if(!_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x36')](_0xa7c6('0x37'))){_0x3983c5[_0xa7c6('0x1c')]=qs[_0xa7c6('0x1c')](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0x3983c5[_0xa7c6('0x1e')]=qs[_0xa7c6('0x1e')](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x1e')]);}return _0x5267d1[_0xa7c6('0x4d')](_0x3983c5);}})['then'](function(_0x3a251f){if(_0x3a251f){return _0x3a251f?{'count':_0x381406,'rows':_0x3a251f}:null;}})[_0xa7c6('0x22')](respondWithResult(_0x354309,null))[_0xa7c6('0x43')](handleError(_0x354309,null));};exports[_0xa7c6('0x50')]=function(_0x5e5380,_0x1d111c,_0x4bee17){return db[_0xa7c6('0x51')]['find']({'where':{'id':_0x5e5380[_0xa7c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d111c,null))[_0xa7c6('0x22')](function(_0x4fb82a){if(_0x4fb82a){return _0x4fb82a[_0xa7c6('0x50')](_0x5e5380[_0xa7c6('0x48')][_0xa7c6('0x4b')],_[_0xa7c6('0x4c')](_0x5e5380[_0xa7c6('0x48')],[_0xa7c6('0x4b'),'id'])||{});}})[_0xa7c6('0x22')](respondWithResult(_0x1d111c,null))[_0xa7c6('0x43')](handleError(_0x1d111c,null));};exports[_0xa7c6('0x52')]=function(_0x157a1f,_0x2d6aaf,_0x1fb5aa){var _0xc4c53a={};var _0x530137={};var _0x198822;var _0x3ba8dd;return db[_0xa7c6('0x2b')][_0xa7c6('0x53')]({'where':{'id':_0x157a1f[_0xa7c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d6aaf,null))[_0xa7c6('0x22')](function(_0x19fe84){if(_0x19fe84){_0x198822=_0x19fe84;_0x530137[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x51')][_0xa7c6('0x46')]);_0x530137[_0xa7c6('0x30')]=_['keys'](_0x157a1f[_0xa7c6('0x30')]);_0x530137[_0xa7c6('0x32')]=_[_0xa7c6('0x34')](_0x530137[_0xa7c6('0x2f')],_0x530137['query']);_0xc4c53a[_0xa7c6('0x33')]=_['intersection'](_0x530137[_0xa7c6('0x2f')],qs['fields'](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x35')]));_0xc4c53a[_0xa7c6('0x33')]=_0xc4c53a[_0xa7c6('0x33')][_0xa7c6('0x4f')]?_0xc4c53a[_0xa7c6('0x33')]:_0x530137[_0xa7c6('0x2f')];_0xc4c53a['order']=qs[_0xa7c6('0x39')](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x39')]);_0xc4c53a['where']=qs[_0xa7c6('0x32')](_[_0xa7c6('0x3b')](_0x157a1f[_0xa7c6('0x30')],_0x530137[_0xa7c6('0x32')]));if(_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x3c')]){_0xc4c53a[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0xc4c53a[_0xa7c6('0x3a')],{'$or':_[_0xa7c6('0x2a')](_0xc4c53a['attributes'],function(_0x44ba21){var _0xfd7f33={};_0xfd7f33[_0x44ba21]={'$like':'%'+_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0xfd7f33;})});}_0xc4c53a=_[_0xa7c6('0x3d')]({},_0xc4c53a,_0x157a1f[_0xa7c6('0x3f')]);return _0x198822[_0xa7c6('0x52')](_0xc4c53a);}})['then'](function(_0xd762a8){if(_0xd762a8){_0x3ba8dd=_0xd762a8[_0xa7c6('0x4f')];if(!_0x157a1f[_0xa7c6('0x30')]['hasOwnProperty']('nolimit')){_0xc4c53a['limit']=qs['limit'](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0xc4c53a[_0xa7c6('0x1e')]=qs[_0xa7c6('0x1e')](_0x157a1f['query']['offset']);}return _0x198822[_0xa7c6('0x52')](_0xc4c53a);}})[_0xa7c6('0x22')](function(_0x519b1f){if(_0x519b1f){return _0x519b1f?{'count':_0x3ba8dd,'rows':_0x519b1f}:null;}})[_0xa7c6('0x22')](respondWithResult(_0x2d6aaf,null))[_0xa7c6('0x43')](handleError(_0x2d6aaf,null));}; \ No newline at end of file +var _0x3dcf=['options','Automation','includeAll','include','findAll','show','rawAttributes','find','catch','create','body','params','addConditions','ids','getConditions','findOne','addActions','Action','omit','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x360b3b,_0x5fc470){var _0x44b6db=function(_0x7d4e6a){while(--_0x7d4e6a){_0x360b3b['push'](_0x360b3b['shift']());}};_0x44b6db(++_0x5fc470);}(_0x3dcf,0x113));var _0xf3dc=function(_0x1a3968,_0x11185d){_0x1a3968=_0x1a3968-0x0;var _0x4b1589=_0x3dcf[_0x1a3968];return _0x4b1589;};'use strict';var emlformat=require(_0xf3dc('0x0'));var rimraf=require(_0xf3dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3dc('0x2'));var rp=require(_0xf3dc('0x3'));var moment=require(_0xf3dc('0x4'));var BPromise=require(_0xf3dc('0x5'));var Mustache=require(_0xf3dc('0x6'));var util=require(_0xf3dc('0x7'));var path=require('path');var sox=require(_0xf3dc('0x8'));var csv=require(_0xf3dc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3dc('0xa'));var _=require(_0xf3dc('0xb'));var squel=require(_0xf3dc('0xc'));var crypto=require(_0xf3dc('0xd'));var jsforce=require(_0xf3dc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf3dc('0x9'));var querystring=require(_0xf3dc('0xf'));var Papa=require(_0xf3dc('0x10'));var Redis=require(_0xf3dc('0x11'));var authService=require(_0xf3dc('0x12'));var qs=require(_0xf3dc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3dc('0x14'));var logger=require(_0xf3dc('0x15'))(_0xf3dc('0x16'));var utils=require(_0xf3dc('0x17'));var config=require(_0xf3dc('0x18'));var licenseUtil=require(_0xf3dc('0x19'));var db=require(_0xf3dc('0x1a'))['db'];function respondWithStatusCode(_0x408e1e,_0xf457a6){_0xf457a6=_0xf457a6||0xcc;return function(_0x102480){if(_0x102480){return _0x408e1e['sendStatus'](_0xf457a6);}return _0x408e1e[_0xf3dc('0x1b')](_0xf457a6)[_0xf3dc('0x1c')]();};}function respondWithResult(_0x37e103,_0x2f04a6){_0x2f04a6=_0x2f04a6||0xc8;return function(_0x45fea5){if(_0x45fea5){return _0x37e103[_0xf3dc('0x1b')](_0x2f04a6)[_0xf3dc('0x1d')](_0x45fea5);}};}function respondWithFilteredResult(_0x129275,_0x48486b){return function(_0x1a3023){if(_0x1a3023){var _0x13636d=typeof _0x48486b[_0xf3dc('0x1e')]===_0xf3dc('0x1f')&&typeof _0x48486b[_0xf3dc('0x20')]===_0xf3dc('0x1f');var _0x4e6778=_0x1a3023['count'];var _0xc1e42c=_0x13636d?0x0:_0x48486b[_0xf3dc('0x1e')];var _0x2b9ae1=_0x13636d?_0x1a3023[_0xf3dc('0x21')]:_0x48486b[_0xf3dc('0x1e')]+_0x48486b[_0xf3dc('0x20')];var _0x273fa3;if(_0x2b9ae1>=_0x4e6778){_0x2b9ae1=_0x4e6778;_0x273fa3=0xc8;}else{_0x273fa3=0xce;}_0x129275[_0xf3dc('0x1b')](_0x273fa3);return _0x129275['set'](_0xf3dc('0x22'),_0xc1e42c+'-'+_0x2b9ae1+'/'+_0x4e6778)[_0xf3dc('0x1d')](_0x1a3023);}return null;};}function patchUpdates(_0x497bb2){return function(_0x4c0143){try{jsonpatch[_0xf3dc('0x23')](_0x4c0143,_0x497bb2,!![]);}catch(_0x1e13cb){return BPromise[_0xf3dc('0x24')](_0x1e13cb);}return _0x4c0143[_0xf3dc('0x25')]();};}function saveUpdates(_0x274823,_0x5b7f14){return function(_0xc612a8){if(_0xc612a8){return _0xc612a8[_0xf3dc('0x26')](_0x274823)[_0xf3dc('0x27')](function(_0x9505ca){return _0x9505ca;});}return null;};}function removeEntity(_0x284514,_0x269baa){return function(_0x408ae6){if(_0x408ae6){return _0x408ae6[_0xf3dc('0x28')]()[_0xf3dc('0x27')](function(){_0x284514[_0xf3dc('0x1b')](0xcc)[_0xf3dc('0x1c')]();});}};}function handleEntityNotFound(_0x4e8ece,_0x1e9940){return function(_0x24a434){if(!_0x24a434){_0x4e8ece[_0xf3dc('0x29')](0x194);}return _0x24a434;};}function handleError(_0x4badd5,_0x5626b6){_0x5626b6=_0x5626b6||0x1f4;return function(_0x2c8a79){logger[_0xf3dc('0x2a')](_0x2c8a79[_0xf3dc('0x2b')]);if(_0x2c8a79[_0xf3dc('0x2c')]){delete _0x2c8a79[_0xf3dc('0x2c')];}_0x4badd5[_0xf3dc('0x1b')](_0x5626b6)[_0xf3dc('0x2d')](_0x2c8a79);};}exports['index']=function(_0x512e17,_0x33ca59){var _0x692d82={},_0x1e5d65={},_0x1b8e66={'count':0x0,'rows':[]};var _0x37875d=_[_0xf3dc('0x2e')](db['Automation']['rawAttributes'],function(_0x43f3df){return{'name':_0x43f3df[_0xf3dc('0x2f')],'type':_0x43f3df[_0xf3dc('0x30')]['key']};});_0x1e5d65[_0xf3dc('0x31')]=_['map'](_0x37875d,_0xf3dc('0x2c'));_0x1e5d65['query']=_[_0xf3dc('0x32')](_0x512e17['query']);_0x1e5d65[_0xf3dc('0x33')]=_[_0xf3dc('0x34')](_0x1e5d65['model'],_0x1e5d65['query']);_0x692d82[_0xf3dc('0x35')]=_[_0xf3dc('0x34')](_0x1e5d65[_0xf3dc('0x31')],qs[_0xf3dc('0x36')](_0x512e17[_0xf3dc('0x37')][_0xf3dc('0x36')]));_0x692d82[_0xf3dc('0x35')]=_0x692d82['attributes'][_0xf3dc('0x38')]?_0x692d82[_0xf3dc('0x35')]:_0x1e5d65[_0xf3dc('0x31')];if(!_0x512e17[_0xf3dc('0x37')][_0xf3dc('0x39')](_0xf3dc('0x3a'))){_0x692d82[_0xf3dc('0x20')]=qs[_0xf3dc('0x20')](_0x512e17[_0xf3dc('0x37')][_0xf3dc('0x20')]);_0x692d82['offset']=qs[_0xf3dc('0x1e')](_0x512e17[_0xf3dc('0x37')][_0xf3dc('0x1e')]);}_0x692d82[_0xf3dc('0x3b')]=qs[_0xf3dc('0x3c')](_0x512e17['query'][_0xf3dc('0x3c')]);_0x692d82[_0xf3dc('0x3d')]=qs[_0xf3dc('0x33')](_[_0xf3dc('0x3e')](_0x512e17[_0xf3dc('0x37')],_0x1e5d65[_0xf3dc('0x33')]),_0x37875d);if(_0x512e17[_0xf3dc('0x37')][_0xf3dc('0x3f')]){_0x692d82[_0xf3dc('0x3d')]=_[_0xf3dc('0x40')](_0x692d82[_0xf3dc('0x3d')],{'$or':_[_0xf3dc('0x2e')](_0x37875d,function(_0x182871){if(_0x182871[_0xf3dc('0x30')]!=='VIRTUAL'){var _0x41a853={};_0x41a853[_0x182871[_0xf3dc('0x2c')]]={'$like':'%'+_0x512e17[_0xf3dc('0x37')][_0xf3dc('0x3f')]+'%'};return _0x41a853;}})});}_0x692d82=_['merge']({},_0x692d82,_0x512e17[_0xf3dc('0x41')]);var _0x56bc02={'where':_0x692d82['where']};return db[_0xf3dc('0x42')][_0xf3dc('0x21')](_0x56bc02)['then'](function(_0x4608e4){_0x1b8e66[_0xf3dc('0x21')]=_0x4608e4;if(_0x512e17[_0xf3dc('0x37')][_0xf3dc('0x43')]){_0x692d82[_0xf3dc('0x44')]=[{'all':!![]}];}return db[_0xf3dc('0x42')][_0xf3dc('0x45')](_0x692d82);})[_0xf3dc('0x27')](function(_0x44ac9b){_0x1b8e66['rows']=_0x44ac9b;return _0x1b8e66;})[_0xf3dc('0x27')](respondWithFilteredResult(_0x33ca59,_0x692d82))['catch'](handleError(_0x33ca59,null));};exports[_0xf3dc('0x46')]=function(_0x314c79,_0x2d8937){var _0x434c39={'raw':![],'where':{'id':_0x314c79['params']['id']}},_0xb636f1={};_0xb636f1['model']=_['keys'](db[_0xf3dc('0x42')][_0xf3dc('0x47')]);_0xb636f1[_0xf3dc('0x37')]=_[_0xf3dc('0x32')](_0x314c79[_0xf3dc('0x37')]);_0xb636f1[_0xf3dc('0x33')]=_['intersection'](_0xb636f1[_0xf3dc('0x31')],_0xb636f1[_0xf3dc('0x37')]);_0x434c39[_0xf3dc('0x35')]=_[_0xf3dc('0x34')](_0xb636f1['model'],qs['fields'](_0x314c79[_0xf3dc('0x37')]['fields']));_0x434c39['attributes']=_0x434c39['attributes'][_0xf3dc('0x38')]?_0x434c39[_0xf3dc('0x35')]:_0xb636f1['model'];if(_0x314c79[_0xf3dc('0x37')][_0xf3dc('0x43')]){_0x434c39[_0xf3dc('0x44')]=[{'all':!![]}];}_0x434c39=_[_0xf3dc('0x40')]({},_0x434c39,_0x314c79[_0xf3dc('0x41')]);return db[_0xf3dc('0x42')][_0xf3dc('0x48')](_0x434c39)['then'](handleEntityNotFound(_0x2d8937,null))[_0xf3dc('0x27')](respondWithResult(_0x2d8937,null))[_0xf3dc('0x49')](handleError(_0x2d8937,null));};exports[_0xf3dc('0x4a')]=function(_0x37e920,_0x2b805a){return db[_0xf3dc('0x42')][_0xf3dc('0x4a')](_0x37e920[_0xf3dc('0x4b')],{})[_0xf3dc('0x27')](respondWithResult(_0x2b805a,0xc9))['catch'](handleError(_0x2b805a,null));};exports[_0xf3dc('0x26')]=function(_0x390837,_0x3317cc){if(_0x390837[_0xf3dc('0x4b')]['id']){delete _0x390837[_0xf3dc('0x4b')]['id'];}return db[_0xf3dc('0x42')][_0xf3dc('0x48')]({'where':{'id':_0x390837[_0xf3dc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3317cc,null))[_0xf3dc('0x27')](saveUpdates(_0x390837[_0xf3dc('0x4b')],null))[_0xf3dc('0x27')](respondWithResult(_0x3317cc,null))[_0xf3dc('0x49')](handleError(_0x3317cc,null));};exports[_0xf3dc('0x28')]=function(_0x191a34,_0x1e3bc0){return db[_0xf3dc('0x42')][_0xf3dc('0x48')]({'where':{'id':_0x191a34[_0xf3dc('0x4c')]['id']}})[_0xf3dc('0x27')](handleEntityNotFound(_0x1e3bc0,null))[_0xf3dc('0x27')](removeEntity(_0x1e3bc0,null))[_0xf3dc('0x49')](handleError(_0x1e3bc0,null));};exports['addConditions']=function(_0x5a5e6d,_0x1a2741,_0x1a59b0){return db['Condition'][_0xf3dc('0x48')]({'where':{'id':_0x5a5e6d[_0xf3dc('0x4c')]['id']}})[_0xf3dc('0x27')](handleEntityNotFound(_0x1a2741,null))[_0xf3dc('0x27')](function(_0x43ac2f){if(_0x43ac2f){return _0x43ac2f[_0xf3dc('0x4d')](_0x5a5e6d[_0xf3dc('0x4b')][_0xf3dc('0x4e')],_['omit'](_0x5a5e6d[_0xf3dc('0x4b')],[_0xf3dc('0x4e'),'id'])||{});}})[_0xf3dc('0x27')](respondWithResult(_0x1a2741,null))[_0xf3dc('0x49')](handleError(_0x1a2741,null));};exports[_0xf3dc('0x4f')]=function(_0x324dc8,_0xe778aa,_0x4ac4e5){var _0x27bcb2={};var _0x4bcd82={};var _0x455498;var _0x47949f;return db[_0xf3dc('0x42')][_0xf3dc('0x50')]({'where':{'id':_0x324dc8[_0xf3dc('0x4c')]['id']}})[_0xf3dc('0x27')](handleEntityNotFound(_0xe778aa,null))[_0xf3dc('0x27')](function(_0x29acf3){if(_0x29acf3){_0x455498=_0x29acf3;_0x4bcd82['model']=_[_0xf3dc('0x32')](db['Condition'][_0xf3dc('0x47')]);_0x4bcd82[_0xf3dc('0x37')]=_[_0xf3dc('0x32')](_0x324dc8[_0xf3dc('0x37')]);_0x4bcd82[_0xf3dc('0x33')]=_['intersection'](_0x4bcd82[_0xf3dc('0x31')],_0x4bcd82[_0xf3dc('0x37')]);_0x27bcb2[_0xf3dc('0x35')]=_[_0xf3dc('0x34')](_0x4bcd82[_0xf3dc('0x31')],qs[_0xf3dc('0x36')](_0x324dc8[_0xf3dc('0x37')][_0xf3dc('0x36')]));_0x27bcb2[_0xf3dc('0x35')]=_0x27bcb2[_0xf3dc('0x35')][_0xf3dc('0x38')]?_0x27bcb2[_0xf3dc('0x35')]:_0x4bcd82['model'];_0x27bcb2['order']=qs['sort'](_0x324dc8[_0xf3dc('0x37')][_0xf3dc('0x3c')]);_0x27bcb2[_0xf3dc('0x3d')]=qs[_0xf3dc('0x33')](_[_0xf3dc('0x3e')](_0x324dc8[_0xf3dc('0x37')],_0x4bcd82[_0xf3dc('0x33')]));if(_0x324dc8[_0xf3dc('0x37')][_0xf3dc('0x3f')]){_0x27bcb2[_0xf3dc('0x3d')]=_[_0xf3dc('0x40')](_0x27bcb2[_0xf3dc('0x3d')],{'$or':_[_0xf3dc('0x2e')](_0x27bcb2['attributes'],function(_0x3e5a40){var _0x1185f7={};_0x1185f7[_0x3e5a40]={'$like':'%'+_0x324dc8[_0xf3dc('0x37')]['filter']+'%'};return _0x1185f7;})});}_0x27bcb2=_[_0xf3dc('0x40')]({},_0x27bcb2,_0x324dc8[_0xf3dc('0x41')]);return _0x455498[_0xf3dc('0x4f')](_0x27bcb2);}})[_0xf3dc('0x27')](function(_0x46eb27){if(_0x46eb27){_0x47949f=_0x46eb27[_0xf3dc('0x38')];if(!_0x324dc8[_0xf3dc('0x37')]['hasOwnProperty'](_0xf3dc('0x3a'))){_0x27bcb2[_0xf3dc('0x20')]=qs[_0xf3dc('0x20')](_0x324dc8[_0xf3dc('0x37')]['limit']);_0x27bcb2[_0xf3dc('0x1e')]=qs[_0xf3dc('0x1e')](_0x324dc8[_0xf3dc('0x37')]['offset']);}return _0x455498[_0xf3dc('0x4f')](_0x27bcb2);}})[_0xf3dc('0x27')](function(_0xfae92e){if(_0xfae92e){return _0xfae92e?{'count':_0x47949f,'rows':_0xfae92e}:null;}})['then'](respondWithResult(_0xe778aa,null))[_0xf3dc('0x49')](handleError(_0xe778aa,null));};exports[_0xf3dc('0x51')]=function(_0x1f9cc0,_0x249e46,_0x111a33){return db[_0xf3dc('0x52')][_0xf3dc('0x48')]({'where':{'id':_0x1f9cc0['params']['id']}})['then'](handleEntityNotFound(_0x249e46,null))[_0xf3dc('0x27')](function(_0x419ea3){if(_0x419ea3){return _0x419ea3[_0xf3dc('0x51')](_0x1f9cc0[_0xf3dc('0x4b')][_0xf3dc('0x4e')],_[_0xf3dc('0x53')](_0x1f9cc0['body'],['ids','id'])||{});}})[_0xf3dc('0x27')](respondWithResult(_0x249e46,null))[_0xf3dc('0x49')](handleError(_0x249e46,null));};exports[_0xf3dc('0x54')]=function(_0x52d0e3,_0x7a3765,_0x4be932){var _0x9fddea={};var _0x33db04={};var _0x5ba2b9;var _0x273764;return db[_0xf3dc('0x42')]['findOne']({'where':{'id':_0x52d0e3['params']['id']}})[_0xf3dc('0x27')](handleEntityNotFound(_0x7a3765,null))[_0xf3dc('0x27')](function(_0x8c6752){if(_0x8c6752){_0x5ba2b9=_0x8c6752;_0x33db04[_0xf3dc('0x31')]=_[_0xf3dc('0x32')](db[_0xf3dc('0x52')][_0xf3dc('0x47')]);_0x33db04[_0xf3dc('0x37')]=_[_0xf3dc('0x32')](_0x52d0e3[_0xf3dc('0x37')]);_0x33db04[_0xf3dc('0x33')]=_[_0xf3dc('0x34')](_0x33db04[_0xf3dc('0x31')],_0x33db04[_0xf3dc('0x37')]);_0x9fddea['attributes']=_[_0xf3dc('0x34')](_0x33db04['model'],qs[_0xf3dc('0x36')](_0x52d0e3[_0xf3dc('0x37')][_0xf3dc('0x36')]));_0x9fddea[_0xf3dc('0x35')]=_0x9fddea[_0xf3dc('0x35')][_0xf3dc('0x38')]?_0x9fddea[_0xf3dc('0x35')]:_0x33db04['model'];_0x9fddea[_0xf3dc('0x3b')]=qs['sort'](_0x52d0e3[_0xf3dc('0x37')][_0xf3dc('0x3c')]);_0x9fddea[_0xf3dc('0x3d')]=qs[_0xf3dc('0x33')](_[_0xf3dc('0x3e')](_0x52d0e3[_0xf3dc('0x37')],_0x33db04[_0xf3dc('0x33')]));if(_0x52d0e3[_0xf3dc('0x37')][_0xf3dc('0x3f')]){_0x9fddea[_0xf3dc('0x3d')]=_[_0xf3dc('0x40')](_0x9fddea['where'],{'$or':_[_0xf3dc('0x2e')](_0x9fddea[_0xf3dc('0x35')],function(_0x45310e){var _0x330928={};_0x330928[_0x45310e]={'$like':'%'+_0x52d0e3[_0xf3dc('0x37')][_0xf3dc('0x3f')]+'%'};return _0x330928;})});}_0x9fddea=_[_0xf3dc('0x40')]({},_0x9fddea,_0x52d0e3[_0xf3dc('0x41')]);return _0x5ba2b9[_0xf3dc('0x54')](_0x9fddea);}})[_0xf3dc('0x27')](function(_0x406cd2){if(_0x406cd2){_0x273764=_0x406cd2['length'];if(!_0x52d0e3[_0xf3dc('0x37')]['hasOwnProperty'](_0xf3dc('0x3a'))){_0x9fddea['limit']=qs['limit'](_0x52d0e3[_0xf3dc('0x37')][_0xf3dc('0x20')]);_0x9fddea[_0xf3dc('0x1e')]=qs['offset'](_0x52d0e3['query'][_0xf3dc('0x1e')]);}return _0x5ba2b9[_0xf3dc('0x54')](_0x9fddea);}})['then'](function(_0x548ee2){if(_0x548ee2){return _0x548ee2?{'count':_0x273764,'rows':_0x548ee2}:null;}})[_0xf3dc('0x27')](respondWithResult(_0x7a3765,null))[_0xf3dc('0x49')](handleError(_0x7a3765,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a16de99..e33f1c5 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 _0x8f85=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_automations','util'];(function(_0x2700cd,_0x499355){var _0x351be3=function(_0x34eba9){while(--_0x34eba9){_0x2700cd['push'](_0x2700cd['shift']());}};_0x351be3(++_0x499355);}(_0x8f85,0x1cb));var _0x58f8=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x8f85[_0x2235bf];return _0x4c3a64;};'use strict';var _=require('lodash');var util=require(_0x58f8('0x0'));var logger=require(_0x58f8('0x1'))('api');var moment=require(_0x58f8('0x2'));var BPromise=require(_0x58f8('0x3'));var rp=require(_0x58f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58f8('0x5'));var config=require(_0x58f8('0x6'));var attributes=require('./automation.attributes');module[_0x58f8('0x7')]=function(_0x1700ae,_0x299f67){return _0x1700ae[_0x58f8('0x8')]('Automation',attributes,{'tableName':_0x58f8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3466=['exports','define','Automation','lodash','util','../../config/logger','api','bluebird','request-promise','path','./automation.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3466,0x1c6));var _0x6346=function(_0x595cc4,_0x4f535d){_0x595cc4=_0x595cc4-0x0;var _0xe13592=_0x3466[_0x595cc4];return _0xe13592;};'use strict';var _=require(_0x6346('0x0'));var util=require(_0x6346('0x1'));var logger=require(_0x6346('0x2'))(_0x6346('0x3'));var moment=require('moment');var BPromise=require(_0x6346('0x4'));var rp=require(_0x6346('0x5'));var fs=require('fs');var path=require(_0x6346('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6346('0x7'));module[_0x6346('0x8')]=function(_0x3be8d6,_0x21251f){return _0x3be8d6[_0x6346('0x9')](_0x6346('0xa'),attributes,{'tableName':'tools_automations','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 043230e..e606523 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 _0x8d62=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x463303,_0x1c9593){var _0x412845=function(_0x150cb7){while(--_0x150cb7){_0x463303['push'](_0x463303['shift']());}};_0x412845(++_0x1c9593);}(_0x8d62,0xf8));var _0x28d6=function(_0xd41060,_0x119def){_0xd41060=_0xd41060-0x0;var _0xe8029f=_0x8d62[_0xd41060];return _0xe8029f;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var moment=require(_0x28d6('0x1'));var BPromise=require(_0x28d6('0x2'));var rs=require(_0x28d6('0x3'));var fs=require('fs');var Redis=require(_0x28d6('0x4'));var db=require(_0x28d6('0x5'))['db'];var utils=require(_0x28d6('0x6'));var logger=require(_0x28d6('0x7'))(_0x28d6('0x8'));var config=require(_0x28d6('0x9'));var jayson=require(_0x28d6('0xa'));var client=jayson[_0x28d6('0xb')][_0x28d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe8aa7b,_0x5c8a27,_0x1d5399){return new BPromise(function(_0xb9dccb,_0x3f3235){return client['request'](_0xe8aa7b,_0x1d5399)[_0x28d6('0xd')](function(_0x4b564f){logger[_0x28d6('0xe')](_0x28d6('0xf'),_0x5c8a27,_0x28d6('0x10'));logger[_0x28d6('0x11')](_0x28d6('0x12'),_0x5c8a27,'request\x20sent',JSON[_0x28d6('0x13')](_0x4b564f));if(_0x4b564f[_0x28d6('0x14')]){if(_0x4b564f[_0x28d6('0x14')][_0x28d6('0x15')]===0x1f4){logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f[_0x28d6('0x14')][_0x28d6('0x16')]);return _0x3f3235(_0x4b564f['error'][_0x28d6('0x16')]);}logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f['error'][_0x28d6('0x16')]);return _0xb9dccb(_0x4b564f['error'][_0x28d6('0x16')]);}else{logger[_0x28d6('0xe')]('Automation,\x20%s,\x20%s',_0x5c8a27,_0x28d6('0x10'));_0xb9dccb(_0x4b564f[_0x28d6('0x17')][_0x28d6('0x16')]);}})[_0x28d6('0x18')](function(_0x154c4d){logger['error'](_0x28d6('0xf'),_0x5c8a27,_0x154c4d);_0x3f3235(_0x154c4d);});});} \ No newline at end of file +var _0xa596=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug'];(function(_0x3735a2,_0x5210ed){var _0x242899=function(_0x1962fe){while(--_0x1962fe){_0x3735a2['push'](_0x3735a2['shift']());}};_0x242899(++_0x5210ed);}(_0xa596,0x7b));var _0x6a59=function(_0x54bcdd,_0x5a9859){_0x54bcdd=_0x54bcdd-0x0;var _0x41c1ae=_0xa596[_0x54bcdd];return _0x41c1ae;};'use strict';var _=require(_0x6a59('0x0'));var util=require(_0x6a59('0x1'));var moment=require('moment');var BPromise=require(_0x6a59('0x2'));var rs=require(_0x6a59('0x3'));var fs=require('fs');var Redis=require(_0x6a59('0x4'));var db=require(_0x6a59('0x5'))['db'];var utils=require(_0x6a59('0x6'));var logger=require(_0x6a59('0x7'))(_0x6a59('0x8'));var config=require(_0x6a59('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6a59('0xa')][_0x6a59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21e97f,_0x375a77,_0xb50532){return new BPromise(function(_0x3c392f,_0x5aa5fe){return client[_0x6a59('0xc')](_0x21e97f,_0xb50532)['then'](function(_0x21008c){logger['info']('Automation,\x20%s,\x20%s',_0x375a77,_0x6a59('0xd'));logger[_0x6a59('0xe')](_0x6a59('0xf'),_0x375a77,'request\x20sent',JSON[_0x6a59('0x10')](_0x21008c));if(_0x21008c[_0x6a59('0x11')]){if(_0x21008c['error'][_0x6a59('0x12')]===0x1f4){logger['error'](_0x6a59('0x13'),_0x375a77,_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);return _0x5aa5fe(_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);}logger[_0x6a59('0x11')](_0x6a59('0x13'),_0x375a77,_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);return _0x3c392f(_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);}else{logger['info'](_0x6a59('0x13'),_0x375a77,_0x6a59('0xd'));_0x3c392f(_0x21008c[_0x6a59('0x15')][_0x6a59('0x14')]);}})[_0x6a59('0x16')](function(_0x39ad1e){logger['error'](_0x6a59('0x13'),_0x375a77,_0x39ad1e);_0x5aa5fe(_0x39ad1e);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 69b0b79..82c76a8 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 _0x7846=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','/:id','destroy'];(function(_0x567259,_0x3c3241){var _0x36a775=function(_0x288b94){while(--_0x288b94){_0x567259['push'](_0x567259['shift']());}};_0x36a775(++_0x3c3241);}(_0x7846,0xf4));var _0x6784=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x7846[_0x186376];return _0x2dbdd9;};'use strict';var multer=require('multer');var util=require(_0x6784('0x0'));var path=require(_0x6784('0x1'));var timeout=require(_0x6784('0x2'));var express=require(_0x6784('0x3'));var router=express[_0x6784('0x4')]();var fs_extra=require(_0x6784('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6784('0x6'));var config=require(_0x6784('0x7'));var controller=require(_0x6784('0x8'));router[_0x6784('0x9')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0xb')]);router[_0x6784('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6784('0xc')]);router[_0x6784('0x9')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0xe')]);router[_0x6784('0x9')](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x10')]);router[_0x6784('0x11')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0x12')]);router[_0x6784('0x11')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0x13')]);router['post'](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x14')]);router[_0x6784('0x15')]('/:id',auth[_0x6784('0xa')](),controller[_0x6784('0x16')]);router[_0x6784('0x17')](_0x6784('0x18'),auth[_0x6784('0xa')](),controller[_0x6784('0x19')]);module[_0x6784('0x1a')]=router; \ No newline at end of file +var _0x0c6d=['addActions','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x43b158,_0x33f382){var _0x2a656c=function(_0x1026d1){while(--_0x1026d1){_0x43b158['push'](_0x43b158['shift']());}};_0x2a656c(++_0x33f382);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x4678dc,_0x4545c8){_0x4678dc=_0x4678dc-0x0;var _0x2cf911=_0x0c6d[_0x4678dc];return _0x2cf911;};'use strict';var multer=require('multer');var util=require(_0xd0c6('0x0'));var path=require(_0xd0c6('0x1'));var timeout=require(_0xd0c6('0x2'));var express=require(_0xd0c6('0x3'));var router=express[_0xd0c6('0x4')]();var fs_extra=require(_0xd0c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0c6('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router['get']('/',auth[_0xd0c6('0x7')](),controller[_0xd0c6('0x8')]);router[_0xd0c6('0x9')]('/:id',auth[_0xd0c6('0x7')](),controller['show']);router[_0xd0c6('0x9')](_0xd0c6('0xa'),auth[_0xd0c6('0x7')](),controller[_0xd0c6('0xb')]);router[_0xd0c6('0x9')](_0xd0c6('0xc'),auth[_0xd0c6('0x7')](),controller[_0xd0c6('0xd')]);router[_0xd0c6('0xe')]('/',auth['isAuthenticated'](),controller[_0xd0c6('0xf')]);router['post']('/:id/conditions',auth[_0xd0c6('0x7')](),controller[_0xd0c6('0x10')]);router[_0xd0c6('0xe')](_0xd0c6('0xc'),auth[_0xd0c6('0x7')](),controller[_0xd0c6('0x11')]);router[_0xd0c6('0x12')](_0xd0c6('0x13'),auth[_0xd0c6('0x7')](),controller[_0xd0c6('0x14')]);router[_0xd0c6('0x15')](_0xd0c6('0x13'),auth[_0xd0c6('0x7')](),controller[_0xd0c6('0x16')]);module[_0xd0c6('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 05d092b..52a44a8 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 _0x51c5=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x51c5,0xc8));var _0x551c=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x51c5[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x551c('0x0')],'unique':_0x551c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x551c('0x2')](_0x551c('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x551c('0x0')]},'active':{'type':Sequelize[_0x551c('0x4')],'defaultValue':0x0,'comment':_0x551c('0x5')},'limitCalls':{'type':Sequelize[_0x551c('0x6')](0x4)[_0x551c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x551c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x551c('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x551c('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x551c('0xf')},'dialTimezone':{'type':Sequelize[_0x551c('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x551c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x551c('0x2')]('always','never',_0x551c('0x11')),'defaultValue':_0x551c('0x12')},'dialAMDActive':{'type':Sequelize[_0x551c('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x551c('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x551c('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x551c('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x551c('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x551c('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x551c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x551c('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x551c('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x551c('0x1a'),'ASC'),'defaultValue':_0x551c('0x1a')},'dialPrefix':{'type':Sequelize[_0x551c('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x551c('0x1b')},'dialCutDigit':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x551c('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x26')}}; \ No newline at end of file +var _0x9ecd=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','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)'];(function(_0x13948b,_0x18ef25){var _0x56dff8=function(_0x2b4770){while(--_0x2b4770){_0x13948b['push'](_0x13948b['shift']());}};_0x56dff8(++_0x18ef25);}(_0x9ecd,0x17f));var _0xd9ec=function(_0x206816,_0x364750){_0x206816=_0x206816-0x0;var _0x222c3c=_0x9ecd[_0x206816];return _0x222c3c;};'use strict';var Sequelize=require(_0xd9ec('0x0'));module[_0xd9ec('0x1')]={'name':{'type':Sequelize[_0xd9ec('0x2')],'unique':_0xd9ec('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd9ec('0x4')](_0xd9ec('0x5')),'allowNull':![],'defaultValue':_0xd9ec('0x5')},'description':{'type':Sequelize[_0xd9ec('0x2')]},'active':{'type':Sequelize[_0xd9ec('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xd9ec('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd9ec('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd9ec('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd9ec('0x9')](0x3)[_0xd9ec('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9ec('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd9ec('0x9')](0x3)[_0xd9ec('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9ec('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd9ec('0x9')](0x5)[_0xd9ec('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9ec('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xd9ec('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9ec('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd9ec('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9ec('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd9ec('0x9')](0x3)[_0xd9ec('0x7')],'defaultValue':0x3,'comment':_0xd9ec('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd9ec('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd9ec('0x9')](0x3)[_0xd9ec('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd9ec('0x10')},'dialTimezone':{'type':Sequelize[_0xd9ec('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd9ec('0x2')],'defaultValue':_0xd9ec('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xd9ec('0x4')](_0xd9ec('0x12'),_0xd9ec('0x13'),_0xd9ec('0x14')),'defaultValue':_0xd9ec('0x12')},'dialAMDActive':{'type':Sequelize[_0xd9ec('0x6')],'defaultValue':0x0,'comment':_0xd9ec('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xd9ec('0x9')](0x9)[_0xd9ec('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd9ec('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xd9ec('0x9')](0x9)[_0xd9ec('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd9ec('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd9ec('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd9ec('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd9ec('0x9')](0x9)[_0xd9ec('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd9ec('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd9ec('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd9ec('0x9')](0x9)[_0xd9ec('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd9ec('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd9ec('0x9')](0x9)[_0xd9ec('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd9ec('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd9ec('0x9')](0x5)[_0xd9ec('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd9ec('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd9ec('0x4')](_0xd9ec('0x1d'),_0xd9ec('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd9ec('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd9ec('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9ec('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9ec('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd9ec('0x9')](0x3)[_0xd9ec('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9ec('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd9ec('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9ec('0x22')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9ec('0x23')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9ec('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd9ec('0x9')](0x3)[_0xd9ec('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9ec('0x25')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd9ec('0x9')](0x5)[_0xd9ec('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9ec('0x26')},'dialMachineMaxRetry':{'type':Sequelize[_0xd9ec('0x9')](0x3)[_0xd9ec('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9ec('0x27')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd9ec('0x9')](0x5)[_0xd9ec('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9ec('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd9ec('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd9ec('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9ec('0x29')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 7689197..879f603 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 _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(_0x2198a1,_0x5cab5c){var _0xcbb626=function(_0x586630){while(--_0x586630){_0x2198a1['push'](_0x2198a1['shift']());}};_0xcbb626(++_0x5cab5c);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'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 +var _0x84a0=['send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','autoAssociation','findOne','CampaignId','CmHopper','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','h.id','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','error','stack','name'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0x84a0,0x66));var _0x084a=function(_0x358ab6,_0x2899d8){_0x358ab6=_0x358ab6-0x0;var _0x155484=_0x84a0[_0x358ab6];return _0x155484;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];function respondWithStatusCode(_0x3ca72f,_0xec90a5){_0xec90a5=_0xec90a5||0xcc;return function(_0x9245b1){if(_0x9245b1){return _0x3ca72f[_0x084a('0x18')](_0xec90a5);}return _0x3ca72f[_0x084a('0x19')](_0xec90a5)[_0x084a('0x1a')]();};}function respondWithResult(_0x3a76d1,_0x5aef40){_0x5aef40=_0x5aef40||0xc8;return function(_0x4277c9){if(_0x4277c9){return _0x3a76d1['status'](_0x5aef40)[_0x084a('0x1b')](_0x4277c9);}};}function respondWithFilteredResult(_0x3ccaca,_0x366624){return function(_0x2d35b8){if(_0x2d35b8){var _0xd20527=typeof _0x366624['offset']===_0x084a('0x1c')&&typeof _0x366624['limit']===_0x084a('0x1c');var _0x355b45=_0x2d35b8['count'];var _0xf2c333=_0xd20527?0x0:_0x366624[_0x084a('0x1d')];var _0x4134b9=_0xd20527?_0x2d35b8[_0x084a('0x1e')]:_0x366624[_0x084a('0x1d')]+_0x366624[_0x084a('0x1f')];var _0x447a19;if(_0x4134b9>=_0x355b45){_0x4134b9=_0x355b45;_0x447a19=0xc8;}else{_0x447a19=0xce;}_0x3ccaca[_0x084a('0x19')](_0x447a19);return _0x3ccaca[_0x084a('0x20')](_0x084a('0x21'),_0xf2c333+'-'+_0x4134b9+'/'+_0x355b45)[_0x084a('0x1b')](_0x2d35b8);}return null;};}function patchUpdates(_0x279e25){return function(_0x116328){try{jsonpatch[_0x084a('0x22')](_0x116328,_0x279e25,!![]);}catch(_0xf0dd98){return BPromise['reject'](_0xf0dd98);}return _0x116328[_0x084a('0x23')]();};}function saveUpdates(_0x1ad257,_0x41a90f){return function(_0x2d62bf){if(_0x2d62bf){return _0x2d62bf[_0x084a('0x24')](_0x1ad257)['then'](function(_0x755c24){return _0x755c24;});}return null;};}function removeEntity(_0x288e9e,_0x6346a5){return function(_0x1f2c9f){if(_0x1f2c9f){return _0x1f2c9f[_0x084a('0x25')]()[_0x084a('0x26')](function(){var _0x5be167=_0x1f2c9f[_0x084a('0x27')]({'plain':!![]});var _0x2af138=_0x084a('0x28');return db['UserProfileResource'][_0x084a('0x25')]({'where':{'type':_0x2af138,'resourceId':_0x5be167['id']}})[_0x084a('0x26')](function(){return _0x1f2c9f;});})[_0x084a('0x26')](function(){_0x288e9e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4874fe,_0x52227a){return function(_0x33b88f){if(!_0x33b88f){_0x4874fe['sendStatus'](0x194);}return _0x33b88f;};}function handleError(_0x5bea78,_0x51c9f4){_0x51c9f4=_0x51c9f4||0x1f4;return function(_0x3b8176){logger[_0x084a('0x29')](_0x3b8176[_0x084a('0x2a')]);if(_0x3b8176[_0x084a('0x2b')]){delete _0x3b8176[_0x084a('0x2b')];}_0x5bea78[_0x084a('0x19')](_0x51c9f4)[_0x084a('0x2c')](_0x3b8176);};}exports[_0x084a('0x2d')]=function(_0x5e6ea8,_0x2ed3cd){var _0x3b2b38={},_0x501a16={},_0xe1980b={'count':0x0,'rows':[]};var _0x24bcf5=_[_0x084a('0x2e')](db[_0x084a('0x2f')][_0x084a('0x30')],function(_0x202602){return{'name':_0x202602[_0x084a('0x31')],'type':_0x202602[_0x084a('0x32')][_0x084a('0x33')]};});_0x501a16[_0x084a('0x34')]=_[_0x084a('0x2e')](_0x24bcf5,_0x084a('0x2b'));_0x501a16[_0x084a('0x35')]=_['keys'](_0x5e6ea8['query']);_0x501a16[_0x084a('0x36')]=_[_0x084a('0x37')](_0x501a16[_0x084a('0x34')],_0x501a16[_0x084a('0x35')]);_0x3b2b38[_0x084a('0x38')]=_['intersection'](_0x501a16[_0x084a('0x34')],qs[_0x084a('0x39')](_0x5e6ea8[_0x084a('0x35')]['fields']));_0x3b2b38[_0x084a('0x38')]=_0x3b2b38[_0x084a('0x38')][_0x084a('0x3a')]?_0x3b2b38['attributes']:_0x501a16['model'];if(!_0x5e6ea8['query'][_0x084a('0x3b')](_0x084a('0x3c'))){_0x3b2b38[_0x084a('0x1f')]=qs['limit'](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x1f')]);_0x3b2b38[_0x084a('0x1d')]=qs[_0x084a('0x1d')](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x1d')]);}_0x3b2b38[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x3e')]);_0x3b2b38[_0x084a('0x3f')]=qs[_0x084a('0x36')](_[_0x084a('0x40')](_0x5e6ea8[_0x084a('0x35')],_0x501a16[_0x084a('0x36')]),_0x24bcf5);if(_0x5e6ea8['query'][_0x084a('0x41')]){_0x3b2b38[_0x084a('0x3f')]=_[_0x084a('0x42')](_0x3b2b38[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x24bcf5,function(_0x22862b){if(_0x22862b[_0x084a('0x32')]!==_0x084a('0x43')){var _0x13dc4c={};_0x13dc4c[_0x22862b['name']]={'$like':'%'+_0x5e6ea8[_0x084a('0x35')][_0x084a('0x41')]+'%'};return _0x13dc4c;}})});}_0x3b2b38=_[_0x084a('0x42')]({},_0x3b2b38,_0x5e6ea8[_0x084a('0x44')]);var _0x256008={'where':_0x3b2b38[_0x084a('0x3f')]};return db['Campaign'][_0x084a('0x1e')](_0x256008)[_0x084a('0x26')](function(_0x55c5f4){_0xe1980b[_0x084a('0x1e')]=_0x55c5f4;if(_0x5e6ea8[_0x084a('0x35')][_0x084a('0x45')]){_0x3b2b38['include']=[{'all':!![]}];}return db[_0x084a('0x2f')][_0x084a('0x46')](_0x3b2b38);})['then'](function(_0x3e2b92){_0xe1980b[_0x084a('0x47')]=_0x3e2b92;return _0xe1980b;})['then'](respondWithFilteredResult(_0x2ed3cd,_0x3b2b38))['catch'](handleError(_0x2ed3cd,null));};exports[_0x084a('0x48')]=function(_0x17a8d4,_0x3726bd){var _0xec2713={'raw':![],'where':{'id':_0x17a8d4[_0x084a('0x49')]['id']}},_0x1e2a2d={};_0x1e2a2d[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x2f')][_0x084a('0x30')]);_0x1e2a2d[_0x084a('0x35')]=_['keys'](_0x17a8d4['query']);_0x1e2a2d[_0x084a('0x36')]=_[_0x084a('0x37')](_0x1e2a2d[_0x084a('0x34')],_0x1e2a2d['query']);_0xec2713[_0x084a('0x38')]=_[_0x084a('0x37')](_0x1e2a2d[_0x084a('0x34')],qs[_0x084a('0x39')](_0x17a8d4[_0x084a('0x35')]['fields']));_0xec2713[_0x084a('0x38')]=_0xec2713['attributes'][_0x084a('0x3a')]?_0xec2713[_0x084a('0x38')]:_0x1e2a2d[_0x084a('0x34')];if(_0x17a8d4['query']['includeAll']){_0xec2713[_0x084a('0x4b')]=[{'all':!![]}];}_0xec2713=_[_0x084a('0x42')]({},_0xec2713,_0x17a8d4['options']);return db[_0x084a('0x2f')][_0x084a('0x4c')](_0xec2713)[_0x084a('0x26')](handleEntityNotFound(_0x3726bd,null))[_0x084a('0x26')](respondWithResult(_0x3726bd,null))['catch'](handleError(_0x3726bd,null));};exports[_0x084a('0x4d')]=function(_0x865368,_0x31677b){return db[_0x084a('0x2f')]['create'](_0x865368[_0x084a('0x4e')],{})[_0x084a('0x26')](function(_0x411fa9){var _0x2d3d01=_0x865368['user']['get']({'plain':!![]});if(!_0x2d3d01)throw new Error(_0x084a('0x4f'));if(_0x2d3d01[_0x084a('0x50')]===_0x084a('0x51')){var _0x264f09=_0x411fa9[_0x084a('0x27')]({'plain':!![]});var _0x3b2df4=_0x084a('0x28');return db[_0x084a('0x52')][_0x084a('0x4c')]({'where':{'name':_0x3b2df4,'userProfileId':_0x2d3d01[_0x084a('0x53')]},'raw':!![]})[_0x084a('0x26')](function(_0x98769c){if(_0x98769c&&_0x98769c['autoAssociation']===0x0){return db[_0x084a('0x54')][_0x084a('0x4d')]({'name':_0x264f09[_0x084a('0x2b')],'resourceId':_0x264f09['id'],'type':_0x98769c[_0x084a('0x2b')],'sectionId':_0x98769c['id']},{})[_0x084a('0x26')](function(){return _0x411fa9;});}else{return _0x411fa9;}})[_0x084a('0x55')](function(_0xa5362){logger['error'](_0x084a('0x56'),_0xa5362);throw _0xa5362;});}return _0x411fa9;})[_0x084a('0x26')](respondWithResult(_0x31677b,0xc9))[_0x084a('0x55')](handleError(_0x31677b,null));};exports['clone']=function(_0x54ca1f,_0x424cd1){var _0x5b8d2d={'where':{'id':_0x54ca1f[_0x084a('0x49')]['id']}},_0x3a4b12={};_0x3a4b12['model']=_[_0x084a('0x4a')](db['Campaign']['rawAttributes']);_0x5b8d2d[_0x084a('0x38')]=_[_0x084a('0x37')](_0x3a4b12[_0x084a('0x34')],qs[_0x084a('0x39')](_0x54ca1f[_0x084a('0x35')][_0x084a('0x39')]));_0x5b8d2d[_0x084a('0x38')]=_0x5b8d2d['attributes'][_0x084a('0x3a')]?_0x5b8d2d[_0x084a('0x38')]:_0x3a4b12[_0x084a('0x34')];if(_0x54ca1f['query'][_0x084a('0x45')]){_0x5b8d2d[_0x084a('0x4b')]=[{'all':!![]}];}_0x5b8d2d=_[_0x084a('0x42')]({},_0x5b8d2d,_0x54ca1f[_0x084a('0x44')]);return db['Campaign'][_0x084a('0x4c')](_0x5b8d2d)['then'](handleEntityNotFound(_0x424cd1,null))[_0x084a('0x26')](function(_0x2da4d4){if(_0x2da4d4){var _0x21a18a=_0x2da4d4['get']({'plain':!![]});_0x21a18a=qs['omit'](_0x21a18a,['id',_0x084a('0x57'),_0x084a('0x58')]);_0x54ca1f['body']=_[_0x084a('0x59')](_0x54ca1f['body'],['id','createdAt',_0x084a('0x58')]);return db[_0x084a('0x2f')][_0x084a('0x4d')](_[_0x084a('0x42')](_0x21a18a,_0x54ca1f[_0x084a('0x4e')]),{'include':_0x54ca1f[_0x084a('0x35')][_0x084a('0x45')]?[{'all':!![]}]:undefined})[_0x084a('0x26')](function(_0x114aa5){var _0x50fe69=_0x54ca1f[_0x084a('0x51')][_0x084a('0x27')]({'plain':!![]});if(!_0x50fe69)throw new Error(_0x084a('0x4f'));if(_0x50fe69['role']===_0x084a('0x51')){var _0x3d8128=_0x114aa5['get']({'plain':!![]});var _0x3db978='IvrCampaigns';return db['UserProfileSection'][_0x084a('0x4c')]({'where':{'name':_0x3db978,'userProfileId':_0x50fe69['userProfileId']},'raw':!![]})['then'](function(_0x2368f5){if(_0x2368f5&&_0x2368f5[_0x084a('0x5a')]===0x0){return db[_0x084a('0x54')]['create']({'name':_0x3d8128[_0x084a('0x2b')],'resourceId':_0x3d8128['id'],'type':_0x2368f5[_0x084a('0x2b')],'sectionId':_0x2368f5['id']},{})[_0x084a('0x26')](function(){return _0x114aa5;});}else{return _0x114aa5;}})[_0x084a('0x55')](function(_0x45e2d3){logger[_0x084a('0x29')](_0x084a('0x56'),_0x45e2d3);throw _0x45e2d3;});}return _0x114aa5;});}})['then'](respondWithResult(_0x424cd1,0xc9))['catch'](handleError(_0x424cd1,null));};exports[_0x084a('0x24')]=function(_0x36ba24,_0x5c77a3){if(_0x36ba24[_0x084a('0x4e')]['id']){delete _0x36ba24[_0x084a('0x4e')]['id'];}return db[_0x084a('0x2f')][_0x084a('0x4c')]({'where':{'id':_0x36ba24['params']['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x5c77a3,null))[_0x084a('0x26')](saveUpdates(_0x36ba24[_0x084a('0x4e')],null))['then'](respondWithResult(_0x5c77a3,null))['catch'](handleError(_0x5c77a3,null));};exports[_0x084a('0x25')]=function(_0x3ea662,_0x2a6331){return db[_0x084a('0x2f')][_0x084a('0x4c')]({'where':{'id':_0x3ea662[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x2a6331,null))['then'](removeEntity(_0x2a6331,null))[_0x084a('0x55')](handleError(_0x2a6331,null));};exports['getHoppers']=function(_0x4e713c,_0x24a553,_0x3acf1b){var _0x2c35ce={'raw':!![],'where':{}};var _0x4a2745={};var _0x163a5d={'count':0x0,'rows':[]};return db['Campaign'][_0x084a('0x5b')]({'where':{'id':_0x4e713c[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x24a553,null))[_0x084a('0x26')](function(_0xb73218){if(_0xb73218){_0x4a2745[_0x084a('0x34')]=_['keys'](db['CmHopper'][_0x084a('0x30')]);_0x4a2745[_0x084a('0x35')]=_[_0x084a('0x4a')](_0x4e713c[_0x084a('0x35')]);_0x4a2745[_0x084a('0x36')]=_[_0x084a('0x37')](_0x4a2745['model'],_0x4a2745[_0x084a('0x35')]);_0x2c35ce[_0x084a('0x38')]=_[_0x084a('0x37')](_0x4a2745[_0x084a('0x34')],qs[_0x084a('0x39')](_0x4e713c[_0x084a('0x35')][_0x084a('0x39')]));_0x2c35ce['attributes']=_0x2c35ce[_0x084a('0x38')][_0x084a('0x3a')]?_0x2c35ce[_0x084a('0x38')]:_0x4a2745[_0x084a('0x34')];if(!_0x4e713c[_0x084a('0x35')][_0x084a('0x3b')](_0x084a('0x3c'))){_0x2c35ce[_0x084a('0x1f')]=qs[_0x084a('0x1f')](_0x4e713c[_0x084a('0x35')]['limit']);_0x2c35ce['offset']=qs['offset'](_0x4e713c[_0x084a('0x35')][_0x084a('0x1d')]);}_0x2c35ce['order']=qs[_0x084a('0x3e')](_0x4e713c[_0x084a('0x35')][_0x084a('0x3e')]);_0x2c35ce[_0x084a('0x3f')]=qs['filters'](_['pick'](_0x4e713c[_0x084a('0x35')],_0x4a2745[_0x084a('0x36')]));_0x2c35ce[_0x084a('0x3f')][_0x084a('0x5c')]=_0xb73218['id'];if(_0x4e713c[_0x084a('0x35')][_0x084a('0x41')]){_0x2c35ce[_0x084a('0x3f')]=_['merge'](_0x2c35ce[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x2c35ce[_0x084a('0x38')],function(_0x137bba){var _0x3dcafb={};_0x3dcafb[_0x137bba]={'$like':'%'+_0x4e713c[_0x084a('0x35')][_0x084a('0x41')]+'%'};return _0x3dcafb;})});}_0x2c35ce=_['merge']({},_0x2c35ce,_0x4e713c[_0x084a('0x44')]);return db[_0x084a('0x5d')][_0x084a('0x1e')]({'where':_0x2c35ce[_0x084a('0x3f')]})[_0x084a('0x26')](function(_0x2fa64d){_0x163a5d[_0x084a('0x1e')]=_0x2fa64d;if(_0x4e713c[_0x084a('0x35')][_0x084a('0x45')]){_0x2c35ce[_0x084a('0x4b')]=[{'all':!![]}];}return db[_0x084a('0x5d')]['findAll'](_0x2c35ce);})[_0x084a('0x26')](function(_0x29916a){_0x163a5d['rows']=_0x29916a;return _0x163a5d;});}})[_0x084a('0x26')](respondWithFilteredResult(_0x24a553,_0x2c35ce))['catch'](handleError(_0x24a553,null));};exports['getHopperHistories']=function(_0x3d6066,_0xd22b54,_0x55297a){var _0x3b9c99={'raw':!![],'where':{}};var _0x43d19c={};var _0x371e8b={'count':0x0,'rows':[]};return db[_0x084a('0x2f')][_0x084a('0x5b')]({'where':{'id':_0x3d6066[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0xd22b54,null))[_0x084a('0x26')](function(_0x1916b1){if(_0x1916b1){_0x43d19c[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x5e')][_0x084a('0x30')]);_0x43d19c[_0x084a('0x35')]=_[_0x084a('0x4a')](_0x3d6066['query']);_0x43d19c[_0x084a('0x36')]=_[_0x084a('0x37')](_0x43d19c[_0x084a('0x34')],_0x43d19c[_0x084a('0x35')]);_0x3b9c99[_0x084a('0x38')]=_[_0x084a('0x37')](_0x43d19c[_0x084a('0x34')],qs[_0x084a('0x39')](_0x3d6066['query']['fields']));_0x3b9c99[_0x084a('0x38')]=_0x3b9c99[_0x084a('0x38')]['length']?_0x3b9c99['attributes']:_0x43d19c[_0x084a('0x34')];if(!_0x3d6066['query'][_0x084a('0x3b')]('nolimit')){_0x3b9c99[_0x084a('0x1f')]=qs[_0x084a('0x1f')](_0x3d6066[_0x084a('0x35')][_0x084a('0x1f')]);_0x3b9c99['offset']=qs['offset'](_0x3d6066['query'][_0x084a('0x1d')]);}_0x3b9c99[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x3d6066['query'][_0x084a('0x3e')]);_0x3b9c99[_0x084a('0x3f')]=qs['filters'](_[_0x084a('0x40')](_0x3d6066[_0x084a('0x35')],_0x43d19c['filters']));_0x3b9c99[_0x084a('0x3f')][_0x084a('0x5c')]=_0x1916b1['id'];if(_0x3d6066[_0x084a('0x35')]['filter']){_0x3b9c99['where']=_[_0x084a('0x42')](_0x3b9c99['where'],{'$or':_[_0x084a('0x2e')](_0x3b9c99[_0x084a('0x38')],function(_0x11894e){var _0xd9b1d8={};_0xd9b1d8[_0x11894e]={'$like':'%'+_0x3d6066[_0x084a('0x35')][_0x084a('0x41')]+'%'};return _0xd9b1d8;})});}_0x3b9c99=_['merge']({},_0x3b9c99,_0x3d6066[_0x084a('0x44')]);return db['CmHopperHistory']['count']({'where':_0x3b9c99[_0x084a('0x3f')]})[_0x084a('0x26')](function(_0xc334e1){_0x371e8b[_0x084a('0x1e')]=_0xc334e1;if(_0x3d6066[_0x084a('0x35')][_0x084a('0x45')]){_0x3b9c99['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x084a('0x46')](_0x3b9c99);})[_0x084a('0x26')](function(_0x3ec654){_0x371e8b['rows']=_0x3ec654;return _0x371e8b;});}})[_0x084a('0x26')](respondWithFilteredResult(_0xd22b54,_0x3b9c99))[_0x084a('0x55')](handleError(_0xd22b54,null));};exports['getHopperFinals']=function(_0x4d2401,_0x2e6dca,_0x487479){var _0x5c93b2={'raw':!![],'where':{}};var _0x135e46={};var _0x2d9c66={'count':0x0,'rows':[]};return db['Campaign'][_0x084a('0x5b')]({'where':{'id':_0x4d2401[_0x084a('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e6dca,null))[_0x084a('0x26')](function(_0x297102){if(_0x297102){_0x135e46[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x5f')][_0x084a('0x30')]);_0x135e46['query']=_['keys'](_0x4d2401[_0x084a('0x35')]);_0x135e46[_0x084a('0x36')]=_['intersection'](_0x135e46[_0x084a('0x34')],_0x135e46['query']);_0x5c93b2[_0x084a('0x38')]=_[_0x084a('0x37')](_0x135e46[_0x084a('0x34')],qs[_0x084a('0x39')](_0x4d2401[_0x084a('0x35')][_0x084a('0x39')]));_0x5c93b2['attributes']=_0x5c93b2['attributes'][_0x084a('0x3a')]?_0x5c93b2[_0x084a('0x38')]:_0x135e46[_0x084a('0x34')];if(!_0x4d2401[_0x084a('0x35')][_0x084a('0x3b')]('nolimit')){_0x5c93b2[_0x084a('0x1f')]=qs[_0x084a('0x1f')](_0x4d2401[_0x084a('0x35')][_0x084a('0x1f')]);_0x5c93b2['offset']=qs[_0x084a('0x1d')](_0x4d2401[_0x084a('0x35')][_0x084a('0x1d')]);}_0x5c93b2[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x4d2401[_0x084a('0x35')][_0x084a('0x3e')]);_0x5c93b2[_0x084a('0x3f')]=qs[_0x084a('0x36')](_[_0x084a('0x40')](_0x4d2401[_0x084a('0x35')],_0x135e46['filters']));_0x5c93b2['where'][_0x084a('0x5c')]=_0x297102['id'];if(_0x4d2401['query'][_0x084a('0x41')]){_0x5c93b2[_0x084a('0x3f')]=_[_0x084a('0x42')](_0x5c93b2[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x5c93b2['attributes'],function(_0x3056fc){var _0x41908d={};_0x41908d[_0x3056fc]={'$like':'%'+_0x4d2401['query'][_0x084a('0x41')]+'%'};return _0x41908d;})});}_0x5c93b2=_[_0x084a('0x42')]({},_0x5c93b2,_0x4d2401[_0x084a('0x44')]);return db['CmHopperFinal'][_0x084a('0x1e')]({'where':_0x5c93b2[_0x084a('0x3f')]})[_0x084a('0x26')](function(_0x19b4be){_0x2d9c66[_0x084a('0x1e')]=_0x19b4be;if(_0x4d2401[_0x084a('0x35')][_0x084a('0x45')]){_0x5c93b2[_0x084a('0x4b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x084a('0x46')](_0x5c93b2);})[_0x084a('0x26')](function(_0x355c04){_0x2d9c66[_0x084a('0x47')]=_0x355c04;return _0x2d9c66;});}})['then'](respondWithFilteredResult(_0x2e6dca,_0x5c93b2))[_0x084a('0x55')](handleError(_0x2e6dca,null));};exports[_0x084a('0x60')]=function(_0xa15c67,_0xab0f66,_0x1957a0){var _0x1093da={'raw':!![],'where':{}};var _0x25f20b={};var _0x5528bc={'count':0x0,'rows':[]};return db[_0x084a('0x2f')][_0x084a('0x5b')]({'where':{'id':_0xa15c67[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0xab0f66,null))[_0x084a('0x26')](function(_0x4087bf){if(_0x4087bf){_0x25f20b[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x61')][_0x084a('0x30')]);_0x25f20b[_0x084a('0x35')]=_[_0x084a('0x4a')](_0xa15c67[_0x084a('0x35')]);_0x25f20b[_0x084a('0x36')]=_[_0x084a('0x37')](_0x25f20b[_0x084a('0x34')],_0x25f20b[_0x084a('0x35')]);_0x1093da['attributes']=_[_0x084a('0x37')](_0x25f20b[_0x084a('0x34')],qs[_0x084a('0x39')](_0xa15c67[_0x084a('0x35')]['fields']));_0x1093da[_0x084a('0x38')]=_0x1093da[_0x084a('0x38')][_0x084a('0x3a')]?_0x1093da[_0x084a('0x38')]:_0x25f20b[_0x084a('0x34')];if(!_0xa15c67[_0x084a('0x35')]['hasOwnProperty']('nolimit')){_0x1093da[_0x084a('0x1f')]=qs[_0x084a('0x1f')](_0xa15c67[_0x084a('0x35')][_0x084a('0x1f')]);_0x1093da[_0x084a('0x1d')]=qs[_0x084a('0x1d')](_0xa15c67[_0x084a('0x35')][_0x084a('0x1d')]);}_0x1093da['order']=qs[_0x084a('0x3e')](_0xa15c67[_0x084a('0x35')][_0x084a('0x3e')]);_0x1093da[_0x084a('0x3f')]=qs['filters'](_['pick'](_0xa15c67[_0x084a('0x35')],_0x25f20b[_0x084a('0x36')]));_0x1093da[_0x084a('0x3f')][_0x084a('0x5c')]=_0x4087bf['id'];if(_0xa15c67[_0x084a('0x35')]['filter']){_0x1093da['where']=_['merge'](_0x1093da[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x1093da['attributes'],function(_0x3983b1){var _0x3d3a01={};_0x3d3a01[_0x3983b1]={'$like':'%'+_0xa15c67['query'][_0x084a('0x41')]+'%'};return _0x3d3a01;})});}_0x1093da=_[_0x084a('0x42')]({},_0x1093da,_0xa15c67[_0x084a('0x44')]);return db['CmHopperBlack'][_0x084a('0x1e')]({'where':_0x1093da[_0x084a('0x3f')]})[_0x084a('0x26')](function(_0x1bca78){_0x5528bc[_0x084a('0x1e')]=_0x1bca78;if(_0xa15c67[_0x084a('0x35')]['includeAll']){_0x1093da[_0x084a('0x4b')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x084a('0x46')](_0x1093da);})['then'](function(_0x4156fa){_0x5528bc[_0x084a('0x47')]=_0x4156fa;return _0x5528bc;});}})[_0x084a('0x26')](respondWithFilteredResult(_0xab0f66,_0x1093da))[_0x084a('0x55')](handleError(_0xab0f66,null));};exports[_0x084a('0x62')]=function(_0x20d051,_0x3859d5,_0x1fb924){var _0x3ec164={};var _0x33f4bd={};var _0xafff35;var _0x193db9;return db['Campaign'][_0x084a('0x5b')]({'where':{'id':_0x20d051[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x3859d5,null))[_0x084a('0x26')](function(_0x210267){if(_0x210267){_0xafff35=_0x210267;_0x33f4bd[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x63')]['rawAttributes']);_0x33f4bd['query']=_['keys'](_0x20d051[_0x084a('0x35')]);_0x33f4bd[_0x084a('0x36')]=_[_0x084a('0x37')](_0x33f4bd[_0x084a('0x34')],_0x33f4bd[_0x084a('0x35')]);_0x3ec164[_0x084a('0x38')]=_[_0x084a('0x37')](_0x33f4bd[_0x084a('0x34')],qs[_0x084a('0x39')](_0x20d051[_0x084a('0x35')][_0x084a('0x39')]));_0x3ec164[_0x084a('0x38')]=_0x3ec164[_0x084a('0x38')][_0x084a('0x3a')]?_0x3ec164[_0x084a('0x38')]:_0x33f4bd[_0x084a('0x34')];_0x3ec164[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x20d051[_0x084a('0x35')][_0x084a('0x3e')]);_0x3ec164[_0x084a('0x3f')]=qs['filters'](_[_0x084a('0x40')](_0x20d051[_0x084a('0x35')],_0x33f4bd[_0x084a('0x36')]));if(_0x20d051['query'][_0x084a('0x41')]){_0x3ec164[_0x084a('0x3f')]=_[_0x084a('0x42')](_0x3ec164[_0x084a('0x3f')],{'$or':_['map'](_0x3ec164[_0x084a('0x38')],function(_0x163610){var _0x4833a1={};_0x4833a1[_0x163610]={'$like':'%'+_0x20d051[_0x084a('0x35')]['filter']+'%'};return _0x4833a1;})});}_0x3ec164=_['merge']({},_0x3ec164,_0x20d051[_0x084a('0x44')]);return _0xafff35[_0x084a('0x62')](_0x3ec164);}})[_0x084a('0x26')](function(_0x80af65){if(_0x80af65){_0x193db9=_0x80af65[_0x084a('0x3a')];if(!_0x20d051['query'][_0x084a('0x3b')](_0x084a('0x3c'))){_0x3ec164[_0x084a('0x1f')]=qs[_0x084a('0x1f')](_0x20d051[_0x084a('0x35')][_0x084a('0x1f')]);_0x3ec164['offset']=qs[_0x084a('0x1d')](_0x20d051['query'][_0x084a('0x1d')]);}return _0xafff35[_0x084a('0x62')](_0x3ec164);}})[_0x084a('0x26')](function(_0x2c8157){if(_0x2c8157){return _0x2c8157?{'count':_0x193db9,'rows':_0x2c8157}:null;}})['then'](respondWithResult(_0x3859d5,null))['catch'](handleError(_0x3859d5,null));};exports[_0x084a('0x64')]=function(_0x4ccc96,_0x468879,_0x20745a){var _0x365d17,_0xe6f5d4;var _0x4b96f7=[];var _0x5bf460=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x084a('0x4c')]({'where':{'id':_0x4ccc96[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x468879,null))[_0x084a('0x26')](function(_0x2b9f29){if(_0x2b9f29){_0xe6f5d4=_0x2b9f29;return _0x2b9f29[_0x084a('0x64')](_0x4ccc96[_0x084a('0x4e')][_0x084a('0x65')],_[_0x084a('0x59')](_0x4ccc96['body'],[_0x084a('0x65'),'id'])||{});}return null;})[_0x084a('0x66')](function(_0x57a30f){var _0x43fcfa;var _0x1f07f0;_0x365d17=_0x57a30f||[];var _0x1dbfd1=[];if(_0x57a30f){for(var _0x137e7d=0x0;_0x137e7d<_0x57a30f[_0x084a('0x3a')];_0x137e7d+=0x1){var _0x1786fe=_0x57a30f[_0x137e7d]['get']({'plain':!![]});_0xe6f5d4[_0x084a('0x67')]=_0x4ccc96[_0x084a('0x4e')][_0x084a('0x67')]?_0x4ccc96[_0x084a('0x4e')][_0x084a('0x67')]:_0xe6f5d4['dialCheckDuplicateType'];switch(_0xe6f5d4[_0x084a('0x67')]){case'always':_0x43fcfa=squel[_0x084a('0x68')]()[_0x084a('0x69')](_0x084a('0x6a'))['fromQuery']([_0x084a('0x6b'),_0x084a('0x6c'),_0x084a('0x6d'),_0x084a('0x6e'),'CampaignId',_0x084a('0x57'),_0x084a('0x58')],squel[_0x084a('0x6f')]()[_0x084a('0x70')](_0x084a('0x6b'),_0x084a('0x6b'))['field'](_0x084a('0x71'),_0x084a('0x6c'))[_0x084a('0x70')]('id','ContactId')['field'](_0x1786fe[_0x084a('0x72')][_0x084a('0x73')](),_0x084a('0x6e'))[_0x084a('0x70')](_0x4ccc96[_0x084a('0x49')]['id'][_0x084a('0x73')](),_0x084a('0x5c'))[_0x084a('0x70')]('\x27'+_0x5bf460+'\x27',_0x084a('0x57'))['field']('\x27'+_0x5bf460+'\x27',_0x084a('0x58'))[_0x084a('0x74')](_0x084a('0x75'))[_0x084a('0x3f')](_0x084a('0x76'))[_0x084a('0x3f')](_0x084a('0x77'),_0x1786fe['CmListId']['toString']())[_0x084a('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x084a('0x78'),squel[_0x084a('0x6f')]()[_0x084a('0x70')](_0x084a('0x79'))[_0x084a('0x74')](_0x084a('0x7a'))[_0x084a('0x3f')](_0x084a('0x7b'),_0x4ccc96[_0x084a('0x49')]['id']['toString']()))[_0x084a('0x3f')](_0x084a('0x78'),squel['select']()[_0x084a('0x70')](_0x084a('0x7c'))['from'](_0x084a('0x6a'))[_0x084a('0x3f')]('CampaignId\x20=\x20?',_0x4ccc96[_0x084a('0x49')]['id'][_0x084a('0x73')]())))['toString']();break;case'onlyIfOpen':_0x43fcfa=squel[_0x084a('0x68')]()['into']('cm_hopper')[_0x084a('0x7d')](['phone',_0x084a('0x6c'),_0x084a('0x6d'),_0x084a('0x6e'),_0x084a('0x5c'),_0x084a('0x57'),_0x084a('0x58')],squel[_0x084a('0x6f')]()[_0x084a('0x70')]('phone',_0x084a('0x6b'))[_0x084a('0x70')]('NOW()','scheduledAt')[_0x084a('0x70')]('id','ContactId')[_0x084a('0x70')](_0x1786fe['CmListId'][_0x084a('0x73')](),_0x084a('0x6e'))[_0x084a('0x70')](_0x4ccc96['params']['id'][_0x084a('0x73')](),_0x084a('0x5c'))[_0x084a('0x70')]('\x27'+_0x5bf460+'\x27',_0x084a('0x57'))['field']('\x27'+_0x5bf460+'\x27','updatedAt')[_0x084a('0x74')](_0x084a('0x75'))[_0x084a('0x3f')](_0x084a('0x76'))[_0x084a('0x3f')](_0x084a('0x77'),_0x1786fe['CmListId']['toString']())[_0x084a('0x3f')](_0x084a('0x7e'))[_0x084a('0x3f')](_0x084a('0x78'),squel[_0x084a('0x6f')]()[_0x084a('0x70')](_0x084a('0x7c'))[_0x084a('0x74')](_0x084a('0x6a'))[_0x084a('0x3f')]('CampaignId\x20=\x20?',_0x4ccc96[_0x084a('0x49')]['id'][_0x084a('0x73')]())))['toString']();break;default:_0x43fcfa=squel[_0x084a('0x68')]()[_0x084a('0x69')](_0x084a('0x6a'))[_0x084a('0x7d')](['phone',_0x084a('0x6c'),_0x084a('0x6d'),_0x084a('0x6e'),_0x084a('0x5c'),'createdAt',_0x084a('0x58')],squel[_0x084a('0x6f')]()[_0x084a('0x70')](_0x084a('0x6b'),_0x084a('0x6b'))[_0x084a('0x70')](_0x084a('0x71'),'scheduledAt')['field']('id',_0x084a('0x6d'))[_0x084a('0x70')](_0x1786fe[_0x084a('0x72')][_0x084a('0x73')](),_0x084a('0x6e'))[_0x084a('0x70')](_0x4ccc96['params']['id'][_0x084a('0x73')](),_0x084a('0x5c'))[_0x084a('0x70')]('\x27'+_0x5bf460+'\x27',_0x084a('0x57'))[_0x084a('0x70')]('\x27'+_0x5bf460+'\x27','updatedAt')[_0x084a('0x74')](_0x084a('0x75'))['where'](_0x084a('0x76'))['where'](_0x084a('0x77'),_0x1786fe[_0x084a('0x72')][_0x084a('0x73')]())[_0x084a('0x3f')](_0x084a('0x7e')))[_0x084a('0x73')]();}_0x1f07f0=squel['insert']()[_0x084a('0x69')](_0x084a('0x7f'))[_0x084a('0x7d')]([_0x084a('0x80'),_0x084a('0x6c'),_0x084a('0x6b'),'OrderBy','createdAt',_0x084a('0x58')],squel[_0x084a('0x6f')]()[_0x084a('0x70')](_0x084a('0x81'),'id')[_0x084a('0x70')](_0x084a('0x71'),_0x084a('0x6c'))['field']('ci.item',_0x084a('0x6b'))[_0x084a('0x70')]('ci.OrderBY','OrderBy')[_0x084a('0x70')]('\x27'+_0x5bf460+'\x27',_0x084a('0x57'))[_0x084a('0x70')]('\x27'+_0x5bf460+'\x27','updatedAt')['from'](_0x084a('0x82'),'ci')[_0x084a('0x83')](_0x084a('0x6a'),'h',_0x084a('0x84'))[_0x084a('0x3f')](_0x084a('0x85'),_0x1786fe[_0x084a('0x72')]['toString']())[_0x084a('0x3f')](_0x084a('0x86'),_0x4ccc96['params']['id'][_0x084a('0x73')]())[_0x084a('0x3f')](_0x084a('0x87'),_0x5bf460))['toString']();_0x1dbfd1['push'](db[_0x084a('0x88')][_0x084a('0x35')](_0x43fcfa));_0x4b96f7[_0x084a('0x89')](db['sequelize'][_0x084a('0x35')](_0x1f07f0));}return BPromise[_0x084a('0x8a')](_0x1dbfd1);}})[_0x084a('0x26')](function(){return BPromise['all'](_0x4b96f7);})[_0x084a('0x26')](function(){return _0x365d17;})[_0x084a('0x26')](respondWithResult(_0x468879,null))[_0x084a('0x55')](handleError(_0x468879,null));};exports[_0x084a('0x8b')]=function(_0x38ce65,_0xfb2355,_0x4b6771){return db[_0x084a('0x2f')][_0x084a('0x4c')]({'where':{'id':_0x38ce65[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0xfb2355,null))['then'](function(_0x5f2229){if(_0x5f2229){return _0x5f2229[_0x084a('0x8b')](_0x38ce65[_0x084a('0x35')]['ids']);}})[_0x084a('0x26')](function(_0x21912c){if(_0x21912c){return db[_0x084a('0x5d')][_0x084a('0x25')]({'where':{'ListId':_0x38ce65['query'][_0x084a('0x65')],'CampaignId':_0x38ce65['params']['id']}})[_0x084a('0x26')](function(){return _0x21912c;});}})[_0x084a('0x26')](respondWithStatusCode(_0xfb2355,null))[_0x084a('0x55')](handleError(_0xfb2355,null));};exports[_0x084a('0x8c')]=function(_0x433107,_0x22c5d5,_0xdb83a6){var _0x5e7c3b={};var _0x40c947={};var _0x239f3e;var _0x3b16cc;return db['Campaign'][_0x084a('0x5b')]({'where':{'id':_0x433107['params']['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x22c5d5,null))[_0x084a('0x26')](function(_0x40e2d7){if(_0x40e2d7){_0x239f3e=_0x40e2d7;_0x40c947[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x63')][_0x084a('0x30')]);_0x40c947[_0x084a('0x35')]=_['keys'](_0x433107[_0x084a('0x35')]);_0x40c947['filters']=_[_0x084a('0x37')](_0x40c947[_0x084a('0x34')],_0x40c947[_0x084a('0x35')]);_0x5e7c3b[_0x084a('0x38')]=_[_0x084a('0x37')](_0x40c947[_0x084a('0x34')],qs['fields'](_0x433107[_0x084a('0x35')][_0x084a('0x39')]));_0x5e7c3b[_0x084a('0x38')]=_0x5e7c3b[_0x084a('0x38')][_0x084a('0x3a')]?_0x5e7c3b[_0x084a('0x38')]:_0x40c947[_0x084a('0x34')];_0x5e7c3b[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x433107[_0x084a('0x35')][_0x084a('0x3e')]);_0x5e7c3b[_0x084a('0x3f')]=qs[_0x084a('0x36')](_[_0x084a('0x40')](_0x433107[_0x084a('0x35')],_0x40c947[_0x084a('0x36')]));if(_0x433107[_0x084a('0x35')][_0x084a('0x41')]){_0x5e7c3b[_0x084a('0x3f')]=_['merge'](_0x5e7c3b[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x5e7c3b[_0x084a('0x38')],function(_0x360858){var _0x2d40d5={};_0x2d40d5[_0x360858]={'$like':'%'+_0x433107[_0x084a('0x35')]['filter']+'%'};return _0x2d40d5;})});}_0x5e7c3b=_[_0x084a('0x42')]({},_0x5e7c3b,_0x433107[_0x084a('0x44')]);return _0x239f3e[_0x084a('0x8c')](_0x5e7c3b);}})['then'](function(_0x372811){if(_0x372811){_0x3b16cc=_0x372811[_0x084a('0x3a')];if(!_0x433107['query'][_0x084a('0x3b')](_0x084a('0x3c'))){_0x5e7c3b['limit']=qs[_0x084a('0x1f')](_0x433107[_0x084a('0x35')][_0x084a('0x1f')]);_0x5e7c3b[_0x084a('0x1d')]=qs[_0x084a('0x1d')](_0x433107[_0x084a('0x35')][_0x084a('0x1d')]);}return _0x239f3e['getBlackLists'](_0x5e7c3b);}})['then'](function(_0x367412){if(_0x367412){return _0x367412?{'count':_0x3b16cc,'rows':_0x367412}:null;}})['then'](respondWithResult(_0x22c5d5,null))[_0x084a('0x55')](handleError(_0x22c5d5,null));};exports[_0x084a('0x8d')]=function(_0x5d1405,_0x43a2bb,_0x46c339){var _0x26663a,_0x53c6bf;var _0x328e4c=[];var _0x55e4bb=moment()[_0x084a('0x8e')](_0x084a('0x8f'));return db[_0x084a('0x2f')][_0x084a('0x4c')]({'where':{'id':_0x5d1405['params']['id']}})['then'](handleEntityNotFound(_0x43a2bb,null))['then'](function(_0x493f13){if(_0x493f13){_0x53c6bf=_0x493f13;return _0x493f13[_0x084a('0x8d')](_0x5d1405[_0x084a('0x4e')][_0x084a('0x65')],_['omit'](_0x5d1405[_0x084a('0x4e')],[_0x084a('0x65'),'id'])||{});}return null;})[_0x084a('0x66')](function(_0x3abac0){var _0xf671c9;var _0x261a2c;_0x26663a=_0x3abac0||[];var _0x2bef3f=[];if(_0x3abac0){for(var _0x29fd7d=0x0;_0x29fd7d<_0x3abac0[_0x084a('0x3a')];_0x29fd7d+=0x1){var _0x26958f=_0x3abac0[_0x29fd7d][_0x084a('0x27')]({'plain':!![]});_0xf671c9=squel[_0x084a('0x68')]()[_0x084a('0x69')](_0x084a('0x90'))[_0x084a('0x7d')]([_0x084a('0x6b'),_0x084a('0x6d'),_0x084a('0x6e'),_0x084a('0x5c'),_0x084a('0x57'),_0x084a('0x58')],squel[_0x084a('0x6f')]()[_0x084a('0x70')]('phone','phone')[_0x084a('0x70')]('id','ContactId')[_0x084a('0x70')](_0x26958f[_0x084a('0x72')]['toString'](),_0x084a('0x6e'))[_0x084a('0x70')](_0x5d1405[_0x084a('0x49')]['id'][_0x084a('0x73')](),'CampaignId')['field'](_0x084a('0x71'),_0x084a('0x57'))[_0x084a('0x70')]('NOW()','updatedAt')[_0x084a('0x74')](_0x084a('0x75'))[_0x084a('0x3f')]('deletedAt\x20IS\x20NULL')[_0x084a('0x3f')](_0x084a('0x77'),_0x26958f['CmListId'][_0x084a('0x73')]())[_0x084a('0x3f')](_0x084a('0x7e')))[_0x084a('0x73')]();_0x2bef3f['push'](db[_0x084a('0x88')][_0x084a('0x35')](_0xf671c9));}return BPromise[_0x084a('0x8a')](_0x2bef3f);}})['then'](function(){return _0x26663a;})['then'](respondWithResult(_0x43a2bb,null))[_0x084a('0x55')](handleError(_0x43a2bb,null));};exports[_0x084a('0x91')]=function(_0x41be24,_0x3c5623,_0x47669c){return db['Campaign']['find']({'where':{'id':_0x41be24[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x3c5623,null))[_0x084a('0x26')](function(_0x35f3bd){if(_0x35f3bd){return _0x35f3bd[_0x084a('0x91')](_0x41be24[_0x084a('0x35')][_0x084a('0x65')]);}})[_0x084a('0x26')](function(_0x12ef12){if(_0x12ef12){return db[_0x084a('0x61')][_0x084a('0x25')]({'where':{'ListId':_0x41be24[_0x084a('0x35')][_0x084a('0x65')],'CampaignId':_0x41be24[_0x084a('0x49')]['id']}})['then'](function(){return _0x12ef12;});}})[_0x084a('0x26')](respondWithStatusCode(_0x3c5623,null))['catch'](handleError(_0x3c5623,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 17a6d80..528ab50 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1ea50c,_0x3dd2e7){var _0x37e769=function(_0x2dcb20){while(--_0x2dcb20){_0x1ea50c['push'](_0x1ea50c['shift']());}};_0x37e769(++_0x3dd2e7);}(_0x7a54,0x106));var _0x47a5=function(_0x1c97c0,_0xaf8fc8){_0x1c97c0=_0x1c97c0-0x0;var _0x40e517=_0x7a54[_0x1c97c0];return _0x40e517;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5af3bc,_0x9d10fb){var _0x32b6ff=function(_0x50e596){while(--_0x50e596){_0x5af3bc['push'](_0x5af3bc['shift']());}};_0x32b6ff(++_0x9d10fb);}(_0x7a54,0x106));var _0x47a5=function(_0x32f107,_0x47cd2b){_0x32f107=_0x32f107-0x0;var _0x4acdcf=_0x7a54[_0x32f107];return _0x4acdcf;};'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 c1f4a27..2f26256 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 _0xa37e=['debug','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x2a5030,_0x5416a5){var _0xe7ee51=function(_0x1bdaaf){while(--_0x1bdaaf){_0x2a5030['push'](_0x2a5030['shift']());}};_0xe7ee51(++_0x5416a5);}(_0xa37e,0x97));var _0xea37=function(_0x597de2,_0x241b83){_0x597de2=_0x597de2-0x0;var _0x59a86e=_0xa37e[_0x597de2];return _0x59a86e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c489,_0x4a9e08,_0x4ae081){return new BPromise(function(_0x2c2890,_0x1401e1){return client[_0xea37('0x8')](_0x36c489,_0x4ae081)[_0xea37('0x9')](function(_0x5e4ebe){logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,_0xea37('0xc'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4a9e08,_0xea37('0xc'),JSON[_0xea37('0xd')](_0x5e4ebe));if(_0x5e4ebe[_0xea37('0xe')]){if(_0x5e4ebe['error'][_0xea37('0xf')]===0x1f4){logger[_0xea37('0xe')](_0xea37('0xb'),_0x4a9e08,_0x5e4ebe['error'][_0xea37('0x10')]);return _0x1401e1(_0x5e4ebe[_0xea37('0xe')]['message']);}logger[_0xea37('0xe')]('Campaign,\x20%s,\x20%s',_0x4a9e08,_0x5e4ebe[_0xea37('0xe')]['message']);return _0x2c2890(_0x5e4ebe[_0xea37('0xe')][_0xea37('0x10')]);}else{logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,'request\x20sent');_0x2c2890(_0x5e4ebe[_0xea37('0x11')]['message']);}})['catch'](function(_0x3ae3cc){logger['error'](_0xea37('0xb'),_0x4a9e08,_0x3ae3cc);_0x1401e1(_0x3ae3cc);});});}exports[_0xea37('0x12')]=function(_0x4ef3c9){var _0x2242f0=this;return new Promise(function(_0x465d3b,_0x5427e7){return db[_0xea37('0x13')][_0xea37('0x14')]({'raw':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x16')]===undefined?!![]:![]:!![],'where':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x17')]||null:null,'attributes':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')]['attributes']||null:null,'limit':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x18')]||null:null,'include':_0x4ef3c9['options']?_0x4ef3c9['options'][_0xea37('0x19')]?_[_0xea37('0x1a')](_0x4ef3c9[_0xea37('0x15')][_0xea37('0x19')],function(_0x4996e9){return{'model':db[_0x4996e9[_0xea37('0x1b')]],'as':_0x4996e9['as'],'attributes':_0x4996e9['attributes'],'include':_0x4996e9['include']?_['map'](_0x4996e9[_0xea37('0x19')],function(_0x4ff973){return{'model':db[_0x4ff973[_0xea37('0x1b')]],'as':_0x4ff973['as'],'attributes':_0x4ff973[_0xea37('0x1c')],'include':_0x4ff973[_0xea37('0x19')]?_[_0xea37('0x1a')](_0x4ff973[_0xea37('0x19')],function(_0xb99cc6){return{'model':db[_0xb99cc6['model']],'as':_0xb99cc6['as'],'attributes':_0xb99cc6[_0xea37('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x477e25){logger[_0xea37('0xa')]('GetCampaign',_0x4ef3c9);logger[_0xea37('0x1d')](_0xea37('0x12'),_0x4ef3c9,JSON[_0xea37('0xd')](_0x477e25));_0x465d3b(_0x477e25);})['catch'](function(_0xe5b07a){logger[_0xea37('0xe')](_0xea37('0x12'),_0xe5b07a[_0xea37('0x10')],_0x4ef3c9);_0x5427e7(_0x2242f0['error'](0x1f4,_0xe5b07a[_0xea37('0x10')]));});});}; \ No newline at end of file +var _0x0434=['info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','model','include','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x4182fa,_0x25bf5c){var _0x45f07b=function(_0x37a94d){while(--_0x37a94d){_0x4182fa['push'](_0x4182fa['shift']());}};_0x45f07b(++_0x25bf5c);}(_0x0434,0x1ad));var _0x4043=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x0434[_0x19dd7a];return _0x3feb6a;};'use strict';var _=require(_0x4043('0x0'));var util=require(_0x4043('0x1'));var moment=require(_0x4043('0x2'));var BPromise=require(_0x4043('0x3'));var rs=require(_0x4043('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4043('0x5'));var logger=require(_0x4043('0x6'))(_0x4043('0x7'));var config=require(_0x4043('0x8'));var jayson=require(_0x4043('0x9'));var client=jayson[_0x4043('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d0a9,_0x1ed6c4,_0x5080e5){return new BPromise(function(_0x56355c,_0x14694d){return client[_0x4043('0xb')](_0x41d0a9,_0x5080e5)[_0x4043('0xc')](function(_0x31cb1f){logger[_0x4043('0xd')](_0x4043('0xe'),_0x1ed6c4,_0x4043('0xf'));logger[_0x4043('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1ed6c4,_0x4043('0xf'),JSON[_0x4043('0x11')](_0x31cb1f));if(_0x31cb1f[_0x4043('0x12')]){if(_0x31cb1f[_0x4043('0x12')][_0x4043('0x13')]===0x1f4){logger['error'](_0x4043('0xe'),_0x1ed6c4,_0x31cb1f[_0x4043('0x12')][_0x4043('0x14')]);return _0x14694d(_0x31cb1f[_0x4043('0x12')][_0x4043('0x14')]);}logger['error'](_0x4043('0xe'),_0x1ed6c4,_0x31cb1f[_0x4043('0x12')][_0x4043('0x14')]);return _0x56355c(_0x31cb1f[_0x4043('0x12')][_0x4043('0x14')]);}else{logger[_0x4043('0xd')](_0x4043('0xe'),_0x1ed6c4,_0x4043('0xf'));_0x56355c(_0x31cb1f[_0x4043('0x15')][_0x4043('0x14')]);}})[_0x4043('0x16')](function(_0x38aefa){logger['error'](_0x4043('0xe'),_0x1ed6c4,_0x38aefa);_0x14694d(_0x38aefa);});});}exports[_0x4043('0x17')]=function(_0x7c7b2e){var _0x5ccdcd=this;return new Promise(function(_0x3767ed,_0x451058){return db[_0x4043('0x18')][_0x4043('0x19')]({'raw':_0x7c7b2e[_0x4043('0x1a')]?_0x7c7b2e['options'][_0x4043('0x1b')]===undefined?!![]:![]:!![],'where':_0x7c7b2e['options']?_0x7c7b2e[_0x4043('0x1a')][_0x4043('0x1c')]||null:null,'attributes':_0x7c7b2e[_0x4043('0x1a')]?_0x7c7b2e[_0x4043('0x1a')][_0x4043('0x1d')]||null:null,'limit':_0x7c7b2e[_0x4043('0x1a')]?_0x7c7b2e['options'][_0x4043('0x1e')]||null:null,'include':_0x7c7b2e[_0x4043('0x1a')]?_0x7c7b2e['options']['include']?_[_0x4043('0x1f')](_0x7c7b2e['options']['include'],function(_0x1eecc2){return{'model':db[_0x1eecc2[_0x4043('0x20')]],'as':_0x1eecc2['as'],'attributes':_0x1eecc2['attributes'],'include':_0x1eecc2[_0x4043('0x21')]?_[_0x4043('0x1f')](_0x1eecc2[_0x4043('0x21')],function(_0x3bbaf6){return{'model':db[_0x3bbaf6[_0x4043('0x20')]],'as':_0x3bbaf6['as'],'attributes':_0x3bbaf6[_0x4043('0x1d')],'include':_0x3bbaf6[_0x4043('0x21')]?_[_0x4043('0x1f')](_0x3bbaf6['include'],function(_0x4a7872){return{'model':db[_0x4a7872[_0x4043('0x20')]],'as':_0x4a7872['as'],'attributes':_0x4a7872[_0x4043('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4043('0xc')](function(_0x4b04f9){logger['info'](_0x4043('0x17'),_0x7c7b2e);logger[_0x4043('0x10')]('GetCampaign',_0x7c7b2e,JSON[_0x4043('0x11')](_0x4b04f9));_0x3767ed(_0x4b04f9);})[_0x4043('0x16')](function(_0x4b1b7f){logger[_0x4043('0x12')]('GetCampaign',_0x4b1b7f[_0x4043('0x14')],_0x7c7b2e);_0x451058(_0x5ccdcd[_0x4043('0x12')](0x1f4,_0x4b1b7f[_0x4043('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4f951ca..4af69f0 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 _0x0137=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','/:id','removeLists','multer'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x0137,0xa4));var _0x7013=function(_0x118c30,_0x7eb1eb){_0x118c30=_0x118c30-0x0;var _0x569999=_0x0137[_0x118c30];return _0x569999;};'use strict';var multer=require(_0x7013('0x0'));var util=require('util');var path=require(_0x7013('0x1'));var timeout=require(_0x7013('0x2'));var express=require(_0x7013('0x3'));var router=express[_0x7013('0x4')]();var fs_extra=require(_0x7013('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7013('0x6'));var controller=require(_0x7013('0x7'));router[_0x7013('0x8')]('/',auth[_0x7013('0x9')](),controller[_0x7013('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7013('0xb')]);router[_0x7013('0x8')](_0x7013('0xc'),auth['isAuthenticated'](),controller[_0x7013('0xd')]);router[_0x7013('0x8')]('/:id/hopper_histories',auth[_0x7013('0x9')](),controller[_0x7013('0xe')]);router[_0x7013('0x8')](_0x7013('0xf'),auth[_0x7013('0x9')](),controller[_0x7013('0x10')]);router[_0x7013('0x8')](_0x7013('0x11'),auth[_0x7013('0x9')](),controller['getHopperBlacks']);router['get'](_0x7013('0x12'),auth[_0x7013('0x9')](),controller[_0x7013('0x13')]);router[_0x7013('0x8')](_0x7013('0x14'),auth[_0x7013('0x9')](),controller[_0x7013('0x15')]);router['post']('/',auth[_0x7013('0x9')](),controller[_0x7013('0x16')]);router[_0x7013('0x17')](_0x7013('0x18'),auth[_0x7013('0x9')](),controller[_0x7013('0x19')]);router[_0x7013('0x17')](_0x7013('0x12'),auth['isAuthenticated'](),controller[_0x7013('0x1a')]);router['post']('/:id/blacklists',auth[_0x7013('0x9')](),controller[_0x7013('0x1b')]);router[_0x7013('0x1c')]('/:id',auth[_0x7013('0x9')](),controller[_0x7013('0x1d')]);router[_0x7013('0x1e')](_0x7013('0x1f'),auth[_0x7013('0x9')](),controller['destroy']);router['delete'](_0x7013('0x12'),auth[_0x7013('0x9')](),controller[_0x7013('0x20')]);router[_0x7013('0x1e')]('/:id/blacklists',auth[_0x7013('0x9')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x1c64=['getBlackLists','create','post','/:id/clone','clone','/:id/lists','addBlackLists','delete','destroy','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/blacklists'];(function(_0xab611d,_0xc0cbc5){var _0x37f5cf=function(_0x1549cd){while(--_0x1549cd){_0xab611d['push'](_0xab611d['shift']());}};_0x37f5cf(++_0xc0cbc5);}(_0x1c64,0x19f));var _0x41c6=function(_0x42b33c,_0x11f9e4){_0x42b33c=_0x42b33c-0x0;var _0x14ea01=_0x1c64[_0x42b33c];return _0x14ea01;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x41c6('0x0'));var timeout=require(_0x41c6('0x1'));var express=require(_0x41c6('0x2'));var router=express[_0x41c6('0x3')]();var fs_extra=require(_0x41c6('0x4'));var auth=require(_0x41c6('0x5'));var interaction=require(_0x41c6('0x6'));var config=require(_0x41c6('0x7'));var controller=require(_0x41c6('0x8'));router['get']('/',auth[_0x41c6('0x9')](),controller[_0x41c6('0xa')]);router[_0x41c6('0xb')](_0x41c6('0xc'),auth[_0x41c6('0x9')](),controller[_0x41c6('0xd')]);router[_0x41c6('0xb')]('/:id/hoppers',auth[_0x41c6('0x9')](),controller[_0x41c6('0xe')]);router[_0x41c6('0xb')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x41c6('0xf')]);router[_0x41c6('0xb')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x41c6('0x10')]);router[_0x41c6('0xb')](_0x41c6('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router['get']('/:id/lists',auth[_0x41c6('0x9')](),controller['getLists']);router[_0x41c6('0xb')](_0x41c6('0x12'),auth[_0x41c6('0x9')](),controller[_0x41c6('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x41c6('0x14')]);router[_0x41c6('0x15')](_0x41c6('0x16'),auth[_0x41c6('0x9')](),controller[_0x41c6('0x17')]);router[_0x41c6('0x15')](_0x41c6('0x18'),auth[_0x41c6('0x9')](),controller['addLists']);router[_0x41c6('0x15')]('/:id/blacklists',auth[_0x41c6('0x9')](),controller[_0x41c6('0x19')]);router['put']('/:id',auth[_0x41c6('0x9')](),controller['update']);router[_0x41c6('0x1a')](_0x41c6('0xc'),auth['isAuthenticated'](),controller[_0x41c6('0x1b')]);router[_0x41c6('0x1a')](_0x41c6('0x18'),auth[_0x41c6('0x9')](),controller[_0x41c6('0x1c')]);router[_0x41c6('0x1a')]('/:id/blacklists',auth[_0x41c6('0x9')](),controller[_0x41c6('0x1d')]);module[_0x41c6('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index cbff88c..7c864fb 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 _0xc081=['TEXT','VIRTUAL','key','exports','STRING'];(function(_0x60157f,_0x22d244){var _0x109db1=function(_0x5cf069){while(--_0x5cf069){_0x60157f['push'](_0x60157f['shift']());}};_0x109db1(++_0x22d244);}(_0xc081,0x143));var _0x1c08=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xc081[_0x21f9c2];return _0x3da17f;};'use strict';var Sequelize=require('sequelize');module[_0x1c08('0x0')]={'key':{'type':Sequelize[_0x1c08('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1c08('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1c08('0x1')]},'name':{'type':Sequelize[_0x1c08('0x3')],'get':function(){return this['getDataValue'](_0x1c08('0x4'));}}}; \ No newline at end of file +var _0x89d7=['key','exports','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0x89d7,0x12d));var _0x789d=function(_0x322743,_0x3903b9){_0x322743=_0x322743-0x0;var _0x13de4d=_0x89d7[_0x322743];return _0x13de4d;};'use strict';var Sequelize=require('sequelize');module[_0x789d('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x789d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x789d('0x2')]},'name':{'type':Sequelize[_0x789d('0x3')],'get':function(){return this[_0x789d('0x4')](_0x789d('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index a59b7a6..7635d86 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 _0xf188=['destroy','then','get','CannedAnswers','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xf188,0x8c));var _0x8f18=function(_0x579d37,_0x378bc1){_0x579d37=_0x579d37-0x0;var _0x431c5b=_0xf188[_0x579d37];return _0x431c5b;};'use strict';var emlformat=require(_0x8f18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f18('0x2'));var BPromise=require(_0x8f18('0x3'));var Mustache=require('mustache');var util=require(_0x8f18('0x4'));var path=require(_0x8f18('0x5'));var sox=require(_0x8f18('0x6'));var csv=require(_0x8f18('0x7'));var ejs=require(_0x8f18('0x8'));var fs=require('fs');var fs_extra=require(_0x8f18('0x9'));var _=require(_0x8f18('0xa'));var squel=require(_0x8f18('0xb'));var crypto=require(_0x8f18('0xc'));var jsforce=require(_0x8f18('0xd'));var deskjs=require(_0x8f18('0xe'));var toCsv=require(_0x8f18('0x7'));var querystring=require('querystring');var Papa=require(_0x8f18('0xf'));var Redis=require(_0x8f18('0x10'));var authService=require(_0x8f18('0x11'));var qs=require(_0x8f18('0x12'));var as=require(_0x8f18('0x13'));var hardwareService=require(_0x8f18('0x14'));var logger=require(_0x8f18('0x15'))(_0x8f18('0x16'));var utils=require(_0x8f18('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8f18('0x18'));var db=require(_0x8f18('0x19'))['db'];function respondWithStatusCode(_0x1f83ba,_0x4a17ab){_0x4a17ab=_0x4a17ab||0xcc;return function(_0x45ca90){if(_0x45ca90){return _0x1f83ba[_0x8f18('0x1a')](_0x4a17ab);}return _0x1f83ba[_0x8f18('0x1b')](_0x4a17ab)[_0x8f18('0x1c')]();};}function respondWithResult(_0x2ab3f4,_0xaa5b68){_0xaa5b68=_0xaa5b68||0xc8;return function(_0x426799){if(_0x426799){return _0x2ab3f4['status'](_0xaa5b68)[_0x8f18('0x1d')](_0x426799);}};}function respondWithFilteredResult(_0xb46859,_0xb5c6aa){return function(_0xf154b2){if(_0xf154b2){var _0x52f2ce=typeof _0xb5c6aa[_0x8f18('0x1e')]==='undefined'&&typeof _0xb5c6aa[_0x8f18('0x1f')]==='undefined';var _0x5b5e13=_0xf154b2[_0x8f18('0x20')];var _0x5401eb=_0x52f2ce?0x0:_0xb5c6aa['offset'];var _0x1e09c0=_0x52f2ce?_0xf154b2[_0x8f18('0x20')]:_0xb5c6aa[_0x8f18('0x1e')]+_0xb5c6aa[_0x8f18('0x1f')];var _0x50bf4d;if(_0x1e09c0>=_0x5b5e13){_0x1e09c0=_0x5b5e13;_0x50bf4d=0xc8;}else{_0x50bf4d=0xce;}_0xb46859[_0x8f18('0x1b')](_0x50bf4d);return _0xb46859[_0x8f18('0x21')](_0x8f18('0x22'),_0x5401eb+'-'+_0x1e09c0+'/'+_0x5b5e13)[_0x8f18('0x1d')](_0xf154b2);}return null;};}function patchUpdates(_0x4c86c9){return function(_0x106166){try{jsonpatch[_0x8f18('0x23')](_0x106166,_0x4c86c9,!![]);}catch(_0x5122f4){return BPromise['reject'](_0x5122f4);}return _0x106166['save']();};}function saveUpdates(_0x38defb,_0x4f87b5){return function(_0x396241){if(_0x396241){return _0x396241['update'](_0x38defb)['then'](function(_0x2bdd0f){return _0x2bdd0f;});}return null;};}function removeEntity(_0x297ccc,_0x423b3a){return function(_0x2a4066){if(_0x2a4066){return _0x2a4066[_0x8f18('0x24')]()[_0x8f18('0x25')](function(){var _0x3dc979=_0x2a4066[_0x8f18('0x26')]({'plain':!![]});var _0x6c536b=_0x8f18('0x27');return db[_0x8f18('0x28')][_0x8f18('0x24')]({'where':{'type':_0x6c536b,'resourceId':_0x3dc979['id']}})[_0x8f18('0x25')](function(){return _0x2a4066;});})[_0x8f18('0x25')](function(){_0x297ccc[_0x8f18('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277281,_0x2822f2){return function(_0x4dba87){if(!_0x4dba87){_0x277281[_0x8f18('0x1a')](0x194);}return _0x4dba87;};}function handleError(_0x1450fb,_0x5bbf05){_0x5bbf05=_0x5bbf05||0x1f4;return function(_0xb5e20f){logger[_0x8f18('0x29')](_0xb5e20f[_0x8f18('0x2a')]);if(_0xb5e20f['name']){delete _0xb5e20f['name'];}_0x1450fb[_0x8f18('0x1b')](_0x5bbf05)[_0x8f18('0x2b')](_0xb5e20f);};}exports[_0x8f18('0x2c')]=function(_0x5c9f70,_0x14bf47){var _0x41e970={},_0x282933={},_0x421c75={'count':0x0,'rows':[]};var _0x48479a=_[_0x8f18('0x2d')](db['CannedAnswer'][_0x8f18('0x2e')],function(_0x3ea112){return{'name':_0x3ea112[_0x8f18('0x2f')],'type':_0x3ea112[_0x8f18('0x30')]['key']};});_0x282933[_0x8f18('0x31')]=_[_0x8f18('0x2d')](_0x48479a,_0x8f18('0x32'));_0x282933['query']=_[_0x8f18('0x33')](_0x5c9f70[_0x8f18('0x34')]);_0x282933[_0x8f18('0x35')]=_[_0x8f18('0x36')](_0x282933['model'],_0x282933[_0x8f18('0x34')]);_0x41e970[_0x8f18('0x37')]=_[_0x8f18('0x36')](_0x282933['model'],qs[_0x8f18('0x38')](_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x38')]));_0x41e970[_0x8f18('0x37')]=_0x41e970[_0x8f18('0x37')][_0x8f18('0x39')]?_0x41e970[_0x8f18('0x37')]:_0x282933[_0x8f18('0x31')];if(!_0x5c9f70['query'][_0x8f18('0x3a')](_0x8f18('0x3b'))){_0x41e970[_0x8f18('0x1f')]=qs[_0x8f18('0x1f')](_0x5c9f70['query'][_0x8f18('0x1f')]);_0x41e970[_0x8f18('0x1e')]=qs[_0x8f18('0x1e')](_0x5c9f70[_0x8f18('0x34')]['offset']);}_0x41e970['order']=qs[_0x8f18('0x3c')](_0x5c9f70[_0x8f18('0x34')]['sort']);_0x41e970[_0x8f18('0x3d')]=qs['filters'](_[_0x8f18('0x3e')](_0x5c9f70[_0x8f18('0x34')],_0x282933[_0x8f18('0x35')]),_0x48479a);if(_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x3f')]){_0x41e970[_0x8f18('0x3d')]=_[_0x8f18('0x40')](_0x41e970[_0x8f18('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x3f')]+'%'}},{'value':{'$like':'%'+_0x5c9f70[_0x8f18('0x34')]['filter']+'%'}}]});}_0x41e970=_['merge']({},_0x41e970,_0x5c9f70[_0x8f18('0x41')]);var _0x36558a={'where':_0x41e970[_0x8f18('0x3d')]};return db[_0x8f18('0x42')]['count'](_0x36558a)[_0x8f18('0x25')](function(_0x2ba4f4){_0x421c75['count']=_0x2ba4f4;if(_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x43')]){_0x41e970['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8f18('0x44')](_0x41e970);})['then'](function(_0xfe3c3b){_0x421c75[_0x8f18('0x45')]=_0xfe3c3b;return _0x421c75;})[_0x8f18('0x25')](respondWithFilteredResult(_0x14bf47,_0x41e970))[_0x8f18('0x46')](handleError(_0x14bf47,null));};exports['show']=function(_0x10be9b,_0x3c04ec){var _0x5afece={'raw':!![],'where':{'id':_0x10be9b[_0x8f18('0x47')]['id']}},_0x5879df={};_0x5879df[_0x8f18('0x31')]=_[_0x8f18('0x33')](db[_0x8f18('0x42')][_0x8f18('0x2e')]);_0x5879df[_0x8f18('0x34')]=_[_0x8f18('0x33')](_0x10be9b[_0x8f18('0x34')]);_0x5879df['filters']=_[_0x8f18('0x36')](_0x5879df[_0x8f18('0x31')],_0x5879df['query']);_0x5afece['attributes']=_[_0x8f18('0x36')](_0x5879df[_0x8f18('0x31')],qs[_0x8f18('0x38')](_0x10be9b[_0x8f18('0x34')][_0x8f18('0x38')]));_0x5afece[_0x8f18('0x37')]=_0x5afece[_0x8f18('0x37')]['length']?_0x5afece[_0x8f18('0x37')]:_0x5879df['model'];if(_0x10be9b[_0x8f18('0x34')][_0x8f18('0x43')]){_0x5afece['include']=[{'all':!![]}];}_0x5afece=_['merge']({},_0x5afece,_0x10be9b['options']);return db[_0x8f18('0x42')][_0x8f18('0x48')](_0x5afece)[_0x8f18('0x25')](handleEntityNotFound(_0x3c04ec,null))[_0x8f18('0x25')](respondWithResult(_0x3c04ec,null))[_0x8f18('0x46')](handleError(_0x3c04ec,null));};exports['update']=function(_0x4f0c05,_0x2c6b4c){if(_0x4f0c05[_0x8f18('0x49')]['id']){delete _0x4f0c05['body']['id'];}return db[_0x8f18('0x42')]['find']({'where':{'id':_0x4f0c05[_0x8f18('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c6b4c,null))[_0x8f18('0x25')](saveUpdates(_0x4f0c05['body'],null))['then'](respondWithResult(_0x2c6b4c,null))[_0x8f18('0x46')](handleError(_0x2c6b4c,null));};exports[_0x8f18('0x24')]=function(_0x3e6e8e,_0x59f282){return db[_0x8f18('0x42')]['find']({'where':{'id':_0x3e6e8e[_0x8f18('0x47')]['id']}})[_0x8f18('0x25')](handleEntityNotFound(_0x59f282,null))['then'](removeEntity(_0x59f282,null))['catch'](handleError(_0x59f282,null));};exports[_0x8f18('0x4a')]=function(_0x2f0c0c,_0x59522d){var _0xaa8ee3={'key':_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4b')]};if(_0x2f0c0c[_0x8f18('0x49')]['MailAccountId']){_0xaa8ee3[_0x8f18('0x4c')]=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4c')];}else if(_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4d')]){_0xaa8ee3[_0x8f18('0x4d')]=_0x2f0c0c['body'][_0x8f18('0x4d')];}else if(_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4e')]){_0xaa8ee3['OpenchannelAccountId']=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4e')];}else if(_0x2f0c0c['body']['ChatWebsiteId']){_0xaa8ee3[_0x8f18('0x4f')]=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4f')];}return db[_0x8f18('0x42')][_0x8f18('0x48')]({'where':_0xaa8ee3})['then'](function(_0x331056){if(_0x331056){throw new db[(_0x8f18('0x50'))][(_0x8f18('0x51'))](_0x8f18('0x52'));}return db[_0x8f18('0x42')][_0x8f18('0x4a')](_0x2f0c0c[_0x8f18('0x49')]);})[_0x8f18('0x25')](function(_0x3874e6){var _0x432a29=_0x2f0c0c[_0x8f18('0x53')][_0x8f18('0x26')]({'plain':!![]});if(!_0x432a29)throw new Error(_0x8f18('0x54'));if(_0x432a29['role']===_0x8f18('0x53')){var _0x162cb3=_0x3874e6[_0x8f18('0x26')]({'plain':!![]});return db[_0x8f18('0x55')]['find']({'where':{'name':_0x8f18('0x27'),'userProfileId':_0x432a29['userProfileId']},'raw':!![]})[_0x8f18('0x25')](function(_0x2248be){if(_0x2248be&&_0x2248be[_0x8f18('0x56')]===0x0){return db[_0x8f18('0x28')][_0x8f18('0x4a')]({'name':_0x162cb3[_0x8f18('0x32')],'resourceId':_0x162cb3['id'],'type':_0x2248be[_0x8f18('0x32')],'sectionId':_0x2248be['id']},{})[_0x8f18('0x25')](function(){return _0x3874e6;});}else{return _0x3874e6;}})[_0x8f18('0x46')](function(_0x516ed5){logger[_0x8f18('0x29')](_0x8f18('0x57'),_0x516ed5);throw _0x516ed5;});}return _0x3874e6;})[_0x8f18('0x25')](respondWithResult(_0x59522d,0xc9))[_0x8f18('0x46')](handleError(_0x59522d,null));}; \ No newline at end of file +var _0x9c5b=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','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','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x169a8a,_0x3526b1){var _0x2e8502=function(_0x4c37f3){while(--_0x4c37f3){_0x169a8a['push'](_0x169a8a['shift']());}};_0x2e8502(++_0x3526b1);}(_0x9c5b,0xfe));var _0xb9c5=function(_0x716de7,_0x234dc5){_0x716de7=_0x716de7-0x0;var _0x55791c=_0x9c5b[_0x716de7];return _0x55791c;};'use strict';var emlformat=require(_0xb9c5('0x0'));var rimraf=require(_0xb9c5('0x1'));var zipdir=require(_0xb9c5('0x2'));var jsonpatch=require(_0xb9c5('0x3'));var rp=require(_0xb9c5('0x4'));var moment=require(_0xb9c5('0x5'));var BPromise=require(_0xb9c5('0x6'));var Mustache=require(_0xb9c5('0x7'));var util=require('util');var path=require(_0xb9c5('0x8'));var sox=require(_0xb9c5('0x9'));var csv=require(_0xb9c5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9c5('0xb'));var _=require('lodash');var squel=require(_0xb9c5('0xc'));var crypto=require('crypto');var jsforce=require(_0xb9c5('0xd'));var deskjs=require(_0xb9c5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb9c5('0xf'));var Redis=require(_0xb9c5('0x10'));var authService=require(_0xb9c5('0x11'));var qs=require(_0xb9c5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9c5('0x13'));var logger=require('../../config/logger')(_0xb9c5('0x14'));var utils=require(_0xb9c5('0x15'));var config=require(_0xb9c5('0x16'));var licenseUtil=require(_0xb9c5('0x17'));var db=require(_0xb9c5('0x18'))['db'];function respondWithStatusCode(_0x49d560,_0x2563cc){_0x2563cc=_0x2563cc||0xcc;return function(_0x118229){if(_0x118229){return _0x49d560[_0xb9c5('0x19')](_0x2563cc);}return _0x49d560[_0xb9c5('0x1a')](_0x2563cc)[_0xb9c5('0x1b')]();};}function respondWithResult(_0x15c7ec,_0x32bffd){_0x32bffd=_0x32bffd||0xc8;return function(_0x24fc06){if(_0x24fc06){return _0x15c7ec[_0xb9c5('0x1a')](_0x32bffd)[_0xb9c5('0x1c')](_0x24fc06);}};}function respondWithFilteredResult(_0x339d82,_0x3a9693){return function(_0x10e782){if(_0x10e782){var _0x15b493=typeof _0x3a9693[_0xb9c5('0x1d')]===_0xb9c5('0x1e')&&typeof _0x3a9693[_0xb9c5('0x1f')]===_0xb9c5('0x1e');var _0x38a8c6=_0x10e782[_0xb9c5('0x20')];var _0x35211b=_0x15b493?0x0:_0x3a9693['offset'];var _0x51a7f5=_0x15b493?_0x10e782[_0xb9c5('0x20')]:_0x3a9693[_0xb9c5('0x1d')]+_0x3a9693[_0xb9c5('0x1f')];var _0x1487e8;if(_0x51a7f5>=_0x38a8c6){_0x51a7f5=_0x38a8c6;_0x1487e8=0xc8;}else{_0x1487e8=0xce;}_0x339d82[_0xb9c5('0x1a')](_0x1487e8);return _0x339d82[_0xb9c5('0x21')]('Content-Range',_0x35211b+'-'+_0x51a7f5+'/'+_0x38a8c6)[_0xb9c5('0x1c')](_0x10e782);}return null;};}function patchUpdates(_0x3937f7){return function(_0xf70d6c){try{jsonpatch[_0xb9c5('0x22')](_0xf70d6c,_0x3937f7,!![]);}catch(_0x3b368c){return BPromise[_0xb9c5('0x23')](_0x3b368c);}return _0xf70d6c[_0xb9c5('0x24')]();};}function saveUpdates(_0x26129d,_0x509f09){return function(_0x30e5e5){if(_0x30e5e5){return _0x30e5e5[_0xb9c5('0x25')](_0x26129d)[_0xb9c5('0x26')](function(_0x56173c){return _0x56173c;});}return null;};}function removeEntity(_0x13f470,_0x6497c5){return function(_0x5c0f15){if(_0x5c0f15){return _0x5c0f15[_0xb9c5('0x27')]()['then'](function(){var _0xcc05e1=_0x5c0f15[_0xb9c5('0x28')]({'plain':!![]});var _0x1dc033='CannedAnswers';return db['UserProfileResource'][_0xb9c5('0x27')]({'where':{'type':_0x1dc033,'resourceId':_0xcc05e1['id']}})[_0xb9c5('0x26')](function(){return _0x5c0f15;});})[_0xb9c5('0x26')](function(){_0x13f470[_0xb9c5('0x1a')](0xcc)[_0xb9c5('0x1b')]();});}};}function handleEntityNotFound(_0x17a0b5,_0x30d0dc){return function(_0x47fd1f){if(!_0x47fd1f){_0x17a0b5[_0xb9c5('0x19')](0x194);}return _0x47fd1f;};}function handleError(_0x15ebcf,_0x584639){_0x584639=_0x584639||0x1f4;return function(_0x200e65){logger[_0xb9c5('0x29')](_0x200e65[_0xb9c5('0x2a')]);if(_0x200e65[_0xb9c5('0x2b')]){delete _0x200e65[_0xb9c5('0x2b')];}_0x15ebcf['status'](_0x584639)[_0xb9c5('0x2c')](_0x200e65);};}exports[_0xb9c5('0x2d')]=function(_0x21099e,_0xc436fd){var _0x5761e7={},_0x228ef9={},_0x2f704a={'count':0x0,'rows':[]};var _0x58b46a=_[_0xb9c5('0x2e')](db[_0xb9c5('0x2f')][_0xb9c5('0x30')],function(_0x293205){return{'name':_0x293205[_0xb9c5('0x31')],'type':_0x293205[_0xb9c5('0x32')][_0xb9c5('0x33')]};});_0x228ef9[_0xb9c5('0x34')]=_['map'](_0x58b46a,_0xb9c5('0x2b'));_0x228ef9['query']=_['keys'](_0x21099e[_0xb9c5('0x35')]);_0x228ef9[_0xb9c5('0x36')]=_['intersection'](_0x228ef9[_0xb9c5('0x34')],_0x228ef9[_0xb9c5('0x35')]);_0x5761e7[_0xb9c5('0x37')]=_[_0xb9c5('0x38')](_0x228ef9[_0xb9c5('0x34')],qs[_0xb9c5('0x39')](_0x21099e[_0xb9c5('0x35')]['fields']));_0x5761e7[_0xb9c5('0x37')]=_0x5761e7[_0xb9c5('0x37')][_0xb9c5('0x3a')]?_0x5761e7['attributes']:_0x228ef9[_0xb9c5('0x34')];if(!_0x21099e[_0xb9c5('0x35')][_0xb9c5('0x3b')](_0xb9c5('0x3c'))){_0x5761e7[_0xb9c5('0x1f')]=qs[_0xb9c5('0x1f')](_0x21099e[_0xb9c5('0x35')]['limit']);_0x5761e7[_0xb9c5('0x1d')]=qs['offset'](_0x21099e[_0xb9c5('0x35')][_0xb9c5('0x1d')]);}_0x5761e7['order']=qs['sort'](_0x21099e[_0xb9c5('0x35')][_0xb9c5('0x3d')]);_0x5761e7[_0xb9c5('0x3e')]=qs[_0xb9c5('0x36')](_[_0xb9c5('0x3f')](_0x21099e[_0xb9c5('0x35')],_0x228ef9[_0xb9c5('0x36')]),_0x58b46a);if(_0x21099e['query']['filter']){_0x5761e7[_0xb9c5('0x3e')]=_['merge'](_0x5761e7[_0xb9c5('0x3e')],{'$or':[{'key':{'$like':'%'+_0x21099e[_0xb9c5('0x35')][_0xb9c5('0x40')]+'%'}},{'value':{'$like':'%'+_0x21099e[_0xb9c5('0x35')][_0xb9c5('0x40')]+'%'}}]});}_0x5761e7=_[_0xb9c5('0x41')]({},_0x5761e7,_0x21099e[_0xb9c5('0x42')]);var _0x332634={'where':_0x5761e7['where']};return db[_0xb9c5('0x2f')]['count'](_0x332634)[_0xb9c5('0x26')](function(_0x4583b1){_0x2f704a[_0xb9c5('0x20')]=_0x4583b1;if(_0x21099e[_0xb9c5('0x35')][_0xb9c5('0x43')]){_0x5761e7['include']=[{'all':!![]}];}return db[_0xb9c5('0x2f')][_0xb9c5('0x44')](_0x5761e7);})[_0xb9c5('0x26')](function(_0x3c3479){_0x2f704a[_0xb9c5('0x45')]=_0x3c3479;return _0x2f704a;})[_0xb9c5('0x26')](respondWithFilteredResult(_0xc436fd,_0x5761e7))[_0xb9c5('0x46')](handleError(_0xc436fd,null));};exports[_0xb9c5('0x47')]=function(_0x1b81bb,_0x3966ad){var _0x49a880={'raw':!![],'where':{'id':_0x1b81bb['params']['id']}},_0x2348b7={};_0x2348b7[_0xb9c5('0x34')]=_[_0xb9c5('0x48')](db[_0xb9c5('0x2f')][_0xb9c5('0x30')]);_0x2348b7['query']=_[_0xb9c5('0x48')](_0x1b81bb[_0xb9c5('0x35')]);_0x2348b7[_0xb9c5('0x36')]=_[_0xb9c5('0x38')](_0x2348b7[_0xb9c5('0x34')],_0x2348b7['query']);_0x49a880['attributes']=_['intersection'](_0x2348b7[_0xb9c5('0x34')],qs[_0xb9c5('0x39')](_0x1b81bb[_0xb9c5('0x35')]['fields']));_0x49a880[_0xb9c5('0x37')]=_0x49a880['attributes'][_0xb9c5('0x3a')]?_0x49a880[_0xb9c5('0x37')]:_0x2348b7[_0xb9c5('0x34')];if(_0x1b81bb[_0xb9c5('0x35')]['includeAll']){_0x49a880[_0xb9c5('0x49')]=[{'all':!![]}];}_0x49a880=_[_0xb9c5('0x41')]({},_0x49a880,_0x1b81bb[_0xb9c5('0x42')]);return db[_0xb9c5('0x2f')][_0xb9c5('0x4a')](_0x49a880)[_0xb9c5('0x26')](handleEntityNotFound(_0x3966ad,null))['then'](respondWithResult(_0x3966ad,null))[_0xb9c5('0x46')](handleError(_0x3966ad,null));};exports[_0xb9c5('0x25')]=function(_0x6be6ae,_0x2b8080){if(_0x6be6ae['body']['id']){delete _0x6be6ae[_0xb9c5('0x4b')]['id'];}return db[_0xb9c5('0x2f')][_0xb9c5('0x4a')]({'where':{'id':_0x6be6ae['params']['id']}})[_0xb9c5('0x26')](handleEntityNotFound(_0x2b8080,null))[_0xb9c5('0x26')](saveUpdates(_0x6be6ae[_0xb9c5('0x4b')],null))['then'](respondWithResult(_0x2b8080,null))[_0xb9c5('0x46')](handleError(_0x2b8080,null));};exports['destroy']=function(_0xeb0a22,_0x5d5943){return db[_0xb9c5('0x2f')][_0xb9c5('0x4a')]({'where':{'id':_0xeb0a22['params']['id']}})[_0xb9c5('0x26')](handleEntityNotFound(_0x5d5943,null))[_0xb9c5('0x26')](removeEntity(_0x5d5943,null))[_0xb9c5('0x46')](handleError(_0x5d5943,null));};exports[_0xb9c5('0x4c')]=function(_0x17293f,_0x4e2a2e){var _0xb4056c={'key':_0x17293f[_0xb9c5('0x4b')]['key']};if(_0x17293f[_0xb9c5('0x4b')][_0xb9c5('0x4d')]){_0xb4056c[_0xb9c5('0x4d')]=_0x17293f[_0xb9c5('0x4b')][_0xb9c5('0x4d')];}else if(_0x17293f['body'][_0xb9c5('0x4e')]){_0xb4056c[_0xb9c5('0x4e')]=_0x17293f['body'][_0xb9c5('0x4e')];}else if(_0x17293f[_0xb9c5('0x4b')][_0xb9c5('0x4f')]){_0xb4056c['OpenchannelAccountId']=_0x17293f[_0xb9c5('0x4b')][_0xb9c5('0x4f')];}else if(_0x17293f['body'][_0xb9c5('0x50')]){_0xb4056c[_0xb9c5('0x50')]=_0x17293f[_0xb9c5('0x4b')][_0xb9c5('0x50')];}return db[_0xb9c5('0x2f')][_0xb9c5('0x4a')]({'where':_0xb4056c})['then'](function(_0x2d200e){if(_0x2d200e){throw new db[(_0xb9c5('0x51'))][(_0xb9c5('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xb9c5('0x2f')][_0xb9c5('0x4c')](_0x17293f[_0xb9c5('0x4b')]);})[_0xb9c5('0x26')](function(_0x5d203c){var _0x3e5d6c=_0x17293f[_0xb9c5('0x53')][_0xb9c5('0x28')]({'plain':!![]});if(!_0x3e5d6c)throw new Error(_0xb9c5('0x54'));if(_0x3e5d6c[_0xb9c5('0x55')]===_0xb9c5('0x53')){var _0x3aeac3=_0x5d203c[_0xb9c5('0x28')]({'plain':!![]});return db[_0xb9c5('0x56')][_0xb9c5('0x4a')]({'where':{'name':_0xb9c5('0x57'),'userProfileId':_0x3e5d6c[_0xb9c5('0x58')]},'raw':!![]})[_0xb9c5('0x26')](function(_0x537e48){if(_0x537e48&&_0x537e48['autoAssociation']===0x0){return db[_0xb9c5('0x59')]['create']({'name':_0x3aeac3[_0xb9c5('0x2b')],'resourceId':_0x3aeac3['id'],'type':_0x537e48[_0xb9c5('0x2b')],'sectionId':_0x537e48['id']},{})['then'](function(){return _0x5d203c;});}else{return _0x5d203c;}})[_0xb9c5('0x46')](function(_0x2a3040){logger['error'](_0xb9c5('0x5a'),_0x2a3040);throw _0x2a3040;});}return _0x5d203c;})[_0xb9c5('0x26')](respondWithResult(_0x4e2a2e,0xc9))[_0xb9c5('0x46')](handleError(_0x4e2a2e,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index bc922bc..2329d0d 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 _0xea10=['rimraf','../../config/environment','./cannedAnswer.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xea10,0x95));var _0x0ea1=function(_0x32abbe,_0x4649c2){_0x32abbe=_0x32abbe-0x0;var _0x40ea67=_0xea10[_0x32abbe];return _0x40ea67;};'use strict';var _=require(_0x0ea1('0x0'));var util=require(_0x0ea1('0x1'));var logger=require('../../config/logger')(_0x0ea1('0x2'));var moment=require(_0x0ea1('0x3'));var BPromise=require(_0x0ea1('0x4'));var rp=require(_0x0ea1('0x5'));var fs=require('fs');var path=require(_0x0ea1('0x6'));var rimraf=require(_0x0ea1('0x7'));var config=require(_0x0ea1('0x8'));var attributes=require(_0x0ea1('0x9'));module['exports']=function(_0xd81f3e,_0xeb349b){return _0xd81f3e['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ea1('0xa'),'collate':_0x0ea1('0xb')});}; \ No newline at end of file +var _0xbeec=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','tools_canned_answers','utf8mb4'];(function(_0x12335e,_0x277b1a){var _0x379c60=function(_0x45198c){while(--_0x45198c){_0x12335e['push'](_0x12335e['shift']());}};_0x379c60(++_0x277b1a);}(_0xbeec,0x135));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcbee('0x0'));var util=require(_0xcbee('0x1'));var logger=require(_0xcbee('0x2'))(_0xcbee('0x3'));var moment=require(_0xcbee('0x4'));var BPromise=require(_0xcbee('0x5'));var rp=require(_0xcbee('0x6'));var fs=require('fs');var path=require(_0xcbee('0x7'));var rimraf=require(_0xcbee('0x8'));var config=require(_0xcbee('0x9'));var attributes=require(_0xcbee('0xa'));module['exports']=function(_0x505803,_0x5036af){return _0x505803['define']('CannedAnswer',attributes,{'tableName':_0xcbee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcbee('0xc'),'collate':_0xcbee('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index b8a2eaa..e27597d 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(_0x4e8a09,_0x3f02ec){var _0x23b670=function(_0x27b3bc){while(--_0x27b3bc){_0x4e8a09['push'](_0x4e8a09['shift']());}};_0x23b670(++_0x3f02ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x36d703,_0x2198e3){var _0x45f48c=function(_0x39ad5d){while(--_0x39ad5d){_0x36d703['push'](_0x36d703['shift']());}};_0x45f48c(++_0x2198e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 f670c6d..1eb1b9d 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 _0x98a1=['./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x98a1,0x171));var _0x198a=function(_0x1cf1cc,_0x2e63b2){_0x1cf1cc=_0x1cf1cc-0x0;var _0x1d5fb8=_0x98a1[_0x1cf1cc];return _0x1d5fb8;};'use strict';var multer=require('multer');var util=require(_0x198a('0x0'));var path=require(_0x198a('0x1'));var timeout=require(_0x198a('0x2'));var express=require(_0x198a('0x3'));var router=express[_0x198a('0x4')]();var fs_extra=require(_0x198a('0x5'));var auth=require(_0x198a('0x6'));var interaction=require(_0x198a('0x7'));var config=require(_0x198a('0x8'));var controller=require(_0x198a('0x9'));router['get']('/',auth[_0x198a('0xa')](),controller[_0x198a('0xb')]);router[_0x198a('0xc')](_0x198a('0xd'),auth['isAuthenticated'](),controller[_0x198a('0xe')]);router[_0x198a('0xf')]('/',auth[_0x198a('0xa')](),controller['create']);router['put'](_0x198a('0xd'),auth['isAuthenticated'](),controller[_0x198a('0x10')]);router['delete'](_0x198a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x198a('0x11')]=router; \ No newline at end of file +var _0xb11b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5eb121,_0x35c4ce){var _0x499777=function(_0x1fe874){while(--_0x1fe874){_0x5eb121['push'](_0x5eb121['shift']());}};_0x499777(++_0x35c4ce);}(_0xb11b,0x1b5));var _0xbb11=function(_0x2e8791,_0x143f3e){_0x2e8791=_0x2e8791-0x0;var _0x19980e=_0xb11b[_0x2e8791];return _0x19980e;};'use strict';var multer=require(_0xbb11('0x0'));var util=require('util');var path=require(_0xbb11('0x1'));var timeout=require(_0xbb11('0x2'));var express=require(_0xbb11('0x3'));var router=express['Router']();var fs_extra=require(_0xbb11('0x4'));var auth=require(_0xbb11('0x5'));var interaction=require(_0xbb11('0x6'));var config=require(_0xbb11('0x7'));var controller=require(_0xbb11('0x8'));router[_0xbb11('0x9')]('/',auth[_0xbb11('0xa')](),controller[_0xbb11('0xb')]);router[_0xbb11('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbb11('0xc')]);router[_0xbb11('0xd')]('/',auth['isAuthenticated'](),controller[_0xbb11('0xe')]);router[_0xbb11('0xf')](_0xbb11('0x10'),auth[_0xbb11('0xa')](),controller[_0xbb11('0x11')]);router[_0xbb11('0x12')](_0xbb11('0x10'),auth[_0xbb11('0xa')](),controller[_0xbb11('0x13')]);module[_0xbb11('0x14')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index e954256..17853bc 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 _0x138d=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x143558,_0x2e9f17){var _0x426caa=function(_0x5b2213){while(--_0x5b2213){_0x143558['push'](_0x143558['shift']());}};_0x426caa(++_0x2e9f17);}(_0x138d,0x1ab));var _0xd138=function(_0x325a08,_0x571fff){_0x325a08=_0x325a08-0x0;var _0x436e01=_0x138d[_0x325a08];return _0x436e01;};'use strict';var Sequelize=require(_0xd138('0x0'));module[_0xd138('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd138('0x2')},'clid':{'type':Sequelize[_0xd138('0x3')]},'src':{'type':Sequelize[_0xd138('0x3')]},'dst':{'type':Sequelize[_0xd138('0x3')]},'dcontext':{'type':Sequelize[_0xd138('0x3')]},'channel':{'type':Sequelize[_0xd138('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd138('0x3')]},'lastdata':{'type':Sequelize[_0xd138('0x3')]},'duration':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd138('0x3')]},'amaflags':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd138('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xd138('0x3')]},'sequence':{'type':Sequelize[_0xd138('0x3')]},'peeraccount':{'type':Sequelize[_0xd138('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xd138('0x3')]}}; \ No newline at end of file +var _0x04b8=['INTEGER','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x2c7a60,_0x378818){var _0x29813b=function(_0x265fe8){while(--_0x265fe8){_0x2c7a60['push'](_0x2c7a60['shift']());}};_0x29813b(++_0x378818);}(_0x04b8,0x159));var _0x804b=function(_0x4e31da,_0x1f8308){_0x4e31da=_0x4e31da-0x0;var _0x30651d=_0x04b8[_0x4e31da];return _0x30651d;};'use strict';var Sequelize=require('sequelize');module[_0x804b('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x804b('0x1')},'clid':{'type':Sequelize[_0x804b('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x804b('0x2')]},'dcontext':{'type':Sequelize[_0x804b('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x804b('0x2')]},'lastapp':{'type':Sequelize[_0x804b('0x2')]},'lastdata':{'type':Sequelize[_0x804b('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x804b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x804b('0x2')]},'amaflags':{'type':Sequelize[_0x804b('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x804b('0x2')]},'uniqueid':{'type':Sequelize[_0x804b('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x804b('0x2')]},'peeraccount':{'type':Sequelize[_0x804b('0x2')]},'type':{'type':Sequelize[_0x804b('0x2')]},'tag':{'type':Sequelize[_0x804b('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 17fbd33..de3773f 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 _0x3c6c=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x2cf37f,_0x2217b7){var _0x1bd369=function(_0x12d071){while(--_0x12d071){_0x2cf37f['push'](_0x2cf37f['shift']());}};_0x1bd369(++_0x2217b7);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x161a85,_0x5740c5){_0x161a85=_0x161a85-0x0;var _0x427798=_0x3c6c[_0x161a85];return _0x427798;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={},_0xb047b1={},_0x4571f4={'count':0x0,'rows':[]};var _0x31975e=_[_0xc3c6('0x29')](db['Cdr'][_0xc3c6('0x2a')],function(_0x1bcc34){return{'name':_0x1bcc34[_0xc3c6('0x2b')],'type':_0x1bcc34[_0xc3c6('0x2c')][_0xc3c6('0x2d')]};});_0xb047b1[_0xc3c6('0x2e')]=_['map'](_0x31975e,_0xc3c6('0x26'));_0xb047b1[_0xc3c6('0x2f')]=_[_0xc3c6('0x30')](_0x2e4094[_0xc3c6('0x2f')]);_0xb047b1[_0xc3c6('0x31')]=_['intersection'](_0xb047b1[_0xc3c6('0x2e')],_0xb047b1[_0xc3c6('0x2f')]);_0x478a4b[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0xb047b1[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x2e4094[_0xc3c6('0x2f')]['fields']));_0x478a4b[_0xc3c6('0x32')]=_0x478a4b['attributes'][_0xc3c6('0x35')]?_0x478a4b[_0xc3c6('0x32')]:_0xb047b1[_0xc3c6('0x2e')];if(!_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x36')](_0xc3c6('0x37'))){_0x478a4b['limit']=qs[_0xc3c6('0x1a')](_0x2e4094[_0xc3c6('0x2f')]['limit']);_0x478a4b[_0xc3c6('0x18')]=qs[_0xc3c6('0x18')](_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x18')]);}_0x478a4b[_0xc3c6('0x38')]=qs[_0xc3c6('0x39')](_0x2e4094[_0xc3c6('0x2f')]['sort']);_0x478a4b['where']=qs[_0xc3c6('0x31')](_[_0xc3c6('0x3a')](_0x2e4094[_0xc3c6('0x2f')],_0xb047b1[_0xc3c6('0x31')]),_0x31975e);if(_0x2e4094[_0xc3c6('0x2f')]['filter']){_0x478a4b[_0xc3c6('0x3b')]=_[_0xc3c6('0x3c')](_0x478a4b[_0xc3c6('0x3b')],{'$or':_[_0xc3c6('0x29')](_0x31975e,function(_0x1eb423){if(_0x1eb423[_0xc3c6('0x2c')]!==_0xc3c6('0x3d')){var _0xada6f={};_0xada6f[_0x1eb423[_0xc3c6('0x26')]]={'$like':'%'+_0x2e4094['query'][_0xc3c6('0x3e')]+'%'};return _0xada6f;}})});}_0x478a4b=_[_0xc3c6('0x3c')]({},_0x478a4b,_0x2e4094[_0xc3c6('0x3f')]);var _0x316605={'where':_0x478a4b[_0xc3c6('0x3b')]};return db[_0xc3c6('0x40')][_0xc3c6('0x1b')](_0x316605)[_0xc3c6('0x23')](function(_0x59b2d9){_0x4571f4[_0xc3c6('0x1b')]=_0x59b2d9;if(_0x2e4094[_0xc3c6('0x2f')]['includeAll']){_0x478a4b[_0xc3c6('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xc3c6('0x42')](_0x478a4b);})[_0xc3c6('0x23')](function(_0x25bb1e){_0x4571f4[_0xc3c6('0x43')]=_0x25bb1e;return _0x4571f4;})[_0xc3c6('0x23')](respondWithFilteredResult(_0x1f1d36,_0x478a4b))[_0xc3c6('0x44')](handleError(_0x1f1d36,null));};exports[_0xc3c6('0x45')]=function(_0x998388,_0x572339){var _0xda8652={'raw':!![],'where':{'id':_0x998388[_0xc3c6('0x46')]['id']}},_0x570d11={};_0x570d11[_0xc3c6('0x2e')]=_[_0xc3c6('0x30')](db[_0xc3c6('0x40')]['rawAttributes']);_0x570d11['query']=_[_0xc3c6('0x30')](_0x998388[_0xc3c6('0x2f')]);_0x570d11[_0xc3c6('0x31')]=_[_0xc3c6('0x33')](_0x570d11['model'],_0x570d11[_0xc3c6('0x2f')]);_0xda8652[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0x570d11[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x34')]));_0xda8652['attributes']=_0xda8652['attributes'][_0xc3c6('0x35')]?_0xda8652[_0xc3c6('0x32')]:_0x570d11['model'];if(_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x47')]){_0xda8652['include']=[{'all':!![]}];}_0xda8652=_[_0xc3c6('0x3c')]({},_0xda8652,_0x998388[_0xc3c6('0x3f')]);return db['Cdr'][_0xc3c6('0x48')](_0xda8652)[_0xc3c6('0x23')](handleEntityNotFound(_0x572339,null))[_0xc3c6('0x23')](respondWithResult(_0x572339,null))[_0xc3c6('0x44')](handleError(_0x572339,null));};exports[_0xc3c6('0x49')]=function(_0x333698,_0x508731){return db[_0xc3c6('0x40')][_0xc3c6('0x49')](_0x333698[_0xc3c6('0x4a')],{})[_0xc3c6('0x23')](respondWithResult(_0x508731,0xc9))[_0xc3c6('0x44')](handleError(_0x508731,null));};exports[_0xc3c6('0x21')]=function(_0x21b8a0,_0x55b8bc){if(_0x21b8a0['body']['id']){delete _0x21b8a0[_0xc3c6('0x4a')]['id'];}return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x21b8a0[_0xc3c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b8bc,null))['then'](saveUpdates(_0x21b8a0[_0xc3c6('0x4a')],null))[_0xc3c6('0x23')](respondWithResult(_0x55b8bc,null))[_0xc3c6('0x44')](handleError(_0x55b8bc,null));};exports[_0xc3c6('0x22')]=function(_0x34ed73,_0x313277){return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x34ed73[_0xc3c6('0x46')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x313277,null))[_0xc3c6('0x23')](removeEntity(_0x313277,null))[_0xc3c6('0x44')](handleError(_0x313277,null));};exports[_0xc3c6('0x4b')]=function(_0xc84c69,_0xad293e){return db[_0xc3c6('0x40')]['describe']()[_0xc3c6('0x23')](respondWithResult(_0xad293e,null))[_0xc3c6('0x44')](handleError(_0xad293e,null));}; \ No newline at end of file +var _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xf767,0x76));var _0x7f76=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xf767[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 62bdacb..7c3db44 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xd5aef5,_0x1c0460){var _0xe67900=function(_0x9d33f4){while(--_0x9d33f4){_0xd5aef5['push'](_0xd5aef5['shift']());}};_0xe67900(++_0x1c0460);}(_0x7a54,0x106));var _0x47a5=function(_0x48afef,_0x298040){_0x48afef=_0x48afef-0x0;var _0x1dba70=_0x7a54[_0x48afef];return _0x1dba70;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5b733b,_0x159ffb){var _0x342a62=function(_0x322bae){while(--_0x322bae){_0x5b733b['push'](_0x5b733b['shift']());}};_0x342a62(++_0x159ffb);}(_0x7a54,0x106));var _0x47a5=function(_0x579971,_0x3dd8b3){_0x579971=_0x579971-0x0;var _0x17843f=_0x7a54[_0x579971];return _0x17843f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index a6194f7..7b7f812 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 _0xad31=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xad31,0x1d3));var _0x1ad3=function(_0x31881f,_0x5c505b){_0x31881f=_0x31881f-0x0;var _0x52c79a=_0xad31[_0x31881f];return _0x52c79a;};'use strict';var _=require(_0x1ad3('0x0'));var util=require(_0x1ad3('0x1'));var moment=require(_0x1ad3('0x2'));var BPromise=require(_0x1ad3('0x3'));var rs=require(_0x1ad3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ad3('0x5'))['db'];var utils=require(_0x1ad3('0x6'));var logger=require(_0x1ad3('0x7'))(_0x1ad3('0x8'));var config=require(_0x1ad3('0x9'));var jayson=require(_0x1ad3('0xa'));var client=jayson[_0x1ad3('0xb')][_0x1ad3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2079a4,_0x53ecde,_0x499cba){return new BPromise(function(_0x43cf92,_0x23c76a){return client[_0x1ad3('0xd')](_0x2079a4,_0x499cba)[_0x1ad3('0xe')](function(_0x420704){logger[_0x1ad3('0xf')](_0x1ad3('0x10'),_0x53ecde,_0x1ad3('0x11'));logger[_0x1ad3('0x12')](_0x1ad3('0x13'),_0x53ecde,_0x1ad3('0x11'),JSON['stringify'](_0x420704));if(_0x420704['error']){if(_0x420704['error'][_0x1ad3('0x14')]===0x1f4){logger[_0x1ad3('0x15')](_0x1ad3('0x10'),_0x53ecde,_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);return _0x23c76a(_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);}logger['error'](_0x1ad3('0x10'),_0x53ecde,_0x420704[_0x1ad3('0x15')]['message']);return _0x43cf92(_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);}else{logger[_0x1ad3('0xf')]('Cdr,\x20%s,\x20%s',_0x53ecde,'request\x20sent');_0x43cf92(_0x420704[_0x1ad3('0x17')][_0x1ad3('0x16')]);}})[_0x1ad3('0x18')](function(_0x2f99f5){logger['error'](_0x1ad3('0x10'),_0x53ecde,_0x2f99f5);_0x23c76a(_0x2f99f5);});});} \ No newline at end of file +var _0x129c=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x129c,0x1cf));var _0xc129=function(_0x5982d3,_0x2acc17){_0x5982d3=_0x5982d3-0x0;var _0x1d51f0=_0x129c[_0x5982d3];return _0x1d51f0;};'use strict';var _=require('lodash');var util=require(_0xc129('0x0'));var moment=require(_0xc129('0x1'));var BPromise=require(_0xc129('0x2'));var rs=require(_0xc129('0x3'));var fs=require('fs');var Redis=require(_0xc129('0x4'));var db=require(_0xc129('0x5'))['db'];var utils=require(_0xc129('0x6'));var logger=require(_0xc129('0x7'))(_0xc129('0x8'));var config=require('../../config/environment');var jayson=require(_0xc129('0x9'));var client=jayson[_0xc129('0xa')][_0xc129('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52949d,_0x3bd4b2,_0x4fc9ca){return new BPromise(function(_0x525e32,_0x4824ed){return client['request'](_0x52949d,_0x4fc9ca)[_0xc129('0xc')](function(_0x23cbb6){logger[_0xc129('0xd')](_0xc129('0xe'),_0x3bd4b2,_0xc129('0xf'));logger[_0xc129('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x3bd4b2,_0xc129('0xf'),JSON[_0xc129('0x11')](_0x23cbb6));if(_0x23cbb6[_0xc129('0x12')]){if(_0x23cbb6['error'][_0xc129('0x13')]===0x1f4){logger['error'](_0xc129('0xe'),_0x3bd4b2,_0x23cbb6[_0xc129('0x12')][_0xc129('0x14')]);return _0x4824ed(_0x23cbb6[_0xc129('0x12')][_0xc129('0x14')]);}logger[_0xc129('0x12')]('Cdr,\x20%s,\x20%s',_0x3bd4b2,_0x23cbb6[_0xc129('0x12')][_0xc129('0x14')]);return _0x525e32(_0x23cbb6['error']['message']);}else{logger[_0xc129('0xd')](_0xc129('0xe'),_0x3bd4b2,_0xc129('0xf'));_0x525e32(_0x23cbb6[_0xc129('0x15')]['message']);}})['catch'](function(_0xeae56d){logger[_0xc129('0x12')](_0xc129('0xe'),_0x3bd4b2,_0xeae56d);_0x4824ed(_0xeae56d);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 62c374a..d09d83e 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xffa654,_0x4c734){var _0x5dd847=function(_0x64173a){while(--_0x64173a){_0xffa654['push'](_0xffa654['shift']());}};_0x5dd847(++_0x4c734);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index ec854f1..886dc1c 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 _0x4c6b=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x4c6b,0xf0));var _0xb4c6=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x4c6b[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require('sequelize');module[_0xb4c6('0x0')]={'priority':{'type':Sequelize[_0xb4c6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4c6('0x2')],'allowNull':![],'defaultValue':_0xb4c6('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb4c6('0x2')]},'interval':{'type':Sequelize[_0xb4c6('0x2')],'defaultValue':_0xb4c6('0x4')}}; \ No newline at end of file +var _0xf58e=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x35cace,_0x2596bd){var _0x2e4814=function(_0xc66532){while(--_0xc66532){_0x35cace['push'](_0x35cace['shift']());}};_0x2e4814(++_0x2596bd);}(_0xf58e,0x1ba));var _0xef58=function(_0x18d67c,_0x5b939d){_0x18d67c=_0x18d67c-0x0;var _0x128838=_0xf58e[_0x18d67c];return _0x128838;};'use strict';var Sequelize=require(_0xef58('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xef58('0x1')],'allowNull':![],'defaultValue':_0xef58('0x2')},'appdata':{'type':Sequelize[_0xef58('0x3')]()},'description':{'type':Sequelize[_0xef58('0x1')]},'interval':{'type':Sequelize[_0xef58('0x1')],'defaultValue':_0xef58('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 17a6a36..aa3e7ad 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 _0x97c1=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','show','rawAttributes','keys','query','intersection','attributes','model','fields','includeAll','include','merge','options','ChatApplication','catch','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x582c18,_0x19969a){var _0x485f24=function(_0xdfad1d){while(--_0xdfad1d){_0x582c18['push'](_0x582c18['shift']());}};_0x485f24(++_0x19969a);}(_0x97c1,0xdf));var _0x197c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x2911dd,_0x2b6319){return function(_0x499051){if(!_0x499051){_0x2911dd[_0x197c('0x26')](0x194);}return _0x499051;};}function handleError(_0x3331ac,_0x4c3337){_0x4c3337=_0x4c3337||0x1f4;return function(_0x5e7bc9){logger[_0x197c('0x27')](_0x5e7bc9['stack']);if(_0x5e7bc9[_0x197c('0x28')]){delete _0x5e7bc9[_0x197c('0x28')];}_0x3331ac[_0x197c('0x17')](_0x4c3337)[_0x197c('0x29')](_0x5e7bc9);};}exports[_0x197c('0x2a')]=function(_0x3cdcd8,_0x2b6154){var _0x215df1={'raw':!![],'where':{'id':_0x3cdcd8['params']['id']}},_0x4422d1={};_0x4422d1['model']=_['keys'](db['ChatApplication'][_0x197c('0x2b')]);_0x4422d1['query']=_[_0x197c('0x2c')](_0x3cdcd8[_0x197c('0x2d')]);_0x4422d1['filters']=_[_0x197c('0x2e')](_0x4422d1['model'],_0x4422d1[_0x197c('0x2d')]);_0x215df1[_0x197c('0x2f')]=_[_0x197c('0x2e')](_0x4422d1[_0x197c('0x30')],qs[_0x197c('0x31')](_0x3cdcd8[_0x197c('0x2d')][_0x197c('0x31')]));_0x215df1[_0x197c('0x2f')]=_0x215df1[_0x197c('0x2f')]['length']?_0x215df1['attributes']:_0x4422d1[_0x197c('0x30')];if(_0x3cdcd8[_0x197c('0x2d')][_0x197c('0x32')]){_0x215df1[_0x197c('0x33')]=[{'all':!![]}];}_0x215df1=_[_0x197c('0x34')]({},_0x215df1,_0x3cdcd8[_0x197c('0x35')]);return db[_0x197c('0x36')]['find'](_0x215df1)['then'](handleEntityNotFound(_0x2b6154,null))[_0x197c('0x24')](respondWithResult(_0x2b6154,null))[_0x197c('0x37')](handleError(_0x2b6154,null));};exports['update']=function(_0x5bebe7,_0x3cdaa1){if(_0x5bebe7[_0x197c('0x38')]['id']){delete _0x5bebe7[_0x197c('0x38')]['id'];}return db[_0x197c('0x36')][_0x197c('0x39')]({'where':{'id':_0x5bebe7[_0x197c('0x3a')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x3cdaa1,null))[_0x197c('0x24')](saveUpdates(_0x5bebe7[_0x197c('0x38')],null))['then'](respondWithResult(_0x3cdaa1,null))[_0x197c('0x37')](handleError(_0x3cdaa1,null));};exports[_0x197c('0x25')]=function(_0x358900,_0x41269e){return db[_0x197c('0x36')][_0x197c('0x39')]({'where':{'id':_0x358900['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x41269e,null))[_0x197c('0x24')](removeEntity(_0x41269e,null))[_0x197c('0x37')](handleError(_0x41269e,null));}; \ No newline at end of file +var _0xe130=['error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','catch','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then'];(function(_0x23012b,_0x5151a4){var _0x2889de=function(_0x4b9216){while(--_0x4b9216){_0x23012b['push'](_0x23012b['shift']());}};_0x2889de(++_0x5151a4);}(_0xe130,0x127));var _0x0e13=function(_0x3b76fb,_0x14575c){_0x3b76fb=_0x3b76fb-0x0;var _0x438d81=_0xe130[_0x3b76fb];return _0x438d81;};'use strict';var emlformat=require(_0x0e13('0x0'));var rimraf=require(_0x0e13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e13('0x2'));var rp=require(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require(_0x0e13('0x5'));var Mustache=require(_0x0e13('0x6'));var util=require('util');var path=require(_0x0e13('0x7'));var sox=require(_0x0e13('0x8'));var csv=require(_0x0e13('0x9'));var ejs=require(_0x0e13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e13('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e13('0xc'));var toCsv=require(_0x0e13('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e13('0xd'));var authService=require(_0x0e13('0xe'));var qs=require(_0x0e13('0xf'));var as=require(_0x0e13('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e13('0x11'));var utils=require(_0x0e13('0x12'));var config=require(_0x0e13('0x13'));var licenseUtil=require(_0x0e13('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4391,_0x4d9ea0){_0x4d9ea0=_0x4d9ea0||0xcc;return function(_0x2ef77e){if(_0x2ef77e){return _0x1b4391[_0x0e13('0x15')](_0x4d9ea0);}return _0x1b4391[_0x0e13('0x16')](_0x4d9ea0)[_0x0e13('0x17')]();};}function respondWithResult(_0x2f0d82,_0x1ec6ad){_0x1ec6ad=_0x1ec6ad||0xc8;return function(_0x27c3cf){if(_0x27c3cf){return _0x2f0d82[_0x0e13('0x16')](_0x1ec6ad)[_0x0e13('0x18')](_0x27c3cf);}};}function respondWithFilteredResult(_0x530f82,_0x302763){return function(_0xbc1617){if(_0xbc1617){var _0x2057fe=typeof _0x302763[_0x0e13('0x19')]===_0x0e13('0x1a')&&typeof _0x302763[_0x0e13('0x1b')]==='undefined';var _0x11ec50=_0xbc1617[_0x0e13('0x1c')];var _0x510a2b=_0x2057fe?0x0:_0x302763['offset'];var _0x3b85fd=_0x2057fe?_0xbc1617['count']:_0x302763[_0x0e13('0x19')]+_0x302763['limit'];var _0x294aea;if(_0x3b85fd>=_0x11ec50){_0x3b85fd=_0x11ec50;_0x294aea=0xc8;}else{_0x294aea=0xce;}_0x530f82[_0x0e13('0x16')](_0x294aea);return _0x530f82[_0x0e13('0x1d')](_0x0e13('0x1e'),_0x510a2b+'-'+_0x3b85fd+'/'+_0x11ec50)[_0x0e13('0x18')](_0xbc1617);}return null;};}function patchUpdates(_0x5ef062){return function(_0x5cfba8){try{jsonpatch['apply'](_0x5cfba8,_0x5ef062,!![]);}catch(_0x2dddef){return BPromise[_0x0e13('0x1f')](_0x2dddef);}return _0x5cfba8['save']();};}function saveUpdates(_0x515222,_0x295eb0){return function(_0x296ed3){if(_0x296ed3){return _0x296ed3[_0x0e13('0x20')](_0x515222)['then'](function(_0x400e87){return _0x400e87;});}return null;};}function removeEntity(_0x70c3db,_0x22cc15){return function(_0x20303b){if(_0x20303b){return _0x20303b[_0x0e13('0x21')]()[_0x0e13('0x22')](function(){_0x70c3db[_0x0e13('0x16')](0xcc)[_0x0e13('0x17')]();});}};}function handleEntityNotFound(_0x3d6abf,_0x260bf7){return function(_0x9621e2){if(!_0x9621e2){_0x3d6abf[_0x0e13('0x15')](0x194);}return _0x9621e2;};}function handleError(_0x230684,_0x45edf7){_0x45edf7=_0x45edf7||0x1f4;return function(_0xfd19ed){logger[_0x0e13('0x23')](_0xfd19ed[_0x0e13('0x24')]);if(_0xfd19ed['name']){delete _0xfd19ed[_0x0e13('0x25')];}_0x230684[_0x0e13('0x16')](_0x45edf7)[_0x0e13('0x26')](_0xfd19ed);};}exports['show']=function(_0x2182ae,_0x1deb3b){var _0xa38940={'raw':!![],'where':{'id':_0x2182ae['params']['id']}},_0x4606de={};_0x4606de[_0x0e13('0x27')]=_[_0x0e13('0x28')](db[_0x0e13('0x29')][_0x0e13('0x2a')]);_0x4606de[_0x0e13('0x2b')]=_[_0x0e13('0x28')](_0x2182ae[_0x0e13('0x2b')]);_0x4606de[_0x0e13('0x2c')]=_['intersection'](_0x4606de[_0x0e13('0x27')],_0x4606de[_0x0e13('0x2b')]);_0xa38940[_0x0e13('0x2d')]=_['intersection'](_0x4606de[_0x0e13('0x27')],qs[_0x0e13('0x2e')](_0x2182ae[_0x0e13('0x2b')][_0x0e13('0x2e')]));_0xa38940[_0x0e13('0x2d')]=_0xa38940[_0x0e13('0x2d')][_0x0e13('0x2f')]?_0xa38940[_0x0e13('0x2d')]:_0x4606de[_0x0e13('0x27')];if(_0x2182ae['query'][_0x0e13('0x30')]){_0xa38940[_0x0e13('0x31')]=[{'all':!![]}];}_0xa38940=_[_0x0e13('0x32')]({},_0xa38940,_0x2182ae['options']);return db[_0x0e13('0x29')]['find'](_0xa38940)[_0x0e13('0x22')](handleEntityNotFound(_0x1deb3b,null))[_0x0e13('0x22')](respondWithResult(_0x1deb3b,null))[_0x0e13('0x33')](handleError(_0x1deb3b,null));};exports[_0x0e13('0x20')]=function(_0x2e313a,_0x4036d4){if(_0x2e313a[_0x0e13('0x34')]['id']){delete _0x2e313a['body']['id'];}return db['ChatApplication'][_0x0e13('0x35')]({'where':{'id':_0x2e313a[_0x0e13('0x36')]['id']}})[_0x0e13('0x22')](handleEntityNotFound(_0x4036d4,null))[_0x0e13('0x22')](saveUpdates(_0x2e313a[_0x0e13('0x34')],null))[_0x0e13('0x22')](respondWithResult(_0x4036d4,null))[_0x0e13('0x33')](handleError(_0x4036d4,null));};exports['destroy']=function(_0x304cde,_0x445abf){return db[_0x0e13('0x29')][_0x0e13('0x35')]({'where':{'id':_0x304cde[_0x0e13('0x36')]['id']}})['then'](handleEntityNotFound(_0x445abf,null))[_0x0e13('0x22')](removeEntity(_0x445abf,null))[_0x0e13('0x33')](handleError(_0x445abf,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d6346c0..063e020 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 _0xeb0d=['../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','lodash','moment','bluebird','path','rimraf'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x50d7c7,_0x3cef1d){_0x50d7c7=_0x50d7c7-0x0;var _0x5cb0f5=_0xeb0d[_0x50d7c7];return _0x5cb0f5;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdeb0('0x1'));var BPromise=require(_0xdeb0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb0('0x3'));var rimraf=require(_0xdeb0('0x4'));var config=require(_0xdeb0('0x5'));var attributes=require(_0xdeb0('0x6'));module[_0xdeb0('0x7')]=function(_0x13d486,_0xc48108){return _0x13d486[_0xdeb0('0x8')]('ChatApplication',attributes,{'tableName':_0xdeb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb0('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7764=['moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatApplication','chat_applications','lodash','util','../../config/logger','api'];(function(_0x49e66,_0x43f4b9){var _0x545549=function(_0x18b28f){while(--_0x18b28f){_0x49e66['push'](_0x49e66['shift']());}};_0x545549(++_0x43f4b9);}(_0x7764,0xa4));var _0x4776=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0x7764[_0x555ebb];return _0x3c0a4a;};'use strict';var _=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var logger=require(_0x4776('0x2'))(_0x4776('0x3'));var moment=require(_0x4776('0x4'));var BPromise=require(_0x4776('0x5'));var rp=require(_0x4776('0x6'));var fs=require('fs');var path=require(_0x4776('0x7'));var rimraf=require(_0x4776('0x8'));var config=require(_0x4776('0x9'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0xc431bf,_0x3eff9c){return _0xc431bf['define'](_0x4776('0xa'),attributes,{'tableName':_0x4776('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 8283254..cb4b515 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 _0xea9b=['../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3452d1,_0x2be075){var _0x4a6a2c=function(_0x20620a){while(--_0x20620a){_0x3452d1['push'](_0x3452d1['shift']());}};_0x4a6a2c(++_0x2be075);}(_0xea9b,0xdf));var _0xbea9=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0xea9b[_0x162780];return _0x1ea2dc;};'use strict';var _=require('lodash');var util=require(_0xbea9('0x0'));var moment=require('moment');var BPromise=require(_0xbea9('0x1'));var rs=require(_0xbea9('0x2'));var fs=require('fs');var Redis=require(_0xbea9('0x3'));var db=require(_0xbea9('0x4'))['db'];var utils=require(_0xbea9('0x5'));var logger=require(_0xbea9('0x6'))(_0xbea9('0x7'));var config=require(_0xbea9('0x8'));var jayson=require(_0xbea9('0x9'));var client=jayson[_0xbea9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf563e5,_0x5d47c6,_0x101e5b){return new BPromise(function(_0x403fe5,_0x3a1f7a){return client[_0xbea9('0xb')](_0xf563e5,_0x101e5b)['then'](function(_0x2b2818){logger[_0xbea9('0xc')](_0xbea9('0xd'),_0x5d47c6,'request\x20sent');logger[_0xbea9('0xe')](_0xbea9('0xf'),_0x5d47c6,_0xbea9('0x10'),JSON[_0xbea9('0x11')](_0x2b2818));if(_0x2b2818[_0xbea9('0x12')]){if(_0x2b2818[_0xbea9('0x12')]['code']===0x1f4){logger['error'](_0xbea9('0xd'),_0x5d47c6,_0x2b2818[_0xbea9('0x12')]['message']);return _0x3a1f7a(_0x2b2818['error'][_0xbea9('0x13')]);}logger[_0xbea9('0x12')](_0xbea9('0xd'),_0x5d47c6,_0x2b2818[_0xbea9('0x12')]['message']);return _0x403fe5(_0x2b2818[_0xbea9('0x12')][_0xbea9('0x13')]);}else{logger['info'](_0xbea9('0xd'),_0x5d47c6,_0xbea9('0x10'));_0x403fe5(_0x2b2818['result'][_0xbea9('0x13')]);}})[_0xbea9('0x14')](function(_0xa72f3c){logger[_0xbea9('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5d47c6,_0xa72f3c);_0x3a1f7a(_0xa72f3c);});});} \ No newline at end of file +var _0xfac4=['error','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0xfac4,0x1e3));var _0x4fac=function(_0x4a816a,_0x434689){_0x4a816a=_0x4a816a-0x0;var _0x46db5f=_0xfac4[_0x4a816a];return _0x46db5f;};'use strict';var _=require(_0x4fac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4fac('0x1'));var rs=require(_0x4fac('0x2'));var fs=require('fs');var Redis=require(_0x4fac('0x3'));var db=require(_0x4fac('0x4'))['db'];var utils=require(_0x4fac('0x5'));var logger=require('../../config/logger')(_0x4fac('0x6'));var config=require(_0x4fac('0x7'));var jayson=require(_0x4fac('0x8'));var client=jayson[_0x4fac('0x9')][_0x4fac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b0ec5,_0x37d3d1,_0x459df5){return new BPromise(function(_0x1d2701,_0x298868){return client[_0x4fac('0xb')](_0x5b0ec5,_0x459df5)[_0x4fac('0xc')](function(_0x5eba18){logger[_0x4fac('0xd')](_0x4fac('0xe'),_0x37d3d1,'request\x20sent');logger['debug'](_0x4fac('0xf'),_0x37d3d1,'request\x20sent',JSON[_0x4fac('0x10')](_0x5eba18));if(_0x5eba18['error']){if(_0x5eba18[_0x4fac('0x11')]['code']===0x1f4){logger[_0x4fac('0x11')](_0x4fac('0xe'),_0x37d3d1,_0x5eba18[_0x4fac('0x11')]['message']);return _0x298868(_0x5eba18[_0x4fac('0x11')][_0x4fac('0x12')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x37d3d1,_0x5eba18[_0x4fac('0x11')][_0x4fac('0x12')]);return _0x1d2701(_0x5eba18[_0x4fac('0x11')][_0x4fac('0x12')]);}else{logger[_0x4fac('0xd')](_0x4fac('0xe'),_0x37d3d1,'request\x20sent');_0x1d2701(_0x5eba18[_0x4fac('0x13')][_0x4fac('0x12')]);}})['catch'](function(_0x5271c7){logger[_0x4fac('0x11')](_0x4fac('0xe'),_0x37d3d1,_0x5271c7);_0x298868(_0x5271c7);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index a48ddd7..b7391b2 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 _0xd0d4=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy'];(function(_0x14f53b,_0x3fea28){var _0x10b218=function(_0x3813e6){while(--_0x3813e6){_0x14f53b['push'](_0x14f53b['shift']());}};_0x10b218(++_0x3fea28);}(_0xd0d4,0x18d));var _0x4d0d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd0d4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4d0d('0x0'));var util=require(_0x4d0d('0x1'));var path=require('path');var timeout=require(_0x4d0d('0x2'));var express=require(_0x4d0d('0x3'));var router=express[_0x4d0d('0x4')]();var fs_extra=require(_0x4d0d('0x5'));var auth=require(_0x4d0d('0x6'));var interaction=require(_0x4d0d('0x7'));var config=require(_0x4d0d('0x8'));var controller=require(_0x4d0d('0x9'));router[_0x4d0d('0xa')]('/:id',auth[_0x4d0d('0xb')](),controller[_0x4d0d('0xc')]);router[_0x4d0d('0xd')](_0x4d0d('0xe'),auth[_0x4d0d('0xb')](),controller[_0x4d0d('0xf')]);router['delete'](_0x4d0d('0xe'),auth[_0x4d0d('0xb')](),controller[_0x4d0d('0x10')]);module[_0x4d0d('0x11')]=router; \ No newline at end of file +var _0x085a=['get','/:id','isAuthenticated','put','update','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x317dd9,_0x599846){var _0xba50ec=function(_0x457b4e){while(--_0x457b4e){_0x317dd9['push'](_0x317dd9['shift']());}};_0xba50ec(++_0x599846);}(_0x085a,0x1b9));var _0xa085=function(_0x3c2a3c,_0x26edd9){_0x3c2a3c=_0x3c2a3c-0x0;var _0xb37c9e=_0x085a[_0x3c2a3c];return _0xb37c9e;};'use strict';var multer=require(_0xa085('0x0'));var util=require('util');var path=require(_0xa085('0x1'));var timeout=require('connect-timeout');var express=require(_0xa085('0x2'));var router=express[_0xa085('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa085('0x4'));var config=require(_0xa085('0x5'));var controller=require(_0xa085('0x6'));router[_0xa085('0x7')](_0xa085('0x8'),auth[_0xa085('0x9')](),controller['show']);router[_0xa085('0xa')](_0xa085('0x8'),auth[_0xa085('0x9')](),controller[_0xa085('0xb')]);router['delete'](_0xa085('0x8'),auth[_0xa085('0x9')](),controller[_0xa085('0xc')]);module[_0xa085('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 2f80b4d..6b49cb8 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 _0x87b4=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87b4,0xaa));var _0x487b=function(_0x4d4a09,_0x2ce4b3){_0x4d4a09=_0x4d4a09-0x0;var _0xc3ab96=_0x87b4[_0x4d4a09];return _0xc3ab96;};'use strict';var Sequelize=require(_0x487b('0x0'));module[_0x487b('0x1')]={'name':{'type':Sequelize[_0x487b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x487b('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6657=['STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x49eb34,_0x1ae5f8){_0x49eb34=_0x49eb34-0x0;var _0x2220af=_0x6657[_0x49eb34];return _0x2220af;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7665('0x1')]},'write':{'type':Sequelize[_0x7665('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 0050927..fd3b495 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 _0xbcb5=['catch','show','rawAttributes','length','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','removeMembers','ChatGroupId','getMessages','$gte','format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows'];(function(_0x4f18a4,_0x4522ea){var _0x23a9bc=function(_0x3302a3){while(--_0x3302a3){_0x4f18a4['push'](_0x4f18a4['shift']());}};_0x23a9bc(++_0x4522ea);}(_0xbcb5,0x134));var _0x5bcb=function(_0x2aa36f,_0x2e549e){_0x2aa36f=_0x2aa36f-0x0;var _0x5f5a0c=_0xbcb5[_0x2aa36f];return _0x5f5a0c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5bcb('0x0'));var jsonpatch=require(_0x5bcb('0x1'));var rp=require('request-promise');var moment=require(_0x5bcb('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5bcb('0x3'));var path=require(_0x5bcb('0x4'));var sox=require(_0x5bcb('0x5'));var csv=require('to-csv');var ejs=require(_0x5bcb('0x6'));var fs=require('fs');var fs_extra=require(_0x5bcb('0x7'));var _=require(_0x5bcb('0x8'));var squel=require('squel');var crypto=require(_0x5bcb('0x9'));var jsforce=require(_0x5bcb('0xa'));var deskjs=require(_0x5bcb('0xb'));var toCsv=require(_0x5bcb('0xc'));var querystring=require(_0x5bcb('0xd'));var Papa=require(_0x5bcb('0xe'));var Redis=require(_0x5bcb('0xf'));var authService=require(_0x5bcb('0x10'));var qs=require(_0x5bcb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bcb('0x12'));var logger=require('../../config/logger')(_0x5bcb('0x13'));var utils=require(_0x5bcb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5bcb('0x15'));var db=require(_0x5bcb('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5bcb('0x17'),'port':0x18eb});var socket=require(_0x5bcb('0x18'))(new Redis(config[_0x5bcb('0x19')]));require('./chatGroup.socket')[_0x5bcb('0x1a')](socket);function respondWithStatusCode(_0xedf2ab,_0xbaa5f4){_0xbaa5f4=_0xbaa5f4||0xcc;return function(_0x237a66){if(_0x237a66){return _0xedf2ab[_0x5bcb('0x1b')](_0xbaa5f4);}return _0xedf2ab[_0x5bcb('0x1c')](_0xbaa5f4)[_0x5bcb('0x1d')]();};}function respondWithResult(_0x265220,_0x42a397){_0x42a397=_0x42a397||0xc8;return function(_0x19f2a0){if(_0x19f2a0){return _0x265220[_0x5bcb('0x1c')](_0x42a397)[_0x5bcb('0x1e')](_0x19f2a0);}};}function respondWithFilteredResult(_0x1e3cf6,_0x5edde5){return function(_0x308e35){if(_0x308e35){var _0x522250=typeof _0x5edde5[_0x5bcb('0x1f')]===_0x5bcb('0x20')&&typeof _0x5edde5[_0x5bcb('0x21')]===_0x5bcb('0x20');var _0x164310=_0x308e35[_0x5bcb('0x22')];var _0x3bc3d4=_0x522250?0x0:_0x5edde5[_0x5bcb('0x1f')];var _0x10d056=_0x522250?_0x308e35[_0x5bcb('0x22')]:_0x5edde5['offset']+_0x5edde5[_0x5bcb('0x21')];var _0x3eaea6;if(_0x10d056>=_0x164310){_0x10d056=_0x164310;_0x3eaea6=0xc8;}else{_0x3eaea6=0xce;}_0x1e3cf6['status'](_0x3eaea6);return _0x1e3cf6[_0x5bcb('0x23')](_0x5bcb('0x24'),_0x3bc3d4+'-'+_0x10d056+'/'+_0x164310)[_0x5bcb('0x1e')](_0x308e35);}return null;};}function patchUpdates(_0x2172dd){return function(_0x3ca324){try{jsonpatch[_0x5bcb('0x25')](_0x3ca324,_0x2172dd,!![]);}catch(_0x1752ee){return BPromise[_0x5bcb('0x26')](_0x1752ee);}return _0x3ca324[_0x5bcb('0x27')]();};}function saveUpdates(_0x57ef9f,_0x513ab4){return function(_0x146e85){if(_0x146e85){return _0x146e85[_0x5bcb('0x28')](_0x57ef9f)[_0x5bcb('0x29')](function(_0x2308fe){return _0x2308fe;});}return null;};}function removeEntity(_0x28ac04,_0x1a8864){return function(_0x32fc45){if(_0x32fc45){return _0x32fc45[_0x5bcb('0x2a')]()[_0x5bcb('0x29')](function(){_0x28ac04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x263f21,_0x277fa6){return function(_0x2507cc){if(!_0x2507cc){_0x263f21[_0x5bcb('0x1b')](0x194);}return _0x2507cc;};}function handleError(_0x1ba918,_0x3199e9){_0x3199e9=_0x3199e9||0x1f4;return function(_0xc8d637){logger['error'](_0xc8d637['stack']);if(_0xc8d637['name']){delete _0xc8d637[_0x5bcb('0x2b')];}_0x1ba918[_0x5bcb('0x1c')](_0x3199e9)[_0x5bcb('0x2c')](_0xc8d637);};}exports[_0x5bcb('0x2d')]=function(_0xf09d0b,_0x2feeba){var _0x47560d={},_0x20cede={},_0x296f5b={'count':0x0,'rows':[]};var _0x290c51=_[_0x5bcb('0x2e')](db['ChatGroup']['rawAttributes'],function(_0x2826e3){return{'name':_0x2826e3[_0x5bcb('0x2f')],'type':_0x2826e3['type'][_0x5bcb('0x30')]};});_0x20cede[_0x5bcb('0x31')]=_['map'](_0x290c51,'name');_0x20cede['query']=_[_0x5bcb('0x32')](_0xf09d0b[_0x5bcb('0x33')]);_0x20cede[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x20cede[_0x5bcb('0x31')],_0x20cede[_0x5bcb('0x33')]);_0x47560d[_0x5bcb('0x36')]=_['intersection'](_0x20cede[_0x5bcb('0x31')],qs[_0x5bcb('0x37')](_0xf09d0b[_0x5bcb('0x33')]['fields']));_0x47560d['attributes']=_0x47560d[_0x5bcb('0x36')]['length']?_0x47560d[_0x5bcb('0x36')]:_0x20cede['model'];if(!_0xf09d0b['query'][_0x5bcb('0x38')](_0x5bcb('0x39'))){_0x47560d[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x21')]);_0x47560d[_0x5bcb('0x1f')]=qs['offset'](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}_0x47560d[_0x5bcb('0x3a')]=qs[_0x5bcb('0x3b')](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x3b')]);_0x47560d['where']=qs[_0x5bcb('0x34')](_[_0x5bcb('0x3c')](_0xf09d0b[_0x5bcb('0x33')],_0x20cede[_0x5bcb('0x34')]),_0x290c51);if(_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x3d')]){_0x47560d[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x47560d[_0x5bcb('0x3e')],{'$or':_[_0x5bcb('0x2e')](_0x290c51,function(_0x27ab6c){if(_0x27ab6c[_0x5bcb('0x40')]!==_0x5bcb('0x41')){var _0x3bd363={};_0x3bd363[_0x27ab6c[_0x5bcb('0x2b')]]={'$like':'%'+_0xf09d0b['query'][_0x5bcb('0x3d')]+'%'};return _0x3bd363;}})});}_0x47560d=_[_0x5bcb('0x3f')]({},_0x47560d,_0xf09d0b[_0x5bcb('0x42')]);var _0x169694={'where':_0x47560d[_0x5bcb('0x3e')]};return db[_0x5bcb('0x43')][_0x5bcb('0x22')](_0x169694)[_0x5bcb('0x29')](function(_0x2d9ed2){_0x296f5b[_0x5bcb('0x22')]=_0x2d9ed2;if(_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x44')]){_0x47560d[_0x5bcb('0x45')]=[{'all':!![]}];}return db[_0x5bcb('0x43')][_0x5bcb('0x46')](_0x47560d);})['then'](function(_0x10dabb){_0x296f5b[_0x5bcb('0x47')]=_0x10dabb;return _0x296f5b;})[_0x5bcb('0x29')](respondWithFilteredResult(_0x2feeba,_0x47560d))[_0x5bcb('0x48')](handleError(_0x2feeba,null));};exports[_0x5bcb('0x49')]=function(_0x30435c,_0x3d7b54){var _0x33bb6f={'raw':!![],'where':{'id':_0x30435c['params']['id']}},_0x2840de={};_0x2840de[_0x5bcb('0x31')]=_[_0x5bcb('0x32')](db[_0x5bcb('0x43')][_0x5bcb('0x4a')]);_0x2840de['query']=_[_0x5bcb('0x32')](_0x30435c[_0x5bcb('0x33')]);_0x2840de[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x2840de[_0x5bcb('0x31')],_0x2840de['query']);_0x33bb6f['attributes']=_[_0x5bcb('0x35')](_0x2840de[_0x5bcb('0x31')],qs['fields'](_0x30435c[_0x5bcb('0x33')][_0x5bcb('0x37')]));_0x33bb6f[_0x5bcb('0x36')]=_0x33bb6f['attributes'][_0x5bcb('0x4b')]?_0x33bb6f[_0x5bcb('0x36')]:_0x2840de['model'];if(_0x30435c[_0x5bcb('0x33')][_0x5bcb('0x44')]){_0x33bb6f[_0x5bcb('0x45')]=[{'all':!![]}];}_0x33bb6f=_[_0x5bcb('0x3f')]({},_0x33bb6f,_0x30435c[_0x5bcb('0x42')]);return db[_0x5bcb('0x43')][_0x5bcb('0x4c')](_0x33bb6f)[_0x5bcb('0x29')](handleEntityNotFound(_0x3d7b54,null))[_0x5bcb('0x29')](respondWithResult(_0x3d7b54,null))[_0x5bcb('0x48')](handleError(_0x3d7b54,null));};exports[_0x5bcb('0x4d')]=function(_0x2b34b1,_0x316030){return db['ChatGroup']['create'](_0x2b34b1['body'],{})[_0x5bcb('0x29')](respondWithResult(_0x316030,0xc9))[_0x5bcb('0x48')](handleError(_0x316030,null));};exports[_0x5bcb('0x28')]=function(_0x6046c2,_0x570897){if(_0x6046c2[_0x5bcb('0x4e')]['id']){delete _0x6046c2[_0x5bcb('0x4e')]['id'];}return db['ChatGroup'][_0x5bcb('0x4c')]({'where':{'id':_0x6046c2[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x570897,null))['then'](saveUpdates(_0x6046c2[_0x5bcb('0x4e')],null))[_0x5bcb('0x29')](respondWithResult(_0x570897,null))[_0x5bcb('0x48')](handleError(_0x570897,null));};exports['destroy']=function(_0x270f77,_0x343a95){return db['ChatGroup'][_0x5bcb('0x4c')]({'where':{'id':_0x270f77[_0x5bcb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x343a95,null))[_0x5bcb('0x29')](removeEntity(_0x343a95,null))[_0x5bcb('0x48')](handleError(_0x343a95,null));};exports['describe']=function(_0x11050a,_0x2eaf6b){return db[_0x5bcb('0x43')][_0x5bcb('0x50')]()[_0x5bcb('0x29')](respondWithResult(_0x2eaf6b,null))[_0x5bcb('0x48')](handleError(_0x2eaf6b,null));};exports[_0x5bcb('0x51')]=function(_0x14ce95,_0x4adc34,_0x33eaf5){return db[_0x5bcb('0x52')][_0x5bcb('0x22')]({'where':{'ChatGroupId':_0x14ce95[_0x5bcb('0x4f')]['id'],'ToId':_0x14ce95[_0x5bcb('0x53')]['id'],'read':![]}})['then'](function(_0x185b80){return{'id':_[_0x5bcb('0x54')](_0x14ce95[_0x5bcb('0x4f')]['id']),'count':_0x185b80};})[_0x5bcb('0x29')](respondWithResult(_0x4adc34,null))[_0x5bcb('0x48')](handleError(_0x4adc34,null));};exports[_0x5bcb('0x55')]=function(_0x25ed51,_0x4e0bee,_0x402b74){return db[_0x5bcb('0x43')][_0x5bcb('0x4c')]({'where':{'id':_0x25ed51[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x4e0bee,null))[_0x5bcb('0x29')](function(_0x2c0f77){if(_0x2c0f77){return _0x2c0f77[_0x5bcb('0x55')](_0x25ed51[_0x5bcb('0x4e')][_0x5bcb('0x56')],_[_0x5bcb('0x57')](_0x25ed51['body'],[_0x5bcb('0x56'),'id'])||{});}})[_0x5bcb('0x29')](respondWithResult(_0x4e0bee,null))[_0x5bcb('0x48')](handleError(_0x4e0bee,null));};exports['getMembers']=function(_0x525166,_0x4e1935,_0x471c83){var _0x350fbb={};var _0x3e448f={};var _0x34d407;var _0x26a65;return db['ChatGroup']['findOne']({'where':{'id':_0x525166[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x4e1935,null))[_0x5bcb('0x29')](function(_0x3648b0){if(_0x3648b0){_0x34d407=_0x3648b0;_0x3e448f[_0x5bcb('0x31')]=_[_0x5bcb('0x32')](db[_0x5bcb('0x58')][_0x5bcb('0x4a')]);_0x3e448f[_0x5bcb('0x33')]=_[_0x5bcb('0x32')](_0x525166['query']);_0x3e448f[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x3e448f[_0x5bcb('0x31')],_0x3e448f[_0x5bcb('0x33')]);_0x350fbb['attributes']=_[_0x5bcb('0x35')](_0x3e448f[_0x5bcb('0x31')],qs['fields'](_0x525166[_0x5bcb('0x33')]['fields']));_0x350fbb[_0x5bcb('0x36')]=_0x350fbb[_0x5bcb('0x36')][_0x5bcb('0x4b')]?_0x350fbb[_0x5bcb('0x36')]:_0x3e448f['model'];_0x350fbb[_0x5bcb('0x3a')]=qs['sort'](_0x525166[_0x5bcb('0x33')][_0x5bcb('0x3b')]);_0x350fbb[_0x5bcb('0x3e')]=qs[_0x5bcb('0x34')](_[_0x5bcb('0x3c')](_0x525166['query'],_0x3e448f[_0x5bcb('0x34')]));if(_0x525166['query'][_0x5bcb('0x3d')]){_0x350fbb[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x350fbb[_0x5bcb('0x3e')],{'$or':_['map'](_0x350fbb[_0x5bcb('0x36')],function(_0xabe3b5){var _0x27506e={};_0x27506e[_0xabe3b5]={'$like':'%'+_0x525166[_0x5bcb('0x33')][_0x5bcb('0x3d')]+'%'};return _0x27506e;})});}_0x350fbb=_[_0x5bcb('0x3f')]({},_0x350fbb,_0x525166['options']);return _0x34d407[_0x5bcb('0x59')](_0x350fbb);}})[_0x5bcb('0x29')](function(_0x44115b){if(_0x44115b){_0x26a65=_0x44115b[_0x5bcb('0x4b')];if(!_0x525166[_0x5bcb('0x33')][_0x5bcb('0x38')](_0x5bcb('0x39'))){_0x350fbb[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0x525166[_0x5bcb('0x33')]['limit']);_0x350fbb['offset']=qs[_0x5bcb('0x1f')](_0x525166[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}return _0x34d407['getMembers'](_0x350fbb);}})['then'](function(_0x5c7ace){if(_0x5c7ace){return _0x5c7ace?{'count':_0x26a65,'rows':_0x5c7ace}:null;}})['then'](respondWithResult(_0x4e1935,null))[_0x5bcb('0x48')](handleError(_0x4e1935,null));};exports[_0x5bcb('0x5a')]=function(_0x441a28,_0x186e1d,_0x25a317){return db[_0x5bcb('0x43')][_0x5bcb('0x4c')]({'where':{'id':_0x441a28[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x186e1d,null))['then'](function(_0x4ecdf6){if(_0x4ecdf6){return _0x4ecdf6[_0x5bcb('0x5a')](_0x441a28[_0x5bcb('0x33')][_0x5bcb('0x56')]);}})[_0x5bcb('0x29')](respondWithStatusCode(_0x186e1d,null))['catch'](handleError(_0x186e1d,null));};exports['addMessage']=function(_0x5ba6ac,_0x475779,_0x522b04){if(_0x5ba6ac['body']['id']){delete _0x5ba6ac[_0x5bcb('0x4e')]['id'];}return db[_0x5bcb('0x43')]['find']({'where':{'id':_0x5ba6ac['params']['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x475779,null))['then'](function(_0x1bd757){if(_0x1bd757){_0x5ba6ac['body'][_0x5bcb('0x5b')]=_0x1bd757['id'];return db[_0x5bcb('0x52')][_0x5bcb('0x4d')](_0x5ba6ac[_0x5bcb('0x4e')]);}})[_0x5bcb('0x29')](respondWithResult(_0x475779,null))[_0x5bcb('0x48')](handleError(_0x475779,null));};exports[_0x5bcb('0x5c')]=function(_0x2bfc1f,_0x29cf71,_0xb55a4f){var _0x583665={};var _0x5e656c={};var _0x240902;var _0x4347b6;return db['ChatGroup']['findOne']({'where':{'id':_0x2bfc1f['params']['id']}})['then'](handleEntityNotFound(_0x29cf71,null))['then'](function(_0xf0d662){if(_0xf0d662){_0x240902=_0xf0d662;_0x5e656c['model']=_[_0x5bcb('0x32')](db['ChatInternalMessage']['rawAttributes']);_0x5e656c[_0x5bcb('0x33')]=_['keys'](_0x2bfc1f[_0x5bcb('0x33')]);_0x5e656c['filters']=_[_0x5bcb('0x35')](_0x5e656c[_0x5bcb('0x31')],_0x5e656c[_0x5bcb('0x33')]);_0x583665[_0x5bcb('0x36')]=_[_0x5bcb('0x35')](_0x5e656c['model'],qs[_0x5bcb('0x37')](_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x37')]));_0x583665[_0x5bcb('0x36')]=_0x583665[_0x5bcb('0x36')]['length']?_0x583665['attributes']:_0x5e656c[_0x5bcb('0x31')];_0x583665['order']=qs[_0x5bcb('0x3b')](_0x2bfc1f['query'][_0x5bcb('0x3b')]);_0x583665[_0x5bcb('0x3e')]=qs[_0x5bcb('0x34')](_['pick'](_0x2bfc1f[_0x5bcb('0x33')],_0x5e656c['filters']));if(_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x3d')]){_0x583665[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x583665['where'],{'$or':_['map'](_0x583665[_0x5bcb('0x36')],function(_0x3cfb5a){var _0x8c54ed={};_0x8c54ed[_0x3cfb5a]={'$like':'%'+_0x2bfc1f['query'][_0x5bcb('0x3d')]+'%'};return _0x8c54ed;})});}if(_0x2bfc1f['query'][_0x5bcb('0x5d')]){var _0x4a8a6e=_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x5d')]['split'](',');var _0xe06610={};_0xe06610[_0x4a8a6e[0x0]]={'$gte':moment(_0x4a8a6e[0x1])[_0x5bcb('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x583665[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x583665['where'],_0xe06610);}_0x583665=_['merge']({},_0x583665,_0x2bfc1f[_0x5bcb('0x42')]);return _0x240902[_0x5bcb('0x5c')](_0x583665);}})[_0x5bcb('0x29')](function(_0x1ac874){if(_0x1ac874){_0x4347b6=_0x1ac874[_0x5bcb('0x4b')];if(!_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x38')]('nolimit')){_0x583665[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0x2bfc1f[_0x5bcb('0x33')]['limit']);_0x583665[_0x5bcb('0x1f')]=qs[_0x5bcb('0x1f')](_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}return _0x240902['getMessages'](_0x583665);}})[_0x5bcb('0x29')](function(_0x57c723){if(_0x57c723){return _0x57c723?{'count':_0x4347b6,'rows':_0x57c723}:null;}})[_0x5bcb('0x29')](respondWithResult(_0x29cf71,null))[_0x5bcb('0x48')](handleError(_0x29cf71,null));}; \ No newline at end of file +var _0x4e14=['catch','create','update','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','User','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','Content-Range','reject','destroy','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','count','findAll','show','params','includeAll','include','find'];(function(_0x439d05,_0x15c424){var _0x51f24f=function(_0x2775de){while(--_0x2775de){_0x439d05['push'](_0x439d05['shift']());}};_0x51f24f(++_0x15c424);}(_0x4e14,0x199));var _0x44e1=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x4e14[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x44e1('0x0'));var rimraf=require(_0x44e1('0x1'));var zipdir=require(_0x44e1('0x2'));var jsonpatch=require(_0x44e1('0x3'));var rp=require(_0x44e1('0x4'));var moment=require(_0x44e1('0x5'));var BPromise=require(_0x44e1('0x6'));var Mustache=require('mustache');var util=require(_0x44e1('0x7'));var path=require(_0x44e1('0x8'));var sox=require(_0x44e1('0x9'));var csv=require('to-csv');var ejs=require(_0x44e1('0xa'));var fs=require('fs');var fs_extra=require(_0x44e1('0xb'));var _=require('lodash');var squel=require(_0x44e1('0xc'));var crypto=require(_0x44e1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x44e1('0xe'));var toCsv=require(_0x44e1('0xf'));var querystring=require(_0x44e1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x44e1('0x11'));var as=require(_0x44e1('0x12'));var hardwareService=require(_0x44e1('0x13'));var logger=require(_0x44e1('0x14'))(_0x44e1('0x15'));var utils=require(_0x44e1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x44e1('0x17'));var db=require('../../mysqldb')['db'];config[_0x44e1('0x18')]=_[_0x44e1('0x19')](config[_0x44e1('0x18')],{'host':_0x44e1('0x1a'),'port':0x18eb});var socket=require(_0x44e1('0x1b'))(new Redis(config['redis']));require(_0x44e1('0x1c'))[_0x44e1('0x1d')](socket);function respondWithStatusCode(_0x2fe7bc,_0x289dc5){_0x289dc5=_0x289dc5||0xcc;return function(_0x5b2c31){if(_0x5b2c31){return _0x2fe7bc['sendStatus'](_0x289dc5);}return _0x2fe7bc[_0x44e1('0x1e')](_0x289dc5)[_0x44e1('0x1f')]();};}function respondWithResult(_0x3edb50,_0x1af6e1){_0x1af6e1=_0x1af6e1||0xc8;return function(_0x3ee197){if(_0x3ee197){return _0x3edb50['status'](_0x1af6e1)[_0x44e1('0x20')](_0x3ee197);}};}function respondWithFilteredResult(_0x323f36,_0x43bfbf){return function(_0x209bd4){if(_0x209bd4){var _0x22d682=typeof _0x43bfbf[_0x44e1('0x21')]===_0x44e1('0x22')&&typeof _0x43bfbf[_0x44e1('0x23')]===_0x44e1('0x22');var _0x42e839=_0x209bd4['count'];var _0x3b39fd=_0x22d682?0x0:_0x43bfbf[_0x44e1('0x21')];var _0x59aa10=_0x22d682?_0x209bd4['count']:_0x43bfbf[_0x44e1('0x21')]+_0x43bfbf['limit'];var _0x5bcfe7;if(_0x59aa10>=_0x42e839){_0x59aa10=_0x42e839;_0x5bcfe7=0xc8;}else{_0x5bcfe7=0xce;}_0x323f36[_0x44e1('0x1e')](_0x5bcfe7);return _0x323f36['set'](_0x44e1('0x24'),_0x3b39fd+'-'+_0x59aa10+'/'+_0x42e839)[_0x44e1('0x20')](_0x209bd4);}return null;};}function patchUpdates(_0x46cac3){return function(_0x50f048){try{jsonpatch['apply'](_0x50f048,_0x46cac3,!![]);}catch(_0xa767d7){return BPromise[_0x44e1('0x25')](_0xa767d7);}return _0x50f048['save']();};}function saveUpdates(_0x2aa7da,_0x4621c7){return function(_0x1cd37e){if(_0x1cd37e){return _0x1cd37e['update'](_0x2aa7da)['then'](function(_0xbf384f){return _0xbf384f;});}return null;};}function removeEntity(_0x2e3d98,_0x43bddc){return function(_0x322187){if(_0x322187){return _0x322187[_0x44e1('0x26')]()[_0x44e1('0x27')](function(){_0x2e3d98[_0x44e1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e666d,_0x44d8ef){return function(_0x28aa67){if(!_0x28aa67){_0x4e666d[_0x44e1('0x28')](0x194);}return _0x28aa67;};}function handleError(_0x28c2c7,_0x249ee2){_0x249ee2=_0x249ee2||0x1f4;return function(_0x1652cb){logger[_0x44e1('0x29')](_0x1652cb[_0x44e1('0x2a')]);if(_0x1652cb[_0x44e1('0x2b')]){delete _0x1652cb['name'];}_0x28c2c7[_0x44e1('0x1e')](_0x249ee2)[_0x44e1('0x2c')](_0x1652cb);};}exports['index']=function(_0x581cb5,_0x56229e){var _0x548b96={},_0x1dc5d7={},_0x3ec164={'count':0x0,'rows':[]};var _0x46488d=_[_0x44e1('0x2d')](db['ChatGroup'][_0x44e1('0x2e')],function(_0x4aa734){return{'name':_0x4aa734[_0x44e1('0x2f')],'type':_0x4aa734[_0x44e1('0x30')][_0x44e1('0x31')]};});_0x1dc5d7[_0x44e1('0x32')]=_['map'](_0x46488d,_0x44e1('0x2b'));_0x1dc5d7['query']=_[_0x44e1('0x33')](_0x581cb5[_0x44e1('0x34')]);_0x1dc5d7[_0x44e1('0x35')]=_[_0x44e1('0x36')](_0x1dc5d7[_0x44e1('0x32')],_0x1dc5d7['query']);_0x548b96['attributes']=_[_0x44e1('0x36')](_0x1dc5d7[_0x44e1('0x32')],qs[_0x44e1('0x37')](_0x581cb5[_0x44e1('0x34')][_0x44e1('0x37')]));_0x548b96[_0x44e1('0x38')]=_0x548b96['attributes'][_0x44e1('0x39')]?_0x548b96[_0x44e1('0x38')]:_0x1dc5d7[_0x44e1('0x32')];if(!_0x581cb5['query'][_0x44e1('0x3a')](_0x44e1('0x3b'))){_0x548b96[_0x44e1('0x23')]=qs[_0x44e1('0x23')](_0x581cb5[_0x44e1('0x34')][_0x44e1('0x23')]);_0x548b96['offset']=qs[_0x44e1('0x21')](_0x581cb5[_0x44e1('0x34')]['offset']);}_0x548b96[_0x44e1('0x3c')]=qs[_0x44e1('0x3d')](_0x581cb5['query']['sort']);_0x548b96[_0x44e1('0x3e')]=qs[_0x44e1('0x35')](_[_0x44e1('0x3f')](_0x581cb5[_0x44e1('0x34')],_0x1dc5d7[_0x44e1('0x35')]),_0x46488d);if(_0x581cb5[_0x44e1('0x34')][_0x44e1('0x40')]){_0x548b96[_0x44e1('0x3e')]=_[_0x44e1('0x41')](_0x548b96['where'],{'$or':_['map'](_0x46488d,function(_0x2c7998){if(_0x2c7998['type']!==_0x44e1('0x42')){var _0x41183c={};_0x41183c[_0x2c7998[_0x44e1('0x2b')]]={'$like':'%'+_0x581cb5[_0x44e1('0x34')][_0x44e1('0x40')]+'%'};return _0x41183c;}})});}_0x548b96=_['merge']({},_0x548b96,_0x581cb5[_0x44e1('0x43')]);var _0x218def={'where':_0x548b96[_0x44e1('0x3e')]};return db[_0x44e1('0x44')]['count'](_0x218def)['then'](function(_0x854bf5){_0x3ec164[_0x44e1('0x45')]=_0x854bf5;if(_0x581cb5['query']['includeAll']){_0x548b96['include']=[{'all':!![]}];}return db[_0x44e1('0x44')][_0x44e1('0x46')](_0x548b96);})['then'](function(_0x3aceea){_0x3ec164['rows']=_0x3aceea;return _0x3ec164;})['then'](respondWithFilteredResult(_0x56229e,_0x548b96))['catch'](handleError(_0x56229e,null));};exports[_0x44e1('0x47')]=function(_0x17ff55,_0x1065bd){var _0x5b10ea={'raw':!![],'where':{'id':_0x17ff55[_0x44e1('0x48')]['id']}},_0x487db2={};_0x487db2[_0x44e1('0x32')]=_[_0x44e1('0x33')](db['ChatGroup'][_0x44e1('0x2e')]);_0x487db2[_0x44e1('0x34')]=_['keys'](_0x17ff55[_0x44e1('0x34')]);_0x487db2['filters']=_[_0x44e1('0x36')](_0x487db2[_0x44e1('0x32')],_0x487db2[_0x44e1('0x34')]);_0x5b10ea[_0x44e1('0x38')]=_['intersection'](_0x487db2[_0x44e1('0x32')],qs[_0x44e1('0x37')](_0x17ff55['query']['fields']));_0x5b10ea['attributes']=_0x5b10ea[_0x44e1('0x38')][_0x44e1('0x39')]?_0x5b10ea['attributes']:_0x487db2[_0x44e1('0x32')];if(_0x17ff55['query'][_0x44e1('0x49')]){_0x5b10ea[_0x44e1('0x4a')]=[{'all':!![]}];}_0x5b10ea=_[_0x44e1('0x41')]({},_0x5b10ea,_0x17ff55[_0x44e1('0x43')]);return db[_0x44e1('0x44')][_0x44e1('0x4b')](_0x5b10ea)[_0x44e1('0x27')](handleEntityNotFound(_0x1065bd,null))['then'](respondWithResult(_0x1065bd,null))[_0x44e1('0x4c')](handleError(_0x1065bd,null));};exports[_0x44e1('0x4d')]=function(_0x29417d,_0x34346a){return db[_0x44e1('0x44')]['create'](_0x29417d['body'],{})[_0x44e1('0x27')](respondWithResult(_0x34346a,0xc9))[_0x44e1('0x4c')](handleError(_0x34346a,null));};exports[_0x44e1('0x4e')]=function(_0xe6a665,_0x441bc6){if(_0xe6a665[_0x44e1('0x4f')]['id']){delete _0xe6a665['body']['id'];}return db['ChatGroup'][_0x44e1('0x4b')]({'where':{'id':_0xe6a665['params']['id']}})['then'](handleEntityNotFound(_0x441bc6,null))[_0x44e1('0x27')](saveUpdates(_0xe6a665['body'],null))[_0x44e1('0x27')](respondWithResult(_0x441bc6,null))[_0x44e1('0x4c')](handleError(_0x441bc6,null));};exports[_0x44e1('0x26')]=function(_0x2d72bc,_0x12dd7e){return db[_0x44e1('0x44')]['find']({'where':{'id':_0x2d72bc['params']['id']}})['then'](handleEntityNotFound(_0x12dd7e,null))[_0x44e1('0x27')](removeEntity(_0x12dd7e,null))[_0x44e1('0x4c')](handleError(_0x12dd7e,null));};exports[_0x44e1('0x50')]=function(_0xc74e96,_0xd713b6){return db[_0x44e1('0x44')]['describe']()[_0x44e1('0x27')](respondWithResult(_0xd713b6,null))['catch'](handleError(_0xd713b6,null));};exports[_0x44e1('0x51')]=function(_0x224902,_0x389e89,_0x4d1ba7){return db['ChatInternalMessage'][_0x44e1('0x45')]({'where':{'ChatGroupId':_0x224902[_0x44e1('0x48')]['id'],'ToId':_0x224902[_0x44e1('0x52')]['id'],'read':![]}})[_0x44e1('0x27')](function(_0xcb10e2){return{'id':_[_0x44e1('0x53')](_0x224902['params']['id']),'count':_0xcb10e2};})[_0x44e1('0x27')](respondWithResult(_0x389e89,null))[_0x44e1('0x4c')](handleError(_0x389e89,null));};exports[_0x44e1('0x54')]=function(_0x15fbda,_0x2940c3,_0x5556f5){return db[_0x44e1('0x44')]['find']({'where':{'id':_0x15fbda[_0x44e1('0x48')]['id']}})[_0x44e1('0x27')](handleEntityNotFound(_0x2940c3,null))['then'](function(_0x28f1d3){if(_0x28f1d3){return _0x28f1d3[_0x44e1('0x54')](_0x15fbda[_0x44e1('0x4f')][_0x44e1('0x55')],_['omit'](_0x15fbda['body'],[_0x44e1('0x55'),'id'])||{});}})[_0x44e1('0x27')](respondWithResult(_0x2940c3,null))[_0x44e1('0x4c')](handleError(_0x2940c3,null));};exports[_0x44e1('0x56')]=function(_0x4f2413,_0x3445b9,_0x5dcff6){var _0x48a6e9={};var _0x1a41e2={};var _0xf4be5d;var _0x46fb60;return db[_0x44e1('0x44')][_0x44e1('0x57')]({'where':{'id':_0x4f2413[_0x44e1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3445b9,null))[_0x44e1('0x27')](function(_0x1a973c){if(_0x1a973c){_0xf4be5d=_0x1a973c;_0x1a41e2[_0x44e1('0x32')]=_[_0x44e1('0x33')](db[_0x44e1('0x58')][_0x44e1('0x2e')]);_0x1a41e2[_0x44e1('0x34')]=_['keys'](_0x4f2413[_0x44e1('0x34')]);_0x1a41e2[_0x44e1('0x35')]=_[_0x44e1('0x36')](_0x1a41e2[_0x44e1('0x32')],_0x1a41e2[_0x44e1('0x34')]);_0x48a6e9['attributes']=_[_0x44e1('0x36')](_0x1a41e2[_0x44e1('0x32')],qs['fields'](_0x4f2413['query'][_0x44e1('0x37')]));_0x48a6e9[_0x44e1('0x38')]=_0x48a6e9[_0x44e1('0x38')][_0x44e1('0x39')]?_0x48a6e9[_0x44e1('0x38')]:_0x1a41e2[_0x44e1('0x32')];_0x48a6e9['order']=qs[_0x44e1('0x3d')](_0x4f2413['query'][_0x44e1('0x3d')]);_0x48a6e9[_0x44e1('0x3e')]=qs[_0x44e1('0x35')](_[_0x44e1('0x3f')](_0x4f2413[_0x44e1('0x34')],_0x1a41e2[_0x44e1('0x35')]));if(_0x4f2413[_0x44e1('0x34')][_0x44e1('0x40')]){_0x48a6e9[_0x44e1('0x3e')]=_[_0x44e1('0x41')](_0x48a6e9['where'],{'$or':_['map'](_0x48a6e9[_0x44e1('0x38')],function(_0x3b8dce){var _0x564bf8={};_0x564bf8[_0x3b8dce]={'$like':'%'+_0x4f2413[_0x44e1('0x34')]['filter']+'%'};return _0x564bf8;})});}_0x48a6e9=_['merge']({},_0x48a6e9,_0x4f2413[_0x44e1('0x43')]);return _0xf4be5d[_0x44e1('0x56')](_0x48a6e9);}})['then'](function(_0x31e5b9){if(_0x31e5b9){_0x46fb60=_0x31e5b9[_0x44e1('0x39')];if(!_0x4f2413[_0x44e1('0x34')]['hasOwnProperty'](_0x44e1('0x3b'))){_0x48a6e9['limit']=qs[_0x44e1('0x23')](_0x4f2413[_0x44e1('0x34')][_0x44e1('0x23')]);_0x48a6e9[_0x44e1('0x21')]=qs[_0x44e1('0x21')](_0x4f2413[_0x44e1('0x34')][_0x44e1('0x21')]);}return _0xf4be5d[_0x44e1('0x56')](_0x48a6e9);}})['then'](function(_0x31ef3e){if(_0x31ef3e){return _0x31ef3e?{'count':_0x46fb60,'rows':_0x31ef3e}:null;}})[_0x44e1('0x27')](respondWithResult(_0x3445b9,null))[_0x44e1('0x4c')](handleError(_0x3445b9,null));};exports['removeMembers']=function(_0x25161f,_0x143d2d,_0x42e6aa){return db[_0x44e1('0x44')][_0x44e1('0x4b')]({'where':{'id':_0x25161f['params']['id']}})[_0x44e1('0x27')](handleEntityNotFound(_0x143d2d,null))[_0x44e1('0x27')](function(_0x1aa6fe){if(_0x1aa6fe){return _0x1aa6fe['removeMembers'](_0x25161f[_0x44e1('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x143d2d,null))['catch'](handleError(_0x143d2d,null));};exports[_0x44e1('0x59')]=function(_0x12a417,_0x5b22e4,_0x1caa28){if(_0x12a417[_0x44e1('0x4f')]['id']){delete _0x12a417[_0x44e1('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x12a417[_0x44e1('0x48')]['id']}})[_0x44e1('0x27')](handleEntityNotFound(_0x5b22e4,null))[_0x44e1('0x27')](function(_0x49780c){if(_0x49780c){_0x12a417[_0x44e1('0x4f')][_0x44e1('0x5a')]=_0x49780c['id'];return db[_0x44e1('0x5b')]['create'](_0x12a417[_0x44e1('0x4f')]);}})[_0x44e1('0x27')](respondWithResult(_0x5b22e4,null))['catch'](handleError(_0x5b22e4,null));};exports[_0x44e1('0x5c')]=function(_0x41c1cb,_0x22b535,_0x1eb53a){var _0x13fe5e={};var _0x5b891f={};var _0x4bd4d9;var _0x52e7a1;return db['ChatGroup'][_0x44e1('0x57')]({'where':{'id':_0x41c1cb['params']['id']}})['then'](handleEntityNotFound(_0x22b535,null))[_0x44e1('0x27')](function(_0xb3e02a){if(_0xb3e02a){_0x4bd4d9=_0xb3e02a;_0x5b891f['model']=_[_0x44e1('0x33')](db[_0x44e1('0x5b')]['rawAttributes']);_0x5b891f[_0x44e1('0x34')]=_['keys'](_0x41c1cb[_0x44e1('0x34')]);_0x5b891f['filters']=_[_0x44e1('0x36')](_0x5b891f['model'],_0x5b891f[_0x44e1('0x34')]);_0x13fe5e[_0x44e1('0x38')]=_[_0x44e1('0x36')](_0x5b891f[_0x44e1('0x32')],qs[_0x44e1('0x37')](_0x41c1cb[_0x44e1('0x34')]['fields']));_0x13fe5e['attributes']=_0x13fe5e[_0x44e1('0x38')]['length']?_0x13fe5e['attributes']:_0x5b891f[_0x44e1('0x32')];_0x13fe5e[_0x44e1('0x3c')]=qs['sort'](_0x41c1cb['query']['sort']);_0x13fe5e[_0x44e1('0x3e')]=qs[_0x44e1('0x35')](_['pick'](_0x41c1cb['query'],_0x5b891f[_0x44e1('0x35')]));if(_0x41c1cb[_0x44e1('0x34')][_0x44e1('0x40')]){_0x13fe5e[_0x44e1('0x3e')]=_['merge'](_0x13fe5e['where'],{'$or':_[_0x44e1('0x2d')](_0x13fe5e[_0x44e1('0x38')],function(_0x559081){var _0x596f25={};_0x596f25[_0x559081]={'$like':'%'+_0x41c1cb[_0x44e1('0x34')]['filter']+'%'};return _0x596f25;})});}if(_0x41c1cb[_0x44e1('0x34')][_0x44e1('0x5d')]){var _0x1b6004=_0x41c1cb[_0x44e1('0x34')][_0x44e1('0x5d')][_0x44e1('0x5e')](',');var _0x28def8={};_0x28def8[_0x1b6004[0x0]]={'$gte':moment(_0x1b6004[0x1])[_0x44e1('0x5f')](_0x44e1('0x60'))};_0x13fe5e[_0x44e1('0x3e')]=_[_0x44e1('0x41')](_0x13fe5e[_0x44e1('0x3e')],_0x28def8);}_0x13fe5e=_[_0x44e1('0x41')]({},_0x13fe5e,_0x41c1cb[_0x44e1('0x43')]);return _0x4bd4d9['getMessages'](_0x13fe5e);}})['then'](function(_0x44513e){if(_0x44513e){_0x52e7a1=_0x44513e[_0x44e1('0x39')];if(!_0x41c1cb[_0x44e1('0x34')][_0x44e1('0x3a')](_0x44e1('0x3b'))){_0x13fe5e[_0x44e1('0x23')]=qs[_0x44e1('0x23')](_0x41c1cb[_0x44e1('0x34')][_0x44e1('0x23')]);_0x13fe5e[_0x44e1('0x21')]=qs[_0x44e1('0x21')](_0x41c1cb[_0x44e1('0x34')][_0x44e1('0x21')]);}return _0x4bd4d9[_0x44e1('0x5c')](_0x13fe5e);}})[_0x44e1('0x27')](function(_0xf9262d){if(_0xf9262d){return _0xf9262d?{'count':_0x52e7a1,'rows':_0xf9262d}:null;}})[_0x44e1('0x27')](respondWithResult(_0x22b535,null))['catch'](handleError(_0x22b535,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 17071df..09d93aa 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 _0x84d6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatGroup'];(function(_0x14a6f7,_0x586f25){var _0x42c47d=function(_0x2ed1c8){while(--_0x2ed1c8){_0x14a6f7['push'](_0x14a6f7['shift']());}};_0x42c47d(++_0x586f25);}(_0x84d6,0x180));var _0x684d=function(_0x40ba45,_0x13be71){_0x40ba45=_0x40ba45-0x0;var _0x4e290e=_0x84d6[_0x40ba45];return _0x4e290e;};'use strict';var EventEmitter=require(_0x684d('0x0'));var ChatGroup=require(_0x684d('0x1'))['db'][_0x684d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x684d('0x3')](0x0);var events={'afterCreate':_0x684d('0x4'),'afterUpdate':_0x684d('0x5'),'afterDestroy':_0x684d('0x6')};function emitEvent(_0x917d4d){return function(_0xb449ca,_0x26fcbe,_0x34c9b6){ChatGroupEvents[_0x684d('0x7')](_0x917d4d+':'+_0xb449ca['id'],_0xb449ca);ChatGroupEvents[_0x684d('0x7')](_0x917d4d,_0xb449ca);_0x34c9b6(null);};}for(var e in events){if(events[_0x684d('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x084d=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','remove','emit'];(function(_0x262734,_0x6a7eb2){var _0x52c6c8=function(_0x3719c4){while(--_0x3719c4){_0x262734['push'](_0x262734['shift']());}};_0x52c6c8(++_0x6a7eb2);}(_0x084d,0x147));var _0xd084=function(_0x21acaa,_0x4519c4){_0x21acaa=_0x21acaa-0x0;var _0x40ca6c=_0x084d[_0x21acaa];return _0x40ca6c;};'use strict';var EventEmitter=require(_0xd084('0x0'));var ChatGroup=require(_0xd084('0x1'))['db'][_0xd084('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd084('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd084('0x4')};function emitEvent(_0x3cd476){return function(_0x32f68a,_0x384c37,_0x1dd916){ChatGroupEvents[_0xd084('0x5')](_0x3cd476+':'+_0x32f68a['id'],_0x32f68a);ChatGroupEvents[_0xd084('0x5')](_0x3cd476,_0x32f68a);_0x1dd916(null);};}for(var e in events){if(events[_0xd084('0x6')](e)){var event=events[e];ChatGroup[_0xd084('0x7')](e,emitEvent(event));}}module[_0xd084('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 fad15b5..c0ff1ea 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 _0xc12b=['exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc12b,0x64));var _0xbc12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbc12('0x0'));var util=require(_0xbc12('0x1'));var logger=require(_0xbc12('0x2'))('api');var moment=require(_0xbc12('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc12('0x4'));var fs=require('fs');var path=require(_0xbc12('0x5'));var rimraf=require(_0xbc12('0x6'));var config=require(_0xbc12('0x7'));var attributes=require('./chatGroup.attributes');module[_0xbc12('0x8')]=function(_0x3d3dbd,_0x559364){return _0x3d3dbd[_0xbc12('0x9')](_0xbc12('0xa'),attributes,{'tableName':_0xbc12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12a9=['rimraf','./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12a9,0xf4));var _0x912a=function(_0x3ab080,_0xb0c046){_0x3ab080=_0x3ab080-0x0;var _0x24cfde=_0x12a9[_0x3ab080];return _0x24cfde;};'use strict';var _=require(_0x912a('0x0'));var util=require(_0x912a('0x1'));var logger=require(_0x912a('0x2'))(_0x912a('0x3'));var moment=require(_0x912a('0x4'));var BPromise=require(_0x912a('0x5'));var rp=require(_0x912a('0x6'));var fs=require('fs');var path=require(_0x912a('0x7'));var rimraf=require(_0x912a('0x8'));var config=require('../../config/environment');var attributes=require(_0x912a('0x9'));module['exports']=function(_0x452d0b,_0x20aa96){return _0x452d0b[_0x912a('0xa')]('ChatGroup',attributes,{'tableName':_0x912a('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 9909a42..8df0d07 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 _0x3c70=['defaults','localhost','socket.io-emitter','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c70,0x10c));var _0x03c7=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x3c70[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var moment=require(_0x03c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x03c7('0x3'));var fs=require('fs');var Redis=require(_0x03c7('0x4'));var db=require(_0x03c7('0x5'))['db'];var utils=require(_0x03c7('0x6'));var logger=require(_0x03c7('0x7'))(_0x03c7('0x8'));var config=require('../../config/environment');var jayson=require(_0x03c7('0x9'));var client=jayson['client'][_0x03c7('0xa')]({'port':0x232a});config[_0x03c7('0xb')]=_[_0x03c7('0xc')](config['redis'],{'host':_0x03c7('0xd'),'port':0x18eb});var socket=require(_0x03c7('0xe'))(new Redis(config[_0x03c7('0xb')]));require('./chatGroup.socket')[_0x03c7('0xf')](socket);function respondWithRpcPromise(_0x48c3f7,_0x103052,_0x20c6c8){return new BPromise(function(_0x57c8fb,_0x856199){return client[_0x03c7('0x10')](_0x48c3f7,_0x20c6c8)[_0x03c7('0x11')](function(_0xf98747){logger[_0x03c7('0x12')]('ChatGroup,\x20%s,\x20%s',_0x103052,'request\x20sent');logger[_0x03c7('0x13')](_0x03c7('0x14'),_0x103052,'request\x20sent',JSON[_0x03c7('0x15')](_0xf98747));if(_0xf98747[_0x03c7('0x16')]){if(_0xf98747[_0x03c7('0x16')][_0x03c7('0x17')]===0x1f4){logger[_0x03c7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x103052,_0xf98747[_0x03c7('0x16')]['message']);return _0x856199(_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);}logger['error'](_0x03c7('0x19'),_0x103052,_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);return _0x57c8fb(_0xf98747['error'][_0x03c7('0x18')]);}else{logger[_0x03c7('0x12')](_0x03c7('0x19'),_0x103052,_0x03c7('0x1a'));_0x57c8fb(_0xf98747[_0x03c7('0x1b')][_0x03c7('0x18')]);}})['catch'](function(_0x571108){logger[_0x03c7('0x16')](_0x03c7('0x19'),_0x103052,_0x571108);_0x856199(_0x571108);});});} \ No newline at end of file +var _0x142c=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','./chatGroup.socket','then','info'];(function(_0x416430,_0x1d40c1){var _0xbafe9c=function(_0xc3839f){while(--_0xc3839f){_0x416430['push'](_0x416430['shift']());}};_0xbafe9c(++_0x1d40c1);}(_0x142c,0x86));var _0xc142=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x142c[_0x389832];return _0x59429e;};'use strict';var _=require(_0xc142('0x0'));var util=require('util');var moment=require(_0xc142('0x1'));var BPromise=require(_0xc142('0x2'));var rs=require(_0xc142('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc142('0x4'))['db'];var utils=require(_0xc142('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc142('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc142('0x7')]['http']({'port':0x232a});config[_0xc142('0x8')]=_[_0xc142('0x9')](config[_0xc142('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc142('0x8')]));require(_0xc142('0xa'))['register'](socket);function respondWithRpcPromise(_0x4a0feb,_0x128066,_0xc9a6a0){return new BPromise(function(_0x565b60,_0x3009ba){return client['request'](_0x4a0feb,_0xc9a6a0)[_0xc142('0xb')](function(_0x5cf72b){logger[_0xc142('0xc')](_0xc142('0xd'),_0x128066,_0xc142('0xe'));logger[_0xc142('0xf')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x128066,_0xc142('0xe'),JSON[_0xc142('0x10')](_0x5cf72b));if(_0x5cf72b['error']){if(_0x5cf72b[_0xc142('0x11')]['code']===0x1f4){logger[_0xc142('0x11')]('ChatGroup,\x20%s,\x20%s',_0x128066,_0x5cf72b['error'][_0xc142('0x12')]);return _0x3009ba(_0x5cf72b[_0xc142('0x11')][_0xc142('0x12')]);}logger[_0xc142('0x11')]('ChatGroup,\x20%s,\x20%s',_0x128066,_0x5cf72b[_0xc142('0x11')][_0xc142('0x12')]);return _0x565b60(_0x5cf72b[_0xc142('0x11')][_0xc142('0x12')]);}else{logger[_0xc142('0xc')](_0xc142('0xd'),_0x128066,'request\x20sent');_0x565b60(_0x5cf72b[_0xc142('0x13')][_0xc142('0x12')]);}})[_0xc142('0x14')](function(_0x2ec1f9){logger[_0xc142('0x11')](_0xc142('0xd'),_0x128066,_0x2ec1f9);_0x3009ba(_0x2ec1f9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d8c2519..51d9b31 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 _0x0a82=['removeListener','register','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x138d3d,_0x41a640){var _0x2e1cac=function(_0x1a2a8b){while(--_0x1a2a8b){_0x138d3d['push'](_0x138d3d['shift']());}};_0x2e1cac(++_0x41a640);}(_0x0a82,0x137));var _0x20a8=function(_0x1147e7,_0x22494d){_0x1147e7=_0x1147e7-0x0;var _0x3438bf=_0x0a82[_0x1147e7];return _0x3438bf;};'use strict';var ChatGroupEvents=require(_0x20a8('0x0'));var events=[_0x20a8('0x1'),'remove',_0x20a8('0x2')];function createListener(_0x5eeec1,_0x10e28f){return function(_0x32f1c9){_0x10e28f[_0x20a8('0x3')](_0x5eeec1,_0x32f1c9);};}function removeListener(_0xa96946,_0x154037){return function(){ChatGroupEvents[_0x20a8('0x4')](_0xa96946,_0x154037);};}exports[_0x20a8('0x5')]=function(_0x13b380){for(var _0x4e5924=0x0,_0x5a8f47=events['length'];_0x4e5924<_0x5a8f47;_0x4e5924++){var _0x298e20=events[_0x4e5924];var _0x63d692=createListener(_0x20a8('0x6')+_0x298e20,_0x13b380);ChatGroupEvents['on'](_0x298e20,_0x63d692);}}; \ No newline at end of file +var _0xeb66=['register','length','chatGroup:','./chatGroup.events','save','update','removeListener'];(function(_0x2b4e53,_0x1eb31c){var _0xd6d348=function(_0x518865){while(--_0x518865){_0x2b4e53['push'](_0x2b4e53['shift']());}};_0xd6d348(++_0x1eb31c);}(_0xeb66,0xf1));var _0x6eb6=function(_0x2cf657,_0x31249f){_0x2cf657=_0x2cf657-0x0;var _0x439366=_0xeb66[_0x2cf657];return _0x439366;};'use strict';var ChatGroupEvents=require(_0x6eb6('0x0'));var events=[_0x6eb6('0x1'),'remove',_0x6eb6('0x2')];function createListener(_0x58709a,_0x1876d8){return function(_0x4af5b2){_0x1876d8['emit'](_0x58709a,_0x4af5b2);};}function removeListener(_0x4ad970,_0x33e5a7){return function(){ChatGroupEvents[_0x6eb6('0x3')](_0x4ad970,_0x33e5a7);};}exports[_0x6eb6('0x4')]=function(_0x258614){for(var _0x9b801e=0x0,_0x494320=events[_0x6eb6('0x5')];_0x9b801e<_0x494320;_0x9b801e++){var _0x2e7612=events[_0x9b801e];var _0xa68ba7=createListener(_0x6eb6('0x6')+_0x2e7612,_0x258614);ChatGroupEvents['on'](_0x2e7612,_0xa68ba7);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index f93b279..5dc00ae 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 _0x93b2=['express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','post','create','addMembers','put','update','destroy','delete','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x93b2,0xb9));var _0x293b=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x93b2[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0x293b('0x0'));var util=require(_0x293b('0x1'));var path=require(_0x293b('0x2'));var timeout=require(_0x293b('0x3'));var express=require(_0x293b('0x4'));var router=express[_0x293b('0x5')]();var fs_extra=require(_0x293b('0x6'));var auth=require(_0x293b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x293b('0x8'));router[_0x293b('0x9')]('/',auth[_0x293b('0xa')](),controller[_0x293b('0xb')]);router['get']('/describe',auth[_0x293b('0xa')](),controller[_0x293b('0xc')]);router[_0x293b('0x9')](_0x293b('0xd'),auth[_0x293b('0xa')](),controller[_0x293b('0xe')]);router[_0x293b('0x9')](_0x293b('0xf'),auth[_0x293b('0xa')](),controller[_0x293b('0x10')]);router[_0x293b('0x9')](_0x293b('0x11'),auth[_0x293b('0xa')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x293b('0xa')](),controller['getMessages']);router[_0x293b('0x12')]('/',auth[_0x293b('0xa')](),controller[_0x293b('0x13')]);router[_0x293b('0x12')]('/:id/members',auth['isAuthenticated'](),controller[_0x293b('0x14')]);router['post']('/:id/messages',auth[_0x293b('0xa')](),controller['addMessage']);router[_0x293b('0x15')](_0x293b('0xd'),auth[_0x293b('0xa')](),controller[_0x293b('0x16')]);router['delete'](_0x293b('0xd'),auth['isAuthenticated'](),controller[_0x293b('0x17')]);router[_0x293b('0x18')]('/:id/members',auth[_0x293b('0xa')](),controller[_0x293b('0x19')]);module[_0x293b('0x1a')]=router; \ No newline at end of file +var _0xe390=['get','index','/describe','describe','/:id','isAuthenticated','show','getUnread','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage','put','update','destroy','delete','removeMembers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x36a3d1,_0x4a32cd){var _0x821ef4=function(_0x1dfb29){while(--_0x1dfb29){_0x36a3d1['push'](_0x36a3d1['shift']());}};_0x821ef4(++_0x4a32cd);}(_0xe390,0xa0));var _0x0e39=function(_0x41b3ab,_0x393020){_0x41b3ab=_0x41b3ab-0x0;var _0x29589e=_0xe390[_0x41b3ab];return _0x29589e;};'use strict';var multer=require(_0x0e39('0x0'));var util=require('util');var path=require(_0x0e39('0x1'));var timeout=require(_0x0e39('0x2'));var express=require(_0x0e39('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0e39('0x4'));var interaction=require(_0x0e39('0x5'));var config=require(_0x0e39('0x6'));var controller=require(_0x0e39('0x7'));router[_0x0e39('0x8')]('/',auth['isAuthenticated'](),controller[_0x0e39('0x9')]);router[_0x0e39('0x8')](_0x0e39('0xa'),auth['isAuthenticated'](),controller[_0x0e39('0xb')]);router[_0x0e39('0x8')](_0x0e39('0xc'),auth[_0x0e39('0xd')](),controller[_0x0e39('0xe')]);router['get']('/:id/unread',auth[_0x0e39('0xd')](),controller[_0x0e39('0xf')]);router['get'](_0x0e39('0x10'),auth[_0x0e39('0xd')](),controller['getMembers']);router['get'](_0x0e39('0x11'),auth['isAuthenticated'](),controller[_0x0e39('0x12')]);router[_0x0e39('0x13')]('/',auth[_0x0e39('0xd')](),controller['create']);router[_0x0e39('0x13')](_0x0e39('0x10'),auth[_0x0e39('0xd')](),controller[_0x0e39('0x14')]);router[_0x0e39('0x13')](_0x0e39('0x11'),auth['isAuthenticated'](),controller[_0x0e39('0x15')]);router[_0x0e39('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0e39('0x17')]);router['delete'](_0x0e39('0xc'),auth[_0x0e39('0xd')](),controller[_0x0e39('0x18')]);router[_0x0e39('0x19')]('/:id/members',auth[_0x0e39('0xd')](),controller[_0x0e39('0x1a')]);module[_0x0e39('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 62288cc..81e96ea 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 _0x7033=['star','thumb','TEXT','STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7033,0x19e));var _0x3703=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7033[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'closed':{'type':Sequelize[_0x3703('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3703('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x3703('0x4'),_0x3703('0x5')),'defaultValue':_0x3703('0x4')},'ratingMessage':{'type':Sequelize[_0x3703('0x6')]},'pathTranscript':{'type':Sequelize[_0x3703('0x6')]},'mailTranscript':{'type':Sequelize[_0x3703('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3703('0x8')]},'disposition':{'type':Sequelize[_0x3703('0x7')]},'secondDisposition':{'type':Sequelize[_0x3703('0x7')]},'thirdDisposition':{'type':Sequelize[_0x3703('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x3703('0x7')]},'osVersion':{'type':Sequelize[_0x3703('0x7')]},'deviceModel':{'type':Sequelize[_0x3703('0x7')]},'deviceVendor':{'type':Sequelize[_0x3703('0x7')]},'deviceType':{'type':Sequelize[_0x3703('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3703('0x7')]},'formData':{'type':Sequelize[_0x3703('0x6')](_0x3703('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3703('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3703('0x7')]},'customerPort':{'type':Sequelize[_0x3703('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x3703('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3703('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd2bf=['sequelize','ENUM','star','TEXT','STRING','DATE','long','out','BOOLEAN'];(function(_0x48e1ee,_0x5ecd31){var _0x4de197=function(_0x471177){while(--_0x471177){_0x48e1ee['push'](_0x48e1ee['shift']());}};_0x4de197(++_0x5ecd31);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x2e655a,_0x6d5799){_0x2e655a=_0x2e655a-0x0;var _0x26f13b=_0xd2bf[_0x2e655a];return _0x26f13b;};'use strict';var Sequelize=require(_0xfd2b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfd2b('0x1')](_0xfd2b('0x2'),'thumb'),'defaultValue':_0xfd2b('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xfd2b('0x3')]},'mailTranscript':{'type':Sequelize[_0xfd2b('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfd2b('0x5')]},'disposition':{'type':Sequelize[_0xfd2b('0x4')]},'secondDisposition':{'type':Sequelize[_0xfd2b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfd2b('0x4')]},'browserName':{'type':Sequelize[_0xfd2b('0x4')]},'browserVersion':{'type':Sequelize[_0xfd2b('0x4')]},'osName':{'type':Sequelize[_0xfd2b('0x4')]},'osVersion':{'type':Sequelize[_0xfd2b('0x4')]},'deviceModel':{'type':Sequelize[_0xfd2b('0x4')]},'deviceVendor':{'type':Sequelize[_0xfd2b('0x4')]},'deviceType':{'type':Sequelize[_0xfd2b('0x4')]},'referer':{'type':Sequelize[_0xfd2b('0x3')]},'customerIp':{'type':Sequelize[_0xfd2b('0x4')]},'formData':{'type':Sequelize[_0xfd2b('0x3')](_0xfd2b('0x6'))},'read1stAt':{'type':Sequelize[_0xfd2b('0x5')]},'lastMsgAt':{'type':Sequelize[_0xfd2b('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfd2b('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfd2b('0x4')]},'customerPort':{'type':Sequelize[_0xfd2b('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfd2b('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 467844d..6794705 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 _0x48c7=['includeAgent','setTags','Tag','color','emit','removeTags','unix','toString','server','files','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','closedAt','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','stack','name','send','render','body','contact','account','map','ChatInteraction','fieldName','type','key','getOptions','chat','user','show','params','model','rawAttributes','query','keys','filters','fields','attributes','length','includeAll','include','merge','options','find','create','describe','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','server/files/attachments/','offline-chat/','download','close','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','agentAlias','Visitor','agentIdentifier','website_alias','%s%d','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','intersection','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','nolimit','order','pick','secret'];(function(_0x5637bf,_0x43fde4){var _0x56852a=function(_0x315f99){while(--_0x315f99){_0x5637bf['push'](_0x5637bf['shift']());}};_0x56852a(++_0x43fde4);}(_0x48c7,0x1c3));var _0x748c=function(_0x5285f9,_0x2bd7d7){_0x5285f9=_0x5285f9-0x0;var _0x6edc0c=_0x48c7[_0x5285f9];return _0x6edc0c;};'use strict';var rimraf=require(_0x748c('0x0'));var zipdir=require('zip-dir');var rp=require(_0x748c('0x1'));var moment=require(_0x748c('0x2'));var BPromise=require(_0x748c('0x3'));var Mustache=require(_0x748c('0x4'));var util=require(_0x748c('0x5'));var path=require(_0x748c('0x6'));var ejs=require(_0x748c('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x748c('0x8'));var qs=require(_0x748c('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x748c('0xa'));var config=require('../../config/environment');var db=require(_0x748c('0xb'))['db'];config[_0x748c('0xc')]=_[_0x748c('0xd')](config[_0x748c('0xc')],{'host':_0x748c('0xe'),'port':0x18eb});var socket=require(_0x748c('0xf'))(new Redis(config[_0x748c('0xc')]));require(_0x748c('0x10'))[_0x748c('0x11')](socket);var jayson=require(_0x748c('0x12'));var client=jayson[_0x748c('0x13')]['http']({'port':0x232b});var client9004=jayson['client'][_0x748c('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x552d30,_0x3d24f5,_0x5c2290,_0x394188){return new BPromise(function(_0x5b2326,_0x5e6c59){var _0x3cc317=_0x394188||client;return _0x3cc317[_0x748c('0x15')](_0x552d30,_0x5c2290)[_0x748c('0x16')](function(_0x8b4ae3){logger[_0x748c('0x17')](_0x748c('0x18'),_0x3d24f5,_0x748c('0x19'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3d24f5,_0x748c('0x19'),JSON[_0x748c('0x1a')](_0x8b4ae3));if(_0x8b4ae3[_0x748c('0x1b')]){if(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3d24f5,_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);return _0x5e6c59(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);}logger['error'](_0x748c('0x18'),_0x3d24f5,_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);return _0x5b2326(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3d24f5,'request\x20sent');_0x5b2326(_0x8b4ae3[_0x748c('0x1e')][_0x748c('0x1d')]);}})[_0x748c('0x1f')](function(_0x23e44c){logger['error'](_0x748c('0x18'),_0x3d24f5,_0x23e44c);_0x5e6c59(_0x23e44c);});});}function respondWithStatusCode(_0x5579e1,_0x2ee69f){_0x2ee69f=_0x2ee69f||0xcc;return function(_0xf54003){if(_0xf54003){return _0x5579e1[_0x748c('0x20')](_0x2ee69f);}return _0x5579e1[_0x748c('0x21')](_0x2ee69f)[_0x748c('0x22')]();};}function respondWithResult(_0x3e1406,_0x1043c7){_0x1043c7=_0x1043c7||0xc8;return function(_0x1ce179){if(_0x1ce179){return _0x3e1406[_0x748c('0x21')](_0x1043c7)[_0x748c('0x23')](_0x1ce179);}};}function respondWithFilteredResult(_0x3976aa,_0x3da752){return function(_0x5c7a80){if(_0x5c7a80){var _0x530707=typeof _0x3da752['offset']===_0x748c('0x24')&&typeof _0x3da752[_0x748c('0x25')]===_0x748c('0x24');var _0x37f20e=_0x5c7a80[_0x748c('0x26')];var _0x37d6ef=_0x530707?0x0:_0x3da752['offset'];var _0x386e9a=_0x530707?_0x5c7a80[_0x748c('0x26')]:_0x3da752[_0x748c('0x27')]+_0x3da752['limit'];var _0x420fde;if(_0x386e9a>=_0x37f20e){_0x386e9a=_0x37f20e;_0x420fde=0xc8;}else{_0x420fde=0xce;}_0x3976aa[_0x748c('0x21')](_0x420fde);return _0x3976aa[_0x748c('0x28')](_0x748c('0x29'),_0x37d6ef+'-'+_0x386e9a+'/'+_0x37f20e)[_0x748c('0x23')](_0x5c7a80);}return null;};}function saveUpdates(_0xb7a6c7){return function(_0x3cfe2a){if(_0x3cfe2a){return _0x3cfe2a[_0x748c('0x2a')](_0xb7a6c7)[_0x748c('0x16')](function(_0x2a3801){return _0x2a3801;});}return null;};}function removeEntity(_0x50d8bf){return function(_0x1ea6b0){if(_0x1ea6b0){return _0x1ea6b0[_0x748c('0x2b')]()[_0x748c('0x16')](function(){_0x50d8bf[_0x748c('0x21')](0xcc)[_0x748c('0x22')]();});}};}function handleEntityNotFound(_0x2bc698){return function(_0xdd9dc6){if(!_0xdd9dc6){_0x2bc698[_0x748c('0x20')](0x194);}return _0xdd9dc6;};}function handleError(_0x3e6532,_0x11a48f){_0x11a48f=_0x11a48f||0x1f4;return function(_0xad7e0c){logger['error'](_0xad7e0c[_0x748c('0x2c')]);if(_0xad7e0c[_0x748c('0x2d')]){delete _0xad7e0c[_0x748c('0x2d')];}_0x3e6532[_0x748c('0x21')](_0x11a48f)[_0x748c('0x2e')](_0xad7e0c);};}function getMustacheRender(_0x5551af,_0x59e779){return Mustache[_0x748c('0x2f')](_0x5551af,_['merge'](_0x59e779[_0x748c('0x30')],{'contact':_0x59e779[_0x748c('0x31')],'message':_0x59e779[_0x748c('0x1d')],'agent':_0x59e779['agent'],'interaction':_0x59e779['interaction'],'account':_0x59e779[_0x748c('0x32')]}))||'';}exports['index']=function(_0x2af656,_0x4deab3){var _0xce15cd={};var _0x3d68ab=_[_0x748c('0x33')](db[_0x748c('0x34')]['rawAttributes'],function(_0x27bd22){return{'name':_0x27bd22[_0x748c('0x35')],'type':_0x27bd22[_0x748c('0x36')][_0x748c('0x37')]};});_0xce15cd=qs[_0x748c('0x38')](_0x3d68ab,_0x2af656);return interaction['findAll'](_0x748c('0x39'),_0x2af656['query'],_0x2af656[_0x748c('0x3a')],_0xce15cd,_0x3d68ab)[_0x748c('0x16')](respondWithFilteredResult(_0x4deab3,_0xce15cd))[_0x748c('0x1f')](handleError(_0x4deab3,null));};exports[_0x748c('0x3b')]=function(_0x4cf2ce,_0x22d125){var _0x26a1d5={'raw':![],'where':{'id':_0x4cf2ce[_0x748c('0x3c')]['id']}},_0x34f57c={};_0x34f57c[_0x748c('0x3d')]=_['keys'](db[_0x748c('0x34')][_0x748c('0x3e')]);_0x34f57c[_0x748c('0x3f')]=_[_0x748c('0x40')](_0x4cf2ce[_0x748c('0x3f')]);_0x34f57c[_0x748c('0x41')]=_['intersection'](_0x34f57c[_0x748c('0x3d')],_0x34f57c[_0x748c('0x3f')]);_0x26a1d5['attributes']=_['intersection'](_0x34f57c[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x4cf2ce[_0x748c('0x3f')][_0x748c('0x42')]));_0x26a1d5[_0x748c('0x43')]=_0x26a1d5['attributes'][_0x748c('0x44')]?_0x26a1d5[_0x748c('0x43')]:_0x34f57c[_0x748c('0x3d')];if(_0x4cf2ce[_0x748c('0x3f')][_0x748c('0x45')]){_0x26a1d5[_0x748c('0x46')]=[{'all':!![]}];}_0x26a1d5=_[_0x748c('0x47')]({},_0x26a1d5,_0x4cf2ce[_0x748c('0x48')]);return db[_0x748c('0x34')][_0x748c('0x49')](_0x26a1d5)[_0x748c('0x16')](handleEntityNotFound(_0x22d125,null))['then'](respondWithResult(_0x22d125,null))[_0x748c('0x1f')](handleError(_0x22d125,null));};exports[_0x748c('0x4a')]=function(_0x52599c,_0x561f81){return db[_0x748c('0x34')][_0x748c('0x4a')](_0x52599c['body'],{})[_0x748c('0x16')](respondWithResult(_0x561f81,0xc9))[_0x748c('0x1f')](handleError(_0x561f81,null));};exports[_0x748c('0x2a')]=function(_0x4d0a50,_0x56d1c1){if(_0x4d0a50[_0x748c('0x30')]['id']){delete _0x4d0a50[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x4d0a50[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x56d1c1,null))[_0x748c('0x16')](saveUpdates(_0x4d0a50['body'],null))[_0x748c('0x16')](respondWithResult(_0x56d1c1,null))['catch'](handleError(_0x56d1c1,null));};exports['destroy']=function(_0x14670d,_0x13fd26){return db['ChatInteraction'][_0x748c('0x49')]({'where':{'id':_0x14670d[_0x748c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x13fd26,null))[_0x748c('0x16')](removeEntity(_0x13fd26,null))[_0x748c('0x1f')](handleError(_0x13fd26,null));};exports[_0x748c('0x4b')]=function(_0x3029f9,_0x52c7d6){return db[_0x748c('0x34')][_0x748c('0x4b')]()[_0x748c('0x16')](respondWithResult(_0x52c7d6,null))[_0x748c('0x1f')](handleError(_0x52c7d6,null));};exports['createVidaooSession']=function(_0x3c5b46,_0x3088a5){var _0x2e8f67=_0x3c5b46[_0x748c('0x3c')]['id'];var _0x4f342a;var _0xffc2c3;var _0x514825;return db['ChatInteraction'][_0x748c('0x4c')]({'where':{'id':_0x2e8f67}})[_0x748c('0x16')](function(_0x125857){_0x4f342a=_0x125857;return db['ChatWebsite'][_0x748c('0x4c')]({'where':{'id':_0x125857[_0x748c('0x4d')]},'attributes':['id','vidaooApiKey',_0x748c('0x4e'),_0x748c('0x4f'),_0x748c('0x50'),_0x748c('0x51')],'raw':!![]});})[_0x748c('0x16')](function(_0xe65988){if(_0xe65988&&_0xe65988['vidaooApiKey']&&_0xe65988[_0x748c('0x4e')]){_0xffc2c3=_0xe65988;var _0x295c9c={'interaction':{'id':_0x2e8f67},'agent':{'id':_0x3c5b46[_0x748c('0x3a')]['id'],'name':_0x3c5b46['user']['name'],'fullname':_0x3c5b46[_0x748c('0x3a')][_0x748c('0x52')],'email':_0x3c5b46[_0x748c('0x3a')][_0x748c('0x53')]},'contact':_0x3c5b46[_0x748c('0x30')][_0x748c('0x31')],'account':_0x3c5b46[_0x748c('0x30')][_0x748c('0x32')]};var _0x3e805b={'rejectUnauthorized':![],'method':_0x748c('0x54'),'url':_0x748c('0x55'),'headers':{'X-APIKEY':_0xe65988[_0x748c('0x56')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c5b46[_0x748c('0x3a')][_0x748c('0x53')]],'buttons':null,'topic':_0xffc2c3[_0x748c('0x4f')],'note':_[_0x748c('0x57')](_0xffc2c3['vidaooNote'])?null:getMustacheRender(_0xffc2c3[_0x748c('0x50')],_0x295c9c),'metadata':null},'redirect':_0x748c('0x58'),'json':!![]};try{if(!_[_0x748c('0x57')](_0xffc2c3['vidaooMetadata'])){var _0x20e454=getMustacheRender(_0xffc2c3[_0x748c('0x51')],_0x295c9c);var _0x13c4e2=JSON[_0x748c('0x59')](_0x20e454);_0x3e805b['body'][_0x748c('0x5a')]=_0x13c4e2;}}catch(_0x188633){throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))](_0x748c('0x5d'));}return rp(_0x3e805b);}else{throw new db['Sequelize'][(_0x748c('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x1cf4ac){_0x514825=_0x1cf4ac;if(_0x514825['id']){var _0x5e55fc={'body':_0x514825['join_url'],'ChatWebsiteId':_0xffc2c3['id'],'ChatInteractionId':_0x4f342a['id'],'direction':'out','UserId':_0x3c5b46['user']['id']};return db[_0x748c('0x5e')][_0x748c('0x4a')](_0x5e55fc,{});}else{throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))](_0x748c('0x5f'));}})[_0x748c('0x16')](function(){return _0x4f342a[_0x748c('0x60')]({'vidaooSessionId':_0x514825['id']});})['then'](respondWithResult(_0x3088a5,null))[_0x748c('0x1f')](handleError(_0x3088a5,null));};exports[_0x748c('0x61')]=function(_0x161cef,_0xf19973){if(_0x161cef[_0x748c('0x30')]['id']){delete _0x161cef[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x161cef['params']['id']},'include':[{'model':db[_0x748c('0x62')],'as':_0x748c('0x63')}]})[_0x748c('0x16')](handleEntityNotFound(_0xf19973,null))[_0x748c('0x16')](saveUpdates(_0x161cef[_0x748c('0x30')],null))['then'](respondWithResult(_0xf19973,null))[_0x748c('0x1f')](handleError(_0xf19973,null));};exports[_0x748c('0x64')]=function(_0x3404c5,_0x59e2ba){if(_0x3404c5[_0x748c('0x30')]['id']){delete _0x3404c5[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x3404c5[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](function(_0xc6e39b){if(!_0xc6e39b){logger['error'](_0x748c('0x65'),'abandon',0x194,_0x748c('0x66'));_0x59e2ba['sendStatus'](0x194);}else{if(_0xc6e39b[_0x748c('0x67')]){throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))]('Interaction\x20already\x20assigned');}}return _0xc6e39b;})[_0x748c('0x16')](function(_0x4ae3fc){if(_0x4ae3fc){return _0x4ae3fc[_0x748c('0x2a')]({'closed':_0x3404c5[_0x748c('0x30')][_0x748c('0x68')],'disposition':_0x3404c5[_0x748c('0x30')][_0x748c('0x69')]})[_0x748c('0x16')](function(_0x39d0bf){return _0x39d0bf;});}})[_0x748c('0x16')](function(){return respondWithRpcPromise(_0x748c('0x6a'),'abandon',_0x3404c5['body'],client9004);})[_0x748c('0x16')](respondWithResult(_0x59e2ba,null))[_0x748c('0x1f')](handleError(_0x59e2ba,null));};exports[_0x748c('0x6b')]=function(_0x427b49,_0x47784c){_0x427b49[_0x748c('0x30')][_0x748c('0x2d')]=_0x427b49['file'][_0x748c('0x6c')];_0x427b49[_0x748c('0x30')][_0x748c('0x6d')]=_0x427b49[_0x748c('0x6e')][_0x748c('0x6f')];_0x427b49[_0x748c('0x30')][_0x748c('0x36')]=_0x427b49['file'][_0x748c('0x70')];return db[_0x748c('0x71')][_0x748c('0x4a')](_0x427b49[_0x748c('0x30')])[_0x748c('0x16')](respondWithResult(_0x47784c,0xc9))[_0x748c('0x1f')](handleError(_0x47784c,null));};exports[_0x748c('0x72')]=function(_0x191bcd,_0x587fa5){return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x191bcd[_0x748c('0x3c')]['id']},'raw':!![]})[_0x748c('0x16')](handleEntityNotFound(_0x587fa5,null))[_0x748c('0x16')](function(_0x88b355){if(_0x88b355){if(_0x88b355[_0x748c('0x68')]){return _0x587fa5[_0x748c('0x21')](0x193)[_0x748c('0x23')]({'status':0x193,'message':_0x748c('0x73')});}return db[_0x748c('0x71')][_0x748c('0x4c')]({'where':{'id':_0x191bcd[_0x748c('0x3f')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x587fa5,null));}})['then'](function(_0x269b89){if(_0x269b89){var _0x3648d3=_0x269b89['ChatOfflineMessageId']!==null;var _0x2a3b88=path[_0x748c('0x74')](config['root'],_0x748c('0x75'));if(_0x3648d3){_0x2a3b88=path[_0x748c('0x74')](_0x2a3b88,_0x748c('0x76'));}var _0x27cee3=path[_0x748c('0x74')](_0x2a3b88,_0x269b89[_0x748c('0x6d')]);return _0x587fa5[_0x748c('0x77')](_0x27cee3);}})['catch'](handleError(_0x587fa5,null));};exports[_0x748c('0x78')]=function(_0x548ae1,_0x1fade1){var _0x391f39=null;var _0x47d239=null;var _0x29a62d=null;if(_0x548ae1['body']['id']){delete _0x548ae1['body']['id'];}if(_0x548ae1[_0x748c('0x30')]['mailTranscript']){_0x29a62d=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0x7a'),util[_0x748c('0x7b')](_0x748c('0x7c'),Date[_0x748c('0x7d')]()));_0x548ae1[_0x748c('0x30')][_0x748c('0x7e')]=_0x29a62d;}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x548ae1[_0x748c('0x3c')]['id']},'include':[{'model':db[_0x748c('0x5e')],'as':'Messages','include':[{'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f')}]}]})[_0x748c('0x16')](handleEntityNotFound(_0x1fade1,null))[_0x748c('0x16')](saveUpdates(_0x548ae1[_0x748c('0x30')],null))[_0x748c('0x16')](function(_0x1c331c){if(_0x1c331c){_0x391f39=_0x1c331c;return db['ChatWebsite'][_0x748c('0x49')]({'where':{'id':_0x391f39['ChatWebsiteId']}});}})[_0x748c('0x16')](function(_0x1fe033){if(_0x1fe033){_0x47d239=_0x1fe033;return db[_0x748c('0x62')][_0x748c('0x49')]({'where':{'id':_0x391f39[_0x748c('0x80')]}});}})[_0x748c('0x16')](function(_0x339a03){if(_0x339a03){if(_0x29a62d){var _0x5c0dc8=null;for(var _0x4b7fc5=0x1;_0x4b7fc5<_0x391f39[_0x748c('0x81')]['length'];++_0x4b7fc5){_0x5c0dc8=_0x391f39[_0x748c('0x81')][_0x4b7fc5];var _0x468208=_0x5c0dc8['UserId']?util[_0x748c('0x7b')]('%s%d',_0x47d239[_0x748c('0x82')],_0x5c0dc8[_0x748c('0x67')]):'System';var _0x50e2fc=_0x548ae1[_0x748c('0x30')]['customer']||util['format']('%s%d',_0x748c('0x83'),_0x5c0dc8[_0x748c('0x80')]);switch(_0x47d239[_0x748c('0x84')]){case _0x748c('0x85'):_0x468208=_0x5c0dc8['UserId']?util[_0x748c('0x7b')](_0x748c('0x86'),_0x47d239['agentAlias'],_0x5c0dc8[_0x748c('0x67')]):_0x748c('0x87');break;case _0x748c('0x88'):_0x468208=_0x5c0dc8[_0x748c('0x67')]?_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x89')]||_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x52')]:_0x748c('0x87');break;case'agent_fullname':_0x468208=_0x5c0dc8['UserId']?_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x52')]:'System';break;default:_0x468208=_0x5c0dc8[_0x748c('0x67')]?util[_0x748c('0x7b')](_0x748c('0x86'),_0x47d239[_0x748c('0x82')],_0x5c0dc8[_0x748c('0x67')]):_0x748c('0x87');}var _0x1140ee=util[_0x748c('0x7b')](_0x748c('0x8a'),moment(_0x5c0dc8[_0x748c('0x8b')])[_0x748c('0x7b')](_0x748c('0x8c')),_0x5c0dc8[_0x748c('0x8d')]==='in'?_0x50e2fc:_0x468208,_0x5c0dc8[_0x748c('0x30')]);if(!_0x5c0dc8['secret']){fs['appendFileSync'](_0x29a62d,_0x1140ee);}}return db[_0x748c('0x8e')][_0x748c('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x748c('0x8f')],'as':_0x748c('0x90'),'raw':!![],'include':[{'model':db[_0x748c('0x91')],'as':_0x748c('0x91'),'raw':!![]}]}]});}}})['then'](function(_0x5ebb4c){if(!_0x5ebb4c||!_0x5ebb4c[_0x748c('0x90')]||!_0x548ae1[_0x748c('0x30')])return _0x391f39;var _0x5ab3a3=_0x5ebb4c[_0x748c('0x92')]();return respondWithRpcPromise(_0x748c('0x93'),_0x748c('0x94'),{'account':_0x5ab3a3,'message':{'from':util[_0x748c('0x7b')](_0x748c('0x95'),_0x5ebb4c[_0x748c('0x2d')],_0x5ebb4c[_0x748c('0x53')]||_0x5ebb4c[_0x748c('0x90')]['user']),'to':_0x548ae1[_0x748c('0x30')][_0x748c('0x96')],'subject':_0x748c('0x97'),'text':util['format'](_0x748c('0x98'),_0x548ae1['body'][_0x748c('0x96')]),'attachments':[{'path':_0x29a62d}]}})[_0x748c('0x16')](function(){return _0x391f39;})['catch'](function(_0x43f612){logger[_0x748c('0x1b')](_0x43f612);});})[_0x748c('0x16')](respondWithStatusCode(_0x1fade1,0xc8))[_0x748c('0x1f')](handleError(_0x1fade1,null));};exports[_0x748c('0x99')]=function(_0x5b40a0,_0x11362a){return db['ChatMessage']['find']({'where':{'id':_0x5b40a0['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x11362a,null))[_0x748c('0x16')](function(_0x245445){if(_0x245445){return _0x245445[_0x748c('0x99')](_0x5b40a0['body']['ids'],_['omit'](_0x5b40a0[_0x748c('0x30')],[_0x748c('0x9a'),'id'])||{});}})[_0x748c('0x16')](respondWithResult(_0x11362a,null))['catch'](handleError(_0x11362a,null));};exports[_0x748c('0x9b')]=function(_0x49b2fb,_0x2b652f){var _0x57c2ac={'raw':![],'where':{}};var _0x1f2379={};var _0x11a3da={'count':0x0,'rows':[]};return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x49b2fb['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x2b652f,null))[_0x748c('0x16')](function(_0xc14dd6){if(_0xc14dd6){_0x1f2379[_0x748c('0x3d')]=_[_0x748c('0x40')](db['ChatMessage']['rawAttributes']);_0x1f2379['query']=_['keys'](_0x49b2fb['query']);_0x1f2379[_0x748c('0x41')]=_[_0x748c('0x9c')](_0x1f2379[_0x748c('0x3d')],_0x1f2379['query']);_0x57c2ac[_0x748c('0x43')]=_[_0x748c('0x9c')](_0x1f2379[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x49b2fb[_0x748c('0x3f')][_0x748c('0x42')]));_0x57c2ac[_0x748c('0x43')]=_0x57c2ac[_0x748c('0x43')][_0x748c('0x44')]?_0x57c2ac[_0x748c('0x43')]:_0x1f2379[_0x748c('0x3d')];if(!_0x49b2fb[_0x748c('0x3f')]['hasOwnProperty']('nolimit')){_0x57c2ac[_0x748c('0x25')]=qs[_0x748c('0x25')](_0x49b2fb[_0x748c('0x3f')]['limit']);_0x57c2ac[_0x748c('0x27')]=qs[_0x748c('0x27')](_0x49b2fb[_0x748c('0x3f')]['offset']);}_0x57c2ac['order']=qs[_0x748c('0x9d')](_0x49b2fb[_0x748c('0x3f')][_0x748c('0x9d')]);_0x57c2ac[_0x748c('0x9e')]=qs[_0x748c('0x41')](_['pick'](_0x49b2fb['query'],_0x1f2379[_0x748c('0x41')]));_0x57c2ac[_0x748c('0x9e')][_0x748c('0x9f')]=_0xc14dd6['id'];if(_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa0')]){_0x57c2ac[_0x748c('0x9e')]=_[_0x748c('0x47')](_0x57c2ac[_0x748c('0x9e')],{'$or':_[_0x748c('0x33')](_0x57c2ac[_0x748c('0x43')],function(_0x215f11){var _0x317f4a={};_0x317f4a[_0x215f11]={'$like':'%'+_0x49b2fb['query'][_0x748c('0xa0')]+'%'};return _0x317f4a;})});}if(_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa1')]){var _0x379f14=_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa1')][_0x748c('0xa2')](',');var _0x29a108={};_0x29a108[_0x379f14[0x0]]={'$gte':moment(_0x379f14[0x1])[_0x748c('0x7b')](_0x748c('0xa3'))};_0x57c2ac[_0x748c('0x9e')]=_['merge'](_0x57c2ac[_0x748c('0x9e')],_0x29a108);}_0x57c2ac=_[_0x748c('0x47')]({},_0x57c2ac,_0x49b2fb[_0x748c('0x48')]);return db['ChatMessage'][_0x748c('0x26')]({'where':_0x57c2ac[_0x748c('0x9e')]})['then'](function(_0x465230){_0x11a3da[_0x748c('0x26')]=_0x465230;if(_0x49b2fb['query'][_0x748c('0x45')]){_0x57c2ac[_0x748c('0x46')]=[{'all':!![]}];}return db['ChatMessage'][_0x748c('0xa4')](_0x57c2ac);})[_0x748c('0x16')](function(_0xa8d724){_0x11a3da['rows']=_0xa8d724;return _0x11a3da;});}})[_0x748c('0x16')](respondWithFilteredResult(_0x2b652f,_0x57c2ac))[_0x748c('0x1f')](handleError(_0x2b652f,null));};exports['getMyMessages']=function(_0x60b5c1,_0x2e3e66){var _0x395bda={'where':{}},_0x550d43={},_0xa2d4ca={'count':0x0,'rows':[]};return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x60b5c1[_0x748c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2e3e66,null))[_0x748c('0x16')](function(_0x1d2180){if(_0x1d2180){_0x550d43[_0x748c('0x3d')]=_[_0x748c('0x40')](db[_0x748c('0x5e')][_0x748c('0x3e')]);_0x550d43[_0x748c('0x3f')]=_['keys'](_0x60b5c1[_0x748c('0x3f')]);_0x550d43[_0x748c('0x41')]=_['intersection'](_0x550d43[_0x748c('0x3d')],_0x550d43[_0x748c('0x3f')]);_0x395bda['attributes']=_[_0x748c('0x9c')](_0x550d43[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x42')]));_0x395bda[_0x748c('0x43')]=_0x395bda['attributes'][_0x748c('0x44')]?_0x395bda[_0x748c('0x43')]:_0x550d43[_0x748c('0x3d')];if(!_0x60b5c1[_0x748c('0x3f')][_0x748c('0xa5')](_0x748c('0xa6'))){_0x395bda['limit']=qs[_0x748c('0x25')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x25')]);_0x395bda[_0x748c('0x27')]=qs[_0x748c('0x27')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x27')]);}_0x395bda[_0x748c('0xa7')]=qs[_0x748c('0x9d')](_0x60b5c1[_0x748c('0x3f')]['sort']);_0x395bda[_0x748c('0x9e')]=qs[_0x748c('0x41')](_[_0x748c('0xa8')](_0x60b5c1[_0x748c('0x3f')],_0x550d43['filters']));_0x395bda[_0x748c('0x9e')][_0x748c('0x9f')]=_0x1d2180['id'];if(_0x60b5c1[_0x748c('0x3f')][_0x748c('0xa0')]){_0x395bda[_0x748c('0x9e')]=_['merge'](_0x395bda[_0x748c('0x9e')],{'$or':_[_0x748c('0x33')](_0x395bda[_0x748c('0x43')],function(_0x2c1cc6){var _0x492fe4={};_0x492fe4[_0x2c1cc6]={'$like':'%'+_0x60b5c1['query'][_0x748c('0xa0')]+'%'};return _0x492fe4;})});}_0x395bda[_0x748c('0x9e')][_0x748c('0xa9')]=![];if(_0x60b5c1[_0x748c('0x3f')]['id']){_0x395bda[_0x748c('0x9e')]['id']={'$gt':_0x60b5c1[_0x748c('0x3f')]['id']};}_0x395bda=_[_0x748c('0x47')]({},_0x395bda,_0x60b5c1[_0x748c('0x48')]);return db['ChatMessage'][_0x748c('0x26')]({'where':_0x395bda[_0x748c('0x9e')]})[_0x748c('0x16')](function(_0x2e45a4){_0xa2d4ca[_0x748c('0x26')]=_0x2e45a4;_0x395bda[_0x748c('0x46')]=[];if(_0x60b5c1['query'][_0x748c('0xaa')]){_0x395bda['include']['push']({'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f'),'attributes':['id',_0x748c('0x52'),_0x748c('0x89')]});}if(_0x60b5c1[_0x748c('0x3f')][_0x748c('0x45')]){_0x395bda['include']=[{'all':!![]}];}return db['ChatMessage'][_0x748c('0xa4')](_0x395bda);})[_0x748c('0x16')](function(_0x533f34){_0xa2d4ca['rows']=_0x533f34;return _0xa2d4ca;});}})['then'](respondWithFilteredResult(_0x2e3e66,_0x395bda))[_0x748c('0x1f')](handleError(_0x2e3e66,null));};exports['addTags']=function(_0x106fb7,_0x56dd0b){return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x106fb7[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x56dd0b,null))['then'](function(_0x3c814d){if(_0x3c814d){return _0x3c814d[_0x748c('0xab')](_0x106fb7[_0x748c('0x30')][_0x748c('0x9a')],_['omit'](_0x106fb7['body'],[_0x748c('0x9a'),'id'])||{})['spread'](function(){return db[_0x748c('0xac')][_0x748c('0xa4')]({'attributes':['id',_0x748c('0x2d'),_0x748c('0xad')],'where':{'id':_0x106fb7[_0x748c('0x30')][_0x748c('0x9a')]}});})[_0x748c('0x16')](function(_0x1de4ad){socket[_0x748c('0xae')]('chatInteractionTags:save',{'id':Number(_0x106fb7[_0x748c('0x3c')]['id']),'tags':_0x1de4ad||[]});return{'id':Number(_0x106fb7['params']['id']),'tags':_0x1de4ad||[]};});}})['then'](respondWithResult(_0x56dd0b,null))['catch'](handleError(_0x56dd0b,null));};exports[_0x748c('0xaf')]=function(_0x19b2e1,_0x389179){return db['ChatInteraction'][_0x748c('0x49')]({'where':{'id':_0x19b2e1['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x389179,null))['then'](function(_0x483c7e){if(_0x483c7e){return _0x483c7e[_0x748c('0xaf')](_0x19b2e1[_0x748c('0x3f')][_0x748c('0x9a')]);}})['then'](respondWithStatusCode(_0x389179,null))[_0x748c('0x1f')](handleError(_0x389179,null));};exports[_0x748c('0x77')]=function(_0x164b70,_0x37e99e){var _0x32062e=moment()[_0x748c('0xb0')]()[_0x748c('0xb1')]();var _0x163319=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0xb2'),'files','tmp');var _0x11d584=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0xb2'),_0x748c('0xb3'),'attachments');var _0x502499=path['join'](_0x163319,_0x32062e);var _0x2616f9=util['format'](_0x748c('0xb4'),_0x164b70['params']['id'],_0x32062e);var _0x38dd53=path[_0x748c('0x74')](_0x163319,_0x2616f9);var _0x16c8e8=[];_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f'),'attributes':['id',_0x748c('0x52')],'raw':!![]});_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x62')],'as':_0x748c('0x63'),'attributes':['id',_0x748c('0xb6'),_0x748c('0xb7')],'raw':!![]});if(_0x164b70[_0x748c('0x3f')]['attachments']){_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x71')],'as':'Attachment','raw':!![]});}var _0x30685c=[{'model':db[_0x748c('0x5e')],'as':_0x748c('0x81'),'attributes':['id',_0x748c('0x30'),_0x748c('0x8b'),'direction',_0x748c('0xa9'),_0x748c('0xb8')],'include':_0x16c8e8}];_0x30685c[_0x748c('0xb5')]({'model':db['ChatWebsite'],'as':_0x748c('0xb9'),'attributes':['id','name']});_0x30685c[_0x748c('0xb5')]({'model':db[_0x748c('0x7f')],'as':_0x748c('0xba'),'attributes':['id',_0x748c('0x52')]});return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x164b70['params']['id']},'include':_0x30685c})[_0x748c('0x16')](handleEntityNotFound(_0x37e99e,null))[_0x748c('0x16')](function(_0x460186){if(_0x460186){var _0x25215a=_0x460186[_0x748c('0xbb')]({'plain':!![]});fs[_0x748c('0xbc')](_0x502499);var _0x33c53a={'channel':'Chat','account':_0x25215a[_0x748c('0xb9')]['name'],'agent':_0x25215a['Owner']?_0x25215a[_0x748c('0xba')][_0x748c('0x52')]:'N.A.','createdAt':moment(_0x25215a['createdAt'])[_0x748c('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x25215a[_0x748c('0x68')]?moment(_0x25215a[_0x748c('0xbd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x748c('0xb1')]():'','disposition':_0x25215a[_0x748c('0x69')],'chatInfo':{'browser':_0x25215a['browserName'],'os':_0x25215a[_0x748c('0xbe')],'referer':_0x25215a[_0x748c('0xbf')],'customerIp':_0x25215a[_0x748c('0xc0')],'customerPort':_0x25215a['customerPort']?_0x25215a[_0x748c('0xc1')]:'N.A.'},'messages':_(_0x25215a[_0x748c('0x81')])[_0x748c('0xc2')]()[_0x748c('0xa0')]({'secret':![]})['map'](function(_0x2fb608){if(_0x2fb608[_0x748c('0x71')]){var _0xc12fae=path['join'](_0x11d584,_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')]);if(fs[_0x748c('0xc3')](_0xc12fae)){fs[_0x748c('0xc4')](_0xc12fae)[_0x748c('0xc5')](fs['createWriteStream'](path[_0x748c('0x74')](_0x502499,_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')])));}}return{'date':moment(_0x2fb608[_0x748c('0x8b')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2fb608['direction']===_0x748c('0xc6')?_0x2fb608[_0x748c('0x7f')]?_0x2fb608[_0x748c('0x7f')][_0x748c('0x52')]:_0x748c('0x87'):_0x2fb608[_0x748c('0x63')][_0x748c('0xb6')]+(_0x2fb608['Contact']['lastName']?'\x20'+_0x2fb608[_0x748c('0x63')][_0x748c('0xb7')]:''),'body':_0x2fb608[_0x748c('0x71')]?_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')]:_0x2fb608[_0x748c('0x30')],'direction':_0x2fb608[_0x748c('0x8d')]==='out'?'A':'C','secret':_0x2fb608[_0x748c('0xa9')],'read':_0x2fb608['read'],'attachment':_0x2fb608[_0x748c('0x71')]};})['value']()};return ejs[_0x748c('0xc7')](path[_0x748c('0x74')](config['root'],_0x748c('0xb2'),_0x748c('0xc8'),_0x748c('0xc9')),{'interaction':_0x33c53a})['then'](function(_0x8225b9){var _0xcd7506=path[_0x748c('0x74')](_0x502499,_0x748c('0xca')+_0x25215a['id']+'-'+_0x32062e+_0x748c('0xcb'));var _0x5a5a90={'path':_0xcd7506,'channel':_0x748c('0xcc'),'interactionId':_0x25215a['id']};return pdf['createPdfFromHTML'](_0x8225b9,_0x5a5a90);})[_0x748c('0x16')](function(){return new Promise(function(_0xafd4d2,_0x49d053){zipdir(_0x502499,{'saveTo':_0x38dd53},function(_0x3ddb34,_0x5eb960){if(_0x3ddb34)return _0x49d053(_0x3ddb34);return _0xafd4d2(_0x5eb960);});})[_0x748c('0x16')](function(){return new BPromise(function(_0x5bf18f,_0x4bd855){rimraf(_0x502499,function(_0x5cbf2f){if(_0x5cbf2f)_0x4bd855(_0x5cbf2f);return _0x5bf18f();});});})[_0x748c('0x16')](function(){return _0x37e99e['download'](_0x38dd53,_0x2616f9,function(_0xbcbf66){if(_0xbcbf66){logger[_0x748c('0x1b')](_0x748c('0xcd'),_0xbcbf66);}else{fs[_0x748c('0xce')](_0x38dd53);}});});});}else{return _0x37e99e[_0x748c('0x20')](0xc8);}})['catch'](handleError(_0x37e99e,null));}; \ No newline at end of file +var _0x2e37=['Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','originalname','basename','filename','file','mimetype','attachmentDownload','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','User','ChatWebsiteId','ContactId','Messages','agentAlias','System','%s%d','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','order','sort','where','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','hasOwnProperty','secret','includeAgent','push','addTags','Tag','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','read','Account','Owner','mkdirSync','Chat','N.A.','browserName','osName','referer','customerPort','tail','pipe','createWriteStream','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','register','jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','sendStatus','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','getOptions','findAll','chat','query','user','params','keys','rawAttributes','filters','attributes','intersection','model','fields','length','includeAll','include','options','find','create','describe','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage'];(function(_0x2c31c8,_0x1afda3){var _0x1d8bba=function(_0x4d5a68){while(--_0x4d5a68){_0x2c31c8['push'](_0x2c31c8['shift']());}};_0x1d8bba(++_0x1afda3);}(_0x2e37,0x13d));var _0x72e3=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x2e37[_0x1044e5];return _0x5ad0dd;};'use strict';var rimraf=require(_0x72e3('0x0'));var zipdir=require('zip-dir');var rp=require(_0x72e3('0x1'));var moment=require(_0x72e3('0x2'));var BPromise=require(_0x72e3('0x3'));var Mustache=require(_0x72e3('0x4'));var util=require(_0x72e3('0x5'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x72e3('0x6'));var Redis=require('ioredis');var interaction=require(_0x72e3('0x7'));var qs=require(_0x72e3('0x8'));var pdf=require(_0x72e3('0x9'));var logger=require(_0x72e3('0xa'))(_0x72e3('0xb'));var config=require(_0x72e3('0xc'));var db=require(_0x72e3('0xd'))['db'];config['redis']=_[_0x72e3('0xe')](config[_0x72e3('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72e3('0xf')]));require('./chatInteraction.socket')[_0x72e3('0x10')](socket);var jayson=require(_0x72e3('0x11'));var client=jayson[_0x72e3('0x12')][_0x72e3('0x13')]({'port':0x232b});var client9004=jayson[_0x72e3('0x12')][_0x72e3('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x4b96ea,_0x240618,_0x28be60,_0x53c173){return new BPromise(function(_0x4c272f,_0x956e2d){var _0x4b3263=_0x53c173||client;return _0x4b3263['request'](_0x4b96ea,_0x28be60)['then'](function(_0x429325){logger[_0x72e3('0x14')](_0x72e3('0x15'),_0x240618,_0x72e3('0x16'));logger[_0x72e3('0x17')](_0x72e3('0x18'),_0x240618,_0x72e3('0x16'),JSON[_0x72e3('0x19')](_0x429325));if(_0x429325[_0x72e3('0x1a')]){if(_0x429325[_0x72e3('0x1a')]['code']===0x1f4){logger[_0x72e3('0x1a')](_0x72e3('0x15'),_0x240618,_0x429325[_0x72e3('0x1a')][_0x72e3('0x1b')]);return _0x956e2d(_0x429325[_0x72e3('0x1a')][_0x72e3('0x1b')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x240618,_0x429325[_0x72e3('0x1a')][_0x72e3('0x1b')]);return _0x4c272f(_0x429325[_0x72e3('0x1a')][_0x72e3('0x1b')]);}else{logger[_0x72e3('0x14')](_0x72e3('0x15'),_0x240618,_0x72e3('0x16'));_0x4c272f(_0x429325[_0x72e3('0x1c')][_0x72e3('0x1b')]);}})[_0x72e3('0x1d')](function(_0x5d7723){logger[_0x72e3('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x240618,_0x5d7723);_0x956e2d(_0x5d7723);});});}function respondWithStatusCode(_0x280fe3,_0x4b1f48){_0x4b1f48=_0x4b1f48||0xcc;return function(_0x471fb5){if(_0x471fb5){return _0x280fe3['sendStatus'](_0x4b1f48);}return _0x280fe3[_0x72e3('0x1e')](_0x4b1f48)[_0x72e3('0x1f')]();};}function respondWithResult(_0x42165e,_0x3bbc29){_0x3bbc29=_0x3bbc29||0xc8;return function(_0x4bf5b5){if(_0x4bf5b5){return _0x42165e['status'](_0x3bbc29)[_0x72e3('0x20')](_0x4bf5b5);}};}function respondWithFilteredResult(_0x553f8d,_0x22daba){return function(_0x358236){if(_0x358236){var _0x10ff7d=typeof _0x22daba[_0x72e3('0x21')]==='undefined'&&typeof _0x22daba[_0x72e3('0x22')]===_0x72e3('0x23');var _0x461ba9=_0x358236[_0x72e3('0x24')];var _0x42834a=_0x10ff7d?0x0:_0x22daba[_0x72e3('0x21')];var _0x4e813c=_0x10ff7d?_0x358236[_0x72e3('0x24')]:_0x22daba[_0x72e3('0x21')]+_0x22daba[_0x72e3('0x22')];var _0x221843;if(_0x4e813c>=_0x461ba9){_0x4e813c=_0x461ba9;_0x221843=0xc8;}else{_0x221843=0xce;}_0x553f8d['status'](_0x221843);return _0x553f8d[_0x72e3('0x25')](_0x72e3('0x26'),_0x42834a+'-'+_0x4e813c+'/'+_0x461ba9)[_0x72e3('0x20')](_0x358236);}return null;};}function saveUpdates(_0x2a8ea5){return function(_0x33bef6){if(_0x33bef6){return _0x33bef6['update'](_0x2a8ea5)[_0x72e3('0x27')](function(_0x244227){return _0x244227;});}return null;};}function removeEntity(_0x14e686){return function(_0x3117a4){if(_0x3117a4){return _0x3117a4[_0x72e3('0x28')]()[_0x72e3('0x27')](function(){_0x14e686[_0x72e3('0x1e')](0xcc)[_0x72e3('0x1f')]();});}};}function handleEntityNotFound(_0x407d89){return function(_0x38fba7){if(!_0x38fba7){_0x407d89[_0x72e3('0x29')](0x194);}return _0x38fba7;};}function handleError(_0x476281,_0x2aa675){_0x2aa675=_0x2aa675||0x1f4;return function(_0x144ae5){logger[_0x72e3('0x1a')](_0x144ae5[_0x72e3('0x2a')]);if(_0x144ae5[_0x72e3('0x2b')]){delete _0x144ae5['name'];}_0x476281[_0x72e3('0x1e')](_0x2aa675)[_0x72e3('0x2c')](_0x144ae5);};}function getMustacheRender(_0x2b80a9,_0x17b6da){return Mustache[_0x72e3('0x2d')](_0x2b80a9,_[_0x72e3('0x2e')](_0x17b6da[_0x72e3('0x2f')],{'contact':_0x17b6da[_0x72e3('0x30')],'message':_0x17b6da[_0x72e3('0x1b')],'agent':_0x17b6da[_0x72e3('0x31')],'interaction':_0x17b6da[_0x72e3('0x32')],'account':_0x17b6da[_0x72e3('0x33')]}))||'';}exports[_0x72e3('0x34')]=function(_0x388f9f,_0x183988){var _0xe5d408={};var _0x8a3d3c=_[_0x72e3('0x35')](db[_0x72e3('0x36')]['rawAttributes'],function(_0x47a0d0){return{'name':_0x47a0d0[_0x72e3('0x37')],'type':_0x47a0d0[_0x72e3('0x38')]['key']};});_0xe5d408=qs[_0x72e3('0x39')](_0x8a3d3c,_0x388f9f);return interaction[_0x72e3('0x3a')](_0x72e3('0x3b'),_0x388f9f[_0x72e3('0x3c')],_0x388f9f[_0x72e3('0x3d')],_0xe5d408,_0x8a3d3c)[_0x72e3('0x27')](respondWithFilteredResult(_0x183988,_0xe5d408))['catch'](handleError(_0x183988,null));};exports['show']=function(_0x43586c,_0x17277c){var _0x1291f0={'raw':![],'where':{'id':_0x43586c[_0x72e3('0x3e')]['id']}},_0x3a759f={};_0x3a759f['model']=_[_0x72e3('0x3f')](db[_0x72e3('0x36')][_0x72e3('0x40')]);_0x3a759f[_0x72e3('0x3c')]=_[_0x72e3('0x3f')](_0x43586c[_0x72e3('0x3c')]);_0x3a759f[_0x72e3('0x41')]=_['intersection'](_0x3a759f['model'],_0x3a759f[_0x72e3('0x3c')]);_0x1291f0[_0x72e3('0x42')]=_[_0x72e3('0x43')](_0x3a759f[_0x72e3('0x44')],qs[_0x72e3('0x45')](_0x43586c[_0x72e3('0x3c')]['fields']));_0x1291f0['attributes']=_0x1291f0[_0x72e3('0x42')][_0x72e3('0x46')]?_0x1291f0[_0x72e3('0x42')]:_0x3a759f[_0x72e3('0x44')];if(_0x43586c[_0x72e3('0x3c')][_0x72e3('0x47')]){_0x1291f0[_0x72e3('0x48')]=[{'all':!![]}];}_0x1291f0=_[_0x72e3('0x2e')]({},_0x1291f0,_0x43586c[_0x72e3('0x49')]);return db[_0x72e3('0x36')][_0x72e3('0x4a')](_0x1291f0)[_0x72e3('0x27')](handleEntityNotFound(_0x17277c,null))[_0x72e3('0x27')](respondWithResult(_0x17277c,null))['catch'](handleError(_0x17277c,null));};exports[_0x72e3('0x4b')]=function(_0x593e4d,_0x12c9f1){return db['ChatInteraction'][_0x72e3('0x4b')](_0x593e4d[_0x72e3('0x2f')],{})[_0x72e3('0x27')](respondWithResult(_0x12c9f1,0xc9))[_0x72e3('0x1d')](handleError(_0x12c9f1,null));};exports['update']=function(_0x4872be,_0x408815){if(_0x4872be['body']['id']){delete _0x4872be[_0x72e3('0x2f')]['id'];}return db[_0x72e3('0x36')][_0x72e3('0x4a')]({'where':{'id':_0x4872be[_0x72e3('0x3e')]['id']}})[_0x72e3('0x27')](handleEntityNotFound(_0x408815,null))[_0x72e3('0x27')](saveUpdates(_0x4872be[_0x72e3('0x2f')],null))[_0x72e3('0x27')](respondWithResult(_0x408815,null))['catch'](handleError(_0x408815,null));};exports[_0x72e3('0x28')]=function(_0xe0fc96,_0x580b8f){return db[_0x72e3('0x36')]['find']({'where':{'id':_0xe0fc96['params']['id']}})[_0x72e3('0x27')](handleEntityNotFound(_0x580b8f,null))[_0x72e3('0x27')](removeEntity(_0x580b8f,null))['catch'](handleError(_0x580b8f,null));};exports['describe']=function(_0x1d305c,_0x1f4304){return db[_0x72e3('0x36')][_0x72e3('0x4c')]()[_0x72e3('0x27')](respondWithResult(_0x1f4304,null))[_0x72e3('0x1d')](handleError(_0x1f4304,null));};exports['createVidaooSession']=function(_0x8297f7,_0x265333){var _0x18aa7b=_0x8297f7[_0x72e3('0x3e')]['id'];var _0x43c775;var _0x3e5336;var _0x28be96;return db['ChatInteraction']['findOne']({'where':{'id':_0x18aa7b}})[_0x72e3('0x27')](function(_0x566adf){_0x43c775=_0x566adf;return db[_0x72e3('0x4d')][_0x72e3('0x4e')]({'where':{'id':_0x566adf['ChatWebsiteId']},'attributes':['id',_0x72e3('0x4f'),_0x72e3('0x50'),_0x72e3('0x51'),_0x72e3('0x52'),_0x72e3('0x53')],'raw':!![]});})['then'](function(_0x177720){if(_0x177720&&_0x177720['vidaooApiKey']&&_0x177720[_0x72e3('0x50')]){_0x3e5336=_0x177720;var _0x2705aa={'interaction':{'id':_0x18aa7b},'agent':{'id':_0x8297f7[_0x72e3('0x3d')]['id'],'name':_0x8297f7['user'][_0x72e3('0x2b')],'fullname':_0x8297f7[_0x72e3('0x3d')][_0x72e3('0x54')],'email':_0x8297f7['user'][_0x72e3('0x55')]},'contact':_0x8297f7[_0x72e3('0x2f')]['contact'],'account':_0x8297f7[_0x72e3('0x2f')][_0x72e3('0x33')]};var _0x5706d3={'rejectUnauthorized':![],'method':'POST','url':_0x72e3('0x56'),'headers':{'X-APIKEY':_0x177720[_0x72e3('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8297f7[_0x72e3('0x3d')][_0x72e3('0x55')]],'buttons':null,'topic':_0x3e5336['vidaooTopic'],'note':_[_0x72e3('0x57')](_0x3e5336[_0x72e3('0x52')])?null:getMustacheRender(_0x3e5336['vidaooNote'],_0x2705aa),'metadata':null},'redirect':_0x72e3('0x58'),'json':!![]};try{if(!_['isNull'](_0x3e5336[_0x72e3('0x53')])){var _0x2da563=getMustacheRender(_0x3e5336[_0x72e3('0x53')],_0x2705aa);var _0x6b5118=JSON[_0x72e3('0x59')](_0x2da563);_0x5706d3[_0x72e3('0x2f')][_0x72e3('0x5a')]=_0x6b5118;}}catch(_0x9d45eb){throw new db[(_0x72e3('0x5b'))][(_0x72e3('0x5c'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5706d3);}else{throw new db[(_0x72e3('0x5b'))][(_0x72e3('0x5c'))](_0x72e3('0x5d'));}})[_0x72e3('0x27')](function(_0x54bc41){_0x28be96=_0x54bc41;if(_0x28be96['id']){var _0x4f02d9={'body':_0x28be96[_0x72e3('0x5e')],'ChatWebsiteId':_0x3e5336['id'],'ChatInteractionId':_0x43c775['id'],'direction':_0x72e3('0x5f'),'UserId':_0x8297f7[_0x72e3('0x3d')]['id']};return db[_0x72e3('0x60')]['create'](_0x4f02d9,{});}else{throw new db[(_0x72e3('0x5b'))][(_0x72e3('0x5c'))](_0x72e3('0x61'));}})['then'](function(){return _0x43c775[_0x72e3('0x62')]({'vidaooSessionId':_0x28be96['id']});})[_0x72e3('0x27')](respondWithResult(_0x265333,null))[_0x72e3('0x1d')](handleError(_0x265333,null));};exports[_0x72e3('0x63')]=function(_0x434d2b,_0x3ae90f){if(_0x434d2b[_0x72e3('0x2f')]['id']){delete _0x434d2b[_0x72e3('0x2f')]['id'];}return db[_0x72e3('0x36')][_0x72e3('0x4a')]({'where':{'id':_0x434d2b[_0x72e3('0x3e')]['id']},'include':[{'model':db[_0x72e3('0x64')],'as':_0x72e3('0x65')}]})['then'](handleEntityNotFound(_0x3ae90f,null))[_0x72e3('0x27')](saveUpdates(_0x434d2b['body'],null))['then'](respondWithResult(_0x3ae90f,null))['catch'](handleError(_0x3ae90f,null));};exports[_0x72e3('0x66')]=function(_0x494f85,_0x11016a){if(_0x494f85[_0x72e3('0x2f')]['id']){delete _0x494f85[_0x72e3('0x2f')]['id'];}return db[_0x72e3('0x36')][_0x72e3('0x4a')]({'where':{'id':_0x494f85[_0x72e3('0x3e')]['id']}})[_0x72e3('0x27')](function(_0x35016c){if(!_0x35016c){logger[_0x72e3('0x1a')](_0x72e3('0x67'),_0x72e3('0x66'),0x194,_0x72e3('0x68'));_0x11016a[_0x72e3('0x29')](0x194);}else{if(_0x35016c[_0x72e3('0x69')]){throw new db[(_0x72e3('0x5b'))]['ValidationError'](_0x72e3('0x6a'));}}return _0x35016c;})['then'](function(_0x13802f){if(_0x13802f){return _0x13802f['update']({'closed':_0x494f85[_0x72e3('0x2f')][_0x72e3('0x6b')],'disposition':_0x494f85['body'][_0x72e3('0x6c')]})['then'](function(_0x34c6c1){return _0x34c6c1;});}})[_0x72e3('0x27')](function(){return respondWithRpcPromise('AbandonInteraction',_0x72e3('0x66'),_0x494f85[_0x72e3('0x2f')],client9004);})[_0x72e3('0x27')](respondWithResult(_0x11016a,null))[_0x72e3('0x1d')](handleError(_0x11016a,null));};exports['attachmentUpload']=function(_0x4eb8e5,_0xc9d225){_0x4eb8e5['body']['name']=_0x4eb8e5['file'][_0x72e3('0x6d')];_0x4eb8e5[_0x72e3('0x2f')][_0x72e3('0x6e')]=_0x4eb8e5['file'][_0x72e3('0x6f')];_0x4eb8e5[_0x72e3('0x2f')][_0x72e3('0x38')]=_0x4eb8e5[_0x72e3('0x70')][_0x72e3('0x71')];return db['Attachment'][_0x72e3('0x4b')](_0x4eb8e5[_0x72e3('0x2f')])[_0x72e3('0x27')](respondWithResult(_0xc9d225,0xc9))[_0x72e3('0x1d')](handleError(_0xc9d225,null));};exports[_0x72e3('0x72')]=function(_0x328fdc,_0x140ad7){return db[_0x72e3('0x36')][_0x72e3('0x4e')]({'where':{'id':_0x328fdc[_0x72e3('0x3e')]['id']},'raw':!![]})[_0x72e3('0x27')](handleEntityNotFound(_0x140ad7,null))[_0x72e3('0x27')](function(_0x2e620e){if(_0x2e620e){if(_0x2e620e[_0x72e3('0x6b')]){return _0x140ad7['status'](0x193)[_0x72e3('0x20')]({'status':0x193,'message':'Unauthorized'});}return db[_0x72e3('0x73')]['findOne']({'where':{'id':_0x328fdc[_0x72e3('0x3c')][_0x72e3('0x74')]},'raw':!![]})[_0x72e3('0x27')](handleEntityNotFound(_0x140ad7,null));}})[_0x72e3('0x27')](function(_0x3ed5f6){if(_0x3ed5f6){var _0x3a8ece=_0x3ed5f6[_0x72e3('0x75')]!==null;var _0x2d1990=path[_0x72e3('0x76')](config[_0x72e3('0x77')],_0x72e3('0x78'));if(_0x3a8ece){_0x2d1990=path['join'](_0x2d1990,_0x72e3('0x79'));}var _0xd4b0f8=path[_0x72e3('0x76')](_0x2d1990,_0x3ed5f6[_0x72e3('0x6e')]);return _0x140ad7['download'](_0xd4b0f8);}})[_0x72e3('0x1d')](handleError(_0x140ad7,null));};exports[_0x72e3('0x7a')]=function(_0xebd41c,_0x38e0af){var _0x5c6e2d=null;var _0x2fdde3=null;var _0x3917d4=null;if(_0xebd41c['body']['id']){delete _0xebd41c[_0x72e3('0x2f')]['id'];}if(_0xebd41c['body'][_0x72e3('0x7b')]){_0x3917d4=path[_0x72e3('0x76')](config[_0x72e3('0x77')],_0x72e3('0x7c'),util[_0x72e3('0x7d')]('transcript-%s.txt',Date[_0x72e3('0x7e')]()));_0xebd41c[_0x72e3('0x2f')][_0x72e3('0x7f')]=_0x3917d4;}return db[_0x72e3('0x36')]['find']({'where':{'id':_0xebd41c['params']['id']},'include':[{'model':db[_0x72e3('0x60')],'as':'Messages','include':[{'model':db[_0x72e3('0x80')],'as':'User'}]}]})[_0x72e3('0x27')](handleEntityNotFound(_0x38e0af,null))[_0x72e3('0x27')](saveUpdates(_0xebd41c[_0x72e3('0x2f')],null))[_0x72e3('0x27')](function(_0x33019a){if(_0x33019a){_0x5c6e2d=_0x33019a;return db['ChatWebsite'][_0x72e3('0x4a')]({'where':{'id':_0x5c6e2d[_0x72e3('0x81')]}});}})[_0x72e3('0x27')](function(_0x443dc5){if(_0x443dc5){_0x2fdde3=_0x443dc5;return db[_0x72e3('0x64')][_0x72e3('0x4a')]({'where':{'id':_0x5c6e2d[_0x72e3('0x82')]}});}})[_0x72e3('0x27')](function(_0x23e7ac){if(_0x23e7ac){if(_0x3917d4){var _0x52f6b4=null;for(var _0x3f783b=0x1;_0x3f783b<_0x5c6e2d[_0x72e3('0x83')][_0x72e3('0x46')];++_0x3f783b){_0x52f6b4=_0x5c6e2d[_0x72e3('0x83')][_0x3f783b];var _0x4b466a=_0x52f6b4[_0x72e3('0x69')]?util[_0x72e3('0x7d')]('%s%d',_0x2fdde3[_0x72e3('0x84')],_0x52f6b4[_0x72e3('0x69')]):_0x72e3('0x85');var _0x9373c2=_0xebd41c['body']['customer']||util['format'](_0x72e3('0x86'),_0x72e3('0x87'),_0x52f6b4[_0x72e3('0x82')]);switch(_0x2fdde3['agentIdentifier']){case _0x72e3('0x88'):_0x4b466a=_0x52f6b4[_0x72e3('0x69')]?util[_0x72e3('0x7d')](_0x72e3('0x86'),_0x2fdde3[_0x72e3('0x84')],_0x52f6b4['UserId']):'System';break;case _0x72e3('0x89'):_0x4b466a=_0x52f6b4[_0x72e3('0x69')]?_0x52f6b4[_0x72e3('0x80')][_0x72e3('0x8a')]||_0x52f6b4[_0x72e3('0x80')][_0x72e3('0x54')]:_0x72e3('0x85');break;case _0x72e3('0x8b'):_0x4b466a=_0x52f6b4[_0x72e3('0x69')]?_0x52f6b4[_0x72e3('0x80')]['fullname']:_0x72e3('0x85');break;default:_0x4b466a=_0x52f6b4['UserId']?util[_0x72e3('0x7d')]('%s%d',_0x2fdde3[_0x72e3('0x84')],_0x52f6b4['UserId']):_0x72e3('0x85');}var _0x8bcad6=util[_0x72e3('0x7d')](_0x72e3('0x8c'),moment(_0x52f6b4[_0x72e3('0x8d')])[_0x72e3('0x7d')](_0x72e3('0x8e')),_0x52f6b4['direction']==='in'?_0x9373c2:_0x4b466a,_0x52f6b4['body']);if(!_0x52f6b4['secret']){fs[_0x72e3('0x8f')](_0x3917d4,_0x8bcad6);}}return db[_0x72e3('0x90')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x72e3('0x91')],'as':_0x72e3('0x92'),'raw':!![],'include':[{'model':db[_0x72e3('0x93')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x9f1fa7){if(!_0x9f1fa7||!_0x9f1fa7[_0x72e3('0x92')]||!_0xebd41c['body'])return _0x5c6e2d;var _0x1f470a=_0x9f1fa7[_0x72e3('0x94')]();return respondWithRpcPromise(_0x72e3('0x95'),_0x72e3('0x96'),{'account':_0x1f470a,'message':{'from':util[_0x72e3('0x7d')](_0x72e3('0x97'),_0x9f1fa7[_0x72e3('0x2b')],_0x9f1fa7[_0x72e3('0x55')]||_0x9f1fa7[_0x72e3('0x92')][_0x72e3('0x3d')]),'to':_0xebd41c[_0x72e3('0x2f')][_0x72e3('0x7b')],'subject':_0x72e3('0x98'),'text':util[_0x72e3('0x7d')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xebd41c[_0x72e3('0x2f')]['mailTranscript']),'attachments':[{'path':_0x3917d4}]}})[_0x72e3('0x27')](function(){return _0x5c6e2d;})[_0x72e3('0x1d')](function(_0x55cb78){logger[_0x72e3('0x1a')](_0x55cb78);});})['then'](respondWithStatusCode(_0x38e0af,0xc8))[_0x72e3('0x1d')](handleError(_0x38e0af,null));};exports[_0x72e3('0x99')]=function(_0x2de127,_0x2ef46e){return db['ChatMessage'][_0x72e3('0x4a')]({'where':{'id':_0x2de127[_0x72e3('0x3e')]['id']}})[_0x72e3('0x27')](handleEntityNotFound(_0x2ef46e,null))['then'](function(_0x542887){if(_0x542887){return _0x542887[_0x72e3('0x99')](_0x2de127[_0x72e3('0x2f')][_0x72e3('0x9a')],_[_0x72e3('0x9b')](_0x2de127[_0x72e3('0x2f')],[_0x72e3('0x9a'),'id'])||{});}})[_0x72e3('0x27')](respondWithResult(_0x2ef46e,null))['catch'](handleError(_0x2ef46e,null));};exports[_0x72e3('0x9c')]=function(_0xbfca1d,_0x266b12){var _0xbf2936={'raw':![],'where':{}};var _0x2d6cd0={};var _0x523734={'count':0x0,'rows':[]};return db[_0x72e3('0x36')][_0x72e3('0x4e')]({'where':{'id':_0xbfca1d[_0x72e3('0x3e')]['id']}})[_0x72e3('0x27')](handleEntityNotFound(_0x266b12,null))[_0x72e3('0x27')](function(_0x37cc53){if(_0x37cc53){_0x2d6cd0[_0x72e3('0x44')]=_[_0x72e3('0x3f')](db[_0x72e3('0x60')][_0x72e3('0x40')]);_0x2d6cd0['query']=_[_0x72e3('0x3f')](_0xbfca1d[_0x72e3('0x3c')]);_0x2d6cd0['filters']=_[_0x72e3('0x43')](_0x2d6cd0[_0x72e3('0x44')],_0x2d6cd0[_0x72e3('0x3c')]);_0xbf2936[_0x72e3('0x42')]=_[_0x72e3('0x43')](_0x2d6cd0['model'],qs[_0x72e3('0x45')](_0xbfca1d[_0x72e3('0x3c')][_0x72e3('0x45')]));_0xbf2936['attributes']=_0xbf2936[_0x72e3('0x42')][_0x72e3('0x46')]?_0xbf2936[_0x72e3('0x42')]:_0x2d6cd0[_0x72e3('0x44')];if(!_0xbfca1d[_0x72e3('0x3c')]['hasOwnProperty'](_0x72e3('0x9d'))){_0xbf2936[_0x72e3('0x22')]=qs[_0x72e3('0x22')](_0xbfca1d[_0x72e3('0x3c')][_0x72e3('0x22')]);_0xbf2936[_0x72e3('0x21')]=qs['offset'](_0xbfca1d[_0x72e3('0x3c')]['offset']);}_0xbf2936[_0x72e3('0x9e')]=qs[_0x72e3('0x9f')](_0xbfca1d['query'][_0x72e3('0x9f')]);_0xbf2936[_0x72e3('0xa0')]=qs[_0x72e3('0x41')](_['pick'](_0xbfca1d[_0x72e3('0x3c')],_0x2d6cd0[_0x72e3('0x41')]));_0xbf2936[_0x72e3('0xa0')][_0x72e3('0xa1')]=_0x37cc53['id'];if(_0xbfca1d[_0x72e3('0x3c')][_0x72e3('0xa2')]){_0xbf2936[_0x72e3('0xa0')]=_[_0x72e3('0x2e')](_0xbf2936[_0x72e3('0xa0')],{'$or':_[_0x72e3('0x35')](_0xbf2936[_0x72e3('0x42')],function(_0x626327){var _0xc220fa={};_0xc220fa[_0x626327]={'$like':'%'+_0xbfca1d[_0x72e3('0x3c')][_0x72e3('0xa2')]+'%'};return _0xc220fa;})});}if(_0xbfca1d['query'][_0x72e3('0xa3')]){var _0x2a994b=_0xbfca1d[_0x72e3('0x3c')][_0x72e3('0xa3')]['split'](',');var _0x2a3b31={};_0x2a3b31[_0x2a994b[0x0]]={'$gte':moment(_0x2a994b[0x1])[_0x72e3('0x7d')](_0x72e3('0xa4'))};_0xbf2936[_0x72e3('0xa0')]=_[_0x72e3('0x2e')](_0xbf2936['where'],_0x2a3b31);}_0xbf2936=_[_0x72e3('0x2e')]({},_0xbf2936,_0xbfca1d[_0x72e3('0x49')]);return db['ChatMessage'][_0x72e3('0x24')]({'where':_0xbf2936[_0x72e3('0xa0')]})['then'](function(_0x2f8898){_0x523734[_0x72e3('0x24')]=_0x2f8898;if(_0xbfca1d['query']['includeAll']){_0xbf2936[_0x72e3('0x48')]=[{'all':!![]}];}return db['ChatMessage'][_0x72e3('0x3a')](_0xbf2936);})[_0x72e3('0x27')](function(_0x4fcb4b){_0x523734[_0x72e3('0xa5')]=_0x4fcb4b;return _0x523734;});}})['then'](respondWithFilteredResult(_0x266b12,_0xbf2936))[_0x72e3('0x1d')](handleError(_0x266b12,null));};exports[_0x72e3('0xa6')]=function(_0x15d86d,_0x10e601){var _0xbf3a77={'where':{}},_0x55c3f4={},_0x36e244={'count':0x0,'rows':[]};return db[_0x72e3('0x36')][_0x72e3('0x4e')]({'where':{'id':_0x15d86d[_0x72e3('0x3e')]['id']}})[_0x72e3('0x27')](handleEntityNotFound(_0x10e601,null))['then'](function(_0x239ecb){if(_0x239ecb){_0x55c3f4[_0x72e3('0x44')]=_['keys'](db[_0x72e3('0x60')][_0x72e3('0x40')]);_0x55c3f4[_0x72e3('0x3c')]=_[_0x72e3('0x3f')](_0x15d86d[_0x72e3('0x3c')]);_0x55c3f4[_0x72e3('0x41')]=_[_0x72e3('0x43')](_0x55c3f4['model'],_0x55c3f4[_0x72e3('0x3c')]);_0xbf3a77[_0x72e3('0x42')]=_[_0x72e3('0x43')](_0x55c3f4[_0x72e3('0x44')],qs[_0x72e3('0x45')](_0x15d86d[_0x72e3('0x3c')]['fields']));_0xbf3a77[_0x72e3('0x42')]=_0xbf3a77['attributes'][_0x72e3('0x46')]?_0xbf3a77['attributes']:_0x55c3f4[_0x72e3('0x44')];if(!_0x15d86d[_0x72e3('0x3c')][_0x72e3('0xa7')](_0x72e3('0x9d'))){_0xbf3a77['limit']=qs['limit'](_0x15d86d[_0x72e3('0x3c')][_0x72e3('0x22')]);_0xbf3a77[_0x72e3('0x21')]=qs[_0x72e3('0x21')](_0x15d86d[_0x72e3('0x3c')]['offset']);}_0xbf3a77[_0x72e3('0x9e')]=qs[_0x72e3('0x9f')](_0x15d86d['query'][_0x72e3('0x9f')]);_0xbf3a77[_0x72e3('0xa0')]=qs[_0x72e3('0x41')](_['pick'](_0x15d86d[_0x72e3('0x3c')],_0x55c3f4[_0x72e3('0x41')]));_0xbf3a77[_0x72e3('0xa0')][_0x72e3('0xa1')]=_0x239ecb['id'];if(_0x15d86d[_0x72e3('0x3c')]['filter']){_0xbf3a77['where']=_['merge'](_0xbf3a77[_0x72e3('0xa0')],{'$or':_['map'](_0xbf3a77['attributes'],function(_0x3ce4c6){var _0x1f6b10={};_0x1f6b10[_0x3ce4c6]={'$like':'%'+_0x15d86d[_0x72e3('0x3c')][_0x72e3('0xa2')]+'%'};return _0x1f6b10;})});}_0xbf3a77[_0x72e3('0xa0')][_0x72e3('0xa8')]=![];if(_0x15d86d['query']['id']){_0xbf3a77[_0x72e3('0xa0')]['id']={'$gt':_0x15d86d[_0x72e3('0x3c')]['id']};}_0xbf3a77=_['merge']({},_0xbf3a77,_0x15d86d['options']);return db['ChatMessage'][_0x72e3('0x24')]({'where':_0xbf3a77['where']})[_0x72e3('0x27')](function(_0x2ce5d9){_0x36e244[_0x72e3('0x24')]=_0x2ce5d9;_0xbf3a77[_0x72e3('0x48')]=[];if(_0x15d86d[_0x72e3('0x3c')][_0x72e3('0xa9')]){_0xbf3a77[_0x72e3('0x48')][_0x72e3('0xaa')]({'model':db['User'],'as':'User','attributes':['id',_0x72e3('0x54'),_0x72e3('0x8a')]});}if(_0x15d86d[_0x72e3('0x3c')][_0x72e3('0x47')]){_0xbf3a77['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xbf3a77);})[_0x72e3('0x27')](function(_0x4249b8){_0x36e244[_0x72e3('0xa5')]=_0x4249b8;return _0x36e244;});}})[_0x72e3('0x27')](respondWithFilteredResult(_0x10e601,_0xbf3a77))[_0x72e3('0x1d')](handleError(_0x10e601,null));};exports[_0x72e3('0xab')]=function(_0x498c2e,_0xe30602){return db['ChatInteraction'][_0x72e3('0x4a')]({'where':{'id':_0x498c2e[_0x72e3('0x3e')]['id']}})[_0x72e3('0x27')](handleEntityNotFound(_0xe30602,null))[_0x72e3('0x27')](function(_0x233f4d){if(_0x233f4d){return _0x233f4d['setTags'](_0x498c2e[_0x72e3('0x2f')]['ids'],_['omit'](_0x498c2e[_0x72e3('0x2f')],['ids','id'])||{})['spread'](function(){return db[_0x72e3('0xac')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x498c2e[_0x72e3('0x2f')][_0x72e3('0x9a')]}});})[_0x72e3('0x27')](function(_0x41464b){socket[_0x72e3('0xad')](_0x72e3('0xae'),{'id':Number(_0x498c2e['params']['id']),'tags':_0x41464b||[]});return{'id':Number(_0x498c2e[_0x72e3('0x3e')]['id']),'tags':_0x41464b||[]};});}})[_0x72e3('0x27')](respondWithResult(_0xe30602,null))[_0x72e3('0x1d')](handleError(_0xe30602,null));};exports['removeTags']=function(_0x338cc3,_0x53a6fb){return db[_0x72e3('0x36')][_0x72e3('0x4a')]({'where':{'id':_0x338cc3[_0x72e3('0x3e')]['id']}})[_0x72e3('0x27')](handleEntityNotFound(_0x53a6fb,null))[_0x72e3('0x27')](function(_0x3b64a7){if(_0x3b64a7){return _0x3b64a7[_0x72e3('0xaf')](_0x338cc3[_0x72e3('0x3c')]['ids']);}})[_0x72e3('0x27')](respondWithStatusCode(_0x53a6fb,null))[_0x72e3('0x1d')](handleError(_0x53a6fb,null));};exports[_0x72e3('0xb0')]=function(_0x4f5d53,_0x26ac11){var _0x148fcc=moment()[_0x72e3('0xb1')]()[_0x72e3('0xb2')]();var _0x39cdc4=path[_0x72e3('0x76')](config[_0x72e3('0x77')],_0x72e3('0xb3'),'files',_0x72e3('0xb4'));var _0x47ecc4=path[_0x72e3('0x76')](config[_0x72e3('0x77')],_0x72e3('0xb3'),_0x72e3('0xb5'),_0x72e3('0xb6'));var _0x3908bf=path[_0x72e3('0x76')](_0x39cdc4,_0x148fcc);var _0x5c3d7a=util['format'](_0x72e3('0xb7'),_0x4f5d53['params']['id'],_0x148fcc);var _0x48b869=path[_0x72e3('0x76')](_0x39cdc4,_0x5c3d7a);var _0x435212=[];_0x435212['push']({'model':db[_0x72e3('0x80')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x435212[_0x72e3('0xaa')]({'model':db[_0x72e3('0x64')],'as':_0x72e3('0x65'),'attributes':['id',_0x72e3('0xb8'),_0x72e3('0xb9')],'raw':!![]});if(_0x4f5d53['query'][_0x72e3('0xb6')]){_0x435212['push']({'model':db[_0x72e3('0x73')],'as':'Attachment','raw':!![]});}var _0x1808e6=[{'model':db[_0x72e3('0x60')],'as':_0x72e3('0x83'),'attributes':['id',_0x72e3('0x2f'),_0x72e3('0x8d'),_0x72e3('0xba'),_0x72e3('0xa8'),_0x72e3('0xbb')],'include':_0x435212}];_0x1808e6['push']({'model':db[_0x72e3('0x4d')],'as':_0x72e3('0xbc'),'attributes':['id','name']});_0x1808e6[_0x72e3('0xaa')]({'model':db[_0x72e3('0x80')],'as':_0x72e3('0xbd'),'attributes':['id',_0x72e3('0x54')]});return db['ChatInteraction'][_0x72e3('0x4a')]({'where':{'id':_0x4f5d53[_0x72e3('0x3e')]['id']},'include':_0x1808e6})[_0x72e3('0x27')](handleEntityNotFound(_0x26ac11,null))[_0x72e3('0x27')](function(_0x586fd8){if(_0x586fd8){var _0x315c1b=_0x586fd8['get']({'plain':!![]});fs[_0x72e3('0xbe')](_0x3908bf);var _0x1d8e82={'channel':_0x72e3('0xbf'),'account':_0x315c1b[_0x72e3('0xbc')]['name'],'agent':_0x315c1b[_0x72e3('0xbd')]?_0x315c1b['Owner'][_0x72e3('0x54')]:_0x72e3('0xc0'),'createdAt':moment(_0x315c1b[_0x72e3('0x8d')])[_0x72e3('0x7d')](_0x72e3('0xa4'))[_0x72e3('0xb2')](),'closedAt':_0x315c1b['closed']?moment(_0x315c1b['closedAt'])[_0x72e3('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x315c1b[_0x72e3('0x6c')],'chatInfo':{'browser':_0x315c1b[_0x72e3('0xc1')],'os':_0x315c1b[_0x72e3('0xc2')],'referer':_0x315c1b[_0x72e3('0xc3')],'customerIp':_0x315c1b['customerIp'],'customerPort':_0x315c1b['customerPort']?_0x315c1b[_0x72e3('0xc4')]:_0x72e3('0xc0')},'messages':_(_0x315c1b[_0x72e3('0x83')])[_0x72e3('0xc5')]()[_0x72e3('0xa2')]({'secret':![]})[_0x72e3('0x35')](function(_0x15d5e5){if(_0x15d5e5['Attachment']){var _0x52fcba=path[_0x72e3('0x76')](_0x47ecc4,_0x15d5e5[_0x72e3('0x73')][_0x72e3('0x6e')]);if(fs['existsSync'](_0x52fcba)){fs['createReadStream'](_0x52fcba)[_0x72e3('0xc6')](fs[_0x72e3('0xc7')](path[_0x72e3('0x76')](_0x3908bf,_0x15d5e5[_0x72e3('0x73')][_0x72e3('0x6e')])));}}return{'date':moment(_0x15d5e5[_0x72e3('0x8d')])[_0x72e3('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x72e3('0xb2')](),'sender':_0x15d5e5[_0x72e3('0xba')]===_0x72e3('0x5f')?_0x15d5e5[_0x72e3('0x80')]?_0x15d5e5[_0x72e3('0x80')]['fullname']:_0x72e3('0x85'):_0x15d5e5['Contact']['firstName']+(_0x15d5e5[_0x72e3('0x65')]['lastName']?'\x20'+_0x15d5e5['Contact'][_0x72e3('0xb9')]:''),'body':_0x15d5e5['Attachment']?_0x15d5e5[_0x72e3('0x73')][_0x72e3('0x6e')]:_0x15d5e5[_0x72e3('0x2f')],'direction':_0x15d5e5['direction']===_0x72e3('0x5f')?'A':'C','secret':_0x15d5e5['secret'],'read':_0x15d5e5[_0x72e3('0xbb')],'attachment':_0x15d5e5[_0x72e3('0x73')]};})['value']()};return ejs[_0x72e3('0xc8')](path[_0x72e3('0x76')](config[_0x72e3('0x77')],'server',_0x72e3('0xc9'),'downloadInteraction.ejs'),{'interaction':_0x1d8e82})['then'](function(_0x2e4c43){var _0x2b9c90=path[_0x72e3('0x76')](_0x3908bf,_0x72e3('0xca')+_0x315c1b['id']+'-'+_0x148fcc+_0x72e3('0xcb'));var _0x535c94={'path':_0x2b9c90,'channel':_0x72e3('0xbf'),'interactionId':_0x315c1b['id']};return pdf[_0x72e3('0xcc')](_0x2e4c43,_0x535c94);})[_0x72e3('0x27')](function(){return new Promise(function(_0x4b425b,_0x31008c){zipdir(_0x3908bf,{'saveTo':_0x48b869},function(_0x357e9a,_0x55549e){if(_0x357e9a)return _0x31008c(_0x357e9a);return _0x4b425b(_0x55549e);});})[_0x72e3('0x27')](function(){return new BPromise(function(_0x46e628,_0x3d2f9d){rimraf(_0x3908bf,function(_0x510b73){if(_0x510b73)_0x3d2f9d(_0x510b73);return _0x46e628();});});})[_0x72e3('0x27')](function(){return _0x26ac11[_0x72e3('0xb0')](_0x48b869,_0x5c3d7a,function(_0x288607){if(_0x288607){logger[_0x72e3('0x1a')](_0x72e3('0xcd'),_0x288607);}else{fs[_0x72e3('0xce')](_0x48b869);}});});});}else{return _0x26ac11[_0x72e3('0x29')](0xc8);}})[_0x72e3('0x1d')](handleError(_0x26ac11,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index fe819bd..09cdc1b 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 _0x86f9=['setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then','Users','map','findAll'];(function(_0xd7e544,_0x4811bf){var _0x3dbcf7=function(_0x1641e0){while(--_0x1641e0){_0xd7e544['push'](_0xd7e544['shift']());}};_0x3dbcf7(++_0x4811bf);}(_0x86f9,0xcd));var _0x986f=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x86f9[_0x2a558d];return _0xa7bc9c;};'use strict';var EventEmitter=require(_0x986f('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x986f('0x1'))['db'][_0x986f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x986f('0x3')](0x0);var events={'afterCreate':_0x986f('0x4'),'afterUpdate':_0x986f('0x5'),'afterDestroy':_0x986f('0x6')};function emitEvent(_0x191e0b){return function(_0x3fc4a5,_0x4f69c0,_0x2f843c){_0x3fc4a5['getUsers']({'attributes':['id'],'raw':!![]})[_0x986f('0x7')](function(_0x2a49a8){_0x3fc4a5['setDataValue'](_0x986f('0x8'),_0x2a49a8[_0x986f('0x9')](function(_0x14159d){return{'id':_0x14159d['id']};}));return ChatMessage[_0x986f('0xa')]({'where':{'ChatInteractionId':_0x3fc4a5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x986f('0x7')](function(_0x1edd72){_0x3fc4a5[_0x986f('0xb')]('unreadMessages',_0x1edd72[_0x986f('0xc')]);ChatInteractionEvents[_0x986f('0xd')](_0x191e0b+':'+_0x3fc4a5['id'],_0x3fc4a5);ChatInteractionEvents[_0x986f('0xd')](_0x191e0b,_0x3fc4a5);_0x2f843c(null);})[_0x986f('0xe')](_0x2f843c(null));};}for(var e in events){if(events[_0x986f('0xf')](e)){var event=events[e];ChatInteraction[_0x986f('0x10')](e,emitEvent(event));}}module[_0x986f('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x20f8=['ChatInteraction','../../mysqldb','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x336462,_0x3ed9a5){var _0x3d07f1=function(_0x2d7358){while(--_0x2d7358){_0x336462['push'](_0x336462['shift']());}};_0x3d07f1(++_0x3ed9a5);}(_0x20f8,0x1ba));var _0x820f=function(_0x376335,_0x309177){_0x376335=_0x376335-0x0;var _0x42ddcd=_0x20f8[_0x376335];return _0x42ddcd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x820f('0x0')];var ChatMessage=require(_0x820f('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x820f('0x2'),'afterDestroy':_0x820f('0x3')};function emitEvent(_0x4ff59b){return function(_0x2ee146,_0x3d6c23,_0x41757d){_0x2ee146[_0x820f('0x4')]({'attributes':['id'],'raw':!![]})[_0x820f('0x5')](function(_0x52a917){_0x2ee146[_0x820f('0x6')](_0x820f('0x7'),_0x52a917[_0x820f('0x8')](function(_0x37bf7f){return{'id':_0x37bf7f['id']};}));return ChatMessage[_0x820f('0x9')]({'where':{'ChatInteractionId':_0x2ee146['id'],'direction':'in','read':![]},'raw':!![]});})[_0x820f('0x5')](function(_0x52e4b3){_0x2ee146[_0x820f('0x6')](_0x820f('0xa'),_0x52e4b3[_0x820f('0xb')]);ChatInteractionEvents['emit'](_0x4ff59b+':'+_0x2ee146['id'],_0x2ee146);ChatInteractionEvents[_0x820f('0xc')](_0x4ff59b,_0x2ee146);_0x41757d(null);})[_0x820f('0xd')](_0x41757d(null));};}for(var e in events){if(events[_0x820f('0xe')](e)){var event=events[e];ChatInteraction[_0x820f('0xf')](e,emitEvent(event));}}module[_0x820f('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 3dc5f7c..a8141fd 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 _0x44c4=['format','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closedAt'];(function(_0x29e54f,_0x33535a){var _0x4c619f=function(_0xc98342){while(--_0xc98342){_0x29e54f['push'](_0x29e54f['shift']());}};_0x4c619f(++_0x33535a);}(_0x44c4,0x11f));var _0x444c=function(_0x3385c1,_0x16921b){_0x3385c1=_0x3385c1-0x0;var _0x3a19fd=_0x44c4[_0x3385c1];return _0x3a19fd;};'use strict';var _=require('lodash');var util=require(_0x444c('0x0'));var logger=require(_0x444c('0x1'))(_0x444c('0x2'));var moment=require(_0x444c('0x3'));var BPromise=require(_0x444c('0x4'));var rp=require(_0x444c('0x5'));var fs=require('fs');var path=require(_0x444c('0x6'));var rimraf=require(_0x444c('0x7'));var config=require('../../config/environment');var attributes=require(_0x444c('0x8'));module[_0x444c('0x9')]=function(_0x5f5603,_0x3a3454){return _0x5f5603['define'](_0x444c('0xa'),attributes,{'tableName':_0x444c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x193487,_0x4a9c30,_0x583b16){if(_0x193487['changed']('closed')){_0x193487[_0x444c('0xc')]=moment()[_0x444c('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x583b16(null,_0x193487);}},'charset':_0x444c('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8a14=['lodash','../../config/logger','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x24310a,_0x22f59f){var _0x34fe89=function(_0x4a26c2){while(--_0x4a26c2){_0x24310a['push'](_0x24310a['shift']());}};_0x34fe89(++_0x22f59f);}(_0x8a14,0x8c));var _0x48a1=function(_0x3b1b18,_0xcb6e90){_0x3b1b18=_0x3b1b18-0x0;var _0xdc4311=_0x8a14[_0x3b1b18];return _0xdc4311;};'use strict';var _=require(_0x48a1('0x0'));var util=require('util');var logger=require(_0x48a1('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x48a1('0x2'));var fs=require('fs');var path=require(_0x48a1('0x3'));var rimraf=require(_0x48a1('0x4'));var config=require('../../config/environment');var attributes=require(_0x48a1('0x5'));module[_0x48a1('0x6')]=function(_0x204a0f,_0x331ecb){return _0x204a0f[_0x48a1('0x7')](_0x48a1('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52cce5,_0x3d5700,_0x191dfa){if(_0x52cce5[_0x48a1('0x9')](_0x48a1('0xa'))){_0x52cce5[_0x48a1('0xb')]=moment()[_0x48a1('0xc')](_0x48a1('0xd'));}_0x191dfa(null,_0x52cce5);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f84e024..185cbc4 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 _0x4633=['ioredis','../../config/logger','../../config/environment','http','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','ChatInteraction','update','body','options','raw','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','where','addTags','ids','spread','AddTags','lodash','util','bluebird'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4633,0x66));var _0x3463=function(_0x50b475,_0x96fff7){_0x50b475=_0x50b475-0x0;var _0x418b3d=_0x4633[_0x50b475];return _0x418b3d;};'use strict';var _=require(_0x3463('0x0'));var util=require(_0x3463('0x1'));var moment=require('moment');var BPromise=require(_0x3463('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3463('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3463('0x4'))('rpc');var config=require(_0x3463('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3463('0x6')]({'port':0x232a});config['redis']=_[_0x3463('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3463('0x8'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x3463('0x9')](socket);function respondWithRpcPromise(_0x3db661,_0x17886d,_0x20e2b5){return new BPromise(function(_0x4657a3,_0x59fe32){return client['request'](_0x3db661,_0x20e2b5)[_0x3463('0xa')](function(_0x44d77d){logger[_0x3463('0xb')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'));logger[_0x3463('0xd')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'),JSON[_0x3463('0xe')](_0x44d77d));if(_0x44d77d[_0x3463('0xf')]){if(_0x44d77d[_0x3463('0xf')][_0x3463('0x10')]===0x1f4){logger[_0x3463('0xf')](_0x3463('0x11'),_0x17886d,_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);return _0x59fe32(_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);}logger[_0x3463('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);return _0x4657a3(_0x44d77d[_0x3463('0xf')]['message']);}else{logger[_0x3463('0xb')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'));_0x4657a3(_0x44d77d[_0x3463('0x13')][_0x3463('0x12')]);}})['catch'](function(_0x5448c5){logger[_0x3463('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x5448c5);_0x59fe32(_0x5448c5);});});}exports['UpdateChatInteraction']=function(_0x3b0722){var _0x23ba19=this;return new Promise(function(_0x1ca25b,_0x2925fd){return db[_0x3463('0x14')][_0x3463('0x15')](_0x3b0722[_0x3463('0x16')],{'raw':_0x3b0722[_0x3463('0x17')]?_0x3b0722['options'][_0x3463('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b0722[_0x3463('0x17')]?_0x3b0722[_0x3463('0x17')]['where']||null:null,'attributes':_0x3b0722[_0x3463('0x17')]?_0x3b0722[_0x3463('0x17')][_0x3463('0x19')]||null:null,'limit':_0x3b0722[_0x3463('0x17')]?_0x3b0722['options'][_0x3463('0x1a')]||null:null})['then'](function(_0x20d433){logger['info'](_0x3463('0x1b'),_0x3b0722);logger[_0x3463('0xd')](_0x3463('0x1b'),_0x3b0722,JSON[_0x3463('0xe')](_0x20d433));_0x1ca25b(_0x20d433);})[_0x3463('0x1c')](function(_0x5cdb52){logger[_0x3463('0xf')](_0x3463('0x1b'),_0x5cdb52[_0x3463('0x12')],_0x3b0722);_0x2925fd(_0x23ba19[_0x3463('0xf')](0x1f4,_0x5cdb52['message']));});});};exports[_0x3463('0x1d')]=function(_0x4f8fea){return new Promise(function(_0x254f1b,_0x48a994){return db[_0x3463('0x14')]['find']({'where':_0x4f8fea['options']?_0x4f8fea[_0x3463('0x17')][_0x3463('0x1e')]||null:null})['then'](function(_0x4eaf8f){if(_0x4eaf8f){return _0x4eaf8f[_0x3463('0x1f')](_0x4f8fea['body'][_0x3463('0x20')],_['omit'](_0x4f8fea[_0x3463('0x16')],[_0x3463('0x20'),'id'])||{});}})[_0x3463('0x21')](function(_0x5599e8){logger[_0x3463('0xb')](_0x3463('0x22'),_0x4f8fea);logger['debug']('AddTags',_0x4f8fea,JSON['stringify'](_0x5599e8));_0x254f1b(_0x5599e8);})[_0x3463('0x1c')](function(_0x194967){logger[_0x3463('0xf')]('AddTags',_0x194967[_0x3463('0x12')],_0x4f8fea);_0x48a994(_this[_0x3463('0xf')](0x1f4,_0x194967[_0x3463('0x12')]));});});}; \ No newline at end of file +var _0x872f=['info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','UpdateChatInteraction','body','options','raw','where','limit','AddTagsToChatInteraction','ChatInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x70084d,_0x1b7cac){var _0x50f523=function(_0x4e05f7){while(--_0x4e05f7){_0x70084d['push'](_0x70084d['shift']());}};_0x50f523(++_0x1b7cac);}(_0x872f,0x1c5));var _0xf872=function(_0x5dea35,_0x4403ce){_0x5dea35=_0x5dea35-0x0;var _0x420537=_0x872f[_0x5dea35];return _0x420537;};'use strict';var _=require(_0xf872('0x0'));var util=require(_0xf872('0x1'));var moment=require(_0xf872('0x2'));var BPromise=require(_0xf872('0x3'));var rs=require(_0xf872('0x4'));var fs=require('fs');var Redis=require(_0xf872('0x5'));var db=require(_0xf872('0x6'))['db'];var utils=require(_0xf872('0x7'));var logger=require(_0xf872('0x8'))(_0xf872('0x9'));var config=require(_0xf872('0xa'));var jayson=require(_0xf872('0xb'));var client=jayson[_0xf872('0xc')][_0xf872('0xd')]({'port':0x232a});config[_0xf872('0xe')]=_['defaults'](config['redis'],{'host':_0xf872('0xf'),'port':0x18eb});var socket=require(_0xf872('0x10'))(new Redis(config[_0xf872('0xe')]));require('./chatInteraction.socket')[_0xf872('0x11')](socket);function respondWithRpcPromise(_0x2c7434,_0x14cc2f,_0x1492e4){return new BPromise(function(_0x2232bb,_0x5ded4f){return client[_0xf872('0x12')](_0x2c7434,_0x1492e4)[_0xf872('0x13')](function(_0x1dbffd){logger[_0xf872('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x14cc2f,_0xf872('0x15'));logger[_0xf872('0x16')](_0xf872('0x17'),_0x14cc2f,_0xf872('0x15'),JSON[_0xf872('0x18')](_0x1dbffd));if(_0x1dbffd[_0xf872('0x19')]){if(_0x1dbffd[_0xf872('0x19')]['code']===0x1f4){logger[_0xf872('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x14cc2f,_0x1dbffd[_0xf872('0x19')][_0xf872('0x1a')]);return _0x5ded4f(_0x1dbffd[_0xf872('0x19')]['message']);}logger[_0xf872('0x19')](_0xf872('0x1b'),_0x14cc2f,_0x1dbffd[_0xf872('0x19')][_0xf872('0x1a')]);return _0x2232bb(_0x1dbffd['error'][_0xf872('0x1a')]);}else{logger[_0xf872('0x14')](_0xf872('0x1b'),_0x14cc2f,_0xf872('0x15'));_0x2232bb(_0x1dbffd[_0xf872('0x1c')]['message']);}})[_0xf872('0x1d')](function(_0xb5a3cc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x14cc2f,_0xb5a3cc);_0x5ded4f(_0xb5a3cc);});});}exports[_0xf872('0x1e')]=function(_0x56d78e){var _0x2a0f29=this;return new Promise(function(_0x1c9c2e,_0x1dc96){return db['ChatInteraction']['update'](_0x56d78e[_0xf872('0x1f')],{'raw':_0x56d78e['options']?_0x56d78e[_0xf872('0x20')][_0xf872('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56d78e[_0xf872('0x20')]?_0x56d78e['options'][_0xf872('0x22')]||null:null,'attributes':_0x56d78e[_0xf872('0x20')]?_0x56d78e[_0xf872('0x20')]['attributes']||null:null,'limit':_0x56d78e[_0xf872('0x20')]?_0x56d78e[_0xf872('0x20')][_0xf872('0x23')]||null:null})[_0xf872('0x13')](function(_0xca06e){logger['info']('UpdateChatInteraction',_0x56d78e);logger['debug'](_0xf872('0x1e'),_0x56d78e,JSON[_0xf872('0x18')](_0xca06e));_0x1c9c2e(_0xca06e);})[_0xf872('0x1d')](function(_0x561c23){logger[_0xf872('0x19')](_0xf872('0x1e'),_0x561c23[_0xf872('0x1a')],_0x56d78e);_0x1dc96(_0x2a0f29[_0xf872('0x19')](0x1f4,_0x561c23[_0xf872('0x1a')]));});});};exports[_0xf872('0x24')]=function(_0x480828){return new Promise(function(_0x5711ce,_0x245b22){return db[_0xf872('0x25')]['find']({'where':_0x480828['options']?_0x480828[_0xf872('0x20')][_0xf872('0x22')]||null:null})['then'](function(_0x35c28e){if(_0x35c28e){return _0x35c28e[_0xf872('0x26')](_0x480828[_0xf872('0x1f')]['ids'],_[_0xf872('0x27')](_0x480828['body'],[_0xf872('0x28'),'id'])||{});}})[_0xf872('0x29')](function(_0xbdcc80){logger[_0xf872('0x14')](_0xf872('0x2a'),_0x480828);logger[_0xf872('0x16')]('AddTags',_0x480828,JSON[_0xf872('0x18')](_0xbdcc80));_0x5711ce(_0xbdcc80);})[_0xf872('0x1d')](function(_0x25663a){logger[_0xf872('0x19')](_0xf872('0x2a'),_0x25663a['message'],_0x480828);_0x245b22(_this[_0xf872('0x19')](0x1f4,_0x25663a[_0xf872('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index a817635..81aad62 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 _0x133a=['register','length','chatInteraction:','save','remove','update','emit','removeListener'];(function(_0x2c54dd,_0x22d4a2){var _0x3dccba=function(_0x7ba02c){while(--_0x7ba02c){_0x2c54dd['push'](_0x2c54dd['shift']());}};_0x3dccba(++_0x22d4a2);}(_0x133a,0xcb));var _0xa133=function(_0x2d90cc,_0x45bb4e){_0x2d90cc=_0x2d90cc-0x0;var _0x227a99=_0x133a[_0x2d90cc];return _0x227a99;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xa133('0x0'),_0xa133('0x1'),_0xa133('0x2')];function createListener(_0x31ee7a,_0x5f0eea){return function(_0x30e2cb){_0x5f0eea[_0xa133('0x3')](_0x31ee7a,_0x30e2cb);};}function removeListener(_0x2841ba,_0x52f874){return function(){ChatInteractionEvents[_0xa133('0x4')](_0x2841ba,_0x52f874);};}exports[_0xa133('0x5')]=function(_0x17fe9b){for(var _0x1e16a7=0x0,_0x56fbbf=events[_0xa133('0x6')];_0x1e16a7<_0x56fbbf;_0x1e16a7++){var _0x1fdfa5=events[_0x1e16a7];var _0x15ba48=createListener(_0xa133('0x7')+_0x1fdfa5,_0x17fe9b);ChatInteractionEvents['on'](_0x1fdfa5,_0x15ba48);}}; \ No newline at end of file +var _0x956a=['save','remove','update','emit','register','length','chatInteraction:'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x956a,0xb6));var _0xa956=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x956a[_0x17d9e3];return _0x14192d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xa956('0x0'),_0xa956('0x1'),_0xa956('0x2')];function createListener(_0x15cb5a,_0x12daaa){return function(_0x24b6c4){_0x12daaa[_0xa956('0x3')](_0x15cb5a,_0x24b6c4);};}function removeListener(_0x38c808,_0x48bb8a){return function(){ChatInteractionEvents['removeListener'](_0x38c808,_0x48bb8a);};}exports[_0xa956('0x4')]=function(_0x2b9675){for(var _0x2ce2c8=0x0,_0x5f1684=events[_0xa956('0x5')];_0x2ce2c8<_0x5f1684;_0x2ce2c8++){var _0x1318ea=events[_0x2ce2c8];var _0x1265dd=createListener(_0xa956('0x6')+_0x1318ea,_0x2b9675);ChatInteractionEvents['on'](_0x1318ea,_0x1265dd);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 76ea473..67989d1 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 _0xe459=['/:id/vidaoo','diskStorage','join','root','format','originalname','replace','/:id/attachment_upload','file','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','post','create'];(function(_0x1b0afd,_0x367934){var _0x4ba0d2=function(_0x4755b8){while(--_0x4755b8){_0x1b0afd['push'](_0x1b0afd['shift']());}};_0x4ba0d2(++_0x367934);}(_0xe459,0x7a));var _0x9e45=function(_0x59a68a,_0xc0c564){_0x59a68a=_0x59a68a-0x0;var _0x1e114d=_0xe459[_0x59a68a];return _0x1e114d;};'use strict';var multer=require(_0x9e45('0x0'));var util=require('util');var path=require(_0x9e45('0x1'));var timeout=require(_0x9e45('0x2'));var express=require(_0x9e45('0x3'));var router=express['Router']();var fs_extra=require(_0x9e45('0x4'));var auth=require(_0x9e45('0x5'));var interaction=require(_0x9e45('0x6'));var config=require('../../config/environment');var controller=require(_0x9e45('0x7'));router[_0x9e45('0x8')]('/',auth[_0x9e45('0x9')](),controller[_0x9e45('0xa')]);router[_0x9e45('0x8')](_0x9e45('0xb'),auth[_0x9e45('0x9')](),controller[_0x9e45('0xc')]);router['get'](_0x9e45('0xd'),auth[_0x9e45('0xe')](),controller[_0x9e45('0xf')]);router[_0x9e45('0x8')]('/:id/attachment_download',auth[_0x9e45('0xe')](),controller[_0x9e45('0x10')]);router[_0x9e45('0x8')]('/:id/messages',auth[_0x9e45('0x9')](),controller[_0x9e45('0x11')]);router[_0x9e45('0x8')](_0x9e45('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x9e45('0x13')]);router['get']('/:id/download',auth[_0x9e45('0x9')](),controller['download']);router[_0x9e45('0x14')]('/',auth['isAuthenticated'](),controller[_0x9e45('0x15')]);router[_0x9e45('0x14')](_0x9e45('0x16'),auth[_0x9e45('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x9e45('0x17')]({'destination':function(_0x500f6e,_0x41b56d,_0x538f2f){_0x538f2f(null,path[_0x9e45('0x18')](config[_0x9e45('0x19')],'server/files/attachments/'));},'filename':function(_0x3846bd,_0x13806e,_0x1e3690){_0x1e3690(null,util[_0x9e45('0x1a')]('%s-%s',Date['now'](),_0x13806e[_0x9e45('0x1b')][_0x9e45('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9e45('0x14')](_0x9e45('0x1d'),upload['single'](_0x9e45('0x1e')),controller['attachmentUpload']);router[_0x9e45('0x14')]('/:id/messages',auth[_0x9e45('0xe')](),controller[_0x9e45('0x1f')]);router[_0x9e45('0x14')](_0x9e45('0x20'),auth['isAuthenticated'](),interaction[_0x9e45('0x21')](_0x9e45('0x22'),'chatinteraction:addtags'),controller[_0x9e45('0x23')]);router[_0x9e45('0x24')](_0x9e45('0xd'),auth['isAuthenticated'](),interaction[_0x9e45('0x21')](_0x9e45('0x22'),_0x9e45('0x25')),controller[_0x9e45('0x26')]);router['put'](_0x9e45('0x27'),controller['customUpdate']);router[_0x9e45('0x24')](_0x9e45('0x28'),auth[_0x9e45('0xe')](),controller[_0x9e45('0x29')]);router[_0x9e45('0x24')](_0x9e45('0x2a'),controller[_0x9e45('0x2b')]);router[_0x9e45('0x2c')](_0x9e45('0xd'),auth[_0x9e45('0x9')](),interaction['tracked']('chat',_0x9e45('0x2d')),controller[_0x9e45('0x2e')]);router[_0x9e45('0x2c')](_0x9e45('0x20'),auth[_0x9e45('0x9')](),controller['removeTags']);module[_0x9e45('0x2f')]=router; \ No newline at end of file +var _0x223a=['chatinteraction:destroy','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','/:id/tags','chat','addTags','update','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','/:id','tracked'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x223a,0xa4));var _0xa223=function(_0x23e097,_0x18adea){_0x23e097=_0x23e097-0x0;var _0x37dab8=_0x223a[_0x23e097];return _0x37dab8;};'use strict';var multer=require(_0xa223('0x0'));var util=require(_0xa223('0x1'));var path=require(_0xa223('0x2'));var timeout=require('connect-timeout');var express=require(_0xa223('0x3'));var router=express[_0xa223('0x4')]();var fs_extra=require(_0xa223('0x5'));var auth=require(_0xa223('0x6'));var interaction=require(_0xa223('0x7'));var config=require(_0xa223('0x8'));var controller=require(_0xa223('0x9'));router[_0xa223('0xa')]('/',auth[_0xa223('0xb')](),controller[_0xa223('0xc')]);router['get'](_0xa223('0xd'),auth['isAuthenticated'](),controller[_0xa223('0xe')]);router[_0xa223('0xa')]('/:id',auth[_0xa223('0xf')](),controller[_0xa223('0x10')]);router[_0xa223('0xa')](_0xa223('0x11'),auth[_0xa223('0xf')](),controller[_0xa223('0x12')]);router[_0xa223('0xa')]('/:id/messages',auth[_0xa223('0xb')](),controller[_0xa223('0x13')]);router[_0xa223('0xa')](_0xa223('0x14'),auth['isChatInteractionAuthorized'](),controller[_0xa223('0x15')]);router['get'](_0xa223('0x16'),auth[_0xa223('0xb')](),controller[_0xa223('0x17')]);router['post']('/',auth[_0xa223('0xb')](),controller[_0xa223('0x18')]);router[_0xa223('0x19')](_0xa223('0x1a'),auth[_0xa223('0xb')](),controller[_0xa223('0x1b')]);var upload=multer({'storage':multer[_0xa223('0x1c')]({'destination':function(_0x2aaa4b,_0x46c167,_0x27f983){_0x27f983(null,path['join'](config['root'],_0xa223('0x1d')));},'filename':function(_0x1cb544,_0x539517,_0x3f8d86){_0x3f8d86(null,util[_0xa223('0x1e')](_0xa223('0x1f'),Date['now'](),_0x539517[_0xa223('0x20')][_0xa223('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa223('0x19')](_0xa223('0x22'),upload[_0xa223('0x23')](_0xa223('0x24')),controller[_0xa223('0x25')]);router[_0xa223('0x19')](_0xa223('0x26'),auth[_0xa223('0xf')](),controller['addMessage']);router['post'](_0xa223('0x27'),auth[_0xa223('0xb')](),interaction['tracked'](_0xa223('0x28'),'chatinteraction:addtags'),controller[_0xa223('0x29')]);router['put']('/:id',auth[_0xa223('0xb')](),interaction['tracked'](_0xa223('0x28'),'chatinteraction:update'),controller[_0xa223('0x2a')]);router[_0xa223('0x2b')](_0xa223('0x2c'),controller[_0xa223('0x2d')]);router['put'](_0xa223('0x2e'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xa223('0x2b')](_0xa223('0x2f'),controller[_0xa223('0x30')]);router[_0xa223('0x31')](_0xa223('0x32'),auth[_0xa223('0xb')](),interaction[_0xa223('0x33')](_0xa223('0x28'),_0xa223('0x34')),controller[_0xa223('0x35')]);router['delete'](_0xa223('0x27'),auth[_0xa223('0xb')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 0321b3f..07bfd05 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 _0x18ec=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x437eda,_0x35eaa6){var _0x35b585=function(_0x23c15a){while(--_0x23c15a){_0x437eda['push'](_0x437eda['shift']());}};_0x35b585(++_0x35eaa6);}(_0x18ec,0xb4));var _0xc18e=function(_0x5ab69c,_0x52f26b){_0x5ab69c=_0x5ab69c-0x0;var _0x112e12=_0x18ec[_0x5ab69c];return _0x112e12;};'use strict';var Sequelize=require(_0xc18e('0x0'));module[_0xc18e('0x1')]={'body':{'type':Sequelize[_0xc18e('0x2')](_0xc18e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc18e('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc18e('0x5')]}}; \ No newline at end of file +var _0x5eca=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x55c7e4,_0x1746d7){var _0x48b877=function(_0x299ec0){while(--_0x299ec0){_0x55c7e4['push'](_0x55c7e4['shift']());}};_0x48b877(++_0x1746d7);}(_0x5eca,0x1bd));var _0xa5ec=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5eca[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0xa5ec('0x0')]={'body':{'type':Sequelize[_0xa5ec('0x1')](_0xa5ec('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa5ec('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa5ec('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index f8bf888..ee1c9d4 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 _0x2bb9=['merge','VIRTUAL','filter','includeAll','include','show','params','filters','options','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','findAll','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x19bdd2,_0x152c0f){var _0x218bcf=function(_0x112b8c){while(--_0x112b8c){_0x19bdd2['push'](_0x19bdd2['shift']());}};_0x218bcf(++_0x152c0f);}(_0x2bb9,0x16e));var _0x92bb=function(_0x513cbb,_0x5bbea5){_0x513cbb=_0x513cbb-0x0;var _0x481b9e=_0x2bb9[_0x513cbb];return _0x481b9e;};'use strict';var emlformat=require(_0x92bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92bb('0x1'));var jsonpatch=require(_0x92bb('0x2'));var rp=require(_0x92bb('0x3'));var moment=require(_0x92bb('0x4'));var BPromise=require(_0x92bb('0x5'));var Mustache=require(_0x92bb('0x6'));var util=require(_0x92bb('0x7'));var path=require(_0x92bb('0x8'));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(_0x92bb('0x9'));var squel=require(_0x92bb('0xa'));var crypto=require('crypto');var jsforce=require(_0x92bb('0xb'));var deskjs=require(_0x92bb('0xc'));var toCsv=require(_0x92bb('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x92bb('0xe'));var qs=require(_0x92bb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92bb('0x10'));var logger=require(_0x92bb('0x11'))(_0x92bb('0x12'));var utils=require(_0x92bb('0x13'));var config=require(_0x92bb('0x14'));var licenseUtil=require(_0x92bb('0x15'));var db=require(_0x92bb('0x16'))['db'];config['redis']=_[_0x92bb('0x17')](config[_0x92bb('0x18')],{'host':_0x92bb('0x19'),'port':0x18eb});var socket=require(_0x92bb('0x1a'))(new Redis(config[_0x92bb('0x18')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x5049b4,_0x549532){_0x549532=_0x549532||0xcc;return function(_0x59bba2){if(_0x59bba2){return _0x5049b4[_0x92bb('0x1b')](_0x549532);}return _0x5049b4[_0x92bb('0x1c')](_0x549532)[_0x92bb('0x1d')]();};}function respondWithResult(_0x4e996d,_0x2c95f2){_0x2c95f2=_0x2c95f2||0xc8;return function(_0x3c7fde){if(_0x3c7fde){return _0x4e996d[_0x92bb('0x1c')](_0x2c95f2)['json'](_0x3c7fde);}};}function respondWithFilteredResult(_0xcf57bc,_0x4d1477){return function(_0x564b7f){if(_0x564b7f){var _0x1222ce=typeof _0x4d1477[_0x92bb('0x1e')]==='undefined'&&typeof _0x4d1477[_0x92bb('0x1f')]==='undefined';var _0x33fd01=_0x564b7f[_0x92bb('0x20')];var _0x513338=_0x1222ce?0x0:_0x4d1477[_0x92bb('0x1e')];var _0x3f3ac0=_0x1222ce?_0x564b7f[_0x92bb('0x20')]:_0x4d1477[_0x92bb('0x1e')]+_0x4d1477[_0x92bb('0x1f')];var _0x30c08e;if(_0x3f3ac0>=_0x33fd01){_0x3f3ac0=_0x33fd01;_0x30c08e=0xc8;}else{_0x30c08e=0xce;}_0xcf57bc[_0x92bb('0x1c')](_0x30c08e);return _0xcf57bc[_0x92bb('0x21')](_0x92bb('0x22'),_0x513338+'-'+_0x3f3ac0+'/'+_0x33fd01)[_0x92bb('0x23')](_0x564b7f);}return null;};}function patchUpdates(_0x725571){return function(_0x275158){try{jsonpatch[_0x92bb('0x24')](_0x275158,_0x725571,!![]);}catch(_0x5ef69d){return BPromise['reject'](_0x5ef69d);}return _0x275158[_0x92bb('0x25')]();};}function saveUpdates(_0x37c400,_0x527eb0){return function(_0x3a1452){if(_0x3a1452){return _0x3a1452[_0x92bb('0x26')](_0x37c400)['then'](function(_0x87c619){return _0x87c619;});}return null;};}function removeEntity(_0x323007,_0x4d926e){return function(_0x39f8a1){if(_0x39f8a1){return _0x39f8a1['destroy']()[_0x92bb('0x27')](function(){_0x323007['status'](0xcc)[_0x92bb('0x1d')]();});}};}function handleEntityNotFound(_0x1e83c1,_0x513b45){return function(_0x179985){if(!_0x179985){_0x1e83c1[_0x92bb('0x1b')](0x194);}return _0x179985;};}function handleError(_0x22cd1a,_0x4853b9){_0x4853b9=_0x4853b9||0x1f4;return function(_0xe58677){logger[_0x92bb('0x28')](_0xe58677[_0x92bb('0x29')]);if(_0xe58677[_0x92bb('0x2a')]){delete _0xe58677[_0x92bb('0x2a')];}_0x22cd1a[_0x92bb('0x1c')](_0x4853b9)[_0x92bb('0x2b')](_0xe58677);};}exports[_0x92bb('0x2c')]=function(_0x66f374,_0x51f3de){var _0x2d5f13={},_0x164c6b={},_0x4592c5={'count':0x0,'rows':[]};var _0x4dc6b6=_[_0x92bb('0x2d')](db[_0x92bb('0x2e')][_0x92bb('0x2f')],function(_0x2689d8){return{'name':_0x2689d8['fieldName'],'type':_0x2689d8[_0x92bb('0x30')][_0x92bb('0x31')]};});_0x164c6b[_0x92bb('0x32')]=_[_0x92bb('0x2d')](_0x4dc6b6,_0x92bb('0x2a'));_0x164c6b[_0x92bb('0x33')]=_[_0x92bb('0x34')](_0x66f374['query']);_0x164c6b['filters']=_[_0x92bb('0x35')](_0x164c6b[_0x92bb('0x32')],_0x164c6b[_0x92bb('0x33')]);_0x2d5f13['attributes']=_[_0x92bb('0x35')](_0x164c6b[_0x92bb('0x32')],qs[_0x92bb('0x36')](_0x66f374['query']['fields']));_0x2d5f13[_0x92bb('0x37')]=_0x2d5f13['attributes'][_0x92bb('0x38')]?_0x2d5f13['attributes']:_0x164c6b[_0x92bb('0x32')];if(!_0x66f374[_0x92bb('0x33')][_0x92bb('0x39')]('nolimit')){_0x2d5f13[_0x92bb('0x1f')]=qs[_0x92bb('0x1f')](_0x66f374[_0x92bb('0x33')][_0x92bb('0x1f')]);_0x2d5f13[_0x92bb('0x1e')]=qs[_0x92bb('0x1e')](_0x66f374['query'][_0x92bb('0x1e')]);}_0x2d5f13[_0x92bb('0x3a')]=qs[_0x92bb('0x3b')](_0x66f374['query'][_0x92bb('0x3b')]);_0x2d5f13[_0x92bb('0x3c')]=qs['filters'](_[_0x92bb('0x3d')](_0x66f374['query'],_0x164c6b['filters']),_0x4dc6b6);if(_0x66f374['query']['filter']){_0x2d5f13[_0x92bb('0x3c')]=_[_0x92bb('0x3e')](_0x2d5f13['where'],{'$or':_[_0x92bb('0x2d')](_0x4dc6b6,function(_0x5762fa){if(_0x5762fa['type']!==_0x92bb('0x3f')){var _0x56b35f={};_0x56b35f[_0x5762fa[_0x92bb('0x2a')]]={'$like':'%'+_0x66f374[_0x92bb('0x33')][_0x92bb('0x40')]+'%'};return _0x56b35f;}})});}_0x2d5f13=_[_0x92bb('0x3e')]({},_0x2d5f13,_0x66f374['options']);var _0x5b3558={'where':_0x2d5f13['where']};return db[_0x92bb('0x2e')][_0x92bb('0x20')](_0x5b3558)['then'](function(_0x4a8053){_0x4592c5['count']=_0x4a8053;if(_0x66f374[_0x92bb('0x33')][_0x92bb('0x41')]){_0x2d5f13[_0x92bb('0x42')]=[{'all':!![]}];}return db[_0x92bb('0x2e')]['findAll'](_0x2d5f13);})[_0x92bb('0x27')](function(_0x2541bb){_0x4592c5['rows']=_0x2541bb;return _0x4592c5;})[_0x92bb('0x27')](respondWithFilteredResult(_0x51f3de,_0x2d5f13))['catch'](handleError(_0x51f3de,null));};exports[_0x92bb('0x43')]=function(_0xfd485a,_0x53fd31){var _0x34c66c={'raw':!![],'where':{'id':_0xfd485a[_0x92bb('0x44')]['id']}},_0x23d7a0={};_0x23d7a0['model']=_[_0x92bb('0x34')](db['ChatInternalMessage'][_0x92bb('0x2f')]);_0x23d7a0[_0x92bb('0x33')]=_[_0x92bb('0x34')](_0xfd485a['query']);_0x23d7a0[_0x92bb('0x45')]=_[_0x92bb('0x35')](_0x23d7a0[_0x92bb('0x32')],_0x23d7a0['query']);_0x34c66c['attributes']=_['intersection'](_0x23d7a0['model'],qs[_0x92bb('0x36')](_0xfd485a['query'][_0x92bb('0x36')]));_0x34c66c['attributes']=_0x34c66c['attributes']['length']?_0x34c66c[_0x92bb('0x37')]:_0x23d7a0[_0x92bb('0x32')];if(_0xfd485a[_0x92bb('0x33')]['includeAll']){_0x34c66c[_0x92bb('0x42')]=[{'all':!![]}];}_0x34c66c=_[_0x92bb('0x3e')]({},_0x34c66c,_0xfd485a[_0x92bb('0x46')]);return db['ChatInternalMessage'][_0x92bb('0x47')](_0x34c66c)['then'](handleEntityNotFound(_0x53fd31,null))[_0x92bb('0x27')](respondWithResult(_0x53fd31,null))['catch'](handleError(_0x53fd31,null));};exports[_0x92bb('0x48')]=function(_0x454e19,_0x3745d6){return db[_0x92bb('0x2e')]['create'](_0x454e19[_0x92bb('0x49')],{})['then'](respondWithResult(_0x3745d6,0xc9))[_0x92bb('0x4a')](handleError(_0x3745d6,null));};exports[_0x92bb('0x26')]=function(_0x568cdd,_0x1cc939){if(_0x568cdd[_0x92bb('0x49')]['id']){delete _0x568cdd[_0x92bb('0x49')]['id'];}return db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'id':_0x568cdd[_0x92bb('0x44')]['id']}})[_0x92bb('0x27')](handleEntityNotFound(_0x1cc939,null))[_0x92bb('0x27')](saveUpdates(_0x568cdd[_0x92bb('0x49')],null))['then'](respondWithResult(_0x1cc939,null))[_0x92bb('0x4a')](handleError(_0x1cc939,null));};exports['destroy']=function(_0x5eccc5,_0x661ef){return db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'id':_0x5eccc5[_0x92bb('0x44')]['id']}})['then'](handleEntityNotFound(_0x661ef,null))[_0x92bb('0x27')](removeEntity(_0x661ef,null))[_0x92bb('0x4a')](handleError(_0x661ef,null));};exports[_0x92bb('0x4b')]=function(_0xe91c9b,_0x189595){return db[_0x92bb('0x2e')][_0x92bb('0x4b')]()[_0x92bb('0x27')](respondWithResult(_0x189595,null))[_0x92bb('0x4a')](handleError(_0x189595,null));};function wrapUser(_0x44d6f4){return function(_0x302cb2){var _0x24dfdb=_0x44d6f4[_0x92bb('0x4c')]({'plain':!![]});_0x24dfdb[_0x92bb('0x4d')]=[];if(_0x302cb2){_0x24dfdb[_0x92bb('0x4e')]=_0x302cb2[_0x92bb('0x4f')];_0x24dfdb[_0x92bb('0x50')]=_0x302cb2;}else{_0x24dfdb[_0x92bb('0x4e')]=moment(0x0)[_0x92bb('0x51')](_0x92bb('0x52'));_0x24dfdb[_0x92bb('0x50')]={};}return _0x24dfdb;};}exports[_0x92bb('0x53')]=function(_0x3e27a1,_0x52433f,_0x2e8cdc){var _0x445d78=[];return db[_0x92bb('0x54')]['findAll']({'where':{'role':['agent',_0x92bb('0x55'),_0x92bb('0x56')]},'attributes':['id','fullname',_0x92bb('0x2a'),'role','userpic',_0x92bb('0x57'),_0x92bb('0x58'),_0x92bb('0x59'),_0x92bb('0x5a'),'showWebBar'],'order':qs[_0x92bb('0x3b')](_0x92bb('0x5b')),'include':[{'model':db[_0x92bb('0x5c')],'as':_0x92bb('0x5d'),'attributes':['id',_0x92bb('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x92bb('0x27')](function(_0x2ba634){if(_0x2ba634){var _0x3356bd=_0x3e27a1[_0x92bb('0x56')][_0x92bb('0x4c')]({'plain':!![]});if(!_0x3356bd)throw new Error(_0x92bb('0x5e'));if(_0x3356bd[_0x92bb('0x5f')]==='user'){return db[_0x92bb('0x60')][_0x92bb('0x47')]({'where':{'name':'Agents','userProfileId':_0x3356bd['userProfileId']},'raw':!![]})[_0x92bb('0x27')](function(_0xf906d0){if(_0xf906d0){if(_0xf906d0[_0x92bb('0x61')]===0x0){return db['UserProfileResource'][_0x92bb('0x62')]({'where':{'sectionId':_0xf906d0['id']},'raw':!![]})[_0x92bb('0x27')](function(_0x20e01f){var _0xc827e8=[];if(_['isEmpty'](_0x20e01f)){_0xc827e8=_[_0x92bb('0x40')](_0x2ba634,function(_0x2c1507){if(_0x2c1507['role']!==_0x92bb('0x63')){return _0x2c1507;}});return _0xc827e8;}else{for(var _0x420ef7=0x0;_0x420ef7<_0x2ba634['length'];_0x420ef7++){var _0x5350f5=_0x2ba634[_0x420ef7];if(_0x5350f5['role']===_0x92bb('0x63')){var _0x39199a=_[_0x92bb('0x47')](_0x20e01f,function(_0x512076){return _0x512076[_0x92bb('0x64')]===_0x5350f5['id'];});if(_0x39199a)_0xc827e8[_0x92bb('0x65')](_0x5350f5);}else{_0xc827e8['push'](_0x5350f5);}}return _0xc827e8;}});}else{return _0x2ba634;}}else{var _0x1bab42=_['filter'](_0x2ba634,function(_0x55ecf1){if(_0x55ecf1[_0x92bb('0x5f')]!=='agent'){return _0x55ecf1;}});return _0x1bab42;}});}else{return _0x2ba634;}}})[_0x92bb('0x27')](function(_0xe6254f){var _0x19ce2b=[];if(_0xe6254f){_0x445d78=_0xe6254f;for(var _0x2bc1d6=0x0;_0x2bc1d6<_0xe6254f[_0x92bb('0x38')];_0x2bc1d6+=0x1){_0x445d78[_0x2bc1d6]['messages']=[];_0x19ce2b[_0x92bb('0x65')](db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'FromId':[_0x3e27a1[_0x92bb('0x56')]['id'],_0xe6254f[_0x2bc1d6]['id']],'ToId':[_0x3e27a1['user']['id'],_0xe6254f[_0x2bc1d6]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x92bb('0x66'),_0x92bb('0x67'),_0x92bb('0x68'),_0x92bb('0x49')],'order':qs[_0x92bb('0x3b')](_0x92bb('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xe6254f[_0x2bc1d6])));}return BPromise[_0x92bb('0x6a')](_0x19ce2b);}return[];})[_0x92bb('0x27')](function(_0x515639){return{'rows':_0x515639,'count':_0x515639[_0x92bb('0x38')]};})[_0x92bb('0x27')](respondWithResult(_0x52433f,null))[_0x92bb('0x4a')](handleError(_0x52433f,null));}; \ No newline at end of file +var _0xf4f5=['VIRTUAL','options','findAll','catch','show','rawAttributes','intersection','includeAll','include','find','create','body','update','params','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','internal','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Agents','userProfileId','autoAssociation','UserProfileResource','role','push','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','count','Content-Range','apply','reject','then','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge'];(function(_0x11a114,_0x49cbd7){var _0x1d7dfb=function(_0xb658b7){while(--_0xb658b7){_0x11a114['push'](_0x11a114['shift']());}};_0x1d7dfb(++_0x49cbd7);}(_0xf4f5,0x97));var _0x5f4f=function(_0x38f116,_0xf3e8bb){_0x38f116=_0x38f116-0x0;var _0x1851f1=_0xf4f5[_0x38f116];return _0x1851f1;};'use strict';var emlformat=require(_0x5f4f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f4f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f4f('0x2'));var moment=require(_0x5f4f('0x3'));var BPromise=require(_0x5f4f('0x4'));var Mustache=require('mustache');var util=require(_0x5f4f('0x5'));var path=require(_0x5f4f('0x6'));var sox=require('sox');var csv=require(_0x5f4f('0x7'));var ejs=require(_0x5f4f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f4f('0x9'));var squel=require(_0x5f4f('0xa'));var crypto=require(_0x5f4f('0xb'));var jsforce=require(_0x5f4f('0xc'));var deskjs=require(_0x5f4f('0xd'));var toCsv=require(_0x5f4f('0x7'));var querystring=require(_0x5f4f('0xe'));var Papa=require(_0x5f4f('0xf'));var Redis=require(_0x5f4f('0x10'));var authService=require(_0x5f4f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5f4f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f4f('0x13'));var utils=require(_0x5f4f('0x14'));var config=require(_0x5f4f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f4f('0x16'))['db'];config['redis']=_[_0x5f4f('0x17')](config[_0x5f4f('0x18')],{'host':_0x5f4f('0x19'),'port':0x18eb});var socket=require(_0x5f4f('0x1a'))(new Redis(config['redis']));require(_0x5f4f('0x1b'))[_0x5f4f('0x1c')](socket);function respondWithStatusCode(_0x4d9c38,_0x1a77b8){_0x1a77b8=_0x1a77b8||0xcc;return function(_0x132394){if(_0x132394){return _0x4d9c38[_0x5f4f('0x1d')](_0x1a77b8);}return _0x4d9c38[_0x5f4f('0x1e')](_0x1a77b8)[_0x5f4f('0x1f')]();};}function respondWithResult(_0x39a793,_0x22688e){_0x22688e=_0x22688e||0xc8;return function(_0x366afa){if(_0x366afa){return _0x39a793['status'](_0x22688e)[_0x5f4f('0x20')](_0x366afa);}};}function respondWithFilteredResult(_0x520ce3,_0x35efee){return function(_0x276527){if(_0x276527){var _0x3ccbab=typeof _0x35efee[_0x5f4f('0x21')]==='undefined'&&typeof _0x35efee['limit']==='undefined';var _0x5db826=_0x276527[_0x5f4f('0x22')];var _0x184a5f=_0x3ccbab?0x0:_0x35efee['offset'];var _0x176854=_0x3ccbab?_0x276527[_0x5f4f('0x22')]:_0x35efee[_0x5f4f('0x21')]+_0x35efee['limit'];var _0x454569;if(_0x176854>=_0x5db826){_0x176854=_0x5db826;_0x454569=0xc8;}else{_0x454569=0xce;}_0x520ce3[_0x5f4f('0x1e')](_0x454569);return _0x520ce3['set'](_0x5f4f('0x23'),_0x184a5f+'-'+_0x176854+'/'+_0x5db826)[_0x5f4f('0x20')](_0x276527);}return null;};}function patchUpdates(_0x28e616){return function(_0xedfc65){try{jsonpatch[_0x5f4f('0x24')](_0xedfc65,_0x28e616,!![]);}catch(_0x5391e6){return BPromise[_0x5f4f('0x25')](_0x5391e6);}return _0xedfc65['save']();};}function saveUpdates(_0x587b10,_0x4e37f2){return function(_0x11206e){if(_0x11206e){return _0x11206e['update'](_0x587b10)['then'](function(_0xe667bb){return _0xe667bb;});}return null;};}function removeEntity(_0x52e848,_0x2603d8){return function(_0x489904){if(_0x489904){return _0x489904['destroy']()[_0x5f4f('0x26')](function(){_0x52e848[_0x5f4f('0x1e')](0xcc)[_0x5f4f('0x1f')]();});}};}function handleEntityNotFound(_0x4b88e0,_0x21f16c){return function(_0x3be5ff){if(!_0x3be5ff){_0x4b88e0[_0x5f4f('0x1d')](0x194);}return _0x3be5ff;};}function handleError(_0x57912c,_0x2040f4){_0x2040f4=_0x2040f4||0x1f4;return function(_0x3109ad){logger[_0x5f4f('0x27')](_0x3109ad[_0x5f4f('0x28')]);if(_0x3109ad[_0x5f4f('0x29')]){delete _0x3109ad['name'];}_0x57912c['status'](_0x2040f4)[_0x5f4f('0x2a')](_0x3109ad);};}exports[_0x5f4f('0x2b')]=function(_0x684634,_0x2e126a){var _0x32f9fb={},_0x4c0bd1={},_0x4ee11d={'count':0x0,'rows':[]};var _0x3d5427=_[_0x5f4f('0x2c')](db[_0x5f4f('0x2d')]['rawAttributes'],function(_0x75f192){return{'name':_0x75f192[_0x5f4f('0x2e')],'type':_0x75f192[_0x5f4f('0x2f')][_0x5f4f('0x30')]};});_0x4c0bd1[_0x5f4f('0x31')]=_[_0x5f4f('0x2c')](_0x3d5427,_0x5f4f('0x29'));_0x4c0bd1['query']=_[_0x5f4f('0x32')](_0x684634[_0x5f4f('0x33')]);_0x4c0bd1[_0x5f4f('0x34')]=_['intersection'](_0x4c0bd1[_0x5f4f('0x31')],_0x4c0bd1[_0x5f4f('0x33')]);_0x32f9fb[_0x5f4f('0x35')]=_['intersection'](_0x4c0bd1[_0x5f4f('0x31')],qs[_0x5f4f('0x36')](_0x684634['query'][_0x5f4f('0x36')]));_0x32f9fb[_0x5f4f('0x35')]=_0x32f9fb[_0x5f4f('0x35')][_0x5f4f('0x37')]?_0x32f9fb[_0x5f4f('0x35')]:_0x4c0bd1[_0x5f4f('0x31')];if(!_0x684634['query'][_0x5f4f('0x38')]('nolimit')){_0x32f9fb[_0x5f4f('0x39')]=qs[_0x5f4f('0x39')](_0x684634[_0x5f4f('0x33')][_0x5f4f('0x39')]);_0x32f9fb[_0x5f4f('0x21')]=qs[_0x5f4f('0x21')](_0x684634[_0x5f4f('0x33')][_0x5f4f('0x21')]);}_0x32f9fb['order']=qs[_0x5f4f('0x3a')](_0x684634[_0x5f4f('0x33')][_0x5f4f('0x3a')]);_0x32f9fb[_0x5f4f('0x3b')]=qs[_0x5f4f('0x34')](_[_0x5f4f('0x3c')](_0x684634['query'],_0x4c0bd1[_0x5f4f('0x34')]),_0x3d5427);if(_0x684634[_0x5f4f('0x33')][_0x5f4f('0x3d')]){_0x32f9fb[_0x5f4f('0x3b')]=_[_0x5f4f('0x3e')](_0x32f9fb[_0x5f4f('0x3b')],{'$or':_[_0x5f4f('0x2c')](_0x3d5427,function(_0x3d5f3b){if(_0x3d5f3b[_0x5f4f('0x2f')]!==_0x5f4f('0x3f')){var _0x50fe84={};_0x50fe84[_0x3d5f3b[_0x5f4f('0x29')]]={'$like':'%'+_0x684634[_0x5f4f('0x33')][_0x5f4f('0x3d')]+'%'};return _0x50fe84;}})});}_0x32f9fb=_[_0x5f4f('0x3e')]({},_0x32f9fb,_0x684634[_0x5f4f('0x40')]);var _0x38cb3e={'where':_0x32f9fb[_0x5f4f('0x3b')]};return db[_0x5f4f('0x2d')][_0x5f4f('0x22')](_0x38cb3e)[_0x5f4f('0x26')](function(_0x5e4fe3){_0x4ee11d['count']=_0x5e4fe3;if(_0x684634[_0x5f4f('0x33')]['includeAll']){_0x32f9fb['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5f4f('0x41')](_0x32f9fb);})[_0x5f4f('0x26')](function(_0x458e8d){_0x4ee11d['rows']=_0x458e8d;return _0x4ee11d;})[_0x5f4f('0x26')](respondWithFilteredResult(_0x2e126a,_0x32f9fb))[_0x5f4f('0x42')](handleError(_0x2e126a,null));};exports[_0x5f4f('0x43')]=function(_0x3fac69,_0x4faf1e){var _0x438583={'raw':!![],'where':{'id':_0x3fac69['params']['id']}},_0x30c1d2={};_0x30c1d2[_0x5f4f('0x31')]=_[_0x5f4f('0x32')](db['ChatInternalMessage'][_0x5f4f('0x44')]);_0x30c1d2[_0x5f4f('0x33')]=_[_0x5f4f('0x32')](_0x3fac69[_0x5f4f('0x33')]);_0x30c1d2[_0x5f4f('0x34')]=_[_0x5f4f('0x45')](_0x30c1d2['model'],_0x30c1d2[_0x5f4f('0x33')]);_0x438583[_0x5f4f('0x35')]=_[_0x5f4f('0x45')](_0x30c1d2[_0x5f4f('0x31')],qs[_0x5f4f('0x36')](_0x3fac69[_0x5f4f('0x33')][_0x5f4f('0x36')]));_0x438583['attributes']=_0x438583[_0x5f4f('0x35')][_0x5f4f('0x37')]?_0x438583[_0x5f4f('0x35')]:_0x30c1d2[_0x5f4f('0x31')];if(_0x3fac69[_0x5f4f('0x33')][_0x5f4f('0x46')]){_0x438583[_0x5f4f('0x47')]=[{'all':!![]}];}_0x438583=_['merge']({},_0x438583,_0x3fac69['options']);return db[_0x5f4f('0x2d')][_0x5f4f('0x48')](_0x438583)[_0x5f4f('0x26')](handleEntityNotFound(_0x4faf1e,null))[_0x5f4f('0x26')](respondWithResult(_0x4faf1e,null))[_0x5f4f('0x42')](handleError(_0x4faf1e,null));};exports[_0x5f4f('0x49')]=function(_0x5c5074,_0x387200){return db['ChatInternalMessage']['create'](_0x5c5074[_0x5f4f('0x4a')],{})['then'](respondWithResult(_0x387200,0xc9))[_0x5f4f('0x42')](handleError(_0x387200,null));};exports[_0x5f4f('0x4b')]=function(_0x484269,_0xf4a5ed){if(_0x484269['body']['id']){delete _0x484269[_0x5f4f('0x4a')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x484269[_0x5f4f('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf4a5ed,null))[_0x5f4f('0x26')](saveUpdates(_0x484269[_0x5f4f('0x4a')],null))['then'](respondWithResult(_0xf4a5ed,null))[_0x5f4f('0x42')](handleError(_0xf4a5ed,null));};exports[_0x5f4f('0x4d')]=function(_0xdc8654,_0x44a3e4){return db[_0x5f4f('0x2d')][_0x5f4f('0x48')]({'where':{'id':_0xdc8654[_0x5f4f('0x4c')]['id']}})[_0x5f4f('0x26')](handleEntityNotFound(_0x44a3e4,null))[_0x5f4f('0x26')](removeEntity(_0x44a3e4,null))[_0x5f4f('0x42')](handleError(_0x44a3e4,null));};exports[_0x5f4f('0x4e')]=function(_0x51d55e,_0x5df54c){return db[_0x5f4f('0x2d')][_0x5f4f('0x4e')]()[_0x5f4f('0x26')](respondWithResult(_0x5df54c,null))[_0x5f4f('0x42')](handleError(_0x5df54c,null));};function wrapUser(_0x58780b){return function(_0x49189f){var _0x3a8c2c=_0x58780b[_0x5f4f('0x4f')]({'plain':!![]});_0x3a8c2c[_0x5f4f('0x50')]=[];if(_0x49189f){_0x3a8c2c['lastMessageAt']=_0x49189f[_0x5f4f('0x51')];_0x3a8c2c[_0x5f4f('0x52')]=_0x49189f;}else{_0x3a8c2c[_0x5f4f('0x53')]=moment(0x0)[_0x5f4f('0x54')](_0x5f4f('0x55'));_0x3a8c2c['lastMessage']={};}return _0x3a8c2c;};}exports['getUsers']=function(_0x247cb9,_0xebedf,_0x16e715){var _0x134c0f=[];return db[_0x5f4f('0x56')][_0x5f4f('0x41')]({'where':{'role':[_0x5f4f('0x57'),_0x5f4f('0x58'),_0x5f4f('0x59')]},'attributes':['id','fullname',_0x5f4f('0x29'),'role','userpic',_0x5f4f('0x5a'),'online','lastLoginAt',_0x5f4f('0x5b'),_0x5f4f('0x5c')],'order':qs['sort'](_0x5f4f('0x5d')),'include':[{'model':db[_0x5f4f('0x5e')],'as':_0x5f4f('0x5f'),'attributes':['id',_0x5f4f('0x29'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x4f0fb7){if(_0x4f0fb7){var _0x999b10=_0x247cb9[_0x5f4f('0x59')][_0x5f4f('0x4f')]({'plain':!![]});if(!_0x999b10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x999b10['role']===_0x5f4f('0x59')){return db['UserProfileSection'][_0x5f4f('0x48')]({'where':{'name':_0x5f4f('0x60'),'userProfileId':_0x999b10[_0x5f4f('0x61')]},'raw':!![]})[_0x5f4f('0x26')](function(_0x139ab5){if(_0x139ab5){if(_0x139ab5[_0x5f4f('0x62')]===0x0){return db[_0x5f4f('0x63')]['findAll']({'where':{'sectionId':_0x139ab5['id']},'raw':!![]})[_0x5f4f('0x26')](function(_0xe10260){var _0x293dfc=[];if(_['isEmpty'](_0xe10260)){_0x293dfc=_[_0x5f4f('0x3d')](_0x4f0fb7,function(_0xcc8c8c){if(_0xcc8c8c[_0x5f4f('0x64')]!==_0x5f4f('0x57')){return _0xcc8c8c;}});return _0x293dfc;}else{for(var _0x491df0=0x0;_0x491df0<_0x4f0fb7[_0x5f4f('0x37')];_0x491df0++){var _0x5544b4=_0x4f0fb7[_0x491df0];if(_0x5544b4[_0x5f4f('0x64')]===_0x5f4f('0x57')){var _0x440a50=_[_0x5f4f('0x48')](_0xe10260,function(_0x5f2237){return _0x5f2237['resourceId']===_0x5544b4['id'];});if(_0x440a50)_0x293dfc['push'](_0x5544b4);}else{_0x293dfc[_0x5f4f('0x65')](_0x5544b4);}}return _0x293dfc;}});}else{return _0x4f0fb7;}}else{var _0x15f248=_[_0x5f4f('0x3d')](_0x4f0fb7,function(_0x10b45b){if(_0x10b45b['role']!==_0x5f4f('0x57')){return _0x10b45b;}});return _0x15f248;}});}else{return _0x4f0fb7;}}})['then'](function(_0x53e01a){var _0x443b26=[];if(_0x53e01a){_0x134c0f=_0x53e01a;for(var _0x350c34=0x0;_0x350c34<_0x53e01a['length'];_0x350c34+=0x1){_0x134c0f[_0x350c34][_0x5f4f('0x50')]=[];_0x443b26[_0x5f4f('0x65')](db[_0x5f4f('0x2d')]['find']({'where':{'FromId':[_0x247cb9[_0x5f4f('0x59')]['id'],_0x53e01a[_0x350c34]['id']],'ToId':[_0x247cb9[_0x5f4f('0x59')]['id'],_0x53e01a[_0x350c34]['id']],'ChatGroupId':null},'attributes':['id',_0x5f4f('0x51'),_0x5f4f('0x66'),_0x5f4f('0x67'),_0x5f4f('0x68'),_0x5f4f('0x4a')],'order':qs[_0x5f4f('0x3a')](_0x5f4f('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x53e01a[_0x350c34])));}return BPromise[_0x5f4f('0x6a')](_0x443b26);}return[];})['then'](function(_0x49cd40){return{'rows':_0x49cd40,'count':_0x49cd40['length']};})['then'](respondWithResult(_0xebedf,null))[_0x5f4f('0x42')](handleError(_0xebedf,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index aaf5337..1a7e4e9 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 _0x00ca=['events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x2ed636,_0x3e4f62){var _0x39224c=function(_0x379fcd){while(--_0x379fcd){_0x2ed636['push'](_0x2ed636['shift']());}};_0x39224c(++_0x3e4f62);}(_0x00ca,0x96));var _0xa00c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x00ca[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xa00c('0x0'));var ChatInternalMessage=require(_0xa00c('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa00c('0x2'),'afterUpdate':'update','afterDestroy':_0xa00c('0x3')};function emitEvent(_0x5d01cd){return function(_0x1b8f74,_0xe42dbd,_0x31b9e7){ChatInternalMessageEvents[_0xa00c('0x4')](_0x5d01cd+':'+_0x1b8f74['id'],_0x1b8f74);ChatInternalMessageEvents[_0xa00c('0x4')](_0x5d01cd,_0x1b8f74);_0x31b9e7(null);};}for(var e in events){if(events[_0xa00c('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xa182=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x1dc302,_0x397470){var _0x13f696=function(_0x2ea000){while(--_0x2ea000){_0x1dc302['push'](_0x1dc302['shift']());}};_0x13f696(++_0x397470);}(_0xa182,0x122));var _0x2a18=function(_0x206ec1,_0x58d1b6){_0x206ec1=_0x206ec1-0x0;var _0x2f0db8=_0xa182[_0x206ec1];return _0x2f0db8;};'use strict';var EventEmitter=require(_0x2a18('0x0'));var ChatInternalMessage=require(_0x2a18('0x1'))['db'][_0x2a18('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2a18('0x3')](0x0);var events={'afterCreate':_0x2a18('0x4'),'afterUpdate':_0x2a18('0x5'),'afterDestroy':_0x2a18('0x6')};function emitEvent(_0x445074){return function(_0x5897d5,_0x83e068,_0x5aeae2){ChatInternalMessageEvents[_0x2a18('0x7')](_0x445074+':'+_0x5897d5['id'],_0x5897d5);ChatInternalMessageEvents['emit'](_0x445074,_0x5897d5);_0x5aeae2(null);};}for(var e in events){if(events[_0x2a18('0x8')](e)){var event=events[e];ChatInternalMessage[_0x2a18('0x9')](e,emitEvent(event));}}module[_0x2a18('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 2f4d538..0a73b27 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 _0x9005=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatInternalMessage.attributes','exports'];(function(_0x321327,_0x4965b){var _0x33be38=function(_0x27e02c){while(--_0x27e02c){_0x321327['push'](_0x321327['shift']());}};_0x33be38(++_0x4965b);}(_0x9005,0x138));var _0x5900=function(_0x420a5b,_0x26c365){_0x420a5b=_0x420a5b-0x0;var _0x1a4f26=_0x9005[_0x420a5b];return _0x1a4f26;};'use strict';var _=require(_0x5900('0x0'));var util=require(_0x5900('0x1'));var logger=require(_0x5900('0x2'))(_0x5900('0x3'));var moment=require(_0x5900('0x4'));var BPromise=require(_0x5900('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5900('0x6'));var rimraf=require(_0x5900('0x7'));var config=require('../../config/environment');var attributes=require(_0x5900('0x8'));module[_0x5900('0x9')]=function(_0x5c5447,_0x243850){return _0x5c5447[_0x5900('0xa')](_0x5900('0xb'),attributes,{'tableName':_0x5900('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5900('0xd')});}; \ No newline at end of file +var _0xefb8=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf8634d,_0x22bff6){var _0x483203=function(_0x33d3ac){while(--_0x33d3ac){_0xf8634d['push'](_0xf8634d['shift']());}};_0x483203(++_0x22bff6);}(_0xefb8,0x1e9));var _0x8efb=function(_0x46e62d,_0x55f75d){_0x46e62d=_0x46e62d-0x0;var _0x459700=_0xefb8[_0x46e62d];return _0x459700;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8efb('0x0'))(_0x8efb('0x1'));var moment=require(_0x8efb('0x2'));var BPromise=require(_0x8efb('0x3'));var rp=require(_0x8efb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8efb('0x5'));var config=require(_0x8efb('0x6'));var attributes=require(_0x8efb('0x7'));module[_0x8efb('0x8')]=function(_0x3a94d8,_0x2a47d4){return _0x3a94d8[_0x8efb('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x8efb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8efb('0xb'),'collate':_0x8efb('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a6802d8..e4bd957 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 _0xb877=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x508232,_0x43af25){var _0x2b761d=function(_0x306a62){while(--_0x306a62){_0x508232['push'](_0x508232['shift']());}};_0x2b761d(++_0x43af25);}(_0xb877,0x1cb));var _0x7b87=function(_0x13b433,_0x285036){_0x13b433=_0x13b433-0x0;var _0x4db0aa=_0xb877[_0x13b433];return _0x4db0aa;};'use strict';var _=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var moment=require(_0x7b87('0x2'));var BPromise=require(_0x7b87('0x3'));var rs=require(_0x7b87('0x4'));var fs=require('fs');var Redis=require(_0x7b87('0x5'));var db=require(_0x7b87('0x6'))['db'];var utils=require(_0x7b87('0x7'));var logger=require(_0x7b87('0x8'))(_0x7b87('0x9'));var config=require(_0x7b87('0xa'));var jayson=require(_0x7b87('0xb'));var client=jayson[_0x7b87('0xc')][_0x7b87('0xd')]({'port':0x232a});config[_0x7b87('0xe')]=_[_0x7b87('0xf')](config[_0x7b87('0xe')],{'host':_0x7b87('0x10'),'port':0x18eb});var socket=require(_0x7b87('0x11'))(new Redis(config[_0x7b87('0xe')]));require(_0x7b87('0x12'))[_0x7b87('0x13')](socket);function respondWithRpcPromise(_0x5a0e91,_0xa8d5cc,_0x3215c7){return new BPromise(function(_0x222760,_0x2f6040){return client[_0x7b87('0x14')](_0x5a0e91,_0x3215c7)[_0x7b87('0x15')](function(_0x466403){logger[_0x7b87('0x16')](_0x7b87('0x17'),_0xa8d5cc,_0x7b87('0x18'));logger[_0x7b87('0x19')](_0x7b87('0x1a'),_0xa8d5cc,'request\x20sent',JSON['stringify'](_0x466403));if(_0x466403['error']){if(_0x466403['error']['code']===0x1f4){logger[_0x7b87('0x1b')](_0x7b87('0x17'),_0xa8d5cc,_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);return _0x2f6040(_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);}logger[_0x7b87('0x1b')](_0x7b87('0x17'),_0xa8d5cc,_0x466403['error']['message']);return _0x222760(_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);}else{logger[_0x7b87('0x16')](_0x7b87('0x17'),_0xa8d5cc,_0x7b87('0x18'));_0x222760(_0x466403[_0x7b87('0x1d')][_0x7b87('0x1c')]);}})['catch'](function(_0x4456c7){logger[_0x7b87('0x1b')]('ChatInternalMessage,\x20%s,\x20%s',_0xa8d5cc,_0x4456c7);_0x2f6040(_0x4456c7);});});} \ No newline at end of file +var _0x7da7=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x17e467,_0x2b739f){var _0x561266=function(_0xf026d){while(--_0xf026d){_0x17e467['push'](_0x17e467['shift']());}};_0x561266(++_0x2b739f);}(_0x7da7,0x10d));var _0x77da=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x7da7[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});config[_0x77da('0x9')]=_['defaults'](config[_0x77da('0x9')],{'host':_0x77da('0xa'),'port':0x18eb});var socket=require(_0x77da('0xb'))(new Redis(config[_0x77da('0x9')]));require(_0x77da('0xc'))['register'](socket);function respondWithRpcPromise(_0x40c86e,_0xb55827,_0x172d7f){return new BPromise(function(_0x5ea12f,_0x35d06e){return client[_0x77da('0xd')](_0x40c86e,_0x172d7f)[_0x77da('0xe')](function(_0x2a675a){logger['info'](_0x77da('0xf'),_0xb55827,_0x77da('0x10'));logger[_0x77da('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xb55827,'request\x20sent',JSON[_0x77da('0x12')](_0x2a675a));if(_0x2a675a[_0x77da('0x13')]){if(_0x2a675a['error'][_0x77da('0x14')]===0x1f4){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')]['message']);return _0x35d06e(_0x2a675a[_0x77da('0x13')]['message']);}logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')][_0x77da('0x15')]);return _0x5ea12f(_0x2a675a['error']['message']);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xb55827,_0x77da('0x10'));_0x5ea12f(_0x2a675a[_0x77da('0x16')][_0x77da('0x15')]);}})[_0x77da('0x17')](function(_0x19a00c){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x19a00c);_0x35d06e(_0x19a00c);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 76a6b9a..bf5aa02 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 _0xdc9c=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x197884,_0x4ecf5f){var _0x33b1af=function(_0x4fae72){while(--_0x4fae72){_0x197884['push'](_0x197884['shift']());}};_0x33b1af(++_0x4ecf5f);}(_0xdc9c,0x9d));var _0xcdc9=function(_0x30a0c0,_0x41014c){_0x30a0c0=_0x30a0c0-0x0;var _0x42cbdf=_0xdc9c[_0x30a0c0];return _0x42cbdf;};'use strict';var ChatInternalMessageEvents=require(_0xcdc9('0x0'));var events=[_0xcdc9('0x1'),'remove',_0xcdc9('0x2')];function createListener(_0x152b40,_0x8d4057){return function(_0x42f536){_0x8d4057[_0xcdc9('0x3')](_0x152b40,_0x42f536);};}function removeListener(_0x23bc59,_0x1139d6){return function(){ChatInternalMessageEvents[_0xcdc9('0x4')](_0x23bc59,_0x1139d6);};}exports[_0xcdc9('0x5')]=function(_0x446c89){for(var _0x502830=0x0,_0x3a71bc=events[_0xcdc9('0x6')];_0x502830<_0x3a71bc;_0x502830++){var _0x104dae=events[_0x502830];var _0x27d0c3=createListener(_0xcdc9('0x7')+_0x104dae,_0x446c89);ChatInternalMessageEvents['on'](_0x104dae,_0x27d0c3);}}; \ No newline at end of file +var _0x8662=['emit','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x36b34d,_0x492ce9){var _0xbd6279=function(_0x389620){while(--_0x389620){_0x36b34d['push'](_0x36b34d['shift']());}};_0xbd6279(++_0x492ce9);}(_0x8662,0x185));var _0x2866=function(_0x1fc09c,_0x42d971){_0x1fc09c=_0x1fc09c-0x0;var _0xe42f1d=_0x8662[_0x1fc09c];return _0xe42f1d;};'use strict';var ChatInternalMessageEvents=require(_0x2866('0x0'));var events=['save',_0x2866('0x1'),_0x2866('0x2')];function createListener(_0x4f718c,_0x466b7e){return function(_0x4fc80b){_0x466b7e[_0x2866('0x3')](_0x4f718c,_0x4fc80b);};}function removeListener(_0x5ef9f1,_0x2efbb6){return function(){ChatInternalMessageEvents['removeListener'](_0x5ef9f1,_0x2efbb6);};}exports[_0x2866('0x4')]=function(_0x3b42c5){for(var _0x5029c3=0x0,_0x5ee0ab=events[_0x2866('0x5')];_0x5029c3<_0x5ee0ab;_0x5029c3++){var _0x4956a2=events[_0x5029c3];var _0xb6d794=createListener(_0x2866('0x6')+_0x4956a2,_0x3b42c5);ChatInternalMessageEvents['on'](_0x4956a2,_0xb6d794);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index c4a2fd5..cc5c956 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 _0xdac2=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/users','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x22d292,_0x2d85fd){var _0x36a152=function(_0xb76399){while(--_0xb76399){_0x22d292['push'](_0x22d292['shift']());}};_0x36a152(++_0x2d85fd);}(_0xdac2,0x72));var _0x2dac=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xdac2[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2dac('0x0'));var timeout=require(_0x2dac('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2dac('0x2'));var auth=require(_0x2dac('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2dac('0x4'));var controller=require(_0x2dac('0x5'));router[_0x2dac('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2dac('0x6')](_0x2dac('0x7'),auth[_0x2dac('0x8')](),controller[_0x2dac('0x9')]);router[_0x2dac('0x6')](_0x2dac('0xa'),auth[_0x2dac('0x8')](),controller['getUsers']);router[_0x2dac('0x6')](_0x2dac('0xb'),auth[_0x2dac('0x8')](),controller[_0x2dac('0xc')]);router[_0x2dac('0xd')]('/',auth[_0x2dac('0x8')](),controller[_0x2dac('0xe')]);router[_0x2dac('0xf')](_0x2dac('0xb'),controller['update']);router[_0x2dac('0x10')](_0x2dac('0xb'),auth[_0x2dac('0x8')](),controller[_0x2dac('0x11')]);module[_0x2dac('0x12')]=router; \ No newline at end of file +var _0x9aa2=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9aa2,0x14f));var _0x29aa=function(_0x1b5ea6,_0x2f4b93){_0x1b5ea6=_0x1b5ea6-0x0;var _0x29b2d9=_0x9aa2[_0x1b5ea6];return _0x29b2d9;};'use strict';var multer=require(_0x29aa('0x0'));var util=require(_0x29aa('0x1'));var path=require(_0x29aa('0x2'));var timeout=require(_0x29aa('0x3'));var express=require('express');var router=express[_0x29aa('0x4')]();var fs_extra=require(_0x29aa('0x5'));var auth=require(_0x29aa('0x6'));var interaction=require(_0x29aa('0x7'));var config=require(_0x29aa('0x8'));var controller=require(_0x29aa('0x9'));router[_0x29aa('0xa')]('/',auth[_0x29aa('0xb')](),controller[_0x29aa('0xc')]);router[_0x29aa('0xa')](_0x29aa('0xd'),auth['isAuthenticated'](),controller[_0x29aa('0xe')]);router[_0x29aa('0xa')](_0x29aa('0xf'),auth[_0x29aa('0xb')](),controller['getUsers']);router['get']('/:id',auth[_0x29aa('0xb')](),controller[_0x29aa('0x10')]);router[_0x29aa('0x11')]('/',auth[_0x29aa('0xb')](),controller[_0x29aa('0x12')]);router[_0x29aa('0x13')](_0x29aa('0x14'),controller[_0x29aa('0x15')]);router['delete'](_0x29aa('0x14'),auth[_0x29aa('0xb')](),controller[_0x29aa('0x16')]);module[_0x29aa('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index f5cf779..5aa0c5f 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 _0x4c71=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x3d9ec7,_0x59d1f3){var _0x500f81=function(_0x39dad8){while(--_0x39dad8){_0x3d9ec7['push'](_0x3d9ec7['shift']());}};_0x500f81(++_0x59d1f3);}(_0x4c71,0x12b));var _0x14c7=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4c71[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x14c7('0x0'));module[_0x14c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x14c7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x14c7('0x4')]('in',_0x14c7('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x14c7('0x6')]},'providerName':{'type':Sequelize[_0x14c7('0x7')]},'providerResponse':{'type':Sequelize[_0x14c7('0x8')]}}; \ No newline at end of file +var _0xae60=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0xae60,0x1c7));var _0x0ae6=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xae60[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x0ae6('0x0'));module[_0x0ae6('0x1')]={'body':{'type':Sequelize[_0x0ae6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0ae6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0ae6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0ae6('0x4')]('in','out'),'defaultValue':_0x0ae6('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0ae6('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0ae6('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 6654b10..5b01807 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 _0xbae0=['fullname','internal','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','email','interface','rejectmessage','parse','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','sendStatus','name','send','map','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','ChatMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User'];(function(_0x1e3aac,_0x5118ba){var _0x4e72d0=function(_0x15648c){while(--_0x15648c){_0x1e3aac['push'](_0x1e3aac['shift']());}};_0x4e72d0(++_0x5118ba);}(_0xbae0,0x198));var _0x0bae=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xbae0[_0x2c0dc0];return _0x4c0990;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bae('0x0'));var zipdir=require(_0x0bae('0x1'));var jsonpatch=require(_0x0bae('0x2'));var rp=require('request-promise');var moment=require(_0x0bae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bae('0x4'));var util=require(_0x0bae('0x5'));var path=require(_0x0bae('0x6'));var sox=require(_0x0bae('0x7'));var csv=require(_0x0bae('0x8'));var ejs=require(_0x0bae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bae('0xa'));var squel=require(_0x0bae('0xb'));var crypto=require('crypto');var jsforce=require(_0x0bae('0xc'));var deskjs=require(_0x0bae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0bae('0xe'));var Papa=require(_0x0bae('0xf'));var Redis=require(_0x0bae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0bae('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bae('0x12'))(_0x0bae('0x13'));var utils=require(_0x0bae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0bae('0x15'))['db'];config[_0x0bae('0x16')]=_[_0x0bae('0x17')](config[_0x0bae('0x16')],{'host':_0x0bae('0x18'),'port':0x18eb});var socket=require(_0x0bae('0x19'))(new Redis(config[_0x0bae('0x16')]));require(_0x0bae('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0bae('0x1b')][_0x0bae('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59863d,_0x47532d,_0x3339b1,_0x18d4fb){return new BPromise(function(_0x1fc5d0,_0x29b2e4){var _0x2503ea=_0x18d4fb||client;return _0x2503ea[_0x0bae('0x1d')](_0x59863d,_0x3339b1)[_0x0bae('0x1e')](function(_0x4ab4ae){logger[_0x0bae('0x1f')](_0x0bae('0x20'),_0x47532d,_0x0bae('0x21'));logger[_0x0bae('0x22')](_0x0bae('0x23'),_0x47532d,_0x0bae('0x21'),JSON[_0x0bae('0x24')](_0x4ab4ae));if(_0x4ab4ae[_0x0bae('0x25')]){if(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x26')]===0x1f4){logger['error'](_0x0bae('0x20'),_0x47532d,_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);return _0x29b2e4(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);}logger[_0x0bae('0x25')](_0x0bae('0x20'),_0x47532d,_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);return _0x1fc5d0(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);}else{logger[_0x0bae('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x47532d,_0x0bae('0x21'));_0x1fc5d0(_0x4ab4ae[_0x0bae('0x28')][_0x0bae('0x27')]);}})['catch'](function(_0x5c681c){logger[_0x0bae('0x25')](_0x0bae('0x20'),_0x47532d,_0x5c681c);_0x29b2e4(_0x5c681c);});});}function respondWithStatusCode(_0x2fbf18,_0xec47e1){_0xec47e1=_0xec47e1||0xcc;return function(_0x928f78){if(_0x928f78){return _0x2fbf18['sendStatus'](_0xec47e1);}return _0x2fbf18['status'](_0xec47e1)[_0x0bae('0x29')]();};}function respondWithResult(_0x451b59,_0x4b39e3){_0x4b39e3=_0x4b39e3||0xc8;return function(_0x4a5ca6){if(_0x4a5ca6){return _0x451b59[_0x0bae('0x2a')](_0x4b39e3)[_0x0bae('0x2b')](_0x4a5ca6);}};}function respondWithFilteredResult(_0x30e5b5,_0x2bfca5){return function(_0x5f71e6){if(_0x5f71e6){var _0x253647=typeof _0x2bfca5['offset']===_0x0bae('0x2c')&&typeof _0x2bfca5[_0x0bae('0x2d')]===_0x0bae('0x2c');var _0x774b09=_0x5f71e6[_0x0bae('0x2e')];var _0x27d9e7=_0x253647?0x0:_0x2bfca5[_0x0bae('0x2f')];var _0x4494da=_0x253647?_0x5f71e6[_0x0bae('0x2e')]:_0x2bfca5[_0x0bae('0x2f')]+_0x2bfca5[_0x0bae('0x2d')];var _0x13941e;if(_0x4494da>=_0x774b09){_0x4494da=_0x774b09;_0x13941e=0xc8;}else{_0x13941e=0xce;}_0x30e5b5['status'](_0x13941e);return _0x30e5b5[_0x0bae('0x30')](_0x0bae('0x31'),_0x27d9e7+'-'+_0x4494da+'/'+_0x774b09)[_0x0bae('0x2b')](_0x5f71e6);}return null;};}function patchUpdates(_0x39b9c3){return function(_0x566f5c){try{jsonpatch['apply'](_0x566f5c,_0x39b9c3,!![]);}catch(_0x3989e8){return BPromise[_0x0bae('0x32')](_0x3989e8);}return _0x566f5c[_0x0bae('0x33')]();};}function saveUpdates(_0x468075,_0x378d02){return function(_0x213c9c){if(_0x213c9c){return _0x213c9c[_0x0bae('0x34')](_0x468075)[_0x0bae('0x1e')](function(_0x49179c){return _0x49179c;});}return null;};}function removeEntity(_0x16a51f,_0xb7ee57){return function(_0x23b688){if(_0x23b688){return _0x23b688[_0x0bae('0x35')]()[_0x0bae('0x1e')](function(){_0x16a51f[_0x0bae('0x2a')](0xcc)[_0x0bae('0x29')]();});}};}function handleEntityNotFound(_0x50ea7c,_0x4ae12f){return function(_0x505e0d){if(!_0x505e0d){_0x50ea7c[_0x0bae('0x36')](0x194);}return _0x505e0d;};}function handleError(_0x1cd2f2,_0x6d5d68){_0x6d5d68=_0x6d5d68||0x1f4;return function(_0x31ee1e){logger[_0x0bae('0x25')](_0x31ee1e['stack']);if(_0x31ee1e[_0x0bae('0x37')]){delete _0x31ee1e[_0x0bae('0x37')];}_0x1cd2f2[_0x0bae('0x2a')](_0x6d5d68)[_0x0bae('0x38')](_0x31ee1e);};}exports['index']=function(_0x54ed09,_0x4d3a13){var _0x3a2af3={},_0x24e3e1={},_0x3e8d93={'count':0x0,'rows':[]};var _0x455869=_[_0x0bae('0x39')](db['ChatMessage']['rawAttributes'],function(_0x590e49){return{'name':_0x590e49['fieldName'],'type':_0x590e49['type'][_0x0bae('0x3a')]};});_0x24e3e1[_0x0bae('0x3b')]=_[_0x0bae('0x39')](_0x455869,_0x0bae('0x37'));_0x24e3e1['query']=_[_0x0bae('0x3c')](_0x54ed09[_0x0bae('0x3d')]);_0x24e3e1[_0x0bae('0x3e')]=_[_0x0bae('0x3f')](_0x24e3e1['model'],_0x24e3e1[_0x0bae('0x3d')]);_0x3a2af3['attributes']=_[_0x0bae('0x3f')](_0x24e3e1['model'],qs[_0x0bae('0x40')](_0x54ed09[_0x0bae('0x3d')]['fields']));_0x3a2af3['attributes']=_0x3a2af3[_0x0bae('0x41')]['length']?_0x3a2af3['attributes']:_0x24e3e1[_0x0bae('0x3b')];if(!_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x42')]('nolimit')){_0x3a2af3[_0x0bae('0x2d')]=qs[_0x0bae('0x2d')](_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x2d')]);_0x3a2af3[_0x0bae('0x2f')]=qs[_0x0bae('0x2f')](_0x54ed09['query'][_0x0bae('0x2f')]);}_0x3a2af3[_0x0bae('0x43')]=qs['sort'](_0x54ed09['query'][_0x0bae('0x44')]);_0x3a2af3[_0x0bae('0x45')]=qs[_0x0bae('0x3e')](_[_0x0bae('0x46')](_0x54ed09[_0x0bae('0x3d')],_0x24e3e1[_0x0bae('0x3e')]),_0x455869);if(_0x54ed09['query']['filter']){_0x3a2af3['where']=_[_0x0bae('0x47')](_0x3a2af3['where'],{'$or':_['map'](_0x455869,function(_0x327dd2){if(_0x327dd2[_0x0bae('0x48')]!==_0x0bae('0x49')){var _0x2ca4be={};_0x2ca4be[_0x327dd2[_0x0bae('0x37')]]={'$like':'%'+_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x4a')]+'%'};return _0x2ca4be;}})});}_0x3a2af3=_[_0x0bae('0x47')]({},_0x3a2af3,_0x54ed09['options']);var _0x1efe2d={'where':_0x3a2af3[_0x0bae('0x45')]};return db[_0x0bae('0x4b')]['count'](_0x1efe2d)['then'](function(_0x6a49b1){_0x3e8d93['count']=_0x6a49b1;if(_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x4c')]){_0x3a2af3[_0x0bae('0x4d')]=[{'all':!![]}];}return db[_0x0bae('0x4b')][_0x0bae('0x4e')](_0x3a2af3);})[_0x0bae('0x1e')](function(_0xca3ec5){_0x3e8d93[_0x0bae('0x4f')]=_0xca3ec5;return _0x3e8d93;})[_0x0bae('0x1e')](respondWithFilteredResult(_0x4d3a13,_0x3a2af3))[_0x0bae('0x50')](handleError(_0x4d3a13,null));};exports[_0x0bae('0x51')]=function(_0x398bff,_0x14e0c8){var _0x514e26={'raw':!![],'where':{'id':_0x398bff[_0x0bae('0x52')]['id']}},_0x3ff432={};_0x3ff432[_0x0bae('0x3b')]=_['keys'](db[_0x0bae('0x4b')][_0x0bae('0x53')]);_0x3ff432[_0x0bae('0x3d')]=_[_0x0bae('0x3c')](_0x398bff[_0x0bae('0x3d')]);_0x3ff432[_0x0bae('0x3e')]=_[_0x0bae('0x3f')](_0x3ff432[_0x0bae('0x3b')],_0x3ff432[_0x0bae('0x3d')]);_0x514e26[_0x0bae('0x41')]=_['intersection'](_0x3ff432['model'],qs['fields'](_0x398bff[_0x0bae('0x3d')][_0x0bae('0x40')]));_0x514e26[_0x0bae('0x41')]=_0x514e26['attributes'][_0x0bae('0x54')]?_0x514e26['attributes']:_0x3ff432[_0x0bae('0x3b')];if(_0x398bff[_0x0bae('0x3d')][_0x0bae('0x4c')]){_0x514e26[_0x0bae('0x4d')]=[{'all':!![]}];}_0x514e26=_[_0x0bae('0x47')]({},_0x514e26,_0x398bff[_0x0bae('0x55')]);return db[_0x0bae('0x4b')][_0x0bae('0x56')](_0x514e26)[_0x0bae('0x1e')](handleEntityNotFound(_0x14e0c8,null))[_0x0bae('0x1e')](respondWithResult(_0x14e0c8,null))[_0x0bae('0x50')](handleError(_0x14e0c8,null));};exports[_0x0bae('0x57')]=function(_0x5b1a15,_0x501a4b){return db[_0x0bae('0x4b')]['create'](_0x5b1a15[_0x0bae('0x58')],{})[_0x0bae('0x1e')](respondWithResult(_0x501a4b,0xc9))[_0x0bae('0x50')](handleError(_0x501a4b,null));};exports[_0x0bae('0x34')]=function(_0x4d0876,_0xba0e87){if(_0x4d0876[_0x0bae('0x58')]['id']){delete _0x4d0876[_0x0bae('0x58')]['id'];}return db['ChatMessage'][_0x0bae('0x56')]({'where':{'id':_0x4d0876[_0x0bae('0x52')]['id']}})[_0x0bae('0x1e')](handleEntityNotFound(_0xba0e87,null))[_0x0bae('0x1e')](saveUpdates(_0x4d0876['body'],null))[_0x0bae('0x1e')](respondWithResult(_0xba0e87,null))[_0x0bae('0x50')](handleError(_0xba0e87,null));};exports[_0x0bae('0x35')]=function(_0x321a67,_0x861fee){return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x321a67['params']['id']}})['then'](handleEntityNotFound(_0x861fee,null))['then'](removeEntity(_0x861fee,null))[_0x0bae('0x50')](handleError(_0x861fee,null));};exports[_0x0bae('0x59')]=function(_0x99e466,_0x5139fa){return db[_0x0bae('0x4b')][_0x0bae('0x59')]()[_0x0bae('0x1e')](respondWithResult(_0x5139fa,null))['catch'](handleError(_0x5139fa,null));};var interaction_log=require(_0x0bae('0x12'))(_0x0bae('0x5a'));exports[_0x0bae('0x5b')]=function(_0x135285,_0x439d3a,_0x52d067){var _0x172591={'agent':{},'channel':_0x0bae('0x5c')};if(_0x135285[_0x0bae('0x58')]['id']){delete _0x135285[_0x0bae('0x58')]['id'];}_0x135285['body'][_0x0bae('0x5d')]=!![];_0x135285[_0x0bae('0x58')][_0x0bae('0x5e')]=moment()[_0x0bae('0x5f')](_0x0bae('0x60'));_0x135285['body'][_0x0bae('0x61')]=_0x135285[_0x0bae('0x58')]['UserId']||_0x135285[_0x0bae('0x62')]['id'];_0x172591[_0x0bae('0x63')]['id']=_0x135285[_0x0bae('0x58')]['UserId'];return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x135285['params']['id'],'UserId':null}})[_0x0bae('0x1e')](handleEntityNotFound(_0x439d3a,null))[_0x0bae('0x1e')](saveUpdates(_0x135285[_0x0bae('0x58')],null))[_0x0bae('0x1e')](function(_0x485178){if(_0x485178){_0x172591[_0x0bae('0x27')]=_0x485178[_0x0bae('0x64')]({'plain':!![]});return db[_0x0bae('0x65')][_0x0bae('0x56')]({'where':{'id':_0x485178[_0x0bae('0x66')]}});}return null;})[_0x0bae('0x1e')](handleEntityNotFound(_0x439d3a,null))[_0x0bae('0x1e')](function(_0x6a1dc9){if(_0x6a1dc9){return _0x6a1dc9[_0x0bae('0x34')]({'UserId':_0x135285[_0x0bae('0x58')]['UserId'],'read1stAt':_[_0x0bae('0x67')](_0x6a1dc9[_0x0bae('0x68')])?moment()[_0x0bae('0x5f')](_0x0bae('0x60')):undefined});}return null;})[_0x0bae('0x1e')](function(_0x249608){if(_0x249608){_0x172591[_0x0bae('0x69')]=_0x249608['get']({'plain':!![]});interaction_log[_0x0bae('0x1f')](_0x0bae('0x6a'),_0x135285[_0x0bae('0x62')]['id'],_0x135285[_0x0bae('0x62')][_0x0bae('0x37')],_0x135285[_0x0bae('0x62')][_0x0bae('0x6b')],_0x172591[_0x0bae('0x69')]['id'],_0x135285[_0x0bae('0x58')]?JSON[_0x0bae('0x24')](_0x135285['body']):_0x0bae('0x6c'));return respondWithRpcPromise(_0x0bae('0x6d'),'acceptMessage',_0x172591);}return null;})[_0x0bae('0x1e')](function(_0x409c0d){var _0x2a05c3=_0x0bae('0x6e')+_0x409c0d['message'][_0x0bae('0x6f')];return db[_0x0bae('0x70')][_0x0bae('0x3d')](_0x2a05c3,{'type':db['Sequelize'][_0x0bae('0x71')]['SELECT'],'raw':!![]})[_0x0bae('0x1e')](function(_0x57307c){return _0x57307c;});})[_0x0bae('0x1e')](function(_0x4d0c34){if(_0x4d0c34){_0x172591['message'][_0x0bae('0x72')]=_0x4d0c34[0x0];if(!_0x135285['body'][_0x0bae('0x61')])return;return db[_0x0bae('0x73')][_0x0bae('0x56')]({'where':{'id':_0x135285['body'][_0x0bae('0x61')],'role':'agent'},'attributes':['id',_0x0bae('0x37'),_0x0bae('0x74'),'email',_0x0bae('0x75')],'raw':!![]});}return null;})[_0x0bae('0x1e')](function(_0x877096){if(!_0x877096)return null;_0x172591[_0x0bae('0x27')]['agent']=_0x877096;return _0x172591;})[_0x0bae('0x1e')](function(_0x4b17ac){if(_0x4b17ac){if(_0x135285[_0x0bae('0x58')]['manual']){_0x172591['message']['interface']=util['format']('SIP/%s',_0x135285[_0x0bae('0x62')][_0x0bae('0x37')]);_0x172591[_0x0bae('0x27')][_0x0bae('0x76')]=_0x172591[_0x0bae('0x76')];_0x172591[_0x0bae('0x27')][_0x0bae('0x77')]=_0x172591[_0x0bae('0x76')];_0x172591[_0x0bae('0x27')][_0x0bae('0x78')]=_0x0bae('0x5b');return respondWithRpcPromise(_0x0bae('0x79'),_0x0bae('0x79'),{'event':_0x0bae('0x7a'),'message':_[_0x0bae('0x47')](_0x172591[_0x0bae('0x27')],JSON['parse'](_0x172591[_0x0bae('0x69')][_0x0bae('0x7b')]))},client9002)['then'](function(){return _0x172591;});}return _0x172591;}return null;})[_0x0bae('0x1e')](respondWithResult(_0x439d3a,null))[_0x0bae('0x50')](handleError(_0x439d3a,null));};var interaction_log=require(_0x0bae('0x12'))(_0x0bae('0x5a'));exports[_0x0bae('0x32')]=function(_0x3700b5,_0x18ce9c,_0x5f0489){var _0x2d168d={'agent':{},'channel':_0x0bae('0x5c')};if(_0x3700b5['body']['id']){delete _0x3700b5['body']['id'];}_0x3700b5[_0x0bae('0x58')]['UserId']=_0x3700b5['body']['UserId']||_0x3700b5[_0x0bae('0x62')]['id'];_0x2d168d[_0x0bae('0x63')]['id']=_0x3700b5[_0x0bae('0x58')][_0x0bae('0x61')];return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x3700b5[_0x0bae('0x52')]['id'],'UserId':null}})[_0x0bae('0x1e')](handleEntityNotFound(_0x18ce9c,null))[_0x0bae('0x1e')](function(_0x2ce5e2){if(_0x2ce5e2){_0x2d168d[_0x0bae('0x27')]=_0x2ce5e2['get']({'plain':!![]});return db[_0x0bae('0x65')][_0x0bae('0x56')]({'where':{'id':_0x2ce5e2['ChatInteractionId']}});}return null;})[_0x0bae('0x1e')](handleEntityNotFound(_0x18ce9c,null))['then'](function(_0x1d436e){if(_0x1d436e){_0x2d168d[_0x0bae('0x69')]=_0x1d436e[_0x0bae('0x64')]({'plain':!![]});interaction_log[_0x0bae('0x1f')](_0x0bae('0x7c'),_0x3700b5['user']['id'],_0x3700b5['user'][_0x0bae('0x37')],_0x3700b5[_0x0bae('0x62')][_0x0bae('0x6b')],_0x2d168d[_0x0bae('0x69')]['id'],_0x3700b5[_0x0bae('0x58')]?JSON[_0x0bae('0x24')](_0x3700b5[_0x0bae('0x58')]):_0x0bae('0x6c'));return respondWithRpcPromise('RejectMessage',_0x0bae('0x7d'),_0x2d168d);}return null;})[_0x0bae('0x1e')](function(_0x541cd3){var _0x17db3c=_0x0bae('0x6e')+_0x541cd3['message'][_0x0bae('0x6f')];return db[_0x0bae('0x70')]['query'](_0x17db3c,{'type':db['Sequelize'][_0x0bae('0x71')][_0x0bae('0x7e')],'raw':!![]})['then'](function(_0xbc6b6d){return _0xbc6b6d;});})[_0x0bae('0x1e')](function(_0x206328){if(_0x206328){_0x2d168d[_0x0bae('0x27')]['contact']=_0x206328[0x0];if(!_0x3700b5['body'][_0x0bae('0x61')])return;return db[_0x0bae('0x73')][_0x0bae('0x56')]({'where':{'id':_0x3700b5[_0x0bae('0x58')][_0x0bae('0x61')],'role':_0x0bae('0x63')},'attributes':['id',_0x0bae('0x37'),'fullname',_0x0bae('0x7f'),_0x0bae('0x75')],'raw':!![]});}return null;})['then'](function(_0x37acfe){if(!_0x37acfe)return null;_0x2d168d[_0x0bae('0x27')][_0x0bae('0x63')]=_0x37acfe;return _0x2d168d;})[_0x0bae('0x1e')](function(_0x4892c8){if(_0x4892c8){_0x4892c8[_0x0bae('0x27')][_0x0bae('0x80')]=util[_0x0bae('0x5f')]('SIP/%s',_0x3700b5[_0x0bae('0x62')]['name']);_0x4892c8[_0x0bae('0x27')][_0x0bae('0x76')]=_0x2d168d[_0x0bae('0x76')];_0x4892c8[_0x0bae('0x27')][_0x0bae('0x77')]=_0x2d168d[_0x0bae('0x76')];_0x4892c8[_0x0bae('0x27')][_0x0bae('0x78')]=_0x0bae('0x32');respondWithRpcPromise('EventManager',_0x0bae('0x79'),{'event':_0x0bae('0x81'),'message':_[_0x0bae('0x47')](_0x2d168d[_0x0bae('0x27')],JSON[_0x0bae('0x82')](_0x2d168d[_0x0bae('0x69')][_0x0bae('0x7b')]))},client9002);return _0x2d168d;}return null;})['then'](respondWithResult(_0x18ce9c,null))[_0x0bae('0x50')](handleError(_0x18ce9c,null));}; \ No newline at end of file +var _0x8a37=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','destroy','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','filters','filter','where','findAll','show','params','includeAll','include','merge','options','find','create','body','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','isNil','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','formData','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','internal','interface','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4ac2f6,_0x35b57b){var _0x56b68a=function(_0x274592){while(--_0x274592){_0x4ac2f6['push'](_0x4ac2f6['shift']());}};_0x56b68a(++_0x35b57b);}(_0x8a37,0xf2));var _0x78a3=function(_0x54b668,_0x391793){_0x54b668=_0x54b668-0x0;var _0xc10e55=_0x8a37[_0x54b668];return _0xc10e55;};'use strict';var emlformat=require(_0x78a3('0x0'));var rimraf=require(_0x78a3('0x1'));var zipdir=require(_0x78a3('0x2'));var jsonpatch=require(_0x78a3('0x3'));var rp=require(_0x78a3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x78a3('0x5'));var util=require(_0x78a3('0x6'));var path=require(_0x78a3('0x7'));var sox=require('sox');var csv=require(_0x78a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78a3('0x9'));var _=require(_0x78a3('0xa'));var squel=require(_0x78a3('0xb'));var crypto=require(_0x78a3('0xc'));var jsforce=require(_0x78a3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x78a3('0xe'));var Papa=require('papaparse');var Redis=require(_0x78a3('0xf'));var authService=require(_0x78a3('0x10'));var qs=require(_0x78a3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78a3('0x12'));var logger=require(_0x78a3('0x13'))(_0x78a3('0x14'));var utils=require(_0x78a3('0x15'));var config=require(_0x78a3('0x16'));var licenseUtil=require(_0x78a3('0x17'));var db=require('../../mysqldb')['db'];config[_0x78a3('0x18')]=_[_0x78a3('0x19')](config['redis'],{'host':_0x78a3('0x1a'),'port':0x18eb});var socket=require(_0x78a3('0x1b'))(new Redis(config[_0x78a3('0x18')]));require(_0x78a3('0x1c'))[_0x78a3('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x78a3('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x78a3('0x1e')][_0x78a3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xbfbb8c,_0x1d1303,_0x10a5a9,_0x4dd30e){return new BPromise(function(_0x5cfabb,_0x5a5a9f){var _0x2f3b4c=_0x4dd30e||client;return _0x2f3b4c[_0x78a3('0x20')](_0xbfbb8c,_0x10a5a9)[_0x78a3('0x21')](function(_0x2189e7){logger[_0x78a3('0x22')](_0x78a3('0x23'),_0x1d1303,_0x78a3('0x24'));logger[_0x78a3('0x25')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1d1303,_0x78a3('0x24'),JSON[_0x78a3('0x26')](_0x2189e7));if(_0x2189e7[_0x78a3('0x27')]){if(_0x2189e7['error'][_0x78a3('0x28')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1d1303,_0x2189e7[_0x78a3('0x27')][_0x78a3('0x29')]);return _0x5a5a9f(_0x2189e7[_0x78a3('0x27')][_0x78a3('0x29')]);}logger[_0x78a3('0x27')](_0x78a3('0x23'),_0x1d1303,_0x2189e7[_0x78a3('0x27')][_0x78a3('0x29')]);return _0x5cfabb(_0x2189e7[_0x78a3('0x27')]['message']);}else{logger[_0x78a3('0x22')](_0x78a3('0x23'),_0x1d1303,_0x78a3('0x24'));_0x5cfabb(_0x2189e7[_0x78a3('0x2a')][_0x78a3('0x29')]);}})[_0x78a3('0x2b')](function(_0x5485a3){logger[_0x78a3('0x27')](_0x78a3('0x23'),_0x1d1303,_0x5485a3);_0x5a5a9f(_0x5485a3);});});}function respondWithStatusCode(_0x1b52d,_0x20f533){_0x20f533=_0x20f533||0xcc;return function(_0x256542){if(_0x256542){return _0x1b52d['sendStatus'](_0x20f533);}return _0x1b52d[_0x78a3('0x2c')](_0x20f533)[_0x78a3('0x2d')]();};}function respondWithResult(_0x44c31a,_0x25104a){_0x25104a=_0x25104a||0xc8;return function(_0x4144b7){if(_0x4144b7){return _0x44c31a[_0x78a3('0x2c')](_0x25104a)['json'](_0x4144b7);}};}function respondWithFilteredResult(_0x164524,_0x4a360d){return function(_0x5ecd11){if(_0x5ecd11){var _0x51e899=typeof _0x4a360d[_0x78a3('0x2e')]==='undefined'&&typeof _0x4a360d[_0x78a3('0x2f')]===_0x78a3('0x30');var _0x30d4a5=_0x5ecd11[_0x78a3('0x31')];var _0x32501d=_0x51e899?0x0:_0x4a360d[_0x78a3('0x2e')];var _0x1fba58=_0x51e899?_0x5ecd11[_0x78a3('0x31')]:_0x4a360d[_0x78a3('0x2e')]+_0x4a360d['limit'];var _0xbea8a8;if(_0x1fba58>=_0x30d4a5){_0x1fba58=_0x30d4a5;_0xbea8a8=0xc8;}else{_0xbea8a8=0xce;}_0x164524['status'](_0xbea8a8);return _0x164524[_0x78a3('0x32')](_0x78a3('0x33'),_0x32501d+'-'+_0x1fba58+'/'+_0x30d4a5)[_0x78a3('0x34')](_0x5ecd11);}return null;};}function patchUpdates(_0x30bef5){return function(_0x52c376){try{jsonpatch['apply'](_0x52c376,_0x30bef5,!![]);}catch(_0x40afb7){return BPromise[_0x78a3('0x35')](_0x40afb7);}return _0x52c376['save']();};}function saveUpdates(_0xae77a1,_0x16df48){return function(_0x1352f7){if(_0x1352f7){return _0x1352f7[_0x78a3('0x36')](_0xae77a1)[_0x78a3('0x21')](function(_0x37d7ec){return _0x37d7ec;});}return null;};}function removeEntity(_0x1cc0fa,_0x42dc40){return function(_0x5ee1e8){if(_0x5ee1e8){return _0x5ee1e8[_0x78a3('0x37')]()[_0x78a3('0x21')](function(){_0x1cc0fa['status'](0xcc)[_0x78a3('0x2d')]();});}};}function handleEntityNotFound(_0x5e0003,_0x3a185f){return function(_0x22a66e){if(!_0x22a66e){_0x5e0003['sendStatus'](0x194);}return _0x22a66e;};}function handleError(_0x8e2e0b,_0x483fcf){_0x483fcf=_0x483fcf||0x1f4;return function(_0x4d7d25){logger['error'](_0x4d7d25['stack']);if(_0x4d7d25[_0x78a3('0x38')]){delete _0x4d7d25[_0x78a3('0x38')];}_0x8e2e0b[_0x78a3('0x2c')](_0x483fcf)[_0x78a3('0x39')](_0x4d7d25);};}exports[_0x78a3('0x3a')]=function(_0x2de6db,_0x1fa516){var _0x4662a4={},_0x9d7f27={},_0x34ce2b={'count':0x0,'rows':[]};var _0x235dec=_[_0x78a3('0x3b')](db[_0x78a3('0x3c')][_0x78a3('0x3d')],function(_0x2f7ea1){return{'name':_0x2f7ea1[_0x78a3('0x3e')],'type':_0x2f7ea1[_0x78a3('0x3f')][_0x78a3('0x40')]};});_0x9d7f27['model']=_[_0x78a3('0x3b')](_0x235dec,_0x78a3('0x38'));_0x9d7f27[_0x78a3('0x41')]=_[_0x78a3('0x42')](_0x2de6db[_0x78a3('0x41')]);_0x9d7f27['filters']=_[_0x78a3('0x43')](_0x9d7f27[_0x78a3('0x44')],_0x9d7f27['query']);_0x4662a4[_0x78a3('0x45')]=_[_0x78a3('0x43')](_0x9d7f27[_0x78a3('0x44')],qs[_0x78a3('0x46')](_0x2de6db[_0x78a3('0x41')][_0x78a3('0x46')]));_0x4662a4['attributes']=_0x4662a4[_0x78a3('0x45')][_0x78a3('0x47')]?_0x4662a4[_0x78a3('0x45')]:_0x9d7f27[_0x78a3('0x44')];if(!_0x2de6db[_0x78a3('0x41')]['hasOwnProperty'](_0x78a3('0x48'))){_0x4662a4[_0x78a3('0x2f')]=qs[_0x78a3('0x2f')](_0x2de6db[_0x78a3('0x41')]['limit']);_0x4662a4['offset']=qs[_0x78a3('0x2e')](_0x2de6db['query'][_0x78a3('0x2e')]);}_0x4662a4['order']=qs[_0x78a3('0x49')](_0x2de6db[_0x78a3('0x41')][_0x78a3('0x49')]);_0x4662a4['where']=qs[_0x78a3('0x4a')](_['pick'](_0x2de6db[_0x78a3('0x41')],_0x9d7f27[_0x78a3('0x4a')]),_0x235dec);if(_0x2de6db[_0x78a3('0x41')]['filter']){_0x4662a4['where']=_['merge'](_0x4662a4['where'],{'$or':_[_0x78a3('0x3b')](_0x235dec,function(_0x55dca0){if(_0x55dca0[_0x78a3('0x3f')]!=='VIRTUAL'){var _0x1b0a4c={};_0x1b0a4c[_0x55dca0['name']]={'$like':'%'+_0x2de6db[_0x78a3('0x41')][_0x78a3('0x4b')]+'%'};return _0x1b0a4c;}})});}_0x4662a4=_['merge']({},_0x4662a4,_0x2de6db['options']);var _0x55ddd2={'where':_0x4662a4[_0x78a3('0x4c')]};return db['ChatMessage'][_0x78a3('0x31')](_0x55ddd2)[_0x78a3('0x21')](function(_0x26008e){_0x34ce2b[_0x78a3('0x31')]=_0x26008e;if(_0x2de6db[_0x78a3('0x41')]['includeAll']){_0x4662a4['include']=[{'all':!![]}];}return db['ChatMessage'][_0x78a3('0x4d')](_0x4662a4);})[_0x78a3('0x21')](function(_0x3e9a47){_0x34ce2b['rows']=_0x3e9a47;return _0x34ce2b;})[_0x78a3('0x21')](respondWithFilteredResult(_0x1fa516,_0x4662a4))[_0x78a3('0x2b')](handleError(_0x1fa516,null));};exports[_0x78a3('0x4e')]=function(_0xe9701,_0xd25e2e){var _0x5164ba={'raw':!![],'where':{'id':_0xe9701[_0x78a3('0x4f')]['id']}},_0x57c654={};_0x57c654['model']=_[_0x78a3('0x42')](db[_0x78a3('0x3c')][_0x78a3('0x3d')]);_0x57c654[_0x78a3('0x41')]=_['keys'](_0xe9701[_0x78a3('0x41')]);_0x57c654['filters']=_[_0x78a3('0x43')](_0x57c654[_0x78a3('0x44')],_0x57c654[_0x78a3('0x41')]);_0x5164ba[_0x78a3('0x45')]=_['intersection'](_0x57c654['model'],qs['fields'](_0xe9701[_0x78a3('0x41')]['fields']));_0x5164ba[_0x78a3('0x45')]=_0x5164ba['attributes'][_0x78a3('0x47')]?_0x5164ba[_0x78a3('0x45')]:_0x57c654[_0x78a3('0x44')];if(_0xe9701[_0x78a3('0x41')][_0x78a3('0x50')]){_0x5164ba[_0x78a3('0x51')]=[{'all':!![]}];}_0x5164ba=_[_0x78a3('0x52')]({},_0x5164ba,_0xe9701[_0x78a3('0x53')]);return db[_0x78a3('0x3c')][_0x78a3('0x54')](_0x5164ba)[_0x78a3('0x21')](handleEntityNotFound(_0xd25e2e,null))[_0x78a3('0x21')](respondWithResult(_0xd25e2e,null))[_0x78a3('0x2b')](handleError(_0xd25e2e,null));};exports[_0x78a3('0x55')]=function(_0x1f882e,_0x5aa90e){return db[_0x78a3('0x3c')]['create'](_0x1f882e[_0x78a3('0x56')],{})[_0x78a3('0x21')](respondWithResult(_0x5aa90e,0xc9))[_0x78a3('0x2b')](handleError(_0x5aa90e,null));};exports[_0x78a3('0x36')]=function(_0x2b9d1d,_0x5d25a5){if(_0x2b9d1d['body']['id']){delete _0x2b9d1d[_0x78a3('0x56')]['id'];}return db[_0x78a3('0x3c')][_0x78a3('0x54')]({'where':{'id':_0x2b9d1d[_0x78a3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5d25a5,null))[_0x78a3('0x21')](saveUpdates(_0x2b9d1d[_0x78a3('0x56')],null))[_0x78a3('0x21')](respondWithResult(_0x5d25a5,null))[_0x78a3('0x2b')](handleError(_0x5d25a5,null));};exports[_0x78a3('0x37')]=function(_0xdc51a9,_0x4deb4a){return db[_0x78a3('0x3c')][_0x78a3('0x54')]({'where':{'id':_0xdc51a9[_0x78a3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4deb4a,null))[_0x78a3('0x21')](removeEntity(_0x4deb4a,null))[_0x78a3('0x2b')](handleError(_0x4deb4a,null));};exports[_0x78a3('0x57')]=function(_0x49b254,_0x93998e){return db[_0x78a3('0x3c')][_0x78a3('0x57')]()[_0x78a3('0x21')](respondWithResult(_0x93998e,null))[_0x78a3('0x2b')](handleError(_0x93998e,null));};var interaction_log=require(_0x78a3('0x13'))(_0x78a3('0x58'));exports['accept']=function(_0x44eac5,_0x5076b1,_0x172ecf){var _0x1082b1={'agent':{},'channel':_0x78a3('0x59')};if(_0x44eac5[_0x78a3('0x56')]['id']){delete _0x44eac5[_0x78a3('0x56')]['id'];}_0x44eac5[_0x78a3('0x56')][_0x78a3('0x5a')]=!![];_0x44eac5[_0x78a3('0x56')][_0x78a3('0x5b')]=moment()['format'](_0x78a3('0x5c'));_0x44eac5[_0x78a3('0x56')][_0x78a3('0x5d')]=_0x44eac5[_0x78a3('0x56')][_0x78a3('0x5d')]||_0x44eac5['user']['id'];_0x1082b1['agent']['id']=_0x44eac5['body']['UserId'];return db[_0x78a3('0x3c')][_0x78a3('0x54')]({'where':{'id':_0x44eac5['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5076b1,null))[_0x78a3('0x21')](saveUpdates(_0x44eac5[_0x78a3('0x56')],null))['then'](function(_0x3508d2){if(_0x3508d2){_0x1082b1[_0x78a3('0x29')]=_0x3508d2[_0x78a3('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x78a3('0x54')]({'where':{'id':_0x3508d2['ChatInteractionId']}});}return null;})[_0x78a3('0x21')](handleEntityNotFound(_0x5076b1,null))['then'](function(_0x5dd675){if(_0x5dd675){return _0x5dd675['update']({'UserId':_0x44eac5['body'][_0x78a3('0x5d')],'read1stAt':_[_0x78a3('0x5f')](_0x5dd675['read1stAt'])?moment()[_0x78a3('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x27e015){if(_0x27e015){_0x1082b1[_0x78a3('0x61')]=_0x27e015[_0x78a3('0x5e')]({'plain':!![]});interaction_log[_0x78a3('0x22')](_0x78a3('0x62'),_0x44eac5[_0x78a3('0x63')]['id'],_0x44eac5[_0x78a3('0x63')][_0x78a3('0x38')],_0x44eac5[_0x78a3('0x63')]['role'],_0x1082b1[_0x78a3('0x61')]['id'],_0x44eac5[_0x78a3('0x56')]?JSON['stringify'](_0x44eac5[_0x78a3('0x56')]):_0x78a3('0x64'));return respondWithRpcPromise('AcceptMessage',_0x78a3('0x65'),_0x1082b1);}return null;})[_0x78a3('0x21')](function(_0x3a7a22){var _0x3298a8=_0x78a3('0x66')+_0x3a7a22[_0x78a3('0x29')][_0x78a3('0x67')];return db[_0x78a3('0x68')][_0x78a3('0x41')](_0x3298a8,{'type':db[_0x78a3('0x69')][_0x78a3('0x6a')][_0x78a3('0x6b')],'raw':!![]})[_0x78a3('0x21')](function(_0x470a29){return _0x470a29;});})['then'](function(_0x12ac34){if(_0x12ac34){_0x1082b1[_0x78a3('0x29')][_0x78a3('0x6c')]=_0x12ac34[0x0];if(!_0x44eac5[_0x78a3('0x56')][_0x78a3('0x5d')])return;return db[_0x78a3('0x6d')]['find']({'where':{'id':_0x44eac5['body']['UserId'],'role':_0x78a3('0x6e')},'attributes':['id','name',_0x78a3('0x6f'),_0x78a3('0x70'),'internal'],'raw':!![]});}return null;})[_0x78a3('0x21')](function(_0x379a3a){if(!_0x379a3a)return null;_0x1082b1['message'][_0x78a3('0x6e')]=_0x379a3a;return _0x1082b1;})[_0x78a3('0x21')](function(_0x1cb75e){if(_0x1cb75e){if(_0x44eac5['body'][_0x78a3('0x71')]){_0x1082b1['message']['interface']=util['format'](_0x78a3('0x72'),_0x44eac5[_0x78a3('0x63')]['name']);_0x1082b1[_0x78a3('0x29')][_0x78a3('0x73')]=_0x1082b1[_0x78a3('0x73')];_0x1082b1[_0x78a3('0x29')]['motionChannel']=_0x1082b1[_0x78a3('0x73')];_0x1082b1[_0x78a3('0x29')][_0x78a3('0x74')]=_0x78a3('0x75');return respondWithRpcPromise(_0x78a3('0x76'),'EventManager',{'event':_0x78a3('0x77'),'message':_[_0x78a3('0x52')](_0x1082b1[_0x78a3('0x29')],JSON['parse'](_0x1082b1[_0x78a3('0x61')][_0x78a3('0x78')]))},client9002)['then'](function(){return _0x1082b1;});}return _0x1082b1;}return null;})[_0x78a3('0x21')](respondWithResult(_0x5076b1,null))[_0x78a3('0x2b')](handleError(_0x5076b1,null));};var interaction_log=require(_0x78a3('0x13'))(_0x78a3('0x58'));exports[_0x78a3('0x35')]=function(_0x1dd2de,_0x575619,_0x4baeba){var _0x2df39b={'agent':{},'channel':_0x78a3('0x59')};if(_0x1dd2de[_0x78a3('0x56')]['id']){delete _0x1dd2de[_0x78a3('0x56')]['id'];}_0x1dd2de[_0x78a3('0x56')][_0x78a3('0x5d')]=_0x1dd2de[_0x78a3('0x56')][_0x78a3('0x5d')]||_0x1dd2de['user']['id'];_0x2df39b[_0x78a3('0x6e')]['id']=_0x1dd2de['body'][_0x78a3('0x5d')];return db[_0x78a3('0x3c')][_0x78a3('0x54')]({'where':{'id':_0x1dd2de[_0x78a3('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x575619,null))[_0x78a3('0x21')](function(_0x11fe7b){if(_0x11fe7b){_0x2df39b[_0x78a3('0x29')]=_0x11fe7b['get']({'plain':!![]});return db[_0x78a3('0x79')]['find']({'where':{'id':_0x11fe7b[_0x78a3('0x7a')]}});}return null;})[_0x78a3('0x21')](handleEntityNotFound(_0x575619,null))[_0x78a3('0x21')](function(_0x279555){if(_0x279555){_0x2df39b[_0x78a3('0x61')]=_0x279555[_0x78a3('0x5e')]({'plain':!![]});interaction_log[_0x78a3('0x22')](_0x78a3('0x7b'),_0x1dd2de['user']['id'],_0x1dd2de[_0x78a3('0x63')]['name'],_0x1dd2de[_0x78a3('0x63')][_0x78a3('0x7c')],_0x2df39b[_0x78a3('0x61')]['id'],_0x1dd2de[_0x78a3('0x56')]?JSON[_0x78a3('0x26')](_0x1dd2de[_0x78a3('0x56')]):_0x78a3('0x64'));return respondWithRpcPromise(_0x78a3('0x7d'),'rejectMessage',_0x2df39b);}return null;})[_0x78a3('0x21')](function(_0x482b1e){var _0x243341='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x482b1e[_0x78a3('0x29')][_0x78a3('0x67')];return db[_0x78a3('0x68')]['query'](_0x243341,{'type':db[_0x78a3('0x69')][_0x78a3('0x6a')][_0x78a3('0x6b')],'raw':!![]})[_0x78a3('0x21')](function(_0x19e982){return _0x19e982;});})['then'](function(_0x592852){if(_0x592852){_0x2df39b['message']['contact']=_0x592852[0x0];if(!_0x1dd2de[_0x78a3('0x56')][_0x78a3('0x5d')])return;return db[_0x78a3('0x6d')][_0x78a3('0x54')]({'where':{'id':_0x1dd2de['body'][_0x78a3('0x5d')],'role':_0x78a3('0x6e')},'attributes':['id',_0x78a3('0x38'),_0x78a3('0x6f'),_0x78a3('0x70'),_0x78a3('0x7e')],'raw':!![]});}return null;})['then'](function(_0x4a1d44){if(!_0x4a1d44)return null;_0x2df39b[_0x78a3('0x29')]['agent']=_0x4a1d44;return _0x2df39b;})[_0x78a3('0x21')](function(_0x272e94){if(_0x272e94){_0x272e94[_0x78a3('0x29')][_0x78a3('0x7f')]=util[_0x78a3('0x60')](_0x78a3('0x72'),_0x1dd2de[_0x78a3('0x63')][_0x78a3('0x38')]);_0x272e94['message']['channel']=_0x2df39b[_0x78a3('0x73')];_0x272e94[_0x78a3('0x29')][_0x78a3('0x80')]=_0x2df39b[_0x78a3('0x73')];_0x272e94[_0x78a3('0x29')][_0x78a3('0x74')]='reject';respondWithRpcPromise('EventManager',_0x78a3('0x76'),{'event':_0x78a3('0x81'),'message':_[_0x78a3('0x52')](_0x2df39b['message'],JSON['parse'](_0x2df39b[_0x78a3('0x61')]['formData']))},client9002);return _0x2df39b;}return null;})['then'](respondWithResult(_0x575619,null))[_0x78a3('0x2b')](handleError(_0x575619,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 1010557..02a38fc 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 _0xfbc5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','ChatMessage'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xfbc5,0xdf));var _0x5fbc=function(_0x4df3bb,_0x5aef0b){_0x4df3bb=_0x4df3bb-0x0;var _0x58c001=_0xfbc5[_0x4df3bb];return _0x58c001;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x5fbc('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5fbc('0x1')](0x0);var events={'afterCreate':_0x5fbc('0x2'),'afterUpdate':_0x5fbc('0x3'),'afterDestroy':_0x5fbc('0x4')};function emitEvent(_0x36dee7){return function(_0x53f1dc,_0x29b65d,_0x5229b4){ChatMessageEvents[_0x5fbc('0x5')](_0x36dee7+':'+_0x53f1dc['id'],_0x53f1dc);ChatMessageEvents[_0x5fbc('0x5')](_0x36dee7,_0x53f1dc);_0x5229b4(null);};}for(var e in events){if(events[_0x5fbc('0x6')](e)){var event=events[e];ChatMessage[_0x5fbc('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x72d4=['hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0x72d4,0x77));var _0x472d=function(_0xee3485,_0x118866){_0xee3485=_0xee3485-0x0;var _0x512b8d=_0x72d4[_0xee3485];return _0x512b8d;};'use strict';var EventEmitter=require(_0x472d('0x0'));var ChatMessage=require(_0x472d('0x1'))['db'][_0x472d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x472d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x472d('0x4'),'afterDestroy':_0x472d('0x5')};function emitEvent(_0x31930b){return function(_0x4db92f,_0x4032c7,_0x2110bf){ChatMessageEvents[_0x472d('0x6')](_0x31930b+':'+_0x4db92f['id'],_0x4db92f);ChatMessageEvents['emit'](_0x31930b,_0x4db92f);_0x2110bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x472d('0x7')](e,emitEvent(event));}}module[_0x472d('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index e64a346..dc9298e 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 _0x1bdf=['UserId','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x1bdf,0x15e));var _0xf1bd=function(_0x8e73ee,_0x3d0eb3){_0x8e73ee=_0x8e73ee-0x0;var _0x1e812a=_0x1bdf[_0x8e73ee];return _0x1e812a;};'use strict';var _=require(_0xf1bd('0x0'));var util=require('util');var logger=require(_0xf1bd('0x1'))(_0xf1bd('0x2'));var moment=require(_0xf1bd('0x3'));var BPromise=require(_0xf1bd('0x4'));var rp=require(_0xf1bd('0x5'));var fs=require('fs');var path=require(_0xf1bd('0x6'));var rimraf=require(_0xf1bd('0x7'));var config=require(_0xf1bd('0x8'));var attributes=require('./chatMessage.attributes');module[_0xf1bd('0x9')]=function(_0x3b300c,_0xb39866){return _0x3b300c['define'](_0xf1bd('0xa'),attributes,{'tableName':_0xf1bd('0xb'),'paranoid':![],'indexes':[{'name':_0xf1bd('0xc'),'fields':[_0xf1bd('0xd')],'type':_0xf1bd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x312083,_0x3e8cd4,_0x2bcba9){var _0x439d07=_0x3b300c[_0xf1bd('0xf')];var _0xad44d5=_0x312083[_0xf1bd('0x10')]({'plain':!![]});if(_0xad44d5[_0xf1bd('0x11')][_0xf1bd('0x12')]()==='in'||_0xad44d5[_0xf1bd('0x11')]['toLowerCase']()===_0xf1bd('0x13')&&!_0xad44d5[_0xf1bd('0x14')]&&!_[_0xf1bd('0x15')](_0xad44d5[_0xf1bd('0x16')])){_0x439d07['ChatInteraction'][_0xf1bd('0x17')]({'where':{'id':_0xad44d5[_0xf1bd('0x18')]}})[_0xf1bd('0x19')](function(_0x206788){if(_0x206788){_0x206788[_0xf1bd('0x1a')]({'lastMsgAt':_0xad44d5[_0xf1bd('0x1b')],'lastMsgDirection':_0xad44d5[_0xf1bd('0x11')]['toLowerCase']()});}})['catch'](function(_0x32b16e){console[_0xf1bd('0x1c')](_0x32b16e);});}_0x2bcba9();}},'charset':_0xf1bd('0x1d'),'collate':_0xf1bd('0x1e')});}; \ No newline at end of file +var _0xc796=['fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages'];(function(_0x213082,_0x433a95){var _0x5583d8=function(_0x3c4f90){while(--_0x3c4f90){_0x213082['push'](_0x213082['shift']());}};_0x5583d8(++_0x433a95);}(_0xc796,0x15b));var _0x6c79=function(_0x3f2fea,_0x3c4ea8){_0x3f2fea=_0x3f2fea-0x0;var _0x69a4d5=_0xc796[_0x3f2fea];return _0x69a4d5;};'use strict';var _=require(_0x6c79('0x0'));var util=require(_0x6c79('0x1'));var logger=require('../../config/logger')(_0x6c79('0x2'));var moment=require(_0x6c79('0x3'));var BPromise=require(_0x6c79('0x4'));var rp=require(_0x6c79('0x5'));var fs=require('fs');var path=require(_0x6c79('0x6'));var rimraf=require(_0x6c79('0x7'));var config=require(_0x6c79('0x8'));var attributes=require(_0x6c79('0x9'));module['exports']=function(_0x483707,_0x3525c9){return _0x483707[_0x6c79('0xa')](_0x6c79('0xb'),attributes,{'tableName':_0x6c79('0xc'),'paranoid':![],'indexes':[{'name':_0x6c79('0xd'),'fields':[_0x6c79('0xe')],'type':_0x6c79('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x272382,_0x2caa3b,_0x2438c8){var _0xfacbde=_0x483707[_0x6c79('0x10')];var _0x2fc5ca=_0x272382[_0x6c79('0x11')]({'plain':!![]});if(_0x2fc5ca['direction'][_0x6c79('0x12')]()==='in'||_0x2fc5ca[_0x6c79('0x13')][_0x6c79('0x12')]()===_0x6c79('0x14')&&!_0x2fc5ca['secret']&&!_[_0x6c79('0x15')](_0x2fc5ca[_0x6c79('0x16')])){_0xfacbde['ChatInteraction'][_0x6c79('0x17')]({'where':{'id':_0x2fc5ca['ChatInteractionId']}})[_0x6c79('0x18')](function(_0x5c9c86){if(_0x5c9c86){_0x5c9c86[_0x6c79('0x19')]({'lastMsgAt':_0x2fc5ca[_0x6c79('0x1a')],'lastMsgDirection':_0x2fc5ca['direction']['toLowerCase']()});}})[_0x6c79('0x1b')](function(_0x16c7ae){console[_0x6c79('0x1c')](_0x16c7ae);});}_0x2438c8();}},'charset':'utf8mb4','collate':_0x6c79('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 70c068d..e08a8ed 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 _0x04e7=['code','message','result','ChatMessage','options','raw','CreateChatMessage','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x04e7,0x121));var _0x704e=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x04e7[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x704e('0x0'));var util=require(_0x704e('0x1'));var moment=require(_0x704e('0x2'));var BPromise=require(_0x704e('0x3'));var rs=require(_0x704e('0x4'));var fs=require('fs');var Redis=require(_0x704e('0x5'));var db=require(_0x704e('0x6'))['db'];var utils=require(_0x704e('0x7'));var logger=require(_0x704e('0x8'))(_0x704e('0x9'));var config=require(_0x704e('0xa'));var jayson=require(_0x704e('0xb'));var client=jayson['client'][_0x704e('0xc')]({'port':0x232a});config[_0x704e('0xd')]=_[_0x704e('0xe')](config[_0x704e('0xd')],{'host':_0x704e('0xf'),'port':0x18eb});var socket=require(_0x704e('0x10'))(new Redis(config[_0x704e('0xd')]));require(_0x704e('0x11'))[_0x704e('0x12')](socket);function respondWithRpcPromise(_0xc0d178,_0x1a2f74,_0x458537){return new BPromise(function(_0x48dc9b,_0x3c80dd){return client[_0x704e('0x13')](_0xc0d178,_0x458537)[_0x704e('0x14')](function(_0x42c150){logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1a2f74,_0x704e('0x17'),JSON[_0x704e('0x18')](_0x42c150));if(_0x42c150[_0x704e('0x19')]){if(_0x42c150[_0x704e('0x19')][_0x704e('0x1a')]===0x1f4){logger[_0x704e('0x19')](_0x704e('0x16'),_0x1a2f74,_0x42c150[_0x704e('0x19')]['message']);return _0x3c80dd(_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);}logger[_0x704e('0x19')]('ChatMessage,\x20%s,\x20%s',_0x1a2f74,_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);return _0x48dc9b(_0x42c150[_0x704e('0x19')]['message']);}else{logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));_0x48dc9b(_0x42c150[_0x704e('0x1c')][_0x704e('0x1b')]);}})['catch'](function(_0x333524){logger['error'](_0x704e('0x16'),_0x1a2f74,_0x333524);_0x3c80dd(_0x333524);});});}exports['CreateChatMessage']=function(_0x5e0542){var _0x5bd786=this;return new Promise(function(_0x295d5a,_0x361cb7){return db[_0x704e('0x1d')]['create'](_0x5e0542['body'],{'raw':_0x5e0542[_0x704e('0x1e')]?_0x5e0542[_0x704e('0x1e')][_0x704e('0x1f')]===undefined?!![]:![]:!![]})[_0x704e('0x14')](function(_0x418322){logger[_0x704e('0x15')](_0x704e('0x20'),_0x5e0542);logger[_0x704e('0x21')](_0x704e('0x20'),_0x5e0542,JSON[_0x704e('0x18')](_0x418322));_0x295d5a(_0x418322);})[_0x704e('0x22')](function(_0x5554d0){logger['error'](_0x704e('0x20'),_0x5554d0[_0x704e('0x1b')],_0x5e0542);_0x361cb7(_0x5bd786[_0x704e('0x19')](0x1f4,_0x5554d0[_0x704e('0x1b')]));});});}; \ No newline at end of file +var _0xdc00=['./chatMessage.socket','register','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xdc00,0x1e1));var _0x0dc0=function(_0x4decaf,_0x28acba){_0x4decaf=_0x4decaf-0x0;var _0x1fba88=_0xdc00[_0x4decaf];return _0x1fba88;};'use strict';var _=require('lodash');var util=require(_0x0dc0('0x0'));var moment=require(_0x0dc0('0x1'));var BPromise=require(_0x0dc0('0x2'));var rs=require(_0x0dc0('0x3'));var fs=require('fs');var Redis=require(_0x0dc0('0x4'));var db=require(_0x0dc0('0x5'))['db'];var utils=require(_0x0dc0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0dc0('0x7'));var jayson=require(_0x0dc0('0x8'));var client=jayson[_0x0dc0('0x9')][_0x0dc0('0xa')]({'port':0x232a});config[_0x0dc0('0xb')]=_['defaults'](config[_0x0dc0('0xb')],{'host':_0x0dc0('0xc'),'port':0x18eb});var socket=require(_0x0dc0('0xd'))(new Redis(config[_0x0dc0('0xb')]));require(_0x0dc0('0xe'))[_0x0dc0('0xf')](socket);function respondWithRpcPromise(_0x4eb113,_0x3c5038,_0x5f1c8d){return new BPromise(function(_0x16338b,_0xe7292a){return client['request'](_0x4eb113,_0x5f1c8d)['then'](function(_0x2e1df8){logger['info'](_0x0dc0('0x10'),_0x3c5038,_0x0dc0('0x11'));logger['debug'](_0x0dc0('0x12'),_0x3c5038,'request\x20sent',JSON[_0x0dc0('0x13')](_0x2e1df8));if(_0x2e1df8[_0x0dc0('0x14')]){if(_0x2e1df8[_0x0dc0('0x14')][_0x0dc0('0x15')]===0x1f4){logger[_0x0dc0('0x14')](_0x0dc0('0x10'),_0x3c5038,_0x2e1df8[_0x0dc0('0x14')][_0x0dc0('0x16')]);return _0xe7292a(_0x2e1df8[_0x0dc0('0x14')]['message']);}logger[_0x0dc0('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3c5038,_0x2e1df8[_0x0dc0('0x14')][_0x0dc0('0x16')]);return _0x16338b(_0x2e1df8['error'][_0x0dc0('0x16')]);}else{logger[_0x0dc0('0x17')](_0x0dc0('0x10'),_0x3c5038,_0x0dc0('0x11'));_0x16338b(_0x2e1df8[_0x0dc0('0x18')][_0x0dc0('0x16')]);}})[_0x0dc0('0x19')](function(_0x4cf9b6){logger['error'](_0x0dc0('0x10'),_0x3c5038,_0x4cf9b6);_0xe7292a(_0x4cf9b6);});});}exports[_0x0dc0('0x1a')]=function(_0xceb71f){var _0x1354f1=this;return new Promise(function(_0x2e1f87,_0x23adc5){return db[_0x0dc0('0x1b')]['create'](_0xceb71f[_0x0dc0('0x1c')],{'raw':_0xceb71f[_0x0dc0('0x1d')]?_0xceb71f['options'][_0x0dc0('0x1e')]===undefined?!![]:![]:!![]})[_0x0dc0('0x1f')](function(_0x21eddb){logger[_0x0dc0('0x17')](_0x0dc0('0x1a'),_0xceb71f);logger[_0x0dc0('0x20')]('CreateChatMessage',_0xceb71f,JSON[_0x0dc0('0x13')](_0x21eddb));_0x2e1f87(_0x21eddb);})[_0x0dc0('0x19')](function(_0x373cd2){logger[_0x0dc0('0x14')]('CreateChatMessage',_0x373cd2['message'],_0xceb71f);_0x23adc5(_0x1354f1[_0x0dc0('0x14')](0x1f4,_0x373cd2[_0x0dc0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index bf392d5..504b1ff 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 _0x3e9d=['chatMessage:','./chatMessage.events','save','update','removeListener','register','length'];(function(_0xf711da,_0x5dfce7){var _0x219748=function(_0x39d857){while(--_0x39d857){_0xf711da['push'](_0xf711da['shift']());}};_0x219748(++_0x5dfce7);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x1e6e99,_0x2ef9ac){_0x1e6e99=_0x1e6e99-0x0;var _0x41d4f3=_0x3e9d[_0x1e6e99];return _0x41d4f3;};'use strict';var ChatMessageEvents=require(_0xd3e9('0x0'));var events=[_0xd3e9('0x1'),'remove',_0xd3e9('0x2')];function createListener(_0x4bc1c3,_0x328e91){return function(_0x2ebba5){_0x328e91['emit'](_0x4bc1c3,_0x2ebba5);};}function removeListener(_0x4887ba,_0xa499a3){return function(){ChatMessageEvents[_0xd3e9('0x3')](_0x4887ba,_0xa499a3);};}exports[_0xd3e9('0x4')]=function(_0x3dea0a){for(var _0x568eea=0x0,_0x4dc1de=events[_0xd3e9('0x5')];_0x568eea<_0x4dc1de;_0x568eea++){var _0x140f2d=events[_0x568eea];var _0x45364e=createListener(_0xd3e9('0x6')+_0x140f2d,_0x3dea0a);ChatMessageEvents['on'](_0x140f2d,_0x45364e);}}; \ No newline at end of file +var _0xe7de=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x42cd2d,_0x119ad4){var _0x4e3de6=function(_0x4d5704){while(--_0x4d5704){_0x42cd2d['push'](_0x42cd2d['shift']());}};_0x4e3de6(++_0x119ad4);}(_0xe7de,0x165));var _0xee7d=function(_0x2c7f47,_0x302505){_0x2c7f47=_0x2c7f47-0x0;var _0x36ebb1=_0xe7de[_0x2c7f47];return _0x36ebb1;};'use strict';var ChatMessageEvents=require(_0xee7d('0x0'));var events=[_0xee7d('0x1'),_0xee7d('0x2'),'update'];function createListener(_0x53a8c9,_0x439281){return function(_0x2cd219){_0x439281[_0xee7d('0x3')](_0x53a8c9,_0x2cd219);};}function removeListener(_0x3f1c6d,_0x3afa35){return function(){ChatMessageEvents[_0xee7d('0x4')](_0x3f1c6d,_0x3afa35);};}exports[_0xee7d('0x5')]=function(_0x215ba4){for(var _0x401cd0=0x0,_0x28d5b6=events[_0xee7d('0x6')];_0x401cd0<_0x28d5b6;_0x401cd0++){var _0x2e172d=events[_0x401cd0];var _0x1c0584=createListener(_0xee7d('0x7')+_0x2e172d,_0x215ba4);ChatMessageEvents['on'](_0x2e172d,_0x1c0584);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index cb556b7..ab2e8af 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 _0xe5a5=['post','chat','chatmessage:create','create','update','accept','put','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xe5a5,0x15b));var _0x5e5a=function(_0x480e53,_0x5c8da4){_0x480e53=_0x480e53-0x0;var _0x12c12f=_0xe5a5[_0x480e53];return _0x12c12f;};'use strict';var multer=require(_0x5e5a('0x0'));var util=require(_0x5e5a('0x1'));var path=require(_0x5e5a('0x2'));var timeout=require(_0x5e5a('0x3'));var express=require('express');var router=express[_0x5e5a('0x4')]();var fs_extra=require(_0x5e5a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5e5a('0x6'));var config=require(_0x5e5a('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5e5a('0x8')]);router[_0x5e5a('0x9')]('/describe',auth[_0x5e5a('0xa')](),controller[_0x5e5a('0xb')]);router[_0x5e5a('0x9')](_0x5e5a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5e5a('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5e5a('0xe'),_0x5e5a('0xf')),controller[_0x5e5a('0x10')]);router['put'](_0x5e5a('0xc'),controller[_0x5e5a('0x11')]);router['put']('/:id/accept',auth[_0x5e5a('0xa')](),controller[_0x5e5a('0x12')]);router[_0x5e5a('0x13')](_0x5e5a('0x14'),auth[_0x5e5a('0xa')](),controller[_0x5e5a('0x15')]);router[_0x5e5a('0x16')](_0x5e5a('0xc'),auth['isAuthenticated'](),controller[_0x5e5a('0x17')]);module['exports']=router; \ No newline at end of file +var _0x5398=['create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','tracked','chat'];(function(_0x456847,_0x369779){var _0x3c0050=function(_0x45f165){while(--_0x45f165){_0x456847['push'](_0x456847['shift']());}};_0x3c0050(++_0x369779);}(_0x5398,0x168));var _0x8539=function(_0x407e61,_0x4624ce){_0x407e61=_0x407e61-0x0;var _0x32a8f9=_0x5398[_0x407e61];return _0x32a8f9;};'use strict';var multer=require(_0x8539('0x0'));var util=require(_0x8539('0x1'));var path=require(_0x8539('0x2'));var timeout=require(_0x8539('0x3'));var express=require(_0x8539('0x4'));var router=express[_0x8539('0x5')]();var fs_extra=require(_0x8539('0x6'));var auth=require(_0x8539('0x7'));var interaction=require(_0x8539('0x8'));var config=require(_0x8539('0x9'));var controller=require('./chatMessage.controller');router[_0x8539('0xa')]('/',auth[_0x8539('0xb')](),controller[_0x8539('0xc')]);router[_0x8539('0xa')](_0x8539('0xd'),auth[_0x8539('0xb')](),controller['describe']);router[_0x8539('0xa')](_0x8539('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x8539('0xf')]('/',auth['isAuthenticated'](),interaction[_0x8539('0x10')](_0x8539('0x11'),'chatmessage:create'),controller[_0x8539('0x12')]);router[_0x8539('0x13')](_0x8539('0xe'),controller['update']);router[_0x8539('0x13')](_0x8539('0x14'),auth[_0x8539('0xb')](),controller[_0x8539('0x15')]);router[_0x8539('0x13')](_0x8539('0x16'),auth['isAuthenticated'](),controller[_0x8539('0x17')]);router[_0x8539('0x18')](_0x8539('0xe'),auth[_0x8539('0xb')](),controller[_0x8539('0x19')]);module[_0x8539('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 20f4c50..55aadf8 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x36fec3,_0x455039){var _0x5bba9c=function(_0x3b8353){while(--_0x3b8353){_0x36fec3['push'](_0x36fec3['shift']());}};_0x5bba9c(++_0x455039);}(_0xdb28,0x106));var _0x8db2=function(_0x28dac0,_0x40b8ad){_0x28dac0=_0x28dac0-0x0;var _0x26efbc=_0xdb28[_0x28dac0];return _0x26efbc;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['medium','TEXT','exports'];(function(_0xe38e85,_0x545bb7){var _0x213b70=function(_0xd05ac6){while(--_0xd05ac6){_0xe38e85['push'](_0xe38e85['shift']());}};_0x213b70(++_0x545bb7);}(_0xadb5,0xad));var _0x5adb=function(_0x51aaf0,_0x4b5010){_0x51aaf0=_0x51aaf0-0x0;var _0x484406=_0xadb5[_0x51aaf0];return _0x484406;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 9f559d4..fce4ada 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(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7a54,0x106));var _0x47a5=function(_0x10beef,_0x4c26e1){_0x10beef=_0x10beef-0x0;var _0x244288=_0x7a54[_0x10beef];return _0x244288;};'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(_0x239637,_0x4d4446){var _0x1d9bcf=function(_0x588535){while(--_0x588535){_0x239637['push'](_0x239637['shift']());}};_0x1d9bcf(++_0x4d4446);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 391d845..358494f 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 _0xd5fc=['emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1d978e,_0x30032a){var _0x2fe0c9=function(_0x1b661c){while(--_0x1b661c){_0x1d978e['push'](_0x1d978e['shift']());}};_0x2fe0c9(++_0x30032a);}(_0xd5fc,0x11a));var _0xcd5f=function(_0x332e1,_0x225f10){_0x332e1=_0x332e1-0x0;var _0x41380b=_0xd5fc[_0x332e1];return _0x41380b;};'use strict';var EventEmitter=require(_0xcd5f('0x0'));var ChatOfflineMessage=require(_0xcd5f('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcd5f('0x2')](0x0);var events={'afterCreate':_0xcd5f('0x3'),'afterUpdate':_0xcd5f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbd0dc4){return function(_0x2897ed,_0x4ab81b,_0xf83ba0){ChatOfflineMessageEvents[_0xcd5f('0x5')](_0xbd0dc4+':'+_0x2897ed['id'],_0x2897ed);ChatOfflineMessageEvents[_0xcd5f('0x5')](_0xbd0dc4,_0x2897ed);_0xf83ba0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xcd5f('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x3095=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x4cda21,_0x4c8116){var _0x5b51c2=function(_0x201483){while(--_0x201483){_0x4cda21['push'](_0x4cda21['shift']());}};_0x5b51c2(++_0x4c8116);}(_0x3095,0x13a));var _0x5309=function(_0x360dfc,_0x23ee2e){_0x360dfc=_0x360dfc-0x0;var _0x24ad26=_0x3095[_0x360dfc];return _0x24ad26;};'use strict';var EventEmitter=require(_0x5309('0x0'));var ChatOfflineMessage=require(_0x5309('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5309('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5309('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3df9bc){return function(_0x506ead,_0x9bf1e0,_0x284094){ChatOfflineMessageEvents[_0x5309('0x4')](_0x3df9bc+':'+_0x506ead['id'],_0x506ead);ChatOfflineMessageEvents[_0x5309('0x4')](_0x3df9bc,_0x506ead);_0x284094(null);};}for(var e in events){if(events[_0x5309('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x5309('0x6')](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 934bf66..852d701 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 _0x3af1=['define','ChatOfflineMessage','./chatOfflineMessage.attributes','exports'];(function(_0x2e4e85,_0x37262f){var _0x52f763=function(_0x26c195){while(--_0x26c195){_0x2e4e85['push'](_0x2e4e85['shift']());}};_0x52f763(++_0x37262f);}(_0x3af1,0xfe));var _0x13af=function(_0x36f340,_0x218b82){_0x36f340=_0x36f340-0x0;var _0x48ac0e=_0x3af1[_0x36f340];return _0x48ac0e;};'use strict';var attributes=require(_0x13af('0x0'));module[_0x13af('0x1')]=function(_0x2fa3e2){return _0x2fa3e2[_0x13af('0x2')](_0x13af('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc037=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','chat_offline_messages'];(function(_0x62d96d,_0x1bafec){var _0x2a48c2=function(_0x5d63ab){while(--_0x5d63ab){_0x62d96d['push'](_0x62d96d['shift']());}};_0x2a48c2(++_0x1bafec);}(_0xc037,0x9d));var _0x7c03=function(_0x45459b,_0x1619bf){_0x45459b=_0x45459b-0x0;var _0x44f75c=_0xc037[_0x45459b];return _0x44f75c;};'use strict';var attributes=require(_0x7c03('0x0'));module['exports']=function(_0xb6ec76){return _0xb6ec76[_0x7c03('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x7c03('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7c03('0x3'),'collate':_0x7c03('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 918c37e..d542ee0 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 _0x4974=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x4974,0x127));var _0x4497=function(_0x42f58d,_0x44a5a3){_0x42f58d=_0x42f58d-0x0;var _0x3207f5=_0x4974[_0x42f58d];return _0x3207f5;};'use strict';var _=require(_0x4497('0x0'));var util=require('util');var moment=require(_0x4497('0x1'));var BPromise=require(_0x4497('0x2'));var rs=require(_0x4497('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4497('0x4'))['db'];var utils=require(_0x4497('0x5'));var logger=require('../../config/logger')(_0x4497('0x6'));var config=require(_0x4497('0x7'));var jayson=require(_0x4497('0x8'));var client=jayson['client'][_0x4497('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445e3c,_0x571aa8,_0x9acff7){return new BPromise(function(_0x484983,_0x4ebfdf){return client[_0x4497('0xa')](_0x445e3c,_0x9acff7)[_0x4497('0xb')](function(_0x487f6a){logger[_0x4497('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x571aa8,_0x4497('0xd'));logger[_0x4497('0xe')](_0x4497('0xf'),_0x571aa8,'request\x20sent',JSON[_0x4497('0x10')](_0x487f6a));if(_0x487f6a[_0x4497('0x11')]){if(_0x487f6a[_0x4497('0x11')][_0x4497('0x12')]===0x1f4){logger[_0x4497('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x571aa8,_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);return _0x4ebfdf(_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);}logger[_0x4497('0x11')](_0x4497('0x14'),_0x571aa8,_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);return _0x484983(_0x487f6a['error'][_0x4497('0x13')]);}else{logger[_0x4497('0xc')](_0x4497('0x14'),_0x571aa8,_0x4497('0xd'));_0x484983(_0x487f6a['result'][_0x4497('0x13')]);}})[_0x4497('0x15')](function(_0x3db095){logger[_0x4497('0x11')](_0x4497('0x14'),_0x571aa8,_0x3db095);_0x4ebfdf(_0x3db095);});});} \ No newline at end of file +var _0xec9d=['../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5fe7ce,_0x1a0d39){var _0x3b5793=function(_0x221d2a){while(--_0x221d2a){_0x5fe7ce['push'](_0x5fe7ce['shift']());}};_0x3b5793(++_0x1a0d39);}(_0xec9d,0x6f));var _0xdec9=function(_0x53e2bc,_0x524b5c){_0x53e2bc=_0x53e2bc-0x0;var _0x32a1be=_0xec9d[_0x53e2bc];return _0x32a1be;};'use strict';var _=require(_0xdec9('0x0'));var util=require(_0xdec9('0x1'));var moment=require(_0xdec9('0x2'));var BPromise=require('bluebird');var rs=require(_0xdec9('0x3'));var fs=require('fs');var Redis=require(_0xdec9('0x4'));var db=require(_0xdec9('0x5'))['db'];var utils=require(_0xdec9('0x6'));var logger=require(_0xdec9('0x7'))(_0xdec9('0x8'));var config=require(_0xdec9('0x9'));var jayson=require(_0xdec9('0xa'));var client=jayson[_0xdec9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x75d187,_0x37be1a,_0x10cfc9){return new BPromise(function(_0x46a859,_0x459a8d){return client[_0xdec9('0xc')](_0x75d187,_0x10cfc9)[_0xdec9('0xd')](function(_0x52b150){logger[_0xdec9('0xe')](_0xdec9('0xf'),_0x37be1a,'request\x20sent');logger[_0xdec9('0x10')](_0xdec9('0x11'),_0x37be1a,_0xdec9('0x12'),JSON[_0xdec9('0x13')](_0x52b150));if(_0x52b150[_0xdec9('0x14')]){if(_0x52b150['error']['code']===0x1f4){logger[_0xdec9('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x37be1a,_0x52b150[_0xdec9('0x14')][_0xdec9('0x15')]);return _0x459a8d(_0x52b150[_0xdec9('0x14')]['message']);}logger['error'](_0xdec9('0xf'),_0x37be1a,_0x52b150['error'][_0xdec9('0x15')]);return _0x46a859(_0x52b150[_0xdec9('0x14')][_0xdec9('0x15')]);}else{logger[_0xdec9('0xe')](_0xdec9('0xf'),_0x37be1a,'request\x20sent');_0x46a859(_0x52b150[_0xdec9('0x16')]['message']);}})[_0xdec9('0x17')](function(_0x61bc89){logger[_0xdec9('0x14')](_0xdec9('0xf'),_0x37be1a,_0x61bc89);_0x459a8d(_0x61bc89);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 87a99ed..903c45e 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 _0x1f5f=['post','create','put','/:id','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe'];(function(_0x30f06f,_0x160eaf){var _0x7e3a80=function(_0x47fa04){while(--_0x47fa04){_0x30f06f['push'](_0x30f06f['shift']());}};_0x7e3a80(++_0x160eaf);}(_0x1f5f,0x116));var _0xf1f5=function(_0x2eeb79,_0x5c81e3){_0x2eeb79=_0x2eeb79-0x0;var _0x91495d=_0x1f5f[_0x2eeb79];return _0x91495d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf1f5('0x0'));var timeout=require('connect-timeout');var express=require(_0xf1f5('0x1'));var router=express[_0xf1f5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf1f5('0x3'));var interaction=require(_0xf1f5('0x4'));var config=require('../../config/environment');var controller=require(_0xf1f5('0x5'));router[_0xf1f5('0x6')]('/',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0x8')]);router['get']('/describe',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0x9')]);router[_0xf1f5('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf1f5('0xa')]('/',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0xb')]);router[_0xf1f5('0xc')](_0xf1f5('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf1f5('0xd'),auth[_0xf1f5('0x7')](),controller[_0xf1f5('0xe')]);module[_0xf1f5('0xf')]=router; \ No newline at end of file +var _0xf59d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','util','path'];(function(_0x533d54,_0x29c8ab){var _0x4e03f5=function(_0x1e9f54){while(--_0x1e9f54){_0x533d54['push'](_0x533d54['shift']());}};_0x4e03f5(++_0x29c8ab);}(_0xf59d,0xfa));var _0xdf59=function(_0x2f32ea,_0x1d9e66){_0x2f32ea=_0x2f32ea-0x0;var _0x55a07f=_0xf59d[_0x2f32ea];return _0x55a07f;};'use strict';var multer=require('multer');var util=require(_0xdf59('0x0'));var path=require(_0xdf59('0x1'));var timeout=require(_0xdf59('0x2'));var express=require(_0xdf59('0x3'));var router=express[_0xdf59('0x4')]();var fs_extra=require(_0xdf59('0x5'));var auth=require(_0xdf59('0x6'));var interaction=require(_0xdf59('0x7'));var config=require('../../config/environment');var controller=require(_0xdf59('0x8'));router[_0xdf59('0x9')]('/',auth[_0xdf59('0xa')](),controller['index']);router[_0xdf59('0x9')](_0xdf59('0xb'),auth['isAuthenticated'](),controller[_0xdf59('0xc')]);router['get']('/:id',auth[_0xdf59('0xa')](),controller[_0xdf59('0xd')]);router[_0xdf59('0xe')]('/',auth[_0xdf59('0xa')](),controller[_0xdf59('0xf')]);router[_0xdf59('0x10')](_0xdf59('0x11'),auth[_0xdf59('0xa')](),controller['update']);router[_0xdf59('0x12')](_0xdf59('0x11'),auth[_0xdf59('0xa')](),controller[_0xdf59('0x13')]);module[_0xdf59('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 35615b4..6544662 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 _0x974d=['ENUM','INTEGER','sequelize','exports','STRING'];(function(_0x58cb96,_0x3d7cec){var _0x58b556=function(_0x2455d2){while(--_0x2455d2){_0x58cb96['push'](_0x58cb96['shift']());}};_0x58b556(++_0x3d7cec);}(_0x974d,0x115));var _0xd974=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x974d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xd974('0x0'));module[_0xd974('0x1')]={'name':{'type':Sequelize[_0xd974('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd974('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd974('0x4')]}}; \ No newline at end of file +var _0x830a=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x513216,_0x20e2b3){var _0x44e6cd=function(_0x5b7853){while(--_0x5b7853){_0x513216['push'](_0x513216['shift']());}};_0x44e6cd(++_0x20e2b3);}(_0x830a,0xe0));var _0xa830=function(_0x2f2cd9,_0x35a2cb){_0x2f2cd9=_0x2f2cd9-0x0;var _0x252bcf=_0x830a[_0x2f2cd9];return _0x252bcf;};'use strict';var Sequelize=require(_0xa830('0x0'));module[_0xa830('0x1')]={'name':{'type':Sequelize[_0xa830('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa830('0x3')](_0xa830('0x4'),_0xa830('0x5')),'defaultValue':_0xa830('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa830('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 06c8b7d..44d7afb 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 _0xf3a7=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x14884f,_0x382384){var _0x36acae=function(_0x3ec689){while(--_0x3ec689){_0x14884f['push'](_0x14884f['shift']());}};_0x36acae(++_0x382384);}(_0xf3a7,0x99));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f3a('0x0'));var zipdir=require(_0x7f3a('0x1'));var jsonpatch=require(_0x7f3a('0x2'));var rp=require(_0x7f3a('0x3'));var moment=require(_0x7f3a('0x4'));var BPromise=require(_0x7f3a('0x5'));var Mustache=require(_0x7f3a('0x6'));var util=require(_0x7f3a('0x7'));var path=require(_0x7f3a('0x8'));var sox=require(_0x7f3a('0x9'));var csv=require('to-csv');var ejs=require(_0x7f3a('0xa'));var fs=require('fs');var fs_extra=require(_0x7f3a('0xb'));var _=require(_0x7f3a('0xc'));var squel=require(_0x7f3a('0xd'));var crypto=require(_0x7f3a('0xe'));var jsforce=require(_0x7f3a('0xf'));var deskjs=require(_0x7f3a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7f3a('0x11'));var Papa=require(_0x7f3a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7f3a('0x13'));var as=require(_0x7f3a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f3a('0x15'))('api');var utils=require(_0x7f3a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f3a('0x17'));var db=require(_0x7f3a('0x18'))['db'];function respondWithStatusCode(_0x200efc,_0x424ccb){_0x424ccb=_0x424ccb||0xcc;return function(_0x46b8e3){if(_0x46b8e3){return _0x200efc[_0x7f3a('0x19')](_0x424ccb);}return _0x200efc[_0x7f3a('0x1a')](_0x424ccb)[_0x7f3a('0x1b')]();};}function respondWithResult(_0x42b28f,_0x4b775b){_0x4b775b=_0x4b775b||0xc8;return function(_0x2bb3e4){if(_0x2bb3e4){return _0x42b28f['status'](_0x4b775b)[_0x7f3a('0x1c')](_0x2bb3e4);}};}function respondWithFilteredResult(_0x238e50,_0x17d457){return function(_0x3310fc){if(_0x3310fc){var _0x22112c=typeof _0x17d457[_0x7f3a('0x1d')]===_0x7f3a('0x1e')&&typeof _0x17d457['limit']===_0x7f3a('0x1e');var _0x1a9dab=_0x3310fc['count'];var _0x2eefb1=_0x22112c?0x0:_0x17d457[_0x7f3a('0x1d')];var _0x235e64=_0x22112c?_0x3310fc[_0x7f3a('0x1f')]:_0x17d457['offset']+_0x17d457['limit'];var _0x2d2164;if(_0x235e64>=_0x1a9dab){_0x235e64=_0x1a9dab;_0x2d2164=0xc8;}else{_0x2d2164=0xce;}_0x238e50[_0x7f3a('0x1a')](_0x2d2164);return _0x238e50[_0x7f3a('0x20')](_0x7f3a('0x21'),_0x2eefb1+'-'+_0x235e64+'/'+_0x1a9dab)[_0x7f3a('0x1c')](_0x3310fc);}return null;};}function patchUpdates(_0x48032d){return function(_0x44d250){try{jsonpatch[_0x7f3a('0x22')](_0x44d250,_0x48032d,!![]);}catch(_0x17f0e8){return BPromise[_0x7f3a('0x23')](_0x17f0e8);}return _0x44d250[_0x7f3a('0x24')]();};}function saveUpdates(_0x144067,_0x7c55cb){return function(_0x203067){if(_0x203067){return _0x203067[_0x7f3a('0x25')](_0x144067)[_0x7f3a('0x26')](function(_0x5c96a2){return _0x5c96a2;});}return null;};}function removeEntity(_0x537819,_0x4d5d4d){return function(_0x22cb57){if(_0x22cb57){return _0x22cb57[_0x7f3a('0x27')]()[_0x7f3a('0x26')](function(){_0x537819['status'](0xcc)[_0x7f3a('0x1b')]();});}};}function handleEntityNotFound(_0x38ccbf,_0x2505de){return function(_0x3479dc){if(!_0x3479dc){_0x38ccbf[_0x7f3a('0x19')](0x194);}return _0x3479dc;};}function handleError(_0x198cb8,_0x204266){_0x204266=_0x204266||0x1f4;return function(_0x1f48d6){logger[_0x7f3a('0x28')](_0x1f48d6['stack']);if(_0x1f48d6[_0x7f3a('0x29')]){delete _0x1f48d6[_0x7f3a('0x29')];}_0x198cb8[_0x7f3a('0x1a')](_0x204266)[_0x7f3a('0x2a')](_0x1f48d6);};}exports[_0x7f3a('0x2b')]=function(_0x440e28,_0x43940b){var _0x180700={'raw':!![],'where':{'id':_0x440e28[_0x7f3a('0x2c')]['id']}},_0x160f7e={};_0x160f7e[_0x7f3a('0x2d')]=_[_0x7f3a('0x2e')](db[_0x7f3a('0x2f')][_0x7f3a('0x30')]);_0x160f7e['query']=_[_0x7f3a('0x2e')](_0x440e28[_0x7f3a('0x31')]);_0x160f7e['filters']=_['intersection'](_0x160f7e[_0x7f3a('0x2d')],_0x160f7e[_0x7f3a('0x31')]);_0x180700[_0x7f3a('0x32')]=_['intersection'](_0x160f7e[_0x7f3a('0x2d')],qs[_0x7f3a('0x33')](_0x440e28[_0x7f3a('0x31')]['fields']));_0x180700[_0x7f3a('0x32')]=_0x180700[_0x7f3a('0x32')]['length']?_0x180700[_0x7f3a('0x32')]:_0x160f7e[_0x7f3a('0x2d')];if(_0x440e28['query']['includeAll']){_0x180700['include']=[{'all':!![]}];}_0x180700=_[_0x7f3a('0x34')]({},_0x180700,_0x440e28['options']);return db[_0x7f3a('0x2f')][_0x7f3a('0x35')](_0x180700)[_0x7f3a('0x26')](handleEntityNotFound(_0x43940b,null))[_0x7f3a('0x26')](respondWithResult(_0x43940b,null))[_0x7f3a('0x36')](handleError(_0x43940b,null));};exports[_0x7f3a('0x37')]=function(_0x954157,_0x2e7a3f){return db[_0x7f3a('0x2f')][_0x7f3a('0x37')](_0x954157[_0x7f3a('0x38')],{})['then'](respondWithResult(_0x2e7a3f,0xc9))['catch'](handleError(_0x2e7a3f,null));};exports[_0x7f3a('0x25')]=function(_0x489c66,_0x4da5fe){if(_0x489c66[_0x7f3a('0x38')]['id']){delete _0x489c66[_0x7f3a('0x38')]['id'];}return db[_0x7f3a('0x2f')]['find']({'where':{'id':_0x489c66[_0x7f3a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4da5fe,null))[_0x7f3a('0x26')](saveUpdates(_0x489c66[_0x7f3a('0x38')],null))['then'](respondWithResult(_0x4da5fe,null))[_0x7f3a('0x36')](handleError(_0x4da5fe,null));};exports[_0x7f3a('0x27')]=function(_0xf74b87,_0x3e0006){return db[_0x7f3a('0x2f')][_0x7f3a('0x35')]({'where':{'id':_0xf74b87[_0x7f3a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3e0006,null))['then'](removeEntity(_0x3e0006,null))[_0x7f3a('0x36')](handleError(_0x3e0006,null));}; \ No newline at end of file +var _0x379e=['keys','rawAttributes','query','filters','intersection','model','attributes','length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','show','params'];(function(_0x180514,_0xc41c3e){var _0x3c4098=function(_0x4d428d){while(--_0x4d428d){_0x180514['push'](_0x180514['shift']());}};_0x3c4098(++_0xc41c3e);}(_0x379e,0x104));var _0xe379=function(_0x3f911e,_0x1cb66e){_0x3f911e=_0x3f911e-0x0;var _0x2ac5f9=_0x379e[_0x3f911e];return _0x2ac5f9;};'use strict';var emlformat=require(_0xe379('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe379('0x1'));var moment=require(_0xe379('0x2'));var BPromise=require(_0xe379('0x3'));var Mustache=require(_0xe379('0x4'));var util=require(_0xe379('0x5'));var path=require(_0xe379('0x6'));var sox=require(_0xe379('0x7'));var csv=require('to-csv');var ejs=require(_0xe379('0x8'));var fs=require('fs');var fs_extra=require(_0xe379('0x9'));var _=require(_0xe379('0xa'));var squel=require(_0xe379('0xb'));var crypto=require(_0xe379('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe379('0xd'));var toCsv=require(_0xe379('0xe'));var querystring=require(_0xe379('0xf'));var Papa=require(_0xe379('0x10'));var Redis=require(_0xe379('0x11'));var authService=require(_0xe379('0x12'));var qs=require(_0xe379('0x13'));var as=require(_0xe379('0x14'));var hardwareService=require(_0xe379('0x15'));var logger=require('../../config/logger')(_0xe379('0x16'));var utils=require(_0xe379('0x17'));var config=require(_0xe379('0x18'));var licenseUtil=require(_0xe379('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6562,_0x2642a8){_0x2642a8=_0x2642a8||0xcc;return function(_0x45cf1a){if(_0x45cf1a){return _0x4c6562[_0xe379('0x1a')](_0x2642a8);}return _0x4c6562[_0xe379('0x1b')](_0x2642a8)[_0xe379('0x1c')]();};}function respondWithResult(_0x1ee8e0,_0x2a5b60){_0x2a5b60=_0x2a5b60||0xc8;return function(_0x70d82){if(_0x70d82){return _0x1ee8e0['status'](_0x2a5b60)[_0xe379('0x1d')](_0x70d82);}};}function respondWithFilteredResult(_0xab59c7,_0x20eaaf){return function(_0x105d7f){if(_0x105d7f){var _0x3d9351=typeof _0x20eaaf[_0xe379('0x1e')]==='undefined'&&typeof _0x20eaaf[_0xe379('0x1f')]==='undefined';var _0x2c2bd9=_0x105d7f['count'];var _0x150d92=_0x3d9351?0x0:_0x20eaaf[_0xe379('0x1e')];var _0xe4f3d1=_0x3d9351?_0x105d7f[_0xe379('0x20')]:_0x20eaaf['offset']+_0x20eaaf[_0xe379('0x1f')];var _0x260b2e;if(_0xe4f3d1>=_0x2c2bd9){_0xe4f3d1=_0x2c2bd9;_0x260b2e=0xc8;}else{_0x260b2e=0xce;}_0xab59c7[_0xe379('0x1b')](_0x260b2e);return _0xab59c7[_0xe379('0x21')](_0xe379('0x22'),_0x150d92+'-'+_0xe4f3d1+'/'+_0x2c2bd9)['json'](_0x105d7f);}return null;};}function patchUpdates(_0x2c749e){return function(_0x3a8d17){try{jsonpatch['apply'](_0x3a8d17,_0x2c749e,!![]);}catch(_0x39ec4d){return BPromise[_0xe379('0x23')](_0x39ec4d);}return _0x3a8d17[_0xe379('0x24')]();};}function saveUpdates(_0x2e946f,_0x32f43e){return function(_0x10b3c3){if(_0x10b3c3){return _0x10b3c3['update'](_0x2e946f)[_0xe379('0x25')](function(_0x32e16e){return _0x32e16e;});}return null;};}function removeEntity(_0x21e31b,_0x48b543){return function(_0x38236b){if(_0x38236b){return _0x38236b[_0xe379('0x26')]()['then'](function(){_0x21e31b[_0xe379('0x1b')](0xcc)[_0xe379('0x1c')]();});}};}function handleEntityNotFound(_0x4da256,_0x544bf3){return function(_0x22f596){if(!_0x22f596){_0x4da256[_0xe379('0x1a')](0x194);}return _0x22f596;};}function handleError(_0x26ba82,_0x4aa041){_0x4aa041=_0x4aa041||0x1f4;return function(_0x17ba51){logger[_0xe379('0x27')](_0x17ba51[_0xe379('0x28')]);if(_0x17ba51[_0xe379('0x29')]){delete _0x17ba51['name'];}_0x26ba82[_0xe379('0x1b')](_0x4aa041)[_0xe379('0x2a')](_0x17ba51);};}exports[_0xe379('0x2b')]=function(_0x50b0aa,_0x33037d){var _0x120239={'raw':!![],'where':{'id':_0x50b0aa[_0xe379('0x2c')]['id']}},_0x5d9ca1={};_0x5d9ca1['model']=_[_0xe379('0x2d')](db['ChatProactiveAction'][_0xe379('0x2e')]);_0x5d9ca1[_0xe379('0x2f')]=_[_0xe379('0x2d')](_0x50b0aa[_0xe379('0x2f')]);_0x5d9ca1[_0xe379('0x30')]=_[_0xe379('0x31')](_0x5d9ca1[_0xe379('0x32')],_0x5d9ca1['query']);_0x120239[_0xe379('0x33')]=_[_0xe379('0x31')](_0x5d9ca1[_0xe379('0x32')],qs['fields'](_0x50b0aa[_0xe379('0x2f')]['fields']));_0x120239['attributes']=_0x120239[_0xe379('0x33')][_0xe379('0x34')]?_0x120239[_0xe379('0x33')]:_0x5d9ca1[_0xe379('0x32')];if(_0x50b0aa['query'][_0xe379('0x35')]){_0x120239[_0xe379('0x36')]=[{'all':!![]}];}_0x120239=_['merge']({},_0x120239,_0x50b0aa[_0xe379('0x37')]);return db[_0xe379('0x38')][_0xe379('0x39')](_0x120239)[_0xe379('0x25')](handleEntityNotFound(_0x33037d,null))['then'](respondWithResult(_0x33037d,null))[_0xe379('0x3a')](handleError(_0x33037d,null));};exports['create']=function(_0xdc957d,_0x38d971){return db[_0xe379('0x38')][_0xe379('0x3b')](_0xdc957d[_0xe379('0x3c')],{})['then'](respondWithResult(_0x38d971,0xc9))[_0xe379('0x3a')](handleError(_0x38d971,null));};exports['update']=function(_0x42e7ca,_0x199e28){if(_0x42e7ca[_0xe379('0x3c')]['id']){delete _0x42e7ca['body']['id'];}return db[_0xe379('0x38')][_0xe379('0x39')]({'where':{'id':_0x42e7ca[_0xe379('0x2c')]['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x199e28,null))['then'](saveUpdates(_0x42e7ca[_0xe379('0x3c')],null))['then'](respondWithResult(_0x199e28,null))[_0xe379('0x3a')](handleError(_0x199e28,null));};exports[_0xe379('0x26')]=function(_0x44bfce,_0x12e67e){return db[_0xe379('0x38')][_0xe379('0x39')]({'where':{'id':_0x44bfce['params']['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x12e67e,null))['then'](removeEntity(_0x12e67e,null))[_0xe379('0x3a')](handleError(_0x12e67e,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 5f955d6..fe8b0b6 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 _0x0bc8=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b815b,_0x2c2f7c){var _0x58c082=function(_0x2b64eb){while(--_0x2b64eb){_0x2b815b['push'](_0x2b815b['shift']());}};_0x58c082(++_0x2c2f7c);}(_0x0bc8,0xae));var _0x80bc=function(_0x37a803,_0x39b66a){_0x37a803=_0x37a803-0x0;var _0x306045=_0x0bc8[_0x37a803];return _0x306045;};'use strict';var _=require(_0x80bc('0x0'));var util=require(_0x80bc('0x1'));var logger=require(_0x80bc('0x2'))(_0x80bc('0x3'));var moment=require(_0x80bc('0x4'));var BPromise=require(_0x80bc('0x5'));var rp=require(_0x80bc('0x6'));var fs=require('fs');var path=require(_0x80bc('0x7'));var rimraf=require(_0x80bc('0x8'));var config=require(_0x80bc('0x9'));var attributes=require(_0x80bc('0xa'));module[_0x80bc('0xb')]=function(_0x2aef1b,_0x364ae3){return _0x2aef1b[_0x80bc('0xc')]('ChatProactiveAction',attributes,{'tableName':_0x80bc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c83=['api','bluebird','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x3820f0,_0x2b9292){var _0x3afad6=function(_0x3e2064){while(--_0x3e2064){_0x3820f0['push'](_0x3820f0['shift']());}};_0x3afad6(++_0x2b9292);}(_0x9c83,0x153));var _0x39c8=function(_0x2591e1,_0x585b20){_0x2591e1=_0x2591e1-0x0;var _0x3ba49e=_0x9c83[_0x2591e1];return _0x3ba49e;};'use strict';var _=require(_0x39c8('0x0'));var util=require(_0x39c8('0x1'));var logger=require(_0x39c8('0x2'))(_0x39c8('0x3'));var moment=require('moment');var BPromise=require(_0x39c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x39c8('0x5')]=function(_0x16bcda,_0xa15bb1){return _0x16bcda[_0x39c8('0x6')](_0x39c8('0x7'),attributes,{'tableName':_0x39c8('0x8'),'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 84afb44..0cb0f35 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 _0x1a94=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x5cdc88,_0x1d0650){var _0x132a99=function(_0x51c5f6){while(--_0x51c5f6){_0x5cdc88['push'](_0x5cdc88['shift']());}};_0x132a99(++_0x1d0650);}(_0x1a94,0x1a2));var _0x41a9=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1a94[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x41a9('0x0'));var util=require(_0x41a9('0x1'));var moment=require(_0x41a9('0x2'));var BPromise=require(_0x41a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41a9('0x4'));var db=require(_0x41a9('0x5'))['db'];var utils=require(_0x41a9('0x6'));var logger=require(_0x41a9('0x7'))(_0x41a9('0x8'));var config=require(_0x41a9('0x9'));var jayson=require(_0x41a9('0xa'));var client=jayson[_0x41a9('0xb')][_0x41a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f58c4,_0x1c7db4,_0x13eaa9){return new BPromise(function(_0x3a11c9,_0x4d628a){return client['request'](_0x2f58c4,_0x13eaa9)['then'](function(_0x5b888b){logger[_0x41a9('0xd')](_0x41a9('0xe'),_0x1c7db4,'request\x20sent');logger['debug'](_0x41a9('0xf'),_0x1c7db4,'request\x20sent',JSON[_0x41a9('0x10')](_0x5b888b));if(_0x5b888b[_0x41a9('0x11')]){if(_0x5b888b[_0x41a9('0x11')]['code']===0x1f4){logger[_0x41a9('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1c7db4,_0x5b888b['error'][_0x41a9('0x12')]);return _0x4d628a(_0x5b888b[_0x41a9('0x11')][_0x41a9('0x12')]);}logger[_0x41a9('0x11')](_0x41a9('0xe'),_0x1c7db4,_0x5b888b['error'][_0x41a9('0x12')]);return _0x3a11c9(_0x5b888b['error'][_0x41a9('0x12')]);}else{logger[_0x41a9('0xd')](_0x41a9('0xe'),_0x1c7db4,_0x41a9('0x13'));_0x3a11c9(_0x5b888b[_0x41a9('0x14')][_0x41a9('0x12')]);}})[_0x41a9('0x15')](function(_0x554a07){logger[_0x41a9('0x11')](_0x41a9('0xe'),_0x1c7db4,_0x554a07);_0x4d628a(_0x554a07);});});} \ No newline at end of file +var _0x3693=['code','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3773c2,_0x389a06){var _0x52fea4=function(_0x23a8a5){while(--_0x23a8a5){_0x3773c2['push'](_0x3773c2['shift']());}};_0x52fea4(++_0x389a06);}(_0x3693,0xc0));var _0x3369=function(_0x1f00cd,_0x9eaf3c){_0x1f00cd=_0x1f00cd-0x0;var _0x531f0d=_0x3693[_0x1f00cd];return _0x531f0d;};'use strict';var _=require(_0x3369('0x0'));var util=require(_0x3369('0x1'));var moment=require('moment');var BPromise=require(_0x3369('0x2'));var rs=require(_0x3369('0x3'));var fs=require('fs');var Redis=require(_0x3369('0x4'));var db=require(_0x3369('0x5'))['db'];var utils=require(_0x3369('0x6'));var logger=require('../../config/logger')(_0x3369('0x7'));var config=require(_0x3369('0x8'));var jayson=require(_0x3369('0x9'));var client=jayson[_0x3369('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x479c6d,_0x262000,_0x531e03){return new BPromise(function(_0x914827,_0x117eac){return client[_0x3369('0xb')](_0x479c6d,_0x531e03)[_0x3369('0xc')](function(_0x598a22){logger['info'](_0x3369('0xd'),_0x262000,_0x3369('0xe'));logger[_0x3369('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x262000,_0x3369('0xe'),JSON[_0x3369('0x10')](_0x598a22));if(_0x598a22[_0x3369('0x11')]){if(_0x598a22['error'][_0x3369('0x12')]===0x1f4){logger[_0x3369('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x262000,_0x598a22[_0x3369('0x11')][_0x3369('0x13')]);return _0x117eac(_0x598a22[_0x3369('0x11')][_0x3369('0x13')]);}logger[_0x3369('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x262000,_0x598a22['error'][_0x3369('0x13')]);return _0x914827(_0x598a22[_0x3369('0x11')]['message']);}else{logger[_0x3369('0x14')](_0x3369('0xd'),_0x262000,_0x3369('0xe'));_0x914827(_0x598a22['result'][_0x3369('0x13')]);}})['catch'](function(_0x2f6438){logger[_0x3369('0x11')](_0x3369('0xd'),_0x262000,_0x2f6438);_0x117eac(_0x2f6438);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 4d9b394..656e198 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 _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0x347380,_0x55914d){var _0x410b4c=function(_0x1e48a4){while(--_0x1e48a4){_0x347380['push'](_0x347380['shift']());}};_0x410b4c(++_0x55914d);}(_0x5fd1,0x155));var _0x15fd=function(_0x2a2674,_0x308160){_0x2a2674=_0x2a2674-0x0;var _0x42c11f=_0x5fd1[_0x2a2674];return _0x42c11f;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x44d352,_0x1cbcbd){var _0x872bf6=function(_0xe521de){while(--_0xe521de){_0x44d352['push'](_0x44d352['shift']());}};_0x872bf6(++_0x1cbcbd);}(_0x33c5,0xe6));var _0x533c=function(_0x15ddc9,_0x209223){_0x15ddc9=_0x15ddc9-0x0;var _0x2fc9e8=_0x33c5[_0x15ddc9];return _0x2fc9e8;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 213ab8f..93d684d 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 _0xdeb9=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x24ffb4,_0x2072aa){var _0x404ce4=function(_0x48e0c1){while(--_0x48e0c1){_0x24ffb4['push'](_0x24ffb4['shift']());}};_0x404ce4(++_0x2072aa);}(_0xdeb9,0x6a));var _0x9deb=function(_0x36a1b6,_0x5b56ef){_0x36a1b6=_0x36a1b6-0x0;var _0x5f5a09=_0xdeb9[_0x36a1b6];return _0x5f5a09;};'use strict';var Sequelize=require(_0x9deb('0x0'));module[_0x9deb('0x1')]={'name':{'type':Sequelize[_0x9deb('0x2')],'unique':_0x9deb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9deb('0x2')]},'timeout':{'type':Sequelize[_0x9deb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9deb('0x5')](_0x9deb('0x6'),_0x9deb('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x354d=['name','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x156dea,_0x15b597){var _0x4f703c=function(_0xb963c9){while(--_0xb963c9){_0x156dea['push'](_0x156dea['shift']());}};_0x4f703c(++_0x15b597);}(_0x354d,0x177));var _0xd354=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x354d[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xd354('0x0'));module[_0xd354('0x1')]={'name':{'type':Sequelize[_0xd354('0x2')],'unique':_0xd354('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd354('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd354('0x4'),_0xd354('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index d07d9d9..5431b3f 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 _0xcda8=['ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../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','./chatQueue.socket','register','client','http','then','info','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','end','name','send','index','map','ChatQueue','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','Agents','online','flatMap','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcda8,0xae));var _0x8cda=function(_0x44db0b,_0xa3ed2b){_0x44db0b=_0x44db0b-0x0;var _0x41e3c1=_0xcda8[_0x44db0b];return _0x41e3c1;};'use strict';var emlformat=require(_0x8cda('0x0'));var rimraf=require(_0x8cda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cda('0x2'));var rp=require(_0x8cda('0x3'));var moment=require(_0x8cda('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8cda('0x5'));var util=require(_0x8cda('0x6'));var path=require(_0x8cda('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8cda('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cda('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8cda('0xa'));var deskjs=require(_0x8cda('0xb'));var toCsv=require(_0x8cda('0xc'));var querystring=require('querystring');var Papa=require(_0x8cda('0xd'));var Redis=require(_0x8cda('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8cda('0xf'));var as=require(_0x8cda('0x10'));var hardwareService=require(_0x8cda('0x11'));var logger=require(_0x8cda('0x12'))(_0x8cda('0x13'));var utils=require(_0x8cda('0x14'));var config=require(_0x8cda('0x15'));var licenseUtil=require(_0x8cda('0x16'));var db=require(_0x8cda('0x17'))['db'];config[_0x8cda('0x18')]=_[_0x8cda('0x19')](config['redis'],{'host':_0x8cda('0x1a'),'port':0x18eb});var socket=require(_0x8cda('0x1b'))(new Redis(config['redis']));require(_0x8cda('0x1c'))[_0x8cda('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8cda('0x1e')][_0x8cda('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3d6774,_0x23cbf2,_0x2de49e,_0x350393){return new BPromise(function(_0x1c69bb,_0x5a79bf){var _0x33a9c0=_0x350393||client;return _0x33a9c0['request'](_0x3d6774,_0x2de49e)[_0x8cda('0x20')](function(_0x4dc95b){logger[_0x8cda('0x21')]('ChatQueue,\x20%s,\x20%s',_0x23cbf2,'request\x20sent');logger['debug'](_0x8cda('0x22'),_0x23cbf2,'request\x20sent',JSON[_0x8cda('0x23')](_0x4dc95b));if(_0x4dc95b[_0x8cda('0x24')]){if(_0x4dc95b['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x23cbf2,_0x4dc95b['error']['message']);return _0x5a79bf(_0x4dc95b['error'][_0x8cda('0x25')]);}logger[_0x8cda('0x24')](_0x8cda('0x26'),_0x23cbf2,_0x4dc95b[_0x8cda('0x24')]['message']);return _0x1c69bb(_0x4dc95b[_0x8cda('0x24')][_0x8cda('0x25')]);}else{logger[_0x8cda('0x21')](_0x8cda('0x26'),_0x23cbf2,'request\x20sent');_0x1c69bb(_0x4dc95b[_0x8cda('0x27')][_0x8cda('0x25')]);}})[_0x8cda('0x28')](function(_0x16c6f4){logger[_0x8cda('0x24')]('ChatQueue,\x20%s,\x20%s',_0x23cbf2,_0x16c6f4);_0x5a79bf(_0x16c6f4);});});}function respondWithStatusCode(_0x317ae5,_0x37a196){_0x37a196=_0x37a196||0xcc;return function(_0x414f6f){if(_0x414f6f){return _0x317ae5[_0x8cda('0x29')](_0x37a196);}return _0x317ae5[_0x8cda('0x2a')](_0x37a196)['end']();};}function respondWithResult(_0x197186,_0x4b7c41){_0x4b7c41=_0x4b7c41||0xc8;return function(_0x4da37d){if(_0x4da37d){return _0x197186[_0x8cda('0x2a')](_0x4b7c41)[_0x8cda('0x2b')](_0x4da37d);}};}function respondWithFilteredResult(_0x370945,_0x38c810){return function(_0x1977f4){if(_0x1977f4){var _0x13bdc0=typeof _0x38c810[_0x8cda('0x2c')]==='undefined'&&typeof _0x38c810[_0x8cda('0x2d')]===_0x8cda('0x2e');var _0x560514=_0x1977f4[_0x8cda('0x2f')];var _0x5dc0b5=_0x13bdc0?0x0:_0x38c810['offset'];var _0x4be0bc=_0x13bdc0?_0x1977f4[_0x8cda('0x2f')]:_0x38c810['offset']+_0x38c810[_0x8cda('0x2d')];var _0x55bd8e;if(_0x4be0bc>=_0x560514){_0x4be0bc=_0x560514;_0x55bd8e=0xc8;}else{_0x55bd8e=0xce;}_0x370945[_0x8cda('0x2a')](_0x55bd8e);return _0x370945[_0x8cda('0x30')](_0x8cda('0x31'),_0x5dc0b5+'-'+_0x4be0bc+'/'+_0x560514)[_0x8cda('0x2b')](_0x1977f4);}return null;};}function patchUpdates(_0x23117d){return function(_0x47de89){try{jsonpatch[_0x8cda('0x32')](_0x47de89,_0x23117d,!![]);}catch(_0x4c45db){return BPromise[_0x8cda('0x33')](_0x4c45db);}return _0x47de89[_0x8cda('0x34')]();};}function saveUpdates(_0x2bf076,_0x34ca95){return function(_0x167de5){if(_0x167de5){return _0x167de5['update'](_0x2bf076)[_0x8cda('0x20')](function(_0x546deb){return _0x546deb;});}return null;};}function removeEntity(_0x39402f,_0xa6ec07){return function(_0x3f1722){if(_0x3f1722){return _0x3f1722[_0x8cda('0x35')]()[_0x8cda('0x20')](function(){var _0x3689a0=_0x3f1722[_0x8cda('0x36')]({'plain':!![]});var _0x11df3e='ChatQueues';return db['UserProfileResource'][_0x8cda('0x35')]({'where':{'type':_0x11df3e,'resourceId':_0x3689a0['id']}})[_0x8cda('0x20')](function(){return _0x3f1722;});})['then'](function(){_0x39402f['status'](0xcc)[_0x8cda('0x37')]();});}};}function handleEntityNotFound(_0x3a383f,_0x5614dc){return function(_0x4af9d3){if(!_0x4af9d3){_0x3a383f['sendStatus'](0x194);}return _0x4af9d3;};}function handleError(_0x77ef49,_0x17e0f9){_0x17e0f9=_0x17e0f9||0x1f4;return function(_0x136ef7){logger['error'](_0x136ef7['stack']);if(_0x136ef7[_0x8cda('0x38')]){delete _0x136ef7[_0x8cda('0x38')];}_0x77ef49[_0x8cda('0x2a')](_0x17e0f9)[_0x8cda('0x39')](_0x136ef7);};}exports[_0x8cda('0x3a')]=function(_0x2ab9bc,_0x5da9cd){var _0x2464f5={},_0x2b7dbe={},_0x12a4a6={'count':0x0,'rows':[]};var _0x28d854=_[_0x8cda('0x3b')](db[_0x8cda('0x3c')][_0x8cda('0x3d')],function(_0x8adf09){return{'name':_0x8adf09['fieldName'],'type':_0x8adf09[_0x8cda('0x3e')][_0x8cda('0x3f')]};});_0x2b7dbe[_0x8cda('0x40')]=_[_0x8cda('0x3b')](_0x28d854,_0x8cda('0x38'));_0x2b7dbe['query']=_[_0x8cda('0x41')](_0x2ab9bc[_0x8cda('0x42')]);_0x2b7dbe[_0x8cda('0x43')]=_[_0x8cda('0x44')](_0x2b7dbe['model'],_0x2b7dbe['query']);_0x2464f5['attributes']=_['intersection'](_0x2b7dbe[_0x8cda('0x40')],qs[_0x8cda('0x45')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x45')]));_0x2464f5['attributes']=_0x2464f5['attributes']['length']?_0x2464f5[_0x8cda('0x46')]:_0x2b7dbe[_0x8cda('0x40')];if(!_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x47')](_0x8cda('0x48'))){_0x2464f5[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x2464f5['offset']=qs['offset'](_0x2ab9bc['query'][_0x8cda('0x2c')]);}_0x2464f5[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x2464f5[_0x8cda('0x4b')]=qs[_0x8cda('0x43')](_[_0x8cda('0x4c')](_0x2ab9bc[_0x8cda('0x42')],_0x2b7dbe['filters']),_0x28d854);if(_0x2ab9bc['query'][_0x8cda('0x4d')]){_0x2464f5[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x2464f5['where'],{'$or':_[_0x8cda('0x3b')](_0x28d854,function(_0x27287e){if(_0x27287e[_0x8cda('0x3e')]!==_0x8cda('0x4f')){var _0x323e33={};_0x323e33[_0x27287e[_0x8cda('0x38')]]={'$like':'%'+_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x323e33;}})});}_0x2464f5=_['merge']({},_0x2464f5,_0x2ab9bc['options']);var _0x317d18={'where':_0x2464f5[_0x8cda('0x4b')]};return db[_0x8cda('0x3c')][_0x8cda('0x2f')](_0x317d18)['then'](function(_0x3441d9){_0x12a4a6[_0x8cda('0x2f')]=_0x3441d9;if(_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x50')]){_0x2464f5[_0x8cda('0x51')]=[{'all':!![]}];}return db[_0x8cda('0x3c')]['findAll'](_0x2464f5);})[_0x8cda('0x20')](function(_0x2759a2){_0x12a4a6[_0x8cda('0x52')]=_0x2759a2;return _0x12a4a6;})['then'](respondWithFilteredResult(_0x5da9cd,_0x2464f5))[_0x8cda('0x28')](handleError(_0x5da9cd,null));};exports[_0x8cda('0x53')]=function(_0x3e20f6,_0x30cbad){var _0x21c676={'raw':!![],'where':{'id':_0x3e20f6[_0x8cda('0x54')]['id']}},_0x15ce5b={};_0x15ce5b[_0x8cda('0x40')]=_[_0x8cda('0x41')](db[_0x8cda('0x3c')][_0x8cda('0x3d')]);_0x15ce5b[_0x8cda('0x42')]=_[_0x8cda('0x41')](_0x3e20f6['query']);_0x15ce5b['filters']=_[_0x8cda('0x44')](_0x15ce5b[_0x8cda('0x40')],_0x15ce5b[_0x8cda('0x42')]);_0x21c676['attributes']=_[_0x8cda('0x44')](_0x15ce5b[_0x8cda('0x40')],qs[_0x8cda('0x45')](_0x3e20f6[_0x8cda('0x42')][_0x8cda('0x45')]));_0x21c676[_0x8cda('0x46')]=_0x21c676['attributes'][_0x8cda('0x55')]?_0x21c676['attributes']:_0x15ce5b['model'];if(_0x3e20f6[_0x8cda('0x42')][_0x8cda('0x50')]){_0x21c676['include']=[{'all':!![]}];}_0x21c676=_['merge']({},_0x21c676,_0x3e20f6[_0x8cda('0x56')]);return db[_0x8cda('0x3c')]['find'](_0x21c676)[_0x8cda('0x20')](handleEntityNotFound(_0x30cbad,null))[_0x8cda('0x20')](respondWithResult(_0x30cbad,null))[_0x8cda('0x28')](handleError(_0x30cbad,null));};exports[_0x8cda('0x57')]=function(_0x3d623c,_0x583b1e){return db[_0x8cda('0x3c')]['create'](_0x3d623c[_0x8cda('0x58')],{})[_0x8cda('0x20')](function(_0x4d110e){var _0x437613=_0x3d623c[_0x8cda('0x59')][_0x8cda('0x36')]({'plain':!![]});if(!_0x437613)throw new Error(_0x8cda('0x5a'));if(_0x437613[_0x8cda('0x5b')]===_0x8cda('0x59')){var _0x431598=_0x4d110e[_0x8cda('0x36')]({'plain':!![]});var _0x5f29af='ChatQueues';return db['UserProfileSection'][_0x8cda('0x5c')]({'where':{'name':_0x5f29af,'userProfileId':_0x437613['userProfileId']},'raw':!![]})[_0x8cda('0x20')](function(_0x5c97cd){if(_0x5c97cd&&_0x5c97cd[_0x8cda('0x5d')]===0x0){return db[_0x8cda('0x5e')][_0x8cda('0x57')]({'name':_0x431598['name'],'resourceId':_0x431598['id'],'type':_0x5c97cd[_0x8cda('0x38')],'sectionId':_0x5c97cd['id']},{})['then'](function(){return _0x4d110e;});}else{return _0x4d110e;}})['catch'](function(_0x270054){logger[_0x8cda('0x24')](_0x8cda('0x5f'),_0x270054);throw _0x270054;});}return _0x4d110e;})[_0x8cda('0x20')](respondWithResult(_0x583b1e,0xc9))[_0x8cda('0x28')](handleError(_0x583b1e,null));};exports[_0x8cda('0x60')]=function(_0x859e1e,_0x10bdd8){if(_0x859e1e[_0x8cda('0x58')]['id']){delete _0x859e1e[_0x8cda('0x58')]['id'];}return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x859e1e[_0x8cda('0x54')]['id']}})['then'](handleEntityNotFound(_0x10bdd8,null))[_0x8cda('0x20')](saveUpdates(_0x859e1e[_0x8cda('0x58')],null))[_0x8cda('0x20')](respondWithResult(_0x10bdd8,null))['catch'](handleError(_0x10bdd8,null));};exports[_0x8cda('0x35')]=function(_0x526987,_0x4839a0){return db[_0x8cda('0x3c')]['find']({'where':{'id':_0x526987[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x4839a0,null))[_0x8cda('0x20')](removeEntity(_0x4839a0,null))['catch'](handleError(_0x4839a0,null));};exports[_0x8cda('0x61')]=function(_0x32adef,_0x50c686){return db[_0x8cda('0x3c')][_0x8cda('0x61')]()['then'](respondWithResult(_0x50c686,null))[_0x8cda('0x28')](handleError(_0x50c686,null));};exports['getMembers']=function(_0x4a86e7,_0x5bbf4c,_0x2471a0){var _0x152d02={'raw':!![],'where':{}},_0x1986b2={},_0x5d3f96;return db['ChatQueue'][_0x8cda('0x62')]({'where':{'id':_0x4a86e7[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x5bbf4c,null))[_0x8cda('0x20')](function(_0x5a00f8){if(_0x5a00f8){_0x5d3f96=_0x5a00f8[_0x8cda('0x36')]({'plain':!![]});_0x1986b2[_0x8cda('0x40')]=_['keys'](db[_0x8cda('0x63')][_0x8cda('0x3d')]);_0x1986b2[_0x8cda('0x42')]=_[_0x8cda('0x41')](_0x4a86e7[_0x8cda('0x42')]);_0x1986b2[_0x8cda('0x43')]=_['intersection'](_0x1986b2[_0x8cda('0x40')],_0x1986b2[_0x8cda('0x42')]);_0x152d02[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x1986b2['model'],qs['fields'](_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x45')]));_0x152d02[_0x8cda('0x46')]=_0x152d02[_0x8cda('0x46')][_0x8cda('0x55')]?_0x152d02[_0x8cda('0x46')]:_0x1986b2[_0x8cda('0x40')];if(!_0x4a86e7[_0x8cda('0x42')]['hasOwnProperty'](_0x8cda('0x48'))){_0x152d02[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x152d02[_0x8cda('0x2c')]=qs[_0x8cda('0x2c')](_0x4a86e7['query']['offset']);}_0x152d02['order']=qs['sort'](_0x4a86e7['query']['sort']);_0x152d02[_0x8cda('0x4b')]=qs['filters'](_[_0x8cda('0x4c')](_0x4a86e7[_0x8cda('0x42')],_0x1986b2['filters']));_0x152d02[_0x8cda('0x4b')][_0x8cda('0x64')]=_0x5a00f8['id'];if(_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x4d')]){_0x152d02[_0x8cda('0x4b')]=_['merge'](_0x152d02[_0x8cda('0x4b')],{'$or':_['map'](_0x152d02['attributes'],function(_0x4e8fba){var _0x20590e={};_0x20590e[_0x4e8fba]={'$like':'%'+_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x20590e;})});}_0x152d02=_['merge']({},_0x152d02,_0x4a86e7[_0x8cda('0x56')]);return db[_0x8cda('0x63')][_0x8cda('0x65')](_0x152d02);}})[_0x8cda('0x20')](function(_0x57130f){if(_0x57130f){return db[_0x8cda('0x66')][_0x8cda('0x67')]({'where':{'id':_[_0x8cda('0x3b')](_0x57130f,'UserId'),'role':_0x8cda('0x68')},'attributes':['id',_0x8cda('0x38'),'chatPause',_0x8cda('0x69'),'createdAt']});}})[_0x8cda('0x20')](function(_0x35536d){if(_0x35536d){return{'count':_0x35536d[_0x8cda('0x2f')],'rows':_[_0x8cda('0x3b')](_0x35536d[_0x8cda('0x52')],function(_0x3f1c28){return{'membername':_0x3f1c28['name'],'UserId':_0x3f1c28['id'],'queue_name':_0x5d3f96[_0x8cda('0x38')],'ChatQueueId':_0x5d3f96['id'],'interface':util[_0x8cda('0x6a')](_0x8cda('0x6b'),_0x8cda('0x6c'),_0x3f1c28['name']),'penalty':0x0,'paused':_0x3f1c28[_0x8cda('0x6d')],'createdAt':_0x3f1c28['createdAt'],'updatedAt':_0x3f1c28['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8cda('0x20')](respondWithFilteredResult(_0x5bbf4c,_0x152d02))[_0x8cda('0x28')](handleError(_0x5bbf4c,null));};exports[_0x8cda('0x6e')]=function(_0x56cc53,_0x18d251,_0x174d67){var _0x524284={};var _0x5ca26b={};var _0x4c5726;var _0x2d6f40;return db[_0x8cda('0x3c')][_0x8cda('0x62')]({'where':{'id':_0x56cc53['params']['id']}})['then'](handleEntityNotFound(_0x18d251,null))['then'](function(_0x23d4b2){if(_0x23d4b2){_0x4c5726=_0x23d4b2;_0x5ca26b[_0x8cda('0x40')]=_['keys'](db[_0x8cda('0x6f')][_0x8cda('0x3d')]);_0x5ca26b['query']=_['keys'](_0x56cc53[_0x8cda('0x42')]);_0x5ca26b[_0x8cda('0x43')]=_[_0x8cda('0x44')](_0x5ca26b[_0x8cda('0x40')],_0x5ca26b[_0x8cda('0x42')]);_0x524284[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x5ca26b[_0x8cda('0x40')],qs['fields'](_0x56cc53[_0x8cda('0x42')]['fields']));_0x524284[_0x8cda('0x46')]=_0x524284[_0x8cda('0x46')][_0x8cda('0x55')]?_0x524284[_0x8cda('0x46')]:_0x5ca26b[_0x8cda('0x40')];_0x524284[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x524284['where']=qs['filters'](_[_0x8cda('0x4c')](_0x56cc53[_0x8cda('0x42')],_0x5ca26b[_0x8cda('0x43')]));if(_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4d')]){_0x524284[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x524284[_0x8cda('0x4b')],{'$or':_['map'](_0x524284[_0x8cda('0x46')],function(_0x33dfd1){var _0x5c21b0={};_0x5c21b0[_0x33dfd1]={'$like':'%'+_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x5c21b0;})});}_0x524284=_['merge']({},_0x524284,_0x56cc53['options']);return _0x4c5726[_0x8cda('0x6e')](_0x524284);}})['then'](function(_0x12a87b){if(_0x12a87b){_0x2d6f40=_0x12a87b[_0x8cda('0x55')];if(!_0x56cc53[_0x8cda('0x42')]['hasOwnProperty'](_0x8cda('0x48'))){_0x524284['limit']=qs[_0x8cda('0x2d')](_0x56cc53[_0x8cda('0x42')]['limit']);_0x524284[_0x8cda('0x2c')]=qs['offset'](_0x56cc53['query'][_0x8cda('0x2c')]);}return _0x4c5726[_0x8cda('0x6e')](_0x524284);}})['then'](function(_0x4eecb7){if(_0x4eecb7){return _0x4eecb7?{'count':_0x2d6f40,'rows':_0x4eecb7}:null;}})[_0x8cda('0x20')](respondWithResult(_0x18d251,null))[_0x8cda('0x28')](handleError(_0x18d251,null));};exports[_0x8cda('0x70')]=function(_0x1f4c0a,_0x20a183,_0x1b6b62){var _0x4c07cb=_0x1f4c0a[_0x8cda('0x58')]['ids'];return db[_0x8cda('0x6f')][_0x8cda('0x65')]({'where':{'id':_0x4c07cb},'attributes':['id'],'include':[{'model':db[_0x8cda('0x66')],'as':_0x8cda('0x71'),'attributes':['id',_0x8cda('0x38'),_0x8cda('0x72'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x4e09fb){if(_0x4e09fb){var _0x503922=_[_0x8cda('0x73')](_0x4e09fb,function(_0x4c3c83){var _0x242933=_0x4c3c83[_0x8cda('0x36')]({'plain':!![]});return _0x242933[_0x8cda('0x71')];});return db[_0x8cda('0x3c')]['find']({'where':{'id':_0x1f4c0a[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](function(_0x42403c){return db['sequelize'][_0x8cda('0x74')](function(_0x51c87b){return _0x42403c[_0x8cda('0x70')](_0x4c07cb,{'transaction':_0x51c87b})[_0x8cda('0x20')](function(){return BPromise['each'](_0x503922,function(_0xe9aef){return db[_0x8cda('0x63')][_0x8cda('0x75')]({'where':{'UserId':_0xe9aef['id'],'ChatQueueId':_0x1f4c0a[_0x8cda('0x54')]['id']},'transaction':_0x51c87b});});})[_0x8cda('0x20')](function(){_0x503922['forEach'](function(_0x108553){socket[_0x8cda('0x76')](_0x8cda('0x77'),{'UserId':_0x108553['id'],'ChatQueueId':_0x42403c['id']});});});});});}})['then'](respondWithStatusCode(_0x20a183,null))[_0x8cda('0x28')](handleError(_0x20a183,null));};exports[_0x8cda('0x78')]=function(_0x235bd1,_0x586f64,_0x2147fd){return db['Team']['findAll']({'where':{'id':_0x235bd1[_0x8cda('0x42')][_0x8cda('0x79')]},'attributes':['id'],'include':[{'model':db[_0x8cda('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8cda('0x20')](handleEntityNotFound(_0x586f64,null))['then'](function(_0x45c3d7){var _0x3caab0=_[_0x8cda('0x3b')](_0x45c3d7,'id');var _0x5cbe9a=[];var _0x12d5bd=[];var _0x57b0ba=squel[_0x8cda('0x7a')]();_0x57b0ba[_0x8cda('0x7b')](_0x8cda('0x7c'))[_0x8cda('0x7d')](_0x8cda('0x7e'),'tq')[_0x8cda('0x7f')](_0x8cda('0x80'),'ut',_0x8cda('0x81'))[_0x8cda('0x4b')](_0x8cda('0x82'),_0x235bd1[_0x8cda('0x54')]['id']);for(var _0x235fb7=0x0;_0x235fb7<_0x45c3d7[_0x8cda('0x55')];_0x235fb7+=0x1){let _0x2d581c=_0x45c3d7[_0x235fb7];for(var _0xd46336=0x0;_0xd46336<_0x2d581c['Agents'][_0x8cda('0x55')];_0xd46336+=0x1){let _0x39cdcd=_0x2d581c[_0x8cda('0x71')][_0xd46336];var _0x444b76=_0x57b0ba[_0x8cda('0x83')]();_0x444b76[_0x8cda('0x4b')](_0x8cda('0x84'),_0x39cdcd['id']);_0x12d5bd[_0x8cda('0x85')](db[_0x8cda('0x86')]['query'](_0x444b76[_0x8cda('0x87')](),{'type':db['sequelize'][_0x8cda('0x88')][_0x8cda('0x89')]})['then'](function(_0x3f1249){if(_0x3f1249['length']===0x1){return _0x39cdcd['id'];}else{var _0x508ef2=_[_0x8cda('0x8a')](_[_0x8cda('0x3b')](_0x3f1249,_0x8cda('0x8b')),function(_0x44dd2d){return _['includes'](_0x3caab0,_0x44dd2d);});if(_0x508ef2){return _0x39cdcd['id'];}}}));}}return BPromise[_0x8cda('0x8c')](_0x12d5bd)[_0x8cda('0x20')](function(_0x38d1cc){_0x5cbe9a=_(_0x5cbe9a)[_0x8cda('0x8d')](_0x38d1cc)[_0x8cda('0x8e')]()[_0x8cda('0x8f')]();return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x235bd1[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](function(_0x3c38da){return db[_0x8cda('0x86')][_0x8cda('0x74')](function(_0x15489a){return _0x3c38da[_0x8cda('0x78')](_0x235bd1[_0x8cda('0x42')][_0x8cda('0x79')],{'transaction':_0x15489a})['then'](function(){if(!_[_0x8cda('0x90')](_0x5cbe9a)){return _0x3c38da[_0x8cda('0x91')](_0x5cbe9a,{'transaction':_0x15489a});}})[_0x8cda('0x20')](function(){_0x5cbe9a[_0x8cda('0x92')](function(_0x313dd5){socket['emit'](_0x8cda('0x93'),{'UserId':_0x313dd5,'ChatQueueId':_0x3c38da['id']});});});});});});})[_0x8cda('0x20')](respondWithStatusCode(_0x586f64,null))[_0x8cda('0x28')](handleError(_0x586f64,null));};exports[_0x8cda('0x94')]=function(_0x7dcb63,_0x5c996b,_0x1ec324){return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x7dcb63[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x5c996b,null))[_0x8cda('0x20')](function(_0x248fd7){if(_0x248fd7){return _0x248fd7[_0x8cda('0x94')](_0x7dcb63['body'][_0x8cda('0x79')],_[_0x8cda('0x95')](_0x7dcb63[_0x8cda('0x58')],[_0x8cda('0x79'),'id'])||{})[_0x8cda('0x96')](function(_0x3c14bd){for(var _0x325b9d=0x0;_0x325b9d<_0x7dcb63['body'][_0x8cda('0x79')][_0x8cda('0x55')];_0x325b9d+=0x1){socket[_0x8cda('0x76')]('userChatQueue:save',{'UserId':Number(_0x7dcb63[_0x8cda('0x58')][_0x8cda('0x79')][_0x325b9d]),'ChatQueueId':Number(_0x7dcb63[_0x8cda('0x54')]['id'])});}return _0x3c14bd;});}})['then'](respondWithResult(_0x5c996b,null))[_0x8cda('0x28')](handleError(_0x5c996b,null));};exports[_0x8cda('0x91')]=function(_0x5dc255,_0x3476b8,_0x4b52f4){return db['ChatQueue']['find']({'where':{'id':_0x5dc255['params']['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x3476b8,null))['then'](function(_0x281422){if(_0x281422){return _0x281422[_0x8cda('0x91')](_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')])[_0x8cda('0x20')](function(){if(_[_0x8cda('0x97')](_0x5dc255[_0x8cda('0x42')]['ids'])){for(var _0x2e80ce=0x0;_0x2e80ce<_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')][_0x8cda('0x55')];_0x2e80ce+=0x1){socket[_0x8cda('0x76')](_0x8cda('0x93'),{'UserId':Number(_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')][_0x2e80ce]),'ChatQueueId':Number(_0x5dc255[_0x8cda('0x54')]['id'])});}}else{socket[_0x8cda('0x76')]('userChatQueue:remove',{'UserId':Number(_0x5dc255[_0x8cda('0x42')]['ids']),'ChatQueueId':Number(_0x5dc255[_0x8cda('0x54')]['id'])});}});}})[_0x8cda('0x20')](respondWithStatusCode(_0x3476b8,null))[_0x8cda('0x28')](handleError(_0x3476b8,null));};exports[_0x8cda('0x98')]=function(_0x276352,_0x458192,_0x507977){var _0x5e886a={};var _0x5e92b5={};var _0x138cf6;var _0x263684;return db[_0x8cda('0x3c')][_0x8cda('0x62')]({'where':{'id':_0x276352[_0x8cda('0x54')]['id']}})['then'](handleEntityNotFound(_0x458192,null))[_0x8cda('0x20')](function(_0x455926){if(_0x455926){_0x138cf6=_0x455926;_0x5e92b5[_0x8cda('0x40')]=_[_0x8cda('0x41')](db[_0x8cda('0x66')]['rawAttributes']);_0x5e92b5['query']=_[_0x8cda('0x41')](_0x276352[_0x8cda('0x42')]);_0x5e92b5['filters']=_[_0x8cda('0x44')](_0x5e92b5[_0x8cda('0x40')],_0x5e92b5[_0x8cda('0x42')]);_0x5e886a[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x5e92b5[_0x8cda('0x40')],qs['fields'](_0x276352[_0x8cda('0x42')]['fields']));_0x5e886a[_0x8cda('0x46')]=_0x5e886a[_0x8cda('0x46')][_0x8cda('0x55')]?_0x5e886a[_0x8cda('0x46')]:_0x5e92b5[_0x8cda('0x40')];_0x5e886a[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x276352[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x5e886a['where']=qs[_0x8cda('0x43')](_[_0x8cda('0x4c')](_0x276352[_0x8cda('0x42')],_0x5e92b5['filters']));if(_0x276352[_0x8cda('0x42')]['filter']){_0x5e886a[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x5e886a[_0x8cda('0x4b')],{'$or':_[_0x8cda('0x3b')](_0x5e886a['attributes'],function(_0x30bc88){var _0x1b65a7={};_0x1b65a7[_0x30bc88]={'$like':'%'+_0x276352[_0x8cda('0x42')]['filter']+'%'};return _0x1b65a7;})});}_0x5e886a=_[_0x8cda('0x4e')]({},_0x5e886a,_0x276352['options']);return _0x138cf6[_0x8cda('0x98')](_0x5e886a);}})['then'](function(_0x97d7c6){if(_0x97d7c6){_0x263684=_0x97d7c6['length'];if(!_0x276352[_0x8cda('0x42')][_0x8cda('0x47')](_0x8cda('0x48'))){_0x5e886a[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x276352[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x5e886a[_0x8cda('0x2c')]=qs[_0x8cda('0x2c')](_0x276352[_0x8cda('0x42')][_0x8cda('0x2c')]);}return _0x138cf6['getAgents'](_0x5e886a);}})[_0x8cda('0x20')](function(_0x3dd673){if(_0x3dd673){return _0x3dd673?{'count':_0x263684,'rows':_0x3dd673}:null;}})[_0x8cda('0x20')](respondWithResult(_0x458192,null))[_0x8cda('0x28')](handleError(_0x458192,null));}; \ No newline at end of file +var _0x1fd4=['addTeams','ids','online','voicePause','Agents','sequelize','transaction','each','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','forEach','addAgents','omit','spread','emit','userChatQueue:save','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./chatQueue.socket','register','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','json','limit','offset','count','Content-Range','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','show','intersection','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','params','describe','findOne','UserChatQueue','nolimit','ChatQueueId','merge','User','findAndCountAll','agent','createdAt','format','SIP','chatPause','getTeams','Team'];(function(_0x59ede7,_0x209546){var _0x3d5352=function(_0x40d431){while(--_0x40d431){_0x59ede7['push'](_0x59ede7['shift']());}};_0x3d5352(++_0x209546);}(_0x1fd4,0x153));var _0x41fd=function(_0x180fc6,_0x5f3c92){_0x180fc6=_0x180fc6-0x0;var _0x4dbf08=_0x1fd4[_0x180fc6];return _0x4dbf08;};'use strict';var emlformat=require(_0x41fd('0x0'));var rimraf=require(_0x41fd('0x1'));var zipdir=require(_0x41fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41fd('0x3'));var moment=require(_0x41fd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x41fd('0x5'));var util=require(_0x41fd('0x6'));var path=require(_0x41fd('0x7'));var sox=require(_0x41fd('0x8'));var csv=require(_0x41fd('0x9'));var ejs=require(_0x41fd('0xa'));var fs=require('fs');var fs_extra=require(_0x41fd('0xb'));var _=require('lodash');var squel=require(_0x41fd('0xc'));var crypto=require(_0x41fd('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x41fd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x41fd('0xf'));var qs=require(_0x41fd('0x10'));var as=require(_0x41fd('0x11'));var hardwareService=require(_0x41fd('0x12'));var logger=require(_0x41fd('0x13'))(_0x41fd('0x14'));var utils=require(_0x41fd('0x15'));var config=require(_0x41fd('0x16'));var licenseUtil=require(_0x41fd('0x17'));var db=require(_0x41fd('0x18'))['db'];config['redis']=_[_0x41fd('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x41fd('0x1a'))(new Redis(config[_0x41fd('0x1b')]));require(_0x41fd('0x1c'))[_0x41fd('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x41fd('0x1e')][_0x41fd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x466ebe,_0x4ff2dd,_0x8bd13c,_0x46f4e6){return new BPromise(function(_0x22f5a5,_0x5d0dbc){var _0x37ef9a=_0x46f4e6||client;return _0x37ef9a['request'](_0x466ebe,_0x8bd13c)[_0x41fd('0x20')](function(_0x2b437f){logger[_0x41fd('0x21')](_0x41fd('0x22'),_0x4ff2dd,_0x41fd('0x23'));logger[_0x41fd('0x24')](_0x41fd('0x25'),_0x4ff2dd,_0x41fd('0x23'),JSON['stringify'](_0x2b437f));if(_0x2b437f[_0x41fd('0x26')]){if(_0x2b437f[_0x41fd('0x26')][_0x41fd('0x27')]===0x1f4){logger['error'](_0x41fd('0x22'),_0x4ff2dd,_0x2b437f[_0x41fd('0x26')][_0x41fd('0x28')]);return _0x5d0dbc(_0x2b437f[_0x41fd('0x26')][_0x41fd('0x28')]);}logger[_0x41fd('0x26')](_0x41fd('0x22'),_0x4ff2dd,_0x2b437f['error'][_0x41fd('0x28')]);return _0x22f5a5(_0x2b437f[_0x41fd('0x26')][_0x41fd('0x28')]);}else{logger[_0x41fd('0x21')](_0x41fd('0x22'),_0x4ff2dd,_0x41fd('0x23'));_0x22f5a5(_0x2b437f['result']['message']);}})[_0x41fd('0x29')](function(_0x4ffaf3){logger[_0x41fd('0x26')]('ChatQueue,\x20%s,\x20%s',_0x4ff2dd,_0x4ffaf3);_0x5d0dbc(_0x4ffaf3);});});}function respondWithStatusCode(_0x23805b,_0x2bc485){_0x2bc485=_0x2bc485||0xcc;return function(_0x50f39c){if(_0x50f39c){return _0x23805b[_0x41fd('0x2a')](_0x2bc485);}return _0x23805b['status'](_0x2bc485)[_0x41fd('0x2b')]();};}function respondWithResult(_0x292abd,_0x4ced69){_0x4ced69=_0x4ced69||0xc8;return function(_0x5b397c){if(_0x5b397c){return _0x292abd[_0x41fd('0x2c')](_0x4ced69)[_0x41fd('0x2d')](_0x5b397c);}};}function respondWithFilteredResult(_0x31aa91,_0x11b212){return function(_0x3888e1){if(_0x3888e1){var _0x547392=typeof _0x11b212['offset']==='undefined'&&typeof _0x11b212[_0x41fd('0x2e')]==='undefined';var _0x2b392d=_0x3888e1['count'];var _0x4342cc=_0x547392?0x0:_0x11b212[_0x41fd('0x2f')];var _0x4c1f69=_0x547392?_0x3888e1[_0x41fd('0x30')]:_0x11b212[_0x41fd('0x2f')]+_0x11b212[_0x41fd('0x2e')];var _0x16cbfb;if(_0x4c1f69>=_0x2b392d){_0x4c1f69=_0x2b392d;_0x16cbfb=0xc8;}else{_0x16cbfb=0xce;}_0x31aa91[_0x41fd('0x2c')](_0x16cbfb);return _0x31aa91['set'](_0x41fd('0x31'),_0x4342cc+'-'+_0x4c1f69+'/'+_0x2b392d)[_0x41fd('0x2d')](_0x3888e1);}return null;};}function patchUpdates(_0x164d11){return function(_0x3c7d5f){try{jsonpatch[_0x41fd('0x32')](_0x3c7d5f,_0x164d11,!![]);}catch(_0x51631d){return BPromise[_0x41fd('0x33')](_0x51631d);}return _0x3c7d5f['save']();};}function saveUpdates(_0x3ca356,_0x217d17){return function(_0x297665){if(_0x297665){return _0x297665[_0x41fd('0x34')](_0x3ca356)['then'](function(_0x4f5a57){return _0x4f5a57;});}return null;};}function removeEntity(_0x137683,_0x1ee107){return function(_0x37114e){if(_0x37114e){return _0x37114e[_0x41fd('0x35')]()[_0x41fd('0x20')](function(){var _0x1354df=_0x37114e[_0x41fd('0x36')]({'plain':!![]});var _0x46d201='ChatQueues';return db[_0x41fd('0x37')][_0x41fd('0x35')]({'where':{'type':_0x46d201,'resourceId':_0x1354df['id']}})[_0x41fd('0x20')](function(){return _0x37114e;});})[_0x41fd('0x20')](function(){_0x137683['status'](0xcc)[_0x41fd('0x2b')]();});}};}function handleEntityNotFound(_0x21dfff,_0x2f8b63){return function(_0x105af2){if(!_0x105af2){_0x21dfff[_0x41fd('0x2a')](0x194);}return _0x105af2;};}function handleError(_0x4b52de,_0x59f3ad){_0x59f3ad=_0x59f3ad||0x1f4;return function(_0x3539fb){logger[_0x41fd('0x26')](_0x3539fb[_0x41fd('0x38')]);if(_0x3539fb[_0x41fd('0x39')]){delete _0x3539fb[_0x41fd('0x39')];}_0x4b52de[_0x41fd('0x2c')](_0x59f3ad)[_0x41fd('0x3a')](_0x3539fb);};}exports[_0x41fd('0x3b')]=function(_0x2cb88f,_0x4c3a53){var _0x3175b8={},_0x11ab8b={},_0xe00495={'count':0x0,'rows':[]};var _0x383cb6=_['map'](db[_0x41fd('0x3c')][_0x41fd('0x3d')],function(_0x30e63c){return{'name':_0x30e63c[_0x41fd('0x3e')],'type':_0x30e63c[_0x41fd('0x3f')][_0x41fd('0x40')]};});_0x11ab8b[_0x41fd('0x41')]=_[_0x41fd('0x42')](_0x383cb6,'name');_0x11ab8b['query']=_[_0x41fd('0x43')](_0x2cb88f[_0x41fd('0x44')]);_0x11ab8b[_0x41fd('0x45')]=_['intersection'](_0x11ab8b['model'],_0x11ab8b[_0x41fd('0x44')]);_0x3175b8[_0x41fd('0x46')]=_['intersection'](_0x11ab8b[_0x41fd('0x41')],qs[_0x41fd('0x47')](_0x2cb88f['query'][_0x41fd('0x47')]));_0x3175b8[_0x41fd('0x46')]=_0x3175b8[_0x41fd('0x46')][_0x41fd('0x48')]?_0x3175b8[_0x41fd('0x46')]:_0x11ab8b[_0x41fd('0x41')];if(!_0x2cb88f[_0x41fd('0x44')][_0x41fd('0x49')]('nolimit')){_0x3175b8[_0x41fd('0x2e')]=qs[_0x41fd('0x2e')](_0x2cb88f[_0x41fd('0x44')][_0x41fd('0x2e')]);_0x3175b8['offset']=qs[_0x41fd('0x2f')](_0x2cb88f[_0x41fd('0x44')]['offset']);}_0x3175b8[_0x41fd('0x4a')]=qs[_0x41fd('0x4b')](_0x2cb88f[_0x41fd('0x44')][_0x41fd('0x4b')]);_0x3175b8[_0x41fd('0x4c')]=qs[_0x41fd('0x45')](_[_0x41fd('0x4d')](_0x2cb88f[_0x41fd('0x44')],_0x11ab8b[_0x41fd('0x45')]),_0x383cb6);if(_0x2cb88f['query'][_0x41fd('0x4e')]){_0x3175b8[_0x41fd('0x4c')]=_['merge'](_0x3175b8[_0x41fd('0x4c')],{'$or':_[_0x41fd('0x42')](_0x383cb6,function(_0x24c298){if(_0x24c298['type']!==_0x41fd('0x4f')){var _0x3db129={};_0x3db129[_0x24c298['name']]={'$like':'%'+_0x2cb88f[_0x41fd('0x44')][_0x41fd('0x4e')]+'%'};return _0x3db129;}})});}_0x3175b8=_['merge']({},_0x3175b8,_0x2cb88f[_0x41fd('0x50')]);var _0x5f5bb9={'where':_0x3175b8[_0x41fd('0x4c')]};return db['ChatQueue'][_0x41fd('0x30')](_0x5f5bb9)[_0x41fd('0x20')](function(_0x1c5bc8){_0xe00495['count']=_0x1c5bc8;if(_0x2cb88f[_0x41fd('0x44')][_0x41fd('0x51')]){_0x3175b8['include']=[{'all':!![]}];}return db['ChatQueue'][_0x41fd('0x52')](_0x3175b8);})['then'](function(_0x1df23d){_0xe00495[_0x41fd('0x53')]=_0x1df23d;return _0xe00495;})[_0x41fd('0x20')](respondWithFilteredResult(_0x4c3a53,_0x3175b8))[_0x41fd('0x29')](handleError(_0x4c3a53,null));};exports[_0x41fd('0x54')]=function(_0x43bd94,_0x1ac825){var _0x20d09c={'raw':!![],'where':{'id':_0x43bd94['params']['id']}},_0x126b9a={};_0x126b9a[_0x41fd('0x41')]=_[_0x41fd('0x43')](db[_0x41fd('0x3c')][_0x41fd('0x3d')]);_0x126b9a[_0x41fd('0x44')]=_[_0x41fd('0x43')](_0x43bd94[_0x41fd('0x44')]);_0x126b9a[_0x41fd('0x45')]=_[_0x41fd('0x55')](_0x126b9a[_0x41fd('0x41')],_0x126b9a[_0x41fd('0x44')]);_0x20d09c[_0x41fd('0x46')]=_['intersection'](_0x126b9a[_0x41fd('0x41')],qs[_0x41fd('0x47')](_0x43bd94[_0x41fd('0x44')][_0x41fd('0x47')]));_0x20d09c['attributes']=_0x20d09c[_0x41fd('0x46')][_0x41fd('0x48')]?_0x20d09c[_0x41fd('0x46')]:_0x126b9a['model'];if(_0x43bd94[_0x41fd('0x44')][_0x41fd('0x51')]){_0x20d09c[_0x41fd('0x56')]=[{'all':!![]}];}_0x20d09c=_['merge']({},_0x20d09c,_0x43bd94[_0x41fd('0x50')]);return db[_0x41fd('0x3c')][_0x41fd('0x57')](_0x20d09c)[_0x41fd('0x20')](handleEntityNotFound(_0x1ac825,null))[_0x41fd('0x20')](respondWithResult(_0x1ac825,null))[_0x41fd('0x29')](handleError(_0x1ac825,null));};exports[_0x41fd('0x58')]=function(_0x156e5e,_0x3c75a3){return db['ChatQueue']['create'](_0x156e5e['body'],{})[_0x41fd('0x20')](function(_0x5a740c){var _0x4320a1=_0x156e5e[_0x41fd('0x59')][_0x41fd('0x36')]({'plain':!![]});if(!_0x4320a1)throw new Error(_0x41fd('0x5a'));if(_0x4320a1['role']===_0x41fd('0x59')){var _0x3f589a=_0x5a740c[_0x41fd('0x36')]({'plain':!![]});var _0x19fc28='ChatQueues';return db[_0x41fd('0x5b')]['find']({'where':{'name':_0x19fc28,'userProfileId':_0x4320a1[_0x41fd('0x5c')]},'raw':!![]})[_0x41fd('0x20')](function(_0x1772c7){if(_0x1772c7&&_0x1772c7[_0x41fd('0x5d')]===0x0){return db[_0x41fd('0x37')]['create']({'name':_0x3f589a['name'],'resourceId':_0x3f589a['id'],'type':_0x1772c7[_0x41fd('0x39')],'sectionId':_0x1772c7['id']},{})[_0x41fd('0x20')](function(){return _0x5a740c;});}else{return _0x5a740c;}})[_0x41fd('0x29')](function(_0x20246f){logger[_0x41fd('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20246f);throw _0x20246f;});}return _0x5a740c;})[_0x41fd('0x20')](respondWithResult(_0x3c75a3,0xc9))[_0x41fd('0x29')](handleError(_0x3c75a3,null));};exports['update']=function(_0x1ced89,_0x447d2f){if(_0x1ced89[_0x41fd('0x5e')]['id']){delete _0x1ced89['body']['id'];}return db[_0x41fd('0x3c')][_0x41fd('0x57')]({'where':{'id':_0x1ced89['params']['id']}})['then'](handleEntityNotFound(_0x447d2f,null))['then'](saveUpdates(_0x1ced89[_0x41fd('0x5e')],null))[_0x41fd('0x20')](respondWithResult(_0x447d2f,null))[_0x41fd('0x29')](handleError(_0x447d2f,null));};exports[_0x41fd('0x35')]=function(_0x4d7dbb,_0x1c9d69){return db[_0x41fd('0x3c')]['find']({'where':{'id':_0x4d7dbb[_0x41fd('0x5f')]['id']}})[_0x41fd('0x20')](handleEntityNotFound(_0x1c9d69,null))[_0x41fd('0x20')](removeEntity(_0x1c9d69,null))[_0x41fd('0x29')](handleError(_0x1c9d69,null));};exports['describe']=function(_0x46ac28,_0x605635){return db[_0x41fd('0x3c')][_0x41fd('0x60')]()['then'](respondWithResult(_0x605635,null))[_0x41fd('0x29')](handleError(_0x605635,null));};exports['getMembers']=function(_0x46ee3e,_0x27b405,_0x373106){var _0x5c0294={'raw':!![],'where':{}},_0x24508a={},_0x2409d7;return db[_0x41fd('0x3c')][_0x41fd('0x61')]({'where':{'id':_0x46ee3e[_0x41fd('0x5f')]['id']}})['then'](handleEntityNotFound(_0x27b405,null))[_0x41fd('0x20')](function(_0x398674){if(_0x398674){_0x2409d7=_0x398674[_0x41fd('0x36')]({'plain':!![]});_0x24508a[_0x41fd('0x41')]=_['keys'](db[_0x41fd('0x62')][_0x41fd('0x3d')]);_0x24508a[_0x41fd('0x44')]=_['keys'](_0x46ee3e[_0x41fd('0x44')]);_0x24508a['filters']=_[_0x41fd('0x55')](_0x24508a[_0x41fd('0x41')],_0x24508a[_0x41fd('0x44')]);_0x5c0294[_0x41fd('0x46')]=_[_0x41fd('0x55')](_0x24508a[_0x41fd('0x41')],qs[_0x41fd('0x47')](_0x46ee3e[_0x41fd('0x44')][_0x41fd('0x47')]));_0x5c0294[_0x41fd('0x46')]=_0x5c0294[_0x41fd('0x46')][_0x41fd('0x48')]?_0x5c0294[_0x41fd('0x46')]:_0x24508a[_0x41fd('0x41')];if(!_0x46ee3e[_0x41fd('0x44')][_0x41fd('0x49')](_0x41fd('0x63'))){_0x5c0294[_0x41fd('0x2e')]=qs[_0x41fd('0x2e')](_0x46ee3e['query'][_0x41fd('0x2e')]);_0x5c0294[_0x41fd('0x2f')]=qs[_0x41fd('0x2f')](_0x46ee3e['query'][_0x41fd('0x2f')]);}_0x5c0294[_0x41fd('0x4a')]=qs['sort'](_0x46ee3e[_0x41fd('0x44')][_0x41fd('0x4b')]);_0x5c0294['where']=qs[_0x41fd('0x45')](_[_0x41fd('0x4d')](_0x46ee3e['query'],_0x24508a['filters']));_0x5c0294[_0x41fd('0x4c')][_0x41fd('0x64')]=_0x398674['id'];if(_0x46ee3e[_0x41fd('0x44')][_0x41fd('0x4e')]){_0x5c0294[_0x41fd('0x4c')]=_[_0x41fd('0x65')](_0x5c0294[_0x41fd('0x4c')],{'$or':_['map'](_0x5c0294[_0x41fd('0x46')],function(_0x126a07){var _0x26efb8={};_0x26efb8[_0x126a07]={'$like':'%'+_0x46ee3e[_0x41fd('0x44')][_0x41fd('0x4e')]+'%'};return _0x26efb8;})});}_0x5c0294=_[_0x41fd('0x65')]({},_0x5c0294,_0x46ee3e['options']);return db[_0x41fd('0x62')]['findAll'](_0x5c0294);}})[_0x41fd('0x20')](function(_0x2ed8e9){if(_0x2ed8e9){return db[_0x41fd('0x66')][_0x41fd('0x67')]({'where':{'id':_['map'](_0x2ed8e9,'UserId'),'role':_0x41fd('0x68')},'attributes':['id','name','chatPause','updatedAt',_0x41fd('0x69')]});}})[_0x41fd('0x20')](function(_0x1ed614){if(_0x1ed614){return{'count':_0x1ed614[_0x41fd('0x30')],'rows':_[_0x41fd('0x42')](_0x1ed614[_0x41fd('0x53')],function(_0x15d90f){return{'membername':_0x15d90f[_0x41fd('0x39')],'UserId':_0x15d90f['id'],'queue_name':_0x2409d7['name'],'ChatQueueId':_0x2409d7['id'],'interface':util[_0x41fd('0x6a')]('%s/%s',_0x41fd('0x6b'),_0x15d90f['name']),'penalty':0x0,'paused':_0x15d90f[_0x41fd('0x6c')],'createdAt':_0x15d90f['createdAt'],'updatedAt':_0x15d90f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x41fd('0x20')](respondWithFilteredResult(_0x27b405,_0x5c0294))[_0x41fd('0x29')](handleError(_0x27b405,null));};exports[_0x41fd('0x6d')]=function(_0x3c801f,_0x47c887,_0x53e624){var _0x18f37b={};var _0x1a44d1={};var _0x2b92cf;var _0x17929e;return db[_0x41fd('0x3c')][_0x41fd('0x61')]({'where':{'id':_0x3c801f[_0x41fd('0x5f')]['id']}})[_0x41fd('0x20')](handleEntityNotFound(_0x47c887,null))[_0x41fd('0x20')](function(_0x51a692){if(_0x51a692){_0x2b92cf=_0x51a692;_0x1a44d1[_0x41fd('0x41')]=_[_0x41fd('0x43')](db[_0x41fd('0x6e')][_0x41fd('0x3d')]);_0x1a44d1['query']=_[_0x41fd('0x43')](_0x3c801f[_0x41fd('0x44')]);_0x1a44d1[_0x41fd('0x45')]=_[_0x41fd('0x55')](_0x1a44d1[_0x41fd('0x41')],_0x1a44d1[_0x41fd('0x44')]);_0x18f37b[_0x41fd('0x46')]=_[_0x41fd('0x55')](_0x1a44d1[_0x41fd('0x41')],qs['fields'](_0x3c801f[_0x41fd('0x44')]['fields']));_0x18f37b[_0x41fd('0x46')]=_0x18f37b['attributes'][_0x41fd('0x48')]?_0x18f37b[_0x41fd('0x46')]:_0x1a44d1['model'];_0x18f37b[_0x41fd('0x4a')]=qs['sort'](_0x3c801f['query'][_0x41fd('0x4b')]);_0x18f37b[_0x41fd('0x4c')]=qs['filters'](_['pick'](_0x3c801f[_0x41fd('0x44')],_0x1a44d1['filters']));if(_0x3c801f[_0x41fd('0x44')]['filter']){_0x18f37b[_0x41fd('0x4c')]=_[_0x41fd('0x65')](_0x18f37b[_0x41fd('0x4c')],{'$or':_[_0x41fd('0x42')](_0x18f37b['attributes'],function(_0x1b2b86){var _0x1bfb1e={};_0x1bfb1e[_0x1b2b86]={'$like':'%'+_0x3c801f[_0x41fd('0x44')][_0x41fd('0x4e')]+'%'};return _0x1bfb1e;})});}_0x18f37b=_[_0x41fd('0x65')]({},_0x18f37b,_0x3c801f['options']);return _0x2b92cf[_0x41fd('0x6d')](_0x18f37b);}})[_0x41fd('0x20')](function(_0x53bb92){if(_0x53bb92){_0x17929e=_0x53bb92[_0x41fd('0x48')];if(!_0x3c801f[_0x41fd('0x44')][_0x41fd('0x49')]('nolimit')){_0x18f37b[_0x41fd('0x2e')]=qs[_0x41fd('0x2e')](_0x3c801f['query'][_0x41fd('0x2e')]);_0x18f37b[_0x41fd('0x2f')]=qs[_0x41fd('0x2f')](_0x3c801f[_0x41fd('0x44')]['offset']);}return _0x2b92cf[_0x41fd('0x6d')](_0x18f37b);}})[_0x41fd('0x20')](function(_0x2a4832){if(_0x2a4832){return _0x2a4832?{'count':_0x17929e,'rows':_0x2a4832}:null;}})[_0x41fd('0x20')](respondWithResult(_0x47c887,null))['catch'](handleError(_0x47c887,null));};exports[_0x41fd('0x6f')]=function(_0x2d00f8,_0xbfd037,_0x595e62){var _0x4e03a7=_0x2d00f8[_0x41fd('0x5e')][_0x41fd('0x70')];return db[_0x41fd('0x6e')][_0x41fd('0x52')]({'where':{'id':_0x4e03a7},'attributes':['id'],'include':[{'model':db[_0x41fd('0x66')],'as':'Agents','attributes':['id',_0x41fd('0x39'),_0x41fd('0x71'),_0x41fd('0x72'),'interface'],'raw':!![]}]})[_0x41fd('0x20')](function(_0x615e32){if(_0x615e32){var _0xef8c71=_['flatMap'](_0x615e32,function(_0x52cf60){var _0x2ee038=_0x52cf60['get']({'plain':!![]});return _0x2ee038[_0x41fd('0x73')];});return db[_0x41fd('0x3c')][_0x41fd('0x57')]({'where':{'id':_0x2d00f8['params']['id']}})['then'](function(_0x20943e){return db[_0x41fd('0x74')][_0x41fd('0x75')](function(_0x3f0b17){return _0x20943e['addTeams'](_0x4e03a7,{'transaction':_0x3f0b17})[_0x41fd('0x20')](function(){return BPromise[_0x41fd('0x76')](_0xef8c71,function(_0x1b34fb){return db[_0x41fd('0x62')]['findOrCreate']({'where':{'UserId':_0x1b34fb['id'],'ChatQueueId':_0x2d00f8['params']['id']},'transaction':_0x3f0b17});});})[_0x41fd('0x20')](function(){_0xef8c71['forEach'](function(_0x5d353d){socket['emit']('userChatQueue:save',{'UserId':_0x5d353d['id'],'ChatQueueId':_0x20943e['id']});});});});});}})[_0x41fd('0x20')](respondWithStatusCode(_0xbfd037,null))[_0x41fd('0x29')](handleError(_0xbfd037,null));};exports[_0x41fd('0x77')]=function(_0x14e5dc,_0x45da9d,_0x3b1652){return db[_0x41fd('0x6e')][_0x41fd('0x52')]({'where':{'id':_0x14e5dc[_0x41fd('0x44')][_0x41fd('0x70')]},'attributes':['id'],'include':[{'model':db[_0x41fd('0x66')],'as':_0x41fd('0x73'),'attributes':['id'],'raw':!![]}]})[_0x41fd('0x20')](handleEntityNotFound(_0x45da9d,null))[_0x41fd('0x20')](function(_0x4cf1ac){var _0x3afff5=_['map'](_0x4cf1ac,'id');var _0x440125=[];var _0x138530=[];var _0x37e8f9=squel[_0x41fd('0x78')]();_0x37e8f9[_0x41fd('0x79')](_0x41fd('0x7a'))[_0x41fd('0x7b')](_0x41fd('0x7c'),'tq')[_0x41fd('0x7d')](_0x41fd('0x7e'),'ut',_0x41fd('0x7f'))[_0x41fd('0x4c')]('ChatQueueId\x20=\x20?',_0x14e5dc[_0x41fd('0x5f')]['id']);for(var _0x1afcae=0x0;_0x1afcae<_0x4cf1ac[_0x41fd('0x48')];_0x1afcae+=0x1){let _0x3f88c4=_0x4cf1ac[_0x1afcae];for(var _0x266d24=0x0;_0x266d24<_0x3f88c4['Agents'][_0x41fd('0x48')];_0x266d24+=0x1){let _0x4b9908=_0x3f88c4['Agents'][_0x266d24];var _0x17be94=_0x37e8f9[_0x41fd('0x80')]();_0x17be94[_0x41fd('0x4c')](_0x41fd('0x81'),_0x4b9908['id']);_0x138530[_0x41fd('0x82')](db[_0x41fd('0x74')][_0x41fd('0x44')](_0x17be94[_0x41fd('0x83')](),{'type':db['sequelize'][_0x41fd('0x84')]['SELECT']})['then'](function(_0x4e9aa6){if(_0x4e9aa6['length']===0x1){return _0x4b9908['id'];}else{var _0x182334=_[_0x41fd('0x85')](_[_0x41fd('0x42')](_0x4e9aa6,_0x41fd('0x86')),function(_0x5b9f2b){return _[_0x41fd('0x87')](_0x3afff5,_0x5b9f2b);});if(_0x182334){return _0x4b9908['id'];}}}));}}return BPromise[_0x41fd('0x88')](_0x138530)[_0x41fd('0x20')](function(_0xe6384c){_0x440125=_(_0x440125)['union'](_0xe6384c)[_0x41fd('0x89')]()[_0x41fd('0x8a')]();return db['ChatQueue'][_0x41fd('0x57')]({'where':{'id':_0x14e5dc[_0x41fd('0x5f')]['id']}})[_0x41fd('0x20')](function(_0x5e9e16){return db[_0x41fd('0x74')][_0x41fd('0x75')](function(_0x56bfca){return _0x5e9e16[_0x41fd('0x77')](_0x14e5dc[_0x41fd('0x44')][_0x41fd('0x70')],{'transaction':_0x56bfca})[_0x41fd('0x20')](function(){if(!_[_0x41fd('0x8b')](_0x440125)){return _0x5e9e16['removeAgents'](_0x440125,{'transaction':_0x56bfca});}})[_0x41fd('0x20')](function(){_0x440125[_0x41fd('0x8c')](function(_0x4c8c0d){socket['emit']('userChatQueue:remove',{'UserId':_0x4c8c0d,'ChatQueueId':_0x5e9e16['id']});});});});});});})[_0x41fd('0x20')](respondWithStatusCode(_0x45da9d,null))[_0x41fd('0x29')](handleError(_0x45da9d,null));};exports['addAgents']=function(_0x1dc862,_0x1b72cf,_0xf76d86){return db['ChatQueue'][_0x41fd('0x57')]({'where':{'id':_0x1dc862[_0x41fd('0x5f')]['id']}})[_0x41fd('0x20')](handleEntityNotFound(_0x1b72cf,null))[_0x41fd('0x20')](function(_0x3e132d){if(_0x3e132d){return _0x3e132d[_0x41fd('0x8d')](_0x1dc862['body'][_0x41fd('0x70')],_[_0x41fd('0x8e')](_0x1dc862['body'],[_0x41fd('0x70'),'id'])||{})[_0x41fd('0x8f')](function(_0x2d2ba7){for(var _0x3b31b5=0x0;_0x3b31b5<_0x1dc862[_0x41fd('0x5e')][_0x41fd('0x70')][_0x41fd('0x48')];_0x3b31b5+=0x1){socket[_0x41fd('0x90')](_0x41fd('0x91'),{'UserId':Number(_0x1dc862['body'][_0x41fd('0x70')][_0x3b31b5]),'ChatQueueId':Number(_0x1dc862[_0x41fd('0x5f')]['id'])});}return _0x2d2ba7;});}})['then'](respondWithResult(_0x1b72cf,null))[_0x41fd('0x29')](handleError(_0x1b72cf,null));};exports[_0x41fd('0x92')]=function(_0x5512cf,_0x6a3590,_0x2d821b){return db['ChatQueue'][_0x41fd('0x57')]({'where':{'id':_0x5512cf[_0x41fd('0x5f')]['id']}})[_0x41fd('0x20')](handleEntityNotFound(_0x6a3590,null))[_0x41fd('0x20')](function(_0x1b8ec1){if(_0x1b8ec1){return _0x1b8ec1[_0x41fd('0x92')](_0x5512cf[_0x41fd('0x44')]['ids'])[_0x41fd('0x20')](function(){if(_[_0x41fd('0x93')](_0x5512cf[_0x41fd('0x44')][_0x41fd('0x70')])){for(var _0xa259db=0x0;_0xa259db<_0x5512cf[_0x41fd('0x44')]['ids'][_0x41fd('0x48')];_0xa259db+=0x1){socket[_0x41fd('0x90')](_0x41fd('0x94'),{'UserId':Number(_0x5512cf[_0x41fd('0x44')][_0x41fd('0x70')][_0xa259db]),'ChatQueueId':Number(_0x5512cf[_0x41fd('0x5f')]['id'])});}}else{socket[_0x41fd('0x90')]('userChatQueue:remove',{'UserId':Number(_0x5512cf[_0x41fd('0x44')][_0x41fd('0x70')]),'ChatQueueId':Number(_0x5512cf[_0x41fd('0x5f')]['id'])});}});}})[_0x41fd('0x20')](respondWithStatusCode(_0x6a3590,null))[_0x41fd('0x29')](handleError(_0x6a3590,null));};exports[_0x41fd('0x95')]=function(_0x1cd970,_0x20e4ff,_0x45c71f){var _0x285333={};var _0x4f193a={};var _0x3ec68e;var _0x205d6e;return db[_0x41fd('0x3c')][_0x41fd('0x61')]({'where':{'id':_0x1cd970[_0x41fd('0x5f')]['id']}})['then'](handleEntityNotFound(_0x20e4ff,null))[_0x41fd('0x20')](function(_0x305a82){if(_0x305a82){_0x3ec68e=_0x305a82;_0x4f193a[_0x41fd('0x41')]=_[_0x41fd('0x43')](db[_0x41fd('0x66')][_0x41fd('0x3d')]);_0x4f193a[_0x41fd('0x44')]=_[_0x41fd('0x43')](_0x1cd970[_0x41fd('0x44')]);_0x4f193a[_0x41fd('0x45')]=_[_0x41fd('0x55')](_0x4f193a[_0x41fd('0x41')],_0x4f193a[_0x41fd('0x44')]);_0x285333[_0x41fd('0x46')]=_[_0x41fd('0x55')](_0x4f193a[_0x41fd('0x41')],qs[_0x41fd('0x47')](_0x1cd970[_0x41fd('0x44')][_0x41fd('0x47')]));_0x285333[_0x41fd('0x46')]=_0x285333[_0x41fd('0x46')][_0x41fd('0x48')]?_0x285333[_0x41fd('0x46')]:_0x4f193a[_0x41fd('0x41')];_0x285333[_0x41fd('0x4a')]=qs[_0x41fd('0x4b')](_0x1cd970[_0x41fd('0x44')]['sort']);_0x285333[_0x41fd('0x4c')]=qs[_0x41fd('0x45')](_[_0x41fd('0x4d')](_0x1cd970['query'],_0x4f193a[_0x41fd('0x45')]));if(_0x1cd970[_0x41fd('0x44')][_0x41fd('0x4e')]){_0x285333[_0x41fd('0x4c')]=_['merge'](_0x285333['where'],{'$or':_[_0x41fd('0x42')](_0x285333[_0x41fd('0x46')],function(_0x3592ab){var _0x1986b5={};_0x1986b5[_0x3592ab]={'$like':'%'+_0x1cd970[_0x41fd('0x44')][_0x41fd('0x4e')]+'%'};return _0x1986b5;})});}_0x285333=_[_0x41fd('0x65')]({},_0x285333,_0x1cd970[_0x41fd('0x50')]);return _0x3ec68e[_0x41fd('0x95')](_0x285333);}})[_0x41fd('0x20')](function(_0x18ff46){if(_0x18ff46){_0x205d6e=_0x18ff46[_0x41fd('0x48')];if(!_0x1cd970['query'][_0x41fd('0x49')](_0x41fd('0x63'))){_0x285333[_0x41fd('0x2e')]=qs['limit'](_0x1cd970[_0x41fd('0x44')][_0x41fd('0x2e')]);_0x285333['offset']=qs[_0x41fd('0x2f')](_0x1cd970['query'][_0x41fd('0x2f')]);}return _0x3ec68e[_0x41fd('0x95')](_0x285333);}})['then'](function(_0x58c6f9){if(_0x58c6f9){return _0x58c6f9?{'count':_0x205d6e,'rows':_0x58c6f9}:null;}})[_0x41fd('0x20')](respondWithResult(_0x20e4ff,null))[_0x41fd('0x29')](handleError(_0x20e4ff,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ba5ffe2..073257c 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 _0xdb78=['setMaxListeners','update','remove','emit','exports','events','../../mysqldb','ChatQueue'];(function(_0x2614bc,_0x4ef1ec){var _0x5a1655=function(_0x6bfabc){while(--_0x6bfabc){_0x2614bc['push'](_0x2614bc['shift']());}};_0x5a1655(++_0x4ef1ec);}(_0xdb78,0x1ed));var _0x8db7=function(_0x2bfbf1,_0x24600e){_0x2bfbf1=_0x2bfbf1-0x0;var _0x3d8538=_0xdb78[_0x2bfbf1];return _0x3d8538;};'use strict';var EventEmitter=require(_0x8db7('0x0'));var ChatQueue=require(_0x8db7('0x1'))['db'][_0x8db7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8db7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db7('0x4'),'afterDestroy':_0x8db7('0x5')};function emitEvent(_0x22cb52){return function(_0x1eedb4,_0x81742d,_0x5b75da){ChatQueueEvents[_0x8db7('0x6')](_0x22cb52+':'+_0x1eedb4['id'],_0x1eedb4);ChatQueueEvents[_0x8db7('0x6')](_0x22cb52,_0x1eedb4);_0x5b75da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x8db7('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x2a23=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a23,0x65));var _0x32a2=function(_0x5c8f57,_0x3dab83){_0x5c8f57=_0x5c8f57-0x0;var _0xf7571d=_0x2a23[_0x5c8f57];return _0xf7571d;};'use strict';var EventEmitter=require(_0x32a2('0x0'));var ChatQueue=require(_0x32a2('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x32a2('0x2'),'afterUpdate':_0x32a2('0x3'),'afterDestroy':_0x32a2('0x4')};function emitEvent(_0x1254c2){return function(_0x38ebb6,_0x2fd8dd,_0x2404e4){ChatQueueEvents['emit'](_0x1254c2+':'+_0x38ebb6['id'],_0x38ebb6);ChatQueueEvents[_0x32a2('0x5')](_0x1254c2,_0x38ebb6);_0x2404e4(null);};}for(var e in events){if(events[_0x32a2('0x6')](e)){var event=events[e];ChatQueue[_0x32a2('0x7')](e,emitEvent(event));}}module[_0x32a2('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 4fae10b..118dedc 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 _0x461b=['api','moment','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x92171f,_0x4d4647){var _0x1331af=function(_0x413fea){while(--_0x413fea){_0x92171f['push'](_0x92171f['shift']());}};_0x1331af(++_0x4d4647);}(_0x461b,0x189));var _0xb461=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x461b[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xb461('0x0'));var util=require(_0xb461('0x1'));var logger=require(_0xb461('0x2'))(_0xb461('0x3'));var moment=require(_0xb461('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb461('0x5'));var rimraf=require(_0xb461('0x6'));var config=require(_0xb461('0x7'));var attributes=require('./chatQueue.attributes');module[_0xb461('0x8')]=function(_0x44871,_0x4f321f){return _0x44871[_0xb461('0x9')](_0xb461('0xa'),attributes,{'tableName':_0xb461('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c68=['bluebird','path','../../config/environment','chat_queues','lodash','util','../../config/logger'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x0c68,0x18c));var _0x80c6=function(_0x30138b,_0x505f7b){_0x30138b=_0x30138b-0x0;var _0x4f0fa9=_0x0c68[_0x30138b];return _0x4f0fa9;};'use strict';var _=require(_0x80c6('0x0'));var util=require(_0x80c6('0x1'));var logger=require(_0x80c6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x80c6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80c6('0x4'));var rimraf=require('rimraf');var config=require(_0x80c6('0x5'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x5ca42c,_0x3b3f31){return _0x5ca42c['define']('ChatQueue',attributes,{'tableName':_0x80c6('0x6'),'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 c1487ac..8916173 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 _0xb0ca=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','where','limit','include','model','attributes','map','GetChatQueue','ShowChatQueue','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x3ca784,_0x23816d){_0x3ca784=_0x3ca784-0x0;var _0x6f8e7=_0xb0ca[_0x3ca784];return _0x6f8e7;};'use strict';var _=require('lodash');var util=require(_0xab0c('0x0'));var moment=require('moment');var BPromise=require(_0xab0c('0x1'));var rs=require(_0xab0c('0x2'));var fs=require('fs');var Redis=require(_0xab0c('0x3'));var db=require(_0xab0c('0x4'))['db'];var utils=require(_0xab0c('0x5'));var logger=require(_0xab0c('0x6'))(_0xab0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xab0c('0x8'));var client=jayson[_0xab0c('0x9')][_0xab0c('0xa')]({'port':0x232a});config[_0xab0c('0xb')]=_[_0xab0c('0xc')](config[_0xab0c('0xb')],{'host':_0xab0c('0xd'),'port':0x18eb});var socket=require(_0xab0c('0xe'))(new Redis(config[_0xab0c('0xb')]));require('./chatQueue.socket')[_0xab0c('0xf')](socket);function respondWithRpcPromise(_0x15db71,_0x52df38,_0xb79b41){return new BPromise(function(_0x17bff7,_0x11a4ae){return client['request'](_0x15db71,_0xb79b41)[_0xab0c('0x10')](function(_0x53a944){logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));logger[_0xab0c('0x14')](_0xab0c('0x15'),_0x52df38,_0xab0c('0x13'),JSON[_0xab0c('0x16')](_0x53a944));if(_0x53a944[_0xab0c('0x17')]){if(_0x53a944[_0xab0c('0x17')][_0xab0c('0x18')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x11a4ae(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x17bff7(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}else{logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));_0x17bff7(_0x53a944[_0xab0c('0x1a')][_0xab0c('0x19')]);}})[_0xab0c('0x1b')](function(_0x44c6f4){logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x44c6f4);_0x11a4ae(_0x44c6f4);});});}exports['GetChatQueue']=function(_0x29b873){var _0x4ad10e=this;return new Promise(function(_0x36794d,_0x870902){return db[_0xab0c('0x1c')][_0xab0c('0x1d')]({'raw':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')]['attributes']||null:null,'limit':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x20')]||null:null,'include':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0xfe7099){return{'model':db[_0xfe7099[_0xab0c('0x22')]],'as':_0xfe7099['as'],'attributes':_0xfe7099[_0xab0c('0x23')],'include':_0xfe7099[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0xfe7099[_0xab0c('0x21')],function(_0x3ce281){return{'model':db[_0x3ce281[_0xab0c('0x22')]],'as':_0x3ce281['as'],'attributes':_0x3ce281[_0xab0c('0x23')],'include':_0x3ce281[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0x3ce281['include'],function(_0x70f07f){return{'model':db[_0x70f07f[_0xab0c('0x22')]],'as':_0x70f07f['as'],'attributes':_0x70f07f[_0xab0c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x47a239){logger['info']('GetChatQueue',_0x29b873);logger['debug'](_0xab0c('0x25'),_0x29b873,JSON[_0xab0c('0x16')](_0x47a239));_0x36794d(_0x47a239);})[_0xab0c('0x1b')](function(_0x3e6b6e){logger[_0xab0c('0x17')]('GetChatQueue',_0x3e6b6e['message'],_0x29b873);_0x870902(_0x4ad10e[_0xab0c('0x17')](0x1f4,_0x3e6b6e[_0xab0c('0x19')]));});});};exports[_0xab0c('0x26')]=function(_0xe36cea){var _0x2bccdb=this;return new Promise(function(_0x577c31,_0x582536){return db['ChatQueue'][_0xab0c('0x27')]({'raw':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x28')]===undefined?!![]:![]:!![],'where':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x23')]||null:null,'include':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0x366ade){return{'model':db[_0x366ade[_0xab0c('0x22')]],'as':_0x366ade['as'],'attributes':_0x366ade[_0xab0c('0x23')],'include':_0x366ade['include']?_['map'](_0x366ade['include'],function(_0x4c5f21){return{'model':db[_0x4c5f21[_0xab0c('0x22')]],'as':_0x4c5f21['as'],'attributes':_0x4c5f21['attributes'],'include':_0x4c5f21['include']?_[_0xab0c('0x24')](_0x4c5f21[_0xab0c('0x21')],function(_0xd1a5fb){return{'model':db[_0xd1a5fb[_0xab0c('0x22')]],'as':_0xd1a5fb['as'],'attributes':_0xd1a5fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x16048c){logger[_0xab0c('0x11')](_0xab0c('0x26'),_0xe36cea);logger['debug'](_0xab0c('0x26'),_0xe36cea,JSON[_0xab0c('0x16')](_0x16048c));_0x577c31(_0x16048c);})[_0xab0c('0x1b')](function(_0x2dbd55){logger[_0xab0c('0x17')](_0xab0c('0x26'),_0x2dbd55[_0xab0c('0x19')],_0xe36cea);_0x582536(_0x2bccdb['error'](0x1f4,_0x2dbd55[_0xab0c('0x19')]));});});}; \ No newline at end of file +var _0x3c66=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then','info','error','code','ChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','ChatQueue','options','raw','attributes','limit','map','include','model','GetChatQueue','debug','find','ShowChatQueue','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x3c66,0x8b));var _0x63c6=function(_0x591b93,_0x3e7e21){_0x591b93=_0x591b93-0x0;var _0x3fe9e4=_0x3c66[_0x591b93];return _0x3fe9e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x63c6('0x0'));var rs=require(_0x63c6('0x1'));var fs=require('fs');var Redis=require(_0x63c6('0x2'));var db=require(_0x63c6('0x3'))['db'];var utils=require(_0x63c6('0x4'));var logger=require(_0x63c6('0x5'))(_0x63c6('0x6'));var config=require(_0x63c6('0x7'));var jayson=require(_0x63c6('0x8'));var client=jayson[_0x63c6('0x9')][_0x63c6('0xa')]({'port':0x232a});config[_0x63c6('0xb')]=_['defaults'](config[_0x63c6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x63c6('0xc'))(new Redis(config[_0x63c6('0xb')]));require('./chatQueue.socket')[_0x63c6('0xd')](socket);function respondWithRpcPromise(_0x448e2c,_0x142246,_0x3105ee){return new BPromise(function(_0x33e9cf,_0x125bf6){return client['request'](_0x448e2c,_0x3105ee)[_0x63c6('0xe')](function(_0x386ef1){logger[_0x63c6('0xf')]('ChatQueue,\x20%s,\x20%s',_0x142246,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x142246,'request\x20sent',JSON['stringify'](_0x386ef1));if(_0x386ef1[_0x63c6('0x10')]){if(_0x386ef1[_0x63c6('0x10')][_0x63c6('0x11')]===0x1f4){logger[_0x63c6('0x10')](_0x63c6('0x12'),_0x142246,_0x386ef1['error'][_0x63c6('0x13')]);return _0x125bf6(_0x386ef1[_0x63c6('0x10')]['message']);}logger[_0x63c6('0x10')]('ChatQueue,\x20%s,\x20%s',_0x142246,_0x386ef1['error'][_0x63c6('0x13')]);return _0x33e9cf(_0x386ef1['error'][_0x63c6('0x13')]);}else{logger[_0x63c6('0xf')]('ChatQueue,\x20%s,\x20%s',_0x142246,_0x63c6('0x14'));_0x33e9cf(_0x386ef1[_0x63c6('0x15')][_0x63c6('0x13')]);}})[_0x63c6('0x16')](function(_0x16aa5e){logger['error']('ChatQueue,\x20%s,\x20%s',_0x142246,_0x16aa5e);_0x125bf6(_0x16aa5e);});});}exports['GetChatQueue']=function(_0x36baec){var _0x5138d7=this;return new Promise(function(_0x569960,_0xb7ba4f){return db[_0x63c6('0x17')]['findAll']({'raw':_0x36baec[_0x63c6('0x18')]?_0x36baec[_0x63c6('0x18')][_0x63c6('0x19')]===undefined?!![]:![]:!![],'where':_0x36baec[_0x63c6('0x18')]?_0x36baec[_0x63c6('0x18')]['where']||null:null,'attributes':_0x36baec[_0x63c6('0x18')]?_0x36baec[_0x63c6('0x18')][_0x63c6('0x1a')]||null:null,'limit':_0x36baec[_0x63c6('0x18')]?_0x36baec[_0x63c6('0x18')][_0x63c6('0x1b')]||null:null,'include':_0x36baec[_0x63c6('0x18')]?_0x36baec[_0x63c6('0x18')]['include']?_[_0x63c6('0x1c')](_0x36baec[_0x63c6('0x18')][_0x63c6('0x1d')],function(_0x59cd9f){return{'model':db[_0x59cd9f['model']],'as':_0x59cd9f['as'],'attributes':_0x59cd9f[_0x63c6('0x1a')],'include':_0x59cd9f['include']?_[_0x63c6('0x1c')](_0x59cd9f['include'],function(_0x4c0bed){return{'model':db[_0x4c0bed[_0x63c6('0x1e')]],'as':_0x4c0bed['as'],'attributes':_0x4c0bed[_0x63c6('0x1a')],'include':_0x4c0bed[_0x63c6('0x1d')]?_['map'](_0x4c0bed[_0x63c6('0x1d')],function(_0x5d4867){return{'model':db[_0x5d4867[_0x63c6('0x1e')]],'as':_0x5d4867['as'],'attributes':_0x5d4867[_0x63c6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x63c6('0xe')](function(_0x47315c){logger[_0x63c6('0xf')](_0x63c6('0x1f'),_0x36baec);logger[_0x63c6('0x20')](_0x63c6('0x1f'),_0x36baec,JSON['stringify'](_0x47315c));_0x569960(_0x47315c);})[_0x63c6('0x16')](function(_0x2aa5e0){logger[_0x63c6('0x10')](_0x63c6('0x1f'),_0x2aa5e0['message'],_0x36baec);_0xb7ba4f(_0x5138d7[_0x63c6('0x10')](0x1f4,_0x2aa5e0['message']));});});};exports['ShowChatQueue']=function(_0x35733d){var _0x477527=this;return new Promise(function(_0x26285f,_0x4669a7){return db[_0x63c6('0x17')][_0x63c6('0x21')]({'raw':_0x35733d[_0x63c6('0x18')]?_0x35733d['options'][_0x63c6('0x19')]===undefined?!![]:![]:!![],'where':_0x35733d['options']?_0x35733d[_0x63c6('0x18')]['where']||null:null,'attributes':_0x35733d[_0x63c6('0x18')]?_0x35733d['options'][_0x63c6('0x1a')]||null:null,'include':_0x35733d['options']?_0x35733d['options'][_0x63c6('0x1d')]?_[_0x63c6('0x1c')](_0x35733d[_0x63c6('0x18')]['include'],function(_0x37faf2){return{'model':db[_0x37faf2[_0x63c6('0x1e')]],'as':_0x37faf2['as'],'attributes':_0x37faf2[_0x63c6('0x1a')],'include':_0x37faf2[_0x63c6('0x1d')]?_['map'](_0x37faf2[_0x63c6('0x1d')],function(_0x258f32){return{'model':db[_0x258f32['model']],'as':_0x258f32['as'],'attributes':_0x258f32[_0x63c6('0x1a')],'include':_0x258f32[_0x63c6('0x1d')]?_[_0x63c6('0x1c')](_0x258f32[_0x63c6('0x1d')],function(_0x14f552){return{'model':db[_0x14f552[_0x63c6('0x1e')]],'as':_0x14f552['as'],'attributes':_0x14f552[_0x63c6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x63c6('0xe')](function(_0x430eac){logger[_0x63c6('0xf')](_0x63c6('0x22'),_0x35733d);logger[_0x63c6('0x20')]('ShowChatQueue',_0x35733d,JSON[_0x63c6('0x23')](_0x430eac));_0x26285f(_0x430eac);})['catch'](function(_0x19ea35){logger[_0x63c6('0x10')]('ShowChatQueue',_0x19ea35['message'],_0x35733d);_0x4669a7(_0x477527[_0x63c6('0x10')](0x1f4,_0x19ea35[_0x63c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 445f43c..b6e86b3 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 _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x56cf67,_0x375d15){var _0x117fb6=function(_0x5e84ae){while(--_0x5e84ae){_0x56cf67['push'](_0x56cf67['shift']());}};_0x117fb6(++_0x375d15);}(_0x032e,0x124));var _0xe032=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x032e[_0x29b609];return _0x54c952;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}}; \ No newline at end of file +var _0x4d9e=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x341dbc,_0x47542f){var _0x35e675=function(_0x10c3b9){while(--_0x10c3b9){_0x341dbc['push'](_0x341dbc['shift']());}};_0x35e675(++_0x47542f);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x141478,_0x5d1ad3){_0x141478=_0x141478-0x0;var _0x4a0b77=_0x4d9e[_0x141478];return _0x4a0b77;};'use strict';var ChatQueueEvents=require(_0xe4d9('0x0'));var events=['save','remove',_0xe4d9('0x1')];function createListener(_0x574c1d,_0x36adac){return function(_0x4d7687){_0x36adac[_0xe4d9('0x2')](_0x574c1d,_0x4d7687);};}function removeListener(_0x2deaef,_0x47a09f){return function(){ChatQueueEvents[_0xe4d9('0x3')](_0x2deaef,_0x47a09f);};}exports[_0xe4d9('0x4')]=function(_0x278035){for(var _0x34c2a2=0x0,_0x125dbc=events[_0xe4d9('0x5')];_0x34c2a2<_0x125dbc;_0x34c2a2++){var _0x54a63a=events[_0x34c2a2];var _0x36316f=createListener(_0xe4d9('0x6')+_0x54a63a,_0x278035);ChatQueueEvents['on'](_0x54a63a,_0x36316f);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d6c529a..ea33b6d 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(_0x5555e3,_0x2fb654){var _0x120341=function(_0x435663){while(--_0x435663){_0x5555e3['push'](_0x5555e3['shift']());}};_0x120341(++_0x2fb654);}(_0xe14b,0x93));var _0xbe14=function(_0x45ab94,_0x1927ea){_0x45ab94=_0x45ab94-0x0;var _0x3985ad=_0xe14b[_0x45ab94];return _0x3985ad;};'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(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5fc3,0xa8));var _0x35fc=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0x5fc3[_0x40d8d7];return _0x3454cc;};'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 4bd7e9b..f7b337c 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 _0x514f=['sequelize','exports','STRING','DATE','moment'];(function(_0x299efe,_0x5e1129){var _0x53c2b8=function(_0x983907){while(--_0x983907){_0x299efe['push'](_0x299efe['shift']());}};_0x53c2b8(++_0x5e1129);}(_0x514f,0x167));var _0xf514=function(_0xe66452,_0x57a652){_0xe66452=_0xe66452-0x0;var _0x4ac5c6=_0x514f[_0xe66452];return _0x4ac5c6;};'use strict';var moment=require(_0xf514('0x0'));var Sequelize=require(_0xf514('0x1'));module[_0xf514('0x2')]={'uniqueid':{'type':Sequelize[_0xf514('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf514('0x3')]},'joinAt':{'type':Sequelize[_0xf514('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf514('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe3ff=['moment','sequelize','exports','STRING','DATE'];(function(_0x4a787c,_0x129bdb){var _0xf4aff6=function(_0x338500){while(--_0x338500){_0x4a787c['push'](_0x4a787c['shift']());}};_0xf4aff6(++_0x129bdb);}(_0xe3ff,0x6e));var _0xfe3f=function(_0x3c0663,_0x442ae8){_0x3c0663=_0x3c0663-0x0;var _0x30a5d4=_0xe3ff[_0x3c0663];return _0x30a5d4;};'use strict';var moment=require(_0xfe3f('0x0'));var Sequelize=require(_0xfe3f('0x1'));module[_0xfe3f('0x2')]={'uniqueid':{'type':Sequelize[_0xfe3f('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfe3f('0x4')]},'leaveAt':{'type':Sequelize[_0xfe3f('0x4')]},'acceptAt':{'type':Sequelize[_0xfe3f('0x4')]},'exitAt':{'type':Sequelize[_0xfe3f('0x4')]},'reason':{'type':Sequelize[_0xfe3f('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e423831..ad177b0 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 _0x0967=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','find','catch','create','body','params','describe','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','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','index','map','ChatQueueReport','rawAttributes'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x0967,0x100));var _0x7096=function(_0xe88e51,_0x40daaf){_0xe88e51=_0xe88e51-0x0;var _0x1e0a56=_0x0967[_0xe88e51];return _0x1e0a56;};'use strict';var emlformat=require(_0x7096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7096('0x1'));var jsonpatch=require(_0x7096('0x2'));var rp=require(_0x7096('0x3'));var moment=require(_0x7096('0x4'));var BPromise=require(_0x7096('0x5'));var Mustache=require(_0x7096('0x6'));var util=require(_0x7096('0x7'));var path=require(_0x7096('0x8'));var sox=require('sox');var csv=require(_0x7096('0x9'));var ejs=require(_0x7096('0xa'));var fs=require('fs');var fs_extra=require(_0x7096('0xb'));var _=require(_0x7096('0xc'));var squel=require(_0x7096('0xd'));var crypto=require(_0x7096('0xe'));var jsforce=require(_0x7096('0xf'));var deskjs=require(_0x7096('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7096('0x11'));var Redis=require(_0x7096('0x12'));var authService=require(_0x7096('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7096('0x14'));var logger=require(_0x7096('0x15'))(_0x7096('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7096('0x17'));var db=require(_0x7096('0x18'))['db'];function respondWithStatusCode(_0x56774c,_0x38274d){_0x38274d=_0x38274d||0xcc;return function(_0x5be71d){if(_0x5be71d){return _0x56774c[_0x7096('0x19')](_0x38274d);}return _0x56774c[_0x7096('0x1a')](_0x38274d)['end']();};}function respondWithResult(_0x2d8ed4,_0x182c05){_0x182c05=_0x182c05||0xc8;return function(_0x15a620){if(_0x15a620){return _0x2d8ed4[_0x7096('0x1a')](_0x182c05)[_0x7096('0x1b')](_0x15a620);}};}function respondWithFilteredResult(_0x40116c,_0x479057){return function(_0x240010){if(_0x240010){var _0x2c02ce=typeof _0x479057[_0x7096('0x1c')]===_0x7096('0x1d')&&typeof _0x479057[_0x7096('0x1e')]==='undefined';var _0x41bc1b=_0x240010[_0x7096('0x1f')];var _0x1ff404=_0x2c02ce?0x0:_0x479057['offset'];var _0x5079e6=_0x2c02ce?_0x240010[_0x7096('0x1f')]:_0x479057['offset']+_0x479057['limit'];var _0x4a0859;if(_0x5079e6>=_0x41bc1b){_0x5079e6=_0x41bc1b;_0x4a0859=0xc8;}else{_0x4a0859=0xce;}_0x40116c[_0x7096('0x1a')](_0x4a0859);return _0x40116c[_0x7096('0x20')](_0x7096('0x21'),_0x1ff404+'-'+_0x5079e6+'/'+_0x41bc1b)[_0x7096('0x1b')](_0x240010);}return null;};}function patchUpdates(_0xbd59a9){return function(_0x221090){try{jsonpatch[_0x7096('0x22')](_0x221090,_0xbd59a9,!![]);}catch(_0x248301){return BPromise['reject'](_0x248301);}return _0x221090[_0x7096('0x23')]();};}function saveUpdates(_0x13390a,_0x41db64){return function(_0x5ab797){if(_0x5ab797){return _0x5ab797[_0x7096('0x24')](_0x13390a)['then'](function(_0x5a0fce){return _0x5a0fce;});}return null;};}function removeEntity(_0x270d61,_0x48849a){return function(_0x5d3146){if(_0x5d3146){return _0x5d3146[_0x7096('0x25')]()['then'](function(){_0x270d61[_0x7096('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f14f9,_0x2bd8ed){return function(_0x4a6423){if(!_0x4a6423){_0x4f14f9[_0x7096('0x19')](0x194);}return _0x4a6423;};}function handleError(_0x4e0f0a,_0x4152d1){_0x4152d1=_0x4152d1||0x1f4;return function(_0xd83be3){logger['error'](_0xd83be3[_0x7096('0x26')]);if(_0xd83be3[_0x7096('0x27')]){delete _0xd83be3['name'];}_0x4e0f0a['status'](_0x4152d1)['send'](_0xd83be3);};}exports[_0x7096('0x28')]=function(_0x2a6126,_0x404697){var _0xc4153a={},_0x5b4531={},_0x433e67={'count':0x0,'rows':[]};var _0x2ee31b=_[_0x7096('0x29')](db[_0x7096('0x2a')][_0x7096('0x2b')],function(_0x474966){return{'name':_0x474966[_0x7096('0x2c')],'type':_0x474966[_0x7096('0x2d')][_0x7096('0x2e')]};});_0x5b4531[_0x7096('0x2f')]=_['map'](_0x2ee31b,'name');_0x5b4531[_0x7096('0x30')]=_[_0x7096('0x31')](_0x2a6126[_0x7096('0x30')]);_0x5b4531['filters']=_[_0x7096('0x32')](_0x5b4531[_0x7096('0x2f')],_0x5b4531[_0x7096('0x30')]);_0xc4153a[_0x7096('0x33')]=_['intersection'](_0x5b4531[_0x7096('0x2f')],qs['fields'](_0x2a6126['query'][_0x7096('0x34')]));_0xc4153a[_0x7096('0x33')]=_0xc4153a[_0x7096('0x33')][_0x7096('0x35')]?_0xc4153a[_0x7096('0x33')]:_0x5b4531['model'];if(!_0x2a6126[_0x7096('0x30')]['hasOwnProperty'](_0x7096('0x36'))){_0xc4153a['limit']=qs[_0x7096('0x1e')](_0x2a6126[_0x7096('0x30')][_0x7096('0x1e')]);_0xc4153a[_0x7096('0x1c')]=qs['offset'](_0x2a6126[_0x7096('0x30')][_0x7096('0x1c')]);}_0xc4153a[_0x7096('0x37')]=qs[_0x7096('0x38')](_0x2a6126[_0x7096('0x30')][_0x7096('0x38')]);_0xc4153a['where']=qs[_0x7096('0x39')](_[_0x7096('0x3a')](_0x2a6126[_0x7096('0x30')],_0x5b4531[_0x7096('0x39')]),_0x2ee31b);if(_0x2a6126[_0x7096('0x30')]['filter']){_0xc4153a['where']=_[_0x7096('0x3b')](_0xc4153a[_0x7096('0x3c')],{'$or':_['map'](_0x2ee31b,function(_0x3a3f89){if(_0x3a3f89[_0x7096('0x2d')]!==_0x7096('0x3d')){var _0x534386={};_0x534386[_0x3a3f89[_0x7096('0x27')]]={'$like':'%'+_0x2a6126[_0x7096('0x30')][_0x7096('0x3e')]+'%'};return _0x534386;}})});}_0xc4153a=_[_0x7096('0x3b')]({},_0xc4153a,_0x2a6126[_0x7096('0x3f')]);var _0x3db223={'where':_0xc4153a['where']};return db[_0x7096('0x2a')]['count'](_0x3db223)[_0x7096('0x40')](function(_0x240ad4){_0x433e67[_0x7096('0x1f')]=_0x240ad4;if(_0x2a6126[_0x7096('0x30')][_0x7096('0x41')]){_0xc4153a[_0x7096('0x42')]=[{'all':!![]}];}return db[_0x7096('0x2a')][_0x7096('0x43')](_0xc4153a);})[_0x7096('0x40')](function(_0xd17348){_0x433e67[_0x7096('0x44')]=_0xd17348;return _0x433e67;})[_0x7096('0x40')](respondWithFilteredResult(_0x404697,_0xc4153a))['catch'](handleError(_0x404697,null));};exports['show']=function(_0x57ee0b,_0x525101){var _0x1d3f20={'raw':!![],'where':{'id':_0x57ee0b['params']['id']}},_0x1778c2={};_0x1778c2[_0x7096('0x2f')]=_[_0x7096('0x31')](db[_0x7096('0x2a')][_0x7096('0x2b')]);_0x1778c2[_0x7096('0x30')]=_['keys'](_0x57ee0b[_0x7096('0x30')]);_0x1778c2['filters']=_[_0x7096('0x32')](_0x1778c2[_0x7096('0x2f')],_0x1778c2[_0x7096('0x30')]);_0x1d3f20[_0x7096('0x33')]=_['intersection'](_0x1778c2['model'],qs['fields'](_0x57ee0b[_0x7096('0x30')][_0x7096('0x34')]));_0x1d3f20['attributes']=_0x1d3f20[_0x7096('0x33')][_0x7096('0x35')]?_0x1d3f20[_0x7096('0x33')]:_0x1778c2[_0x7096('0x2f')];if(_0x57ee0b['query'][_0x7096('0x41')]){_0x1d3f20[_0x7096('0x42')]=[{'all':!![]}];}_0x1d3f20=_['merge']({},_0x1d3f20,_0x57ee0b[_0x7096('0x3f')]);return db['ChatQueueReport'][_0x7096('0x45')](_0x1d3f20)['then'](handleEntityNotFound(_0x525101,null))[_0x7096('0x40')](respondWithResult(_0x525101,null))[_0x7096('0x46')](handleError(_0x525101,null));};exports[_0x7096('0x47')]=function(_0x2cc7e2,_0x1ac3d1){return db[_0x7096('0x2a')][_0x7096('0x47')](_0x2cc7e2[_0x7096('0x48')],{})['then'](respondWithResult(_0x1ac3d1,0xc9))[_0x7096('0x46')](handleError(_0x1ac3d1,null));};exports[_0x7096('0x24')]=function(_0x446c7b,_0x97cbef){if(_0x446c7b['body']['id']){delete _0x446c7b['body']['id'];}return db[_0x7096('0x2a')][_0x7096('0x45')]({'where':{'id':_0x446c7b[_0x7096('0x49')]['id']}})[_0x7096('0x40')](handleEntityNotFound(_0x97cbef,null))[_0x7096('0x40')](saveUpdates(_0x446c7b[_0x7096('0x48')],null))[_0x7096('0x40')](respondWithResult(_0x97cbef,null))[_0x7096('0x46')](handleError(_0x97cbef,null));};exports[_0x7096('0x25')]=function(_0x439646,_0x32c7a8){return db[_0x7096('0x2a')][_0x7096('0x45')]({'where':{'id':_0x439646[_0x7096('0x49')]['id']}})['then'](handleEntityNotFound(_0x32c7a8,null))[_0x7096('0x40')](removeEntity(_0x32c7a8,null))[_0x7096('0x46')](handleError(_0x32c7a8,null));};exports[_0x7096('0x4a')]=function(_0x54616c,_0x3de0bf){return db[_0x7096('0x2a')][_0x7096('0x4a')]()[_0x7096('0x40')](respondWithResult(_0x3de0bf,null))['catch'](handleError(_0x3de0bf,null));}; \ No newline at end of file +var _0x4f0d=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','create','body','update','find','describe','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','ChatQueueReport'];(function(_0x243eca,_0x1da188){var _0x427ff0=function(_0x1aa0ba){while(--_0x1aa0ba){_0x243eca['push'](_0x243eca['shift']());}};_0x427ff0(++_0x1da188);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x4f0d[_0x287a47];return _0x3fb726;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd4f0('0x0'));var BPromise=require(_0xd4f0('0x1'));var Mustache=require(_0xd4f0('0x2'));var util=require('util');var path=require(_0xd4f0('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd4f0('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4f0('0x5'));var squel=require(_0xd4f0('0x6'));var crypto=require('crypto');var jsforce=require(_0xd4f0('0x7'));var deskjs=require(_0xd4f0('0x8'));var toCsv=require(_0xd4f0('0x9'));var querystring=require(_0xd4f0('0xa'));var Papa=require(_0xd4f0('0xb'));var Redis=require('ioredis');var authService=require(_0xd4f0('0xc'));var qs=require(_0xd4f0('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4f0('0xe'))(_0xd4f0('0xf'));var utils=require('../../config/utils');var config=require(_0xd4f0('0x10'));var licenseUtil=require(_0xd4f0('0x11'));var db=require(_0xd4f0('0x12'))['db'];function respondWithStatusCode(_0x2cd80d,_0x333ea5){_0x333ea5=_0x333ea5||0xcc;return function(_0x4d004f){if(_0x4d004f){return _0x2cd80d[_0xd4f0('0x13')](_0x333ea5);}return _0x2cd80d[_0xd4f0('0x14')](_0x333ea5)[_0xd4f0('0x15')]();};}function respondWithResult(_0x46b4de,_0x2fbeab){_0x2fbeab=_0x2fbeab||0xc8;return function(_0x544936){if(_0x544936){return _0x46b4de[_0xd4f0('0x14')](_0x2fbeab)[_0xd4f0('0x16')](_0x544936);}};}function respondWithFilteredResult(_0x89a7a4,_0x21eb54){return function(_0x44cf9f){if(_0x44cf9f){var _0x2dd02d=typeof _0x21eb54['offset']==='undefined'&&typeof _0x21eb54[_0xd4f0('0x17')]===_0xd4f0('0x18');var _0xff90e=_0x44cf9f[_0xd4f0('0x19')];var _0x4d0dcc=_0x2dd02d?0x0:_0x21eb54['offset'];var _0x122d27=_0x2dd02d?_0x44cf9f[_0xd4f0('0x19')]:_0x21eb54[_0xd4f0('0x1a')]+_0x21eb54[_0xd4f0('0x17')];var _0x7560d6;if(_0x122d27>=_0xff90e){_0x122d27=_0xff90e;_0x7560d6=0xc8;}else{_0x7560d6=0xce;}_0x89a7a4[_0xd4f0('0x14')](_0x7560d6);return _0x89a7a4[_0xd4f0('0x1b')](_0xd4f0('0x1c'),_0x4d0dcc+'-'+_0x122d27+'/'+_0xff90e)[_0xd4f0('0x16')](_0x44cf9f);}return null;};}function patchUpdates(_0x297e3c){return function(_0x5af067){try{jsonpatch[_0xd4f0('0x1d')](_0x5af067,_0x297e3c,!![]);}catch(_0x474c22){return BPromise[_0xd4f0('0x1e')](_0x474c22);}return _0x5af067['save']();};}function saveUpdates(_0x2c2bd5,_0x31c7a0){return function(_0x655480){if(_0x655480){return _0x655480['update'](_0x2c2bd5)[_0xd4f0('0x1f')](function(_0x174e52){return _0x174e52;});}return null;};}function removeEntity(_0xe85527,_0x143aee){return function(_0x4fd650){if(_0x4fd650){return _0x4fd650[_0xd4f0('0x20')]()[_0xd4f0('0x1f')](function(){_0xe85527[_0xd4f0('0x14')](0xcc)[_0xd4f0('0x15')]();});}};}function handleEntityNotFound(_0x5f4858,_0x37e8a1){return function(_0x49b94b){if(!_0x49b94b){_0x5f4858[_0xd4f0('0x13')](0x194);}return _0x49b94b;};}function handleError(_0x1135aa,_0x7552ec){_0x7552ec=_0x7552ec||0x1f4;return function(_0x22d385){logger[_0xd4f0('0x21')](_0x22d385[_0xd4f0('0x22')]);if(_0x22d385[_0xd4f0('0x23')]){delete _0x22d385[_0xd4f0('0x23')];}_0x1135aa[_0xd4f0('0x14')](_0x7552ec)[_0xd4f0('0x24')](_0x22d385);};}exports[_0xd4f0('0x25')]=function(_0x4ea8aa,_0x13a3c2){var _0xa77559={},_0x45661a={},_0x1a2466={'count':0x0,'rows':[]};var _0x54cb05=_[_0xd4f0('0x26')](db[_0xd4f0('0x27')][_0xd4f0('0x28')],function(_0x40da73){return{'name':_0x40da73['fieldName'],'type':_0x40da73[_0xd4f0('0x29')][_0xd4f0('0x2a')]};});_0x45661a[_0xd4f0('0x2b')]=_[_0xd4f0('0x26')](_0x54cb05,'name');_0x45661a[_0xd4f0('0x2c')]=_[_0xd4f0('0x2d')](_0x4ea8aa[_0xd4f0('0x2c')]);_0x45661a[_0xd4f0('0x2e')]=_[_0xd4f0('0x2f')](_0x45661a[_0xd4f0('0x2b')],_0x45661a[_0xd4f0('0x2c')]);_0xa77559[_0xd4f0('0x30')]=_[_0xd4f0('0x2f')](_0x45661a[_0xd4f0('0x2b')],qs[_0xd4f0('0x31')](_0x4ea8aa['query'][_0xd4f0('0x31')]));_0xa77559[_0xd4f0('0x30')]=_0xa77559[_0xd4f0('0x30')][_0xd4f0('0x32')]?_0xa77559[_0xd4f0('0x30')]:_0x45661a['model'];if(!_0x4ea8aa[_0xd4f0('0x2c')][_0xd4f0('0x33')]('nolimit')){_0xa77559[_0xd4f0('0x17')]=qs[_0xd4f0('0x17')](_0x4ea8aa[_0xd4f0('0x2c')]['limit']);_0xa77559[_0xd4f0('0x1a')]=qs['offset'](_0x4ea8aa['query']['offset']);}_0xa77559[_0xd4f0('0x34')]=qs[_0xd4f0('0x35')](_0x4ea8aa[_0xd4f0('0x2c')][_0xd4f0('0x35')]);_0xa77559[_0xd4f0('0x36')]=qs['filters'](_['pick'](_0x4ea8aa[_0xd4f0('0x2c')],_0x45661a[_0xd4f0('0x2e')]),_0x54cb05);if(_0x4ea8aa[_0xd4f0('0x2c')]['filter']){_0xa77559[_0xd4f0('0x36')]=_[_0xd4f0('0x37')](_0xa77559[_0xd4f0('0x36')],{'$or':_['map'](_0x54cb05,function(_0x42d518){if(_0x42d518['type']!==_0xd4f0('0x38')){var _0x301a85={};_0x301a85[_0x42d518[_0xd4f0('0x23')]]={'$like':'%'+_0x4ea8aa[_0xd4f0('0x2c')][_0xd4f0('0x39')]+'%'};return _0x301a85;}})});}_0xa77559=_[_0xd4f0('0x37')]({},_0xa77559,_0x4ea8aa['options']);var _0x492f27={'where':_0xa77559[_0xd4f0('0x36')]};return db[_0xd4f0('0x27')]['count'](_0x492f27)[_0xd4f0('0x1f')](function(_0x24dacc){_0x1a2466[_0xd4f0('0x19')]=_0x24dacc;if(_0x4ea8aa[_0xd4f0('0x2c')][_0xd4f0('0x3a')]){_0xa77559[_0xd4f0('0x3b')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xd4f0('0x3c')](_0xa77559);})[_0xd4f0('0x1f')](function(_0x2e59e4){_0x1a2466[_0xd4f0('0x3d')]=_0x2e59e4;return _0x1a2466;})[_0xd4f0('0x1f')](respondWithFilteredResult(_0x13a3c2,_0xa77559))[_0xd4f0('0x3e')](handleError(_0x13a3c2,null));};exports['show']=function(_0x290191,_0x16f52a){var _0x4c323d={'raw':!![],'where':{'id':_0x290191[_0xd4f0('0x3f')]['id']}},_0x50ccda={};_0x50ccda[_0xd4f0('0x2b')]=_[_0xd4f0('0x2d')](db['ChatQueueReport']['rawAttributes']);_0x50ccda[_0xd4f0('0x2c')]=_[_0xd4f0('0x2d')](_0x290191[_0xd4f0('0x2c')]);_0x50ccda[_0xd4f0('0x2e')]=_[_0xd4f0('0x2f')](_0x50ccda[_0xd4f0('0x2b')],_0x50ccda[_0xd4f0('0x2c')]);_0x4c323d[_0xd4f0('0x30')]=_[_0xd4f0('0x2f')](_0x50ccda[_0xd4f0('0x2b')],qs[_0xd4f0('0x31')](_0x290191[_0xd4f0('0x2c')][_0xd4f0('0x31')]));_0x4c323d['attributes']=_0x4c323d[_0xd4f0('0x30')]['length']?_0x4c323d[_0xd4f0('0x30')]:_0x50ccda['model'];if(_0x290191[_0xd4f0('0x2c')][_0xd4f0('0x3a')]){_0x4c323d[_0xd4f0('0x3b')]=[{'all':!![]}];}_0x4c323d=_['merge']({},_0x4c323d,_0x290191[_0xd4f0('0x40')]);return db[_0xd4f0('0x27')]['find'](_0x4c323d)[_0xd4f0('0x1f')](handleEntityNotFound(_0x16f52a,null))['then'](respondWithResult(_0x16f52a,null))[_0xd4f0('0x3e')](handleError(_0x16f52a,null));};exports[_0xd4f0('0x41')]=function(_0x4a9078,_0x47ec60){return db[_0xd4f0('0x27')][_0xd4f0('0x41')](_0x4a9078[_0xd4f0('0x42')],{})[_0xd4f0('0x1f')](respondWithResult(_0x47ec60,0xc9))[_0xd4f0('0x3e')](handleError(_0x47ec60,null));};exports[_0xd4f0('0x43')]=function(_0x42f52d,_0x63d99){if(_0x42f52d[_0xd4f0('0x42')]['id']){delete _0x42f52d[_0xd4f0('0x42')]['id'];}return db[_0xd4f0('0x27')]['find']({'where':{'id':_0x42f52d[_0xd4f0('0x3f')]['id']}})[_0xd4f0('0x1f')](handleEntityNotFound(_0x63d99,null))[_0xd4f0('0x1f')](saveUpdates(_0x42f52d[_0xd4f0('0x42')],null))[_0xd4f0('0x1f')](respondWithResult(_0x63d99,null))['catch'](handleError(_0x63d99,null));};exports[_0xd4f0('0x20')]=function(_0x353f82,_0x44b92b){return db[_0xd4f0('0x27')][_0xd4f0('0x44')]({'where':{'id':_0x353f82[_0xd4f0('0x3f')]['id']}})[_0xd4f0('0x1f')](handleEntityNotFound(_0x44b92b,null))[_0xd4f0('0x1f')](removeEntity(_0x44b92b,null))[_0xd4f0('0x3e')](handleError(_0x44b92b,null));};exports[_0xd4f0('0x45')]=function(_0x2625b6,_0x2c7530){return db[_0xd4f0('0x27')][_0xd4f0('0x45')]()[_0xd4f0('0x1f')](respondWithResult(_0x2c7530,null))['catch'](handleError(_0x2c7530,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 987ec24..5b31621 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x12f4fc,_0x47ff54){var _0x297cb8=function(_0x5a680c){while(--_0x5a680c){_0x12f4fc['push'](_0x12f4fc['shift']());}};_0x297cb8(++_0x47ff54);}(_0x757a,0xde));var _0xa757=function(_0xbfeba3,_0x215f24){_0xbfeba3=_0xbfeba3-0x0;var _0xf1962a=_0x757a[_0xbfeba3];return _0xf1962a;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x30cbf0,_0x3bbafc){var _0x40afe6=function(_0xbeda58){while(--_0xbeda58){_0x30cbf0['push'](_0x30cbf0['shift']());}};_0x40afe6(++_0x3bbafc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 742c5f8..1592a22 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 _0x5066=['client','http','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','body','raw','options','where','attributes','UpdateChatQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30b8d5,_0x390f2a){var _0x47fc21=function(_0x4cbb1a){while(--_0x4cbb1a){_0x30b8d5['push'](_0x30b8d5['shift']());}};_0x47fc21(++_0x390f2a);}(_0x5066,0x1a3));var _0x6506=function(_0x5b0f89,_0x303a8b){_0x5b0f89=_0x5b0f89-0x0;var _0x21ae25=_0x5066[_0x5b0f89];return _0x21ae25;};'use strict';var _=require(_0x6506('0x0'));var util=require(_0x6506('0x1'));var moment=require('moment');var BPromise=require(_0x6506('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6506('0x3'));var db=require(_0x6506('0x4'))['db'];var utils=require(_0x6506('0x5'));var logger=require(_0x6506('0x6'))(_0x6506('0x7'));var config=require(_0x6506('0x8'));var jayson=require(_0x6506('0x9'));var client=jayson[_0x6506('0xa')][_0x6506('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ddced,_0x4a3191,_0x4cc9ab){return new BPromise(function(_0x5ca913,_0x374718){return client[_0x6506('0xc')](_0x1ddced,_0x4cc9ab)[_0x6506('0xd')](function(_0x276d86){logger[_0x6506('0xe')](_0x6506('0xf'),_0x4a3191,_0x6506('0x10'));logger[_0x6506('0x11')](_0x6506('0x12'),_0x4a3191,_0x6506('0x10'),JSON[_0x6506('0x13')](_0x276d86));if(_0x276d86[_0x6506('0x14')]){if(_0x276d86[_0x6506('0x14')]['code']===0x1f4){logger['error'](_0x6506('0xf'),_0x4a3191,_0x276d86[_0x6506('0x14')][_0x6506('0x15')]);return _0x374718(_0x276d86['error'][_0x6506('0x15')]);}logger['error'](_0x6506('0xf'),_0x4a3191,_0x276d86[_0x6506('0x14')]['message']);return _0x5ca913(_0x276d86[_0x6506('0x14')][_0x6506('0x15')]);}else{logger[_0x6506('0xe')](_0x6506('0xf'),_0x4a3191,_0x6506('0x10'));_0x5ca913(_0x276d86[_0x6506('0x16')][_0x6506('0x15')]);}})[_0x6506('0x17')](function(_0x2b59fd){logger[_0x6506('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x4a3191,_0x2b59fd);_0x374718(_0x2b59fd);});});}exports[_0x6506('0x18')]=function(_0x429396){var _0x2dc91b=this;return new Promise(function(_0x59f433,_0x5517d3){return db[_0x6506('0x19')][_0x6506('0x1a')](_0x429396[_0x6506('0x1b')],{'raw':_0x429396['options']?_0x429396['options'][_0x6506('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x51572c){logger[_0x6506('0xe')](_0x6506('0x18'),_0x429396);logger[_0x6506('0x11')](_0x6506('0x18'),_0x429396,JSON[_0x6506('0x13')](_0x51572c));_0x59f433(_0x51572c);})[_0x6506('0x17')](function(_0x1c37fa){logger[_0x6506('0x14')](_0x6506('0x18'),_0x1c37fa[_0x6506('0x15')],_0x429396);_0x5517d3(_0x2dc91b[_0x6506('0x14')](0x1f4,_0x1c37fa[_0x6506('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x3bc6b5){var _0x2b4437=this;return new Promise(function(_0x477805,_0x3e6d7a){return db[_0x6506('0x19')]['update'](_0x3bc6b5[_0x6506('0x1b')],{'raw':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1e')]||null:null,'attributes':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1f')]||null:null,'limit':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')]['limit']||null:null})[_0x6506('0xd')](function(_0x5986b6){logger['info'](_0x6506('0x20'),_0x3bc6b5);logger[_0x6506('0x11')](_0x6506('0x20'),_0x3bc6b5,JSON[_0x6506('0x13')](_0x5986b6));_0x477805(_0x5986b6);})[_0x6506('0x17')](function(_0xed9a88){logger[_0x6506('0x14')](_0x6506('0x20'),_0xed9a88['message'],_0x3bc6b5);_0x3e6d7a(_0x2b4437['error'](0x1f4,_0xed9a88[_0x6506('0x15')]));});});}; \ No newline at end of file +var _0x5525=['code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','update','attributes','limit','UpdateChatQueueReport','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3e435a,_0x6dd0de){var _0x419ed0=function(_0x236f69){while(--_0x236f69){_0x3e435a['push'](_0x3e435a['shift']());}};_0x419ed0(++_0x6dd0de);}(_0x5525,0x87));var _0x5552=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5525[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var moment=require(_0x5552('0x2'));var BPromise=require(_0x5552('0x3'));var rs=require(_0x5552('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5552('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5552('0x6'));var jayson=require(_0x5552('0x7'));var client=jayson['client'][_0x5552('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1af266,_0x230857,_0x4ab86c){return new BPromise(function(_0x435989,_0x5746d9){return client[_0x5552('0x9')](_0x1af266,_0x4ab86c)[_0x5552('0xa')](function(_0x2e692d){logger[_0x5552('0xb')](_0x5552('0xc'),_0x230857,_0x5552('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x230857,_0x5552('0xd'),JSON['stringify'](_0x2e692d));if(_0x2e692d[_0x5552('0xe')]){if(_0x2e692d['error'][_0x5552('0xf')]===0x1f4){logger[_0x5552('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x230857,_0x2e692d[_0x5552('0xe')][_0x5552('0x10')]);return _0x5746d9(_0x2e692d['error']['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x230857,_0x2e692d['error']['message']);return _0x435989(_0x2e692d['error'][_0x5552('0x10')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x230857,_0x5552('0xd'));_0x435989(_0x2e692d['result']['message']);}})[_0x5552('0x11')](function(_0x4d1ba7){logger[_0x5552('0xe')](_0x5552('0xc'),_0x230857,_0x4d1ba7);_0x5746d9(_0x4d1ba7);});});}exports[_0x5552('0x12')]=function(_0x5325df){var _0x449aa3=this;return new Promise(function(_0x3b16e6,_0x3b12f6){return db[_0x5552('0x13')][_0x5552('0x14')](_0x5325df[_0x5552('0x15')],{'raw':_0x5325df[_0x5552('0x16')]?_0x5325df[_0x5552('0x16')][_0x5552('0x17')]===undefined?!![]:![]:!![]})[_0x5552('0xa')](function(_0xd6c510){logger[_0x5552('0xb')](_0x5552('0x12'),_0x5325df);logger[_0x5552('0x18')](_0x5552('0x12'),_0x5325df,JSON['stringify'](_0xd6c510));_0x3b16e6(_0xd6c510);})[_0x5552('0x11')](function(_0x333806){logger[_0x5552('0xe')](_0x5552('0x12'),_0x333806['message'],_0x5325df);_0x3b12f6(_0x449aa3[_0x5552('0xe')](0x1f4,_0x333806[_0x5552('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x404e00){var _0x1bcbd2=this;return new Promise(function(_0x4cecb0,_0x2bad0a){return db[_0x5552('0x13')][_0x5552('0x19')](_0x404e00[_0x5552('0x15')],{'raw':_0x404e00['options']?_0x404e00[_0x5552('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x404e00[_0x5552('0x16')]?_0x404e00[_0x5552('0x16')]['where']||null:null,'attributes':_0x404e00[_0x5552('0x16')]?_0x404e00['options'][_0x5552('0x1a')]||null:null,'limit':_0x404e00[_0x5552('0x16')]?_0x404e00[_0x5552('0x16')][_0x5552('0x1b')]||null:null})['then'](function(_0x7a298f){logger[_0x5552('0xb')]('UpdateChatQueueReport',_0x404e00);logger[_0x5552('0x18')](_0x5552('0x1c'),_0x404e00,JSON[_0x5552('0x1d')](_0x7a298f));_0x4cecb0(_0x7a298f);})[_0x5552('0x11')](function(_0x135d7a){logger[_0x5552('0xe')](_0x5552('0x1c'),_0x135d7a[_0x5552('0x10')],_0x404e00);_0x2bad0a(_0x1bcbd2[_0x5552('0xe')](0x1f4,_0x135d7a[_0x5552('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index e1336c1..6f5af8d 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 _0xbe44=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x579e76,_0x13b9fe){var _0x532e25=function(_0x42cd6d){while(--_0x42cd6d){_0x579e76['push'](_0x579e76['shift']());}};_0x532e25(++_0x13b9fe);}(_0xbe44,0x175));var _0x4be4=function(_0x511d5c,_0x4d44a0){_0x511d5c=_0x511d5c-0x0;var _0x128d3b=_0xbe44[_0x511d5c];return _0x128d3b;};'use strict';var multer=require(_0x4be4('0x0'));var util=require('util');var path=require(_0x4be4('0x1'));var timeout=require(_0x4be4('0x2'));var express=require(_0x4be4('0x3'));var router=express[_0x4be4('0x4')]();var fs_extra=require(_0x4be4('0x5'));var auth=require(_0x4be4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4be4('0x7'));var controller=require(_0x4be4('0x8'));router[_0x4be4('0x9')]('/',auth['isAuthenticated'](),controller[_0x4be4('0xa')]);router[_0x4be4('0x9')](_0x4be4('0xb'),auth[_0x4be4('0xc')](),controller['describe']);router[_0x4be4('0x9')](_0x4be4('0xd'),auth[_0x4be4('0xc')](),controller[_0x4be4('0xe')]);router[_0x4be4('0xf')]('/',auth[_0x4be4('0xc')](),controller[_0x4be4('0x10')]);router[_0x4be4('0x11')](_0x4be4('0xd'),auth['isAuthenticated'](),controller[_0x4be4('0x12')]);router[_0x4be4('0x13')](_0x4be4('0xd'),auth[_0x4be4('0xc')](),controller[_0x4be4('0x14')]);module[_0x4be4('0x15')]=router; \ No newline at end of file +var _0xead7=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','multer'];(function(_0x4b6feb,_0x158c73){var _0x749123=function(_0x1ba59f){while(--_0x1ba59f){_0x4b6feb['push'](_0x4b6feb['shift']());}};_0x749123(++_0x158c73);}(_0xead7,0x71));var _0x7ead=function(_0x3d8dc6,_0x593cb4){_0x3d8dc6=_0x3d8dc6-0x0;var _0x7204d7=_0xead7[_0x3d8dc6];return _0x7204d7;};'use strict';var multer=require(_0x7ead('0x0'));var util=require(_0x7ead('0x1'));var path=require(_0x7ead('0x2'));var timeout=require(_0x7ead('0x3'));var express=require(_0x7ead('0x4'));var router=express[_0x7ead('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7ead('0x6'));var interaction=require(_0x7ead('0x7'));var config=require(_0x7ead('0x8'));var controller=require(_0x7ead('0x9'));router[_0x7ead('0xa')]('/',auth[_0x7ead('0xb')](),controller[_0x7ead('0xc')]);router[_0x7ead('0xa')](_0x7ead('0xd'),auth['isAuthenticated'](),controller[_0x7ead('0xe')]);router[_0x7ead('0xa')](_0x7ead('0xf'),auth[_0x7ead('0xb')](),controller[_0x7ead('0x10')]);router[_0x7ead('0x11')]('/',auth[_0x7ead('0xb')](),controller['create']);router['put'](_0x7ead('0xf'),auth['isAuthenticated'](),controller[_0x7ead('0x12')]);router['delete'](_0x7ead('0xf'),auth[_0x7ead('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index ee3e7d5..9c1e8a8 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(_0xf3d3d,_0x18c710){var _0x1e5511=function(_0x2b25e9){while(--_0x2b25e9){_0xf3d3d['push'](_0xf3d3d['shift']());}};_0x1e5511(++_0x18c710);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x2866c7,_0x197fdd){var _0x3c5db2=function(_0x5f40db){while(--_0x5f40db){_0x2866c7['push'](_0x2866c7['shift']());}};_0x3c5db2(++_0x197fdd);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index af981bb..678a2c2 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 _0x7f07=['model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','count','offset','limit','status','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7f07,0x1d0));var _0x77f0=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0x7f07[_0x32f6b9];return _0x267d52;};'use strict';var emlformat=require(_0x77f0('0x0'));var rimraf=require(_0x77f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77f0('0x2'));var rp=require(_0x77f0('0x3'));var moment=require(_0x77f0('0x4'));var BPromise=require(_0x77f0('0x5'));var Mustache=require(_0x77f0('0x6'));var util=require(_0x77f0('0x7'));var path=require('path');var sox=require(_0x77f0('0x8'));var csv=require(_0x77f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77f0('0xa'));var _=require(_0x77f0('0xb'));var squel=require(_0x77f0('0xc'));var crypto=require(_0x77f0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x77f0('0x9'));var querystring=require(_0x77f0('0xe'));var Papa=require(_0x77f0('0xf'));var Redis=require(_0x77f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77f0('0x11'));var as=require(_0x77f0('0x12'));var hardwareService=require(_0x77f0('0x13'));var logger=require(_0x77f0('0x14'))(_0x77f0('0x15'));var utils=require(_0x77f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x77f0('0x17'));var db=require(_0x77f0('0x18'))['db'];function respondWithStatusCode(_0xe6402c,_0x55cec6){_0x55cec6=_0x55cec6||0xcc;return function(_0xb8a810){if(_0xb8a810){return _0xe6402c['sendStatus'](_0x55cec6);}return _0xe6402c['status'](_0x55cec6)[_0x77f0('0x19')]();};}function respondWithResult(_0x27329b,_0x335e53){_0x335e53=_0x335e53||0xc8;return function(_0x20de43){if(_0x20de43){return _0x27329b['status'](_0x335e53)[_0x77f0('0x1a')](_0x20de43);}};}function respondWithFilteredResult(_0x2474b5,_0xf74c3){return function(_0x281ea2){if(_0x281ea2){var _0xfc507=typeof _0xf74c3['offset']==='undefined'&&typeof _0xf74c3['limit']===_0x77f0('0x1b');var _0x313fd8=_0x281ea2[_0x77f0('0x1c')];var _0x4b4053=_0xfc507?0x0:_0xf74c3[_0x77f0('0x1d')];var _0x4759a4=_0xfc507?_0x281ea2['count']:_0xf74c3[_0x77f0('0x1d')]+_0xf74c3[_0x77f0('0x1e')];var _0x44d9f3;if(_0x4759a4>=_0x313fd8){_0x4759a4=_0x313fd8;_0x44d9f3=0xc8;}else{_0x44d9f3=0xce;}_0x2474b5[_0x77f0('0x1f')](_0x44d9f3);return _0x2474b5['set'](_0x77f0('0x20'),_0x4b4053+'-'+_0x4759a4+'/'+_0x313fd8)[_0x77f0('0x1a')](_0x281ea2);}return null;};}function patchUpdates(_0x39b252){return function(_0x1d9142){try{jsonpatch['apply'](_0x1d9142,_0x39b252,!![]);}catch(_0xffb21f){return BPromise[_0x77f0('0x21')](_0xffb21f);}return _0x1d9142[_0x77f0('0x22')]();};}function saveUpdates(_0x202c3e,_0x5acb54){return function(_0x42930b){if(_0x42930b){return _0x42930b[_0x77f0('0x23')](_0x202c3e)['then'](function(_0x25e23e){return _0x25e23e;});}return null;};}function removeEntity(_0x5d0223,_0x14dbec){return function(_0x5e3b1f){if(_0x5e3b1f){return _0x5e3b1f[_0x77f0('0x24')]()[_0x77f0('0x25')](function(){_0x5d0223[_0x77f0('0x1f')](0xcc)[_0x77f0('0x19')]();});}};}function handleEntityNotFound(_0x57f4e2,_0x373fea){return function(_0x3cc93e){if(!_0x3cc93e){_0x57f4e2[_0x77f0('0x26')](0x194);}return _0x3cc93e;};}function handleError(_0x91400f,_0xa4629){_0xa4629=_0xa4629||0x1f4;return function(_0x5ec4b3){logger['error'](_0x5ec4b3[_0x77f0('0x27')]);if(_0x5ec4b3[_0x77f0('0x28')]){delete _0x5ec4b3['name'];}_0x91400f['status'](_0xa4629)[_0x77f0('0x29')](_0x5ec4b3);};}exports[_0x77f0('0x2a')]=function(_0x4bc0ce,_0x132221){var _0x1c3713={},_0x1a1668={},_0x448a20={'count':0x0,'rows':[]};var _0x1d6ce6=_[_0x77f0('0x2b')](db[_0x77f0('0x2c')][_0x77f0('0x2d')],function(_0x55df40){return{'name':_0x55df40[_0x77f0('0x2e')],'type':_0x55df40['type']['key']};});_0x1a1668[_0x77f0('0x2f')]=_['map'](_0x1d6ce6,'name');_0x1a1668[_0x77f0('0x30')]=_[_0x77f0('0x31')](_0x4bc0ce[_0x77f0('0x30')]);_0x1a1668[_0x77f0('0x32')]=_[_0x77f0('0x33')](_0x1a1668[_0x77f0('0x2f')],_0x1a1668[_0x77f0('0x30')]);_0x1c3713[_0x77f0('0x34')]=_[_0x77f0('0x33')](_0x1a1668[_0x77f0('0x2f')],qs['fields'](_0x4bc0ce[_0x77f0('0x30')]['fields']));_0x1c3713['attributes']=_0x1c3713[_0x77f0('0x34')][_0x77f0('0x35')]?_0x1c3713['attributes']:_0x1a1668['model'];if(!_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x36')](_0x77f0('0x37'))){_0x1c3713[_0x77f0('0x1e')]=qs['limit'](_0x4bc0ce[_0x77f0('0x30')]['limit']);_0x1c3713[_0x77f0('0x1d')]=qs['offset'](_0x4bc0ce[_0x77f0('0x30')]['offset']);}_0x1c3713[_0x77f0('0x38')]=qs[_0x77f0('0x39')](_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x39')]);_0x1c3713[_0x77f0('0x3a')]=qs['filters'](_['pick'](_0x4bc0ce[_0x77f0('0x30')],_0x1a1668['filters']),_0x1d6ce6);if(_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3b')]){_0x1c3713[_0x77f0('0x3a')]=_[_0x77f0('0x3c')](_0x1c3713[_0x77f0('0x3a')],{'$or':_[_0x77f0('0x2b')](_0x1d6ce6,function(_0x532907){if(_0x532907[_0x77f0('0x3d')]!==_0x77f0('0x3e')){var _0x190fd5={};_0x190fd5[_0x532907['name']]={'$like':'%'+_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3b')]+'%'};return _0x190fd5;}})});}_0x1c3713=_[_0x77f0('0x3c')]({},_0x1c3713,_0x4bc0ce['options']);var _0x42b81a={'where':_0x1c3713[_0x77f0('0x3a')]};return db[_0x77f0('0x2c')]['count'](_0x42b81a)['then'](function(_0x4e93e4){_0x448a20[_0x77f0('0x1c')]=_0x4e93e4;if(_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3f')]){_0x1c3713['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x77f0('0x40')](_0x1c3713);})[_0x77f0('0x25')](function(_0x104289){_0x448a20['rows']=_0x104289;return _0x448a20;})[_0x77f0('0x25')](respondWithFilteredResult(_0x132221,_0x1c3713))[_0x77f0('0x41')](handleError(_0x132221,null));};exports['show']=function(_0x362341,_0x2b03d){var _0x5815ed={'raw':!![],'where':{'id':_0x362341[_0x77f0('0x42')]['id']}},_0x27082c={};_0x27082c['model']=_['keys'](db[_0x77f0('0x2c')][_0x77f0('0x2d')]);_0x27082c[_0x77f0('0x30')]=_[_0x77f0('0x31')](_0x362341['query']);_0x27082c['filters']=_['intersection'](_0x27082c[_0x77f0('0x2f')],_0x27082c[_0x77f0('0x30')]);_0x5815ed[_0x77f0('0x34')]=_[_0x77f0('0x33')](_0x27082c[_0x77f0('0x2f')],qs['fields'](_0x362341[_0x77f0('0x30')][_0x77f0('0x43')]));_0x5815ed['attributes']=_0x5815ed[_0x77f0('0x34')][_0x77f0('0x35')]?_0x5815ed[_0x77f0('0x34')]:_0x27082c[_0x77f0('0x2f')];if(_0x362341['query'][_0x77f0('0x3f')]){_0x5815ed['include']=[{'all':!![]}];}_0x5815ed=_[_0x77f0('0x3c')]({},_0x5815ed,_0x362341[_0x77f0('0x44')]);return db[_0x77f0('0x2c')][_0x77f0('0x45')](_0x5815ed)[_0x77f0('0x25')](handleEntityNotFound(_0x2b03d,null))[_0x77f0('0x25')](respondWithResult(_0x2b03d,null))[_0x77f0('0x41')](handleError(_0x2b03d,null));};exports[_0x77f0('0x46')]=function(_0x253f68,_0x18588c){return db[_0x77f0('0x2c')][_0x77f0('0x46')](_0x253f68[_0x77f0('0x47')],{})['then'](respondWithResult(_0x18588c,0xc9))[_0x77f0('0x41')](handleError(_0x18588c,null));};exports[_0x77f0('0x23')]=function(_0x9a1a76,_0x3413aa){if(_0x9a1a76[_0x77f0('0x47')]['id']){delete _0x9a1a76[_0x77f0('0x47')]['id'];}return db['ChatTransferReport'][_0x77f0('0x45')]({'where':{'id':_0x9a1a76[_0x77f0('0x42')]['id']}})[_0x77f0('0x25')](handleEntityNotFound(_0x3413aa,null))['then'](saveUpdates(_0x9a1a76[_0x77f0('0x47')],null))[_0x77f0('0x25')](respondWithResult(_0x3413aa,null))[_0x77f0('0x41')](handleError(_0x3413aa,null));};exports[_0x77f0('0x24')]=function(_0x40ffdd,_0x5e8979){return db['ChatTransferReport']['find']({'where':{'id':_0x40ffdd[_0x77f0('0x42')]['id']}})[_0x77f0('0x25')](handleEntityNotFound(_0x5e8979,null))['then'](removeEntity(_0x5e8979,null))[_0x77f0('0x41')](handleError(_0x5e8979,null));};exports[_0x77f0('0x48')]=function(_0x5bd32a,_0x22001c){return db[_0x77f0('0x2c')][_0x77f0('0x48')]()['then'](respondWithResult(_0x22001c,null))['catch'](handleError(_0x22001c,null));}; \ No newline at end of file +var _0x25e4=['fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','keys','options','find','catch','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','apply','save','update','then','destroy','end','name','send','ChatTransferReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes'];(function(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0x25e4,0xe8));var _0x425e=function(_0x4f22f0,_0x40db65){_0x4f22f0=_0x4f22f0-0x0;var _0x51cd87=_0x25e4[_0x4f22f0];return _0x51cd87;};'use strict';var emlformat=require(_0x425e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x425e('0x1'));var rp=require(_0x425e('0x2'));var moment=require(_0x425e('0x3'));var BPromise=require(_0x425e('0x4'));var Mustache=require(_0x425e('0x5'));var util=require(_0x425e('0x6'));var path=require(_0x425e('0x7'));var sox=require(_0x425e('0x8'));var csv=require(_0x425e('0x9'));var ejs=require(_0x425e('0xa'));var fs=require('fs');var fs_extra=require(_0x425e('0xb'));var _=require(_0x425e('0xc'));var squel=require(_0x425e('0xd'));var crypto=require('crypto');var jsforce=require(_0x425e('0xe'));var deskjs=require(_0x425e('0xf'));var toCsv=require(_0x425e('0x9'));var querystring=require(_0x425e('0x10'));var Papa=require(_0x425e('0x11'));var Redis=require(_0x425e('0x12'));var authService=require(_0x425e('0x13'));var qs=require(_0x425e('0x14'));var as=require(_0x425e('0x15'));var hardwareService=require(_0x425e('0x16'));var logger=require('../../config/logger')(_0x425e('0x17'));var utils=require(_0x425e('0x18'));var config=require(_0x425e('0x19'));var licenseUtil=require(_0x425e('0x1a'));var db=require(_0x425e('0x1b'))['db'];function respondWithStatusCode(_0x263e32,_0x2c5e23){_0x2c5e23=_0x2c5e23||0xcc;return function(_0x2e1825){if(_0x2e1825){return _0x263e32['sendStatus'](_0x2c5e23);}return _0x263e32[_0x425e('0x1c')](_0x2c5e23)['end']();};}function respondWithResult(_0x363ccb,_0x5ae77b){_0x5ae77b=_0x5ae77b||0xc8;return function(_0x4f29ee){if(_0x4f29ee){return _0x363ccb[_0x425e('0x1c')](_0x5ae77b)[_0x425e('0x1d')](_0x4f29ee);}};}function respondWithFilteredResult(_0x223784,_0x65c413){return function(_0x3fadca){if(_0x3fadca){var _0x5888ec=typeof _0x65c413['offset']===_0x425e('0x1e')&&typeof _0x65c413[_0x425e('0x1f')]===_0x425e('0x1e');var _0x341e28=_0x3fadca[_0x425e('0x20')];var _0x3a9b68=_0x5888ec?0x0:_0x65c413[_0x425e('0x21')];var _0x1767f4=_0x5888ec?_0x3fadca[_0x425e('0x20')]:_0x65c413[_0x425e('0x21')]+_0x65c413[_0x425e('0x1f')];var _0x14fe2a;if(_0x1767f4>=_0x341e28){_0x1767f4=_0x341e28;_0x14fe2a=0xc8;}else{_0x14fe2a=0xce;}_0x223784['status'](_0x14fe2a);return _0x223784['set']('Content-Range',_0x3a9b68+'-'+_0x1767f4+'/'+_0x341e28)[_0x425e('0x1d')](_0x3fadca);}return null;};}function patchUpdates(_0x314e1f){return function(_0x315e9f){try{jsonpatch[_0x425e('0x22')](_0x315e9f,_0x314e1f,!![]);}catch(_0x1f52c9){return BPromise['reject'](_0x1f52c9);}return _0x315e9f[_0x425e('0x23')]();};}function saveUpdates(_0x58fa7f,_0x14336b){return function(_0xe60038){if(_0xe60038){return _0xe60038[_0x425e('0x24')](_0x58fa7f)[_0x425e('0x25')](function(_0x233700){return _0x233700;});}return null;};}function removeEntity(_0x532a5b,_0x41de84){return function(_0x307ce9){if(_0x307ce9){return _0x307ce9[_0x425e('0x26')]()[_0x425e('0x25')](function(){_0x532a5b[_0x425e('0x1c')](0xcc)[_0x425e('0x27')]();});}};}function handleEntityNotFound(_0x5f23a4,_0x486c64){return function(_0x168cb3){if(!_0x168cb3){_0x5f23a4['sendStatus'](0x194);}return _0x168cb3;};}function handleError(_0x15e831,_0x2976d3){_0x2976d3=_0x2976d3||0x1f4;return function(_0x76e66a){logger['error'](_0x76e66a['stack']);if(_0x76e66a[_0x425e('0x28')]){delete _0x76e66a[_0x425e('0x28')];}_0x15e831[_0x425e('0x1c')](_0x2976d3)[_0x425e('0x29')](_0x76e66a);};}exports['index']=function(_0x3ab61e,_0x26586d){var _0x4acdf7={},_0x2dce14={},_0x4792f4={'count':0x0,'rows':[]};var _0x4de9bf=_['map'](db[_0x425e('0x2a')][_0x425e('0x2b')],function(_0x182a58){return{'name':_0x182a58[_0x425e('0x2c')],'type':_0x182a58['type'][_0x425e('0x2d')]};});_0x2dce14[_0x425e('0x2e')]=_[_0x425e('0x2f')](_0x4de9bf,_0x425e('0x28'));_0x2dce14[_0x425e('0x30')]=_['keys'](_0x3ab61e[_0x425e('0x30')]);_0x2dce14[_0x425e('0x31')]=_[_0x425e('0x32')](_0x2dce14['model'],_0x2dce14[_0x425e('0x30')]);_0x4acdf7[_0x425e('0x33')]=_[_0x425e('0x32')](_0x2dce14[_0x425e('0x2e')],qs[_0x425e('0x34')](_0x3ab61e[_0x425e('0x30')][_0x425e('0x34')]));_0x4acdf7[_0x425e('0x33')]=_0x4acdf7[_0x425e('0x33')][_0x425e('0x35')]?_0x4acdf7['attributes']:_0x2dce14[_0x425e('0x2e')];if(!_0x3ab61e['query']['hasOwnProperty']('nolimit')){_0x4acdf7[_0x425e('0x1f')]=qs[_0x425e('0x1f')](_0x3ab61e[_0x425e('0x30')][_0x425e('0x1f')]);_0x4acdf7[_0x425e('0x21')]=qs['offset'](_0x3ab61e[_0x425e('0x30')]['offset']);}_0x4acdf7[_0x425e('0x36')]=qs[_0x425e('0x37')](_0x3ab61e[_0x425e('0x30')][_0x425e('0x37')]);_0x4acdf7[_0x425e('0x38')]=qs[_0x425e('0x31')](_[_0x425e('0x39')](_0x3ab61e['query'],_0x2dce14[_0x425e('0x31')]),_0x4de9bf);if(_0x3ab61e['query'][_0x425e('0x3a')]){_0x4acdf7[_0x425e('0x38')]=_[_0x425e('0x3b')](_0x4acdf7[_0x425e('0x38')],{'$or':_[_0x425e('0x2f')](_0x4de9bf,function(_0xa0bb94){if(_0xa0bb94['type']!==_0x425e('0x3c')){var _0x1d8fc7={};_0x1d8fc7[_0xa0bb94[_0x425e('0x28')]]={'$like':'%'+_0x3ab61e[_0x425e('0x30')]['filter']+'%'};return _0x1d8fc7;}})});}_0x4acdf7=_[_0x425e('0x3b')]({},_0x4acdf7,_0x3ab61e['options']);var _0x459a5c={'where':_0x4acdf7['where']};return db[_0x425e('0x2a')][_0x425e('0x20')](_0x459a5c)[_0x425e('0x25')](function(_0x4b602d){_0x4792f4[_0x425e('0x20')]=_0x4b602d;if(_0x3ab61e[_0x425e('0x30')][_0x425e('0x3d')]){_0x4acdf7['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x425e('0x3e')](_0x4acdf7);})[_0x425e('0x25')](function(_0x3f6b4d){_0x4792f4[_0x425e('0x3f')]=_0x3f6b4d;return _0x4792f4;})[_0x425e('0x25')](respondWithFilteredResult(_0x26586d,_0x4acdf7))['catch'](handleError(_0x26586d,null));};exports['show']=function(_0x197f86,_0x10d535){var _0x11e643={'raw':!![],'where':{'id':_0x197f86[_0x425e('0x40')]['id']}},_0x2256dd={};_0x2256dd[_0x425e('0x2e')]=_['keys'](db[_0x425e('0x2a')][_0x425e('0x2b')]);_0x2256dd[_0x425e('0x30')]=_[_0x425e('0x41')](_0x197f86['query']);_0x2256dd['filters']=_['intersection'](_0x2256dd['model'],_0x2256dd['query']);_0x11e643[_0x425e('0x33')]=_[_0x425e('0x32')](_0x2256dd['model'],qs[_0x425e('0x34')](_0x197f86[_0x425e('0x30')][_0x425e('0x34')]));_0x11e643[_0x425e('0x33')]=_0x11e643[_0x425e('0x33')][_0x425e('0x35')]?_0x11e643[_0x425e('0x33')]:_0x2256dd[_0x425e('0x2e')];if(_0x197f86[_0x425e('0x30')][_0x425e('0x3d')]){_0x11e643['include']=[{'all':!![]}];}_0x11e643=_['merge']({},_0x11e643,_0x197f86[_0x425e('0x42')]);return db[_0x425e('0x2a')][_0x425e('0x43')](_0x11e643)['then'](handleEntityNotFound(_0x10d535,null))['then'](respondWithResult(_0x10d535,null))[_0x425e('0x44')](handleError(_0x10d535,null));};exports['create']=function(_0x2aa4d9,_0x506c2d){return db[_0x425e('0x2a')]['create'](_0x2aa4d9[_0x425e('0x45')],{})[_0x425e('0x25')](respondWithResult(_0x506c2d,0xc9))[_0x425e('0x44')](handleError(_0x506c2d,null));};exports[_0x425e('0x24')]=function(_0xf85488,_0x13d548){if(_0xf85488['body']['id']){delete _0xf85488[_0x425e('0x45')]['id'];}return db[_0x425e('0x2a')]['find']({'where':{'id':_0xf85488[_0x425e('0x40')]['id']}})['then'](handleEntityNotFound(_0x13d548,null))[_0x425e('0x25')](saveUpdates(_0xf85488[_0x425e('0x45')],null))['then'](respondWithResult(_0x13d548,null))[_0x425e('0x44')](handleError(_0x13d548,null));};exports[_0x425e('0x26')]=function(_0x33f8dd,_0x23a0e7){return db['ChatTransferReport'][_0x425e('0x43')]({'where':{'id':_0x33f8dd[_0x425e('0x40')]['id']}})[_0x425e('0x25')](handleEntityNotFound(_0x23a0e7,null))[_0x425e('0x25')](removeEntity(_0x23a0e7,null))[_0x425e('0x44')](handleError(_0x23a0e7,null));};exports['describe']=function(_0x229469,_0xf43d22){return db['ChatTransferReport'][_0x425e('0x46')]()['then'](respondWithResult(_0xf43d22,null))['catch'](handleError(_0xf43d22,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index aca0446..7327ccf 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 _0xe76d=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x307d9f,_0x231547){var _0x59dac4=function(_0x4f50c8){while(--_0x4f50c8){_0x307d9f['push'](_0x307d9f['shift']());}};_0x59dac4(++_0x231547);}(_0xe76d,0x1cb));var _0xde76=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xe76d[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xde76('0x0'));var util=require('util');var logger=require(_0xde76('0x1'))('api');var moment=require(_0xde76('0x2'));var BPromise=require(_0xde76('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde76('0x4'));var rimraf=require(_0xde76('0x5'));var config=require(_0xde76('0x6'));var attributes=require(_0xde76('0x7'));module[_0xde76('0x8')]=function(_0x4dc7aa,_0x39d111){return _0x4dc7aa[_0xde76('0x9')](_0xde76('0xa'),attributes,{'tableName':_0xde76('0xb'),'paranoid':![],'indexes':[{'name':_0xde76('0xc'),'fields':[_0xde76('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc797=['ChatTransferReport','report_chat_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4f98f8,_0x54652e){var _0x3a10e7=function(_0x491d90){while(--_0x491d90){_0x4f98f8['push'](_0x4f98f8['shift']());}};_0x3a10e7(++_0x54652e);}(_0xc797,0x154));var _0x7c79=function(_0x42b885,_0x3fcaf5){_0x42b885=_0x42b885-0x0;var _0x4dcf62=_0xc797[_0x42b885];return _0x4dcf62;};'use strict';var _=require(_0x7c79('0x0'));var util=require(_0x7c79('0x1'));var logger=require(_0x7c79('0x2'))(_0x7c79('0x3'));var moment=require(_0x7c79('0x4'));var BPromise=require(_0x7c79('0x5'));var rp=require(_0x7c79('0x6'));var fs=require('fs');var path=require(_0x7c79('0x7'));var rimraf=require(_0x7c79('0x8'));var config=require(_0x7c79('0x9'));var attributes=require('./chatTransferReport.attributes');module[_0x7c79('0xa')]=function(_0x5a7948,_0x146b36){return _0x5a7948['define'](_0x7c79('0xb'),attributes,{'tableName':_0x7c79('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index f2b7be9..aa87d71 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 _0xa61d=['jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x119739,_0x250ebb){var _0x1fc8e5=function(_0x34eaef){while(--_0x34eaef){_0x119739['push'](_0x119739['shift']());}};_0x1fc8e5(++_0x250ebb);}(_0xa61d,0xfe));var _0xda61=function(_0x8f4ca2,_0xc4ac52){_0x8f4ca2=_0x8f4ca2-0x0;var _0x126663=_0xa61d[_0x8f4ca2];return _0x126663;};'use strict';var _=require(_0xda61('0x0'));var util=require(_0xda61('0x1'));var moment=require(_0xda61('0x2'));var BPromise=require(_0xda61('0x3'));var rs=require(_0xda61('0x4'));var fs=require('fs');var Redis=require(_0xda61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda61('0x6'));var logger=require(_0xda61('0x7'))(_0xda61('0x8'));var config=require(_0xda61('0x9'));var jayson=require(_0xda61('0xa'));var client=jayson['client'][_0xda61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fd5d3,_0x2555bf,_0x7de2b3){return new BPromise(function(_0x2024af,_0x13e822){return client[_0xda61('0xc')](_0x3fd5d3,_0x7de2b3)[_0xda61('0xd')](function(_0x3a1d44){logger[_0xda61('0xe')](_0xda61('0xf'),_0x2555bf,_0xda61('0x10'));logger[_0xda61('0x11')](_0xda61('0x12'),_0x2555bf,_0xda61('0x10'),JSON[_0xda61('0x13')](_0x3a1d44));if(_0x3a1d44[_0xda61('0x14')]){if(_0x3a1d44[_0xda61('0x14')][_0xda61('0x15')]===0x1f4){logger[_0xda61('0x14')](_0xda61('0xf'),_0x2555bf,_0x3a1d44['error'][_0xda61('0x16')]);return _0x13e822(_0x3a1d44[_0xda61('0x14')][_0xda61('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2555bf,_0x3a1d44['error'][_0xda61('0x16')]);return _0x2024af(_0x3a1d44[_0xda61('0x14')][_0xda61('0x16')]);}else{logger[_0xda61('0xe')](_0xda61('0xf'),_0x2555bf,_0xda61('0x10'));_0x2024af(_0x3a1d44['result'][_0xda61('0x16')]);}})[_0xda61('0x17')](function(_0x3c9597){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2555bf,_0x3c9597);_0x13e822(_0x3c9597);});});} \ No newline at end of file +var _0x5b7d=['ChatTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x161f72,_0x30cecf){var _0x12bf8f=function(_0x599063){while(--_0x599063){_0x161f72['push'](_0x161f72['shift']());}};_0x12bf8f(++_0x30cecf);}(_0x5b7d,0x17a));var _0xd5b7=function(_0x41c4fc,_0x48df2e){_0x41c4fc=_0x41c4fc-0x0;var _0x18d3db=_0x5b7d[_0x41c4fc];return _0x18d3db;};'use strict';var _=require('lodash');var util=require(_0xd5b7('0x0'));var moment=require(_0xd5b7('0x1'));var BPromise=require(_0xd5b7('0x2'));var rs=require(_0xd5b7('0x3'));var fs=require('fs');var Redis=require(_0xd5b7('0x4'));var db=require(_0xd5b7('0x5'))['db'];var utils=require(_0xd5b7('0x6'));var logger=require(_0xd5b7('0x7'))(_0xd5b7('0x8'));var config=require(_0xd5b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd5b7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bbbb5,_0x27e2a9,_0x212537){return new BPromise(function(_0x12cd4f,_0x55d7c2){return client['request'](_0x1bbbb5,_0x212537)['then'](function(_0x5ac16f){logger[_0xd5b7('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x27e2a9,_0xd5b7('0xc'));logger[_0xd5b7('0xd')](_0xd5b7('0xe'),_0x27e2a9,_0xd5b7('0xc'),JSON[_0xd5b7('0xf')](_0x5ac16f));if(_0x5ac16f[_0xd5b7('0x10')]){if(_0x5ac16f[_0xd5b7('0x10')][_0xd5b7('0x11')]===0x1f4){logger['error'](_0xd5b7('0x12'),_0x27e2a9,_0x5ac16f[_0xd5b7('0x10')][_0xd5b7('0x13')]);return _0x55d7c2(_0x5ac16f[_0xd5b7('0x10')][_0xd5b7('0x13')]);}logger['error'](_0xd5b7('0x12'),_0x27e2a9,_0x5ac16f['error'][_0xd5b7('0x13')]);return _0x12cd4f(_0x5ac16f[_0xd5b7('0x10')][_0xd5b7('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x27e2a9,_0xd5b7('0xc'));_0x12cd4f(_0x5ac16f[_0xd5b7('0x14')][_0xd5b7('0x13')]);}})[_0xd5b7('0x15')](function(_0x314861){logger[_0xd5b7('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x27e2a9,_0x314861);_0x55d7c2(_0x314861);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 77e338e..da274d8 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 _0x4865=['/describe','/:id','create','put','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x3f6e77,_0x443be1){var _0x3b8ef1=function(_0xbdbf95){while(--_0xbdbf95){_0x3f6e77['push'](_0x3f6e77['shift']());}};_0x3b8ef1(++_0x443be1);}(_0x4865,0x1c1));var _0x5486=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4865[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x5486('0x0'));var util=require(_0x5486('0x1'));var path=require(_0x5486('0x2'));var timeout=require('connect-timeout');var express=require(_0x5486('0x3'));var router=express[_0x5486('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5486('0x5'));var controller=require(_0x5486('0x6'));router[_0x5486('0x7')]('/',auth[_0x5486('0x8')](),controller[_0x5486('0x9')]);router[_0x5486('0x7')](_0x5486('0xa'),auth[_0x5486('0x8')](),controller['describe']);router[_0x5486('0x7')](_0x5486('0xb'),auth[_0x5486('0x8')](),controller['show']);router['post']('/',auth[_0x5486('0x8')](),controller[_0x5486('0xc')]);router[_0x5486('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5486('0xe')](_0x5486('0xb'),auth['isAuthenticated'](),controller[_0x5486('0xf')]);module[_0x5486('0x10')]=router; \ No newline at end of file +var _0x68bf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','express'];(function(_0xe6e0d,_0x42ed4e){var _0x2927c0=function(_0x4a2032){while(--_0x4a2032){_0xe6e0d['push'](_0xe6e0d['shift']());}};_0x2927c0(++_0x42ed4e);}(_0x68bf,0x71));var _0xf68b=function(_0x2e8ccf,_0x3b52c6){_0x2e8ccf=_0x2e8ccf-0x0;var _0x549283=_0x68bf[_0x2e8ccf];return _0x549283;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf68b('0x0'));var router=express['Router']();var fs_extra=require(_0xf68b('0x1'));var auth=require(_0xf68b('0x2'));var interaction=require(_0xf68b('0x3'));var config=require(_0xf68b('0x4'));var controller=require(_0xf68b('0x5'));router[_0xf68b('0x6')]('/',auth['isAuthenticated'](),controller[_0xf68b('0x7')]);router[_0xf68b('0x6')](_0xf68b('0x8'),auth[_0xf68b('0x9')](),controller[_0xf68b('0xa')]);router[_0xf68b('0x6')](_0xf68b('0xb'),auth[_0xf68b('0x9')](),controller[_0xf68b('0xc')]);router[_0xf68b('0xd')]('/',auth[_0xf68b('0x9')](),controller[_0xf68b('0xe')]);router[_0xf68b('0xf')]('/:id',auth[_0xf68b('0x9')](),controller[_0xf68b('0x10')]);router[_0xf68b('0x11')](_0xf68b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xf68b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index b66f8a4..9b6055c 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 _0x750a=['System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','ENUM','thumb','TEXT','input','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','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.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa'];(function(_0x4724ce,_0x57ea91){var _0x5dbb37=function(_0x4bac24){while(--_0x4bac24){_0x4724ce['push'](_0x4724ce['shift']());}};_0x5dbb37(++_0x57ea91);}(_0x750a,0x140));var _0xa750=function(_0x11eca0,_0x466916){_0x11eca0=_0x11eca0-0x0;var _0xf706a=_0x750a[_0x11eca0];return _0xf706a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa750('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'unique':_0xa750('0x2')},'description':{'type':Sequelize[_0xa750('0x1')]},'mapKey':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x3')},'key':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x4')},'customerAlias':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa750('0x1')]},'animation':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xa750('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x9')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xa')},'offline_chat_button':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xc')},'download_transcript':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa750('0x12')]('star',_0xa750('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa750('0x14')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa750('0x15'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xa750('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xa750('0x3'),'type':_0xa750('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa750('0x16')](_0xa750('0x17'))?JSON[_0xa750('0x18')](this[_0xa750('0x16')](_0xa750('0x17'))):{};},'set':function(_0x3d52b3){return this[_0xa750('0x19')](_0xa750('0x17'),JSON[_0xa750('0x1a')](_0x3d52b3));}},'offlineForm':{'type':Sequelize[_0xa750('0x14')],'defaultValue':function(){return JSON[_0xa750('0x1a')]({'items':[{'type':_0xa750('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa750('0x3'),'type':_0xa750('0x3')},'variable':null},{'type':_0xa750('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':_0xa750('0x1c'),'helpText':_0xa750('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0xa750('0x16')](_0xa750('0x1e'))?JSON['parse'](this[_0xa750('0x16')](_0xa750('0x1e'))):{};},'set':function(_0x449bb7){return this[_0xa750('0x19')](_0xa750('0x1e'),JSON['stringify'](_0x449bb7));}},'token':{'type':Sequelize[_0xa750('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa750('0x1')]},'forwardOffline':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa750('0x1')]},'waitingTitle':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x1f')},'waitingMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x21')},'skipUnmanaged':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xb')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa750('0x14')]},'showAgentAvatar':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa750('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa750('0x22');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x23')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x24')},'verticalAlignment':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0x25')},'messagesAlignment':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xa750('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa750('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa750('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0x28')},'systemAvatar':{'type':Sequelize[_0xa750('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa750('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![],'comment':_0xa750('0x2a'),'set':function(_0x1166ff){if(!_0x1166ff)this[_0xa750('0x19')]('mandatoryDispositionPauseId',null);this[_0xa750('0x19')](_0xa750('0x2b'),_0x1166ff);}},'vidaooEscalation':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa750('0x1')]},'vidaooTopic':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x2c')},'vidaooNote':{'type':Sequelize[_0xa750('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa750('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa750('0x14')]}}; \ No newline at end of file +var _0xec56=['#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','name','text','input','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xec56,0x1bd));var _0x6ec5=function(_0x493e20,_0x38fde3){_0x493e20=_0x493e20-0x0;var _0x409d78=_0xec56[_0x493e20];return _0x409d78;};'use strict';var Sequelize=require(_0x6ec5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'unique':_0x6ec5('0x2')},'description':{'type':Sequelize[_0x6ec5('0x1')]},'mapKey':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x3')},'mapKeyOffline':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x3')},'key':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x4')},'customerAlias':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6ec5('0x1')]},'animation':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6ec5('0x9')](_0x6ec5('0xa'),_0x6ec5('0xb')),'defaultValue':_0x6ec5('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6ec5('0xc')},'start_chat_button':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xd')},'offline_chat_button':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xe')},'header_offline':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xf')},'download_transcript':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6ec5('0x10')]},'closingQuestion':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x12')},'noteTitle':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x13')},'placeholderMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x14')},'closingMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x15')},'closingMessageButton':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xe')},'skipMessageButton':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x16')},'conditionAgreement':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x6ec5('0x9')](_0x6ec5('0x17'),_0x6ec5('0x18')),'defaultValue':_0x6ec5('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6ec5('0x10')],'defaultValue':function(){return JSON[_0x6ec5('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6ec5('0x1a'),'type':_0x6ec5('0x1b'),'required':!![]},'props':{'title':_0x6ec5('0x1a'),'helpText':''}},{'type':_0x6ec5('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6ec5('0x3'),'type':_0x6ec5('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6ec5('0x1d'))?JSON[_0x6ec5('0x1e')](this[_0x6ec5('0x1f')]('onlineForm')):{};},'set':function(_0x1b779a){return this[_0x6ec5('0x20')](_0x6ec5('0x1d'),JSON[_0x6ec5('0x19')](_0x1b779a));}},'offlineForm':{'type':Sequelize[_0x6ec5('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6ec5('0x1c'),'props':{'title':_0x6ec5('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6ec5('0x3')},'variable':null},{'type':_0x6ec5('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x6ec5('0x22'),'helpText':_0x6ec5('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6ec5('0x1f')](_0x6ec5('0x24'))?JSON[_0x6ec5('0x1e')](this['getDataValue'](_0x6ec5('0x24'))):{};},'set':function(_0x179f57){return this[_0x6ec5('0x20')](_0x6ec5('0x24'),JSON[_0x6ec5('0x19')](_0x179f57));}},'token':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':function(){return rs[_0x6ec5('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6ec5('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6ec5('0x1')]},'waitingTitle':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6ec5('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x28')},'skipUnmanaged':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x16')},'sendUnmanaged':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6ec5('0x10')],'defaultValue':function(){return _0x6ec5('0x29');}},'notificationSound':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6ec5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x2b')},'verticalAlignment':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x6ec5('0x1')]},'customerAvatar':{'type':Sequelize[_0x6ec5('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6ec5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x2d')},'systemAvatar':{'type':Sequelize[_0x6ec5('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ec5('0x7')],'comment':_0x6ec5('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![],'comment':_0x6ec5('0x2f'),'set':function(_0x53dcd8){if(!_0x53dcd8)this[_0x6ec5('0x20')]('mandatoryDispositionPauseId',null);this[_0x6ec5('0x20')]('mandatoryDisposition',_0x53dcd8);}},'vidaooEscalation':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6ec5('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ec5('0x30')},'vidaooNote':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':function(){return _0x6ec5('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6ec5('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ffb204a..37dfb93 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 _0x9baf=['Applications','account','applications','priority','contact','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','remoteAddress','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','stack','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','querystring','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','UserProfileResource','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','CmContact','Contacts'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9baf,0x9d));var _0xf9ba=function(_0x4979f7,_0x334536){_0x4979f7=_0x4979f7-0x0;var _0x219cff=_0x9baf[_0x4979f7];return _0x219cff;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xf9ba('0x0'));var util=require(_0xf9ba('0x1'));var path=require('path');var ejs=require(_0xf9ba('0x2'));var fs=require('fs');var fs_extra=require(_0xf9ba('0x3'));var _=require(_0xf9ba('0x4'));var querystring=require(_0xf9ba('0x5'));var Redis=require(_0xf9ba('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf9ba('0x7'));var config=require(_0xf9ba('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config[_0xf9ba('0x9')]=_[_0xf9ba('0xa')](config[_0xf9ba('0x9')],{'host':_0xf9ba('0xb'),'port':0x18eb});var socket=require(_0xf9ba('0xc'))(new Redis(config[_0xf9ba('0x9')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0xf9ba('0xd'));var jayson=require(_0xf9ba('0xe'));var client=jayson[_0xf9ba('0xf')][_0xf9ba('0x10')]({'port':0x232c});var client9002=jayson['client'][_0xf9ba('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xf9ba('0x10')]({'port':0x232b});var client9001=jayson[_0xf9ba('0xf')][_0xf9ba('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x231b5d,_0x49d1e7,_0x75e3cd,_0x5b4b3d){return new BPromise(function(_0xceade5,_0x3453cb){var _0x186d26=_0x5b4b3d||client;return _0x186d26[_0xf9ba('0x11')](_0x231b5d,_0x75e3cd)[_0xf9ba('0x12')](function(_0x5a61c4){logger[_0xf9ba('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x49d1e7,_0xf9ba('0x14'));logger[_0xf9ba('0x15')](_0xf9ba('0x16'),_0x49d1e7,_0xf9ba('0x14'),JSON['stringify'](_0x5a61c4));if(_0x5a61c4['error']){if(_0x5a61c4[_0xf9ba('0x17')][_0xf9ba('0x18')]===0x1f4){logger['error'](_0xf9ba('0x19'),_0x49d1e7,_0x5a61c4[_0xf9ba('0x17')]['message']);return _0x3453cb(_0x5a61c4[_0xf9ba('0x17')]['message']);}logger[_0xf9ba('0x17')](_0xf9ba('0x19'),_0x49d1e7,_0x5a61c4[_0xf9ba('0x17')][_0xf9ba('0x1a')]);return _0xceade5(_0x5a61c4['error'][_0xf9ba('0x1a')]);}else{logger['info'](_0xf9ba('0x19'),_0x49d1e7,_0xf9ba('0x14'));_0xceade5(_0x5a61c4[_0xf9ba('0x1b')][_0xf9ba('0x1a')]);}})[_0xf9ba('0x1c')](function(_0x563eac){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x49d1e7,_0x563eac);_0x3453cb(_0x563eac);});});}function respondWithStatusCode(_0x17e6b4,_0x21df90){_0x21df90=_0x21df90||0xcc;return function(_0x112f10){if(_0x112f10){return _0x17e6b4[_0xf9ba('0x1d')](_0x21df90);}return _0x17e6b4[_0xf9ba('0x1e')](_0x21df90)[_0xf9ba('0x1f')]();};}function respondWithResult(_0x3be76f,_0x536d36){_0x536d36=_0x536d36||0xc8;return function(_0xbc737d){if(_0xbc737d){return _0x3be76f[_0xf9ba('0x1e')](_0x536d36)['json'](_0xbc737d);}};}function respondWithFilteredResult(_0x106429,_0x2cf78e){return function(_0x45f99a){if(_0x45f99a){var _0x39cae0=typeof _0x2cf78e[_0xf9ba('0x20')]===_0xf9ba('0x21')&&typeof _0x2cf78e[_0xf9ba('0x22')]==='undefined';var _0x1c032a=_0x45f99a[_0xf9ba('0x23')];var _0x234f7a=_0x39cae0?0x0:_0x2cf78e['offset'];var _0x437b30=_0x39cae0?_0x45f99a['count']:_0x2cf78e['offset']+_0x2cf78e[_0xf9ba('0x22')];var _0x2636f6;if(_0x437b30>=_0x1c032a){_0x437b30=_0x1c032a;_0x2636f6=0xc8;}else{_0x2636f6=0xce;}_0x106429['status'](_0x2636f6);return _0x106429[_0xf9ba('0x24')](_0xf9ba('0x25'),_0x234f7a+'-'+_0x437b30+'/'+_0x1c032a)['json'](_0x45f99a);}return null;};}function saveUpdates(_0x21362d){return function(_0x419ec8){if(_0x419ec8){return _0x419ec8[_0xf9ba('0x26')](_0x21362d)[_0xf9ba('0x12')](function(_0x55b2e2){return _0x55b2e2;});}return null;};}function removeEntity(_0x37fb50){return function(_0x4576ec){if(_0x4576ec){return _0x4576ec['destroy']()[_0xf9ba('0x12')](function(){var _0x5f9cf2=_0x4576ec['get']({'plain':!![]});var _0x14e18a='ChatWebsites';return db[_0xf9ba('0x27')]['destroy']({'where':{'type':_0x14e18a,'resourceId':_0x5f9cf2['id']}})[_0xf9ba('0x12')](function(){return _0x4576ec;});})[_0xf9ba('0x12')](function(){_0x37fb50['status'](0xcc)[_0xf9ba('0x1f')]();});}};}function handleEntityNotFound(_0x1800f2){return function(_0x4a6e20){if(!_0x4a6e20){_0x1800f2[_0xf9ba('0x1d')](0x194);}return _0x4a6e20;};}function handleError(_0x8c3eb2,_0x56d7ea){_0x56d7ea=_0x56d7ea||0x1f4;return function(_0x5748f3){logger[_0xf9ba('0x17')](_0x5748f3['stack']);if(_0x5748f3[_0xf9ba('0x28')]){delete _0x5748f3[_0xf9ba('0x28')];}_0x8c3eb2[_0xf9ba('0x1e')](_0x56d7ea)['send'](_0x5748f3);};}exports[_0xf9ba('0x29')]=function(_0xd3b95,_0x3c602d){var _0x107b97={'include':[{'model':db[_0xf9ba('0x2a')],'as':_0xf9ba('0x2b')}]},_0x10aa01={},_0x3337f2={'count':0x0,'rows':[]};var _0x5c0307=_['map'](db[_0xf9ba('0x2c')][_0xf9ba('0x2d')],function(_0x4eff39){return{'name':_0x4eff39['fieldName'],'type':_0x4eff39[_0xf9ba('0x2e')]['key']};});_0x10aa01[_0xf9ba('0x2f')]=_[_0xf9ba('0x30')](_0x5c0307,'name');_0x10aa01[_0xf9ba('0x31')]=_['keys'](_0xd3b95['query']);_0x10aa01[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x10aa01[_0xf9ba('0x2f')],_0x10aa01[_0xf9ba('0x31')]);_0x107b97[_0xf9ba('0x34')]=_['intersection'](_0x10aa01[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x107b97[_0xf9ba('0x34')]=_0x107b97[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x107b97[_0xf9ba('0x34')]:_0x10aa01[_0xf9ba('0x2f')];if(!_0xd3b95[_0xf9ba('0x31')]['hasOwnProperty'](_0xf9ba('0x37'))){_0x107b97['limit']=qs[_0xf9ba('0x22')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x107b97[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0xd3b95['query']['offset']);}_0x107b97[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x107b97['where']=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0xd3b95[_0xf9ba('0x31')],_0x10aa01[_0xf9ba('0x32')]),_0x5c0307);if(_0xd3b95[_0xf9ba('0x31')]['filter']){_0x107b97['where']=_['merge'](_0x107b97[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x5c0307,function(_0x5bd6d2){if(_0x5bd6d2[_0xf9ba('0x2e')]!==_0xf9ba('0x3c')){var _0x13d45a={};_0x13d45a[_0x5bd6d2['name']]={'$like':'%'+_0xd3b95['query'][_0xf9ba('0x3d')]+'%'};return _0x13d45a;}})});}_0x107b97=_[_0xf9ba('0x3e')]({},_0x107b97,_0xd3b95['options']);var _0x412a37={'where':_0x107b97[_0xf9ba('0x3b')]};return db[_0xf9ba('0x2c')][_0xf9ba('0x23')](_0x412a37)['then'](function(_0x377b0f){_0x3337f2[_0xf9ba('0x23')]=_0x377b0f;if(_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x107b97[_0xf9ba('0x40')]=[{'all':!![]}];}return db[_0xf9ba('0x2c')][_0xf9ba('0x41')](_0x107b97);})[_0xf9ba('0x12')](function(_0x14c45d){_0x3337f2[_0xf9ba('0x42')]=_0x14c45d;return _0x3337f2;})['then'](respondWithFilteredResult(_0x3c602d,_0x107b97))[_0xf9ba('0x1c')](handleError(_0x3c602d,null));};exports[_0xf9ba('0x43')]=function(_0x3b78e3,_0x11e06b){var _0xbe6d0c={'raw':![],'where':{'id':_0x3b78e3[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x2a')],'as':_0xf9ba('0x2b')}]},_0x3bcf2d={};_0x3bcf2d['model']=_[_0xf9ba('0x45')](db['ChatWebsite']['rawAttributes']);_0x3bcf2d['query']=_['keys'](_0x3b78e3[_0xf9ba('0x31')]);_0x3bcf2d[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x3bcf2d[_0xf9ba('0x2f')],_0x3bcf2d[_0xf9ba('0x31')]);_0xbe6d0c[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3bcf2d[_0xf9ba('0x2f')],qs['fields'](_0x3b78e3['query']['fields']));_0xbe6d0c[_0xf9ba('0x34')]=_0xbe6d0c[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0xbe6d0c['attributes']:_0x3bcf2d[_0xf9ba('0x2f')];if(_0x3b78e3[_0xf9ba('0x31')]['includeAll']){_0xbe6d0c[_0xf9ba('0x40')]=[{'all':!![]}];}_0xbe6d0c=_[_0xf9ba('0x3e')]({},_0xbe6d0c,_0x3b78e3[_0xf9ba('0x46')]);return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0xbe6d0c)[_0xf9ba('0x12')](handleEntityNotFound(_0x11e06b,null))['then'](respondWithResult(_0x11e06b,null))['catch'](handleError(_0x11e06b,null));};exports['create']=function(_0x5de5c4,_0x3ae30e){return db[_0xf9ba('0x2c')][_0xf9ba('0x48')](_0x5de5c4[_0xf9ba('0x49')],{})['then'](function(_0x3fe343){var _0x1f0bf6=_0x5de5c4[_0xf9ba('0x4a')]['get']({'plain':!![]});if(!_0x1f0bf6)throw new Error(_0xf9ba('0x4b'));if(_0x1f0bf6[_0xf9ba('0x4c')]===_0xf9ba('0x4a')){var _0x48e2ca=_0x3fe343[_0xf9ba('0x4d')]({'plain':!![]});var _0x3eff77=_0xf9ba('0x4e');return db[_0xf9ba('0x4f')][_0xf9ba('0x47')]({'where':{'name':_0x3eff77,'userProfileId':_0x1f0bf6['userProfileId']},'raw':!![]})[_0xf9ba('0x12')](function(_0x325b94){if(_0x325b94&&_0x325b94[_0xf9ba('0x50')]===0x0){return db[_0xf9ba('0x27')][_0xf9ba('0x48')]({'name':_0x48e2ca[_0xf9ba('0x28')],'resourceId':_0x48e2ca['id'],'type':_0x325b94['name'],'sectionId':_0x325b94['id']},{})[_0xf9ba('0x12')](function(){return _0x3fe343;});}else{return _0x3fe343;}})[_0xf9ba('0x1c')](function(_0x21cdac){logger['error'](_0xf9ba('0x51'),_0x21cdac);throw _0x21cdac;});}return _0x3fe343;})[_0xf9ba('0x12')](respondWithResult(_0x3ae30e,0xc9))[_0xf9ba('0x1c')](handleError(_0x3ae30e,null));};exports[_0xf9ba('0x26')]=function(_0x6a7a7c,_0x498c3b){if(_0x6a7a7c[_0xf9ba('0x49')]['id']){delete _0x6a7a7c[_0xf9ba('0x49')]['id'];}return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x6a7a7c['params']['id']},'include':[{'model':db[_0xf9ba('0x2a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x498c3b,null))[_0xf9ba('0x12')](saveUpdates(_0x6a7a7c[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x498c3b,null))['catch'](handleError(_0x498c3b,null));};exports[_0xf9ba('0x52')]=function(_0x6df306,_0x12482f){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x6df306[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x12482f,null))[_0xf9ba('0x12')](removeEntity(_0x12482f,null))[_0xf9ba('0x1c')](handleError(_0x12482f,null));};exports[_0xf9ba('0x53')]=function(_0x2ab4cb,_0x2e8f9f){return db[_0xf9ba('0x2c')]['describe']()[_0xf9ba('0x12')](respondWithResult(_0x2e8f9f,null))[_0xf9ba('0x1c')](handleError(_0x2e8f9f,null));};exports[_0xf9ba('0x54')]=function(_0x4b8525,_0x25af88){if(_0x4b8525[_0xf9ba('0x49')]['id']){delete _0x4b8525['body']['id'];}return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x4b8525[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x25af88,null))[_0xf9ba('0x12')](function(_0x161267){if(_0x161267){_0x4b8525[_0xf9ba('0x49')][_0xf9ba('0x55')]=_0x161267['id'];return db[_0xf9ba('0x56')][_0xf9ba('0x48')](_0x4b8525[_0xf9ba('0x49')]);}})[_0xf9ba('0x12')](respondWithResult(_0x25af88,null))[_0xf9ba('0x1c')](handleError(_0x25af88,null));};exports[_0xf9ba('0x57')]=function(_0x1de30d,_0x3c1015){var _0x3ea210={'raw':![],'where':{}};var _0x322ae1={};var _0xe52863={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x1de30d[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x3c1015,null))[_0xf9ba('0x12')](function(_0x1a23ca){if(_0x1a23ca){_0x322ae1[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x56')][_0xf9ba('0x2d')]);_0x322ae1[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x1de30d[_0xf9ba('0x31')]);_0x322ae1['filters']=_[_0xf9ba('0x33')](_0x322ae1['model'],_0x322ae1[_0xf9ba('0x31')]);_0x3ea210[_0xf9ba('0x34')]=_['intersection'](_0x322ae1['model'],qs[_0xf9ba('0x35')](_0x1de30d[_0xf9ba('0x31')]['fields']));_0x3ea210[_0xf9ba('0x34')]=_0x3ea210[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x3ea210[_0xf9ba('0x34')]:_0x322ae1[_0xf9ba('0x2f')];if(!_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x3ea210[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x3ea210['offset']=qs[_0xf9ba('0x20')](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x3ea210[_0xf9ba('0x38')]=qs['sort'](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x3ea210[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_['pick'](_0x1de30d[_0xf9ba('0x31')],_0x322ae1[_0xf9ba('0x32')]));_0x3ea210['where'][_0xf9ba('0x55')]=_0x1a23ca['id'];if(_0x1de30d['query']['filter']){_0x3ea210['where']=_['merge'](_0x3ea210[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x3ea210['attributes'],function(_0x4d2272){var _0x589cae={};_0x589cae[_0x4d2272]={'$like':'%'+_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x589cae;})});}_0x3ea210=_[_0xf9ba('0x3e')]({},_0x3ea210,_0x1de30d['options']);return db['Disposition'][_0xf9ba('0x23')]({'where':_0x3ea210['where']})[_0xf9ba('0x12')](function(_0xc44237){_0xe52863[_0xf9ba('0x23')]=_0xc44237;if(_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x3ea210[_0xf9ba('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xf9ba('0x41')](_0x3ea210);})[_0xf9ba('0x12')](function(_0x364312){_0xe52863[_0xf9ba('0x42')]=_0x364312;return _0xe52863;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3c1015,_0x3ea210))[_0xf9ba('0x1c')](handleError(_0x3c1015,null));};exports[_0xf9ba('0x5a')]=function(_0x311e5d,_0x546935){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x311e5d['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x546935,null))['then'](function(_0x10b705){if(_0x10b705){return _0x10b705['removeDispositions'](_0x311e5d[_0xf9ba('0x31')]['ids']);}})[_0xf9ba('0x12')](respondWithStatusCode(_0x546935,null))[_0xf9ba('0x1c')](handleError(_0x546935,null));};exports[_0xf9ba('0x5b')]=function(_0x738efb,_0x5d2588){if(_0x738efb[_0xf9ba('0x49')]['id']){delete _0x738efb[_0xf9ba('0x49')]['id'];}return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x738efb[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x5d2588,null))['then'](function(_0x14ea94){if(_0x14ea94){_0x738efb['body'][_0xf9ba('0x55')]=_0x14ea94['id'];return db['CannedAnswer']['create'](_0x738efb['body']);}})[_0xf9ba('0x12')](respondWithResult(_0x5d2588,null))[_0xf9ba('0x1c')](handleError(_0x5d2588,null));};exports[_0xf9ba('0x5c')]=function(_0x33d7c3,_0x3c7b61){var _0x3219a6={'raw':![],'where':{}};var _0xbae3df={};var _0x1cdd92={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')]['findOne']({'where':{'id':_0x33d7c3['params']['id']}})['then'](handleEntityNotFound(_0x3c7b61,null))[_0xf9ba('0x12')](function(_0x326e4f){if(_0x326e4f){_0xbae3df[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x5d')][_0xf9ba('0x2d')]);_0xbae3df[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x33d7c3[_0xf9ba('0x31')]);_0xbae3df[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0xbae3df[_0xf9ba('0x2f')],_0xbae3df[_0xf9ba('0x31')]);_0x3219a6['attributes']=_['intersection'](_0xbae3df['model'],qs[_0xf9ba('0x35')](_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x3219a6[_0xf9ba('0x34')]=_0x3219a6[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x3219a6[_0xf9ba('0x34')]:_0xbae3df[_0xf9ba('0x2f')];if(!_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x3219a6[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x33d7c3['query']['limit']);_0x3219a6[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x3219a6['order']=qs['sort'](_0x33d7c3[_0xf9ba('0x31')]['sort']);_0x3219a6[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x33d7c3['query'],_0xbae3df[_0xf9ba('0x32')]));_0x3219a6[_0xf9ba('0x3b')][_0xf9ba('0x55')]=_0x326e4f['id'];if(_0x33d7c3[_0xf9ba('0x31')]['filter']){_0x3219a6[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x3219a6[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x3219a6[_0xf9ba('0x34')],function(_0x1fe93a){var _0x7c2f66={};_0x7c2f66[_0x1fe93a]={'$like':'%'+_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x7c2f66;})});}_0x3219a6=_[_0xf9ba('0x3e')]({},_0x3219a6,_0x33d7c3[_0xf9ba('0x46')]);return db[_0xf9ba('0x5d')][_0xf9ba('0x23')]({'where':_0x3219a6[_0xf9ba('0x3b')]})[_0xf9ba('0x12')](function(_0x2f7be9){_0x1cdd92['count']=_0x2f7be9;if(_0x33d7c3['query']['includeAll']){_0x3219a6[_0xf9ba('0x40')]=[{'all':!![]}];}return db[_0xf9ba('0x5d')][_0xf9ba('0x41')](_0x3219a6);})['then'](function(_0x10fa81){_0x1cdd92[_0xf9ba('0x42')]=_0x10fa81;return _0x1cdd92;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3c7b61,_0x3219a6))[_0xf9ba('0x1c')](handleError(_0x3c7b61,null));};exports['removeAnswers']=function(_0x3107c1,_0x2202f0){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x3107c1[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x2202f0,null))['then'](function(_0x168987){if(_0x168987){return _0x168987[_0xf9ba('0x5e')](_0x3107c1[_0xf9ba('0x31')][_0xf9ba('0x5f')]);}})[_0xf9ba('0x12')](respondWithStatusCode(_0x2202f0,null))[_0xf9ba('0x1c')](handleError(_0x2202f0,null));};exports['addLogo']=function(_0x39c630,_0xe231ae){_0x39c630['body'][_0xf9ba('0x60')]=_0x39c630[_0xf9ba('0x61')]['filename'];return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x39c630[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0xe231ae,null))[_0xf9ba('0x12')](saveUpdates(_0x39c630[_0xf9ba('0x49')],null))['then'](respondWithResult(_0xe231ae,null))['catch'](handleError(_0xe231ae,null));};exports[_0xf9ba('0x62')]=function(_0xefa5cf,_0x221a90){_0xefa5cf['body'][_0xf9ba('0x63')]=_0xefa5cf[_0xf9ba('0x61')][_0xf9ba('0x64')];return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0xefa5cf[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x221a90,null))['then'](saveUpdates(_0xefa5cf[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x221a90,null))[_0xf9ba('0x1c')](handleError(_0x221a90,null));};exports[_0xf9ba('0x65')]=function(_0x41036a,_0x848339){_0x41036a[_0xf9ba('0x49')][_0xf9ba('0x66')]=_0x41036a[_0xf9ba('0x61')][_0xf9ba('0x64')];return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x41036a[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x848339,null))[_0xf9ba('0x12')](saveUpdates(_0x41036a[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x848339,null))[_0xf9ba('0x1c')](handleError(_0x848339,null));};exports[_0xf9ba('0x67')]=function(_0x23091f,_0x36b0f8){_0x23091f['body']['systemAvatar']=_0x23091f[_0xf9ba('0x61')][_0xf9ba('0x64')];return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x23091f[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x36b0f8,null))[_0xf9ba('0x12')](saveUpdates(_0x23091f[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x36b0f8,null))[_0xf9ba('0x1c')](handleError(_0x36b0f8,null));};exports['getLogo']=function(_0x1da392,_0x27fbc3){var _0x47c4cf=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x6a'));var _0x8f4a13={'where':{'id':_0x1da392[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x60')],'raw':!![]};var _0x229aa1=![];return require(_0xf9ba('0x6b'))[_0xf9ba('0x6c')]()[_0xf9ba('0x12')](function(_0x338c89){if(_0x338c89){_0x229aa1=_0x338c89[_0xf9ba('0x6d')];}})[_0xf9ba('0x12')](function(){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x8f4a13);})[_0xf9ba('0x12')](handleEntityNotFound(_0x27fbc3,null))['then'](function(_0x17e421){if(_0x17e421){if(!_[_0xf9ba('0x6e')](_0x17e421[_0xf9ba('0x60')])){if(fs[_0xf9ba('0x6f')](path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x70'),_0x17e421[_0xf9ba('0x60')]))&&_0x229aa1){_0x47c4cf=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x70'),_0x17e421[_0xf9ba('0x60')]);}}return _0x27fbc3['download'](_0x47c4cf);}})['catch'](handleError(_0x27fbc3,null));};exports[_0xf9ba('0x71')]=function(_0x48e656,_0x2d5815){var _0x59898a=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x72'));var _0x2706e7={'where':{'id':_0x48e656['params']['id']},'attributes':['id',_0xf9ba('0x63')],'raw':!![]};return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x2706e7)['then'](handleEntityNotFound(_0x2d5815,null))[_0xf9ba('0x12')](function(_0x447b5c){if(_0x447b5c){if(!_['isNil'](_0x447b5c[_0xf9ba('0x63')])){if(fs['existsSync'](path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x447b5c[_0xf9ba('0x63')]))){_0x59898a=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x447b5c[_0xf9ba('0x63')]);}}return _0x2d5815['download'](_0x59898a);}})['catch'](handleError(_0x2d5815,null));};exports[_0xf9ba('0x74')]=function(_0x404649,_0x13ddf1){var _0x3685cc=path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x75'));var _0x31b78f={'where':{'id':_0x404649[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x66'),_0xf9ba('0x76')],'raw':!![]};return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x31b78f)[_0xf9ba('0x12')](handleEntityNotFound(_0x13ddf1,null))[_0xf9ba('0x12')](function(_0x275609){if(_0x275609){if(!_[_0xf9ba('0x6e')](_0x275609[_0xf9ba('0x66')])){if(fs[_0xf9ba('0x6f')](path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x275609['customerAvatar']))&&_0x275609[_0xf9ba('0x76')]){_0x3685cc=path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x275609['customerAvatar']);}}return _0x13ddf1[_0xf9ba('0x77')](_0x3685cc);}})['catch'](handleError(_0x13ddf1,null));};exports[_0xf9ba('0x78')]=function(_0x33f99d,_0x47c217){var _0x1c5739=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x79'));var _0x2a902b={'where':{'id':_0x33f99d[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x7a')],'raw':!![]};return db[_0xf9ba('0x2c')]['find'](_0x2a902b)[_0xf9ba('0x12')](handleEntityNotFound(_0x47c217,null))[_0xf9ba('0x12')](function(_0x4e9713){if(_0x4e9713){if(!_[_0xf9ba('0x6e')](_0x4e9713['systemAvatar'])){if(fs[_0xf9ba('0x6f')](path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x4e9713['systemAvatar']))){_0x1c5739=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x4e9713[_0xf9ba('0x7a')]);}}return _0x47c217[_0xf9ba('0x77')](_0x1c5739);}})[_0xf9ba('0x1c')](handleError(_0x47c217,null));};exports['notify']=function(_0x33c7fd,_0x37f86d){var _0x3af379=require('user-agent-parser');var _0x304bfd=new _0x3af379();var _0x358b60=_0x304bfd[_0xf9ba('0x7b')](_0x33c7fd['headers']['user-agent'])['getResult']();var _0x18c15d={'body':_0x33c7fd[_0xf9ba('0x49')],'channel':'chat'};var _0x2f3930=[];var _0x2974af=[];var _0x311c58={};var _0x2d55a1=![];return db['CmContact']['describe']()['then'](function(_0x52396b){if(!_0x52396b){throw new db['Sequelize']['ValidationError'](_0xf9ba('0x7c'));}_0x2f3930=_[_0xf9ba('0x7d')](_['keys'](_0x52396b),[_0xf9ba('0x7e'),_0xf9ba('0x7f')]);_0x2974af=_[_0xf9ba('0x7d')](_[_0xf9ba('0x45')](_0x52396b),[_0xf9ba('0x7e'),_0xf9ba('0x7f'),_0xf9ba('0x80'),_0xf9ba('0x81')]);if(_0x33c7fd[_0xf9ba('0x49')]['id']){delete _0x33c7fd['body']['id'];}if(_['isNil'](_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0x85'));}if(_[_0xf9ba('0x6e')](_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x49')])||_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x49')]===''){throw new db[(_0xf9ba('0x83'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x33c7fd['body']['mapKey'])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0x86')+_0x2974af);}if(!_[_0xf9ba('0x87')](_0x2974af,_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2974af);}_0x311c58[_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')]]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')];})[_0xf9ba('0x12')](function(){return db[_0xf9ba('0x2c')]['find']({'where':{'id':_0x33c7fd[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x89')],'as':_0xf9ba('0x8a'),'include':[{'model':db[_0xf9ba('0x8b')],'as':_0xf9ba('0x8c'),'where':_0x311c58,'limit':0x1,'order':[[_0xf9ba('0x7f'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xf9ba('0x8d')}]});})[_0xf9ba('0x12')](handleEntityNotFound(_0x37f86d,null))['then'](function(_0x3a6d36){if(_0x3a6d36&&_0x3a6d36[_0xf9ba('0x8a')]){_0x18c15d[_0xf9ba('0x8e')]=_0x3a6d36;_0x18c15d[_0xf9ba('0x8f')]=_0x3a6d36[_0xf9ba('0x8d')];_0x18c15d['list']=_0x3a6d36[_0xf9ba('0x8a')];_0x18c15d['applications']=_['orderBy'](_0x18c15d[_0xf9ba('0x8f')],[_0xf9ba('0x90')],['asc']);if(_0x18c15d['account']['Applications']){delete _0x18c15d[_0xf9ba('0x8e')][_0xf9ba('0x8d')];}if(_0x18c15d[_0xf9ba('0x8e')]['List']&&_0x18c15d[_0xf9ba('0x8e')]['List']['Contacts'][_0xf9ba('0x36')]){return _0x18c15d[_0xf9ba('0x8e')]['List']['Contacts'][0x0];}var _0x175782=_['defaults'](_0x33c7fd[_0xf9ba('0x49')],{'firstName':_0x33c7fd[_0xf9ba('0x49')]['from'],'ListId':_0x3a6d36[_0xf9ba('0x81')]});_0x175782[_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')]]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')];return db[_0xf9ba('0x8b')][_0xf9ba('0x48')](_0x175782,{'fields':_0x2f3930,'raw':!![]});}})['then'](handleEntityNotFound(_0x37f86d,null))[_0xf9ba('0x12')](function(_0x19625a){_0x18c15d[_0xf9ba('0x91')]=_0x19625a;var _0x2d1ff6=_0x33c7fd['body']['customerIp'];if(_0x33c7fd['headers']['cf-connecting-ip']){_0x2d1ff6=_0x33c7fd['headers'][_0xf9ba('0x92')];}else if(_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x94')]){_0x2d1ff6=_[_0xf9ba('0x95')](_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x94')][_0xf9ba('0x96')](','));}if(_0x19625a){var _0x3d16f1={'ContactId':_0x19625a['id'],'ChatWebsiteId':_0x33c7fd[_0xf9ba('0x44')]['id'],'from':(_0x19625a[_0xf9ba('0x97')]||'')+'\x20'+(_0x19625a[_0xf9ba('0x98')]||''),'customerIp':_0x2d1ff6,'customerPort':_0x33c7fd[_0xf9ba('0x93')]['x-real-port']?_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x99')]:null,'referer':_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x9a')],'browserName':_0x358b60[_0xf9ba('0x9b')][_0xf9ba('0x28')]&&_0x358b60['browser'][_0xf9ba('0x9c')]?util[_0xf9ba('0x9d')](_0xf9ba('0x9e'),_0x358b60[_0xf9ba('0x9b')][_0xf9ba('0x28')],_0x358b60['browser']['version']):_0xf9ba('0x9f'),'browserVersion':_0x358b60['browser'][_0xf9ba('0x9c')]||_0xf9ba('0x9f'),'osName':util[_0xf9ba('0x9d')]('%s\x20%s',_0x358b60['os'][_0xf9ba('0x28')],_0x358b60['os'][_0xf9ba('0x9c')]),'osVersion':_0x358b60['os'][_0xf9ba('0x9c')],'deviceModel':_0x358b60['device']['model']&&_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')]?util['format'](_0xf9ba('0xa2'),_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0x2f')],_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')],_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0x2e')]):null,'deviceVendor':_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')],'deviceType':_0x358b60[_0xf9ba('0xa0')]['type'],'formData':JSON[_0xf9ba('0xa3')](_0x33c7fd['body'])};var _0x4d056c={'ChatWebsiteId':_0x33c7fd['params']['id'],'closed':![]};if(_0x33c7fd[_0xf9ba('0x49')]['threadId']){_0x4d056c[_0xf9ba('0xa4')]=_0x33c7fd['body'][_0xf9ba('0xa4')];return db[_0xf9ba('0xa5')]['find']({'where':_0x4d056c})[_0xf9ba('0x12')](function(_0x4a65ca){if(_0x4a65ca){return[_0x4a65ca,![]];}_0x3d16f1['threadId']=_0x33c7fd['body'][_0xf9ba('0xa4')];_0x3d16f1[_0xf9ba('0xa6')]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa6')];return db[_0xf9ba('0xa5')][_0xf9ba('0x48')](_0x3d16f1)['then'](function(_0x1c4da5){return[_0x1c4da5,!![]];});});}_0x4d056c[_0xf9ba('0xa7')]=_0x19625a['id'];if(_0x33c7fd['body'][_0xf9ba('0xa8')]&&_0x33c7fd[_0xf9ba('0x49')]['interaction']['id']){_0x4d056c['id']=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa8')]['id'];return db[_0xf9ba('0xa5')][_0xf9ba('0x47')]({'where':_0x4d056c})[_0xf9ba('0x12')](function(_0x1d4067){if(_0x1d4067){return[_0x1d4067,![]];}return db['ChatInteraction'][_0xf9ba('0x48')](_0x3d16f1)[_0xf9ba('0x12')](function(_0x2c9999){return[_0x2c9999,!![]];});});}return db[_0xf9ba('0xa5')][_0xf9ba('0x48')](_0x3d16f1)[_0xf9ba('0x12')](function(_0x72c433){return[_0x72c433,!![]];});}})[_0xf9ba('0xa9')](function(_0x4e06c8,_0xcb950d){if(_0x4e06c8){_0x2d55a1=_0xcb950d;if(!_0xcb950d){var _0x515714={'from':(_0x18c15d[_0xf9ba('0x91')][_0xf9ba('0x97')]||'')+'\x20'+(_0x18c15d[_0xf9ba('0x91')][_0xf9ba('0x98')]||'')};if(_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa4')]&&_0x33c7fd[_0xf9ba('0x49')]['messageId']&&_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa4')]!=_0x33c7fd[_0xf9ba('0x49')]['messageId']){_0x515714[_0xf9ba('0xa4')]=_0x33c7fd['body'][_0xf9ba('0xaa')];}return _0x4e06c8[_0xf9ba('0x26')](_0x515714);}else{return _0x4e06c8;}}})['then'](function(_0x110a08){_0x18c15d[_0xf9ba('0xa8')]=_0x110a08[_0xf9ba('0x4d')]({'plain':!![]});_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xab')]=_0x2d55a1;if(_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xab')]){if(_0x18c15d[_0xf9ba('0x8e')][_0xf9ba('0xac')]){_0x18c15d[_0xf9ba('0x8f')][_0xf9ba('0xad')]({'id':0x0,'priority':_0x18c15d[_0xf9ba('0x8f')][_0xf9ba('0x36')]+0x1,'app':_0xf9ba('0xae'),'appdata':_0xf9ba('0xaf'),'interval':_0xf9ba('0xb0')});}}return db[_0xf9ba('0xb1')][_0xf9ba('0x48')]({'body':_0x33c7fd['body']['body'],'ChatWebsiteId':_0x33c7fd[_0xf9ba('0x44')]['id'],'ChatInteractionId':_0x110a08['id'],'direction':'in','ContactId':_0x18c15d[_0xf9ba('0x91')]['id'],'AttachmentId':_0x33c7fd['body'][_0xf9ba('0xb2')]});})[_0xf9ba('0x12')](function(_0x104f98){_0x18c15d[_0xf9ba('0x1a')]=_0x104f98;if(_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xb3')]){return db[_0xf9ba('0xb4')][_0xf9ba('0x47')]({'attributes':['id',_0xf9ba('0x28')],'where':{'id':_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xb3')]}})['then'](function(_0x1da9cf){if(_0x1da9cf){_0x18c15d[_0xf9ba('0x8f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf9ba('0xb5'),'appdata':_0x1da9cf[_0xf9ba('0x28')]+','+(_0x18c15d['account'][_0xf9ba('0xb6')]||0xa),'interval':_0xf9ba('0xb0')});_0x18c15d[_0xf9ba('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x18c15d);});}return respondWithRpcPromise(_0xf9ba('0xb8'),'startRouting',_0x18c15d);})[_0xf9ba('0x12')](function(_0x11518d){respondWithRpcPromise(_0xf9ba('0xb9'),_0xf9ba('0xb9'),{'event':'notify','message':_0x11518d},client9002);return _0x11518d;})[_0xf9ba('0x12')](respondWithResult(_0x37f86d,null))[_0xf9ba('0x1c')](handleError(_0x37f86d,null));};exports[_0xf9ba('0xba')]=function(_0x5b21d6,_0x1138a4){var _0x12e0e6,_0x54deb4,_0xadfb83;var _0x63731d=[];var _0x4ffcf7={};var _0x1a355a=_0x5b21d6[_0xf9ba('0xbb')]||[];var _0x4b148b=[];var _0x5461fa;return db[_0xf9ba('0x8b')]['describe']()[_0xf9ba('0x12')](function(_0x52aa26){if(!_0x52aa26){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))]('no\x20available\x20attributes');}_0x63731d=_[_0xf9ba('0x7d')](_['keys'](_0x52aa26),['createdAt',_0xf9ba('0x7f'),_0xf9ba('0x80'),'ListId']);if(_0x5b21d6[_0xf9ba('0x49')]['id']){delete _0x5b21d6['body']['id'];}if(_[_0xf9ba('0x6e')](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x82')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xf9ba('0x6e')](_0x5b21d6['body'][_0xf9ba('0x49')])||_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x49')]===''){throw _0x1138a4['status'](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0xbd')));}if(_['isNil'](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0xbe')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0xbf')+_0x63731d));}if(!_['includes'](_0x63731d,_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0xbe')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db['Sequelize'][(_0xf9ba('0x84'))](_0xf9ba('0xc0')+_0x63731d));}_0x4ffcf7[_0x5b21d6[_0xf9ba('0x49')]['mapKeyOffline']]=_0x5b21d6['body'][_0xf9ba('0x82')];})[_0xf9ba('0x12')](function(){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x5b21d6[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x89')],'as':_0xf9ba('0x8a')},{'model':db[_0xf9ba('0xc1')],'as':'MailAccount'}]});})[_0xf9ba('0x12')](handleEntityNotFound(_0x1138a4,null))['then'](function(_0x1fda0a){if(_0x1fda0a&&_0x1fda0a[_0xf9ba('0x8a')]){_0x54deb4=_0x1fda0a;var _0x6d3f12=_[_0xf9ba('0xa')](_0x5b21d6[_0xf9ba('0x49')],{'firstName':_0x5b21d6[_0xf9ba('0x49')]['from'],'phone':_0x5b21d6['body']['from'],'ListId':_0x1fda0a['ListId']});_0x6d3f12[_0x5b21d6['body'][_0xf9ba('0xbe')]]=_0x5b21d6[_0xf9ba('0x49')]['from'];return db[_0xf9ba('0x8b')][_0xf9ba('0xc2')]({'where':_0x4ffcf7,'defaults':_0x6d3f12});}})[_0xf9ba('0xa9')](function(_0x387dd0){if(_0x387dd0){_0xadfb83=_0x387dd0;var _0x585aee=fs['readFileSync'](path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0xc3')),_0xf9ba('0xc4'));var _0x3e67c5=ejs[_0xf9ba('0xc5')](_0x585aee,{'body':_['toPairs'](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x49')]),'bodyTitle':_0x54deb4['offlineMessageBody']});return db[_0xf9ba('0xc6')][_0xf9ba('0x48')]({'body':_0x3e67c5,'plainBody':htmlToText[_0xf9ba('0xc7')](_0x3e67c5),'ContactId':_0x387dd0['id'],'ChatWebsiteId':_0x54deb4['id']});}})[_0xf9ba('0x12')](function(_0x3fd2f1){_0x5461fa=_0x3fd2f1;if(_0x1a355a[_0xf9ba('0x36')]){var _0x5b88bb=_0x1a355a[_0xf9ba('0x30')](function(_0x1a2646){return{'name':_0x1a2646[_0xf9ba('0xc8')],'basename':_0x1a2646[_0xf9ba('0x64')],'type':_0x1a2646[_0xf9ba('0xc9')],'ChatOfflineMessageId':_0x3fd2f1['id']};});_0x4b148b=_0x5b88bb[_0xf9ba('0x30')](_0x1321c1=>{var _0x1d0204={'filename':_0x1321c1[_0xf9ba('0x28')],'path':path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0xca'),'files',_0xf9ba('0xcb'),_0xf9ba('0xcc'),_0x1321c1[_0xf9ba('0xcd')])};return _0x1d0204;});if(!_0x54deb4[_0xf9ba('0xce')]){return db['sequelize']['transaction'](function(_0x13f146){return db[_0xf9ba('0xcf')][_0xf9ba('0xd0')](_0x5b88bb,{'transaction':_0x13f146});});}}})[_0xf9ba('0x12')](function(){if(_0x5461fa){_0x12e0e6=_0x5461fa;return db[_0xf9ba('0xc1')][_0xf9ba('0x58')]({'where':{'service':!![]},'include':[{'model':db[_0xf9ba('0xd1')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf9ba('0xd2')],'as':_0xf9ba('0xd2'),'raw':!![]}]}]});}})[_0xf9ba('0x12')](function(_0x3ced1b){if(_0x3ced1b&&_0x3ced1b[_0xf9ba('0xd3')]&&_0x54deb4[_0xf9ba('0xd4')]&&_0x54deb4[_0xf9ba('0xd5')]){var _0x39d10a=_0x3ced1b[_0xf9ba('0xd6')]();return respondWithRpcPromise('SendMail',_0xf9ba('0xd7'),{'account':_0x39d10a,'message':{'from':util[_0xf9ba('0x9d')](_0xf9ba('0xd8'),_0x3ced1b[_0xf9ba('0x28')],_0x3ced1b['email']||_0x3ced1b['Smtp'][_0xf9ba('0x4a')]),'to':_0x54deb4['forwardOfflineAddress'],'subject':_0x54deb4[_0xf9ba('0xd9')],'html':_0x12e0e6[_0xf9ba('0x49')],'attachments':_0x4b148b}},client9003)[_0xf9ba('0x12')](function(){return _0x12e0e6;})[_0xf9ba('0x1c')](function(_0x160385){logger[_0xf9ba('0x17')](_0x160385);});}})[_0xf9ba('0x12')](function(){if(_0x54deb4&&_0x54deb4[_0xf9ba('0xce')]&&_0x54deb4[_0xf9ba('0xda')]){var _0x1f79bd=[];if(_0x1a355a[_0xf9ba('0x36')]){_0x1f79bd=_0x1a355a['map'](function(_0x31bf88){return{'name':_0x31bf88[_0xf9ba('0xc8')],'basename':_0x31bf88[_0xf9ba('0x64')],'type':_0x31bf88[_0xf9ba('0xc9')],'ChatOfflineMessageId':_0x5461fa['id']};});}var _0x124504;if(!_[_0xf9ba('0x6e')](_0x54deb4[_0xf9ba('0xdb')])){var _0x54b885=_[_0xf9ba('0x30')](_0x5b21d6[_0xf9ba('0x49')],function(_0x55068a){return _0x55068a;});var _0x51cce3=_[_0xf9ba('0xdc')](_0x54b885)[0x0];var _0x9835b6=_[_0xf9ba('0xdd')](_0x51cce3,function(_0x28a22a){return _0x28a22a;});_0x124504=_0x9835b6[0x1][_0x54deb4[_0xf9ba('0xdb')]];}var _0x5d1045={'from':_0xadfb83[_0xf9ba('0xde')],'firstName':_0xadfb83[_0xf9ba('0x97')],'lastName':_0xadfb83[_0xf9ba('0x98')],'mapKey':_0xf9ba('0xde'),'message':{'from':_0xadfb83[_0xf9ba('0xde')],'to':_0x54deb4['MailAccount']['email'],'cc':'','subject':_[_0xf9ba('0x6e')](_0x124504)?_0x54deb4['offlineMessageSubject']:_0x124504,'messageId':'','sentAt':new Date(),'attach':_0x1f79bd[_0xf9ba('0x36')],'attachments':_0x1f79bd,'originChannel':_0xf9ba('0xdf'),'ChatWebsiteId':_0x54deb4['id'],'ChatOfflineMessageId':_0x12e0e6['id'],'originTo':_0x54deb4[_0xf9ba('0xc1')][_0xf9ba('0xde')]},'body':_0x12e0e6[_0xf9ba('0x49')]};var _0x16aca1={'account':{'id':_0x54deb4['MailAccountId']},'body':_0x5d1045,'log':_0xf9ba('0xe0')};return respondWithRpcPromise(_0xf9ba('0xe0'),_0xf9ba('0xe1'),_0x16aca1,client9001)[_0xf9ba('0x12')](function(){return _0x12e0e6;})[_0xf9ba('0x1c')](function(_0x375821){logger[_0xf9ba('0x17')](_0x375821);});}return;})[_0xf9ba('0x12')](function(){if(_0x12e0e6){return _0x12e0e6;}})[_0xf9ba('0x12')](respondWithResult(_0x1138a4,null))[_0xf9ba('0x1c')](function(_0x33a178){logger[_0xf9ba('0x17')](_0xf9ba('0x1c'),_0x33a178);for(var _0xe5cca9 of _0x1a355a){var _0x358b5c=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],'server',_0xf9ba('0xbb'),_0xf9ba('0xcb'),_0xf9ba('0xcc'),_0xe5cca9['filename']);fs_extra[_0xf9ba('0xe2')](_0x358b5c)[_0xf9ba('0x1c')](function(_0x48ca4d){logger[_0xf9ba('0x17')](_0xf9ba('0xe3'),_0x358b5c,_0x48ca4d);});}});};exports[_0xf9ba('0xe4')]=function(_0x10111d,_0x3a9743){return db[_0xf9ba('0xa5')][_0xf9ba('0x47')]({'where':{'id':_0x10111d[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x3a9743,null))[_0xf9ba('0x12')](function(_0x27e21d){if(_0x27e21d){return _0x27e21d[_0xf9ba('0xe4')](_0x10111d['body'][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0x10111d[_0xf9ba('0x49')],[_0xf9ba('0x5f'),'id'])||{});}})[_0xf9ba('0x12')](respondWithResult(_0x3a9743,null))[_0xf9ba('0x1c')](handleError(_0x3a9743,null));};exports[_0xf9ba('0xe6')]=function(_0x1a71d5,_0x3f71da){var _0x5077f5={'raw':![],'where':{}};var _0x3b0f9e={};var _0x5c6842={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')]['findOne']({'where':{'id':_0x1a71d5[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f71da,null))['then'](function(_0x17a798){if(_0x17a798){_0x3b0f9e[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0xa5')][_0xf9ba('0x2d')]);_0x3b0f9e[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x1a71d5['query']);_0x3b0f9e[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x3b0f9e['model'],_0x3b0f9e[_0xf9ba('0x31')]);_0x5077f5[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3b0f9e[_0xf9ba('0x2f')],qs['fields'](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x5077f5[_0xf9ba('0x34')]=_0x5077f5[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x5077f5[_0xf9ba('0x34')]:_0x3b0f9e[_0xf9ba('0x2f')];if(!_0x1a71d5['query'][_0xf9ba('0x59')]('nolimit')){_0x5077f5[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x5077f5['offset']=qs[_0xf9ba('0x20')](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x5077f5[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x1a71d5['query'][_0xf9ba('0x39')]);_0x5077f5[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x1a71d5[_0xf9ba('0x31')],_0x3b0f9e[_0xf9ba('0x32')]));_0x5077f5[_0xf9ba('0x3b')]['ChatWebsiteId']=_0x17a798['id'];if(_0x1a71d5['query']['filter']){_0x5077f5['where']=_[_0xf9ba('0x3e')](_0x5077f5['where'],{'$or':_[_0xf9ba('0x30')](_0x5077f5[_0xf9ba('0x34')],function(_0x395bb2){var _0x15487f={};_0x15487f[_0x395bb2]={'$like':'%'+_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x15487f;})});}_0x5077f5=_[_0xf9ba('0x3e')]({},_0x5077f5,_0x1a71d5['options']);return db[_0xf9ba('0xa5')][_0xf9ba('0x23')]({'where':_0x5077f5[_0xf9ba('0x3b')]})[_0xf9ba('0x12')](function(_0x273c14){_0x5c6842[_0xf9ba('0x23')]=_0x273c14;if(_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x5077f5['include']=[{'model':db[_0xf9ba('0x8b')],'as':_0xf9ba('0xe7'),'required':![]},{'model':db['User'],'as':_0xf9ba('0xe8'),'attributes':[_0xf9ba('0x28'),_0xf9ba('0xe9'),_0xf9ba('0xea')],'required':![]},{'model':db[_0xf9ba('0xeb')],'as':_0xf9ba('0xec'),'attributes':['id',_0xf9ba('0x28'),_0xf9ba('0xed')],'where':_0x1a71d5[_0xf9ba('0x31')]['tag']?{'id':_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0xee')]}:undefined,'required':_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0xee')]?!![]:![]}];}return db[_0xf9ba('0xa5')][_0xf9ba('0x41')](_0x5077f5);})[_0xf9ba('0x12')](function(_0x3bc494){_0x5c6842[_0xf9ba('0x42')]=_0x3bc494;return _0x5c6842;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3f71da,_0x5077f5))[_0xf9ba('0x1c')](handleError(_0x3f71da,null));};function iftimePromise(_0x3ff5f6,_0x1c1175){return respondWithRpcPromise(_0xf9ba('0xef'),_0xf9ba('0xf0'),{'command':_0x1c1175[_0xf9ba('0xf1')]?util[_0xf9ba('0x9d')](_0xf9ba('0xf2'),_0x3ff5f6['interval'],_0x1c1175[_0xf9ba('0xf1')]):util[_0xf9ba('0x9d')](_0xf9ba('0xf3'),_0x3ff5f6[_0xf9ba('0xf4')])},client9002)[_0xf9ba('0x12')](function(_0x3dd1f2){var _0x1759db=_0x3dd1f2&&_0x3dd1f2[_0xf9ba('0xf5')](_0xf9ba('0xf6'))>=0x0?!![]:![];logger[_0xf9ba('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1c1175['id'],_0x3ff5f6['id'],_0x3ff5f6[_0xf9ba('0xf4')],_0x1759db?_0xf9ba('0xf7'):_0xf9ba('0xf8'),_0x1c1175['timezone']?_0x1c1175[_0xf9ba('0xf1')]:_0xf9ba('0xf9'));return _0x1759db;})[_0xf9ba('0x1c')](function(_0x2edf1f){logger[_0xf9ba('0x17')](_0xf9ba('0xfa'),_0x1c1175['id'],_0x3ff5f6['id'],_0x3ff5f6['interval'],util['inspect'](_0x2edf1f,{'showHidden':![],'depth':null}),_0x1c1175['timezone']?_0x1c1175[_0xf9ba('0xf1')]:_0xf9ba('0xf9'));return![];});}exports[_0xf9ba('0xf0')]=function(_0xbd5e6d,_0xf03974){var _0x556c21=0x0;var _0x318caa=0x0;var _0x1b6382=![];var _0x2d1c55;var _0x799d84;return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0xbd5e6d[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0xfb')],'as':_0xf9ba('0xfb'),'include':[{'model':db[_0xf9ba('0xfb')],'as':_0xf9ba('0xfc'),'attributes':['id',_0xf9ba('0xf4')],'raw':!![]}]}]})[_0xf9ba('0x12')](handleEntityNotFound(_0xf03974,null))[_0xf9ba('0x12')](function(_0x4eedfb){if(_0x4eedfb){_0x2d1c55=_0x4eedfb;return _0x4eedfb[_0xf9ba('0xfd')]({'raw':!![]});}})[_0xf9ba('0x12')](function(_0x5351cd){if(_0x2d1c55){if(_0x5351cd){_0x799d84=_0x5351cd;}}return require(_0xf9ba('0x6b'))[_0xf9ba('0x6c')]();})[_0xf9ba('0x12')](function(_0xc7f42f){if(_0xc7f42f){_0x318caa=_0xc7f42f[_0xf9ba('0xfe')];_0x1b6382=_0xc7f42f[_0xf9ba('0x6d')];}})['then'](function(){return db[_0xf9ba('0xa5')]['count']({'where':{'closed':![]}});})[_0xf9ba('0x12')](function(_0x5e1279){_0x556c21=_0x5e1279;if(_0x318caa&&_0x5e1279>_0x318caa){return db['License'][_0xf9ba('0x58')]({'where':{'id':0x1}})[_0xf9ba('0x12')](function(_0x5bce55){if(_0x5bce55){_0x5bce55[_0xf9ba('0xff')](_0xf9ba('0x100'));}});}})[_0xf9ba('0x12')](function(){if(_0x2d1c55[_0xf9ba('0xfb')]&&_0x2d1c55[_0xf9ba('0xfb')]['Intervals']){var _0xbba012=[];for(var _0x1f0e78=0x0;_0x1f0e78<_0x2d1c55['Interval'][_0xf9ba('0xfc')][_0xf9ba('0x36')];_0x1f0e78++){var _0x4ee213=_0x2d1c55[_0xf9ba('0xfb')][_0xf9ba('0xfc')][_0x1f0e78][_0xf9ba('0x4d')]({'plain':!![]});_0xbba012[_0xf9ba('0xad')](iftimePromise(_0x4ee213,_0x2d1c55));}return BPromise[_0xf9ba('0x101')](_0xbba012)[_0xf9ba('0x12')](function(_0x2b6aed){return _[_0xf9ba('0x102')](_0x2b6aed);});}else{return!![];}})['then'](function(_0x37f444){var _0x58aa31=fs[_0xf9ba('0x103')](path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x104')),'utf8');var _0x15b951=new url[(_0xf9ba('0x105'))](_0x2d1c55[_0xf9ba('0x106')])[_0xf9ba('0x107')];var _0x3cd632=_0xf9ba('0x108');var _0x7e6c0e=![];var _0x25f99f={'chatVersion':_0x3cd632,'chatWebsiteAddressOrigin':_0x15b951,'remote':_0x2d1c55[_0xf9ba('0x109')],'query':querystring[_0xf9ba('0xa3')](_['merge'](_0x2d1c55[_0xf9ba('0x4d')]({'plain':!![]}),{'customerIp':_0xbd5e6d[_0xf9ba('0x93')][_0xf9ba('0x94')]||_0xbd5e6d[_0xf9ba('0x93')]['x-real-ip']||_0xbd5e6d['connection'][_0xf9ba('0x10a')]||_0xbd5e6d['ip'],'referer':_0xbd5e6d[_0xf9ba('0x93')][_0xf9ba('0x9a')],'openedInteractions':_0x556c21,'maxInteractions':_0x318caa,'virtual':_0x1b6382['virtual'],'online':_0x37f444,'custom':_0x1b6382}))['replace'](/'/g,'\x5c\x27')};_0xf03974[_0xf9ba('0xbc')](ejs['render'](Mustache[_0xf9ba('0xc5')](_0x58aa31,_0x25f99f),{'proactiveActions':_0x799d84,'alignment':_0x2d1c55[_0xf9ba('0x10b')],'verticalAlignment':_0x2d1c55[_0xf9ba('0x10c')],'div_color':_0x2d1c55[_0xf9ba('0xed')],'labelText':_0x2d1c55[_0xf9ba('0x10d')],'text_color':_0x2d1c55['textColor'],'text_button_color':_0x2d1c55[_0xf9ba('0x10e')],'button_color':_0x2d1c55['color_button'],'background_color':_0x2d1c55[_0xf9ba('0x10f')],'hideWhenOffline':_0x2d1c55['hideWhenOffline'],'intervalId':_0x2d1c55['IntervalId'],'isDevelopment':_0x7e6c0e,'chatVersion':_0x3cd632}));})['catch'](handleError(_0xf03974,null));};exports[_0xf9ba('0x110')]=function(_0x55deb2,_0x58e8ae){var _0x136338=_0x55deb2['params']['id'];var _0x1dec8f=_0x55deb2[_0xf9ba('0x49')];var _0x2a321e=0xc8;var _0x116d31=null;return db[_0xf9ba('0x111')][_0xf9ba('0x112')]({'isolationLevel':db[_0xf9ba('0x111')][_0xf9ba('0x113')][_0xf9ba('0x114')]['READ_COMMITTED']},function(_0x31b987){return db['ChatWebsite'][_0xf9ba('0x58')]({'where':{'id':_0x136338},'transaction':_0x31b987})['then'](function(_0x75371a){if(_0x75371a){return db[_0xf9ba('0x115')][_0xf9ba('0x52')]({'where':{'ChatWebsiteId':_0x136338},'transaction':_0x31b987})[_0xf9ba('0x12')](function(){var _0x403275=_[_0xf9ba('0x30')](_0x1dec8f,function(_0x2d3de4){_0x2d3de4[_0xf9ba('0x55')]=_0x136338;return _0x2d3de4;});return db[_0xf9ba('0x115')][_0xf9ba('0xd0')](_0x403275,{'transaction':_0x31b987});});}else{_0x2a321e=0x194;_0x116d31=[];}});})[_0xf9ba('0x12')](function(){if(_0x2a321e!==0x194){return db[_0xf9ba('0x115')][_0xf9ba('0x116')]({'where':{'ChatWebsiteId':_0x136338},'order':_0xf9ba('0x90')})[_0xf9ba('0x12')](function(_0xf2cecc){_0x116d31=_0xf2cecc;});}})[_0xf9ba('0x1c')](function(_0x1fd7eb){_0x2a321e=0x1f4;logger['error'](_0x1fd7eb[_0xf9ba('0x117')]);if(_0x1fd7eb[_0xf9ba('0x28')]){delete _0x1fd7eb[_0xf9ba('0x28')];}_0x116d31=_0x1fd7eb;})['finally'](function(){if(_0x116d31===null){_0x58e8ae[_0xf9ba('0x1d')](_0x2a321e);}else{if(_0x2a321e===0x1f4){_0x58e8ae[_0xf9ba('0x1e')](_0x2a321e)['send'](_0x116d31);}else{_0x58e8ae['status'](_0x2a321e)['json'](_0x116d31);}}});};exports[_0xf9ba('0x118')]=function(_0x165d68,_0x58b4af){var _0x5e08a6={};var _0x5b4119={};var _0x3c8bd9;var _0x2210c8;return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x165d68[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x58b4af,null))[_0xf9ba('0x12')](function(_0x3a7739){if(_0x3a7739){_0x3c8bd9=_0x3a7739;_0x5b4119[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x115')][_0xf9ba('0x2d')]);_0x5b4119['query']=_[_0xf9ba('0x45')](_0x165d68['query']);_0x5b4119[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x5b4119[_0xf9ba('0x2f')],_0x5b4119[_0xf9ba('0x31')]);_0x5e08a6[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x5b4119[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0x165d68['query']['fields']));_0x5e08a6[_0xf9ba('0x34')]=_0x5e08a6[_0xf9ba('0x34')]['length']?_0x5e08a6[_0xf9ba('0x34')]:_0x5b4119['model'];_0x5e08a6[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x165d68['query']['sort']);_0x5e08a6[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x165d68[_0xf9ba('0x31')],_0x5b4119[_0xf9ba('0x32')]));if(_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x5e08a6['where']=_[_0xf9ba('0x3e')](_0x5e08a6[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x5e08a6[_0xf9ba('0x34')],function(_0x23892d){var _0x7b0dc6={};_0x7b0dc6[_0x23892d]={'$like':'%'+_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x7b0dc6;})});}_0x5e08a6=_[_0xf9ba('0x3e')]({},_0x5e08a6,_0x165d68[_0xf9ba('0x46')]);return _0x3c8bd9[_0xf9ba('0x118')](_0x5e08a6);}})['then'](function(_0x29b566){if(_0x29b566){_0x2210c8=_0x29b566['length'];if(!_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x59')]('nolimit')){_0x5e08a6['limit']=qs['limit'](_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x5e08a6[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x20')]);}return _0x3c8bd9['getApplications'](_0x5e08a6);}})[_0xf9ba('0x12')](function(_0x3fbfb7){if(_0x3fbfb7){return _0x3fbfb7?{'count':_0x2210c8,'rows':_0x3fbfb7}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x58b4af,null))['catch'](handleError(_0x58b4af,null));};exports[_0xf9ba('0x119')]=function(_0x2baa12,_0xcb19ca){return db['chatProactiveAction'][_0xf9ba('0x47')]({'where':{'id':_0x2baa12['params']['id']}})['then'](handleEntityNotFound(_0xcb19ca,null))[_0xf9ba('0x12')](function(_0x5cdfbe){if(_0x5cdfbe){return _0x5cdfbe[_0xf9ba('0x119')](_0x2baa12[_0xf9ba('0x49')][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0x2baa12[_0xf9ba('0x49')],[_0xf9ba('0x5f'),'id'])||{});}})['then'](respondWithResult(_0xcb19ca,null))['catch'](handleError(_0xcb19ca,null));};exports[_0xf9ba('0xfd')]=function(_0x53c0e9,_0x13f46d){var _0x50817f={};var _0x313227={};var _0x1c546b;var _0x8608e9;return db['ChatWebsite'][_0xf9ba('0x58')]({'where':{'id':_0x53c0e9['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x13f46d,null))[_0xf9ba('0x12')](function(_0x31e0e9){if(_0x31e0e9){_0x1c546b=_0x31e0e9;_0x313227[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0x11a')][_0xf9ba('0x2d')]);_0x313227[_0xf9ba('0x31')]=_['keys'](_0x53c0e9['query']);_0x313227[_0xf9ba('0x32')]=_['intersection'](_0x313227[_0xf9ba('0x2f')],_0x313227['query']);_0x50817f[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x313227[_0xf9ba('0x2f')],qs['fields'](_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x50817f['attributes']=_0x50817f[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x50817f[_0xf9ba('0x34')]:_0x313227[_0xf9ba('0x2f')];_0x50817f[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x53c0e9[_0xf9ba('0x31')]['sort']);_0x50817f[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x53c0e9[_0xf9ba('0x31')],_0x313227['filters']));if(_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x50817f[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x50817f[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x50817f[_0xf9ba('0x34')],function(_0x45042c){var _0x1ae822={};_0x1ae822[_0x45042c]={'$like':'%'+_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x1ae822;})});}_0x50817f=_['merge']({},_0x50817f,_0x53c0e9[_0xf9ba('0x46')]);return _0x1c546b[_0xf9ba('0xfd')](_0x50817f);}})[_0xf9ba('0x12')](function(_0x38a9cf){if(_0x38a9cf){_0x8608e9=_0x38a9cf[_0xf9ba('0x36')];if(!_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x50817f[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x53c0e9[_0xf9ba('0x31')]['limit']);_0x50817f[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x53c0e9['query'][_0xf9ba('0x20')]);}return _0x1c546b[_0xf9ba('0xfd')](_0x50817f);}})['then'](function(_0x461791){if(_0x461791){return _0x461791?{'count':_0x8608e9,'rows':_0x461791}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x13f46d,null))[_0xf9ba('0x1c')](handleError(_0x13f46d,null));};exports[_0xf9ba('0x11b')]=function(_0x507c40,_0x1837a6){var _0x47120a=_0x507c40['query'][_0xf9ba('0x11c')]===_0xf9ba('0x11d')?_0xf9ba('0x11e'):_0xf9ba('0x11f');return db['ChatWebsite'][_0xf9ba('0x47')]({'attributes':['id',_0x47120a],'where':{'id':_0x507c40[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x1837a6,null))[_0xf9ba('0x12')](function(_0x1f2457){if(_0x1f2457){var _0x12e201=_0x1f2457[_0x47120a];var _0x46a453=_0x12e201&&_0x12e201[_0xf9ba('0x120')]?_0x12e201[_0xf9ba('0x120')]:[];_0x1837a6['send']({'fromKey':_[_0xf9ba('0x6e')](_0x12e201[_0xf9ba('0x121')])?undefined:_0x12e201[_0xf9ba('0x121')],'count':_0x46a453[_0xf9ba('0x36')],'rows':_0x46a453});}})[_0xf9ba('0x1c')](handleError(_0x1837a6,null));};exports[_0xf9ba('0x122')]=function(_0x310516,_0x4293e9){var _0x405013={'raw':![],'where':{}};var _0x457094={};var _0x53978b={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x310516[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x4293e9,null))[_0xf9ba('0x12')](function(_0x4f0a4e){if(_0x4f0a4e){_0x457094[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0xc6')][_0xf9ba('0x2d')]);_0x457094[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x310516[_0xf9ba('0x31')]);_0x457094[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x457094['model'],_0x457094['query']);_0x405013[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x457094[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0x310516['query'][_0xf9ba('0x35')]));_0x405013[_0xf9ba('0x34')]=_0x405013[_0xf9ba('0x34')]['length']?_0x405013[_0xf9ba('0x34')]:_0x457094[_0xf9ba('0x2f')];if(!_0x310516[_0xf9ba('0x31')]['hasOwnProperty']('nolimit')){_0x405013[_0xf9ba('0x22')]=qs['limit'](_0x310516['query'][_0xf9ba('0x22')]);_0x405013[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x310516[_0xf9ba('0x31')]['offset']);}_0x405013[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x310516[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x405013['where']=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x310516[_0xf9ba('0x31')],_0x457094[_0xf9ba('0x32')]));_0x405013[_0xf9ba('0x3b')]['ChatWebsiteId']=_0x4f0a4e['id'];if(_0x310516[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x405013[_0xf9ba('0x3b')]=_['merge'](_0x405013[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x405013[_0xf9ba('0x34')],function(_0x54f76e){var _0x143828={};_0x143828[_0x54f76e]={'$like':'%'+_0x310516['query'][_0xf9ba('0x3d')]+'%'};return _0x143828;})});}_0x405013=_[_0xf9ba('0x3e')]({},_0x405013,_0x310516[_0xf9ba('0x46')]);return db[_0xf9ba('0xc6')][_0xf9ba('0x23')]({'where':_0x405013['where']})[_0xf9ba('0x12')](function(_0x310b7c){_0x53978b['count']=_0x310b7c;if(_0x310516[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x405013[_0xf9ba('0x40')]=[{'all':!![]}];}else{_0x405013[_0xf9ba('0x40')]=[{'model':db['CmContact'],'as':_0xf9ba('0xe7'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xf9ba('0xc6')][_0xf9ba('0x41')](_0x405013);})[_0xf9ba('0x12')](function(_0x17c2b4){_0x53978b[_0xf9ba('0x42')]=_0x17c2b4;return _0x53978b;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x4293e9,_0x405013))[_0xf9ba('0x1c')](handleError(_0x4293e9,null));};exports[_0xf9ba('0x123')]=function(_0xd52a03,_0x4b4c99){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0xd52a03[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x4b4c99,null))[_0xf9ba('0x12')](function(_0x5a7b9b){if(_0x5a7b9b){return _0x5a7b9b[_0xf9ba('0x123')](_0xd52a03[_0xf9ba('0x49')][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0xd52a03[_0xf9ba('0x49')],['ids','id'])||{})[_0xf9ba('0xa9')](function(_0x118cbe){for(var _0x22fcf2=0x0;_0x22fcf2<_0xd52a03['body'][_0xf9ba('0x5f')][_0xf9ba('0x36')];_0x22fcf2+=0x1){socket['emit'](_0xf9ba('0x124'),{'UserId':Number(_0xd52a03[_0xf9ba('0x49')][_0xf9ba('0x5f')][_0x22fcf2]),'ChatWebsiteId':Number(_0xd52a03[_0xf9ba('0x44')]['id'])});}return _0x118cbe;});}})[_0xf9ba('0x12')](respondWithResult(_0x4b4c99,null))[_0xf9ba('0x1c')](handleError(_0x4b4c99,null));};exports['removeAgents']=function(_0x48add1,_0x1bfd5e){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x48add1[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x1bfd5e,null))[_0xf9ba('0x12')](function(_0x24263c){if(_0x24263c){return _0x24263c[_0xf9ba('0x125')](_0x48add1['query'][_0xf9ba('0x5f')])[_0xf9ba('0x12')](function(){if(_[_0xf9ba('0x126')](_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')])){for(var _0x3b88f0=0x0;_0x3b88f0<_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')][_0xf9ba('0x36')];_0x3b88f0+=0x1){socket[_0xf9ba('0x127')](_0xf9ba('0x128'),{'UserId':Number(_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')][_0x3b88f0]),'ChatWebsiteId':Number(_0x48add1[_0xf9ba('0x44')]['id'])});}}else{socket[_0xf9ba('0x127')](_0xf9ba('0x128'),{'UserId':Number(_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')]),'ChatWebsiteId':Number(_0x48add1[_0xf9ba('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bfd5e,null))[_0xf9ba('0x1c')](handleError(_0x1bfd5e,null));};exports[_0xf9ba('0x129')]=function(_0x1140e4,_0x5ebcf7){var _0x12b50d={};var _0x19e632={};var _0x37bb7b;var _0x403553;return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x1140e4['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x5ebcf7,null))['then'](function(_0xed6935){if(_0xed6935){_0x37bb7b=_0xed6935;_0x19e632[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0xb4')]['rawAttributes']);_0x19e632[_0xf9ba('0x31')]=_['keys'](_0x1140e4[_0xf9ba('0x31')]);_0x19e632[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x19e632[_0xf9ba('0x2f')],_0x19e632[_0xf9ba('0x31')]);_0x12b50d[_0xf9ba('0x34')]=_['intersection'](_0x19e632[_0xf9ba('0x2f')],qs['fields'](_0x1140e4[_0xf9ba('0x31')]['fields']));_0x12b50d[_0xf9ba('0x34')]=_0x12b50d[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x12b50d[_0xf9ba('0x34')]:_0x19e632['model'];_0x12b50d[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x12b50d[_0xf9ba('0x3b')]=qs['filters'](_[_0xf9ba('0x3a')](_0x1140e4[_0xf9ba('0x31')],_0x19e632[_0xf9ba('0x32')]));if(_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x12b50d[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x12b50d[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x12b50d[_0xf9ba('0x34')],function(_0x256764){var _0x252e7e={};_0x252e7e[_0x256764]={'$like':'%'+_0x1140e4[_0xf9ba('0x31')]['filter']+'%'};return _0x252e7e;})});}_0x12b50d=_[_0xf9ba('0x3e')]({},_0x12b50d,_0x1140e4['options']);return _0x37bb7b[_0xf9ba('0x129')](_0x12b50d);}})[_0xf9ba('0x12')](function(_0xa15996){if(_0xa15996){_0x403553=_0xa15996[_0xf9ba('0x36')];if(!_0x1140e4[_0xf9ba('0x31')]['hasOwnProperty'](_0xf9ba('0x37'))){_0x12b50d[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x12b50d[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x20')]);}return _0x37bb7b[_0xf9ba('0x129')](_0x12b50d);}})[_0xf9ba('0x12')](function(_0x37e4d6){if(_0x37e4d6){return _0x37e4d6?{'count':_0x403553,'rows':_0x37e4d6}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x5ebcf7,null))[_0xf9ba('0x1c')](handleError(_0x5ebcf7,null));}; \ No newline at end of file +var _0x47cb=['json','offset','undefined','limit','Content-Range','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','type','filter','merge','count','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','findOne','Disposition','rows','removeDispositions','ids','getAnswers','CannedAnswer','addLogo','sitepic','file','filename','addAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','isNil','from','Sequelize','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','ChatApplication','Applications','List','account','applications','orderBy','ListId','customerIp','headers','cf-connecting-ip','first','split','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','firstName','lastName','messageId','created','autoclose','close','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','EventManager','notify','offline','files','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','basename','sequelize','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','openNewInteraction','MailAccountId','mimetype','subjectOffline','toPairsIn','email','Chat','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Intervals','getProactiveActions','../../config/license/util','virtual','License','chatLicenseExceeded','Interval','push','all','some','utf8','URL','address','origin','3.1.0','remote','x-forwarded-for','connection','remoteAddress','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47cb,0x10a));var _0xb47c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x47cb[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xb47c('0x0'));var Mustache=require(_0xb47c('0x1'));var util=require(_0xb47c('0x2'));var path=require(_0xb47c('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb47c('0x4'));var _=require(_0xb47c('0x5'));var querystring=require(_0xb47c('0x6'));var Redis=require('ioredis');var qs=require(_0xb47c('0x7'));var logger=require(_0xb47c('0x8'))(_0xb47c('0x9'));var config=require(_0xb47c('0xa'));var url=require(_0xb47c('0xb'));var db=require(_0xb47c('0xc'))['db'];config[_0xb47c('0xd')]=_[_0xb47c('0xe')](config[_0xb47c('0xd')],{'host':_0xb47c('0xf'),'port':0x18eb});var socket=require(_0xb47c('0x10'))(new Redis(config[_0xb47c('0xd')]));require(_0xb47c('0x11'))[_0xb47c('0x12')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xb47c('0x13'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xb47c('0x14')]({'port':0x232a});var client9003=jayson[_0xb47c('0x15')]['http']({'port':0x232b});var client9001=jayson[_0xb47c('0x15')]['http']({'port':0x2329});function respondWithRpcPromise(_0x598987,_0x50f0a5,_0xdbd0d3,_0x37f581){return new BPromise(function(_0xbe1058,_0x8b3b30){var _0x2cf6a2=_0x37f581||client;return _0x2cf6a2[_0xb47c('0x16')](_0x598987,_0xdbd0d3)[_0xb47c('0x17')](function(_0xdd4e37){logger[_0xb47c('0x18')](_0xb47c('0x19'),_0x50f0a5,_0xb47c('0x1a'));logger[_0xb47c('0x1b')](_0xb47c('0x1c'),_0x50f0a5,_0xb47c('0x1a'),JSON[_0xb47c('0x1d')](_0xdd4e37));if(_0xdd4e37['error']){if(_0xdd4e37[_0xb47c('0x1e')][_0xb47c('0x1f')]===0x1f4){logger['error'](_0xb47c('0x19'),_0x50f0a5,_0xdd4e37[_0xb47c('0x1e')][_0xb47c('0x20')]);return _0x8b3b30(_0xdd4e37['error']['message']);}logger[_0xb47c('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x50f0a5,_0xdd4e37['error'][_0xb47c('0x20')]);return _0xbe1058(_0xdd4e37[_0xb47c('0x1e')][_0xb47c('0x20')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x50f0a5,_0xb47c('0x1a'));_0xbe1058(_0xdd4e37[_0xb47c('0x21')][_0xb47c('0x20')]);}})[_0xb47c('0x22')](function(_0x346442){logger[_0xb47c('0x1e')](_0xb47c('0x19'),_0x50f0a5,_0x346442);_0x8b3b30(_0x346442);});});}function respondWithStatusCode(_0x46adaf,_0x4400c8){_0x4400c8=_0x4400c8||0xcc;return function(_0x152965){if(_0x152965){return _0x46adaf[_0xb47c('0x23')](_0x4400c8);}return _0x46adaf[_0xb47c('0x24')](_0x4400c8)[_0xb47c('0x25')]();};}function respondWithResult(_0x1ab52f,_0x5a4044){_0x5a4044=_0x5a4044||0xc8;return function(_0x58505a){if(_0x58505a){return _0x1ab52f[_0xb47c('0x24')](_0x5a4044)[_0xb47c('0x26')](_0x58505a);}};}function respondWithFilteredResult(_0x2e7d22,_0x5842d3){return function(_0x4ca585){if(_0x4ca585){var _0x54021a=typeof _0x5842d3[_0xb47c('0x27')]===_0xb47c('0x28')&&typeof _0x5842d3[_0xb47c('0x29')]===_0xb47c('0x28');var _0x5c7e4b=_0x4ca585['count'];var _0x35131d=_0x54021a?0x0:_0x5842d3[_0xb47c('0x27')];var _0x2f6cb9=_0x54021a?_0x4ca585['count']:_0x5842d3[_0xb47c('0x27')]+_0x5842d3[_0xb47c('0x29')];var _0x3e6024;if(_0x2f6cb9>=_0x5c7e4b){_0x2f6cb9=_0x5c7e4b;_0x3e6024=0xc8;}else{_0x3e6024=0xce;}_0x2e7d22['status'](_0x3e6024);return _0x2e7d22['set'](_0xb47c('0x2a'),_0x35131d+'-'+_0x2f6cb9+'/'+_0x5c7e4b)['json'](_0x4ca585);}return null;};}function saveUpdates(_0x453baa){return function(_0x5ea664){if(_0x5ea664){return _0x5ea664[_0xb47c('0x2b')](_0x453baa)['then'](function(_0x3efdbf){return _0x3efdbf;});}return null;};}function removeEntity(_0x5dfd0c){return function(_0x379877){if(_0x379877){return _0x379877[_0xb47c('0x2c')]()[_0xb47c('0x17')](function(){var _0x191f76=_0x379877[_0xb47c('0x2d')]({'plain':!![]});var _0x2e83fe='ChatWebsites';return db[_0xb47c('0x2e')]['destroy']({'where':{'type':_0x2e83fe,'resourceId':_0x191f76['id']}})[_0xb47c('0x17')](function(){return _0x379877;});})[_0xb47c('0x17')](function(){_0x5dfd0c['status'](0xcc)[_0xb47c('0x25')]();});}};}function handleEntityNotFound(_0x2f2817){return function(_0x22babe){if(!_0x22babe){_0x2f2817[_0xb47c('0x23')](0x194);}return _0x22babe;};}function handleError(_0x13d4a1,_0x445b32){_0x445b32=_0x445b32||0x1f4;return function(_0x1b8a87){logger[_0xb47c('0x1e')](_0x1b8a87[_0xb47c('0x2f')]);if(_0x1b8a87[_0xb47c('0x30')]){delete _0x1b8a87[_0xb47c('0x30')];}_0x13d4a1[_0xb47c('0x24')](_0x445b32)[_0xb47c('0x31')](_0x1b8a87);};}exports['index']=function(_0x476d23,_0x462830){var _0x3763d9={'include':[{'model':db[_0xb47c('0x32')],'as':_0xb47c('0x33')}]},_0x41311d={},_0x1aa1a6={'count':0x0,'rows':[]};var _0x5dedc6=_[_0xb47c('0x34')](db[_0xb47c('0x35')][_0xb47c('0x36')],function(_0x7d2dad){return{'name':_0x7d2dad[_0xb47c('0x37')],'type':_0x7d2dad['type'][_0xb47c('0x38')]};});_0x41311d[_0xb47c('0x39')]=_[_0xb47c('0x34')](_0x5dedc6,_0xb47c('0x30'));_0x41311d['query']=_[_0xb47c('0x3a')](_0x476d23[_0xb47c('0x3b')]);_0x41311d['filters']=_[_0xb47c('0x3c')](_0x41311d[_0xb47c('0x39')],_0x41311d[_0xb47c('0x3b')]);_0x3763d9[_0xb47c('0x3d')]=_[_0xb47c('0x3c')](_0x41311d[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0x476d23['query'][_0xb47c('0x3e')]));_0x3763d9[_0xb47c('0x3d')]=_0x3763d9[_0xb47c('0x3d')][_0xb47c('0x3f')]?_0x3763d9[_0xb47c('0x3d')]:_0x41311d[_0xb47c('0x39')];if(!_0x476d23['query'][_0xb47c('0x40')](_0xb47c('0x41'))){_0x3763d9['limit']=qs[_0xb47c('0x29')](_0x476d23[_0xb47c('0x3b')]['limit']);_0x3763d9[_0xb47c('0x27')]=qs[_0xb47c('0x27')](_0x476d23[_0xb47c('0x3b')]['offset']);}_0x3763d9[_0xb47c('0x42')]=qs[_0xb47c('0x43')](_0x476d23[_0xb47c('0x3b')][_0xb47c('0x43')]);_0x3763d9[_0xb47c('0x44')]=qs['filters'](_[_0xb47c('0x45')](_0x476d23['query'],_0x41311d[_0xb47c('0x46')]),_0x5dedc6);if(_0x476d23['query']['filter']){_0x3763d9[_0xb47c('0x44')]=_['merge'](_0x3763d9['where'],{'$or':_['map'](_0x5dedc6,function(_0x1101cf){if(_0x1101cf[_0xb47c('0x47')]!=='VIRTUAL'){var _0x17c32e={};_0x17c32e[_0x1101cf[_0xb47c('0x30')]]={'$like':'%'+_0x476d23[_0xb47c('0x3b')][_0xb47c('0x48')]+'%'};return _0x17c32e;}})});}_0x3763d9=_[_0xb47c('0x49')]({},_0x3763d9,_0x476d23['options']);var _0x16ee1d={'where':_0x3763d9['where']};return db[_0xb47c('0x35')][_0xb47c('0x4a')](_0x16ee1d)[_0xb47c('0x17')](function(_0x11c012){_0x1aa1a6[_0xb47c('0x4a')]=_0x11c012;if(_0x476d23['query'][_0xb47c('0x4b')]){_0x3763d9[_0xb47c('0x4c')]=[{'all':!![]}];}return db[_0xb47c('0x35')][_0xb47c('0x4d')](_0x3763d9);})[_0xb47c('0x17')](function(_0x291ccf){_0x1aa1a6['rows']=_0x291ccf;return _0x1aa1a6;})[_0xb47c('0x17')](respondWithFilteredResult(_0x462830,_0x3763d9))['catch'](handleError(_0x462830,null));};exports[_0xb47c('0x4e')]=function(_0x21abf6,_0x3fe7ae){var _0x443008={'raw':![],'where':{'id':_0x21abf6[_0xb47c('0x4f')]['id']},'include':[{'model':db[_0xb47c('0x32')],'as':_0xb47c('0x33')}]},_0x1e0f35={};_0x1e0f35[_0xb47c('0x39')]=_[_0xb47c('0x3a')](db['ChatWebsite'][_0xb47c('0x36')]);_0x1e0f35['query']=_[_0xb47c('0x3a')](_0x21abf6[_0xb47c('0x3b')]);_0x1e0f35[_0xb47c('0x46')]=_[_0xb47c('0x3c')](_0x1e0f35[_0xb47c('0x39')],_0x1e0f35[_0xb47c('0x3b')]);_0x443008[_0xb47c('0x3d')]=_['intersection'](_0x1e0f35[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0x21abf6[_0xb47c('0x3b')]['fields']));_0x443008['attributes']=_0x443008[_0xb47c('0x3d')][_0xb47c('0x3f')]?_0x443008[_0xb47c('0x3d')]:_0x1e0f35['model'];if(_0x21abf6['query'][_0xb47c('0x4b')]){_0x443008['include']=[{'all':!![]}];}_0x443008=_[_0xb47c('0x49')]({},_0x443008,_0x21abf6[_0xb47c('0x50')]);return db[_0xb47c('0x35')][_0xb47c('0x51')](_0x443008)[_0xb47c('0x17')](handleEntityNotFound(_0x3fe7ae,null))[_0xb47c('0x17')](respondWithResult(_0x3fe7ae,null))[_0xb47c('0x22')](handleError(_0x3fe7ae,null));};exports[_0xb47c('0x52')]=function(_0x4e7410,_0x29828b){return db[_0xb47c('0x35')]['create'](_0x4e7410[_0xb47c('0x53')],{})[_0xb47c('0x17')](function(_0x55cf38){var _0x2a4d1c=_0x4e7410[_0xb47c('0x54')][_0xb47c('0x2d')]({'plain':!![]});if(!_0x2a4d1c)throw new Error(_0xb47c('0x55'));if(_0x2a4d1c['role']==='user'){var _0x1a2bcd=_0x55cf38['get']({'plain':!![]});var _0x5f41ee=_0xb47c('0x56');return db[_0xb47c('0x57')][_0xb47c('0x51')]({'where':{'name':_0x5f41ee,'userProfileId':_0x2a4d1c[_0xb47c('0x58')]},'raw':!![]})['then'](function(_0x2704bf){if(_0x2704bf&&_0x2704bf[_0xb47c('0x59')]===0x0){return db[_0xb47c('0x2e')][_0xb47c('0x52')]({'name':_0x1a2bcd[_0xb47c('0x30')],'resourceId':_0x1a2bcd['id'],'type':_0x2704bf['name'],'sectionId':_0x2704bf['id']},{})[_0xb47c('0x17')](function(){return _0x55cf38;});}else{return _0x55cf38;}})[_0xb47c('0x22')](function(_0x321c4b){logger['error'](_0xb47c('0x5a'),_0x321c4b);throw _0x321c4b;});}return _0x55cf38;})[_0xb47c('0x17')](respondWithResult(_0x29828b,0xc9))[_0xb47c('0x22')](handleError(_0x29828b,null));};exports['update']=function(_0x2e422c,_0x164322){if(_0x2e422c[_0xb47c('0x53')]['id']){delete _0x2e422c[_0xb47c('0x53')]['id'];}return db['ChatWebsite'][_0xb47c('0x51')]({'where':{'id':_0x2e422c[_0xb47c('0x4f')]['id']},'include':[{'model':db[_0xb47c('0x32')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x164322,null))[_0xb47c('0x17')](saveUpdates(_0x2e422c['body'],null))[_0xb47c('0x17')](respondWithResult(_0x164322,null))[_0xb47c('0x22')](handleError(_0x164322,null));};exports[_0xb47c('0x2c')]=function(_0x3c1692,_0x49c2d6){return db['ChatWebsite'][_0xb47c('0x51')]({'where':{'id':_0x3c1692[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x49c2d6,null))[_0xb47c('0x17')](removeEntity(_0x49c2d6,null))[_0xb47c('0x22')](handleError(_0x49c2d6,null));};exports[_0xb47c('0x5b')]=function(_0xe71829,_0x3a491c){return db[_0xb47c('0x35')][_0xb47c('0x5b')]()[_0xb47c('0x17')](respondWithResult(_0x3a491c,null))[_0xb47c('0x22')](handleError(_0x3a491c,null));};exports[_0xb47c('0x5c')]=function(_0x40654b,_0x20ccd1){if(_0x40654b[_0xb47c('0x53')]['id']){delete _0x40654b['body']['id'];}return db[_0xb47c('0x35')][_0xb47c('0x51')]({'where':{'id':_0x40654b[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x20ccd1,null))[_0xb47c('0x17')](function(_0x3e24f9){if(_0x3e24f9){_0x40654b[_0xb47c('0x53')][_0xb47c('0x5d')]=_0x3e24f9['id'];return db['Disposition'][_0xb47c('0x52')](_0x40654b[_0xb47c('0x53')]);}})[_0xb47c('0x17')](respondWithResult(_0x20ccd1,null))[_0xb47c('0x22')](handleError(_0x20ccd1,null));};exports['getDispositions']=function(_0x301bd1,_0x5342a8){var _0x4e85e5={'raw':![],'where':{}};var _0x5d27b8={};var _0x2efb79={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb47c('0x5e')]({'where':{'id':_0x301bd1['params']['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x5342a8,null))[_0xb47c('0x17')](function(_0x559efd){if(_0x559efd){_0x5d27b8[_0xb47c('0x39')]=_[_0xb47c('0x3a')](db[_0xb47c('0x5f')][_0xb47c('0x36')]);_0x5d27b8[_0xb47c('0x3b')]=_['keys'](_0x301bd1['query']);_0x5d27b8[_0xb47c('0x46')]=_[_0xb47c('0x3c')](_0x5d27b8[_0xb47c('0x39')],_0x5d27b8[_0xb47c('0x3b')]);_0x4e85e5[_0xb47c('0x3d')]=_[_0xb47c('0x3c')](_0x5d27b8[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0x301bd1['query'][_0xb47c('0x3e')]));_0x4e85e5['attributes']=_0x4e85e5[_0xb47c('0x3d')][_0xb47c('0x3f')]?_0x4e85e5[_0xb47c('0x3d')]:_0x5d27b8[_0xb47c('0x39')];if(!_0x301bd1[_0xb47c('0x3b')][_0xb47c('0x40')]('nolimit')){_0x4e85e5['limit']=qs[_0xb47c('0x29')](_0x301bd1[_0xb47c('0x3b')][_0xb47c('0x29')]);_0x4e85e5[_0xb47c('0x27')]=qs[_0xb47c('0x27')](_0x301bd1[_0xb47c('0x3b')]['offset']);}_0x4e85e5[_0xb47c('0x42')]=qs['sort'](_0x301bd1[_0xb47c('0x3b')]['sort']);_0x4e85e5[_0xb47c('0x44')]=qs['filters'](_[_0xb47c('0x45')](_0x301bd1['query'],_0x5d27b8[_0xb47c('0x46')]));_0x4e85e5[_0xb47c('0x44')][_0xb47c('0x5d')]=_0x559efd['id'];if(_0x301bd1['query'][_0xb47c('0x48')]){_0x4e85e5['where']=_[_0xb47c('0x49')](_0x4e85e5[_0xb47c('0x44')],{'$or':_[_0xb47c('0x34')](_0x4e85e5[_0xb47c('0x3d')],function(_0x4d477c){var _0x465dfd={};_0x465dfd[_0x4d477c]={'$like':'%'+_0x301bd1[_0xb47c('0x3b')]['filter']+'%'};return _0x465dfd;})});}_0x4e85e5=_['merge']({},_0x4e85e5,_0x301bd1['options']);return db[_0xb47c('0x5f')]['count']({'where':_0x4e85e5[_0xb47c('0x44')]})[_0xb47c('0x17')](function(_0x40db41){_0x2efb79[_0xb47c('0x4a')]=_0x40db41;if(_0x301bd1[_0xb47c('0x3b')][_0xb47c('0x4b')]){_0x4e85e5[_0xb47c('0x4c')]=[{'all':!![]}];}return db[_0xb47c('0x5f')][_0xb47c('0x4d')](_0x4e85e5);})[_0xb47c('0x17')](function(_0x473d9c){_0x2efb79[_0xb47c('0x60')]=_0x473d9c;return _0x2efb79;});}})['then'](respondWithFilteredResult(_0x5342a8,_0x4e85e5))[_0xb47c('0x22')](handleError(_0x5342a8,null));};exports[_0xb47c('0x61')]=function(_0x73560a,_0x22029b){return db[_0xb47c('0x35')]['find']({'where':{'id':_0x73560a['params']['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x22029b,null))[_0xb47c('0x17')](function(_0x81d877){if(_0x81d877){return _0x81d877[_0xb47c('0x61')](_0x73560a[_0xb47c('0x3b')][_0xb47c('0x62')]);}})[_0xb47c('0x17')](respondWithStatusCode(_0x22029b,null))[_0xb47c('0x22')](handleError(_0x22029b,null));};exports['addAnswer']=function(_0xc84f9a,_0x348a29){if(_0xc84f9a[_0xb47c('0x53')]['id']){delete _0xc84f9a[_0xb47c('0x53')]['id'];}return db['ChatWebsite'][_0xb47c('0x51')]({'where':{'id':_0xc84f9a['params']['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x348a29,null))['then'](function(_0x4e9627){if(_0x4e9627){_0xc84f9a['body'][_0xb47c('0x5d')]=_0x4e9627['id'];return db['CannedAnswer']['create'](_0xc84f9a[_0xb47c('0x53')]);}})[_0xb47c('0x17')](respondWithResult(_0x348a29,null))[_0xb47c('0x22')](handleError(_0x348a29,null));};exports[_0xb47c('0x63')]=function(_0x19ff63,_0x175b65){var _0x3f0ca9={'raw':![],'where':{}};var _0x3047d0={};var _0x363a12={'count':0x0,'rows':[]};return db[_0xb47c('0x35')][_0xb47c('0x5e')]({'where':{'id':_0x19ff63['params']['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x175b65,null))[_0xb47c('0x17')](function(_0x411d3a){if(_0x411d3a){_0x3047d0[_0xb47c('0x39')]=_[_0xb47c('0x3a')](db[_0xb47c('0x64')][_0xb47c('0x36')]);_0x3047d0['query']=_[_0xb47c('0x3a')](_0x19ff63[_0xb47c('0x3b')]);_0x3047d0[_0xb47c('0x46')]=_[_0xb47c('0x3c')](_0x3047d0['model'],_0x3047d0[_0xb47c('0x3b')]);_0x3f0ca9['attributes']=_[_0xb47c('0x3c')](_0x3047d0[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0x19ff63['query'][_0xb47c('0x3e')]));_0x3f0ca9[_0xb47c('0x3d')]=_0x3f0ca9[_0xb47c('0x3d')]['length']?_0x3f0ca9['attributes']:_0x3047d0[_0xb47c('0x39')];if(!_0x19ff63[_0xb47c('0x3b')]['hasOwnProperty']('nolimit')){_0x3f0ca9['limit']=qs[_0xb47c('0x29')](_0x19ff63['query'][_0xb47c('0x29')]);_0x3f0ca9[_0xb47c('0x27')]=qs[_0xb47c('0x27')](_0x19ff63[_0xb47c('0x3b')][_0xb47c('0x27')]);}_0x3f0ca9['order']=qs[_0xb47c('0x43')](_0x19ff63['query'][_0xb47c('0x43')]);_0x3f0ca9[_0xb47c('0x44')]=qs[_0xb47c('0x46')](_[_0xb47c('0x45')](_0x19ff63[_0xb47c('0x3b')],_0x3047d0[_0xb47c('0x46')]));_0x3f0ca9[_0xb47c('0x44')][_0xb47c('0x5d')]=_0x411d3a['id'];if(_0x19ff63['query'][_0xb47c('0x48')]){_0x3f0ca9[_0xb47c('0x44')]=_['merge'](_0x3f0ca9[_0xb47c('0x44')],{'$or':_[_0xb47c('0x34')](_0x3f0ca9[_0xb47c('0x3d')],function(_0x5ed834){var _0x31c1c9={};_0x31c1c9[_0x5ed834]={'$like':'%'+_0x19ff63['query']['filter']+'%'};return _0x31c1c9;})});}_0x3f0ca9=_[_0xb47c('0x49')]({},_0x3f0ca9,_0x19ff63[_0xb47c('0x50')]);return db[_0xb47c('0x64')][_0xb47c('0x4a')]({'where':_0x3f0ca9[_0xb47c('0x44')]})[_0xb47c('0x17')](function(_0x5eba98){_0x363a12[_0xb47c('0x4a')]=_0x5eba98;if(_0x19ff63[_0xb47c('0x3b')][_0xb47c('0x4b')]){_0x3f0ca9[_0xb47c('0x4c')]=[{'all':!![]}];}return db[_0xb47c('0x64')]['findAll'](_0x3f0ca9);})[_0xb47c('0x17')](function(_0x607740){_0x363a12[_0xb47c('0x60')]=_0x607740;return _0x363a12;});}})['then'](respondWithFilteredResult(_0x175b65,_0x3f0ca9))[_0xb47c('0x22')](handleError(_0x175b65,null));};exports['removeAnswers']=function(_0x3bddc7,_0x53141a){return db[_0xb47c('0x35')][_0xb47c('0x51')]({'where':{'id':_0x3bddc7[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x53141a,null))[_0xb47c('0x17')](function(_0x2733c7){if(_0x2733c7){return _0x2733c7['removeAnswers'](_0x3bddc7[_0xb47c('0x3b')][_0xb47c('0x62')]);}})[_0xb47c('0x17')](respondWithStatusCode(_0x53141a,null))[_0xb47c('0x22')](handleError(_0x53141a,null));};exports[_0xb47c('0x65')]=function(_0x5100a2,_0x1e15ed){_0x5100a2['body'][_0xb47c('0x66')]=_0x5100a2[_0xb47c('0x67')][_0xb47c('0x68')];return db[_0xb47c('0x35')]['find']({'where':{'id':_0x5100a2[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x1e15ed,null))[_0xb47c('0x17')](saveUpdates(_0x5100a2[_0xb47c('0x53')],null))[_0xb47c('0x17')](respondWithResult(_0x1e15ed,null))['catch'](handleError(_0x1e15ed,null));};exports[_0xb47c('0x69')]=function(_0x4bf6f8,_0x4455d7){_0x4bf6f8['body']['agentAvatar']=_0x4bf6f8[_0xb47c('0x67')]['filename'];return db['ChatWebsite'][_0xb47c('0x51')]({'where':{'id':_0x4bf6f8[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x4455d7,null))['then'](saveUpdates(_0x4bf6f8[_0xb47c('0x53')],null))[_0xb47c('0x17')](respondWithResult(_0x4455d7,null))[_0xb47c('0x22')](handleError(_0x4455d7,null));};exports['addCustomerAvatar']=function(_0x210b76,_0x32781e){_0x210b76[_0xb47c('0x53')]['customerAvatar']=_0x210b76[_0xb47c('0x67')][_0xb47c('0x68')];return db[_0xb47c('0x35')][_0xb47c('0x51')]({'where':{'id':_0x210b76[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x32781e,null))[_0xb47c('0x17')](saveUpdates(_0x210b76[_0xb47c('0x53')],null))[_0xb47c('0x17')](respondWithResult(_0x32781e,null))['catch'](handleError(_0x32781e,null));};exports[_0xb47c('0x6a')]=function(_0x2910fc,_0x241493){_0x2910fc[_0xb47c('0x53')][_0xb47c('0x6b')]=_0x2910fc[_0xb47c('0x67')][_0xb47c('0x68')];return db[_0xb47c('0x35')][_0xb47c('0x51')]({'where':{'id':_0x2910fc[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x241493,null))['then'](saveUpdates(_0x2910fc[_0xb47c('0x53')],null))[_0xb47c('0x17')](respondWithResult(_0x241493,null))[_0xb47c('0x22')](handleError(_0x241493,null));};exports[_0xb47c('0x6c')]=function(_0x4d059a,_0x3532dc){var _0x1713ff=path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0x6f'));var _0xa2deb9={'where':{'id':_0x4d059a['params']['id']},'attributes':['id',_0xb47c('0x66')],'raw':!![]};var _0x4dc983=![];return require('../../config/license/util')[_0xb47c('0x70')]()[_0xb47c('0x17')](function(_0xec8478){if(_0xec8478){_0x4dc983=_0xec8478[_0xb47c('0x71')];}})['then'](function(){return db['ChatWebsite'][_0xb47c('0x51')](_0xa2deb9);})[_0xb47c('0x17')](handleEntityNotFound(_0x3532dc,null))[_0xb47c('0x17')](function(_0x35850d){if(_0x35850d){if(!_['isNil'](_0x35850d[_0xb47c('0x66')])){if(fs[_0xb47c('0x72')](path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],'server/files/images/logos/',_0x35850d[_0xb47c('0x66')]))&&_0x4dc983){_0x1713ff=path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0x73'),_0x35850d[_0xb47c('0x66')]);}}return _0x3532dc[_0xb47c('0x74')](_0x1713ff);}})[_0xb47c('0x22')](handleError(_0x3532dc,null));};exports[_0xb47c('0x75')]=function(_0x1bb5ed,_0x53995f){var _0x73d10c=path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0x76'));var _0x4b63c3={'where':{'id':_0x1bb5ed[_0xb47c('0x4f')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xb47c('0x35')]['find'](_0x4b63c3)[_0xb47c('0x17')](handleEntityNotFound(_0x53995f,null))[_0xb47c('0x17')](function(_0x35aa85){if(_0x35aa85){if(!_['isNil'](_0x35aa85[_0xb47c('0x77')])){if(fs[_0xb47c('0x72')](path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0x78'),_0x35aa85[_0xb47c('0x77')]))){_0x73d10c=path[_0xb47c('0x6d')](config['root'],_0xb47c('0x78'),_0x35aa85[_0xb47c('0x77')]);}}return _0x53995f[_0xb47c('0x74')](_0x73d10c);}})[_0xb47c('0x22')](handleError(_0x53995f,null));};exports[_0xb47c('0x79')]=function(_0x147a98,_0x4919b0){var _0x13db60=path[_0xb47c('0x6d')](config['root'],_0xb47c('0x7a'));var _0x33cd05={'where':{'id':_0x147a98[_0xb47c('0x4f')]['id']},'attributes':['id',_0xb47c('0x7b'),_0xb47c('0x7c')],'raw':!![]};return db[_0xb47c('0x35')][_0xb47c('0x51')](_0x33cd05)[_0xb47c('0x17')](handleEntityNotFound(_0x4919b0,null))[_0xb47c('0x17')](function(_0x4d3087){if(_0x4d3087){if(!_['isNil'](_0x4d3087[_0xb47c('0x7b')])){if(fs[_0xb47c('0x72')](path['join'](config[_0xb47c('0x6e')],_0xb47c('0x78'),_0x4d3087[_0xb47c('0x7b')]))&&_0x4d3087[_0xb47c('0x7c')]){_0x13db60=path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0x78'),_0x4d3087[_0xb47c('0x7b')]);}}return _0x4919b0['download'](_0x13db60);}})[_0xb47c('0x22')](handleError(_0x4919b0,null));};exports[_0xb47c('0x7d')]=function(_0x57114e,_0x66b7fa){var _0x275c1e=path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0x7e'));var _0x538f04={'where':{'id':_0x57114e[_0xb47c('0x4f')]['id']},'attributes':['id',_0xb47c('0x6b')],'raw':!![]};return db[_0xb47c('0x35')]['find'](_0x538f04)[_0xb47c('0x17')](handleEntityNotFound(_0x66b7fa,null))[_0xb47c('0x17')](function(_0x1e53f4){if(_0x1e53f4){if(!_['isNil'](_0x1e53f4[_0xb47c('0x6b')])){if(fs[_0xb47c('0x72')](path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],'server/files/images/avatars/',_0x1e53f4[_0xb47c('0x6b')]))){_0x275c1e=path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0x78'),_0x1e53f4[_0xb47c('0x6b')]);}}return _0x66b7fa[_0xb47c('0x74')](_0x275c1e);}})[_0xb47c('0x22')](handleError(_0x66b7fa,null));};exports['notify']=function(_0x1b71dd,_0x16adbc){var _0x3b8d17=require(_0xb47c('0x7f'));var _0x5564ca=new _0x3b8d17();var _0x8c9069=_0x5564ca['setUA'](_0x1b71dd['headers'][_0xb47c('0x80')])[_0xb47c('0x81')]();var _0x739cc4={'body':_0x1b71dd[_0xb47c('0x53')],'channel':_0xb47c('0x82')};var _0x396a5a=[];var _0x3e1880=[];var _0x23e711={};var _0x34fc25=![];return db[_0xb47c('0x83')][_0xb47c('0x5b')]()[_0xb47c('0x17')](function(_0x5c5f9b){if(!_0x5c5f9b){throw new db['Sequelize'][(_0xb47c('0x84'))](_0xb47c('0x85'));}_0x396a5a=_[_0xb47c('0x86')](_[_0xb47c('0x3a')](_0x5c5f9b),[_0xb47c('0x87'),'updatedAt']);_0x3e1880=_[_0xb47c('0x86')](_[_0xb47c('0x3a')](_0x5c5f9b),[_0xb47c('0x87'),'updatedAt','CompanyId','ListId']);if(_0x1b71dd[_0xb47c('0x53')]['id']){delete _0x1b71dd[_0xb47c('0x53')]['id'];}if(_[_0xb47c('0x88')](_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x89')])){throw new db[(_0xb47c('0x8a'))][(_0xb47c('0x84'))](_0xb47c('0x8b'));}if(_['isNil'](_0x1b71dd['body'][_0xb47c('0x53')])||_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x53')]===''){throw new db['Sequelize'][(_0xb47c('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb47c('0x88')](_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x8c')])){throw new db[(_0xb47c('0x8a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e1880);}if(!_[_0xb47c('0x8d')](_0x3e1880,_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x8c')])){throw new db[(_0xb47c('0x8a'))][(_0xb47c('0x84'))](_0xb47c('0x8e')+_0x3e1880);}_0x23e711[_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x8c')]]=_0x1b71dd['body'][_0xb47c('0x89')];})[_0xb47c('0x17')](function(){return db['ChatWebsite'][_0xb47c('0x51')]({'where':{'id':_0x1b71dd['params']['id']},'include':[{'model':db[_0xb47c('0x8f')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb47c('0x90'),'where':_0x23e711,'limit':0x1,'order':[[_0xb47c('0x91'),'DESC']]}]},{'model':db[_0xb47c('0x92')],'as':_0xb47c('0x93')}]});})['then'](handleEntityNotFound(_0x16adbc,null))['then'](function(_0x369e92){if(_0x369e92&&_0x369e92[_0xb47c('0x94')]){_0x739cc4[_0xb47c('0x95')]=_0x369e92;_0x739cc4[_0xb47c('0x96')]=_0x369e92[_0xb47c('0x93')];_0x739cc4['list']=_0x369e92[_0xb47c('0x94')];_0x739cc4[_0xb47c('0x96')]=_[_0xb47c('0x97')](_0x739cc4[_0xb47c('0x96')],['priority'],['asc']);if(_0x739cc4[_0xb47c('0x95')][_0xb47c('0x93')]){delete _0x739cc4[_0xb47c('0x95')][_0xb47c('0x93')];}if(_0x739cc4[_0xb47c('0x95')]['List']&&_0x739cc4[_0xb47c('0x95')][_0xb47c('0x94')]['Contacts'][_0xb47c('0x3f')]){return _0x739cc4[_0xb47c('0x95')][_0xb47c('0x94')][_0xb47c('0x90')][0x0];}var _0x49bb34=_[_0xb47c('0xe')](_0x1b71dd[_0xb47c('0x53')],{'firstName':_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x89')],'ListId':_0x369e92[_0xb47c('0x98')]});_0x49bb34[_0x1b71dd['body'][_0xb47c('0x8c')]]=_0x1b71dd['body'][_0xb47c('0x89')];return db[_0xb47c('0x83')][_0xb47c('0x52')](_0x49bb34,{'fields':_0x396a5a,'raw':!![]});}})['then'](handleEntityNotFound(_0x16adbc,null))[_0xb47c('0x17')](function(_0x378a86){_0x739cc4['contact']=_0x378a86;var _0x1d5cb4=_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x99')];if(_0x1b71dd['headers']['cf-connecting-ip']){_0x1d5cb4=_0x1b71dd[_0xb47c('0x9a')][_0xb47c('0x9b')];}else if(_0x1b71dd[_0xb47c('0x9a')]['x-forwarded-for']){_0x1d5cb4=_[_0xb47c('0x9c')](_0x1b71dd[_0xb47c('0x9a')]['x-forwarded-for'][_0xb47c('0x9d')](','));}if(_0x378a86){var _0x415e56={'ContactId':_0x378a86['id'],'ChatWebsiteId':_0x1b71dd['params']['id'],'from':(_0x378a86['firstName']||'')+'\x20'+(_0x378a86['lastName']||''),'customerIp':_0x1d5cb4,'customerPort':_0x1b71dd[_0xb47c('0x9a')]['x-real-port']?_0x1b71dd[_0xb47c('0x9a')]['x-real-port']:null,'referer':_0x1b71dd[_0xb47c('0x53')][_0xb47c('0x9e')],'browserName':_0x8c9069[_0xb47c('0x9f')][_0xb47c('0x30')]&&_0x8c9069['browser'][_0xb47c('0xa0')]?util[_0xb47c('0xa1')]('%s\x20%s',_0x8c9069[_0xb47c('0x9f')][_0xb47c('0x30')],_0x8c9069[_0xb47c('0x9f')][_0xb47c('0xa0')]):'unknown','browserVersion':_0x8c9069['browser'][_0xb47c('0xa0')]||_0xb47c('0xa2'),'osName':util['format'](_0xb47c('0xa3'),_0x8c9069['os']['name'],_0x8c9069['os'][_0xb47c('0xa0')]),'osVersion':_0x8c9069['os']['version'],'deviceModel':_0x8c9069['device'][_0xb47c('0x39')]&&_0x8c9069[_0xb47c('0xa4')]['vendor']?util[_0xb47c('0xa1')](_0xb47c('0xa5'),_0x8c9069[_0xb47c('0xa4')][_0xb47c('0x39')],_0x8c9069['device'][_0xb47c('0xa6')],_0x8c9069[_0xb47c('0xa4')]['type']):null,'deviceVendor':_0x8c9069['device'][_0xb47c('0xa6')],'deviceType':_0x8c9069[_0xb47c('0xa4')][_0xb47c('0x47')],'formData':JSON[_0xb47c('0x1d')](_0x1b71dd[_0xb47c('0x53')])};var _0x28c55d={'ChatWebsiteId':_0x1b71dd[_0xb47c('0x4f')]['id'],'closed':![]};if(_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xa7')]){_0x28c55d[_0xb47c('0xa7')]=_0x1b71dd['body']['threadId'];return db[_0xb47c('0xa8')][_0xb47c('0x51')]({'where':_0x28c55d})['then'](function(_0x5d662f){if(_0x5d662f){return[_0x5d662f,![]];}_0x415e56[_0xb47c('0xa7')]=_0x1b71dd[_0xb47c('0x53')]['threadId'];_0x415e56[_0xb47c('0xa9')]=_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xa9')];return db['ChatInteraction'][_0xb47c('0x52')](_0x415e56)[_0xb47c('0x17')](function(_0x3aca11){return[_0x3aca11,!![]];});});}_0x28c55d[_0xb47c('0xaa')]=_0x378a86['id'];if(_0x1b71dd['body']['interaction']&&_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xab')]['id']){_0x28c55d['id']=_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xab')]['id'];return db[_0xb47c('0xa8')]['find']({'where':_0x28c55d})[_0xb47c('0x17')](function(_0x5adf99){if(_0x5adf99){return[_0x5adf99,![]];}return db[_0xb47c('0xa8')]['create'](_0x415e56)['then'](function(_0x41c86f){return[_0x41c86f,!![]];});});}return db[_0xb47c('0xa8')][_0xb47c('0x52')](_0x415e56)[_0xb47c('0x17')](function(_0x9de255){return[_0x9de255,!![]];});}})['spread'](function(_0x145d1c,_0x2ffd53){if(_0x145d1c){_0x34fc25=_0x2ffd53;if(!_0x2ffd53){var _0x10178f={'from':(_0x739cc4[_0xb47c('0xac')][_0xb47c('0xad')]||'')+'\x20'+(_0x739cc4[_0xb47c('0xac')][_0xb47c('0xae')]||'')};if(_0x1b71dd['body'][_0xb47c('0xa7')]&&_0x1b71dd['body'][_0xb47c('0xaf')]&&_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xa7')]!=_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xaf')]){_0x10178f[_0xb47c('0xa7')]=_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xaf')];}return _0x145d1c['update'](_0x10178f);}else{return _0x145d1c;}}})[_0xb47c('0x17')](function(_0x54200c){_0x739cc4[_0xb47c('0xab')]=_0x54200c[_0xb47c('0x2d')]({'plain':!![]});_0x739cc4[_0xb47c('0xab')]['created']=_0x34fc25;if(_0x739cc4[_0xb47c('0xab')][_0xb47c('0xb0')]){if(_0x739cc4[_0xb47c('0x95')][_0xb47c('0xb1')]){_0x739cc4[_0xb47c('0x96')]['push']({'id':0x0,'priority':_0x739cc4[_0xb47c('0x96')][_0xb47c('0x3f')]+0x1,'app':_0xb47c('0xb2'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xb47c('0xb3')][_0xb47c('0x52')]({'body':_0x1b71dd[_0xb47c('0x53')]['body'],'ChatWebsiteId':_0x1b71dd[_0xb47c('0x4f')]['id'],'ChatInteractionId':_0x54200c['id'],'direction':'in','ContactId':_0x739cc4[_0xb47c('0xac')]['id'],'AttachmentId':_0x1b71dd[_0xb47c('0x53')][_0xb47c('0xb4')]});})[_0xb47c('0x17')](function(_0xfb754e){_0x739cc4['message']=_0xfb754e;if(_0x739cc4[_0xb47c('0xab')][_0xb47c('0xb5')]){return db[_0xb47c('0xb6')][_0xb47c('0x51')]({'attributes':['id',_0xb47c('0x30')],'where':{'id':_0x739cc4['interaction'][_0xb47c('0xb5')]}})[_0xb47c('0x17')](function(_0x17d2f0){if(_0x17d2f0){_0x739cc4[_0xb47c('0x96')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb47c('0xb7'),'appdata':_0x17d2f0['name']+','+(_0x739cc4[_0xb47c('0x95')][_0xb47c('0xb8')]||0xa),'interval':_0xb47c('0xb9')});_0x739cc4['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xb47c('0xba'),_0x739cc4);});}return respondWithRpcPromise(_0xb47c('0xbb'),_0xb47c('0xba'),_0x739cc4);})['then'](function(_0x3c822e){respondWithRpcPromise('EventManager',_0xb47c('0xbc'),{'event':_0xb47c('0xbd'),'message':_0x3c822e},client9002);return _0x3c822e;})['then'](respondWithResult(_0x16adbc,null))[_0xb47c('0x22')](handleError(_0x16adbc,null));};exports[_0xb47c('0xbe')]=function(_0x145937,_0x25eb82){var _0x36c7a3,_0x5f18a4,_0x1a87ef;var _0x3c77b9=[];var _0x31dce4={};var _0x40afaa=_0x145937[_0xb47c('0xbf')]||[];var _0x12c37b=[];var _0x178457;return db[_0xb47c('0x83')][_0xb47c('0x5b')]()['then'](function(_0x54e369){if(!_0x54e369){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x3c77b9=_[_0xb47c('0x86')](_[_0xb47c('0x3a')](_0x54e369),['createdAt','updatedAt',_0xb47c('0xc0'),_0xb47c('0x98')]);if(_0x145937[_0xb47c('0x53')]['id']){delete _0x145937['body']['id'];}if(_[_0xb47c('0x88')](_0x145937[_0xb47c('0x53')]['from'])){throw _0x25eb82[_0xb47c('0x24')](0x1f4)[_0xb47c('0x31')](new db['Sequelize'][(_0xb47c('0x84'))](_0xb47c('0x8b')));}if(_['isNil'](_0x145937['body'][_0xb47c('0x53')])||_0x145937[_0xb47c('0x53')][_0xb47c('0x53')]===''){throw _0x25eb82[_0xb47c('0x24')](0x1f4)[_0xb47c('0x31')](new db[(_0xb47c('0x8a'))][(_0xb47c('0x84'))](_0xb47c('0xc1')));}if(_['isNil'](_0x145937[_0xb47c('0x53')][_0xb47c('0xc2')])){throw _0x25eb82[_0xb47c('0x24')](0x1f4)[_0xb47c('0x31')](new db[(_0xb47c('0x8a'))][(_0xb47c('0x84'))](_0xb47c('0xc3')+_0x3c77b9));}if(!_['includes'](_0x3c77b9,_0x145937[_0xb47c('0x53')]['mapKeyOffline'])){throw _0x25eb82[_0xb47c('0x24')](0x1f4)[_0xb47c('0x31')](new db[(_0xb47c('0x8a'))][(_0xb47c('0x84'))](_0xb47c('0xc4')+_0x3c77b9));}_0x31dce4[_0x145937[_0xb47c('0x53')][_0xb47c('0xc2')]]=_0x145937[_0xb47c('0x53')][_0xb47c('0x89')];})['then'](function(){return db[_0xb47c('0x35')]['find']({'where':{'id':_0x145937[_0xb47c('0x4f')]['id']},'include':[{'model':db[_0xb47c('0x8f')],'as':'List'},{'model':db[_0xb47c('0xc5')],'as':_0xb47c('0xc5')}]});})[_0xb47c('0x17')](handleEntityNotFound(_0x25eb82,null))[_0xb47c('0x17')](function(_0x30eb8a){if(_0x30eb8a&&_0x30eb8a[_0xb47c('0x94')]){_0x5f18a4=_0x30eb8a;var _0x5d50e7=_[_0xb47c('0xe')](_0x145937['body'],{'firstName':_0x145937['body'][_0xb47c('0x89')],'phone':_0x145937[_0xb47c('0x53')][_0xb47c('0x89')],'ListId':_0x30eb8a[_0xb47c('0x98')]});_0x5d50e7[_0x145937['body']['mapKeyOffline']]=_0x145937[_0xb47c('0x53')][_0xb47c('0x89')];return db['CmContact'][_0xb47c('0xc6')]({'where':_0x31dce4,'defaults':_0x5d50e7});}})[_0xb47c('0xc7')](function(_0x2361dc){if(_0x2361dc){_0x1a87ef=_0x2361dc;var _0x18818d=fs[_0xb47c('0xc8')](path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],_0xb47c('0xc9')),'utf8');var _0x45aedf=ejs[_0xb47c('0xca')](_0x18818d,{'body':_[_0xb47c('0xcb')](_0x145937[_0xb47c('0x53')]['body']),'bodyTitle':_0x5f18a4[_0xb47c('0xcc')]});return db[_0xb47c('0xcd')]['create']({'body':_0x45aedf,'plainBody':htmlToText[_0xb47c('0xce')](_0x45aedf),'ContactId':_0x2361dc['id'],'ChatWebsiteId':_0x5f18a4['id']});}})[_0xb47c('0x17')](function(_0x19a116){_0x178457=_0x19a116;if(_0x40afaa[_0xb47c('0x3f')]){var _0x178653=_0x40afaa[_0xb47c('0x34')](function(_0x14989f){return{'name':_0x14989f[_0xb47c('0xcf')],'basename':_0x14989f[_0xb47c('0x68')],'type':_0x14989f['mimetype'],'ChatOfflineMessageId':_0x19a116['id']};});_0x12c37b=_0x178653[_0xb47c('0x34')](_0x1e1403=>{var _0x532a99={'filename':_0x1e1403[_0xb47c('0x30')],'path':path['join'](config[_0xb47c('0x6e')],'server',_0xb47c('0xbf'),'attachments','offline-chat',_0x1e1403[_0xb47c('0xd0')])};return _0x532a99;});if(!_0x5f18a4['openNewInteraction']){return db[_0xb47c('0xd1')]['transaction'](function(_0x30ec80){return db[_0xb47c('0xd2')]['bulkCreate'](_0x178653,{'transaction':_0x30ec80});});}}})[_0xb47c('0x17')](function(){if(_0x178457){_0x36c7a3=_0x178457;return db[_0xb47c('0xc5')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xb47c('0xd3')],'as':_0xb47c('0xd4'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb47c('0xd5'),'raw':!![]}]}]});}})[_0xb47c('0x17')](function(_0x2f5401){if(_0x2f5401&&_0x2f5401[_0xb47c('0xd4')]&&_0x5f18a4[_0xb47c('0xd6')]&&_0x5f18a4[_0xb47c('0xd7')]){var _0x472cfb=_0x2f5401['getSmtpOptions']();return respondWithRpcPromise(_0xb47c('0xd8'),_0xb47c('0xd9'),{'account':_0x472cfb,'message':{'from':util[_0xb47c('0xa1')]('\x22%s\x22\x20<%s>',_0x2f5401[_0xb47c('0x30')],_0x2f5401['email']||_0x2f5401[_0xb47c('0xd4')][_0xb47c('0x54')]),'to':_0x5f18a4[_0xb47c('0xd7')],'subject':_0x5f18a4['offlineMessageSubject'],'html':_0x36c7a3[_0xb47c('0x53')],'attachments':_0x12c37b}},client9003)['then'](function(){return _0x36c7a3;})[_0xb47c('0x22')](function(_0x3dbbc0){logger[_0xb47c('0x1e')](_0x3dbbc0);});}})[_0xb47c('0x17')](function(){if(_0x5f18a4&&_0x5f18a4[_0xb47c('0xda')]&&_0x5f18a4[_0xb47c('0xdb')]){var _0x50db46=[];if(_0x40afaa[_0xb47c('0x3f')]){_0x50db46=_0x40afaa[_0xb47c('0x34')](function(_0x2bd825){return{'name':_0x2bd825[_0xb47c('0xcf')],'basename':_0x2bd825[_0xb47c('0x68')],'type':_0x2bd825[_0xb47c('0xdc')],'ChatOfflineMessageId':_0x178457['id']};});}var _0x39b2b7;if(!_[_0xb47c('0x88')](_0x5f18a4[_0xb47c('0xdd')])){var _0x1ba4ca=_['map'](_0x145937[_0xb47c('0x53')],function(_0x39bdef){return _0x39bdef;});var _0x11b408=_[_0xb47c('0xde')](_0x1ba4ca)[0x0];var _0x2c9a4b=_['mapValues'](_0x11b408,function(_0x3e2a22){return _0x3e2a22;});_0x39b2b7=_0x2c9a4b[0x1][_0x5f18a4[_0xb47c('0xdd')]];}var _0x4f55e6={'from':_0x1a87ef[_0xb47c('0xdf')],'firstName':_0x1a87ef[_0xb47c('0xad')],'lastName':_0x1a87ef[_0xb47c('0xae')],'mapKey':_0xb47c('0xdf'),'message':{'from':_0x1a87ef[_0xb47c('0xdf')],'to':_0x5f18a4['MailAccount'][_0xb47c('0xdf')],'cc':'','subject':_['isNil'](_0x39b2b7)?_0x5f18a4['offlineMessageSubject']:_0x39b2b7,'messageId':'','sentAt':new Date(),'attach':_0x50db46[_0xb47c('0x3f')],'attachments':_0x50db46,'originChannel':_0xb47c('0xe0'),'ChatWebsiteId':_0x5f18a4['id'],'ChatOfflineMessageId':_0x36c7a3['id'],'originTo':_0x5f18a4['MailAccount']['email']},'body':_0x36c7a3['body']};var _0x30921b={'account':{'id':_0x5f18a4[_0xb47c('0xdb')]},'body':_0x4f55e6,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xb47c('0xe1'),'notifyMail',_0x30921b,client9001)[_0xb47c('0x17')](function(){return _0x36c7a3;})[_0xb47c('0x22')](function(_0x5310e6){logger[_0xb47c('0x1e')](_0x5310e6);});}return;})[_0xb47c('0x17')](function(){if(_0x36c7a3){return _0x36c7a3;}})[_0xb47c('0x17')](respondWithResult(_0x25eb82,null))[_0xb47c('0x22')](function(_0x2e783d){logger['error'](_0xb47c('0x22'),_0x2e783d);for(var _0x492ee9 of _0x40afaa){var _0x3398c4=path['join'](config[_0xb47c('0x6e')],'server',_0xb47c('0xbf'),'attachments',_0xb47c('0xe2'),_0x492ee9[_0xb47c('0x68')]);fs_extra[_0xb47c('0xe3')](_0x3398c4)['catch'](function(_0xd77506){logger[_0xb47c('0x1e')](_0xb47c('0xe4'),_0x3398c4,_0xd77506);});}});};exports[_0xb47c('0xe5')]=function(_0x39e3ae,_0x187754){return db[_0xb47c('0xa8')]['find']({'where':{'id':_0x39e3ae['params']['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x187754,null))['then'](function(_0x2ecba9){if(_0x2ecba9){return _0x2ecba9[_0xb47c('0xe5')](_0x39e3ae[_0xb47c('0x53')][_0xb47c('0x62')],_[_0xb47c('0xe6')](_0x39e3ae[_0xb47c('0x53')],[_0xb47c('0x62'),'id'])||{});}})[_0xb47c('0x17')](respondWithResult(_0x187754,null))[_0xb47c('0x22')](handleError(_0x187754,null));};exports['getInteractions']=function(_0x47d0b4,_0xd5ed96){var _0x1e6e31={'raw':![],'where':{}};var _0x468efb={};var _0x711eff={'count':0x0,'rows':[]};return db[_0xb47c('0x35')][_0xb47c('0x5e')]({'where':{'id':_0x47d0b4[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0xd5ed96,null))[_0xb47c('0x17')](function(_0x140803){if(_0x140803){_0x468efb[_0xb47c('0x39')]=_[_0xb47c('0x3a')](db[_0xb47c('0xa8')][_0xb47c('0x36')]);_0x468efb['query']=_['keys'](_0x47d0b4[_0xb47c('0x3b')]);_0x468efb[_0xb47c('0x46')]=_[_0xb47c('0x3c')](_0x468efb[_0xb47c('0x39')],_0x468efb['query']);_0x1e6e31[_0xb47c('0x3d')]=_['intersection'](_0x468efb[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0x47d0b4[_0xb47c('0x3b')]['fields']));_0x1e6e31[_0xb47c('0x3d')]=_0x1e6e31[_0xb47c('0x3d')]['length']?_0x1e6e31['attributes']:_0x468efb[_0xb47c('0x39')];if(!_0x47d0b4[_0xb47c('0x3b')][_0xb47c('0x40')](_0xb47c('0x41'))){_0x1e6e31[_0xb47c('0x29')]=qs[_0xb47c('0x29')](_0x47d0b4['query'][_0xb47c('0x29')]);_0x1e6e31[_0xb47c('0x27')]=qs[_0xb47c('0x27')](_0x47d0b4['query'][_0xb47c('0x27')]);}_0x1e6e31['order']=qs['sort'](_0x47d0b4[_0xb47c('0x3b')][_0xb47c('0x43')]);_0x1e6e31['where']=qs[_0xb47c('0x46')](_[_0xb47c('0x45')](_0x47d0b4['query'],_0x468efb[_0xb47c('0x46')]));_0x1e6e31['where'][_0xb47c('0x5d')]=_0x140803['id'];if(_0x47d0b4[_0xb47c('0x3b')][_0xb47c('0x48')]){_0x1e6e31[_0xb47c('0x44')]=_['merge'](_0x1e6e31[_0xb47c('0x44')],{'$or':_[_0xb47c('0x34')](_0x1e6e31['attributes'],function(_0xccacc2){var _0x370e0c={};_0x370e0c[_0xccacc2]={'$like':'%'+_0x47d0b4[_0xb47c('0x3b')][_0xb47c('0x48')]+'%'};return _0x370e0c;})});}_0x1e6e31=_[_0xb47c('0x49')]({},_0x1e6e31,_0x47d0b4[_0xb47c('0x50')]);return db[_0xb47c('0xa8')]['count']({'where':_0x1e6e31[_0xb47c('0x44')]})['then'](function(_0x5c221b){_0x711eff[_0xb47c('0x4a')]=_0x5c221b;if(_0x47d0b4[_0xb47c('0x3b')][_0xb47c('0x4b')]){_0x1e6e31['include']=[{'model':db[_0xb47c('0x83')],'as':_0xb47c('0xe7'),'required':![]},{'model':db['User'],'as':_0xb47c('0xe8'),'attributes':['name',_0xb47c('0xe9'),_0xb47c('0xea')],'required':![]},{'model':db[_0xb47c('0xeb')],'as':_0xb47c('0xec'),'attributes':['id',_0xb47c('0x30'),_0xb47c('0xed')],'where':_0x47d0b4[_0xb47c('0x3b')]['tag']?{'id':_0x47d0b4[_0xb47c('0x3b')][_0xb47c('0xee')]}:undefined,'required':_0x47d0b4['query'][_0xb47c('0xee')]?!![]:![]}];}return db[_0xb47c('0xa8')][_0xb47c('0x4d')](_0x1e6e31);})['then'](function(_0xcaa510){_0x711eff[_0xb47c('0x60')]=_0xcaa510;return _0x711eff;});}})[_0xb47c('0x17')](respondWithFilteredResult(_0xd5ed96,_0x1e6e31))[_0xb47c('0x22')](handleError(_0xd5ed96,null));};function iftimePromise(_0x3ff839,_0x234703){return respondWithRpcPromise(_0xb47c('0xef'),_0xb47c('0xf0'),{'command':_0x234703[_0xb47c('0xf1')]?util[_0xb47c('0xa1')](_0xb47c('0xf2'),_0x3ff839['interval'],_0x234703['timezone']):util[_0xb47c('0xa1')]('iftime\x20%s',_0x3ff839[_0xb47c('0xf3')])},client9002)[_0xb47c('0x17')](function(_0xaf2889){var _0xc001b7=_0xaf2889&&_0xaf2889[_0xb47c('0xf4')](_0xb47c('0xf5'))>=0x0?!![]:![];logger[_0xb47c('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x234703['id'],_0x3ff839['id'],_0x3ff839[_0xb47c('0xf3')],_0xc001b7?_0xb47c('0xf6'):_0xb47c('0xf7'),_0x234703[_0xb47c('0xf1')]?_0x234703['timezone']:_0xb47c('0xf8'));return _0xc001b7;})['catch'](function(_0x58ca4e){logger[_0xb47c('0x1e')](_0xb47c('0xf9'),_0x234703['id'],_0x3ff839['id'],_0x3ff839[_0xb47c('0xf3')],util[_0xb47c('0xfa')](_0x58ca4e,{'showHidden':![],'depth':null}),_0x234703[_0xb47c('0xf1')]?_0x234703[_0xb47c('0xf1')]:'No\x20timezone');return![];});}exports[_0xb47c('0xf0')]=function(_0x5866d2,_0x86d352){var _0x3f48c6=0x0;var _0x9d510c=0x0;var _0x23eb3f=![];var _0x3ff27f;var _0x1e7f7b;return db['ChatWebsite'][_0xb47c('0x51')]({'where':{'id':_0x5866d2['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':_0xb47c('0xfb'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xb47c('0x17')](handleEntityNotFound(_0x86d352,null))['then'](function(_0x194886){if(_0x194886){_0x3ff27f=_0x194886;return _0x194886[_0xb47c('0xfc')]({'raw':!![]});}})[_0xb47c('0x17')](function(_0x1fca07){if(_0x3ff27f){if(_0x1fca07){_0x1e7f7b=_0x1fca07;}}return require(_0xb47c('0xfd'))[_0xb47c('0x70')]();})[_0xb47c('0x17')](function(_0x49caeb){if(_0x49caeb){_0x9d510c=_0x49caeb[_0xb47c('0xfe')];_0x23eb3f=_0x49caeb[_0xb47c('0x71')];}})['then'](function(){return db[_0xb47c('0xa8')]['count']({'where':{'closed':![]}});})[_0xb47c('0x17')](function(_0x3e31cb){_0x3f48c6=_0x3e31cb;if(_0x9d510c&&_0x3e31cb>_0x9d510c){return db[_0xb47c('0xff')][_0xb47c('0x5e')]({'where':{'id':0x1}})[_0xb47c('0x17')](function(_0x1ae05c){if(_0x1ae05c){_0x1ae05c['increment'](_0xb47c('0x100'));}});}})[_0xb47c('0x17')](function(){if(_0x3ff27f[_0xb47c('0x101')]&&_0x3ff27f[_0xb47c('0x101')][_0xb47c('0xfb')]){var _0x1d37f3=[];for(var _0x538716=0x0;_0x538716<_0x3ff27f['Interval']['Intervals'][_0xb47c('0x3f')];_0x538716++){var _0x100fa3=_0x3ff27f[_0xb47c('0x101')][_0xb47c('0xfb')][_0x538716]['get']({'plain':!![]});_0x1d37f3[_0xb47c('0x102')](iftimePromise(_0x100fa3,_0x3ff27f));}return BPromise[_0xb47c('0x103')](_0x1d37f3)[_0xb47c('0x17')](function(_0x2ccfbf){return _[_0xb47c('0x104')](_0x2ccfbf);});}else{return!![];}})[_0xb47c('0x17')](function(_0x1e552a){var _0x304353=fs[_0xb47c('0xc8')](path[_0xb47c('0x6d')](config[_0xb47c('0x6e')],'server/files/chat/iframe.ejs'),_0xb47c('0x105'));var _0x1cd615=new url[(_0xb47c('0x106'))](_0x3ff27f[_0xb47c('0x107')])[_0xb47c('0x108')];var _0x96ba22=_0xb47c('0x109');var _0x474b8d=![];var _0x5ddeac={'chatVersion':_0x96ba22,'chatWebsiteAddressOrigin':_0x1cd615,'remote':_0x3ff27f[_0xb47c('0x10a')],'query':querystring[_0xb47c('0x1d')](_['merge'](_0x3ff27f[_0xb47c('0x2d')]({'plain':!![]}),{'customerIp':_0x5866d2[_0xb47c('0x9a')][_0xb47c('0x10b')]||_0x5866d2[_0xb47c('0x9a')]['x-real-ip']||_0x5866d2[_0xb47c('0x10c')][_0xb47c('0x10d')]||_0x5866d2['ip'],'referer':_0x5866d2[_0xb47c('0x9a')]['referer'],'openedInteractions':_0x3f48c6,'maxInteractions':_0x9d510c,'virtual':_0x23eb3f[_0xb47c('0xfe')],'online':_0x1e552a,'custom':_0x23eb3f}))[_0xb47c('0x10e')](/'/g,'\x5c\x27')};_0x86d352['send'](ejs[_0xb47c('0xca')](Mustache[_0xb47c('0xca')](_0x304353,_0x5ddeac),{'proactiveActions':_0x1e7f7b,'alignment':_0x3ff27f[_0xb47c('0x10f')],'verticalAlignment':_0x3ff27f['verticalAlignment'],'div_color':_0x3ff27f['color'],'labelText':_0x3ff27f[_0xb47c('0x110')],'text_color':_0x3ff27f[_0xb47c('0x111')],'text_button_color':_0x3ff27f[_0xb47c('0x112')],'button_color':_0x3ff27f[_0xb47c('0x113')],'background_color':_0x3ff27f[_0xb47c('0x114')],'hideWhenOffline':_0x3ff27f[_0xb47c('0x115')],'intervalId':_0x3ff27f['IntervalId'],'isDevelopment':_0x474b8d,'chatVersion':_0x96ba22}));})[_0xb47c('0x22')](handleError(_0x86d352,null));};exports[_0xb47c('0x116')]=function(_0x22061c,_0x4cbec1){var _0x305145=_0x22061c[_0xb47c('0x4f')]['id'];var _0x4b52d6=_0x22061c[_0xb47c('0x53')];var _0x41b9d5=0xc8;var _0x450ce5=null;return db[_0xb47c('0xd1')]['transaction']({'isolationLevel':db['sequelize'][_0xb47c('0x117')][_0xb47c('0x118')][_0xb47c('0x119')]},function(_0x26be5d){return db[_0xb47c('0x35')]['findOne']({'where':{'id':_0x305145},'transaction':_0x26be5d})[_0xb47c('0x17')](function(_0x4505bd){if(_0x4505bd){return db[_0xb47c('0x92')][_0xb47c('0x2c')]({'where':{'ChatWebsiteId':_0x305145},'transaction':_0x26be5d})[_0xb47c('0x17')](function(){var _0x61756c=_[_0xb47c('0x34')](_0x4b52d6,function(_0x2342cb){_0x2342cb[_0xb47c('0x5d')]=_0x305145;return _0x2342cb;});return db[_0xb47c('0x92')][_0xb47c('0x11a')](_0x61756c,{'transaction':_0x26be5d});});}else{_0x41b9d5=0x194;_0x450ce5=[];}});})[_0xb47c('0x17')](function(){if(_0x41b9d5!==0x194){return db[_0xb47c('0x92')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x305145},'order':_0xb47c('0x11b')})[_0xb47c('0x17')](function(_0x1dfc55){_0x450ce5=_0x1dfc55;});}})['catch'](function(_0x39cfdb){_0x41b9d5=0x1f4;logger['error'](_0x39cfdb[_0xb47c('0x2f')]);if(_0x39cfdb[_0xb47c('0x30')]){delete _0x39cfdb[_0xb47c('0x30')];}_0x450ce5=_0x39cfdb;})[_0xb47c('0x11c')](function(){if(_0x450ce5===null){_0x4cbec1[_0xb47c('0x23')](_0x41b9d5);}else{if(_0x41b9d5===0x1f4){_0x4cbec1[_0xb47c('0x24')](_0x41b9d5)[_0xb47c('0x31')](_0x450ce5);}else{_0x4cbec1['status'](_0x41b9d5)['json'](_0x450ce5);}}});};exports[_0xb47c('0x11d')]=function(_0x3ecc52,_0x5bcb8e){var _0x54b879={};var _0x1c0c62={};var _0xda8a45;var _0x48aeca;return db['ChatWebsite'][_0xb47c('0x5e')]({'where':{'id':_0x3ecc52[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x5bcb8e,null))['then'](function(_0x3e5d9c){if(_0x3e5d9c){_0xda8a45=_0x3e5d9c;_0x1c0c62[_0xb47c('0x39')]=_[_0xb47c('0x3a')](db[_0xb47c('0x92')]['rawAttributes']);_0x1c0c62[_0xb47c('0x3b')]=_[_0xb47c('0x3a')](_0x3ecc52[_0xb47c('0x3b')]);_0x1c0c62['filters']=_['intersection'](_0x1c0c62[_0xb47c('0x39')],_0x1c0c62[_0xb47c('0x3b')]);_0x54b879[_0xb47c('0x3d')]=_['intersection'](_0x1c0c62[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0x3ecc52[_0xb47c('0x3b')][_0xb47c('0x3e')]));_0x54b879['attributes']=_0x54b879[_0xb47c('0x3d')][_0xb47c('0x3f')]?_0x54b879[_0xb47c('0x3d')]:_0x1c0c62[_0xb47c('0x39')];_0x54b879[_0xb47c('0x42')]=qs[_0xb47c('0x43')](_0x3ecc52[_0xb47c('0x3b')]['sort']);_0x54b879['where']=qs['filters'](_[_0xb47c('0x45')](_0x3ecc52[_0xb47c('0x3b')],_0x1c0c62[_0xb47c('0x46')]));if(_0x3ecc52[_0xb47c('0x3b')]['filter']){_0x54b879[_0xb47c('0x44')]=_[_0xb47c('0x49')](_0x54b879[_0xb47c('0x44')],{'$or':_[_0xb47c('0x34')](_0x54b879['attributes'],function(_0x2bf9d5){var _0x281c1c={};_0x281c1c[_0x2bf9d5]={'$like':'%'+_0x3ecc52[_0xb47c('0x3b')][_0xb47c('0x48')]+'%'};return _0x281c1c;})});}_0x54b879=_[_0xb47c('0x49')]({},_0x54b879,_0x3ecc52[_0xb47c('0x50')]);return _0xda8a45[_0xb47c('0x11d')](_0x54b879);}})[_0xb47c('0x17')](function(_0x2bc6c0){if(_0x2bc6c0){_0x48aeca=_0x2bc6c0[_0xb47c('0x3f')];if(!_0x3ecc52[_0xb47c('0x3b')][_0xb47c('0x40')](_0xb47c('0x41'))){_0x54b879['limit']=qs['limit'](_0x3ecc52[_0xb47c('0x3b')]['limit']);_0x54b879[_0xb47c('0x27')]=qs[_0xb47c('0x27')](_0x3ecc52['query']['offset']);}return _0xda8a45[_0xb47c('0x11d')](_0x54b879);}})[_0xb47c('0x17')](function(_0x580169){if(_0x580169){return _0x580169?{'count':_0x48aeca,'rows':_0x580169}:null;}})['then'](respondWithResult(_0x5bcb8e,null))['catch'](handleError(_0x5bcb8e,null));};exports[_0xb47c('0x11e')]=function(_0x4cbc16,_0x4200ef){return db[_0xb47c('0x11f')][_0xb47c('0x51')]({'where':{'id':_0x4cbc16[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x4200ef,null))[_0xb47c('0x17')](function(_0x17715e){if(_0x17715e){return _0x17715e['addProactiveActions'](_0x4cbc16[_0xb47c('0x53')][_0xb47c('0x62')],_['omit'](_0x4cbc16['body'],[_0xb47c('0x62'),'id'])||{});}})['then'](respondWithResult(_0x4200ef,null))[_0xb47c('0x22')](handleError(_0x4200ef,null));};exports[_0xb47c('0xfc')]=function(_0x93aec4,_0x4f878b){var _0x4a150b={};var _0x13f635={};var _0x124361;var _0x351ab4;return db['ChatWebsite'][_0xb47c('0x5e')]({'where':{'id':_0x93aec4[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x4f878b,null))['then'](function(_0xe29594){if(_0xe29594){_0x124361=_0xe29594;_0x13f635[_0xb47c('0x39')]=_[_0xb47c('0x3a')](db[_0xb47c('0x120')][_0xb47c('0x36')]);_0x13f635['query']=_['keys'](_0x93aec4[_0xb47c('0x3b')]);_0x13f635[_0xb47c('0x46')]=_[_0xb47c('0x3c')](_0x13f635[_0xb47c('0x39')],_0x13f635['query']);_0x4a150b[_0xb47c('0x3d')]=_['intersection'](_0x13f635[_0xb47c('0x39')],qs['fields'](_0x93aec4[_0xb47c('0x3b')][_0xb47c('0x3e')]));_0x4a150b[_0xb47c('0x3d')]=_0x4a150b['attributes']['length']?_0x4a150b[_0xb47c('0x3d')]:_0x13f635[_0xb47c('0x39')];_0x4a150b[_0xb47c('0x42')]=qs[_0xb47c('0x43')](_0x93aec4['query']['sort']);_0x4a150b[_0xb47c('0x44')]=qs[_0xb47c('0x46')](_[_0xb47c('0x45')](_0x93aec4['query'],_0x13f635[_0xb47c('0x46')]));if(_0x93aec4[_0xb47c('0x3b')]['filter']){_0x4a150b[_0xb47c('0x44')]=_[_0xb47c('0x49')](_0x4a150b[_0xb47c('0x44')],{'$or':_[_0xb47c('0x34')](_0x4a150b[_0xb47c('0x3d')],function(_0x2d4c90){var _0x15d3c1={};_0x15d3c1[_0x2d4c90]={'$like':'%'+_0x93aec4[_0xb47c('0x3b')][_0xb47c('0x48')]+'%'};return _0x15d3c1;})});}_0x4a150b=_['merge']({},_0x4a150b,_0x93aec4[_0xb47c('0x50')]);return _0x124361[_0xb47c('0xfc')](_0x4a150b);}})[_0xb47c('0x17')](function(_0x1b4b35){if(_0x1b4b35){_0x351ab4=_0x1b4b35[_0xb47c('0x3f')];if(!_0x93aec4[_0xb47c('0x3b')][_0xb47c('0x40')](_0xb47c('0x41'))){_0x4a150b['limit']=qs['limit'](_0x93aec4[_0xb47c('0x3b')][_0xb47c('0x29')]);_0x4a150b['offset']=qs[_0xb47c('0x27')](_0x93aec4[_0xb47c('0x3b')][_0xb47c('0x27')]);}return _0x124361['getProactiveActions'](_0x4a150b);}})[_0xb47c('0x17')](function(_0x2a6d81){if(_0x2a6d81){return _0x2a6d81?{'count':_0x351ab4,'rows':_0x2a6d81}:null;}})[_0xb47c('0x17')](respondWithResult(_0x4f878b,null))[_0xb47c('0x22')](handleError(_0x4f878b,null));};exports[_0xb47c('0x121')]=function(_0x1b4e69,_0x59a30f){var _0x27a3fb=_0x1b4e69[_0xb47c('0x3b')][_0xb47c('0x122')]===_0xb47c('0x123')?_0xb47c('0x124'):_0xb47c('0x125');return db[_0xb47c('0x35')]['find']({'attributes':['id',_0x27a3fb],'where':{'id':_0x1b4e69[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x59a30f,null))[_0xb47c('0x17')](function(_0x201a83){if(_0x201a83){var _0x3d5063=_0x201a83[_0x27a3fb];var _0x1d2ef6=_0x3d5063&&_0x3d5063[_0xb47c('0x126')]?_0x3d5063[_0xb47c('0x126')]:[];_0x59a30f['send']({'fromKey':_[_0xb47c('0x88')](_0x3d5063[_0xb47c('0x127')])?undefined:_0x3d5063[_0xb47c('0x127')],'count':_0x1d2ef6[_0xb47c('0x3f')],'rows':_0x1d2ef6});}})[_0xb47c('0x22')](handleError(_0x59a30f,null));};exports[_0xb47c('0x128')]=function(_0xf7c0a,_0xa9866c){var _0x22490a={'raw':![],'where':{}};var _0x3a620f={};var _0x277ea2={'count':0x0,'rows':[]};return db[_0xb47c('0x35')][_0xb47c('0x5e')]({'where':{'id':_0xf7c0a['params']['id']}})['then'](handleEntityNotFound(_0xa9866c,null))[_0xb47c('0x17')](function(_0x3d22f2){if(_0x3d22f2){_0x3a620f[_0xb47c('0x39')]=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x3a620f['query']=_[_0xb47c('0x3a')](_0xf7c0a[_0xb47c('0x3b')]);_0x3a620f[_0xb47c('0x46')]=_[_0xb47c('0x3c')](_0x3a620f[_0xb47c('0x39')],_0x3a620f[_0xb47c('0x3b')]);_0x22490a['attributes']=_[_0xb47c('0x3c')](_0x3a620f[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0xf7c0a[_0xb47c('0x3b')][_0xb47c('0x3e')]));_0x22490a[_0xb47c('0x3d')]=_0x22490a[_0xb47c('0x3d')]['length']?_0x22490a[_0xb47c('0x3d')]:_0x3a620f[_0xb47c('0x39')];if(!_0xf7c0a['query'][_0xb47c('0x40')](_0xb47c('0x41'))){_0x22490a[_0xb47c('0x29')]=qs[_0xb47c('0x29')](_0xf7c0a[_0xb47c('0x3b')][_0xb47c('0x29')]);_0x22490a[_0xb47c('0x27')]=qs[_0xb47c('0x27')](_0xf7c0a[_0xb47c('0x3b')][_0xb47c('0x27')]);}_0x22490a[_0xb47c('0x42')]=qs[_0xb47c('0x43')](_0xf7c0a[_0xb47c('0x3b')][_0xb47c('0x43')]);_0x22490a[_0xb47c('0x44')]=qs[_0xb47c('0x46')](_[_0xb47c('0x45')](_0xf7c0a[_0xb47c('0x3b')],_0x3a620f[_0xb47c('0x46')]));_0x22490a['where'][_0xb47c('0x5d')]=_0x3d22f2['id'];if(_0xf7c0a[_0xb47c('0x3b')][_0xb47c('0x48')]){_0x22490a['where']=_['merge'](_0x22490a[_0xb47c('0x44')],{'$or':_[_0xb47c('0x34')](_0x22490a['attributes'],function(_0x355b17){var _0x59ecda={};_0x59ecda[_0x355b17]={'$like':'%'+_0xf7c0a[_0xb47c('0x3b')]['filter']+'%'};return _0x59ecda;})});}_0x22490a=_[_0xb47c('0x49')]({},_0x22490a,_0xf7c0a[_0xb47c('0x50')]);return db['ChatOfflineMessage']['count']({'where':_0x22490a[_0xb47c('0x44')]})['then'](function(_0x53b3ed){_0x277ea2['count']=_0x53b3ed;if(_0xf7c0a[_0xb47c('0x3b')]['includeAll']){_0x22490a[_0xb47c('0x4c')]=[{'all':!![]}];}else{_0x22490a['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xb47c('0xd2')],'as':_0xb47c('0x129'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x22490a);})['then'](function(_0x4b5391){_0x277ea2['rows']=_0x4b5391;return _0x277ea2;});}})[_0xb47c('0x17')](respondWithFilteredResult(_0xa9866c,_0x22490a))[_0xb47c('0x22')](handleError(_0xa9866c,null));};exports[_0xb47c('0x12a')]=function(_0x342fe1,_0x4c3c61){return db[_0xb47c('0x35')][_0xb47c('0x51')]({'where':{'id':_0x342fe1[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x4c3c61,null))[_0xb47c('0x17')](function(_0x5e46af){if(_0x5e46af){return _0x5e46af[_0xb47c('0x12a')](_0x342fe1[_0xb47c('0x53')]['ids'],_[_0xb47c('0xe6')](_0x342fe1[_0xb47c('0x53')],[_0xb47c('0x62'),'id'])||{})['spread'](function(_0x4afe27){for(var _0x227bf2=0x0;_0x227bf2<_0x342fe1[_0xb47c('0x53')]['ids']['length'];_0x227bf2+=0x1){socket[_0xb47c('0x12b')](_0xb47c('0x12c'),{'UserId':Number(_0x342fe1[_0xb47c('0x53')][_0xb47c('0x62')][_0x227bf2]),'ChatWebsiteId':Number(_0x342fe1['params']['id'])});}return _0x4afe27;});}})[_0xb47c('0x17')](respondWithResult(_0x4c3c61,null))[_0xb47c('0x22')](handleError(_0x4c3c61,null));};exports[_0xb47c('0x12d')]=function(_0x35eb7a,_0x2b4b90){return db[_0xb47c('0x35')][_0xb47c('0x51')]({'where':{'id':_0x35eb7a[_0xb47c('0x4f')]['id']}})[_0xb47c('0x17')](handleEntityNotFound(_0x2b4b90,null))[_0xb47c('0x17')](function(_0x24456f){if(_0x24456f){return _0x24456f[_0xb47c('0x12d')](_0x35eb7a[_0xb47c('0x3b')]['ids'])[_0xb47c('0x17')](function(){if(_['isArray'](_0x35eb7a[_0xb47c('0x3b')]['ids'])){for(var _0x3b5808=0x0;_0x3b5808<_0x35eb7a['query'][_0xb47c('0x62')][_0xb47c('0x3f')];_0x3b5808+=0x1){socket[_0xb47c('0x12b')](_0xb47c('0x12e'),{'UserId':Number(_0x35eb7a[_0xb47c('0x3b')]['ids'][_0x3b5808]),'ChatWebsiteId':Number(_0x35eb7a['params']['id'])});}}else{socket[_0xb47c('0x12b')]('userChatWebsite:remove',{'UserId':Number(_0x35eb7a[_0xb47c('0x3b')][_0xb47c('0x62')]),'ChatWebsiteId':Number(_0x35eb7a[_0xb47c('0x4f')]['id'])});}});}})[_0xb47c('0x17')](respondWithStatusCode(_0x2b4b90,null))[_0xb47c('0x22')](handleError(_0x2b4b90,null));};exports['getAgents']=function(_0x567a8d,_0xdbdbb5){var _0x3c4fbf={};var _0x192f89={};var _0x6b9428;var _0xde8549;return db[_0xb47c('0x35')]['findOne']({'where':{'id':_0x567a8d['params']['id']}})['then'](handleEntityNotFound(_0xdbdbb5,null))[_0xb47c('0x17')](function(_0x38af4d){if(_0x38af4d){_0x6b9428=_0x38af4d;_0x192f89[_0xb47c('0x39')]=_[_0xb47c('0x3a')](db[_0xb47c('0xb6')][_0xb47c('0x36')]);_0x192f89[_0xb47c('0x3b')]=_[_0xb47c('0x3a')](_0x567a8d['query']);_0x192f89['filters']=_['intersection'](_0x192f89[_0xb47c('0x39')],_0x192f89[_0xb47c('0x3b')]);_0x3c4fbf[_0xb47c('0x3d')]=_[_0xb47c('0x3c')](_0x192f89[_0xb47c('0x39')],qs[_0xb47c('0x3e')](_0x567a8d[_0xb47c('0x3b')][_0xb47c('0x3e')]));_0x3c4fbf['attributes']=_0x3c4fbf[_0xb47c('0x3d')]['length']?_0x3c4fbf[_0xb47c('0x3d')]:_0x192f89[_0xb47c('0x39')];_0x3c4fbf[_0xb47c('0x42')]=qs['sort'](_0x567a8d[_0xb47c('0x3b')][_0xb47c('0x43')]);_0x3c4fbf[_0xb47c('0x44')]=qs[_0xb47c('0x46')](_[_0xb47c('0x45')](_0x567a8d[_0xb47c('0x3b')],_0x192f89[_0xb47c('0x46')]));if(_0x567a8d[_0xb47c('0x3b')][_0xb47c('0x48')]){_0x3c4fbf[_0xb47c('0x44')]=_[_0xb47c('0x49')](_0x3c4fbf['where'],{'$or':_[_0xb47c('0x34')](_0x3c4fbf[_0xb47c('0x3d')],function(_0x41aa36){var _0x2f26e6={};_0x2f26e6[_0x41aa36]={'$like':'%'+_0x567a8d[_0xb47c('0x3b')][_0xb47c('0x48')]+'%'};return _0x2f26e6;})});}_0x3c4fbf=_[_0xb47c('0x49')]({},_0x3c4fbf,_0x567a8d['options']);return _0x6b9428[_0xb47c('0x12f')](_0x3c4fbf);}})[_0xb47c('0x17')](function(_0x522a87){if(_0x522a87){_0xde8549=_0x522a87[_0xb47c('0x3f')];if(!_0x567a8d[_0xb47c('0x3b')][_0xb47c('0x40')](_0xb47c('0x41'))){_0x3c4fbf[_0xb47c('0x29')]=qs['limit'](_0x567a8d['query'][_0xb47c('0x29')]);_0x3c4fbf['offset']=qs[_0xb47c('0x27')](_0x567a8d[_0xb47c('0x3b')][_0xb47c('0x27')]);}return _0x6b9428['getAgents'](_0x3c4fbf);}})[_0xb47c('0x17')](function(_0x1e86d1){if(_0x1e86d1){return _0x1e86d1?{'count':_0xde8549,'rows':_0x1e86d1}:null;}})[_0xb47c('0x17')](respondWithResult(_0xdbdbb5,null))[_0xb47c('0x22')](handleError(_0xdbdbb5,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index ba3f166..bea710c 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 _0x379e=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x390259,_0x338589){var _0x17bec9=function(_0x498c7d){while(--_0x498c7d){_0x390259['push'](_0x390259['shift']());}};_0x17bec9(++_0x338589);}(_0x379e,0x104));var _0xe379=function(_0x287829,_0x39e938){_0x287829=_0x287829-0x0;var _0x293992=_0x379e[_0x287829];return _0x293992;};'use strict';var EventEmitter=require(_0xe379('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe379('0x1'),'afterUpdate':_0xe379('0x2'),'afterDestroy':_0xe379('0x3')};function emitEvent(_0x4387fd){return function(_0x3db31a,_0x475418,_0x3ed6c8){ChatWebsiteEvents['emit'](_0x4387fd+':'+_0x3db31a['id'],_0x3db31a);ChatWebsiteEvents[_0xe379('0x4')](_0x4387fd,_0x3db31a);_0x3ed6c8(null);};}for(var e in events){if(events[_0xe379('0x5')](e)){var event=events[e];ChatWebsite[_0xe379('0x6')](e,emitEvent(event));}}module[_0xe379('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x8b2d=['update','emit','hasOwnProperty','hook','exports','ChatWebsite','save'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x687ce7,_0x39db4f){_0x687ce7=_0x687ce7-0x0;var _0x8bb835=_0x8b2d[_0x687ce7];return _0x8bb835;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xd8b2('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8b2('0x1'),'afterUpdate':_0xd8b2('0x2'),'afterDestroy':'remove'};function emitEvent(_0x273310){return function(_0x3a7304,_0x55a03c,_0x2ad404){ChatWebsiteEvents[_0xd8b2('0x3')](_0x273310+':'+_0x3a7304['id'],_0x3a7304);ChatWebsiteEvents[_0xd8b2('0x3')](_0x273310,_0x3a7304);_0x2ad404(null);};}for(var e in events){if(events[_0xd8b2('0x4')](e)){var event=events[e];ChatWebsite[_0xd8b2('0x5')](e,emitEvent(event));}}module[_0xd8b2('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 94ee362..ea70ce1 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 _0xc5b0=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x221443,_0x597dc0){var _0x260530=function(_0x28b5aa){while(--_0x28b5aa){_0x221443['push'](_0x221443['shift']());}};_0x260530(++_0x597dc0);}(_0xc5b0,0x119));var _0x0c5b=function(_0x38eb86,_0x247e47){_0x38eb86=_0x38eb86-0x0;var _0x1f2581=_0xc5b0[_0x38eb86];return _0x1f2581;};'use strict';var _=require(_0x0c5b('0x0'));var util=require('util');var logger=require(_0x0c5b('0x1'))(_0x0c5b('0x2'));var moment=require('moment');var BPromise=require(_0x0c5b('0x3'));var rp=require(_0x0c5b('0x4'));var fs=require('fs');var path=require(_0x0c5b('0x5'));var rimraf=require(_0x0c5b('0x6'));var config=require(_0x0c5b('0x7'));var attributes=require(_0x0c5b('0x8'));module[_0x0c5b('0x9')]=function(_0x567026,_0x319115){return _0x567026[_0x0c5b('0xa')](_0x0c5b('0xb'),attributes,{'tableName':_0x0c5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcae=['define','ChatWebsite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports'];(function(_0x4f2c97,_0x254eab){var _0x13f999=function(_0x173d25){while(--_0x173d25){_0x4f2c97['push'](_0x4f2c97['shift']());}};_0x13f999(++_0x254eab);}(_0xbcae,0x1e3));var _0xebca=function(_0x13ed52,_0x29a503){_0x13ed52=_0x13ed52-0x0;var _0x26f446=_0xbcae[_0x13ed52];return _0x26f446;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var logger=require(_0xebca('0x2'))(_0xebca('0x3'));var moment=require(_0xebca('0x4'));var BPromise=require(_0xebca('0x5'));var rp=require(_0xebca('0x6'));var fs=require('fs');var path=require(_0xebca('0x7'));var rimraf=require(_0xebca('0x8'));var config=require('../../config/environment');var attributes=require(_0xebca('0x9'));module[_0xebca('0xa')]=function(_0x3c190c,_0x16e7de){return _0x3c190c[_0xebca('0xb')](_0xebca('0xc'),attributes,{'tableName':'chat_websites','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 347cae7..b080430 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 _0xdd38=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3e94d1,_0x2d264e){var _0x5b4d1e=function(_0x2b0e06){while(--_0x2b0e06){_0x3e94d1['push'](_0x3e94d1['shift']());}};_0x5b4d1e(++_0x2d264e);}(_0xdd38,0x180));var _0x8dd3=function(_0x2c6805,_0x46f0c5){_0x2c6805=_0x2c6805-0x0;var _0x523793=_0xdd38[_0x2c6805];return _0x523793;};'use strict';var _=require(_0x8dd3('0x0'));var util=require(_0x8dd3('0x1'));var moment=require(_0x8dd3('0x2'));var BPromise=require(_0x8dd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8dd3('0x4'));var db=require(_0x8dd3('0x5'))['db'];var utils=require(_0x8dd3('0x6'));var logger=require('../../config/logger')(_0x8dd3('0x7'));var config=require(_0x8dd3('0x8'));var jayson=require(_0x8dd3('0x9'));var client=jayson[_0x8dd3('0xa')][_0x8dd3('0xb')]({'port':0x232a});config[_0x8dd3('0xc')]=_['defaults'](config[_0x8dd3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dd3('0xd'))(new Redis(config['redis']));require(_0x8dd3('0xe'))['register'](socket);function respondWithRpcPromise(_0xcfdd9,_0x18daa4,_0x615a79){return new BPromise(function(_0x5dcc82,_0x440293){return client['request'](_0xcfdd9,_0x615a79)[_0x8dd3('0xf')](function(_0x2b71d4){logger[_0x8dd3('0x10')](_0x8dd3('0x11'),_0x18daa4,_0x8dd3('0x12'));logger[_0x8dd3('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x18daa4,'request\x20sent',JSON[_0x8dd3('0x14')](_0x2b71d4));if(_0x2b71d4[_0x8dd3('0x15')]){if(_0x2b71d4[_0x8dd3('0x15')][_0x8dd3('0x16')]===0x1f4){logger[_0x8dd3('0x15')](_0x8dd3('0x11'),_0x18daa4,_0x2b71d4['error'][_0x8dd3('0x17')]);return _0x440293(_0x2b71d4[_0x8dd3('0x15')][_0x8dd3('0x17')]);}logger[_0x8dd3('0x15')](_0x8dd3('0x11'),_0x18daa4,_0x2b71d4['error'][_0x8dd3('0x17')]);return _0x5dcc82(_0x2b71d4['error'][_0x8dd3('0x17')]);}else{logger['info'](_0x8dd3('0x11'),_0x18daa4,'request\x20sent');_0x5dcc82(_0x2b71d4[_0x8dd3('0x18')][_0x8dd3('0x17')]);}})[_0x8dd3('0x19')](function(_0x1655b9){logger['error'](_0x8dd3('0x11'),_0x18daa4,_0x1655b9);_0x440293(_0x1655b9);});});} \ No newline at end of file +var _0x5774=['defaults','socket.io-emitter','register','info','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis'];(function(_0xecab90,_0x471fcd){var _0x1741e1=function(_0x3dde7b){while(--_0x3dde7b){_0xecab90['push'](_0xecab90['shift']());}};_0x1741e1(++_0x471fcd);}(_0x5774,0x1c4));var _0x4577=function(_0x20a21d,_0x43ca39){_0x20a21d=_0x20a21d-0x0;var _0x1a9c32=_0x5774[_0x20a21d];return _0x1a9c32;};'use strict';var _=require(_0x4577('0x0'));var util=require(_0x4577('0x1'));var moment=require('moment');var BPromise=require(_0x4577('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4577('0x3'))['db'];var utils=require(_0x4577('0x4'));var logger=require(_0x4577('0x5'))(_0x4577('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4577('0x7')][_0x4577('0x8')]({'port':0x232a});config[_0x4577('0x9')]=_[_0x4577('0xa')](config[_0x4577('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4577('0xb'))(new Redis(config[_0x4577('0x9')]));require('./chatWebsite.socket')[_0x4577('0xc')](socket);function respondWithRpcPromise(_0x31aa86,_0x1581b1,_0x103f1a){return new BPromise(function(_0x1c76e7,_0x5b9433){return client['request'](_0x31aa86,_0x103f1a)['then'](function(_0x2eef64){logger[_0x4577('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x1581b1,'request\x20sent');logger[_0x4577('0xe')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1581b1,_0x4577('0xf'),JSON[_0x4577('0x10')](_0x2eef64));if(_0x2eef64['error']){if(_0x2eef64[_0x4577('0x11')][_0x4577('0x12')]===0x1f4){logger[_0x4577('0x11')](_0x4577('0x13'),_0x1581b1,_0x2eef64['error'][_0x4577('0x14')]);return _0x5b9433(_0x2eef64['error'][_0x4577('0x14')]);}logger['error'](_0x4577('0x13'),_0x1581b1,_0x2eef64['error'][_0x4577('0x14')]);return _0x1c76e7(_0x2eef64[_0x4577('0x11')][_0x4577('0x14')]);}else{logger[_0x4577('0xd')](_0x4577('0x13'),_0x1581b1,_0x4577('0xf'));_0x1c76e7(_0x2eef64[_0x4577('0x15')][_0x4577('0x14')]);}})['catch'](function(_0x3e2518){logger[_0x4577('0x11')](_0x4577('0x13'),_0x1581b1,_0x3e2518);_0x5b9433(_0x3e2518);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 4fa3630..8b21476 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 _0x4ef8=['length','chatWebsite:','save','update','emit','removeListener','register'];(function(_0x100f72,_0x1fb228){var _0x3b376c=function(_0x30ce91){while(--_0x30ce91){_0x100f72['push'](_0x100f72['shift']());}};_0x3b376c(++_0x1fb228);}(_0x4ef8,0x16e));var _0x84ef=function(_0x4770b5,_0x4ad6c3){_0x4770b5=_0x4770b5-0x0;var _0x331de2=_0x4ef8[_0x4770b5];return _0x331de2;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x84ef('0x0'),'remove',_0x84ef('0x1')];function createListener(_0x51af75,_0x5d32a9){return function(_0x294a44){_0x5d32a9[_0x84ef('0x2')](_0x51af75,_0x294a44);};}function removeListener(_0x3debae,_0x31d4e8){return function(){ChatWebsiteEvents[_0x84ef('0x3')](_0x3debae,_0x31d4e8);};}exports[_0x84ef('0x4')]=function(_0xb6c9a2){for(var _0x2b050a=0x0,_0x33fbc4=events[_0x84ef('0x5')];_0x2b050a<_0x33fbc4;_0x2b050a++){var _0x17596d=events[_0x2b050a];var _0x55e40b=createListener(_0x84ef('0x6')+_0x17596d,_0xb6c9a2);ChatWebsiteEvents['on'](_0x17596d,_0x55e40b);}}; \ No newline at end of file +var _0xa0cb=['remove','update','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x100737,_0xcba877){var _0x2e62ba=function(_0x54b2bf){while(--_0x54b2bf){_0x100737['push'](_0x100737['shift']());}};_0x2e62ba(++_0xcba877);}(_0xa0cb,0x10d));var _0xba0c=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xa0cb[_0x1d1779];return _0x2377e9;};'use strict';var ChatWebsiteEvents=require(_0xba0c('0x0'));var events=['save',_0xba0c('0x1'),_0xba0c('0x2')];function createListener(_0x5d56f3,_0x435197){return function(_0xd08ea0){_0x435197['emit'](_0x5d56f3,_0xd08ea0);};}function removeListener(_0x5d7748,_0x1b6031){return function(){ChatWebsiteEvents['removeListener'](_0x5d7748,_0x1b6031);};}exports[_0xba0c('0x3')]=function(_0x3d56bc){for(var _0x42330d=0x0,_0x54754d=events[_0xba0c('0x4')];_0x42330d<_0x54754d;_0x42330d++){var _0x101836=events[_0x42330d];var _0xb91289=createListener(_0xba0c('0x5')+_0x101836,_0x3d56bc);ChatWebsiteEvents['on'](_0x101836,_0xb91289);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 73be8e7..8e80e69 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 _0x2c06=['server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','put','/:id','update','destroy','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','now','addAvatar'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x2c06,0x1b1));var _0x62c0=function(_0x30a5f2,_0x48c746){_0x30a5f2=_0x30a5f2-0x0;var _0x4f9ab9=_0x2c06[_0x30a5f2];return _0x4f9ab9;};'use strict';var multer=require('multer');var util=require(_0x62c0('0x0'));var path=require(_0x62c0('0x1'));var timeout=require(_0x62c0('0x2'));var express=require(_0x62c0('0x3'));var router=express[_0x62c0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x62c0('0x5'));var config=require(_0x62c0('0x6'));var controller=require(_0x62c0('0x7'));router[_0x62c0('0x8')]('/',auth[_0x62c0('0x9')](),controller[_0x62c0('0xa')]);router[_0x62c0('0x8')](_0x62c0('0xb'),auth[_0x62c0('0x9')](),controller['describe']);router[_0x62c0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x62c0('0xc')]);router['get'](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller[_0x62c0('0xe')]);router[_0x62c0('0x8')](_0x62c0('0xf'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x10')]);router[_0x62c0('0x8')](_0x62c0('0x11'),controller[_0x62c0('0x12')]);router[_0x62c0('0x8')](_0x62c0('0x13'),controller['getAvatar']);router[_0x62c0('0x8')](_0x62c0('0x14'),controller[_0x62c0('0x15')]);router['get'](_0x62c0('0x16'),controller[_0x62c0('0x17')]);router[_0x62c0('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x62c0('0x8')](_0x62c0('0x18'),controller['getSnippet']);router[_0x62c0('0x8')](_0x62c0('0x19'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x1a')]);router[_0x62c0('0x8')](_0x62c0('0x1b'),auth['isAuthenticated'](),controller[_0x62c0('0x1c')]);router[_0x62c0('0x8')](_0x62c0('0x1d'),controller['getFields']);router[_0x62c0('0x8')](_0x62c0('0x1e'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x1f')]);router['get'](_0x62c0('0x20'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x21')]);router[_0x62c0('0x22')]('/',auth['isAuthenticated'](),controller[_0x62c0('0x23')]);router[_0x62c0('0x22')](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x24')]);router['post']('/:id/canned_answers',auth[_0x62c0('0x9')](),controller[_0x62c0('0x25')]);var upload=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x4e7960,_0x56b23e,_0x3cc1ea){_0x3cc1ea(null,path[_0x62c0('0x27')](config[_0x62c0('0x28')],_0x62c0('0x29')));},'filename':function(_0x47a90e,_0x532125,_0x35ac78){_0x35ac78(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date['now'](),_0x532125[_0x62c0('0x2c')]));}})});router['post'](_0x62c0('0x11'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159bc7,_0x209f0d,_0x33dd3b){_0x33dd3b(null,path['join'](config[_0x62c0('0x28')],'server/files/images/avatars/'));},'filename':function(_0x32255b,_0x48870d,_0x1b6cb7){_0x1b6cb7(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date[_0x62c0('0x30')](),_0x48870d['originalname']));}})});router[_0x62c0('0x22')](_0x62c0('0x13'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ff74d,_0x29f27c,_0x188b76){_0x188b76(null,path[_0x62c0('0x27')](config[_0x62c0('0x28')],_0x62c0('0x32')));},'filename':function(_0xb10f3b,_0x2be7e9,_0x59bd55){_0x59bd55(null,util[_0x62c0('0x2a')]('%s-%s',Date['now'](),_0x2be7e9[_0x62c0('0x2c')]));}})});router[_0x62c0('0x22')](_0x62c0('0x14'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x33')]);var upload=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x198385,_0x5b9493,_0x20aca0){_0x20aca0(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x47aabf,_0x4b2ec4,_0x27fc5e){_0x27fc5e(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date['now'](),_0x4b2ec4[_0x62c0('0x2c')]));}})});router[_0x62c0('0x22')]('/:id/system_avatar',upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x34')]);router['post'](_0x62c0('0x35'),controller[_0x62c0('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x5b04a0,_0x22eeea,_0x47c228){const _0x578bed=path['join'](config['root'],'server/files','attachments','offline-chat');fs_extra['ensureDir'](_0x578bed,function(){_0x47c228(null,_0x578bed);});},'filename':function(_0x5008e7,_0x389823,_0x4cfc88){const _0x36179d=_0x389823[_0x62c0('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x275a0b=path[_0x62c0('0x37')](_0x36179d);const _0x4d21b4=Date[_0x62c0('0x30')]()+'-'+_0x36179d[_0x62c0('0x38')](_0x275a0b,'')+_0x275a0b;_0x4cfc88(null,_0x4d21b4);}})});router[_0x62c0('0x22')](_0x62c0('0x39'),offlineUploadMulter[_0x62c0('0x3a')](),controller[_0x62c0('0x3b')]);router['post'](_0x62c0('0x3c'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3d')]);router[_0x62c0('0x22')](_0x62c0('0x19'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3e')]);router[_0x62c0('0x22')](_0x62c0('0x1b'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3f')]);router[_0x62c0('0x22')](_0x62c0('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x62c0('0x40')](_0x62c0('0x41'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x42')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x62c0('0x43')]);router[_0x62c0('0x44')](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller['removeDispositions']);router[_0x62c0('0x44')](_0x62c0('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x62c0('0x20'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xe079=['/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','format','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addProactiveActions','/:id/users','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo'];(function(_0x719724,_0x2d6ff4){var _0x30e75e=function(_0x900268){while(--_0x900268){_0x719724['push'](_0x719724['shift']());}};_0x30e75e(++_0x2d6ff4);}(_0xe079,0x7f));var _0x9e07=function(_0xe75588,_0x2d077d){_0xe75588=_0xe75588-0x0;var _0x11b003=_0xe079[_0xe75588];return _0x11b003;};'use strict';var multer=require('multer');var util=require(_0x9e07('0x0'));var path=require(_0x9e07('0x1'));var timeout=require(_0x9e07('0x2'));var express=require('express');var router=express[_0x9e07('0x3')]();var fs_extra=require(_0x9e07('0x4'));var auth=require(_0x9e07('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e07('0x6'));var controller=require(_0x9e07('0x7'));router[_0x9e07('0x8')]('/',auth[_0x9e07('0x9')](),controller[_0x9e07('0xa')]);router[_0x9e07('0x8')](_0x9e07('0xb'),auth[_0x9e07('0x9')](),controller[_0x9e07('0xc')]);router[_0x9e07('0x8')]('/:id',auth[_0x9e07('0x9')](),controller[_0x9e07('0xd')]);router['get'](_0x9e07('0xe'),auth[_0x9e07('0x9')](),controller[_0x9e07('0xf')]);router['get'](_0x9e07('0x10'),auth[_0x9e07('0x9')](),controller[_0x9e07('0x11')]);router[_0x9e07('0x8')]('/:id/logo',controller[_0x9e07('0x12')]);router['get']('/:id/avatar',controller['getAvatar']);router[_0x9e07('0x8')](_0x9e07('0x13'),controller[_0x9e07('0x14')]);router[_0x9e07('0x8')](_0x9e07('0x15'),controller['getSystemAvatar']);router[_0x9e07('0x8')](_0x9e07('0x16'),auth[_0x9e07('0x9')](),controller[_0x9e07('0x17')]);router[_0x9e07('0x8')](_0x9e07('0x18'),controller['getSnippet']);router['get'](_0x9e07('0x19'),auth['isAuthenticated'](),controller[_0x9e07('0x1a')]);router['get'](_0x9e07('0x1b'),auth[_0x9e07('0x9')](),controller[_0x9e07('0x1c')]);router[_0x9e07('0x8')]('/:id/fields',controller[_0x9e07('0x1d')]);router[_0x9e07('0x8')](_0x9e07('0x1e'),auth[_0x9e07('0x9')](),controller[_0x9e07('0x1f')]);router['get']('/:id/users',auth[_0x9e07('0x9')](),controller['getAgents']);router[_0x9e07('0x20')]('/',auth[_0x9e07('0x9')](),controller[_0x9e07('0x21')]);router[_0x9e07('0x20')](_0x9e07('0xe'),auth['isAuthenticated'](),controller[_0x9e07('0x22')]);router[_0x9e07('0x20')]('/:id/canned_answers',auth[_0x9e07('0x9')](),controller[_0x9e07('0x23')]);var upload=multer({'storage':multer[_0x9e07('0x24')]({'destination':function(_0x5e1746,_0x124ed5,_0x56edd5){_0x56edd5(null,path[_0x9e07('0x25')](config[_0x9e07('0x26')],_0x9e07('0x27')));},'filename':function(_0x53f3f6,_0x5a90d3,_0x2836a5){_0x2836a5(null,util['format'](_0x9e07('0x28'),Date['now'](),_0x5a90d3[_0x9e07('0x29')]));}})});router[_0x9e07('0x20')]('/:id/logo',upload[_0x9e07('0x2a')](_0x9e07('0x2b')),controller[_0x9e07('0x2c')]);var upload=multer({'storage':multer[_0x9e07('0x24')]({'destination':function(_0x31126b,_0x32d48b,_0x143e19){_0x143e19(null,path['join'](config['root'],_0x9e07('0x2d')));},'filename':function(_0x3ced88,_0x516cf6,_0x14beec){_0x14beec(null,util[_0x9e07('0x2e')](_0x9e07('0x28'),Date['now'](),_0x516cf6[_0x9e07('0x29')]));}})});router[_0x9e07('0x20')]('/:id/avatar',upload[_0x9e07('0x2a')](_0x9e07('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x9e07('0x24')]({'destination':function(_0x44c3da,_0x20cc9a,_0x746046){_0x746046(null,path['join'](config['root'],_0x9e07('0x2d')));},'filename':function(_0x1396cb,_0x2c9d6f,_0x20fb7a){_0x20fb7a(null,util['format'](_0x9e07('0x28'),Date[_0x9e07('0x2f')](),_0x2c9d6f[_0x9e07('0x29')]));}})});router[_0x9e07('0x20')](_0x9e07('0x13'),upload[_0x9e07('0x2a')](_0x9e07('0x2b')),controller[_0x9e07('0x30')]);var upload=multer({'storage':multer[_0x9e07('0x24')]({'destination':function(_0x3bad59,_0x1a87ac,_0xfa4a52){_0xfa4a52(null,path[_0x9e07('0x25')](config[_0x9e07('0x26')],'server/files/images/avatars/'));},'filename':function(_0x11f93f,_0x463658,_0x582cc9){_0x582cc9(null,util[_0x9e07('0x2e')](_0x9e07('0x28'),Date[_0x9e07('0x2f')](),_0x463658['originalname']));}})});router[_0x9e07('0x20')](_0x9e07('0x15'),upload[_0x9e07('0x2a')](_0x9e07('0x2b')),controller[_0x9e07('0x31')]);router[_0x9e07('0x20')](_0x9e07('0x32'),controller[_0x9e07('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x9e07('0x24')]({'destination':function(_0x163d9d,_0x2621e3,_0x2f9df5){const _0x969a55=path['join'](config['root'],_0x9e07('0x34'),_0x9e07('0x35'),_0x9e07('0x36'));fs_extra[_0x9e07('0x37')](_0x969a55,function(){_0x2f9df5(null,_0x969a55);});},'filename':function(_0x34533b,_0x25e120,_0x14d497){const _0x24c2e4=_0x25e120[_0x9e07('0x29')][_0x9e07('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x26421f=path[_0x9e07('0x39')](_0x24c2e4);const _0x21bb9a=Date['now']()+'-'+_0x24c2e4[_0x9e07('0x38')](_0x26421f,'')+_0x26421f;_0x14d497(null,_0x21bb9a);}})});router[_0x9e07('0x20')](_0x9e07('0x3a'),offlineUploadMulter[_0x9e07('0x3b')](),controller[_0x9e07('0x3c')]);router[_0x9e07('0x20')](_0x9e07('0x16'),auth[_0x9e07('0x9')](),controller['addInteraction']);router['post'](_0x9e07('0x19'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x9e07('0x1b'),auth[_0x9e07('0x9')](),controller[_0x9e07('0x3d')]);router[_0x9e07('0x20')](_0x9e07('0x3e'),auth[_0x9e07('0x9')](),controller[_0x9e07('0x3f')]);router[_0x9e07('0x40')]('/:id',auth[_0x9e07('0x9')](),controller[_0x9e07('0x41')]);router[_0x9e07('0x42')](_0x9e07('0x43'),auth[_0x9e07('0x9')](),controller[_0x9e07('0x44')]);router[_0x9e07('0x42')]('/:id/dispositions',auth[_0x9e07('0x9')](),controller[_0x9e07('0x45')]);router[_0x9e07('0x42')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9e07('0x46')]);router[_0x9e07('0x42')]('/:id/users',auth[_0x9e07('0x9')](),controller[_0x9e07('0x47')]);module[_0x9e07('0x48')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index f7cc4dd..e513318 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 _0x6a57=['../components/auth/service','../config/environment','Router','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server'];(function(_0x114c74,_0x188e59){var _0x465157=function(_0x3b70ad){while(--_0x3b70ad){_0x114c74['push'](_0x114c74['shift']());}};_0x465157(++_0x188e59);}(_0x6a57,0x197));var _0x76a5=function(_0x4bdab6,_0xe86f11){_0x4bdab6=_0x4bdab6-0x0;var _0x5e1c1a=_0x6a57[_0x4bdab6];return _0x5e1c1a;};var beaverLogger=require(_0x76a5('0x0'));var express=require('express');var auth=require(_0x76a5('0x1'));var config=require(_0x76a5('0x2'));var router=express[_0x76a5('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x342f99,_0x1c1749,_0x85dfac){var _0x20a73f=_0x342f99[_0x76a5('0x4')][_0x76a5('0x5')](_0x76a5('0x6'));if(!_0x20a73f){throw new Error(_0x76a5('0x7'));}return beaverLogger[_0x76a5('0x8')]({'uri':'/client-logs','logger':_0x20a73f,'enableCors':!isProduction})(_0x342f99,_0x1c1749,_0x85dfac);}router[_0x76a5('0x9')](auth[_0x76a5('0xa')](),clientSideLogs);module[_0x76a5('0xb')]=router; \ No newline at end of file +var _0x5d4e=['get','client-side-logger','expressEndpoint','/client-logs','isAuthenticated','beaver-logger/server','express','../config/environment','Router','production','app'];(function(_0xfb5d3,_0xfb8d48){var _0xf1853=function(_0x12ceb9){while(--_0x12ceb9){_0xfb5d3['push'](_0xfb5d3['shift']());}};_0xf1853(++_0xfb8d48);}(_0x5d4e,0x1b2));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};var beaverLogger=require(_0xe5d4('0x0'));var express=require(_0xe5d4('0x1'));var auth=require('../components/auth/service');var config=require(_0xe5d4('0x2'));var router=express[_0xe5d4('0x3')]();var isProduction=config['env']===_0xe5d4('0x4')||![];function clientSideLogs(_0x557446,_0x57779b,_0x24218a){var _0x46865b=_0x557446[_0xe5d4('0x5')][_0xe5d4('0x6')](_0xe5d4('0x7'));if(!_0x46865b){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xe5d4('0x8')]({'uri':_0xe5d4('0x9'),'logger':_0x46865b,'enableCors':!isProduction})(_0x557446,_0x57779b,_0x24218a);}router['use'](auth[_0xe5d4('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 9559bd9..e3a62b5 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 _0x7898=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x7dc834,_0x2ea838){var _0x2b3946=function(_0x133ebf){while(--_0x133ebf){_0x7dc834['push'](_0x7dc834['shift']());}};_0x2b3946(++_0x2ea838);}(_0x7898,0xa0));var _0x8789=function(_0x4639d2,_0x41bf0a){_0x4639d2=_0x4639d2-0x0;var _0x5c1f9d=_0x7898[_0x4639d2];return _0x5c1f9d;};'use strict';var Sequelize=require(_0x8789('0x0'));module[_0x8789('0x1')]={'name':{'type':Sequelize[_0x8789('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x8789('0x3'),_0x8789('0x4'),_0x8789('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8789('0x6')](_0x8789('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x8789('0x8')},'data2':{'type':Sequelize[_0x8789('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x8789('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x8789('0x2')],'comment':_0x8789('0x9')},'data5':{'type':Sequelize[_0x8789('0xa')],'comment':_0x8789('0xb')},'data6':{'type':Sequelize[_0x8789('0xa')],'comment':_0x8789('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xb008=['STRING','ENUM','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x48b535,_0x355c27){var _0x1aec5b=function(_0x3c72f0){while(--_0x3c72f0){_0x48b535['push'](_0x48b535['shift']());}};_0x1aec5b(++_0x355c27);}(_0xb008,0xa6));var _0x8b00=function(_0x4d59c3,_0x3af2f8){_0x4d59c3=_0x4d59c3-0x0;var _0xb9be18=_0xb008[_0x4d59c3];return _0xb9be18;};'use strict';var Sequelize=require(_0x8b00('0x0'));module[_0x8b00('0x1')]={'name':{'type':Sequelize[_0x8b00('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8b00('0x3')]('AmazonAWS',_0x8b00('0x4'),_0x8b00('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8b00('0x3')](_0x8b00('0x6'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x8b00('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x8b00('0x8')},'data3':{'type':Sequelize[_0x8b00('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x8b00('0x2')],'comment':_0x8b00('0x9')},'data5':{'type':Sequelize[_0x8b00('0xa')],'comment':_0x8b00('0xb')},'data6':{'type':Sequelize[_0x8b00('0xa')],'comment':_0x8b00('0xc')},'data7':{'type':Sequelize[_0x8b00('0xa')],'comment':_0x8b00('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 7cef634..1697077 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 _0x586e=['index','map','CloudProvider','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','state','toString','ascii','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','then','end','name','send','padEnd','slice'];(function(_0x44dc86,_0x5d33da){var _0x22b4b7=function(_0x420804){while(--_0x420804){_0x44dc86['push'](_0x44dc86['shift']());}};_0x22b4b7(++_0x5d33da);}(_0x586e,0xa5));var _0xe586=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x586e[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0xe586('0x0'));var Redis=require(_0xe586('0x1'));var qs=require(_0xe586('0x2'));var encryptor=require(_0xe586('0x3'));var config=require(_0xe586('0x4'));var logger=require(_0xe586('0x5'))(_0xe586('0x6'));var db=require(_0xe586('0x7'))['db'];var oauth=require(_0xe586('0x8'));config['redis']=_[_0xe586('0x9')](config[_0xe586('0xa')],{'host':_0xe586('0xb'),'port':0x18eb});var socket=require(_0xe586('0xc'))(new Redis(config[_0xe586('0xa')]));var redis=new Redis(config[_0xe586('0xa')]);function respondWithStatusCode(_0x49bc22,_0x46d5bd){_0x46d5bd=_0x46d5bd||0xcc;return function(_0x13576c){if(_0x13576c){return _0x49bc22[_0xe586('0xd')](_0x46d5bd);}return _0x49bc22[_0xe586('0xe')](_0x46d5bd)['end']();};}function respondWithResult(_0x3d449f,_0x4c4125){_0x4c4125=_0x4c4125||0xc8;return function(_0xcb0cc5){if(_0xcb0cc5){return _0x3d449f[_0xe586('0xe')](_0x4c4125)['json'](_0xcb0cc5);}};}function respondWithFilteredResult(_0x36e265,_0x50de8c){return function(_0x4f530f){if(_0x4f530f){var _0x3705c4=typeof _0x50de8c[_0xe586('0xf')]==='undefined'&&typeof _0x50de8c['limit']===_0xe586('0x10');var _0x3e8b5a=_0x4f530f[_0xe586('0x11')];var _0x1651e8=_0x3705c4?0x0:_0x50de8c['offset'];var _0x10e2b5=_0x3705c4?_0x4f530f[_0xe586('0x11')]:_0x50de8c['offset']+_0x50de8c[_0xe586('0x12')];var _0x4afa74;if(_0x10e2b5>=_0x3e8b5a){_0x10e2b5=_0x3e8b5a;_0x4afa74=0xc8;}else{_0x4afa74=0xce;}_0x36e265[_0xe586('0xe')](_0x4afa74);return _0x36e265[_0xe586('0x13')](_0xe586('0x14'),_0x1651e8+'-'+_0x10e2b5+'/'+_0x3e8b5a)[_0xe586('0x15')](_0x4f530f);}return null;};}function saveUpdates(_0x748f3){return function(_0x28c2cd){if(_0x28c2cd){return _0x28c2cd[_0xe586('0x16')](_0x748f3)['then'](function(_0xa557c2){return _0xa557c2;});}return null;};}function removeEntity(_0x4a401c){return function(_0x340471){if(_0x340471){return _0x340471['destroy']()[_0xe586('0x17')](function(){_0x4a401c[_0xe586('0xe')](0xcc)[_0xe586('0x18')]();});}};}function handleEntityNotFound(_0x8782c3){return function(_0x4114dc){if(!_0x4114dc){_0x8782c3['sendStatus'](0x194);}return _0x4114dc;};}function handleError(_0x497df1,_0x1ed1b8){_0x1ed1b8=_0x1ed1b8||0x1f4;return function(_0x1ba2cc){logger['error'](_0x1ba2cc['stack']);if(_0x1ba2cc[_0xe586('0x19')]){delete _0x1ba2cc[_0xe586('0x19')];}_0x497df1[_0xe586('0xe')](_0x1ed1b8)[_0xe586('0x1a')](_0x1ba2cc);};}function maskClientSecret(_0x111a77){return _[_0xe586('0x1b')](_0x111a77[_0xe586('0x1c')](0x0,0x3),0x14,'*');}exports[_0xe586('0x1d')]=function(_0x54d164,_0x4df6c8){var _0x5590f3={},_0x50f9be={},_0x254e38={'count':0x0,'rows':[]};var _0x250de9=_[_0xe586('0x1e')](db[_0xe586('0x1f')][_0xe586('0x20')],function(_0x5d7463){return{'name':_0x5d7463[_0xe586('0x21')],'type':_0x5d7463[_0xe586('0x22')][_0xe586('0x23')]};});_0x50f9be['model']=_[_0xe586('0x1e')](_0x250de9,_0xe586('0x19'));_0x50f9be['query']=_[_0xe586('0x24')](_0x54d164[_0xe586('0x25')]);_0x50f9be[_0xe586('0x26')]=_[_0xe586('0x27')](_0x50f9be[_0xe586('0x28')],_0x50f9be[_0xe586('0x25')]);_0x5590f3[_0xe586('0x29')]=_[_0xe586('0x27')](_0x50f9be['model'],qs[_0xe586('0x2a')](_0x54d164[_0xe586('0x25')]['fields']));_0x5590f3[_0xe586('0x29')]=_0x5590f3['attributes'][_0xe586('0x2b')]?_0x5590f3[_0xe586('0x29')]:_0x50f9be[_0xe586('0x28')];if(!_0x54d164[_0xe586('0x25')][_0xe586('0x2c')]('nolimit')){_0x5590f3[_0xe586('0x12')]=qs[_0xe586('0x12')](_0x54d164[_0xe586('0x25')][_0xe586('0x12')]);_0x5590f3[_0xe586('0xf')]=qs[_0xe586('0xf')](_0x54d164[_0xe586('0x25')]['offset']);}_0x5590f3['order']=qs['sort'](_0x54d164[_0xe586('0x25')]['sort']);_0x5590f3[_0xe586('0x2d')]=qs['filters'](_[_0xe586('0x2e')](_0x54d164['query'],_0x50f9be[_0xe586('0x26')]),_0x250de9);if(_0x54d164[_0xe586('0x25')][_0xe586('0x2f')]){_0x5590f3[_0xe586('0x2d')]=_['merge'](_0x5590f3[_0xe586('0x2d')],{'$or':_[_0xe586('0x1e')](_0x250de9,function(_0x4651b3){if(_0x4651b3['type']!=='VIRTUAL'){var _0x9b38fa={};_0x9b38fa[_0x4651b3[_0xe586('0x19')]]={'$like':'%'+_0x54d164[_0xe586('0x25')][_0xe586('0x2f')]+'%'};return _0x9b38fa;}})});}_0x5590f3=_[_0xe586('0x30')]({},_0x5590f3,_0x54d164[_0xe586('0x31')]);var _0x338baa={'where':_0x5590f3[_0xe586('0x2d')]};return db[_0xe586('0x1f')][_0xe586('0x11')](_0x338baa)['then'](function(_0x3b1d5f){_0x254e38['count']=_0x3b1d5f;if(_0x54d164[_0xe586('0x25')][_0xe586('0x32')]){_0x5590f3[_0xe586('0x33')]=[{'all':!![]}];}return db[_0xe586('0x1f')]['findAll'](_0x5590f3);})[_0xe586('0x17')](function(_0x4a4cd4){_0x254e38[_0xe586('0x34')]=_[_0xe586('0x1e')](_0x4a4cd4,function(_0x27bc47){if(_0x27bc47[_0xe586('0x35')]===_0xe586('0x36')){var _0x1f0a54=encryptor[_0xe586('0x37')](_0x27bc47[_0xe586('0x38')]);_0x27bc47[_0xe586('0x38')]=maskClientSecret(_0x1f0a54);}return _0x27bc47;});return _0x254e38;})['then'](respondWithFilteredResult(_0x4df6c8,_0x5590f3))[_0xe586('0x39')](handleError(_0x4df6c8,null));};exports['show']=function(_0x173365,_0x5eb080){var _0x44cead={'raw':!![],'where':{'id':_0x173365['params']['id']}},_0x30c3c5={};_0x30c3c5['model']=_['keys'](db[_0xe586('0x1f')][_0xe586('0x20')]);_0x30c3c5['query']=_[_0xe586('0x24')](_0x173365['query']);_0x30c3c5[_0xe586('0x26')]=_[_0xe586('0x27')](_0x30c3c5[_0xe586('0x28')],_0x30c3c5[_0xe586('0x25')]);_0x44cead[_0xe586('0x29')]=_[_0xe586('0x27')](_0x30c3c5[_0xe586('0x28')],qs[_0xe586('0x2a')](_0x173365['query'][_0xe586('0x2a')]));_0x44cead['attributes']=_0x44cead[_0xe586('0x29')][_0xe586('0x2b')]?_0x44cead[_0xe586('0x29')]:_0x30c3c5[_0xe586('0x28')];if(_0x173365['query'][_0xe586('0x32')]){_0x44cead['include']=[{'all':!![]}];}_0x44cead=_[_0xe586('0x30')]({},_0x44cead,_0x173365[_0xe586('0x31')]);return db[_0xe586('0x1f')][_0xe586('0x3a')](_0x44cead)[_0xe586('0x17')](handleEntityNotFound(_0x5eb080,null))[_0xe586('0x17')](function(_0x55a27d){if(_0x55a27d[_0xe586('0x35')]==='MicrosoftAzure'){var _0x4999ba=encryptor[_0xe586('0x37')](_0x55a27d[_0xe586('0x38')]);_0x55a27d[_0xe586('0x38')]=maskClientSecret(_0x4999ba);}return _0x55a27d;})[_0xe586('0x17')](respondWithResult(_0x5eb080,null))[_0xe586('0x39')](handleError(_0x5eb080,null));};exports[_0xe586('0x3b')]=function(_0x332c3f,_0x1c172a){if(!_0x332c3f[_0xe586('0x3c')][_0xe586('0x19')])throw new Error(_0xe586('0x3d'));if(!_0x332c3f['body'][_0xe586('0x35')])throw new Error(_0xe586('0x3e'));var _0x581f74=db[_0xe586('0x1f')][_0xe586('0x20')][_0xe586('0x35')][_0xe586('0x3f')];if(!_0x581f74[_0xe586('0x40')](_0x332c3f[_0xe586('0x3c')][_0xe586('0x35')]))throw new Error(_0xe586('0x41')+_0x581f74[_0xe586('0x42')](',\x20'));if(_0x332c3f[_0xe586('0x3c')]['service']==='MicrosoftAzure'&&_0x332c3f[_0xe586('0x3c')][_0xe586('0x38')]){_0x332c3f[_0xe586('0x3c')]['data3']=encryptor[_0xe586('0x43')](_0x332c3f[_0xe586('0x3c')][_0xe586('0x38')]);}return db[_0xe586('0x1f')]['create'](_0x332c3f[_0xe586('0x3c')],{})[_0xe586('0x17')](respondWithResult(_0x1c172a,0xc9))['catch'](handleError(_0x1c172a,null));};exports[_0xe586('0x16')]=function(_0x5afe38,_0x3a8658){if(_0x5afe38[_0xe586('0x3c')]['id']){delete _0x5afe38['body']['id'];}return db[_0xe586('0x1f')][_0xe586('0x3a')]({'where':{'id':_0x5afe38[_0xe586('0x44')]['id']}})[_0xe586('0x17')](handleEntityNotFound(_0x3a8658,null))[_0xe586('0x17')](function(_0x4f8738){if(_0x4f8738['service']==='MicrosoftAzure'&&_0x5afe38[_0xe586('0x3c')][_0xe586('0x38')]){_0x5afe38[_0xe586('0x3c')][_0xe586('0x38')]=encryptor['encryptString'](_0x5afe38['body']['data3']);}return _0x4f8738;})['then'](saveUpdates(_0x5afe38['body'],null))[_0xe586('0x17')](respondWithResult(_0x3a8658,null))[_0xe586('0x39')](handleError(_0x3a8658,null));};exports[_0xe586('0x45')]=function(_0x137e0e,_0x1547bc){return db[_0xe586('0x1f')][_0xe586('0x3a')]({'where':{'id':_0x137e0e[_0xe586('0x44')]['id']}})[_0xe586('0x17')](handleEntityNotFound(_0x1547bc,null))[_0xe586('0x17')](removeEntity(_0x1547bc,null))[_0xe586('0x39')](handleError(_0x1547bc,null));};exports[_0xe586('0x46')]=function(_0xd9652e,_0x2740e8){return db[_0xe586('0x1f')]['findOne']({'where':{'id':_0xd9652e[_0xe586('0x44')]['id']},'raw':!![]})['then'](function(_0x563f91){if(!_0x563f91)return _0x2740e8[_0xe586('0xd')](0x194);return{'url':oauth[_0xe586('0x47')](_0x563f91,_0xd9652e[_0xe586('0x48')]['id'])};})[_0xe586('0x17')](respondWithResult(_0x2740e8,null))[_0xe586('0x39')](handleError(_0x2740e8,null));};exports[_0xe586('0x49')]=function(_0x189e2c,_0x2d0965){var _0x46a805=_0x189e2c[_0xe586('0x3c')];var _0x4c23ce;var _0x4c557f;if(_0x46a805['error'])throw _0x46a805;redis['get'](_0x46a805['state'])[_0xe586('0x17')](function(_0xa8bb7a){if(!_0xa8bb7a)throw new Error(_0xe586('0x4a'));_0x4c23ce=JSON[_0xe586('0x4b')](_0xa8bb7a);var _0x52ae30=Buffer['from'](_0x46a805[_0xe586('0x4c')],'base64')[_0xe586('0x4d')](_0xe586('0x4e'));_0x4c557f=JSON['parse'](_0x52ae30);if(!oauth[_0xe586('0x4f')](_0x46a805[_0xe586('0x50')],_0x4c23ce['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xe586('0x51')](_0x46a805['state']);return oauth[_0xe586('0x52')](_0x46a805[_0xe586('0x53')],_0x4c23ce);})[_0xe586('0x17')](function(_0x2de782){_0x4c23ce[_0xe586('0x54')]=_0x2de782[_0xe586('0x55')];_0x4c23ce['data6']=_0x2de782[_0xe586('0x56')];return db[_0xe586('0x1f')][_0xe586('0x16')]({'data5':_0x4c23ce[_0xe586('0x54')],'data6':_0x4c23ce[_0xe586('0x57')]},{'where':{'id':_0x4c23ce['id']}});})[_0xe586('0x17')](function(){oauth[_0xe586('0x58')](_0x4c23ce);socket[_0xe586('0x59')](_0xe586('0x5a'),{'id':_0x4c557f['id']});return;})[_0xe586('0x17')](respondWithStatusCode(_0x2d0965,null))[_0xe586('0x39')](function(_0x49897e){if(_0x4c557f){socket[_0xe586('0x59')](_0xe586('0x5b'),{'id':_0x4c557f['id']});}if(!_0x4c23ce){logger[_0xe586('0x5c')](_0xe586('0x5d'),_0x49897e);return _0x2d0965[_0xe586('0xe')](0x1f4)[_0xe586('0x1a')](_0x49897e[_0xe586('0x5e')]);}logger['error'](_0xe586('0x5f'),_0x4c23ce['id'],JSON[_0xe586('0x60')](_0x49897e));});}; \ No newline at end of file +var _0xa61f=['../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','error','stack','name','send','padEnd','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','filter','merge','options','CloudProvider','includeAll','findAll','then','rows','service','MicrosoftAzure','decryptString','data3','catch','length','include','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api'];(function(_0x332906,_0x58ab96){var _0x311a8e=function(_0x6ff3d3){while(--_0x6ff3d3){_0x332906['push'](_0x332906['shift']());}};_0x311a8e(++_0x58ab96);}(_0xa61f,0x17a));var _0xfa61=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa61f[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xfa61('0x0'));var Redis=require(_0xfa61('0x1'));var qs=require(_0xfa61('0x2'));var encryptor=require(_0xfa61('0x3'));var config=require('../../config/environment');var logger=require(_0xfa61('0x4'))(_0xfa61('0x5'));var db=require(_0xfa61('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xfa61('0x7')]=_[_0xfa61('0x8')](config[_0xfa61('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa61('0x9'))(new Redis(config[_0xfa61('0x7')]));var redis=new Redis(config[_0xfa61('0x7')]);function respondWithStatusCode(_0x49ee99,_0x3368f6){_0x3368f6=_0x3368f6||0xcc;return function(_0x729248){if(_0x729248){return _0x49ee99[_0xfa61('0xa')](_0x3368f6);}return _0x49ee99[_0xfa61('0xb')](_0x3368f6)[_0xfa61('0xc')]();};}function respondWithResult(_0x38931a,_0x19a583){_0x19a583=_0x19a583||0xc8;return function(_0x579cf1){if(_0x579cf1){return _0x38931a['status'](_0x19a583)[_0xfa61('0xd')](_0x579cf1);}};}function respondWithFilteredResult(_0x180a53,_0x18fe51){return function(_0x530b04){if(_0x530b04){var _0x29bb64=typeof _0x18fe51[_0xfa61('0xe')]===_0xfa61('0xf')&&typeof _0x18fe51[_0xfa61('0x10')]==='undefined';var _0x4fb57e=_0x530b04[_0xfa61('0x11')];var _0x32f086=_0x29bb64?0x0:_0x18fe51[_0xfa61('0xe')];var _0x5caa56=_0x29bb64?_0x530b04[_0xfa61('0x11')]:_0x18fe51['offset']+_0x18fe51[_0xfa61('0x10')];var _0x55f74d;if(_0x5caa56>=_0x4fb57e){_0x5caa56=_0x4fb57e;_0x55f74d=0xc8;}else{_0x55f74d=0xce;}_0x180a53[_0xfa61('0xb')](_0x55f74d);return _0x180a53[_0xfa61('0x12')](_0xfa61('0x13'),_0x32f086+'-'+_0x5caa56+'/'+_0x4fb57e)['json'](_0x530b04);}return null;};}function saveUpdates(_0x1addc5){return function(_0xc0f178){if(_0xc0f178){return _0xc0f178[_0xfa61('0x14')](_0x1addc5)['then'](function(_0x3f21db){return _0x3f21db;});}return null;};}function removeEntity(_0x1a2735){return function(_0x58b128){if(_0x58b128){return _0x58b128[_0xfa61('0x15')]()['then'](function(){_0x1a2735[_0xfa61('0xb')](0xcc)[_0xfa61('0xc')]();});}};}function handleEntityNotFound(_0x785765){return function(_0x5dd172){if(!_0x5dd172){_0x785765[_0xfa61('0xa')](0x194);}return _0x5dd172;};}function handleError(_0x239ddf,_0x1d0254){_0x1d0254=_0x1d0254||0x1f4;return function(_0x3ee81d){logger[_0xfa61('0x16')](_0x3ee81d[_0xfa61('0x17')]);if(_0x3ee81d[_0xfa61('0x18')]){delete _0x3ee81d[_0xfa61('0x18')];}_0x239ddf[_0xfa61('0xb')](_0x1d0254)[_0xfa61('0x19')](_0x3ee81d);};}function maskClientSecret(_0x1b5ef6){return _[_0xfa61('0x1a')](_0x1b5ef6['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x11e973,_0x3fe743){var _0x37d0e2={},_0x5cf53f={},_0x3dc53d={'count':0x0,'rows':[]};var _0x237e31=_[_0xfa61('0x1b')](db['CloudProvider'][_0xfa61('0x1c')],function(_0x4d11b8){return{'name':_0x4d11b8[_0xfa61('0x1d')],'type':_0x4d11b8[_0xfa61('0x1e')][_0xfa61('0x1f')]};});_0x5cf53f[_0xfa61('0x20')]=_['map'](_0x237e31,_0xfa61('0x18'));_0x5cf53f[_0xfa61('0x21')]=_[_0xfa61('0x22')](_0x11e973['query']);_0x5cf53f['filters']=_[_0xfa61('0x23')](_0x5cf53f[_0xfa61('0x20')],_0x5cf53f[_0xfa61('0x21')]);_0x37d0e2[_0xfa61('0x24')]=_[_0xfa61('0x23')](_0x5cf53f['model'],qs['fields'](_0x11e973[_0xfa61('0x21')][_0xfa61('0x25')]));_0x37d0e2[_0xfa61('0x24')]=_0x37d0e2[_0xfa61('0x24')]['length']?_0x37d0e2[_0xfa61('0x24')]:_0x5cf53f[_0xfa61('0x20')];if(!_0x11e973[_0xfa61('0x21')]['hasOwnProperty']('nolimit')){_0x37d0e2['limit']=qs[_0xfa61('0x10')](_0x11e973[_0xfa61('0x21')][_0xfa61('0x10')]);_0x37d0e2[_0xfa61('0xe')]=qs['offset'](_0x11e973['query'][_0xfa61('0xe')]);}_0x37d0e2[_0xfa61('0x26')]=qs['sort'](_0x11e973['query'][_0xfa61('0x27')]);_0x37d0e2[_0xfa61('0x28')]=qs[_0xfa61('0x29')](_['pick'](_0x11e973[_0xfa61('0x21')],_0x5cf53f[_0xfa61('0x29')]),_0x237e31);if(_0x11e973[_0xfa61('0x21')][_0xfa61('0x2a')]){_0x37d0e2['where']=_[_0xfa61('0x2b')](_0x37d0e2[_0xfa61('0x28')],{'$or':_[_0xfa61('0x1b')](_0x237e31,function(_0x33b1c8){if(_0x33b1c8[_0xfa61('0x1e')]!=='VIRTUAL'){var _0x3b6098={};_0x3b6098[_0x33b1c8[_0xfa61('0x18')]]={'$like':'%'+_0x11e973['query']['filter']+'%'};return _0x3b6098;}})});}_0x37d0e2=_[_0xfa61('0x2b')]({},_0x37d0e2,_0x11e973[_0xfa61('0x2c')]);var _0x57fc79={'where':_0x37d0e2['where']};return db[_0xfa61('0x2d')][_0xfa61('0x11')](_0x57fc79)['then'](function(_0x17c780){_0x3dc53d['count']=_0x17c780;if(_0x11e973[_0xfa61('0x21')][_0xfa61('0x2e')]){_0x37d0e2['include']=[{'all':!![]}];}return db['CloudProvider'][_0xfa61('0x2f')](_0x37d0e2);})[_0xfa61('0x30')](function(_0xc6f138){_0x3dc53d[_0xfa61('0x31')]=_[_0xfa61('0x1b')](_0xc6f138,function(_0x3ff8c5){if(_0x3ff8c5[_0xfa61('0x32')]===_0xfa61('0x33')){var _0x12d084=encryptor[_0xfa61('0x34')](_0x3ff8c5[_0xfa61('0x35')]);_0x3ff8c5[_0xfa61('0x35')]=maskClientSecret(_0x12d084);}return _0x3ff8c5;});return _0x3dc53d;})[_0xfa61('0x30')](respondWithFilteredResult(_0x3fe743,_0x37d0e2))[_0xfa61('0x36')](handleError(_0x3fe743,null));};exports['show']=function(_0xa928c,_0x2ba246){var _0x21d80f={'raw':!![],'where':{'id':_0xa928c['params']['id']}},_0x300572={};_0x300572[_0xfa61('0x20')]=_[_0xfa61('0x22')](db[_0xfa61('0x2d')][_0xfa61('0x1c')]);_0x300572[_0xfa61('0x21')]=_[_0xfa61('0x22')](_0xa928c[_0xfa61('0x21')]);_0x300572['filters']=_[_0xfa61('0x23')](_0x300572['model'],_0x300572[_0xfa61('0x21')]);_0x21d80f[_0xfa61('0x24')]=_[_0xfa61('0x23')](_0x300572['model'],qs[_0xfa61('0x25')](_0xa928c['query'][_0xfa61('0x25')]));_0x21d80f[_0xfa61('0x24')]=_0x21d80f[_0xfa61('0x24')][_0xfa61('0x37')]?_0x21d80f[_0xfa61('0x24')]:_0x300572['model'];if(_0xa928c[_0xfa61('0x21')][_0xfa61('0x2e')]){_0x21d80f[_0xfa61('0x38')]=[{'all':!![]}];}_0x21d80f=_['merge']({},_0x21d80f,_0xa928c[_0xfa61('0x2c')]);return db[_0xfa61('0x2d')][_0xfa61('0x39')](_0x21d80f)[_0xfa61('0x30')](handleEntityNotFound(_0x2ba246,null))['then'](function(_0xd6dcab){if(_0xd6dcab[_0xfa61('0x32')]===_0xfa61('0x33')){var _0x2919f5=encryptor['decryptString'](_0xd6dcab[_0xfa61('0x35')]);_0xd6dcab[_0xfa61('0x35')]=maskClientSecret(_0x2919f5);}return _0xd6dcab;})[_0xfa61('0x30')](respondWithResult(_0x2ba246,null))[_0xfa61('0x36')](handleError(_0x2ba246,null));};exports[_0xfa61('0x3a')]=function(_0x3c21b4,_0x923723){if(!_0x3c21b4[_0xfa61('0x3b')][_0xfa61('0x18')])throw new Error(_0xfa61('0x3c'));if(!_0x3c21b4['body'][_0xfa61('0x32')])throw new Error(_0xfa61('0x3d'));var _0x134e60=db[_0xfa61('0x2d')][_0xfa61('0x1c')][_0xfa61('0x32')]['values'];if(!_0x134e60[_0xfa61('0x3e')](_0x3c21b4[_0xfa61('0x3b')][_0xfa61('0x32')]))throw new Error(_0xfa61('0x3f')+_0x134e60[_0xfa61('0x40')](',\x20'));if(_0x3c21b4[_0xfa61('0x3b')][_0xfa61('0x32')]===_0xfa61('0x33')&&_0x3c21b4[_0xfa61('0x3b')]['data3']){_0x3c21b4['body']['data3']=encryptor['encryptString'](_0x3c21b4['body']['data3']);}return db['CloudProvider'][_0xfa61('0x3a')](_0x3c21b4[_0xfa61('0x3b')],{})[_0xfa61('0x30')](respondWithResult(_0x923723,0xc9))[_0xfa61('0x36')](handleError(_0x923723,null));};exports[_0xfa61('0x14')]=function(_0x188aa0,_0x2d3e2e){if(_0x188aa0[_0xfa61('0x3b')]['id']){delete _0x188aa0[_0xfa61('0x3b')]['id'];}return db[_0xfa61('0x2d')][_0xfa61('0x39')]({'where':{'id':_0x188aa0['params']['id']}})['then'](handleEntityNotFound(_0x2d3e2e,null))[_0xfa61('0x30')](function(_0x5b0869){if(_0x5b0869[_0xfa61('0x32')]===_0xfa61('0x33')&&_0x188aa0['body'][_0xfa61('0x35')]){_0x188aa0[_0xfa61('0x3b')][_0xfa61('0x35')]=encryptor[_0xfa61('0x41')](_0x188aa0['body'][_0xfa61('0x35')]);}return _0x5b0869;})[_0xfa61('0x30')](saveUpdates(_0x188aa0['body'],null))[_0xfa61('0x30')](respondWithResult(_0x2d3e2e,null))[_0xfa61('0x36')](handleError(_0x2d3e2e,null));};exports[_0xfa61('0x15')]=function(_0x21a3a1,_0x45a94d){return db['CloudProvider'][_0xfa61('0x39')]({'where':{'id':_0x21a3a1[_0xfa61('0x42')]['id']}})[_0xfa61('0x30')](handleEntityNotFound(_0x45a94d,null))['then'](removeEntity(_0x45a94d,null))[_0xfa61('0x36')](handleError(_0x45a94d,null));};exports[_0xfa61('0x43')]=function(_0x4dac4a,_0x45d839){return db[_0xfa61('0x2d')]['findOne']({'where':{'id':_0x4dac4a[_0xfa61('0x42')]['id']},'raw':!![]})[_0xfa61('0x30')](function(_0x88b34c){if(!_0x88b34c)return _0x45d839['sendStatus'](0x194);return{'url':oauth[_0xfa61('0x44')](_0x88b34c,_0x4dac4a[_0xfa61('0x45')]['id'])};})[_0xfa61('0x30')](respondWithResult(_0x45d839,null))[_0xfa61('0x36')](handleError(_0x45d839,null));};exports[_0xfa61('0x46')]=function(_0x486a43,_0x54fdb2){var _0x48a8f3=_0x486a43[_0xfa61('0x3b')];var _0x2efea4;var _0x577e8c;if(_0x48a8f3[_0xfa61('0x16')])throw _0x48a8f3;redis['get'](_0x48a8f3[_0xfa61('0x47')])[_0xfa61('0x30')](function(_0x181660){if(!_0x181660)throw new Error(_0xfa61('0x48'));_0x2efea4=JSON[_0xfa61('0x49')](_0x181660);var _0x5e4b5a=Buffer[_0xfa61('0x4a')](_0x48a8f3[_0xfa61('0x47')],_0xfa61('0x4b'))[_0xfa61('0x4c')](_0xfa61('0x4d'));_0x577e8c=JSON[_0xfa61('0x49')](_0x5e4b5a);if(!oauth[_0xfa61('0x4e')](_0x48a8f3[_0xfa61('0x4f')],_0x2efea4[_0xfa61('0x50')]))throw new Error(_0xfa61('0x51'));redis[_0xfa61('0x52')](_0x48a8f3['state']);return oauth[_0xfa61('0x53')](_0x48a8f3[_0xfa61('0x54')],_0x2efea4);})[_0xfa61('0x30')](function(_0x260c5b){_0x2efea4['data5']=_0x260c5b[_0xfa61('0x55')];_0x2efea4[_0xfa61('0x56')]=_0x260c5b[_0xfa61('0x57')];return db['CloudProvider']['update']({'data5':_0x2efea4['data5'],'data6':_0x2efea4['data6']},{'where':{'id':_0x2efea4['id']}});})[_0xfa61('0x30')](function(){oauth[_0xfa61('0x58')](_0x2efea4);socket['emit'](_0xfa61('0x59'),{'id':_0x577e8c['id']});return;})[_0xfa61('0x30')](respondWithStatusCode(_0x54fdb2,null))[_0xfa61('0x36')](function(_0x7aa6bf){if(_0x577e8c){socket[_0xfa61('0x5a')](_0xfa61('0x5b'),{'id':_0x577e8c['id']});}if(!_0x2efea4){logger[_0xfa61('0x16')](_0xfa61('0x5c'),_0x7aa6bf);return _0x54fdb2[_0xfa61('0xb')](0x1f4)[_0xfa61('0x19')](_0x7aa6bf[_0xfa61('0x5d')]);}logger[_0xfa61('0x16')](_0xfa61('0x5e'),_0x2efea4['id'],JSON[_0xfa61('0x5f')](_0x7aa6bf));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index a24e894..aa33902 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 _0xc6ed=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x4e97df,_0x38deba){var _0x2f132e=function(_0x1fb46f){while(--_0x1fb46f){_0x4e97df['push'](_0x4e97df['shift']());}};_0x2f132e(++_0x38deba);}(_0xc6ed,0x161));var _0xdc6e=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc6ed[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xdc6e('0x0'));var util=require(_0xdc6e('0x1'));var logger=require(_0xdc6e('0x2'))(_0xdc6e('0x3'));var moment=require('moment');var BPromise=require(_0xdc6e('0x4'));var rp=require(_0xdc6e('0x5'));var fs=require('fs');var path=require(_0xdc6e('0x6'));var rimraf=require('rimraf');var config=require(_0xdc6e('0x7'));var attributes=require(_0xdc6e('0x8'));module[_0xdc6e('0x9')]=function(_0x307def,_0x49ae37){return _0x307def[_0xdc6e('0xa')](_0xdc6e('0xb'),attributes,{'tableName':_0xdc6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x986e=['api','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x1fa68b,_0x152e4e){var _0x32a3c6=function(_0x25c292){while(--_0x25c292){_0x1fa68b['push'](_0x1fa68b['shift']());}};_0x32a3c6(++_0x152e4e);}(_0x986e,0x19d));var _0xe986=function(_0x8adbfe,_0x5b464e){_0x8adbfe=_0x8adbfe-0x0;var _0x5bb8ce=_0x986e[_0x8adbfe];return _0x5bb8ce;};'use strict';var _=require(_0xe986('0x0'));var util=require(_0xe986('0x1'));var logger=require(_0xe986('0x2'))(_0xe986('0x3'));var moment=require(_0xe986('0x4'));var BPromise=require(_0xe986('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe986('0x6'));var rimraf=require(_0xe986('0x7'));var config=require(_0xe986('0x8'));var attributes=require(_0xe986('0x9'));module[_0xe986('0xa')]=function(_0x5593a3,_0x4d9b50){return _0x5593a3['define'](_0xe986('0xb'),attributes,{'tableName':_0xe986('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 1fae493..457578f 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 _0x1542=['../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','push','data7','/.default','Outlook365','Dynamics365','data2','code','id_token','from','stringify','base64','randomBytes','toString','data1','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','isAfter','unix','then','data3','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','replace','intervals','bind','map','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','ioredis','request-promise','util','../../components/encryptor'];(function(_0x49ec8d,_0x4804a9){var _0x1d6db3=function(_0x18b3a5){while(--_0x18b3a5){_0x49ec8d['push'](_0x49ec8d['shift']());}};_0x1d6db3(++_0x4804a9);}(_0x1542,0x92));var _0x2154=function(_0x3feb60,_0x2f532d){_0x3feb60=_0x3feb60-0x0;var _0x5d69b9=_0x1542[_0x3feb60];return _0x5d69b9;};'use strict';var _=require(_0x2154('0x0'));var crypto=require(_0x2154('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x2154('0x2'));var rp=require(_0x2154('0x3'));var util=require(_0x2154('0x4'));var encryptor=require(_0x2154('0x5'));var config=require(_0x2154('0x6'));var logger=require(_0x2154('0x7'))(_0x2154('0x8'));var schedule=require(_0x2154('0x9'));var db=require(_0x2154('0xa'))['db'];config[_0x2154('0xb')]=_['defaults'](config[_0x2154('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x2154('0xb')]);var MICROSOFT_AUTH_URL=_0x2154('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2154('0xd'),'profile','email',_0x2154('0xe'),_0x2154('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0x2154('0x10')],'Dynamics365':['openid',_0x2154('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x2154('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x2154('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x27e050){var _0x45e802=_['map'](AZURE_AUTH_SCOPES[_0x27e050[_0x2154('0x13')]]);if(_0x27e050[_0x2154('0x13')]==='Dynamics365')_0x45e802[_0x2154('0x14')](_0x27e050[_0x2154('0x15')]+_0x2154('0x16'));return _0x45e802['join']('\x20');}function getAccessTokenScope(_0x47f4d2){if(_0x47f4d2['type']===_0x2154('0x17'))return _0x2154('0xf');if(_0x47f4d2[_0x2154('0x13')]===_0x2154('0x18'))return _0x47f4d2[_0x2154('0x15')]+_0x2154('0x16');}function generateMicrosoftAuthorizationUrl(_0x3123b2,_0xe19dc8){var _0x3eea36=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3123b2[_0x2154('0x19')]);var _0x795a94=[_0x2154('0x1a'),_0x2154('0x1b')];var _0x20a04b=Buffer[_0x2154('0x1c')](JSON[_0x2154('0x1d')]({'id':_0xe19dc8}))['toString'](_0x2154('0x1e'));var _0x141ba0=crypto[_0x2154('0x1f')](0x10)[_0x2154('0x20')]('hex');var _0x58d16a=getAuthorizationScopes(_0x3123b2);var _0x3dee0a=[{'key':'client_id','value':_0x3123b2[_0x2154('0x21')]},{'key':'response_type','value':encodeURIComponent(_0x795a94[_0x2154('0x22')]('\x20'))},{'key':_0x2154('0x23'),'value':_0x3123b2[_0x2154('0x24')]},{'key':_0x2154('0x25'),'value':_0x2154('0x26')},{'key':_0x2154('0x27'),'value':encodeURIComponent(_0x58d16a)},{'key':'state','value':_0x20a04b},{'key':_0x2154('0x28'),'value':_0x141ba0},{'key':_0x2154('0x29'),'value':_0x2154('0x2a')}];var _0xf367b5=_0x3eea36+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x3dee0a,function(_0x5ba770){return _0x5ba770[_0x2154('0x2b')]+'='+_0x5ba770[_0x2154('0x2c')];})['join']('&');_0x3123b2[_0x2154('0x2d')]={'issuer':_0x3eea36['replace'](_0x2154('0x2e'),''),'audience':_0x3123b2[_0x2154('0x21')],'state':_0x20a04b,'nonce':_0x141ba0};redis['set'](_0x20a04b,JSON[_0x2154('0x1d')](_0x3123b2));return _0xf367b5;}function isValidIdToken(_0x3eae87,_0x356500){try{var _0x2c5f5b=jwt[_0x2154('0x2f')](_0x3eae87,{'complete':!![]});var _0x451a72=_0x2c5f5b[_0x2154('0x30')];if(_0x451a72[_0x2154('0x31')]!==_0x356500[_0x2154('0x32')])return![];if(_0x451a72[_0x2154('0x33')]!==_0x356500['audience'])return![];if(_0x451a72[_0x2154('0x28')]!==_0x356500['nonce'])return![];if(moment()[_0x2154('0x34')](moment[_0x2154('0x35')](_0x451a72['exp'])))return![];return!![];}catch(_0x32b66a){throw _0x32b66a;}}function refreshOauth2MicrosoftAccessToken(_0x213f24){return Promise['resolve']()[_0x2154('0x36')](function(){if(_0x213f24[_0x2154('0x37')])return _0x213f24;return db['CloudProvider'][_0x2154('0x38')]({'where':{'id':_0x213f24['id']},'raw':!![]});})['then'](function(_0x2c8d37){var _0x17e4bd={'grant_type':_0x2154('0x39'),'refresh_token':_0x2c8d37[_0x2154('0x3a')],'scope':getAccessTokenScope(_0x2c8d37),'redirect_uri':_0x2c8d37[_0x2154('0x24')],'client_id':_0x2c8d37[_0x2154('0x21')],'client_secret':encryptor[_0x2154('0x3b')](_0x2c8d37[_0x2154('0x37')])};var _0x358cb5={'method':_0x2154('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0x2154('0x3d'),_0x2c8d37[_0x2154('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x17e4bd,'json':!![]};return rp(_0x358cb5);})[_0x2154('0x36')](function(_0x7ecb24){_0x213f24[_0x2154('0x3e')]=_0x7ecb24[_0x2154('0x3f')];_0x213f24['data6']=_0x7ecb24[_0x2154('0x39')];return db['CloudProvider'][_0x2154('0x40')]({'data5':_0x213f24['data5'],'data6':_0x213f24[_0x2154('0x3a')]},{'where':{'id':_0x213f24['id']}});})[_0x2154('0x36')](function(){return _0x213f24;})[_0x2154('0x41')](function(_0x446cdc){logger['error'](_0x2154('0x42'),_0x213f24['id'],_0x446cdc);});}function getOauth2MicrosoftAccessToken(_0x422bd8,_0x4ae370){var _0x227c26={'grant_type':'authorization_code','code':_0x422bd8,'scope':getAccessTokenScope(_0x4ae370),'redirect_uri':_0x4ae370[_0x2154('0x24')],'client_id':_0x4ae370[_0x2154('0x21')],'client_secret':encryptor['decryptString'](_0x4ae370['data3'])};var _0x1a9a7d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x2154('0x43')](_0x2154('0x3d'),_0x4ae370[_0x2154('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x227c26,'json':!![]};return rp(_0x1a9a7d);}function startRefreshInterval(_0x188c45){var _0x21a661=schedule[_0x2154('0x44')];if(_0x21a661[_0x188c45['id']])clearInterval(_0x21a661[_0x188c45['id']]);_0x21a661[_0x188c45['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2154('0x45')](this,{'id':_0x188c45['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x21a661;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2154('0x36')](function(_0x198bb1){var _0x2f8ee1=_0x198bb1[_0x2154('0x46')](function(_0x28bf8b){return refreshOauth2MicrosoftAccessToken(_0x28bf8b)['then'](function(_0x4439cb){startRefreshInterval(_0x4439cb);});});return Promise[_0x2154('0x47')](_0x2f8ee1);})[_0x2154('0x41')](function(_0x21f5a4){var _0x1b943e=_0x21f5a4?util[_0x2154('0x48')](_0x21f5a4,{'showHidden':![],'depth':null}):'';logger[_0x2154('0x49')](_0x2154('0x4a'),_0x1b943e);});}module[_0x2154('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x57ba=['toString','randomBytes','client_id','data1','response_type','response_mode','state','nonce','prompt','login','map','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','util','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','stringify'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x57ba,0x78));var _0xa57b=function(_0x1fd426,_0x29e4d4){_0x1fd426=_0x1fd426-0x0;var _0x3c28f3=_0x57ba[_0x1fd426];return _0x3c28f3;};'use strict';var _=require('lodash');var crypto=require(_0xa57b('0x0'));var jwt=require(_0xa57b('0x1'));var moment=require(_0xa57b('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xa57b('0x3'));var encryptor=require(_0xa57b('0x4'));var config=require(_0xa57b('0x5'));var logger=require('../../config/logger')(_0xa57b('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xa57b('0x7'))['db'];config[_0xa57b('0x8')]=_[_0xa57b('0x9')](config[_0xa57b('0x8')],{'host':_0xa57b('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xa57b('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa57b('0xc'),'profile',_0xa57b('0xd'),_0xa57b('0xe'),_0xa57b('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0xa57b('0x10')],'Dynamics365':[_0xa57b('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xa57b('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xa57b('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x489d05){var _0x339ba5=_['map'](AZURE_AUTH_SCOPES[_0x489d05[_0xa57b('0x13')]]);if(_0x489d05[_0xa57b('0x13')]===_0xa57b('0x14'))_0x339ba5[_0xa57b('0x15')](_0x489d05[_0xa57b('0x16')]+_0xa57b('0x17'));return _0x339ba5[_0xa57b('0x18')]('\x20');}function getAccessTokenScope(_0x4cad46){if(_0x4cad46[_0xa57b('0x13')]===_0xa57b('0x19'))return _0xa57b('0xf');if(_0x4cad46[_0xa57b('0x13')]===_0xa57b('0x14'))return _0x4cad46[_0xa57b('0x16')]+_0xa57b('0x17');}function generateMicrosoftAuthorizationUrl(_0x1a82a3,_0x217e34){var _0x3448a0=MICROSOFT_AUTH_URL[_0xa57b('0x1a')](_0xa57b('0x1b'),_0x1a82a3[_0xa57b('0x1c')]);var _0x3d03f2=[_0xa57b('0x1d'),_0xa57b('0x1e')];var _0xcb2108=Buffer['from'](JSON[_0xa57b('0x1f')]({'id':_0x217e34}))[_0xa57b('0x20')]('base64');var _0x230b1e=crypto[_0xa57b('0x21')](0x10)[_0xa57b('0x20')]('hex');var _0x294ca9=getAuthorizationScopes(_0x1a82a3);var _0x55f62=[{'key':_0xa57b('0x22'),'value':_0x1a82a3[_0xa57b('0x23')]},{'key':_0xa57b('0x24'),'value':encodeURIComponent(_0x3d03f2['join']('\x20'))},{'key':'redirect_uri','value':_0x1a82a3['data4']},{'key':_0xa57b('0x25'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x294ca9)},{'key':_0xa57b('0x26'),'value':_0xcb2108},{'key':_0xa57b('0x27'),'value':_0x230b1e},{'key':_0xa57b('0x28'),'value':_0xa57b('0x29')}];var _0x3baf55=_0x3448a0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa57b('0x2a')](_0x55f62,function(_0x5af1f7){return _0x5af1f7[_0xa57b('0x2b')]+'='+_0x5af1f7[_0xa57b('0x2c')];})[_0xa57b('0x18')]('&');_0x1a82a3[_0xa57b('0x2d')]={'issuer':_0x3448a0[_0xa57b('0x1a')](_0xa57b('0x2e'),''),'audience':_0x1a82a3[_0xa57b('0x23')],'state':_0xcb2108,'nonce':_0x230b1e};redis[_0xa57b('0x2f')](_0xcb2108,JSON[_0xa57b('0x1f')](_0x1a82a3));return _0x3baf55;}function isValidIdToken(_0x74014,_0x364eeb){try{var _0x17fd29=jwt[_0xa57b('0x30')](_0x74014,{'complete':!![]});var _0x126ce0=_0x17fd29[_0xa57b('0x31')];if(_0x126ce0[_0xa57b('0x32')]!==_0x364eeb['issuer'])return![];if(_0x126ce0[_0xa57b('0x33')]!==_0x364eeb[_0xa57b('0x34')])return![];if(_0x126ce0['nonce']!==_0x364eeb[_0xa57b('0x27')])return![];if(moment()[_0xa57b('0x35')](moment[_0xa57b('0x36')](_0x126ce0[_0xa57b('0x37')])))return![];return!![];}catch(_0x323614){throw _0x323614;}}function refreshOauth2MicrosoftAccessToken(_0x4f9bad){return Promise[_0xa57b('0x38')]()[_0xa57b('0x39')](function(){if(_0x4f9bad[_0xa57b('0x3a')])return _0x4f9bad;return db[_0xa57b('0x3b')][_0xa57b('0x3c')]({'where':{'id':_0x4f9bad['id']},'raw':!![]});})[_0xa57b('0x39')](function(_0x55c99e){var _0x11f250={'grant_type':_0xa57b('0x3d'),'refresh_token':_0x55c99e[_0xa57b('0x3e')],'scope':getAccessTokenScope(_0x55c99e),'redirect_uri':_0x55c99e[_0xa57b('0x3f')],'client_id':_0x55c99e[_0xa57b('0x23')],'client_secret':encryptor[_0xa57b('0x40')](_0x55c99e['data3'])};var _0x288074={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa57b('0x1a')](_0xa57b('0x1b'),_0x55c99e[_0xa57b('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11f250,'json':!![]};return rp(_0x288074);})['then'](function(_0x44a31e){_0x4f9bad[_0xa57b('0x41')]=_0x44a31e[_0xa57b('0x42')];_0x4f9bad[_0xa57b('0x3e')]=_0x44a31e['refresh_token'];return db['CloudProvider']['update']({'data5':_0x4f9bad[_0xa57b('0x41')],'data6':_0x4f9bad['data6']},{'where':{'id':_0x4f9bad['id']}});})[_0xa57b('0x39')](function(){return _0x4f9bad;})[_0xa57b('0x43')](function(_0xae90d6){logger[_0xa57b('0x44')](_0xa57b('0x45'),_0x4f9bad['id'],_0xae90d6);});}function getOauth2MicrosoftAccessToken(_0xdf18de,_0x17117f){var _0x340d45={'grant_type':_0xa57b('0x46'),'code':_0xdf18de,'scope':getAccessTokenScope(_0x17117f),'redirect_uri':_0x17117f[_0xa57b('0x3f')],'client_id':_0x17117f[_0xa57b('0x23')],'client_secret':encryptor[_0xa57b('0x40')](_0x17117f[_0xa57b('0x3a')])};var _0x49ced2={'method':_0xa57b('0x47'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa57b('0x1b'),_0x17117f[_0xa57b('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x340d45,'json':!![]};return rp(_0x49ced2);}function startRefreshInterval(_0x38da90){var _0x4088a9=schedule[_0xa57b('0x48')];if(_0x4088a9[_0x38da90['id']])clearInterval(_0x4088a9[_0x38da90['id']]);_0x4088a9[_0x38da90['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa57b('0x49')](this,{'id':_0x38da90['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4088a9;}function startAllRefreshIntervals(){return db[_0xa57b('0x3b')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa57b('0x39')](function(_0x1d7946){var _0x2dfb61=_0x1d7946[_0xa57b('0x2a')](function(_0x5d3d12){return refreshOauth2MicrosoftAccessToken(_0x5d3d12)[_0xa57b('0x39')](function(_0x306724){startRefreshInterval(_0x306724);});});return Promise['all'](_0x2dfb61);})[_0xa57b('0x43')](function(_0x182693){var _0x10eb8c=_0x182693?util['inspect'](_0x182693,{'showHidden':![],'depth':null}):'';logger[_0xa57b('0x44')](_0xa57b('0x4a'),_0x10eb8c);});}module[_0xa57b('0x4b')]={'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 5398f82..3e19cf3 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 _0xe056=['code','message','info','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x428d9a,_0x4e724d){var _0x50da90=function(_0x283946){while(--_0x283946){_0x428d9a['push'](_0x428d9a['shift']());}};_0x50da90(++_0x4e724d);}(_0xe056,0xdb));var _0x6e05=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xe056[_0x555069];return _0x100af7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e05('0x0'));var BPromise=require(_0x6e05('0x1'));var rs=require(_0x6e05('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e05('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e05('0x4'))(_0x6e05('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e05('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x390bb6,_0x1c78eb,_0x5dacb2){return new BPromise(function(_0x1a54b7,_0x177b2c){return client[_0x6e05('0x7')](_0x390bb6,_0x5dacb2)[_0x6e05('0x8')](function(_0x13af56){logger['info'](_0x6e05('0x9'),_0x1c78eb,_0x6e05('0xa'));logger[_0x6e05('0xb')](_0x6e05('0xc'),_0x1c78eb,_0x6e05('0xa'),JSON[_0x6e05('0xd')](_0x13af56));if(_0x13af56['error']){if(_0x13af56[_0x6e05('0xe')][_0x6e05('0xf')]===0x1f4){logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);return _0x177b2c(_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);}logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);return _0x1a54b7(_0x13af56['error']['message']);}else{logger[_0x6e05('0x11')](_0x6e05('0x9'),_0x1c78eb,_0x6e05('0xa'));_0x1a54b7(_0x13af56['result'][_0x6e05('0x10')]);}})['catch'](function(_0x3c3ef0){logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x3c3ef0);_0x177b2c(_0x3c3ef0);});});} \ No newline at end of file +var _0xcf37=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x405386,_0xa08f54){var _0x131729=function(_0x2fd943){while(--_0x2fd943){_0x405386['push'](_0x405386['shift']());}};_0x131729(++_0xa08f54);}(_0xcf37,0xdc));var _0x7cf3=function(_0x559b6b,_0x593cab){_0x559b6b=_0x559b6b-0x0;var _0x3d18f1=_0xcf37[_0x559b6b];return _0x3d18f1;};'use strict';var _=require('lodash');var util=require(_0x7cf3('0x0'));var moment=require(_0x7cf3('0x1'));var BPromise=require(_0x7cf3('0x2'));var rs=require(_0x7cf3('0x3'));var fs=require('fs');var Redis=require(_0x7cf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cf3('0x5'));var logger=require(_0x7cf3('0x6'))(_0x7cf3('0x7'));var config=require(_0x7cf3('0x8'));var jayson=require(_0x7cf3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd617,_0x5be340,_0x78b9a4){return new BPromise(function(_0x53502d,_0x110c99){return client['request'](_0x4fd617,_0x78b9a4)[_0x7cf3('0xa')](function(_0x377577){logger[_0x7cf3('0xb')](_0x7cf3('0xc'),_0x5be340,_0x7cf3('0xd'));logger[_0x7cf3('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5be340,_0x7cf3('0xd'),JSON[_0x7cf3('0xf')](_0x377577));if(_0x377577[_0x7cf3('0x10')]){if(_0x377577[_0x7cf3('0x10')][_0x7cf3('0x11')]===0x1f4){logger['error'](_0x7cf3('0xc'),_0x5be340,_0x377577['error'][_0x7cf3('0x12')]);return _0x110c99(_0x377577['error'][_0x7cf3('0x12')]);}logger[_0x7cf3('0x10')]('CloudProvider,\x20%s,\x20%s',_0x5be340,_0x377577[_0x7cf3('0x10')][_0x7cf3('0x12')]);return _0x53502d(_0x377577[_0x7cf3('0x10')][_0x7cf3('0x12')]);}else{logger['info'](_0x7cf3('0xc'),_0x5be340,'request\x20sent');_0x53502d(_0x377577[_0x7cf3('0x13')][_0x7cf3('0x12')]);}})[_0x7cf3('0x14')](function(_0x14aef6){logger[_0x7cf3('0x10')](_0x7cf3('0xc'),_0x5be340,_0x14aef6);_0x110c99(_0x14aef6);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index deb08f4..36fd89c 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x1261,0x144));var _0x1126=function(_0x2703cf,_0x526b31){_0x2703cf=_0x2703cf-0x0;var _0x28f18a=_0x1261[_0x2703cf];return _0x28f18a;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x1261,0x144));var _0x1126=function(_0x335db2,_0x3e70f6){_0x335db2=_0x335db2-0x0;var _0x410499=_0x1261[_0x335db2];return _0x410499;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 3d5c217..884f7d1 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 _0x7b51=['name','sequelize','exports','STRING'];(function(_0x59c556,_0x3e3be8){var _0x53079b=function(_0x1e1fd3){while(--_0x1e1fd3){_0x59c556['push'](_0x59c556['shift']());}};_0x53079b(++_0x3e3be8);}(_0x7b51,0x1bd));var _0x17b5=function(_0x345e4c,_0x3e73ba){_0x345e4c=_0x345e4c-0x0;var _0x40c41c=_0x7b51[_0x345e4c];return _0x40c41c;};'use strict';var Sequelize=require(_0x17b5('0x0'));module[_0x17b5('0x1')]={'name':{'type':Sequelize[_0x17b5('0x2')],'unique':_0x17b5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x17b5('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x17b5('0x2')]},'fax':{'type':Sequelize[_0x17b5('0x2')]},'type':{'type':Sequelize[_0x17b5('0x2')]},'street':{'type':Sequelize[_0x17b5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x17b5('0x2')]},'country':{'type':Sequelize[_0x17b5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5bb7=['STRING','name','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5bb7,0xc2));var _0x75bb=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x5bb7[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require(_0x75bb('0x0'));module[_0x75bb('0x1')]={'name':{'type':Sequelize[_0x75bb('0x2')],'unique':_0x75bb('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x75bb('0x2')]},'companyId':{'type':Sequelize[_0x75bb('0x2')]},'website':{'type':Sequelize[_0x75bb('0x2')]},'phone':{'type':Sequelize[_0x75bb('0x2')]},'fax':{'type':Sequelize[_0x75bb('0x2')]},'type':{'type':Sequelize[_0x75bb('0x2')]},'street':{'type':Sequelize[_0x75bb('0x2')]},'postalCode':{'type':Sequelize[_0x75bb('0x2')]},'city':{'type':Sequelize[_0x75bb('0x2')]},'country':{'type':Sequelize[_0x75bb('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x75bb('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x75bb('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x75bb('0x2')]},'description':{'type':Sequelize[_0x75bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 0391fd1..7297442 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 _0xb6f5=['options','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','create','user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','ids','findOne','length','pick','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','order','sort','where','filter','merge','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f5,0x12b));var _0x5b6f=function(_0x591d44,_0x2b43a3){_0x591d44=_0x591d44-0x0;var _0x41dd26=_0xb6f5[_0x591d44];return _0x41dd26;};'use strict';var emlformat=require(_0x5b6f('0x0'));var rimraf=require(_0x5b6f('0x1'));var zipdir=require(_0x5b6f('0x2'));var jsonpatch=require(_0x5b6f('0x3'));var rp=require('request-promise');var moment=require(_0x5b6f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b6f('0x5'));var util=require(_0x5b6f('0x6'));var path=require(_0x5b6f('0x7'));var sox=require(_0x5b6f('0x8'));var csv=require(_0x5b6f('0x9'));var ejs=require(_0x5b6f('0xa'));var fs=require('fs');var fs_extra=require(_0x5b6f('0xb'));var _=require(_0x5b6f('0xc'));var squel=require(_0x5b6f('0xd'));var crypto=require(_0x5b6f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5b6f('0xf'));var toCsv=require(_0x5b6f('0x9'));var querystring=require(_0x5b6f('0x10'));var Papa=require(_0x5b6f('0x11'));var Redis=require(_0x5b6f('0x12'));var authService=require(_0x5b6f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5b6f('0x14'));var hardwareService=require(_0x5b6f('0x15'));var logger=require(_0x5b6f('0x16'))('api');var utils=require(_0x5b6f('0x17'));var config=require(_0x5b6f('0x18'));var licenseUtil=require(_0x5b6f('0x19'));var db=require(_0x5b6f('0x1a'))['db'];function respondWithStatusCode(_0x40e793,_0x3c5416){_0x3c5416=_0x3c5416||0xcc;return function(_0x5656a8){if(_0x5656a8){return _0x40e793[_0x5b6f('0x1b')](_0x3c5416);}return _0x40e793[_0x5b6f('0x1c')](_0x3c5416)[_0x5b6f('0x1d')]();};}function respondWithResult(_0xad2576,_0x11dc90){_0x11dc90=_0x11dc90||0xc8;return function(_0x48ef5d){if(_0x48ef5d){return _0xad2576[_0x5b6f('0x1c')](_0x11dc90)[_0x5b6f('0x1e')](_0x48ef5d);}};}function respondWithFilteredResult(_0x15727f,_0x3bb22e){return function(_0x37a666){if(_0x37a666){var _0x32a91a=typeof _0x3bb22e['offset']==='undefined'&&typeof _0x3bb22e['limit']==='undefined';var _0x10753c=_0x37a666[_0x5b6f('0x1f')];var _0x2d47db=_0x32a91a?0x0:_0x3bb22e[_0x5b6f('0x20')];var _0x56fb33=_0x32a91a?_0x37a666[_0x5b6f('0x1f')]:_0x3bb22e['offset']+_0x3bb22e[_0x5b6f('0x21')];var _0x1ccd32;if(_0x56fb33>=_0x10753c){_0x56fb33=_0x10753c;_0x1ccd32=0xc8;}else{_0x1ccd32=0xce;}_0x15727f['status'](_0x1ccd32);return _0x15727f[_0x5b6f('0x22')]('Content-Range',_0x2d47db+'-'+_0x56fb33+'/'+_0x10753c)[_0x5b6f('0x1e')](_0x37a666);}return null;};}function patchUpdates(_0x3bedb4){return function(_0x5b6a38){try{jsonpatch[_0x5b6f('0x23')](_0x5b6a38,_0x3bedb4,!![]);}catch(_0x1b35f4){return BPromise[_0x5b6f('0x24')](_0x1b35f4);}return _0x5b6a38[_0x5b6f('0x25')]();};}function saveUpdates(_0x321a46,_0x3bc5d3){return function(_0xfc45a9){if(_0xfc45a9){return _0xfc45a9['update'](_0x321a46)[_0x5b6f('0x26')](function(_0x3b7cac){return _0x3b7cac;});}return null;};}function removeEntity(_0x1815d6,_0x2cc439){return function(_0x1ab1ff){if(_0x1ab1ff){return _0x1ab1ff[_0x5b6f('0x27')]()[_0x5b6f('0x26')](function(){var _0x3dc244=_0x1ab1ff[_0x5b6f('0x28')]({'plain':!![]});var _0x56d0cf='Companies';return db[_0x5b6f('0x29')][_0x5b6f('0x27')]({'where':{'type':_0x56d0cf,'resourceId':_0x3dc244['id']}})[_0x5b6f('0x26')](function(){return _0x1ab1ff;});})[_0x5b6f('0x26')](function(){_0x1815d6[_0x5b6f('0x1c')](0xcc)[_0x5b6f('0x1d')]();});}};}function handleEntityNotFound(_0x2f85f8,_0x185f2a){return function(_0x1da9a3){if(!_0x1da9a3){_0x2f85f8[_0x5b6f('0x1b')](0x194);}return _0x1da9a3;};}function handleError(_0x586aae,_0x5321d5){_0x5321d5=_0x5321d5||0x1f4;return function(_0x8a07bb){logger[_0x5b6f('0x2a')](_0x8a07bb[_0x5b6f('0x2b')]);if(_0x8a07bb[_0x5b6f('0x2c')]){delete _0x8a07bb[_0x5b6f('0x2c')];}_0x586aae[_0x5b6f('0x1c')](_0x5321d5)[_0x5b6f('0x2d')](_0x8a07bb);};}exports[_0x5b6f('0x2e')]=function(_0x37b9b4,_0x2c6829){var _0x164452={},_0xeb6bfd={},_0x36b213={'count':0x0,'rows':[]};return db[_0x5b6f('0x2f')][_0x5b6f('0x30')]()['then'](function(_0x5be31e){_0xeb6bfd[_0x5b6f('0x31')]=_[_0x5b6f('0x32')](_0x5be31e);_0xeb6bfd['query']=_['keys'](_0x37b9b4[_0x5b6f('0x33')]);_0xeb6bfd[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0xeb6bfd[_0x5b6f('0x31')],_0xeb6bfd['query']);_0x164452['attributes']=_[_0x5b6f('0x35')](_0xeb6bfd[_0x5b6f('0x31')],qs['fields'](_0x37b9b4[_0x5b6f('0x33')]['fields']));_0x164452[_0x5b6f('0x36')]=_0x164452[_0x5b6f('0x36')]['length']?_0x164452[_0x5b6f('0x36')]:_0xeb6bfd['model'];if(!_0x37b9b4[_0x5b6f('0x33')]['hasOwnProperty']('nolimit')){_0x164452[_0x5b6f('0x21')]=qs[_0x5b6f('0x21')](_0x37b9b4['query'][_0x5b6f('0x21')]);_0x164452[_0x5b6f('0x20')]=qs[_0x5b6f('0x20')](_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x20')]);}_0x164452[_0x5b6f('0x37')]=qs[_0x5b6f('0x38')](_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x38')]);_0x164452[_0x5b6f('0x39')]=qs[_0x5b6f('0x34')](_['pick'](_0x37b9b4[_0x5b6f('0x33')],_0xeb6bfd[_0x5b6f('0x34')]),_0x5be31e);if(_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x3a')]){_0x164452['where']=_[_0x5b6f('0x3b')](_0x164452['where'],{'$or':_[_0x5b6f('0x3c')](_0x164452['attributes'],function(_0x5ce9b1){var _0x4ae3b4={};_0x4ae3b4[_0x5ce9b1]={'$like':'%'+_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x3a')]+'%'};return _0x4ae3b4;})});}_0x164452=_[_0x5b6f('0x3b')]({},_0x164452,_0x37b9b4[_0x5b6f('0x3d')]);var _0x501ddf={'where':_0x164452[_0x5b6f('0x39')]};return db['CmCompany'][_0x5b6f('0x1f')](_0x501ddf)[_0x5b6f('0x26')](function(_0x5863af){_0x36b213[_0x5b6f('0x1f')]=_0x5863af;if(_0x37b9b4[_0x5b6f('0x33')]['includeAll']){_0x164452[_0x5b6f('0x3e')]=[{'all':!![]}];}return db[_0x5b6f('0x2f')][_0x5b6f('0x3f')](_0x164452);})[_0x5b6f('0x26')](function(_0x3886e6){_0x36b213[_0x5b6f('0x40')]=_0x3886e6;return _0x36b213;})[_0x5b6f('0x26')](respondWithFilteredResult(_0x2c6829,_0x164452))[_0x5b6f('0x41')](handleError(_0x2c6829,null));})[_0x5b6f('0x41')](handleError(_0x2c6829,null));};exports[_0x5b6f('0x42')]=function(_0x32b610,_0x375257){var _0x20f284={'raw':![],'where':{'id':_0x32b610['params']['id']}},_0xa83134={};_0xa83134['model']=_[_0x5b6f('0x32')](db[_0x5b6f('0x2f')][_0x5b6f('0x43')]);_0xa83134[_0x5b6f('0x33')]=_['keys'](_0x32b610[_0x5b6f('0x33')]);_0xa83134[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0xa83134[_0x5b6f('0x31')],_0xa83134[_0x5b6f('0x33')]);_0x20f284['attributes']=_[_0x5b6f('0x35')](_0xa83134[_0x5b6f('0x31')],qs['fields'](_0x32b610[_0x5b6f('0x33')][_0x5b6f('0x44')]));_0x20f284[_0x5b6f('0x36')]=_0x20f284['attributes']['length']?_0x20f284[_0x5b6f('0x36')]:_0xa83134[_0x5b6f('0x31')];if(_0x32b610[_0x5b6f('0x33')][_0x5b6f('0x45')]){_0x20f284['include']=[{'all':!![]}];}_0x20f284=_[_0x5b6f('0x3b')]({},_0x20f284,_0x32b610[_0x5b6f('0x3d')]);return db[_0x5b6f('0x2f')][_0x5b6f('0x46')](_0x20f284)[_0x5b6f('0x26')](handleEntityNotFound(_0x375257,null))[_0x5b6f('0x26')](respondWithResult(_0x375257,null))[_0x5b6f('0x41')](handleError(_0x375257,null));};exports[_0x5b6f('0x47')]=function(_0x11b256,_0x154419){return db[_0x5b6f('0x2f')]['create'](_0x11b256['body'],{})[_0x5b6f('0x26')](function(_0x3c097c){var _0x3c7f45=_0x11b256[_0x5b6f('0x48')][_0x5b6f('0x28')]({'plain':!![]});if(!_0x3c7f45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c7f45[_0x5b6f('0x49')]===_0x5b6f('0x48')){var _0x57a04e=_0x3c097c[_0x5b6f('0x28')]({'plain':!![]});var _0x2f178c=_0x5b6f('0x4a');return db[_0x5b6f('0x4b')][_0x5b6f('0x46')]({'where':{'name':_0x2f178c,'userProfileId':_0x3c7f45[_0x5b6f('0x4c')]},'raw':!![]})[_0x5b6f('0x26')](function(_0x3faadc){if(_0x3faadc&&_0x3faadc[_0x5b6f('0x4d')]===0x0){return db[_0x5b6f('0x29')][_0x5b6f('0x47')]({'name':_0x57a04e['name'],'resourceId':_0x57a04e['id'],'type':_0x3faadc[_0x5b6f('0x2c')],'sectionId':_0x3faadc['id']},{})[_0x5b6f('0x26')](function(){return _0x3c097c;});}else{return _0x3c097c;}})[_0x5b6f('0x41')](function(_0x1708ec){logger[_0x5b6f('0x2a')](_0x5b6f('0x4e'),_0x1708ec);throw _0x1708ec;});}return _0x3c097c;})['then'](respondWithResult(_0x154419,0xc9))[_0x5b6f('0x41')](handleError(_0x154419,null));};exports['update']=function(_0x5f9a99,_0x2fa6ff){if(_0x5f9a99[_0x5b6f('0x4f')]['id']){delete _0x5f9a99['body']['id'];}return db[_0x5b6f('0x2f')][_0x5b6f('0x46')]({'where':{'id':_0x5f9a99['params']['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x2fa6ff,null))[_0x5b6f('0x26')](saveUpdates(_0x5f9a99[_0x5b6f('0x4f')],null))[_0x5b6f('0x26')](respondWithResult(_0x2fa6ff,null))['catch'](handleError(_0x2fa6ff,null));};exports[_0x5b6f('0x27')]=function(_0x5a4675,_0x1cbc74){return db[_0x5b6f('0x2f')][_0x5b6f('0x46')]({'where':{'id':_0x5a4675[_0x5b6f('0x50')]['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x1cbc74,null))[_0x5b6f('0x26')](removeEntity(_0x1cbc74,null))[_0x5b6f('0x41')](handleError(_0x1cbc74,null));};exports['describe']=function(_0x2db212,_0x2f3169){return db['CmCompany'][_0x5b6f('0x30')]()['then'](respondWithResult(_0x2f3169,null))[_0x5b6f('0x41')](handleError(_0x2f3169,null));};exports[_0x5b6f('0x51')]=function(_0x51fce3,_0x18305c,_0x40a330){return db[_0x5b6f('0x52')]['find']({'where':{'id':_0x51fce3[_0x5b6f('0x50')]['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x18305c,null))[_0x5b6f('0x26')](function(_0x38676a){if(_0x38676a){return _0x38676a['addContacts'](_0x51fce3[_0x5b6f('0x4f')]['ids'],_[_0x5b6f('0x53')](_0x51fce3[_0x5b6f('0x4f')],[_0x5b6f('0x54'),'id'])||{});}})[_0x5b6f('0x26')](respondWithResult(_0x18305c,null))['catch'](handleError(_0x18305c,null));};exports['getContacts']=function(_0x2c78f4,_0x3995d3,_0x5ee756){var _0x203d4f={};var _0x29ce74={};var _0x11f0ab;var _0x53c24e;return db['CmCompany'][_0x5b6f('0x55')]({'where':{'id':_0x2c78f4[_0x5b6f('0x50')]['id']}})['then'](handleEntityNotFound(_0x3995d3,null))[_0x5b6f('0x26')](function(_0x1eb29f){if(_0x1eb29f){_0x11f0ab=_0x1eb29f;_0x29ce74[_0x5b6f('0x31')]=_[_0x5b6f('0x32')](db[_0x5b6f('0x52')][_0x5b6f('0x43')]);_0x29ce74[_0x5b6f('0x33')]=_[_0x5b6f('0x32')](_0x2c78f4[_0x5b6f('0x33')]);_0x29ce74[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0x29ce74[_0x5b6f('0x31')],_0x29ce74['query']);_0x203d4f['attributes']=_[_0x5b6f('0x35')](_0x29ce74['model'],qs['fields'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x44')]));_0x203d4f['attributes']=_0x203d4f[_0x5b6f('0x36')][_0x5b6f('0x56')]?_0x203d4f[_0x5b6f('0x36')]:_0x29ce74[_0x5b6f('0x31')];_0x203d4f['order']=qs['sort'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x38')]);_0x203d4f['where']=qs[_0x5b6f('0x34')](_[_0x5b6f('0x57')](_0x2c78f4['query'],_0x29ce74[_0x5b6f('0x34')]));if(_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x3a')]){_0x203d4f[_0x5b6f('0x39')]=_[_0x5b6f('0x3b')](_0x203d4f[_0x5b6f('0x39')],{'$or':_[_0x5b6f('0x3c')](_0x203d4f[_0x5b6f('0x36')],function(_0x34ecd6){var _0x30a6c4={};_0x30a6c4[_0x34ecd6]={'$like':'%'+_0x2c78f4[_0x5b6f('0x33')]['filter']+'%'};return _0x30a6c4;})});}_0x203d4f=_[_0x5b6f('0x3b')]({},_0x203d4f,_0x2c78f4['options']);return _0x11f0ab[_0x5b6f('0x58')](_0x203d4f);}})[_0x5b6f('0x26')](function(_0x1dc34a){if(_0x1dc34a){_0x53c24e=_0x1dc34a[_0x5b6f('0x56')];if(!_0x2c78f4['query']['hasOwnProperty'](_0x5b6f('0x59'))){_0x203d4f[_0x5b6f('0x21')]=qs[_0x5b6f('0x21')](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x21')]);_0x203d4f[_0x5b6f('0x20')]=qs['offset'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x20')]);}return _0x11f0ab[_0x5b6f('0x58')](_0x203d4f);}})[_0x5b6f('0x26')](function(_0x1d255d){if(_0x1d255d){return _0x1d255d?{'count':_0x53c24e,'rows':_0x1d255d}:null;}})['then'](respondWithResult(_0x3995d3,null))[_0x5b6f('0x41')](handleError(_0x3995d3,null));}; \ No newline at end of file +var _0xce80=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','params','rawAttributes','include','CmCompany','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3aa7ba,_0x13d3b5){var _0x265021=function(_0x36b1a4){while(--_0x36b1a4){_0x3aa7ba['push'](_0x3aa7ba['shift']());}};_0x265021(++_0x13d3b5);}(_0xce80,0x100));var _0x0ce8=function(_0xa173f5,_0x2a9ec1){_0xa173f5=_0xa173f5-0x0;var _0x47292e=_0xce80[_0xa173f5];return _0x47292e;};'use strict';var emlformat=require(_0x0ce8('0x0'));var rimraf=require(_0x0ce8('0x1'));var zipdir=require(_0x0ce8('0x2'));var jsonpatch=require(_0x0ce8('0x3'));var rp=require(_0x0ce8('0x4'));var moment=require(_0x0ce8('0x5'));var BPromise=require(_0x0ce8('0x6'));var Mustache=require(_0x0ce8('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0ce8('0x8'));var csv=require(_0x0ce8('0x9'));var ejs=require(_0x0ce8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ce8('0xb'));var squel=require(_0x0ce8('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ce8('0xd'));var deskjs=require(_0x0ce8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ce8('0xf'));var Papa=require(_0x0ce8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ce8('0x11'));var hardwareService=require(_0x0ce8('0x12'));var logger=require(_0x0ce8('0x13'))(_0x0ce8('0x14'));var utils=require('../../config/utils');var config=require(_0x0ce8('0x15'));var licenseUtil=require(_0x0ce8('0x16'));var db=require(_0x0ce8('0x17'))['db'];function respondWithStatusCode(_0x302f60,_0x301dc6){_0x301dc6=_0x301dc6||0xcc;return function(_0x1346cb){if(_0x1346cb){return _0x302f60[_0x0ce8('0x18')](_0x301dc6);}return _0x302f60[_0x0ce8('0x19')](_0x301dc6)[_0x0ce8('0x1a')]();};}function respondWithResult(_0xd1edba,_0x2231ce){_0x2231ce=_0x2231ce||0xc8;return function(_0x5730d5){if(_0x5730d5){return _0xd1edba[_0x0ce8('0x19')](_0x2231ce)['json'](_0x5730d5);}};}function respondWithFilteredResult(_0x45219c,_0x498a56){return function(_0x59632f){if(_0x59632f){var _0x116043=typeof _0x498a56[_0x0ce8('0x1b')]===_0x0ce8('0x1c')&&typeof _0x498a56[_0x0ce8('0x1d')]===_0x0ce8('0x1c');var _0x5dfd5b=_0x59632f[_0x0ce8('0x1e')];var _0x27e460=_0x116043?0x0:_0x498a56[_0x0ce8('0x1b')];var _0x3a9d86=_0x116043?_0x59632f['count']:_0x498a56[_0x0ce8('0x1b')]+_0x498a56['limit'];var _0x1899e4;if(_0x3a9d86>=_0x5dfd5b){_0x3a9d86=_0x5dfd5b;_0x1899e4=0xc8;}else{_0x1899e4=0xce;}_0x45219c[_0x0ce8('0x19')](_0x1899e4);return _0x45219c[_0x0ce8('0x1f')](_0x0ce8('0x20'),_0x27e460+'-'+_0x3a9d86+'/'+_0x5dfd5b)[_0x0ce8('0x21')](_0x59632f);}return null;};}function patchUpdates(_0x26fbfd){return function(_0x55d7ba){try{jsonpatch[_0x0ce8('0x22')](_0x55d7ba,_0x26fbfd,!![]);}catch(_0x8be483){return BPromise[_0x0ce8('0x23')](_0x8be483);}return _0x55d7ba[_0x0ce8('0x24')]();};}function saveUpdates(_0x2c47de,_0x17dcd1){return function(_0x3c28ea){if(_0x3c28ea){return _0x3c28ea['update'](_0x2c47de)[_0x0ce8('0x25')](function(_0x2dbbad){return _0x2dbbad;});}return null;};}function removeEntity(_0x4d8aa4,_0x9b14dd){return function(_0xa62cd8){if(_0xa62cd8){return _0xa62cd8[_0x0ce8('0x26')]()[_0x0ce8('0x25')](function(){var _0x2376e9=_0xa62cd8[_0x0ce8('0x27')]({'plain':!![]});var _0x426247=_0x0ce8('0x28');return db[_0x0ce8('0x29')][_0x0ce8('0x26')]({'where':{'type':_0x426247,'resourceId':_0x2376e9['id']}})[_0x0ce8('0x25')](function(){return _0xa62cd8;});})[_0x0ce8('0x25')](function(){_0x4d8aa4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a9c73,_0x483bb3){return function(_0x27bf05){if(!_0x27bf05){_0x3a9c73[_0x0ce8('0x18')](0x194);}return _0x27bf05;};}function handleError(_0x5bbced,_0x5a906d){_0x5a906d=_0x5a906d||0x1f4;return function(_0x29fa8b){logger[_0x0ce8('0x2a')](_0x29fa8b[_0x0ce8('0x2b')]);if(_0x29fa8b[_0x0ce8('0x2c')]){delete _0x29fa8b[_0x0ce8('0x2c')];}_0x5bbced[_0x0ce8('0x19')](_0x5a906d)[_0x0ce8('0x2d')](_0x29fa8b);};}exports[_0x0ce8('0x2e')]=function(_0x2a16e4,_0x4798f5){var _0x2bb608={},_0x15d3a3={},_0x1d960c={'count':0x0,'rows':[]};return db['CmCompany'][_0x0ce8('0x2f')]()['then'](function(_0x2363d5){_0x15d3a3[_0x0ce8('0x30')]=_[_0x0ce8('0x31')](_0x2363d5);_0x15d3a3[_0x0ce8('0x32')]=_['keys'](_0x2a16e4[_0x0ce8('0x32')]);_0x15d3a3[_0x0ce8('0x33')]=_[_0x0ce8('0x34')](_0x15d3a3[_0x0ce8('0x30')],_0x15d3a3[_0x0ce8('0x32')]);_0x2bb608[_0x0ce8('0x35')]=_[_0x0ce8('0x34')](_0x15d3a3['model'],qs[_0x0ce8('0x36')](_0x2a16e4[_0x0ce8('0x32')]['fields']));_0x2bb608['attributes']=_0x2bb608['attributes'][_0x0ce8('0x37')]?_0x2bb608[_0x0ce8('0x35')]:_0x15d3a3[_0x0ce8('0x30')];if(!_0x2a16e4[_0x0ce8('0x32')][_0x0ce8('0x38')](_0x0ce8('0x39'))){_0x2bb608[_0x0ce8('0x1d')]=qs['limit'](_0x2a16e4['query']['limit']);_0x2bb608[_0x0ce8('0x1b')]=qs[_0x0ce8('0x1b')](_0x2a16e4[_0x0ce8('0x32')][_0x0ce8('0x1b')]);}_0x2bb608[_0x0ce8('0x3a')]=qs[_0x0ce8('0x3b')](_0x2a16e4[_0x0ce8('0x32')][_0x0ce8('0x3b')]);_0x2bb608[_0x0ce8('0x3c')]=qs[_0x0ce8('0x33')](_[_0x0ce8('0x3d')](_0x2a16e4[_0x0ce8('0x32')],_0x15d3a3[_0x0ce8('0x33')]),_0x2363d5);if(_0x2a16e4['query'][_0x0ce8('0x3e')]){_0x2bb608[_0x0ce8('0x3c')]=_[_0x0ce8('0x3f')](_0x2bb608[_0x0ce8('0x3c')],{'$or':_[_0x0ce8('0x40')](_0x2bb608[_0x0ce8('0x35')],function(_0x408e2b){var _0x1b7ddd={};_0x1b7ddd[_0x408e2b]={'$like':'%'+_0x2a16e4[_0x0ce8('0x32')][_0x0ce8('0x3e')]+'%'};return _0x1b7ddd;})});}_0x2bb608=_[_0x0ce8('0x3f')]({},_0x2bb608,_0x2a16e4[_0x0ce8('0x41')]);var _0x569cca={'where':_0x2bb608[_0x0ce8('0x3c')]};return db['CmCompany'][_0x0ce8('0x1e')](_0x569cca)[_0x0ce8('0x25')](function(_0x5b56b0){_0x1d960c[_0x0ce8('0x1e')]=_0x5b56b0;if(_0x2a16e4[_0x0ce8('0x32')][_0x0ce8('0x42')]){_0x2bb608['include']=[{'all':!![]}];}return db['CmCompany'][_0x0ce8('0x43')](_0x2bb608);})[_0x0ce8('0x25')](function(_0x14b5a3){_0x1d960c[_0x0ce8('0x44')]=_0x14b5a3;return _0x1d960c;})['then'](respondWithFilteredResult(_0x4798f5,_0x2bb608))[_0x0ce8('0x45')](handleError(_0x4798f5,null));})[_0x0ce8('0x45')](handleError(_0x4798f5,null));};exports['show']=function(_0x43e846,_0x161e87){var _0x3086ae={'raw':![],'where':{'id':_0x43e846[_0x0ce8('0x46')]['id']}},_0x48c897={};_0x48c897['model']=_['keys'](db['CmCompany'][_0x0ce8('0x47')]);_0x48c897['query']=_[_0x0ce8('0x31')](_0x43e846[_0x0ce8('0x32')]);_0x48c897[_0x0ce8('0x33')]=_[_0x0ce8('0x34')](_0x48c897[_0x0ce8('0x30')],_0x48c897[_0x0ce8('0x32')]);_0x3086ae[_0x0ce8('0x35')]=_[_0x0ce8('0x34')](_0x48c897[_0x0ce8('0x30')],qs['fields'](_0x43e846[_0x0ce8('0x32')][_0x0ce8('0x36')]));_0x3086ae[_0x0ce8('0x35')]=_0x3086ae['attributes'][_0x0ce8('0x37')]?_0x3086ae['attributes']:_0x48c897['model'];if(_0x43e846[_0x0ce8('0x32')][_0x0ce8('0x42')]){_0x3086ae[_0x0ce8('0x48')]=[{'all':!![]}];}_0x3086ae=_[_0x0ce8('0x3f')]({},_0x3086ae,_0x43e846[_0x0ce8('0x41')]);return db[_0x0ce8('0x49')][_0x0ce8('0x4a')](_0x3086ae)[_0x0ce8('0x25')](handleEntityNotFound(_0x161e87,null))[_0x0ce8('0x25')](respondWithResult(_0x161e87,null))[_0x0ce8('0x45')](handleError(_0x161e87,null));};exports[_0x0ce8('0x4b')]=function(_0x40f37e,_0x37dda7){return db[_0x0ce8('0x49')][_0x0ce8('0x4b')](_0x40f37e[_0x0ce8('0x4c')],{})['then'](function(_0x55ce5e){var _0x2d4ee8=_0x40f37e['user'][_0x0ce8('0x27')]({'plain':!![]});if(!_0x2d4ee8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d4ee8['role']===_0x0ce8('0x4d')){var _0x1fed70=_0x55ce5e[_0x0ce8('0x27')]({'plain':!![]});var _0x46fd5b=_0x0ce8('0x28');return db[_0x0ce8('0x4e')][_0x0ce8('0x4a')]({'where':{'name':_0x46fd5b,'userProfileId':_0x2d4ee8[_0x0ce8('0x4f')]},'raw':!![]})['then'](function(_0x36eb86){if(_0x36eb86&&_0x36eb86[_0x0ce8('0x50')]===0x0){return db[_0x0ce8('0x29')][_0x0ce8('0x4b')]({'name':_0x1fed70[_0x0ce8('0x2c')],'resourceId':_0x1fed70['id'],'type':_0x36eb86[_0x0ce8('0x2c')],'sectionId':_0x36eb86['id']},{})[_0x0ce8('0x25')](function(){return _0x55ce5e;});}else{return _0x55ce5e;}})[_0x0ce8('0x45')](function(_0x2f54ed){logger[_0x0ce8('0x2a')](_0x0ce8('0x51'),_0x2f54ed);throw _0x2f54ed;});}return _0x55ce5e;})[_0x0ce8('0x25')](respondWithResult(_0x37dda7,0xc9))['catch'](handleError(_0x37dda7,null));};exports[_0x0ce8('0x52')]=function(_0x1b0cdb,_0x435573){if(_0x1b0cdb['body']['id']){delete _0x1b0cdb[_0x0ce8('0x4c')]['id'];}return db[_0x0ce8('0x49')]['find']({'where':{'id':_0x1b0cdb[_0x0ce8('0x46')]['id']}})[_0x0ce8('0x25')](handleEntityNotFound(_0x435573,null))[_0x0ce8('0x25')](saveUpdates(_0x1b0cdb[_0x0ce8('0x4c')],null))['then'](respondWithResult(_0x435573,null))[_0x0ce8('0x45')](handleError(_0x435573,null));};exports[_0x0ce8('0x26')]=function(_0x3dbcc7,_0x177aff){return db[_0x0ce8('0x49')][_0x0ce8('0x4a')]({'where':{'id':_0x3dbcc7['params']['id']}})[_0x0ce8('0x25')](handleEntityNotFound(_0x177aff,null))[_0x0ce8('0x25')](removeEntity(_0x177aff,null))['catch'](handleError(_0x177aff,null));};exports[_0x0ce8('0x2f')]=function(_0x274150,_0x347082){return db['CmCompany'][_0x0ce8('0x2f')]()[_0x0ce8('0x25')](respondWithResult(_0x347082,null))[_0x0ce8('0x45')](handleError(_0x347082,null));};exports['addContacts']=function(_0x3922a9,_0x582b4f,_0x393034){return db['CmContact'][_0x0ce8('0x4a')]({'where':{'id':_0x3922a9['params']['id']}})[_0x0ce8('0x25')](handleEntityNotFound(_0x582b4f,null))[_0x0ce8('0x25')](function(_0x47eb38){if(_0x47eb38){return _0x47eb38[_0x0ce8('0x53')](_0x3922a9['body'][_0x0ce8('0x54')],_['omit'](_0x3922a9[_0x0ce8('0x4c')],[_0x0ce8('0x54'),'id'])||{});}})['then'](respondWithResult(_0x582b4f,null))[_0x0ce8('0x45')](handleError(_0x582b4f,null));};exports[_0x0ce8('0x55')]=function(_0x12b1a9,_0x3e334c,_0x5db2eb){var _0x1ccc18={};var _0xfa68f0={};var _0x518bf9;var _0x5ddca0;return db[_0x0ce8('0x49')][_0x0ce8('0x56')]({'where':{'id':_0x12b1a9['params']['id']}})['then'](handleEntityNotFound(_0x3e334c,null))[_0x0ce8('0x25')](function(_0x4b6897){if(_0x4b6897){_0x518bf9=_0x4b6897;_0xfa68f0[_0x0ce8('0x30')]=_[_0x0ce8('0x31')](db[_0x0ce8('0x57')][_0x0ce8('0x47')]);_0xfa68f0[_0x0ce8('0x32')]=_[_0x0ce8('0x31')](_0x12b1a9[_0x0ce8('0x32')]);_0xfa68f0[_0x0ce8('0x33')]=_[_0x0ce8('0x34')](_0xfa68f0[_0x0ce8('0x30')],_0xfa68f0[_0x0ce8('0x32')]);_0x1ccc18['attributes']=_[_0x0ce8('0x34')](_0xfa68f0['model'],qs[_0x0ce8('0x36')](_0x12b1a9[_0x0ce8('0x32')][_0x0ce8('0x36')]));_0x1ccc18[_0x0ce8('0x35')]=_0x1ccc18['attributes']['length']?_0x1ccc18[_0x0ce8('0x35')]:_0xfa68f0[_0x0ce8('0x30')];_0x1ccc18[_0x0ce8('0x3a')]=qs[_0x0ce8('0x3b')](_0x12b1a9['query']['sort']);_0x1ccc18[_0x0ce8('0x3c')]=qs['filters'](_[_0x0ce8('0x3d')](_0x12b1a9[_0x0ce8('0x32')],_0xfa68f0[_0x0ce8('0x33')]));if(_0x12b1a9['query'][_0x0ce8('0x3e')]){_0x1ccc18[_0x0ce8('0x3c')]=_[_0x0ce8('0x3f')](_0x1ccc18[_0x0ce8('0x3c')],{'$or':_[_0x0ce8('0x40')](_0x1ccc18[_0x0ce8('0x35')],function(_0x400cbf){var _0x3517c3={};_0x3517c3[_0x400cbf]={'$like':'%'+_0x12b1a9['query'][_0x0ce8('0x3e')]+'%'};return _0x3517c3;})});}_0x1ccc18=_[_0x0ce8('0x3f')]({},_0x1ccc18,_0x12b1a9[_0x0ce8('0x41')]);return _0x518bf9['getContacts'](_0x1ccc18);}})[_0x0ce8('0x25')](function(_0x288987){if(_0x288987){_0x5ddca0=_0x288987['length'];if(!_0x12b1a9[_0x0ce8('0x32')]['hasOwnProperty'](_0x0ce8('0x39'))){_0x1ccc18[_0x0ce8('0x1d')]=qs['limit'](_0x12b1a9[_0x0ce8('0x32')][_0x0ce8('0x1d')]);_0x1ccc18[_0x0ce8('0x1b')]=qs[_0x0ce8('0x1b')](_0x12b1a9[_0x0ce8('0x32')]['offset']);}return _0x518bf9['getContacts'](_0x1ccc18);}})[_0x0ce8('0x25')](function(_0x476108){if(_0x476108){return _0x476108?{'count':_0x5ddca0,'rows':_0x476108}:null;}})[_0x0ce8('0x25')](respondWithResult(_0x3e334c,null))[_0x0ce8('0x45')](handleError(_0x3e334c,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 20c6c57..fe51122 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 _0x0615=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','define'];(function(_0x516a73,_0x40da9f){var _0x2c4543=function(_0x1509f7){while(--_0x1509f7){_0x516a73['push'](_0x516a73['shift']());}};_0x2c4543(++_0x40da9f);}(_0x0615,0x1b2));var _0x5061=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0615[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x5061('0x0'));var util=require(_0x5061('0x1'));var logger=require(_0x5061('0x2'))(_0x5061('0x3'));var moment=require(_0x5061('0x4'));var BPromise=require(_0x5061('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5061('0x6'));var config=require(_0x5061('0x7'));var attributes=require(_0x5061('0x8'));module['exports']=function(_0x393e30,_0x59233f){return _0x393e30[_0x5061('0x9')](_0x5061('0xa'),attributes,{'tableName':_0x5061('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21d8=['exports','define','CmCompany','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x206693,_0x14e432){var _0x234597=function(_0x103528){while(--_0x103528){_0x206693['push'](_0x206693['shift']());}};_0x234597(++_0x14e432);}(_0x21d8,0xab));var _0x821d=function(_0x1afcae,_0x3609ea){_0x1afcae=_0x1afcae-0x0;var _0x49a56d=_0x21d8[_0x1afcae];return _0x49a56d;};'use strict';var _=require(_0x821d('0x0'));var util=require(_0x821d('0x1'));var logger=require(_0x821d('0x2'))(_0x821d('0x3'));var moment=require('moment');var BPromise=require(_0x821d('0x4'));var rp=require(_0x821d('0x5'));var fs=require('fs');var path=require(_0x821d('0x6'));var rimraf=require(_0x821d('0x7'));var config=require(_0x821d('0x8'));var attributes=require('./cmCompany.attributes');module[_0x821d('0x9')]=function(_0x568e7f,_0x473034){return _0x568e7f[_0x821d('0xa')](_0x821d('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 1093b6a..5470316 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 _0x61d3=['rpc','../../config/environment','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x61d3,0x124));var _0x361d=function(_0x3e3d12,_0x5d8c29){_0x3e3d12=_0x3e3d12-0x0;var _0x2685a8=_0x61d3[_0x3e3d12];return _0x2685a8;};'use strict';var _=require('lodash');var util=require(_0x361d('0x0'));var moment=require(_0x361d('0x1'));var BPromise=require(_0x361d('0x2'));var rs=require(_0x361d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x361d('0x4'))['db'];var utils=require(_0x361d('0x5'));var logger=require(_0x361d('0x6'))(_0x361d('0x7'));var config=require(_0x361d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x361d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13ecc7,_0x477d92,_0x58b83e){return new BPromise(function(_0x397b94,_0x2641b5){return client[_0x361d('0xa')](_0x13ecc7,_0x58b83e)[_0x361d('0xb')](function(_0x50c9c6){logger[_0x361d('0xc')]('CmCompany,\x20%s,\x20%s',_0x477d92,_0x361d('0xd'));logger[_0x361d('0xe')](_0x361d('0xf'),_0x477d92,'request\x20sent',JSON[_0x361d('0x10')](_0x50c9c6));if(_0x50c9c6['error']){if(_0x50c9c6[_0x361d('0x11')][_0x361d('0x12')]===0x1f4){logger['error'](_0x361d('0x13'),_0x477d92,_0x50c9c6[_0x361d('0x11')]['message']);return _0x2641b5(_0x50c9c6[_0x361d('0x11')][_0x361d('0x14')]);}logger[_0x361d('0x11')]('CmCompany,\x20%s,\x20%s',_0x477d92,_0x50c9c6[_0x361d('0x11')]['message']);return _0x397b94(_0x50c9c6[_0x361d('0x11')][_0x361d('0x14')]);}else{logger[_0x361d('0xc')](_0x361d('0x13'),_0x477d92,_0x361d('0xd'));_0x397b94(_0x50c9c6[_0x361d('0x15')][_0x361d('0x14')]);}})[_0x361d('0x16')](function(_0x4582d1){logger[_0x361d('0x11')](_0x361d('0x13'),_0x477d92,_0x4582d1);_0x2641b5(_0x4582d1);});});} \ No newline at end of file +var _0x2964=['request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x45c92e,_0x545868){var _0x68011e=function(_0xea6e17){while(--_0xea6e17){_0x45c92e['push'](_0x45c92e['shift']());}};_0x68011e(++_0x545868);}(_0x2964,0x19b));var _0x4296=function(_0x5b40e7,_0x58ba5b){_0x5b40e7=_0x5b40e7-0x0;var _0x219048=_0x2964[_0x5b40e7];return _0x219048;};'use strict';var _=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var moment=require(_0x4296('0x2'));var BPromise=require(_0x4296('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4296('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4296('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4296('0x6'));var jayson=require(_0x4296('0x7'));var client=jayson['client'][_0x4296('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc46fc,_0x2e38a9,_0x3473f2){return new BPromise(function(_0x1a36c0,_0x50309e){return client[_0x4296('0x9')](_0xc46fc,_0x3473f2)[_0x4296('0xa')](function(_0xdfc2b6){logger[_0x4296('0xb')](_0x4296('0xc'),_0x2e38a9,_0x4296('0xd'));logger[_0x4296('0xe')](_0x4296('0xf'),_0x2e38a9,_0x4296('0xd'),JSON[_0x4296('0x10')](_0xdfc2b6));if(_0xdfc2b6['error']){if(_0xdfc2b6['error']['code']===0x1f4){logger['error'](_0x4296('0xc'),_0x2e38a9,_0xdfc2b6[_0x4296('0x11')]['message']);return _0x50309e(_0xdfc2b6['error'][_0x4296('0x12')]);}logger[_0x4296('0x11')](_0x4296('0xc'),_0x2e38a9,_0xdfc2b6[_0x4296('0x11')][_0x4296('0x12')]);return _0x1a36c0(_0xdfc2b6[_0x4296('0x11')][_0x4296('0x12')]);}else{logger[_0x4296('0xb')](_0x4296('0xc'),_0x2e38a9,_0x4296('0xd'));_0x1a36c0(_0xdfc2b6[_0x4296('0x13')][_0x4296('0x12')]);}})['catch'](function(_0x2a858c){logger[_0x4296('0x11')](_0x4296('0xc'),_0x2e38a9,_0x2a858c);_0x50309e(_0x2a858c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 66b5ce1..f231034 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 _0xfa41=['create','addContacts','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x118a97,_0x143f67){var _0x1b20c8=function(_0x240fdd){while(--_0x240fdd){_0x118a97['push'](_0x118a97['shift']());}};_0x1b20c8(++_0x143f67);}(_0xfa41,0xeb));var _0x1fa4=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xfa41[_0xb99421];return _0x4b3ec7;};'use strict';var multer=require(_0x1fa4('0x0'));var util=require('util');var path=require(_0x1fa4('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fa4('0x2'));var router=express[_0x1fa4('0x3')]();var fs_extra=require(_0x1fa4('0x4'));var auth=require(_0x1fa4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa4('0x6'));var controller=require(_0x1fa4('0x7'));router[_0x1fa4('0x8')]('/',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xa')]);router[_0x1fa4('0x8')](_0x1fa4('0xb'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xc')]);router[_0x1fa4('0x8')](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xe')]);router[_0x1fa4('0x8')](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x10')]);router[_0x1fa4('0x11')]('/',auth['isAuthenticated'](),controller[_0x1fa4('0x12')]);router['post'](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x13')]);router[_0x1fa4('0x14')]('/:id',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x15')]);router['delete'](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x16')]);module['exports']=router; \ No newline at end of file +var _0x898e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','post','/:id/contacts','addContacts','put','update','/:id','destroy','multer','util','path'];(function(_0x813d0a,_0x4fd3d7){var _0x241352=function(_0x3ca375){while(--_0x3ca375){_0x813d0a['push'](_0x813d0a['shift']());}};_0x241352(++_0x4fd3d7);}(_0x898e,0x18d));var _0xe898=function(_0x364732,_0x476ab3){_0x364732=_0x364732-0x0;var _0x23a095=_0x898e[_0x364732];return _0x23a095;};'use strict';var multer=require(_0xe898('0x0'));var util=require(_0xe898('0x1'));var path=require(_0xe898('0x2'));var timeout=require(_0xe898('0x3'));var express=require('express');var router=express[_0xe898('0x4')]();var fs_extra=require(_0xe898('0x5'));var auth=require(_0xe898('0x6'));var interaction=require(_0xe898('0x7'));var config=require(_0xe898('0x8'));var controller=require(_0xe898('0x9'));router[_0xe898('0xa')]('/',auth[_0xe898('0xb')](),controller[_0xe898('0xc')]);router[_0xe898('0xa')]('/describe',auth[_0xe898('0xb')](),controller['describe']);router[_0xe898('0xa')]('/:id',auth[_0xe898('0xb')](),controller['show']);router[_0xe898('0xa')]('/:id/contacts',auth[_0xe898('0xb')](),controller['getContacts']);router[_0xe898('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe898('0xd')](_0xe898('0xe'),auth[_0xe898('0xb')](),controller[_0xe898('0xf')]);router[_0xe898('0x10')]('/:id',auth[_0xe898('0xb')](),controller[_0xe898('0x11')]);router['delete'](_0xe898('0x12'),auth['isAuthenticated'](),controller[_0xe898('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7784312..f18bff8 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 _0xdcd8=['TEXT','UNSIGNED','NOW','INTEGER','lodash','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdcd8,0xdd));var _0x8dcd=function(_0x184d15,_0x156b5d){_0x184d15=_0x184d15-0x0;var _0x4989da=_0xdcd8[_0x184d15];return _0x4989da;};'use strict';var _=require(_0x8dcd('0x0'));var Sequelize=require(_0x8dcd('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8dcd('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8dcd('0x2')]},'street':{'type':Sequelize[_0x8dcd('0x2')]},'postalCode':{'type':Sequelize[_0x8dcd('0x2')]},'city':{'type':Sequelize[_0x8dcd('0x2')]},'country':{'type':Sequelize[_0x8dcd('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8dcd('0x2')]},'description':{'type':Sequelize[_0x8dcd('0x3')]},'phone':{'type':Sequelize[_0x8dcd('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8dcd('0x2')]},'url':{'type':Sequelize[_0x8dcd('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8dcd('0x2')]},'teams':{'type':Sequelize[_0x8dcd('0x2')]},'viber':{'type':Sequelize[_0x8dcd('0x2')]},'line':{'type':Sequelize[_0x8dcd('0x2')]},'wechat':{'type':Sequelize[_0x8dcd('0x2')]},'telegram':{'type':Sequelize[_0x8dcd('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x8dcd('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8dcd('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8dcd('0x5')]},'dialTimezone':{'type':Sequelize[_0x8dcd('0x2')]},'utcOffset':{'type':Sequelize[_0x8dcd('0x6')]}}; \ No newline at end of file +var _0x6498=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x43a566,_0x2f1067){var _0x3a380b=function(_0x9609a4){while(--_0x9609a4){_0x43a566['push'](_0x43a566['shift']());}};_0x3a380b(++_0x2f1067);}(_0x6498,0xfe));var _0x8649=function(_0x13b471,_0x42efbf){_0x13b471=_0x13b471-0x0;var _0xc79516=_0x6498[_0x13b471];return _0xc79516;};'use strict';var _=require(_0x8649('0x0'));var Sequelize=require(_0x8649('0x1'));module[_0x8649('0x2')]={'firstName':{'type':Sequelize[_0x8649('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8649('0x3')]},'street':{'type':Sequelize[_0x8649('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x8649('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x8649('0x3')]},'mobile':{'type':Sequelize[_0x8649('0x3')]},'fax':{'type':Sequelize[_0x8649('0x3')]},'email':{'type':Sequelize[_0x8649('0x3')]},'url':{'type':Sequelize[_0x8649('0x3')]},'facebook':{'type':Sequelize[_0x8649('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x8649('0x3')]},'skype':{'type':Sequelize[_0x8649('0x3')]},'teams':{'type':Sequelize[_0x8649('0x3')]},'viber':{'type':Sequelize[_0x8649('0x3')]},'line':{'type':Sequelize[_0x8649('0x3')]},'wechat':{'type':Sequelize[_0x8649('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x8649('0x3')]},'priority':{'type':Sequelize[_0x8649('0x4')](0x2)[_0x8649('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8649('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7b13b37..11ad20b 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 011e7a1..91d78e6 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 _0xc0a2=['exports','events','update','remove','emit'];(function(_0xac0dc6,_0x277c9b){var _0x1feb0a=function(_0x492ef4){while(--_0x492ef4){_0xac0dc6['push'](_0xac0dc6['shift']());}};_0x1feb0a(++_0x277c9b);}(_0xc0a2,0x18c));var _0x2c0a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0a2[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x2c0a('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c0a('0x1'),'afterDestroy':_0x2c0a('0x2')};function emitEvent(_0x16c619){return function(_0x7455ae,_0x5b2672,_0x250670){CmContactEvents[_0x2c0a('0x3')](_0x16c619+':'+_0x7455ae['id'],_0x7455ae);CmContactEvents[_0x2c0a('0x3')](_0x16c619,_0x7455ae);_0x250670(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x2c0a('0x4')]=CmContactEvents; \ No newline at end of file +var _0xa817=['hasOwnProperty','events','../../mysqldb','save','update','remove','emit'];(function(_0x151c4c,_0x1c9647){var _0x46ed2a=function(_0x153a11){while(--_0x153a11){_0x151c4c['push'](_0x151c4c['shift']());}};_0x46ed2a(++_0x1c9647);}(_0xa817,0x1d6));var _0x7a81=function(_0x34f7c4,_0x1cdca2){_0x34f7c4=_0x34f7c4-0x0;var _0xff34bf=_0xa817[_0x34f7c4];return _0xff34bf;};'use strict';var EventEmitter=require(_0x7a81('0x0'));var CmContact=require(_0x7a81('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7a81('0x2'),'afterUpdate':_0x7a81('0x3'),'afterDestroy':_0x7a81('0x4')};function emitEvent(_0x43606a){return function(_0x17856d,_0x24bb7e,_0x22bde3){CmContactEvents[_0x7a81('0x5')](_0x43606a+':'+_0x17856d['id'],_0x17856d);CmContactEvents[_0x7a81('0x5')](_0x43606a,_0x17856d);_0x22bde3(null);};}for(var e in events){if(events[_0x7a81('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index ddbcef3..d85734d 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 _0x1405=['utf8mb4','models','get','error','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','ListId','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','length','always','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','onlyIfOpen','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT'];(function(_0x133638,_0x418b24){var _0x2e276d=function(_0x46ad2a){while(--_0x46ad2a){_0x133638['push'](_0x133638['shift']());}};_0x2e276d(++_0x418b24);}(_0x1405,0x1b6));var _0x5140=function(_0x28c89a,_0x5664b0){_0x28c89a=_0x28c89a-0x0;var _0x1888c7=_0x1405[_0x28c89a];return _0x1888c7;};'use strict';var _=require(_0x5140('0x0'));var util=require(_0x5140('0x1'));var logger=require(_0x5140('0x2'))(_0x5140('0x3'));var moment=require('moment');var BPromise=require(_0x5140('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5140('0x5'));var rimraf=require(_0x5140('0x6'));var config=require(_0x5140('0x7'));var shared=require(_0x5140('0x8'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x5c3c17,_0x172d37){return _0x5c3c17['define'](_0x5140('0x9'),attributes,{'tableName':_0x5140('0xa'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x5140('0xb')]},{'name':_0x5140('0xc'),'fields':[_0x5140('0xd'),_0x5140('0xe'),_0x5140('0xb'),'mobile',_0x5140('0xf'),_0x5140('0x10')],'type':_0x5140('0x11')}],'timestamps':!![],'charset':_0x5140('0x12'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x1c1e3a,_0x121c28,_0x1c9825){var _0x13933a=_0x5c3c17[_0x5140('0x13')];var _0x9623e1=_0x1c1e3a[_0x5140('0x14')]({'plain':!![]});function _0x86e0c5(){return function(_0x426c2e){logger[_0x5140('0x15')](_0x5140('0x16'),_0x5140('0x17'),util['inspect'](_0x426c2e,{'showHidden':![],'depth':null}));};}function _0x151072(_0x3577b1,_0x4c948a){var _0x3eb6c3=_0x4c948a[_0x5140('0x18')]?_0x4c948a['scheduledat']:moment()[_0x5140('0x19')](_0x5140('0x1a'));return new BPromise(function(_0x20847e,_0x9afd0d){if(_[_0x5140('0x1b')](_0x4c948a[_0x5140('0x1c')])){_0x20847e({'ret':_0x3eb6c3});}else{_0x13933a[_0x5140('0x1d')][_0x5140('0x1e')]({'where':{'id':_0x3577b1['id']}})[_0x5140('0x1f')](function(_0x2300c3){if(!_[_0x5140('0x1b')](_0x2300c3)){var _0x47f2e5=_0x2300c3[_0x5140('0x1c')];if(!_[_0x5140('0x1b')](_0x47f2e5)){var _0x353df6=shared[_0x5140('0x20')];var _0x1f0a30=_0x353df6[_0x47f2e5];var _0x133496=_0x353df6[_0x4c948a[_0x5140('0x1c')]];if(!_[_0x5140('0x1b')](_0x1f0a30)&&!_[_0x5140('0x1b')](_0x133496)){var _0xf90ac5=_0x1f0a30[_0x5140('0x21')]-_0x133496[_0x5140('0x21')];_0x3eb6c3=_0x4c948a[_0x5140('0x18')]?_0x4c948a[_0x5140('0x18')]:moment();var _0x2b2313=moment(_0x3eb6c3)[_0x5140('0x22')](_0xf90ac5,_0x5140('0x23'));_0x20847e({'ret':_0x2b2313[_0x5140('0x19')](_0x5140('0x1a'))});}else _0x20847e({'ret':_0x3eb6c3});}else _0x20847e({'ret':_0x3eb6c3});}else{_0x20847e({'ret':_0x3eb6c3});}});}});return 0xa;}var _0xbb09bf=function(_0x37ab47){return new BPromise(function(_0x23040b,_0x31986f){_0x151072(_0x37ab47,_0x9623e1)[_0x5140('0x1f')](function(_0x16e9d8){_0x9623e1[_0x5140('0x18')]=_0x16e9d8[_0x5140('0x24')];_0x13933a['CmHopper']['findOne']({'where':{'phone':_0x9623e1[_0x5140('0xb')],'VoiceQueueId':_0x37ab47['id']}})[_0x5140('0x1f')](function(_0x334902){if(!_[_0x5140('0x1b')](_0x334902)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x26')+_0x37ab47['id']);}return _0x13933a[_0x5140('0x27')]['create']({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1['ListId'],'priority':_0x9623e1['priority']?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')](_0x5140('0x1a')):undefined,'VoiceQueueId':_0x37ab47['id']});})[_0x5140('0x2a')](function(_0x3e0fa7){_0x31986f(_0x3e0fa7);});});});};var _0x5e9f1f=function(_0x7cc0ab){return new BPromise(function(_0x59d543,_0x4f2108){_0x151072(_0x7cc0ab,_0x9623e1)[_0x5140('0x1f')](function(_0x3edf88){_0x9623e1[_0x5140('0x18')]=_0x3edf88[_0x5140('0x24')];_0x13933a[_0x5140('0x27')][_0x5140('0x1e')]({'where':{'phone':_0x9623e1[_0x5140('0xb')],'VoiceQueueId':_0x7cc0ab['id']}})['then'](function(_0x1028ce){if(!_[_0x5140('0x1b')](_0x1028ce)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x2b')+_0x7cc0ab['id']);}return _0x13933a['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x9623e1['phone'],'VoiceQueueId':_0x7cc0ab['id']}});})[_0x5140('0x1f')](function(_0x463161){if(!_[_0x5140('0x1b')](_0x463161)){throw new Error(_0x5140('0x2c')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x2d')+_0x7cc0ab['id']);}return _0x13933a[_0x5140('0x27')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1[_0x5140('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1['callbackUniqueid']:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x7cc0ab['id']});})[_0x5140('0x2a')](function(_0x222edd){_0x4f2108(_0x222edd);});});});};function _0x59d70c(){return function(_0x219cd8){logger[_0x5140('0x15')](_0x5140('0x16'),'afterCreate',util[_0x5140('0x30')](_0x219cd8,{'showHidden':![],'depth':null}));};}function _0x1d7ab7(_0x24500e,_0x3cad65){var _0x14d62b=_0x3cad65['scheduledat']?_0x3cad65[_0x5140('0x18')]:moment()[_0x5140('0x19')](_0x5140('0x1a'));return new BPromise(function(_0x1ca8fa,_0x1933b1){if(_[_0x5140('0x1b')](_0x3cad65[_0x5140('0x1c')])){_0x1ca8fa({'ret':_0x14d62b});}else{_0x13933a[_0x5140('0x31')][_0x5140('0x1e')]({'where':{'id':_0x24500e['id']}})['then'](function(_0x494101){if(!_[_0x5140('0x1b')](_0x494101)){var _0x54c389=_0x494101[_0x5140('0x1c')];if(!_[_0x5140('0x1b')](_0x54c389)){var _0x45d991=shared[_0x5140('0x20')];var _0x87978a=_0x45d991[_0x54c389];var _0x3a1724=_0x45d991[_0x3cad65[_0x5140('0x1c')]];if(!_[_0x5140('0x1b')](_0x87978a)&&!_[_0x5140('0x1b')](_0x3a1724)){var _0x2e933b=_0x87978a[_0x5140('0x21')]-_0x3a1724[_0x5140('0x21')];_0x14d62b=_0x3cad65[_0x5140('0x18')]?_0x3cad65['scheduledat']:moment();var _0x20c3a7=moment(_0x14d62b)['add'](_0x2e933b,_0x5140('0x23'));_0x1ca8fa({'ret':_0x20c3a7[_0x5140('0x19')](_0x5140('0x1a'))});}else _0x1ca8fa({'ret':_0x14d62b});}else _0x1ca8fa({'ret':_0x14d62b});}else{_0x1ca8fa({'ret':_0x14d62b});}});}});return 0xa;}var _0x2c2e7=function(_0x57f094){return new BPromise(function(_0x2c957a,_0x37dfb3){_0x1d7ab7(_0x57f094,_0x9623e1)['then'](function(_0x49ea55){_0x9623e1[_0x5140('0x18')]=_0x49ea55[_0x5140('0x24')];_0x13933a[_0x5140('0x27')][_0x5140('0x1e')]({'where':{'phone':_0x9623e1[_0x5140('0xb')],'CampaignId':_0x57f094['id']}})['then'](function(_0x399c02){if(!_['isNil'](_0x399c02)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x32')+_0x57f094['id']);}return _0x13933a[_0x5140('0x27')]['create']({'phone':_0x9623e1['phone'],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1['scheduledat']:moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x57f094['id']});})[_0x5140('0x2a')](function(_0x170039){_0x37dfb3(_0x170039);});});});};var _0x123019=function(_0x1dd221){return new BPromise(function(_0x17bffb,_0x1ba2b7){_0x1d7ab7(_0x1dd221,_0x9623e1)[_0x5140('0x1f')](function(_0x3fd4cf){_0x9623e1[_0x5140('0x18')]=_0x3fd4cf[_0x5140('0x24')];_0x13933a[_0x5140('0x27')][_0x5140('0x1e')]({'where':{'phone':_0x9623e1[_0x5140('0xb')],'CampaignId':_0x1dd221['id']}})['then'](function(_0x783ce8){if(!_['isNil'](_0x783ce8)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x33')+_0x1dd221['id']);}return _0x13933a[_0x5140('0x34')]['findOne']({'where':{'calleridnum':_0x9623e1['phone'],'CampaignId':_0x1dd221['id']}});})[_0x5140('0x1f')](function(_0x52eb4c){if(!_['isNil'](_0x52eb4c)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x9623e1[_0x5140('0xb')]+_0x5140('0x35')+_0x1dd221['id']);}return _0x13933a[_0x5140('0x27')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1[_0x5140('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')](_0x5140('0x1a')):undefined,'CampaignId':_0x1dd221['id']});})[_0x5140('0x2a')](function(_0x310a80){_0x1ba2b7(_0x310a80);});});});};if(_0x9623e1['ListId']){_0x13933a['VoiceQueue'][_0x5140('0x36')]({'where':{'type':_0x5140('0x37')},'attributes':['id',_0x5140('0x38'),_0x5140('0x1c')],'include':[{'model':_0x13933a['CmList'],'as':_0x5140('0x39'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})[_0x5140('0x1f')](function(_0x234d2c){if(_0x234d2c){var _0x4d3b93=[];for(var _0x3e23f7=0x0,_0x27c3ad;_0x3e23f7<_0x234d2c[_0x5140('0x3a')];_0x3e23f7+=0x1){_0x27c3ad=_0x234d2c[_0x3e23f7]['get']({'plain':!![]});switch(_0x27c3ad[_0x5140('0x38')]){case _0x5140('0x3b'):_0x5e9f1f(_0x27c3ad)[_0x5140('0x2a')](_0x86e0c5());break;case'onlyIfOpen':_0xbb09bf(_0x27c3ad)[_0x5140('0x2a')](_0x86e0c5());break;default:_0x1d7ab7(_0x27c3ad,_0x9623e1)[_0x5140('0x1f')](function(_0xbcdb9e){_0x9623e1['scheduledat']=_0xbcdb9e['ret'];_0x13933a[_0x5140('0x27')]['create']({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'scheduledat':_0x9623e1['scheduledat']?_0x9623e1[_0x5140('0x18')]:moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1['priority']:0x2,'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1['callbackUniqueid']?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')](_0x5140('0x1a')):undefined,'VoiceQueueId':_0x27c3ad['id']})[_0x5140('0x2a')](_0x86e0c5());});}}}})[_0x5140('0x1f')](function(){return _0x13933a['VoiceQueue'][_0x5140('0x36')]({'where':{'type':_0x5140('0x37')},'attributes':['id'],'include':[{'model':_0x13933a[_0x5140('0x3c')],'as':_0x5140('0x3d'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})[_0x5140('0x1f')](function(_0x22dd1e){if(_0x22dd1e){var _0xe67648=[];for(var _0x2c1913=0x0,_0x30487b;_0x2c1913<_0x22dd1e[_0x5140('0x3a')];_0x2c1913+=0x1){_0x30487b=_0x22dd1e[_0x2c1913][_0x5140('0x14')]({'plain':!![]});_0x13933a[_0x5140('0x3e')][_0x5140('0x2e')]({'phone':_0x9623e1['phone'],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'VoiceQueueId':_0x30487b['id']})['catch'](function(_0x1096cb){logger[_0x5140('0x15')](_0x5140('0x3f'),_0x5140('0x17'),_0x1096cb[_0x5140('0x40')]);});}}});})[_0x5140('0x1f')](function(){return _0x13933a[_0x5140('0x31')][_0x5140('0x36')]({'attributes':['id','dialCheckDuplicateType',_0x5140('0x1c')],'include':[{'model':_0x13933a[_0x5140('0x3c')],'as':_0x5140('0x39'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})['then'](function(_0xca8a00){if(_0xca8a00){var _0xf357a0=[];for(var _0x3fc6fa=0x0,_0x107b68;_0x3fc6fa<_0xca8a00[_0x5140('0x3a')];_0x3fc6fa+=0x1){_0x107b68=_0xca8a00[_0x3fc6fa][_0x5140('0x14')]({'plain':!![]});switch(_0x107b68[_0x5140('0x38')]){case _0x5140('0x3b'):_0x123019(_0x107b68)[_0x5140('0x2a')](_0x59d70c());break;case _0x5140('0x41'):_0x2c2e7(_0x107b68)[_0x5140('0x2a')](_0x59d70c());break;default:_0x13933a[_0x5140('0x27')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1[_0x5140('0x18')]:moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'callback':_0x9623e1['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x107b68['id']})[_0x5140('0x2a')](_0x59d70c());}}}});})[_0x5140('0x1f')](function(){return _0x13933a[_0x5140('0x31')][_0x5140('0x36')]({'attributes':['id'],'include':[{'model':_0x13933a[_0x5140('0x3c')],'as':_0x5140('0x3d'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})[_0x5140('0x1f')](function(_0x474844){if(_0x474844){var _0x2c302d=[];for(var _0x141628=0x0,_0x1db2d5;_0x141628<_0x474844[_0x5140('0x3a')];_0x141628+=0x1){_0x1db2d5=_0x474844[_0x141628]['get']({'plain':!![]});_0x13933a[_0x5140('0x3e')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'CampaignId':_0x1db2d5['id']})['catch'](function(_0x421833){logger[_0x5140('0x15')](_0x5140('0x3f'),_0x5140('0x17'),_0x421833[_0x5140('0x40')]);});}}});})[_0x5140('0x1f')](function(){_0x1c9825();})[_0x5140('0x2a')](function(_0x4ba7de){logger['error'](_0x5140('0x3f'),'afterCreate',_0x4ba7de[_0x5140('0x40')]);_0x1c9825(_0x4ba7de);});}else{_0x1c9825(new Error(_0x5140('0x42')));}},'afterDestroy':function(_0x4698dc,_0x3a0588,_0x46cc36){var _0x3bc5d4=_0x5c3c17[_0x5140('0x13')];var _0x4879ef=_0x4698dc[_0x5140('0x14')]({'plain':!![]});return _0x3bc5d4[_0x5140('0x27')][_0x5140('0x36')]({'raw':!![],'where':{'ListId':_0x4879ef[_0x5140('0x2f')],'ContactId':_0x4879ef['id']}})[_0x5140('0x1f')](function(_0x24b0b3){if(!_[_0x5140('0x43')](_0x24b0b3)){var _0x2ed1ec=[];for(var _0x27ad32=0x0;_0x27ad32<_0x24b0b3[_0x5140('0x3a')];_0x27ad32+=0x1){var _0x26864c=_0x3bc5d4['CmHopper'][_0x5140('0x44')]({'where':{'ListId':_0x24b0b3[_0x27ad32]['ListId'],'ContactId':_0x24b0b3[_0x27ad32][_0x5140('0x45')],'VoiceQueueId':_0x24b0b3[_0x27ad32][_0x5140('0x46')],'CampaignId':_0x24b0b3[_0x27ad32][_0x5140('0x47')]}});_0x2ed1ec[_0x5140('0x48')](_0x26864c);}return BPromise[_0x5140('0x49')](_0x2ed1ec);}})[_0x5140('0x1f')](function(_0x350f3b){logger['info'](_0x5140('0x4a'),util[_0x5140('0x30')](_0x350f3b,{'showHidden':![],'depth':null}));_0x46cc36();})['catch'](function(_0x119daf){logger[_0x5140('0x15')](_0x5140('0x4b'),util['inspect'](_0x119daf,{'showHidden':![],'depth':null}));_0x46cc36(_0x119daf);});}}});}; \ No newline at end of file +var _0x0316=['ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','\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','create','findAll','outbound','dialCheckDuplicateType','CmList','length','get','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','always','onlyIfOpen','Campaign','List\x20not\x20found','isEmpty','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','timezones','utcOffset','add','minutes'];(function(_0x184385,_0x178fb5){var _0x4a058d=function(_0x11f382){while(--_0x11f382){_0x184385['push'](_0x184385['shift']());}};_0x4a058d(++_0x178fb5);}(_0x0316,0x191));var _0x6031=function(_0x60500a,_0x1ad05b){_0x60500a=_0x60500a-0x0;var _0x2ac426=_0x0316[_0x60500a];return _0x2ac426;};'use strict';var _=require(_0x6031('0x0'));var util=require(_0x6031('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6031('0x2'));var BPromise=require(_0x6031('0x3'));var rp=require(_0x6031('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6031('0x5'));var config=require(_0x6031('0x6'));var shared=require(_0x6031('0x7'));var attributes=require(_0x6031('0x8'));module['exports']=function(_0x4900ad,_0x42c320){return _0x4900ad[_0x6031('0x9')]('CmContact',attributes,{'tableName':_0x6031('0xa'),'paranoid':!![],'indexes':[{'name':_0x6031('0xb'),'fields':['phone']},{'name':_0x6031('0xc'),'fields':[_0x6031('0xd'),_0x6031('0xe'),_0x6031('0xb'),_0x6031('0xf'),_0x6031('0x10'),_0x6031('0x11')],'type':_0x6031('0x12')}],'timestamps':!![],'charset':_0x6031('0x13'),'collate':_0x6031('0x14'),'hooks':{'afterCreate':function(_0x16050d,_0x51a714,_0x1af8b6){var _0x2ec361=_0x4900ad['models'];var _0x7d5e94=_0x16050d['get']({'plain':!![]});function _0x42555b(){return function(_0x2dd29b){logger[_0x6031('0x15')](_0x6031('0x16'),_0x6031('0x17'),util[_0x6031('0x18')](_0x2dd29b,{'showHidden':![],'depth':null}));};}function _0x16d3a0(_0x4f8230,_0x4a4500){var _0x2753d8=_0x4a4500[_0x6031('0x19')]?_0x4a4500['scheduledat']:moment()[_0x6031('0x1a')](_0x6031('0x1b'));return new BPromise(function(_0x480ea9,_0x14627c){if(_['isNil'](_0x4a4500[_0x6031('0x1c')])){_0x480ea9({'ret':_0x2753d8});}else{_0x2ec361[_0x6031('0x1d')][_0x6031('0x1e')]({'where':{'id':_0x4f8230['id']}})[_0x6031('0x1f')](function(_0x212ea4){if(!_['isNil'](_0x212ea4)){var _0x59a11d=_0x212ea4[_0x6031('0x1c')];if(!_[_0x6031('0x20')](_0x59a11d)){var _0x35c0ac=shared[_0x6031('0x21')];var _0xe41354=_0x35c0ac[_0x59a11d];var _0x5b37b6=_0x35c0ac[_0x4a4500[_0x6031('0x1c')]];if(!_[_0x6031('0x20')](_0xe41354)&&!_[_0x6031('0x20')](_0x5b37b6)){var _0xf76684=_0xe41354[_0x6031('0x22')]-_0x5b37b6[_0x6031('0x22')];_0x2753d8=_0x4a4500[_0x6031('0x19')]?_0x4a4500[_0x6031('0x19')]:moment();var _0x24fb87=moment(_0x2753d8)[_0x6031('0x23')](_0xf76684,_0x6031('0x24'));_0x480ea9({'ret':_0x24fb87[_0x6031('0x1a')](_0x6031('0x1b'))});}else _0x480ea9({'ret':_0x2753d8});}else _0x480ea9({'ret':_0x2753d8});}else{_0x480ea9({'ret':_0x2753d8});}});}});return 0xa;}var _0x214bea=function(_0xde4582){return new BPromise(function(_0x5c520c,_0x1ab77d){_0x16d3a0(_0xde4582,_0x7d5e94)[_0x6031('0x1f')](function(_0xe28162){_0x7d5e94[_0x6031('0x19')]=_0xe28162[_0x6031('0x25')];_0x2ec361[_0x6031('0x26')][_0x6031('0x1e')]({'where':{'phone':_0x7d5e94[_0x6031('0xb')],'VoiceQueueId':_0xde4582['id']}})[_0x6031('0x1f')](function(_0x592188){if(!_[_0x6031('0x20')](_0x592188)){throw new Error(_0x6031('0x27')+_0x7d5e94[_0x6031('0xb')]+_0x6031('0x28')+_0xde4582['id']);}return _0x2ec361[_0x6031('0x26')]['create']({'phone':_0x7d5e94[_0x6031('0xb')],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94[_0x6031('0x29')],'priority':_0x7d5e94[_0x6031('0x2a')]?_0x7d5e94[_0x6031('0x2a')]:0x2,'scheduledat':_0x7d5e94['scheduledat']?_0x7d5e94['scheduledat']:moment()[_0x6031('0x1a')](_0x6031('0x1b')),'callback':_0x7d5e94[_0x6031('0x2b')]?!![]:![],'callbackuniqueid':_0x7d5e94[_0x6031('0x2b')]?_0x7d5e94['callbackUniqueid']:undefined,'callbackat':_0x7d5e94[_0x6031('0x2b')]?moment()['format'](_0x6031('0x1b')):undefined,'VoiceQueueId':_0xde4582['id']});})[_0x6031('0x2c')](function(_0x185ff1){_0x1ab77d(_0x185ff1);});});});};var _0x3a8467=function(_0x429744){return new BPromise(function(_0x20a652,_0x396436){_0x16d3a0(_0x429744,_0x7d5e94)[_0x6031('0x1f')](function(_0x56005b){_0x7d5e94[_0x6031('0x19')]=_0x56005b[_0x6031('0x25')];_0x2ec361['CmHopper'][_0x6031('0x1e')]({'where':{'phone':_0x7d5e94[_0x6031('0xb')],'VoiceQueueId':_0x429744['id']}})[_0x6031('0x1f')](function(_0x3103c4){if(!_[_0x6031('0x20')](_0x3103c4)){throw new Error(_0x6031('0x27')+_0x7d5e94[_0x6031('0xb')]+_0x6031('0x2d')+_0x429744['id']);}return _0x2ec361[_0x6031('0x2e')]['findOne']({'where':{'calleridnum':_0x7d5e94[_0x6031('0xb')],'VoiceQueueId':_0x429744['id']}});})[_0x6031('0x1f')](function(_0x17bcdd){if(!_[_0x6031('0x20')](_0x17bcdd)){throw new Error(_0x6031('0x2f')+_0x7d5e94[_0x6031('0xb')]+_0x6031('0x30')+_0x429744['id']);}return _0x2ec361[_0x6031('0x26')]['create']({'phone':_0x7d5e94[_0x6031('0xb')],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94[_0x6031('0x29')],'priority':_0x7d5e94[_0x6031('0x2a')]?_0x7d5e94[_0x6031('0x2a')]:0x2,'scheduledat':_0x7d5e94['scheduledat']?_0x7d5e94[_0x6031('0x19')]:moment()[_0x6031('0x1a')](_0x6031('0x1b')),'callback':_0x7d5e94[_0x6031('0x2b')]?!![]:![],'callbackuniqueid':_0x7d5e94[_0x6031('0x2b')]?_0x7d5e94[_0x6031('0x2b')]:undefined,'callbackat':_0x7d5e94[_0x6031('0x2b')]?moment()['format'](_0x6031('0x1b')):undefined,'VoiceQueueId':_0x429744['id']});})[_0x6031('0x2c')](function(_0x4790a2){_0x396436(_0x4790a2);});});});};function _0x38614c(){return function(_0x1cd315){logger['error'](_0x6031('0x16'),'afterCreate',util[_0x6031('0x18')](_0x1cd315,{'showHidden':![],'depth':null}));};}function _0x5c3498(_0x263fac,_0x46868f){var _0x506e3b=_0x46868f[_0x6031('0x19')]?_0x46868f[_0x6031('0x19')]:moment()[_0x6031('0x1a')](_0x6031('0x1b'));return new BPromise(function(_0x3cb360,_0x1e6133){if(_[_0x6031('0x20')](_0x46868f['dialTimezone'])){_0x3cb360({'ret':_0x506e3b});}else{_0x2ec361['Campaign'][_0x6031('0x1e')]({'where':{'id':_0x263fac['id']}})['then'](function(_0x4abffe){if(!_[_0x6031('0x20')](_0x4abffe)){var _0x8968e3=_0x4abffe[_0x6031('0x1c')];if(!_[_0x6031('0x20')](_0x8968e3)){var _0x5a6be3=shared[_0x6031('0x21')];var _0x22d3b9=_0x5a6be3[_0x8968e3];var _0x34792a=_0x5a6be3[_0x46868f[_0x6031('0x1c')]];if(!_[_0x6031('0x20')](_0x22d3b9)&&!_[_0x6031('0x20')](_0x34792a)){var _0x2f00f9=_0x22d3b9[_0x6031('0x22')]-_0x34792a[_0x6031('0x22')];_0x506e3b=_0x46868f['scheduledat']?_0x46868f['scheduledat']:moment();var _0x1d76bf=moment(_0x506e3b)['add'](_0x2f00f9,_0x6031('0x24'));_0x3cb360({'ret':_0x1d76bf[_0x6031('0x1a')](_0x6031('0x1b'))});}else _0x3cb360({'ret':_0x506e3b});}else _0x3cb360({'ret':_0x506e3b});}else{_0x3cb360({'ret':_0x506e3b});}});}});return 0xa;}var _0x31b02e=function(_0x326de1){return new BPromise(function(_0x3cc146,_0x34cf88){_0x5c3498(_0x326de1,_0x7d5e94)[_0x6031('0x1f')](function(_0xf26be1){_0x7d5e94[_0x6031('0x19')]=_0xf26be1[_0x6031('0x25')];_0x2ec361[_0x6031('0x26')][_0x6031('0x1e')]({'where':{'phone':_0x7d5e94[_0x6031('0xb')],'CampaignId':_0x326de1['id']}})[_0x6031('0x1f')](function(_0xe6896a){if(!_[_0x6031('0x20')](_0xe6896a)){throw new Error(_0x6031('0x27')+_0x7d5e94[_0x6031('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x326de1['id']);}return _0x2ec361['CmHopper']['create']({'phone':_0x7d5e94[_0x6031('0xb')],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94[_0x6031('0x29')],'priority':_0x7d5e94[_0x6031('0x2a')]?_0x7d5e94['priority']:0x2,'scheduledat':_0x7d5e94['scheduledat']?_0x7d5e94[_0x6031('0x19')]:moment()[_0x6031('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x7d5e94[_0x6031('0x2b')]?!![]:![],'callbackuniqueid':_0x7d5e94[_0x6031('0x2b')]?_0x7d5e94[_0x6031('0x2b')]:undefined,'callbackat':_0x7d5e94[_0x6031('0x2b')]?moment()['format'](_0x6031('0x1b')):undefined,'CampaignId':_0x326de1['id']});})['catch'](function(_0x347c83){_0x34cf88(_0x347c83);});});});};var _0x5e9bf2=function(_0x389180){return new BPromise(function(_0x54be6f,_0x5bfdbe){_0x5c3498(_0x389180,_0x7d5e94)[_0x6031('0x1f')](function(_0x3dcd6a){_0x7d5e94[_0x6031('0x19')]=_0x3dcd6a['ret'];_0x2ec361[_0x6031('0x26')][_0x6031('0x1e')]({'where':{'phone':_0x7d5e94[_0x6031('0xb')],'CampaignId':_0x389180['id']}})[_0x6031('0x1f')](function(_0x5518dc){if(!_['isNil'](_0x5518dc)){throw new Error(_0x6031('0x27')+_0x7d5e94[_0x6031('0xb')]+_0x6031('0x31')+_0x389180['id']);}return _0x2ec361[_0x6031('0x2e')][_0x6031('0x1e')]({'where':{'calleridnum':_0x7d5e94[_0x6031('0xb')],'CampaignId':_0x389180['id']}});})[_0x6031('0x1f')](function(_0x5886d4){if(!_['isNil'](_0x5886d4)){throw new Error(_0x6031('0x2f')+_0x7d5e94['phone']+_0x6031('0x32')+_0x389180['id']);}return _0x2ec361[_0x6031('0x26')][_0x6031('0x33')]({'phone':_0x7d5e94['phone'],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94[_0x6031('0x29')],'priority':_0x7d5e94[_0x6031('0x2a')]?_0x7d5e94['priority']:0x2,'scheduledat':_0x7d5e94[_0x6031('0x19')]?_0x7d5e94[_0x6031('0x19')]:moment()[_0x6031('0x1a')](_0x6031('0x1b')),'callback':_0x7d5e94[_0x6031('0x2b')]?!![]:![],'callbackuniqueid':_0x7d5e94['callbackUniqueid']?_0x7d5e94['callbackUniqueid']:undefined,'callbackat':_0x7d5e94[_0x6031('0x2b')]?moment()[_0x6031('0x1a')](_0x6031('0x1b')):undefined,'CampaignId':_0x389180['id']});})[_0x6031('0x2c')](function(_0x43cb77){_0x5bfdbe(_0x43cb77);});});});};if(_0x7d5e94[_0x6031('0x29')]){_0x2ec361[_0x6031('0x1d')][_0x6031('0x34')]({'where':{'type':_0x6031('0x35')},'attributes':['id',_0x6031('0x36'),'dialTimezone'],'include':[{'model':_0x2ec361[_0x6031('0x37')],'as':'Lists','where':{'id':_0x7d5e94[_0x6031('0x29')]}}]})[_0x6031('0x1f')](function(_0x1a8579){if(_0x1a8579){var _0x49989d=[];for(var _0x1d0fd3=0x0,_0x4238eb;_0x1d0fd3<_0x1a8579[_0x6031('0x38')];_0x1d0fd3+=0x1){_0x4238eb=_0x1a8579[_0x1d0fd3][_0x6031('0x39')]({'plain':!![]});switch(_0x4238eb['dialCheckDuplicateType']){case'always':_0x3a8467(_0x4238eb)[_0x6031('0x2c')](_0x42555b());break;case'onlyIfOpen':_0x214bea(_0x4238eb)[_0x6031('0x2c')](_0x42555b());break;default:_0x5c3498(_0x4238eb,_0x7d5e94)['then'](function(_0x5e2fe4){_0x7d5e94['scheduledat']=_0x5e2fe4['ret'];_0x2ec361['CmHopper'][_0x6031('0x33')]({'phone':_0x7d5e94[_0x6031('0xb')],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94[_0x6031('0x29')],'scheduledat':_0x7d5e94[_0x6031('0x19')]?_0x7d5e94[_0x6031('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x7d5e94['priority']?_0x7d5e94['priority']:0x2,'callback':_0x7d5e94[_0x6031('0x2b')]?!![]:![],'callbackuniqueid':_0x7d5e94[_0x6031('0x2b')]?_0x7d5e94[_0x6031('0x2b')]:undefined,'callbackat':_0x7d5e94['callbackUniqueid']?moment()['format'](_0x6031('0x1b')):undefined,'VoiceQueueId':_0x4238eb['id']})[_0x6031('0x2c')](_0x42555b());});}}}})[_0x6031('0x1f')](function(){return _0x2ec361[_0x6031('0x1d')][_0x6031('0x34')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x2ec361['CmList'],'as':_0x6031('0x3a'),'where':{'id':_0x7d5e94[_0x6031('0x29')]}}]})[_0x6031('0x1f')](function(_0x2552c4){if(_0x2552c4){var _0x714801=[];for(var _0x4335e3=0x0,_0x46fcf6;_0x4335e3<_0x2552c4[_0x6031('0x38')];_0x4335e3+=0x1){_0x46fcf6=_0x2552c4[_0x4335e3][_0x6031('0x39')]({'plain':!![]});_0x2ec361[_0x6031('0x3b')][_0x6031('0x33')]({'phone':_0x7d5e94['phone'],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94[_0x6031('0x29')],'VoiceQueueId':_0x46fcf6['id']})[_0x6031('0x2c')](function(_0x27ee71){logger[_0x6031('0x15')](_0x6031('0x3c'),'afterCreate',_0x27ee71[_0x6031('0x3d')]);});}}});})['then'](function(){return _0x2ec361['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x2ec361[_0x6031('0x37')],'as':'Lists','where':{'id':_0x7d5e94['ListId']}}]})[_0x6031('0x1f')](function(_0x47e9d0){if(_0x47e9d0){var _0x2ec220=[];for(var _0x27d7bf=0x0,_0x19ff73;_0x27d7bf<_0x47e9d0[_0x6031('0x38')];_0x27d7bf+=0x1){_0x19ff73=_0x47e9d0[_0x27d7bf][_0x6031('0x39')]({'plain':!![]});switch(_0x19ff73[_0x6031('0x36')]){case _0x6031('0x3e'):_0x5e9bf2(_0x19ff73)[_0x6031('0x2c')](_0x38614c());break;case _0x6031('0x3f'):_0x31b02e(_0x19ff73)[_0x6031('0x2c')](_0x38614c());break;default:_0x2ec361['CmHopper'][_0x6031('0x33')]({'phone':_0x7d5e94['phone'],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94[_0x6031('0x29')],'scheduledat':_0x7d5e94[_0x6031('0x19')]?_0x7d5e94[_0x6031('0x19')]:moment()['format'](_0x6031('0x1b')),'priority':_0x7d5e94[_0x6031('0x2a')]?_0x7d5e94['priority']:0x2,'callback':_0x7d5e94[_0x6031('0x2b')]?!![]:![],'callbackuniqueid':_0x7d5e94[_0x6031('0x2b')]?_0x7d5e94[_0x6031('0x2b')]:undefined,'callbackat':_0x7d5e94[_0x6031('0x2b')]?moment()['format'](_0x6031('0x1b')):undefined,'CampaignId':_0x19ff73['id']})['catch'](_0x38614c());}}}});})[_0x6031('0x1f')](function(){return _0x2ec361[_0x6031('0x40')][_0x6031('0x34')]({'attributes':['id'],'include':[{'model':_0x2ec361[_0x6031('0x37')],'as':'BlackLists','where':{'id':_0x7d5e94[_0x6031('0x29')]}}]})[_0x6031('0x1f')](function(_0xabc9f3){if(_0xabc9f3){var _0x43c70e=[];for(var _0x5d4770=0x0,_0x3b7b1a;_0x5d4770<_0xabc9f3['length'];_0x5d4770+=0x1){_0x3b7b1a=_0xabc9f3[_0x5d4770][_0x6031('0x39')]({'plain':!![]});_0x2ec361[_0x6031('0x3b')][_0x6031('0x33')]({'phone':_0x7d5e94[_0x6031('0xb')],'ContactId':_0x7d5e94['id'],'ListId':_0x7d5e94['ListId'],'CampaignId':_0x3b7b1a['id']})[_0x6031('0x2c')](function(_0xd2cfc6){logger[_0x6031('0x15')](_0x6031('0x3c'),_0x6031('0x17'),_0xd2cfc6[_0x6031('0x3d')]);});}}});})[_0x6031('0x1f')](function(){_0x1af8b6();})[_0x6031('0x2c')](function(_0x5f148c){logger[_0x6031('0x15')](_0x6031('0x3c'),'afterCreate',_0x5f148c[_0x6031('0x3d')]);_0x1af8b6(_0x5f148c);});}else{_0x1af8b6(new Error(_0x6031('0x41')));}},'afterDestroy':function(_0x1d740f,_0xd5ba9e,_0x3c2eef){var _0x5da3bb=_0x4900ad['models'];var _0x33fb1c=_0x1d740f[_0x6031('0x39')]({'plain':!![]});return _0x5da3bb[_0x6031('0x26')]['findAll']({'raw':!![],'where':{'ListId':_0x33fb1c['ListId'],'ContactId':_0x33fb1c['id']}})[_0x6031('0x1f')](function(_0x45663b){if(!_[_0x6031('0x42')](_0x45663b)){var _0x1c72b8=[];for(var _0x26546f=0x0;_0x26546f<_0x45663b[_0x6031('0x38')];_0x26546f+=0x1){var _0x570ef6=_0x5da3bb[_0x6031('0x26')]['destroy']({'where':{'ListId':_0x45663b[_0x26546f]['ListId'],'ContactId':_0x45663b[_0x26546f]['ContactId'],'VoiceQueueId':_0x45663b[_0x26546f][_0x6031('0x43')],'CampaignId':_0x45663b[_0x26546f][_0x6031('0x44')]}});_0x1c72b8[_0x6031('0x45')](_0x570ef6);}return BPromise[_0x6031('0x46')](_0x1c72b8);}})[_0x6031('0x1f')](function(_0x30dbaf){logger[_0x6031('0x47')](_0x6031('0x48'),util[_0x6031('0x18')](_0x30dbaf,{'showHidden':![],'depth':null}));_0x3c2eef();})[_0x6031('0x2c')](function(_0x5af206){logger[_0x6031('0x15')]('[CmContact][afterDestroy][Error]',util[_0x6031('0x18')](_0x5af206,{'showHidden':![],'depth':null}));_0x3c2eef(_0x5af206);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 1bb4ff8..6b63ec9 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x57f8a1,_0x58b8b4){var _0x49122a=function(_0x521169){while(--_0x521169){_0x57f8a1['push'](_0x57f8a1['shift']());}};_0x49122a(++_0x58b8b4);}(_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['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 b118920..6c05e49 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 _0xa74d=['INTEGER','STRING','PHONE','exports'];(function(_0xe0c564,_0x2ff569){var _0x32e0f6=function(_0x3fd0fc){while(--_0x3fd0fc){_0xe0c564['push'](_0xe0c564['shift']());}};_0x32e0f6(++_0x2ff569);}(_0xa74d,0x1cf));var _0xda74=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xa74d[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require('sequelize');module[_0xda74('0x0')]={'CmContactId':{'type':Sequelize[_0xda74('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xda74('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xda74('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xda74('0x2')],'defaultValue':_0xda74('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xda74('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x292e=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x2202b2,_0x5c4d50){var _0x4fe633=function(_0x5d840a){while(--_0x5d840a){_0x2202b2['push'](_0x2202b2['shift']());}};_0x4fe633(++_0x5c4d50);}(_0x292e,0xcb));var _0xe292=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x292e[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xe292('0x0'));module[_0xe292('0x1')]={'CmContactId':{'type':Sequelize[_0xe292('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xe292('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xe292('0x4')},'OrderBy':{'type':Sequelize[_0xe292('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xe292('0x3')],'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 3872e4d..7f20933 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 _0x3250=['CmContactHasItem','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','error','name','send','index'];(function(_0xff6648,_0x40608e){var _0x2b6b96=function(_0x145031){while(--_0x145031){_0xff6648['push'](_0xff6648['shift']());}};_0x2b6b96(++_0x40608e);}(_0x3250,0x1cd));var _0x0325=function(_0x3f959d,_0x2569aa){_0x3f959d=_0x3f959d-0x0;var _0x17cbdc=_0x3250[_0x3f959d];return _0x17cbdc;};'use strict';var emlformat=require(_0x0325('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0325('0x1'));var jsonpatch=require(_0x0325('0x2'));var rp=require(_0x0325('0x3'));var moment=require(_0x0325('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0325('0x5'));var path=require('path');var sox=require(_0x0325('0x6'));var csv=require(_0x0325('0x7'));var ejs=require(_0x0325('0x8'));var fs=require('fs');var fs_extra=require(_0x0325('0x9'));var _=require('lodash');var squel=require(_0x0325('0xa'));var crypto=require('crypto');var jsforce=require(_0x0325('0xb'));var deskjs=require(_0x0325('0xc'));var toCsv=require(_0x0325('0x7'));var querystring=require(_0x0325('0xd'));var Papa=require(_0x0325('0xe'));var Redis=require(_0x0325('0xf'));var authService=require(_0x0325('0x10'));var qs=require(_0x0325('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0325('0x12'));var logger=require('../../config/logger')(_0x0325('0x13'));var utils=require(_0x0325('0x14'));var config=require(_0x0325('0x15'));var licenseUtil=require(_0x0325('0x16'));var db=require(_0x0325('0x17'))['db'];function respondWithStatusCode(_0x3a3164,_0x4f35b5){_0x4f35b5=_0x4f35b5||0xcc;return function(_0x451c87){if(_0x451c87){return _0x3a3164[_0x0325('0x18')](_0x4f35b5);}return _0x3a3164[_0x0325('0x19')](_0x4f35b5)[_0x0325('0x1a')]();};}function respondWithResult(_0x376993,_0x1ba6c9){_0x1ba6c9=_0x1ba6c9||0xc8;return function(_0x2b1074){if(_0x2b1074){return _0x376993[_0x0325('0x19')](_0x1ba6c9)[_0x0325('0x1b')](_0x2b1074);}};}function respondWithFilteredResult(_0x1433d7,_0x504cc6){return function(_0x4ff1f5){if(_0x4ff1f5){var _0x116db4=typeof _0x504cc6[_0x0325('0x1c')]===_0x0325('0x1d')&&typeof _0x504cc6[_0x0325('0x1e')]===_0x0325('0x1d');var _0x43cb5b=_0x4ff1f5['count'];var _0x1388b7=_0x116db4?0x0:_0x504cc6['offset'];var _0x44678a=_0x116db4?_0x4ff1f5[_0x0325('0x1f')]:_0x504cc6[_0x0325('0x1c')]+_0x504cc6[_0x0325('0x1e')];var _0x5a4649;if(_0x44678a>=_0x43cb5b){_0x44678a=_0x43cb5b;_0x5a4649=0xc8;}else{_0x5a4649=0xce;}_0x1433d7[_0x0325('0x19')](_0x5a4649);return _0x1433d7['set'](_0x0325('0x20'),_0x1388b7+'-'+_0x44678a+'/'+_0x43cb5b)[_0x0325('0x1b')](_0x4ff1f5);}return null;};}function patchUpdates(_0x15ec84){return function(_0x592c42){try{jsonpatch['apply'](_0x592c42,_0x15ec84,!![]);}catch(_0x50918f){return BPromise[_0x0325('0x21')](_0x50918f);}return _0x592c42[_0x0325('0x22')]();};}function saveUpdates(_0x1c5dc6,_0x183c9e){return function(_0x2edf02){if(_0x2edf02){return _0x2edf02[_0x0325('0x23')](_0x1c5dc6)[_0x0325('0x24')](function(_0x562996){return _0x562996;});}return null;};}function removeEntity(_0xcf19b4,_0x10153d){return function(_0x5d2745){if(_0x5d2745){return _0x5d2745[_0x0325('0x25')]()[_0x0325('0x24')](function(){var _0x477926=_0x5d2745[_0x0325('0x26')]({'plain':!![]});var _0x2ec30d='CmContactHasItems';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ec30d,'resourceId':_0x477926['id']}})[_0x0325('0x24')](function(){return _0x5d2745;});})[_0x0325('0x24')](function(){_0xcf19b4[_0x0325('0x19')](0xcc)[_0x0325('0x1a')]();});}};}function handleEntityNotFound(_0x222d5a,_0x5025c3){return function(_0x505064){if(!_0x505064){_0x222d5a[_0x0325('0x18')](0x194);}return _0x505064;};}function handleError(_0x280e6a,_0x578eb0){_0x578eb0=_0x578eb0||0x1f4;return function(_0x235934){logger[_0x0325('0x27')](_0x235934['stack']);if(_0x235934[_0x0325('0x28')]){delete _0x235934[_0x0325('0x28')];}_0x280e6a[_0x0325('0x19')](_0x578eb0)[_0x0325('0x29')](_0x235934);};}exports[_0x0325('0x2a')]=function(_0x5713ae,_0x43e443){var _0x43fdd3={},_0x5a3a50={},_0x3ffdc6={'count':0x0,'rows':[]};var _0x18ff83=_['map'](db[_0x0325('0x2b')][_0x0325('0x2c')],function(_0x4afa4f){return{'name':_0x4afa4f[_0x0325('0x2d')],'type':_0x4afa4f[_0x0325('0x2e')][_0x0325('0x2f')]};});_0x5a3a50['model']=_[_0x0325('0x30')](_0x18ff83,_0x0325('0x28'));_0x5a3a50[_0x0325('0x31')]=_[_0x0325('0x32')](_0x5713ae[_0x0325('0x31')]);_0x5a3a50['filters']=_[_0x0325('0x33')](_0x5a3a50[_0x0325('0x34')],_0x5a3a50[_0x0325('0x31')]);_0x43fdd3[_0x0325('0x35')]=_['intersection'](_0x5a3a50[_0x0325('0x34')],qs['fields'](_0x5713ae[_0x0325('0x31')]['fields']));_0x43fdd3[_0x0325('0x35')]=_0x43fdd3[_0x0325('0x35')][_0x0325('0x36')]?_0x43fdd3['attributes']:_0x5a3a50[_0x0325('0x34')];if(!_0x5713ae[_0x0325('0x31')][_0x0325('0x37')](_0x0325('0x38'))){_0x43fdd3[_0x0325('0x1e')]=qs[_0x0325('0x1e')](_0x5713ae['query']['limit']);_0x43fdd3[_0x0325('0x1c')]=qs[_0x0325('0x1c')](_0x5713ae['query'][_0x0325('0x1c')]);}_0x43fdd3[_0x0325('0x39')]=qs[_0x0325('0x3a')](_0x5713ae[_0x0325('0x31')][_0x0325('0x3a')]);_0x43fdd3['where']=qs[_0x0325('0x3b')](_['pick'](_0x5713ae[_0x0325('0x31')],_0x5a3a50[_0x0325('0x3b')]),_0x18ff83);if(_0x5713ae[_0x0325('0x31')][_0x0325('0x3c')]){_0x43fdd3[_0x0325('0x3d')]=_[_0x0325('0x3e')](_0x43fdd3[_0x0325('0x3d')],{'$or':_[_0x0325('0x30')](_0x18ff83,function(_0x1dd99a){if(_0x1dd99a['type']!==_0x0325('0x3f')){var _0x302657={};_0x302657[_0x1dd99a[_0x0325('0x28')]]={'$like':'%'+_0x5713ae[_0x0325('0x31')][_0x0325('0x3c')]+'%'};return _0x302657;}})});}_0x43fdd3=_['merge']({},_0x43fdd3,_0x5713ae[_0x0325('0x40')]);var _0x38d950={'where':_0x43fdd3[_0x0325('0x3d')]};return db[_0x0325('0x2b')][_0x0325('0x1f')](_0x38d950)[_0x0325('0x24')](function(_0x56a5ea){_0x3ffdc6[_0x0325('0x1f')]=_0x56a5ea;if(_0x5713ae[_0x0325('0x31')][_0x0325('0x41')]){_0x43fdd3[_0x0325('0x42')]=[{'all':!![]}];}return db[_0x0325('0x2b')][_0x0325('0x43')](_0x43fdd3);})[_0x0325('0x24')](function(_0x3d498f){_0x3ffdc6[_0x0325('0x44')]=_0x3d498f;return _0x3ffdc6;})['then'](respondWithFilteredResult(_0x43e443,_0x43fdd3))['catch'](handleError(_0x43e443,null));};exports[_0x0325('0x45')]=function(_0x3bbd6d,_0x20fbd7){var _0x407102={'raw':!![],'where':{'id':_0x3bbd6d[_0x0325('0x46')]['id']}},_0xf48268={};_0xf48268[_0x0325('0x34')]=_[_0x0325('0x32')](db[_0x0325('0x2b')]['rawAttributes']);_0xf48268[_0x0325('0x31')]=_[_0x0325('0x32')](_0x3bbd6d[_0x0325('0x31')]);_0xf48268[_0x0325('0x3b')]=_[_0x0325('0x33')](_0xf48268[_0x0325('0x34')],_0xf48268[_0x0325('0x31')]);_0x407102[_0x0325('0x35')]=_['intersection'](_0xf48268['model'],qs[_0x0325('0x47')](_0x3bbd6d[_0x0325('0x31')]['fields']));_0x407102[_0x0325('0x35')]=_0x407102[_0x0325('0x35')][_0x0325('0x36')]?_0x407102['attributes']:_0xf48268['model'];if(_0x3bbd6d['query'][_0x0325('0x41')]){_0x407102[_0x0325('0x42')]=[{'all':!![]}];}_0x407102=_[_0x0325('0x3e')]({},_0x407102,_0x3bbd6d[_0x0325('0x40')]);return db['CmContactHasItem'][_0x0325('0x48')](_0x407102)[_0x0325('0x24')](handleEntityNotFound(_0x20fbd7,null))[_0x0325('0x24')](respondWithResult(_0x20fbd7,null))[_0x0325('0x49')](handleError(_0x20fbd7,null));};exports[_0x0325('0x4a')]=function(_0x104525,_0x44d1e4){return db[_0x0325('0x2b')][_0x0325('0x4a')](_0x104525['body'],{})[_0x0325('0x24')](function(_0x2071f2){var _0x4474dd=_0x104525[_0x0325('0x4b')][_0x0325('0x26')]({'plain':!![]});if(!_0x4474dd)throw new Error(_0x0325('0x4c'));if(_0x4474dd['role']===_0x0325('0x4b')){var _0x254da6=_0x2071f2[_0x0325('0x26')]({'plain':!![]});var _0x2ef449=_0x0325('0x4d');return db[_0x0325('0x4e')][_0x0325('0x48')]({'where':{'name':_0x2ef449,'userProfileId':_0x4474dd[_0x0325('0x4f')]},'raw':!![]})[_0x0325('0x24')](function(_0x2189f1){if(_0x2189f1&&_0x2189f1[_0x0325('0x50')]===0x0){return db[_0x0325('0x51')]['create']({'name':_0x254da6[_0x0325('0x28')],'resourceId':_0x254da6['id'],'type':_0x2189f1[_0x0325('0x28')],'sectionId':_0x2189f1['id']},{})[_0x0325('0x24')](function(){return _0x2071f2;});}else{return _0x2071f2;}})[_0x0325('0x49')](function(_0x4ad52b){logger[_0x0325('0x27')](_0x0325('0x52'),_0x4ad52b);throw _0x4ad52b;});}return _0x2071f2;})[_0x0325('0x24')](respondWithResult(_0x44d1e4,0xc9))['catch'](handleError(_0x44d1e4,null));};exports[_0x0325('0x23')]=function(_0x1234b5,_0x448af2){if(_0x1234b5['body']['id']){delete _0x1234b5[_0x0325('0x53')]['id'];}return db[_0x0325('0x2b')][_0x0325('0x48')]({'where':{'id':_0x1234b5['params']['id']}})[_0x0325('0x24')](handleEntityNotFound(_0x448af2,null))[_0x0325('0x24')](saveUpdates(_0x1234b5[_0x0325('0x53')],null))[_0x0325('0x24')](respondWithResult(_0x448af2,null))[_0x0325('0x49')](handleError(_0x448af2,null));};exports['destroy']=function(_0x45e996,_0x179c79){return db[_0x0325('0x2b')][_0x0325('0x48')]({'where':{'id':_0x45e996[_0x0325('0x46')]['id']}})['then'](handleEntityNotFound(_0x179c79,null))[_0x0325('0x24')](removeEntity(_0x179c79,null))[_0x0325('0x49')](handleError(_0x179c79,null));}; \ No newline at end of file +var _0x283b=['show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','CmContactHasItem','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x283b,0x103));var _0xb283=function(_0x2ab418,_0x1f2849){_0x2ab418=_0x2ab418-0x0;var _0x68f709=_0x283b[_0x2ab418];return _0x68f709;};'use strict';var emlformat=require(_0xb283('0x0'));var rimraf=require(_0xb283('0x1'));var zipdir=require(_0xb283('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb283('0x3'));var moment=require(_0xb283('0x4'));var BPromise=require(_0xb283('0x5'));var Mustache=require(_0xb283('0x6'));var util=require(_0xb283('0x7'));var path=require('path');var sox=require(_0xb283('0x8'));var csv=require('to-csv');var ejs=require(_0xb283('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb283('0xa'));var crypto=require(_0xb283('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb283('0xc'));var toCsv=require(_0xb283('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb283('0xe'));var authService=require(_0xb283('0xf'));var qs=require(_0xb283('0x10'));var as=require(_0xb283('0x11'));var hardwareService=require(_0xb283('0x12'));var logger=require(_0xb283('0x13'))('api');var utils=require(_0xb283('0x14'));var config=require(_0xb283('0x15'));var licenseUtil=require(_0xb283('0x16'));var db=require(_0xb283('0x17'))['db'];function respondWithStatusCode(_0x10237e,_0x442fb1){_0x442fb1=_0x442fb1||0xcc;return function(_0x473bb6){if(_0x473bb6){return _0x10237e[_0xb283('0x18')](_0x442fb1);}return _0x10237e[_0xb283('0x19')](_0x442fb1)['end']();};}function respondWithResult(_0x204aba,_0x2c584e){_0x2c584e=_0x2c584e||0xc8;return function(_0x276a69){if(_0x276a69){return _0x204aba[_0xb283('0x19')](_0x2c584e)[_0xb283('0x1a')](_0x276a69);}};}function respondWithFilteredResult(_0x2489ad,_0x3b474d){return function(_0xe20517){if(_0xe20517){var _0xc9aaea=typeof _0x3b474d[_0xb283('0x1b')]===_0xb283('0x1c')&&typeof _0x3b474d[_0xb283('0x1d')]===_0xb283('0x1c');var _0x2c2497=_0xe20517['count'];var _0xa303fd=_0xc9aaea?0x0:_0x3b474d[_0xb283('0x1b')];var _0x421e36=_0xc9aaea?_0xe20517[_0xb283('0x1e')]:_0x3b474d['offset']+_0x3b474d[_0xb283('0x1d')];var _0x569a7d;if(_0x421e36>=_0x2c2497){_0x421e36=_0x2c2497;_0x569a7d=0xc8;}else{_0x569a7d=0xce;}_0x2489ad[_0xb283('0x19')](_0x569a7d);return _0x2489ad['set'](_0xb283('0x1f'),_0xa303fd+'-'+_0x421e36+'/'+_0x2c2497)[_0xb283('0x1a')](_0xe20517);}return null;};}function patchUpdates(_0x5b85d9){return function(_0x1e424b){try{jsonpatch[_0xb283('0x20')](_0x1e424b,_0x5b85d9,!![]);}catch(_0x31d924){return BPromise[_0xb283('0x21')](_0x31d924);}return _0x1e424b[_0xb283('0x22')]();};}function saveUpdates(_0x4cba2d,_0x4d3016){return function(_0x52d435){if(_0x52d435){return _0x52d435[_0xb283('0x23')](_0x4cba2d)[_0xb283('0x24')](function(_0x20be21){return _0x20be21;});}return null;};}function removeEntity(_0x30bb4f,_0x1c769a){return function(_0x576d9f){if(_0x576d9f){return _0x576d9f[_0xb283('0x25')]()[_0xb283('0x24')](function(){var _0x28441d=_0x576d9f[_0xb283('0x26')]({'plain':!![]});var _0x15361e='CmContactHasItems';return db[_0xb283('0x27')][_0xb283('0x25')]({'where':{'type':_0x15361e,'resourceId':_0x28441d['id']}})[_0xb283('0x24')](function(){return _0x576d9f;});})[_0xb283('0x24')](function(){_0x30bb4f[_0xb283('0x19')](0xcc)[_0xb283('0x28')]();});}};}function handleEntityNotFound(_0x4d8b2f,_0x19a316){return function(_0x5bf4dd){if(!_0x5bf4dd){_0x4d8b2f[_0xb283('0x18')](0x194);}return _0x5bf4dd;};}function handleError(_0x24917e,_0x268299){_0x268299=_0x268299||0x1f4;return function(_0x1f3619){logger[_0xb283('0x29')](_0x1f3619[_0xb283('0x2a')]);if(_0x1f3619[_0xb283('0x2b')]){delete _0x1f3619[_0xb283('0x2b')];}_0x24917e['status'](_0x268299)['send'](_0x1f3619);};}exports[_0xb283('0x2c')]=function(_0x3dd130,_0x5bbd0c){var _0x4d14b6={},_0x44b154={},_0x451738={'count':0x0,'rows':[]};var _0x2a45a6=_[_0xb283('0x2d')](db[_0xb283('0x2e')]['rawAttributes'],function(_0xd4ac7f){return{'name':_0xd4ac7f[_0xb283('0x2f')],'type':_0xd4ac7f[_0xb283('0x30')]['key']};});_0x44b154[_0xb283('0x31')]=_[_0xb283('0x2d')](_0x2a45a6,_0xb283('0x2b'));_0x44b154[_0xb283('0x32')]=_[_0xb283('0x33')](_0x3dd130['query']);_0x44b154[_0xb283('0x34')]=_['intersection'](_0x44b154['model'],_0x44b154[_0xb283('0x32')]);_0x4d14b6['attributes']=_[_0xb283('0x35')](_0x44b154[_0xb283('0x31')],qs[_0xb283('0x36')](_0x3dd130[_0xb283('0x32')][_0xb283('0x36')]));_0x4d14b6[_0xb283('0x37')]=_0x4d14b6['attributes'][_0xb283('0x38')]?_0x4d14b6[_0xb283('0x37')]:_0x44b154[_0xb283('0x31')];if(!_0x3dd130[_0xb283('0x32')][_0xb283('0x39')](_0xb283('0x3a'))){_0x4d14b6[_0xb283('0x1d')]=qs[_0xb283('0x1d')](_0x3dd130[_0xb283('0x32')][_0xb283('0x1d')]);_0x4d14b6[_0xb283('0x1b')]=qs['offset'](_0x3dd130[_0xb283('0x32')][_0xb283('0x1b')]);}_0x4d14b6['order']=qs[_0xb283('0x3b')](_0x3dd130[_0xb283('0x32')]['sort']);_0x4d14b6[_0xb283('0x3c')]=qs['filters'](_[_0xb283('0x3d')](_0x3dd130[_0xb283('0x32')],_0x44b154['filters']),_0x2a45a6);if(_0x3dd130[_0xb283('0x32')][_0xb283('0x3e')]){_0x4d14b6[_0xb283('0x3c')]=_[_0xb283('0x3f')](_0x4d14b6[_0xb283('0x3c')],{'$or':_[_0xb283('0x2d')](_0x2a45a6,function(_0x26b17f){if(_0x26b17f[_0xb283('0x30')]!=='VIRTUAL'){var _0x5519c5={};_0x5519c5[_0x26b17f[_0xb283('0x2b')]]={'$like':'%'+_0x3dd130[_0xb283('0x32')]['filter']+'%'};return _0x5519c5;}})});}_0x4d14b6=_[_0xb283('0x3f')]({},_0x4d14b6,_0x3dd130[_0xb283('0x40')]);var _0xf6df91={'where':_0x4d14b6['where']};return db[_0xb283('0x2e')][_0xb283('0x1e')](_0xf6df91)[_0xb283('0x24')](function(_0x1e15a9){_0x451738[_0xb283('0x1e')]=_0x1e15a9;if(_0x3dd130[_0xb283('0x32')][_0xb283('0x41')]){_0x4d14b6['include']=[{'all':!![]}];}return db[_0xb283('0x2e')][_0xb283('0x42')](_0x4d14b6);})['then'](function(_0x18c900){_0x451738[_0xb283('0x43')]=_0x18c900;return _0x451738;})[_0xb283('0x24')](respondWithFilteredResult(_0x5bbd0c,_0x4d14b6))[_0xb283('0x44')](handleError(_0x5bbd0c,null));};exports[_0xb283('0x45')]=function(_0x3e32b8,_0x45b566){var _0x4fc7fb={'raw':!![],'where':{'id':_0x3e32b8['params']['id']}},_0x393089={};_0x393089[_0xb283('0x31')]=_[_0xb283('0x33')](db[_0xb283('0x2e')][_0xb283('0x46')]);_0x393089[_0xb283('0x32')]=_[_0xb283('0x33')](_0x3e32b8[_0xb283('0x32')]);_0x393089[_0xb283('0x34')]=_[_0xb283('0x35')](_0x393089['model'],_0x393089[_0xb283('0x32')]);_0x4fc7fb[_0xb283('0x37')]=_[_0xb283('0x35')](_0x393089[_0xb283('0x31')],qs[_0xb283('0x36')](_0x3e32b8[_0xb283('0x32')]['fields']));_0x4fc7fb['attributes']=_0x4fc7fb[_0xb283('0x37')]['length']?_0x4fc7fb[_0xb283('0x37')]:_0x393089[_0xb283('0x31')];if(_0x3e32b8[_0xb283('0x32')][_0xb283('0x41')]){_0x4fc7fb[_0xb283('0x47')]=[{'all':!![]}];}_0x4fc7fb=_[_0xb283('0x3f')]({},_0x4fc7fb,_0x3e32b8[_0xb283('0x40')]);return db[_0xb283('0x2e')][_0xb283('0x48')](_0x4fc7fb)[_0xb283('0x24')](handleEntityNotFound(_0x45b566,null))[_0xb283('0x24')](respondWithResult(_0x45b566,null))[_0xb283('0x44')](handleError(_0x45b566,null));};exports[_0xb283('0x49')]=function(_0x38f851,_0x932a33){return db['CmContactHasItem'][_0xb283('0x49')](_0x38f851[_0xb283('0x4a')],{})[_0xb283('0x24')](function(_0x1e2b85){var _0x459b12=_0x38f851[_0xb283('0x4b')][_0xb283('0x26')]({'plain':!![]});if(!_0x459b12)throw new Error(_0xb283('0x4c'));if(_0x459b12[_0xb283('0x4d')]==='user'){var _0x44d114=_0x1e2b85[_0xb283('0x26')]({'plain':!![]});var _0x159224=_0xb283('0x4e');return db['UserProfileSection'][_0xb283('0x48')]({'where':{'name':_0x159224,'userProfileId':_0x459b12['userProfileId']},'raw':!![]})[_0xb283('0x24')](function(_0x44d2cb){if(_0x44d2cb&&_0x44d2cb[_0xb283('0x4f')]===0x0){return db['UserProfileResource'][_0xb283('0x49')]({'name':_0x44d114[_0xb283('0x2b')],'resourceId':_0x44d114['id'],'type':_0x44d2cb[_0xb283('0x2b')],'sectionId':_0x44d2cb['id']},{})['then'](function(){return _0x1e2b85;});}else{return _0x1e2b85;}})[_0xb283('0x44')](function(_0x24bc32){logger[_0xb283('0x29')](_0xb283('0x50'),_0x24bc32);throw _0x24bc32;});}return _0x1e2b85;})[_0xb283('0x24')](respondWithResult(_0x932a33,0xc9))['catch'](handleError(_0x932a33,null));};exports['update']=function(_0x39ecfe,_0x59a6db){if(_0x39ecfe[_0xb283('0x4a')]['id']){delete _0x39ecfe['body']['id'];}return db[_0xb283('0x2e')][_0xb283('0x48')]({'where':{'id':_0x39ecfe[_0xb283('0x51')]['id']}})[_0xb283('0x24')](handleEntityNotFound(_0x59a6db,null))[_0xb283('0x24')](saveUpdates(_0x39ecfe[_0xb283('0x4a')],null))[_0xb283('0x24')](respondWithResult(_0x59a6db,null))[_0xb283('0x44')](handleError(_0x59a6db,null));};exports['destroy']=function(_0x2b731a,_0x3cd494){return db[_0xb283('0x2e')][_0xb283('0x48')]({'where':{'id':_0x2b731a[_0xb283('0x51')]['id']}})[_0xb283('0x24')](handleEntityNotFound(_0x3cd494,null))[_0xb283('0x24')](removeEntity(_0x3cd494,null))[_0xb283('0x44')](handleError(_0x3cd494,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 6b7a212..1386c32 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 _0xb449=['./cmContactHasItem.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb449,0xf3));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(_0x9b44('0x2'))(_0x9b44('0x3'));var moment=require('moment');var BPromise=require(_0x9b44('0x4'));var rp=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(_0x9b44('0x9'));module[_0x9b44('0xa')]=function(_0x208a1d,_0x360a36){return _0x208a1d[_0x9b44('0xb')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ad7=['cm_contact_has_items','api','bluebird','../../config/environment','define','CmContactHasItem'];(function(_0x29dd23,_0x4688e0){var _0x3c74db=function(_0x219d7a){while(--_0x219d7a){_0x29dd23['push'](_0x29dd23['shift']());}};_0x3c74db(++_0x4688e0);}(_0x1ad7,0x151));var _0x71ad=function(_0x391bce,_0x4dcec1){_0x391bce=_0x391bce-0x0;var _0x14075b=_0x1ad7[_0x391bce];return _0x14075b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x71ad('0x0'));var moment=require('moment');var BPromise=require(_0x71ad('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x71ad('0x2'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x3391e1,_0x3be948){return _0x3391e1[_0x71ad('0x3')](_0x71ad('0x4'),attributes,{'tableName':_0x71ad('0x5'),'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 8b4ec20..cefd881 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 _0x9c47=['error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x5ca9d9,_0x124cdd){var _0x1cfd98=function(_0x5ef1a9){while(--_0x5ef1a9){_0x5ca9d9['push'](_0x5ca9d9['shift']());}};_0x1cfd98(++_0x124cdd);}(_0x9c47,0x18d));var _0x79c4=function(_0x1166fb,_0x4b4216){_0x1166fb=_0x1166fb-0x0;var _0x200613=_0x9c47[_0x1166fb];return _0x200613;};'use strict';var _=require(_0x79c4('0x0'));var util=require('util');var moment=require(_0x79c4('0x1'));var BPromise=require(_0x79c4('0x2'));var rs=require(_0x79c4('0x3'));var fs=require('fs');var Redis=require(_0x79c4('0x4'));var db=require(_0x79c4('0x5'))['db'];var utils=require(_0x79c4('0x6'));var logger=require(_0x79c4('0x7'))('rpc');var config=require(_0x79c4('0x8'));var jayson=require(_0x79c4('0x9'));var client=jayson[_0x79c4('0xa')][_0x79c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ca276,_0x50b490,_0x2fda0b){return new BPromise(function(_0x344765,_0x53768f){return client[_0x79c4('0xc')](_0x3ca276,_0x2fda0b)['then'](function(_0x72dafe){logger['info'](_0x79c4('0xd'),_0x50b490,_0x79c4('0xe'));logger[_0x79c4('0xf')](_0x79c4('0x10'),_0x50b490,_0x79c4('0xe'),JSON['stringify'](_0x72dafe));if(_0x72dafe['error']){if(_0x72dafe[_0x79c4('0x11')][_0x79c4('0x12')]===0x1f4){logger[_0x79c4('0x11')](_0x79c4('0xd'),_0x50b490,_0x72dafe[_0x79c4('0x11')][_0x79c4('0x13')]);return _0x53768f(_0x72dafe[_0x79c4('0x11')][_0x79c4('0x13')]);}logger[_0x79c4('0x11')](_0x79c4('0xd'),_0x50b490,_0x72dafe['error']['message']);return _0x344765(_0x72dafe[_0x79c4('0x11')][_0x79c4('0x13')]);}else{logger[_0x79c4('0x14')]('CmContactHasItem,\x20%s,\x20%s',_0x50b490,_0x79c4('0xe'));_0x344765(_0x72dafe[_0x79c4('0x15')][_0x79c4('0x13')]);}})[_0x79c4('0x16')](function(_0x2db500){logger[_0x79c4('0x11')](_0x79c4('0xd'),_0x50b490,_0x2db500);_0x53768f(_0x2db500);});});} \ No newline at end of file +var _0xd89c=['client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xd89c,0xa6));var _0xcd89=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xd89c[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0xcd89('0x0'));var util=require(_0xcd89('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd89('0x2'));var fs=require('fs');var Redis=require(_0xcd89('0x3'));var db=require(_0xcd89('0x4'))['db'];var utils=require(_0xcd89('0x5'));var logger=require(_0xcd89('0x6'))(_0xcd89('0x7'));var config=require(_0xcd89('0x8'));var jayson=require(_0xcd89('0x9'));var client=jayson[_0xcd89('0xa')][_0xcd89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43df8a,_0x7126fc,_0x2f695f){return new BPromise(function(_0x207b81,_0x298d58){return client['request'](_0x43df8a,_0x2f695f)[_0xcd89('0xc')](function(_0x4f7f60){logger[_0xcd89('0xd')](_0xcd89('0xe'),_0x7126fc,_0xcd89('0xf'));logger[_0xcd89('0x10')](_0xcd89('0x11'),_0x7126fc,_0xcd89('0xf'),JSON['stringify'](_0x4f7f60));if(_0x4f7f60[_0xcd89('0x12')]){if(_0x4f7f60['error']['code']===0x1f4){logger[_0xcd89('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x7126fc,_0x4f7f60['error'][_0xcd89('0x13')]);return _0x298d58(_0x4f7f60[_0xcd89('0x12')][_0xcd89('0x13')]);}logger[_0xcd89('0x12')](_0xcd89('0xe'),_0x7126fc,_0x4f7f60['error'][_0xcd89('0x13')]);return _0x207b81(_0x4f7f60[_0xcd89('0x12')][_0xcd89('0x13')]);}else{logger[_0xcd89('0xd')](_0xcd89('0xe'),_0x7126fc,_0xcd89('0xf'));_0x207b81(_0x4f7f60[_0xcd89('0x14')][_0xcd89('0x13')]);}})[_0xcd89('0x15')](function(_0x5231e8){logger['error'](_0xcd89('0xe'),_0x7126fc,_0x5231e8);_0x298d58(_0x5231e8);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index a6bd748..8580505 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 _0xbedc=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbedc,0x10a));var _0xcbed=function(_0x2b2970,_0x2c72c1){_0x2b2970=_0x2b2970-0x0;var _0x981e4f=_0xbedc[_0x2b2970];return _0x981e4f;};'use strict';var multer=require(_0xcbed('0x0'));var util=require(_0xcbed('0x1'));var path=require(_0xcbed('0x2'));var timeout=require(_0xcbed('0x3'));var express=require('express');var router=express[_0xcbed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcbed('0x5'));var interaction=require(_0xcbed('0x6'));var config=require(_0xcbed('0x7'));var controller=require(_0xcbed('0x8'));router[_0xcbed('0x9')]('/',auth[_0xcbed('0xa')](),controller[_0xcbed('0xb')]);router[_0xcbed('0x9')](_0xcbed('0xc'),auth[_0xcbed('0xa')](),controller[_0xcbed('0xd')]);router[_0xcbed('0xe')]('/',auth[_0xcbed('0xa')](),controller[_0xcbed('0xf')]);router[_0xcbed('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcbed('0x11')](_0xcbed('0xc'),auth[_0xcbed('0xa')](),controller['destroy']);module[_0xcbed('0x12')]=router; \ No newline at end of file +var _0x8d03=['put','update','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5953cb,_0x37147e){var _0x2e352e=function(_0x1c8647){while(--_0x1c8647){_0x5953cb['push'](_0x5953cb['shift']());}};_0x2e352e(++_0x37147e);}(_0x8d03,0xd0));var _0x38d0=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x8d03[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x38d0('0x0'));var timeout=require(_0x38d0('0x1'));var express=require('express');var router=express[_0x38d0('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x38d0('0x3'));var config=require(_0x38d0('0x4'));var controller=require(_0x38d0('0x5'));router[_0x38d0('0x6')]('/',auth[_0x38d0('0x7')](),controller[_0x38d0('0x8')]);router[_0x38d0('0x6')](_0x38d0('0x9'),auth['isAuthenticated'](),controller[_0x38d0('0xa')]);router[_0x38d0('0xb')]('/',auth[_0x38d0('0x7')](),controller[_0x38d0('0xc')]);router[_0x38d0('0xd')]('/:id',auth[_0x38d0('0x7')](),controller[_0x38d0('0xe')]);router['delete'](_0x38d0('0x9'),auth[_0x38d0('0x7')](),controller[_0x38d0('0xf')]);module[_0x38d0('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ef1f76c..a83fd0c 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 _0x4cc1=['getDataValue','alias','setDataValue','name','STRING','long','type','select','parse','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL'];(function(_0x58e32c,_0x309781){var _0x481e60=function(_0x5326ab){while(--_0x5326ab){_0x58e32c['push'](_0x58e32c['shift']());}};_0x481e60(++_0x309781);}(_0x4cc1,0xe6));var _0x14cc=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0x4cc1[_0x2dacca];return _0x4e8745;};'use strict';var Sequelize=require(_0x14cc('0x0'));var _=require(_0x14cc('0x1'));module[_0x14cc('0x2')]={'name':{'type':Sequelize[_0x14cc('0x3')],'get':function(_0x1e3da4){return this[_0x14cc('0x4')](_0x14cc('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2ea0c8){this[_0x14cc('0x6')](_0x14cc('0x5'),_0x2ea0c8?_0x2ea0c8:this[_0x14cc('0x4')](_0x14cc('0x7')));}},'type':{'type':Sequelize[_0x14cc('0x8')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x14cc('0x9')),'get':function(){if(this[_0x14cc('0x4')](_0x14cc('0xa'))===_0x14cc('0xb')){return JSON[_0x14cc('0xc')](this[_0x14cc('0x4')]('values'));}else{return this[_0x14cc('0x4')](_0x14cc('0xd'));}},'set':function(_0x1ae009){if(Array['isArray'](_0x1ae009)){this[_0x14cc('0x6')]('values',JSON[_0x14cc('0xe')](_0x1ae009));}else{this[_0x14cc('0x6')](_0x14cc('0xd'),_0x1ae009);}}},'required':{'type':Sequelize[_0x14cc('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x14cc('0x10')](_0x14cc('0x11'))}}; \ No newline at end of file +var _0x5221=['exports','VIRTUAL','getDataValue','alias','STRING','TEXT','type','parse','isArray','setDataValue','values','BOOLEAN','ENUM','voice','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5221,0x167));var _0x1522=function(_0x14366e,_0x3e0ce6){_0x14366e=_0x14366e-0x0;var _0x38e55a=_0x5221[_0x14366e];return _0x38e55a;};'use strict';var Sequelize=require(_0x1522('0x0'));var _=require('lodash');module[_0x1522('0x1')]={'name':{'type':Sequelize[_0x1522('0x2')],'get':function(_0x5ba886){return this[_0x1522('0x3')](_0x1522('0x4'));}},'alias':{'type':Sequelize[_0x1522('0x5')],'allowNull':![],'set':function(_0x53c7f3){this['setDataValue']('alias',_0x53c7f3?_0x53c7f3:this[_0x1522('0x3')]('name'));}},'type':{'type':Sequelize[_0x1522('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x1522('0x6')]('long'),'get':function(){if(this[_0x1522('0x3')](_0x1522('0x7'))==='select'){return JSON[_0x1522('0x8')](this['getDataValue']('values'));}else{return this[_0x1522('0x3')]('values');}},'set':function(_0x22aa31){if(Array[_0x1522('0x9')](_0x22aa31)){this[_0x1522('0xa')](_0x1522('0xb'),JSON['stringify'](_0x22aa31));}else{this[_0x1522('0xa')]('values',_0x22aa31);}}},'required':{'type':Sequelize[_0x1522('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1522('0xd')](_0x1522('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 74136b3..f1a1966 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 _0xf751=['limit','set','apply','save','update','then','destroy','stack','name','send','map','fieldName','type','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','CmCustomField','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','body','sequelize','create','Sequelize','text','TEXT','number','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count'];(function(_0x3d66c9,_0x3077ff){var _0x292af8=function(_0x40745a){while(--_0x40745a){_0x3d66c9['push'](_0x3d66c9['shift']());}};_0x292af8(++_0x3077ff);}(_0xf751,0x132));var _0x1f75=function(_0xefd2fd,_0x3a8047){_0xefd2fd=_0xefd2fd-0x0;var _0x391cbe=_0xf751[_0xefd2fd];return _0x391cbe;};'use strict';var emlformat=require(_0x1f75('0x0'));var rimraf=require(_0x1f75('0x1'));var zipdir=require(_0x1f75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f75('0x3'));var moment=require(_0x1f75('0x4'));var BPromise=require(_0x1f75('0x5'));var Mustache=require(_0x1f75('0x6'));var util=require('util');var path=require(_0x1f75('0x7'));var sox=require(_0x1f75('0x8'));var csv=require('to-csv');var ejs=require(_0x1f75('0x9'));var fs=require('fs');var fs_extra=require(_0x1f75('0xa'));var _=require(_0x1f75('0xb'));var squel=require(_0x1f75('0xc'));var crypto=require(_0x1f75('0xd'));var jsforce=require(_0x1f75('0xe'));var deskjs=require(_0x1f75('0xf'));var toCsv=require(_0x1f75('0x10'));var querystring=require(_0x1f75('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f75('0x12'));var authService=require(_0x1f75('0x13'));var qs=require(_0x1f75('0x14'));var as=require(_0x1f75('0x15'));var hardwareService=require(_0x1f75('0x16'));var logger=require(_0x1f75('0x17'))(_0x1f75('0x18'));var utils=require(_0x1f75('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1f75('0x1a'));var db=require(_0x1f75('0x1b'))['db'];function respondWithStatusCode(_0xfc0ea9,_0x5582da){_0x5582da=_0x5582da||0xcc;return function(_0x325c19){if(_0x325c19){return _0xfc0ea9[_0x1f75('0x1c')](_0x5582da);}return _0xfc0ea9[_0x1f75('0x1d')](_0x5582da)['end']();};}function respondWithResult(_0x3b75b9,_0x586842){_0x586842=_0x586842||0xc8;return function(_0x46e8af){if(_0x46e8af){return _0x3b75b9[_0x1f75('0x1d')](_0x586842)[_0x1f75('0x1e')](_0x46e8af);}};}function respondWithFilteredResult(_0x4286f1,_0x52886f){return function(_0x4c8a20){if(_0x4c8a20){var _0x2db0d9=typeof _0x52886f[_0x1f75('0x1f')]===_0x1f75('0x20')&&typeof _0x52886f['limit']===_0x1f75('0x20');var _0x494522=_0x4c8a20[_0x1f75('0x21')];var _0x3b3c03=_0x2db0d9?0x0:_0x52886f['offset'];var _0x25f3a9=_0x2db0d9?_0x4c8a20['count']:_0x52886f[_0x1f75('0x1f')]+_0x52886f[_0x1f75('0x22')];var _0x4fc6dd;if(_0x25f3a9>=_0x494522){_0x25f3a9=_0x494522;_0x4fc6dd=0xc8;}else{_0x4fc6dd=0xce;}_0x4286f1[_0x1f75('0x1d')](_0x4fc6dd);return _0x4286f1[_0x1f75('0x23')]('Content-Range',_0x3b3c03+'-'+_0x25f3a9+'/'+_0x494522)[_0x1f75('0x1e')](_0x4c8a20);}return null;};}function patchUpdates(_0x5119ba){return function(_0x5d871d){try{jsonpatch[_0x1f75('0x24')](_0x5d871d,_0x5119ba,!![]);}catch(_0x2ccdf0){return BPromise['reject'](_0x2ccdf0);}return _0x5d871d[_0x1f75('0x25')]();};}function saveUpdates(_0x512645,_0x4e3892){return function(_0xa57176){if(_0xa57176){return _0xa57176[_0x1f75('0x26')](_0x512645)[_0x1f75('0x27')](function(_0x4bb299){return _0x4bb299;});}return null;};}function removeEntity(_0x355f1a,_0x46b746){return function(_0x55db55){if(_0x55db55){return _0x55db55[_0x1f75('0x28')]()[_0x1f75('0x27')](function(){_0x355f1a[_0x1f75('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44eda3,_0x22e5fb){return function(_0x1ed9ee){if(!_0x1ed9ee){_0x44eda3[_0x1f75('0x1c')](0x194);}return _0x1ed9ee;};}function handleError(_0x131290,_0x569102){_0x569102=_0x569102||0x1f4;return function(_0x541e7f){logger['error'](_0x541e7f[_0x1f75('0x29')]);if(_0x541e7f[_0x1f75('0x2a')]){delete _0x541e7f[_0x1f75('0x2a')];}_0x131290[_0x1f75('0x1d')](_0x569102)[_0x1f75('0x2b')](_0x541e7f);};}exports['index']=function(_0x3253cd,_0x4f1192){var _0x14011f={},_0x2dccdd={},_0x183d00={'count':0x0,'rows':[]};var _0x3e791b=_[_0x1f75('0x2c')](db['CmCustomField']['rawAttributes'],function(_0x596f8f){return{'name':_0x596f8f[_0x1f75('0x2d')],'type':_0x596f8f[_0x1f75('0x2e')]['key']};});_0x2dccdd['model']=_[_0x1f75('0x2f')](_[_0x1f75('0x2c')](_0x3e791b,_0x1f75('0x2a')),['name']);_0x2dccdd[_0x1f75('0x30')]=_[_0x1f75('0x31')](_0x3253cd[_0x1f75('0x30')]);_0x2dccdd[_0x1f75('0x32')]=_[_0x1f75('0x33')](_0x2dccdd[_0x1f75('0x34')],_0x2dccdd[_0x1f75('0x30')]);_0x14011f[_0x1f75('0x35')]=_[_0x1f75('0x33')](_0x2dccdd['model'],qs[_0x1f75('0x36')](_0x3253cd[_0x1f75('0x30')][_0x1f75('0x36')]));_0x14011f[_0x1f75('0x35')]=_0x14011f['attributes'][_0x1f75('0x37')]?_0x14011f[_0x1f75('0x35')]:_0x2dccdd[_0x1f75('0x34')];if(!_0x3253cd[_0x1f75('0x30')][_0x1f75('0x38')](_0x1f75('0x39'))){_0x14011f[_0x1f75('0x22')]=qs[_0x1f75('0x22')](_0x3253cd[_0x1f75('0x30')][_0x1f75('0x22')]);_0x14011f[_0x1f75('0x1f')]=qs[_0x1f75('0x1f')](_0x3253cd['query'][_0x1f75('0x1f')]);}_0x14011f[_0x1f75('0x3a')]=qs['sort'](_0x3253cd[_0x1f75('0x30')]['sort']);_0x14011f[_0x1f75('0x3b')]=qs[_0x1f75('0x32')](_[_0x1f75('0x3c')](_0x3253cd['query'],_0x2dccdd[_0x1f75('0x32')]),_0x3e791b);if(_0x3253cd[_0x1f75('0x30')][_0x1f75('0x3d')]){_0x14011f[_0x1f75('0x3b')]=_[_0x1f75('0x3e')](_0x14011f[_0x1f75('0x3b')],{'$or':_[_0x1f75('0x2c')](_0x3e791b,function(_0x155886){if(_0x155886[_0x1f75('0x2e')]!==_0x1f75('0x3f')){var _0x159049={};_0x159049[_0x155886[_0x1f75('0x2a')]]={'$like':'%'+_0x3253cd['query']['filter']+'%'};return _0x159049;}})});}_0x14011f=_['merge']({},_0x14011f,_0x3253cd[_0x1f75('0x40')]);var _0x399977={'where':_0x14011f[_0x1f75('0x3b')]};return db[_0x1f75('0x41')][_0x1f75('0x21')](_0x399977)['then'](function(_0x11df31){_0x183d00[_0x1f75('0x21')]=_0x11df31;if(_0x3253cd[_0x1f75('0x30')]['includeAll']){_0x14011f['include']=[{'all':!![]}];}return db[_0x1f75('0x41')][_0x1f75('0x42')](_0x14011f);})[_0x1f75('0x27')](function(_0x5452b5){_0x183d00[_0x1f75('0x43')]=_0x5452b5;return _0x183d00;})[_0x1f75('0x27')](respondWithFilteredResult(_0x4f1192,_0x14011f))[_0x1f75('0x44')](handleError(_0x4f1192,null));};exports[_0x1f75('0x45')]=function(_0x3825af,_0x4d9de8){var _0x213d93={'raw':!![],'where':{'id':_0x3825af[_0x1f75('0x46')]['id']}},_0x4768a0={};_0x4768a0[_0x1f75('0x34')]=_['keys'](db[_0x1f75('0x41')][_0x1f75('0x47')]);_0x4768a0[_0x1f75('0x30')]=_[_0x1f75('0x31')](_0x3825af[_0x1f75('0x30')]);_0x4768a0[_0x1f75('0x32')]=_['intersection'](_0x4768a0[_0x1f75('0x34')],_0x4768a0[_0x1f75('0x30')]);_0x213d93[_0x1f75('0x35')]=_[_0x1f75('0x33')](_0x4768a0[_0x1f75('0x34')],qs[_0x1f75('0x36')](_0x3825af[_0x1f75('0x30')][_0x1f75('0x36')]));_0x213d93[_0x1f75('0x35')]=_0x213d93[_0x1f75('0x35')][_0x1f75('0x37')]?_0x213d93[_0x1f75('0x35')]:_0x4768a0['model'];if(_0x3825af[_0x1f75('0x30')][_0x1f75('0x48')]){_0x213d93[_0x1f75('0x49')]=[{'all':!![]}];}_0x213d93=_[_0x1f75('0x3e')]({},_0x213d93,_0x3825af[_0x1f75('0x40')]);return db[_0x1f75('0x41')][_0x1f75('0x4a')](_0x213d93)['then'](handleEntityNotFound(_0x4d9de8,null))['then'](respondWithResult(_0x4d9de8,null))[_0x1f75('0x44')](handleError(_0x4d9de8,null));};exports['update']=function(_0x2b2bae,_0x3756a0){if(_0x2b2bae[_0x1f75('0x4b')]['id']){delete _0x2b2bae[_0x1f75('0x4b')]['id'];}return db[_0x1f75('0x41')]['find']({'where':{'id':_0x2b2bae[_0x1f75('0x46')]['id']}})[_0x1f75('0x27')](handleEntityNotFound(_0x3756a0,null))[_0x1f75('0x27')](saveUpdates(_0x2b2bae[_0x1f75('0x4b')],null))[_0x1f75('0x27')](respondWithResult(_0x3756a0,null))[_0x1f75('0x44')](handleError(_0x3756a0,null));};exports['destroy']=function(_0x5a778e,_0x3b51ac){return db[_0x1f75('0x41')][_0x1f75('0x4a')]({'where':{'id':_0x5a778e[_0x1f75('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b51ac,null))[_0x1f75('0x27')](removeEntity(_0x3b51ac,null))[_0x1f75('0x44')](handleError(_0x3b51ac,null));};exports['create']=function(_0x83a96a,_0x534792){var _0x1e6cd9;return db[_0x1f75('0x4c')]['transaction'](function(_0x5d59d7){return db['CmCustomField'][_0x1f75('0x4d')](_0x83a96a[_0x1f75('0x4b')],{'transaction':_0x5d59d7})[_0x1f75('0x27')](function(_0xf348f6){_0x1e6cd9=_0xf348f6;var _0x25104e={'type':db[_0x1f75('0x4e')]['TEXT'],'transaction':_0x5d59d7};switch(_0x83a96a[_0x1f75('0x4b')][_0x1f75('0x2e')]){case _0x1f75('0x4f'):_0x25104e['type']=db[_0x1f75('0x4e')][_0x1f75('0x50')];break;case _0x1f75('0x51'):_0x25104e['type']=db[_0x1f75('0x4e')]['INTEGER'];break;case'switch':_0x25104e[_0x1f75('0x2e')]=db[_0x1f75('0x4e')]['BOOLEAN'];_0x25104e['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x1f75('0x52')](_0x1f75('0x53'),util[_0x1f75('0x54')]('cf_%d',_0x1e6cd9['id']),_0x25104e);})[_0x1f75('0x27')](function(){return _0x1e6cd9;});})['then'](respondWithResult(_0x534792,0xc9))[_0x1f75('0x44')](handleError(_0x534792,null));}; \ No newline at end of file +var _0xd1d8=['status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','include','body','find','params','sequelize','TEXT','Sequelize','number','INTEGER','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','end'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd1d8,0x1ce));var _0x8d1d=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xd1d8[_0x571c1d];return _0x33c609;};'use strict';var emlformat=require(_0x8d1d('0x0'));var rimraf=require(_0x8d1d('0x1'));var zipdir=require(_0x8d1d('0x2'));var jsonpatch=require(_0x8d1d('0x3'));var rp=require(_0x8d1d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8d1d('0x5'));var util=require(_0x8d1d('0x6'));var path=require('path');var sox=require(_0x8d1d('0x7'));var csv=require(_0x8d1d('0x8'));var ejs=require(_0x8d1d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d1d('0xa'));var squel=require(_0x8d1d('0xb'));var crypto=require(_0x8d1d('0xc'));var jsforce=require(_0x8d1d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8d1d('0x8'));var querystring=require('querystring');var Papa=require(_0x8d1d('0xe'));var Redis=require(_0x8d1d('0xf'));var authService=require(_0x8d1d('0x10'));var qs=require(_0x8d1d('0x11'));var as=require(_0x8d1d('0x12'));var hardwareService=require(_0x8d1d('0x13'));var logger=require(_0x8d1d('0x14'))(_0x8d1d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d1d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e51c4,_0x19078e){_0x19078e=_0x19078e||0xcc;return function(_0x5658c6){if(_0x5658c6){return _0x3e51c4['sendStatus'](_0x19078e);}return _0x3e51c4['status'](_0x19078e)[_0x8d1d('0x17')]();};}function respondWithResult(_0x1080c6,_0x1d6044){_0x1d6044=_0x1d6044||0xc8;return function(_0x35045d){if(_0x35045d){return _0x1080c6[_0x8d1d('0x18')](_0x1d6044)['json'](_0x35045d);}};}function respondWithFilteredResult(_0xfbb1f3,_0x2de18e){return function(_0x5b894c){if(_0x5b894c){var _0x2b8769=typeof _0x2de18e['offset']==='undefined'&&typeof _0x2de18e[_0x8d1d('0x19')]===_0x8d1d('0x1a');var _0x10ff1f=_0x5b894c[_0x8d1d('0x1b')];var _0x1a984e=_0x2b8769?0x0:_0x2de18e[_0x8d1d('0x1c')];var _0x414b2b=_0x2b8769?_0x5b894c[_0x8d1d('0x1b')]:_0x2de18e[_0x8d1d('0x1c')]+_0x2de18e[_0x8d1d('0x19')];var _0x5b3dbf;if(_0x414b2b>=_0x10ff1f){_0x414b2b=_0x10ff1f;_0x5b3dbf=0xc8;}else{_0x5b3dbf=0xce;}_0xfbb1f3[_0x8d1d('0x18')](_0x5b3dbf);return _0xfbb1f3['set'](_0x8d1d('0x1d'),_0x1a984e+'-'+_0x414b2b+'/'+_0x10ff1f)['json'](_0x5b894c);}return null;};}function patchUpdates(_0x4ac6cd){return function(_0x5f33bb){try{jsonpatch[_0x8d1d('0x1e')](_0x5f33bb,_0x4ac6cd,!![]);}catch(_0x2ba24b){return BPromise[_0x8d1d('0x1f')](_0x2ba24b);}return _0x5f33bb[_0x8d1d('0x20')]();};}function saveUpdates(_0x1336f4,_0x5954ef){return function(_0x21ca04){if(_0x21ca04){return _0x21ca04[_0x8d1d('0x21')](_0x1336f4)[_0x8d1d('0x22')](function(_0x515ffb){return _0x515ffb;});}return null;};}function removeEntity(_0x28fe52,_0x34eb30){return function(_0x44f542){if(_0x44f542){return _0x44f542[_0x8d1d('0x23')]()[_0x8d1d('0x22')](function(){_0x28fe52[_0x8d1d('0x18')](0xcc)[_0x8d1d('0x17')]();});}};}function handleEntityNotFound(_0x59cb54,_0x1dd43c){return function(_0xb48b13){if(!_0xb48b13){_0x59cb54[_0x8d1d('0x24')](0x194);}return _0xb48b13;};}function handleError(_0x310d46,_0x44059c){_0x44059c=_0x44059c||0x1f4;return function(_0x4f3b30){logger[_0x8d1d('0x25')](_0x4f3b30['stack']);if(_0x4f3b30[_0x8d1d('0x26')]){delete _0x4f3b30['name'];}_0x310d46[_0x8d1d('0x18')](_0x44059c)[_0x8d1d('0x27')](_0x4f3b30);};}exports['index']=function(_0x109fc8,_0x3bf9e4){var _0x7a4890={},_0x4dcb8d={},_0x590bba={'count':0x0,'rows':[]};var _0x2458af=_[_0x8d1d('0x28')](db[_0x8d1d('0x29')][_0x8d1d('0x2a')],function(_0x21b46b){return{'name':_0x21b46b[_0x8d1d('0x2b')],'type':_0x21b46b[_0x8d1d('0x2c')][_0x8d1d('0x2d')]};});_0x4dcb8d[_0x8d1d('0x2e')]=_[_0x8d1d('0x2f')](_[_0x8d1d('0x28')](_0x2458af,_0x8d1d('0x26')),[_0x8d1d('0x26')]);_0x4dcb8d[_0x8d1d('0x30')]=_['keys'](_0x109fc8['query']);_0x4dcb8d[_0x8d1d('0x31')]=_['intersection'](_0x4dcb8d[_0x8d1d('0x2e')],_0x4dcb8d[_0x8d1d('0x30')]);_0x7a4890[_0x8d1d('0x32')]=_[_0x8d1d('0x33')](_0x4dcb8d[_0x8d1d('0x2e')],qs[_0x8d1d('0x34')](_0x109fc8[_0x8d1d('0x30')][_0x8d1d('0x34')]));_0x7a4890['attributes']=_0x7a4890[_0x8d1d('0x32')][_0x8d1d('0x35')]?_0x7a4890[_0x8d1d('0x32')]:_0x4dcb8d['model'];if(!_0x109fc8[_0x8d1d('0x30')][_0x8d1d('0x36')](_0x8d1d('0x37'))){_0x7a4890[_0x8d1d('0x19')]=qs[_0x8d1d('0x19')](_0x109fc8[_0x8d1d('0x30')][_0x8d1d('0x19')]);_0x7a4890[_0x8d1d('0x1c')]=qs[_0x8d1d('0x1c')](_0x109fc8[_0x8d1d('0x30')][_0x8d1d('0x1c')]);}_0x7a4890[_0x8d1d('0x38')]=qs['sort'](_0x109fc8[_0x8d1d('0x30')][_0x8d1d('0x39')]);_0x7a4890[_0x8d1d('0x3a')]=qs['filters'](_[_0x8d1d('0x3b')](_0x109fc8['query'],_0x4dcb8d[_0x8d1d('0x31')]),_0x2458af);if(_0x109fc8[_0x8d1d('0x30')][_0x8d1d('0x3c')]){_0x7a4890[_0x8d1d('0x3a')]=_[_0x8d1d('0x3d')](_0x7a4890[_0x8d1d('0x3a')],{'$or':_['map'](_0x2458af,function(_0x19cbda){if(_0x19cbda[_0x8d1d('0x2c')]!==_0x8d1d('0x3e')){var _0x583a3c={};_0x583a3c[_0x19cbda[_0x8d1d('0x26')]]={'$like':'%'+_0x109fc8['query'][_0x8d1d('0x3c')]+'%'};return _0x583a3c;}})});}_0x7a4890=_[_0x8d1d('0x3d')]({},_0x7a4890,_0x109fc8[_0x8d1d('0x3f')]);var _0x513b00={'where':_0x7a4890[_0x8d1d('0x3a')]};return db[_0x8d1d('0x29')][_0x8d1d('0x1b')](_0x513b00)[_0x8d1d('0x22')](function(_0x567db1){_0x590bba[_0x8d1d('0x1b')]=_0x567db1;if(_0x109fc8[_0x8d1d('0x30')][_0x8d1d('0x40')]){_0x7a4890['include']=[{'all':!![]}];}return db[_0x8d1d('0x29')]['findAll'](_0x7a4890);})['then'](function(_0x2145d5){_0x590bba[_0x8d1d('0x41')]=_0x2145d5;return _0x590bba;})[_0x8d1d('0x22')](respondWithFilteredResult(_0x3bf9e4,_0x7a4890))[_0x8d1d('0x42')](handleError(_0x3bf9e4,null));};exports['show']=function(_0x55a08d,_0x2fc90b){var _0x1de51f={'raw':!![],'where':{'id':_0x55a08d['params']['id']}},_0x4cea3e={};_0x4cea3e['model']=_[_0x8d1d('0x43')](db[_0x8d1d('0x29')][_0x8d1d('0x2a')]);_0x4cea3e[_0x8d1d('0x30')]=_[_0x8d1d('0x43')](_0x55a08d[_0x8d1d('0x30')]);_0x4cea3e[_0x8d1d('0x31')]=_['intersection'](_0x4cea3e[_0x8d1d('0x2e')],_0x4cea3e['query']);_0x1de51f['attributes']=_['intersection'](_0x4cea3e[_0x8d1d('0x2e')],qs[_0x8d1d('0x34')](_0x55a08d[_0x8d1d('0x30')][_0x8d1d('0x34')]));_0x1de51f[_0x8d1d('0x32')]=_0x1de51f[_0x8d1d('0x32')][_0x8d1d('0x35')]?_0x1de51f[_0x8d1d('0x32')]:_0x4cea3e[_0x8d1d('0x2e')];if(_0x55a08d['query'][_0x8d1d('0x40')]){_0x1de51f[_0x8d1d('0x44')]=[{'all':!![]}];}_0x1de51f=_[_0x8d1d('0x3d')]({},_0x1de51f,_0x55a08d['options']);return db[_0x8d1d('0x29')]['find'](_0x1de51f)[_0x8d1d('0x22')](handleEntityNotFound(_0x2fc90b,null))[_0x8d1d('0x22')](respondWithResult(_0x2fc90b,null))[_0x8d1d('0x42')](handleError(_0x2fc90b,null));};exports[_0x8d1d('0x21')]=function(_0x3e678c,_0x2f93e7){if(_0x3e678c[_0x8d1d('0x45')]['id']){delete _0x3e678c[_0x8d1d('0x45')]['id'];}return db[_0x8d1d('0x29')][_0x8d1d('0x46')]({'where':{'id':_0x3e678c[_0x8d1d('0x47')]['id']}})[_0x8d1d('0x22')](handleEntityNotFound(_0x2f93e7,null))[_0x8d1d('0x22')](saveUpdates(_0x3e678c[_0x8d1d('0x45')],null))[_0x8d1d('0x22')](respondWithResult(_0x2f93e7,null))[_0x8d1d('0x42')](handleError(_0x2f93e7,null));};exports[_0x8d1d('0x23')]=function(_0x14e826,_0x312fd7){return db[_0x8d1d('0x29')]['find']({'where':{'id':_0x14e826['params']['id']}})[_0x8d1d('0x22')](handleEntityNotFound(_0x312fd7,null))['then'](removeEntity(_0x312fd7,null))[_0x8d1d('0x42')](handleError(_0x312fd7,null));};exports['create']=function(_0xcffe3c,_0x55a3e7){var _0x180d88;return db[_0x8d1d('0x48')]['transaction'](function(_0x449b56){return db[_0x8d1d('0x29')]['create'](_0xcffe3c[_0x8d1d('0x45')],{'transaction':_0x449b56})[_0x8d1d('0x22')](function(_0x333103){_0x180d88=_0x333103;var _0x565aa2={'type':db['Sequelize'][_0x8d1d('0x49')],'transaction':_0x449b56};switch(_0xcffe3c['body']['type']){case'text':_0x565aa2[_0x8d1d('0x2c')]=db[_0x8d1d('0x4a')]['TEXT'];break;case _0x8d1d('0x4b'):_0x565aa2[_0x8d1d('0x2c')]=db[_0x8d1d('0x4a')][_0x8d1d('0x4c')];break;case'switch':_0x565aa2[_0x8d1d('0x2c')]=db['Sequelize']['BOOLEAN'];_0x565aa2['defaultValue']=![];break;default:}return db[_0x8d1d('0x48')][_0x8d1d('0x4d')]['addColumn'](_0x8d1d('0x4e'),util[_0x8d1d('0x4f')](_0x8d1d('0x50'),_0x180d88['id']),_0x565aa2);})[_0x8d1d('0x22')](function(){return _0x180d88;});})['then'](respondWithResult(_0x55a3e7,0xc9))['catch'](handleError(_0x55a3e7,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 24ad547..a21534e 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 _0xd5b8=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','define','CmCustomField','cm_custom_fields'];(function(_0x405248,_0x3fb406){var _0x3c5b73=function(_0x383df9){while(--_0x383df9){_0x405248['push'](_0x405248['shift']());}};_0x3c5b73(++_0x3fb406);}(_0xd5b8,0x14a));var _0x8d5b=function(_0x3a7927,_0x1e0251){_0x3a7927=_0x3a7927-0x0;var _0x4791cd=_0xd5b8[_0x3a7927];return _0x4791cd;};'use strict';var _=require(_0x8d5b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d5b('0x1'));var moment=require(_0x8d5b('0x2'));var BPromise=require('bluebird');var rp=require(_0x8d5b('0x3'));var fs=require('fs');var path=require(_0x8d5b('0x4'));var rimraf=require(_0x8d5b('0x5'));var config=require(_0x8d5b('0x6'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x3a426b,_0x197bbc){return _0x3a426b[_0x8d5b('0x7')](_0x8d5b('0x8'),attributes,{'tableName':_0x8d5b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa390=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1414b1,_0x47727e){var _0x196076=function(_0x4d8ef0){while(--_0x4d8ef0){_0x1414b1['push'](_0x1414b1['shift']());}};_0x196076(++_0x47727e);}(_0xa390,0xd9));var _0x0a39=function(_0x57fc14,_0x139b4c){_0x57fc14=_0x57fc14-0x0;var _0x931200=_0xa390[_0x57fc14];return _0x931200;};'use strict';var _=require(_0x0a39('0x0'));var util=require('util');var logger=require(_0x0a39('0x1'))(_0x0a39('0x2'));var moment=require(_0x0a39('0x3'));var BPromise=require(_0x0a39('0x4'));var rp=require(_0x0a39('0x5'));var fs=require('fs');var path=require(_0x0a39('0x6'));var rimraf=require(_0x0a39('0x7'));var config=require(_0x0a39('0x8'));var attributes=require(_0x0a39('0x9'));module[_0x0a39('0xa')]=function(_0x28f84f,_0x2c51f8){return _0x28f84f[_0x0a39('0xb')](_0x0a39('0xc'),attributes,{'tableName':_0x0a39('0xd'),'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 e18e686..4e605e7 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 _0x4de3=['catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x5f0b6d,_0x159fd5){var _0x3dd638=function(_0x2fd6f1){while(--_0x2fd6f1){_0x5f0b6d['push'](_0x5f0b6d['shift']());}};_0x3dd638(++_0x159fd5);}(_0x4de3,0xc7));var _0x34de=function(_0x1f6b75,_0x139039){_0x1f6b75=_0x1f6b75-0x0;var _0x2a3f91=_0x4de3[_0x1f6b75];return _0x2a3f91;};'use strict';var _=require(_0x34de('0x0'));var util=require('util');var moment=require(_0x34de('0x1'));var BPromise=require(_0x34de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x34de('0x4'));var logger=require(_0x34de('0x5'))(_0x34de('0x6'));var config=require(_0x34de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x34de('0x8')][_0x34de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x337556,_0x268b8f,_0x469ec7){return new BPromise(function(_0x21e250,_0x5e45bb){return client[_0x34de('0xa')](_0x337556,_0x469ec7)[_0x34de('0xb')](function(_0x2a793e){logger[_0x34de('0xc')](_0x34de('0xd'),_0x268b8f,_0x34de('0xe'));logger[_0x34de('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x268b8f,'request\x20sent',JSON[_0x34de('0x10')](_0x2a793e));if(_0x2a793e[_0x34de('0x11')]){if(_0x2a793e[_0x34de('0x11')][_0x34de('0x12')]===0x1f4){logger[_0x34de('0x11')]('CmCustomField,\x20%s,\x20%s',_0x268b8f,_0x2a793e[_0x34de('0x11')][_0x34de('0x13')]);return _0x5e45bb(_0x2a793e[_0x34de('0x11')][_0x34de('0x13')]);}logger[_0x34de('0x11')](_0x34de('0xd'),_0x268b8f,_0x2a793e['error'][_0x34de('0x13')]);return _0x21e250(_0x2a793e[_0x34de('0x11')][_0x34de('0x13')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x268b8f,'request\x20sent');_0x21e250(_0x2a793e[_0x34de('0x14')][_0x34de('0x13')]);}})[_0x34de('0x15')](function(_0x3b15ca){logger[_0x34de('0x11')]('CmCustomField,\x20%s,\x20%s',_0x268b8f,_0x3b15ca);_0x5e45bb(_0x3b15ca);});});} \ No newline at end of file +var _0xbd70=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0xbd70,0x72));var _0x0bd7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbd70[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x0bd7('0x0'));var util=require(_0x0bd7('0x1'));var moment=require('moment');var BPromise=require(_0x0bd7('0x2'));var rs=require(_0x0bd7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0bd7('0x4'));var logger=require(_0x0bd7('0x5'))(_0x0bd7('0x6'));var config=require(_0x0bd7('0x7'));var jayson=require(_0x0bd7('0x8'));var client=jayson[_0x0bd7('0x9')][_0x0bd7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fae82,_0x30a2d6,_0x138e5d){return new BPromise(function(_0xb470a5,_0x20a0e6){return client[_0x0bd7('0xb')](_0x1fae82,_0x138e5d)[_0x0bd7('0xc')](function(_0x1d33ac){logger[_0x0bd7('0xd')](_0x0bd7('0xe'),_0x30a2d6,'request\x20sent');logger[_0x0bd7('0xf')](_0x0bd7('0x10'),_0x30a2d6,_0x0bd7('0x11'),JSON[_0x0bd7('0x12')](_0x1d33ac));if(_0x1d33ac[_0x0bd7('0x13')]){if(_0x1d33ac[_0x0bd7('0x13')][_0x0bd7('0x14')]===0x1f4){logger[_0x0bd7('0x13')](_0x0bd7('0xe'),_0x30a2d6,_0x1d33ac[_0x0bd7('0x13')][_0x0bd7('0x15')]);return _0x20a0e6(_0x1d33ac[_0x0bd7('0x13')][_0x0bd7('0x15')]);}logger[_0x0bd7('0x13')](_0x0bd7('0xe'),_0x30a2d6,_0x1d33ac[_0x0bd7('0x13')]['message']);return _0xb470a5(_0x1d33ac[_0x0bd7('0x13')][_0x0bd7('0x15')]);}else{logger[_0x0bd7('0xd')](_0x0bd7('0xe'),_0x30a2d6,_0x0bd7('0x11'));_0xb470a5(_0x1d33ac['result'][_0x0bd7('0x15')]);}})[_0x0bd7('0x16')](function(_0x4f3e2a){logger[_0x0bd7('0x13')](_0x0bd7('0xe'),_0x30a2d6,_0x4f3e2a);_0x20a0e6(_0x4f3e2a);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 9659d80..2787949 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 _0x1ad9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x1ad9,0xdb));var _0x91ad=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x1ad9[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x91ad('0x0'));var util=require(_0x91ad('0x1'));var path=require(_0x91ad('0x2'));var timeout=require(_0x91ad('0x3'));var express=require(_0x91ad('0x4'));var router=express[_0x91ad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91ad('0x6'));var interaction=require(_0x91ad('0x7'));var config=require(_0x91ad('0x8'));var controller=require(_0x91ad('0x9'));router[_0x91ad('0xa')]('/',auth[_0x91ad('0xb')](),controller[_0x91ad('0xc')]);router[_0x91ad('0xa')]('/:id',auth[_0x91ad('0xb')](),controller[_0x91ad('0xd')]);router[_0x91ad('0xe')]('/',auth[_0x91ad('0xb')](),controller[_0x91ad('0xf')]);router[_0x91ad('0x10')](_0x91ad('0x11'),auth[_0x91ad('0xb')](),controller[_0x91ad('0x12')]);router[_0x91ad('0x13')](_0x91ad('0x11'),auth['isAuthenticated'](),controller[_0x91ad('0x14')]);module[_0x91ad('0x15')]=router; \ No newline at end of file +var _0x05dc=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','update','delete','multer','util','path'];(function(_0x806c4,_0x128abb){var _0x29256d=function(_0x4c2283){while(--_0x4c2283){_0x806c4['push'](_0x806c4['shift']());}};_0x29256d(++_0x128abb);}(_0x05dc,0xcd));var _0xc05d=function(_0x32de1c,_0x1b9e3b){_0x32de1c=_0x32de1c-0x0;var _0x34efc5=_0x05dc[_0x32de1c];return _0x34efc5;};'use strict';var multer=require(_0xc05d('0x0'));var util=require(_0xc05d('0x1'));var path=require(_0xc05d('0x2'));var timeout=require(_0xc05d('0x3'));var express=require(_0xc05d('0x4'));var router=express['Router']();var fs_extra=require(_0xc05d('0x5'));var auth=require(_0xc05d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc05d('0x7'));var controller=require('./cmCustomField.controller');router[_0xc05d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc05d('0x8')](_0xc05d('0x9'),auth[_0xc05d('0xa')](),controller[_0xc05d('0xb')]);router[_0xc05d('0xc')]('/',auth[_0xc05d('0xa')](),controller[_0xc05d('0xd')]);router['put'](_0xc05d('0x9'),auth[_0xc05d('0xa')](),controller[_0xc05d('0xe')]);router[_0xc05d('0xf')]('/:id',auth[_0xc05d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 714901b..f7ad4ea 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 _0xd39b=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x540109,_0x395b32){var _0x3df990=function(_0x4b1bf7){while(--_0x4b1bf7){_0x540109['push'](_0x540109['shift']());}};_0x3df990(++_0x395b32);}(_0xd39b,0x17b));var _0xbd39=function(_0xbd57fe,_0xc0dda6){_0xbd57fe=_0xbd57fe-0x0;var _0x13c4a5=_0xd39b[_0xbd57fe];return _0x13c4a5;};'use strict';var moment=require(_0xbd39('0x0'));var Sequelize=require(_0xbd39('0x1'));module[_0xbd39('0x2')]={'phone':{'type':Sequelize[_0xbd39('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xbd39('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbd39('0x5')],'defaultValue':moment()[_0xbd39('0x6')](_0xbd39('0x7'))},'countbusyretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbd39('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbd39('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbd39('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xbd39('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbd39('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbd39('0x8')],'unique':_0xbd39('0xa')},'ListId':{'type':Sequelize[_0xbd39('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xbd39('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xbd39('0x8')],'unique':_0xbd39('0xa')},'CampaignId':{'type':Sequelize[_0xbd39('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xbd39('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbd39('0x3')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xe53f=['INTEGER','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5268c1,_0x155560){var _0x572aa7=function(_0x16de4f){while(--_0x16de4f){_0x5268c1['push'](_0x5268c1['shift']());}};_0x572aa7(++_0x155560);}(_0xe53f,0x67));var _0xfe53=function(_0x21f524,_0x2bdec2){_0x21f524=_0x21f524-0x0;var _0x56d1d8=_0xe53f[_0x21f524];return _0x56d1d8;};'use strict';var moment=require(_0xfe53('0x0'));var Sequelize=require('sequelize');module[_0xfe53('0x1')]={'phone':{'type':Sequelize[_0xfe53('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xfe53('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xfe53('0x4')],'defaultValue':moment()[_0xfe53('0x5')](_0xfe53('0x6'))},'countbusyretry':{'type':Sequelize[_0xfe53('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfe53('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xfe53('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfe53('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfe53('0x4')]},'priority':{'type':Sequelize[_0xfe53('0x7')](0x2)[_0xfe53('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xfe53('0x7')],'unique':_0xfe53('0x9')},'ListId':{'type':Sequelize[_0xfe53('0x7')],'unique':_0xfe53('0x9')},'UserId':{'type':Sequelize[_0xfe53('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xfe53('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xfe53('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xfe53('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfe53('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfe53('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfe53('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xfe53('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xfe53('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xfe53('0x4')],'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 917844e..6d8daf1 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 _0x00bb=['find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','preview','dialPreviewAutoRecallMe','format','value','direction','prev','isEmpty','ASC','dialOrderByScheduledAt','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','hopperIds','priority','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getPreviewRecall','transaction','recallme','getOpenContacts','outbound','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','api','../../mysqldb','status','offset','undefined','limit','count','json','update','then','sendStatus','error','name','send','index','CmHopper','rawAttributes','type','model','map','query','intersection','filters','concat','$and','$or','$gte','$lt','$lte','$ne','$between','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys'];(function(_0x5eb9e4,_0xfe886d){var _0xf661a4=function(_0x4aaa95){while(--_0x4aaa95){_0x5eb9e4['push'](_0x5eb9e4['shift']());}};_0xf661a4(++_0xfe886d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var qs=require(_0xb00b('0x2'));var logger=require('../../config/logger')(_0xb00b('0x3'));var shared=require('../../config/environment');var db=require(_0xb00b('0x4'))['db'];function respondWithResult(_0x464fe7,_0x582ef9){_0x582ef9=_0x582ef9||0xc8;return function(_0x14b5d0){if(_0x14b5d0){return _0x464fe7[_0xb00b('0x5')](_0x582ef9)['json'](_0x14b5d0);}};}function respondWithFilteredResult(_0x574cf8,_0x532ffb){return function(_0x36e363){if(_0x36e363){var _0xf737d0=typeof _0x532ffb[_0xb00b('0x6')]===_0xb00b('0x7')&&typeof _0x532ffb[_0xb00b('0x8')]===_0xb00b('0x7');var _0x5b0c03=_0x36e363['count'];var _0x5154d9=_0xf737d0?0x0:_0x532ffb[_0xb00b('0x6')];var _0x5851d4=_0xf737d0?_0x36e363[_0xb00b('0x9')]:_0x532ffb[_0xb00b('0x6')]+_0x532ffb['limit'];var _0x3182db;if(_0x5851d4>=_0x5b0c03){_0x5851d4=_0x5b0c03;_0x3182db=0xc8;}else{_0x3182db=0xce;}_0x574cf8['status'](_0x3182db);return _0x574cf8['set']('Content-Range',_0x5154d9+'-'+_0x5851d4+'/'+_0x5b0c03)[_0xb00b('0xa')](_0x36e363);}return null;};}function saveUpdates(_0x2d8ddf,_0x1be8aa){return function(_0x466b9b){if(_0x466b9b){return _0x466b9b[_0xb00b('0xb')](_0x2d8ddf)[_0xb00b('0xc')](function(_0x4ada81){return _0x4ada81;});}return null;};}function handleEntityNotFound(_0x218de2,_0xb0d42e){return function(_0x482fe6){if(!_0x482fe6){_0x218de2[_0xb00b('0xd')](0x194);}return _0x482fe6;};}function handleError(_0x1084a6,_0x540b79){_0x540b79=_0x540b79||0x1f4;return function(_0x5da36b){logger[_0xb00b('0xe')](_0x5da36b['stack']);if(_0x5da36b['name']){delete _0x5da36b[_0xb00b('0xf')];}_0x1084a6[_0xb00b('0x5')](_0x540b79)[_0xb00b('0x10')](_0x5da36b);};}exports[_0xb00b('0x11')]=function(_0x58d65f,_0x2a7231){var _0x599347={},_0x415f91={},_0x5aa9a0={'count':0x0,'rows':[]};var _0x25d7a0=_['map'](db[_0xb00b('0x12')][_0xb00b('0x13')],function(_0x53ee68){return{'name':_0x53ee68['fieldName'],'type':_0x53ee68[_0xb00b('0x14')]['key']};});_0x415f91[_0xb00b('0x15')]=_[_0xb00b('0x16')](_0x25d7a0,_0xb00b('0xf'));_0x415f91[_0xb00b('0x17')]=_['keys'](_0x58d65f[_0xb00b('0x17')]);_0x415f91['filters']=_[_0xb00b('0x18')](_0x415f91[_0xb00b('0x15')],_0x415f91['query']);_0x415f91[_0xb00b('0x19')]=_[_0xb00b('0x1a')](_0x415f91['filters'],[_0xb00b('0x1b'),_0xb00b('0x1c'),'$gt',_0xb00b('0x1d'),_0xb00b('0x1e'),_0xb00b('0x1f'),_0xb00b('0x20'),'$eq','$not',_0xb00b('0x21'),'$notBetween','$in','$notIn',_0xb00b('0x22'),_0xb00b('0x23'),_0xb00b('0x24'),_0xb00b('0x25'),_0xb00b('0x22'),_0xb00b('0x26'),_0xb00b('0x27'),'$contained',_0xb00b('0x28')]);_0x599347['attributes']=_[_0xb00b('0x18')](_0x415f91[_0xb00b('0x15')],qs[_0xb00b('0x29')](_0x58d65f['query'][_0xb00b('0x29')]));_0x599347[_0xb00b('0x2a')]=_0x599347[_0xb00b('0x2a')][_0xb00b('0x2b')]?_0x599347[_0xb00b('0x2a')]:_0x415f91[_0xb00b('0x15')];if(!_0x58d65f[_0xb00b('0x17')][_0xb00b('0x2c')](_0xb00b('0x2d'))){_0x599347['limit']=qs[_0xb00b('0x8')](_0x58d65f[_0xb00b('0x17')]['limit']);_0x599347[_0xb00b('0x6')]=qs[_0xb00b('0x6')](_0x58d65f['query'][_0xb00b('0x6')]);}_0x599347['order']=qs[_0xb00b('0x2e')](_0x58d65f[_0xb00b('0x17')][_0xb00b('0x2e')]);_0x599347[_0xb00b('0x2f')]=qs[_0xb00b('0x19')](_[_0xb00b('0x30')](_0x58d65f[_0xb00b('0x17')],_0x415f91['filters']),_0x25d7a0);if(_0x58d65f['query']['filter']){_0x599347[_0xb00b('0x2f')]=_[_0xb00b('0x31')](_0x599347[_0xb00b('0x2f')],{'$or':_[_0xb00b('0x16')](_0x25d7a0,function(_0x5cfa60){if(_0x5cfa60[_0xb00b('0x14')]!==_0xb00b('0x32')){var _0x341f46={};_0x341f46[_0x5cfa60[_0xb00b('0xf')]]={'$like':'%'+_0x58d65f[_0xb00b('0x17')][_0xb00b('0x33')]+'%'};return _0x341f46;}})});}_0x599347=_[_0xb00b('0x31')]({},_0x599347,_0x58d65f[_0xb00b('0x34')]);var _0x5efc18={'where':_0x599347['where']};return db[_0xb00b('0x12')]['count'](_0x5efc18)[_0xb00b('0xc')](function(_0x1c5400){_0x5aa9a0[_0xb00b('0x9')]=_0x1c5400;if(_0x58d65f[_0xb00b('0x17')][_0xb00b('0x35')]){_0x599347[_0xb00b('0x36')]=[{'all':!![]}];}return db[_0xb00b('0x12')]['findAll'](_0x599347);})[_0xb00b('0xc')](function(_0x25578e){_0x5aa9a0[_0xb00b('0x37')]=_0x25578e;return _0x5aa9a0;})[_0xb00b('0xc')](respondWithFilteredResult(_0x2a7231,_0x599347))[_0xb00b('0x38')](handleError(_0x2a7231,null));};exports[_0xb00b('0x39')]=function(_0x59fb00,_0x36980a){var _0x3beb8f={'raw':!![],'where':{'id':_0x59fb00[_0xb00b('0x3a')]['id']}},_0x4801e7={};_0x4801e7[_0xb00b('0x15')]=_[_0xb00b('0x3b')](db[_0xb00b('0x12')][_0xb00b('0x13')]);_0x4801e7['query']=_[_0xb00b('0x3b')](_0x59fb00[_0xb00b('0x17')]);_0x4801e7[_0xb00b('0x19')]=_[_0xb00b('0x18')](_0x4801e7['model'],_0x4801e7['query']);_0x3beb8f[_0xb00b('0x2a')]=_[_0xb00b('0x18')](_0x4801e7[_0xb00b('0x15')],qs[_0xb00b('0x29')](_0x59fb00[_0xb00b('0x17')][_0xb00b('0x29')]));_0x3beb8f[_0xb00b('0x2a')]=_0x3beb8f['attributes'][_0xb00b('0x2b')]?_0x3beb8f[_0xb00b('0x2a')]:_0x4801e7[_0xb00b('0x15')];if(_0x59fb00[_0xb00b('0x17')][_0xb00b('0x35')]){_0x3beb8f[_0xb00b('0x36')]=[{'all':!![]}];}_0x3beb8f=_[_0xb00b('0x31')]({},_0x3beb8f,_0x59fb00[_0xb00b('0x34')]);return db[_0xb00b('0x12')][_0xb00b('0x3c')](_0x3beb8f)[_0xb00b('0xc')](handleEntityNotFound(_0x36980a,null))[_0xb00b('0xc')](respondWithResult(_0x36980a,null))['catch'](handleError(_0x36980a,null));};exports[_0xb00b('0x3d')]=function(_0x35a0ba,_0xd07fb8){return db[_0xb00b('0x12')][_0xb00b('0x3d')](_0x35a0ba[_0xb00b('0x3e')],{})[_0xb00b('0xc')](respondWithResult(_0xd07fb8,0xc9))[_0xb00b('0x38')](handleError(_0xd07fb8,null));};exports[_0xb00b('0xb')]=function(_0x103320,_0x1eec12){if(_0x103320[_0xb00b('0x3e')]['id']){delete _0x103320['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x103320[_0xb00b('0x3a')]['id']}})[_0xb00b('0xc')](handleEntityNotFound(_0x1eec12,null))['then'](saveUpdates(_0x103320[_0xb00b('0x3e')],null))[_0xb00b('0xc')](respondWithResult(_0x1eec12,null))[_0xb00b('0x38')](handleError(_0x1eec12,null));};exports[_0xb00b('0x3f')]=function(_0x4b62b3,_0x58e9cb){return db[_0xb00b('0x12')][_0xb00b('0x3f')]()['then'](respondWithResult(_0x58e9cb,null))['catch'](handleError(_0x58e9cb,null));};exports[_0xb00b('0x40')]=function(_0x3a205d,_0x4e0be4){var _0x2228e9;var _0x47a814=_0x3a205d['params']['id'];return db['CmHopper'][_0xb00b('0x3c')]({'where':{'id':_0x3a205d['params']['id']}})[_0xb00b('0xc')](handleEntityNotFound(_0x4e0be4,null))[_0xb00b('0xc')](function(_0x4b6482){if(_0x4b6482){return _0x4b6482[_0xb00b('0x40')]()[_0xb00b('0xc')](function(_0xda60ca){return _0xda60ca;});}})['then'](function(_0x5bd40c){_0x2228e9=_0x5bd40c;if(_0x5bd40c){if(_0x5bd40c[_0xb00b('0x41')]||_0x5bd40c[_0xb00b('0x42')]){return db[_0x5bd40c['VoiceQueueId']?_0xb00b('0x43'):_0xb00b('0x44')]['find']({'where':{'id':_0x5bd40c[_0xb00b('0x41')]?_0x5bd40c[_0xb00b('0x41')]:_0x5bd40c[_0xb00b('0x42')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x19f907){var _0x398deb={};if(_0x19f907){_[_0xb00b('0x31')](_0x398deb,_[_0xb00b('0x45')](_0x2228e9['dataValues'],[_0xb00b('0x46'),_0xb00b('0x47'),'id']));_0x398deb['state']=0x15;_0x398deb['statedesc']=_0xb00b('0x48');_0x398deb['campaign']=_0x19f907[_0xb00b('0xf')];_0x398deb[_0xb00b('0x49')]=_0x3a205d[_0xb00b('0x4a')][_0xb00b('0xf')];_0x398deb[_0xb00b('0x4b')]=_0x3a205d[_0xb00b('0x4a')]['id'];_0x398deb['deleted']=!![];_0x398deb[_0xb00b('0x4c')]=moment()['format'](_0xb00b('0x4d'));_0x398deb[_0xb00b('0x4e')]=_0x2228e9[_0xb00b('0x4f')];_0x398deb['campaigntype']=_0x2228e9[_0xb00b('0x41')]?_0xb00b('0x50'):_0xb00b('0x51');return db['CmContact'][_0xb00b('0x3c')]({'where':{'id':_0x398deb[_0xb00b('0x52')]},'attributes':[_0xb00b('0x53'),_0xb00b('0x54')]})[_0xb00b('0xc')](function(_0x279467){if(!_[_0xb00b('0x55')](_0x4e0be4)&&!_[_0xb00b('0x55')](_0x279467['firstName'])){_0x398deb[_0xb00b('0x56')]=_0x279467[_0xb00b('0x53')];if(!_[_0xb00b('0x55')](_0x279467['lastName'])){_0x398deb[_0xb00b('0x56')]+='\x20'+_0x279467[_0xb00b('0x54')];}}})[_0xb00b('0x57')](function(){return db[_0xb00b('0x58')][_0xb00b('0x3d')](_0x398deb);});}})['then'](function(_0xfd4ecc){return db[_0xb00b('0x59')][_0xb00b('0x40')]({'where':{'CmHopperId':_0x47a814}});})[_0xb00b('0xc')](function(){return _0x4e0be4['status'](0xcc)[_0xb00b('0x5a')]();})[_0xb00b('0x38')](handleError(_0x4e0be4,null));};exports[_0xb00b('0x5b')]=function(_0x2d73bb,_0x161216){var _0x1e5ed8=[];return db[_0xb00b('0x5c')]['describe']()[_0xb00b('0xc')](function(_0x502822){_0x1e5ed8=_[_0xb00b('0x3b')](_0x502822);return _0x2d73bb['user'][_0xb00b('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xb00b('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0xb00b('0x5f')],'raw':!![]});})[_0xb00b('0xc')](function(_0x3bae02){if(_0x3bae02&&_0x3bae02['length']){return db['sequelize']['transaction'](function(_0x21a53d){var _0x3126be={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb00b('0x60')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xb00b('0x16')](_0x3bae02,'id')},'$or':[{'UserId':null},{'UserId':_0x2d73bb[_0xb00b('0x4a')]['id']}]};var _0xca87d4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3bae02)[_0xb00b('0x33')]([_0xb00b('0x5f'),0x0])['map']('id')[_0xb00b('0x61')]()},'$or':[{'UserId':null},{'UserId':_0x2d73bb[_0xb00b('0x4a')]['id']}]};var _0x5622a4={'$or':[_0x3126be,_0xca87d4]};var _0xe1316d=[];if(_0x2d73bb[_0xb00b('0x3e')][_0xb00b('0x62')]&&_0x2d73bb['body']['direction']===_0xb00b('0x63')){if(!_[_0xb00b('0x64')](_0x2d73bb[_0xb00b('0x3e')]['hopperIds'])){_0x5622a4['id']={'$in':_0x2d73bb['body']['hopperIds']};}_0xe1316d=[['priority',_0xb00b('0x65')],['scheduledAt',_0x3bae02[0x0][_0xb00b('0x66')]===_0xb00b('0x65')?'DESC':_0xb00b('0x65')],db[_0xb00b('0x67')][_0xb00b('0x68')](_0xb00b('0x69')),['id',_0xb00b('0x6a')]];}else{if(!_['isEmpty'](_0x2d73bb[_0xb00b('0x3e')][_0xb00b('0x6b')])){_0x5622a4['id']={'$notIn':_0x2d73bb[_0xb00b('0x3e')][_0xb00b('0x6b')]};}_0xe1316d=[[_0xb00b('0x6c'),_0xb00b('0x6a')],[_0xb00b('0x6d'),_0x3bae02[0x0]['dialOrderByScheduledAt']],db[_0xb00b('0x67')][_0xb00b('0x68')](_0xb00b('0x6e')),['id',_0xb00b('0x65')]];}return db[_0xb00b('0x12')][_0xb00b('0x6f')]({'attributes':['id',_0xb00b('0x70'),_0xb00b('0x4f'),'recallme'],'where':_0x5622a4,'order':_0xe1316d,'transaction':_0x21a53d,'lock':_0x21a53d[_0xb00b('0x71')][_0xb00b('0x72')],'include':[{'model':db[_0xb00b('0x5c')],'as':_0xb00b('0x73'),'attributes':_0x1e5ed8,'include':[{'model':db[_0xb00b('0x74')],'as':_0xb00b('0x75'),'attributes':['id',_0xb00b('0xf')]}]},{'model':db[_0xb00b('0x76')],'as':'List','attributes':['id',_0xb00b('0xf')]},{'model':db[_0xb00b('0x43')],'as':_0xb00b('0x77'),'attributes':['id',_0xb00b('0xf'),_0xb00b('0x78')]}]})[_0xb00b('0xc')](function(_0x26461a){if(_0x26461a){return _0x26461a['update']({'UserId':_0x2d73bb[_0xb00b('0x4a')]['id']},{'transaction':_0x21a53d});}});});}})[_0xb00b('0xc')](handleEntityNotFound(_0x161216,null))[_0xb00b('0xc')](respondWithResult(_0x161216,null))[_0xb00b('0x38')](handleError(_0x161216,null));};exports[_0xb00b('0x79')]=function(_0x14ccaf,_0x4930f3,_0x39bb6c){var _0x4e95c7=[];var _0x135cbf=_0x14ccaf['params']['id'];var _0x1b255d=_0x14ccaf[_0xb00b('0x4a')]['id'];return db[_0xb00b('0x5c')]['describe']()['then'](function(_0x9ad1c6){_0x4e95c7=_[_0xb00b('0x3b')](_0x9ad1c6);return db[_0xb00b('0x67')][_0xb00b('0x7a')](function(_0x36b3a2){const _0x13e875={'id':_0x135cbf};return db[_0xb00b('0x12')][_0xb00b('0x6f')]({'attributes':['id',_0xb00b('0x70'),_0xb00b('0x7b')],'where':_0x13e875,'transaction':_0x36b3a2,'lock':_0x36b3a2[_0xb00b('0x71')][_0xb00b('0x72')],'include':[{'model':db[_0xb00b('0x5c')],'as':_0xb00b('0x73'),'attributes':_0x4e95c7,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xb00b('0xf')]}]},{'model':db[_0xb00b('0x76')],'as':'List','attributes':['id','name']},{'model':db[_0xb00b('0x43')],'as':_0xb00b('0x77'),'attributes':['id',_0xb00b('0xf'),'dialActive']}]})[_0xb00b('0xc')](function(_0x3f415a){if(_0x3f415a){return _0x3f415a[_0xb00b('0xb')]({'UserId':_0x1b255d},{'transaction':_0x36b3a2});}});});})[_0xb00b('0xc')](handleEntityNotFound(_0x4930f3,null))[_0xb00b('0xc')](respondWithResult(_0x4930f3,null))[_0xb00b('0x38')](handleError(_0x4930f3,null));};exports[_0xb00b('0x7c')]=function(_0x4a9125,_0x4168cf){return _0x4a9125['user'][_0xb00b('0x5d')]({'where':{'type':_0xb00b('0x7d'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xb00b('0xc')](function(_0x1099cb){if(_0x1099cb&&_0x1099cb[_0xb00b('0x2b')]){return db[_0xb00b('0x12')][_0xb00b('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb00b('0x60')](_0xb00b('0x4d'))},'VoiceQueueId':{'$in':_[_0xb00b('0x16')](_0x1099cb,'id')},'$or':[{'UserId':null},{'UserId':_0x4a9125[_0xb00b('0x4a')]['id']}]}});}return 0x0;})[_0xb00b('0xc')](function(_0x2ec3f2){if(!_[_0xb00b('0x55')](_0x2ec3f2)&&_['isNumber'](_0x2ec3f2)){return _0x4168cf[_0xb00b('0x5')](0xc8)[_0xb00b('0xa')]({'contacts':_0x2ec3f2});}else{logger[_0xb00b('0xe')](_0xb00b('0x7e'),'getOpenContacts',0x194,_0xb00b('0x7f'));_0x4168cf[_0xb00b('0xd')](0x194);}})[_0xb00b('0x38')](handleError(_0x4168cf,null));};exports[_0xb00b('0x80')]=function(_0x21471a,_0x5b4d38){var _0x2f1096=shared[_0xb00b('0x81')];var _0xa4fe1e=[];_[_0xb00b('0x16')](_0x2f1096,function(_0x4fb982){_0xa4fe1e[_0xb00b('0x82')]({'id':_0x4fb982['name'],'name':_0x4fb982[_0xb00b('0xf')],'utcOffset':_0x4fb982[_0xb00b('0x83')]});});return _0x5b4d38[_0xb00b('0x5')](0xc8)[_0xb00b('0xa')]({'tz':_0xa4fe1e});};exports[_0xb00b('0x84')]=function(_0x27e051,_0x430e8a){var _0x319977=shared[_0xb00b('0x81')];var _0x1cd071={};if(!_[_0xb00b('0x55')](_0x319977[_0x27e051['body']['id']]))_0x1cd071=_0x319977[_0x27e051[_0xb00b('0x3e')]['id']];return _0x430e8a[_0xb00b('0x5')](0xc8)[_0xb00b('0xa')](_0x1cd071);}; \ No newline at end of file +var _0x8d0a=['$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','map','VIRTUAL','filter','options','CmHopper','count','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','Queue','dialActive','LOCK','CmList','List','getOpenContacts','outbound','isNumber','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','update','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','keys','query','filters','intersection','$and','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains'];(function(_0x1111b6,_0x406ede){var _0x2b4945=function(_0x31ec4f){while(--_0x31ec4f){_0x1111b6['push'](_0x1111b6['shift']());}};_0x2b4945(++_0x406ede);}(_0x8d0a,0x65));var _0xa8d0=function(_0x2cf5af,_0x393bb3){_0x2cf5af=_0x2cf5af-0x0;var _0x5efcc3=_0x8d0a[_0x2cf5af];return _0x5efcc3;};'use strict';var moment=require(_0xa8d0('0x0'));var _=require('lodash');var qs=require(_0xa8d0('0x1'));var logger=require(_0xa8d0('0x2'))(_0xa8d0('0x3'));var shared=require(_0xa8d0('0x4'));var db=require(_0xa8d0('0x5'))['db'];function respondWithResult(_0x477190,_0x528287){_0x528287=_0x528287||0xc8;return function(_0x202833){if(_0x202833){return _0x477190[_0xa8d0('0x6')](_0x528287)['json'](_0x202833);}};}function respondWithFilteredResult(_0x1cac4f,_0x212aaf){return function(_0x1f95a7){if(_0x1f95a7){var _0x1f8b78=typeof _0x212aaf[_0xa8d0('0x7')]==='undefined'&&typeof _0x212aaf['limit']===_0xa8d0('0x8');var _0x823481=_0x1f95a7['count'];var _0x5362af=_0x1f8b78?0x0:_0x212aaf['offset'];var _0x296b54=_0x1f8b78?_0x1f95a7['count']:_0x212aaf[_0xa8d0('0x7')]+_0x212aaf[_0xa8d0('0x9')];var _0x44541e;if(_0x296b54>=_0x823481){_0x296b54=_0x823481;_0x44541e=0xc8;}else{_0x44541e=0xce;}_0x1cac4f[_0xa8d0('0x6')](_0x44541e);return _0x1cac4f[_0xa8d0('0xa')](_0xa8d0('0xb'),_0x5362af+'-'+_0x296b54+'/'+_0x823481)[_0xa8d0('0xc')](_0x1f95a7);}return null;};}function saveUpdates(_0x3bf335,_0x329583){return function(_0x1bfcb6){if(_0x1bfcb6){return _0x1bfcb6[_0xa8d0('0xd')](_0x3bf335)['then'](function(_0x757540){return _0x757540;});}return null;};}function handleEntityNotFound(_0x478f66,_0x5a9193){return function(_0x32ea3e){if(!_0x32ea3e){_0x478f66[_0xa8d0('0xe')](0x194);}return _0x32ea3e;};}function handleError(_0x523ec0,_0x31da9f){_0x31da9f=_0x31da9f||0x1f4;return function(_0x459e9d){logger[_0xa8d0('0xf')](_0x459e9d[_0xa8d0('0x10')]);if(_0x459e9d[_0xa8d0('0x11')]){delete _0x459e9d[_0xa8d0('0x11')];}_0x523ec0['status'](_0x31da9f)[_0xa8d0('0x12')](_0x459e9d);};}exports[_0xa8d0('0x13')]=function(_0x5cf619,_0x2f0b00){var _0x1e325a={},_0x53d168={},_0x32b11a={'count':0x0,'rows':[]};var _0xf9267d=_['map'](db['CmHopper'][_0xa8d0('0x14')],function(_0x25ed8d){return{'name':_0x25ed8d['fieldName'],'type':_0x25ed8d[_0xa8d0('0x15')][_0xa8d0('0x16')]};});_0x53d168[_0xa8d0('0x17')]=_['map'](_0xf9267d,_0xa8d0('0x11'));_0x53d168['query']=_[_0xa8d0('0x18')](_0x5cf619[_0xa8d0('0x19')]);_0x53d168[_0xa8d0('0x1a')]=_[_0xa8d0('0x1b')](_0x53d168[_0xa8d0('0x17')],_0x53d168[_0xa8d0('0x19')]);_0x53d168[_0xa8d0('0x1a')]=_['concat'](_0x53d168['filters'],[_0xa8d0('0x1c'),'$or',_0xa8d0('0x1d'),_0xa8d0('0x1e'),_0xa8d0('0x1f'),_0xa8d0('0x20'),_0xa8d0('0x21'),'$eq',_0xa8d0('0x22'),_0xa8d0('0x23'),_0xa8d0('0x24'),_0xa8d0('0x25'),_0xa8d0('0x26'),_0xa8d0('0x27'),_0xa8d0('0x28'),_0xa8d0('0x29'),'$notILike',_0xa8d0('0x27'),_0xa8d0('0x2a'),_0xa8d0('0x2b'),_0xa8d0('0x2c'),_0xa8d0('0x2d')]);_0x1e325a[_0xa8d0('0x2e')]=_['intersection'](_0x53d168[_0xa8d0('0x17')],qs[_0xa8d0('0x2f')](_0x5cf619[_0xa8d0('0x19')][_0xa8d0('0x2f')]));_0x1e325a['attributes']=_0x1e325a[_0xa8d0('0x2e')][_0xa8d0('0x30')]?_0x1e325a['attributes']:_0x53d168['model'];if(!_0x5cf619[_0xa8d0('0x19')][_0xa8d0('0x31')](_0xa8d0('0x32'))){_0x1e325a[_0xa8d0('0x9')]=qs[_0xa8d0('0x9')](_0x5cf619[_0xa8d0('0x19')][_0xa8d0('0x9')]);_0x1e325a[_0xa8d0('0x7')]=qs[_0xa8d0('0x7')](_0x5cf619[_0xa8d0('0x19')][_0xa8d0('0x7')]);}_0x1e325a[_0xa8d0('0x33')]=qs['sort'](_0x5cf619['query'][_0xa8d0('0x34')]);_0x1e325a['where']=qs[_0xa8d0('0x1a')](_[_0xa8d0('0x35')](_0x5cf619[_0xa8d0('0x19')],_0x53d168[_0xa8d0('0x1a')]),_0xf9267d);if(_0x5cf619[_0xa8d0('0x19')]['filter']){_0x1e325a['where']=_[_0xa8d0('0x36')](_0x1e325a[_0xa8d0('0x37')],{'$or':_[_0xa8d0('0x38')](_0xf9267d,function(_0x1352ed){if(_0x1352ed[_0xa8d0('0x15')]!==_0xa8d0('0x39')){var _0x5b2d5e={};_0x5b2d5e[_0x1352ed[_0xa8d0('0x11')]]={'$like':'%'+_0x5cf619[_0xa8d0('0x19')][_0xa8d0('0x3a')]+'%'};return _0x5b2d5e;}})});}_0x1e325a=_['merge']({},_0x1e325a,_0x5cf619[_0xa8d0('0x3b')]);var _0x4ac500={'where':_0x1e325a[_0xa8d0('0x37')]};return db[_0xa8d0('0x3c')][_0xa8d0('0x3d')](_0x4ac500)[_0xa8d0('0x3e')](function(_0x27515e){_0x32b11a['count']=_0x27515e;if(_0x5cf619[_0xa8d0('0x19')][_0xa8d0('0x3f')]){_0x1e325a[_0xa8d0('0x40')]=[{'all':!![]}];}return db[_0xa8d0('0x3c')][_0xa8d0('0x41')](_0x1e325a);})[_0xa8d0('0x3e')](function(_0x5dea4a){_0x32b11a[_0xa8d0('0x42')]=_0x5dea4a;return _0x32b11a;})[_0xa8d0('0x3e')](respondWithFilteredResult(_0x2f0b00,_0x1e325a))[_0xa8d0('0x43')](handleError(_0x2f0b00,null));};exports[_0xa8d0('0x44')]=function(_0xeba90c,_0x2f5186){var _0x1c1e05={'raw':!![],'where':{'id':_0xeba90c['params']['id']}},_0x10dc8b={};_0x10dc8b[_0xa8d0('0x17')]=_['keys'](db[_0xa8d0('0x3c')][_0xa8d0('0x14')]);_0x10dc8b[_0xa8d0('0x19')]=_[_0xa8d0('0x18')](_0xeba90c[_0xa8d0('0x19')]);_0x10dc8b[_0xa8d0('0x1a')]=_[_0xa8d0('0x1b')](_0x10dc8b[_0xa8d0('0x17')],_0x10dc8b[_0xa8d0('0x19')]);_0x1c1e05[_0xa8d0('0x2e')]=_[_0xa8d0('0x1b')](_0x10dc8b[_0xa8d0('0x17')],qs['fields'](_0xeba90c[_0xa8d0('0x19')][_0xa8d0('0x2f')]));_0x1c1e05[_0xa8d0('0x2e')]=_0x1c1e05[_0xa8d0('0x2e')][_0xa8d0('0x30')]?_0x1c1e05[_0xa8d0('0x2e')]:_0x10dc8b['model'];if(_0xeba90c[_0xa8d0('0x19')][_0xa8d0('0x3f')]){_0x1c1e05[_0xa8d0('0x40')]=[{'all':!![]}];}_0x1c1e05=_[_0xa8d0('0x36')]({},_0x1c1e05,_0xeba90c[_0xa8d0('0x3b')]);return db[_0xa8d0('0x3c')][_0xa8d0('0x45')](_0x1c1e05)[_0xa8d0('0x3e')](handleEntityNotFound(_0x2f5186,null))['then'](respondWithResult(_0x2f5186,null))[_0xa8d0('0x43')](handleError(_0x2f5186,null));};exports['create']=function(_0x3f6760,_0x1ae68b){return db[_0xa8d0('0x3c')][_0xa8d0('0x46')](_0x3f6760['body'],{})[_0xa8d0('0x3e')](respondWithResult(_0x1ae68b,0xc9))[_0xa8d0('0x43')](handleError(_0x1ae68b,null));};exports['update']=function(_0x22be14,_0x4b0d20){if(_0x22be14[_0xa8d0('0x47')]['id']){delete _0x22be14['body']['id'];}return db['CmHopper'][_0xa8d0('0x45')]({'where':{'id':_0x22be14[_0xa8d0('0x48')]['id']}})[_0xa8d0('0x3e')](handleEntityNotFound(_0x4b0d20,null))[_0xa8d0('0x3e')](saveUpdates(_0x22be14['body'],null))[_0xa8d0('0x3e')](respondWithResult(_0x4b0d20,null))[_0xa8d0('0x43')](handleError(_0x4b0d20,null));};exports[_0xa8d0('0x49')]=function(_0x352adc,_0x2258d1){return db['CmHopper'][_0xa8d0('0x49')]()['then'](respondWithResult(_0x2258d1,null))[_0xa8d0('0x43')](handleError(_0x2258d1,null));};exports[_0xa8d0('0x4a')]=function(_0x3dd3ae,_0x5a2aef){var _0x900fd0;var _0x149d65=_0x3dd3ae[_0xa8d0('0x48')]['id'];return db[_0xa8d0('0x3c')][_0xa8d0('0x45')]({'where':{'id':_0x3dd3ae['params']['id']}})[_0xa8d0('0x3e')](handleEntityNotFound(_0x5a2aef,null))[_0xa8d0('0x3e')](function(_0x5329d3){if(_0x5329d3){return _0x5329d3[_0xa8d0('0x4a')]()[_0xa8d0('0x3e')](function(_0x20b617){return _0x20b617;});}})[_0xa8d0('0x3e')](function(_0x2eeed7){_0x900fd0=_0x2eeed7;if(_0x2eeed7){if(_0x2eeed7[_0xa8d0('0x4b')]||_0x2eeed7[_0xa8d0('0x4c')]){return db[_0x2eeed7['VoiceQueueId']?_0xa8d0('0x4d'):'Campaign']['find']({'where':{'id':_0x2eeed7[_0xa8d0('0x4b')]?_0x2eeed7[_0xa8d0('0x4b')]:_0x2eeed7['CampaignId']},'attributes':['id',_0xa8d0('0x11')],'raw':!![]});}}})[_0xa8d0('0x3e')](function(_0x238a3f){var _0x5bc28c={};if(_0x238a3f){_[_0xa8d0('0x36')](_0x5bc28c,_['omit'](_0x900fd0[_0xa8d0('0x4e')],[_0xa8d0('0x4f'),_0xa8d0('0x50'),'id']));_0x5bc28c[_0xa8d0('0x51')]=0x15;_0x5bc28c[_0xa8d0('0x52')]=_0xa8d0('0x53');_0x5bc28c['campaign']=_0x238a3f[_0xa8d0('0x11')];_0x5bc28c[_0xa8d0('0x54')]=_0x3dd3ae[_0xa8d0('0x55')]['name'];_0x5bc28c[_0xa8d0('0x56')]=_0x3dd3ae[_0xa8d0('0x55')]['id'];_0x5bc28c[_0xa8d0('0x53')]=!![];_0x5bc28c[_0xa8d0('0x57')]=moment()[_0xa8d0('0x58')](_0xa8d0('0x59'));_0x5bc28c[_0xa8d0('0x5a')]=_0x900fd0[_0xa8d0('0x5b')];_0x5bc28c[_0xa8d0('0x5c')]=_0x900fd0[_0xa8d0('0x4b')]?_0xa8d0('0x5d'):_0xa8d0('0x5e');return db[_0xa8d0('0x5f')]['find']({'where':{'id':_0x5bc28c[_0xa8d0('0x60')]},'attributes':['firstName',_0xa8d0('0x61')]})['then'](function(_0x575301){if(!_[_0xa8d0('0x62')](_0x5a2aef)&&!_[_0xa8d0('0x62')](_0x575301[_0xa8d0('0x63')])){_0x5bc28c['calleridname']=_0x575301['firstName'];if(!_[_0xa8d0('0x62')](_0x575301[_0xa8d0('0x61')])){_0x5bc28c[_0xa8d0('0x64')]+='\x20'+_0x575301['lastName'];}}})[_0xa8d0('0x65')](function(){return db[_0xa8d0('0x66')][_0xa8d0('0x46')](_0x5bc28c);});}})[_0xa8d0('0x3e')](function(_0x20d3fe){return db[_0xa8d0('0x67')]['destroy']({'where':{'CmHopperId':_0x149d65}});})[_0xa8d0('0x3e')](function(){return _0x5a2aef[_0xa8d0('0x6')](0xcc)[_0xa8d0('0x68')]();})[_0xa8d0('0x43')](handleError(_0x5a2aef,null));};exports[_0xa8d0('0x69')]=function(_0x191df2,_0x3504ac){var _0x3a54a9=[];return db[_0xa8d0('0x5f')][_0xa8d0('0x49')]()['then'](function(_0x2e2237){_0x3a54a9=_[_0xa8d0('0x18')](_0x2e2237);return _0x191df2['user'][_0xa8d0('0x6a')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xa8d0('0x6b')},'attributes':['id',_0xa8d0('0x6c'),_0xa8d0('0x6d')],'raw':!![]});})[_0xa8d0('0x3e')](function(_0x59e607){if(_0x59e607&&_0x59e607['length']){return db[_0xa8d0('0x6e')][_0xa8d0('0x6f')](function(_0x41ebd3){var _0x4820d0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa8d0('0x58')](_0xa8d0('0x59'))},'VoiceQueueId':{'$in':_[_0xa8d0('0x38')](_0x59e607,'id')},'$or':[{'UserId':null},{'UserId':_0x191df2[_0xa8d0('0x55')]['id']}]};var _0x203b29={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x59e607)['filter']([_0xa8d0('0x6d'),0x0])[_0xa8d0('0x38')]('id')[_0xa8d0('0x70')]()},'$or':[{'UserId':null},{'UserId':_0x191df2[_0xa8d0('0x55')]['id']}]};var _0x5a2817={'$or':[_0x4820d0,_0x203b29]};var _0x682412=[];if(_0x191df2[_0xa8d0('0x47')][_0xa8d0('0x71')]&&_0x191df2[_0xa8d0('0x47')]['direction']===_0xa8d0('0x72')){if(!_[_0xa8d0('0x73')](_0x191df2[_0xa8d0('0x47')]['hopperIds'])){_0x5a2817['id']={'$in':_0x191df2[_0xa8d0('0x47')][_0xa8d0('0x74')]};}_0x682412=[[_0xa8d0('0x75'),_0xa8d0('0x76')],[_0xa8d0('0x77'),_0x59e607[0x0]['dialOrderByScheduledAt']===_0xa8d0('0x76')?_0xa8d0('0x78'):'ASC'],db[_0xa8d0('0x6e')][_0xa8d0('0x79')](_0xa8d0('0x7a')),['id',_0xa8d0('0x78')]];}else{if(!_[_0xa8d0('0x73')](_0x191df2[_0xa8d0('0x47')][_0xa8d0('0x74')])){_0x5a2817['id']={'$notIn':_0x191df2['body'][_0xa8d0('0x74')]};}_0x682412=[[_0xa8d0('0x75'),_0xa8d0('0x78')],[_0xa8d0('0x77'),_0x59e607[0x0][_0xa8d0('0x6c')]],db[_0xa8d0('0x6e')][_0xa8d0('0x79')](_0xa8d0('0x7b')),['id','ASC']];}return db[_0xa8d0('0x3c')][_0xa8d0('0x7c')]({'attributes':['id',_0xa8d0('0x7d'),_0xa8d0('0x5b'),_0xa8d0('0x7e')],'where':_0x5a2817,'order':_0x682412,'transaction':_0x41ebd3,'lock':_0x41ebd3['LOCK'][_0xa8d0('0x7f')],'include':[{'model':db[_0xa8d0('0x5f')],'as':_0xa8d0('0x80'),'attributes':_0x3a54a9,'include':[{'model':db[_0xa8d0('0x81')],'as':_0xa8d0('0x82'),'attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xa8d0('0x11')]},{'model':db[_0xa8d0('0x4d')],'as':_0xa8d0('0x83'),'attributes':['id','name',_0xa8d0('0x84')]}]})[_0xa8d0('0x3e')](function(_0x4e373c){if(_0x4e373c){return _0x4e373c[_0xa8d0('0xd')]({'UserId':_0x191df2[_0xa8d0('0x55')]['id']},{'transaction':_0x41ebd3});}});});}})[_0xa8d0('0x3e')](handleEntityNotFound(_0x3504ac,null))['then'](respondWithResult(_0x3504ac,null))['catch'](handleError(_0x3504ac,null));};exports['getPreviewRecall']=function(_0x2e50c5,_0x5ea683,_0x1effc3){var _0x29d2c1=[];var _0x185a62=_0x2e50c5[_0xa8d0('0x48')]['id'];var _0x5c8ce5=_0x2e50c5[_0xa8d0('0x55')]['id'];return db[_0xa8d0('0x5f')][_0xa8d0('0x49')]()['then'](function(_0x37cba8){_0x29d2c1=_[_0xa8d0('0x18')](_0x37cba8);return db[_0xa8d0('0x6e')][_0xa8d0('0x6f')](function(_0x348529){const _0x4509c6={'id':_0x185a62};return db[_0xa8d0('0x3c')][_0xa8d0('0x7c')]({'attributes':['id',_0xa8d0('0x7d'),'recallme'],'where':_0x4509c6,'transaction':_0x348529,'lock':_0x348529[_0xa8d0('0x85')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xa8d0('0x80'),'attributes':_0x29d2c1,'include':[{'model':db[_0xa8d0('0x81')],'as':'Company','attributes':['id','name']}]},{'model':db[_0xa8d0('0x86')],'as':_0xa8d0('0x87'),'attributes':['id',_0xa8d0('0x11')]},{'model':db[_0xa8d0('0x4d')],'as':_0xa8d0('0x83'),'attributes':['id','name','dialActive']}]})[_0xa8d0('0x3e')](function(_0x12ad99){if(_0x12ad99){return _0x12ad99['update']({'UserId':_0x5c8ce5},{'transaction':_0x348529});}});});})[_0xa8d0('0x3e')](handleEntityNotFound(_0x5ea683,null))['then'](respondWithResult(_0x5ea683,null))[_0xa8d0('0x43')](handleError(_0x5ea683,null));};exports[_0xa8d0('0x88')]=function(_0x975558,_0x4dad88){return _0x975558['user']['getVoiceQueues']({'where':{'type':_0xa8d0('0x89'),'dialActive':!![],'dialMethod':_0xa8d0('0x6b')},'attributes':['id'],'raw':!![]})[_0xa8d0('0x3e')](function(_0x1815c8){if(_0x1815c8&&_0x1815c8[_0xa8d0('0x30')]){return db[_0xa8d0('0x3c')][_0xa8d0('0x3d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa8d0('0x59'))},'VoiceQueueId':{'$in':_['map'](_0x1815c8,'id')},'$or':[{'UserId':null},{'UserId':_0x975558[_0xa8d0('0x55')]['id']}]}});}return 0x0;})[_0xa8d0('0x3e')](function(_0x379286){if(!_[_0xa8d0('0x62')](_0x379286)&&_[_0xa8d0('0x8a')](_0x379286)){return _0x4dad88[_0xa8d0('0x6')](0xc8)['json']({'contacts':_0x379286});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0xa8d0('0x88'),0x194,_0xa8d0('0x8b'));_0x4dad88[_0xa8d0('0xe')](0x194);}})[_0xa8d0('0x43')](handleError(_0x4dad88,null));};exports[_0xa8d0('0x8c')]=function(_0x2e439b,_0xfcdf8c){var _0x543521=shared['timezones'];var _0x458af1=[];_[_0xa8d0('0x38')](_0x543521,function(_0x4eb658){_0x458af1[_0xa8d0('0x8d')]({'id':_0x4eb658['name'],'name':_0x4eb658['name'],'utcOffset':_0x4eb658[_0xa8d0('0x8e')]});});return _0xfcdf8c[_0xa8d0('0x6')](0xc8)[_0xa8d0('0xc')]({'tz':_0x458af1});};exports[_0xa8d0('0x8f')]=function(_0x1d8197,_0x2be1ad){var _0x76609=shared[_0xa8d0('0x90')];var _0x4fc9fe={};if(!_[_0xa8d0('0x62')](_0x76609[_0x1d8197['body']['id']]))_0x4fc9fe=_0x76609[_0x1d8197[_0xa8d0('0x47')]['id']];return _0x2be1ad[_0xa8d0('0x6')](0xc8)[_0xa8d0('0xc')](_0x4fc9fe);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index e594e62..f64372a 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 _0xf494=['define','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x4503dc,_0x2007dd){var _0x5a4d80=function(_0x108c9c){while(--_0x108c9c){_0x4503dc['push'](_0x4503dc['shift']());}};_0x5a4d80(++_0x2007dd);}(_0xf494,0x1c6));var _0x4f49=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0xf494[_0x5cfb92];return _0x1cd7c2;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9536=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x9536,0x179));var _0x6953=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x9536[_0x4c8a8f];return _0x404500;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['scheduledat']},{'name':_0x6953('0xe'),'fields':[_0x6953('0xe')]},{'name':_0x6953('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b275f96..24ee1ab 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 _0x9edf=['ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','all','keys','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','CmList','List','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','limit','include','model','attributes','map','then','info','debug','stringify','message','error','ShowCmHopper','where','catch','CreateCmHopper','create','body','UpdateCmHopper','raw','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','User','Agent','voicePause','length','UserId','push','update','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues'];(function(_0x4c1f3a,_0x489fa2){var _0x20e44e=function(_0x365a6b){while(--_0x365a6b){_0x4c1f3a['push'](_0x4c1f3a['shift']());}};_0x20e44e(++_0x489fa2);}(_0x9edf,0x15d));var _0xf9ed=function(_0x48688c,_0x2c3e98){_0x48688c=_0x48688c-0x0;var _0x467f6e=_0x9edf[_0x48688c];return _0x467f6e;};'use strict';var _=require(_0xf9ed('0x0'));var util=require('util');var moment=require(_0xf9ed('0x1'));var BPromise=require(_0xf9ed('0x2'));var db=require(_0xf9ed('0x3'))['db'];var logger=require(_0xf9ed('0x4'))(_0xf9ed('0x5'));exports[_0xf9ed('0x6')]=function(_0x2d83f9){var _0x1122ac=this;return new Promise(function(_0x59fb82,_0x29706a){return db[_0xf9ed('0x7')]['findAll']({'raw':_0x2d83f9[_0xf9ed('0x8')]?_0x2d83f9[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x2d83f9['options']?_0x2d83f9['options']['where']||null:null,'attributes':_0x2d83f9['options']?_0x2d83f9[_0xf9ed('0x8')]['attributes']||null:null,'limit':_0x2d83f9['options']?_0x2d83f9[_0xf9ed('0x8')][_0xf9ed('0x9')]||null:null,'include':_0x2d83f9[_0xf9ed('0x8')]?_0x2d83f9[_0xf9ed('0x8')][_0xf9ed('0xa')]?_['map'](_0x2d83f9[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0x51313d){return{'model':db[_0x51313d[_0xf9ed('0xb')]],'as':_0x51313d['as'],'attributes':_0x51313d[_0xf9ed('0xc')],'include':_0x51313d['include']?_[_0xf9ed('0xd')](_0x51313d['include'],function(_0x4c3f9e){return{'model':db[_0x4c3f9e[_0xf9ed('0xb')]],'as':_0x4c3f9e['as'],'attributes':_0x4c3f9e[_0xf9ed('0xc')],'include':_0x4c3f9e[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x4c3f9e[_0xf9ed('0xa')],function(_0x3af976){return{'model':db[_0x3af976[_0xf9ed('0xb')]],'as':_0x3af976['as'],'attributes':_0x3af976[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0x5ca1c1){logger[_0xf9ed('0xf')]('GetCmHopper',_0x2d83f9);logger[_0xf9ed('0x10')](_0xf9ed('0x6'),_0x2d83f9,JSON[_0xf9ed('0x11')](_0x5ca1c1));_0x59fb82(_0x5ca1c1);})['catch'](function(_0x2841e8){logger['error']('GetCmHopper',_0x2841e8[_0xf9ed('0x12')],_0x2d83f9);_0x29706a(_0x1122ac[_0xf9ed('0x13')](0x1f4,_0x2841e8['message']));});});};exports[_0xf9ed('0x14')]=function(_0x22146f){var _0x257d06=this;return new Promise(function(_0x58e417,_0x47ddfb){return db[_0xf9ed('0x7')]['find']({'raw':_0x22146f['options']?_0x22146f[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x22146f[_0xf9ed('0x8')]?_0x22146f[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x22146f[_0xf9ed('0x8')]?_0x22146f[_0xf9ed('0x8')][_0xf9ed('0xc')]||null:null,'include':_0x22146f[_0xf9ed('0x8')]?_0x22146f[_0xf9ed('0x8')]['include']?_[_0xf9ed('0xd')](_0x22146f[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0xca97fb){return{'model':db[_0xca97fb[_0xf9ed('0xb')]],'as':_0xca97fb['as'],'attributes':_0xca97fb[_0xf9ed('0xc')],'include':_0xca97fb['include']?_['map'](_0xca97fb[_0xf9ed('0xa')],function(_0x20f281){return{'model':db[_0x20f281[_0xf9ed('0xb')]],'as':_0x20f281['as'],'attributes':_0x20f281[_0xf9ed('0xc')],'include':_0x20f281[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x20f281['include'],function(_0x3a6c44){return{'model':db[_0x3a6c44['model']],'as':_0x3a6c44['as'],'attributes':_0x3a6c44[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0x220983){logger[_0xf9ed('0xf')](_0xf9ed('0x14'),_0x22146f);logger[_0xf9ed('0x10')]('ShowCmHopper',_0x22146f,JSON[_0xf9ed('0x11')](_0x220983));_0x58e417(_0x220983);})[_0xf9ed('0x16')](function(_0x48befc){logger[_0xf9ed('0x13')](_0xf9ed('0x14'),_0x48befc[_0xf9ed('0x12')],_0x22146f);_0x47ddfb(_0x257d06[_0xf9ed('0x13')](0x1f4,_0x48befc[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x17')]=function(_0x3bb12f){var _0x387cd5=this;return new Promise(function(_0x55e660,_0x2dc446){return db[_0xf9ed('0x7')][_0xf9ed('0x18')](_0x3bb12f[_0xf9ed('0x19')],{'raw':_0x3bb12f['options']?_0x3bb12f[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![]})[_0xf9ed('0xe')](function(_0xa9c03d){logger['info'](_0xf9ed('0x17'),_0x3bb12f);logger[_0xf9ed('0x10')](_0xf9ed('0x17'),_0x3bb12f,JSON[_0xf9ed('0x11')](_0xa9c03d));_0x55e660(_0xa9c03d);})[_0xf9ed('0x16')](function(_0x34044d){logger[_0xf9ed('0x13')](_0xf9ed('0x17'),_0x34044d[_0xf9ed('0x12')],_0x3bb12f);_0x2dc446(_0x387cd5[_0xf9ed('0x13')](0x1f4,_0x34044d[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x1a')]=function(_0x17b2c1){var _0x5cb3f1=this;return new Promise(function(_0x418990,_0x54d7c0){return db['CmHopper']['update'](_0x17b2c1[_0xf9ed('0x19')],{'raw':_0x17b2c1[_0xf9ed('0x8')]?_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b2c1[_0xf9ed('0x8')]?_0x17b2c1['options'][_0xf9ed('0x15')]||null:null,'attributes':_0x17b2c1[_0xf9ed('0x8')]?_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0xc')]||null:null,'limit':_0x17b2c1['options']?_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0x9')]||null:null})[_0xf9ed('0xe')](function(_0x3d8a54){logger[_0xf9ed('0xf')](_0xf9ed('0x1a'),_0x17b2c1);logger[_0xf9ed('0xf')](_0xf9ed('0x1c'),JSON[_0xf9ed('0x11')](_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0x15')]),_0x17b2c1[_0xf9ed('0x19')][_0xf9ed('0x1d')]);logger['debug'](_0xf9ed('0x1a'),_0x17b2c1,JSON['stringify'](_0x3d8a54));_0x418990(_0x3d8a54);})['catch'](function(_0x26315b){logger['error'](_0xf9ed('0x1a'),_0x26315b[_0xf9ed('0x12')],_0x17b2c1);_0x54d7c0(_0x5cb3f1[_0xf9ed('0x13')](0x1f4,_0x26315b[_0xf9ed('0x12')]));});});};exports['DestroyCmHopper']=function(_0x3a6a5e){var _0x6876f4=this;return new Promise(function(_0xe4a241,_0x1fd299){return db[_0xf9ed('0x7')][_0xf9ed('0x1e')]({'where':_0x3a6a5e[_0xf9ed('0x8')]?_0x3a6a5e['options']['where']||null:null})['then'](function(_0x5c9eac){logger[_0xf9ed('0xf')](_0xf9ed('0x1f'),_0x3a6a5e);logger[_0xf9ed('0x10')]('DestroyCmHopper',_0x3a6a5e,JSON['stringify'](_0x5c9eac));_0xe4a241(_0x5c9eac);})[_0xf9ed('0x16')](function(_0xd85736){logger[_0xf9ed('0x13')](_0xf9ed('0x1f'),_0xd85736[_0xf9ed('0x12')],_0x3a6a5e);_0x1fd299(_0x6876f4[_0xf9ed('0x13')](0x1f4,_0xd85736[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x20')]=function(_0x38aba3){var _0x44f1ea=this;return new Promise(function(_0x142aad,_0x14016f){return db[_0xf9ed('0x21')][_0xf9ed('0x22')]()[_0xf9ed('0xe')](function(_0x28a0e6){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x4f6425){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'where':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3[_0xf9ed('0x8')]['attributes']||null:null,'limit':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3[_0xf9ed('0x8')][_0xf9ed('0x9')]||null:null,'order':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3['options'][_0xf9ed('0x26')]||null:null,'transaction':_0x4f6425,'lock':_0x4f6425[_0xf9ed('0x27')][_0xf9ed('0x28')],'include':[{'model':db['CmContact'],'as':_0xf9ed('0x29'),'attributes':_['keys'](_0x28a0e6)},{'model':db[_0xf9ed('0x2a')],'as':_0xf9ed('0x2b'),'attributes':['id','name',_0xf9ed('0x2c')]}]})[_0xf9ed('0xe')](function(_0x33bbea){var _0x4c30c6=[];var _0x2716ec=[];for(var _0x47ee77=0x0;_0x47ee77<_0x33bbea[_0xf9ed('0x2d')];_0x47ee77+=0x1){var _0x55e66e=_0x33bbea[_0x47ee77][_0xf9ed('0x2e')];if(_0x55e66e===null){_0x4c30c6[_0xf9ed('0x2f')](_0x33bbea[_0x47ee77]['update'](_0x38aba3[_0xf9ed('0x19')],{'transaction':_0x4f6425}));}else if(!_0x2716ec['includes'](_0x55e66e)){_0x2716ec[_0xf9ed('0x2f')](_0x55e66e);_0x4c30c6[_0xf9ed('0x2f')](_0x33bbea[_0x47ee77][_0xf9ed('0x30')](_0x38aba3['body'],{'transaction':_0x4f6425}));}}return BPromise['all'](_0x4c30c6);});})[_0xf9ed('0xe')](function(_0x1d0710){logger[_0xf9ed('0xf')](_0xf9ed('0x20'),_0x38aba3);if(_0x1d0710[_0xf9ed('0x2d')]>0x0){logger[_0xf9ed('0xf')](_0xf9ed('0x31'),_0x1d0710[0x0][_0xf9ed('0x32')]['id'],_0x1d0710[0x0]['dataValues'][_0xf9ed('0x33')],_0x1d0710[0x0][_0xf9ed('0x32')]['active']);}logger[_0xf9ed('0x10')](_0xf9ed('0x20'),_0x38aba3,JSON[_0xf9ed('0x11')](_0x1d0710));_0x142aad(_0x1d0710);})[_0xf9ed('0x16')](function(_0x577d26){logger[_0xf9ed('0x13')](_0xf9ed('0x20'),_0x577d26['message'],_0x38aba3);_0x14016f(_0x44f1ea['error'](0x1f4,_0x577d26[_0xf9ed('0x12')]));});});});};exports[_0xf9ed('0x34')]=function(_0x36b20e){var _0x3b10d7=this;return new Promise(function(_0x2a795a,_0x40c711){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x4b1c1f){return db['CmHopperFinal'][_0xf9ed('0x18')](_0x36b20e[_0xf9ed('0x19')],{'raw':_0x36b20e[_0xf9ed('0x8')]?_0x36b20e[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4b1c1f})[_0xf9ed('0xe')](function(){logger[_0xf9ed('0xf')](_0xf9ed('0x35'),JSON[_0xf9ed('0x11')](_0x36b20e[_0xf9ed('0x8')]['where']),_0x36b20e[_0xf9ed('0x8')]['where'][_0xf9ed('0x1d')]);return db['CmHopper'][_0xf9ed('0x1e')]({'where':_0x36b20e[_0xf9ed('0x8')]?_0x36b20e[_0xf9ed('0x8')]['where']||null:null,'transaction':_0x4b1c1f});});})[_0xf9ed('0xe')](function(_0xfdec8f){logger[_0xf9ed('0xf')](_0xf9ed('0x34'),_0x36b20e);logger['debug']('MoveContactManagedDialer',_0x36b20e,JSON[_0xf9ed('0x11')](_0xfdec8f));_0x2a795a(_0xfdec8f);})[_0xf9ed('0x16')](function(_0x5ae60b){logger['error']('MoveContactManagedDialer',_0x5ae60b[_0xf9ed('0x12')],_0x36b20e);_0x40c711(_0x3b10d7[_0xf9ed('0x13')](0x1f4,_0x5ae60b[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x36')]=function(_0x439dbc){var _0x2f4e97=this;return new Promise(function(_0x389fb5,_0x381b0b){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'raw':_0x439dbc[_0xf9ed('0x8')]?_0x439dbc['options'][_0xf9ed('0x1b')]===undefined?!![]:![]:!![],'where':_0x439dbc['options']?_0x439dbc[_0xf9ed('0x8')]['where']||null:null,'attributes':[[db[_0xf9ed('0x23')]['fn'](_0xf9ed('0x37'),db[_0xf9ed('0x23')]['fn']('IF',db['sequelize'][_0xf9ed('0x38')]('`scheduledat`\x20>=\x20'+util[_0xf9ed('0x39')](_0xf9ed('0x3a'),moment()[_0xf9ed('0x39')](_0xf9ed('0x3b')))+_0xf9ed('0x3c')))),_0xf9ed('0x3d')]]})['then'](function(_0x114fef){logger['info']('CountReScheduled',_0x439dbc);logger[_0xf9ed('0x10')](_0xf9ed('0x36'),_0x439dbc,JSON[_0xf9ed('0x11')](_0x114fef));_0x389fb5(_0x114fef);})[_0xf9ed('0x16')](function(_0x4d37d3){logger['error'](_0xf9ed('0x36'),_0x4d37d3[_0xf9ed('0x12')],_0x439dbc);_0x381b0b(_0x2f4e97[_0xf9ed('0x13')](0x1f4,_0x4d37d3[_0xf9ed('0x12')]));});});};exports['GetContactRecallMe']=function(_0x5d5e12){var _0x33b446=this;return new Promise(function(_0x311371,_0x5a2bd1){return db[_0xf9ed('0x21')][_0xf9ed('0x22')]()[_0xf9ed('0xe')](function(){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x886f7c){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'where':_0x5d5e12[_0xf9ed('0x8')]?_0x5d5e12[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x5d5e12[_0xf9ed('0x8')]?_0x5d5e12[_0xf9ed('0x8')]['attributes']||null:null,'limit':0x1,'order':_0x5d5e12[_0xf9ed('0x8')]?_0x5d5e12['options'][_0xf9ed('0x26')]||null:null,'group':db[_0xf9ed('0x7')][_0xf9ed('0x2e')],'transaction':_0x886f7c,'lock':_0x886f7c[_0xf9ed('0x27')][_0xf9ed('0x28')],'include':_0x5d5e12['options']?_0x5d5e12['options'][_0xf9ed('0xa')]?_['map'](_0x5d5e12[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0x2e26a5){return{'model':db[_0x2e26a5['model']],'as':_0x2e26a5['as'],'attributes':_0x2e26a5['attributes'],'include':_0x2e26a5[_0xf9ed('0xa')]?_['map'](_0x2e26a5[_0xf9ed('0xa')],function(_0x119269){return{'model':db[_0x119269['model']],'as':_0x119269['as'],'attributes':_0x119269['attributes'],'include':_0x119269['include']?_[_0xf9ed('0xd')](_0x119269[_0xf9ed('0xa')],function(_0x401e44){return{'model':db[_0x401e44[_0xf9ed('0xb')]],'as':_0x401e44['as'],'attributes':_0x401e44[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0xae6d96){var _0x49d739=[];for(var _0x560c87=0x0;_0x560c87<_0xae6d96[_0xf9ed('0x2d')];_0x560c87+=0x1){_0x49d739[_0xf9ed('0x2f')](_0xae6d96[_0x560c87][_0xf9ed('0x30')](_0x5d5e12[_0xf9ed('0x19')],{'transaction':_0x886f7c}));}return BPromise[_0xf9ed('0x3e')](_0x49d739);});})[_0xf9ed('0xe')](function(_0x33f8ea){logger[_0xf9ed('0xf')]('GetContactRecallMe',_0x5d5e12);logger[_0xf9ed('0x10')]('GetContactRecallMe',_0x5d5e12,JSON[_0xf9ed('0x11')](_0x33f8ea));_0x311371(_0x33f8ea);})[_0xf9ed('0x16')](function(_0x447bfd){logger['error']('GetContactRecallMe',_0x447bfd[_0xf9ed('0x12')],_0x5d5e12);_0x5a2bd1(_0x33b446[_0xf9ed('0x13')](0x1f4,_0x447bfd[_0xf9ed('0x12')]));});});});};exports['GetCmHopperPreview']=function(_0x297a69){var _0x912bc5=this;return new Promise(function(_0xdf21fd,_0x5a31d4){db['CmContact'][_0xf9ed('0x22')]()[_0xf9ed('0xe')](function(_0x37f9f3){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'raw':_0x297a69[_0xf9ed('0x8')]?_0x297a69['options'][_0xf9ed('0x1b')]===undefined?!![]:![]:!![],'where':_0x297a69['options']?_0x297a69[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x297a69[_0xf9ed('0x8')]?_0x297a69[_0xf9ed('0x8')]['attributes']||null:null,'limit':_0x297a69[_0xf9ed('0x8')]?_0x297a69[_0xf9ed('0x8')]['limit']||null:null,'include':_0x297a69[_0xf9ed('0x8')]?_0x297a69[_0xf9ed('0x8')][_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x297a69[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0x56495e){return{'model':db[_0x56495e['model']],'as':_0x56495e['as'],'attributes':_0x56495e['as']===_0xf9ed('0x29')?_[_0xf9ed('0x3f')](_0x37f9f3):_0x56495e[_0xf9ed('0xc')],'include':_0x56495e[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x56495e[_0xf9ed('0xa')],function(_0x14e447){return{'model':db[_0x14e447[_0xf9ed('0xb')]],'as':_0x14e447['as'],'attributes':_0x14e447[_0xf9ed('0xc')],'include':_0x14e447[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x14e447[_0xf9ed('0xa')],function(_0x1aa569){return{'model':db[_0x1aa569[_0xf9ed('0xb')]],'as':_0x1aa569['as'],'attributes':_0x1aa569[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0x189810){logger[_0xf9ed('0xf')]('GetCmHopper',_0x297a69);logger[_0xf9ed('0x10')](_0xf9ed('0x6'),_0x297a69,JSON[_0xf9ed('0x11')](_0x189810));_0xdf21fd(_0x189810);})[_0xf9ed('0x16')](function(_0x39461a){logger[_0xf9ed('0x13')](_0xf9ed('0x6'),_0x39461a['message'],_0x297a69);_0x5a31d4(_0x912bc5[_0xf9ed('0x13')](0x1f4,_0x39461a[_0xf9ed('0x12')]));});});});};exports[_0xf9ed('0x40')]=function(_0x47bfd9){var _0x124e60=this;return new Promise(function(_0x340320,_0x53a144){return db[_0xf9ed('0x21')][_0xf9ed('0x41')]({'raw':!![],'where':{'phone':_0x47bfd9[_0xf9ed('0x8')][_0xf9ed('0x15')][_0xf9ed('0x42')]},'attributes':['id',_0xf9ed('0x43')],'order':[['id','DESC']]})['then'](function(_0x444a02){logger[_0xf9ed('0xf')]('getContactByPhone',_0x47bfd9);logger[_0xf9ed('0x10')](_0xf9ed('0x44'),_0x47bfd9,JSON[_0xf9ed('0x11')](_0x444a02));_0x340320(_0x444a02);})['catch'](function(_0x266094){logger[_0xf9ed('0x13')](_0xf9ed('0x44'),_0x266094[_0xf9ed('0x12')],_0x47bfd9);_0x53a144(_0x124e60['error'](0x1f4,_0x266094[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x45')]=function(_0x29c410){var _0x500e11=this;return new Promise(function(_0xcbecb1,_0x2eb793){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x57ec55){var _0x3d29bb=_0x29c410[_0xf9ed('0x8')]&&_0x29c410[_0xf9ed('0x8')][_0xf9ed('0x15')]?_0x29c410[_0xf9ed('0x8')][_0xf9ed('0x15')]:{};return db[_0xf9ed('0x7')][_0xf9ed('0x30')](_0x29c410[_0xf9ed('0x19')],{'where':_0x3d29bb,'transaction':_0x57ec55})[_0xf9ed('0xe')](function(_0x39c13e){logger['info'](_0xf9ed('0x45'),_0x29c410);logger[_0xf9ed('0x10')]('ResetActiveCalls',_0x29c410,JSON[_0xf9ed('0x11')](_0x39c13e));_0xcbecb1(_0x39c13e);})[_0xf9ed('0x16')](function(_0x53a50f){logger['error'](_0xf9ed('0x45'),_0x53a50f[_0xf9ed('0x12')],_0x29c410);_0x2eb793(_0x500e11[_0xf9ed('0x13')](0x1f4,_0x53a50f['message']));});});});};exports[_0xf9ed('0x46')]=function(_0x42b82b){var _0x51c95=this;var _0x1a42c9=_0x42b82b[_0xf9ed('0x19')][_0xf9ed('0x15')][_0xf9ed('0x47')];var _0x32ae76=_0x42b82b[_0xf9ed('0x19')][_0xf9ed('0x15')][_0xf9ed('0x48')];var _0x2938c5=_0x42b82b[_0xf9ed('0x19')]['where'][_0xf9ed('0x49')];return new Promise(function(_0x49b327,_0x5097e5){return db['CmHopper'][_0xf9ed('0x25')]({'where':{'voiceQueueId':{'$in':_0x1a42c9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf9ed('0x23')][_0xf9ed('0x38')](_0xf9ed('0x4a')+_0x32ae76+_0xf9ed('0x4b')),'$gt':db[_0xf9ed('0x23')][_0xf9ed('0x38')](_0xf9ed('0x4c'))}},'UserId':{'$in':_0x2938c5}},'include':[{'model':db[_0xf9ed('0x21')],'as':'Contact'},{'model':db[_0xf9ed('0x2a')],'as':_0xf9ed('0x2b'),'attributes':['id',_0xf9ed('0x4d'),_0xf9ed('0x2c')]},{'model':db[_0xf9ed('0x4e')],'as':_0xf9ed('0x4f')}]})['then'](function(_0x37024c){if(_0x37024c[_0xf9ed('0x2d')]>0x0){return db['sequelize'][_0xf9ed('0x24')](function(_0x233082){return db['CmHopper'][_0xf9ed('0x30')]({'recallmeNotifiedDate':db[_0xf9ed('0x23')][_0xf9ed('0x38')]('NOW()')},{'where':{'id':{'$in':_[_0xf9ed('0xd')](_0x37024c,'id')}},'transaction':_0x233082})[_0xf9ed('0xe')](function(){_0x49b327(_0x37024c);})[_0xf9ed('0x16')](function(_0x17a1c1){logger[_0xf9ed('0x13')](_0xf9ed('0x46'),_0x17a1c1[_0xf9ed('0x12')],_0x42b82b);_0x5097e5(_0x51c95[_0xf9ed('0x13')](0x1f4,_0x17a1c1['message']));});})[_0xf9ed('0x16')](function(_0x3f1697){logger[_0xf9ed('0x13')](_0xf9ed('0x46'),_0x3f1697[_0xf9ed('0x12')],_0x42b82b);_0x5097e5(_0x51c95[_0xf9ed('0x13')](0x1f4,_0x3f1697[_0xf9ed('0x12')]));});}else{_0x49b327(_0x37024c);}});});}; \ No newline at end of file +var _0x266a=['name','voicePause','length','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','keys','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','CmList','List','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','options','raw','where','include','map','attributes','model','then','debug','stringify','catch','error','GetCmHopper','message','find','info','ShowCmHopper','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','findAll','limit','order','LOCK','UPDATE','Contact','User'];(function(_0x276c01,_0x9a6503){var _0x39e110=function(_0x3b83a8){while(--_0x3b83a8){_0x276c01['push'](_0x276c01['shift']());}};_0x39e110(++_0x9a6503);}(_0x266a,0x75));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require(_0xa266('0x1'));var moment=require('moment');var BPromise=require(_0xa266('0x2'));var db=require(_0xa266('0x3'))['db'];var logger=require(_0xa266('0x4'))(_0xa266('0x5'));exports['GetCmHopper']=function(_0x2fb3d8){var _0x515b69=this;return new Promise(function(_0x2a1e6f,_0x16fa84){return db[_0xa266('0x6')]['findAll']({'raw':_0x2fb3d8['options']?_0x2fb3d8[_0xa266('0x7')][_0xa266('0x8')]===undefined?!![]:![]:!![],'where':_0x2fb3d8[_0xa266('0x7')]?_0x2fb3d8['options'][_0xa266('0x9')]||null:null,'attributes':_0x2fb3d8[_0xa266('0x7')]?_0x2fb3d8[_0xa266('0x7')]['attributes']||null:null,'limit':_0x2fb3d8[_0xa266('0x7')]?_0x2fb3d8[_0xa266('0x7')]['limit']||null:null,'include':_0x2fb3d8[_0xa266('0x7')]?_0x2fb3d8[_0xa266('0x7')][_0xa266('0xa')]?_[_0xa266('0xb')](_0x2fb3d8[_0xa266('0x7')][_0xa266('0xa')],function(_0x3f9f6e){return{'model':db[_0x3f9f6e['model']],'as':_0x3f9f6e['as'],'attributes':_0x3f9f6e[_0xa266('0xc')],'include':_0x3f9f6e[_0xa266('0xa')]?_[_0xa266('0xb')](_0x3f9f6e[_0xa266('0xa')],function(_0x53d6f0){return{'model':db[_0x53d6f0[_0xa266('0xd')]],'as':_0x53d6f0['as'],'attributes':_0x53d6f0['attributes'],'include':_0x53d6f0[_0xa266('0xa')]?_[_0xa266('0xb')](_0x53d6f0['include'],function(_0x392f3f){return{'model':db[_0x392f3f['model']],'as':_0x392f3f['as'],'attributes':_0x392f3f[_0xa266('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa266('0xe')](function(_0x4637e1){logger['info']('GetCmHopper',_0x2fb3d8);logger[_0xa266('0xf')]('GetCmHopper',_0x2fb3d8,JSON[_0xa266('0x10')](_0x4637e1));_0x2a1e6f(_0x4637e1);})[_0xa266('0x11')](function(_0x69b0c0){logger[_0xa266('0x12')](_0xa266('0x13'),_0x69b0c0[_0xa266('0x14')],_0x2fb3d8);_0x16fa84(_0x515b69[_0xa266('0x12')](0x1f4,_0x69b0c0['message']));});});};exports['ShowCmHopper']=function(_0x2020a5){var _0x3bfdd9=this;return new Promise(function(_0x4e6665,_0x50037b){return db[_0xa266('0x6')][_0xa266('0x15')]({'raw':_0x2020a5[_0xa266('0x7')]?_0x2020a5[_0xa266('0x7')][_0xa266('0x8')]===undefined?!![]:![]:!![],'where':_0x2020a5[_0xa266('0x7')]?_0x2020a5[_0xa266('0x7')]['where']||null:null,'attributes':_0x2020a5[_0xa266('0x7')]?_0x2020a5[_0xa266('0x7')][_0xa266('0xc')]||null:null,'include':_0x2020a5['options']?_0x2020a5[_0xa266('0x7')][_0xa266('0xa')]?_[_0xa266('0xb')](_0x2020a5[_0xa266('0x7')][_0xa266('0xa')],function(_0x471d45){return{'model':db[_0x471d45[_0xa266('0xd')]],'as':_0x471d45['as'],'attributes':_0x471d45[_0xa266('0xc')],'include':_0x471d45[_0xa266('0xa')]?_[_0xa266('0xb')](_0x471d45['include'],function(_0xd701b4){return{'model':db[_0xd701b4['model']],'as':_0xd701b4['as'],'attributes':_0xd701b4[_0xa266('0xc')],'include':_0xd701b4[_0xa266('0xa')]?_[_0xa266('0xb')](_0xd701b4[_0xa266('0xa')],function(_0x38c7c1){return{'model':db[_0x38c7c1[_0xa266('0xd')]],'as':_0x38c7c1['as'],'attributes':_0x38c7c1[_0xa266('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa266('0xe')](function(_0x5a0631){logger[_0xa266('0x16')](_0xa266('0x17'),_0x2020a5);logger[_0xa266('0xf')](_0xa266('0x17'),_0x2020a5,JSON['stringify'](_0x5a0631));_0x4e6665(_0x5a0631);})['catch'](function(_0x9a3b0c){logger[_0xa266('0x12')](_0xa266('0x17'),_0x9a3b0c[_0xa266('0x14')],_0x2020a5);_0x50037b(_0x3bfdd9['error'](0x1f4,_0x9a3b0c[_0xa266('0x14')]));});});};exports['CreateCmHopper']=function(_0xe65713){var _0x4b3a58=this;return new Promise(function(_0x452688,_0x3c9234){return db[_0xa266('0x6')][_0xa266('0x18')](_0xe65713[_0xa266('0x19')],{'raw':_0xe65713[_0xa266('0x7')]?_0xe65713[_0xa266('0x7')]['raw']===undefined?!![]:![]:!![]})[_0xa266('0xe')](function(_0xd9127e){logger[_0xa266('0x16')](_0xa266('0x1a'),_0xe65713);logger[_0xa266('0xf')](_0xa266('0x1a'),_0xe65713,JSON[_0xa266('0x10')](_0xd9127e));_0x452688(_0xd9127e);})[_0xa266('0x11')](function(_0x51a09f){logger['error']('CreateCmHopper',_0x51a09f[_0xa266('0x14')],_0xe65713);_0x3c9234(_0x4b3a58[_0xa266('0x12')](0x1f4,_0x51a09f['message']));});});};exports[_0xa266('0x1b')]=function(_0x123595){var _0x3b04cf=this;return new Promise(function(_0x1a6410,_0x2c3788){return db[_0xa266('0x6')][_0xa266('0x1c')](_0x123595['body'],{'raw':_0x123595['options']?_0x123595['options'][_0xa266('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x123595[_0xa266('0x7')]?_0x123595[_0xa266('0x7')]['where']||null:null,'attributes':_0x123595[_0xa266('0x7')]?_0x123595[_0xa266('0x7')]['attributes']||null:null,'limit':_0x123595[_0xa266('0x7')]?_0x123595[_0xa266('0x7')]['limit']||null:null})[_0xa266('0xe')](function(_0x683888){logger[_0xa266('0x16')]('UpdateCmHopper',_0x123595);logger[_0xa266('0x16')](_0xa266('0x1d'),JSON['stringify'](_0x123595[_0xa266('0x7')][_0xa266('0x9')]),_0x123595[_0xa266('0x19')][_0xa266('0x1e')]);logger[_0xa266('0xf')](_0xa266('0x1b'),_0x123595,JSON[_0xa266('0x10')](_0x683888));_0x1a6410(_0x683888);})['catch'](function(_0x45ec86){logger[_0xa266('0x12')](_0xa266('0x1b'),_0x45ec86[_0xa266('0x14')],_0x123595);_0x2c3788(_0x3b04cf[_0xa266('0x12')](0x1f4,_0x45ec86['message']));});});};exports[_0xa266('0x1f')]=function(_0x198c02){var _0x320a28=this;return new Promise(function(_0x198fc5,_0x55b1e0){return db[_0xa266('0x6')]['destroy']({'where':_0x198c02[_0xa266('0x7')]?_0x198c02[_0xa266('0x7')][_0xa266('0x9')]||null:null})[_0xa266('0xe')](function(_0x12760a){logger[_0xa266('0x16')]('DestroyCmHopper',_0x198c02);logger['debug'](_0xa266('0x1f'),_0x198c02,JSON[_0xa266('0x10')](_0x12760a));_0x198fc5(_0x12760a);})[_0xa266('0x11')](function(_0x482253){logger[_0xa266('0x12')](_0xa266('0x1f'),_0x482253['message'],_0x198c02);_0x55b1e0(_0x320a28[_0xa266('0x12')](0x1f4,_0x482253[_0xa266('0x14')]));});});};exports[_0xa266('0x20')]=function(_0x3de51e){var _0x3f9184=this;return new Promise(function(_0x5e909a,_0x48f457){return db[_0xa266('0x21')][_0xa266('0x22')]()[_0xa266('0xe')](function(_0x28b8fe){return db[_0xa266('0x23')]['transaction'](function(_0x126077){return db[_0xa266('0x6')][_0xa266('0x24')]({'where':_0x3de51e['options']?_0x3de51e[_0xa266('0x7')][_0xa266('0x9')]||null:null,'attributes':_0x3de51e[_0xa266('0x7')]?_0x3de51e['options'][_0xa266('0xc')]||null:null,'limit':_0x3de51e[_0xa266('0x7')]?_0x3de51e['options'][_0xa266('0x25')]||null:null,'order':_0x3de51e[_0xa266('0x7')]?_0x3de51e[_0xa266('0x7')][_0xa266('0x26')]||null:null,'transaction':_0x126077,'lock':_0x126077[_0xa266('0x27')][_0xa266('0x28')],'include':[{'model':db[_0xa266('0x21')],'as':_0xa266('0x29'),'attributes':_['keys'](_0x28b8fe)},{'model':db[_0xa266('0x2a')],'as':'Agent','attributes':['id',_0xa266('0x2b'),_0xa266('0x2c')]}]})[_0xa266('0xe')](function(_0x2d4a40){var _0x249314=[];var _0x59bc47=[];for(var _0x7e7a27=0x0;_0x7e7a27<_0x2d4a40[_0xa266('0x2d')];_0x7e7a27+=0x1){var _0x1c96b8=_0x2d4a40[_0x7e7a27]['UserId'];if(_0x1c96b8===null){_0x249314[_0xa266('0x2e')](_0x2d4a40[_0x7e7a27][_0xa266('0x1c')](_0x3de51e[_0xa266('0x19')],{'transaction':_0x126077}));}else if(!_0x59bc47[_0xa266('0x2f')](_0x1c96b8)){_0x59bc47[_0xa266('0x2e')](_0x1c96b8);_0x249314[_0xa266('0x2e')](_0x2d4a40[_0x7e7a27]['update'](_0x3de51e[_0xa266('0x19')],{'transaction':_0x126077}));}}return BPromise[_0xa266('0x30')](_0x249314);});})['then'](function(_0xdcc0c9){logger['info'](_0xa266('0x20'),_0x3de51e);if(_0xdcc0c9[_0xa266('0x2d')]>0x0){logger['info'](_0xa266('0x31'),_0xdcc0c9[0x0]['dataValues']['id'],_0xdcc0c9[0x0][_0xa266('0x32')][_0xa266('0x33')],_0xdcc0c9[0x0]['dataValues'][_0xa266('0x1e')]);}logger[_0xa266('0xf')](_0xa266('0x20'),_0x3de51e,JSON['stringify'](_0xdcc0c9));_0x5e909a(_0xdcc0c9);})[_0xa266('0x11')](function(_0x383dc8){logger[_0xa266('0x12')](_0xa266('0x20'),_0x383dc8[_0xa266('0x14')],_0x3de51e);_0x48f457(_0x3f9184[_0xa266('0x12')](0x1f4,_0x383dc8[_0xa266('0x14')]));});});});};exports[_0xa266('0x34')]=function(_0x1c1328){var _0x479f84=this;return new Promise(function(_0x1bf721,_0x13c3d8){return db[_0xa266('0x23')][_0xa266('0x35')](function(_0x545204){return db[_0xa266('0x36')]['create'](_0x1c1328[_0xa266('0x19')],{'raw':_0x1c1328[_0xa266('0x7')]?_0x1c1328['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x545204})['then'](function(){logger[_0xa266('0x16')](_0xa266('0x37'),JSON['stringify'](_0x1c1328[_0xa266('0x7')][_0xa266('0x9')]),_0x1c1328['options'][_0xa266('0x9')][_0xa266('0x1e')]);return db[_0xa266('0x6')]['destroy']({'where':_0x1c1328['options']?_0x1c1328[_0xa266('0x7')][_0xa266('0x9')]||null:null,'transaction':_0x545204});});})['then'](function(_0x2b402e){logger[_0xa266('0x16')](_0xa266('0x34'),_0x1c1328);logger[_0xa266('0xf')](_0xa266('0x34'),_0x1c1328,JSON[_0xa266('0x10')](_0x2b402e));_0x1bf721(_0x2b402e);})[_0xa266('0x11')](function(_0x5d6223){logger['error'](_0xa266('0x34'),_0x5d6223[_0xa266('0x14')],_0x1c1328);_0x13c3d8(_0x479f84['error'](0x1f4,_0x5d6223[_0xa266('0x14')]));});});};exports['CountReScheduled']=function(_0x462e27){var _0x1492fa=this;return new Promise(function(_0x5688c3,_0x196ea2){return db[_0xa266('0x6')][_0xa266('0x24')]({'raw':_0x462e27[_0xa266('0x7')]?_0x462e27[_0xa266('0x7')][_0xa266('0x8')]===undefined?!![]:![]:!![],'where':_0x462e27[_0xa266('0x7')]?_0x462e27[_0xa266('0x7')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xa266('0x38'),db[_0xa266('0x23')]['fn']('IF',db['sequelize'][_0xa266('0x39')]('`scheduledat`\x20>=\x20'+util[_0xa266('0x3a')](_0xa266('0x3b'),moment()[_0xa266('0x3a')](_0xa266('0x3c')))+_0xa266('0x3d')))),_0xa266('0x3e')]]})[_0xa266('0xe')](function(_0x2926fe){logger['info'](_0xa266('0x3f'),_0x462e27);logger[_0xa266('0xf')](_0xa266('0x3f'),_0x462e27,JSON[_0xa266('0x10')](_0x2926fe));_0x5688c3(_0x2926fe);})['catch'](function(_0x59478c){logger[_0xa266('0x12')](_0xa266('0x3f'),_0x59478c[_0xa266('0x14')],_0x462e27);_0x196ea2(_0x1492fa[_0xa266('0x12')](0x1f4,_0x59478c[_0xa266('0x14')]));});});};exports[_0xa266('0x40')]=function(_0x4a969a){var _0x1baf18=this;return new Promise(function(_0x233d0,_0xf8f712){return db[_0xa266('0x21')]['describe']()[_0xa266('0xe')](function(){return db[_0xa266('0x23')]['transaction'](function(_0x1a3fc9){return db['CmHopper'][_0xa266('0x24')]({'where':_0x4a969a[_0xa266('0x7')]?_0x4a969a[_0xa266('0x7')]['where']||null:null,'attributes':_0x4a969a[_0xa266('0x7')]?_0x4a969a[_0xa266('0x7')]['attributes']||null:null,'limit':0x1,'order':_0x4a969a['options']?_0x4a969a[_0xa266('0x7')][_0xa266('0x26')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x1a3fc9,'lock':_0x1a3fc9['LOCK']['UPDATE'],'include':_0x4a969a[_0xa266('0x7')]?_0x4a969a[_0xa266('0x7')][_0xa266('0xa')]?_[_0xa266('0xb')](_0x4a969a[_0xa266('0x7')][_0xa266('0xa')],function(_0x19fefd){return{'model':db[_0x19fefd[_0xa266('0xd')]],'as':_0x19fefd['as'],'attributes':_0x19fefd[_0xa266('0xc')],'include':_0x19fefd[_0xa266('0xa')]?_[_0xa266('0xb')](_0x19fefd[_0xa266('0xa')],function(_0x3f3e45){return{'model':db[_0x3f3e45[_0xa266('0xd')]],'as':_0x3f3e45['as'],'attributes':_0x3f3e45[_0xa266('0xc')],'include':_0x3f3e45[_0xa266('0xa')]?_['map'](_0x3f3e45['include'],function(_0x5b9eb6){return{'model':db[_0x5b9eb6[_0xa266('0xd')]],'as':_0x5b9eb6['as'],'attributes':_0x5b9eb6[_0xa266('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa266('0xe')](function(_0x43dba1){var _0x55effd=[];for(var _0x46a945=0x0;_0x46a945<_0x43dba1[_0xa266('0x2d')];_0x46a945+=0x1){_0x55effd['push'](_0x43dba1[_0x46a945][_0xa266('0x1c')](_0x4a969a[_0xa266('0x19')],{'transaction':_0x1a3fc9}));}return BPromise[_0xa266('0x30')](_0x55effd);});})[_0xa266('0xe')](function(_0x12369d){logger[_0xa266('0x16')](_0xa266('0x40'),_0x4a969a);logger[_0xa266('0xf')](_0xa266('0x40'),_0x4a969a,JSON[_0xa266('0x10')](_0x12369d));_0x233d0(_0x12369d);})[_0xa266('0x11')](function(_0x4e7418){logger['error']('GetContactRecallMe',_0x4e7418['message'],_0x4a969a);_0xf8f712(_0x1baf18[_0xa266('0x12')](0x1f4,_0x4e7418[_0xa266('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x56d73e){var _0x450341=this;return new Promise(function(_0x16459a,_0xef26ab){db[_0xa266('0x21')][_0xa266('0x22')]()[_0xa266('0xe')](function(_0x330e6b){return db['CmHopper'][_0xa266('0x24')]({'raw':_0x56d73e['options']?_0x56d73e[_0xa266('0x7')][_0xa266('0x8')]===undefined?!![]:![]:!![],'where':_0x56d73e[_0xa266('0x7')]?_0x56d73e['options'][_0xa266('0x9')]||null:null,'attributes':_0x56d73e[_0xa266('0x7')]?_0x56d73e[_0xa266('0x7')]['attributes']||null:null,'limit':_0x56d73e[_0xa266('0x7')]?_0x56d73e[_0xa266('0x7')]['limit']||null:null,'include':_0x56d73e[_0xa266('0x7')]?_0x56d73e[_0xa266('0x7')][_0xa266('0xa')]?_[_0xa266('0xb')](_0x56d73e[_0xa266('0x7')][_0xa266('0xa')],function(_0x4222fa){return{'model':db[_0x4222fa['model']],'as':_0x4222fa['as'],'attributes':_0x4222fa['as']==='Contact'?_[_0xa266('0x41')](_0x330e6b):_0x4222fa['attributes'],'include':_0x4222fa[_0xa266('0xa')]?_[_0xa266('0xb')](_0x4222fa[_0xa266('0xa')],function(_0x5423cf){return{'model':db[_0x5423cf[_0xa266('0xd')]],'as':_0x5423cf['as'],'attributes':_0x5423cf['attributes'],'include':_0x5423cf['include']?_[_0xa266('0xb')](_0x5423cf['include'],function(_0x4a9111){return{'model':db[_0x4a9111['model']],'as':_0x4a9111['as'],'attributes':_0x4a9111[_0xa266('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa266('0xe')](function(_0x7cad1d){logger[_0xa266('0x16')](_0xa266('0x13'),_0x56d73e);logger[_0xa266('0xf')](_0xa266('0x13'),_0x56d73e,JSON[_0xa266('0x10')](_0x7cad1d));_0x16459a(_0x7cad1d);})[_0xa266('0x11')](function(_0x587c5c){logger[_0xa266('0x12')](_0xa266('0x13'),_0x587c5c['message'],_0x56d73e);_0xef26ab(_0x450341[_0xa266('0x12')](0x1f4,_0x587c5c[_0xa266('0x14')]));});});});};exports['GetContactByPhone']=function(_0x4ed97c){var _0x3b93b2=this;return new Promise(function(_0xcfa44a,_0x2f267e){return db['CmContact'][_0xa266('0x42')]({'raw':!![],'where':{'phone':_0x4ed97c[_0xa266('0x7')][_0xa266('0x9')][_0xa266('0x43')]},'attributes':['id',_0xa266('0x44')],'order':[['id',_0xa266('0x45')]]})[_0xa266('0xe')](function(_0x4b5d22){logger[_0xa266('0x16')](_0xa266('0x46'),_0x4ed97c);logger['debug']('getContactByPhone',_0x4ed97c,JSON[_0xa266('0x10')](_0x4b5d22));_0xcfa44a(_0x4b5d22);})[_0xa266('0x11')](function(_0x49655b){logger[_0xa266('0x12')](_0xa266('0x46'),_0x49655b['message'],_0x4ed97c);_0x2f267e(_0x3b93b2['error'](0x1f4,_0x49655b[_0xa266('0x14')]));});});};exports[_0xa266('0x47')]=function(_0x29ac55){var _0x4f249f=this;return new Promise(function(_0x18ff56,_0x1baa94){return db['sequelize']['transaction'](function(_0x5b6d49){var _0x2748ea=_0x29ac55[_0xa266('0x7')]&&_0x29ac55[_0xa266('0x7')][_0xa266('0x9')]?_0x29ac55['options'][_0xa266('0x9')]:{};return db[_0xa266('0x6')]['update'](_0x29ac55[_0xa266('0x19')],{'where':_0x2748ea,'transaction':_0x5b6d49})[_0xa266('0xe')](function(_0x3297ba){logger['info'](_0xa266('0x47'),_0x29ac55);logger[_0xa266('0xf')]('ResetActiveCalls',_0x29ac55,JSON[_0xa266('0x10')](_0x3297ba));_0x18ff56(_0x3297ba);})[_0xa266('0x11')](function(_0x3b7c84){logger['error'](_0xa266('0x47'),_0x3b7c84[_0xa266('0x14')],_0x29ac55);_0x1baa94(_0x4f249f[_0xa266('0x12')](0x1f4,_0x3b7c84[_0xa266('0x14')]));});});});};exports[_0xa266('0x48')]=function(_0x37ef68){var _0x4cc7e7=this;var _0x8da70d=_0x37ef68[_0xa266('0x19')]['where']['voiceQueueIds'];var _0x5e5912=_0x37ef68[_0xa266('0x19')]['where'][_0xa266('0x49')];var _0x364877=_0x37ef68[_0xa266('0x19')][_0xa266('0x9')]['availableAgentsIds'];return new Promise(function(_0x86ccf9,_0x2d6a15){return db[_0xa266('0x6')][_0xa266('0x24')]({'where':{'voiceQueueId':{'$in':_0x8da70d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xa266('0x39')](_0xa266('0x4a')+_0x5e5912+_0xa266('0x4b')),'$gt':db[_0xa266('0x23')][_0xa266('0x39')](_0xa266('0x4c'))}},'UserId':{'$in':_0x364877}},'include':[{'model':db[_0xa266('0x21')],'as':'Contact'},{'model':db[_0xa266('0x2a')],'as':_0xa266('0x4d'),'attributes':['id','name',_0xa266('0x2c')]},{'model':db[_0xa266('0x4e')],'as':_0xa266('0x4f')}]})[_0xa266('0xe')](function(_0x5a4af9){if(_0x5a4af9[_0xa266('0x2d')]>0x0){return db[_0xa266('0x23')][_0xa266('0x35')](function(_0x4c4cd0){return db[_0xa266('0x6')][_0xa266('0x1c')]({'recallmeNotifiedDate':db[_0xa266('0x23')][_0xa266('0x39')](_0xa266('0x4c'))},{'where':{'id':{'$in':_[_0xa266('0xb')](_0x5a4af9,'id')}},'transaction':_0x4c4cd0})[_0xa266('0xe')](function(){_0x86ccf9(_0x5a4af9);})[_0xa266('0x11')](function(_0x3e52a1){logger[_0xa266('0x12')](_0xa266('0x48'),_0x3e52a1[_0xa266('0x14')],_0x37ef68);_0x2d6a15(_0x4cc7e7[_0xa266('0x12')](0x1f4,_0x3e52a1[_0xa266('0x14')]));});})[_0xa266('0x11')](function(_0x52db22){logger[_0xa266('0x12')](_0xa266('0x48'),_0x52db22['message'],_0x37ef68);_0x2d6a15(_0x4cc7e7[_0xa266('0x12')](0x1f4,_0x52db22[_0xa266('0x14')]));});}else{_0x86ccf9(_0x5a4af9);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 2a8e610..f0ccdda 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 _0x032c=['getTimezone','put','update','destroy','exports','express','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone'];(function(_0x435d49,_0xe63b56){var _0x40a43d=function(_0x427d95){while(--_0x427d95){_0x435d49['push'](_0x435d49['shift']());}};_0x40a43d(++_0xe63b56);}(_0x032c,0x1c7));var _0xc032=function(_0x74746c,_0x4b0a70){_0x74746c=_0x74746c-0x0;var _0xfdb2f6=_0x032c[_0x74746c];return _0xfdb2f6;};'use strict';var express=require(_0xc032('0x0'));var router=express['Router']();var auth=require(_0xc032('0x1'));var controller=require(_0xc032('0x2'));router['get']('/',auth[_0xc032('0x3')](),controller[_0xc032('0x4')]);router[_0xc032('0x5')](_0xc032('0x6'),auth['isAuthenticated'](),controller[_0xc032('0x7')]);router[_0xc032('0x5')](_0xc032('0x8'),auth[_0xc032('0x3')](),controller['getOpenContacts']);router[_0xc032('0x5')](_0xc032('0x9'),auth[_0xc032('0x3')](),controller[_0xc032('0xa')]);router['get'](_0xc032('0xb'),auth[_0xc032('0x3')](),controller[_0xc032('0xc')]);router[_0xc032('0x5')](_0xc032('0xd'),auth[_0xc032('0x3')](),controller[_0xc032('0xe')]);router[_0xc032('0xf')]('/',auth[_0xc032('0x3')](),controller[_0xc032('0x10')]);router['post'](_0xc032('0x11'),auth['isAuthenticated'](),controller[_0xc032('0x12')]);router['post'](_0xc032('0x13'),auth[_0xc032('0x3')](),controller[_0xc032('0x14')]);router[_0xc032('0x15')](_0xc032('0xb'),auth[_0xc032('0x3')](),controller[_0xc032('0x16')]);router['delete']('/:id',auth[_0xc032('0x3')](),controller[_0xc032('0x17')]);module[_0xc032('0x18')]=router; \ No newline at end of file +var _0xcdba=['post','/preview','getPreview','/timezone','getTimezone','update','delete','destroy','exports','../../components/auth/service','isAuthenticated','index','describe','getOpenContacts','/timezones','get','show','/:id/previewrecall','getPreviewRecall','create'];(function(_0x565fee,_0x8a850c){var _0x392b5b=function(_0x42aa30){while(--_0x42aa30){_0x565fee['push'](_0x565fee['shift']());}};_0x392b5b(++_0x8a850c);}(_0xcdba,0xd1));var _0xacdb=function(_0x580e4a,_0xe82cbc){_0x580e4a=_0x580e4a-0x0;var _0x5378c9=_0xcdba[_0x580e4a];return _0x5378c9;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xacdb('0x0'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0xacdb('0x1')](),controller[_0xacdb('0x2')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xacdb('0x3')]);router['get']('/opencontacts',auth[_0xacdb('0x1')](),controller[_0xacdb('0x4')]);router['get'](_0xacdb('0x5'),auth[_0xacdb('0x1')](),controller['getTimezones']);router[_0xacdb('0x6')]('/:id',auth[_0xacdb('0x1')](),controller[_0xacdb('0x7')]);router[_0xacdb('0x6')](_0xacdb('0x8'),auth[_0xacdb('0x1')](),controller[_0xacdb('0x9')]);router['post']('/',auth[_0xacdb('0x1')](),controller[_0xacdb('0xa')]);router[_0xacdb('0xb')](_0xacdb('0xc'),auth['isAuthenticated'](),controller[_0xacdb('0xd')]);router['post'](_0xacdb('0xe'),auth[_0xacdb('0x1')](),controller[_0xacdb('0xf')]);router['put']('/:id',auth[_0xacdb('0x1')](),controller[_0xacdb('0x10')]);router[_0xacdb('0x11')]('/:id',auth[_0xacdb('0x1')](),controller[_0xacdb('0x12')]);module[_0xacdb('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index d8c2240..4b3738d 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 _0x83b2=['INTEGER','DATE','moment','sequelize','exports','STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x83b2,0x98));var _0x283b=function(_0x59d3df,_0x19fe6e){_0x59d3df=_0x59d3df-0x0;var _0x82a217=_0x83b2[_0x59d3df];return _0x82a217;};'use strict';var moment=require(_0x283b('0x0'));var Sequelize=require(_0x283b('0x1'));module[_0x283b('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x283b('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x283b('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3977=['exports','INTEGER','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x1650b5,_0x4e7746){var _0x45c73c=function(_0x577218){while(--_0x577218){_0x1650b5['push'](_0x1650b5['shift']());}};_0x45c73c(++_0x4e7746);}(_0x3977,0x1ee));var _0x7397=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3977[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require('moment');var Sequelize=require(_0x7397('0x0'));module[_0x7397('0x1')]={'CmHopperId':{'type':Sequelize[_0x7397('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x7397('0x3')](_0x7397('0x4'))},'countbusyretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7397('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 c2c0f1a..0e16849 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 _0xa173=['type','key','model','map','keys','query','intersection','attributes','fields','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','then','get','CmHopperAdditionalPhones','error','stack','name','index','CmHopperAdditionalPhone','rawAttributes'];(function(_0x13ebcd,_0x7e6af9){var _0x1c6cd9=function(_0x2dcc6f){while(--_0x2dcc6f){_0x13ebcd['push'](_0x13ebcd['shift']());}};_0x1c6cd9(++_0x7e6af9);}(_0xa173,0x165));var _0x3a17=function(_0x4be681,_0x133c27){_0x4be681=_0x4be681-0x0;var _0x31bb66=_0xa173[_0x4be681];return _0x31bb66;};'use strict';var emlformat=require(_0x3a17('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a17('0x1'));var rp=require(_0x3a17('0x2'));var moment=require(_0x3a17('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3a17('0x4'));var util=require(_0x3a17('0x5'));var path=require(_0x3a17('0x6'));var sox=require(_0x3a17('0x7'));var csv=require(_0x3a17('0x8'));var ejs=require(_0x3a17('0x9'));var fs=require('fs');var fs_extra=require(_0x3a17('0xa'));var _=require(_0x3a17('0xb'));var squel=require(_0x3a17('0xc'));var crypto=require(_0x3a17('0xd'));var jsforce=require(_0x3a17('0xe'));var deskjs=require(_0x3a17('0xf'));var toCsv=require(_0x3a17('0x8'));var querystring=require('querystring');var Papa=require(_0x3a17('0x10'));var Redis=require(_0x3a17('0x11'));var authService=require(_0x3a17('0x12'));var qs=require(_0x3a17('0x13'));var as=require(_0x3a17('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a17('0x15'))(_0x3a17('0x16'));var utils=require(_0x3a17('0x17'));var config=require(_0x3a17('0x18'));var licenseUtil=require(_0x3a17('0x19'));var db=require(_0x3a17('0x1a'))['db'];function respondWithStatusCode(_0x18e166,_0xf211f7){_0xf211f7=_0xf211f7||0xcc;return function(_0x8a0247){if(_0x8a0247){return _0x18e166[_0x3a17('0x1b')](_0xf211f7);}return _0x18e166[_0x3a17('0x1c')](_0xf211f7)[_0x3a17('0x1d')]();};}function respondWithResult(_0x4b65b4,_0x4ea799){_0x4ea799=_0x4ea799||0xc8;return function(_0x545c29){if(_0x545c29){return _0x4b65b4[_0x3a17('0x1c')](_0x4ea799)['json'](_0x545c29);}};}function respondWithFilteredResult(_0x5a7d6c,_0x1a3cba){return function(_0x4f02ff){if(_0x4f02ff){var _0x5ef3ef=typeof _0x1a3cba[_0x3a17('0x1e')]==='undefined'&&typeof _0x1a3cba[_0x3a17('0x1f')]===_0x3a17('0x20');var _0x18d936=_0x4f02ff['count'];var _0x533544=_0x5ef3ef?0x0:_0x1a3cba[_0x3a17('0x1e')];var _0x3f6b36=_0x5ef3ef?_0x4f02ff[_0x3a17('0x21')]:_0x1a3cba[_0x3a17('0x1e')]+_0x1a3cba['limit'];var _0x9473a5;if(_0x3f6b36>=_0x18d936){_0x3f6b36=_0x18d936;_0x9473a5=0xc8;}else{_0x9473a5=0xce;}_0x5a7d6c[_0x3a17('0x1c')](_0x9473a5);return _0x5a7d6c[_0x3a17('0x22')]('Content-Range',_0x533544+'-'+_0x3f6b36+'/'+_0x18d936)['json'](_0x4f02ff);}return null;};}function patchUpdates(_0x1d02e1){return function(_0x3e7d15){try{jsonpatch[_0x3a17('0x23')](_0x3e7d15,_0x1d02e1,!![]);}catch(_0x45fa4c){return BPromise[_0x3a17('0x24')](_0x45fa4c);}return _0x3e7d15[_0x3a17('0x25')]();};}function saveUpdates(_0x28cce4,_0x35e3fa){return function(_0x52a192){if(_0x52a192){return _0x52a192[_0x3a17('0x26')](_0x28cce4)[_0x3a17('0x27')](function(_0x348c97){return _0x348c97;});}return null;};}function removeEntity(_0x49eec0,_0x177c33){return function(_0x5bc01f){if(_0x5bc01f){return _0x5bc01f['destroy']()[_0x3a17('0x27')](function(){var _0x35bb58=_0x5bc01f[_0x3a17('0x28')]({'plain':!![]});var _0xb1de7f=_0x3a17('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xb1de7f,'resourceId':_0x35bb58['id']}})['then'](function(){return _0x5bc01f;});})[_0x3a17('0x27')](function(){_0x49eec0[_0x3a17('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bad15,_0x2778c1){return function(_0x4f4614){if(!_0x4f4614){_0x5bad15[_0x3a17('0x1b')](0x194);}return _0x4f4614;};}function handleError(_0xbda20c,_0x52d264){_0x52d264=_0x52d264||0x1f4;return function(_0x3365f9){logger[_0x3a17('0x2a')](_0x3365f9[_0x3a17('0x2b')]);if(_0x3365f9['name']){delete _0x3365f9[_0x3a17('0x2c')];}_0xbda20c['status'](_0x52d264)['send'](_0x3365f9);};}exports[_0x3a17('0x2d')]=function(_0x564cc0,_0x4e2aaa){var _0x52e92c={},_0x5f0eff={},_0x86ce45={'count':0x0,'rows':[]};var _0x3cdfa9=_['map'](db[_0x3a17('0x2e')][_0x3a17('0x2f')],function(_0x1e8bba){return{'name':_0x1e8bba['fieldName'],'type':_0x1e8bba[_0x3a17('0x30')][_0x3a17('0x31')]};});_0x5f0eff[_0x3a17('0x32')]=_[_0x3a17('0x33')](_0x3cdfa9,_0x3a17('0x2c'));_0x5f0eff['query']=_[_0x3a17('0x34')](_0x564cc0[_0x3a17('0x35')]);_0x5f0eff['filters']=_[_0x3a17('0x36')](_0x5f0eff[_0x3a17('0x32')],_0x5f0eff[_0x3a17('0x35')]);_0x52e92c[_0x3a17('0x37')]=_['intersection'](_0x5f0eff[_0x3a17('0x32')],qs[_0x3a17('0x38')](_0x564cc0['query'][_0x3a17('0x38')]));_0x52e92c['attributes']=_0x52e92c[_0x3a17('0x37')]['length']?_0x52e92c[_0x3a17('0x37')]:_0x5f0eff[_0x3a17('0x32')];if(!_0x564cc0[_0x3a17('0x35')]['hasOwnProperty']('nolimit')){_0x52e92c[_0x3a17('0x1f')]=qs['limit'](_0x564cc0[_0x3a17('0x35')][_0x3a17('0x1f')]);_0x52e92c['offset']=qs[_0x3a17('0x1e')](_0x564cc0[_0x3a17('0x35')][_0x3a17('0x1e')]);}_0x52e92c['order']=qs['sort'](_0x564cc0[_0x3a17('0x35')][_0x3a17('0x39')]);_0x52e92c[_0x3a17('0x3a')]=qs['filters'](_['pick'](_0x564cc0[_0x3a17('0x35')],_0x5f0eff[_0x3a17('0x3b')]),_0x3cdfa9);if(_0x564cc0[_0x3a17('0x35')][_0x3a17('0x3c')]){_0x52e92c[_0x3a17('0x3a')]=_['merge'](_0x52e92c['where'],{'$or':_[_0x3a17('0x33')](_0x3cdfa9,function(_0x2465e6){if(_0x2465e6['type']!==_0x3a17('0x3d')){var _0x47f1dc={};_0x47f1dc[_0x2465e6[_0x3a17('0x2c')]]={'$like':'%'+_0x564cc0[_0x3a17('0x35')][_0x3a17('0x3c')]+'%'};return _0x47f1dc;}})});}_0x52e92c=_[_0x3a17('0x3e')]({},_0x52e92c,_0x564cc0[_0x3a17('0x3f')]);var _0x36c829={'where':_0x52e92c[_0x3a17('0x3a')]};return db[_0x3a17('0x2e')][_0x3a17('0x21')](_0x36c829)['then'](function(_0x46c94a){_0x86ce45[_0x3a17('0x21')]=_0x46c94a;if(_0x564cc0['query'][_0x3a17('0x40')]){_0x52e92c[_0x3a17('0x41')]=[{'all':!![]}];}return db[_0x3a17('0x2e')][_0x3a17('0x42')](_0x52e92c);})[_0x3a17('0x27')](function(_0x4fb0b5){_0x86ce45[_0x3a17('0x43')]=_0x4fb0b5;return _0x86ce45;})['then'](respondWithFilteredResult(_0x4e2aaa,_0x52e92c))[_0x3a17('0x44')](handleError(_0x4e2aaa,null));};exports['show']=function(_0x336072,_0x2462be){var _0x2c58f1={'raw':!![],'where':{'id':_0x336072[_0x3a17('0x45')]['id']}},_0x460367={};_0x460367[_0x3a17('0x32')]=_[_0x3a17('0x34')](db[_0x3a17('0x2e')][_0x3a17('0x2f')]);_0x460367[_0x3a17('0x35')]=_[_0x3a17('0x34')](_0x336072[_0x3a17('0x35')]);_0x460367[_0x3a17('0x3b')]=_['intersection'](_0x460367['model'],_0x460367[_0x3a17('0x35')]);_0x2c58f1[_0x3a17('0x37')]=_['intersection'](_0x460367['model'],qs[_0x3a17('0x38')](_0x336072[_0x3a17('0x35')][_0x3a17('0x38')]));_0x2c58f1[_0x3a17('0x37')]=_0x2c58f1[_0x3a17('0x37')][_0x3a17('0x46')]?_0x2c58f1[_0x3a17('0x37')]:_0x460367['model'];if(_0x336072[_0x3a17('0x35')][_0x3a17('0x40')]){_0x2c58f1[_0x3a17('0x41')]=[{'all':!![]}];}_0x2c58f1=_[_0x3a17('0x3e')]({},_0x2c58f1,_0x336072['options']);return db[_0x3a17('0x2e')][_0x3a17('0x47')](_0x2c58f1)[_0x3a17('0x27')](handleEntityNotFound(_0x2462be,null))[_0x3a17('0x27')](respondWithResult(_0x2462be,null))[_0x3a17('0x44')](handleError(_0x2462be,null));};exports[_0x3a17('0x48')]=function(_0x80b21,_0x2cbe5c){return db['CmHopperAdditionalPhone'][_0x3a17('0x48')](_0x80b21[_0x3a17('0x49')],{})[_0x3a17('0x27')](function(_0x24a64e){var _0x51160a=_0x80b21[_0x3a17('0x4a')][_0x3a17('0x28')]({'plain':!![]});if(!_0x51160a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51160a[_0x3a17('0x4b')]==='user'){var _0x9cce1f=_0x24a64e[_0x3a17('0x28')]({'plain':!![]});var _0x3cc18f='CmHopperAdditionalPhones';return db[_0x3a17('0x4c')][_0x3a17('0x47')]({'where':{'name':_0x3cc18f,'userProfileId':_0x51160a[_0x3a17('0x4d')]},'raw':!![]})['then'](function(_0x1e17a8){if(_0x1e17a8&&_0x1e17a8[_0x3a17('0x4e')]===0x0){return db[_0x3a17('0x4f')][_0x3a17('0x48')]({'name':_0x9cce1f[_0x3a17('0x2c')],'resourceId':_0x9cce1f['id'],'type':_0x1e17a8[_0x3a17('0x2c')],'sectionId':_0x1e17a8['id']},{})[_0x3a17('0x27')](function(){return _0x24a64e;});}else{return _0x24a64e;}})[_0x3a17('0x44')](function(_0xefa3ea){logger[_0x3a17('0x2a')](_0x3a17('0x50'),_0xefa3ea);throw _0xefa3ea;});}return _0x24a64e;})['then'](respondWithResult(_0x2cbe5c,0xc9))['catch'](handleError(_0x2cbe5c,null));};exports[_0x3a17('0x26')]=function(_0x50e363,_0x357dbd){if(_0x50e363['body']['id']){delete _0x50e363[_0x3a17('0x49')]['id'];}return db[_0x3a17('0x2e')][_0x3a17('0x47')]({'where':{'id':_0x50e363[_0x3a17('0x45')]['id']}})[_0x3a17('0x27')](handleEntityNotFound(_0x357dbd,null))['then'](saveUpdates(_0x50e363['body'],null))[_0x3a17('0x27')](respondWithResult(_0x357dbd,null))[_0x3a17('0x44')](handleError(_0x357dbd,null));};exports['destroy']=function(_0x201f87,_0x218ae1){return db[_0x3a17('0x2e')]['find']({'where':{'id':_0x201f87['params']['id']}})[_0x3a17('0x27')](handleEntityNotFound(_0x218ae1,null))[_0x3a17('0x27')](removeEntity(_0x218ae1,null))['catch'](handleError(_0x218ae1,null));}; \ No newline at end of file +var _0x3f8d=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','sendStatus','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x5f1f0d,_0x22673c){var _0x52af47=function(_0x4a6263){while(--_0x4a6263){_0x5f1f0d['push'](_0x5f1f0d['shift']());}};_0x52af47(++_0x22673c);}(_0x3f8d,0x1b9));var _0xd3f8=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0x3f8d[_0x487ab4];return _0x3bef77;};'use strict';var emlformat=require(_0xd3f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3f8('0x1'));var jsonpatch=require(_0xd3f8('0x2'));var rp=require(_0xd3f8('0x3'));var moment=require('moment');var BPromise=require(_0xd3f8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd3f8('0x5'));var sox=require('sox');var csv=require(_0xd3f8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3f8('0x7'));var squel=require(_0xd3f8('0x8'));var crypto=require(_0xd3f8('0x9'));var jsforce=require(_0xd3f8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd3f8('0x6'));var querystring=require(_0xd3f8('0xb'));var Papa=require(_0xd3f8('0xc'));var Redis=require(_0xd3f8('0xd'));var authService=require(_0xd3f8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd3f8('0xf'));var hardwareService=require(_0xd3f8('0x10'));var logger=require(_0xd3f8('0x11'))(_0xd3f8('0x12'));var utils=require(_0xd3f8('0x13'));var config=require(_0xd3f8('0x14'));var licenseUtil=require(_0xd3f8('0x15'));var db=require(_0xd3f8('0x16'))['db'];function respondWithStatusCode(_0x3afae4,_0x36829f){_0x36829f=_0x36829f||0xcc;return function(_0x51a0a3){if(_0x51a0a3){return _0x3afae4['sendStatus'](_0x36829f);}return _0x3afae4[_0xd3f8('0x17')](_0x36829f)[_0xd3f8('0x18')]();};}function respondWithResult(_0x36aa28,_0x36ce42){_0x36ce42=_0x36ce42||0xc8;return function(_0x50defa){if(_0x50defa){return _0x36aa28[_0xd3f8('0x17')](_0x36ce42)[_0xd3f8('0x19')](_0x50defa);}};}function respondWithFilteredResult(_0x5810a3,_0x4c798c){return function(_0x1e8944){if(_0x1e8944){var _0x183380=typeof _0x4c798c['offset']==='undefined'&&typeof _0x4c798c['limit']===_0xd3f8('0x1a');var _0x380da8=_0x1e8944[_0xd3f8('0x1b')];var _0x59ee4b=_0x183380?0x0:_0x4c798c[_0xd3f8('0x1c')];var _0x1702cb=_0x183380?_0x1e8944['count']:_0x4c798c[_0xd3f8('0x1c')]+_0x4c798c[_0xd3f8('0x1d')];var _0x1cb6e3;if(_0x1702cb>=_0x380da8){_0x1702cb=_0x380da8;_0x1cb6e3=0xc8;}else{_0x1cb6e3=0xce;}_0x5810a3['status'](_0x1cb6e3);return _0x5810a3[_0xd3f8('0x1e')](_0xd3f8('0x1f'),_0x59ee4b+'-'+_0x1702cb+'/'+_0x380da8)[_0xd3f8('0x19')](_0x1e8944);}return null;};}function patchUpdates(_0x1c0efb){return function(_0x4927dc){try{jsonpatch['apply'](_0x4927dc,_0x1c0efb,!![]);}catch(_0x1888cf){return BPromise[_0xd3f8('0x20')](_0x1888cf);}return _0x4927dc[_0xd3f8('0x21')]();};}function saveUpdates(_0x2a26d6,_0x5a7e4c){return function(_0x972399){if(_0x972399){return _0x972399[_0xd3f8('0x22')](_0x2a26d6)[_0xd3f8('0x23')](function(_0x32bcb4){return _0x32bcb4;});}return null;};}function removeEntity(_0x3f3a40,_0x4a535a){return function(_0x2fb3d7){if(_0x2fb3d7){return _0x2fb3d7[_0xd3f8('0x24')]()[_0xd3f8('0x23')](function(){var _0x3999f0=_0x2fb3d7['get']({'plain':!![]});var _0x1425ed=_0xd3f8('0x25');return db[_0xd3f8('0x26')][_0xd3f8('0x24')]({'where':{'type':_0x1425ed,'resourceId':_0x3999f0['id']}})[_0xd3f8('0x23')](function(){return _0x2fb3d7;});})[_0xd3f8('0x23')](function(){_0x3f3a40[_0xd3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b354,_0x1ab13c){return function(_0x409b25){if(!_0x409b25){_0x13b354[_0xd3f8('0x27')](0x194);}return _0x409b25;};}function handleError(_0x2a0c5f,_0x112297){_0x112297=_0x112297||0x1f4;return function(_0xae3a95){logger[_0xd3f8('0x28')](_0xae3a95['stack']);if(_0xae3a95[_0xd3f8('0x29')]){delete _0xae3a95[_0xd3f8('0x29')];}_0x2a0c5f[_0xd3f8('0x17')](_0x112297)[_0xd3f8('0x2a')](_0xae3a95);};}exports[_0xd3f8('0x2b')]=function(_0x15b146,_0x5dd411){var _0x44b623={},_0x25fb46={},_0x32b9b1={'count':0x0,'rows':[]};var _0x4c8848=_[_0xd3f8('0x2c')](db[_0xd3f8('0x2d')][_0xd3f8('0x2e')],function(_0xcb3550){return{'name':_0xcb3550[_0xd3f8('0x2f')],'type':_0xcb3550[_0xd3f8('0x30')]['key']};});_0x25fb46[_0xd3f8('0x31')]=_[_0xd3f8('0x2c')](_0x4c8848,_0xd3f8('0x29'));_0x25fb46[_0xd3f8('0x32')]=_[_0xd3f8('0x33')](_0x15b146[_0xd3f8('0x32')]);_0x25fb46[_0xd3f8('0x34')]=_[_0xd3f8('0x35')](_0x25fb46[_0xd3f8('0x31')],_0x25fb46[_0xd3f8('0x32')]);_0x44b623[_0xd3f8('0x36')]=_[_0xd3f8('0x35')](_0x25fb46[_0xd3f8('0x31')],qs[_0xd3f8('0x37')](_0x15b146['query'][_0xd3f8('0x37')]));_0x44b623[_0xd3f8('0x36')]=_0x44b623[_0xd3f8('0x36')][_0xd3f8('0x38')]?_0x44b623[_0xd3f8('0x36')]:_0x25fb46[_0xd3f8('0x31')];if(!_0x15b146['query'][_0xd3f8('0x39')]('nolimit')){_0x44b623[_0xd3f8('0x1d')]=qs['limit'](_0x15b146[_0xd3f8('0x32')][_0xd3f8('0x1d')]);_0x44b623[_0xd3f8('0x1c')]=qs[_0xd3f8('0x1c')](_0x15b146[_0xd3f8('0x32')][_0xd3f8('0x1c')]);}_0x44b623[_0xd3f8('0x3a')]=qs[_0xd3f8('0x3b')](_0x15b146['query'][_0xd3f8('0x3b')]);_0x44b623[_0xd3f8('0x3c')]=qs[_0xd3f8('0x34')](_[_0xd3f8('0x3d')](_0x15b146[_0xd3f8('0x32')],_0x25fb46[_0xd3f8('0x34')]),_0x4c8848);if(_0x15b146[_0xd3f8('0x32')][_0xd3f8('0x3e')]){_0x44b623['where']=_[_0xd3f8('0x3f')](_0x44b623['where'],{'$or':_[_0xd3f8('0x2c')](_0x4c8848,function(_0x64b6d5){if(_0x64b6d5['type']!==_0xd3f8('0x40')){var _0x4938b1={};_0x4938b1[_0x64b6d5[_0xd3f8('0x29')]]={'$like':'%'+_0x15b146[_0xd3f8('0x32')]['filter']+'%'};return _0x4938b1;}})});}_0x44b623=_['merge']({},_0x44b623,_0x15b146[_0xd3f8('0x41')]);var _0xc80aa8={'where':_0x44b623[_0xd3f8('0x3c')]};return db['CmHopperAdditionalPhone'][_0xd3f8('0x1b')](_0xc80aa8)['then'](function(_0x57df4f){_0x32b9b1[_0xd3f8('0x1b')]=_0x57df4f;if(_0x15b146[_0xd3f8('0x32')][_0xd3f8('0x42')]){_0x44b623[_0xd3f8('0x43')]=[{'all':!![]}];}return db[_0xd3f8('0x2d')]['findAll'](_0x44b623);})['then'](function(_0x422707){_0x32b9b1[_0xd3f8('0x44')]=_0x422707;return _0x32b9b1;})[_0xd3f8('0x23')](respondWithFilteredResult(_0x5dd411,_0x44b623))['catch'](handleError(_0x5dd411,null));};exports[_0xd3f8('0x45')]=function(_0x3af58f,_0x5632ec){var _0x4025ac={'raw':!![],'where':{'id':_0x3af58f[_0xd3f8('0x46')]['id']}},_0x277e18={};_0x277e18[_0xd3f8('0x31')]=_[_0xd3f8('0x33')](db[_0xd3f8('0x2d')][_0xd3f8('0x2e')]);_0x277e18[_0xd3f8('0x32')]=_[_0xd3f8('0x33')](_0x3af58f[_0xd3f8('0x32')]);_0x277e18[_0xd3f8('0x34')]=_[_0xd3f8('0x35')](_0x277e18['model'],_0x277e18[_0xd3f8('0x32')]);_0x4025ac[_0xd3f8('0x36')]=_[_0xd3f8('0x35')](_0x277e18['model'],qs[_0xd3f8('0x37')](_0x3af58f[_0xd3f8('0x32')][_0xd3f8('0x37')]));_0x4025ac[_0xd3f8('0x36')]=_0x4025ac[_0xd3f8('0x36')][_0xd3f8('0x38')]?_0x4025ac[_0xd3f8('0x36')]:_0x277e18[_0xd3f8('0x31')];if(_0x3af58f[_0xd3f8('0x32')]['includeAll']){_0x4025ac['include']=[{'all':!![]}];}_0x4025ac=_['merge']({},_0x4025ac,_0x3af58f[_0xd3f8('0x41')]);return db[_0xd3f8('0x2d')][_0xd3f8('0x47')](_0x4025ac)[_0xd3f8('0x23')](handleEntityNotFound(_0x5632ec,null))['then'](respondWithResult(_0x5632ec,null))['catch'](handleError(_0x5632ec,null));};exports[_0xd3f8('0x48')]=function(_0x48f3c4,_0x2b4fac){return db[_0xd3f8('0x2d')][_0xd3f8('0x48')](_0x48f3c4['body'],{})[_0xd3f8('0x23')](function(_0xa1843f){var _0x53e3ee=_0x48f3c4['user'][_0xd3f8('0x49')]({'plain':!![]});if(!_0x53e3ee)throw new Error(_0xd3f8('0x4a'));if(_0x53e3ee[_0xd3f8('0x4b')]===_0xd3f8('0x4c')){var _0xfb150d=_0xa1843f[_0xd3f8('0x49')]({'plain':!![]});var _0x2e8827=_0xd3f8('0x25');return db[_0xd3f8('0x4d')][_0xd3f8('0x47')]({'where':{'name':_0x2e8827,'userProfileId':_0x53e3ee[_0xd3f8('0x4e')]},'raw':!![]})[_0xd3f8('0x23')](function(_0x433097){if(_0x433097&&_0x433097[_0xd3f8('0x4f')]===0x0){return db['UserProfileResource'][_0xd3f8('0x48')]({'name':_0xfb150d[_0xd3f8('0x29')],'resourceId':_0xfb150d['id'],'type':_0x433097[_0xd3f8('0x29')],'sectionId':_0x433097['id']},{})[_0xd3f8('0x23')](function(){return _0xa1843f;});}else{return _0xa1843f;}})[_0xd3f8('0x50')](function(_0x3cf708){logger[_0xd3f8('0x28')](_0xd3f8('0x51'),_0x3cf708);throw _0x3cf708;});}return _0xa1843f;})['then'](respondWithResult(_0x2b4fac,0xc9))[_0xd3f8('0x50')](handleError(_0x2b4fac,null));};exports['update']=function(_0x35442d,_0x2fe487){if(_0x35442d[_0xd3f8('0x52')]['id']){delete _0x35442d[_0xd3f8('0x52')]['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x35442d[_0xd3f8('0x46')]['id']}})[_0xd3f8('0x23')](handleEntityNotFound(_0x2fe487,null))[_0xd3f8('0x23')](saveUpdates(_0x35442d[_0xd3f8('0x52')],null))['then'](respondWithResult(_0x2fe487,null))[_0xd3f8('0x50')](handleError(_0x2fe487,null));};exports[_0xd3f8('0x24')]=function(_0x491880,_0x4eba57){return db[_0xd3f8('0x2d')][_0xd3f8('0x47')]({'where':{'id':_0x491880[_0xd3f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4eba57,null))['then'](removeEntity(_0x4eba57,null))[_0xd3f8('0x50')](handleError(_0x4eba57,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index c901f29..2536fde 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 _0x8b3d=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b3d,0x1af));var _0xd8b3=function(_0x3a13fa,_0x316feb){_0x3a13fa=_0x3a13fa-0x0;var _0xcf6bc5=_0x8b3d[_0x3a13fa];return _0xcf6bc5;};'use strict';var _=require(_0xd8b3('0x0'));var util=require(_0xd8b3('0x1'));var logger=require(_0xd8b3('0x2'))('api');var moment=require(_0xd8b3('0x3'));var BPromise=require(_0xd8b3('0x4'));var rp=require(_0xd8b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8b3('0x6'));var config=require(_0xd8b3('0x7'));var attributes=require(_0xd8b3('0x8'));module['exports']=function(_0x13f7e2,_0x326da5){return _0x13f7e2[_0xd8b3('0x9')](_0xd8b3('0xa'),attributes,{'tableName':_0xd8b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1737=['moment','request-promise','path','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','api'];(function(_0x341ed4,_0x4ff712){var _0x5cdd35=function(_0x5e76f0){while(--_0x5e76f0){_0x341ed4['push'](_0x341ed4['shift']());}};_0x5cdd35(++_0x4ff712);}(_0x1737,0x147));var _0x7173=function(_0x58cd80,_0x4b54cf){_0x58cd80=_0x58cd80-0x0;var _0x5a2ca1=_0x1737[_0x58cd80];return _0x5a2ca1;};'use strict';var _=require(_0x7173('0x0'));var util=require(_0x7173('0x1'));var logger=require('../../config/logger')(_0x7173('0x2'));var moment=require(_0x7173('0x3'));var BPromise=require('bluebird');var rp=require(_0x7173('0x4'));var fs=require('fs');var path=require(_0x7173('0x5'));var rimraf=require('rimraf');var config=require(_0x7173('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x7173('0x7')]=function(_0x415ad2,_0x411706){return _0x415ad2[_0x7173('0x8')](_0x7173('0x9'),attributes,{'tableName':_0x7173('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index e7082d3..26a507d 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 _0xf350=['activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperAdditionalPhone,\x20%s,\x20%s','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','then','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','catch','SwapAdditionalPhones','ListId','CmHopperAdditionalPhone','duration','isNil','scheduledat','add','minutes','phone','countnoanswerretry','updatedAt','sequelize','update'];(function(_0xe19d21,_0x24bb39){var _0x597448=function(_0x808451){while(--_0x808451){_0xe19d21['push'](_0xe19d21['shift']());}};_0x597448(++_0x24bb39);}(_0xf350,0x1f1));var _0x0f35=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf350[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0f35('0x0'));var util=require(_0x0f35('0x1'));var moment=require(_0x0f35('0x2'));var BPromise=require(_0x0f35('0x3'));var rs=require(_0x0f35('0x4'));var fs=require('fs');var Redis=require(_0x0f35('0x5'));var db=require(_0x0f35('0x6'))['db'];var utils=require(_0x0f35('0x7'));var logger=require(_0x0f35('0x8'))(_0x0f35('0x9'));var config=require(_0x0f35('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0f35('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb2cd08,_0x243ffc,_0x4e764f){return new BPromise(function(_0x3293df,_0x4a0ef2){return client['request'](_0xb2cd08,_0x4e764f)['then'](function(_0x5d110c){logger[_0x0f35('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x243ffc,_0x0f35('0xd'));logger[_0x0f35('0xe')](_0x0f35('0xf'),_0x243ffc,_0x0f35('0xd'),JSON[_0x0f35('0x10')](_0x5d110c));if(_0x5d110c[_0x0f35('0x11')]){if(_0x5d110c[_0x0f35('0x11')][_0x0f35('0x12')]===0x1f4){logger[_0x0f35('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x243ffc,_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);return _0x4a0ef2(_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);}logger[_0x0f35('0x11')](_0x0f35('0x14'),_0x243ffc,_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);return _0x3293df(_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);}else{logger[_0x0f35('0xc')](_0x0f35('0x14'),_0x243ffc,_0x0f35('0xd'));_0x3293df(_0x5d110c['result']['message']);}})['catch'](function(_0x29e870){logger[_0x0f35('0x11')](_0x0f35('0x14'),_0x243ffc,_0x29e870);_0x4a0ef2(_0x29e870);});});}exports[_0x0f35('0x15')]=function(_0xbca74b){var _0x6cf624=this;return new Promise(function(_0x1f1c72,_0x4451bc){return db[_0x0f35('0x16')][_0x0f35('0x17')]({'raw':!![],'where':{'ContactId':_0xbca74b[_0x0f35('0x18')][_0x0f35('0x19')],'ListId':_0xbca74b[_0x0f35('0x18')]['ListId'],'VoiceQueueId':_0xbca74b[_0x0f35('0x18')]['VoiceQueueId']===undefined?null:_0xbca74b[_0x0f35('0x18')][_0x0f35('0x1a')],'CampaignId':_0xbca74b[_0x0f35('0x18')]['CampaignId']===undefined?null:_0xbca74b[_0x0f35('0x18')][_0x0f35('0x1b')]}})[_0x0f35('0x1c')](function(_0x3cae56){if(_0x3cae56!=null){return db['CmHopperAdditionalPhone'][_0x0f35('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3cae56['id'],'OrderBy':{'$gt':_0x3cae56[_0x0f35('0x1d')]}},'order':[['OrderBy',_0x0f35('0x1e')]]})['then'](function(_0x55d779){var _0x9005cb=0x0;if(_0x55d779){if(_0x55d779[_0x0f35('0x1f')]+_0x55d779[_0x0f35('0x20')]+_0x55d779['countnoanswerretry']+_0x55d779[_0x0f35('0x21')]+_0x55d779[_0x0f35('0x22')]+_0x55d779[_0x0f35('0x23')]+_0x55d779[_0x0f35('0x24')]+_0x55d779[_0x0f35('0x25')]<_0xbca74b['entity'][_0x0f35('0x26')])_0x9005cb=0x1;_0x1f1c72({'additional':_0x9005cb});}else{return db['CmHopperAdditionalPhone'][_0x0f35('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3cae56['id']},'order':[[_0x0f35('0x1d'),'ASC']]})['then'](function(_0x1e8a43){var _0x2c0a9b=0x0;if(_0x1e8a43){if(_0x1e8a43['countbusyretry']+_0x1e8a43[_0x0f35('0x20')]+_0x1e8a43['countnoanswerretry']+_0x1e8a43[_0x0f35('0x21')]+_0x1e8a43[_0x0f35('0x22')]+_0x1e8a43['countabandonedretry']+_0x1e8a43[_0x0f35('0x24')]+_0x1e8a43[_0x0f35('0x25')]<_0xbca74b['entity'][_0x0f35('0x26')])_0x2c0a9b=0x1;_0x1f1c72({'additional':_0x2c0a9b});}else{_0x1f1c72({'additional':0x0});}})[_0x0f35('0x27')](function(_0x170ded){logger[_0x0f35('0x11')](_0x0f35('0x15'),_0x170ded[_0x0f35('0x13')]);_0x4451bc(_0x6cf624[_0x0f35('0x11')](0x1f4,_0x170ded[_0x0f35('0x13')]));});}})[_0x0f35('0x27')](function(_0x1e1df6){logger[_0x0f35('0x11')]('VerifyAdditionalPhones',_0x1e1df6['message']);_0x4451bc(_0x6cf624[_0x0f35('0x11')](0x1f4,_0x1e1df6[_0x0f35('0x13')]));});}else _0x1f1c72({'additional':0x0});});});};exports[_0x0f35('0x28')]=function(_0x209be5){var _0x20c3a5=this;return new Promise(function(_0xde50fb,_0x44bddf){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x209be5[_0x0f35('0x18')][_0x0f35('0x19')],'ListId':_0x209be5['body'][_0x0f35('0x29')],'VoiceQueueId':_0x209be5[_0x0f35('0x18')][_0x0f35('0x1a')]===undefined?null:_0x209be5[_0x0f35('0x18')][_0x0f35('0x1a')],'CampaignId':_0x209be5[_0x0f35('0x18')][_0x0f35('0x1b')]===undefined?null:_0x209be5[_0x0f35('0x18')][_0x0f35('0x1b')]}})[_0x0f35('0x1c')](function(_0x47d19a){if(_0x47d19a!=null){return db[_0x0f35('0x2a')][_0x0f35('0x17')]({'raw':!![],'where':{'CmHopperId':_0x47d19a['id'],'OrderBy':{'$gte':_0x47d19a['OrderBy']}},'order':[[_0x0f35('0x1d'),_0x0f35('0x1e')]]})[_0x0f35('0x1c')](function(_0x1a27a6){if(_0x1a27a6)return activateAdditionalPhone(_0x47d19a,_0x209be5[_0x0f35('0x18')],_0x1a27a6,_0x209be5[_0x0f35('0x2b')],_0x209be5['waitTime'])[_0x0f35('0x1c')](function(_0x3ef6e8){_0xde50fb(_0x3ef6e8);});else{return db[_0x0f35('0x2a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x47d19a['id']},'order':[[_0x0f35('0x1d'),'ASC']]})[_0x0f35('0x1c')](function(_0x2703d5){if(_0x2703d5)return activateAdditionalPhone(_0x47d19a,_0x209be5[_0x0f35('0x18')],_0x2703d5,_0x209be5[_0x0f35('0x2b')],_0x209be5['waitTime'])[_0x0f35('0x1c')](function(_0x34e768){_0xde50fb(_0x34e768);});else{_0xde50fb({'id':_0x47d19a['id'],'phone':''});}})['catch'](function(_0x7912f6){logger[_0x0f35('0x11')](_0x0f35('0x15'),_0x7912f6[_0x0f35('0x13')]);_0x44bddf(_0x20c3a5[_0x0f35('0x11')](0x1f4,_0x7912f6[_0x0f35('0x13')]));});}})[_0x0f35('0x27')](function(_0x510220){logger[_0x0f35('0x11')](_0x0f35('0x15'),_0x510220[_0x0f35('0x13')]);_0x44bddf(_0x20c3a5['error'](0x1f4,_0x510220[_0x0f35('0x13')]));});}else _0xde50fb(0x1);});});};function activateAdditionalPhone(_0x1a40e3,_0xf569ea,_0x48320c,_0x1ce84c,_0x1f7712){return new Promise(function(_0x533d28,_0x20ac1e){var _0xe98f6f;if(_[_0x0f35('0x2c')](_0x48320c[_0x0f35('0x2d')])){_0x48320c[_0x0f35('0x2d')]=moment();}if(moment()>moment(_0x48320c[_0x0f35('0x2d')])){_0xe98f6f=moment()[_0x0f35('0x2e')](_0x1f7712||0x3,_0x0f35('0x2f'));}else{if(_0x48320c[_0x0f35('0x1d')]==0x0){_0xe98f6f=moment(_0x48320c[_0x0f35('0x2d')]);}else{_0xe98f6f=moment()[_0x0f35('0x2e')](_0x1f7712||0x3,_0x0f35('0x2f'));}}if(_[_0x0f35('0x2c')](_0xe98f6f)){_0xe98f6f=moment()[_0x0f35('0x2e')](_0x1f7712||0x3,_0x0f35('0x2f'));}var _0x3f37bd={'phone':_0x1a40e3[_0x0f35('0x30')],'active':0x0,'OrderBy':_[_0x0f35('0x2c')](_0x1a40e3['OrderBy'])?0x0:_0x1a40e3[_0x0f35('0x1d')],'scheduledat':moment()[_0x0f35('0x2e')](_0x1ce84c||0x1,_0x0f35('0x2f')),'countbusyretry':_0xf569ea[_0x0f35('0x1f')],'countcongestionretry':_0xf569ea[_0x0f35('0x20')],'countnoanswerretry':_0xf569ea[_0x0f35('0x31')],'countnosuchnumberretry':_0xf569ea[_0x0f35('0x21')],'countdropretry':_0xf569ea[_0x0f35('0x22')],'countabandonedretry':_0xf569ea[_0x0f35('0x23')],'countmachineretry':_0xf569ea[_0x0f35('0x24')],'countagentrejectretry':_0xf569ea['countagentrejectretry'],'createdAt':_0xf569ea['createdAt'],'updatedAt':_0xf569ea[_0x0f35('0x32')]};var _0x4f37f4={'CmHopperId':_0x1a40e3['id'],'phone':_0x48320c[_0x0f35('0x30')],'active':0x0,'OrderBy':_[_0x0f35('0x2c')](_0x48320c['OrderBy'])?0x0:_0x48320c['OrderBy'],'scheduledat':_0xe98f6f,'countbusyretry':_0x48320c[_0x0f35('0x1f')],'countcongestionretry':_0x48320c[_0x0f35('0x20')],'countnoanswerretry':_0x48320c['countnoanswerretry'],'countnosuchnumberretry':_0x48320c[_0x0f35('0x21')],'countdropretry':_0x48320c['countdropretry'],'countabandonedretry':_0x48320c[_0x0f35('0x23')],'countmachineretry':_0x48320c[_0x0f35('0x24')],'countagentrejectretry':_0x48320c[_0x0f35('0x25')],'createdAt':_0x48320c['createdAt'],'updatedAt':_0x48320c[_0x0f35('0x32')]};return db[_0x0f35('0x33')]['transaction'](function(_0x268100){return db['CmHopperAdditionalPhone'][_0x0f35('0x34')](_0x3f37bd,{'where':{'id':_0x48320c['id']}},{'transaction':_0x268100})[_0x0f35('0x1c')](function(){return db['CmHopper']['update'](_0x4f37f4,{'where':{'id':_0x1a40e3['id']}},{'transaction':_0x268100});});})[_0x0f35('0x1c')](function(_0x2b7e98){_0x533d28({'id':_0x1a40e3['id'],'phone':_0x48320c[_0x0f35('0x30')]});})[_0x0f35('0x27')](function(_0xb51128){logger[_0x0f35('0x11')](_0x0f35('0x35'),_0xb51128[_0x0f35('0x13')]);_0x20ac1e({'error':_0xb51128[_0x0f35('0x13')]});});});}exports[_0x0f35('0x36')]=function(_0x4d9941){var _0x10949c=this;return new Promise(function(_0x3cfa9d,_0x2e6b48){return db[_0x0f35('0x16')][_0x0f35('0x34')](_0x4d9941[_0x0f35('0x18')]['field'],{'where':{'id':_0x4d9941[_0x0f35('0x18')]['id']}})['then'](function(_0x309fdf){_0x3cfa9d(_0x309fdf);})['catch'](function(_0x4fd296){logger[_0x0f35('0x11')](_0x0f35('0x36'),_0x4fd296[_0x0f35('0x13')]);_0x2e6b48(_0x10949c[_0x0f35('0x11')](0x1f4,_0x4fd296[_0x0f35('0x13')]));});});}; \ No newline at end of file +var _0xe607=['isNil','scheduledat','minutes','add','countnosuchnumberretry','countdropretry','createdAt','updatedAt','update','phone','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','VerifyAdditionalPhones','CmHopper','body','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','ASC','countbusyretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','CmHopperAdditionalPhone','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','catch','SwapAdditionalPhones','ContactId','duration','waitTime'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xe607,0x7f));var _0x7e60=function(_0x7d47a1,_0x4b18f2){_0x7d47a1=_0x7d47a1-0x0;var _0x508eaa=_0xe607[_0x7d47a1];return _0x508eaa;};'use strict';var _=require(_0x7e60('0x0'));var util=require(_0x7e60('0x1'));var moment=require(_0x7e60('0x2'));var BPromise=require(_0x7e60('0x3'));var rs=require(_0x7e60('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e60('0x5'))['db'];var utils=require(_0x7e60('0x6'));var logger=require('../../config/logger')(_0x7e60('0x7'));var config=require(_0x7e60('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7e60('0x9')][_0x7e60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c853f,_0x101a7d,_0x258e24){return new BPromise(function(_0x261ebf,_0xe15cac){return client['request'](_0x5c853f,_0x258e24)[_0x7e60('0xb')](function(_0x1a9c40){logger[_0x7e60('0xc')](_0x7e60('0xd'),_0x101a7d,_0x7e60('0xe'));logger[_0x7e60('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x101a7d,_0x7e60('0xe'),JSON[_0x7e60('0x10')](_0x1a9c40));if(_0x1a9c40[_0x7e60('0x11')]){if(_0x1a9c40[_0x7e60('0x11')][_0x7e60('0x12')]===0x1f4){logger[_0x7e60('0x11')](_0x7e60('0xd'),_0x101a7d,_0x1a9c40[_0x7e60('0x11')][_0x7e60('0x13')]);return _0xe15cac(_0x1a9c40[_0x7e60('0x11')][_0x7e60('0x13')]);}logger['error'](_0x7e60('0xd'),_0x101a7d,_0x1a9c40[_0x7e60('0x11')]['message']);return _0x261ebf(_0x1a9c40['error'][_0x7e60('0x13')]);}else{logger[_0x7e60('0xc')](_0x7e60('0xd'),_0x101a7d,_0x7e60('0xe'));_0x261ebf(_0x1a9c40[_0x7e60('0x14')][_0x7e60('0x13')]);}})['catch'](function(_0x97f007){logger['error'](_0x7e60('0xd'),_0x101a7d,_0x97f007);_0xe15cac(_0x97f007);});});}exports[_0x7e60('0x15')]=function(_0x14d704){var _0xc3a720=this;return new Promise(function(_0x180d28,_0x555ff6){return db[_0x7e60('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x14d704[_0x7e60('0x17')]['ContactId'],'ListId':_0x14d704[_0x7e60('0x17')][_0x7e60('0x18')],'VoiceQueueId':_0x14d704[_0x7e60('0x17')][_0x7e60('0x19')]===undefined?null:_0x14d704['body'][_0x7e60('0x19')],'CampaignId':_0x14d704[_0x7e60('0x17')][_0x7e60('0x1a')]===undefined?null:_0x14d704['body'][_0x7e60('0x1a')]}})[_0x7e60('0xb')](function(_0x54cb1f){if(_0x54cb1f!=null){return db['CmHopperAdditionalPhone'][_0x7e60('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x54cb1f['id'],'OrderBy':{'$gt':_0x54cb1f[_0x7e60('0x1c')]}},'order':[['OrderBy',_0x7e60('0x1d')]]})[_0x7e60('0xb')](function(_0x3befca){var _0xeaf722=0x0;if(_0x3befca){if(_0x3befca[_0x7e60('0x1e')]+_0x3befca['countcongestionretry']+_0x3befca['countnoanswerretry']+_0x3befca['countnosuchnumberretry']+_0x3befca['countdropretry']+_0x3befca[_0x7e60('0x1f')]+_0x3befca[_0x7e60('0x20')]+_0x3befca[_0x7e60('0x21')]<_0x14d704[_0x7e60('0x22')]['dialGlobalMaxRetry'])_0xeaf722=0x1;_0x180d28({'additional':_0xeaf722});}else{return db[_0x7e60('0x23')][_0x7e60('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x54cb1f['id']},'order':[[_0x7e60('0x1c'),_0x7e60('0x1d')]]})[_0x7e60('0xb')](function(_0x282843){var _0x19d5ba=0x0;if(_0x282843){if(_0x282843['countbusyretry']+_0x282843[_0x7e60('0x24')]+_0x282843[_0x7e60('0x25')]+_0x282843['countnosuchnumberretry']+_0x282843['countdropretry']+_0x282843[_0x7e60('0x1f')]+_0x282843[_0x7e60('0x20')]+_0x282843['countagentrejectretry']<_0x14d704['entity'][_0x7e60('0x26')])_0x19d5ba=0x1;_0x180d28({'additional':_0x19d5ba});}else{_0x180d28({'additional':0x0});}})[_0x7e60('0x27')](function(_0x5d30c8){logger[_0x7e60('0x11')](_0x7e60('0x15'),_0x5d30c8[_0x7e60('0x13')]);_0x555ff6(_0xc3a720[_0x7e60('0x11')](0x1f4,_0x5d30c8[_0x7e60('0x13')]));});}})['catch'](function(_0x28e1bf){logger[_0x7e60('0x11')](_0x7e60('0x15'),_0x28e1bf['message']);_0x555ff6(_0xc3a720['error'](0x1f4,_0x28e1bf['message']));});}else _0x180d28({'additional':0x0});});});};exports[_0x7e60('0x28')]=function(_0x14a1e9){var _0x248d8d=this;return new Promise(function(_0x234f90,_0x15a534){return db[_0x7e60('0x16')][_0x7e60('0x1b')]({'raw':!![],'where':{'ContactId':_0x14a1e9[_0x7e60('0x17')][_0x7e60('0x29')],'ListId':_0x14a1e9[_0x7e60('0x17')]['ListId'],'VoiceQueueId':_0x14a1e9['body'][_0x7e60('0x19')]===undefined?null:_0x14a1e9['body'][_0x7e60('0x19')],'CampaignId':_0x14a1e9[_0x7e60('0x17')][_0x7e60('0x1a')]===undefined?null:_0x14a1e9[_0x7e60('0x17')][_0x7e60('0x1a')]}})[_0x7e60('0xb')](function(_0xc04814){if(_0xc04814!=null){return db[_0x7e60('0x23')][_0x7e60('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xc04814['id'],'OrderBy':{'$gte':_0xc04814[_0x7e60('0x1c')]}},'order':[[_0x7e60('0x1c'),'ASC']]})[_0x7e60('0xb')](function(_0xcbbbf4){if(_0xcbbbf4)return activateAdditionalPhone(_0xc04814,_0x14a1e9['body'],_0xcbbbf4,_0x14a1e9[_0x7e60('0x2a')],_0x14a1e9[_0x7e60('0x2b')])['then'](function(_0x4018a7){_0x234f90(_0x4018a7);});else{return db[_0x7e60('0x23')][_0x7e60('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xc04814['id']},'order':[[_0x7e60('0x1c'),_0x7e60('0x1d')]]})[_0x7e60('0xb')](function(_0xf037da){if(_0xf037da)return activateAdditionalPhone(_0xc04814,_0x14a1e9[_0x7e60('0x17')],_0xf037da,_0x14a1e9[_0x7e60('0x2a')],_0x14a1e9[_0x7e60('0x2b')])['then'](function(_0x3f6457){_0x234f90(_0x3f6457);});else{_0x234f90({'id':_0xc04814['id'],'phone':''});}})[_0x7e60('0x27')](function(_0xc0302a){logger[_0x7e60('0x11')](_0x7e60('0x15'),_0xc0302a[_0x7e60('0x13')]);_0x15a534(_0x248d8d[_0x7e60('0x11')](0x1f4,_0xc0302a[_0x7e60('0x13')]));});}})[_0x7e60('0x27')](function(_0x526a11){logger[_0x7e60('0x11')]('VerifyAdditionalPhones',_0x526a11[_0x7e60('0x13')]);_0x15a534(_0x248d8d['error'](0x1f4,_0x526a11[_0x7e60('0x13')]));});}else _0x234f90(0x1);});});};function activateAdditionalPhone(_0xec3a2d,_0x28f5f4,_0x2da9f9,_0xa37fac,_0x594a41){return new Promise(function(_0x20ffa7,_0x3a7681){var _0x5ee243;if(_[_0x7e60('0x2c')](_0x2da9f9[_0x7e60('0x2d')])){_0x2da9f9[_0x7e60('0x2d')]=moment();}if(moment()>moment(_0x2da9f9[_0x7e60('0x2d')])){_0x5ee243=moment()['add'](_0x594a41||0x3,_0x7e60('0x2e'));}else{if(_0x2da9f9[_0x7e60('0x1c')]==0x0){_0x5ee243=moment(_0x2da9f9[_0x7e60('0x2d')]);}else{_0x5ee243=moment()[_0x7e60('0x2f')](_0x594a41||0x3,_0x7e60('0x2e'));}}if(_[_0x7e60('0x2c')](_0x5ee243)){_0x5ee243=moment()['add'](_0x594a41||0x3,_0x7e60('0x2e'));}var _0x3c7d58={'phone':_0xec3a2d['phone'],'active':0x0,'OrderBy':_[_0x7e60('0x2c')](_0xec3a2d[_0x7e60('0x1c')])?0x0:_0xec3a2d[_0x7e60('0x1c')],'scheduledat':moment()[_0x7e60('0x2f')](_0xa37fac||0x1,_0x7e60('0x2e')),'countbusyretry':_0x28f5f4[_0x7e60('0x1e')],'countcongestionretry':_0x28f5f4[_0x7e60('0x24')],'countnoanswerretry':_0x28f5f4[_0x7e60('0x25')],'countnosuchnumberretry':_0x28f5f4[_0x7e60('0x30')],'countdropretry':_0x28f5f4[_0x7e60('0x31')],'countabandonedretry':_0x28f5f4[_0x7e60('0x1f')],'countmachineretry':_0x28f5f4['countmachineretry'],'countagentrejectretry':_0x28f5f4[_0x7e60('0x21')],'createdAt':_0x28f5f4[_0x7e60('0x32')],'updatedAt':_0x28f5f4[_0x7e60('0x33')]};var _0x1abfdb={'CmHopperId':_0xec3a2d['id'],'phone':_0x2da9f9['phone'],'active':0x0,'OrderBy':_[_0x7e60('0x2c')](_0x2da9f9['OrderBy'])?0x0:_0x2da9f9['OrderBy'],'scheduledat':_0x5ee243,'countbusyretry':_0x2da9f9[_0x7e60('0x1e')],'countcongestionretry':_0x2da9f9[_0x7e60('0x24')],'countnoanswerretry':_0x2da9f9['countnoanswerretry'],'countnosuchnumberretry':_0x2da9f9[_0x7e60('0x30')],'countdropretry':_0x2da9f9['countdropretry'],'countabandonedretry':_0x2da9f9[_0x7e60('0x1f')],'countmachineretry':_0x2da9f9[_0x7e60('0x20')],'countagentrejectretry':_0x2da9f9[_0x7e60('0x21')],'createdAt':_0x2da9f9[_0x7e60('0x32')],'updatedAt':_0x2da9f9[_0x7e60('0x33')]};return db['sequelize']['transaction'](function(_0x1e06d4){return db['CmHopperAdditionalPhone'][_0x7e60('0x34')](_0x3c7d58,{'where':{'id':_0x2da9f9['id']}},{'transaction':_0x1e06d4})[_0x7e60('0xb')](function(){return db[_0x7e60('0x16')]['update'](_0x1abfdb,{'where':{'id':_0xec3a2d['id']}},{'transaction':_0x1e06d4});});})[_0x7e60('0xb')](function(_0x428e28){_0x20ffa7({'id':_0xec3a2d['id'],'phone':_0x2da9f9[_0x7e60('0x35')]});})['catch'](function(_0x547671){logger[_0x7e60('0x11')](_0x7e60('0x36'),_0x547671[_0x7e60('0x13')]);_0x3a7681({'error':_0x547671[_0x7e60('0x13')]});});});}exports[_0x7e60('0x37')]=function(_0x5bb7e8){var _0x51c964=this;return new Promise(function(_0x1e3d70,_0x34038c){return db['CmHopper'][_0x7e60('0x34')](_0x5bb7e8[_0x7e60('0x17')][_0x7e60('0x38')],{'where':{'id':_0x5bb7e8[_0x7e60('0x17')]['id']}})[_0x7e60('0xb')](function(_0x170609){_0x1e3d70(_0x170609);})[_0x7e60('0x27')](function(_0x573c1a){logger[_0x7e60('0x11')]('IncrementPreviewCounters',_0x573c1a['message']);_0x34038c(_0x51c964[_0x7e60('0x11')](0x1f4,_0x573c1a[_0x7e60('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 0f10b85..bd80aba 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 _0xe35c=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x41d215,_0x3efdea){var _0x549c1f=function(_0x5b9501){while(--_0x5b9501){_0x41d215['push'](_0x41d215['shift']());}};_0x549c1f(++_0x3efdea);}(_0xe35c,0xd5));var _0xce35=function(_0x5d3ba2,_0x45b47b){_0x5d3ba2=_0x5d3ba2-0x0;var _0x790c6d=_0xe35c[_0x5d3ba2];return _0x790c6d;};'use strict';var multer=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var path=require(_0xce35('0x2'));var timeout=require(_0xce35('0x3'));var express=require(_0xce35('0x4'));var router=express[_0xce35('0x5')]();var fs_extra=require(_0xce35('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xce35('0x7'));var config=require(_0xce35('0x8'));var controller=require(_0xce35('0x9'));router[_0xce35('0xa')]('/',auth[_0xce35('0xb')](),controller[_0xce35('0xc')]);router[_0xce35('0xa')](_0xce35('0xd'),auth[_0xce35('0xb')](),controller[_0xce35('0xe')]);router[_0xce35('0xf')]('/',auth[_0xce35('0xb')](),controller[_0xce35('0x10')]);router[_0xce35('0x11')](_0xce35('0xd'),auth[_0xce35('0xb')](),controller[_0xce35('0x12')]);router[_0xce35('0x13')](_0xce35('0xd'),auth[_0xce35('0xb')](),controller['destroy']);module[_0xce35('0x14')]=router; \ No newline at end of file +var _0xb64c=['index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x29a4b3,_0x49e41d){var _0x3e5827=function(_0x408524){while(--_0x408524){_0x29a4b3['push'](_0x29a4b3['shift']());}};_0x3e5827(++_0x49e41d);}(_0xb64c,0xc7));var _0xcb64=function(_0x545e64,_0x356844){_0x545e64=_0x545e64-0x0;var _0x13dbef=_0xb64c[_0x545e64];return _0x13dbef;};'use strict';var multer=require(_0xcb64('0x0'));var util=require(_0xcb64('0x1'));var path=require(_0xcb64('0x2'));var timeout=require(_0xcb64('0x3'));var express=require(_0xcb64('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcb64('0x5'));var interaction=require(_0xcb64('0x6'));var config=require('../../config/environment');var controller=require(_0xcb64('0x7'));router[_0xcb64('0x8')]('/',auth[_0xcb64('0x9')](),controller[_0xcb64('0xa')]);router[_0xcb64('0x8')](_0xcb64('0xb'),auth['isAuthenticated'](),controller[_0xcb64('0xc')]);router[_0xcb64('0xd')]('/',auth['isAuthenticated'](),controller[_0xcb64('0xe')]);router[_0xcb64('0xf')](_0xcb64('0xb'),auth[_0xcb64('0x9')](),controller[_0xcb64('0x10')]);router[_0xcb64('0x11')](_0xcb64('0xb'),auth[_0xcb64('0x9')](),controller['destroy']);module[_0xcb64('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 46382d8..34ce59b 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 _0x6778=['contactListQueue','moment','sequelize','exports','INTEGER'];(function(_0x17be97,_0x49be52){var _0x4901f3=function(_0x790e4a){while(--_0x790e4a){_0x17be97['push'](_0x17be97['shift']());}};_0x4901f3(++_0x49be52);}(_0x6778,0x1d2));var _0x8677=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x6778[_0x4394b6];return _0x360244;};'use strict';var moment=require(_0x8677('0x0'));var Sequelize=require(_0x8677('0x1'));module[_0x8677('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8677('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8677('0x3')],'unique':_0x8677('0x4')},'VoiceQueueId':{'type':Sequelize[_0x8677('0x3')],'unique':_0x8677('0x4')}}; \ No newline at end of file +var _0x737d=['sequelize','INTEGER','moment'];(function(_0x5b87ce,_0x20b7f6){var _0x597aa7=function(_0x295004){while(--_0x295004){_0x5b87ce['push'](_0x5b87ce['shift']());}};_0x597aa7(++_0x20b7f6);}(_0x737d,0xbc));var _0xd737=function(_0x50b484,_0x2b3001){_0x50b484=_0x50b484-0x0;var _0x147156=_0x737d[_0x50b484];return _0x147156;};'use strict';var moment=require(_0xd737('0x0'));var Sequelize=require(_0xd737('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xd737('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xd737('0x2')],'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 4a8970f..4e1e345 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 _0x3287=['count','Content-Range','apply','reject','then','destroy','sendStatus','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','keys','query','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','rows','catch','show','options','find','update','body','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined'];(function(_0x5b09ac,_0x298dcb){var _0x3ce3ce=function(_0x1bb7b2){while(--_0x1bb7b2){_0x5b09ac['push'](_0x5b09ac['shift']());}};_0x3ce3ce(++_0x298dcb);}(_0x3287,0x6e));var _0x7328=function(_0x4b1a17,_0x1cd2d4){_0x4b1a17=_0x4b1a17-0x0;var _0x309e36=_0x3287[_0x4b1a17];return _0x309e36;};'use strict';var emlformat=require(_0x7328('0x0'));var rimraf=require(_0x7328('0x1'));var zipdir=require(_0x7328('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7328('0x3'));var Mustache=require(_0x7328('0x4'));var util=require(_0x7328('0x5'));var path=require(_0x7328('0x6'));var sox=require(_0x7328('0x7'));var csv=require('to-csv');var ejs=require(_0x7328('0x8'));var fs=require('fs');var fs_extra=require(_0x7328('0x9'));var _=require(_0x7328('0xa'));var squel=require(_0x7328('0xb'));var crypto=require(_0x7328('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7328('0xd'));var toCsv=require(_0x7328('0xe'));var querystring=require(_0x7328('0xf'));var Papa=require(_0x7328('0x10'));var Redis=require(_0x7328('0x11'));var authService=require(_0x7328('0x12'));var qs=require(_0x7328('0x13'));var as=require(_0x7328('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7328('0x15'))(_0x7328('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7328('0x17'));var db=require(_0x7328('0x18'))['db'];function respondWithStatusCode(_0x521d52,_0x51eca3){_0x51eca3=_0x51eca3||0xcc;return function(_0x4cf788){if(_0x4cf788){return _0x521d52['sendStatus'](_0x51eca3);}return _0x521d52[_0x7328('0x19')](_0x51eca3)['end']();};}function respondWithResult(_0x543b18,_0x5017db){_0x5017db=_0x5017db||0xc8;return function(_0x476d8c){if(_0x476d8c){return _0x543b18[_0x7328('0x19')](_0x5017db)[_0x7328('0x1a')](_0x476d8c);}};}function respondWithFilteredResult(_0x1df4da,_0x5df00f){return function(_0x26121f){if(_0x26121f){var _0x365a07=typeof _0x5df00f[_0x7328('0x1b')]==='undefined'&&typeof _0x5df00f[_0x7328('0x1c')]===_0x7328('0x1d');var _0x1703eb=_0x26121f['count'];var _0x2a2e5f=_0x365a07?0x0:_0x5df00f[_0x7328('0x1b')];var _0x495f4f=_0x365a07?_0x26121f[_0x7328('0x1e')]:_0x5df00f[_0x7328('0x1b')]+_0x5df00f[_0x7328('0x1c')];var _0x3b3b32;if(_0x495f4f>=_0x1703eb){_0x495f4f=_0x1703eb;_0x3b3b32=0xc8;}else{_0x3b3b32=0xce;}_0x1df4da['status'](_0x3b3b32);return _0x1df4da['set'](_0x7328('0x1f'),_0x2a2e5f+'-'+_0x495f4f+'/'+_0x1703eb)[_0x7328('0x1a')](_0x26121f);}return null;};}function patchUpdates(_0x3b57af){return function(_0x3205d0){try{jsonpatch[_0x7328('0x20')](_0x3205d0,_0x3b57af,!![]);}catch(_0x57f192){return BPromise[_0x7328('0x21')](_0x57f192);}return _0x3205d0['save']();};}function saveUpdates(_0x531f81,_0x246fcf){return function(_0x16b4d6){if(_0x16b4d6){return _0x16b4d6['update'](_0x531f81)[_0x7328('0x22')](function(_0x457e06){return _0x457e06;});}return null;};}function removeEntity(_0x182fc4,_0x10938f){return function(_0x59a4d9){if(_0x59a4d9){return _0x59a4d9[_0x7328('0x23')]()[_0x7328('0x22')](function(){_0x182fc4[_0x7328('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ad8d4,_0x396012){return function(_0xfe1265){if(!_0xfe1265){_0x2ad8d4[_0x7328('0x24')](0x194);}return _0xfe1265;};}function handleError(_0x51cee7,_0x15ab81){_0x15ab81=_0x15ab81||0x1f4;return function(_0x33d275){logger['error'](_0x33d275['stack']);if(_0x33d275[_0x7328('0x25')]){delete _0x33d275[_0x7328('0x25')];}_0x51cee7[_0x7328('0x19')](_0x15ab81)[_0x7328('0x26')](_0x33d275);};}exports[_0x7328('0x27')]=function(_0x1891d8,_0x1524e8){var _0x256db9={},_0x1bb950={},_0x5c018d={'count':0x0,'rows':[]};var _0x202caa=_[_0x7328('0x28')](db[_0x7328('0x29')][_0x7328('0x2a')],function(_0x184580){return{'name':_0x184580[_0x7328('0x2b')],'type':_0x184580[_0x7328('0x2c')]['key']};});_0x1bb950['model']=_['map'](_0x202caa,_0x7328('0x25'));_0x1bb950['query']=_[_0x7328('0x2d')](_0x1891d8[_0x7328('0x2e')]);_0x1bb950['filters']=_[_0x7328('0x2f')](_0x1bb950[_0x7328('0x30')],_0x1bb950[_0x7328('0x2e')]);_0x256db9['attributes']=_[_0x7328('0x2f')](_0x1bb950[_0x7328('0x30')],qs[_0x7328('0x31')](_0x1891d8[_0x7328('0x2e')][_0x7328('0x31')]));_0x256db9[_0x7328('0x32')]=_0x256db9['attributes'][_0x7328('0x33')]?_0x256db9[_0x7328('0x32')]:_0x1bb950[_0x7328('0x30')];if(!_0x1891d8[_0x7328('0x2e')]['hasOwnProperty'](_0x7328('0x34'))){_0x256db9[_0x7328('0x1c')]=qs[_0x7328('0x1c')](_0x1891d8[_0x7328('0x2e')]['limit']);_0x256db9['offset']=qs[_0x7328('0x1b')](_0x1891d8[_0x7328('0x2e')][_0x7328('0x1b')]);}_0x256db9['order']=qs[_0x7328('0x35')](_0x1891d8[_0x7328('0x2e')][_0x7328('0x35')]);_0x256db9[_0x7328('0x36')]=qs['filters'](_[_0x7328('0x37')](_0x1891d8['query'],_0x1bb950[_0x7328('0x38')]),_0x202caa);if(_0x1891d8[_0x7328('0x2e')]['filter']){_0x256db9['where']=_['merge'](_0x256db9[_0x7328('0x36')],{'$or':_[_0x7328('0x28')](_0x202caa,function(_0x5b7866){if(_0x5b7866[_0x7328('0x2c')]!=='VIRTUAL'){var _0x23ab94={};_0x23ab94[_0x5b7866['name']]={'$like':'%'+_0x1891d8['query'][_0x7328('0x39')]+'%'};return _0x23ab94;}})});}_0x256db9=_[_0x7328('0x3a')]({},_0x256db9,_0x1891d8['options']);var _0x41ef2a={'where':_0x256db9[_0x7328('0x36')]};return db[_0x7328('0x29')][_0x7328('0x1e')](_0x41ef2a)['then'](function(_0x213962){_0x5c018d[_0x7328('0x1e')]=_0x213962;if(_0x1891d8[_0x7328('0x2e')][_0x7328('0x3b')]){_0x256db9[_0x7328('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x256db9);})[_0x7328('0x22')](function(_0x202b54){_0x5c018d[_0x7328('0x3d')]=_0x202b54;return _0x5c018d;})[_0x7328('0x22')](respondWithFilteredResult(_0x1524e8,_0x256db9))[_0x7328('0x3e')](handleError(_0x1524e8,null));};exports[_0x7328('0x3f')]=function(_0x722335,_0x59a89a){var _0x14e02c={'raw':!![],'where':{'id':_0x722335['params']['id']}},_0x55bd4a={};_0x55bd4a[_0x7328('0x30')]=_[_0x7328('0x2d')](db['CmHopperBlack'][_0x7328('0x2a')]);_0x55bd4a[_0x7328('0x2e')]=_['keys'](_0x722335[_0x7328('0x2e')]);_0x55bd4a['filters']=_['intersection'](_0x55bd4a[_0x7328('0x30')],_0x55bd4a[_0x7328('0x2e')]);_0x14e02c[_0x7328('0x32')]=_[_0x7328('0x2f')](_0x55bd4a[_0x7328('0x30')],qs['fields'](_0x722335[_0x7328('0x2e')][_0x7328('0x31')]));_0x14e02c[_0x7328('0x32')]=_0x14e02c[_0x7328('0x32')][_0x7328('0x33')]?_0x14e02c[_0x7328('0x32')]:_0x55bd4a[_0x7328('0x30')];if(_0x722335[_0x7328('0x2e')]['includeAll']){_0x14e02c[_0x7328('0x3c')]=[{'all':!![]}];}_0x14e02c=_['merge']({},_0x14e02c,_0x722335[_0x7328('0x40')]);return db[_0x7328('0x29')][_0x7328('0x41')](_0x14e02c)[_0x7328('0x22')](handleEntityNotFound(_0x59a89a,null))['then'](respondWithResult(_0x59a89a,null))[_0x7328('0x3e')](handleError(_0x59a89a,null));};exports[_0x7328('0x42')]=function(_0x297360,_0x42657e){if(_0x297360[_0x7328('0x43')]['id']){delete _0x297360[_0x7328('0x43')]['id'];}return db['CmHopperBlack'][_0x7328('0x41')]({'where':{'id':_0x297360[_0x7328('0x44')]['id']}})['then'](handleEntityNotFound(_0x42657e,null))['then'](saveUpdates(_0x297360[_0x7328('0x43')],null))[_0x7328('0x22')](respondWithResult(_0x42657e,null))['catch'](handleError(_0x42657e,null));};exports['destroy']=function(_0x16ffed,_0x242250){return db['CmHopperBlack'][_0x7328('0x41')]({'where':{'id':_0x16ffed[_0x7328('0x44')]['id']}})[_0x7328('0x22')](handleEntityNotFound(_0x242250,null))['then'](removeEntity(_0x242250,null))[_0x7328('0x3e')](handleError(_0x242250,null));};exports[_0x7328('0x45')]=function(_0x30de73,_0x5882c3){return db[_0x7328('0x29')][_0x7328('0x45')]()[_0x7328('0x22')](respondWithResult(_0x5882c3,null))[_0x7328('0x3e')](handleError(_0x5882c3,null));}; \ No newline at end of file +var _0x9ec5=['sort','where','filter','merge','VIRTUAL','CmHopperBlack','then','includeAll','findAll','catch','show','params','options','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','apply','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x9ec5,0x1e6));var _0x59ec=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0x9ec5[_0x212fcc];return _0x4d8190;};'use strict';var emlformat=require(_0x59ec('0x0'));var rimraf=require(_0x59ec('0x1'));var zipdir=require(_0x59ec('0x2'));var jsonpatch=require(_0x59ec('0x3'));var rp=require(_0x59ec('0x4'));var moment=require(_0x59ec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x59ec('0x6'));var util=require(_0x59ec('0x7'));var path=require(_0x59ec('0x8'));var sox=require('sox');var csv=require(_0x59ec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59ec('0xa'));var _=require(_0x59ec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x59ec('0x9'));var querystring=require(_0x59ec('0xc'));var Papa=require('papaparse');var Redis=require(_0x59ec('0xd'));var authService=require(_0x59ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x59ec('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59ec('0x10'))(_0x59ec('0x11'));var utils=require(_0x59ec('0x12'));var config=require(_0x59ec('0x13'));var licenseUtil=require(_0x59ec('0x14'));var db=require(_0x59ec('0x15'))['db'];function respondWithStatusCode(_0x1351d7,_0x5ac19f){_0x5ac19f=_0x5ac19f||0xcc;return function(_0x4189eb){if(_0x4189eb){return _0x1351d7[_0x59ec('0x16')](_0x5ac19f);}return _0x1351d7[_0x59ec('0x17')](_0x5ac19f)[_0x59ec('0x18')]();};}function respondWithResult(_0x1dd200,_0x240003){_0x240003=_0x240003||0xc8;return function(_0x34e730){if(_0x34e730){return _0x1dd200['status'](_0x240003)[_0x59ec('0x19')](_0x34e730);}};}function respondWithFilteredResult(_0x1b863e,_0x176948){return function(_0x13cbe6){if(_0x13cbe6){var _0x25816d=typeof _0x176948['offset']===_0x59ec('0x1a')&&typeof _0x176948['limit']===_0x59ec('0x1a');var _0x27c057=_0x13cbe6[_0x59ec('0x1b')];var _0x3c633=_0x25816d?0x0:_0x176948[_0x59ec('0x1c')];var _0x21cf1a=_0x25816d?_0x13cbe6['count']:_0x176948[_0x59ec('0x1c')]+_0x176948[_0x59ec('0x1d')];var _0x44ff7b;if(_0x21cf1a>=_0x27c057){_0x21cf1a=_0x27c057;_0x44ff7b=0xc8;}else{_0x44ff7b=0xce;}_0x1b863e[_0x59ec('0x17')](_0x44ff7b);return _0x1b863e['set']('Content-Range',_0x3c633+'-'+_0x21cf1a+'/'+_0x27c057)['json'](_0x13cbe6);}return null;};}function patchUpdates(_0x4234c5){return function(_0x17ee4a){try{jsonpatch[_0x59ec('0x1e')](_0x17ee4a,_0x4234c5,!![]);}catch(_0x20dec8){return BPromise['reject'](_0x20dec8);}return _0x17ee4a['save']();};}function saveUpdates(_0x3bb540,_0x333846){return function(_0x5c8ecc){if(_0x5c8ecc){return _0x5c8ecc['update'](_0x3bb540)['then'](function(_0x4155c4){return _0x4155c4;});}return null;};}function removeEntity(_0x5da4a4,_0x3fdf33){return function(_0x11d8e4){if(_0x11d8e4){return _0x11d8e4[_0x59ec('0x1f')]()['then'](function(){_0x5da4a4[_0x59ec('0x17')](0xcc)[_0x59ec('0x18')]();});}};}function handleEntityNotFound(_0x2a0a3f,_0x34cb07){return function(_0x1cb01a){if(!_0x1cb01a){_0x2a0a3f[_0x59ec('0x16')](0x194);}return _0x1cb01a;};}function handleError(_0x4ffe9a,_0x3b9c9f){_0x3b9c9f=_0x3b9c9f||0x1f4;return function(_0x541db7){logger[_0x59ec('0x20')](_0x541db7[_0x59ec('0x21')]);if(_0x541db7[_0x59ec('0x22')]){delete _0x541db7['name'];}_0x4ffe9a[_0x59ec('0x17')](_0x3b9c9f)['send'](_0x541db7);};}exports[_0x59ec('0x23')]=function(_0x8f1393,_0x5c5217){var _0x1f13db={},_0x36c7a1={},_0x24beb9={'count':0x0,'rows':[]};var _0x54bebd=_[_0x59ec('0x24')](db['CmHopperBlack'][_0x59ec('0x25')],function(_0x2bf939){return{'name':_0x2bf939[_0x59ec('0x26')],'type':_0x2bf939[_0x59ec('0x27')][_0x59ec('0x28')]};});_0x36c7a1[_0x59ec('0x29')]=_[_0x59ec('0x24')](_0x54bebd,_0x59ec('0x22'));_0x36c7a1[_0x59ec('0x2a')]=_[_0x59ec('0x2b')](_0x8f1393[_0x59ec('0x2a')]);_0x36c7a1[_0x59ec('0x2c')]=_[_0x59ec('0x2d')](_0x36c7a1['model'],_0x36c7a1[_0x59ec('0x2a')]);_0x1f13db['attributes']=_[_0x59ec('0x2d')](_0x36c7a1[_0x59ec('0x29')],qs[_0x59ec('0x2e')](_0x8f1393[_0x59ec('0x2a')][_0x59ec('0x2e')]));_0x1f13db[_0x59ec('0x2f')]=_0x1f13db[_0x59ec('0x2f')][_0x59ec('0x30')]?_0x1f13db[_0x59ec('0x2f')]:_0x36c7a1[_0x59ec('0x29')];if(!_0x8f1393[_0x59ec('0x2a')][_0x59ec('0x31')]('nolimit')){_0x1f13db[_0x59ec('0x1d')]=qs[_0x59ec('0x1d')](_0x8f1393[_0x59ec('0x2a')]['limit']);_0x1f13db['offset']=qs[_0x59ec('0x1c')](_0x8f1393[_0x59ec('0x2a')]['offset']);}_0x1f13db['order']=qs[_0x59ec('0x32')](_0x8f1393[_0x59ec('0x2a')][_0x59ec('0x32')]);_0x1f13db[_0x59ec('0x33')]=qs[_0x59ec('0x2c')](_['pick'](_0x8f1393['query'],_0x36c7a1['filters']),_0x54bebd);if(_0x8f1393[_0x59ec('0x2a')][_0x59ec('0x34')]){_0x1f13db[_0x59ec('0x33')]=_[_0x59ec('0x35')](_0x1f13db[_0x59ec('0x33')],{'$or':_['map'](_0x54bebd,function(_0x265222){if(_0x265222['type']!==_0x59ec('0x36')){var _0x4ebc60={};_0x4ebc60[_0x265222[_0x59ec('0x22')]]={'$like':'%'+_0x8f1393[_0x59ec('0x2a')][_0x59ec('0x34')]+'%'};return _0x4ebc60;}})});}_0x1f13db=_[_0x59ec('0x35')]({},_0x1f13db,_0x8f1393['options']);var _0x2a3d00={'where':_0x1f13db['where']};return db[_0x59ec('0x37')][_0x59ec('0x1b')](_0x2a3d00)[_0x59ec('0x38')](function(_0x14845b){_0x24beb9['count']=_0x14845b;if(_0x8f1393[_0x59ec('0x2a')][_0x59ec('0x39')]){_0x1f13db['include']=[{'all':!![]}];}return db[_0x59ec('0x37')][_0x59ec('0x3a')](_0x1f13db);})['then'](function(_0x5af37d){_0x24beb9['rows']=_0x5af37d;return _0x24beb9;})[_0x59ec('0x38')](respondWithFilteredResult(_0x5c5217,_0x1f13db))[_0x59ec('0x3b')](handleError(_0x5c5217,null));};exports[_0x59ec('0x3c')]=function(_0x483a6d,_0x15acc1){var _0x3d5699={'raw':!![],'where':{'id':_0x483a6d[_0x59ec('0x3d')]['id']}},_0x239ecf={};_0x239ecf[_0x59ec('0x29')]=_[_0x59ec('0x2b')](db[_0x59ec('0x37')]['rawAttributes']);_0x239ecf[_0x59ec('0x2a')]=_[_0x59ec('0x2b')](_0x483a6d[_0x59ec('0x2a')]);_0x239ecf[_0x59ec('0x2c')]=_[_0x59ec('0x2d')](_0x239ecf['model'],_0x239ecf['query']);_0x3d5699[_0x59ec('0x2f')]=_['intersection'](_0x239ecf[_0x59ec('0x29')],qs[_0x59ec('0x2e')](_0x483a6d[_0x59ec('0x2a')][_0x59ec('0x2e')]));_0x3d5699['attributes']=_0x3d5699[_0x59ec('0x2f')][_0x59ec('0x30')]?_0x3d5699[_0x59ec('0x2f')]:_0x239ecf[_0x59ec('0x29')];if(_0x483a6d[_0x59ec('0x2a')][_0x59ec('0x39')]){_0x3d5699['include']=[{'all':!![]}];}_0x3d5699=_['merge']({},_0x3d5699,_0x483a6d[_0x59ec('0x3e')]);return db[_0x59ec('0x37')]['find'](_0x3d5699)[_0x59ec('0x38')](handleEntityNotFound(_0x15acc1,null))['then'](respondWithResult(_0x15acc1,null))[_0x59ec('0x3b')](handleError(_0x15acc1,null));};exports[_0x59ec('0x3f')]=function(_0xf16034,_0x1dc274){if(_0xf16034['body']['id']){delete _0xf16034[_0x59ec('0x40')]['id'];}return db[_0x59ec('0x37')][_0x59ec('0x41')]({'where':{'id':_0xf16034[_0x59ec('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1dc274,null))[_0x59ec('0x38')](saveUpdates(_0xf16034[_0x59ec('0x40')],null))[_0x59ec('0x38')](respondWithResult(_0x1dc274,null))[_0x59ec('0x3b')](handleError(_0x1dc274,null));};exports[_0x59ec('0x1f')]=function(_0x359731,_0xce8078){return db[_0x59ec('0x37')][_0x59ec('0x41')]({'where':{'id':_0x359731['params']['id']}})[_0x59ec('0x38')](handleEntityNotFound(_0xce8078,null))[_0x59ec('0x38')](removeEntity(_0xce8078,null))['catch'](handleError(_0xce8078,null));};exports['describe']=function(_0x1a3576,_0x1213b3){return db[_0x59ec('0x37')][_0x59ec('0x42')]()['then'](respondWithResult(_0x1213b3,null))[_0x59ec('0x3b')](handleError(_0x1213b3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6f14447..ec08154 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 _0x02ab=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','cm_hopper_black','lodash'];(function(_0x241890,_0x5e5676){var _0x558dd2=function(_0x57b16e){while(--_0x57b16e){_0x241890['push'](_0x241890['shift']());}};_0x558dd2(++_0x5e5676);}(_0x02ab,0xe7));var _0xb02a=function(_0x16723b,_0x30d80c){_0x16723b=_0x16723b-0x0;var _0xc9d4bb=_0x02ab[_0x16723b];return _0xc9d4bb;};'use strict';var _=require(_0xb02a('0x0'));var util=require(_0xb02a('0x1'));var logger=require(_0xb02a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb02a('0x3'));var fs=require('fs');var path=require(_0xb02a('0x4'));var rimraf=require(_0xb02a('0x5'));var config=require(_0xb02a('0x6'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x53ee8b,_0x598054){return _0x53ee8b['define']('CmHopperBlack',attributes,{'tableName':_0xb02a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c7a=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash'];(function(_0x42d8c4,_0x5a0238){var _0x1a45a7=function(_0x3ca4d8){while(--_0x3ca4d8){_0x42d8c4['push'](_0x42d8c4['shift']());}};_0x1a45a7(++_0x5a0238);}(_0x3c7a,0x173));var _0xa3c7=function(_0x22f635,_0x4a0def){_0x22f635=_0x22f635-0x0;var _0x41b2b3=_0x3c7a[_0x22f635];return _0x41b2b3;};'use strict';var _=require(_0xa3c7('0x0'));var util=require(_0xa3c7('0x1'));var logger=require('../../config/logger')(_0xa3c7('0x2'));var moment=require('moment');var BPromise=require(_0xa3c7('0x3'));var rp=require(_0xa3c7('0x4'));var fs=require('fs');var path=require(_0xa3c7('0x5'));var rimraf=require(_0xa3c7('0x6'));var config=require(_0xa3c7('0x7'));var attributes=require(_0xa3c7('0x8'));module[_0xa3c7('0x9')]=function(_0x39bbf1,_0x46a851){return _0x39bbf1[_0xa3c7('0xa')]('CmHopperBlack',attributes,{'tableName':_0xa3c7('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 817a3af..4c60b2a 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 _0xaed4=['../../config/environment','jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','CmHopperBlack','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x127966,_0x3d69e0){var _0x46e664=function(_0x29439c){while(--_0x29439c){_0x127966['push'](_0x127966['shift']());}};_0x46e664(++_0x3d69e0);}(_0xaed4,0xb6));var _0x4aed=function(_0x39eba1,_0x548ec6){_0x39eba1=_0x39eba1-0x0;var _0x5ea861=_0xaed4[_0x39eba1];return _0x5ea861;};'use strict';var _=require(_0x4aed('0x0'));var util=require(_0x4aed('0x1'));var moment=require(_0x4aed('0x2'));var BPromise=require(_0x4aed('0x3'));var rs=require(_0x4aed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4aed('0x5'));var logger=require(_0x4aed('0x6'))(_0x4aed('0x7'));var config=require(_0x4aed('0x8'));var jayson=require(_0x4aed('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8bfd,_0x2dc6f9,_0x356d65){return new BPromise(function(_0x1621f5,_0x4e3be3){return client[_0x4aed('0xa')](_0x1c8bfd,_0x356d65)[_0x4aed('0xb')](function(_0x60f8d4){logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x2dc6f9,_0x4aed('0xe'));logger[_0x4aed('0xf')](_0x4aed('0x10'),_0x2dc6f9,_0x4aed('0xe'),JSON[_0x4aed('0x11')](_0x60f8d4));if(_0x60f8d4[_0x4aed('0x12')]){if(_0x60f8d4[_0x4aed('0x12')]['code']===0x1f4){logger[_0x4aed('0x12')](_0x4aed('0xd'),_0x2dc6f9,_0x60f8d4[_0x4aed('0x12')][_0x4aed('0x13')]);return _0x4e3be3(_0x60f8d4[_0x4aed('0x12')][_0x4aed('0x13')]);}logger[_0x4aed('0x12')](_0x4aed('0xd'),_0x2dc6f9,_0x60f8d4[_0x4aed('0x12')][_0x4aed('0x13')]);return _0x1621f5(_0x60f8d4[_0x4aed('0x12')]['message']);}else{logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x2dc6f9,_0x4aed('0xe'));_0x1621f5(_0x60f8d4[_0x4aed('0x14')][_0x4aed('0x13')]);}})[_0x4aed('0x15')](function(_0x3082c3){logger[_0x4aed('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x2dc6f9,_0x3082c3);_0x4e3be3(_0x3082c3);});});}exports[_0x4aed('0x16')]=function(_0x566ecd){var _0x38f262=this;return new Promise(function(_0x4761d2,_0x1cf4e2){return db['CmHopperBlack'][_0x4aed('0x17')]({'raw':_0x566ecd[_0x4aed('0x18')]?_0x566ecd['options'][_0x4aed('0x19')]===undefined?!![]:![]:!![],'where':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1a')]||null:null,'attributes':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1b')]||null:null,'limit':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1c')]||null:null,'include':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1d')]?_[_0x4aed('0x1e')](_0x566ecd['options'][_0x4aed('0x1d')],function(_0x4ec625){return{'model':db[_0x4ec625[_0x4aed('0x1f')]],'as':_0x4ec625['as'],'attributes':_0x4ec625[_0x4aed('0x1b')],'include':_0x4ec625[_0x4aed('0x1d')]?_[_0x4aed('0x1e')](_0x4ec625[_0x4aed('0x1d')],function(_0x45c4ef){return{'model':db[_0x45c4ef[_0x4aed('0x1f')]],'as':_0x45c4ef['as'],'attributes':_0x45c4ef[_0x4aed('0x1b')],'include':_0x45c4ef[_0x4aed('0x1d')]?_[_0x4aed('0x1e')](_0x45c4ef[_0x4aed('0x1d')],function(_0xa06638){return{'model':db[_0xa06638[_0x4aed('0x1f')]],'as':_0xa06638['as'],'attributes':_0xa06638['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x341508){logger['info'](_0x4aed('0x16'),_0x566ecd);logger[_0x4aed('0xf')](_0x4aed('0x16'),_0x566ecd,JSON[_0x4aed('0x11')](_0x341508));_0x4761d2(_0x341508);})['catch'](function(_0x234c43){logger[_0x4aed('0x12')]('GetCmHopperBlack',_0x234c43[_0x4aed('0x13')],_0x566ecd);_0x1cf4e2(_0x38f262[_0x4aed('0x12')](0x1f4,_0x234c43[_0x4aed('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x50cfd2){var _0x3ef671=this;return new Promise(function(_0x3ccd88,_0x20a454){return db[_0x4aed('0x20')][_0x4aed('0x21')](_0x50cfd2[_0x4aed('0x22')],{'raw':_0x50cfd2[_0x4aed('0x18')]?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50cfd2[_0x4aed('0x18')]?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x1a')]||null:null,'attributes':_0x50cfd2[_0x4aed('0x18')]?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x1b')]||null:null,'limit':_0x50cfd2['options']?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x1c')]||null:null})['then'](function(_0x378917){logger[_0x4aed('0xc')]('UpdateCmHopperBlack',_0x50cfd2);logger[_0x4aed('0xf')](_0x4aed('0x23'),_0x50cfd2,JSON[_0x4aed('0x11')](_0x378917));_0x3ccd88(_0x378917);})['catch'](function(_0x340b28){logger[_0x4aed('0x12')](_0x4aed('0x23'),_0x340b28['message'],_0x50cfd2);_0x20a454(_0x3ef671[_0x4aed('0x12')](0x1f4,_0x340b28['message']));});});};exports[_0x4aed('0x24')]=function(_0x4335e2){var _0x5c9ef8=this;return new Promise(function(_0x2baf05,_0xa88bce){return db['CmHopperBlack'][_0x4aed('0x25')]({'where':_0x4335e2[_0x4aed('0x18')]?_0x4335e2['options']['where']||null:null})[_0x4aed('0xb')](function(_0x5eb002){logger['info'](_0x4aed('0x24'),_0x4335e2);logger[_0x4aed('0xf')](_0x4aed('0x24'),_0x4335e2,JSON[_0x4aed('0x11')](_0x5eb002));_0x2baf05(_0x5eb002);})[_0x4aed('0x15')](function(_0x183a3c){logger[_0x4aed('0x12')]('DestroyCmHopperBlack',_0x183a3c['message'],_0x4335e2);_0xa88bce(_0x5c9ef8[_0x4aed('0x12')](0x1f4,_0x183a3c[_0x4aed('0x13')]));});});}; \ No newline at end of file +var _0x92ff=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','limit','map','include','attributes','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring'];(function(_0xd034c8,_0x4b5fbe){var _0x37c283=function(_0x1fc5c3){while(--_0x1fc5c3){_0xd034c8['push'](_0xd034c8['shift']());}};_0x37c283(++_0x4b5fbe);}(_0x92ff,0x1e9));var _0xf92f=function(_0x472f98,_0x52b8fd){_0x472f98=_0x472f98-0x0;var _0x4f9122=_0x92ff[_0x472f98];return _0x4f9122;};'use strict';var _=require(_0xf92f('0x0'));var util=require(_0xf92f('0x1'));var moment=require(_0xf92f('0x2'));var BPromise=require(_0xf92f('0x3'));var rs=require(_0xf92f('0x4'));var fs=require('fs');var Redis=require(_0xf92f('0x5'));var db=require(_0xf92f('0x6'))['db'];var utils=require(_0xf92f('0x7'));var logger=require(_0xf92f('0x8'))('rpc');var config=require(_0xf92f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf92f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12ba38,_0x553ca2,_0x572998){return new BPromise(function(_0x4cd168,_0x3c7f54){return client[_0xf92f('0xb')](_0x12ba38,_0x572998)[_0xf92f('0xc')](function(_0x2b2776){logger[_0xf92f('0xd')](_0xf92f('0xe'),_0x553ca2,_0xf92f('0xf'));logger[_0xf92f('0x10')](_0xf92f('0x11'),_0x553ca2,_0xf92f('0xf'),JSON[_0xf92f('0x12')](_0x2b2776));if(_0x2b2776['error']){if(_0x2b2776['error']['code']===0x1f4){logger[_0xf92f('0x13')](_0xf92f('0xe'),_0x553ca2,_0x2b2776['error'][_0xf92f('0x14')]);return _0x3c7f54(_0x2b2776[_0xf92f('0x13')][_0xf92f('0x14')]);}logger[_0xf92f('0x13')](_0xf92f('0xe'),_0x553ca2,_0x2b2776[_0xf92f('0x13')]['message']);return _0x4cd168(_0x2b2776[_0xf92f('0x13')][_0xf92f('0x14')]);}else{logger[_0xf92f('0xd')](_0xf92f('0xe'),_0x553ca2,_0xf92f('0xf'));_0x4cd168(_0x2b2776[_0xf92f('0x15')]['message']);}})[_0xf92f('0x16')](function(_0x5126d2){logger['error'](_0xf92f('0xe'),_0x553ca2,_0x5126d2);_0x3c7f54(_0x5126d2);});});}exports[_0xf92f('0x17')]=function(_0x1472e3){var _0x5c5f29=this;return new Promise(function(_0x1ed77b,_0x5e5100){return db[_0xf92f('0x18')]['findAll']({'raw':_0x1472e3[_0xf92f('0x19')]?_0x1472e3[_0xf92f('0x19')][_0xf92f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1472e3[_0xf92f('0x19')]?_0x1472e3[_0xf92f('0x19')][_0xf92f('0x1b')]||null:null,'attributes':_0x1472e3[_0xf92f('0x19')]?_0x1472e3[_0xf92f('0x19')]['attributes']||null:null,'limit':_0x1472e3[_0xf92f('0x19')]?_0x1472e3[_0xf92f('0x19')][_0xf92f('0x1c')]||null:null,'include':_0x1472e3['options']?_0x1472e3[_0xf92f('0x19')]['include']?_[_0xf92f('0x1d')](_0x1472e3[_0xf92f('0x19')][_0xf92f('0x1e')],function(_0x1b8426){return{'model':db[_0x1b8426['model']],'as':_0x1b8426['as'],'attributes':_0x1b8426[_0xf92f('0x1f')],'include':_0x1b8426[_0xf92f('0x1e')]?_[_0xf92f('0x1d')](_0x1b8426['include'],function(_0x385ac3){return{'model':db[_0x385ac3['model']],'as':_0x385ac3['as'],'attributes':_0x385ac3[_0xf92f('0x1f')],'include':_0x385ac3['include']?_['map'](_0x385ac3[_0xf92f('0x1e')],function(_0x5206e4){return{'model':db[_0x5206e4[_0xf92f('0x20')]],'as':_0x5206e4['as'],'attributes':_0x5206e4[_0xf92f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x105c54){logger[_0xf92f('0xd')](_0xf92f('0x17'),_0x1472e3);logger['debug'](_0xf92f('0x17'),_0x1472e3,JSON[_0xf92f('0x12')](_0x105c54));_0x1ed77b(_0x105c54);})[_0xf92f('0x16')](function(_0x54b2b9){logger['error'](_0xf92f('0x17'),_0x54b2b9['message'],_0x1472e3);_0x5e5100(_0x5c5f29['error'](0x1f4,_0x54b2b9['message']));});});};exports[_0xf92f('0x21')]=function(_0x41e885){var _0xa82ad5=this;return new Promise(function(_0x56eeff,_0x53bdcb){return db[_0xf92f('0x18')][_0xf92f('0x22')](_0x41e885[_0xf92f('0x23')],{'raw':_0x41e885[_0xf92f('0x19')]?_0x41e885[_0xf92f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41e885[_0xf92f('0x19')]?_0x41e885[_0xf92f('0x19')][_0xf92f('0x1b')]||null:null,'attributes':_0x41e885[_0xf92f('0x19')]?_0x41e885[_0xf92f('0x19')][_0xf92f('0x1f')]||null:null,'limit':_0x41e885['options']?_0x41e885[_0xf92f('0x19')][_0xf92f('0x1c')]||null:null})[_0xf92f('0xc')](function(_0x37a764){logger[_0xf92f('0xd')](_0xf92f('0x21'),_0x41e885);logger[_0xf92f('0x10')](_0xf92f('0x21'),_0x41e885,JSON['stringify'](_0x37a764));_0x56eeff(_0x37a764);})[_0xf92f('0x16')](function(_0x77dbeb){logger[_0xf92f('0x13')](_0xf92f('0x21'),_0x77dbeb[_0xf92f('0x14')],_0x41e885);_0x53bdcb(_0xa82ad5[_0xf92f('0x13')](0x1f4,_0x77dbeb[_0xf92f('0x14')]));});});};exports[_0xf92f('0x24')]=function(_0x418526){var _0x13b259=this;return new Promise(function(_0x2f1836,_0x45eb03){return db[_0xf92f('0x18')][_0xf92f('0x25')]({'where':_0x418526[_0xf92f('0x19')]?_0x418526[_0xf92f('0x19')][_0xf92f('0x1b')]||null:null})[_0xf92f('0xc')](function(_0x1a93e8){logger[_0xf92f('0xd')](_0xf92f('0x24'),_0x418526);logger['debug'](_0xf92f('0x24'),_0x418526,JSON[_0xf92f('0x12')](_0x1a93e8));_0x2f1836(_0x1a93e8);})[_0xf92f('0x16')](function(_0x31154a){logger['error'](_0xf92f('0x24'),_0x31154a[_0xf92f('0x14')],_0x418526);_0x45eb03(_0x13b259[_0xf92f('0x13')](0x1f4,_0x31154a['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b762c7a..25547d3 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 _0x5430=['path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','multer','util'];(function(_0x230783,_0x3f1c0e){var _0x19dd10=function(_0x165817){while(--_0x165817){_0x230783['push'](_0x230783['shift']());}};_0x19dd10(++_0x3f1c0e);}(_0x5430,0x10c));var _0x0543=function(_0x53f085,_0x2dedd9){_0x53f085=_0x53f085-0x0;var _0x41101c=_0x5430[_0x53f085];return _0x41101c;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0xe')]('/:id',auth[_0x0543('0x8')](),controller[_0x0543('0xf')]);router['delete'](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0x10')]);module[_0x0543('0x11')]=router; \ No newline at end of file +var _0xe3da=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','exports','multer'];(function(_0x3392c4,_0x187ee5){var _0xd40eed=function(_0x31cd1f){while(--_0x31cd1f){_0x3392c4['push'](_0x3392c4['shift']());}};_0xd40eed(++_0x187ee5);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0x11')](_0xae3d('0x12'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x13')]);router[_0xae3d('0x14')]('/:id',auth[_0xae3d('0xc')](),controller['destroy']);module[_0xae3d('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index b82073d..ef243c5 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 _0xc39d=['diff','seconds','BOOLEAN','sequelize','moment','exports','DATE','INTEGER','STRING','endtime','setDataValue'];(function(_0x3bfdfc,_0x596a9c){var _0x5e348c=function(_0x4103c9){while(--_0x4103c9){_0x3bfdfc['push'](_0x3bfdfc['shift']());}};_0x5e348c(++_0x596a9c);}(_0xc39d,0x116));var _0xdc39=function(_0x5950fd,_0x405b7f){_0x5950fd=_0x5950fd-0x0;var _0x32bed7=_0xc39d[_0x5950fd];return _0x32bed7;};'use strict';var Sequelize=require(_0xdc39('0x0'));var moment=require(_0xdc39('0x1'));module[_0xdc39('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xdc39('0x3')]},'countbusyretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdc39('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xdc39('0x5')]},'originatecalleridname':{'type':Sequelize[_0xdc39('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdc39('0x5')]},'starttime':{'type':Sequelize[_0xdc39('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xdc39('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdc39('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xdc39('0x5')]},'membername':{'type':Sequelize[_0xdc39('0x5')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdc39('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xdc39('0x3')],'set':function(_0x504ea8){var _0x4d1630=this['getDataValue'](_0xdc39('0x6'));if(_0x4d1630&&_0x504ea8){this[_0xdc39('0x7')]('followuptime',moment(_0x504ea8)[_0xdc39('0x8')](moment(_0x4d1630),_0xdc39('0x9')));}}},'amd':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xdc39('0x3')]},'callback':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdc39('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdc39('0x3')]},'deleted':{'type':Sequelize[_0xdc39('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xdc39('0x3')]},'recallme':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xdc39('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x71dd=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN'];(function(_0x565a10,_0x4459fa){var _0x42b2b7=function(_0x611916){while(--_0x611916){_0x565a10['push'](_0x565a10['shift']());}};_0x42b2b7(++_0x4459fa);}(_0x71dd,0x1c7));var _0xd71d=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x71dd[_0x4c2f17];return _0x20919e;};'use strict';var Sequelize=require(_0xd71d('0x0'));var moment=require(_0xd71d('0x1'));module[_0xd71d('0x2')]={'state':{'type':Sequelize[_0xd71d('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xd71d('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd71d('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xd71d('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd71d('0x4')]},'calleridname':{'type':Sequelize[_0xd71d('0x4')]},'starttime':{'type':Sequelize[_0xd71d('0x5')]},'responsetime':{'type':Sequelize[_0xd71d('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xd71d('0x5')]},'endtime':{'type':Sequelize[_0xd71d('0x5')]},'ringtime':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd71d('0x4')]},'campaign':{'type':Sequelize[_0xd71d('0x4')]},'campaigntype':{'type':Sequelize[_0xd71d('0x4')]},'membername':{'type':Sequelize[_0xd71d('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd71d('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd71d('0x4')]},'dispositionat':{'type':Sequelize[_0xd71d('0x5')],'set':function(_0x4b43e0){var _0x1b75b0=this[_0xd71d('0x6')](_0xd71d('0x7'));if(_0x1b75b0&&_0x4b43e0){this[_0xd71d('0x8')](_0xd71d('0x9'),moment(_0x4b43e0)[_0xd71d('0xa')](moment(_0x1b75b0),_0xd71d('0xb')));}}},'amd':{'type':Sequelize[_0xd71d('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd71d('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xd71d('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd71d('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd71d('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd71d('0x5')]},'recallme':{'type':Sequelize[_0xd71d('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd71d('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 5c1a020..428c0ca 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 _0xba34=['insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','state\x20=\x20?','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xba34,0x119));var _0x4ba3=function(_0x537719,_0x938874){_0x537719=_0x537719-0x0;var _0x452363=_0xba34[_0x537719];return _0x452363;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['describe']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['describe']()[_0x4ba3('0x26')](respondWithResult(_0x1fe115,null))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports[_0x4ba3('0x25')]=function(_0x58648d,_0x47f588){if(_0x58648d[_0x4ba3('0x49')]['uniqueid']){delete _0x58648d[_0x4ba3('0x49')][_0x4ba3('0x4a')];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'uniqueid':_0x58648d[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x47f588,null))['then'](saveUpdates(_0x58648d[_0x4ba3('0x49')],null))[_0x4ba3('0x26')](respondWithResult(_0x47f588,null))['catch'](handleError(_0x47f588,null));};exports[_0x4ba3('0x4c')]=function(_0x12ae6f,_0x156c2d,_0x19d6a3){return db[_0x4ba3('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x12ae6f[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),_0x4ba3('0x53')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x4ba3('0x54')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5a')))),_0x4ba3('0x5b')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x156c2d,null))[_0x4ba3('0x26')](respondWithResult(_0x156c2d,null))[_0x4ba3('0x46')](handleError(_0x156c2d,null));};exports[_0x4ba3('0x5d')]=function(_0xf0fd32,_0x4b5289,_0x3d9a7e){return db[_0x4ba3('0x2d')][_0x4ba3('0x44')]({'raw':![],'where':{'CampaignId':_0xf0fd32[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),'noAnswerContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x5e')))),'busyContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5f')))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4ba3('0x5b')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x4b5289,null))['then'](respondWithResult(_0x4b5289,null))[_0x4ba3('0x46')](handleError(_0x4b5289,null));};exports[_0x4ba3('0x60')]=function(_0x5dce8f,_0x37fedb,_0x2ed729){return db[_0x4ba3('0x61')][_0x4ba3('0x48')]({'where':{'id':_0x5dce8f[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x37fedb,null))[_0x4ba3('0x26')](function(_0x329874){var _0x360127;if(_0x329874){_0x360127=squel['insert']()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),_0x4ba3('0x66'),_0x4ba3('0x67'),_0x4ba3('0x68'),_0x4ba3('0x69'),_0x4ba3('0x6a'),_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')]('ANY_VALUE(calleridnum)',_0x4ba3('0x65'))[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')]('ANY_VALUE(ContactId)','ContactId')[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x6f'),_0x4ba3('0x69'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')]('state\x20=\x20?',_0x5dce8f[_0x4ba3('0x49')][_0x4ba3('0x75')][_0x4ba3('0x74')]())['where'](_0x4ba3('0x76'))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')]('cm_hopper')['where'](_0x4ba3('0x73'),_0x5dce8f['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field']('calleridnum')[_0x4ba3('0x71')](_0x4ba3('0x72'))['where'](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')](_0x4ba3('0x67')))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x360127);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x37fedb,null))['catch'](handleError(_0x37fedb,null));};exports[_0x4ba3('0x7a')]=function(_0x13dbc4,_0x4e334c,_0x39d1d3){return db[_0x4ba3('0x7b')]['find']({'where':{'id':_0x13dbc4['params']['id']}})['then'](handleEntityNotFound(_0x4e334c,null))['then'](function(_0x206e93){var _0x2d57a7;if(_0x206e93){_0x2d57a7=squel[_0x4ba3('0x7c')]()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),'scheduledAt',_0x4ba3('0x67'),'ListId',_0x4ba3('0x7d'),'createdAt',_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x7e'),_0x4ba3('0x65'))['field']('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')](_0x4ba3('0x7f'),_0x4ba3('0x67'))[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x80'),_0x4ba3('0x7d'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x81'),_0x13dbc4['body']['state'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x76'))['where'](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')](_0x4ba3('0x63'))['where'](_0x4ba3('0x82'),_0x13dbc4['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field'](_0x4ba3('0x83'))[_0x4ba3('0x71')]('cm_hopper_final')[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')]('ContactId'))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x2d57a7);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x4e334c,null))['catch'](handleError(_0x4e334c,null));};exports[_0x4ba3('0x84')]=function(_0x38a7a8,_0x5553eb,_0x402ab1){return db[_0x4ba3('0x85')][_0x4ba3('0x86')]({'where':{'VoiceQueueId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x69')],'CampaignId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x7d')],'ContactId':_0x38a7a8[_0x4ba3('0x49')]['ContactId']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5553eb,null))[_0x4ba3('0x26')](function(_0xfb16a6){if(_0xfb16a6){return _0xfb16a6;}return null;})[_0x4ba3('0x26')](respondWithResult(_0x5553eb,null))[_0x4ba3('0x46')](handleError(_0x5553eb,null));}; \ No newline at end of file +var _0x1261=['attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','describe','catch','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','cm_hopper','fromQuery','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','ListId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','CmHopperFinal','model','map','name','keys','query','intersection'];(function(_0x5a8db6,_0x3981fe){var _0x54ad62=function(_0x3ee65c){while(--_0x3ee65c){_0x5a8db6['push'](_0x5a8db6['shift']());}};_0x54ad62(++_0x3981fe);}(_0x1261,0x144));var _0x1126=function(_0x88fab1,_0x1accff){_0x88fab1=_0x88fab1-0x0;var _0x20c571=_0x1261[_0x88fab1];return _0x20c571;};'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'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['CmHopperFinal'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['CmHopperFinal']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')]()['then'](respondWithResult(_0x5111d3,null))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports[_0x1126('0x24')]=function(_0x518e0a,_0x3e4eeb){if(_0x518e0a[_0x1126('0x44')][_0x1126('0x45')]){delete _0x518e0a['body'][_0x1126('0x45')];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'uniqueid':_0x518e0a[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x25')](saveUpdates(_0x518e0a[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0x3e4eeb,null))['catch'](handleError(_0x3e4eeb,null));};exports[_0x1126('0x46')]=function(_0x5a2287,_0x40168e,_0x2ad118){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x5a2287[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4a')))),_0x1126('0x4b')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x4e')))),_0x1126('0x4f')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1126('0x50')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1126('0x51')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),_0x1126('0x53')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x25')](respondWithResult(_0x40168e,null))[_0x1126('0x43')](handleError(_0x40168e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xcc1a95,_0x315386,_0x5e0ea1){return db[_0x1126('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0xcc1a95[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x1126('0x4b')],[db['sequelize']['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x56')))),_0x1126('0x57')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x58')))),'dropContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x59')))),_0x1126('0x51')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x315386,null))[_0x1126('0x25')](respondWithResult(_0x315386,null))[_0x1126('0x43')](handleError(_0x315386,null));};exports[_0x1126('0x5a')]=function(_0x247f12,_0xd20fbe,_0x3d5e15){return db[_0x1126('0x5b')][_0x1126('0x41')]({'where':{'id':_0x247f12[_0x1126('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd20fbe,null))[_0x1126('0x25')](function(_0x274343){var _0x2b61ae;if(_0x274343){_0x2b61ae=squel['insert']()['into'](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),'ContactId','ListId','VoiceQueueId',_0x1126('0x60'),_0x1126('0x61')],squel[_0x1126('0x62')]()[_0x1126('0x63')]('ANY_VALUE(calleridnum)',_0x1126('0x5e'))['field'](_0x1126('0x64'),_0x1126('0x5f'))[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),'ListId')[_0x1126('0x63')]('ANY_VALUE(VoiceQueueId)',_0x1126('0x68'))[_0x1126('0x63')]('NOW()',_0x1126('0x60'))[_0x1126('0x63')]('NOW()',_0x1126('0x61'))[_0x1126('0x69')]('cm_hopper_final')['where'](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())['where']('state\x20=\x20?',_0x247f12['body'][_0x1126('0x6c')]['toString']())['where'](_0x1126('0x6d'))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()['field'](_0x1126('0x5e'))[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12['params']['id'][_0x1126('0x6b')]()))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')](_0x1126('0x71')))[_0x1126('0x72')](_0x1126('0x66')))[_0x1126('0x6b')]();return db[_0x1126('0x47')][_0x1126('0x2e')](_0x2b61ae);}return[];})['then'](respondWithResult(_0xd20fbe,null))[_0x1126('0x43')](handleError(_0xd20fbe,null));};exports[_0x1126('0x73')]=function(_0x33cccf,_0x1483f4,_0x3be5bf){return db['Campaign'][_0x1126('0x41')]({'where':{'id':_0x33cccf['params']['id']}})['then'](handleEntityNotFound(_0x1483f4,null))[_0x1126('0x25')](function(_0x2b1884){var _0x55f366;if(_0x2b1884){_0x55f366=squel['insert']()[_0x1126('0x74')](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),_0x1126('0x66'),_0x1126('0x75'),_0x1126('0x76'),_0x1126('0x60'),'updatedAt'],squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x77'),_0x1126('0x5e'))[_0x1126('0x63')](_0x1126('0x64'),'scheduledAt')[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),_0x1126('0x75'))[_0x1126('0x63')](_0x1126('0x78'),_0x1126('0x76'))[_0x1126('0x63')]('NOW()','createdAt')[_0x1126('0x63')]('NOW()',_0x1126('0x61'))['from'](_0x1126('0x70'))['where'](_0x1126('0x79'),_0x33cccf['params']['id']['toString']())['where'](_0x1126('0x7a'),_0x33cccf[_0x1126('0x44')]['state']['toString']())[_0x1126('0x37')](_0x1126('0x6d'))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x1126('0x63')]('phone')[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id']['toString']()))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')]('state\x20=\x204'))[_0x1126('0x72')]('ContactId'))[_0x1126('0x6b')]();return db['sequelize'][_0x1126('0x2e')](_0x55f366);}return[];})[_0x1126('0x25')](respondWithResult(_0x1483f4,null))[_0x1126('0x43')](handleError(_0x1483f4,null));};exports[_0x1126('0x7b')]=function(_0x59c04b,_0x429183,_0x834360){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x59c04b[_0x1126('0x44')][_0x1126('0x68')],'CampaignId':_0x59c04b[_0x1126('0x44')]['CampaignId'],'ContactId':_0x59c04b[_0x1126('0x44')]['ContactId']}})[_0x1126('0x25')](handleEntityNotFound(_0x429183,null))[_0x1126('0x25')](function(_0x4d6bb2){if(_0x4d6bb2){return _0x4d6bb2;}return null;})[_0x1126('0x25')](respondWithResult(_0x429183,null))[_0x1126('0x43')](handleError(_0x429183,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index fbc29ad..c8e3304 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 _0xc033=['calleridnum','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0xc033,0x144));var _0x3c03=function(_0x4acfd2,_0x5b9374){_0x4acfd2=_0x4acfd2-0x0;var _0x12afbe=_0xc033[_0x4acfd2];return _0x12afbe;};'use strict';var _=require(_0x3c03('0x0'));var util=require('util');var logger=require(_0x3c03('0x1'))(_0x3c03('0x2'));var moment=require('moment');var BPromise=require(_0x3c03('0x3'));var rp=require(_0x3c03('0x4'));var fs=require('fs');var path=require(_0x3c03('0x5'));var rimraf=require(_0x3c03('0x6'));var config=require(_0x3c03('0x7'));var attributes=require(_0x3c03('0x8'));module[_0x3c03('0x9')]=function(_0x5680fa,_0x116932){return _0x5680fa[_0x3c03('0xa')](_0x3c03('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3c03('0xc'),'fields':[_0x3c03('0xc')]},{'name':_0x3c03('0xd'),'fields':[_0x3c03('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7449=['uniqueid','util','../../config/logger','moment','request-promise','rimraf','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x7449,0x137));var _0x9744=function(_0x1221b3,_0x394bc2){_0x1221b3=_0x1221b3-0x0;var _0x550b98=_0x7449[_0x1221b3];return _0x550b98;};'use strict';var _=require('lodash');var util=require(_0x9744('0x0'));var logger=require(_0x9744('0x1'))('api');var moment=require(_0x9744('0x2'));var BPromise=require('bluebird');var rp=require(_0x9744('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9744('0x4'));var config=require('../../config/environment');var attributes=require(_0x9744('0x5'));module['exports']=function(_0x5c0a4b,_0x5bd1b8){return _0x5c0a4b[_0x9744('0x6')](_0x9744('0x7'),attributes,{'tableName':_0x9744('0x8'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x9744('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 2e55e48..54aff2f 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(_0x3041d0,_0x255b24){var _0xccd584=function(_0x51b109){while(--_0x51b109){_0x3041d0['push'](_0x3041d0['shift']());}};_0xccd584(++_0x255b24);}(_0x7a54,0x106));var _0x47a5=function(_0x19b876,_0x39b214){_0x19b876=_0x19b876-0x0;var _0x2601eb=_0x7a54[_0x19b876];return _0x2601eb;};'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 _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(_0xf5af75,_0x36c6d2){var _0x275fcc=function(_0x2f3d31){while(--_0x2f3d31){_0xf5af75['push'](_0xf5af75['shift']());}};_0x275fcc(++_0x36c6d2);}(_0x7a54,0x106));var _0x47a5=function(_0x2f41e3,_0xaa95c2){_0x2f41e3=_0x2f41e3-0x0;var _0x433d5c=_0x7a54[_0x2f41e3];return _0x433d5c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 583990e..1475280 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 _0x908d=['index','/describe','describe','/:id','show','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xfcd69d,_0x2101cf){var _0x233b2b=function(_0x2d4f94){while(--_0x2d4f94){_0xfcd69d['push'](_0xfcd69d['shift']());}};_0x233b2b(++_0x2101cf);}(_0x908d,0x176));var _0xd908=function(_0x219951,_0x1298e9){_0x219951=_0x219951-0x0;var _0x45ed82=_0x908d[_0x219951];return _0x45ed82;};'use strict';var multer=require(_0xd908('0x0'));var util=require('util');var path=require(_0xd908('0x1'));var timeout=require(_0xd908('0x2'));var express=require('express');var router=express[_0xd908('0x3')]();var fs_extra=require(_0xd908('0x4'));var auth=require(_0xd908('0x5'));var interaction=require(_0xd908('0x6'));var config=require(_0xd908('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xd908('0x8')]('/',auth[_0xd908('0x9')](),controller[_0xd908('0xa')]);router['get'](_0xd908('0xb'),auth['isAuthenticated'](),controller[_0xd908('0xc')]);router[_0xd908('0x8')](_0xd908('0xd'),auth[_0xd908('0x9')](),controller[_0xd908('0xe')]);router[_0xd908('0x8')]('/voice/queue/countAttributes/:id',auth[_0xd908('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xd908('0x8')](_0xd908('0xf'),auth[_0xd908('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xd908('0x10')](_0xd908('0x11'),auth[_0xd908('0x9')](),controller[_0xd908('0x12')]);router[_0xd908('0x10')](_0xd908('0x13'),auth[_0xd908('0x9')](),controller[_0xd908('0x14')]);router[_0xd908('0x10')](_0xd908('0x15'),auth[_0xd908('0x9')](),controller[_0xd908('0x16')]);router['put'](_0xd908('0xd'),auth[_0xd908('0x9')](),controller['update']);module[_0xd908('0x17')]=router; \ No newline at end of file +var _0xf54a=['/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal'];(function(_0x2f4438,_0x3e8d2e){var _0x218723=function(_0x33f9b4){while(--_0x33f9b4){_0x2f4438['push'](_0x2f4438['shift']());}};_0x218723(++_0x3e8d2e);}(_0xf54a,0x13d));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaf54('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaf54('0x1'));var express=require(_0xaf54('0x2'));var router=express[_0xaf54('0x3')]();var fs_extra=require(_0xaf54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaf54('0x5'));var config=require(_0xaf54('0x6'));var controller=require(_0xaf54('0x7'));router[_0xaf54('0x8')]('/',auth[_0xaf54('0x9')](),controller[_0xaf54('0xa')]);router[_0xaf54('0x8')](_0xaf54('0xb'),auth[_0xaf54('0x9')](),controller['describe']);router[_0xaf54('0x8')](_0xaf54('0xc'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xd')]);router[_0xaf54('0x8')](_0xaf54('0xe'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xf')]);router[_0xaf54('0x8')]('/campaign/countAttributes/:id',auth[_0xaf54('0x9')](),controller[_0xaf54('0x10')]);router[_0xaf54('0x11')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xaf54('0x12')]);router['post'](_0xaf54('0x13'),auth[_0xaf54('0x9')](),controller[_0xaf54('0x14')]);router[_0xaf54('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xaf54('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaf54('0x16')]);module[_0xaf54('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 50858f5..2d1e74f 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 _0xd0e0=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0xd0e0,0x103));var _0x0d0e=function(_0x27bb17,_0x50e2e7){_0x27bb17=_0x27bb17-0x0;var _0x41d606=_0xd0e0[_0x27bb17];return _0x41d606;};'use strict';var Sequelize=require(_0x0d0e('0x0'));module[_0x0d0e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0d0e('0x2')]},'scheduledat':{'type':Sequelize[_0x0d0e('0x3')]},'countbusyretry':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0d0e('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0d0e('0x2')]},'originatecalleridname':{'type':Sequelize[_0x0d0e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0d0e('0x2')]},'starttime':{'type':Sequelize[_0x0d0e('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0d0e('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0d0e('0x2')]},'campaign':{'type':Sequelize[_0x0d0e('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0d0e('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0d0e('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0d0e('0x3')]},'recallme':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0d0e('0x2')]}}; \ No newline at end of file +var _0xb6ba=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x1484bf,_0x1ca54c){var _0x1fa3c5=function(_0x5ef808){while(--_0x5ef808){_0x1484bf['push'](_0x1484bf['shift']());}};_0x1fa3c5(++_0x1ca54c);}(_0xb6ba,0x1f4));var _0xab6b=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xb6ba[_0x1cfa0d];return _0xe33279;};'use strict';var Sequelize=require(_0xab6b('0x0'));module[_0xab6b('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xab6b('0x2')]},'scheduledat':{'type':Sequelize[_0xab6b('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xab6b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xab6b('0x2')]},'originatecalleridname':{'type':Sequelize[_0xab6b('0x2')]},'calleridnum':{'type':Sequelize[_0xab6b('0x2')]},'calleridname':{'type':Sequelize[_0xab6b('0x2')]},'starttime':{'type':Sequelize[_0xab6b('0x3')]},'responsetime':{'type':Sequelize[_0xab6b('0x3')]},'answertime':{'type':Sequelize[_0xab6b('0x3')]},'droptime':{'type':Sequelize[_0xab6b('0x3')]},'endtime':{'type':Sequelize[_0xab6b('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xab6b('0x2')]},'campaign':{'type':Sequelize[_0xab6b('0x2')]},'campaigntype':{'type':Sequelize[_0xab6b('0x2')]},'membername':{'type':Sequelize[_0xab6b('0x2')]},'reason':{'type':Sequelize[_0xab6b('0x2')]},'amd':{'type':Sequelize[_0xab6b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xab6b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xab6b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xab6b('0x3')]},'recallme':{'type':Sequelize[_0xab6b('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xab6b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xab6b('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xab6b('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 40732fc..89f4392 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 _0xc0e9=['catch','show','params','intersection','length','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','update','then','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows'];(function(_0x56c4f8,_0x2d4f9d){var _0x58ba92=function(_0x2226ef){while(--_0x2226ef){_0x56c4f8['push'](_0x56c4f8['shift']());}};_0x58ba92(++_0x2d4f9d);}(_0xc0e9,0xe5));var _0x9c0e=function(_0x167a6a,_0x453afb){_0x167a6a=_0x167a6a-0x0;var _0x2333ad=_0xc0e9[_0x167a6a];return _0x2333ad;};'use strict';var emlformat=require(_0x9c0e('0x0'));var rimraf=require(_0x9c0e('0x1'));var zipdir=require(_0x9c0e('0x2'));var jsonpatch=require(_0x9c0e('0x3'));var rp=require(_0x9c0e('0x4'));var moment=require(_0x9c0e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c0e('0x6'));var util=require(_0x9c0e('0x7'));var path=require(_0x9c0e('0x8'));var sox=require(_0x9c0e('0x9'));var csv=require(_0x9c0e('0xa'));var ejs=require(_0x9c0e('0xb'));var fs=require('fs');var fs_extra=require(_0x9c0e('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9c0e('0xd'));var Redis=require(_0x9c0e('0xe'));var authService=require(_0x9c0e('0xf'));var qs=require(_0x9c0e('0x10'));var as=require(_0x9c0e('0x11'));var hardwareService=require(_0x9c0e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9c0e('0x13'));var config=require(_0x9c0e('0x14'));var licenseUtil=require(_0x9c0e('0x15'));var db=require(_0x9c0e('0x16'))['db'];function respondWithStatusCode(_0xdbf374,_0x1893c6){_0x1893c6=_0x1893c6||0xcc;return function(_0x5a674e){if(_0x5a674e){return _0xdbf374[_0x9c0e('0x17')](_0x1893c6);}return _0xdbf374[_0x9c0e('0x18')](_0x1893c6)['end']();};}function respondWithResult(_0x19dcd2,_0x252a10){_0x252a10=_0x252a10||0xc8;return function(_0x5dc3de){if(_0x5dc3de){return _0x19dcd2[_0x9c0e('0x18')](_0x252a10)['json'](_0x5dc3de);}};}function respondWithFilteredResult(_0x12779b,_0x3a6de1){return function(_0x579ae0){if(_0x579ae0){var _0x1b6611=typeof _0x3a6de1['offset']===_0x9c0e('0x19')&&typeof _0x3a6de1[_0x9c0e('0x1a')]===_0x9c0e('0x19');var _0xf28112=_0x579ae0[_0x9c0e('0x1b')];var _0x5ccc66=_0x1b6611?0x0:_0x3a6de1[_0x9c0e('0x1c')];var _0x1914e8=_0x1b6611?_0x579ae0['count']:_0x3a6de1[_0x9c0e('0x1c')]+_0x3a6de1['limit'];var _0x554895;if(_0x1914e8>=_0xf28112){_0x1914e8=_0xf28112;_0x554895=0xc8;}else{_0x554895=0xce;}_0x12779b['status'](_0x554895);return _0x12779b[_0x9c0e('0x1d')]('Content-Range',_0x5ccc66+'-'+_0x1914e8+'/'+_0xf28112)[_0x9c0e('0x1e')](_0x579ae0);}return null;};}function patchUpdates(_0x416950){return function(_0x1b32eb){try{jsonpatch[_0x9c0e('0x1f')](_0x1b32eb,_0x416950,!![]);}catch(_0x435d78){return BPromise[_0x9c0e('0x20')](_0x435d78);}return _0x1b32eb['save']();};}function saveUpdates(_0x26d378,_0x5211af){return function(_0x32dc3f){if(_0x32dc3f){return _0x32dc3f[_0x9c0e('0x21')](_0x26d378)[_0x9c0e('0x22')](function(_0x577f80){return _0x577f80;});}return null;};}function removeEntity(_0x54b14b,_0x1b3e74){return function(_0x4f3229){if(_0x4f3229){return _0x4f3229['destroy']()['then'](function(){_0x54b14b['status'](0xcc)[_0x9c0e('0x23')]();});}};}function handleEntityNotFound(_0x5f0707,_0x4b62b5){return function(_0x598afa){if(!_0x598afa){_0x5f0707[_0x9c0e('0x17')](0x194);}return _0x598afa;};}function handleError(_0x25ac5f,_0x3d5278){_0x3d5278=_0x3d5278||0x1f4;return function(_0x255b7e){logger[_0x9c0e('0x24')](_0x255b7e[_0x9c0e('0x25')]);if(_0x255b7e[_0x9c0e('0x26')]){delete _0x255b7e[_0x9c0e('0x26')];}_0x25ac5f[_0x9c0e('0x18')](_0x3d5278)['send'](_0x255b7e);};}exports[_0x9c0e('0x27')]=function(_0x5af60e,_0x1e6dde){var _0xcfad93={},_0x589db1={},_0x1933b3={'count':0x0,'rows':[]};var _0x1f6997=_[_0x9c0e('0x28')](db[_0x9c0e('0x29')][_0x9c0e('0x2a')],function(_0x5d0cbc){return{'name':_0x5d0cbc[_0x9c0e('0x2b')],'type':_0x5d0cbc[_0x9c0e('0x2c')][_0x9c0e('0x2d')]};});_0x589db1['model']=_[_0x9c0e('0x28')](_0x1f6997,_0x9c0e('0x26'));_0x589db1[_0x9c0e('0x2e')]=_[_0x9c0e('0x2f')](_0x5af60e[_0x9c0e('0x2e')]);_0x589db1[_0x9c0e('0x30')]=_['intersection'](_0x589db1[_0x9c0e('0x31')],_0x589db1[_0x9c0e('0x2e')]);_0xcfad93['attributes']=_['intersection'](_0x589db1['model'],qs['fields'](_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x32')]));_0xcfad93[_0x9c0e('0x33')]=_0xcfad93['attributes']['length']?_0xcfad93[_0x9c0e('0x33')]:_0x589db1[_0x9c0e('0x31')];if(!_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x34')]('nolimit')){_0xcfad93['limit']=qs['limit'](_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x1a')]);_0xcfad93['offset']=qs[_0x9c0e('0x1c')](_0x5af60e['query']['offset']);}_0xcfad93['order']=qs[_0x9c0e('0x35')](_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x35')]);_0xcfad93['where']=qs[_0x9c0e('0x30')](_[_0x9c0e('0x36')](_0x5af60e[_0x9c0e('0x2e')],_0x589db1[_0x9c0e('0x30')]),_0x1f6997);if(_0x5af60e[_0x9c0e('0x2e')]['filter']){_0xcfad93[_0x9c0e('0x37')]=_[_0x9c0e('0x38')](_0xcfad93['where'],{'$or':_[_0x9c0e('0x28')](_0x1f6997,function(_0x54d4b2){if(_0x54d4b2[_0x9c0e('0x2c')]!==_0x9c0e('0x39')){var _0x26a9a7={};_0x26a9a7[_0x54d4b2['name']]={'$like':'%'+_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x3a')]+'%'};return _0x26a9a7;}})});}_0xcfad93=_[_0x9c0e('0x38')]({},_0xcfad93,_0x5af60e[_0x9c0e('0x3b')]);var _0x4b4c7c={'where':_0xcfad93[_0x9c0e('0x37')]};return db[_0x9c0e('0x29')]['count'](_0x4b4c7c)[_0x9c0e('0x22')](function(_0x1ee530){_0x1933b3[_0x9c0e('0x1b')]=_0x1ee530;if(_0x5af60e['query'][_0x9c0e('0x3c')]){_0xcfad93[_0x9c0e('0x3d')]=[{'all':!![]}];}return db[_0x9c0e('0x29')]['findAll'](_0xcfad93);})['then'](function(_0x45dcf5){_0x1933b3[_0x9c0e('0x3e')]=_0x45dcf5;return _0x1933b3;})['then'](respondWithFilteredResult(_0x1e6dde,_0xcfad93))[_0x9c0e('0x3f')](handleError(_0x1e6dde,null));};exports[_0x9c0e('0x40')]=function(_0x39df6c,_0x40f6c5){var _0x2d876e={'raw':!![],'where':{'id':_0x39df6c[_0x9c0e('0x41')]['id']}},_0x1816d9={};_0x1816d9[_0x9c0e('0x31')]=_[_0x9c0e('0x2f')](db['CmHopperHistory'][_0x9c0e('0x2a')]);_0x1816d9[_0x9c0e('0x2e')]=_[_0x9c0e('0x2f')](_0x39df6c[_0x9c0e('0x2e')]);_0x1816d9[_0x9c0e('0x30')]=_[_0x9c0e('0x42')](_0x1816d9[_0x9c0e('0x31')],_0x1816d9['query']);_0x2d876e['attributes']=_[_0x9c0e('0x42')](_0x1816d9['model'],qs[_0x9c0e('0x32')](_0x39df6c['query'][_0x9c0e('0x32')]));_0x2d876e[_0x9c0e('0x33')]=_0x2d876e['attributes'][_0x9c0e('0x43')]?_0x2d876e[_0x9c0e('0x33')]:_0x1816d9[_0x9c0e('0x31')];if(_0x39df6c[_0x9c0e('0x2e')][_0x9c0e('0x3c')]){_0x2d876e['include']=[{'all':!![]}];}_0x2d876e=_[_0x9c0e('0x38')]({},_0x2d876e,_0x39df6c['options']);return db[_0x9c0e('0x29')]['find'](_0x2d876e)[_0x9c0e('0x22')](handleEntityNotFound(_0x40f6c5,null))['then'](respondWithResult(_0x40f6c5,null))['catch'](handleError(_0x40f6c5,null));};exports[_0x9c0e('0x44')]=function(_0xb0a4b7,_0x81a368){return db[_0x9c0e('0x29')]['create'](_0xb0a4b7[_0x9c0e('0x45')],{})[_0x9c0e('0x22')](respondWithResult(_0x81a368,0xc9))[_0x9c0e('0x3f')](handleError(_0x81a368,null));};exports['describe']=function(_0xee4b26,_0x59ca3c){return db[_0x9c0e('0x29')][_0x9c0e('0x46')]()[_0x9c0e('0x22')](respondWithResult(_0x59ca3c,null))[_0x9c0e('0x3f')](handleError(_0x59ca3c,null));};exports[_0x9c0e('0x21')]=function(_0x5824f6,_0x1a87e1){if(_0x5824f6[_0x9c0e('0x45')][_0x9c0e('0x47')]){delete _0x5824f6[_0x9c0e('0x45')][_0x9c0e('0x47')];}return db['CmHopperHistory'][_0x9c0e('0x48')]({'where':{'uniqueid':_0x5824f6[_0x9c0e('0x41')]['id']}})[_0x9c0e('0x22')](handleEntityNotFound(_0x1a87e1,null))[_0x9c0e('0x22')](saveUpdates(_0x5824f6[_0x9c0e('0x45')],null))[_0x9c0e('0x22')](respondWithResult(_0x1a87e1,null))['catch'](handleError(_0x1a87e1,null));}; \ No newline at end of file +var _0x6697=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','create','body','catch','describe','uniqueid','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1a7911,_0x694021){var _0x40aafc=function(_0x30105a){while(--_0x30105a){_0x1a7911['push'](_0x1a7911['shift']());}};_0x40aafc(++_0x694021);}(_0x6697,0x1de));var _0x7669=function(_0x5681e5,_0x4a17a4){_0x5681e5=_0x5681e5-0x0;var _0x5c343a=_0x6697[_0x5681e5];return _0x5c343a;};'use strict';var emlformat=require(_0x7669('0x0'));var rimraf=require(_0x7669('0x1'));var zipdir=require(_0x7669('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7669('0x3'));var moment=require(_0x7669('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7669('0x5'));var util=require(_0x7669('0x6'));var path=require(_0x7669('0x7'));var sox=require(_0x7669('0x8'));var csv=require(_0x7669('0x9'));var ejs=require(_0x7669('0xa'));var fs=require('fs');var fs_extra=require(_0x7669('0xb'));var _=require(_0x7669('0xc'));var squel=require(_0x7669('0xd'));var crypto=require(_0x7669('0xe'));var jsforce=require(_0x7669('0xf'));var deskjs=require(_0x7669('0x10'));var toCsv=require(_0x7669('0x9'));var querystring=require(_0x7669('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7669('0x12'));var qs=require(_0x7669('0x13'));var as=require(_0x7669('0x14'));var hardwareService=require(_0x7669('0x15'));var logger=require(_0x7669('0x16'))(_0x7669('0x17'));var utils=require(_0x7669('0x18'));var config=require(_0x7669('0x19'));var licenseUtil=require(_0x7669('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x428744,_0x98241f){_0x98241f=_0x98241f||0xcc;return function(_0x189861){if(_0x189861){return _0x428744[_0x7669('0x1b')](_0x98241f);}return _0x428744[_0x7669('0x1c')](_0x98241f)[_0x7669('0x1d')]();};}function respondWithResult(_0x48519d,_0x2b711e){_0x2b711e=_0x2b711e||0xc8;return function(_0x2a0804){if(_0x2a0804){return _0x48519d['status'](_0x2b711e)[_0x7669('0x1e')](_0x2a0804);}};}function respondWithFilteredResult(_0x11f0a7,_0x18db94){return function(_0x32c773){if(_0x32c773){var _0x583c95=typeof _0x18db94[_0x7669('0x1f')]===_0x7669('0x20')&&typeof _0x18db94[_0x7669('0x21')]===_0x7669('0x20');var _0x3fae29=_0x32c773['count'];var _0x96e680=_0x583c95?0x0:_0x18db94['offset'];var _0x39f3a0=_0x583c95?_0x32c773[_0x7669('0x22')]:_0x18db94[_0x7669('0x1f')]+_0x18db94['limit'];var _0x588a84;if(_0x39f3a0>=_0x3fae29){_0x39f3a0=_0x3fae29;_0x588a84=0xc8;}else{_0x588a84=0xce;}_0x11f0a7[_0x7669('0x1c')](_0x588a84);return _0x11f0a7[_0x7669('0x23')](_0x7669('0x24'),_0x96e680+'-'+_0x39f3a0+'/'+_0x3fae29)['json'](_0x32c773);}return null;};}function patchUpdates(_0x79c7d8){return function(_0x316767){try{jsonpatch[_0x7669('0x25')](_0x316767,_0x79c7d8,!![]);}catch(_0x46e07){return BPromise[_0x7669('0x26')](_0x46e07);}return _0x316767[_0x7669('0x27')]();};}function saveUpdates(_0x192a8b,_0x245c9e){return function(_0x364d0c){if(_0x364d0c){return _0x364d0c[_0x7669('0x28')](_0x192a8b)['then'](function(_0x4e2a7c){return _0x4e2a7c;});}return null;};}function removeEntity(_0x12e19f,_0x362c7e){return function(_0x40851c){if(_0x40851c){return _0x40851c[_0x7669('0x29')]()[_0x7669('0x2a')](function(){_0x12e19f[_0x7669('0x1c')](0xcc)[_0x7669('0x1d')]();});}};}function handleEntityNotFound(_0x217fd4,_0x3c14e9){return function(_0x40e3bd){if(!_0x40e3bd){_0x217fd4[_0x7669('0x1b')](0x194);}return _0x40e3bd;};}function handleError(_0x112a23,_0x4fa42b){_0x4fa42b=_0x4fa42b||0x1f4;return function(_0x111d8c){logger['error'](_0x111d8c[_0x7669('0x2b')]);if(_0x111d8c[_0x7669('0x2c')]){delete _0x111d8c[_0x7669('0x2c')];}_0x112a23[_0x7669('0x1c')](_0x4fa42b)[_0x7669('0x2d')](_0x111d8c);};}exports[_0x7669('0x2e')]=function(_0x263d69,_0x5b47f9){var _0x3a1d71={},_0x2669e8={},_0xbf3396={'count':0x0,'rows':[]};var _0x281f9f=_[_0x7669('0x2f')](db[_0x7669('0x30')][_0x7669('0x31')],function(_0x45204a){return{'name':_0x45204a[_0x7669('0x32')],'type':_0x45204a['type'][_0x7669('0x33')]};});_0x2669e8['model']=_['map'](_0x281f9f,_0x7669('0x2c'));_0x2669e8[_0x7669('0x34')]=_[_0x7669('0x35')](_0x263d69[_0x7669('0x34')]);_0x2669e8[_0x7669('0x36')]=_[_0x7669('0x37')](_0x2669e8['model'],_0x2669e8[_0x7669('0x34')]);_0x3a1d71[_0x7669('0x38')]=_['intersection'](_0x2669e8[_0x7669('0x39')],qs[_0x7669('0x3a')](_0x263d69['query'][_0x7669('0x3a')]));_0x3a1d71[_0x7669('0x38')]=_0x3a1d71[_0x7669('0x38')]['length']?_0x3a1d71['attributes']:_0x2669e8[_0x7669('0x39')];if(!_0x263d69[_0x7669('0x34')][_0x7669('0x3b')]('nolimit')){_0x3a1d71[_0x7669('0x21')]=qs[_0x7669('0x21')](_0x263d69['query'][_0x7669('0x21')]);_0x3a1d71[_0x7669('0x1f')]=qs[_0x7669('0x1f')](_0x263d69[_0x7669('0x34')][_0x7669('0x1f')]);}_0x3a1d71[_0x7669('0x3c')]=qs[_0x7669('0x3d')](_0x263d69[_0x7669('0x34')][_0x7669('0x3d')]);_0x3a1d71[_0x7669('0x3e')]=qs[_0x7669('0x36')](_[_0x7669('0x3f')](_0x263d69[_0x7669('0x34')],_0x2669e8['filters']),_0x281f9f);if(_0x263d69[_0x7669('0x34')][_0x7669('0x40')]){_0x3a1d71[_0x7669('0x3e')]=_['merge'](_0x3a1d71[_0x7669('0x3e')],{'$or':_[_0x7669('0x2f')](_0x281f9f,function(_0x5f26a3){if(_0x5f26a3[_0x7669('0x41')]!==_0x7669('0x42')){var _0x374bb3={};_0x374bb3[_0x5f26a3[_0x7669('0x2c')]]={'$like':'%'+_0x263d69[_0x7669('0x34')]['filter']+'%'};return _0x374bb3;}})});}_0x3a1d71=_['merge']({},_0x3a1d71,_0x263d69['options']);var _0x101539={'where':_0x3a1d71['where']};return db[_0x7669('0x30')][_0x7669('0x22')](_0x101539)[_0x7669('0x2a')](function(_0x167851){_0xbf3396['count']=_0x167851;if(_0x263d69[_0x7669('0x34')][_0x7669('0x43')]){_0x3a1d71[_0x7669('0x44')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7669('0x45')](_0x3a1d71);})[_0x7669('0x2a')](function(_0x1cbf25){_0xbf3396[_0x7669('0x46')]=_0x1cbf25;return _0xbf3396;})[_0x7669('0x2a')](respondWithFilteredResult(_0x5b47f9,_0x3a1d71))['catch'](handleError(_0x5b47f9,null));};exports[_0x7669('0x47')]=function(_0x1bfa21,_0x229897){var _0x150efc={'raw':!![],'where':{'id':_0x1bfa21[_0x7669('0x48')]['id']}},_0x3dad96={};_0x3dad96['model']=_[_0x7669('0x35')](db[_0x7669('0x30')][_0x7669('0x31')]);_0x3dad96['query']=_[_0x7669('0x35')](_0x1bfa21[_0x7669('0x34')]);_0x3dad96[_0x7669('0x36')]=_[_0x7669('0x37')](_0x3dad96[_0x7669('0x39')],_0x3dad96['query']);_0x150efc['attributes']=_[_0x7669('0x37')](_0x3dad96[_0x7669('0x39')],qs['fields'](_0x1bfa21[_0x7669('0x34')]['fields']));_0x150efc[_0x7669('0x38')]=_0x150efc[_0x7669('0x38')][_0x7669('0x49')]?_0x150efc[_0x7669('0x38')]:_0x3dad96[_0x7669('0x39')];if(_0x1bfa21[_0x7669('0x34')]['includeAll']){_0x150efc[_0x7669('0x44')]=[{'all':!![]}];}_0x150efc=_[_0x7669('0x4a')]({},_0x150efc,_0x1bfa21[_0x7669('0x4b')]);return db[_0x7669('0x30')]['find'](_0x150efc)[_0x7669('0x2a')](handleEntityNotFound(_0x229897,null))[_0x7669('0x2a')](respondWithResult(_0x229897,null))['catch'](handleError(_0x229897,null));};exports['create']=function(_0x5b443b,_0x122c80){return db[_0x7669('0x30')][_0x7669('0x4c')](_0x5b443b[_0x7669('0x4d')],{})['then'](respondWithResult(_0x122c80,0xc9))[_0x7669('0x4e')](handleError(_0x122c80,null));};exports[_0x7669('0x4f')]=function(_0x3c7871,_0x249d64){return db[_0x7669('0x30')][_0x7669('0x4f')]()[_0x7669('0x2a')](respondWithResult(_0x249d64,null))[_0x7669('0x4e')](handleError(_0x249d64,null));};exports['update']=function(_0x214186,_0x5a5e91){if(_0x214186[_0x7669('0x4d')][_0x7669('0x50')]){delete _0x214186[_0x7669('0x4d')][_0x7669('0x50')];}return db[_0x7669('0x30')][_0x7669('0x51')]({'where':{'uniqueid':_0x214186[_0x7669('0x48')]['id']}})[_0x7669('0x2a')](handleEntityNotFound(_0x5a5e91,null))[_0x7669('0x2a')](saveUpdates(_0x214186[_0x7669('0x4d')],null))[_0x7669('0x2a')](respondWithResult(_0x5a5e91,null))[_0x7669('0x4e')](handleError(_0x5a5e91,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0ab89d2..baba5fb 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 _0xca6e=['../../config/environment','exports','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1db833,_0x57842d){var _0x45e6fe=function(_0x2645d2){while(--_0x2645d2){_0x1db833['push'](_0x1db833['shift']());}};_0x45e6fe(++_0x57842d);}(_0xca6e,0x1c1));var _0xeca6=function(_0xa8edd0,_0x3c4a95){_0xa8edd0=_0xa8edd0-0x0;var _0x3cda62=_0xca6e[_0xa8edd0];return _0x3cda62;};'use strict';var _=require(_0xeca6('0x0'));var util=require(_0xeca6('0x1'));var logger=require(_0xeca6('0x2'))(_0xeca6('0x3'));var moment=require(_0xeca6('0x4'));var BPromise=require('bluebird');var rp=require(_0xeca6('0x5'));var fs=require('fs');var path=require(_0xeca6('0x6'));var rimraf=require('rimraf');var config=require(_0xeca6('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0xeca6('0x8')]=function(_0x1d7b16,_0x32cb8d){return _0x1d7b16['define'](_0xeca6('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xeca6('0xa'),'fields':[_0xeca6('0xa')]},{'name':_0xeca6('0xb'),'fields':[_0xeca6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c8e=['bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3c8e,0x89));var _0xe3c8=function(_0x5c90b2,_0x4ebbfd){_0x5c90b2=_0x5c90b2-0x0;var _0x28e02e=_0x3c8e[_0x5c90b2];return _0x28e02e;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe3c8('0x2'));var BPromise=require(_0xe3c8('0x3'));var rp=require(_0xe3c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3c8('0x5'));var config=require(_0xe3c8('0x6'));var attributes=require(_0xe3c8('0x7'));module[_0xe3c8('0x8')]=function(_0x4bb874,_0x2a5362){return _0x4bb874[_0xe3c8('0x9')](_0xe3c8('0xa'),attributes,{'tableName':_0xe3c8('0xb'),'paranoid':![],'indexes':[{'name':_0xe3c8('0xc'),'fields':['endtime']},{'name':_0xe3c8('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 4ec1621..a755861 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 _0x0427=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperHistory,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','debug','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0427,0x137));var _0x7042=function(_0x27e6b9,_0x499a12){_0x27e6b9=_0x27e6b9-0x0;var _0x409231=_0x0427[_0x27e6b9];return _0x409231;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7042('0x0'));var BPromise=require(_0x7042('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7042('0x2'));var db=require(_0x7042('0x3'))['db'];var utils=require(_0x7042('0x4'));var logger=require(_0x7042('0x5'))(_0x7042('0x6'));var config=require(_0x7042('0x7'));var jayson=require(_0x7042('0x8'));var client=jayson['client'][_0x7042('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f24b5,_0x25c552,_0x346aa8){return new BPromise(function(_0x295b19,_0x978169){return client[_0x7042('0xa')](_0x2f24b5,_0x346aa8)[_0x7042('0xb')](function(_0x3bd534){logger['info'](_0x7042('0xc'),_0x25c552,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x25c552,'request\x20sent',JSON[_0x7042('0xd')](_0x3bd534));if(_0x3bd534['error']){if(_0x3bd534[_0x7042('0xe')][_0x7042('0xf')]===0x1f4){logger[_0x7042('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x25c552,_0x3bd534['error'][_0x7042('0x10')]);return _0x978169(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}logger[_0x7042('0xe')](_0x7042('0xc'),_0x25c552,_0x3bd534[_0x7042('0xe')]['message']);return _0x295b19(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}else{logger[_0x7042('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x25c552,_0x7042('0x12'));_0x295b19(_0x3bd534[_0x7042('0x13')]['message']);}})[_0x7042('0x14')](function(_0x590edd){logger['error'](_0x7042('0xc'),_0x25c552,_0x590edd);_0x978169(_0x590edd);});});}exports[_0x7042('0x15')]=function(_0x1e69aa){var _0x22d9a8=this;return new Promise(function(_0x6e18fb,_0x544c02){return db[_0x7042('0x16')][_0x7042('0x17')](_0x1e69aa[_0x7042('0x18')],{'raw':_0x1e69aa[_0x7042('0x19')]?_0x1e69aa[_0x7042('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x7042('0xb')](function(_0x580f84){logger[_0x7042('0x11')]('CreateCmHopperHistory',_0x1e69aa);logger[_0x7042('0x1a')](_0x7042('0x15'),_0x1e69aa,JSON[_0x7042('0xd')](_0x580f84));_0x6e18fb(_0x580f84);})[_0x7042('0x14')](function(_0x484c82){logger['error']('CreateCmHopperHistory',_0x484c82[_0x7042('0x10')],_0x1e69aa);_0x544c02(_0x22d9a8[_0x7042('0xe')](0x1f4,_0x484c82[_0x7042('0x10')]));});});};exports[_0x7042('0x1b')]=function(_0x48d529){var _0x12d618=this;return new Promise(function(_0x1d6afa,_0x4611f9){return db[_0x7042('0x16')][_0x7042('0x1c')]({'raw':_0x48d529['options']?_0x48d529[_0x7042('0x19')][_0x7042('0x1d')]===undefined?!![]:![]:!![],'where':_0x48d529[_0x7042('0x19')]?_0x48d529[_0x7042('0x19')][_0x7042('0x1e')]||null:null,'attributes':[[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')][_0x7042('0x21')]('id')),_0x7042('0x22')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x24')))),_0x7042('0x25')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x26')))),_0x7042('0x27')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x7042('0x28')],[db[_0x7042('0x1f')]['fn']('AVG',db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal'](_0x7042('0x29')))),_0x7042('0x2a')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x2b'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x7042('0xb')](function(_0x530bf6){logger[_0x7042('0x11')](_0x7042('0x1b'),_0x48d529);logger['debug'](_0x7042('0x1b'),_0x48d529,JSON['stringify'](_0x530bf6));_0x1d6afa(_0x530bf6);})[_0x7042('0x14')](function(_0x1ae147){logger[_0x7042('0xe')](_0x7042('0x1b'),_0x1ae147[_0x7042('0x10')],_0x48d529);_0x4611f9(_0x12d618[_0x7042('0xe')](0x1f4,_0x1ae147[_0x7042('0x10')]));});});};exports[_0x7042('0x2c')]=function(_0x11efb7){var _0x4d42a5=this;return new Promise(function(_0x2a13cc,_0x39702f){return db[_0x7042('0x16')]['findAll']({'raw':_0x11efb7['options']?_0x11efb7[_0x7042('0x19')][_0x7042('0x1d')]===undefined?!![]:![]:!![],'where':_0x11efb7['options']?_0x11efb7[_0x7042('0x19')][_0x7042('0x1e')]||null:null,'attributes':[[_0x7042('0x2d'),_0x7042('0x2e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x2f')))),_0x7042('0x30')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x31')))),_0x7042('0x32')],[db[_0x7042('0x1f')]['fn']('COUNT',db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x7042('0x33')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x7042('0x34')],[db[_0x7042('0x1f')]['fn']('COUNT',db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x35')))),'outboundDropCallsDayTimeout'],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x36')))),_0x7042('0x37')],[db['sequelize']['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x38')))),_0x7042('0x39')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x7042('0x3a')],[db['sequelize']['fn']('COUNT',db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x3b')))),_0x7042('0x3c')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x3d')))),_0x7042('0x3e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x3f')))),_0x7042('0x40')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x41')))),_0x7042('0x3e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x7042('0x42')]],'group':[_0x7042('0x2d')]})[_0x7042('0xb')](function(_0x5a0c85){logger['info'](_0x7042('0x2c'),_0x11efb7);logger[_0x7042('0x1a')](_0x7042('0x2c'),_0x11efb7,JSON[_0x7042('0xd')](_0x5a0c85));_0x2a13cc(_0x5a0c85);})['catch'](function(_0x497188){logger[_0x7042('0xe')](_0x7042('0x2c'),_0x497188['message'],_0x11efb7);_0x39702f(_0x4d42a5[_0x7042('0xe')](0x1f4,_0x497188[_0x7042('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0x1180e2){var _0x2abb79=this;return new Promise(function(_0x578e90,_0x449de2){return db[_0x7042('0x16')][_0x7042('0x1c')]({'raw':_0x1180e2['options']?_0x1180e2[_0x7042('0x19')][_0x7042('0x1d')]===undefined?!![]:![]:!![],'where':_0x1180e2[_0x7042('0x19')]?_0x1180e2[_0x7042('0x19')][_0x7042('0x1e')]||null:null,'attributes':[[_0x7042('0x2d'),_0x7042('0x2e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')][_0x7042('0x21')]('id')),_0x7042('0x43')],[db['sequelize']['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x24')))),_0x7042('0x44')]],'group':['campaign']})[_0x7042('0xb')](function(_0x17f5c9){logger[_0x7042('0x11')]('GetCampaignHopperHistory',_0x1180e2);logger[_0x7042('0x1a')](_0x7042('0x45'),_0x1180e2,JSON[_0x7042('0xd')](_0x17f5c9));_0x578e90(_0x17f5c9);})[_0x7042('0x14')](function(_0x267cdf){logger[_0x7042('0xe')](_0x7042('0x45'),_0x267cdf[_0x7042('0x10')],_0x1180e2);_0x449de2(_0x2abb79['error'](0x1f4,_0x267cdf[_0x7042('0x10')]));});});}; \ No newline at end of file +var _0x422f=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','body','options','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','raw','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment'];(function(_0x19a6b5,_0x2bda7c){var _0x1677ac=function(_0x2f1ad9){while(--_0x2f1ad9){_0x19a6b5['push'](_0x19a6b5['shift']());}};_0x1677ac(++_0x2bda7c);}(_0x422f,0xd9));var _0xf422=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x422f[_0x1bfe2b];return _0x1477d4;};'use strict';var _=require(_0xf422('0x0'));var util=require('util');var moment=require(_0xf422('0x1'));var BPromise=require(_0xf422('0x2'));var rs=require(_0xf422('0x3'));var fs=require('fs');var Redis=require(_0xf422('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf422('0x5'));var logger=require(_0xf422('0x6'))(_0xf422('0x7'));var config=require(_0xf422('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf422('0x9')][_0xf422('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df250,_0x3b667b,_0x44e391){return new BPromise(function(_0x3f6f26,_0x4b88de){return client[_0xf422('0xb')](_0x3df250,_0x44e391)[_0xf422('0xc')](function(_0x28e169){logger[_0xf422('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x3b667b,_0xf422('0xe'));logger[_0xf422('0xf')](_0xf422('0x10'),_0x3b667b,_0xf422('0xe'),JSON[_0xf422('0x11')](_0x28e169));if(_0x28e169[_0xf422('0x12')]){if(_0x28e169[_0xf422('0x12')][_0xf422('0x13')]===0x1f4){logger[_0xf422('0x12')](_0xf422('0x14'),_0x3b667b,_0x28e169[_0xf422('0x12')]['message']);return _0x4b88de(_0x28e169[_0xf422('0x12')][_0xf422('0x15')]);}logger[_0xf422('0x12')](_0xf422('0x14'),_0x3b667b,_0x28e169[_0xf422('0x12')][_0xf422('0x15')]);return _0x3f6f26(_0x28e169[_0xf422('0x12')][_0xf422('0x15')]);}else{logger['info'](_0xf422('0x14'),_0x3b667b,_0xf422('0xe'));_0x3f6f26(_0x28e169[_0xf422('0x16')][_0xf422('0x15')]);}})[_0xf422('0x17')](function(_0x42e868){logger[_0xf422('0x12')](_0xf422('0x14'),_0x3b667b,_0x42e868);_0x4b88de(_0x42e868);});});}exports[_0xf422('0x18')]=function(_0x5498df){var _0x8c44c0=this;return new Promise(function(_0x345a15,_0x45096d){return db['CmHopperHistory']['create'](_0x5498df[_0xf422('0x19')],{'raw':_0x5498df[_0xf422('0x1a')]?_0x5498df['options']['raw']===undefined?!![]:![]:!![]})[_0xf422('0xc')](function(_0x206b2d){logger[_0xf422('0xd')]('CreateCmHopperHistory',_0x5498df);logger[_0xf422('0xf')](_0xf422('0x18'),_0x5498df,JSON[_0xf422('0x11')](_0x206b2d));_0x345a15(_0x206b2d);})[_0xf422('0x17')](function(_0x53abd4){logger[_0xf422('0x12')](_0xf422('0x18'),_0x53abd4['message'],_0x5498df);_0x45096d(_0x8c44c0[_0xf422('0x12')](0x1f4,_0x53abd4[_0xf422('0x15')]));});});};exports[_0xf422('0x1b')]=function(_0x2f679a){var _0x19ce5b=this;return new Promise(function(_0x523fc4,_0x33d805){return db['CmHopperHistory'][_0xf422('0x1c')]({'raw':_0x2f679a[_0xf422('0x1a')]?_0x2f679a[_0xf422('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2f679a[_0xf422('0x1a')]?_0x2f679a[_0xf422('0x1a')][_0xf422('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')][_0xf422('0x20')]('id')),_0xf422('0x21')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x23')))),_0xf422('0x24')],[db['sequelize']['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x25')))),_0xf422('0x26')],[db['sequelize']['fn']('AVG',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')]['literal'](_0xf422('0x27')))),_0xf422('0x28')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x29'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x2a')))),_0xf422('0x2b')]]})['then'](function(_0x470e4d){logger['info']('AvgHandleTime',_0x2f679a);logger['debug'](_0xf422('0x1b'),_0x2f679a,JSON[_0xf422('0x11')](_0x470e4d));_0x523fc4(_0x470e4d);})['catch'](function(_0x411ea8){logger[_0xf422('0x12')](_0xf422('0x1b'),_0x411ea8[_0xf422('0x15')],_0x2f679a);_0x33d805(_0x19ce5b[_0xf422('0x12')](0x1f4,_0x411ea8[_0xf422('0x15')]));});});};exports[_0xf422('0x2c')]=function(_0x546264){var _0x2bd699=this;return new Promise(function(_0x3ba49c,_0x146125){return db[_0xf422('0x2d')][_0xf422('0x1c')]({'raw':_0x546264[_0xf422('0x1a')]?_0x546264[_0xf422('0x1a')][_0xf422('0x2e')]===undefined?!![]:![]:!![],'where':_0x546264[_0xf422('0x1a')]?_0x546264['options'][_0xf422('0x1d')]||null:null,'attributes':[['campaign',_0xf422('0x2f')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')]('`state`\x20=\x200,\x201,\x20null'))),_0xf422('0x30')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x31')))),_0xf422('0x32')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db['sequelize']['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x23')))),_0xf422('0x33')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x34')))),_0xf422('0x35')],[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x36')))),_0xf422('0x37')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')]['literal'](_0xf422('0x38')))),_0xf422('0x39')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x3a')))),_0xf422('0x3b')],[db[_0xf422('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x3c')))),_0xf422('0x3d')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x3e')))),_0xf422('0x3f')],[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x40')))),_0xf422('0x41')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db['sequelize']['fn']('IF',db[_0xf422('0x1f')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x42')))),_0xf422('0x41')],[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x43')))),_0xf422('0x44')]],'group':[_0xf422('0x45')]})[_0xf422('0xc')](function(_0x15559e){logger[_0xf422('0xd')](_0xf422('0x2c'),_0x546264);logger['debug'](_0xf422('0x2c'),_0x546264,JSON['stringify'](_0x15559e));_0x3ba49c(_0x15559e);})[_0xf422('0x17')](function(_0x2797dd){logger['error'](_0xf422('0x2c'),_0x2797dd[_0xf422('0x15')],_0x546264);_0x146125(_0x2bd699[_0xf422('0x12')](0x1f4,_0x2797dd['message']));});});};exports['GetCampaignHopperHistory']=function(_0x1b92ec){var _0x4d92a0=this;return new Promise(function(_0x264e70,_0x4ba29e){return db['CmHopperHistory'][_0xf422('0x1c')]({'raw':_0x1b92ec[_0xf422('0x1a')]?_0x1b92ec[_0xf422('0x1a')][_0xf422('0x2e')]===undefined?!![]:![]:!![],'where':_0x1b92ec[_0xf422('0x1a')]?_0x1b92ec[_0xf422('0x1a')][_0xf422('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')][_0xf422('0x20')]('id')),_0xf422('0x46')],[db[_0xf422('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x23')))),_0xf422('0x47')]],'group':[_0xf422('0x45')]})[_0xf422('0xc')](function(_0x236010){logger['info'](_0xf422('0x48'),_0x1b92ec);logger['debug']('GetCampaignHopperHistory',_0x1b92ec,JSON[_0xf422('0x11')](_0x236010));_0x264e70(_0x236010);})[_0xf422('0x17')](function(_0xa514c3){logger['error'](_0xf422('0x48'),_0xa514c3[_0xf422('0x15')],_0x1b92ec);_0x4ba29e(_0x4d92a0[_0xf422('0x12')](0x1f4,_0xa514c3[_0xf422('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 34f2342..3e31d97 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 _0x3514=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x2a5dc2,_0x4c0500){var _0x1d0b06=function(_0xfb000e){while(--_0xfb000e){_0x2a5dc2['push'](_0x2a5dc2['shift']());}};_0x1d0b06(++_0x4c0500);}(_0x3514,0x1e6));var _0x4351=function(_0x5bc48c,_0x532918){_0x5bc48c=_0x5bc48c-0x0;var _0x4f6e0f=_0x3514[_0x5bc48c];return _0x4f6e0f;};'use strict';var multer=require(_0x4351('0x0'));var util=require(_0x4351('0x1'));var path=require(_0x4351('0x2'));var timeout=require(_0x4351('0x3'));var express=require(_0x4351('0x4'));var router=express[_0x4351('0x5')]();var fs_extra=require(_0x4351('0x6'));var auth=require(_0x4351('0x7'));var interaction=require(_0x4351('0x8'));var config=require(_0x4351('0x9'));var controller=require(_0x4351('0xa'));router[_0x4351('0xb')]('/',auth['isAuthenticated'](),controller[_0x4351('0xc')]);router[_0x4351('0xb')](_0x4351('0xd'),auth[_0x4351('0xe')](),controller[_0x4351('0xf')]);router[_0x4351('0xb')](_0x4351('0x10'),auth[_0x4351('0xe')](),controller[_0x4351('0x11')]);router[_0x4351('0x12')]('/',auth[_0x4351('0xe')](),controller[_0x4351('0x13')]);router[_0x4351('0x14')](_0x4351('0x10'),auth[_0x4351('0xe')](),controller[_0x4351('0x15')]);module[_0x4351('0x16')]=router; \ No newline at end of file +var _0x3ee1=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x429649,_0xfe6499){var _0x55dbcc=function(_0x3c3d6b){while(--_0x3c3d6b){_0x429649['push'](_0x429649['shift']());}};_0x55dbcc(++_0xfe6499);}(_0x3ee1,0x1cc));var _0x13ee=function(_0x44d1c6,_0x3f65a8){_0x44d1c6=_0x44d1c6-0x0;var _0xdce7ec=_0x3ee1[_0x44d1c6];return _0xdce7ec;};'use strict';var multer=require(_0x13ee('0x0'));var util=require(_0x13ee('0x1'));var path=require(_0x13ee('0x2'));var timeout=require('connect-timeout');var express=require(_0x13ee('0x3'));var router=express[_0x13ee('0x4')]();var fs_extra=require(_0x13ee('0x5'));var auth=require(_0x13ee('0x6'));var interaction=require(_0x13ee('0x7'));var config=require(_0x13ee('0x8'));var controller=require(_0x13ee('0x9'));router[_0x13ee('0xa')]('/',auth[_0x13ee('0xb')](),controller[_0x13ee('0xc')]);router[_0x13ee('0xa')](_0x13ee('0xd'),auth['isAuthenticated'](),controller[_0x13ee('0xe')]);router[_0x13ee('0xa')](_0x13ee('0xf'),auth[_0x13ee('0xb')](),controller[_0x13ee('0x10')]);router[_0x13ee('0x11')]('/',auth['isAuthenticated'](),controller[_0x13ee('0x12')]);router[_0x13ee('0x13')](_0x13ee('0xf'),auth[_0x13ee('0xb')](),controller[_0x13ee('0x14')]);module[_0x13ee('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 03bd426..2e7f068 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 _0xd1f9=['STRING','name'];(function(_0x57aa81,_0xe9293f){var _0x2cf931=function(_0x1cae05){while(--_0x1cae05){_0x57aa81['push'](_0x57aa81['shift']());}};_0x2cf931(++_0xe9293f);}(_0xd1f9,0x88));var _0x9d1f=function(_0x49b78f,_0x1ccdf7){_0x49b78f=_0x49b78f-0x0;var _0x544d2=_0xd1f9[_0x49b78f];return _0x544d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d1f('0x0')],'unique':_0x9d1f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9d1f('0x0')]},'dialPrefix':{'type':Sequelize[_0x9d1f('0x0')]}}; \ No newline at end of file +var _0x078c=['name','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x078c,0x19f));var _0xc078=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0x078c[_0x122e9b];return _0x22c247;};'use strict';var Sequelize=require(_0xc078('0x0'));module['exports']={'name':{'type':Sequelize[_0xc078('0x1')],'unique':_0xc078('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xc078('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 0e8c69e..0280efa 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 _0x9437=['raw','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','number','BOOLEAN','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','info','message','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','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','defaults','redis','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Lists','UserProfileResource','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','filter','CmList','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','hasOwnProperty'];(function(_0x581008,_0x5e3da3){var _0x2dfaf7=function(_0x366812){while(--_0x366812){_0x581008['push'](_0x581008['shift']());}};_0x2dfaf7(++_0x5e3da3);}(_0x9437,0xd5));var _0x7943=function(_0x1ff21c,_0x2e9f03){_0x1ff21c=_0x1ff21c-0x0;var _0x571f26=_0x9437[_0x1ff21c];return _0x571f26;};'use strict';var emlformat=require(_0x7943('0x0'));var rimraf=require(_0x7943('0x1'));var zipdir=require(_0x7943('0x2'));var jsonpatch=require(_0x7943('0x3'));var rp=require(_0x7943('0x4'));var moment=require(_0x7943('0x5'));var BPromise=require(_0x7943('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7943('0x7'));var sox=require(_0x7943('0x8'));var csv=require(_0x7943('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7943('0xa'));var _=require('lodash');var squel=require(_0x7943('0xb'));var crypto=require(_0x7943('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7943('0xd'));var toCsv=require(_0x7943('0x9'));var querystring=require(_0x7943('0xe'));var Papa=require(_0x7943('0xf'));var Redis=require(_0x7943('0x10'));var authService=require(_0x7943('0x11'));var qs=require(_0x7943('0x12'));var as=require(_0x7943('0x13'));var hardwareService=require(_0x7943('0x14'));var logger=require('../../config/logger')(_0x7943('0x15'));var utils=require(_0x7943('0x16'));var config=require(_0x7943('0x17'));var licenseUtil=require(_0x7943('0x18'));var db=require(_0x7943('0x19'))['db'];var csv_results;config['redis']=_[_0x7943('0x1a')](config[_0x7943('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x7943('0x1c'))(new Redis(config['redis']));require('./cmList.socket')[_0x7943('0x1d')](socket);function respondWithStatusCode(_0x4780fb,_0x387954){_0x387954=_0x387954||0xcc;return function(_0x117591){if(_0x117591){return _0x4780fb[_0x7943('0x1e')](_0x387954);}return _0x4780fb['status'](_0x387954)['end']();};}function respondWithResult(_0x56fce6,_0x4b2bfc){_0x4b2bfc=_0x4b2bfc||0xc8;return function(_0x1ac378){if(_0x1ac378){return _0x56fce6[_0x7943('0x1f')](_0x4b2bfc)[_0x7943('0x20')](_0x1ac378);}};}function respondWithFilteredResult(_0x496811,_0x5f2a01){return function(_0x485538){if(_0x485538){var _0x2c400a=typeof _0x5f2a01['offset']===_0x7943('0x21')&&typeof _0x5f2a01[_0x7943('0x22')]===_0x7943('0x21');var _0x1e8976=_0x485538[_0x7943('0x23')];var _0x4c52b1=_0x2c400a?0x0:_0x5f2a01[_0x7943('0x24')];var _0x10f3a5=_0x2c400a?_0x485538[_0x7943('0x23')]:_0x5f2a01['offset']+_0x5f2a01[_0x7943('0x22')];var _0x46ec73;if(_0x10f3a5>=_0x1e8976){_0x10f3a5=_0x1e8976;_0x46ec73=0xc8;}else{_0x46ec73=0xce;}_0x496811[_0x7943('0x1f')](_0x46ec73);return _0x496811[_0x7943('0x25')](_0x7943('0x26'),_0x4c52b1+'-'+_0x10f3a5+'/'+_0x1e8976)['json'](_0x485538);}return null;};}function patchUpdates(_0x445a0c){return function(_0x135d50){try{jsonpatch[_0x7943('0x27')](_0x135d50,_0x445a0c,!![]);}catch(_0x11e585){return BPromise[_0x7943('0x28')](_0x11e585);}return _0x135d50[_0x7943('0x29')]();};}function saveUpdates(_0x372b30,_0x2c9129){return function(_0x16266f){if(_0x16266f){return _0x16266f[_0x7943('0x2a')](_0x372b30)['then'](function(_0x109087){return _0x109087;});}return null;};}function removeEntity(_0x30b543,_0xc0ffb1){return function(_0x2f4b8){if(_0x2f4b8){return _0x2f4b8[_0x7943('0x2b')]()[_0x7943('0x2c')](function(){var _0x17afa0=_0x2f4b8['get']({'plain':!![]});var _0x481e00=_0x7943('0x2d');return db[_0x7943('0x2e')][_0x7943('0x2b')]({'where':{'type':_0x481e00,'resourceId':_0x17afa0['id']}})[_0x7943('0x2c')](function(){return _0x2f4b8;});})[_0x7943('0x2c')](function(){_0x30b543[_0x7943('0x1f')](0xcc)[_0x7943('0x2f')]();});}};}function handleEntityNotFound(_0xb70622,_0x1958dd){return function(_0x43fd92){if(!_0x43fd92){_0xb70622[_0x7943('0x1e')](0x194);}return _0x43fd92;};}function handleError(_0x384882,_0x3c129c){_0x3c129c=_0x3c129c||0x1f4;return function(_0x41ad66){logger[_0x7943('0x30')](_0x41ad66[_0x7943('0x31')]);if(_0x41ad66[_0x7943('0x32')]){delete _0x41ad66['name'];}_0x384882[_0x7943('0x1f')](_0x3c129c)['send'](_0x41ad66);};}exports[_0x7943('0x33')]=function(_0x2fbf1b,_0x2b6f88){var _0x5e6a9a={},_0xf3307e={},_0x3b9aed={'count':0x0,'rows':[]};var _0x10f25f=_['map'](db['CmList'][_0x7943('0x34')],function(_0x37e5aa){return{'name':_0x37e5aa[_0x7943('0x35')],'type':_0x37e5aa[_0x7943('0x36')][_0x7943('0x37')]};});_0xf3307e[_0x7943('0x38')]=_[_0x7943('0x39')](_0x10f25f,_0x7943('0x32'));_0xf3307e['query']=_[_0x7943('0x3a')](_0x2fbf1b[_0x7943('0x3b')]);_0xf3307e[_0x7943('0x3c')]=_[_0x7943('0x3d')](_0xf3307e[_0x7943('0x38')],_0xf3307e['query']);_0x5e6a9a[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0xf3307e[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x3f')]));_0x5e6a9a[_0x7943('0x3e')]=_0x5e6a9a[_0x7943('0x3e')][_0x7943('0x40')]?_0x5e6a9a[_0x7943('0x3e')]:_0xf3307e[_0x7943('0x38')];if(!_0x2fbf1b[_0x7943('0x3b')]['hasOwnProperty']('nolimit')){_0x5e6a9a['limit']=qs['limit'](_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x22')]);_0x5e6a9a[_0x7943('0x24')]=qs[_0x7943('0x24')](_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x24')]);}_0x5e6a9a[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x2fbf1b['query'][_0x7943('0x42')]);_0x5e6a9a[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x2fbf1b[_0x7943('0x3b')],_0xf3307e[_0x7943('0x3c')]),_0x10f25f);if(_0x2fbf1b[_0x7943('0x3b')]['filter']){_0x5e6a9a[_0x7943('0x43')]=_[_0x7943('0x45')](_0x5e6a9a['where'],{'$or':_[_0x7943('0x39')](_0x10f25f,function(_0x448fb6){if(_0x448fb6[_0x7943('0x36')]!=='VIRTUAL'){var _0x1fdfc4={};_0x1fdfc4[_0x448fb6[_0x7943('0x32')]]={'$like':'%'+_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x46')]+'%'};return _0x1fdfc4;}})});}_0x5e6a9a=_[_0x7943('0x45')]({},_0x5e6a9a,_0x2fbf1b['options']);var _0x236e4a={'where':_0x5e6a9a[_0x7943('0x43')]};return db[_0x7943('0x47')][_0x7943('0x23')](_0x236e4a)[_0x7943('0x2c')](function(_0x449ba1){_0x3b9aed[_0x7943('0x23')]=_0x449ba1;if(_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x48')]){_0x5e6a9a['include']=[{'all':!![]}];}return db['CmList'][_0x7943('0x49')](_0x5e6a9a);})[_0x7943('0x2c')](function(_0x1b7cc4){_0x3b9aed[_0x7943('0x4a')]=_0x1b7cc4;return _0x3b9aed;})[_0x7943('0x2c')](respondWithFilteredResult(_0x2b6f88,_0x5e6a9a))[_0x7943('0x4b')](handleError(_0x2b6f88,null));};exports['show']=function(_0xe9fff2,_0x2ff3c6){var _0x414e56={'raw':![],'where':{'id':_0xe9fff2[_0x7943('0x4c')]['id']}},_0x2a8dab={};_0x2a8dab[_0x7943('0x38')]=_[_0x7943('0x3a')](db[_0x7943('0x47')][_0x7943('0x34')]);_0x2a8dab[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0xe9fff2['query']);_0x2a8dab['filters']=_['intersection'](_0x2a8dab[_0x7943('0x38')],_0x2a8dab[_0x7943('0x3b')]);_0x414e56[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x2a8dab['model'],qs[_0x7943('0x3f')](_0xe9fff2[_0x7943('0x3b')][_0x7943('0x3f')]));_0x414e56[_0x7943('0x3e')]=_0x414e56[_0x7943('0x3e')][_0x7943('0x40')]?_0x414e56[_0x7943('0x3e')]:_0x2a8dab['model'];if(_0xe9fff2[_0x7943('0x3b')][_0x7943('0x48')]){_0x414e56[_0x7943('0x4d')]=[{'all':!![]}];}_0x414e56=_[_0x7943('0x45')]({},_0x414e56,_0xe9fff2[_0x7943('0x4e')]);return db[_0x7943('0x47')][_0x7943('0x4f')](_0x414e56)[_0x7943('0x2c')](handleEntityNotFound(_0x2ff3c6,null))[_0x7943('0x2c')](respondWithResult(_0x2ff3c6,null))[_0x7943('0x4b')](handleError(_0x2ff3c6,null));};exports['create']=function(_0x15ebd7,_0x1e1654){return db['CmList'][_0x7943('0x50')](_0x15ebd7[_0x7943('0x51')],{})[_0x7943('0x2c')](function(_0x4c5ca8){var _0x2e5f55=_0x15ebd7[_0x7943('0x52')][_0x7943('0x53')]({'plain':!![]});if(!_0x2e5f55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5f55[_0x7943('0x54')]==='user'){var _0x5b603c=_0x4c5ca8[_0x7943('0x53')]({'plain':!![]});var _0x454519='Lists';return db['UserProfileSection'][_0x7943('0x4f')]({'where':{'name':_0x454519,'userProfileId':_0x2e5f55[_0x7943('0x55')]},'raw':!![]})['then'](function(_0x3b8033){if(_0x3b8033&&_0x3b8033[_0x7943('0x56')]===0x0){return db[_0x7943('0x2e')][_0x7943('0x50')]({'name':_0x5b603c[_0x7943('0x32')],'resourceId':_0x5b603c['id'],'type':_0x3b8033['name'],'sectionId':_0x3b8033['id']},{})[_0x7943('0x2c')](function(){return _0x4c5ca8;});}else{return _0x4c5ca8;}})['catch'](function(_0x3b7485){logger['error'](_0x7943('0x57'),_0x3b7485);throw _0x3b7485;});}return _0x4c5ca8;})['then'](respondWithResult(_0x1e1654,0xc9))['catch'](handleError(_0x1e1654,null));};exports[_0x7943('0x2a')]=function(_0x4160af,_0x264de4){if(_0x4160af[_0x7943('0x51')]['id']){delete _0x4160af['body']['id'];}return db[_0x7943('0x47')][_0x7943('0x4f')]({'where':{'id':_0x4160af[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x264de4,null))[_0x7943('0x2c')](saveUpdates(_0x4160af[_0x7943('0x51')],null))['then'](respondWithResult(_0x264de4,null))[_0x7943('0x4b')](handleError(_0x264de4,null));};exports[_0x7943('0x2b')]=function(_0x56c63a,_0x3df790){return db[_0x7943('0x47')]['find']({'where':{'id':_0x56c63a[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x3df790,null))[_0x7943('0x2c')](removeEntity(_0x3df790,null))[_0x7943('0x4b')](handleError(_0x3df790,null));};exports['describe']=function(_0x237853,_0x374aed){return db[_0x7943('0x47')][_0x7943('0x58')]()[_0x7943('0x2c')](respondWithResult(_0x374aed,null))['catch'](handleError(_0x374aed,null));};exports[_0x7943('0x59')]=function(_0x5dfd3a,_0x4cb298,_0x187524){if(_0x5dfd3a[_0x7943('0x51')]['id']){delete _0x5dfd3a[_0x7943('0x51')]['id'];}return db['CmList'][_0x7943('0x4f')]({'where':{'id':_0x5dfd3a[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x4cb298,null))['then'](function(_0x2e471d){if(_0x2e471d){_0x5dfd3a[_0x7943('0x51')][_0x7943('0x5a')]=_0x2e471d['id'];return db['Disposition']['create'](_0x5dfd3a[_0x7943('0x51')]);}})['then'](respondWithResult(_0x4cb298,null))['catch'](handleError(_0x4cb298,null));};exports[_0x7943('0x5b')]=function(_0x1a17f5,_0x31c9ba,_0x42d694){var _0x2d6ad2={'raw':![],'where':{}};var _0x5a6c4b={};var _0x2b616f={'count':0x0,'rows':[]};return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x1a17f5['params']['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x31c9ba,null))[_0x7943('0x2c')](function(_0x348131){if(_0x348131){_0x5a6c4b[_0x7943('0x38')]=_[_0x7943('0x3a')](db[_0x7943('0x5d')]['rawAttributes']);_0x5a6c4b[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x1a17f5[_0x7943('0x3b')]);_0x5a6c4b[_0x7943('0x3c')]=_['intersection'](_0x5a6c4b['model'],_0x5a6c4b['query']);_0x2d6ad2[_0x7943('0x3e')]=_['intersection'](_0x5a6c4b['model'],qs[_0x7943('0x3f')](_0x1a17f5[_0x7943('0x3b')][_0x7943('0x3f')]));_0x2d6ad2[_0x7943('0x3e')]=_0x2d6ad2[_0x7943('0x3e')][_0x7943('0x40')]?_0x2d6ad2[_0x7943('0x3e')]:_0x5a6c4b[_0x7943('0x38')];if(!_0x1a17f5[_0x7943('0x3b')]['hasOwnProperty'](_0x7943('0x5e'))){_0x2d6ad2[_0x7943('0x22')]=qs[_0x7943('0x22')](_0x1a17f5[_0x7943('0x3b')][_0x7943('0x22')]);_0x2d6ad2[_0x7943('0x24')]=qs['offset'](_0x1a17f5[_0x7943('0x3b')][_0x7943('0x24')]);}_0x2d6ad2[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x1a17f5[_0x7943('0x3b')]['sort']);_0x2d6ad2['where']=qs['filters'](_['pick'](_0x1a17f5[_0x7943('0x3b')],_0x5a6c4b[_0x7943('0x3c')]));_0x2d6ad2[_0x7943('0x43')][_0x7943('0x5a')]=_0x348131['id'];if(_0x1a17f5[_0x7943('0x3b')][_0x7943('0x46')]){_0x2d6ad2[_0x7943('0x43')]=_[_0x7943('0x45')](_0x2d6ad2[_0x7943('0x43')],{'$or':_[_0x7943('0x39')](_0x2d6ad2[_0x7943('0x3e')],function(_0x3a2f3d){var _0x952722={};_0x952722[_0x3a2f3d]={'$like':'%'+_0x1a17f5['query'][_0x7943('0x46')]+'%'};return _0x952722;})});}_0x2d6ad2=_['merge']({},_0x2d6ad2,_0x1a17f5[_0x7943('0x4e')]);return db[_0x7943('0x5d')][_0x7943('0x23')]({'where':_0x2d6ad2[_0x7943('0x43')]})[_0x7943('0x2c')](function(_0x1463a2){_0x2b616f[_0x7943('0x23')]=_0x1463a2;if(_0x1a17f5[_0x7943('0x3b')][_0x7943('0x48')]){_0x2d6ad2[_0x7943('0x4d')]=[{'all':!![]}];}return db[_0x7943('0x5d')][_0x7943('0x49')](_0x2d6ad2);})[_0x7943('0x2c')](function(_0x31c05d){_0x2b616f[_0x7943('0x4a')]=_0x31c05d;return _0x2b616f;});}})['then'](respondWithFilteredResult(_0x31c9ba,_0x2d6ad2))['catch'](handleError(_0x31c9ba,null));};exports[_0x7943('0x5f')]=function(_0x2199c1,_0x254d6d,_0x370989){return db['CmList'][_0x7943('0x4f')]({'where':{'id':_0x2199c1[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x254d6d,null))[_0x7943('0x2c')](function(_0x3c796f){if(_0x3c796f){return _0x3c796f[_0x7943('0x5f')](_0x2199c1[_0x7943('0x3b')][_0x7943('0x60')]);}})[_0x7943('0x2c')](respondWithStatusCode(_0x254d6d,null))[_0x7943('0x4b')](handleError(_0x254d6d,null));};exports[_0x7943('0x61')]=function(_0x5ab28d,_0xba6354,_0x4e327f){return db[_0x7943('0x47')][_0x7943('0x4f')]({'where':{'id':_0x5ab28d[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0xba6354,null))['then'](function(_0x382f85){if(_0x382f85){var _0x4697b2=[];var _0x135e93={'success':[],'errors':[]};return db[_0x7943('0x62')]['describe']()[_0x7943('0x2c')](function(_0x511f98){if(_0x5ab28d['body'][_0x7943('0x63')]&&_['isArray'](_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')])){if(_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')][_0x7943('0x40')]){_0x5ab28d['body'][_0x7943('0x63')]=_0x5ab28d[_0x7943('0x51')]['tags'][_0x7943('0x64')](';')+';';}else{_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')]=null;}}else{_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')]=null;}if(_0x5ab28d['body']&&_[_0x7943('0x65')](_0x5ab28d[_0x7943('0x51')])){for(var _0x403765=0x0;_0x403765<_0x5ab28d['body'][_0x7943('0x40')];_0x403765+=0x1){_0x5ab28d['body'][_0x403765][_0x7943('0x5a')]=_0x5ab28d[_0x7943('0x4c')]['id'];_0x4697b2[_0x7943('0x66')](_0x5ab28d[_0x7943('0x51')][_0x403765]);}return BPromise[_0x7943('0x67')](_0x4697b2,function(_0x4718d0){return db[_0x7943('0x62')][_0x7943('0x50')](_[_0x7943('0x68')](_0x4718d0,['ids','id'])||{},{'fields':_['keys'](_0x511f98),'raw':!![]})[_0x7943('0x2c')](function(_0x31be58){_0x135e93[_0x7943('0x69')]['push'](_0x31be58[_0x7943('0x6a')]);})[_0x7943('0x4b')](function(_0x1af3d4){_0x135e93[_0x7943('0x6b')]['push']({'data':_0x4718d0,'error':_0x1af3d4['message']});});})[_0x7943('0x2c')](function(_0x55eca0){return _0x135e93;})[_0x7943('0x4b')](function(_0x3f9d98){return _0x3f9d98;});}else{_0xba6354[_0x7943('0x1f')](0x190)['json']({'message':_0x7943('0x6c')});}});}})[_0x7943('0x2c')](respondWithResult(_0xba6354,null))['catch'](handleError(_0xba6354,null));};exports[_0x7943('0x6d')]=function(_0x3fe50e,_0x4e584a,_0x3f1804){var _0x2accfa;return db['CmList']['find']({'where':{'id':_0x3fe50e[_0x7943('0x4c')]['id']},'include':[{'model':db[_0x7943('0x6e')],'as':_0x7943('0x6f')}]})[_0x7943('0x2c')](handleEntityNotFound(_0x4e584a,null))[_0x7943('0x2c')](function(_0x505979){if(_0x505979){_0x2accfa=_0x505979;return db['CmContact'][_0x7943('0x34')];}})[_0x7943('0x2c')](function(_0xd942df){if(_0xd942df){var _0x1ce9ff={};var _0x40045b={};_0x40045b[_0x7943('0x38')]=_['concat'](_[_0x7943('0x3a')](_0xd942df),_['map'](_0x2accfa['CustomFields'],function(_0x56045b){return util[_0x7943('0x70')](_0x7943('0x71'),_0x56045b['id']);}));_0x40045b[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x3fe50e['query']);_0x40045b[_0x7943('0x3c')]=_['intersection'](_0x40045b['model'],_0x40045b['query']);_0x1ce9ff[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x40045b[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x3fe50e[_0x7943('0x3b')][_0x7943('0x3f')]));_0x1ce9ff[_0x7943('0x3e')]=_0x1ce9ff['attributes']['length']?_0x1ce9ff[_0x7943('0x3e')]:_0x40045b['model'];if(!_0x3fe50e[_0x7943('0x3b')][_0x7943('0x72')](_0x7943('0x5e'))){_0x1ce9ff[_0x7943('0x22')]=qs['limit'](_0x3fe50e[_0x7943('0x3b')]['limit']);_0x1ce9ff[_0x7943('0x24')]=qs[_0x7943('0x24')](_0x3fe50e[_0x7943('0x3b')]['offset']);}_0x1ce9ff[_0x7943('0x41')]=qs['sort'](_0x3fe50e[_0x7943('0x3b')][_0x7943('0x42')]);_0x1ce9ff[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x3fe50e['query'],_0x40045b[_0x7943('0x3c')]));_0x1ce9ff[_0x7943('0x73')]=!![];if(_0x3fe50e[_0x7943('0x3b')][_0x7943('0x46')]){_0x1ce9ff['where']=_['merge'](_0x1ce9ff[_0x7943('0x43')],{'$or':_[_0x7943('0x39')](_0x1ce9ff['attributes'],function(_0x4f13ae){var _0x348c55={};_0x348c55[_0x4f13ae]={'$like':'%'+_0x3fe50e[_0x7943('0x3b')]['filter']+'%'};return _0x348c55;})});}_0x1ce9ff=_[_0x7943('0x45')]({},_0x1ce9ff,_0x3fe50e['options']);return _0x2accfa['getContacts'](_0x1ce9ff);}})['then'](respondWithResult(_0x4e584a,null))[_0x7943('0x4b')](handleError(_0x4e584a,null));};exports[_0x7943('0x74')]=function(_0x15772d,_0x2a592d,_0x2c2a5e){var _0x2112e3;var _0x4454ae;var _0x21bb12;var _0x2b6871=_0x15772d[_0x7943('0x4c')]['id'];csv_results=[];return db[_0x7943('0x75')]['findAll']({'attributes':['id',_0x7943('0x32')],'raw':!![],'order':['OrderBy']})[_0x7943('0x2c')](function(_0x2aa758){_0x2112e3=_0x2aa758;var _0x2110e8=_[_0x7943('0x3a')](db['CmContact'][_0x7943('0x34')]);return db[_0x7943('0x6e')][_0x7943('0x49')]({'raw':!![],'attributes':['id',_0x7943('0x76')]})[_0x7943('0x2c')](function(_0x3c83ef){_0x4454ae=_0x3c83ef;var _0x5d6575=squel[_0x7943('0x77')]()[_0x7943('0x3f')](_0x2110e8)[_0x7943('0x78')](_0x7943('0x79'),'c')[_0x7943('0x43')](_0x7943('0x7a'),_0x2b6871)[_0x7943('0x43')](_0x7943('0x7b'))['distinct']();for(var _0x14674c=0x0;_0x14674c<_0x4454ae['length'];_0x14674c++){_0x5d6575[_0x7943('0x7c')](_0x7943('0x7d')+_0x4454ae[_0x14674c]['id'],'customField_'+_0x4454ae[_0x14674c][_0x7943('0x76')]);}for(var _0x14674c=0x0;_0x14674c<_0x2112e3[_0x7943('0x40')];_0x14674c++){_0x5d6575[_0x7943('0x7c')](squel['select']()[_0x7943('0x7c')](_0x7943('0x7e'))[_0x7943('0x78')](_0x7943('0x7f'))[_0x7943('0x43')](_0x7943('0x80'),_0x2112e3[_0x14674c]['id'])[_0x7943('0x43')](_0x7943('0x81')),_0x7943('0x82')+_0x2112e3[_0x14674c][_0x7943('0x32')]);_0x5d6575['field'](squel[_0x7943('0x77')]()[_0x7943('0x7c')](_0x7943('0x83'))[_0x7943('0x78')](_0x7943('0x7f'))[_0x7943('0x43')](_0x7943('0x80'),_0x2112e3[_0x14674c]['id'])[_0x7943('0x43')](_0x7943('0x81')),_0x7943('0x84')+_0x2112e3[_0x14674c]['name']);}var _0x17fcb2=[];_0x17fcb2[_0x7943('0x66')](_0x5d6575['toString']());BPromise[_0x7943('0x67')](_0x17fcb2,handleQuery)[_0x7943('0x2c')](function(_0x44224f){handleQuery(_0x5d6575[_0x7943('0x85')]());var _0x2bdba0=csv_results[0x0];if(!_[_0x7943('0x86')](_0x2bdba0)){var _0x54585a=toCsv(_0x2bdba0);var _0x5d17a8=Date[_0x7943('0x87')]();fs[_0x7943('0x88')](util['format'](_0x7943('0x89'),_0x2b6871,_0x5d17a8),_0x54585a);_0x2a592d[_0x7943('0x8a')](_0x7943('0x8b'),_0x7943('0x8c')+util[_0x7943('0x70')](_0x7943('0x8d'),_0x2b6871,_0x5d17a8));_0x2a592d[_0x7943('0x8a')](_0x7943('0x8e'),_0x7943('0x8f'));return _0x2a592d[_0x7943('0x90')](util[_0x7943('0x70')](_0x7943('0x89'),_0x2b6871,_0x5d17a8));}else{return _0x2a592d[_0x7943('0x1e')](0xcc);}});});});};exports[_0x7943('0x91')]=function(_0x25efd8,_0x50d3b1,_0x59cb82){var _0x11f992;delete _0x25efd8[_0x7943('0x51')]['id'];return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x25efd8[_0x7943('0x4c')]['id']}})['then'](handleEntityNotFound(_0x50d3b1,null))[_0x7943('0x2c')](function(_0x5e7d8a){if(_0x5e7d8a){return db[_0x7943('0x92')][_0x7943('0x93')](function(_0x28d179){return db[_0x7943('0x6e')][_0x7943('0x50')](_0x25efd8['body'],{'transaction':_0x28d179})['then'](function(_0x39b4ff){_0x11f992=_0x39b4ff;return _0x5e7d8a['addCustomFields'](_0x39b4ff,{'transaction':_0x28d179});})['then'](function(){var _0x34e577={'type':db[_0x7943('0x94')][_0x7943('0x95')],'transaction':_0x28d179};switch(_0x25efd8[_0x7943('0x51')][_0x7943('0x36')]){case'text':_0x34e577[_0x7943('0x36')]=db['Sequelize'][_0x7943('0x95')];break;case _0x7943('0x96'):_0x34e577[_0x7943('0x36')]=db[_0x7943('0x94')]['INTEGER'];break;case'switch':_0x34e577[_0x7943('0x36')]=db[_0x7943('0x94')][_0x7943('0x97')];_0x34e577['defaultValue']=![];break;default:}return db[_0x7943('0x92')]['queryInterface'][_0x7943('0x98')](_0x7943('0x79'),util[_0x7943('0x70')](_0x7943('0x99'),_0x11f992['id']),_0x34e577);})[_0x7943('0x2c')](function(){return _0x11f992;});});}})[_0x7943('0x2c')](respondWithResult(_0x50d3b1,null))['catch'](handleError(_0x50d3b1,null));};exports[_0x7943('0x9a')]=function(_0x2444e4,_0x4e43ac,_0x3c24c5){var _0x247ff0={};var _0x595613={};var _0x264aa0;var _0x4dc9e3;return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x2444e4[_0x7943('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e43ac,null))[_0x7943('0x2c')](function(_0x8975f){if(_0x8975f){_0x264aa0=_0x8975f;_0x595613[_0x7943('0x38')]=_[_0x7943('0x3a')](db[_0x7943('0x6e')][_0x7943('0x34')]);_0x595613[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x2444e4[_0x7943('0x3b')]);_0x595613[_0x7943('0x3c')]=_['intersection'](_0x595613[_0x7943('0x38')],_0x595613[_0x7943('0x3b')]);_0x247ff0[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x595613[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x2444e4['query'][_0x7943('0x3f')]));_0x247ff0[_0x7943('0x3e')]=_0x247ff0['attributes'][_0x7943('0x40')]?_0x247ff0[_0x7943('0x3e')]:_0x595613['model'];_0x247ff0[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x2444e4[_0x7943('0x3b')][_0x7943('0x42')]);_0x247ff0[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x2444e4['query'],_0x595613[_0x7943('0x3c')]));_0x247ff0[_0x7943('0x43')]=_[_0x7943('0x45')](_0x247ff0[_0x7943('0x43')],{'$or':[{'ListId':_0x8975f['id']},{'ListId':null}]});if(_0x2444e4['query'][_0x7943('0x46')]){_0x247ff0[_0x7943('0x43')]=_['merge'](_0x247ff0[_0x7943('0x43')],{'$or':_[_0x7943('0x39')](_0x247ff0[_0x7943('0x3e')],function(_0x43949f){var _0x40c49a={};_0x40c49a[_0x43949f]={'$like':'%'+_0x2444e4['query'][_0x7943('0x46')]+'%'};return _0x40c49a;})});}_0x247ff0=_[_0x7943('0x45')]({},_0x247ff0,_0x2444e4[_0x7943('0x4e')]);return db['CmCustomField'][_0x7943('0x9b')](_0x247ff0);}})['then'](respondWithResult(_0x4e43ac,null))[_0x7943('0x4b')](handleError(_0x4e43ac,null));};exports[_0x7943('0x9c')]=function(_0x3b42a0,_0x33725d){return db[_0x7943('0x6e')][_0x7943('0x9b')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x33725d,null))[_0x7943('0x2c')](function(_0x4ecc7e){return _0x4ecc7e;})['then'](respondWithResult(_0x33725d,null))['catch'](handleError(_0x33725d,null));};exports['addAgents']=function(_0x53db50,_0x3dba1a,_0x396bbd){return db[_0x7943('0x47')]['find']({'where':{'id':_0x53db50[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x3dba1a,null))[_0x7943('0x2c')](function(_0x5924cc){if(_0x5924cc){return _0x5924cc['addAgents'](_0x53db50[_0x7943('0x51')]['ids'],_[_0x7943('0x68')](_0x53db50['body'],['ids','id'])||{})['spread'](function(_0x14e4cc){for(var _0x5e63ad=0x0;_0x5e63ad<_0x53db50[_0x7943('0x51')][_0x7943('0x60')][_0x7943('0x40')];_0x5e63ad+=0x1){socket['emit'](_0x7943('0x9d'),{'UserId':Number(_0x53db50[_0x7943('0x51')][_0x7943('0x60')][_0x5e63ad]),'CmListId':Number(_0x53db50[_0x7943('0x4c')]['id'])});}return _0x14e4cc;});}})[_0x7943('0x2c')](respondWithResult(_0x3dba1a,null))[_0x7943('0x4b')](handleError(_0x3dba1a,null));};exports[_0x7943('0x9e')]=function(_0x357a69,_0x40c74d,_0x5dfd0f){return db['CmList'][_0x7943('0x4f')]({'where':{'id':_0x357a69['params']['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x40c74d,null))[_0x7943('0x2c')](function(_0x382228){if(_0x382228){return _0x382228[_0x7943('0x9e')](_0x357a69[_0x7943('0x3b')][_0x7943('0x60')])[_0x7943('0x2c')](function(){if(_['isArray'](_0x357a69[_0x7943('0x3b')][_0x7943('0x60')])){for(var _0x34e597=0x0;_0x34e597<_0x357a69['query'][_0x7943('0x60')][_0x7943('0x40')];_0x34e597+=0x1){socket[_0x7943('0x9f')](_0x7943('0xa0'),{'UserId':Number(_0x357a69[_0x7943('0x3b')]['ids'][_0x34e597]),'CmListId':Number(_0x357a69[_0x7943('0x4c')]['id'])});}}else{socket[_0x7943('0x9f')](_0x7943('0xa0'),{'UserId':Number(_0x357a69['query'][_0x7943('0x60')]),'CmListId':Number(_0x357a69[_0x7943('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x40c74d,null))['catch'](handleError(_0x40c74d,null));};exports[_0x7943('0xa1')]=function(_0x5f0132,_0x70badf,_0x278db4){var _0x1b7cfa={};var _0x3d25c1={};var _0x45020a;var _0x4a26a0;return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x5f0132[_0x7943('0x4c')]['id']}})['then'](handleEntityNotFound(_0x70badf,null))['then'](function(_0x3d2c66){if(_0x3d2c66){_0x45020a=_0x3d2c66;_0x3d25c1[_0x7943('0x38')]=_[_0x7943('0x3a')](db['User']['rawAttributes']);_0x3d25c1[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x5f0132[_0x7943('0x3b')]);_0x3d25c1[_0x7943('0x3c')]=_['intersection'](_0x3d25c1[_0x7943('0x38')],_0x3d25c1[_0x7943('0x3b')]);_0x1b7cfa[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x3d25c1[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x5f0132['query']['fields']));_0x1b7cfa[_0x7943('0x3e')]=_0x1b7cfa[_0x7943('0x3e')][_0x7943('0x40')]?_0x1b7cfa[_0x7943('0x3e')]:_0x3d25c1[_0x7943('0x38')];_0x1b7cfa[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x5f0132[_0x7943('0x3b')][_0x7943('0x42')]);_0x1b7cfa[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x5f0132[_0x7943('0x3b')],_0x3d25c1[_0x7943('0x3c')]));if(_0x5f0132[_0x7943('0x3b')][_0x7943('0x46')]){_0x1b7cfa[_0x7943('0x43')]=_[_0x7943('0x45')](_0x1b7cfa['where'],{'$or':_[_0x7943('0x39')](_0x1b7cfa[_0x7943('0x3e')],function(_0x3bd333){var _0x43b444={};_0x43b444[_0x3bd333]={'$like':'%'+_0x5f0132[_0x7943('0x3b')][_0x7943('0x46')]+'%'};return _0x43b444;})});}_0x1b7cfa=_[_0x7943('0x45')]({},_0x1b7cfa,_0x5f0132[_0x7943('0x4e')]);return _0x45020a[_0x7943('0xa1')](_0x1b7cfa);}})[_0x7943('0x2c')](function(_0x5725f5){if(_0x5725f5){_0x4a26a0=_0x5725f5[_0x7943('0x40')];if(!_0x5f0132[_0x7943('0x3b')][_0x7943('0x72')]('nolimit')){_0x1b7cfa[_0x7943('0x22')]=qs[_0x7943('0x22')](_0x5f0132[_0x7943('0x3b')][_0x7943('0x22')]);_0x1b7cfa[_0x7943('0x24')]=qs[_0x7943('0x24')](_0x5f0132[_0x7943('0x3b')][_0x7943('0x24')]);}return _0x45020a[_0x7943('0xa1')](_0x1b7cfa);}})[_0x7943('0x2c')](function(_0x5e913b){if(_0x5e913b){return _0x5e913b?{'count':_0x4a26a0,'rows':_0x5e913b}:null;}})['then'](respondWithResult(_0x70badf,null))[_0x7943('0x4b')](handleError(_0x70badf,null));};function handleQuery(_0x499806){logger[_0x7943('0xa2')](_0x499806);return db[_0x7943('0x92')][_0x7943('0x3b')](_0x499806)['spread'](function(_0x135309){csv_results[_0x7943('0x66')](_0x135309);})[_0x7943('0x4b')](function(_0x2abe92){logger[_0x7943('0x30')](_0x2abe92[_0x7943('0xa3')]);});} \ No newline at end of file +var _0x8087=['addAgents','omit','emit','removeAgents','isArray','userCmList:remove','getAgents','User','info','spread','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','get','Lists','UserProfileResource','error','stack','send','map','rawAttributes','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','CmList','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','ListId','getDispositions','findOne','Disposition','pick','removeDispositions','addContacts','tags','join','push','each','ids','success','errors','Malformed\x20request\x20syntax','CmCustomField','CustomFields','CmContact','concat','format','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','select','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','c.cf_','alias','from','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields'];(function(_0x28a661,_0x397569){var _0x2fd37f=function(_0x187d3e){while(--_0x187d3e){_0x28a661['push'](_0x28a661['shift']());}};_0x2fd37f(++_0x397569);}(_0x8087,0xab));var _0x7808=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x8087[_0x15c421];return _0x5e5ed5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7808('0x0'));var jsonpatch=require(_0x7808('0x1'));var rp=require(_0x7808('0x2'));var moment=require(_0x7808('0x3'));var BPromise=require(_0x7808('0x4'));var Mustache=require('mustache');var util=require(_0x7808('0x5'));var path=require('path');var sox=require(_0x7808('0x6'));var csv=require(_0x7808('0x7'));var ejs=require(_0x7808('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7808('0x9'));var squel=require(_0x7808('0xa'));var crypto=require('crypto');var jsforce=require(_0x7808('0xb'));var deskjs=require(_0x7808('0xc'));var toCsv=require(_0x7808('0x7'));var querystring=require(_0x7808('0xd'));var Papa=require(_0x7808('0xe'));var Redis=require(_0x7808('0xf'));var authService=require(_0x7808('0x10'));var qs=require(_0x7808('0x11'));var as=require(_0x7808('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7808('0x13'));var utils=require(_0x7808('0x14'));var config=require(_0x7808('0x15'));var licenseUtil=require(_0x7808('0x16'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x7808('0x17')]=_[_0x7808('0x18')](config[_0x7808('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7808('0x19'))(new Redis(config[_0x7808('0x17')]));require(_0x7808('0x1a'))[_0x7808('0x1b')](socket);function respondWithStatusCode(_0x39fad8,_0x25a991){_0x25a991=_0x25a991||0xcc;return function(_0x1c8479){if(_0x1c8479){return _0x39fad8[_0x7808('0x1c')](_0x25a991);}return _0x39fad8[_0x7808('0x1d')](_0x25a991)[_0x7808('0x1e')]();};}function respondWithResult(_0x4da40b,_0x44f3e1){_0x44f3e1=_0x44f3e1||0xc8;return function(_0x588750){if(_0x588750){return _0x4da40b[_0x7808('0x1d')](_0x44f3e1)['json'](_0x588750);}};}function respondWithFilteredResult(_0x3d3ea2,_0x17df38){return function(_0x3a22c1){if(_0x3a22c1){var _0x11ef74=typeof _0x17df38[_0x7808('0x1f')]===_0x7808('0x20')&&typeof _0x17df38['limit']===_0x7808('0x20');var _0x197dbc=_0x3a22c1[_0x7808('0x21')];var _0x2f7ecb=_0x11ef74?0x0:_0x17df38[_0x7808('0x1f')];var _0x14019c=_0x11ef74?_0x3a22c1[_0x7808('0x21')]:_0x17df38[_0x7808('0x1f')]+_0x17df38[_0x7808('0x22')];var _0xa68026;if(_0x14019c>=_0x197dbc){_0x14019c=_0x197dbc;_0xa68026=0xc8;}else{_0xa68026=0xce;}_0x3d3ea2[_0x7808('0x1d')](_0xa68026);return _0x3d3ea2[_0x7808('0x23')]('Content-Range',_0x2f7ecb+'-'+_0x14019c+'/'+_0x197dbc)[_0x7808('0x24')](_0x3a22c1);}return null;};}function patchUpdates(_0x59d3ee){return function(_0x5a9afd){try{jsonpatch[_0x7808('0x25')](_0x5a9afd,_0x59d3ee,!![]);}catch(_0x5a251b){return BPromise[_0x7808('0x26')](_0x5a251b);}return _0x5a9afd[_0x7808('0x27')]();};}function saveUpdates(_0xbe8611,_0x5e9a52){return function(_0x5decd0){if(_0x5decd0){return _0x5decd0[_0x7808('0x28')](_0xbe8611)[_0x7808('0x29')](function(_0x4850e4){return _0x4850e4;});}return null;};}function removeEntity(_0x30a507,_0x383ca9){return function(_0x546040){if(_0x546040){return _0x546040['destroy']()[_0x7808('0x29')](function(){var _0x2fefb2=_0x546040[_0x7808('0x2a')]({'plain':!![]});var _0x3c3492=_0x7808('0x2b');return db[_0x7808('0x2c')]['destroy']({'where':{'type':_0x3c3492,'resourceId':_0x2fefb2['id']}})[_0x7808('0x29')](function(){return _0x546040;});})[_0x7808('0x29')](function(){_0x30a507['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1623f,_0x70a8e5){return function(_0x4ce2d7){if(!_0x4ce2d7){_0x1623f[_0x7808('0x1c')](0x194);}return _0x4ce2d7;};}function handleError(_0x44f002,_0x143325){_0x143325=_0x143325||0x1f4;return function(_0x5b0a2f){logger[_0x7808('0x2d')](_0x5b0a2f[_0x7808('0x2e')]);if(_0x5b0a2f['name']){delete _0x5b0a2f['name'];}_0x44f002[_0x7808('0x1d')](_0x143325)[_0x7808('0x2f')](_0x5b0a2f);};}exports['index']=function(_0x40c39f,_0x284ff4){var _0x446595={},_0x1041b6={},_0x20936c={'count':0x0,'rows':[]};var _0x2f2293=_[_0x7808('0x30')](db['CmList'][_0x7808('0x31')],function(_0x387b14){return{'name':_0x387b14['fieldName'],'type':_0x387b14['type']['key']};});_0x1041b6[_0x7808('0x32')]=_[_0x7808('0x30')](_0x2f2293,_0x7808('0x33'));_0x1041b6[_0x7808('0x34')]=_['keys'](_0x40c39f[_0x7808('0x34')]);_0x1041b6[_0x7808('0x35')]=_['intersection'](_0x1041b6[_0x7808('0x32')],_0x1041b6['query']);_0x446595[_0x7808('0x36')]=_[_0x7808('0x37')](_0x1041b6[_0x7808('0x32')],qs[_0x7808('0x38')](_0x40c39f[_0x7808('0x34')][_0x7808('0x38')]));_0x446595[_0x7808('0x36')]=_0x446595[_0x7808('0x36')][_0x7808('0x39')]?_0x446595[_0x7808('0x36')]:_0x1041b6['model'];if(!_0x40c39f[_0x7808('0x34')][_0x7808('0x3a')](_0x7808('0x3b'))){_0x446595[_0x7808('0x22')]=qs[_0x7808('0x22')](_0x40c39f[_0x7808('0x34')][_0x7808('0x22')]);_0x446595[_0x7808('0x1f')]=qs[_0x7808('0x1f')](_0x40c39f[_0x7808('0x34')][_0x7808('0x1f')]);}_0x446595[_0x7808('0x3c')]=qs[_0x7808('0x3d')](_0x40c39f[_0x7808('0x34')]['sort']);_0x446595['where']=qs[_0x7808('0x35')](_['pick'](_0x40c39f['query'],_0x1041b6['filters']),_0x2f2293);if(_0x40c39f[_0x7808('0x34')]['filter']){_0x446595['where']=_['merge'](_0x446595[_0x7808('0x3e')],{'$or':_[_0x7808('0x30')](_0x2f2293,function(_0x4b6d83){if(_0x4b6d83['type']!==_0x7808('0x3f')){var _0x51c70b={};_0x51c70b[_0x4b6d83[_0x7808('0x33')]]={'$like':'%'+_0x40c39f[_0x7808('0x34')][_0x7808('0x40')]+'%'};return _0x51c70b;}})});}_0x446595=_[_0x7808('0x41')]({},_0x446595,_0x40c39f[_0x7808('0x42')]);var _0x19e16d={'where':_0x446595['where']};return db[_0x7808('0x43')][_0x7808('0x21')](_0x19e16d)[_0x7808('0x29')](function(_0x7446e2){_0x20936c[_0x7808('0x21')]=_0x7446e2;if(_0x40c39f[_0x7808('0x34')][_0x7808('0x44')]){_0x446595[_0x7808('0x45')]=[{'all':!![]}];}return db['CmList'][_0x7808('0x46')](_0x446595);})['then'](function(_0x24faf2){_0x20936c[_0x7808('0x47')]=_0x24faf2;return _0x20936c;})[_0x7808('0x29')](respondWithFilteredResult(_0x284ff4,_0x446595))[_0x7808('0x48')](handleError(_0x284ff4,null));};exports[_0x7808('0x49')]=function(_0x197f4d,_0x4711da){var _0x170b19={'raw':![],'where':{'id':_0x197f4d[_0x7808('0x4a')]['id']}},_0x1fec3f={};_0x1fec3f['model']=_[_0x7808('0x4b')](db['CmList'][_0x7808('0x31')]);_0x1fec3f[_0x7808('0x34')]=_[_0x7808('0x4b')](_0x197f4d[_0x7808('0x34')]);_0x1fec3f[_0x7808('0x35')]=_[_0x7808('0x37')](_0x1fec3f[_0x7808('0x32')],_0x1fec3f['query']);_0x170b19[_0x7808('0x36')]=_[_0x7808('0x37')](_0x1fec3f[_0x7808('0x32')],qs[_0x7808('0x38')](_0x197f4d[_0x7808('0x34')][_0x7808('0x38')]));_0x170b19[_0x7808('0x36')]=_0x170b19['attributes']['length']?_0x170b19[_0x7808('0x36')]:_0x1fec3f['model'];if(_0x197f4d[_0x7808('0x34')]['includeAll']){_0x170b19['include']=[{'all':!![]}];}_0x170b19=_[_0x7808('0x41')]({},_0x170b19,_0x197f4d[_0x7808('0x42')]);return db['CmList'][_0x7808('0x4c')](_0x170b19)[_0x7808('0x29')](handleEntityNotFound(_0x4711da,null))[_0x7808('0x29')](respondWithResult(_0x4711da,null))['catch'](handleError(_0x4711da,null));};exports['create']=function(_0x52d37a,_0x151477){return db['CmList'][_0x7808('0x4d')](_0x52d37a[_0x7808('0x4e')],{})[_0x7808('0x29')](function(_0x2cebac){var _0x4dda05=_0x52d37a[_0x7808('0x4f')]['get']({'plain':!![]});if(!_0x4dda05)throw new Error(_0x7808('0x50'));if(_0x4dda05[_0x7808('0x51')]===_0x7808('0x4f')){var _0x1a975a=_0x2cebac[_0x7808('0x2a')]({'plain':!![]});var _0x224a67=_0x7808('0x2b');return db[_0x7808('0x52')][_0x7808('0x4c')]({'where':{'name':_0x224a67,'userProfileId':_0x4dda05[_0x7808('0x53')]},'raw':!![]})[_0x7808('0x29')](function(_0x1acf56){if(_0x1acf56&&_0x1acf56[_0x7808('0x54')]===0x0){return db[_0x7808('0x2c')][_0x7808('0x4d')]({'name':_0x1a975a[_0x7808('0x33')],'resourceId':_0x1a975a['id'],'type':_0x1acf56[_0x7808('0x33')],'sectionId':_0x1acf56['id']},{})['then'](function(){return _0x2cebac;});}else{return _0x2cebac;}})[_0x7808('0x48')](function(_0x22a9d7){logger[_0x7808('0x2d')](_0x7808('0x55'),_0x22a9d7);throw _0x22a9d7;});}return _0x2cebac;})[_0x7808('0x29')](respondWithResult(_0x151477,0xc9))['catch'](handleError(_0x151477,null));};exports[_0x7808('0x28')]=function(_0x5b719f,_0x3b8670){if(_0x5b719f[_0x7808('0x4e')]['id']){delete _0x5b719f[_0x7808('0x4e')]['id'];}return db['CmList'][_0x7808('0x4c')]({'where':{'id':_0x5b719f[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x3b8670,null))[_0x7808('0x29')](saveUpdates(_0x5b719f['body'],null))[_0x7808('0x29')](respondWithResult(_0x3b8670,null))[_0x7808('0x48')](handleError(_0x3b8670,null));};exports[_0x7808('0x56')]=function(_0x1eda6b,_0x54fb0a){return db['CmList'][_0x7808('0x4c')]({'where':{'id':_0x1eda6b[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x54fb0a,null))['then'](removeEntity(_0x54fb0a,null))['catch'](handleError(_0x54fb0a,null));};exports[_0x7808('0x57')]=function(_0x5d3200,_0x1fc1b4){return db[_0x7808('0x43')]['describe']()[_0x7808('0x29')](respondWithResult(_0x1fc1b4,null))[_0x7808('0x48')](handleError(_0x1fc1b4,null));};exports['addDisposition']=function(_0x1afe85,_0x1cedb8,_0x3e1c1b){if(_0x1afe85[_0x7808('0x4e')]['id']){delete _0x1afe85[_0x7808('0x4e')]['id'];}return db[_0x7808('0x43')][_0x7808('0x4c')]({'where':{'id':_0x1afe85[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x1cedb8,null))['then'](function(_0x6826e5){if(_0x6826e5){_0x1afe85[_0x7808('0x4e')][_0x7808('0x58')]=_0x6826e5['id'];return db['Disposition']['create'](_0x1afe85['body']);}})[_0x7808('0x29')](respondWithResult(_0x1cedb8,null))[_0x7808('0x48')](handleError(_0x1cedb8,null));};exports[_0x7808('0x59')]=function(_0x30f885,_0x5ce0d0,_0x573ae9){var _0xc6e76d={'raw':![],'where':{}};var _0x29caf5={};var _0x100215={'count':0x0,'rows':[]};return db[_0x7808('0x43')][_0x7808('0x5a')]({'where':{'id':_0x30f885[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x5ce0d0,null))['then'](function(_0x22363c){if(_0x22363c){_0x29caf5[_0x7808('0x32')]=_[_0x7808('0x4b')](db[_0x7808('0x5b')]['rawAttributes']);_0x29caf5['query']=_[_0x7808('0x4b')](_0x30f885['query']);_0x29caf5[_0x7808('0x35')]=_[_0x7808('0x37')](_0x29caf5[_0x7808('0x32')],_0x29caf5[_0x7808('0x34')]);_0xc6e76d['attributes']=_['intersection'](_0x29caf5['model'],qs['fields'](_0x30f885['query']['fields']));_0xc6e76d[_0x7808('0x36')]=_0xc6e76d[_0x7808('0x36')][_0x7808('0x39')]?_0xc6e76d[_0x7808('0x36')]:_0x29caf5[_0x7808('0x32')];if(!_0x30f885[_0x7808('0x34')][_0x7808('0x3a')](_0x7808('0x3b'))){_0xc6e76d[_0x7808('0x22')]=qs[_0x7808('0x22')](_0x30f885[_0x7808('0x34')][_0x7808('0x22')]);_0xc6e76d[_0x7808('0x1f')]=qs[_0x7808('0x1f')](_0x30f885['query'][_0x7808('0x1f')]);}_0xc6e76d[_0x7808('0x3c')]=qs[_0x7808('0x3d')](_0x30f885[_0x7808('0x34')][_0x7808('0x3d')]);_0xc6e76d[_0x7808('0x3e')]=qs['filters'](_[_0x7808('0x5c')](_0x30f885[_0x7808('0x34')],_0x29caf5['filters']));_0xc6e76d[_0x7808('0x3e')][_0x7808('0x58')]=_0x22363c['id'];if(_0x30f885[_0x7808('0x34')][_0x7808('0x40')]){_0xc6e76d[_0x7808('0x3e')]=_[_0x7808('0x41')](_0xc6e76d[_0x7808('0x3e')],{'$or':_['map'](_0xc6e76d[_0x7808('0x36')],function(_0x433b4f){var _0x149d2b={};_0x149d2b[_0x433b4f]={'$like':'%'+_0x30f885['query'][_0x7808('0x40')]+'%'};return _0x149d2b;})});}_0xc6e76d=_[_0x7808('0x41')]({},_0xc6e76d,_0x30f885[_0x7808('0x42')]);return db[_0x7808('0x5b')][_0x7808('0x21')]({'where':_0xc6e76d[_0x7808('0x3e')]})[_0x7808('0x29')](function(_0x4f1acf){_0x100215[_0x7808('0x21')]=_0x4f1acf;if(_0x30f885[_0x7808('0x34')][_0x7808('0x44')]){_0xc6e76d[_0x7808('0x45')]=[{'all':!![]}];}return db[_0x7808('0x5b')][_0x7808('0x46')](_0xc6e76d);})['then'](function(_0x432383){_0x100215[_0x7808('0x47')]=_0x432383;return _0x100215;});}})[_0x7808('0x29')](respondWithFilteredResult(_0x5ce0d0,_0xc6e76d))[_0x7808('0x48')](handleError(_0x5ce0d0,null));};exports[_0x7808('0x5d')]=function(_0xb51f7a,_0x210f53,_0xa405f){return db[_0x7808('0x43')][_0x7808('0x4c')]({'where':{'id':_0xb51f7a[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x210f53,null))[_0x7808('0x29')](function(_0x5ecb0c){if(_0x5ecb0c){return _0x5ecb0c[_0x7808('0x5d')](_0xb51f7a[_0x7808('0x34')]['ids']);}})[_0x7808('0x29')](respondWithStatusCode(_0x210f53,null))[_0x7808('0x48')](handleError(_0x210f53,null));};exports[_0x7808('0x5e')]=function(_0x3c3f44,_0x31fed6,_0x97f601){return db['CmList']['find']({'where':{'id':_0x3c3f44[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x31fed6,null))['then'](function(_0x1880e5){if(_0x1880e5){var _0x3b022e=[];var _0x35c551={'success':[],'errors':[]};return db['CmContact'][_0x7808('0x57')]()['then'](function(_0x2db657){if(_0x3c3f44['body'][_0x7808('0x5f')]&&_['isArray'](_0x3c3f44[_0x7808('0x4e')][_0x7808('0x5f')])){if(_0x3c3f44['body']['tags']['length']){_0x3c3f44[_0x7808('0x4e')]['tags']=_0x3c3f44[_0x7808('0x4e')][_0x7808('0x5f')][_0x7808('0x60')](';')+';';}else{_0x3c3f44['body'][_0x7808('0x5f')]=null;}}else{_0x3c3f44[_0x7808('0x4e')][_0x7808('0x5f')]=null;}if(_0x3c3f44[_0x7808('0x4e')]&&_['isArray'](_0x3c3f44[_0x7808('0x4e')])){for(var _0x5db857=0x0;_0x5db857<_0x3c3f44[_0x7808('0x4e')][_0x7808('0x39')];_0x5db857+=0x1){_0x3c3f44[_0x7808('0x4e')][_0x5db857][_0x7808('0x58')]=_0x3c3f44[_0x7808('0x4a')]['id'];_0x3b022e[_0x7808('0x61')](_0x3c3f44['body'][_0x5db857]);}return BPromise[_0x7808('0x62')](_0x3b022e,function(_0x20bd9b){return db['CmContact'][_0x7808('0x4d')](_['omit'](_0x20bd9b,[_0x7808('0x63'),'id'])||{},{'fields':_[_0x7808('0x4b')](_0x2db657),'raw':!![]})['then'](function(_0x578cf7){_0x35c551[_0x7808('0x64')]['push'](_0x578cf7['dataValues']);})[_0x7808('0x48')](function(_0xb773c4){_0x35c551[_0x7808('0x65')]['push']({'data':_0x20bd9b,'error':_0xb773c4['message']});});})[_0x7808('0x29')](function(_0x3dda33){return _0x35c551;})[_0x7808('0x48')](function(_0x342e6d){return _0x342e6d;});}else{_0x31fed6[_0x7808('0x1d')](0x190)[_0x7808('0x24')]({'message':_0x7808('0x66')});}});}})[_0x7808('0x29')](respondWithResult(_0x31fed6,null))[_0x7808('0x48')](handleError(_0x31fed6,null));};exports['getContacts']=function(_0x1857bd,_0x177586,_0x11e933){var _0x2a3776;return db[_0x7808('0x43')][_0x7808('0x4c')]({'where':{'id':_0x1857bd[_0x7808('0x4a')]['id']},'include':[{'model':db[_0x7808('0x67')],'as':_0x7808('0x68')}]})[_0x7808('0x29')](handleEntityNotFound(_0x177586,null))[_0x7808('0x29')](function(_0x4b1c45){if(_0x4b1c45){_0x2a3776=_0x4b1c45;return db[_0x7808('0x69')]['rawAttributes'];}})['then'](function(_0x4279fe){if(_0x4279fe){var _0x16af06={};var _0x6071dc={};_0x6071dc[_0x7808('0x32')]=_[_0x7808('0x6a')](_['keys'](_0x4279fe),_[_0x7808('0x30')](_0x2a3776[_0x7808('0x68')],function(_0x4f6f29){return util[_0x7808('0x6b')](_0x7808('0x6c'),_0x4f6f29['id']);}));_0x6071dc['query']=_[_0x7808('0x4b')](_0x1857bd[_0x7808('0x34')]);_0x6071dc[_0x7808('0x35')]=_[_0x7808('0x37')](_0x6071dc[_0x7808('0x32')],_0x6071dc[_0x7808('0x34')]);_0x16af06['attributes']=_[_0x7808('0x37')](_0x6071dc[_0x7808('0x32')],qs[_0x7808('0x38')](_0x1857bd['query'][_0x7808('0x38')]));_0x16af06[_0x7808('0x36')]=_0x16af06[_0x7808('0x36')][_0x7808('0x39')]?_0x16af06[_0x7808('0x36')]:_0x6071dc[_0x7808('0x32')];if(!_0x1857bd[_0x7808('0x34')][_0x7808('0x3a')]('nolimit')){_0x16af06[_0x7808('0x22')]=qs[_0x7808('0x22')](_0x1857bd[_0x7808('0x34')]['limit']);_0x16af06[_0x7808('0x1f')]=qs[_0x7808('0x1f')](_0x1857bd['query'][_0x7808('0x1f')]);}_0x16af06[_0x7808('0x3c')]=qs['sort'](_0x1857bd[_0x7808('0x34')][_0x7808('0x3d')]);_0x16af06[_0x7808('0x3e')]=qs[_0x7808('0x35')](_['pick'](_0x1857bd['query'],_0x6071dc[_0x7808('0x35')]));_0x16af06[_0x7808('0x6d')]=!![];if(_0x1857bd[_0x7808('0x34')][_0x7808('0x40')]){_0x16af06['where']=_['merge'](_0x16af06[_0x7808('0x3e')],{'$or':_[_0x7808('0x30')](_0x16af06[_0x7808('0x36')],function(_0x146021){var _0x5301d3={};_0x5301d3[_0x146021]={'$like':'%'+_0x1857bd[_0x7808('0x34')][_0x7808('0x40')]+'%'};return _0x5301d3;})});}_0x16af06=_[_0x7808('0x41')]({},_0x16af06,_0x1857bd['options']);return _0x2a3776[_0x7808('0x6e')](_0x16af06);}})[_0x7808('0x29')](respondWithResult(_0x177586,null))['catch'](handleError(_0x177586,null));};exports[_0x7808('0x6f')]=function(_0x7a14ce,_0x54b9e7,_0x4fa5b7){var _0x16fffe;var _0x39c702;var _0x14a0a8;var _0x12d845=_0x7a14ce[_0x7808('0x4a')]['id'];csv_results=[];return db[_0x7808('0x70')]['findAll']({'attributes':['id',_0x7808('0x33')],'raw':!![],'order':[_0x7808('0x71')]})['then'](function(_0x1fc869){_0x16fffe=_0x1fc869;var _0x4a0b87=_[_0x7808('0x4b')](db[_0x7808('0x69')][_0x7808('0x31')]);return db['CmCustomField'][_0x7808('0x46')]({'raw':!![],'attributes':['id','alias']})[_0x7808('0x29')](function(_0x33e1b4){_0x39c702=_0x33e1b4;var _0x583c21=squel[_0x7808('0x72')]()[_0x7808('0x38')](_0x4a0b87)['from'](_0x7808('0x73'),'c')[_0x7808('0x3e')]('c.ListId\x20=\x20?',_0x12d845)[_0x7808('0x3e')](_0x7808('0x74'))[_0x7808('0x75')]();for(var _0x2a5457=0x0;_0x2a5457<_0x39c702[_0x7808('0x39')];_0x2a5457++){_0x583c21[_0x7808('0x76')](_0x7808('0x77')+_0x39c702[_0x2a5457]['id'],'customField_'+_0x39c702[_0x2a5457][_0x7808('0x78')]);}for(var _0x2a5457=0x0;_0x2a5457<_0x16fffe['length'];_0x2a5457++){_0x583c21[_0x7808('0x76')](squel['select']()[_0x7808('0x76')]('item')[_0x7808('0x79')]('cm_contact_has_items')[_0x7808('0x3e')](_0x7808('0x7a'),_0x16fffe[_0x2a5457]['id'])[_0x7808('0x3e')](_0x7808('0x7b')),_0x7808('0x7c')+_0x16fffe[_0x2a5457][_0x7808('0x33')]);_0x583c21[_0x7808('0x76')](squel[_0x7808('0x72')]()[_0x7808('0x76')](_0x7808('0x7d'))[_0x7808('0x79')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x16fffe[_0x2a5457]['id'])[_0x7808('0x3e')](_0x7808('0x7b')),'description_additionalPhone_'+_0x16fffe[_0x2a5457]['name']);}var _0x330b76=[];_0x330b76[_0x7808('0x61')](_0x583c21[_0x7808('0x7e')]());BPromise[_0x7808('0x62')](_0x330b76,handleQuery)['then'](function(_0x14c13e){handleQuery(_0x583c21['toString']());var _0x159fb1=csv_results[0x0];if(!_[_0x7808('0x7f')](_0x159fb1)){var _0x36c21e=toCsv(_0x159fb1);var _0x26d1b7=Date[_0x7808('0x80')]();fs[_0x7808('0x81')](util['format'](_0x7808('0x82'),_0x12d845,_0x26d1b7),_0x36c21e);_0x54b9e7[_0x7808('0x83')](_0x7808('0x84'),_0x7808('0x85')+util[_0x7808('0x6b')](_0x7808('0x86'),_0x12d845,_0x26d1b7));_0x54b9e7[_0x7808('0x83')]('Content-type',_0x7808('0x87'));return _0x54b9e7['download'](util[_0x7808('0x6b')](_0x7808('0x82'),_0x12d845,_0x26d1b7));}else{return _0x54b9e7['sendStatus'](0xcc);}});});});};exports[_0x7808('0x88')]=function(_0x4bad0f,_0x22a293,_0x908fa4){var _0x5c2fb9;delete _0x4bad0f[_0x7808('0x4e')]['id'];return db[_0x7808('0x43')][_0x7808('0x5a')]({'where':{'id':_0x4bad0f[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x22a293,null))[_0x7808('0x29')](function(_0x4d852c){if(_0x4d852c){return db[_0x7808('0x89')][_0x7808('0x8a')](function(_0x375794){return db[_0x7808('0x67')][_0x7808('0x4d')](_0x4bad0f['body'],{'transaction':_0x375794})['then'](function(_0xee6e3){_0x5c2fb9=_0xee6e3;return _0x4d852c[_0x7808('0x8b')](_0xee6e3,{'transaction':_0x375794});})[_0x7808('0x29')](function(){var _0x14fa87={'type':db[_0x7808('0x8c')][_0x7808('0x8d')],'transaction':_0x375794};switch(_0x4bad0f[_0x7808('0x4e')][_0x7808('0x8e')]){case _0x7808('0x8f'):_0x14fa87[_0x7808('0x8e')]=db[_0x7808('0x8c')][_0x7808('0x8d')];break;case _0x7808('0x90'):_0x14fa87[_0x7808('0x8e')]=db[_0x7808('0x8c')][_0x7808('0x91')];break;case'switch':_0x14fa87['type']=db[_0x7808('0x8c')]['BOOLEAN'];_0x14fa87['defaultValue']=![];break;default:}return db['sequelize'][_0x7808('0x92')][_0x7808('0x93')](_0x7808('0x73'),util['format'](_0x7808('0x94'),_0x5c2fb9['id']),_0x14fa87);})['then'](function(){return _0x5c2fb9;});});}})[_0x7808('0x29')](respondWithResult(_0x22a293,null))[_0x7808('0x48')](handleError(_0x22a293,null));};exports[_0x7808('0x95')]=function(_0x5dca0a,_0xbfcc3a,_0x4223c3){var _0x266ae2={};var _0x80ba65={};var _0x4abdb0;var _0x517797;return db['CmList']['findOne']({'where':{'id':_0x5dca0a[_0x7808('0x4a')]['id']}})['then'](handleEntityNotFound(_0xbfcc3a,null))[_0x7808('0x29')](function(_0x403395){if(_0x403395){_0x4abdb0=_0x403395;_0x80ba65['model']=_[_0x7808('0x4b')](db[_0x7808('0x67')][_0x7808('0x31')]);_0x80ba65[_0x7808('0x34')]=_['keys'](_0x5dca0a['query']);_0x80ba65[_0x7808('0x35')]=_['intersection'](_0x80ba65[_0x7808('0x32')],_0x80ba65[_0x7808('0x34')]);_0x266ae2[_0x7808('0x36')]=_[_0x7808('0x37')](_0x80ba65[_0x7808('0x32')],qs['fields'](_0x5dca0a['query'][_0x7808('0x38')]));_0x266ae2[_0x7808('0x36')]=_0x266ae2[_0x7808('0x36')]['length']?_0x266ae2[_0x7808('0x36')]:_0x80ba65[_0x7808('0x32')];_0x266ae2[_0x7808('0x3c')]=qs['sort'](_0x5dca0a[_0x7808('0x34')][_0x7808('0x3d')]);_0x266ae2[_0x7808('0x3e')]=qs[_0x7808('0x35')](_[_0x7808('0x5c')](_0x5dca0a[_0x7808('0x34')],_0x80ba65[_0x7808('0x35')]));_0x266ae2['where']=_[_0x7808('0x41')](_0x266ae2[_0x7808('0x3e')],{'$or':[{'ListId':_0x403395['id']},{'ListId':null}]});if(_0x5dca0a['query']['filter']){_0x266ae2[_0x7808('0x3e')]=_['merge'](_0x266ae2[_0x7808('0x3e')],{'$or':_[_0x7808('0x30')](_0x266ae2[_0x7808('0x36')],function(_0x39ba0f){var _0x32d701={};_0x32d701[_0x39ba0f]={'$like':'%'+_0x5dca0a[_0x7808('0x34')]['filter']+'%'};return _0x32d701;})});}_0x266ae2=_[_0x7808('0x41')]({},_0x266ae2,_0x5dca0a[_0x7808('0x42')]);return db['CmCustomField']['findAndCountAll'](_0x266ae2);}})[_0x7808('0x29')](respondWithResult(_0xbfcc3a,null))[_0x7808('0x48')](handleError(_0xbfcc3a,null));};exports[_0x7808('0x96')]=function(_0x175cc0,_0xb91bc){return db[_0x7808('0x67')]['findAndCountAll']({'where':{'ListId':null}})[_0x7808('0x29')](handleEntityNotFound(_0xb91bc,null))[_0x7808('0x29')](function(_0xdb8c39){return _0xdb8c39;})[_0x7808('0x29')](respondWithResult(_0xb91bc,null))[_0x7808('0x48')](handleError(_0xb91bc,null));};exports[_0x7808('0x97')]=function(_0x279834,_0x48b6fa,_0x3181b5){return db['CmList'][_0x7808('0x4c')]({'where':{'id':_0x279834[_0x7808('0x4a')]['id']}})[_0x7808('0x29')](handleEntityNotFound(_0x48b6fa,null))[_0x7808('0x29')](function(_0x38bc07){if(_0x38bc07){return _0x38bc07[_0x7808('0x97')](_0x279834['body'][_0x7808('0x63')],_[_0x7808('0x98')](_0x279834[_0x7808('0x4e')],[_0x7808('0x63'),'id'])||{})['spread'](function(_0x261fb7){for(var _0x806bd5=0x0;_0x806bd5<_0x279834[_0x7808('0x4e')][_0x7808('0x63')][_0x7808('0x39')];_0x806bd5+=0x1){socket[_0x7808('0x99')]('userCmList:save',{'UserId':Number(_0x279834[_0x7808('0x4e')][_0x7808('0x63')][_0x806bd5]),'CmListId':Number(_0x279834['params']['id'])});}return _0x261fb7;});}})['then'](respondWithResult(_0x48b6fa,null))[_0x7808('0x48')](handleError(_0x48b6fa,null));};exports[_0x7808('0x9a')]=function(_0x2234af,_0x15197a,_0x54f653){return db[_0x7808('0x43')][_0x7808('0x4c')]({'where':{'id':_0x2234af['params']['id']}})['then'](handleEntityNotFound(_0x15197a,null))[_0x7808('0x29')](function(_0x328a1f){if(_0x328a1f){return _0x328a1f[_0x7808('0x9a')](_0x2234af['query'][_0x7808('0x63')])[_0x7808('0x29')](function(){if(_[_0x7808('0x9b')](_0x2234af[_0x7808('0x34')][_0x7808('0x63')])){for(var _0x149577=0x0;_0x149577<_0x2234af[_0x7808('0x34')][_0x7808('0x63')][_0x7808('0x39')];_0x149577+=0x1){socket[_0x7808('0x99')]('userCmList:remove',{'UserId':Number(_0x2234af['query'][_0x7808('0x63')][_0x149577]),'CmListId':Number(_0x2234af[_0x7808('0x4a')]['id'])});}}else{socket[_0x7808('0x99')](_0x7808('0x9c'),{'UserId':Number(_0x2234af[_0x7808('0x34')]['ids']),'CmListId':Number(_0x2234af['params']['id'])});}});}})['then'](respondWithStatusCode(_0x15197a,null))[_0x7808('0x48')](handleError(_0x15197a,null));};exports[_0x7808('0x9d')]=function(_0x402eff,_0x46a70b,_0x251c39){var _0x27e325={};var _0x320e92={};var _0x11dadc;var _0xe7cd9;return db[_0x7808('0x43')][_0x7808('0x5a')]({'where':{'id':_0x402eff['params']['id']}})['then'](handleEntityNotFound(_0x46a70b,null))[_0x7808('0x29')](function(_0x4b832a){if(_0x4b832a){_0x11dadc=_0x4b832a;_0x320e92[_0x7808('0x32')]=_['keys'](db[_0x7808('0x9e')][_0x7808('0x31')]);_0x320e92[_0x7808('0x34')]=_['keys'](_0x402eff[_0x7808('0x34')]);_0x320e92[_0x7808('0x35')]=_[_0x7808('0x37')](_0x320e92['model'],_0x320e92[_0x7808('0x34')]);_0x27e325['attributes']=_[_0x7808('0x37')](_0x320e92[_0x7808('0x32')],qs[_0x7808('0x38')](_0x402eff['query'][_0x7808('0x38')]));_0x27e325[_0x7808('0x36')]=_0x27e325[_0x7808('0x36')][_0x7808('0x39')]?_0x27e325[_0x7808('0x36')]:_0x320e92[_0x7808('0x32')];_0x27e325['order']=qs['sort'](_0x402eff[_0x7808('0x34')]['sort']);_0x27e325[_0x7808('0x3e')]=qs[_0x7808('0x35')](_['pick'](_0x402eff[_0x7808('0x34')],_0x320e92[_0x7808('0x35')]));if(_0x402eff[_0x7808('0x34')]['filter']){_0x27e325[_0x7808('0x3e')]=_[_0x7808('0x41')](_0x27e325[_0x7808('0x3e')],{'$or':_[_0x7808('0x30')](_0x27e325['attributes'],function(_0x36a7d1){var _0x160803={};_0x160803[_0x36a7d1]={'$like':'%'+_0x402eff[_0x7808('0x34')][_0x7808('0x40')]+'%'};return _0x160803;})});}_0x27e325=_[_0x7808('0x41')]({},_0x27e325,_0x402eff['options']);return _0x11dadc['getAgents'](_0x27e325);}})['then'](function(_0x1514cc){if(_0x1514cc){_0xe7cd9=_0x1514cc[_0x7808('0x39')];if(!_0x402eff['query']['hasOwnProperty'](_0x7808('0x3b'))){_0x27e325[_0x7808('0x22')]=qs['limit'](_0x402eff[_0x7808('0x34')][_0x7808('0x22')]);_0x27e325[_0x7808('0x1f')]=qs[_0x7808('0x1f')](_0x402eff[_0x7808('0x34')][_0x7808('0x1f')]);}return _0x11dadc[_0x7808('0x9d')](_0x27e325);}})['then'](function(_0x57741a){if(_0x57741a){return _0x57741a?{'count':_0xe7cd9,'rows':_0x57741a}:null;}})[_0x7808('0x29')](respondWithResult(_0x46a70b,null))[_0x7808('0x48')](handleError(_0x46a70b,null));};function handleQuery(_0x52e51c){logger[_0x7808('0x9f')](_0x52e51c);return db[_0x7808('0x89')][_0x7808('0x34')](_0x52e51c)[_0x7808('0xa0')](function(_0x345156){csv_results[_0x7808('0x61')](_0x345156);})[_0x7808('0x48')](function(_0x1765df){logger[_0x7808('0x2d')](_0x1765df['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 42b9e1b..ac1dd46 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x5bc18d,_0x4a1372){var _0x32a08e=function(_0x22d348){while(--_0x22d348){_0x5bc18d['push'](_0x5bc18d['shift']());}};_0x32a08e(++_0x4a1372);}(_0x7217,0x19e));var _0x7721=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7217[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3e74,0x175));var _0x43e7=function(_0x5835c6,_0x1de65c){_0x5835c6=_0x5835c6-0x0;var _0x502938=_0x3e74[_0x5835c6];return _0x502938;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d02231e..fdb6cf1 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 _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x347d0e,_0x596808){var _0x236754=function(_0x54695c){while(--_0x54695c){_0x347d0e['push'](_0x347d0e['shift']());}};_0x236754(++_0x596808);}(_0x99e9,0xb4));var _0x999e=function(_0x19997d,_0x2c92a4){_0x19997d=_0x19997d-0x0;var _0x49be7f=_0x99e9[_0x19997d];return _0x49be7f;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x24724b,_0x134d50){var _0x481080=function(_0x42e4ba){while(--_0x42e4ba){_0x24724b['push'](_0x24724b['shift']());}};_0x481080(++_0x134d50);}(_0xb903,0x185));var _0x3b90=function(_0x4e03e8,_0x2b1c73){_0x4e03e8=_0x4e03e8-0x0;var _0x36c5e1=_0xb903[_0x4e03e8];return _0x36c5e1;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 37011a9..65ccdd6 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 _0xa034=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x17c5ae,_0x233499){var _0x39eab9=function(_0x13f419){while(--_0x13f419){_0x17c5ae['push'](_0x17c5ae['shift']());}};_0x39eab9(++_0x233499);}(_0xa034,0x1d8));var _0x4a03=function(_0x3711e2,_0x1468e1){_0x3711e2=_0x3711e2-0x0;var _0x18a556=_0xa034[_0x3711e2];return _0x18a556;};'use strict';var _=require(_0x4a03('0x0'));var util=require('util');var moment=require(_0x4a03('0x1'));var BPromise=require(_0x4a03('0x2'));var rs=require(_0x4a03('0x3'));var fs=require('fs');var Redis=require(_0x4a03('0x4'));var db=require(_0x4a03('0x5'))['db'];var utils=require(_0x4a03('0x6'));var logger=require('../../config/logger')(_0x4a03('0x7'));var config=require(_0x4a03('0x8'));var jayson=require(_0x4a03('0x9'));var client=jayson[_0x4a03('0xa')][_0x4a03('0xb')]({'port':0x232a});config[_0x4a03('0xc')]=_[_0x4a03('0xd')](config[_0x4a03('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a03('0xe'))(new Redis(config['redis']));require(_0x4a03('0xf'))[_0x4a03('0x10')](socket);function respondWithRpcPromise(_0x88f54d,_0x3f84c7,_0x485ccc){return new BPromise(function(_0x1ad27a,_0x54203d){return client[_0x4a03('0x11')](_0x88f54d,_0x485ccc)[_0x4a03('0x12')](function(_0x1ce8f5){logger[_0x4a03('0x13')](_0x4a03('0x14'),_0x3f84c7,'request\x20sent');logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x3f84c7,'request\x20sent',JSON[_0x4a03('0x15')](_0x1ce8f5));if(_0x1ce8f5[_0x4a03('0x16')]){if(_0x1ce8f5[_0x4a03('0x16')]['code']===0x1f4){logger['error'](_0x4a03('0x14'),_0x3f84c7,_0x1ce8f5[_0x4a03('0x16')][_0x4a03('0x17')]);return _0x54203d(_0x1ce8f5['error']['message']);}logger[_0x4a03('0x16')]('CmList,\x20%s,\x20%s',_0x3f84c7,_0x1ce8f5[_0x4a03('0x16')]['message']);return _0x1ad27a(_0x1ce8f5['error'][_0x4a03('0x17')]);}else{logger[_0x4a03('0x13')](_0x4a03('0x14'),_0x3f84c7,'request\x20sent');_0x1ad27a(_0x1ce8f5['result']['message']);}})['catch'](function(_0x26be15){logger['error'](_0x4a03('0x14'),_0x3f84c7,_0x26be15);_0x54203d(_0x26be15);});});} \ No newline at end of file +var _0xd4f9=['../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15c43a,_0x50643b){var _0x900289=function(_0x258a8c){while(--_0x258a8c){_0x15c43a['push'](_0x15c43a['shift']());}};_0x900289(++_0x50643b);}(_0xd4f9,0x18d));var _0x9d4f=function(_0x14ef2e,_0x5cf60b){_0x14ef2e=_0x14ef2e-0x0;var _0x58a847=_0xd4f9[_0x14ef2e];return _0x58a847;};'use strict';var _=require(_0x9d4f('0x0'));var util=require(_0x9d4f('0x1'));var moment=require(_0x9d4f('0x2'));var BPromise=require(_0x9d4f('0x3'));var rs=require(_0x9d4f('0x4'));var fs=require('fs');var Redis=require(_0x9d4f('0x5'));var db=require(_0x9d4f('0x6'))['db'];var utils=require(_0x9d4f('0x7'));var logger=require(_0x9d4f('0x8'))(_0x9d4f('0x9'));var config=require('../../config/environment');var jayson=require(_0x9d4f('0xa'));var client=jayson['client'][_0x9d4f('0xb')]({'port':0x232a});config[_0x9d4f('0xc')]=_[_0x9d4f('0xd')](config[_0x9d4f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d4f('0xe'))(new Redis(config['redis']));require(_0x9d4f('0xf'))[_0x9d4f('0x10')](socket);function respondWithRpcPromise(_0x16603a,_0x181e98,_0x5cd8a4){return new BPromise(function(_0x5b8742,_0x48a75f){return client[_0x9d4f('0x11')](_0x16603a,_0x5cd8a4)[_0x9d4f('0x12')](function(_0x2724db){logger[_0x9d4f('0x13')]('CmList,\x20%s,\x20%s',_0x181e98,_0x9d4f('0x14'));logger['debug'](_0x9d4f('0x15'),_0x181e98,_0x9d4f('0x14'),JSON[_0x9d4f('0x16')](_0x2724db));if(_0x2724db[_0x9d4f('0x17')]){if(_0x2724db[_0x9d4f('0x17')]['code']===0x1f4){logger['error'](_0x9d4f('0x18'),_0x181e98,_0x2724db['error']['message']);return _0x48a75f(_0x2724db[_0x9d4f('0x17')]['message']);}logger[_0x9d4f('0x17')](_0x9d4f('0x18'),_0x181e98,_0x2724db[_0x9d4f('0x17')]['message']);return _0x5b8742(_0x2724db[_0x9d4f('0x17')][_0x9d4f('0x19')]);}else{logger[_0x9d4f('0x13')]('CmList,\x20%s,\x20%s',_0x181e98,_0x9d4f('0x14'));_0x5b8742(_0x2724db['result']['message']);}})[_0x9d4f('0x1a')](function(_0x629a65){logger[_0x9d4f('0x17')](_0x9d4f('0x18'),_0x181e98,_0x629a65);_0x48a75f(_0x629a65);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 0fa47c2..5a74253 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 _0x3bae=['update','removeListener','length','./cmList.events','save'];(function(_0x2cc3c1,_0x21d7b6){var _0x3ae7b2=function(_0x533ee6){while(--_0x533ee6){_0x2cc3c1['push'](_0x2cc3c1['shift']());}};_0x3ae7b2(++_0x21d7b6);}(_0x3bae,0x13e));var _0xe3ba=function(_0x24aacf,_0x406a66){_0x24aacf=_0x24aacf-0x0;var _0x32cb33=_0x3bae[_0x24aacf];return _0x32cb33;};'use strict';var CmListEvents=require(_0xe3ba('0x0'));var events=[_0xe3ba('0x1'),'remove',_0xe3ba('0x2')];function createListener(_0x105628,_0x599ab){return function(_0x237bd1){_0x599ab['emit'](_0x105628,_0x237bd1);};}function removeListener(_0x5da55d,_0x101453){return function(){CmListEvents[_0xe3ba('0x3')](_0x5da55d,_0x101453);};}exports['register']=function(_0x20f7d7){for(var _0x2a5bd1=0x0,_0x5ea5a0=events[_0xe3ba('0x4')];_0x2a5bd1<_0x5ea5a0;_0x2a5bd1++){var _0x4e7f7e=events[_0x2a5bd1];var _0x2ce2a1=createListener('cmList:'+_0x4e7f7e,_0x20f7d7);CmListEvents['on'](_0x4e7f7e,_0x2ce2a1);}}; \ No newline at end of file +var _0xe1e2=['register','length','cmList:','save','remove','update','emit','removeListener'];(function(_0x13dda9,_0x3e59ca){var _0xf329c8=function(_0x1498a1){while(--_0x1498a1){_0x13dda9['push'](_0x13dda9['shift']());}};_0xf329c8(++_0x3e59ca);}(_0xe1e2,0x1e3));var _0x2e1e=function(_0x44b5d9,_0xe28bb1){_0x44b5d9=_0x44b5d9-0x0;var _0x25d599=_0xe1e2[_0x44b5d9];return _0x25d599;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x2e1e('0x0'),_0x2e1e('0x1'),_0x2e1e('0x2')];function createListener(_0x284452,_0x990988){return function(_0x5c3182){_0x990988[_0x2e1e('0x3')](_0x284452,_0x5c3182);};}function removeListener(_0x3f73b2,_0x2c3bf8){return function(){CmListEvents[_0x2e1e('0x4')](_0x3f73b2,_0x2c3bf8);};}exports[_0x2e1e('0x5')]=function(_0x18233c){for(var _0x2c3249=0x0,_0x313b5c=events[_0x2e1e('0x6')];_0x2c3249<_0x313b5c;_0x2c3249++){var _0x2dd424=events[_0x2c3249];var _0x57c227=createListener(_0x2e1e('0x7')+_0x2dd424,_0x18233c);CmListEvents['on'](_0x2dd424,_0x57c227);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index f50a75e..535ef57 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 _0x1f10=['multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','update','delete','destroy','removeDispositions'];(function(_0x223858,_0x9e9379){var _0x44e6b3=function(_0x1b98df){while(--_0x1b98df){_0x223858['push'](_0x223858['shift']());}};_0x44e6b3(++_0x9e9379);}(_0x1f10,0x69));var _0x01f1=function(_0x34aead,_0x436eba){_0x34aead=_0x34aead-0x0;var _0x5ab3ef=_0x1f10[_0x34aead];return _0x5ab3ef;};'use strict';var multer=require(_0x01f1('0x0'));var util=require(_0x01f1('0x1'));var path=require('path');var timeout=require(_0x01f1('0x2'));var express=require(_0x01f1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x01f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x01f1('0x5'));var controller=require(_0x01f1('0x6'));router[_0x01f1('0x7')]('/',auth['isAuthenticated'](),controller[_0x01f1('0x8')]);router[_0x01f1('0x7')](_0x01f1('0x9'),auth[_0x01f1('0xa')](),controller[_0x01f1('0xb')]);router[_0x01f1('0x7')](_0x01f1('0xc'),auth[_0x01f1('0xa')](),controller['getGlobalCustomFields']);router[_0x01f1('0x7')](_0x01f1('0xd'),auth[_0x01f1('0xa')](),controller[_0x01f1('0xe')]);router[_0x01f1('0x7')]('/:id/dispositions',auth[_0x01f1('0xa')](),controller[_0x01f1('0xf')]);router[_0x01f1('0x7')](_0x01f1('0x10'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x11')]);router[_0x01f1('0x7')](_0x01f1('0x12'),auth['isAuthenticated'](),controller[_0x01f1('0x13')]);router[_0x01f1('0x7')](_0x01f1('0x14'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x15')]);router['get'](_0x01f1('0x16'),auth['isAuthenticated'](),controller[_0x01f1('0x17')]);router[_0x01f1('0x18')]('/',auth[_0x01f1('0xa')](),controller[_0x01f1('0x19')]);router[_0x01f1('0x18')](_0x01f1('0x1a'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1b')]);router[_0x01f1('0x18')](_0x01f1('0x10'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1c')]);router[_0x01f1('0x18')](_0x01f1('0x14'),auth['isAuthenticated'](),controller[_0x01f1('0x1d')]);router[_0x01f1('0x18')](_0x01f1('0x16'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1e')]);router['put'](_0x01f1('0xd'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1f')]);router[_0x01f1('0x20')](_0x01f1('0xd'),auth['isAuthenticated'](),controller[_0x01f1('0x21')]);router[_0x01f1('0x20')](_0x01f1('0x1a'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x22')]);router[_0x01f1('0x20')](_0x01f1('0x16'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xaae2=['isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','getContacts','getContactsCsv','/:id/fields','getAgents','post','addContacts','addCustomField','/:id/users','addAgents','delete','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get'];(function(_0x29b564,_0x2d95bd){var _0xae0676=function(_0x4eedb8){while(--_0x4eedb8){_0x29b564['push'](_0x29b564['shift']());}};_0xae0676(++_0x2d95bd);}(_0xaae2,0x1a8));var _0x2aae=function(_0xef1d7e,_0x77b09){_0xef1d7e=_0xef1d7e-0x0;var _0x410daa=_0xaae2[_0xef1d7e];return _0x410daa;};'use strict';var multer=require(_0x2aae('0x0'));var util=require(_0x2aae('0x1'));var path=require(_0x2aae('0x2'));var timeout=require('connect-timeout');var express=require(_0x2aae('0x3'));var router=express[_0x2aae('0x4')]();var fs_extra=require(_0x2aae('0x5'));var auth=require(_0x2aae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2aae('0x7'));var controller=require(_0x2aae('0x8'));router[_0x2aae('0x9')]('/',auth[_0x2aae('0xa')](),controller['index']);router['get'](_0x2aae('0xb'),auth['isAuthenticated'](),controller[_0x2aae('0xc')]);router[_0x2aae('0x9')](_0x2aae('0xd'),auth[_0x2aae('0xa')](),controller[_0x2aae('0xe')]);router['get'](_0x2aae('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2aae('0x9')](_0x2aae('0x10'),auth[_0x2aae('0xa')](),controller[_0x2aae('0x11')]);router[_0x2aae('0x9')]('/:id/contacts',auth[_0x2aae('0xa')](),controller[_0x2aae('0x12')]);router[_0x2aae('0x9')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x2aae('0x13')]);router['get'](_0x2aae('0x14'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x2aae('0x9')]('/:id/users',auth[_0x2aae('0xa')](),controller[_0x2aae('0x15')]);router[_0x2aae('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2aae('0x16')](_0x2aae('0x10'),auth[_0x2aae('0xa')](),controller['addDisposition']);router[_0x2aae('0x16')]('/:id/contacts',auth[_0x2aae('0xa')](),controller[_0x2aae('0x17')]);router['post'](_0x2aae('0x14'),auth[_0x2aae('0xa')](),controller[_0x2aae('0x18')]);router['post'](_0x2aae('0x19'),auth['isAuthenticated'](),controller[_0x2aae('0x1a')]);router['put'](_0x2aae('0xf'),auth[_0x2aae('0xa')](),controller['update']);router[_0x2aae('0x1b')](_0x2aae('0xf'),auth[_0x2aae('0xa')](),controller[_0x2aae('0x1c')]);router['delete'](_0x2aae('0x10'),auth[_0x2aae('0xa')](),controller['removeDispositions']);router[_0x2aae('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0x2aae('0x1d')]);module[_0x2aae('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 4a8f9cd..0affd2e 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 _0xd4c0=['getDataValue','field','STRING','sequelize','exports','VIRTUAL'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0xd4c0,0x177));var _0x0d4c=function(_0x1f2118,_0x157f27){_0x1f2118=_0x1f2118-0x0;var _0x518d0b=_0xd4c0[_0x1f2118];return _0x518d0b;};'use strict';var Sequelize=require(_0x0d4c('0x0'));module[_0x0d4c('0x1')]={'name':{'type':Sequelize[_0x0d4c('0x2')],'get':function(_0x37e1b4){return this[_0x0d4c('0x3')](_0x0d4c('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0d4c('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x0d4c('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0xb0db=['field','STRING','exports'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0xb0db,0x16a));var _0xbb0d=function(_0x55c8da,_0xea991c){_0x55c8da=_0x55c8da-0x0;var _0x1d562d=_0xb0db[_0x55c8da];return _0x1d562d;};'use strict';var Sequelize=require('sequelize');module[_0xbb0d('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x32de95){return this['getDataValue'](_0xbb0d('0x1'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xbb0d('0x2')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 4f24e21..9f817e9 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(_0x3c0b6e,_0x4f6e62){var _0x2816b4=function(_0x572b65){while(--_0x572b65){_0x3c0b6e['push'](_0x3c0b6e['shift']());}};_0x2816b4(++_0x4f6e62);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2e6ac8,_0x216085){var _0x4e55c3=function(_0x888530){while(--_0x888530){_0x2e6ac8['push'](_0x2e6ac8['shift']());}};_0x4e55c3(++_0x216085);}(_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){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 7377826..93a508d 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 _0x251e=['../../config/logger','moment','request-promise','rimraf','./condition.attributes','define','Condition','tools_conditions','lodash','util'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x251e,0xe4));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe251('0x0'));var util=require(_0xe251('0x1'));var logger=require(_0xe251('0x2'))('api');var moment=require(_0xe251('0x3'));var BPromise=require('bluebird');var rp=require(_0xe251('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe251('0x5'));var config=require('../../config/environment');var attributes=require(_0xe251('0x6'));module['exports']=function(_0x504319,_0x2e45a0){return _0x504319[_0xe251('0x7')](_0xe251('0x8'),attributes,{'tableName':_0xe251('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2596=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./condition.attributes','exports','Condition','tools_conditions'];(function(_0x18159f,_0x511689){var _0x403adf=function(_0x1e7db3){while(--_0x1e7db3){_0x18159f['push'](_0x18159f['shift']());}};_0x403adf(++_0x511689);}(_0x2596,0x8f));var _0x6259=function(_0x3773c4,_0x41942f){_0x3773c4=_0x3773c4-0x0;var _0x17f7a7=_0x2596[_0x3773c4];return _0x17f7a7;};'use strict';var _=require(_0x6259('0x0'));var util=require(_0x6259('0x1'));var logger=require(_0x6259('0x2'))(_0x6259('0x3'));var moment=require('moment');var BPromise=require(_0x6259('0x4'));var rp=require(_0x6259('0x5'));var fs=require('fs');var path=require(_0x6259('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6259('0x7'));module[_0x6259('0x8')]=function(_0x3b1f6c,_0x1b7f04){return _0x3b1f6c['define'](_0x6259('0x9'),attributes,{'tableName':_0x6259('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index c43575d..bff9815 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 _0x96ef=['ioredis','../../mysqldb','../../config/logger','jayson/promise','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','bluebird'];(function(_0x51723a,_0x355865){var _0x4ee0c1=function(_0x2275ff){while(--_0x2275ff){_0x51723a['push'](_0x51723a['shift']());}};_0x4ee0c1(++_0x355865);}(_0x96ef,0x1f4));var _0xf96e=function(_0x2457f7,_0xc5b9f2){_0x2457f7=_0x2457f7-0x0;var _0x1e550e=_0x96ef[_0x2457f7];return _0x1e550e;};'use strict';var _=require(_0xf96e('0x0'));var util=require(_0xf96e('0x1'));var moment=require(_0xf96e('0x2'));var BPromise=require(_0xf96e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf96e('0x4'));var db=require(_0xf96e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf96e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf96e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ac10f,_0x267e98,_0x441d7e){return new BPromise(function(_0x2b3df8,_0x4eaf1e){return client['request'](_0x1ac10f,_0x441d7e)[_0xf96e('0x8')](function(_0x2813fc){logger['info'](_0xf96e('0x9'),_0x267e98,'request\x20sent');logger[_0xf96e('0xa')](_0xf96e('0xb'),_0x267e98,_0xf96e('0xc'),JSON[_0xf96e('0xd')](_0x2813fc));if(_0x2813fc[_0xf96e('0xe')]){if(_0x2813fc['error']['code']===0x1f4){logger['error'](_0xf96e('0x9'),_0x267e98,_0x2813fc['error']['message']);return _0x4eaf1e(_0x2813fc[_0xf96e('0xe')]['message']);}logger['error'](_0xf96e('0x9'),_0x267e98,_0x2813fc[_0xf96e('0xe')][_0xf96e('0xf')]);return _0x2b3df8(_0x2813fc[_0xf96e('0xe')][_0xf96e('0xf')]);}else{logger[_0xf96e('0x10')](_0xf96e('0x9'),_0x267e98,'request\x20sent');_0x2b3df8(_0x2813fc[_0xf96e('0x11')][_0xf96e('0xf')]);}})['catch'](function(_0x25d2dc){logger[_0xf96e('0xe')](_0xf96e('0x9'),_0x267e98,_0x25d2dc);_0x4eaf1e(_0x25d2dc);});});} \ No newline at end of file +var _0x2b56=['ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x1ecffd,_0x462d92){var _0x28d59e=function(_0x22ec49){while(--_0x22ec49){_0x1ecffd['push'](_0x1ecffd['shift']());}};_0x28d59e(++_0x462d92);}(_0x2b56,0x154));var _0x62b5=function(_0xead15b,_0x25aa0c){_0xead15b=_0xead15b-0x0;var _0x4d2a5a=_0x2b56[_0xead15b];return _0x4d2a5a;};'use strict';var _=require(_0x62b5('0x0'));var util=require(_0x62b5('0x1'));var moment=require(_0x62b5('0x2'));var BPromise=require(_0x62b5('0x3'));var rs=require(_0x62b5('0x4'));var fs=require('fs');var Redis=require(_0x62b5('0x5'));var db=require(_0x62b5('0x6'))['db'];var utils=require(_0x62b5('0x7'));var logger=require('../../config/logger')(_0x62b5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x62b5('0x9')][_0x62b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47c37d,_0x348eb9,_0x347737){return new BPromise(function(_0x1d8d2e,_0x310246){return client[_0x62b5('0xb')](_0x47c37d,_0x347737)[_0x62b5('0xc')](function(_0x5c5aaf){logger[_0x62b5('0xd')](_0x62b5('0xe'),_0x348eb9,_0x62b5('0xf'));logger[_0x62b5('0x10')](_0x62b5('0x11'),_0x348eb9,_0x62b5('0xf'),JSON[_0x62b5('0x12')](_0x5c5aaf));if(_0x5c5aaf['error']){if(_0x5c5aaf[_0x62b5('0x13')][_0x62b5('0x14')]===0x1f4){logger[_0x62b5('0x13')]('Condition,\x20%s,\x20%s',_0x348eb9,_0x5c5aaf[_0x62b5('0x13')]['message']);return _0x310246(_0x5c5aaf[_0x62b5('0x13')][_0x62b5('0x15')]);}logger['error'](_0x62b5('0xe'),_0x348eb9,_0x5c5aaf['error'][_0x62b5('0x15')]);return _0x1d8d2e(_0x5c5aaf[_0x62b5('0x13')][_0x62b5('0x15')]);}else{logger[_0x62b5('0xd')](_0x62b5('0xe'),_0x348eb9,_0x62b5('0xf'));_0x1d8d2e(_0x5c5aaf[_0x62b5('0x16')][_0x62b5('0x15')]);}})['catch'](function(_0x4d7365){logger[_0x62b5('0x13')]('Condition,\x20%s,\x20%s',_0x348eb9,_0x4d7365);_0x310246(_0x4d7365);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 18a2933..461dd60 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 _0x4d7b=['../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x4d7b,0x13d));var _0xb4d7=function(_0x3e14a3,_0x40307a){_0x3e14a3=_0x3e14a3-0x0;var _0x565a84=_0x4d7b[_0x3e14a3];return _0x565a84;};'use strict';var multer=require('multer');var util=require(_0xb4d7('0x0'));var path=require('path');var timeout=require(_0xb4d7('0x1'));var express=require(_0xb4d7('0x2'));var router=express[_0xb4d7('0x3')]();var fs_extra=require(_0xb4d7('0x4'));var auth=require(_0xb4d7('0x5'));var interaction=require(_0xb4d7('0x6'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xb4d7('0x7')](_0xb4d7('0x8'),auth[_0xb4d7('0x9')](),controller[_0xb4d7('0xa')]);router[_0xb4d7('0xb')](_0xb4d7('0x8'),auth['isAuthenticated'](),controller[_0xb4d7('0xc')]);module[_0xb4d7('0xd')]=router; \ No newline at end of file +var _0xe2f7=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','update','/:id'];(function(_0x2264a9,_0xe5e68d){var _0x363381=function(_0x1cb913){while(--_0x1cb913){_0x2264a9['push'](_0x2264a9['shift']());}};_0x363381(++_0xe5e68d);}(_0xe2f7,0x1d5));var _0x7e2f=function(_0x28e8da,_0x13bf65){_0x28e8da=_0x28e8da-0x0;var _0x391e4e=_0xe2f7[_0x28e8da];return _0x391e4e;};'use strict';var multer=require(_0x7e2f('0x0'));var util=require(_0x7e2f('0x1'));var path=require(_0x7e2f('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e2f('0x3'));var router=express[_0x7e2f('0x4')]();var fs_extra=require(_0x7e2f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e2f('0x6'));var config=require(_0x7e2f('0x7'));var controller=require(_0x7e2f('0x8'));router['put']('/:id',auth[_0x7e2f('0x9')](),controller[_0x7e2f('0xa')]);router['delete'](_0x7e2f('0xb'),auth[_0x7e2f('0x9')](),controller['destroy']);module[_0x7e2f('0xc')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 2b380f3..25a0e30 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 _0xbac2=['exports','name','INTEGER','sequelize'];(function(_0x4f4e6f,_0x2c4f17){var _0x3c88ee=function(_0x7c10d1){while(--_0x7c10d1){_0x4f4e6f['push'](_0x4f4e6f['shift']());}};_0x3c88ee(++_0x2c4f17);}(_0xbac2,0x17f));var _0x2bac=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xbac2[_0x381372];return _0x4e959a;};'use strict';var Sequelize=require(_0x2bac('0x0'));module[_0x2bac('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2bac('0x2')},'OrderBy':{'type':Sequelize[_0x2bac('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x99df=['INTEGER','exports'];(function(_0x174036,_0x4a382b){var _0x33771e=function(_0x956b3c){while(--_0x956b3c){_0x174036['push'](_0x174036['shift']());}};_0x33771e(++_0x4a382b);}(_0x99df,0x85));var _0xf99d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x99df[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0xf99d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xf99d('0x1')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 9084390..3f66edf 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 _0x7334=['save','update','then','destroy','get','ContactItemTypes','UserProfileResource','name','send','index','map','ContactItemType','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7334,0x184));var _0x4733=function(_0x472161,_0x5033dd){_0x472161=_0x472161-0x0;var _0x423457=_0x7334[_0x472161];return _0x423457;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];function respondWithStatusCode(_0x461f74,_0x100ecd){_0x100ecd=_0x100ecd||0xcc;return function(_0x1c146c){if(_0x1c146c){return _0x461f74[_0x4733('0x1a')](_0x100ecd);}return _0x461f74['status'](_0x100ecd)[_0x4733('0x1b')]();};}function respondWithResult(_0x543caf,_0x4327f3){_0x4327f3=_0x4327f3||0xc8;return function(_0x1a22e4){if(_0x1a22e4){return _0x543caf[_0x4733('0x1c')](_0x4327f3)[_0x4733('0x1d')](_0x1a22e4);}};}function respondWithFilteredResult(_0x3813df,_0x167016){return function(_0x12f111){if(_0x12f111){var _0x9fff=typeof _0x167016[_0x4733('0x1e')]==='undefined'&&typeof _0x167016[_0x4733('0x1f')]===_0x4733('0x20');var _0x47b129=_0x12f111[_0x4733('0x21')];var _0x1d2fb6=_0x9fff?0x0:_0x167016[_0x4733('0x1e')];var _0x384e0c=_0x9fff?_0x12f111['count']:_0x167016['offset']+_0x167016[_0x4733('0x1f')];var _0x3b730a;if(_0x384e0c>=_0x47b129){_0x384e0c=_0x47b129;_0x3b730a=0xc8;}else{_0x3b730a=0xce;}_0x3813df['status'](_0x3b730a);return _0x3813df[_0x4733('0x22')](_0x4733('0x23'),_0x1d2fb6+'-'+_0x384e0c+'/'+_0x47b129)[_0x4733('0x1d')](_0x12f111);}return null;};}function patchUpdates(_0x7a4e0){return function(_0x493cd3){try{jsonpatch[_0x4733('0x24')](_0x493cd3,_0x7a4e0,!![]);}catch(_0xb45e1){return BPromise['reject'](_0xb45e1);}return _0x493cd3[_0x4733('0x25')]();};}function saveUpdates(_0x18da47,_0x478e34){return function(_0x15a291){if(_0x15a291){return _0x15a291[_0x4733('0x26')](_0x18da47)[_0x4733('0x27')](function(_0x1a0643){return _0x1a0643;});}return null;};}function removeEntity(_0x3a2542,_0x24db74){return function(_0x180049){if(_0x180049){return _0x180049[_0x4733('0x28')]()['then'](function(){var _0x3e6976=_0x180049[_0x4733('0x29')]({'plain':!![]});var _0x7884e5=_0x4733('0x2a');return db[_0x4733('0x2b')][_0x4733('0x28')]({'where':{'type':_0x7884e5,'resourceId':_0x3e6976['id']}})[_0x4733('0x27')](function(){return _0x180049;});})[_0x4733('0x27')](function(){_0x3a2542[_0x4733('0x1c')](0xcc)[_0x4733('0x1b')]();});}};}function handleEntityNotFound(_0x521855,_0x3aeb57){return function(_0x4c91bc){if(!_0x4c91bc){_0x521855['sendStatus'](0x194);}return _0x4c91bc;};}function handleError(_0x24e975,_0x49c516){_0x49c516=_0x49c516||0x1f4;return function(_0xcde4f4){logger['error'](_0xcde4f4['stack']);if(_0xcde4f4['name']){delete _0xcde4f4[_0x4733('0x2c')];}_0x24e975[_0x4733('0x1c')](_0x49c516)[_0x4733('0x2d')](_0xcde4f4);};}exports[_0x4733('0x2e')]=function(_0x4fee4a,_0x538a7c){var _0x50f67e={},_0x2b2757={},_0x56872b={'count':0x0,'rows':[]};var _0x5a4814=_[_0x4733('0x2f')](db[_0x4733('0x30')][_0x4733('0x31')],function(_0x59172a){return{'name':_0x59172a['fieldName'],'type':_0x59172a[_0x4733('0x32')][_0x4733('0x33')]};});_0x2b2757[_0x4733('0x34')]=_[_0x4733('0x2f')](_0x5a4814,_0x4733('0x2c'));_0x2b2757['query']=_[_0x4733('0x35')](_0x4fee4a[_0x4733('0x36')]);_0x2b2757[_0x4733('0x37')]=_[_0x4733('0x38')](_0x2b2757[_0x4733('0x34')],_0x2b2757['query']);_0x50f67e['attributes']=_[_0x4733('0x38')](_0x2b2757[_0x4733('0x34')],qs[_0x4733('0x39')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x39')]));_0x50f67e['attributes']=_0x50f67e[_0x4733('0x3a')][_0x4733('0x3b')]?_0x50f67e[_0x4733('0x3a')]:_0x2b2757['model'];if(!_0x4fee4a[_0x4733('0x36')][_0x4733('0x3c')](_0x4733('0x3d'))){_0x50f67e[_0x4733('0x1f')]=qs[_0x4733('0x1f')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x1f')]);_0x50f67e[_0x4733('0x1e')]=qs['offset'](_0x4fee4a[_0x4733('0x36')]['offset']);}_0x50f67e[_0x4733('0x3e')]=qs[_0x4733('0x3f')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x3f')]);_0x50f67e[_0x4733('0x40')]=qs[_0x4733('0x37')](_[_0x4733('0x41')](_0x4fee4a[_0x4733('0x36')],_0x2b2757['filters']),_0x5a4814);if(_0x4fee4a[_0x4733('0x36')][_0x4733('0x42')]){_0x50f67e['where']=_[_0x4733('0x43')](_0x50f67e[_0x4733('0x40')],{'$or':_['map'](_0x5a4814,function(_0x34aefe){if(_0x34aefe['type']!==_0x4733('0x44')){var _0x4c3073={};_0x4c3073[_0x34aefe[_0x4733('0x2c')]]={'$like':'%'+_0x4fee4a[_0x4733('0x36')]['filter']+'%'};return _0x4c3073;}})});}_0x50f67e=_['merge']({},_0x50f67e,_0x4fee4a[_0x4733('0x45')]);var _0x1d7112={'where':_0x50f67e['where']};return db[_0x4733('0x30')][_0x4733('0x21')](_0x1d7112)[_0x4733('0x27')](function(_0x28ed14){_0x56872b[_0x4733('0x21')]=_0x28ed14;if(_0x4fee4a[_0x4733('0x36')][_0x4733('0x46')]){_0x50f67e[_0x4733('0x47')]=[{'all':!![]}];}return db[_0x4733('0x30')][_0x4733('0x48')](_0x50f67e);})[_0x4733('0x27')](function(_0x1d32df){_0x56872b[_0x4733('0x49')]=_0x1d32df;return _0x56872b;})[_0x4733('0x27')](respondWithFilteredResult(_0x538a7c,_0x50f67e))[_0x4733('0x4a')](handleError(_0x538a7c,null));};exports[_0x4733('0x4b')]=function(_0x297bb1,_0x397088){var _0x50b9cb={'raw':!![],'where':{'id':_0x297bb1[_0x4733('0x4c')]['id']}},_0x1a0c5c={};_0x1a0c5c[_0x4733('0x34')]=_[_0x4733('0x35')](db[_0x4733('0x30')][_0x4733('0x31')]);_0x1a0c5c[_0x4733('0x36')]=_[_0x4733('0x35')](_0x297bb1[_0x4733('0x36')]);_0x1a0c5c[_0x4733('0x37')]=_[_0x4733('0x38')](_0x1a0c5c[_0x4733('0x34')],_0x1a0c5c[_0x4733('0x36')]);_0x50b9cb[_0x4733('0x3a')]=_['intersection'](_0x1a0c5c['model'],qs[_0x4733('0x39')](_0x297bb1[_0x4733('0x36')][_0x4733('0x39')]));_0x50b9cb[_0x4733('0x3a')]=_0x50b9cb[_0x4733('0x3a')][_0x4733('0x3b')]?_0x50b9cb[_0x4733('0x3a')]:_0x1a0c5c[_0x4733('0x34')];if(_0x297bb1[_0x4733('0x36')][_0x4733('0x46')]){_0x50b9cb['include']=[{'all':!![]}];}_0x50b9cb=_['merge']({},_0x50b9cb,_0x297bb1['options']);return db['ContactItemType'][_0x4733('0x4d')](_0x50b9cb)[_0x4733('0x27')](handleEntityNotFound(_0x397088,null))[_0x4733('0x27')](respondWithResult(_0x397088,null))[_0x4733('0x4a')](handleError(_0x397088,null));};exports[_0x4733('0x4e')]=function(_0x45b9cf,_0x1c6abf){return db[_0x4733('0x30')][_0x4733('0x4e')](_0x45b9cf[_0x4733('0x4f')],{})['then'](function(_0x53d70b){var _0x29c93d=_0x45b9cf['user'][_0x4733('0x29')]({'plain':!![]});if(!_0x29c93d)throw new Error(_0x4733('0x50'));if(_0x29c93d[_0x4733('0x51')]==='user'){var _0x3f2a78=_0x53d70b[_0x4733('0x29')]({'plain':!![]});var _0x31ae69=_0x4733('0x2a');return db[_0x4733('0x52')][_0x4733('0x4d')]({'where':{'name':_0x31ae69,'userProfileId':_0x29c93d[_0x4733('0x53')]},'raw':!![]})[_0x4733('0x27')](function(_0x28d428){if(_0x28d428&&_0x28d428['autoAssociation']===0x0){return db[_0x4733('0x2b')][_0x4733('0x4e')]({'name':_0x3f2a78[_0x4733('0x2c')],'resourceId':_0x3f2a78['id'],'type':_0x28d428['name'],'sectionId':_0x28d428['id']},{})[_0x4733('0x27')](function(){return _0x53d70b;});}else{return _0x53d70b;}})[_0x4733('0x4a')](function(_0xafb3f8){logger[_0x4733('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xafb3f8);throw _0xafb3f8;});}return _0x53d70b;})[_0x4733('0x27')](respondWithResult(_0x1c6abf,0xc9))['catch'](handleError(_0x1c6abf,null));};exports[_0x4733('0x26')]=function(_0x3b8165,_0x42405e){if(_0x3b8165[_0x4733('0x4f')]['id']){delete _0x3b8165[_0x4733('0x4f')]['id'];}return db['ContactItemType'][_0x4733('0x4d')]({'where':{'id':_0x3b8165[_0x4733('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42405e,null))['then'](saveUpdates(_0x3b8165[_0x4733('0x4f')],null))[_0x4733('0x27')](respondWithResult(_0x42405e,null))[_0x4733('0x4a')](handleError(_0x42405e,null));};exports[_0x4733('0x28')]=function(_0x422010,_0x972fde){return db[_0x4733('0x30')][_0x4733('0x4d')]({'where':{'id':_0x422010['params']['id']}})['then'](handleEntityNotFound(_0x972fde,null))[_0x4733('0x27')](db['CmContactHasItem'][_0x4733('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x422010[_0x4733('0x4c')]['id']}}))[_0x4733('0x27')](removeEntity(_0x972fde,null))['catch'](handleError(_0x972fde,null));}; \ No newline at end of file +var _0x1c9a=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','name','send','index','map','ContactItemType','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring'];(function(_0x24862a,_0x501fe2){var _0xe21fda=function(_0x4c31e0){while(--_0x4c31e0){_0x24862a['push'](_0x24862a['shift']());}};_0xe21fda(++_0x501fe2);}(_0x1c9a,0x98));var _0xa1c9=function(_0x35043,_0x32a2ee){_0x35043=_0x35043-0x0;var _0xac6001=_0x1c9a[_0x35043];return _0xac6001;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){var _0x380f31=_0x50b16b[_0xa1c9('0x29')]({'plain':!![]});var _0x1c6f37=_0xa1c9('0x2a');return db[_0xa1c9('0x2b')]['destroy']({'where':{'type':_0x1c6f37,'resourceId':_0x380f31['id']}})[_0xa1c9('0x27')](function(){return _0x50b16b;});})[_0xa1c9('0x27')](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x133f80,_0x1e7a97){return function(_0x1ca443){if(!_0x1ca443){_0x133f80['sendStatus'](0x194);}return _0x1ca443;};}function handleError(_0x242a43,_0x2a2e9c){_0x2a2e9c=_0x2a2e9c||0x1f4;return function(_0x594137){logger[_0xa1c9('0x2c')](_0x594137['stack']);if(_0x594137[_0xa1c9('0x2d')]){delete _0x594137[_0xa1c9('0x2d')];}_0x242a43[_0xa1c9('0x1a')](_0x2a2e9c)[_0xa1c9('0x2e')](_0x594137);};}exports[_0xa1c9('0x2f')]=function(_0xe8523b,_0x42fcb2){var _0x58b900={},_0x5648b8={},_0x4d23cd={'count':0x0,'rows':[]};var _0x1c7038=_[_0xa1c9('0x30')](db[_0xa1c9('0x31')][_0xa1c9('0x32')],function(_0x3161b0){return{'name':_0x3161b0['fieldName'],'type':_0x3161b0['type']['key']};});_0x5648b8[_0xa1c9('0x33')]=_[_0xa1c9('0x30')](_0x1c7038,_0xa1c9('0x2d'));_0x5648b8[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xe8523b[_0xa1c9('0x34')]);_0x5648b8[_0xa1c9('0x36')]=_['intersection'](_0x5648b8[_0xa1c9('0x33')],_0x5648b8['query']);_0x58b900[_0xa1c9('0x37')]=_['intersection'](_0x5648b8[_0xa1c9('0x33')],qs[_0xa1c9('0x38')](_0xe8523b[_0xa1c9('0x34')]['fields']));_0x58b900[_0xa1c9('0x37')]=_0x58b900[_0xa1c9('0x37')][_0xa1c9('0x39')]?_0x58b900[_0xa1c9('0x37')]:_0x5648b8['model'];if(!_0xe8523b['query'][_0xa1c9('0x3a')](_0xa1c9('0x3b'))){_0x58b900[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x1f')]);_0x58b900[_0xa1c9('0x1d')]=qs[_0xa1c9('0x1d')](_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x1d')]);}_0x58b900['order']=qs[_0xa1c9('0x3c')](_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x3c')]);_0x58b900[_0xa1c9('0x3d')]=qs[_0xa1c9('0x36')](_[_0xa1c9('0x3e')](_0xe8523b['query'],_0x5648b8[_0xa1c9('0x36')]),_0x1c7038);if(_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x3f')]){_0x58b900['where']=_[_0xa1c9('0x40')](_0x58b900[_0xa1c9('0x3d')],{'$or':_['map'](_0x1c7038,function(_0x58d877){if(_0x58d877[_0xa1c9('0x41')]!=='VIRTUAL'){var _0x4dc34a={};_0x4dc34a[_0x58d877[_0xa1c9('0x2d')]]={'$like':'%'+_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x3f')]+'%'};return _0x4dc34a;}})});}_0x58b900=_[_0xa1c9('0x40')]({},_0x58b900,_0xe8523b[_0xa1c9('0x42')]);var _0x1af387={'where':_0x58b900[_0xa1c9('0x3d')]};return db[_0xa1c9('0x31')][_0xa1c9('0x20')](_0x1af387)[_0xa1c9('0x27')](function(_0x5ac71f){_0x4d23cd['count']=_0x5ac71f;if(_0xe8523b[_0xa1c9('0x34')][_0xa1c9('0x43')]){_0x58b900['include']=[{'all':!![]}];}return db[_0xa1c9('0x31')][_0xa1c9('0x44')](_0x58b900);})[_0xa1c9('0x27')](function(_0x36c846){_0x4d23cd[_0xa1c9('0x45')]=_0x36c846;return _0x4d23cd;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x42fcb2,_0x58b900))[_0xa1c9('0x46')](handleError(_0x42fcb2,null));};exports[_0xa1c9('0x47')]=function(_0x1a32ff,_0x2b0599){var _0xece03c={'raw':!![],'where':{'id':_0x1a32ff[_0xa1c9('0x48')]['id']}},_0x50cc27={};_0x50cc27['model']=_[_0xa1c9('0x35')](db['ContactItemType'][_0xa1c9('0x32')]);_0x50cc27['query']=_[_0xa1c9('0x35')](_0x1a32ff[_0xa1c9('0x34')]);_0x50cc27['filters']=_[_0xa1c9('0x49')](_0x50cc27[_0xa1c9('0x33')],_0x50cc27['query']);_0xece03c[_0xa1c9('0x37')]=_[_0xa1c9('0x49')](_0x50cc27[_0xa1c9('0x33')],qs[_0xa1c9('0x38')](_0x1a32ff[_0xa1c9('0x34')][_0xa1c9('0x38')]));_0xece03c['attributes']=_0xece03c[_0xa1c9('0x37')][_0xa1c9('0x39')]?_0xece03c[_0xa1c9('0x37')]:_0x50cc27[_0xa1c9('0x33')];if(_0x1a32ff[_0xa1c9('0x34')]['includeAll']){_0xece03c['include']=[{'all':!![]}];}_0xece03c=_['merge']({},_0xece03c,_0x1a32ff[_0xa1c9('0x42')]);return db[_0xa1c9('0x31')][_0xa1c9('0x4a')](_0xece03c)['then'](handleEntityNotFound(_0x2b0599,null))[_0xa1c9('0x27')](respondWithResult(_0x2b0599,null))[_0xa1c9('0x46')](handleError(_0x2b0599,null));};exports['create']=function(_0x43ee79,_0x4bdf5d){return db['ContactItemType'][_0xa1c9('0x4b')](_0x43ee79[_0xa1c9('0x4c')],{})[_0xa1c9('0x27')](function(_0x3b9a30){var _0x3439fb=_0x43ee79[_0xa1c9('0x4d')][_0xa1c9('0x29')]({'plain':!![]});if(!_0x3439fb)throw new Error(_0xa1c9('0x4e'));if(_0x3439fb[_0xa1c9('0x4f')]===_0xa1c9('0x4d')){var _0x2b2065=_0x3b9a30[_0xa1c9('0x29')]({'plain':!![]});var _0x2cd053=_0xa1c9('0x2a');return db[_0xa1c9('0x50')][_0xa1c9('0x4a')]({'where':{'name':_0x2cd053,'userProfileId':_0x3439fb[_0xa1c9('0x51')]},'raw':!![]})[_0xa1c9('0x27')](function(_0x3803f8){if(_0x3803f8&&_0x3803f8['autoAssociation']===0x0){return db['UserProfileResource'][_0xa1c9('0x4b')]({'name':_0x2b2065[_0xa1c9('0x2d')],'resourceId':_0x2b2065['id'],'type':_0x3803f8[_0xa1c9('0x2d')],'sectionId':_0x3803f8['id']},{})[_0xa1c9('0x27')](function(){return _0x3b9a30;});}else{return _0x3b9a30;}})['catch'](function(_0x449e85){logger[_0xa1c9('0x2c')](_0xa1c9('0x52'),_0x449e85);throw _0x449e85;});}return _0x3b9a30;})['then'](respondWithResult(_0x4bdf5d,0xc9))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x26')]=function(_0x480326,_0x53d4e8){if(_0x480326[_0xa1c9('0x4c')]['id']){delete _0x480326['body']['id'];}return db[_0xa1c9('0x31')][_0xa1c9('0x4a')]({'where':{'id':_0x480326[_0xa1c9('0x48')]['id']}})['then'](handleEntityNotFound(_0x53d4e8,null))['then'](saveUpdates(_0x480326[_0xa1c9('0x4c')],null))['then'](respondWithResult(_0x53d4e8,null))[_0xa1c9('0x46')](handleError(_0x53d4e8,null));};exports['destroy']=function(_0x3334ad,_0x37fcce){return db[_0xa1c9('0x31')][_0xa1c9('0x4a')]({'where':{'id':_0x3334ad[_0xa1c9('0x48')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x37fcce,null))[_0xa1c9('0x27')](db['CmContactHasItem'][_0xa1c9('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3334ad[_0xa1c9('0x48')]['id']}}))['then'](removeEntity(_0x37fcce,null))['catch'](handleError(_0x37fcce,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index fb67ca7..5a048d3 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 _0xd2e3=['exports','tools_contact_item_types','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x592212,_0x1d87ad){var _0xc18254=function(_0x368716){while(--_0x368716){_0x592212['push'](_0x592212['shift']());}};_0xc18254(++_0x1d87ad);}(_0xd2e3,0x10a));var _0x3d2e=function(_0x53a73f,_0x5907c4){_0x53a73f=_0x53a73f-0x0;var _0x1ab16e=_0xd2e3[_0x53a73f];return _0x1ab16e;};'use strict';var _=require(_0x3d2e('0x0'));var util=require(_0x3d2e('0x1'));var logger=require(_0x3d2e('0x2'))(_0x3d2e('0x3'));var moment=require('moment');var BPromise=require(_0x3d2e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d2e('0x5'));var rimraf=require(_0x3d2e('0x6'));var config=require(_0x3d2e('0x7'));var attributes=require(_0x3d2e('0x8'));module[_0x3d2e('0x9')]=function(_0x1d74f9,_0x10ec04){return _0x1d74f9['define']('ContactItemType',attributes,{'tableName':_0x3d2e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x498d=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./contactItemType.attributes','define','tools_contact_item_types','lodash'];(function(_0x3c4659,_0x51d29a){var _0x4db899=function(_0x46b4ef){while(--_0x46b4ef){_0x3c4659['push'](_0x3c4659['shift']());}};_0x4db899(++_0x51d29a);}(_0x498d,0xba));var _0xd498=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x498d[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd498('0x0'));var util=require('util');var logger=require(_0xd498('0x1'))(_0xd498('0x2'));var moment=require(_0xd498('0x3'));var BPromise=require(_0xd498('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd498('0x5'));var rimraf=require(_0xd498('0x6'));var config=require(_0xd498('0x7'));var attributes=require(_0xd498('0x8'));module['exports']=function(_0x5a1c42,_0x5baf75){return _0x5a1c42[_0xd498('0x9')]('ContactItemType',attributes,{'tableName':_0xd498('0xa'),'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 cd093e8..14f3a8b 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 _0x3f72=['request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x3f72,0xaf));var _0x23f7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3f72[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('ContactItemType,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});} \ No newline at end of file +var _0xa047=['rpc','../../config/environment','jayson/promise','http','then','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x421471,_0x2ce8f5){var _0x34b09e=function(_0x276600){while(--_0x276600){_0x421471['push'](_0x421471['shift']());}};_0x34b09e(++_0x2ce8f5);}(_0xa047,0x1c5));var _0x7a04=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xa047[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x7a04('0x0'));var util=require(_0x7a04('0x1'));var moment=require(_0x7a04('0x2'));var BPromise=require(_0x7a04('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a04('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a04('0x5'));var logger=require(_0x7a04('0x6'))(_0x7a04('0x7'));var config=require(_0x7a04('0x8'));var jayson=require(_0x7a04('0x9'));var client=jayson['client'][_0x7a04('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3166ff,_0x1dc89f,_0x5c183c){return new BPromise(function(_0x10d92f,_0x10faf9){return client['request'](_0x3166ff,_0x5c183c)[_0x7a04('0xb')](function(_0xc64317){logger['info'](_0x7a04('0xc'),_0x1dc89f,'request\x20sent');logger['debug'](_0x7a04('0xd'),_0x1dc89f,_0x7a04('0xe'),JSON['stringify'](_0xc64317));if(_0xc64317['error']){if(_0xc64317['error'][_0x7a04('0xf')]===0x1f4){logger[_0x7a04('0x10')](_0x7a04('0xc'),_0x1dc89f,_0xc64317[_0x7a04('0x10')][_0x7a04('0x11')]);return _0x10faf9(_0xc64317[_0x7a04('0x10')][_0x7a04('0x11')]);}logger[_0x7a04('0x10')](_0x7a04('0xc'),_0x1dc89f,_0xc64317['error'][_0x7a04('0x11')]);return _0x10d92f(_0xc64317[_0x7a04('0x10')][_0x7a04('0x11')]);}else{logger[_0x7a04('0x12')](_0x7a04('0xc'),_0x1dc89f,_0x7a04('0xe'));_0x10d92f(_0xc64317['result'][_0x7a04('0x11')]);}})[_0x7a04('0x13')](function(_0x400468){logger['error']('ContactItemType,\x20%s,\x20%s',_0x1dc89f,_0x400468);_0x10faf9(_0x400468);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 9c773c1..0caad3b 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 _0x14cb=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','create','/:id','update'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x14cb,0x1b8));var _0xb14c=function(_0x1808bd,_0x371bce){_0x1808bd=_0x1808bd-0x0;var _0x260b97=_0x14cb[_0x1808bd];return _0x260b97;};'use strict';var multer=require(_0xb14c('0x0'));var util=require('util');var path=require(_0xb14c('0x1'));var timeout=require(_0xb14c('0x2'));var express=require(_0xb14c('0x3'));var router=express[_0xb14c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb14c('0x5'));var interaction=require(_0xb14c('0x6'));var config=require(_0xb14c('0x7'));var controller=require(_0xb14c('0x8'));router[_0xb14c('0x9')]('/',auth[_0xb14c('0xa')](),controller['index']);router[_0xb14c('0x9')]('/:id',auth[_0xb14c('0xa')](),controller[_0xb14c('0xb')]);router[_0xb14c('0xc')]('/',auth[_0xb14c('0xa')](),controller[_0xb14c('0xd')]);router['put'](_0xb14c('0xe'),auth[_0xb14c('0xa')](),controller[_0xb14c('0xf')]);router[_0xb14c('0x10')]('/:id',auth[_0xb14c('0xa')](),controller[_0xb14c('0x11')]);module[_0xb14c('0x12')]=router; \ No newline at end of file +var _0xafe9=['fs-extra','../../config/environment','./contactItemType.controller','get','index','isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x29f0f0,_0x13114b){var _0x4fac5a=function(_0x1e98c5){while(--_0x1e98c5){_0x29f0f0['push'](_0x29f0f0['shift']());}};_0x4fac5a(++_0x13114b);}(_0xafe9,0x84));var _0x9afe=function(_0x1794aa,_0x4900e1){_0x1794aa=_0x1794aa-0x0;var _0x483106=_0xafe9[_0x1794aa];return _0x483106;};'use strict';var multer=require(_0x9afe('0x0'));var util=require(_0x9afe('0x1'));var path=require('path');var timeout=require(_0x9afe('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9afe('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9afe('0x4'));var controller=require(_0x9afe('0x5'));router[_0x9afe('0x6')]('/',auth['isAuthenticated'](),controller[_0x9afe('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9afe('0x8')](),controller[_0x9afe('0x9')]);router[_0x9afe('0xa')](_0x9afe('0xb'),auth[_0x9afe('0x8')](),controller['update']);router[_0x9afe('0xc')](_0x9afe('0xb'),auth[_0x9afe('0x8')](),controller[_0x9afe('0xd')]);module[_0x9afe('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 05bbce8..800fb6a 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(_0x104b97,_0x2db793){var _0x33a962=function(_0x10969c){while(--_0x10969c){_0x104b97['push'](_0x104b97['shift']());}};_0x33a962(++_0x2db793);}(_0x757a,0xde));var _0xa757=function(_0x28e326,_0x12d04c){_0x28e326=_0x28e326-0x0;var _0x4eb9f1=_0x757a[_0x28e326];return _0x4eb9f1;};'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 _0xb7e7=['STRING','sequelize'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 445e657..3e0b7f3 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 _0x29fa=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','index','map','Dashboard','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrs','https://','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrOpenchannelAccounts','web-report','attrReport','reportType','stringify','DashboardId','DashboardItem','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x31e5e7,_0x50a4c2){var _0x2fd580=function(_0x40a580){while(--_0x40a580){_0x31e5e7['push'](_0x31e5e7['shift']());}};_0x2fd580(++_0x50a4c2);}(_0x29fa,0x70));var _0xa29f=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x29fa[_0x189305];return _0xea3406;};'use strict';var emlformat=require(_0xa29f('0x0'));var rimraf=require(_0xa29f('0x1'));var zipdir=require(_0xa29f('0x2'));var jsonpatch=require(_0xa29f('0x3'));var rp=require('request-promise');var moment=require(_0xa29f('0x4'));var BPromise=require(_0xa29f('0x5'));var Mustache=require(_0xa29f('0x6'));var util=require('util');var path=require(_0xa29f('0x7'));var sox=require(_0xa29f('0x8'));var csv=require(_0xa29f('0x9'));var ejs=require(_0xa29f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa29f('0xb'));var squel=require(_0xa29f('0xc'));var crypto=require(_0xa29f('0xd'));var jsforce=require(_0xa29f('0xe'));var deskjs=require(_0xa29f('0xf'));var toCsv=require(_0xa29f('0x9'));var querystring=require(_0xa29f('0x10'));var Papa=require(_0xa29f('0x11'));var Redis=require(_0xa29f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa29f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa29f('0x14'))(_0xa29f('0x15'));var utils=require(_0xa29f('0x16'));var config=require(_0xa29f('0x17'));var licenseUtil=require(_0xa29f('0x18'));var db=require(_0xa29f('0x19'))['db'];config[_0xa29f('0x1a')]=_[_0xa29f('0x1b')](config[_0xa29f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa29f('0x1c'))(new Redis(config['redis']));require(_0xa29f('0x1d'))['register'](socket);function respondWithStatusCode(_0x1a856a,_0x463308){_0x463308=_0x463308||0xcc;return function(_0x4b148c){if(_0x4b148c){return _0x1a856a[_0xa29f('0x1e')](_0x463308);}return _0x1a856a['status'](_0x463308)['end']();};}function respondWithResult(_0x13cc5e,_0x49090e){_0x49090e=_0x49090e||0xc8;return function(_0x312c85){if(_0x312c85){return _0x13cc5e['status'](_0x49090e)['json'](_0x312c85);}};}function respondWithFilteredResult(_0x1d1419,_0x4ded5d){return function(_0x39dad5){if(_0x39dad5){var _0x396d76=typeof _0x4ded5d[_0xa29f('0x1f')]===_0xa29f('0x20')&&typeof _0x4ded5d[_0xa29f('0x21')]===_0xa29f('0x20');var _0x4d026f=_0x39dad5[_0xa29f('0x22')];var _0x47d351=_0x396d76?0x0:_0x4ded5d[_0xa29f('0x1f')];var _0x56aab6=_0x396d76?_0x39dad5[_0xa29f('0x22')]:_0x4ded5d[_0xa29f('0x1f')]+_0x4ded5d[_0xa29f('0x21')];var _0x25fb27;if(_0x56aab6>=_0x4d026f){_0x56aab6=_0x4d026f;_0x25fb27=0xc8;}else{_0x25fb27=0xce;}_0x1d1419[_0xa29f('0x23')](_0x25fb27);return _0x1d1419[_0xa29f('0x24')](_0xa29f('0x25'),_0x47d351+'-'+_0x56aab6+'/'+_0x4d026f)[_0xa29f('0x26')](_0x39dad5);}return null;};}function patchUpdates(_0x119d08){return function(_0x1503c4){try{jsonpatch[_0xa29f('0x27')](_0x1503c4,_0x119d08,!![]);}catch(_0x5c9753){return BPromise[_0xa29f('0x28')](_0x5c9753);}return _0x1503c4[_0xa29f('0x29')]();};}function saveUpdates(_0x3c0825,_0x3a847b){return function(_0x3de9c1){if(_0x3de9c1){return _0x3de9c1[_0xa29f('0x2a')](_0x3c0825)[_0xa29f('0x2b')](function(_0x1e49f4){return _0x1e49f4;});}return null;};}function removeEntity(_0xa5e6a8,_0x29c97d){return function(_0x2e89f9){if(_0x2e89f9){return _0x2e89f9[_0xa29f('0x2c')]()['then'](function(){var _0xf46ce0=_0x2e89f9[_0xa29f('0x2d')]({'plain':!![]});var _0x5edcaf='CustomDashboards';return db[_0xa29f('0x2e')]['destroy']({'where':{'type':_0x5edcaf,'resourceId':_0xf46ce0['id']}})[_0xa29f('0x2b')](function(){return _0x2e89f9;});})[_0xa29f('0x2b')](function(){_0xa5e6a8[_0xa29f('0x23')](0xcc)[_0xa29f('0x2f')]();});}};}function handleEntityNotFound(_0x22b784,_0x5f61d6){return function(_0xcb5c80){if(!_0xcb5c80){_0x22b784[_0xa29f('0x1e')](0x194);}return _0xcb5c80;};}function handleError(_0x92833f,_0x346ab9){_0x346ab9=_0x346ab9||0x1f4;return function(_0x7b3fa4){logger[_0xa29f('0x30')](_0x7b3fa4['stack']);if(_0x7b3fa4['name']){delete _0x7b3fa4[_0xa29f('0x31')];}_0x92833f[_0xa29f('0x23')](_0x346ab9)[_0xa29f('0x32')](_0x7b3fa4);};}exports[_0xa29f('0x33')]=function(_0x5b06d7,_0x36f853){var _0x421823={},_0xdf44bd={},_0x463133={'count':0x0,'rows':[]};var _0x56d8ed=_[_0xa29f('0x34')](db[_0xa29f('0x35')][_0xa29f('0x36')],function(_0x498901){return{'name':_0x498901['fieldName'],'type':_0x498901[_0xa29f('0x37')][_0xa29f('0x38')]};});_0xdf44bd[_0xa29f('0x39')]=_[_0xa29f('0x34')](_0x56d8ed,_0xa29f('0x31'));_0xdf44bd['query']=_[_0xa29f('0x3a')](_0x5b06d7[_0xa29f('0x3b')]);_0xdf44bd[_0xa29f('0x3c')]=_[_0xa29f('0x3d')](_0xdf44bd[_0xa29f('0x39')],_0xdf44bd['query']);_0x421823[_0xa29f('0x3e')]=_[_0xa29f('0x3d')](_0xdf44bd['model'],qs['fields'](_0x5b06d7['query'][_0xa29f('0x3f')]));_0x421823[_0xa29f('0x3e')]=_0x421823['attributes'][_0xa29f('0x40')]?_0x421823[_0xa29f('0x3e')]:_0xdf44bd[_0xa29f('0x39')];if(!_0x5b06d7['query']['hasOwnProperty'](_0xa29f('0x41'))){_0x421823[_0xa29f('0x21')]=qs['limit'](_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x21')]);_0x421823[_0xa29f('0x1f')]=qs[_0xa29f('0x1f')](_0x5b06d7[_0xa29f('0x3b')]['offset']);}_0x421823['order']=qs['sort'](_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x42')]);_0x421823[_0xa29f('0x43')]=qs['filters'](_['pick'](_0x5b06d7[_0xa29f('0x3b')],_0xdf44bd[_0xa29f('0x3c')]),_0x56d8ed);if(_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x44')]){_0x421823[_0xa29f('0x43')]=_[_0xa29f('0x45')](_0x421823[_0xa29f('0x43')],{'$or':_[_0xa29f('0x34')](_0x56d8ed,function(_0x58acf6){if(_0x58acf6[_0xa29f('0x37')]!==_0xa29f('0x46')){var _0x276221={};_0x276221[_0x58acf6[_0xa29f('0x31')]]={'$like':'%'+_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x44')]+'%'};return _0x276221;}})});}_0x421823=_[_0xa29f('0x45')]({},_0x421823,_0x5b06d7['options']);var _0x4e9cd6={'where':_0x421823[_0xa29f('0x43')]};return db[_0xa29f('0x35')]['count'](_0x4e9cd6)[_0xa29f('0x2b')](function(_0x5600e7){_0x463133[_0xa29f('0x22')]=_0x5600e7;if(_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x47')]){_0x421823[_0xa29f('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0xa29f('0x49')](_0x421823);})[_0xa29f('0x2b')](function(_0xb950f4){_0x463133['rows']=_0xb950f4;return _0x463133;})[_0xa29f('0x2b')](respondWithFilteredResult(_0x36f853,_0x421823))['catch'](handleError(_0x36f853,null));};exports[_0xa29f('0x4a')]=function(_0xf1a72e,_0x730601){var _0x12cd99={'raw':![],'where':{'id':_0xf1a72e[_0xa29f('0x4b')]['id']}},_0x154052={};_0x154052[_0xa29f('0x39')]=_['keys'](db[_0xa29f('0x35')]['rawAttributes']);_0x154052[_0xa29f('0x3b')]=_['keys'](_0xf1a72e[_0xa29f('0x3b')]);_0x154052['filters']=_[_0xa29f('0x3d')](_0x154052[_0xa29f('0x39')],_0x154052[_0xa29f('0x3b')]);_0x12cd99[_0xa29f('0x3e')]=_['intersection'](_0x154052[_0xa29f('0x39')],qs['fields'](_0xf1a72e['query'][_0xa29f('0x3f')]));_0x12cd99[_0xa29f('0x3e')]=_0x12cd99['attributes']['length']?_0x12cd99[_0xa29f('0x3e')]:_0x154052[_0xa29f('0x39')];if(_0xf1a72e[_0xa29f('0x3b')][_0xa29f('0x47')]){_0x12cd99[_0xa29f('0x48')]=[{'all':!![]}];}_0x12cd99=_[_0xa29f('0x45')]({},_0x12cd99,_0xf1a72e[_0xa29f('0x4c')]);return db[_0xa29f('0x35')]['find'](_0x12cd99)[_0xa29f('0x2b')](handleEntityNotFound(_0x730601,null))[_0xa29f('0x2b')](respondWithResult(_0x730601,null))[_0xa29f('0x4d')](handleError(_0x730601,null));};exports[_0xa29f('0x4e')]=function(_0xc34def,_0x4cf260){return db['Dashboard'][_0xa29f('0x4e')](_0xc34def[_0xa29f('0x4f')],{})[_0xa29f('0x2b')](function(_0x108cca){var _0x22a8d9=_0xc34def[_0xa29f('0x50')]['get']({'plain':!![]});if(!_0x22a8d9)throw new Error(_0xa29f('0x51'));if(_0x22a8d9[_0xa29f('0x52')]===_0xa29f('0x50')){var _0x38c286=_0x108cca['get']({'plain':!![]});var _0x4a6e8e=_0xa29f('0x53');return db[_0xa29f('0x54')]['find']({'where':{'name':_0x4a6e8e,'userProfileId':_0x22a8d9[_0xa29f('0x55')]},'raw':!![]})[_0xa29f('0x2b')](function(_0x5b2766){if(_0x5b2766&&_0x5b2766[_0xa29f('0x56')]===0x0){return db[_0xa29f('0x2e')][_0xa29f('0x4e')]({'name':_0x38c286[_0xa29f('0x31')],'resourceId':_0x38c286['id'],'type':_0x5b2766[_0xa29f('0x31')],'sectionId':_0x5b2766['id']},{})[_0xa29f('0x2b')](function(){return _0x108cca;});}else{return _0x108cca;}})['catch'](function(_0x1f2714){logger[_0xa29f('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f2714);throw _0x1f2714;});}return _0x108cca;})['then'](respondWithResult(_0x4cf260,0xc9))[_0xa29f('0x4d')](handleError(_0x4cf260,null));};exports[_0xa29f('0x57')]=function(_0x458e43,_0x28f71e){var _0x5edcce={'where':{'id':_0x458e43[_0xa29f('0x4b')]['id']}},_0x4db25f={};_0x4db25f[_0xa29f('0x39')]=_[_0xa29f('0x3a')](db[_0xa29f('0x35')]['rawAttributes']);_0x5edcce['attributes']=_[_0xa29f('0x3d')](_0x4db25f['model'],qs[_0xa29f('0x3f')](_0x458e43[_0xa29f('0x3b')]['fields']));_0x5edcce[_0xa29f('0x3e')]=_0x5edcce[_0xa29f('0x3e')][_0xa29f('0x40')]?_0x5edcce[_0xa29f('0x3e')]:_0x4db25f[_0xa29f('0x39')];if(_0x458e43[_0xa29f('0x3b')][_0xa29f('0x47')]){_0x5edcce[_0xa29f('0x48')]=[{'all':!![]}];}_0x5edcce=_['merge']({},_0x5edcce,_0x458e43[_0xa29f('0x4c')]);return db[_0xa29f('0x35')][_0xa29f('0x58')](_0x5edcce)[_0xa29f('0x2b')](handleEntityNotFound(_0x28f71e,null))[_0xa29f('0x2b')](function(_0x29f184){if(_0x29f184){var _0x2f8f35=_0x29f184[_0xa29f('0x2d')]({'plain':!![]});_0x2f8f35=qs[_0xa29f('0x59')](_0x2f8f35,['id',_0xa29f('0x5a'),_0xa29f('0x5b')]);_0x458e43[_0xa29f('0x4f')]=_['omit'](_0x458e43[_0xa29f('0x4f')],['id',_0xa29f('0x5a'),'updatedAt']);return db['Dashboard'][_0xa29f('0x4e')](_[_0xa29f('0x45')](_0x2f8f35,_0x458e43[_0xa29f('0x4f')]),{'include':_0x458e43[_0xa29f('0x3b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x433bae){var _0x3e26c6=_0x458e43[_0xa29f('0x50')][_0xa29f('0x2d')]({'plain':!![]});if(!_0x3e26c6)throw new Error(_0xa29f('0x51'));if(_0x3e26c6['role']===_0xa29f('0x50')){var _0xb665ef=_0x433bae[_0xa29f('0x2d')]({'plain':!![]});var _0x85abdd=_0xa29f('0x53');return db[_0xa29f('0x54')]['find']({'where':{'name':_0x85abdd,'userProfileId':_0x3e26c6[_0xa29f('0x55')]},'raw':!![]})['then'](function(_0x37032f){if(_0x37032f&&_0x37032f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xb665ef['name'],'resourceId':_0xb665ef['id'],'type':_0x37032f[_0xa29f('0x31')],'sectionId':_0x37032f['id']},{})[_0xa29f('0x2b')](function(){return _0x433bae;});}else{return _0x433bae;}})[_0xa29f('0x4d')](function(_0x165cc1){logger[_0xa29f('0x30')](_0xa29f('0x5c'),_0x165cc1);throw _0x165cc1;});}return _0x433bae;});}})['then'](respondWithResult(_0x28f71e,0xc9))['catch'](handleError(_0x28f71e,null));};exports['update']=function(_0x3f8937,_0x72a2e7){if(_0x3f8937[_0xa29f('0x4f')]['id']){delete _0x3f8937[_0xa29f('0x4f')]['id'];}return db[_0xa29f('0x35')][_0xa29f('0x58')]({'where':{'id':_0x3f8937[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x72a2e7,null))[_0xa29f('0x2b')](saveUpdates(_0x3f8937[_0xa29f('0x4f')],null))[_0xa29f('0x2b')](respondWithResult(_0x72a2e7,null))[_0xa29f('0x4d')](handleError(_0x72a2e7,null));};exports['destroy']=function(_0x1099b9,_0x19e0ff){return db[_0xa29f('0x35')][_0xa29f('0x58')]({'where':{'id':_0x1099b9[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x19e0ff,null))[_0xa29f('0x2b')](removeEntity(_0x19e0ff,null))[_0xa29f('0x4d')](handleError(_0x19e0ff,null));};function widgetAttributes(_0x1e8a22){try{switch(_0x1e8a22[_0xa29f('0x37')]){case'iframe':return[{'name':'attrUrl','value':_0x1e8a22['attrUrl']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0]['value']:undefined)||_0xa29f('0x5e')}];case _0xa29f('0x5f'):return[{'name':_0xa29f('0x60'),'value':_0x1e8a22[_0xa29f('0x60')]||(_0x1e8a22['attrs']&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22['attrs'][0x0]['value']:undefined)||''}];case _0xa29f('0x61'):return[{'name':_0xa29f('0x62'),'value':_0x1e8a22[_0xa29f('0x62')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||_0xa29f('0x64')},{'name':_0xa29f('0x65'),'value':_0x1e8a22['attrTimezone']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22[_0xa29f('0x5d')][0x1][_0xa29f('0x63')]:undefined)||_0xa29f('0x66')},{'name':_0xa29f('0x67'),'value':_0x1e8a22[_0xa29f('0x67')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x2]?_0x1e8a22['attrs'][0x2][_0xa29f('0x63')]:undefined)||0xc}];case _0xa29f('0x68'):return[{'name':_0xa29f('0x69'),'value':_0x1e8a22['attrMetric']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||_0xa29f('0x6a')},{'name':_0xa29f('0x6b'),'value':_0x1e8a22[_0xa29f('0x6b')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22['attrs'][0x1][_0xa29f('0x63')]:undefined)||[]},{'name':_0xa29f('0x67'),'value':_0x1e8a22[_0xa29f('0x67')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x2]?_0x1e8a22[_0xa29f('0x5d')][0x2][_0xa29f('0x63')]:undefined)||0x14},{'name':_0xa29f('0x6c'),'value':_0x1e8a22[_0xa29f('0x6c')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x3]?_0x1e8a22[_0xa29f('0x5d')][0x3]['value']:undefined)||_0xa29f('0x6d')},{'name':_0xa29f('0x6e'),'value':_0x1e8a22[_0xa29f('0x6e')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x4]?_0x1e8a22[_0xa29f('0x5d')][0x4][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x6f'),'value':_0x1e8a22[_0xa29f('0x6f')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x5]?_0x1e8a22[_0xa29f('0x5d')][0x5][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x70'),'value':_0x1e8a22['attrSmsAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x6]?_0x1e8a22['attrs'][0x6][_0xa29f('0x63')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1e8a22['attrOpenchannelAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x7]?_0x1e8a22[_0xa29f('0x5d')][0x7][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x71'),'value':_0x1e8a22['attrWhatsappAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x8]?_0x1e8a22[_0xa29f('0x5d')][0x8][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x72'),'value':_0x1e8a22[_0xa29f('0x72')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x9]?_0x1e8a22['attrs'][0x9][_0xa29f('0x63')]:undefined)||''}];case _0xa29f('0x73'):case _0xa29f('0x74'):return[{'name':'attrSerie1','value':_0x1e8a22[_0xa29f('0x75')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||_0xa29f('0x6a')},{'name':'attrSerie2','value':_0x1e8a22['attrSerie2']||(_0x1e8a22['attrs']&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22[_0xa29f('0x5d')][0x1][_0xa29f('0x63')]:undefined)||null},{'name':_0xa29f('0x76'),'value':_0x1e8a22[_0xa29f('0x76')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x2]?_0x1e8a22[_0xa29f('0x5d')][0x2][_0xa29f('0x63')]:undefined)||null},{'name':_0xa29f('0x6b'),'value':_0x1e8a22[_0xa29f('0x6b')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x3]?_0x1e8a22[_0xa29f('0x5d')][0x3][_0xa29f('0x63')]:undefined)||[]},{'name':_0xa29f('0x6c'),'value':_0x1e8a22['attrChannel']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x4]?_0x1e8a22[_0xa29f('0x5d')][0x4][_0xa29f('0x63')]:undefined)||_0xa29f('0x6d')},{'name':_0xa29f('0x6e'),'value':_0x1e8a22[_0xa29f('0x6e')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x5]?_0x1e8a22[_0xa29f('0x5d')][0x5][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x6f'),'value':_0x1e8a22['attrFaxAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x6]?_0x1e8a22[_0xa29f('0x5d')][0x6][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x70'),'value':_0x1e8a22[_0xa29f('0x70')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x7]?_0x1e8a22[_0xa29f('0x5d')][0x7]['value']:undefined)||''},{'name':_0xa29f('0x77'),'value':_0x1e8a22[_0xa29f('0x77')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x8]?_0x1e8a22[_0xa29f('0x5d')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1e8a22[_0xa29f('0x71')]||(_0x1e8a22['attrs']&&_0x1e8a22[_0xa29f('0x5d')][0x9]?_0x1e8a22[_0xa29f('0x5d')][0x9][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x72'),'value':_0x1e8a22[_0xa29f('0x72')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0xa]?_0x1e8a22[_0xa29f('0x5d')][0xa][_0xa29f('0x63')]:undefined)||''}];case _0xa29f('0x78'):return[{'name':_0xa29f('0x79'),'type':_0x1e8a22[_0xa29f('0x7a')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22['attrs'][0x0]['type']:undefined)||null,'value':_0x1e8a22[_0xa29f('0x79')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x1e8a22['attrRefresh']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22[_0xa29f('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x350777){logger['error']('widgetAttributes:\x20%s',JSON[_0xa29f('0x7b')](_0x350777));return[];}}exports['addItem']=function(_0x45922a,_0x13c108,_0x5c834c){if(_0x45922a[_0xa29f('0x4f')]['id']){delete _0x45922a['body']['id'];}return db[_0xa29f('0x35')][_0xa29f('0x58')]({'where':{'id':_0x45922a[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x13c108,null))[_0xa29f('0x2b')](function(_0x45d8af){if(_0x45d8af){_0x45922a['body'][_0xa29f('0x7c')]=_0x45d8af['id'];_0x45922a[_0xa29f('0x4f')][_0xa29f('0x5d')]=widgetAttributes(_0x45922a[_0xa29f('0x4f')]);return db[_0xa29f('0x7d')][_0xa29f('0x4e')](_0x45922a[_0xa29f('0x4f')]);}})['then'](respondWithResult(_0x13c108,null))['catch'](handleError(_0x13c108,null));};exports['getItems']=function(_0x182a52,_0x4f2582,_0x3e180a){var _0x4c435f={};var _0xcdf2ff={};var _0x34fa8d;var _0x5d78dd;return db[_0xa29f('0x35')]['findOne']({'where':{'id':_0x182a52[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x4f2582,null))['then'](function(_0x28ef96){if(_0x28ef96){_0x34fa8d=_0x28ef96;_0xcdf2ff[_0xa29f('0x39')]=_[_0xa29f('0x3a')](db[_0xa29f('0x7d')][_0xa29f('0x36')]);_0xcdf2ff[_0xa29f('0x3b')]=_['keys'](_0x182a52['query']);_0xcdf2ff[_0xa29f('0x3c')]=_[_0xa29f('0x3d')](_0xcdf2ff['model'],_0xcdf2ff[_0xa29f('0x3b')]);_0x4c435f[_0xa29f('0x3e')]=_[_0xa29f('0x3d')](_0xcdf2ff[_0xa29f('0x39')],qs[_0xa29f('0x3f')](_0x182a52[_0xa29f('0x3b')][_0xa29f('0x3f')]));_0x4c435f[_0xa29f('0x3e')]=_0x4c435f[_0xa29f('0x3e')]['length']?_0x4c435f['attributes']:_0xcdf2ff[_0xa29f('0x39')];_0x4c435f['order']=qs[_0xa29f('0x42')](_0x182a52['query']['sort']);_0x4c435f['where']=qs['filters'](_[_0xa29f('0x7e')](_0x182a52[_0xa29f('0x3b')],_0xcdf2ff[_0xa29f('0x3c')]));if(_0x182a52['query'][_0xa29f('0x44')]){_0x4c435f[_0xa29f('0x43')]=_['merge'](_0x4c435f[_0xa29f('0x43')],{'$or':_[_0xa29f('0x34')](_0x4c435f['attributes'],function(_0x2a228f){var _0x1beb20={};_0x1beb20[_0x2a228f]={'$like':'%'+_0x182a52[_0xa29f('0x3b')]['filter']+'%'};return _0x1beb20;})});}_0x4c435f=_[_0xa29f('0x45')]({},_0x4c435f,_0x182a52[_0xa29f('0x4c')]);return _0x34fa8d[_0xa29f('0x7f')](_0x4c435f);}})[_0xa29f('0x2b')](function(_0x489192){if(_0x489192){_0x5d78dd=_0x489192['length'];if(!_0x182a52['query']['hasOwnProperty'](_0xa29f('0x41'))){_0x4c435f['limit']=qs[_0xa29f('0x21')](_0x182a52[_0xa29f('0x3b')][_0xa29f('0x21')]);_0x4c435f[_0xa29f('0x1f')]=qs[_0xa29f('0x1f')](_0x182a52[_0xa29f('0x3b')][_0xa29f('0x1f')]);}return _0x34fa8d[_0xa29f('0x7f')](_0x4c435f);}})['then'](function(_0x1eda11){if(_0x1eda11){return _0x1eda11?{'count':_0x5d78dd,'rows':_0x1eda11}:null;}})[_0xa29f('0x2b')](respondWithResult(_0x4f2582,null))[_0xa29f('0x4d')](handleError(_0x4f2582,null));}; \ No newline at end of file +var _0x1176=['value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrFaxAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','findOne','DashboardItem','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./dashboard.socket','register','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','destroy','then','get','CustomDashboards','UserProfileResource','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','fields','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','params','includeAll','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','iframe','attrUrl','attrs'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1176,0xac));var _0x6117=function(_0x1c4413,_0x365b64){_0x1c4413=_0x1c4413-0x0;var _0x3ce476=_0x1176[_0x1c4413];return _0x3ce476;};'use strict';var emlformat=require(_0x6117('0x0'));var rimraf=require(_0x6117('0x1'));var zipdir=require(_0x6117('0x2'));var jsonpatch=require(_0x6117('0x3'));var rp=require(_0x6117('0x4'));var moment=require(_0x6117('0x5'));var BPromise=require(_0x6117('0x6'));var Mustache=require('mustache');var util=require(_0x6117('0x7'));var path=require(_0x6117('0x8'));var sox=require(_0x6117('0x9'));var csv=require(_0x6117('0xa'));var ejs=require(_0x6117('0xb'));var fs=require('fs');var fs_extra=require(_0x6117('0xc'));var _=require(_0x6117('0xd'));var squel=require(_0x6117('0xe'));var crypto=require(_0x6117('0xf'));var jsforce=require(_0x6117('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6117('0xa'));var querystring=require(_0x6117('0x11'));var Papa=require(_0x6117('0x12'));var Redis=require(_0x6117('0x13'));var authService=require(_0x6117('0x14'));var qs=require(_0x6117('0x15'));var as=require(_0x6117('0x16'));var hardwareService=require(_0x6117('0x17'));var logger=require(_0x6117('0x18'))(_0x6117('0x19'));var utils=require(_0x6117('0x1a'));var config=require(_0x6117('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x6117('0x1c'))['db'];config['redis']=_['defaults'](config[_0x6117('0x1d')],{'host':_0x6117('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6117('0x1d')]));require(_0x6117('0x1f'))[_0x6117('0x20')](socket);function respondWithStatusCode(_0x197f36,_0x4cd902){_0x4cd902=_0x4cd902||0xcc;return function(_0x4f26a2){if(_0x4f26a2){return _0x197f36[_0x6117('0x21')](_0x4cd902);}return _0x197f36['status'](_0x4cd902)[_0x6117('0x22')]();};}function respondWithResult(_0x3743ad,_0x33eac2){_0x33eac2=_0x33eac2||0xc8;return function(_0x5a5c55){if(_0x5a5c55){return _0x3743ad[_0x6117('0x23')](_0x33eac2)[_0x6117('0x24')](_0x5a5c55);}};}function respondWithFilteredResult(_0x221b1b,_0x3c8329){return function(_0x592798){if(_0x592798){var _0x6e41=typeof _0x3c8329['offset']==='undefined'&&typeof _0x3c8329[_0x6117('0x25')]===_0x6117('0x26');var _0x1d980f=_0x592798['count'];var _0x479721=_0x6e41?0x0:_0x3c8329[_0x6117('0x27')];var _0x24985e=_0x6e41?_0x592798[_0x6117('0x28')]:_0x3c8329[_0x6117('0x27')]+_0x3c8329['limit'];var _0xab4e33;if(_0x24985e>=_0x1d980f){_0x24985e=_0x1d980f;_0xab4e33=0xc8;}else{_0xab4e33=0xce;}_0x221b1b[_0x6117('0x23')](_0xab4e33);return _0x221b1b[_0x6117('0x29')](_0x6117('0x2a'),_0x479721+'-'+_0x24985e+'/'+_0x1d980f)[_0x6117('0x24')](_0x592798);}return null;};}function patchUpdates(_0x4f0537){return function(_0x119cd0){try{jsonpatch[_0x6117('0x2b')](_0x119cd0,_0x4f0537,!![]);}catch(_0x32d79b){return BPromise[_0x6117('0x2c')](_0x32d79b);}return _0x119cd0[_0x6117('0x2d')]();};}function saveUpdates(_0x512019,_0x754a37){return function(_0x484ac5){if(_0x484ac5){return _0x484ac5['update'](_0x512019)['then'](function(_0x1d68cd){return _0x1d68cd;});}return null;};}function removeEntity(_0xba4ba7,_0x432d63){return function(_0x177f00){if(_0x177f00){return _0x177f00[_0x6117('0x2e')]()[_0x6117('0x2f')](function(){var _0x5e6cc2=_0x177f00[_0x6117('0x30')]({'plain':!![]});var _0x43873a=_0x6117('0x31');return db[_0x6117('0x32')][_0x6117('0x2e')]({'where':{'type':_0x43873a,'resourceId':_0x5e6cc2['id']}})[_0x6117('0x2f')](function(){return _0x177f00;});})[_0x6117('0x2f')](function(){_0xba4ba7[_0x6117('0x23')](0xcc)[_0x6117('0x22')]();});}};}function handleEntityNotFound(_0x1f8aaa,_0x516220){return function(_0x319a8d){if(!_0x319a8d){_0x1f8aaa[_0x6117('0x21')](0x194);}return _0x319a8d;};}function handleError(_0x292704,_0x4dd04c){_0x4dd04c=_0x4dd04c||0x1f4;return function(_0x36cf76){logger['error'](_0x36cf76[_0x6117('0x33')]);if(_0x36cf76[_0x6117('0x34')]){delete _0x36cf76[_0x6117('0x34')];}_0x292704['status'](_0x4dd04c)[_0x6117('0x35')](_0x36cf76);};}exports['index']=function(_0x5b87aa,_0x269c8e){var _0x353e74={},_0x27ead9={},_0xce23fb={'count':0x0,'rows':[]};var _0x4dc3b2=_[_0x6117('0x36')](db[_0x6117('0x37')][_0x6117('0x38')],function(_0x2de4b7){return{'name':_0x2de4b7[_0x6117('0x39')],'type':_0x2de4b7[_0x6117('0x3a')][_0x6117('0x3b')]};});_0x27ead9['model']=_[_0x6117('0x36')](_0x4dc3b2,_0x6117('0x34'));_0x27ead9[_0x6117('0x3c')]=_[_0x6117('0x3d')](_0x5b87aa[_0x6117('0x3c')]);_0x27ead9['filters']=_[_0x6117('0x3e')](_0x27ead9['model'],_0x27ead9[_0x6117('0x3c')]);_0x353e74[_0x6117('0x3f')]=_[_0x6117('0x3e')](_0x27ead9[_0x6117('0x40')],qs['fields'](_0x5b87aa[_0x6117('0x3c')]['fields']));_0x353e74[_0x6117('0x3f')]=_0x353e74[_0x6117('0x3f')]['length']?_0x353e74[_0x6117('0x3f')]:_0x27ead9[_0x6117('0x40')];if(!_0x5b87aa[_0x6117('0x3c')][_0x6117('0x41')](_0x6117('0x42'))){_0x353e74[_0x6117('0x25')]=qs[_0x6117('0x25')](_0x5b87aa[_0x6117('0x3c')]['limit']);_0x353e74[_0x6117('0x27')]=qs[_0x6117('0x27')](_0x5b87aa['query'][_0x6117('0x27')]);}_0x353e74[_0x6117('0x43')]=qs[_0x6117('0x44')](_0x5b87aa['query'][_0x6117('0x44')]);_0x353e74['where']=qs[_0x6117('0x45')](_['pick'](_0x5b87aa[_0x6117('0x3c')],_0x27ead9['filters']),_0x4dc3b2);if(_0x5b87aa['query'][_0x6117('0x46')]){_0x353e74[_0x6117('0x47')]=_[_0x6117('0x48')](_0x353e74['where'],{'$or':_[_0x6117('0x36')](_0x4dc3b2,function(_0xe35a49){if(_0xe35a49[_0x6117('0x3a')]!==_0x6117('0x49')){var _0x5c0b8a={};_0x5c0b8a[_0xe35a49['name']]={'$like':'%'+_0x5b87aa[_0x6117('0x3c')][_0x6117('0x46')]+'%'};return _0x5c0b8a;}})});}_0x353e74=_[_0x6117('0x48')]({},_0x353e74,_0x5b87aa[_0x6117('0x4a')]);var _0x4339bb={'where':_0x353e74[_0x6117('0x47')]};return db[_0x6117('0x37')]['count'](_0x4339bb)[_0x6117('0x2f')](function(_0x4b4e7f){_0xce23fb[_0x6117('0x28')]=_0x4b4e7f;if(_0x5b87aa['query']['includeAll']){_0x353e74[_0x6117('0x4b')]=[{'all':!![]}];}return db[_0x6117('0x37')][_0x6117('0x4c')](_0x353e74);})[_0x6117('0x2f')](function(_0x57d2b5){_0xce23fb[_0x6117('0x4d')]=_0x57d2b5;return _0xce23fb;})[_0x6117('0x2f')](respondWithFilteredResult(_0x269c8e,_0x353e74))[_0x6117('0x4e')](handleError(_0x269c8e,null));};exports[_0x6117('0x4f')]=function(_0x5ccc5e,_0x4bcd2b){var _0x26fba8={'raw':![],'where':{'id':_0x5ccc5e['params']['id']}},_0x4f51cf={};_0x4f51cf['model']=_[_0x6117('0x3d')](db[_0x6117('0x37')][_0x6117('0x38')]);_0x4f51cf[_0x6117('0x3c')]=_[_0x6117('0x3d')](_0x5ccc5e['query']);_0x4f51cf['filters']=_['intersection'](_0x4f51cf[_0x6117('0x40')],_0x4f51cf['query']);_0x26fba8['attributes']=_[_0x6117('0x3e')](_0x4f51cf[_0x6117('0x40')],qs[_0x6117('0x50')](_0x5ccc5e[_0x6117('0x3c')]['fields']));_0x26fba8[_0x6117('0x3f')]=_0x26fba8[_0x6117('0x3f')][_0x6117('0x51')]?_0x26fba8[_0x6117('0x3f')]:_0x4f51cf[_0x6117('0x40')];if(_0x5ccc5e[_0x6117('0x3c')]['includeAll']){_0x26fba8[_0x6117('0x4b')]=[{'all':!![]}];}_0x26fba8=_['merge']({},_0x26fba8,_0x5ccc5e['options']);return db['Dashboard'][_0x6117('0x52')](_0x26fba8)['then'](handleEntityNotFound(_0x4bcd2b,null))[_0x6117('0x2f')](respondWithResult(_0x4bcd2b,null))[_0x6117('0x4e')](handleError(_0x4bcd2b,null));};exports[_0x6117('0x53')]=function(_0x1d98f7,_0x536ea7){return db[_0x6117('0x37')]['create'](_0x1d98f7[_0x6117('0x54')],{})[_0x6117('0x2f')](function(_0x38d84a){var _0x3fbfa5=_0x1d98f7[_0x6117('0x55')][_0x6117('0x30')]({'plain':!![]});if(!_0x3fbfa5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fbfa5[_0x6117('0x56')]===_0x6117('0x55')){var _0x368de0=_0x38d84a[_0x6117('0x30')]({'plain':!![]});var _0x3d44b4=_0x6117('0x31');return db[_0x6117('0x57')][_0x6117('0x52')]({'where':{'name':_0x3d44b4,'userProfileId':_0x3fbfa5[_0x6117('0x58')]},'raw':!![]})[_0x6117('0x2f')](function(_0xd9079c){if(_0xd9079c&&_0xd9079c[_0x6117('0x59')]===0x0){return db[_0x6117('0x32')][_0x6117('0x53')]({'name':_0x368de0[_0x6117('0x34')],'resourceId':_0x368de0['id'],'type':_0xd9079c[_0x6117('0x34')],'sectionId':_0xd9079c['id']},{})['then'](function(){return _0x38d84a;});}else{return _0x38d84a;}})['catch'](function(_0x3bd29f){logger[_0x6117('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bd29f);throw _0x3bd29f;});}return _0x38d84a;})[_0x6117('0x2f')](respondWithResult(_0x536ea7,0xc9))[_0x6117('0x4e')](handleError(_0x536ea7,null));};exports['clone']=function(_0x4b1cb5,_0x340dc2){var _0x4e9949={'where':{'id':_0x4b1cb5[_0x6117('0x5b')]['id']}},_0x4480fe={};_0x4480fe[_0x6117('0x40')]=_[_0x6117('0x3d')](db[_0x6117('0x37')][_0x6117('0x38')]);_0x4e9949['attributes']=_[_0x6117('0x3e')](_0x4480fe[_0x6117('0x40')],qs[_0x6117('0x50')](_0x4b1cb5[_0x6117('0x3c')]['fields']));_0x4e9949[_0x6117('0x3f')]=_0x4e9949[_0x6117('0x3f')]['length']?_0x4e9949[_0x6117('0x3f')]:_0x4480fe[_0x6117('0x40')];if(_0x4b1cb5[_0x6117('0x3c')][_0x6117('0x5c')]){_0x4e9949[_0x6117('0x4b')]=[{'all':!![]}];}_0x4e9949=_[_0x6117('0x48')]({},_0x4e9949,_0x4b1cb5[_0x6117('0x4a')]);return db[_0x6117('0x37')][_0x6117('0x52')](_0x4e9949)[_0x6117('0x2f')](handleEntityNotFound(_0x340dc2,null))[_0x6117('0x2f')](function(_0x48b84d){if(_0x48b84d){var _0x3c119b=_0x48b84d[_0x6117('0x30')]({'plain':!![]});_0x3c119b=qs['omit'](_0x3c119b,['id',_0x6117('0x5d'),'updatedAt']);_0x4b1cb5[_0x6117('0x54')]=_[_0x6117('0x5e')](_0x4b1cb5['body'],['id',_0x6117('0x5d'),_0x6117('0x5f')]);return db[_0x6117('0x37')]['create'](_[_0x6117('0x48')](_0x3c119b,_0x4b1cb5['body']),{'include':_0x4b1cb5[_0x6117('0x3c')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x39219c){var _0x5d36cc=_0x4b1cb5['user']['get']({'plain':!![]});if(!_0x5d36cc)throw new Error(_0x6117('0x60'));if(_0x5d36cc[_0x6117('0x56')]==='user'){var _0x2a0b1a=_0x39219c[_0x6117('0x30')]({'plain':!![]});var _0x1f5867='CustomDashboards';return db[_0x6117('0x57')][_0x6117('0x52')]({'where':{'name':_0x1f5867,'userProfileId':_0x5d36cc['userProfileId']},'raw':!![]})[_0x6117('0x2f')](function(_0x9d54fd){if(_0x9d54fd&&_0x9d54fd[_0x6117('0x59')]===0x0){return db[_0x6117('0x32')][_0x6117('0x53')]({'name':_0x2a0b1a[_0x6117('0x34')],'resourceId':_0x2a0b1a['id'],'type':_0x9d54fd['name'],'sectionId':_0x9d54fd['id']},{})['then'](function(){return _0x39219c;});}else{return _0x39219c;}})[_0x6117('0x4e')](function(_0x3b6413){logger[_0x6117('0x5a')](_0x6117('0x61'),_0x3b6413);throw _0x3b6413;});}return _0x39219c;});}})['then'](respondWithResult(_0x340dc2,0xc9))[_0x6117('0x4e')](handleError(_0x340dc2,null));};exports[_0x6117('0x62')]=function(_0x267c09,_0xd3e5b9){if(_0x267c09[_0x6117('0x54')]['id']){delete _0x267c09[_0x6117('0x54')]['id'];}return db[_0x6117('0x37')][_0x6117('0x52')]({'where':{'id':_0x267c09['params']['id']}})[_0x6117('0x2f')](handleEntityNotFound(_0xd3e5b9,null))['then'](saveUpdates(_0x267c09[_0x6117('0x54')],null))[_0x6117('0x2f')](respondWithResult(_0xd3e5b9,null))['catch'](handleError(_0xd3e5b9,null));};exports[_0x6117('0x2e')]=function(_0x2def0a,_0x8a1eda){return db[_0x6117('0x37')][_0x6117('0x52')]({'where':{'id':_0x2def0a[_0x6117('0x5b')]['id']}})[_0x6117('0x2f')](handleEntityNotFound(_0x8a1eda,null))[_0x6117('0x2f')](removeEntity(_0x8a1eda,null))[_0x6117('0x4e')](handleError(_0x8a1eda,null));};function widgetAttributes(_0x45a811){try{switch(_0x45a811[_0x6117('0x3a')]){case _0x6117('0x63'):return[{'name':'attrUrl','value':_0x45a811[_0x6117('0x64')]||(_0x45a811['attrs']&&_0x45a811[_0x6117('0x65')][0x0]?_0x45a811[_0x6117('0x65')][0x0][_0x6117('0x66')]:undefined)||'https://'}];case _0x6117('0x67'):return[{'name':_0x6117('0x68'),'value':_0x45a811['attrPath']||(_0x45a811[_0x6117('0x65')]&&_0x45a811['attrs'][0x0]?_0x45a811[_0x6117('0x65')][0x0][_0x6117('0x66')]:undefined)||''}];case _0x6117('0x69'):return[{'name':_0x6117('0x6a'),'value':_0x45a811[_0x6117('0x6a')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x0]?_0x45a811['attrs'][0x0][_0x6117('0x66')]:undefined)||_0x6117('0x6b')},{'name':_0x6117('0x6c'),'value':_0x45a811[_0x6117('0x6c')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x1]?_0x45a811[_0x6117('0x65')][0x1][_0x6117('0x66')]:undefined)||_0x6117('0x6d')},{'name':_0x6117('0x6e'),'value':_0x45a811[_0x6117('0x6e')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x2]?_0x45a811[_0x6117('0x65')][0x2][_0x6117('0x66')]:undefined)||0xc}];case'counter':return[{'name':_0x6117('0x6f'),'value':_0x45a811[_0x6117('0x6f')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x0]?_0x45a811[_0x6117('0x65')][0x0][_0x6117('0x66')]:undefined)||_0x6117('0x70')},{'name':_0x6117('0x71'),'value':_0x45a811[_0x6117('0x71')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x1]?_0x45a811[_0x6117('0x65')][0x1]['value']:undefined)||[]},{'name':_0x6117('0x6e'),'value':_0x45a811[_0x6117('0x6e')]||(_0x45a811['attrs']&&_0x45a811[_0x6117('0x65')][0x2]?_0x45a811[_0x6117('0x65')][0x2][_0x6117('0x66')]:undefined)||0x14},{'name':'attrChannel','value':_0x45a811[_0x6117('0x72')]||(_0x45a811['attrs']&&_0x45a811[_0x6117('0x65')][0x3]?_0x45a811[_0x6117('0x65')][0x3][_0x6117('0x66')]:undefined)||_0x6117('0x73')},{'name':_0x6117('0x74'),'value':_0x45a811[_0x6117('0x74')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811['attrs'][0x4]?_0x45a811[_0x6117('0x65')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x45a811['attrFaxAccounts']||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x5]?_0x45a811[_0x6117('0x65')][0x5][_0x6117('0x66')]:undefined)||''},{'name':_0x6117('0x75'),'value':_0x45a811[_0x6117('0x75')]||(_0x45a811['attrs']&&_0x45a811[_0x6117('0x65')][0x6]?_0x45a811[_0x6117('0x65')][0x6][_0x6117('0x66')]:undefined)||''},{'name':_0x6117('0x76'),'value':_0x45a811['attrOpenchannelAccounts']||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x7]?_0x45a811[_0x6117('0x65')][0x7][_0x6117('0x66')]:undefined)||''},{'name':_0x6117('0x77'),'value':_0x45a811[_0x6117('0x77')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x8]?_0x45a811['attrs'][0x8][_0x6117('0x66')]:undefined)||''},{'name':_0x6117('0x78'),'value':_0x45a811['attrChatWebsites']||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x9]?_0x45a811[_0x6117('0x65')][0x9][_0x6117('0x66')]:undefined)||''}];case _0x6117('0x79'):case _0x6117('0x7a'):return[{'name':_0x6117('0x7b'),'value':_0x45a811['attrSerie1']||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x0]?_0x45a811[_0x6117('0x65')][0x0][_0x6117('0x66')]:undefined)||_0x6117('0x70')},{'name':_0x6117('0x7c'),'value':_0x45a811[_0x6117('0x7c')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811['attrs'][0x1]?_0x45a811[_0x6117('0x65')][0x1][_0x6117('0x66')]:undefined)||null},{'name':_0x6117('0x7d'),'value':_0x45a811[_0x6117('0x7d')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x2]?_0x45a811['attrs'][0x2][_0x6117('0x66')]:undefined)||null},{'name':_0x6117('0x71'),'value':_0x45a811['attrVoiceQueues']||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x3]?_0x45a811['attrs'][0x3][_0x6117('0x66')]:undefined)||[]},{'name':_0x6117('0x72'),'value':_0x45a811[_0x6117('0x72')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x4]?_0x45a811[_0x6117('0x65')][0x4][_0x6117('0x66')]:undefined)||_0x6117('0x73')},{'name':_0x6117('0x74'),'value':_0x45a811[_0x6117('0x74')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x5]?_0x45a811[_0x6117('0x65')][0x5][_0x6117('0x66')]:undefined)||''},{'name':_0x6117('0x7e'),'value':_0x45a811[_0x6117('0x7e')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x6]?_0x45a811[_0x6117('0x65')][0x6][_0x6117('0x66')]:undefined)||''},{'name':_0x6117('0x75'),'value':_0x45a811[_0x6117('0x75')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811['attrs'][0x7]?_0x45a811[_0x6117('0x65')][0x7][_0x6117('0x66')]:undefined)||''},{'name':_0x6117('0x76'),'value':_0x45a811[_0x6117('0x76')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x8]?_0x45a811[_0x6117('0x65')][0x8][_0x6117('0x66')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x45a811['attrWhatsappAccounts']||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x9]?_0x45a811[_0x6117('0x65')][0x9]['value']:undefined)||''},{'name':_0x6117('0x78'),'value':_0x45a811['attrChatWebsites']||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0xa]?_0x45a811[_0x6117('0x65')][0xa][_0x6117('0x66')]:undefined)||''}];case'web-report':return[{'name':_0x6117('0x7f'),'type':_0x45a811[_0x6117('0x80')]||(_0x45a811['attrs']&&_0x45a811[_0x6117('0x65')][0x0]?_0x45a811['attrs'][0x0][_0x6117('0x3a')]:undefined)||null,'value':_0x45a811[_0x6117('0x7f')]||(_0x45a811[_0x6117('0x65')]&&_0x45a811[_0x6117('0x65')][0x0]?_0x45a811[_0x6117('0x65')][0x0][_0x6117('0x66')]:undefined)||null},{'name':_0x6117('0x81'),'value':_0x45a811[_0x6117('0x81')]||(_0x45a811['attrs']&&_0x45a811[_0x6117('0x65')][0x1]?_0x45a811['attrs'][0x1][_0x6117('0x66')]:undefined)||0x0}];default:return[];}}catch(_0x44fe6a){logger['error'](_0x6117('0x82'),JSON[_0x6117('0x83')](_0x44fe6a));return[];}}exports[_0x6117('0x84')]=function(_0x90b1ce,_0x1d1ada,_0x227076){if(_0x90b1ce['body']['id']){delete _0x90b1ce[_0x6117('0x54')]['id'];}return db[_0x6117('0x37')]['find']({'where':{'id':_0x90b1ce[_0x6117('0x5b')]['id']}})[_0x6117('0x2f')](handleEntityNotFound(_0x1d1ada,null))[_0x6117('0x2f')](function(_0x1ef29e){if(_0x1ef29e){_0x90b1ce[_0x6117('0x54')][_0x6117('0x85')]=_0x1ef29e['id'];_0x90b1ce[_0x6117('0x54')][_0x6117('0x65')]=widgetAttributes(_0x90b1ce[_0x6117('0x54')]);return db['DashboardItem'][_0x6117('0x53')](_0x90b1ce[_0x6117('0x54')]);}})[_0x6117('0x2f')](respondWithResult(_0x1d1ada,null))[_0x6117('0x4e')](handleError(_0x1d1ada,null));};exports['getItems']=function(_0x5b6cb8,_0x283b42,_0x400b57){var _0x263e3f={};var _0x450a83={};var _0x2ef4f7;var _0x50a5e3;return db[_0x6117('0x37')][_0x6117('0x86')]({'where':{'id':_0x5b6cb8[_0x6117('0x5b')]['id']}})[_0x6117('0x2f')](handleEntityNotFound(_0x283b42,null))[_0x6117('0x2f')](function(_0x26da03){if(_0x26da03){_0x2ef4f7=_0x26da03;_0x450a83[_0x6117('0x40')]=_[_0x6117('0x3d')](db[_0x6117('0x87')][_0x6117('0x38')]);_0x450a83['query']=_[_0x6117('0x3d')](_0x5b6cb8['query']);_0x450a83[_0x6117('0x45')]=_[_0x6117('0x3e')](_0x450a83[_0x6117('0x40')],_0x450a83['query']);_0x263e3f[_0x6117('0x3f')]=_[_0x6117('0x3e')](_0x450a83[_0x6117('0x40')],qs['fields'](_0x5b6cb8[_0x6117('0x3c')][_0x6117('0x50')]));_0x263e3f[_0x6117('0x3f')]=_0x263e3f[_0x6117('0x3f')]['length']?_0x263e3f[_0x6117('0x3f')]:_0x450a83[_0x6117('0x40')];_0x263e3f[_0x6117('0x43')]=qs[_0x6117('0x44')](_0x5b6cb8['query'][_0x6117('0x44')]);_0x263e3f[_0x6117('0x47')]=qs[_0x6117('0x45')](_['pick'](_0x5b6cb8['query'],_0x450a83[_0x6117('0x45')]));if(_0x5b6cb8[_0x6117('0x3c')]['filter']){_0x263e3f[_0x6117('0x47')]=_[_0x6117('0x48')](_0x263e3f['where'],{'$or':_[_0x6117('0x36')](_0x263e3f['attributes'],function(_0x47c90e){var _0x21f4bf={};_0x21f4bf[_0x47c90e]={'$like':'%'+_0x5b6cb8[_0x6117('0x3c')][_0x6117('0x46')]+'%'};return _0x21f4bf;})});}_0x263e3f=_[_0x6117('0x48')]({},_0x263e3f,_0x5b6cb8['options']);return _0x2ef4f7[_0x6117('0x88')](_0x263e3f);}})['then'](function(_0x51929b){if(_0x51929b){_0x50a5e3=_0x51929b[_0x6117('0x51')];if(!_0x5b6cb8[_0x6117('0x3c')][_0x6117('0x41')](_0x6117('0x42'))){_0x263e3f[_0x6117('0x25')]=qs[_0x6117('0x25')](_0x5b6cb8[_0x6117('0x3c')][_0x6117('0x25')]);_0x263e3f['offset']=qs[_0x6117('0x27')](_0x5b6cb8[_0x6117('0x3c')][_0x6117('0x27')]);}return _0x2ef4f7[_0x6117('0x88')](_0x263e3f);}})['then'](function(_0xbd0108){if(_0xbd0108){return _0xbd0108?{'count':_0x50a5e3,'rows':_0xbd0108}:null;}})['then'](respondWithResult(_0x283b42,null))[_0x6117('0x4e')](handleError(_0x283b42,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index df239bf..a6d904a 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 _0xcf58=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x322a45,_0x2a3066){var _0x3132af=function(_0xb38d6b){while(--_0xb38d6b){_0x322a45['push'](_0x322a45['shift']());}};_0x3132af(++_0x2a3066);}(_0xcf58,0x86));var _0x8cf5=function(_0x5f297b,_0x5ccc16){_0x5f297b=_0x5f297b-0x0;var _0x597f7e=_0xcf58[_0x5f297b];return _0x597f7e;};'use strict';var EventEmitter=require(_0x8cf5('0x0'));var Dashboard=require(_0x8cf5('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8cf5('0x2')](0x0);var events={'afterCreate':_0x8cf5('0x3'),'afterUpdate':'update','afterDestroy':_0x8cf5('0x4')};function emitEvent(_0x267892){return function(_0x42133b,_0x15a06f,_0x595846){DashboardEvents[_0x8cf5('0x5')](_0x267892+':'+_0x42133b['id'],_0x42133b);DashboardEvents[_0x8cf5('0x5')](_0x267892,_0x42133b);_0x595846(null);};}for(var e in events){if(events[_0x8cf5('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x2bbc=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2bbc,0xa5));var _0xc2bb=function(_0x3bdcf3,_0x2bc4b3){_0x3bdcf3=_0x3bdcf3-0x0;var _0x2bea6d=_0x2bbc[_0x3bdcf3];return _0x2bea6d;};'use strict';var EventEmitter=require(_0xc2bb('0x0'));var Dashboard=require(_0xc2bb('0x1'))['db'][_0xc2bb('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc2bb('0x3')](0x0);var events={'afterCreate':_0xc2bb('0x4'),'afterUpdate':_0xc2bb('0x5'),'afterDestroy':_0xc2bb('0x6')};function emitEvent(_0xb20ebd){return function(_0x2db6b6,_0x48da46,_0x35fe81){DashboardEvents[_0xc2bb('0x7')](_0xb20ebd+':'+_0x2db6b6['id'],_0x2db6b6);DashboardEvents['emit'](_0xb20ebd,_0x2db6b6);_0x35fe81(null);};}for(var e in events){if(events[_0xc2bb('0x8')](e)){var event=events[e];Dashboard[_0xc2bb('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 7fa3855..f019260 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 _0x81aa=['rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x11cc42,_0x313c7d){var _0x45b7e4=function(_0x4ee48b){while(--_0x4ee48b){_0x11cc42['push'](_0x11cc42['shift']());}};_0x45b7e4(++_0x313c7d);}(_0x81aa,0x94));var _0xa81a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x81aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa81a('0x0'));var util=require(_0xa81a('0x1'));var logger=require(_0xa81a('0x2'))('api');var moment=require(_0xa81a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa81a('0x4'));var fs=require('fs');var path=require(_0xa81a('0x5'));var rimraf=require(_0xa81a('0x6'));var config=require(_0xa81a('0x7'));var attributes=require(_0xa81a('0x8'));module['exports']=function(_0x3d3112,_0x2466e9){return _0x3d3112[_0xa81a('0x9')](_0xa81a('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x182d=['Dashboard','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define'];(function(_0xc95706,_0x1562a3){var _0x8ea7fa=function(_0x1a4e99){while(--_0x1a4e99){_0xc95706['push'](_0xc95706['shift']());}};_0x8ea7fa(++_0x1562a3);}(_0x182d,0x114));var _0xd182=function(_0x2a341b,_0x1b3e11){_0x2a341b=_0x2a341b-0x0;var _0x13cce3=_0x182d[_0x2a341b];return _0x13cce3;};'use strict';var _=require('lodash');var util=require(_0xd182('0x0'));var logger=require(_0xd182('0x1'))('api');var moment=require(_0xd182('0x2'));var BPromise=require(_0xd182('0x3'));var rp=require(_0xd182('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd182('0x5'));var config=require(_0xd182('0x6'));var attributes=require(_0xd182('0x7'));module[_0xd182('0x8')]=function(_0xbf138a,_0x1fbb69){return _0xbf138a[_0xd182('0x9')](_0xd182('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 1d2bc01..31ca76f 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 _0x68a7=['Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','http','redis','socket.io-emitter','./dashboard.socket','register','request','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x98492e,_0x2d4fcf){var _0x531c5d=function(_0x58cc5f){while(--_0x58cc5f){_0x98492e['push'](_0x98492e['shift']());}};_0x531c5d(++_0x2d4fcf);}(_0x68a7,0x77));var _0x768a=function(_0x1f6896,_0x1d0112){_0x1f6896=_0x1f6896-0x0;var _0x77da76=_0x68a7[_0x1f6896];return _0x77da76;};'use strict';var _=require(_0x768a('0x0'));var util=require(_0x768a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x768a('0x2'));var fs=require('fs');var Redis=require(_0x768a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x768a('0x4'));var logger=require('../../config/logger')(_0x768a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x768a('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x768a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x768a('0x8'))(new Redis(config['redis']));require(_0x768a('0x9'))[_0x768a('0xa')](socket);function respondWithRpcPromise(_0xf01b26,_0x49c060,_0x54d989){return new BPromise(function(_0x35403f,_0x2710e7){return client[_0x768a('0xb')](_0xf01b26,_0x54d989)['then'](function(_0x45c176){logger[_0x768a('0xc')]('Dashboard,\x20%s,\x20%s',_0x49c060,'request\x20sent');logger[_0x768a('0xd')](_0x768a('0xe'),_0x49c060,_0x768a('0xf'),JSON[_0x768a('0x10')](_0x45c176));if(_0x45c176[_0x768a('0x11')]){if(_0x45c176[_0x768a('0x11')][_0x768a('0x12')]===0x1f4){logger['error'](_0x768a('0x13'),_0x49c060,_0x45c176[_0x768a('0x11')][_0x768a('0x14')]);return _0x2710e7(_0x45c176[_0x768a('0x11')]['message']);}logger[_0x768a('0x11')]('Dashboard,\x20%s,\x20%s',_0x49c060,_0x45c176[_0x768a('0x11')][_0x768a('0x14')]);return _0x35403f(_0x45c176[_0x768a('0x11')][_0x768a('0x14')]);}else{logger[_0x768a('0xc')](_0x768a('0x13'),_0x49c060,_0x768a('0xf'));_0x35403f(_0x45c176[_0x768a('0x15')]['message']);}})[_0x768a('0x16')](function(_0x348748){logger[_0x768a('0x11')]('Dashboard,\x20%s,\x20%s',_0x49c060,_0x348748);_0x2710e7(_0x348748);});});} \ No newline at end of file +var _0xa709=['debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./dashboard.socket','register','info','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x13432a,_0x5a1046){var _0x4982ad=function(_0x3f2936){while(--_0x3f2936){_0x13432a['push'](_0x13432a['shift']());}};_0x4982ad(++_0x5a1046);}(_0xa709,0x104));var _0x9a70=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa709[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x9a70('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a70('0x1'));var fs=require('fs');var Redis=require(_0x9a70('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a70('0x3'));var logger=require(_0x9a70('0x4'))(_0x9a70('0x5'));var config=require(_0x9a70('0x6'));var jayson=require(_0x9a70('0x7'));var client=jayson[_0x9a70('0x8')][_0x9a70('0x9')]({'port':0x232a});config[_0x9a70('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a70('0xa')]));require(_0x9a70('0xb'))[_0x9a70('0xc')](socket);function respondWithRpcPromise(_0x521f8e,_0x2d459f,_0x5996a7){return new BPromise(function(_0x330405,_0x39eb7f){return client['request'](_0x521f8e,_0x5996a7)['then'](function(_0x199169){logger[_0x9a70('0xd')](_0x9a70('0xe'),_0x2d459f,_0x9a70('0xf'));logger[_0x9a70('0x10')](_0x9a70('0x11'),_0x2d459f,_0x9a70('0xf'),JSON[_0x9a70('0x12')](_0x199169));if(_0x199169[_0x9a70('0x13')]){if(_0x199169[_0x9a70('0x13')]['code']===0x1f4){logger[_0x9a70('0x13')](_0x9a70('0xe'),_0x2d459f,_0x199169['error']['message']);return _0x39eb7f(_0x199169['error'][_0x9a70('0x14')]);}logger[_0x9a70('0x13')](_0x9a70('0xe'),_0x2d459f,_0x199169[_0x9a70('0x13')][_0x9a70('0x14')]);return _0x330405(_0x199169[_0x9a70('0x13')][_0x9a70('0x14')]);}else{logger[_0x9a70('0xd')](_0x9a70('0xe'),_0x2d459f,_0x9a70('0xf'));_0x330405(_0x199169[_0x9a70('0x15')][_0x9a70('0x14')]);}})[_0x9a70('0x16')](function(_0x5d35b4){logger[_0x9a70('0x13')]('Dashboard,\x20%s,\x20%s',_0x2d459f,_0x5d35b4);_0x39eb7f(_0x5d35b4);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 4ff40be..875d6f6 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 _0x4046=['./dashboard.events','save','remove','update','emit','removeListener','register','dashboard:'];(function(_0x522fa1,_0x3628f6){var _0x4d7caa=function(_0x327ee3){while(--_0x327ee3){_0x522fa1['push'](_0x522fa1['shift']());}};_0x4d7caa(++_0x3628f6);}(_0x4046,0x80));var _0x6404=function(_0x14f59f,_0x26fb6e){_0x14f59f=_0x14f59f-0x0;var _0x209f18=_0x4046[_0x14f59f];return _0x209f18;};'use strict';var DashboardEvents=require(_0x6404('0x0'));var events=[_0x6404('0x1'),_0x6404('0x2'),_0x6404('0x3')];function createListener(_0x2cd0f4,_0x333e2e){return function(_0x92efb6){_0x333e2e[_0x6404('0x4')](_0x2cd0f4,_0x92efb6);};}function removeListener(_0x4f83dc,_0x31b0e0){return function(){DashboardEvents[_0x6404('0x5')](_0x4f83dc,_0x31b0e0);};}exports[_0x6404('0x6')]=function(_0x1d12bf){for(var _0x4b97ac=0x0,_0x371ec0=events['length'];_0x4b97ac<_0x371ec0;_0x4b97ac++){var _0x511229=events[_0x4b97ac];var _0x8a8a17=createListener(_0x6404('0x7')+_0x511229,_0x1d12bf);DashboardEvents['on'](_0x511229,_0x8a8a17);}}; \ No newline at end of file +var _0x59b1=['update','emit','register','length','./dashboard.events','remove'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0x59b1,0x14e));var _0x159b=function(_0x228e0c,_0x38a73f){_0x228e0c=_0x228e0c-0x0;var _0x516735=_0x59b1[_0x228e0c];return _0x516735;};'use strict';var DashboardEvents=require(_0x159b('0x0'));var events=['save',_0x159b('0x1'),_0x159b('0x2')];function createListener(_0x29767f,_0x105587){return function(_0x5a91b2){_0x105587[_0x159b('0x3')](_0x29767f,_0x5a91b2);};}function removeListener(_0x19904d,_0x4cee92){return function(){DashboardEvents['removeListener'](_0x19904d,_0x4cee92);};}exports[_0x159b('0x4')]=function(_0x560621){for(var _0x57e9c8=0x0,_0x11d989=events[_0x159b('0x5')];_0x57e9c8<_0x11d989;_0x57e9c8++){var _0x59bbe8=events[_0x57e9c8];var _0x33ea2e=createListener('dashboard:'+_0x59bbe8,_0x560621);DashboardEvents['on'](_0x59bbe8,_0x33ea2e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 6217948..7583b4a 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 _0xfd88=['show','/:id/items','post','create','addItem','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id'];(function(_0x1fdf54,_0x5a646f){var _0x4c5e64=function(_0x1f59ad){while(--_0x1f59ad){_0x1fdf54['push'](_0x1fdf54['shift']());}};_0x4c5e64(++_0x5a646f);}(_0xfd88,0xb9));var _0x8fd8=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0xfd88[_0x36de10];return _0x58100f;};'use strict';var multer=require('multer');var util=require(_0x8fd8('0x0'));var path=require(_0x8fd8('0x1'));var timeout=require(_0x8fd8('0x2'));var express=require(_0x8fd8('0x3'));var router=express[_0x8fd8('0x4')]();var fs_extra=require(_0x8fd8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fd8('0x6'));var config=require(_0x8fd8('0x7'));var controller=require(_0x8fd8('0x8'));router[_0x8fd8('0x9')]('/',auth[_0x8fd8('0xa')](),controller[_0x8fd8('0xb')]);router[_0x8fd8('0x9')](_0x8fd8('0xc'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0xd')]);router[_0x8fd8('0x9')](_0x8fd8('0xe'),auth[_0x8fd8('0xa')](),controller['getItems']);router[_0x8fd8('0xf')]('/',auth['isAuthenticated'](),controller[_0x8fd8('0x10')]);router['post']('/:id/clone',auth[_0x8fd8('0xa')](),controller['clone']);router[_0x8fd8('0xf')](_0x8fd8('0xe'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0x11')]);router[_0x8fd8('0x12')](_0x8fd8('0xc'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0x13')]);router[_0x8fd8('0x14')](_0x8fd8('0xc'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9d58=['../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','/:id','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','destroy','exports','util','express','Router','fs-extra'];(function(_0x52caee,_0x671b9a){var _0x11ecdb=function(_0xfee732){while(--_0xfee732){_0x52caee['push'](_0x52caee['shift']());}};_0x11ecdb(++_0x671b9a);}(_0x9d58,0x1f4));var _0x89d5=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x9d58[_0x1ed116];return _0x574066;};'use strict';var multer=require('multer');var util=require(_0x89d5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x89d5('0x1'));var router=express[_0x89d5('0x2')]();var fs_extra=require(_0x89d5('0x3'));var auth=require(_0x89d5('0x4'));var interaction=require(_0x89d5('0x5'));var config=require('../../config/environment');var controller=require(_0x89d5('0x6'));router[_0x89d5('0x7')]('/',auth[_0x89d5('0x8')](),controller['index']);router[_0x89d5('0x7')](_0x89d5('0x9'),auth[_0x89d5('0x8')](),controller['show']);router['get'](_0x89d5('0xa'),auth[_0x89d5('0x8')](),controller[_0x89d5('0xb')]);router[_0x89d5('0xc')]('/',auth['isAuthenticated'](),controller[_0x89d5('0xd')]);router[_0x89d5('0xc')](_0x89d5('0xe'),auth[_0x89d5('0x8')](),controller[_0x89d5('0xf')]);router[_0x89d5('0xc')](_0x89d5('0xa'),auth[_0x89d5('0x8')](),controller[_0x89d5('0x10')]);router[_0x89d5('0x11')](_0x89d5('0x9'),auth['isAuthenticated'](),controller[_0x89d5('0x12')]);router['delete']('/:id',auth[_0x89d5('0x8')](),controller[_0x89d5('0x13')]);module[_0x89d5('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 425c61e..bc27a4b 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 _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x4b7640,_0x4d0174){var _0x9c27ed=function(_0x1b359f){while(--_0x1b359f){_0x4b7640['push'](_0x4b7640['shift']());}};_0x9c27ed(++_0x4d0174);}(_0x2ef3,0xba));var _0x32ef=function(_0x50c167,_0x1ab4b2){_0x50c167=_0x50c167-0x0;var _0x22e8b8=_0x2ef3[_0x50c167];return _0x22e8b8;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x19c1c9,_0x238c89){var _0x1c64dd=function(_0x398dbb){while(--_0x398dbb){_0x19c1c9['push'](_0x19c1c9['shift']());}};_0x1c64dd(++_0x238c89);}(_0xeff8,0x186));var _0x8eff=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xeff8[_0x52085a];return _0x5afc1a;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index f77c299..af9025e 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 _0x2cd0=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','show','params','model','DashboardItem','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x4f5bc9,_0x2d8bc5){var _0x39796b=function(_0x20910a){while(--_0x20910a){_0x4f5bc9['push'](_0x4f5bc9['shift']());}};_0x39796b(++_0x2d8bc5);}(_0x2cd0,0x10f));var _0x02cd=function(_0x430290,_0x57fea2){_0x430290=_0x430290-0x0;var _0x151f6d=_0x2cd0[_0x430290];return _0x151f6d;};'use strict';var emlformat=require(_0x02cd('0x0'));var rimraf=require(_0x02cd('0x1'));var zipdir=require(_0x02cd('0x2'));var jsonpatch=require(_0x02cd('0x3'));var rp=require(_0x02cd('0x4'));var moment=require(_0x02cd('0x5'));var BPromise=require(_0x02cd('0x6'));var Mustache=require(_0x02cd('0x7'));var util=require('util');var path=require(_0x02cd('0x8'));var sox=require(_0x02cd('0x9'));var csv=require(_0x02cd('0xa'));var ejs=require(_0x02cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02cd('0xc'));var squel=require(_0x02cd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02cd('0xa'));var querystring=require(_0x02cd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02cd('0xf'));var qs=require(_0x02cd('0x10'));var as=require(_0x02cd('0x11'));var hardwareService=require(_0x02cd('0x12'));var logger=require(_0x02cd('0x13'))(_0x02cd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x02cd('0x15'));var db=require(_0x02cd('0x16'))['db'];config[_0x02cd('0x17')]=_[_0x02cd('0x18')](config[_0x02cd('0x17')],{'host':_0x02cd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cd('0x17')]));require('./dashboardItem.socket')[_0x02cd('0x1a')](socket);function respondWithStatusCode(_0x583620,_0x526499){_0x526499=_0x526499||0xcc;return function(_0x51f190){if(_0x51f190){return _0x583620[_0x02cd('0x1b')](_0x526499);}return _0x583620[_0x02cd('0x1c')](_0x526499)[_0x02cd('0x1d')]();};}function respondWithResult(_0x15b6fe,_0x14ba5c){_0x14ba5c=_0x14ba5c||0xc8;return function(_0x177720){if(_0x177720){return _0x15b6fe[_0x02cd('0x1c')](_0x14ba5c)[_0x02cd('0x1e')](_0x177720);}};}function respondWithFilteredResult(_0xb4115c,_0x2d554b){return function(_0x18c522){if(_0x18c522){var _0x24ca3e=typeof _0x2d554b[_0x02cd('0x1f')]===_0x02cd('0x20')&&typeof _0x2d554b[_0x02cd('0x21')]===_0x02cd('0x20');var _0x4f448b=_0x18c522[_0x02cd('0x22')];var _0x2ba059=_0x24ca3e?0x0:_0x2d554b[_0x02cd('0x1f')];var _0x17c764=_0x24ca3e?_0x18c522[_0x02cd('0x22')]:_0x2d554b[_0x02cd('0x1f')]+_0x2d554b[_0x02cd('0x21')];var _0xd6cc59;if(_0x17c764>=_0x4f448b){_0x17c764=_0x4f448b;_0xd6cc59=0xc8;}else{_0xd6cc59=0xce;}_0xb4115c[_0x02cd('0x1c')](_0xd6cc59);return _0xb4115c[_0x02cd('0x23')](_0x02cd('0x24'),_0x2ba059+'-'+_0x17c764+'/'+_0x4f448b)['json'](_0x18c522);}return null;};}function patchUpdates(_0x2b9809){return function(_0x155e5e){try{jsonpatch[_0x02cd('0x25')](_0x155e5e,_0x2b9809,!![]);}catch(_0x2fb5af){return BPromise['reject'](_0x2fb5af);}return _0x155e5e[_0x02cd('0x26')]();};}function saveUpdates(_0x4e127f,_0x1351fa){return function(_0x397aba){if(_0x397aba){return _0x397aba[_0x02cd('0x27')](_0x4e127f)[_0x02cd('0x28')](function(_0x40e7fa){return _0x40e7fa;});}return null;};}function removeEntity(_0x194c7e,_0x3fd0b0){return function(_0x5e92ed){if(_0x5e92ed){return _0x5e92ed[_0x02cd('0x29')]()[_0x02cd('0x28')](function(){_0x194c7e['status'](0xcc)[_0x02cd('0x1d')]();});}};}function handleEntityNotFound(_0x560027,_0x35f785){return function(_0x490389){if(!_0x490389){_0x560027[_0x02cd('0x1b')](0x194);}return _0x490389;};}function handleError(_0x3651d4,_0x478068){_0x478068=_0x478068||0x1f4;return function(_0x205ee7){logger[_0x02cd('0x2a')](_0x205ee7[_0x02cd('0x2b')]);if(_0x205ee7['name']){delete _0x205ee7['name'];}_0x3651d4[_0x02cd('0x1c')](_0x478068)[_0x02cd('0x2c')](_0x205ee7);};}exports[_0x02cd('0x2d')]=function(_0x296103,_0x5f5283){var _0x561eba={'raw':![],'where':{'id':_0x296103[_0x02cd('0x2e')]['id']}},_0x15a334={};_0x15a334[_0x02cd('0x2f')]=_['keys'](db[_0x02cd('0x30')]['rawAttributes']);_0x15a334[_0x02cd('0x31')]=_['keys'](_0x296103[_0x02cd('0x31')]);_0x15a334['filters']=_[_0x02cd('0x32')](_0x15a334[_0x02cd('0x2f')],_0x15a334[_0x02cd('0x31')]);_0x561eba[_0x02cd('0x33')]=_[_0x02cd('0x32')](_0x15a334['model'],qs[_0x02cd('0x34')](_0x296103['query']['fields']));_0x561eba[_0x02cd('0x33')]=_0x561eba[_0x02cd('0x33')][_0x02cd('0x35')]?_0x561eba[_0x02cd('0x33')]:_0x15a334['model'];if(_0x296103['query'][_0x02cd('0x36')]){_0x561eba[_0x02cd('0x37')]=[{'all':!![]}];}_0x561eba=_[_0x02cd('0x38')]({},_0x561eba,_0x296103[_0x02cd('0x39')]);return db[_0x02cd('0x30')][_0x02cd('0x3a')](_0x561eba)[_0x02cd('0x28')](handleEntityNotFound(_0x5f5283,null))['then'](respondWithResult(_0x5f5283,null))[_0x02cd('0x3b')](handleError(_0x5f5283,null));};exports[_0x02cd('0x29')]=function(_0x4169e4,_0x27b585){return db[_0x02cd('0x30')][_0x02cd('0x3a')]({'where':{'id':_0x4169e4[_0x02cd('0x2e')]['id']}})[_0x02cd('0x28')](handleEntityNotFound(_0x27b585,null))[_0x02cd('0x28')](removeEntity(_0x27b585,null))['catch'](handleError(_0x27b585,null));};function widgetAttributes(_0x349ca8){try{switch(_0x349ca8[_0x02cd('0x3c')]){case _0x02cd('0x3d'):return[{'name':_0x02cd('0x3e'),'value':_0x349ca8[_0x02cd('0x3e')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x41')}];case _0x02cd('0x42'):return[{'name':_0x02cd('0x43'),'value':_0x349ca8['attrPath']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0][_0x02cd('0x40')]:undefined)||''}];case'clock':return[{'name':_0x02cd('0x44'),'value':_0x349ca8[_0x02cd('0x44')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x45')},{'name':'attrTimezone','value':_0x349ca8[_0x02cd('0x46')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||'0.00'},{'name':_0x02cd('0x47'),'value':_0x349ca8[_0x02cd('0x47')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8[_0x02cd('0x3f')][0x2][_0x02cd('0x40')]:undefined)||0xc}];case _0x02cd('0x48'):return[{'name':_0x02cd('0x49'),'value':_0x349ca8['attrMetric']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x4a')},{'name':_0x02cd('0x4b'),'value':_0x349ca8['attrVoiceQueues']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||[]},{'name':_0x02cd('0x47'),'value':_0x349ca8[_0x02cd('0x47')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8[_0x02cd('0x3f')][0x2][_0x02cd('0x40')]:undefined)||0x14},{'name':'attrChannel','value':_0x349ca8[_0x02cd('0x4c')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x3]?_0x349ca8['attrs'][0x3][_0x02cd('0x40')]:undefined)||_0x02cd('0x4d')},{'name':_0x02cd('0x4e'),'value':_0x349ca8[_0x02cd('0x4e')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x4]?_0x349ca8[_0x02cd('0x3f')][0x4]['value']:undefined)||''},{'name':_0x02cd('0x4f'),'value':_0x349ca8[_0x02cd('0x4f')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x5]?_0x349ca8[_0x02cd('0x3f')][0x5][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x50'),'value':_0x349ca8[_0x02cd('0x50')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x6]?_0x349ca8[_0x02cd('0x3f')][0x6][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x51'),'value':_0x349ca8[_0x02cd('0x51')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x7]?_0x349ca8[_0x02cd('0x3f')][0x7][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x52'),'value':_0x349ca8[_0x02cd('0x52')]||(_0x349ca8['attrs']&&_0x349ca8['attrs'][0x8]?_0x349ca8[_0x02cd('0x3f')][0x8]['value']:undefined)||''},{'name':_0x02cd('0x53'),'value':_0x349ca8[_0x02cd('0x53')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x9]?_0x349ca8['attrs'][0x9][_0x02cd('0x40')]:undefined)||''}];case _0x02cd('0x54'):case _0x02cd('0x55'):return[{'name':_0x02cd('0x56'),'value':_0x349ca8['attrSerie1']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||'total'},{'name':_0x02cd('0x57'),'value':_0x349ca8[_0x02cd('0x57')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||null},{'name':_0x02cd('0x58'),'value':_0x349ca8[_0x02cd('0x58')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x349ca8[_0x02cd('0x4b')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x3]?_0x349ca8[_0x02cd('0x3f')][0x3][_0x02cd('0x40')]:undefined)||[]},{'name':_0x02cd('0x4c'),'value':_0x349ca8['attrChannel']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x4]?_0x349ca8['attrs'][0x4][_0x02cd('0x40')]:undefined)||'voice'},{'name':_0x02cd('0x4e'),'value':_0x349ca8['attrEmailAccounts']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x5]?_0x349ca8[_0x02cd('0x3f')][0x5]['value']:undefined)||''},{'name':_0x02cd('0x4f'),'value':_0x349ca8[_0x02cd('0x4f')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x6]?_0x349ca8['attrs'][0x6][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x50'),'value':_0x349ca8['attrSmsAccounts']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x7]?_0x349ca8['attrs'][0x7][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x51'),'value':_0x349ca8[_0x02cd('0x51')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x8]?_0x349ca8['attrs'][0x8]['value']:undefined)||''},{'name':_0x02cd('0x52'),'value':_0x349ca8['attrWhatsappAccounts']||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x9]?_0x349ca8[_0x02cd('0x3f')][0x9][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x53'),'value':_0x349ca8[_0x02cd('0x53')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0xa]?_0x349ca8[_0x02cd('0x3f')][0xa][_0x02cd('0x40')]:undefined)||''}];case _0x02cd('0x59'):return[{'name':'attrReport','type':_0x349ca8[_0x02cd('0x5a')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0][_0x02cd('0x3c')]:undefined)||null,'value':_0x349ca8['attrReport']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0]['value']:undefined)||null},{'name':_0x02cd('0x5b'),'value':_0x349ca8['attrRefresh']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x20e23e){logger['error'](_0x02cd('0x5c'),JSON['stringify'](_0x20e23e));return[];}}exports[_0x02cd('0x5d')]=function(_0x470b48,_0x1f327d){if(_0x470b48[_0x02cd('0x5e')]){_0x470b48[_0x02cd('0x5e')][_0x02cd('0x3f')]=widgetAttributes(_0x470b48['body']);}return db[_0x02cd('0x30')]['create'](_0x470b48[_0x02cd('0x5e')],{})[_0x02cd('0x28')](respondWithResult(_0x1f327d,0xc9))[_0x02cd('0x3b')](handleError(_0x1f327d,null));};exports[_0x02cd('0x27')]=function(_0xe5bd3e,_0x3c4dda){if(_0xe5bd3e['body']['id']){delete _0xe5bd3e[_0x02cd('0x5e')]['id'];}_0xe5bd3e[_0x02cd('0x5e')][_0x02cd('0x3f')]=widgetAttributes(_0xe5bd3e[_0x02cd('0x5e')]);return db[_0x02cd('0x30')][_0x02cd('0x3a')]({'where':{'id':_0xe5bd3e['params']['id']}})[_0x02cd('0x28')](handleEntityNotFound(_0x3c4dda,null))[_0x02cd('0x28')](saveUpdates(_0xe5bd3e['body'],null))[_0x02cd('0x28')](respondWithResult(_0x3c4dda,null))[_0x02cd('0x3b')](handleError(_0x3c4dda,null));}; \ No newline at end of file +var _0xb3d8=['attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','model','fields','length','includeAll','include','merge','options','find','catch','attrUrl','attrs','https://','custom','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts'];(function(_0x38edee,_0x1ba0aa){var _0x3d7f1e=function(_0x491d20){while(--_0x491d20){_0x38edee['push'](_0x38edee['shift']());}};_0x3d7f1e(++_0x1ba0aa);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x16f2bd,_0x6f58ed){_0x16f2bd=_0x16f2bd-0x0;var _0x8113af=_0xb3d8[_0x16f2bd];return _0x8113af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b3d('0x0'));var zipdir=require(_0x8b3d('0x1'));var jsonpatch=require(_0x8b3d('0x2'));var rp=require(_0x8b3d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8b3d('0x4'));var util=require(_0x8b3d('0x5'));var path=require(_0x8b3d('0x6'));var sox=require(_0x8b3d('0x7'));var csv=require(_0x8b3d('0x8'));var ejs=require(_0x8b3d('0x9'));var fs=require('fs');var fs_extra=require(_0x8b3d('0xa'));var _=require(_0x8b3d('0xb'));var squel=require(_0x8b3d('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b3d('0xd'));var deskjs=require(_0x8b3d('0xe'));var toCsv=require(_0x8b3d('0x8'));var querystring=require(_0x8b3d('0xf'));var Papa=require(_0x8b3d('0x10'));var Redis=require(_0x8b3d('0x11'));var authService=require(_0x8b3d('0x12'));var qs=require(_0x8b3d('0x13'));var as=require(_0x8b3d('0x14'));var hardwareService=require(_0x8b3d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x8b3d('0x16'));var config=require(_0x8b3d('0x17'));var licenseUtil=require(_0x8b3d('0x18'));var db=require(_0x8b3d('0x19'))['db'];config[_0x8b3d('0x1a')]=_[_0x8b3d('0x1b')](config[_0x8b3d('0x1a')],{'host':_0x8b3d('0x1c'),'port':0x18eb});var socket=require(_0x8b3d('0x1d'))(new Redis(config[_0x8b3d('0x1a')]));require(_0x8b3d('0x1e'))[_0x8b3d('0x1f')](socket);function respondWithStatusCode(_0xb0a303,_0x1c5eaa){_0x1c5eaa=_0x1c5eaa||0xcc;return function(_0x173e94){if(_0x173e94){return _0xb0a303[_0x8b3d('0x20')](_0x1c5eaa);}return _0xb0a303['status'](_0x1c5eaa)[_0x8b3d('0x21')]();};}function respondWithResult(_0x381c0d,_0x5c11b9){_0x5c11b9=_0x5c11b9||0xc8;return function(_0x37fd79){if(_0x37fd79){return _0x381c0d[_0x8b3d('0x22')](_0x5c11b9)['json'](_0x37fd79);}};}function respondWithFilteredResult(_0xb493ac,_0x205d11){return function(_0xcc9b46){if(_0xcc9b46){var _0x3d733e=typeof _0x205d11[_0x8b3d('0x23')]==='undefined'&&typeof _0x205d11['limit']===_0x8b3d('0x24');var _0x4f1b21=_0xcc9b46['count'];var _0x50c5e8=_0x3d733e?0x0:_0x205d11[_0x8b3d('0x23')];var _0x2e9dce=_0x3d733e?_0xcc9b46['count']:_0x205d11[_0x8b3d('0x23')]+_0x205d11[_0x8b3d('0x25')];var _0xff346c;if(_0x2e9dce>=_0x4f1b21){_0x2e9dce=_0x4f1b21;_0xff346c=0xc8;}else{_0xff346c=0xce;}_0xb493ac[_0x8b3d('0x22')](_0xff346c);return _0xb493ac[_0x8b3d('0x26')](_0x8b3d('0x27'),_0x50c5e8+'-'+_0x2e9dce+'/'+_0x4f1b21)[_0x8b3d('0x28')](_0xcc9b46);}return null;};}function patchUpdates(_0x116ea4){return function(_0x21fac6){try{jsonpatch[_0x8b3d('0x29')](_0x21fac6,_0x116ea4,!![]);}catch(_0x338f6b){return BPromise['reject'](_0x338f6b);}return _0x21fac6[_0x8b3d('0x2a')]();};}function saveUpdates(_0x584a71,_0x27fa14){return function(_0x17cd4c){if(_0x17cd4c){return _0x17cd4c[_0x8b3d('0x2b')](_0x584a71)[_0x8b3d('0x2c')](function(_0x57fe10){return _0x57fe10;});}return null;};}function removeEntity(_0x219ecb,_0x4fc627){return function(_0x4bda3e){if(_0x4bda3e){return _0x4bda3e[_0x8b3d('0x2d')]()['then'](function(){_0x219ecb['status'](0xcc)[_0x8b3d('0x21')]();});}};}function handleEntityNotFound(_0x3a075b,_0x52467f){return function(_0x5901f4){if(!_0x5901f4){_0x3a075b[_0x8b3d('0x20')](0x194);}return _0x5901f4;};}function handleError(_0x3aef33,_0x15f2f4){_0x15f2f4=_0x15f2f4||0x1f4;return function(_0x1cab3a){logger[_0x8b3d('0x2e')](_0x1cab3a['stack']);if(_0x1cab3a[_0x8b3d('0x2f')]){delete _0x1cab3a[_0x8b3d('0x2f')];}_0x3aef33[_0x8b3d('0x22')](_0x15f2f4)[_0x8b3d('0x30')](_0x1cab3a);};}exports[_0x8b3d('0x31')]=function(_0x487065,_0x520a69){var _0x3dae7e={'raw':![],'where':{'id':_0x487065[_0x8b3d('0x32')]['id']}},_0x20bc19={};_0x20bc19['model']=_[_0x8b3d('0x33')](db[_0x8b3d('0x34')][_0x8b3d('0x35')]);_0x20bc19['query']=_[_0x8b3d('0x33')](_0x487065[_0x8b3d('0x36')]);_0x20bc19[_0x8b3d('0x37')]=_['intersection'](_0x20bc19['model'],_0x20bc19[_0x8b3d('0x36')]);_0x3dae7e[_0x8b3d('0x38')]=_[_0x8b3d('0x39')](_0x20bc19[_0x8b3d('0x3a')],qs[_0x8b3d('0x3b')](_0x487065[_0x8b3d('0x36')][_0x8b3d('0x3b')]));_0x3dae7e['attributes']=_0x3dae7e[_0x8b3d('0x38')][_0x8b3d('0x3c')]?_0x3dae7e[_0x8b3d('0x38')]:_0x20bc19[_0x8b3d('0x3a')];if(_0x487065[_0x8b3d('0x36')][_0x8b3d('0x3d')]){_0x3dae7e[_0x8b3d('0x3e')]=[{'all':!![]}];}_0x3dae7e=_[_0x8b3d('0x3f')]({},_0x3dae7e,_0x487065[_0x8b3d('0x40')]);return db[_0x8b3d('0x34')][_0x8b3d('0x41')](_0x3dae7e)[_0x8b3d('0x2c')](handleEntityNotFound(_0x520a69,null))[_0x8b3d('0x2c')](respondWithResult(_0x520a69,null))[_0x8b3d('0x42')](handleError(_0x520a69,null));};exports[_0x8b3d('0x2d')]=function(_0x2bce52,_0x607b86){return db['DashboardItem']['find']({'where':{'id':_0x2bce52[_0x8b3d('0x32')]['id']}})['then'](handleEntityNotFound(_0x607b86,null))[_0x8b3d('0x2c')](removeEntity(_0x607b86,null))[_0x8b3d('0x42')](handleError(_0x607b86,null));};function widgetAttributes(_0x218cef){try{switch(_0x218cef['type']){case'iframe':return[{'name':_0x8b3d('0x43'),'value':_0x218cef[_0x8b3d('0x43')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef['attrs'][0x0]?_0x218cef['attrs'][0x0]['value']:undefined)||_0x8b3d('0x45')}];case _0x8b3d('0x46'):return[{'name':'attrPath','value':_0x218cef['attrPath']||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x0]?_0x218cef['attrs'][0x0][_0x8b3d('0x47')]:undefined)||''}];case _0x8b3d('0x48'):return[{'name':_0x8b3d('0x49'),'value':_0x218cef[_0x8b3d('0x49')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x0]?_0x218cef[_0x8b3d('0x44')][0x0][_0x8b3d('0x47')]:undefined)||_0x8b3d('0x4a')},{'name':_0x8b3d('0x4b'),'value':_0x218cef[_0x8b3d('0x4b')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x1]?_0x218cef[_0x8b3d('0x44')][0x1][_0x8b3d('0x47')]:undefined)||_0x8b3d('0x4c')},{'name':_0x8b3d('0x4d'),'value':_0x218cef[_0x8b3d('0x4d')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef['attrs'][0x2]?_0x218cef[_0x8b3d('0x44')][0x2]['value']:undefined)||0xc}];case _0x8b3d('0x4e'):return[{'name':'attrMetric','value':_0x218cef[_0x8b3d('0x4f')]||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x0]?_0x218cef[_0x8b3d('0x44')][0x0][_0x8b3d('0x47')]:undefined)||_0x8b3d('0x50')},{'name':_0x8b3d('0x51'),'value':_0x218cef[_0x8b3d('0x51')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x1]?_0x218cef['attrs'][0x1][_0x8b3d('0x47')]:undefined)||[]},{'name':_0x8b3d('0x4d'),'value':_0x218cef['attrFontSize']||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x2]?_0x218cef[_0x8b3d('0x44')][0x2][_0x8b3d('0x47')]:undefined)||0x14},{'name':_0x8b3d('0x52'),'value':_0x218cef[_0x8b3d('0x52')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x3]?_0x218cef[_0x8b3d('0x44')][0x3][_0x8b3d('0x47')]:undefined)||'voice'},{'name':_0x8b3d('0x53'),'value':_0x218cef['attrEmailAccounts']||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x4]?_0x218cef[_0x8b3d('0x44')][0x4][_0x8b3d('0x47')]:undefined)||''},{'name':_0x8b3d('0x54'),'value':_0x218cef['attrFaxAccounts']||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x5]?_0x218cef[_0x8b3d('0x44')][0x5][_0x8b3d('0x47')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x218cef[_0x8b3d('0x55')]||(_0x218cef['attrs']&&_0x218cef['attrs'][0x6]?_0x218cef[_0x8b3d('0x44')][0x6][_0x8b3d('0x47')]:undefined)||''},{'name':_0x8b3d('0x56'),'value':_0x218cef[_0x8b3d('0x56')]||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x7]?_0x218cef[_0x8b3d('0x44')][0x7]['value']:undefined)||''},{'name':_0x8b3d('0x57'),'value':_0x218cef[_0x8b3d('0x57')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x8]?_0x218cef[_0x8b3d('0x44')][0x8][_0x8b3d('0x47')]:undefined)||''},{'name':_0x8b3d('0x58'),'value':_0x218cef[_0x8b3d('0x58')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x9]?_0x218cef['attrs'][0x9][_0x8b3d('0x47')]:undefined)||''}];case'multibar-chart':case _0x8b3d('0x59'):return[{'name':'attrSerie1','value':_0x218cef[_0x8b3d('0x5a')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x0]?_0x218cef[_0x8b3d('0x44')][0x0]['value']:undefined)||_0x8b3d('0x50')},{'name':_0x8b3d('0x5b'),'value':_0x218cef[_0x8b3d('0x5b')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x1]?_0x218cef[_0x8b3d('0x44')][0x1]['value']:undefined)||null},{'name':_0x8b3d('0x5c'),'value':_0x218cef['attrSerie3']||(_0x218cef['attrs']&&_0x218cef['attrs'][0x2]?_0x218cef[_0x8b3d('0x44')][0x2]['value']:undefined)||null},{'name':_0x8b3d('0x51'),'value':_0x218cef[_0x8b3d('0x51')]||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x3]?_0x218cef[_0x8b3d('0x44')][0x3]['value']:undefined)||[]},{'name':_0x8b3d('0x52'),'value':_0x218cef[_0x8b3d('0x52')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x4]?_0x218cef[_0x8b3d('0x44')][0x4]['value']:undefined)||_0x8b3d('0x5d')},{'name':_0x8b3d('0x53'),'value':_0x218cef[_0x8b3d('0x53')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef['attrs'][0x5]?_0x218cef[_0x8b3d('0x44')][0x5][_0x8b3d('0x47')]:undefined)||''},{'name':_0x8b3d('0x54'),'value':_0x218cef[_0x8b3d('0x54')]||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x6]?_0x218cef[_0x8b3d('0x44')][0x6][_0x8b3d('0x47')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x218cef['attrSmsAccounts']||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x7]?_0x218cef[_0x8b3d('0x44')][0x7][_0x8b3d('0x47')]:undefined)||''},{'name':_0x8b3d('0x56'),'value':_0x218cef[_0x8b3d('0x56')]||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x8]?_0x218cef[_0x8b3d('0x44')][0x8][_0x8b3d('0x47')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x218cef['attrWhatsappAccounts']||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x9]?_0x218cef[_0x8b3d('0x44')][0x9][_0x8b3d('0x47')]:undefined)||''},{'name':'attrChatWebsites','value':_0x218cef['attrChatWebsites']||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0xa]?_0x218cef[_0x8b3d('0x44')][0xa][_0x8b3d('0x47')]:undefined)||''}];case _0x8b3d('0x5e'):return[{'name':_0x8b3d('0x5f'),'type':_0x218cef[_0x8b3d('0x60')]||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x0]?_0x218cef['attrs'][0x0]['type']:undefined)||null,'value':_0x218cef[_0x8b3d('0x5f')]||(_0x218cef['attrs']&&_0x218cef[_0x8b3d('0x44')][0x0]?_0x218cef[_0x8b3d('0x44')][0x0]['value']:undefined)||null},{'name':_0x8b3d('0x61'),'value':_0x218cef['attrRefresh']||(_0x218cef[_0x8b3d('0x44')]&&_0x218cef[_0x8b3d('0x44')][0x1]?_0x218cef[_0x8b3d('0x44')][0x1][_0x8b3d('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x1b6107){logger[_0x8b3d('0x2e')](_0x8b3d('0x62'),JSON[_0x8b3d('0x63')](_0x1b6107));return[];}}exports[_0x8b3d('0x64')]=function(_0x351cae,_0x1b0fa3){if(_0x351cae[_0x8b3d('0x65')]){_0x351cae[_0x8b3d('0x65')][_0x8b3d('0x44')]=widgetAttributes(_0x351cae[_0x8b3d('0x65')]);}return db['DashboardItem'][_0x8b3d('0x64')](_0x351cae[_0x8b3d('0x65')],{})[_0x8b3d('0x2c')](respondWithResult(_0x1b0fa3,0xc9))[_0x8b3d('0x42')](handleError(_0x1b0fa3,null));};exports[_0x8b3d('0x2b')]=function(_0x2c0648,_0x2707ab){if(_0x2c0648[_0x8b3d('0x65')]['id']){delete _0x2c0648[_0x8b3d('0x65')]['id'];}_0x2c0648[_0x8b3d('0x65')][_0x8b3d('0x44')]=widgetAttributes(_0x2c0648[_0x8b3d('0x65')]);return db[_0x8b3d('0x34')]['find']({'where':{'id':_0x2c0648[_0x8b3d('0x32')]['id']}})['then'](handleEntityNotFound(_0x2707ab,null))[_0x8b3d('0x2c')](saveUpdates(_0x2c0648[_0x8b3d('0x65')],null))[_0x8b3d('0x2c')](respondWithResult(_0x2707ab,null))[_0x8b3d('0x42')](handleError(_0x2707ab,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 14b1d02..a830f1c 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 _0x28f8=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x28f8,0x10a));var _0x828f=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0x28f8[_0x1c72b8];return _0x191114;};'use strict';var EventEmitter=require(_0x828f('0x0'));var DashboardItem=require(_0x828f('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x828f('0x2')](0x0);var events={'afterCreate':_0x828f('0x3'),'afterUpdate':_0x828f('0x4'),'afterDestroy':_0x828f('0x5')};function emitEvent(_0x44524b){return function(_0x428cd2,_0x2f3463,_0x43d66f){DashboardItemEvents[_0x828f('0x6')](_0x44524b+':'+_0x428cd2['id'],_0x428cd2);DashboardItemEvents['emit'](_0x44524b,_0x428cd2);_0x43d66f(null);};}for(var e in events){if(events[_0x828f('0x7')](e)){var event=events[e];DashboardItem[_0x828f('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xd7ec=['setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3f70e7,_0xa3d718){var _0x1e10fd=function(_0x3803b4){while(--_0x3803b4){_0x3f70e7['push'](_0x3f70e7['shift']());}};_0x1e10fd(++_0xa3d718);}(_0xd7ec,0x6e));var _0xcd7e=function(_0x233b57,_0x5b696b){_0x233b57=_0x233b57-0x0;var _0x5c3289=_0xd7ec[_0x233b57];return _0x5c3289;};'use strict';var EventEmitter=require(_0xcd7e('0x0'));var DashboardItem=require(_0xcd7e('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xcd7e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd7e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1879ac){return function(_0x4c39f8,_0x22e021,_0x3e0f5c){DashboardItemEvents[_0xcd7e('0x4')](_0x1879ac+':'+_0x4c39f8['id'],_0x4c39f8);DashboardItemEvents['emit'](_0x1879ac,_0x4c39f8);_0x3e0f5c(null);};}for(var e in events){if(events[_0xcd7e('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xcd7e('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 33a07db..3b6a0fe 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 _0xb9bd=['exports','define','dashboard_items','lodash','util','../../config/logger','api','moment','path','../../config/environment','./dashboardItem.attributes'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0xb9bd,0x9d));var _0xdb9b=function(_0x2cd192,_0x1199fa){_0x2cd192=_0x2cd192-0x0;var _0x430e57=_0xb9bd[_0x2cd192];return _0x430e57;};'use strict';var _=require(_0xdb9b('0x0'));var util=require(_0xdb9b('0x1'));var logger=require(_0xdb9b('0x2'))(_0xdb9b('0x3'));var moment=require(_0xdb9b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb9b('0x5'));var rimraf=require('rimraf');var config=require(_0xdb9b('0x6'));var attributes=require(_0xdb9b('0x7'));module[_0xdb9b('0x8')]=function(_0x58693c,_0x325837){return _0x58693c[_0xdb9b('0x9')]('DashboardItem',attributes,{'tableName':_0xdb9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdb5=['define','DashboardItem','dashboard_items','util','api','moment','bluebird','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x563d3d,_0x3dffbd){var _0x1831a0=function(_0x2b4587){while(--_0x2b4587){_0x563d3d['push'](_0x563d3d['shift']());}};_0x1831a0(++_0x3dffbd);}(_0xcdb5,0xb3));var _0x5cdb=function(_0x51a4c4,_0x5cef2e){_0x51a4c4=_0x51a4c4-0x0;var _0x47bf59=_0xcdb5[_0x51a4c4];return _0x47bf59;};'use strict';var _=require('lodash');var util=require(_0x5cdb('0x0'));var logger=require('../../config/logger')(_0x5cdb('0x1'));var moment=require(_0x5cdb('0x2'));var BPromise=require(_0x5cdb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5cdb('0x4'));var config=require(_0x5cdb('0x5'));var attributes=require(_0x5cdb('0x6'));module[_0x5cdb('0x7')]=function(_0x1319cc,_0x3af4b5){return _0x1319cc[_0x5cdb('0x8')](_0x5cdb('0x9'),attributes,{'tableName':_0x5cdb('0xa'),'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 afb9381..8633b4d 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 _0xb966=['error','message','DashboardItem,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug'];(function(_0x1f029b,_0x532b86){var _0x2fe524=function(_0x39d7d0){while(--_0x39d7d0){_0x1f029b['push'](_0x1f029b['shift']());}};_0x2fe524(++_0x532b86);}(_0xb966,0xe4));var _0x6b96=function(_0x1e8fc2,_0x33aac3){_0x1e8fc2=_0x1e8fc2-0x0;var _0x541046=_0xb966[_0x1e8fc2];return _0x541046;};'use strict';var _=require(_0x6b96('0x0'));var util=require(_0x6b96('0x1'));var moment=require(_0x6b96('0x2'));var BPromise=require(_0x6b96('0x3'));var rs=require(_0x6b96('0x4'));var fs=require('fs');var Redis=require(_0x6b96('0x5'));var db=require(_0x6b96('0x6'))['db'];var utils=require(_0x6b96('0x7'));var logger=require(_0x6b96('0x8'))(_0x6b96('0x9'));var config=require(_0x6b96('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6b96('0xb')][_0x6b96('0xc')]({'port':0x232a});config[_0x6b96('0xd')]=_[_0x6b96('0xe')](config[_0x6b96('0xd')],{'host':_0x6b96('0xf'),'port':0x18eb});var socket=require(_0x6b96('0x10'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x6b96('0x11')](socket);function respondWithRpcPromise(_0x241ef9,_0x250cb3,_0x43e5c2){return new BPromise(function(_0x3056f6,_0x328267){return client['request'](_0x241ef9,_0x43e5c2)[_0x6b96('0x12')](function(_0x2e5df6){logger[_0x6b96('0x13')]('DashboardItem,\x20%s,\x20%s',_0x250cb3,_0x6b96('0x14'));logger[_0x6b96('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x250cb3,_0x6b96('0x14'),JSON['stringify'](_0x2e5df6));if(_0x2e5df6[_0x6b96('0x16')]){if(_0x2e5df6[_0x6b96('0x16')]['code']===0x1f4){logger[_0x6b96('0x16')]('DashboardItem,\x20%s,\x20%s',_0x250cb3,_0x2e5df6[_0x6b96('0x16')][_0x6b96('0x17')]);return _0x328267(_0x2e5df6[_0x6b96('0x16')]['message']);}logger['error'](_0x6b96('0x18'),_0x250cb3,_0x2e5df6[_0x6b96('0x16')][_0x6b96('0x17')]);return _0x3056f6(_0x2e5df6[_0x6b96('0x16')]['message']);}else{logger[_0x6b96('0x13')](_0x6b96('0x18'),_0x250cb3,_0x6b96('0x14'));_0x3056f6(_0x2e5df6['result']['message']);}})['catch'](function(_0x1abe96){logger[_0x6b96('0x16')](_0x6b96('0x18'),_0x250cb3,_0x1abe96);_0x328267(_0x1abe96);});});} \ No newline at end of file +var _0x00dc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','util','bluebird','randomstring'];(function(_0x4eb6dc,_0x3dc261){var _0x3068b4=function(_0x49f403){while(--_0x49f403){_0x4eb6dc['push'](_0x4eb6dc['shift']());}};_0x3068b4(++_0x3dc261);}(_0x00dc,0x101));var _0xc00d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x00dc[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xc00d('0x0'));var moment=require('moment');var BPromise=require(_0xc00d('0x1'));var rs=require(_0xc00d('0x2'));var fs=require('fs');var Redis=require(_0xc00d('0x3'));var db=require(_0xc00d('0x4'))['db'];var utils=require(_0xc00d('0x5'));var logger=require(_0xc00d('0x6'))(_0xc00d('0x7'));var config=require(_0xc00d('0x8'));var jayson=require(_0xc00d('0x9'));var client=jayson[_0xc00d('0xa')][_0xc00d('0xb')]({'port':0x232a});config[_0xc00d('0xc')]=_[_0xc00d('0xd')](config[_0xc00d('0xc')],{'host':_0xc00d('0xe'),'port':0x18eb});var socket=require(_0xc00d('0xf'))(new Redis(config[_0xc00d('0xc')]));require('./dashboardItem.socket')[_0xc00d('0x10')](socket);function respondWithRpcPromise(_0x19c19e,_0x5748fc,_0x2bd2b3){return new BPromise(function(_0x218ec7,_0x28d4dd){return client['request'](_0x19c19e,_0x2bd2b3)[_0xc00d('0x11')](function(_0x953d6f){logger[_0xc00d('0x12')]('DashboardItem,\x20%s,\x20%s',_0x5748fc,_0xc00d('0x13'));logger[_0xc00d('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5748fc,'request\x20sent',JSON[_0xc00d('0x15')](_0x953d6f));if(_0x953d6f[_0xc00d('0x16')]){if(_0x953d6f[_0xc00d('0x16')]['code']===0x1f4){logger['error'](_0xc00d('0x17'),_0x5748fc,_0x953d6f[_0xc00d('0x16')]['message']);return _0x28d4dd(_0x953d6f[_0xc00d('0x16')][_0xc00d('0x18')]);}logger[_0xc00d('0x16')]('DashboardItem,\x20%s,\x20%s',_0x5748fc,_0x953d6f[_0xc00d('0x16')]['message']);return _0x218ec7(_0x953d6f[_0xc00d('0x16')]['message']);}else{logger[_0xc00d('0x12')](_0xc00d('0x17'),_0x5748fc,_0xc00d('0x13'));_0x218ec7(_0x953d6f[_0xc00d('0x19')]['message']);}})['catch'](function(_0x1b7463){logger[_0xc00d('0x16')]('DashboardItem,\x20%s,\x20%s',_0x5748fc,_0x1b7463);_0x28d4dd(_0x1b7463);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 24eddbc..cd2d85c 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 _0xc237=['remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x54e523,_0xfc81fc){var _0x1a8c62=function(_0x37401c){while(--_0x37401c){_0x54e523['push'](_0x54e523['shift']());}};_0x1a8c62(++_0xfc81fc);}(_0xc237,0x7e));var _0x7c23=function(_0x5691f2,_0x1b4aba){_0x5691f2=_0x5691f2-0x0;var _0x1605c6=_0xc237[_0x5691f2];return _0x1605c6;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x7c23('0x0'),_0x7c23('0x1')];function createListener(_0x57d839,_0x59ec8f){return function(_0x91b75a){_0x59ec8f[_0x7c23('0x2')](_0x57d839,_0x91b75a);};}function removeListener(_0x252363,_0x119c06){return function(){DashboardItemEvents[_0x7c23('0x3')](_0x252363,_0x119c06);};}exports[_0x7c23('0x4')]=function(_0x302ca8){for(var _0x440f14=0x0,_0x46421d=events[_0x7c23('0x5')];_0x440f14<_0x46421d;_0x440f14++){var _0x5e42ed=events[_0x440f14];var _0x51f698=createListener(_0x7c23('0x6')+_0x5e42ed,_0x302ca8);DashboardItemEvents['on'](_0x5e42ed,_0x51f698);}}; \ No newline at end of file +var _0xb6b6=['removeListener','register','length','save','remove','emit'];(function(_0x3f4fc0,_0x29d7c7){var _0x5dca9e=function(_0x3e6366){while(--_0x3e6366){_0x3f4fc0['push'](_0x3f4fc0['shift']());}};_0x5dca9e(++_0x29d7c7);}(_0xb6b6,0x117));var _0x6b6b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb6b6[_0x4b055c];return _0x4b62bb;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x6b6b('0x0'),_0x6b6b('0x1'),'update'];function createListener(_0xf226d1,_0x3ae943){return function(_0x45eee0){_0x3ae943[_0x6b6b('0x2')](_0xf226d1,_0x45eee0);};}function removeListener(_0x1320ca,_0x3184aa){return function(){DashboardItemEvents[_0x6b6b('0x3')](_0x1320ca,_0x3184aa);};}exports[_0x6b6b('0x4')]=function(_0x92bfe6){for(var _0xa2eb12=0x0,_0x4c6417=events[_0x6b6b('0x5')];_0xa2eb12<_0x4c6417;_0xa2eb12++){var _0x7ddd1f=events[_0xa2eb12];var _0x5227ac=createListener('dashboardItem:'+_0x7ddd1f,_0x92bfe6);DashboardItemEvents['on'](_0x7ddd1f,_0x5227ac);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 22607ff..e5e78c3 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 _0x1703=['get','/:id','post','isAuthenticated','create','put','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0xc1d4dc,_0x37e5b0){var _0x327c78=function(_0x2d7343){while(--_0x2d7343){_0xc1d4dc['push'](_0xc1d4dc['shift']());}};_0x327c78(++_0x37e5b0);}(_0x1703,0x6e));var _0x3170=function(_0x711e59,_0x5b35fa){_0x711e59=_0x711e59-0x0;var _0x5edcc7=_0x1703[_0x711e59];return _0x5edcc7;};'use strict';var multer=require(_0x3170('0x0'));var util=require(_0x3170('0x1'));var path=require(_0x3170('0x2'));var timeout=require('connect-timeout');var express=require(_0x3170('0x3'));var router=express['Router']();var fs_extra=require(_0x3170('0x4'));var auth=require(_0x3170('0x5'));var interaction=require(_0x3170('0x6'));var config=require(_0x3170('0x7'));var controller=require(_0x3170('0x8'));router[_0x3170('0x9')](_0x3170('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3170('0xb')]('/',auth[_0x3170('0xc')](),controller[_0x3170('0xd')]);router[_0x3170('0xe')](_0x3170('0xa'),auth[_0x3170('0xc')](),controller[_0x3170('0xf')]);router['delete'](_0x3170('0xa'),auth[_0x3170('0xc')](),controller['destroy']);module[_0x3170('0x10')]=router; \ No newline at end of file +var _0x3153=['show','create','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x3153,0x150));var _0x3315=function(_0x9ce548,_0x15e945){_0x9ce548=_0x9ce548-0x0;var _0xc88241=_0x3153[_0x9ce548];return _0xc88241;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3315('0x0'));var express=require(_0x3315('0x1'));var router=express[_0x3315('0x2')]();var fs_extra=require(_0x3315('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3315('0x4'));var config=require(_0x3315('0x5'));var controller=require('./dashboardItem.controller');router[_0x3315('0x6')](_0x3315('0x7'),auth[_0x3315('0x8')](),controller[_0x3315('0x9')]);router['post']('/',auth[_0x3315('0x8')](),controller[_0x3315('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3315('0xb')]);router[_0x3315('0xc')](_0x3315('0x7'),auth[_0x3315('0x8')](),controller[_0x3315('0xd')]);module[_0x3315('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 44399ad..01e9a0a 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 _0x75f0=['STRING','second','third','first','sequelize','exports'];(function(_0x31021e,_0x248900){var _0x1e6fe5=function(_0x420acf){while(--_0x420acf){_0x31021e['push'](_0x31021e['shift']());}};_0x1e6fe5(++_0x248900);}(_0x75f0,0x124));var _0x075f=function(_0x12d9ab,_0x4e8449){_0x12d9ab=_0x12d9ab-0x0;var _0x24a304=_0x75f0[_0x12d9ab];return _0x24a304;};'use strict';var Sequelize=require(_0x075f('0x0'));module[_0x075f('0x1')]={'name':{'type':Sequelize[_0x075f('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x075f('0x3'),_0x075f('0x4')),'allowNull':![],'defaultValue':_0x075f('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x08a5=['sequelize','STRING','first','second','third'];(function(_0x19e52c,_0x3f541a){var _0xb543c0=function(_0x5aecdb){while(--_0x5aecdb){_0x19e52c['push'](_0x19e52c['shift']());}};_0xb543c0(++_0x3f541a);}(_0x08a5,0x1e0));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x508a('0x0'));module['exports']={'name':{'type':Sequelize[_0x508a('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x508a('0x2'),_0x508a('0x3'),_0x508a('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x508a('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 50e266f..9114ec5 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 _0x29ae=['Dispositions','UserProfileResource','end','error','stack','name','send','map','Disposition','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','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','get'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x29ae,0x167));var _0xe29a=function(_0x270fa4,_0x1f8546){_0x270fa4=_0x270fa4-0x0;var _0x1239df=_0x29ae[_0x270fa4];return _0x1239df;};'use strict';var emlformat=require(_0xe29a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe29a('0x1'));var moment=require(_0xe29a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe29a('0x3'));var util=require('util');var path=require(_0xe29a('0x4'));var sox=require(_0xe29a('0x5'));var csv=require(_0xe29a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe29a('0x7'));var _=require(_0xe29a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe29a('0x9'));var deskjs=require(_0xe29a('0xa'));var toCsv=require(_0xe29a('0x6'));var querystring=require(_0xe29a('0xb'));var Papa=require(_0xe29a('0xc'));var Redis=require(_0xe29a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe29a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe29a('0xf'));var logger=require(_0xe29a('0x10'))(_0xe29a('0x11'));var utils=require(_0xe29a('0x12'));var config=require(_0xe29a('0x13'));var licenseUtil=require(_0xe29a('0x14'));var db=require(_0xe29a('0x15'))['db'];function respondWithStatusCode(_0x210dcc,_0x254cc4){_0x254cc4=_0x254cc4||0xcc;return function(_0x26f895){if(_0x26f895){return _0x210dcc[_0xe29a('0x16')](_0x254cc4);}return _0x210dcc[_0xe29a('0x17')](_0x254cc4)['end']();};}function respondWithResult(_0x5d47de,_0x3282a5){_0x3282a5=_0x3282a5||0xc8;return function(_0x54817c){if(_0x54817c){return _0x5d47de[_0xe29a('0x17')](_0x3282a5)[_0xe29a('0x18')](_0x54817c);}};}function respondWithFilteredResult(_0x2904aa,_0x119b48){return function(_0xdd0d3b){if(_0xdd0d3b){var _0x84ba57=typeof _0x119b48[_0xe29a('0x19')]===_0xe29a('0x1a')&&typeof _0x119b48[_0xe29a('0x1b')]===_0xe29a('0x1a');var _0x4ec604=_0xdd0d3b[_0xe29a('0x1c')];var _0x61ff63=_0x84ba57?0x0:_0x119b48[_0xe29a('0x19')];var _0x17268d=_0x84ba57?_0xdd0d3b[_0xe29a('0x1c')]:_0x119b48[_0xe29a('0x19')]+_0x119b48[_0xe29a('0x1b')];var _0xe62dd7;if(_0x17268d>=_0x4ec604){_0x17268d=_0x4ec604;_0xe62dd7=0xc8;}else{_0xe62dd7=0xce;}_0x2904aa[_0xe29a('0x17')](_0xe62dd7);return _0x2904aa[_0xe29a('0x1d')]('Content-Range',_0x61ff63+'-'+_0x17268d+'/'+_0x4ec604)[_0xe29a('0x18')](_0xdd0d3b);}return null;};}function patchUpdates(_0x52e6e8){return function(_0x2955ae){try{jsonpatch['apply'](_0x2955ae,_0x52e6e8,!![]);}catch(_0x3f876f){return BPromise[_0xe29a('0x1e')](_0x3f876f);}return _0x2955ae[_0xe29a('0x1f')]();};}function saveUpdates(_0x4a155f,_0x568a78){return function(_0x493a6a){if(_0x493a6a){return _0x493a6a[_0xe29a('0x20')](_0x4a155f)[_0xe29a('0x21')](function(_0xe17fb3){return _0xe17fb3;});}return null;};}function removeEntity(_0x4f3021,_0xc93894){return function(_0x489203){if(_0x489203){return _0x489203[_0xe29a('0x22')]()[_0xe29a('0x21')](function(){var _0x22ffab=_0x489203[_0xe29a('0x23')]({'plain':!![]});var _0x391d3a=_0xe29a('0x24');return db[_0xe29a('0x25')][_0xe29a('0x22')]({'where':{'type':_0x391d3a,'resourceId':_0x22ffab['id']}})[_0xe29a('0x21')](function(){return _0x489203;});})[_0xe29a('0x21')](function(){_0x4f3021['status'](0xcc)[_0xe29a('0x26')]();});}};}function handleEntityNotFound(_0x303256,_0x54b9fc){return function(_0x1d1656){if(!_0x1d1656){_0x303256[_0xe29a('0x16')](0x194);}return _0x1d1656;};}function handleError(_0x4462e0,_0x5bf1c1){_0x5bf1c1=_0x5bf1c1||0x1f4;return function(_0x412faa){logger[_0xe29a('0x27')](_0x412faa[_0xe29a('0x28')]);if(_0x412faa['name']){delete _0x412faa[_0xe29a('0x29')];}_0x4462e0[_0xe29a('0x17')](_0x5bf1c1)[_0xe29a('0x2a')](_0x412faa);};}exports['index']=function(_0x1a59d7,_0x2ae50d){var _0x2e73ca={},_0x1f533f={},_0x14fee1={'count':0x0,'rows':[]};var _0x261e8e=_[_0xe29a('0x2b')](db[_0xe29a('0x2c')]['rawAttributes'],function(_0x2368e9){return{'name':_0x2368e9[_0xe29a('0x2d')],'type':_0x2368e9[_0xe29a('0x2e')]['key']};});_0x1f533f[_0xe29a('0x2f')]=_[_0xe29a('0x2b')](_0x261e8e,'name');_0x1f533f[_0xe29a('0x30')]=_[_0xe29a('0x31')](_0x1a59d7[_0xe29a('0x30')]);_0x1f533f[_0xe29a('0x32')]=_[_0xe29a('0x33')](_0x1f533f[_0xe29a('0x2f')],_0x1f533f[_0xe29a('0x30')]);_0x2e73ca[_0xe29a('0x34')]=_[_0xe29a('0x33')](_0x1f533f[_0xe29a('0x2f')],qs['fields'](_0x1a59d7['query']['fields']));_0x2e73ca[_0xe29a('0x34')]=_0x2e73ca['attributes'][_0xe29a('0x35')]?_0x2e73ca[_0xe29a('0x34')]:_0x1f533f[_0xe29a('0x2f')];if(!_0x1a59d7['query']['hasOwnProperty'](_0xe29a('0x36'))){_0x2e73ca[_0xe29a('0x1b')]=qs['limit'](_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x1b')]);_0x2e73ca[_0xe29a('0x19')]=qs[_0xe29a('0x19')](_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x19')]);}_0x2e73ca['order']=qs[_0xe29a('0x37')](_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x37')]);_0x2e73ca['where']=qs[_0xe29a('0x32')](_[_0xe29a('0x38')](_0x1a59d7[_0xe29a('0x30')],_0x1f533f[_0xe29a('0x32')]),_0x261e8e);if(_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x39')]){_0x2e73ca[_0xe29a('0x3a')]=_[_0xe29a('0x3b')](_0x2e73ca[_0xe29a('0x3a')],{'$or':_[_0xe29a('0x2b')](_0x261e8e,function(_0x4800c3){if(_0x4800c3[_0xe29a('0x2e')]!==_0xe29a('0x3c')){var _0x4da83f={};_0x4da83f[_0x4800c3['name']]={'$like':'%'+_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x39')]+'%'};return _0x4da83f;}})});}_0x2e73ca=_[_0xe29a('0x3b')]({},_0x2e73ca,_0x1a59d7[_0xe29a('0x3d')]);var _0x28d911={'where':_0x2e73ca[_0xe29a('0x3a')]};return db[_0xe29a('0x2c')]['count'](_0x28d911)[_0xe29a('0x21')](function(_0x22d78d){_0x14fee1[_0xe29a('0x1c')]=_0x22d78d;if(_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x3e')]){_0x2e73ca['include']=[{'all':!![]}];}return db[_0xe29a('0x2c')][_0xe29a('0x3f')](_0x2e73ca);})['then'](function(_0x3368b2){_0x14fee1[_0xe29a('0x40')]=_0x3368b2;return _0x14fee1;})[_0xe29a('0x21')](respondWithFilteredResult(_0x2ae50d,_0x2e73ca))[_0xe29a('0x41')](handleError(_0x2ae50d,null));};exports[_0xe29a('0x42')]=function(_0x3bc29d,_0x2c211c){var _0xe1ba22={'raw':!![],'where':{'id':_0x3bc29d['params']['id']}},_0x1e2310={};_0x1e2310[_0xe29a('0x2f')]=_[_0xe29a('0x31')](db[_0xe29a('0x2c')][_0xe29a('0x43')]);_0x1e2310[_0xe29a('0x30')]=_[_0xe29a('0x31')](_0x3bc29d['query']);_0x1e2310['filters']=_['intersection'](_0x1e2310[_0xe29a('0x2f')],_0x1e2310[_0xe29a('0x30')]);_0xe1ba22[_0xe29a('0x34')]=_[_0xe29a('0x33')](_0x1e2310[_0xe29a('0x2f')],qs['fields'](_0x3bc29d['query'][_0xe29a('0x44')]));_0xe1ba22[_0xe29a('0x34')]=_0xe1ba22[_0xe29a('0x34')]['length']?_0xe1ba22[_0xe29a('0x34')]:_0x1e2310[_0xe29a('0x2f')];if(_0x3bc29d[_0xe29a('0x30')]['includeAll']){_0xe1ba22[_0xe29a('0x45')]=[{'all':!![]}];}_0xe1ba22=_[_0xe29a('0x3b')]({},_0xe1ba22,_0x3bc29d[_0xe29a('0x3d')]);return db[_0xe29a('0x2c')][_0xe29a('0x46')](_0xe1ba22)[_0xe29a('0x21')](handleEntityNotFound(_0x2c211c,null))[_0xe29a('0x21')](respondWithResult(_0x2c211c,null))['catch'](handleError(_0x2c211c,null));};exports[_0xe29a('0x47')]=function(_0x2a1f1d,_0x18dc09){return db[_0xe29a('0x2c')]['create'](_0x2a1f1d[_0xe29a('0x48')],{})['then'](function(_0x53fbb2){var _0x4822a9=_0x2a1f1d[_0xe29a('0x49')][_0xe29a('0x23')]({'plain':!![]});if(!_0x4822a9)throw new Error(_0xe29a('0x4a'));if(_0x4822a9['role']==='user'){var _0x3510b7=_0x53fbb2['get']({'plain':!![]});var _0x3933a3=_0xe29a('0x24');return db[_0xe29a('0x4b')][_0xe29a('0x46')]({'where':{'name':_0x3933a3,'userProfileId':_0x4822a9[_0xe29a('0x4c')]},'raw':!![]})[_0xe29a('0x21')](function(_0x216a44){if(_0x216a44&&_0x216a44['autoAssociation']===0x0){return db[_0xe29a('0x25')][_0xe29a('0x47')]({'name':_0x3510b7[_0xe29a('0x29')],'resourceId':_0x3510b7['id'],'type':_0x216a44[_0xe29a('0x29')],'sectionId':_0x216a44['id']},{})[_0xe29a('0x21')](function(){return _0x53fbb2;});}else{return _0x53fbb2;}})[_0xe29a('0x41')](function(_0x5ecee0){logger[_0xe29a('0x27')](_0xe29a('0x4d'),_0x5ecee0);throw _0x5ecee0;});}return _0x53fbb2;})[_0xe29a('0x21')](respondWithResult(_0x18dc09,0xc9))[_0xe29a('0x41')](handleError(_0x18dc09,null));};exports['update']=function(_0x23145a,_0x30d824){if(_0x23145a[_0xe29a('0x48')]['id']){delete _0x23145a[_0xe29a('0x48')]['id'];}return db['Disposition'][_0xe29a('0x46')]({'where':{'id':_0x23145a[_0xe29a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x30d824,null))[_0xe29a('0x21')](saveUpdates(_0x23145a['body'],null))[_0xe29a('0x21')](respondWithResult(_0x30d824,null))['catch'](handleError(_0x30d824,null));};exports['destroy']=function(_0x41ccf2,_0x230d74){return db[_0xe29a('0x2c')][_0xe29a('0x46')]({'where':{'id':_0x41ccf2[_0xe29a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x230d74,null))[_0xe29a('0x21')](removeEntity(_0x230d74,null))[_0xe29a('0x41')](handleError(_0x230d74,null));}; \ No newline at end of file +var _0x2e63=['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/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','Disposition','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','length','nolimit','order','sort','where','filters','merge','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x2e63,0x14d));var _0x32e6=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x2e63[_0x2a5b3b];return _0xae665a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32e6('0x0'));var zipdir=require(_0x32e6('0x1'));var jsonpatch=require(_0x32e6('0x2'));var rp=require(_0x32e6('0x3'));var moment=require(_0x32e6('0x4'));var BPromise=require(_0x32e6('0x5'));var Mustache=require(_0x32e6('0x6'));var util=require('util');var path=require(_0x32e6('0x7'));var sox=require(_0x32e6('0x8'));var csv=require(_0x32e6('0x9'));var ejs=require(_0x32e6('0xa'));var fs=require('fs');var fs_extra=require(_0x32e6('0xb'));var _=require(_0x32e6('0xc'));var squel=require(_0x32e6('0xd'));var crypto=require(_0x32e6('0xe'));var jsforce=require(_0x32e6('0xf'));var deskjs=require(_0x32e6('0x10'));var toCsv=require(_0x32e6('0x9'));var querystring=require(_0x32e6('0x11'));var Papa=require('papaparse');var Redis=require(_0x32e6('0x12'));var authService=require(_0x32e6('0x13'));var qs=require(_0x32e6('0x14'));var as=require(_0x32e6('0x15'));var hardwareService=require(_0x32e6('0x16'));var logger=require('../../config/logger')(_0x32e6('0x17'));var utils=require(_0x32e6('0x18'));var config=require(_0x32e6('0x19'));var licenseUtil=require(_0x32e6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4eeb77,_0x124205){_0x124205=_0x124205||0xcc;return function(_0x52b1e7){if(_0x52b1e7){return _0x4eeb77[_0x32e6('0x1b')](_0x124205);}return _0x4eeb77['status'](_0x124205)[_0x32e6('0x1c')]();};}function respondWithResult(_0x46a7fd,_0x3c069f){_0x3c069f=_0x3c069f||0xc8;return function(_0x2c8599){if(_0x2c8599){return _0x46a7fd[_0x32e6('0x1d')](_0x3c069f)[_0x32e6('0x1e')](_0x2c8599);}};}function respondWithFilteredResult(_0xbe49dc,_0x421c13){return function(_0x155a90){if(_0x155a90){var _0x37dea8=typeof _0x421c13[_0x32e6('0x1f')]===_0x32e6('0x20')&&typeof _0x421c13[_0x32e6('0x21')]==='undefined';var _0x25264d=_0x155a90[_0x32e6('0x22')];var _0x15bc70=_0x37dea8?0x0:_0x421c13[_0x32e6('0x1f')];var _0x353ec7=_0x37dea8?_0x155a90[_0x32e6('0x22')]:_0x421c13['offset']+_0x421c13[_0x32e6('0x21')];var _0x347a37;if(_0x353ec7>=_0x25264d){_0x353ec7=_0x25264d;_0x347a37=0xc8;}else{_0x347a37=0xce;}_0xbe49dc[_0x32e6('0x1d')](_0x347a37);return _0xbe49dc[_0x32e6('0x23')](_0x32e6('0x24'),_0x15bc70+'-'+_0x353ec7+'/'+_0x25264d)[_0x32e6('0x1e')](_0x155a90);}return null;};}function patchUpdates(_0x2318e2){return function(_0x813861){try{jsonpatch[_0x32e6('0x25')](_0x813861,_0x2318e2,!![]);}catch(_0x4ac106){return BPromise[_0x32e6('0x26')](_0x4ac106);}return _0x813861['save']();};}function saveUpdates(_0x4de3da,_0x4ae07d){return function(_0x52c824){if(_0x52c824){return _0x52c824[_0x32e6('0x27')](_0x4de3da)[_0x32e6('0x28')](function(_0x320d2d){return _0x320d2d;});}return null;};}function removeEntity(_0x264779,_0x168c5b){return function(_0x150bbc){if(_0x150bbc){return _0x150bbc[_0x32e6('0x29')]()[_0x32e6('0x28')](function(){var _0x3c3cfe=_0x150bbc[_0x32e6('0x2a')]({'plain':!![]});var _0x3dff6c=_0x32e6('0x2b');return db[_0x32e6('0x2c')][_0x32e6('0x29')]({'where':{'type':_0x3dff6c,'resourceId':_0x3c3cfe['id']}})['then'](function(){return _0x150bbc;});})[_0x32e6('0x28')](function(){_0x264779[_0x32e6('0x1d')](0xcc)[_0x32e6('0x1c')]();});}};}function handleEntityNotFound(_0x2bc879,_0x235b3f){return function(_0x31b51d){if(!_0x31b51d){_0x2bc879[_0x32e6('0x1b')](0x194);}return _0x31b51d;};}function handleError(_0x4d9b38,_0x872f35){_0x872f35=_0x872f35||0x1f4;return function(_0xf3a90e){logger[_0x32e6('0x2d')](_0xf3a90e[_0x32e6('0x2e')]);if(_0xf3a90e[_0x32e6('0x2f')]){delete _0xf3a90e['name'];}_0x4d9b38[_0x32e6('0x1d')](_0x872f35)[_0x32e6('0x30')](_0xf3a90e);};}exports[_0x32e6('0x31')]=function(_0x4c22db,_0x49ef99){var _0x3d6fe3={},_0x22f2ec={},_0x2c353f={'count':0x0,'rows':[]};var _0xe1ebee=_['map'](db[_0x32e6('0x32')][_0x32e6('0x33')],function(_0x2a73da){return{'name':_0x2a73da[_0x32e6('0x34')],'type':_0x2a73da['type'][_0x32e6('0x35')]};});_0x22f2ec['model']=_[_0x32e6('0x36')](_0xe1ebee,'name');_0x22f2ec[_0x32e6('0x37')]=_[_0x32e6('0x38')](_0x4c22db[_0x32e6('0x37')]);_0x22f2ec['filters']=_[_0x32e6('0x39')](_0x22f2ec[_0x32e6('0x3a')],_0x22f2ec[_0x32e6('0x37')]);_0x3d6fe3[_0x32e6('0x3b')]=_[_0x32e6('0x39')](_0x22f2ec['model'],qs['fields'](_0x4c22db['query']['fields']));_0x3d6fe3[_0x32e6('0x3b')]=_0x3d6fe3[_0x32e6('0x3b')][_0x32e6('0x3c')]?_0x3d6fe3[_0x32e6('0x3b')]:_0x22f2ec['model'];if(!_0x4c22db[_0x32e6('0x37')]['hasOwnProperty'](_0x32e6('0x3d'))){_0x3d6fe3[_0x32e6('0x21')]=qs[_0x32e6('0x21')](_0x4c22db['query'][_0x32e6('0x21')]);_0x3d6fe3[_0x32e6('0x1f')]=qs[_0x32e6('0x1f')](_0x4c22db[_0x32e6('0x37')][_0x32e6('0x1f')]);}_0x3d6fe3[_0x32e6('0x3e')]=qs['sort'](_0x4c22db[_0x32e6('0x37')][_0x32e6('0x3f')]);_0x3d6fe3[_0x32e6('0x40')]=qs[_0x32e6('0x41')](_['pick'](_0x4c22db['query'],_0x22f2ec['filters']),_0xe1ebee);if(_0x4c22db['query']['filter']){_0x3d6fe3[_0x32e6('0x40')]=_['merge'](_0x3d6fe3[_0x32e6('0x40')],{'$or':_[_0x32e6('0x36')](_0xe1ebee,function(_0x4a8bdc){if(_0x4a8bdc['type']!=='VIRTUAL'){var _0x2eca2d={};_0x2eca2d[_0x4a8bdc['name']]={'$like':'%'+_0x4c22db[_0x32e6('0x37')]['filter']+'%'};return _0x2eca2d;}})});}_0x3d6fe3=_[_0x32e6('0x42')]({},_0x3d6fe3,_0x4c22db['options']);var _0x40220c={'where':_0x3d6fe3[_0x32e6('0x40')]};return db[_0x32e6('0x32')]['count'](_0x40220c)[_0x32e6('0x28')](function(_0x561bfe){_0x2c353f['count']=_0x561bfe;if(_0x4c22db['query'][_0x32e6('0x43')]){_0x3d6fe3[_0x32e6('0x44')]=[{'all':!![]}];}return db[_0x32e6('0x32')][_0x32e6('0x45')](_0x3d6fe3);})[_0x32e6('0x28')](function(_0xa2f5ad){_0x2c353f[_0x32e6('0x46')]=_0xa2f5ad;return _0x2c353f;})['then'](respondWithFilteredResult(_0x49ef99,_0x3d6fe3))['catch'](handleError(_0x49ef99,null));};exports[_0x32e6('0x47')]=function(_0x93dbcb,_0x20d43a){var _0x13b5d1={'raw':!![],'where':{'id':_0x93dbcb[_0x32e6('0x48')]['id']}},_0x2d47c4={};_0x2d47c4['model']=_[_0x32e6('0x38')](db[_0x32e6('0x32')][_0x32e6('0x33')]);_0x2d47c4[_0x32e6('0x37')]=_[_0x32e6('0x38')](_0x93dbcb['query']);_0x2d47c4[_0x32e6('0x41')]=_[_0x32e6('0x39')](_0x2d47c4[_0x32e6('0x3a')],_0x2d47c4['query']);_0x13b5d1['attributes']=_[_0x32e6('0x39')](_0x2d47c4[_0x32e6('0x3a')],qs[_0x32e6('0x49')](_0x93dbcb[_0x32e6('0x37')]['fields']));_0x13b5d1[_0x32e6('0x3b')]=_0x13b5d1[_0x32e6('0x3b')][_0x32e6('0x3c')]?_0x13b5d1[_0x32e6('0x3b')]:_0x2d47c4['model'];if(_0x93dbcb[_0x32e6('0x37')]['includeAll']){_0x13b5d1[_0x32e6('0x44')]=[{'all':!![]}];}_0x13b5d1=_[_0x32e6('0x42')]({},_0x13b5d1,_0x93dbcb[_0x32e6('0x4a')]);return db[_0x32e6('0x32')][_0x32e6('0x4b')](_0x13b5d1)['then'](handleEntityNotFound(_0x20d43a,null))[_0x32e6('0x28')](respondWithResult(_0x20d43a,null))[_0x32e6('0x4c')](handleError(_0x20d43a,null));};exports[_0x32e6('0x4d')]=function(_0x5c4c05,_0x11d0a5){return db[_0x32e6('0x32')][_0x32e6('0x4d')](_0x5c4c05[_0x32e6('0x4e')],{})[_0x32e6('0x28')](function(_0xc6f95f){var _0x3eae80=_0x5c4c05['user'][_0x32e6('0x2a')]({'plain':!![]});if(!_0x3eae80)throw new Error(_0x32e6('0x4f'));if(_0x3eae80['role']===_0x32e6('0x50')){var _0x2a067a=_0xc6f95f['get']({'plain':!![]});var _0x5f1180=_0x32e6('0x2b');return db[_0x32e6('0x51')][_0x32e6('0x4b')]({'where':{'name':_0x5f1180,'userProfileId':_0x3eae80[_0x32e6('0x52')]},'raw':!![]})['then'](function(_0x2bd175){if(_0x2bd175&&_0x2bd175[_0x32e6('0x53')]===0x0){return db['UserProfileResource'][_0x32e6('0x4d')]({'name':_0x2a067a[_0x32e6('0x2f')],'resourceId':_0x2a067a['id'],'type':_0x2bd175[_0x32e6('0x2f')],'sectionId':_0x2bd175['id']},{})[_0x32e6('0x28')](function(){return _0xc6f95f;});}else{return _0xc6f95f;}})[_0x32e6('0x4c')](function(_0x2b0cb2){logger[_0x32e6('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b0cb2);throw _0x2b0cb2;});}return _0xc6f95f;})['then'](respondWithResult(_0x11d0a5,0xc9))[_0x32e6('0x4c')](handleError(_0x11d0a5,null));};exports['update']=function(_0x191648,_0x5b920f){if(_0x191648['body']['id']){delete _0x191648[_0x32e6('0x4e')]['id'];}return db['Disposition']['find']({'where':{'id':_0x191648[_0x32e6('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b920f,null))[_0x32e6('0x28')](saveUpdates(_0x191648[_0x32e6('0x4e')],null))[_0x32e6('0x28')](respondWithResult(_0x5b920f,null))[_0x32e6('0x4c')](handleError(_0x5b920f,null));};exports[_0x32e6('0x29')]=function(_0x1db583,_0x57d66f){return db[_0x32e6('0x32')][_0x32e6('0x4b')]({'where':{'id':_0x1db583['params']['id']}})['then'](handleEntityNotFound(_0x57d66f,null))[_0x32e6('0x28')](removeEntity(_0x57d66f,null))['catch'](handleError(_0x57d66f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 2c7a60e..a42411c 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 _0x7487=['exports','define','tools_dispositions','ListId','name_chat','name_mail','name','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1bcd40,_0x1c6d08){var _0x474167=function(_0x5ba1bf){while(--_0x5ba1bf){_0x1bcd40['push'](_0x1bcd40['shift']());}};_0x474167(++_0x1c6d08);}(_0x7487,0x1e4));var _0x7748=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x7487[_0x5cab28];return _0xa3554d;};'use strict';var _=require(_0x7748('0x0'));var util=require(_0x7748('0x1'));var logger=require(_0x7748('0x2'))(_0x7748('0x3'));var moment=require(_0x7748('0x4'));var BPromise=require(_0x7748('0x5'));var rp=require(_0x7748('0x6'));var fs=require('fs');var path=require(_0x7748('0x7'));var rimraf=require(_0x7748('0x8'));var config=require(_0x7748('0x9'));var attributes=require('./disposition.attributes');module[_0x7748('0xa')]=function(_0x5cb762,_0x361c80){return _0x5cb762[_0x7748('0xb')]('Disposition',attributes,{'tableName':_0x7748('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x7748('0xd')]},{'unique':!![],'name':_0x7748('0xe'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x7748('0xf'),'fields':[_0x7748('0x10'),_0x7748('0x11')]},{'unique':!![],'name':_0x7748('0x12'),'fields':[_0x7748('0x10'),_0x7748('0x13')]},{'unique':!![],'name':_0x7748('0x14'),'fields':[_0x7748('0x10'),_0x7748('0x15')]},{'unique':!![],'name':_0x7748('0x16'),'fields':[_0x7748('0x10'),_0x7748('0x17')]},{'unique':!![],'name':_0x7748('0x18'),'fields':['name',_0x7748('0x19')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ee3=['name_whatsapp','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name','name_chat','ChatWebsiteId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x9ee3,0x109));var _0x39ee=function(_0x3f8e15,_0x28875f){_0x3f8e15=_0x3f8e15-0x0;var _0x2ea095=_0x9ee3[_0x3f8e15];return _0x2ea095;};'use strict';var _=require('lodash');var util=require(_0x39ee('0x0'));var logger=require(_0x39ee('0x1'))(_0x39ee('0x2'));var moment=require(_0x39ee('0x3'));var BPromise=require(_0x39ee('0x4'));var rp=require(_0x39ee('0x5'));var fs=require('fs');var path=require(_0x39ee('0x6'));var rimraf=require(_0x39ee('0x7'));var config=require(_0x39ee('0x8'));var attributes=require(_0x39ee('0x9'));module[_0x39ee('0xa')]=function(_0x260521,_0x3c754a){return _0x260521[_0x39ee('0xb')](_0x39ee('0xc'),attributes,{'tableName':_0x39ee('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x39ee('0xe'),'ListId']},{'unique':!![],'name':_0x39ee('0xf'),'fields':[_0x39ee('0xe'),_0x39ee('0x10')]},{'unique':!![],'name':'name_mail','fields':[_0x39ee('0xe'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x39ee('0xe'),_0x39ee('0x11')]},{'unique':!![],'name':_0x39ee('0x12'),'fields':[_0x39ee('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x39ee('0x13'),'fields':[_0x39ee('0xe'),_0x39ee('0x14')]},{'unique':!![],'name':_0x39ee('0x15'),'fields':['name','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 22fa6d6..95fa0ec 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(_0x31064d,_0x1eb426){var _0x852193=function(_0xe591ea){while(--_0xe591ea){_0x31064d['push'](_0x31064d['shift']());}};_0x852193(++_0x1eb426);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x23712d,_0x8e89ba){var _0x69c45f=function(_0x58c7bf){while(--_0x58c7bf){_0x23712d['push'](_0x23712d['shift']());}};_0x69c45f(++_0x8e89ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 c866336..86f954c 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 _0x56b2=['show','post','create','put','/:id','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x56b2,0x1bc));var _0x256b=function(_0x2f696f,_0x39dec1){_0x2f696f=_0x2f696f-0x0;var _0x5b2b4c=_0x56b2[_0x2f696f];return _0x5b2b4c;};'use strict';var multer=require('multer');var util=require(_0x256b('0x0'));var path=require(_0x256b('0x1'));var timeout=require('connect-timeout');var express=require(_0x256b('0x2'));var router=express[_0x256b('0x3')]();var fs_extra=require(_0x256b('0x4'));var auth=require(_0x256b('0x5'));var interaction=require(_0x256b('0x6'));var config=require(_0x256b('0x7'));var controller=require(_0x256b('0x8'));router[_0x256b('0x9')]('/',auth[_0x256b('0xa')](),controller[_0x256b('0xb')]);router[_0x256b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x256b('0xc')]);router[_0x256b('0xd')]('/',auth[_0x256b('0xa')](),controller[_0x256b('0xe')]);router[_0x256b('0xf')](_0x256b('0x10'),auth[_0x256b('0xa')](),controller[_0x256b('0x11')]);router['delete']('/:id',auth[_0x256b('0xa')](),controller[_0x256b('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9e12=['index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0x9e12,0xec));var _0x29e1=function(_0x1488ab,_0x2b69ac){_0x1488ab=_0x1488ab-0x0;var _0x42f3c5=_0x9e12[_0x1488ab];return _0x42f3c5;};'use strict';var multer=require(_0x29e1('0x0'));var util=require(_0x29e1('0x1'));var path=require(_0x29e1('0x2'));var timeout=require(_0x29e1('0x3'));var express=require(_0x29e1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x29e1('0x5'));var interaction=require(_0x29e1('0x6'));var config=require(_0x29e1('0x7'));var controller=require(_0x29e1('0x8'));router[_0x29e1('0x9')]('/',auth[_0x29e1('0xa')](),controller[_0x29e1('0xb')]);router[_0x29e1('0x9')](_0x29e1('0xc'),auth[_0x29e1('0xa')](),controller[_0x29e1('0xd')]);router[_0x29e1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x29e1('0xc'),auth[_0x29e1('0xa')](),controller[_0x29e1('0xf')]);router[_0x29e1('0x10')](_0x29e1('0xc'),auth[_0x29e1('0xa')](),controller[_0x29e1('0x11')]);module[_0x29e1('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a7ab46d..94b8e5c 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 _0x1e73=['14400','4800','7200','9600','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','12000'];(function(_0x495438,_0x1632e2){var _0x3003c5=function(_0x571eaf){while(--_0x571eaf){_0x495438['push'](_0x495438['shift']());}};_0x3003c5(++_0x1632e2);}(_0x1e73,0x1c0));var _0x31e7=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x1e73[_0x149083];return _0x4dc74e;};'use strict';var Sequelize=require(_0x31e7('0x0'));module[_0x31e7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x31e7('0x2')]},'ecm':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x31e7('0x2')],'unique':_0x31e7('0x5')},'minrate':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0x6'),'4800','7200','9600',_0x31e7('0x7'),_0x31e7('0x8')),'defaultValue':_0x31e7('0x9')},'maxrate':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0x6'),_0x31e7('0x9'),_0x31e7('0xa'),_0x31e7('0xb'),'12000',_0x31e7('0x8')),'defaultValue':_0x31e7('0x8')},'modem':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':_0x31e7('0xc')},'gateway':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0xd'),_0x31e7('0xe'),_0x31e7('0xf'),_0x31e7('0x10')),'defaultValue':_0x31e7('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x31e7('0x11')],'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[_0x31e7('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x31e7('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x31e7('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x31e7('0x13')],'allowNull':!![],'defaultValue':null,'comment':_0x31e7('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x31e7('0x12')],'defaultValue':![],'comment':_0x31e7('0x15'),'set':function(_0x5ed2e0){if(!_0x5ed2e0)this[_0x31e7('0x16')]('mandatoryDispositionPauseId',null);this[_0x31e7('0x16')](_0x31e7('0x17'),_0x5ed2e0);}}}; \ No newline at end of file +var _0x2caa=['localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x19412f,_0x132206){var _0xe2264=function(_0x58712c){while(--_0x58712c){_0x19412f['push'](_0x19412f['shift']());}};_0xe2264(++_0x132206);}(_0x2caa,0xe4));var _0xa2ca=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x2caa[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require(_0xa2ca('0x0'));module[_0xa2ca('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa2ca('0x2')]},'ecm':{'type':Sequelize[_0xa2ca('0x3')](_0xa2ca('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xa2ca('0x2')],'defaultValue':_0xa2ca('0x5')},'localstationid':{'type':Sequelize[_0xa2ca('0x2')],'unique':_0xa2ca('0x6')},'minrate':{'type':Sequelize[_0xa2ca('0x3')](_0xa2ca('0x7'),_0xa2ca('0x8'),_0xa2ca('0x9'),_0xa2ca('0xa'),_0xa2ca('0xb'),_0xa2ca('0xc')),'defaultValue':_0xa2ca('0x8')},'maxrate':{'type':Sequelize[_0xa2ca('0x3')](_0xa2ca('0x7'),_0xa2ca('0x8'),'7200','9600',_0xa2ca('0xb'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xa2ca('0x2')],'defaultValue':_0xa2ca('0xd')},'gateway':{'type':Sequelize[_0xa2ca('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa2ca('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa2ca('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xa2ca('0xf'),_0xa2ca('0x10'),_0xa2ca('0x11'),'KHOMP'),'defaultValue':_0xa2ca('0xf')},'key':{'type':Sequelize[_0xa2ca('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa2ca('0x12')],'defaultValue':function(){return _0xa2ca('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa2ca('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa2ca('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa2ca('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa2ca('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa2ca('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xa2ca('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa2ca('0x16'),'set':function(_0x28e860){if(!_0x28e860)this[_0xa2ca('0x17')](_0xa2ca('0x18'),null);this[_0xa2ca('0x17')](_0xa2ca('0x19'),_0x28e860);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7e6d626..1d006b3 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 _0x15c6=['Content-Range','save','update','destroy','get','UserProfileResource','stack','send','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','name','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','params','Pause','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','describe','FaxAccountId','Disposition','getDispositions','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','CmList','Contacts','attachments','join','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','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','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','set'];(function(_0x1210c8,_0x3dc75d){var _0x337b41=function(_0x10b72b){while(--_0x10b72b){_0x1210c8['push'](_0x1210c8['shift']());}};_0x337b41(++_0x3dc75d);}(_0x15c6,0x93));var _0x615c=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0x15c6[_0x4eab61];return _0x342426;};'use strict';var emlformat=require(_0x615c('0x0'));var rimraf=require(_0x615c('0x1'));var zipdir=require(_0x615c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x615c('0x3'));var moment=require(_0x615c('0x4'));var BPromise=require(_0x615c('0x5'));var Mustache=require(_0x615c('0x6'));var util=require(_0x615c('0x7'));var path=require(_0x615c('0x8'));var sox=require(_0x615c('0x9'));var csv=require(_0x615c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x615c('0xb'));var _=require(_0x615c('0xc'));var squel=require(_0x615c('0xd'));var crypto=require(_0x615c('0xe'));var jsforce=require(_0x615c('0xf'));var deskjs=require(_0x615c('0x10'));var toCsv=require(_0x615c('0xa'));var querystring=require('querystring');var Papa=require(_0x615c('0x11'));var Redis=require(_0x615c('0x12'));var authService=require(_0x615c('0x13'));var qs=require(_0x615c('0x14'));var as=require(_0x615c('0x15'));var hardwareService=require(_0x615c('0x16'));var logger=require(_0x615c('0x17'))('api');var utils=require(_0x615c('0x18'));var config=require(_0x615c('0x19'));var licenseUtil=require(_0x615c('0x1a'));var db=require('../../mysqldb')['db'];config[_0x615c('0x1b')]=_[_0x615c('0x1c')](config[_0x615c('0x1b')],{'host':_0x615c('0x1d'),'port':0x18eb});var socket=require(_0x615c('0x1e'))(new Redis(config[_0x615c('0x1b')]));require(_0x615c('0x1f'))[_0x615c('0x20')](socket);var jayson=require(_0x615c('0x21'));var client=jayson[_0x615c('0x22')][_0x615c('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4383c5,_0x40273e,_0x4500ce,_0x3e89c0){return new BPromise(function(_0x275b59,_0x785f8c){var _0x378491=_0x3e89c0||client;return _0x378491[_0x615c('0x24')](_0x4383c5,_0x4500ce)[_0x615c('0x25')](function(_0x725b8a){logger[_0x615c('0x26')](_0x615c('0x27'),_0x40273e,_0x615c('0x28'));logger[_0x615c('0x29')](_0x615c('0x2a'),_0x40273e,_0x615c('0x28'),JSON[_0x615c('0x2b')](_0x725b8a));if(_0x725b8a[_0x615c('0x2c')]){if(_0x725b8a[_0x615c('0x2c')]['code']===0x1f4){logger[_0x615c('0x2c')](_0x615c('0x27'),_0x40273e,_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);return _0x785f8c(_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);}logger[_0x615c('0x2c')]('FaxAccount,\x20%s,\x20%s',_0x40273e,_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);return _0x275b59(_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);}else{logger[_0x615c('0x26')](_0x615c('0x27'),_0x40273e,_0x615c('0x28'));_0x275b59(_0x725b8a[_0x615c('0x2e')][_0x615c('0x2d')]);}})[_0x615c('0x2f')](function(_0x59c8d9){logger[_0x615c('0x2c')](_0x615c('0x27'),_0x40273e,_0x59c8d9);_0x785f8c(_0x59c8d9);});});}function respondWithStatusCode(_0x3cd69a,_0x31f194){_0x31f194=_0x31f194||0xcc;return function(_0x6357f6){if(_0x6357f6){return _0x3cd69a[_0x615c('0x30')](_0x31f194);}return _0x3cd69a['status'](_0x31f194)[_0x615c('0x31')]();};}function respondWithResult(_0x519af0,_0xabb6fe){_0xabb6fe=_0xabb6fe||0xc8;return function(_0x459e74){if(_0x459e74){return _0x519af0[_0x615c('0x32')](_0xabb6fe)[_0x615c('0x33')](_0x459e74);}};}function respondWithFilteredResult(_0x6a32b0,_0x30d0de){return function(_0x247db8){if(_0x247db8){var _0x209ddf=typeof _0x30d0de[_0x615c('0x34')]==='undefined'&&typeof _0x30d0de[_0x615c('0x35')]===_0x615c('0x36');var _0x5e5631=_0x247db8['count'];var _0x6fc464=_0x209ddf?0x0:_0x30d0de[_0x615c('0x34')];var _0x47d07c=_0x209ddf?_0x247db8['count']:_0x30d0de['offset']+_0x30d0de[_0x615c('0x35')];var _0x3f5971;if(_0x47d07c>=_0x5e5631){_0x47d07c=_0x5e5631;_0x3f5971=0xc8;}else{_0x3f5971=0xce;}_0x6a32b0[_0x615c('0x32')](_0x3f5971);return _0x6a32b0[_0x615c('0x37')](_0x615c('0x38'),_0x6fc464+'-'+_0x47d07c+'/'+_0x5e5631)['json'](_0x247db8);}return null;};}function patchUpdates(_0x31f61e){return function(_0x27d8fd){try{jsonpatch['apply'](_0x27d8fd,_0x31f61e,!![]);}catch(_0x5a0dbd){return BPromise['reject'](_0x5a0dbd);}return _0x27d8fd[_0x615c('0x39')]();};}function saveUpdates(_0x44e5cc,_0x1a4b87){return function(_0x6608a3){if(_0x6608a3){return _0x6608a3[_0x615c('0x3a')](_0x44e5cc)['then'](function(_0xcf41c0){return _0xcf41c0;});}return null;};}function removeEntity(_0x3963c7,_0x5019a4){return function(_0x4e6cd4){if(_0x4e6cd4){return _0x4e6cd4[_0x615c('0x3b')]()[_0x615c('0x25')](function(){var _0x357554=_0x4e6cd4[_0x615c('0x3c')]({'plain':!![]});var _0x4d507d='FaxAccounts';return db[_0x615c('0x3d')][_0x615c('0x3b')]({'where':{'type':_0x4d507d,'resourceId':_0x357554['id']}})[_0x615c('0x25')](function(){return _0x4e6cd4;});})[_0x615c('0x25')](function(){_0x3963c7[_0x615c('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbba5,_0x5ddfb6){return function(_0x12005e){if(!_0x12005e){_0x2cbba5[_0x615c('0x30')](0x194);}return _0x12005e;};}function handleError(_0x3fd03e,_0x1adead){_0x1adead=_0x1adead||0x1f4;return function(_0x4efa29){logger[_0x615c('0x2c')](_0x4efa29[_0x615c('0x3e')]);if(_0x4efa29['name']){delete _0x4efa29['name'];}_0x3fd03e[_0x615c('0x32')](_0x1adead)[_0x615c('0x3f')](_0x4efa29);};}exports['index']=function(_0x4ac63e,_0x492a5f){var _0x480932={'include':[{'model':db['Pause'],'as':_0x615c('0x40')}]},_0x39f480={},_0x4d3156={'count':0x0,'rows':[]};var _0x8731e8=_[_0x615c('0x41')](db[_0x615c('0x42')][_0x615c('0x43')],function(_0x4ae3ae){return{'name':_0x4ae3ae[_0x615c('0x44')],'type':_0x4ae3ae[_0x615c('0x45')][_0x615c('0x46')]};});_0x39f480['model']=_[_0x615c('0x41')](_0x8731e8,_0x615c('0x47'));_0x39f480['query']=_[_0x615c('0x48')](_0x4ac63e['query']);_0x39f480[_0x615c('0x49')]=_['intersection'](_0x39f480[_0x615c('0x4a')],_0x39f480[_0x615c('0x4b')]);_0x480932[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x39f480['model'],qs[_0x615c('0x4e')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x4e')]));_0x480932['attributes']=_0x480932[_0x615c('0x4c')][_0x615c('0x4f')]?_0x480932[_0x615c('0x4c')]:_0x39f480['model'];if(!_0x4ac63e['query'][_0x615c('0x50')](_0x615c('0x51'))){_0x480932[_0x615c('0x35')]=qs[_0x615c('0x35')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x35')]);_0x480932[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x34')]);}_0x480932[_0x615c('0x52')]=qs[_0x615c('0x53')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x53')]);_0x480932[_0x615c('0x54')]=qs[_0x615c('0x49')](_['pick'](_0x4ac63e[_0x615c('0x4b')],_0x39f480['filters']),_0x8731e8);if(_0x4ac63e[_0x615c('0x4b')][_0x615c('0x55')]){_0x480932[_0x615c('0x54')]=_[_0x615c('0x56')](_0x480932[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x8731e8,function(_0x31edd8){if(_0x31edd8[_0x615c('0x45')]!==_0x615c('0x57')){var _0x208420={};_0x208420[_0x31edd8['name']]={'$like':'%'+_0x4ac63e['query'][_0x615c('0x55')]+'%'};return _0x208420;}})});}_0x480932=_[_0x615c('0x56')]({},_0x480932,_0x4ac63e[_0x615c('0x58')]);var _0x20a106={'where':_0x480932['where']};return db[_0x615c('0x42')]['count'](_0x20a106)[_0x615c('0x25')](function(_0x591811){_0x4d3156[_0x615c('0x59')]=_0x591811;if(_0x4ac63e[_0x615c('0x4b')]['includeAll']){_0x480932[_0x615c('0x5a')]=[{'all':!![]}];}return db[_0x615c('0x42')][_0x615c('0x5b')](_0x480932);})[_0x615c('0x25')](function(_0x54c0ba){_0x4d3156[_0x615c('0x5c')]=_0x54c0ba;return _0x4d3156;})['then'](respondWithFilteredResult(_0x492a5f,_0x480932))[_0x615c('0x2f')](handleError(_0x492a5f,null));};exports['show']=function(_0x97393f,_0x1510e2){var _0x2b6e88={'raw':![],'where':{'id':_0x97393f[_0x615c('0x5d')]['id']},'include':[{'model':db[_0x615c('0x5e')],'as':_0x615c('0x40')}]},_0x2876d9={};_0x2876d9[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0x42')][_0x615c('0x43')]);_0x2876d9[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x97393f[_0x615c('0x4b')]);_0x2876d9['filters']=_[_0x615c('0x4d')](_0x2876d9[_0x615c('0x4a')],_0x2876d9[_0x615c('0x4b')]);_0x2b6e88[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x2876d9[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0x97393f['query']['fields']));_0x2b6e88['attributes']=_0x2b6e88[_0x615c('0x4c')][_0x615c('0x4f')]?_0x2b6e88[_0x615c('0x4c')]:_0x2876d9[_0x615c('0x4a')];if(_0x97393f[_0x615c('0x4b')][_0x615c('0x5f')]){_0x2b6e88[_0x615c('0x5a')]=[{'all':!![]}];}_0x2b6e88=_[_0x615c('0x56')]({},_0x2b6e88,_0x97393f[_0x615c('0x58')]);return db[_0x615c('0x42')][_0x615c('0x60')](_0x2b6e88)[_0x615c('0x25')](handleEntityNotFound(_0x1510e2,null))[_0x615c('0x25')](respondWithResult(_0x1510e2,null))['catch'](handleError(_0x1510e2,null));};exports[_0x615c('0x61')]=function(_0x270276,_0x2aefaf){return db[_0x615c('0x42')][_0x615c('0x61')](_0x270276[_0x615c('0x62')],{})['then'](function(_0x42619c){var _0x3dadca=_0x270276['user'][_0x615c('0x3c')]({'plain':!![]});if(!_0x3dadca)throw new Error(_0x615c('0x63'));if(_0x3dadca[_0x615c('0x64')]===_0x615c('0x65')){var _0x4fabe2=_0x42619c['get']({'plain':!![]});var _0x4d5d64=_0x615c('0x66');return db[_0x615c('0x67')][_0x615c('0x60')]({'where':{'name':_0x4d5d64,'userProfileId':_0x3dadca[_0x615c('0x68')]},'raw':!![]})[_0x615c('0x25')](function(_0x529735){if(_0x529735&&_0x529735[_0x615c('0x69')]===0x0){return db['UserProfileResource'][_0x615c('0x61')]({'name':_0x4fabe2[_0x615c('0x47')],'resourceId':_0x4fabe2['id'],'type':_0x529735[_0x615c('0x47')],'sectionId':_0x529735['id']},{})[_0x615c('0x25')](function(){return _0x42619c;});}else{return _0x42619c;}})[_0x615c('0x2f')](function(_0xf022ad){logger[_0x615c('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf022ad);throw _0xf022ad;});}return _0x42619c;})[_0x615c('0x25')](respondWithResult(_0x2aefaf,0xc9))[_0x615c('0x2f')](handleError(_0x2aefaf,null));};exports[_0x615c('0x3a')]=function(_0x4b8633,_0x41d621){if(_0x4b8633[_0x615c('0x62')]['id']){delete _0x4b8633[_0x615c('0x62')]['id'];}return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x4b8633['params']['id']},'include':[{'model':db[_0x615c('0x5e')],'as':_0x615c('0x40')}]})[_0x615c('0x25')](handleEntityNotFound(_0x41d621,null))[_0x615c('0x25')](saveUpdates(_0x4b8633['body'],null))['then'](respondWithResult(_0x41d621,null))['catch'](handleError(_0x41d621,null));};exports['destroy']=function(_0x18974a,_0x3e65f9){return db['FaxAccount'][_0x615c('0x60')]({'where':{'id':_0x18974a[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3e65f9,null))[_0x615c('0x25')](removeEntity(_0x3e65f9,null))[_0x615c('0x2f')](handleError(_0x3e65f9,null));};exports[_0x615c('0x6a')]=function(_0x5f5b29,_0x21d8a9){return db[_0x615c('0x42')][_0x615c('0x6a')]()[_0x615c('0x25')](respondWithResult(_0x21d8a9,null))[_0x615c('0x2f')](handleError(_0x21d8a9,null));};exports['addDisposition']=function(_0x304504,_0x45b122,_0x3acbd2){if(_0x304504[_0x615c('0x62')]['id']){delete _0x304504['body']['id'];}return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x304504['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x45b122,null))[_0x615c('0x25')](function(_0x46cb34){if(_0x46cb34){_0x304504[_0x615c('0x62')][_0x615c('0x6b')]=_0x46cb34['id'];return db[_0x615c('0x6c')][_0x615c('0x61')](_0x304504['body']);}})[_0x615c('0x25')](respondWithResult(_0x45b122,null))[_0x615c('0x2f')](handleError(_0x45b122,null));};exports[_0x615c('0x6d')]=function(_0xbe6668,_0x5143fa,_0x4acf55){var _0x369870={'raw':![],'where':{}};var _0x5c1532={};var _0x2e71f2={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xbe6668[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5143fa,null))[_0x615c('0x25')](function(_0xe4e3a5){if(_0xe4e3a5){_0x5c1532['model']=_[_0x615c('0x48')](db[_0x615c('0x6c')][_0x615c('0x43')]);_0x5c1532[_0x615c('0x4b')]=_['keys'](_0xbe6668[_0x615c('0x4b')]);_0x5c1532['filters']=_[_0x615c('0x4d')](_0x5c1532['model'],_0x5c1532[_0x615c('0x4b')]);_0x369870[_0x615c('0x4c')]=_['intersection'](_0x5c1532[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0xbe6668[_0x615c('0x4b')]['fields']));_0x369870['attributes']=_0x369870[_0x615c('0x4c')][_0x615c('0x4f')]?_0x369870[_0x615c('0x4c')]:_0x5c1532[_0x615c('0x4a')];if(!_0xbe6668[_0x615c('0x4b')]['hasOwnProperty']('nolimit')){_0x369870['limit']=qs[_0x615c('0x35')](_0xbe6668['query'][_0x615c('0x35')]);_0x369870[_0x615c('0x34')]=qs[_0x615c('0x34')](_0xbe6668[_0x615c('0x4b')][_0x615c('0x34')]);}_0x369870['order']=qs['sort'](_0xbe6668[_0x615c('0x4b')][_0x615c('0x53')]);_0x369870[_0x615c('0x54')]=qs['filters'](_[_0x615c('0x6e')](_0xbe6668[_0x615c('0x4b')],_0x5c1532['filters']));_0x369870['where']['FaxAccountId']=_0xe4e3a5['id'];if(_0xbe6668[_0x615c('0x4b')][_0x615c('0x55')]){_0x369870['where']=_[_0x615c('0x56')](_0x369870[_0x615c('0x54')],{'$or':_['map'](_0x369870['attributes'],function(_0x5d2fb8){var _0x56299e={};_0x56299e[_0x5d2fb8]={'$like':'%'+_0xbe6668[_0x615c('0x4b')]['filter']+'%'};return _0x56299e;})});}_0x369870=_[_0x615c('0x56')]({},_0x369870,_0xbe6668[_0x615c('0x58')]);return db[_0x615c('0x6c')]['count']({'where':_0x369870[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x47bcaa){_0x2e71f2['count']=_0x47bcaa;if(_0xbe6668[_0x615c('0x4b')][_0x615c('0x5f')]){_0x369870[_0x615c('0x5a')]=[{'all':!![]}];}return db[_0x615c('0x6c')][_0x615c('0x5b')](_0x369870);})[_0x615c('0x25')](function(_0x55f957){_0x2e71f2['rows']=_0x55f957;return _0x2e71f2;});}})['then'](respondWithFilteredResult(_0x5143fa,_0x369870))[_0x615c('0x2f')](handleError(_0x5143fa,null));};exports[_0x615c('0x6f')]=function(_0x5b1167,_0x2cdde5,_0x4f1e5a){return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x5b1167[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x2cdde5,null))[_0x615c('0x25')](function(_0x87ce83){if(_0x87ce83){return _0x87ce83[_0x615c('0x6f')](_0x5b1167[_0x615c('0x4b')][_0x615c('0x70')]);}})[_0x615c('0x25')](respondWithStatusCode(_0x2cdde5,null))[_0x615c('0x2f')](handleError(_0x2cdde5,null));};exports[_0x615c('0x71')]=function(_0x1a3b22,_0x2bb4f1,_0x24f25e){if(_0x1a3b22[_0x615c('0x62')]['id']){delete _0x1a3b22['body']['id'];}return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x1a3b22[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x2bb4f1,null))[_0x615c('0x25')](function(_0x2a45d1){if(_0x2a45d1){_0x1a3b22[_0x615c('0x62')][_0x615c('0x6b')]=_0x2a45d1['id'];return db['CannedAnswer'][_0x615c('0x61')](_0x1a3b22[_0x615c('0x62')]);}})[_0x615c('0x25')](respondWithResult(_0x2bb4f1,null))['catch'](handleError(_0x2bb4f1,null));};exports[_0x615c('0x72')]=function(_0xb604df,_0x51ba3a,_0x5e6997){var _0x159c39={'raw':![],'where':{}};var _0x54bdb1={};var _0x5b97f8={'count':0x0,'rows':[]};return db[_0x615c('0x42')][_0x615c('0x73')]({'where':{'id':_0xb604df[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x51ba3a,null))['then'](function(_0x5ea448){if(_0x5ea448){_0x54bdb1['model']=_['keys'](db[_0x615c('0x74')][_0x615c('0x43')]);_0x54bdb1['query']=_[_0x615c('0x48')](_0xb604df['query']);_0x54bdb1[_0x615c('0x49')]=_[_0x615c('0x4d')](_0x54bdb1[_0x615c('0x4a')],_0x54bdb1[_0x615c('0x4b')]);_0x159c39[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x54bdb1[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0xb604df[_0x615c('0x4b')][_0x615c('0x4e')]));_0x159c39['attributes']=_0x159c39[_0x615c('0x4c')][_0x615c('0x4f')]?_0x159c39['attributes']:_0x54bdb1['model'];if(!_0xb604df[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x159c39[_0x615c('0x35')]=qs[_0x615c('0x35')](_0xb604df[_0x615c('0x4b')][_0x615c('0x35')]);_0x159c39[_0x615c('0x34')]=qs[_0x615c('0x34')](_0xb604df[_0x615c('0x4b')]['offset']);}_0x159c39[_0x615c('0x52')]=qs['sort'](_0xb604df[_0x615c('0x4b')]['sort']);_0x159c39[_0x615c('0x54')]=qs[_0x615c('0x49')](_[_0x615c('0x6e')](_0xb604df[_0x615c('0x4b')],_0x54bdb1[_0x615c('0x49')]));_0x159c39[_0x615c('0x54')][_0x615c('0x6b')]=_0x5ea448['id'];if(_0xb604df[_0x615c('0x4b')]['filter']){_0x159c39[_0x615c('0x54')]=_['merge'](_0x159c39[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x159c39['attributes'],function(_0x3ca90e){var _0x112078={};_0x112078[_0x3ca90e]={'$like':'%'+_0xb604df[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x112078;})});}_0x159c39=_[_0x615c('0x56')]({},_0x159c39,_0xb604df['options']);return db['CannedAnswer'][_0x615c('0x59')]({'where':_0x159c39[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x21801a){_0x5b97f8[_0x615c('0x59')]=_0x21801a;if(_0xb604df['query'][_0x615c('0x5f')]){_0x159c39[_0x615c('0x5a')]=[{'all':!![]}];}return db[_0x615c('0x74')][_0x615c('0x5b')](_0x159c39);})['then'](function(_0x55d8db){_0x5b97f8[_0x615c('0x5c')]=_0x55d8db;return _0x5b97f8;});}})[_0x615c('0x25')](respondWithFilteredResult(_0x51ba3a,_0x159c39))[_0x615c('0x2f')](handleError(_0x51ba3a,null));};exports[_0x615c('0x75')]=function(_0x5e16cf,_0x26233a,_0x58aba2){return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x5e16cf[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x26233a,null))[_0x615c('0x25')](function(_0x1ad241){if(_0x1ad241){return _0x1ad241[_0x615c('0x75')](_0x5e16cf[_0x615c('0x4b')][_0x615c('0x70')]);}})[_0x615c('0x25')](respondWithStatusCode(_0x26233a,null))[_0x615c('0x2f')](handleError(_0x26233a,null));};exports['addInteraction']=function(_0x2ecf99,_0x3f0219,_0x50e02e){return db[_0x615c('0x76')][_0x615c('0x60')]({'where':{'id':_0x2ecf99[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x3f0219,null))['then'](function(_0x5a669a){if(_0x5a669a){return _0x5a669a[_0x615c('0x77')](_0x2ecf99[_0x615c('0x62')][_0x615c('0x70')],_[_0x615c('0x78')](_0x2ecf99[_0x615c('0x62')],[_0x615c('0x70'),'id'])||{});}})[_0x615c('0x25')](respondWithResult(_0x3f0219,null))[_0x615c('0x2f')](handleError(_0x3f0219,null));};exports[_0x615c('0x79')]=function(_0x1de49b,_0x48a6e8,_0x5ee811){var _0x1fd8cd={'raw':![],'where':{}};var _0x4e3040={};var _0x2fd846={'count':0x0,'rows':[]};return db['FaxAccount'][_0x615c('0x73')]({'where':{'id':_0x1de49b['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x48a6e8,null))['then'](function(_0x14c5be){if(_0x14c5be){_0x4e3040['model']=_[_0x615c('0x48')](db[_0x615c('0x76')][_0x615c('0x43')]);_0x4e3040[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x1de49b[_0x615c('0x4b')]);_0x4e3040['filters']=_[_0x615c('0x4d')](_0x4e3040[_0x615c('0x4a')],_0x4e3040['query']);_0x1fd8cd[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x4e3040[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0x1de49b[_0x615c('0x4b')][_0x615c('0x4e')]));_0x1fd8cd['attributes']=_0x1fd8cd[_0x615c('0x4c')][_0x615c('0x4f')]?_0x1fd8cd[_0x615c('0x4c')]:_0x4e3040[_0x615c('0x4a')];if(!_0x1de49b[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x1fd8cd[_0x615c('0x35')]=qs['limit'](_0x1de49b[_0x615c('0x4b')][_0x615c('0x35')]);_0x1fd8cd[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x1de49b[_0x615c('0x4b')]['offset']);}_0x1fd8cd['order']=qs[_0x615c('0x53')](_0x1de49b[_0x615c('0x4b')][_0x615c('0x53')]);_0x1fd8cd[_0x615c('0x54')]=qs['filters'](_['pick'](_0x1de49b[_0x615c('0x4b')],_0x4e3040[_0x615c('0x49')]));_0x1fd8cd['where'][_0x615c('0x6b')]=_0x14c5be['id'];if(_0x1de49b['query'][_0x615c('0x55')]){_0x1fd8cd[_0x615c('0x54')]=_[_0x615c('0x56')](_0x1fd8cd[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x1fd8cd[_0x615c('0x4c')],function(_0x11edb0){var _0x3f4209={};_0x3f4209[_0x11edb0]={'$like':'%'+_0x1de49b['query'][_0x615c('0x55')]+'%'};return _0x3f4209;})});}_0x1fd8cd=_[_0x615c('0x56')]({},_0x1fd8cd,_0x1de49b[_0x615c('0x58')]);return db['FaxInteraction'][_0x615c('0x59')]({'where':_0x1fd8cd[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x704f03){_0x2fd846[_0x615c('0x59')]=_0x704f03;if(_0x1de49b[_0x615c('0x4b')][_0x615c('0x5f')]){_0x1fd8cd[_0x615c('0x5a')]=[{'model':db[_0x615c('0x7a')],'as':_0x615c('0x7b'),'required':![]},{'model':db[_0x615c('0x7c')],'as':_0x615c('0x7d'),'attributes':['name',_0x615c('0x7e'),'internal'],'required':![]},{'model':db[_0x615c('0x7f')],'as':_0x615c('0x80'),'attributes':['id',_0x615c('0x47'),_0x615c('0x81')],'where':_0x1de49b[_0x615c('0x4b')]['tag']?{'id':_0x1de49b['query'][_0x615c('0x82')]}:undefined,'required':_0x1de49b[_0x615c('0x4b')]['tag']?!![]:![]}];}return db[_0x615c('0x76')][_0x615c('0x5b')](_0x1fd8cd);})[_0x615c('0x25')](function(_0x2416a9){_0x2fd846[_0x615c('0x5c')]=_0x2416a9;return _0x2fd846;});}})[_0x615c('0x25')](respondWithFilteredResult(_0x48a6e8,_0x1fd8cd))[_0x615c('0x2f')](handleError(_0x48a6e8,null));};exports[_0x615c('0x83')]=function(_0x1a89de,_0x27f896){var _0x2b3120=_0x1a89de[_0x615c('0x5d')]['id'];var _0x138346=_0x1a89de[_0x615c('0x62')];var _0x51ad97=0xc8;var _0x1fa4aa=null;return db[_0x615c('0x84')][_0x615c('0x85')]({'isolationLevel':db['sequelize'][_0x615c('0x86')][_0x615c('0x87')][_0x615c('0x88')]},function(_0x522e41){return db[_0x615c('0x42')][_0x615c('0x73')]({'where':{'id':_0x2b3120},'transaction':_0x522e41})['then'](function(_0x84948){if(_0x84948){return db[_0x615c('0x89')][_0x615c('0x3b')]({'where':{'FaxAccountId':_0x2b3120},'transaction':_0x522e41})[_0x615c('0x25')](function(){var _0x1d33ef=_[_0x615c('0x41')](_0x138346,function(_0x5dc330){_0x5dc330['FaxAccountId']=_0x2b3120;return _0x5dc330;});return db[_0x615c('0x89')]['bulkCreate'](_0x1d33ef,{'transaction':_0x522e41});});}else{_0x51ad97=0x194;_0x1fa4aa=[];}});})[_0x615c('0x25')](function(){if(_0x51ad97!==0x194){return db[_0x615c('0x89')][_0x615c('0x8a')]({'where':{'FaxAccountId':_0x2b3120},'order':_0x615c('0x8b')})[_0x615c('0x25')](function(_0x232832){_0x1fa4aa=_0x232832;});}})[_0x615c('0x2f')](function(_0x34a5b6){_0x51ad97=0x1f4;logger[_0x615c('0x2c')](_0x34a5b6['stack']);if(_0x34a5b6[_0x615c('0x47')]){delete _0x34a5b6[_0x615c('0x47')];}_0x1fa4aa=_0x34a5b6;})[_0x615c('0x8c')](function(){if(_0x1fa4aa===null){_0x27f896['sendStatus'](_0x51ad97);}else{if(_0x51ad97===0x1f4){_0x27f896[_0x615c('0x32')](_0x51ad97)[_0x615c('0x3f')](_0x1fa4aa);}else{_0x27f896[_0x615c('0x32')](_0x51ad97)[_0x615c('0x33')](_0x1fa4aa);}}});};exports['getApplications']=function(_0x3f51ac,_0x3a28c3,_0x13455e){var _0x5232c4={};var _0x1a7797={};var _0x551657;var _0x3503c3;return db['FaxAccount'][_0x615c('0x73')]({'where':{'id':_0x3f51ac[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3a28c3,null))['then'](function(_0x20bb7d){if(_0x20bb7d){_0x551657=_0x20bb7d;_0x1a7797[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0x89')][_0x615c('0x43')]);_0x1a7797[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x3f51ac[_0x615c('0x4b')]);_0x1a7797['filters']=_[_0x615c('0x4d')](_0x1a7797[_0x615c('0x4a')],_0x1a7797[_0x615c('0x4b')]);_0x5232c4['attributes']=_[_0x615c('0x4d')](_0x1a7797['model'],qs['fields'](_0x3f51ac[_0x615c('0x4b')][_0x615c('0x4e')]));_0x5232c4['attributes']=_0x5232c4[_0x615c('0x4c')][_0x615c('0x4f')]?_0x5232c4[_0x615c('0x4c')]:_0x1a7797[_0x615c('0x4a')];_0x5232c4[_0x615c('0x52')]=qs['sort'](_0x3f51ac['query']['sort']);_0x5232c4[_0x615c('0x54')]=qs['filters'](_[_0x615c('0x6e')](_0x3f51ac[_0x615c('0x4b')],_0x1a7797['filters']));if(_0x3f51ac[_0x615c('0x4b')][_0x615c('0x55')]){_0x5232c4['where']=_[_0x615c('0x56')](_0x5232c4[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x5232c4['attributes'],function(_0xe4250b){var _0x5b224c={};_0x5b224c[_0xe4250b]={'$like':'%'+_0x3f51ac[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x5b224c;})});}_0x5232c4=_['merge']({},_0x5232c4,_0x3f51ac['options']);return _0x551657['getApplications'](_0x5232c4);}})[_0x615c('0x25')](function(_0x30550f){if(_0x30550f){_0x3503c3=_0x30550f['length'];if(!_0x3f51ac[_0x615c('0x4b')][_0x615c('0x50')](_0x615c('0x51'))){_0x5232c4[_0x615c('0x35')]=qs['limit'](_0x3f51ac[_0x615c('0x4b')][_0x615c('0x35')]);_0x5232c4[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x3f51ac['query'][_0x615c('0x34')]);}return _0x551657['getApplications'](_0x5232c4);}})[_0x615c('0x25')](function(_0x1c0347){if(_0x1c0347){return _0x1c0347?{'count':_0x3503c3,'rows':_0x1c0347}:null;}})[_0x615c('0x25')](respondWithResult(_0x3a28c3,null))['catch'](handleError(_0x3a28c3,null));};function Extension(_0x5f5cbd,_0x5b564b,_0x4ac562,_0x13c429){this['context']=_0x615c('0x8d');this[_0x615c('0x8e')]=_0x5f5cbd[_0x615c('0x8f')];this[_0x615c('0x90')]=_0x13c429;this[_0x615c('0x45')]='system';this[_0x615c('0x91')]=_0x615c('0x92');this['FaxAccountId']=_0x5f5cbd['id'];this['priority']=_0x5b564b;this[_0x615c('0x93')]=_0x4ac562;}function createExtensionsReciveFax(_0x393363){var _0x4f6617=0x1;var _0x1b7594=[];_0x1b7594['push'](new Extension(_0x393363,_0x4f6617,'',_0x615c('0x94')));_0x4f6617+=0x1;_0x1b7594[_0x615c('0x95')](new Extension(_0x393363,_0x4f6617,_0x615c('0x96'),_0x615c('0x97')));_0x4f6617+=0x1;for(var _0x4cba81 in _0x393363){if(_0x393363[_0x615c('0x50')](_0x4cba81)&&(_0x4cba81==='ecm'||_0x4cba81===_0x615c('0x8f')||_0x4cba81===_0x615c('0x98')||_0x4cba81===_0x615c('0x99')||_0x4cba81==='headerinfo'||_0x4cba81===_0x615c('0x9a')||_0x4cba81===_0x615c('0x9b')||_0x4cba81===_0x615c('0x9c')||_0x4cba81===_0x615c('0x9d'))){_0x1b7594[_0x615c('0x95')](new Extension(_0x393363,_0x4f6617,_0x615c('0x9e')+_0x4cba81+')='+_0x393363[_0x4cba81],'Set'));_0x4f6617+=0x1;}}_0x1b7594[_0x615c('0x95')](new Extension(_0x393363,_0x4f6617,'6','Wait'));_0x4f6617+=0x1;_0x1b7594['push'](new Extension(_0x393363,_0x4f6617,_0x615c('0x9f'),_0x615c('0xa0')));_0x4f6617=0x0;return _0x1b7594;}exports[_0x615c('0xa1')]=function(_0x1bc1a5,_0x5a8b58,_0x607bb3){var _0x27dbe4;return db[_0x615c('0x84')][_0x615c('0x85')](function(_0x5780f0){return db['FaxAccount'][_0x615c('0x61')](_0x1bc1a5[_0x615c('0x62')],{'transaction':_0x5780f0})[_0x615c('0x25')](function(_0x173fc2){_0x27dbe4=_0x173fc2[_0x615c('0x3c')]({'plain':!![]});return db[_0x615c('0xa2')][_0x615c('0xa3')](createExtensionsReciveFax(_0x27dbe4),{'transaction':_0x5780f0});});})[_0x615c('0x25')](function(){return _0x27dbe4;})['then'](respondWithResult(_0x5a8b58,null))[_0x615c('0x2f')](handleError(_0x5a8b58,null));};exports[_0x615c('0xa4')]=function(_0x2508bb,_0x450aa7,_0x4cf501){var _0x559dfd;return db['sequelize'][_0x615c('0x85')](function(_0x487af1){return db[_0x615c('0x42')][_0x615c('0x3a')](_0x2508bb['body'],{'where':{'id':_0x2508bb[_0x615c('0x62')]['id']},'transaction':_0x487af1})[_0x615c('0x25')](function(_0x4a6831){return db[_0x615c('0xa2')]['destroy']({'where':{'FaxAccountId':_0x2508bb[_0x615c('0x62')]['id']},'transaction':_0x487af1})[_0x615c('0x25')](function(_0x5c6f7b){return db['VoiceExtension'][_0x615c('0xa3')](createExtensionsReciveFax(_[_0x615c('0x78')](_0x2508bb[_0x615c('0x62')],[_0x615c('0xa5'),'key','createdAt',_0x615c('0xa6'),'TrunkId',_0x615c('0xa7')])),{'transaction':_0x487af1});});});})[_0x615c('0x25')](function(){return db[_0x615c('0x42')][_0x615c('0xa8')](_0x2508bb['body']['id']);})['then'](respondWithResult(_0x450aa7,null))[_0x615c('0x2f')](handleError(_0x450aa7,null));};exports[_0x615c('0xa9')]=function(_0x569a81,_0x41789f,_0x42b565){var _0x6fb62a={'raw':!![],'where':{}};var _0x4e4a09={};var _0x216f90={'count':0x0,'rows':[]};return db[_0x615c('0x42')][_0x615c('0x73')]({'where':{'id':_0x569a81['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x41789f,null))[_0x615c('0x25')](function(_0x57b951){if(_0x57b951){_0x4e4a09[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0xaa')][_0x615c('0x43')]);_0x4e4a09[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x569a81[_0x615c('0x4b')]);_0x4e4a09['filters']=_[_0x615c('0x4d')](_0x4e4a09['model'],_0x4e4a09[_0x615c('0x4b')]);_0x6fb62a[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x4e4a09[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0x569a81[_0x615c('0x4b')]['fields']));_0x6fb62a[_0x615c('0x4c')]=_0x6fb62a[_0x615c('0x4c')][_0x615c('0x4f')]?_0x6fb62a[_0x615c('0x4c')]:_0x4e4a09[_0x615c('0x4a')];if(!_0x569a81[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x6fb62a[_0x615c('0x35')]=qs[_0x615c('0x35')](_0x569a81[_0x615c('0x4b')]['limit']);_0x6fb62a[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x569a81[_0x615c('0x4b')]['offset']);}_0x6fb62a[_0x615c('0x52')]=qs[_0x615c('0x53')](_0x569a81[_0x615c('0x4b')][_0x615c('0x53')]);_0x6fb62a[_0x615c('0x54')]=qs[_0x615c('0x49')](_[_0x615c('0x6e')](_0x569a81[_0x615c('0x4b')],_0x4e4a09[_0x615c('0x49')]));_0x6fb62a[_0x615c('0x54')]['FaxAccountId']=_0x57b951['id'];if(_0x569a81[_0x615c('0x4b')]['filter']){_0x6fb62a['where']=_['merge'](_0x6fb62a[_0x615c('0x54')],{'$or':_['map'](_0x6fb62a[_0x615c('0x4c')],function(_0x2ac4f1){var _0x30184e={};_0x30184e[_0x2ac4f1]={'$like':'%'+_0x569a81[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x30184e;})});}if(_0x569a81[_0x615c('0x4b')]['$gte']){var _0x2c4e27=_0x569a81[_0x615c('0x4b')][_0x615c('0xab')][_0x615c('0xac')](',');var _0x157c18={};_0x157c18[_0x2c4e27[0x0]]={'$gte':moment(_0x2c4e27[0x1])[_0x615c('0xad')]('YYYY-MM-DD\x20HH:mm:ss')};_0x6fb62a['where']=_[_0x615c('0x56')](_0x6fb62a[_0x615c('0x54')],_0x157c18);}_0x6fb62a=_['merge']({},_0x6fb62a,_0x569a81[_0x615c('0x58')]);return db[_0x615c('0xaa')][_0x615c('0x59')]({'where':_0x6fb62a[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x1ba050){_0x216f90[_0x615c('0x59')]=_0x1ba050;if(_0x569a81['query'][_0x615c('0x5f')]){_0x6fb62a['include']=[{'all':!![]}];}return db[_0x615c('0xaa')][_0x615c('0x5b')](_0x6fb62a);})[_0x615c('0x25')](function(_0x4b25d5){_0x216f90[_0x615c('0x5c')]=_0x4b25d5;return _0x216f90;});}})[_0x615c('0x25')](respondWithFilteredResult(_0x41789f,_0x6fb62a))['catch'](handleError(_0x41789f,null));};exports[_0x615c('0x3f')]=function(_0xd9dd91,_0x2773af,_0x267843){var _0x3902aa,_0x318371={},_0x51351e;if(_0xd9dd91[_0x615c('0x62')]['to']){_0x51351e=_0xd9dd91[_0x615c('0x62')]['to'][0x0];}return db[_0x615c('0x42')]['find']({'where':{'id':_0xd9dd91[_0x615c('0x5d')]['id']},'include':[{'model':db[_0x615c('0xae')],'as':'List','include':[{'model':db['CmContact'],'as':_0x615c('0xaf'),'where':{'fax':_0x51351e},'limit':0x1,'order':[[_0x615c('0xa6'),'DESC']]}]}]})[_0x615c('0x25')](handleEntityNotFound(_0x2773af,null))['then'](function(_0x1c09d1){_0x3902aa=_0x1c09d1;if(_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')]&&_0xd9dd91['body'][_0x615c('0xb0')][_0x615c('0x4f')]){for(var _0x5b0d1e=0x0;_0x5b0d1e<_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][_0x615c('0x4f')];_0x5b0d1e+=0x1){_0xd9dd91[_0x615c('0x62')]['attachments'][_0x5b0d1e]={'filename':_0xd9dd91['body'][_0x615c('0xb0')][_0x5b0d1e][_0x615c('0x47')],'id':_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][_0x5b0d1e]['id'],'path':path[_0x615c('0xb1')](config['root'],'server/files/attachments',_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][_0x5b0d1e][_0x615c('0xb2')])};}}return respondWithRpcPromise('CheckAfterSend',_0x615c('0xb3'),{'FaxAccountId':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x5d')]['id'])?undefined:_0xd9dd91[_0x615c('0x5d')]['id'],'path':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0][_0x615c('0x8')])?undefined:_0xd9dd91['body'][_0x615c('0xb0')][0x0]['path'],'fax':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x62')]['to'][0x0])?undefined:_0xd9dd91[_0x615c('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0x3902aa){if(_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x62')]['from'])){_0xd9dd91['body'][_0x615c('0xb5')]=util[_0x615c('0xad')](_0x615c('0xb6'),_0x3902aa['name'],_0x3902aa[_0x615c('0xb7')]);}if(_0x3902aa[_0x615c('0xb8')]){if(_0x3902aa[_0x615c('0xb8')][_0x615c('0xaf')][_0x615c('0x4f')]){return _0x3902aa[_0x615c('0xb8')]['Contacts'][0x0];}else{return db['CmContact'][_0x615c('0x61')](_['defaults'](_0xd9dd91[_0x615c('0x62')],{'firstName':_0xd9dd91[_0x615c('0x62')]['to'][0x0],'phone':_0xd9dd91[_0x615c('0x62')]['to'][0x0],'fax':_0xd9dd91['body']['to'][0x0],'ListId':_0x3902aa['ListId']}));}}else{throw new Error(_0x615c('0xb9'));}}else{throw new Error(_0x615c('0xba'));}})[_0x615c('0x25')](function(_0x408f64){if(_0x408f64){return db[_0x615c('0x76')][_0x615c('0x60')]({'where':{'ContactId':_0x408f64['id'],'closed':![],'FaxAccountId':_0x3902aa['id']}})[_0x615c('0x25')](function(_0x5dbbeb){if(_0x5dbbeb){return[_0x5dbbeb,![]];}return db['FaxInteraction'][_0x615c('0x61')]({'UserId':_0xd9dd91['user']['id'],'ContactId':_0x408f64['id'],'FaxAccountId':_0x3902aa['id'],'fax':_0xd9dd91[_0x615c('0x62')]['to'][0x0],'firstMsgDirection':_0x615c('0xbb'),'Messages':[_['merge'](_0xd9dd91['body'],{'read':![],'body':_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0][_0x615c('0xbc')],'FaxAccountId':_0x3902aa['id'],'UserId':_0xd9dd91[_0x615c('0x65')]['id'],'ContactId':_0x408f64['id'],'AttachmentId':_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0x615c('0xaa')],'as':_0x615c('0xbd')}]})[_0x615c('0x25')](function(_0x14c8e8){return[_0x14c8e8,!![]];});});}else{throw new Error(_0x615c('0xbe'));}})['spread'](function(_0x226953,_0x3d525d){if(_0x3d525d){return _0x226953;}return db[_0x615c('0xaa')][_0x615c('0x61')]({'direction':_0x615c('0xbb'),'read':![],'body':_0xd9dd91[_0x615c('0x62')]['attachments'][0x0]['filename'],'FaxAccountId':_0x3902aa['id'],'FaxInteractionId':_0x226953['id'],'UserId':_0xd9dd91['user']['id'],'ContactId':_0x226953[_0x615c('0xbf')],'AttachmentId':_0xd9dd91[_0x615c('0x62')]['attachments'][0x0]['id']})[_0x615c('0x25')](function(_0x250a63){_0x226953[_0x615c('0xc0')][_0x615c('0xbd')]=[];_0x226953[_0x615c('0xc0')][_0x615c('0xbd')][_0x615c('0x95')](_0x250a63[_0x615c('0xc0')]);return _0x226953;});})['then'](function(_0x39ef64){respondWithRpcPromise(_0x615c('0xc1'),'SendFax',{'FaxAccountId':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x5d')]['id'])?undefined:_0xd9dd91[_0x615c('0x5d')]['id'],'path':_[_0x615c('0xb4')](_0xd9dd91['body'][_0x615c('0xb0')][0x0][_0x615c('0x8')])?undefined:_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0][_0x615c('0x8')],'fax':_['isNil'](_0xd9dd91[_0x615c('0x62')]['to'][0x0])?undefined:_0xd9dd91[_0x615c('0x62')]['to'][0x0],'AttachmentId':_0xd9dd91['body'][_0x615c('0xb0')][0x0]['id']},client9002)[_0x615c('0x25')](function(_0x2b8205){logger[_0x615c('0x26')](_0x615c('0xc2'),_0x2b8205);})[_0x615c('0x2f')](function(_0x2b6af9){logger[_0x615c('0x26')]('SendFaxRpc,\x20%s',_0x2b6af9);});return _0x39ef64;})[_0x615c('0x25')](respondWithResult(_0x2773af,null))[_0x615c('0x2f')](handleError(_0x2773af,null));};exports[_0x615c('0xc3')]=function(_0x5eed38,_0x5d188e,_0x31b009){return db['FaxAccount']['find']({'where':{'id':_0x5eed38['params']['id']}})['then'](handleEntityNotFound(_0x5d188e,null))[_0x615c('0x25')](function(_0x46d5d4){if(_0x46d5d4){return _0x46d5d4[_0x615c('0xc3')](_0x5eed38['body'][_0x615c('0x70')],_[_0x615c('0x78')](_0x5eed38[_0x615c('0x62')],[_0x615c('0x70'),'id'])||{})[_0x615c('0xc4')](function(_0x3c82bc){for(var _0x48240a=0x0;_0x48240a<_0x5eed38[_0x615c('0x62')][_0x615c('0x70')][_0x615c('0x4f')];_0x48240a+=0x1){socket['emit'](_0x615c('0xc5'),{'UserId':Number(_0x5eed38[_0x615c('0x62')][_0x615c('0x70')][_0x48240a]),'FaxAccountId':Number(_0x5eed38['params']['id'])});}return _0x3c82bc;});}})[_0x615c('0x25')](respondWithResult(_0x5d188e,null))[_0x615c('0x2f')](handleError(_0x5d188e,null));};exports[_0x615c('0xc6')]=function(_0x100109,_0x1c3554,_0x1da735){return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x100109['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x1c3554,null))[_0x615c('0x25')](function(_0x5927a8){if(_0x5927a8){return _0x5927a8[_0x615c('0xc6')](_0x100109[_0x615c('0x4b')][_0x615c('0x70')])[_0x615c('0x25')](function(){if(_[_0x615c('0xc7')](_0x100109[_0x615c('0x4b')]['ids'])){for(var _0x53f875=0x0;_0x53f875<_0x100109['query'][_0x615c('0x70')][_0x615c('0x4f')];_0x53f875+=0x1){socket[_0x615c('0xc8')](_0x615c('0xc9'),{'UserId':Number(_0x100109[_0x615c('0x4b')][_0x615c('0x70')][_0x53f875]),'FaxAccountId':Number(_0x100109[_0x615c('0x5d')]['id'])});}}else{socket['emit'](_0x615c('0xc9'),{'UserId':Number(_0x100109[_0x615c('0x4b')][_0x615c('0x70')]),'FaxAccountId':Number(_0x100109['params']['id'])});}});}})[_0x615c('0x25')](respondWithStatusCode(_0x1c3554,null))[_0x615c('0x2f')](handleError(_0x1c3554,null));};exports['getAgents']=function(_0x182b36,_0xc5337,_0x3587e7){var _0x615d={};var _0x465f8a={};var _0x2936c8;var _0x38343c;return db[_0x615c('0x42')]['findOne']({'where':{'id':_0x182b36[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc5337,null))['then'](function(_0x14893b){if(_0x14893b){_0x2936c8=_0x14893b;_0x465f8a[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0x7c')]['rawAttributes']);_0x465f8a[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x182b36[_0x615c('0x4b')]);_0x465f8a[_0x615c('0x49')]=_[_0x615c('0x4d')](_0x465f8a[_0x615c('0x4a')],_0x465f8a['query']);_0x615d[_0x615c('0x4c')]=_['intersection'](_0x465f8a[_0x615c('0x4a')],qs['fields'](_0x182b36[_0x615c('0x4b')][_0x615c('0x4e')]));_0x615d[_0x615c('0x4c')]=_0x615d[_0x615c('0x4c')][_0x615c('0x4f')]?_0x615d[_0x615c('0x4c')]:_0x465f8a[_0x615c('0x4a')];_0x615d[_0x615c('0x52')]=qs[_0x615c('0x53')](_0x182b36[_0x615c('0x4b')][_0x615c('0x53')]);_0x615d[_0x615c('0x54')]=qs[_0x615c('0x49')](_[_0x615c('0x6e')](_0x182b36[_0x615c('0x4b')],_0x465f8a[_0x615c('0x49')]));if(_0x182b36[_0x615c('0x4b')]['filter']){_0x615d[_0x615c('0x54')]=_[_0x615c('0x56')](_0x615d['where'],{'$or':_[_0x615c('0x41')](_0x615d['attributes'],function(_0x38df99){var _0x28e3c9={};_0x28e3c9[_0x38df99]={'$like':'%'+_0x182b36[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x28e3c9;})});}_0x615d=_['merge']({},_0x615d,_0x182b36['options']);return _0x2936c8[_0x615c('0xca')](_0x615d);}})['then'](function(_0x2c79cb){if(_0x2c79cb){_0x38343c=_0x2c79cb['length'];if(!_0x182b36[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x615d[_0x615c('0x35')]=qs[_0x615c('0x35')](_0x182b36[_0x615c('0x4b')][_0x615c('0x35')]);_0x615d[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x182b36[_0x615c('0x4b')][_0x615c('0x34')]);}return _0x2936c8[_0x615c('0xca')](_0x615d);}})[_0x615c('0x25')](function(_0x1ef89e){if(_0x1ef89e){return _0x1ef89e?{'count':_0x38343c,'rows':_0x1ef89e}:null;}})[_0x615c('0x25')](respondWithResult(_0xc5337,null))[_0x615c('0x2f')](handleError(_0xc5337,null));}; \ No newline at end of file +var _0x29fc=['merge','VIRTUAL','options','includeAll','include','findAll','keys','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','order','sort','pick','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','Answer','push','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','tech','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','List','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','get','FaxAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter'];(function(_0x13d430,_0xfe5f60){var _0x40d925=function(_0x4a631f){while(--_0x4a631f){_0x13d430['push'](_0x13d430['shift']());}};_0x40d925(++_0xfe5f60);}(_0x29fc,0x139));var _0xc29f=function(_0x50a272,_0x1082b4){_0x50a272=_0x50a272-0x0;var _0x8ff3fa=_0x29fc[_0x50a272];return _0x8ff3fa;};'use strict';var emlformat=require(_0xc29f('0x0'));var rimraf=require(_0xc29f('0x1'));var zipdir=require(_0xc29f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc29f('0x3'));var BPromise=require(_0xc29f('0x4'));var Mustache=require(_0xc29f('0x5'));var util=require(_0xc29f('0x6'));var path=require(_0xc29f('0x7'));var sox=require(_0xc29f('0x8'));var csv=require(_0xc29f('0x9'));var ejs=require(_0xc29f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc29f('0xb'));var crypto=require(_0xc29f('0xc'));var jsforce=require(_0xc29f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc29f('0x9'));var querystring=require(_0xc29f('0xe'));var Papa=require(_0xc29f('0xf'));var Redis=require(_0xc29f('0x10'));var authService=require(_0xc29f('0x11'));var qs=require(_0xc29f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc29f('0x13'));var logger=require(_0xc29f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc29f('0x15'));var db=require('../../mysqldb')['db'];config[_0xc29f('0x16')]=_[_0xc29f('0x17')](config[_0xc29f('0x16')],{'host':_0xc29f('0x18'),'port':0x18eb});var socket=require(_0xc29f('0x19'))(new Redis(config[_0xc29f('0x16')]));require('./faxAccount.socket')[_0xc29f('0x1a')](socket);var jayson=require(_0xc29f('0x1b'));var client=jayson[_0xc29f('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xc29f('0x1c')][_0xc29f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x150bea,_0x5a95d8,_0x5ab947,_0x3f01ab){return new BPromise(function(_0x5de3a1,_0x53621a){var _0xf63cbd=_0x3f01ab||client;return _0xf63cbd[_0xc29f('0x1e')](_0x150bea,_0x5ab947)[_0xc29f('0x1f')](function(_0x1bdc78){logger[_0xc29f('0x20')](_0xc29f('0x21'),_0x5a95d8,'request\x20sent');logger[_0xc29f('0x22')](_0xc29f('0x23'),_0x5a95d8,_0xc29f('0x24'),JSON[_0xc29f('0x25')](_0x1bdc78));if(_0x1bdc78[_0xc29f('0x26')]){if(_0x1bdc78['error']['code']===0x1f4){logger[_0xc29f('0x26')](_0xc29f('0x21'),_0x5a95d8,_0x1bdc78[_0xc29f('0x26')][_0xc29f('0x27')]);return _0x53621a(_0x1bdc78['error'][_0xc29f('0x27')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x5a95d8,_0x1bdc78[_0xc29f('0x26')][_0xc29f('0x27')]);return _0x5de3a1(_0x1bdc78[_0xc29f('0x26')]['message']);}else{logger[_0xc29f('0x20')](_0xc29f('0x21'),_0x5a95d8,'request\x20sent');_0x5de3a1(_0x1bdc78[_0xc29f('0x28')]['message']);}})[_0xc29f('0x29')](function(_0x1f6df0){logger[_0xc29f('0x26')](_0xc29f('0x21'),_0x5a95d8,_0x1f6df0);_0x53621a(_0x1f6df0);});});}function respondWithStatusCode(_0x208667,_0x295a2f){_0x295a2f=_0x295a2f||0xcc;return function(_0x50801d){if(_0x50801d){return _0x208667['sendStatus'](_0x295a2f);}return _0x208667[_0xc29f('0x2a')](_0x295a2f)[_0xc29f('0x2b')]();};}function respondWithResult(_0x91e2fc,_0x4c645c){_0x4c645c=_0x4c645c||0xc8;return function(_0x4e6b1b){if(_0x4e6b1b){return _0x91e2fc[_0xc29f('0x2a')](_0x4c645c)[_0xc29f('0x2c')](_0x4e6b1b);}};}function respondWithFilteredResult(_0x151361,_0x14a2d6){return function(_0x1a1fbb){if(_0x1a1fbb){var _0x26ecf3=typeof _0x14a2d6[_0xc29f('0x2d')]===_0xc29f('0x2e')&&typeof _0x14a2d6['limit']===_0xc29f('0x2e');var _0x5e87a3=_0x1a1fbb[_0xc29f('0x2f')];var _0x513216=_0x26ecf3?0x0:_0x14a2d6[_0xc29f('0x2d')];var _0x4bfdbd=_0x26ecf3?_0x1a1fbb['count']:_0x14a2d6[_0xc29f('0x2d')]+_0x14a2d6[_0xc29f('0x30')];var _0x530f51;if(_0x4bfdbd>=_0x5e87a3){_0x4bfdbd=_0x5e87a3;_0x530f51=0xc8;}else{_0x530f51=0xce;}_0x151361[_0xc29f('0x2a')](_0x530f51);return _0x151361['set'](_0xc29f('0x31'),_0x513216+'-'+_0x4bfdbd+'/'+_0x5e87a3)[_0xc29f('0x2c')](_0x1a1fbb);}return null;};}function patchUpdates(_0x74039c){return function(_0x12150c){try{jsonpatch[_0xc29f('0x32')](_0x12150c,_0x74039c,!![]);}catch(_0x3fedb7){return BPromise[_0xc29f('0x33')](_0x3fedb7);}return _0x12150c['save']();};}function saveUpdates(_0x1c46b4,_0x54c563){return function(_0x48baae){if(_0x48baae){return _0x48baae[_0xc29f('0x34')](_0x1c46b4)[_0xc29f('0x1f')](function(_0x4caa54){return _0x4caa54;});}return null;};}function removeEntity(_0x3d426b,_0x2e18ae){return function(_0x234b75){if(_0x234b75){return _0x234b75['destroy']()[_0xc29f('0x1f')](function(){var _0x564e14=_0x234b75[_0xc29f('0x35')]({'plain':!![]});var _0x133721=_0xc29f('0x36');return db[_0xc29f('0x37')][_0xc29f('0x38')]({'where':{'type':_0x133721,'resourceId':_0x564e14['id']}})['then'](function(){return _0x234b75;});})['then'](function(){_0x3d426b[_0xc29f('0x2a')](0xcc)[_0xc29f('0x2b')]();});}};}function handleEntityNotFound(_0x4f2bb1,_0x43f1ff){return function(_0x4ac842){if(!_0x4ac842){_0x4f2bb1[_0xc29f('0x39')](0x194);}return _0x4ac842;};}function handleError(_0x338d0f,_0x1b3e69){_0x1b3e69=_0x1b3e69||0x1f4;return function(_0x2bf5ab){logger[_0xc29f('0x26')](_0x2bf5ab[_0xc29f('0x3a')]);if(_0x2bf5ab[_0xc29f('0x3b')]){delete _0x2bf5ab[_0xc29f('0x3b')];}_0x338d0f[_0xc29f('0x2a')](_0x1b3e69)[_0xc29f('0x3c')](_0x2bf5ab);};}exports[_0xc29f('0x3d')]=function(_0x3b1331,_0x4ece22){var _0x238a48={'include':[{'model':db[_0xc29f('0x3e')],'as':_0xc29f('0x3f')}]},_0x318387={},_0x5159a4={'count':0x0,'rows':[]};var _0x5a6f90=_[_0xc29f('0x40')](db[_0xc29f('0x41')][_0xc29f('0x42')],function(_0x4ca9f7){return{'name':_0x4ca9f7[_0xc29f('0x43')],'type':_0x4ca9f7[_0xc29f('0x44')][_0xc29f('0x45')]};});_0x318387[_0xc29f('0x46')]=_[_0xc29f('0x40')](_0x5a6f90,_0xc29f('0x3b'));_0x318387[_0xc29f('0x47')]=_['keys'](_0x3b1331[_0xc29f('0x47')]);_0x318387[_0xc29f('0x48')]=_[_0xc29f('0x49')](_0x318387['model'],_0x318387['query']);_0x238a48[_0xc29f('0x4a')]=_['intersection'](_0x318387[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0x3b1331[_0xc29f('0x47')][_0xc29f('0x4b')]));_0x238a48['attributes']=_0x238a48[_0xc29f('0x4a')][_0xc29f('0x4c')]?_0x238a48[_0xc29f('0x4a')]:_0x318387[_0xc29f('0x46')];if(!_0x3b1331[_0xc29f('0x47')][_0xc29f('0x4d')](_0xc29f('0x4e'))){_0x238a48[_0xc29f('0x30')]=qs['limit'](_0x3b1331[_0xc29f('0x47')][_0xc29f('0x30')]);_0x238a48['offset']=qs[_0xc29f('0x2d')](_0x3b1331[_0xc29f('0x47')][_0xc29f('0x2d')]);}_0x238a48['order']=qs['sort'](_0x3b1331[_0xc29f('0x47')]['sort']);_0x238a48[_0xc29f('0x4f')]=qs['filters'](_['pick'](_0x3b1331['query'],_0x318387[_0xc29f('0x48')]),_0x5a6f90);if(_0x3b1331[_0xc29f('0x47')][_0xc29f('0x50')]){_0x238a48[_0xc29f('0x4f')]=_[_0xc29f('0x51')](_0x238a48[_0xc29f('0x4f')],{'$or':_[_0xc29f('0x40')](_0x5a6f90,function(_0x3caa5b){if(_0x3caa5b[_0xc29f('0x44')]!==_0xc29f('0x52')){var _0x3af738={};_0x3af738[_0x3caa5b[_0xc29f('0x3b')]]={'$like':'%'+_0x3b1331[_0xc29f('0x47')][_0xc29f('0x50')]+'%'};return _0x3af738;}})});}_0x238a48=_[_0xc29f('0x51')]({},_0x238a48,_0x3b1331[_0xc29f('0x53')]);var _0x49c3dd={'where':_0x238a48[_0xc29f('0x4f')]};return db[_0xc29f('0x41')][_0xc29f('0x2f')](_0x49c3dd)[_0xc29f('0x1f')](function(_0x45453a){_0x5159a4[_0xc29f('0x2f')]=_0x45453a;if(_0x3b1331[_0xc29f('0x47')][_0xc29f('0x54')]){_0x238a48[_0xc29f('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0xc29f('0x56')](_0x238a48);})[_0xc29f('0x1f')](function(_0x39ce87){_0x5159a4['rows']=_0x39ce87;return _0x5159a4;})[_0xc29f('0x1f')](respondWithFilteredResult(_0x4ece22,_0x238a48))['catch'](handleError(_0x4ece22,null));};exports['show']=function(_0x3038ea,_0x5d3ffb){var _0x2a4be1={'raw':![],'where':{'id':_0x3038ea['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1e6642={};_0x1e6642[_0xc29f('0x46')]=_['keys'](db[_0xc29f('0x41')][_0xc29f('0x42')]);_0x1e6642['query']=_[_0xc29f('0x57')](_0x3038ea[_0xc29f('0x47')]);_0x1e6642[_0xc29f('0x48')]=_['intersection'](_0x1e6642[_0xc29f('0x46')],_0x1e6642['query']);_0x2a4be1[_0xc29f('0x4a')]=_['intersection'](_0x1e6642[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0x3038ea['query'][_0xc29f('0x4b')]));_0x2a4be1[_0xc29f('0x4a')]=_0x2a4be1[_0xc29f('0x4a')][_0xc29f('0x4c')]?_0x2a4be1[_0xc29f('0x4a')]:_0x1e6642[_0xc29f('0x46')];if(_0x3038ea[_0xc29f('0x47')][_0xc29f('0x54')]){_0x2a4be1[_0xc29f('0x55')]=[{'all':!![]}];}_0x2a4be1=_[_0xc29f('0x51')]({},_0x2a4be1,_0x3038ea[_0xc29f('0x53')]);return db['FaxAccount'][_0xc29f('0x58')](_0x2a4be1)[_0xc29f('0x1f')](handleEntityNotFound(_0x5d3ffb,null))[_0xc29f('0x1f')](respondWithResult(_0x5d3ffb,null))[_0xc29f('0x29')](handleError(_0x5d3ffb,null));};exports['create']=function(_0x16c534,_0x221570){return db[_0xc29f('0x41')]['create'](_0x16c534['body'],{})[_0xc29f('0x1f')](function(_0x1802e7){var _0x28be3d=_0x16c534[_0xc29f('0x59')][_0xc29f('0x35')]({'plain':!![]});if(!_0x28be3d)throw new Error(_0xc29f('0x5a'));if(_0x28be3d[_0xc29f('0x5b')]===_0xc29f('0x59')){var _0x153210=_0x1802e7[_0xc29f('0x35')]({'plain':!![]});var _0x442804=_0xc29f('0x36');return db[_0xc29f('0x5c')][_0xc29f('0x58')]({'where':{'name':_0x442804,'userProfileId':_0x28be3d['userProfileId']},'raw':!![]})[_0xc29f('0x1f')](function(_0xc49441){if(_0xc49441&&_0xc49441[_0xc29f('0x5d')]===0x0){return db[_0xc29f('0x37')][_0xc29f('0x5e')]({'name':_0x153210['name'],'resourceId':_0x153210['id'],'type':_0xc49441[_0xc29f('0x3b')],'sectionId':_0xc49441['id']},{})[_0xc29f('0x1f')](function(){return _0x1802e7;});}else{return _0x1802e7;}})[_0xc29f('0x29')](function(_0x3d3625){logger[_0xc29f('0x26')](_0xc29f('0x5f'),_0x3d3625);throw _0x3d3625;});}return _0x1802e7;})[_0xc29f('0x1f')](respondWithResult(_0x221570,0xc9))[_0xc29f('0x29')](handleError(_0x221570,null));};exports[_0xc29f('0x34')]=function(_0x2dc654,_0x264f5f){if(_0x2dc654[_0xc29f('0x60')]['id']){delete _0x2dc654[_0xc29f('0x60')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x2dc654[_0xc29f('0x61')]['id']},'include':[{'model':db[_0xc29f('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xc29f('0x1f')](handleEntityNotFound(_0x264f5f,null))[_0xc29f('0x1f')](saveUpdates(_0x2dc654[_0xc29f('0x60')],null))[_0xc29f('0x1f')](respondWithResult(_0x264f5f,null))[_0xc29f('0x29')](handleError(_0x264f5f,null));};exports[_0xc29f('0x38')]=function(_0x3cb511,_0x491d33){return db[_0xc29f('0x41')]['find']({'where':{'id':_0x3cb511[_0xc29f('0x61')]['id']}})['then'](handleEntityNotFound(_0x491d33,null))[_0xc29f('0x1f')](removeEntity(_0x491d33,null))['catch'](handleError(_0x491d33,null));};exports[_0xc29f('0x62')]=function(_0x3bb5ae,_0x4a53a9){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x4a53a9,null))[_0xc29f('0x29')](handleError(_0x4a53a9,null));};exports[_0xc29f('0x63')]=function(_0x3f44a2,_0x3c3dce,_0x3b63cf){if(_0x3f44a2[_0xc29f('0x60')]['id']){delete _0x3f44a2[_0xc29f('0x60')]['id'];}return db[_0xc29f('0x41')]['find']({'where':{'id':_0x3f44a2[_0xc29f('0x61')]['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x3c3dce,null))['then'](function(_0xaba9bb){if(_0xaba9bb){_0x3f44a2[_0xc29f('0x60')][_0xc29f('0x64')]=_0xaba9bb['id'];return db['Disposition']['create'](_0x3f44a2[_0xc29f('0x60')]);}})[_0xc29f('0x1f')](respondWithResult(_0x3c3dce,null))[_0xc29f('0x29')](handleError(_0x3c3dce,null));};exports[_0xc29f('0x65')]=function(_0x123f9d,_0x3e3fd7,_0xd2a4cb){var _0x306634={'raw':![],'where':{}};var _0x229513={};var _0x18108c={'count':0x0,'rows':[]};return db[_0xc29f('0x41')][_0xc29f('0x66')]({'where':{'id':_0x123f9d[_0xc29f('0x61')]['id']}})['then'](handleEntityNotFound(_0x3e3fd7,null))[_0xc29f('0x1f')](function(_0x5b4d6a){if(_0x5b4d6a){_0x229513['model']=_[_0xc29f('0x57')](db[_0xc29f('0x67')]['rawAttributes']);_0x229513[_0xc29f('0x47')]=_[_0xc29f('0x57')](_0x123f9d['query']);_0x229513[_0xc29f('0x48')]=_[_0xc29f('0x49')](_0x229513[_0xc29f('0x46')],_0x229513[_0xc29f('0x47')]);_0x306634[_0xc29f('0x4a')]=_[_0xc29f('0x49')](_0x229513[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0x123f9d[_0xc29f('0x47')]['fields']));_0x306634[_0xc29f('0x4a')]=_0x306634[_0xc29f('0x4a')][_0xc29f('0x4c')]?_0x306634[_0xc29f('0x4a')]:_0x229513['model'];if(!_0x123f9d['query'][_0xc29f('0x4d')](_0xc29f('0x4e'))){_0x306634[_0xc29f('0x30')]=qs[_0xc29f('0x30')](_0x123f9d[_0xc29f('0x47')]['limit']);_0x306634[_0xc29f('0x2d')]=qs[_0xc29f('0x2d')](_0x123f9d[_0xc29f('0x47')][_0xc29f('0x2d')]);}_0x306634[_0xc29f('0x68')]=qs[_0xc29f('0x69')](_0x123f9d['query'][_0xc29f('0x69')]);_0x306634[_0xc29f('0x4f')]=qs[_0xc29f('0x48')](_[_0xc29f('0x6a')](_0x123f9d[_0xc29f('0x47')],_0x229513[_0xc29f('0x48')]));_0x306634[_0xc29f('0x4f')][_0xc29f('0x64')]=_0x5b4d6a['id'];if(_0x123f9d[_0xc29f('0x47')][_0xc29f('0x50')]){_0x306634[_0xc29f('0x4f')]=_[_0xc29f('0x51')](_0x306634[_0xc29f('0x4f')],{'$or':_['map'](_0x306634[_0xc29f('0x4a')],function(_0x3d2435){var _0x4a3844={};_0x4a3844[_0x3d2435]={'$like':'%'+_0x123f9d[_0xc29f('0x47')][_0xc29f('0x50')]+'%'};return _0x4a3844;})});}_0x306634=_[_0xc29f('0x51')]({},_0x306634,_0x123f9d['options']);return db[_0xc29f('0x67')]['count']({'where':_0x306634[_0xc29f('0x4f')]})[_0xc29f('0x1f')](function(_0x3c44ac){_0x18108c[_0xc29f('0x2f')]=_0x3c44ac;if(_0x123f9d[_0xc29f('0x47')]['includeAll']){_0x306634[_0xc29f('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xc29f('0x56')](_0x306634);})[_0xc29f('0x1f')](function(_0x3bfdee){_0x18108c['rows']=_0x3bfdee;return _0x18108c;});}})[_0xc29f('0x1f')](respondWithFilteredResult(_0x3e3fd7,_0x306634))['catch'](handleError(_0x3e3fd7,null));};exports['removeDispositions']=function(_0x19cca8,_0x16a480,_0x571b72){return db[_0xc29f('0x41')][_0xc29f('0x58')]({'where':{'id':_0x19cca8['params']['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x16a480,null))['then'](function(_0x240bea){if(_0x240bea){return _0x240bea['removeDispositions'](_0x19cca8[_0xc29f('0x47')][_0xc29f('0x6b')]);}})[_0xc29f('0x1f')](respondWithStatusCode(_0x16a480,null))[_0xc29f('0x29')](handleError(_0x16a480,null));};exports[_0xc29f('0x6c')]=function(_0x3d983f,_0x163b85,_0x515afd){if(_0x3d983f[_0xc29f('0x60')]['id']){delete _0x3d983f[_0xc29f('0x60')]['id'];}return db['FaxAccount'][_0xc29f('0x58')]({'where':{'id':_0x3d983f[_0xc29f('0x61')]['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x163b85,null))['then'](function(_0x4a0e81){if(_0x4a0e81){_0x3d983f['body'][_0xc29f('0x64')]=_0x4a0e81['id'];return db[_0xc29f('0x6d')][_0xc29f('0x5e')](_0x3d983f['body']);}})[_0xc29f('0x1f')](respondWithResult(_0x163b85,null))[_0xc29f('0x29')](handleError(_0x163b85,null));};exports[_0xc29f('0x6e')]=function(_0x3d0e3a,_0x40bd0e,_0x59cc3c){var _0x448347={'raw':![],'where':{}};var _0x162e7f={};var _0x431048={'count':0x0,'rows':[]};return db[_0xc29f('0x41')][_0xc29f('0x66')]({'where':{'id':_0x3d0e3a[_0xc29f('0x61')]['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x40bd0e,null))[_0xc29f('0x1f')](function(_0x1dc2af){if(_0x1dc2af){_0x162e7f[_0xc29f('0x46')]=_['keys'](db[_0xc29f('0x6d')][_0xc29f('0x42')]);_0x162e7f[_0xc29f('0x47')]=_[_0xc29f('0x57')](_0x3d0e3a[_0xc29f('0x47')]);_0x162e7f[_0xc29f('0x48')]=_[_0xc29f('0x49')](_0x162e7f['model'],_0x162e7f[_0xc29f('0x47')]);_0x448347['attributes']=_[_0xc29f('0x49')](_0x162e7f[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0x3d0e3a[_0xc29f('0x47')][_0xc29f('0x4b')]));_0x448347['attributes']=_0x448347['attributes'][_0xc29f('0x4c')]?_0x448347[_0xc29f('0x4a')]:_0x162e7f[_0xc29f('0x46')];if(!_0x3d0e3a['query'][_0xc29f('0x4d')](_0xc29f('0x4e'))){_0x448347[_0xc29f('0x30')]=qs[_0xc29f('0x30')](_0x3d0e3a['query'][_0xc29f('0x30')]);_0x448347['offset']=qs[_0xc29f('0x2d')](_0x3d0e3a[_0xc29f('0x47')][_0xc29f('0x2d')]);}_0x448347['order']=qs[_0xc29f('0x69')](_0x3d0e3a['query'][_0xc29f('0x69')]);_0x448347['where']=qs[_0xc29f('0x48')](_['pick'](_0x3d0e3a[_0xc29f('0x47')],_0x162e7f[_0xc29f('0x48')]));_0x448347[_0xc29f('0x4f')][_0xc29f('0x64')]=_0x1dc2af['id'];if(_0x3d0e3a['query'][_0xc29f('0x50')]){_0x448347[_0xc29f('0x4f')]=_[_0xc29f('0x51')](_0x448347[_0xc29f('0x4f')],{'$or':_[_0xc29f('0x40')](_0x448347['attributes'],function(_0x63bf56){var _0x4fbecd={};_0x4fbecd[_0x63bf56]={'$like':'%'+_0x3d0e3a[_0xc29f('0x47')][_0xc29f('0x50')]+'%'};return _0x4fbecd;})});}_0x448347=_['merge']({},_0x448347,_0x3d0e3a[_0xc29f('0x53')]);return db[_0xc29f('0x6d')][_0xc29f('0x2f')]({'where':_0x448347[_0xc29f('0x4f')]})[_0xc29f('0x1f')](function(_0x3c0bb2){_0x431048[_0xc29f('0x2f')]=_0x3c0bb2;if(_0x3d0e3a[_0xc29f('0x47')][_0xc29f('0x54')]){_0x448347[_0xc29f('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc29f('0x56')](_0x448347);})[_0xc29f('0x1f')](function(_0x2119c6){_0x431048[_0xc29f('0x6f')]=_0x2119c6;return _0x431048;});}})[_0xc29f('0x1f')](respondWithFilteredResult(_0x40bd0e,_0x448347))['catch'](handleError(_0x40bd0e,null));};exports[_0xc29f('0x70')]=function(_0x46702f,_0x56dc58,_0x99602e){return db['FaxAccount']['find']({'where':{'id':_0x46702f['params']['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x56dc58,null))[_0xc29f('0x1f')](function(_0x3a3831){if(_0x3a3831){return _0x3a3831[_0xc29f('0x70')](_0x46702f[_0xc29f('0x47')][_0xc29f('0x6b')]);}})['then'](respondWithStatusCode(_0x56dc58,null))[_0xc29f('0x29')](handleError(_0x56dc58,null));};exports[_0xc29f('0x71')]=function(_0x3cea55,_0x234e86,_0x2828a5){return db['FaxInteraction'][_0xc29f('0x58')]({'where':{'id':_0x3cea55['params']['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x234e86,null))[_0xc29f('0x1f')](function(_0x409dd0){if(_0x409dd0){return _0x409dd0[_0xc29f('0x71')](_0x3cea55[_0xc29f('0x60')][_0xc29f('0x6b')],_[_0xc29f('0x72')](_0x3cea55['body'],['ids','id'])||{});}})[_0xc29f('0x1f')](respondWithResult(_0x234e86,null))[_0xc29f('0x29')](handleError(_0x234e86,null));};exports[_0xc29f('0x73')]=function(_0x1a20e5,_0x52abd7,_0xf3482a){var _0x213535={'raw':![],'where':{}};var _0x31c38e={};var _0x481923={'count':0x0,'rows':[]};return db[_0xc29f('0x41')][_0xc29f('0x66')]({'where':{'id':_0x1a20e5['params']['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x52abd7,null))[_0xc29f('0x1f')](function(_0xcfc6cf){if(_0xcfc6cf){_0x31c38e['model']=_[_0xc29f('0x57')](db['FaxInteraction'][_0xc29f('0x42')]);_0x31c38e[_0xc29f('0x47')]=_[_0xc29f('0x57')](_0x1a20e5[_0xc29f('0x47')]);_0x31c38e['filters']=_['intersection'](_0x31c38e['model'],_0x31c38e[_0xc29f('0x47')]);_0x213535[_0xc29f('0x4a')]=_[_0xc29f('0x49')](_0x31c38e[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0x1a20e5[_0xc29f('0x47')][_0xc29f('0x4b')]));_0x213535[_0xc29f('0x4a')]=_0x213535[_0xc29f('0x4a')]['length']?_0x213535[_0xc29f('0x4a')]:_0x31c38e['model'];if(!_0x1a20e5['query'][_0xc29f('0x4d')](_0xc29f('0x4e'))){_0x213535[_0xc29f('0x30')]=qs[_0xc29f('0x30')](_0x1a20e5['query'][_0xc29f('0x30')]);_0x213535[_0xc29f('0x2d')]=qs[_0xc29f('0x2d')](_0x1a20e5[_0xc29f('0x47')]['offset']);}_0x213535[_0xc29f('0x68')]=qs[_0xc29f('0x69')](_0x1a20e5[_0xc29f('0x47')]['sort']);_0x213535['where']=qs[_0xc29f('0x48')](_['pick'](_0x1a20e5['query'],_0x31c38e['filters']));_0x213535[_0xc29f('0x4f')][_0xc29f('0x64')]=_0xcfc6cf['id'];if(_0x1a20e5[_0xc29f('0x47')]['filter']){_0x213535[_0xc29f('0x4f')]=_['merge'](_0x213535[_0xc29f('0x4f')],{'$or':_['map'](_0x213535[_0xc29f('0x4a')],function(_0x2324ae){var _0x43ad62={};_0x43ad62[_0x2324ae]={'$like':'%'+_0x1a20e5[_0xc29f('0x47')][_0xc29f('0x50')]+'%'};return _0x43ad62;})});}_0x213535=_[_0xc29f('0x51')]({},_0x213535,_0x1a20e5[_0xc29f('0x53')]);return db[_0xc29f('0x74')][_0xc29f('0x2f')]({'where':_0x213535[_0xc29f('0x4f')]})[_0xc29f('0x1f')](function(_0x23227e){_0x481923[_0xc29f('0x2f')]=_0x23227e;if(_0x1a20e5['query'][_0xc29f('0x54')]){_0x213535[_0xc29f('0x55')]=[{'model':db[_0xc29f('0x75')],'as':_0xc29f('0x76'),'required':![]},{'model':db[_0xc29f('0x77')],'as':_0xc29f('0x78'),'attributes':[_0xc29f('0x3b'),_0xc29f('0x79'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xc29f('0x7a'),'attributes':['id',_0xc29f('0x3b'),_0xc29f('0x7b')],'where':_0x1a20e5[_0xc29f('0x47')][_0xc29f('0x7c')]?{'id':_0x1a20e5['query'][_0xc29f('0x7c')]}:undefined,'required':_0x1a20e5[_0xc29f('0x47')][_0xc29f('0x7c')]?!![]:![]}];}return db[_0xc29f('0x74')][_0xc29f('0x56')](_0x213535);})[_0xc29f('0x1f')](function(_0x2443b9){_0x481923[_0xc29f('0x6f')]=_0x2443b9;return _0x481923;});}})[_0xc29f('0x1f')](respondWithFilteredResult(_0x52abd7,_0x213535))[_0xc29f('0x29')](handleError(_0x52abd7,null));};exports[_0xc29f('0x7d')]=function(_0x26752e,_0x403445){var _0x12afd8=_0x26752e['params']['id'];var _0x39f10=_0x26752e['body'];var _0x1dcc3a=0xc8;var _0xc64d2e=null;return db[_0xc29f('0x7e')][_0xc29f('0x7f')]({'isolationLevel':db[_0xc29f('0x7e')][_0xc29f('0x80')][_0xc29f('0x81')][_0xc29f('0x82')]},function(_0x1feb10){return db[_0xc29f('0x41')][_0xc29f('0x66')]({'where':{'id':_0x12afd8},'transaction':_0x1feb10})['then'](function(_0x480353){if(_0x480353){return db[_0xc29f('0x83')]['destroy']({'where':{'FaxAccountId':_0x12afd8},'transaction':_0x1feb10})[_0xc29f('0x1f')](function(){var _0x1d98d0=_[_0xc29f('0x40')](_0x39f10,function(_0x5178af){_0x5178af['FaxAccountId']=_0x12afd8;return _0x5178af;});return db[_0xc29f('0x83')][_0xc29f('0x84')](_0x1d98d0,{'transaction':_0x1feb10});});}else{_0x1dcc3a=0x194;_0xc64d2e=[];}});})[_0xc29f('0x1f')](function(){if(_0x1dcc3a!==0x194){return db[_0xc29f('0x83')][_0xc29f('0x85')]({'where':{'FaxAccountId':_0x12afd8},'order':_0xc29f('0x86')})[_0xc29f('0x1f')](function(_0x1b58c7){_0xc64d2e=_0x1b58c7;});}})['catch'](function(_0x382af6){_0x1dcc3a=0x1f4;logger[_0xc29f('0x26')](_0x382af6['stack']);if(_0x382af6[_0xc29f('0x3b')]){delete _0x382af6[_0xc29f('0x3b')];}_0xc64d2e=_0x382af6;})[_0xc29f('0x87')](function(){if(_0xc64d2e===null){_0x403445['sendStatus'](_0x1dcc3a);}else{if(_0x1dcc3a===0x1f4){_0x403445['status'](_0x1dcc3a)[_0xc29f('0x3c')](_0xc64d2e);}else{_0x403445[_0xc29f('0x2a')](_0x1dcc3a)['json'](_0xc64d2e);}}});};exports[_0xc29f('0x88')]=function(_0xbd026a,_0xc98347,_0x14b925){var _0x2da835={};var _0x47d556={};var _0x9fd3dc;var _0x4837b4;return db[_0xc29f('0x41')][_0xc29f('0x66')]({'where':{'id':_0xbd026a[_0xc29f('0x61')]['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0xc98347,null))[_0xc29f('0x1f')](function(_0x5d4321){if(_0x5d4321){_0x9fd3dc=_0x5d4321;_0x47d556[_0xc29f('0x46')]=_[_0xc29f('0x57')](db[_0xc29f('0x83')][_0xc29f('0x42')]);_0x47d556[_0xc29f('0x47')]=_[_0xc29f('0x57')](_0xbd026a[_0xc29f('0x47')]);_0x47d556[_0xc29f('0x48')]=_[_0xc29f('0x49')](_0x47d556[_0xc29f('0x46')],_0x47d556[_0xc29f('0x47')]);_0x2da835[_0xc29f('0x4a')]=_['intersection'](_0x47d556[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0xbd026a[_0xc29f('0x47')][_0xc29f('0x4b')]));_0x2da835['attributes']=_0x2da835['attributes'][_0xc29f('0x4c')]?_0x2da835[_0xc29f('0x4a')]:_0x47d556['model'];_0x2da835['order']=qs[_0xc29f('0x69')](_0xbd026a[_0xc29f('0x47')][_0xc29f('0x69')]);_0x2da835['where']=qs[_0xc29f('0x48')](_[_0xc29f('0x6a')](_0xbd026a[_0xc29f('0x47')],_0x47d556['filters']));if(_0xbd026a[_0xc29f('0x47')]['filter']){_0x2da835['where']=_[_0xc29f('0x51')](_0x2da835[_0xc29f('0x4f')],{'$or':_[_0xc29f('0x40')](_0x2da835[_0xc29f('0x4a')],function(_0xbab069){var _0x51acdf={};_0x51acdf[_0xbab069]={'$like':'%'+_0xbd026a[_0xc29f('0x47')][_0xc29f('0x50')]+'%'};return _0x51acdf;})});}_0x2da835=_['merge']({},_0x2da835,_0xbd026a['options']);return _0x9fd3dc['getApplications'](_0x2da835);}})['then'](function(_0x137545){if(_0x137545){_0x4837b4=_0x137545['length'];if(!_0xbd026a[_0xc29f('0x47')]['hasOwnProperty']('nolimit')){_0x2da835[_0xc29f('0x30')]=qs[_0xc29f('0x30')](_0xbd026a[_0xc29f('0x47')]['limit']);_0x2da835[_0xc29f('0x2d')]=qs[_0xc29f('0x2d')](_0xbd026a[_0xc29f('0x47')]['offset']);}return _0x9fd3dc[_0xc29f('0x88')](_0x2da835);}})[_0xc29f('0x1f')](function(_0x965e78){if(_0x965e78){return _0x965e78?{'count':_0x4837b4,'rows':_0x965e78}:null;}})[_0xc29f('0x1f')](respondWithResult(_0xc98347,null))['catch'](handleError(_0xc98347,null));};function Extension(_0x24c7ae,_0x50d4ad,_0x2fb457,_0xc5c689){this[_0xc29f('0x89')]=_0xc29f('0x8a');this[_0xc29f('0x8b')]=_0x24c7ae[_0xc29f('0x8c')];this[_0xc29f('0x8d')]=_0xc5c689;this[_0xc29f('0x44')]='system';this[_0xc29f('0x8e')]=_0xc29f('0x8f');this[_0xc29f('0x64')]=_0x24c7ae['id'];this['priority']=_0x50d4ad;this[_0xc29f('0x90')]=_0x2fb457;}function createExtensionsReciveFax(_0x47f8f4){var _0x3d4edb=0x1;var _0x7e8781=[];_0x7e8781['push'](new Extension(_0x47f8f4,_0x3d4edb,'',_0xc29f('0x91')));_0x3d4edb+=0x1;_0x7e8781[_0xc29f('0x92')](new Extension(_0x47f8f4,_0x3d4edb,'CDR(type)=inbound-fax',_0xc29f('0x93')));_0x3d4edb+=0x1;for(var _0x3aba79 in _0x47f8f4){if(_0x47f8f4[_0xc29f('0x4d')](_0x3aba79)&&(_0x3aba79===_0xc29f('0x94')||_0x3aba79==='localstationid'||_0x3aba79===_0xc29f('0x95')||_0x3aba79===_0xc29f('0x96')||_0x3aba79===_0xc29f('0x97')||_0x3aba79===_0xc29f('0x98')||_0x3aba79===_0xc29f('0x99')||_0x3aba79===_0xc29f('0x9a')||_0x3aba79===_0xc29f('0x9b'))){_0x7e8781[_0xc29f('0x92')](new Extension(_0x47f8f4,_0x3d4edb,'FAXOPT('+_0x3aba79+')='+_0x47f8f4[_0x3aba79],_0xc29f('0x93')));_0x3d4edb+=0x1;}}_0x7e8781['push'](new Extension(_0x47f8f4,_0x3d4edb,'6',_0xc29f('0x9c')));_0x3d4edb+=0x1;_0x7e8781[_0xc29f('0x92')](new Extension(_0x47f8f4,_0x3d4edb,_0xc29f('0x9d'),_0xc29f('0x9e')));_0x3d4edb=0x0;return _0x7e8781;}exports[_0xc29f('0x9f')]=function(_0x270556,_0x106cff,_0x766cf6){var _0x586210;return db['sequelize'][_0xc29f('0x7f')](function(_0x59eba7){return db[_0xc29f('0x41')][_0xc29f('0x5e')](_0x270556['body'],{'transaction':_0x59eba7})[_0xc29f('0x1f')](function(_0x490783){_0x586210=_0x490783['get']({'plain':!![]});return db['VoiceExtension'][_0xc29f('0x84')](createExtensionsReciveFax(_0x586210),{'transaction':_0x59eba7});});})[_0xc29f('0x1f')](function(){return _0x586210;})[_0xc29f('0x1f')](respondWithResult(_0x106cff,null))['catch'](handleError(_0x106cff,null));};exports[_0xc29f('0xa0')]=function(_0x143a69,_0x15b576,_0x341b58){var _0x36c919;return db[_0xc29f('0x7e')]['transaction'](function(_0x5259d0){return db[_0xc29f('0x41')][_0xc29f('0x34')](_0x143a69[_0xc29f('0x60')],{'where':{'id':_0x143a69[_0xc29f('0x60')]['id']},'transaction':_0x5259d0})['then'](function(_0x429bee){return db[_0xc29f('0xa1')]['destroy']({'where':{'FaxAccountId':_0x143a69[_0xc29f('0x60')]['id']},'transaction':_0x5259d0})[_0xc29f('0x1f')](function(_0x428b2f){return db[_0xc29f('0xa1')][_0xc29f('0x84')](createExtensionsReciveFax(_[_0xc29f('0x72')](_0x143a69[_0xc29f('0x60')],[_0xc29f('0xa2'),_0xc29f('0x45'),'createdAt','updatedAt','TrunkId','ListId'])),{'transaction':_0x5259d0});});});})[_0xc29f('0x1f')](function(){return db[_0xc29f('0x41')]['findById'](_0x143a69[_0xc29f('0x60')]['id']);})[_0xc29f('0x1f')](respondWithResult(_0x15b576,null))['catch'](handleError(_0x15b576,null));};exports[_0xc29f('0xa3')]=function(_0x4be7cd,_0x1015be,_0x4c6cd1){var _0x8fca91={'raw':!![],'where':{}};var _0x405bfe={};var _0x4a9d0b={'count':0x0,'rows':[]};return db[_0xc29f('0x41')][_0xc29f('0x66')]({'where':{'id':_0x4be7cd[_0xc29f('0x61')]['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x1015be,null))[_0xc29f('0x1f')](function(_0x1e5244){if(_0x1e5244){_0x405bfe['model']=_[_0xc29f('0x57')](db[_0xc29f('0xa4')][_0xc29f('0x42')]);_0x405bfe[_0xc29f('0x47')]=_[_0xc29f('0x57')](_0x4be7cd[_0xc29f('0x47')]);_0x405bfe[_0xc29f('0x48')]=_[_0xc29f('0x49')](_0x405bfe['model'],_0x405bfe[_0xc29f('0x47')]);_0x8fca91[_0xc29f('0x4a')]=_[_0xc29f('0x49')](_0x405bfe[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0x4be7cd[_0xc29f('0x47')][_0xc29f('0x4b')]));_0x8fca91[_0xc29f('0x4a')]=_0x8fca91[_0xc29f('0x4a')][_0xc29f('0x4c')]?_0x8fca91[_0xc29f('0x4a')]:_0x405bfe[_0xc29f('0x46')];if(!_0x4be7cd['query'][_0xc29f('0x4d')]('nolimit')){_0x8fca91[_0xc29f('0x30')]=qs[_0xc29f('0x30')](_0x4be7cd[_0xc29f('0x47')][_0xc29f('0x30')]);_0x8fca91[_0xc29f('0x2d')]=qs[_0xc29f('0x2d')](_0x4be7cd[_0xc29f('0x47')][_0xc29f('0x2d')]);}_0x8fca91['order']=qs['sort'](_0x4be7cd[_0xc29f('0x47')][_0xc29f('0x69')]);_0x8fca91[_0xc29f('0x4f')]=qs['filters'](_['pick'](_0x4be7cd[_0xc29f('0x47')],_0x405bfe[_0xc29f('0x48')]));_0x8fca91[_0xc29f('0x4f')][_0xc29f('0x64')]=_0x1e5244['id'];if(_0x4be7cd[_0xc29f('0x47')]['filter']){_0x8fca91[_0xc29f('0x4f')]=_[_0xc29f('0x51')](_0x8fca91[_0xc29f('0x4f')],{'$or':_[_0xc29f('0x40')](_0x8fca91[_0xc29f('0x4a')],function(_0x2d39d8){var _0x970f9d={};_0x970f9d[_0x2d39d8]={'$like':'%'+_0x4be7cd['query'][_0xc29f('0x50')]+'%'};return _0x970f9d;})});}if(_0x4be7cd[_0xc29f('0x47')][_0xc29f('0xa5')]){var _0x3ac147=_0x4be7cd[_0xc29f('0x47')][_0xc29f('0xa5')][_0xc29f('0xa6')](',');var _0x5caa49={};_0x5caa49[_0x3ac147[0x0]]={'$gte':moment(_0x3ac147[0x1])['format'](_0xc29f('0xa7'))};_0x8fca91[_0xc29f('0x4f')]=_[_0xc29f('0x51')](_0x8fca91[_0xc29f('0x4f')],_0x5caa49);}_0x8fca91=_[_0xc29f('0x51')]({},_0x8fca91,_0x4be7cd['options']);return db['FaxMessage'][_0xc29f('0x2f')]({'where':_0x8fca91[_0xc29f('0x4f')]})[_0xc29f('0x1f')](function(_0x5b9340){_0x4a9d0b[_0xc29f('0x2f')]=_0x5b9340;if(_0x4be7cd[_0xc29f('0x47')][_0xc29f('0x54')]){_0x8fca91[_0xc29f('0x55')]=[{'all':!![]}];}return db[_0xc29f('0xa4')][_0xc29f('0x56')](_0x8fca91);})[_0xc29f('0x1f')](function(_0x58853b){_0x4a9d0b[_0xc29f('0x6f')]=_0x58853b;return _0x4a9d0b;});}})[_0xc29f('0x1f')](respondWithFilteredResult(_0x1015be,_0x8fca91))[_0xc29f('0x29')](handleError(_0x1015be,null));};exports[_0xc29f('0x3c')]=function(_0x3bf120,_0x358934,_0x5b2a24){var _0x16d95b,_0x1bfec8={},_0x441095;if(_0x3bf120['body']['to']){_0x441095=_0x3bf120[_0xc29f('0x60')]['to'][0x0];}return db[_0xc29f('0x41')]['find']({'where':{'id':_0x3bf120['params']['id']},'include':[{'model':db[_0xc29f('0xa8')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc29f('0xa9'),'where':{'fax':_0x441095},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xc29f('0x1f')](handleEntityNotFound(_0x358934,null))[_0xc29f('0x1f')](function(_0x5cdef1){_0x16d95b=_0x5cdef1;if(_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')]&&_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')][_0xc29f('0x4c')]){for(var _0x381b4e=0x0;_0x381b4e<_0x3bf120['body'][_0xc29f('0xaa')][_0xc29f('0x4c')];_0x381b4e+=0x1){_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')][_0x381b4e]={'filename':_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')][_0x381b4e]['name'],'id':_0x3bf120[_0xc29f('0x60')]['attachments'][_0x381b4e]['id'],'path':path[_0xc29f('0xab')](config['root'],_0xc29f('0xac'),_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')][_0x381b4e][_0xc29f('0xad')])};}}return respondWithRpcPromise('CheckAfterSend',_0xc29f('0xae'),{'FaxAccountId':_[_0xc29f('0xaf')](_0x3bf120['params']['id'])?undefined:_0x3bf120[_0xc29f('0x61')]['id'],'path':_[_0xc29f('0xaf')](_0x3bf120['body'][_0xc29f('0xaa')][0x0]['path'])?undefined:_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')][0x0][_0xc29f('0x7')],'fax':_[_0xc29f('0xaf')](_0x3bf120[_0xc29f('0x60')]['to'][0x0])?undefined:_0x3bf120[_0xc29f('0x60')]['to'][0x0]},client9002);})[_0xc29f('0x1f')](function(){if(_0x16d95b){if(_[_0xc29f('0xaf')](_0x3bf120[_0xc29f('0x60')][_0xc29f('0xb0')])){_0x3bf120['body'][_0xc29f('0xb0')]=util[_0xc29f('0xb1')](_0xc29f('0xb2'),_0x16d95b['name'],_0x16d95b['fax']);}if(_0x16d95b[_0xc29f('0xb3')]){if(_0x16d95b[_0xc29f('0xb3')][_0xc29f('0xa9')]['length']){return _0x16d95b[_0xc29f('0xb3')][_0xc29f('0xa9')][0x0];}else{return db[_0xc29f('0x75')][_0xc29f('0x5e')](_[_0xc29f('0x17')](_0x3bf120[_0xc29f('0x60')],{'firstName':_0x3bf120['body']['to'][0x0],'phone':_0x3bf120[_0xc29f('0x60')]['to'][0x0],'fax':_0x3bf120[_0xc29f('0x60')]['to'][0x0],'ListId':_0x16d95b[_0xc29f('0xb4')]}));}}else{throw new Error(_0xc29f('0xb5'));}}else{throw new Error(_0xc29f('0xb6'));}})[_0xc29f('0x1f')](function(_0x58d2e0){if(_0x58d2e0){return db[_0xc29f('0x74')]['find']({'where':{'ContactId':_0x58d2e0['id'],'closed':![],'FaxAccountId':_0x16d95b['id']}})[_0xc29f('0x1f')](function(_0x278f37){if(_0x278f37){return[_0x278f37,![]];}return db[_0xc29f('0x74')][_0xc29f('0x5e')]({'UserId':_0x3bf120[_0xc29f('0x59')]['id'],'ContactId':_0x58d2e0['id'],'FaxAccountId':_0x16d95b['id'],'fax':_0x3bf120[_0xc29f('0x60')]['to'][0x0],'firstMsgDirection':_0xc29f('0xb7'),'Messages':[_['merge'](_0x3bf120[_0xc29f('0x60')],{'read':![],'body':_0x3bf120[_0xc29f('0x60')]['attachments'][0x0][_0xc29f('0xb8')],'FaxAccountId':_0x16d95b['id'],'UserId':_0x3bf120[_0xc29f('0x59')]['id'],'ContactId':_0x58d2e0['id'],'AttachmentId':_0x3bf120['body']['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xc29f('0xb9')}]})[_0xc29f('0x1f')](function(_0x1bc1f8){return[_0x1bc1f8,!![]];});});}else{throw new Error(_0xc29f('0xba'));}})[_0xc29f('0xbb')](function(_0x4ee2cf,_0x1c13ac){if(_0x1c13ac){return _0x4ee2cf;}return db['FaxMessage'][_0xc29f('0x5e')]({'direction':_0xc29f('0xb7'),'read':![],'body':_0x3bf120[_0xc29f('0x60')]['attachments'][0x0][_0xc29f('0xb8')],'FaxAccountId':_0x16d95b['id'],'FaxInteractionId':_0x4ee2cf['id'],'UserId':_0x3bf120['user']['id'],'ContactId':_0x4ee2cf[_0xc29f('0xbc')],'AttachmentId':_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')][0x0]['id']})[_0xc29f('0x1f')](function(_0x114cd1){_0x4ee2cf[_0xc29f('0xbd')][_0xc29f('0xb9')]=[];_0x4ee2cf[_0xc29f('0xbd')][_0xc29f('0xb9')][_0xc29f('0x92')](_0x114cd1['dataValues']);return _0x4ee2cf;});})[_0xc29f('0x1f')](function(_0x41770e){respondWithRpcPromise(_0xc29f('0xbe'),_0xc29f('0xbe'),{'FaxAccountId':_['isNil'](_0x3bf120[_0xc29f('0x61')]['id'])?undefined:_0x3bf120[_0xc29f('0x61')]['id'],'path':_[_0xc29f('0xaf')](_0x3bf120['body'][_0xc29f('0xaa')][0x0]['path'])?undefined:_0x3bf120[_0xc29f('0x60')][_0xc29f('0xaa')][0x0][_0xc29f('0x7')],'fax':_[_0xc29f('0xaf')](_0x3bf120['body']['to'][0x0])?undefined:_0x3bf120[_0xc29f('0x60')]['to'][0x0],'AttachmentId':_0x3bf120[_0xc29f('0x60')]['attachments'][0x0]['id']},client9002)[_0xc29f('0x1f')](function(_0xd9656d){logger[_0xc29f('0x20')](_0xc29f('0xbf'),_0xd9656d);})['catch'](function(_0x598b83){logger['info']('SendFaxRpc,\x20%s',_0x598b83);});return _0x41770e;})[_0xc29f('0x1f')](respondWithResult(_0x358934,null))['catch'](handleError(_0x358934,null));};exports[_0xc29f('0xc0')]=function(_0x45224c,_0x504903,_0x89d3e1){return db['FaxAccount'][_0xc29f('0x58')]({'where':{'id':_0x45224c['params']['id']}})['then'](handleEntityNotFound(_0x504903,null))[_0xc29f('0x1f')](function(_0x1be1ef){if(_0x1be1ef){return _0x1be1ef[_0xc29f('0xc0')](_0x45224c[_0xc29f('0x60')][_0xc29f('0x6b')],_['omit'](_0x45224c[_0xc29f('0x60')],[_0xc29f('0x6b'),'id'])||{})[_0xc29f('0xbb')](function(_0x37d2df){for(var _0x4e409a=0x0;_0x4e409a<_0x45224c[_0xc29f('0x60')][_0xc29f('0x6b')]['length'];_0x4e409a+=0x1){socket[_0xc29f('0xc1')](_0xc29f('0xc2'),{'UserId':Number(_0x45224c['body'][_0xc29f('0x6b')][_0x4e409a]),'FaxAccountId':Number(_0x45224c[_0xc29f('0x61')]['id'])});}return _0x37d2df;});}})[_0xc29f('0x1f')](respondWithResult(_0x504903,null))[_0xc29f('0x29')](handleError(_0x504903,null));};exports[_0xc29f('0xc3')]=function(_0xe42f5,_0x443698,_0x21caab){return db[_0xc29f('0x41')]['find']({'where':{'id':_0xe42f5[_0xc29f('0x61')]['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x443698,null))['then'](function(_0x771efb){if(_0x771efb){return _0x771efb[_0xc29f('0xc3')](_0xe42f5[_0xc29f('0x47')][_0xc29f('0x6b')])[_0xc29f('0x1f')](function(){if(_['isArray'](_0xe42f5[_0xc29f('0x47')]['ids'])){for(var _0x3632e4=0x0;_0x3632e4<_0xe42f5[_0xc29f('0x47')][_0xc29f('0x6b')][_0xc29f('0x4c')];_0x3632e4+=0x1){socket[_0xc29f('0xc1')](_0xc29f('0xc4'),{'UserId':Number(_0xe42f5['query'][_0xc29f('0x6b')][_0x3632e4]),'FaxAccountId':Number(_0xe42f5['params']['id'])});}}else{socket[_0xc29f('0xc1')](_0xc29f('0xc4'),{'UserId':Number(_0xe42f5[_0xc29f('0x47')][_0xc29f('0x6b')]),'FaxAccountId':Number(_0xe42f5[_0xc29f('0x61')]['id'])});}});}})[_0xc29f('0x1f')](respondWithStatusCode(_0x443698,null))[_0xc29f('0x29')](handleError(_0x443698,null));};exports['getAgents']=function(_0x22723f,_0x21d396,_0x3ab3cc){var _0x2a62e4={};var _0xfff247={};var _0x53b370;var _0x545775;return db[_0xc29f('0x41')][_0xc29f('0x66')]({'where':{'id':_0x22723f[_0xc29f('0x61')]['id']}})[_0xc29f('0x1f')](handleEntityNotFound(_0x21d396,null))[_0xc29f('0x1f')](function(_0x2d8722){if(_0x2d8722){_0x53b370=_0x2d8722;_0xfff247[_0xc29f('0x46')]=_[_0xc29f('0x57')](db[_0xc29f('0x77')][_0xc29f('0x42')]);_0xfff247[_0xc29f('0x47')]=_[_0xc29f('0x57')](_0x22723f['query']);_0xfff247[_0xc29f('0x48')]=_[_0xc29f('0x49')](_0xfff247['model'],_0xfff247[_0xc29f('0x47')]);_0x2a62e4[_0xc29f('0x4a')]=_[_0xc29f('0x49')](_0xfff247[_0xc29f('0x46')],qs[_0xc29f('0x4b')](_0x22723f[_0xc29f('0x47')][_0xc29f('0x4b')]));_0x2a62e4[_0xc29f('0x4a')]=_0x2a62e4[_0xc29f('0x4a')][_0xc29f('0x4c')]?_0x2a62e4[_0xc29f('0x4a')]:_0xfff247['model'];_0x2a62e4[_0xc29f('0x68')]=qs[_0xc29f('0x69')](_0x22723f['query']['sort']);_0x2a62e4[_0xc29f('0x4f')]=qs['filters'](_['pick'](_0x22723f[_0xc29f('0x47')],_0xfff247['filters']));if(_0x22723f[_0xc29f('0x47')]['filter']){_0x2a62e4[_0xc29f('0x4f')]=_['merge'](_0x2a62e4[_0xc29f('0x4f')],{'$or':_[_0xc29f('0x40')](_0x2a62e4['attributes'],function(_0x3d2318){var _0xadaba5={};_0xadaba5[_0x3d2318]={'$like':'%'+_0x22723f[_0xc29f('0x47')]['filter']+'%'};return _0xadaba5;})});}_0x2a62e4=_[_0xc29f('0x51')]({},_0x2a62e4,_0x22723f[_0xc29f('0x53')]);return _0x53b370['getAgents'](_0x2a62e4);}})[_0xc29f('0x1f')](function(_0x40f724){if(_0x40f724){_0x545775=_0x40f724[_0xc29f('0x4c')];if(!_0x22723f['query'][_0xc29f('0x4d')](_0xc29f('0x4e'))){_0x2a62e4['limit']=qs['limit'](_0x22723f['query'][_0xc29f('0x30')]);_0x2a62e4[_0xc29f('0x2d')]=qs[_0xc29f('0x2d')](_0x22723f['query'][_0xc29f('0x2d')]);}return _0x53b370['getAgents'](_0x2a62e4);}})[_0xc29f('0x1f')](function(_0x29420e){if(_0x29420e){return _0x29420e?{'count':_0x545775,'rows':_0x29420e}:null;}})[_0xc29f('0x1f')](respondWithResult(_0x21d396,null))[_0xc29f('0x29')](handleError(_0x21d396,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 3cc606e..c15ca3d 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 _0x4ef9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update','remove'];(function(_0x44cfdd,_0xe5d8da){var _0x737be7=function(_0x41ce1c){while(--_0x41ce1c){_0x44cfdd['push'](_0x44cfdd['shift']());}};_0x737be7(++_0xe5d8da);}(_0x4ef9,0x144));var _0x94ef=function(_0x280820,_0xce9bc7){_0x280820=_0x280820-0x0;var _0x474787=_0x4ef9[_0x280820];return _0x474787;};'use strict';var EventEmitter=require(_0x94ef('0x0'));var FaxAccount=require(_0x94ef('0x1'))['db'][_0x94ef('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x94ef('0x3'),'afterUpdate':_0x94ef('0x4'),'afterDestroy':_0x94ef('0x5')};function emitEvent(_0x53eae1){return function(_0x1a8030,_0x2cb58e,_0x4b2398){FaxAccountEvents[_0x94ef('0x6')](_0x53eae1+':'+_0x1a8030['id'],_0x1a8030);FaxAccountEvents[_0x94ef('0x6')](_0x53eae1,_0x1a8030);_0x4b2398(null);};}for(var e in events){if(events[_0x94ef('0x7')](e)){var event=events[e];FaxAccount[_0x94ef('0x8')](e,emitEvent(event));}}module[_0x94ef('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xeef7=['../../mysqldb','setMaxListeners','save','hook','exports','events'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0xeef7,0x7d));var _0x7eef=function(_0x271831,_0x384e5c){_0x271831=_0x271831-0x0;var _0x254a07=_0xeef7[_0x271831];return _0x254a07;};'use strict';var EventEmitter=require(_0x7eef('0x0'));var FaxAccount=require(_0x7eef('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7eef('0x2')](0x0);var events={'afterCreate':_0x7eef('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ab204){return function(_0x2c4b50,_0x1d12ab,_0x1f129d){FaxAccountEvents['emit'](_0x4ab204+':'+_0x2c4b50['id'],_0x2c4b50);FaxAccountEvents['emit'](_0x4ab204,_0x2c4b50);_0x1f129d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x7eef('0x4')](e,emitEvent(event));}}module[_0x7eef('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index bc20f80..d4c17fe 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 _0x6174=['bluebird','path','../../config/environment','./faxAccount.attributes','FaxAccount','lodash','../../config/logger','api','moment'];(function(_0x129479,_0x256c7e){var _0x3fa0ce=function(_0x35401f){while(--_0x35401f){_0x129479['push'](_0x129479['shift']());}};_0x3fa0ce(++_0x256c7e);}(_0x6174,0xdd));var _0x4617=function(_0x547cae,_0x565c50){_0x547cae=_0x547cae-0x0;var _0x1e8607=_0x6174[_0x547cae];return _0x1e8607;};'use strict';var _=require(_0x4617('0x0'));var util=require('util');var logger=require(_0x4617('0x1'))(_0x4617('0x2'));var moment=require(_0x4617('0x3'));var BPromise=require(_0x4617('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4617('0x5'));var rimraf=require('rimraf');var config=require(_0x4617('0x6'));var attributes=require(_0x4617('0x7'));module['exports']=function(_0x11d6f0,_0x227e34){return _0x11d6f0['define'](_0x4617('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59ca=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x59ca,0x111));var _0xa59c=function(_0x23f33a,_0x15335c){_0x23f33a=_0x23f33a-0x0;var _0x4ade6d=_0x59ca[_0x23f33a];return _0x4ade6d;};'use strict';var _=require(_0xa59c('0x0'));var util=require(_0xa59c('0x1'));var logger=require(_0xa59c('0x2'))(_0xa59c('0x3'));var moment=require(_0xa59c('0x4'));var BPromise=require(_0xa59c('0x5'));var rp=require(_0xa59c('0x6'));var fs=require('fs');var path=require(_0xa59c('0x7'));var rimraf=require(_0xa59c('0x8'));var config=require(_0xa59c('0x9'));var attributes=require(_0xa59c('0xa'));module[_0xa59c('0xb')]=function(_0x4e9564,_0x26a0ad){return _0x4e9564[_0xa59c('0xc')]('FaxAccount',attributes,{'tableName':'fax_accounts','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 ada5ef4..910155c 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 _0xd839=['from','Sequelize','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','get','account','Applications','list','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','applications','close','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','model','map','stringify','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','keys','updatedAt','CompanyId','isNil'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xd839,0x18f));var _0x9d83=function(_0x4c3359,_0x170c4b){_0x4c3359=_0x4c3359-0x0;var _0x255f0e=_0xd839[_0x4c3359];return _0x255f0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d83('0x0'));var BPromise=require(_0x9d83('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d83('0x2'));var db=require(_0x9d83('0x3'))['db'];var utils=require(_0x9d83('0x4'));var logger=require(_0x9d83('0x5'))(_0x9d83('0x6'));var config=require(_0x9d83('0x7'));var jayson=require(_0x9d83('0x8'));var client=jayson[_0x9d83('0x9')][_0x9d83('0xa')]({'port':0x232c});config[_0x9d83('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9d83('0xc'))(new Redis(config[_0x9d83('0xb')]));require(_0x9d83('0xd'))[_0x9d83('0xe')](socket);function respondWithRpcPromise(_0x51aebc,_0x1a2fbe,_0x479d73){return new BPromise(function(_0x232d41,_0x1de5c3){return client[_0x9d83('0xf')](_0x51aebc,_0x479d73)[_0x9d83('0x10')](function(_0x9c752e){logger[_0x9d83('0x11')](_0x9d83('0x12'),_0x1a2fbe,_0x9d83('0x13'));logger[_0x9d83('0x14')](_0x9d83('0x15'),_0x1a2fbe,_0x9d83('0x13'),JSON['stringify'](_0x9c752e));if(_0x9c752e[_0x9d83('0x16')]){if(_0x9c752e['error'][_0x9d83('0x17')]===0x1f4){logger['error'](_0x9d83('0x12'),_0x1a2fbe,_0x9c752e['error'][_0x9d83('0x18')]);return _0x1de5c3(_0x9c752e['error'][_0x9d83('0x18')]);}logger[_0x9d83('0x16')](_0x9d83('0x12'),_0x1a2fbe,_0x9c752e[_0x9d83('0x16')][_0x9d83('0x18')]);return _0x232d41(_0x9c752e[_0x9d83('0x16')][_0x9d83('0x18')]);}else{logger[_0x9d83('0x11')]('FaxAccount,\x20%s,\x20%s',_0x1a2fbe,_0x9d83('0x13'));_0x232d41(_0x9c752e[_0x9d83('0x19')][_0x9d83('0x18')]);}})[_0x9d83('0x1a')](function(_0xbd7efa){logger[_0x9d83('0x16')](_0x9d83('0x12'),_0x1a2fbe,_0xbd7efa);_0x1de5c3(_0xbd7efa);});});}exports[_0x9d83('0x1b')]=function(_0x12b48a){var _0x18cfe4=this;return new Promise(function(_0xa6266,_0x42591c){return db[_0x9d83('0x1c')][_0x9d83('0x1d')]({'raw':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a['options'][_0x9d83('0x1f')]===undefined?!![]:![]:!![],'where':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a[_0x9d83('0x1e')]['where']||null:null,'attributes':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a[_0x9d83('0x1e')][_0x9d83('0x20')]||null:null,'limit':_0x12b48a['options']?_0x12b48a['options'][_0x9d83('0x21')]||null:null,'include':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a[_0x9d83('0x1e')][_0x9d83('0x22')]?_['map'](_0x12b48a[_0x9d83('0x1e')][_0x9d83('0x22')],function(_0x476aa9){return{'model':db[_0x476aa9[_0x9d83('0x23')]],'as':_0x476aa9['as'],'attributes':_0x476aa9[_0x9d83('0x20')],'include':_0x476aa9[_0x9d83('0x22')]?_[_0x9d83('0x24')](_0x476aa9[_0x9d83('0x22')],function(_0x36c78e){return{'model':db[_0x36c78e['model']],'as':_0x36c78e['as'],'attributes':_0x36c78e[_0x9d83('0x20')],'include':_0x36c78e[_0x9d83('0x22')]?_[_0x9d83('0x24')](_0x36c78e[_0x9d83('0x22')],function(_0x3c35ac){return{'model':db[_0x3c35ac[_0x9d83('0x23')]],'as':_0x3c35ac['as'],'attributes':_0x3c35ac[_0x9d83('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9d83('0x10')](function(_0x57979){logger['info']('GetFaxAccount',_0x12b48a);logger[_0x9d83('0x14')](_0x9d83('0x1b'),_0x12b48a,JSON[_0x9d83('0x25')](_0x57979));_0xa6266(_0x57979);})[_0x9d83('0x1a')](function(_0x56b75c){logger[_0x9d83('0x16')](_0x9d83('0x1b'),_0x56b75c['message'],_0x12b48a);_0x42591c(_0x18cfe4['error'](0x1f4,_0x56b75c[_0x9d83('0x18')]));});});};exports[_0x9d83('0x26')]=function(_0x1db097,_0x9dc3d7,_0x5b4c2e){var _0x320c49=this;return new Promise(function(_0x2dc16b,_0x5204d6){var _0x27ade2={'body':_0x1db097[_0x9d83('0x27')],'channel':_0x9d83('0x28')};var _0x3fabf4=[];var _0xfb990c=[];var _0x34c51a={};return db[_0x9d83('0x29')][_0x9d83('0x2a')]()[_0x9d83('0x10')](function(_0x323e0d){if(!_0x323e0d){throw new db['Sequelize'][(_0x9d83('0x2b'))](_0x9d83('0x2c'));}_0x3fabf4=_[_0x9d83('0x2d')](_['keys'](_0x323e0d),[_0x9d83('0x2e'),'updatedAt']);_0xfb990c=_[_0x9d83('0x2d')](_[_0x9d83('0x2f')](_0x323e0d),[_0x9d83('0x2e'),_0x9d83('0x30'),_0x9d83('0x31'),'ListId']);if(_0x1db097[_0x9d83('0x27')]['id']){delete _0x1db097['body']['id'];}if(_[_0x9d83('0x32')](_0x1db097[_0x9d83('0x27')][_0x9d83('0x33')])){throw new db[(_0x9d83('0x34'))][(_0x9d83('0x2b'))](_0x9d83('0x35'));}if(_['isNil'](_0x1db097[_0x9d83('0x27')][_0x9d83('0x27')])||_0x1db097[_0x9d83('0x27')][_0x9d83('0x27')]===''){throw new db['Sequelize'][(_0x9d83('0x2b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9d83('0x32')](_0x1db097[_0x9d83('0x27')]['mapKey'])){throw new db[(_0x9d83('0x34'))][(_0x9d83('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xfb990c);}if(!_[_0x9d83('0x36')](_0xfb990c,_0x1db097['body'][_0x9d83('0x37')])){throw new db[(_0x9d83('0x34'))]['ValidationError'](_0x9d83('0x38')+_0xfb990c);}_0x34c51a[_0x1db097['body']['mapKey']]=_0x1db097[_0x9d83('0x27')][_0x9d83('0x33')];})[_0x9d83('0x10')](function(){return db[_0x9d83('0x1c')][_0x9d83('0x39')]({'where':{'id':_0x1db097['account']['id']},'include':[{'model':db[_0x9d83('0x3a')],'as':_0x9d83('0x3b'),'include':[{'model':db[_0x9d83('0x29')],'as':_0x9d83('0x3c'),'where':_0x34c51a,'limit':0x1,'order':[[_0x9d83('0x30'),_0x9d83('0x3d')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x9d83('0x10')](function(_0x5caf56){if(_0x5caf56&&_0x5caf56[_0x9d83('0x3b')]){var _0x5f2a0a=_0x5caf56[_0x9d83('0x3e')]({'plain':!![]});_0x27ade2[_0x9d83('0x3f')]=_0x5f2a0a;_0x27ade2['applications']=_0x5f2a0a[_0x9d83('0x40')];_0x27ade2[_0x9d83('0x41')]=_0x5f2a0a[_0x9d83('0x3b')];_0x27ade2['applications']=_[_0x9d83('0x42')](_0x27ade2['applications'],[_0x9d83('0x43')],[_0x9d83('0x44')]);if(_0x27ade2[_0x9d83('0x3f')][_0x9d83('0x40')]){delete _0x27ade2[_0x9d83('0x3f')][_0x9d83('0x40')];}if(_0x27ade2['account'][_0x9d83('0x3b')]&&_0x27ade2[_0x9d83('0x3f')][_0x9d83('0x3b')][_0x9d83('0x3c')][_0x9d83('0x45')]){return _0x27ade2['account'][_0x9d83('0x3b')][_0x9d83('0x3c')][0x0];}var _0x1494e3=_['defaults'](_0x1db097[_0x9d83('0x27')],{'firstName':_0x1db097[_0x9d83('0x27')][_0x9d83('0x33')],'ListId':_0x5f2a0a[_0x9d83('0x46')]});_0x1494e3[_0x1db097[_0x9d83('0x27')][_0x9d83('0x37')]]=_0x1db097['body'][_0x9d83('0x33')];return db[_0x9d83('0x29')][_0x9d83('0x47')](_0x1494e3,{'fields':_0x3fabf4,'raw':!![]});}})[_0x9d83('0x10')](function(_0x126426){_0x27ade2[_0x9d83('0x48')]=_0x126426;if(_0x126426){var _0x5f49d4={'ContactId':_0x126426['id'],'FaxAccountId':_0x1db097[_0x9d83('0x3f')]['id'],'fax':_0x126426['fax']};return db[_0x9d83('0x49')][_0x9d83('0x39')]({'where':{'ContactId':_0x126426['id'],'closed':![],'FaxAccountId':_0x1db097['account']['id']}})[_0x9d83('0x10')](function(_0x4b796b){if(_0x4b796b){return[_0x4b796b,![]];}return db['FaxInteraction'][_0x9d83('0x47')](_0x5f49d4)['then'](function(_0x23849e){return[_0x23849e,!![]];});});}else{throw new Error(_0x9d83('0x4a'));}})['spread'](function(_0x32fe20,_0x30751c){var _0x292e3a=_0x32fe20[_0x9d83('0x3e')]({'plain':!![]});if(_0x30751c){if(_0x27ade2[_0x9d83('0x3f')]['autoclose']){_0x27ade2[_0x9d83('0x4b')]['push']({'id':0x0,'priority':_0x27ade2[_0x9d83('0x4b')][_0x9d83('0x45')]+0x1,'app':_0x9d83('0x4c'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x292e3a[_0x9d83('0x4d')]=!![];}else{_0x292e3a[_0x9d83('0x4d')]=![];}_0x27ade2[_0x9d83('0x4e')]=_0x292e3a;return db[_0x9d83('0x4f')][_0x9d83('0x47')]({'body':_0x1db097[_0x9d83('0x27')][_0x9d83('0x27')],'FaxAccountId':_0x1db097[_0x9d83('0x3f')]['id'],'FaxInteractionId':_0x32fe20['id'],'direction':'in','ContactId':_0x32fe20[_0x9d83('0x50')],'AttachmentId':_0x1db097['body'][_0x9d83('0x51')]});})['then'](function(_0x3f6449){_0x27ade2[_0x9d83('0x18')]=_0x3f6449;if(_0x27ade2['interaction'][_0x9d83('0x52')]){return db[_0x9d83('0x53')][_0x9d83('0x39')]({'attributes':['id',_0x9d83('0x54')],'where':{'id':_0x27ade2[_0x9d83('0x4e')][_0x9d83('0x52')]}})[_0x9d83('0x10')](function(_0x41180){if(_0x41180){_0x27ade2[_0x9d83('0x4b')][_0x9d83('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x41180[_0x9d83('0x54')]+','+(_0x27ade2[_0x9d83('0x3f')][_0x9d83('0x56')]||0xa),'interval':_0x9d83('0x57')});}return respondWithRpcPromise(_0x9d83('0x58'),_0x9d83('0x59'),_0x27ade2);});}return respondWithRpcPromise(_0x9d83('0x58'),_0x9d83('0x59'),_0x27ade2);})[_0x9d83('0x10')](function(_0x1c36e5){_0x2dc16b(_0x1c36e5);})['catch'](function(_0x396953){_0x5204d6(_0x320c49[_0x9d83('0x16')](0x1f4,_0x396953[_0x9d83('0x18')]));});});}; \ No newline at end of file +var _0x54f9=['map','model','attributes','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','contact','FaxInteraction','find','create','Contact\x20not\x20found','push','length','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','User','name','UserId','agent','waitForTheAssignedAgent','Start','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54f9,0xe6));var _0x954f=function(_0x12ba97,_0x562b93){_0x12ba97=_0x12ba97-0x0;var _0x41f289=_0x54f9[_0x12ba97];return _0x41f289;};'use strict';var _=require(_0x954f('0x0'));var util=require(_0x954f('0x1'));var moment=require(_0x954f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x954f('0x3'));var db=require(_0x954f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x954f('0x5'))(_0x954f('0x6'));var config=require(_0x954f('0x7'));var jayson=require(_0x954f('0x8'));var client=jayson[_0x954f('0x9')][_0x954f('0xa')]({'port':0x232c});config[_0x954f('0xb')]=_[_0x954f('0xc')](config[_0x954f('0xb')],{'host':_0x954f('0xd'),'port':0x18eb});var socket=require(_0x954f('0xe'))(new Redis(config['redis']));require(_0x954f('0xf'))[_0x954f('0x10')](socket);function respondWithRpcPromise(_0x10d798,_0x1eab19,_0x288f5d){return new BPromise(function(_0x433406,_0x501048){return client[_0x954f('0x11')](_0x10d798,_0x288f5d)[_0x954f('0x12')](function(_0x1e3bc1){logger['info'](_0x954f('0x13'),_0x1eab19,_0x954f('0x14'));logger[_0x954f('0x15')](_0x954f('0x16'),_0x1eab19,_0x954f('0x14'),JSON['stringify'](_0x1e3bc1));if(_0x1e3bc1[_0x954f('0x17')]){if(_0x1e3bc1[_0x954f('0x17')][_0x954f('0x18')]===0x1f4){logger[_0x954f('0x17')](_0x954f('0x13'),_0x1eab19,_0x1e3bc1['error'][_0x954f('0x19')]);return _0x501048(_0x1e3bc1['error'][_0x954f('0x19')]);}logger[_0x954f('0x17')]('FaxAccount,\x20%s,\x20%s',_0x1eab19,_0x1e3bc1[_0x954f('0x17')][_0x954f('0x19')]);return _0x433406(_0x1e3bc1['error']['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x1eab19,'request\x20sent');_0x433406(_0x1e3bc1['result']['message']);}})['catch'](function(_0x197d2d){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1eab19,_0x197d2d);_0x501048(_0x197d2d);});});}exports[_0x954f('0x1a')]=function(_0x52a908){var _0x222d91=this;return new Promise(function(_0x468981,_0x5b3065){return db[_0x954f('0x1b')][_0x954f('0x1c')]({'raw':_0x52a908[_0x954f('0x1d')]?_0x52a908['options'][_0x954f('0x1e')]===undefined?!![]:![]:!![],'where':_0x52a908[_0x954f('0x1d')]?_0x52a908[_0x954f('0x1d')][_0x954f('0x1f')]||null:null,'attributes':_0x52a908[_0x954f('0x1d')]?_0x52a908[_0x954f('0x1d')]['attributes']||null:null,'limit':_0x52a908['options']?_0x52a908[_0x954f('0x1d')][_0x954f('0x20')]||null:null,'include':_0x52a908['options']?_0x52a908['options'][_0x954f('0x21')]?_[_0x954f('0x22')](_0x52a908[_0x954f('0x1d')][_0x954f('0x21')],function(_0x5c9d76){return{'model':db[_0x5c9d76[_0x954f('0x23')]],'as':_0x5c9d76['as'],'attributes':_0x5c9d76[_0x954f('0x24')],'include':_0x5c9d76['include']?_[_0x954f('0x22')](_0x5c9d76[_0x954f('0x21')],function(_0x3a47fa){return{'model':db[_0x3a47fa[_0x954f('0x23')]],'as':_0x3a47fa['as'],'attributes':_0x3a47fa[_0x954f('0x24')],'include':_0x3a47fa[_0x954f('0x21')]?_[_0x954f('0x22')](_0x3a47fa[_0x954f('0x21')],function(_0x1783c0){return{'model':db[_0x1783c0[_0x954f('0x23')]],'as':_0x1783c0['as'],'attributes':_0x1783c0[_0x954f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x954f('0x12')](function(_0x4b3f84){logger['info'](_0x954f('0x1a'),_0x52a908);logger[_0x954f('0x15')]('GetFaxAccount',_0x52a908,JSON['stringify'](_0x4b3f84));_0x468981(_0x4b3f84);})['catch'](function(_0x5e9938){logger['error']('GetFaxAccount',_0x5e9938['message'],_0x52a908);_0x5b3065(_0x222d91[_0x954f('0x17')](0x1f4,_0x5e9938[_0x954f('0x19')]));});});};exports[_0x954f('0x25')]=function(_0x3e4374,_0x57f6b0,_0x5e02c8){var _0x1508df=this;return new Promise(function(_0x3fc71d,_0x1e1ecb){var _0x183b05={'body':_0x3e4374[_0x954f('0x26')],'channel':_0x954f('0x27')};var _0x3d9d12=[];var _0x4a312e=[];var _0x57dff3={};return db[_0x954f('0x28')]['describe']()[_0x954f('0x12')](function(_0x306844){if(!_0x306844){throw new db[(_0x954f('0x29'))][(_0x954f('0x2a'))](_0x954f('0x2b'));}_0x3d9d12=_[_0x954f('0x2c')](_[_0x954f('0x2d')](_0x306844),[_0x954f('0x2e'),_0x954f('0x2f')]);_0x4a312e=_[_0x954f('0x2c')](_[_0x954f('0x2d')](_0x306844),[_0x954f('0x2e'),'updatedAt',_0x954f('0x30'),_0x954f('0x31')]);if(_0x3e4374['body']['id']){delete _0x3e4374[_0x954f('0x26')]['id'];}if(_[_0x954f('0x32')](_0x3e4374['body']['from'])){throw new db['Sequelize'][(_0x954f('0x2a'))]('from\x20is\x20mandatory');}if(_[_0x954f('0x32')](_0x3e4374[_0x954f('0x26')]['body'])||_0x3e4374[_0x954f('0x26')][_0x954f('0x26')]===''){throw new db[(_0x954f('0x29'))][(_0x954f('0x2a'))](_0x954f('0x33'));}if(_[_0x954f('0x32')](_0x3e4374[_0x954f('0x26')]['mapKey'])){throw new db[(_0x954f('0x29'))][(_0x954f('0x2a'))](_0x954f('0x34')+_0x4a312e);}if(!_[_0x954f('0x35')](_0x4a312e,_0x3e4374[_0x954f('0x26')][_0x954f('0x36')])){throw new db['Sequelize'][(_0x954f('0x2a'))](_0x954f('0x37')+_0x4a312e);}_0x57dff3[_0x3e4374[_0x954f('0x26')][_0x954f('0x36')]]=_0x3e4374[_0x954f('0x26')][_0x954f('0x38')];})[_0x954f('0x12')](function(){return db[_0x954f('0x1b')]['find']({'where':{'id':_0x3e4374[_0x954f('0x39')]['id']},'include':[{'model':db[_0x954f('0x3a')],'as':_0x954f('0x3b'),'include':[{'model':db['CmContact'],'as':_0x954f('0x3c'),'where':_0x57dff3,'limit':0x1,'order':[[_0x954f('0x2f'),_0x954f('0x3d')]]}]},{'model':db[_0x954f('0x3e')],'as':_0x954f('0x3f')}]});})['then'](function(_0x3f18bd){if(_0x3f18bd&&_0x3f18bd['List']){var _0x4eb639=_0x3f18bd[_0x954f('0x40')]({'plain':!![]});_0x183b05[_0x954f('0x39')]=_0x4eb639;_0x183b05[_0x954f('0x41')]=_0x4eb639[_0x954f('0x3f')];_0x183b05['list']=_0x4eb639[_0x954f('0x3b')];_0x183b05['applications']=_[_0x954f('0x42')](_0x183b05['applications'],['priority'],['asc']);if(_0x183b05[_0x954f('0x39')][_0x954f('0x3f')]){delete _0x183b05['account'][_0x954f('0x3f')];}if(_0x183b05[_0x954f('0x39')]['List']&&_0x183b05['account'][_0x954f('0x3b')][_0x954f('0x3c')]['length']){return _0x183b05[_0x954f('0x39')][_0x954f('0x3b')][_0x954f('0x3c')][0x0];}var _0x3f01cc=_[_0x954f('0xc')](_0x3e4374[_0x954f('0x26')],{'firstName':_0x3e4374[_0x954f('0x26')][_0x954f('0x38')],'ListId':_0x4eb639[_0x954f('0x31')]});_0x3f01cc[_0x3e4374[_0x954f('0x26')][_0x954f('0x36')]]=_0x3e4374[_0x954f('0x26')][_0x954f('0x38')];return db[_0x954f('0x28')]['create'](_0x3f01cc,{'fields':_0x3d9d12,'raw':!![]});}})[_0x954f('0x12')](function(_0x17ab8f){_0x183b05[_0x954f('0x43')]=_0x17ab8f;if(_0x17ab8f){var _0x31df2c={'ContactId':_0x17ab8f['id'],'FaxAccountId':_0x3e4374[_0x954f('0x39')]['id'],'fax':_0x17ab8f[_0x954f('0x27')]};return db[_0x954f('0x44')][_0x954f('0x45')]({'where':{'ContactId':_0x17ab8f['id'],'closed':![],'FaxAccountId':_0x3e4374[_0x954f('0x39')]['id']}})[_0x954f('0x12')](function(_0x232671){if(_0x232671){return[_0x232671,![]];}return db[_0x954f('0x44')][_0x954f('0x46')](_0x31df2c)['then'](function(_0x465ea2){return[_0x465ea2,!![]];});});}else{throw new Error(_0x954f('0x47'));}})['spread'](function(_0xff0bc7,_0x5d92b9){var _0x50009b=_0xff0bc7[_0x954f('0x40')]({'plain':!![]});if(_0x5d92b9){if(_0x183b05['account']['autoclose']){_0x183b05[_0x954f('0x41')][_0x954f('0x48')]({'id':0x0,'priority':_0x183b05[_0x954f('0x41')][_0x954f('0x49')]+0x1,'app':_0x954f('0x4a'),'appdata':_0x954f('0x4b'),'interval':_0x954f('0x4c')});}_0x50009b['created']=!![];}else{_0x50009b[_0x954f('0x4d')]=![];}_0x183b05[_0x954f('0x4e')]=_0x50009b;return db['FaxMessage'][_0x954f('0x46')]({'body':_0x3e4374['body'][_0x954f('0x26')],'FaxAccountId':_0x3e4374[_0x954f('0x39')]['id'],'FaxInteractionId':_0xff0bc7['id'],'direction':'in','ContactId':_0xff0bc7[_0x954f('0x4f')],'AttachmentId':_0x3e4374[_0x954f('0x26')][_0x954f('0x50')]});})[_0x954f('0x12')](function(_0x355ef4){_0x183b05[_0x954f('0x19')]=_0x355ef4;if(_0x183b05[_0x954f('0x4e')]['UserId']){return db[_0x954f('0x51')][_0x954f('0x45')]({'attributes':['id',_0x954f('0x52')],'where':{'id':_0x183b05[_0x954f('0x4e')][_0x954f('0x53')]}})[_0x954f('0x12')](function(_0x47328e){if(_0x47328e){_0x183b05['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x954f('0x54'),'appdata':_0x47328e[_0x954f('0x52')]+','+(_0x183b05[_0x954f('0x39')][_0x954f('0x55')]||0xa),'interval':_0x954f('0x4c')});}return respondWithRpcPromise(_0x954f('0x56'),'startRouting',_0x183b05);});}return respondWithRpcPromise(_0x954f('0x56'),'startRouting',_0x183b05);})[_0x954f('0x12')](function(_0x2889e3){_0x3fc71d(_0x2889e3);})[_0x954f('0x57')](function(_0x1eaa4c){_0x1e1ecb(_0x1508df['error'](0x1f4,_0x1eaa4c[_0x954f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index c5148d8..a83de18 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 _0x4ff3=['emit','removeListener','length','faxAccount:','./faxAccount.events','remove','update'];(function(_0x4369c7,_0x2212d3){var _0x351a79=function(_0x18b95c){while(--_0x18b95c){_0x4369c7['push'](_0x4369c7['shift']());}};_0x351a79(++_0x2212d3);}(_0x4ff3,0x1bd));var _0x34ff=function(_0x1229ac,_0x23dab8){_0x1229ac=_0x1229ac-0x0;var _0x536085=_0x4ff3[_0x1229ac];return _0x536085;};'use strict';var FaxAccountEvents=require(_0x34ff('0x0'));var events=['save',_0x34ff('0x1'),_0x34ff('0x2')];function createListener(_0xb2916e,_0x1cb33b){return function(_0x3402c1){_0x1cb33b[_0x34ff('0x3')](_0xb2916e,_0x3402c1);};}function removeListener(_0x7bd462,_0x476eec){return function(){FaxAccountEvents[_0x34ff('0x4')](_0x7bd462,_0x476eec);};}exports['register']=function(_0x44d722){for(var _0x396fd4=0x0,_0x3227a0=events[_0x34ff('0x5')];_0x396fd4<_0x3227a0;_0x396fd4++){var _0x5eda11=events[_0x396fd4];var _0x3f4b27=createListener(_0x34ff('0x6')+_0x5eda11,_0x44d722);FaxAccountEvents['on'](_0x5eda11,_0x3f4b27);}}; \ No newline at end of file +var _0xb1dc=['emit','removeListener','register','length','./faxAccount.events','save','remove','update'];(function(_0x58f457,_0x990c9b){var _0x2e8229=function(_0x53b2aa){while(--_0x53b2aa){_0x58f457['push'](_0x58f457['shift']());}};_0x2e8229(++_0x990c9b);}(_0xb1dc,0x19c));var _0xcb1d=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0xb1dc[_0x316c42];return _0x2b38f7;};'use strict';var FaxAccountEvents=require(_0xcb1d('0x0'));var events=[_0xcb1d('0x1'),_0xcb1d('0x2'),_0xcb1d('0x3')];function createListener(_0xe46f89,_0x46f7f5){return function(_0x5b42ce){_0x46f7f5[_0xcb1d('0x4')](_0xe46f89,_0x5b42ce);};}function removeListener(_0x372970,_0x4166f1){return function(){FaxAccountEvents[_0xcb1d('0x5')](_0x372970,_0x4166f1);};}exports[_0xcb1d('0x6')]=function(_0x115809){for(var _0x250a69=0x0,_0x556c78=events[_0xcb1d('0x7')];_0x250a69<_0x556c78;_0x250a69++){var _0x4f9684=events[_0x250a69];var _0x241ae9=createListener('faxAccount:'+_0x4f9684,_0x115809);FaxAccountEvents['on'](_0x4f9684,_0x241ae9);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index a0fa8db..b6d0a99 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x301d29,_0x9ff2b7){var _0x1598a6=function(_0x587ca5){while(--_0x587ca5){_0x301d29['push'](_0x301d29['shift']());}};_0x1598a6(++_0x9ff2b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xcca6e4,_0x250b8d){var _0x13ef13=function(_0x2ad989){while(--_0x2ad989){_0xcca6e4['push'](_0xcca6e4['shift']());}};_0x13ef13(++_0x250b8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 4efde94..1ae8021 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 _0xff3a=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x455154,_0x45deae){var _0x124dbc=function(_0x69d923){while(--_0x69d923){_0x455154['push'](_0x455154['shift']());}};_0x124dbc(++_0x45deae);}(_0xff3a,0x92));var _0xaff3=function(_0x4f6def,_0x1e4bb8){_0x4f6def=_0x4f6def-0x0;var _0x343106=_0xff3a[_0x4f6def];return _0x343106;};'use strict';var Sequelize=require(_0xaff3('0x0'));module[_0xaff3('0x1')]={'priority':{'type':Sequelize[_0xaff3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaff3('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xaff3('0x4')]()},'description':{'type':Sequelize[_0xaff3('0x3')]},'interval':{'type':Sequelize[_0xaff3('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x489c=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x489c,0x1d3));var _0xc489=function(_0x12c589,_0x370e25){_0x12c589=_0x12c589-0x0;var _0x5e1e22=_0x489c[_0x12c589];return _0x5e1e22;};'use strict';var Sequelize=require(_0xc489('0x0'));module[_0xc489('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc489('0x2')],'allowNull':![],'defaultValue':_0xc489('0x3')},'appdata':{'type':Sequelize[_0xc489('0x4')]()},'description':{'type':Sequelize[_0xc489('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc489('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index de3365d..3dab988 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 _0x1958=['limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','FaxApplication','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','length','include','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1958,0xc5));var _0x8195=function(_0x3480e9,_0x1ce980){_0x3480e9=_0x3480e9-0x0;var _0x389aad=_0x1958[_0x3480e9];return _0x389aad;};'use strict';var emlformat=require(_0x8195('0x0'));var rimraf=require(_0x8195('0x1'));var zipdir=require(_0x8195('0x2'));var jsonpatch=require(_0x8195('0x3'));var rp=require(_0x8195('0x4'));var moment=require(_0x8195('0x5'));var BPromise=require(_0x8195('0x6'));var Mustache=require('mustache');var util=require(_0x8195('0x7'));var path=require(_0x8195('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8195('0x9'));var fs=require('fs');var fs_extra=require(_0x8195('0xa'));var _=require(_0x8195('0xb'));var squel=require(_0x8195('0xc'));var crypto=require(_0x8195('0xd'));var jsforce=require(_0x8195('0xe'));var deskjs=require(_0x8195('0xf'));var toCsv=require(_0x8195('0x10'));var querystring=require('querystring');var Papa=require(_0x8195('0x11'));var Redis=require('ioredis');var authService=require(_0x8195('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8195('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8195('0x14'));var utils=require(_0x8195('0x15'));var config=require(_0x8195('0x16'));var licenseUtil=require(_0x8195('0x17'));var db=require(_0x8195('0x18'))['db'];function respondWithStatusCode(_0x53de5f,_0x3488b1){_0x3488b1=_0x3488b1||0xcc;return function(_0x1d7df3){if(_0x1d7df3){return _0x53de5f[_0x8195('0x19')](_0x3488b1);}return _0x53de5f[_0x8195('0x1a')](_0x3488b1)[_0x8195('0x1b')]();};}function respondWithResult(_0x59b762,_0x11a543){_0x11a543=_0x11a543||0xc8;return function(_0x58958d){if(_0x58958d){return _0x59b762[_0x8195('0x1a')](_0x11a543)[_0x8195('0x1c')](_0x58958d);}};}function respondWithFilteredResult(_0x4e3fc7,_0x43ee16){return function(_0x6c1fb5){if(_0x6c1fb5){var _0x39d91a=typeof _0x43ee16[_0x8195('0x1d')]===_0x8195('0x1e')&&typeof _0x43ee16[_0x8195('0x1f')]==='undefined';var _0x530840=_0x6c1fb5['count'];var _0x1cdccb=_0x39d91a?0x0:_0x43ee16[_0x8195('0x1d')];var _0x215e18=_0x39d91a?_0x6c1fb5[_0x8195('0x20')]:_0x43ee16[_0x8195('0x1d')]+_0x43ee16[_0x8195('0x1f')];var _0x9dea18;if(_0x215e18>=_0x530840){_0x215e18=_0x530840;_0x9dea18=0xc8;}else{_0x9dea18=0xce;}_0x4e3fc7[_0x8195('0x1a')](_0x9dea18);return _0x4e3fc7['set'](_0x8195('0x21'),_0x1cdccb+'-'+_0x215e18+'/'+_0x530840)['json'](_0x6c1fb5);}return null;};}function patchUpdates(_0x189ba4){return function(_0x2ff981){try{jsonpatch[_0x8195('0x22')](_0x2ff981,_0x189ba4,!![]);}catch(_0x5dfb1e){return BPromise[_0x8195('0x23')](_0x5dfb1e);}return _0x2ff981[_0x8195('0x24')]();};}function saveUpdates(_0x8daaf,_0x3ddf54){return function(_0x172374){if(_0x172374){return _0x172374[_0x8195('0x25')](_0x8daaf)[_0x8195('0x26')](function(_0x1d3689){return _0x1d3689;});}return null;};}function removeEntity(_0x2734c7,_0x5f128f){return function(_0x508d87){if(_0x508d87){return _0x508d87[_0x8195('0x27')]()[_0x8195('0x26')](function(){_0x2734c7['status'](0xcc)[_0x8195('0x1b')]();});}};}function handleEntityNotFound(_0x11abfd,_0x562779){return function(_0x5daa96){if(!_0x5daa96){_0x11abfd[_0x8195('0x19')](0x194);}return _0x5daa96;};}function handleError(_0x26089d,_0x94d0d6){_0x94d0d6=_0x94d0d6||0x1f4;return function(_0x22d8c0){logger['error'](_0x22d8c0[_0x8195('0x28')]);if(_0x22d8c0[_0x8195('0x29')]){delete _0x22d8c0[_0x8195('0x29')];}_0x26089d['status'](_0x94d0d6)[_0x8195('0x2a')](_0x22d8c0);};}exports['index']=function(_0x5baac6,_0x1723fb){var _0x5bc256={},_0x564ab1={},_0x52a69e={'count':0x0,'rows':[]};var _0x1f6108=_['map'](db[_0x8195('0x2b')][_0x8195('0x2c')],function(_0x51dbd8){return{'name':_0x51dbd8[_0x8195('0x2d')],'type':_0x51dbd8[_0x8195('0x2e')][_0x8195('0x2f')]};});_0x564ab1[_0x8195('0x30')]=_[_0x8195('0x31')](_0x1f6108,_0x8195('0x29'));_0x564ab1['query']=_[_0x8195('0x32')](_0x5baac6[_0x8195('0x33')]);_0x564ab1['filters']=_[_0x8195('0x34')](_0x564ab1[_0x8195('0x30')],_0x564ab1[_0x8195('0x33')]);_0x5bc256[_0x8195('0x35')]=_[_0x8195('0x34')](_0x564ab1['model'],qs[_0x8195('0x36')](_0x5baac6[_0x8195('0x33')][_0x8195('0x36')]));_0x5bc256[_0x8195('0x35')]=_0x5bc256[_0x8195('0x35')]['length']?_0x5bc256[_0x8195('0x35')]:_0x564ab1[_0x8195('0x30')];if(!_0x5baac6[_0x8195('0x33')][_0x8195('0x37')](_0x8195('0x38'))){_0x5bc256['limit']=qs['limit'](_0x5baac6['query']['limit']);_0x5bc256[_0x8195('0x1d')]=qs[_0x8195('0x1d')](_0x5baac6['query']['offset']);}_0x5bc256[_0x8195('0x39')]=qs[_0x8195('0x3a')](_0x5baac6[_0x8195('0x33')][_0x8195('0x3a')]);_0x5bc256[_0x8195('0x3b')]=qs[_0x8195('0x3c')](_[_0x8195('0x3d')](_0x5baac6[_0x8195('0x33')],_0x564ab1[_0x8195('0x3c')]),_0x1f6108);if(_0x5baac6[_0x8195('0x33')][_0x8195('0x3e')]){_0x5bc256[_0x8195('0x3b')]=_[_0x8195('0x3f')](_0x5bc256[_0x8195('0x3b')],{'$or':_['map'](_0x1f6108,function(_0x504dd1){if(_0x504dd1[_0x8195('0x2e')]!==_0x8195('0x40')){var _0x25a48c={};_0x25a48c[_0x504dd1[_0x8195('0x29')]]={'$like':'%'+_0x5baac6[_0x8195('0x33')]['filter']+'%'};return _0x25a48c;}})});}_0x5bc256=_[_0x8195('0x3f')]({},_0x5bc256,_0x5baac6['options']);var _0x62b170={'where':_0x5bc256['where']};return db['FaxApplication']['count'](_0x62b170)[_0x8195('0x26')](function(_0x5979d3){_0x52a69e['count']=_0x5979d3;if(_0x5baac6[_0x8195('0x33')][_0x8195('0x41')]){_0x5bc256['include']=[{'all':!![]}];}return db[_0x8195('0x2b')]['findAll'](_0x5bc256);})[_0x8195('0x26')](function(_0x2e187f){_0x52a69e[_0x8195('0x42')]=_0x2e187f;return _0x52a69e;})[_0x8195('0x26')](respondWithFilteredResult(_0x1723fb,_0x5bc256))[_0x8195('0x43')](handleError(_0x1723fb,null));};exports[_0x8195('0x44')]=function(_0x2ab6b6,_0x4ec1f6){var _0x5f2471={'raw':!![],'where':{'id':_0x2ab6b6['params']['id']}},_0x5eb107={};_0x5eb107[_0x8195('0x30')]=_[_0x8195('0x32')](db[_0x8195('0x2b')]['rawAttributes']);_0x5eb107[_0x8195('0x33')]=_[_0x8195('0x32')](_0x2ab6b6[_0x8195('0x33')]);_0x5eb107[_0x8195('0x3c')]=_['intersection'](_0x5eb107[_0x8195('0x30')],_0x5eb107[_0x8195('0x33')]);_0x5f2471['attributes']=_[_0x8195('0x34')](_0x5eb107[_0x8195('0x30')],qs[_0x8195('0x36')](_0x2ab6b6['query'][_0x8195('0x36')]));_0x5f2471['attributes']=_0x5f2471['attributes'][_0x8195('0x45')]?_0x5f2471[_0x8195('0x35')]:_0x5eb107['model'];if(_0x2ab6b6[_0x8195('0x33')]['includeAll']){_0x5f2471[_0x8195('0x46')]=[{'all':!![]}];}_0x5f2471=_['merge']({},_0x5f2471,_0x2ab6b6[_0x8195('0x47')]);return db[_0x8195('0x2b')][_0x8195('0x48')](_0x5f2471)[_0x8195('0x26')](handleEntityNotFound(_0x4ec1f6,null))[_0x8195('0x26')](respondWithResult(_0x4ec1f6,null))['catch'](handleError(_0x4ec1f6,null));};exports[_0x8195('0x49')]=function(_0x5546e4,_0x3af4f2){return db[_0x8195('0x2b')][_0x8195('0x49')](_0x5546e4[_0x8195('0x4a')],{})[_0x8195('0x26')](respondWithResult(_0x3af4f2,0xc9))['catch'](handleError(_0x3af4f2,null));};exports[_0x8195('0x25')]=function(_0x2e9c50,_0x305447){if(_0x2e9c50[_0x8195('0x4a')]['id']){delete _0x2e9c50['body']['id'];}return db[_0x8195('0x2b')][_0x8195('0x48')]({'where':{'id':_0x2e9c50[_0x8195('0x4b')]['id']}})[_0x8195('0x26')](handleEntityNotFound(_0x305447,null))['then'](saveUpdates(_0x2e9c50[_0x8195('0x4a')],null))['then'](respondWithResult(_0x305447,null))['catch'](handleError(_0x305447,null));};exports['destroy']=function(_0x432529,_0x1c2a93){return db['FaxApplication'][_0x8195('0x48')]({'where':{'id':_0x432529[_0x8195('0x4b')]['id']}})[_0x8195('0x26')](handleEntityNotFound(_0x1c2a93,null))[_0x8195('0x26')](removeEntity(_0x1c2a93,null))['catch'](handleError(_0x1c2a93,null));}; \ No newline at end of file +var _0xac5c=['order','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','FaxApplication','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','save','then','destroy','stack','name','index','map','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x30c48d,_0x25e828){var _0x2c64aa=function(_0x244ae6){while(--_0x244ae6){_0x30c48d['push'](_0x30c48d['shift']());}};_0x2c64aa(++_0x25e828);}(_0xac5c,0xa1));var _0xcac5=function(_0x5c1bc7,_0x25f303){_0x5c1bc7=_0x5c1bc7-0x0;var _0x423b01=_0xac5c[_0x5c1bc7];return _0x423b01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcac5('0x0'));var zipdir=require(_0xcac5('0x1'));var jsonpatch=require(_0xcac5('0x2'));var rp=require('request-promise');var moment=require(_0xcac5('0x3'));var BPromise=require(_0xcac5('0x4'));var Mustache=require('mustache');var util=require(_0xcac5('0x5'));var path=require(_0xcac5('0x6'));var sox=require(_0xcac5('0x7'));var csv=require('to-csv');var ejs=require(_0xcac5('0x8'));var fs=require('fs');var fs_extra=require(_0xcac5('0x9'));var _=require('lodash');var squel=require(_0xcac5('0xa'));var crypto=require(_0xcac5('0xb'));var jsforce=require(_0xcac5('0xc'));var deskjs=require(_0xcac5('0xd'));var toCsv=require(_0xcac5('0xe'));var querystring=require('querystring');var Papa=require(_0xcac5('0xf'));var Redis=require('ioredis');var authService=require(_0xcac5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcac5('0x11'));var hardwareService=require(_0xcac5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xcac5('0x13'));var config=require(_0xcac5('0x14'));var licenseUtil=require(_0xcac5('0x15'));var db=require(_0xcac5('0x16'))['db'];function respondWithStatusCode(_0x2c037a,_0x4e1b3b){_0x4e1b3b=_0x4e1b3b||0xcc;return function(_0xff4984){if(_0xff4984){return _0x2c037a[_0xcac5('0x17')](_0x4e1b3b);}return _0x2c037a['status'](_0x4e1b3b)['end']();};}function respondWithResult(_0x37ddfd,_0x2e93cb){_0x2e93cb=_0x2e93cb||0xc8;return function(_0x3e2e94){if(_0x3e2e94){return _0x37ddfd[_0xcac5('0x18')](_0x2e93cb)[_0xcac5('0x19')](_0x3e2e94);}};}function respondWithFilteredResult(_0x2e5397,_0x26a0c6){return function(_0x2c768d){if(_0x2c768d){var _0x3d85a4=typeof _0x26a0c6[_0xcac5('0x1a')]==='undefined'&&typeof _0x26a0c6[_0xcac5('0x1b')]==='undefined';var _0x28f92a=_0x2c768d[_0xcac5('0x1c')];var _0x5db216=_0x3d85a4?0x0:_0x26a0c6[_0xcac5('0x1a')];var _0x27657a=_0x3d85a4?_0x2c768d[_0xcac5('0x1c')]:_0x26a0c6['offset']+_0x26a0c6[_0xcac5('0x1b')];var _0x260fda;if(_0x27657a>=_0x28f92a){_0x27657a=_0x28f92a;_0x260fda=0xc8;}else{_0x260fda=0xce;}_0x2e5397[_0xcac5('0x18')](_0x260fda);return _0x2e5397['set'](_0xcac5('0x1d'),_0x5db216+'-'+_0x27657a+'/'+_0x28f92a)[_0xcac5('0x19')](_0x2c768d);}return null;};}function patchUpdates(_0x2bf0e2){return function(_0xe0bb21){try{jsonpatch[_0xcac5('0x1e')](_0xe0bb21,_0x2bf0e2,!![]);}catch(_0x5420d2){return BPromise['reject'](_0x5420d2);}return _0xe0bb21[_0xcac5('0x1f')]();};}function saveUpdates(_0x42eaef,_0x1914e9){return function(_0x3e8097){if(_0x3e8097){return _0x3e8097['update'](_0x42eaef)[_0xcac5('0x20')](function(_0x4eb9d8){return _0x4eb9d8;});}return null;};}function removeEntity(_0x3a7412,_0x424484){return function(_0x4c8dfb){if(_0x4c8dfb){return _0x4c8dfb[_0xcac5('0x21')]()[_0xcac5('0x20')](function(){_0x3a7412[_0xcac5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8a7f,_0x14f94f){return function(_0x40d593){if(!_0x40d593){_0x3c8a7f[_0xcac5('0x17')](0x194);}return _0x40d593;};}function handleError(_0x32e1f7,_0x14340d){_0x14340d=_0x14340d||0x1f4;return function(_0x262ea3){logger['error'](_0x262ea3[_0xcac5('0x22')]);if(_0x262ea3[_0xcac5('0x23')]){delete _0x262ea3[_0xcac5('0x23')];}_0x32e1f7[_0xcac5('0x18')](_0x14340d)['send'](_0x262ea3);};}exports[_0xcac5('0x24')]=function(_0xc76c7e,_0x3bda3e){var _0x57ca20={},_0x5a3d78={},_0x2cb1a9={'count':0x0,'rows':[]};var _0x877cde=_[_0xcac5('0x25')](db['FaxApplication']['rawAttributes'],function(_0x5c341c){return{'name':_0x5c341c['fieldName'],'type':_0x5c341c[_0xcac5('0x26')][_0xcac5('0x27')]};});_0x5a3d78[_0xcac5('0x28')]=_[_0xcac5('0x25')](_0x877cde,'name');_0x5a3d78[_0xcac5('0x29')]=_[_0xcac5('0x2a')](_0xc76c7e[_0xcac5('0x29')]);_0x5a3d78['filters']=_[_0xcac5('0x2b')](_0x5a3d78[_0xcac5('0x28')],_0x5a3d78['query']);_0x57ca20['attributes']=_[_0xcac5('0x2b')](_0x5a3d78[_0xcac5('0x28')],qs[_0xcac5('0x2c')](_0xc76c7e['query'][_0xcac5('0x2c')]));_0x57ca20[_0xcac5('0x2d')]=_0x57ca20[_0xcac5('0x2d')][_0xcac5('0x2e')]?_0x57ca20[_0xcac5('0x2d')]:_0x5a3d78[_0xcac5('0x28')];if(!_0xc76c7e[_0xcac5('0x29')][_0xcac5('0x2f')](_0xcac5('0x30'))){_0x57ca20[_0xcac5('0x1b')]=qs['limit'](_0xc76c7e[_0xcac5('0x29')][_0xcac5('0x1b')]);_0x57ca20[_0xcac5('0x1a')]=qs[_0xcac5('0x1a')](_0xc76c7e['query'][_0xcac5('0x1a')]);}_0x57ca20[_0xcac5('0x31')]=qs[_0xcac5('0x32')](_0xc76c7e[_0xcac5('0x29')][_0xcac5('0x32')]);_0x57ca20[_0xcac5('0x33')]=qs[_0xcac5('0x34')](_[_0xcac5('0x35')](_0xc76c7e[_0xcac5('0x29')],_0x5a3d78[_0xcac5('0x34')]),_0x877cde);if(_0xc76c7e[_0xcac5('0x29')]['filter']){_0x57ca20[_0xcac5('0x33')]=_['merge'](_0x57ca20['where'],{'$or':_[_0xcac5('0x25')](_0x877cde,function(_0x2b9e48){if(_0x2b9e48['type']!==_0xcac5('0x36')){var _0x2725a0={};_0x2725a0[_0x2b9e48[_0xcac5('0x23')]]={'$like':'%'+_0xc76c7e[_0xcac5('0x29')][_0xcac5('0x37')]+'%'};return _0x2725a0;}})});}_0x57ca20=_[_0xcac5('0x38')]({},_0x57ca20,_0xc76c7e[_0xcac5('0x39')]);var _0x59e3f8={'where':_0x57ca20[_0xcac5('0x33')]};return db['FaxApplication'][_0xcac5('0x1c')](_0x59e3f8)[_0xcac5('0x20')](function(_0x5d37ae){_0x2cb1a9['count']=_0x5d37ae;if(_0xc76c7e[_0xcac5('0x29')]['includeAll']){_0x57ca20[_0xcac5('0x3a')]=[{'all':!![]}];}return db[_0xcac5('0x3b')]['findAll'](_0x57ca20);})['then'](function(_0x5eeed8){_0x2cb1a9[_0xcac5('0x3c')]=_0x5eeed8;return _0x2cb1a9;})[_0xcac5('0x20')](respondWithFilteredResult(_0x3bda3e,_0x57ca20))[_0xcac5('0x3d')](handleError(_0x3bda3e,null));};exports[_0xcac5('0x3e')]=function(_0x41ace8,_0x3b901c){var _0x5d2cd6={'raw':!![],'where':{'id':_0x41ace8[_0xcac5('0x3f')]['id']}},_0x4aea11={};_0x4aea11[_0xcac5('0x28')]=_[_0xcac5('0x2a')](db['FaxApplication'][_0xcac5('0x40')]);_0x4aea11['query']=_[_0xcac5('0x2a')](_0x41ace8['query']);_0x4aea11[_0xcac5('0x34')]=_['intersection'](_0x4aea11[_0xcac5('0x28')],_0x4aea11[_0xcac5('0x29')]);_0x5d2cd6[_0xcac5('0x2d')]=_[_0xcac5('0x2b')](_0x4aea11[_0xcac5('0x28')],qs[_0xcac5('0x2c')](_0x41ace8[_0xcac5('0x29')][_0xcac5('0x2c')]));_0x5d2cd6['attributes']=_0x5d2cd6[_0xcac5('0x2d')][_0xcac5('0x2e')]?_0x5d2cd6[_0xcac5('0x2d')]:_0x4aea11[_0xcac5('0x28')];if(_0x41ace8[_0xcac5('0x29')][_0xcac5('0x41')]){_0x5d2cd6[_0xcac5('0x3a')]=[{'all':!![]}];}_0x5d2cd6=_[_0xcac5('0x38')]({},_0x5d2cd6,_0x41ace8[_0xcac5('0x39')]);return db['FaxApplication'][_0xcac5('0x42')](_0x5d2cd6)[_0xcac5('0x20')](handleEntityNotFound(_0x3b901c,null))[_0xcac5('0x20')](respondWithResult(_0x3b901c,null))[_0xcac5('0x3d')](handleError(_0x3b901c,null));};exports['create']=function(_0x22bb37,_0x35ed88){return db[_0xcac5('0x3b')][_0xcac5('0x43')](_0x22bb37[_0xcac5('0x44')],{})['then'](respondWithResult(_0x35ed88,0xc9))[_0xcac5('0x3d')](handleError(_0x35ed88,null));};exports[_0xcac5('0x45')]=function(_0x3fb6ac,_0x6d42c2){if(_0x3fb6ac[_0xcac5('0x44')]['id']){delete _0x3fb6ac['body']['id'];}return db['FaxApplication'][_0xcac5('0x42')]({'where':{'id':_0x3fb6ac[_0xcac5('0x3f')]['id']}})[_0xcac5('0x20')](handleEntityNotFound(_0x6d42c2,null))[_0xcac5('0x20')](saveUpdates(_0x3fb6ac[_0xcac5('0x44')],null))[_0xcac5('0x20')](respondWithResult(_0x6d42c2,null))['catch'](handleError(_0x6d42c2,null));};exports[_0xcac5('0x21')]=function(_0x466bbf,_0x7baa17){return db[_0xcac5('0x3b')][_0xcac5('0x42')]({'where':{'id':_0x466bbf[_0xcac5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x7baa17,null))[_0xcac5('0x20')](removeEntity(_0x7baa17,null))[_0xcac5('0x3d')](handleError(_0x7baa17,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 0adc044..5e35ce1 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 _0x67e3=['define','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','./faxApplication.attributes','exports'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x67e3,0xc4));var _0x367e=function(_0x2ed07f,_0x343012){_0x2ed07f=_0x2ed07f-0x0;var _0x3b5ad1=_0x67e3[_0x2ed07f];return _0x3b5ad1;};'use strict';var _=require('lodash');var util=require(_0x367e('0x0'));var logger=require(_0x367e('0x1'))(_0x367e('0x2'));var moment=require('moment');var BPromise=require(_0x367e('0x3'));var rp=require(_0x367e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x367e('0x5'));var config=require('../../config/environment');var attributes=require(_0x367e('0x6'));module[_0x367e('0x7')]=function(_0x12ce3c,_0x40638a){return _0x12ce3c[_0x367e('0x8')]('FaxApplication',attributes,{'tableName':_0x367e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x367e('0xa'),'collate':_0x367e('0xb')});}; \ No newline at end of file +var _0xc999=['bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x5c7055,_0x550d42){var _0x20d196=function(_0x47e15e){while(--_0x47e15e){_0x5c7055['push'](_0x5c7055['shift']());}};_0x20d196(++_0x550d42);}(_0xc999,0x1ea));var _0x9c99=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xc999[_0x1db251];return _0x56685a;};'use strict';var _=require('lodash');var util=require(_0x9c99('0x0'));var logger=require(_0x9c99('0x1'))(_0x9c99('0x2'));var moment=require(_0x9c99('0x3'));var BPromise=require(_0x9c99('0x4'));var rp=require(_0x9c99('0x5'));var fs=require('fs');var path=require(_0x9c99('0x6'));var rimraf=require('rimraf');var config=require(_0x9c99('0x7'));var attributes=require(_0x9c99('0x8'));module['exports']=function(_0x572c4d,_0x1ac0b8){return _0x572c4d['define'](_0x9c99('0x9'),attributes,{'tableName':_0x9c99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c99('0xb'),'collate':_0x9c99('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index d280d9a..714dfdf 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 _0x1522=['http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x236f12,_0x4c7faf){var _0x32969a=function(_0x3a3e1d){while(--_0x3a3e1d){_0x236f12['push'](_0x236f12['shift']());}};_0x32969a(++_0x4c7faf);}(_0x1522,0x95));var _0x2152=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1522[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2152('0x0'));var util=require(_0x2152('0x1'));var moment=require(_0x2152('0x2'));var BPromise=require(_0x2152('0x3'));var rs=require(_0x2152('0x4'));var fs=require('fs');var Redis=require(_0x2152('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2152('0x6'));var logger=require(_0x2152('0x7'))(_0x2152('0x8'));var config=require('../../config/environment');var jayson=require(_0x2152('0x9'));var client=jayson[_0x2152('0xa')][_0x2152('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bbc6,_0x2b56e5,_0x21b683){return new BPromise(function(_0x51caca,_0xc547ac){return client[_0x2152('0xc')](_0x4bbc6,_0x21b683)[_0x2152('0xd')](function(_0x42454e){logger['info'](_0x2152('0xe'),_0x2b56e5,_0x2152('0xf'));logger[_0x2152('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2b56e5,_0x2152('0xf'),JSON[_0x2152('0x11')](_0x42454e));if(_0x42454e[_0x2152('0x12')]){if(_0x42454e['error'][_0x2152('0x13')]===0x1f4){logger[_0x2152('0x12')](_0x2152('0xe'),_0x2b56e5,_0x42454e[_0x2152('0x12')][_0x2152('0x14')]);return _0xc547ac(_0x42454e['error'][_0x2152('0x14')]);}logger[_0x2152('0x12')](_0x2152('0xe'),_0x2b56e5,_0x42454e['error']['message']);return _0x51caca(_0x42454e['error'][_0x2152('0x14')]);}else{logger[_0x2152('0x15')]('FaxApplication,\x20%s,\x20%s',_0x2b56e5,_0x2152('0xf'));_0x51caca(_0x42454e[_0x2152('0x16')][_0x2152('0x14')]);}})['catch'](function(_0x40d008){logger[_0x2152('0x12')](_0x2152('0xe'),_0x2b56e5,_0x40d008);_0xc547ac(_0x40d008);});});}exports[_0x2152('0x17')]=function(_0x3ad7f2){var _0x1a5133=this;return new Promise(function(_0x3742e5,_0x24d496){return db[_0x2152('0x18')]['update'](_0x3ad7f2[_0x2152('0x19')],{'raw':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2[_0x2152('0x1a')][_0x2152('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2['options'][_0x2152('0x1c')]||null:null,'attributes':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2[_0x2152('0x1a')][_0x2152('0x1d')]||null:null,'limit':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2['options'][_0x2152('0x1e')]||null:null})[_0x2152('0xd')](function(_0x12582f){logger['info'](_0x2152('0x17'),_0x3ad7f2);logger[_0x2152('0x10')](_0x2152('0x17'),_0x3ad7f2,JSON['stringify'](_0x12582f));_0x3742e5(_0x12582f);})[_0x2152('0x1f')](function(_0x17f1c1){logger[_0x2152('0x12')](_0x2152('0x17'),_0x17f1c1[_0x2152('0x14')],_0x3ad7f2);_0x24d496(_0x1a5133[_0x2152('0x12')](0x1f4,_0x17f1c1[_0x2152('0x14')]));});});}; \ No newline at end of file +var _0xa1ca=['http','request','then','debug','request\x20sent','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','catch','UpdateFaxApplication','FaxApplication','update','body','raw','options','where','attributes','limit','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0xa1ca,0x99));var _0xaa1c=function(_0xfdf7a4,_0x37da46){_0xfdf7a4=_0xfdf7a4-0x0;var _0x59ec89=_0xa1ca[_0xfdf7a4];return _0x59ec89;};'use strict';var _=require(_0xaa1c('0x0'));var util=require(_0xaa1c('0x1'));var moment=require(_0xaa1c('0x2'));var BPromise=require(_0xaa1c('0x3'));var rs=require(_0xaa1c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa1c('0x5'))['db'];var utils=require(_0xaa1c('0x6'));var logger=require(_0xaa1c('0x7'))(_0xaa1c('0x8'));var config=require(_0xaa1c('0x9'));var jayson=require(_0xaa1c('0xa'));var client=jayson[_0xaa1c('0xb')][_0xaa1c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x121b4e,_0x2c95f7,_0x54a00d){return new BPromise(function(_0x5a0164,_0x1535bb){return client[_0xaa1c('0xd')](_0x121b4e,_0x54a00d)[_0xaa1c('0xe')](function(_0x1f7dc4){logger['info']('FaxApplication,\x20%s,\x20%s',_0x2c95f7,'request\x20sent');logger[_0xaa1c('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2c95f7,_0xaa1c('0x10'),JSON[_0xaa1c('0x11')](_0x1f7dc4));if(_0x1f7dc4[_0xaa1c('0x12')]){if(_0x1f7dc4[_0xaa1c('0x12')][_0xaa1c('0x13')]===0x1f4){logger[_0xaa1c('0x12')]('FaxApplication,\x20%s,\x20%s',_0x2c95f7,_0x1f7dc4[_0xaa1c('0x12')][_0xaa1c('0x14')]);return _0x1535bb(_0x1f7dc4['error'][_0xaa1c('0x14')]);}logger[_0xaa1c('0x12')](_0xaa1c('0x15'),_0x2c95f7,_0x1f7dc4['error'][_0xaa1c('0x14')]);return _0x5a0164(_0x1f7dc4[_0xaa1c('0x12')]['message']);}else{logger['info'](_0xaa1c('0x15'),_0x2c95f7,'request\x20sent');_0x5a0164(_0x1f7dc4['result'][_0xaa1c('0x14')]);}})[_0xaa1c('0x16')](function(_0x12e6fd){logger[_0xaa1c('0x12')]('FaxApplication,\x20%s,\x20%s',_0x2c95f7,_0x12e6fd);_0x1535bb(_0x12e6fd);});});}exports[_0xaa1c('0x17')]=function(_0x5ee583){var _0x342666=this;return new Promise(function(_0x29e07d,_0x1dc19d){return db[_0xaa1c('0x18')][_0xaa1c('0x19')](_0x5ee583[_0xaa1c('0x1a')],{'raw':_0x5ee583['options']?_0x5ee583['options'][_0xaa1c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ee583[_0xaa1c('0x1c')]?_0x5ee583[_0xaa1c('0x1c')][_0xaa1c('0x1d')]||null:null,'attributes':_0x5ee583[_0xaa1c('0x1c')]?_0x5ee583[_0xaa1c('0x1c')][_0xaa1c('0x1e')]||null:null,'limit':_0x5ee583[_0xaa1c('0x1c')]?_0x5ee583[_0xaa1c('0x1c')][_0xaa1c('0x1f')]||null:null})[_0xaa1c('0xe')](function(_0x31fb36){logger[_0xaa1c('0x20')](_0xaa1c('0x17'),_0x5ee583);logger['debug'](_0xaa1c('0x17'),_0x5ee583,JSON['stringify'](_0x31fb36));_0x29e07d(_0x31fb36);})[_0xaa1c('0x16')](function(_0x13ece3){logger[_0xaa1c('0x12')](_0xaa1c('0x17'),_0x13ece3['message'],_0x5ee583);_0x1dc19d(_0x342666['error'](0x1f4,_0x13ece3[_0xaa1c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 6d779d4..116ee1c 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 _0xe511=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','show','post','put'];(function(_0x5c0e79,_0x3a5fc5){var _0x1a647c=function(_0xf24522){while(--_0xf24522){_0x5c0e79['push'](_0x5c0e79['shift']());}};_0x1a647c(++_0x3a5fc5);}(_0xe511,0x16f));var _0x1e51=function(_0x15131a,_0x204bcd){_0x15131a=_0x15131a-0x0;var _0x8f309b=_0xe511[_0x15131a];return _0x8f309b;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e51('0xc')](_0x1e51('0xd'),auth[_0x1e51('0xe')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')](_0x1e51('0xd'),auth['isAuthenticated'](),controller[_0x1e51('0x11')]);module[_0x1e51('0x12')]=router; \ No newline at end of file +var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x24cdb3,_0x10a54e){var _0x1b1829=function(_0x50a57c){while(--_0x50a57c){_0x24cdb3['push'](_0x24cdb3['shift']());}};_0x1b1829(++_0x10a54e);}(_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('./faxApplication.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 6c72e8d..df4a954 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 _0x5074=['out','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x807ec1,_0x248b9f){var _0x383adb=function(_0x41378e){while(--_0x41378e){_0x807ec1['push'](_0x807ec1['shift']());}};_0x383adb(++_0x248b9f);}(_0x5074,0x1e7));var _0x4507=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0x5074[_0x4f6d08];return _0x53a9c6;};'use strict';var Sequelize=require('sequelize');module[_0x4507('0x0')]={'closed':{'type':Sequelize[_0x4507('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4507('0x2')]},'secondDisposition':{'type':Sequelize[_0x4507('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4507('0x2')]},'note':{'type':Sequelize[_0x4507('0x2')]},'read1stAt':{'type':Sequelize[_0x4507('0x3')]},'fax':{'type':Sequelize[_0x4507('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4507('0x4')]('in',_0x4507('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4507('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4507('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb1dc=['out','ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x4c4bef,_0x290e22){var _0xdd118c=function(_0x4561f0){while(--_0x4561f0){_0x4c4bef['push'](_0x4c4bef['shift']());}};_0xdd118c(++_0x290e22);}(_0xb1dc,0x1bb));var _0xcb1d=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xb1dc[_0x35fb56];return _0x2fd52c;};'use strict';var Sequelize=require(_0xcb1d('0x0'));module[_0xcb1d('0x1')]={'closed':{'type':Sequelize[_0xcb1d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcb1d('0x3')]},'disposition':{'type':Sequelize[_0xcb1d('0x4')]},'secondDisposition':{'type':Sequelize[_0xcb1d('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcb1d('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcb1d('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xcb1d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcb1d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcb1d('0x6')]('in',_0xcb1d('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 254e1b5..789f4a3 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 _0xc27b=['update','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','options','findAll','rows','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','join','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','resolve','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','query','user','catch','show','params','keys','filters','intersection','model','fields','attributes','includeAll','include','find','create','body'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0xc27b,0x9c));var _0xbc27=function(_0x579c21,_0xe642a){_0x579c21=_0x579c21-0x0;var _0x12aa22=_0xc27b[_0x579c21];return _0x12aa22;};'use strict';var rimraf=require(_0xbc27('0x0'));var zipdir=require(_0xbc27('0x1'));var moment=require(_0xbc27('0x2'));var BPromise=require(_0xbc27('0x3'));var util=require('util');var path=require(_0xbc27('0x4'));var fs=require('fs');var _=require(_0xbc27('0x5'));var Redis=require('ioredis');var interaction=require(_0xbc27('0x6'));var qs=require(_0xbc27('0x7'));var logger=require(_0xbc27('0x8'))(_0xbc27('0x9'));var config=require(_0xbc27('0xa'));var db=require(_0xbc27('0xb'))['db'];config[_0xbc27('0xc')]=_[_0xbc27('0xd')](config[_0xbc27('0xc')],{'host':_0xbc27('0xe'),'port':0x18eb});var socket=require(_0xbc27('0xf'))(new Redis(config[_0xbc27('0xc')]));require(_0xbc27('0x10'))[_0xbc27('0x11')](socket);function respondWithStatusCode(_0x5817f7,_0x3a2e3e){_0x3a2e3e=_0x3a2e3e||0xcc;return function(_0x162d80){if(_0x162d80){return _0x5817f7['sendStatus'](_0x3a2e3e);}return _0x5817f7[_0xbc27('0x12')](_0x3a2e3e)[_0xbc27('0x13')]();};}function respondWithResult(_0x2c1652,_0x57c940){_0x57c940=_0x57c940||0xc8;return function(_0x1dbb6f){if(_0x1dbb6f){return _0x2c1652[_0xbc27('0x12')](_0x57c940)[_0xbc27('0x14')](_0x1dbb6f);}};}function respondWithFilteredResult(_0x1d67fc,_0x16b965){return function(_0x2c8a6a){if(_0x2c8a6a){var _0x19e1c7=typeof _0x16b965[_0xbc27('0x15')]==='undefined'&&typeof _0x16b965[_0xbc27('0x16')]===_0xbc27('0x17');var _0x2ed457=_0x2c8a6a[_0xbc27('0x18')];var _0xa36cae=_0x19e1c7?0x0:_0x16b965['offset'];var _0x2c50f6=_0x19e1c7?_0x2c8a6a[_0xbc27('0x18')]:_0x16b965['offset']+_0x16b965[_0xbc27('0x16')];var _0x30cfae;if(_0x2c50f6>=_0x2ed457){_0x2c50f6=_0x2ed457;_0x30cfae=0xc8;}else{_0x30cfae=0xce;}_0x1d67fc[_0xbc27('0x12')](_0x30cfae);return _0x1d67fc[_0xbc27('0x19')](_0xbc27('0x1a'),_0xa36cae+'-'+_0x2c50f6+'/'+_0x2ed457)[_0xbc27('0x14')](_0x2c8a6a);}return null;};}function saveUpdates(_0x5afa28){return function(_0x157c57){if(_0x157c57){return _0x157c57['update'](_0x5afa28)[_0xbc27('0x1b')](function(_0x22cee0){return _0x22cee0;});}return null;};}function removeEntity(_0x5179e9){return function(_0x496f68){if(_0x496f68){return _0x496f68[_0xbc27('0x1c')]()[_0xbc27('0x1b')](function(){_0x5179e9[_0xbc27('0x12')](0xcc)[_0xbc27('0x13')]();});}};}function handleEntityNotFound(_0x44473e){return function(_0x2a4a03){if(!_0x2a4a03){_0x44473e[_0xbc27('0x1d')](0x194);}return _0x2a4a03;};}function handleError(_0x22f7fa,_0x3eb0be){_0x3eb0be=_0x3eb0be||0x1f4;return function(_0x44ad14){logger[_0xbc27('0x1e')](_0x44ad14[_0xbc27('0x1f')]);if(_0x44ad14[_0xbc27('0x20')]){delete _0x44ad14[_0xbc27('0x20')];}_0x22f7fa['status'](_0x3eb0be)['send'](_0x44ad14);};}exports[_0xbc27('0x21')]=function(_0x20e978,_0x2cbe69){var _0x685df={};var _0x38b3b1=_[_0xbc27('0x22')](db[_0xbc27('0x23')][_0xbc27('0x24')],function(_0x1ec0d2){return{'name':_0x1ec0d2[_0xbc27('0x25')],'type':_0x1ec0d2['type'][_0xbc27('0x26')]};});_0x685df=qs[_0xbc27('0x27')](_0x38b3b1,_0x20e978);return interaction['findAll']('fax',_0x20e978[_0xbc27('0x28')],_0x20e978[_0xbc27('0x29')],_0x685df,_0x38b3b1)['then'](respondWithFilteredResult(_0x2cbe69,_0x685df))[_0xbc27('0x2a')](handleError(_0x2cbe69,null));};exports[_0xbc27('0x2b')]=function(_0x241415,_0x78d7ac){var _0x3444a9={'raw':![],'where':{'id':_0x241415[_0xbc27('0x2c')]['id']}},_0x44b7f3={};_0x44b7f3['model']=_['keys'](db['FaxInteraction'][_0xbc27('0x24')]);_0x44b7f3[_0xbc27('0x28')]=_[_0xbc27('0x2d')](_0x241415[_0xbc27('0x28')]);_0x44b7f3[_0xbc27('0x2e')]=_[_0xbc27('0x2f')](_0x44b7f3['model'],_0x44b7f3[_0xbc27('0x28')]);_0x3444a9['attributes']=_[_0xbc27('0x2f')](_0x44b7f3[_0xbc27('0x30')],qs[_0xbc27('0x31')](_0x241415['query'][_0xbc27('0x31')]));_0x3444a9[_0xbc27('0x32')]=_0x3444a9[_0xbc27('0x32')]['length']?_0x3444a9[_0xbc27('0x32')]:_0x44b7f3['model'];if(_0x241415[_0xbc27('0x28')][_0xbc27('0x33')]){_0x3444a9[_0xbc27('0x34')]=[{'all':!![]}];}_0x3444a9=_['merge']({},_0x3444a9,_0x241415['options']);return db[_0xbc27('0x23')][_0xbc27('0x35')](_0x3444a9)[_0xbc27('0x1b')](handleEntityNotFound(_0x78d7ac,null))[_0xbc27('0x1b')](respondWithResult(_0x78d7ac,null))[_0xbc27('0x2a')](handleError(_0x78d7ac,null));};exports[_0xbc27('0x36')]=function(_0xc3270a,_0x3d4b64){return db[_0xbc27('0x23')][_0xbc27('0x36')](_0xc3270a[_0xbc27('0x37')],{})[_0xbc27('0x1b')](respondWithResult(_0x3d4b64,0xc9))[_0xbc27('0x2a')](handleError(_0x3d4b64,null));};exports[_0xbc27('0x38')]=function(_0x17beea,_0x5cf2e9){if(_0x17beea['body']['id']){delete _0x17beea[_0xbc27('0x37')]['id'];}return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x17beea['params']['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x5cf2e9,null))[_0xbc27('0x1b')](saveUpdates(_0x17beea[_0xbc27('0x37')],null))[_0xbc27('0x1b')](respondWithResult(_0x5cf2e9,null))[_0xbc27('0x2a')](handleError(_0x5cf2e9,null));};exports[_0xbc27('0x1c')]=function(_0x48b858,_0x566f2c){return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x48b858[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x566f2c,null))['then'](removeEntity(_0x566f2c,null))['catch'](handleError(_0x566f2c,null));};exports[_0xbc27('0x39')]=function(_0x5f30e9,_0x429a44){return db[_0xbc27('0x23')][_0xbc27('0x39')]()[_0xbc27('0x1b')](respondWithResult(_0x429a44,null))['catch'](handleError(_0x429a44,null));};exports['addMessage']=function(_0x11a287,_0x4ff43e){return db[_0xbc27('0x3a')][_0xbc27('0x35')]({'where':{'id':_0x11a287['params']['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x4ff43e,null))['then'](function(_0x5000ba){if(_0x5000ba){return _0x5000ba[_0xbc27('0x3b')](_0x11a287[_0xbc27('0x37')][_0xbc27('0x3c')],_[_0xbc27('0x3d')](_0x11a287[_0xbc27('0x37')],[_0xbc27('0x3c'),'id'])||{});}})[_0xbc27('0x1b')](respondWithResult(_0x4ff43e,null))[_0xbc27('0x2a')](handleError(_0x4ff43e,null));};exports[_0xbc27('0x3e')]=function(_0x428034,_0xf5ae4f){var _0x465522={'raw':![],'where':{}};var _0x5c4e4d={};var _0x5d6338={'count':0x0,'rows':[]};return db[_0xbc27('0x23')][_0xbc27('0x3f')]({'where':{'id':_0x428034[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0xf5ae4f,null))[_0xbc27('0x1b')](function(_0x61fd97){if(_0x61fd97){_0x5c4e4d[_0xbc27('0x30')]=_[_0xbc27('0x2d')](db['FaxMessage']['rawAttributes']);_0x5c4e4d[_0xbc27('0x28')]=_[_0xbc27('0x2d')](_0x428034[_0xbc27('0x28')]);_0x5c4e4d[_0xbc27('0x2e')]=_[_0xbc27('0x2f')](_0x5c4e4d['model'],_0x5c4e4d[_0xbc27('0x28')]);_0x465522[_0xbc27('0x32')]=_['intersection'](_0x5c4e4d[_0xbc27('0x30')],qs[_0xbc27('0x31')](_0x428034[_0xbc27('0x28')]['fields']));_0x465522['attributes']=_0x465522['attributes'][_0xbc27('0x40')]?_0x465522[_0xbc27('0x32')]:_0x5c4e4d['model'];if(!_0x428034[_0xbc27('0x28')][_0xbc27('0x41')](_0xbc27('0x42'))){_0x465522[_0xbc27('0x16')]=qs[_0xbc27('0x16')](_0x428034[_0xbc27('0x28')][_0xbc27('0x16')]);_0x465522[_0xbc27('0x15')]=qs[_0xbc27('0x15')](_0x428034[_0xbc27('0x28')][_0xbc27('0x15')]);}_0x465522[_0xbc27('0x43')]=qs[_0xbc27('0x44')](_0x428034['query']['sort']);_0x465522[_0xbc27('0x45')]=qs[_0xbc27('0x2e')](_['pick'](_0x428034[_0xbc27('0x28')],_0x5c4e4d['filters']));_0x465522[_0xbc27('0x45')][_0xbc27('0x46')]=_0x61fd97['id'];if(_0x428034[_0xbc27('0x28')][_0xbc27('0x47')]){_0x465522['where']=_['merge'](_0x465522['where'],{'$or':_['map'](_0x465522['attributes'],function(_0x9bda8a){var _0x46f6ff={};_0x46f6ff[_0x9bda8a]={'$like':'%'+_0x428034[_0xbc27('0x28')][_0xbc27('0x47')]+'%'};return _0x46f6ff;})});}if(_0x428034[_0xbc27('0x28')][_0xbc27('0x48')]){var _0x48d43e=_0x428034['query']['$gte'][_0xbc27('0x49')](',');var _0x4323de={};_0x4323de[_0x48d43e[0x0]]={'$gte':moment(_0x48d43e[0x1])['format'](_0xbc27('0x4a'))};_0x465522['where']=_[_0xbc27('0x4b')](_0x465522[_0xbc27('0x45')],_0x4323de);}_0x465522=_[_0xbc27('0x4b')]({},_0x465522,_0x428034[_0xbc27('0x4c')]);return db[_0xbc27('0x3a')][_0xbc27('0x18')]({'where':_0x465522[_0xbc27('0x45')]})[_0xbc27('0x1b')](function(_0x2b0e58){_0x5d6338[_0xbc27('0x18')]=_0x2b0e58;if(_0x428034[_0xbc27('0x28')][_0xbc27('0x33')]){_0x465522[_0xbc27('0x34')]=[{'all':!![]}];}return db['FaxMessage'][_0xbc27('0x4d')](_0x465522);})[_0xbc27('0x1b')](function(_0x5718db){_0x5d6338[_0xbc27('0x4e')]=_0x5718db;return _0x5d6338;});}})[_0xbc27('0x1b')](respondWithFilteredResult(_0xf5ae4f,_0x465522))['catch'](handleError(_0xf5ae4f,null));};exports[_0xbc27('0x4f')]=function(_0x2aac95,_0x48d672){return db['FaxInteraction'][_0xbc27('0x35')]({'where':{'id':_0x2aac95[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x48d672,null))['then'](function(_0x4f4bbe){if(_0x4f4bbe){return _0x4f4bbe[_0xbc27('0x50')](_0x2aac95['body'][_0xbc27('0x3c')],_['omit'](_0x2aac95['body'],[_0xbc27('0x3c'),'id'])||{})[_0xbc27('0x51')](function(){return db['Tag'][_0xbc27('0x4d')]({'attributes':['id',_0xbc27('0x20'),_0xbc27('0x52')],'where':{'id':_0x2aac95[_0xbc27('0x37')][_0xbc27('0x3c')]}});})['then'](function(_0x4d64e3){socket[_0xbc27('0x53')](_0xbc27('0x54'),{'id':Number(_0x2aac95['params']['id']),'tags':_0x4d64e3||[]});return{'id':Number(_0x2aac95['params']['id']),'tags':_0x4d64e3||[]};});}})[_0xbc27('0x1b')](respondWithResult(_0x48d672,null))[_0xbc27('0x2a')](handleError(_0x48d672,null));};exports[_0xbc27('0x55')]=function(_0x5c8e3d,_0x30472d){return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x5c8e3d[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x30472d,null))['then'](function(_0x58f187){if(_0x58f187){return _0x58f187[_0xbc27('0x55')](_0x5c8e3d[_0xbc27('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x30472d,null))[_0xbc27('0x2a')](handleError(_0x30472d,null));};exports[_0xbc27('0x56')]=function(_0x3c4e87,_0x5dbb3f){var _0x5b4bff=moment()[_0xbc27('0x57')]()['toString']();var _0x4d8b24=path['join'](config[_0xbc27('0x58')],_0xbc27('0x59'),_0xbc27('0x5a'),'tmp');var _0xa81a5e=path[_0xbc27('0x5b')](config[_0xbc27('0x58')],_0xbc27('0x59'),'files',_0xbc27('0x5c'));var _0x16b58f=path[_0xbc27('0x5b')](_0x4d8b24,_0x5b4bff);var _0x41c839=util[_0xbc27('0x5d')](_0xbc27('0x5e'),_0x3c4e87[_0xbc27('0x2c')]['id'],_0x5b4bff);var _0x4c96aa=path[_0xbc27('0x5b')](_0x4d8b24,_0x41c839);var _0x2c60f7=[];_0x2c60f7[_0xbc27('0x5f')]({'model':db[_0xbc27('0x60')],'as':'Attachment','raw':!![]});var _0x10a185=[{'model':db[_0xbc27('0x3a')],'as':_0xbc27('0x61'),'attributes':['id',_0xbc27('0x37'),_0xbc27('0x62')],'include':_0x2c60f7}];return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x3c4e87[_0xbc27('0x2c')]['id']},'include':_0x10a185})['then'](handleEntityNotFound(_0x5dbb3f,null))['then'](function(_0x16db89){if(_0x16db89&&_0x16db89['Messages']){var _0x22d863=_0x16db89['get']({'plain':!![]});fs[_0xbc27('0x63')](_0x16b58f);for(var _0x1b28be=0x0;_0x1b28be<_0x22d863[_0xbc27('0x61')]['length'];_0x1b28be++){var _0x1e745d=_0x22d863[_0xbc27('0x61')][_0x1b28be][_0xbc27('0x60')];if(_0x1e745d){var _0x5e2ec8=path[_0xbc27('0x5b')](_0xa81a5e,_0x1e745d[_0xbc27('0x64')]);if(fs[_0xbc27('0x65')](_0x5e2ec8)){fs[_0xbc27('0x66')](_0x5e2ec8)['pipe'](fs['createWriteStream'](path[_0xbc27('0x5b')](_0x16b58f,_0x1e745d[_0xbc27('0x64')])));}}}return BPromise[_0xbc27('0x67')]()[_0xbc27('0x1b')](function(){return new BPromise(function(_0x19ba11,_0x14db03){zipdir(_0x16b58f,{'saveTo':_0x4c96aa},function(_0x432170,_0x31efdd){if(_0x432170)return _0x14db03(_0x432170);return _0x19ba11(_0x31efdd);});})[_0xbc27('0x1b')](function(){return new BPromise(function(_0x413d77,_0x497e45){rimraf(_0x16b58f,function(_0x17c60f){if(_0x17c60f)_0x497e45(_0x17c60f);return _0x413d77();});});})['then'](function(){return _0x5dbb3f[_0xbc27('0x56')](_0x4c96aa,_0x41c839,function(_0x59684b){if(_0x59684b){console['log'](_0xbc27('0x68'),_0x59684b);}else{fs[_0xbc27('0x69')](_0x4c96aa);}});});});}else{return _0x5dbb3f[_0xbc27('0x1d')](0xc8);}})[_0xbc27('0x2a')](handleError(_0x5dbb3f,null));}; \ No newline at end of file +var _0xf052=['fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','$gte','split','options','findAll','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','fax','query','user','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','include','find','create','FaxInteraction','update','body','describe','FaxMessage','ids','omit'];(function(_0x521f70,_0x29f1ed){var _0x10b2a9=function(_0xded4ac){while(--_0xded4ac){_0x521f70['push'](_0x521f70['shift']());}};_0x10b2a9(++_0x29f1ed);}(_0xf052,0x1ca));var _0x2f05=function(_0x5b8155,_0x51c636){_0x5b8155=_0x5b8155-0x0;var _0x1d6f07=_0xf052[_0x5b8155];return _0x1d6f07;};'use strict';var rimraf=require(_0x2f05('0x0'));var zipdir=require(_0x2f05('0x1'));var moment=require(_0x2f05('0x2'));var BPromise=require(_0x2f05('0x3'));var util=require(_0x2f05('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x2f05('0x5'));var Redis=require(_0x2f05('0x6'));var interaction=require(_0x2f05('0x7'));var qs=require(_0x2f05('0x8'));var logger=require(_0x2f05('0x9'))('api');var config=require(_0x2f05('0xa'));var db=require(_0x2f05('0xb'))['db'];config[_0x2f05('0xc')]=_[_0x2f05('0xd')](config[_0x2f05('0xc')],{'host':_0x2f05('0xe'),'port':0x18eb});var socket=require(_0x2f05('0xf'))(new Redis(config[_0x2f05('0xc')]));require(_0x2f05('0x10'))[_0x2f05('0x11')](socket);function respondWithStatusCode(_0x1abab2,_0x377d57){_0x377d57=_0x377d57||0xcc;return function(_0x250219){if(_0x250219){return _0x1abab2[_0x2f05('0x12')](_0x377d57);}return _0x1abab2[_0x2f05('0x13')](_0x377d57)[_0x2f05('0x14')]();};}function respondWithResult(_0x1606b,_0x556892){_0x556892=_0x556892||0xc8;return function(_0x5d6191){if(_0x5d6191){return _0x1606b[_0x2f05('0x13')](_0x556892)[_0x2f05('0x15')](_0x5d6191);}};}function respondWithFilteredResult(_0x21ce0a,_0x312f04){return function(_0x5390ab){if(_0x5390ab){var _0x231521=typeof _0x312f04['offset']===_0x2f05('0x16')&&typeof _0x312f04[_0x2f05('0x17')]===_0x2f05('0x16');var _0x7e8a81=_0x5390ab[_0x2f05('0x18')];var _0x336281=_0x231521?0x0:_0x312f04['offset'];var _0x45a448=_0x231521?_0x5390ab['count']:_0x312f04[_0x2f05('0x19')]+_0x312f04[_0x2f05('0x17')];var _0x24b9fc;if(_0x45a448>=_0x7e8a81){_0x45a448=_0x7e8a81;_0x24b9fc=0xc8;}else{_0x24b9fc=0xce;}_0x21ce0a[_0x2f05('0x13')](_0x24b9fc);return _0x21ce0a[_0x2f05('0x1a')]('Content-Range',_0x336281+'-'+_0x45a448+'/'+_0x7e8a81)[_0x2f05('0x15')](_0x5390ab);}return null;};}function saveUpdates(_0x1d3660){return function(_0x4e9793){if(_0x4e9793){return _0x4e9793['update'](_0x1d3660)[_0x2f05('0x1b')](function(_0x5552d2){return _0x5552d2;});}return null;};}function removeEntity(_0x17b493){return function(_0x129865){if(_0x129865){return _0x129865[_0x2f05('0x1c')]()[_0x2f05('0x1b')](function(){_0x17b493['status'](0xcc)[_0x2f05('0x14')]();});}};}function handleEntityNotFound(_0x19aa8c){return function(_0x49fa02){if(!_0x49fa02){_0x19aa8c[_0x2f05('0x12')](0x194);}return _0x49fa02;};}function handleError(_0x770292,_0x10cd09){_0x10cd09=_0x10cd09||0x1f4;return function(_0x349034){logger[_0x2f05('0x1d')](_0x349034[_0x2f05('0x1e')]);if(_0x349034[_0x2f05('0x1f')]){delete _0x349034[_0x2f05('0x1f')];}_0x770292[_0x2f05('0x13')](_0x10cd09)[_0x2f05('0x20')](_0x349034);};}exports[_0x2f05('0x21')]=function(_0x47bb30,_0x24ba01){var _0x350871={};var _0x5bbb93=_[_0x2f05('0x22')](db['FaxInteraction'][_0x2f05('0x23')],function(_0x291577){return{'name':_0x291577[_0x2f05('0x24')],'type':_0x291577[_0x2f05('0x25')]['key']};});_0x350871=qs[_0x2f05('0x26')](_0x5bbb93,_0x47bb30);return interaction['findAll'](_0x2f05('0x27'),_0x47bb30[_0x2f05('0x28')],_0x47bb30[_0x2f05('0x29')],_0x350871,_0x5bbb93)[_0x2f05('0x1b')](respondWithFilteredResult(_0x24ba01,_0x350871))[_0x2f05('0x2a')](handleError(_0x24ba01,null));};exports[_0x2f05('0x2b')]=function(_0x86b6c9,_0x3c3d27){var _0x500f80={'raw':![],'where':{'id':_0x86b6c9[_0x2f05('0x2c')]['id']}},_0x2f327b={};_0x2f327b[_0x2f05('0x2d')]=_[_0x2f05('0x2e')](db['FaxInteraction'][_0x2f05('0x23')]);_0x2f327b['query']=_[_0x2f05('0x2e')](_0x86b6c9['query']);_0x2f327b[_0x2f05('0x2f')]=_[_0x2f05('0x30')](_0x2f327b['model'],_0x2f327b[_0x2f05('0x28')]);_0x500f80[_0x2f05('0x31')]=_[_0x2f05('0x30')](_0x2f327b[_0x2f05('0x2d')],qs['fields'](_0x86b6c9[_0x2f05('0x28')]['fields']));_0x500f80[_0x2f05('0x31')]=_0x500f80['attributes'][_0x2f05('0x32')]?_0x500f80[_0x2f05('0x31')]:_0x2f327b[_0x2f05('0x2d')];if(_0x86b6c9['query'][_0x2f05('0x33')]){_0x500f80[_0x2f05('0x34')]=[{'all':!![]}];}_0x500f80=_['merge']({},_0x500f80,_0x86b6c9['options']);return db['FaxInteraction'][_0x2f05('0x35')](_0x500f80)['then'](handleEntityNotFound(_0x3c3d27,null))[_0x2f05('0x1b')](respondWithResult(_0x3c3d27,null))[_0x2f05('0x2a')](handleError(_0x3c3d27,null));};exports[_0x2f05('0x36')]=function(_0x59b4ce,_0x35ea8b){return db[_0x2f05('0x37')]['create'](_0x59b4ce['body'],{})[_0x2f05('0x1b')](respondWithResult(_0x35ea8b,0xc9))['catch'](handleError(_0x35ea8b,null));};exports[_0x2f05('0x38')]=function(_0x448899,_0x30f267){if(_0x448899[_0x2f05('0x39')]['id']){delete _0x448899[_0x2f05('0x39')]['id'];}return db[_0x2f05('0x37')][_0x2f05('0x35')]({'where':{'id':_0x448899[_0x2f05('0x2c')]['id']}})[_0x2f05('0x1b')](handleEntityNotFound(_0x30f267,null))[_0x2f05('0x1b')](saveUpdates(_0x448899[_0x2f05('0x39')],null))[_0x2f05('0x1b')](respondWithResult(_0x30f267,null))[_0x2f05('0x2a')](handleError(_0x30f267,null));};exports[_0x2f05('0x1c')]=function(_0x39a872,_0x5c8f67){return db[_0x2f05('0x37')][_0x2f05('0x35')]({'where':{'id':_0x39a872['params']['id']}})['then'](handleEntityNotFound(_0x5c8f67,null))[_0x2f05('0x1b')](removeEntity(_0x5c8f67,null))[_0x2f05('0x2a')](handleError(_0x5c8f67,null));};exports[_0x2f05('0x3a')]=function(_0x1818eb,_0x20dbe6){return db[_0x2f05('0x37')][_0x2f05('0x3a')]()[_0x2f05('0x1b')](respondWithResult(_0x20dbe6,null))[_0x2f05('0x2a')](handleError(_0x20dbe6,null));};exports['addMessage']=function(_0x527fc4,_0xc36cd){return db[_0x2f05('0x3b')][_0x2f05('0x35')]({'where':{'id':_0x527fc4[_0x2f05('0x2c')]['id']}})[_0x2f05('0x1b')](handleEntityNotFound(_0xc36cd,null))[_0x2f05('0x1b')](function(_0x3523a4){if(_0x3523a4){return _0x3523a4['addMessage'](_0x527fc4[_0x2f05('0x39')][_0x2f05('0x3c')],_[_0x2f05('0x3d')](_0x527fc4[_0x2f05('0x39')],[_0x2f05('0x3c'),'id'])||{});}})[_0x2f05('0x1b')](respondWithResult(_0xc36cd,null))[_0x2f05('0x2a')](handleError(_0xc36cd,null));};exports['getMessages']=function(_0x5b1501,_0x2c96b6){var _0x553318={'raw':![],'where':{}};var _0x4614f8={};var _0x2d8398={'count':0x0,'rows':[]};return db[_0x2f05('0x37')]['findOne']({'where':{'id':_0x5b1501['params']['id']}})['then'](handleEntityNotFound(_0x2c96b6,null))[_0x2f05('0x1b')](function(_0x47a762){if(_0x47a762){_0x4614f8[_0x2f05('0x2d')]=_['keys'](db[_0x2f05('0x3b')][_0x2f05('0x23')]);_0x4614f8['query']=_[_0x2f05('0x2e')](_0x5b1501[_0x2f05('0x28')]);_0x4614f8[_0x2f05('0x2f')]=_[_0x2f05('0x30')](_0x4614f8[_0x2f05('0x2d')],_0x4614f8['query']);_0x553318[_0x2f05('0x31')]=_[_0x2f05('0x30')](_0x4614f8['model'],qs[_0x2f05('0x3e')](_0x5b1501[_0x2f05('0x28')]['fields']));_0x553318['attributes']=_0x553318['attributes'][_0x2f05('0x32')]?_0x553318[_0x2f05('0x31')]:_0x4614f8['model'];if(!_0x5b1501[_0x2f05('0x28')][_0x2f05('0x3f')](_0x2f05('0x40'))){_0x553318[_0x2f05('0x17')]=qs[_0x2f05('0x17')](_0x5b1501[_0x2f05('0x28')][_0x2f05('0x17')]);_0x553318[_0x2f05('0x19')]=qs['offset'](_0x5b1501[_0x2f05('0x28')]['offset']);}_0x553318['order']=qs[_0x2f05('0x41')](_0x5b1501[_0x2f05('0x28')]['sort']);_0x553318[_0x2f05('0x42')]=qs[_0x2f05('0x2f')](_[_0x2f05('0x43')](_0x5b1501['query'],_0x4614f8['filters']));_0x553318[_0x2f05('0x42')]['FaxInteractionId']=_0x47a762['id'];if(_0x5b1501[_0x2f05('0x28')][_0x2f05('0x44')]){_0x553318[_0x2f05('0x42')]=_[_0x2f05('0x45')](_0x553318[_0x2f05('0x42')],{'$or':_['map'](_0x553318['attributes'],function(_0x19f088){var _0x7b04bf={};_0x7b04bf[_0x19f088]={'$like':'%'+_0x5b1501[_0x2f05('0x28')]['filter']+'%'};return _0x7b04bf;})});}if(_0x5b1501[_0x2f05('0x28')]['$gte']){var _0x45fdcb=_0x5b1501[_0x2f05('0x28')][_0x2f05('0x46')][_0x2f05('0x47')](',');var _0x30e1f6={};_0x30e1f6[_0x45fdcb[0x0]]={'$gte':moment(_0x45fdcb[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x553318[_0x2f05('0x42')]=_[_0x2f05('0x45')](_0x553318['where'],_0x30e1f6);}_0x553318=_[_0x2f05('0x45')]({},_0x553318,_0x5b1501[_0x2f05('0x48')]);return db[_0x2f05('0x3b')][_0x2f05('0x18')]({'where':_0x553318['where']})['then'](function(_0x2ecd10){_0x2d8398['count']=_0x2ecd10;if(_0x5b1501['query'][_0x2f05('0x33')]){_0x553318[_0x2f05('0x34')]=[{'all':!![]}];}return db[_0x2f05('0x3b')][_0x2f05('0x49')](_0x553318);})[_0x2f05('0x1b')](function(_0x2563e3){_0x2d8398['rows']=_0x2563e3;return _0x2d8398;});}})[_0x2f05('0x1b')](respondWithFilteredResult(_0x2c96b6,_0x553318))[_0x2f05('0x2a')](handleError(_0x2c96b6,null));};exports[_0x2f05('0x4a')]=function(_0x353892,_0x1988a7){return db[_0x2f05('0x37')][_0x2f05('0x35')]({'where':{'id':_0x353892[_0x2f05('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1988a7,null))[_0x2f05('0x1b')](function(_0x3d5973){if(_0x3d5973){return _0x3d5973[_0x2f05('0x4b')](_0x353892[_0x2f05('0x39')][_0x2f05('0x3c')],_['omit'](_0x353892[_0x2f05('0x39')],[_0x2f05('0x3c'),'id'])||{})[_0x2f05('0x4c')](function(){return db[_0x2f05('0x4d')]['findAll']({'attributes':['id',_0x2f05('0x1f'),_0x2f05('0x4e')],'where':{'id':_0x353892[_0x2f05('0x39')][_0x2f05('0x3c')]}});})[_0x2f05('0x1b')](function(_0x5e1125){socket[_0x2f05('0x4f')](_0x2f05('0x50'),{'id':Number(_0x353892[_0x2f05('0x2c')]['id']),'tags':_0x5e1125||[]});return{'id':Number(_0x353892[_0x2f05('0x2c')]['id']),'tags':_0x5e1125||[]};});}})[_0x2f05('0x1b')](respondWithResult(_0x1988a7,null))[_0x2f05('0x2a')](handleError(_0x1988a7,null));};exports[_0x2f05('0x51')]=function(_0x590be2,_0x54ef94){return db['FaxInteraction']['find']({'where':{'id':_0x590be2[_0x2f05('0x2c')]['id']}})['then'](handleEntityNotFound(_0x54ef94,null))['then'](function(_0x263476){if(_0x263476){return _0x263476[_0x2f05('0x51')](_0x590be2[_0x2f05('0x28')][_0x2f05('0x3c')]);}})[_0x2f05('0x1b')](respondWithStatusCode(_0x54ef94,null))['catch'](handleError(_0x54ef94,null));};exports[_0x2f05('0x52')]=function(_0xce570d,_0x4031f7){var _0x25fcf2=moment()[_0x2f05('0x53')]()['toString']();var _0x540789=path[_0x2f05('0x54')](config[_0x2f05('0x55')],'server','files','tmp');var _0x1faca1=path[_0x2f05('0x54')](config[_0x2f05('0x55')],'server',_0x2f05('0x56'),_0x2f05('0x57'));var _0x136922=path[_0x2f05('0x54')](_0x540789,_0x25fcf2);var _0xb34c60=util[_0x2f05('0x58')](_0x2f05('0x59'),_0xce570d[_0x2f05('0x2c')]['id'],_0x25fcf2);var _0xbe7f03=path[_0x2f05('0x54')](_0x540789,_0xb34c60);var _0x163277=[];_0x163277[_0x2f05('0x5a')]({'model':db[_0x2f05('0x5b')],'as':'Attachment','raw':!![]});var _0x57f325=[{'model':db[_0x2f05('0x3b')],'as':_0x2f05('0x5c'),'attributes':['id',_0x2f05('0x39'),'createdAt'],'include':_0x163277}];return db[_0x2f05('0x37')][_0x2f05('0x35')]({'where':{'id':_0xce570d[_0x2f05('0x2c')]['id']},'include':_0x57f325})['then'](handleEntityNotFound(_0x4031f7,null))[_0x2f05('0x1b')](function(_0x536504){if(_0x536504&&_0x536504['Messages']){var _0x2a3159=_0x536504[_0x2f05('0x5d')]({'plain':!![]});fs[_0x2f05('0x5e')](_0x136922);for(var _0x501d23=0x0;_0x501d23<_0x2a3159[_0x2f05('0x5c')]['length'];_0x501d23++){var _0x6fa59b=_0x2a3159[_0x2f05('0x5c')][_0x501d23][_0x2f05('0x5b')];if(_0x6fa59b){var _0x531b9a=path[_0x2f05('0x54')](_0x1faca1,_0x6fa59b['basename']);if(fs[_0x2f05('0x5f')](_0x531b9a)){fs[_0x2f05('0x60')](_0x531b9a)[_0x2f05('0x61')](fs[_0x2f05('0x62')](path['join'](_0x136922,_0x6fa59b[_0x2f05('0x63')])));}}}return BPromise[_0x2f05('0x64')]()['then'](function(){return new BPromise(function(_0x35700f,_0x4cd8c0){zipdir(_0x136922,{'saveTo':_0xbe7f03},function(_0x41aba6,_0xa28e6e){if(_0x41aba6)return _0x4cd8c0(_0x41aba6);return _0x35700f(_0xa28e6e);});})[_0x2f05('0x1b')](function(){return new BPromise(function(_0x4e1f4a,_0x40a5e0){rimraf(_0x136922,function(_0x5d83d4){if(_0x5d83d4)_0x40a5e0(_0x5d83d4);return _0x4e1f4a();});});})[_0x2f05('0x1b')](function(){return _0x4031f7['download'](_0xbe7f03,_0xb34c60,function(_0x36b0c1){if(_0x36b0c1){console[_0x2f05('0x65')](_0x2f05('0x66'),_0x36b0c1);}else{fs[_0x2f05('0x67')](_0xbe7f03);}});});});}else{return _0x4031f7['sendStatus'](0xc8);}})[_0x2f05('0x2a')](handleError(_0x4031f7,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 906a58d..215938e 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 _0xab8a=['setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','save','update','getUsers','then'];(function(_0x544125,_0x743ffa){var _0x193a8a=function(_0x5ecc7e){while(--_0x5ecc7e){_0x544125['push'](_0x544125['shift']());}};_0x193a8a(++_0x743ffa);}(_0xab8a,0x1bb));var _0xaab8=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xab8a[_0x525c7b];return _0x27b33e;};'use strict';var EventEmitter=require(_0xaab8('0x0'));var FaxInteraction=require(_0xaab8('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xaab8('0x1'))['db'][_0xaab8('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaab8('0x3'),'afterUpdate':_0xaab8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45d214){return function(_0xd8a2fa,_0x1d1acc,_0x2726de){_0xd8a2fa[_0xaab8('0x5')]({'attributes':['id'],'raw':!![]})[_0xaab8('0x6')](function(_0x346d9c){_0xd8a2fa[_0xaab8('0x7')](_0xaab8('0x8'),_0x346d9c['map'](function(_0x30b4c1){return{'id':_0x30b4c1['id']};}));return FaxMessage[_0xaab8('0x9')]({'where':{'FaxInteractionId':_0xd8a2fa['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaab8('0x6')](function(_0x52a326){_0xd8a2fa[_0xaab8('0x7')](_0xaab8('0xa'),_0x52a326[_0xaab8('0xb')]);FaxInteractionEvents[_0xaab8('0xc')](_0x45d214+':'+_0xd8a2fa['id'],_0xd8a2fa);FaxInteractionEvents[_0xaab8('0xc')](_0x45d214,_0xd8a2fa);_0x2726de(null);})['catch'](_0x2726de(null));};}for(var e in events){if(events[_0xaab8('0xd')](e)){var event=events[e];FaxInteraction[_0xaab8('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xec3f=['Users','map','findAll','then','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','save','remove','getUsers'];(function(_0x52fff9,_0x1c193c){var _0x31e8ea=function(_0x443b26){while(--_0x443b26){_0x52fff9['push'](_0x52fff9['shift']());}};_0x31e8ea(++_0x1c193c);}(_0xec3f,0x77));var _0xfec3=function(_0x34f2c9,_0x32d9bb){_0x34f2c9=_0x34f2c9-0x0;var _0x224a8c=_0xec3f[_0x34f2c9];return _0x224a8c;};'use strict';var EventEmitter=require(_0xfec3('0x0'));var FaxInteraction=require(_0xfec3('0x1'))['db'][_0xfec3('0x2')];var FaxMessage=require(_0xfec3('0x1'))['db'][_0xfec3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfec3('0x4'),'afterUpdate':'update','afterDestroy':_0xfec3('0x5')};function emitEvent(_0x5bb900){return function(_0x1492ea,_0x1ea332,_0x5c86f4){_0x1492ea[_0xfec3('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8586f5){_0x1492ea['setDataValue'](_0xfec3('0x7'),_0x8586f5[_0xfec3('0x8')](function(_0x71dedd){return{'id':_0x71dedd['id']};}));return FaxMessage[_0xfec3('0x9')]({'where':{'FaxInteractionId':_0x1492ea['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfec3('0xa')](function(_0x341f4e){_0x1492ea[_0xfec3('0xb')](_0xfec3('0xc'),_0x341f4e[_0xfec3('0xd')]);FaxInteractionEvents[_0xfec3('0xe')](_0x5bb900+':'+_0x1492ea['id'],_0x1492ea);FaxInteractionEvents[_0xfec3('0xe')](_0x5bb900,_0x1492ea);_0x5c86f4(null);})['catch'](_0x5c86f4(null));};}for(var e in events){if(events[_0xfec3('0xf')](e)){var event=events[e];FaxInteraction[_0xfec3('0x10')](e,emitEvent(event));}}module[_0xfec3('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 7f5e225..a4230ea 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 _0xfb21=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','fax_interactions','closed','closedAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb21,0xeb));var _0x1fb2=function(_0x3878b2,_0x18adcb){_0x3878b2=_0x3878b2-0x0;var _0xa3cf1c=_0xfb21[_0x3878b2];return _0xa3cf1c;};'use strict';var _=require(_0x1fb2('0x0'));var util=require(_0x1fb2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1fb2('0x2'));var BPromise=require(_0x1fb2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb2('0x4'));var rimraf=require(_0x1fb2('0x5'));var config=require(_0x1fb2('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x1fb2('0x7')]=function(_0x58a4c1,_0x5b090){return _0x58a4c1[_0x1fb2('0x8')]('FaxInteraction',attributes,{'tableName':_0x1fb2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b7adf,_0x1ef978,_0x1271bf){if(_0x2b7adf['changed'](_0x1fb2('0xa'))){_0x2b7adf[_0x1fb2('0xb')]=moment()['format'](_0x1fb2('0xc'));}_0x1271bf(null,_0x2b7adf);}}});}; \ No newline at end of file +var _0x04c6=['api','moment','bluebird','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','util','../../config/logger'];(function(_0x20353d,_0x3ffad0){var _0x3e1a9f=function(_0x31e469){while(--_0x31e469){_0x20353d['push'](_0x20353d['shift']());}};_0x3e1a9f(++_0x3ffad0);}(_0x04c6,0xc1));var _0x604c=function(_0x295c0e,_0x3677e6){_0x295c0e=_0x295c0e-0x0;var _0x34bdf1=_0x04c6[_0x295c0e];return _0x34bdf1;};'use strict';var _=require('lodash');var util=require(_0x604c('0x0'));var logger=require(_0x604c('0x1'))(_0x604c('0x2'));var moment=require(_0x604c('0x3'));var BPromise=require(_0x604c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x604c('0x5'));var config=require('../../config/environment');var attributes=require(_0x604c('0x6'));module[_0x604c('0x7')]=function(_0x1f7130,_0x2c345d){return _0x1f7130[_0x604c('0x8')](_0x604c('0x9'),attributes,{'tableName':_0x604c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c79a3,_0x3aa08a,_0x506992){if(_0x3c79a3[_0x604c('0xb')](_0x604c('0xc'))){_0x3c79a3[_0x604c('0xd')]=moment()[_0x604c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x506992(null,_0x3c79a3);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1aadfe5..9010ddd 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 _0x3441=['AddTagsToFaxInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','redis','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxInteraction','update','options','raw','info'];(function(_0x2b6d24,_0x3393b1){var _0x2f2224=function(_0xa28314){while(--_0xa28314){_0x2b6d24['push'](_0x2b6d24['shift']());}};_0x2f2224(++_0x3393b1);}(_0x3441,0x15d));var _0x1344=function(_0x18e815,_0x171312){_0x18e815=_0x18e815-0x0;var _0x3ae01b=_0x3441[_0x18e815];return _0x3ae01b;};'use strict';var _=require(_0x1344('0x0'));var util=require(_0x1344('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1344('0x2'));var fs=require('fs');var Redis=require(_0x1344('0x3'));var db=require(_0x1344('0x4'))['db'];var utils=require(_0x1344('0x5'));var logger=require(_0x1344('0x6'))(_0x1344('0x7'));var config=require(_0x1344('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1344('0x9')][_0x1344('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1344('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1344('0xc')]));require(_0x1344('0xd'))[_0x1344('0xe')](socket);function respondWithRpcPromise(_0x908046,_0x5b3141,_0x5398c3){return new BPromise(function(_0xb48bb,_0x1255f){return client[_0x1344('0xf')](_0x908046,_0x5398c3)[_0x1344('0x10')](function(_0x1f645f){logger['info'](_0x1344('0x11'),_0x5b3141,_0x1344('0x12'));logger[_0x1344('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5b3141,'request\x20sent',JSON[_0x1344('0x14')](_0x1f645f));if(_0x1f645f['error']){if(_0x1f645f[_0x1344('0x15')][_0x1344('0x16')]===0x1f4){logger[_0x1344('0x15')](_0x1344('0x11'),_0x5b3141,_0x1f645f['error'][_0x1344('0x17')]);return _0x1255f(_0x1f645f[_0x1344('0x15')][_0x1344('0x17')]);}logger[_0x1344('0x15')](_0x1344('0x11'),_0x5b3141,_0x1f645f[_0x1344('0x15')][_0x1344('0x17')]);return _0xb48bb(_0x1f645f[_0x1344('0x15')][_0x1344('0x17')]);}else{logger['info'](_0x1344('0x11'),_0x5b3141,_0x1344('0x12'));_0xb48bb(_0x1f645f[_0x1344('0x18')]['message']);}})[_0x1344('0x19')](function(_0x1d33b7){logger[_0x1344('0x15')](_0x1344('0x11'),_0x5b3141,_0x1d33b7);_0x1255f(_0x1d33b7);});});}exports[_0x1344('0x1a')]=function(_0x3e818a){var _0x5e1521=this;return new Promise(function(_0x473dd3,_0x589a2e){return db['FaxInteraction'][_0x1344('0x1b')](_0x3e818a['body'],{'raw':_0x3e818a[_0x1344('0x1c')]?_0x3e818a[_0x1344('0x1c')][_0x1344('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e818a[_0x1344('0x1c')]?_0x3e818a[_0x1344('0x1c')]['where']||null:null,'attributes':_0x3e818a['options']?_0x3e818a[_0x1344('0x1c')]['attributes']||null:null,'limit':_0x3e818a[_0x1344('0x1c')]?_0x3e818a[_0x1344('0x1c')]['limit']||null:null})[_0x1344('0x10')](function(_0xe7618e){logger[_0x1344('0x1e')]('UpdateFaxInteraction',_0x3e818a);logger[_0x1344('0x13')](_0x1344('0x1a'),_0x3e818a,JSON[_0x1344('0x14')](_0xe7618e));_0x473dd3(_0xe7618e);})[_0x1344('0x19')](function(_0x1ac705){logger[_0x1344('0x15')](_0x1344('0x1a'),_0x1ac705[_0x1344('0x17')],_0x3e818a);_0x589a2e(_0x5e1521['error'](0x1f4,_0x1ac705['message']));});});};exports[_0x1344('0x1f')]=function(_0x24f5d0){return new Promise(function(_0x5bdaa2,_0x598857){return db['FaxInteraction'][_0x1344('0x20')]({'where':_0x24f5d0['options']?_0x24f5d0['options']['where']||null:null})[_0x1344('0x10')](function(_0x3da5d6){if(_0x3da5d6){return _0x3da5d6[_0x1344('0x21')](_0x24f5d0[_0x1344('0x22')][_0x1344('0x23')],_['omit'](_0x24f5d0[_0x1344('0x22')],[_0x1344('0x23'),'id'])||{});}})[_0x1344('0x24')](function(_0x312334){logger[_0x1344('0x1e')](_0x1344('0x25'),_0x24f5d0);logger[_0x1344('0x13')](_0x1344('0x25'),_0x24f5d0,JSON[_0x1344('0x14')](_0x312334));_0x5bdaa2(_0x312334);})[_0x1344('0x19')](function(_0x4f3734){logger['error'](_0x1344('0x25'),_0x4f3734[_0x1344('0x17')],_0x24f5d0);_0x598857(_this[_0x1344('0x15')](0x1f4,_0x4f3734[_0x1344('0x17')]));});});}; \ No newline at end of file +var _0x6ace=['AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','then','addTags','ids','omit','spread'];(function(_0x559278,_0x552116){var _0x232b5a=function(_0x3a5dfe){while(--_0x3a5dfe){_0x559278['push'](_0x559278['shift']());}};_0x232b5a(++_0x552116);}(_0x6ace,0x161));var _0xe6ac=function(_0x1b2531,_0x447a58){_0x1b2531=_0x1b2531-0x0;var _0x12c2b8=_0x6ace[_0x1b2531];return _0x12c2b8;};'use strict';var _=require(_0xe6ac('0x0'));var util=require(_0xe6ac('0x1'));var moment=require(_0xe6ac('0x2'));var BPromise=require('bluebird');var rs=require(_0xe6ac('0x3'));var fs=require('fs');var Redis=require(_0xe6ac('0x4'));var db=require(_0xe6ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6ac('0x6'))(_0xe6ac('0x7'));var config=require(_0xe6ac('0x8'));var jayson=require(_0xe6ac('0x9'));var client=jayson[_0xe6ac('0xa')]['http']({'port':0x232a});config[_0xe6ac('0xb')]=_[_0xe6ac('0xc')](config[_0xe6ac('0xb')],{'host':_0xe6ac('0xd'),'port':0x18eb});var socket=require(_0xe6ac('0xe'))(new Redis(config[_0xe6ac('0xb')]));require(_0xe6ac('0xf'))[_0xe6ac('0x10')](socket);function respondWithRpcPromise(_0x53f11f,_0x22bfa1,_0x41f0bb){return new BPromise(function(_0x57b100,_0x2fc462){return client[_0xe6ac('0x11')](_0x53f11f,_0x41f0bb)['then'](function(_0x52a008){logger[_0xe6ac('0x12')](_0xe6ac('0x13'),_0x22bfa1,'request\x20sent');logger[_0xe6ac('0x14')](_0xe6ac('0x15'),_0x22bfa1,_0xe6ac('0x16'),JSON[_0xe6ac('0x17')](_0x52a008));if(_0x52a008[_0xe6ac('0x18')]){if(_0x52a008[_0xe6ac('0x18')][_0xe6ac('0x19')]===0x1f4){logger[_0xe6ac('0x18')](_0xe6ac('0x13'),_0x22bfa1,_0x52a008[_0xe6ac('0x18')]['message']);return _0x2fc462(_0x52a008[_0xe6ac('0x18')][_0xe6ac('0x1a')]);}logger[_0xe6ac('0x18')](_0xe6ac('0x13'),_0x22bfa1,_0x52a008[_0xe6ac('0x18')][_0xe6ac('0x1a')]);return _0x57b100(_0x52a008[_0xe6ac('0x18')]['message']);}else{logger[_0xe6ac('0x12')](_0xe6ac('0x13'),_0x22bfa1,_0xe6ac('0x16'));_0x57b100(_0x52a008[_0xe6ac('0x1b')][_0xe6ac('0x1a')]);}})[_0xe6ac('0x1c')](function(_0x4eb1e0){logger['error'](_0xe6ac('0x13'),_0x22bfa1,_0x4eb1e0);_0x2fc462(_0x4eb1e0);});});}exports[_0xe6ac('0x1d')]=function(_0x39a3a0){var _0x7a6da0=this;return new Promise(function(_0x1fa98f,_0x5d814c){return db[_0xe6ac('0x1e')][_0xe6ac('0x1f')](_0x39a3a0[_0xe6ac('0x20')],{'raw':_0x39a3a0['options']?_0x39a3a0[_0xe6ac('0x21')][_0xe6ac('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39a3a0[_0xe6ac('0x21')]?_0x39a3a0['options'][_0xe6ac('0x23')]||null:null,'attributes':_0x39a3a0['options']?_0x39a3a0[_0xe6ac('0x21')][_0xe6ac('0x24')]||null:null,'limit':_0x39a3a0[_0xe6ac('0x21')]?_0x39a3a0['options'][_0xe6ac('0x25')]||null:null})[_0xe6ac('0x26')](function(_0x1dc20d){logger[_0xe6ac('0x12')](_0xe6ac('0x1d'),_0x39a3a0);logger[_0xe6ac('0x14')](_0xe6ac('0x1d'),_0x39a3a0,JSON['stringify'](_0x1dc20d));_0x1fa98f(_0x1dc20d);})[_0xe6ac('0x1c')](function(_0x26fb5d){logger[_0xe6ac('0x18')](_0xe6ac('0x1d'),_0x26fb5d[_0xe6ac('0x1a')],_0x39a3a0);_0x5d814c(_0x7a6da0[_0xe6ac('0x18')](0x1f4,_0x26fb5d[_0xe6ac('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x353ce8){return new Promise(function(_0x307497,_0x3b5a22){return db[_0xe6ac('0x1e')]['find']({'where':_0x353ce8[_0xe6ac('0x21')]?_0x353ce8['options'][_0xe6ac('0x23')]||null:null})[_0xe6ac('0x26')](function(_0x56df01){if(_0x56df01){return _0x56df01[_0xe6ac('0x27')](_0x353ce8[_0xe6ac('0x20')][_0xe6ac('0x28')],_[_0xe6ac('0x29')](_0x353ce8[_0xe6ac('0x20')],[_0xe6ac('0x28'),'id'])||{});}})[_0xe6ac('0x2a')](function(_0xe38d96){logger[_0xe6ac('0x12')](_0xe6ac('0x2b'),_0x353ce8);logger['debug']('AddTags',_0x353ce8,JSON[_0xe6ac('0x17')](_0xe38d96));_0x307497(_0xe38d96);})['catch'](function(_0x5a37de){logger[_0xe6ac('0x18')](_0xe6ac('0x2b'),_0x5a37de['message'],_0x353ce8);_0x3b5a22(_this[_0xe6ac('0x18')](0x1f4,_0x5a37de[_0xe6ac('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 30e3fd8..0ee3ce7 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 _0x4211=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x4211,0x165));var _0x1421=function(_0x33676b,_0x442eae){_0x33676b=_0x33676b-0x0;var _0x51a25e=_0x4211[_0x33676b];return _0x51a25e;};'use strict';var FaxInteractionEvents=require(_0x1421('0x0'));var events=[_0x1421('0x1'),_0x1421('0x2'),'update'];function createListener(_0x34eb19,_0x148e8a){return function(_0x35c6b2){_0x148e8a['emit'](_0x34eb19,_0x35c6b2);};}function removeListener(_0x25429d,_0x19753d){return function(){FaxInteractionEvents[_0x1421('0x3')](_0x25429d,_0x19753d);};}exports[_0x1421('0x4')]=function(_0x447cd1){for(var _0x3fa4b0=0x0,_0x4dfd62=events['length'];_0x3fa4b0<_0x4dfd62;_0x3fa4b0++){var _0xaac547=events[_0x3fa4b0];var _0x19e24a=createListener(_0x1421('0x5')+_0xaac547,_0x447cd1);FaxInteractionEvents['on'](_0xaac547,_0x19e24a);}}; \ No newline at end of file +var _0x639b=['save','remove','update','emit','register','length'];(function(_0x2492f1,_0x333675){var _0x2edecf=function(_0x355ce6){while(--_0x355ce6){_0x2492f1['push'](_0x2492f1['shift']());}};_0x2edecf(++_0x333675);}(_0x639b,0x1ce));var _0xb639=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x639b[_0x321bb2];return _0x9c12ed;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xb639('0x0'),_0xb639('0x1'),_0xb639('0x2')];function createListener(_0x158934,_0x4bda04){return function(_0x2b06ea){_0x4bda04[_0xb639('0x3')](_0x158934,_0x2b06ea);};}function removeListener(_0x295b15,_0x58311e){return function(){FaxInteractionEvents['removeListener'](_0x295b15,_0x58311e);};}exports[_0xb639('0x4')]=function(_0x1d548a){for(var _0xee12bd=0x0,_0x2061dc=events[_0xb639('0x5')];_0xee12bd<_0x2061dc;_0xee12bd++){var _0x11c828=events[_0xee12bd];var _0x33310d=createListener('faxInteraction:'+_0x11c828,_0x1d548a);FaxInteractionEvents['on'](_0x11c828,_0x33310d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index dc22745..aadb995 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 _0xd344=['download','create','post','/:id/tags','tracked','fax','addTags','put','/:id','faxinteraction:update','update','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download'];(function(_0x4068a3,_0x1c2cd3){var _0xcdea1=function(_0x1eabe1){while(--_0x1eabe1){_0x4068a3['push'](_0x4068a3['shift']());}};_0xcdea1(++_0x1c2cd3);}(_0xd344,0x104));var _0x4d34=function(_0x26cd09,_0x4eef34){_0x26cd09=_0x26cd09-0x0;var _0x1754f0=_0xd344[_0x26cd09];return _0x1754f0;};'use strict';var multer=require(_0x4d34('0x0'));var util=require(_0x4d34('0x1'));var path=require(_0x4d34('0x2'));var timeout=require(_0x4d34('0x3'));var express=require(_0x4d34('0x4'));var router=express[_0x4d34('0x5')]();var fs_extra=require(_0x4d34('0x6'));var auth=require(_0x4d34('0x7'));var interaction=require(_0x4d34('0x8'));var config=require(_0x4d34('0x9'));var controller=require(_0x4d34('0xa'));router[_0x4d34('0xb')]('/',auth[_0x4d34('0xc')](),controller[_0x4d34('0xd')]);router[_0x4d34('0xb')](_0x4d34('0xe'),auth['isAuthenticated'](),controller[_0x4d34('0xf')]);router[_0x4d34('0xb')]('/:id',auth[_0x4d34('0xc')](),controller[_0x4d34('0x10')]);router[_0x4d34('0xb')](_0x4d34('0x11'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x12')]);router[_0x4d34('0xb')](_0x4d34('0x13'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x14')]);router['post']('/',auth[_0x4d34('0xc')](),controller[_0x4d34('0x15')]);router[_0x4d34('0x16')](_0x4d34('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4d34('0x16')](_0x4d34('0x17'),auth['isAuthenticated'](),interaction[_0x4d34('0x18')](_0x4d34('0x19'),'faxinteraction:addtags'),controller[_0x4d34('0x1a')]);router[_0x4d34('0x1b')](_0x4d34('0x1c'),auth[_0x4d34('0xc')](),interaction['tracked'](_0x4d34('0x19'),_0x4d34('0x1d')),controller[_0x4d34('0x1e')]);router['delete'](_0x4d34('0x1c'),auth['isAuthenticated'](),interaction['tracked'](_0x4d34('0x19'),_0x4d34('0x1f')),controller[_0x4d34('0x20')]);router['delete'](_0x4d34('0x17'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x21')]);module[_0x4d34('0x22')]=router; \ No newline at end of file +var _0x8d05=['Router','fs-extra','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','/:id/tags','exports','multer','util','path','connect-timeout','express'];(function(_0x428202,_0x40a85d){var _0x5ae0e5=function(_0xc403b1){while(--_0xc403b1){_0x428202['push'](_0x428202['shift']());}};_0x5ae0e5(++_0x40a85d);}(_0x8d05,0x1ad));var _0x58d0=function(_0x2ac165,_0x56661f){_0x2ac165=_0x2ac165-0x0;var _0x16156d=_0x8d05[_0x2ac165];return _0x16156d;};'use strict';var multer=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var path=require(_0x58d0('0x2'));var timeout=require(_0x58d0('0x3'));var express=require(_0x58d0('0x4'));var router=express[_0x58d0('0x5')]();var fs_extra=require(_0x58d0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x58d0('0x7'));var config=require('../../config/environment');var controller=require(_0x58d0('0x8'));router[_0x58d0('0x9')]('/',auth[_0x58d0('0xa')](),controller['index']);router[_0x58d0('0x9')](_0x58d0('0xb'),auth[_0x58d0('0xa')](),controller[_0x58d0('0xc')]);router[_0x58d0('0x9')](_0x58d0('0xd'),auth['isAuthenticated'](),controller[_0x58d0('0xe')]);router[_0x58d0('0x9')]('/:id/messages',auth[_0x58d0('0xa')](),controller['getMessages']);router[_0x58d0('0x9')](_0x58d0('0xf'),auth['isAuthenticated'](),controller[_0x58d0('0x10')]);router[_0x58d0('0x11')]('/',auth[_0x58d0('0xa')](),controller[_0x58d0('0x12')]);router[_0x58d0('0x11')](_0x58d0('0x13'),auth['isAuthenticated'](),controller[_0x58d0('0x14')]);router[_0x58d0('0x11')]('/:id/tags',auth[_0x58d0('0xa')](),interaction[_0x58d0('0x15')](_0x58d0('0x16'),_0x58d0('0x17')),controller[_0x58d0('0x18')]);router[_0x58d0('0x19')](_0x58d0('0xd'),auth[_0x58d0('0xa')](),interaction[_0x58d0('0x15')]('fax',_0x58d0('0x1a')),controller[_0x58d0('0x1b')]);router[_0x58d0('0x1c')](_0x58d0('0xd'),auth[_0x58d0('0xa')](),interaction['tracked']('fax','faxinteraction:destroy'),controller['destroy']);router[_0x58d0('0x1c')](_0x58d0('0x1d'),auth[_0x58d0('0xa')](),controller['removeTags']);module[_0x58d0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 12c76ff..9aaace2 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 _0x8388=['TEXT','medium','ENUM','out','DATE','sequelize','exports'];(function(_0x29a730,_0xa04b4d){var _0x40d450=function(_0x4feb79){while(--_0x4feb79){_0x29a730['push'](_0x29a730['shift']());}};_0x40d450(++_0xa04b4d);}(_0x8388,0x18d));var _0x8838=function(_0x44474f,_0x431580){_0x44474f=_0x44474f-0x0;var _0x427d97=_0x8388[_0x44474f];return _0x427d97;};'use strict';var Sequelize=require(_0x8838('0x0'));module[_0x8838('0x1')]={'body':{'type':Sequelize[_0x8838('0x2')](_0x8838('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8838('0x4')]('in',_0x8838('0x5')),'defaultValue':_0x8838('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8838('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8838('0x6')]}}; \ No newline at end of file +var _0x0e35=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1ef614,_0xddd8ea){var _0x3fc2c4=function(_0x493438){while(--_0x493438){_0x1ef614['push'](_0x1ef614['shift']());}};_0x3fc2c4(++_0xddd8ea);}(_0x0e35,0xc2));var _0x50e3=function(_0x23052b,_0x2a2f09){_0x23052b=_0x23052b-0x0;var _0x2a31da=_0x0e35[_0x23052b];return _0x2a31da;};'use strict';var Sequelize=require(_0x50e3('0x0'));module[_0x50e3('0x1')]={'body':{'type':Sequelize[_0x50e3('0x2')](_0x50e3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x50e3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x50e3('0x5')]('in',_0x50e3('0x6')),'defaultValue':_0x50e3('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x50e3('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x50e3('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 610bb06..2ffa5b0 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 _0x5ba8=['AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','sequelize','contact','interface','EventManager','rejectmessage','create','CmContact','findOne','Attachment','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','server','files','attachments','join','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','rows','show','params','keys','intersection','find','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null'];(function(_0x132311,_0x361a66){var _0x18bfa0=function(_0x534265){while(--_0x534265){_0x132311['push'](_0x132311['shift']());}};_0x18bfa0(++_0x361a66);}(_0x5ba8,0x146));var _0x85ba=function(_0x9a6e6a,_0x4855c0){_0x9a6e6a=_0x9a6e6a-0x0;var _0x3a22ef=_0x5ba8[_0x9a6e6a];return _0x3a22ef;};'use strict';var emlformat=require(_0x85ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x85ba('0x1'));var rp=require(_0x85ba('0x2'));var moment=require(_0x85ba('0x3'));var BPromise=require(_0x85ba('0x4'));var Mustache=require(_0x85ba('0x5'));var util=require('util');var path=require(_0x85ba('0x6'));var sox=require(_0x85ba('0x7'));var csv=require(_0x85ba('0x8'));var ejs=require(_0x85ba('0x9'));var fs=require('fs');var fs_extra=require(_0x85ba('0xa'));var _=require('lodash');var squel=require(_0x85ba('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x85ba('0xc'));var toCsv=require(_0x85ba('0x8'));var querystring=require('querystring');var Papa=require(_0x85ba('0xd'));var Redis=require('ioredis');var authService=require(_0x85ba('0xe'));var qs=require(_0x85ba('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85ba('0x10'));var logger=require(_0x85ba('0x11'))(_0x85ba('0x12'));var utils=require(_0x85ba('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x85ba('0x14')]=_[_0x85ba('0x15')](config[_0x85ba('0x14')],{'host':_0x85ba('0x16'),'port':0x18eb});var socket=require(_0x85ba('0x17'))(new Redis(config[_0x85ba('0x14')]));require(_0x85ba('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x85ba('0x19')]['http']({'port':0x232c});var client9002=jayson['client'][_0x85ba('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x30442,_0x1f5dee,_0x40097f,_0x40ddce){return new BPromise(function(_0x143cf9,_0x5b2e9e){var _0x1626dc=_0x40ddce||client;return _0x1626dc[_0x85ba('0x1b')](_0x30442,_0x40097f)[_0x85ba('0x1c')](function(_0x1b6c22){logger['info'](_0x85ba('0x1d'),_0x1f5dee,_0x85ba('0x1e'));logger[_0x85ba('0x1f')](_0x85ba('0x20'),_0x1f5dee,_0x85ba('0x1e'),JSON[_0x85ba('0x21')](_0x1b6c22));if(_0x1b6c22[_0x85ba('0x22')]){if(_0x1b6c22[_0x85ba('0x22')][_0x85ba('0x23')]===0x1f4){logger[_0x85ba('0x22')](_0x85ba('0x1d'),_0x1f5dee,_0x1b6c22[_0x85ba('0x22')][_0x85ba('0x24')]);return _0x5b2e9e(_0x1b6c22[_0x85ba('0x22')][_0x85ba('0x24')]);}logger[_0x85ba('0x22')]('FaxMessage,\x20%s,\x20%s',_0x1f5dee,_0x1b6c22['error'][_0x85ba('0x24')]);return _0x143cf9(_0x1b6c22[_0x85ba('0x22')]['message']);}else{logger[_0x85ba('0x25')](_0x85ba('0x1d'),_0x1f5dee,_0x85ba('0x1e'));_0x143cf9(_0x1b6c22[_0x85ba('0x26')][_0x85ba('0x24')]);}})[_0x85ba('0x27')](function(_0x3bd7b0){logger[_0x85ba('0x22')](_0x85ba('0x1d'),_0x1f5dee,_0x3bd7b0);_0x5b2e9e(_0x3bd7b0);});});}function respondWithStatusCode(_0x2aeb74,_0x5dc94b){_0x5dc94b=_0x5dc94b||0xcc;return function(_0x450d20){if(_0x450d20){return _0x2aeb74['sendStatus'](_0x5dc94b);}return _0x2aeb74[_0x85ba('0x28')](_0x5dc94b)[_0x85ba('0x29')]();};}function respondWithResult(_0x2d7940,_0x3469ea){_0x3469ea=_0x3469ea||0xc8;return function(_0x3c8572){if(_0x3c8572){return _0x2d7940['status'](_0x3469ea)[_0x85ba('0x2a')](_0x3c8572);}};}function respondWithFilteredResult(_0x5d3fd7,_0x3ea5f4){return function(_0x909668){if(_0x909668){var _0x50b7da=typeof _0x3ea5f4[_0x85ba('0x2b')]===_0x85ba('0x2c')&&typeof _0x3ea5f4[_0x85ba('0x2d')]===_0x85ba('0x2c');var _0x3fcfc7=_0x909668[_0x85ba('0x2e')];var _0xca8219=_0x50b7da?0x0:_0x3ea5f4['offset'];var _0x19208e=_0x50b7da?_0x909668[_0x85ba('0x2e')]:_0x3ea5f4[_0x85ba('0x2b')]+_0x3ea5f4['limit'];var _0x1734d7;if(_0x19208e>=_0x3fcfc7){_0x19208e=_0x3fcfc7;_0x1734d7=0xc8;}else{_0x1734d7=0xce;}_0x5d3fd7[_0x85ba('0x28')](_0x1734d7);return _0x5d3fd7[_0x85ba('0x2f')](_0x85ba('0x30'),_0xca8219+'-'+_0x19208e+'/'+_0x3fcfc7)['json'](_0x909668);}return null;};}function patchUpdates(_0x13f2a2){return function(_0x57f94d){try{jsonpatch[_0x85ba('0x31')](_0x57f94d,_0x13f2a2,!![]);}catch(_0x1ace54){return BPromise[_0x85ba('0x32')](_0x1ace54);}return _0x57f94d[_0x85ba('0x33')]();};}function saveUpdates(_0x5dd803,_0x4afd6b){return function(_0x272734){if(_0x272734){return _0x272734[_0x85ba('0x34')](_0x5dd803)[_0x85ba('0x1c')](function(_0x380969){return _0x380969;});}return null;};}function removeEntity(_0x2e3e8e,_0x624189){return function(_0xa8199a){if(_0xa8199a){return _0xa8199a[_0x85ba('0x35')]()[_0x85ba('0x1c')](function(){_0x2e3e8e[_0x85ba('0x28')](0xcc)[_0x85ba('0x29')]();});}};}function handleEntityNotFound(_0x5d9891,_0x22a413){return function(_0x45606e){if(!_0x45606e){_0x5d9891[_0x85ba('0x36')](0x194);}return _0x45606e;};}function handleError(_0x122e39,_0x44af8b){_0x44af8b=_0x44af8b||0x1f4;return function(_0x2c4acf){logger[_0x85ba('0x22')](_0x2c4acf[_0x85ba('0x37')]);if(_0x2c4acf[_0x85ba('0x38')]){delete _0x2c4acf[_0x85ba('0x38')];}_0x122e39[_0x85ba('0x28')](_0x44af8b)[_0x85ba('0x39')](_0x2c4acf);};}exports[_0x85ba('0x3a')]=function(_0x4950fd,_0x13590f){var _0x5c9c3f={},_0x455335={},_0x2dd875={'count':0x0,'rows':[]};var _0x4288b8=_[_0x85ba('0x3b')](db['FaxMessage'][_0x85ba('0x3c')],function(_0x2a50c5){return{'name':_0x2a50c5[_0x85ba('0x3d')],'type':_0x2a50c5[_0x85ba('0x3e')]['key']};});_0x455335['model']=_['map'](_0x4288b8,_0x85ba('0x38'));_0x455335[_0x85ba('0x3f')]=_['keys'](_0x4950fd[_0x85ba('0x3f')]);_0x455335[_0x85ba('0x40')]=_['intersection'](_0x455335[_0x85ba('0x41')],_0x455335['query']);_0x5c9c3f[_0x85ba('0x42')]=_['intersection'](_0x455335[_0x85ba('0x41')],qs[_0x85ba('0x43')](_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x43')]));_0x5c9c3f[_0x85ba('0x42')]=_0x5c9c3f['attributes'][_0x85ba('0x44')]?_0x5c9c3f['attributes']:_0x455335[_0x85ba('0x41')];if(!_0x4950fd['query'][_0x85ba('0x45')]('nolimit')){_0x5c9c3f['limit']=qs[_0x85ba('0x2d')](_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x2d')]);_0x5c9c3f[_0x85ba('0x2b')]=qs[_0x85ba('0x2b')](_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x2b')]);}_0x5c9c3f[_0x85ba('0x46')]=qs['sort'](_0x4950fd[_0x85ba('0x3f')]['sort']);_0x5c9c3f[_0x85ba('0x47')]=qs[_0x85ba('0x40')](_[_0x85ba('0x48')](_0x4950fd[_0x85ba('0x3f')],_0x455335[_0x85ba('0x40')]),_0x4288b8);if(_0x4950fd['query'][_0x85ba('0x49')]){_0x5c9c3f[_0x85ba('0x47')]=_[_0x85ba('0x4a')](_0x5c9c3f[_0x85ba('0x47')],{'$or':_[_0x85ba('0x3b')](_0x4288b8,function(_0x574c16){if(_0x574c16['type']!==_0x85ba('0x4b')){var _0x40c4b4={};_0x40c4b4[_0x574c16[_0x85ba('0x38')]]={'$like':'%'+_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x49')]+'%'};return _0x40c4b4;}})});}_0x5c9c3f=_[_0x85ba('0x4a')]({},_0x5c9c3f,_0x4950fd[_0x85ba('0x4c')]);var _0x55361c={'where':_0x5c9c3f['where']};return db[_0x85ba('0x4d')][_0x85ba('0x2e')](_0x55361c)['then'](function(_0x216686){_0x2dd875[_0x85ba('0x2e')]=_0x216686;if(_0x4950fd['query'][_0x85ba('0x4e')]){_0x5c9c3f[_0x85ba('0x4f')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x5c9c3f);})[_0x85ba('0x1c')](function(_0x3f3397){_0x2dd875[_0x85ba('0x50')]=_0x3f3397;return _0x2dd875;})[_0x85ba('0x1c')](respondWithFilteredResult(_0x13590f,_0x5c9c3f))[_0x85ba('0x27')](handleError(_0x13590f,null));};exports[_0x85ba('0x51')]=function(_0x10e4dd,_0x4643e7){var _0x158bbf={'raw':!![],'where':{'id':_0x10e4dd[_0x85ba('0x52')]['id']}},_0x198f46={};_0x198f46[_0x85ba('0x41')]=_[_0x85ba('0x53')](db[_0x85ba('0x4d')]['rawAttributes']);_0x198f46[_0x85ba('0x3f')]=_[_0x85ba('0x53')](_0x10e4dd[_0x85ba('0x3f')]);_0x198f46[_0x85ba('0x40')]=_['intersection'](_0x198f46[_0x85ba('0x41')],_0x198f46[_0x85ba('0x3f')]);_0x158bbf['attributes']=_[_0x85ba('0x54')](_0x198f46[_0x85ba('0x41')],qs[_0x85ba('0x43')](_0x10e4dd['query'][_0x85ba('0x43')]));_0x158bbf[_0x85ba('0x42')]=_0x158bbf[_0x85ba('0x42')]['length']?_0x158bbf[_0x85ba('0x42')]:_0x198f46['model'];if(_0x10e4dd['query'][_0x85ba('0x4e')]){_0x158bbf[_0x85ba('0x4f')]=[{'all':!![]}];}_0x158bbf=_[_0x85ba('0x4a')]({},_0x158bbf,_0x10e4dd['options']);return db['FaxMessage'][_0x85ba('0x55')](_0x158bbf)[_0x85ba('0x1c')](handleEntityNotFound(_0x4643e7,null))[_0x85ba('0x1c')](respondWithResult(_0x4643e7,null))['catch'](handleError(_0x4643e7,null));};exports[_0x85ba('0x34')]=function(_0x5a6fdb,_0x5779cc){if(_0x5a6fdb['body']['id']){delete _0x5a6fdb[_0x85ba('0x56')]['id'];}return db[_0x85ba('0x4d')]['find']({'where':{'id':_0x5a6fdb['params']['id']}})[_0x85ba('0x1c')](handleEntityNotFound(_0x5779cc,null))['then'](saveUpdates(_0x5a6fdb['body'],null))[_0x85ba('0x1c')](respondWithResult(_0x5779cc,null))[_0x85ba('0x27')](handleError(_0x5779cc,null));};exports[_0x85ba('0x35')]=function(_0x144258,_0x2b6393){return db[_0x85ba('0x4d')]['find']({'where':{'id':_0x144258[_0x85ba('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b6393,null))[_0x85ba('0x1c')](removeEntity(_0x2b6393,null))[_0x85ba('0x27')](handleError(_0x2b6393,null));};exports[_0x85ba('0x57')]=function(_0x5530b4,_0x123177){return db[_0x85ba('0x4d')]['describe']()[_0x85ba('0x1c')](respondWithResult(_0x123177,null))['catch'](handleError(_0x123177,null));};var interaction_log=require(_0x85ba('0x11'))(_0x85ba('0x58'));exports[_0x85ba('0x59')]=function(_0x3bd105,_0xd6dac8,_0x49fdbb){var _0x4c49fb={'agent':{},'channel':_0x85ba('0x5a')};if(_0x3bd105[_0x85ba('0x56')]['id']){delete _0x3bd105[_0x85ba('0x56')]['id'];}_0x3bd105[_0x85ba('0x56')]['read']=!![];_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5b')]=moment()[_0x85ba('0x5c')](_0x85ba('0x5d'));_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')]=_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')]||_0x3bd105[_0x85ba('0x5f')]['id'];_0x4c49fb[_0x85ba('0x60')]['id']=_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')];return db['FaxMessage'][_0x85ba('0x55')]({'where':{'id':_0x3bd105[_0x85ba('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xd6dac8,null))[_0x85ba('0x1c')](saveUpdates(_0x3bd105[_0x85ba('0x56')],null))[_0x85ba('0x1c')](function(_0x5d514a){if(_0x5d514a){_0x4c49fb[_0x85ba('0x24')]=_0x5d514a[_0x85ba('0x61')]({'plain':!![]});return db[_0x85ba('0x62')][_0x85ba('0x55')]({'where':{'id':_0x5d514a['FaxInteractionId']}});}return null;})[_0x85ba('0x1c')](handleEntityNotFound(_0xd6dac8,null))[_0x85ba('0x1c')](function(_0x40ddd3){if(_0x40ddd3){return _0x40ddd3['update']({'UserId':_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')],'read1stAt':_['isNil'](_0x40ddd3[_0x85ba('0x63')])?moment()[_0x85ba('0x5c')](_0x85ba('0x5d')):undefined});}return null;})[_0x85ba('0x1c')](function(_0x182bd2){if(_0x182bd2){_0x4c49fb[_0x85ba('0x64')]=_0x182bd2['get']({'plain':!![]});interaction_log[_0x85ba('0x25')](_0x85ba('0x65'),_0x3bd105[_0x85ba('0x5f')]['id'],_0x3bd105['user']['name'],_0x3bd105[_0x85ba('0x5f')]['role'],_0x4c49fb[_0x85ba('0x64')]['id'],_0x3bd105['body']?JSON[_0x85ba('0x21')](_0x3bd105[_0x85ba('0x56')]):_0x85ba('0x66'));return respondWithRpcPromise(_0x85ba('0x67'),_0x85ba('0x68'),_0x4c49fb);}return null;})[_0x85ba('0x1c')](function(_0x556985){var _0x51982b=_0x85ba('0x69')+_0x556985[_0x85ba('0x24')]['ContactId'];return db['sequelize']['query'](_0x51982b,{'type':db[_0x85ba('0x6a')][_0x85ba('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x33e5ce){return _0x33e5ce;});})[_0x85ba('0x1c')](function(_0x42462a){if(_0x42462a){_0x4c49fb[_0x85ba('0x24')]['contact']=_0x42462a[0x0];if(!_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')])return;return db[_0x85ba('0x6c')]['find']({'where':{'id':_0x3bd105['body']['UserId'],'role':_0x85ba('0x60')},'attributes':['id','name',_0x85ba('0x6d'),_0x85ba('0x6e'),_0x85ba('0x6f')],'raw':!![]});}return null;})['then'](function(_0x2a103a){if(!_0x2a103a)return null;_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x60')]=_0x2a103a;return _0x4c49fb;})[_0x85ba('0x1c')](function(_0x5bbeeb){if(_0x5bbeeb){if(_0x3bd105[_0x85ba('0x56')]['manual']){_0x4c49fb[_0x85ba('0x24')]['interface']=util[_0x85ba('0x5c')](_0x85ba('0x70'),_0x3bd105[_0x85ba('0x5f')][_0x85ba('0x38')]);_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x71')]=_0x4c49fb['channel'];_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x72')]=_0x4c49fb[_0x85ba('0x71')];_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x73')]=_0x85ba('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x85ba('0x74'),'message':_0x4c49fb[_0x85ba('0x24')]},client9002)['then'](function(){return _0x4c49fb;});}return _0x4c49fb;}return null;})['then'](respondWithResult(_0xd6dac8,null))[_0x85ba('0x27')](handleError(_0xd6dac8,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x85ba('0x32')]=function(_0x411e19,_0x2608e0,_0xc1697e){var _0x5f3bc2={'agent':{},'channel':'fax'};if(_0x411e19[_0x85ba('0x56')]['id']){delete _0x411e19[_0x85ba('0x56')]['id'];}_0x411e19[_0x85ba('0x56')][_0x85ba('0x5e')]=_0x411e19['body'][_0x85ba('0x5e')]||_0x411e19[_0x85ba('0x5f')]['id'];_0x5f3bc2['agent']['id']=_0x411e19[_0x85ba('0x56')][_0x85ba('0x5e')];return db[_0x85ba('0x4d')]['find']({'where':{'id':_0x411e19[_0x85ba('0x52')]['id'],'UserId':null}})[_0x85ba('0x1c')](handleEntityNotFound(_0x2608e0,null))[_0x85ba('0x1c')](function(_0x235843){if(_0x235843){_0x5f3bc2['message']=_0x235843[_0x85ba('0x61')]({'plain':!![]});return db[_0x85ba('0x62')]['find']({'where':{'id':_0x235843[_0x85ba('0x75')]}});}return null;})[_0x85ba('0x1c')](handleEntityNotFound(_0x2608e0,null))[_0x85ba('0x1c')](function(_0x4bf9e1){if(_0x4bf9e1){_0x5f3bc2[_0x85ba('0x64')]=_0x4bf9e1[_0x85ba('0x61')]({'plain':!![]});interaction_log['info'](_0x85ba('0x76'),_0x411e19[_0x85ba('0x5f')]['id'],_0x411e19[_0x85ba('0x5f')][_0x85ba('0x38')],_0x411e19[_0x85ba('0x5f')][_0x85ba('0x77')],_0x5f3bc2['interaction']['id'],_0x411e19[_0x85ba('0x56')]?JSON[_0x85ba('0x21')](_0x411e19[_0x85ba('0x56')]):_0x85ba('0x66'));return respondWithRpcPromise(_0x85ba('0x78'),'rejectMessage',_0x5f3bc2);}return null;})[_0x85ba('0x1c')](function(_0x26187a){var _0x455a31=_0x85ba('0x69')+_0x26187a['message'][_0x85ba('0x79')];return db[_0x85ba('0x7a')][_0x85ba('0x3f')](_0x455a31,{'type':db[_0x85ba('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x4acb15){return _0x4acb15;});})['then'](function(_0x33c492){if(_0x33c492){_0x5f3bc2[_0x85ba('0x24')][_0x85ba('0x7b')]=_0x33c492[0x0];if(!_0x411e19[_0x85ba('0x56')][_0x85ba('0x5e')])return;return db[_0x85ba('0x6c')]['find']({'where':{'id':_0x411e19['body'][_0x85ba('0x5e')],'role':_0x85ba('0x60')},'attributes':['id',_0x85ba('0x38'),_0x85ba('0x6d'),'email',_0x85ba('0x6f')],'raw':!![]});}return null;})['then'](function(_0x122f2d){if(!_0x122f2d)return null;_0x5f3bc2['message']['agent']=_0x122f2d;return _0x5f3bc2;})[_0x85ba('0x1c')](function(_0x167e6c){if(_0x167e6c){_0x167e6c[_0x85ba('0x24')][_0x85ba('0x7c')]=util[_0x85ba('0x5c')](_0x85ba('0x70'),_0x411e19[_0x85ba('0x5f')][_0x85ba('0x38')]);_0x167e6c[_0x85ba('0x24')][_0x85ba('0x71')]=_0x5f3bc2[_0x85ba('0x71')];_0x167e6c[_0x85ba('0x24')][_0x85ba('0x72')]=_0x5f3bc2[_0x85ba('0x71')];_0x167e6c['message'][_0x85ba('0x73')]=_0x85ba('0x32');respondWithRpcPromise(_0x85ba('0x7d'),_0x85ba('0x7d'),{'event':_0x85ba('0x7e'),'message':_0x167e6c[_0x85ba('0x24')]},client9002);return _0x5f3bc2;}return null;})[_0x85ba('0x1c')](respondWithResult(_0x2608e0,null))[_0x85ba('0x27')](handleError(_0x2608e0,null));};exports[_0x85ba('0x7f')]=function(_0x9d0bbf,_0x51b687){var _0xfd39;return db[_0x85ba('0x4d')]['create'](_0x9d0bbf[_0x85ba('0x56')],{})[_0x85ba('0x1c')](function(_0x2ac974){_0xfd39=_0x2ac974;return db[_0x85ba('0x80')][_0x85ba('0x81')]({'where':{'id':_0xfd39[_0x85ba('0x79')]}});})[_0x85ba('0x1c')](function(_0x2c1a27){if(_['isNil'](_0x2c1a27)){return;}else{_0xfd39['fax']=_0x2c1a27[_0x85ba('0x5a')];return db[_0x85ba('0x82')][_0x85ba('0x81')]({'where':{'id':_0xfd39['AttachmentId']}});}})[_0x85ba('0x1c')](function(_0x5366d7){return respondWithRpcPromise('SendFax',_0x85ba('0x83'),{'FaxAccountId':_[_0x85ba('0x84')](_0x9d0bbf[_0x85ba('0x56')])?undefined:_0x9d0bbf['body'][_0x85ba('0x85')],'path':_[_0x85ba('0x84')](_0x5366d7)?undefined:util['format'](_0x85ba('0x86'),_0x5366d7[_0x85ba('0x87')]),'fax':_['isNil'](_0xfd39[_0x85ba('0x5a')])?undefined:_0xfd39[_0x85ba('0x5a')],'AttachmentId':_0xfd39[_0x85ba('0x88')]},client9002);})['then'](respondWithResult(_0x51b687,0xc9))[_0x85ba('0x27')](handleError(_0x51b687,null));};exports[_0x85ba('0x89')]=function(_0x5dff39,_0x26c086){var _0x422132=path['join'](config[_0x85ba('0x8a')],_0x85ba('0x8b'),_0x85ba('0x8c'),_0x85ba('0x8d'));return db['FaxMessage']['find']({'where':{'id':_0x5dff39[_0x85ba('0x52')]['id']},'include':[{'model':db[_0x85ba('0x82')],'as':_0x85ba('0x82')}]})[_0x85ba('0x1c')](handleEntityNotFound(_0x26c086,null))[_0x85ba('0x1c')](function(_0x244323){if(_0x244323){return _0x26c086['download'](path[_0x85ba('0x8e')](_0x422132,_0x244323[_0x85ba('0x82')][_0x85ba('0x87')]));}})[_0x85ba('0x27')](handleError(_0x26c086,null));}; \ No newline at end of file +var _0x22ca=['model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','options','includeAll','include','FaxMessage','findAll','rows','show','params','keys','length','find','body','describe','../../config/logger','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','get','UserId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','CmContact','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','attachments','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','name','index','map','rawAttributes','fieldName','type'];(function(_0xe6bbe2,_0x4eeae3){var _0x1414f3=function(_0x3aef68){while(--_0x3aef68){_0xe6bbe2['push'](_0xe6bbe2['shift']());}};_0x1414f3(++_0x4eeae3);}(_0x22ca,0x179));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa22c('0x0'));var zipdir=require(_0xa22c('0x1'));var jsonpatch=require(_0xa22c('0x2'));var rp=require(_0xa22c('0x3'));var moment=require(_0xa22c('0x4'));var BPromise=require(_0xa22c('0x5'));var Mustache=require(_0xa22c('0x6'));var util=require('util');var path=require(_0xa22c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa22c('0x8'));var _=require(_0xa22c('0x9'));var squel=require(_0xa22c('0xa'));var crypto=require('crypto');var jsforce=require(_0xa22c('0xb'));var deskjs=require(_0xa22c('0xc'));var toCsv=require(_0xa22c('0xd'));var querystring=require('querystring');var Papa=require(_0xa22c('0xe'));var Redis=require(_0xa22c('0xf'));var authService=require(_0xa22c('0x10'));var qs=require(_0xa22c('0x11'));var as=require(_0xa22c('0x12'));var hardwareService=require(_0xa22c('0x13'));var logger=require('../../config/logger')(_0xa22c('0x14'));var utils=require(_0xa22c('0x15'));var config=require(_0xa22c('0x16'));var licenseUtil=require(_0xa22c('0x17'));var db=require(_0xa22c('0x18'))['db'];config[_0xa22c('0x19')]=_[_0xa22c('0x1a')](config[_0xa22c('0x19')],{'host':_0xa22c('0x1b'),'port':0x18eb});var socket=require(_0xa22c('0x1c'))(new Redis(config[_0xa22c('0x19')]));require(_0xa22c('0x1d'))[_0xa22c('0x1e')](socket);var jayson=require(_0xa22c('0x1f'));var client=jayson[_0xa22c('0x20')][_0xa22c('0x21')]({'port':0x232c});var client9002=jayson[_0xa22c('0x20')][_0xa22c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x197f48,_0x145521,_0x5acaf3,_0x20c474){return new BPromise(function(_0x255d3b,_0x318ab6){var _0x389223=_0x20c474||client;return _0x389223[_0xa22c('0x22')](_0x197f48,_0x5acaf3)['then'](function(_0x2c6ec1){logger[_0xa22c('0x23')](_0xa22c('0x24'),_0x145521,_0xa22c('0x25'));logger['debug'](_0xa22c('0x26'),_0x145521,_0xa22c('0x25'),JSON[_0xa22c('0x27')](_0x2c6ec1));if(_0x2c6ec1[_0xa22c('0x28')]){if(_0x2c6ec1[_0xa22c('0x28')][_0xa22c('0x29')]===0x1f4){logger[_0xa22c('0x28')](_0xa22c('0x24'),_0x145521,_0x2c6ec1[_0xa22c('0x28')][_0xa22c('0x2a')]);return _0x318ab6(_0x2c6ec1[_0xa22c('0x28')]['message']);}logger[_0xa22c('0x28')]('FaxMessage,\x20%s,\x20%s',_0x145521,_0x2c6ec1[_0xa22c('0x28')]['message']);return _0x255d3b(_0x2c6ec1[_0xa22c('0x28')][_0xa22c('0x2a')]);}else{logger[_0xa22c('0x23')](_0xa22c('0x24'),_0x145521,_0xa22c('0x25'));_0x255d3b(_0x2c6ec1['result']['message']);}})[_0xa22c('0x2b')](function(_0x91422b){logger[_0xa22c('0x28')](_0xa22c('0x24'),_0x145521,_0x91422b);_0x318ab6(_0x91422b);});});}function respondWithStatusCode(_0x20b22d,_0x515e47){_0x515e47=_0x515e47||0xcc;return function(_0x68e057){if(_0x68e057){return _0x20b22d[_0xa22c('0x2c')](_0x515e47);}return _0x20b22d[_0xa22c('0x2d')](_0x515e47)[_0xa22c('0x2e')]();};}function respondWithResult(_0x12fc9d,_0x249d37){_0x249d37=_0x249d37||0xc8;return function(_0x533d24){if(_0x533d24){return _0x12fc9d[_0xa22c('0x2d')](_0x249d37)['json'](_0x533d24);}};}function respondWithFilteredResult(_0x789cf1,_0x1a3c12){return function(_0x126357){if(_0x126357){var _0x526e55=typeof _0x1a3c12['offset']===_0xa22c('0x2f')&&typeof _0x1a3c12[_0xa22c('0x30')]===_0xa22c('0x2f');var _0x152510=_0x126357[_0xa22c('0x31')];var _0x97206b=_0x526e55?0x0:_0x1a3c12['offset'];var _0x521343=_0x526e55?_0x126357['count']:_0x1a3c12['offset']+_0x1a3c12[_0xa22c('0x30')];var _0x2ffe81;if(_0x521343>=_0x152510){_0x521343=_0x152510;_0x2ffe81=0xc8;}else{_0x2ffe81=0xce;}_0x789cf1[_0xa22c('0x2d')](_0x2ffe81);return _0x789cf1[_0xa22c('0x32')](_0xa22c('0x33'),_0x97206b+'-'+_0x521343+'/'+_0x152510)[_0xa22c('0x34')](_0x126357);}return null;};}function patchUpdates(_0x3e5d36){return function(_0x6df238){try{jsonpatch[_0xa22c('0x35')](_0x6df238,_0x3e5d36,!![]);}catch(_0x46641f){return BPromise[_0xa22c('0x36')](_0x46641f);}return _0x6df238['save']();};}function saveUpdates(_0x1dbc64,_0x41b3ad){return function(_0x33c16e){if(_0x33c16e){return _0x33c16e[_0xa22c('0x37')](_0x1dbc64)[_0xa22c('0x38')](function(_0x2d001d){return _0x2d001d;});}return null;};}function removeEntity(_0x49aa71,_0xb100fd){return function(_0x3126a9){if(_0x3126a9){return _0x3126a9[_0xa22c('0x39')]()[_0xa22c('0x38')](function(){_0x49aa71[_0xa22c('0x2d')](0xcc)[_0xa22c('0x2e')]();});}};}function handleEntityNotFound(_0x34c1e0,_0x4a21b7){return function(_0x469208){if(!_0x469208){_0x34c1e0[_0xa22c('0x2c')](0x194);}return _0x469208;};}function handleError(_0xaf5d51,_0x31ab6c){_0x31ab6c=_0x31ab6c||0x1f4;return function(_0x3fd365){logger[_0xa22c('0x28')](_0x3fd365['stack']);if(_0x3fd365['name']){delete _0x3fd365[_0xa22c('0x3a')];}_0xaf5d51[_0xa22c('0x2d')](_0x31ab6c)['send'](_0x3fd365);};}exports[_0xa22c('0x3b')]=function(_0x39a5d2,_0x2e86c5){var _0x5aa4c9={},_0x40cff7={},_0x183707={'count':0x0,'rows':[]};var _0x1260a8=_[_0xa22c('0x3c')](db['FaxMessage'][_0xa22c('0x3d')],function(_0x379a56){return{'name':_0x379a56[_0xa22c('0x3e')],'type':_0x379a56[_0xa22c('0x3f')]['key']};});_0x40cff7[_0xa22c('0x40')]=_[_0xa22c('0x3c')](_0x1260a8,_0xa22c('0x3a'));_0x40cff7[_0xa22c('0x41')]=_['keys'](_0x39a5d2[_0xa22c('0x41')]);_0x40cff7[_0xa22c('0x42')]=_[_0xa22c('0x43')](_0x40cff7['model'],_0x40cff7[_0xa22c('0x41')]);_0x5aa4c9[_0xa22c('0x44')]=_[_0xa22c('0x43')](_0x40cff7[_0xa22c('0x40')],qs[_0xa22c('0x45')](_0x39a5d2[_0xa22c('0x41')]['fields']));_0x5aa4c9[_0xa22c('0x44')]=_0x5aa4c9[_0xa22c('0x44')]['length']?_0x5aa4c9[_0xa22c('0x44')]:_0x40cff7[_0xa22c('0x40')];if(!_0x39a5d2[_0xa22c('0x41')][_0xa22c('0x46')](_0xa22c('0x47'))){_0x5aa4c9['limit']=qs[_0xa22c('0x30')](_0x39a5d2[_0xa22c('0x41')]['limit']);_0x5aa4c9[_0xa22c('0x48')]=qs['offset'](_0x39a5d2['query'][_0xa22c('0x48')]);}_0x5aa4c9[_0xa22c('0x49')]=qs[_0xa22c('0x4a')](_0x39a5d2[_0xa22c('0x41')][_0xa22c('0x4a')]);_0x5aa4c9[_0xa22c('0x4b')]=qs[_0xa22c('0x42')](_[_0xa22c('0x4c')](_0x39a5d2[_0xa22c('0x41')],_0x40cff7['filters']),_0x1260a8);if(_0x39a5d2[_0xa22c('0x41')]['filter']){_0x5aa4c9[_0xa22c('0x4b')]=_[_0xa22c('0x4d')](_0x5aa4c9[_0xa22c('0x4b')],{'$or':_['map'](_0x1260a8,function(_0x7c1e3d){if(_0x7c1e3d[_0xa22c('0x3f')]!=='VIRTUAL'){var _0x4979d4={};_0x4979d4[_0x7c1e3d[_0xa22c('0x3a')]]={'$like':'%'+_0x39a5d2[_0xa22c('0x41')][_0xa22c('0x4e')]+'%'};return _0x4979d4;}})});}_0x5aa4c9=_[_0xa22c('0x4d')]({},_0x5aa4c9,_0x39a5d2[_0xa22c('0x4f')]);var _0x4ccfe5={'where':_0x5aa4c9[_0xa22c('0x4b')]};return db['FaxMessage'][_0xa22c('0x31')](_0x4ccfe5)[_0xa22c('0x38')](function(_0x31f646){_0x183707['count']=_0x31f646;if(_0x39a5d2['query'][_0xa22c('0x50')]){_0x5aa4c9[_0xa22c('0x51')]=[{'all':!![]}];}return db[_0xa22c('0x52')][_0xa22c('0x53')](_0x5aa4c9);})[_0xa22c('0x38')](function(_0x5207c8){_0x183707[_0xa22c('0x54')]=_0x5207c8;return _0x183707;})[_0xa22c('0x38')](respondWithFilteredResult(_0x2e86c5,_0x5aa4c9))[_0xa22c('0x2b')](handleError(_0x2e86c5,null));};exports[_0xa22c('0x55')]=function(_0x3f886d,_0x290747){var _0x34e1df={'raw':!![],'where':{'id':_0x3f886d[_0xa22c('0x56')]['id']}},_0x59b23e={};_0x59b23e['model']=_[_0xa22c('0x57')](db['FaxMessage'][_0xa22c('0x3d')]);_0x59b23e[_0xa22c('0x41')]=_['keys'](_0x3f886d[_0xa22c('0x41')]);_0x59b23e['filters']=_[_0xa22c('0x43')](_0x59b23e['model'],_0x59b23e[_0xa22c('0x41')]);_0x34e1df[_0xa22c('0x44')]=_[_0xa22c('0x43')](_0x59b23e['model'],qs[_0xa22c('0x45')](_0x3f886d[_0xa22c('0x41')][_0xa22c('0x45')]));_0x34e1df[_0xa22c('0x44')]=_0x34e1df[_0xa22c('0x44')][_0xa22c('0x58')]?_0x34e1df[_0xa22c('0x44')]:_0x59b23e['model'];if(_0x3f886d[_0xa22c('0x41')][_0xa22c('0x50')]){_0x34e1df['include']=[{'all':!![]}];}_0x34e1df=_[_0xa22c('0x4d')]({},_0x34e1df,_0x3f886d[_0xa22c('0x4f')]);return db[_0xa22c('0x52')][_0xa22c('0x59')](_0x34e1df)['then'](handleEntityNotFound(_0x290747,null))[_0xa22c('0x38')](respondWithResult(_0x290747,null))[_0xa22c('0x2b')](handleError(_0x290747,null));};exports['update']=function(_0x86ed54,_0x66847d){if(_0x86ed54[_0xa22c('0x5a')]['id']){delete _0x86ed54[_0xa22c('0x5a')]['id'];}return db[_0xa22c('0x52')][_0xa22c('0x59')]({'where':{'id':_0x86ed54['params']['id']}})[_0xa22c('0x38')](handleEntityNotFound(_0x66847d,null))[_0xa22c('0x38')](saveUpdates(_0x86ed54[_0xa22c('0x5a')],null))['then'](respondWithResult(_0x66847d,null))[_0xa22c('0x2b')](handleError(_0x66847d,null));};exports[_0xa22c('0x39')]=function(_0x821b63,_0x418db7){return db[_0xa22c('0x52')][_0xa22c('0x59')]({'where':{'id':_0x821b63['params']['id']}})[_0xa22c('0x38')](handleEntityNotFound(_0x418db7,null))[_0xa22c('0x38')](removeEntity(_0x418db7,null))[_0xa22c('0x2b')](handleError(_0x418db7,null));};exports[_0xa22c('0x5b')]=function(_0x50f5b6,_0x5c53d5){return db['FaxMessage'][_0xa22c('0x5b')]()[_0xa22c('0x38')](respondWithResult(_0x5c53d5,null))['catch'](handleError(_0x5c53d5,null));};var interaction_log=require(_0xa22c('0x5c'))(_0xa22c('0x5d'));exports['accept']=function(_0x161aed,_0x13e604,_0x324cd7){var _0x13fd76={'agent':{},'channel':_0xa22c('0x5e')};if(_0x161aed['body']['id']){delete _0x161aed[_0xa22c('0x5a')]['id'];}_0x161aed['body'][_0xa22c('0x5f')]=!![];_0x161aed[_0xa22c('0x5a')][_0xa22c('0x60')]=moment()[_0xa22c('0x61')](_0xa22c('0x62'));_0x161aed[_0xa22c('0x5a')]['UserId']=_0x161aed[_0xa22c('0x5a')]['UserId']||_0x161aed['user']['id'];_0x13fd76[_0xa22c('0x63')]['id']=_0x161aed[_0xa22c('0x5a')]['UserId'];return db[_0xa22c('0x52')][_0xa22c('0x59')]({'where':{'id':_0x161aed['params']['id'],'UserId':null}})[_0xa22c('0x38')](handleEntityNotFound(_0x13e604,null))[_0xa22c('0x38')](saveUpdates(_0x161aed[_0xa22c('0x5a')],null))[_0xa22c('0x38')](function(_0x4b16de){if(_0x4b16de){_0x13fd76[_0xa22c('0x2a')]=_0x4b16de[_0xa22c('0x64')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4b16de['FaxInteractionId']}});}return null;})[_0xa22c('0x38')](handleEntityNotFound(_0x13e604,null))[_0xa22c('0x38')](function(_0x215f64){if(_0x215f64){return _0x215f64['update']({'UserId':_0x161aed[_0xa22c('0x5a')][_0xa22c('0x65')],'read1stAt':_[_0xa22c('0x66')](_0x215f64[_0xa22c('0x67')])?moment()[_0xa22c('0x61')](_0xa22c('0x62')):undefined});}return null;})[_0xa22c('0x38')](function(_0xe615d3){if(_0xe615d3){_0x13fd76[_0xa22c('0x68')]=_0xe615d3[_0xa22c('0x64')]({'plain':!![]});interaction_log[_0xa22c('0x23')](_0xa22c('0x69'),_0x161aed[_0xa22c('0x6a')]['id'],_0x161aed[_0xa22c('0x6a')][_0xa22c('0x3a')],_0x161aed['user'][_0xa22c('0x6b')],_0x13fd76[_0xa22c('0x68')]['id'],_0x161aed[_0xa22c('0x5a')]?JSON[_0xa22c('0x27')](_0x161aed[_0xa22c('0x5a')]):_0xa22c('0x6c'));return respondWithRpcPromise(_0xa22c('0x6d'),_0xa22c('0x6e'),_0x13fd76);}return null;})[_0xa22c('0x38')](function(_0x1ee4db){var _0x16df86=_0xa22c('0x6f')+_0x1ee4db[_0xa22c('0x2a')]['ContactId'];return db[_0xa22c('0x70')]['query'](_0x16df86,{'type':db[_0xa22c('0x71')][_0xa22c('0x72')][_0xa22c('0x73')],'raw':!![]})[_0xa22c('0x38')](function(_0x91cbee){return _0x91cbee;});})['then'](function(_0x236994){if(_0x236994){_0x13fd76['message'][_0xa22c('0x74')]=_0x236994[0x0];if(!_0x161aed['body'][_0xa22c('0x65')])return;return db[_0xa22c('0x75')]['find']({'where':{'id':_0x161aed[_0xa22c('0x5a')][_0xa22c('0x65')],'role':_0xa22c('0x63')},'attributes':['id','name',_0xa22c('0x76'),_0xa22c('0x77'),_0xa22c('0x78')],'raw':!![]});}return null;})[_0xa22c('0x38')](function(_0xb66b74){if(!_0xb66b74)return null;_0x13fd76['message'][_0xa22c('0x63')]=_0xb66b74;return _0x13fd76;})[_0xa22c('0x38')](function(_0x3f5c47){if(_0x3f5c47){if(_0x161aed['body'][_0xa22c('0x79')]){_0x13fd76[_0xa22c('0x2a')][_0xa22c('0x7a')]=util[_0xa22c('0x61')](_0xa22c('0x7b'),_0x161aed[_0xa22c('0x6a')][_0xa22c('0x3a')]);_0x13fd76[_0xa22c('0x2a')][_0xa22c('0x7c')]=_0x13fd76[_0xa22c('0x7c')];_0x13fd76['message'][_0xa22c('0x7d')]=_0x13fd76[_0xa22c('0x7c')];_0x13fd76['message'][_0xa22c('0x7e')]=_0xa22c('0x7f');return respondWithRpcPromise(_0xa22c('0x80'),_0xa22c('0x80'),{'event':_0xa22c('0x81'),'message':_0x13fd76[_0xa22c('0x2a')]},client9002)[_0xa22c('0x38')](function(){return _0x13fd76;});}return _0x13fd76;}return null;})[_0xa22c('0x38')](respondWithResult(_0x13e604,null))[_0xa22c('0x2b')](handleError(_0x13e604,null));};var interaction_log=require('../../config/logger')(_0xa22c('0x5d'));exports[_0xa22c('0x36')]=function(_0x58c013,_0x3f9703,_0x1ba20f){var _0x5723e8={'agent':{},'channel':_0xa22c('0x5e')};if(_0x58c013['body']['id']){delete _0x58c013[_0xa22c('0x5a')]['id'];}_0x58c013['body']['UserId']=_0x58c013[_0xa22c('0x5a')]['UserId']||_0x58c013['user']['id'];_0x5723e8[_0xa22c('0x63')]['id']=_0x58c013['body'][_0xa22c('0x65')];return db[_0xa22c('0x52')][_0xa22c('0x59')]({'where':{'id':_0x58c013[_0xa22c('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f9703,null))[_0xa22c('0x38')](function(_0xf9b581){if(_0xf9b581){_0x5723e8['message']=_0xf9b581[_0xa22c('0x64')]({'plain':!![]});return db[_0xa22c('0x82')][_0xa22c('0x59')]({'where':{'id':_0xf9b581[_0xa22c('0x83')]}});}return null;})[_0xa22c('0x38')](handleEntityNotFound(_0x3f9703,null))[_0xa22c('0x38')](function(_0x29b455){if(_0x29b455){_0x5723e8[_0xa22c('0x68')]=_0x29b455[_0xa22c('0x64')]({'plain':!![]});interaction_log['info'](_0xa22c('0x84'),_0x58c013[_0xa22c('0x6a')]['id'],_0x58c013['user'][_0xa22c('0x3a')],_0x58c013['user']['role'],_0x5723e8['interaction']['id'],_0x58c013[_0xa22c('0x5a')]?JSON['stringify'](_0x58c013[_0xa22c('0x5a')]):_0xa22c('0x6c'));return respondWithRpcPromise(_0xa22c('0x85'),_0xa22c('0x86'),_0x5723e8);}return null;})['then'](function(_0x4c3ddd){var _0x1d1ecc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4c3ddd[_0xa22c('0x2a')][_0xa22c('0x87')];return db[_0xa22c('0x70')][_0xa22c('0x41')](_0x1d1ecc,{'type':db[_0xa22c('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0xa22c('0x38')](function(_0x3190bd){return _0x3190bd;});})[_0xa22c('0x38')](function(_0x59da72){if(_0x59da72){_0x5723e8[_0xa22c('0x2a')]['contact']=_0x59da72[0x0];if(!_0x58c013['body'][_0xa22c('0x65')])return;return db[_0xa22c('0x75')][_0xa22c('0x59')]({'where':{'id':_0x58c013[_0xa22c('0x5a')][_0xa22c('0x65')],'role':_0xa22c('0x63')},'attributes':['id',_0xa22c('0x3a'),_0xa22c('0x76'),_0xa22c('0x77'),_0xa22c('0x78')],'raw':!![]});}return null;})['then'](function(_0x17f502){if(!_0x17f502)return null;_0x5723e8[_0xa22c('0x2a')][_0xa22c('0x63')]=_0x17f502;return _0x5723e8;})[_0xa22c('0x38')](function(_0x2c6bba){if(_0x2c6bba){_0x2c6bba[_0xa22c('0x2a')][_0xa22c('0x7a')]=util[_0xa22c('0x61')](_0xa22c('0x7b'),_0x58c013[_0xa22c('0x6a')][_0xa22c('0x3a')]);_0x2c6bba['message']['channel']=_0x5723e8['channel'];_0x2c6bba[_0xa22c('0x2a')][_0xa22c('0x7d')]=_0x5723e8[_0xa22c('0x7c')];_0x2c6bba[_0xa22c('0x2a')][_0xa22c('0x7e')]=_0xa22c('0x36');respondWithRpcPromise(_0xa22c('0x80'),_0xa22c('0x80'),{'event':'rejectmessage','message':_0x2c6bba[_0xa22c('0x2a')]},client9002);return _0x5723e8;}return null;})['then'](respondWithResult(_0x3f9703,null))['catch'](handleError(_0x3f9703,null));};exports['create']=function(_0x2a3297,_0x461f29){var _0x434452;return db[_0xa22c('0x52')]['create'](_0x2a3297[_0xa22c('0x5a')],{})[_0xa22c('0x38')](function(_0x475a78){_0x434452=_0x475a78;return db[_0xa22c('0x88')]['findOne']({'where':{'id':_0x434452[_0xa22c('0x87')]}});})[_0xa22c('0x38')](function(_0x2d9f42){if(_[_0xa22c('0x66')](_0x2d9f42)){return;}else{_0x434452[_0xa22c('0x5e')]=_0x2d9f42[_0xa22c('0x5e')];return db[_0xa22c('0x89')]['findOne']({'where':{'id':_0x434452[_0xa22c('0x8a')]}});}})[_0xa22c('0x38')](function(_0x33813a){return respondWithRpcPromise(_0xa22c('0x8b'),'SendFax',{'FaxAccountId':_[_0xa22c('0x66')](_0x2a3297[_0xa22c('0x5a')])?undefined:_0x2a3297['body']['FaxAccountId'],'path':_[_0xa22c('0x66')](_0x33813a)?undefined:util[_0xa22c('0x61')](_0xa22c('0x8c'),_0x33813a[_0xa22c('0x8d')]),'fax':_[_0xa22c('0x66')](_0x434452['fax'])?undefined:_0x434452[_0xa22c('0x5e')],'AttachmentId':_0x434452['AttachmentId']},client9002);})[_0xa22c('0x38')](respondWithResult(_0x461f29,0xc9))['catch'](handleError(_0x461f29,null));};exports[_0xa22c('0x8e')]=function(_0x9deeca,_0x47f546){var _0x3569a3=path['join'](config[_0xa22c('0x8f')],_0xa22c('0x90'),'files',_0xa22c('0x91'));return db[_0xa22c('0x52')]['find']({'where':{'id':_0x9deeca[_0xa22c('0x56')]['id']},'include':[{'model':db[_0xa22c('0x89')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x47f546,null))[_0xa22c('0x38')](function(_0x5c6d79){if(_0x5c6d79){return _0x47f546['download'](path[_0xa22c('0x92')](_0x3569a3,_0x5c6d79['Attachment']['basename']));}})[_0xa22c('0x2b')](handleError(_0x47f546,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index cd90d71..cdd0e73 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 _0xc9ab=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x1e95d1,_0x189454){var _0x3e3f59=function(_0x4aae4b){while(--_0x4aae4b){_0x1e95d1['push'](_0x1e95d1['shift']());}};_0x3e3f59(++_0x189454);}(_0xc9ab,0x125));var _0xbc9a=function(_0xc8ffa5,_0x1fd15f){_0xc8ffa5=_0xc8ffa5-0x0;var _0x35bc1b=_0xc9ab[_0xc8ffa5];return _0x35bc1b;};'use strict';var EventEmitter=require(_0xbc9a('0x0'));var FaxMessage=require(_0xbc9a('0x1'))['db'][_0xbc9a('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbc9a('0x3')};function emitEvent(_0x20e8eb){return function(_0x23d40c,_0x33e557,_0x16f84d){FaxMessageEvents[_0xbc9a('0x4')](_0x20e8eb+':'+_0x23d40c['id'],_0x23d40c);FaxMessageEvents[_0xbc9a('0x4')](_0x20e8eb,_0x23d40c);_0x16f84d(null);};}for(var e in events){if(events[_0xbc9a('0x5')](e)){var event=events[e];FaxMessage[_0xbc9a('0x6')](e,emitEvent(event));}}module[_0xbc9a('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x644f=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x6bfb0c,_0x20cca9){var _0x2e9e66=function(_0x4b148a){while(--_0x4b148a){_0x6bfb0c['push'](_0x6bfb0c['shift']());}};_0x2e9e66(++_0x20cca9);}(_0x644f,0x177));var _0xf644=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0x644f[_0x58999b];return _0x5efc3a;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xf644('0x0'))['db'][_0xf644('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf644('0x2')](0x0);var events={'afterCreate':_0xf644('0x3'),'afterUpdate':_0xf644('0x4'),'afterDestroy':_0xf644('0x5')};function emitEvent(_0x318999){return function(_0x2885d7,_0x347827,_0x57bf32){FaxMessageEvents['emit'](_0x318999+':'+_0x2885d7['id'],_0x2885d7);FaxMessageEvents[_0xf644('0x6')](_0x318999,_0x2885d7);_0x57bf32(null);};}for(var e in events){if(events[_0xf644('0x7')](e)){var event=events[e];FaxMessage[_0xf644('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 9c5b129..a7d282b 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 _0x8483=['request-promise','path','../../config/environment','./faxMessage.attributes','exports','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x56b2e4,_0x3e4439){var _0x1e688f=function(_0x384fae){while(--_0x384fae){_0x56b2e4['push'](_0x56b2e4['shift']());}};_0x1e688f(++_0x3e4439);}(_0x8483,0x73));var _0x3848=function(_0x217419,_0x187e73){_0x217419=_0x217419-0x0;var _0x2282ee=_0x8483[_0x217419];return _0x2282ee;};'use strict';var _=require(_0x3848('0x0'));var util=require(_0x3848('0x1'));var logger=require(_0x3848('0x2'))('api');var moment=require(_0x3848('0x3'));var BPromise=require(_0x3848('0x4'));var rp=require(_0x3848('0x5'));var fs=require('fs');var path=require(_0x3848('0x6'));var rimraf=require('rimraf');var config=require(_0x3848('0x7'));var attributes=require(_0x3848('0x8'));module[_0x3848('0x9')]=function(_0xedf675,_0x471f59){return _0xedf675['define']('FaxMessage',attributes,{'tableName':_0x3848('0xa'),'paranoid':![],'indexes':[{'name':_0x3848('0xb'),'fields':[_0x3848('0xc')],'type':_0x3848('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48d6c9,_0x1b851f,_0x2e1940){var _0x40efe4=_0xedf675['models'];var _0x3592bc=_0x48d6c9[_0x3848('0xe')]({'plain':!![]});if(_0x3592bc[_0x3848('0xf')][_0x3848('0x10')]()==='in'||_0x3592bc[_0x3848('0xf')][_0x3848('0x10')]()===_0x3848('0x11')&&!_0x3592bc[_0x3848('0x12')]&&!_[_0x3848('0x13')](_0x3592bc[_0x3848('0x14')])){_0x40efe4[_0x3848('0x15')][_0x3848('0x16')]({'where':{'id':_0x3592bc[_0x3848('0x17')]}})['then'](function(_0x43e04f){if(_0x43e04f){_0x43e04f[_0x3848('0x18')]({'lastMsgAt':_0x3592bc[_0x3848('0x19')],'lastMsgDirection':_0x3592bc[_0x3848('0xf')][_0x3848('0x10')]()});}})[_0x3848('0x1a')](function(_0x4b2e6a){console[_0x3848('0x1b')](_0x4b2e6a);});}_0x2e1940();}},'charset':_0x3848('0x1c'),'collate':_0x3848('0x1d')});}; \ No newline at end of file +var _0x96f9=['exports','FaxMessage','fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxMessage.attributes'];(function(_0x145016,_0x40ba0b){var _0x4a57e8=function(_0x11ea2a){while(--_0x11ea2a){_0x145016['push'](_0x145016['shift']());}};_0x4a57e8(++_0x40ba0b);}(_0x96f9,0x7f));var _0x996f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x96f9[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x996f('0x0'));var logger=require(_0x996f('0x1'))(_0x996f('0x2'));var moment=require(_0x996f('0x3'));var BPromise=require('bluebird');var rp=require(_0x996f('0x4'));var fs=require('fs');var path=require(_0x996f('0x5'));var rimraf=require(_0x996f('0x6'));var config=require('../../config/environment');var attributes=require(_0x996f('0x7'));module[_0x996f('0x8')]=function(_0x52b769,_0x3def03){return _0x52b769['define'](_0x996f('0x9'),attributes,{'tableName':_0x996f('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x996f('0xb')],'type':_0x996f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9e76a,_0xe267f2,_0x35e2de){var _0x17d5f7=_0x52b769['models'];var _0x144533=_0x9e76a[_0x996f('0xd')]({'plain':!![]});if(_0x144533[_0x996f('0xe')][_0x996f('0xf')]()==='in'||_0x144533['direction'][_0x996f('0xf')]()===_0x996f('0x10')&&!_0x144533[_0x996f('0x11')]&&!_[_0x996f('0x12')](_0x144533[_0x996f('0x13')])){_0x17d5f7[_0x996f('0x14')]['findOne']({'where':{'id':_0x144533[_0x996f('0x15')]}})['then'](function(_0x505fed){if(_0x505fed){_0x505fed[_0x996f('0x16')]({'lastMsgAt':_0x144533[_0x996f('0x17')],'lastMsgDirection':_0x144533['direction'][_0x996f('0xf')]()});}})[_0x996f('0x18')](function(_0x423853){console[_0x996f('0x19')](_0x423853);});}_0x35e2de();}},'charset':'utf8mb4','collate':_0x996f('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 12bd73a..8e557b4 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 _0x4ea3=['message','result','catch','body','options','CreateFaxMessage','update','where','attributes','UpdateFaxMessage','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5b8f6d,_0x15ecd0){var _0x729fba=function(_0xfeecfc){while(--_0xfeecfc){_0x5b8f6d['push'](_0x5b8f6d['shift']());}};_0x729fba(++_0x15ecd0);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});config[_0x34ea('0xa')]=_[_0x34ea('0xb')](config[_0x34ea('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x34ea('0xc'))(new Redis(config[_0x34ea('0xa')]));require(_0x34ea('0xd'))['register'](socket);function respondWithRpcPromise(_0x301b98,_0xea1be2,_0x5126de){return new BPromise(function(_0x4a76b1,_0x5bd8b6){return client[_0x34ea('0xe')](_0x301b98,_0x5126de)[_0x34ea('0xf')](function(_0x58bb0d){logger[_0x34ea('0x10')](_0x34ea('0x11'),_0xea1be2,_0x34ea('0x12'));logger[_0x34ea('0x13')](_0x34ea('0x14'),_0xea1be2,_0x34ea('0x12'),JSON[_0x34ea('0x15')](_0x58bb0d));if(_0x58bb0d[_0x34ea('0x16')]){if(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x17')]===0x1f4){logger[_0x34ea('0x16')]('FaxMessage,\x20%s,\x20%s',_0xea1be2,_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);return _0x5bd8b6(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);}logger[_0x34ea('0x16')]('FaxMessage,\x20%s,\x20%s',_0xea1be2,_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);return _0x4a76b1(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);}else{logger['info'](_0x34ea('0x11'),_0xea1be2,_0x34ea('0x12'));_0x4a76b1(_0x58bb0d[_0x34ea('0x19')]['message']);}})[_0x34ea('0x1a')](function(_0x1353de){logger[_0x34ea('0x16')](_0x34ea('0x11'),_0xea1be2,_0x1353de);_0x5bd8b6(_0x1353de);});});}exports['CreateFaxMessage']=function(_0x2eea57){var _0x35328c=this;return new Promise(function(_0x287aaa,_0x247ee7){return db['FaxMessage']['create'](_0x2eea57[_0x34ea('0x1b')],{'raw':_0x2eea57[_0x34ea('0x1c')]?_0x2eea57[_0x34ea('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2eafc6){logger[_0x34ea('0x10')](_0x34ea('0x1d'),_0x2eea57);logger[_0x34ea('0x13')](_0x34ea('0x1d'),_0x2eea57,JSON[_0x34ea('0x15')](_0x2eafc6));_0x287aaa(_0x2eafc6);})['catch'](function(_0xf24962){logger[_0x34ea('0x16')](_0x34ea('0x1d'),_0xf24962[_0x34ea('0x18')],_0x2eea57);_0x247ee7(_0x35328c['error'](0x1f4,_0xf24962['message']));});});};exports['UpdateFaxMessage']=function(_0x142709){var _0x187306=this;return new Promise(function(_0x37c214,_0x4204d7){return db['FaxMessage'][_0x34ea('0x1e')](_0x142709[_0x34ea('0x1b')],{'raw':_0x142709[_0x34ea('0x1c')]?_0x142709['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x142709['options']?_0x142709['options'][_0x34ea('0x1f')]||null:null,'attributes':_0x142709[_0x34ea('0x1c')]?_0x142709[_0x34ea('0x1c')][_0x34ea('0x20')]||null:null,'limit':_0x142709['options']?_0x142709[_0x34ea('0x1c')]['limit']||null:null})[_0x34ea('0xf')](function(_0x4f2b77){logger[_0x34ea('0x10')](_0x34ea('0x21'),_0x142709);logger[_0x34ea('0x13')]('UpdateFaxMessage',_0x142709,JSON[_0x34ea('0x15')](_0x4f2b77));_0x37c214(_0x4f2b77);})[_0x34ea('0x1a')](function(_0x55c8ba){logger[_0x34ea('0x16')]('UpdateFaxMessage',_0x55c8ba[_0x34ea('0x18')],_0x142709);_0x4204d7(_0x187306[_0x34ea('0x16')](0x1f4,_0x55c8ba[_0x34ea('0x18')]));});});}; \ No newline at end of file +var _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0xc496df,_0x225b21){var _0x5133a3=function(_0x2fd886){while(--_0x2fd886){_0xc496df['push'](_0xc496df['shift']());}};_0x5133a3(++_0x225b21);}(_0x032e,0x124));var _0xe032=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x032e[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index c77604d..8f46630 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 _0x96aa=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x4be8be,_0x35672c){var _0x1dd44b=function(_0x1c38f8){while(--_0x1c38f8){_0x4be8be['push'](_0x4be8be['shift']());}};_0x1dd44b(++_0x35672c);}(_0x96aa,0x114));var _0xa96a=function(_0x247851,_0x4f964b){_0x247851=_0x247851-0x0;var _0x276acb=_0x96aa[_0x247851];return _0x276acb;};'use strict';var FaxMessageEvents=require(_0xa96a('0x0'));var events=[_0xa96a('0x1'),_0xa96a('0x2'),_0xa96a('0x3')];function createListener(_0x5216e4,_0x25543d){return function(_0xe8ad9e){_0x25543d[_0xa96a('0x4')](_0x5216e4,_0xe8ad9e);};}function removeListener(_0xad1482,_0x3aa524){return function(){FaxMessageEvents[_0xa96a('0x5')](_0xad1482,_0x3aa524);};}exports[_0xa96a('0x6')]=function(_0x77880b){for(var _0x27da05=0x0,_0x518658=events[_0xa96a('0x7')];_0x27da05<_0x518658;_0x27da05++){var _0xf43c1f=events[_0x27da05];var _0x580fde=createListener(_0xa96a('0x8')+_0xf43c1f,_0x77880b);FaxMessageEvents['on'](_0xf43c1f,_0x580fde);}}; \ No newline at end of file +var _0x6e9d=['length','./faxMessage.events','remove','update','emit','register'];(function(_0x20f763,_0x441b07){var _0x4d1c6a=function(_0x4a5763){while(--_0x4a5763){_0x20f763['push'](_0x20f763['shift']());}};_0x4d1c6a(++_0x441b07);}(_0x6e9d,0x109));var _0xd6e9=function(_0x1ac7a1,_0x29faf8){_0x1ac7a1=_0x1ac7a1-0x0;var _0x12d12e=_0x6e9d[_0x1ac7a1];return _0x12d12e;};'use strict';var FaxMessageEvents=require(_0xd6e9('0x0'));var events=['save',_0xd6e9('0x1'),_0xd6e9('0x2')];function createListener(_0x128c14,_0x298cbf){return function(_0x46dcc5){_0x298cbf[_0xd6e9('0x3')](_0x128c14,_0x46dcc5);};}function removeListener(_0x31b7ab,_0x421c90){return function(){FaxMessageEvents['removeListener'](_0x31b7ab,_0x421c90);};}exports[_0xd6e9('0x4')]=function(_0x1da244){for(var _0x4ca6cb=0x0,_0xaf6889=events[_0xd6e9('0x5')];_0x4ca6cb<_0xaf6889;_0x4ca6cb++){var _0x51b6ec=events[_0x4ca6cb];var _0x34d667=createListener('faxMessage:'+_0x51b6ec,_0x1da244);FaxMessageEvents['on'](_0x51b6ec,_0x34d667);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b5d492e..5b45769 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 _0x9bde=['index','/describe','isAuthenticated','describe','/:id','show','download','post','fax','faxmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get'];(function(_0x3e59c8,_0x5ec82d){var _0x5a1273=function(_0x502dba){while(--_0x502dba){_0x3e59c8['push'](_0x3e59c8['shift']());}};_0x5a1273(++_0x5ec82d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x59630d,_0x49af34){_0x59630d=_0x59630d-0x0;var _0x3402ed=_0x9bde[_0x59630d];return _0x3402ed;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xe9bd('0xf')]);router[_0xe9bd('0x10')]('/',auth[_0xe9bd('0xb')](),interaction['tracked'](_0xe9bd('0x11'),_0xe9bd('0x12')),controller[_0xe9bd('0x13')]);router[_0xe9bd('0x14')]('/:id',auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x14')](_0xe9bd('0x15'),auth[_0xe9bd('0xb')](),controller['accept']);router['put'](_0xe9bd('0x16'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x17')]);router[_0xe9bd('0x18')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x19')]);module['exports']=router; \ No newline at end of file +var _0x44a3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','download','fax','create','put','update','/:id/accept','accept','reject','delete','exports'];(function(_0x7797fa,_0x26fc1c){var _0x5b6eec=function(_0x48e242){while(--_0x48e242){_0x7797fa['push'](_0x7797fa['shift']());}};_0x5b6eec(++_0x26fc1c);}(_0x44a3,0x1a9));var _0x344a=function(_0x3937b6,_0xd53d2b){_0x3937b6=_0x3937b6-0x0;var _0x1ba356=_0x44a3[_0x3937b6];return _0x1ba356;};'use strict';var multer=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var path=require(_0x344a('0x2'));var timeout=require(_0x344a('0x3'));var express=require(_0x344a('0x4'));var router=express[_0x344a('0x5')]();var fs_extra=require(_0x344a('0x6'));var auth=require(_0x344a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x344a('0x8'));var controller=require(_0x344a('0x9'));router[_0x344a('0xa')]('/',auth[_0x344a('0xb')](),controller[_0x344a('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x344a('0xa')](_0x344a('0xd'),auth[_0x344a('0xb')](),controller[_0x344a('0xe')]);router[_0x344a('0xa')]('/:id/download',auth[_0x344a('0xb')](),controller[_0x344a('0xf')]);router['post']('/',auth[_0x344a('0xb')](),interaction['tracked'](_0x344a('0x10'),'faxmessage:create'),controller[_0x344a('0x11')]);router[_0x344a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x344a('0x13')]);router[_0x344a('0x12')](_0x344a('0x14'),auth[_0x344a('0xb')](),controller[_0x344a('0x15')]);router[_0x344a('0x12')]('/:id/reject',auth[_0x344a('0xb')](),controller[_0x344a('0x16')]);router[_0x344a('0x17')](_0x344a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x344a('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index a80d3f8..1666afd 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 _0x50c1=['STRING','ENUM','beepall','INTEGER','sequelize'];(function(_0x3eb63b,_0x2824ea){var _0x108d39=function(_0x369ba2){while(--_0x369ba2){_0x3eb63b['push'](_0x3eb63b['shift']());}};_0x108d39(++_0x2824ea);}(_0x50c1,0x171));var _0x150c=function(_0x4e5967,_0x4f209d){_0x4e5967=_0x4e5967-0x0;var _0x2fc6df=_0x50c1[_0x4e5967];return _0x2fc6df;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize[_0x150c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x150c('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x150c('0x2')]('rrmemory',_0x150c('0x3'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x150c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x38b8=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x38b8,0x7b));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x838b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x838b('0x1')]},'timeout':{'type':Sequelize[_0x838b('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x838b('0x3')](_0x838b('0x4'),_0x838b('0x5'),_0x838b('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 4a9b5db..3e483d3 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 _0x7f44=['transaction','removeTeams','isEmpty','emit','addAgents','removeAgents','isArray','userFaxQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','FaxQueue','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','options','includeAll','findAll','include','merge','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','describe','rawAttributes','pick','FaxQueueId','UserFaxQueue','User','UserId','agent','faxPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','findOne','Team','hasOwnProperty','nolimit','addTeams','ids','online','voicePause','interface','sequelize','each','forEach','userFaxQueue:save','Agents','field','from','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value'];(function(_0x354fa9,_0x554970){var _0x2eae07=function(_0x5cdd61){while(--_0x5cdd61){_0x354fa9['push'](_0x354fa9['shift']());}};_0x2eae07(++_0x554970);}(_0x7f44,0x91));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47f4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47f4('0x1'));var rp=require(_0x47f4('0x2'));var moment=require(_0x47f4('0x3'));var BPromise=require(_0x47f4('0x4'));var Mustache=require(_0x47f4('0x5'));var util=require(_0x47f4('0x6'));var path=require('path');var sox=require(_0x47f4('0x7'));var csv=require(_0x47f4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47f4('0x9'));var _=require(_0x47f4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x47f4('0xb'));var deskjs=require(_0x47f4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x47f4('0xd'));var Redis=require('ioredis');var authService=require(_0x47f4('0xe'));var qs=require(_0x47f4('0xf'));var as=require(_0x47f4('0x10'));var hardwareService=require(_0x47f4('0x11'));var logger=require(_0x47f4('0x12'))(_0x47f4('0x13'));var utils=require('../../config/utils');var config=require(_0x47f4('0x14'));var licenseUtil=require(_0x47f4('0x15'));var db=require(_0x47f4('0x16'))['db'];config[_0x47f4('0x17')]=_['defaults'](config[_0x47f4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x47f4('0x18'))(new Redis(config[_0x47f4('0x17')]));require(_0x47f4('0x19'))[_0x47f4('0x1a')](socket);function respondWithStatusCode(_0x4047ba,_0x1c6f46){_0x1c6f46=_0x1c6f46||0xcc;return function(_0x1101c6){if(_0x1101c6){return _0x4047ba['sendStatus'](_0x1c6f46);}return _0x4047ba[_0x47f4('0x1b')](_0x1c6f46)[_0x47f4('0x1c')]();};}function respondWithResult(_0x561224,_0x50e377){_0x50e377=_0x50e377||0xc8;return function(_0x3bd671){if(_0x3bd671){return _0x561224['status'](_0x50e377)[_0x47f4('0x1d')](_0x3bd671);}};}function respondWithFilteredResult(_0x3e3a6d,_0x52c898){return function(_0x246ac9){if(_0x246ac9){var _0x1cf138=typeof _0x52c898[_0x47f4('0x1e')]===_0x47f4('0x1f')&&typeof _0x52c898[_0x47f4('0x20')]===_0x47f4('0x1f');var _0x2cf429=_0x246ac9[_0x47f4('0x21')];var _0x33fe73=_0x1cf138?0x0:_0x52c898[_0x47f4('0x1e')];var _0x25f96f=_0x1cf138?_0x246ac9[_0x47f4('0x21')]:_0x52c898[_0x47f4('0x1e')]+_0x52c898['limit'];var _0x31a230;if(_0x25f96f>=_0x2cf429){_0x25f96f=_0x2cf429;_0x31a230=0xc8;}else{_0x31a230=0xce;}_0x3e3a6d[_0x47f4('0x1b')](_0x31a230);return _0x3e3a6d[_0x47f4('0x22')](_0x47f4('0x23'),_0x33fe73+'-'+_0x25f96f+'/'+_0x2cf429)[_0x47f4('0x1d')](_0x246ac9);}return null;};}function patchUpdates(_0x48b5de){return function(_0x2de95f){try{jsonpatch[_0x47f4('0x24')](_0x2de95f,_0x48b5de,!![]);}catch(_0x4b008e){return BPromise[_0x47f4('0x25')](_0x4b008e);}return _0x2de95f['save']();};}function saveUpdates(_0x435507,_0x4618ce){return function(_0xd0ce81){if(_0xd0ce81){return _0xd0ce81['update'](_0x435507)[_0x47f4('0x26')](function(_0x50afb8){return _0x50afb8;});}return null;};}function removeEntity(_0x1bb676,_0x4c4ad4){return function(_0x45d039){if(_0x45d039){return _0x45d039['destroy']()[_0x47f4('0x26')](function(){var _0x375092=_0x45d039[_0x47f4('0x27')]({'plain':!![]});var _0x3408ed=_0x47f4('0x28');return db[_0x47f4('0x29')]['destroy']({'where':{'type':_0x3408ed,'resourceId':_0x375092['id']}})[_0x47f4('0x26')](function(){return _0x45d039;});})[_0x47f4('0x26')](function(){_0x1bb676[_0x47f4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0507,_0x32c5e4){return function(_0x55189b){if(!_0x55189b){_0x2c0507[_0x47f4('0x2a')](0x194);}return _0x55189b;};}function handleError(_0x419ac8,_0x29f8cc){_0x29f8cc=_0x29f8cc||0x1f4;return function(_0x57dd4b){logger[_0x47f4('0x2b')](_0x57dd4b[_0x47f4('0x2c')]);if(_0x57dd4b[_0x47f4('0x2d')]){delete _0x57dd4b[_0x47f4('0x2d')];}_0x419ac8[_0x47f4('0x1b')](_0x29f8cc)[_0x47f4('0x2e')](_0x57dd4b);};}exports[_0x47f4('0x2f')]=function(_0x562e92,_0x78f334){var _0x2054a6={},_0x10cb57={},_0x365d70={'count':0x0,'rows':[]};var _0x1f6864=_[_0x47f4('0x30')](db[_0x47f4('0x31')]['rawAttributes'],function(_0x4426e5){return{'name':_0x4426e5['fieldName'],'type':_0x4426e5['type'][_0x47f4('0x32')]};});_0x10cb57[_0x47f4('0x33')]=_[_0x47f4('0x30')](_0x1f6864,_0x47f4('0x2d'));_0x10cb57['query']=_[_0x47f4('0x34')](_0x562e92[_0x47f4('0x35')]);_0x10cb57[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x10cb57[_0x47f4('0x33')],_0x10cb57[_0x47f4('0x35')]);_0x2054a6[_0x47f4('0x38')]=_['intersection'](_0x10cb57['model'],qs['fields'](_0x562e92[_0x47f4('0x35')][_0x47f4('0x39')]));_0x2054a6['attributes']=_0x2054a6['attributes'][_0x47f4('0x3a')]?_0x2054a6[_0x47f4('0x38')]:_0x10cb57[_0x47f4('0x33')];if(!_0x562e92['query']['hasOwnProperty']('nolimit')){_0x2054a6['limit']=qs[_0x47f4('0x20')](_0x562e92[_0x47f4('0x35')]['limit']);_0x2054a6[_0x47f4('0x1e')]=qs['offset'](_0x562e92[_0x47f4('0x35')]['offset']);}_0x2054a6[_0x47f4('0x3b')]=qs[_0x47f4('0x3c')](_0x562e92[_0x47f4('0x35')][_0x47f4('0x3c')]);_0x2054a6[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_['pick'](_0x562e92['query'],_0x10cb57[_0x47f4('0x36')]),_0x1f6864);if(_0x562e92[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x2054a6[_0x47f4('0x3d')]=_['merge'](_0x2054a6[_0x47f4('0x3d')],{'$or':_[_0x47f4('0x30')](_0x1f6864,function(_0x153bd9){if(_0x153bd9['type']!==_0x47f4('0x3f')){var _0x2a537c={};_0x2a537c[_0x153bd9[_0x47f4('0x2d')]]={'$like':'%'+_0x562e92[_0x47f4('0x35')][_0x47f4('0x3e')]+'%'};return _0x2a537c;}})});}_0x2054a6=_['merge']({},_0x2054a6,_0x562e92[_0x47f4('0x40')]);var _0x121dbd={'where':_0x2054a6[_0x47f4('0x3d')]};return db[_0x47f4('0x31')][_0x47f4('0x21')](_0x121dbd)[_0x47f4('0x26')](function(_0x53954e){_0x365d70['count']=_0x53954e;if(_0x562e92[_0x47f4('0x35')][_0x47f4('0x41')]){_0x2054a6['include']=[{'all':!![]}];}return db['FaxQueue'][_0x47f4('0x42')](_0x2054a6);})['then'](function(_0x177afd){_0x365d70['rows']=_0x177afd;return _0x365d70;})[_0x47f4('0x26')](respondWithFilteredResult(_0x78f334,_0x2054a6))['catch'](handleError(_0x78f334,null));};exports['show']=function(_0x4be719,_0x1e879b){var _0x59c7ab={'raw':!![],'where':{'id':_0x4be719['params']['id']}},_0x274612={};_0x274612[_0x47f4('0x33')]=_[_0x47f4('0x34')](db[_0x47f4('0x31')]['rawAttributes']);_0x274612['query']=_[_0x47f4('0x34')](_0x4be719['query']);_0x274612[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x274612[_0x47f4('0x33')],_0x274612['query']);_0x59c7ab[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x274612[_0x47f4('0x33')],qs[_0x47f4('0x39')](_0x4be719[_0x47f4('0x35')][_0x47f4('0x39')]));_0x59c7ab[_0x47f4('0x38')]=_0x59c7ab['attributes'][_0x47f4('0x3a')]?_0x59c7ab['attributes']:_0x274612[_0x47f4('0x33')];if(_0x4be719[_0x47f4('0x35')][_0x47f4('0x41')]){_0x59c7ab[_0x47f4('0x43')]=[{'all':!![]}];}_0x59c7ab=_[_0x47f4('0x44')]({},_0x59c7ab,_0x4be719[_0x47f4('0x40')]);return db[_0x47f4('0x31')][_0x47f4('0x45')](_0x59c7ab)[_0x47f4('0x26')](handleEntityNotFound(_0x1e879b,null))[_0x47f4('0x26')](respondWithResult(_0x1e879b,null))[_0x47f4('0x46')](handleError(_0x1e879b,null));};exports['create']=function(_0x23ae53,_0x145285){return db['FaxQueue'][_0x47f4('0x47')](_0x23ae53['body'],{})[_0x47f4('0x26')](function(_0x1acab9){var _0x4e0109=_0x23ae53[_0x47f4('0x48')][_0x47f4('0x27')]({'plain':!![]});if(!_0x4e0109)throw new Error(_0x47f4('0x49'));if(_0x4e0109[_0x47f4('0x4a')]==='user'){var _0x240136=_0x1acab9[_0x47f4('0x27')]({'plain':!![]});var _0x5de4bd='FaxQueues';return db[_0x47f4('0x4b')][_0x47f4('0x45')]({'where':{'name':_0x5de4bd,'userProfileId':_0x4e0109[_0x47f4('0x4c')]},'raw':!![]})[_0x47f4('0x26')](function(_0x2c6ff0){if(_0x2c6ff0&&_0x2c6ff0['autoAssociation']===0x0){return db[_0x47f4('0x29')][_0x47f4('0x47')]({'name':_0x240136['name'],'resourceId':_0x240136['id'],'type':_0x2c6ff0['name'],'sectionId':_0x2c6ff0['id']},{})[_0x47f4('0x26')](function(){return _0x1acab9;});}else{return _0x1acab9;}})[_0x47f4('0x46')](function(_0x474238){logger['error'](_0x47f4('0x4d'),_0x474238);throw _0x474238;});}return _0x1acab9;})[_0x47f4('0x26')](respondWithResult(_0x145285,0xc9))[_0x47f4('0x46')](handleError(_0x145285,null));};exports[_0x47f4('0x4e')]=function(_0x4d27ca,_0x3286f6){if(_0x4d27ca[_0x47f4('0x4f')]['id']){delete _0x4d27ca[_0x47f4('0x4f')]['id'];}return db[_0x47f4('0x31')][_0x47f4('0x45')]({'where':{'id':_0x4d27ca[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x3286f6,null))['then'](saveUpdates(_0x4d27ca[_0x47f4('0x4f')],null))[_0x47f4('0x26')](respondWithResult(_0x3286f6,null))[_0x47f4('0x46')](handleError(_0x3286f6,null));};exports[_0x47f4('0x51')]=function(_0x13df53,_0x4cf0c4){return db['FaxQueue'][_0x47f4('0x45')]({'where':{'id':_0x13df53[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x4cf0c4,null))['then'](removeEntity(_0x4cf0c4,null))['catch'](handleError(_0x4cf0c4,null));};exports[_0x47f4('0x52')]=function(_0x3c2ca1,_0x58960e){return db[_0x47f4('0x31')][_0x47f4('0x52')]()[_0x47f4('0x26')](respondWithResult(_0x58960e,null))[_0x47f4('0x46')](handleError(_0x58960e,null));};exports['getMembers']=function(_0x248c76,_0x320dd0,_0x303a96){var _0x3866de={'raw':!![],'where':{}},_0x4fc5ae={},_0x53ac83;return db[_0x47f4('0x31')]['findOne']({'where':{'id':_0x248c76['params']['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x320dd0,null))[_0x47f4('0x26')](function(_0x14065d){if(_0x14065d){_0x53ac83=_0x14065d[_0x47f4('0x27')]({'plain':!![]});_0x4fc5ae['model']=_['keys'](db['UserFaxQueue'][_0x47f4('0x53')]);_0x4fc5ae['query']=_['keys'](_0x248c76[_0x47f4('0x35')]);_0x4fc5ae[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x4fc5ae['model'],_0x4fc5ae[_0x47f4('0x35')]);_0x3866de[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x4fc5ae[_0x47f4('0x33')],qs['fields'](_0x248c76[_0x47f4('0x35')]['fields']));_0x3866de[_0x47f4('0x38')]=_0x3866de[_0x47f4('0x38')]['length']?_0x3866de[_0x47f4('0x38')]:_0x4fc5ae['model'];if(!_0x248c76[_0x47f4('0x35')]['hasOwnProperty']('nolimit')){_0x3866de[_0x47f4('0x20')]=qs[_0x47f4('0x20')](_0x248c76[_0x47f4('0x35')][_0x47f4('0x20')]);_0x3866de[_0x47f4('0x1e')]=qs[_0x47f4('0x1e')](_0x248c76[_0x47f4('0x35')]['offset']);}_0x3866de[_0x47f4('0x3b')]=qs[_0x47f4('0x3c')](_0x248c76[_0x47f4('0x35')][_0x47f4('0x3c')]);_0x3866de[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_[_0x47f4('0x54')](_0x248c76[_0x47f4('0x35')],_0x4fc5ae[_0x47f4('0x36')]));_0x3866de['where'][_0x47f4('0x55')]=_0x14065d['id'];if(_0x248c76[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x3866de[_0x47f4('0x3d')]=_[_0x47f4('0x44')](_0x3866de[_0x47f4('0x3d')],{'$or':_[_0x47f4('0x30')](_0x3866de[_0x47f4('0x38')],function(_0x495c85){var _0x4340f5={};_0x4340f5[_0x495c85]={'$like':'%'+_0x248c76[_0x47f4('0x35')]['filter']+'%'};return _0x4340f5;})});}_0x3866de=_[_0x47f4('0x44')]({},_0x3866de,_0x248c76[_0x47f4('0x40')]);return db[_0x47f4('0x56')][_0x47f4('0x42')](_0x3866de);}})[_0x47f4('0x26')](function(_0x1148e1){if(_0x1148e1){return db[_0x47f4('0x57')]['findAndCountAll']({'where':{'id':_[_0x47f4('0x30')](_0x1148e1,_0x47f4('0x58')),'role':_0x47f4('0x59')},'attributes':['id','name',_0x47f4('0x5a'),_0x47f4('0x5b'),_0x47f4('0x5c')]});}})[_0x47f4('0x26')](function(_0x87862a){if(_0x87862a){return{'count':_0x87862a[_0x47f4('0x21')],'rows':_[_0x47f4('0x30')](_0x87862a[_0x47f4('0x5d')],function(_0x253b51){return{'membername':_0x253b51[_0x47f4('0x2d')],'UserId':_0x253b51['id'],'queue_name':_0x53ac83[_0x47f4('0x2d')],'FaxQueueId':_0x53ac83['id'],'interface':util['format'](_0x47f4('0x5e'),_0x47f4('0x5f'),_0x253b51[_0x47f4('0x2d')]),'penalty':0x0,'paused':_0x253b51['faxPause'],'createdAt':_0x253b51['createdAt'],'updatedAt':_0x253b51['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x320dd0,_0x3866de))[_0x47f4('0x46')](handleError(_0x320dd0,null));};exports[_0x47f4('0x60')]=function(_0x17c7f9,_0x4c4280,_0x89abcc){var _0x43eb88={};var _0x13a26d={};var _0x371936;var _0x5280d2;return db[_0x47f4('0x31')][_0x47f4('0x61')]({'where':{'id':_0x17c7f9[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x4c4280,null))[_0x47f4('0x26')](function(_0x266855){if(_0x266855){_0x371936=_0x266855;_0x13a26d[_0x47f4('0x33')]=_[_0x47f4('0x34')](db[_0x47f4('0x62')]['rawAttributes']);_0x13a26d['query']=_[_0x47f4('0x34')](_0x17c7f9[_0x47f4('0x35')]);_0x13a26d[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x13a26d[_0x47f4('0x33')],_0x13a26d['query']);_0x43eb88[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x13a26d[_0x47f4('0x33')],qs[_0x47f4('0x39')](_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x39')]));_0x43eb88[_0x47f4('0x38')]=_0x43eb88['attributes'][_0x47f4('0x3a')]?_0x43eb88[_0x47f4('0x38')]:_0x13a26d[_0x47f4('0x33')];_0x43eb88[_0x47f4('0x3b')]=qs['sort'](_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x3c')]);_0x43eb88[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_[_0x47f4('0x54')](_0x17c7f9[_0x47f4('0x35')],_0x13a26d['filters']));if(_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x43eb88['where']=_[_0x47f4('0x44')](_0x43eb88['where'],{'$or':_[_0x47f4('0x30')](_0x43eb88[_0x47f4('0x38')],function(_0x5105a7){var _0x46bcf6={};_0x46bcf6[_0x5105a7]={'$like':'%'+_0x17c7f9[_0x47f4('0x35')]['filter']+'%'};return _0x46bcf6;})});}_0x43eb88=_[_0x47f4('0x44')]({},_0x43eb88,_0x17c7f9['options']);return _0x371936['getTeams'](_0x43eb88);}})['then'](function(_0x2352c2){if(_0x2352c2){_0x5280d2=_0x2352c2[_0x47f4('0x3a')];if(!_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x63')](_0x47f4('0x64'))){_0x43eb88[_0x47f4('0x20')]=qs[_0x47f4('0x20')](_0x17c7f9[_0x47f4('0x35')]['limit']);_0x43eb88['offset']=qs[_0x47f4('0x1e')](_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x1e')]);}return _0x371936[_0x47f4('0x60')](_0x43eb88);}})[_0x47f4('0x26')](function(_0x5719be){if(_0x5719be){return _0x5719be?{'count':_0x5280d2,'rows':_0x5719be}:null;}})[_0x47f4('0x26')](respondWithResult(_0x4c4280,null))[_0x47f4('0x46')](handleError(_0x4c4280,null));};exports[_0x47f4('0x65')]=function(_0x1cf3c3,_0xe1b13a,_0x3f5c99){var _0x2abd6d=_0x1cf3c3[_0x47f4('0x4f')][_0x47f4('0x66')];return db['Team']['findAll']({'where':{'id':_0x2abd6d},'attributes':['id'],'include':[{'model':db[_0x47f4('0x57')],'as':'Agents','attributes':['id',_0x47f4('0x2d'),_0x47f4('0x67'),_0x47f4('0x68'),_0x47f4('0x69')],'raw':!![]}]})[_0x47f4('0x26')](function(_0x379a8a){if(_0x379a8a){var _0x1c5fec=_['flatMap'](_0x379a8a,function(_0x32f3bf){var _0x2b8fd6=_0x32f3bf[_0x47f4('0x27')]({'plain':!![]});return _0x2b8fd6['Agents'];});return db[_0x47f4('0x31')][_0x47f4('0x45')]({'where':{'id':_0x1cf3c3[_0x47f4('0x50')]['id']}})['then'](function(_0x2f44f3){return db[_0x47f4('0x6a')]['transaction'](function(_0x193c68){return _0x2f44f3[_0x47f4('0x65')](_0x2abd6d,{'transaction':_0x193c68})['then'](function(){return BPromise[_0x47f4('0x6b')](_0x1c5fec,function(_0x1b98ea){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x1b98ea['id'],'FaxQueueId':_0x1cf3c3[_0x47f4('0x50')]['id']},'transaction':_0x193c68});});})[_0x47f4('0x26')](function(){_0x1c5fec[_0x47f4('0x6c')](function(_0x1757e7){socket['emit'](_0x47f4('0x6d'),{'UserId':_0x1757e7['id'],'FaxQueueId':_0x2f44f3['id']});});});});});}})[_0x47f4('0x26')](respondWithStatusCode(_0xe1b13a,null))[_0x47f4('0x46')](handleError(_0xe1b13a,null));};exports['removeTeams']=function(_0x3a6864,_0x1757e6,_0xd0151c){return db[_0x47f4('0x62')][_0x47f4('0x42')]({'where':{'id':_0x3a6864[_0x47f4('0x35')][_0x47f4('0x66')]},'attributes':['id'],'include':[{'model':db[_0x47f4('0x57')],'as':_0x47f4('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x47f4('0x26')](handleEntityNotFound(_0x1757e6,null))[_0x47f4('0x26')](function(_0x48a323){var _0x26f953=_[_0x47f4('0x30')](_0x48a323,'id');var _0xcfe9ec=[];var _0x13c3de=[];var _0x4a5937=squel['select']();_0x4a5937[_0x47f4('0x6f')]('tq.TeamId')[_0x47f4('0x70')]('team_has_fax_queues','tq')[_0x47f4('0x71')]('user_has_teams','ut',_0x47f4('0x72'))[_0x47f4('0x3d')](_0x47f4('0x73'),_0x3a6864[_0x47f4('0x50')]['id']);for(var _0x25f23f=0x0;_0x25f23f<_0x48a323[_0x47f4('0x3a')];_0x25f23f+=0x1){let _0x22522f=_0x48a323[_0x25f23f];for(var _0x50da1f=0x0;_0x50da1f<_0x22522f[_0x47f4('0x6e')][_0x47f4('0x3a')];_0x50da1f+=0x1){let _0x8efeb9=_0x22522f[_0x47f4('0x6e')][_0x50da1f];var _0x181976=_0x4a5937[_0x47f4('0x74')]();_0x181976[_0x47f4('0x3d')](_0x47f4('0x75'),_0x8efeb9['id']);_0x13c3de['push'](db[_0x47f4('0x6a')][_0x47f4('0x35')](_0x181976['toString'](),{'type':db[_0x47f4('0x6a')][_0x47f4('0x76')][_0x47f4('0x77')]})[_0x47f4('0x26')](function(_0x3f0be3){if(_0x3f0be3[_0x47f4('0x3a')]===0x1){return _0x8efeb9['id'];}else{var _0xb4a643=_[_0x47f4('0x78')](_['map'](_0x3f0be3,_0x47f4('0x79')),function(_0x4037c5){return _[_0x47f4('0x7a')](_0x26f953,_0x4037c5);});if(_0xb4a643){return _0x8efeb9['id'];}}}));}}return BPromise[_0x47f4('0x7b')](_0x13c3de)[_0x47f4('0x26')](function(_0x4678ec){_0xcfe9ec=_(_0xcfe9ec)[_0x47f4('0x7c')](_0x4678ec)[_0x47f4('0x7d')]()[_0x47f4('0x7e')]();return db['FaxQueue']['find']({'where':{'id':_0x3a6864[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](function(_0x4cd865){return db[_0x47f4('0x6a')][_0x47f4('0x7f')](function(_0x418f2c){return _0x4cd865[_0x47f4('0x80')](_0x3a6864[_0x47f4('0x35')]['ids'],{'transaction':_0x418f2c})['then'](function(){if(!_[_0x47f4('0x81')](_0xcfe9ec)){return _0x4cd865['removeAgents'](_0xcfe9ec,{'transaction':_0x418f2c});}})[_0x47f4('0x26')](function(){_0xcfe9ec[_0x47f4('0x6c')](function(_0x167532){socket[_0x47f4('0x82')]('userFaxQueue:remove',{'UserId':_0x167532,'FaxQueueId':_0x4cd865['id']});});});});});});})['then'](respondWithStatusCode(_0x1757e6,null))['catch'](handleError(_0x1757e6,null));};exports[_0x47f4('0x83')]=function(_0x27ddd5,_0x3a045,_0x543db1){return db[_0x47f4('0x31')][_0x47f4('0x45')]({'where':{'id':_0x27ddd5[_0x47f4('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a045,null))['then'](function(_0x2c5eb5){if(_0x2c5eb5){return _0x2c5eb5[_0x47f4('0x83')](_0x27ddd5[_0x47f4('0x4f')][_0x47f4('0x66')],_['omit'](_0x27ddd5[_0x47f4('0x4f')],['ids','id'])||{})['spread'](function(_0xb6c107){for(var _0x52cb03=0x0;_0x52cb03<_0x27ddd5[_0x47f4('0x4f')][_0x47f4('0x66')]['length'];_0x52cb03+=0x1){socket[_0x47f4('0x82')](_0x47f4('0x6d'),{'UserId':Number(_0x27ddd5[_0x47f4('0x4f')][_0x47f4('0x66')][_0x52cb03]),'FaxQueueId':Number(_0x27ddd5[_0x47f4('0x50')]['id'])});}return _0xb6c107;});}})[_0x47f4('0x26')](respondWithResult(_0x3a045,null))['catch'](handleError(_0x3a045,null));};exports[_0x47f4('0x84')]=function(_0x58be66,_0xc95923,_0x5e54d5){return db['FaxQueue'][_0x47f4('0x45')]({'where':{'id':_0x58be66[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0xc95923,null))['then'](function(_0x4ebea5){if(_0x4ebea5){return _0x4ebea5[_0x47f4('0x84')](_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')])['then'](function(){if(_[_0x47f4('0x85')](_0x58be66['query']['ids'])){for(var _0x4bd33b=0x0;_0x4bd33b<_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')][_0x47f4('0x3a')];_0x4bd33b+=0x1){socket[_0x47f4('0x82')](_0x47f4('0x86'),{'UserId':Number(_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')][_0x4bd33b]),'FaxQueueId':Number(_0x58be66[_0x47f4('0x50')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')]),'FaxQueueId':Number(_0x58be66[_0x47f4('0x50')]['id'])});}});}})[_0x47f4('0x26')](respondWithStatusCode(_0xc95923,null))[_0x47f4('0x46')](handleError(_0xc95923,null));};exports[_0x47f4('0x87')]=function(_0x22d7ec,_0x31d418,_0x2761b5){var _0x450096={};var _0x432dff={};var _0x5b5aef;var _0x16a7c3;return db[_0x47f4('0x31')][_0x47f4('0x61')]({'where':{'id':_0x22d7ec[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x31d418,null))[_0x47f4('0x26')](function(_0x18b0a3){if(_0x18b0a3){_0x5b5aef=_0x18b0a3;_0x432dff['model']=_[_0x47f4('0x34')](db[_0x47f4('0x57')][_0x47f4('0x53')]);_0x432dff[_0x47f4('0x35')]=_['keys'](_0x22d7ec[_0x47f4('0x35')]);_0x432dff[_0x47f4('0x36')]=_['intersection'](_0x432dff['model'],_0x432dff[_0x47f4('0x35')]);_0x450096[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x432dff[_0x47f4('0x33')],qs[_0x47f4('0x39')](_0x22d7ec[_0x47f4('0x35')]['fields']));_0x450096[_0x47f4('0x38')]=_0x450096[_0x47f4('0x38')][_0x47f4('0x3a')]?_0x450096[_0x47f4('0x38')]:_0x432dff[_0x47f4('0x33')];_0x450096[_0x47f4('0x3b')]=qs['sort'](_0x22d7ec[_0x47f4('0x35')]['sort']);_0x450096[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_[_0x47f4('0x54')](_0x22d7ec[_0x47f4('0x35')],_0x432dff[_0x47f4('0x36')]));if(_0x22d7ec[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x450096[_0x47f4('0x3d')]=_[_0x47f4('0x44')](_0x450096[_0x47f4('0x3d')],{'$or':_[_0x47f4('0x30')](_0x450096['attributes'],function(_0x204cd5){var _0x5b2d8a={};_0x5b2d8a[_0x204cd5]={'$like':'%'+_0x22d7ec[_0x47f4('0x35')][_0x47f4('0x3e')]+'%'};return _0x5b2d8a;})});}_0x450096=_[_0x47f4('0x44')]({},_0x450096,_0x22d7ec['options']);return _0x5b5aef[_0x47f4('0x87')](_0x450096);}})[_0x47f4('0x26')](function(_0x5f1103){if(_0x5f1103){_0x16a7c3=_0x5f1103[_0x47f4('0x3a')];if(!_0x22d7ec['query'][_0x47f4('0x63')](_0x47f4('0x64'))){_0x450096[_0x47f4('0x20')]=qs[_0x47f4('0x20')](_0x22d7ec['query'][_0x47f4('0x20')]);_0x450096['offset']=qs[_0x47f4('0x1e')](_0x22d7ec[_0x47f4('0x35')][_0x47f4('0x1e')]);}return _0x5b5aef[_0x47f4('0x87')](_0x450096);}})['then'](function(_0x5abb71){if(_0x5abb71){return _0x5abb71?{'count':_0x16a7c3,'rows':_0x5abb71}:null;}})[_0x47f4('0x26')](respondWithResult(_0x31d418,null))[_0x47f4('0x46')](handleError(_0x31d418,null));}; \ No newline at end of file +var _0xa1da=['getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','end','status','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','index','FaxQueue','rawAttributes','fieldName','type','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','order','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','sort','FaxQueueId','findAll','User','agent','faxPause','updatedAt','createdAt','format','%s/%s'];(function(_0x3e4a79,_0x46f38c){var _0x364444=function(_0x1eb936){while(--_0x1eb936){_0x3e4a79['push'](_0x3e4a79['shift']());}};_0x364444(++_0x46f38c);}(_0xa1da,0xab));var _0xaa1d=function(_0x161ab6,_0x51ee5c){_0x161ab6=_0x161ab6-0x0;var _0x437d12=_0xa1da[_0x161ab6];return _0x437d12;};'use strict';var emlformat=require(_0xaa1d('0x0'));var rimraf=require(_0xaa1d('0x1'));var zipdir=require(_0xaa1d('0x2'));var jsonpatch=require(_0xaa1d('0x3'));var rp=require('request-promise');var moment=require(_0xaa1d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa1d('0x5'));var path=require(_0xaa1d('0x6'));var sox=require(_0xaa1d('0x7'));var csv=require(_0xaa1d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa1d('0x9'));var squel=require('squel');var crypto=require(_0xaa1d('0xa'));var jsforce=require(_0xaa1d('0xb'));var deskjs=require(_0xaa1d('0xc'));var toCsv=require(_0xaa1d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaa1d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xaa1d('0xe'));var as=require(_0xaa1d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa1d('0x10'))(_0xaa1d('0x11'));var utils=require(_0xaa1d('0x12'));var config=require(_0xaa1d('0x13'));var licenseUtil=require(_0xaa1d('0x14'));var db=require('../../mysqldb')['db'];config[_0xaa1d('0x15')]=_[_0xaa1d('0x16')](config['redis'],{'host':_0xaa1d('0x17'),'port':0x18eb});var socket=require(_0xaa1d('0x18'))(new Redis(config[_0xaa1d('0x15')]));require(_0xaa1d('0x19'))['register'](socket);function respondWithStatusCode(_0x5be084,_0x2b3100){_0x2b3100=_0x2b3100||0xcc;return function(_0x5e8b9d){if(_0x5e8b9d){return _0x5be084['sendStatus'](_0x2b3100);}return _0x5be084['status'](_0x2b3100)[_0xaa1d('0x1a')]();};}function respondWithResult(_0x212e9a,_0x50cd8b){_0x50cd8b=_0x50cd8b||0xc8;return function(_0x154b5e){if(_0x154b5e){return _0x212e9a[_0xaa1d('0x1b')](_0x50cd8b)[_0xaa1d('0x1c')](_0x154b5e);}};}function respondWithFilteredResult(_0x3f1fd9,_0x41527b){return function(_0x4821af){if(_0x4821af){var _0x5981b1=typeof _0x41527b['offset']==='undefined'&&typeof _0x41527b[_0xaa1d('0x1d')]===_0xaa1d('0x1e');var _0x2ee025=_0x4821af[_0xaa1d('0x1f')];var _0x12e33f=_0x5981b1?0x0:_0x41527b[_0xaa1d('0x20')];var _0xdd92e8=_0x5981b1?_0x4821af[_0xaa1d('0x1f')]:_0x41527b['offset']+_0x41527b['limit'];var _0x3114f0;if(_0xdd92e8>=_0x2ee025){_0xdd92e8=_0x2ee025;_0x3114f0=0xc8;}else{_0x3114f0=0xce;}_0x3f1fd9['status'](_0x3114f0);return _0x3f1fd9['set']('Content-Range',_0x12e33f+'-'+_0xdd92e8+'/'+_0x2ee025)[_0xaa1d('0x1c')](_0x4821af);}return null;};}function patchUpdates(_0x5b900a){return function(_0x1d25ac){try{jsonpatch[_0xaa1d('0x21')](_0x1d25ac,_0x5b900a,!![]);}catch(_0x13d68b){return BPromise[_0xaa1d('0x22')](_0x13d68b);}return _0x1d25ac[_0xaa1d('0x23')]();};}function saveUpdates(_0x13da7,_0x4f5a6f){return function(_0x3617c6){if(_0x3617c6){return _0x3617c6[_0xaa1d('0x24')](_0x13da7)[_0xaa1d('0x25')](function(_0x28b59d){return _0x28b59d;});}return null;};}function removeEntity(_0x692aee,_0x4d7983){return function(_0x3f4f41){if(_0x3f4f41){return _0x3f4f41[_0xaa1d('0x26')]()['then'](function(){var _0x30976d=_0x3f4f41[_0xaa1d('0x27')]({'plain':!![]});var _0x41a537='FaxQueues';return db[_0xaa1d('0x28')]['destroy']({'where':{'type':_0x41a537,'resourceId':_0x30976d['id']}})[_0xaa1d('0x25')](function(){return _0x3f4f41;});})['then'](function(){_0x692aee['status'](0xcc)[_0xaa1d('0x1a')]();});}};}function handleEntityNotFound(_0x38af3c,_0x361adf){return function(_0x192372){if(!_0x192372){_0x38af3c[_0xaa1d('0x29')](0x194);}return _0x192372;};}function handleError(_0x4b663e,_0x4b58d0){_0x4b58d0=_0x4b58d0||0x1f4;return function(_0x5b2b77){logger['error'](_0x5b2b77[_0xaa1d('0x2a')]);if(_0x5b2b77[_0xaa1d('0x2b')]){delete _0x5b2b77['name'];}_0x4b663e[_0xaa1d('0x1b')](_0x4b58d0)['send'](_0x5b2b77);};}exports[_0xaa1d('0x2c')]=function(_0x3b03d2,_0x1afaec){var _0x304d63={},_0x566451={},_0x5bc1a5={'count':0x0,'rows':[]};var _0x5e2f05=_['map'](db[_0xaa1d('0x2d')][_0xaa1d('0x2e')],function(_0x3a70b2){return{'name':_0x3a70b2[_0xaa1d('0x2f')],'type':_0x3a70b2[_0xaa1d('0x30')]['key']};});_0x566451[_0xaa1d('0x31')]=_[_0xaa1d('0x32')](_0x5e2f05,_0xaa1d('0x2b'));_0x566451['query']=_[_0xaa1d('0x33')](_0x3b03d2[_0xaa1d('0x34')]);_0x566451[_0xaa1d('0x35')]=_['intersection'](_0x566451[_0xaa1d('0x31')],_0x566451[_0xaa1d('0x34')]);_0x304d63['attributes']=_['intersection'](_0x566451[_0xaa1d('0x31')],qs['fields'](_0x3b03d2[_0xaa1d('0x34')][_0xaa1d('0x36')]));_0x304d63[_0xaa1d('0x37')]=_0x304d63['attributes'][_0xaa1d('0x38')]?_0x304d63['attributes']:_0x566451[_0xaa1d('0x31')];if(!_0x3b03d2[_0xaa1d('0x34')][_0xaa1d('0x39')]('nolimit')){_0x304d63[_0xaa1d('0x1d')]=qs['limit'](_0x3b03d2[_0xaa1d('0x34')]['limit']);_0x304d63[_0xaa1d('0x20')]=qs[_0xaa1d('0x20')](_0x3b03d2[_0xaa1d('0x34')][_0xaa1d('0x20')]);}_0x304d63[_0xaa1d('0x3a')]=qs['sort'](_0x3b03d2[_0xaa1d('0x34')]['sort']);_0x304d63['where']=qs[_0xaa1d('0x35')](_[_0xaa1d('0x3b')](_0x3b03d2[_0xaa1d('0x34')],_0x566451[_0xaa1d('0x35')]),_0x5e2f05);if(_0x3b03d2[_0xaa1d('0x34')]['filter']){_0x304d63[_0xaa1d('0x3c')]=_[_0xaa1d('0x3d')](_0x304d63[_0xaa1d('0x3c')],{'$or':_['map'](_0x5e2f05,function(_0x381b48){if(_0x381b48[_0xaa1d('0x30')]!==_0xaa1d('0x3e')){var _0x25da31={};_0x25da31[_0x381b48[_0xaa1d('0x2b')]]={'$like':'%'+_0x3b03d2[_0xaa1d('0x34')][_0xaa1d('0x3f')]+'%'};return _0x25da31;}})});}_0x304d63=_[_0xaa1d('0x3d')]({},_0x304d63,_0x3b03d2[_0xaa1d('0x40')]);var _0x492b94={'where':_0x304d63['where']};return db['FaxQueue']['count'](_0x492b94)[_0xaa1d('0x25')](function(_0x54050d){_0x5bc1a5['count']=_0x54050d;if(_0x3b03d2[_0xaa1d('0x34')][_0xaa1d('0x41')]){_0x304d63[_0xaa1d('0x42')]=[{'all':!![]}];}return db[_0xaa1d('0x2d')]['findAll'](_0x304d63);})[_0xaa1d('0x25')](function(_0x31c502){_0x5bc1a5[_0xaa1d('0x43')]=_0x31c502;return _0x5bc1a5;})['then'](respondWithFilteredResult(_0x1afaec,_0x304d63))[_0xaa1d('0x44')](handleError(_0x1afaec,null));};exports['show']=function(_0x3c37ea,_0x5dd9cc){var _0x57a51f={'raw':!![],'where':{'id':_0x3c37ea[_0xaa1d('0x45')]['id']}},_0x3fa40f={};_0x3fa40f[_0xaa1d('0x31')]=_[_0xaa1d('0x33')](db['FaxQueue']['rawAttributes']);_0x3fa40f['query']=_[_0xaa1d('0x33')](_0x3c37ea[_0xaa1d('0x34')]);_0x3fa40f[_0xaa1d('0x35')]=_['intersection'](_0x3fa40f[_0xaa1d('0x31')],_0x3fa40f[_0xaa1d('0x34')]);_0x57a51f[_0xaa1d('0x37')]=_[_0xaa1d('0x46')](_0x3fa40f['model'],qs['fields'](_0x3c37ea[_0xaa1d('0x34')][_0xaa1d('0x36')]));_0x57a51f[_0xaa1d('0x37')]=_0x57a51f[_0xaa1d('0x37')][_0xaa1d('0x38')]?_0x57a51f[_0xaa1d('0x37')]:_0x3fa40f[_0xaa1d('0x31')];if(_0x3c37ea[_0xaa1d('0x34')][_0xaa1d('0x41')]){_0x57a51f[_0xaa1d('0x42')]=[{'all':!![]}];}_0x57a51f=_[_0xaa1d('0x3d')]({},_0x57a51f,_0x3c37ea[_0xaa1d('0x40')]);return db['FaxQueue']['find'](_0x57a51f)['then'](handleEntityNotFound(_0x5dd9cc,null))['then'](respondWithResult(_0x5dd9cc,null))[_0xaa1d('0x44')](handleError(_0x5dd9cc,null));};exports[_0xaa1d('0x47')]=function(_0x38b362,_0x3bf92d){return db[_0xaa1d('0x2d')]['create'](_0x38b362[_0xaa1d('0x48')],{})[_0xaa1d('0x25')](function(_0x299521){var _0x654749=_0x38b362[_0xaa1d('0x49')][_0xaa1d('0x27')]({'plain':!![]});if(!_0x654749)throw new Error(_0xaa1d('0x4a'));if(_0x654749[_0xaa1d('0x4b')]===_0xaa1d('0x49')){var _0x2b176e=_0x299521[_0xaa1d('0x27')]({'plain':!![]});var _0x3b0b8b=_0xaa1d('0x4c');return db[_0xaa1d('0x4d')][_0xaa1d('0x4e')]({'where':{'name':_0x3b0b8b,'userProfileId':_0x654749[_0xaa1d('0x4f')]},'raw':!![]})[_0xaa1d('0x25')](function(_0x1219f9){if(_0x1219f9&&_0x1219f9['autoAssociation']===0x0){return db[_0xaa1d('0x28')][_0xaa1d('0x47')]({'name':_0x2b176e['name'],'resourceId':_0x2b176e['id'],'type':_0x1219f9['name'],'sectionId':_0x1219f9['id']},{})[_0xaa1d('0x25')](function(){return _0x299521;});}else{return _0x299521;}})[_0xaa1d('0x44')](function(_0x24934e){logger[_0xaa1d('0x50')](_0xaa1d('0x51'),_0x24934e);throw _0x24934e;});}return _0x299521;})[_0xaa1d('0x25')](respondWithResult(_0x3bf92d,0xc9))[_0xaa1d('0x44')](handleError(_0x3bf92d,null));};exports[_0xaa1d('0x24')]=function(_0x287206,_0x27c30b){if(_0x287206[_0xaa1d('0x48')]['id']){delete _0x287206[_0xaa1d('0x48')]['id'];}return db[_0xaa1d('0x2d')][_0xaa1d('0x4e')]({'where':{'id':_0x287206[_0xaa1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x27c30b,null))[_0xaa1d('0x25')](saveUpdates(_0x287206[_0xaa1d('0x48')],null))[_0xaa1d('0x25')](respondWithResult(_0x27c30b,null))[_0xaa1d('0x44')](handleError(_0x27c30b,null));};exports[_0xaa1d('0x26')]=function(_0x2004eb,_0x324461){return db[_0xaa1d('0x2d')]['find']({'where':{'id':_0x2004eb[_0xaa1d('0x45')]['id']}})[_0xaa1d('0x25')](handleEntityNotFound(_0x324461,null))[_0xaa1d('0x25')](removeEntity(_0x324461,null))[_0xaa1d('0x44')](handleError(_0x324461,null));};exports[_0xaa1d('0x52')]=function(_0x2e160e,_0x33b6c1){return db['FaxQueue']['describe']()[_0xaa1d('0x25')](respondWithResult(_0x33b6c1,null))[_0xaa1d('0x44')](handleError(_0x33b6c1,null));};exports[_0xaa1d('0x53')]=function(_0x2e13cc,_0x4bbdb7,_0x4fae0c){var _0x5b2b26={'raw':!![],'where':{}},_0x144a63={},_0x19fa0e;return db[_0xaa1d('0x2d')][_0xaa1d('0x54')]({'where':{'id':_0x2e13cc[_0xaa1d('0x45')]['id']}})[_0xaa1d('0x25')](handleEntityNotFound(_0x4bbdb7,null))[_0xaa1d('0x25')](function(_0x4156dc){if(_0x4156dc){_0x19fa0e=_0x4156dc[_0xaa1d('0x27')]({'plain':!![]});_0x144a63[_0xaa1d('0x31')]=_[_0xaa1d('0x33')](db[_0xaa1d('0x55')][_0xaa1d('0x2e')]);_0x144a63[_0xaa1d('0x34')]=_[_0xaa1d('0x33')](_0x2e13cc[_0xaa1d('0x34')]);_0x144a63[_0xaa1d('0x35')]=_[_0xaa1d('0x46')](_0x144a63[_0xaa1d('0x31')],_0x144a63[_0xaa1d('0x34')]);_0x5b2b26['attributes']=_[_0xaa1d('0x46')](_0x144a63[_0xaa1d('0x31')],qs['fields'](_0x2e13cc[_0xaa1d('0x34')][_0xaa1d('0x36')]));_0x5b2b26[_0xaa1d('0x37')]=_0x5b2b26[_0xaa1d('0x37')][_0xaa1d('0x38')]?_0x5b2b26['attributes']:_0x144a63[_0xaa1d('0x31')];if(!_0x2e13cc[_0xaa1d('0x34')]['hasOwnProperty'](_0xaa1d('0x56'))){_0x5b2b26[_0xaa1d('0x1d')]=qs[_0xaa1d('0x1d')](_0x2e13cc[_0xaa1d('0x34')][_0xaa1d('0x1d')]);_0x5b2b26[_0xaa1d('0x20')]=qs[_0xaa1d('0x20')](_0x2e13cc[_0xaa1d('0x34')]['offset']);}_0x5b2b26[_0xaa1d('0x3a')]=qs[_0xaa1d('0x57')](_0x2e13cc[_0xaa1d('0x34')][_0xaa1d('0x57')]);_0x5b2b26[_0xaa1d('0x3c')]=qs[_0xaa1d('0x35')](_[_0xaa1d('0x3b')](_0x2e13cc[_0xaa1d('0x34')],_0x144a63[_0xaa1d('0x35')]));_0x5b2b26['where'][_0xaa1d('0x58')]=_0x4156dc['id'];if(_0x2e13cc[_0xaa1d('0x34')][_0xaa1d('0x3f')]){_0x5b2b26[_0xaa1d('0x3c')]=_[_0xaa1d('0x3d')](_0x5b2b26[_0xaa1d('0x3c')],{'$or':_[_0xaa1d('0x32')](_0x5b2b26[_0xaa1d('0x37')],function(_0x255b57){var _0x151e62={};_0x151e62[_0x255b57]={'$like':'%'+_0x2e13cc[_0xaa1d('0x34')]['filter']+'%'};return _0x151e62;})});}_0x5b2b26=_[_0xaa1d('0x3d')]({},_0x5b2b26,_0x2e13cc[_0xaa1d('0x40')]);return db[_0xaa1d('0x55')][_0xaa1d('0x59')](_0x5b2b26);}})[_0xaa1d('0x25')](function(_0x14dcdd){if(_0x14dcdd){return db[_0xaa1d('0x5a')]['findAndCountAll']({'where':{'id':_[_0xaa1d('0x32')](_0x14dcdd,'UserId'),'role':_0xaa1d('0x5b')},'attributes':['id',_0xaa1d('0x2b'),_0xaa1d('0x5c'),_0xaa1d('0x5d'),_0xaa1d('0x5e')]});}})[_0xaa1d('0x25')](function(_0x131adb){if(_0x131adb){return{'count':_0x131adb[_0xaa1d('0x1f')],'rows':_['map'](_0x131adb[_0xaa1d('0x43')],function(_0x13e771){return{'membername':_0x13e771[_0xaa1d('0x2b')],'UserId':_0x13e771['id'],'queue_name':_0x19fa0e[_0xaa1d('0x2b')],'FaxQueueId':_0x19fa0e['id'],'interface':util[_0xaa1d('0x5f')](_0xaa1d('0x60'),'SIP',_0x13e771['name']),'penalty':0x0,'paused':_0x13e771[_0xaa1d('0x5c')],'createdAt':_0x13e771[_0xaa1d('0x5e')],'updatedAt':_0x13e771[_0xaa1d('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaa1d('0x25')](respondWithFilteredResult(_0x4bbdb7,_0x5b2b26))[_0xaa1d('0x44')](handleError(_0x4bbdb7,null));};exports[_0xaa1d('0x61')]=function(_0x4af85c,_0x2021f5,_0x285ea7){var _0x3202b6={};var _0x56628e={};var _0x2f5ba9;var _0x367fe6;return db[_0xaa1d('0x2d')]['findOne']({'where':{'id':_0x4af85c[_0xaa1d('0x45')]['id']}})[_0xaa1d('0x25')](handleEntityNotFound(_0x2021f5,null))[_0xaa1d('0x25')](function(_0x48af49){if(_0x48af49){_0x2f5ba9=_0x48af49;_0x56628e['model']=_[_0xaa1d('0x33')](db[_0xaa1d('0x62')][_0xaa1d('0x2e')]);_0x56628e[_0xaa1d('0x34')]=_[_0xaa1d('0x33')](_0x4af85c['query']);_0x56628e['filters']=_[_0xaa1d('0x46')](_0x56628e['model'],_0x56628e[_0xaa1d('0x34')]);_0x3202b6[_0xaa1d('0x37')]=_[_0xaa1d('0x46')](_0x56628e['model'],qs[_0xaa1d('0x36')](_0x4af85c[_0xaa1d('0x34')][_0xaa1d('0x36')]));_0x3202b6[_0xaa1d('0x37')]=_0x3202b6['attributes']['length']?_0x3202b6[_0xaa1d('0x37')]:_0x56628e[_0xaa1d('0x31')];_0x3202b6[_0xaa1d('0x3a')]=qs[_0xaa1d('0x57')](_0x4af85c[_0xaa1d('0x34')]['sort']);_0x3202b6[_0xaa1d('0x3c')]=qs[_0xaa1d('0x35')](_[_0xaa1d('0x3b')](_0x4af85c['query'],_0x56628e[_0xaa1d('0x35')]));if(_0x4af85c[_0xaa1d('0x34')]['filter']){_0x3202b6[_0xaa1d('0x3c')]=_[_0xaa1d('0x3d')](_0x3202b6[_0xaa1d('0x3c')],{'$or':_['map'](_0x3202b6[_0xaa1d('0x37')],function(_0x149a3a){var _0x5d53b5={};_0x5d53b5[_0x149a3a]={'$like':'%'+_0x4af85c[_0xaa1d('0x34')][_0xaa1d('0x3f')]+'%'};return _0x5d53b5;})});}_0x3202b6=_[_0xaa1d('0x3d')]({},_0x3202b6,_0x4af85c[_0xaa1d('0x40')]);return _0x2f5ba9[_0xaa1d('0x61')](_0x3202b6);}})[_0xaa1d('0x25')](function(_0x41ce0c){if(_0x41ce0c){_0x367fe6=_0x41ce0c['length'];if(!_0x4af85c[_0xaa1d('0x34')][_0xaa1d('0x39')](_0xaa1d('0x56'))){_0x3202b6[_0xaa1d('0x1d')]=qs[_0xaa1d('0x1d')](_0x4af85c[_0xaa1d('0x34')]['limit']);_0x3202b6['offset']=qs['offset'](_0x4af85c[_0xaa1d('0x34')][_0xaa1d('0x20')]);}return _0x2f5ba9[_0xaa1d('0x61')](_0x3202b6);}})[_0xaa1d('0x25')](function(_0x5b9f2b){if(_0x5b9f2b){return _0x5b9f2b?{'count':_0x367fe6,'rows':_0x5b9f2b}:null;}})['then'](respondWithResult(_0x2021f5,null))[_0xaa1d('0x44')](handleError(_0x2021f5,null));};exports['addTeams']=function(_0x55ecb1,_0x1f0e2b,_0x4d5e68){var _0x56d2de=_0x55ecb1[_0xaa1d('0x48')][_0xaa1d('0x63')];return db[_0xaa1d('0x62')][_0xaa1d('0x59')]({'where':{'id':_0x56d2de},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaa1d('0x64'),'attributes':['id',_0xaa1d('0x2b'),_0xaa1d('0x65'),_0xaa1d('0x66'),_0xaa1d('0x67')],'raw':!![]}]})[_0xaa1d('0x25')](function(_0x13d09e){if(_0x13d09e){var _0x4222c0=_[_0xaa1d('0x68')](_0x13d09e,function(_0x51911e){var _0x4609fb=_0x51911e[_0xaa1d('0x27')]({'plain':!![]});return _0x4609fb[_0xaa1d('0x64')];});return db['FaxQueue']['find']({'where':{'id':_0x55ecb1['params']['id']}})[_0xaa1d('0x25')](function(_0x404a06){return db[_0xaa1d('0x69')][_0xaa1d('0x6a')](function(_0x3ef859){return _0x404a06['addTeams'](_0x56d2de,{'transaction':_0x3ef859})['then'](function(){return BPromise[_0xaa1d('0x6b')](_0x4222c0,function(_0x49a994){return db[_0xaa1d('0x55')][_0xaa1d('0x6c')]({'where':{'UserId':_0x49a994['id'],'FaxQueueId':_0x55ecb1[_0xaa1d('0x45')]['id']},'transaction':_0x3ef859});});})['then'](function(){_0x4222c0[_0xaa1d('0x6d')](function(_0x325ad2){socket[_0xaa1d('0x6e')]('userFaxQueue:save',{'UserId':_0x325ad2['id'],'FaxQueueId':_0x404a06['id']});});});});});}})['then'](respondWithStatusCode(_0x1f0e2b,null))[_0xaa1d('0x44')](handleError(_0x1f0e2b,null));};exports[_0xaa1d('0x6f')]=function(_0x5cf222,_0x2f1e25,_0x3e216d){return db['Team'][_0xaa1d('0x59')]({'where':{'id':_0x5cf222[_0xaa1d('0x34')][_0xaa1d('0x63')]},'attributes':['id'],'include':[{'model':db[_0xaa1d('0x5a')],'as':_0xaa1d('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f1e25,null))['then'](function(_0x1048f6){var _0x5658c5=_['map'](_0x1048f6,'id');var _0x36e78a=[];var _0x2d9a22=[];var _0xfefd2=squel['select']();_0xfefd2[_0xaa1d('0x70')](_0xaa1d('0x71'))['from'](_0xaa1d('0x72'),'tq')[_0xaa1d('0x73')](_0xaa1d('0x74'),'ut',_0xaa1d('0x75'))[_0xaa1d('0x3c')]('FaxQueueId\x20=\x20?',_0x5cf222[_0xaa1d('0x45')]['id']);for(var _0x41d406=0x0;_0x41d406<_0x1048f6[_0xaa1d('0x38')];_0x41d406+=0x1){let _0x246198=_0x1048f6[_0x41d406];for(var _0x1369aa=0x0;_0x1369aa<_0x246198[_0xaa1d('0x64')][_0xaa1d('0x38')];_0x1369aa+=0x1){let _0x5443d7=_0x246198[_0xaa1d('0x64')][_0x1369aa];var _0x583439=_0xfefd2[_0xaa1d('0x76')]();_0x583439['where'](_0xaa1d('0x77'),_0x5443d7['id']);_0x2d9a22[_0xaa1d('0x78')](db[_0xaa1d('0x69')][_0xaa1d('0x34')](_0x583439[_0xaa1d('0x79')](),{'type':db[_0xaa1d('0x69')][_0xaa1d('0x7a')]['SELECT']})[_0xaa1d('0x25')](function(_0x478f32){if(_0x478f32[_0xaa1d('0x38')]===0x1){return _0x5443d7['id'];}else{var _0x573bd1=_[_0xaa1d('0x7b')](_['map'](_0x478f32,'TeamId'),function(_0x167401){return _[_0xaa1d('0x7c')](_0x5658c5,_0x167401);});if(_0x573bd1){return _0x5443d7['id'];}}}));}}return BPromise[_0xaa1d('0x7d')](_0x2d9a22)[_0xaa1d('0x25')](function(_0x31d4e0){_0x36e78a=_(_0x36e78a)['union'](_0x31d4e0)['compact']()[_0xaa1d('0x7e')]();return db['FaxQueue'][_0xaa1d('0x4e')]({'where':{'id':_0x5cf222['params']['id']}})[_0xaa1d('0x25')](function(_0x22f4c9){return db[_0xaa1d('0x69')][_0xaa1d('0x6a')](function(_0x444a3b){return _0x22f4c9[_0xaa1d('0x6f')](_0x5cf222[_0xaa1d('0x34')]['ids'],{'transaction':_0x444a3b})['then'](function(){if(!_['isEmpty'](_0x36e78a)){return _0x22f4c9[_0xaa1d('0x7f')](_0x36e78a,{'transaction':_0x444a3b});}})[_0xaa1d('0x25')](function(){_0x36e78a[_0xaa1d('0x6d')](function(_0x41a630){socket['emit'](_0xaa1d('0x80'),{'UserId':_0x41a630,'FaxQueueId':_0x22f4c9['id']});});});});});});})[_0xaa1d('0x25')](respondWithStatusCode(_0x2f1e25,null))['catch'](handleError(_0x2f1e25,null));};exports[_0xaa1d('0x81')]=function(_0x12f524,_0x5bd214,_0x4d9adc){return db[_0xaa1d('0x2d')][_0xaa1d('0x4e')]({'where':{'id':_0x12f524[_0xaa1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bd214,null))[_0xaa1d('0x25')](function(_0x585f59){if(_0x585f59){return _0x585f59[_0xaa1d('0x81')](_0x12f524[_0xaa1d('0x48')][_0xaa1d('0x63')],_[_0xaa1d('0x82')](_0x12f524[_0xaa1d('0x48')],[_0xaa1d('0x63'),'id'])||{})[_0xaa1d('0x83')](function(_0x53c0bc){for(var _0x303495=0x0;_0x303495<_0x12f524[_0xaa1d('0x48')][_0xaa1d('0x63')][_0xaa1d('0x38')];_0x303495+=0x1){socket['emit'](_0xaa1d('0x84'),{'UserId':Number(_0x12f524[_0xaa1d('0x48')][_0xaa1d('0x63')][_0x303495]),'FaxQueueId':Number(_0x12f524[_0xaa1d('0x45')]['id'])});}return _0x53c0bc;});}})[_0xaa1d('0x25')](respondWithResult(_0x5bd214,null))['catch'](handleError(_0x5bd214,null));};exports['removeAgents']=function(_0xa0f537,_0x1949a8,_0x5905c4){return db['FaxQueue']['find']({'where':{'id':_0xa0f537[_0xaa1d('0x45')]['id']}})[_0xaa1d('0x25')](handleEntityNotFound(_0x1949a8,null))[_0xaa1d('0x25')](function(_0x2a5a17){if(_0x2a5a17){return _0x2a5a17[_0xaa1d('0x7f')](_0xa0f537['query'][_0xaa1d('0x63')])[_0xaa1d('0x25')](function(){if(_['isArray'](_0xa0f537[_0xaa1d('0x34')][_0xaa1d('0x63')])){for(var _0x48f718=0x0;_0x48f718<_0xa0f537[_0xaa1d('0x34')][_0xaa1d('0x63')][_0xaa1d('0x38')];_0x48f718+=0x1){socket['emit'](_0xaa1d('0x80'),{'UserId':Number(_0xa0f537[_0xaa1d('0x34')][_0xaa1d('0x63')][_0x48f718]),'FaxQueueId':Number(_0xa0f537[_0xaa1d('0x45')]['id'])});}}else{socket[_0xaa1d('0x6e')](_0xaa1d('0x80'),{'UserId':Number(_0xa0f537[_0xaa1d('0x34')][_0xaa1d('0x63')]),'FaxQueueId':Number(_0xa0f537[_0xaa1d('0x45')]['id'])});}});}})[_0xaa1d('0x25')](respondWithStatusCode(_0x1949a8,null))['catch'](handleError(_0x1949a8,null));};exports[_0xaa1d('0x85')]=function(_0x42b27b,_0x5b19d7,_0x536090){var _0x1c775b={};var _0x3f7423={};var _0x55a20a;var _0x52c93b;return db[_0xaa1d('0x2d')]['findOne']({'where':{'id':_0x42b27b[_0xaa1d('0x45')]['id']}})[_0xaa1d('0x25')](handleEntityNotFound(_0x5b19d7,null))[_0xaa1d('0x25')](function(_0x5416af){if(_0x5416af){_0x55a20a=_0x5416af;_0x3f7423[_0xaa1d('0x31')]=_[_0xaa1d('0x33')](db[_0xaa1d('0x5a')][_0xaa1d('0x2e')]);_0x3f7423['query']=_[_0xaa1d('0x33')](_0x42b27b[_0xaa1d('0x34')]);_0x3f7423['filters']=_[_0xaa1d('0x46')](_0x3f7423['model'],_0x3f7423[_0xaa1d('0x34')]);_0x1c775b[_0xaa1d('0x37')]=_[_0xaa1d('0x46')](_0x3f7423[_0xaa1d('0x31')],qs[_0xaa1d('0x36')](_0x42b27b['query']['fields']));_0x1c775b[_0xaa1d('0x37')]=_0x1c775b[_0xaa1d('0x37')][_0xaa1d('0x38')]?_0x1c775b[_0xaa1d('0x37')]:_0x3f7423[_0xaa1d('0x31')];_0x1c775b[_0xaa1d('0x3a')]=qs[_0xaa1d('0x57')](_0x42b27b[_0xaa1d('0x34')][_0xaa1d('0x57')]);_0x1c775b['where']=qs[_0xaa1d('0x35')](_[_0xaa1d('0x3b')](_0x42b27b[_0xaa1d('0x34')],_0x3f7423[_0xaa1d('0x35')]));if(_0x42b27b['query'][_0xaa1d('0x3f')]){_0x1c775b['where']=_['merge'](_0x1c775b['where'],{'$or':_[_0xaa1d('0x32')](_0x1c775b[_0xaa1d('0x37')],function(_0x2c3732){var _0x2312f5={};_0x2312f5[_0x2c3732]={'$like':'%'+_0x42b27b[_0xaa1d('0x34')][_0xaa1d('0x3f')]+'%'};return _0x2312f5;})});}_0x1c775b=_[_0xaa1d('0x3d')]({},_0x1c775b,_0x42b27b[_0xaa1d('0x40')]);return _0x55a20a[_0xaa1d('0x85')](_0x1c775b);}})[_0xaa1d('0x25')](function(_0x5e5dea){if(_0x5e5dea){_0x52c93b=_0x5e5dea['length'];if(!_0x42b27b[_0xaa1d('0x34')]['hasOwnProperty'](_0xaa1d('0x56'))){_0x1c775b[_0xaa1d('0x1d')]=qs['limit'](_0x42b27b[_0xaa1d('0x34')][_0xaa1d('0x1d')]);_0x1c775b['offset']=qs['offset'](_0x42b27b[_0xaa1d('0x34')][_0xaa1d('0x20')]);}return _0x55a20a[_0xaa1d('0x85')](_0x1c775b);}})[_0xaa1d('0x25')](function(_0x4b1f9f){if(_0x4b1f9f){return _0x4b1f9f?{'count':_0x52c93b,'rows':_0x4b1f9f}:null;}})[_0xaa1d('0x25')](respondWithResult(_0x5b19d7,null))[_0xaa1d('0x44')](handleError(_0x5b19d7,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 32cfcd0..f70446e 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 _0x8056=['hasOwnProperty','exports','events','FaxQueue','setMaxListeners','update','remove','emit'];(function(_0x4ce205,_0x7744a3){var _0x4a702c=function(_0xcf753c){while(--_0xcf753c){_0x4ce205['push'](_0x4ce205['shift']());}};_0x4a702c(++_0x7744a3);}(_0x8056,0x6a));var _0x6805=function(_0xce4604,_0x5e98ad){_0xce4604=_0xce4604-0x0;var _0x474352=_0x8056[_0xce4604];return _0x474352;};'use strict';var EventEmitter=require(_0x6805('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x6805('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6805('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6805('0x3'),'afterDestroy':_0x6805('0x4')};function emitEvent(_0x5442e7){return function(_0x129e71,_0x44d4da,_0x6df369){FaxQueueEvents[_0x6805('0x5')](_0x5442e7+':'+_0x129e71['id'],_0x129e71);FaxQueueEvents[_0x6805('0x5')](_0x5442e7,_0x129e71);_0x6df369(null);};}for(var e in events){if(events[_0x6805('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x6805('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xaa6a=['FaxQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x379fc3,_0x8039b5){var _0x74d65=function(_0x154243){while(--_0x154243){_0x379fc3['push'](_0x379fc3['shift']());}};_0x74d65(++_0x8039b5);}(_0xaa6a,0x1e7));var _0xaaa6=function(_0x284b3d,_0x5c633c){_0x284b3d=_0x284b3d-0x0;var _0x8da807=_0xaa6a[_0x284b3d];return _0x8da807;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xaaa6('0x0'))['db'][_0xaaa6('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xaaa6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaaa6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2a9cb1){return function(_0xeae9e0,_0x3ac0d4,_0x3a36fd){FaxQueueEvents[_0xaaa6('0x4')](_0x2a9cb1+':'+_0xeae9e0['id'],_0xeae9e0);FaxQueueEvents['emit'](_0x2a9cb1,_0xeae9e0);_0x3a36fd(null);};}for(var e in events){if(events[_0xaaa6('0x5')](e)){var event=events[e];FaxQueue[_0xaaa6('0x6')](e,emitEvent(event));}}module[_0xaaa6('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 06cc12e..55d75f5 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 _0xbfd7=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','fax_queues','lodash','util'];(function(_0x274a03,_0xa661ae){var _0x53b6dc=function(_0x29a5df){while(--_0x29a5df){_0x274a03['push'](_0x274a03['shift']());}};_0x53b6dc(++_0xa661ae);}(_0xbfd7,0x1e2));var _0x7bfd=function(_0x26ca44,_0x4611e2){_0x26ca44=_0x26ca44-0x0;var _0x4a126d=_0xbfd7[_0x26ca44];return _0x4a126d;};'use strict';var _=require(_0x7bfd('0x0'));var util=require(_0x7bfd('0x1'));var logger=require(_0x7bfd('0x2'))('api');var moment=require(_0x7bfd('0x3'));var BPromise=require(_0x7bfd('0x4'));var rp=require(_0x7bfd('0x5'));var fs=require('fs');var path=require(_0x7bfd('0x6'));var rimraf=require(_0x7bfd('0x7'));var config=require(_0x7bfd('0x8'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x4b271c,_0x53931d){return _0x4b271c[_0x7bfd('0x9')]('FaxQueue',attributes,{'tableName':_0x7bfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48e7=['bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','util','moment'];(function(_0x5bf0d9,_0x35fc28){var _0x4ac6a1=function(_0x55346b){while(--_0x55346b){_0x5bf0d9['push'](_0x5bf0d9['shift']());}};_0x4ac6a1(++_0x35fc28);}(_0x48e7,0x17e));var _0x748e=function(_0x249bb5,_0x25e243){_0x249bb5=_0x249bb5-0x0;var _0x21b641=_0x48e7[_0x249bb5];return _0x21b641;};'use strict';var _=require(_0x748e('0x0'));var util=require(_0x748e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x748e('0x2'));var BPromise=require(_0x748e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x748e('0x4'));var rimraf=require(_0x748e('0x5'));var config=require(_0x748e('0x6'));var attributes=require(_0x748e('0x7'));module['exports']=function(_0x100584,_0x238423){return _0x100584[_0x748e('0x8')](_0x748e('0x9'),attributes,{'tableName':_0x748e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index bb25601..6822bda 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 _0xf813=['code','FaxQueue,\x20%s,\x20%s','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowFaxQueue','find','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x750904,_0x95afa9){var _0x4f3b85=function(_0x1ff3a3){while(--_0x1ff3a3){_0x750904['push'](_0x750904['shift']());}};_0x4f3b85(++_0x95afa9);}(_0xf813,0x1e7));var _0x3f81=function(_0x1e4c37,_0xdf253e){_0x1e4c37=_0x1e4c37-0x0;var _0xec3469=_0xf813[_0x1e4c37];return _0xec3469;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f81('0x0'));var fs=require('fs');var Redis=require(_0x3f81('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f81('0x2'));var logger=require(_0x3f81('0x3'))(_0x3f81('0x4'));var config=require('../../config/environment');var jayson=require(_0x3f81('0x5'));var client=jayson[_0x3f81('0x6')][_0x3f81('0x7')]({'port':0x232a});config[_0x3f81('0x8')]=_[_0x3f81('0x9')](config[_0x3f81('0x8')],{'host':_0x3f81('0xa'),'port':0x18eb});var socket=require(_0x3f81('0xb'))(new Redis(config[_0x3f81('0x8')]));require('./faxQueue.socket')[_0x3f81('0xc')](socket);function respondWithRpcPromise(_0x266310,_0x554d31,_0x270bbb){return new BPromise(function(_0x38b235,_0x2684da){return client[_0x3f81('0xd')](_0x266310,_0x270bbb)[_0x3f81('0xe')](function(_0x62e221){logger[_0x3f81('0xf')]('FaxQueue,\x20%s,\x20%s',_0x554d31,_0x3f81('0x10'));logger[_0x3f81('0x11')](_0x3f81('0x12'),_0x554d31,_0x3f81('0x10'),JSON['stringify'](_0x62e221));if(_0x62e221['error']){if(_0x62e221[_0x3f81('0x13')][_0x3f81('0x14')]===0x1f4){logger[_0x3f81('0x13')](_0x3f81('0x15'),_0x554d31,_0x62e221[_0x3f81('0x13')][_0x3f81('0x16')]);return _0x2684da(_0x62e221['error'][_0x3f81('0x16')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x554d31,_0x62e221['error'][_0x3f81('0x16')]);return _0x38b235(_0x62e221[_0x3f81('0x13')][_0x3f81('0x16')]);}else{logger[_0x3f81('0xf')](_0x3f81('0x15'),_0x554d31,_0x3f81('0x10'));_0x38b235(_0x62e221[_0x3f81('0x17')][_0x3f81('0x16')]);}})['catch'](function(_0x55a41a){logger['error'](_0x3f81('0x15'),_0x554d31,_0x55a41a);_0x2684da(_0x55a41a);});});}exports[_0x3f81('0x18')]=function(_0x215596){var _0x4c0a6c=this;return new Promise(function(_0x5a3a14,_0x54e1d5){return db[_0x3f81('0x19')][_0x3f81('0x1a')]({'raw':_0x215596[_0x3f81('0x1b')]?_0x215596[_0x3f81('0x1b')][_0x3f81('0x1c')]===undefined?!![]:![]:!![],'where':_0x215596[_0x3f81('0x1b')]?_0x215596[_0x3f81('0x1b')][_0x3f81('0x1d')]||null:null,'attributes':_0x215596['options']?_0x215596['options']['attributes']||null:null,'limit':_0x215596[_0x3f81('0x1b')]?_0x215596['options'][_0x3f81('0x1e')]||null:null,'include':_0x215596['options']?_0x215596[_0x3f81('0x1b')][_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x215596[_0x3f81('0x1b')][_0x3f81('0x1f')],function(_0x1dd02b){return{'model':db[_0x1dd02b[_0x3f81('0x21')]],'as':_0x1dd02b['as'],'attributes':_0x1dd02b[_0x3f81('0x22')],'include':_0x1dd02b[_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x1dd02b[_0x3f81('0x1f')],function(_0x1305fa){return{'model':db[_0x1305fa['model']],'as':_0x1305fa['as'],'attributes':_0x1305fa[_0x3f81('0x22')],'include':_0x1305fa[_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x1305fa[_0x3f81('0x1f')],function(_0xa016f){return{'model':db[_0xa016f[_0x3f81('0x21')]],'as':_0xa016f['as'],'attributes':_0xa016f[_0x3f81('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3758db){logger['info'](_0x3f81('0x18'),_0x215596);logger[_0x3f81('0x11')](_0x3f81('0x18'),_0x215596,JSON[_0x3f81('0x23')](_0x3758db));_0x5a3a14(_0x3758db);})['catch'](function(_0x259d9f){logger[_0x3f81('0x13')](_0x3f81('0x18'),_0x259d9f[_0x3f81('0x16')],_0x215596);_0x54e1d5(_0x4c0a6c['error'](0x1f4,_0x259d9f[_0x3f81('0x16')]));});});};exports[_0x3f81('0x24')]=function(_0x4aa52c){var _0x4c56a1=this;return new Promise(function(_0x7edebe,_0x516343){return db[_0x3f81('0x19')][_0x3f81('0x25')]({'raw':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c[_0x3f81('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c['options'][_0x3f81('0x1d')]||null:null,'attributes':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c['options'][_0x3f81('0x22')]||null:null,'include':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c[_0x3f81('0x1b')]['include']?_[_0x3f81('0x20')](_0x4aa52c['options'][_0x3f81('0x1f')],function(_0x3b6838){return{'model':db[_0x3b6838['model']],'as':_0x3b6838['as'],'attributes':_0x3b6838[_0x3f81('0x22')],'include':_0x3b6838['include']?_['map'](_0x3b6838['include'],function(_0x2c36c3){return{'model':db[_0x2c36c3[_0x3f81('0x21')]],'as':_0x2c36c3['as'],'attributes':_0x2c36c3[_0x3f81('0x22')],'include':_0x2c36c3[_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x2c36c3[_0x3f81('0x1f')],function(_0x4725b5){return{'model':db[_0x4725b5['model']],'as':_0x4725b5['as'],'attributes':_0x4725b5[_0x3f81('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3f81('0xe')](function(_0x135d46){logger[_0x3f81('0xf')](_0x3f81('0x24'),_0x4aa52c);logger[_0x3f81('0x11')]('ShowFaxQueue',_0x4aa52c,JSON[_0x3f81('0x23')](_0x135d46));_0x7edebe(_0x135d46);})[_0x3f81('0x26')](function(_0x43794d){logger[_0x3f81('0x13')]('ShowFaxQueue',_0x43794d['message'],_0x4aa52c);_0x516343(_0x4c56a1[_0x3f81('0x13')](0x1f4,_0x43794d[_0x3f81('0x16')]));});});}; \ No newline at end of file +var _0xfc24=['attributes','limit','map','model','include','ShowFaxQueue','find','raw','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options'];(function(_0x1918f1,_0x23e97f){var _0x5396ed=function(_0x304364){while(--_0x304364){_0x1918f1['push'](_0x1918f1['shift']());}};_0x5396ed(++_0x23e97f);}(_0xfc24,0xad));var _0x4fc2=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xfc24[_0x43a6cd];return _0x5acb36;};'use strict';var _=require(_0x4fc2('0x0'));var util=require('util');var moment=require(_0x4fc2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fc2('0x2'));var fs=require('fs');var Redis=require(_0x4fc2('0x3'));var db=require(_0x4fc2('0x4'))['db'];var utils=require(_0x4fc2('0x5'));var logger=require(_0x4fc2('0x6'))(_0x4fc2('0x7'));var config=require(_0x4fc2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4fc2('0x9')]['http']({'port':0x232a});config[_0x4fc2('0xa')]=_[_0x4fc2('0xb')](config[_0x4fc2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4fc2('0xc'))(new Redis(config[_0x4fc2('0xa')]));require(_0x4fc2('0xd'))[_0x4fc2('0xe')](socket);function respondWithRpcPromise(_0x53e1c4,_0x3865bc,_0xccbbcb){return new BPromise(function(_0x3e17aa,_0x11522e){return client[_0x4fc2('0xf')](_0x53e1c4,_0xccbbcb)[_0x4fc2('0x10')](function(_0x22c3fa){logger[_0x4fc2('0x11')](_0x4fc2('0x12'),_0x3865bc,'request\x20sent');logger[_0x4fc2('0x13')](_0x4fc2('0x14'),_0x3865bc,_0x4fc2('0x15'),JSON[_0x4fc2('0x16')](_0x22c3fa));if(_0x22c3fa[_0x4fc2('0x17')]){if(_0x22c3fa[_0x4fc2('0x17')][_0x4fc2('0x18')]===0x1f4){logger[_0x4fc2('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3865bc,_0x22c3fa[_0x4fc2('0x17')][_0x4fc2('0x19')]);return _0x11522e(_0x22c3fa[_0x4fc2('0x17')][_0x4fc2('0x19')]);}logger[_0x4fc2('0x17')](_0x4fc2('0x12'),_0x3865bc,_0x22c3fa[_0x4fc2('0x17')][_0x4fc2('0x19')]);return _0x3e17aa(_0x22c3fa[_0x4fc2('0x17')]['message']);}else{logger[_0x4fc2('0x11')](_0x4fc2('0x12'),_0x3865bc,_0x4fc2('0x15'));_0x3e17aa(_0x22c3fa[_0x4fc2('0x1a')][_0x4fc2('0x19')]);}})[_0x4fc2('0x1b')](function(_0xfff4c3){logger[_0x4fc2('0x17')](_0x4fc2('0x12'),_0x3865bc,_0xfff4c3);_0x11522e(_0xfff4c3);});});}exports[_0x4fc2('0x1c')]=function(_0x3b0988){var _0x3976ea=this;return new Promise(function(_0xf55a19,_0x518757){return db[_0x4fc2('0x1d')][_0x4fc2('0x1e')]({'raw':_0x3b0988[_0x4fc2('0x1f')]?_0x3b0988['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b0988['options']?_0x3b0988[_0x4fc2('0x1f')]['where']||null:null,'attributes':_0x3b0988[_0x4fc2('0x1f')]?_0x3b0988[_0x4fc2('0x1f')][_0x4fc2('0x20')]||null:null,'limit':_0x3b0988[_0x4fc2('0x1f')]?_0x3b0988[_0x4fc2('0x1f')][_0x4fc2('0x21')]||null:null,'include':_0x3b0988['options']?_0x3b0988[_0x4fc2('0x1f')]['include']?_[_0x4fc2('0x22')](_0x3b0988[_0x4fc2('0x1f')]['include'],function(_0x4926ae){return{'model':db[_0x4926ae[_0x4fc2('0x23')]],'as':_0x4926ae['as'],'attributes':_0x4926ae[_0x4fc2('0x20')],'include':_0x4926ae['include']?_[_0x4fc2('0x22')](_0x4926ae[_0x4fc2('0x24')],function(_0x279773){return{'model':db[_0x279773['model']],'as':_0x279773['as'],'attributes':_0x279773[_0x4fc2('0x20')],'include':_0x279773['include']?_[_0x4fc2('0x22')](_0x279773[_0x4fc2('0x24')],function(_0x4b2226){return{'model':db[_0x4b2226['model']],'as':_0x4b2226['as'],'attributes':_0x4b2226['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e705c){logger[_0x4fc2('0x11')](_0x4fc2('0x1c'),_0x3b0988);logger['debug'](_0x4fc2('0x1c'),_0x3b0988,JSON[_0x4fc2('0x16')](_0x1e705c));_0xf55a19(_0x1e705c);})[_0x4fc2('0x1b')](function(_0x4e91b1){logger[_0x4fc2('0x17')](_0x4fc2('0x1c'),_0x4e91b1[_0x4fc2('0x19')],_0x3b0988);_0x518757(_0x3976ea[_0x4fc2('0x17')](0x1f4,_0x4e91b1[_0x4fc2('0x19')]));});});};exports[_0x4fc2('0x25')]=function(_0x4b6d94){var _0x496826=this;return new Promise(function(_0x4856ed,_0x17a5bb){return db[_0x4fc2('0x1d')][_0x4fc2('0x26')]({'raw':_0x4b6d94[_0x4fc2('0x1f')]?_0x4b6d94[_0x4fc2('0x1f')][_0x4fc2('0x27')]===undefined?!![]:![]:!![],'where':_0x4b6d94[_0x4fc2('0x1f')]?_0x4b6d94[_0x4fc2('0x1f')][_0x4fc2('0x28')]||null:null,'attributes':_0x4b6d94[_0x4fc2('0x1f')]?_0x4b6d94['options'][_0x4fc2('0x20')]||null:null,'include':_0x4b6d94['options']?_0x4b6d94[_0x4fc2('0x1f')][_0x4fc2('0x24')]?_[_0x4fc2('0x22')](_0x4b6d94[_0x4fc2('0x1f')]['include'],function(_0x588e49){return{'model':db[_0x588e49[_0x4fc2('0x23')]],'as':_0x588e49['as'],'attributes':_0x588e49['attributes'],'include':_0x588e49[_0x4fc2('0x24')]?_[_0x4fc2('0x22')](_0x588e49[_0x4fc2('0x24')],function(_0x4460b2){return{'model':db[_0x4460b2[_0x4fc2('0x23')]],'as':_0x4460b2['as'],'attributes':_0x4460b2[_0x4fc2('0x20')],'include':_0x4460b2[_0x4fc2('0x24')]?_[_0x4fc2('0x22')](_0x4460b2[_0x4fc2('0x24')],function(_0x18d322){return{'model':db[_0x18d322[_0x4fc2('0x23')]],'as':_0x18d322['as'],'attributes':_0x18d322['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fc2('0x10')](function(_0x1c247c){logger[_0x4fc2('0x11')](_0x4fc2('0x25'),_0x4b6d94);logger[_0x4fc2('0x13')](_0x4fc2('0x25'),_0x4b6d94,JSON['stringify'](_0x1c247c));_0x4856ed(_0x1c247c);})[_0x4fc2('0x1b')](function(_0x799bec){logger[_0x4fc2('0x17')](_0x4fc2('0x25'),_0x799bec['message'],_0x4b6d94);_0x17a5bb(_0x496826[_0x4fc2('0x17')](0x1f4,_0x799bec[_0x4fc2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index b9e8c41..47a33ee 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 _0xa482=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x5bcfaa,_0x2a40fc){var _0x258316=function(_0x4eaabb){while(--_0x4eaabb){_0x5bcfaa['push'](_0x5bcfaa['shift']());}};_0x258316(++_0x2a40fc);}(_0xa482,0x181));var _0x2a48=function(_0x5277e3,_0x4a48b2){_0x5277e3=_0x5277e3-0x0;var _0x465ef5=_0xa482[_0x5277e3];return _0x465ef5;};'use strict';var FaxQueueEvents=require(_0x2a48('0x0'));var events=[_0x2a48('0x1'),_0x2a48('0x2'),_0x2a48('0x3')];function createListener(_0x291bc9,_0xde9fd9){return function(_0x5ee9a0){_0xde9fd9[_0x2a48('0x4')](_0x291bc9,_0x5ee9a0);};}function removeListener(_0x2b458d,_0x379940){return function(){FaxQueueEvents[_0x2a48('0x5')](_0x2b458d,_0x379940);};}exports[_0x2a48('0x6')]=function(_0x26cf5d){for(var _0x2d69e8=0x0,_0x389bfc=events[_0x2a48('0x7')];_0x2d69e8<_0x389bfc;_0x2d69e8++){var _0x423494=events[_0x2d69e8];var _0x50f009=createListener(_0x2a48('0x8')+_0x423494,_0x26cf5d);FaxQueueEvents['on'](_0x423494,_0x50f009);}}; \ No newline at end of file +var _0x149e=['save','update','removeListener','register','length','./faxQueue.events'];(function(_0x2e3712,_0x1d0369){var _0x301251=function(_0x31249d){while(--_0x31249d){_0x2e3712['push'](_0x2e3712['shift']());}};_0x301251(++_0x1d0369);}(_0x149e,0x9b));var _0xe149=function(_0x4ac243,_0x2d7783){_0x4ac243=_0x4ac243-0x0;var _0x2964d8=_0x149e[_0x4ac243];return _0x2964d8;};'use strict';var FaxQueueEvents=require(_0xe149('0x0'));var events=[_0xe149('0x1'),'remove',_0xe149('0x2')];function createListener(_0x5ad1d2,_0x522d42){return function(_0x38f0c2){_0x522d42['emit'](_0x5ad1d2,_0x38f0c2);};}function removeListener(_0x3754e1,_0x2f93b3){return function(){FaxQueueEvents[_0xe149('0x3')](_0x3754e1,_0x2f93b3);};}exports[_0xe149('0x4')]=function(_0x75f633){for(var _0x27d083=0x0,_0x5211c4=events[_0xe149('0x5')];_0x27d083<_0x5211c4;_0x27d083++){var _0x20f5d4=events[_0x27d083];var _0x49bb0d=createListener('faxQueue:'+_0x20f5d4,_0x75f633);FaxQueueEvents['on'](_0x20f5d4,_0x49bb0d);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index a9ef008..60749e9 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 _0x553a=['/:id/users','getAgents','create','post','addTeams','put','/:id','destroy','delete','removeTeams','removeAgents','util','connect-timeout','express','Router','../../components/interaction/service','get','/describe','isAuthenticated','show','getMembers','/:id/teams','getTeams'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x553a,0x192));var _0xa553=function(_0x4d729f,_0x52bf8b){_0x4d729f=_0x4d729f-0x0;var _0x5ce12a=_0x553a[_0x4d729f];return _0x5ce12a;};'use strict';var multer=require('multer');var util=require(_0xa553('0x0'));var path=require('path');var timeout=require(_0xa553('0x1'));var express=require(_0xa553('0x2'));var router=express[_0xa553('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa553('0x4'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xa553('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa553('0x5')](_0xa553('0x6'),auth[_0xa553('0x7')](),controller['describe']);router[_0xa553('0x5')]('/:id',auth[_0xa553('0x7')](),controller[_0xa553('0x8')]);router[_0xa553('0x5')]('/:id/members',auth['isAuthenticated'](),controller[_0xa553('0x9')]);router['get'](_0xa553('0xa'),auth[_0xa553('0x7')](),controller[_0xa553('0xb')]);router['get'](_0xa553('0xc'),auth[_0xa553('0x7')](),controller[_0xa553('0xd')]);router['post']('/',auth[_0xa553('0x7')](),controller[_0xa553('0xe')]);router[_0xa553('0xf')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa553('0x10')]);router[_0xa553('0xf')](_0xa553('0xc'),auth[_0xa553('0x7')](),controller['addAgents']);router[_0xa553('0x11')]('/:id',auth[_0xa553('0x7')](),controller['update']);router['delete'](_0xa553('0x12'),auth['isAuthenticated'](),controller[_0xa553('0x13')]);router[_0xa553('0x14')](_0xa553('0xa'),auth['isAuthenticated'](),controller[_0xa553('0x15')]);router[_0xa553('0x14')]('/:id/users',auth[_0xa553('0x7')](),controller[_0xa553('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf072=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','update','delete','destroy','removeAgents','exports','multer'];(function(_0x13b70f,_0x5c1116){var _0x51427c=function(_0x54bb0b){while(--_0x54bb0b){_0x13b70f['push'](_0x13b70f['shift']());}};_0x51427c(++_0x5c1116);}(_0xf072,0x1cf));var _0x2f07=function(_0x8c8d0f,_0x27a023){_0x8c8d0f=_0x8c8d0f-0x0;var _0x4aeaef=_0xf072[_0x8c8d0f];return _0x4aeaef;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0x8')](_0x2f07('0xf'),auth[_0x2f07('0x9')](),controller['getMembers']);router[_0x2f07('0x8')](_0x2f07('0x10'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);router['get']('/:id/users',auth[_0x2f07('0x9')](),controller[_0x2f07('0x12')]);router['post']('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0x13')]);router[_0x2f07('0x14')]('/:id/teams',auth[_0x2f07('0x9')](),controller[_0x2f07('0x15')]);router[_0x2f07('0x14')](_0x2f07('0x16'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x17')]);router['put'](_0x2f07('0xd'),auth['isAuthenticated'](),controller[_0x2f07('0x18')]);router[_0x2f07('0x19')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x1a')]);router[_0x2f07('0x19')](_0x2f07('0x10'),auth[_0x2f07('0x9')](),controller['removeTeams']);router[_0x2f07('0x19')]('/:id/users',auth[_0x2f07('0x9')](),controller[_0x2f07('0x1b')]);module[_0x2f07('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index c2f06e6..85f70e0 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 _0xfc17=['DATE','moment','sequelize','exports','STRING'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xfc17,0x1b4));var _0x7fc1=function(_0xedc976,_0x28e892){_0xedc976=_0xedc976-0x0;var _0x3d74ca=_0xfc17[_0xedc976];return _0x3d74ca;};'use strict';var moment=require(_0x7fc1('0x0'));var Sequelize=require(_0x7fc1('0x1'));module[_0x7fc1('0x2')]={'uniqueid':{'type':Sequelize[_0x7fc1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7fc1('0x4')]},'leaveAt':{'type':Sequelize[_0x7fc1('0x4')]},'acceptAt':{'type':Sequelize[_0x7fc1('0x4')]},'exitAt':{'type':Sequelize[_0x7fc1('0x4')]},'reason':{'type':Sequelize[_0x7fc1('0x3')]}}; \ No newline at end of file +var _0x8d18=['DATE','moment','sequelize','exports','STRING'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8d18,0x137));var _0x88d1=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x8d18[_0x3d34da];return _0xcf6af8;};'use strict';var moment=require(_0x88d1('0x0'));var Sequelize=require(_0x88d1('0x1'));module[_0x88d1('0x2')]={'uniqueid':{'type':Sequelize[_0x88d1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x88d1('0x3')]},'joinAt':{'type':Sequelize[_0x88d1('0x4')]},'leaveAt':{'type':Sequelize[_0x88d1('0x4')]},'acceptAt':{'type':Sequelize[_0x88d1('0x4')]},'exitAt':{'type':Sequelize[_0x88d1('0x4')]},'reason':{'type':Sequelize[_0x88d1('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index f40475e..2baec1b 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 _0x2ce1=['bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','fast-json-patch','request-promise','moment'];(function(_0x4cb476,_0x10d7e3){var _0x15887f=function(_0x37e726){while(--_0x37e726){_0x4cb476['push'](_0x4cb476['shift']());}};_0x15887f(++_0x10d7e3);}(_0x2ce1,0x8b));var _0x12ce=function(_0x2dc46e,_0x22c800){_0x2dc46e=_0x2dc46e-0x0;var _0x4eb52c=_0x2ce1[_0x2dc46e];return _0x4eb52c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12ce('0x0'));var rp=require(_0x12ce('0x1'));var moment=require(_0x12ce('0x2'));var BPromise=require(_0x12ce('0x3'));var Mustache=require('mustache');var util=require(_0x12ce('0x4'));var path=require(_0x12ce('0x5'));var sox=require('sox');var csv=require(_0x12ce('0x6'));var ejs=require(_0x12ce('0x7'));var fs=require('fs');var fs_extra=require(_0x12ce('0x8'));var _=require('lodash');var squel=require(_0x12ce('0x9'));var crypto=require('crypto');var jsforce=require(_0x12ce('0xa'));var deskjs=require(_0x12ce('0xb'));var toCsv=require(_0x12ce('0x6'));var querystring=require('querystring');var Papa=require(_0x12ce('0xc'));var Redis=require(_0x12ce('0xd'));var authService=require(_0x12ce('0xe'));var qs=require(_0x12ce('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12ce('0x10'));var logger=require('../../config/logger')(_0x12ce('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x12ce('0x12'));var db=require(_0x12ce('0x13'))['db'];function respondWithStatusCode(_0x3dcfb4,_0x3d274d){_0x3d274d=_0x3d274d||0xcc;return function(_0x3d1dd0){if(_0x3d1dd0){return _0x3dcfb4[_0x12ce('0x14')](_0x3d274d);}return _0x3dcfb4['status'](_0x3d274d)[_0x12ce('0x15')]();};}function respondWithResult(_0x5cabae,_0x12bcf2){_0x12bcf2=_0x12bcf2||0xc8;return function(_0x132867){if(_0x132867){return _0x5cabae[_0x12ce('0x16')](_0x12bcf2)['json'](_0x132867);}};}function respondWithFilteredResult(_0x2171d2,_0x288cff){return function(_0x2ac396){if(_0x2ac396){var _0x39e4ec=typeof _0x288cff[_0x12ce('0x17')]===_0x12ce('0x18')&&typeof _0x288cff['limit']==='undefined';var _0x1fcf08=_0x2ac396['count'];var _0x40ab14=_0x39e4ec?0x0:_0x288cff[_0x12ce('0x17')];var _0x4955ae=_0x39e4ec?_0x2ac396[_0x12ce('0x19')]:_0x288cff['offset']+_0x288cff[_0x12ce('0x1a')];var _0x524b6b;if(_0x4955ae>=_0x1fcf08){_0x4955ae=_0x1fcf08;_0x524b6b=0xc8;}else{_0x524b6b=0xce;}_0x2171d2[_0x12ce('0x16')](_0x524b6b);return _0x2171d2['set'](_0x12ce('0x1b'),_0x40ab14+'-'+_0x4955ae+'/'+_0x1fcf08)['json'](_0x2ac396);}return null;};}function patchUpdates(_0x3f031e){return function(_0x521adb){try{jsonpatch['apply'](_0x521adb,_0x3f031e,!![]);}catch(_0x385687){return BPromise[_0x12ce('0x1c')](_0x385687);}return _0x521adb[_0x12ce('0x1d')]();};}function saveUpdates(_0x31656e,_0x5cbb85){return function(_0x162811){if(_0x162811){return _0x162811[_0x12ce('0x1e')](_0x31656e)['then'](function(_0x6302d2){return _0x6302d2;});}return null;};}function removeEntity(_0x4c86cd,_0x45a79c){return function(_0x5c4f01){if(_0x5c4f01){return _0x5c4f01[_0x12ce('0x1f')]()[_0x12ce('0x20')](function(){_0x4c86cd[_0x12ce('0x16')](0xcc)[_0x12ce('0x15')]();});}};}function handleEntityNotFound(_0xb2f1c5,_0x186358){return function(_0xb45ebe){if(!_0xb45ebe){_0xb2f1c5[_0x12ce('0x14')](0x194);}return _0xb45ebe;};}function handleError(_0x562a3d,_0x492e77){_0x492e77=_0x492e77||0x1f4;return function(_0x12c75e){logger[_0x12ce('0x21')](_0x12c75e[_0x12ce('0x22')]);if(_0x12c75e[_0x12ce('0x23')]){delete _0x12c75e['name'];}_0x562a3d[_0x12ce('0x16')](_0x492e77)[_0x12ce('0x24')](_0x12c75e);};}exports[_0x12ce('0x25')]=function(_0xf867bf,_0x55ea43){var _0x57fa70={},_0x4e511b={},_0x3ac1e3={'count':0x0,'rows':[]};var _0x10b653=_['map'](db[_0x12ce('0x26')][_0x12ce('0x27')],function(_0x9d00a5){return{'name':_0x9d00a5[_0x12ce('0x28')],'type':_0x9d00a5[_0x12ce('0x29')][_0x12ce('0x2a')]};});_0x4e511b[_0x12ce('0x2b')]=_[_0x12ce('0x2c')](_0x10b653,'name');_0x4e511b[_0x12ce('0x2d')]=_[_0x12ce('0x2e')](_0xf867bf[_0x12ce('0x2d')]);_0x4e511b[_0x12ce('0x2f')]=_[_0x12ce('0x30')](_0x4e511b['model'],_0x4e511b[_0x12ce('0x2d')]);_0x57fa70[_0x12ce('0x31')]=_['intersection'](_0x4e511b['model'],qs['fields'](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x32')]));_0x57fa70[_0x12ce('0x31')]=_0x57fa70[_0x12ce('0x31')][_0x12ce('0x33')]?_0x57fa70[_0x12ce('0x31')]:_0x4e511b['model'];if(!_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x34')](_0x12ce('0x35'))){_0x57fa70[_0x12ce('0x1a')]=qs[_0x12ce('0x1a')](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x1a')]);_0x57fa70[_0x12ce('0x17')]=qs['offset'](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x17')]);}_0x57fa70[_0x12ce('0x36')]=qs['sort'](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x37')]);_0x57fa70[_0x12ce('0x38')]=qs['filters'](_[_0x12ce('0x39')](_0xf867bf['query'],_0x4e511b['filters']),_0x10b653);if(_0xf867bf[_0x12ce('0x2d')]['filter']){_0x57fa70[_0x12ce('0x38')]=_[_0x12ce('0x3a')](_0x57fa70[_0x12ce('0x38')],{'$or':_['map'](_0x10b653,function(_0x3797d1){if(_0x3797d1[_0x12ce('0x29')]!==_0x12ce('0x3b')){var _0x3c7352={};_0x3c7352[_0x3797d1[_0x12ce('0x23')]]={'$like':'%'+_0xf867bf[_0x12ce('0x2d')]['filter']+'%'};return _0x3c7352;}})});}_0x57fa70=_['merge']({},_0x57fa70,_0xf867bf['options']);var _0x25eb25={'where':_0x57fa70[_0x12ce('0x38')]};return db[_0x12ce('0x26')]['count'](_0x25eb25)[_0x12ce('0x20')](function(_0x25e365){_0x3ac1e3[_0x12ce('0x19')]=_0x25e365;if(_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x3c')]){_0x57fa70[_0x12ce('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x12ce('0x3e')](_0x57fa70);})[_0x12ce('0x20')](function(_0x4672ac){_0x3ac1e3['rows']=_0x4672ac;return _0x3ac1e3;})[_0x12ce('0x20')](respondWithFilteredResult(_0x55ea43,_0x57fa70))[_0x12ce('0x3f')](handleError(_0x55ea43,null));};exports[_0x12ce('0x40')]=function(_0x4c2123,_0x5da8de){var _0x357d92={'raw':!![],'where':{'id':_0x4c2123[_0x12ce('0x41')]['id']}},_0xc2bfad={};_0xc2bfad['model']=_[_0x12ce('0x2e')](db[_0x12ce('0x26')][_0x12ce('0x27')]);_0xc2bfad[_0x12ce('0x2d')]=_[_0x12ce('0x2e')](_0x4c2123[_0x12ce('0x2d')]);_0xc2bfad[_0x12ce('0x2f')]=_[_0x12ce('0x30')](_0xc2bfad[_0x12ce('0x2b')],_0xc2bfad[_0x12ce('0x2d')]);_0x357d92[_0x12ce('0x31')]=_['intersection'](_0xc2bfad['model'],qs[_0x12ce('0x32')](_0x4c2123[_0x12ce('0x2d')][_0x12ce('0x32')]));_0x357d92['attributes']=_0x357d92['attributes']['length']?_0x357d92[_0x12ce('0x31')]:_0xc2bfad[_0x12ce('0x2b')];if(_0x4c2123[_0x12ce('0x2d')][_0x12ce('0x3c')]){_0x357d92[_0x12ce('0x3d')]=[{'all':!![]}];}_0x357d92=_[_0x12ce('0x3a')]({},_0x357d92,_0x4c2123[_0x12ce('0x42')]);return db['FaxQueueReport']['find'](_0x357d92)[_0x12ce('0x20')](handleEntityNotFound(_0x5da8de,null))['then'](respondWithResult(_0x5da8de,null))[_0x12ce('0x3f')](handleError(_0x5da8de,null));};exports[_0x12ce('0x43')]=function(_0x1342e9,_0xd17a37){return db[_0x12ce('0x26')][_0x12ce('0x43')](_0x1342e9['body'],{})[_0x12ce('0x20')](respondWithResult(_0xd17a37,0xc9))['catch'](handleError(_0xd17a37,null));};exports[_0x12ce('0x1e')]=function(_0x38eea7,_0x3a5849){if(_0x38eea7[_0x12ce('0x44')]['id']){delete _0x38eea7[_0x12ce('0x44')]['id'];}return db[_0x12ce('0x26')][_0x12ce('0x45')]({'where':{'id':_0x38eea7['params']['id']}})['then'](handleEntityNotFound(_0x3a5849,null))[_0x12ce('0x20')](saveUpdates(_0x38eea7[_0x12ce('0x44')],null))['then'](respondWithResult(_0x3a5849,null))['catch'](handleError(_0x3a5849,null));};exports[_0x12ce('0x1f')]=function(_0x3976eb,_0x7faa73){return db[_0x12ce('0x26')][_0x12ce('0x45')]({'where':{'id':_0x3976eb[_0x12ce('0x41')]['id']}})[_0x12ce('0x20')](handleEntityNotFound(_0x7faa73,null))[_0x12ce('0x20')](removeEntity(_0x7faa73,null))[_0x12ce('0x3f')](handleError(_0x7faa73,null));};exports[_0x12ce('0x46')]=function(_0x40502c,_0x178a0a){return db[_0x12ce('0x26')][_0x12ce('0x46')]()[_0x12ce('0x20')](respondWithResult(_0x178a0a,null))['catch'](handleError(_0x178a0a,null));}; \ No newline at end of file +var _0x0eec=['limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','json','apply','reject','update','destroy','then','end','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc0ee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc0ee('0x1'));var rp=require(_0xc0ee('0x2'));var moment=require(_0xc0ee('0x3'));var BPromise=require(_0xc0ee('0x4'));var Mustache=require(_0xc0ee('0x5'));var util=require(_0xc0ee('0x6'));var path=require(_0xc0ee('0x7'));var sox=require('sox');var csv=require(_0xc0ee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0ee('0x9'));var _=require(_0xc0ee('0xa'));var squel=require(_0xc0ee('0xb'));var crypto=require(_0xc0ee('0xc'));var jsforce=require(_0xc0ee('0xd'));var deskjs=require(_0xc0ee('0xe'));var toCsv=require(_0xc0ee('0x8'));var querystring=require('querystring');var Papa=require(_0xc0ee('0xf'));var Redis=require(_0xc0ee('0x10'));var authService=require(_0xc0ee('0x11'));var qs=require(_0xc0ee('0x12'));var as=require(_0xc0ee('0x13'));var hardwareService=require(_0xc0ee('0x14'));var logger=require(_0xc0ee('0x15'))('api');var utils=require(_0xc0ee('0x16'));var config=require(_0xc0ee('0x17'));var licenseUtil=require(_0xc0ee('0x18'));var db=require(_0xc0ee('0x19'))['db'];function respondWithStatusCode(_0x22d46b,_0x2d4e3c){_0x2d4e3c=_0x2d4e3c||0xcc;return function(_0x454f5d){if(_0x454f5d){return _0x22d46b[_0xc0ee('0x1a')](_0x2d4e3c);}return _0x22d46b[_0xc0ee('0x1b')](_0x2d4e3c)['end']();};}function respondWithResult(_0x51ae2e,_0x1f3ad9){_0x1f3ad9=_0x1f3ad9||0xc8;return function(_0x325193){if(_0x325193){return _0x51ae2e[_0xc0ee('0x1b')](_0x1f3ad9)['json'](_0x325193);}};}function respondWithFilteredResult(_0x170bf9,_0x30c324){return function(_0x448448){if(_0x448448){var _0x58e1f0=typeof _0x30c324['offset']===_0xc0ee('0x1c')&&typeof _0x30c324['limit']===_0xc0ee('0x1c');var _0x20195b=_0x448448[_0xc0ee('0x1d')];var _0x59aad9=_0x58e1f0?0x0:_0x30c324['offset'];var _0x16d050=_0x58e1f0?_0x448448[_0xc0ee('0x1d')]:_0x30c324[_0xc0ee('0x1e')]+_0x30c324['limit'];var _0x390ee4;if(_0x16d050>=_0x20195b){_0x16d050=_0x20195b;_0x390ee4=0xc8;}else{_0x390ee4=0xce;}_0x170bf9[_0xc0ee('0x1b')](_0x390ee4);return _0x170bf9['set']('Content-Range',_0x59aad9+'-'+_0x16d050+'/'+_0x20195b)[_0xc0ee('0x1f')](_0x448448);}return null;};}function patchUpdates(_0x233333){return function(_0x4dd8c9){try{jsonpatch[_0xc0ee('0x20')](_0x4dd8c9,_0x233333,!![]);}catch(_0x30a00c){return BPromise[_0xc0ee('0x21')](_0x30a00c);}return _0x4dd8c9['save']();};}function saveUpdates(_0x49be2a,_0x5af925){return function(_0x7ec74){if(_0x7ec74){return _0x7ec74[_0xc0ee('0x22')](_0x49be2a)['then'](function(_0x2c3d95){return _0x2c3d95;});}return null;};}function removeEntity(_0x453490,_0x20b657){return function(_0x11b6a4){if(_0x11b6a4){return _0x11b6a4[_0xc0ee('0x23')]()[_0xc0ee('0x24')](function(){_0x453490[_0xc0ee('0x1b')](0xcc)[_0xc0ee('0x25')]();});}};}function handleEntityNotFound(_0x38abc9,_0x6d1087){return function(_0x2b0584){if(!_0x2b0584){_0x38abc9[_0xc0ee('0x1a')](0x194);}return _0x2b0584;};}function handleError(_0x168ab5,_0x30582e){_0x30582e=_0x30582e||0x1f4;return function(_0x4288e1){logger['error'](_0x4288e1[_0xc0ee('0x26')]);if(_0x4288e1[_0xc0ee('0x27')]){delete _0x4288e1['name'];}_0x168ab5[_0xc0ee('0x1b')](_0x30582e)['send'](_0x4288e1);};}exports[_0xc0ee('0x28')]=function(_0x410fb2,_0x44b511){var _0x1d3594={},_0x46ca29={},_0x369764={'count':0x0,'rows':[]};var _0x24a67a=_[_0xc0ee('0x29')](db[_0xc0ee('0x2a')][_0xc0ee('0x2b')],function(_0x394777){return{'name':_0x394777[_0xc0ee('0x2c')],'type':_0x394777[_0xc0ee('0x2d')][_0xc0ee('0x2e')]};});_0x46ca29['model']=_['map'](_0x24a67a,_0xc0ee('0x27'));_0x46ca29[_0xc0ee('0x2f')]=_[_0xc0ee('0x30')](_0x410fb2[_0xc0ee('0x2f')]);_0x46ca29[_0xc0ee('0x31')]=_[_0xc0ee('0x32')](_0x46ca29[_0xc0ee('0x33')],_0x46ca29[_0xc0ee('0x2f')]);_0x1d3594[_0xc0ee('0x34')]=_[_0xc0ee('0x32')](_0x46ca29[_0xc0ee('0x33')],qs['fields'](_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x35')]));_0x1d3594[_0xc0ee('0x34')]=_0x1d3594[_0xc0ee('0x34')][_0xc0ee('0x36')]?_0x1d3594['attributes']:_0x46ca29[_0xc0ee('0x33')];if(!_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x37')]('nolimit')){_0x1d3594[_0xc0ee('0x38')]=qs[_0xc0ee('0x38')](_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x38')]);_0x1d3594['offset']=qs[_0xc0ee('0x1e')](_0x410fb2['query'][_0xc0ee('0x1e')]);}_0x1d3594[_0xc0ee('0x39')]=qs[_0xc0ee('0x3a')](_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x3a')]);_0x1d3594[_0xc0ee('0x3b')]=qs[_0xc0ee('0x31')](_[_0xc0ee('0x3c')](_0x410fb2[_0xc0ee('0x2f')],_0x46ca29[_0xc0ee('0x31')]),_0x24a67a);if(_0x410fb2[_0xc0ee('0x2f')]['filter']){_0x1d3594[_0xc0ee('0x3b')]=_[_0xc0ee('0x3d')](_0x1d3594[_0xc0ee('0x3b')],{'$or':_[_0xc0ee('0x29')](_0x24a67a,function(_0x1cb120){if(_0x1cb120[_0xc0ee('0x2d')]!==_0xc0ee('0x3e')){var _0x2d7b9e={};_0x2d7b9e[_0x1cb120['name']]={'$like':'%'+_0x410fb2['query'][_0xc0ee('0x3f')]+'%'};return _0x2d7b9e;}})});}_0x1d3594=_['merge']({},_0x1d3594,_0x410fb2[_0xc0ee('0x40')]);var _0xf46dc5={'where':_0x1d3594['where']};return db[_0xc0ee('0x2a')]['count'](_0xf46dc5)[_0xc0ee('0x24')](function(_0x4f385a){_0x369764['count']=_0x4f385a;if(_0x410fb2['query'][_0xc0ee('0x41')]){_0x1d3594[_0xc0ee('0x42')]=[{'all':!![]}];}return db[_0xc0ee('0x2a')][_0xc0ee('0x43')](_0x1d3594);})['then'](function(_0x3c0c7b){_0x369764[_0xc0ee('0x44')]=_0x3c0c7b;return _0x369764;})[_0xc0ee('0x24')](respondWithFilteredResult(_0x44b511,_0x1d3594))[_0xc0ee('0x45')](handleError(_0x44b511,null));};exports[_0xc0ee('0x46')]=function(_0x5c2111,_0x388c7b){var _0x264a41={'raw':!![],'where':{'id':_0x5c2111[_0xc0ee('0x47')]['id']}},_0x5577aa={};_0x5577aa['model']=_[_0xc0ee('0x30')](db[_0xc0ee('0x2a')]['rawAttributes']);_0x5577aa[_0xc0ee('0x2f')]=_[_0xc0ee('0x30')](_0x5c2111['query']);_0x5577aa[_0xc0ee('0x31')]=_[_0xc0ee('0x32')](_0x5577aa['model'],_0x5577aa[_0xc0ee('0x2f')]);_0x264a41[_0xc0ee('0x34')]=_[_0xc0ee('0x32')](_0x5577aa[_0xc0ee('0x33')],qs[_0xc0ee('0x35')](_0x5c2111['query']['fields']));_0x264a41[_0xc0ee('0x34')]=_0x264a41[_0xc0ee('0x34')][_0xc0ee('0x36')]?_0x264a41[_0xc0ee('0x34')]:_0x5577aa['model'];if(_0x5c2111['query'][_0xc0ee('0x41')]){_0x264a41[_0xc0ee('0x42')]=[{'all':!![]}];}_0x264a41=_[_0xc0ee('0x3d')]({},_0x264a41,_0x5c2111['options']);return db['FaxQueueReport'][_0xc0ee('0x48')](_0x264a41)[_0xc0ee('0x24')](handleEntityNotFound(_0x388c7b,null))[_0xc0ee('0x24')](respondWithResult(_0x388c7b,null))['catch'](handleError(_0x388c7b,null));};exports[_0xc0ee('0x49')]=function(_0x3d6a10,_0x5e5f5e){return db[_0xc0ee('0x2a')][_0xc0ee('0x49')](_0x3d6a10[_0xc0ee('0x4a')],{})[_0xc0ee('0x24')](respondWithResult(_0x5e5f5e,0xc9))['catch'](handleError(_0x5e5f5e,null));};exports['update']=function(_0x22c742,_0x5ca93b){if(_0x22c742['body']['id']){delete _0x22c742['body']['id'];}return db[_0xc0ee('0x2a')]['find']({'where':{'id':_0x22c742[_0xc0ee('0x47')]['id']}})[_0xc0ee('0x24')](handleEntityNotFound(_0x5ca93b,null))[_0xc0ee('0x24')](saveUpdates(_0x22c742['body'],null))[_0xc0ee('0x24')](respondWithResult(_0x5ca93b,null))['catch'](handleError(_0x5ca93b,null));};exports[_0xc0ee('0x23')]=function(_0x4b2fcc,_0x3bb5ae){return db[_0xc0ee('0x2a')][_0xc0ee('0x48')]({'where':{'id':_0x4b2fcc[_0xc0ee('0x47')]['id']}})[_0xc0ee('0x24')](handleEntityNotFound(_0x3bb5ae,null))[_0xc0ee('0x24')](removeEntity(_0x3bb5ae,null))['catch'](handleError(_0x3bb5ae,null));};exports['describe']=function(_0x6e6b2c,_0x497ed9){return db[_0xc0ee('0x2a')][_0xc0ee('0x4b')]()[_0xc0ee('0x24')](respondWithResult(_0x497ed9,null))[_0xc0ee('0x45')](handleError(_0x497ed9,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5ec1ad9..385fc3c 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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b6895,_0x1b5107){var _0x21f2c0=function(_0x16005e){while(--_0x16005e){_0x5b6895['push'](_0x5b6895['shift']());}};_0x21f2c0(++_0x1b5107);}(_0x53ec,0x192));var _0xc53e=function(_0x415005,_0x595685){_0x415005=_0x415005-0x0;var _0x50002f=_0x53ec[_0x415005];return _0x50002f;};'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':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x4e9e17,_0x193522){var _0x8802d2=function(_0x5979a5){while(--_0x5979a5){_0x4e9e17['push'](_0x4e9e17['shift']());}};_0x8802d2(++_0x193522);}(_0x326f,0xd1));var _0xf326=function(_0x2cdde9,_0x4b5439){_0x2cdde9=_0x2cdde9-0x0;var _0x3009ad=_0x326f[_0x2cdde9];return _0x3009ad;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 950309a..9a77a00 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 _0x6bb3=['FaxQueueReport','create','body','options','raw','debug','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x6bb3,0x18c));var _0x36bb=function(_0x5e55e0,_0x5e4b37){_0x5e55e0=_0x5e55e0-0x0;var _0x161e2e=_0x6bb3[_0x5e55e0];return _0x161e2e;};'use strict';var _=require(_0x36bb('0x0'));var util=require(_0x36bb('0x1'));var moment=require(_0x36bb('0x2'));var BPromise=require(_0x36bb('0x3'));var rs=require(_0x36bb('0x4'));var fs=require('fs');var Redis=require(_0x36bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x36bb('0x6'));var logger=require(_0x36bb('0x7'))(_0x36bb('0x8'));var config=require(_0x36bb('0x9'));var jayson=require(_0x36bb('0xa'));var client=jayson['client'][_0x36bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f39f7,_0x32ba9b,_0x318d1f){return new BPromise(function(_0x4accd4,_0x2be582){return client[_0x36bb('0xc')](_0x2f39f7,_0x318d1f)[_0x36bb('0xd')](function(_0x38f02b){logger[_0x36bb('0xe')](_0x36bb('0xf'),_0x32ba9b,'request\x20sent');logger['debug'](_0x36bb('0x10'),_0x32ba9b,_0x36bb('0x11'),JSON[_0x36bb('0x12')](_0x38f02b));if(_0x38f02b['error']){if(_0x38f02b[_0x36bb('0x13')][_0x36bb('0x14')]===0x1f4){logger[_0x36bb('0x13')](_0x36bb('0xf'),_0x32ba9b,_0x38f02b[_0x36bb('0x13')][_0x36bb('0x15')]);return _0x2be582(_0x38f02b['error'][_0x36bb('0x15')]);}logger[_0x36bb('0x13')](_0x36bb('0xf'),_0x32ba9b,_0x38f02b['error'][_0x36bb('0x15')]);return _0x4accd4(_0x38f02b['error'][_0x36bb('0x15')]);}else{logger[_0x36bb('0xe')](_0x36bb('0xf'),_0x32ba9b,_0x36bb('0x11'));_0x4accd4(_0x38f02b[_0x36bb('0x16')]['message']);}})[_0x36bb('0x17')](function(_0x57a26a){logger[_0x36bb('0x13')](_0x36bb('0xf'),_0x32ba9b,_0x57a26a);_0x2be582(_0x57a26a);});});}exports['CreateFaxQueueReport']=function(_0x4503fc){var _0x442586=this;return new Promise(function(_0x58d78c,_0x12c3bc){return db[_0x36bb('0x18')][_0x36bb('0x19')](_0x4503fc[_0x36bb('0x1a')],{'raw':_0x4503fc[_0x36bb('0x1b')]?_0x4503fc['options'][_0x36bb('0x1c')]===undefined?!![]:![]:!![]})[_0x36bb('0xd')](function(_0x21d583){logger['info']('CreateFaxQueueReport',_0x4503fc);logger[_0x36bb('0x1d')](_0x36bb('0x1e'),_0x4503fc,JSON['stringify'](_0x21d583));_0x58d78c(_0x21d583);})[_0x36bb('0x17')](function(_0x5165c2){logger['error'](_0x36bb('0x1e'),_0x5165c2[_0x36bb('0x15')],_0x4503fc);_0x12c3bc(_0x442586['error'](0x1f4,_0x5165c2['message']));});});};exports[_0x36bb('0x1f')]=function(_0x39cb37){var _0x178afc=this;return new Promise(function(_0x154d6b,_0x59b21a){return db[_0x36bb('0x18')][_0x36bb('0x20')](_0x39cb37[_0x36bb('0x1a')],{'raw':_0x39cb37['options']?_0x39cb37[_0x36bb('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39cb37[_0x36bb('0x1b')]?_0x39cb37[_0x36bb('0x1b')][_0x36bb('0x21')]||null:null,'attributes':_0x39cb37[_0x36bb('0x1b')]?_0x39cb37[_0x36bb('0x1b')][_0x36bb('0x22')]||null:null,'limit':_0x39cb37[_0x36bb('0x1b')]?_0x39cb37[_0x36bb('0x1b')]['limit']||null:null})[_0x36bb('0xd')](function(_0x43967a){logger['info'](_0x36bb('0x1f'),_0x39cb37);logger['debug']('UpdateFaxQueueReport',_0x39cb37,JSON['stringify'](_0x43967a));_0x154d6b(_0x43967a);})['catch'](function(_0x2d8e34){logger['error'](_0x36bb('0x1f'),_0x2d8e34['message'],_0x39cb37);_0x59b21a(_0x178afc['error'](0x1f4,_0x2d8e34['message']));});});}; \ No newline at end of file +var _0xb93e=['../../config/logger','../../config/environment','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x65c885,_0x6782e8){var _0x42df45=function(_0x2f3024){while(--_0x2f3024){_0x65c885['push'](_0x65c885['shift']());}};_0x42df45(++_0x6782e8);}(_0xb93e,0xf3));var _0xeb93=function(_0x4d2076,_0x3d726f){_0x4d2076=_0x4d2076-0x0;var _0x3e7b99=_0xb93e[_0x4d2076];return _0x3e7b99;};'use strict';var _=require(_0xeb93('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeb93('0x1'));var rs=require(_0xeb93('0x2'));var fs=require('fs');var Redis=require(_0xeb93('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb93('0x4'));var logger=require(_0xeb93('0x5'))('rpc');var config=require(_0xeb93('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeb93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4eb569,_0x5a4cb4,_0x2a9860){return new BPromise(function(_0x39a6fc,_0x404533){return client[_0xeb93('0x8')](_0x4eb569,_0x2a9860)[_0xeb93('0x9')](function(_0x53ee56){logger[_0xeb93('0xa')](_0xeb93('0xb'),_0x5a4cb4,_0xeb93('0xc'));logger[_0xeb93('0xd')](_0xeb93('0xe'),_0x5a4cb4,_0xeb93('0xc'),JSON[_0xeb93('0xf')](_0x53ee56));if(_0x53ee56[_0xeb93('0x10')]){if(_0x53ee56['error'][_0xeb93('0x11')]===0x1f4){logger[_0xeb93('0x10')](_0xeb93('0xb'),_0x5a4cb4,_0x53ee56[_0xeb93('0x10')][_0xeb93('0x12')]);return _0x404533(_0x53ee56['error'][_0xeb93('0x12')]);}logger[_0xeb93('0x10')](_0xeb93('0xb'),_0x5a4cb4,_0x53ee56[_0xeb93('0x10')][_0xeb93('0x12')]);return _0x39a6fc(_0x53ee56['error'][_0xeb93('0x12')]);}else{logger['info'](_0xeb93('0xb'),_0x5a4cb4,_0xeb93('0xc'));_0x39a6fc(_0x53ee56['result'][_0xeb93('0x12')]);}})[_0xeb93('0x13')](function(_0x43dab9){logger[_0xeb93('0x10')](_0xeb93('0xb'),_0x5a4cb4,_0x43dab9);_0x404533(_0x43dab9);});});}exports['CreateFaxQueueReport']=function(_0x130b0a){var _0x1fb14b=this;return new Promise(function(_0x453596,_0x5eb71c){return db['FaxQueueReport'][_0xeb93('0x14')](_0x130b0a[_0xeb93('0x15')],{'raw':_0x130b0a[_0xeb93('0x16')]?_0x130b0a[_0xeb93('0x16')][_0xeb93('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xa97094){logger['info']('CreateFaxQueueReport',_0x130b0a);logger[_0xeb93('0xd')](_0xeb93('0x18'),_0x130b0a,JSON['stringify'](_0xa97094));_0x453596(_0xa97094);})[_0xeb93('0x13')](function(_0x1ccbb0){logger[_0xeb93('0x10')](_0xeb93('0x18'),_0x1ccbb0[_0xeb93('0x12')],_0x130b0a);_0x5eb71c(_0x1fb14b['error'](0x1f4,_0x1ccbb0[_0xeb93('0x12')]));});});};exports[_0xeb93('0x19')]=function(_0x3b5e90){var _0x552b63=this;return new Promise(function(_0x567087,_0x238615){return db[_0xeb93('0x1a')][_0xeb93('0x1b')](_0x3b5e90[_0xeb93('0x15')],{'raw':_0x3b5e90[_0xeb93('0x16')]?_0x3b5e90[_0xeb93('0x16')][_0xeb93('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b5e90[_0xeb93('0x16')]?_0x3b5e90[_0xeb93('0x16')][_0xeb93('0x1c')]||null:null,'attributes':_0x3b5e90[_0xeb93('0x16')]?_0x3b5e90[_0xeb93('0x16')][_0xeb93('0x1d')]||null:null,'limit':_0x3b5e90[_0xeb93('0x16')]?_0x3b5e90[_0xeb93('0x16')][_0xeb93('0x1e')]||null:null})[_0xeb93('0x9')](function(_0x4696b4){logger['info'](_0xeb93('0x19'),_0x3b5e90);logger[_0xeb93('0xd')](_0xeb93('0x19'),_0x3b5e90,JSON[_0xeb93('0xf')](_0x4696b4));_0x567087(_0x4696b4);})[_0xeb93('0x13')](function(_0x5d3b82){logger[_0xeb93('0x10')]('UpdateFaxQueueReport',_0x5d3b82[_0xeb93('0x12')],_0x3b5e90);_0x238615(_0x552b63['error'](0x1f4,_0x5d3b82[_0xeb93('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 71f778c..2c9f939 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 _0xe717=['post','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1ff94f,_0x2870a4){var _0x5b602f=function(_0xa25013){while(--_0xa25013){_0x1ff94f['push'](_0x1ff94f['shift']());}};_0x5b602f(++_0x2870a4);}(_0xe717,0x1de));var _0x7e71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe717[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7e71('0x0'));var util=require(_0x7e71('0x1'));var path=require(_0x7e71('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e71('0x3'));var router=express[_0x7e71('0x4')]();var fs_extra=require(_0x7e71('0x5'));var auth=require(_0x7e71('0x6'));var interaction=require(_0x7e71('0x7'));var config=require(_0x7e71('0x8'));var controller=require('./faxQueueReport.controller');router[_0x7e71('0x9')]('/',auth[_0x7e71('0xa')](),controller[_0x7e71('0xb')]);router[_0x7e71('0x9')](_0x7e71('0xc'),auth[_0x7e71('0xa')](),controller[_0x7e71('0xd')]);router[_0x7e71('0x9')](_0x7e71('0xe'),auth[_0x7e71('0xa')](),controller[_0x7e71('0xf')]);router[_0x7e71('0x10')]('/',auth[_0x7e71('0xa')](),controller['create']);router['put'](_0x7e71('0xe'),auth[_0x7e71('0xa')](),controller[_0x7e71('0x11')]);router['delete']('/:id',auth[_0x7e71('0xa')](),controller['destroy']);module[_0x7e71('0x12')]=router; \ No newline at end of file +var _0x75a9=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','show','post','put','/:id'];(function(_0x2fa4ee,_0x3e1dea){var _0x11b8aa=function(_0x47d194){while(--_0x47d194){_0x2fa4ee['push'](_0x2fa4ee['shift']());}};_0x11b8aa(++_0x3e1dea);}(_0x75a9,0x1bc));var _0x975a=function(_0x5d4cbf,_0x5530b6){_0x5d4cbf=_0x5d4cbf-0x0;var _0xcb5648=_0x75a9[_0x5d4cbf];return _0xcb5648;};'use strict';var multer=require(_0x975a('0x0'));var util=require('util');var path=require(_0x975a('0x1'));var timeout=require(_0x975a('0x2'));var express=require(_0x975a('0x3'));var router=express[_0x975a('0x4')]();var fs_extra=require(_0x975a('0x5'));var auth=require(_0x975a('0x6'));var interaction=require(_0x975a('0x7'));var config=require(_0x975a('0x8'));var controller=require(_0x975a('0x9'));router['get']('/',auth[_0x975a('0xa')](),controller[_0x975a('0xb')]);router[_0x975a('0xc')](_0x975a('0xd'),auth[_0x975a('0xa')](),controller['describe']);router['get']('/:id',auth[_0x975a('0xa')](),controller[_0x975a('0xe')]);router[_0x975a('0xf')]('/',auth[_0x975a('0xa')](),controller['create']);router[_0x975a('0x10')](_0x975a('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x975a('0x12')](_0x975a('0x11'),auth[_0x975a('0xa')](),controller[_0x975a('0x13')]);module[_0x975a('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index c3b88ec..22ef195 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(_0x137987,_0x20162c){var _0x597cae=function(_0x48ecb5){while(--_0x48ecb5){_0x137987['push'](_0x137987['shift']());}};_0x597cae(++_0x20162c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0xf3cd[_0x149083];return _0x4dc74e;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x34e8,0x12c));var _0x834e=function(_0x21188b,_0x1de902){_0x21188b=_0x21188b-0x0;var _0x3d682c=_0x34e8[_0x21188b];return _0x3d682c;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1dc8c62..17c7b06 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 _0xf49f=['includeAll','include','findAll','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','error','name','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FaxTransferReport','then'];(function(_0x313986,_0x4206c5){var _0x417a8b=function(_0x3d1b10){while(--_0x3d1b10){_0x313986['push'](_0x313986['shift']());}};_0x417a8b(++_0x4206c5);}(_0xf49f,0xde));var _0xff49=function(_0x4dad77,_0x4d5f12){_0x4dad77=_0x4dad77-0x0;var _0x3c80a3=_0xf49f[_0x4dad77];return _0x3c80a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff49('0x0'));var zipdir=require(_0xff49('0x1'));var jsonpatch=require(_0xff49('0x2'));var rp=require(_0xff49('0x3'));var moment=require(_0xff49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff49('0x5'));var util=require(_0xff49('0x6'));var path=require(_0xff49('0x7'));var sox=require('sox');var csv=require(_0xff49('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff49('0x9'));var _=require(_0xff49('0xa'));var squel=require(_0xff49('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff49('0xc'));var toCsv=require(_0xff49('0x8'));var querystring=require(_0xff49('0xd'));var Papa=require(_0xff49('0xe'));var Redis=require(_0xff49('0xf'));var authService=require(_0xff49('0x10'));var qs=require(_0xff49('0x11'));var as=require(_0xff49('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff49('0x13'))(_0xff49('0x14'));var utils=require(_0xff49('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xff49('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b0fef,_0x11ea7a){_0x11ea7a=_0x11ea7a||0xcc;return function(_0x4e75bb){if(_0x4e75bb){return _0x1b0fef[_0xff49('0x17')](_0x11ea7a);}return _0x1b0fef['status'](_0x11ea7a)[_0xff49('0x18')]();};}function respondWithResult(_0x5c544d,_0x1b7b9f){_0x1b7b9f=_0x1b7b9f||0xc8;return function(_0x13f680){if(_0x13f680){return _0x5c544d[_0xff49('0x19')](_0x1b7b9f)['json'](_0x13f680);}};}function respondWithFilteredResult(_0x3099a2,_0x1dfca3){return function(_0x1ce17c){if(_0x1ce17c){var _0x3cfd0f=typeof _0x1dfca3[_0xff49('0x1a')]===_0xff49('0x1b')&&typeof _0x1dfca3[_0xff49('0x1c')]===_0xff49('0x1b');var _0x3d54b1=_0x1ce17c[_0xff49('0x1d')];var _0xd49f93=_0x3cfd0f?0x0:_0x1dfca3[_0xff49('0x1a')];var _0x327638=_0x3cfd0f?_0x1ce17c[_0xff49('0x1d')]:_0x1dfca3[_0xff49('0x1a')]+_0x1dfca3['limit'];var _0x47c005;if(_0x327638>=_0x3d54b1){_0x327638=_0x3d54b1;_0x47c005=0xc8;}else{_0x47c005=0xce;}_0x3099a2['status'](_0x47c005);return _0x3099a2['set'](_0xff49('0x1e'),_0xd49f93+'-'+_0x327638+'/'+_0x3d54b1)[_0xff49('0x1f')](_0x1ce17c);}return null;};}function patchUpdates(_0x299b36){return function(_0x35e963){try{jsonpatch[_0xff49('0x20')](_0x35e963,_0x299b36,!![]);}catch(_0x10e8f2){return BPromise[_0xff49('0x21')](_0x10e8f2);}return _0x35e963[_0xff49('0x22')]();};}function saveUpdates(_0x50d36e,_0x1a9c30){return function(_0x451c80){if(_0x451c80){return _0x451c80[_0xff49('0x23')](_0x50d36e)['then'](function(_0x2ecbf1){return _0x2ecbf1;});}return null;};}function removeEntity(_0x4cd657,_0x554fb5){return function(_0x850963){if(_0x850963){return _0x850963[_0xff49('0x24')]()['then'](function(){_0x4cd657[_0xff49('0x19')](0xcc)[_0xff49('0x18')]();});}};}function handleEntityNotFound(_0x1e4ad0,_0x26a27d){return function(_0x2da03f){if(!_0x2da03f){_0x1e4ad0[_0xff49('0x17')](0x194);}return _0x2da03f;};}function handleError(_0x26b3ac,_0x38ba22){_0x38ba22=_0x38ba22||0x1f4;return function(_0x5096f7){logger[_0xff49('0x25')](_0x5096f7['stack']);if(_0x5096f7[_0xff49('0x26')]){delete _0x5096f7['name'];}_0x26b3ac[_0xff49('0x19')](_0x38ba22)['send'](_0x5096f7);};}exports['index']=function(_0x2ba853,_0x591b5e){var _0x3c94ff={},_0x5571ee={},_0x1fc5e6={'count':0x0,'rows':[]};var _0x2efa3c=_[_0xff49('0x27')](db['FaxTransferReport'][_0xff49('0x28')],function(_0x5d6337){return{'name':_0x5d6337['fieldName'],'type':_0x5d6337[_0xff49('0x29')][_0xff49('0x2a')]};});_0x5571ee['model']=_['map'](_0x2efa3c,'name');_0x5571ee[_0xff49('0x2b')]=_[_0xff49('0x2c')](_0x2ba853[_0xff49('0x2b')]);_0x5571ee[_0xff49('0x2d')]=_[_0xff49('0x2e')](_0x5571ee[_0xff49('0x2f')],_0x5571ee['query']);_0x3c94ff['attributes']=_[_0xff49('0x2e')](_0x5571ee[_0xff49('0x2f')],qs['fields'](_0x2ba853[_0xff49('0x2b')][_0xff49('0x30')]));_0x3c94ff['attributes']=_0x3c94ff[_0xff49('0x31')][_0xff49('0x32')]?_0x3c94ff['attributes']:_0x5571ee[_0xff49('0x2f')];if(!_0x2ba853[_0xff49('0x2b')][_0xff49('0x33')](_0xff49('0x34'))){_0x3c94ff[_0xff49('0x1c')]=qs[_0xff49('0x1c')](_0x2ba853[_0xff49('0x2b')][_0xff49('0x1c')]);_0x3c94ff[_0xff49('0x1a')]=qs[_0xff49('0x1a')](_0x2ba853[_0xff49('0x2b')][_0xff49('0x1a')]);}_0x3c94ff[_0xff49('0x35')]=qs['sort'](_0x2ba853['query'][_0xff49('0x36')]);_0x3c94ff[_0xff49('0x37')]=qs[_0xff49('0x2d')](_[_0xff49('0x38')](_0x2ba853[_0xff49('0x2b')],_0x5571ee['filters']),_0x2efa3c);if(_0x2ba853[_0xff49('0x2b')][_0xff49('0x39')]){_0x3c94ff['where']=_[_0xff49('0x3a')](_0x3c94ff[_0xff49('0x37')],{'$or':_[_0xff49('0x27')](_0x2efa3c,function(_0x470961){if(_0x470961['type']!=='VIRTUAL'){var _0x267f66={};_0x267f66[_0x470961[_0xff49('0x26')]]={'$like':'%'+_0x2ba853['query']['filter']+'%'};return _0x267f66;}})});}_0x3c94ff=_[_0xff49('0x3a')]({},_0x3c94ff,_0x2ba853[_0xff49('0x3b')]);var _0x1734fc={'where':_0x3c94ff[_0xff49('0x37')]};return db[_0xff49('0x3c')][_0xff49('0x1d')](_0x1734fc)[_0xff49('0x3d')](function(_0x55dbab){_0x1fc5e6[_0xff49('0x1d')]=_0x55dbab;if(_0x2ba853['query'][_0xff49('0x3e')]){_0x3c94ff[_0xff49('0x3f')]=[{'all':!![]}];}return db[_0xff49('0x3c')][_0xff49('0x40')](_0x3c94ff);})[_0xff49('0x3d')](function(_0x469e33){_0x1fc5e6['rows']=_0x469e33;return _0x1fc5e6;})[_0xff49('0x3d')](respondWithFilteredResult(_0x591b5e,_0x3c94ff))[_0xff49('0x41')](handleError(_0x591b5e,null));};exports[_0xff49('0x42')]=function(_0x54194a,_0x225393){var _0x276162={'raw':!![],'where':{'id':_0x54194a['params']['id']}},_0x24bfa8={};_0x24bfa8[_0xff49('0x2f')]=_[_0xff49('0x2c')](db['FaxTransferReport'][_0xff49('0x28')]);_0x24bfa8[_0xff49('0x2b')]=_[_0xff49('0x2c')](_0x54194a[_0xff49('0x2b')]);_0x24bfa8[_0xff49('0x2d')]=_[_0xff49('0x2e')](_0x24bfa8['model'],_0x24bfa8[_0xff49('0x2b')]);_0x276162[_0xff49('0x31')]=_[_0xff49('0x2e')](_0x24bfa8[_0xff49('0x2f')],qs[_0xff49('0x30')](_0x54194a['query'][_0xff49('0x30')]));_0x276162[_0xff49('0x31')]=_0x276162[_0xff49('0x31')][_0xff49('0x32')]?_0x276162[_0xff49('0x31')]:_0x24bfa8[_0xff49('0x2f')];if(_0x54194a[_0xff49('0x2b')][_0xff49('0x3e')]){_0x276162['include']=[{'all':!![]}];}_0x276162=_[_0xff49('0x3a')]({},_0x276162,_0x54194a[_0xff49('0x3b')]);return db[_0xff49('0x3c')][_0xff49('0x43')](_0x276162)[_0xff49('0x3d')](handleEntityNotFound(_0x225393,null))[_0xff49('0x3d')](respondWithResult(_0x225393,null))[_0xff49('0x41')](handleError(_0x225393,null));};exports['create']=function(_0x5f0dd4,_0x5232c5){return db[_0xff49('0x3c')][_0xff49('0x44')](_0x5f0dd4[_0xff49('0x45')],{})[_0xff49('0x3d')](respondWithResult(_0x5232c5,0xc9))[_0xff49('0x41')](handleError(_0x5232c5,null));};exports[_0xff49('0x23')]=function(_0x47370c,_0x5539d1){if(_0x47370c[_0xff49('0x45')]['id']){delete _0x47370c[_0xff49('0x45')]['id'];}return db['FaxTransferReport'][_0xff49('0x43')]({'where':{'id':_0x47370c[_0xff49('0x46')]['id']}})[_0xff49('0x3d')](handleEntityNotFound(_0x5539d1,null))['then'](saveUpdates(_0x47370c['body'],null))['then'](respondWithResult(_0x5539d1,null))[_0xff49('0x41')](handleError(_0x5539d1,null));};exports[_0xff49('0x24')]=function(_0x320ff5,_0x29ad94){return db[_0xff49('0x3c')][_0xff49('0x43')]({'where':{'id':_0x320ff5[_0xff49('0x46')]['id']}})[_0xff49('0x3d')](handleEntityNotFound(_0x29ad94,null))['then'](removeEntity(_0x29ad94,null))[_0xff49('0x41')](handleError(_0x29ad94,null));};exports['describe']=function(_0x3e2a31,_0x2d943b){return db['FaxTransferReport']['describe']()[_0xff49('0x3d')](respondWithResult(_0x2d943b,null))[_0xff49('0x41')](handleError(_0x2d943b,null));}; \ No newline at end of file +var _0x9226=['pick','merge','filter','options','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x1f703c,_0x30954a){var _0x333466=function(_0x32aafd){while(--_0x32aafd){_0x1f703c['push'](_0x1f703c['shift']());}};_0x333466(++_0x30954a);}(_0x9226,0x142));var _0x6922=function(_0x13b233,_0x2cc623){_0x13b233=_0x13b233-0x0;var _0x448340=_0x9226[_0x13b233];return _0x448340;};'use strict';var emlformat=require(_0x6922('0x0'));var rimraf=require(_0x6922('0x1'));var zipdir=require(_0x6922('0x2'));var jsonpatch=require(_0x6922('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6922('0x4'));var Mustache=require(_0x6922('0x5'));var util=require(_0x6922('0x6'));var path=require(_0x6922('0x7'));var sox=require(_0x6922('0x8'));var csv=require('to-csv');var ejs=require(_0x6922('0x9'));var fs=require('fs');var fs_extra=require(_0x6922('0xa'));var _=require(_0x6922('0xb'));var squel=require(_0x6922('0xc'));var crypto=require(_0x6922('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6922('0xe'));var toCsv=require(_0x6922('0xf'));var querystring=require(_0x6922('0x10'));var Papa=require(_0x6922('0x11'));var Redis=require('ioredis');var authService=require(_0x6922('0x12'));var qs=require(_0x6922('0x13'));var as=require(_0x6922('0x14'));var hardwareService=require(_0x6922('0x15'));var logger=require('../../config/logger')(_0x6922('0x16'));var utils=require(_0x6922('0x17'));var config=require(_0x6922('0x18'));var licenseUtil=require(_0x6922('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1740c9,_0x324112){_0x324112=_0x324112||0xcc;return function(_0x5e4ba9){if(_0x5e4ba9){return _0x1740c9[_0x6922('0x1a')](_0x324112);}return _0x1740c9['status'](_0x324112)['end']();};}function respondWithResult(_0xb07fc1,_0x3b0e20){_0x3b0e20=_0x3b0e20||0xc8;return function(_0x2bd837){if(_0x2bd837){return _0xb07fc1[_0x6922('0x1b')](_0x3b0e20)['json'](_0x2bd837);}};}function respondWithFilteredResult(_0x210286,_0x3b7ec0){return function(_0x3eec34){if(_0x3eec34){var _0x376f93=typeof _0x3b7ec0[_0x6922('0x1c')]==='undefined'&&typeof _0x3b7ec0['limit']===_0x6922('0x1d');var _0x479601=_0x3eec34['count'];var _0x4de4e6=_0x376f93?0x0:_0x3b7ec0['offset'];var _0x1f7251=_0x376f93?_0x3eec34[_0x6922('0x1e')]:_0x3b7ec0[_0x6922('0x1c')]+_0x3b7ec0[_0x6922('0x1f')];var _0x1f335b;if(_0x1f7251>=_0x479601){_0x1f7251=_0x479601;_0x1f335b=0xc8;}else{_0x1f335b=0xce;}_0x210286[_0x6922('0x1b')](_0x1f335b);return _0x210286[_0x6922('0x20')]('Content-Range',_0x4de4e6+'-'+_0x1f7251+'/'+_0x479601)[_0x6922('0x21')](_0x3eec34);}return null;};}function patchUpdates(_0x4d766f){return function(_0x48bbfe){try{jsonpatch[_0x6922('0x22')](_0x48bbfe,_0x4d766f,!![]);}catch(_0x3773d7){return BPromise[_0x6922('0x23')](_0x3773d7);}return _0x48bbfe[_0x6922('0x24')]();};}function saveUpdates(_0x59a7ec,_0x3b4ef6){return function(_0x1e991f){if(_0x1e991f){return _0x1e991f[_0x6922('0x25')](_0x59a7ec)[_0x6922('0x26')](function(_0x244927){return _0x244927;});}return null;};}function removeEntity(_0x6b7331,_0x3b84f5){return function(_0xe3b99){if(_0xe3b99){return _0xe3b99[_0x6922('0x27')]()[_0x6922('0x26')](function(){_0x6b7331[_0x6922('0x1b')](0xcc)[_0x6922('0x28')]();});}};}function handleEntityNotFound(_0x16bcf2,_0x3c7a3a){return function(_0x265c36){if(!_0x265c36){_0x16bcf2[_0x6922('0x1a')](0x194);}return _0x265c36;};}function handleError(_0x4e7853,_0xcbe82d){_0xcbe82d=_0xcbe82d||0x1f4;return function(_0x3a5a2d){logger[_0x6922('0x29')](_0x3a5a2d[_0x6922('0x2a')]);if(_0x3a5a2d[_0x6922('0x2b')]){delete _0x3a5a2d['name'];}_0x4e7853[_0x6922('0x1b')](_0xcbe82d)[_0x6922('0x2c')](_0x3a5a2d);};}exports[_0x6922('0x2d')]=function(_0x6fbbc2,_0x945fff){var _0x3407f0={},_0x374ff7={},_0x375fea={'count':0x0,'rows':[]};var _0x124290=_[_0x6922('0x2e')](db[_0x6922('0x2f')][_0x6922('0x30')],function(_0x3075ab){return{'name':_0x3075ab['fieldName'],'type':_0x3075ab[_0x6922('0x31')][_0x6922('0x32')]};});_0x374ff7[_0x6922('0x33')]=_[_0x6922('0x2e')](_0x124290,_0x6922('0x2b'));_0x374ff7[_0x6922('0x34')]=_[_0x6922('0x35')](_0x6fbbc2[_0x6922('0x34')]);_0x374ff7[_0x6922('0x36')]=_[_0x6922('0x37')](_0x374ff7['model'],_0x374ff7[_0x6922('0x34')]);_0x3407f0['attributes']=_[_0x6922('0x37')](_0x374ff7[_0x6922('0x33')],qs['fields'](_0x6fbbc2[_0x6922('0x34')][_0x6922('0x38')]));_0x3407f0[_0x6922('0x39')]=_0x3407f0[_0x6922('0x39')][_0x6922('0x3a')]?_0x3407f0[_0x6922('0x39')]:_0x374ff7[_0x6922('0x33')];if(!_0x6fbbc2[_0x6922('0x34')][_0x6922('0x3b')]('nolimit')){_0x3407f0[_0x6922('0x1f')]=qs[_0x6922('0x1f')](_0x6fbbc2[_0x6922('0x34')][_0x6922('0x1f')]);_0x3407f0[_0x6922('0x1c')]=qs[_0x6922('0x1c')](_0x6fbbc2[_0x6922('0x34')]['offset']);}_0x3407f0[_0x6922('0x3c')]=qs[_0x6922('0x3d')](_0x6fbbc2[_0x6922('0x34')]['sort']);_0x3407f0[_0x6922('0x3e')]=qs[_0x6922('0x36')](_[_0x6922('0x3f')](_0x6fbbc2[_0x6922('0x34')],_0x374ff7[_0x6922('0x36')]),_0x124290);if(_0x6fbbc2['query']['filter']){_0x3407f0[_0x6922('0x3e')]=_[_0x6922('0x40')](_0x3407f0[_0x6922('0x3e')],{'$or':_[_0x6922('0x2e')](_0x124290,function(_0x748bb0){if(_0x748bb0['type']!=='VIRTUAL'){var _0x28616b={};_0x28616b[_0x748bb0['name']]={'$like':'%'+_0x6fbbc2['query'][_0x6922('0x41')]+'%'};return _0x28616b;}})});}_0x3407f0=_[_0x6922('0x40')]({},_0x3407f0,_0x6fbbc2[_0x6922('0x42')]);var _0x476acb={'where':_0x3407f0['where']};return db[_0x6922('0x2f')]['count'](_0x476acb)[_0x6922('0x26')](function(_0x729b4a){_0x375fea[_0x6922('0x1e')]=_0x729b4a;if(_0x6fbbc2[_0x6922('0x34')]['includeAll']){_0x3407f0[_0x6922('0x43')]=[{'all':!![]}];}return db[_0x6922('0x2f')]['findAll'](_0x3407f0);})['then'](function(_0x4a1f6b){_0x375fea[_0x6922('0x44')]=_0x4a1f6b;return _0x375fea;})['then'](respondWithFilteredResult(_0x945fff,_0x3407f0))[_0x6922('0x45')](handleError(_0x945fff,null));};exports[_0x6922('0x46')]=function(_0xe33165,_0x207013){var _0x1dfb97={'raw':!![],'where':{'id':_0xe33165[_0x6922('0x47')]['id']}},_0x2bfac4={};_0x2bfac4[_0x6922('0x33')]=_['keys'](db['FaxTransferReport'][_0x6922('0x30')]);_0x2bfac4[_0x6922('0x34')]=_[_0x6922('0x35')](_0xe33165[_0x6922('0x34')]);_0x2bfac4[_0x6922('0x36')]=_['intersection'](_0x2bfac4[_0x6922('0x33')],_0x2bfac4[_0x6922('0x34')]);_0x1dfb97['attributes']=_[_0x6922('0x37')](_0x2bfac4[_0x6922('0x33')],qs[_0x6922('0x38')](_0xe33165[_0x6922('0x34')][_0x6922('0x38')]));_0x1dfb97[_0x6922('0x39')]=_0x1dfb97[_0x6922('0x39')][_0x6922('0x3a')]?_0x1dfb97[_0x6922('0x39')]:_0x2bfac4[_0x6922('0x33')];if(_0xe33165[_0x6922('0x34')][_0x6922('0x48')]){_0x1dfb97[_0x6922('0x43')]=[{'all':!![]}];}_0x1dfb97=_[_0x6922('0x40')]({},_0x1dfb97,_0xe33165[_0x6922('0x42')]);return db[_0x6922('0x2f')][_0x6922('0x49')](_0x1dfb97)[_0x6922('0x26')](handleEntityNotFound(_0x207013,null))[_0x6922('0x26')](respondWithResult(_0x207013,null))[_0x6922('0x45')](handleError(_0x207013,null));};exports[_0x6922('0x4a')]=function(_0x38a782,_0x12a025){return db[_0x6922('0x2f')][_0x6922('0x4a')](_0x38a782[_0x6922('0x4b')],{})[_0x6922('0x26')](respondWithResult(_0x12a025,0xc9))[_0x6922('0x45')](handleError(_0x12a025,null));};exports[_0x6922('0x25')]=function(_0x32576d,_0x57f85e){if(_0x32576d[_0x6922('0x4b')]['id']){delete _0x32576d[_0x6922('0x4b')]['id'];}return db[_0x6922('0x2f')]['find']({'where':{'id':_0x32576d[_0x6922('0x47')]['id']}})['then'](handleEntityNotFound(_0x57f85e,null))['then'](saveUpdates(_0x32576d[_0x6922('0x4b')],null))[_0x6922('0x26')](respondWithResult(_0x57f85e,null))[_0x6922('0x45')](handleError(_0x57f85e,null));};exports['destroy']=function(_0x556a79,_0x3bd3cc){return db[_0x6922('0x2f')][_0x6922('0x49')]({'where':{'id':_0x556a79[_0x6922('0x47')]['id']}})[_0x6922('0x26')](handleEntityNotFound(_0x3bd3cc,null))['then'](removeEntity(_0x3bd3cc,null))[_0x6922('0x45')](handleError(_0x3bd3cc,null));};exports[_0x6922('0x4c')]=function(_0x519bb5,_0x39fbdc){return db[_0x6922('0x2f')][_0x6922('0x4c')]()[_0x6922('0x26')](respondWithResult(_0x39fbdc,null))[_0x6922('0x45')](handleError(_0x39fbdc,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index bf57383..f1d0b60 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 _0xd868=['request-promise','path','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','api','moment','bluebird'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xd868,0xf9));var _0x8d86=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xd868[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x8d86('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d86('0x1'));var moment=require(_0x8d86('0x2'));var BPromise=require(_0x8d86('0x3'));var rp=require(_0x8d86('0x4'));var fs=require('fs');var path=require(_0x8d86('0x5'));var rimraf=require(_0x8d86('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d86('0x7'));module['exports']=function(_0x43da91,_0x1e936a){return _0x43da91[_0x8d86('0x8')](_0x8d86('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x8d86('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xad60=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','api'];(function(_0x2f36f4,_0x1fee85){var _0x4ab19f=function(_0x46af1f){while(--_0x46af1f){_0x2f36f4['push'](_0x2f36f4['shift']());}};_0x4ab19f(++_0x1fee85);}(_0xad60,0x196));var _0x0ad6=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xad60[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x0ad6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ad6('0x1'));var moment=require(_0x0ad6('0x2'));var BPromise=require(_0x0ad6('0x3'));var rp=require(_0x0ad6('0x4'));var fs=require('fs');var path=require(_0x0ad6('0x5'));var rimraf=require(_0x0ad6('0x6'));var config=require(_0x0ad6('0x7'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x55812d,_0x1a531e){return _0x55812d[_0x0ad6('0x8')](_0x0ad6('0x9'),attributes,{'tableName':_0x0ad6('0xa'),'paranoid':![],'indexes':[{'name':_0x0ad6('0xb'),'fields':[_0x0ad6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 9503e6d..832c2f5 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 _0x3246=['FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x593f0e,_0x3555e7){var _0x116f30=function(_0x4df802){while(--_0x4df802){_0x593f0e['push'](_0x593f0e['shift']());}};_0x116f30(++_0x3555e7);}(_0x3246,0x7f));var _0x6324=function(_0x3afc45,_0x304a38){_0x3afc45=_0x3afc45-0x0;var _0x28df8a=_0x3246[_0x3afc45];return _0x28df8a;};'use strict';var _=require(_0x6324('0x0'));var util=require(_0x6324('0x1'));var moment=require(_0x6324('0x2'));var BPromise=require('bluebird');var rs=require(_0x6324('0x3'));var fs=require('fs');var Redis=require(_0x6324('0x4'));var db=require(_0x6324('0x5'))['db'];var utils=require(_0x6324('0x6'));var logger=require('../../config/logger')(_0x6324('0x7'));var config=require(_0x6324('0x8'));var jayson=require(_0x6324('0x9'));var client=jayson['client'][_0x6324('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b618b,_0x28ab6a,_0xb0ca3){return new BPromise(function(_0x43d06e,_0xf13d7e){return client['request'](_0x5b618b,_0xb0ca3)[_0x6324('0xb')](function(_0x30e2cc){logger[_0x6324('0xc')](_0x6324('0xd'),_0x28ab6a,'request\x20sent');logger['debug'](_0x6324('0xe'),_0x28ab6a,_0x6324('0xf'),JSON['stringify'](_0x30e2cc));if(_0x30e2cc['error']){if(_0x30e2cc[_0x6324('0x10')][_0x6324('0x11')]===0x1f4){logger[_0x6324('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x28ab6a,_0x30e2cc[_0x6324('0x10')][_0x6324('0x12')]);return _0xf13d7e(_0x30e2cc[_0x6324('0x10')][_0x6324('0x12')]);}logger['error'](_0x6324('0xd'),_0x28ab6a,_0x30e2cc[_0x6324('0x10')][_0x6324('0x12')]);return _0x43d06e(_0x30e2cc['error'][_0x6324('0x12')]);}else{logger[_0x6324('0xc')](_0x6324('0xd'),_0x28ab6a,_0x6324('0xf'));_0x43d06e(_0x30e2cc['result'][_0x6324('0x12')]);}})[_0x6324('0x13')](function(_0x30021b){logger[_0x6324('0x10')](_0x6324('0xd'),_0x28ab6a,_0x30021b);_0xf13d7e(_0x30021b);});});} \ No newline at end of file +var _0x5fa1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2a9e43,_0x31a731){var _0x10e35e=function(_0x4871a6){while(--_0x4871a6){_0x2a9e43['push'](_0x2a9e43['shift']());}};_0x10e35e(++_0x31a731);}(_0x5fa1,0xba));var _0x15fa=function(_0x125b95,_0x53550d){_0x125b95=_0x125b95-0x0;var _0x166a7c=_0x5fa1[_0x125b95];return _0x166a7c;};'use strict';var _=require(_0x15fa('0x0'));var util=require(_0x15fa('0x1'));var moment=require('moment');var BPromise=require(_0x15fa('0x2'));var rs=require(_0x15fa('0x3'));var fs=require('fs');var Redis=require(_0x15fa('0x4'));var db=require(_0x15fa('0x5'))['db'];var utils=require(_0x15fa('0x6'));var logger=require(_0x15fa('0x7'))(_0x15fa('0x8'));var config=require(_0x15fa('0x9'));var jayson=require(_0x15fa('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x146afe,_0x55aa15,_0x2eae55){return new BPromise(function(_0x2227fd,_0xa6521d){return client[_0x15fa('0xb')](_0x146afe,_0x2eae55)[_0x15fa('0xc')](function(_0x219665){logger['info'](_0x15fa('0xd'),_0x55aa15,_0x15fa('0xe'));logger[_0x15fa('0xf')](_0x15fa('0x10'),_0x55aa15,'request\x20sent',JSON[_0x15fa('0x11')](_0x219665));if(_0x219665[_0x15fa('0x12')]){if(_0x219665[_0x15fa('0x12')][_0x15fa('0x13')]===0x1f4){logger[_0x15fa('0x12')](_0x15fa('0xd'),_0x55aa15,_0x219665[_0x15fa('0x12')]['message']);return _0xa6521d(_0x219665['error'][_0x15fa('0x14')]);}logger[_0x15fa('0x12')](_0x15fa('0xd'),_0x55aa15,_0x219665['error'][_0x15fa('0x14')]);return _0x2227fd(_0x219665['error']['message']);}else{logger[_0x15fa('0x15')]('FaxTransferReport,\x20%s,\x20%s',_0x55aa15,_0x15fa('0xe'));_0x2227fd(_0x219665[_0x15fa('0x16')][_0x15fa('0x14')]);}})[_0x15fa('0x17')](function(_0x228ead){logger[_0x15fa('0x12')](_0x15fa('0xd'),_0x55aa15,_0x228ead);_0xa6521d(_0x228ead);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 5a39f14..eeaebf0 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 _0x0f3e=['./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x159555,_0x117772){var _0x411e11=function(_0x4d646a){while(--_0x4d646a){_0x159555['push'](_0x159555['shift']());}};_0x411e11(++_0x117772);}(_0x0f3e,0x88));var _0xe0f3=function(_0x16e173,_0x4147c6){_0x16e173=_0x16e173-0x0;var _0x9f44b6=_0x0f3e[_0x16e173];return _0x9f44b6;};'use strict';var multer=require(_0xe0f3('0x0'));var util=require(_0xe0f3('0x1'));var path=require(_0xe0f3('0x2'));var timeout=require(_0xe0f3('0x3'));var express=require(_0xe0f3('0x4'));var router=express[_0xe0f3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe0f3('0x6'));var config=require(_0xe0f3('0x7'));var controller=require(_0xe0f3('0x8'));router[_0xe0f3('0x9')]('/',auth[_0xe0f3('0xa')](),controller[_0xe0f3('0xb')]);router['get'](_0xe0f3('0xc'),auth[_0xe0f3('0xa')](),controller['describe']);router[_0xe0f3('0x9')](_0xe0f3('0xd'),auth[_0xe0f3('0xa')](),controller['show']);router['post']('/',auth[_0xe0f3('0xa')](),controller[_0xe0f3('0xe')]);router['put'](_0xe0f3('0xd'),auth['isAuthenticated'](),controller[_0xe0f3('0xf')]);router['delete'](_0xe0f3('0xd'),auth['isAuthenticated'](),controller[_0xe0f3('0x10')]);module[_0xe0f3('0x11')]=router; \ No newline at end of file +var _0x5ab7=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update'];(function(_0x51fb6a,_0x52812d){var _0x1fa3ec=function(_0x247bb1){while(--_0x247bb1){_0x51fb6a['push'](_0x51fb6a['shift']());}};_0x1fa3ec(++_0x52812d);}(_0x5ab7,0x157));var _0x75ab=function(_0x16a828,_0x4044e2){_0x16a828=_0x16a828-0x0;var _0x5df032=_0x5ab7[_0x16a828];return _0x5df032;};'use strict';var multer=require(_0x75ab('0x0'));var util=require(_0x75ab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75ab('0x2'));var router=express[_0x75ab('0x3')]();var fs_extra=require(_0x75ab('0x4'));var auth=require(_0x75ab('0x5'));var interaction=require(_0x75ab('0x6'));var config=require('../../config/environment');var controller=require(_0x75ab('0x7'));router[_0x75ab('0x8')]('/',auth[_0x75ab('0x9')](),controller[_0x75ab('0xa')]);router[_0x75ab('0x8')](_0x75ab('0xb'),auth[_0x75ab('0x9')](),controller[_0x75ab('0xc')]);router[_0x75ab('0x8')](_0x75ab('0xd'),auth[_0x75ab('0x9')](),controller[_0x75ab('0xe')]);router['post']('/',auth[_0x75ab('0x9')](),controller['create']);router[_0x75ab('0xf')](_0x75ab('0xd'),auth[_0x75ab('0x9')](),controller[_0x75ab('0x10')]);router[_0x75ab('0x11')](_0x75ab('0xd'),auth[_0x75ab('0x9')](),controller[_0x75ab('0x12')]);module[_0x75ab('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index ce6b9dd..db1b90d 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 _0x09d1=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x09d1,0x17a));var _0x109d=function(_0x4e8eea,_0x3ebbbb){_0x4e8eea=_0x4e8eea-0x0;var _0x1f36ad=_0x09d1[_0x4e8eea];return _0x1f36ad;};'use strict';var multer=require('multer');var util=require(_0x109d('0x0'));var path=require('path');var timeout=require(_0x109d('0x1'));var express=require(_0x109d('0x2'));var router=express['Router']();var fs_extra=require(_0x109d('0x3'));var auth=require(_0x109d('0x4'));var interaction=require(_0x109d('0x5'));var config=require(_0x109d('0x6'));var controller=require(_0x109d('0x7'));router[_0x109d('0x8')]('/',auth[_0x109d('0x9')](),controller[_0x109d('0xa')]);router[_0x109d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0xb')]);router[_0x109d('0x8')](_0x109d('0xc'),auth['isAuthenticated'](),controller[_0x109d('0xd')]);router[_0x109d('0x8')](_0x109d('0xe'),auth[_0x109d('0x9')](),controller[_0x109d('0xf')]);router[_0x109d('0x10')]('/',auth[_0x109d('0x9')](),controller['create']);router[_0x109d('0x10')](_0x109d('0xc'),auth[_0x109d('0x9')](),controller[_0x109d('0x11')]);router[_0x109d('0x12')](_0x109d('0x13'),auth[_0x109d('0x9')](),controller[_0x109d('0x14')]);router[_0x109d('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0x16')]);module['exports']=router; \ No newline at end of file +var _0x5eb0=['index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x18dfc4,_0x5e10e4){var _0x4ce089=function(_0xc0da1d){while(--_0xc0da1d){_0x18dfc4['push'](_0x18dfc4['shift']());}};_0x4ce089(++_0x5e10e4);}(_0x5eb0,0x92));var _0x05eb=function(_0x2fc650,_0x1d386){_0x2fc650=_0x2fc650-0x0;var _0x2a9ae8=_0x5eb0[_0x2fc650];return _0x2a9ae8;};'use strict';var multer=require(_0x05eb('0x0'));var util=require(_0x05eb('0x1'));var path=require(_0x05eb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x05eb('0x3')]();var fs_extra=require(_0x05eb('0x4'));var auth=require(_0x05eb('0x5'));var interaction=require(_0x05eb('0x6'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x05eb('0x7')]('/',auth['isAuthenticated'](),controller[_0x05eb('0x8')]);router['get'](_0x05eb('0x9'),auth[_0x05eb('0xa')](),controller[_0x05eb('0xb')]);router[_0x05eb('0x7')](_0x05eb('0xc'),auth[_0x05eb('0xa')](),controller[_0x05eb('0xd')]);router[_0x05eb('0x7')](_0x05eb('0xe'),auth[_0x05eb('0xa')](),controller[_0x05eb('0xf')]);router[_0x05eb('0x10')]('/',auth['isAuthenticated'](),controller[_0x05eb('0x11')]);router[_0x05eb('0x10')](_0x05eb('0xc'),auth['isAuthenticated'](),controller[_0x05eb('0x12')]);router['put']('/:id',auth[_0x05eb('0xa')](),controller['update']);router[_0x05eb('0x13')]('/:id',auth[_0x05eb('0xa')](),controller[_0x05eb('0x14')]);module[_0x05eb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index a882468..92ae40d 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 _0xdf13=['exports','STRING','ENUM','basic','newTab','integrationTab'];(function(_0x6d2675,_0xffc976){var _0x562241=function(_0x1d3864){while(--_0x1d3864){_0x6d2675['push'](_0x6d2675['shift']());}};_0x562241(++_0xffc976);}(_0xdf13,0xba));var _0x3df1=function(_0x5cd7a3,_0x1aa14f){_0x5cd7a3=_0x5cd7a3-0x0;var _0x21235d=_0xdf13[_0x5cd7a3];return _0x21235d;};'use strict';var Sequelize=require('sequelize');module[_0x3df1('0x0')]={'name':{'type':Sequelize[_0x3df1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3df1('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x3df1('0x2')](_0x3df1('0x3')),'defaultValue':_0x3df1('0x3')},'password':{'type':Sequelize[_0x3df1('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x3df1('0x1')]},'token':{'type':Sequelize[_0x3df1('0x1')]},'tokenSecret':{'type':Sequelize[_0x3df1('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x3df1('0x4')),'defaultValue':_0x3df1('0x5')}}; \ No newline at end of file +var _0x0619=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x1b0be9,_0x446243){var _0x281738=function(_0x2d9cd9){while(--_0x2d9cd9){_0x1b0be9['push'](_0x1b0be9['shift']());}};_0x281738(++_0x446243);}(_0x0619,0x92));var _0x9061=function(_0x1b6ec3,_0x2420f6){_0x1b6ec3=_0x1b6ec3-0x0;var _0x55d9d6=_0x0619[_0x1b6ec3];return _0x55d9d6;};'use strict';var Sequelize=require(_0x9061('0x0'));module[_0x9061('0x1')]={'name':{'type':Sequelize[_0x9061('0x2')]},'description':{'type':Sequelize[_0x9061('0x2')]},'username':{'type':Sequelize[_0x9061('0x2')]},'remoteUri':{'type':Sequelize[_0x9061('0x2')]},'authType':{'type':Sequelize[_0x9061('0x3')](_0x9061('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x9061('0x2')]},'consumerSecret':{'type':Sequelize[_0x9061('0x2')]},'token':{'type':Sequelize[_0x9061('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9061('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9061('0x3')](_0x9061('0x5'),_0x9061('0x6')),'defaultValue':_0x9061('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index b527174..995e1ba 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 _0x4986=['to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','Content-Range','reject','update','then','error','stack','name','send','index','DeskAccount','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','DeskField','Subjects','getFields','priority','remoteUri','username','password','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','path','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4986,0x146));var _0x6498=function(_0x148c77,_0x300d8f){_0x148c77=_0x148c77-0x0;var _0x2141a1=_0x4986[_0x148c77];return _0x2141a1;};'use strict';var emlformat=require(_0x6498('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6498('0x1'));var jsonpatch=require(_0x6498('0x2'));var rp=require(_0x6498('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6498('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6498('0x5'));var _=require(_0x6498('0x6'));var squel=require(_0x6498('0x7'));var crypto=require('crypto');var jsforce=require(_0x6498('0x8'));var deskjs=require(_0x6498('0x9'));var toCsv=require(_0x6498('0xa'));var querystring=require(_0x6498('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6498('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6498('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6498('0xe'))(_0x6498('0xf'));var utils=require(_0x6498('0x10'));var config=require(_0x6498('0x11'));var licenseUtil=require(_0x6498('0x12'));var db=require(_0x6498('0x13'))['db'];var integrations=require(_0x6498('0x14'));function respondWithStatusCode(_0xb1011d,_0x479c10){_0x479c10=_0x479c10||0xcc;return function(_0x568843){if(_0x568843){return _0xb1011d[_0x6498('0x15')](_0x479c10);}return _0xb1011d[_0x6498('0x16')](_0x479c10)[_0x6498('0x17')]();};}function respondWithResult(_0x1208e4,_0x47c1ea){_0x47c1ea=_0x47c1ea||0xc8;return function(_0x4943d3){if(_0x4943d3){return _0x1208e4[_0x6498('0x16')](_0x47c1ea)[_0x6498('0x18')](_0x4943d3);}};}function respondWithFilteredResult(_0x2c4318,_0x18e311){return function(_0xe587cd){if(_0xe587cd){var _0x4f30b=typeof _0x18e311['offset']===_0x6498('0x19')&&typeof _0x18e311[_0x6498('0x1a')]===_0x6498('0x19');var _0x27a141=_0xe587cd['count'];var _0x486c4e=_0x4f30b?0x0:_0x18e311['offset'];var _0x129a33=_0x4f30b?_0xe587cd[_0x6498('0x1b')]:_0x18e311['offset']+_0x18e311[_0x6498('0x1a')];var _0x197a8f;if(_0x129a33>=_0x27a141){_0x129a33=_0x27a141;_0x197a8f=0xc8;}else{_0x197a8f=0xce;}_0x2c4318[_0x6498('0x16')](_0x197a8f);return _0x2c4318['set'](_0x6498('0x1c'),_0x486c4e+'-'+_0x129a33+'/'+_0x27a141)[_0x6498('0x18')](_0xe587cd);}return null;};}function patchUpdates(_0x1d2a37){return function(_0x2e2443){try{jsonpatch['apply'](_0x2e2443,_0x1d2a37,!![]);}catch(_0x15def2){return BPromise[_0x6498('0x1d')](_0x15def2);}return _0x2e2443['save']();};}function saveUpdates(_0x340633,_0x5998b3){return function(_0x5dc5f9){if(_0x5dc5f9){return _0x5dc5f9[_0x6498('0x1e')](_0x340633)[_0x6498('0x1f')](function(_0x37e46c){return _0x37e46c;});}return null;};}function removeEntity(_0x174857,_0x299352){return function(_0x362b44){if(_0x362b44){return _0x362b44['destroy']()[_0x6498('0x1f')](function(){_0x174857['status'](0xcc)[_0x6498('0x17')]();});}};}function handleEntityNotFound(_0x1ae3eb,_0x6846d2){return function(_0x487032){if(!_0x487032){_0x1ae3eb['sendStatus'](0x194);}return _0x487032;};}function handleError(_0x33092b,_0x45dc0d){_0x45dc0d=_0x45dc0d||0x1f4;return function(_0x54c9b9){logger[_0x6498('0x20')](_0x54c9b9[_0x6498('0x21')]);if(_0x54c9b9['name']){delete _0x54c9b9[_0x6498('0x22')];}_0x33092b['status'](_0x45dc0d)[_0x6498('0x23')](_0x54c9b9);};}exports[_0x6498('0x24')]=function(_0x417bec,_0x32ae11){var _0x35fd93={},_0x565fe3={},_0x54faa7={'count':0x0,'rows':[]};var _0xc52129=_['map'](db[_0x6498('0x25')]['rawAttributes'],function(_0x5e9352){return{'name':_0x5e9352[_0x6498('0x26')],'type':_0x5e9352['type'][_0x6498('0x27')]};});_0x565fe3[_0x6498('0x28')]=_[_0x6498('0x29')](_0xc52129,_0x6498('0x22'));_0x565fe3[_0x6498('0x2a')]=_['keys'](_0x417bec['query']);_0x565fe3['filters']=_[_0x6498('0x2b')](_0x565fe3[_0x6498('0x28')],_0x565fe3['query']);_0x35fd93[_0x6498('0x2c')]=_[_0x6498('0x2b')](_0x565fe3['model'],qs[_0x6498('0x2d')](_0x417bec[_0x6498('0x2a')][_0x6498('0x2d')]));_0x35fd93[_0x6498('0x2c')]=_0x35fd93[_0x6498('0x2c')][_0x6498('0x2e')]?_0x35fd93[_0x6498('0x2c')]:_0x565fe3[_0x6498('0x28')];if(!_0x417bec[_0x6498('0x2a')][_0x6498('0x2f')]('nolimit')){_0x35fd93[_0x6498('0x1a')]=qs['limit'](_0x417bec['query'][_0x6498('0x1a')]);_0x35fd93[_0x6498('0x30')]=qs['offset'](_0x417bec[_0x6498('0x2a')]['offset']);}_0x35fd93[_0x6498('0x31')]=qs[_0x6498('0x32')](_0x417bec[_0x6498('0x2a')][_0x6498('0x32')]);_0x35fd93[_0x6498('0x33')]=qs[_0x6498('0x34')](_[_0x6498('0x35')](_0x417bec[_0x6498('0x2a')],_0x565fe3[_0x6498('0x34')]),_0xc52129);if(_0x417bec[_0x6498('0x2a')][_0x6498('0x36')]){_0x35fd93[_0x6498('0x33')]=_[_0x6498('0x37')](_0x35fd93[_0x6498('0x33')],{'$or':_['map'](_0xc52129,function(_0x5640f5){if(_0x5640f5[_0x6498('0x38')]!==_0x6498('0x39')){var _0x583b69={};_0x583b69[_0x5640f5['name']]={'$like':'%'+_0x417bec['query']['filter']+'%'};return _0x583b69;}})});}_0x35fd93=_[_0x6498('0x37')]({},_0x35fd93,_0x417bec[_0x6498('0x3a')]);var _0x2c6638={'where':_0x35fd93[_0x6498('0x33')]};return db[_0x6498('0x25')]['count'](_0x2c6638)[_0x6498('0x1f')](function(_0x209c56){_0x54faa7[_0x6498('0x1b')]=_0x209c56;if(_0x417bec[_0x6498('0x2a')]['includeAll']){_0x35fd93[_0x6498('0x3b')]=[{'all':!![]}];}return db[_0x6498('0x25')][_0x6498('0x3c')](_0x35fd93);})[_0x6498('0x1f')](function(_0x2cba51){_0x54faa7[_0x6498('0x3d')]=_0x2cba51;return _0x54faa7;})[_0x6498('0x1f')](respondWithFilteredResult(_0x32ae11,_0x35fd93))[_0x6498('0x3e')](handleError(_0x32ae11,null));};exports[_0x6498('0x3f')]=function(_0x3319d5,_0x3fa5fd){var _0x2ec3b5={'raw':![],'where':{'id':_0x3319d5[_0x6498('0x40')]['id']}},_0x4dddab={};_0x4dddab[_0x6498('0x28')]=_[_0x6498('0x41')](db[_0x6498('0x25')][_0x6498('0x42')]);_0x4dddab[_0x6498('0x2a')]=_[_0x6498('0x41')](_0x3319d5['query']);_0x4dddab['filters']=_[_0x6498('0x2b')](_0x4dddab[_0x6498('0x28')],_0x4dddab['query']);_0x2ec3b5[_0x6498('0x2c')]=_['intersection'](_0x4dddab[_0x6498('0x28')],qs[_0x6498('0x2d')](_0x3319d5[_0x6498('0x2a')][_0x6498('0x2d')]));_0x2ec3b5[_0x6498('0x2c')]=_0x2ec3b5['attributes'][_0x6498('0x2e')]?_0x2ec3b5[_0x6498('0x2c')]:_0x4dddab[_0x6498('0x28')];if(_0x3319d5['query']['includeAll']){_0x2ec3b5[_0x6498('0x3b')]=[{'all':!![]}];}_0x2ec3b5=_['merge']({},_0x2ec3b5,_0x3319d5['options']);return db[_0x6498('0x25')][_0x6498('0x43')](_0x2ec3b5)[_0x6498('0x1f')](handleEntityNotFound(_0x3fa5fd,null))[_0x6498('0x1f')](respondWithResult(_0x3fa5fd,null))[_0x6498('0x3e')](handleError(_0x3fa5fd,null));};exports[_0x6498('0x44')]=function(_0x55389f,_0x1b1d13){return db[_0x6498('0x25')][_0x6498('0x44')](_0x55389f[_0x6498('0x45')],{})['then'](respondWithResult(_0x1b1d13,0xc9))[_0x6498('0x3e')](handleError(_0x1b1d13,null));};exports[_0x6498('0x1e')]=function(_0xb22ea3,_0x4ae227){if(_0xb22ea3[_0x6498('0x45')]['id']){delete _0xb22ea3[_0x6498('0x45')]['id'];}return db[_0x6498('0x25')][_0x6498('0x43')]({'where':{'id':_0xb22ea3['params']['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x4ae227,null))[_0x6498('0x1f')](saveUpdates(_0xb22ea3[_0x6498('0x45')],null))[_0x6498('0x1f')](respondWithResult(_0x4ae227,null))[_0x6498('0x3e')](handleError(_0x4ae227,null));};exports[_0x6498('0x46')]=function(_0xbab052,_0x5704d8){return db['DeskAccount']['find']({'where':{'id':_0xbab052['params']['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x5704d8,null))[_0x6498('0x1f')](removeEntity(_0x5704d8,null))[_0x6498('0x3e')](handleError(_0x5704d8,null));};exports[_0x6498('0x47')]=function(_0x1c2e3b,_0x3a3345,_0x3d2b87){var _0xb0e7f2={};var _0x979144={};var _0x5cb1dc;var _0x24b575;return db[_0x6498('0x25')][_0x6498('0x48')]({'where':{'id':_0x1c2e3b[_0x6498('0x40')]['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x3a3345,null))[_0x6498('0x1f')](function(_0x4c3a63){if(_0x4c3a63){_0x5cb1dc=_0x4c3a63;_0x979144['model']=_[_0x6498('0x41')](db[_0x6498('0x49')][_0x6498('0x42')]);_0x979144[_0x6498('0x2a')]=_['keys'](_0x1c2e3b[_0x6498('0x2a')]);_0x979144[_0x6498('0x34')]=_[_0x6498('0x2b')](_0x979144[_0x6498('0x28')],_0x979144[_0x6498('0x2a')]);_0xb0e7f2[_0x6498('0x2c')]=_[_0x6498('0x2b')](_0x979144[_0x6498('0x28')],qs['fields'](_0x1c2e3b['query']['fields']));_0xb0e7f2['attributes']=_0xb0e7f2[_0x6498('0x2c')][_0x6498('0x2e')]?_0xb0e7f2[_0x6498('0x2c')]:_0x979144[_0x6498('0x28')];_0xb0e7f2[_0x6498('0x31')]=qs['sort'](_0x1c2e3b[_0x6498('0x2a')][_0x6498('0x32')]);_0xb0e7f2[_0x6498('0x33')]=qs['filters'](_['pick'](_0x1c2e3b[_0x6498('0x2a')],_0x979144[_0x6498('0x34')]));if(_0x1c2e3b['query'][_0x6498('0x36')]){_0xb0e7f2[_0x6498('0x33')]=_[_0x6498('0x37')](_0xb0e7f2['where'],{'$or':_['map'](_0xb0e7f2[_0x6498('0x2c')],function(_0x326874){var _0x2fd935={};_0x2fd935[_0x326874]={'$like':'%'+_0x1c2e3b[_0x6498('0x2a')][_0x6498('0x36')]+'%'};return _0x2fd935;})});}_0xb0e7f2=_[_0x6498('0x37')]({},_0xb0e7f2,_0x1c2e3b[_0x6498('0x3a')]);return _0x5cb1dc['getConfigurations'](_0xb0e7f2);}})[_0x6498('0x1f')](function(_0x1a9243){if(_0x1a9243){_0x24b575=_0x1a9243['length'];if(!_0x1c2e3b[_0x6498('0x2a')][_0x6498('0x2f')](_0x6498('0x4a'))){_0xb0e7f2[_0x6498('0x1a')]=qs[_0x6498('0x1a')](_0x1c2e3b[_0x6498('0x2a')]['limit']);_0xb0e7f2[_0x6498('0x30')]=qs[_0x6498('0x30')](_0x1c2e3b['query'][_0x6498('0x30')]);}return _0x5cb1dc['getConfigurations'](_0xb0e7f2);}})[_0x6498('0x1f')](function(_0x4fa27b){if(_0x4fa27b){return _0x4fa27b?{'count':_0x24b575,'rows':_0x4fa27b}:null;}})[_0x6498('0x1f')](respondWithResult(_0x3a3345,null))[_0x6498('0x3e')](handleError(_0x3a3345,null));};exports[_0x6498('0x4b')]=function(_0xb3dc65,_0x3bf624,_0x3fed63){if(_0xb3dc65[_0x6498('0x45')]['id']){delete _0xb3dc65[_0x6498('0x45')]['id'];}return db[_0x6498('0x25')][_0x6498('0x48')]({'where':{'id':_0xb3dc65[_0x6498('0x40')]['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x3bf624,null))[_0x6498('0x1f')](function(_0x1dccba){if(_0x1dccba){_0xb3dc65['body'][_0x6498('0x4c')]=_0x1dccba['id'];_0xb3dc65[_0x6498('0x45')]['Subjects']=integrations[_0x6498('0x4d')](_0xb3dc65['body'][_0x6498('0x4e')],_0xb3dc65['body']['type']);_0xb3dc65[_0x6498('0x45')][_0x6498('0x4f')]=integrations['getDescriptions'](_0xb3dc65[_0x6498('0x45')][_0x6498('0x4e')],_0xb3dc65[_0x6498('0x45')][_0x6498('0x38')]);return db[_0x6498('0x49')][_0x6498('0x44')](_0xb3dc65[_0x6498('0x45')],{'include':[{'model':db[_0x6498('0x50')],'as':_0x6498('0x51')},{'model':db[_0x6498('0x50')],'as':_0x6498('0x4f')}]});}return null;})[_0x6498('0x1f')](respondWithResult(_0x3bf624,null))[_0x6498('0x3e')](handleError(_0x3bf624,null));};exports[_0x6498('0x52')]=function(_0x5045ef,_0x547962,_0x207fad){var _0x504357=[{'name':_0x6498('0x53'),'label':_0x6498('0x53'),'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 _0x10d1e7='';return db[_0x6498('0x25')][_0x6498('0x48')]({'where':{'id':_0x5045ef[_0x6498('0x40')]['id']},'attributes':['id',_0x6498('0x54'),'authType',_0x6498('0x55'),_0x6498('0x56'),'consumerKey',_0x6498('0x57'),_0x6498('0x58'),_0x6498('0x59')]})[_0x6498('0x1f')](handleEntityNotFound(_0x547962,null))[_0x6498('0x1f')](function(_0x49c4c3){if(_0x49c4c3){_0x10d1e7=_0x49c4c3[_0x6498('0x54')];var _0x28cf1e=_0x10d1e7['slice'](-0x1);if(_0x28cf1e==='/'){_0x10d1e7=_0x10d1e7[_0x6498('0x5a')](0x0,_0x10d1e7[_0x6498('0x5b')](_0x28cf1e));}var _0x269cc1={'method':_0x6498('0x5c'),'uri':util[_0x6498('0x5d')](_0x6498('0x5e'),_0x10d1e7),'headers':{'Content-Type':_0x6498('0x5f'),'Accept':_0x6498('0x5f')},'json':!![]};if(_0x49c4c3[_0x6498('0x60')]===_0x6498('0x61')){_0x269cc1['headers'][_0x6498('0x62')]=util[_0x6498('0x5d')](_0x6498('0x63'),new Buffer(util[_0x6498('0x5d')](_0x6498('0x64'),_0x49c4c3[_0x6498('0x55')],_0x49c4c3[_0x6498('0x56')]))[_0x6498('0x65')](_0x6498('0x66')));}return rp(_0x269cc1)[_0x6498('0x1f')](function(_0x10b7e9){return _0x504357[_0x6498('0x67')](_['map'](_0x10b7e9[_0x6498('0x68')]['entries'],function(_0x514396){return{'id':_0x514396['name'],'name':_0x514396[_0x6498('0x22')],'type':_0x514396[_0x6498('0x38')],'active':_0x514396[_0x6498('0x69')],'label':_0x514396[_0x6498('0x6a')],'custom':!![]};}));});}})[_0x6498('0x1f')](function(_0x383e5b){return{'count':_0x383e5b[_0x6498('0x2e')],'rows':_0x383e5b};})[_0x6498('0x1f')](respondWithResult(_0x547962,null))[_0x6498('0x3e')](function(_0x97fa93){var _0x2c0903=_0x5045ef['query']['test']?0x1f4:_0x97fa93['statusCode']||0x1f4;logger[_0x6498('0x20')](_0x6498('0x6b'),_0x6498('0x52'),_0x2c0903,JSON[_0x6498('0x6c')](_0x97fa93));delete _0x97fa93[_0x6498('0x22')];if(_0x2c0903===0x191){_0x2c0903=0x190;}_0x547962[_0x6498('0x16')](_0x2c0903)[_0x6498('0x23')](_0x5045ef[_0x6498('0x2a')][_0x6498('0x6d')]?{'message':_0x6498('0x6e'),'statusCode':_0x97fa93[_0x6498('0x6f')]}:_0x97fa93);});}; \ No newline at end of file +var _0x9a53=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','update','params','getConfigurations','filters','merge','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskConfiguration','DeskField','Descriptions','getFields','priority','findOne','remoteUri','authType','password','token','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','active','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','count','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes'];(function(_0x40214a,_0x2509ab){var _0x4b7e24=function(_0xf2e758){while(--_0xf2e758){_0x40214a['push'](_0x40214a['shift']());}};_0x4b7e24(++_0x2509ab);}(_0x9a53,0xb5));var _0x39a5=function(_0x29713b,_0x345e52){_0x29713b=_0x29713b-0x0;var _0x3b81b2=_0x9a53[_0x29713b];return _0x3b81b2;};'use strict';var emlformat=require(_0x39a5('0x0'));var rimraf=require(_0x39a5('0x1'));var zipdir=require(_0x39a5('0x2'));var jsonpatch=require(_0x39a5('0x3'));var rp=require(_0x39a5('0x4'));var moment=require(_0x39a5('0x5'));var BPromise=require(_0x39a5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x39a5('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('lodash');var squel=require(_0x39a5('0x8'));var crypto=require(_0x39a5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x39a5('0xa'));var toCsv=require(_0x39a5('0xb'));var querystring=require(_0x39a5('0xc'));var Papa=require(_0x39a5('0xd'));var Redis=require(_0x39a5('0xe'));var authService=require(_0x39a5('0xf'));var qs=require(_0x39a5('0x10'));var as=require(_0x39a5('0x11'));var hardwareService=require(_0x39a5('0x12'));var logger=require(_0x39a5('0x13'))(_0x39a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x39a5('0x15'))['db'];var integrations=require(_0x39a5('0x16'));function respondWithStatusCode(_0x270dcc,_0x29fef0){_0x29fef0=_0x29fef0||0xcc;return function(_0x41132d){if(_0x41132d){return _0x270dcc['sendStatus'](_0x29fef0);}return _0x270dcc[_0x39a5('0x17')](_0x29fef0)[_0x39a5('0x18')]();};}function respondWithResult(_0xf3c160,_0xfc9081){_0xfc9081=_0xfc9081||0xc8;return function(_0x5be093){if(_0x5be093){return _0xf3c160['status'](_0xfc9081)[_0x39a5('0x19')](_0x5be093);}};}function respondWithFilteredResult(_0x148363,_0x2b95fb){return function(_0x3e5b5c){if(_0x3e5b5c){var _0x17f73b=typeof _0x2b95fb['offset']===_0x39a5('0x1a')&&typeof _0x2b95fb['limit']===_0x39a5('0x1a');var _0x5ed696=_0x3e5b5c['count'];var _0x234675=_0x17f73b?0x0:_0x2b95fb['offset'];var _0x5070cd=_0x17f73b?_0x3e5b5c[_0x39a5('0x1b')]:_0x2b95fb['offset']+_0x2b95fb['limit'];var _0x57df16;if(_0x5070cd>=_0x5ed696){_0x5070cd=_0x5ed696;_0x57df16=0xc8;}else{_0x57df16=0xce;}_0x148363[_0x39a5('0x17')](_0x57df16);return _0x148363['set'](_0x39a5('0x1c'),_0x234675+'-'+_0x5070cd+'/'+_0x5ed696)[_0x39a5('0x19')](_0x3e5b5c);}return null;};}function patchUpdates(_0x38f5ae){return function(_0xcdde07){try{jsonpatch['apply'](_0xcdde07,_0x38f5ae,!![]);}catch(_0x3254d5){return BPromise['reject'](_0x3254d5);}return _0xcdde07[_0x39a5('0x1d')]();};}function saveUpdates(_0x1d49cb,_0x28e025){return function(_0x55b958){if(_0x55b958){return _0x55b958['update'](_0x1d49cb)[_0x39a5('0x1e')](function(_0x3377aa){return _0x3377aa;});}return null;};}function removeEntity(_0xc7e442,_0x96612f){return function(_0x1c4b99){if(_0x1c4b99){return _0x1c4b99[_0x39a5('0x1f')]()[_0x39a5('0x1e')](function(){_0xc7e442[_0x39a5('0x17')](0xcc)[_0x39a5('0x18')]();});}};}function handleEntityNotFound(_0x1f96fd,_0x388012){return function(_0x2c7835){if(!_0x2c7835){_0x1f96fd[_0x39a5('0x20')](0x194);}return _0x2c7835;};}function handleError(_0x4bdfde,_0x33cba6){_0x33cba6=_0x33cba6||0x1f4;return function(_0xd55bf7){logger[_0x39a5('0x21')](_0xd55bf7[_0x39a5('0x22')]);if(_0xd55bf7[_0x39a5('0x23')]){delete _0xd55bf7[_0x39a5('0x23')];}_0x4bdfde['status'](_0x33cba6)[_0x39a5('0x24')](_0xd55bf7);};}exports[_0x39a5('0x25')]=function(_0x46ce24,_0x204433){var _0x109652={},_0x28d311={},_0x37f868={'count':0x0,'rows':[]};var _0x5581ac=_[_0x39a5('0x26')](db[_0x39a5('0x27')][_0x39a5('0x28')],function(_0xce950e){return{'name':_0xce950e[_0x39a5('0x29')],'type':_0xce950e[_0x39a5('0x2a')][_0x39a5('0x2b')]};});_0x28d311[_0x39a5('0x2c')]=_['map'](_0x5581ac,_0x39a5('0x23'));_0x28d311[_0x39a5('0x2d')]=_[_0x39a5('0x2e')](_0x46ce24[_0x39a5('0x2d')]);_0x28d311['filters']=_[_0x39a5('0x2f')](_0x28d311[_0x39a5('0x2c')],_0x28d311[_0x39a5('0x2d')]);_0x109652[_0x39a5('0x30')]=_[_0x39a5('0x2f')](_0x28d311['model'],qs[_0x39a5('0x31')](_0x46ce24[_0x39a5('0x2d')][_0x39a5('0x31')]));_0x109652[_0x39a5('0x30')]=_0x109652[_0x39a5('0x30')][_0x39a5('0x32')]?_0x109652[_0x39a5('0x30')]:_0x28d311[_0x39a5('0x2c')];if(!_0x46ce24['query'][_0x39a5('0x33')](_0x39a5('0x34'))){_0x109652[_0x39a5('0x35')]=qs[_0x39a5('0x35')](_0x46ce24[_0x39a5('0x2d')]['limit']);_0x109652['offset']=qs[_0x39a5('0x36')](_0x46ce24[_0x39a5('0x2d')][_0x39a5('0x36')]);}_0x109652[_0x39a5('0x37')]=qs['sort'](_0x46ce24[_0x39a5('0x2d')][_0x39a5('0x38')]);_0x109652[_0x39a5('0x39')]=qs['filters'](_[_0x39a5('0x3a')](_0x46ce24[_0x39a5('0x2d')],_0x28d311['filters']),_0x5581ac);if(_0x46ce24[_0x39a5('0x2d')][_0x39a5('0x3b')]){_0x109652[_0x39a5('0x39')]=_['merge'](_0x109652[_0x39a5('0x39')],{'$or':_[_0x39a5('0x26')](_0x5581ac,function(_0x46f874){if(_0x46f874[_0x39a5('0x2a')]!==_0x39a5('0x3c')){var _0x52736c={};_0x52736c[_0x46f874[_0x39a5('0x23')]]={'$like':'%'+_0x46ce24[_0x39a5('0x2d')][_0x39a5('0x3b')]+'%'};return _0x52736c;}})});}_0x109652=_['merge']({},_0x109652,_0x46ce24[_0x39a5('0x3d')]);var _0x218ac5={'where':_0x109652[_0x39a5('0x39')]};return db[_0x39a5('0x27')]['count'](_0x218ac5)[_0x39a5('0x1e')](function(_0x429ce8){_0x37f868[_0x39a5('0x1b')]=_0x429ce8;if(_0x46ce24[_0x39a5('0x2d')]['includeAll']){_0x109652[_0x39a5('0x3e')]=[{'all':!![]}];}return db[_0x39a5('0x27')][_0x39a5('0x3f')](_0x109652);})['then'](function(_0x524362){_0x37f868[_0x39a5('0x40')]=_0x524362;return _0x37f868;})[_0x39a5('0x1e')](respondWithFilteredResult(_0x204433,_0x109652))[_0x39a5('0x41')](handleError(_0x204433,null));};exports['show']=function(_0x5ce9d5,_0x4c3d88){var _0x5ccaea={'raw':![],'where':{'id':_0x5ce9d5['params']['id']}},_0x3392fb={};_0x3392fb[_0x39a5('0x2c')]=_[_0x39a5('0x2e')](db['DeskAccount'][_0x39a5('0x28')]);_0x3392fb[_0x39a5('0x2d')]=_[_0x39a5('0x2e')](_0x5ce9d5[_0x39a5('0x2d')]);_0x3392fb['filters']=_['intersection'](_0x3392fb[_0x39a5('0x2c')],_0x3392fb[_0x39a5('0x2d')]);_0x5ccaea[_0x39a5('0x30')]=_[_0x39a5('0x2f')](_0x3392fb[_0x39a5('0x2c')],qs[_0x39a5('0x31')](_0x5ce9d5[_0x39a5('0x2d')][_0x39a5('0x31')]));_0x5ccaea[_0x39a5('0x30')]=_0x5ccaea[_0x39a5('0x30')][_0x39a5('0x32')]?_0x5ccaea['attributes']:_0x3392fb[_0x39a5('0x2c')];if(_0x5ce9d5[_0x39a5('0x2d')][_0x39a5('0x42')]){_0x5ccaea['include']=[{'all':!![]}];}_0x5ccaea=_['merge']({},_0x5ccaea,_0x5ce9d5[_0x39a5('0x3d')]);return db[_0x39a5('0x27')][_0x39a5('0x43')](_0x5ccaea)['then'](handleEntityNotFound(_0x4c3d88,null))[_0x39a5('0x1e')](respondWithResult(_0x4c3d88,null))[_0x39a5('0x41')](handleError(_0x4c3d88,null));};exports['create']=function(_0x222d13,_0x13e566){return db['DeskAccount'][_0x39a5('0x44')](_0x222d13[_0x39a5('0x45')],{})[_0x39a5('0x1e')](respondWithResult(_0x13e566,0xc9))[_0x39a5('0x41')](handleError(_0x13e566,null));};exports[_0x39a5('0x46')]=function(_0x462fac,_0x441c0d){if(_0x462fac['body']['id']){delete _0x462fac[_0x39a5('0x45')]['id'];}return db[_0x39a5('0x27')]['find']({'where':{'id':_0x462fac['params']['id']}})[_0x39a5('0x1e')](handleEntityNotFound(_0x441c0d,null))[_0x39a5('0x1e')](saveUpdates(_0x462fac['body'],null))[_0x39a5('0x1e')](respondWithResult(_0x441c0d,null))[_0x39a5('0x41')](handleError(_0x441c0d,null));};exports[_0x39a5('0x1f')]=function(_0x59b740,_0x480a32){return db[_0x39a5('0x27')][_0x39a5('0x43')]({'where':{'id':_0x59b740[_0x39a5('0x47')]['id']}})[_0x39a5('0x1e')](handleEntityNotFound(_0x480a32,null))[_0x39a5('0x1e')](removeEntity(_0x480a32,null))['catch'](handleError(_0x480a32,null));};exports[_0x39a5('0x48')]=function(_0x42a8f4,_0x28a400,_0x1b6284){var _0xf36f49={};var _0x546d45={};var _0xd155c9;var _0x477f41;return db['DeskAccount']['findOne']({'where':{'id':_0x42a8f4[_0x39a5('0x47')]['id']}})[_0x39a5('0x1e')](handleEntityNotFound(_0x28a400,null))[_0x39a5('0x1e')](function(_0xb23a0){if(_0xb23a0){_0xd155c9=_0xb23a0;_0x546d45['model']=_[_0x39a5('0x2e')](db['DeskConfiguration']['rawAttributes']);_0x546d45[_0x39a5('0x2d')]=_['keys'](_0x42a8f4[_0x39a5('0x2d')]);_0x546d45[_0x39a5('0x49')]=_[_0x39a5('0x2f')](_0x546d45[_0x39a5('0x2c')],_0x546d45[_0x39a5('0x2d')]);_0xf36f49[_0x39a5('0x30')]=_[_0x39a5('0x2f')](_0x546d45['model'],qs[_0x39a5('0x31')](_0x42a8f4[_0x39a5('0x2d')][_0x39a5('0x31')]));_0xf36f49['attributes']=_0xf36f49['attributes'][_0x39a5('0x32')]?_0xf36f49[_0x39a5('0x30')]:_0x546d45[_0x39a5('0x2c')];_0xf36f49[_0x39a5('0x37')]=qs['sort'](_0x42a8f4['query'][_0x39a5('0x38')]);_0xf36f49[_0x39a5('0x39')]=qs[_0x39a5('0x49')](_['pick'](_0x42a8f4['query'],_0x546d45[_0x39a5('0x49')]));if(_0x42a8f4[_0x39a5('0x2d')][_0x39a5('0x3b')]){_0xf36f49[_0x39a5('0x39')]=_[_0x39a5('0x4a')](_0xf36f49[_0x39a5('0x39')],{'$or':_['map'](_0xf36f49[_0x39a5('0x30')],function(_0x260ded){var _0xe4b6b7={};_0xe4b6b7[_0x260ded]={'$like':'%'+_0x42a8f4[_0x39a5('0x2d')][_0x39a5('0x3b')]+'%'};return _0xe4b6b7;})});}_0xf36f49=_[_0x39a5('0x4a')]({},_0xf36f49,_0x42a8f4[_0x39a5('0x3d')]);return _0xd155c9['getConfigurations'](_0xf36f49);}})['then'](function(_0x43034a){if(_0x43034a){_0x477f41=_0x43034a[_0x39a5('0x32')];if(!_0x42a8f4[_0x39a5('0x2d')]['hasOwnProperty']('nolimit')){_0xf36f49[_0x39a5('0x35')]=qs[_0x39a5('0x35')](_0x42a8f4[_0x39a5('0x2d')][_0x39a5('0x35')]);_0xf36f49['offset']=qs['offset'](_0x42a8f4[_0x39a5('0x2d')]['offset']);}return _0xd155c9['getConfigurations'](_0xf36f49);}})[_0x39a5('0x1e')](function(_0x564a62){if(_0x564a62){return _0x564a62?{'count':_0x477f41,'rows':_0x564a62}:null;}})[_0x39a5('0x1e')](respondWithResult(_0x28a400,null))[_0x39a5('0x41')](handleError(_0x28a400,null));};exports[_0x39a5('0x4b')]=function(_0x328f59,_0x93692a,_0x131641){if(_0x328f59[_0x39a5('0x45')]['id']){delete _0x328f59[_0x39a5('0x45')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x328f59[_0x39a5('0x47')]['id']}})[_0x39a5('0x1e')](handleEntityNotFound(_0x93692a,null))['then'](function(_0x35755b){if(_0x35755b){_0x328f59[_0x39a5('0x45')][_0x39a5('0x4c')]=_0x35755b['id'];_0x328f59[_0x39a5('0x45')][_0x39a5('0x4d')]=integrations[_0x39a5('0x4e')](_0x328f59[_0x39a5('0x45')][_0x39a5('0x4f')],_0x328f59[_0x39a5('0x45')][_0x39a5('0x2a')]);_0x328f59['body']['Descriptions']=integrations['getDescriptions'](_0x328f59[_0x39a5('0x45')][_0x39a5('0x4f')],_0x328f59[_0x39a5('0x45')][_0x39a5('0x2a')]);return db[_0x39a5('0x50')]['create'](_0x328f59[_0x39a5('0x45')],{'include':[{'model':db[_0x39a5('0x51')],'as':_0x39a5('0x4d')},{'model':db[_0x39a5('0x51')],'as':_0x39a5('0x52')}]});}return null;})['then'](respondWithResult(_0x93692a,null))['catch'](handleError(_0x93692a,null));};exports[_0x39a5('0x53')]=function(_0x45ad4a,_0x52ec0a,_0x1569e7){var _0x4feffd=[{'name':_0x39a5('0x54'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x128dd6='';return db[_0x39a5('0x27')][_0x39a5('0x55')]({'where':{'id':_0x45ad4a['params']['id']},'attributes':['id',_0x39a5('0x56'),_0x39a5('0x57'),'username',_0x39a5('0x58'),'consumerKey','consumerSecret',_0x39a5('0x59'),'tokenSecret']})['then'](handleEntityNotFound(_0x52ec0a,null))[_0x39a5('0x1e')](function(_0x327334){if(_0x327334){_0x128dd6=_0x327334[_0x39a5('0x56')];var _0x451d9e=_0x128dd6[_0x39a5('0x5a')](-0x1);if(_0x451d9e==='/'){_0x128dd6=_0x128dd6[_0x39a5('0x5b')](0x0,_0x128dd6[_0x39a5('0x5c')](_0x451d9e));}var _0x4696a3={'method':_0x39a5('0x5d'),'uri':util[_0x39a5('0x5e')](_0x39a5('0x5f'),_0x128dd6),'headers':{'Content-Type':_0x39a5('0x60'),'Accept':_0x39a5('0x60')},'json':!![]};if(_0x327334[_0x39a5('0x57')]===_0x39a5('0x61')){_0x4696a3[_0x39a5('0x62')]['Authorization']=util[_0x39a5('0x5e')](_0x39a5('0x63'),new Buffer(util[_0x39a5('0x5e')](_0x39a5('0x64'),_0x327334[_0x39a5('0x65')],_0x327334[_0x39a5('0x58')]))[_0x39a5('0x66')](_0x39a5('0x67')));}return rp(_0x4696a3)[_0x39a5('0x1e')](function(_0x204347){return _0x4feffd[_0x39a5('0x68')](_[_0x39a5('0x26')](_0x204347[_0x39a5('0x69')]['entries'],function(_0xa3820f){return{'id':_0xa3820f[_0x39a5('0x23')],'name':_0xa3820f[_0x39a5('0x23')],'type':_0xa3820f[_0x39a5('0x2a')],'active':_0xa3820f[_0x39a5('0x6a')],'label':_0xa3820f['label'],'custom':!![]};}));});}})[_0x39a5('0x1e')](function(_0x1ac7e4){return{'count':_0x1ac7e4[_0x39a5('0x32')],'rows':_0x1ac7e4};})[_0x39a5('0x1e')](respondWithResult(_0x52ec0a,null))['catch'](function(_0x171d22){var _0x40676a=_0x45ad4a[_0x39a5('0x2d')][_0x39a5('0x6b')]?0x1f4:_0x171d22[_0x39a5('0x6c')]||0x1f4;logger[_0x39a5('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x39a5('0x53'),_0x40676a,JSON[_0x39a5('0x6d')](_0x171d22));delete _0x171d22[_0x39a5('0x23')];if(_0x40676a===0x191){_0x40676a=0x190;}_0x52ec0a[_0x39a5('0x17')](_0x40676a)[_0x39a5('0x24')](_0x45ad4a[_0x39a5('0x2d')][_0x39a5('0x6b')]?{'message':_0x39a5('0x6e'),'statusCode':_0x171d22['statusCode']}:_0x171d22);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index fa141fa..d4b27f6 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 _0x6365=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts'];(function(_0x16772e,_0x2b9360){var _0x15653b=function(_0x329e99){while(--_0x329e99){_0x16772e['push'](_0x16772e['shift']());}};_0x15653b(++_0x2b9360);}(_0x6365,0x9c));var _0x5636=function(_0x169fd4,_0x1879a9){_0x169fd4=_0x169fd4-0x0;var _0x1a4a07=_0x6365[_0x169fd4];return _0x1a4a07;};'use strict';var _=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var logger=require(_0x5636('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5636('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5636('0x4'));var rimraf=require(_0x5636('0x5'));var config=require(_0x5636('0x6'));var attributes=require(_0x5636('0x7'));var integrations=require(_0x5636('0x8'));module[_0x5636('0x9')]=function(_0x27b195,_0x2282de){return _0x27b195[_0x5636('0xa')](_0x5636('0xb'),attributes,{'tableName':_0x5636('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbedd=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2ac201,_0x12da2a){var _0x3f6b1c=function(_0x1104e0){while(--_0x1104e0){_0x2ac201['push'](_0x2ac201['shift']());}};_0x3f6b1c(++_0x12da2a);}(_0xbedd,0x1db));var _0xdbed=function(_0x31b588,_0x30b636){_0x31b588=_0x31b588-0x0;var _0xf4faae=_0xbedd[_0x31b588];return _0xf4faae;};'use strict';var _=require(_0xdbed('0x0'));var util=require('util');var logger=require(_0xdbed('0x1'))(_0xdbed('0x2'));var moment=require(_0xdbed('0x3'));var BPromise=require('bluebird');var rp=require(_0xdbed('0x4'));var fs=require('fs');var path=require(_0xdbed('0x5'));var rimraf=require(_0xdbed('0x6'));var config=require(_0xdbed('0x7'));var attributes=require(_0xdbed('0x8'));var integrations=require(_0xdbed('0x9'));module['exports']=function(_0x3b9519,_0x26dc99){return _0x3b9519[_0xdbed('0xa')](_0xdbed('0xb'),attributes,{'tableName':_0xdbed('0xc'),'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 61258b0..d655525 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 _0x2289=['limit','include','model','attributes','map','then','ShowDeskAccount','find','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','where'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x2289,0x11b));var _0x9228=function(_0x2974e4,_0x2029b0){_0x2974e4=_0x2974e4-0x0;var _0x241980=_0x2289[_0x2974e4];return _0x241980;};'use strict';var _=require('lodash');var util=require(_0x9228('0x0'));var moment=require(_0x9228('0x1'));var BPromise=require(_0x9228('0x2'));var rs=require(_0x9228('0x3'));var fs=require('fs');var Redis=require(_0x9228('0x4'));var db=require(_0x9228('0x5'))['db'];var utils=require(_0x9228('0x6'));var logger=require(_0x9228('0x7'))(_0x9228('0x8'));var config=require(_0x9228('0x9'));var jayson=require(_0x9228('0xa'));var client=jayson[_0x9228('0xb')][_0x9228('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f8a63,_0x377e4b,_0x28c251){return new BPromise(function(_0x403fd9,_0x464ec5){return client[_0x9228('0xd')](_0x2f8a63,_0x28c251)['then'](function(_0x3467a2){logger['info'](_0x9228('0xe'),_0x377e4b,_0x9228('0xf'));logger['debug'](_0x9228('0x10'),_0x377e4b,_0x9228('0xf'),JSON[_0x9228('0x11')](_0x3467a2));if(_0x3467a2[_0x9228('0x12')]){if(_0x3467a2[_0x9228('0x12')][_0x9228('0x13')]===0x1f4){logger[_0x9228('0x12')](_0x9228('0xe'),_0x377e4b,_0x3467a2[_0x9228('0x12')]['message']);return _0x464ec5(_0x3467a2['error'][_0x9228('0x14')]);}logger[_0x9228('0x12')]('DeskAccount,\x20%s,\x20%s',_0x377e4b,_0x3467a2[_0x9228('0x12')][_0x9228('0x14')]);return _0x403fd9(_0x3467a2['error'][_0x9228('0x14')]);}else{logger[_0x9228('0x15')]('DeskAccount,\x20%s,\x20%s',_0x377e4b,_0x9228('0xf'));_0x403fd9(_0x3467a2[_0x9228('0x16')][_0x9228('0x14')]);}})[_0x9228('0x17')](function(_0x48efca){logger[_0x9228('0x12')](_0x9228('0xe'),_0x377e4b,_0x48efca);_0x464ec5(_0x48efca);});});}exports[_0x9228('0x18')]=function(_0x4d6fc8){var _0x5c9e4f=this;return new Promise(function(_0x2016b7,_0x438045){return db[_0x9228('0x19')][_0x9228('0x1a')]({'raw':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8[_0x9228('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8['options'][_0x9228('0x1c')]||null:null,'attributes':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8[_0x9228('0x1b')]['attributes']||null:null,'limit':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8['options'][_0x9228('0x1d')]||null:null,'include':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8[_0x9228('0x1b')][_0x9228('0x1e')]?_['map'](_0x4d6fc8['options'][_0x9228('0x1e')],function(_0x4e4f85){return{'model':db[_0x4e4f85[_0x9228('0x1f')]],'as':_0x4e4f85['as'],'attributes':_0x4e4f85[_0x9228('0x20')],'include':_0x4e4f85[_0x9228('0x1e')]?_[_0x9228('0x21')](_0x4e4f85[_0x9228('0x1e')],function(_0x38ba37){return{'model':db[_0x38ba37[_0x9228('0x1f')]],'as':_0x38ba37['as'],'attributes':_0x38ba37['attributes'],'include':_0x38ba37[_0x9228('0x1e')]?_[_0x9228('0x21')](_0x38ba37[_0x9228('0x1e')],function(_0x19e362){return{'model':db[_0x19e362[_0x9228('0x1f')]],'as':_0x19e362['as'],'attributes':_0x19e362[_0x9228('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9228('0x22')](function(_0x3e998c){logger[_0x9228('0x15')](_0x9228('0x18'),_0x4d6fc8);logger['debug'](_0x9228('0x18'),_0x4d6fc8,JSON[_0x9228('0x11')](_0x3e998c));_0x2016b7(_0x3e998c);})['catch'](function(_0x630336){logger[_0x9228('0x12')](_0x9228('0x18'),_0x630336[_0x9228('0x14')],_0x4d6fc8);_0x438045(_0x5c9e4f[_0x9228('0x12')](0x1f4,_0x630336[_0x9228('0x14')]));});});};exports[_0x9228('0x23')]=function(_0x28bc87){var _0xe64e19=this;return new Promise(function(_0x388758,_0x375a04){return db[_0x9228('0x19')][_0x9228('0x24')]({'raw':_0x28bc87[_0x9228('0x1b')]?_0x28bc87['options'][_0x9228('0x25')]===undefined?!![]:![]:!![],'where':_0x28bc87[_0x9228('0x1b')]?_0x28bc87[_0x9228('0x1b')][_0x9228('0x1c')]||null:null,'attributes':_0x28bc87['options']?_0x28bc87[_0x9228('0x1b')][_0x9228('0x20')]||null:null,'include':_0x28bc87[_0x9228('0x1b')]?_0x28bc87[_0x9228('0x1b')][_0x9228('0x1e')]?_['map'](_0x28bc87[_0x9228('0x1b')][_0x9228('0x1e')],function(_0x8e7b38){return{'model':db[_0x8e7b38[_0x9228('0x1f')]],'as':_0x8e7b38['as'],'attributes':_0x8e7b38[_0x9228('0x20')],'include':_0x8e7b38[_0x9228('0x1e')]?_[_0x9228('0x21')](_0x8e7b38[_0x9228('0x1e')],function(_0x50c45c){return{'model':db[_0x50c45c[_0x9228('0x1f')]],'as':_0x50c45c['as'],'attributes':_0x50c45c[_0x9228('0x20')],'include':_0x50c45c['include']?_[_0x9228('0x21')](_0x50c45c[_0x9228('0x1e')],function(_0xd82fb2){return{'model':db[_0xd82fb2[_0x9228('0x1f')]],'as':_0xd82fb2['as'],'attributes':_0xd82fb2[_0x9228('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12f149){logger[_0x9228('0x15')](_0x9228('0x23'),_0x28bc87);logger[_0x9228('0x26')]('ShowDeskAccount',_0x28bc87,JSON[_0x9228('0x11')](_0x12f149));_0x388758(_0x12f149);})[_0x9228('0x17')](function(_0x309569){logger[_0x9228('0x12')](_0x9228('0x23'),_0x309569[_0x9228('0x14')],_0x28bc87);_0x375a04(_0xe64e19[_0x9228('0x12')](0x1f4,_0x309569[_0x9228('0x14')]));});});}; \ No newline at end of file +var _0x0546=['request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2e6def,_0xcd7d63){var _0x5ba6ee=function(_0x576775){while(--_0x576775){_0x2e6def['push'](_0x2e6def['shift']());}};_0x5ba6ee(++_0xcd7d63);}(_0x0546,0x177));var _0x6054=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0x0546[_0x3dc538];return _0x72c2fd;};'use strict';var _=require(_0x6054('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6054('0x1'));var rs=require(_0x6054('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6054('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6054('0x4'));var config=require(_0x6054('0x5'));var jayson=require(_0x6054('0x6'));var client=jayson[_0x6054('0x7')][_0x6054('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aa482,_0x276cf7,_0x5ebc2f){return new BPromise(function(_0x10302b,_0x2fe4c7){return client[_0x6054('0x9')](_0x5aa482,_0x5ebc2f)[_0x6054('0xa')](function(_0x4027ab){logger[_0x6054('0xb')](_0x6054('0xc'),_0x276cf7,_0x6054('0xd'));logger[_0x6054('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x276cf7,_0x6054('0xd'),JSON[_0x6054('0xf')](_0x4027ab));if(_0x4027ab[_0x6054('0x10')]){if(_0x4027ab['error'][_0x6054('0x11')]===0x1f4){logger[_0x6054('0x10')](_0x6054('0xc'),_0x276cf7,_0x4027ab['error']['message']);return _0x2fe4c7(_0x4027ab[_0x6054('0x10')][_0x6054('0x12')]);}logger[_0x6054('0x10')]('DeskAccount,\x20%s,\x20%s',_0x276cf7,_0x4027ab[_0x6054('0x10')]['message']);return _0x10302b(_0x4027ab[_0x6054('0x10')][_0x6054('0x12')]);}else{logger[_0x6054('0xb')](_0x6054('0xc'),_0x276cf7,_0x6054('0xd'));_0x10302b(_0x4027ab[_0x6054('0x13')][_0x6054('0x12')]);}})[_0x6054('0x14')](function(_0x46ea0f){logger['error'](_0x6054('0xc'),_0x276cf7,_0x46ea0f);_0x2fe4c7(_0x46ea0f);});});}exports[_0x6054('0x15')]=function(_0x31276a){var _0x2a5664=this;return new Promise(function(_0x429d43,_0x2d3aa4){return db[_0x6054('0x16')]['findAll']({'raw':_0x31276a[_0x6054('0x17')]?_0x31276a[_0x6054('0x17')][_0x6054('0x18')]===undefined?!![]:![]:!![],'where':_0x31276a[_0x6054('0x17')]?_0x31276a[_0x6054('0x17')][_0x6054('0x19')]||null:null,'attributes':_0x31276a['options']?_0x31276a['options'][_0x6054('0x1a')]||null:null,'limit':_0x31276a['options']?_0x31276a[_0x6054('0x17')][_0x6054('0x1b')]||null:null,'include':_0x31276a['options']?_0x31276a[_0x6054('0x17')][_0x6054('0x1c')]?_[_0x6054('0x1d')](_0x31276a[_0x6054('0x17')][_0x6054('0x1c')],function(_0xf15796){return{'model':db[_0xf15796[_0x6054('0x1e')]],'as':_0xf15796['as'],'attributes':_0xf15796['attributes'],'include':_0xf15796[_0x6054('0x1c')]?_[_0x6054('0x1d')](_0xf15796[_0x6054('0x1c')],function(_0x334860){return{'model':db[_0x334860['model']],'as':_0x334860['as'],'attributes':_0x334860[_0x6054('0x1a')],'include':_0x334860[_0x6054('0x1c')]?_[_0x6054('0x1d')](_0x334860[_0x6054('0x1c')],function(_0x359a74){return{'model':db[_0x359a74['model']],'as':_0x359a74['as'],'attributes':_0x359a74['attributes']};}):[]};}):[]};}):[]:[]})[_0x6054('0xa')](function(_0x15ea18){logger[_0x6054('0xb')](_0x6054('0x15'),_0x31276a);logger[_0x6054('0xe')](_0x6054('0x15'),_0x31276a,JSON[_0x6054('0xf')](_0x15ea18));_0x429d43(_0x15ea18);})[_0x6054('0x14')](function(_0x558b2e){logger[_0x6054('0x10')]('GetDeskAccount',_0x558b2e['message'],_0x31276a);_0x2d3aa4(_0x2a5664['error'](0x1f4,_0x558b2e['message']));});});};exports[_0x6054('0x1f')]=function(_0x154066){var _0x5ed642=this;return new Promise(function(_0x2bdfc5,_0x28ff17){return db[_0x6054('0x16')]['find']({'raw':_0x154066[_0x6054('0x17')]?_0x154066[_0x6054('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x154066[_0x6054('0x17')]?_0x154066[_0x6054('0x17')][_0x6054('0x19')]||null:null,'attributes':_0x154066[_0x6054('0x17')]?_0x154066[_0x6054('0x17')][_0x6054('0x1a')]||null:null,'include':_0x154066[_0x6054('0x17')]?_0x154066[_0x6054('0x17')][_0x6054('0x1c')]?_[_0x6054('0x1d')](_0x154066[_0x6054('0x17')]['include'],function(_0x3cd3a4){return{'model':db[_0x3cd3a4[_0x6054('0x1e')]],'as':_0x3cd3a4['as'],'attributes':_0x3cd3a4[_0x6054('0x1a')],'include':_0x3cd3a4[_0x6054('0x1c')]?_[_0x6054('0x1d')](_0x3cd3a4[_0x6054('0x1c')],function(_0x1dd09d){return{'model':db[_0x1dd09d['model']],'as':_0x1dd09d['as'],'attributes':_0x1dd09d[_0x6054('0x1a')],'include':_0x1dd09d[_0x6054('0x1c')]?_['map'](_0x1dd09d['include'],function(_0x57ff06){return{'model':db[_0x57ff06[_0x6054('0x1e')]],'as':_0x57ff06['as'],'attributes':_0x57ff06[_0x6054('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ab3d9){logger[_0x6054('0xb')]('ShowDeskAccount',_0x154066);logger[_0x6054('0xe')](_0x6054('0x1f'),_0x154066,JSON[_0x6054('0xf')](_0x1ab3d9));_0x2bdfc5(_0x1ab3d9);})[_0x6054('0x14')](function(_0x362fd4){logger[_0x6054('0x10')](_0x6054('0x1f'),_0x362fd4[_0x6054('0x12')],_0x154066);_0x28ff17(_0x5ed642[_0x6054('0x10')](0x1f4,_0x362fd4[_0x6054('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a04a40d..36af4f6 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x5e257b,_0x523b5d){var _0x52fb44=function(_0x3b2a64){while(--_0x3b2a64){_0x5e257b['push'](_0x5e257b['shift']());}};_0x52fb44(++_0x523b5d);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x183b3b,_0x1834ec){var _0x49029b=function(_0x567f89){while(--_0x567f89){_0x183b3b['push'](_0x183b3b['shift']());}};_0x49029b(++_0x1834ec);}(_0x008c,0x188));var _0xc008=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0x008c[_0x2298f0];return _0x39b136;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 02475fb..a05006f 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 _0x3ee7=['STRING','sequelize'];(function(_0x417f5e,_0x451ee2){var _0x5e017c=function(_0x1facf2){while(--_0x1facf2){_0x417f5e['push'](_0x417f5e['shift']());}};_0x5e017c(++_0x451ee2);}(_0x3ee7,0x10b));var _0x73ee=function(_0x4c8812,_0xa9d102){_0x4c8812=_0x4c8812-0x0;var _0x42d129=_0x3ee7[_0x4c8812];return _0x42d129;};'use strict';var Sequelize=require(_0x73ee('0x0'));module['exports']={'name':{'type':Sequelize[_0x73ee('0x1')]},'description':{'type':Sequelize[_0x73ee('0x1')]}}; \ No newline at end of file +var _0x88fd=['exports','STRING'];(function(_0x37e618,_0x4e288d){var _0x2b0307=function(_0x3e9a39){while(--_0x3e9a39){_0x37e618['push'](_0x37e618['shift']());}};_0x2b0307(++_0x4e288d);}(_0x88fd,0x90));var _0xd88f=function(_0x4098ad,_0x331fd1){_0x4098ad=_0x4098ad-0x0;var _0xb6533a=_0x88fd[_0x4098ad];return _0xb6533a;};'use strict';var Sequelize=require('sequelize');module[_0xd88f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd88f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 014be01..e498ccd 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 _0x3f66=['limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','DeskConfiguration','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','getFields','findOne','DeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3f66,0x12a));var _0x63f6=function(_0x1be707,_0x2e2fd5){_0x1be707=_0x1be707-0x0;var _0x351463=_0x3f66[_0x1be707];return _0x351463;};'use strict';var emlformat=require(_0x63f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63f6('0x1'));var jsonpatch=require(_0x63f6('0x2'));var rp=require(_0x63f6('0x3'));var moment=require(_0x63f6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x63f6('0x5'));var path=require('path');var sox=require(_0x63f6('0x6'));var csv=require(_0x63f6('0x7'));var ejs=require(_0x63f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63f6('0x9'));var squel=require(_0x63f6('0xa'));var crypto=require('crypto');var jsforce=require(_0x63f6('0xb'));var deskjs=require(_0x63f6('0xc'));var toCsv=require(_0x63f6('0x7'));var querystring=require('querystring');var Papa=require(_0x63f6('0xd'));var Redis=require('ioredis');var authService=require(_0x63f6('0xe'));var qs=require(_0x63f6('0xf'));var as=require(_0x63f6('0x10'));var hardwareService=require(_0x63f6('0x11'));var logger=require(_0x63f6('0x12'))(_0x63f6('0x13'));var utils=require(_0x63f6('0x14'));var config=require(_0x63f6('0x15'));var licenseUtil=require(_0x63f6('0x16'));var db=require(_0x63f6('0x17'))['db'];function respondWithStatusCode(_0x1bb08c,_0x52c328){_0x52c328=_0x52c328||0xcc;return function(_0xce65e0){if(_0xce65e0){return _0x1bb08c[_0x63f6('0x18')](_0x52c328);}return _0x1bb08c[_0x63f6('0x19')](_0x52c328)[_0x63f6('0x1a')]();};}function respondWithResult(_0x499515,_0x3b8af7){_0x3b8af7=_0x3b8af7||0xc8;return function(_0x267ded){if(_0x267ded){return _0x499515['status'](_0x3b8af7)['json'](_0x267ded);}};}function respondWithFilteredResult(_0x53a62c,_0x336a9c){return function(_0x14fa2d){if(_0x14fa2d){var _0x5299b4=typeof _0x336a9c[_0x63f6('0x1b')]===_0x63f6('0x1c')&&typeof _0x336a9c['limit']==='undefined';var _0x31ef2b=_0x14fa2d[_0x63f6('0x1d')];var _0x2ec351=_0x5299b4?0x0:_0x336a9c[_0x63f6('0x1b')];var _0x4e3a8f=_0x5299b4?_0x14fa2d[_0x63f6('0x1d')]:_0x336a9c[_0x63f6('0x1b')]+_0x336a9c[_0x63f6('0x1e')];var _0x7bd961;if(_0x4e3a8f>=_0x31ef2b){_0x4e3a8f=_0x31ef2b;_0x7bd961=0xc8;}else{_0x7bd961=0xce;}_0x53a62c[_0x63f6('0x19')](_0x7bd961);return _0x53a62c[_0x63f6('0x1f')](_0x63f6('0x20'),_0x2ec351+'-'+_0x4e3a8f+'/'+_0x31ef2b)['json'](_0x14fa2d);}return null;};}function patchUpdates(_0x246329){return function(_0x30542b){try{jsonpatch['apply'](_0x30542b,_0x246329,!![]);}catch(_0x6c3966){return BPromise['reject'](_0x6c3966);}return _0x30542b[_0x63f6('0x21')]();};}function saveUpdates(_0x110dea,_0x325c4b){return function(_0x5f4285){if(_0x5f4285){return _0x5f4285[_0x63f6('0x22')](_0x110dea)[_0x63f6('0x23')](function(_0x4f63eb){return _0x4f63eb;});}return null;};}function removeEntity(_0x109d73,_0xb35abf){return function(_0x4f0e5b){if(_0x4f0e5b){return _0x4f0e5b[_0x63f6('0x24')]()['then'](function(){_0x109d73['status'](0xcc)[_0x63f6('0x1a')]();});}};}function handleEntityNotFound(_0x37d40b,_0x1a980e){return function(_0x27ddaf){if(!_0x27ddaf){_0x37d40b[_0x63f6('0x18')](0x194);}return _0x27ddaf;};}function handleError(_0x2565dc,_0x152fca){_0x152fca=_0x152fca||0x1f4;return function(_0x4f2f3f){logger[_0x63f6('0x25')](_0x4f2f3f[_0x63f6('0x26')]);if(_0x4f2f3f[_0x63f6('0x27')]){delete _0x4f2f3f[_0x63f6('0x27')];}_0x2565dc[_0x63f6('0x19')](_0x152fca)['send'](_0x4f2f3f);};}exports[_0x63f6('0x28')]=function(_0x31fe27,_0x3fca64){var _0xe712b8={},_0x9af07a={},_0x131102={'count':0x0,'rows':[]};var _0x1360bb=_[_0x63f6('0x29')](db[_0x63f6('0x2a')]['rawAttributes'],function(_0x395da1){return{'name':_0x395da1[_0x63f6('0x2b')],'type':_0x395da1[_0x63f6('0x2c')]['key']};});_0x9af07a[_0x63f6('0x2d')]=_['map'](_0x1360bb,_0x63f6('0x27'));_0x9af07a[_0x63f6('0x2e')]=_['keys'](_0x31fe27[_0x63f6('0x2e')]);_0x9af07a[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x9af07a['model'],_0x9af07a['query']);_0xe712b8['attributes']=_[_0x63f6('0x30')](_0x9af07a[_0x63f6('0x2d')],qs[_0x63f6('0x31')](_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x31')]));_0xe712b8[_0x63f6('0x32')]=_0xe712b8['attributes'][_0x63f6('0x33')]?_0xe712b8[_0x63f6('0x32')]:_0x9af07a[_0x63f6('0x2d')];if(!_0x31fe27['query'][_0x63f6('0x34')](_0x63f6('0x35'))){_0xe712b8[_0x63f6('0x1e')]=qs[_0x63f6('0x1e')](_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x1e')]);_0xe712b8[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0x31fe27['query'][_0x63f6('0x1b')]);}_0xe712b8['order']=qs[_0x63f6('0x36')](_0x31fe27[_0x63f6('0x2e')]['sort']);_0xe712b8[_0x63f6('0x37')]=qs[_0x63f6('0x2f')](_[_0x63f6('0x38')](_0x31fe27[_0x63f6('0x2e')],_0x9af07a[_0x63f6('0x2f')]),_0x1360bb);if(_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x39')]){_0xe712b8['where']=_[_0x63f6('0x3a')](_0xe712b8[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x1360bb,function(_0x50c126){if(_0x50c126[_0x63f6('0x2c')]!==_0x63f6('0x3b')){var _0x4cfaa1={};_0x4cfaa1[_0x50c126[_0x63f6('0x27')]]={'$like':'%'+_0x31fe27[_0x63f6('0x2e')]['filter']+'%'};return _0x4cfaa1;}})});}_0xe712b8=_['merge']({},_0xe712b8,_0x31fe27[_0x63f6('0x3c')]);var _0x1a7b03={'where':_0xe712b8['where']};return db[_0x63f6('0x2a')][_0x63f6('0x1d')](_0x1a7b03)[_0x63f6('0x23')](function(_0x591071){_0x131102[_0x63f6('0x1d')]=_0x591071;if(_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x3d')]){_0xe712b8[_0x63f6('0x3e')]=[{'all':!![]}];}return db[_0x63f6('0x2a')][_0x63f6('0x3f')](_0xe712b8);})[_0x63f6('0x23')](function(_0x93ec9a){_0x131102['rows']=_0x93ec9a;return _0x131102;})[_0x63f6('0x23')](respondWithFilteredResult(_0x3fca64,_0xe712b8))['catch'](handleError(_0x3fca64,null));};exports[_0x63f6('0x40')]=function(_0x8e53e6,_0xc0d3bd){var _0x3464ad={'raw':![],'where':{'id':_0x8e53e6[_0x63f6('0x41')]['id']}},_0x452720={};_0x452720['model']=_[_0x63f6('0x42')](db[_0x63f6('0x2a')][_0x63f6('0x43')]);_0x452720[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x8e53e6[_0x63f6('0x2e')]);_0x452720[_0x63f6('0x2f')]=_['intersection'](_0x452720[_0x63f6('0x2d')],_0x452720[_0x63f6('0x2e')]);_0x3464ad[_0x63f6('0x32')]=_[_0x63f6('0x30')](_0x452720[_0x63f6('0x2d')],qs['fields'](_0x8e53e6[_0x63f6('0x2e')][_0x63f6('0x31')]));_0x3464ad['attributes']=_0x3464ad['attributes'][_0x63f6('0x33')]?_0x3464ad[_0x63f6('0x32')]:_0x452720[_0x63f6('0x2d')];if(_0x8e53e6[_0x63f6('0x2e')][_0x63f6('0x3d')]){_0x3464ad['include']=[{'all':!![]}];}_0x3464ad=_[_0x63f6('0x3a')]({},_0x3464ad,_0x8e53e6[_0x63f6('0x3c')]);return db[_0x63f6('0x2a')][_0x63f6('0x44')](_0x3464ad)[_0x63f6('0x23')](handleEntityNotFound(_0xc0d3bd,null))['then'](respondWithResult(_0xc0d3bd,null))[_0x63f6('0x45')](handleError(_0xc0d3bd,null));};exports[_0x63f6('0x46')]=function(_0x4a7fdb,_0xe06bb1){return db[_0x63f6('0x2a')]['create'](_0x4a7fdb[_0x63f6('0x47')],{})['then'](respondWithResult(_0xe06bb1,0xc9))[_0x63f6('0x45')](handleError(_0xe06bb1,null));};exports[_0x63f6('0x22')]=function(_0x1239ab,_0x1b51ad){if(_0x1239ab[_0x63f6('0x47')]['id']){delete _0x1239ab[_0x63f6('0x47')]['id'];}return db[_0x63f6('0x2a')]['find']({'where':{'id':_0x1239ab['params']['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x1b51ad,null))[_0x63f6('0x23')](saveUpdates(_0x1239ab['body'],null))[_0x63f6('0x23')](respondWithResult(_0x1b51ad,null))['catch'](handleError(_0x1b51ad,null));};exports['destroy']=function(_0x2e5e7a,_0x11467c){return db[_0x63f6('0x2a')][_0x63f6('0x44')]({'where':{'id':_0x2e5e7a[_0x63f6('0x41')]['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x11467c,null))[_0x63f6('0x23')](removeEntity(_0x11467c,null))['catch'](handleError(_0x11467c,null));};exports[_0x63f6('0x48')]=function(_0x59fefc,_0x15623a,_0xe981e2){var _0x249082={};var _0x93c243={};var _0x156818;var _0x14091b;return db['DeskConfiguration'][_0x63f6('0x49')]({'where':{'id':_0x59fefc[_0x63f6('0x41')]['id']}})['then'](handleEntityNotFound(_0x15623a,null))['then'](function(_0x120139){if(_0x120139){_0x156818=_0x120139;_0x93c243[_0x63f6('0x2d')]=_['keys'](db[_0x63f6('0x4a')][_0x63f6('0x43')]);_0x93c243[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x59fefc[_0x63f6('0x2e')]);_0x93c243[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x93c243[_0x63f6('0x2d')],_0x93c243[_0x63f6('0x2e')]);_0x249082[_0x63f6('0x32')]=_[_0x63f6('0x30')](_0x93c243['model'],qs['fields'](_0x59fefc[_0x63f6('0x2e')]['fields']));_0x249082[_0x63f6('0x32')]=_0x249082[_0x63f6('0x32')][_0x63f6('0x33')]?_0x249082[_0x63f6('0x32')]:_0x93c243['model'];_0x249082[_0x63f6('0x4b')]=qs[_0x63f6('0x36')](_0x59fefc[_0x63f6('0x2e')][_0x63f6('0x36')]);_0x249082[_0x63f6('0x37')]=qs[_0x63f6('0x2f')](_[_0x63f6('0x38')](_0x59fefc[_0x63f6('0x2e')],_0x93c243[_0x63f6('0x2f')]));if(_0x59fefc['query'][_0x63f6('0x39')]){_0x249082['where']=_[_0x63f6('0x3a')](_0x249082[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x249082[_0x63f6('0x32')],function(_0x3b2f38){var _0x2d29ab={};_0x2d29ab[_0x3b2f38]={'$like':'%'+_0x59fefc[_0x63f6('0x2e')]['filter']+'%'};return _0x2d29ab;})});}_0x249082=_['merge']({},_0x249082,_0x59fefc['options']);return _0x156818['getFields'](_0x249082);}})[_0x63f6('0x23')](function(_0x183cb3){if(_0x183cb3){_0x14091b=_0x183cb3[_0x63f6('0x33')];if(!_0x59fefc['query'][_0x63f6('0x34')](_0x63f6('0x35'))){_0x249082['limit']=qs['limit'](_0x59fefc[_0x63f6('0x2e')]['limit']);_0x249082['offset']=qs['offset'](_0x59fefc[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x156818[_0x63f6('0x48')](_0x249082);}})[_0x63f6('0x23')](function(_0x186e43){if(_0x186e43){return _0x186e43?{'count':_0x14091b,'rows':_0x186e43}:null;}})['then'](respondWithResult(_0x15623a,null))[_0x63f6('0x45')](handleError(_0x15623a,null));};exports[_0x63f6('0x4c')]=function(_0x320549,_0x1af4bb,_0x1811db){var _0x3f3ce4={};var _0x160ef3={};var _0x465ad0;var _0x4739fc;return db[_0x63f6('0x2a')]['findOne']({'where':{'id':_0x320549[_0x63f6('0x41')]['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x1af4bb,null))[_0x63f6('0x23')](function(_0x4313e5){if(_0x4313e5){_0x465ad0=_0x4313e5;_0x160ef3['model']=_[_0x63f6('0x42')](db[_0x63f6('0x4a')][_0x63f6('0x43')]);_0x160ef3[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x320549['query']);_0x160ef3[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x160ef3['model'],_0x160ef3['query']);_0x3f3ce4[_0x63f6('0x32')]=_['intersection'](_0x160ef3[_0x63f6('0x2d')],qs[_0x63f6('0x31')](_0x320549[_0x63f6('0x2e')]['fields']));_0x3f3ce4['attributes']=_0x3f3ce4['attributes'][_0x63f6('0x33')]?_0x3f3ce4[_0x63f6('0x32')]:_0x160ef3[_0x63f6('0x2d')];_0x3f3ce4['order']=qs[_0x63f6('0x36')](_0x320549[_0x63f6('0x2e')]['sort']);_0x3f3ce4['where']=qs['filters'](_['pick'](_0x320549[_0x63f6('0x2e')],_0x160ef3[_0x63f6('0x2f')]));if(_0x320549[_0x63f6('0x2e')]['filter']){_0x3f3ce4[_0x63f6('0x37')]=_[_0x63f6('0x3a')](_0x3f3ce4[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x3f3ce4[_0x63f6('0x32')],function(_0x190008){var _0x51be6c={};_0x51be6c[_0x190008]={'$like':'%'+_0x320549['query'][_0x63f6('0x39')]+'%'};return _0x51be6c;})});}_0x3f3ce4=_[_0x63f6('0x3a')]({},_0x3f3ce4,_0x320549[_0x63f6('0x3c')]);return _0x465ad0[_0x63f6('0x4c')](_0x3f3ce4);}})[_0x63f6('0x23')](function(_0x13e8d5){if(_0x13e8d5){_0x4739fc=_0x13e8d5[_0x63f6('0x33')];if(!_0x320549[_0x63f6('0x2e')][_0x63f6('0x34')](_0x63f6('0x35'))){_0x3f3ce4[_0x63f6('0x1e')]=qs[_0x63f6('0x1e')](_0x320549[_0x63f6('0x2e')][_0x63f6('0x1e')]);_0x3f3ce4[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0x320549[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x465ad0[_0x63f6('0x4c')](_0x3f3ce4);}})['then'](function(_0x4e18ce){if(_0x4e18ce){return _0x4e18ce?{'count':_0x4739fc,'rows':_0x4e18ce}:null;}})[_0x63f6('0x23')](respondWithResult(_0x1af4bb,null))[_0x63f6('0x45')](handleError(_0x1af4bb,null));};exports[_0x63f6('0x4d')]=function(_0xc3b376,_0xffd6f3,_0x5cb2f2){var _0x3468ad={};var _0x4152a8={};var _0x30d606;var _0x93293f;return db[_0x63f6('0x2a')]['findOne']({'where':{'id':_0xc3b376[_0x63f6('0x41')]['id']}})['then'](handleEntityNotFound(_0xffd6f3,null))[_0x63f6('0x23')](function(_0x5e09d5){if(_0x5e09d5){_0x30d606=_0x5e09d5;_0x4152a8[_0x63f6('0x2d')]=_[_0x63f6('0x42')](db[_0x63f6('0x4a')][_0x63f6('0x43')]);_0x4152a8[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0xc3b376[_0x63f6('0x2e')]);_0x4152a8[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x4152a8[_0x63f6('0x2d')],_0x4152a8[_0x63f6('0x2e')]);_0x3468ad[_0x63f6('0x32')]=_['intersection'](_0x4152a8['model'],qs[_0x63f6('0x31')](_0xc3b376['query'][_0x63f6('0x31')]));_0x3468ad[_0x63f6('0x32')]=_0x3468ad['attributes']['length']?_0x3468ad[_0x63f6('0x32')]:_0x4152a8[_0x63f6('0x2d')];_0x3468ad[_0x63f6('0x4b')]=qs['sort'](_0xc3b376[_0x63f6('0x2e')][_0x63f6('0x36')]);_0x3468ad['where']=qs['filters'](_[_0x63f6('0x38')](_0xc3b376[_0x63f6('0x2e')],_0x4152a8[_0x63f6('0x2f')]));if(_0xc3b376[_0x63f6('0x2e')][_0x63f6('0x39')]){_0x3468ad[_0x63f6('0x37')]=_[_0x63f6('0x3a')](_0x3468ad[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x3468ad['attributes'],function(_0x1bf0f5){var _0x250615={};_0x250615[_0x1bf0f5]={'$like':'%'+_0xc3b376['query'][_0x63f6('0x39')]+'%'};return _0x250615;})});}_0x3468ad=_[_0x63f6('0x3a')]({},_0x3468ad,_0xc3b376['options']);return _0x30d606['getDescriptions'](_0x3468ad);}})[_0x63f6('0x23')](function(_0x15ffc8){if(_0x15ffc8){_0x93293f=_0x15ffc8[_0x63f6('0x33')];if(!_0xc3b376['query'][_0x63f6('0x34')](_0x63f6('0x35'))){_0x3468ad[_0x63f6('0x1e')]=qs[_0x63f6('0x1e')](_0xc3b376[_0x63f6('0x2e')]['limit']);_0x3468ad[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0xc3b376[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x30d606[_0x63f6('0x4d')](_0x3468ad);}})[_0x63f6('0x23')](function(_0x951732){if(_0x951732){return _0x951732?{'count':_0x93293f,'rows':_0x951732}:null;}})[_0x63f6('0x23')](respondWithResult(_0xffd6f3,null))[_0x63f6('0x45')](handleError(_0xffd6f3,null));};exports['getTags']=function(_0x22ce21,_0x1598fc,_0x3bc624){var _0x35f076={};var _0x48611f={};var _0x1ebefa;var _0x660e07;return db[_0x63f6('0x2a')][_0x63f6('0x49')]({'where':{'id':_0x22ce21['params']['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x1598fc,null))['then'](function(_0x3a48b6){if(_0x3a48b6){_0x1ebefa=_0x3a48b6;_0x48611f[_0x63f6('0x2d')]=_[_0x63f6('0x42')](db[_0x63f6('0x4e')][_0x63f6('0x43')]);_0x48611f[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x22ce21[_0x63f6('0x2e')]);_0x48611f['filters']=_[_0x63f6('0x30')](_0x48611f[_0x63f6('0x2d')],_0x48611f[_0x63f6('0x2e')]);_0x35f076['attributes']=_[_0x63f6('0x30')](_0x48611f[_0x63f6('0x2d')],qs[_0x63f6('0x31')](_0x22ce21[_0x63f6('0x2e')]['fields']));_0x35f076[_0x63f6('0x32')]=_0x35f076[_0x63f6('0x32')][_0x63f6('0x33')]?_0x35f076[_0x63f6('0x32')]:_0x48611f[_0x63f6('0x2d')];_0x35f076['order']=qs[_0x63f6('0x36')](_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x36')]);_0x35f076[_0x63f6('0x37')]=qs[_0x63f6('0x2f')](_['pick'](_0x22ce21[_0x63f6('0x2e')],_0x48611f[_0x63f6('0x2f')]));if(_0x22ce21['query'][_0x63f6('0x39')]){_0x35f076[_0x63f6('0x37')]=_[_0x63f6('0x3a')](_0x35f076[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x35f076[_0x63f6('0x32')],function(_0x478051){var _0x24fdc2={};_0x24fdc2[_0x478051]={'$like':'%'+_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x39')]+'%'};return _0x24fdc2;})});}_0x35f076=_['merge']({},_0x35f076,_0x22ce21['options']);return _0x1ebefa[_0x63f6('0x4f')](_0x35f076);}})[_0x63f6('0x23')](function(_0x48d199){if(_0x48d199){_0x660e07=_0x48d199['length'];if(!_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x34')]('nolimit')){_0x35f076[_0x63f6('0x1e')]=qs['limit'](_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x1e')]);_0x35f076[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x1ebefa[_0x63f6('0x4f')](_0x35f076);}})[_0x63f6('0x23')](function(_0x39bc80){if(_0x39bc80){return _0x39bc80?{'count':_0x660e07,'rows':_0x39bc80}:null;}})['then'](respondWithResult(_0x1598fc,null))[_0x63f6('0x45')](handleError(_0x1598fc,null));};exports[_0x63f6('0x50')]=function(_0x7164af,_0x242c6e,_0x21c23b){if(_0x7164af[_0x63f6('0x47')]['id']){delete _0x7164af[_0x63f6('0x47')]['id'];}return db[_0x63f6('0x2a')][_0x63f6('0x49')]({'where':{'id':_0x7164af[_0x63f6('0x41')]['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x242c6e,null))[_0x63f6('0x23')](function(_0x284e71){if(_0x284e71){return _0x284e71['setTags'](_0x7164af[_0x63f6('0x47')][_0x63f6('0x51')]||[]);}return null;})[_0x63f6('0x23')](respondWithResult(_0x242c6e,null))[_0x63f6('0x45')](handleError(_0x242c6e,null));}; \ No newline at end of file +var _0x1889=['request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','getFields','getSubjects','DeskField','getDescriptions','findOne','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x106fed,_0x3d8337){var _0x39e37d=function(_0xf49ece){while(--_0xf49ece){_0x106fed['push'](_0x106fed['shift']());}};_0x39e37d(++_0x3d8337);}(_0x1889,0x160));var _0x9188=function(_0x148d42,_0x10ee67){_0x148d42=_0x148d42-0x0;var _0x3c6482=_0x1889[_0x148d42];return _0x3c6482;};'use strict';var emlformat=require(_0x9188('0x0'));var rimraf=require(_0x9188('0x1'));var zipdir=require(_0x9188('0x2'));var jsonpatch=require(_0x9188('0x3'));var rp=require(_0x9188('0x4'));var moment=require(_0x9188('0x5'));var BPromise=require(_0x9188('0x6'));var Mustache=require(_0x9188('0x7'));var util=require('util');var path=require(_0x9188('0x8'));var sox=require('sox');var csv=require(_0x9188('0x9'));var ejs=require(_0x9188('0xa'));var fs=require('fs');var fs_extra=require(_0x9188('0xb'));var _=require(_0x9188('0xc'));var squel=require(_0x9188('0xd'));var crypto=require(_0x9188('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9188('0xf'));var toCsv=require(_0x9188('0x9'));var querystring=require(_0x9188('0x10'));var Papa=require(_0x9188('0x11'));var Redis=require(_0x9188('0x12'));var authService=require(_0x9188('0x13'));var qs=require(_0x9188('0x14'));var as=require(_0x9188('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9188('0x16'))(_0x9188('0x17'));var utils=require(_0x9188('0x18'));var config=require(_0x9188('0x19'));var licenseUtil=require(_0x9188('0x1a'));var db=require(_0x9188('0x1b'))['db'];function respondWithStatusCode(_0x100dc9,_0x26b157){_0x26b157=_0x26b157||0xcc;return function(_0x2d7ced){if(_0x2d7ced){return _0x100dc9[_0x9188('0x1c')](_0x26b157);}return _0x100dc9[_0x9188('0x1d')](_0x26b157)[_0x9188('0x1e')]();};}function respondWithResult(_0x2fb829,_0x2e3abf){_0x2e3abf=_0x2e3abf||0xc8;return function(_0x4c0244){if(_0x4c0244){return _0x2fb829[_0x9188('0x1d')](_0x2e3abf)['json'](_0x4c0244);}};}function respondWithFilteredResult(_0x1e5af4,_0x5ad722){return function(_0x1cc7c7){if(_0x1cc7c7){var _0x47f964=typeof _0x5ad722['offset']===_0x9188('0x1f')&&typeof _0x5ad722['limit']===_0x9188('0x1f');var _0x5eb9ee=_0x1cc7c7['count'];var _0x44f7b8=_0x47f964?0x0:_0x5ad722['offset'];var _0x181bed=_0x47f964?_0x1cc7c7[_0x9188('0x20')]:_0x5ad722[_0x9188('0x21')]+_0x5ad722[_0x9188('0x22')];var _0x521a2e;if(_0x181bed>=_0x5eb9ee){_0x181bed=_0x5eb9ee;_0x521a2e=0xc8;}else{_0x521a2e=0xce;}_0x1e5af4['status'](_0x521a2e);return _0x1e5af4[_0x9188('0x23')](_0x9188('0x24'),_0x44f7b8+'-'+_0x181bed+'/'+_0x5eb9ee)[_0x9188('0x25')](_0x1cc7c7);}return null;};}function patchUpdates(_0x132df9){return function(_0x519357){try{jsonpatch[_0x9188('0x26')](_0x519357,_0x132df9,!![]);}catch(_0x4cd047){return BPromise[_0x9188('0x27')](_0x4cd047);}return _0x519357[_0x9188('0x28')]();};}function saveUpdates(_0x245d02,_0x103776){return function(_0x28f540){if(_0x28f540){return _0x28f540[_0x9188('0x29')](_0x245d02)[_0x9188('0x2a')](function(_0xe0843d){return _0xe0843d;});}return null;};}function removeEntity(_0x3f863a,_0x4ac40f){return function(_0x9868b9){if(_0x9868b9){return _0x9868b9['destroy']()[_0x9188('0x2a')](function(){_0x3f863a[_0x9188('0x1d')](0xcc)[_0x9188('0x1e')]();});}};}function handleEntityNotFound(_0x34d24b,_0x321678){return function(_0x3d92b8){if(!_0x3d92b8){_0x34d24b[_0x9188('0x1c')](0x194);}return _0x3d92b8;};}function handleError(_0x50315c,_0x154d3c){_0x154d3c=_0x154d3c||0x1f4;return function(_0x81e42f){logger[_0x9188('0x2b')](_0x81e42f[_0x9188('0x2c')]);if(_0x81e42f[_0x9188('0x2d')]){delete _0x81e42f[_0x9188('0x2d')];}_0x50315c[_0x9188('0x1d')](_0x154d3c)[_0x9188('0x2e')](_0x81e42f);};}exports[_0x9188('0x2f')]=function(_0x893808,_0x551151){var _0x160003={},_0x26d946={},_0x24c23e={'count':0x0,'rows':[]};var _0x329e90=_[_0x9188('0x30')](db[_0x9188('0x31')][_0x9188('0x32')],function(_0x235fd8){return{'name':_0x235fd8[_0x9188('0x33')],'type':_0x235fd8[_0x9188('0x34')]['key']};});_0x26d946[_0x9188('0x35')]=_[_0x9188('0x30')](_0x329e90,'name');_0x26d946['query']=_[_0x9188('0x36')](_0x893808[_0x9188('0x37')]);_0x26d946[_0x9188('0x38')]=_[_0x9188('0x39')](_0x26d946[_0x9188('0x35')],_0x26d946['query']);_0x160003['attributes']=_[_0x9188('0x39')](_0x26d946['model'],qs[_0x9188('0x3a')](_0x893808['query']['fields']));_0x160003[_0x9188('0x3b')]=_0x160003[_0x9188('0x3b')][_0x9188('0x3c')]?_0x160003[_0x9188('0x3b')]:_0x26d946[_0x9188('0x35')];if(!_0x893808['query'][_0x9188('0x3d')](_0x9188('0x3e'))){_0x160003[_0x9188('0x22')]=qs[_0x9188('0x22')](_0x893808[_0x9188('0x37')][_0x9188('0x22')]);_0x160003['offset']=qs['offset'](_0x893808[_0x9188('0x37')]['offset']);}_0x160003[_0x9188('0x3f')]=qs[_0x9188('0x40')](_0x893808[_0x9188('0x37')][_0x9188('0x40')]);_0x160003[_0x9188('0x41')]=qs[_0x9188('0x38')](_[_0x9188('0x42')](_0x893808[_0x9188('0x37')],_0x26d946[_0x9188('0x38')]),_0x329e90);if(_0x893808['query']['filter']){_0x160003[_0x9188('0x41')]=_['merge'](_0x160003[_0x9188('0x41')],{'$or':_[_0x9188('0x30')](_0x329e90,function(_0x408e34){if(_0x408e34['type']!==_0x9188('0x43')){var _0x440889={};_0x440889[_0x408e34[_0x9188('0x2d')]]={'$like':'%'+_0x893808[_0x9188('0x37')][_0x9188('0x44')]+'%'};return _0x440889;}})});}_0x160003=_[_0x9188('0x45')]({},_0x160003,_0x893808[_0x9188('0x46')]);var _0xf734={'where':_0x160003[_0x9188('0x41')]};return db[_0x9188('0x31')][_0x9188('0x20')](_0xf734)[_0x9188('0x2a')](function(_0x55d8be){_0x24c23e[_0x9188('0x20')]=_0x55d8be;if(_0x893808[_0x9188('0x37')][_0x9188('0x47')]){_0x160003[_0x9188('0x48')]=[{'all':!![]}];}return db[_0x9188('0x31')][_0x9188('0x49')](_0x160003);})['then'](function(_0x259802){_0x24c23e['rows']=_0x259802;return _0x24c23e;})[_0x9188('0x2a')](respondWithFilteredResult(_0x551151,_0x160003))[_0x9188('0x4a')](handleError(_0x551151,null));};exports[_0x9188('0x4b')]=function(_0x253d21,_0x5860f6){var _0x49656a={'raw':![],'where':{'id':_0x253d21[_0x9188('0x4c')]['id']}},_0x164899={};_0x164899['model']=_['keys'](db[_0x9188('0x31')][_0x9188('0x32')]);_0x164899['query']=_[_0x9188('0x36')](_0x253d21['query']);_0x164899[_0x9188('0x38')]=_[_0x9188('0x39')](_0x164899['model'],_0x164899[_0x9188('0x37')]);_0x49656a[_0x9188('0x3b')]=_[_0x9188('0x39')](_0x164899[_0x9188('0x35')],qs[_0x9188('0x3a')](_0x253d21[_0x9188('0x37')]['fields']));_0x49656a[_0x9188('0x3b')]=_0x49656a[_0x9188('0x3b')]['length']?_0x49656a[_0x9188('0x3b')]:_0x164899[_0x9188('0x35')];if(_0x253d21[_0x9188('0x37')][_0x9188('0x47')]){_0x49656a[_0x9188('0x48')]=[{'all':!![]}];}_0x49656a=_[_0x9188('0x45')]({},_0x49656a,_0x253d21[_0x9188('0x46')]);return db[_0x9188('0x31')][_0x9188('0x4d')](_0x49656a)[_0x9188('0x2a')](handleEntityNotFound(_0x5860f6,null))[_0x9188('0x2a')](respondWithResult(_0x5860f6,null))[_0x9188('0x4a')](handleError(_0x5860f6,null));};exports[_0x9188('0x4e')]=function(_0x5956ea,_0x22a7ee){return db[_0x9188('0x31')][_0x9188('0x4e')](_0x5956ea[_0x9188('0x4f')],{})['then'](respondWithResult(_0x22a7ee,0xc9))[_0x9188('0x4a')](handleError(_0x22a7ee,null));};exports[_0x9188('0x29')]=function(_0x2999b2,_0x5cb76c){if(_0x2999b2[_0x9188('0x4f')]['id']){delete _0x2999b2[_0x9188('0x4f')]['id'];}return db[_0x9188('0x31')][_0x9188('0x4d')]({'where':{'id':_0x2999b2[_0x9188('0x4c')]['id']}})[_0x9188('0x2a')](handleEntityNotFound(_0x5cb76c,null))[_0x9188('0x2a')](saveUpdates(_0x2999b2[_0x9188('0x4f')],null))[_0x9188('0x2a')](respondWithResult(_0x5cb76c,null))[_0x9188('0x4a')](handleError(_0x5cb76c,null));};exports[_0x9188('0x50')]=function(_0x38023e,_0x10e20b){return db[_0x9188('0x31')][_0x9188('0x4d')]({'where':{'id':_0x38023e['params']['id']}})[_0x9188('0x2a')](handleEntityNotFound(_0x10e20b,null))[_0x9188('0x2a')](removeEntity(_0x10e20b,null))[_0x9188('0x4a')](handleError(_0x10e20b,null));};exports[_0x9188('0x51')]=function(_0x16c010,_0x107716,_0xf14ab1){var _0x2f8853={};var _0x2df634={};var _0x4571a6;var _0x396480;return db[_0x9188('0x31')]['findOne']({'where':{'id':_0x16c010[_0x9188('0x4c')]['id']}})[_0x9188('0x2a')](handleEntityNotFound(_0x107716,null))[_0x9188('0x2a')](function(_0x2e0c29){if(_0x2e0c29){_0x4571a6=_0x2e0c29;_0x2df634['model']=_['keys'](db['DeskField']['rawAttributes']);_0x2df634[_0x9188('0x37')]=_[_0x9188('0x36')](_0x16c010['query']);_0x2df634[_0x9188('0x38')]=_['intersection'](_0x2df634['model'],_0x2df634['query']);_0x2f8853[_0x9188('0x3b')]=_['intersection'](_0x2df634[_0x9188('0x35')],qs[_0x9188('0x3a')](_0x16c010[_0x9188('0x37')][_0x9188('0x3a')]));_0x2f8853[_0x9188('0x3b')]=_0x2f8853[_0x9188('0x3b')]['length']?_0x2f8853['attributes']:_0x2df634['model'];_0x2f8853[_0x9188('0x3f')]=qs[_0x9188('0x40')](_0x16c010[_0x9188('0x37')][_0x9188('0x40')]);_0x2f8853[_0x9188('0x41')]=qs['filters'](_[_0x9188('0x42')](_0x16c010['query'],_0x2df634[_0x9188('0x38')]));if(_0x16c010[_0x9188('0x37')][_0x9188('0x44')]){_0x2f8853[_0x9188('0x41')]=_[_0x9188('0x45')](_0x2f8853[_0x9188('0x41')],{'$or':_[_0x9188('0x30')](_0x2f8853[_0x9188('0x3b')],function(_0x44d7f1){var _0x57568c={};_0x57568c[_0x44d7f1]={'$like':'%'+_0x16c010['query'][_0x9188('0x44')]+'%'};return _0x57568c;})});}_0x2f8853=_[_0x9188('0x45')]({},_0x2f8853,_0x16c010[_0x9188('0x46')]);return _0x4571a6[_0x9188('0x51')](_0x2f8853);}})['then'](function(_0x5e2958){if(_0x5e2958){_0x396480=_0x5e2958[_0x9188('0x3c')];if(!_0x16c010[_0x9188('0x37')][_0x9188('0x3d')](_0x9188('0x3e'))){_0x2f8853['limit']=qs[_0x9188('0x22')](_0x16c010[_0x9188('0x37')]['limit']);_0x2f8853[_0x9188('0x21')]=qs[_0x9188('0x21')](_0x16c010['query'][_0x9188('0x21')]);}return _0x4571a6['getFields'](_0x2f8853);}})['then'](function(_0x269749){if(_0x269749){return _0x269749?{'count':_0x396480,'rows':_0x269749}:null;}})[_0x9188('0x2a')](respondWithResult(_0x107716,null))[_0x9188('0x4a')](handleError(_0x107716,null));};exports[_0x9188('0x52')]=function(_0x1dcfc1,_0x45b48f,_0x386b63){var _0x2f5c69={};var _0x536846={};var _0x4f14cc;var _0x4cf2e0;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1dcfc1[_0x9188('0x4c')]['id']}})[_0x9188('0x2a')](handleEntityNotFound(_0x45b48f,null))[_0x9188('0x2a')](function(_0x1b8d8f){if(_0x1b8d8f){_0x4f14cc=_0x1b8d8f;_0x536846[_0x9188('0x35')]=_[_0x9188('0x36')](db[_0x9188('0x53')][_0x9188('0x32')]);_0x536846[_0x9188('0x37')]=_[_0x9188('0x36')](_0x1dcfc1[_0x9188('0x37')]);_0x536846[_0x9188('0x38')]=_[_0x9188('0x39')](_0x536846[_0x9188('0x35')],_0x536846['query']);_0x2f5c69[_0x9188('0x3b')]=_[_0x9188('0x39')](_0x536846[_0x9188('0x35')],qs[_0x9188('0x3a')](_0x1dcfc1[_0x9188('0x37')][_0x9188('0x3a')]));_0x2f5c69['attributes']=_0x2f5c69[_0x9188('0x3b')][_0x9188('0x3c')]?_0x2f5c69[_0x9188('0x3b')]:_0x536846['model'];_0x2f5c69[_0x9188('0x3f')]=qs[_0x9188('0x40')](_0x1dcfc1[_0x9188('0x37')][_0x9188('0x40')]);_0x2f5c69[_0x9188('0x41')]=qs['filters'](_[_0x9188('0x42')](_0x1dcfc1[_0x9188('0x37')],_0x536846[_0x9188('0x38')]));if(_0x1dcfc1['query'][_0x9188('0x44')]){_0x2f5c69[_0x9188('0x41')]=_[_0x9188('0x45')](_0x2f5c69['where'],{'$or':_['map'](_0x2f5c69['attributes'],function(_0x22f3c2){var _0x2a5627={};_0x2a5627[_0x22f3c2]={'$like':'%'+_0x1dcfc1[_0x9188('0x37')][_0x9188('0x44')]+'%'};return _0x2a5627;})});}_0x2f5c69=_['merge']({},_0x2f5c69,_0x1dcfc1[_0x9188('0x46')]);return _0x4f14cc['getSubjects'](_0x2f5c69);}})[_0x9188('0x2a')](function(_0x4c3f6a){if(_0x4c3f6a){_0x4cf2e0=_0x4c3f6a['length'];if(!_0x1dcfc1[_0x9188('0x37')][_0x9188('0x3d')]('nolimit')){_0x2f5c69['limit']=qs[_0x9188('0x22')](_0x1dcfc1[_0x9188('0x37')][_0x9188('0x22')]);_0x2f5c69['offset']=qs[_0x9188('0x21')](_0x1dcfc1['query'][_0x9188('0x21')]);}return _0x4f14cc[_0x9188('0x52')](_0x2f5c69);}})['then'](function(_0x402f8b){if(_0x402f8b){return _0x402f8b?{'count':_0x4cf2e0,'rows':_0x402f8b}:null;}})[_0x9188('0x2a')](respondWithResult(_0x45b48f,null))[_0x9188('0x4a')](handleError(_0x45b48f,null));};exports[_0x9188('0x54')]=function(_0x29d498,_0x358ec1,_0x55840c){var _0x1fd2d3={};var _0x35c2f7={};var _0x25a984;var _0x3529f5;return db[_0x9188('0x31')][_0x9188('0x55')]({'where':{'id':_0x29d498[_0x9188('0x4c')]['id']}})[_0x9188('0x2a')](handleEntityNotFound(_0x358ec1,null))['then'](function(_0x4f3ba6){if(_0x4f3ba6){_0x25a984=_0x4f3ba6;_0x35c2f7[_0x9188('0x35')]=_[_0x9188('0x36')](db[_0x9188('0x53')][_0x9188('0x32')]);_0x35c2f7[_0x9188('0x37')]=_[_0x9188('0x36')](_0x29d498['query']);_0x35c2f7[_0x9188('0x38')]=_['intersection'](_0x35c2f7[_0x9188('0x35')],_0x35c2f7['query']);_0x1fd2d3[_0x9188('0x3b')]=_[_0x9188('0x39')](_0x35c2f7[_0x9188('0x35')],qs['fields'](_0x29d498['query'][_0x9188('0x3a')]));_0x1fd2d3['attributes']=_0x1fd2d3[_0x9188('0x3b')]['length']?_0x1fd2d3[_0x9188('0x3b')]:_0x35c2f7[_0x9188('0x35')];_0x1fd2d3['order']=qs[_0x9188('0x40')](_0x29d498[_0x9188('0x37')]['sort']);_0x1fd2d3['where']=qs[_0x9188('0x38')](_[_0x9188('0x42')](_0x29d498[_0x9188('0x37')],_0x35c2f7['filters']));if(_0x29d498[_0x9188('0x37')]['filter']){_0x1fd2d3[_0x9188('0x41')]=_['merge'](_0x1fd2d3[_0x9188('0x41')],{'$or':_[_0x9188('0x30')](_0x1fd2d3[_0x9188('0x3b')],function(_0x38a679){var _0x344a21={};_0x344a21[_0x38a679]={'$like':'%'+_0x29d498['query'][_0x9188('0x44')]+'%'};return _0x344a21;})});}_0x1fd2d3=_['merge']({},_0x1fd2d3,_0x29d498['options']);return _0x25a984['getDescriptions'](_0x1fd2d3);}})['then'](function(_0x197aef){if(_0x197aef){_0x3529f5=_0x197aef[_0x9188('0x3c')];if(!_0x29d498[_0x9188('0x37')][_0x9188('0x3d')](_0x9188('0x3e'))){_0x1fd2d3[_0x9188('0x22')]=qs[_0x9188('0x22')](_0x29d498[_0x9188('0x37')][_0x9188('0x22')]);_0x1fd2d3[_0x9188('0x21')]=qs[_0x9188('0x21')](_0x29d498['query']['offset']);}return _0x25a984[_0x9188('0x54')](_0x1fd2d3);}})[_0x9188('0x2a')](function(_0x2bce83){if(_0x2bce83){return _0x2bce83?{'count':_0x3529f5,'rows':_0x2bce83}:null;}})[_0x9188('0x2a')](respondWithResult(_0x358ec1,null))[_0x9188('0x4a')](handleError(_0x358ec1,null));};exports[_0x9188('0x56')]=function(_0x45d6cf,_0xccdf48,_0x50c8e4){var _0x3d0320={};var _0x31a117={};var _0x9c726;var _0x152e57;return db[_0x9188('0x31')]['findOne']({'where':{'id':_0x45d6cf[_0x9188('0x4c')]['id']}})[_0x9188('0x2a')](handleEntityNotFound(_0xccdf48,null))[_0x9188('0x2a')](function(_0x28d097){if(_0x28d097){_0x9c726=_0x28d097;_0x31a117[_0x9188('0x35')]=_[_0x9188('0x36')](db['Tag']['rawAttributes']);_0x31a117[_0x9188('0x37')]=_['keys'](_0x45d6cf[_0x9188('0x37')]);_0x31a117['filters']=_['intersection'](_0x31a117[_0x9188('0x35')],_0x31a117['query']);_0x3d0320['attributes']=_[_0x9188('0x39')](_0x31a117['model'],qs[_0x9188('0x3a')](_0x45d6cf['query'][_0x9188('0x3a')]));_0x3d0320[_0x9188('0x3b')]=_0x3d0320[_0x9188('0x3b')][_0x9188('0x3c')]?_0x3d0320[_0x9188('0x3b')]:_0x31a117[_0x9188('0x35')];_0x3d0320[_0x9188('0x3f')]=qs['sort'](_0x45d6cf[_0x9188('0x37')][_0x9188('0x40')]);_0x3d0320['where']=qs[_0x9188('0x38')](_[_0x9188('0x42')](_0x45d6cf[_0x9188('0x37')],_0x31a117[_0x9188('0x38')]));if(_0x45d6cf[_0x9188('0x37')][_0x9188('0x44')]){_0x3d0320[_0x9188('0x41')]=_[_0x9188('0x45')](_0x3d0320['where'],{'$or':_[_0x9188('0x30')](_0x3d0320['attributes'],function(_0x1364be){var _0x212e2e={};_0x212e2e[_0x1364be]={'$like':'%'+_0x45d6cf['query'][_0x9188('0x44')]+'%'};return _0x212e2e;})});}_0x3d0320=_[_0x9188('0x45')]({},_0x3d0320,_0x45d6cf['options']);return _0x9c726['getTags'](_0x3d0320);}})[_0x9188('0x2a')](function(_0x10ebca){if(_0x10ebca){_0x152e57=_0x10ebca[_0x9188('0x3c')];if(!_0x45d6cf['query'][_0x9188('0x3d')](_0x9188('0x3e'))){_0x3d0320[_0x9188('0x22')]=qs['limit'](_0x45d6cf['query']['limit']);_0x3d0320[_0x9188('0x21')]=qs[_0x9188('0x21')](_0x45d6cf['query'][_0x9188('0x21')]);}return _0x9c726[_0x9188('0x56')](_0x3d0320);}})[_0x9188('0x2a')](function(_0x594ae1){if(_0x594ae1){return _0x594ae1?{'count':_0x152e57,'rows':_0x594ae1}:null;}})['then'](respondWithResult(_0xccdf48,null))[_0x9188('0x4a')](handleError(_0xccdf48,null));};exports[_0x9188('0x57')]=function(_0x5749ed,_0x1502e6,_0x125bc6){if(_0x5749ed[_0x9188('0x4f')]['id']){delete _0x5749ed[_0x9188('0x4f')]['id'];}return db[_0x9188('0x31')][_0x9188('0x55')]({'where':{'id':_0x5749ed[_0x9188('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1502e6,null))[_0x9188('0x2a')](function(_0x2972ad){if(_0x2972ad){return _0x2972ad[_0x9188('0x57')](_0x5749ed[_0x9188('0x4f')][_0x9188('0x58')]||[]);}return null;})[_0x9188('0x2a')](respondWithResult(_0x1502e6,null))['catch'](handleError(_0x1502e6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index c6d2476..00adc31 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 _0x448a=['bluebird','path','../../config/environment','exports','DeskConfiguration','util','../../config/logger','api'];(function(_0x3ff1a1,_0x5f37d5){var _0x50200a=function(_0x1b1717){while(--_0x1b1717){_0x3ff1a1['push'](_0x3ff1a1['shift']());}};_0x50200a(++_0x5f37d5);}(_0x448a,0x65));var _0xa448=function(_0x49eed8,_0x9aa73c){_0x49eed8=_0x49eed8-0x0;var _0x1b2667=_0x448a[_0x49eed8];return _0x1b2667;};'use strict';var _=require('lodash');var util=require(_0xa448('0x0'));var logger=require(_0xa448('0x1'))(_0xa448('0x2'));var moment=require('moment');var BPromise=require(_0xa448('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa448('0x4'));var rimraf=require('rimraf');var config=require(_0xa448('0x5'));var attributes=require('./intDeskConfiguration.attributes');module[_0xa448('0x6')]=function(_0x5de0cf,_0x3181df){return _0x5de0cf['define'](_0xa448('0x7'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2930=['moment','bluebird','request-promise','path','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x2930,0x130));var _0x0293=function(_0xf504e7,_0x49f44a){_0xf504e7=_0xf504e7-0x0;var _0x14b196=_0x2930[_0xf504e7];return _0x14b196;};'use strict';var _=require(_0x0293('0x0'));var util=require(_0x0293('0x1'));var logger=require(_0x0293('0x2'))(_0x0293('0x3'));var moment=require(_0x0293('0x4'));var BPromise=require(_0x0293('0x5'));var rp=require(_0x0293('0x6'));var fs=require('fs');var path=require(_0x0293('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x0293('0x8')]=function(_0x1f00ca,_0x32696b){return _0x1f00ca['define'](_0x0293('0x9'),attributes,{'tableName':_0x0293('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 6bfe986..1eae30c 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 _0x117c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','bluebird'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x117c,0x71));var _0xc117=function(_0xf39e84,_0x825c93){_0xf39e84=_0xf39e84-0x0;var _0x58e41f=_0x117c[_0xf39e84];return _0x58e41f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc117('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc117('0x1'))['db'];var utils=require(_0xc117('0x2'));var logger=require(_0xc117('0x3'))(_0xc117('0x4'));var config=require(_0xc117('0x5'));var jayson=require(_0xc117('0x6'));var client=jayson['client'][_0xc117('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x389734,_0x48efbb,_0x181a70){return new BPromise(function(_0x56c9bd,_0x451447){return client[_0xc117('0x8')](_0x389734,_0x181a70)[_0xc117('0x9')](function(_0x39e33f){logger[_0xc117('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x48efbb,_0xc117('0xb'));logger['debug'](_0xc117('0xc'),_0x48efbb,'request\x20sent',JSON[_0xc117('0xd')](_0x39e33f));if(_0x39e33f[_0xc117('0xe')]){if(_0x39e33f['error'][_0xc117('0xf')]===0x1f4){logger['error'](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x451447(_0x39e33f[_0xc117('0xe')]['message']);}logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x56c9bd(_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);}else{logger[_0xc117('0xa')](_0xc117('0x10'),_0x48efbb,_0xc117('0xb'));_0x56c9bd(_0x39e33f['result']['message']);}})[_0xc117('0x12')](function(_0x241ee7){logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x241ee7);_0x451447(_0x241ee7);});});} \ No newline at end of file +var _0xce2e=['request','then','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','DeskConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x24cfb3,_0x2da737){var _0x1e2159=function(_0x5135d2){while(--_0x5135d2){_0x24cfb3['push'](_0x24cfb3['shift']());}};_0x1e2159(++_0x2da737);}(_0xce2e,0x1d8));var _0xece2=function(_0x2f16ef,_0x221f5d){_0x2f16ef=_0x2f16ef-0x0;var _0x213487=_0xce2e[_0x2f16ef];return _0x213487;};'use strict';var _=require(_0xece2('0x0'));var util=require(_0xece2('0x1'));var moment=require(_0xece2('0x2'));var BPromise=require(_0xece2('0x3'));var rs=require(_0xece2('0x4'));var fs=require('fs');var Redis=require(_0xece2('0x5'));var db=require(_0xece2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xece2('0x7'))(_0xece2('0x8'));var config=require(_0xece2('0x9'));var jayson=require(_0xece2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x365255,_0x4631b3,_0x502c57){return new BPromise(function(_0x47a168,_0x20c3ef){return client[_0xece2('0xb')](_0x365255,_0x502c57)[_0xece2('0xc')](function(_0x494f5b){logger[_0xece2('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4631b3,'request\x20sent');logger[_0xece2('0xe')](_0xece2('0xf'),_0x4631b3,'request\x20sent',JSON[_0xece2('0x10')](_0x494f5b));if(_0x494f5b[_0xece2('0x11')]){if(_0x494f5b[_0xece2('0x11')]['code']===0x1f4){logger['error'](_0xece2('0x12'),_0x4631b3,_0x494f5b[_0xece2('0x11')][_0xece2('0x13')]);return _0x20c3ef(_0x494f5b[_0xece2('0x11')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4631b3,_0x494f5b[_0xece2('0x11')][_0xece2('0x13')]);return _0x47a168(_0x494f5b[_0xece2('0x11')][_0xece2('0x13')]);}else{logger[_0xece2('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4631b3,_0xece2('0x14'));_0x47a168(_0x494f5b[_0xece2('0x15')][_0xece2('0x13')]);}})[_0xece2('0x16')](function(_0x362090){logger[_0xece2('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4631b3,_0x362090);_0x20c3ef(_0x362090);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 31697e1..b0cae9f 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 _0xbced=['create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskField.controller','isAuthenticated','index','/:id','post'];(function(_0x5d7c7d,_0xb243cc){var _0x30ae4f=function(_0x1fc2bc){while(--_0x1fc2bc){_0x5d7c7d['push'](_0x5d7c7d['shift']());}};_0x30ae4f(++_0xb243cc);}(_0xbced,0x1d6));var _0xdbce=function(_0x4e64c7,_0x58e180){_0x4e64c7=_0x4e64c7-0x0;var _0x117dae=_0xbced[_0x4e64c7];return _0x117dae;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdbce('0x0'));var express=require(_0xdbce('0x1'));var router=express[_0xdbce('0x2')]();var fs_extra=require(_0xdbce('0x3'));var auth=require(_0xdbce('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdbce('0x5'));router['get']('/',auth[_0xdbce('0x6')](),controller[_0xdbce('0x7')]);router['get'](_0xdbce('0x8'),auth[_0xdbce('0x6')](),controller['show']);router[_0xdbce('0x9')]('/',auth[_0xdbce('0x6')](),controller[_0xdbce('0xa')]);router[_0xdbce('0xb')](_0xdbce('0x8'),auth[_0xdbce('0x6')](),controller[_0xdbce('0xc')]);router[_0xdbce('0xd')](_0xdbce('0x8'),auth[_0xdbce('0x6')](),controller[_0xdbce('0xe')]);module[_0xdbce('0xf')]=router; \ No newline at end of file +var _0x043c=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','get','/:id','post','create','put','update'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x043c,0xc8));var _0xc043=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0x043c[_0xee5d2a];return _0x346948;};'use strict';var multer=require(_0xc043('0x0'));var util=require(_0xc043('0x1'));var path=require('path');var timeout=require(_0xc043('0x2'));var express=require(_0xc043('0x3'));var router=express[_0xc043('0x4')]();var fs_extra=require(_0xc043('0x5'));var auth=require(_0xc043('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc043('0x7'));var controller=require(_0xc043('0x8'));router['get']('/',auth[_0xc043('0x9')](),controller['index']);router[_0xc043('0xa')](_0xc043('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc043('0xc')]('/',auth[_0xc043('0x9')](),controller[_0xc043('0xd')]);router[_0xc043('0xe')](_0xc043('0xb'),auth[_0xc043('0x9')](),controller[_0xc043('0xf')]);router[_0xc043('0x10')](_0xc043('0xb'),auth['isAuthenticated'](),controller[_0xc043('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index aa33aec..1155a55 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 _0x510f=['picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x3c0318,_0x267fde){var _0x146788=function(_0x5c4fd8){while(--_0x5c4fd8){_0x3c0318['push'](_0x3c0318['shift']());}};_0x146788(++_0x267fde);}(_0x510f,0xcc));var _0xf510=function(_0x57beaf,_0x165fb5){_0x57beaf=_0x57beaf-0x0;var _0x1f23c6=_0x510f[_0x57beaf];return _0x1f23c6;};'use strict';var Sequelize=require(_0xf510('0x0'));module[_0xf510('0x1')]={'type':{'type':Sequelize[_0xf510('0x2')]('string',_0xf510('0x3'),_0xf510('0x4'),_0xf510('0x5'),_0xf510('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf510('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xf510('0x8'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf510('0x7')]},'nameField':{'type':Sequelize[_0xf510('0x7')]},'customField':{'type':Sequelize[_0xf510('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf510('0x7')]}}; \ No newline at end of file +var _0x4916=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x25f204,_0x572f9a){var _0x298087=function(_0x2079ff){while(--_0x2079ff){_0x25f204['push'](_0x25f204['shift']());}};_0x298087(++_0x572f9a);}(_0x4916,0x13a));var _0x6491=function(_0x5ad8e2,_0x20c787){_0x5ad8e2=_0x5ad8e2-0x0;var _0x2151ac=_0x4916[_0x5ad8e2];return _0x2151ac;};'use strict';var Sequelize=require(_0x6491('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6491('0x1'),_0x6491('0x2'),_0x6491('0x3'),_0x6491('0x4'),_0x6491('0x5')),'defaultValue':_0x6491('0x1')},'content':{'type':Sequelize[_0x6491('0x6')]},'key':{'type':Sequelize[_0x6491('0x6')]},'keyType':{'type':Sequelize[_0x6491('0x7')](_0x6491('0x1'),_0x6491('0x2'),_0x6491('0x3'))},'keyContent':{'type':Sequelize[_0x6491('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6491('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6491('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3a21ed2..72188a1 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 _0x4279=['moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../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','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','DeskField','includeAll','include','findAll','rows','show','params','catch','body','find','rimraf','zip-dir','request-promise'];(function(_0x4723ff,_0x16ad59){var _0xd42df6=function(_0x53580a){while(--_0x53580a){_0x4723ff['push'](_0x4723ff['shift']());}};_0xd42df6(++_0x16ad59);}(_0x4279,0x8d));var _0x9427=function(_0x53ac49,_0x5d0037){_0x53ac49=_0x53ac49-0x0;var _0x5f0719=_0x4279[_0x53ac49];return _0x5f0719;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9427('0x0'));var zipdir=require(_0x9427('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9427('0x2'));var moment=require(_0x9427('0x3'));var BPromise=require(_0x9427('0x4'));var Mustache=require(_0x9427('0x5'));var util=require('util');var path=require(_0x9427('0x6'));var sox=require('sox');var csv=require(_0x9427('0x7'));var ejs=require(_0x9427('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9427('0x9'));var squel=require(_0x9427('0xa'));var crypto=require(_0x9427('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9427('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9427('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9427('0xe'));var qs=require(_0x9427('0xf'));var as=require(_0x9427('0x10'));var hardwareService=require(_0x9427('0x11'));var logger=require(_0x9427('0x12'))(_0x9427('0x13'));var utils=require(_0x9427('0x14'));var config=require(_0x9427('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9427('0x16'))['db'];function respondWithStatusCode(_0x1ceb46,_0x44bd4e){_0x44bd4e=_0x44bd4e||0xcc;return function(_0x17eb26){if(_0x17eb26){return _0x1ceb46[_0x9427('0x17')](_0x44bd4e);}return _0x1ceb46[_0x9427('0x18')](_0x44bd4e)[_0x9427('0x19')]();};}function respondWithResult(_0x1f6b92,_0x250144){_0x250144=_0x250144||0xc8;return function(_0x3a2956){if(_0x3a2956){return _0x1f6b92[_0x9427('0x18')](_0x250144)[_0x9427('0x1a')](_0x3a2956);}};}function respondWithFilteredResult(_0x418e37,_0x5cbf67){return function(_0x3a6f84){if(_0x3a6f84){var _0x1a41eb=typeof _0x5cbf67[_0x9427('0x1b')]==='undefined'&&typeof _0x5cbf67['limit']===_0x9427('0x1c');var _0x567da4=_0x3a6f84[_0x9427('0x1d')];var _0x20de12=_0x1a41eb?0x0:_0x5cbf67['offset'];var _0x5177e2=_0x1a41eb?_0x3a6f84[_0x9427('0x1d')]:_0x5cbf67[_0x9427('0x1b')]+_0x5cbf67[_0x9427('0x1e')];var _0x11fcd4;if(_0x5177e2>=_0x567da4){_0x5177e2=_0x567da4;_0x11fcd4=0xc8;}else{_0x11fcd4=0xce;}_0x418e37[_0x9427('0x18')](_0x11fcd4);return _0x418e37[_0x9427('0x1f')](_0x9427('0x20'),_0x20de12+'-'+_0x5177e2+'/'+_0x567da4)[_0x9427('0x1a')](_0x3a6f84);}return null;};}function patchUpdates(_0xa9da31){return function(_0x97800f){try{jsonpatch[_0x9427('0x21')](_0x97800f,_0xa9da31,!![]);}catch(_0x374291){return BPromise[_0x9427('0x22')](_0x374291);}return _0x97800f[_0x9427('0x23')]();};}function saveUpdates(_0xac18ea,_0x3e8743){return function(_0x4c6c09){if(_0x4c6c09){return _0x4c6c09['update'](_0xac18ea)[_0x9427('0x24')](function(_0x3cde1e){return _0x3cde1e;});}return null;};}function removeEntity(_0x1db2cf,_0x40d8cb){return function(_0x437dda){if(_0x437dda){return _0x437dda[_0x9427('0x25')]()[_0x9427('0x24')](function(){_0x1db2cf[_0x9427('0x18')](0xcc)[_0x9427('0x19')]();});}};}function handleEntityNotFound(_0x1ecd67,_0xb43f57){return function(_0x32a68a){if(!_0x32a68a){_0x1ecd67['sendStatus'](0x194);}return _0x32a68a;};}function handleError(_0x2a9a0c,_0x5d1829){_0x5d1829=_0x5d1829||0x1f4;return function(_0x2ed9b5){logger[_0x9427('0x26')](_0x2ed9b5['stack']);if(_0x2ed9b5[_0x9427('0x27')]){delete _0x2ed9b5[_0x9427('0x27')];}_0x2a9a0c[_0x9427('0x18')](_0x5d1829)[_0x9427('0x28')](_0x2ed9b5);};}exports[_0x9427('0x29')]=function(_0x58c7a2,_0x8e8955){var _0x2a0263={},_0x5947d0={},_0x51a356={'count':0x0,'rows':[]};var _0x2362f0=_[_0x9427('0x2a')](db['DeskField'][_0x9427('0x2b')],function(_0x127572){return{'name':_0x127572[_0x9427('0x2c')],'type':_0x127572[_0x9427('0x2d')][_0x9427('0x2e')]};});_0x5947d0['model']=_['map'](_0x2362f0,_0x9427('0x27'));_0x5947d0[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x58c7a2['query']);_0x5947d0[_0x9427('0x31')]=_[_0x9427('0x32')](_0x5947d0[_0x9427('0x33')],_0x5947d0['query']);_0x2a0263['attributes']=_[_0x9427('0x32')](_0x5947d0['model'],qs[_0x9427('0x34')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x34')]));_0x2a0263['attributes']=_0x2a0263[_0x9427('0x35')][_0x9427('0x36')]?_0x2a0263[_0x9427('0x35')]:_0x5947d0[_0x9427('0x33')];if(!_0x58c7a2[_0x9427('0x2f')][_0x9427('0x37')]('nolimit')){_0x2a0263['limit']=qs[_0x9427('0x1e')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x1e')]);_0x2a0263[_0x9427('0x1b')]=qs[_0x9427('0x1b')](_0x58c7a2['query'][_0x9427('0x1b')]);}_0x2a0263[_0x9427('0x38')]=qs[_0x9427('0x39')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x39')]);_0x2a0263[_0x9427('0x3a')]=qs[_0x9427('0x31')](_['pick'](_0x58c7a2[_0x9427('0x2f')],_0x5947d0['filters']),_0x2362f0);if(_0x58c7a2['query'][_0x9427('0x3b')]){_0x2a0263[_0x9427('0x3a')]=_[_0x9427('0x3c')](_0x2a0263[_0x9427('0x3a')],{'$or':_[_0x9427('0x2a')](_0x2362f0,function(_0x34915f){if(_0x34915f['type']!=='VIRTUAL'){var _0x689284={};_0x689284[_0x34915f['name']]={'$like':'%'+_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3b')]+'%'};return _0x689284;}})});}_0x2a0263=_['merge']({},_0x2a0263,_0x58c7a2[_0x9427('0x3d')]);var _0xff3674={'where':_0x2a0263['where']};return db[_0x9427('0x3e')][_0x9427('0x1d')](_0xff3674)['then'](function(_0x18b5c4){_0x51a356['count']=_0x18b5c4;if(_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3f')]){_0x2a0263[_0x9427('0x40')]=[{'all':!![]}];}return db[_0x9427('0x3e')][_0x9427('0x41')](_0x2a0263);})[_0x9427('0x24')](function(_0x14e137){_0x51a356[_0x9427('0x42')]=_0x14e137;return _0x51a356;})[_0x9427('0x24')](respondWithFilteredResult(_0x8e8955,_0x2a0263))['catch'](handleError(_0x8e8955,null));};exports[_0x9427('0x43')]=function(_0x234092,_0x4a5c19){var _0x4988f8={'raw':!![],'where':{'id':_0x234092[_0x9427('0x44')]['id']}},_0x17eb62={};_0x17eb62[_0x9427('0x33')]=_[_0x9427('0x30')](db[_0x9427('0x3e')]['rawAttributes']);_0x17eb62[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x234092[_0x9427('0x2f')]);_0x17eb62[_0x9427('0x31')]=_['intersection'](_0x17eb62['model'],_0x17eb62[_0x9427('0x2f')]);_0x4988f8[_0x9427('0x35')]=_[_0x9427('0x32')](_0x17eb62[_0x9427('0x33')],qs[_0x9427('0x34')](_0x234092['query'][_0x9427('0x34')]));_0x4988f8[_0x9427('0x35')]=_0x4988f8['attributes'][_0x9427('0x36')]?_0x4988f8['attributes']:_0x17eb62['model'];if(_0x234092['query']['includeAll']){_0x4988f8['include']=[{'all':!![]}];}_0x4988f8=_['merge']({},_0x4988f8,_0x234092[_0x9427('0x3d')]);return db['DeskField']['find'](_0x4988f8)['then'](handleEntityNotFound(_0x4a5c19,null))[_0x9427('0x24')](respondWithResult(_0x4a5c19,null))[_0x9427('0x45')](handleError(_0x4a5c19,null));};exports['create']=function(_0x590673,_0x1d3818){return db[_0x9427('0x3e')]['create'](_0x590673['body'],{})[_0x9427('0x24')](respondWithResult(_0x1d3818,0xc9))[_0x9427('0x45')](handleError(_0x1d3818,null));};exports['update']=function(_0x44a0a2,_0x442755){if(_0x44a0a2[_0x9427('0x46')]['id']){delete _0x44a0a2['body']['id'];}return db[_0x9427('0x3e')]['find']({'where':{'id':_0x44a0a2[_0x9427('0x44')]['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x442755,null))[_0x9427('0x24')](saveUpdates(_0x44a0a2[_0x9427('0x46')],null))['then'](respondWithResult(_0x442755,null))[_0x9427('0x45')](handleError(_0x442755,null));};exports[_0x9427('0x25')]=function(_0xe2cac7,_0x664bdc){return db[_0x9427('0x3e')][_0x9427('0x47')]({'where':{'id':_0xe2cac7['params']['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x664bdc,null))[_0x9427('0x24')](removeEntity(_0x664bdc,null))[_0x9427('0x45')](handleError(_0x664bdc,null));}; \ No newline at end of file +var _0x79e5=['create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','params','length','options','find'];(function(_0x23276e,_0x5c3144){var _0x40c600=function(_0x6f0b68){while(--_0x6f0b68){_0x23276e['push'](_0x23276e['shift']());}};_0x40c600(++_0x5c3144);}(_0x79e5,0x170));var _0x579e=function(_0x24f9ff,_0x349692){_0x24f9ff=_0x24f9ff-0x0;var _0x25c4ba=_0x79e5[_0x24f9ff];return _0x25c4ba;};'use strict';var emlformat=require(_0x579e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x579e('0x1'));var jsonpatch=require(_0x579e('0x2'));var rp=require(_0x579e('0x3'));var moment=require(_0x579e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x579e('0x5'));var util=require(_0x579e('0x6'));var path=require(_0x579e('0x7'));var sox=require(_0x579e('0x8'));var csv=require(_0x579e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x579e('0xa'));var _=require('lodash');var squel=require(_0x579e('0xb'));var crypto=require(_0x579e('0xc'));var jsforce=require(_0x579e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x579e('0x9'));var querystring=require(_0x579e('0xe'));var Papa=require('papaparse');var Redis=require(_0x579e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x579e('0x10'));var hardwareService=require(_0x579e('0x11'));var logger=require(_0x579e('0x12'))(_0x579e('0x13'));var utils=require(_0x579e('0x14'));var config=require(_0x579e('0x15'));var licenseUtil=require(_0x579e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35296c,_0x29960b){_0x29960b=_0x29960b||0xcc;return function(_0x201202){if(_0x201202){return _0x35296c[_0x579e('0x17')](_0x29960b);}return _0x35296c[_0x579e('0x18')](_0x29960b)[_0x579e('0x19')]();};}function respondWithResult(_0x3a9451,_0x563966){_0x563966=_0x563966||0xc8;return function(_0x2e4345){if(_0x2e4345){return _0x3a9451[_0x579e('0x18')](_0x563966)[_0x579e('0x1a')](_0x2e4345);}};}function respondWithFilteredResult(_0x53a069,_0x21e6c7){return function(_0x5d25e1){if(_0x5d25e1){var _0x3ff035=typeof _0x21e6c7['offset']==='undefined'&&typeof _0x21e6c7['limit']===_0x579e('0x1b');var _0x55f8c6=_0x5d25e1[_0x579e('0x1c')];var _0x192a9b=_0x3ff035?0x0:_0x21e6c7[_0x579e('0x1d')];var _0x1cd1dc=_0x3ff035?_0x5d25e1[_0x579e('0x1c')]:_0x21e6c7[_0x579e('0x1d')]+_0x21e6c7[_0x579e('0x1e')];var _0x55493e;if(_0x1cd1dc>=_0x55f8c6){_0x1cd1dc=_0x55f8c6;_0x55493e=0xc8;}else{_0x55493e=0xce;}_0x53a069['status'](_0x55493e);return _0x53a069['set'](_0x579e('0x1f'),_0x192a9b+'-'+_0x1cd1dc+'/'+_0x55f8c6)['json'](_0x5d25e1);}return null;};}function patchUpdates(_0x21891f){return function(_0x3b1f69){try{jsonpatch['apply'](_0x3b1f69,_0x21891f,!![]);}catch(_0x5994e6){return BPromise[_0x579e('0x20')](_0x5994e6);}return _0x3b1f69[_0x579e('0x21')]();};}function saveUpdates(_0x1e2aad,_0x5c46f3){return function(_0x57d8ea){if(_0x57d8ea){return _0x57d8ea['update'](_0x1e2aad)[_0x579e('0x22')](function(_0x13327c){return _0x13327c;});}return null;};}function removeEntity(_0x188995,_0x397009){return function(_0xbaa32d){if(_0xbaa32d){return _0xbaa32d[_0x579e('0x23')]()[_0x579e('0x22')](function(){_0x188995[_0x579e('0x18')](0xcc)[_0x579e('0x19')]();});}};}function handleEntityNotFound(_0xdf2470,_0x17a1dd){return function(_0x33ae20){if(!_0x33ae20){_0xdf2470[_0x579e('0x17')](0x194);}return _0x33ae20;};}function handleError(_0x1d289a,_0xf019a8){_0xf019a8=_0xf019a8||0x1f4;return function(_0x159cef){logger[_0x579e('0x24')](_0x159cef[_0x579e('0x25')]);if(_0x159cef[_0x579e('0x26')]){delete _0x159cef[_0x579e('0x26')];}_0x1d289a[_0x579e('0x18')](_0xf019a8)[_0x579e('0x27')](_0x159cef);};}exports[_0x579e('0x28')]=function(_0x18c040,_0x59aa51){var _0x45bee0={},_0x401517={},_0x167679={'count':0x0,'rows':[]};var _0x38675b=_[_0x579e('0x29')](db[_0x579e('0x2a')][_0x579e('0x2b')],function(_0x55808c){return{'name':_0x55808c['fieldName'],'type':_0x55808c[_0x579e('0x2c')][_0x579e('0x2d')]};});_0x401517[_0x579e('0x2e')]=_[_0x579e('0x29')](_0x38675b,_0x579e('0x26'));_0x401517[_0x579e('0x2f')]=_[_0x579e('0x30')](_0x18c040['query']);_0x401517['filters']=_[_0x579e('0x31')](_0x401517[_0x579e('0x2e')],_0x401517['query']);_0x45bee0[_0x579e('0x32')]=_[_0x579e('0x31')](_0x401517[_0x579e('0x2e')],qs[_0x579e('0x33')](_0x18c040[_0x579e('0x2f')]['fields']));_0x45bee0[_0x579e('0x32')]=_0x45bee0[_0x579e('0x32')]['length']?_0x45bee0[_0x579e('0x32')]:_0x401517[_0x579e('0x2e')];if(!_0x18c040['query'][_0x579e('0x34')](_0x579e('0x35'))){_0x45bee0[_0x579e('0x1e')]=qs[_0x579e('0x1e')](_0x18c040[_0x579e('0x2f')][_0x579e('0x1e')]);_0x45bee0[_0x579e('0x1d')]=qs['offset'](_0x18c040[_0x579e('0x2f')][_0x579e('0x1d')]);}_0x45bee0[_0x579e('0x36')]=qs[_0x579e('0x37')](_0x18c040['query'][_0x579e('0x37')]);_0x45bee0[_0x579e('0x38')]=qs['filters'](_['pick'](_0x18c040[_0x579e('0x2f')],_0x401517[_0x579e('0x39')]),_0x38675b);if(_0x18c040[_0x579e('0x2f')]['filter']){_0x45bee0[_0x579e('0x38')]=_['merge'](_0x45bee0['where'],{'$or':_[_0x579e('0x29')](_0x38675b,function(_0x29b2d7){if(_0x29b2d7[_0x579e('0x2c')]!==_0x579e('0x3a')){var _0x5ab401={};_0x5ab401[_0x29b2d7['name']]={'$like':'%'+_0x18c040['query'][_0x579e('0x3b')]+'%'};return _0x5ab401;}})});}_0x45bee0=_[_0x579e('0x3c')]({},_0x45bee0,_0x18c040['options']);var _0x5bb13d={'where':_0x45bee0['where']};return db['DeskField'][_0x579e('0x1c')](_0x5bb13d)['then'](function(_0x40d4d1){_0x167679['count']=_0x40d4d1;if(_0x18c040[_0x579e('0x2f')][_0x579e('0x3d')]){_0x45bee0[_0x579e('0x3e')]=[{'all':!![]}];}return db[_0x579e('0x2a')][_0x579e('0x3f')](_0x45bee0);})[_0x579e('0x22')](function(_0x24bcd4){_0x167679[_0x579e('0x40')]=_0x24bcd4;return _0x167679;})[_0x579e('0x22')](respondWithFilteredResult(_0x59aa51,_0x45bee0))[_0x579e('0x41')](handleError(_0x59aa51,null));};exports['show']=function(_0x2217e5,_0x96bc28){var _0x1eee2b={'raw':!![],'where':{'id':_0x2217e5[_0x579e('0x42')]['id']}},_0x49f88b={};_0x49f88b[_0x579e('0x2e')]=_[_0x579e('0x30')](db[_0x579e('0x2a')][_0x579e('0x2b')]);_0x49f88b[_0x579e('0x2f')]=_['keys'](_0x2217e5[_0x579e('0x2f')]);_0x49f88b['filters']=_[_0x579e('0x31')](_0x49f88b[_0x579e('0x2e')],_0x49f88b[_0x579e('0x2f')]);_0x1eee2b[_0x579e('0x32')]=_[_0x579e('0x31')](_0x49f88b[_0x579e('0x2e')],qs[_0x579e('0x33')](_0x2217e5['query']['fields']));_0x1eee2b['attributes']=_0x1eee2b[_0x579e('0x32')][_0x579e('0x43')]?_0x1eee2b[_0x579e('0x32')]:_0x49f88b[_0x579e('0x2e')];if(_0x2217e5[_0x579e('0x2f')][_0x579e('0x3d')]){_0x1eee2b[_0x579e('0x3e')]=[{'all':!![]}];}_0x1eee2b=_[_0x579e('0x3c')]({},_0x1eee2b,_0x2217e5[_0x579e('0x44')]);return db[_0x579e('0x2a')][_0x579e('0x45')](_0x1eee2b)[_0x579e('0x22')](handleEntityNotFound(_0x96bc28,null))['then'](respondWithResult(_0x96bc28,null))[_0x579e('0x41')](handleError(_0x96bc28,null));};exports['create']=function(_0x2da8c7,_0x43cf06){return db[_0x579e('0x2a')][_0x579e('0x46')](_0x2da8c7[_0x579e('0x47')],{})[_0x579e('0x22')](respondWithResult(_0x43cf06,0xc9))[_0x579e('0x41')](handleError(_0x43cf06,null));};exports[_0x579e('0x48')]=function(_0xdc1325,_0xe95780){if(_0xdc1325[_0x579e('0x47')]['id']){delete _0xdc1325[_0x579e('0x47')]['id'];}return db[_0x579e('0x2a')]['find']({'where':{'id':_0xdc1325[_0x579e('0x42')]['id']}})[_0x579e('0x22')](handleEntityNotFound(_0xe95780,null))[_0x579e('0x22')](saveUpdates(_0xdc1325[_0x579e('0x47')],null))['then'](respondWithResult(_0xe95780,null))['catch'](handleError(_0xe95780,null));};exports[_0x579e('0x23')]=function(_0x262489,_0x4eda0a){return db[_0x579e('0x2a')][_0x579e('0x45')]({'where':{'id':_0x262489[_0x579e('0x42')]['id']}})[_0x579e('0x22')](handleEntityNotFound(_0x4eda0a,null))[_0x579e('0x22')](removeEntity(_0x4eda0a,null))['catch'](handleError(_0x4eda0a,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d460a07..30a03cc 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 _0xe43a=['idField','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x4b3ad1,_0x499cec){var _0x318947=function(_0x2b3c9d){while(--_0x2b3c9d){_0x4b3ad1['push'](_0x4b3ad1['shift']());}};_0x318947(++_0x499cec);}(_0xe43a,0x1d5));var _0xae43=function(_0x14db33,_0x25d919){_0x14db33=_0x14db33-0x0;var _0x41bff6=_0xe43a[_0x14db33];return _0x41bff6;};'use strict';var _=require(_0xae43('0x0'));var util=require('util');var logger=require(_0xae43('0x1'))(_0xae43('0x2'));var moment=require(_0xae43('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae43('0x4'));var rimraf=require(_0xae43('0x5'));var config=require(_0xae43('0x6'));var attributes=require('./intDeskField.attributes');module[_0xae43('0x7')]=function(_0x381630,_0x176567){return _0x381630[_0xae43('0x8')](_0xae43('0x9'),attributes,{'tableName':_0xae43('0xa'),'paranoid':![],'indexes':[{'name':_0xae43('0xb'),'fields':[_0xae43('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x61ed=['./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x61ed,0x172));var _0xd61e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61ed[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xd61e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd61e('0x1'));var moment=require(_0xd61e('0x2'));var BPromise=require(_0xd61e('0x3'));var rp=require(_0xd61e('0x4'));var fs=require('fs');var path=require(_0xd61e('0x5'));var rimraf=require(_0xd61e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd61e('0x7'));module[_0xd61e('0x8')]=function(_0x4043a4,_0x25bbee){return _0x4043a4['define'](_0xd61e('0x9'),attributes,{'tableName':_0xd61e('0xa'),'paranoid':![],'indexes':[{'name':_0xd61e('0xb'),'fields':[_0xd61e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 620ca54..31e0c34 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 _0xff9a=['debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xff9a,0x101));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaff9('0x0'));var util=require(_0xaff9('0x1'));var moment=require(_0xaff9('0x2'));var BPromise=require('bluebird');var rs=require(_0xaff9('0x3'));var fs=require('fs');var Redis=require(_0xaff9('0x4'));var db=require(_0xaff9('0x5'))['db'];var utils=require(_0xaff9('0x6'));var logger=require(_0xaff9('0x7'))(_0xaff9('0x8'));var config=require(_0xaff9('0x9'));var jayson=require(_0xaff9('0xa'));var client=jayson[_0xaff9('0xb')][_0xaff9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3841e6,_0x32f260,_0x455f3c){return new BPromise(function(_0x396e5b,_0xe154af){return client[_0xaff9('0xd')](_0x3841e6,_0x455f3c)[_0xaff9('0xe')](function(_0x4ec146){logger[_0xaff9('0xf')](_0xaff9('0x10'),_0x32f260,_0xaff9('0x11'));logger[_0xaff9('0x12')](_0xaff9('0x13'),_0x32f260,'request\x20sent',JSON[_0xaff9('0x14')](_0x4ec146));if(_0x4ec146[_0xaff9('0x15')]){if(_0x4ec146[_0xaff9('0x15')]['code']===0x1f4){logger[_0xaff9('0x15')](_0xaff9('0x10'),_0x32f260,_0x4ec146['error'][_0xaff9('0x16')]);return _0xe154af(_0x4ec146[_0xaff9('0x15')][_0xaff9('0x16')]);}logger[_0xaff9('0x15')](_0xaff9('0x10'),_0x32f260,_0x4ec146[_0xaff9('0x15')][_0xaff9('0x16')]);return _0x396e5b(_0x4ec146['error']['message']);}else{logger[_0xaff9('0xf')](_0xaff9('0x10'),_0x32f260,_0xaff9('0x11'));_0x396e5b(_0x4ec146[_0xaff9('0x17')][_0xaff9('0x16')]);}})[_0xaff9('0x18')](function(_0x440097){logger[_0xaff9('0x15')]('DeskField,\x20%s,\x20%s',_0x32f260,_0x440097);_0xe154af(_0x440097);});});} \ No newline at end of file +var _0x92f5=['client','http','request','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','message','info','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x326068,_0x560344){var _0x297953=function(_0x35b1f2){while(--_0x35b1f2){_0x326068['push'](_0x326068['shift']());}};_0x297953(++_0x560344);}(_0x92f5,0xc9));var _0x592f=function(_0x3b119f,_0x4f10d3){_0x3b119f=_0x3b119f-0x0;var _0x1aff29=_0x92f5[_0x3b119f];return _0x1aff29;};'use strict';var _=require(_0x592f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x592f('0x1'));var rs=require(_0x592f('0x2'));var fs=require('fs');var Redis=require(_0x592f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x592f('0x4'))(_0x592f('0x5'));var config=require(_0x592f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x592f('0x7')][_0x592f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5006b4,_0x5c0dba,_0x196b3e){return new BPromise(function(_0x54c6dc,_0x3b716d){return client[_0x592f('0x9')](_0x5006b4,_0x196b3e)['then'](function(_0x5ca042){logger['info'](_0x592f('0xa'),_0x5c0dba,_0x592f('0xb'));logger['debug'](_0x592f('0xc'),_0x5c0dba,'request\x20sent',JSON['stringify'](_0x5ca042));if(_0x5ca042[_0x592f('0xd')]){if(_0x5ca042['error']['code']===0x1f4){logger[_0x592f('0xd')](_0x592f('0xa'),_0x5c0dba,_0x5ca042[_0x592f('0xd')][_0x592f('0xe')]);return _0x3b716d(_0x5ca042[_0x592f('0xd')][_0x592f('0xe')]);}logger[_0x592f('0xd')](_0x592f('0xa'),_0x5c0dba,_0x5ca042[_0x592f('0xd')][_0x592f('0xe')]);return _0x54c6dc(_0x5ca042[_0x592f('0xd')][_0x592f('0xe')]);}else{logger[_0x592f('0xf')]('DeskField,\x20%s,\x20%s',_0x5c0dba,_0x592f('0xb'));_0x54c6dc(_0x5ca042['result'][_0x592f('0xe')]);}})['catch'](function(_0x1063d3){logger['error'](_0x592f('0xa'),_0x5c0dba,_0x1063d3);_0x3b716d(_0x1063d3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 87c0dc6..e7c3e97 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 _0xa4dd=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','isAuthenticated','index','/:id','get','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','delete','exports','multer'];(function(_0x43bc7e,_0x120993){var _0x27ed73=function(_0x461295){while(--_0x461295){_0x43bc7e['push'](_0x43bc7e['shift']());}};_0x27ed73(++_0x120993);}(_0xa4dd,0x1b7));var _0xda4d=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0xa4dd[_0x190ff6];return _0x5356d2;};'use strict';var multer=require(_0xda4d('0x0'));var util=require(_0xda4d('0x1'));var path=require(_0xda4d('0x2'));var timeout=require(_0xda4d('0x3'));var express=require(_0xda4d('0x4'));var router=express['Router']();var fs_extra=require(_0xda4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xda4d('0x6'));var config=require('../../config/environment');var controller=require(_0xda4d('0x7'));router['get']('/',auth[_0xda4d('0x8')](),controller[_0xda4d('0x9')]);router['get'](_0xda4d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xda4d('0xb')](_0xda4d('0xc'),auth[_0xda4d('0x8')](),controller[_0xda4d('0xd')]);router[_0xda4d('0xb')](_0xda4d('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xda4d('0xf')]('/',auth[_0xda4d('0x8')](),controller[_0xda4d('0x10')]);router[_0xda4d('0xf')]('/:id/configurations',auth[_0xda4d('0x8')](),controller[_0xda4d('0x11')]);router['put'](_0xda4d('0xa'),auth[_0xda4d('0x8')](),controller['update']);router[_0xda4d('0x12')](_0xda4d('0xa'),auth[_0xda4d('0x8')](),controller['destroy']);module[_0xda4d('0x13')]=router; \ No newline at end of file +var _0xf539=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','post','create','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0xd33826,_0x5e56dc){var _0x1f869c=function(_0x4cffce){while(--_0x4cffce){_0xd33826['push'](_0xd33826['shift']());}};_0x1f869c(++_0x5e56dc);}(_0xf539,0x6e));var _0x9f53=function(_0x6955eb,_0x5c62b8){_0x6955eb=_0x6955eb-0x0;var _0x30df1e=_0xf539[_0x6955eb];return _0x30df1e;};'use strict';var multer=require(_0x9f53('0x0'));var util=require('util');var path=require(_0x9f53('0x1'));var timeout=require(_0x9f53('0x2'));var express=require('express');var router=express[_0x9f53('0x3')]();var fs_extra=require(_0x9f53('0x4'));var auth=require(_0x9f53('0x5'));var interaction=require(_0x9f53('0x6'));var config=require(_0x9f53('0x7'));var controller=require(_0x9f53('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f53('0x9')]);router[_0x9f53('0xa')](_0x9f53('0xb'),auth['isAuthenticated'](),controller[_0x9f53('0xc')]);router[_0x9f53('0xa')](_0x9f53('0xd'),auth[_0x9f53('0xe')](),controller['getConfigurations']);router[_0x9f53('0xa')](_0x9f53('0xf'),auth[_0x9f53('0xe')](),controller[_0x9f53('0x10')]);router[_0x9f53('0x11')]('/',auth[_0x9f53('0xe')](),controller[_0x9f53('0x12')]);router[_0x9f53('0x11')](_0x9f53('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9f53('0x13')](_0x9f53('0xb'),auth[_0x9f53('0xe')](),controller[_0x9f53('0x14')]);router[_0x9f53('0x15')]('/:id',auth[_0x9f53('0xe')](),controller['destroy']);module[_0x9f53('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 96ecbcb..8be4608 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 _0x24ce=['BOOLEAN','exports','STRING'];(function(_0x22bdc2,_0x2c9a4f){var _0x59e877=function(_0x1fb4bf){while(--_0x1fb4bf){_0x22bdc2['push'](_0x22bdc2['shift']());}};_0x59e877(++_0x2c9a4f);}(_0x24ce,0x1de));var _0xe24c=function(_0x4ec052,_0x21df8b){_0x4ec052=_0x4ec052-0x0;var _0x51b8e=_0x24ce[_0x4ec052];return _0x51b8e;};'use strict';var Sequelize=require('sequelize');module[_0xe24c('0x0')]={'name':{'type':Sequelize[_0xe24c('0x1')]},'username':{'type':Sequelize[_0xe24c('0x1')]},'password':{'type':Sequelize[_0xe24c('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe24c('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe24c('0x1')]},'modernAuthentication':{'type':Sequelize[_0xe24c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcd59=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4788ca,_0x5cda70){_0x4788ca=_0x4788ca-0x0;var _0x28a6f5=_0xcd59[_0x4788ca];return _0x28a6f5;};'use strict';var Sequelize=require(_0x9cd5('0x0'));module[_0x9cd5('0x1')]={'name':{'type':Sequelize[_0x9cd5('0x2')]},'username':{'type':Sequelize[_0x9cd5('0x2')]},'password':{'type':Sequelize[_0x9cd5('0x2')]},'remoteUri':{'type':Sequelize[_0x9cd5('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9cd5('0x2')]},'clientSecret':{'type':Sequelize[_0x9cd5('0x2')]},'serverUrl':{'type':Sequelize[_0x9cd5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9cd5('0x2')]},'modernAuthentication':{'type':Sequelize[_0x9cd5('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 0c73f77..1899bb4 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 _0xe3f5=['createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','remoteUri','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','Label','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','count','includeAll','rows','show','params','include','merge','find','catch','create','body','update','getConfigurations','findOne','Dynamics365Configuration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','getFields','ticketType','PhoneCall','description','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xe3f5,0x118));var _0x5e3f=function(_0x342686,_0x5614ea){_0x342686=_0x342686-0x0;var _0x144f4c=_0xe3f5[_0x342686];return _0x144f4c;};'use strict';var rp=require(_0x5e3f('0x0'));var util=require('util');var _=require(_0x5e3f('0x1'));var qs=require(_0x5e3f('0x2'));var logger=require(_0x5e3f('0x3'))(_0x5e3f('0x4'));var db=require(_0x5e3f('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x7410c6,_0x5e4fd5){_0x5e4fd5=_0x5e4fd5||0xc8;return function(_0x2243e2){if(_0x2243e2){return _0x7410c6[_0x5e3f('0x6')](_0x5e4fd5)['json'](_0x2243e2);}};}function respondWithFilteredResult(_0x45913c,_0x55d06f){return function(_0x259d81){if(_0x259d81){var _0x16b6bb=typeof _0x55d06f[_0x5e3f('0x7')]===_0x5e3f('0x8')&&typeof _0x55d06f['limit']===_0x5e3f('0x8');var _0x1b4bfe=_0x259d81['count'];var _0x3143c3=_0x16b6bb?0x0:_0x55d06f['offset'];var _0x67945a=_0x16b6bb?_0x259d81['count']:_0x55d06f['offset']+_0x55d06f[_0x5e3f('0x9')];var _0x323e0f;if(_0x67945a>=_0x1b4bfe){_0x67945a=_0x1b4bfe;_0x323e0f=0xc8;}else{_0x323e0f=0xce;}_0x45913c[_0x5e3f('0x6')](_0x323e0f);return _0x45913c[_0x5e3f('0xa')](_0x5e3f('0xb'),_0x3143c3+'-'+_0x67945a+'/'+_0x1b4bfe)[_0x5e3f('0xc')](_0x259d81);}return null;};}function saveUpdates(_0x3774c8){return function(_0x34bf26){if(_0x34bf26){return _0x34bf26['update'](_0x3774c8)[_0x5e3f('0xd')](function(_0x153aee){return _0x153aee;});}return null;};}function removeEntity(_0x3bce1f){return function(_0x3c7427){if(_0x3c7427){return _0x3c7427[_0x5e3f('0xe')]()[_0x5e3f('0xd')](function(){_0x3bce1f[_0x5e3f('0x6')](0xcc)[_0x5e3f('0xf')]();});}};}function handleEntityNotFound(_0x506780){return function(_0x3e15e2){if(!_0x3e15e2){_0x506780[_0x5e3f('0x10')](0x194);}return _0x3e15e2;};}function handleError(_0x174af6,_0x47f657){_0x47f657=_0x47f657||0x1f4;return function(_0x14f830){logger[_0x5e3f('0x11')](_0x14f830[_0x5e3f('0x12')]);if(_0x14f830[_0x5e3f('0x13')]){delete _0x14f830['name'];}_0x174af6[_0x5e3f('0x6')](_0x47f657)[_0x5e3f('0x14')](_0x14f830);};}exports[_0x5e3f('0x15')]=function(_0x4a4421,_0x335b36){var _0x5a5466={},_0x5b4169={},_0x25a8cc={'count':0x0,'rows':[]};var _0x2b6d7c=_[_0x5e3f('0x16')](db[_0x5e3f('0x17')][_0x5e3f('0x18')],function(_0x1f870e){return{'name':_0x1f870e[_0x5e3f('0x19')],'type':_0x1f870e[_0x5e3f('0x1a')]['key']};});_0x5b4169[_0x5e3f('0x1b')]=_[_0x5e3f('0x16')](_0x2b6d7c,_0x5e3f('0x13'));_0x5b4169['query']=_[_0x5e3f('0x1c')](_0x4a4421['query']);_0x5b4169[_0x5e3f('0x1d')]=_[_0x5e3f('0x1e')](_0x5b4169[_0x5e3f('0x1b')],_0x5b4169[_0x5e3f('0x1f')]);_0x5a5466[_0x5e3f('0x20')]=_[_0x5e3f('0x1e')](_0x5b4169[_0x5e3f('0x1b')],qs[_0x5e3f('0x21')](_0x4a4421['query'][_0x5e3f('0x21')]));_0x5a5466['attributes']=_0x5a5466[_0x5e3f('0x20')][_0x5e3f('0x22')]?_0x5a5466[_0x5e3f('0x20')]:_0x5b4169[_0x5e3f('0x1b')];if(!_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x23')](_0x5e3f('0x24'))){_0x5a5466['limit']=qs[_0x5e3f('0x9')](_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x9')]);_0x5a5466[_0x5e3f('0x7')]=qs['offset'](_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x7')]);}_0x5a5466[_0x5e3f('0x25')]=qs[_0x5e3f('0x26')](_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x26')]);_0x5a5466[_0x5e3f('0x27')]=qs[_0x5e3f('0x1d')](_[_0x5e3f('0x28')](_0x4a4421[_0x5e3f('0x1f')],_0x5b4169[_0x5e3f('0x1d')]),_0x2b6d7c);if(_0x4a4421[_0x5e3f('0x1f')]['filter']){_0x5a5466['where']=_['merge'](_0x5a5466[_0x5e3f('0x27')],{'$or':_['map'](_0x2b6d7c,function(_0x485837){if(_0x485837[_0x5e3f('0x1a')]!==_0x5e3f('0x29')){var _0x1ad016={};_0x1ad016[_0x485837[_0x5e3f('0x13')]]={'$like':'%'+_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x2a')]+'%'};return _0x1ad016;}})});}_0x5a5466=_['merge']({},_0x5a5466,_0x4a4421[_0x5e3f('0x2b')]);var _0x1be86c={'where':_0x5a5466['where']};return db['Dynamics365Account']['count'](_0x1be86c)['then'](function(_0x165ca1){_0x25a8cc[_0x5e3f('0x2c')]=_0x165ca1;if(_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x2d')]){_0x5a5466['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x5a5466);})[_0x5e3f('0xd')](function(_0x2f91f7){_0x25a8cc[_0x5e3f('0x2e')]=_0x2f91f7;return _0x25a8cc;})[_0x5e3f('0xd')](respondWithFilteredResult(_0x335b36,_0x5a5466))['catch'](handleError(_0x335b36,null));};exports[_0x5e3f('0x2f')]=function(_0x2f0b8c,_0x5a6c6b){var _0x3b3e0={'raw':![],'where':{'id':_0x2f0b8c[_0x5e3f('0x30')]['id']}},_0x223bf4={};_0x223bf4[_0x5e3f('0x1b')]=_[_0x5e3f('0x1c')](db[_0x5e3f('0x17')]['rawAttributes']);_0x223bf4['query']=_[_0x5e3f('0x1c')](_0x2f0b8c[_0x5e3f('0x1f')]);_0x223bf4[_0x5e3f('0x1d')]=_[_0x5e3f('0x1e')](_0x223bf4[_0x5e3f('0x1b')],_0x223bf4[_0x5e3f('0x1f')]);_0x3b3e0['attributes']=_[_0x5e3f('0x1e')](_0x223bf4[_0x5e3f('0x1b')],qs['fields'](_0x2f0b8c[_0x5e3f('0x1f')][_0x5e3f('0x21')]));_0x3b3e0['attributes']=_0x3b3e0[_0x5e3f('0x20')]['length']?_0x3b3e0[_0x5e3f('0x20')]:_0x223bf4[_0x5e3f('0x1b')];if(_0x2f0b8c[_0x5e3f('0x1f')][_0x5e3f('0x2d')]){_0x3b3e0[_0x5e3f('0x31')]=[{'all':!![]}];}_0x3b3e0=_[_0x5e3f('0x32')]({},_0x3b3e0,_0x2f0b8c[_0x5e3f('0x2b')]);return db['Dynamics365Account'][_0x5e3f('0x33')](_0x3b3e0)[_0x5e3f('0xd')](handleEntityNotFound(_0x5a6c6b,null))['then'](respondWithResult(_0x5a6c6b,null))[_0x5e3f('0x34')](handleError(_0x5a6c6b,null));};exports[_0x5e3f('0x35')]=function(_0xa82e7d,_0x3cd1a1){return db[_0x5e3f('0x17')][_0x5e3f('0x35')](_0xa82e7d[_0x5e3f('0x36')],{})[_0x5e3f('0xd')](respondWithResult(_0x3cd1a1,0xc9))[_0x5e3f('0x34')](handleError(_0x3cd1a1,null));};exports[_0x5e3f('0x37')]=function(_0x4cf9dc,_0x340bf5){if(_0x4cf9dc[_0x5e3f('0x36')]['id']){delete _0x4cf9dc[_0x5e3f('0x36')]['id'];}return db['Dynamics365Account'][_0x5e3f('0x33')]({'where':{'id':_0x4cf9dc[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x340bf5,null))['then'](saveUpdates(_0x4cf9dc[_0x5e3f('0x36')],null))['then'](respondWithResult(_0x340bf5,null))['catch'](handleError(_0x340bf5,null));};exports[_0x5e3f('0xe')]=function(_0x260401,_0x4583a2){return db[_0x5e3f('0x17')]['find']({'where':{'id':_0x260401[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x4583a2,null))[_0x5e3f('0xd')](removeEntity(_0x4583a2,null))[_0x5e3f('0x34')](handleError(_0x4583a2,null));};exports[_0x5e3f('0x38')]=function(_0x1839c5,_0x281847){var _0x1b68f5={};var _0x31a99a={};var _0x557e51;var _0x14da33;return db[_0x5e3f('0x17')][_0x5e3f('0x39')]({'where':{'id':_0x1839c5[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x281847,null))[_0x5e3f('0xd')](function(_0x518429){if(_0x518429){_0x557e51=_0x518429;_0x31a99a['model']=_[_0x5e3f('0x1c')](db[_0x5e3f('0x3a')][_0x5e3f('0x18')]);_0x31a99a['query']=_['keys'](_0x1839c5[_0x5e3f('0x1f')]);_0x31a99a[_0x5e3f('0x1d')]=_['intersection'](_0x31a99a[_0x5e3f('0x1b')],_0x31a99a['query']);_0x1b68f5['attributes']=_[_0x5e3f('0x1e')](_0x31a99a[_0x5e3f('0x1b')],qs[_0x5e3f('0x21')](_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x21')]));_0x1b68f5[_0x5e3f('0x20')]=_0x1b68f5[_0x5e3f('0x20')][_0x5e3f('0x22')]?_0x1b68f5['attributes']:_0x31a99a[_0x5e3f('0x1b')];_0x1b68f5[_0x5e3f('0x25')]=qs[_0x5e3f('0x26')](_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x26')]);_0x1b68f5[_0x5e3f('0x27')]=qs[_0x5e3f('0x1d')](_[_0x5e3f('0x28')](_0x1839c5[_0x5e3f('0x1f')],_0x31a99a[_0x5e3f('0x1d')]));if(_0x1839c5['query'][_0x5e3f('0x2a')]){_0x1b68f5[_0x5e3f('0x27')]=_[_0x5e3f('0x32')](_0x1b68f5[_0x5e3f('0x27')],{'$or':_['map'](_0x1b68f5[_0x5e3f('0x20')],function(_0x2aa848){var _0x2cadfe={};_0x2cadfe[_0x2aa848]={'$like':'%'+_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x2a')]+'%'};return _0x2cadfe;})});}_0x1b68f5=_[_0x5e3f('0x32')]({},_0x1b68f5,_0x1839c5['options']);return _0x557e51['getConfigurations'](_0x1b68f5);}})['then'](function(_0x26e4df){if(_0x26e4df){_0x14da33=_0x26e4df[_0x5e3f('0x22')];if(!_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x23')](_0x5e3f('0x24'))){_0x1b68f5[_0x5e3f('0x9')]=qs[_0x5e3f('0x9')](_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x9')]);_0x1b68f5[_0x5e3f('0x7')]=qs[_0x5e3f('0x7')](_0x1839c5[_0x5e3f('0x1f')]['offset']);}return _0x557e51['getConfigurations'](_0x1b68f5);}})[_0x5e3f('0xd')](function(_0x49aa77){if(_0x49aa77){return _0x49aa77?{'count':_0x14da33,'rows':_0x49aa77}:null;}})['then'](respondWithResult(_0x281847,null))[_0x5e3f('0x34')](handleError(_0x281847,null));};exports['addConfiguration']=function(_0x321a9e,_0x7208e8){if(_0x321a9e[_0x5e3f('0x36')]['id']){delete _0x321a9e[_0x5e3f('0x36')]['id'];}return db[_0x5e3f('0x17')][_0x5e3f('0x39')]({'where':{'id':_0x321a9e[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x7208e8,null))[_0x5e3f('0xd')](function(_0x185268){if(_0x185268){_0x321a9e['body']['AccountId']=_0x185268['id'];_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x3b')]=integrations[_0x5e3f('0x3c')](_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x3d')],_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x1a')]);_0x321a9e['body']['Descriptions']=integrations[_0x5e3f('0x3e')](_0x321a9e[_0x5e3f('0x36')]['channel'],_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x1a')]);return db[_0x5e3f('0x3a')][_0x5e3f('0x35')](_0x321a9e[_0x5e3f('0x36')],{'include':[{'model':db[_0x5e3f('0x3f')],'as':_0x5e3f('0x3b')},{'model':db['Dynamics365Field'],'as':_0x5e3f('0x40')}]});}return null;})['then'](respondWithResult(_0x7208e8,null))['catch'](handleError(_0x7208e8,null));};function sanitizeRemoteUri(_0x5a0ec5){var _0x22dc84=_0x5a0ec5[_0x5e3f('0x41')](-0x1);if(_0x22dc84==='/')return _0x5a0ec5[_0x5e3f('0x42')](0x0,_0x5a0ec5[_0x5e3f('0x43')](_0x22dc84));return _0x5a0ec5;}function getWebApiUrl(_0x42fc95){return util[_0x5e3f('0x44')]('%s/api/data/v9.0/',_0x42fc95);}exports[_0x5e3f('0x45')]=function(_0x2e493d,_0x599430){var _0x171c92=_0x2e493d[_0x5e3f('0x1f')][_0x5e3f('0x46')];var _0x4fcda0=_0x171c92==='incident'?'Incident':_0x5e3f('0x47');var _0x56c8c7='';var _0x307059='';var _0x913be7='';var _0x589d7b='';var _0x40d649='';var _0x4c4b7e='';var _0x198ddc='';var _0x2cae12='';var _0x1341a3=['title',_0x5e3f('0x48'),'customerid','ownerid',_0x5e3f('0x49'),'subject','phonenumber',_0x5e3f('0x4a'),_0x5e3f('0x4b'),_0x5e3f('0x4c')];var _0x3bfe76=[_0x5e3f('0x4d'),_0x5e3f('0x4e'),_0x5e3f('0x4f'),_0x5e3f('0x50'),'contactidname',_0x5e3f('0x51'),_0x5e3f('0x52'),'contractidname',_0x5e3f('0x53'),_0x5e3f('0x54'),_0x5e3f('0x55'),'createdbyyominame',_0x5e3f('0x56'),_0x5e3f('0x57'),_0x5e3f('0x58'),_0x5e3f('0x59'),_0x5e3f('0x5a'),_0x5e3f('0x5b'),_0x5e3f('0x5c'),_0x5e3f('0x5d'),_0x5e3f('0x5e'),'entityimage_url',_0x5e3f('0x5f'),_0x5e3f('0x60'),'firstresponsebykpiidname',_0x5e3f('0x61'),_0x5e3f('0x62'),_0x5e3f('0x63'),_0x5e3f('0x64'),'lastonholdtime',_0x5e3f('0x65'),_0x5e3f('0x66'),_0x5e3f('0x67'),_0x5e3f('0x68'),_0x5e3f('0x69'),_0x5e3f('0x6a'),_0x5e3f('0x6b'),'modifiedonbehalfbyyominame',_0x5e3f('0x6c'),_0x5e3f('0x6d'),'numberofchildincidents',_0x5e3f('0x6e'),_0x5e3f('0x6f'),'owneridname',_0x5e3f('0x70'),'owneridyominame','parentcaseidname','primarycontactidname',_0x5e3f('0x71'),'prioritycodename',_0x5e3f('0x72'),'productserialnumber',_0x5e3f('0x73'),_0x5e3f('0x74'),'responseby','responsiblecontactidname',_0x5e3f('0x75'),_0x5e3f('0x76'),_0x5e3f('0x77'),'slaname',_0x5e3f('0x78'),_0x5e3f('0x79'),_0x5e3f('0x7a'),'subjectidname','ticketnumber',_0x5e3f('0x7b'),_0x5e3f('0x7c'),'traversedpath',_0x5e3f('0x7d'),_0x5e3f('0x7e')];var _0x272b44=_0x1341a3[_0x5e3f('0x7f')](_0x3bfe76);return db[_0x5e3f('0x17')][_0x5e3f('0x39')]({'where':{'id':_0x2e493d[_0x5e3f('0x30')]['id']},'attributes':['id','username','password',_0x5e3f('0x80'),'tenantId','clientId','clientSecret',_0x5e3f('0x81')],'include':[{'model':db[_0x5e3f('0x82')],'as':_0x5e3f('0x82'),'attributes':['id',_0x5e3f('0x83'),_0x5e3f('0x84')]}]})[_0x5e3f('0xd')](handleEntityNotFound(_0x599430,null))[_0x5e3f('0xd')](function(_0x33d2c7){if(_0x33d2c7){if(_0x33d2c7[_0x5e3f('0x81')]){_0x33d2c7[_0x5e3f('0x85')]=_0x33d2c7[_0x5e3f('0x82')][_0x5e3f('0x83')];_0x2cae12=sanitizeRemoteUri(_0x33d2c7[_0x5e3f('0x82')][_0x5e3f('0x84')]);_0x198ddc=getWebApiUrl(_0x2cae12);return _0x33d2c7;}_0x2cae12=sanitizeRemoteUri(_0x33d2c7['remoteUri']);_0x198ddc=getWebApiUrl(_0x2cae12);var _0x1b5e39={'method':_0x5e3f('0x86'),'uri':_0x5e3f('0x87')+_0x33d2c7[_0x5e3f('0x88')]+_0x5e3f('0x89'),'form':{'client_id':_0x33d2c7[_0x5e3f('0x8a')],'resource':_0x2cae12,'username':_0x33d2c7['username'],'password':_0x33d2c7[_0x5e3f('0x8b')],'grant_type':'password','client_secret':_0x33d2c7[_0x5e3f('0x8c')]},'json':!![]};return rp(_0x1b5e39);}})[_0x5e3f('0xd')](function(_0x2420ea){_0x4c4b7e=_0x2420ea[_0x5e3f('0x85')];var _0x772c73={'method':'GET','uri':encodeURI(_0x198ddc+_0x5e3f('0x8d')+_0x4fcda0+'\x27'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x4c4b7e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x772c73);})[_0x5e3f('0xd')](function(_0x509f60){var _0x403458=_0x509f60[_0x5e3f('0x8f')][0x0];var _0x2168dc=_0x403458[_0x5e3f('0x90')];var _0x394271={'method':_0x5e3f('0x91'),'uri':_0x198ddc+_0x5e3f('0x92')+_0x2168dc+_0x5e3f('0x93'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x4c4b7e,'If-None-Match':null,'OData-Version':_0x5e3f('0x94')},'json':!![]};return rp(_0x394271);})['then'](function(_0x4e3059){_0x56c8c7=_0x4e3059;_0x307059=_0x56c8c7['Attributes'];_0x307059=_[_0x5e3f('0x95')](_0x307059,function(_0x5c1344){return!_0x272b44[_0x5e3f('0x96')](_0x5c1344['LogicalName']);});var _0x2d4de8=[];var _0x1c16ba=[];_0x307059[_0x5e3f('0x97')](function(_0x46a4f7){if(_0x46a4f7[_0x5e3f('0x98')]){var _0x59afe1=_0x46a4f7['@odata.type'][_0x5e3f('0x42')](_0x46a4f7['@odata.type'][_0x5e3f('0x43')]('.')+0x1);if(_0x59afe1===_0x5e3f('0x99')){_0x2d4de8['push'](getSelectList(_0x198ddc,_0x171c92,_0x1c16ba,_0x56c8c7['MetadataId'],_0x46a4f7[_0x5e3f('0x90')],_0x4c4b7e));}}});return Promise[_0x5e3f('0x9a')](_0x2d4de8);})[_0x5e3f('0xd')](function(_0x23b1f3){_0x913be7=_0x23b1f3[0x0];var _0x43d8dc=[];var _0x1416e4=[];_0x307059['forEach'](function(_0x3e5f1d){if(!_[_0x5e3f('0x9b')](_0x3e5f1d[_0x5e3f('0x98')])){var _0x1741d6=_0x3e5f1d['@odata.type'][_0x5e3f('0x42')](_0x3e5f1d[_0x5e3f('0x98')][_0x5e3f('0x43')]('.')+0x1);if(_0x1741d6===_0x5e3f('0x9c')){_0x43d8dc['push'](getBooleanList(_0x198ddc,_0x171c92,_0x1416e4,_0x56c8c7[_0x5e3f('0x90')],_0x3e5f1d[_0x5e3f('0x90')],_0x4c4b7e));}}});return Promise[_0x5e3f('0x9a')](_0x43d8dc);})[_0x5e3f('0xd')](function(_0x5a3716){_0x589d7b=_0x5a3716[0x0];var _0x46e6fa=[];var _0x18cb9e=[];_0x307059['forEach'](function(_0x253ebe){if(_0x253ebe[_0x5e3f('0x98')]){var _0x504047=_0x253ebe[_0x5e3f('0x98')][_0x5e3f('0x42')](_0x253ebe['@odata.type'][_0x5e3f('0x43')]('.')+0x1);if(_0x504047==='StringAttributeMetadata'||_0x504047===_0x5e3f('0x9d')||_0x504047==='BigIntAttributeMetadata'||_0x504047===_0x5e3f('0x9e')||_0x504047===_0x5e3f('0x9f')||_0x504047===_0x5e3f('0xa0')||_0x504047===_0x5e3f('0xa1')||_0x504047===_0x5e3f('0xa2')||_0x504047===_0x5e3f('0xa3')||_0x504047===_0x5e3f('0xa4')){_0x46e6fa[_0x5e3f('0xa5')](getInputList(_0x198ddc,_0x171c92,_0x504047,_0x18cb9e,_0x56c8c7[_0x5e3f('0x90')],_0x253ebe['MetadataId'],_0x4c4b7e));}}});return Promise['all'](_0x46e6fa);})[_0x5e3f('0xd')](function(_0x2eccc1){_0x40d649=_0x2eccc1[0x0];var _0x537729=_0x913be7[_0x5e3f('0x7f')](_0x589d7b)[_0x5e3f('0x7f')](_0x40d649);var _0x1d4f2c={'count':_0x537729['length'],'rows':_0x537729};return _0x1d4f2c;})[_0x5e3f('0xd')](respondWithResult(_0x599430,null))[_0x5e3f('0x34')](function(_0x5630b0){var _0x41a156=_0x2e493d[_0x5e3f('0x1f')][_0x5e3f('0xa6')]?0x1f4:_0x5630b0['statusCode']||0x1f4;logger['error'](_0x5630b0['stack']);delete _0x5630b0[_0x5e3f('0x13')];if(_0x41a156===0x191){_0x41a156=0x190;}_0x599430[_0x5e3f('0x6')](_0x41a156)[_0x5e3f('0x14')](_0x2e493d[_0x5e3f('0x1f')]['test']?{'message':_0x5e3f('0xa7'),'statusCode':_0x5630b0[_0x5e3f('0xa8')]}:_0x5630b0);});};function getSelectList(_0x241d27,_0x19c6d7,_0x2268d0,_0x3d5a5b,_0x461c8d,_0x35f8ad){var _0x3f3cc7={'method':_0x5e3f('0x91'),'uri':_0x241d27+_0x5e3f('0x92')+_0x3d5a5b+_0x5e3f('0xa9')+_0x461c8d+_0x5e3f('0xaa')+_0x5e3f('0xab'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x35f8ad,'If-None-Match':null,'OData-Version':_0x5e3f('0x94')},'json':!![]};return rp(_0x3f3cc7)[_0x5e3f('0xd')](function(_0x3dc492){var _0x451214=[];var _0x2d1216=_0x3dc492[_0x5e3f('0xac')]['Options'];_0x2d1216['forEach'](function(_0x326cf8){_0x451214['push']({'name':_0x326cf8['Label'][_0x5e3f('0xad')][_0x5e3f('0xae')],'value':String(_0x326cf8[_0x5e3f('0xaf')])});});var _0x78f792={'id':_0x19c6d7+'_'+_0x3dc492[_0x5e3f('0xb0')],'name':_0x3dc492[_0x5e3f('0xb1')][_0x5e3f('0xad')][_0x5e3f('0xae')],'custom':![],'options':_0x451214};_0x2268d0[_0x5e3f('0xa5')](_0x78f792);return _0x2268d0;});}function getBooleanList(_0x51b32d,_0x1782aa,_0x59ac9c,_0x3326fb,_0x3a7867,_0x55c11b){var _0xc66fe5={'method':_0x5e3f('0x91'),'uri':_0x51b32d+_0x5e3f('0x92')+_0x3326fb+_0x5e3f('0xa9')+_0x3a7867+_0x5e3f('0xb2'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x55c11b,'If-None-Match':null,'OData-Version':_0x5e3f('0x94')},'json':!![]};return rp(_0xc66fe5)[_0x5e3f('0xd')](function(_0x3ffd5c){var _0x37e526=[];_0x37e526[_0x5e3f('0xa5')]({'name':_0x3ffd5c[_0x5e3f('0xac')][_0x5e3f('0xb3')][_0x5e3f('0xae')]['UserLocalizedLabel'][_0x5e3f('0xae')],'value':_0x5e3f('0xb4')},{'name':_0x3ffd5c[_0x5e3f('0xac')][_0x5e3f('0xb5')][_0x5e3f('0xae')][_0x5e3f('0xad')]['Label'],'value':_0x5e3f('0xb6')});var _0x54ad09={'id':_0x1782aa+'_'+_0x3ffd5c[_0x5e3f('0xb0')],'name':_0x3ffd5c[_0x5e3f('0xb1')][_0x5e3f('0xad')]['Label'],'custom':![],'options':_0x37e526};_0x59ac9c[_0x5e3f('0xa5')](_0x54ad09);return _0x59ac9c;});}function getInputList(_0x1346a2,_0x25d1b0,_0x1af0e0,_0x5a0bda,_0x30d193,_0x1a0738,_0x4c0f11){var _0x46bde1={'method':_0x5e3f('0x91'),'uri':_0x1346a2+'EntityDefinitions('+_0x30d193+_0x5e3f('0xa9')+_0x1a0738+_0x5e3f('0xb7')+_0x1af0e0+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5e3f('0x8e')+_0x4c0f11,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x46bde1)[_0x5e3f('0xd')](function(_0x192edd){var _0x33e150={'id':_0x25d1b0+'_'+_0x192edd[_0x5e3f('0xb0')],'name':_0x192edd[_0x5e3f('0xb1')][_0x5e3f('0xad')]?_0x192edd[_0x5e3f('0xb1')]['UserLocalizedLabel']['Label']:_0x192edd[_0x5e3f('0xb0')],'custom':![],'options':[]};_0x5a0bda[_0x5e3f('0xa5')](_0x33e150);return _0x5a0bda;});} \ No newline at end of file +var _0xba26=['exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','traversedpath','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','push','UserLocalizedLabel','Label','Value','DisplayName','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','lodash','../../components/parsers/qs','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','name','index','map','Dynamics365Account','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','create','body','catch','destroy','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_url'];(function(_0x5f6a8a,_0x45f474){var _0x2cce4d=function(_0x590b80){while(--_0x590b80){_0x5f6a8a['push'](_0x5f6a8a['shift']());}};_0x2cce4d(++_0x45f474);}(_0xba26,0x1c9));var _0x6ba2=function(_0x31e75c,_0x1ee7a4){_0x31e75c=_0x31e75c-0x0;var _0x47c1a8=_0xba26[_0x31e75c];return _0x47c1a8;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x6ba2('0x0'));var qs=require(_0x6ba2('0x1'));var logger=require('../../config/logger')(_0x6ba2('0x2'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6ba2('0x3'));function respondWithResult(_0x46ee09,_0x5c0bcf){_0x5c0bcf=_0x5c0bcf||0xc8;return function(_0xb0a5c2){if(_0xb0a5c2){return _0x46ee09[_0x6ba2('0x4')](_0x5c0bcf)[_0x6ba2('0x5')](_0xb0a5c2);}};}function respondWithFilteredResult(_0x125002,_0x27a456){return function(_0x4c10eb){if(_0x4c10eb){var _0x3768fb=typeof _0x27a456[_0x6ba2('0x6')]===_0x6ba2('0x7')&&typeof _0x27a456[_0x6ba2('0x8')]===_0x6ba2('0x7');var _0x365506=_0x4c10eb[_0x6ba2('0x9')];var _0x1b0e9b=_0x3768fb?0x0:_0x27a456['offset'];var _0x192bc1=_0x3768fb?_0x4c10eb[_0x6ba2('0x9')]:_0x27a456['offset']+_0x27a456['limit'];var _0x54574f;if(_0x192bc1>=_0x365506){_0x192bc1=_0x365506;_0x54574f=0xc8;}else{_0x54574f=0xce;}_0x125002[_0x6ba2('0x4')](_0x54574f);return _0x125002[_0x6ba2('0xa')](_0x6ba2('0xb'),_0x1b0e9b+'-'+_0x192bc1+'/'+_0x365506)[_0x6ba2('0x5')](_0x4c10eb);}return null;};}function saveUpdates(_0x599909){return function(_0x544729){if(_0x544729){return _0x544729[_0x6ba2('0xc')](_0x599909)[_0x6ba2('0xd')](function(_0x11c907){return _0x11c907;});}return null;};}function removeEntity(_0xe6f51c){return function(_0x124632){if(_0x124632){return _0x124632['destroy']()[_0x6ba2('0xd')](function(){_0xe6f51c[_0x6ba2('0x4')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eb3af){return function(_0x1c9be5){if(!_0x1c9be5){_0x3eb3af[_0x6ba2('0xe')](0x194);}return _0x1c9be5;};}function handleError(_0x3e02f1,_0xdec022){_0xdec022=_0xdec022||0x1f4;return function(_0x4107af){logger[_0x6ba2('0xf')](_0x4107af['stack']);if(_0x4107af[_0x6ba2('0x10')]){delete _0x4107af[_0x6ba2('0x10')];}_0x3e02f1['status'](_0xdec022)['send'](_0x4107af);};}exports[_0x6ba2('0x11')]=function(_0x3f09f3,_0x168d32){var _0x367443={},_0x4f42be={},_0x56e627={'count':0x0,'rows':[]};var _0x256feb=_[_0x6ba2('0x12')](db[_0x6ba2('0x13')]['rawAttributes'],function(_0x26e4be){return{'name':_0x26e4be[_0x6ba2('0x14')],'type':_0x26e4be[_0x6ba2('0x15')][_0x6ba2('0x16')]};});_0x4f42be[_0x6ba2('0x17')]=_['map'](_0x256feb,_0x6ba2('0x10'));_0x4f42be['query']=_[_0x6ba2('0x18')](_0x3f09f3[_0x6ba2('0x19')]);_0x4f42be[_0x6ba2('0x1a')]=_[_0x6ba2('0x1b')](_0x4f42be[_0x6ba2('0x17')],_0x4f42be[_0x6ba2('0x19')]);_0x367443[_0x6ba2('0x1c')]=_[_0x6ba2('0x1b')](_0x4f42be[_0x6ba2('0x17')],qs[_0x6ba2('0x1d')](_0x3f09f3[_0x6ba2('0x19')]['fields']));_0x367443[_0x6ba2('0x1c')]=_0x367443[_0x6ba2('0x1c')]['length']?_0x367443['attributes']:_0x4f42be[_0x6ba2('0x17')];if(!_0x3f09f3[_0x6ba2('0x19')][_0x6ba2('0x1e')]('nolimit')){_0x367443[_0x6ba2('0x8')]=qs['limit'](_0x3f09f3[_0x6ba2('0x19')][_0x6ba2('0x8')]);_0x367443['offset']=qs['offset'](_0x3f09f3[_0x6ba2('0x19')]['offset']);}_0x367443[_0x6ba2('0x1f')]=qs[_0x6ba2('0x20')](_0x3f09f3[_0x6ba2('0x19')][_0x6ba2('0x20')]);_0x367443[_0x6ba2('0x21')]=qs[_0x6ba2('0x1a')](_['pick'](_0x3f09f3[_0x6ba2('0x19')],_0x4f42be[_0x6ba2('0x1a')]),_0x256feb);if(_0x3f09f3['query'][_0x6ba2('0x22')]){_0x367443['where']=_[_0x6ba2('0x23')](_0x367443['where'],{'$or':_['map'](_0x256feb,function(_0x3537ec){if(_0x3537ec[_0x6ba2('0x15')]!==_0x6ba2('0x24')){var _0x4d5bc0={};_0x4d5bc0[_0x3537ec['name']]={'$like':'%'+_0x3f09f3['query']['filter']+'%'};return _0x4d5bc0;}})});}_0x367443=_[_0x6ba2('0x23')]({},_0x367443,_0x3f09f3[_0x6ba2('0x25')]);var _0x102d26={'where':_0x367443[_0x6ba2('0x21')]};return db['Dynamics365Account']['count'](_0x102d26)[_0x6ba2('0xd')](function(_0x391cae){_0x56e627[_0x6ba2('0x9')]=_0x391cae;if(_0x3f09f3['query'][_0x6ba2('0x26')]){_0x367443[_0x6ba2('0x27')]=[{'all':!![]}];}return db[_0x6ba2('0x13')][_0x6ba2('0x28')](_0x367443);})['then'](function(_0x581209){_0x56e627[_0x6ba2('0x29')]=_0x581209;return _0x56e627;})[_0x6ba2('0xd')](respondWithFilteredResult(_0x168d32,_0x367443))['catch'](handleError(_0x168d32,null));};exports['show']=function(_0x3ff618,_0x2cef6f){var _0x1c8a35={'raw':![],'where':{'id':_0x3ff618[_0x6ba2('0x2a')]['id']}},_0x2de43f={};_0x2de43f[_0x6ba2('0x17')]=_[_0x6ba2('0x18')](db[_0x6ba2('0x13')][_0x6ba2('0x2b')]);_0x2de43f[_0x6ba2('0x19')]=_[_0x6ba2('0x18')](_0x3ff618[_0x6ba2('0x19')]);_0x2de43f[_0x6ba2('0x1a')]=_[_0x6ba2('0x1b')](_0x2de43f[_0x6ba2('0x17')],_0x2de43f['query']);_0x1c8a35[_0x6ba2('0x1c')]=_[_0x6ba2('0x1b')](_0x2de43f[_0x6ba2('0x17')],qs[_0x6ba2('0x1d')](_0x3ff618[_0x6ba2('0x19')][_0x6ba2('0x1d')]));_0x1c8a35[_0x6ba2('0x1c')]=_0x1c8a35[_0x6ba2('0x1c')][_0x6ba2('0x2c')]?_0x1c8a35[_0x6ba2('0x1c')]:_0x2de43f['model'];if(_0x3ff618[_0x6ba2('0x19')][_0x6ba2('0x26')]){_0x1c8a35[_0x6ba2('0x27')]=[{'all':!![]}];}_0x1c8a35=_['merge']({},_0x1c8a35,_0x3ff618[_0x6ba2('0x25')]);return db[_0x6ba2('0x13')][_0x6ba2('0x2d')](_0x1c8a35)[_0x6ba2('0xd')](handleEntityNotFound(_0x2cef6f,null))[_0x6ba2('0xd')](respondWithResult(_0x2cef6f,null))['catch'](handleError(_0x2cef6f,null));};exports[_0x6ba2('0x2e')]=function(_0xa69e83,_0x342cf2){return db[_0x6ba2('0x13')][_0x6ba2('0x2e')](_0xa69e83[_0x6ba2('0x2f')],{})['then'](respondWithResult(_0x342cf2,0xc9))[_0x6ba2('0x30')](handleError(_0x342cf2,null));};exports[_0x6ba2('0xc')]=function(_0x40118a,_0x476dc9){if(_0x40118a[_0x6ba2('0x2f')]['id']){delete _0x40118a['body']['id'];}return db['Dynamics365Account'][_0x6ba2('0x2d')]({'where':{'id':_0x40118a[_0x6ba2('0x2a')]['id']}})[_0x6ba2('0xd')](handleEntityNotFound(_0x476dc9,null))[_0x6ba2('0xd')](saveUpdates(_0x40118a['body'],null))['then'](respondWithResult(_0x476dc9,null))[_0x6ba2('0x30')](handleError(_0x476dc9,null));};exports[_0x6ba2('0x31')]=function(_0x10d8c3,_0x375219){return db[_0x6ba2('0x13')][_0x6ba2('0x2d')]({'where':{'id':_0x10d8c3[_0x6ba2('0x2a')]['id']}})[_0x6ba2('0xd')](handleEntityNotFound(_0x375219,null))[_0x6ba2('0xd')](removeEntity(_0x375219,null))[_0x6ba2('0x30')](handleError(_0x375219,null));};exports[_0x6ba2('0x32')]=function(_0x58c63d,_0xd533bd){var _0x51bcbc={};var _0x23175a={};var _0x5c18f2;var _0x146d04;return db[_0x6ba2('0x13')][_0x6ba2('0x33')]({'where':{'id':_0x58c63d[_0x6ba2('0x2a')]['id']}})[_0x6ba2('0xd')](handleEntityNotFound(_0xd533bd,null))['then'](function(_0x2d514f){if(_0x2d514f){_0x5c18f2=_0x2d514f;_0x23175a['model']=_[_0x6ba2('0x18')](db[_0x6ba2('0x34')]['rawAttributes']);_0x23175a[_0x6ba2('0x19')]=_['keys'](_0x58c63d[_0x6ba2('0x19')]);_0x23175a[_0x6ba2('0x1a')]=_[_0x6ba2('0x1b')](_0x23175a['model'],_0x23175a[_0x6ba2('0x19')]);_0x51bcbc[_0x6ba2('0x1c')]=_['intersection'](_0x23175a[_0x6ba2('0x17')],qs['fields'](_0x58c63d[_0x6ba2('0x19')][_0x6ba2('0x1d')]));_0x51bcbc[_0x6ba2('0x1c')]=_0x51bcbc['attributes'][_0x6ba2('0x2c')]?_0x51bcbc[_0x6ba2('0x1c')]:_0x23175a['model'];_0x51bcbc[_0x6ba2('0x1f')]=qs[_0x6ba2('0x20')](_0x58c63d[_0x6ba2('0x19')][_0x6ba2('0x20')]);_0x51bcbc[_0x6ba2('0x21')]=qs[_0x6ba2('0x1a')](_[_0x6ba2('0x35')](_0x58c63d[_0x6ba2('0x19')],_0x23175a[_0x6ba2('0x1a')]));if(_0x58c63d['query'][_0x6ba2('0x22')]){_0x51bcbc[_0x6ba2('0x21')]=_['merge'](_0x51bcbc[_0x6ba2('0x21')],{'$or':_[_0x6ba2('0x12')](_0x51bcbc[_0x6ba2('0x1c')],function(_0x4def70){var _0x198eee={};_0x198eee[_0x4def70]={'$like':'%'+_0x58c63d['query'][_0x6ba2('0x22')]+'%'};return _0x198eee;})});}_0x51bcbc=_[_0x6ba2('0x23')]({},_0x51bcbc,_0x58c63d[_0x6ba2('0x25')]);return _0x5c18f2[_0x6ba2('0x32')](_0x51bcbc);}})[_0x6ba2('0xd')](function(_0x3ad085){if(_0x3ad085){_0x146d04=_0x3ad085[_0x6ba2('0x2c')];if(!_0x58c63d[_0x6ba2('0x19')][_0x6ba2('0x1e')]('nolimit')){_0x51bcbc[_0x6ba2('0x8')]=qs['limit'](_0x58c63d['query']['limit']);_0x51bcbc['offset']=qs['offset'](_0x58c63d[_0x6ba2('0x19')][_0x6ba2('0x6')]);}return _0x5c18f2[_0x6ba2('0x32')](_0x51bcbc);}})[_0x6ba2('0xd')](function(_0x5121ab){if(_0x5121ab){return _0x5121ab?{'count':_0x146d04,'rows':_0x5121ab}:null;}})[_0x6ba2('0xd')](respondWithResult(_0xd533bd,null))['catch'](handleError(_0xd533bd,null));};exports[_0x6ba2('0x36')]=function(_0x11cab3,_0x5ea2fb){if(_0x11cab3[_0x6ba2('0x2f')]['id']){delete _0x11cab3[_0x6ba2('0x2f')]['id'];}return db[_0x6ba2('0x13')][_0x6ba2('0x33')]({'where':{'id':_0x11cab3[_0x6ba2('0x2a')]['id']}})[_0x6ba2('0xd')](handleEntityNotFound(_0x5ea2fb,null))[_0x6ba2('0xd')](function(_0x2d23cd){if(_0x2d23cd){_0x11cab3[_0x6ba2('0x2f')][_0x6ba2('0x37')]=_0x2d23cd['id'];_0x11cab3[_0x6ba2('0x2f')][_0x6ba2('0x38')]=integrations[_0x6ba2('0x39')](_0x11cab3['body'][_0x6ba2('0x3a')],_0x11cab3[_0x6ba2('0x2f')][_0x6ba2('0x15')]);_0x11cab3[_0x6ba2('0x2f')][_0x6ba2('0x3b')]=integrations[_0x6ba2('0x3c')](_0x11cab3[_0x6ba2('0x2f')][_0x6ba2('0x3a')],_0x11cab3[_0x6ba2('0x2f')][_0x6ba2('0x15')]);return db[_0x6ba2('0x34')]['create'](_0x11cab3['body'],{'include':[{'model':db[_0x6ba2('0x3d')],'as':_0x6ba2('0x38')},{'model':db[_0x6ba2('0x3d')],'as':'Descriptions'}]});}return null;})[_0x6ba2('0xd')](respondWithResult(_0x5ea2fb,null))['catch'](handleError(_0x5ea2fb,null));};function sanitizeRemoteUri(_0x1262b0){var _0x3b896b=_0x1262b0[_0x6ba2('0x3e')](-0x1);if(_0x3b896b==='/')return _0x1262b0[_0x6ba2('0x3f')](0x0,_0x1262b0[_0x6ba2('0x40')](_0x3b896b));return _0x1262b0;}function getWebApiUrl(_0x32d3d3){return util['format'](_0x6ba2('0x41'),_0x32d3d3);}exports[_0x6ba2('0x42')]=function(_0x3f3308,_0x3c360d){var _0xf71c9=_0x3f3308[_0x6ba2('0x19')][_0x6ba2('0x43')];var _0x14fab0=_0xf71c9===_0x6ba2('0x44')?_0x6ba2('0x45'):_0x6ba2('0x46');var _0x273899='';var _0x505e80='';var _0x3efd72='';var _0x137c7a='';var _0x58f595='';var _0x20ed9e='';var _0x34b7c4='';var _0x21a0ec='';var _0x246813=['title',_0x6ba2('0x47'),'customerid',_0x6ba2('0x48'),_0x6ba2('0x49'),_0x6ba2('0x4a'),_0x6ba2('0x4b'),_0x6ba2('0x4c'),_0x6ba2('0x4d'),_0x6ba2('0x4e')];var _0xe0cc69=['accountidname',_0x6ba2('0x4f'),'actualserviceunits',_0x6ba2('0x50'),'contactidname',_0x6ba2('0x51'),'contractdetailidname',_0x6ba2('0x52'),_0x6ba2('0x53'),'createdbyexternalpartyyominame',_0x6ba2('0x54'),_0x6ba2('0x55'),'createdon','createdonbehalfbyname',_0x6ba2('0x56'),_0x6ba2('0x57'),_0x6ba2('0x58'),_0x6ba2('0x59'),_0x6ba2('0x5a'),'entitlementidname','entityimage_timestamp',_0x6ba2('0x5b'),'escalatedon',_0x6ba2('0x5c'),'firstresponsebykpiidname',_0x6ba2('0x5d'),_0x6ba2('0x5e'),_0x6ba2('0x5f'),_0x6ba2('0x60'),_0x6ba2('0x61'),_0x6ba2('0x62'),_0x6ba2('0x63'),_0x6ba2('0x64'),_0x6ba2('0x65'),_0x6ba2('0x66'),'modifiedon',_0x6ba2('0x67'),_0x6ba2('0x68'),'msdyn_incidenttypename',_0x6ba2('0x69'),'numberofchildincidents',_0x6ba2('0x6a'),'overriddencreatedon',_0x6ba2('0x6b'),_0x6ba2('0x6c'),'owneridyominame','parentcaseidname',_0x6ba2('0x6d'),_0x6ba2('0x6e'),_0x6ba2('0x6f'),_0x6ba2('0x70'),_0x6ba2('0x71'),_0x6ba2('0x72'),_0x6ba2('0x73'),_0x6ba2('0x74'),_0x6ba2('0x75'),_0x6ba2('0x76'),_0x6ba2('0x77'),'slainvokedidname',_0x6ba2('0x78'),_0x6ba2('0x79'),'statecode',_0x6ba2('0x7a'),'subjectidname',_0x6ba2('0x7b'),_0x6ba2('0x7c'),'transactioncurrencyidname',_0x6ba2('0x7d'),'utcconversiontimezonecode',_0x6ba2('0x7e')];var _0x177ebb=_0x246813['concat'](_0xe0cc69);return db[_0x6ba2('0x13')]['findOne']({'where':{'id':_0x3f3308[_0x6ba2('0x2a')]['id']},'attributes':['id',_0x6ba2('0x7f'),_0x6ba2('0x80'),_0x6ba2('0x81'),_0x6ba2('0x82'),_0x6ba2('0x83'),_0x6ba2('0x84'),_0x6ba2('0x85')],'include':[{'model':db[_0x6ba2('0x86')],'as':_0x6ba2('0x86'),'attributes':['id',_0x6ba2('0x87'),_0x6ba2('0x88')]}]})[_0x6ba2('0xd')](handleEntityNotFound(_0x3c360d,null))['then'](function(_0x4f0947){if(_0x4f0947){if(_0x4f0947['modernAuthentication']){_0x4f0947[_0x6ba2('0x89')]=_0x4f0947['CloudProvider'][_0x6ba2('0x87')];_0x21a0ec=sanitizeRemoteUri(_0x4f0947[_0x6ba2('0x86')][_0x6ba2('0x88')]);_0x34b7c4=getWebApiUrl(_0x21a0ec);return _0x4f0947;}_0x21a0ec=sanitizeRemoteUri(_0x4f0947[_0x6ba2('0x81')]);_0x34b7c4=getWebApiUrl(_0x21a0ec);var _0x17b15e={'method':_0x6ba2('0x8a'),'uri':_0x6ba2('0x8b')+_0x4f0947[_0x6ba2('0x82')]+_0x6ba2('0x8c'),'form':{'client_id':_0x4f0947[_0x6ba2('0x83')],'resource':_0x21a0ec,'username':_0x4f0947[_0x6ba2('0x7f')],'password':_0x4f0947[_0x6ba2('0x80')],'grant_type':_0x6ba2('0x80'),'client_secret':_0x4f0947[_0x6ba2('0x84')]},'json':!![]};return rp(_0x17b15e);}})[_0x6ba2('0xd')](function(_0x1576a4){_0x20ed9e=_0x1576a4[_0x6ba2('0x89')];var _0x49f101={'method':_0x6ba2('0x8d'),'uri':encodeURI(_0x34b7c4+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x14fab0+'\x27'),'headers':{'Authorization':_0x6ba2('0x8e')+_0x20ed9e,'If-None-Match':null,'OData-Version':_0x6ba2('0x8f')},'json':!![]};return rp(_0x49f101);})[_0x6ba2('0xd')](function(_0x3f1ef9){var _0x53bfed=_0x3f1ef9[_0x6ba2('0x90')][0x0];var _0x36a477=_0x53bfed['MetadataId'];var _0xccd6f7={'method':_0x6ba2('0x8d'),'uri':_0x34b7c4+_0x6ba2('0x91')+_0x36a477+_0x6ba2('0x92'),'headers':{'Authorization':_0x6ba2('0x8e')+_0x20ed9e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xccd6f7);})[_0x6ba2('0xd')](function(_0x37d7d5){_0x273899=_0x37d7d5;_0x505e80=_0x273899['Attributes'];_0x505e80=_[_0x6ba2('0x93')](_0x505e80,function(_0x37d944){return!_0x177ebb['includes'](_0x37d944[_0x6ba2('0x94')]);});var _0x1cf584=[];var _0x266baa=[];_0x505e80[_0x6ba2('0x95')](function(_0x26a03d){if(_0x26a03d[_0x6ba2('0x96')]){var _0x479f93=_0x26a03d[_0x6ba2('0x96')][_0x6ba2('0x3f')](_0x26a03d[_0x6ba2('0x96')][_0x6ba2('0x40')]('.')+0x1);if(_0x479f93===_0x6ba2('0x97')){_0x1cf584['push'](getSelectList(_0x34b7c4,_0xf71c9,_0x266baa,_0x273899['MetadataId'],_0x26a03d[_0x6ba2('0x98')],_0x20ed9e));}}});return Promise[_0x6ba2('0x99')](_0x1cf584);})[_0x6ba2('0xd')](function(_0x2277bd){_0x3efd72=_0x2277bd[0x0];var _0x1cac4d=[];var _0x553f10=[];_0x505e80[_0x6ba2('0x95')](function(_0x5fecf9){if(!_[_0x6ba2('0x9a')](_0x5fecf9[_0x6ba2('0x96')])){var _0x49003f=_0x5fecf9[_0x6ba2('0x96')][_0x6ba2('0x3f')](_0x5fecf9['@odata.type'][_0x6ba2('0x40')]('.')+0x1);if(_0x49003f===_0x6ba2('0x9b')){_0x1cac4d['push'](getBooleanList(_0x34b7c4,_0xf71c9,_0x553f10,_0x273899[_0x6ba2('0x98')],_0x5fecf9[_0x6ba2('0x98')],_0x20ed9e));}}});return Promise[_0x6ba2('0x99')](_0x1cac4d);})[_0x6ba2('0xd')](function(_0x47a752){_0x137c7a=_0x47a752[0x0];var _0x307dfb=[];var _0x4a27b1=[];_0x505e80[_0x6ba2('0x95')](function(_0x1260e3){if(_0x1260e3[_0x6ba2('0x96')]){var _0xdfe190=_0x1260e3[_0x6ba2('0x96')][_0x6ba2('0x3f')](_0x1260e3['@odata.type'][_0x6ba2('0x40')]('.')+0x1);if(_0xdfe190===_0x6ba2('0x9c')||_0xdfe190===_0x6ba2('0x9d')||_0xdfe190==='BigIntAttributeMetadata'||_0xdfe190==='IntegerAttributeMetadata'||_0xdfe190===_0x6ba2('0x9e')||_0xdfe190==='DateTimeAttributeMetadata'||_0xdfe190===_0x6ba2('0x9f')||_0xdfe190===_0x6ba2('0xa0')||_0xdfe190===_0x6ba2('0xa1')||_0xdfe190===_0x6ba2('0xa2')){_0x307dfb['push'](getInputList(_0x34b7c4,_0xf71c9,_0xdfe190,_0x4a27b1,_0x273899[_0x6ba2('0x98')],_0x1260e3[_0x6ba2('0x98')],_0x20ed9e));}}});return Promise['all'](_0x307dfb);})[_0x6ba2('0xd')](function(_0x52b4ba){_0x58f595=_0x52b4ba[0x0];var _0x17c6cf=_0x3efd72[_0x6ba2('0xa3')](_0x137c7a)[_0x6ba2('0xa3')](_0x58f595);var _0x5a1181={'count':_0x17c6cf['length'],'rows':_0x17c6cf};return _0x5a1181;})[_0x6ba2('0xd')](respondWithResult(_0x3c360d,null))[_0x6ba2('0x30')](function(_0x475134){var _0x2acb90=_0x3f3308[_0x6ba2('0x19')][_0x6ba2('0xa4')]?0x1f4:_0x475134[_0x6ba2('0xa5')]||0x1f4;logger['error'](_0x475134[_0x6ba2('0xa6')]);delete _0x475134[_0x6ba2('0x10')];if(_0x2acb90===0x191){_0x2acb90=0x190;}_0x3c360d[_0x6ba2('0x4')](_0x2acb90)[_0x6ba2('0xa7')](_0x3f3308[_0x6ba2('0x19')]['test']?{'message':_0x6ba2('0xa8'),'statusCode':_0x475134['statusCode']}:_0x475134);});};function getSelectList(_0x4a60cd,_0x157b01,_0x3b95b9,_0x5dbdab,_0x30fc9c,_0xfe6815){var _0xc05137={'method':_0x6ba2('0x8d'),'uri':_0x4a60cd+_0x6ba2('0x91')+_0x5dbdab+_0x6ba2('0xa9')+_0x30fc9c+_0x6ba2('0xaa')+_0x6ba2('0xab'),'headers':{'Authorization':_0x6ba2('0x8e')+_0xfe6815,'If-None-Match':null,'OData-Version':_0x6ba2('0x8f')},'json':!![]};return rp(_0xc05137)[_0x6ba2('0xd')](function(_0x30f55b){var _0xe745b8=[];var _0xeeafe5=_0x30f55b[_0x6ba2('0xac')][_0x6ba2('0xad')];_0xeeafe5['forEach'](function(_0xc93a66){_0xe745b8[_0x6ba2('0xae')]({'name':_0xc93a66['Label'][_0x6ba2('0xaf')][_0x6ba2('0xb0')],'value':String(_0xc93a66[_0x6ba2('0xb1')])});});var _0x40f967={'id':_0x157b01+'_'+_0x30f55b['LogicalName'],'name':_0x30f55b[_0x6ba2('0xb2')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0xe745b8};_0x3b95b9[_0x6ba2('0xae')](_0x40f967);return _0x3b95b9;});}function getBooleanList(_0xdfabd0,_0x1724b4,_0x33c3b7,_0x1f7290,_0x440303,_0x58c2f7){var _0x37cd8e={'method':'GET','uri':_0xdfabd0+_0x6ba2('0x91')+_0x1f7290+')/Attributes('+_0x440303+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x6ba2('0x8e')+_0x58c2f7,'If-None-Match':null,'OData-Version':_0x6ba2('0x8f')},'json':!![]};return rp(_0x37cd8e)['then'](function(_0x17591d){var _0x34a052=[];_0x34a052[_0x6ba2('0xae')]({'name':_0x17591d['OptionSet'][_0x6ba2('0xb3')]['Label']['UserLocalizedLabel'][_0x6ba2('0xb0')],'value':'true'},{'name':_0x17591d[_0x6ba2('0xac')][_0x6ba2('0xb4')][_0x6ba2('0xb0')][_0x6ba2('0xaf')]['Label'],'value':'false'});var _0x5c7e43={'id':_0x1724b4+'_'+_0x17591d[_0x6ba2('0x94')],'name':_0x17591d[_0x6ba2('0xb2')][_0x6ba2('0xaf')][_0x6ba2('0xb0')],'custom':![],'options':_0x34a052};_0x33c3b7[_0x6ba2('0xae')](_0x5c7e43);return _0x33c3b7;});}function getInputList(_0x52d1f9,_0x117b5a,_0x573833,_0x1f3f26,_0x57ccdb,_0x2dbafc,_0x3a2f16){var _0x317c3c={'method':_0x6ba2('0x8d'),'uri':_0x52d1f9+_0x6ba2('0x91')+_0x57ccdb+_0x6ba2('0xa9')+_0x2dbafc+_0x6ba2('0xb5')+_0x573833+_0x6ba2('0xb6'),'headers':{'Authorization':_0x6ba2('0x8e')+_0x3a2f16,'If-None-Match':null,'OData-Version':_0x6ba2('0x8f')},'json':!![]};return rp(_0x317c3c)[_0x6ba2('0xd')](function(_0x5b5d6c){var _0x14321b={'id':_0x117b5a+'_'+_0x5b5d6c['LogicalName'],'name':_0x5b5d6c['DisplayName'][_0x6ba2('0xaf')]?_0x5b5d6c['DisplayName']['UserLocalizedLabel'][_0x6ba2('0xb0')]:_0x5b5d6c[_0x6ba2('0x94')],'custom':![],'options':[]};_0x1f3f26['push'](_0x14321b);return _0x1f3f26;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b51d81a..8bc3e4a 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1ef735,_0xc49a85){var _0x16f63f=function(_0x116406){while(--_0x116406){_0x1ef735['push'](_0x1ef735['shift']());}};_0x16f63f(++_0xc49a85);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x39af61,_0x604658){var _0x32c7a2=function(_0x8fd2c9){while(--_0x8fd2c9){_0x39af61['push'](_0x39af61['shift']());}};_0x32c7a2(++_0x604658);}(_0xb7e7,0x121));var _0x7b7e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xb7e7[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 21c561e..5493344 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 _0xc8aa=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Dynamics365Account','findAll','options','where','attributes','limit','model','include','map','then','GetDynamics365Account','catch','ShowDynamics365Account','find'];(function(_0x3e753a,_0x45e9cc){var _0x2a8a3a=function(_0x4cc62e){while(--_0x4cc62e){_0x3e753a['push'](_0x3e753a['shift']());}};_0x2a8a3a(++_0x45e9cc);}(_0xc8aa,0x154));var _0xac8a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc8aa[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xac8a('0x0'));var util=require('util');var moment=require(_0xac8a('0x1'));var BPromise=require(_0xac8a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac8a('0x3'));var db=require(_0xac8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac8a('0x5'))(_0xac8a('0x6'));var config=require(_0xac8a('0x7'));var jayson=require(_0xac8a('0x8'));var client=jayson[_0xac8a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48ace9,_0x3b0f41,_0x5c19ee){return new BPromise(function(_0x475633,_0x1169a1){return client[_0xac8a('0xa')](_0x48ace9,_0x5c19ee)['then'](function(_0x3436d8){logger[_0xac8a('0xb')](_0xac8a('0xc'),_0x3b0f41,_0xac8a('0xd'));logger[_0xac8a('0xe')](_0xac8a('0xf'),_0x3b0f41,'request\x20sent',JSON[_0xac8a('0x10')](_0x3436d8));if(_0x3436d8[_0xac8a('0x11')]){if(_0x3436d8[_0xac8a('0x11')]['code']===0x1f4){logger[_0xac8a('0x11')](_0xac8a('0xc'),_0x3b0f41,_0x3436d8[_0xac8a('0x11')][_0xac8a('0x12')]);return _0x1169a1(_0x3436d8[_0xac8a('0x11')][_0xac8a('0x12')]);}logger[_0xac8a('0x11')](_0xac8a('0xc'),_0x3b0f41,_0x3436d8[_0xac8a('0x11')]['message']);return _0x475633(_0x3436d8['error'][_0xac8a('0x12')]);}else{logger[_0xac8a('0xb')](_0xac8a('0xc'),_0x3b0f41,_0xac8a('0xd'));_0x475633(_0x3436d8[_0xac8a('0x13')][_0xac8a('0x12')]);}})['catch'](function(_0x344bb0){logger[_0xac8a('0x11')](_0xac8a('0xc'),_0x3b0f41,_0x344bb0);_0x1169a1(_0x344bb0);});});}exports['GetDynamics365Account']=function(_0x16083c){var _0x42fd53=this;return new Promise(function(_0x131f17,_0x587baa){return db[_0xac8a('0x14')][_0xac8a('0x15')]({'raw':_0x16083c['options']?_0x16083c['options']['raw']===undefined?!![]:![]:!![],'where':_0x16083c[_0xac8a('0x16')]?_0x16083c[_0xac8a('0x16')][_0xac8a('0x17')]||null:null,'attributes':_0x16083c[_0xac8a('0x16')]?_0x16083c['options'][_0xac8a('0x18')]||null:null,'limit':_0x16083c[_0xac8a('0x16')]?_0x16083c['options'][_0xac8a('0x19')]||null:null,'include':_0x16083c[_0xac8a('0x16')]?_0x16083c['options']['include']?_['map'](_0x16083c['options']['include'],function(_0x327a76){return{'model':db[_0x327a76[_0xac8a('0x1a')]],'as':_0x327a76['as'],'attributes':_0x327a76[_0xac8a('0x18')],'include':_0x327a76[_0xac8a('0x1b')]?_['map'](_0x327a76[_0xac8a('0x1b')],function(_0x14db1f){return{'model':db[_0x14db1f[_0xac8a('0x1a')]],'as':_0x14db1f['as'],'attributes':_0x14db1f[_0xac8a('0x18')],'include':_0x14db1f[_0xac8a('0x1b')]?_[_0xac8a('0x1c')](_0x14db1f[_0xac8a('0x1b')],function(_0x99fb0c){return{'model':db[_0x99fb0c[_0xac8a('0x1a')]],'as':_0x99fb0c['as'],'attributes':_0x99fb0c[_0xac8a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xac8a('0x1d')](function(_0x3bb5c9){logger[_0xac8a('0xb')](_0xac8a('0x1e'),_0x16083c);logger['debug'](_0xac8a('0x1e'),_0x16083c,JSON['stringify'](_0x3bb5c9));_0x131f17(_0x3bb5c9);})[_0xac8a('0x1f')](function(_0xadd58){logger[_0xac8a('0x11')]('GetDynamics365Account',_0xadd58[_0xac8a('0x12')],_0x16083c);_0x587baa(_0x42fd53[_0xac8a('0x11')](0x1f4,_0xadd58[_0xac8a('0x12')]));});});};exports[_0xac8a('0x20')]=function(_0x27111b){var _0x3a59c6=this;return new Promise(function(_0x1a5a59,_0xafebd5){return db[_0xac8a('0x14')][_0xac8a('0x21')]({'raw':_0x27111b[_0xac8a('0x16')]?_0x27111b[_0xac8a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x27111b[_0xac8a('0x16')]?_0x27111b[_0xac8a('0x16')]['where']||null:null,'attributes':_0x27111b[_0xac8a('0x16')]?_0x27111b[_0xac8a('0x16')][_0xac8a('0x18')]||null:null,'include':_0x27111b['options']?_0x27111b['options']['include']?_[_0xac8a('0x1c')](_0x27111b[_0xac8a('0x16')]['include'],function(_0x16387e){return{'model':db[_0x16387e['model']],'as':_0x16387e['as'],'attributes':_0x16387e[_0xac8a('0x18')],'include':_0x16387e[_0xac8a('0x1b')]?_['map'](_0x16387e[_0xac8a('0x1b')],function(_0x224ece){return{'model':db[_0x224ece['model']],'as':_0x224ece['as'],'attributes':_0x224ece[_0xac8a('0x18')],'include':_0x224ece[_0xac8a('0x1b')]?_[_0xac8a('0x1c')](_0x224ece[_0xac8a('0x1b')],function(_0x4d8c97){return{'model':db[_0x4d8c97[_0xac8a('0x1a')]],'as':_0x4d8c97['as'],'attributes':_0x4d8c97[_0xac8a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xac8a('0x1d')](function(_0x3e2e3b){logger['info']('ShowDynamics365Account',_0x27111b);logger[_0xac8a('0xe')](_0xac8a('0x20'),_0x27111b,JSON[_0xac8a('0x10')](_0x3e2e3b));_0x1a5a59(_0x3e2e3b);})[_0xac8a('0x1f')](function(_0x2308e9){logger[_0xac8a('0x11')]('ShowDynamics365Account',_0x2308e9[_0xac8a('0x12')],_0x27111b);_0xafebd5(_0x3a59c6['error'](0x1f4,_0x2308e9['message']));});});}; \ No newline at end of file +var _0xe4e7=['jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','where','limit','include','map','model','GetDynamics365Account','stringify','ShowDynamics365Account','find','attributes','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4f0c71,_0xe1e8a){var _0x54a6e7=function(_0x146c9f){while(--_0x146c9f){_0x4f0c71['push'](_0x4f0c71['shift']());}};_0x54a6e7(++_0xe1e8a);}(_0xe4e7,0xc5));var _0x7e4e=function(_0x4ca40b,_0x531ba9){_0x4ca40b=_0x4ca40b-0x0;var _0x81cf70=_0xe4e7[_0x4ca40b];return _0x81cf70;};'use strict';var _=require('lodash');var util=require(_0x7e4e('0x0'));var moment=require('moment');var BPromise=require(_0x7e4e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e4e('0x2'));var db=require(_0x7e4e('0x3'))['db'];var utils=require(_0x7e4e('0x4'));var logger=require(_0x7e4e('0x5'))('rpc');var config=require(_0x7e4e('0x6'));var jayson=require(_0x7e4e('0x7'));var client=jayson[_0x7e4e('0x8')][_0x7e4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e3c00,_0x3acda0,_0xf34604){return new BPromise(function(_0xe07bd3,_0x52defe){return client[_0x7e4e('0xa')](_0x3e3c00,_0xf34604)[_0x7e4e('0xb')](function(_0x52b592){logger[_0x7e4e('0xc')](_0x7e4e('0xd'),_0x3acda0,_0x7e4e('0xe'));logger[_0x7e4e('0xf')](_0x7e4e('0x10'),_0x3acda0,_0x7e4e('0xe'),JSON['stringify'](_0x52b592));if(_0x52b592[_0x7e4e('0x11')]){if(_0x52b592[_0x7e4e('0x11')][_0x7e4e('0x12')]===0x1f4){logger[_0x7e4e('0x11')](_0x7e4e('0xd'),_0x3acda0,_0x52b592[_0x7e4e('0x11')][_0x7e4e('0x13')]);return _0x52defe(_0x52b592['error'][_0x7e4e('0x13')]);}logger['error'](_0x7e4e('0xd'),_0x3acda0,_0x52b592[_0x7e4e('0x11')][_0x7e4e('0x13')]);return _0xe07bd3(_0x52b592[_0x7e4e('0x11')][_0x7e4e('0x13')]);}else{logger[_0x7e4e('0xc')](_0x7e4e('0xd'),_0x3acda0,_0x7e4e('0xe'));_0xe07bd3(_0x52b592[_0x7e4e('0x14')][_0x7e4e('0x13')]);}})[_0x7e4e('0x15')](function(_0x294121){logger[_0x7e4e('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x3acda0,_0x294121);_0x52defe(_0x294121);});});}exports['GetDynamics365Account']=function(_0x2cfabc){var _0x95b92d=this;return new Promise(function(_0x3a9f03,_0x4c9078){return db['Dynamics365Account'][_0x7e4e('0x16')]({'raw':_0x2cfabc[_0x7e4e('0x17')]?_0x2cfabc[_0x7e4e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2cfabc[_0x7e4e('0x17')]?_0x2cfabc['options'][_0x7e4e('0x18')]||null:null,'attributes':_0x2cfabc[_0x7e4e('0x17')]?_0x2cfabc[_0x7e4e('0x17')]['attributes']||null:null,'limit':_0x2cfabc[_0x7e4e('0x17')]?_0x2cfabc[_0x7e4e('0x17')][_0x7e4e('0x19')]||null:null,'include':_0x2cfabc[_0x7e4e('0x17')]?_0x2cfabc[_0x7e4e('0x17')][_0x7e4e('0x1a')]?_[_0x7e4e('0x1b')](_0x2cfabc[_0x7e4e('0x17')]['include'],function(_0x15700e){return{'model':db[_0x15700e[_0x7e4e('0x1c')]],'as':_0x15700e['as'],'attributes':_0x15700e['attributes'],'include':_0x15700e[_0x7e4e('0x1a')]?_[_0x7e4e('0x1b')](_0x15700e[_0x7e4e('0x1a')],function(_0x6c98f){return{'model':db[_0x6c98f[_0x7e4e('0x1c')]],'as':_0x6c98f['as'],'attributes':_0x6c98f['attributes'],'include':_0x6c98f[_0x7e4e('0x1a')]?_[_0x7e4e('0x1b')](_0x6c98f[_0x7e4e('0x1a')],function(_0x8d5762){return{'model':db[_0x8d5762[_0x7e4e('0x1c')]],'as':_0x8d5762['as'],'attributes':_0x8d5762['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e4e('0xb')](function(_0x15d9a9){logger[_0x7e4e('0xc')](_0x7e4e('0x1d'),_0x2cfabc);logger[_0x7e4e('0xf')](_0x7e4e('0x1d'),_0x2cfabc,JSON[_0x7e4e('0x1e')](_0x15d9a9));_0x3a9f03(_0x15d9a9);})[_0x7e4e('0x15')](function(_0x1594cf){logger['error']('GetDynamics365Account',_0x1594cf[_0x7e4e('0x13')],_0x2cfabc);_0x4c9078(_0x95b92d[_0x7e4e('0x11')](0x1f4,_0x1594cf[_0x7e4e('0x13')]));});});};exports[_0x7e4e('0x1f')]=function(_0x255afe){var _0x5b78cb=this;return new Promise(function(_0x1ab721,_0x20fd3d){return db['Dynamics365Account'][_0x7e4e('0x20')]({'raw':_0x255afe[_0x7e4e('0x17')]?_0x255afe[_0x7e4e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x255afe[_0x7e4e('0x17')]?_0x255afe[_0x7e4e('0x17')][_0x7e4e('0x18')]||null:null,'attributes':_0x255afe[_0x7e4e('0x17')]?_0x255afe[_0x7e4e('0x17')][_0x7e4e('0x21')]||null:null,'include':_0x255afe[_0x7e4e('0x17')]?_0x255afe[_0x7e4e('0x17')][_0x7e4e('0x1a')]?_[_0x7e4e('0x1b')](_0x255afe[_0x7e4e('0x17')][_0x7e4e('0x1a')],function(_0x8afb31){return{'model':db[_0x8afb31[_0x7e4e('0x1c')]],'as':_0x8afb31['as'],'attributes':_0x8afb31['attributes'],'include':_0x8afb31[_0x7e4e('0x1a')]?_[_0x7e4e('0x1b')](_0x8afb31['include'],function(_0x5858d7){return{'model':db[_0x5858d7[_0x7e4e('0x1c')]],'as':_0x5858d7['as'],'attributes':_0x5858d7[_0x7e4e('0x21')],'include':_0x5858d7['include']?_[_0x7e4e('0x1b')](_0x5858d7[_0x7e4e('0x1a')],function(_0x59ea93){return{'model':db[_0x59ea93[_0x7e4e('0x1c')]],'as':_0x59ea93['as'],'attributes':_0x59ea93[_0x7e4e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f1fd1){logger[_0x7e4e('0xc')]('ShowDynamics365Account',_0x255afe);logger['debug']('ShowDynamics365Account',_0x255afe,JSON[_0x7e4e('0x1e')](_0x3f1fd1));_0x1ab721(_0x3f1fd1);})[_0x7e4e('0x15')](function(_0x4a4c20){logger[_0x7e4e('0x11')](_0x7e4e('0x1f'),_0x4a4c20[_0x7e4e('0x13')],_0x255afe);_0x20fd3d(_0x5b78cb['error'](0x1f4,_0x4a4c20[_0x7e4e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 2180ddb..889bc2a 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 _0xa9e2=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','/:id'];(function(_0x45772a,_0x1c4bfa){var _0x2cb69e=function(_0x285bb0){while(--_0x285bb0){_0x45772a['push'](_0x45772a['shift']());}};_0x2cb69e(++_0x1c4bfa);}(_0xa9e2,0xc0));var _0x2a9e=function(_0x3145d7,_0x250c96){_0x3145d7=_0x3145d7-0x0;var _0x1783b4=_0xa9e2[_0x3145d7];return _0x1783b4;};'use strict';var multer=require(_0x2a9e('0x0'));var util=require(_0x2a9e('0x1'));var path=require(_0x2a9e('0x2'));var timeout=require(_0x2a9e('0x3'));var express=require('express');var router=express[_0x2a9e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2a9e('0x5'));var config=require('../../config/environment');var controller=require(_0x2a9e('0x6'));router[_0x2a9e('0x7')]('/',auth[_0x2a9e('0x8')](),controller[_0x2a9e('0x9')]);router[_0x2a9e('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2a9e('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2a9e('0xa')]);router[_0x2a9e('0x7')](_0x2a9e('0xb'),auth[_0x2a9e('0x8')](),controller['getSubjects']);router[_0x2a9e('0x7')](_0x2a9e('0xc'),auth[_0x2a9e('0x8')](),controller[_0x2a9e('0xd')]);router[_0x2a9e('0xe')]('/',auth[_0x2a9e('0x8')](),controller['create']);router[_0x2a9e('0xf')](_0x2a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2a9e('0x8')](),controller[_0x2a9e('0x11')]);module[_0x2a9e('0x12')]=router; \ No newline at end of file +var _0x95e0=['Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','post','create','put','/:id','update','delete','exports','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95e0,0x163));var _0x095e=function(_0x2c74d6,_0x4e36d2){_0x2c74d6=_0x2c74d6-0x0;var _0x26ed8b=_0x95e0[_0x2c74d6];return _0x26ed8b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x095e('0x0'));var timeout=require('connect-timeout');var express=require(_0x095e('0x1'));var router=express[_0x095e('0x2')]();var fs_extra=require(_0x095e('0x3'));var auth=require(_0x095e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x095e('0x5'));var controller=require(_0x095e('0x6'));router[_0x095e('0x7')]('/',auth[_0x095e('0x8')](),controller[_0x095e('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x095e('0xa')]);router[_0x095e('0x7')]('/:id/fields',auth[_0x095e('0x8')](),controller[_0x095e('0xb')]);router[_0x095e('0x7')](_0x095e('0xc'),auth[_0x095e('0x8')](),controller[_0x095e('0xd')]);router['get']('/:id/descriptions',auth[_0x095e('0x8')](),controller['getDescriptions']);router[_0x095e('0xe')]('/',auth[_0x095e('0x8')](),controller[_0x095e('0xf')]);router[_0x095e('0x10')](_0x095e('0x11'),auth[_0x095e('0x8')](),controller[_0x095e('0x12')]);router[_0x095e('0x13')](_0x095e('0x11'),auth[_0x095e('0x8')](),controller['destroy']);module[_0x095e('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 3176257..3a5c425 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 _0xed85=['STRING','incident','phonecall','ENUM','contact','BOOLEAN','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xed85,0x136));var _0x5ed8=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0xed85[_0x4653f7];return _0x5454da;};'use strict';var Sequelize=require(_0x5ed8('0x0'));module[_0x5ed8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5ed8('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x5ed8('0x3'),_0x5ed8('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x5ed8('0x5')](_0x5ed8('0x6'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x5ed8('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x5ed8('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb26c=['BOOLEAN','sequelize','exports','STRING','ENUM','contact','nothing'];(function(_0x81d993,_0x5343e4){var _0x509df3=function(_0x13ccbf){while(--_0x13ccbf){_0x81d993['push'](_0x81d993['shift']());}};_0x509df3(++_0x5343e4);}(_0xb26c,0x94));var _0xcb26=function(_0x2804b4,_0x264e7f){_0x2804b4=_0x2804b4-0x0;var _0x174786=_0xb26c[_0x2804b4];return _0x174786;};'use strict';var Sequelize=require(_0xcb26('0x0'));module[_0xcb26('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcb26('0x2')]},'ticketType':{'type':Sequelize[_0xcb26('0x3')]('incident','phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xcb26('0x3')](_0xcb26('0x4'),_0xcb26('0x5')),'defaultValue':_0xcb26('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xcb26('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xcb26('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index a9bad3b..57bf915 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 _0xc6c2=['limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','include','findAll','rows','show','params','rawAttributes','fields','length','includeAll','find','create','body','catch','getFields','findOne','Dynamics365Field','nolimit','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3d1ae3,_0x43c01b){var _0x227d59=function(_0x28e966){while(--_0x28e966){_0x3d1ae3['push'](_0x3d1ae3['shift']());}};_0x227d59(++_0x43c01b);}(_0xc6c2,0xcf));var _0x2c6c=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xc6c2[_0x424357];return _0x29c68e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2c6c('0x0'));var rp=require(_0x2c6c('0x1'));var moment=require(_0x2c6c('0x2'));var BPromise=require(_0x2c6c('0x3'));var Mustache=require('mustache');var util=require(_0x2c6c('0x4'));var path=require(_0x2c6c('0x5'));var sox=require('sox');var csv=require(_0x2c6c('0x6'));var ejs=require(_0x2c6c('0x7'));var fs=require('fs');var fs_extra=require(_0x2c6c('0x8'));var _=require(_0x2c6c('0x9'));var squel=require(_0x2c6c('0xa'));var crypto=require(_0x2c6c('0xb'));var jsforce=require(_0x2c6c('0xc'));var deskjs=require(_0x2c6c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2c6c('0xe'));var Papa=require('papaparse');var Redis=require(_0x2c6c('0xf'));var authService=require(_0x2c6c('0x10'));var qs=require(_0x2c6c('0x11'));var as=require(_0x2c6c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2c6c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c6c('0x14'))['db'];function respondWithStatusCode(_0x303e0b,_0x1bda4c){_0x1bda4c=_0x1bda4c||0xcc;return function(_0x1f7c3c){if(_0x1f7c3c){return _0x303e0b[_0x2c6c('0x15')](_0x1bda4c);}return _0x303e0b[_0x2c6c('0x16')](_0x1bda4c)[_0x2c6c('0x17')]();};}function respondWithResult(_0x2303e2,_0x4731ee){_0x4731ee=_0x4731ee||0xc8;return function(_0x270782){if(_0x270782){return _0x2303e2[_0x2c6c('0x16')](_0x4731ee)[_0x2c6c('0x18')](_0x270782);}};}function respondWithFilteredResult(_0xc009f5,_0x3ca731){return function(_0x3d61f1){if(_0x3d61f1){var _0x435f90=typeof _0x3ca731[_0x2c6c('0x19')]===_0x2c6c('0x1a')&&typeof _0x3ca731[_0x2c6c('0x1b')]===_0x2c6c('0x1a');var _0x22225a=_0x3d61f1[_0x2c6c('0x1c')];var _0x12ed6c=_0x435f90?0x0:_0x3ca731[_0x2c6c('0x19')];var _0x25c602=_0x435f90?_0x3d61f1['count']:_0x3ca731[_0x2c6c('0x19')]+_0x3ca731[_0x2c6c('0x1b')];var _0x4ea03b;if(_0x25c602>=_0x22225a){_0x25c602=_0x22225a;_0x4ea03b=0xc8;}else{_0x4ea03b=0xce;}_0xc009f5[_0x2c6c('0x16')](_0x4ea03b);return _0xc009f5[_0x2c6c('0x1d')](_0x2c6c('0x1e'),_0x12ed6c+'-'+_0x25c602+'/'+_0x22225a)[_0x2c6c('0x18')](_0x3d61f1);}return null;};}function patchUpdates(_0x3e7d83){return function(_0x2c595d){try{jsonpatch['apply'](_0x2c595d,_0x3e7d83,!![]);}catch(_0xf52b29){return BPromise[_0x2c6c('0x1f')](_0xf52b29);}return _0x2c595d[_0x2c6c('0x20')]();};}function saveUpdates(_0x37c6eb,_0x336e6a){return function(_0x152e5c){if(_0x152e5c){return _0x152e5c['update'](_0x37c6eb)[_0x2c6c('0x21')](function(_0x1f78f7){return _0x1f78f7;});}return null;};}function removeEntity(_0x3d7023,_0x22dc40){return function(_0x27f582){if(_0x27f582){return _0x27f582[_0x2c6c('0x22')]()[_0x2c6c('0x21')](function(){_0x3d7023['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x323b68,_0x3def33){return function(_0x41cd49){if(!_0x41cd49){_0x323b68[_0x2c6c('0x15')](0x194);}return _0x41cd49;};}function handleError(_0x36cf58,_0x29e3dd){_0x29e3dd=_0x29e3dd||0x1f4;return function(_0x55dc1b){logger[_0x2c6c('0x23')](_0x55dc1b[_0x2c6c('0x24')]);if(_0x55dc1b[_0x2c6c('0x25')]){delete _0x55dc1b[_0x2c6c('0x25')];}_0x36cf58[_0x2c6c('0x16')](_0x29e3dd)[_0x2c6c('0x26')](_0x55dc1b);};}exports[_0x2c6c('0x27')]=function(_0x5c15d3,_0x20de81){var _0x5b512a={},_0x4f9510={},_0x15a7f6={'count':0x0,'rows':[]};var _0x2b7012=_[_0x2c6c('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0x25438b){return{'name':_0x25438b[_0x2c6c('0x29')],'type':_0x25438b[_0x2c6c('0x2a')]['key']};});_0x4f9510[_0x2c6c('0x2b')]=_[_0x2c6c('0x28')](_0x2b7012,_0x2c6c('0x25'));_0x4f9510[_0x2c6c('0x2c')]=_[_0x2c6c('0x2d')](_0x5c15d3[_0x2c6c('0x2c')]);_0x4f9510[_0x2c6c('0x2e')]=_[_0x2c6c('0x2f')](_0x4f9510['model'],_0x4f9510[_0x2c6c('0x2c')]);_0x5b512a[_0x2c6c('0x30')]=_[_0x2c6c('0x2f')](_0x4f9510[_0x2c6c('0x2b')],qs['fields'](_0x5c15d3[_0x2c6c('0x2c')]['fields']));_0x5b512a[_0x2c6c('0x30')]=_0x5b512a[_0x2c6c('0x30')]['length']?_0x5b512a[_0x2c6c('0x30')]:_0x4f9510[_0x2c6c('0x2b')];if(!_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x31')]('nolimit')){_0x5b512a[_0x2c6c('0x1b')]=qs['limit'](_0x5c15d3[_0x2c6c('0x2c')]['limit']);_0x5b512a[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x5c15d3[_0x2c6c('0x2c')]['offset']);}_0x5b512a[_0x2c6c('0x32')]=qs['sort'](_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x33')]);_0x5b512a[_0x2c6c('0x34')]=qs['filters'](_[_0x2c6c('0x35')](_0x5c15d3['query'],_0x4f9510[_0x2c6c('0x2e')]),_0x2b7012);if(_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x5b512a[_0x2c6c('0x34')]=_[_0x2c6c('0x37')](_0x5b512a[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x2b7012,function(_0x584e02){if(_0x584e02[_0x2c6c('0x2a')]!==_0x2c6c('0x38')){var _0x3c0460={};_0x3c0460[_0x584e02[_0x2c6c('0x25')]]={'$like':'%'+_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x36')]+'%'};return _0x3c0460;}})});}_0x5b512a=_[_0x2c6c('0x37')]({},_0x5b512a,_0x5c15d3[_0x2c6c('0x39')]);var _0x3a40a9={'where':_0x5b512a[_0x2c6c('0x34')]};return db[_0x2c6c('0x3a')][_0x2c6c('0x1c')](_0x3a40a9)[_0x2c6c('0x21')](function(_0x47634c){_0x15a7f6[_0x2c6c('0x1c')]=_0x47634c;if(_0x5c15d3[_0x2c6c('0x2c')]['includeAll']){_0x5b512a[_0x2c6c('0x3b')]=[{'all':!![]}];}return db[_0x2c6c('0x3a')][_0x2c6c('0x3c')](_0x5b512a);})[_0x2c6c('0x21')](function(_0x31b2a4){_0x15a7f6[_0x2c6c('0x3d')]=_0x31b2a4;return _0x15a7f6;})[_0x2c6c('0x21')](respondWithFilteredResult(_0x20de81,_0x5b512a))['catch'](handleError(_0x20de81,null));};exports[_0x2c6c('0x3e')]=function(_0xb64abb,_0x5a7214){var _0x4f7dbd={'raw':![],'where':{'id':_0xb64abb[_0x2c6c('0x3f')]['id']}},_0x33097c={};_0x33097c[_0x2c6c('0x2b')]=_[_0x2c6c('0x2d')](db[_0x2c6c('0x3a')][_0x2c6c('0x40')]);_0x33097c[_0x2c6c('0x2c')]=_['keys'](_0xb64abb[_0x2c6c('0x2c')]);_0x33097c['filters']=_[_0x2c6c('0x2f')](_0x33097c['model'],_0x33097c['query']);_0x4f7dbd[_0x2c6c('0x30')]=_[_0x2c6c('0x2f')](_0x33097c[_0x2c6c('0x2b')],qs[_0x2c6c('0x41')](_0xb64abb[_0x2c6c('0x2c')][_0x2c6c('0x41')]));_0x4f7dbd[_0x2c6c('0x30')]=_0x4f7dbd['attributes'][_0x2c6c('0x42')]?_0x4f7dbd[_0x2c6c('0x30')]:_0x33097c[_0x2c6c('0x2b')];if(_0xb64abb[_0x2c6c('0x2c')][_0x2c6c('0x43')]){_0x4f7dbd[_0x2c6c('0x3b')]=[{'all':!![]}];}_0x4f7dbd=_[_0x2c6c('0x37')]({},_0x4f7dbd,_0xb64abb[_0x2c6c('0x39')]);return db[_0x2c6c('0x3a')][_0x2c6c('0x44')](_0x4f7dbd)[_0x2c6c('0x21')](handleEntityNotFound(_0x5a7214,null))[_0x2c6c('0x21')](respondWithResult(_0x5a7214,null))['catch'](handleError(_0x5a7214,null));};exports['create']=function(_0x199c03,_0x58c8a3){return db['Dynamics365Configuration'][_0x2c6c('0x45')](_0x199c03[_0x2c6c('0x46')],{})[_0x2c6c('0x21')](respondWithResult(_0x58c8a3,0xc9))[_0x2c6c('0x47')](handleError(_0x58c8a3,null));};exports['update']=function(_0x475e51,_0x1e9efa){if(_0x475e51[_0x2c6c('0x46')]['id']){delete _0x475e51[_0x2c6c('0x46')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x475e51['params']['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x1e9efa,null))[_0x2c6c('0x21')](saveUpdates(_0x475e51['body'],null))[_0x2c6c('0x21')](respondWithResult(_0x1e9efa,null))['catch'](handleError(_0x1e9efa,null));};exports[_0x2c6c('0x22')]=function(_0x340141,_0x3ae14a){return db[_0x2c6c('0x3a')][_0x2c6c('0x44')]({'where':{'id':_0x340141['params']['id']}})['then'](handleEntityNotFound(_0x3ae14a,null))[_0x2c6c('0x21')](removeEntity(_0x3ae14a,null))[_0x2c6c('0x47')](handleError(_0x3ae14a,null));};exports[_0x2c6c('0x48')]=function(_0x37933d,_0x576418,_0x31bd9f){var _0x2084c0={};var _0x3ae22e={};var _0x273366;var _0x5725ee;return db[_0x2c6c('0x3a')][_0x2c6c('0x49')]({'where':{'id':_0x37933d['params']['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x576418,null))[_0x2c6c('0x21')](function(_0x339bf0){if(_0x339bf0){_0x273366=_0x339bf0;_0x3ae22e[_0x2c6c('0x2b')]=_[_0x2c6c('0x2d')](db[_0x2c6c('0x4a')][_0x2c6c('0x40')]);_0x3ae22e[_0x2c6c('0x2c')]=_['keys'](_0x37933d[_0x2c6c('0x2c')]);_0x3ae22e['filters']=_[_0x2c6c('0x2f')](_0x3ae22e[_0x2c6c('0x2b')],_0x3ae22e[_0x2c6c('0x2c')]);_0x2084c0[_0x2c6c('0x30')]=_['intersection'](_0x3ae22e[_0x2c6c('0x2b')],qs[_0x2c6c('0x41')](_0x37933d[_0x2c6c('0x2c')]['fields']));_0x2084c0[_0x2c6c('0x30')]=_0x2084c0[_0x2c6c('0x30')][_0x2c6c('0x42')]?_0x2084c0[_0x2c6c('0x30')]:_0x3ae22e[_0x2c6c('0x2b')];_0x2084c0['order']=qs[_0x2c6c('0x33')](_0x37933d[_0x2c6c('0x2c')][_0x2c6c('0x33')]);_0x2084c0['where']=qs[_0x2c6c('0x2e')](_[_0x2c6c('0x35')](_0x37933d['query'],_0x3ae22e[_0x2c6c('0x2e')]));if(_0x37933d[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x2084c0[_0x2c6c('0x34')]=_[_0x2c6c('0x37')](_0x2084c0[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x2084c0[_0x2c6c('0x30')],function(_0x20444e){var _0x4f240d={};_0x4f240d[_0x20444e]={'$like':'%'+_0x37933d['query']['filter']+'%'};return _0x4f240d;})});}_0x2084c0=_[_0x2c6c('0x37')]({},_0x2084c0,_0x37933d[_0x2c6c('0x39')]);return _0x273366[_0x2c6c('0x48')](_0x2084c0);}})[_0x2c6c('0x21')](function(_0x3d9111){if(_0x3d9111){_0x5725ee=_0x3d9111[_0x2c6c('0x42')];if(!_0x37933d['query'][_0x2c6c('0x31')](_0x2c6c('0x4b'))){_0x2084c0[_0x2c6c('0x1b')]=qs[_0x2c6c('0x1b')](_0x37933d[_0x2c6c('0x2c')][_0x2c6c('0x1b')]);_0x2084c0[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x37933d[_0x2c6c('0x2c')]['offset']);}return _0x273366[_0x2c6c('0x48')](_0x2084c0);}})[_0x2c6c('0x21')](function(_0x1c3a43){if(_0x1c3a43){return _0x1c3a43?{'count':_0x5725ee,'rows':_0x1c3a43}:null;}})['then'](respondWithResult(_0x576418,null))[_0x2c6c('0x47')](handleError(_0x576418,null));};exports['getSubjects']=function(_0x4159e4,_0x1d3d48,_0x265bb8){var _0x289b2f={};var _0x165b74={};var _0x4b2846;var _0x4401bf;return db[_0x2c6c('0x3a')][_0x2c6c('0x49')]({'where':{'id':_0x4159e4['params']['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x1d3d48,null))[_0x2c6c('0x21')](function(_0x1266b4){if(_0x1266b4){_0x4b2846=_0x1266b4;_0x165b74['model']=_[_0x2c6c('0x2d')](db[_0x2c6c('0x4a')][_0x2c6c('0x40')]);_0x165b74[_0x2c6c('0x2c')]=_[_0x2c6c('0x2d')](_0x4159e4[_0x2c6c('0x2c')]);_0x165b74[_0x2c6c('0x2e')]=_['intersection'](_0x165b74[_0x2c6c('0x2b')],_0x165b74['query']);_0x289b2f[_0x2c6c('0x30')]=_[_0x2c6c('0x2f')](_0x165b74['model'],qs[_0x2c6c('0x41')](_0x4159e4['query'][_0x2c6c('0x41')]));_0x289b2f[_0x2c6c('0x30')]=_0x289b2f['attributes'][_0x2c6c('0x42')]?_0x289b2f['attributes']:_0x165b74['model'];_0x289b2f[_0x2c6c('0x32')]=qs[_0x2c6c('0x33')](_0x4159e4['query']['sort']);_0x289b2f[_0x2c6c('0x34')]=qs['filters'](_['pick'](_0x4159e4[_0x2c6c('0x2c')],_0x165b74['filters']));if(_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x289b2f[_0x2c6c('0x34')]=_[_0x2c6c('0x37')](_0x289b2f[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x289b2f[_0x2c6c('0x30')],function(_0x157935){var _0x4f2e8e={};_0x4f2e8e[_0x157935]={'$like':'%'+_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x36')]+'%'};return _0x4f2e8e;})});}_0x289b2f=_[_0x2c6c('0x37')]({},_0x289b2f,_0x4159e4['options']);return _0x4b2846[_0x2c6c('0x4c')](_0x289b2f);}})[_0x2c6c('0x21')](function(_0xb691e0){if(_0xb691e0){_0x4401bf=_0xb691e0[_0x2c6c('0x42')];if(!_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x31')](_0x2c6c('0x4b'))){_0x289b2f['limit']=qs[_0x2c6c('0x1b')](_0x4159e4[_0x2c6c('0x2c')]['limit']);_0x289b2f[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x19')]);}return _0x4b2846[_0x2c6c('0x4c')](_0x289b2f);}})[_0x2c6c('0x21')](function(_0x3d8cec){if(_0x3d8cec){return _0x3d8cec?{'count':_0x4401bf,'rows':_0x3d8cec}:null;}})['then'](respondWithResult(_0x1d3d48,null))[_0x2c6c('0x47')](handleError(_0x1d3d48,null));};exports[_0x2c6c('0x4d')]=function(_0x10889d,_0x44bbdb,_0x372918){var _0x277d99={};var _0x574884={};var _0xe0bb60;var _0x3e1587;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x10889d[_0x2c6c('0x3f')]['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x44bbdb,null))[_0x2c6c('0x21')](function(_0x8dcd34){if(_0x8dcd34){_0xe0bb60=_0x8dcd34;_0x574884[_0x2c6c('0x2b')]=_[_0x2c6c('0x2d')](db['Dynamics365Field'][_0x2c6c('0x40')]);_0x574884['query']=_[_0x2c6c('0x2d')](_0x10889d[_0x2c6c('0x2c')]);_0x574884[_0x2c6c('0x2e')]=_[_0x2c6c('0x2f')](_0x574884[_0x2c6c('0x2b')],_0x574884[_0x2c6c('0x2c')]);_0x277d99[_0x2c6c('0x30')]=_['intersection'](_0x574884[_0x2c6c('0x2b')],qs[_0x2c6c('0x41')](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x41')]));_0x277d99['attributes']=_0x277d99['attributes'][_0x2c6c('0x42')]?_0x277d99[_0x2c6c('0x30')]:_0x574884[_0x2c6c('0x2b')];_0x277d99['order']=qs['sort'](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x33')]);_0x277d99['where']=qs[_0x2c6c('0x2e')](_[_0x2c6c('0x35')](_0x10889d['query'],_0x574884[_0x2c6c('0x2e')]));if(_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x277d99[_0x2c6c('0x34')]=_['merge'](_0x277d99[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x277d99[_0x2c6c('0x30')],function(_0x4b2d37){var _0x4c76fd={};_0x4c76fd[_0x4b2d37]={'$like':'%'+_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x36')]+'%'};return _0x4c76fd;})});}_0x277d99=_[_0x2c6c('0x37')]({},_0x277d99,_0x10889d['options']);return _0xe0bb60[_0x2c6c('0x4d')](_0x277d99);}})['then'](function(_0x177a29){if(_0x177a29){_0x3e1587=_0x177a29[_0x2c6c('0x42')];if(!_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x31')](_0x2c6c('0x4b'))){_0x277d99[_0x2c6c('0x1b')]=qs[_0x2c6c('0x1b')](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x1b')]);_0x277d99[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x19')]);}return _0xe0bb60['getDescriptions'](_0x277d99);}})[_0x2c6c('0x21')](function(_0xa637e4){if(_0xa637e4){return _0xa637e4?{'count':_0x3e1587,'rows':_0xa637e4}:null;}})['then'](respondWithResult(_0x44bbdb,null))[_0x2c6c('0x47')](handleError(_0x44bbdb,null));}; \ No newline at end of file +var _0x9c44=['apply','reject','then','destroy','end','stack','name','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','Dynamics365Configuration','includeAll','rows','catch','show','params','find','create','body','update','getFields','findOne','nolimit','getSubjects','getDescriptions','Dynamics365Field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x56c370,_0x51f131){var _0x4b990d=function(_0x2b1ec4){while(--_0x2b1ec4){_0x56c370['push'](_0x56c370['shift']());}};_0x4b990d(++_0x51f131);}(_0x9c44,0x1a3));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x49c4('0x0'));var rimraf=require(_0x49c4('0x1'));var zipdir=require(_0x49c4('0x2'));var jsonpatch=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x49c4('0x5'));var util=require(_0x49c4('0x6'));var path=require(_0x49c4('0x7'));var sox=require(_0x49c4('0x8'));var csv=require(_0x49c4('0x9'));var ejs=require(_0x49c4('0xa'));var fs=require('fs');var fs_extra=require(_0x49c4('0xb'));var _=require(_0x49c4('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x49c4('0x9'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require(_0x49c4('0xf'));var authService=require(_0x49c4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x49c4('0x11'));var hardwareService=require(_0x49c4('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x49c4('0x13'));var config=require(_0x49c4('0x14'));var licenseUtil=require(_0x49c4('0x15'));var db=require(_0x49c4('0x16'))['db'];function respondWithStatusCode(_0xe0a311,_0x2b5394){_0x2b5394=_0x2b5394||0xcc;return function(_0x27da42){if(_0x27da42){return _0xe0a311['sendStatus'](_0x2b5394);}return _0xe0a311[_0x49c4('0x17')](_0x2b5394)['end']();};}function respondWithResult(_0xd82056,_0x5e146d){_0x5e146d=_0x5e146d||0xc8;return function(_0x6d59e7){if(_0x6d59e7){return _0xd82056[_0x49c4('0x17')](_0x5e146d)[_0x49c4('0x18')](_0x6d59e7);}};}function respondWithFilteredResult(_0x54ed60,_0x2b4b47){return function(_0x5d6bb5){if(_0x5d6bb5){var _0x53d3bd=typeof _0x2b4b47[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x2b4b47[_0x49c4('0x1b')]===_0x49c4('0x1a');var _0x1fc3f8=_0x5d6bb5[_0x49c4('0x1c')];var _0x3ceeea=_0x53d3bd?0x0:_0x2b4b47[_0x49c4('0x19')];var _0x53c8a4=_0x53d3bd?_0x5d6bb5['count']:_0x2b4b47[_0x49c4('0x19')]+_0x2b4b47[_0x49c4('0x1b')];var _0x3e0e2e;if(_0x53c8a4>=_0x1fc3f8){_0x53c8a4=_0x1fc3f8;_0x3e0e2e=0xc8;}else{_0x3e0e2e=0xce;}_0x54ed60[_0x49c4('0x17')](_0x3e0e2e);return _0x54ed60[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x3ceeea+'-'+_0x53c8a4+'/'+_0x1fc3f8)[_0x49c4('0x18')](_0x5d6bb5);}return null;};}function patchUpdates(_0x347af5){return function(_0x2417e9){try{jsonpatch[_0x49c4('0x1f')](_0x2417e9,_0x347af5,!![]);}catch(_0x5093ae){return BPromise[_0x49c4('0x20')](_0x5093ae);}return _0x2417e9['save']();};}function saveUpdates(_0x42e9c4,_0x3a5b41){return function(_0x3c0b27){if(_0x3c0b27){return _0x3c0b27['update'](_0x42e9c4)[_0x49c4('0x21')](function(_0x498506){return _0x498506;});}return null;};}function removeEntity(_0x46b0ca,_0x15f65f){return function(_0x54e8fa){if(_0x54e8fa){return _0x54e8fa[_0x49c4('0x22')]()['then'](function(){_0x46b0ca['status'](0xcc)[_0x49c4('0x23')]();});}};}function handleEntityNotFound(_0x26957c,_0xe467f4){return function(_0xe20df){if(!_0xe20df){_0x26957c['sendStatus'](0x194);}return _0xe20df;};}function handleError(_0x5a4740,_0x5a7a2b){_0x5a7a2b=_0x5a7a2b||0x1f4;return function(_0x583d68){logger['error'](_0x583d68[_0x49c4('0x24')]);if(_0x583d68[_0x49c4('0x25')]){delete _0x583d68[_0x49c4('0x25')];}_0x5a4740[_0x49c4('0x17')](_0x5a7a2b)['send'](_0x583d68);};}exports['index']=function(_0x4464d3,_0x23f4a1){var _0x3b5734={},_0x2892b6={},_0x58bc9b={'count':0x0,'rows':[]};var _0x31b90c=_[_0x49c4('0x26')](db['Dynamics365Configuration'][_0x49c4('0x27')],function(_0x581508){return{'name':_0x581508['fieldName'],'type':_0x581508[_0x49c4('0x28')][_0x49c4('0x29')]};});_0x2892b6['model']=_[_0x49c4('0x26')](_0x31b90c,_0x49c4('0x25'));_0x2892b6['query']=_[_0x49c4('0x2a')](_0x4464d3[_0x49c4('0x2b')]);_0x2892b6[_0x49c4('0x2c')]=_[_0x49c4('0x2d')](_0x2892b6[_0x49c4('0x2e')],_0x2892b6[_0x49c4('0x2b')]);_0x3b5734[_0x49c4('0x2f')]=_[_0x49c4('0x2d')](_0x2892b6['model'],qs[_0x49c4('0x30')](_0x4464d3[_0x49c4('0x2b')][_0x49c4('0x30')]));_0x3b5734[_0x49c4('0x2f')]=_0x3b5734[_0x49c4('0x2f')][_0x49c4('0x31')]?_0x3b5734[_0x49c4('0x2f')]:_0x2892b6['model'];if(!_0x4464d3['query'][_0x49c4('0x32')]('nolimit')){_0x3b5734[_0x49c4('0x1b')]=qs[_0x49c4('0x1b')](_0x4464d3['query'][_0x49c4('0x1b')]);_0x3b5734[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x4464d3[_0x49c4('0x2b')][_0x49c4('0x19')]);}_0x3b5734[_0x49c4('0x33')]=qs[_0x49c4('0x34')](_0x4464d3['query'][_0x49c4('0x34')]);_0x3b5734[_0x49c4('0x35')]=qs[_0x49c4('0x2c')](_[_0x49c4('0x36')](_0x4464d3[_0x49c4('0x2b')],_0x2892b6[_0x49c4('0x2c')]),_0x31b90c);if(_0x4464d3[_0x49c4('0x2b')][_0x49c4('0x37')]){_0x3b5734[_0x49c4('0x35')]=_['merge'](_0x3b5734[_0x49c4('0x35')],{'$or':_[_0x49c4('0x26')](_0x31b90c,function(_0x598a45){if(_0x598a45[_0x49c4('0x28')]!==_0x49c4('0x38')){var _0x226e97={};_0x226e97[_0x598a45['name']]={'$like':'%'+_0x4464d3[_0x49c4('0x2b')][_0x49c4('0x37')]+'%'};return _0x226e97;}})});}_0x3b5734=_[_0x49c4('0x39')]({},_0x3b5734,_0x4464d3[_0x49c4('0x3a')]);var _0x12a5ea={'where':_0x3b5734[_0x49c4('0x35')]};return db[_0x49c4('0x3b')][_0x49c4('0x1c')](_0x12a5ea)[_0x49c4('0x21')](function(_0x586df){_0x58bc9b[_0x49c4('0x1c')]=_0x586df;if(_0x4464d3[_0x49c4('0x2b')][_0x49c4('0x3c')]){_0x3b5734['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x3b5734);})[_0x49c4('0x21')](function(_0x44e35e){_0x58bc9b[_0x49c4('0x3d')]=_0x44e35e;return _0x58bc9b;})[_0x49c4('0x21')](respondWithFilteredResult(_0x23f4a1,_0x3b5734))[_0x49c4('0x3e')](handleError(_0x23f4a1,null));};exports[_0x49c4('0x3f')]=function(_0x254956,_0xbfbabf){var _0x58681b={'raw':![],'where':{'id':_0x254956[_0x49c4('0x40')]['id']}},_0x22d2e9={};_0x22d2e9[_0x49c4('0x2e')]=_[_0x49c4('0x2a')](db['Dynamics365Configuration'][_0x49c4('0x27')]);_0x22d2e9[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x254956[_0x49c4('0x2b')]);_0x22d2e9['filters']=_['intersection'](_0x22d2e9['model'],_0x22d2e9['query']);_0x58681b['attributes']=_['intersection'](_0x22d2e9[_0x49c4('0x2e')],qs[_0x49c4('0x30')](_0x254956[_0x49c4('0x2b')][_0x49c4('0x30')]));_0x58681b[_0x49c4('0x2f')]=_0x58681b[_0x49c4('0x2f')][_0x49c4('0x31')]?_0x58681b[_0x49c4('0x2f')]:_0x22d2e9['model'];if(_0x254956[_0x49c4('0x2b')][_0x49c4('0x3c')]){_0x58681b['include']=[{'all':!![]}];}_0x58681b=_[_0x49c4('0x39')]({},_0x58681b,_0x254956[_0x49c4('0x3a')]);return db[_0x49c4('0x3b')][_0x49c4('0x41')](_0x58681b)['then'](handleEntityNotFound(_0xbfbabf,null))['then'](respondWithResult(_0xbfbabf,null))[_0x49c4('0x3e')](handleError(_0xbfbabf,null));};exports[_0x49c4('0x42')]=function(_0x58ed0d,_0x156002){return db[_0x49c4('0x3b')]['create'](_0x58ed0d[_0x49c4('0x43')],{})[_0x49c4('0x21')](respondWithResult(_0x156002,0xc9))[_0x49c4('0x3e')](handleError(_0x156002,null));};exports[_0x49c4('0x44')]=function(_0x4518f2,_0x481891){if(_0x4518f2[_0x49c4('0x43')]['id']){delete _0x4518f2[_0x49c4('0x43')]['id'];}return db[_0x49c4('0x3b')][_0x49c4('0x41')]({'where':{'id':_0x4518f2[_0x49c4('0x40')]['id']}})[_0x49c4('0x21')](handleEntityNotFound(_0x481891,null))[_0x49c4('0x21')](saveUpdates(_0x4518f2[_0x49c4('0x43')],null))[_0x49c4('0x21')](respondWithResult(_0x481891,null))[_0x49c4('0x3e')](handleError(_0x481891,null));};exports[_0x49c4('0x22')]=function(_0x22f370,_0x3849c3){return db[_0x49c4('0x3b')][_0x49c4('0x41')]({'where':{'id':_0x22f370[_0x49c4('0x40')]['id']}})[_0x49c4('0x21')](handleEntityNotFound(_0x3849c3,null))['then'](removeEntity(_0x3849c3,null))[_0x49c4('0x3e')](handleError(_0x3849c3,null));};exports[_0x49c4('0x45')]=function(_0x39405e,_0x1bcb07,_0x7765e4){var _0x5d35aa={};var _0x33707e={};var _0x14b8a6;var _0x48c41b;return db[_0x49c4('0x3b')][_0x49c4('0x46')]({'where':{'id':_0x39405e[_0x49c4('0x40')]['id']}})[_0x49c4('0x21')](handleEntityNotFound(_0x1bcb07,null))[_0x49c4('0x21')](function(_0x52c8dd){if(_0x52c8dd){_0x14b8a6=_0x52c8dd;_0x33707e[_0x49c4('0x2e')]=_[_0x49c4('0x2a')](db['Dynamics365Field'][_0x49c4('0x27')]);_0x33707e['query']=_['keys'](_0x39405e[_0x49c4('0x2b')]);_0x33707e['filters']=_[_0x49c4('0x2d')](_0x33707e[_0x49c4('0x2e')],_0x33707e[_0x49c4('0x2b')]);_0x5d35aa[_0x49c4('0x2f')]=_[_0x49c4('0x2d')](_0x33707e[_0x49c4('0x2e')],qs[_0x49c4('0x30')](_0x39405e['query'][_0x49c4('0x30')]));_0x5d35aa[_0x49c4('0x2f')]=_0x5d35aa['attributes'][_0x49c4('0x31')]?_0x5d35aa[_0x49c4('0x2f')]:_0x33707e[_0x49c4('0x2e')];_0x5d35aa[_0x49c4('0x33')]=qs[_0x49c4('0x34')](_0x39405e[_0x49c4('0x2b')][_0x49c4('0x34')]);_0x5d35aa[_0x49c4('0x35')]=qs['filters'](_[_0x49c4('0x36')](_0x39405e[_0x49c4('0x2b')],_0x33707e[_0x49c4('0x2c')]));if(_0x39405e[_0x49c4('0x2b')][_0x49c4('0x37')]){_0x5d35aa['where']=_['merge'](_0x5d35aa[_0x49c4('0x35')],{'$or':_[_0x49c4('0x26')](_0x5d35aa['attributes'],function(_0x649ab4){var _0x1b1fd3={};_0x1b1fd3[_0x649ab4]={'$like':'%'+_0x39405e[_0x49c4('0x2b')][_0x49c4('0x37')]+'%'};return _0x1b1fd3;})});}_0x5d35aa=_[_0x49c4('0x39')]({},_0x5d35aa,_0x39405e[_0x49c4('0x3a')]);return _0x14b8a6[_0x49c4('0x45')](_0x5d35aa);}})[_0x49c4('0x21')](function(_0x2b693f){if(_0x2b693f){_0x48c41b=_0x2b693f['length'];if(!_0x39405e[_0x49c4('0x2b')]['hasOwnProperty'](_0x49c4('0x47'))){_0x5d35aa[_0x49c4('0x1b')]=qs[_0x49c4('0x1b')](_0x39405e[_0x49c4('0x2b')][_0x49c4('0x1b')]);_0x5d35aa[_0x49c4('0x19')]=qs['offset'](_0x39405e['query'][_0x49c4('0x19')]);}return _0x14b8a6[_0x49c4('0x45')](_0x5d35aa);}})[_0x49c4('0x21')](function(_0x4d0190){if(_0x4d0190){return _0x4d0190?{'count':_0x48c41b,'rows':_0x4d0190}:null;}})['then'](respondWithResult(_0x1bcb07,null))[_0x49c4('0x3e')](handleError(_0x1bcb07,null));};exports[_0x49c4('0x48')]=function(_0x29bb4d,_0x412a75,_0x444bcb){var _0x2cbcf8={};var _0x103cf1={};var _0x31ef67;var _0x11cac1;return db[_0x49c4('0x3b')]['findOne']({'where':{'id':_0x29bb4d[_0x49c4('0x40')]['id']}})[_0x49c4('0x21')](handleEntityNotFound(_0x412a75,null))[_0x49c4('0x21')](function(_0x461a09){if(_0x461a09){_0x31ef67=_0x461a09;_0x103cf1['model']=_[_0x49c4('0x2a')](db['Dynamics365Field'][_0x49c4('0x27')]);_0x103cf1[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x29bb4d[_0x49c4('0x2b')]);_0x103cf1[_0x49c4('0x2c')]=_[_0x49c4('0x2d')](_0x103cf1[_0x49c4('0x2e')],_0x103cf1[_0x49c4('0x2b')]);_0x2cbcf8[_0x49c4('0x2f')]=_[_0x49c4('0x2d')](_0x103cf1[_0x49c4('0x2e')],qs[_0x49c4('0x30')](_0x29bb4d[_0x49c4('0x2b')][_0x49c4('0x30')]));_0x2cbcf8['attributes']=_0x2cbcf8['attributes'][_0x49c4('0x31')]?_0x2cbcf8['attributes']:_0x103cf1[_0x49c4('0x2e')];_0x2cbcf8['order']=qs[_0x49c4('0x34')](_0x29bb4d['query'][_0x49c4('0x34')]);_0x2cbcf8[_0x49c4('0x35')]=qs[_0x49c4('0x2c')](_[_0x49c4('0x36')](_0x29bb4d[_0x49c4('0x2b')],_0x103cf1[_0x49c4('0x2c')]));if(_0x29bb4d[_0x49c4('0x2b')][_0x49c4('0x37')]){_0x2cbcf8[_0x49c4('0x35')]=_[_0x49c4('0x39')](_0x2cbcf8[_0x49c4('0x35')],{'$or':_[_0x49c4('0x26')](_0x2cbcf8['attributes'],function(_0x3739f7){var _0x174012={};_0x174012[_0x3739f7]={'$like':'%'+_0x29bb4d[_0x49c4('0x2b')][_0x49c4('0x37')]+'%'};return _0x174012;})});}_0x2cbcf8=_[_0x49c4('0x39')]({},_0x2cbcf8,_0x29bb4d[_0x49c4('0x3a')]);return _0x31ef67[_0x49c4('0x48')](_0x2cbcf8);}})[_0x49c4('0x21')](function(_0x2ebdb2){if(_0x2ebdb2){_0x11cac1=_0x2ebdb2[_0x49c4('0x31')];if(!_0x29bb4d[_0x49c4('0x2b')][_0x49c4('0x32')]('nolimit')){_0x2cbcf8['limit']=qs['limit'](_0x29bb4d['query'][_0x49c4('0x1b')]);_0x2cbcf8[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x29bb4d['query'][_0x49c4('0x19')]);}return _0x31ef67[_0x49c4('0x48')](_0x2cbcf8);}})[_0x49c4('0x21')](function(_0x5096f5){if(_0x5096f5){return _0x5096f5?{'count':_0x11cac1,'rows':_0x5096f5}:null;}})[_0x49c4('0x21')](respondWithResult(_0x412a75,null))['catch'](handleError(_0x412a75,null));};exports[_0x49c4('0x49')]=function(_0x35bdd0,_0x40f9a3,_0x2a7113){var _0x405e4a={};var _0x26f087={};var _0xe1c547;var _0x2b3722;return db[_0x49c4('0x3b')][_0x49c4('0x46')]({'where':{'id':_0x35bdd0['params']['id']}})[_0x49c4('0x21')](handleEntityNotFound(_0x40f9a3,null))['then'](function(_0x502833){if(_0x502833){_0xe1c547=_0x502833;_0x26f087[_0x49c4('0x2e')]=_[_0x49c4('0x2a')](db[_0x49c4('0x4a')][_0x49c4('0x27')]);_0x26f087[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x35bdd0[_0x49c4('0x2b')]);_0x26f087[_0x49c4('0x2c')]=_['intersection'](_0x26f087['model'],_0x26f087[_0x49c4('0x2b')]);_0x405e4a[_0x49c4('0x2f')]=_[_0x49c4('0x2d')](_0x26f087[_0x49c4('0x2e')],qs[_0x49c4('0x30')](_0x35bdd0['query']['fields']));_0x405e4a[_0x49c4('0x2f')]=_0x405e4a['attributes'][_0x49c4('0x31')]?_0x405e4a[_0x49c4('0x2f')]:_0x26f087['model'];_0x405e4a['order']=qs[_0x49c4('0x34')](_0x35bdd0[_0x49c4('0x2b')]['sort']);_0x405e4a[_0x49c4('0x35')]=qs['filters'](_['pick'](_0x35bdd0[_0x49c4('0x2b')],_0x26f087[_0x49c4('0x2c')]));if(_0x35bdd0[_0x49c4('0x2b')][_0x49c4('0x37')]){_0x405e4a[_0x49c4('0x35')]=_[_0x49c4('0x39')](_0x405e4a[_0x49c4('0x35')],{'$or':_[_0x49c4('0x26')](_0x405e4a['attributes'],function(_0x1a0fee){var _0x311583={};_0x311583[_0x1a0fee]={'$like':'%'+_0x35bdd0[_0x49c4('0x2b')][_0x49c4('0x37')]+'%'};return _0x311583;})});}_0x405e4a=_[_0x49c4('0x39')]({},_0x405e4a,_0x35bdd0[_0x49c4('0x3a')]);return _0xe1c547[_0x49c4('0x49')](_0x405e4a);}})['then'](function(_0x1e532a){if(_0x1e532a){_0x2b3722=_0x1e532a['length'];if(!_0x35bdd0[_0x49c4('0x2b')][_0x49c4('0x32')](_0x49c4('0x47'))){_0x405e4a[_0x49c4('0x1b')]=qs[_0x49c4('0x1b')](_0x35bdd0[_0x49c4('0x2b')][_0x49c4('0x1b')]);_0x405e4a[_0x49c4('0x19')]=qs['offset'](_0x35bdd0[_0x49c4('0x2b')][_0x49c4('0x19')]);}return _0xe1c547[_0x49c4('0x49')](_0x405e4a);}})['then'](function(_0xbe80b2){if(_0xbe80b2){return _0xbe80b2?{'count':_0x2b3722,'rows':_0xbe80b2}:null;}})['then'](respondWithResult(_0x40f9a3,null))['catch'](handleError(_0x40f9a3,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index acc9da0..7c422f5 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 _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x315ea3,_0x259e5d){var _0x478239=function(_0x50c4f7){while(--_0x50c4f7){_0x315ea3['push'](_0x315ea3['shift']());}};_0x478239(++_0x259e5d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x25187c,_0x77d4dd){_0x25187c=_0x25187c-0x0;var _0x4d3522=_0xd6d6[_0x25187c];return _0x4d3522;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x16e73a,_0x146629){var _0x187aa1=function(_0x26eb2f){while(--_0x26eb2f){_0x16e73a['push'](_0x16e73a['shift']());}};_0x187aa1(++_0x146629);}(_0x70e0,0x17b));var _0x070e=function(_0x123ef6,_0x3c01e7){_0x123ef6=_0x123ef6-0x0;var _0x4c5a66=_0x70e0[_0x123ef6];return _0x4c5a66;};'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']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'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 2013d7e..bfa55d9 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 _0x5337=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5337,0x134));var _0x7533=function(_0x32f91b,_0x460016){_0x32f91b=_0x32f91b-0x0;var _0x3ee8f3=_0x5337[_0x32f91b];return _0x3ee8f3;};'use strict';var _=require(_0x7533('0x0'));var util=require(_0x7533('0x1'));var moment=require('moment');var BPromise=require(_0x7533('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7533('0x3'));var db=require(_0x7533('0x4'))['db'];var utils=require(_0x7533('0x5'));var logger=require(_0x7533('0x6'))(_0x7533('0x7'));var config=require(_0x7533('0x8'));var jayson=require(_0x7533('0x9'));var client=jayson['client'][_0x7533('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aaaa6,_0x10a3ce,_0x4fc0dc){return new BPromise(function(_0x38137b,_0x5ea293){return client['request'](_0x5aaaa6,_0x4fc0dc)['then'](function(_0x135c33){logger[_0x7533('0xb')](_0x7533('0xc'),_0x10a3ce,_0x7533('0xd'));logger[_0x7533('0xe')](_0x7533('0xf'),_0x10a3ce,_0x7533('0xd'),JSON[_0x7533('0x10')](_0x135c33));if(_0x135c33[_0x7533('0x11')]){if(_0x135c33[_0x7533('0x11')]['code']===0x1f4){logger[_0x7533('0x11')](_0x7533('0xc'),_0x10a3ce,_0x135c33[_0x7533('0x11')][_0x7533('0x12')]);return _0x5ea293(_0x135c33[_0x7533('0x11')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x10a3ce,_0x135c33['error'][_0x7533('0x12')]);return _0x38137b(_0x135c33[_0x7533('0x11')]['message']);}else{logger[_0x7533('0xb')](_0x7533('0xc'),_0x10a3ce,_0x7533('0xd'));_0x38137b(_0x135c33['result'][_0x7533('0x12')]);}})['catch'](function(_0x5473c8){logger[_0x7533('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x10a3ce,_0x5473c8);_0x5ea293(_0x5473c8);});});} \ No newline at end of file +var _0x7683=['result','catch','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x352c32,_0x1e07ea){var _0x2e9a88=function(_0x55c663){while(--_0x55c663){_0x352c32['push'](_0x352c32['shift']());}};_0x2e9a88(++_0x1e07ea);}(_0x7683,0x106));var _0x3768=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x7683[_0x4c73ac];return _0x9839ee;};'use strict';var _=require('lodash');var util=require(_0x3768('0x0'));var moment=require('moment');var BPromise=require(_0x3768('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3768('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3768('0x3'))(_0x3768('0x4'));var config=require('../../config/environment');var jayson=require(_0x3768('0x5'));var client=jayson[_0x3768('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x449eb1,_0x3b5f62,_0x621264){return new BPromise(function(_0x576472,_0x408c77){return client[_0x3768('0x7')](_0x449eb1,_0x621264)[_0x3768('0x8')](function(_0x21d477){logger[_0x3768('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3b5f62,_0x3768('0xa'));logger[_0x3768('0xb')](_0x3768('0xc'),_0x3b5f62,_0x3768('0xa'),JSON[_0x3768('0xd')](_0x21d477));if(_0x21d477[_0x3768('0xe')]){if(_0x21d477[_0x3768('0xe')][_0x3768('0xf')]===0x1f4){logger[_0x3768('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3b5f62,_0x21d477[_0x3768('0xe')][_0x3768('0x10')]);return _0x408c77(_0x21d477[_0x3768('0xe')]['message']);}logger['error'](_0x3768('0x11'),_0x3b5f62,_0x21d477[_0x3768('0xe')][_0x3768('0x10')]);return _0x576472(_0x21d477[_0x3768('0xe')][_0x3768('0x10')]);}else{logger[_0x3768('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3b5f62,_0x3768('0xa'));_0x576472(_0x21d477[_0x3768('0x12')][_0x3768('0x10')]);}})[_0x3768('0x13')](function(_0x16594f){logger[_0x3768('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3b5f62,_0x16594f);_0x408c77(_0x16594f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index ac184a4..fcf7205 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 _0x6671=['../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x28f346,_0x7654bc){var _0x1e8465=function(_0x16eae1){while(--_0x16eae1){_0x28f346['push'](_0x28f346['shift']());}};_0x1e8465(++_0x7654bc);}(_0x6671,0x14f));var _0x1667=function(_0x2e1f14,_0x4bca84){_0x2e1f14=_0x2e1f14-0x0;var _0x5ef864=_0x6671[_0x2e1f14];return _0x5ef864;};'use strict';var multer=require(_0x1667('0x0'));var util=require(_0x1667('0x1'));var path=require(_0x1667('0x2'));var timeout=require(_0x1667('0x3'));var express=require(_0x1667('0x4'));var router=express[_0x1667('0x5')]();var fs_extra=require(_0x1667('0x6'));var auth=require(_0x1667('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x1667('0x8')]('/',auth[_0x1667('0x9')](),controller[_0x1667('0xa')]);router[_0x1667('0x8')](_0x1667('0xb'),auth[_0x1667('0x9')](),controller[_0x1667('0xc')]);router[_0x1667('0xd')]('/',auth[_0x1667('0x9')](),controller[_0x1667('0xe')]);router[_0x1667('0xf')](_0x1667('0xb'),auth[_0x1667('0x9')](),controller[_0x1667('0x10')]);router['delete'](_0x1667('0xb'),auth[_0x1667('0x9')](),controller[_0x1667('0x11')]);module[_0x1667('0x12')]=router; \ No newline at end of file +var _0xd070=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x367ff3,_0x4a046c){var _0x1c4f01=function(_0x598b6b){while(--_0x598b6b){_0x367ff3['push'](_0x367ff3['shift']());}};_0x1c4f01(++_0x4a046c);}(_0xd070,0x1a3));var _0x0d07=function(_0x23254d,_0x7609b1){_0x23254d=_0x23254d-0x0;var _0x4fd62e=_0xd070[_0x23254d];return _0x4fd62e;};'use strict';var multer=require(_0x0d07('0x0'));var util=require(_0x0d07('0x1'));var path=require(_0x0d07('0x2'));var timeout=require(_0x0d07('0x3'));var express=require(_0x0d07('0x4'));var router=express['Router']();var fs_extra=require(_0x0d07('0x5'));var auth=require(_0x0d07('0x6'));var interaction=require(_0x0d07('0x7'));var config=require(_0x0d07('0x8'));var controller=require(_0x0d07('0x9'));router[_0x0d07('0xa')]('/',auth[_0x0d07('0xb')](),controller[_0x0d07('0xc')]);router[_0x0d07('0xa')](_0x0d07('0xd'),auth[_0x0d07('0xb')](),controller[_0x0d07('0xe')]);router['post']('/',auth[_0x0d07('0xb')](),controller[_0x0d07('0xf')]);router[_0x0d07('0x10')](_0x0d07('0xd'),auth[_0x0d07('0xb')](),controller[_0x0d07('0x11')]);router[_0x0d07('0x12')](_0x0d07('0xd'),auth[_0x0d07('0xb')](),controller[_0x0d07('0x13')]);module[_0x0d07('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 11cc75c..665ad52 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 _0xbaab=['BOOLEAN','sequelize','string','variable','keyValue','picklist','ENUM','STRING'];(function(_0x5af85e,_0x5f55c2){var _0x10d7e0=function(_0x14e800){while(--_0x14e800){_0x5af85e['push'](_0x5af85e['shift']());}};_0x10d7e0(++_0x5f55c2);}(_0xbaab,0xe1));var _0xbbaa=function(_0x2bd39f,_0x39b4d3){_0x2bd39f=_0x2bd39f-0x0;var _0x25df15=_0xbaab[_0x2bd39f];return _0x25df15;};'use strict';var Sequelize=require(_0xbbaa('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xbbaa('0x1'),_0xbbaa('0x2'),'customVariable',_0xbbaa('0x3'),_0xbbaa('0x4')),'defaultValue':_0xbbaa('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbbaa('0x5')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xbbaa('0x6')]},'idField':{'type':Sequelize[_0xbbaa('0x6')]},'nameField':{'type':Sequelize[_0xbbaa('0x6')]},'customField':{'type':Sequelize[_0xbbaa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe37f=['sequelize','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x20c2a5,_0x3745b7){var _0x306482=function(_0x5c1333){while(--_0x5c1333){_0x20c2a5['push'](_0x20c2a5['shift']());}};_0x306482(++_0x3745b7);}(_0xe37f,0x69));var _0xfe37=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xe37f[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0xfe37('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xfe37('0x1'),_0xfe37('0x2'),_0xfe37('0x3'),_0xfe37('0x4'),'picklist'),'defaultValue':_0xfe37('0x1')},'content':{'type':Sequelize[_0xfe37('0x5')]},'key':{'type':Sequelize[_0xfe37('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xfe37('0x1'),_0xfe37('0x2'),_0xfe37('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfe37('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfe37('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfe37('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index fd09f49..9a34367 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 _0xb155=['show','params','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','catch'];(function(_0x151d64,_0x360f73){var _0x409cfd=function(_0x152309){while(--_0x152309){_0x151d64['push'](_0x151d64['shift']());}};_0x409cfd(++_0x360f73);}(_0xb155,0x1c8));var _0x5b15=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xb155[_0xdeac17];return _0x33aabd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b15('0x0'));var zipdir=require(_0x5b15('0x1'));var jsonpatch=require(_0x5b15('0x2'));var rp=require(_0x5b15('0x3'));var moment=require(_0x5b15('0x4'));var BPromise=require(_0x5b15('0x5'));var Mustache=require(_0x5b15('0x6'));var util=require('util');var path=require(_0x5b15('0x7'));var sox=require(_0x5b15('0x8'));var csv=require(_0x5b15('0x9'));var ejs=require(_0x5b15('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b15('0xb'));var crypto=require(_0x5b15('0xc'));var jsforce=require(_0x5b15('0xd'));var deskjs=require(_0x5b15('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b15('0xf'));var Redis=require(_0x5b15('0x10'));var authService=require(_0x5b15('0x11'));var qs=require(_0x5b15('0x12'));var as=require(_0x5b15('0x13'));var hardwareService=require(_0x5b15('0x14'));var logger=require(_0x5b15('0x15'))(_0x5b15('0x16'));var utils=require(_0x5b15('0x17'));var config=require(_0x5b15('0x18'));var licenseUtil=require(_0x5b15('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bef49,_0x33dba4){_0x33dba4=_0x33dba4||0xcc;return function(_0x315ccb){if(_0x315ccb){return _0x2bef49[_0x5b15('0x1a')](_0x33dba4);}return _0x2bef49['status'](_0x33dba4)['end']();};}function respondWithResult(_0x2b3ef5,_0x442a80){_0x442a80=_0x442a80||0xc8;return function(_0x5308d2){if(_0x5308d2){return _0x2b3ef5[_0x5b15('0x1b')](_0x442a80)['json'](_0x5308d2);}};}function respondWithFilteredResult(_0x439774,_0x3b3d3b){return function(_0x2ec246){if(_0x2ec246){var _0x2d63a0=typeof _0x3b3d3b[_0x5b15('0x1c')]===_0x5b15('0x1d')&&typeof _0x3b3d3b[_0x5b15('0x1e')]===_0x5b15('0x1d');var _0x379d9a=_0x2ec246[_0x5b15('0x1f')];var _0x4d9d8a=_0x2d63a0?0x0:_0x3b3d3b[_0x5b15('0x1c')];var _0x4e6172=_0x2d63a0?_0x2ec246[_0x5b15('0x1f')]:_0x3b3d3b['offset']+_0x3b3d3b[_0x5b15('0x1e')];var _0x4afd11;if(_0x4e6172>=_0x379d9a){_0x4e6172=_0x379d9a;_0x4afd11=0xc8;}else{_0x4afd11=0xce;}_0x439774[_0x5b15('0x1b')](_0x4afd11);return _0x439774[_0x5b15('0x20')](_0x5b15('0x21'),_0x4d9d8a+'-'+_0x4e6172+'/'+_0x379d9a)[_0x5b15('0x22')](_0x2ec246);}return null;};}function patchUpdates(_0x394e09){return function(_0x5268c0){try{jsonpatch[_0x5b15('0x23')](_0x5268c0,_0x394e09,!![]);}catch(_0x2d1686){return BPromise['reject'](_0x2d1686);}return _0x5268c0[_0x5b15('0x24')]();};}function saveUpdates(_0x585478,_0x4d8e82){return function(_0x33da4a){if(_0x33da4a){return _0x33da4a[_0x5b15('0x25')](_0x585478)[_0x5b15('0x26')](function(_0x3c7d0d){return _0x3c7d0d;});}return null;};}function removeEntity(_0x2f9d4c,_0x2cad22){return function(_0x59b09d){if(_0x59b09d){return _0x59b09d[_0x5b15('0x27')]()[_0x5b15('0x26')](function(){_0x2f9d4c[_0x5b15('0x1b')](0xcc)[_0x5b15('0x28')]();});}};}function handleEntityNotFound(_0x215b81,_0x183512){return function(_0x52b9b1){if(!_0x52b9b1){_0x215b81[_0x5b15('0x1a')](0x194);}return _0x52b9b1;};}function handleError(_0xe2cb3a,_0xb6b83a){_0xb6b83a=_0xb6b83a||0x1f4;return function(_0x45694b){logger[_0x5b15('0x29')](_0x45694b['stack']);if(_0x45694b[_0x5b15('0x2a')]){delete _0x45694b[_0x5b15('0x2a')];}_0xe2cb3a[_0x5b15('0x1b')](_0xb6b83a)[_0x5b15('0x2b')](_0x45694b);};}exports[_0x5b15('0x2c')]=function(_0x1474a0,_0x379f76){var _0x2fc372={},_0x1958f7={},_0x4abe65={'count':0x0,'rows':[]};var _0x53f559=_[_0x5b15('0x2d')](db[_0x5b15('0x2e')][_0x5b15('0x2f')],function(_0x32d09e){return{'name':_0x32d09e[_0x5b15('0x30')],'type':_0x32d09e[_0x5b15('0x31')][_0x5b15('0x32')]};});_0x1958f7[_0x5b15('0x33')]=_[_0x5b15('0x2d')](_0x53f559,'name');_0x1958f7[_0x5b15('0x34')]=_[_0x5b15('0x35')](_0x1474a0[_0x5b15('0x34')]);_0x1958f7['filters']=_[_0x5b15('0x36')](_0x1958f7[_0x5b15('0x33')],_0x1958f7[_0x5b15('0x34')]);_0x2fc372[_0x5b15('0x37')]=_[_0x5b15('0x36')](_0x1958f7[_0x5b15('0x33')],qs[_0x5b15('0x38')](_0x1474a0['query']['fields']));_0x2fc372['attributes']=_0x2fc372[_0x5b15('0x37')][_0x5b15('0x39')]?_0x2fc372[_0x5b15('0x37')]:_0x1958f7[_0x5b15('0x33')];if(!_0x1474a0[_0x5b15('0x34')][_0x5b15('0x3a')](_0x5b15('0x3b'))){_0x2fc372[_0x5b15('0x1e')]=qs['limit'](_0x1474a0[_0x5b15('0x34')][_0x5b15('0x1e')]);_0x2fc372['offset']=qs[_0x5b15('0x1c')](_0x1474a0[_0x5b15('0x34')]['offset']);}_0x2fc372[_0x5b15('0x3c')]=qs[_0x5b15('0x3d')](_0x1474a0['query'][_0x5b15('0x3d')]);_0x2fc372[_0x5b15('0x3e')]=qs[_0x5b15('0x3f')](_['pick'](_0x1474a0[_0x5b15('0x34')],_0x1958f7['filters']),_0x53f559);if(_0x1474a0['query'][_0x5b15('0x40')]){_0x2fc372[_0x5b15('0x3e')]=_['merge'](_0x2fc372[_0x5b15('0x3e')],{'$or':_[_0x5b15('0x2d')](_0x53f559,function(_0x40034e){if(_0x40034e['type']!=='VIRTUAL'){var _0x58876b={};_0x58876b[_0x40034e[_0x5b15('0x2a')]]={'$like':'%'+_0x1474a0[_0x5b15('0x34')][_0x5b15('0x40')]+'%'};return _0x58876b;}})});}_0x2fc372=_[_0x5b15('0x41')]({},_0x2fc372,_0x1474a0['options']);var _0x2182d9={'where':_0x2fc372[_0x5b15('0x3e')]};return db[_0x5b15('0x2e')][_0x5b15('0x1f')](_0x2182d9)['then'](function(_0x175601){_0x4abe65[_0x5b15('0x1f')]=_0x175601;if(_0x1474a0[_0x5b15('0x34')][_0x5b15('0x42')]){_0x2fc372['include']=[{'all':!![]}];}return db[_0x5b15('0x2e')][_0x5b15('0x43')](_0x2fc372);})[_0x5b15('0x26')](function(_0x236028){_0x4abe65['rows']=_0x236028;return _0x4abe65;})[_0x5b15('0x26')](respondWithFilteredResult(_0x379f76,_0x2fc372))[_0x5b15('0x44')](handleError(_0x379f76,null));};exports[_0x5b15('0x45')]=function(_0x4bed68,_0xb1d2a0){var _0x4e63c6={'raw':!![],'where':{'id':_0x4bed68[_0x5b15('0x46')]['id']}},_0x29d5da={};_0x29d5da['model']=_[_0x5b15('0x35')](db[_0x5b15('0x2e')][_0x5b15('0x2f')]);_0x29d5da['query']=_[_0x5b15('0x35')](_0x4bed68[_0x5b15('0x34')]);_0x29d5da['filters']=_[_0x5b15('0x36')](_0x29d5da[_0x5b15('0x33')],_0x29d5da[_0x5b15('0x34')]);_0x4e63c6[_0x5b15('0x37')]=_[_0x5b15('0x36')](_0x29d5da[_0x5b15('0x33')],qs['fields'](_0x4bed68['query'][_0x5b15('0x38')]));_0x4e63c6['attributes']=_0x4e63c6[_0x5b15('0x37')][_0x5b15('0x39')]?_0x4e63c6[_0x5b15('0x37')]:_0x29d5da[_0x5b15('0x33')];if(_0x4bed68[_0x5b15('0x34')][_0x5b15('0x42')]){_0x4e63c6[_0x5b15('0x47')]=[{'all':!![]}];}_0x4e63c6=_['merge']({},_0x4e63c6,_0x4bed68['options']);return db[_0x5b15('0x2e')][_0x5b15('0x48')](_0x4e63c6)[_0x5b15('0x26')](handleEntityNotFound(_0xb1d2a0,null))[_0x5b15('0x26')](respondWithResult(_0xb1d2a0,null))['catch'](handleError(_0xb1d2a0,null));};exports['create']=function(_0x6c62aa,_0x300e96){return db[_0x5b15('0x2e')][_0x5b15('0x49')](_0x6c62aa[_0x5b15('0x4a')],{})[_0x5b15('0x26')](respondWithResult(_0x300e96,0xc9))[_0x5b15('0x44')](handleError(_0x300e96,null));};exports[_0x5b15('0x25')]=function(_0x2a1e43,_0x447f71){if(_0x2a1e43[_0x5b15('0x4a')]['id']){delete _0x2a1e43[_0x5b15('0x4a')]['id'];}return db['Dynamics365Field'][_0x5b15('0x48')]({'where':{'id':_0x2a1e43['params']['id']}})[_0x5b15('0x26')](handleEntityNotFound(_0x447f71,null))[_0x5b15('0x26')](saveUpdates(_0x2a1e43[_0x5b15('0x4a')],null))[_0x5b15('0x26')](respondWithResult(_0x447f71,null))['catch'](handleError(_0x447f71,null));};exports[_0x5b15('0x27')]=function(_0x25e294,_0x34813a){return db[_0x5b15('0x2e')]['find']({'where':{'id':_0x25e294[_0x5b15('0x46')]['id']}})[_0x5b15('0x26')](handleEntityNotFound(_0x34813a,null))['then'](removeEntity(_0x34813a,null))['catch'](handleError(_0x34813a,null));}; \ No newline at end of file +var _0x0d7b=['limit','undefined','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x236b5a,_0x6f7a18){var _0x3c0b35=function(_0x471ed9){while(--_0x471ed9){_0x236b5a['push'](_0x236b5a['shift']());}};_0x3c0b35(++_0x6f7a18);}(_0x0d7b,0x145));var _0xb0d7=function(_0x513c9c,_0x20916f){_0x513c9c=_0x513c9c-0x0;var _0x2f3f35=_0x0d7b[_0x513c9c];return _0x2f3f35;};'use strict';var emlformat=require(_0xb0d7('0x0'));var rimraf=require(_0xb0d7('0x1'));var zipdir=require(_0xb0d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0d7('0x3'));var moment=require('moment');var BPromise=require(_0xb0d7('0x4'));var Mustache=require(_0xb0d7('0x5'));var util=require('util');var path=require(_0xb0d7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb0d7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0d7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0d7('0x9'));var querystring=require(_0xb0d7('0xa'));var Papa=require(_0xb0d7('0xb'));var Redis=require(_0xb0d7('0xc'));var authService=require(_0xb0d7('0xd'));var qs=require(_0xb0d7('0xe'));var as=require(_0xb0d7('0xf'));var hardwareService=require(_0xb0d7('0x10'));var logger=require(_0xb0d7('0x11'))(_0xb0d7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb0d7('0x13'))['db'];function respondWithStatusCode(_0x3e8145,_0x11e5a0){_0x11e5a0=_0x11e5a0||0xcc;return function(_0x4d7fb0){if(_0x4d7fb0){return _0x3e8145[_0xb0d7('0x14')](_0x11e5a0);}return _0x3e8145['status'](_0x11e5a0)[_0xb0d7('0x15')]();};}function respondWithResult(_0x1fbe15,_0x4e1e03){_0x4e1e03=_0x4e1e03||0xc8;return function(_0x184fd4){if(_0x184fd4){return _0x1fbe15[_0xb0d7('0x16')](_0x4e1e03)[_0xb0d7('0x17')](_0x184fd4);}};}function respondWithFilteredResult(_0x25c65f,_0x6808fd){return function(_0x37ebfd){if(_0x37ebfd){var _0x45f967=typeof _0x6808fd[_0xb0d7('0x18')]==='undefined'&&typeof _0x6808fd[_0xb0d7('0x19')]===_0xb0d7('0x1a');var _0x26eacb=_0x37ebfd['count'];var _0x5bcf50=_0x45f967?0x0:_0x6808fd[_0xb0d7('0x18')];var _0x58094b=_0x45f967?_0x37ebfd[_0xb0d7('0x1b')]:_0x6808fd[_0xb0d7('0x18')]+_0x6808fd[_0xb0d7('0x19')];var _0x3851e3;if(_0x58094b>=_0x26eacb){_0x58094b=_0x26eacb;_0x3851e3=0xc8;}else{_0x3851e3=0xce;}_0x25c65f['status'](_0x3851e3);return _0x25c65f['set']('Content-Range',_0x5bcf50+'-'+_0x58094b+'/'+_0x26eacb)[_0xb0d7('0x17')](_0x37ebfd);}return null;};}function patchUpdates(_0x41525b){return function(_0x433292){try{jsonpatch[_0xb0d7('0x1c')](_0x433292,_0x41525b,!![]);}catch(_0x43e4f4){return BPromise[_0xb0d7('0x1d')](_0x43e4f4);}return _0x433292[_0xb0d7('0x1e')]();};}function saveUpdates(_0x58b09b,_0x5c5746){return function(_0x2ada01){if(_0x2ada01){return _0x2ada01[_0xb0d7('0x1f')](_0x58b09b)[_0xb0d7('0x20')](function(_0x2e65f0){return _0x2e65f0;});}return null;};}function removeEntity(_0x46d6de,_0x51be52){return function(_0x38c5be){if(_0x38c5be){return _0x38c5be[_0xb0d7('0x21')]()[_0xb0d7('0x20')](function(){_0x46d6de[_0xb0d7('0x16')](0xcc)[_0xb0d7('0x15')]();});}};}function handleEntityNotFound(_0x2324b9,_0x2f2002){return function(_0xc7302f){if(!_0xc7302f){_0x2324b9[_0xb0d7('0x14')](0x194);}return _0xc7302f;};}function handleError(_0x3d8a4e,_0x158f8a){_0x158f8a=_0x158f8a||0x1f4;return function(_0x319423){logger[_0xb0d7('0x22')](_0x319423[_0xb0d7('0x23')]);if(_0x319423['name']){delete _0x319423[_0xb0d7('0x24')];}_0x3d8a4e['status'](_0x158f8a)[_0xb0d7('0x25')](_0x319423);};}exports[_0xb0d7('0x26')]=function(_0x341282,_0x5b9d95){var _0x1d335e={},_0x2434cb={},_0x44dd59={'count':0x0,'rows':[]};var _0x1d7765=_[_0xb0d7('0x27')](db[_0xb0d7('0x28')][_0xb0d7('0x29')],function(_0x4ae173){return{'name':_0x4ae173[_0xb0d7('0x2a')],'type':_0x4ae173[_0xb0d7('0x2b')][_0xb0d7('0x2c')]};});_0x2434cb[_0xb0d7('0x2d')]=_[_0xb0d7('0x27')](_0x1d7765,'name');_0x2434cb[_0xb0d7('0x2e')]=_['keys'](_0x341282[_0xb0d7('0x2e')]);_0x2434cb[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x2434cb[_0xb0d7('0x2d')],_0x2434cb['query']);_0x1d335e[_0xb0d7('0x31')]=_['intersection'](_0x2434cb['model'],qs['fields'](_0x341282[_0xb0d7('0x2e')][_0xb0d7('0x32')]));_0x1d335e[_0xb0d7('0x31')]=_0x1d335e[_0xb0d7('0x31')][_0xb0d7('0x33')]?_0x1d335e[_0xb0d7('0x31')]:_0x2434cb[_0xb0d7('0x2d')];if(!_0x341282[_0xb0d7('0x2e')][_0xb0d7('0x34')](_0xb0d7('0x35'))){_0x1d335e[_0xb0d7('0x19')]=qs[_0xb0d7('0x19')](_0x341282[_0xb0d7('0x2e')]['limit']);_0x1d335e[_0xb0d7('0x18')]=qs['offset'](_0x341282[_0xb0d7('0x2e')]['offset']);}_0x1d335e[_0xb0d7('0x36')]=qs[_0xb0d7('0x37')](_0x341282['query']['sort']);_0x1d335e[_0xb0d7('0x38')]=qs[_0xb0d7('0x2f')](_[_0xb0d7('0x39')](_0x341282[_0xb0d7('0x2e')],_0x2434cb[_0xb0d7('0x2f')]),_0x1d7765);if(_0x341282[_0xb0d7('0x2e')][_0xb0d7('0x3a')]){_0x1d335e[_0xb0d7('0x38')]=_[_0xb0d7('0x3b')](_0x1d335e['where'],{'$or':_[_0xb0d7('0x27')](_0x1d7765,function(_0x198166){if(_0x198166[_0xb0d7('0x2b')]!=='VIRTUAL'){var _0x2c7ede={};_0x2c7ede[_0x198166['name']]={'$like':'%'+_0x341282[_0xb0d7('0x2e')][_0xb0d7('0x3a')]+'%'};return _0x2c7ede;}})});}_0x1d335e=_[_0xb0d7('0x3b')]({},_0x1d335e,_0x341282[_0xb0d7('0x3c')]);var _0x1ff49b={'where':_0x1d335e['where']};return db[_0xb0d7('0x28')]['count'](_0x1ff49b)[_0xb0d7('0x20')](function(_0x1ebec1){_0x44dd59[_0xb0d7('0x1b')]=_0x1ebec1;if(_0x341282['query']['includeAll']){_0x1d335e[_0xb0d7('0x3d')]=[{'all':!![]}];}return db[_0xb0d7('0x28')]['findAll'](_0x1d335e);})[_0xb0d7('0x20')](function(_0xf3d3de){_0x44dd59['rows']=_0xf3d3de;return _0x44dd59;})[_0xb0d7('0x20')](respondWithFilteredResult(_0x5b9d95,_0x1d335e))[_0xb0d7('0x3e')](handleError(_0x5b9d95,null));};exports[_0xb0d7('0x3f')]=function(_0xa95f03,_0x88a1c7){var _0x14b8d0={'raw':!![],'where':{'id':_0xa95f03[_0xb0d7('0x40')]['id']}},_0x5bc602={};_0x5bc602[_0xb0d7('0x2d')]=_[_0xb0d7('0x41')](db[_0xb0d7('0x28')]['rawAttributes']);_0x5bc602['query']=_[_0xb0d7('0x41')](_0xa95f03[_0xb0d7('0x2e')]);_0x5bc602[_0xb0d7('0x2f')]=_['intersection'](_0x5bc602[_0xb0d7('0x2d')],_0x5bc602['query']);_0x14b8d0[_0xb0d7('0x31')]=_['intersection'](_0x5bc602[_0xb0d7('0x2d')],qs[_0xb0d7('0x32')](_0xa95f03[_0xb0d7('0x2e')][_0xb0d7('0x32')]));_0x14b8d0[_0xb0d7('0x31')]=_0x14b8d0[_0xb0d7('0x31')][_0xb0d7('0x33')]?_0x14b8d0['attributes']:_0x5bc602[_0xb0d7('0x2d')];if(_0xa95f03['query'][_0xb0d7('0x42')]){_0x14b8d0[_0xb0d7('0x3d')]=[{'all':!![]}];}_0x14b8d0=_[_0xb0d7('0x3b')]({},_0x14b8d0,_0xa95f03['options']);return db[_0xb0d7('0x28')][_0xb0d7('0x43')](_0x14b8d0)[_0xb0d7('0x20')](handleEntityNotFound(_0x88a1c7,null))[_0xb0d7('0x20')](respondWithResult(_0x88a1c7,null))[_0xb0d7('0x3e')](handleError(_0x88a1c7,null));};exports['create']=function(_0x3f3725,_0x57ada4){return db[_0xb0d7('0x28')][_0xb0d7('0x44')](_0x3f3725[_0xb0d7('0x45')],{})[_0xb0d7('0x20')](respondWithResult(_0x57ada4,0xc9))[_0xb0d7('0x3e')](handleError(_0x57ada4,null));};exports['update']=function(_0x2e04e0,_0x15e40e){if(_0x2e04e0['body']['id']){delete _0x2e04e0[_0xb0d7('0x45')]['id'];}return db[_0xb0d7('0x28')][_0xb0d7('0x43')]({'where':{'id':_0x2e04e0[_0xb0d7('0x40')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x15e40e,null))[_0xb0d7('0x20')](saveUpdates(_0x2e04e0[_0xb0d7('0x45')],null))['then'](respondWithResult(_0x15e40e,null))[_0xb0d7('0x3e')](handleError(_0x15e40e,null));};exports[_0xb0d7('0x21')]=function(_0x23122c,_0x37c236){return db[_0xb0d7('0x28')]['find']({'where':{'id':_0x23122c[_0xb0d7('0x40')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x37c236,null))[_0xb0d7('0x20')](removeEntity(_0x37c236,null))[_0xb0d7('0x3e')](handleError(_0x37c236,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 74b8bab..802a5d0 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 _0x8e6f=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e6f,0x149));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf8e6('0x0'));var util=require(_0xf8e6('0x1'));var logger=require(_0xf8e6('0x2'))(_0xf8e6('0x3'));var moment=require(_0xf8e6('0x4'));var BPromise=require(_0xf8e6('0x5'));var rp=require(_0xf8e6('0x6'));var fs=require('fs');var path=require(_0xf8e6('0x7'));var rimraf=require(_0xf8e6('0x8'));var config=require(_0xf8e6('0x9'));var attributes=require(_0xf8e6('0xa'));module[_0xf8e6('0xb')]=function(_0x2c8c66,_0xc0b984){return _0x2c8c66['define'](_0xf8e6('0xc'),attributes,{'tableName':_0xf8e6('0xd'),'paranoid':![],'indexes':[{'name':_0xf8e6('0xe'),'fields':[_0xf8e6('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x179c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','lodash'];(function(_0x3c38a,_0x590548){var _0x16df15=function(_0x1f8983){while(--_0x1f8983){_0x3c38a['push'](_0x3c38a['shift']());}};_0x16df15(++_0x590548);}(_0x179c,0x77));var _0xc179=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x179c[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require(_0xc179('0x0'));var util=require(_0xc179('0x1'));var logger=require(_0xc179('0x2'))(_0xc179('0x3'));var moment=require(_0xc179('0x4'));var BPromise=require(_0xc179('0x5'));var rp=require(_0xc179('0x6'));var fs=require('fs');var path=require(_0xc179('0x7'));var rimraf=require(_0xc179('0x8'));var config=require('../../config/environment');var attributes=require(_0xc179('0x9'));module[_0xc179('0xa')]=function(_0x2f0303,_0x39b274){return _0x2f0303[_0xc179('0xb')](_0xc179('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xc179('0xd'),'fields':[_0xc179('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 3987941..b1e3208 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 _0xa03b=['../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa03b,0x1ae));var _0xba03=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0xa03b[_0x5b077b];return _0x16faf7;};'use strict';var _=require('lodash');var util=require(_0xba03('0x0'));var moment=require(_0xba03('0x1'));var BPromise=require(_0xba03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba03('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba03('0x4'));var logger=require(_0xba03('0x5'))(_0xba03('0x6'));var config=require(_0xba03('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba03('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6c949,_0x5d7326,_0x12a4a0){return new BPromise(function(_0x11809a,_0x3f1bc9){return client[_0xba03('0x9')](_0xa6c949,_0x12a4a0)[_0xba03('0xa')](function(_0x2d7549){logger[_0xba03('0xb')](_0xba03('0xc'),_0x5d7326,'request\x20sent');logger['debug'](_0xba03('0xd'),_0x5d7326,'request\x20sent',JSON[_0xba03('0xe')](_0x2d7549));if(_0x2d7549[_0xba03('0xf')]){if(_0x2d7549['error']['code']===0x1f4){logger[_0xba03('0xf')](_0xba03('0xc'),_0x5d7326,_0x2d7549[_0xba03('0xf')]['message']);return _0x3f1bc9(_0x2d7549[_0xba03('0xf')]['message']);}logger[_0xba03('0xf')](_0xba03('0xc'),_0x5d7326,_0x2d7549[_0xba03('0xf')][_0xba03('0x10')]);return _0x11809a(_0x2d7549[_0xba03('0xf')][_0xba03('0x10')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x5d7326,_0xba03('0x11'));_0x11809a(_0x2d7549[_0xba03('0x12')][_0xba03('0x10')]);}})['catch'](function(_0xf56005){logger['error'](_0xba03('0xc'),_0x5d7326,_0xf56005);_0x3f1bc9(_0xf56005);});});} \ No newline at end of file +var _0xa664=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x295ea9,_0x19d658){var _0x59a3fe=function(_0x35be54){while(--_0x35be54){_0x295ea9['push'](_0x295ea9['shift']());}};_0x59a3fe(++_0x19d658);}(_0xa664,0x1e0));var _0x4a66=function(_0x2905df,_0x5aa988){_0x2905df=_0x2905df-0x0;var _0x19f02a=_0xa664[_0x2905df];return _0x19f02a;};'use strict';var _=require(_0x4a66('0x0'));var util=require(_0x4a66('0x1'));var moment=require(_0x4a66('0x2'));var BPromise=require(_0x4a66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a66('0x4'));var db=require(_0x4a66('0x5'))['db'];var utils=require(_0x4a66('0x6'));var logger=require('../../config/logger')(_0x4a66('0x7'));var config=require(_0x4a66('0x8'));var jayson=require(_0x4a66('0x9'));var client=jayson['client'][_0x4a66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a3b4b,_0x298b1e,_0x533f5a){return new BPromise(function(_0x1f81f7,_0x34c06b){return client[_0x4a66('0xb')](_0x4a3b4b,_0x533f5a)[_0x4a66('0xc')](function(_0x2248f3){logger['info'](_0x4a66('0xd'),_0x298b1e,'request\x20sent');logger[_0x4a66('0xe')](_0x4a66('0xf'),_0x298b1e,_0x4a66('0x10'),JSON['stringify'](_0x2248f3));if(_0x2248f3[_0x4a66('0x11')]){if(_0x2248f3['error'][_0x4a66('0x12')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x298b1e,_0x2248f3[_0x4a66('0x11')][_0x4a66('0x13')]);return _0x34c06b(_0x2248f3['error']['message']);}logger[_0x4a66('0x11')](_0x4a66('0xd'),_0x298b1e,_0x2248f3[_0x4a66('0x11')][_0x4a66('0x13')]);return _0x1f81f7(_0x2248f3[_0x4a66('0x11')]['message']);}else{logger[_0x4a66('0x14')](_0x4a66('0xd'),_0x298b1e,_0x4a66('0x10'));_0x1f81f7(_0x2248f3[_0x4a66('0x15')][_0x4a66('0x13')]);}})[_0x4a66('0x16')](function(_0x21dc97){logger[_0x4a66('0x11')](_0x4a66('0xd'),_0x298b1e,_0x21dc97);_0x34c06b(_0x21dc97);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3d7ccfc..46ca250 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 _0xeb3e=['get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','update','delete','/:id','exports','util','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x15bfaa,_0x4a4269){var _0x47b8e6=function(_0xc1248b){while(--_0xc1248b){_0x15bfaa['push'](_0x15bfaa['shift']());}};_0x47b8e6(++_0x4a4269);}(_0xeb3e,0x13f));var _0xeeb3=function(_0x5b6ace,_0x3a9cf7){_0x5b6ace=_0x5b6ace-0x0;var _0x2e9ba5=_0xeb3e[_0x5b6ace];return _0x2e9ba5;};'use strict';var multer=require('multer');var util=require(_0xeeb3('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeeb3('0x1')]();var fs_extra=require(_0xeeb3('0x2'));var auth=require(_0xeeb3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xeeb3('0x4'));var controller=require('./intFreshdeskAccount.controller');router[_0xeeb3('0x5')]('/',auth[_0xeeb3('0x6')](),controller[_0xeeb3('0x7')]);router[_0xeeb3('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xeeb3('0x8')]);router['get'](_0xeeb3('0x9'),auth[_0xeeb3('0x6')](),controller[_0xeeb3('0xa')]);router['get']('/:id/fields',auth[_0xeeb3('0x6')](),controller[_0xeeb3('0xb')]);router[_0xeeb3('0xc')]('/',auth['isAuthenticated'](),controller[_0xeeb3('0xd')]);router[_0xeeb3('0xc')](_0xeeb3('0x9'),auth[_0xeeb3('0x6')](),controller['addConfiguration']);router['put']('/:id',auth[_0xeeb3('0x6')](),controller[_0xeeb3('0xe')]);router[_0xeeb3('0xf')](_0xeeb3('0x10'),auth[_0xeeb3('0x6')](),controller['destroy']);module[_0xeeb3('0x11')]=router; \ No newline at end of file +var _0xaf07=['./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ee040,_0x2607c0){var _0x452998=function(_0x157d1b){while(--_0x157d1b){_0x1ee040['push'](_0x1ee040['shift']());}};_0x452998(++_0x2607c0);}(_0xaf07,0x65));var _0x7af0=function(_0x29a475,_0x534248){_0x29a475=_0x29a475-0x0;var _0x428d8e=_0xaf07[_0x29a475];return _0x428d8e;};'use strict';var multer=require(_0x7af0('0x0'));var util=require('util');var path=require(_0x7af0('0x1'));var timeout=require(_0x7af0('0x2'));var express=require(_0x7af0('0x3'));var router=express[_0x7af0('0x4')]();var fs_extra=require(_0x7af0('0x5'));var auth=require(_0x7af0('0x6'));var interaction=require(_0x7af0('0x7'));var config=require(_0x7af0('0x8'));var controller=require(_0x7af0('0x9'));router[_0x7af0('0xa')]('/',auth[_0x7af0('0xb')](),controller[_0x7af0('0xc')]);router[_0x7af0('0xa')](_0x7af0('0xd'),auth[_0x7af0('0xb')](),controller[_0x7af0('0xe')]);router[_0x7af0('0xa')](_0x7af0('0xf'),auth[_0x7af0('0xb')](),controller['getConfigurations']);router[_0x7af0('0xa')](_0x7af0('0x10'),auth[_0x7af0('0xb')](),controller['getFields']);router[_0x7af0('0x11')]('/',auth[_0x7af0('0xb')](),controller[_0x7af0('0x12')]);router['post']('/:id/configurations',auth[_0x7af0('0xb')](),controller['addConfiguration']);router['put'](_0x7af0('0xd'),auth[_0x7af0('0xb')](),controller[_0x7af0('0x13')]);router['delete']('/:id',auth[_0x7af0('0xb')](),controller[_0x7af0('0x14')]);module[_0x7af0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6824159..032d041 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 _0x93e9=['sequelize','exports','STRING','username'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x93e9,0xcc));var _0x993e=function(_0xac18d3,_0x3b9c72){_0xac18d3=_0xac18d3-0x0;var _0x231952=_0x93e9[_0xac18d3];return _0x231952;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'username':{'type':Sequelize[_0x993e('0x2')],'unique':_0x993e('0x3')},'apiKey':{'type':Sequelize[_0x993e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6343=['STRING','remoteUri'];(function(_0x2762e1,_0x396db2){var _0xc416d4=function(_0x1ffaeb){while(--_0x1ffaeb){_0x2762e1['push'](_0x2762e1['shift']());}};_0xc416d4(++_0x396db2);}(_0x6343,0x168));var _0x3634=function(_0x454520,_0x131fa5){_0x454520=_0x454520-0x0;var _0x4f265e=_0x6343[_0x454520];return _0x4f265e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3634('0x1')},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ccf142e..04a64e3 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 _0x5b02=['util','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','then','include','findAll','catch','show','params','includeAll','find','body','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','default','choices','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5b02,0xe9));var _0x25b0=function(_0x5f3364,_0x835ba7){_0x5f3364=_0x5f3364-0x0;var _0x11c932=_0x5b02[_0x5f3364];return _0x11c932;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];var integrations=require(_0x25b0('0x19'));function respondWithStatusCode(_0x184452,_0x26a34f){_0x26a34f=_0x26a34f||0xcc;return function(_0x2048dc){if(_0x2048dc){return _0x184452[_0x25b0('0x1a')](_0x26a34f);}return _0x184452[_0x25b0('0x1b')](_0x26a34f)[_0x25b0('0x1c')]();};}function respondWithResult(_0x293203,_0x211658){_0x211658=_0x211658||0xc8;return function(_0x418954){if(_0x418954){return _0x293203[_0x25b0('0x1b')](_0x211658)[_0x25b0('0x1d')](_0x418954);}};}function respondWithFilteredResult(_0x5ac18d,_0x51542b){return function(_0xfe1ea6){if(_0xfe1ea6){var _0x4b2357=typeof _0x51542b[_0x25b0('0x1e')]===_0x25b0('0x1f')&&typeof _0x51542b[_0x25b0('0x20')]===_0x25b0('0x1f');var _0x5e3a3a=_0xfe1ea6[_0x25b0('0x21')];var _0x213a77=_0x4b2357?0x0:_0x51542b[_0x25b0('0x1e')];var _0x385334=_0x4b2357?_0xfe1ea6[_0x25b0('0x21')]:_0x51542b[_0x25b0('0x1e')]+_0x51542b['limit'];var _0x348d36;if(_0x385334>=_0x5e3a3a){_0x385334=_0x5e3a3a;_0x348d36=0xc8;}else{_0x348d36=0xce;}_0x5ac18d[_0x25b0('0x1b')](_0x348d36);return _0x5ac18d[_0x25b0('0x22')](_0x25b0('0x23'),_0x213a77+'-'+_0x385334+'/'+_0x5e3a3a)[_0x25b0('0x1d')](_0xfe1ea6);}return null;};}function patchUpdates(_0xea4162){return function(_0x232be7){try{jsonpatch[_0x25b0('0x24')](_0x232be7,_0xea4162,!![]);}catch(_0x7bdaf9){return BPromise[_0x25b0('0x25')](_0x7bdaf9);}return _0x232be7[_0x25b0('0x26')]();};}function saveUpdates(_0x3ce1da,_0x5cb746){return function(_0x9f432e){if(_0x9f432e){return _0x9f432e[_0x25b0('0x27')](_0x3ce1da)['then'](function(_0x2d7c17){return _0x2d7c17;});}return null;};}function removeEntity(_0x2023d8,_0x3546f0){return function(_0x498fef){if(_0x498fef){return _0x498fef['destroy']()['then'](function(){_0x2023d8[_0x25b0('0x1b')](0xcc)[_0x25b0('0x1c')]();});}};}function handleEntityNotFound(_0x99bd3a,_0x24f847){return function(_0xdbb459){if(!_0xdbb459){_0x99bd3a[_0x25b0('0x1a')](0x194);}return _0xdbb459;};}function handleError(_0x40268a,_0x75ce7a){_0x75ce7a=_0x75ce7a||0x1f4;return function(_0x22e024){logger['error'](_0x22e024[_0x25b0('0x28')]);if(_0x22e024[_0x25b0('0x29')]){delete _0x22e024['name'];}_0x40268a['status'](_0x75ce7a)['send'](_0x22e024);};}exports[_0x25b0('0x2a')]=function(_0x3f0a54,_0x251fad){var _0x105129={},_0x214377={},_0x3285ae={'count':0x0,'rows':[]};var _0x12676b=_[_0x25b0('0x2b')](db[_0x25b0('0x2c')][_0x25b0('0x2d')],function(_0x1e217c){return{'name':_0x1e217c[_0x25b0('0x2e')],'type':_0x1e217c[_0x25b0('0x2f')]['key']};});_0x214377['model']=_[_0x25b0('0x2b')](_0x12676b,'name');_0x214377['query']=_[_0x25b0('0x30')](_0x3f0a54[_0x25b0('0x31')]);_0x214377[_0x25b0('0x32')]=_[_0x25b0('0x33')](_0x214377[_0x25b0('0x34')],_0x214377['query']);_0x105129[_0x25b0('0x35')]=_[_0x25b0('0x33')](_0x214377['model'],qs[_0x25b0('0x36')](_0x3f0a54[_0x25b0('0x31')]['fields']));_0x105129[_0x25b0('0x35')]=_0x105129['attributes'][_0x25b0('0x37')]?_0x105129[_0x25b0('0x35')]:_0x214377[_0x25b0('0x34')];if(!_0x3f0a54[_0x25b0('0x31')][_0x25b0('0x38')](_0x25b0('0x39'))){_0x105129[_0x25b0('0x20')]=qs[_0x25b0('0x20')](_0x3f0a54[_0x25b0('0x31')]['limit']);_0x105129[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x3f0a54[_0x25b0('0x31')][_0x25b0('0x1e')]);}_0x105129[_0x25b0('0x3a')]=qs[_0x25b0('0x3b')](_0x3f0a54[_0x25b0('0x31')][_0x25b0('0x3b')]);_0x105129[_0x25b0('0x3c')]=qs[_0x25b0('0x32')](_['pick'](_0x3f0a54[_0x25b0('0x31')],_0x214377[_0x25b0('0x32')]),_0x12676b);if(_0x3f0a54[_0x25b0('0x31')]['filter']){_0x105129[_0x25b0('0x3c')]=_[_0x25b0('0x3d')](_0x105129[_0x25b0('0x3c')],{'$or':_[_0x25b0('0x2b')](_0x12676b,function(_0x17f67c){if(_0x17f67c[_0x25b0('0x2f')]!==_0x25b0('0x3e')){var _0x391493={};_0x391493[_0x17f67c['name']]={'$like':'%'+_0x3f0a54['query'][_0x25b0('0x3f')]+'%'};return _0x391493;}})});}_0x105129=_[_0x25b0('0x3d')]({},_0x105129,_0x3f0a54[_0x25b0('0x40')]);var _0x52c0af={'where':_0x105129[_0x25b0('0x3c')]};return db['FreshdeskAccount'][_0x25b0('0x21')](_0x52c0af)[_0x25b0('0x41')](function(_0xbd0db5){_0x3285ae[_0x25b0('0x21')]=_0xbd0db5;if(_0x3f0a54[_0x25b0('0x31')]['includeAll']){_0x105129[_0x25b0('0x42')]=[{'all':!![]}];}return db[_0x25b0('0x2c')][_0x25b0('0x43')](_0x105129);})[_0x25b0('0x41')](function(_0x428799){_0x3285ae['rows']=_0x428799;return _0x3285ae;})[_0x25b0('0x41')](respondWithFilteredResult(_0x251fad,_0x105129))[_0x25b0('0x44')](handleError(_0x251fad,null));};exports[_0x25b0('0x45')]=function(_0x44c400,_0x35fc00){var _0x1adf8d={'raw':![],'where':{'id':_0x44c400[_0x25b0('0x46')]['id']}},_0x51deba={};_0x51deba[_0x25b0('0x34')]=_[_0x25b0('0x30')](db[_0x25b0('0x2c')]['rawAttributes']);_0x51deba[_0x25b0('0x31')]=_['keys'](_0x44c400[_0x25b0('0x31')]);_0x51deba[_0x25b0('0x32')]=_[_0x25b0('0x33')](_0x51deba[_0x25b0('0x34')],_0x51deba['query']);_0x1adf8d[_0x25b0('0x35')]=_[_0x25b0('0x33')](_0x51deba[_0x25b0('0x34')],qs['fields'](_0x44c400[_0x25b0('0x31')][_0x25b0('0x36')]));_0x1adf8d[_0x25b0('0x35')]=_0x1adf8d[_0x25b0('0x35')][_0x25b0('0x37')]?_0x1adf8d[_0x25b0('0x35')]:_0x51deba[_0x25b0('0x34')];if(_0x44c400['query'][_0x25b0('0x47')]){_0x1adf8d[_0x25b0('0x42')]=[{'all':!![]}];}_0x1adf8d=_[_0x25b0('0x3d')]({},_0x1adf8d,_0x44c400['options']);return db[_0x25b0('0x2c')][_0x25b0('0x48')](_0x1adf8d)[_0x25b0('0x41')](handleEntityNotFound(_0x35fc00,null))[_0x25b0('0x41')](respondWithResult(_0x35fc00,null))[_0x25b0('0x44')](handleError(_0x35fc00,null));};exports['create']=function(_0x1e8a8d,_0x1cf933){return db[_0x25b0('0x2c')]['create'](_0x1e8a8d[_0x25b0('0x49')],{})[_0x25b0('0x41')](respondWithResult(_0x1cf933,0xc9))[_0x25b0('0x44')](handleError(_0x1cf933,null));};exports[_0x25b0('0x27')]=function(_0x29165e,_0x3d4531){if(_0x29165e['body']['id']){delete _0x29165e['body']['id'];}return db['FreshdeskAccount'][_0x25b0('0x48')]({'where':{'id':_0x29165e['params']['id']}})['then'](handleEntityNotFound(_0x3d4531,null))[_0x25b0('0x41')](saveUpdates(_0x29165e['body'],null))[_0x25b0('0x41')](respondWithResult(_0x3d4531,null))['catch'](handleError(_0x3d4531,null));};exports['destroy']=function(_0x394e52,_0x14a8a7){return db[_0x25b0('0x2c')][_0x25b0('0x48')]({'where':{'id':_0x394e52[_0x25b0('0x46')]['id']}})[_0x25b0('0x41')](handleEntityNotFound(_0x14a8a7,null))[_0x25b0('0x41')](removeEntity(_0x14a8a7,null))[_0x25b0('0x44')](handleError(_0x14a8a7,null));};exports[_0x25b0('0x4a')]=function(_0x20d56f,_0x48fb71,_0x4d3e9e){var _0x582f36={};var _0xf1e6bf={};var _0xa45e87;var _0x2a28fb;return db[_0x25b0('0x2c')][_0x25b0('0x4b')]({'where':{'id':_0x20d56f[_0x25b0('0x46')]['id']}})[_0x25b0('0x41')](handleEntityNotFound(_0x48fb71,null))['then'](function(_0x64ffa3){if(_0x64ffa3){_0xa45e87=_0x64ffa3;_0xf1e6bf['model']=_[_0x25b0('0x30')](db['FreshdeskConfiguration']['rawAttributes']);_0xf1e6bf[_0x25b0('0x31')]=_['keys'](_0x20d56f['query']);_0xf1e6bf[_0x25b0('0x32')]=_[_0x25b0('0x33')](_0xf1e6bf[_0x25b0('0x34')],_0xf1e6bf[_0x25b0('0x31')]);_0x582f36[_0x25b0('0x35')]=_[_0x25b0('0x33')](_0xf1e6bf[_0x25b0('0x34')],qs[_0x25b0('0x36')](_0x20d56f[_0x25b0('0x31')][_0x25b0('0x36')]));_0x582f36['attributes']=_0x582f36['attributes'][_0x25b0('0x37')]?_0x582f36[_0x25b0('0x35')]:_0xf1e6bf['model'];_0x582f36[_0x25b0('0x3a')]=qs[_0x25b0('0x3b')](_0x20d56f[_0x25b0('0x31')][_0x25b0('0x3b')]);_0x582f36[_0x25b0('0x3c')]=qs['filters'](_[_0x25b0('0x4c')](_0x20d56f[_0x25b0('0x31')],_0xf1e6bf[_0x25b0('0x32')]));if(_0x20d56f['query'][_0x25b0('0x3f')]){_0x582f36[_0x25b0('0x3c')]=_[_0x25b0('0x3d')](_0x582f36[_0x25b0('0x3c')],{'$or':_[_0x25b0('0x2b')](_0x582f36[_0x25b0('0x35')],function(_0x6f17a4){var _0x2ccf0c={};_0x2ccf0c[_0x6f17a4]={'$like':'%'+_0x20d56f[_0x25b0('0x31')][_0x25b0('0x3f')]+'%'};return _0x2ccf0c;})});}_0x582f36=_[_0x25b0('0x3d')]({},_0x582f36,_0x20d56f[_0x25b0('0x40')]);return _0xa45e87[_0x25b0('0x4a')](_0x582f36);}})[_0x25b0('0x41')](function(_0x561634){if(_0x561634){_0x2a28fb=_0x561634[_0x25b0('0x37')];if(!_0x20d56f[_0x25b0('0x31')]['hasOwnProperty'](_0x25b0('0x39'))){_0x582f36['limit']=qs[_0x25b0('0x20')](_0x20d56f[_0x25b0('0x31')]['limit']);_0x582f36[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x20d56f[_0x25b0('0x31')]['offset']);}return _0xa45e87[_0x25b0('0x4a')](_0x582f36);}})['then'](function(_0x1be54a){if(_0x1be54a){return _0x1be54a?{'count':_0x2a28fb,'rows':_0x1be54a}:null;}})[_0x25b0('0x41')](respondWithResult(_0x48fb71,null))['catch'](handleError(_0x48fb71,null));};exports[_0x25b0('0x4d')]=function(_0x4457d1,_0x4efa96,_0x26e4fd){if(_0x4457d1['body']['id']){delete _0x4457d1['body']['id'];}return db['FreshdeskAccount'][_0x25b0('0x4b')]({'where':{'id':_0x4457d1[_0x25b0('0x46')]['id']}})[_0x25b0('0x41')](handleEntityNotFound(_0x4efa96,null))['then'](function(_0x45f175){if(_0x45f175){_0x4457d1[_0x25b0('0x49')][_0x25b0('0x4e')]=_0x45f175['id'];_0x4457d1[_0x25b0('0x49')][_0x25b0('0x4f')]=integrations[_0x25b0('0x50')](_0x4457d1[_0x25b0('0x49')][_0x25b0('0x51')],_0x4457d1[_0x25b0('0x49')][_0x25b0('0x2f')]);_0x4457d1[_0x25b0('0x49')][_0x25b0('0x52')]=integrations[_0x25b0('0x53')](_0x4457d1[_0x25b0('0x49')][_0x25b0('0x51')],_0x4457d1[_0x25b0('0x49')][_0x25b0('0x2f')]);return db['FreshdeskConfiguration'][_0x25b0('0x54')](_0x4457d1['body'],{'include':[{'model':db[_0x25b0('0x55')],'as':_0x25b0('0x4f')},{'model':db[_0x25b0('0x55')],'as':_0x25b0('0x52')}]});}return null;})['then'](respondWithResult(_0x4efa96,null))[_0x25b0('0x44')](handleError(_0x4efa96,null));};exports[_0x25b0('0x56')]=function(_0x3e326c,_0x2217e7,_0x46a1d1){var _0x19e49c='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x3e326c[_0x25b0('0x46')]['id']},'attributes':['id','remoteUri',_0x25b0('0x57')]})[_0x25b0('0x41')](handleEntityNotFound(_0x2217e7,null))[_0x25b0('0x41')](function(_0x5279ab){if(_0x5279ab){_0x19e49c=_0x5279ab[_0x25b0('0x58')];var _0x1259ad=_0x19e49c[_0x25b0('0x59')](-0x1);if(_0x1259ad==='/'){_0x19e49c=_0x19e49c[_0x25b0('0x5a')](0x0,_0x19e49c['lastIndexOf'](_0x1259ad));}return rp({'method':_0x25b0('0x5b'),'uri':util[_0x25b0('0x5c')](_0x25b0('0x5d'),_0x19e49c,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x25b0('0x5c')](_0x25b0('0x5e'),new Buffer(util[_0x25b0('0x5c')](_0x25b0('0x5f'),_0x5279ab[_0x25b0('0x57')]))[_0x25b0('0x60')](_0x25b0('0x61')))},'json':!![]});}})[_0x25b0('0x41')](function(_0x55a48d){if(_0x55a48d){var _0x1f5757=[_0x25b0('0x62'),_0x25b0('0x63'),_0x25b0('0x64'),'description','status',_0x25b0('0x65'),_0x25b0('0x66'),_0x25b0('0x67'),_0x25b0('0x68'),'group',_0x25b0('0x69')];_[_0x25b0('0x6a')](_0x55a48d,function(_0x4876a4){return _0x1f5757[_0x25b0('0x6b')](_0x4876a4[_0x25b0('0x29')])||!_0x4876a4['default']&&_0x4876a4['type']!==_0x25b0('0x6c')&&_0x4876a4[_0x25b0('0x2f')]!==_0x25b0('0x6d');});return{'count':_0x55a48d[_0x25b0('0x37')],'rows':_[_0x25b0('0x2b')](_0x55a48d,function(_0x171d80){return{'id':_0x171d80[_0x25b0('0x29')],'name':_0x171d80[_0x25b0('0x6e')],'custom':!_0x171d80[_0x25b0('0x6f')],'options':_0x171d80[_0x25b0('0x70')]?_[_0x25b0('0x2b')](_0x171d80[_0x25b0('0x70')],function(_0x217f16){return{'name':_['capitalize'](_0x217f16),'value':_0x217f16};}):[]};})};}})[_0x25b0('0x41')](respondWithResult(_0x2217e7,null))['catch'](function(_0x472ae1){var _0x46a839=_0x3e326c['query'][_0x25b0('0x71')]?0x1f4:_0x472ae1[_0x25b0('0x72')]||0x1f4;logger[_0x25b0('0x73')](_0x25b0('0x74'),_0x25b0('0x56'),_0x46a839,JSON[_0x25b0('0x75')](_0x472ae1));delete _0x472ae1[_0x25b0('0x29')];if(_0x46a839===0x191){_0x46a839=0x190;}_0x2217e7[_0x25b0('0x1b')](_0x46a839)[_0x25b0('0x76')](_0x3e326c[_0x25b0('0x31')][_0x25b0('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x472ae1['statusCode']}:_0x472ae1);});}; \ No newline at end of file +var _0x58a7=['remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','FreshdeskField','slice','substring','lastIndexOf','GET','api/v2/ticket_fields','format','%s:X','apiKey','toString','base64','requester','agent','description','priority','group','company'];(function(_0x4a045d,_0x10b826){var _0x10f896=function(_0x41f096){while(--_0x41f096){_0x4a045d['push'](_0x4a045d['shift']());}};_0x10f896(++_0x10b826);}(_0x58a7,0xf7));var _0x758a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x58a7[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x758a('0x0'));var rimraf=require(_0x758a('0x1'));var zipdir=require(_0x758a('0x2'));var jsonpatch=require(_0x758a('0x3'));var rp=require(_0x758a('0x4'));var moment=require(_0x758a('0x5'));var BPromise=require(_0x758a('0x6'));var Mustache=require(_0x758a('0x7'));var util=require('util');var path=require(_0x758a('0x8'));var sox=require(_0x758a('0x9'));var csv=require(_0x758a('0xa'));var ejs=require(_0x758a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x758a('0xc'));var crypto=require('crypto');var jsforce=require(_0x758a('0xd'));var deskjs=require(_0x758a('0xe'));var toCsv=require(_0x758a('0xa'));var querystring=require(_0x758a('0xf'));var Papa=require(_0x758a('0x10'));var Redis=require(_0x758a('0x11'));var authService=require(_0x758a('0x12'));var qs=require(_0x758a('0x13'));var as=require(_0x758a('0x14'));var hardwareService=require(_0x758a('0x15'));var logger=require(_0x758a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x758a('0x17'));var licenseUtil=require(_0x758a('0x18'));var db=require(_0x758a('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e1ee0,_0x2cc841){_0x2cc841=_0x2cc841||0xcc;return function(_0x3a496f){if(_0x3a496f){return _0x3e1ee0[_0x758a('0x1a')](_0x2cc841);}return _0x3e1ee0[_0x758a('0x1b')](_0x2cc841)['end']();};}function respondWithResult(_0x4b0b39,_0x4581df){_0x4581df=_0x4581df||0xc8;return function(_0x194bb9){if(_0x194bb9){return _0x4b0b39[_0x758a('0x1b')](_0x4581df)['json'](_0x194bb9);}};}function respondWithFilteredResult(_0x4e4aee,_0x5a9512){return function(_0x5bdbfb){if(_0x5bdbfb){var _0x460aa8=typeof _0x5a9512[_0x758a('0x1c')]==='undefined'&&typeof _0x5a9512[_0x758a('0x1d')]===_0x758a('0x1e');var _0x197abf=_0x5bdbfb[_0x758a('0x1f')];var _0x2a2850=_0x460aa8?0x0:_0x5a9512[_0x758a('0x1c')];var _0x452bbb=_0x460aa8?_0x5bdbfb[_0x758a('0x1f')]:_0x5a9512[_0x758a('0x1c')]+_0x5a9512[_0x758a('0x1d')];var _0x317427;if(_0x452bbb>=_0x197abf){_0x452bbb=_0x197abf;_0x317427=0xc8;}else{_0x317427=0xce;}_0x4e4aee[_0x758a('0x1b')](_0x317427);return _0x4e4aee[_0x758a('0x20')](_0x758a('0x21'),_0x2a2850+'-'+_0x452bbb+'/'+_0x197abf)[_0x758a('0x22')](_0x5bdbfb);}return null;};}function patchUpdates(_0x1effec){return function(_0x485900){try{jsonpatch[_0x758a('0x23')](_0x485900,_0x1effec,!![]);}catch(_0x301173){return BPromise[_0x758a('0x24')](_0x301173);}return _0x485900[_0x758a('0x25')]();};}function saveUpdates(_0x239fd9,_0x26acb8){return function(_0x135601){if(_0x135601){return _0x135601['update'](_0x239fd9)[_0x758a('0x26')](function(_0x24d5cf){return _0x24d5cf;});}return null;};}function removeEntity(_0x56a99a,_0x4b1e08){return function(_0xfbcf60){if(_0xfbcf60){return _0xfbcf60[_0x758a('0x27')]()[_0x758a('0x26')](function(){_0x56a99a[_0x758a('0x1b')](0xcc)[_0x758a('0x28')]();});}};}function handleEntityNotFound(_0x51f18f,_0xa359e){return function(_0x5d0499){if(!_0x5d0499){_0x51f18f['sendStatus'](0x194);}return _0x5d0499;};}function handleError(_0x24e3d4,_0x3e01f4){_0x3e01f4=_0x3e01f4||0x1f4;return function(_0x46a2a2){logger['error'](_0x46a2a2[_0x758a('0x29')]);if(_0x46a2a2[_0x758a('0x2a')]){delete _0x46a2a2[_0x758a('0x2a')];}_0x24e3d4[_0x758a('0x1b')](_0x3e01f4)[_0x758a('0x2b')](_0x46a2a2);};}exports[_0x758a('0x2c')]=function(_0xe21322,_0x6c4025){var _0x1d2a65={},_0x25418b={},_0x1808c8={'count':0x0,'rows':[]};var _0x51b6d2=_['map'](db[_0x758a('0x2d')][_0x758a('0x2e')],function(_0x150ce5){return{'name':_0x150ce5[_0x758a('0x2f')],'type':_0x150ce5[_0x758a('0x30')][_0x758a('0x31')]};});_0x25418b[_0x758a('0x32')]=_[_0x758a('0x33')](_0x51b6d2,_0x758a('0x2a'));_0x25418b[_0x758a('0x34')]=_[_0x758a('0x35')](_0xe21322[_0x758a('0x34')]);_0x25418b[_0x758a('0x36')]=_['intersection'](_0x25418b[_0x758a('0x32')],_0x25418b[_0x758a('0x34')]);_0x1d2a65['attributes']=_[_0x758a('0x37')](_0x25418b[_0x758a('0x32')],qs[_0x758a('0x38')](_0xe21322[_0x758a('0x34')]['fields']));_0x1d2a65['attributes']=_0x1d2a65[_0x758a('0x39')][_0x758a('0x3a')]?_0x1d2a65['attributes']:_0x25418b['model'];if(!_0xe21322[_0x758a('0x34')][_0x758a('0x3b')](_0x758a('0x3c'))){_0x1d2a65[_0x758a('0x1d')]=qs[_0x758a('0x1d')](_0xe21322['query'][_0x758a('0x1d')]);_0x1d2a65['offset']=qs['offset'](_0xe21322[_0x758a('0x34')][_0x758a('0x1c')]);}_0x1d2a65[_0x758a('0x3d')]=qs[_0x758a('0x3e')](_0xe21322[_0x758a('0x34')]['sort']);_0x1d2a65[_0x758a('0x3f')]=qs[_0x758a('0x36')](_[_0x758a('0x40')](_0xe21322[_0x758a('0x34')],_0x25418b[_0x758a('0x36')]),_0x51b6d2);if(_0xe21322[_0x758a('0x34')][_0x758a('0x41')]){_0x1d2a65['where']=_[_0x758a('0x42')](_0x1d2a65[_0x758a('0x3f')],{'$or':_[_0x758a('0x33')](_0x51b6d2,function(_0x3b6f60){if(_0x3b6f60[_0x758a('0x30')]!=='VIRTUAL'){var _0x677b02={};_0x677b02[_0x3b6f60[_0x758a('0x2a')]]={'$like':'%'+_0xe21322[_0x758a('0x34')]['filter']+'%'};return _0x677b02;}})});}_0x1d2a65=_[_0x758a('0x42')]({},_0x1d2a65,_0xe21322['options']);var _0x219d47={'where':_0x1d2a65[_0x758a('0x3f')]};return db['FreshdeskAccount'][_0x758a('0x1f')](_0x219d47)[_0x758a('0x26')](function(_0x24755f){_0x1808c8[_0x758a('0x1f')]=_0x24755f;if(_0xe21322[_0x758a('0x34')][_0x758a('0x43')]){_0x1d2a65[_0x758a('0x44')]=[{'all':!![]}];}return db[_0x758a('0x2d')][_0x758a('0x45')](_0x1d2a65);})[_0x758a('0x26')](function(_0x1698ea){_0x1808c8[_0x758a('0x46')]=_0x1698ea;return _0x1808c8;})[_0x758a('0x26')](respondWithFilteredResult(_0x6c4025,_0x1d2a65))[_0x758a('0x47')](handleError(_0x6c4025,null));};exports[_0x758a('0x48')]=function(_0x7c2406,_0x111d5d){var _0x3a7bca={'raw':![],'where':{'id':_0x7c2406['params']['id']}},_0x114fcb={};_0x114fcb[_0x758a('0x32')]=_[_0x758a('0x35')](db['FreshdeskAccount']['rawAttributes']);_0x114fcb[_0x758a('0x34')]=_['keys'](_0x7c2406['query']);_0x114fcb[_0x758a('0x36')]=_[_0x758a('0x37')](_0x114fcb['model'],_0x114fcb[_0x758a('0x34')]);_0x3a7bca[_0x758a('0x39')]=_[_0x758a('0x37')](_0x114fcb[_0x758a('0x32')],qs[_0x758a('0x38')](_0x7c2406[_0x758a('0x34')][_0x758a('0x38')]));_0x3a7bca[_0x758a('0x39')]=_0x3a7bca['attributes']['length']?_0x3a7bca[_0x758a('0x39')]:_0x114fcb[_0x758a('0x32')];if(_0x7c2406[_0x758a('0x34')][_0x758a('0x43')]){_0x3a7bca[_0x758a('0x44')]=[{'all':!![]}];}_0x3a7bca=_[_0x758a('0x42')]({},_0x3a7bca,_0x7c2406[_0x758a('0x49')]);return db[_0x758a('0x2d')][_0x758a('0x4a')](_0x3a7bca)['then'](handleEntityNotFound(_0x111d5d,null))[_0x758a('0x26')](respondWithResult(_0x111d5d,null))['catch'](handleError(_0x111d5d,null));};exports['create']=function(_0x1b243c,_0x3b51d6){return db['FreshdeskAccount'][_0x758a('0x4b')](_0x1b243c[_0x758a('0x4c')],{})[_0x758a('0x26')](respondWithResult(_0x3b51d6,0xc9))[_0x758a('0x47')](handleError(_0x3b51d6,null));};exports[_0x758a('0x4d')]=function(_0x5c4645,_0x3d867c){if(_0x5c4645[_0x758a('0x4c')]['id']){delete _0x5c4645[_0x758a('0x4c')]['id'];}return db[_0x758a('0x2d')][_0x758a('0x4a')]({'where':{'id':_0x5c4645['params']['id']}})[_0x758a('0x26')](handleEntityNotFound(_0x3d867c,null))['then'](saveUpdates(_0x5c4645[_0x758a('0x4c')],null))[_0x758a('0x26')](respondWithResult(_0x3d867c,null))[_0x758a('0x47')](handleError(_0x3d867c,null));};exports[_0x758a('0x27')]=function(_0x337582,_0x130abf){return db[_0x758a('0x2d')][_0x758a('0x4a')]({'where':{'id':_0x337582[_0x758a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x130abf,null))[_0x758a('0x26')](removeEntity(_0x130abf,null))[_0x758a('0x47')](handleError(_0x130abf,null));};exports[_0x758a('0x4f')]=function(_0x181d03,_0x58dc40,_0x54dcc5){var _0x2316b3={};var _0x1b1b86={};var _0xaee57a;var _0x33c70a;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x181d03['params']['id']}})[_0x758a('0x26')](handleEntityNotFound(_0x58dc40,null))[_0x758a('0x26')](function(_0x80e8ef){if(_0x80e8ef){_0xaee57a=_0x80e8ef;_0x1b1b86['model']=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x1b1b86[_0x758a('0x34')]=_[_0x758a('0x35')](_0x181d03[_0x758a('0x34')]);_0x1b1b86[_0x758a('0x36')]=_[_0x758a('0x37')](_0x1b1b86[_0x758a('0x32')],_0x1b1b86[_0x758a('0x34')]);_0x2316b3[_0x758a('0x39')]=_[_0x758a('0x37')](_0x1b1b86[_0x758a('0x32')],qs[_0x758a('0x38')](_0x181d03[_0x758a('0x34')]['fields']));_0x2316b3['attributes']=_0x2316b3[_0x758a('0x39')][_0x758a('0x3a')]?_0x2316b3[_0x758a('0x39')]:_0x1b1b86[_0x758a('0x32')];_0x2316b3['order']=qs[_0x758a('0x3e')](_0x181d03[_0x758a('0x34')][_0x758a('0x3e')]);_0x2316b3[_0x758a('0x3f')]=qs[_0x758a('0x36')](_[_0x758a('0x40')](_0x181d03[_0x758a('0x34')],_0x1b1b86['filters']));if(_0x181d03[_0x758a('0x34')][_0x758a('0x41')]){_0x2316b3[_0x758a('0x3f')]=_['merge'](_0x2316b3[_0x758a('0x3f')],{'$or':_[_0x758a('0x33')](_0x2316b3[_0x758a('0x39')],function(_0x3405f8){var _0x251035={};_0x251035[_0x3405f8]={'$like':'%'+_0x181d03[_0x758a('0x34')][_0x758a('0x41')]+'%'};return _0x251035;})});}_0x2316b3=_[_0x758a('0x42')]({},_0x2316b3,_0x181d03[_0x758a('0x49')]);return _0xaee57a[_0x758a('0x4f')](_0x2316b3);}})['then'](function(_0x13ebf8){if(_0x13ebf8){_0x33c70a=_0x13ebf8['length'];if(!_0x181d03[_0x758a('0x34')][_0x758a('0x3b')](_0x758a('0x3c'))){_0x2316b3[_0x758a('0x1d')]=qs['limit'](_0x181d03[_0x758a('0x34')][_0x758a('0x1d')]);_0x2316b3[_0x758a('0x1c')]=qs[_0x758a('0x1c')](_0x181d03[_0x758a('0x34')][_0x758a('0x1c')]);}return _0xaee57a[_0x758a('0x4f')](_0x2316b3);}})[_0x758a('0x26')](function(_0x25b99c){if(_0x25b99c){return _0x25b99c?{'count':_0x33c70a,'rows':_0x25b99c}:null;}})[_0x758a('0x26')](respondWithResult(_0x58dc40,null))[_0x758a('0x47')](handleError(_0x58dc40,null));};exports['addConfiguration']=function(_0x11ca3b,_0x846881,_0x2e1045){if(_0x11ca3b[_0x758a('0x4c')]['id']){delete _0x11ca3b[_0x758a('0x4c')]['id'];}return db[_0x758a('0x2d')]['findOne']({'where':{'id':_0x11ca3b[_0x758a('0x4e')]['id']}})[_0x758a('0x26')](handleEntityNotFound(_0x846881,null))['then'](function(_0x71073f){if(_0x71073f){_0x11ca3b[_0x758a('0x4c')][_0x758a('0x50')]=_0x71073f['id'];_0x11ca3b['body'][_0x758a('0x51')]=integrations[_0x758a('0x52')](_0x11ca3b['body']['channel'],_0x11ca3b[_0x758a('0x4c')][_0x758a('0x30')]);_0x11ca3b['body'][_0x758a('0x53')]=integrations['getDescriptions'](_0x11ca3b['body']['channel'],_0x11ca3b['body'][_0x758a('0x30')]);return db['FreshdeskConfiguration']['create'](_0x11ca3b[_0x758a('0x4c')],{'include':[{'model':db[_0x758a('0x54')],'as':_0x758a('0x51')},{'model':db['FreshdeskField'],'as':_0x758a('0x53')}]});}return null;})['then'](respondWithResult(_0x846881,null))[_0x758a('0x47')](handleError(_0x846881,null));};exports['getFields']=function(_0x36a651,_0x52a120,_0x54cd6a){var _0x2f07f0='';return db[_0x758a('0x2d')]['findOne']({'where':{'id':_0x36a651[_0x758a('0x4e')]['id']},'attributes':['id','remoteUri','apiKey']})[_0x758a('0x26')](handleEntityNotFound(_0x52a120,null))[_0x758a('0x26')](function(_0x27ebdf){if(_0x27ebdf){_0x2f07f0=_0x27ebdf['remoteUri'];var _0x4f7de6=_0x2f07f0[_0x758a('0x55')](-0x1);if(_0x4f7de6==='/'){_0x2f07f0=_0x2f07f0[_0x758a('0x56')](0x0,_0x2f07f0[_0x758a('0x57')](_0x4f7de6));}return rp({'method':_0x758a('0x58'),'uri':util['format']('%s/%s',_0x2f07f0,_0x758a('0x59')),'headers':{'Authorization':util[_0x758a('0x5a')]('Basic\x20%s',new Buffer(util['format'](_0x758a('0x5b'),_0x27ebdf[_0x758a('0x5c')]))[_0x758a('0x5d')](_0x758a('0x5e')))},'json':!![]});}})['then'](function(_0x1c00ed){if(_0x1c00ed){var _0x2ec75a=[_0x758a('0x5f'),'subject',_0x758a('0x60'),_0x758a('0x61'),_0x758a('0x1b'),_0x758a('0x62'),_0x758a('0x63'),'source','ticket_type',_0x758a('0x63'),_0x758a('0x64')];_[_0x758a('0x65')](_0x1c00ed,function(_0x4a8c7f){return _0x2ec75a[_0x758a('0x66')](_0x4a8c7f[_0x758a('0x2a')])||!_0x4a8c7f[_0x758a('0x67')]&&_0x4a8c7f['type']!==_0x758a('0x68')&&_0x4a8c7f[_0x758a('0x30')]!==_0x758a('0x69');});return{'count':_0x1c00ed[_0x758a('0x3a')],'rows':_[_0x758a('0x33')](_0x1c00ed,function(_0x510ad9){return{'id':_0x510ad9[_0x758a('0x2a')],'name':_0x510ad9[_0x758a('0x6a')],'custom':!_0x510ad9['default'],'options':_0x510ad9[_0x758a('0x6b')]?_[_0x758a('0x33')](_0x510ad9['choices'],function(_0x3284f7){return{'name':_[_0x758a('0x6c')](_0x3284f7),'value':_0x3284f7};}):[]};})};}})['then'](respondWithResult(_0x52a120,null))[_0x758a('0x47')](function(_0x1f5ff1){var _0x4fbe0b=_0x36a651[_0x758a('0x34')]['test']?0x1f4:_0x1f5ff1[_0x758a('0x6d')]||0x1f4;logger[_0x758a('0x6e')](_0x758a('0x6f'),_0x758a('0x70'),_0x4fbe0b,JSON[_0x758a('0x71')](_0x1f5ff1));delete _0x1f5ff1[_0x758a('0x2a')];if(_0x4fbe0b===0x191){_0x4fbe0b=0x190;}_0x52a120['status'](_0x4fbe0b)[_0x758a('0x2b')](_0x36a651[_0x758a('0x34')][_0x758a('0x72')]?{'message':_0x758a('0x73'),'statusCode':_0x1f5ff1[_0x758a('0x6d')]}:_0x1f5ff1);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 8fb356e..457d84e 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 _0xdb72=['./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x288371,_0x35f999){var _0x5a1ad1=function(_0xc35a07){while(--_0xc35a07){_0x288371['push'](_0x288371['shift']());}};_0x5a1ad1(++_0x35f999);}(_0xdb72,0xd7));var _0x2db7=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0xdb72[_0x13342f];return _0x2fc1fc;};'use strict';var _=require(_0x2db7('0x0'));var util=require(_0x2db7('0x1'));var logger=require(_0x2db7('0x2'))(_0x2db7('0x3'));var moment=require(_0x2db7('0x4'));var BPromise=require(_0x2db7('0x5'));var rp=require(_0x2db7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2db7('0x7'));var config=require(_0x2db7('0x8'));var attributes=require(_0x2db7('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x2db7('0xa')]=function(_0x300b21,_0x981b7b){return _0x300b21[_0x2db7('0xb')](_0x2db7('0xc'),attributes,{'tableName':_0x2db7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b59=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0xbfcf07,_0x3dd6f0){var _0x2a7548=function(_0x2653e3){while(--_0x2653e3){_0xbfcf07['push'](_0xbfcf07['shift']());}};_0x2a7548(++_0x3dd6f0);}(_0x3b59,0xf0));var _0x93b5=function(_0x55bba6,_0x2f1a61){_0x55bba6=_0x55bba6-0x0;var _0x34bc85=_0x3b59[_0x55bba6];return _0x34bc85;};'use strict';var _=require(_0x93b5('0x0'));var util=require('util');var logger=require(_0x93b5('0x1'))(_0x93b5('0x2'));var moment=require(_0x93b5('0x3'));var BPromise=require(_0x93b5('0x4'));var rp=require(_0x93b5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93b5('0x6'));var config=require(_0x93b5('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x93b5('0x8'));module['exports']=function(_0x27b3f0,_0x3e8cd0){return _0x27b3f0[_0x93b5('0x9')](_0x93b5('0xa'),attributes,{'tableName':_0x93b5('0xb'),'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 1452983..ab39950 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 _0xdbf7=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','map','include','attributes','model','ShowFreshdeskAccount'];(function(_0x3c457f,_0x307fb5){var _0x54ec35=function(_0x55105b){while(--_0x55105b){_0x3c457f['push'](_0x3c457f['shift']());}};_0x54ec35(++_0x307fb5);}(_0xdbf7,0x8d));var _0x7dbf=function(_0xfc2190,_0x303514){_0xfc2190=_0xfc2190-0x0;var _0x2fc49e=_0xdbf7[_0xfc2190];return _0x2fc49e;};'use strict';var _=require(_0x7dbf('0x0'));var util=require(_0x7dbf('0x1'));var moment=require(_0x7dbf('0x2'));var BPromise=require(_0x7dbf('0x3'));var rs=require(_0x7dbf('0x4'));var fs=require('fs');var Redis=require(_0x7dbf('0x5'));var db=require(_0x7dbf('0x6'))['db'];var utils=require(_0x7dbf('0x7'));var logger=require('../../config/logger')(_0x7dbf('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dbf('0x9')][_0x7dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x601b60,_0x3df94e,_0x29f02b){return new BPromise(function(_0x3e7a9c,_0x3f4efe){return client[_0x7dbf('0xb')](_0x601b60,_0x29f02b)[_0x7dbf('0xc')](function(_0x1851fc){logger[_0x7dbf('0xd')](_0x7dbf('0xe'),_0x3df94e,_0x7dbf('0xf'));logger[_0x7dbf('0x10')](_0x7dbf('0x11'),_0x3df94e,'request\x20sent',JSON[_0x7dbf('0x12')](_0x1851fc));if(_0x1851fc[_0x7dbf('0x13')]){if(_0x1851fc[_0x7dbf('0x13')][_0x7dbf('0x14')]===0x1f4){logger[_0x7dbf('0x13')](_0x7dbf('0xe'),_0x3df94e,_0x1851fc['error'][_0x7dbf('0x15')]);return _0x3f4efe(_0x1851fc['error']['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3df94e,_0x1851fc[_0x7dbf('0x13')][_0x7dbf('0x15')]);return _0x3e7a9c(_0x1851fc[_0x7dbf('0x13')]['message']);}else{logger[_0x7dbf('0xd')](_0x7dbf('0xe'),_0x3df94e,_0x7dbf('0xf'));_0x3e7a9c(_0x1851fc['result'][_0x7dbf('0x15')]);}})[_0x7dbf('0x16')](function(_0x11ee4d){logger[_0x7dbf('0x13')](_0x7dbf('0xe'),_0x3df94e,_0x11ee4d);_0x3f4efe(_0x11ee4d);});});}exports[_0x7dbf('0x17')]=function(_0xc47749){var _0x47e7b4=this;return new Promise(function(_0x3abe64,_0x49b09f){return db[_0x7dbf('0x18')]['findAll']({'raw':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')][_0x7dbf('0x1a')]===undefined?!![]:![]:!![],'where':_0xc47749[_0x7dbf('0x19')]?_0xc47749['options'][_0x7dbf('0x1b')]||null:null,'attributes':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')]['attributes']||null:null,'limit':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')][_0x7dbf('0x1c')]||null:null,'include':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')]['include']?_[_0x7dbf('0x1d')](_0xc47749[_0x7dbf('0x19')][_0x7dbf('0x1e')],function(_0x502014){return{'model':db[_0x502014['model']],'as':_0x502014['as'],'attributes':_0x502014[_0x7dbf('0x1f')],'include':_0x502014[_0x7dbf('0x1e')]?_[_0x7dbf('0x1d')](_0x502014[_0x7dbf('0x1e')],function(_0x205a70){return{'model':db[_0x205a70[_0x7dbf('0x20')]],'as':_0x205a70['as'],'attributes':_0x205a70[_0x7dbf('0x1f')],'include':_0x205a70['include']?_['map'](_0x205a70[_0x7dbf('0x1e')],function(_0x2403d7){return{'model':db[_0x2403d7['model']],'as':_0x2403d7['as'],'attributes':_0x2403d7[_0x7dbf('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7dbf('0xc')](function(_0x292a2c){logger[_0x7dbf('0xd')]('GetFreshdeskAccount',_0xc47749);logger[_0x7dbf('0x10')]('GetFreshdeskAccount',_0xc47749,JSON[_0x7dbf('0x12')](_0x292a2c));_0x3abe64(_0x292a2c);})['catch'](function(_0x3c0515){logger[_0x7dbf('0x13')](_0x7dbf('0x17'),_0x3c0515[_0x7dbf('0x15')],_0xc47749);_0x49b09f(_0x47e7b4[_0x7dbf('0x13')](0x1f4,_0x3c0515[_0x7dbf('0x15')]));});});};exports[_0x7dbf('0x21')]=function(_0x2783aa){var _0x478395=this;return new Promise(function(_0x44a3ea,_0x156bc2){return db[_0x7dbf('0x18')][_0x7dbf('0x22')]({'raw':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')][_0x7dbf('0x1b')]||null:null,'attributes':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')]['attributes']||null:null,'include':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')][_0x7dbf('0x1e')]?_[_0x7dbf('0x1d')](_0x2783aa[_0x7dbf('0x19')]['include'],function(_0x62097e){return{'model':db[_0x62097e[_0x7dbf('0x20')]],'as':_0x62097e['as'],'attributes':_0x62097e['attributes'],'include':_0x62097e[_0x7dbf('0x1e')]?_['map'](_0x62097e[_0x7dbf('0x1e')],function(_0x441a86){return{'model':db[_0x441a86[_0x7dbf('0x20')]],'as':_0x441a86['as'],'attributes':_0x441a86['attributes'],'include':_0x441a86[_0x7dbf('0x1e')]?_[_0x7dbf('0x1d')](_0x441a86['include'],function(_0x431466){return{'model':db[_0x431466[_0x7dbf('0x20')]],'as':_0x431466['as'],'attributes':_0x431466['attributes']};}):[]};}):[]};}):[]:[]})[_0x7dbf('0xc')](function(_0x4fda6f){logger[_0x7dbf('0xd')]('ShowFreshdeskAccount',_0x2783aa);logger[_0x7dbf('0x10')](_0x7dbf('0x21'),_0x2783aa,JSON[_0x7dbf('0x12')](_0x4fda6f));_0x44a3ea(_0x4fda6f);})[_0x7dbf('0x16')](function(_0x28dc1c){logger[_0x7dbf('0x13')]('ShowFreshdeskAccount',_0x28dc1c['message'],_0x2783aa);_0x156bc2(_0x478395[_0x7dbf('0x13')](0x1f4,_0x28dc1c[_0x7dbf('0x15')]));});});}; \ No newline at end of file +var _0xb2f2=['rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','include','map','model','ShowFreshdeskAccount','find','then','stringify','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x38a792,_0x5a21a5){var _0x2cee7b=function(_0x3e9555){while(--_0x3e9555){_0x38a792['push'](_0x38a792['shift']());}};_0x2cee7b(++_0x5a21a5);}(_0xb2f2,0xc0));var _0x2b2f=function(_0x380595,_0xbe5118){_0x380595=_0x380595-0x0;var _0x2c5c72=_0xb2f2[_0x380595];return _0x2c5c72;};'use strict';var _=require('lodash');var util=require(_0x2b2f('0x0'));var moment=require(_0x2b2f('0x1'));var BPromise=require(_0x2b2f('0x2'));var rs=require(_0x2b2f('0x3'));var fs=require('fs');var Redis=require(_0x2b2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2b2f('0x5'))(_0x2b2f('0x6'));var config=require(_0x2b2f('0x7'));var jayson=require(_0x2b2f('0x8'));var client=jayson[_0x2b2f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f0e61,_0x1d374c,_0x1c2219){return new BPromise(function(_0x30b55a,_0x249db2){return client[_0x2b2f('0xa')](_0x4f0e61,_0x1c2219)['then'](function(_0x52372e){logger[_0x2b2f('0xb')](_0x2b2f('0xc'),_0x1d374c,'request\x20sent');logger[_0x2b2f('0xd')](_0x2b2f('0xe'),_0x1d374c,_0x2b2f('0xf'),JSON['stringify'](_0x52372e));if(_0x52372e[_0x2b2f('0x10')]){if(_0x52372e[_0x2b2f('0x10')][_0x2b2f('0x11')]===0x1f4){logger['error'](_0x2b2f('0xc'),_0x1d374c,_0x52372e['error']['message']);return _0x249db2(_0x52372e[_0x2b2f('0x10')][_0x2b2f('0x12')]);}logger[_0x2b2f('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1d374c,_0x52372e['error']['message']);return _0x30b55a(_0x52372e[_0x2b2f('0x10')][_0x2b2f('0x12')]);}else{logger[_0x2b2f('0xb')](_0x2b2f('0xc'),_0x1d374c,'request\x20sent');_0x30b55a(_0x52372e['result'][_0x2b2f('0x12')]);}})[_0x2b2f('0x13')](function(_0x4778fb){logger[_0x2b2f('0x10')](_0x2b2f('0xc'),_0x1d374c,_0x4778fb);_0x249db2(_0x4778fb);});});}exports[_0x2b2f('0x14')]=function(_0x10848c){var _0x186e2c=this;return new Promise(function(_0x38c771,_0x538198){return db[_0x2b2f('0x15')]['findAll']({'raw':_0x10848c[_0x2b2f('0x16')]?_0x10848c[_0x2b2f('0x16')][_0x2b2f('0x17')]===undefined?!![]:![]:!![],'where':_0x10848c['options']?_0x10848c['options'][_0x2b2f('0x18')]||null:null,'attributes':_0x10848c[_0x2b2f('0x16')]?_0x10848c['options'][_0x2b2f('0x19')]||null:null,'limit':_0x10848c[_0x2b2f('0x16')]?_0x10848c['options']['limit']||null:null,'include':_0x10848c[_0x2b2f('0x16')]?_0x10848c[_0x2b2f('0x16')][_0x2b2f('0x1a')]?_[_0x2b2f('0x1b')](_0x10848c['options'][_0x2b2f('0x1a')],function(_0x473971){return{'model':db[_0x473971[_0x2b2f('0x1c')]],'as':_0x473971['as'],'attributes':_0x473971['attributes'],'include':_0x473971[_0x2b2f('0x1a')]?_['map'](_0x473971[_0x2b2f('0x1a')],function(_0x4e0a24){return{'model':db[_0x4e0a24[_0x2b2f('0x1c')]],'as':_0x4e0a24['as'],'attributes':_0x4e0a24[_0x2b2f('0x19')],'include':_0x4e0a24[_0x2b2f('0x1a')]?_[_0x2b2f('0x1b')](_0x4e0a24[_0x2b2f('0x1a')],function(_0x339a20){return{'model':db[_0x339a20[_0x2b2f('0x1c')]],'as':_0x339a20['as'],'attributes':_0x339a20['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x334568){logger[_0x2b2f('0xb')](_0x2b2f('0x14'),_0x10848c);logger[_0x2b2f('0xd')](_0x2b2f('0x14'),_0x10848c,JSON['stringify'](_0x334568));_0x38c771(_0x334568);})[_0x2b2f('0x13')](function(_0x162ff6){logger[_0x2b2f('0x10')](_0x2b2f('0x14'),_0x162ff6[_0x2b2f('0x12')],_0x10848c);_0x538198(_0x186e2c[_0x2b2f('0x10')](0x1f4,_0x162ff6[_0x2b2f('0x12')]));});});};exports[_0x2b2f('0x1d')]=function(_0x4e66fd){var _0x1c222b=this;return new Promise(function(_0x3e6137,_0x534de6){return db[_0x2b2f('0x15')][_0x2b2f('0x1e')]({'raw':_0x4e66fd['options']?_0x4e66fd['options'][_0x2b2f('0x17')]===undefined?!![]:![]:!![],'where':_0x4e66fd[_0x2b2f('0x16')]?_0x4e66fd[_0x2b2f('0x16')]['where']||null:null,'attributes':_0x4e66fd[_0x2b2f('0x16')]?_0x4e66fd[_0x2b2f('0x16')][_0x2b2f('0x19')]||null:null,'include':_0x4e66fd[_0x2b2f('0x16')]?_0x4e66fd[_0x2b2f('0x16')][_0x2b2f('0x1a')]?_[_0x2b2f('0x1b')](_0x4e66fd[_0x2b2f('0x16')][_0x2b2f('0x1a')],function(_0x113cab){return{'model':db[_0x113cab[_0x2b2f('0x1c')]],'as':_0x113cab['as'],'attributes':_0x113cab[_0x2b2f('0x19')],'include':_0x113cab[_0x2b2f('0x1a')]?_[_0x2b2f('0x1b')](_0x113cab[_0x2b2f('0x1a')],function(_0x17f92e){return{'model':db[_0x17f92e[_0x2b2f('0x1c')]],'as':_0x17f92e['as'],'attributes':_0x17f92e[_0x2b2f('0x19')],'include':_0x17f92e[_0x2b2f('0x1a')]?_[_0x2b2f('0x1b')](_0x17f92e['include'],function(_0x4dc680){return{'model':db[_0x4dc680[_0x2b2f('0x1c')]],'as':_0x4dc680['as'],'attributes':_0x4dc680['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b2f('0x1f')](function(_0x2d0460){logger['info'](_0x2b2f('0x1d'),_0x4e66fd);logger[_0x2b2f('0xd')]('ShowFreshdeskAccount',_0x4e66fd,JSON[_0x2b2f('0x20')](_0x2d0460));_0x3e6137(_0x2d0460);})[_0x2b2f('0x13')](function(_0x462be8){logger[_0x2b2f('0x10')]('ShowFreshdeskAccount',_0x462be8['message'],_0x4e66fd);_0x534de6(_0x1c222b['error'](0x1f4,_0x462be8[_0x2b2f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 23052ed..987b784 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 _0x850e=['getTags','post','create','/:id/tags','setTags','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x10366e,_0x2ca3d8){var _0x41a3a9=function(_0x36b189){while(--_0x36b189){_0x10366e['push'](_0x10366e['shift']());}};_0x41a3a9(++_0x2ca3d8);}(_0x850e,0x14e));var _0xe850=function(_0xa67928,_0x563a31){_0xa67928=_0xa67928-0x0;var _0x56a48d=_0x850e[_0xa67928];return _0x56a48d;};'use strict';var multer=require(_0xe850('0x0'));var util=require(_0xe850('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe850('0x2'));var router=express[_0xe850('0x3')]();var fs_extra=require(_0xe850('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe850('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0xe850('0x6')]('/',auth[_0xe850('0x7')](),controller[_0xe850('0x8')]);router[_0xe850('0x6')](_0xe850('0x9'),auth[_0xe850('0x7')](),controller[_0xe850('0xa')]);router[_0xe850('0x6')](_0xe850('0xb'),auth[_0xe850('0x7')](),controller[_0xe850('0xc')]);router[_0xe850('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe850('0xd')]);router[_0xe850('0x6')](_0xe850('0xe'),auth[_0xe850('0x7')](),controller[_0xe850('0xf')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0xe850('0x10')]);router[_0xe850('0x11')]('/',auth[_0xe850('0x7')](),controller[_0xe850('0x12')]);router[_0xe850('0x11')](_0xe850('0x13'),auth[_0xe850('0x7')](),controller[_0xe850('0x14')]);router['put']('/:id',auth[_0xe850('0x7')](),controller[_0xe850('0x15')]);router[_0xe850('0x16')](_0xe850('0x9'),auth[_0xe850('0x7')](),controller[_0xe850('0x17')]);module[_0xe850('0x18')]=router; \ No newline at end of file +var _0x2543=['getDescriptions','/:id/tags','getTags','post','setTags','put','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x2543,0x196));var _0x3254=function(_0x2d9a23,_0x481dc4){_0x2d9a23=_0x2d9a23-0x0;var _0x5198ee=_0x2543[_0x2d9a23];return _0x5198ee;};'use strict';var multer=require(_0x3254('0x0'));var util=require(_0x3254('0x1'));var path=require('path');var timeout=require(_0x3254('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3254('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3254('0x4'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x3254('0x5')]('/',auth[_0x3254('0x6')](),controller['index']);router[_0x3254('0x5')](_0x3254('0x7'),auth[_0x3254('0x6')](),controller[_0x3254('0x8')]);router[_0x3254('0x5')](_0x3254('0x9'),auth[_0x3254('0x6')](),controller['getFields']);router[_0x3254('0x5')](_0x3254('0xa'),auth[_0x3254('0x6')](),controller[_0x3254('0xb')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3254('0xc')]);router[_0x3254('0x5')](_0x3254('0xd'),auth[_0x3254('0x6')](),controller[_0x3254('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3254('0xf')](_0x3254('0xd'),auth['isAuthenticated'](),controller[_0x3254('0x10')]);router[_0x3254('0x11')]('/:id',auth[_0x3254('0x6')](),controller['update']);router['delete'](_0x3254('0x7'),auth[_0x3254('0x6')](),controller['destroy']);module[_0x3254('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index d1d565e..ba21e95 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 _0xe237=['sequelize','STRING'];(function(_0x2dc040,_0x35ad1f){var _0x19db82=function(_0x1a0a67){while(--_0x1a0a67){_0x2dc040['push'](_0x2dc040['shift']());}};_0x19db82(++_0x35ad1f);}(_0xe237,0x164));var _0x7e23=function(_0x5661d8,_0x385cd9){_0x5661d8=_0x5661d8-0x0;var _0x5e938f=_0xe237[_0x5661d8];return _0x5e938f;};'use strict';var Sequelize=require(_0x7e23('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e23('0x1')]},'description':{'type':Sequelize[_0x7e23('0x1')]}}; \ No newline at end of file +var _0xcf47=['STRING','exports'];(function(_0xe01dc7,_0x56256e){var _0x37bac8=function(_0x71eca5){while(--_0x71eca5){_0xe01dc7['push'](_0xe01dc7['shift']());}};_0x37bac8(++_0x56256e);}(_0xcf47,0x1e7));var _0x7cf4=function(_0x3d2c06,_0x3cc8f3){_0x3d2c06=_0x3d2c06-0x0;var _0x36c85f=_0xcf47[_0x3d2c06];return _0x36c85f;};'use strict';var Sequelize=require('sequelize');module[_0x7cf4('0x0')]={'name':{'type':Sequelize[_0x7cf4('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 48a3800..f35ff0b 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 _0xe5d1=['zip-dir','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','getFields','findOne','FreshdeskField','length','getSubjects','getDescriptions','Tag','setTags','ids','rimraf'];(function(_0x4c3e29,_0x2afb51){var _0xf4f34c=function(_0x3da8d9){while(--_0x3da8d9){_0x4c3e29['push'](_0x4c3e29['shift']());}};_0xf4f34c(++_0x2afb51);}(_0xe5d1,0xa7));var _0x1e5d=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0xe5d1[_0x2c93e2];return _0x57264e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e5d('0x0'));var zipdir=require(_0x1e5d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e5d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1e5d('0x3'));var util=require(_0x1e5d('0x4'));var path=require('path');var sox=require(_0x1e5d('0x5'));var csv=require('to-csv');var ejs=require(_0x1e5d('0x6'));var fs=require('fs');var fs_extra=require(_0x1e5d('0x7'));var _=require(_0x1e5d('0x8'));var squel=require(_0x1e5d('0x9'));var crypto=require(_0x1e5d('0xa'));var jsforce=require(_0x1e5d('0xb'));var deskjs=require(_0x1e5d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1e5d('0xd'));var Papa=require(_0x1e5d('0xe'));var Redis=require(_0x1e5d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1e5d('0x10'));var as=require(_0x1e5d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e5d('0x12'))(_0x1e5d('0x13'));var utils=require('../../config/utils');var config=require(_0x1e5d('0x14'));var licenseUtil=require(_0x1e5d('0x15'));var db=require(_0x1e5d('0x16'))['db'];function respondWithStatusCode(_0x266618,_0x2727dc){_0x2727dc=_0x2727dc||0xcc;return function(_0x4233c2){if(_0x4233c2){return _0x266618[_0x1e5d('0x17')](_0x2727dc);}return _0x266618[_0x1e5d('0x18')](_0x2727dc)[_0x1e5d('0x19')]();};}function respondWithResult(_0x18da15,_0x48535b){_0x48535b=_0x48535b||0xc8;return function(_0x1d784a){if(_0x1d784a){return _0x18da15[_0x1e5d('0x18')](_0x48535b)[_0x1e5d('0x1a')](_0x1d784a);}};}function respondWithFilteredResult(_0x32d417,_0x6c7600){return function(_0x172375){if(_0x172375){var _0x42c0d0=typeof _0x6c7600[_0x1e5d('0x1b')]===_0x1e5d('0x1c')&&typeof _0x6c7600[_0x1e5d('0x1d')]===_0x1e5d('0x1c');var _0x349311=_0x172375[_0x1e5d('0x1e')];var _0x69f37c=_0x42c0d0?0x0:_0x6c7600[_0x1e5d('0x1b')];var _0x98e778=_0x42c0d0?_0x172375[_0x1e5d('0x1e')]:_0x6c7600['offset']+_0x6c7600[_0x1e5d('0x1d')];var _0x295127;if(_0x98e778>=_0x349311){_0x98e778=_0x349311;_0x295127=0xc8;}else{_0x295127=0xce;}_0x32d417[_0x1e5d('0x18')](_0x295127);return _0x32d417['set'](_0x1e5d('0x1f'),_0x69f37c+'-'+_0x98e778+'/'+_0x349311)[_0x1e5d('0x1a')](_0x172375);}return null;};}function patchUpdates(_0x1fe383){return function(_0x17eb6d){try{jsonpatch[_0x1e5d('0x20')](_0x17eb6d,_0x1fe383,!![]);}catch(_0x1468bb){return BPromise['reject'](_0x1468bb);}return _0x17eb6d[_0x1e5d('0x21')]();};}function saveUpdates(_0x3331f5,_0x5cbef1){return function(_0x53b709){if(_0x53b709){return _0x53b709[_0x1e5d('0x22')](_0x3331f5)['then'](function(_0x522096){return _0x522096;});}return null;};}function removeEntity(_0x500ec9,_0x3d481f){return function(_0x8bf72a){if(_0x8bf72a){return _0x8bf72a[_0x1e5d('0x23')]()[_0x1e5d('0x24')](function(){_0x500ec9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e29d,_0x3d3ce1){return function(_0x305176){if(!_0x305176){_0x34e29d[_0x1e5d('0x17')](0x194);}return _0x305176;};}function handleError(_0x5274cb,_0x5ca408){_0x5ca408=_0x5ca408||0x1f4;return function(_0x439c22){logger[_0x1e5d('0x25')](_0x439c22[_0x1e5d('0x26')]);if(_0x439c22[_0x1e5d('0x27')]){delete _0x439c22['name'];}_0x5274cb[_0x1e5d('0x18')](_0x5ca408)[_0x1e5d('0x28')](_0x439c22);};}exports[_0x1e5d('0x29')]=function(_0x33a126,_0x511429){var _0x4d41d5={},_0x122de0={},_0xde3e6f={'count':0x0,'rows':[]};var _0x27d9c4=_['map'](db[_0x1e5d('0x2a')][_0x1e5d('0x2b')],function(_0x41d181){return{'name':_0x41d181[_0x1e5d('0x2c')],'type':_0x41d181[_0x1e5d('0x2d')][_0x1e5d('0x2e')]};});_0x122de0[_0x1e5d('0x2f')]=_['map'](_0x27d9c4,_0x1e5d('0x27'));_0x122de0[_0x1e5d('0x30')]=_[_0x1e5d('0x31')](_0x33a126['query']);_0x122de0['filters']=_[_0x1e5d('0x32')](_0x122de0[_0x1e5d('0x2f')],_0x122de0[_0x1e5d('0x30')]);_0x4d41d5[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x122de0[_0x1e5d('0x2f')],qs[_0x1e5d('0x34')](_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x4d41d5['attributes']=_0x4d41d5[_0x1e5d('0x33')]['length']?_0x4d41d5['attributes']:_0x122de0[_0x1e5d('0x2f')];if(!_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x35')](_0x1e5d('0x36'))){_0x4d41d5[_0x1e5d('0x1d')]=qs['limit'](_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x1d')]);_0x4d41d5[_0x1e5d('0x1b')]=qs['offset'](_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}_0x4d41d5[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0x33a126[_0x1e5d('0x30')]['sort']);_0x4d41d5[_0x1e5d('0x39')]=qs[_0x1e5d('0x3a')](_[_0x1e5d('0x3b')](_0x33a126['query'],_0x122de0[_0x1e5d('0x3a')]),_0x27d9c4);if(_0x33a126['query']['filter']){_0x4d41d5['where']=_[_0x1e5d('0x3c')](_0x4d41d5[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x27d9c4,function(_0x28fb59){if(_0x28fb59[_0x1e5d('0x2d')]!==_0x1e5d('0x3e')){var _0x87e66c={};_0x87e66c[_0x28fb59[_0x1e5d('0x27')]]={'$like':'%'+_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x3f')]+'%'};return _0x87e66c;}})});}_0x4d41d5=_[_0x1e5d('0x3c')]({},_0x4d41d5,_0x33a126[_0x1e5d('0x40')]);var _0x5d686c={'where':_0x4d41d5[_0x1e5d('0x39')]};return db[_0x1e5d('0x2a')][_0x1e5d('0x1e')](_0x5d686c)[_0x1e5d('0x24')](function(_0xfbb42d){_0xde3e6f[_0x1e5d('0x1e')]=_0xfbb42d;if(_0x33a126['query'][_0x1e5d('0x41')]){_0x4d41d5['include']=[{'all':!![]}];}return db[_0x1e5d('0x2a')][_0x1e5d('0x42')](_0x4d41d5);})[_0x1e5d('0x24')](function(_0x329463){_0xde3e6f[_0x1e5d('0x43')]=_0x329463;return _0xde3e6f;})[_0x1e5d('0x24')](respondWithFilteredResult(_0x511429,_0x4d41d5))[_0x1e5d('0x44')](handleError(_0x511429,null));};exports[_0x1e5d('0x45')]=function(_0x4f0ffe,_0x31cfa6){var _0xaf76d8={'raw':![],'where':{'id':_0x4f0ffe[_0x1e5d('0x46')]['id']}},_0x2d840a={};_0x2d840a[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x2a')]['rawAttributes']);_0x2d840a[_0x1e5d('0x30')]=_['keys'](_0x4f0ffe['query']);_0x2d840a[_0x1e5d('0x3a')]=_[_0x1e5d('0x32')](_0x2d840a[_0x1e5d('0x2f')],_0x2d840a[_0x1e5d('0x30')]);_0xaf76d8[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x2d840a[_0x1e5d('0x2f')],qs['fields'](_0x4f0ffe[_0x1e5d('0x30')]['fields']));_0xaf76d8[_0x1e5d('0x33')]=_0xaf76d8['attributes']['length']?_0xaf76d8[_0x1e5d('0x33')]:_0x2d840a['model'];if(_0x4f0ffe[_0x1e5d('0x30')]['includeAll']){_0xaf76d8[_0x1e5d('0x47')]=[{'all':!![]}];}_0xaf76d8=_[_0x1e5d('0x3c')]({},_0xaf76d8,_0x4f0ffe[_0x1e5d('0x40')]);return db['FreshdeskConfiguration']['find'](_0xaf76d8)[_0x1e5d('0x24')](handleEntityNotFound(_0x31cfa6,null))[_0x1e5d('0x24')](respondWithResult(_0x31cfa6,null))['catch'](handleError(_0x31cfa6,null));};exports[_0x1e5d('0x48')]=function(_0x8d07b0,_0x3a498d){return db['FreshdeskConfiguration'][_0x1e5d('0x48')](_0x8d07b0['body'],{})[_0x1e5d('0x24')](respondWithResult(_0x3a498d,0xc9))['catch'](handleError(_0x3a498d,null));};exports['update']=function(_0xde1e37,_0x292872){if(_0xde1e37[_0x1e5d('0x49')]['id']){delete _0xde1e37[_0x1e5d('0x49')]['id'];}return db['FreshdeskConfiguration'][_0x1e5d('0x4a')]({'where':{'id':_0xde1e37[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x292872,null))[_0x1e5d('0x24')](saveUpdates(_0xde1e37[_0x1e5d('0x49')],null))[_0x1e5d('0x24')](respondWithResult(_0x292872,null))[_0x1e5d('0x44')](handleError(_0x292872,null));};exports[_0x1e5d('0x23')]=function(_0x40ecd9,_0x136a9e){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x40ecd9[_0x1e5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x136a9e,null))[_0x1e5d('0x24')](removeEntity(_0x136a9e,null))[_0x1e5d('0x44')](handleError(_0x136a9e,null));};exports[_0x1e5d('0x4b')]=function(_0x4ac174,_0x347f81,_0x5b6749){var _0x5494ab={};var _0x1acb7c={};var _0x12e103;var _0x201806;return db[_0x1e5d('0x2a')][_0x1e5d('0x4c')]({'where':{'id':_0x4ac174[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x347f81,null))[_0x1e5d('0x24')](function(_0x4596d2){if(_0x4596d2){_0x12e103=_0x4596d2;_0x1acb7c[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x4d')][_0x1e5d('0x2b')]);_0x1acb7c[_0x1e5d('0x30')]=_['keys'](_0x4ac174[_0x1e5d('0x30')]);_0x1acb7c['filters']=_[_0x1e5d('0x32')](_0x1acb7c[_0x1e5d('0x2f')],_0x1acb7c['query']);_0x5494ab[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x1acb7c['model'],qs[_0x1e5d('0x34')](_0x4ac174[_0x1e5d('0x30')]['fields']));_0x5494ab[_0x1e5d('0x33')]=_0x5494ab[_0x1e5d('0x33')][_0x1e5d('0x4e')]?_0x5494ab[_0x1e5d('0x33')]:_0x1acb7c[_0x1e5d('0x2f')];_0x5494ab[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x38')]);_0x5494ab[_0x1e5d('0x39')]=qs[_0x1e5d('0x3a')](_[_0x1e5d('0x3b')](_0x4ac174['query'],_0x1acb7c[_0x1e5d('0x3a')]));if(_0x4ac174[_0x1e5d('0x30')]['filter']){_0x5494ab['where']=_[_0x1e5d('0x3c')](_0x5494ab[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x5494ab[_0x1e5d('0x33')],function(_0x46843e){var _0x397d0e={};_0x397d0e[_0x46843e]={'$like':'%'+_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x3f')]+'%'};return _0x397d0e;})});}_0x5494ab=_[_0x1e5d('0x3c')]({},_0x5494ab,_0x4ac174[_0x1e5d('0x40')]);return _0x12e103['getFields'](_0x5494ab);}})['then'](function(_0x59f6d7){if(_0x59f6d7){_0x201806=_0x59f6d7[_0x1e5d('0x4e')];if(!_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x35')]('nolimit')){_0x5494ab[_0x1e5d('0x1d')]=qs[_0x1e5d('0x1d')](_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x1d')]);_0x5494ab[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}return _0x12e103[_0x1e5d('0x4b')](_0x5494ab);}})['then'](function(_0x274a51){if(_0x274a51){return _0x274a51?{'count':_0x201806,'rows':_0x274a51}:null;}})[_0x1e5d('0x24')](respondWithResult(_0x347f81,null))[_0x1e5d('0x44')](handleError(_0x347f81,null));};exports['getSubjects']=function(_0x1909ea,_0x3c947b,_0x257386){var _0x2fdad2={};var _0x5532e3={};var _0x40f5f5;var _0x557e73;return db[_0x1e5d('0x2a')][_0x1e5d('0x4c')]({'where':{'id':_0x1909ea[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x3c947b,null))[_0x1e5d('0x24')](function(_0x2adc4d){if(_0x2adc4d){_0x40f5f5=_0x2adc4d;_0x5532e3[_0x1e5d('0x2f')]=_['keys'](db[_0x1e5d('0x4d')]['rawAttributes']);_0x5532e3['query']=_[_0x1e5d('0x31')](_0x1909ea[_0x1e5d('0x30')]);_0x5532e3[_0x1e5d('0x3a')]=_[_0x1e5d('0x32')](_0x5532e3['model'],_0x5532e3[_0x1e5d('0x30')]);_0x2fdad2['attributes']=_['intersection'](_0x5532e3[_0x1e5d('0x2f')],qs[_0x1e5d('0x34')](_0x1909ea[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x2fdad2[_0x1e5d('0x33')]=_0x2fdad2['attributes'][_0x1e5d('0x4e')]?_0x2fdad2['attributes']:_0x5532e3[_0x1e5d('0x2f')];_0x2fdad2[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0x1909ea[_0x1e5d('0x30')]['sort']);_0x2fdad2[_0x1e5d('0x39')]=qs[_0x1e5d('0x3a')](_[_0x1e5d('0x3b')](_0x1909ea['query'],_0x5532e3['filters']));if(_0x1909ea[_0x1e5d('0x30')]['filter']){_0x2fdad2['where']=_['merge'](_0x2fdad2[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x2fdad2[_0x1e5d('0x33')],function(_0x4af341){var _0x1e0f6b={};_0x1e0f6b[_0x4af341]={'$like':'%'+_0x1909ea['query']['filter']+'%'};return _0x1e0f6b;})});}_0x2fdad2=_[_0x1e5d('0x3c')]({},_0x2fdad2,_0x1909ea[_0x1e5d('0x40')]);return _0x40f5f5[_0x1e5d('0x4f')](_0x2fdad2);}})[_0x1e5d('0x24')](function(_0x33b014){if(_0x33b014){_0x557e73=_0x33b014[_0x1e5d('0x4e')];if(!_0x1909ea[_0x1e5d('0x30')]['hasOwnProperty'](_0x1e5d('0x36'))){_0x2fdad2['limit']=qs[_0x1e5d('0x1d')](_0x1909ea[_0x1e5d('0x30')][_0x1e5d('0x1d')]);_0x2fdad2[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0x1909ea[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}return _0x40f5f5[_0x1e5d('0x4f')](_0x2fdad2);}})[_0x1e5d('0x24')](function(_0x185ea6){if(_0x185ea6){return _0x185ea6?{'count':_0x557e73,'rows':_0x185ea6}:null;}})[_0x1e5d('0x24')](respondWithResult(_0x3c947b,null))[_0x1e5d('0x44')](handleError(_0x3c947b,null));};exports[_0x1e5d('0x50')]=function(_0x25747e,_0x2bf1bd,_0x1c3025){var _0x2ece56={};var _0x392e11={};var _0x359a87;var _0x335436;return db[_0x1e5d('0x2a')][_0x1e5d('0x4c')]({'where':{'id':_0x25747e[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x2bf1bd,null))[_0x1e5d('0x24')](function(_0x10df77){if(_0x10df77){_0x359a87=_0x10df77;_0x392e11[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x4d')][_0x1e5d('0x2b')]);_0x392e11[_0x1e5d('0x30')]=_[_0x1e5d('0x31')](_0x25747e[_0x1e5d('0x30')]);_0x392e11[_0x1e5d('0x3a')]=_[_0x1e5d('0x32')](_0x392e11['model'],_0x392e11[_0x1e5d('0x30')]);_0x2ece56['attributes']=_[_0x1e5d('0x32')](_0x392e11['model'],qs[_0x1e5d('0x34')](_0x25747e[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x2ece56['attributes']=_0x2ece56[_0x1e5d('0x33')][_0x1e5d('0x4e')]?_0x2ece56[_0x1e5d('0x33')]:_0x392e11[_0x1e5d('0x2f')];_0x2ece56['order']=qs[_0x1e5d('0x38')](_0x25747e['query']['sort']);_0x2ece56['where']=qs['filters'](_[_0x1e5d('0x3b')](_0x25747e[_0x1e5d('0x30')],_0x392e11[_0x1e5d('0x3a')]));if(_0x25747e[_0x1e5d('0x30')]['filter']){_0x2ece56[_0x1e5d('0x39')]=_['merge'](_0x2ece56[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x2ece56[_0x1e5d('0x33')],function(_0x1d8e57){var _0x3335ec={};_0x3335ec[_0x1d8e57]={'$like':'%'+_0x25747e['query']['filter']+'%'};return _0x3335ec;})});}_0x2ece56=_['merge']({},_0x2ece56,_0x25747e[_0x1e5d('0x40')]);return _0x359a87[_0x1e5d('0x50')](_0x2ece56);}})['then'](function(_0x36b46a){if(_0x36b46a){_0x335436=_0x36b46a['length'];if(!_0x25747e[_0x1e5d('0x30')][_0x1e5d('0x35')](_0x1e5d('0x36'))){_0x2ece56[_0x1e5d('0x1d')]=qs[_0x1e5d('0x1d')](_0x25747e[_0x1e5d('0x30')]['limit']);_0x2ece56[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0x25747e['query'][_0x1e5d('0x1b')]);}return _0x359a87['getDescriptions'](_0x2ece56);}})['then'](function(_0x241401){if(_0x241401){return _0x241401?{'count':_0x335436,'rows':_0x241401}:null;}})['then'](respondWithResult(_0x2bf1bd,null))[_0x1e5d('0x44')](handleError(_0x2bf1bd,null));};exports['getTags']=function(_0xa9feeb,_0x71f648,_0x217af4){var _0x25e4c4={};var _0x36a153={};var _0xd9cfa0;var _0x434456;return db[_0x1e5d('0x2a')]['findOne']({'where':{'id':_0xa9feeb[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x71f648,null))[_0x1e5d('0x24')](function(_0x1c36dc){if(_0x1c36dc){_0xd9cfa0=_0x1c36dc;_0x36a153[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x51')][_0x1e5d('0x2b')]);_0x36a153[_0x1e5d('0x30')]=_[_0x1e5d('0x31')](_0xa9feeb[_0x1e5d('0x30')]);_0x36a153['filters']=_['intersection'](_0x36a153[_0x1e5d('0x2f')],_0x36a153[_0x1e5d('0x30')]);_0x25e4c4[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x36a153[_0x1e5d('0x2f')],qs[_0x1e5d('0x34')](_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x25e4c4[_0x1e5d('0x33')]=_0x25e4c4[_0x1e5d('0x33')]['length']?_0x25e4c4[_0x1e5d('0x33')]:_0x36a153['model'];_0x25e4c4[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x38')]);_0x25e4c4[_0x1e5d('0x39')]=qs['filters'](_[_0x1e5d('0x3b')](_0xa9feeb[_0x1e5d('0x30')],_0x36a153[_0x1e5d('0x3a')]));if(_0xa9feeb[_0x1e5d('0x30')]['filter']){_0x25e4c4[_0x1e5d('0x39')]=_[_0x1e5d('0x3c')](_0x25e4c4[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x25e4c4[_0x1e5d('0x33')],function(_0x5e7828){var _0x32bfa4={};_0x32bfa4[_0x5e7828]={'$like':'%'+_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x3f')]+'%'};return _0x32bfa4;})});}_0x25e4c4=_[_0x1e5d('0x3c')]({},_0x25e4c4,_0xa9feeb[_0x1e5d('0x40')]);return _0xd9cfa0['getTags'](_0x25e4c4);}})[_0x1e5d('0x24')](function(_0x1b9d57){if(_0x1b9d57){_0x434456=_0x1b9d57[_0x1e5d('0x4e')];if(!_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x35')]('nolimit')){_0x25e4c4[_0x1e5d('0x1d')]=qs[_0x1e5d('0x1d')](_0xa9feeb['query']['limit']);_0x25e4c4[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}return _0xd9cfa0['getTags'](_0x25e4c4);}})['then'](function(_0x534f4f){if(_0x534f4f){return _0x534f4f?{'count':_0x434456,'rows':_0x534f4f}:null;}})['then'](respondWithResult(_0x71f648,null))[_0x1e5d('0x44')](handleError(_0x71f648,null));};exports[_0x1e5d('0x52')]=function(_0x21ab3a,_0x2740e7,_0x331f1b){if(_0x21ab3a[_0x1e5d('0x49')]['id']){delete _0x21ab3a['body']['id'];}return db[_0x1e5d('0x2a')]['findOne']({'where':{'id':_0x21ab3a[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x2740e7,null))[_0x1e5d('0x24')](function(_0x51ee7b){if(_0x51ee7b){return _0x51ee7b[_0x1e5d('0x52')](_0x21ab3a[_0x1e5d('0x49')][_0x1e5d('0x53')]||[]);}return null;})['then'](respondWithResult(_0x2740e7,null))[_0x1e5d('0x44')](handleError(_0x2740e7,null));}; \ No newline at end of file +var _0xf626=['where','filter','FreshdeskConfiguration','include','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','getFields','findOne','FreshdeskField','order','pick','merge','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','status','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x57c5cc,_0x465823){var _0x3aff5d=function(_0x5935ee){while(--_0x5935ee){_0x57c5cc['push'](_0x57c5cc['shift']());}};_0x3aff5d(++_0x465823);}(_0xf626,0x1b3));var _0x6f62=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xf626[_0x710815];return _0x5b3b89;};'use strict';var emlformat=require(_0x6f62('0x0'));var rimraf=require(_0x6f62('0x1'));var zipdir=require(_0x6f62('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f62('0x3'));var moment=require(_0x6f62('0x4'));var BPromise=require(_0x6f62('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f62('0x6'));var sox=require(_0x6f62('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f62('0x8'));var squel=require(_0x6f62('0x9'));var crypto=require(_0x6f62('0xa'));var jsforce=require(_0x6f62('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6f62('0xc'));var querystring=require('querystring');var Papa=require(_0x6f62('0xd'));var Redis=require(_0x6f62('0xe'));var authService=require(_0x6f62('0xf'));var qs=require(_0x6f62('0x10'));var as=require(_0x6f62('0x11'));var hardwareService=require(_0x6f62('0x12'));var logger=require('../../config/logger')(_0x6f62('0x13'));var utils=require(_0x6f62('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6f62('0x15'));var db=require(_0x6f62('0x16'))['db'];function respondWithStatusCode(_0x400e35,_0xe2df1a){_0xe2df1a=_0xe2df1a||0xcc;return function(_0xba53f0){if(_0xba53f0){return _0x400e35[_0x6f62('0x17')](_0xe2df1a);}return _0x400e35['status'](_0xe2df1a)[_0x6f62('0x18')]();};}function respondWithResult(_0x11d956,_0x207975){_0x207975=_0x207975||0xc8;return function(_0x34f93f){if(_0x34f93f){return _0x11d956['status'](_0x207975)[_0x6f62('0x19')](_0x34f93f);}};}function respondWithFilteredResult(_0x549553,_0x5df925){return function(_0x4a8bb1){if(_0x4a8bb1){var _0x4e3a84=typeof _0x5df925[_0x6f62('0x1a')]===_0x6f62('0x1b')&&typeof _0x5df925[_0x6f62('0x1c')]===_0x6f62('0x1b');var _0x2c145d=_0x4a8bb1['count'];var _0x18b6a3=_0x4e3a84?0x0:_0x5df925[_0x6f62('0x1a')];var _0x2a11e7=_0x4e3a84?_0x4a8bb1[_0x6f62('0x1d')]:_0x5df925[_0x6f62('0x1a')]+_0x5df925['limit'];var _0x14c1ec;if(_0x2a11e7>=_0x2c145d){_0x2a11e7=_0x2c145d;_0x14c1ec=0xc8;}else{_0x14c1ec=0xce;}_0x549553['status'](_0x14c1ec);return _0x549553[_0x6f62('0x1e')](_0x6f62('0x1f'),_0x18b6a3+'-'+_0x2a11e7+'/'+_0x2c145d)[_0x6f62('0x19')](_0x4a8bb1);}return null;};}function patchUpdates(_0x1cca8c){return function(_0x5968c7){try{jsonpatch['apply'](_0x5968c7,_0x1cca8c,!![]);}catch(_0x31dd80){return BPromise[_0x6f62('0x20')](_0x31dd80);}return _0x5968c7[_0x6f62('0x21')]();};}function saveUpdates(_0x3be305,_0x4124f6){return function(_0xda7f8e){if(_0xda7f8e){return _0xda7f8e[_0x6f62('0x22')](_0x3be305)[_0x6f62('0x23')](function(_0x16cab5){return _0x16cab5;});}return null;};}function removeEntity(_0x5160a4,_0x1e6a6d){return function(_0x44e812){if(_0x44e812){return _0x44e812[_0x6f62('0x24')]()[_0x6f62('0x23')](function(){_0x5160a4['status'](0xcc)[_0x6f62('0x18')]();});}};}function handleEntityNotFound(_0x56ad3b,_0x4bf40b){return function(_0x5b7a28){if(!_0x5b7a28){_0x56ad3b[_0x6f62('0x17')](0x194);}return _0x5b7a28;};}function handleError(_0xb3895e,_0x435f60){_0x435f60=_0x435f60||0x1f4;return function(_0x4cfd8c){logger['error'](_0x4cfd8c[_0x6f62('0x25')]);if(_0x4cfd8c[_0x6f62('0x26')]){delete _0x4cfd8c[_0x6f62('0x26')];}_0xb3895e[_0x6f62('0x27')](_0x435f60)[_0x6f62('0x28')](_0x4cfd8c);};}exports[_0x6f62('0x29')]=function(_0x5d2716,_0x12defc){var _0x667dbc={},_0xabf607={},_0x3691e8={'count':0x0,'rows':[]};var _0x4a53bb=_[_0x6f62('0x2a')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x167491){return{'name':_0x167491[_0x6f62('0x2b')],'type':_0x167491[_0x6f62('0x2c')][_0x6f62('0x2d')]};});_0xabf607[_0x6f62('0x2e')]=_[_0x6f62('0x2a')](_0x4a53bb,_0x6f62('0x26'));_0xabf607[_0x6f62('0x2f')]=_[_0x6f62('0x30')](_0x5d2716[_0x6f62('0x2f')]);_0xabf607[_0x6f62('0x31')]=_[_0x6f62('0x32')](_0xabf607[_0x6f62('0x2e')],_0xabf607['query']);_0x667dbc[_0x6f62('0x33')]=_[_0x6f62('0x32')](_0xabf607[_0x6f62('0x2e')],qs['fields'](_0x5d2716[_0x6f62('0x2f')][_0x6f62('0x34')]));_0x667dbc[_0x6f62('0x33')]=_0x667dbc[_0x6f62('0x33')][_0x6f62('0x35')]?_0x667dbc[_0x6f62('0x33')]:_0xabf607['model'];if(!_0x5d2716[_0x6f62('0x2f')][_0x6f62('0x36')](_0x6f62('0x37'))){_0x667dbc[_0x6f62('0x1c')]=qs['limit'](_0x5d2716[_0x6f62('0x2f')][_0x6f62('0x1c')]);_0x667dbc['offset']=qs[_0x6f62('0x1a')](_0x5d2716[_0x6f62('0x2f')][_0x6f62('0x1a')]);}_0x667dbc['order']=qs[_0x6f62('0x38')](_0x5d2716[_0x6f62('0x2f')][_0x6f62('0x38')]);_0x667dbc[_0x6f62('0x39')]=qs['filters'](_['pick'](_0x5d2716[_0x6f62('0x2f')],_0xabf607[_0x6f62('0x31')]),_0x4a53bb);if(_0x5d2716[_0x6f62('0x2f')][_0x6f62('0x3a')]){_0x667dbc[_0x6f62('0x39')]=_['merge'](_0x667dbc[_0x6f62('0x39')],{'$or':_[_0x6f62('0x2a')](_0x4a53bb,function(_0x56c74c){if(_0x56c74c['type']!=='VIRTUAL'){var _0x3cc68f={};_0x3cc68f[_0x56c74c['name']]={'$like':'%'+_0x5d2716[_0x6f62('0x2f')][_0x6f62('0x3a')]+'%'};return _0x3cc68f;}})});}_0x667dbc=_['merge']({},_0x667dbc,_0x5d2716['options']);var _0x43ec6e={'where':_0x667dbc['where']};return db[_0x6f62('0x3b')][_0x6f62('0x1d')](_0x43ec6e)[_0x6f62('0x23')](function(_0x555653){_0x3691e8[_0x6f62('0x1d')]=_0x555653;if(_0x5d2716[_0x6f62('0x2f')]['includeAll']){_0x667dbc[_0x6f62('0x3c')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x667dbc);})[_0x6f62('0x23')](function(_0x4243c0){_0x3691e8[_0x6f62('0x3d')]=_0x4243c0;return _0x3691e8;})['then'](respondWithFilteredResult(_0x12defc,_0x667dbc))[_0x6f62('0x3e')](handleError(_0x12defc,null));};exports[_0x6f62('0x3f')]=function(_0x24ab2e,_0x37fff0){var _0x2b1ff3={'raw':![],'where':{'id':_0x24ab2e[_0x6f62('0x40')]['id']}},_0x4de04f={};_0x4de04f['model']=_[_0x6f62('0x30')](db[_0x6f62('0x3b')][_0x6f62('0x41')]);_0x4de04f['query']=_[_0x6f62('0x30')](_0x24ab2e[_0x6f62('0x2f')]);_0x4de04f[_0x6f62('0x31')]=_[_0x6f62('0x32')](_0x4de04f['model'],_0x4de04f['query']);_0x2b1ff3[_0x6f62('0x33')]=_[_0x6f62('0x32')](_0x4de04f['model'],qs[_0x6f62('0x34')](_0x24ab2e[_0x6f62('0x2f')]['fields']));_0x2b1ff3['attributes']=_0x2b1ff3[_0x6f62('0x33')][_0x6f62('0x35')]?_0x2b1ff3[_0x6f62('0x33')]:_0x4de04f[_0x6f62('0x2e')];if(_0x24ab2e[_0x6f62('0x2f')][_0x6f62('0x42')]){_0x2b1ff3[_0x6f62('0x3c')]=[{'all':!![]}];}_0x2b1ff3=_['merge']({},_0x2b1ff3,_0x24ab2e[_0x6f62('0x43')]);return db[_0x6f62('0x3b')][_0x6f62('0x44')](_0x2b1ff3)[_0x6f62('0x23')](handleEntityNotFound(_0x37fff0,null))[_0x6f62('0x23')](respondWithResult(_0x37fff0,null))[_0x6f62('0x3e')](handleError(_0x37fff0,null));};exports[_0x6f62('0x45')]=function(_0x2250c3,_0x94dcf5){return db[_0x6f62('0x3b')][_0x6f62('0x45')](_0x2250c3[_0x6f62('0x46')],{})[_0x6f62('0x23')](respondWithResult(_0x94dcf5,0xc9))[_0x6f62('0x3e')](handleError(_0x94dcf5,null));};exports[_0x6f62('0x22')]=function(_0x5ce810,_0x5a0556){if(_0x5ce810[_0x6f62('0x46')]['id']){delete _0x5ce810['body']['id'];}return db[_0x6f62('0x3b')][_0x6f62('0x44')]({'where':{'id':_0x5ce810[_0x6f62('0x40')]['id']}})['then'](handleEntityNotFound(_0x5a0556,null))['then'](saveUpdates(_0x5ce810[_0x6f62('0x46')],null))[_0x6f62('0x23')](respondWithResult(_0x5a0556,null))[_0x6f62('0x3e')](handleError(_0x5a0556,null));};exports[_0x6f62('0x24')]=function(_0x1c9237,_0x2803e4){return db[_0x6f62('0x3b')][_0x6f62('0x44')]({'where':{'id':_0x1c9237[_0x6f62('0x40')]['id']}})[_0x6f62('0x23')](handleEntityNotFound(_0x2803e4,null))[_0x6f62('0x23')](removeEntity(_0x2803e4,null))[_0x6f62('0x3e')](handleError(_0x2803e4,null));};exports[_0x6f62('0x47')]=function(_0x1810d3,_0x9aa35d,_0x25552e){var _0x499b69={};var _0x58a6c6={};var _0x182c89;var _0x1d2edc;return db[_0x6f62('0x3b')][_0x6f62('0x48')]({'where':{'id':_0x1810d3[_0x6f62('0x40')]['id']}})[_0x6f62('0x23')](handleEntityNotFound(_0x9aa35d,null))['then'](function(_0x27e8c4){if(_0x27e8c4){_0x182c89=_0x27e8c4;_0x58a6c6[_0x6f62('0x2e')]=_[_0x6f62('0x30')](db[_0x6f62('0x49')][_0x6f62('0x41')]);_0x58a6c6[_0x6f62('0x2f')]=_[_0x6f62('0x30')](_0x1810d3['query']);_0x58a6c6[_0x6f62('0x31')]=_[_0x6f62('0x32')](_0x58a6c6[_0x6f62('0x2e')],_0x58a6c6[_0x6f62('0x2f')]);_0x499b69[_0x6f62('0x33')]=_[_0x6f62('0x32')](_0x58a6c6[_0x6f62('0x2e')],qs[_0x6f62('0x34')](_0x1810d3['query'][_0x6f62('0x34')]));_0x499b69[_0x6f62('0x33')]=_0x499b69[_0x6f62('0x33')][_0x6f62('0x35')]?_0x499b69[_0x6f62('0x33')]:_0x58a6c6[_0x6f62('0x2e')];_0x499b69[_0x6f62('0x4a')]=qs[_0x6f62('0x38')](_0x1810d3[_0x6f62('0x2f')][_0x6f62('0x38')]);_0x499b69[_0x6f62('0x39')]=qs[_0x6f62('0x31')](_[_0x6f62('0x4b')](_0x1810d3[_0x6f62('0x2f')],_0x58a6c6[_0x6f62('0x31')]));if(_0x1810d3[_0x6f62('0x2f')][_0x6f62('0x3a')]){_0x499b69[_0x6f62('0x39')]=_[_0x6f62('0x4c')](_0x499b69[_0x6f62('0x39')],{'$or':_[_0x6f62('0x2a')](_0x499b69[_0x6f62('0x33')],function(_0xa56525){var _0x56a8bc={};_0x56a8bc[_0xa56525]={'$like':'%'+_0x1810d3[_0x6f62('0x2f')][_0x6f62('0x3a')]+'%'};return _0x56a8bc;})});}_0x499b69=_['merge']({},_0x499b69,_0x1810d3['options']);return _0x182c89[_0x6f62('0x47')](_0x499b69);}})[_0x6f62('0x23')](function(_0x20b45f){if(_0x20b45f){_0x1d2edc=_0x20b45f['length'];if(!_0x1810d3[_0x6f62('0x2f')][_0x6f62('0x36')](_0x6f62('0x37'))){_0x499b69['limit']=qs[_0x6f62('0x1c')](_0x1810d3[_0x6f62('0x2f')][_0x6f62('0x1c')]);_0x499b69['offset']=qs[_0x6f62('0x1a')](_0x1810d3['query'][_0x6f62('0x1a')]);}return _0x182c89['getFields'](_0x499b69);}})[_0x6f62('0x23')](function(_0x5e4b35){if(_0x5e4b35){return _0x5e4b35?{'count':_0x1d2edc,'rows':_0x5e4b35}:null;}})[_0x6f62('0x23')](respondWithResult(_0x9aa35d,null))['catch'](handleError(_0x9aa35d,null));};exports['getSubjects']=function(_0x1c07ff,_0x5c8e52,_0x10240f){var _0x1d9103={};var _0x26d1c1={};var _0x1ec551;var _0x551d6b;return db[_0x6f62('0x3b')][_0x6f62('0x48')]({'where':{'id':_0x1c07ff[_0x6f62('0x40')]['id']}})['then'](handleEntityNotFound(_0x5c8e52,null))['then'](function(_0x405dae){if(_0x405dae){_0x1ec551=_0x405dae;_0x26d1c1[_0x6f62('0x2e')]=_['keys'](db[_0x6f62('0x49')][_0x6f62('0x41')]);_0x26d1c1['query']=_[_0x6f62('0x30')](_0x1c07ff[_0x6f62('0x2f')]);_0x26d1c1[_0x6f62('0x31')]=_['intersection'](_0x26d1c1['model'],_0x26d1c1[_0x6f62('0x2f')]);_0x1d9103[_0x6f62('0x33')]=_[_0x6f62('0x32')](_0x26d1c1[_0x6f62('0x2e')],qs[_0x6f62('0x34')](_0x1c07ff[_0x6f62('0x2f')][_0x6f62('0x34')]));_0x1d9103[_0x6f62('0x33')]=_0x1d9103[_0x6f62('0x33')]['length']?_0x1d9103[_0x6f62('0x33')]:_0x26d1c1[_0x6f62('0x2e')];_0x1d9103[_0x6f62('0x4a')]=qs['sort'](_0x1c07ff[_0x6f62('0x2f')][_0x6f62('0x38')]);_0x1d9103[_0x6f62('0x39')]=qs[_0x6f62('0x31')](_[_0x6f62('0x4b')](_0x1c07ff[_0x6f62('0x2f')],_0x26d1c1[_0x6f62('0x31')]));if(_0x1c07ff[_0x6f62('0x2f')][_0x6f62('0x3a')]){_0x1d9103[_0x6f62('0x39')]=_[_0x6f62('0x4c')](_0x1d9103[_0x6f62('0x39')],{'$or':_[_0x6f62('0x2a')](_0x1d9103['attributes'],function(_0x1d75a1){var _0x878f1e={};_0x878f1e[_0x1d75a1]={'$like':'%'+_0x1c07ff[_0x6f62('0x2f')][_0x6f62('0x3a')]+'%'};return _0x878f1e;})});}_0x1d9103=_['merge']({},_0x1d9103,_0x1c07ff[_0x6f62('0x43')]);return _0x1ec551['getSubjects'](_0x1d9103);}})[_0x6f62('0x23')](function(_0xd073a3){if(_0xd073a3){_0x551d6b=_0xd073a3[_0x6f62('0x35')];if(!_0x1c07ff[_0x6f62('0x2f')]['hasOwnProperty'](_0x6f62('0x37'))){_0x1d9103[_0x6f62('0x1c')]=qs['limit'](_0x1c07ff[_0x6f62('0x2f')][_0x6f62('0x1c')]);_0x1d9103[_0x6f62('0x1a')]=qs[_0x6f62('0x1a')](_0x1c07ff['query']['offset']);}return _0x1ec551[_0x6f62('0x4d')](_0x1d9103);}})[_0x6f62('0x23')](function(_0x57c625){if(_0x57c625){return _0x57c625?{'count':_0x551d6b,'rows':_0x57c625}:null;}})[_0x6f62('0x23')](respondWithResult(_0x5c8e52,null))[_0x6f62('0x3e')](handleError(_0x5c8e52,null));};exports[_0x6f62('0x4e')]=function(_0x46e611,_0x24c1b5,_0x23c3bc){var _0x103ca1={};var _0x56c4b7={};var _0x25d105;var _0x3bea78;return db[_0x6f62('0x3b')][_0x6f62('0x48')]({'where':{'id':_0x46e611['params']['id']}})[_0x6f62('0x23')](handleEntityNotFound(_0x24c1b5,null))[_0x6f62('0x23')](function(_0xb0bcc4){if(_0xb0bcc4){_0x25d105=_0xb0bcc4;_0x56c4b7[_0x6f62('0x2e')]=_[_0x6f62('0x30')](db['FreshdeskField'][_0x6f62('0x41')]);_0x56c4b7[_0x6f62('0x2f')]=_[_0x6f62('0x30')](_0x46e611[_0x6f62('0x2f')]);_0x56c4b7['filters']=_[_0x6f62('0x32')](_0x56c4b7[_0x6f62('0x2e')],_0x56c4b7[_0x6f62('0x2f')]);_0x103ca1[_0x6f62('0x33')]=_[_0x6f62('0x32')](_0x56c4b7[_0x6f62('0x2e')],qs['fields'](_0x46e611['query'][_0x6f62('0x34')]));_0x103ca1[_0x6f62('0x33')]=_0x103ca1[_0x6f62('0x33')]['length']?_0x103ca1[_0x6f62('0x33')]:_0x56c4b7[_0x6f62('0x2e')];_0x103ca1['order']=qs[_0x6f62('0x38')](_0x46e611[_0x6f62('0x2f')][_0x6f62('0x38')]);_0x103ca1[_0x6f62('0x39')]=qs['filters'](_[_0x6f62('0x4b')](_0x46e611[_0x6f62('0x2f')],_0x56c4b7[_0x6f62('0x31')]));if(_0x46e611[_0x6f62('0x2f')][_0x6f62('0x3a')]){_0x103ca1['where']=_['merge'](_0x103ca1[_0x6f62('0x39')],{'$or':_['map'](_0x103ca1[_0x6f62('0x33')],function(_0x3f5b31){var _0x123124={};_0x123124[_0x3f5b31]={'$like':'%'+_0x46e611[_0x6f62('0x2f')]['filter']+'%'};return _0x123124;})});}_0x103ca1=_[_0x6f62('0x4c')]({},_0x103ca1,_0x46e611[_0x6f62('0x43')]);return _0x25d105['getDescriptions'](_0x103ca1);}})[_0x6f62('0x23')](function(_0x394d49){if(_0x394d49){_0x3bea78=_0x394d49[_0x6f62('0x35')];if(!_0x46e611['query'][_0x6f62('0x36')](_0x6f62('0x37'))){_0x103ca1[_0x6f62('0x1c')]=qs[_0x6f62('0x1c')](_0x46e611['query']['limit']);_0x103ca1[_0x6f62('0x1a')]=qs[_0x6f62('0x1a')](_0x46e611[_0x6f62('0x2f')][_0x6f62('0x1a')]);}return _0x25d105['getDescriptions'](_0x103ca1);}})['then'](function(_0x4e335b){if(_0x4e335b){return _0x4e335b?{'count':_0x3bea78,'rows':_0x4e335b}:null;}})[_0x6f62('0x23')](respondWithResult(_0x24c1b5,null))[_0x6f62('0x3e')](handleError(_0x24c1b5,null));};exports[_0x6f62('0x4f')]=function(_0xe96aa9,_0x52d246,_0x582e22){var _0x560063={};var _0x3d921d={};var _0x2e459f;var _0x29ac7b;return db[_0x6f62('0x3b')][_0x6f62('0x48')]({'where':{'id':_0xe96aa9[_0x6f62('0x40')]['id']}})['then'](handleEntityNotFound(_0x52d246,null))[_0x6f62('0x23')](function(_0x1ca7a6){if(_0x1ca7a6){_0x2e459f=_0x1ca7a6;_0x3d921d[_0x6f62('0x2e')]=_['keys'](db[_0x6f62('0x50')][_0x6f62('0x41')]);_0x3d921d['query']=_['keys'](_0xe96aa9['query']);_0x3d921d[_0x6f62('0x31')]=_[_0x6f62('0x32')](_0x3d921d[_0x6f62('0x2e')],_0x3d921d[_0x6f62('0x2f')]);_0x560063[_0x6f62('0x33')]=_[_0x6f62('0x32')](_0x3d921d[_0x6f62('0x2e')],qs[_0x6f62('0x34')](_0xe96aa9[_0x6f62('0x2f')][_0x6f62('0x34')]));_0x560063[_0x6f62('0x33')]=_0x560063[_0x6f62('0x33')]['length']?_0x560063[_0x6f62('0x33')]:_0x3d921d[_0x6f62('0x2e')];_0x560063['order']=qs[_0x6f62('0x38')](_0xe96aa9[_0x6f62('0x2f')][_0x6f62('0x38')]);_0x560063[_0x6f62('0x39')]=qs[_0x6f62('0x31')](_[_0x6f62('0x4b')](_0xe96aa9[_0x6f62('0x2f')],_0x3d921d[_0x6f62('0x31')]));if(_0xe96aa9[_0x6f62('0x2f')][_0x6f62('0x3a')]){_0x560063[_0x6f62('0x39')]=_[_0x6f62('0x4c')](_0x560063['where'],{'$or':_[_0x6f62('0x2a')](_0x560063['attributes'],function(_0xcc3852){var _0x137877={};_0x137877[_0xcc3852]={'$like':'%'+_0xe96aa9['query'][_0x6f62('0x3a')]+'%'};return _0x137877;})});}_0x560063=_[_0x6f62('0x4c')]({},_0x560063,_0xe96aa9['options']);return _0x2e459f[_0x6f62('0x4f')](_0x560063);}})[_0x6f62('0x23')](function(_0x1b1837){if(_0x1b1837){_0x29ac7b=_0x1b1837[_0x6f62('0x35')];if(!_0xe96aa9[_0x6f62('0x2f')][_0x6f62('0x36')](_0x6f62('0x37'))){_0x560063[_0x6f62('0x1c')]=qs[_0x6f62('0x1c')](_0xe96aa9[_0x6f62('0x2f')][_0x6f62('0x1c')]);_0x560063[_0x6f62('0x1a')]=qs['offset'](_0xe96aa9[_0x6f62('0x2f')][_0x6f62('0x1a')]);}return _0x2e459f[_0x6f62('0x4f')](_0x560063);}})[_0x6f62('0x23')](function(_0x185f86){if(_0x185f86){return _0x185f86?{'count':_0x29ac7b,'rows':_0x185f86}:null;}})[_0x6f62('0x23')](respondWithResult(_0x52d246,null))[_0x6f62('0x3e')](handleError(_0x52d246,null));};exports['setTags']=function(_0x3eb0d4,_0x593f0d,_0x5d0c31){if(_0x3eb0d4['body']['id']){delete _0x3eb0d4[_0x6f62('0x46')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3eb0d4[_0x6f62('0x40')]['id']}})[_0x6f62('0x23')](handleEntityNotFound(_0x593f0d,null))[_0x6f62('0x23')](function(_0x18b2db){if(_0x18b2db){return _0x18b2db['setTags'](_0x3eb0d4[_0x6f62('0x46')][_0x6f62('0x51')]||[]);}return null;})[_0x6f62('0x23')](respondWithResult(_0x593f0d,null))[_0x6f62('0x3e')](handleError(_0x593f0d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f8a7d3f..4f33281 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 _0x5df6=['path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x54dee7,_0x10ec9b){var _0x29e578=function(_0x3f600e){while(--_0x3f600e){_0x54dee7['push'](_0x54dee7['shift']());}};_0x29e578(++_0x10ec9b);}(_0x5df6,0x6f));var _0x65df=function(_0x2193b0,_0x330bbc){_0x2193b0=_0x2193b0-0x0;var _0x5d3431=_0x5df6[_0x2193b0];return _0x5d3431;};'use strict';var _=require(_0x65df('0x0'));var util=require(_0x65df('0x1'));var logger=require(_0x65df('0x2'))(_0x65df('0x3'));var moment=require('moment');var BPromise=require(_0x65df('0x4'));var rp=require(_0x65df('0x5'));var fs=require('fs');var path=require(_0x65df('0x6'));var rimraf=require(_0x65df('0x7'));var config=require(_0x65df('0x8'));var attributes=require(_0x65df('0x9'));module['exports']=function(_0x3f8136,_0x250c0a){return _0x3f8136[_0x65df('0xa')](_0x65df('0xb'),attributes,{'tableName':_0x65df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3b7=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1728eb,_0x2cc598){var _0xddba26=function(_0x33d368){while(--_0x33d368){_0x1728eb['push'](_0x1728eb['shift']());}};_0xddba26(++_0x2cc598);}(_0xd3b7,0x97));var _0x7d3b=function(_0x3e94f0,_0x1bb6cc){_0x3e94f0=_0x3e94f0-0x0;var _0x951e76=_0xd3b7[_0x3e94f0];return _0x951e76;};'use strict';var _=require(_0x7d3b('0x0'));var util=require(_0x7d3b('0x1'));var logger=require(_0x7d3b('0x2'))(_0x7d3b('0x3'));var moment=require(_0x7d3b('0x4'));var BPromise=require(_0x7d3b('0x5'));var rp=require(_0x7d3b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d3b('0x7'));var config=require(_0x7d3b('0x8'));var attributes=require(_0x7d3b('0x9'));module[_0x7d3b('0xa')]=function(_0x5b7143,_0x5baf73){return _0x5b7143[_0x7d3b('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0x7d3b('0xc'),'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 4e9043f..087f730 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 _0xefec=['then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x5aac59,_0x47ee1e){var _0x40a314=function(_0x4e7bfc){while(--_0x4e7bfc){_0x5aac59['push'](_0x5aac59['shift']());}};_0x40a314(++_0x47ee1e);}(_0xefec,0xa2));var _0xcefe=function(_0x40ae52,_0x55586a){_0x40ae52=_0x40ae52-0x0;var _0x295dd3=_0xefec[_0x40ae52];return _0x295dd3;};'use strict';var _=require(_0xcefe('0x0'));var util=require(_0xcefe('0x1'));var moment=require(_0xcefe('0x2'));var BPromise=require(_0xcefe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcefe('0x4'));var db=require(_0xcefe('0x5'))['db'];var utils=require(_0xcefe('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcefe('0x7'));var jayson=require(_0xcefe('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dff57,_0x29f97c,_0x3b988e){return new BPromise(function(_0x1d50f7,_0x15d99d){return client['request'](_0x3dff57,_0x3b988e)[_0xcefe('0x9')](function(_0x3710fb){logger['info'](_0xcefe('0xa'),_0x29f97c,_0xcefe('0xb'));logger[_0xcefe('0xc')](_0xcefe('0xd'),_0x29f97c,'request\x20sent',JSON[_0xcefe('0xe')](_0x3710fb));if(_0x3710fb[_0xcefe('0xf')]){if(_0x3710fb[_0xcefe('0xf')][_0xcefe('0x10')]===0x1f4){logger['error'](_0xcefe('0xa'),_0x29f97c,_0x3710fb[_0xcefe('0xf')]['message']);return _0x15d99d(_0x3710fb[_0xcefe('0xf')][_0xcefe('0x11')]);}logger[_0xcefe('0xf')](_0xcefe('0xa'),_0x29f97c,_0x3710fb[_0xcefe('0xf')]['message']);return _0x1d50f7(_0x3710fb['error'][_0xcefe('0x11')]);}else{logger['info'](_0xcefe('0xa'),_0x29f97c,_0xcefe('0xb'));_0x1d50f7(_0x3710fb['result'][_0xcefe('0x11')]);}})[_0xcefe('0x12')](function(_0x36a1cf){logger[_0xcefe('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x29f97c,_0x36a1cf);_0x15d99d(_0x36a1cf);});});} \ No newline at end of file +var _0x2c23=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x42d156,_0x46996e){var _0x111e43=function(_0x390f7e){while(--_0x390f7e){_0x42d156['push'](_0x42d156['shift']());}};_0x111e43(++_0x46996e);}(_0x2c23,0xef));var _0x32c2=function(_0x1f244d,_0x19e830){_0x1f244d=_0x1f244d-0x0;var _0x16003a=_0x2c23[_0x1f244d];return _0x16003a;};'use strict';var _=require(_0x32c2('0x0'));var util=require(_0x32c2('0x1'));var moment=require(_0x32c2('0x2'));var BPromise=require(_0x32c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x32c2('0x4'));var logger=require(_0x32c2('0x5'))(_0x32c2('0x6'));var config=require(_0x32c2('0x7'));var jayson=require(_0x32c2('0x8'));var client=jayson['client'][_0x32c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45c6f8,_0x8035b8,_0x3d7239){return new BPromise(function(_0x38e14c,_0x5c4a2b){return client[_0x32c2('0xa')](_0x45c6f8,_0x3d7239)[_0x32c2('0xb')](function(_0x3f4300){logger[_0x32c2('0xc')](_0x32c2('0xd'),_0x8035b8,_0x32c2('0xe'));logger[_0x32c2('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x8035b8,_0x32c2('0xe'),JSON[_0x32c2('0x10')](_0x3f4300));if(_0x3f4300['error']){if(_0x3f4300[_0x32c2('0x11')][_0x32c2('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x8035b8,_0x3f4300[_0x32c2('0x11')][_0x32c2('0x13')]);return _0x5c4a2b(_0x3f4300[_0x32c2('0x11')]['message']);}logger[_0x32c2('0x11')](_0x32c2('0xd'),_0x8035b8,_0x3f4300[_0x32c2('0x11')]['message']);return _0x38e14c(_0x3f4300['error'][_0x32c2('0x13')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x8035b8,'request\x20sent');_0x38e14c(_0x3f4300[_0x32c2('0x14')][_0x32c2('0x13')]);}})['catch'](function(_0x5e823c){logger['error'](_0x32c2('0xd'),_0x8035b8,_0x5e823c);_0x5c4a2b(_0x5e823c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index edb3495..99f2700 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 _0xf490=['../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x529cf8,_0x4f395c){var _0x5a8c35=function(_0x10e460){while(--_0x10e460){_0x529cf8['push'](_0x529cf8['shift']());}};_0x5a8c35(++_0x4f395c);}(_0xf490,0x107));var _0x0f49=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0xf490[_0x4cc03b];return _0xf0358c;};'use strict';var multer=require(_0x0f49('0x0'));var util=require(_0x0f49('0x1'));var path=require(_0x0f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f49('0x3'));var router=express[_0x0f49('0x4')]();var fs_extra=require(_0x0f49('0x5'));var auth=require(_0x0f49('0x6'));var interaction=require(_0x0f49('0x7'));var config=require('../../config/environment');var controller=require(_0x0f49('0x8'));router['get']('/',auth[_0x0f49('0x9')](),controller[_0x0f49('0xa')]);router[_0x0f49('0xb')](_0x0f49('0xc'),auth[_0x0f49('0x9')](),controller[_0x0f49('0xd')]);router['post']('/',auth[_0x0f49('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0f49('0xe')]);router[_0x0f49('0xf')]('/:id',auth[_0x0f49('0x9')](),controller[_0x0f49('0x10')]);module[_0x0f49('0x11')]=router; \ No newline at end of file +var _0xa2fa=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2bb713,_0x8eff09){var _0x2a5452=function(_0x4140d7){while(--_0x4140d7){_0x2bb713['push'](_0x2bb713['shift']());}};_0x2a5452(++_0x8eff09);}(_0xa2fa,0x1eb));var _0xaa2f=function(_0x1d37c6,_0x5ec404){_0x1d37c6=_0x1d37c6-0x0;var _0xd95b3a=_0xa2fa[_0x1d37c6];return _0xd95b3a;};'use strict';var multer=require(_0xaa2f('0x0'));var util=require('util');var path=require(_0xaa2f('0x1'));var timeout=require(_0xaa2f('0x2'));var express=require(_0xaa2f('0x3'));var router=express[_0xaa2f('0x4')]();var fs_extra=require(_0xaa2f('0x5'));var auth=require(_0xaa2f('0x6'));var interaction=require(_0xaa2f('0x7'));var config=require(_0xaa2f('0x8'));var controller=require('./intFreshdeskField.controller');router[_0xaa2f('0x9')]('/',auth[_0xaa2f('0xa')](),controller[_0xaa2f('0xb')]);router[_0xaa2f('0x9')](_0xaa2f('0xc'),auth[_0xaa2f('0xa')](),controller[_0xaa2f('0xd')]);router[_0xaa2f('0xe')]('/',auth[_0xaa2f('0xa')](),controller[_0xaa2f('0xf')]);router[_0xaa2f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xaa2f('0x11')]);router[_0xaa2f('0x12')](_0xaa2f('0xc'),auth['isAuthenticated'](),controller[_0xaa2f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 8613be7..d7357c0 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 _0x72fb=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable'];(function(_0x526786,_0x105cbf){var _0x3a512d=function(_0x4efa05){while(--_0x4efa05){_0x526786['push'](_0x526786['shift']());}};_0x3a512d(++_0x105cbf);}(_0x72fb,0x1d7));var _0xb72f=function(_0x35e06d,_0xad434c){_0x35e06d=_0x35e06d-0x0;var _0x1b7a39=_0x72fb[_0x35e06d];return _0x1b7a39;};'use strict';var Sequelize=require(_0xb72f('0x0'));module[_0xb72f('0x1')]={'type':{'type':Sequelize[_0xb72f('0x2')]('string','variable',_0xb72f('0x3'),_0xb72f('0x4'),_0xb72f('0x5')),'defaultValue':_0xb72f('0x6')},'content':{'type':Sequelize[_0xb72f('0x7')]},'key':{'type':Sequelize[_0xb72f('0x7')]},'keyType':{'type':Sequelize[_0xb72f('0x2')](_0xb72f('0x6'),_0xb72f('0x8'),_0xb72f('0x3'))},'keyContent':{'type':Sequelize[_0xb72f('0x7')]},'idField':{'type':Sequelize[_0xb72f('0x7')]},'nameField':{'type':Sequelize[_0xb72f('0x7')]},'customField':{'type':Sequelize[_0xb72f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x58c5=['picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x545a32,_0x2ac74a){var _0x4b798f=function(_0x583d79){while(--_0x583d79){_0x545a32['push'](_0x545a32['shift']());}};_0x4b798f(++_0x2ac74a);}(_0x58c5,0x12c));var _0x558c=function(_0x4ab999,_0x5c5795){_0x4ab999=_0x4ab999-0x0;var _0x3e206e=_0x58c5[_0x4ab999];return _0x3e206e;};'use strict';var Sequelize=require(_0x558c('0x0'));module[_0x558c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x558c('0x2'),_0x558c('0x3'),_0x558c('0x4'),_0x558c('0x5'),_0x558c('0x6')),'defaultValue':_0x558c('0x2')},'content':{'type':Sequelize[_0x558c('0x7')]},'key':{'type':Sequelize[_0x558c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x558c('0x2'),_0x558c('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x558c('0x7')]},'idField':{'type':Sequelize[_0x558c('0x7')]},'nameField':{'type':Sequelize[_0x558c('0x7')]},'customField':{'type':Sequelize[_0x558c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index f9f62f0..f324b91 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 _0x9bde=['catch','show','params','includeAll','include','create','body','update','find','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','FreshdeskField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','rows'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2d43f0,_0x32df39){_0x2d43f0=_0x2d43f0-0x0;var _0x566580=_0x9bde[_0x2d43f0];return _0x566580;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={},_0x1de54c={},_0x56e409={'count':0x0,'rows':[]};var _0xa45eb0=_[_0xe9bd('0x2b')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')],function(_0x4057df){return{'name':_0x4057df['fieldName'],'type':_0x4057df['type'][_0xe9bd('0x2e')]};});_0x1de54c[_0xe9bd('0x2f')]=_[_0xe9bd('0x2b')](_0xa45eb0,_0xe9bd('0x28'));_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x183601[_0xe9bd('0x30')]);_0x1de54c[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x1de54c['model'],_0x1de54c[_0xe9bd('0x30')]);_0x5b7f1d[_0xe9bd('0x34')]=_[_0xe9bd('0x33')](_0x1de54c['model'],qs['fields'](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x5b7f1d[_0xe9bd('0x34')]=_0x5b7f1d[_0xe9bd('0x34')][_0xe9bd('0x36')]?_0x5b7f1d[_0xe9bd('0x34')]:_0x1de54c[_0xe9bd('0x2f')];if(!_0x183601[_0xe9bd('0x30')][_0xe9bd('0x37')](_0xe9bd('0x38'))){_0x5b7f1d[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x1e')]);_0x5b7f1d[_0xe9bd('0x20')]=qs[_0xe9bd('0x20')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x20')]);}_0x5b7f1d['order']=qs[_0xe9bd('0x39')](_0x183601[_0xe9bd('0x30')]['sort']);_0x5b7f1d[_0xe9bd('0x3a')]=qs[_0xe9bd('0x32')](_['pick'](_0x183601['query'],_0x1de54c[_0xe9bd('0x32')]),_0xa45eb0);if(_0x183601[_0xe9bd('0x30')]['filter']){_0x5b7f1d[_0xe9bd('0x3a')]=_[_0xe9bd('0x3b')](_0x5b7f1d[_0xe9bd('0x3a')],{'$or':_['map'](_0xa45eb0,function(_0x19740b){if(_0x19740b['type']!==_0xe9bd('0x3c')){var _0x42238a={};_0x42238a[_0x19740b[_0xe9bd('0x28')]]={'$like':'%'+_0x183601[_0xe9bd('0x30')]['filter']+'%'};return _0x42238a;}})});}_0x5b7f1d=_[_0xe9bd('0x3b')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x3d')]);var _0x327e1a={'where':_0x5b7f1d[_0xe9bd('0x3a')]};return db[_0xe9bd('0x2c')][_0xe9bd('0x1f')](_0x327e1a)[_0xe9bd('0x25')](function(_0xacfd19){_0x56e409[_0xe9bd('0x1f')]=_0xacfd19;if(_0x183601[_0xe9bd('0x30')]['includeAll']){_0x5b7f1d['include']=[{'all':!![]}];}return db[_0xe9bd('0x2c')]['findAll'](_0x5b7f1d);})[_0xe9bd('0x25')](function(_0x340819){_0x56e409[_0xe9bd('0x3e')]=_0x340819;return _0x56e409;})['then'](respondWithFilteredResult(_0x519f48,_0x5b7f1d))[_0xe9bd('0x3f')](handleError(_0x519f48,null));};exports[_0xe9bd('0x40')]=function(_0x1a2d94,_0x5a4460){var _0x2ef01b={'raw':!![],'where':{'id':_0x1a2d94[_0xe9bd('0x41')]['id']}},_0x3a5703={};_0x3a5703[_0xe9bd('0x2f')]=_[_0xe9bd('0x31')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')]);_0x3a5703[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1a2d94[_0xe9bd('0x30')]);_0x3a5703[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x3a5703[_0xe9bd('0x2f')],_0x3a5703[_0xe9bd('0x30')]);_0x2ef01b[_0xe9bd('0x34')]=_['intersection'](_0x3a5703['model'],qs[_0xe9bd('0x35')](_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x2ef01b['attributes']=_0x2ef01b['attributes'][_0xe9bd('0x36')]?_0x2ef01b[_0xe9bd('0x34')]:_0x3a5703[_0xe9bd('0x2f')];if(_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x42')]){_0x2ef01b[_0xe9bd('0x43')]=[{'all':!![]}];}_0x2ef01b=_[_0xe9bd('0x3b')]({},_0x2ef01b,_0x1a2d94['options']);return db[_0xe9bd('0x2c')]['find'](_0x2ef01b)[_0xe9bd('0x25')](handleEntityNotFound(_0x5a4460,null))[_0xe9bd('0x25')](respondWithResult(_0x5a4460,null))[_0xe9bd('0x3f')](handleError(_0x5a4460,null));};exports[_0xe9bd('0x44')]=function(_0x74ea23,_0x4b7b67){return db[_0xe9bd('0x2c')][_0xe9bd('0x44')](_0x74ea23[_0xe9bd('0x45')],{})['then'](respondWithResult(_0x4b7b67,0xc9))[_0xe9bd('0x3f')](handleError(_0x4b7b67,null));};exports[_0xe9bd('0x46')]=function(_0x34f787,_0x5a466b){if(_0x34f787[_0xe9bd('0x45')]['id']){delete _0x34f787[_0xe9bd('0x45')]['id'];}return db[_0xe9bd('0x2c')][_0xe9bd('0x47')]({'where':{'id':_0x34f787[_0xe9bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a466b,null))[_0xe9bd('0x25')](saveUpdates(_0x34f787['body'],null))[_0xe9bd('0x25')](respondWithResult(_0x5a466b,null))[_0xe9bd('0x3f')](handleError(_0x5a466b,null));};exports[_0xe9bd('0x26')]=function(_0x14b06b,_0x194b7d){return db['FreshdeskField'][_0xe9bd('0x47')]({'where':{'id':_0x14b06b['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x194b7d,null))[_0xe9bd('0x25')](removeEntity(_0x194b7d,null))['catch'](handleError(_0x194b7d,null));}; \ No newline at end of file +var _0x777d=['send','index','map','FreshdeskField','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','limit','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','lodash','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','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','update','then','destroy','error','name'];(function(_0x2c559d,_0x28059e){var _0x28e217=function(_0x6d4407){while(--_0x6d4407){_0x2c559d['push'](_0x2c559d['shift']());}};_0x28e217(++_0x28059e);}(_0x777d,0xe9));var _0xd777=function(_0x3ff2f9,_0x544ba1){_0x3ff2f9=_0x3ff2f9-0x0;var _0x3b0913=_0x777d[_0x3ff2f9];return _0x3b0913;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd777('0x0'));var zipdir=require(_0xd777('0x1'));var jsonpatch=require(_0xd777('0x2'));var rp=require('request-promise');var moment=require(_0xd777('0x3'));var BPromise=require(_0xd777('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd777('0x5'));var csv=require('to-csv');var ejs=require(_0xd777('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd777('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd777('0x8'));var toCsv=require(_0xd777('0x9'));var querystring=require(_0xd777('0xa'));var Papa=require(_0xd777('0xb'));var Redis=require(_0xd777('0xc'));var authService=require(_0xd777('0xd'));var qs=require(_0xd777('0xe'));var as=require(_0xd777('0xf'));var hardwareService=require(_0xd777('0x10'));var logger=require(_0xd777('0x11'))(_0xd777('0x12'));var utils=require(_0xd777('0x13'));var config=require(_0xd777('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25f574,_0x560778){_0x560778=_0x560778||0xcc;return function(_0x2cc3e7){if(_0x2cc3e7){return _0x25f574[_0xd777('0x15')](_0x560778);}return _0x25f574[_0xd777('0x16')](_0x560778)[_0xd777('0x17')]();};}function respondWithResult(_0x2ac82f,_0x5d0ded){_0x5d0ded=_0x5d0ded||0xc8;return function(_0x84141c){if(_0x84141c){return _0x2ac82f['status'](_0x5d0ded)[_0xd777('0x18')](_0x84141c);}};}function respondWithFilteredResult(_0x2cd014,_0x1e5ecb){return function(_0x1ef016){if(_0x1ef016){var _0x25e3f2=typeof _0x1e5ecb['offset']===_0xd777('0x19')&&typeof _0x1e5ecb['limit']===_0xd777('0x19');var _0x4dcaed=_0x1ef016[_0xd777('0x1a')];var _0x386f1a=_0x25e3f2?0x0:_0x1e5ecb[_0xd777('0x1b')];var _0x13b63b=_0x25e3f2?_0x1ef016[_0xd777('0x1a')]:_0x1e5ecb[_0xd777('0x1b')]+_0x1e5ecb['limit'];var _0x4d6100;if(_0x13b63b>=_0x4dcaed){_0x13b63b=_0x4dcaed;_0x4d6100=0xc8;}else{_0x4d6100=0xce;}_0x2cd014[_0xd777('0x16')](_0x4d6100);return _0x2cd014['set'](_0xd777('0x1c'),_0x386f1a+'-'+_0x13b63b+'/'+_0x4dcaed)['json'](_0x1ef016);}return null;};}function patchUpdates(_0x58a079){return function(_0x5b2204){try{jsonpatch[_0xd777('0x1d')](_0x5b2204,_0x58a079,!![]);}catch(_0x4e53ed){return BPromise['reject'](_0x4e53ed);}return _0x5b2204['save']();};}function saveUpdates(_0x48d18c,_0x55b975){return function(_0x8cfb5a){if(_0x8cfb5a){return _0x8cfb5a[_0xd777('0x1e')](_0x48d18c)[_0xd777('0x1f')](function(_0x343405){return _0x343405;});}return null;};}function removeEntity(_0xfebc2f,_0x33c3d4){return function(_0x2ff8d3){if(_0x2ff8d3){return _0x2ff8d3[_0xd777('0x20')]()[_0xd777('0x1f')](function(){_0xfebc2f[_0xd777('0x16')](0xcc)[_0xd777('0x17')]();});}};}function handleEntityNotFound(_0x56af61,_0x373646){return function(_0x63e5c1){if(!_0x63e5c1){_0x56af61[_0xd777('0x15')](0x194);}return _0x63e5c1;};}function handleError(_0x15f1fd,_0x184ff6){_0x184ff6=_0x184ff6||0x1f4;return function(_0x5e32de){logger[_0xd777('0x21')](_0x5e32de['stack']);if(_0x5e32de['name']){delete _0x5e32de[_0xd777('0x22')];}_0x15f1fd[_0xd777('0x16')](_0x184ff6)[_0xd777('0x23')](_0x5e32de);};}exports[_0xd777('0x24')]=function(_0x4c941c,_0x453b45){var _0x141baa={},_0x4f93eb={},_0x1975e2={'count':0x0,'rows':[]};var _0xb63cf7=_[_0xd777('0x25')](db[_0xd777('0x26')][_0xd777('0x27')],function(_0x508587){return{'name':_0x508587[_0xd777('0x28')],'type':_0x508587['type']['key']};});_0x4f93eb[_0xd777('0x29')]=_[_0xd777('0x25')](_0xb63cf7,_0xd777('0x22'));_0x4f93eb[_0xd777('0x2a')]=_['keys'](_0x4c941c['query']);_0x4f93eb[_0xd777('0x2b')]=_[_0xd777('0x2c')](_0x4f93eb[_0xd777('0x29')],_0x4f93eb[_0xd777('0x2a')]);_0x141baa[_0xd777('0x2d')]=_[_0xd777('0x2c')](_0x4f93eb['model'],qs['fields'](_0x4c941c[_0xd777('0x2a')][_0xd777('0x2e')]));_0x141baa[_0xd777('0x2d')]=_0x141baa[_0xd777('0x2d')][_0xd777('0x2f')]?_0x141baa[_0xd777('0x2d')]:_0x4f93eb[_0xd777('0x29')];if(!_0x4c941c[_0xd777('0x2a')]['hasOwnProperty']('nolimit')){_0x141baa[_0xd777('0x30')]=qs['limit'](_0x4c941c[_0xd777('0x2a')][_0xd777('0x30')]);_0x141baa[_0xd777('0x1b')]=qs[_0xd777('0x1b')](_0x4c941c['query'][_0xd777('0x1b')]);}_0x141baa['order']=qs[_0xd777('0x31')](_0x4c941c['query']['sort']);_0x141baa['where']=qs['filters'](_[_0xd777('0x32')](_0x4c941c[_0xd777('0x2a')],_0x4f93eb[_0xd777('0x2b')]),_0xb63cf7);if(_0x4c941c['query']['filter']){_0x141baa['where']=_[_0xd777('0x33')](_0x141baa[_0xd777('0x34')],{'$or':_[_0xd777('0x25')](_0xb63cf7,function(_0x471bfd){if(_0x471bfd[_0xd777('0x35')]!==_0xd777('0x36')){var _0xf496bb={};_0xf496bb[_0x471bfd[_0xd777('0x22')]]={'$like':'%'+_0x4c941c[_0xd777('0x2a')][_0xd777('0x37')]+'%'};return _0xf496bb;}})});}_0x141baa=_['merge']({},_0x141baa,_0x4c941c[_0xd777('0x38')]);var _0x11a5f7={'where':_0x141baa[_0xd777('0x34')]};return db[_0xd777('0x26')][_0xd777('0x1a')](_0x11a5f7)[_0xd777('0x1f')](function(_0x3356c2){_0x1975e2[_0xd777('0x1a')]=_0x3356c2;if(_0x4c941c[_0xd777('0x2a')][_0xd777('0x39')]){_0x141baa[_0xd777('0x3a')]=[{'all':!![]}];}return db[_0xd777('0x26')]['findAll'](_0x141baa);})[_0xd777('0x1f')](function(_0x52b3d0){_0x1975e2[_0xd777('0x3b')]=_0x52b3d0;return _0x1975e2;})[_0xd777('0x1f')](respondWithFilteredResult(_0x453b45,_0x141baa))[_0xd777('0x3c')](handleError(_0x453b45,null));};exports[_0xd777('0x3d')]=function(_0x149329,_0x11d654){var _0x4af057={'raw':!![],'where':{'id':_0x149329[_0xd777('0x3e')]['id']}},_0x3dd8af={};_0x3dd8af[_0xd777('0x29')]=_['keys'](db[_0xd777('0x26')][_0xd777('0x27')]);_0x3dd8af[_0xd777('0x2a')]=_[_0xd777('0x3f')](_0x149329[_0xd777('0x2a')]);_0x3dd8af[_0xd777('0x2b')]=_[_0xd777('0x2c')](_0x3dd8af['model'],_0x3dd8af[_0xd777('0x2a')]);_0x4af057[_0xd777('0x2d')]=_['intersection'](_0x3dd8af['model'],qs[_0xd777('0x2e')](_0x149329[_0xd777('0x2a')][_0xd777('0x2e')]));_0x4af057[_0xd777('0x2d')]=_0x4af057[_0xd777('0x2d')][_0xd777('0x2f')]?_0x4af057[_0xd777('0x2d')]:_0x3dd8af[_0xd777('0x29')];if(_0x149329[_0xd777('0x2a')][_0xd777('0x39')]){_0x4af057[_0xd777('0x3a')]=[{'all':!![]}];}_0x4af057=_['merge']({},_0x4af057,_0x149329[_0xd777('0x38')]);return db[_0xd777('0x26')][_0xd777('0x40')](_0x4af057)['then'](handleEntityNotFound(_0x11d654,null))['then'](respondWithResult(_0x11d654,null))[_0xd777('0x3c')](handleError(_0x11d654,null));};exports[_0xd777('0x41')]=function(_0x26d5d7,_0x281d1d){return db[_0xd777('0x26')][_0xd777('0x41')](_0x26d5d7[_0xd777('0x42')],{})[_0xd777('0x1f')](respondWithResult(_0x281d1d,0xc9))['catch'](handleError(_0x281d1d,null));};exports[_0xd777('0x1e')]=function(_0x559232,_0x4c059d){if(_0x559232[_0xd777('0x42')]['id']){delete _0x559232[_0xd777('0x42')]['id'];}return db['FreshdeskField'][_0xd777('0x40')]({'where':{'id':_0x559232[_0xd777('0x3e')]['id']}})[_0xd777('0x1f')](handleEntityNotFound(_0x4c059d,null))[_0xd777('0x1f')](saveUpdates(_0x559232['body'],null))['then'](respondWithResult(_0x4c059d,null))[_0xd777('0x3c')](handleError(_0x4c059d,null));};exports['destroy']=function(_0x45b806,_0x24779c){return db[_0xd777('0x26')][_0xd777('0x40')]({'where':{'id':_0x45b806[_0xd777('0x3e')]['id']}})['then'](handleEntityNotFound(_0x24779c,null))[_0xd777('0x1f')](removeEntity(_0x24779c,null))[_0xd777('0x3c')](handleError(_0x24779c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f1d3719..f7c8b9c 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 _0xed1c=['request-promise','path','exports','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed1c,0x7f));var _0xced1=function(_0x30bf81,_0x4c00c5){_0x30bf81=_0x30bf81-0x0;var _0x148a30=_0xed1c[_0x30bf81];return _0x148a30;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')(_0xced1('0x2'));var moment=require(_0xced1('0x3'));var BPromise=require(_0xced1('0x4'));var rp=require(_0xced1('0x5'));var fs=require('fs');var path=require(_0xced1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0xced1('0x7')]=function(_0x4846c3,_0x39baa1){return _0x4846c3['define'](_0xced1('0x8'),attributes,{'tableName':_0xced1('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xced1('0xa'),_0xced1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a17=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x57380d,_0x4eab6a){var _0x4e8d3d=function(_0x340be9){while(--_0x340be9){_0x57380d['push'](_0x57380d['shift']());}};_0x4e8d3d(++_0x4eab6a);}(_0x6a17,0x1e8));var _0x76a1=function(_0x1f7163,_0x18ee06){_0x1f7163=_0x1f7163-0x0;var _0x5c87e3=_0x6a17[_0x1f7163];return _0x5c87e3;};'use strict';var _=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var logger=require(_0x76a1('0x2'))(_0x76a1('0x3'));var moment=require(_0x76a1('0x4'));var BPromise=require(_0x76a1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76a1('0x6'));var rimraf=require(_0x76a1('0x7'));var config=require(_0x76a1('0x8'));var attributes=require(_0x76a1('0x9'));module[_0x76a1('0xa')]=function(_0x31e56c,_0x5e1cff){return _0x31e56c[_0x76a1('0xb')](_0x76a1('0xc'),attributes,{'tableName':_0x76a1('0xd'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x76a1('0xe')],'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 15cd6c9..1a0863d 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 _0x883b=['../../config/environment','client','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c882f,_0x804b1d){var _0x52addd=function(_0x1e1b39){while(--_0x1e1b39){_0x4c882f['push'](_0x4c882f['shift']());}};_0x52addd(++_0x804b1d);}(_0x883b,0x6a));var _0xb883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb883('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb883('0x1'));var rs=require(_0xb883('0x2'));var fs=require('fs');var Redis=require(_0xb883('0x3'));var db=require(_0xb883('0x4'))['db'];var utils=require(_0xb883('0x5'));var logger=require(_0xb883('0x6'))(_0xb883('0x7'));var config=require(_0xb883('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb883('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a8204,_0x22a89e,_0x59ea9a){return new BPromise(function(_0x5d275d,_0x599477){return client['request'](_0x3a8204,_0x59ea9a)[_0xb883('0xa')](function(_0x275cb3){logger[_0xb883('0xb')](_0xb883('0xc'),_0x22a89e,'request\x20sent');logger[_0xb883('0xd')](_0xb883('0xe'),_0x22a89e,_0xb883('0xf'),JSON['stringify'](_0x275cb3));if(_0x275cb3[_0xb883('0x10')]){if(_0x275cb3[_0xb883('0x10')][_0xb883('0x11')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x22a89e,_0x275cb3[_0xb883('0x10')]['message']);return _0x599477(_0x275cb3[_0xb883('0x10')]['message']);}logger[_0xb883('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x22a89e,_0x275cb3[_0xb883('0x10')]['message']);return _0x5d275d(_0x275cb3[_0xb883('0x10')][_0xb883('0x12')]);}else{logger[_0xb883('0xb')](_0xb883('0xc'),_0x22a89e,_0xb883('0xf'));_0x5d275d(_0x275cb3['result']['message']);}})['catch'](function(_0x23a395){logger['error'](_0xb883('0xc'),_0x22a89e,_0x23a395);_0x599477(_0x23a395);});});} \ No newline at end of file +var _0x53e8=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1e14db,_0x49f2aa){var _0x78536=function(_0x5e4739){while(--_0x5e4739){_0x1e14db['push'](_0x1e14db['shift']());}};_0x78536(++_0x49f2aa);}(_0x53e8,0x17d));var _0x853e=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x53e8[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x853e('0x0'));var util=require(_0x853e('0x1'));var moment=require(_0x853e('0x2'));var BPromise=require('bluebird');var rs=require(_0x853e('0x3'));var fs=require('fs');var Redis=require(_0x853e('0x4'));var db=require(_0x853e('0x5'))['db'];var utils=require(_0x853e('0x6'));var logger=require('../../config/logger')(_0x853e('0x7'));var config=require(_0x853e('0x8'));var jayson=require(_0x853e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7cf322,_0x1d73e5,_0x146596){return new BPromise(function(_0x524db4,_0x1766f8){return client['request'](_0x7cf322,_0x146596)[_0x853e('0xa')](function(_0x209fe6){logger[_0x853e('0xb')](_0x853e('0xc'),_0x1d73e5,_0x853e('0xd'));logger[_0x853e('0xe')](_0x853e('0xf'),_0x1d73e5,_0x853e('0xd'),JSON['stringify'](_0x209fe6));if(_0x209fe6[_0x853e('0x10')]){if(_0x209fe6[_0x853e('0x10')][_0x853e('0x11')]===0x1f4){logger[_0x853e('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x1d73e5,_0x209fe6['error'][_0x853e('0x12')]);return _0x1766f8(_0x209fe6['error'][_0x853e('0x12')]);}logger[_0x853e('0x10')](_0x853e('0xc'),_0x1d73e5,_0x209fe6['error'][_0x853e('0x12')]);return _0x524db4(_0x209fe6[_0x853e('0x10')][_0x853e('0x12')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x1d73e5,_0x853e('0xd'));_0x524db4(_0x209fe6['result'][_0x853e('0x12')]);}})[_0x853e('0x13')](function(_0x22084c){logger[_0x853e('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x1d73e5,_0x22084c);_0x1766f8(_0x22084c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index e4f9841..516c4ed 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 _0xde2c=['getFields','post','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x360a75,_0x1b5342){var _0x5da663=function(_0x21200e){while(--_0x21200e){_0x360a75['push'](_0x360a75['shift']());}};_0x5da663(++_0x1b5342);}(_0xde2c,0x7f));var _0xcde2=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xde2c[_0x2283dc];return _0x16db90;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id/configurations',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcde2('0x12')](_0xcde2('0x13'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x14')]);router[_0xcde2('0x15')](_0xcde2('0xd'),auth['isAuthenticated'](),controller[_0xcde2('0x16')]);router['delete'](_0xcde2('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xcde2('0x17')]=router; \ No newline at end of file +var _0x41bb=['/:id/fields','getFields','post','addConfiguration','put','update','delete','/:id','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x4667ae,_0x4ed90a){var _0x1b3479=function(_0x1862e0){while(--_0x1862e0){_0x4667ae['push'](_0x4667ae['shift']());}};_0x1b3479(++_0x4ed90a);}(_0x41bb,0xc5));var _0xb41b=function(_0x17fccd,_0x753864){_0x17fccd=_0x17fccd-0x0;var _0x54b81c=_0x41bb[_0x17fccd];return _0x54b81c;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/:id',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0x8')](_0xb41b('0xd'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router['post']('/',auth[_0xb41b('0x9')](),controller['create']);router[_0xb41b('0xf')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x10')]);router[_0xb41b('0x11')]('/:id',auth[_0xb41b('0x9')](),controller[_0xb41b('0x12')]);router[_0xb41b('0x13')](_0xb41b('0x14'),auth[_0xb41b('0x9')](),controller['destroy']);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 b2c0c70..7e3a506 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 _0x583c=['exports','STRING','username','sequelize'];(function(_0x164ca4,_0x916bae){var _0xebc2b8=function(_0x2ee97c){while(--_0x2ee97c){_0x164ca4['push'](_0x164ca4['shift']());}};_0xebc2b8(++_0x916bae);}(_0x583c,0x12b));var _0xc583=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x583c[_0x26b622];return _0x58a028;};'use strict';var Sequelize=require(_0xc583('0x0'));module[_0xc583('0x1')]={'name':{'type':Sequelize[_0xc583('0x2')]},'description':{'type':Sequelize[_0xc583('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc583('0x3')},'apiKey':{'type':Sequelize[_0xc583('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc583('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x1eba[_0x4b2251];return _0x5d22fb;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('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 b9682d6..d22dd58 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 _0x2a73=['zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','options','addConfiguration','AccountId','getSubjects','getDescriptions','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf'];(function(_0x49392e,_0x441b28){var _0xe978bb=function(_0x4404d1){while(--_0x4404d1){_0x49392e['push'](_0x49392e['shift']());}};_0xe978bb(++_0x441b28);}(_0x2a73,0x68));var _0x32a7=function(_0x1b14cf,_0x2abf37){_0x1b14cf=_0x1b14cf-0x0;var _0x562a94=_0x2a73[_0x1b14cf];return _0x562a94;};'use strict';var emlformat=require(_0x32a7('0x0'));var rimraf=require(_0x32a7('0x1'));var zipdir=require(_0x32a7('0x2'));var jsonpatch=require(_0x32a7('0x3'));var rp=require(_0x32a7('0x4'));var moment=require(_0x32a7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x32a7('0x6'));var path=require(_0x32a7('0x7'));var sox=require('sox');var csv=require(_0x32a7('0x8'));var ejs=require(_0x32a7('0x9'));var fs=require('fs');var fs_extra=require(_0x32a7('0xa'));var _=require(_0x32a7('0xb'));var squel=require(_0x32a7('0xc'));var crypto=require(_0x32a7('0xd'));var jsforce=require(_0x32a7('0xe'));var deskjs=require(_0x32a7('0xf'));var toCsv=require(_0x32a7('0x8'));var querystring=require(_0x32a7('0x10'));var Papa=require(_0x32a7('0x11'));var Redis=require(_0x32a7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x32a7('0x13'));var hardwareService=require(_0x32a7('0x14'));var logger=require(_0x32a7('0x15'))(_0x32a7('0x16'));var utils=require(_0x32a7('0x17'));var config=require(_0x32a7('0x18'));var licenseUtil=require(_0x32a7('0x19'));var db=require(_0x32a7('0x1a'))['db'];var integrations=require(_0x32a7('0x1b'));function respondWithStatusCode(_0x3a9ecd,_0x2d9b4b){_0x2d9b4b=_0x2d9b4b||0xcc;return function(_0x20f5d4){if(_0x20f5d4){return _0x3a9ecd['sendStatus'](_0x2d9b4b);}return _0x3a9ecd[_0x32a7('0x1c')](_0x2d9b4b)[_0x32a7('0x1d')]();};}function respondWithResult(_0xbb2b2b,_0x34a249){_0x34a249=_0x34a249||0xc8;return function(_0x528da8){if(_0x528da8){return _0xbb2b2b[_0x32a7('0x1c')](_0x34a249)['json'](_0x528da8);}};}function respondWithFilteredResult(_0x41b549,_0x24c862){return function(_0x57209f){if(_0x57209f){var _0x3866cf=typeof _0x24c862[_0x32a7('0x1e')]==='undefined'&&typeof _0x24c862[_0x32a7('0x1f')]==='undefined';var _0x1fb213=_0x57209f[_0x32a7('0x20')];var _0x503659=_0x3866cf?0x0:_0x24c862['offset'];var _0x20e2fa=_0x3866cf?_0x57209f[_0x32a7('0x20')]:_0x24c862[_0x32a7('0x1e')]+_0x24c862['limit'];var _0x1be23d;if(_0x20e2fa>=_0x1fb213){_0x20e2fa=_0x1fb213;_0x1be23d=0xc8;}else{_0x1be23d=0xce;}_0x41b549[_0x32a7('0x1c')](_0x1be23d);return _0x41b549[_0x32a7('0x21')](_0x32a7('0x22'),_0x503659+'-'+_0x20e2fa+'/'+_0x1fb213)[_0x32a7('0x23')](_0x57209f);}return null;};}function patchUpdates(_0x5f40fa){return function(_0x506b68){try{jsonpatch[_0x32a7('0x24')](_0x506b68,_0x5f40fa,!![]);}catch(_0x3fc66a){return BPromise[_0x32a7('0x25')](_0x3fc66a);}return _0x506b68[_0x32a7('0x26')]();};}function saveUpdates(_0x3b795f,_0x46cd93){return function(_0x11bae6){if(_0x11bae6){return _0x11bae6[_0x32a7('0x27')](_0x3b795f)[_0x32a7('0x28')](function(_0x5b8c7d){return _0x5b8c7d;});}return null;};}function removeEntity(_0x879a67,_0x2cc6e4){return function(_0x5d552a){if(_0x5d552a){return _0x5d552a['destroy']()[_0x32a7('0x28')](function(){_0x879a67[_0x32a7('0x1c')](0xcc)[_0x32a7('0x1d')]();});}};}function handleEntityNotFound(_0x37cae4,_0x26308b){return function(_0x34d986){if(!_0x34d986){_0x37cae4['sendStatus'](0x194);}return _0x34d986;};}function handleError(_0x48cb42,_0x400ec0){_0x400ec0=_0x400ec0||0x1f4;return function(_0x43b092){logger[_0x32a7('0x29')](_0x43b092[_0x32a7('0x2a')]);if(_0x43b092[_0x32a7('0x2b')]){delete _0x43b092['name'];}_0x48cb42[_0x32a7('0x1c')](_0x400ec0)['send'](_0x43b092);};}exports[_0x32a7('0x2c')]=function(_0x26b16c,_0x5a8dd2){var _0x44810f={},_0x4ae02a={},_0x50d813={'count':0x0,'rows':[]};var _0x4333ca=_[_0x32a7('0x2d')](db[_0x32a7('0x2e')][_0x32a7('0x2f')],function(_0x1ddb6f){return{'name':_0x1ddb6f[_0x32a7('0x30')],'type':_0x1ddb6f[_0x32a7('0x31')]['key']};});_0x4ae02a[_0x32a7('0x32')]=_['map'](_0x4333ca,_0x32a7('0x2b'));_0x4ae02a['query']=_[_0x32a7('0x33')](_0x26b16c[_0x32a7('0x34')]);_0x4ae02a[_0x32a7('0x35')]=_[_0x32a7('0x36')](_0x4ae02a[_0x32a7('0x32')],_0x4ae02a[_0x32a7('0x34')]);_0x44810f[_0x32a7('0x37')]=_[_0x32a7('0x36')](_0x4ae02a[_0x32a7('0x32')],qs['fields'](_0x26b16c[_0x32a7('0x34')][_0x32a7('0x38')]));_0x44810f[_0x32a7('0x37')]=_0x44810f[_0x32a7('0x37')][_0x32a7('0x39')]?_0x44810f[_0x32a7('0x37')]:_0x4ae02a['model'];if(!_0x26b16c['query'][_0x32a7('0x3a')](_0x32a7('0x3b'))){_0x44810f[_0x32a7('0x1f')]=qs['limit'](_0x26b16c[_0x32a7('0x34')][_0x32a7('0x1f')]);_0x44810f[_0x32a7('0x1e')]=qs[_0x32a7('0x1e')](_0x26b16c[_0x32a7('0x34')][_0x32a7('0x1e')]);}_0x44810f[_0x32a7('0x3c')]=qs[_0x32a7('0x3d')](_0x26b16c['query'][_0x32a7('0x3d')]);_0x44810f[_0x32a7('0x3e')]=qs[_0x32a7('0x35')](_[_0x32a7('0x3f')](_0x26b16c[_0x32a7('0x34')],_0x4ae02a[_0x32a7('0x35')]),_0x4333ca);if(_0x26b16c[_0x32a7('0x34')][_0x32a7('0x40')]){_0x44810f[_0x32a7('0x3e')]=_[_0x32a7('0x41')](_0x44810f[_0x32a7('0x3e')],{'$or':_[_0x32a7('0x2d')](_0x4333ca,function(_0x21053d){if(_0x21053d['type']!==_0x32a7('0x42')){var _0x3ec5e9={};_0x3ec5e9[_0x21053d['name']]={'$like':'%'+_0x26b16c[_0x32a7('0x34')][_0x32a7('0x40')]+'%'};return _0x3ec5e9;}})});}_0x44810f=_[_0x32a7('0x41')]({},_0x44810f,_0x26b16c['options']);var _0xd9a958={'where':_0x44810f[_0x32a7('0x3e')]};return db['FreshsalesAccount']['count'](_0xd9a958)['then'](function(_0x51678e){_0x50d813[_0x32a7('0x20')]=_0x51678e;if(_0x26b16c[_0x32a7('0x34')][_0x32a7('0x43')]){_0x44810f[_0x32a7('0x44')]=[{'all':!![]}];}return db[_0x32a7('0x2e')][_0x32a7('0x45')](_0x44810f);})[_0x32a7('0x28')](function(_0x43c466){_0x50d813['rows']=_0x43c466;return _0x50d813;})[_0x32a7('0x28')](respondWithFilteredResult(_0x5a8dd2,_0x44810f))[_0x32a7('0x46')](handleError(_0x5a8dd2,null));};exports[_0x32a7('0x47')]=function(_0x661c9b,_0x5df50d){var _0x423bfb={'raw':![],'where':{'id':_0x661c9b[_0x32a7('0x48')]['id']}},_0x66eeab={};_0x66eeab[_0x32a7('0x32')]=_['keys'](db[_0x32a7('0x2e')]['rawAttributes']);_0x66eeab[_0x32a7('0x34')]=_[_0x32a7('0x33')](_0x661c9b[_0x32a7('0x34')]);_0x66eeab[_0x32a7('0x35')]=_[_0x32a7('0x36')](_0x66eeab['model'],_0x66eeab[_0x32a7('0x34')]);_0x423bfb[_0x32a7('0x37')]=_[_0x32a7('0x36')](_0x66eeab[_0x32a7('0x32')],qs[_0x32a7('0x38')](_0x661c9b[_0x32a7('0x34')][_0x32a7('0x38')]));_0x423bfb['attributes']=_0x423bfb[_0x32a7('0x37')]['length']?_0x423bfb[_0x32a7('0x37')]:_0x66eeab['model'];if(_0x661c9b[_0x32a7('0x34')][_0x32a7('0x43')]){_0x423bfb[_0x32a7('0x44')]=[{'all':!![]}];}_0x423bfb=_[_0x32a7('0x41')]({},_0x423bfb,_0x661c9b['options']);return db[_0x32a7('0x2e')][_0x32a7('0x49')](_0x423bfb)[_0x32a7('0x28')](handleEntityNotFound(_0x5df50d,null))[_0x32a7('0x28')](respondWithResult(_0x5df50d,null))[_0x32a7('0x46')](handleError(_0x5df50d,null));};exports[_0x32a7('0x4a')]=function(_0x42b24d,_0x1a54ab){return db['FreshsalesAccount'][_0x32a7('0x4a')](_0x42b24d['body'],{})['then'](respondWithResult(_0x1a54ab,0xc9))[_0x32a7('0x46')](handleError(_0x1a54ab,null));};exports[_0x32a7('0x27')]=function(_0x20b545,_0xa97b){if(_0x20b545[_0x32a7('0x4b')]['id']){delete _0x20b545[_0x32a7('0x4b')]['id'];}return db[_0x32a7('0x2e')][_0x32a7('0x49')]({'where':{'id':_0x20b545[_0x32a7('0x48')]['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0xa97b,null))['then'](saveUpdates(_0x20b545['body'],null))['then'](respondWithResult(_0xa97b,null))[_0x32a7('0x46')](handleError(_0xa97b,null));};exports[_0x32a7('0x4c')]=function(_0x22ebfb,_0xad8fea){return db[_0x32a7('0x2e')][_0x32a7('0x49')]({'where':{'id':_0x22ebfb['params']['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0xad8fea,null))[_0x32a7('0x28')](removeEntity(_0xad8fea,null))['catch'](handleError(_0xad8fea,null));};exports[_0x32a7('0x4d')]=function(_0x3dfd65,_0x3ec362,_0x4202b1){var _0x5f2ee1={};var _0x1fd0ad={};var _0x3e3c20;var _0x18a2d7;return db[_0x32a7('0x2e')][_0x32a7('0x4e')]({'where':{'id':_0x3dfd65[_0x32a7('0x48')]['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0x3ec362,null))['then'](function(_0x30ef09){if(_0x30ef09){_0x3e3c20=_0x30ef09;_0x1fd0ad[_0x32a7('0x32')]=_[_0x32a7('0x33')](db[_0x32a7('0x4f')]['rawAttributes']);_0x1fd0ad[_0x32a7('0x34')]=_[_0x32a7('0x33')](_0x3dfd65[_0x32a7('0x34')]);_0x1fd0ad[_0x32a7('0x35')]=_[_0x32a7('0x36')](_0x1fd0ad[_0x32a7('0x32')],_0x1fd0ad[_0x32a7('0x34')]);_0x5f2ee1[_0x32a7('0x37')]=_[_0x32a7('0x36')](_0x1fd0ad[_0x32a7('0x32')],qs[_0x32a7('0x38')](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x38')]));_0x5f2ee1[_0x32a7('0x37')]=_0x5f2ee1['attributes'][_0x32a7('0x39')]?_0x5f2ee1[_0x32a7('0x37')]:_0x1fd0ad['model'];_0x5f2ee1['order']=qs[_0x32a7('0x3d')](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x3d')]);_0x5f2ee1[_0x32a7('0x3e')]=qs[_0x32a7('0x35')](_[_0x32a7('0x3f')](_0x3dfd65[_0x32a7('0x34')],_0x1fd0ad['filters']));if(_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x40')]){_0x5f2ee1[_0x32a7('0x3e')]=_[_0x32a7('0x41')](_0x5f2ee1[_0x32a7('0x3e')],{'$or':_[_0x32a7('0x2d')](_0x5f2ee1[_0x32a7('0x37')],function(_0x359511){var _0x120406={};_0x120406[_0x359511]={'$like':'%'+_0x3dfd65['query'][_0x32a7('0x40')]+'%'};return _0x120406;})});}_0x5f2ee1=_[_0x32a7('0x41')]({},_0x5f2ee1,_0x3dfd65[_0x32a7('0x50')]);return _0x3e3c20[_0x32a7('0x4d')](_0x5f2ee1);}})[_0x32a7('0x28')](function(_0x8975f4){if(_0x8975f4){_0x18a2d7=_0x8975f4[_0x32a7('0x39')];if(!_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x3a')](_0x32a7('0x3b'))){_0x5f2ee1[_0x32a7('0x1f')]=qs[_0x32a7('0x1f')](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x1f')]);_0x5f2ee1[_0x32a7('0x1e')]=qs['offset'](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x1e')]);}return _0x3e3c20['getConfigurations'](_0x5f2ee1);}})[_0x32a7('0x28')](function(_0x2ea5b6){if(_0x2ea5b6){return _0x2ea5b6?{'count':_0x18a2d7,'rows':_0x2ea5b6}:null;}})[_0x32a7('0x28')](respondWithResult(_0x3ec362,null))['catch'](handleError(_0x3ec362,null));};exports[_0x32a7('0x51')]=function(_0x29457e,_0x404016,_0x16d290){if(_0x29457e['body']['id']){delete _0x29457e[_0x32a7('0x4b')]['id'];}return db['FreshsalesAccount'][_0x32a7('0x4e')]({'where':{'id':_0x29457e[_0x32a7('0x48')]['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0x404016,null))[_0x32a7('0x28')](function(_0x43b6d5){if(_0x43b6d5){_0x29457e[_0x32a7('0x4b')][_0x32a7('0x52')]=_0x43b6d5['id'];_0x29457e[_0x32a7('0x4b')]['Subjects']=integrations[_0x32a7('0x53')](_0x29457e[_0x32a7('0x4b')]['channel'],_0x29457e[_0x32a7('0x4b')][_0x32a7('0x31')]);_0x29457e[_0x32a7('0x4b')]['Descriptions']=integrations[_0x32a7('0x54')](_0x29457e[_0x32a7('0x4b')]['channel'],_0x29457e['body']['type']);return db[_0x32a7('0x4f')][_0x32a7('0x4a')](_0x29457e[_0x32a7('0x4b')],{'include':[{'model':db[_0x32a7('0x55')],'as':_0x32a7('0x56')},{'model':db[_0x32a7('0x55')],'as':_0x32a7('0x57')}]});}return null;})[_0x32a7('0x28')](respondWithResult(_0x404016,null))[_0x32a7('0x46')](handleError(_0x404016,null));};exports[_0x32a7('0x58')]=function(_0x596c96,_0xe20a0b,_0x43b6f0){var _0x37bc1a='';var _0x310103='';return db[_0x32a7('0x2e')][_0x32a7('0x4e')]({'where':{'id':_0x596c96[_0x32a7('0x48')]['id']},'attributes':['id',_0x32a7('0x59'),_0x32a7('0x5a'),_0x32a7('0x5b')]})[_0x32a7('0x28')](handleEntityNotFound(_0xe20a0b,null))['then'](function(_0x576c19){if(_0x576c19){_0x310103=_0x576c19[_0x32a7('0x59')];_0x37bc1a=_0x576c19[_0x32a7('0x5a')];var _0x199936=_0x576c19[_0x32a7('0x5a')][_0x32a7('0x5c')](-0x1);if(_0x199936==='/'){_0x37bc1a=_0x37bc1a['substring'](0x0,_0x37bc1a[_0x32a7('0x5d')](_0x199936));}return rp({'method':'GET','uri':util[_0x32a7('0x5e')](_0x32a7('0x5f'),_0x37bc1a,_0x32a7('0x60')),'headers':{'Authorization':_0x32a7('0x61')+_0x576c19[_0x32a7('0x5b')]},'json':!![]});}})[_0x32a7('0x28')](function(_0x45cf12){if(_0x45cf12){var _0x154e8e=_0x45cf12[_0x32a7('0x62')];var _0x30b00d=![];var _0x234d92=null;for(_0x234d92=0x0;_0x234d92<_0x154e8e[_0x32a7('0x39')];_0x234d92++){if(_0x154e8e[_0x234d92]['email']===_0x310103){_0x30b00d=!![];}}if(_0x30b00d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x32a7('0x63')});}}})['then'](respondWithResult(_0xe20a0b,null))[_0x32a7('0x46')](function(_0x411685){var _0x3f2dd9=_0x596c96[_0x32a7('0x34')][_0x32a7('0x64')]?0x1f4:_0x411685[_0x32a7('0x65')]||0x1f4;logger[_0x32a7('0x29')](_0x32a7('0x66'),_0x32a7('0x58'),_0x3f2dd9,JSON[_0x32a7('0x67')](_0x411685));delete _0x411685[_0x32a7('0x2b')];if(_0x3f2dd9===0x191){_0x3f2dd9=0x190;}_0xe20a0b[_0x32a7('0x1c')](_0x3f2dd9)[_0x32a7('0x68')](_0x596c96[_0x32a7('0x34')][_0x32a7('0x64')]?{'message':_0x32a7('0x69'),'statusCode':_0x411685['statusCode']}:_0x411685);});}; \ No newline at end of file +var _0x4088=['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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','update','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','GET','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x27fb69,_0x4e8054){var _0x3b0f8a=function(_0x4ad4b8){while(--_0x4ad4b8){_0x27fb69['push'](_0x27fb69['shift']());}};_0x3b0f8a(++_0x4e8054);}(_0x4088,0x1b0));var _0x8408=function(_0x5e9c0f,_0x5b5a67){_0x5e9c0f=_0x5e9c0f-0x0;var _0x5aaf16=_0x4088[_0x5e9c0f];return _0x5aaf16;};'use strict';var emlformat=require(_0x8408('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8408('0x1'));var jsonpatch=require(_0x8408('0x2'));var rp=require(_0x8408('0x3'));var moment=require(_0x8408('0x4'));var BPromise=require(_0x8408('0x5'));var Mustache=require(_0x8408('0x6'));var util=require(_0x8408('0x7'));var path=require(_0x8408('0x8'));var sox=require(_0x8408('0x9'));var csv=require(_0x8408('0xa'));var ejs=require(_0x8408('0xb'));var fs=require('fs');var fs_extra=require(_0x8408('0xc'));var _=require(_0x8408('0xd'));var squel=require(_0x8408('0xe'));var crypto=require(_0x8408('0xf'));var jsforce=require(_0x8408('0x10'));var deskjs=require(_0x8408('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8408('0x12'));var Papa=require(_0x8408('0x13'));var Redis=require(_0x8408('0x14'));var authService=require(_0x8408('0x15'));var qs=require(_0x8408('0x16'));var as=require(_0x8408('0x17'));var hardwareService=require(_0x8408('0x18'));var logger=require('../../config/logger')(_0x8408('0x19'));var utils=require(_0x8408('0x1a'));var config=require(_0x8408('0x1b'));var licenseUtil=require(_0x8408('0x1c'));var db=require(_0x8408('0x1d'))['db'];var integrations=require(_0x8408('0x1e'));function respondWithStatusCode(_0x13ee68,_0x5650a9){_0x5650a9=_0x5650a9||0xcc;return function(_0x4dfcc9){if(_0x4dfcc9){return _0x13ee68[_0x8408('0x1f')](_0x5650a9);}return _0x13ee68[_0x8408('0x20')](_0x5650a9)[_0x8408('0x21')]();};}function respondWithResult(_0x2f5b08,_0x398d8c){_0x398d8c=_0x398d8c||0xc8;return function(_0x26f8a1){if(_0x26f8a1){return _0x2f5b08['status'](_0x398d8c)[_0x8408('0x22')](_0x26f8a1);}};}function respondWithFilteredResult(_0x3ff1b6,_0x518edf){return function(_0x523a6a){if(_0x523a6a){var _0x55ee06=typeof _0x518edf[_0x8408('0x23')]===_0x8408('0x24')&&typeof _0x518edf[_0x8408('0x25')]==='undefined';var _0x246cd1=_0x523a6a[_0x8408('0x26')];var _0x2549c9=_0x55ee06?0x0:_0x518edf['offset'];var _0x8162f9=_0x55ee06?_0x523a6a[_0x8408('0x26')]:_0x518edf[_0x8408('0x23')]+_0x518edf[_0x8408('0x25')];var _0x59530c;if(_0x8162f9>=_0x246cd1){_0x8162f9=_0x246cd1;_0x59530c=0xc8;}else{_0x59530c=0xce;}_0x3ff1b6['status'](_0x59530c);return _0x3ff1b6[_0x8408('0x27')](_0x8408('0x28'),_0x2549c9+'-'+_0x8162f9+'/'+_0x246cd1)[_0x8408('0x22')](_0x523a6a);}return null;};}function patchUpdates(_0x410352){return function(_0x516e59){try{jsonpatch['apply'](_0x516e59,_0x410352,!![]);}catch(_0x23ba73){return BPromise[_0x8408('0x29')](_0x23ba73);}return _0x516e59['save']();};}function saveUpdates(_0x840d74,_0x428d88){return function(_0xffffcc){if(_0xffffcc){return _0xffffcc['update'](_0x840d74)[_0x8408('0x2a')](function(_0x5e320b){return _0x5e320b;});}return null;};}function removeEntity(_0x54a5ef,_0xe69b46){return function(_0x3d9fbb){if(_0x3d9fbb){return _0x3d9fbb[_0x8408('0x2b')]()[_0x8408('0x2a')](function(){_0x54a5ef[_0x8408('0x20')](0xcc)[_0x8408('0x21')]();});}};}function handleEntityNotFound(_0x7f314c,_0x2ea86d){return function(_0x3c9453){if(!_0x3c9453){_0x7f314c['sendStatus'](0x194);}return _0x3c9453;};}function handleError(_0x26361f,_0x6d8f42){_0x6d8f42=_0x6d8f42||0x1f4;return function(_0x2cea26){logger[_0x8408('0x2c')](_0x2cea26[_0x8408('0x2d')]);if(_0x2cea26['name']){delete _0x2cea26[_0x8408('0x2e')];}_0x26361f['status'](_0x6d8f42)[_0x8408('0x2f')](_0x2cea26);};}exports[_0x8408('0x30')]=function(_0x1316b1,_0xc51d95){var _0x12a582={},_0x1f20f3={},_0x4e847a={'count':0x0,'rows':[]};var _0x19f2ed=_['map'](db[_0x8408('0x31')][_0x8408('0x32')],function(_0x5de587){return{'name':_0x5de587[_0x8408('0x33')],'type':_0x5de587[_0x8408('0x34')][_0x8408('0x35')]};});_0x1f20f3[_0x8408('0x36')]=_[_0x8408('0x37')](_0x19f2ed,_0x8408('0x2e'));_0x1f20f3[_0x8408('0x38')]=_[_0x8408('0x39')](_0x1316b1[_0x8408('0x38')]);_0x1f20f3['filters']=_[_0x8408('0x3a')](_0x1f20f3[_0x8408('0x36')],_0x1f20f3[_0x8408('0x38')]);_0x12a582[_0x8408('0x3b')]=_['intersection'](_0x1f20f3[_0x8408('0x36')],qs[_0x8408('0x3c')](_0x1316b1['query'][_0x8408('0x3c')]));_0x12a582[_0x8408('0x3b')]=_0x12a582[_0x8408('0x3b')][_0x8408('0x3d')]?_0x12a582[_0x8408('0x3b')]:_0x1f20f3[_0x8408('0x36')];if(!_0x1316b1[_0x8408('0x38')]['hasOwnProperty'](_0x8408('0x3e'))){_0x12a582[_0x8408('0x25')]=qs[_0x8408('0x25')](_0x1316b1[_0x8408('0x38')][_0x8408('0x25')]);_0x12a582[_0x8408('0x23')]=qs[_0x8408('0x23')](_0x1316b1['query'][_0x8408('0x23')]);}_0x12a582[_0x8408('0x3f')]=qs[_0x8408('0x40')](_0x1316b1[_0x8408('0x38')]['sort']);_0x12a582['where']=qs[_0x8408('0x41')](_[_0x8408('0x42')](_0x1316b1[_0x8408('0x38')],_0x1f20f3[_0x8408('0x41')]),_0x19f2ed);if(_0x1316b1[_0x8408('0x38')]['filter']){_0x12a582[_0x8408('0x43')]=_['merge'](_0x12a582['where'],{'$or':_[_0x8408('0x37')](_0x19f2ed,function(_0x39b349){if(_0x39b349['type']!==_0x8408('0x44')){var _0x4fb061={};_0x4fb061[_0x39b349['name']]={'$like':'%'+_0x1316b1[_0x8408('0x38')][_0x8408('0x45')]+'%'};return _0x4fb061;}})});}_0x12a582=_[_0x8408('0x46')]({},_0x12a582,_0x1316b1[_0x8408('0x47')]);var _0x3fed06={'where':_0x12a582[_0x8408('0x43')]};return db[_0x8408('0x31')][_0x8408('0x26')](_0x3fed06)['then'](function(_0x35e19a){_0x4e847a['count']=_0x35e19a;if(_0x1316b1[_0x8408('0x38')][_0x8408('0x48')]){_0x12a582[_0x8408('0x49')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x8408('0x4a')](_0x12a582);})[_0x8408('0x2a')](function(_0x387562){_0x4e847a['rows']=_0x387562;return _0x4e847a;})['then'](respondWithFilteredResult(_0xc51d95,_0x12a582))[_0x8408('0x4b')](handleError(_0xc51d95,null));};exports[_0x8408('0x4c')]=function(_0x5e140b,_0x3f277e){var _0x4dd736={'raw':![],'where':{'id':_0x5e140b[_0x8408('0x4d')]['id']}},_0x21b83d={};_0x21b83d[_0x8408('0x36')]=_[_0x8408('0x39')](db[_0x8408('0x31')]['rawAttributes']);_0x21b83d[_0x8408('0x38')]=_[_0x8408('0x39')](_0x5e140b[_0x8408('0x38')]);_0x21b83d[_0x8408('0x41')]=_[_0x8408('0x3a')](_0x21b83d['model'],_0x21b83d[_0x8408('0x38')]);_0x4dd736[_0x8408('0x3b')]=_[_0x8408('0x3a')](_0x21b83d[_0x8408('0x36')],qs[_0x8408('0x3c')](_0x5e140b[_0x8408('0x38')][_0x8408('0x3c')]));_0x4dd736[_0x8408('0x3b')]=_0x4dd736[_0x8408('0x3b')][_0x8408('0x3d')]?_0x4dd736[_0x8408('0x3b')]:_0x21b83d[_0x8408('0x36')];if(_0x5e140b[_0x8408('0x38')][_0x8408('0x48')]){_0x4dd736[_0x8408('0x49')]=[{'all':!![]}];}_0x4dd736=_[_0x8408('0x46')]({},_0x4dd736,_0x5e140b[_0x8408('0x47')]);return db[_0x8408('0x31')][_0x8408('0x4e')](_0x4dd736)[_0x8408('0x2a')](handleEntityNotFound(_0x3f277e,null))[_0x8408('0x2a')](respondWithResult(_0x3f277e,null))[_0x8408('0x4b')](handleError(_0x3f277e,null));};exports[_0x8408('0x4f')]=function(_0x9f84e0,_0x4a7893){return db[_0x8408('0x31')][_0x8408('0x4f')](_0x9f84e0[_0x8408('0x50')],{})[_0x8408('0x2a')](respondWithResult(_0x4a7893,0xc9))[_0x8408('0x4b')](handleError(_0x4a7893,null));};exports[_0x8408('0x51')]=function(_0x2bdcf7,_0x5edb6e){if(_0x2bdcf7['body']['id']){delete _0x2bdcf7[_0x8408('0x50')]['id'];}return db[_0x8408('0x31')][_0x8408('0x4e')]({'where':{'id':_0x2bdcf7[_0x8408('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5edb6e,null))[_0x8408('0x2a')](saveUpdates(_0x2bdcf7[_0x8408('0x50')],null))[_0x8408('0x2a')](respondWithResult(_0x5edb6e,null))[_0x8408('0x4b')](handleError(_0x5edb6e,null));};exports[_0x8408('0x2b')]=function(_0x629251,_0x1e1172){return db[_0x8408('0x31')][_0x8408('0x4e')]({'where':{'id':_0x629251[_0x8408('0x4d')]['id']}})[_0x8408('0x2a')](handleEntityNotFound(_0x1e1172,null))[_0x8408('0x2a')](removeEntity(_0x1e1172,null))[_0x8408('0x4b')](handleError(_0x1e1172,null));};exports[_0x8408('0x52')]=function(_0x25d395,_0x4d87e2,_0x1f12b6){var _0x278889={};var _0x1fac77={};var _0x558aa5;var _0x296af5;return db[_0x8408('0x31')][_0x8408('0x53')]({'where':{'id':_0x25d395[_0x8408('0x4d')]['id']}})[_0x8408('0x2a')](handleEntityNotFound(_0x4d87e2,null))['then'](function(_0x855bad){if(_0x855bad){_0x558aa5=_0x855bad;_0x1fac77[_0x8408('0x36')]=_['keys'](db[_0x8408('0x54')][_0x8408('0x32')]);_0x1fac77[_0x8408('0x38')]=_['keys'](_0x25d395[_0x8408('0x38')]);_0x1fac77[_0x8408('0x41')]=_[_0x8408('0x3a')](_0x1fac77[_0x8408('0x36')],_0x1fac77[_0x8408('0x38')]);_0x278889[_0x8408('0x3b')]=_['intersection'](_0x1fac77[_0x8408('0x36')],qs[_0x8408('0x3c')](_0x25d395[_0x8408('0x38')]['fields']));_0x278889[_0x8408('0x3b')]=_0x278889[_0x8408('0x3b')][_0x8408('0x3d')]?_0x278889[_0x8408('0x3b')]:_0x1fac77[_0x8408('0x36')];_0x278889[_0x8408('0x3f')]=qs[_0x8408('0x40')](_0x25d395[_0x8408('0x38')][_0x8408('0x40')]);_0x278889[_0x8408('0x43')]=qs[_0x8408('0x41')](_['pick'](_0x25d395[_0x8408('0x38')],_0x1fac77[_0x8408('0x41')]));if(_0x25d395[_0x8408('0x38')][_0x8408('0x45')]){_0x278889['where']=_[_0x8408('0x46')](_0x278889[_0x8408('0x43')],{'$or':_[_0x8408('0x37')](_0x278889[_0x8408('0x3b')],function(_0x57d47e){var _0x3684f7={};_0x3684f7[_0x57d47e]={'$like':'%'+_0x25d395[_0x8408('0x38')][_0x8408('0x45')]+'%'};return _0x3684f7;})});}_0x278889=_[_0x8408('0x46')]({},_0x278889,_0x25d395[_0x8408('0x47')]);return _0x558aa5[_0x8408('0x52')](_0x278889);}})[_0x8408('0x2a')](function(_0x388560){if(_0x388560){_0x296af5=_0x388560[_0x8408('0x3d')];if(!_0x25d395['query'][_0x8408('0x55')](_0x8408('0x3e'))){_0x278889[_0x8408('0x25')]=qs[_0x8408('0x25')](_0x25d395[_0x8408('0x38')][_0x8408('0x25')]);_0x278889[_0x8408('0x23')]=qs[_0x8408('0x23')](_0x25d395[_0x8408('0x38')]['offset']);}return _0x558aa5[_0x8408('0x52')](_0x278889);}})[_0x8408('0x2a')](function(_0x2dd044){if(_0x2dd044){return _0x2dd044?{'count':_0x296af5,'rows':_0x2dd044}:null;}})[_0x8408('0x2a')](respondWithResult(_0x4d87e2,null))[_0x8408('0x4b')](handleError(_0x4d87e2,null));};exports[_0x8408('0x56')]=function(_0x4a90b2,_0x223e17,_0x57bfdc){if(_0x4a90b2[_0x8408('0x50')]['id']){delete _0x4a90b2[_0x8408('0x50')]['id'];}return db[_0x8408('0x31')][_0x8408('0x53')]({'where':{'id':_0x4a90b2[_0x8408('0x4d')]['id']}})[_0x8408('0x2a')](handleEntityNotFound(_0x223e17,null))['then'](function(_0x34a3da){if(_0x34a3da){_0x4a90b2[_0x8408('0x50')][_0x8408('0x57')]=_0x34a3da['id'];_0x4a90b2['body'][_0x8408('0x58')]=integrations[_0x8408('0x59')](_0x4a90b2[_0x8408('0x50')][_0x8408('0x5a')],_0x4a90b2[_0x8408('0x50')]['type']);_0x4a90b2[_0x8408('0x50')][_0x8408('0x5b')]=integrations[_0x8408('0x5c')](_0x4a90b2[_0x8408('0x50')][_0x8408('0x5a')],_0x4a90b2[_0x8408('0x50')][_0x8408('0x34')]);return db[_0x8408('0x54')][_0x8408('0x4f')](_0x4a90b2['body'],{'include':[{'model':db[_0x8408('0x5d')],'as':_0x8408('0x58')},{'model':db[_0x8408('0x5d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x223e17,null))[_0x8408('0x4b')](handleError(_0x223e17,null));};exports[_0x8408('0x5e')]=function(_0x29004f,_0x228af5,_0x32de9c){var _0x130202='';var _0x1ee08a='';return db[_0x8408('0x31')][_0x8408('0x53')]({'where':{'id':_0x29004f[_0x8408('0x4d')]['id']},'attributes':['id',_0x8408('0x5f'),_0x8408('0x60'),_0x8408('0x61')]})[_0x8408('0x2a')](handleEntityNotFound(_0x228af5,null))['then'](function(_0x38a4e7){if(_0x38a4e7){_0x1ee08a=_0x38a4e7['username'];_0x130202=_0x38a4e7[_0x8408('0x60')];var _0x5b6048=_0x38a4e7[_0x8408('0x60')][_0x8408('0x62')](-0x1);if(_0x5b6048==='/'){_0x130202=_0x130202[_0x8408('0x63')](0x0,_0x130202['lastIndexOf'](_0x5b6048));}return rp({'method':_0x8408('0x64'),'uri':util['format']('%s%s',_0x130202,_0x8408('0x65')),'headers':{'Authorization':_0x8408('0x66')+_0x38a4e7[_0x8408('0x61')]},'json':!![]});}})['then'](function(_0x24fff2){if(_0x24fff2){var _0x4c2fc3=_0x24fff2[_0x8408('0x67')];var _0x1982c0=![];var _0x439367=null;for(_0x439367=0x0;_0x439367<_0x4c2fc3['length'];_0x439367++){if(_0x4c2fc3[_0x439367][_0x8408('0x68')]===_0x1ee08a){_0x1982c0=!![];}}if(_0x1982c0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8408('0x69')});}}})[_0x8408('0x2a')](respondWithResult(_0x228af5,null))[_0x8408('0x4b')](function(_0x458a8f){var _0x438c87=_0x29004f[_0x8408('0x38')][_0x8408('0x6a')]?0x1f4:_0x458a8f[_0x8408('0x6b')]||0x1f4;logger[_0x8408('0x2c')](_0x8408('0x6c'),_0x8408('0x5e'),_0x438c87,JSON[_0x8408('0x6d')](_0x458a8f));delete _0x458a8f[_0x8408('0x2e')];if(_0x438c87===0x191){_0x438c87=0x190;}_0x228af5['status'](_0x438c87)[_0x8408('0x2f')](_0x29004f['query'][_0x8408('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x458a8f['statusCode']}:_0x458a8f);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 482f400..00bfbc4 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 _0x71ab=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','bluebird','request-promise'];(function(_0x32d47a,_0x4ddf9f){var _0x47a09d=function(_0x5e4e4b){while(--_0x5e4e4b){_0x32d47a['push'](_0x32d47a['shift']());}};_0x47a09d(++_0x4ddf9f);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'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'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b0=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5e611e,_0x3a7f67){var _0x2fcb9e=function(_0x55a56b){while(--_0x55a56b){_0x5e611e['push'](_0x5e611e['shift']());}};_0x2fcb9e(++_0x3a7f67);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x9693b7,_0x495ae3){_0x9693b7=_0x9693b7-0x0;var _0x46b292=_0xa6b0[_0x9693b7];return _0x46b292;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));var integrations=require(_0x0a6b('0x8'));module[_0x0a6b('0x9')]=function(_0x3b6967,_0x1b5fb5){return _0x3b6967[_0x0a6b('0xa')](_0x0a6b('0xb'),attributes,{'tableName':_0x0a6b('0xc'),'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 46e187a..cbc98d8 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 _0x4bd3=['where','attributes','limit','include','model','map','stringify','find','ShowFreshsalesAccount','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x4bd3,0x174));var _0x34bd=function(_0x142e33,_0x377cf9){_0x142e33=_0x142e33-0x0;var _0x29b9b3=_0x4bd3[_0x142e33];return _0x29b9b3;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});}exports[_0x34bd('0x13')]=function(_0x3b4bf8){var _0x72b197=this;return new Promise(function(_0x4b5ebb,_0x48d2ba){return db[_0x34bd('0x14')][_0x34bd('0x15')]({'raw':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options'][_0x34bd('0x19')]||null:null,'limit':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x1a')]||null:null,'include':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options']['include']?_['map'](_0x3b4bf8['options'][_0x34bd('0x1b')],function(_0x503a60){return{'model':db[_0x503a60[_0x34bd('0x1c')]],'as':_0x503a60['as'],'attributes':_0x503a60[_0x34bd('0x19')],'include':_0x503a60[_0x34bd('0x1b')]?_['map'](_0x503a60[_0x34bd('0x1b')],function(_0x14479a){return{'model':db[_0x14479a[_0x34bd('0x1c')]],'as':_0x14479a['as'],'attributes':_0x14479a[_0x34bd('0x19')],'include':_0x14479a['include']?_[_0x34bd('0x1d')](_0x14479a[_0x34bd('0x1b')],function(_0x264c94){return{'model':db[_0x264c94[_0x34bd('0x1c')]],'as':_0x264c94['as'],'attributes':_0x264c94['attributes']};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x3fe8b0){logger['info'](_0x34bd('0x13'),_0x3b4bf8);logger[_0x34bd('0xc')](_0x34bd('0x13'),_0x3b4bf8,JSON[_0x34bd('0x1e')](_0x3fe8b0));_0x4b5ebb(_0x3fe8b0);})[_0x34bd('0x12')](function(_0x4500c8){logger[_0x34bd('0xe')]('GetFreshsalesAccount',_0x4500c8[_0x34bd('0x10')],_0x3b4bf8);_0x48d2ba(_0x72b197[_0x34bd('0xe')](0x1f4,_0x4500c8['message']));});});};exports['ShowFreshsalesAccount']=function(_0x38bdba){var _0xca9897=this;return new Promise(function(_0xd176f7,_0x536b2c){return db['FreshsalesAccount'][_0x34bd('0x1f')]({'raw':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x38bdba['options']?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x19')]||null:null,'include':_0x38bdba[_0x34bd('0x16')]?_0x38bdba['options'][_0x34bd('0x1b')]?_['map'](_0x38bdba[_0x34bd('0x16')][_0x34bd('0x1b')],function(_0xf12ee6){return{'model':db[_0xf12ee6['model']],'as':_0xf12ee6['as'],'attributes':_0xf12ee6[_0x34bd('0x19')],'include':_0xf12ee6[_0x34bd('0x1b')]?_['map'](_0xf12ee6[_0x34bd('0x1b')],function(_0x21c7d6){return{'model':db[_0x21c7d6[_0x34bd('0x1c')]],'as':_0x21c7d6['as'],'attributes':_0x21c7d6['attributes'],'include':_0x21c7d6[_0x34bd('0x1b')]?_[_0x34bd('0x1d')](_0x21c7d6['include'],function(_0x117188){return{'model':db[_0x117188[_0x34bd('0x1c')]],'as':_0x117188['as'],'attributes':_0x117188[_0x34bd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x320643){logger[_0x34bd('0xa')]('ShowFreshsalesAccount',_0x38bdba);logger['debug']('ShowFreshsalesAccount',_0x38bdba,JSON[_0x34bd('0x1e')](_0x320643));_0xd176f7(_0x320643);})[_0x34bd('0x12')](function(_0x5e30c5){logger['error'](_0x34bd('0x20'),_0x5e30c5['message'],_0x38bdba);_0x536b2c(_0xca9897['error'](0x1f4,_0x5e30c5[_0x34bd('0x10')]));});});}; \ No newline at end of file +var _0x8e3f=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','include','model','attributes','map','stringify','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x23b57c,_0xdc7f98){var _0x4c3b1d=function(_0x283147){while(--_0x283147){_0x23b57c['push'](_0x23b57c['shift']());}};_0x4c3b1d(++_0xdc7f98);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['findAll']({'raw':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1a')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')]['attributes']||null:null,'limit':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1b')]||null:null,'include':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc['options'][_0xf8e3('0x1c')]?_['map'](_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1c')],function(_0x33d526){return{'model':db[_0x33d526[_0xf8e3('0x1d')]],'as':_0x33d526['as'],'attributes':_0x33d526[_0xf8e3('0x1e')],'include':_0x33d526[_0xf8e3('0x1c')]?_['map'](_0x33d526[_0xf8e3('0x1c')],function(_0x2fc674){return{'model':db[_0x2fc674[_0xf8e3('0x1d')]],'as':_0x2fc674['as'],'attributes':_0x2fc674[_0xf8e3('0x1e')],'include':_0x2fc674[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2fc674[_0xf8e3('0x1c')],function(_0x157a2d){return{'model':db[_0x157a2d['model']],'as':_0x157a2d['as'],'attributes':_0x157a2d[_0xf8e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x12ebd2){logger[_0xf8e3('0xd')](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x20')](_0x12ebd2));_0x2e27e3(_0x12ebd2);})['catch'](function(_0x21e1c0){logger[_0xf8e3('0x12')](_0xf8e3('0x16'),_0x21e1c0[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3['error'](0x1f4,_0x21e1c0[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x21')]=function(_0x40f64d){var _0x45df49=this;return new Promise(function(_0x33f208,_0x46c85d){return db[_0xf8e3('0x17')][_0xf8e3('0x22')]({'raw':_0x40f64d['options']?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x40f64d['options']?_0x40f64d['options']['where']||null:null,'attributes':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d['options'][_0xf8e3('0x1e')]||null:null,'include':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x1c')]?_['map'](_0x40f64d['options'][_0xf8e3('0x1c')],function(_0x2f87d8){return{'model':db[_0x2f87d8[_0xf8e3('0x1d')]],'as':_0x2f87d8['as'],'attributes':_0x2f87d8[_0xf8e3('0x1e')],'include':_0x2f87d8[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2f87d8['include'],function(_0x1afead){return{'model':db[_0x1afead['model']],'as':_0x1afead['as'],'attributes':_0x1afead['attributes'],'include':_0x1afead[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x1afead[_0xf8e3('0x1c')],function(_0x1b7af2){return{'model':db[_0x1b7af2['model']],'as':_0x1b7af2['as'],'attributes':_0x1b7af2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x215183){logger['info'](_0xf8e3('0x21'),_0x40f64d);logger[_0xf8e3('0x10')](_0xf8e3('0x21'),_0x40f64d,JSON[_0xf8e3('0x20')](_0x215183));_0x33f208(_0x215183);})['catch'](function(_0x53cfea){logger['error'](_0xf8e3('0x21'),_0x53cfea[_0xf8e3('0x14')],_0x40f64d);_0x46c85d(_0x45df49[_0xf8e3('0x12')](0x1f4,_0x53cfea[_0xf8e3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 72ea191..4612dcd 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 _0x84ee=['../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x525513,_0x44220c){var _0x17f77f=function(_0x28473e){while(--_0x28473e){_0x525513['push'](_0x525513['shift']());}};_0x17f77f(++_0x44220c);}(_0x84ee,0xf2));var _0xe84e=function(_0x1bc635,_0x4a1b08){_0x1bc635=_0x1bc635-0x0;var _0x1179e0=_0x84ee[_0x1bc635];return _0x1179e0;};'use strict';var multer=require(_0xe84e('0x0'));var util=require(_0xe84e('0x1'));var path=require(_0xe84e('0x2'));var timeout=require(_0xe84e('0x3'));var express=require(_0xe84e('0x4'));var router=express[_0xe84e('0x5')]();var fs_extra=require(_0xe84e('0x6'));var auth=require(_0xe84e('0x7'));var interaction=require(_0xe84e('0x8'));var config=require('../../config/environment');var controller=require(_0xe84e('0x9'));router[_0xe84e('0xa')]('/',auth[_0xe84e('0xb')](),controller[_0xe84e('0xc')]);router[_0xe84e('0xa')](_0xe84e('0xd'),auth[_0xe84e('0xb')](),controller['show']);router[_0xe84e('0xa')]('/:id/subjects',auth[_0xe84e('0xb')](),controller[_0xe84e('0xe')]);router['get'](_0xe84e('0xf'),auth[_0xe84e('0xb')](),controller[_0xe84e('0x10')]);router[_0xe84e('0xa')](_0xe84e('0x11'),auth[_0xe84e('0xb')](),controller[_0xe84e('0x12')]);router[_0xe84e('0x13')]('/',auth[_0xe84e('0xb')](),controller[_0xe84e('0x14')]);router[_0xe84e('0x15')](_0xe84e('0xd'),auth[_0xe84e('0xb')](),controller[_0xe84e('0x16')]);router[_0xe84e('0x17')]('/:id',auth[_0xe84e('0xb')](),controller[_0xe84e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x26d5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','put','/:id','update','destroy','exports','util'];(function(_0x184486,_0x36669d){var _0x55c949=function(_0x99217a){while(--_0x99217a){_0x184486['push'](_0x184486['shift']());}};_0x55c949(++_0x36669d);}(_0x26d5,0xc7));var _0x526d=function(_0x51de35,_0x4cb978){_0x51de35=_0x51de35-0x0;var _0x25497e=_0x26d5[_0x51de35];return _0x25497e;};'use strict';var multer=require('multer');var util=require(_0x526d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x526d('0x1')]();var fs_extra=require(_0x526d('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x526d('0x3'));var config=require(_0x526d('0x4'));var controller=require(_0x526d('0x5'));router[_0x526d('0x6')]('/',auth[_0x526d('0x7')](),controller['index']);router[_0x526d('0x6')]('/:id',auth[_0x526d('0x7')](),controller[_0x526d('0x8')]);router['get'](_0x526d('0x9'),auth[_0x526d('0x7')](),controller[_0x526d('0xa')]);router['get'](_0x526d('0xb'),auth['isAuthenticated'](),controller[_0x526d('0xc')]);router['get'](_0x526d('0xd'),auth[_0x526d('0x7')](),controller[_0x526d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x526d('0xf')](_0x526d('0x10'),auth[_0x526d('0x7')](),controller[_0x526d('0x11')]);router['delete'](_0x526d('0x10'),auth[_0x526d('0x7')](),controller[_0x526d('0x12')]);module[_0x526d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index f5bfb9e..d938f67 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 _0x3bde=['sequelize','exports','STRING'];(function(_0x14b996,_0x21f888){var _0x4258e9=function(_0x48780b){while(--_0x48780b){_0x14b996['push'](_0x14b996['shift']());}};_0x4258e9(++_0x21f888);}(_0x3bde,0x14a));var _0xe3bd=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x3bde[_0x119d5a];return _0x15bff4;};'use strict';var Sequelize=require(_0xe3bd('0x0'));module[_0xe3bd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe3bd('0x2')]}}; \ No newline at end of file +var _0x1613=['STRING','sequelize','exports'];(function(_0xd34f66,_0x2b2953){var _0x474911=function(_0x1f8ebf){while(--_0x1f8ebf){_0xd34f66['push'](_0xd34f66['shift']());}};_0x474911(++_0x2b2953);}(_0x1613,0x1a8));var _0x3161=function(_0x30376a,_0x24727f){_0x30376a=_0x30376a-0x0;var _0x35634b=_0x1613[_0x30376a];return _0x35634b;};'use strict';var Sequelize=require(_0x3161('0x0'));module[_0x3161('0x1')]={'name':{'type':Sequelize[_0x3161('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 3f625b3..05ffcb9 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 _0x95a8=['params','includeAll','include','find','create','body','catch','getSubjects','findOne','rawAttributes','hasOwnProperty','getDescriptions','pick','getFields','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','map','FreshsalesConfiguration','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','show'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x95a8,0x1dc));var _0x895a=function(_0x50748b,_0x599d6d){_0x50748b=_0x50748b-0x0;var _0x5688d7=_0x95a8[_0x50748b];return _0x5688d7;};'use strict';var emlformat=require(_0x895a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x895a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x895a('0x2'));var moment=require('moment');var BPromise=require(_0x895a('0x3'));var Mustache=require(_0x895a('0x4'));var util=require(_0x895a('0x5'));var path=require(_0x895a('0x6'));var sox=require(_0x895a('0x7'));var csv=require(_0x895a('0x8'));var ejs=require(_0x895a('0x9'));var fs=require('fs');var fs_extra=require(_0x895a('0xa'));var _=require('lodash');var squel=require(_0x895a('0xb'));var crypto=require(_0x895a('0xc'));var jsforce=require(_0x895a('0xd'));var deskjs=require(_0x895a('0xe'));var toCsv=require(_0x895a('0x8'));var querystring=require(_0x895a('0xf'));var Papa=require(_0x895a('0x10'));var Redis=require(_0x895a('0x11'));var authService=require(_0x895a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x895a('0x13'));var logger=require(_0x895a('0x14'))('api');var utils=require(_0x895a('0x15'));var config=require(_0x895a('0x16'));var licenseUtil=require(_0x895a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4612c9,_0x4d1d28){_0x4d1d28=_0x4d1d28||0xcc;return function(_0x5b6cd2){if(_0x5b6cd2){return _0x4612c9[_0x895a('0x18')](_0x4d1d28);}return _0x4612c9['status'](_0x4d1d28)['end']();};}function respondWithResult(_0x4d7251,_0x1d8ab5){_0x1d8ab5=_0x1d8ab5||0xc8;return function(_0x53dab3){if(_0x53dab3){return _0x4d7251[_0x895a('0x19')](_0x1d8ab5)[_0x895a('0x1a')](_0x53dab3);}};}function respondWithFilteredResult(_0x57b8f4,_0x3d0cfc){return function(_0x55d43e){if(_0x55d43e){var _0x3bfc71=typeof _0x3d0cfc[_0x895a('0x1b')]===_0x895a('0x1c')&&typeof _0x3d0cfc[_0x895a('0x1d')]==='undefined';var _0x2161d8=_0x55d43e['count'];var _0x455108=_0x3bfc71?0x0:_0x3d0cfc[_0x895a('0x1b')];var _0x111755=_0x3bfc71?_0x55d43e[_0x895a('0x1e')]:_0x3d0cfc[_0x895a('0x1b')]+_0x3d0cfc[_0x895a('0x1d')];var _0x4df3b4;if(_0x111755>=_0x2161d8){_0x111755=_0x2161d8;_0x4df3b4=0xc8;}else{_0x4df3b4=0xce;}_0x57b8f4['status'](_0x4df3b4);return _0x57b8f4[_0x895a('0x1f')](_0x895a('0x20'),_0x455108+'-'+_0x111755+'/'+_0x2161d8)[_0x895a('0x1a')](_0x55d43e);}return null;};}function patchUpdates(_0x13ce10){return function(_0xcee282){try{jsonpatch[_0x895a('0x21')](_0xcee282,_0x13ce10,!![]);}catch(_0x2f62c5){return BPromise['reject'](_0x2f62c5);}return _0xcee282[_0x895a('0x22')]();};}function saveUpdates(_0x5d1d04,_0x27bf48){return function(_0x342d07){if(_0x342d07){return _0x342d07[_0x895a('0x23')](_0x5d1d04)[_0x895a('0x24')](function(_0x111153){return _0x111153;});}return null;};}function removeEntity(_0x111523,_0x56d84a){return function(_0x1d6709){if(_0x1d6709){return _0x1d6709[_0x895a('0x25')]()[_0x895a('0x24')](function(){_0x111523[_0x895a('0x19')](0xcc)[_0x895a('0x26')]();});}};}function handleEntityNotFound(_0x23bb05,_0x540c1f){return function(_0x2667fa){if(!_0x2667fa){_0x23bb05[_0x895a('0x18')](0x194);}return _0x2667fa;};}function handleError(_0x5d25a8,_0x4f0506){_0x4f0506=_0x4f0506||0x1f4;return function(_0x55f270){logger[_0x895a('0x27')](_0x55f270['stack']);if(_0x55f270[_0x895a('0x28')]){delete _0x55f270['name'];}_0x5d25a8[_0x895a('0x19')](_0x4f0506)[_0x895a('0x29')](_0x55f270);};}exports['index']=function(_0x49d585,_0x19529f){var _0x46267f={},_0x3c8dbf={},_0x2133f4={'count':0x0,'rows':[]};var _0xb51bb1=_[_0x895a('0x2a')](db[_0x895a('0x2b')]['rawAttributes'],function(_0x5b41aa){return{'name':_0x5b41aa[_0x895a('0x2c')],'type':_0x5b41aa[_0x895a('0x2d')][_0x895a('0x2e')]};});_0x3c8dbf[_0x895a('0x2f')]=_[_0x895a('0x2a')](_0xb51bb1,_0x895a('0x28'));_0x3c8dbf['query']=_[_0x895a('0x30')](_0x49d585['query']);_0x3c8dbf[_0x895a('0x31')]=_['intersection'](_0x3c8dbf[_0x895a('0x2f')],_0x3c8dbf[_0x895a('0x32')]);_0x46267f['attributes']=_[_0x895a('0x33')](_0x3c8dbf[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x49d585[_0x895a('0x32')][_0x895a('0x34')]));_0x46267f[_0x895a('0x35')]=_0x46267f[_0x895a('0x35')][_0x895a('0x36')]?_0x46267f[_0x895a('0x35')]:_0x3c8dbf[_0x895a('0x2f')];if(!_0x49d585[_0x895a('0x32')]['hasOwnProperty'](_0x895a('0x37'))){_0x46267f[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x49d585['query'][_0x895a('0x1d')]);_0x46267f[_0x895a('0x1b')]=qs[_0x895a('0x1b')](_0x49d585[_0x895a('0x32')]['offset']);}_0x46267f[_0x895a('0x38')]=qs['sort'](_0x49d585['query'][_0x895a('0x39')]);_0x46267f[_0x895a('0x3a')]=qs[_0x895a('0x31')](_['pick'](_0x49d585[_0x895a('0x32')],_0x3c8dbf[_0x895a('0x31')]),_0xb51bb1);if(_0x49d585[_0x895a('0x32')][_0x895a('0x3b')]){_0x46267f[_0x895a('0x3a')]=_[_0x895a('0x3c')](_0x46267f[_0x895a('0x3a')],{'$or':_[_0x895a('0x2a')](_0xb51bb1,function(_0x5c481a){if(_0x5c481a[_0x895a('0x2d')]!=='VIRTUAL'){var _0x241d31={};_0x241d31[_0x5c481a[_0x895a('0x28')]]={'$like':'%'+_0x49d585[_0x895a('0x32')][_0x895a('0x3b')]+'%'};return _0x241d31;}})});}_0x46267f=_[_0x895a('0x3c')]({},_0x46267f,_0x49d585[_0x895a('0x3d')]);var _0x3e0ebd={'where':_0x46267f['where']};return db[_0x895a('0x2b')]['count'](_0x3e0ebd)['then'](function(_0x167fac){_0x2133f4[_0x895a('0x1e')]=_0x167fac;if(_0x49d585[_0x895a('0x32')]['includeAll']){_0x46267f['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x46267f);})[_0x895a('0x24')](function(_0x200f2e){_0x2133f4['rows']=_0x200f2e;return _0x2133f4;})[_0x895a('0x24')](respondWithFilteredResult(_0x19529f,_0x46267f))['catch'](handleError(_0x19529f,null));};exports[_0x895a('0x3e')]=function(_0x3de1cd,_0x56e5ab){var _0x13b91a={'raw':![],'where':{'id':_0x3de1cd[_0x895a('0x3f')]['id']}},_0x4fd007={};_0x4fd007[_0x895a('0x2f')]=_[_0x895a('0x30')](db[_0x895a('0x2b')]['rawAttributes']);_0x4fd007[_0x895a('0x32')]=_[_0x895a('0x30')](_0x3de1cd[_0x895a('0x32')]);_0x4fd007[_0x895a('0x31')]=_[_0x895a('0x33')](_0x4fd007[_0x895a('0x2f')],_0x4fd007[_0x895a('0x32')]);_0x13b91a[_0x895a('0x35')]=_['intersection'](_0x4fd007[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x3de1cd[_0x895a('0x32')][_0x895a('0x34')]));_0x13b91a[_0x895a('0x35')]=_0x13b91a[_0x895a('0x35')][_0x895a('0x36')]?_0x13b91a[_0x895a('0x35')]:_0x4fd007[_0x895a('0x2f')];if(_0x3de1cd[_0x895a('0x32')][_0x895a('0x40')]){_0x13b91a[_0x895a('0x41')]=[{'all':!![]}];}_0x13b91a=_[_0x895a('0x3c')]({},_0x13b91a,_0x3de1cd['options']);return db[_0x895a('0x2b')][_0x895a('0x42')](_0x13b91a)[_0x895a('0x24')](handleEntityNotFound(_0x56e5ab,null))['then'](respondWithResult(_0x56e5ab,null))['catch'](handleError(_0x56e5ab,null));};exports[_0x895a('0x43')]=function(_0x44fa9e,_0x3c74a5){return db[_0x895a('0x2b')]['create'](_0x44fa9e[_0x895a('0x44')],{})[_0x895a('0x24')](respondWithResult(_0x3c74a5,0xc9))[_0x895a('0x45')](handleError(_0x3c74a5,null));};exports['update']=function(_0x242605,_0x13e61e){if(_0x242605[_0x895a('0x44')]['id']){delete _0x242605[_0x895a('0x44')]['id'];}return db[_0x895a('0x2b')]['find']({'where':{'id':_0x242605['params']['id']}})[_0x895a('0x24')](handleEntityNotFound(_0x13e61e,null))[_0x895a('0x24')](saveUpdates(_0x242605[_0x895a('0x44')],null))[_0x895a('0x24')](respondWithResult(_0x13e61e,null))['catch'](handleError(_0x13e61e,null));};exports[_0x895a('0x25')]=function(_0x461fc5,_0xb0c00a){return db['FreshsalesConfiguration'][_0x895a('0x42')]({'where':{'id':_0x461fc5[_0x895a('0x3f')]['id']}})['then'](handleEntityNotFound(_0xb0c00a,null))[_0x895a('0x24')](removeEntity(_0xb0c00a,null))[_0x895a('0x45')](handleError(_0xb0c00a,null));};exports[_0x895a('0x46')]=function(_0x28a75e,_0x293f1f,_0x3ab431){var _0x5bda7d={};var _0x26f985={};var _0x5bea05;var _0x4eabca;return db[_0x895a('0x2b')][_0x895a('0x47')]({'where':{'id':_0x28a75e[_0x895a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x293f1f,null))['then'](function(_0x550d36){if(_0x550d36){_0x5bea05=_0x550d36;_0x26f985[_0x895a('0x2f')]=_[_0x895a('0x30')](db['FreshsalesField'][_0x895a('0x48')]);_0x26f985[_0x895a('0x32')]=_[_0x895a('0x30')](_0x28a75e['query']);_0x26f985[_0x895a('0x31')]=_[_0x895a('0x33')](_0x26f985['model'],_0x26f985[_0x895a('0x32')]);_0x5bda7d[_0x895a('0x35')]=_[_0x895a('0x33')](_0x26f985[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x28a75e[_0x895a('0x32')][_0x895a('0x34')]));_0x5bda7d['attributes']=_0x5bda7d[_0x895a('0x35')][_0x895a('0x36')]?_0x5bda7d[_0x895a('0x35')]:_0x26f985[_0x895a('0x2f')];_0x5bda7d[_0x895a('0x38')]=qs['sort'](_0x28a75e[_0x895a('0x32')][_0x895a('0x39')]);_0x5bda7d['where']=qs[_0x895a('0x31')](_['pick'](_0x28a75e[_0x895a('0x32')],_0x26f985[_0x895a('0x31')]));if(_0x28a75e[_0x895a('0x32')][_0x895a('0x3b')]){_0x5bda7d['where']=_[_0x895a('0x3c')](_0x5bda7d[_0x895a('0x3a')],{'$or':_[_0x895a('0x2a')](_0x5bda7d[_0x895a('0x35')],function(_0x3fd2e7){var _0x31ef06={};_0x31ef06[_0x3fd2e7]={'$like':'%'+_0x28a75e['query'][_0x895a('0x3b')]+'%'};return _0x31ef06;})});}_0x5bda7d=_[_0x895a('0x3c')]({},_0x5bda7d,_0x28a75e['options']);return _0x5bea05[_0x895a('0x46')](_0x5bda7d);}})[_0x895a('0x24')](function(_0x5c3a9b){if(_0x5c3a9b){_0x4eabca=_0x5c3a9b[_0x895a('0x36')];if(!_0x28a75e[_0x895a('0x32')][_0x895a('0x49')]('nolimit')){_0x5bda7d[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x28a75e[_0x895a('0x32')][_0x895a('0x1d')]);_0x5bda7d['offset']=qs['offset'](_0x28a75e[_0x895a('0x32')]['offset']);}return _0x5bea05[_0x895a('0x46')](_0x5bda7d);}})[_0x895a('0x24')](function(_0x333f36){if(_0x333f36){return _0x333f36?{'count':_0x4eabca,'rows':_0x333f36}:null;}})['then'](respondWithResult(_0x293f1f,null))[_0x895a('0x45')](handleError(_0x293f1f,null));};exports[_0x895a('0x4a')]=function(_0x401753,_0x3aeeff,_0x4bf621){var _0x1d995e={};var _0x1c1cab={};var _0x34ea61;var _0x2f686d;return db[_0x895a('0x2b')][_0x895a('0x47')]({'where':{'id':_0x401753[_0x895a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3aeeff,null))[_0x895a('0x24')](function(_0x4ccde6){if(_0x4ccde6){_0x34ea61=_0x4ccde6;_0x1c1cab[_0x895a('0x2f')]=_[_0x895a('0x30')](db['FreshsalesField']['rawAttributes']);_0x1c1cab[_0x895a('0x32')]=_[_0x895a('0x30')](_0x401753[_0x895a('0x32')]);_0x1c1cab[_0x895a('0x31')]=_['intersection'](_0x1c1cab['model'],_0x1c1cab[_0x895a('0x32')]);_0x1d995e[_0x895a('0x35')]=_[_0x895a('0x33')](_0x1c1cab['model'],qs[_0x895a('0x34')](_0x401753[_0x895a('0x32')]['fields']));_0x1d995e['attributes']=_0x1d995e[_0x895a('0x35')][_0x895a('0x36')]?_0x1d995e['attributes']:_0x1c1cab[_0x895a('0x2f')];_0x1d995e[_0x895a('0x38')]=qs['sort'](_0x401753['query'][_0x895a('0x39')]);_0x1d995e[_0x895a('0x3a')]=qs[_0x895a('0x31')](_[_0x895a('0x4b')](_0x401753[_0x895a('0x32')],_0x1c1cab[_0x895a('0x31')]));if(_0x401753[_0x895a('0x32')]['filter']){_0x1d995e[_0x895a('0x3a')]=_['merge'](_0x1d995e[_0x895a('0x3a')],{'$or':_['map'](_0x1d995e[_0x895a('0x35')],function(_0x20a4e9){var _0x419d1b={};_0x419d1b[_0x20a4e9]={'$like':'%'+_0x401753[_0x895a('0x32')][_0x895a('0x3b')]+'%'};return _0x419d1b;})});}_0x1d995e=_[_0x895a('0x3c')]({},_0x1d995e,_0x401753[_0x895a('0x3d')]);return _0x34ea61[_0x895a('0x4a')](_0x1d995e);}})[_0x895a('0x24')](function(_0x580e4a){if(_0x580e4a){_0x2f686d=_0x580e4a[_0x895a('0x36')];if(!_0x401753[_0x895a('0x32')][_0x895a('0x49')]('nolimit')){_0x1d995e[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x401753['query']['limit']);_0x1d995e[_0x895a('0x1b')]=qs[_0x895a('0x1b')](_0x401753['query'][_0x895a('0x1b')]);}return _0x34ea61[_0x895a('0x4a')](_0x1d995e);}})[_0x895a('0x24')](function(_0x38fb17){if(_0x38fb17){return _0x38fb17?{'count':_0x2f686d,'rows':_0x38fb17}:null;}})[_0x895a('0x24')](respondWithResult(_0x3aeeff,null))[_0x895a('0x45')](handleError(_0x3aeeff,null));};exports[_0x895a('0x4c')]=function(_0x8abd36,_0x317405,_0x14d100){var _0x2f7750={};var _0x292357={};var _0x296a35;var _0x173a1c;return db[_0x895a('0x2b')][_0x895a('0x47')]({'where':{'id':_0x8abd36[_0x895a('0x3f')]['id']}})[_0x895a('0x24')](handleEntityNotFound(_0x317405,null))[_0x895a('0x24')](function(_0x419a4c){if(_0x419a4c){_0x296a35=_0x419a4c;_0x292357[_0x895a('0x2f')]=_[_0x895a('0x30')](db['FreshsalesField'][_0x895a('0x48')]);_0x292357[_0x895a('0x32')]=_[_0x895a('0x30')](_0x8abd36['query']);_0x292357[_0x895a('0x31')]=_[_0x895a('0x33')](_0x292357['model'],_0x292357[_0x895a('0x32')]);_0x2f7750['attributes']=_[_0x895a('0x33')](_0x292357[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x8abd36[_0x895a('0x32')][_0x895a('0x34')]));_0x2f7750[_0x895a('0x35')]=_0x2f7750[_0x895a('0x35')][_0x895a('0x36')]?_0x2f7750[_0x895a('0x35')]:_0x292357[_0x895a('0x2f')];_0x2f7750[_0x895a('0x38')]=qs[_0x895a('0x39')](_0x8abd36[_0x895a('0x32')]['sort']);_0x2f7750['where']=qs[_0x895a('0x31')](_[_0x895a('0x4b')](_0x8abd36['query'],_0x292357[_0x895a('0x31')]));if(_0x8abd36['query'][_0x895a('0x3b')]){_0x2f7750[_0x895a('0x3a')]=_[_0x895a('0x3c')](_0x2f7750[_0x895a('0x3a')],{'$or':_[_0x895a('0x2a')](_0x2f7750[_0x895a('0x35')],function(_0x1ce3af){var _0x4cddb0={};_0x4cddb0[_0x1ce3af]={'$like':'%'+_0x8abd36[_0x895a('0x32')]['filter']+'%'};return _0x4cddb0;})});}_0x2f7750=_[_0x895a('0x3c')]({},_0x2f7750,_0x8abd36[_0x895a('0x3d')]);return _0x296a35[_0x895a('0x4c')](_0x2f7750);}})[_0x895a('0x24')](function(_0x2f64c8){if(_0x2f64c8){_0x173a1c=_0x2f64c8['length'];if(!_0x8abd36[_0x895a('0x32')][_0x895a('0x49')](_0x895a('0x37'))){_0x2f7750[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x8abd36[_0x895a('0x32')][_0x895a('0x1d')]);_0x2f7750[_0x895a('0x1b')]=qs[_0x895a('0x1b')](_0x8abd36['query'][_0x895a('0x1b')]);}return _0x296a35[_0x895a('0x4c')](_0x2f7750);}})[_0x895a('0x24')](function(_0x409939){if(_0x409939){return _0x409939?{'count':_0x173a1c,'rows':_0x409939}:null;}})[_0x895a('0x24')](respondWithResult(_0x317405,null))[_0x895a('0x45')](handleError(_0x317405,null));}; \ No newline at end of file +var _0x5f5a=['reject','save','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','then','include','rows','catch','show','params','includeAll','create','body','getSubjects','findOne','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x3e043f,_0x147d74){var _0x2c5d25=function(_0x2173e5){while(--_0x2173e5){_0x3e043f['push'](_0x3e043f['shift']());}};_0x2c5d25(++_0x147d74);}(_0x5f5a,0x10e));var _0xa5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa5f5('0x0'));var rimraf=require(_0xa5f5('0x1'));var zipdir=require(_0xa5f5('0x2'));var jsonpatch=require(_0xa5f5('0x3'));var rp=require(_0xa5f5('0x4'));var moment=require(_0xa5f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa5f5('0x6'));var util=require('util');var path=require(_0xa5f5('0x7'));var sox=require(_0xa5f5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5f5('0x9'));var squel=require(_0xa5f5('0xa'));var crypto=require(_0xa5f5('0xb'));var jsforce=require(_0xa5f5('0xc'));var deskjs=require(_0xa5f5('0xd'));var toCsv=require(_0xa5f5('0xe'));var querystring=require('querystring');var Papa=require(_0xa5f5('0xf'));var Redis=require(_0xa5f5('0x10'));var authService=require(_0xa5f5('0x11'));var qs=require(_0xa5f5('0x12'));var as=require(_0xa5f5('0x13'));var hardwareService=require(_0xa5f5('0x14'));var logger=require('../../config/logger')(_0xa5f5('0x15'));var utils=require(_0xa5f5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa5f5('0x17'))['db'];function respondWithStatusCode(_0x1f0bc1,_0x40fb09){_0x40fb09=_0x40fb09||0xcc;return function(_0x12cc36){if(_0x12cc36){return _0x1f0bc1[_0xa5f5('0x18')](_0x40fb09);}return _0x1f0bc1[_0xa5f5('0x19')](_0x40fb09)[_0xa5f5('0x1a')]();};}function respondWithResult(_0x1ad539,_0xefc632){_0xefc632=_0xefc632||0xc8;return function(_0x28e575){if(_0x28e575){return _0x1ad539[_0xa5f5('0x19')](_0xefc632)[_0xa5f5('0x1b')](_0x28e575);}};}function respondWithFilteredResult(_0x455bf9,_0x46226f){return function(_0x45d3e3){if(_0x45d3e3){var _0x4f8ff8=typeof _0x46226f[_0xa5f5('0x1c')]===_0xa5f5('0x1d')&&typeof _0x46226f[_0xa5f5('0x1e')]==='undefined';var _0x4d8bd2=_0x45d3e3[_0xa5f5('0x1f')];var _0x3b0389=_0x4f8ff8?0x0:_0x46226f[_0xa5f5('0x1c')];var _0x23d5ca=_0x4f8ff8?_0x45d3e3[_0xa5f5('0x1f')]:_0x46226f[_0xa5f5('0x1c')]+_0x46226f[_0xa5f5('0x1e')];var _0x4c4ae1;if(_0x23d5ca>=_0x4d8bd2){_0x23d5ca=_0x4d8bd2;_0x4c4ae1=0xc8;}else{_0x4c4ae1=0xce;}_0x455bf9['status'](_0x4c4ae1);return _0x455bf9[_0xa5f5('0x20')]('Content-Range',_0x3b0389+'-'+_0x23d5ca+'/'+_0x4d8bd2)[_0xa5f5('0x1b')](_0x45d3e3);}return null;};}function patchUpdates(_0x64a2b2){return function(_0x2392c8){try{jsonpatch[_0xa5f5('0x21')](_0x2392c8,_0x64a2b2,!![]);}catch(_0x13f0d3){return BPromise[_0xa5f5('0x22')](_0x13f0d3);}return _0x2392c8[_0xa5f5('0x23')]();};}function saveUpdates(_0x4ed990,_0x2a54e1){return function(_0x3d62d4){if(_0x3d62d4){return _0x3d62d4['update'](_0x4ed990)['then'](function(_0x320d58){return _0x320d58;});}return null;};}function removeEntity(_0xf22d5b,_0x4693fa){return function(_0x34bf72){if(_0x34bf72){return _0x34bf72['destroy']()['then'](function(){_0xf22d5b[_0xa5f5('0x19')](0xcc)[_0xa5f5('0x1a')]();});}};}function handleEntityNotFound(_0x4ca52d,_0x17de03){return function(_0x33e291){if(!_0x33e291){_0x4ca52d[_0xa5f5('0x18')](0x194);}return _0x33e291;};}function handleError(_0x4070c5,_0x25b11c){_0x25b11c=_0x25b11c||0x1f4;return function(_0x5285f3){logger[_0xa5f5('0x24')](_0x5285f3[_0xa5f5('0x25')]);if(_0x5285f3['name']){delete _0x5285f3[_0xa5f5('0x26')];}_0x4070c5[_0xa5f5('0x19')](_0x25b11c)['send'](_0x5285f3);};}exports[_0xa5f5('0x27')]=function(_0x2b3c6e,_0x1ae5c3){var _0x3b025b={},_0x3acd37={},_0x53a6a5={'count':0x0,'rows':[]};var _0x33ea47=_[_0xa5f5('0x28')](db[_0xa5f5('0x29')][_0xa5f5('0x2a')],function(_0x1a6dfa){return{'name':_0x1a6dfa['fieldName'],'type':_0x1a6dfa['type'][_0xa5f5('0x2b')]};});_0x3acd37[_0xa5f5('0x2c')]=_[_0xa5f5('0x28')](_0x33ea47,_0xa5f5('0x26'));_0x3acd37[_0xa5f5('0x2d')]=_[_0xa5f5('0x2e')](_0x2b3c6e[_0xa5f5('0x2d')]);_0x3acd37[_0xa5f5('0x2f')]=_[_0xa5f5('0x30')](_0x3acd37[_0xa5f5('0x2c')],_0x3acd37[_0xa5f5('0x2d')]);_0x3b025b[_0xa5f5('0x31')]=_['intersection'](_0x3acd37['model'],qs[_0xa5f5('0x32')](_0x2b3c6e[_0xa5f5('0x2d')][_0xa5f5('0x32')]));_0x3b025b['attributes']=_0x3b025b['attributes'][_0xa5f5('0x33')]?_0x3b025b[_0xa5f5('0x31')]:_0x3acd37[_0xa5f5('0x2c')];if(!_0x2b3c6e[_0xa5f5('0x2d')][_0xa5f5('0x34')](_0xa5f5('0x35'))){_0x3b025b[_0xa5f5('0x1e')]=qs[_0xa5f5('0x1e')](_0x2b3c6e['query'][_0xa5f5('0x1e')]);_0x3b025b['offset']=qs['offset'](_0x2b3c6e[_0xa5f5('0x2d')]['offset']);}_0x3b025b[_0xa5f5('0x36')]=qs[_0xa5f5('0x37')](_0x2b3c6e[_0xa5f5('0x2d')][_0xa5f5('0x37')]);_0x3b025b[_0xa5f5('0x38')]=qs[_0xa5f5('0x2f')](_[_0xa5f5('0x39')](_0x2b3c6e['query'],_0x3acd37[_0xa5f5('0x2f')]),_0x33ea47);if(_0x2b3c6e[_0xa5f5('0x2d')]['filter']){_0x3b025b[_0xa5f5('0x38')]=_[_0xa5f5('0x3a')](_0x3b025b[_0xa5f5('0x38')],{'$or':_[_0xa5f5('0x28')](_0x33ea47,function(_0x3da7f3){if(_0x3da7f3[_0xa5f5('0x3b')]!==_0xa5f5('0x3c')){var _0x23eeec={};_0x23eeec[_0x3da7f3['name']]={'$like':'%'+_0x2b3c6e[_0xa5f5('0x2d')][_0xa5f5('0x3d')]+'%'};return _0x23eeec;}})});}_0x3b025b=_['merge']({},_0x3b025b,_0x2b3c6e[_0xa5f5('0x3e')]);var _0x651235={'where':_0x3b025b[_0xa5f5('0x38')]};return db['FreshsalesConfiguration'][_0xa5f5('0x1f')](_0x651235)[_0xa5f5('0x3f')](function(_0x59c695){_0x53a6a5[_0xa5f5('0x1f')]=_0x59c695;if(_0x2b3c6e[_0xa5f5('0x2d')]['includeAll']){_0x3b025b[_0xa5f5('0x40')]=[{'all':!![]}];}return db[_0xa5f5('0x29')]['findAll'](_0x3b025b);})[_0xa5f5('0x3f')](function(_0x1a9072){_0x53a6a5[_0xa5f5('0x41')]=_0x1a9072;return _0x53a6a5;})[_0xa5f5('0x3f')](respondWithFilteredResult(_0x1ae5c3,_0x3b025b))[_0xa5f5('0x42')](handleError(_0x1ae5c3,null));};exports[_0xa5f5('0x43')]=function(_0x352d65,_0x181eb9){var _0x35f41d={'raw':![],'where':{'id':_0x352d65[_0xa5f5('0x44')]['id']}},_0x599321={};_0x599321[_0xa5f5('0x2c')]=_['keys'](db['FreshsalesConfiguration'][_0xa5f5('0x2a')]);_0x599321[_0xa5f5('0x2d')]=_[_0xa5f5('0x2e')](_0x352d65[_0xa5f5('0x2d')]);_0x599321['filters']=_[_0xa5f5('0x30')](_0x599321['model'],_0x599321[_0xa5f5('0x2d')]);_0x35f41d[_0xa5f5('0x31')]=_[_0xa5f5('0x30')](_0x599321[_0xa5f5('0x2c')],qs[_0xa5f5('0x32')](_0x352d65['query']['fields']));_0x35f41d[_0xa5f5('0x31')]=_0x35f41d[_0xa5f5('0x31')]['length']?_0x35f41d[_0xa5f5('0x31')]:_0x599321[_0xa5f5('0x2c')];if(_0x352d65['query'][_0xa5f5('0x45')]){_0x35f41d['include']=[{'all':!![]}];}_0x35f41d=_['merge']({},_0x35f41d,_0x352d65['options']);return db[_0xa5f5('0x29')]['find'](_0x35f41d)[_0xa5f5('0x3f')](handleEntityNotFound(_0x181eb9,null))[_0xa5f5('0x3f')](respondWithResult(_0x181eb9,null))[_0xa5f5('0x42')](handleError(_0x181eb9,null));};exports[_0xa5f5('0x46')]=function(_0x3fec12,_0x6e1554){return db[_0xa5f5('0x29')][_0xa5f5('0x46')](_0x3fec12['body'],{})['then'](respondWithResult(_0x6e1554,0xc9))[_0xa5f5('0x42')](handleError(_0x6e1554,null));};exports['update']=function(_0x86f84b,_0x5476e1){if(_0x86f84b[_0xa5f5('0x47')]['id']){delete _0x86f84b['body']['id'];}return db[_0xa5f5('0x29')]['find']({'where':{'id':_0x86f84b[_0xa5f5('0x44')]['id']}})['then'](handleEntityNotFound(_0x5476e1,null))['then'](saveUpdates(_0x86f84b[_0xa5f5('0x47')],null))[_0xa5f5('0x3f')](respondWithResult(_0x5476e1,null))['catch'](handleError(_0x5476e1,null));};exports['destroy']=function(_0x4a8752,_0x26c3d5){return db[_0xa5f5('0x29')]['find']({'where':{'id':_0x4a8752[_0xa5f5('0x44')]['id']}})[_0xa5f5('0x3f')](handleEntityNotFound(_0x26c3d5,null))[_0xa5f5('0x3f')](removeEntity(_0x26c3d5,null))[_0xa5f5('0x42')](handleError(_0x26c3d5,null));};exports[_0xa5f5('0x48')]=function(_0x3b7e41,_0x47f70d,_0x2857b0){var _0x3ccad5={};var _0x399095={};var _0x3f735b;var _0x1333ab;return db['FreshsalesConfiguration'][_0xa5f5('0x49')]({'where':{'id':_0x3b7e41['params']['id']}})[_0xa5f5('0x3f')](handleEntityNotFound(_0x47f70d,null))['then'](function(_0x4d36de){if(_0x4d36de){_0x3f735b=_0x4d36de;_0x399095['model']=_['keys'](db['FreshsalesField'][_0xa5f5('0x2a')]);_0x399095[_0xa5f5('0x2d')]=_[_0xa5f5('0x2e')](_0x3b7e41[_0xa5f5('0x2d')]);_0x399095['filters']=_[_0xa5f5('0x30')](_0x399095[_0xa5f5('0x2c')],_0x399095[_0xa5f5('0x2d')]);_0x3ccad5[_0xa5f5('0x31')]=_[_0xa5f5('0x30')](_0x399095[_0xa5f5('0x2c')],qs[_0xa5f5('0x32')](_0x3b7e41[_0xa5f5('0x2d')]['fields']));_0x3ccad5[_0xa5f5('0x31')]=_0x3ccad5[_0xa5f5('0x31')][_0xa5f5('0x33')]?_0x3ccad5['attributes']:_0x399095[_0xa5f5('0x2c')];_0x3ccad5[_0xa5f5('0x36')]=qs[_0xa5f5('0x37')](_0x3b7e41[_0xa5f5('0x2d')][_0xa5f5('0x37')]);_0x3ccad5[_0xa5f5('0x38')]=qs[_0xa5f5('0x2f')](_[_0xa5f5('0x39')](_0x3b7e41['query'],_0x399095['filters']));if(_0x3b7e41[_0xa5f5('0x2d')]['filter']){_0x3ccad5['where']=_['merge'](_0x3ccad5[_0xa5f5('0x38')],{'$or':_[_0xa5f5('0x28')](_0x3ccad5[_0xa5f5('0x31')],function(_0x2dc51e){var _0x179f21={};_0x179f21[_0x2dc51e]={'$like':'%'+_0x3b7e41[_0xa5f5('0x2d')][_0xa5f5('0x3d')]+'%'};return _0x179f21;})});}_0x3ccad5=_[_0xa5f5('0x3a')]({},_0x3ccad5,_0x3b7e41['options']);return _0x3f735b[_0xa5f5('0x48')](_0x3ccad5);}})[_0xa5f5('0x3f')](function(_0x520010){if(_0x520010){_0x1333ab=_0x520010[_0xa5f5('0x33')];if(!_0x3b7e41[_0xa5f5('0x2d')][_0xa5f5('0x34')]('nolimit')){_0x3ccad5[_0xa5f5('0x1e')]=qs[_0xa5f5('0x1e')](_0x3b7e41[_0xa5f5('0x2d')][_0xa5f5('0x1e')]);_0x3ccad5[_0xa5f5('0x1c')]=qs[_0xa5f5('0x1c')](_0x3b7e41[_0xa5f5('0x2d')][_0xa5f5('0x1c')]);}return _0x3f735b[_0xa5f5('0x48')](_0x3ccad5);}})[_0xa5f5('0x3f')](function(_0x1823bb){if(_0x1823bb){return _0x1823bb?{'count':_0x1333ab,'rows':_0x1823bb}:null;}})[_0xa5f5('0x3f')](respondWithResult(_0x47f70d,null))[_0xa5f5('0x42')](handleError(_0x47f70d,null));};exports['getDescriptions']=function(_0x3adebc,_0x11a682,_0x4ef190){var _0x4c7b7a={};var _0x2c9526={};var _0x5b9a3d;var _0x18afbb;return db[_0xa5f5('0x29')][_0xa5f5('0x49')]({'where':{'id':_0x3adebc[_0xa5f5('0x44')]['id']}})[_0xa5f5('0x3f')](handleEntityNotFound(_0x11a682,null))['then'](function(_0x45c202){if(_0x45c202){_0x5b9a3d=_0x45c202;_0x2c9526[_0xa5f5('0x2c')]=_[_0xa5f5('0x2e')](db[_0xa5f5('0x4a')]['rawAttributes']);_0x2c9526['query']=_[_0xa5f5('0x2e')](_0x3adebc['query']);_0x2c9526[_0xa5f5('0x2f')]=_['intersection'](_0x2c9526[_0xa5f5('0x2c')],_0x2c9526[_0xa5f5('0x2d')]);_0x4c7b7a[_0xa5f5('0x31')]=_[_0xa5f5('0x30')](_0x2c9526[_0xa5f5('0x2c')],qs[_0xa5f5('0x32')](_0x3adebc[_0xa5f5('0x2d')][_0xa5f5('0x32')]));_0x4c7b7a[_0xa5f5('0x31')]=_0x4c7b7a[_0xa5f5('0x31')]['length']?_0x4c7b7a[_0xa5f5('0x31')]:_0x2c9526['model'];_0x4c7b7a['order']=qs['sort'](_0x3adebc['query'][_0xa5f5('0x37')]);_0x4c7b7a[_0xa5f5('0x38')]=qs[_0xa5f5('0x2f')](_[_0xa5f5('0x39')](_0x3adebc[_0xa5f5('0x2d')],_0x2c9526[_0xa5f5('0x2f')]));if(_0x3adebc[_0xa5f5('0x2d')][_0xa5f5('0x3d')]){_0x4c7b7a['where']=_['merge'](_0x4c7b7a[_0xa5f5('0x38')],{'$or':_[_0xa5f5('0x28')](_0x4c7b7a[_0xa5f5('0x31')],function(_0x3463d6){var _0x34f42c={};_0x34f42c[_0x3463d6]={'$like':'%'+_0x3adebc['query'][_0xa5f5('0x3d')]+'%'};return _0x34f42c;})});}_0x4c7b7a=_[_0xa5f5('0x3a')]({},_0x4c7b7a,_0x3adebc[_0xa5f5('0x3e')]);return _0x5b9a3d['getDescriptions'](_0x4c7b7a);}})[_0xa5f5('0x3f')](function(_0x2053de){if(_0x2053de){_0x18afbb=_0x2053de['length'];if(!_0x3adebc['query']['hasOwnProperty']('nolimit')){_0x4c7b7a[_0xa5f5('0x1e')]=qs['limit'](_0x3adebc[_0xa5f5('0x2d')][_0xa5f5('0x1e')]);_0x4c7b7a[_0xa5f5('0x1c')]=qs[_0xa5f5('0x1c')](_0x3adebc[_0xa5f5('0x2d')][_0xa5f5('0x1c')]);}return _0x5b9a3d['getDescriptions'](_0x4c7b7a);}})['then'](function(_0x740644){if(_0x740644){return _0x740644?{'count':_0x18afbb,'rows':_0x740644}:null;}})[_0xa5f5('0x3f')](respondWithResult(_0x11a682,null))[_0xa5f5('0x42')](handleError(_0x11a682,null));};exports[_0xa5f5('0x4b')]=function(_0x107487,_0x2d9835,_0x58a115){var _0xa961d1={};var _0x2887cc={};var _0x460ef8;var _0x919597;return db[_0xa5f5('0x29')][_0xa5f5('0x49')]({'where':{'id':_0x107487[_0xa5f5('0x44')]['id']}})[_0xa5f5('0x3f')](handleEntityNotFound(_0x2d9835,null))['then'](function(_0x334ee5){if(_0x334ee5){_0x460ef8=_0x334ee5;_0x2887cc['model']=_['keys'](db[_0xa5f5('0x4a')][_0xa5f5('0x2a')]);_0x2887cc[_0xa5f5('0x2d')]=_[_0xa5f5('0x2e')](_0x107487['query']);_0x2887cc['filters']=_[_0xa5f5('0x30')](_0x2887cc['model'],_0x2887cc['query']);_0xa961d1['attributes']=_[_0xa5f5('0x30')](_0x2887cc[_0xa5f5('0x2c')],qs['fields'](_0x107487[_0xa5f5('0x2d')][_0xa5f5('0x32')]));_0xa961d1[_0xa5f5('0x31')]=_0xa961d1[_0xa5f5('0x31')][_0xa5f5('0x33')]?_0xa961d1[_0xa5f5('0x31')]:_0x2887cc[_0xa5f5('0x2c')];_0xa961d1[_0xa5f5('0x36')]=qs[_0xa5f5('0x37')](_0x107487[_0xa5f5('0x2d')]['sort']);_0xa961d1['where']=qs['filters'](_[_0xa5f5('0x39')](_0x107487[_0xa5f5('0x2d')],_0x2887cc[_0xa5f5('0x2f')]));if(_0x107487[_0xa5f5('0x2d')]['filter']){_0xa961d1['where']=_[_0xa5f5('0x3a')](_0xa961d1[_0xa5f5('0x38')],{'$or':_[_0xa5f5('0x28')](_0xa961d1[_0xa5f5('0x31')],function(_0x117e9c){var _0x1b357e={};_0x1b357e[_0x117e9c]={'$like':'%'+_0x107487[_0xa5f5('0x2d')][_0xa5f5('0x3d')]+'%'};return _0x1b357e;})});}_0xa961d1=_[_0xa5f5('0x3a')]({},_0xa961d1,_0x107487[_0xa5f5('0x3e')]);return _0x460ef8[_0xa5f5('0x4b')](_0xa961d1);}})[_0xa5f5('0x3f')](function(_0x4f8471){if(_0x4f8471){_0x919597=_0x4f8471[_0xa5f5('0x33')];if(!_0x107487[_0xa5f5('0x2d')][_0xa5f5('0x34')](_0xa5f5('0x35'))){_0xa961d1['limit']=qs[_0xa5f5('0x1e')](_0x107487[_0xa5f5('0x2d')]['limit']);_0xa961d1[_0xa5f5('0x1c')]=qs[_0xa5f5('0x1c')](_0x107487['query'][_0xa5f5('0x1c')]);}return _0x460ef8['getFields'](_0xa961d1);}})[_0xa5f5('0x3f')](function(_0x50641f){if(_0x50641f){return _0x50641f?{'count':_0x919597,'rows':_0x50641f}:null;}})['then'](respondWithResult(_0x2d9835,null))['catch'](handleError(_0x2d9835,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index a82eb18..31ff1a4 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 _0x0b6b=['bluebird','request-promise','rimraf','../../config/environment','exports','define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b6b,0x1b7));var _0xb0b6=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x0b6b[_0x189305];return _0xea3406;};'use strict';var _=require(_0xb0b6('0x0'));var util=require(_0xb0b6('0x1'));var logger=require(_0xb0b6('0x2'))(_0xb0b6('0x3'));var moment=require(_0xb0b6('0x4'));var BPromise=require(_0xb0b6('0x5'));var rp=require(_0xb0b6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb0b6('0x7'));var config=require(_0xb0b6('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xb0b6('0x9')]=function(_0x17443e,_0x47a972){return _0x17443e[_0xb0b6('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0xb0b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05c9=['define','FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x4f1b14,_0x23d785){var _0x264a66=function(_0x21a0d6){while(--_0x21a0d6){_0x4f1b14['push'](_0x4f1b14['shift']());}};_0x264a66(++_0x23d785);}(_0x05c9,0x152));var _0x905c=function(_0x4d3f61,_0x394c2d){_0x4d3f61=_0x4d3f61-0x0;var _0xa01b50=_0x05c9[_0x4d3f61];return _0xa01b50;};'use strict';var _=require(_0x905c('0x0'));var util=require(_0x905c('0x1'));var logger=require(_0x905c('0x2'))(_0x905c('0x3'));var moment=require(_0x905c('0x4'));var BPromise=require('bluebird');var rp=require(_0x905c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x905c('0x6'));var config=require(_0x905c('0x7'));var attributes=require(_0x905c('0x8'));module[_0x905c('0x9')]=function(_0x5d3ed7,_0x2d58bf){return _0x5d3ed7[_0x905c('0xa')](_0x905c('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index af59014..17b283c 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 _0xfefc=['info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then'];(function(_0x2db63a,_0x52ee8e){var _0x556b91=function(_0x4ad3aa){while(--_0x4ad3aa){_0x2db63a['push'](_0x2db63a['shift']());}};_0x556b91(++_0x52ee8e);}(_0xfefc,0x185));var _0xcfef=function(_0x163796,_0x157405){_0x163796=_0x163796-0x0;var _0xe0b76c=_0xfefc[_0x163796];return _0xe0b76c;};'use strict';var _=require(_0xcfef('0x0'));var util=require(_0xcfef('0x1'));var moment=require(_0xcfef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfef('0x3'));var db=require(_0xcfef('0x4'))['db'];var utils=require(_0xcfef('0x5'));var logger=require(_0xcfef('0x6'))('rpc');var config=require(_0xcfef('0x7'));var jayson=require(_0xcfef('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3afd7c,_0x1d0aaa,_0x3a18a9){return new BPromise(function(_0x31280a,_0x56ddd5){return client[_0xcfef('0x9')](_0x3afd7c,_0x3a18a9)[_0xcfef('0xa')](function(_0x378049){logger[_0xcfef('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1d0aaa,'request\x20sent');logger['debug'](_0xcfef('0xc'),_0x1d0aaa,_0xcfef('0xd'),JSON['stringify'](_0x378049));if(_0x378049['error']){if(_0x378049[_0xcfef('0xe')][_0xcfef('0xf')]===0x1f4){logger[_0xcfef('0xe')](_0xcfef('0x10'),_0x1d0aaa,_0x378049[_0xcfef('0xe')][_0xcfef('0x11')]);return _0x56ddd5(_0x378049[_0xcfef('0xe')]['message']);}logger[_0xcfef('0xe')](_0xcfef('0x10'),_0x1d0aaa,_0x378049[_0xcfef('0xe')][_0xcfef('0x11')]);return _0x31280a(_0x378049['error'][_0xcfef('0x11')]);}else{logger[_0xcfef('0xb')](_0xcfef('0x10'),_0x1d0aaa,_0xcfef('0xd'));_0x31280a(_0x378049[_0xcfef('0x12')][_0xcfef('0x11')]);}})[_0xcfef('0x13')](function(_0x413e10){logger[_0xcfef('0xe')](_0xcfef('0x10'),_0x1d0aaa,_0x413e10);_0x56ddd5(_0x413e10);});});} \ No newline at end of file +var _0x93a3=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x93a3,0x171));var _0x393a=function(_0x4e800d,_0x524bc0){_0x4e800d=_0x4e800d-0x0;var _0x54e584=_0x93a3[_0x4e800d];return _0x54e584;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x393a('0x0'));var BPromise=require(_0x393a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x393a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x393a('0x3'));var logger=require(_0x393a('0x4'))(_0x393a('0x5'));var config=require(_0x393a('0x6'));var jayson=require(_0x393a('0x7'));var client=jayson[_0x393a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bdee5,_0x850a9d,_0x1a342f){return new BPromise(function(_0x32c513,_0x566771){return client[_0x393a('0x9')](_0x1bdee5,_0x1a342f)[_0x393a('0xa')](function(_0x3ff9e6){logger[_0x393a('0xb')](_0x393a('0xc'),_0x850a9d,_0x393a('0xd'));logger['debug'](_0x393a('0xe'),_0x850a9d,_0x393a('0xd'),JSON[_0x393a('0xf')](_0x3ff9e6));if(_0x3ff9e6[_0x393a('0x10')]){if(_0x3ff9e6[_0x393a('0x10')][_0x393a('0x11')]===0x1f4){logger[_0x393a('0x10')](_0x393a('0xc'),_0x850a9d,_0x3ff9e6[_0x393a('0x10')]['message']);return _0x566771(_0x3ff9e6[_0x393a('0x10')][_0x393a('0x12')]);}logger[_0x393a('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x850a9d,_0x3ff9e6[_0x393a('0x10')][_0x393a('0x12')]);return _0x32c513(_0x3ff9e6[_0x393a('0x10')][_0x393a('0x12')]);}else{logger[_0x393a('0xb')](_0x393a('0xc'),_0x850a9d,_0x393a('0xd'));_0x32c513(_0x3ff9e6[_0x393a('0x13')][_0x393a('0x12')]);}})[_0x393a('0x14')](function(_0x4e3acf){logger[_0x393a('0x10')](_0x393a('0xc'),_0x850a9d,_0x4e3acf);_0x566771(_0x4e3acf);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ba6cbab..c44730d 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 _0x833b=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','util'];(function(_0x5aaf02,_0x7793a0){var _0x155025=function(_0x5f51c8){while(--_0x5f51c8){_0x5aaf02['push'](_0x5aaf02['shift']());}};_0x155025(++_0x7793a0);}(_0x833b,0x131));var _0xb833=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x833b[_0x17406a];return _0x1501ff;};'use strict';var multer=require('multer');var util=require(_0xb833('0x0'));var path=require('path');var timeout=require(_0xb833('0x1'));var express=require('express');var router=express[_0xb833('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb833('0x3'));var interaction=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var controller=require(_0xb833('0x6'));router[_0xb833('0x7')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x9')]);router['get'](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0xb')]);router[_0xb833('0xc')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0xd')]);router[_0xb833('0xe')]('/:id',auth[_0xb833('0x8')](),controller['update']);router[_0xb833('0xf')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6732=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var path=require(_0x2673('0x2'));var timeout=require(_0x2673('0x3'));var express=require('express');var router=express[_0x2673('0x4')]();var fs_extra=require(_0x2673('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2673('0x6'));var config=require(_0x2673('0x7'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x2673('0x8')](),controller[_0x2673('0x9')]);router[_0x2673('0xa')](_0x2673('0xb'),auth[_0x2673('0x8')](),controller[_0x2673('0xc')]);router[_0x2673('0xd')]('/',auth[_0x2673('0x8')](),controller[_0x2673('0xe')]);router[_0x2673('0xf')](_0x2673('0xb'),auth[_0x2673('0x8')](),controller[_0x2673('0x10')]);router[_0x2673('0x11')](_0x2673('0xb'),auth[_0x2673('0x8')](),controller[_0x2673('0x12')]);module[_0x2673('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index bd8ed24..0e9f414 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 _0x3a68=['string','STRING','variable','BOOLEAN','exports','ENUM','customVariable','keyValue','picklist'];(function(_0x1e5189,_0x3b9660){var _0x468f18=function(_0x5ea5b2){while(--_0x5ea5b2){_0x1e5189['push'](_0x1e5189['shift']());}};_0x468f18(++_0x3b9660);}(_0x3a68,0x1c6));var _0x83a6=function(_0x3b92d6,_0x14af6b){_0x3b92d6=_0x3b92d6-0x0;var _0x138d74=_0x3a68[_0x3b92d6];return _0x138d74;};'use strict';var Sequelize=require('sequelize');module[_0x83a6('0x0')]={'type':{'type':Sequelize[_0x83a6('0x1')]('string','variable',_0x83a6('0x2'),_0x83a6('0x3'),_0x83a6('0x4')),'defaultValue':_0x83a6('0x5')},'content':{'type':Sequelize[_0x83a6('0x6')]},'key':{'type':Sequelize[_0x83a6('0x6')]},'keyType':{'type':Sequelize[_0x83a6('0x1')](_0x83a6('0x5'),_0x83a6('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x83a6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x83a6('0x6')]},'customField':{'type':Sequelize[_0x83a6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x83a6('0x6')]}}; \ No newline at end of file +var _0x230d=['sequelize','exports','ENUM','variable','keyValue','string','STRING','BOOLEAN'];(function(_0x4e0640,_0x27f42d){var _0x4cb735=function(_0x46b82d){while(--_0x46b82d){_0x4e0640['push'](_0x4e0640['shift']());}};_0x4cb735(++_0x27f42d);}(_0x230d,0xf8));var _0xd230=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x230d[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xd230('0x0'));module[_0xd230('0x1')]={'type':{'type':Sequelize[_0xd230('0x2')]('string',_0xd230('0x3'),'customVariable',_0xd230('0x4'),'picklist'),'defaultValue':_0xd230('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd230('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd230('0x6')]},'idField':{'type':Sequelize[_0xd230('0x6')]},'nameField':{'type':Sequelize[_0xd230('0x6')]},'customField':{'type':Sequelize[_0xd230('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd230('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 887c24b..cb7ec7a 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 _0xed08=['find','params','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','findAll','rows','length','include','catch','create','body'];(function(_0x532e19,_0x74ad39){var _0x189286=function(_0x33dd07){while(--_0x33dd07){_0x532e19['push'](_0x532e19['shift']());}};_0x189286(++_0x74ad39);}(_0xed08,0x165));var _0x8ed0=function(_0x3bea5a,_0x4cda93){_0x3bea5a=_0x3bea5a-0x0;var _0x4a9cb3=_0xed08[_0x3bea5a];return _0x4a9cb3;};'use strict';var emlformat=require(_0x8ed0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8ed0('0x1'));var rp=require(_0x8ed0('0x2'));var moment=require(_0x8ed0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8ed0('0x4'));var util=require(_0x8ed0('0x5'));var path=require(_0x8ed0('0x6'));var sox=require('sox');var csv=require(_0x8ed0('0x7'));var ejs=require(_0x8ed0('0x8'));var fs=require('fs');var fs_extra=require(_0x8ed0('0x9'));var _=require(_0x8ed0('0xa'));var squel=require(_0x8ed0('0xb'));var crypto=require(_0x8ed0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8ed0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8ed0('0xe'));var Papa=require(_0x8ed0('0xf'));var Redis=require(_0x8ed0('0x10'));var authService=require(_0x8ed0('0x11'));var qs=require(_0x8ed0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ed0('0x13'));var logger=require(_0x8ed0('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ed0('0x15'))['db'];function respondWithStatusCode(_0x337780,_0x2f5226){_0x2f5226=_0x2f5226||0xcc;return function(_0x5a5a80){if(_0x5a5a80){return _0x337780[_0x8ed0('0x16')](_0x2f5226);}return _0x337780[_0x8ed0('0x17')](_0x2f5226)['end']();};}function respondWithResult(_0x559b0e,_0x49ba5c){_0x49ba5c=_0x49ba5c||0xc8;return function(_0x478f7e){if(_0x478f7e){return _0x559b0e['status'](_0x49ba5c)[_0x8ed0('0x18')](_0x478f7e);}};}function respondWithFilteredResult(_0x5851f5,_0x234546){return function(_0x5c3420){if(_0x5c3420){var _0x17546c=typeof _0x234546[_0x8ed0('0x19')]===_0x8ed0('0x1a')&&typeof _0x234546[_0x8ed0('0x1b')]===_0x8ed0('0x1a');var _0x308880=_0x5c3420[_0x8ed0('0x1c')];var _0x7140e7=_0x17546c?0x0:_0x234546[_0x8ed0('0x19')];var _0x2cc809=_0x17546c?_0x5c3420['count']:_0x234546['offset']+_0x234546[_0x8ed0('0x1b')];var _0x3bd25b;if(_0x2cc809>=_0x308880){_0x2cc809=_0x308880;_0x3bd25b=0xc8;}else{_0x3bd25b=0xce;}_0x5851f5['status'](_0x3bd25b);return _0x5851f5[_0x8ed0('0x1d')](_0x8ed0('0x1e'),_0x7140e7+'-'+_0x2cc809+'/'+_0x308880)['json'](_0x5c3420);}return null;};}function patchUpdates(_0x15d70c){return function(_0x299679){try{jsonpatch[_0x8ed0('0x1f')](_0x299679,_0x15d70c,!![]);}catch(_0x3726dd){return BPromise[_0x8ed0('0x20')](_0x3726dd);}return _0x299679['save']();};}function saveUpdates(_0x448ea9,_0x3b5393){return function(_0x2cfa52){if(_0x2cfa52){return _0x2cfa52[_0x8ed0('0x21')](_0x448ea9)['then'](function(_0x595e76){return _0x595e76;});}return null;};}function removeEntity(_0x4d9780,_0x1c7f7e){return function(_0xfac628){if(_0xfac628){return _0xfac628[_0x8ed0('0x22')]()['then'](function(){_0x4d9780['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x336f49,_0x15a6fb){return function(_0x25842c){if(!_0x25842c){_0x336f49['sendStatus'](0x194);}return _0x25842c;};}function handleError(_0x34003f,_0x23eb59){_0x23eb59=_0x23eb59||0x1f4;return function(_0x32be63){logger[_0x8ed0('0x23')](_0x32be63['stack']);if(_0x32be63['name']){delete _0x32be63['name'];}_0x34003f['status'](_0x23eb59)[_0x8ed0('0x24')](_0x32be63);};}exports[_0x8ed0('0x25')]=function(_0x26c3d7,_0x50d503){var _0x42755b={},_0x17f3e8={},_0x27b922={'count':0x0,'rows':[]};var _0x787bb6=_[_0x8ed0('0x26')](db[_0x8ed0('0x27')][_0x8ed0('0x28')],function(_0x4d50be){return{'name':_0x4d50be[_0x8ed0('0x29')],'type':_0x4d50be[_0x8ed0('0x2a')][_0x8ed0('0x2b')]};});_0x17f3e8[_0x8ed0('0x2c')]=_[_0x8ed0('0x26')](_0x787bb6,'name');_0x17f3e8[_0x8ed0('0x2d')]=_[_0x8ed0('0x2e')](_0x26c3d7[_0x8ed0('0x2d')]);_0x17f3e8[_0x8ed0('0x2f')]=_[_0x8ed0('0x30')](_0x17f3e8[_0x8ed0('0x2c')],_0x17f3e8[_0x8ed0('0x2d')]);_0x42755b[_0x8ed0('0x31')]=_['intersection'](_0x17f3e8[_0x8ed0('0x2c')],qs[_0x8ed0('0x32')](_0x26c3d7['query']['fields']));_0x42755b[_0x8ed0('0x31')]=_0x42755b[_0x8ed0('0x31')]['length']?_0x42755b[_0x8ed0('0x31')]:_0x17f3e8[_0x8ed0('0x2c')];if(!_0x26c3d7['query'][_0x8ed0('0x33')](_0x8ed0('0x34'))){_0x42755b[_0x8ed0('0x1b')]=qs['limit'](_0x26c3d7[_0x8ed0('0x2d')]['limit']);_0x42755b[_0x8ed0('0x19')]=qs['offset'](_0x26c3d7[_0x8ed0('0x2d')]['offset']);}_0x42755b[_0x8ed0('0x35')]=qs[_0x8ed0('0x36')](_0x26c3d7['query']['sort']);_0x42755b[_0x8ed0('0x37')]=qs[_0x8ed0('0x2f')](_[_0x8ed0('0x38')](_0x26c3d7[_0x8ed0('0x2d')],_0x17f3e8[_0x8ed0('0x2f')]),_0x787bb6);if(_0x26c3d7[_0x8ed0('0x2d')][_0x8ed0('0x39')]){_0x42755b[_0x8ed0('0x37')]=_[_0x8ed0('0x3a')](_0x42755b['where'],{'$or':_[_0x8ed0('0x26')](_0x787bb6,function(_0x3cc34b){if(_0x3cc34b['type']!=='VIRTUAL'){var _0x4e417e={};_0x4e417e[_0x3cc34b['name']]={'$like':'%'+_0x26c3d7[_0x8ed0('0x2d')][_0x8ed0('0x39')]+'%'};return _0x4e417e;}})});}_0x42755b=_['merge']({},_0x42755b,_0x26c3d7[_0x8ed0('0x3b')]);var _0x1ea5ac={'where':_0x42755b[_0x8ed0('0x37')]};return db[_0x8ed0('0x27')]['count'](_0x1ea5ac)[_0x8ed0('0x3c')](function(_0x4949fe){_0x27b922[_0x8ed0('0x1c')]=_0x4949fe;if(_0x26c3d7[_0x8ed0('0x2d')][_0x8ed0('0x3d')]){_0x42755b['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x8ed0('0x3e')](_0x42755b);})[_0x8ed0('0x3c')](function(_0x3ce62b){_0x27b922[_0x8ed0('0x3f')]=_0x3ce62b;return _0x27b922;})[_0x8ed0('0x3c')](respondWithFilteredResult(_0x50d503,_0x42755b))['catch'](handleError(_0x50d503,null));};exports['show']=function(_0x7181a,_0x51320d){var _0x19c623={'raw':!![],'where':{'id':_0x7181a['params']['id']}},_0x3e9145={};_0x3e9145[_0x8ed0('0x2c')]=_[_0x8ed0('0x2e')](db[_0x8ed0('0x27')][_0x8ed0('0x28')]);_0x3e9145['query']=_[_0x8ed0('0x2e')](_0x7181a['query']);_0x3e9145['filters']=_[_0x8ed0('0x30')](_0x3e9145[_0x8ed0('0x2c')],_0x3e9145[_0x8ed0('0x2d')]);_0x19c623[_0x8ed0('0x31')]=_[_0x8ed0('0x30')](_0x3e9145['model'],qs[_0x8ed0('0x32')](_0x7181a[_0x8ed0('0x2d')][_0x8ed0('0x32')]));_0x19c623['attributes']=_0x19c623[_0x8ed0('0x31')][_0x8ed0('0x40')]?_0x19c623['attributes']:_0x3e9145[_0x8ed0('0x2c')];if(_0x7181a[_0x8ed0('0x2d')][_0x8ed0('0x3d')]){_0x19c623[_0x8ed0('0x41')]=[{'all':!![]}];}_0x19c623=_[_0x8ed0('0x3a')]({},_0x19c623,_0x7181a['options']);return db[_0x8ed0('0x27')]['find'](_0x19c623)[_0x8ed0('0x3c')](handleEntityNotFound(_0x51320d,null))[_0x8ed0('0x3c')](respondWithResult(_0x51320d,null))[_0x8ed0('0x42')](handleError(_0x51320d,null));};exports[_0x8ed0('0x43')]=function(_0x2c52b2,_0x5a71fc){return db[_0x8ed0('0x27')][_0x8ed0('0x43')](_0x2c52b2['body'],{})[_0x8ed0('0x3c')](respondWithResult(_0x5a71fc,0xc9))['catch'](handleError(_0x5a71fc,null));};exports['update']=function(_0x3df601,_0x151c63){if(_0x3df601[_0x8ed0('0x44')]['id']){delete _0x3df601['body']['id'];}return db[_0x8ed0('0x27')][_0x8ed0('0x45')]({'where':{'id':_0x3df601[_0x8ed0('0x46')]['id']}})[_0x8ed0('0x3c')](handleEntityNotFound(_0x151c63,null))['then'](saveUpdates(_0x3df601['body'],null))[_0x8ed0('0x3c')](respondWithResult(_0x151c63,null))[_0x8ed0('0x42')](handleError(_0x151c63,null));};exports[_0x8ed0('0x22')]=function(_0x178457,_0x14b8d5){return db['FreshsalesField']['find']({'where':{'id':_0x178457[_0x8ed0('0x46')]['id']}})[_0x8ed0('0x3c')](handleEntityNotFound(_0x14b8d5,null))[_0x8ed0('0x3c')](removeEntity(_0x14b8d5,null))[_0x8ed0('0x42')](handleError(_0x14b8d5,null));}; \ No newline at end of file +var _0xc643=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','FreshsalesField','includeAll','include','findAll','rows','catch','show','params','fields','options','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path'];(function(_0x44ddac,_0x2d8f15){var _0x47945a=function(_0x4b370b){while(--_0x4b370b){_0x44ddac['push'](_0x44ddac['shift']());}};_0x47945a(++_0x2d8f15);}(_0xc643,0x167));var _0x3c64=function(_0x5a4303,_0x2fa7e3){_0x5a4303=_0x5a4303-0x0;var _0x22b14d=_0xc643[_0x5a4303];return _0x22b14d;};'use strict';var emlformat=require(_0x3c64('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c64('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c64('0x2'));var Mustache=require(_0x3c64('0x3'));var util=require(_0x3c64('0x4'));var path=require(_0x3c64('0x5'));var sox=require(_0x3c64('0x6'));var csv=require(_0x3c64('0x7'));var ejs=require(_0x3c64('0x8'));var fs=require('fs');var fs_extra=require(_0x3c64('0x9'));var _=require(_0x3c64('0xa'));var squel=require(_0x3c64('0xb'));var crypto=require(_0x3c64('0xc'));var jsforce=require(_0x3c64('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3c64('0x7'));var querystring=require(_0x3c64('0xe'));var Papa=require(_0x3c64('0xf'));var Redis=require(_0x3c64('0x10'));var authService=require(_0x3c64('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c64('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c64('0x13'))(_0x3c64('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3c64('0x15'));var db=require(_0x3c64('0x16'))['db'];function respondWithStatusCode(_0x46295c,_0x1bdf31){_0x1bdf31=_0x1bdf31||0xcc;return function(_0x4be149){if(_0x4be149){return _0x46295c[_0x3c64('0x17')](_0x1bdf31);}return _0x46295c[_0x3c64('0x18')](_0x1bdf31)[_0x3c64('0x19')]();};}function respondWithResult(_0x402c5c,_0x22c187){_0x22c187=_0x22c187||0xc8;return function(_0x5ac2d4){if(_0x5ac2d4){return _0x402c5c[_0x3c64('0x18')](_0x22c187)[_0x3c64('0x1a')](_0x5ac2d4);}};}function respondWithFilteredResult(_0x5d83ca,_0x5739c4){return function(_0x4ef425){if(_0x4ef425){var _0x420110=typeof _0x5739c4[_0x3c64('0x1b')]==='undefined'&&typeof _0x5739c4[_0x3c64('0x1c')]===_0x3c64('0x1d');var _0x518a88=_0x4ef425['count'];var _0x3696b=_0x420110?0x0:_0x5739c4[_0x3c64('0x1b')];var _0x11342f=_0x420110?_0x4ef425[_0x3c64('0x1e')]:_0x5739c4[_0x3c64('0x1b')]+_0x5739c4[_0x3c64('0x1c')];var _0x26c627;if(_0x11342f>=_0x518a88){_0x11342f=_0x518a88;_0x26c627=0xc8;}else{_0x26c627=0xce;}_0x5d83ca[_0x3c64('0x18')](_0x26c627);return _0x5d83ca[_0x3c64('0x1f')]('Content-Range',_0x3696b+'-'+_0x11342f+'/'+_0x518a88)[_0x3c64('0x1a')](_0x4ef425);}return null;};}function patchUpdates(_0x3a18d1){return function(_0x1c2752){try{jsonpatch['apply'](_0x1c2752,_0x3a18d1,!![]);}catch(_0x45b34e){return BPromise[_0x3c64('0x20')](_0x45b34e);}return _0x1c2752[_0x3c64('0x21')]();};}function saveUpdates(_0x360c15,_0x902307){return function(_0x2f6949){if(_0x2f6949){return _0x2f6949[_0x3c64('0x22')](_0x360c15)[_0x3c64('0x23')](function(_0x3083e1){return _0x3083e1;});}return null;};}function removeEntity(_0x236d33,_0x435879){return function(_0x35a62f){if(_0x35a62f){return _0x35a62f[_0x3c64('0x24')]()[_0x3c64('0x23')](function(){_0x236d33['status'](0xcc)[_0x3c64('0x19')]();});}};}function handleEntityNotFound(_0x43638e,_0x51cc14){return function(_0x4e5418){if(!_0x4e5418){_0x43638e[_0x3c64('0x17')](0x194);}return _0x4e5418;};}function handleError(_0x35a713,_0x161f9a){_0x161f9a=_0x161f9a||0x1f4;return function(_0x1dc2cb){logger[_0x3c64('0x25')](_0x1dc2cb[_0x3c64('0x26')]);if(_0x1dc2cb[_0x3c64('0x27')]){delete _0x1dc2cb[_0x3c64('0x27')];}_0x35a713[_0x3c64('0x18')](_0x161f9a)[_0x3c64('0x28')](_0x1dc2cb);};}exports[_0x3c64('0x29')]=function(_0x2550db,_0x564805){var _0x51faee={},_0x548d07={},_0x12b1cb={'count':0x0,'rows':[]};var _0x2a61cc=_[_0x3c64('0x2a')](db['FreshsalesField'][_0x3c64('0x2b')],function(_0x4dece0){return{'name':_0x4dece0[_0x3c64('0x2c')],'type':_0x4dece0['type'][_0x3c64('0x2d')]};});_0x548d07[_0x3c64('0x2e')]=_[_0x3c64('0x2a')](_0x2a61cc,'name');_0x548d07[_0x3c64('0x2f')]=_[_0x3c64('0x30')](_0x2550db[_0x3c64('0x2f')]);_0x548d07['filters']=_[_0x3c64('0x31')](_0x548d07[_0x3c64('0x2e')],_0x548d07[_0x3c64('0x2f')]);_0x51faee[_0x3c64('0x32')]=_[_0x3c64('0x31')](_0x548d07['model'],qs['fields'](_0x2550db[_0x3c64('0x2f')]['fields']));_0x51faee[_0x3c64('0x32')]=_0x51faee[_0x3c64('0x32')][_0x3c64('0x33')]?_0x51faee[_0x3c64('0x32')]:_0x548d07[_0x3c64('0x2e')];if(!_0x2550db[_0x3c64('0x2f')][_0x3c64('0x34')]('nolimit')){_0x51faee[_0x3c64('0x1c')]=qs[_0x3c64('0x1c')](_0x2550db['query'][_0x3c64('0x1c')]);_0x51faee['offset']=qs[_0x3c64('0x1b')](_0x2550db['query']['offset']);}_0x51faee['order']=qs[_0x3c64('0x35')](_0x2550db[_0x3c64('0x2f')]['sort']);_0x51faee[_0x3c64('0x36')]=qs[_0x3c64('0x37')](_[_0x3c64('0x38')](_0x2550db['query'],_0x548d07[_0x3c64('0x37')]),_0x2a61cc);if(_0x2550db[_0x3c64('0x2f')][_0x3c64('0x39')]){_0x51faee['where']=_[_0x3c64('0x3a')](_0x51faee[_0x3c64('0x36')],{'$or':_[_0x3c64('0x2a')](_0x2a61cc,function(_0x5247a1){if(_0x5247a1[_0x3c64('0x3b')]!==_0x3c64('0x3c')){var _0xdca4c2={};_0xdca4c2[_0x5247a1[_0x3c64('0x27')]]={'$like':'%'+_0x2550db[_0x3c64('0x2f')][_0x3c64('0x39')]+'%'};return _0xdca4c2;}})});}_0x51faee=_[_0x3c64('0x3a')]({},_0x51faee,_0x2550db['options']);var _0x1b4755={'where':_0x51faee[_0x3c64('0x36')]};return db[_0x3c64('0x3d')][_0x3c64('0x1e')](_0x1b4755)[_0x3c64('0x23')](function(_0x5339c4){_0x12b1cb[_0x3c64('0x1e')]=_0x5339c4;if(_0x2550db[_0x3c64('0x2f')][_0x3c64('0x3e')]){_0x51faee[_0x3c64('0x3f')]=[{'all':!![]}];}return db['FreshsalesField'][_0x3c64('0x40')](_0x51faee);})[_0x3c64('0x23')](function(_0x4f762d){_0x12b1cb[_0x3c64('0x41')]=_0x4f762d;return _0x12b1cb;})[_0x3c64('0x23')](respondWithFilteredResult(_0x564805,_0x51faee))[_0x3c64('0x42')](handleError(_0x564805,null));};exports[_0x3c64('0x43')]=function(_0xbf6bde,_0x2506d2){var _0x49bcdd={'raw':!![],'where':{'id':_0xbf6bde[_0x3c64('0x44')]['id']}},_0x21d05c={};_0x21d05c[_0x3c64('0x2e')]=_[_0x3c64('0x30')](db[_0x3c64('0x3d')][_0x3c64('0x2b')]);_0x21d05c[_0x3c64('0x2f')]=_[_0x3c64('0x30')](_0xbf6bde[_0x3c64('0x2f')]);_0x21d05c['filters']=_[_0x3c64('0x31')](_0x21d05c[_0x3c64('0x2e')],_0x21d05c['query']);_0x49bcdd[_0x3c64('0x32')]=_['intersection'](_0x21d05c[_0x3c64('0x2e')],qs['fields'](_0xbf6bde[_0x3c64('0x2f')][_0x3c64('0x45')]));_0x49bcdd[_0x3c64('0x32')]=_0x49bcdd[_0x3c64('0x32')][_0x3c64('0x33')]?_0x49bcdd['attributes']:_0x21d05c[_0x3c64('0x2e')];if(_0xbf6bde[_0x3c64('0x2f')][_0x3c64('0x3e')]){_0x49bcdd[_0x3c64('0x3f')]=[{'all':!![]}];}_0x49bcdd=_['merge']({},_0x49bcdd,_0xbf6bde[_0x3c64('0x46')]);return db[_0x3c64('0x3d')]['find'](_0x49bcdd)[_0x3c64('0x23')](handleEntityNotFound(_0x2506d2,null))[_0x3c64('0x23')](respondWithResult(_0x2506d2,null))[_0x3c64('0x42')](handleError(_0x2506d2,null));};exports['create']=function(_0x84f4a,_0x4d5f7f){return db[_0x3c64('0x3d')][_0x3c64('0x47')](_0x84f4a[_0x3c64('0x48')],{})[_0x3c64('0x23')](respondWithResult(_0x4d5f7f,0xc9))[_0x3c64('0x42')](handleError(_0x4d5f7f,null));};exports['update']=function(_0x39ec14,_0x174581){if(_0x39ec14[_0x3c64('0x48')]['id']){delete _0x39ec14[_0x3c64('0x48')]['id'];}return db[_0x3c64('0x3d')]['find']({'where':{'id':_0x39ec14[_0x3c64('0x44')]['id']}})['then'](handleEntityNotFound(_0x174581,null))['then'](saveUpdates(_0x39ec14[_0x3c64('0x48')],null))[_0x3c64('0x23')](respondWithResult(_0x174581,null))[_0x3c64('0x42')](handleError(_0x174581,null));};exports['destroy']=function(_0x3bbe0c,_0x24d28b){return db[_0x3c64('0x3d')]['find']({'where':{'id':_0x3bbe0c[_0x3c64('0x44')]['id']}})[_0x3c64('0x23')](handleEntityNotFound(_0x24d28b,null))[_0x3c64('0x23')](removeEntity(_0x24d28b,null))['catch'](handleError(_0x24d28b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 32ad5d5..6b3c8ce 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 _0x3e22=['util','api','moment','bluebird','request-promise','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId'];(function(_0x33220c,_0x2d3eda){var _0x55c595=function(_0x1b5abd){while(--_0x1b5abd){_0x33220c['push'](_0x33220c['shift']());}};_0x55c595(++_0x2d3eda);}(_0x3e22,0xa8));var _0x23e2=function(_0x4f84e4,_0x2dc37c){_0x4f84e4=_0x4f84e4-0x0;var _0x1a372a=_0x3e22[_0x4f84e4];return _0x1a372a;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var logger=require('../../config/logger')(_0x23e2('0x1'));var moment=require(_0x23e2('0x2'));var BPromise=require(_0x23e2('0x3'));var rp=require(_0x23e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23e2('0x5'));var attributes=require(_0x23e2('0x6'));module['exports']=function(_0x287f8f,_0x433a85){return _0x287f8f[_0x23e2('0x7')](_0x23e2('0x8'),attributes,{'tableName':_0x23e2('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x23e2('0xa'),_0x23e2('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c99=['idField','FieldId','lodash','../../config/logger','request-promise','path','../../config/environment','./intFreshsalesField.attributes','int_freshsales_fields','freshsales_unique_index'];(function(_0x56de02,_0x52a0f9){var _0x27d111=function(_0x4e8b0f){while(--_0x4e8b0f){_0x56de02['push'](_0x56de02['shift']());}};_0x27d111(++_0x52a0f9);}(_0x4c99,0x1ec));var _0x94c9=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x4c99[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var logger=require(_0x94c9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x94c9('0x2'));var fs=require('fs');var path=require(_0x94c9('0x3'));var rimraf=require('rimraf');var config=require(_0x94c9('0x4'));var attributes=require(_0x94c9('0x5'));module['exports']=function(_0x42d25e,_0x4e4ffd){return _0x42d25e['define']('FreshsalesField',attributes,{'tableName':_0x94c9('0x6'),'paranoid':![],'indexes':[{'name':_0x94c9('0x7'),'fields':[_0x94c9('0x8'),_0x94c9('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index fb30c5f..2864963 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 _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x9684f8,_0x59467a){var _0x3fc06f=function(_0x33175d){while(--_0x33175d){_0x9684f8['push'](_0x9684f8['shift']());}};_0x3fc06f(++_0x59467a);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5e3217,_0x1991db){_0x5e3217=_0x5e3217-0x0;var _0x1b413c=_0xdbf5[_0x5e3217];return _0x1b413c;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file +var _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4e687f,_0x18dcae){var _0x3f7cf2=function(_0x106a4e){while(--_0x106a4e){_0x4e687f['push'](_0x4e687f['shift']());}};_0x3f7cf2(++_0x18dcae);}(_0x5496,0x175));var _0x6549=function(_0x56cf72,_0x3e3dc8){_0x56cf72=_0x56cf72-0x0;var _0x2f21f7=_0x5496[_0x56cf72];return _0x2f21f7;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c0afae0..a463414 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5fd016,_0x2d9cf4){var _0x92e1be=function(_0x35df9f){while(--_0x35df9f){_0x5fd016['push'](_0x5fd016['shift']());}};_0x92e1be(++_0x2d9cf4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x6b6708,_0x2c0015){var _0x19ef5a=function(_0x1b483e){while(--_0x1b483e){_0x6b6708['push'](_0x6b6708['shift']());}};_0x19ef5a(++_0x2c0015);}(_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/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 597c379..9ecbd47 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 _0x2ace=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x4bcf1a,_0xdb12cd){var _0x208dec=function(_0x117f40){while(--_0x117f40){_0x4bcf1a['push'](_0x4bcf1a['shift']());}};_0x208dec(++_0xdb12cd);}(_0x2ace,0x17e));var _0xe2ac=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x2ace[_0x3d13bb];return _0x4b5a1b;};'use strict';var Sequelize=require('sequelize');module[_0xe2ac('0x0')]={'name':{'type':Sequelize[_0xe2ac('0x1')]},'description':{'type':Sequelize[_0xe2ac('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xe2ac('0x2')},'remoteUri':{'type':Sequelize[_0xe2ac('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe2ac('0x1')]},'clientSecret':{'type':Sequelize[_0xe2ac('0x1')]},'securityToken':{'type':Sequelize[_0xe2ac('0x1')]},'serverUrl':{'type':Sequelize[_0xe2ac('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe2ac('0x3')](_0xe2ac('0x4'),_0xe2ac('0x5')),'defaultValue':_0xe2ac('0x4')}}; \ No newline at end of file +var _0x14c7=['username','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x2456f7,_0x33072b){var _0x196522=function(_0x37c716){while(--_0x37c716){_0x2456f7['push'](_0x2456f7['shift']());}};_0x196522(++_0x33072b);}(_0x14c7,0x1d9));var _0x714c=function(_0x1a9942,_0x16d488){_0x1a9942=_0x1a9942-0x0;var _0x33fbd8=_0x14c7[_0x1a9942];return _0x33fbd8;};'use strict';var Sequelize=require(_0x714c('0x0'));module[_0x714c('0x1')]={'name':{'type':Sequelize[_0x714c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x714c('0x2')],'unique':_0x714c('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x714c('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x714c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x714c('0x4')](_0x714c('0x5'),_0x714c('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index ff4fe3f..31fc03d 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 _0xc00c=['lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','custom','picklistValues','label','value','True','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','destroy','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','include','SalesforceAccount','rows','catch','show','params','length','options','find','create','update','body','getConfigurations','findOne','sort','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice'];(function(_0x43ef21,_0x58be50){var _0x22e2d3=function(_0x196809){while(--_0x196809){_0x43ef21['push'](_0x43ef21['shift']());}};_0x22e2d3(++_0x58be50);}(_0xc00c,0xa0));var _0xcc00=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xc00c[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0xcc00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc00('0x1'));var jsonpatch=require(_0xcc00('0x2'));var rp=require(_0xcc00('0x3'));var moment=require(_0xcc00('0x4'));var BPromise=require(_0xcc00('0x5'));var Mustache=require('mustache');var util=require(_0xcc00('0x6'));var path=require('path');var sox=require(_0xcc00('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc00('0x8'));var _=require(_0xcc00('0x9'));var squel=require(_0xcc00('0xa'));var crypto=require(_0xcc00('0xb'));var jsforce=require(_0xcc00('0xc'));var deskjs=require(_0xcc00('0xd'));var toCsv=require(_0xcc00('0xe'));var querystring=require(_0xcc00('0xf'));var Papa=require(_0xcc00('0x10'));var Redis=require(_0xcc00('0x11'));var authService=require(_0xcc00('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc00('0x13'));var logger=require(_0xcc00('0x14'))(_0xcc00('0x15'));var utils=require(_0xcc00('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcc00('0x17'));var db=require(_0xcc00('0x18'))['db'];var integrations=require(_0xcc00('0x19'));function respondWithStatusCode(_0x35a815,_0x4b65fe){_0x4b65fe=_0x4b65fe||0xcc;return function(_0x61d3e3){if(_0x61d3e3){return _0x35a815[_0xcc00('0x1a')](_0x4b65fe);}return _0x35a815['status'](_0x4b65fe)['end']();};}function respondWithResult(_0x3ab3df,_0x3a8eb8){_0x3a8eb8=_0x3a8eb8||0xc8;return function(_0x3b7938){if(_0x3b7938){return _0x3ab3df[_0xcc00('0x1b')](_0x3a8eb8)[_0xcc00('0x1c')](_0x3b7938);}};}function respondWithFilteredResult(_0x2e7546,_0x82497b){return function(_0x20a434){if(_0x20a434){var _0x20a632=typeof _0x82497b[_0xcc00('0x1d')]===_0xcc00('0x1e')&&typeof _0x82497b[_0xcc00('0x1f')]===_0xcc00('0x1e');var _0x2dab6b=_0x20a434[_0xcc00('0x20')];var _0x57b21a=_0x20a632?0x0:_0x82497b['offset'];var _0x177e90=_0x20a632?_0x20a434['count']:_0x82497b[_0xcc00('0x1d')]+_0x82497b[_0xcc00('0x1f')];var _0x425bea;if(_0x177e90>=_0x2dab6b){_0x177e90=_0x2dab6b;_0x425bea=0xc8;}else{_0x425bea=0xce;}_0x2e7546[_0xcc00('0x1b')](_0x425bea);return _0x2e7546[_0xcc00('0x21')]('Content-Range',_0x57b21a+'-'+_0x177e90+'/'+_0x2dab6b)['json'](_0x20a434);}return null;};}function patchUpdates(_0x22e4f0){return function(_0x3cd153){try{jsonpatch[_0xcc00('0x22')](_0x3cd153,_0x22e4f0,!![]);}catch(_0x2d4587){return BPromise[_0xcc00('0x23')](_0x2d4587);}return _0x3cd153['save']();};}function saveUpdates(_0x26f5d9,_0x90a08b){return function(_0x17b550){if(_0x17b550){return _0x17b550['update'](_0x26f5d9)['then'](function(_0x532df1){return _0x532df1;});}return null;};}function removeEntity(_0x20079e,_0x453151){return function(_0x2e7515){if(_0x2e7515){return _0x2e7515[_0xcc00('0x24')]()[_0xcc00('0x25')](function(){_0x20079e[_0xcc00('0x1b')](0xcc)[_0xcc00('0x26')]();});}};}function handleEntityNotFound(_0x412439,_0x2efb04){return function(_0x1a630a){if(!_0x1a630a){_0x412439[_0xcc00('0x1a')](0x194);}return _0x1a630a;};}function handleError(_0x274d40,_0x15bea5){_0x15bea5=_0x15bea5||0x1f4;return function(_0x1d30a5){logger['error'](_0x1d30a5[_0xcc00('0x27')]);if(_0x1d30a5[_0xcc00('0x28')]){delete _0x1d30a5[_0xcc00('0x28')];}_0x274d40[_0xcc00('0x1b')](_0x15bea5)[_0xcc00('0x29')](_0x1d30a5);};}exports[_0xcc00('0x2a')]=function(_0x1795f8,_0x355232){var _0x24cab3={},_0x151812={},_0x10ff31={'count':0x0,'rows':[]};var _0x52a90d=_[_0xcc00('0x2b')](db['SalesforceAccount'][_0xcc00('0x2c')],function(_0x4e88db){return{'name':_0x4e88db[_0xcc00('0x2d')],'type':_0x4e88db[_0xcc00('0x2e')][_0xcc00('0x2f')]};});_0x151812['model']=_[_0xcc00('0x2b')](_0x52a90d,_0xcc00('0x28'));_0x151812['query']=_[_0xcc00('0x30')](_0x1795f8[_0xcc00('0x31')]);_0x151812[_0xcc00('0x32')]=_[_0xcc00('0x33')](_0x151812[_0xcc00('0x34')],_0x151812[_0xcc00('0x31')]);_0x24cab3[_0xcc00('0x35')]=_[_0xcc00('0x33')](_0x151812[_0xcc00('0x34')],qs['fields'](_0x1795f8[_0xcc00('0x31')][_0xcc00('0x36')]));_0x24cab3['attributes']=_0x24cab3['attributes']['length']?_0x24cab3[_0xcc00('0x35')]:_0x151812[_0xcc00('0x34')];if(!_0x1795f8[_0xcc00('0x31')][_0xcc00('0x37')](_0xcc00('0x38'))){_0x24cab3['limit']=qs[_0xcc00('0x1f')](_0x1795f8[_0xcc00('0x31')]['limit']);_0x24cab3[_0xcc00('0x1d')]=qs[_0xcc00('0x1d')](_0x1795f8[_0xcc00('0x31')][_0xcc00('0x1d')]);}_0x24cab3[_0xcc00('0x39')]=qs['sort'](_0x1795f8[_0xcc00('0x31')]['sort']);_0x24cab3[_0xcc00('0x3a')]=qs[_0xcc00('0x32')](_[_0xcc00('0x3b')](_0x1795f8[_0xcc00('0x31')],_0x151812[_0xcc00('0x32')]),_0x52a90d);if(_0x1795f8[_0xcc00('0x31')]['filter']){_0x24cab3['where']=_['merge'](_0x24cab3[_0xcc00('0x3a')],{'$or':_[_0xcc00('0x2b')](_0x52a90d,function(_0x45a889){if(_0x45a889[_0xcc00('0x2e')]!=='VIRTUAL'){var _0x384aa7={};_0x384aa7[_0x45a889[_0xcc00('0x28')]]={'$like':'%'+_0x1795f8[_0xcc00('0x31')][_0xcc00('0x3c')]+'%'};return _0x384aa7;}})});}_0x24cab3=_[_0xcc00('0x3d')]({},_0x24cab3,_0x1795f8['options']);var _0xc7a9ed={'where':_0x24cab3[_0xcc00('0x3a')]};return db['SalesforceAccount']['count'](_0xc7a9ed)[_0xcc00('0x25')](function(_0x2019d4){_0x10ff31[_0xcc00('0x20')]=_0x2019d4;if(_0x1795f8[_0xcc00('0x31')][_0xcc00('0x3e')]){_0x24cab3[_0xcc00('0x3f')]=[{'all':!![]}];}return db[_0xcc00('0x40')]['findAll'](_0x24cab3);})[_0xcc00('0x25')](function(_0x5a970e){_0x10ff31[_0xcc00('0x41')]=_0x5a970e;return _0x10ff31;})[_0xcc00('0x25')](respondWithFilteredResult(_0x355232,_0x24cab3))[_0xcc00('0x42')](handleError(_0x355232,null));};exports[_0xcc00('0x43')]=function(_0x2ba52f,_0x49a47c){var _0x260aaa={'raw':![],'where':{'id':_0x2ba52f[_0xcc00('0x44')]['id']}},_0xaae8ba={};_0xaae8ba[_0xcc00('0x34')]=_[_0xcc00('0x30')](db[_0xcc00('0x40')][_0xcc00('0x2c')]);_0xaae8ba[_0xcc00('0x31')]=_[_0xcc00('0x30')](_0x2ba52f[_0xcc00('0x31')]);_0xaae8ba['filters']=_['intersection'](_0xaae8ba[_0xcc00('0x34')],_0xaae8ba[_0xcc00('0x31')]);_0x260aaa[_0xcc00('0x35')]=_['intersection'](_0xaae8ba[_0xcc00('0x34')],qs[_0xcc00('0x36')](_0x2ba52f[_0xcc00('0x31')]['fields']));_0x260aaa[_0xcc00('0x35')]=_0x260aaa[_0xcc00('0x35')][_0xcc00('0x45')]?_0x260aaa['attributes']:_0xaae8ba['model'];if(_0x2ba52f[_0xcc00('0x31')][_0xcc00('0x3e')]){_0x260aaa['include']=[{'all':!![]}];}_0x260aaa=_[_0xcc00('0x3d')]({},_0x260aaa,_0x2ba52f[_0xcc00('0x46')]);return db[_0xcc00('0x40')][_0xcc00('0x47')](_0x260aaa)[_0xcc00('0x25')](handleEntityNotFound(_0x49a47c,null))['then'](respondWithResult(_0x49a47c,null))[_0xcc00('0x42')](handleError(_0x49a47c,null));};exports['create']=function(_0x31251c,_0x24d1b9){return db[_0xcc00('0x40')][_0xcc00('0x48')](_0x31251c['body'],{})['then'](respondWithResult(_0x24d1b9,0xc9))[_0xcc00('0x42')](handleError(_0x24d1b9,null));};exports[_0xcc00('0x49')]=function(_0x562689,_0x4db0c2){if(_0x562689[_0xcc00('0x4a')]['id']){delete _0x562689['body']['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x562689[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x4db0c2,null))[_0xcc00('0x25')](saveUpdates(_0x562689['body'],null))[_0xcc00('0x25')](respondWithResult(_0x4db0c2,null))['catch'](handleError(_0x4db0c2,null));};exports[_0xcc00('0x24')]=function(_0x1bc6f8,_0x394bdd){return db['SalesforceAccount'][_0xcc00('0x47')]({'where':{'id':_0x1bc6f8[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x394bdd,null))[_0xcc00('0x25')](removeEntity(_0x394bdd,null))[_0xcc00('0x42')](handleError(_0x394bdd,null));};exports[_0xcc00('0x4b')]=function(_0x1ccfab,_0x2c3541,_0x15e4fc){var _0x2b09e1={};var _0x5ed511={};var _0x64c25a;var _0x30881b;return db[_0xcc00('0x40')][_0xcc00('0x4c')]({'where':{'id':_0x1ccfab[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x2c3541,null))[_0xcc00('0x25')](function(_0x2b3830){if(_0x2b3830){_0x64c25a=_0x2b3830;_0x5ed511[_0xcc00('0x34')]=_['keys'](db['SalesforceConfiguration'][_0xcc00('0x2c')]);_0x5ed511[_0xcc00('0x31')]=_['keys'](_0x1ccfab['query']);_0x5ed511[_0xcc00('0x32')]=_['intersection'](_0x5ed511[_0xcc00('0x34')],_0x5ed511[_0xcc00('0x31')]);_0x2b09e1['attributes']=_[_0xcc00('0x33')](_0x5ed511[_0xcc00('0x34')],qs['fields'](_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x36')]));_0x2b09e1[_0xcc00('0x35')]=_0x2b09e1[_0xcc00('0x35')][_0xcc00('0x45')]?_0x2b09e1[_0xcc00('0x35')]:_0x5ed511['model'];_0x2b09e1[_0xcc00('0x39')]=qs[_0xcc00('0x4d')](_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x4d')]);_0x2b09e1[_0xcc00('0x3a')]=qs['filters'](_[_0xcc00('0x3b')](_0x1ccfab[_0xcc00('0x31')],_0x5ed511[_0xcc00('0x32')]));if(_0x1ccfab[_0xcc00('0x31')]['filter']){_0x2b09e1[_0xcc00('0x3a')]=_[_0xcc00('0x3d')](_0x2b09e1[_0xcc00('0x3a')],{'$or':_[_0xcc00('0x2b')](_0x2b09e1[_0xcc00('0x35')],function(_0x426ea5){var _0xd068d2={};_0xd068d2[_0x426ea5]={'$like':'%'+_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x3c')]+'%'};return _0xd068d2;})});}_0x2b09e1=_[_0xcc00('0x3d')]({},_0x2b09e1,_0x1ccfab[_0xcc00('0x46')]);return _0x64c25a['getConfigurations'](_0x2b09e1);}})['then'](function(_0x4c5dad){if(_0x4c5dad){_0x30881b=_0x4c5dad[_0xcc00('0x45')];if(!_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x37')]('nolimit')){_0x2b09e1[_0xcc00('0x1f')]=qs[_0xcc00('0x1f')](_0x1ccfab[_0xcc00('0x31')]['limit']);_0x2b09e1[_0xcc00('0x1d')]=qs[_0xcc00('0x1d')](_0x1ccfab['query'][_0xcc00('0x1d')]);}return _0x64c25a['getConfigurations'](_0x2b09e1);}})[_0xcc00('0x25')](function(_0x140bdd){if(_0x140bdd){return _0x140bdd?{'count':_0x30881b,'rows':_0x140bdd}:null;}})[_0xcc00('0x25')](respondWithResult(_0x2c3541,null))[_0xcc00('0x42')](handleError(_0x2c3541,null));};exports[_0xcc00('0x4e')]=function(_0x34c90f,_0x373537,_0x5dd95b){if(_0x34c90f[_0xcc00('0x4a')]['id']){delete _0x34c90f['body']['id'];}return db[_0xcc00('0x40')][_0xcc00('0x4c')]({'where':{'id':_0x34c90f[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x373537,null))[_0xcc00('0x25')](function(_0x50f0a6){if(_0x50f0a6){_0x34c90f[_0xcc00('0x4a')]['AccountId']=_0x50f0a6['id'];_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x4f')]=integrations[_0xcc00('0x50')](_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x51')],_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x2e')]);_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x52')]=integrations[_0xcc00('0x53')](_0x34c90f['body'][_0xcc00('0x51')],_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x2e')]);return db[_0xcc00('0x54')]['create'](_0x34c90f[_0xcc00('0x4a')],{'include':[{'model':db[_0xcc00('0x55')],'as':_0xcc00('0x4f')},{'model':db[_0xcc00('0x55')],'as':'Descriptions'}]});}return null;})[_0xcc00('0x25')](respondWithResult(_0x373537,null))[_0xcc00('0x42')](handleError(_0x373537,null));};exports[_0xcc00('0x56')]=function(_0x4dcd50,_0x3afa13,_0x37f162){var _0x4bf521;var _0x108950='';var _0x1ceb3e=_0xcc00('0x57');return db['SalesforceAccount'][_0xcc00('0x4c')]({'where':{'id':_0x4dcd50[_0xcc00('0x44')]['id']},'attributes':['id',_0xcc00('0x58'),_0xcc00('0x59'),_0xcc00('0x5a'),'username',_0xcc00('0x5b'),_0xcc00('0x5c')]})[_0xcc00('0x25')](handleEntityNotFound(_0x3afa13,null))['then'](function(_0x2bb9bb){if(_0x2bb9bb){_0x108950=_0x2bb9bb[_0xcc00('0x58')];var _0xfcb0cf=_0x108950[_0xcc00('0x5d')](-0x1);if(_0xfcb0cf==='/'){_0x108950=_0x108950['substring'](0x0,_0x108950[_0xcc00('0x5e')](_0xfcb0cf));}_0x4bf521=new jsforce[(_0xcc00('0x5f'))]({'oauth2':{'loginUrl':_0x108950,'clientId':_0x2bb9bb[_0xcc00('0x59')],'clientSecret':_0x2bb9bb['clientSecret']}});return _0x4bf521[_0xcc00('0x60')](_0x2bb9bb['username'],_0x2bb9bb[_0xcc00('0x5b')][_0xcc00('0x61')](_0x2bb9bb['securityToken']));}})[_0xcc00('0x25')](function(_0x2fb945){if(_0x2fb945){if(!_[_0xcc00('0x62')](_0x4dcd50[_0xcc00('0x31')]['ticketType'])){_0x1ceb3e=_0x4dcd50[_0xcc00('0x31')][_0xcc00('0x63')];}return _0x4bf521[_0xcc00('0x64')](_0x1ceb3e)['describe']();}})[_0xcc00('0x25')](function(_0xa1318d){var _0x1a0320=[_0xcc00('0x65'),_0xcc00('0x66'),_0xcc00('0x67'),_0xcc00('0x68'),_0xcc00('0x69'),_0xcc00('0x6a')];var _0x390fbf=[_0xcc00('0x6b'),_0xcc00('0x6c'),_0xcc00('0x6d'),_0xcc00('0x6e'),_0xcc00('0x6f'),_0xcc00('0x70'),_0xcc00('0x71')];if(_0xa1318d){_['remove'](_0xa1318d[_0xcc00('0x36')],function(_0x4ec058){return _0x1a0320['includes'](_0x4ec058[_0xcc00('0x28')])||!_0x390fbf['includes'](_0x4ec058[_0xcc00('0x2e')]);});return{'count':_0xa1318d[_0xcc00('0x36')][_0xcc00('0x45')],'rows':_['map'](_0xa1318d[_0xcc00('0x36')],function(_0x5a15c0){return{'id':_0x5a15c0[_0xcc00('0x28')],'name':_0x5a15c0['label'],'custom':_0x5a15c0[_0xcc00('0x72')],'options':_0x5a15c0['picklistValues'][_0xcc00('0x45')]>0x0?_['map'](_0x5a15c0[_0xcc00('0x73')],function(_0x4440c5){return{'name':_0x4440c5[_0xcc00('0x74')],'value':_0x4440c5[_0xcc00('0x75')]};}):_0x5a15c0[_0xcc00('0x2e')]==_0xcc00('0x6e')?[{'name':_0xcc00('0x76'),'value':_0xcc00('0x77')},{'name':_0xcc00('0x78'),'value':_0xcc00('0x79')}]:[]};})};}})['then'](respondWithResult(_0x3afa13,null))[_0xcc00('0x42')](function(_0x2e01fe){var _0x5b7a78=_0x4dcd50[_0xcc00('0x31')][_0xcc00('0x7a')]?0x1f4:_0x2e01fe[_0xcc00('0x7b')]||0x1f4;logger[_0xcc00('0x7c')](_0xcc00('0x7d'),_0xcc00('0x56'),_0x5b7a78,JSON[_0xcc00('0x7e')](_0x2e01fe));delete _0x2e01fe[_0xcc00('0x28')];if(_0x5b7a78===0x191){_0x5b7a78=0x190;}_0x3afa13[_0xcc00('0x1b')](_0x5b7a78)[_0xcc00('0x29')](_0x4dcd50[_0xcc00('0x31')][_0xcc00('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x2e01fe[_0xcc00('0x7b')]}:_0x2e01fe);});}; \ No newline at end of file +var _0x50de=['concat','ticketType','sobject','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','remove','includes','custom','picklistValues','label','value','True','true','False','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','save','then','destroy','name','send','map','SalesforceAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','merge','body','update','find','getConfigurations','findOne','SalesforceConfiguration','filter','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','create','SalesforceField','Subjects','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection'];(function(_0x3f16d2,_0x5ceebf){var _0xf57f6d=function(_0x311cf2){while(--_0x311cf2){_0x3f16d2['push'](_0x3f16d2['shift']());}};_0xf57f6d(++_0x5ceebf);}(_0x50de,0x95));var _0xe50d=function(_0x55a802,_0x10ab3a){_0x55a802=_0x55a802-0x0;var _0x1a0461=_0x50de[_0x55a802];return _0x1a0461;};'use strict';var emlformat=require(_0xe50d('0x0'));var rimraf=require(_0xe50d('0x1'));var zipdir=require(_0xe50d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe50d('0x3'));var BPromise=require(_0xe50d('0x4'));var Mustache=require(_0xe50d('0x5'));var util=require('util');var path=require(_0xe50d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe50d('0x7'));var fs=require('fs');var fs_extra=require(_0xe50d('0x8'));var _=require(_0xe50d('0x9'));var squel=require('squel');var crypto=require(_0xe50d('0xa'));var jsforce=require(_0xe50d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe50d('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe50d('0xd'));var qs=require(_0xe50d('0xe'));var as=require(_0xe50d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe50d('0x10'))(_0xe50d('0x11'));var utils=require('../../config/utils');var config=require(_0xe50d('0x12'));var licenseUtil=require(_0xe50d('0x13'));var db=require(_0xe50d('0x14'))['db'];var integrations=require(_0xe50d('0x15'));function respondWithStatusCode(_0x20066f,_0x4c0643){_0x4c0643=_0x4c0643||0xcc;return function(_0x3aa310){if(_0x3aa310){return _0x20066f[_0xe50d('0x16')](_0x4c0643);}return _0x20066f['status'](_0x4c0643)[_0xe50d('0x17')]();};}function respondWithResult(_0x47c921,_0x2c8124){_0x2c8124=_0x2c8124||0xc8;return function(_0x1ed94f){if(_0x1ed94f){return _0x47c921[_0xe50d('0x18')](_0x2c8124)[_0xe50d('0x19')](_0x1ed94f);}};}function respondWithFilteredResult(_0xcfda7b,_0x293c09){return function(_0x4d897d){if(_0x4d897d){var _0x2bd8b1=typeof _0x293c09['offset']===_0xe50d('0x1a')&&typeof _0x293c09['limit']==='undefined';var _0x2271f5=_0x4d897d[_0xe50d('0x1b')];var _0x2d1141=_0x2bd8b1?0x0:_0x293c09['offset'];var _0x1c56fe=_0x2bd8b1?_0x4d897d[_0xe50d('0x1b')]:_0x293c09[_0xe50d('0x1c')]+_0x293c09[_0xe50d('0x1d')];var _0x1cb980;if(_0x1c56fe>=_0x2271f5){_0x1c56fe=_0x2271f5;_0x1cb980=0xc8;}else{_0x1cb980=0xce;}_0xcfda7b[_0xe50d('0x18')](_0x1cb980);return _0xcfda7b[_0xe50d('0x1e')]('Content-Range',_0x2d1141+'-'+_0x1c56fe+'/'+_0x2271f5)[_0xe50d('0x19')](_0x4d897d);}return null;};}function patchUpdates(_0x466ebb){return function(_0x399319){try{jsonpatch[_0xe50d('0x1f')](_0x399319,_0x466ebb,!![]);}catch(_0x9eb6b8){return BPromise['reject'](_0x9eb6b8);}return _0x399319[_0xe50d('0x20')]();};}function saveUpdates(_0x2c1d9e,_0xd0a3dd){return function(_0x132326){if(_0x132326){return _0x132326['update'](_0x2c1d9e)[_0xe50d('0x21')](function(_0x208d31){return _0x208d31;});}return null;};}function removeEntity(_0x5cf20d,_0x1f6a64){return function(_0x2c8093){if(_0x2c8093){return _0x2c8093[_0xe50d('0x22')]()[_0xe50d('0x21')](function(){_0x5cf20d[_0xe50d('0x18')](0xcc)[_0xe50d('0x17')]();});}};}function handleEntityNotFound(_0x5ef641,_0x3637dc){return function(_0x155e34){if(!_0x155e34){_0x5ef641[_0xe50d('0x16')](0x194);}return _0x155e34;};}function handleError(_0x2c218f,_0x5ed557){_0x5ed557=_0x5ed557||0x1f4;return function(_0x792635){logger['error'](_0x792635['stack']);if(_0x792635[_0xe50d('0x23')]){delete _0x792635[_0xe50d('0x23')];}_0x2c218f['status'](_0x5ed557)[_0xe50d('0x24')](_0x792635);};}exports['index']=function(_0x17a160,_0x3495a9){var _0xe407f7={},_0x29470a={},_0x28594b={'count':0x0,'rows':[]};var _0x2e13d4=_[_0xe50d('0x25')](db[_0xe50d('0x26')][_0xe50d('0x27')],function(_0x3f8f9a){return{'name':_0x3f8f9a[_0xe50d('0x28')],'type':_0x3f8f9a['type']['key']};});_0x29470a[_0xe50d('0x29')]=_['map'](_0x2e13d4,_0xe50d('0x23'));_0x29470a['query']=_[_0xe50d('0x2a')](_0x17a160[_0xe50d('0x2b')]);_0x29470a[_0xe50d('0x2c')]=_[_0xe50d('0x2d')](_0x29470a[_0xe50d('0x29')],_0x29470a[_0xe50d('0x2b')]);_0xe407f7[_0xe50d('0x2e')]=_[_0xe50d('0x2d')](_0x29470a[_0xe50d('0x29')],qs[_0xe50d('0x2f')](_0x17a160[_0xe50d('0x2b')][_0xe50d('0x2f')]));_0xe407f7[_0xe50d('0x2e')]=_0xe407f7[_0xe50d('0x2e')]['length']?_0xe407f7[_0xe50d('0x2e')]:_0x29470a[_0xe50d('0x29')];if(!_0x17a160[_0xe50d('0x2b')][_0xe50d('0x30')](_0xe50d('0x31'))){_0xe407f7[_0xe50d('0x1d')]=qs['limit'](_0x17a160[_0xe50d('0x2b')][_0xe50d('0x1d')]);_0xe407f7[_0xe50d('0x1c')]=qs[_0xe50d('0x1c')](_0x17a160[_0xe50d('0x2b')][_0xe50d('0x1c')]);}_0xe407f7[_0xe50d('0x32')]=qs['sort'](_0x17a160['query'][_0xe50d('0x33')]);_0xe407f7[_0xe50d('0x34')]=qs['filters'](_[_0xe50d('0x35')](_0x17a160['query'],_0x29470a['filters']),_0x2e13d4);if(_0x17a160['query']['filter']){_0xe407f7[_0xe50d('0x34')]=_['merge'](_0xe407f7[_0xe50d('0x34')],{'$or':_['map'](_0x2e13d4,function(_0x416ea6){if(_0x416ea6[_0xe50d('0x36')]!==_0xe50d('0x37')){var _0x1919e2={};_0x1919e2[_0x416ea6['name']]={'$like':'%'+_0x17a160[_0xe50d('0x2b')]['filter']+'%'};return _0x1919e2;}})});}_0xe407f7=_['merge']({},_0xe407f7,_0x17a160[_0xe50d('0x38')]);var _0xa8acd={'where':_0xe407f7[_0xe50d('0x34')]};return db[_0xe50d('0x26')][_0xe50d('0x1b')](_0xa8acd)['then'](function(_0x175a8c){_0x28594b[_0xe50d('0x1b')]=_0x175a8c;if(_0x17a160[_0xe50d('0x2b')][_0xe50d('0x39')]){_0xe407f7['include']=[{'all':!![]}];}return db[_0xe50d('0x26')][_0xe50d('0x3a')](_0xe407f7);})[_0xe50d('0x21')](function(_0x1bb263){_0x28594b[_0xe50d('0x3b')]=_0x1bb263;return _0x28594b;})['then'](respondWithFilteredResult(_0x3495a9,_0xe407f7))[_0xe50d('0x3c')](handleError(_0x3495a9,null));};exports[_0xe50d('0x3d')]=function(_0x517fa5,_0x516c13){var _0x48dd77={'raw':![],'where':{'id':_0x517fa5[_0xe50d('0x3e')]['id']}},_0x29f6db={};_0x29f6db[_0xe50d('0x29')]=_[_0xe50d('0x2a')](db[_0xe50d('0x26')][_0xe50d('0x27')]);_0x29f6db[_0xe50d('0x2b')]=_[_0xe50d('0x2a')](_0x517fa5[_0xe50d('0x2b')]);_0x29f6db[_0xe50d('0x2c')]=_[_0xe50d('0x2d')](_0x29f6db[_0xe50d('0x29')],_0x29f6db[_0xe50d('0x2b')]);_0x48dd77[_0xe50d('0x2e')]=_['intersection'](_0x29f6db[_0xe50d('0x29')],qs[_0xe50d('0x2f')](_0x517fa5['query'][_0xe50d('0x2f')]));_0x48dd77['attributes']=_0x48dd77[_0xe50d('0x2e')][_0xe50d('0x3f')]?_0x48dd77[_0xe50d('0x2e')]:_0x29f6db[_0xe50d('0x29')];if(_0x517fa5['query'][_0xe50d('0x39')]){_0x48dd77[_0xe50d('0x40')]=[{'all':!![]}];}_0x48dd77=_[_0xe50d('0x41')]({},_0x48dd77,_0x517fa5['options']);return db[_0xe50d('0x26')]['find'](_0x48dd77)['then'](handleEntityNotFound(_0x516c13,null))['then'](respondWithResult(_0x516c13,null))[_0xe50d('0x3c')](handleError(_0x516c13,null));};exports['create']=function(_0x3d2f64,_0x6ccd75){return db[_0xe50d('0x26')]['create'](_0x3d2f64[_0xe50d('0x42')],{})[_0xe50d('0x21')](respondWithResult(_0x6ccd75,0xc9))[_0xe50d('0x3c')](handleError(_0x6ccd75,null));};exports[_0xe50d('0x43')]=function(_0x497c1e,_0x6cdb50){if(_0x497c1e['body']['id']){delete _0x497c1e[_0xe50d('0x42')]['id'];}return db['SalesforceAccount'][_0xe50d('0x44')]({'where':{'id':_0x497c1e[_0xe50d('0x3e')]['id']}})[_0xe50d('0x21')](handleEntityNotFound(_0x6cdb50,null))['then'](saveUpdates(_0x497c1e[_0xe50d('0x42')],null))[_0xe50d('0x21')](respondWithResult(_0x6cdb50,null))[_0xe50d('0x3c')](handleError(_0x6cdb50,null));};exports['destroy']=function(_0x3e6346,_0x39a029){return db[_0xe50d('0x26')][_0xe50d('0x44')]({'where':{'id':_0x3e6346[_0xe50d('0x3e')]['id']}})[_0xe50d('0x21')](handleEntityNotFound(_0x39a029,null))[_0xe50d('0x21')](removeEntity(_0x39a029,null))['catch'](handleError(_0x39a029,null));};exports[_0xe50d('0x45')]=function(_0xe68324,_0x1521a0,_0x28fc06){var _0x178211={};var _0x157274={};var _0x245fa6;var _0x400076;return db['SalesforceAccount'][_0xe50d('0x46')]({'where':{'id':_0xe68324[_0xe50d('0x3e')]['id']}})[_0xe50d('0x21')](handleEntityNotFound(_0x1521a0,null))[_0xe50d('0x21')](function(_0x1b52e8){if(_0x1b52e8){_0x245fa6=_0x1b52e8;_0x157274['model']=_['keys'](db[_0xe50d('0x47')][_0xe50d('0x27')]);_0x157274['query']=_[_0xe50d('0x2a')](_0xe68324[_0xe50d('0x2b')]);_0x157274[_0xe50d('0x2c')]=_[_0xe50d('0x2d')](_0x157274[_0xe50d('0x29')],_0x157274[_0xe50d('0x2b')]);_0x178211[_0xe50d('0x2e')]=_['intersection'](_0x157274['model'],qs[_0xe50d('0x2f')](_0xe68324[_0xe50d('0x2b')]['fields']));_0x178211['attributes']=_0x178211[_0xe50d('0x2e')]['length']?_0x178211[_0xe50d('0x2e')]:_0x157274['model'];_0x178211[_0xe50d('0x32')]=qs[_0xe50d('0x33')](_0xe68324['query'][_0xe50d('0x33')]);_0x178211[_0xe50d('0x34')]=qs[_0xe50d('0x2c')](_[_0xe50d('0x35')](_0xe68324[_0xe50d('0x2b')],_0x157274[_0xe50d('0x2c')]));if(_0xe68324['query'][_0xe50d('0x48')]){_0x178211['where']=_[_0xe50d('0x41')](_0x178211[_0xe50d('0x34')],{'$or':_['map'](_0x178211[_0xe50d('0x2e')],function(_0x2b7c50){var _0x20f3b6={};_0x20f3b6[_0x2b7c50]={'$like':'%'+_0xe68324[_0xe50d('0x2b')][_0xe50d('0x48')]+'%'};return _0x20f3b6;})});}_0x178211=_[_0xe50d('0x41')]({},_0x178211,_0xe68324['options']);return _0x245fa6[_0xe50d('0x45')](_0x178211);}})[_0xe50d('0x21')](function(_0x1fbab7){if(_0x1fbab7){_0x400076=_0x1fbab7[_0xe50d('0x3f')];if(!_0xe68324[_0xe50d('0x2b')]['hasOwnProperty'](_0xe50d('0x31'))){_0x178211['limit']=qs['limit'](_0xe68324[_0xe50d('0x2b')]['limit']);_0x178211[_0xe50d('0x1c')]=qs[_0xe50d('0x1c')](_0xe68324[_0xe50d('0x2b')]['offset']);}return _0x245fa6[_0xe50d('0x45')](_0x178211);}})['then'](function(_0x3b69e7){if(_0x3b69e7){return _0x3b69e7?{'count':_0x400076,'rows':_0x3b69e7}:null;}})[_0xe50d('0x21')](respondWithResult(_0x1521a0,null))['catch'](handleError(_0x1521a0,null));};exports[_0xe50d('0x49')]=function(_0x38394a,_0x5baa5a,_0x234f34){if(_0x38394a[_0xe50d('0x42')]['id']){delete _0x38394a[_0xe50d('0x42')]['id'];}return db[_0xe50d('0x26')][_0xe50d('0x46')]({'where':{'id':_0x38394a[_0xe50d('0x3e')]['id']}})[_0xe50d('0x21')](handleEntityNotFound(_0x5baa5a,null))[_0xe50d('0x21')](function(_0x44b6a6){if(_0x44b6a6){_0x38394a[_0xe50d('0x42')][_0xe50d('0x4a')]=_0x44b6a6['id'];_0x38394a[_0xe50d('0x42')]['Subjects']=integrations[_0xe50d('0x4b')](_0x38394a[_0xe50d('0x42')]['channel'],_0x38394a['body'][_0xe50d('0x36')]);_0x38394a[_0xe50d('0x42')][_0xe50d('0x4c')]=integrations[_0xe50d('0x4d')](_0x38394a[_0xe50d('0x42')][_0xe50d('0x4e')],_0x38394a[_0xe50d('0x42')][_0xe50d('0x36')]);return db[_0xe50d('0x47')][_0xe50d('0x4f')](_0x38394a['body'],{'include':[{'model':db[_0xe50d('0x50')],'as':_0xe50d('0x51')},{'model':db[_0xe50d('0x50')],'as':'Descriptions'}]});}return null;})[_0xe50d('0x21')](respondWithResult(_0x5baa5a,null))['catch'](handleError(_0x5baa5a,null));};exports['getFields']=function(_0x22e355,_0xfd3799,_0x204e64){var _0x3b707e;var _0x1c523f='';var _0x42c159='Task';return db[_0xe50d('0x26')][_0xe50d('0x46')]({'where':{'id':_0x22e355[_0xe50d('0x3e')]['id']},'attributes':['id',_0xe50d('0x52'),_0xe50d('0x53'),_0xe50d('0x54'),_0xe50d('0x55'),_0xe50d('0x56'),_0xe50d('0x57')]})['then'](handleEntityNotFound(_0xfd3799,null))[_0xe50d('0x21')](function(_0x4a7146){if(_0x4a7146){_0x1c523f=_0x4a7146['remoteUri'];var _0x358216=_0x1c523f[_0xe50d('0x58')](-0x1);if(_0x358216==='/'){_0x1c523f=_0x1c523f['substring'](0x0,_0x1c523f[_0xe50d('0x59')](_0x358216));}_0x3b707e=new jsforce[(_0xe50d('0x5a'))]({'oauth2':{'loginUrl':_0x1c523f,'clientId':_0x4a7146['clientId'],'clientSecret':_0x4a7146[_0xe50d('0x54')]}});return _0x3b707e['login'](_0x4a7146[_0xe50d('0x55')],_0x4a7146['password'][_0xe50d('0x5b')](_0x4a7146[_0xe50d('0x57')]));}})[_0xe50d('0x21')](function(_0x3c3389){if(_0x3c3389){if(!_['isNil'](_0x22e355[_0xe50d('0x2b')][_0xe50d('0x5c')])){_0x42c159=_0x22e355[_0xe50d('0x2b')][_0xe50d('0x5c')];}return _0x3b707e[_0xe50d('0x5d')](_0x42c159)['describe']();}})['then'](function(_0x22a5ac){var _0x3b8258=[_0xe50d('0x5e'),'ActivityDate',_0xe50d('0x5f'),_0xe50d('0x60'),_0xe50d('0x61'),_0xe50d('0x62')];var _0x2139ec=[_0xe50d('0x63'),_0xe50d('0x64'),_0xe50d('0x65'),_0xe50d('0x66'),_0xe50d('0x67'),_0xe50d('0x68'),'phone'];if(_0x22a5ac){_[_0xe50d('0x69')](_0x22a5ac[_0xe50d('0x2f')],function(_0x57e8ec){return _0x3b8258[_0xe50d('0x6a')](_0x57e8ec[_0xe50d('0x23')])||!_0x2139ec['includes'](_0x57e8ec['type']);});return{'count':_0x22a5ac['fields'][_0xe50d('0x3f')],'rows':_['map'](_0x22a5ac['fields'],function(_0x50e9fc){return{'id':_0x50e9fc[_0xe50d('0x23')],'name':_0x50e9fc['label'],'custom':_0x50e9fc[_0xe50d('0x6b')],'options':_0x50e9fc['picklistValues'][_0xe50d('0x3f')]>0x0?_[_0xe50d('0x25')](_0x50e9fc[_0xe50d('0x6c')],function(_0x26414){return{'name':_0x26414[_0xe50d('0x6d')],'value':_0x26414[_0xe50d('0x6e')]};}):_0x50e9fc[_0xe50d('0x36')]==_0xe50d('0x66')?[{'name':_0xe50d('0x6f'),'value':_0xe50d('0x70')},{'name':_0xe50d('0x71'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0xfd3799,null))['catch'](function(_0x17a35a){var _0x6dd79=_0x22e355['query'][_0xe50d('0x72')]?0x1f4:_0x17a35a[_0xe50d('0x73')]||0x1f4;logger[_0xe50d('0x74')](_0xe50d('0x75'),'getFields',_0x6dd79,JSON[_0xe50d('0x76')](_0x17a35a));delete _0x17a35a[_0xe50d('0x23')];if(_0x6dd79===0x191){_0x6dd79=0x190;}_0xfd3799['status'](_0x6dd79)[_0xe50d('0x24')](_0x22e355['query'][_0xe50d('0x72')]?{'message':_0xe50d('0x77'),'statusCode':_0x17a35a[_0xe50d('0x73')]}:_0x17a35a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 31a75cb..80ed3be 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 _0x50a0=['define','SalesforceAccount','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4826a0,_0x4ba0f6){var _0x3558e9=function(_0x3764cd){while(--_0x3764cd){_0x4826a0['push'](_0x4826a0['shift']());}};_0x3558e9(++_0x4ba0f6);}(_0x50a0,0x80));var _0x050a=function(_0x50a711,_0x1b373a){_0x50a711=_0x50a711-0x0;var _0x1139a1=_0x50a0[_0x50a711];return _0x1139a1;};'use strict';var _=require(_0x050a('0x0'));var util=require(_0x050a('0x1'));var logger=require(_0x050a('0x2'))('api');var moment=require(_0x050a('0x3'));var BPromise=require(_0x050a('0x4'));var rp=require(_0x050a('0x5'));var fs=require('fs');var path=require(_0x050a('0x6'));var rimraf=require(_0x050a('0x7'));var config=require(_0x050a('0x8'));var attributes=require(_0x050a('0x9'));var integrations=require(_0x050a('0xa'));module[_0x050a('0xb')]=function(_0x33fa5e,_0x3bc19f){return _0x33fa5e[_0x050a('0xc')](_0x050a('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87e7=['api','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','../../config/logger'];(function(_0x558731,_0x46ebaa){var _0xa0c36c=function(_0x560840){while(--_0x560840){_0x558731['push'](_0x558731['shift']());}};_0xa0c36c(++_0x46ebaa);}(_0x87e7,0x11e));var _0x787e=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0x87e7[_0x45dd0e];return _0x50e5ca;};'use strict';var _=require(_0x787e('0x0'));var util=require('util');var logger=require(_0x787e('0x1'))(_0x787e('0x2'));var moment=require('moment');var BPromise=require(_0x787e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x787e('0x4'));var rimraf=require(_0x787e('0x5'));var config=require(_0x787e('0x6'));var attributes=require(_0x787e('0x7'));var integrations=require(_0x787e('0x8'));module[_0x787e('0x9')]=function(_0x14b6bf,_0x2f65da){return _0x14b6bf[_0x787e('0xa')](_0x787e('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index fb5c080..9cdb0c1 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 _0x1543=['catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result'];(function(_0x399057,_0x3eb1ac){var _0x503d15=function(_0x1eb1f9){while(--_0x1eb1f9){_0x399057['push'](_0x399057['shift']());}};_0x503d15(++_0x3eb1ac);}(_0x1543,0x109));var _0x3154=function(_0x5a378d,_0x5b2ea1){_0x5a378d=_0x5a378d-0x0;var _0x1e6c32=_0x1543[_0x5a378d];return _0x1e6c32;};'use strict';var _=require(_0x3154('0x0'));var util=require(_0x3154('0x1'));var moment=require('moment');var BPromise=require(_0x3154('0x2'));var rs=require(_0x3154('0x3'));var fs=require('fs');var Redis=require(_0x3154('0x4'));var db=require(_0x3154('0x5'))['db'];var utils=require(_0x3154('0x6'));var logger=require(_0x3154('0x7'))(_0x3154('0x8'));var config=require(_0x3154('0x9'));var jayson=require(_0x3154('0xa'));var client=jayson['client'][_0x3154('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x217cac,_0x14d74b,_0x5ba44c){return new BPromise(function(_0x1ef5fa,_0x52c3fb){return client[_0x3154('0xc')](_0x217cac,_0x5ba44c)[_0x3154('0xd')](function(_0x95c22d){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x14d74b,'request\x20sent');logger[_0x3154('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x14d74b,_0x3154('0xf'),JSON[_0x3154('0x10')](_0x95c22d));if(_0x95c22d[_0x3154('0x11')]){if(_0x95c22d['error'][_0x3154('0x12')]===0x1f4){logger[_0x3154('0x11')](_0x3154('0x13'),_0x14d74b,_0x95c22d[_0x3154('0x11')][_0x3154('0x14')]);return _0x52c3fb(_0x95c22d['error'][_0x3154('0x14')]);}logger[_0x3154('0x11')](_0x3154('0x13'),_0x14d74b,_0x95c22d[_0x3154('0x11')][_0x3154('0x14')]);return _0x1ef5fa(_0x95c22d['error'][_0x3154('0x14')]);}else{logger[_0x3154('0x15')](_0x3154('0x13'),_0x14d74b,'request\x20sent');_0x1ef5fa(_0x95c22d[_0x3154('0x16')][_0x3154('0x14')]);}})[_0x3154('0x17')](function(_0x3d2953){logger[_0x3154('0x11')](_0x3154('0x13'),_0x14d74b,_0x3d2953);_0x52c3fb(_0x3d2953);});});}exports[_0x3154('0x18')]=function(_0x553b5d){var _0x1b0c47=this;return new Promise(function(_0x5485f9,_0x451ec8){return db[_0x3154('0x19')][_0x3154('0x1a')]({'raw':_0x553b5d['options']?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1c')]===undefined?!![]:![]:!![],'where':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1d')]||null:null,'attributes':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1e')]||null:null,'limit':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1f')]||null:null,'include':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')]['include']?_[_0x3154('0x20')](_0x553b5d[_0x3154('0x1b')][_0x3154('0x21')],function(_0x366681){return{'model':db[_0x366681[_0x3154('0x22')]],'as':_0x366681['as'],'attributes':_0x366681['attributes'],'include':_0x366681[_0x3154('0x21')]?_[_0x3154('0x20')](_0x366681['include'],function(_0x1b0697){return{'model':db[_0x1b0697[_0x3154('0x22')]],'as':_0x1b0697['as'],'attributes':_0x1b0697[_0x3154('0x1e')],'include':_0x1b0697[_0x3154('0x21')]?_[_0x3154('0x20')](_0x1b0697[_0x3154('0x21')],function(_0x20a3d6){return{'model':db[_0x20a3d6[_0x3154('0x22')]],'as':_0x20a3d6['as'],'attributes':_0x20a3d6[_0x3154('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3154('0xd')](function(_0x5cbad7){logger['info'](_0x3154('0x18'),_0x553b5d);logger[_0x3154('0xe')](_0x3154('0x18'),_0x553b5d,JSON[_0x3154('0x10')](_0x5cbad7));_0x5485f9(_0x5cbad7);})['catch'](function(_0x36a805){logger[_0x3154('0x11')](_0x3154('0x18'),_0x36a805[_0x3154('0x14')],_0x553b5d);_0x451ec8(_0x1b0c47[_0x3154('0x11')](0x1f4,_0x36a805[_0x3154('0x14')]));});});};exports[_0x3154('0x23')]=function(_0x42c184){var _0x34cd91=this;return new Promise(function(_0x4bbbd4,_0x215b17){return db[_0x3154('0x19')]['find']({'raw':_0x42c184['options']?_0x42c184[_0x3154('0x1b')][_0x3154('0x1c')]===undefined?!![]:![]:!![],'where':_0x42c184[_0x3154('0x1b')]?_0x42c184['options'][_0x3154('0x1d')]||null:null,'attributes':_0x42c184[_0x3154('0x1b')]?_0x42c184['options'][_0x3154('0x1e')]||null:null,'include':_0x42c184[_0x3154('0x1b')]?_0x42c184[_0x3154('0x1b')][_0x3154('0x21')]?_['map'](_0x42c184[_0x3154('0x1b')][_0x3154('0x21')],function(_0x48f4ca){return{'model':db[_0x48f4ca[_0x3154('0x22')]],'as':_0x48f4ca['as'],'attributes':_0x48f4ca[_0x3154('0x1e')],'include':_0x48f4ca[_0x3154('0x21')]?_[_0x3154('0x20')](_0x48f4ca['include'],function(_0x213dff){return{'model':db[_0x213dff['model']],'as':_0x213dff['as'],'attributes':_0x213dff[_0x3154('0x1e')],'include':_0x213dff[_0x3154('0x21')]?_[_0x3154('0x20')](_0x213dff[_0x3154('0x21')],function(_0x51a8b0){return{'model':db[_0x51a8b0[_0x3154('0x22')]],'as':_0x51a8b0['as'],'attributes':_0x51a8b0[_0x3154('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3154('0xd')](function(_0x268e58){logger[_0x3154('0x15')]('ShowSalesforceAccount',_0x42c184);logger[_0x3154('0xe')](_0x3154('0x23'),_0x42c184,JSON[_0x3154('0x10')](_0x268e58));_0x4bbbd4(_0x268e58);})[_0x3154('0x17')](function(_0x3ad99a){logger['error'](_0x3154('0x23'),_0x3ad99a[_0x3154('0x14')],_0x42c184);_0x215b17(_0x34cd91[_0x3154('0x11')](0x1f4,_0x3ad99a['message']));});});}; \ No newline at end of file +var _0x08dc=['raw','where','limit','map','include','model','attributes','then','ShowSalesforceAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options'];(function(_0x1db8fd,_0x1915a0){var _0x580d12=function(_0x3a728c){while(--_0x3a728c){_0x1db8fd['push'](_0x1db8fd['shift']());}};_0x580d12(++_0x1915a0);}(_0x08dc,0x15d));var _0xc08d=function(_0x326d7d,_0x492505){_0x326d7d=_0x326d7d-0x0;var _0x5ab4ca=_0x08dc[_0x326d7d];return _0x5ab4ca;};'use strict';var _=require('lodash');var util=require(_0xc08d('0x0'));var moment=require(_0xc08d('0x1'));var BPromise=require(_0xc08d('0x2'));var rs=require(_0xc08d('0x3'));var fs=require('fs');var Redis=require(_0xc08d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc08d('0x5'));var logger=require('../../config/logger')(_0xc08d('0x6'));var config=require(_0xc08d('0x7'));var jayson=require(_0xc08d('0x8'));var client=jayson['client'][_0xc08d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ce4f4,_0x192c75,_0x38c956){return new BPromise(function(_0x549cdc,_0x29b3ef){return client['request'](_0x3ce4f4,_0x38c956)['then'](function(_0x4f6276){logger[_0xc08d('0xa')](_0xc08d('0xb'),_0x192c75,_0xc08d('0xc'));logger[_0xc08d('0xd')](_0xc08d('0xe'),_0x192c75,'request\x20sent',JSON[_0xc08d('0xf')](_0x4f6276));if(_0x4f6276['error']){if(_0x4f6276[_0xc08d('0x10')][_0xc08d('0x11')]===0x1f4){logger[_0xc08d('0x10')](_0xc08d('0xb'),_0x192c75,_0x4f6276['error'][_0xc08d('0x12')]);return _0x29b3ef(_0x4f6276[_0xc08d('0x10')]['message']);}logger[_0xc08d('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x192c75,_0x4f6276[_0xc08d('0x10')][_0xc08d('0x12')]);return _0x549cdc(_0x4f6276[_0xc08d('0x10')][_0xc08d('0x12')]);}else{logger['info'](_0xc08d('0xb'),_0x192c75,_0xc08d('0xc'));_0x549cdc(_0x4f6276[_0xc08d('0x13')][_0xc08d('0x12')]);}})[_0xc08d('0x14')](function(_0x3dc1e7){logger[_0xc08d('0x10')](_0xc08d('0xb'),_0x192c75,_0x3dc1e7);_0x29b3ef(_0x3dc1e7);});});}exports[_0xc08d('0x15')]=function(_0x4636e2){var _0x5e8d5b=this;return new Promise(function(_0x17a7e2,_0x3733c4){return db[_0xc08d('0x16')][_0xc08d('0x17')]({'raw':_0x4636e2[_0xc08d('0x18')]?_0x4636e2[_0xc08d('0x18')][_0xc08d('0x19')]===undefined?!![]:![]:!![],'where':_0x4636e2[_0xc08d('0x18')]?_0x4636e2[_0xc08d('0x18')][_0xc08d('0x1a')]||null:null,'attributes':_0x4636e2[_0xc08d('0x18')]?_0x4636e2[_0xc08d('0x18')]['attributes']||null:null,'limit':_0x4636e2[_0xc08d('0x18')]?_0x4636e2[_0xc08d('0x18')][_0xc08d('0x1b')]||null:null,'include':_0x4636e2['options']?_0x4636e2[_0xc08d('0x18')]['include']?_[_0xc08d('0x1c')](_0x4636e2['options'][_0xc08d('0x1d')],function(_0x56596f){return{'model':db[_0x56596f[_0xc08d('0x1e')]],'as':_0x56596f['as'],'attributes':_0x56596f[_0xc08d('0x1f')],'include':_0x56596f[_0xc08d('0x1d')]?_['map'](_0x56596f['include'],function(_0x384a93){return{'model':db[_0x384a93['model']],'as':_0x384a93['as'],'attributes':_0x384a93[_0xc08d('0x1f')],'include':_0x384a93['include']?_[_0xc08d('0x1c')](_0x384a93[_0xc08d('0x1d')],function(_0x339940){return{'model':db[_0x339940[_0xc08d('0x1e')]],'as':_0x339940['as'],'attributes':_0x339940[_0xc08d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc08d('0x20')](function(_0x2fa64d){logger[_0xc08d('0xa')](_0xc08d('0x15'),_0x4636e2);logger['debug']('GetSalesforceAccount',_0x4636e2,JSON[_0xc08d('0xf')](_0x2fa64d));_0x17a7e2(_0x2fa64d);})[_0xc08d('0x14')](function(_0x4af0dd){logger[_0xc08d('0x10')](_0xc08d('0x15'),_0x4af0dd[_0xc08d('0x12')],_0x4636e2);_0x3733c4(_0x5e8d5b[_0xc08d('0x10')](0x1f4,_0x4af0dd['message']));});});};exports[_0xc08d('0x21')]=function(_0x4360ed){var _0x7093c5=this;return new Promise(function(_0x1c5a56,_0x497c11){return db['SalesforceAccount']['find']({'raw':_0x4360ed[_0xc08d('0x18')]?_0x4360ed[_0xc08d('0x18')][_0xc08d('0x19')]===undefined?!![]:![]:!![],'where':_0x4360ed[_0xc08d('0x18')]?_0x4360ed['options'][_0xc08d('0x1a')]||null:null,'attributes':_0x4360ed['options']?_0x4360ed[_0xc08d('0x18')]['attributes']||null:null,'include':_0x4360ed[_0xc08d('0x18')]?_0x4360ed[_0xc08d('0x18')]['include']?_[_0xc08d('0x1c')](_0x4360ed['options'][_0xc08d('0x1d')],function(_0x32b540){return{'model':db[_0x32b540[_0xc08d('0x1e')]],'as':_0x32b540['as'],'attributes':_0x32b540[_0xc08d('0x1f')],'include':_0x32b540[_0xc08d('0x1d')]?_['map'](_0x32b540['include'],function(_0x4bf878){return{'model':db[_0x4bf878[_0xc08d('0x1e')]],'as':_0x4bf878['as'],'attributes':_0x4bf878[_0xc08d('0x1f')],'include':_0x4bf878[_0xc08d('0x1d')]?_['map'](_0x4bf878['include'],function(_0x378337){return{'model':db[_0x378337[_0xc08d('0x1e')]],'as':_0x378337['as'],'attributes':_0x378337[_0xc08d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x349d73){logger[_0xc08d('0xa')](_0xc08d('0x21'),_0x4360ed);logger[_0xc08d('0xd')](_0xc08d('0x21'),_0x4360ed,JSON['stringify'](_0x349d73));_0x1c5a56(_0x349d73);})[_0xc08d('0x14')](function(_0x10ed7c){logger[_0xc08d('0x10')]('ShowSalesforceAccount',_0x10ed7c[_0xc08d('0x12')],_0x4360ed);_0x497c11(_0x7093c5[_0xc08d('0x10')](0x1f4,_0x10ed7c['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 19796b9..a13a8e7 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x302dbb,_0x8e0d2){var _0x342718=function(_0x33774a){while(--_0x33774a){_0x302dbb['push'](_0x302dbb['shift']());}};_0x342718(++_0x8e0d2);}(_0x7a54,0x106));var _0x47a5=function(_0x178c0b,_0x177dbd){_0x178c0b=_0x178c0b-0x0;var _0x57db0b=_0x7a54[_0x178c0b];return _0x57db0b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xdb28,0x106));var _0x8db2=function(_0x49eb7e,_0x2b9eaa){_0x49eb7e=_0x49eb7e-0x0;var _0x16ff90=_0xdb28[_0x49eb7e];return _0x16ff90;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index b6c173d..43a163d 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 _0x6780=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0x6780,0x9a));var _0x0678=function(_0x3378e3,_0x2b218b){_0x3378e3=_0x3378e3-0x0;var _0x55c58b=_0x6780[_0x3378e3];return _0x55c58b;};'use strict';var Sequelize=require(_0x0678('0x0'));module[_0x0678('0x1')]={'name':{'type':Sequelize[_0x0678('0x2')]},'description':{'type':Sequelize[_0x0678('0x2')]},'ticketType':{'type':Sequelize[_0x0678('0x3')](_0x0678('0x4'),_0x0678('0x5')),'defaultValue':_0x0678('0x4')},'moduleSearch':{'type':Sequelize[_0x0678('0x3')](_0x0678('0x6'),_0x0678('0x7'),_0x0678('0x8'),_0x0678('0x9'),_0x0678('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x0678('0x3')](_0x0678('0xb'),'contact',_0x0678('0x8'),_0x0678('0xa')),'defaultValue':_0x0678('0x8')},'leadId':{'type':Sequelize[_0x0678('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x0678('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0678('0x2')]}}; \ No newline at end of file +var _0x447e=['Task','contact_lead','contact','lead','account_contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x2d65b4,_0x3d7a3b){var _0xcd1a0a=function(_0x140841){while(--_0x140841){_0x2d65b4['push'](_0x2d65b4['shift']());}};_0xcd1a0a(++_0x3d7a3b);}(_0x447e,0xd4));var _0xe447=function(_0x4fe011,_0x21c63b){_0x4fe011=_0x4fe011-0x0;var _0x41fde0=_0x447e[_0x4fe011];return _0x41fde0;};'use strict';var Sequelize=require(_0xe447('0x0'));module[_0xe447('0x1')]={'name':{'type':Sequelize[_0xe447('0x2')]},'description':{'type':Sequelize[_0xe447('0x2')]},'ticketType':{'type':Sequelize[_0xe447('0x3')](_0xe447('0x4'),'Case'),'defaultValue':_0xe447('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xe447('0x5'),_0xe447('0x6'),_0xe447('0x7'),_0xe447('0x8'),'account'),'defaultValue':_0xe447('0x5')},'moduleCreate':{'type':Sequelize[_0xe447('0x3')]('nothing',_0xe447('0x6'),_0xe447('0x7'),'account'),'defaultValue':_0xe447('0x7')},'leadId':{'type':Sequelize[_0xe447('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xe447('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xe447('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xe447('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 7ffe809..1f46598 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 _0x8bcc=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','SalesforceConfiguration','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getFields','findOne','order','getSubjects','SalesforceField','getDescriptions'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8bcc,0xaa));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc8bc('0x0'));var rimraf=require(_0xc8bc('0x1'));var zipdir=require(_0xc8bc('0x2'));var jsonpatch=require(_0xc8bc('0x3'));var rp=require(_0xc8bc('0x4'));var moment=require(_0xc8bc('0x5'));var BPromise=require(_0xc8bc('0x6'));var Mustache=require(_0xc8bc('0x7'));var util=require(_0xc8bc('0x8'));var path=require(_0xc8bc('0x9'));var sox=require(_0xc8bc('0xa'));var csv=require('to-csv');var ejs=require(_0xc8bc('0xb'));var fs=require('fs');var fs_extra=require(_0xc8bc('0xc'));var _=require(_0xc8bc('0xd'));var squel=require(_0xc8bc('0xe'));var crypto=require(_0xc8bc('0xf'));var jsforce=require(_0xc8bc('0x10'));var deskjs=require(_0xc8bc('0x11'));var toCsv=require(_0xc8bc('0x12'));var querystring=require('querystring');var Papa=require(_0xc8bc('0x13'));var Redis=require(_0xc8bc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc8bc('0x15'));var as=require(_0xc8bc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8bc('0x17'))(_0xc8bc('0x18'));var utils=require(_0xc8bc('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc8bc('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ba92,_0x3e30bc){_0x3e30bc=_0x3e30bc||0xcc;return function(_0x48ada3){if(_0x48ada3){return _0x20ba92['sendStatus'](_0x3e30bc);}return _0x20ba92[_0xc8bc('0x1b')](_0x3e30bc)['end']();};}function respondWithResult(_0x4d7ece,_0x334382){_0x334382=_0x334382||0xc8;return function(_0x545cbf){if(_0x545cbf){return _0x4d7ece['status'](_0x334382)[_0xc8bc('0x1c')](_0x545cbf);}};}function respondWithFilteredResult(_0x6781d8,_0x56ac85){return function(_0x2d9b6b){if(_0x2d9b6b){var _0x901bb7=typeof _0x56ac85['offset']===_0xc8bc('0x1d')&&typeof _0x56ac85[_0xc8bc('0x1e')]===_0xc8bc('0x1d');var _0x306e70=_0x2d9b6b[_0xc8bc('0x1f')];var _0x158ff8=_0x901bb7?0x0:_0x56ac85[_0xc8bc('0x20')];var _0x3bafe6=_0x901bb7?_0x2d9b6b[_0xc8bc('0x1f')]:_0x56ac85[_0xc8bc('0x20')]+_0x56ac85[_0xc8bc('0x1e')];var _0x42ad44;if(_0x3bafe6>=_0x306e70){_0x3bafe6=_0x306e70;_0x42ad44=0xc8;}else{_0x42ad44=0xce;}_0x6781d8[_0xc8bc('0x1b')](_0x42ad44);return _0x6781d8[_0xc8bc('0x21')](_0xc8bc('0x22'),_0x158ff8+'-'+_0x3bafe6+'/'+_0x306e70)[_0xc8bc('0x1c')](_0x2d9b6b);}return null;};}function patchUpdates(_0x223bff){return function(_0x3aa466){try{jsonpatch[_0xc8bc('0x23')](_0x3aa466,_0x223bff,!![]);}catch(_0x4c99f8){return BPromise[_0xc8bc('0x24')](_0x4c99f8);}return _0x3aa466[_0xc8bc('0x25')]();};}function saveUpdates(_0x2d635f,_0x5f4cda){return function(_0x4be65f){if(_0x4be65f){return _0x4be65f[_0xc8bc('0x26')](_0x2d635f)[_0xc8bc('0x27')](function(_0x5f0e2d){return _0x5f0e2d;});}return null;};}function removeEntity(_0x4ce7d,_0x12ffcd){return function(_0x2851bb){if(_0x2851bb){return _0x2851bb[_0xc8bc('0x28')]()[_0xc8bc('0x27')](function(){_0x4ce7d[_0xc8bc('0x1b')](0xcc)[_0xc8bc('0x29')]();});}};}function handleEntityNotFound(_0x3a560a,_0x48b29d){return function(_0x57169f){if(!_0x57169f){_0x3a560a[_0xc8bc('0x2a')](0x194);}return _0x57169f;};}function handleError(_0x462f2b,_0x3c2513){_0x3c2513=_0x3c2513||0x1f4;return function(_0x2bc04f){logger[_0xc8bc('0x2b')](_0x2bc04f[_0xc8bc('0x2c')]);if(_0x2bc04f['name']){delete _0x2bc04f[_0xc8bc('0x2d')];}_0x462f2b[_0xc8bc('0x1b')](_0x3c2513)['send'](_0x2bc04f);};}exports['index']=function(_0x3a42fd,_0x15150a){var _0x3a72a0={},_0x31cd28={},_0x319cc4={'count':0x0,'rows':[]};var _0x512047=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x2b955b){return{'name':_0x2b955b[_0xc8bc('0x2e')],'type':_0x2b955b[_0xc8bc('0x2f')][_0xc8bc('0x30')]};});_0x31cd28[_0xc8bc('0x31')]=_[_0xc8bc('0x32')](_0x512047,_0xc8bc('0x2d'));_0x31cd28[_0xc8bc('0x33')]=_[_0xc8bc('0x34')](_0x3a42fd[_0xc8bc('0x33')]);_0x31cd28[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x31cd28[_0xc8bc('0x31')],_0x31cd28['query']);_0x3a72a0[_0xc8bc('0x37')]=_['intersection'](_0x31cd28[_0xc8bc('0x31')],qs[_0xc8bc('0x38')](_0x3a42fd[_0xc8bc('0x33')]['fields']));_0x3a72a0[_0xc8bc('0x37')]=_0x3a72a0[_0xc8bc('0x37')][_0xc8bc('0x39')]?_0x3a72a0[_0xc8bc('0x37')]:_0x31cd28[_0xc8bc('0x31')];if(!_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x3a')](_0xc8bc('0x3b'))){_0x3a72a0[_0xc8bc('0x1e')]=qs[_0xc8bc('0x1e')](_0x3a42fd['query'][_0xc8bc('0x1e')]);_0x3a72a0[_0xc8bc('0x20')]=qs[_0xc8bc('0x20')](_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x20')]);}_0x3a72a0['order']=qs['sort'](_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x3c')]);_0x3a72a0['where']=qs[_0xc8bc('0x35')](_[_0xc8bc('0x3d')](_0x3a42fd['query'],_0x31cd28[_0xc8bc('0x35')]),_0x512047);if(_0x3a42fd['query'][_0xc8bc('0x3e')]){_0x3a72a0[_0xc8bc('0x3f')]=_['merge'](_0x3a72a0[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x512047,function(_0x19f3b3){if(_0x19f3b3[_0xc8bc('0x2f')]!==_0xc8bc('0x40')){var _0x500dfc={};_0x500dfc[_0x19f3b3[_0xc8bc('0x2d')]]={'$like':'%'+_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x3e')]+'%'};return _0x500dfc;}})});}_0x3a72a0=_[_0xc8bc('0x41')]({},_0x3a72a0,_0x3a42fd[_0xc8bc('0x42')]);var _0x23f62f={'where':_0x3a72a0[_0xc8bc('0x3f')]};return db['SalesforceConfiguration'][_0xc8bc('0x1f')](_0x23f62f)['then'](function(_0x4430bd){_0x319cc4[_0xc8bc('0x1f')]=_0x4430bd;if(_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x43')]){_0x3a72a0['include']=[{'all':!![]}];}return db[_0xc8bc('0x44')][_0xc8bc('0x45')](_0x3a72a0);})[_0xc8bc('0x27')](function(_0x21fdca){_0x319cc4[_0xc8bc('0x46')]=_0x21fdca;return _0x319cc4;})[_0xc8bc('0x27')](respondWithFilteredResult(_0x15150a,_0x3a72a0))[_0xc8bc('0x47')](handleError(_0x15150a,null));};exports[_0xc8bc('0x48')]=function(_0x27bf69,_0x4084bd){var _0x297116={'raw':![],'where':{'id':_0x27bf69['params']['id']}},_0x6e6640={};_0x6e6640[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db[_0xc8bc('0x44')][_0xc8bc('0x49')]);_0x6e6640[_0xc8bc('0x33')]=_[_0xc8bc('0x34')](_0x27bf69['query']);_0x6e6640[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x6e6640[_0xc8bc('0x31')],_0x6e6640[_0xc8bc('0x33')]);_0x297116[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x6e6640['model'],qs['fields'](_0x27bf69[_0xc8bc('0x33')][_0xc8bc('0x38')]));_0x297116[_0xc8bc('0x37')]=_0x297116[_0xc8bc('0x37')][_0xc8bc('0x39')]?_0x297116['attributes']:_0x6e6640[_0xc8bc('0x31')];if(_0x27bf69['query'][_0xc8bc('0x43')]){_0x297116[_0xc8bc('0x4a')]=[{'all':!![]}];}_0x297116=_[_0xc8bc('0x41')]({},_0x297116,_0x27bf69[_0xc8bc('0x42')]);return db[_0xc8bc('0x44')][_0xc8bc('0x4b')](_0x297116)['then'](handleEntityNotFound(_0x4084bd,null))['then'](respondWithResult(_0x4084bd,null))[_0xc8bc('0x47')](handleError(_0x4084bd,null));};exports[_0xc8bc('0x4c')]=function(_0x3ef1ff,_0x5024ad){return db[_0xc8bc('0x44')]['create'](_0x3ef1ff[_0xc8bc('0x4d')],{})['then'](respondWithResult(_0x5024ad,0xc9))['catch'](handleError(_0x5024ad,null));};exports[_0xc8bc('0x26')]=function(_0x5ea2f0,_0x5b3beb){if(_0x5ea2f0[_0xc8bc('0x4d')]['id']){delete _0x5ea2f0[_0xc8bc('0x4d')]['id'];}return db[_0xc8bc('0x44')][_0xc8bc('0x4b')]({'where':{'id':_0x5ea2f0[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x5b3beb,null))[_0xc8bc('0x27')](saveUpdates(_0x5ea2f0[_0xc8bc('0x4d')],null))[_0xc8bc('0x27')](respondWithResult(_0x5b3beb,null))[_0xc8bc('0x47')](handleError(_0x5b3beb,null));};exports[_0xc8bc('0x28')]=function(_0x2582c3,_0x36ca42){return db['SalesforceConfiguration'][_0xc8bc('0x4b')]({'where':{'id':_0x2582c3[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x36ca42,null))['then'](removeEntity(_0x36ca42,null))[_0xc8bc('0x47')](handleError(_0x36ca42,null));};exports[_0xc8bc('0x4f')]=function(_0x4e9da0,_0x1d9014,_0x40426c){var _0x475034={};var _0x50d5ea={};var _0x480378;var _0x1ff47d;return db[_0xc8bc('0x44')][_0xc8bc('0x50')]({'where':{'id':_0x4e9da0[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x1d9014,null))[_0xc8bc('0x27')](function(_0x33b12e){if(_0x33b12e){_0x480378=_0x33b12e;_0x50d5ea[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db['SalesforceField']['rawAttributes']);_0x50d5ea['query']=_[_0xc8bc('0x34')](_0x4e9da0[_0xc8bc('0x33')]);_0x50d5ea['filters']=_[_0xc8bc('0x36')](_0x50d5ea[_0xc8bc('0x31')],_0x50d5ea['query']);_0x475034[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x50d5ea[_0xc8bc('0x31')],qs['fields'](_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x38')]));_0x475034[_0xc8bc('0x37')]=_0x475034[_0xc8bc('0x37')]['length']?_0x475034[_0xc8bc('0x37')]:_0x50d5ea[_0xc8bc('0x31')];_0x475034[_0xc8bc('0x51')]=qs[_0xc8bc('0x3c')](_0x4e9da0['query'][_0xc8bc('0x3c')]);_0x475034[_0xc8bc('0x3f')]=qs[_0xc8bc('0x35')](_[_0xc8bc('0x3d')](_0x4e9da0[_0xc8bc('0x33')],_0x50d5ea[_0xc8bc('0x35')]));if(_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x3e')]){_0x475034[_0xc8bc('0x3f')]=_[_0xc8bc('0x41')](_0x475034[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x475034[_0xc8bc('0x37')],function(_0x36442f){var _0x289ec7={};_0x289ec7[_0x36442f]={'$like':'%'+_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x3e')]+'%'};return _0x289ec7;})});}_0x475034=_[_0xc8bc('0x41')]({},_0x475034,_0x4e9da0[_0xc8bc('0x42')]);return _0x480378['getFields'](_0x475034);}})['then'](function(_0x2e6165){if(_0x2e6165){_0x1ff47d=_0x2e6165['length'];if(!_0x4e9da0[_0xc8bc('0x33')]['hasOwnProperty'](_0xc8bc('0x3b'))){_0x475034[_0xc8bc('0x1e')]=qs[_0xc8bc('0x1e')](_0x4e9da0[_0xc8bc('0x33')]['limit']);_0x475034[_0xc8bc('0x20')]=qs['offset'](_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x20')]);}return _0x480378[_0xc8bc('0x4f')](_0x475034);}})[_0xc8bc('0x27')](function(_0x148b77){if(_0x148b77){return _0x148b77?{'count':_0x1ff47d,'rows':_0x148b77}:null;}})[_0xc8bc('0x27')](respondWithResult(_0x1d9014,null))[_0xc8bc('0x47')](handleError(_0x1d9014,null));};exports[_0xc8bc('0x52')]=function(_0x490431,_0xfeff7c,_0x3efdf4){var _0x4baafa={};var _0x2b85d9={};var _0x392f1a;var _0x1bfbd2;return db['SalesforceConfiguration'][_0xc8bc('0x50')]({'where':{'id':_0x490431[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0xfeff7c,null))[_0xc8bc('0x27')](function(_0x30c23b){if(_0x30c23b){_0x392f1a=_0x30c23b;_0x2b85d9[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db[_0xc8bc('0x53')][_0xc8bc('0x49')]);_0x2b85d9[_0xc8bc('0x33')]=_[_0xc8bc('0x34')](_0x490431[_0xc8bc('0x33')]);_0x2b85d9[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x2b85d9[_0xc8bc('0x31')],_0x2b85d9[_0xc8bc('0x33')]);_0x4baafa[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x2b85d9[_0xc8bc('0x31')],qs[_0xc8bc('0x38')](_0x490431[_0xc8bc('0x33')]['fields']));_0x4baafa[_0xc8bc('0x37')]=_0x4baafa['attributes'][_0xc8bc('0x39')]?_0x4baafa[_0xc8bc('0x37')]:_0x2b85d9[_0xc8bc('0x31')];_0x4baafa[_0xc8bc('0x51')]=qs[_0xc8bc('0x3c')](_0x490431['query'][_0xc8bc('0x3c')]);_0x4baafa['where']=qs[_0xc8bc('0x35')](_[_0xc8bc('0x3d')](_0x490431[_0xc8bc('0x33')],_0x2b85d9['filters']));if(_0x490431[_0xc8bc('0x33')][_0xc8bc('0x3e')]){_0x4baafa[_0xc8bc('0x3f')]=_[_0xc8bc('0x41')](_0x4baafa[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x4baafa[_0xc8bc('0x37')],function(_0x568fbc){var _0x203e57={};_0x203e57[_0x568fbc]={'$like':'%'+_0x490431[_0xc8bc('0x33')][_0xc8bc('0x3e')]+'%'};return _0x203e57;})});}_0x4baafa=_[_0xc8bc('0x41')]({},_0x4baafa,_0x490431['options']);return _0x392f1a['getSubjects'](_0x4baafa);}})['then'](function(_0x258516){if(_0x258516){_0x1bfbd2=_0x258516[_0xc8bc('0x39')];if(!_0x490431[_0xc8bc('0x33')][_0xc8bc('0x3a')]('nolimit')){_0x4baafa[_0xc8bc('0x1e')]=qs[_0xc8bc('0x1e')](_0x490431[_0xc8bc('0x33')][_0xc8bc('0x1e')]);_0x4baafa[_0xc8bc('0x20')]=qs['offset'](_0x490431[_0xc8bc('0x33')][_0xc8bc('0x20')]);}return _0x392f1a[_0xc8bc('0x52')](_0x4baafa);}})[_0xc8bc('0x27')](function(_0xea1519){if(_0xea1519){return _0xea1519?{'count':_0x1bfbd2,'rows':_0xea1519}:null;}})[_0xc8bc('0x27')](respondWithResult(_0xfeff7c,null))[_0xc8bc('0x47')](handleError(_0xfeff7c,null));};exports[_0xc8bc('0x54')]=function(_0x5b3eac,_0x42803b,_0x2c6f04){var _0x55a941={};var _0x310d1b={};var _0x5ad7b2;var _0x56c2f8;return db[_0xc8bc('0x44')][_0xc8bc('0x50')]({'where':{'id':_0x5b3eac['params']['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x42803b,null))['then'](function(_0x552818){if(_0x552818){_0x5ad7b2=_0x552818;_0x310d1b[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db[_0xc8bc('0x53')][_0xc8bc('0x49')]);_0x310d1b[_0xc8bc('0x33')]=_['keys'](_0x5b3eac['query']);_0x310d1b[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x310d1b[_0xc8bc('0x31')],_0x310d1b[_0xc8bc('0x33')]);_0x55a941[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x310d1b[_0xc8bc('0x31')],qs[_0xc8bc('0x38')](_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x38')]));_0x55a941[_0xc8bc('0x37')]=_0x55a941[_0xc8bc('0x37')][_0xc8bc('0x39')]?_0x55a941['attributes']:_0x310d1b['model'];_0x55a941['order']=qs[_0xc8bc('0x3c')](_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x3c')]);_0x55a941['where']=qs['filters'](_[_0xc8bc('0x3d')](_0x5b3eac[_0xc8bc('0x33')],_0x310d1b[_0xc8bc('0x35')]));if(_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x3e')]){_0x55a941[_0xc8bc('0x3f')]=_[_0xc8bc('0x41')](_0x55a941[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x55a941['attributes'],function(_0x5495ba){var _0x433afe={};_0x433afe[_0x5495ba]={'$like':'%'+_0x5b3eac['query'][_0xc8bc('0x3e')]+'%'};return _0x433afe;})});}_0x55a941=_['merge']({},_0x55a941,_0x5b3eac[_0xc8bc('0x42')]);return _0x5ad7b2[_0xc8bc('0x54')](_0x55a941);}})[_0xc8bc('0x27')](function(_0x4fcbf6){if(_0x4fcbf6){_0x56c2f8=_0x4fcbf6[_0xc8bc('0x39')];if(!_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x3a')](_0xc8bc('0x3b'))){_0x55a941['limit']=qs[_0xc8bc('0x1e')](_0x5b3eac['query'][_0xc8bc('0x1e')]);_0x55a941[_0xc8bc('0x20')]=qs[_0xc8bc('0x20')](_0x5b3eac[_0xc8bc('0x33')]['offset']);}return _0x5ad7b2[_0xc8bc('0x54')](_0x55a941);}})[_0xc8bc('0x27')](function(_0x4165b5){if(_0x4165b5){return _0x4165b5?{'count':_0x56c2f8,'rows':_0x4165b5}:null;}})['then'](respondWithResult(_0x42803b,null))[_0xc8bc('0x47')](handleError(_0x42803b,null));}; \ No newline at end of file +var _0x1280=['includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','getFields','SalesforceField','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options'];(function(_0x544943,_0x4dbd18){var _0x36d759=function(_0x1dab7b){while(--_0x1dab7b){_0x544943['push'](_0x544943['shift']());}};_0x36d759(++_0x4dbd18);}(_0x1280,0xba));var _0x0128=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1280[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0x0128('0x0'));var rimraf=require(_0x0128('0x1'));var zipdir=require(_0x0128('0x2'));var jsonpatch=require(_0x0128('0x3'));var rp=require(_0x0128('0x4'));var moment=require(_0x0128('0x5'));var BPromise=require(_0x0128('0x6'));var Mustache=require(_0x0128('0x7'));var util=require(_0x0128('0x8'));var path=require('path');var sox=require(_0x0128('0x9'));var csv=require(_0x0128('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0128('0xb'));var squel=require(_0x0128('0xc'));var crypto=require(_0x0128('0xd'));var jsforce=require(_0x0128('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var as=require(_0x0128('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0128('0x14'))(_0x0128('0x15'));var utils=require(_0x0128('0x16'));var config=require(_0x0128('0x17'));var licenseUtil=require(_0x0128('0x18'));var db=require(_0x0128('0x19'))['db'];function respondWithStatusCode(_0xa4d9af,_0x152702){_0x152702=_0x152702||0xcc;return function(_0x578f2d){if(_0x578f2d){return _0xa4d9af[_0x0128('0x1a')](_0x152702);}return _0xa4d9af['status'](_0x152702)['end']();};}function respondWithResult(_0x3ee065,_0x91d6b3){_0x91d6b3=_0x91d6b3||0xc8;return function(_0x4467ae){if(_0x4467ae){return _0x3ee065[_0x0128('0x1b')](_0x91d6b3)[_0x0128('0x1c')](_0x4467ae);}};}function respondWithFilteredResult(_0x4fd99f,_0x247f8b){return function(_0x2b4c26){if(_0x2b4c26){var _0x35106a=typeof _0x247f8b['offset']==='undefined'&&typeof _0x247f8b['limit']===_0x0128('0x1d');var _0x170fb3=_0x2b4c26[_0x0128('0x1e')];var _0x179a99=_0x35106a?0x0:_0x247f8b['offset'];var _0x50a307=_0x35106a?_0x2b4c26[_0x0128('0x1e')]:_0x247f8b[_0x0128('0x1f')]+_0x247f8b[_0x0128('0x20')];var _0x11f76e;if(_0x50a307>=_0x170fb3){_0x50a307=_0x170fb3;_0x11f76e=0xc8;}else{_0x11f76e=0xce;}_0x4fd99f['status'](_0x11f76e);return _0x4fd99f['set'](_0x0128('0x21'),_0x179a99+'-'+_0x50a307+'/'+_0x170fb3)[_0x0128('0x1c')](_0x2b4c26);}return null;};}function patchUpdates(_0x283ca2){return function(_0x2f2880){try{jsonpatch[_0x0128('0x22')](_0x2f2880,_0x283ca2,!![]);}catch(_0x5753b4){return BPromise[_0x0128('0x23')](_0x5753b4);}return _0x2f2880[_0x0128('0x24')]();};}function saveUpdates(_0x1f4391,_0x1852d1){return function(_0x1b8938){if(_0x1b8938){return _0x1b8938[_0x0128('0x25')](_0x1f4391)[_0x0128('0x26')](function(_0x75054e){return _0x75054e;});}return null;};}function removeEntity(_0x22583c,_0x5205ad){return function(_0x377dec){if(_0x377dec){return _0x377dec['destroy']()[_0x0128('0x26')](function(){_0x22583c['status'](0xcc)[_0x0128('0x27')]();});}};}function handleEntityNotFound(_0x175a21,_0x3ad8a9){return function(_0x132fa2){if(!_0x132fa2){_0x175a21[_0x0128('0x1a')](0x194);}return _0x132fa2;};}function handleError(_0x13c5ff,_0x270dc8){_0x270dc8=_0x270dc8||0x1f4;return function(_0x22fb36){logger[_0x0128('0x28')](_0x22fb36[_0x0128('0x29')]);if(_0x22fb36[_0x0128('0x2a')]){delete _0x22fb36[_0x0128('0x2a')];}_0x13c5ff['status'](_0x270dc8)[_0x0128('0x2b')](_0x22fb36);};}exports[_0x0128('0x2c')]=function(_0x197580,_0x11f7c5){var _0x4d21c7={},_0x3bf940={},_0x4db631={'count':0x0,'rows':[]};var _0x8f11e4=_[_0x0128('0x2d')](db[_0x0128('0x2e')][_0x0128('0x2f')],function(_0x35be49){return{'name':_0x35be49[_0x0128('0x30')],'type':_0x35be49[_0x0128('0x31')][_0x0128('0x32')]};});_0x3bf940['model']=_[_0x0128('0x2d')](_0x8f11e4,_0x0128('0x2a'));_0x3bf940[_0x0128('0x33')]=_[_0x0128('0x34')](_0x197580['query']);_0x3bf940['filters']=_[_0x0128('0x35')](_0x3bf940[_0x0128('0x36')],_0x3bf940[_0x0128('0x33')]);_0x4d21c7[_0x0128('0x37')]=_[_0x0128('0x35')](_0x3bf940[_0x0128('0x36')],qs[_0x0128('0x38')](_0x197580[_0x0128('0x33')][_0x0128('0x38')]));_0x4d21c7[_0x0128('0x37')]=_0x4d21c7[_0x0128('0x37')][_0x0128('0x39')]?_0x4d21c7[_0x0128('0x37')]:_0x3bf940[_0x0128('0x36')];if(!_0x197580['query'][_0x0128('0x3a')](_0x0128('0x3b'))){_0x4d21c7[_0x0128('0x20')]=qs[_0x0128('0x20')](_0x197580[_0x0128('0x33')][_0x0128('0x20')]);_0x4d21c7[_0x0128('0x1f')]=qs[_0x0128('0x1f')](_0x197580[_0x0128('0x33')][_0x0128('0x1f')]);}_0x4d21c7[_0x0128('0x3c')]=qs[_0x0128('0x3d')](_0x197580[_0x0128('0x33')][_0x0128('0x3d')]);_0x4d21c7['where']=qs[_0x0128('0x3e')](_[_0x0128('0x3f')](_0x197580[_0x0128('0x33')],_0x3bf940[_0x0128('0x3e')]),_0x8f11e4);if(_0x197580['query'][_0x0128('0x40')]){_0x4d21c7[_0x0128('0x41')]=_[_0x0128('0x42')](_0x4d21c7[_0x0128('0x41')],{'$or':_[_0x0128('0x2d')](_0x8f11e4,function(_0x3aa515){if(_0x3aa515[_0x0128('0x31')]!==_0x0128('0x43')){var _0x218700={};_0x218700[_0x3aa515[_0x0128('0x2a')]]={'$like':'%'+_0x197580[_0x0128('0x33')][_0x0128('0x40')]+'%'};return _0x218700;}})});}_0x4d21c7=_['merge']({},_0x4d21c7,_0x197580[_0x0128('0x44')]);var _0x271f67={'where':_0x4d21c7[_0x0128('0x41')]};return db[_0x0128('0x2e')][_0x0128('0x1e')](_0x271f67)[_0x0128('0x26')](function(_0x4fd2e2){_0x4db631['count']=_0x4fd2e2;if(_0x197580[_0x0128('0x33')][_0x0128('0x45')]){_0x4d21c7[_0x0128('0x46')]=[{'all':!![]}];}return db[_0x0128('0x2e')][_0x0128('0x47')](_0x4d21c7);})['then'](function(_0x3442cd){_0x4db631[_0x0128('0x48')]=_0x3442cd;return _0x4db631;})[_0x0128('0x26')](respondWithFilteredResult(_0x11f7c5,_0x4d21c7))['catch'](handleError(_0x11f7c5,null));};exports[_0x0128('0x49')]=function(_0x3ed701,_0x2c7fd4){var _0x45bf39={'raw':![],'where':{'id':_0x3ed701[_0x0128('0x4a')]['id']}},_0x2c97b4={};_0x2c97b4['model']=_[_0x0128('0x34')](db[_0x0128('0x2e')]['rawAttributes']);_0x2c97b4[_0x0128('0x33')]=_['keys'](_0x3ed701[_0x0128('0x33')]);_0x2c97b4['filters']=_[_0x0128('0x35')](_0x2c97b4[_0x0128('0x36')],_0x2c97b4[_0x0128('0x33')]);_0x45bf39['attributes']=_[_0x0128('0x35')](_0x2c97b4[_0x0128('0x36')],qs['fields'](_0x3ed701[_0x0128('0x33')][_0x0128('0x38')]));_0x45bf39[_0x0128('0x37')]=_0x45bf39[_0x0128('0x37')][_0x0128('0x39')]?_0x45bf39[_0x0128('0x37')]:_0x2c97b4[_0x0128('0x36')];if(_0x3ed701[_0x0128('0x33')]['includeAll']){_0x45bf39['include']=[{'all':!![]}];}_0x45bf39=_['merge']({},_0x45bf39,_0x3ed701[_0x0128('0x44')]);return db[_0x0128('0x2e')][_0x0128('0x4b')](_0x45bf39)[_0x0128('0x26')](handleEntityNotFound(_0x2c7fd4,null))[_0x0128('0x26')](respondWithResult(_0x2c7fd4,null))['catch'](handleError(_0x2c7fd4,null));};exports[_0x0128('0x4c')]=function(_0x492d7d,_0x7de574){return db[_0x0128('0x2e')][_0x0128('0x4c')](_0x492d7d[_0x0128('0x4d')],{})[_0x0128('0x26')](respondWithResult(_0x7de574,0xc9))[_0x0128('0x4e')](handleError(_0x7de574,null));};exports[_0x0128('0x25')]=function(_0xdb8891,_0x357d4e){if(_0xdb8891[_0x0128('0x4d')]['id']){delete _0xdb8891['body']['id'];}return db[_0x0128('0x2e')][_0x0128('0x4b')]({'where':{'id':_0xdb8891[_0x0128('0x4a')]['id']}})['then'](handleEntityNotFound(_0x357d4e,null))['then'](saveUpdates(_0xdb8891[_0x0128('0x4d')],null))[_0x0128('0x26')](respondWithResult(_0x357d4e,null))[_0x0128('0x4e')](handleError(_0x357d4e,null));};exports[_0x0128('0x4f')]=function(_0x2ead41,_0x31fd8f){return db[_0x0128('0x2e')][_0x0128('0x4b')]({'where':{'id':_0x2ead41[_0x0128('0x4a')]['id']}})[_0x0128('0x26')](handleEntityNotFound(_0x31fd8f,null))['then'](removeEntity(_0x31fd8f,null))[_0x0128('0x4e')](handleError(_0x31fd8f,null));};exports[_0x0128('0x50')]=function(_0x492f03,_0x1ef15,_0x250b2a){var _0x23c21f={};var _0xff5f93={};var _0x47023d;var _0x36c501;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x492f03[_0x0128('0x4a')]['id']}})[_0x0128('0x26')](handleEntityNotFound(_0x1ef15,null))[_0x0128('0x26')](function(_0x2bf526){if(_0x2bf526){_0x47023d=_0x2bf526;_0xff5f93[_0x0128('0x36')]=_['keys'](db[_0x0128('0x51')][_0x0128('0x2f')]);_0xff5f93['query']=_[_0x0128('0x34')](_0x492f03['query']);_0xff5f93[_0x0128('0x3e')]=_['intersection'](_0xff5f93[_0x0128('0x36')],_0xff5f93['query']);_0x23c21f[_0x0128('0x37')]=_['intersection'](_0xff5f93['model'],qs[_0x0128('0x38')](_0x492f03[_0x0128('0x33')]['fields']));_0x23c21f[_0x0128('0x37')]=_0x23c21f[_0x0128('0x37')][_0x0128('0x39')]?_0x23c21f[_0x0128('0x37')]:_0xff5f93['model'];_0x23c21f[_0x0128('0x3c')]=qs[_0x0128('0x3d')](_0x492f03[_0x0128('0x33')][_0x0128('0x3d')]);_0x23c21f[_0x0128('0x41')]=qs[_0x0128('0x3e')](_['pick'](_0x492f03[_0x0128('0x33')],_0xff5f93[_0x0128('0x3e')]));if(_0x492f03[_0x0128('0x33')][_0x0128('0x40')]){_0x23c21f[_0x0128('0x41')]=_[_0x0128('0x42')](_0x23c21f['where'],{'$or':_[_0x0128('0x2d')](_0x23c21f[_0x0128('0x37')],function(_0x3e91e9){var _0x797297={};_0x797297[_0x3e91e9]={'$like':'%'+_0x492f03['query']['filter']+'%'};return _0x797297;})});}_0x23c21f=_[_0x0128('0x42')]({},_0x23c21f,_0x492f03[_0x0128('0x44')]);return _0x47023d['getFields'](_0x23c21f);}})[_0x0128('0x26')](function(_0x72a797){if(_0x72a797){_0x36c501=_0x72a797['length'];if(!_0x492f03[_0x0128('0x33')][_0x0128('0x3a')](_0x0128('0x3b'))){_0x23c21f['limit']=qs[_0x0128('0x20')](_0x492f03[_0x0128('0x33')][_0x0128('0x20')]);_0x23c21f[_0x0128('0x1f')]=qs['offset'](_0x492f03[_0x0128('0x33')][_0x0128('0x1f')]);}return _0x47023d[_0x0128('0x50')](_0x23c21f);}})[_0x0128('0x26')](function(_0x513f00){if(_0x513f00){return _0x513f00?{'count':_0x36c501,'rows':_0x513f00}:null;}})['then'](respondWithResult(_0x1ef15,null))[_0x0128('0x4e')](handleError(_0x1ef15,null));};exports['getSubjects']=function(_0x3ab83e,_0x565c96,_0x184fd5){var _0x53d5fe={};var _0x401e57={};var _0x1f1017;var _0x1f09f6;return db['SalesforceConfiguration'][_0x0128('0x52')]({'where':{'id':_0x3ab83e[_0x0128('0x4a')]['id']}})[_0x0128('0x26')](handleEntityNotFound(_0x565c96,null))[_0x0128('0x26')](function(_0xecd28f){if(_0xecd28f){_0x1f1017=_0xecd28f;_0x401e57[_0x0128('0x36')]=_['keys'](db['SalesforceField'][_0x0128('0x2f')]);_0x401e57['query']=_['keys'](_0x3ab83e[_0x0128('0x33')]);_0x401e57[_0x0128('0x3e')]=_[_0x0128('0x35')](_0x401e57[_0x0128('0x36')],_0x401e57[_0x0128('0x33')]);_0x53d5fe[_0x0128('0x37')]=_[_0x0128('0x35')](_0x401e57[_0x0128('0x36')],qs['fields'](_0x3ab83e[_0x0128('0x33')]['fields']));_0x53d5fe['attributes']=_0x53d5fe[_0x0128('0x37')][_0x0128('0x39')]?_0x53d5fe['attributes']:_0x401e57[_0x0128('0x36')];_0x53d5fe[_0x0128('0x3c')]=qs[_0x0128('0x3d')](_0x3ab83e[_0x0128('0x33')][_0x0128('0x3d')]);_0x53d5fe['where']=qs[_0x0128('0x3e')](_[_0x0128('0x3f')](_0x3ab83e['query'],_0x401e57[_0x0128('0x3e')]));if(_0x3ab83e[_0x0128('0x33')][_0x0128('0x40')]){_0x53d5fe['where']=_[_0x0128('0x42')](_0x53d5fe[_0x0128('0x41')],{'$or':_['map'](_0x53d5fe[_0x0128('0x37')],function(_0x2f1397){var _0x179a2e={};_0x179a2e[_0x2f1397]={'$like':'%'+_0x3ab83e[_0x0128('0x33')][_0x0128('0x40')]+'%'};return _0x179a2e;})});}_0x53d5fe=_[_0x0128('0x42')]({},_0x53d5fe,_0x3ab83e[_0x0128('0x44')]);return _0x1f1017[_0x0128('0x53')](_0x53d5fe);}})[_0x0128('0x26')](function(_0x5946be){if(_0x5946be){_0x1f09f6=_0x5946be[_0x0128('0x39')];if(!_0x3ab83e[_0x0128('0x33')][_0x0128('0x3a')](_0x0128('0x3b'))){_0x53d5fe['limit']=qs['limit'](_0x3ab83e[_0x0128('0x33')][_0x0128('0x20')]);_0x53d5fe[_0x0128('0x1f')]=qs[_0x0128('0x1f')](_0x3ab83e[_0x0128('0x33')][_0x0128('0x1f')]);}return _0x1f1017[_0x0128('0x53')](_0x53d5fe);}})[_0x0128('0x26')](function(_0x536580){if(_0x536580){return _0x536580?{'count':_0x1f09f6,'rows':_0x536580}:null;}})['then'](respondWithResult(_0x565c96,null))[_0x0128('0x4e')](handleError(_0x565c96,null));};exports['getDescriptions']=function(_0x275a51,_0x40c767,_0x1981da){var _0x7f92d7={};var _0x367ccc={};var _0x55be28;var _0x2445cc;return db[_0x0128('0x2e')][_0x0128('0x52')]({'where':{'id':_0x275a51['params']['id']}})[_0x0128('0x26')](handleEntityNotFound(_0x40c767,null))[_0x0128('0x26')](function(_0x1967cf){if(_0x1967cf){_0x55be28=_0x1967cf;_0x367ccc['model']=_[_0x0128('0x34')](db[_0x0128('0x51')][_0x0128('0x2f')]);_0x367ccc[_0x0128('0x33')]=_['keys'](_0x275a51[_0x0128('0x33')]);_0x367ccc['filters']=_[_0x0128('0x35')](_0x367ccc[_0x0128('0x36')],_0x367ccc[_0x0128('0x33')]);_0x7f92d7[_0x0128('0x37')]=_[_0x0128('0x35')](_0x367ccc[_0x0128('0x36')],qs[_0x0128('0x38')](_0x275a51[_0x0128('0x33')]['fields']));_0x7f92d7[_0x0128('0x37')]=_0x7f92d7['attributes'][_0x0128('0x39')]?_0x7f92d7[_0x0128('0x37')]:_0x367ccc['model'];_0x7f92d7[_0x0128('0x3c')]=qs[_0x0128('0x3d')](_0x275a51[_0x0128('0x33')][_0x0128('0x3d')]);_0x7f92d7[_0x0128('0x41')]=qs[_0x0128('0x3e')](_['pick'](_0x275a51[_0x0128('0x33')],_0x367ccc[_0x0128('0x3e')]));if(_0x275a51['query'][_0x0128('0x40')]){_0x7f92d7[_0x0128('0x41')]=_[_0x0128('0x42')](_0x7f92d7['where'],{'$or':_[_0x0128('0x2d')](_0x7f92d7[_0x0128('0x37')],function(_0x3191a8){var _0x345f95={};_0x345f95[_0x3191a8]={'$like':'%'+_0x275a51['query'][_0x0128('0x40')]+'%'};return _0x345f95;})});}_0x7f92d7=_['merge']({},_0x7f92d7,_0x275a51['options']);return _0x55be28[_0x0128('0x54')](_0x7f92d7);}})[_0x0128('0x26')](function(_0x4c1011){if(_0x4c1011){_0x2445cc=_0x4c1011[_0x0128('0x39')];if(!_0x275a51[_0x0128('0x33')][_0x0128('0x3a')](_0x0128('0x3b'))){_0x7f92d7[_0x0128('0x20')]=qs[_0x0128('0x20')](_0x275a51[_0x0128('0x33')][_0x0128('0x20')]);_0x7f92d7[_0x0128('0x1f')]=qs[_0x0128('0x1f')](_0x275a51[_0x0128('0x33')]['offset']);}return _0x55be28[_0x0128('0x54')](_0x7f92d7);}})['then'](function(_0xc51f81){if(_0xc51f81){return _0xc51f81?{'count':_0x2445cc,'rows':_0xc51f81}:null;}})[_0x0128('0x26')](respondWithResult(_0x40c767,null))[_0x0128('0x4e')](handleError(_0x40c767,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index ce202cc..6bad620 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 _0xe0a5=['int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration'];(function(_0x23c8c9,_0x31fd3d){var _0x4b9287=function(_0x3576a4){while(--_0x3576a4){_0x23c8c9['push'](_0x23c8c9['shift']());}};_0x4b9287(++_0x31fd3d);}(_0xe0a5,0x6d));var _0x5e0a=function(_0x3b660f,_0x45c3db){_0x3b660f=_0x3b660f-0x0;var _0x187a29=_0xe0a5[_0x3b660f];return _0x187a29;};'use strict';var _=require(_0x5e0a('0x0'));var util=require(_0x5e0a('0x1'));var logger=require(_0x5e0a('0x2'))(_0x5e0a('0x3'));var moment=require('moment');var BPromise=require(_0x5e0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e0a('0x5'));var config=require(_0x5e0a('0x6'));var attributes=require(_0x5e0a('0x7'));module[_0x5e0a('0x8')]=function(_0x4258ed,_0x265216){return _0x4258ed[_0x5e0a('0x9')](_0x5e0a('0xa'),attributes,{'tableName':_0x5e0a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ed5=['define','SalesforceConfiguration','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x26e780,_0x5465ba){var _0x2e9594=function(_0x5212df){while(--_0x5212df){_0x26e780['push'](_0x26e780['shift']());}};_0x2e9594(++_0x5465ba);}(_0x6ed5,0x86));var _0x56ed=function(_0x2d6fd9,_0x288abe){_0x2d6fd9=_0x2d6fd9-0x0;var _0x2622f2=_0x6ed5[_0x2d6fd9];return _0x2622f2;};'use strict';var _=require(_0x56ed('0x0'));var util=require(_0x56ed('0x1'));var logger=require(_0x56ed('0x2'))(_0x56ed('0x3'));var moment=require('moment');var BPromise=require(_0x56ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56ed('0x5'));var rimraf=require(_0x56ed('0x6'));var config=require(_0x56ed('0x7'));var attributes=require(_0x56ed('0x8'));module[_0x56ed('0x9')]=function(_0x7a21ed,_0x10e6a9){return _0x7a21ed[_0x56ed('0xa')](_0x56ed('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 3c14c14..b4ca058 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 _0xf89b=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xdb596e,_0x5d6d42){var _0x4b6c87=function(_0x589f00){while(--_0x589f00){_0xdb596e['push'](_0xdb596e['shift']());}};_0x4b6c87(++_0x5d6d42);}(_0xf89b,0x1e8));var _0xbf89=function(_0x2551d9,_0x2aff63){_0x2551d9=_0x2551d9-0x0;var _0x20216a=_0xf89b[_0x2551d9];return _0x20216a;};'use strict';var _=require(_0xbf89('0x0'));var util=require(_0xbf89('0x1'));var moment=require(_0xbf89('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf89('0x3'));var fs=require('fs');var Redis=require(_0xbf89('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf89('0x5'));var logger=require(_0xbf89('0x6'))(_0xbf89('0x7'));var config=require(_0xbf89('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf89('0x9')][_0xbf89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1372fd,_0x307aaf,_0xcef05a){return new BPromise(function(_0x53056a,_0x1efe5d){return client[_0xbf89('0xb')](_0x1372fd,_0xcef05a)[_0xbf89('0xc')](function(_0x20311e){logger[_0xbf89('0xd')](_0xbf89('0xe'),_0x307aaf,_0xbf89('0xf'));logger[_0xbf89('0x10')](_0xbf89('0x11'),_0x307aaf,_0xbf89('0xf'),JSON['stringify'](_0x20311e));if(_0x20311e[_0xbf89('0x12')]){if(_0x20311e['error'][_0xbf89('0x13')]===0x1f4){logger['error'](_0xbf89('0xe'),_0x307aaf,_0x20311e[_0xbf89('0x12')]['message']);return _0x1efe5d(_0x20311e[_0xbf89('0x12')][_0xbf89('0x14')]);}logger[_0xbf89('0x12')](_0xbf89('0xe'),_0x307aaf,_0x20311e[_0xbf89('0x12')]['message']);return _0x53056a(_0x20311e['error'][_0xbf89('0x14')]);}else{logger[_0xbf89('0xd')](_0xbf89('0xe'),_0x307aaf,_0xbf89('0xf'));_0x53056a(_0x20311e['result'][_0xbf89('0x14')]);}})['catch'](function(_0x2aba3b){logger[_0xbf89('0x12')](_0xbf89('0xe'),_0x307aaf,_0x2aba3b);_0x1efe5d(_0x2aba3b);});});} \ No newline at end of file +var _0x0fa7=['client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x0fa7,0x1be));var _0x70fa=function(_0x137d0c,_0x133d7e){_0x137d0c=_0x137d0c-0x0;var _0x51f5ea=_0x0fa7[_0x137d0c];return _0x51f5ea;};'use strict';var _=require(_0x70fa('0x0'));var util=require(_0x70fa('0x1'));var moment=require(_0x70fa('0x2'));var BPromise=require(_0x70fa('0x3'));var rs=require(_0x70fa('0x4'));var fs=require('fs');var Redis=require(_0x70fa('0x5'));var db=require(_0x70fa('0x6'))['db'];var utils=require(_0x70fa('0x7'));var logger=require(_0x70fa('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x70fa('0x9'));var client=jayson[_0x70fa('0xa')][_0x70fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d2373,_0x23d3f5,_0x18151b){return new BPromise(function(_0x58ed38,_0x5b094f){return client[_0x70fa('0xc')](_0x5d2373,_0x18151b)[_0x70fa('0xd')](function(_0x2dd4bc){logger[_0x70fa('0xe')](_0x70fa('0xf'),_0x23d3f5,_0x70fa('0x10'));logger['debug'](_0x70fa('0x11'),_0x23d3f5,_0x70fa('0x10'),JSON[_0x70fa('0x12')](_0x2dd4bc));if(_0x2dd4bc['error']){if(_0x2dd4bc[_0x70fa('0x13')][_0x70fa('0x14')]===0x1f4){logger[_0x70fa('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x23d3f5,_0x2dd4bc[_0x70fa('0x13')][_0x70fa('0x15')]);return _0x5b094f(_0x2dd4bc[_0x70fa('0x13')]['message']);}logger[_0x70fa('0x13')](_0x70fa('0xf'),_0x23d3f5,_0x2dd4bc['error'][_0x70fa('0x15')]);return _0x58ed38(_0x2dd4bc[_0x70fa('0x13')][_0x70fa('0x15')]);}else{logger[_0x70fa('0xe')](_0x70fa('0xf'),_0x23d3f5,_0x70fa('0x10'));_0x58ed38(_0x2dd4bc[_0x70fa('0x16')][_0x70fa('0x15')]);}})[_0x70fa('0x17')](function(_0x48ab81){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x23d3f5,_0x48ab81);_0x5b094f(_0x48ab81);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 434cf91..86d3d2e 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 _0x4c89=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x1b497c,_0x541139){var _0x4d1f5d=function(_0x4445f1){while(--_0x4445f1){_0x1b497c['push'](_0x1b497c['shift']());}};_0x4d1f5d(++_0x541139);}(_0x4c89,0x10c));var _0x94c8=function(_0x12e569,_0x6fa2ed){_0x12e569=_0x12e569-0x0;var _0x327210=_0x4c89[_0x12e569];return _0x327210;};'use strict';var multer=require('multer');var util=require(_0x94c8('0x0'));var path=require(_0x94c8('0x1'));var timeout=require('connect-timeout');var express=require(_0x94c8('0x2'));var router=express['Router']();var fs_extra=require(_0x94c8('0x3'));var auth=require(_0x94c8('0x4'));var interaction=require(_0x94c8('0x5'));var config=require(_0x94c8('0x6'));var controller=require(_0x94c8('0x7'));router[_0x94c8('0x8')]('/',auth[_0x94c8('0x9')](),controller['index']);router[_0x94c8('0x8')](_0x94c8('0xa'),auth[_0x94c8('0x9')](),controller[_0x94c8('0xb')]);router[_0x94c8('0xc')]('/',auth[_0x94c8('0x9')](),controller[_0x94c8('0xd')]);router[_0x94c8('0xe')](_0x94c8('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x94c8('0xf')](_0x94c8('0xa'),auth['isAuthenticated'](),controller[_0x94c8('0x10')]);module[_0x94c8('0x11')]=router; \ No newline at end of file +var _0x0613=['/:id','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0613,0xa9));var _0x3061=function(_0x413410,_0xf7ac22){_0x413410=_0x413410-0x0;var _0x1294e5=_0x0613[_0x413410];return _0x1294e5;};'use strict';var multer=require(_0x3061('0x0'));var util=require('util');var path=require(_0x3061('0x1'));var timeout=require(_0x3061('0x2'));var express=require('express');var router=express[_0x3061('0x3')]();var fs_extra=require(_0x3061('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3061('0x5'));var config=require(_0x3061('0x6'));var controller=require(_0x3061('0x7'));router[_0x3061('0x8')]('/',auth[_0x3061('0x9')](),controller[_0x3061('0xa')]);router[_0x3061('0x8')](_0x3061('0xb'),auth[_0x3061('0x9')](),controller['show']);router[_0x3061('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3061('0xd')](_0x3061('0xb'),auth[_0x3061('0x9')](),controller[_0x3061('0xe')]);router[_0x3061('0xf')](_0x3061('0xb'),auth[_0x3061('0x9')](),controller[_0x3061('0x10')]);module[_0x3061('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 7d7e390..96720b9 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 _0xa10b=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x553d22,_0x16d53c){var _0x1b4df3=function(_0x3f003b){while(--_0x3f003b){_0x553d22['push'](_0x553d22['shift']());}};_0x1b4df3(++_0x16d53c);}(_0xa10b,0xf8));var _0xba10=function(_0x1d39a1,_0x25694c){_0x1d39a1=_0x1d39a1-0x0;var _0x491a69=_0xa10b[_0x1d39a1];return _0x491a69;};'use strict';var Sequelize=require(_0xba10('0x0'));module[_0xba10('0x1')]={'type':{'type':Sequelize[_0xba10('0x2')](_0xba10('0x3'),_0xba10('0x4'),_0xba10('0x5'),_0xba10('0x6'),_0xba10('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba10('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xba10('0x2')](_0xba10('0x3'),_0xba10('0x4'),_0xba10('0x5'))},'keyContent':{'type':Sequelize[_0xba10('0x8')]},'idField':{'type':Sequelize[_0xba10('0x8')]},'variableName':{'type':Sequelize[_0xba10('0x8')]}}; \ No newline at end of file +var _0x3067=['keyValue','picklist','string','STRING','customVariable','sequelize','ENUM','variable'];(function(_0x48ab04,_0x160f27){var _0x1904e4=function(_0x8bacd9){while(--_0x8bacd9){_0x48ab04['push'](_0x48ab04['shift']());}};_0x1904e4(++_0x160f27);}(_0x3067,0x12d));var _0x7306=function(_0x416905,_0x1c82a1){_0x416905=_0x416905-0x0;var _0x41cf3c=_0x3067[_0x416905];return _0x41cf3c;};'use strict';var Sequelize=require(_0x7306('0x0'));module['exports']={'type':{'type':Sequelize[_0x7306('0x1')]('string',_0x7306('0x2'),'customVariable',_0x7306('0x3'),_0x7306('0x4')),'defaultValue':_0x7306('0x5')},'content':{'type':Sequelize[_0x7306('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7306('0x5'),_0x7306('0x2'),_0x7306('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7306('0x6')]},'variableName':{'type':Sequelize[_0x7306('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9b0cbe3..3caaecb 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 _0x6a78=['api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x6a78,0x1c4));var _0x86a7=function(_0xde5b84,_0x10505a){_0xde5b84=_0xde5b84-0x0;var _0x45cc53=_0x6a78[_0xde5b84];return _0x45cc53;};'use strict';var emlformat=require(_0x86a7('0x0'));var rimraf=require(_0x86a7('0x1'));var zipdir=require(_0x86a7('0x2'));var jsonpatch=require(_0x86a7('0x3'));var rp=require(_0x86a7('0x4'));var moment=require(_0x86a7('0x5'));var BPromise=require(_0x86a7('0x6'));var Mustache=require(_0x86a7('0x7'));var util=require(_0x86a7('0x8'));var path=require(_0x86a7('0x9'));var sox=require('sox');var csv=require(_0x86a7('0xa'));var ejs=require(_0x86a7('0xb'));var fs=require('fs');var fs_extra=require(_0x86a7('0xc'));var _=require(_0x86a7('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86a7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x86a7('0xa'));var querystring=require('querystring');var Papa=require(_0x86a7('0xf'));var Redis=require(_0x86a7('0x10'));var authService=require(_0x86a7('0x11'));var qs=require(_0x86a7('0x12'));var as=require(_0x86a7('0x13'));var hardwareService=require(_0x86a7('0x14'));var logger=require(_0x86a7('0x15'))(_0x86a7('0x16'));var utils=require(_0x86a7('0x17'));var config=require(_0x86a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14a6aa,_0x3ca04d){_0x3ca04d=_0x3ca04d||0xcc;return function(_0x2f56cc){if(_0x2f56cc){return _0x14a6aa[_0x86a7('0x19')](_0x3ca04d);}return _0x14a6aa[_0x86a7('0x1a')](_0x3ca04d)[_0x86a7('0x1b')]();};}function respondWithResult(_0x3c83bb,_0x130f0c){_0x130f0c=_0x130f0c||0xc8;return function(_0x4b1334){if(_0x4b1334){return _0x3c83bb[_0x86a7('0x1a')](_0x130f0c)[_0x86a7('0x1c')](_0x4b1334);}};}function respondWithFilteredResult(_0x8c56ef,_0x5a6a69){return function(_0x3a77ec){if(_0x3a77ec){var _0x6b129=typeof _0x5a6a69['offset']===_0x86a7('0x1d')&&typeof _0x5a6a69[_0x86a7('0x1e')]==='undefined';var _0x29ec02=_0x3a77ec[_0x86a7('0x1f')];var _0x5c2837=_0x6b129?0x0:_0x5a6a69[_0x86a7('0x20')];var _0x2aae27=_0x6b129?_0x3a77ec[_0x86a7('0x1f')]:_0x5a6a69[_0x86a7('0x20')]+_0x5a6a69[_0x86a7('0x1e')];var _0x43641f;if(_0x2aae27>=_0x29ec02){_0x2aae27=_0x29ec02;_0x43641f=0xc8;}else{_0x43641f=0xce;}_0x8c56ef[_0x86a7('0x1a')](_0x43641f);return _0x8c56ef[_0x86a7('0x21')](_0x86a7('0x22'),_0x5c2837+'-'+_0x2aae27+'/'+_0x29ec02)['json'](_0x3a77ec);}return null;};}function patchUpdates(_0x53c5ae){return function(_0x43345b){try{jsonpatch[_0x86a7('0x23')](_0x43345b,_0x53c5ae,!![]);}catch(_0xe8dc94){return BPromise[_0x86a7('0x24')](_0xe8dc94);}return _0x43345b[_0x86a7('0x25')]();};}function saveUpdates(_0x3b3f92,_0x30e344){return function(_0x1baf10){if(_0x1baf10){return _0x1baf10[_0x86a7('0x26')](_0x3b3f92)[_0x86a7('0x27')](function(_0x3a091d){return _0x3a091d;});}return null;};}function removeEntity(_0xa1d483,_0x23b1db){return function(_0x563bff){if(_0x563bff){return _0x563bff[_0x86a7('0x28')]()[_0x86a7('0x27')](function(){_0xa1d483[_0x86a7('0x1a')](0xcc)[_0x86a7('0x1b')]();});}};}function handleEntityNotFound(_0x432c47,_0x540964){return function(_0xab0613){if(!_0xab0613){_0x432c47[_0x86a7('0x19')](0x194);}return _0xab0613;};}function handleError(_0x2a3fb8,_0xaede3){_0xaede3=_0xaede3||0x1f4;return function(_0x18deef){logger[_0x86a7('0x29')](_0x18deef[_0x86a7('0x2a')]);if(_0x18deef['name']){delete _0x18deef[_0x86a7('0x2b')];}_0x2a3fb8['status'](_0xaede3)[_0x86a7('0x2c')](_0x18deef);};}exports[_0x86a7('0x2d')]=function(_0x7cf9bb,_0x40f4aa){var _0x129067={},_0xd5439={},_0x2144e5={'count':0x0,'rows':[]};var _0x1650ae=_[_0x86a7('0x2e')](db[_0x86a7('0x2f')]['rawAttributes'],function(_0x153038){return{'name':_0x153038[_0x86a7('0x30')],'type':_0x153038['type'][_0x86a7('0x31')]};});_0xd5439[_0x86a7('0x32')]=_[_0x86a7('0x2e')](_0x1650ae,_0x86a7('0x2b'));_0xd5439[_0x86a7('0x33')]=_[_0x86a7('0x34')](_0x7cf9bb[_0x86a7('0x33')]);_0xd5439['filters']=_[_0x86a7('0x35')](_0xd5439[_0x86a7('0x32')],_0xd5439[_0x86a7('0x33')]);_0x129067[_0x86a7('0x36')]=_[_0x86a7('0x35')](_0xd5439['model'],qs[_0x86a7('0x37')](_0x7cf9bb['query'][_0x86a7('0x37')]));_0x129067['attributes']=_0x129067['attributes'][_0x86a7('0x38')]?_0x129067[_0x86a7('0x36')]:_0xd5439[_0x86a7('0x32')];if(!_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x39')](_0x86a7('0x3a'))){_0x129067[_0x86a7('0x1e')]=qs['limit'](_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x1e')]);_0x129067[_0x86a7('0x20')]=qs[_0x86a7('0x20')](_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x20')]);}_0x129067[_0x86a7('0x3b')]=qs[_0x86a7('0x3c')](_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x3c')]);_0x129067['where']=qs[_0x86a7('0x3d')](_[_0x86a7('0x3e')](_0x7cf9bb['query'],_0xd5439[_0x86a7('0x3d')]),_0x1650ae);if(_0x7cf9bb[_0x86a7('0x33')]['filter']){_0x129067[_0x86a7('0x3f')]=_['merge'](_0x129067[_0x86a7('0x3f')],{'$or':_[_0x86a7('0x2e')](_0x1650ae,function(_0x4bd88d){if(_0x4bd88d['type']!==_0x86a7('0x40')){var _0x23b0c2={};_0x23b0c2[_0x4bd88d[_0x86a7('0x2b')]]={'$like':'%'+_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x41')]+'%'};return _0x23b0c2;}})});}_0x129067=_['merge']({},_0x129067,_0x7cf9bb[_0x86a7('0x42')]);var _0x4873f8={'where':_0x129067[_0x86a7('0x3f')]};return db[_0x86a7('0x2f')][_0x86a7('0x1f')](_0x4873f8)[_0x86a7('0x27')](function(_0x4a6e86){_0x2144e5[_0x86a7('0x1f')]=_0x4a6e86;if(_0x7cf9bb[_0x86a7('0x33')]['includeAll']){_0x129067[_0x86a7('0x43')]=[{'all':!![]}];}return db['SalesforceField'][_0x86a7('0x44')](_0x129067);})['then'](function(_0x37ad04){_0x2144e5[_0x86a7('0x45')]=_0x37ad04;return _0x2144e5;})[_0x86a7('0x27')](respondWithFilteredResult(_0x40f4aa,_0x129067))[_0x86a7('0x46')](handleError(_0x40f4aa,null));};exports[_0x86a7('0x47')]=function(_0x37fda7,_0x25eb51){var _0x154974={'raw':!![],'where':{'id':_0x37fda7[_0x86a7('0x48')]['id']}},_0x232504={};_0x232504[_0x86a7('0x32')]=_[_0x86a7('0x34')](db[_0x86a7('0x2f')][_0x86a7('0x49')]);_0x232504[_0x86a7('0x33')]=_['keys'](_0x37fda7[_0x86a7('0x33')]);_0x232504[_0x86a7('0x3d')]=_[_0x86a7('0x35')](_0x232504['model'],_0x232504[_0x86a7('0x33')]);_0x154974[_0x86a7('0x36')]=_['intersection'](_0x232504[_0x86a7('0x32')],qs[_0x86a7('0x37')](_0x37fda7[_0x86a7('0x33')][_0x86a7('0x37')]));_0x154974['attributes']=_0x154974[_0x86a7('0x36')][_0x86a7('0x38')]?_0x154974[_0x86a7('0x36')]:_0x232504[_0x86a7('0x32')];if(_0x37fda7[_0x86a7('0x33')][_0x86a7('0x4a')]){_0x154974[_0x86a7('0x43')]=[{'all':!![]}];}_0x154974=_[_0x86a7('0x4b')]({},_0x154974,_0x37fda7['options']);return db[_0x86a7('0x2f')]['find'](_0x154974)[_0x86a7('0x27')](handleEntityNotFound(_0x25eb51,null))[_0x86a7('0x27')](respondWithResult(_0x25eb51,null))[_0x86a7('0x46')](handleError(_0x25eb51,null));};exports[_0x86a7('0x4c')]=function(_0x3f99ff,_0x32fe87){return db['SalesforceField'][_0x86a7('0x4c')](_0x3f99ff[_0x86a7('0x4d')],{})[_0x86a7('0x27')](respondWithResult(_0x32fe87,0xc9))[_0x86a7('0x46')](handleError(_0x32fe87,null));};exports[_0x86a7('0x26')]=function(_0x299d47,_0x1b498c){if(_0x299d47[_0x86a7('0x4d')]['id']){delete _0x299d47[_0x86a7('0x4d')]['id'];}return db[_0x86a7('0x2f')][_0x86a7('0x4e')]({'where':{'id':_0x299d47[_0x86a7('0x48')]['id']}})[_0x86a7('0x27')](handleEntityNotFound(_0x1b498c,null))[_0x86a7('0x27')](saveUpdates(_0x299d47[_0x86a7('0x4d')],null))['then'](respondWithResult(_0x1b498c,null))[_0x86a7('0x46')](handleError(_0x1b498c,null));};exports[_0x86a7('0x28')]=function(_0x5f00e7,_0x5e2e4f){return db[_0x86a7('0x2f')][_0x86a7('0x4e')]({'where':{'id':_0x5f00e7[_0x86a7('0x48')]['id']}})[_0x86a7('0x27')](handleEntityNotFound(_0x5e2e4f,null))[_0x86a7('0x27')](removeEntity(_0x5e2e4f,null))[_0x86a7('0x46')](handleError(_0x5e2e4f,null));}; \ No newline at end of file +var _0x4e0c=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','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','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x1e4b6c,_0xe313b6){var _0x1de2d0=function(_0x3746ea){while(--_0x3746ea){_0x1e4b6c['push'](_0x1e4b6c['shift']());}};_0x1de2d0(++_0xe313b6);}(_0x4e0c,0x1d5));var _0xc4e0=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x4e0c[_0x28a5ad];return _0x176b8a;};'use strict';var emlformat=require(_0xc4e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4e0('0x1'));var jsonpatch=require(_0xc4e0('0x2'));var rp=require('request-promise');var moment=require(_0xc4e0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc4e0('0x4'));var path=require('path');var sox=require(_0xc4e0('0x5'));var csv=require(_0xc4e0('0x6'));var ejs=require(_0xc4e0('0x7'));var fs=require('fs');var fs_extra=require(_0xc4e0('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4e0('0x9'));var jsforce=require(_0xc4e0('0xa'));var deskjs=require(_0xc4e0('0xb'));var toCsv=require(_0xc4e0('0x6'));var querystring=require(_0xc4e0('0xc'));var Papa=require(_0xc4e0('0xd'));var Redis=require(_0xc4e0('0xe'));var authService=require(_0xc4e0('0xf'));var qs=require(_0xc4e0('0x10'));var as=require(_0xc4e0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc4e0('0x12'))(_0xc4e0('0x13'));var utils=require(_0xc4e0('0x14'));var config=require(_0xc4e0('0x15'));var licenseUtil=require(_0xc4e0('0x16'));var db=require(_0xc4e0('0x17'))['db'];function respondWithStatusCode(_0x4e11d2,_0x4d0986){_0x4d0986=_0x4d0986||0xcc;return function(_0x3c2c6e){if(_0x3c2c6e){return _0x4e11d2[_0xc4e0('0x18')](_0x4d0986);}return _0x4e11d2['status'](_0x4d0986)[_0xc4e0('0x19')]();};}function respondWithResult(_0x3b292d,_0x569429){_0x569429=_0x569429||0xc8;return function(_0x406b07){if(_0x406b07){return _0x3b292d['status'](_0x569429)[_0xc4e0('0x1a')](_0x406b07);}};}function respondWithFilteredResult(_0x21b725,_0xfeed1a){return function(_0x5eee9f){if(_0x5eee9f){var _0x40b9a7=typeof _0xfeed1a[_0xc4e0('0x1b')]===_0xc4e0('0x1c')&&typeof _0xfeed1a[_0xc4e0('0x1d')]===_0xc4e0('0x1c');var _0x47ca04=_0x5eee9f['count'];var _0x3f97b4=_0x40b9a7?0x0:_0xfeed1a['offset'];var _0x8ea420=_0x40b9a7?_0x5eee9f[_0xc4e0('0x1e')]:_0xfeed1a[_0xc4e0('0x1b')]+_0xfeed1a[_0xc4e0('0x1d')];var _0x2df83f;if(_0x8ea420>=_0x47ca04){_0x8ea420=_0x47ca04;_0x2df83f=0xc8;}else{_0x2df83f=0xce;}_0x21b725[_0xc4e0('0x1f')](_0x2df83f);return _0x21b725[_0xc4e0('0x20')](_0xc4e0('0x21'),_0x3f97b4+'-'+_0x8ea420+'/'+_0x47ca04)[_0xc4e0('0x1a')](_0x5eee9f);}return null;};}function patchUpdates(_0x2157d7){return function(_0x266d3d){try{jsonpatch[_0xc4e0('0x22')](_0x266d3d,_0x2157d7,!![]);}catch(_0x4e09e2){return BPromise['reject'](_0x4e09e2);}return _0x266d3d[_0xc4e0('0x23')]();};}function saveUpdates(_0x6aeb56,_0x5b086e){return function(_0x2f96d3){if(_0x2f96d3){return _0x2f96d3[_0xc4e0('0x24')](_0x6aeb56)[_0xc4e0('0x25')](function(_0x3c0832){return _0x3c0832;});}return null;};}function removeEntity(_0x5dfe40,_0x23ed2b){return function(_0x5303ef){if(_0x5303ef){return _0x5303ef[_0xc4e0('0x26')]()[_0xc4e0('0x25')](function(){_0x5dfe40['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e2bc7,_0x58d9e1){return function(_0x278be5){if(!_0x278be5){_0x4e2bc7[_0xc4e0('0x18')](0x194);}return _0x278be5;};}function handleError(_0x4db90e,_0x449b0b){_0x449b0b=_0x449b0b||0x1f4;return function(_0x1aef9d){logger[_0xc4e0('0x27')](_0x1aef9d[_0xc4e0('0x28')]);if(_0x1aef9d[_0xc4e0('0x29')]){delete _0x1aef9d[_0xc4e0('0x29')];}_0x4db90e['status'](_0x449b0b)[_0xc4e0('0x2a')](_0x1aef9d);};}exports[_0xc4e0('0x2b')]=function(_0x415469,_0x5336c0){var _0x2539b2={},_0x2f2231={},_0x4f2936={'count':0x0,'rows':[]};var _0x46e132=_[_0xc4e0('0x2c')](db[_0xc4e0('0x2d')][_0xc4e0('0x2e')],function(_0x25112a){return{'name':_0x25112a[_0xc4e0('0x2f')],'type':_0x25112a[_0xc4e0('0x30')][_0xc4e0('0x31')]};});_0x2f2231[_0xc4e0('0x32')]=_[_0xc4e0('0x2c')](_0x46e132,'name');_0x2f2231[_0xc4e0('0x33')]=_[_0xc4e0('0x34')](_0x415469[_0xc4e0('0x33')]);_0x2f2231['filters']=_[_0xc4e0('0x35')](_0x2f2231[_0xc4e0('0x32')],_0x2f2231[_0xc4e0('0x33')]);_0x2539b2[_0xc4e0('0x36')]=_[_0xc4e0('0x35')](_0x2f2231[_0xc4e0('0x32')],qs[_0xc4e0('0x37')](_0x415469[_0xc4e0('0x33')][_0xc4e0('0x37')]));_0x2539b2[_0xc4e0('0x36')]=_0x2539b2['attributes'][_0xc4e0('0x38')]?_0x2539b2[_0xc4e0('0x36')]:_0x2f2231[_0xc4e0('0x32')];if(!_0x415469[_0xc4e0('0x33')][_0xc4e0('0x39')](_0xc4e0('0x3a'))){_0x2539b2[_0xc4e0('0x1d')]=qs[_0xc4e0('0x1d')](_0x415469[_0xc4e0('0x33')][_0xc4e0('0x1d')]);_0x2539b2['offset']=qs['offset'](_0x415469[_0xc4e0('0x33')]['offset']);}_0x2539b2[_0xc4e0('0x3b')]=qs[_0xc4e0('0x3c')](_0x415469['query'][_0xc4e0('0x3c')]);_0x2539b2[_0xc4e0('0x3d')]=qs[_0xc4e0('0x3e')](_['pick'](_0x415469[_0xc4e0('0x33')],_0x2f2231[_0xc4e0('0x3e')]),_0x46e132);if(_0x415469[_0xc4e0('0x33')]['filter']){_0x2539b2[_0xc4e0('0x3d')]=_[_0xc4e0('0x3f')](_0x2539b2[_0xc4e0('0x3d')],{'$or':_[_0xc4e0('0x2c')](_0x46e132,function(_0x11c077){if(_0x11c077[_0xc4e0('0x30')]!==_0xc4e0('0x40')){var _0x22c1f0={};_0x22c1f0[_0x11c077[_0xc4e0('0x29')]]={'$like':'%'+_0x415469[_0xc4e0('0x33')]['filter']+'%'};return _0x22c1f0;}})});}_0x2539b2=_[_0xc4e0('0x3f')]({},_0x2539b2,_0x415469[_0xc4e0('0x41')]);var _0xeb0a31={'where':_0x2539b2[_0xc4e0('0x3d')]};return db['SalesforceField'][_0xc4e0('0x1e')](_0xeb0a31)['then'](function(_0x5447af){_0x4f2936[_0xc4e0('0x1e')]=_0x5447af;if(_0x415469['query'][_0xc4e0('0x42')]){_0x2539b2[_0xc4e0('0x43')]=[{'all':!![]}];}return db['SalesforceField'][_0xc4e0('0x44')](_0x2539b2);})['then'](function(_0x177ac6){_0x4f2936[_0xc4e0('0x45')]=_0x177ac6;return _0x4f2936;})[_0xc4e0('0x25')](respondWithFilteredResult(_0x5336c0,_0x2539b2))[_0xc4e0('0x46')](handleError(_0x5336c0,null));};exports[_0xc4e0('0x47')]=function(_0xd11927,_0x167d5b){var _0x578d58={'raw':!![],'where':{'id':_0xd11927[_0xc4e0('0x48')]['id']}},_0x56b079={};_0x56b079[_0xc4e0('0x32')]=_[_0xc4e0('0x34')](db['SalesforceField'][_0xc4e0('0x2e')]);_0x56b079['query']=_['keys'](_0xd11927[_0xc4e0('0x33')]);_0x56b079[_0xc4e0('0x3e')]=_[_0xc4e0('0x35')](_0x56b079['model'],_0x56b079[_0xc4e0('0x33')]);_0x578d58[_0xc4e0('0x36')]=_[_0xc4e0('0x35')](_0x56b079[_0xc4e0('0x32')],qs[_0xc4e0('0x37')](_0xd11927[_0xc4e0('0x33')][_0xc4e0('0x37')]));_0x578d58[_0xc4e0('0x36')]=_0x578d58['attributes']['length']?_0x578d58[_0xc4e0('0x36')]:_0x56b079[_0xc4e0('0x32')];if(_0xd11927['query'][_0xc4e0('0x42')]){_0x578d58[_0xc4e0('0x43')]=[{'all':!![]}];}_0x578d58=_[_0xc4e0('0x3f')]({},_0x578d58,_0xd11927[_0xc4e0('0x41')]);return db['SalesforceField'][_0xc4e0('0x49')](_0x578d58)[_0xc4e0('0x25')](handleEntityNotFound(_0x167d5b,null))[_0xc4e0('0x25')](respondWithResult(_0x167d5b,null))[_0xc4e0('0x46')](handleError(_0x167d5b,null));};exports[_0xc4e0('0x4a')]=function(_0x17677a,_0x23f171){return db[_0xc4e0('0x2d')][_0xc4e0('0x4a')](_0x17677a[_0xc4e0('0x4b')],{})[_0xc4e0('0x25')](respondWithResult(_0x23f171,0xc9))['catch'](handleError(_0x23f171,null));};exports[_0xc4e0('0x24')]=function(_0x428296,_0x238e9a){if(_0x428296[_0xc4e0('0x4b')]['id']){delete _0x428296[_0xc4e0('0x4b')]['id'];}return db[_0xc4e0('0x2d')][_0xc4e0('0x49')]({'where':{'id':_0x428296[_0xc4e0('0x48')]['id']}})['then'](handleEntityNotFound(_0x238e9a,null))[_0xc4e0('0x25')](saveUpdates(_0x428296['body'],null))[_0xc4e0('0x25')](respondWithResult(_0x238e9a,null))[_0xc4e0('0x46')](handleError(_0x238e9a,null));};exports[_0xc4e0('0x26')]=function(_0x358c5e,_0x4e0e90){return db[_0xc4e0('0x2d')]['find']({'where':{'id':_0x358c5e[_0xc4e0('0x48')]['id']}})[_0xc4e0('0x25')](handleEntityNotFound(_0x4e0e90,null))[_0xc4e0('0x25')](removeEntity(_0x4e0e90,null))[_0xc4e0('0x46')](handleError(_0x4e0e90,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2154459..0675b00 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 _0xcbb3=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','lodash','util','../../config/logger','api','moment'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0xcbb3,0xb1));var _0x3cbb=function(_0x4282ae,_0x417623){_0x4282ae=_0x4282ae-0x0;var _0x2ab8f6=_0xcbb3[_0x4282ae];return _0x2ab8f6;};'use strict';var _=require(_0x3cbb('0x0'));var util=require(_0x3cbb('0x1'));var logger=require(_0x3cbb('0x2'))(_0x3cbb('0x3'));var moment=require(_0x3cbb('0x4'));var BPromise=require('bluebird');var rp=require(_0x3cbb('0x5'));var fs=require('fs');var path=require(_0x3cbb('0x6'));var rimraf=require(_0x3cbb('0x7'));var config=require(_0x3cbb('0x8'));var attributes=require(_0x3cbb('0x9'));module[_0x3cbb('0xa')]=function(_0x51b3df,_0x4d2772){return _0x51b3df[_0x3cbb('0xb')](_0x3cbb('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64f7=['salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','request-promise','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0xb2c409,_0x17abee){var _0x5ee509=function(_0x239d72){while(--_0x239d72){_0xb2c409['push'](_0xb2c409['shift']());}};_0x5ee509(++_0x17abee);}(_0x64f7,0xe0));var _0x764f=function(_0x34a812,_0x22f2bd){_0x34a812=_0x34a812-0x0;var _0x6de813=_0x64f7[_0x34a812];return _0x6de813;};'use strict';var _=require(_0x764f('0x0'));var util=require('util');var logger=require(_0x764f('0x1'))(_0x764f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x764f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x764f('0x4'));var config=require('../../config/environment');var attributes=require(_0x764f('0x5'));module[_0x764f('0x6')]=function(_0x3ba68d,_0x405234){return _0x3ba68d[_0x764f('0x7')](_0x764f('0x8'),attributes,{'tableName':_0x764f('0x9'),'paranoid':![],'indexes':[{'name':_0x764f('0xa'),'fields':[_0x764f('0xb'),_0x764f('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 2ad2be9..a96d1d2 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 _0xf966=['jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x1daa41,_0x5b237e){var _0x11b50c=function(_0x4db01){while(--_0x4db01){_0x1daa41['push'](_0x1daa41['shift']());}};_0x11b50c(++_0x5b237e);}(_0xf966,0x185));var _0x6f96=function(_0x38c747,_0x4d29e0){_0x38c747=_0x38c747-0x0;var _0x1ec59e=_0xf966[_0x38c747];return _0x1ec59e;};'use strict';var _=require(_0x6f96('0x0'));var util=require('util');var moment=require(_0x6f96('0x1'));var BPromise=require(_0x6f96('0x2'));var rs=require(_0x6f96('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f96('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f96('0x5'));var config=require(_0x6f96('0x6'));var jayson=require(_0x6f96('0x7'));var client=jayson[_0x6f96('0x8')][_0x6f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5893b9,_0xeb7a29,_0x48a2e2){return new BPromise(function(_0x466963,_0x4bd501){return client[_0x6f96('0xa')](_0x5893b9,_0x48a2e2)[_0x6f96('0xb')](function(_0x3374e1){logger[_0x6f96('0xc')](_0x6f96('0xd'),_0xeb7a29,_0x6f96('0xe'));logger[_0x6f96('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0xeb7a29,_0x6f96('0xe'),JSON[_0x6f96('0x10')](_0x3374e1));if(_0x3374e1[_0x6f96('0x11')]){if(_0x3374e1[_0x6f96('0x11')][_0x6f96('0x12')]===0x1f4){logger[_0x6f96('0x11')](_0x6f96('0xd'),_0xeb7a29,_0x3374e1[_0x6f96('0x11')]['message']);return _0x4bd501(_0x3374e1[_0x6f96('0x11')]['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0xeb7a29,_0x3374e1[_0x6f96('0x11')][_0x6f96('0x13')]);return _0x466963(_0x3374e1[_0x6f96('0x11')][_0x6f96('0x13')]);}else{logger['info'](_0x6f96('0xd'),_0xeb7a29,_0x6f96('0xe'));_0x466963(_0x3374e1[_0x6f96('0x14')][_0x6f96('0x13')]);}})[_0x6f96('0x15')](function(_0x1825a3){logger[_0x6f96('0x11')](_0x6f96('0xd'),_0xeb7a29,_0x1825a3);_0x4bd501(_0x1825a3);});});} \ No newline at end of file +var _0x7a27=['request\x20sent','stringify','error','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x7a27,0xa4));var _0x77a2=function(_0x1ec659,_0x25b05d){_0x1ec659=_0x1ec659-0x0;var _0x546e3a=_0x7a27[_0x1ec659];return _0x546e3a;};'use strict';var _=require('lodash');var util=require(_0x77a2('0x0'));var moment=require('moment');var BPromise=require(_0x77a2('0x1'));var rs=require(_0x77a2('0x2'));var fs=require('fs');var Redis=require(_0x77a2('0x3'));var db=require(_0x77a2('0x4'))['db'];var utils=require(_0x77a2('0x5'));var logger=require(_0x77a2('0x6'))(_0x77a2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x76d44b,_0x2f6b62,_0x15bc0f){return new BPromise(function(_0x1c1d34,_0x5554ac){return client[_0x77a2('0x8')](_0x76d44b,_0x15bc0f)[_0x77a2('0x9')](function(_0x1e6880){logger[_0x77a2('0xa')](_0x77a2('0xb'),_0x2f6b62,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2f6b62,_0x77a2('0xc'),JSON[_0x77a2('0xd')](_0x1e6880));if(_0x1e6880[_0x77a2('0xe')]){if(_0x1e6880[_0x77a2('0xe')]['code']===0x1f4){logger[_0x77a2('0xe')](_0x77a2('0xb'),_0x2f6b62,_0x1e6880[_0x77a2('0xe')][_0x77a2('0xf')]);return _0x5554ac(_0x1e6880[_0x77a2('0xe')]['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x2f6b62,_0x1e6880[_0x77a2('0xe')][_0x77a2('0xf')]);return _0x1c1d34(_0x1e6880[_0x77a2('0xe')][_0x77a2('0xf')]);}else{logger['info'](_0x77a2('0xb'),_0x2f6b62,_0x77a2('0xc'));_0x1c1d34(_0x1e6880['result'][_0x77a2('0xf')]);}})['catch'](function(_0x27faa8){logger['error'](_0x77a2('0xb'),_0x2f6b62,_0x27faa8);_0x5554ac(_0x27faa8);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b1de9fc..7d22913 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 _0x3e1d=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x9f4e39,_0x570664){var _0x59ab98=function(_0x4ae806){while(--_0x4ae806){_0x9f4e39['push'](_0x9f4e39['shift']());}};_0x59ab98(++_0x570664);}(_0x3e1d,0xad));var _0xd3e1=function(_0x28a245,_0x1d817a){_0x28a245=_0x28a245-0x0;var _0x1bfce6=_0x3e1d[_0x28a245];return _0x1bfce6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd3e1('0x0'));var timeout=require(_0xd3e1('0x1'));var express=require('express');var router=express[_0xd3e1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd3e1('0x3'));var interaction=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var controller=require('./intServicenowAccount.controller');router[_0xd3e1('0x6')]('/',auth[_0xd3e1('0x7')](),controller[_0xd3e1('0x8')]);router[_0xd3e1('0x6')](_0xd3e1('0x9'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0xa')]);router[_0xd3e1('0x6')](_0xd3e1('0xb'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0xc')]);router[_0xd3e1('0x6')](_0xd3e1('0xd'),auth[_0xd3e1('0x7')](),controller['getFields']);router['post']('/',auth[_0xd3e1('0x7')](),controller[_0xd3e1('0xe')]);router[_0xd3e1('0xf')](_0xd3e1('0xb'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0x10')]);router['put']('/:id',auth[_0xd3e1('0x7')](),controller['update']);router[_0xd3e1('0x11')](_0xd3e1('0x9'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0x12')]);module[_0xd3e1('0x13')]=router; \ No newline at end of file +var _0xa4de=['../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f7902,_0x5347f3){var _0x1e5a1e=function(_0x3234a5){while(--_0x3234a5){_0x3f7902['push'](_0x3f7902['shift']());}};_0x1e5a1e(++_0x5347f3);}(_0xa4de,0x10d));var _0xea4d=function(_0x497b50,_0x5ef01f){_0x497b50=_0x497b50-0x0;var _0x57c4a3=_0xa4de[_0x497b50];return _0x57c4a3;};'use strict';var multer=require(_0xea4d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea4d('0x1'));var express=require(_0xea4d('0x2'));var router=express[_0xea4d('0x3')]();var fs_extra=require(_0xea4d('0x4'));var auth=require(_0xea4d('0x5'));var interaction=require(_0xea4d('0x6'));var config=require(_0xea4d('0x7'));var controller=require(_0xea4d('0x8'));router[_0xea4d('0x9')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0xb')]);router[_0xea4d('0x9')]('/:id',auth[_0xea4d('0xa')](),controller['show']);router[_0xea4d('0x9')](_0xea4d('0xc'),auth[_0xea4d('0xa')](),controller[_0xea4d('0xd')]);router[_0xea4d('0x9')](_0xea4d('0xe'),auth[_0xea4d('0xa')](),controller[_0xea4d('0xf')]);router[_0xea4d('0x10')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0x11')]);router[_0xea4d('0x10')]('/:id/configurations',auth[_0xea4d('0xa')](),controller[_0xea4d('0x12')]);router[_0xea4d('0x13')](_0xea4d('0x14'),auth[_0xea4d('0xa')](),controller['update']);router[_0xea4d('0x15')](_0xea4d('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0xea4d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f68c93c..0c87f34 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 _0x98b7=['remoteUri','sequelize','STRING'];(function(_0x54d5ba,_0x1f1ba9){var _0x6a592e=function(_0x394f8d){while(--_0x394f8d){_0x54d5ba['push'](_0x54d5ba['shift']());}};_0x6a592e(++_0x1f1ba9);}(_0x98b7,0x1f0));var _0x798b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x98b7[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x798b('0x0'));module['exports']={'name':{'type':Sequelize[_0x798b('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x798b('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x798b('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x798b('0x2')},'serverUrl':{'type':Sequelize[_0x798b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe635=['exports','STRING','username','remoteUri'];(function(_0x400ae0,_0x1490e4){var _0x4d2526=function(_0x54d2f0){while(--_0x54d2f0){_0x400ae0['push'](_0x400ae0['shift']());}};_0x4d2526(++_0x1490e4);}(_0xe635,0xb4));var _0x5e63=function(_0x9070b3,_0x206198){_0x9070b3=_0x9070b3-0x0;var _0x1bb8ba=_0xe635[_0x9070b3];return _0x1bb8ba;};'use strict';var Sequelize=require('sequelize');module[_0x5e63('0x0')]={'name':{'type':Sequelize[_0x5e63('0x1')]},'description':{'type':Sequelize[_0x5e63('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x5e63('0x2')},'password':{'type':Sequelize[_0x5e63('0x1')]},'email':{'type':Sequelize[_0x5e63('0x1')]},'remoteUri':{'type':Sequelize[_0x5e63('0x1')],'unique':_0x5e63('0x3')},'serverUrl':{'type':Sequelize[_0x5e63('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 c965510..dd56a5a 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 _0x8e2b=['../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','index','ServicenowAccount','rawAttributes','fieldName','type','map','name','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','keys','ServicenowConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','sys_updated_by','opened_by','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','correlation_display','assignment_group','business_stc','additional_assignee_list','description','notify','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','comments_and_work_notes','due_date','sys_mod_count','escalation','upon_approval','correlation_id','location','findOne','username','password','remoteUri','serverUrl','substring','format','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','forEach','internalType','label','push','all','assign','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','stack','send','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x2f16e5,_0x2e75e0){var _0x5d082a=function(_0x13873b){while(--_0x13873b){_0x2f16e5['push'](_0x2f16e5['shift']());}};_0x5d082a(++_0x2e75e0);}(_0x8e2b,0x15a));var _0xb8e2=function(_0x34edc9,_0x4afd1c){_0x34edc9=_0x34edc9-0x0;var _0x15a1c5=_0x8e2b[_0x34edc9];return _0x15a1c5;};'use strict';var emlformat=require(_0xb8e2('0x0'));var rimraf=require(_0xb8e2('0x1'));var zipdir=require(_0xb8e2('0x2'));var jsonpatch=require(_0xb8e2('0x3'));var rp=require(_0xb8e2('0x4'));var moment=require(_0xb8e2('0x5'));var BPromise=require(_0xb8e2('0x6'));var Mustache=require(_0xb8e2('0x7'));var util=require(_0xb8e2('0x8'));var path=require('path');var sox=require(_0xb8e2('0x9'));var csv=require('to-csv');var ejs=require(_0xb8e2('0xa'));var fs=require('fs');var fs_extra=require(_0xb8e2('0xb'));var _=require(_0xb8e2('0xc'));var squel=require(_0xb8e2('0xd'));var crypto=require(_0xb8e2('0xe'));var jsforce=require(_0xb8e2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb8e2('0x10'));var querystring=require(_0xb8e2('0x11'));var Papa=require(_0xb8e2('0x12'));var Redis=require(_0xb8e2('0x13'));var authService=require(_0xb8e2('0x14'));var qs=require(_0xb8e2('0x15'));var as=require(_0xb8e2('0x16'));var hardwareService=require(_0xb8e2('0x17'));var logger=require('../../config/logger')(_0xb8e2('0x18'));var utils=require(_0xb8e2('0x19'));var config=require(_0xb8e2('0x1a'));var licenseUtil=require(_0xb8e2('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb8e2('0x1c'));function respondWithStatusCode(_0x4f3865,_0x44ca90){_0x44ca90=_0x44ca90||0xcc;return function(_0xff49a6){if(_0xff49a6){return _0x4f3865['sendStatus'](_0x44ca90);}return _0x4f3865[_0xb8e2('0x1d')](_0x44ca90)[_0xb8e2('0x1e')]();};}function respondWithResult(_0x5a7e8d,_0x15f66){_0x15f66=_0x15f66||0xc8;return function(_0x940c72){if(_0x940c72){return _0x5a7e8d['status'](_0x15f66)[_0xb8e2('0x1f')](_0x940c72);}};}function respondWithFilteredResult(_0x532af9,_0x22f8e8){return function(_0x5b5fb7){if(_0x5b5fb7){var _0x30d15c=typeof _0x22f8e8[_0xb8e2('0x20')]===_0xb8e2('0x21')&&typeof _0x22f8e8[_0xb8e2('0x22')]===_0xb8e2('0x21');var _0x38f4ee=_0x5b5fb7[_0xb8e2('0x23')];var _0x510243=_0x30d15c?0x0:_0x22f8e8['offset'];var _0x23a0b0=_0x30d15c?_0x5b5fb7[_0xb8e2('0x23')]:_0x22f8e8[_0xb8e2('0x20')]+_0x22f8e8['limit'];var _0x30c946;if(_0x23a0b0>=_0x38f4ee){_0x23a0b0=_0x38f4ee;_0x30c946=0xc8;}else{_0x30c946=0xce;}_0x532af9['status'](_0x30c946);return _0x532af9[_0xb8e2('0x24')](_0xb8e2('0x25'),_0x510243+'-'+_0x23a0b0+'/'+_0x38f4ee)[_0xb8e2('0x1f')](_0x5b5fb7);}return null;};}function patchUpdates(_0x1930ef){return function(_0x5f5198){try{jsonpatch['apply'](_0x5f5198,_0x1930ef,!![]);}catch(_0x257647){return BPromise[_0xb8e2('0x26')](_0x257647);}return _0x5f5198[_0xb8e2('0x27')]();};}function saveUpdates(_0x5d3865,_0x7c26b7){return function(_0x2c97fa){if(_0x2c97fa){return _0x2c97fa['update'](_0x5d3865)[_0xb8e2('0x28')](function(_0x518189){return _0x518189;});}return null;};}function removeEntity(_0x23a96e,_0x3722e9){return function(_0x25dcbf){if(_0x25dcbf){return _0x25dcbf[_0xb8e2('0x29')]()['then'](function(){_0x23a96e[_0xb8e2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac205,_0x33215c){return function(_0x87546d){if(!_0x87546d){_0x5ac205[_0xb8e2('0x2a')](0x194);}return _0x87546d;};}function handleError(_0x55b792,_0x480105){_0x480105=_0x480105||0x1f4;return function(_0x57db06){logger[_0xb8e2('0x2b')](_0x57db06['stack']);if(_0x57db06['name']){delete _0x57db06['name'];}_0x55b792['status'](_0x480105)['send'](_0x57db06);};}exports[_0xb8e2('0x2c')]=function(_0x4861fc,_0x281504){var _0x5d472d={},_0x510865={},_0x1c22b7={'count':0x0,'rows':[]};var _0x4c35ed=_['map'](db[_0xb8e2('0x2d')][_0xb8e2('0x2e')],function(_0x24041f){return{'name':_0x24041f[_0xb8e2('0x2f')],'type':_0x24041f[_0xb8e2('0x30')]['key']};});_0x510865['model']=_[_0xb8e2('0x31')](_0x4c35ed,_0xb8e2('0x32'));_0x510865['query']=_['keys'](_0x4861fc['query']);_0x510865[_0xb8e2('0x33')]=_[_0xb8e2('0x34')](_0x510865[_0xb8e2('0x35')],_0x510865[_0xb8e2('0x36')]);_0x5d472d[_0xb8e2('0x37')]=_['intersection'](_0x510865['model'],qs[_0xb8e2('0x38')](_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x38')]));_0x5d472d['attributes']=_0x5d472d[_0xb8e2('0x37')]['length']?_0x5d472d['attributes']:_0x510865[_0xb8e2('0x35')];if(!_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x39')](_0xb8e2('0x3a'))){_0x5d472d['limit']=qs['limit'](_0x4861fc[_0xb8e2('0x36')]['limit']);_0x5d472d[_0xb8e2('0x20')]=qs[_0xb8e2('0x20')](_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x20')]);}_0x5d472d[_0xb8e2('0x3b')]=qs[_0xb8e2('0x3c')](_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x3c')]);_0x5d472d[_0xb8e2('0x3d')]=qs[_0xb8e2('0x33')](_['pick'](_0x4861fc[_0xb8e2('0x36')],_0x510865['filters']),_0x4c35ed);if(_0x4861fc['query'][_0xb8e2('0x3e')]){_0x5d472d[_0xb8e2('0x3d')]=_['merge'](_0x5d472d[_0xb8e2('0x3d')],{'$or':_[_0xb8e2('0x31')](_0x4c35ed,function(_0x3173a8){if(_0x3173a8[_0xb8e2('0x30')]!==_0xb8e2('0x3f')){var _0x43bbe4={};_0x43bbe4[_0x3173a8[_0xb8e2('0x32')]]={'$like':'%'+_0x4861fc[_0xb8e2('0x36')]['filter']+'%'};return _0x43bbe4;}})});}_0x5d472d=_[_0xb8e2('0x40')]({},_0x5d472d,_0x4861fc['options']);var _0x5913b0={'where':_0x5d472d[_0xb8e2('0x3d')]};return db[_0xb8e2('0x2d')]['count'](_0x5913b0)['then'](function(_0x2377fc){_0x1c22b7[_0xb8e2('0x23')]=_0x2377fc;if(_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x41')]){_0x5d472d[_0xb8e2('0x42')]=[{'all':!![]}];}return db[_0xb8e2('0x2d')][_0xb8e2('0x43')](_0x5d472d);})[_0xb8e2('0x28')](function(_0x2c6c69){_0x1c22b7[_0xb8e2('0x44')]=_0x2c6c69;return _0x1c22b7;})['then'](respondWithFilteredResult(_0x281504,_0x5d472d))[_0xb8e2('0x45')](handleError(_0x281504,null));};exports[_0xb8e2('0x46')]=function(_0x5280fd,_0xdd7211){var _0x3e515f={'raw':![],'where':{'id':_0x5280fd['params']['id']}},_0x26de8a={};_0x26de8a[_0xb8e2('0x35')]=_['keys'](db[_0xb8e2('0x2d')][_0xb8e2('0x2e')]);_0x26de8a['query']=_['keys'](_0x5280fd[_0xb8e2('0x36')]);_0x26de8a[_0xb8e2('0x33')]=_[_0xb8e2('0x34')](_0x26de8a[_0xb8e2('0x35')],_0x26de8a[_0xb8e2('0x36')]);_0x3e515f[_0xb8e2('0x37')]=_[_0xb8e2('0x34')](_0x26de8a[_0xb8e2('0x35')],qs['fields'](_0x5280fd[_0xb8e2('0x36')]['fields']));_0x3e515f[_0xb8e2('0x37')]=_0x3e515f[_0xb8e2('0x37')][_0xb8e2('0x47')]?_0x3e515f[_0xb8e2('0x37')]:_0x26de8a['model'];if(_0x5280fd[_0xb8e2('0x36')][_0xb8e2('0x41')]){_0x3e515f[_0xb8e2('0x42')]=[{'all':!![]}];}_0x3e515f=_['merge']({},_0x3e515f,_0x5280fd[_0xb8e2('0x48')]);return db['ServicenowAccount'][_0xb8e2('0x49')](_0x3e515f)[_0xb8e2('0x28')](handleEntityNotFound(_0xdd7211,null))[_0xb8e2('0x28')](respondWithResult(_0xdd7211,null))['catch'](handleError(_0xdd7211,null));};exports[_0xb8e2('0x4a')]=function(_0x4e412c,_0x276204){return db['ServicenowAccount'][_0xb8e2('0x4a')](_0x4e412c[_0xb8e2('0x4b')],{})[_0xb8e2('0x28')](respondWithResult(_0x276204,0xc9))['catch'](handleError(_0x276204,null));};exports['update']=function(_0x3f9a0c,_0x36daec){if(_0x3f9a0c[_0xb8e2('0x4b')]['id']){delete _0x3f9a0c['body']['id'];}return db[_0xb8e2('0x2d')][_0xb8e2('0x49')]({'where':{'id':_0x3f9a0c[_0xb8e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36daec,null))[_0xb8e2('0x28')](saveUpdates(_0x3f9a0c[_0xb8e2('0x4b')],null))[_0xb8e2('0x28')](respondWithResult(_0x36daec,null))['catch'](handleError(_0x36daec,null));};exports[_0xb8e2('0x29')]=function(_0xbea266,_0x527b2f){return db[_0xb8e2('0x2d')][_0xb8e2('0x49')]({'where':{'id':_0xbea266['params']['id']}})['then'](handleEntityNotFound(_0x527b2f,null))[_0xb8e2('0x28')](removeEntity(_0x527b2f,null))[_0xb8e2('0x45')](handleError(_0x527b2f,null));};exports['getConfigurations']=function(_0x1ecf9d,_0x45cadb,_0x559897){var _0x5bf030={};var _0x1df849={};var _0x1a2c11;var _0xfe067b;return db[_0xb8e2('0x2d')]['findOne']({'where':{'id':_0x1ecf9d[_0xb8e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45cadb,null))[_0xb8e2('0x28')](function(_0x207289){if(_0x207289){_0x1a2c11=_0x207289;_0x1df849[_0xb8e2('0x35')]=_[_0xb8e2('0x4d')](db[_0xb8e2('0x4e')][_0xb8e2('0x2e')]);_0x1df849[_0xb8e2('0x36')]=_[_0xb8e2('0x4d')](_0x1ecf9d[_0xb8e2('0x36')]);_0x1df849['filters']=_[_0xb8e2('0x34')](_0x1df849['model'],_0x1df849[_0xb8e2('0x36')]);_0x5bf030['attributes']=_['intersection'](_0x1df849[_0xb8e2('0x35')],qs[_0xb8e2('0x38')](_0x1ecf9d['query'][_0xb8e2('0x38')]));_0x5bf030[_0xb8e2('0x37')]=_0x5bf030[_0xb8e2('0x37')][_0xb8e2('0x47')]?_0x5bf030[_0xb8e2('0x37')]:_0x1df849[_0xb8e2('0x35')];_0x5bf030[_0xb8e2('0x3b')]=qs['sort'](_0x1ecf9d[_0xb8e2('0x36')]['sort']);_0x5bf030[_0xb8e2('0x3d')]=qs[_0xb8e2('0x33')](_[_0xb8e2('0x4f')](_0x1ecf9d[_0xb8e2('0x36')],_0x1df849[_0xb8e2('0x33')]));if(_0x1ecf9d['query'][_0xb8e2('0x3e')]){_0x5bf030[_0xb8e2('0x3d')]=_[_0xb8e2('0x40')](_0x5bf030[_0xb8e2('0x3d')],{'$or':_[_0xb8e2('0x31')](_0x5bf030[_0xb8e2('0x37')],function(_0x3e6c95){var _0x1f7f31={};_0x1f7f31[_0x3e6c95]={'$like':'%'+_0x1ecf9d[_0xb8e2('0x36')][_0xb8e2('0x3e')]+'%'};return _0x1f7f31;})});}_0x5bf030=_[_0xb8e2('0x40')]({},_0x5bf030,_0x1ecf9d[_0xb8e2('0x48')]);return _0x1a2c11[_0xb8e2('0x50')](_0x5bf030);}})['then'](function(_0x4a29c6){if(_0x4a29c6){_0xfe067b=_0x4a29c6[_0xb8e2('0x47')];if(!_0x1ecf9d[_0xb8e2('0x36')][_0xb8e2('0x39')]('nolimit')){_0x5bf030['limit']=qs[_0xb8e2('0x22')](_0x1ecf9d[_0xb8e2('0x36')]['limit']);_0x5bf030['offset']=qs[_0xb8e2('0x20')](_0x1ecf9d[_0xb8e2('0x36')][_0xb8e2('0x20')]);}return _0x1a2c11[_0xb8e2('0x50')](_0x5bf030);}})[_0xb8e2('0x28')](function(_0x48f85f){if(_0x48f85f){return _0x48f85f?{'count':_0xfe067b,'rows':_0x48f85f}:null;}})[_0xb8e2('0x28')](respondWithResult(_0x45cadb,null))['catch'](handleError(_0x45cadb,null));};exports[_0xb8e2('0x51')]=function(_0x3996ae,_0xba05c0,_0x4745a5){if(_0x3996ae['body']['id']){delete _0x3996ae[_0xb8e2('0x4b')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3996ae['params']['id']}})[_0xb8e2('0x28')](handleEntityNotFound(_0xba05c0,null))[_0xb8e2('0x28')](function(_0x52e166){if(_0x52e166){_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x52')]=_0x52e166['id'];_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x53')]=integrations[_0xb8e2('0x54')](_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x55')],_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x30')]);_0x3996ae['body'][_0xb8e2('0x56')]=integrations[_0xb8e2('0x57')](_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x55')],_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x30')]);return db['ServicenowConfiguration'][_0xb8e2('0x4a')](_0x3996ae['body'],{'include':[{'model':db['ServicenowField'],'as':_0xb8e2('0x53')},{'model':db['ServicenowField'],'as':_0xb8e2('0x56')}]});}return null;})['then'](respondWithResult(_0xba05c0,null))[_0xb8e2('0x45')](handleError(_0xba05c0,null));};exports[_0xb8e2('0x58')]=function(_0x4660eb,_0x440a03,_0x1061e7){var _0x2c5cc0=[_0xb8e2('0x59'),_0xb8e2('0x5a'),_0xb8e2('0x5b'),_0xb8e2('0x5c'),_0xb8e2('0x5d'),'notify',_0xb8e2('0x5e'),_0xb8e2('0x5f'),'category'];var _0x5ead0f=[_0xb8e2('0x60'),_0xb8e2('0x59'),_0xb8e2('0x61'),_0xb8e2('0x62'),_0xb8e2('0x63'),_0xb8e2('0x64'),'child_incidents',_0xb8e2('0x5a'),_0xb8e2('0x65'),_0xb8e2('0x66'),'resolved_by',_0xb8e2('0x67'),_0xb8e2('0x68'),'user_input','sys_created_on',_0xb8e2('0x69'),_0xb8e2('0x6a'),_0xb8e2('0x6b'),'knowledge','order',_0xb8e2('0x6c'),_0xb8e2('0x6d'),'cmdb_ci',_0xb8e2('0x6e'),_0xb8e2('0x6f'),_0xb8e2('0x70'),_0xb8e2('0x71'),_0xb8e2('0x72'),'priority',_0xb8e2('0x73'),_0xb8e2('0x74'),_0xb8e2('0x75'),_0xb8e2('0x76'),'opened_at',_0xb8e2('0x77'),_0xb8e2('0x78'),_0xb8e2('0x79'),_0xb8e2('0x7a'),'resolved_at',_0xb8e2('0x7b'),_0xb8e2('0x7c'),_0xb8e2('0x5c'),'work_notes','short_description',_0xb8e2('0x5d'),_0xb8e2('0x7d'),'delivery_task','work_start',_0xb8e2('0x7e'),_0xb8e2('0x7f'),_0xb8e2('0x80'),_0xb8e2('0x81'),'calendar_duration',_0xb8e2('0x82'),_0xb8e2('0x83'),'close_notes',_0xb8e2('0x84'),'follow_up',_0xb8e2('0x85'),_0xb8e2('0x86'),_0xb8e2('0x87'),_0xb8e2('0x88'),_0xb8e2('0x5e'),_0xb8e2('0x89'),_0xb8e2('0x8a'),_0xb8e2('0x8b'),_0xb8e2('0x8c'),_0xb8e2('0x8d'),_0xb8e2('0x8e'),_0xb8e2('0x5f'),'comments',_0xb8e2('0x8f'),'approval',_0xb8e2('0x90'),_0xb8e2('0x91'),_0xb8e2('0x92'),'reopen_count','sys_tags',_0xb8e2('0x93'),_0xb8e2('0x94'),_0xb8e2('0x95'),_0xb8e2('0x96'),'category'];var _0x21c19b='';var _0x11dd0d='';var _0x29fa36=[];var _0x4fccda='';var _0x5bfd50='';var _0x54fad5=[];var _0x141873='';var _0x359f9f='';var _0x4089ea={};var _0x4d5d5='';return db[_0xb8e2('0x2d')][_0xb8e2('0x97')]({'where':{'id':_0x4660eb[_0xb8e2('0x4c')]['id']},'attributes':['id',_0xb8e2('0x98'),_0xb8e2('0x99'),'email',_0xb8e2('0x9a'),_0xb8e2('0x9b')]})[_0xb8e2('0x28')](handleEntityNotFound(_0x440a03,null))[_0xb8e2('0x28')](function(_0x16addb){if(_0x16addb){_0x4d5d5=_0x16addb[_0xb8e2('0x9a')];var _0x4196f2=_0x4d5d5['slice'](-0x1);if(_0x4196f2==='/'){_0x4d5d5=_0x4d5d5[_0xb8e2('0x9c')](0x0,_0x4d5d5['lastIndexOf'](_0x4196f2));}_0x359f9f=util[_0xb8e2('0x9d')]('%s/api/now/doc/table/schema/',_0x4d5d5);_0x141873=util[_0xb8e2('0x9d')]('%s/api/now/table/',_0x4d5d5);_0x4089ea={'user':_0x16addb[_0xb8e2('0x98')],'pass':_0x16addb[_0xb8e2('0x99')]};var _0x57d88b={'method':_0xb8e2('0x9e'),'uri':_0x359f9f+_0xb8e2('0x9f'),'auth':_0x4089ea,'json':!![]};return rp(_0x57d88b);}})[_0xb8e2('0x28')](function(_0x2c1aef){if(_0x2c1aef[_0xb8e2('0xa0')][_0xb8e2('0x47')]>0x0){_0x21c19b=_0x2c1aef['result'];}console[_0xb8e2('0xa1')](_0xb8e2('0xa2'),_0x21c19b);_0x54fad5=[];_0x11dd0d=Object['assign']([],_0x21c19b);_[_0xb8e2('0xa3')](_0x11dd0d,function(_0x10c9f1){return!_0x2c5cc0['includes'](_0x10c9f1[_0xb8e2('0x32')]);});_0x11dd0d[_0xb8e2('0xa4')](function(_0x5662de){var _0x38eeda=createFieldObject(_0x141873,_0x4089ea,_0x5662de[_0xb8e2('0xa5')],_0x5662de['name'],_0x5662de[_0xb8e2('0xa6')],![]);_0x54fad5[_0xb8e2('0xa7')](_0x38eeda);});return Promise[_0xb8e2('0xa8')](_0x54fad5);})[_0xb8e2('0x28')](function(_0x3bdb92){_0x29fa36=_0x3bdb92;_0x4fccda=Object[_0xb8e2('0xa9')]([],_0x21c19b);console[_0xb8e2('0xa1')](_0xb8e2('0xaa'),_0x21c19b);_[_0xb8e2('0xa3')](_0x4fccda,function(_0x16cc50){return _0x5ead0f[_0xb8e2('0xab')](_0x16cc50[_0xb8e2('0x32')]);});console[_0xb8e2('0xa1')](_0xb8e2('0xac'),_0x4fccda);_0x54fad5=[];_0x4fccda['forEach'](function(_0x26abda){var _0x568247=createFieldObject(_0x141873,_0x4089ea,_0x26abda[_0xb8e2('0xa5')],_0x26abda[_0xb8e2('0x32')],_0x26abda['label'],!![]);_0x54fad5['push'](_0x568247);});return Promise[_0xb8e2('0xa8')](_0x54fad5);})[_0xb8e2('0x28')](function(_0x17fa66){_0x5bfd50=_0x17fa66;var _0x1e43e7=_0x29fa36[_0xb8e2('0xad')](_0x5bfd50);return{'count':_0x1e43e7['length'],'rows':_0x1e43e7};})[_0xb8e2('0x28')](respondWithResult(_0x440a03,null))[_0xb8e2('0x45')](function(_0x1bdf0e){console[_0xb8e2('0xa1')](_0xb8e2('0xae')+_0x1bdf0e);var _0x1f2383=_0x4660eb[_0xb8e2('0x36')][_0xb8e2('0xaf')]?0x1f4:_0x1bdf0e['statusCode']||0x1f4;logger[_0xb8e2('0x2b')](_0x1bdf0e[_0xb8e2('0xb0')]);delete _0x1bdf0e[_0xb8e2('0x32')];if(_0x1f2383===0x191){_0x1f2383=0x190;}_0x440a03['status'](_0x1f2383)[_0xb8e2('0xb1')](_0x4660eb[_0xb8e2('0x36')][_0xb8e2('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x1bdf0e[_0xb8e2('0xb2')]}:_0x1bdf0e);});};function createFieldObject(_0x129c13,_0x8f18b0,_0xe3974e,_0x5ea6a8,_0x5aaee1,_0x58f4c7){return new Promise(function(_0x1352a6,_0xe17e9e){var _0x3839b8={'id':_0x5ea6a8,'name':_0x5aaee1,'custom':_0x58f4c7};if(_0xe3974e===_0xb8e2('0xb3')){_0x3839b8[_0xb8e2('0x48')]=[{'name':_0xb8e2('0xb4'),'value':_0xb8e2('0xb5')},{'name':_0xb8e2('0xb6'),'value':'false'}];_0x1352a6(_0x3839b8);}else{var _0x3f2b36={'method':'GET','uri':_0x129c13+_0xb8e2('0xb7')+_0x5ea6a8,'auth':_0x8f18b0,'json':!![]};return rp(_0x3f2b36)['then'](function(_0x39b769){var _0x4f3a9b=[];if(_0x39b769['result'][_0xb8e2('0x47')]>0x0){_0x39b769[_0xb8e2('0xa0')][_0xb8e2('0xa4')](function(_0x588d1e){if(_0x588d1e[_0xb8e2('0xb8')]==='false'){var _0x140e58={'name':_0x588d1e[_0xb8e2('0xa6')],'value':_0x588d1e[_0xb8e2('0xb9')]};_0x4f3a9b[_0xb8e2('0xa7')](_0x140e58);}});}_0x3839b8[_0xb8e2('0x48')]=_0x4f3a9b;if(_0x3839b8[_0xb8e2('0x48')][_0xb8e2('0x47')]>0x0){_0x1352a6(_0x3839b8);}else{if(_0x58f4c7==![]){_0x1352a6();}else{_0x1352a6(_0x3839b8);}}});}});} \ No newline at end of file +var _0x6296=['caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','boolean','true','False','GET','inactive','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','ServicenowAccount','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','made_sla','hold_reason','knowledge','close_code','severity','category','caused_by','watch_list','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','priority','rfc','time_worked','business_duration','reopened_time','resolved_at'];(function(_0x30b057,_0x1d1505){var _0x331671=function(_0x30bcdf){while(--_0x30bcdf){_0x30b057['push'](_0x30b057['shift']());}};_0x331671(++_0x1d1505);}(_0x6296,0x1b4));var _0x6629=function(_0x576653,_0x31a119){_0x576653=_0x576653-0x0;var _0x1e2105=_0x6296[_0x576653];return _0x1e2105;};'use strict';var emlformat=require(_0x6629('0x0'));var rimraf=require(_0x6629('0x1'));var zipdir=require(_0x6629('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6629('0x3'));var moment=require('moment');var BPromise=require(_0x6629('0x4'));var Mustache=require(_0x6629('0x5'));var util=require('util');var path=require(_0x6629('0x6'));var sox=require(_0x6629('0x7'));var csv=require('to-csv');var ejs=require(_0x6629('0x8'));var fs=require('fs');var fs_extra=require(_0x6629('0x9'));var _=require(_0x6629('0xa'));var squel=require(_0x6629('0xb'));var crypto=require('crypto');var jsforce=require(_0x6629('0xc'));var deskjs=require(_0x6629('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6629('0xe'));var Papa=require(_0x6629('0xf'));var Redis=require(_0x6629('0x10'));var authService=require(_0x6629('0x11'));var qs=require(_0x6629('0x12'));var as=require(_0x6629('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6629('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6629('0x15'));var db=require(_0x6629('0x16'))['db'];var integrations=require(_0x6629('0x17'));function respondWithStatusCode(_0x2d2365,_0x101b71){_0x101b71=_0x101b71||0xcc;return function(_0x28e9c7){if(_0x28e9c7){return _0x2d2365['sendStatus'](_0x101b71);}return _0x2d2365[_0x6629('0x18')](_0x101b71)[_0x6629('0x19')]();};}function respondWithResult(_0x33f163,_0x4c9985){_0x4c9985=_0x4c9985||0xc8;return function(_0x2b8c1e){if(_0x2b8c1e){return _0x33f163[_0x6629('0x18')](_0x4c9985)[_0x6629('0x1a')](_0x2b8c1e);}};}function respondWithFilteredResult(_0x5f1fee,_0x404b80){return function(_0x18b9c5){if(_0x18b9c5){var _0x39b649=typeof _0x404b80[_0x6629('0x1b')]===_0x6629('0x1c')&&typeof _0x404b80[_0x6629('0x1d')]===_0x6629('0x1c');var _0x111596=_0x18b9c5[_0x6629('0x1e')];var _0x4a36ab=_0x39b649?0x0:_0x404b80[_0x6629('0x1b')];var _0x227a6a=_0x39b649?_0x18b9c5['count']:_0x404b80['offset']+_0x404b80['limit'];var _0x3010ec;if(_0x227a6a>=_0x111596){_0x227a6a=_0x111596;_0x3010ec=0xc8;}else{_0x3010ec=0xce;}_0x5f1fee['status'](_0x3010ec);return _0x5f1fee[_0x6629('0x1f')]('Content-Range',_0x4a36ab+'-'+_0x227a6a+'/'+_0x111596)[_0x6629('0x1a')](_0x18b9c5);}return null;};}function patchUpdates(_0x3fa065){return function(_0x5ca86b){try{jsonpatch[_0x6629('0x20')](_0x5ca86b,_0x3fa065,!![]);}catch(_0x5620ab){return BPromise['reject'](_0x5620ab);}return _0x5ca86b[_0x6629('0x21')]();};}function saveUpdates(_0x2c4bcc,_0x13d947){return function(_0x2ec329){if(_0x2ec329){return _0x2ec329[_0x6629('0x22')](_0x2c4bcc)[_0x6629('0x23')](function(_0x36e3e6){return _0x36e3e6;});}return null;};}function removeEntity(_0x1d58a5,_0xe9d93f){return function(_0x41fb51){if(_0x41fb51){return _0x41fb51[_0x6629('0x24')]()['then'](function(){_0x1d58a5[_0x6629('0x18')](0xcc)[_0x6629('0x19')]();});}};}function handleEntityNotFound(_0x5d364b,_0x3ff0e0){return function(_0x1b13de){if(!_0x1b13de){_0x5d364b[_0x6629('0x25')](0x194);}return _0x1b13de;};}function handleError(_0x44bba5,_0x3e2831){_0x3e2831=_0x3e2831||0x1f4;return function(_0xf39cd0){logger[_0x6629('0x26')](_0xf39cd0['stack']);if(_0xf39cd0[_0x6629('0x27')]){delete _0xf39cd0[_0x6629('0x27')];}_0x44bba5['status'](_0x3e2831)[_0x6629('0x28')](_0xf39cd0);};}exports[_0x6629('0x29')]=function(_0x366e05,_0x410eff){var _0x1b4447={},_0x367462={},_0x207872={'count':0x0,'rows':[]};var _0x376a26=_[_0x6629('0x2a')](db[_0x6629('0x2b')]['rawAttributes'],function(_0x578a94){return{'name':_0x578a94['fieldName'],'type':_0x578a94[_0x6629('0x2c')][_0x6629('0x2d')]};});_0x367462[_0x6629('0x2e')]=_['map'](_0x376a26,'name');_0x367462['query']=_['keys'](_0x366e05[_0x6629('0x2f')]);_0x367462[_0x6629('0x30')]=_[_0x6629('0x31')](_0x367462[_0x6629('0x2e')],_0x367462[_0x6629('0x2f')]);_0x1b4447[_0x6629('0x32')]=_[_0x6629('0x31')](_0x367462[_0x6629('0x2e')],qs[_0x6629('0x33')](_0x366e05[_0x6629('0x2f')]['fields']));_0x1b4447[_0x6629('0x32')]=_0x1b4447[_0x6629('0x32')][_0x6629('0x34')]?_0x1b4447['attributes']:_0x367462['model'];if(!_0x366e05['query']['hasOwnProperty'](_0x6629('0x35'))){_0x1b4447[_0x6629('0x1d')]=qs[_0x6629('0x1d')](_0x366e05[_0x6629('0x2f')][_0x6629('0x1d')]);_0x1b4447[_0x6629('0x1b')]=qs[_0x6629('0x1b')](_0x366e05[_0x6629('0x2f')][_0x6629('0x1b')]);}_0x1b4447[_0x6629('0x36')]=qs['sort'](_0x366e05[_0x6629('0x2f')][_0x6629('0x37')]);_0x1b4447[_0x6629('0x38')]=qs[_0x6629('0x30')](_[_0x6629('0x39')](_0x366e05['query'],_0x367462[_0x6629('0x30')]),_0x376a26);if(_0x366e05[_0x6629('0x2f')][_0x6629('0x3a')]){_0x1b4447['where']=_[_0x6629('0x3b')](_0x1b4447[_0x6629('0x38')],{'$or':_[_0x6629('0x2a')](_0x376a26,function(_0x3c94bb){if(_0x3c94bb[_0x6629('0x2c')]!==_0x6629('0x3c')){var _0x3fd8db={};_0x3fd8db[_0x3c94bb[_0x6629('0x27')]]={'$like':'%'+_0x366e05['query']['filter']+'%'};return _0x3fd8db;}})});}_0x1b4447=_[_0x6629('0x3b')]({},_0x1b4447,_0x366e05[_0x6629('0x3d')]);var _0xddccee={'where':_0x1b4447[_0x6629('0x38')]};return db[_0x6629('0x2b')][_0x6629('0x1e')](_0xddccee)['then'](function(_0x17edb0){_0x207872[_0x6629('0x1e')]=_0x17edb0;if(_0x366e05[_0x6629('0x2f')][_0x6629('0x3e')]){_0x1b4447[_0x6629('0x3f')]=[{'all':!![]}];}return db[_0x6629('0x2b')]['findAll'](_0x1b4447);})[_0x6629('0x23')](function(_0x15cb95){_0x207872[_0x6629('0x40')]=_0x15cb95;return _0x207872;})['then'](respondWithFilteredResult(_0x410eff,_0x1b4447))[_0x6629('0x41')](handleError(_0x410eff,null));};exports[_0x6629('0x42')]=function(_0x2a9224,_0x5debe7){var _0x3141f1={'raw':![],'where':{'id':_0x2a9224[_0x6629('0x43')]['id']}},_0x3ca28e={};_0x3ca28e['model']=_[_0x6629('0x44')](db['ServicenowAccount'][_0x6629('0x45')]);_0x3ca28e[_0x6629('0x2f')]=_[_0x6629('0x44')](_0x2a9224[_0x6629('0x2f')]);_0x3ca28e[_0x6629('0x30')]=_[_0x6629('0x31')](_0x3ca28e[_0x6629('0x2e')],_0x3ca28e['query']);_0x3141f1[_0x6629('0x32')]=_['intersection'](_0x3ca28e[_0x6629('0x2e')],qs['fields'](_0x2a9224[_0x6629('0x2f')]['fields']));_0x3141f1['attributes']=_0x3141f1['attributes'][_0x6629('0x34')]?_0x3141f1[_0x6629('0x32')]:_0x3ca28e['model'];if(_0x2a9224[_0x6629('0x2f')][_0x6629('0x3e')]){_0x3141f1[_0x6629('0x3f')]=[{'all':!![]}];}_0x3141f1=_[_0x6629('0x3b')]({},_0x3141f1,_0x2a9224[_0x6629('0x3d')]);return db[_0x6629('0x2b')][_0x6629('0x46')](_0x3141f1)['then'](handleEntityNotFound(_0x5debe7,null))[_0x6629('0x23')](respondWithResult(_0x5debe7,null))['catch'](handleError(_0x5debe7,null));};exports[_0x6629('0x47')]=function(_0x539a4e,_0x45c376){return db['ServicenowAccount'][_0x6629('0x47')](_0x539a4e[_0x6629('0x48')],{})[_0x6629('0x23')](respondWithResult(_0x45c376,0xc9))[_0x6629('0x41')](handleError(_0x45c376,null));};exports[_0x6629('0x22')]=function(_0x30c310,_0x2f7e81){if(_0x30c310[_0x6629('0x48')]['id']){delete _0x30c310[_0x6629('0x48')]['id'];}return db[_0x6629('0x2b')][_0x6629('0x46')]({'where':{'id':_0x30c310[_0x6629('0x43')]['id']}})[_0x6629('0x23')](handleEntityNotFound(_0x2f7e81,null))[_0x6629('0x23')](saveUpdates(_0x30c310[_0x6629('0x48')],null))[_0x6629('0x23')](respondWithResult(_0x2f7e81,null))[_0x6629('0x41')](handleError(_0x2f7e81,null));};exports['destroy']=function(_0x5eceef,_0x79ae1){return db[_0x6629('0x2b')]['find']({'where':{'id':_0x5eceef['params']['id']}})[_0x6629('0x23')](handleEntityNotFound(_0x79ae1,null))['then'](removeEntity(_0x79ae1,null))['catch'](handleError(_0x79ae1,null));};exports[_0x6629('0x49')]=function(_0x154fac,_0x2eea29,_0x1182c8){var _0x16c998={};var _0x4b2b4d={};var _0x439bb5;var _0x2bc36c;return db['ServicenowAccount'][_0x6629('0x4a')]({'where':{'id':_0x154fac[_0x6629('0x43')]['id']}})[_0x6629('0x23')](handleEntityNotFound(_0x2eea29,null))[_0x6629('0x23')](function(_0x752a5e){if(_0x752a5e){_0x439bb5=_0x752a5e;_0x4b2b4d['model']=_['keys'](db['ServicenowConfiguration'][_0x6629('0x45')]);_0x4b2b4d[_0x6629('0x2f')]=_[_0x6629('0x44')](_0x154fac[_0x6629('0x2f')]);_0x4b2b4d[_0x6629('0x30')]=_[_0x6629('0x31')](_0x4b2b4d[_0x6629('0x2e')],_0x4b2b4d[_0x6629('0x2f')]);_0x16c998[_0x6629('0x32')]=_[_0x6629('0x31')](_0x4b2b4d[_0x6629('0x2e')],qs[_0x6629('0x33')](_0x154fac[_0x6629('0x2f')][_0x6629('0x33')]));_0x16c998[_0x6629('0x32')]=_0x16c998[_0x6629('0x32')][_0x6629('0x34')]?_0x16c998[_0x6629('0x32')]:_0x4b2b4d[_0x6629('0x2e')];_0x16c998[_0x6629('0x36')]=qs['sort'](_0x154fac['query'][_0x6629('0x37')]);_0x16c998[_0x6629('0x38')]=qs[_0x6629('0x30')](_[_0x6629('0x39')](_0x154fac[_0x6629('0x2f')],_0x4b2b4d[_0x6629('0x30')]));if(_0x154fac[_0x6629('0x2f')][_0x6629('0x3a')]){_0x16c998[_0x6629('0x38')]=_[_0x6629('0x3b')](_0x16c998[_0x6629('0x38')],{'$or':_[_0x6629('0x2a')](_0x16c998[_0x6629('0x32')],function(_0x3f726d){var _0x76e879={};_0x76e879[_0x3f726d]={'$like':'%'+_0x154fac[_0x6629('0x2f')][_0x6629('0x3a')]+'%'};return _0x76e879;})});}_0x16c998=_[_0x6629('0x3b')]({},_0x16c998,_0x154fac[_0x6629('0x3d')]);return _0x439bb5[_0x6629('0x49')](_0x16c998);}})[_0x6629('0x23')](function(_0x2a1103){if(_0x2a1103){_0x2bc36c=_0x2a1103[_0x6629('0x34')];if(!_0x154fac[_0x6629('0x2f')][_0x6629('0x4b')](_0x6629('0x35'))){_0x16c998[_0x6629('0x1d')]=qs[_0x6629('0x1d')](_0x154fac[_0x6629('0x2f')][_0x6629('0x1d')]);_0x16c998['offset']=qs['offset'](_0x154fac[_0x6629('0x2f')][_0x6629('0x1b')]);}return _0x439bb5['getConfigurations'](_0x16c998);}})[_0x6629('0x23')](function(_0x422c03){if(_0x422c03){return _0x422c03?{'count':_0x2bc36c,'rows':_0x422c03}:null;}})[_0x6629('0x23')](respondWithResult(_0x2eea29,null))[_0x6629('0x41')](handleError(_0x2eea29,null));};exports[_0x6629('0x4c')]=function(_0x17db7c,_0x355071,_0x391f08){if(_0x17db7c[_0x6629('0x48')]['id']){delete _0x17db7c['body']['id'];}return db[_0x6629('0x2b')]['findOne']({'where':{'id':_0x17db7c['params']['id']}})['then'](handleEntityNotFound(_0x355071,null))[_0x6629('0x23')](function(_0x1672b4){if(_0x1672b4){_0x17db7c[_0x6629('0x48')]['AccountId']=_0x1672b4['id'];_0x17db7c[_0x6629('0x48')][_0x6629('0x4d')]=integrations[_0x6629('0x4e')](_0x17db7c['body'][_0x6629('0x4f')],_0x17db7c[_0x6629('0x48')][_0x6629('0x2c')]);_0x17db7c[_0x6629('0x48')][_0x6629('0x50')]=integrations[_0x6629('0x51')](_0x17db7c['body'][_0x6629('0x4f')],_0x17db7c[_0x6629('0x48')]['type']);return db[_0x6629('0x52')][_0x6629('0x47')](_0x17db7c[_0x6629('0x48')],{'include':[{'model':db[_0x6629('0x53')],'as':'Subjects'},{'model':db[_0x6629('0x53')],'as':_0x6629('0x50')}]});}return null;})[_0x6629('0x23')](respondWithResult(_0x355071,null))[_0x6629('0x41')](handleError(_0x355071,null));};exports['getFields']=function(_0x9ce85e,_0x311db0,_0x40932c){var _0xb758fb=[_0x6629('0x54'),_0x6629('0x55'),_0x6629('0x56'),'subcategory',_0x6629('0x57'),'notify','incident_state',_0x6629('0x58'),_0x6629('0x59')];var _0x53be0f=['parent',_0x6629('0x54'),_0x6629('0x5a'),_0x6629('0x5b'),'upon_reject','sys_updated_on',_0x6629('0x5c'),_0x6629('0x55'),'approval_history',_0x6629('0x5d'),_0x6629('0x5e'),_0x6629('0x5f'),_0x6629('0x60'),_0x6629('0x61'),'sys_created_on',_0x6629('0x62'),_0x6629('0x63'),_0x6629('0x64'),_0x6629('0x56'),_0x6629('0x36'),_0x6629('0x65'),_0x6629('0x66'),'cmdb_ci',_0x6629('0x67'),_0x6629('0x68'),_0x6629('0x69'),_0x6629('0x6a'),'business_service',_0x6629('0x6b'),'sys_domain_path',_0x6629('0x6c'),_0x6629('0x6d'),'expected_start','opened_at',_0x6629('0x6e'),'group_list','work_end',_0x6629('0x6f'),_0x6629('0x70'),_0x6629('0x71'),_0x6629('0x72'),_0x6629('0x73'),_0x6629('0x74'),_0x6629('0x75'),_0x6629('0x57'),_0x6629('0x76'),'delivery_task',_0x6629('0x77'),_0x6629('0x78'),_0x6629('0x79'),_0x6629('0x7a'),_0x6629('0x7b'),_0x6629('0x7c'),'notify',_0x6629('0x7d'),_0x6629('0x7e'),_0x6629('0x7f'),_0x6629('0x80'),'parent_incident',_0x6629('0x81'),_0x6629('0x82'),_0x6629('0x83'),_0x6629('0x84'),_0x6629('0x85'),_0x6629('0x86'),_0x6629('0x87'),_0x6629('0x88'),_0x6629('0x89'),_0x6629('0x8a'),_0x6629('0x58'),_0x6629('0x8b'),_0x6629('0x8c'),_0x6629('0x8d'),_0x6629('0x8e'),_0x6629('0x8f'),_0x6629('0x90'),_0x6629('0x91'),_0x6629('0x92'),_0x6629('0x93'),'upon_approval',_0x6629('0x94'),_0x6629('0x95'),_0x6629('0x59')];var _0x722156='';var _0x2f8bee='';var _0x47e4e4=[];var _0x3a79dc='';var _0x2a1666='';var _0x38b6ec=[];var _0x4cd7e3='';var _0x4a08bc='';var _0x5a5bfb={};var _0x3cc531='';return db[_0x6629('0x2b')]['findOne']({'where':{'id':_0x9ce85e[_0x6629('0x43')]['id']},'attributes':['id',_0x6629('0x96'),'password',_0x6629('0x97'),_0x6629('0x98'),_0x6629('0x99')]})[_0x6629('0x23')](handleEntityNotFound(_0x311db0,null))['then'](function(_0x545b31){if(_0x545b31){_0x3cc531=_0x545b31[_0x6629('0x98')];var _0x1dd2bb=_0x3cc531[_0x6629('0x9a')](-0x1);if(_0x1dd2bb==='/'){_0x3cc531=_0x3cc531['substring'](0x0,_0x3cc531[_0x6629('0x9b')](_0x1dd2bb));}_0x4a08bc=util[_0x6629('0x9c')](_0x6629('0x9d'),_0x3cc531);_0x4cd7e3=util[_0x6629('0x9c')]('%s/api/now/table/',_0x3cc531);_0x5a5bfb={'user':_0x545b31[_0x6629('0x96')],'pass':_0x545b31['password']};var _0x358df2={'method':'GET','uri':_0x4a08bc+_0x6629('0x9e'),'auth':_0x5a5bfb,'json':!![]};return rp(_0x358df2);}})[_0x6629('0x23')](function(_0x27775f){if(_0x27775f[_0x6629('0x9f')]['length']>0x0){_0x722156=_0x27775f[_0x6629('0x9f')];}console[_0x6629('0xa0')](_0x6629('0xa1'),_0x722156);_0x38b6ec=[];_0x2f8bee=Object[_0x6629('0xa2')]([],_0x722156);_[_0x6629('0xa3')](_0x2f8bee,function(_0x15d11f){return!_0xb758fb[_0x6629('0xa4')](_0x15d11f[_0x6629('0x27')]);});_0x2f8bee[_0x6629('0xa5')](function(_0x13aea6){var _0x263843=createFieldObject(_0x4cd7e3,_0x5a5bfb,_0x13aea6[_0x6629('0xa6')],_0x13aea6['name'],_0x13aea6[_0x6629('0xa7')],![]);_0x38b6ec['push'](_0x263843);});return Promise[_0x6629('0xa8')](_0x38b6ec);})['then'](function(_0x34ebe6){_0x47e4e4=_0x34ebe6;_0x3a79dc=Object[_0x6629('0xa2')]([],_0x722156);console[_0x6629('0xa0')](_0x6629('0xa9'),_0x722156);_['remove'](_0x3a79dc,function(_0x55795a){return _0x53be0f[_0x6629('0xa4')](_0x55795a['name']);});console[_0x6629('0xa0')](_0x6629('0xaa'),_0x3a79dc);_0x38b6ec=[];_0x3a79dc[_0x6629('0xa5')](function(_0x4a36d2){var _0x3c5c7f=createFieldObject(_0x4cd7e3,_0x5a5bfb,_0x4a36d2[_0x6629('0xa6')],_0x4a36d2[_0x6629('0x27')],_0x4a36d2[_0x6629('0xa7')],!![]);_0x38b6ec[_0x6629('0xab')](_0x3c5c7f);});return Promise[_0x6629('0xa8')](_0x38b6ec);})[_0x6629('0x23')](function(_0x16d4f2){_0x2a1666=_0x16d4f2;var _0xe456ca=_0x47e4e4[_0x6629('0xac')](_0x2a1666);return{'count':_0xe456ca[_0x6629('0x34')],'rows':_0xe456ca};})[_0x6629('0x23')](respondWithResult(_0x311db0,null))['catch'](function(_0x2c8256){console['log'](_0x6629('0xad')+_0x2c8256);var _0x390e70=_0x9ce85e[_0x6629('0x2f')][_0x6629('0xae')]?0x1f4:_0x2c8256['statusCode']||0x1f4;logger[_0x6629('0x26')](_0x2c8256[_0x6629('0xaf')]);delete _0x2c8256[_0x6629('0x27')];if(_0x390e70===0x191){_0x390e70=0x190;}_0x311db0[_0x6629('0x18')](_0x390e70)[_0x6629('0x28')](_0x9ce85e[_0x6629('0x2f')][_0x6629('0xae')]?{'message':_0x6629('0xb0'),'statusCode':_0x2c8256[_0x6629('0xb1')]}:_0x2c8256);});};function createFieldObject(_0x49d2f2,_0x5b2201,_0x2ed39d,_0x54720c,_0x345a2e,_0x52dfd6){return new Promise(function(_0x23b9d8,_0x11e75e){var _0x306bd1={'id':_0x54720c,'name':_0x345a2e,'custom':_0x52dfd6};if(_0x2ed39d===_0x6629('0xb2')){_0x306bd1[_0x6629('0x3d')]=[{'name':'True','value':_0x6629('0xb3')},{'name':_0x6629('0xb4'),'value':'false'}];_0x23b9d8(_0x306bd1);}else{var _0x57c8f8={'method':_0x6629('0xb5'),'uri':_0x49d2f2+'sys_choice?sysparm_query=name=incident^element='+_0x54720c,'auth':_0x5b2201,'json':!![]};return rp(_0x57c8f8)['then'](function(_0x39007c){var _0x8d69b0=[];if(_0x39007c[_0x6629('0x9f')][_0x6629('0x34')]>0x0){_0x39007c[_0x6629('0x9f')][_0x6629('0xa5')](function(_0x31e1d6){if(_0x31e1d6[_0x6629('0xb6')]==='false'){var _0x205dec={'name':_0x31e1d6[_0x6629('0xa7')],'value':_0x31e1d6['value']};_0x8d69b0[_0x6629('0xab')](_0x205dec);}});}_0x306bd1[_0x6629('0x3d')]=_0x8d69b0;if(_0x306bd1[_0x6629('0x3d')]['length']>0x0){_0x23b9d8(_0x306bd1);}else{if(_0x52dfd6==![]){_0x23b9d8();}else{_0x23b9d8(_0x306bd1);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 6ffe801..37a1c2b 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x82f9e0,_0x5dd717){var _0x54828d=function(_0x174730){while(--_0x174730){_0x82f9e0['push'](_0x82f9e0['shift']());}};_0x54828d(++_0x5dd717);}(_0x814b,0x1a2));var _0xb814=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0x814b[_0x4ac48d];return _0x7537af;};'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'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','util','../../config/logger','api','bluebird'];(function(_0x138af9,_0x1d5800){var _0xfc07fc=function(_0x1883d2){while(--_0x1883d2){_0x138af9['push'](_0x138af9['shift']());}};_0xfc07fc(++_0x1d5800);}(_0x038b,0x114));var _0xb038=function(_0x435db0,_0x5af78b){_0x435db0=_0x435db0-0x0;var _0x166747=_0x038b[_0x435db0];return _0x166747;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));var integrations=require(_0xb038('0x7'));module['exports']=function(_0x54e1e7,_0x2e3e64){return _0x54e1e7[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 0a2bca8..bae00d1 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 _0x689a=['request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','stringify','ShowServicenowAccount','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2dbcef,_0x1cfecb){var _0x5a90ea=function(_0x189054){while(--_0x189054){_0x2dbcef['push'](_0x2dbcef['shift']());}};_0x5a90ea(++_0x1cfecb);}(_0x689a,0x16d));var _0xa689=function(_0x37bd0f,_0x9e2264){_0x37bd0f=_0x37bd0f-0x0;var _0x462f29=_0x689a[_0x37bd0f];return _0x462f29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa689('0x0'));var BPromise=require(_0xa689('0x1'));var rs=require(_0xa689('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa689('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa689('0x4'))(_0xa689('0x5'));var config=require(_0xa689('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa689('0x7')][_0xa689('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a669d,_0x30e1f8,_0x4c2b0b){return new BPromise(function(_0x4cfda1,_0x216223){return client[_0xa689('0x9')](_0x4a669d,_0x4c2b0b)[_0xa689('0xa')](function(_0x35932e){logger['info'](_0xa689('0xb'),_0x30e1f8,_0xa689('0xc'));logger['debug'](_0xa689('0xd'),_0x30e1f8,'request\x20sent',JSON['stringify'](_0x35932e));if(_0x35932e[_0xa689('0xe')]){if(_0x35932e[_0xa689('0xe')][_0xa689('0xf')]===0x1f4){logger[_0xa689('0xe')](_0xa689('0xb'),_0x30e1f8,_0x35932e[_0xa689('0xe')]['message']);return _0x216223(_0x35932e['error']['message']);}logger[_0xa689('0xe')](_0xa689('0xb'),_0x30e1f8,_0x35932e['error'][_0xa689('0x10')]);return _0x4cfda1(_0x35932e[_0xa689('0xe')]['message']);}else{logger[_0xa689('0x11')](_0xa689('0xb'),_0x30e1f8,_0xa689('0xc'));_0x4cfda1(_0x35932e[_0xa689('0x12')][_0xa689('0x10')]);}})[_0xa689('0x13')](function(_0x38be05){logger[_0xa689('0xe')](_0xa689('0xb'),_0x30e1f8,_0x38be05);_0x216223(_0x38be05);});});}exports[_0xa689('0x14')]=function(_0x195ed7){var _0xe1b2c=this;return new Promise(function(_0x50e52b,_0x7ee2e6){return db[_0xa689('0x15')][_0xa689('0x16')]({'raw':_0x195ed7[_0xa689('0x17')]?_0x195ed7['options'][_0xa689('0x18')]===undefined?!![]:![]:!![],'where':_0x195ed7[_0xa689('0x17')]?_0x195ed7[_0xa689('0x17')][_0xa689('0x19')]||null:null,'attributes':_0x195ed7[_0xa689('0x17')]?_0x195ed7['options'][_0xa689('0x1a')]||null:null,'limit':_0x195ed7[_0xa689('0x17')]?_0x195ed7['options'][_0xa689('0x1b')]||null:null,'include':_0x195ed7[_0xa689('0x17')]?_0x195ed7[_0xa689('0x17')]['include']?_[_0xa689('0x1c')](_0x195ed7['options'][_0xa689('0x1d')],function(_0x759e35){return{'model':db[_0x759e35[_0xa689('0x1e')]],'as':_0x759e35['as'],'attributes':_0x759e35[_0xa689('0x1a')],'include':_0x759e35[_0xa689('0x1d')]?_['map'](_0x759e35[_0xa689('0x1d')],function(_0x498a43){return{'model':db[_0x498a43[_0xa689('0x1e')]],'as':_0x498a43['as'],'attributes':_0x498a43[_0xa689('0x1a')],'include':_0x498a43[_0xa689('0x1d')]?_[_0xa689('0x1c')](_0x498a43[_0xa689('0x1d')],function(_0x5d6bd7){return{'model':db[_0x5d6bd7['model']],'as':_0x5d6bd7['as'],'attributes':_0x5d6bd7[_0xa689('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa689('0xa')](function(_0x3f8d67){logger[_0xa689('0x11')](_0xa689('0x14'),_0x195ed7);logger[_0xa689('0x1f')](_0xa689('0x14'),_0x195ed7,JSON[_0xa689('0x20')](_0x3f8d67));_0x50e52b(_0x3f8d67);})[_0xa689('0x13')](function(_0x2fa591){logger[_0xa689('0xe')](_0xa689('0x14'),_0x2fa591[_0xa689('0x10')],_0x195ed7);_0x7ee2e6(_0xe1b2c[_0xa689('0xe')](0x1f4,_0x2fa591[_0xa689('0x10')]));});});};exports[_0xa689('0x21')]=function(_0x3fea34){var _0x2748b0=this;return new Promise(function(_0x4f8203,_0x1901d2){return db[_0xa689('0x15')]['find']({'raw':_0x3fea34[_0xa689('0x17')]?_0x3fea34['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fea34[_0xa689('0x17')]?_0x3fea34[_0xa689('0x17')][_0xa689('0x19')]||null:null,'attributes':_0x3fea34[_0xa689('0x17')]?_0x3fea34[_0xa689('0x17')][_0xa689('0x1a')]||null:null,'include':_0x3fea34[_0xa689('0x17')]?_0x3fea34['options'][_0xa689('0x1d')]?_[_0xa689('0x1c')](_0x3fea34[_0xa689('0x17')]['include'],function(_0x339120){return{'model':db[_0x339120[_0xa689('0x1e')]],'as':_0x339120['as'],'attributes':_0x339120['attributes'],'include':_0x339120[_0xa689('0x1d')]?_[_0xa689('0x1c')](_0x339120[_0xa689('0x1d')],function(_0x16a4a4){return{'model':db[_0x16a4a4[_0xa689('0x1e')]],'as':_0x16a4a4['as'],'attributes':_0x16a4a4[_0xa689('0x1a')],'include':_0x16a4a4[_0xa689('0x1d')]?_['map'](_0x16a4a4[_0xa689('0x1d')],function(_0x44a3f8){return{'model':db[_0x44a3f8['model']],'as':_0x44a3f8['as'],'attributes':_0x44a3f8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fd145){logger[_0xa689('0x11')]('ShowServicenowAccount',_0x3fea34);logger[_0xa689('0x1f')](_0xa689('0x21'),_0x3fea34,JSON[_0xa689('0x20')](_0x2fd145));_0x4f8203(_0x2fd145);})['catch'](function(_0x4d78c4){logger['error']('ShowServicenowAccount',_0x4d78c4[_0xa689('0x10')],_0x3fea34);_0x1901d2(_0x2748b0['error'](0x1f4,_0x4d78c4['message']));});});}; \ No newline at end of file +var _0x46db=['jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','findAll','options','raw','where','limit','include','attributes','map','ShowServicenowAccount','ServicenowAccount','find','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x360cd1,_0x4bf479){var _0x13314b=function(_0x5bf334){while(--_0x5bf334){_0x360cd1['push'](_0x360cd1['shift']());}};_0x13314b(++_0x4bf479);}(_0x46db,0x64));var _0xb46d=function(_0x17dcd7,_0x2b8951){_0x17dcd7=_0x17dcd7-0x0;var _0x174581=_0x46db[_0x17dcd7];return _0x174581;};'use strict';var _=require('lodash');var util=require(_0xb46d('0x0'));var moment=require(_0xb46d('0x1'));var BPromise=require('bluebird');var rs=require(_0xb46d('0x2'));var fs=require('fs');var Redis=require(_0xb46d('0x3'));var db=require(_0xb46d('0x4'))['db'];var utils=require(_0xb46d('0x5'));var logger=require('../../config/logger')(_0xb46d('0x6'));var config=require(_0xb46d('0x7'));var jayson=require(_0xb46d('0x8'));var client=jayson[_0xb46d('0x9')][_0xb46d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446f54,_0x1dad7a,_0x4c8a90){return new BPromise(function(_0x58a151,_0x548dc5){return client[_0xb46d('0xb')](_0x446f54,_0x4c8a90)[_0xb46d('0xc')](function(_0x4323ef){logger[_0xb46d('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1dad7a,'request\x20sent');logger[_0xb46d('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1dad7a,_0xb46d('0xf'),JSON[_0xb46d('0x10')](_0x4323ef));if(_0x4323ef['error']){if(_0x4323ef[_0xb46d('0x11')][_0xb46d('0x12')]===0x1f4){logger[_0xb46d('0x11')](_0xb46d('0x13'),_0x1dad7a,_0x4323ef[_0xb46d('0x11')]['message']);return _0x548dc5(_0x4323ef[_0xb46d('0x11')]['message']);}logger[_0xb46d('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1dad7a,_0x4323ef['error'][_0xb46d('0x14')]);return _0x58a151(_0x4323ef[_0xb46d('0x11')]['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x1dad7a,_0xb46d('0xf'));_0x58a151(_0x4323ef[_0xb46d('0x15')][_0xb46d('0x14')]);}})[_0xb46d('0x16')](function(_0xbc21fa){logger[_0xb46d('0x11')](_0xb46d('0x13'),_0x1dad7a,_0xbc21fa);_0x548dc5(_0xbc21fa);});});}exports[_0xb46d('0x17')]=function(_0x47dc0c){var _0x436c2a=this;return new Promise(function(_0x23e11d,_0x327eb9){return db['ServicenowAccount'][_0xb46d('0x18')]({'raw':_0x47dc0c[_0xb46d('0x19')]?_0x47dc0c[_0xb46d('0x19')][_0xb46d('0x1a')]===undefined?!![]:![]:!![],'where':_0x47dc0c[_0xb46d('0x19')]?_0x47dc0c['options'][_0xb46d('0x1b')]||null:null,'attributes':_0x47dc0c[_0xb46d('0x19')]?_0x47dc0c['options']['attributes']||null:null,'limit':_0x47dc0c[_0xb46d('0x19')]?_0x47dc0c[_0xb46d('0x19')][_0xb46d('0x1c')]||null:null,'include':_0x47dc0c[_0xb46d('0x19')]?_0x47dc0c[_0xb46d('0x19')][_0xb46d('0x1d')]?_['map'](_0x47dc0c['options'][_0xb46d('0x1d')],function(_0x222cc6){return{'model':db[_0x222cc6['model']],'as':_0x222cc6['as'],'attributes':_0x222cc6[_0xb46d('0x1e')],'include':_0x222cc6[_0xb46d('0x1d')]?_[_0xb46d('0x1f')](_0x222cc6['include'],function(_0x5c757c){return{'model':db[_0x5c757c['model']],'as':_0x5c757c['as'],'attributes':_0x5c757c['attributes'],'include':_0x5c757c[_0xb46d('0x1d')]?_[_0xb46d('0x1f')](_0x5c757c[_0xb46d('0x1d')],function(_0x28d44e){return{'model':db[_0x28d44e['model']],'as':_0x28d44e['as'],'attributes':_0x28d44e[_0xb46d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb46d('0xc')](function(_0x1cf730){logger[_0xb46d('0xd')](_0xb46d('0x17'),_0x47dc0c);logger[_0xb46d('0xe')](_0xb46d('0x17'),_0x47dc0c,JSON['stringify'](_0x1cf730));_0x23e11d(_0x1cf730);})[_0xb46d('0x16')](function(_0x336d71){logger[_0xb46d('0x11')](_0xb46d('0x17'),_0x336d71[_0xb46d('0x14')],_0x47dc0c);_0x327eb9(_0x436c2a[_0xb46d('0x11')](0x1f4,_0x336d71[_0xb46d('0x14')]));});});};exports[_0xb46d('0x20')]=function(_0x138de3){var _0x3d162c=this;return new Promise(function(_0x21e5a6,_0x36b3b5){return db[_0xb46d('0x21')][_0xb46d('0x22')]({'raw':_0x138de3['options']?_0x138de3[_0xb46d('0x19')][_0xb46d('0x1a')]===undefined?!![]:![]:!![],'where':_0x138de3[_0xb46d('0x19')]?_0x138de3[_0xb46d('0x19')]['where']||null:null,'attributes':_0x138de3[_0xb46d('0x19')]?_0x138de3[_0xb46d('0x19')][_0xb46d('0x1e')]||null:null,'include':_0x138de3['options']?_0x138de3[_0xb46d('0x19')][_0xb46d('0x1d')]?_[_0xb46d('0x1f')](_0x138de3[_0xb46d('0x19')][_0xb46d('0x1d')],function(_0x3e070f){return{'model':db[_0x3e070f['model']],'as':_0x3e070f['as'],'attributes':_0x3e070f[_0xb46d('0x1e')],'include':_0x3e070f['include']?_[_0xb46d('0x1f')](_0x3e070f[_0xb46d('0x1d')],function(_0x1562b9){return{'model':db[_0x1562b9[_0xb46d('0x23')]],'as':_0x1562b9['as'],'attributes':_0x1562b9[_0xb46d('0x1e')],'include':_0x1562b9[_0xb46d('0x1d')]?_[_0xb46d('0x1f')](_0x1562b9[_0xb46d('0x1d')],function(_0x266e82){return{'model':db[_0x266e82[_0xb46d('0x23')]],'as':_0x266e82['as'],'attributes':_0x266e82[_0xb46d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb46d('0xc')](function(_0x22d0df){logger['info'](_0xb46d('0x20'),_0x138de3);logger[_0xb46d('0xe')](_0xb46d('0x20'),_0x138de3,JSON['stringify'](_0x22d0df));_0x21e5a6(_0x22d0df);})[_0xb46d('0x16')](function(_0xe441b9){logger[_0xb46d('0x11')](_0xb46d('0x20'),_0xe441b9[_0xb46d('0x14')],_0x138de3);_0x36b3b5(_0x3d162c[_0xb46d('0x11')](0x1f4,_0xe441b9[_0xb46d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 140ffdf..113715d 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 _0x6b69=['Router','fs-extra','../../components/auth/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','exports','multer','util','path'];(function(_0x28afd4,_0x10ff46){var _0xce4a78=function(_0x2c0a2e){while(--_0x2c0a2e){_0x28afd4['push'](_0x28afd4['shift']());}};_0xce4a78(++_0x10ff46);}(_0x6b69,0x1e0));var _0x96b6=function(_0x1ff44d,_0x5ca0cc){_0x1ff44d=_0x1ff44d-0x0;var _0x24e958=_0x6b69[_0x1ff44d];return _0x24e958;};'use strict';var multer=require(_0x96b6('0x0'));var util=require(_0x96b6('0x1'));var path=require(_0x96b6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96b6('0x3')]();var fs_extra=require(_0x96b6('0x4'));var auth=require(_0x96b6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x96b6('0x6'));router[_0x96b6('0x7')]('/',auth[_0x96b6('0x8')](),controller['index']);router[_0x96b6('0x7')](_0x96b6('0x9'),auth[_0x96b6('0x8')](),controller[_0x96b6('0xa')]);router[_0x96b6('0x7')](_0x96b6('0xb'),auth[_0x96b6('0x8')](),controller[_0x96b6('0xc')]);router[_0x96b6('0x7')](_0x96b6('0xd'),auth['isAuthenticated'](),controller[_0x96b6('0xe')]);router['get'](_0x96b6('0xf'),auth[_0x96b6('0x8')](),controller[_0x96b6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x96b6('0x11')](_0x96b6('0x9'),auth[_0x96b6('0x8')](),controller[_0x96b6('0x12')]);router['delete']('/:id',auth[_0x96b6('0x8')](),controller[_0x96b6('0x13')]);module[_0x96b6('0x14')]=router; \ No newline at end of file +var _0x1239=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer'];(function(_0x484161,_0x397cc5){var _0x4bd42e=function(_0x2a94ee){while(--_0x2a94ee){_0x484161['push'](_0x484161['shift']());}};_0x4bd42e(++_0x397cc5);}(_0x1239,0x1e2));var _0x9123=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1239[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9123('0x0'));var util=require('util');var path=require(_0x9123('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9123('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9123('0x3'));var interaction=require(_0x9123('0x4'));var config=require(_0x9123('0x5'));var controller=require(_0x9123('0x6'));router[_0x9123('0x7')]('/',auth[_0x9123('0x8')](),controller[_0x9123('0x9')]);router[_0x9123('0x7')](_0x9123('0xa'),auth[_0x9123('0x8')](),controller[_0x9123('0xb')]);router['get'](_0x9123('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x9123('0x7')]('/:id/subjects',auth[_0x9123('0x8')](),controller[_0x9123('0xd')]);router[_0x9123('0x7')](_0x9123('0xe'),auth['isAuthenticated'](),controller[_0x9123('0xf')]);router[_0x9123('0x10')]('/',auth[_0x9123('0x8')](),controller[_0x9123('0x11')]);router[_0x9123('0x12')](_0x9123('0xa'),auth[_0x9123('0x8')](),controller[_0x9123('0x13')]);router['delete']('/:id',auth[_0x9123('0x8')](),controller[_0x9123('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 951a0e9..5b733f8 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 _0xf040=['sequelize','exports','STRING'];(function(_0x4b6ece,_0x3234be){var _0x55c744=function(_0x13f068){while(--_0x13f068){_0x4b6ece['push'](_0x4b6ece['shift']());}};_0x55c744(++_0x3234be);}(_0xf040,0x1e6));var _0x0f04=function(_0x44c0c2,_0x29d866){_0x44c0c2=_0x44c0c2-0x0;var _0x5b2eb8=_0xf040[_0x44c0c2];return _0x5b2eb8;};'use strict';var Sequelize=require(_0x0f04('0x0'));module[_0x0f04('0x1')]={'name':{'type':Sequelize[_0x0f04('0x2')]},'description':{'type':Sequelize[_0x0f04('0x2')]}}; \ No newline at end of file +var _0xb03c=['exports','STRING','sequelize'];(function(_0x503cd9,_0x3e4924){var _0x15e557=function(_0x1d1189){while(--_0x1d1189){_0x503cd9['push'](_0x503cd9['shift']());}};_0x15e557(++_0x3e4924);}(_0xb03c,0x1df));var _0xcb03=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xb03c[_0x513545];return _0x18b7c5;};'use strict';var Sequelize=require(_0xcb03('0x0'));module[_0xcb03('0x1')]={'name':{'type':Sequelize[_0xcb03('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 9e11406..49bd27a 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 _0xb861=['destroy','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','intersection','fields','create','body','params','getFields','ServicenowField','getSubjects','findOne','pick','nolimit','getDescriptions','eml-format','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update'];(function(_0x27d96,_0x5e4e9f){var _0x123742=function(_0x382582){while(--_0x382582){_0x27d96['push'](_0x27d96['shift']());}};_0x123742(++_0x5e4e9f);}(_0xb861,0xc7));var _0x1b86=function(_0x145e9e,_0x2e6dd4){_0x145e9e=_0x145e9e-0x0;var _0x2264c2=_0xb861[_0x145e9e];return _0x2264c2;};'use strict';var emlformat=require(_0x1b86('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b86('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b86('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b86('0x3'));var util=require('util');var path=require(_0x1b86('0x4'));var sox=require(_0x1b86('0x5'));var csv=require('to-csv');var ejs=require(_0x1b86('0x6'));var fs=require('fs');var fs_extra=require(_0x1b86('0x7'));var _=require(_0x1b86('0x8'));var squel=require(_0x1b86('0x9'));var crypto=require(_0x1b86('0xa'));var jsforce=require(_0x1b86('0xb'));var deskjs=require(_0x1b86('0xc'));var toCsv=require(_0x1b86('0xd'));var querystring=require('querystring');var Papa=require(_0x1b86('0xe'));var Redis=require(_0x1b86('0xf'));var authService=require(_0x1b86('0x10'));var qs=require(_0x1b86('0x11'));var as=require(_0x1b86('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1b86('0x13'));var utils=require(_0x1b86('0x14'));var config=require(_0x1b86('0x15'));var licenseUtil=require(_0x1b86('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4039a4,_0x1dcb72){_0x1dcb72=_0x1dcb72||0xcc;return function(_0x344377){if(_0x344377){return _0x4039a4[_0x1b86('0x17')](_0x1dcb72);}return _0x4039a4['status'](_0x1dcb72)[_0x1b86('0x18')]();};}function respondWithResult(_0xce622b,_0x4e88b5){_0x4e88b5=_0x4e88b5||0xc8;return function(_0xc8437){if(_0xc8437){return _0xce622b['status'](_0x4e88b5)[_0x1b86('0x19')](_0xc8437);}};}function respondWithFilteredResult(_0x2c773a,_0x3766a2){return function(_0x341497){if(_0x341497){var _0x49e128=typeof _0x3766a2[_0x1b86('0x1a')]===_0x1b86('0x1b')&&typeof _0x3766a2[_0x1b86('0x1c')]===_0x1b86('0x1b');var _0x79154=_0x341497[_0x1b86('0x1d')];var _0x3d3f1b=_0x49e128?0x0:_0x3766a2[_0x1b86('0x1a')];var _0x31c6d7=_0x49e128?_0x341497[_0x1b86('0x1d')]:_0x3766a2[_0x1b86('0x1a')]+_0x3766a2['limit'];var _0x4a8750;if(_0x31c6d7>=_0x79154){_0x31c6d7=_0x79154;_0x4a8750=0xc8;}else{_0x4a8750=0xce;}_0x2c773a[_0x1b86('0x1e')](_0x4a8750);return _0x2c773a['set'](_0x1b86('0x1f'),_0x3d3f1b+'-'+_0x31c6d7+'/'+_0x79154)['json'](_0x341497);}return null;};}function patchUpdates(_0x242269){return function(_0x2e628b){try{jsonpatch[_0x1b86('0x20')](_0x2e628b,_0x242269,!![]);}catch(_0x324003){return BPromise[_0x1b86('0x21')](_0x324003);}return _0x2e628b['save']();};}function saveUpdates(_0x3bfa91,_0x3cad30){return function(_0x53fb66){if(_0x53fb66){return _0x53fb66[_0x1b86('0x22')](_0x3bfa91)['then'](function(_0xf51208){return _0xf51208;});}return null;};}function removeEntity(_0x1e0dbf,_0x23a30e){return function(_0xd0a830){if(_0xd0a830){return _0xd0a830[_0x1b86('0x23')]()['then'](function(){_0x1e0dbf[_0x1b86('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6023e3,_0x3051cb){return function(_0x5e765b){if(!_0x5e765b){_0x6023e3[_0x1b86('0x17')](0x194);}return _0x5e765b;};}function handleError(_0x56ed9c,_0x475e05){_0x475e05=_0x475e05||0x1f4;return function(_0x25ee84){logger['error'](_0x25ee84[_0x1b86('0x24')]);if(_0x25ee84[_0x1b86('0x25')]){delete _0x25ee84[_0x1b86('0x25')];}_0x56ed9c[_0x1b86('0x1e')](_0x475e05)['send'](_0x25ee84);};}exports[_0x1b86('0x26')]=function(_0x228931,_0x439e60){var _0x508239={},_0xf047a4={},_0x41a223={'count':0x0,'rows':[]};var _0x28d497=_[_0x1b86('0x27')](db[_0x1b86('0x28')][_0x1b86('0x29')],function(_0x2a3e2e){return{'name':_0x2a3e2e[_0x1b86('0x2a')],'type':_0x2a3e2e[_0x1b86('0x2b')][_0x1b86('0x2c')]};});_0xf047a4[_0x1b86('0x2d')]=_[_0x1b86('0x27')](_0x28d497,_0x1b86('0x25'));_0xf047a4['query']=_[_0x1b86('0x2e')](_0x228931[_0x1b86('0x2f')]);_0xf047a4[_0x1b86('0x30')]=_['intersection'](_0xf047a4[_0x1b86('0x2d')],_0xf047a4['query']);_0x508239[_0x1b86('0x31')]=_['intersection'](_0xf047a4['model'],qs['fields'](_0x228931['query']['fields']));_0x508239[_0x1b86('0x31')]=_0x508239['attributes'][_0x1b86('0x32')]?_0x508239[_0x1b86('0x31')]:_0xf047a4[_0x1b86('0x2d')];if(!_0x228931[_0x1b86('0x2f')][_0x1b86('0x33')]('nolimit')){_0x508239[_0x1b86('0x1c')]=qs['limit'](_0x228931[_0x1b86('0x2f')][_0x1b86('0x1c')]);_0x508239[_0x1b86('0x1a')]=qs['offset'](_0x228931['query'][_0x1b86('0x1a')]);}_0x508239[_0x1b86('0x34')]=qs[_0x1b86('0x35')](_0x228931[_0x1b86('0x2f')][_0x1b86('0x35')]);_0x508239[_0x1b86('0x36')]=qs['filters'](_['pick'](_0x228931[_0x1b86('0x2f')],_0xf047a4['filters']),_0x28d497);if(_0x228931[_0x1b86('0x2f')]['filter']){_0x508239[_0x1b86('0x36')]=_[_0x1b86('0x37')](_0x508239[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0x28d497,function(_0x5361bc){if(_0x5361bc['type']!==_0x1b86('0x38')){var _0x78c4eb={};_0x78c4eb[_0x5361bc[_0x1b86('0x25')]]={'$like':'%'+_0x228931[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x78c4eb;}})});}_0x508239=_['merge']({},_0x508239,_0x228931[_0x1b86('0x3a')]);var _0x526f31={'where':_0x508239[_0x1b86('0x36')]};return db['ServicenowConfiguration'][_0x1b86('0x1d')](_0x526f31)[_0x1b86('0x3b')](function(_0x1b78ce){_0x41a223['count']=_0x1b78ce;if(_0x228931[_0x1b86('0x2f')][_0x1b86('0x3c')]){_0x508239[_0x1b86('0x3d')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x1b86('0x3e')](_0x508239);})[_0x1b86('0x3b')](function(_0x151d9d){_0x41a223[_0x1b86('0x3f')]=_0x151d9d;return _0x41a223;})[_0x1b86('0x3b')](respondWithFilteredResult(_0x439e60,_0x508239))[_0x1b86('0x40')](handleError(_0x439e60,null));};exports[_0x1b86('0x41')]=function(_0x49828a,_0x31de27){var _0x575679={'raw':![],'where':{'id':_0x49828a['params']['id']}},_0x597587={};_0x597587['model']=_[_0x1b86('0x2e')](db[_0x1b86('0x28')]['rawAttributes']);_0x597587['query']=_[_0x1b86('0x2e')](_0x49828a[_0x1b86('0x2f')]);_0x597587['filters']=_[_0x1b86('0x42')](_0x597587[_0x1b86('0x2d')],_0x597587[_0x1b86('0x2f')]);_0x575679[_0x1b86('0x31')]=_[_0x1b86('0x42')](_0x597587[_0x1b86('0x2d')],qs[_0x1b86('0x43')](_0x49828a['query'][_0x1b86('0x43')]));_0x575679['attributes']=_0x575679['attributes'][_0x1b86('0x32')]?_0x575679[_0x1b86('0x31')]:_0x597587[_0x1b86('0x2d')];if(_0x49828a[_0x1b86('0x2f')][_0x1b86('0x3c')]){_0x575679[_0x1b86('0x3d')]=[{'all':!![]}];}_0x575679=_[_0x1b86('0x37')]({},_0x575679,_0x49828a[_0x1b86('0x3a')]);return db['ServicenowConfiguration']['find'](_0x575679)['then'](handleEntityNotFound(_0x31de27,null))[_0x1b86('0x3b')](respondWithResult(_0x31de27,null))[_0x1b86('0x40')](handleError(_0x31de27,null));};exports[_0x1b86('0x44')]=function(_0x4e183a,_0x275bd5){return db[_0x1b86('0x28')][_0x1b86('0x44')](_0x4e183a['body'],{})['then'](respondWithResult(_0x275bd5,0xc9))[_0x1b86('0x40')](handleError(_0x275bd5,null));};exports[_0x1b86('0x22')]=function(_0x384db5,_0xe6124a){if(_0x384db5[_0x1b86('0x45')]['id']){delete _0x384db5[_0x1b86('0x45')]['id'];}return db[_0x1b86('0x28')]['find']({'where':{'id':_0x384db5[_0x1b86('0x46')]['id']}})[_0x1b86('0x3b')](handleEntityNotFound(_0xe6124a,null))[_0x1b86('0x3b')](saveUpdates(_0x384db5[_0x1b86('0x45')],null))[_0x1b86('0x3b')](respondWithResult(_0xe6124a,null))[_0x1b86('0x40')](handleError(_0xe6124a,null));};exports[_0x1b86('0x23')]=function(_0x4a9dd8,_0x18f14d){return db[_0x1b86('0x28')]['find']({'where':{'id':_0x4a9dd8[_0x1b86('0x46')]['id']}})['then'](handleEntityNotFound(_0x18f14d,null))[_0x1b86('0x3b')](removeEntity(_0x18f14d,null))[_0x1b86('0x40')](handleError(_0x18f14d,null));};exports[_0x1b86('0x47')]=function(_0xc2a0b9,_0xecb8d5,_0x217903){var _0xca502a={};var _0x4e5282={};var _0x554244;var _0x274a4d;return db[_0x1b86('0x28')]['findOne']({'where':{'id':_0xc2a0b9['params']['id']}})[_0x1b86('0x3b')](handleEntityNotFound(_0xecb8d5,null))[_0x1b86('0x3b')](function(_0x3a365e){if(_0x3a365e){_0x554244=_0x3a365e;_0x4e5282[_0x1b86('0x2d')]=_[_0x1b86('0x2e')](db[_0x1b86('0x48')][_0x1b86('0x29')]);_0x4e5282[_0x1b86('0x2f')]=_[_0x1b86('0x2e')](_0xc2a0b9['query']);_0x4e5282['filters']=_[_0x1b86('0x42')](_0x4e5282[_0x1b86('0x2d')],_0x4e5282[_0x1b86('0x2f')]);_0xca502a[_0x1b86('0x31')]=_[_0x1b86('0x42')](_0x4e5282[_0x1b86('0x2d')],qs[_0x1b86('0x43')](_0xc2a0b9[_0x1b86('0x2f')]['fields']));_0xca502a[_0x1b86('0x31')]=_0xca502a[_0x1b86('0x31')][_0x1b86('0x32')]?_0xca502a[_0x1b86('0x31')]:_0x4e5282[_0x1b86('0x2d')];_0xca502a[_0x1b86('0x34')]=qs[_0x1b86('0x35')](_0xc2a0b9['query'][_0x1b86('0x35')]);_0xca502a[_0x1b86('0x36')]=qs[_0x1b86('0x30')](_['pick'](_0xc2a0b9[_0x1b86('0x2f')],_0x4e5282['filters']));if(_0xc2a0b9[_0x1b86('0x2f')][_0x1b86('0x39')]){_0xca502a[_0x1b86('0x36')]=_[_0x1b86('0x37')](_0xca502a[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0xca502a[_0x1b86('0x31')],function(_0x4983bc){var _0x560871={};_0x560871[_0x4983bc]={'$like':'%'+_0xc2a0b9[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x560871;})});}_0xca502a=_[_0x1b86('0x37')]({},_0xca502a,_0xc2a0b9['options']);return _0x554244['getFields'](_0xca502a);}})[_0x1b86('0x3b')](function(_0x274944){if(_0x274944){_0x274a4d=_0x274944[_0x1b86('0x32')];if(!_0xc2a0b9['query']['hasOwnProperty']('nolimit')){_0xca502a[_0x1b86('0x1c')]=qs[_0x1b86('0x1c')](_0xc2a0b9['query']['limit']);_0xca502a['offset']=qs[_0x1b86('0x1a')](_0xc2a0b9[_0x1b86('0x2f')][_0x1b86('0x1a')]);}return _0x554244[_0x1b86('0x47')](_0xca502a);}})[_0x1b86('0x3b')](function(_0x29bcd8){if(_0x29bcd8){return _0x29bcd8?{'count':_0x274a4d,'rows':_0x29bcd8}:null;}})['then'](respondWithResult(_0xecb8d5,null))['catch'](handleError(_0xecb8d5,null));};exports[_0x1b86('0x49')]=function(_0x36abf3,_0x444b68,_0x5474c5){var _0xea4989={};var _0x33a575={};var _0x13d1bc;var _0x593c42;return db[_0x1b86('0x28')][_0x1b86('0x4a')]({'where':{'id':_0x36abf3[_0x1b86('0x46')]['id']}})[_0x1b86('0x3b')](handleEntityNotFound(_0x444b68,null))[_0x1b86('0x3b')](function(_0x260e3d){if(_0x260e3d){_0x13d1bc=_0x260e3d;_0x33a575[_0x1b86('0x2d')]=_[_0x1b86('0x2e')](db[_0x1b86('0x48')][_0x1b86('0x29')]);_0x33a575['query']=_[_0x1b86('0x2e')](_0x36abf3[_0x1b86('0x2f')]);_0x33a575[_0x1b86('0x30')]=_['intersection'](_0x33a575[_0x1b86('0x2d')],_0x33a575['query']);_0xea4989['attributes']=_[_0x1b86('0x42')](_0x33a575[_0x1b86('0x2d')],qs['fields'](_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x43')]));_0xea4989[_0x1b86('0x31')]=_0xea4989[_0x1b86('0x31')][_0x1b86('0x32')]?_0xea4989[_0x1b86('0x31')]:_0x33a575[_0x1b86('0x2d')];_0xea4989[_0x1b86('0x34')]=qs[_0x1b86('0x35')](_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x35')]);_0xea4989['where']=qs[_0x1b86('0x30')](_[_0x1b86('0x4b')](_0x36abf3[_0x1b86('0x2f')],_0x33a575[_0x1b86('0x30')]));if(_0x36abf3['query']['filter']){_0xea4989['where']=_[_0x1b86('0x37')](_0xea4989[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0xea4989['attributes'],function(_0x298168){var _0x61b942={};_0x61b942[_0x298168]={'$like':'%'+_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x61b942;})});}_0xea4989=_[_0x1b86('0x37')]({},_0xea4989,_0x36abf3[_0x1b86('0x3a')]);return _0x13d1bc['getSubjects'](_0xea4989);}})[_0x1b86('0x3b')](function(_0x4f0f54){if(_0x4f0f54){_0x593c42=_0x4f0f54[_0x1b86('0x32')];if(!_0x36abf3['query']['hasOwnProperty'](_0x1b86('0x4c'))){_0xea4989['limit']=qs['limit'](_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x1c')]);_0xea4989[_0x1b86('0x1a')]=qs[_0x1b86('0x1a')](_0x36abf3['query'][_0x1b86('0x1a')]);}return _0x13d1bc[_0x1b86('0x49')](_0xea4989);}})['then'](function(_0x556c50){if(_0x556c50){return _0x556c50?{'count':_0x593c42,'rows':_0x556c50}:null;}})['then'](respondWithResult(_0x444b68,null))[_0x1b86('0x40')](handleError(_0x444b68,null));};exports[_0x1b86('0x4d')]=function(_0x411577,_0x379b95,_0x2678e6){var _0x101597={};var _0x5ec82e={};var _0x446d6c;var _0x61e504;return db['ServicenowConfiguration'][_0x1b86('0x4a')]({'where':{'id':_0x411577[_0x1b86('0x46')]['id']}})['then'](handleEntityNotFound(_0x379b95,null))[_0x1b86('0x3b')](function(_0x5010f7){if(_0x5010f7){_0x446d6c=_0x5010f7;_0x5ec82e[_0x1b86('0x2d')]=_[_0x1b86('0x2e')](db['ServicenowField'][_0x1b86('0x29')]);_0x5ec82e[_0x1b86('0x2f')]=_[_0x1b86('0x2e')](_0x411577['query']);_0x5ec82e[_0x1b86('0x30')]=_[_0x1b86('0x42')](_0x5ec82e[_0x1b86('0x2d')],_0x5ec82e['query']);_0x101597[_0x1b86('0x31')]=_[_0x1b86('0x42')](_0x5ec82e[_0x1b86('0x2d')],qs[_0x1b86('0x43')](_0x411577[_0x1b86('0x2f')][_0x1b86('0x43')]));_0x101597[_0x1b86('0x31')]=_0x101597[_0x1b86('0x31')][_0x1b86('0x32')]?_0x101597['attributes']:_0x5ec82e[_0x1b86('0x2d')];_0x101597[_0x1b86('0x34')]=qs['sort'](_0x411577[_0x1b86('0x2f')][_0x1b86('0x35')]);_0x101597[_0x1b86('0x36')]=qs[_0x1b86('0x30')](_[_0x1b86('0x4b')](_0x411577[_0x1b86('0x2f')],_0x5ec82e['filters']));if(_0x411577['query']['filter']){_0x101597['where']=_[_0x1b86('0x37')](_0x101597[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0x101597[_0x1b86('0x31')],function(_0x14e847){var _0x57524b={};_0x57524b[_0x14e847]={'$like':'%'+_0x411577[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x57524b;})});}_0x101597=_[_0x1b86('0x37')]({},_0x101597,_0x411577['options']);return _0x446d6c[_0x1b86('0x4d')](_0x101597);}})['then'](function(_0xb5bb5b){if(_0xb5bb5b){_0x61e504=_0xb5bb5b[_0x1b86('0x32')];if(!_0x411577[_0x1b86('0x2f')]['hasOwnProperty'](_0x1b86('0x4c'))){_0x101597[_0x1b86('0x1c')]=qs[_0x1b86('0x1c')](_0x411577[_0x1b86('0x2f')][_0x1b86('0x1c')]);_0x101597[_0x1b86('0x1a')]=qs[_0x1b86('0x1a')](_0x411577[_0x1b86('0x2f')][_0x1b86('0x1a')]);}return _0x446d6c['getDescriptions'](_0x101597);}})[_0x1b86('0x3b')](function(_0x38f626){if(_0x38f626){return _0x38f626?{'count':_0x61e504,'rows':_0x38f626}:null;}})[_0x1b86('0x3b')](respondWithResult(_0x379b95,null))[_0x1b86('0x40')](handleError(_0x379b95,null));}; \ No newline at end of file +var _0x4986=['eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','ServicenowConfiguration','include','catch','show','params','includeAll','find','create','body','getFields','findOne','nolimit','getSubjects','ServicenowField','order','getDescriptions'];(function(_0x2a8602,_0x42bb74){var _0x82c8e1=function(_0x493ef5){while(--_0x493ef5){_0x2a8602['push'](_0x2a8602['shift']());}};_0x82c8e1(++_0x42bb74);}(_0x4986,0xe7));var _0x6498=function(_0x415118,_0x195c20){_0x415118=_0x415118-0x0;var _0x162a99=_0x4986[_0x415118];return _0x162a99;};'use strict';var emlformat=require(_0x6498('0x0'));var rimraf=require(_0x6498('0x1'));var zipdir=require(_0x6498('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6498('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6498('0x4'));var util=require(_0x6498('0x5'));var path=require(_0x6498('0x6'));var sox=require(_0x6498('0x7'));var csv=require(_0x6498('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6498('0x9'));var _=require(_0x6498('0xa'));var squel=require('squel');var crypto=require(_0x6498('0xb'));var jsforce=require(_0x6498('0xc'));var deskjs=require(_0x6498('0xd'));var toCsv=require(_0x6498('0x8'));var querystring=require(_0x6498('0xe'));var Papa=require('papaparse');var Redis=require(_0x6498('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6498('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6498('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6498('0x12'));var licenseUtil=require(_0x6498('0x13'));var db=require(_0x6498('0x14'))['db'];function respondWithStatusCode(_0x5f0b27,_0x4e3000){_0x4e3000=_0x4e3000||0xcc;return function(_0x11935f){if(_0x11935f){return _0x5f0b27[_0x6498('0x15')](_0x4e3000);}return _0x5f0b27[_0x6498('0x16')](_0x4e3000)[_0x6498('0x17')]();};}function respondWithResult(_0xdad8b,_0x3b71d9){_0x3b71d9=_0x3b71d9||0xc8;return function(_0xb3cbb){if(_0xb3cbb){return _0xdad8b[_0x6498('0x16')](_0x3b71d9)[_0x6498('0x18')](_0xb3cbb);}};}function respondWithFilteredResult(_0x37a1f7,_0x49ccc9){return function(_0x19afbe){if(_0x19afbe){var _0x208c01=typeof _0x49ccc9['offset']===_0x6498('0x19')&&typeof _0x49ccc9['limit']===_0x6498('0x19');var _0x22a0aa=_0x19afbe['count'];var _0x4991f9=_0x208c01?0x0:_0x49ccc9[_0x6498('0x1a')];var _0xc5bea0=_0x208c01?_0x19afbe[_0x6498('0x1b')]:_0x49ccc9[_0x6498('0x1a')]+_0x49ccc9[_0x6498('0x1c')];var _0x5dd064;if(_0xc5bea0>=_0x22a0aa){_0xc5bea0=_0x22a0aa;_0x5dd064=0xc8;}else{_0x5dd064=0xce;}_0x37a1f7['status'](_0x5dd064);return _0x37a1f7[_0x6498('0x1d')]('Content-Range',_0x4991f9+'-'+_0xc5bea0+'/'+_0x22a0aa)[_0x6498('0x18')](_0x19afbe);}return null;};}function patchUpdates(_0x3ac1e3){return function(_0x4624de){try{jsonpatch[_0x6498('0x1e')](_0x4624de,_0x3ac1e3,!![]);}catch(_0x107cbb){return BPromise[_0x6498('0x1f')](_0x107cbb);}return _0x4624de[_0x6498('0x20')]();};}function saveUpdates(_0xbd052f,_0x4d9be2){return function(_0x442ce3){if(_0x442ce3){return _0x442ce3[_0x6498('0x21')](_0xbd052f)[_0x6498('0x22')](function(_0x273d3){return _0x273d3;});}return null;};}function removeEntity(_0x17e7da,_0x1243a8){return function(_0x10e2de){if(_0x10e2de){return _0x10e2de[_0x6498('0x23')]()[_0x6498('0x22')](function(){_0x17e7da[_0x6498('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168581,_0x13ce31){return function(_0x411033){if(!_0x411033){_0x168581[_0x6498('0x15')](0x194);}return _0x411033;};}function handleError(_0x5e368a,_0x433da4){_0x433da4=_0x433da4||0x1f4;return function(_0x5a10a4){logger[_0x6498('0x24')](_0x5a10a4[_0x6498('0x25')]);if(_0x5a10a4[_0x6498('0x26')]){delete _0x5a10a4[_0x6498('0x26')];}_0x5e368a[_0x6498('0x16')](_0x433da4)[_0x6498('0x27')](_0x5a10a4);};}exports[_0x6498('0x28')]=function(_0x3915bb,_0x238f32){var _0x1b3476={},_0xae1323={},_0x33bd39={'count':0x0,'rows':[]};var _0x8da042=_[_0x6498('0x29')](db['ServicenowConfiguration'][_0x6498('0x2a')],function(_0x218bf0){return{'name':_0x218bf0[_0x6498('0x2b')],'type':_0x218bf0[_0x6498('0x2c')]['key']};});_0xae1323[_0x6498('0x2d')]=_[_0x6498('0x29')](_0x8da042,_0x6498('0x26'));_0xae1323[_0x6498('0x2e')]=_[_0x6498('0x2f')](_0x3915bb[_0x6498('0x2e')]);_0xae1323[_0x6498('0x30')]=_[_0x6498('0x31')](_0xae1323[_0x6498('0x2d')],_0xae1323[_0x6498('0x2e')]);_0x1b3476[_0x6498('0x32')]=_[_0x6498('0x31')](_0xae1323[_0x6498('0x2d')],qs[_0x6498('0x33')](_0x3915bb[_0x6498('0x2e')][_0x6498('0x33')]));_0x1b3476[_0x6498('0x32')]=_0x1b3476['attributes'][_0x6498('0x34')]?_0x1b3476[_0x6498('0x32')]:_0xae1323[_0x6498('0x2d')];if(!_0x3915bb[_0x6498('0x2e')][_0x6498('0x35')]('nolimit')){_0x1b3476[_0x6498('0x1c')]=qs[_0x6498('0x1c')](_0x3915bb[_0x6498('0x2e')]['limit']);_0x1b3476[_0x6498('0x1a')]=qs['offset'](_0x3915bb[_0x6498('0x2e')][_0x6498('0x1a')]);}_0x1b3476['order']=qs[_0x6498('0x36')](_0x3915bb[_0x6498('0x2e')]['sort']);_0x1b3476['where']=qs['filters'](_[_0x6498('0x37')](_0x3915bb[_0x6498('0x2e')],_0xae1323[_0x6498('0x30')]),_0x8da042);if(_0x3915bb['query'][_0x6498('0x38')]){_0x1b3476['where']=_[_0x6498('0x39')](_0x1b3476[_0x6498('0x3a')],{'$or':_[_0x6498('0x29')](_0x8da042,function(_0x2a5903){if(_0x2a5903[_0x6498('0x2c')]!==_0x6498('0x3b')){var _0x38b0d5={};_0x38b0d5[_0x2a5903[_0x6498('0x26')]]={'$like':'%'+_0x3915bb[_0x6498('0x2e')][_0x6498('0x38')]+'%'};return _0x38b0d5;}})});}_0x1b3476=_['merge']({},_0x1b3476,_0x3915bb[_0x6498('0x3c')]);var _0x281b6a={'where':_0x1b3476[_0x6498('0x3a')]};return db[_0x6498('0x3d')][_0x6498('0x1b')](_0x281b6a)['then'](function(_0x1cddce){_0x33bd39[_0x6498('0x1b')]=_0x1cddce;if(_0x3915bb[_0x6498('0x2e')]['includeAll']){_0x1b3476[_0x6498('0x3e')]=[{'all':!![]}];}return db[_0x6498('0x3d')]['findAll'](_0x1b3476);})[_0x6498('0x22')](function(_0x44571f){_0x33bd39['rows']=_0x44571f;return _0x33bd39;})[_0x6498('0x22')](respondWithFilteredResult(_0x238f32,_0x1b3476))[_0x6498('0x3f')](handleError(_0x238f32,null));};exports[_0x6498('0x40')]=function(_0x37a981,_0x154228){var _0x5c2870={'raw':![],'where':{'id':_0x37a981[_0x6498('0x41')]['id']}},_0x47ffc7={};_0x47ffc7['model']=_['keys'](db[_0x6498('0x3d')][_0x6498('0x2a')]);_0x47ffc7['query']=_[_0x6498('0x2f')](_0x37a981[_0x6498('0x2e')]);_0x47ffc7[_0x6498('0x30')]=_[_0x6498('0x31')](_0x47ffc7[_0x6498('0x2d')],_0x47ffc7[_0x6498('0x2e')]);_0x5c2870[_0x6498('0x32')]=_[_0x6498('0x31')](_0x47ffc7[_0x6498('0x2d')],qs[_0x6498('0x33')](_0x37a981[_0x6498('0x2e')]['fields']));_0x5c2870[_0x6498('0x32')]=_0x5c2870[_0x6498('0x32')][_0x6498('0x34')]?_0x5c2870[_0x6498('0x32')]:_0x47ffc7[_0x6498('0x2d')];if(_0x37a981['query'][_0x6498('0x42')]){_0x5c2870['include']=[{'all':!![]}];}_0x5c2870=_[_0x6498('0x39')]({},_0x5c2870,_0x37a981[_0x6498('0x3c')]);return db['ServicenowConfiguration'][_0x6498('0x43')](_0x5c2870)[_0x6498('0x22')](handleEntityNotFound(_0x154228,null))[_0x6498('0x22')](respondWithResult(_0x154228,null))[_0x6498('0x3f')](handleError(_0x154228,null));};exports[_0x6498('0x44')]=function(_0x201a3d,_0xce8b8){return db[_0x6498('0x3d')]['create'](_0x201a3d[_0x6498('0x45')],{})[_0x6498('0x22')](respondWithResult(_0xce8b8,0xc9))['catch'](handleError(_0xce8b8,null));};exports[_0x6498('0x21')]=function(_0x42df21,_0x283ca4){if(_0x42df21[_0x6498('0x45')]['id']){delete _0x42df21['body']['id'];}return db[_0x6498('0x3d')]['find']({'where':{'id':_0x42df21[_0x6498('0x41')]['id']}})[_0x6498('0x22')](handleEntityNotFound(_0x283ca4,null))[_0x6498('0x22')](saveUpdates(_0x42df21[_0x6498('0x45')],null))[_0x6498('0x22')](respondWithResult(_0x283ca4,null))[_0x6498('0x3f')](handleError(_0x283ca4,null));};exports['destroy']=function(_0x402eca,_0x1e8dd3){return db[_0x6498('0x3d')]['find']({'where':{'id':_0x402eca[_0x6498('0x41')]['id']}})[_0x6498('0x22')](handleEntityNotFound(_0x1e8dd3,null))[_0x6498('0x22')](removeEntity(_0x1e8dd3,null))[_0x6498('0x3f')](handleError(_0x1e8dd3,null));};exports[_0x6498('0x46')]=function(_0x156325,_0x18312e,_0x337b1b){var _0x21c333={};var _0x1d13ca={};var _0x1f877a;var _0x4eff8a;return db[_0x6498('0x3d')][_0x6498('0x47')]({'where':{'id':_0x156325[_0x6498('0x41')]['id']}})[_0x6498('0x22')](handleEntityNotFound(_0x18312e,null))[_0x6498('0x22')](function(_0x476706){if(_0x476706){_0x1f877a=_0x476706;_0x1d13ca['model']=_[_0x6498('0x2f')](db['ServicenowField'][_0x6498('0x2a')]);_0x1d13ca[_0x6498('0x2e')]=_[_0x6498('0x2f')](_0x156325['query']);_0x1d13ca['filters']=_[_0x6498('0x31')](_0x1d13ca[_0x6498('0x2d')],_0x1d13ca['query']);_0x21c333[_0x6498('0x32')]=_['intersection'](_0x1d13ca[_0x6498('0x2d')],qs[_0x6498('0x33')](_0x156325[_0x6498('0x2e')][_0x6498('0x33')]));_0x21c333[_0x6498('0x32')]=_0x21c333[_0x6498('0x32')][_0x6498('0x34')]?_0x21c333[_0x6498('0x32')]:_0x1d13ca[_0x6498('0x2d')];_0x21c333['order']=qs[_0x6498('0x36')](_0x156325['query'][_0x6498('0x36')]);_0x21c333[_0x6498('0x3a')]=qs[_0x6498('0x30')](_[_0x6498('0x37')](_0x156325[_0x6498('0x2e')],_0x1d13ca[_0x6498('0x30')]));if(_0x156325[_0x6498('0x2e')][_0x6498('0x38')]){_0x21c333[_0x6498('0x3a')]=_[_0x6498('0x39')](_0x21c333[_0x6498('0x3a')],{'$or':_['map'](_0x21c333[_0x6498('0x32')],function(_0x3fce39){var _0xf49a13={};_0xf49a13[_0x3fce39]={'$like':'%'+_0x156325[_0x6498('0x2e')]['filter']+'%'};return _0xf49a13;})});}_0x21c333=_[_0x6498('0x39')]({},_0x21c333,_0x156325[_0x6498('0x3c')]);return _0x1f877a['getFields'](_0x21c333);}})[_0x6498('0x22')](function(_0xaa0bca){if(_0xaa0bca){_0x4eff8a=_0xaa0bca[_0x6498('0x34')];if(!_0x156325[_0x6498('0x2e')]['hasOwnProperty'](_0x6498('0x48'))){_0x21c333[_0x6498('0x1c')]=qs[_0x6498('0x1c')](_0x156325[_0x6498('0x2e')][_0x6498('0x1c')]);_0x21c333[_0x6498('0x1a')]=qs[_0x6498('0x1a')](_0x156325[_0x6498('0x2e')][_0x6498('0x1a')]);}return _0x1f877a['getFields'](_0x21c333);}})[_0x6498('0x22')](function(_0x297ea9){if(_0x297ea9){return _0x297ea9?{'count':_0x4eff8a,'rows':_0x297ea9}:null;}})[_0x6498('0x22')](respondWithResult(_0x18312e,null))[_0x6498('0x3f')](handleError(_0x18312e,null));};exports[_0x6498('0x49')]=function(_0x701b12,_0x42491a,_0xf3bdd1){var _0x3aef0d={};var _0x280c89={};var _0x1c4287;var _0x118cb3;return db[_0x6498('0x3d')][_0x6498('0x47')]({'where':{'id':_0x701b12[_0x6498('0x41')]['id']}})[_0x6498('0x22')](handleEntityNotFound(_0x42491a,null))[_0x6498('0x22')](function(_0x3e91bc){if(_0x3e91bc){_0x1c4287=_0x3e91bc;_0x280c89['model']=_[_0x6498('0x2f')](db[_0x6498('0x4a')]['rawAttributes']);_0x280c89[_0x6498('0x2e')]=_[_0x6498('0x2f')](_0x701b12[_0x6498('0x2e')]);_0x280c89[_0x6498('0x30')]=_[_0x6498('0x31')](_0x280c89[_0x6498('0x2d')],_0x280c89['query']);_0x3aef0d['attributes']=_[_0x6498('0x31')](_0x280c89['model'],qs['fields'](_0x701b12[_0x6498('0x2e')][_0x6498('0x33')]));_0x3aef0d['attributes']=_0x3aef0d[_0x6498('0x32')][_0x6498('0x34')]?_0x3aef0d['attributes']:_0x280c89[_0x6498('0x2d')];_0x3aef0d[_0x6498('0x4b')]=qs[_0x6498('0x36')](_0x701b12[_0x6498('0x2e')][_0x6498('0x36')]);_0x3aef0d[_0x6498('0x3a')]=qs['filters'](_[_0x6498('0x37')](_0x701b12['query'],_0x280c89[_0x6498('0x30')]));if(_0x701b12[_0x6498('0x2e')]['filter']){_0x3aef0d[_0x6498('0x3a')]=_[_0x6498('0x39')](_0x3aef0d[_0x6498('0x3a')],{'$or':_['map'](_0x3aef0d[_0x6498('0x32')],function(_0x159380){var _0x36831a={};_0x36831a[_0x159380]={'$like':'%'+_0x701b12[_0x6498('0x2e')]['filter']+'%'};return _0x36831a;})});}_0x3aef0d=_[_0x6498('0x39')]({},_0x3aef0d,_0x701b12[_0x6498('0x3c')]);return _0x1c4287['getSubjects'](_0x3aef0d);}})['then'](function(_0x264519){if(_0x264519){_0x118cb3=_0x264519[_0x6498('0x34')];if(!_0x701b12[_0x6498('0x2e')]['hasOwnProperty'](_0x6498('0x48'))){_0x3aef0d[_0x6498('0x1c')]=qs[_0x6498('0x1c')](_0x701b12[_0x6498('0x2e')][_0x6498('0x1c')]);_0x3aef0d[_0x6498('0x1a')]=qs[_0x6498('0x1a')](_0x701b12['query']['offset']);}return _0x1c4287[_0x6498('0x49')](_0x3aef0d);}})[_0x6498('0x22')](function(_0x25a905){if(_0x25a905){return _0x25a905?{'count':_0x118cb3,'rows':_0x25a905}:null;}})[_0x6498('0x22')](respondWithResult(_0x42491a,null))[_0x6498('0x3f')](handleError(_0x42491a,null));};exports[_0x6498('0x4c')]=function(_0x4c601c,_0xff8432,_0x20b637){var _0x1529d2={};var _0x273997={};var _0x4ba3e5;var _0x5b5aa1;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x4c601c[_0x6498('0x41')]['id']}})[_0x6498('0x22')](handleEntityNotFound(_0xff8432,null))[_0x6498('0x22')](function(_0x413822){if(_0x413822){_0x4ba3e5=_0x413822;_0x273997[_0x6498('0x2d')]=_[_0x6498('0x2f')](db[_0x6498('0x4a')]['rawAttributes']);_0x273997[_0x6498('0x2e')]=_['keys'](_0x4c601c[_0x6498('0x2e')]);_0x273997[_0x6498('0x30')]=_['intersection'](_0x273997[_0x6498('0x2d')],_0x273997[_0x6498('0x2e')]);_0x1529d2[_0x6498('0x32')]=_[_0x6498('0x31')](_0x273997[_0x6498('0x2d')],qs[_0x6498('0x33')](_0x4c601c['query']['fields']));_0x1529d2[_0x6498('0x32')]=_0x1529d2['attributes'][_0x6498('0x34')]?_0x1529d2[_0x6498('0x32')]:_0x273997[_0x6498('0x2d')];_0x1529d2['order']=qs[_0x6498('0x36')](_0x4c601c[_0x6498('0x2e')]['sort']);_0x1529d2[_0x6498('0x3a')]=qs[_0x6498('0x30')](_[_0x6498('0x37')](_0x4c601c[_0x6498('0x2e')],_0x273997[_0x6498('0x30')]));if(_0x4c601c[_0x6498('0x2e')][_0x6498('0x38')]){_0x1529d2[_0x6498('0x3a')]=_[_0x6498('0x39')](_0x1529d2[_0x6498('0x3a')],{'$or':_[_0x6498('0x29')](_0x1529d2['attributes'],function(_0x15b1e0){var _0x2ef266={};_0x2ef266[_0x15b1e0]={'$like':'%'+_0x4c601c[_0x6498('0x2e')]['filter']+'%'};return _0x2ef266;})});}_0x1529d2=_[_0x6498('0x39')]({},_0x1529d2,_0x4c601c[_0x6498('0x3c')]);return _0x4ba3e5['getDescriptions'](_0x1529d2);}})['then'](function(_0x3df4ce){if(_0x3df4ce){_0x5b5aa1=_0x3df4ce[_0x6498('0x34')];if(!_0x4c601c[_0x6498('0x2e')][_0x6498('0x35')](_0x6498('0x48'))){_0x1529d2['limit']=qs[_0x6498('0x1c')](_0x4c601c[_0x6498('0x2e')][_0x6498('0x1c')]);_0x1529d2[_0x6498('0x1a')]=qs['offset'](_0x4c601c[_0x6498('0x2e')][_0x6498('0x1a')]);}return _0x4ba3e5[_0x6498('0x4c')](_0x1529d2);}})[_0x6498('0x22')](function(_0x236291){if(_0x236291){return _0x236291?{'count':_0x5b5aa1,'rows':_0x236291}:null;}})[_0x6498('0x22')](respondWithResult(_0xff8432,null))[_0x6498('0x3f')](handleError(_0xff8432,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 09e696a..978626f 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 _0x94d2=['exports','int_servicenow_configurations','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94d2,0x1cd));var _0x294d=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x94d2[_0x53b133];return _0x5647e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x294d('0x0'))(_0x294d('0x1'));var moment=require(_0x294d('0x2'));var BPromise=require(_0x294d('0x3'));var rp=require(_0x294d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x294d('0x5'));var attributes=require(_0x294d('0x6'));module[_0x294d('0x7')]=function(_0x234700,_0x279b9b){return _0x234700['define']('ServicenowConfiguration',attributes,{'tableName':_0x294d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd139=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','ServicenowConfiguration','lodash','util','moment','bluebird','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd139,0x14e));var _0x9d13=function(_0x1f6512,_0x3e7cc1){_0x1f6512=_0x1f6512-0x0;var _0x5d218e=_0xd139[_0x1f6512];return _0x5d218e;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d13('0x2'));var BPromise=require(_0x9d13('0x3'));var rp=require(_0x9d13('0x4'));var fs=require('fs');var path=require(_0x9d13('0x5'));var rimraf=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var attributes=require(_0x9d13('0x8'));module['exports']=function(_0x4c8e60,_0x2918eb){return _0x4c8e60['define'](_0x9d13('0x9'),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 a1b9b18..de0840f 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 _0x6b1b=['info','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x28a196,_0x349ebf){var _0x4ccb77=function(_0x3b1f38){while(--_0x3b1f38){_0x28a196['push'](_0x28a196['shift']());}};_0x4ccb77(++_0x349ebf);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6b1b[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var moment=require(_0xb6b1('0x1'));var BPromise=require(_0xb6b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6b1('0x3'));var db=require(_0xb6b1('0x4'))['db'];var utils=require(_0xb6b1('0x5'));var logger=require(_0xb6b1('0x6'))(_0xb6b1('0x7'));var config=require(_0xb6b1('0x8'));var jayson=require(_0xb6b1('0x9'));var client=jayson[_0xb6b1('0xa')][_0xb6b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13334e,_0x1a4cd0,_0x5b440a){return new BPromise(function(_0x2734cc,_0x52aa76){return client['request'](_0x13334e,_0x5b440a)[_0xb6b1('0xc')](function(_0x58027c){logger[_0xb6b1('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a4cd0,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1a4cd0,_0xb6b1('0xe'),JSON[_0xb6b1('0xf')](_0x58027c));if(_0x58027c['error']){if(_0x58027c[_0xb6b1('0x10')]['code']===0x1f4){logger['error'](_0xb6b1('0x11'),_0x1a4cd0,_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);return _0x52aa76(_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);}logger[_0xb6b1('0x10')](_0xb6b1('0x11'),_0x1a4cd0,_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);return _0x2734cc(_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);}else{logger[_0xb6b1('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a4cd0,'request\x20sent');_0x2734cc(_0x58027c['result']['message']);}})[_0xb6b1('0x13')](function(_0x12c595){logger[_0xb6b1('0x10')](_0xb6b1('0x11'),_0x1a4cd0,_0x12c595);_0x52aa76(_0x12c595);});});} \ No newline at end of file +var _0x651e=['message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x573fdf,_0x16cc8f){var _0x269299=function(_0x1c34cc){while(--_0x1c34cc){_0x573fdf['push'](_0x573fdf['shift']());}};_0x269299(++_0x16cc8f);}(_0x651e,0x15d));var _0xe651=function(_0x42b301,_0x23842f){_0x42b301=_0x42b301-0x0;var _0x2430f1=_0x651e[_0x42b301];return _0x2430f1;};'use strict';var _=require(_0xe651('0x0'));var util=require(_0xe651('0x1'));var moment=require(_0xe651('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe651('0x3'));var db=require(_0xe651('0x4'))['db'];var utils=require(_0xe651('0x5'));var logger=require('../../config/logger')(_0xe651('0x6'));var config=require(_0xe651('0x7'));var jayson=require(_0xe651('0x8'));var client=jayson[_0xe651('0x9')][_0xe651('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x403e04,_0x4ea37f,_0x1d154f){return new BPromise(function(_0x25a21b,_0x551729){return client[_0xe651('0xb')](_0x403e04,_0x1d154f)[_0xe651('0xc')](function(_0x3a3774){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4ea37f,_0xe651('0xd'));logger['debug'](_0xe651('0xe'),_0x4ea37f,_0xe651('0xd'),JSON[_0xe651('0xf')](_0x3a3774));if(_0x3a3774[_0xe651('0x10')]){if(_0x3a3774['error'][_0xe651('0x11')]===0x1f4){logger['error'](_0xe651('0x12'),_0x4ea37f,_0x3a3774[_0xe651('0x10')][_0xe651('0x13')]);return _0x551729(_0x3a3774['error']['message']);}logger['error'](_0xe651('0x12'),_0x4ea37f,_0x3a3774[_0xe651('0x10')][_0xe651('0x13')]);return _0x25a21b(_0x3a3774[_0xe651('0x10')][_0xe651('0x13')]);}else{logger[_0xe651('0x14')](_0xe651('0x12'),_0x4ea37f,'request\x20sent');_0x25a21b(_0x3a3774[_0xe651('0x15')]['message']);}})[_0xe651('0x16')](function(_0x35ccd0){logger[_0xe651('0x10')](_0xe651('0x12'),_0x4ea37f,_0x35ccd0);_0x551729(_0x35ccd0);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 700c6a2..7ec4ba0 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 _0x7ec2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x47c1fa,_0x39d4fd){var _0x5955fe=function(_0x35ea89){while(--_0x35ea89){_0x47c1fa['push'](_0x47c1fa['shift']());}};_0x5955fe(++_0x39d4fd);}(_0x7ec2,0x15f));var _0x27ec=function(_0x4282aa,_0x33f9a7){_0x4282aa=_0x4282aa-0x0;var _0x5b19df=_0x7ec2[_0x4282aa];return _0x5b19df;};'use strict';var multer=require(_0x27ec('0x0'));var util=require(_0x27ec('0x1'));var path=require(_0x27ec('0x2'));var timeout=require(_0x27ec('0x3'));var express=require(_0x27ec('0x4'));var router=express[_0x27ec('0x5')]();var fs_extra=require(_0x27ec('0x6'));var auth=require(_0x27ec('0x7'));var interaction=require(_0x27ec('0x8'));var config=require(_0x27ec('0x9'));var controller=require(_0x27ec('0xa'));router[_0x27ec('0xb')]('/',auth[_0x27ec('0xc')](),controller[_0x27ec('0xd')]);router[_0x27ec('0xb')](_0x27ec('0xe'),auth[_0x27ec('0xc')](),controller[_0x27ec('0xf')]);router[_0x27ec('0x10')]('/',auth[_0x27ec('0xc')](),controller[_0x27ec('0x11')]);router[_0x27ec('0x12')](_0x27ec('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x27ec('0xe'),auth['isAuthenticated'](),controller[_0x27ec('0x13')]);module[_0x27ec('0x14')]=router; \ No newline at end of file +var _0x37e9=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post'];(function(_0xc2a56e,_0x3650fb){var _0x20c022=function(_0x2e23bf){while(--_0x2e23bf){_0xc2a56e['push'](_0xc2a56e['shift']());}};_0x20c022(++_0x3650fb);}(_0x37e9,0xba));var _0x937e=function(_0x504c5f,_0x21ae3d){_0x504c5f=_0x504c5f-0x0;var _0x3db2ec=_0x37e9[_0x504c5f];return _0x3db2ec;};'use strict';var multer=require('multer');var util=require(_0x937e('0x0'));var path=require(_0x937e('0x1'));var timeout=require(_0x937e('0x2'));var express=require(_0x937e('0x3'));var router=express[_0x937e('0x4')]();var fs_extra=require(_0x937e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x937e('0x6'));var config=require(_0x937e('0x7'));var controller=require('./intServicenowField.controller');router[_0x937e('0x8')]('/',auth['isAuthenticated'](),controller[_0x937e('0x9')]);router['get'](_0x937e('0xa'),auth[_0x937e('0xb')](),controller[_0x937e('0xc')]);router[_0x937e('0xd')]('/',auth[_0x937e('0xb')](),controller[_0x937e('0xe')]);router[_0x937e('0xf')](_0x937e('0xa'),auth[_0x937e('0xb')](),controller[_0x937e('0x10')]);router[_0x937e('0x11')](_0x937e('0xa'),auth[_0x937e('0xb')](),controller[_0x937e('0x12')]);module[_0x937e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 4be1c35..f2b451a 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 _0x5821=['ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0x5821,0x107));var _0x1582=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5821[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x1582('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1582('0x1'),_0x1582('0x2'),_0x1582('0x3'),_0x1582('0x4'),_0x1582('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1582('0x6')]},'key':{'type':Sequelize[_0x1582('0x6')]},'keyType':{'type':Sequelize[_0x1582('0x7')](_0x1582('0x1'),_0x1582('0x2'),_0x1582('0x3'))},'keyContent':{'type':Sequelize[_0x1582('0x6')]},'idField':{'type':Sequelize[_0x1582('0x6')]},'nameField':{'type':Sequelize[_0x1582('0x6')]},'customField':{'type':Sequelize[_0x1582('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1582('0x6')]}}; \ No newline at end of file +var _0x3db0=['string','variable','customVariable','keyValue','picklist','STRING','exports','ENUM'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x3db0,0x9e));var _0x03db=function(_0x1ad53c,_0x13ebf8){_0x1ad53c=_0x1ad53c-0x0;var _0x33afe4=_0x3db0[_0x1ad53c];return _0x33afe4;};'use strict';var Sequelize=require('sequelize');module[_0x03db('0x0')]={'type':{'type':Sequelize[_0x03db('0x1')](_0x03db('0x2'),_0x03db('0x3'),_0x03db('0x4'),_0x03db('0x5'),_0x03db('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x03db('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x03db('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x03db('0x7')]},'idField':{'type':Sequelize[_0x03db('0x7')]},'nameField':{'type':Sequelize[_0x03db('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x03db('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index acc00a0..6f6156f 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 _0xa4ae=['status','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','ServicenowField','length','include','create','update','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x1251f9,_0x11ae52){var _0x2530a6=function(_0x8c6703){while(--_0x8c6703){_0x1251f9['push'](_0x1251f9['shift']());}};_0x2530a6(++_0x11ae52);}(_0xa4ae,0x109));var _0xea4a=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0xa4ae[_0x43a5c7];return _0x3b12a2;};'use strict';var emlformat=require(_0xea4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea4a('0x1'));var jsonpatch=require(_0xea4a('0x2'));var rp=require(_0xea4a('0x3'));var moment=require(_0xea4a('0x4'));var BPromise=require(_0xea4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xea4a('0x6'));var csv=require('to-csv');var ejs=require(_0xea4a('0x7'));var fs=require('fs');var fs_extra=require(_0xea4a('0x8'));var _=require(_0xea4a('0x9'));var squel=require(_0xea4a('0xa'));var crypto=require(_0xea4a('0xb'));var jsforce=require(_0xea4a('0xc'));var deskjs=require(_0xea4a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xea4a('0xe'));var Papa=require(_0xea4a('0xf'));var Redis=require(_0xea4a('0x10'));var authService=require(_0xea4a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xea4a('0x12'));var hardwareService=require(_0xea4a('0x13'));var logger=require('../../config/logger')(_0xea4a('0x14'));var utils=require(_0xea4a('0x15'));var config=require(_0xea4a('0x16'));var licenseUtil=require(_0xea4a('0x17'));var db=require(_0xea4a('0x18'))['db'];function respondWithStatusCode(_0x3ce72b,_0x5b3584){_0x5b3584=_0x5b3584||0xcc;return function(_0x55d833){if(_0x55d833){return _0x3ce72b[_0xea4a('0x19')](_0x5b3584);}return _0x3ce72b['status'](_0x5b3584)[_0xea4a('0x1a')]();};}function respondWithResult(_0x6d88e,_0x5c4dd3){_0x5c4dd3=_0x5c4dd3||0xc8;return function(_0x355f8c){if(_0x355f8c){return _0x6d88e[_0xea4a('0x1b')](_0x5c4dd3)['json'](_0x355f8c);}};}function respondWithFilteredResult(_0x2ed580,_0x370595){return function(_0x409a84){if(_0x409a84){var _0x27762a=typeof _0x370595[_0xea4a('0x1c')]===_0xea4a('0x1d')&&typeof _0x370595[_0xea4a('0x1e')]===_0xea4a('0x1d');var _0x5ca7c7=_0x409a84[_0xea4a('0x1f')];var _0x9b436d=_0x27762a?0x0:_0x370595['offset'];var _0x38ba08=_0x27762a?_0x409a84[_0xea4a('0x1f')]:_0x370595[_0xea4a('0x1c')]+_0x370595[_0xea4a('0x1e')];var _0x2ab8c3;if(_0x38ba08>=_0x5ca7c7){_0x38ba08=_0x5ca7c7;_0x2ab8c3=0xc8;}else{_0x2ab8c3=0xce;}_0x2ed580[_0xea4a('0x1b')](_0x2ab8c3);return _0x2ed580[_0xea4a('0x20')](_0xea4a('0x21'),_0x9b436d+'-'+_0x38ba08+'/'+_0x5ca7c7)['json'](_0x409a84);}return null;};}function patchUpdates(_0x4a29d1){return function(_0x48f475){try{jsonpatch[_0xea4a('0x22')](_0x48f475,_0x4a29d1,!![]);}catch(_0x174457){return BPromise[_0xea4a('0x23')](_0x174457);}return _0x48f475['save']();};}function saveUpdates(_0x49e8da,_0x4b8b01){return function(_0xe40abb){if(_0xe40abb){return _0xe40abb['update'](_0x49e8da)[_0xea4a('0x24')](function(_0x123f9e){return _0x123f9e;});}return null;};}function removeEntity(_0x3694b1,_0x2fb1c8){return function(_0x1ebe86){if(_0x1ebe86){return _0x1ebe86[_0xea4a('0x25')]()[_0xea4a('0x24')](function(){_0x3694b1[_0xea4a('0x1b')](0xcc)[_0xea4a('0x1a')]();});}};}function handleEntityNotFound(_0x2b8f1a,_0x36b9f5){return function(_0x4bb1b7){if(!_0x4bb1b7){_0x2b8f1a['sendStatus'](0x194);}return _0x4bb1b7;};}function handleError(_0x55db39,_0x5148a1){_0x5148a1=_0x5148a1||0x1f4;return function(_0x418785){logger[_0xea4a('0x26')](_0x418785[_0xea4a('0x27')]);if(_0x418785[_0xea4a('0x28')]){delete _0x418785[_0xea4a('0x28')];}_0x55db39[_0xea4a('0x1b')](_0x5148a1)['send'](_0x418785);};}exports[_0xea4a('0x29')]=function(_0x5af048,_0x2251f2){var _0x43be02={},_0x1ed3a8={},_0x1dafa9={'count':0x0,'rows':[]};var _0x23f258=_[_0xea4a('0x2a')](db['ServicenowField'][_0xea4a('0x2b')],function(_0x2fc9f4){return{'name':_0x2fc9f4['fieldName'],'type':_0x2fc9f4[_0xea4a('0x2c')][_0xea4a('0x2d')]};});_0x1ed3a8[_0xea4a('0x2e')]=_[_0xea4a('0x2a')](_0x23f258,_0xea4a('0x28'));_0x1ed3a8[_0xea4a('0x2f')]=_[_0xea4a('0x30')](_0x5af048[_0xea4a('0x2f')]);_0x1ed3a8[_0xea4a('0x31')]=_[_0xea4a('0x32')](_0x1ed3a8[_0xea4a('0x2e')],_0x1ed3a8[_0xea4a('0x2f')]);_0x43be02[_0xea4a('0x33')]=_[_0xea4a('0x32')](_0x1ed3a8[_0xea4a('0x2e')],qs[_0xea4a('0x34')](_0x5af048[_0xea4a('0x2f')][_0xea4a('0x34')]));_0x43be02['attributes']=_0x43be02[_0xea4a('0x33')]['length']?_0x43be02[_0xea4a('0x33')]:_0x1ed3a8['model'];if(!_0x5af048['query']['hasOwnProperty'](_0xea4a('0x35'))){_0x43be02[_0xea4a('0x1e')]=qs[_0xea4a('0x1e')](_0x5af048[_0xea4a('0x2f')]['limit']);_0x43be02[_0xea4a('0x1c')]=qs[_0xea4a('0x1c')](_0x5af048['query'][_0xea4a('0x1c')]);}_0x43be02['order']=qs[_0xea4a('0x36')](_0x5af048[_0xea4a('0x2f')][_0xea4a('0x36')]);_0x43be02['where']=qs[_0xea4a('0x31')](_[_0xea4a('0x37')](_0x5af048['query'],_0x1ed3a8[_0xea4a('0x31')]),_0x23f258);if(_0x5af048[_0xea4a('0x2f')][_0xea4a('0x38')]){_0x43be02['where']=_['merge'](_0x43be02[_0xea4a('0x39')],{'$or':_[_0xea4a('0x2a')](_0x23f258,function(_0x1e7369){if(_0x1e7369['type']!==_0xea4a('0x3a')){var _0x330feb={};_0x330feb[_0x1e7369[_0xea4a('0x28')]]={'$like':'%'+_0x5af048[_0xea4a('0x2f')]['filter']+'%'};return _0x330feb;}})});}_0x43be02=_[_0xea4a('0x3b')]({},_0x43be02,_0x5af048[_0xea4a('0x3c')]);var _0x106de3={'where':_0x43be02[_0xea4a('0x39')]};return db['ServicenowField'][_0xea4a('0x1f')](_0x106de3)['then'](function(_0x327445){_0x1dafa9['count']=_0x327445;if(_0x5af048[_0xea4a('0x2f')][_0xea4a('0x3d')]){_0x43be02['include']=[{'all':!![]}];}return db['ServicenowField'][_0xea4a('0x3e')](_0x43be02);})[_0xea4a('0x24')](function(_0x42229e){_0x1dafa9[_0xea4a('0x3f')]=_0x42229e;return _0x1dafa9;})[_0xea4a('0x24')](respondWithFilteredResult(_0x2251f2,_0x43be02))[_0xea4a('0x40')](handleError(_0x2251f2,null));};exports['show']=function(_0x54e66e,_0xa6d108){var _0x124bf4={'raw':!![],'where':{'id':_0x54e66e[_0xea4a('0x41')]['id']}},_0x11a7a4={};_0x11a7a4[_0xea4a('0x2e')]=_[_0xea4a('0x30')](db[_0xea4a('0x42')][_0xea4a('0x2b')]);_0x11a7a4[_0xea4a('0x2f')]=_[_0xea4a('0x30')](_0x54e66e[_0xea4a('0x2f')]);_0x11a7a4[_0xea4a('0x31')]=_[_0xea4a('0x32')](_0x11a7a4[_0xea4a('0x2e')],_0x11a7a4['query']);_0x124bf4[_0xea4a('0x33')]=_[_0xea4a('0x32')](_0x11a7a4['model'],qs[_0xea4a('0x34')](_0x54e66e['query'][_0xea4a('0x34')]));_0x124bf4['attributes']=_0x124bf4[_0xea4a('0x33')][_0xea4a('0x43')]?_0x124bf4[_0xea4a('0x33')]:_0x11a7a4[_0xea4a('0x2e')];if(_0x54e66e[_0xea4a('0x2f')][_0xea4a('0x3d')]){_0x124bf4[_0xea4a('0x44')]=[{'all':!![]}];}_0x124bf4=_[_0xea4a('0x3b')]({},_0x124bf4,_0x54e66e[_0xea4a('0x3c')]);return db[_0xea4a('0x42')]['find'](_0x124bf4)['then'](handleEntityNotFound(_0xa6d108,null))[_0xea4a('0x24')](respondWithResult(_0xa6d108,null))[_0xea4a('0x40')](handleError(_0xa6d108,null));};exports[_0xea4a('0x45')]=function(_0xe1b202,_0x257ae7){return db[_0xea4a('0x42')]['create'](_0xe1b202['body'],{})['then'](respondWithResult(_0x257ae7,0xc9))[_0xea4a('0x40')](handleError(_0x257ae7,null));};exports[_0xea4a('0x46')]=function(_0x5b425e,_0x5240be){if(_0x5b425e[_0xea4a('0x47')]['id']){delete _0x5b425e[_0xea4a('0x47')]['id'];}return db[_0xea4a('0x42')][_0xea4a('0x48')]({'where':{'id':_0x5b425e['params']['id']}})[_0xea4a('0x24')](handleEntityNotFound(_0x5240be,null))[_0xea4a('0x24')](saveUpdates(_0x5b425e[_0xea4a('0x47')],null))[_0xea4a('0x24')](respondWithResult(_0x5240be,null))[_0xea4a('0x40')](handleError(_0x5240be,null));};exports[_0xea4a('0x25')]=function(_0x346490,_0x1e1ad1){return db['ServicenowField'][_0xea4a('0x48')]({'where':{'id':_0x346490[_0xea4a('0x41')]['id']}})[_0xea4a('0x24')](handleEntityNotFound(_0x1e1ad1,null))[_0xea4a('0x24')](removeEntity(_0x1e1ad1,null))['catch'](handleError(_0x1e1ad1,null));}; \ No newline at end of file +var _0x1671=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','length','include','create','body','find','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x1671,0x117));var _0x1167=function(_0x363029,_0x1f14f7){_0x363029=_0x363029-0x0;var _0x3d68ca=_0x1671[_0x363029];return _0x3d68ca;};'use strict';var emlformat=require(_0x1167('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1167('0x1'));var jsonpatch=require(_0x1167('0x2'));var rp=require('request-promise');var moment=require(_0x1167('0x3'));var BPromise=require(_0x1167('0x4'));var Mustache=require(_0x1167('0x5'));var util=require(_0x1167('0x6'));var path=require(_0x1167('0x7'));var sox=require(_0x1167('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1167('0x9'));var _=require(_0x1167('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1167('0xb'));var deskjs=require(_0x1167('0xc'));var toCsv=require(_0x1167('0xd'));var querystring=require('querystring');var Papa=require(_0x1167('0xe'));var Redis=require(_0x1167('0xf'));var authService=require(_0x1167('0x10'));var qs=require(_0x1167('0x11'));var as=require(_0x1167('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1167('0x13'))(_0x1167('0x14'));var utils=require(_0x1167('0x15'));var config=require(_0x1167('0x16'));var licenseUtil=require(_0x1167('0x17'));var db=require(_0x1167('0x18'))['db'];function respondWithStatusCode(_0x5ac8c5,_0x4ea742){_0x4ea742=_0x4ea742||0xcc;return function(_0x5e1062){if(_0x5e1062){return _0x5ac8c5[_0x1167('0x19')](_0x4ea742);}return _0x5ac8c5[_0x1167('0x1a')](_0x4ea742)[_0x1167('0x1b')]();};}function respondWithResult(_0x2fb66b,_0x688377){_0x688377=_0x688377||0xc8;return function(_0x148940){if(_0x148940){return _0x2fb66b[_0x1167('0x1a')](_0x688377)[_0x1167('0x1c')](_0x148940);}};}function respondWithFilteredResult(_0x509046,_0x4b17c2){return function(_0x1e67fc){if(_0x1e67fc){var _0x7c91ce=typeof _0x4b17c2[_0x1167('0x1d')]==='undefined'&&typeof _0x4b17c2[_0x1167('0x1e')]===_0x1167('0x1f');var _0x326f0b=_0x1e67fc[_0x1167('0x20')];var _0x367cc3=_0x7c91ce?0x0:_0x4b17c2[_0x1167('0x1d')];var _0x58946f=_0x7c91ce?_0x1e67fc['count']:_0x4b17c2[_0x1167('0x1d')]+_0x4b17c2[_0x1167('0x1e')];var _0x55bb5d;if(_0x58946f>=_0x326f0b){_0x58946f=_0x326f0b;_0x55bb5d=0xc8;}else{_0x55bb5d=0xce;}_0x509046['status'](_0x55bb5d);return _0x509046['set'](_0x1167('0x21'),_0x367cc3+'-'+_0x58946f+'/'+_0x326f0b)[_0x1167('0x1c')](_0x1e67fc);}return null;};}function patchUpdates(_0x4e7d08){return function(_0x1456f2){try{jsonpatch[_0x1167('0x22')](_0x1456f2,_0x4e7d08,!![]);}catch(_0x18b1db){return BPromise[_0x1167('0x23')](_0x18b1db);}return _0x1456f2[_0x1167('0x24')]();};}function saveUpdates(_0x15d322,_0x568f3e){return function(_0x31d64a){if(_0x31d64a){return _0x31d64a[_0x1167('0x25')](_0x15d322)[_0x1167('0x26')](function(_0x361ac2){return _0x361ac2;});}return null;};}function removeEntity(_0x49984d,_0x942981){return function(_0xaf4b45){if(_0xaf4b45){return _0xaf4b45['destroy']()[_0x1167('0x26')](function(){_0x49984d['status'](0xcc)[_0x1167('0x1b')]();});}};}function handleEntityNotFound(_0x3ad9c,_0xd59b23){return function(_0x38f8cd){if(!_0x38f8cd){_0x3ad9c[_0x1167('0x19')](0x194);}return _0x38f8cd;};}function handleError(_0x24a6c4,_0x5317f8){_0x5317f8=_0x5317f8||0x1f4;return function(_0x4b48ce){logger[_0x1167('0x27')](_0x4b48ce[_0x1167('0x28')]);if(_0x4b48ce[_0x1167('0x29')]){delete _0x4b48ce[_0x1167('0x29')];}_0x24a6c4[_0x1167('0x1a')](_0x5317f8)[_0x1167('0x2a')](_0x4b48ce);};}exports[_0x1167('0x2b')]=function(_0x2ab782,_0x179f92){var _0x359721={},_0x30b05a={},_0x27013e={'count':0x0,'rows':[]};var _0x2480e1=_[_0x1167('0x2c')](db[_0x1167('0x2d')][_0x1167('0x2e')],function(_0x246b93){return{'name':_0x246b93['fieldName'],'type':_0x246b93['type'][_0x1167('0x2f')]};});_0x30b05a[_0x1167('0x30')]=_['map'](_0x2480e1,_0x1167('0x29'));_0x30b05a[_0x1167('0x31')]=_['keys'](_0x2ab782[_0x1167('0x31')]);_0x30b05a[_0x1167('0x32')]=_[_0x1167('0x33')](_0x30b05a[_0x1167('0x30')],_0x30b05a[_0x1167('0x31')]);_0x359721[_0x1167('0x34')]=_[_0x1167('0x33')](_0x30b05a[_0x1167('0x30')],qs['fields'](_0x2ab782[_0x1167('0x31')][_0x1167('0x35')]));_0x359721[_0x1167('0x34')]=_0x359721[_0x1167('0x34')]['length']?_0x359721[_0x1167('0x34')]:_0x30b05a[_0x1167('0x30')];if(!_0x2ab782[_0x1167('0x31')][_0x1167('0x36')](_0x1167('0x37'))){_0x359721['limit']=qs[_0x1167('0x1e')](_0x2ab782[_0x1167('0x31')]['limit']);_0x359721[_0x1167('0x1d')]=qs['offset'](_0x2ab782[_0x1167('0x31')][_0x1167('0x1d')]);}_0x359721[_0x1167('0x38')]=qs['sort'](_0x2ab782[_0x1167('0x31')][_0x1167('0x39')]);_0x359721[_0x1167('0x3a')]=qs[_0x1167('0x32')](_[_0x1167('0x3b')](_0x2ab782[_0x1167('0x31')],_0x30b05a[_0x1167('0x32')]),_0x2480e1);if(_0x2ab782[_0x1167('0x31')][_0x1167('0x3c')]){_0x359721[_0x1167('0x3a')]=_[_0x1167('0x3d')](_0x359721[_0x1167('0x3a')],{'$or':_[_0x1167('0x2c')](_0x2480e1,function(_0x4d0db7){if(_0x4d0db7['type']!==_0x1167('0x3e')){var _0x22bbeb={};_0x22bbeb[_0x4d0db7[_0x1167('0x29')]]={'$like':'%'+_0x2ab782[_0x1167('0x31')][_0x1167('0x3c')]+'%'};return _0x22bbeb;}})});}_0x359721=_[_0x1167('0x3d')]({},_0x359721,_0x2ab782[_0x1167('0x3f')]);var _0x36b47a={'where':_0x359721['where']};return db['ServicenowField'][_0x1167('0x20')](_0x36b47a)[_0x1167('0x26')](function(_0x540748){_0x27013e[_0x1167('0x20')]=_0x540748;if(_0x2ab782[_0x1167('0x31')][_0x1167('0x40')]){_0x359721['include']=[{'all':!![]}];}return db[_0x1167('0x2d')][_0x1167('0x41')](_0x359721);})[_0x1167('0x26')](function(_0x19a137){_0x27013e[_0x1167('0x42')]=_0x19a137;return _0x27013e;})[_0x1167('0x26')](respondWithFilteredResult(_0x179f92,_0x359721))[_0x1167('0x43')](handleError(_0x179f92,null));};exports['show']=function(_0x89a8cd,_0x223736){var _0x57896e={'raw':!![],'where':{'id':_0x89a8cd['params']['id']}},_0x5b3169={};_0x5b3169[_0x1167('0x30')]=_[_0x1167('0x44')](db[_0x1167('0x2d')][_0x1167('0x2e')]);_0x5b3169[_0x1167('0x31')]=_[_0x1167('0x44')](_0x89a8cd['query']);_0x5b3169[_0x1167('0x32')]=_['intersection'](_0x5b3169[_0x1167('0x30')],_0x5b3169[_0x1167('0x31')]);_0x57896e['attributes']=_[_0x1167('0x33')](_0x5b3169['model'],qs[_0x1167('0x35')](_0x89a8cd['query'][_0x1167('0x35')]));_0x57896e[_0x1167('0x34')]=_0x57896e[_0x1167('0x34')][_0x1167('0x45')]?_0x57896e[_0x1167('0x34')]:_0x5b3169[_0x1167('0x30')];if(_0x89a8cd['query'][_0x1167('0x40')]){_0x57896e[_0x1167('0x46')]=[{'all':!![]}];}_0x57896e=_['merge']({},_0x57896e,_0x89a8cd['options']);return db[_0x1167('0x2d')]['find'](_0x57896e)['then'](handleEntityNotFound(_0x223736,null))[_0x1167('0x26')](respondWithResult(_0x223736,null))[_0x1167('0x43')](handleError(_0x223736,null));};exports[_0x1167('0x47')]=function(_0xe4db4a,_0x716037){return db[_0x1167('0x2d')][_0x1167('0x47')](_0xe4db4a[_0x1167('0x48')],{})[_0x1167('0x26')](respondWithResult(_0x716037,0xc9))[_0x1167('0x43')](handleError(_0x716037,null));};exports[_0x1167('0x25')]=function(_0x54ff6b,_0x39ea9d){if(_0x54ff6b[_0x1167('0x48')]['id']){delete _0x54ff6b[_0x1167('0x48')]['id'];}return db[_0x1167('0x2d')][_0x1167('0x49')]({'where':{'id':_0x54ff6b[_0x1167('0x4a')]['id']}})[_0x1167('0x26')](handleEntityNotFound(_0x39ea9d,null))[_0x1167('0x26')](saveUpdates(_0x54ff6b[_0x1167('0x48')],null))['then'](respondWithResult(_0x39ea9d,null))[_0x1167('0x43')](handleError(_0x39ea9d,null));};exports['destroy']=function(_0x3d2ae5,_0x2fab07){return db[_0x1167('0x2d')]['find']({'where':{'id':_0x3d2ae5['params']['id']}})[_0x1167('0x26')](handleEntityNotFound(_0x2fab07,null))[_0x1167('0x26')](removeEntity(_0x2fab07,null))['catch'](handleError(_0x2fab07,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5e352e8..cc760d9 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 _0xc9bb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util'];(function(_0x5917af,_0x5b14b){var _0x263b6d=function(_0x516968){while(--_0x516968){_0x5917af['push'](_0x5917af['shift']());}};_0x263b6d(++_0x5b14b);}(_0xc9bb,0x8e));var _0xbc9b=function(_0x9dd431,_0x389313){_0x9dd431=_0x9dd431-0x0;var _0x1aa903=_0xc9bb[_0x9dd431];return _0x1aa903;};'use strict';var _=require(_0xbc9b('0x0'));var util=require(_0xbc9b('0x1'));var logger=require('../../config/logger')(_0xbc9b('0x2'));var moment=require(_0xbc9b('0x3'));var BPromise=require(_0xbc9b('0x4'));var rp=require(_0xbc9b('0x5'));var fs=require('fs');var path=require(_0xbc9b('0x6'));var rimraf=require(_0xbc9b('0x7'));var config=require(_0xbc9b('0x8'));var attributes=require(_0xbc9b('0x9'));module[_0xbc9b('0xa')]=function(_0x327961,_0x518be7){return _0x327961[_0xbc9b('0xb')](_0xbc9b('0xc'),attributes,{'tableName':_0xbc9b('0xd'),'paranoid':![],'indexes':[{'name':_0xbc9b('0xe'),'fields':[_0xbc9b('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeec0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger'];(function(_0x2ea1da,_0x1d444b){var _0x37f88c=function(_0x1fd7e5){while(--_0x1fd7e5){_0x2ea1da['push'](_0x2ea1da['shift']());}};_0x37f88c(++_0x1d444b);}(_0xeec0,0x177));var _0x0eec=function(_0xb88b45,_0x388c4a){_0xb88b45=_0xb88b45-0x0;var _0x3b5e2b=_0xeec0[_0xb88b45];return _0x3b5e2b;};'use strict';var _=require(_0x0eec('0x0'));var util=require(_0x0eec('0x1'));var logger=require(_0x0eec('0x2'))('api');var moment=require(_0x0eec('0x3'));var BPromise=require(_0x0eec('0x4'));var rp=require(_0x0eec('0x5'));var fs=require('fs');var path=require(_0x0eec('0x6'));var rimraf=require(_0x0eec('0x7'));var config=require(_0x0eec('0x8'));var attributes=require(_0x0eec('0x9'));module[_0x0eec('0xa')]=function(_0x5b8a33,_0xb18101){return _0x5b8a33['define']('ServicenowField',attributes,{'tableName':_0x0eec('0xb'),'paranoid':![],'indexes':[{'name':_0x0eec('0xc'),'fields':[_0x0eec('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 732151f..6703f9c 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x159152,_0x174251){var _0x50a4aa=function(_0x1a46f7){while(--_0x1a46f7){_0x159152['push'](_0x159152['shift']());}};_0x50a4aa(++_0x174251);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2ab470,_0x51fc07){_0x2ab470=_0x2ab470-0x0;var _0x1d73db=_0x9ffd[_0x2ab470];return _0x1d73db;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x49ab19,_0x3daeb0){var _0x15c716=function(_0x1bd9da){while(--_0x1bd9da){_0x49ab19['push'](_0x49ab19['shift']());}};_0x15c716(++_0x3daeb0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x557704,_0x4775f7){_0x557704=_0x557704-0x0;var _0x6a58b2=_0xf4eb[_0x557704];return _0x6a58b2;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index bf28890..4156045 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1234b,_0x2045f6){var _0x5e1ba9=function(_0x585f91){while(--_0x585f91){_0x1234b['push'](_0x1234b['shift']());}};_0x5e1ba9(++_0x2045f6);}(_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/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4144e1,_0x43d198){var _0x1c8885=function(_0x127c6c){while(--_0x127c6c){_0x4144e1['push'](_0x4144e1['shift']());}};_0x1c8885(++_0x43d198);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 334f049..5a4b853 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(_0x3096fc,_0x15c6d6){var _0x281ab2=function(_0x5614bf){while(--_0x5614bf){_0x3096fc['push'](_0x3096fc['shift']());}};_0x281ab2(++_0x15c6d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x1ade55,_0x2fa26c){var _0x411283=function(_0x5d2756){while(--_0x5d2756){_0x1ade55['push'](_0x1ade55['shift']());}};_0x411283(++_0x2fa26c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 6e8900d..0c4ffa7 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 _0x5f7f=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','findAll','rows','catch','show','includeAll','include','find','create','body','update','params','getConfigurations','SugarcrmConfiguration','rawAttributes','pick','findOne','Subjects','channel','Descriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','Calls','values','module_fields','remove','includes','label','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto'];(function(_0x469481,_0x2377dd){var _0x54002b=function(_0x24b7f3){while(--_0x24b7f3){_0x469481['push'](_0x469481['shift']());}};_0x54002b(++_0x2377dd);}(_0x5f7f,0x1d3));var _0xf5f7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f7f[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0xf5f7('0x0'));var rimraf=require(_0xf5f7('0x1'));var zipdir=require(_0xf5f7('0x2'));var jsonpatch=require(_0xf5f7('0x3'));var rp=require(_0xf5f7('0x4'));var moment=require(_0xf5f7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf5f7('0x6'));var util=require(_0xf5f7('0x7'));var path=require(_0xf5f7('0x8'));var sox=require('sox');var csv=require(_0xf5f7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5f7('0xa'));var _=require('lodash');var squel=require(_0xf5f7('0xb'));var crypto=require(_0xf5f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf5f7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf5f7('0xe'));var Papa=require(_0xf5f7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5f7('0x10'));var as=require(_0xf5f7('0x11'));var hardwareService=require(_0xf5f7('0x12'));var logger=require(_0xf5f7('0x13'))('api');var utils=require(_0xf5f7('0x14'));var config=require(_0xf5f7('0x15'));var licenseUtil=require(_0xf5f7('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d96e2,_0x2e1c2a){_0x2e1c2a=_0x2e1c2a||0xcc;return function(_0xa94ad8){if(_0xa94ad8){return _0x2d96e2['sendStatus'](_0x2e1c2a);}return _0x2d96e2['status'](_0x2e1c2a)['end']();};}function respondWithResult(_0x414183,_0x57aca5){_0x57aca5=_0x57aca5||0xc8;return function(_0x2993a7){if(_0x2993a7){return _0x414183['status'](_0x57aca5)['json'](_0x2993a7);}};}function respondWithFilteredResult(_0x32b0ed,_0x194256){return function(_0x1f7997){if(_0x1f7997){var _0x2fb3ab=typeof _0x194256[_0xf5f7('0x17')]===_0xf5f7('0x18')&&typeof _0x194256[_0xf5f7('0x19')]==='undefined';var _0x48bb4f=_0x1f7997['count'];var _0x424b30=_0x2fb3ab?0x0:_0x194256['offset'];var _0x4e607d=_0x2fb3ab?_0x1f7997[_0xf5f7('0x1a')]:_0x194256[_0xf5f7('0x17')]+_0x194256[_0xf5f7('0x19')];var _0x4bf451;if(_0x4e607d>=_0x48bb4f){_0x4e607d=_0x48bb4f;_0x4bf451=0xc8;}else{_0x4bf451=0xce;}_0x32b0ed[_0xf5f7('0x1b')](_0x4bf451);return _0x32b0ed[_0xf5f7('0x1c')](_0xf5f7('0x1d'),_0x424b30+'-'+_0x4e607d+'/'+_0x48bb4f)[_0xf5f7('0x1e')](_0x1f7997);}return null;};}function patchUpdates(_0x239d81){return function(_0x1177f8){try{jsonpatch[_0xf5f7('0x1f')](_0x1177f8,_0x239d81,!![]);}catch(_0x4f8b91){return BPromise['reject'](_0x4f8b91);}return _0x1177f8[_0xf5f7('0x20')]();};}function saveUpdates(_0x3f7e2c,_0x277e4f){return function(_0x419389){if(_0x419389){return _0x419389['update'](_0x3f7e2c)[_0xf5f7('0x21')](function(_0x39c3f0){return _0x39c3f0;});}return null;};}function removeEntity(_0x328f22,_0x18dee2){return function(_0x38dbf8){if(_0x38dbf8){return _0x38dbf8[_0xf5f7('0x22')]()[_0xf5f7('0x21')](function(){_0x328f22[_0xf5f7('0x1b')](0xcc)[_0xf5f7('0x23')]();});}};}function handleEntityNotFound(_0x5d26ab,_0x23e5dd){return function(_0x298a6e){if(!_0x298a6e){_0x5d26ab[_0xf5f7('0x24')](0x194);}return _0x298a6e;};}function handleError(_0x16bfc3,_0x585cee){_0x585cee=_0x585cee||0x1f4;return function(_0x9817ea){logger[_0xf5f7('0x25')](_0x9817ea[_0xf5f7('0x26')]);if(_0x9817ea['name']){delete _0x9817ea[_0xf5f7('0x27')];}_0x16bfc3[_0xf5f7('0x1b')](_0x585cee)[_0xf5f7('0x28')](_0x9817ea);};}exports[_0xf5f7('0x29')]=function(_0x24a63d,_0x552898){var _0x46aef6={},_0x2640d2={},_0x1cf13c={'count':0x0,'rows':[]};var _0xce673b=_[_0xf5f7('0x2a')](db[_0xf5f7('0x2b')]['rawAttributes'],function(_0x3a1ae2){return{'name':_0x3a1ae2['fieldName'],'type':_0x3a1ae2['type']['key']};});_0x2640d2[_0xf5f7('0x2c')]=_['map'](_0xce673b,'name');_0x2640d2['query']=_[_0xf5f7('0x2d')](_0x24a63d[_0xf5f7('0x2e')]);_0x2640d2['filters']=_[_0xf5f7('0x2f')](_0x2640d2[_0xf5f7('0x2c')],_0x2640d2[_0xf5f7('0x2e')]);_0x46aef6[_0xf5f7('0x30')]=_[_0xf5f7('0x2f')](_0x2640d2[_0xf5f7('0x2c')],qs[_0xf5f7('0x31')](_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x31')]));_0x46aef6[_0xf5f7('0x30')]=_0x46aef6[_0xf5f7('0x30')][_0xf5f7('0x32')]?_0x46aef6['attributes']:_0x2640d2[_0xf5f7('0x2c')];if(!_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x33')](_0xf5f7('0x34'))){_0x46aef6['limit']=qs[_0xf5f7('0x19')](_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x19')]);_0x46aef6[_0xf5f7('0x17')]=qs[_0xf5f7('0x17')](_0x24a63d[_0xf5f7('0x2e')]['offset']);}_0x46aef6[_0xf5f7('0x35')]=qs[_0xf5f7('0x36')](_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x36')]);_0x46aef6[_0xf5f7('0x37')]=qs['filters'](_['pick'](_0x24a63d[_0xf5f7('0x2e')],_0x2640d2[_0xf5f7('0x38')]),_0xce673b);if(_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x39')]){_0x46aef6[_0xf5f7('0x37')]=_['merge'](_0x46aef6[_0xf5f7('0x37')],{'$or':_[_0xf5f7('0x2a')](_0xce673b,function(_0x20252f){if(_0x20252f[_0xf5f7('0x3a')]!==_0xf5f7('0x3b')){var _0xd1ff1b={};_0xd1ff1b[_0x20252f[_0xf5f7('0x27')]]={'$like':'%'+_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x39')]+'%'};return _0xd1ff1b;}})});}_0x46aef6=_[_0xf5f7('0x3c')]({},_0x46aef6,_0x24a63d[_0xf5f7('0x3d')]);var _0x5ba9ef={'where':_0x46aef6[_0xf5f7('0x37')]};return db[_0xf5f7('0x2b')][_0xf5f7('0x1a')](_0x5ba9ef)['then'](function(_0x4b20d2){_0x1cf13c[_0xf5f7('0x1a')]=_0x4b20d2;if(_0x24a63d[_0xf5f7('0x2e')]['includeAll']){_0x46aef6['include']=[{'all':!![]}];}return db[_0xf5f7('0x2b')][_0xf5f7('0x3e')](_0x46aef6);})['then'](function(_0x3839f2){_0x1cf13c[_0xf5f7('0x3f')]=_0x3839f2;return _0x1cf13c;})[_0xf5f7('0x21')](respondWithFilteredResult(_0x552898,_0x46aef6))[_0xf5f7('0x40')](handleError(_0x552898,null));};exports[_0xf5f7('0x41')]=function(_0x144196,_0x4fa760){var _0x12c47c={'raw':![],'where':{'id':_0x144196['params']['id']}},_0x1bcf69={};_0x1bcf69[_0xf5f7('0x2c')]=_[_0xf5f7('0x2d')](db[_0xf5f7('0x2b')]['rawAttributes']);_0x1bcf69[_0xf5f7('0x2e')]=_['keys'](_0x144196[_0xf5f7('0x2e')]);_0x1bcf69[_0xf5f7('0x38')]=_[_0xf5f7('0x2f')](_0x1bcf69[_0xf5f7('0x2c')],_0x1bcf69['query']);_0x12c47c['attributes']=_[_0xf5f7('0x2f')](_0x1bcf69[_0xf5f7('0x2c')],qs[_0xf5f7('0x31')](_0x144196[_0xf5f7('0x2e')]['fields']));_0x12c47c[_0xf5f7('0x30')]=_0x12c47c[_0xf5f7('0x30')][_0xf5f7('0x32')]?_0x12c47c['attributes']:_0x1bcf69[_0xf5f7('0x2c')];if(_0x144196[_0xf5f7('0x2e')][_0xf5f7('0x42')]){_0x12c47c[_0xf5f7('0x43')]=[{'all':!![]}];}_0x12c47c=_[_0xf5f7('0x3c')]({},_0x12c47c,_0x144196[_0xf5f7('0x3d')]);return db[_0xf5f7('0x2b')][_0xf5f7('0x44')](_0x12c47c)[_0xf5f7('0x21')](handleEntityNotFound(_0x4fa760,null))['then'](respondWithResult(_0x4fa760,null))[_0xf5f7('0x40')](handleError(_0x4fa760,null));};exports[_0xf5f7('0x45')]=function(_0x11d4f9,_0x828ff7){return db[_0xf5f7('0x2b')][_0xf5f7('0x45')](_0x11d4f9[_0xf5f7('0x46')],{})['then'](respondWithResult(_0x828ff7,0xc9))[_0xf5f7('0x40')](handleError(_0x828ff7,null));};exports[_0xf5f7('0x47')]=function(_0x481764,_0x1ba2e9){if(_0x481764['body']['id']){delete _0x481764[_0xf5f7('0x46')]['id'];}return db[_0xf5f7('0x2b')][_0xf5f7('0x44')]({'where':{'id':_0x481764['params']['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x1ba2e9,null))['then'](saveUpdates(_0x481764[_0xf5f7('0x46')],null))[_0xf5f7('0x21')](respondWithResult(_0x1ba2e9,null))[_0xf5f7('0x40')](handleError(_0x1ba2e9,null));};exports[_0xf5f7('0x22')]=function(_0x149057,_0x47ed0c){return db[_0xf5f7('0x2b')][_0xf5f7('0x44')]({'where':{'id':_0x149057[_0xf5f7('0x48')]['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x47ed0c,null))['then'](removeEntity(_0x47ed0c,null))['catch'](handleError(_0x47ed0c,null));};exports[_0xf5f7('0x49')]=function(_0x1a4865,_0x433822,_0xbbd9d1){var _0x26951f={};var _0x37b70b={};var _0x3f546a;var _0x12a0ed;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1a4865[_0xf5f7('0x48')]['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x433822,null))[_0xf5f7('0x21')](function(_0xff0d82){if(_0xff0d82){_0x3f546a=_0xff0d82;_0x37b70b[_0xf5f7('0x2c')]=_['keys'](db[_0xf5f7('0x4a')][_0xf5f7('0x4b')]);_0x37b70b[_0xf5f7('0x2e')]=_[_0xf5f7('0x2d')](_0x1a4865['query']);_0x37b70b[_0xf5f7('0x38')]=_[_0xf5f7('0x2f')](_0x37b70b[_0xf5f7('0x2c')],_0x37b70b['query']);_0x26951f['attributes']=_['intersection'](_0x37b70b[_0xf5f7('0x2c')],qs[_0xf5f7('0x31')](_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x31')]));_0x26951f['attributes']=_0x26951f[_0xf5f7('0x30')][_0xf5f7('0x32')]?_0x26951f[_0xf5f7('0x30')]:_0x37b70b[_0xf5f7('0x2c')];_0x26951f[_0xf5f7('0x35')]=qs['sort'](_0x1a4865['query']['sort']);_0x26951f[_0xf5f7('0x37')]=qs['filters'](_[_0xf5f7('0x4c')](_0x1a4865[_0xf5f7('0x2e')],_0x37b70b[_0xf5f7('0x38')]));if(_0x1a4865[_0xf5f7('0x2e')]['filter']){_0x26951f[_0xf5f7('0x37')]=_[_0xf5f7('0x3c')](_0x26951f['where'],{'$or':_[_0xf5f7('0x2a')](_0x26951f[_0xf5f7('0x30')],function(_0x22061b){var _0x12595f={};_0x12595f[_0x22061b]={'$like':'%'+_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x39')]+'%'};return _0x12595f;})});}_0x26951f=_[_0xf5f7('0x3c')]({},_0x26951f,_0x1a4865[_0xf5f7('0x3d')]);return _0x3f546a[_0xf5f7('0x49')](_0x26951f);}})[_0xf5f7('0x21')](function(_0x1602e0){if(_0x1602e0){_0x12a0ed=_0x1602e0[_0xf5f7('0x32')];if(!_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x33')](_0xf5f7('0x34'))){_0x26951f[_0xf5f7('0x19')]=qs[_0xf5f7('0x19')](_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x19')]);_0x26951f[_0xf5f7('0x17')]=qs[_0xf5f7('0x17')](_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x17')]);}return _0x3f546a[_0xf5f7('0x49')](_0x26951f);}})[_0xf5f7('0x21')](function(_0x4e5bb5){if(_0x4e5bb5){return _0x4e5bb5?{'count':_0x12a0ed,'rows':_0x4e5bb5}:null;}})[_0xf5f7('0x21')](respondWithResult(_0x433822,null))[_0xf5f7('0x40')](handleError(_0x433822,null));};exports['addConfiguration']=function(_0x4592e3,_0x10f2e1,_0x19d344){if(_0x4592e3[_0xf5f7('0x46')]['id']){delete _0x4592e3[_0xf5f7('0x46')]['id'];}return db[_0xf5f7('0x2b')][_0xf5f7('0x4d')]({'where':{'id':_0x4592e3['params']['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x10f2e1,null))[_0xf5f7('0x21')](function(_0x376f98){if(_0x376f98){_0x4592e3[_0xf5f7('0x46')]['AccountId']=_0x376f98['id'];_0x4592e3[_0xf5f7('0x46')][_0xf5f7('0x4e')]=integrations['getSubjects'](_0x4592e3['body'][_0xf5f7('0x4f')],_0x4592e3['body'][_0xf5f7('0x3a')]);_0x4592e3['body'][_0xf5f7('0x50')]=integrations['getDescriptions'](_0x4592e3[_0xf5f7('0x46')]['channel'],_0x4592e3[_0xf5f7('0x46')][_0xf5f7('0x3a')]);return db[_0xf5f7('0x4a')][_0xf5f7('0x45')](_0x4592e3[_0xf5f7('0x46')],{'include':[{'model':db[_0xf5f7('0x51')],'as':'Subjects'},{'model':db[_0xf5f7('0x51')],'as':_0xf5f7('0x50')}]});}return null;})[_0xf5f7('0x21')](respondWithResult(_0x10f2e1,null))['catch'](handleError(_0x10f2e1,null));};exports[_0xf5f7('0x52')]=function(_0x2be7d4,_0x3e9930,_0x42bfc8){var _0x18b2c4='';var _0xd3ad5f=['id',_0xf5f7('0x27'),'assigned_user_id',_0xf5f7('0x53'),_0xf5f7('0x54'),_0xf5f7('0x55'),_0xf5f7('0x56'),_0xf5f7('0x57'),_0xf5f7('0x58'),_0xf5f7('0x59'),_0xf5f7('0x5a'),_0xf5f7('0x5b')];return db[_0xf5f7('0x2b')][_0xf5f7('0x4d')]({'where':{'id':_0x2be7d4[_0xf5f7('0x48')]['id']},'attributes':['id',_0xf5f7('0x5c'),_0xf5f7('0x5d'),_0xf5f7('0x5e')]})[_0xf5f7('0x21')](handleEntityNotFound(_0x3e9930,null))['then'](function(_0x1004d8){if(_0x1004d8){_0x18b2c4=_0x1004d8[_0xf5f7('0x5e')];var _0x502d90=_0x18b2c4[_0xf5f7('0x5f')](-0x1);if(_0x502d90==='/'){_0x18b2c4=_0x18b2c4[_0xf5f7('0x60')](0x0,_0x18b2c4[_0xf5f7('0x61')](_0x502d90));}return rp({'method':_0xf5f7('0x62'),'uri':util[_0xf5f7('0x63')](_0xf5f7('0x64'),_0x18b2c4,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xf5f7('0x65'),'input_type':_0xf5f7('0x66'),'response_type':_0xf5f7('0x66'),'rest_data':JSON[_0xf5f7('0x67')]({'user_auth':{'user_name':_0x1004d8[_0xf5f7('0x5c')],'password':_0x1004d8[_0xf5f7('0x5d')],'encryption':_0xf5f7('0x68')},'application':_0xf5f7('0x69')})}});}})[_0xf5f7('0x21')](function(_0x23c268){if(_0x23c268&&_0x23c268[_0xf5f7('0x27')]!==_0xf5f7('0x6a')&&_0x23c268[_0xf5f7('0x27')]!==_0xf5f7('0x6b')){return rp({'method':_0xf5f7('0x62'),'uri':util[_0xf5f7('0x63')]('%s%s',_0x18b2c4,_0xf5f7('0x6c')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xf5f7('0x66'),'response_type':_0xf5f7('0x66'),'rest_data':JSON[_0xf5f7('0x67')]({'session':_0x23c268['id'],'module_name':_0xf5f7('0x6d')})}})[_0xf5f7('0x21')](function(_0x28cd40){if(_0x28cd40){var _0x455ee4=_[_0xf5f7('0x6e')](_0x28cd40[_0xf5f7('0x6f')]);_[_0xf5f7('0x70')](_0x455ee4,function(_0x5a8fe7){return _0xd3ad5f[_0xf5f7('0x71')](_0x5a8fe7[_0xf5f7('0x27')]);});return{'count':_0x455ee4[_0xf5f7('0x32')],'rows':_[_0xf5f7('0x2a')](_0x455ee4,function(_0x215ad4){return{'id':_0x215ad4[_0xf5f7('0x27')],'name':_0x215ad4[_0xf5f7('0x72')],'custom':_[_0xf5f7('0x73')](_0x215ad4[_0xf5f7('0x27')],'_c')?!![]:![],'options':_0x215ad4[_0xf5f7('0x3d')]?_['map'](_[_0xf5f7('0x6e')](_0x215ad4[_0xf5f7('0x3d')]),function(_0x21e9d9){return{'name':_0x21e9d9['value'],'value':_0x21e9d9[_0xf5f7('0x27')]};}):[]};})};}})[_0xf5f7('0x21')](respondWithResult(_0x3e9930,null))[_0xf5f7('0x40')](function(_0x19c91a){var _0x3f2a1b=_0x2be7d4[_0xf5f7('0x2e')][_0xf5f7('0x74')]?0x1f4:_0x19c91a['statusCode']||0x1f4;logger['error'](_0xf5f7('0x75'),_0xf5f7('0x52'),_0x3f2a1b,JSON[_0xf5f7('0x67')](_0x19c91a));delete _0x19c91a['name'];if(_0x3f2a1b===0x191){_0x3f2a1b=0x190;}_0x3e9930[_0xf5f7('0x1b')](_0x3f2a1b)[_0xf5f7('0x28')](_0x2be7d4['query'][_0xf5f7('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x19c91a[_0xf5f7('0x76')]}:_0x19c91a);});}else{var _0x36f172=0x1f4;_0x3e9930['status'](_0x36f172)[_0xf5f7('0x28')]({'message':_0xf5f7('0x77'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x2f9e=['merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','length','AccountId','Subjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','duration_hours','parent_type','direction','password','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','stringify','Password\x20Expired','%s%s','get_module_fields','JSON','Calls','values','remove','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0xfb290e,_0x2ad318){var _0x42e23f=function(_0x36a086){while(--_0x36a086){_0xfb290e['push'](_0xfb290e['shift']());}};_0x42e23f(++_0x2ad318);}(_0x2f9e,0x117));var _0xe2f9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2f9e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xe2f9('0x0'));var rimraf=require(_0xe2f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe2f9('0x2'));var rp=require(_0xe2f9('0x3'));var moment=require(_0xe2f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2f9('0x5'));var util=require(_0xe2f9('0x6'));var path=require(_0xe2f9('0x7'));var sox=require(_0xe2f9('0x8'));var csv=require(_0xe2f9('0x9'));var ejs=require(_0xe2f9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2f9('0xb'));var squel=require(_0xe2f9('0xc'));var crypto=require('crypto');var jsforce=require(_0xe2f9('0xd'));var deskjs=require(_0xe2f9('0xe'));var toCsv=require(_0xe2f9('0x9'));var querystring=require('querystring');var Papa=require(_0xe2f9('0xf'));var Redis=require(_0xe2f9('0x10'));var authService=require(_0xe2f9('0x11'));var qs=require(_0xe2f9('0x12'));var as=require(_0xe2f9('0x13'));var hardwareService=require(_0xe2f9('0x14'));var logger=require(_0xe2f9('0x15'))(_0xe2f9('0x16'));var utils=require('../../config/utils');var config=require(_0xe2f9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2f9('0x18'))['db'];var integrations=require(_0xe2f9('0x19'));function respondWithStatusCode(_0x7e5886,_0x50dc88){_0x50dc88=_0x50dc88||0xcc;return function(_0x226bee){if(_0x226bee){return _0x7e5886[_0xe2f9('0x1a')](_0x50dc88);}return _0x7e5886[_0xe2f9('0x1b')](_0x50dc88)[_0xe2f9('0x1c')]();};}function respondWithResult(_0x28c99e,_0x5e1402){_0x5e1402=_0x5e1402||0xc8;return function(_0x4c57ec){if(_0x4c57ec){return _0x28c99e[_0xe2f9('0x1b')](_0x5e1402)[_0xe2f9('0x1d')](_0x4c57ec);}};}function respondWithFilteredResult(_0x2b8fef,_0x34e9fb){return function(_0x2db23e){if(_0x2db23e){var _0x3628f2=typeof _0x34e9fb[_0xe2f9('0x1e')]===_0xe2f9('0x1f')&&typeof _0x34e9fb[_0xe2f9('0x20')]===_0xe2f9('0x1f');var _0x251031=_0x2db23e[_0xe2f9('0x21')];var _0x2a4a20=_0x3628f2?0x0:_0x34e9fb[_0xe2f9('0x1e')];var _0x197f0c=_0x3628f2?_0x2db23e[_0xe2f9('0x21')]:_0x34e9fb['offset']+_0x34e9fb[_0xe2f9('0x20')];var _0x4b41eb;if(_0x197f0c>=_0x251031){_0x197f0c=_0x251031;_0x4b41eb=0xc8;}else{_0x4b41eb=0xce;}_0x2b8fef['status'](_0x4b41eb);return _0x2b8fef[_0xe2f9('0x22')](_0xe2f9('0x23'),_0x2a4a20+'-'+_0x197f0c+'/'+_0x251031)[_0xe2f9('0x1d')](_0x2db23e);}return null;};}function patchUpdates(_0x49c0fc){return function(_0x4d2f81){try{jsonpatch[_0xe2f9('0x24')](_0x4d2f81,_0x49c0fc,!![]);}catch(_0x20f10b){return BPromise[_0xe2f9('0x25')](_0x20f10b);}return _0x4d2f81[_0xe2f9('0x26')]();};}function saveUpdates(_0x2e6971,_0x5313d7){return function(_0x364eb6){if(_0x364eb6){return _0x364eb6['update'](_0x2e6971)[_0xe2f9('0x27')](function(_0x4c8962){return _0x4c8962;});}return null;};}function removeEntity(_0x5b604e,_0x2afe09){return function(_0x2ebe2d){if(_0x2ebe2d){return _0x2ebe2d[_0xe2f9('0x28')]()['then'](function(){_0x5b604e[_0xe2f9('0x1b')](0xcc)[_0xe2f9('0x1c')]();});}};}function handleEntityNotFound(_0x8d2a52,_0x41d46a){return function(_0x246100){if(!_0x246100){_0x8d2a52[_0xe2f9('0x1a')](0x194);}return _0x246100;};}function handleError(_0x3ae7ad,_0x5260d3){_0x5260d3=_0x5260d3||0x1f4;return function(_0x507cc9){logger[_0xe2f9('0x29')](_0x507cc9[_0xe2f9('0x2a')]);if(_0x507cc9[_0xe2f9('0x2b')]){delete _0x507cc9[_0xe2f9('0x2b')];}_0x3ae7ad[_0xe2f9('0x1b')](_0x5260d3)[_0xe2f9('0x2c')](_0x507cc9);};}exports[_0xe2f9('0x2d')]=function(_0x539524,_0x3ac888){var _0xe83662={},_0x57e2db={},_0x5da525={'count':0x0,'rows':[]};var _0xbf600=_['map'](db[_0xe2f9('0x2e')][_0xe2f9('0x2f')],function(_0x578ab9){return{'name':_0x578ab9[_0xe2f9('0x30')],'type':_0x578ab9[_0xe2f9('0x31')][_0xe2f9('0x32')]};});_0x57e2db[_0xe2f9('0x33')]=_[_0xe2f9('0x34')](_0xbf600,_0xe2f9('0x2b'));_0x57e2db[_0xe2f9('0x35')]=_[_0xe2f9('0x36')](_0x539524[_0xe2f9('0x35')]);_0x57e2db[_0xe2f9('0x37')]=_[_0xe2f9('0x38')](_0x57e2db[_0xe2f9('0x33')],_0x57e2db['query']);_0xe83662[_0xe2f9('0x39')]=_[_0xe2f9('0x38')](_0x57e2db[_0xe2f9('0x33')],qs[_0xe2f9('0x3a')](_0x539524[_0xe2f9('0x35')][_0xe2f9('0x3a')]));_0xe83662[_0xe2f9('0x39')]=_0xe83662[_0xe2f9('0x39')]['length']?_0xe83662[_0xe2f9('0x39')]:_0x57e2db[_0xe2f9('0x33')];if(!_0x539524['query'][_0xe2f9('0x3b')](_0xe2f9('0x3c'))){_0xe83662[_0xe2f9('0x20')]=qs['limit'](_0x539524[_0xe2f9('0x35')][_0xe2f9('0x20')]);_0xe83662[_0xe2f9('0x1e')]=qs[_0xe2f9('0x1e')](_0x539524['query']['offset']);}_0xe83662[_0xe2f9('0x3d')]=qs[_0xe2f9('0x3e')](_0x539524[_0xe2f9('0x35')][_0xe2f9('0x3e')]);_0xe83662[_0xe2f9('0x3f')]=qs['filters'](_[_0xe2f9('0x40')](_0x539524[_0xe2f9('0x35')],_0x57e2db[_0xe2f9('0x37')]),_0xbf600);if(_0x539524[_0xe2f9('0x35')][_0xe2f9('0x41')]){_0xe83662[_0xe2f9('0x3f')]=_[_0xe2f9('0x42')](_0xe83662['where'],{'$or':_['map'](_0xbf600,function(_0x26b0eb){if(_0x26b0eb[_0xe2f9('0x31')]!==_0xe2f9('0x43')){var _0x38ba74={};_0x38ba74[_0x26b0eb['name']]={'$like':'%'+_0x539524['query'][_0xe2f9('0x41')]+'%'};return _0x38ba74;}})});}_0xe83662=_[_0xe2f9('0x42')]({},_0xe83662,_0x539524[_0xe2f9('0x44')]);var _0x37900a={'where':_0xe83662['where']};return db[_0xe2f9('0x2e')][_0xe2f9('0x21')](_0x37900a)[_0xe2f9('0x27')](function(_0x34ab36){_0x5da525[_0xe2f9('0x21')]=_0x34ab36;if(_0x539524[_0xe2f9('0x35')][_0xe2f9('0x45')]){_0xe83662['include']=[{'all':!![]}];}return db[_0xe2f9('0x2e')][_0xe2f9('0x46')](_0xe83662);})[_0xe2f9('0x27')](function(_0x4227f0){_0x5da525[_0xe2f9('0x47')]=_0x4227f0;return _0x5da525;})[_0xe2f9('0x27')](respondWithFilteredResult(_0x3ac888,_0xe83662))[_0xe2f9('0x48')](handleError(_0x3ac888,null));};exports[_0xe2f9('0x49')]=function(_0x326f9b,_0x1173bd){var _0x4cedc7={'raw':![],'where':{'id':_0x326f9b['params']['id']}},_0x55365a={};_0x55365a[_0xe2f9('0x33')]=_[_0xe2f9('0x36')](db[_0xe2f9('0x2e')][_0xe2f9('0x2f')]);_0x55365a['query']=_[_0xe2f9('0x36')](_0x326f9b['query']);_0x55365a[_0xe2f9('0x37')]=_[_0xe2f9('0x38')](_0x55365a['model'],_0x55365a[_0xe2f9('0x35')]);_0x4cedc7[_0xe2f9('0x39')]=_[_0xe2f9('0x38')](_0x55365a[_0xe2f9('0x33')],qs[_0xe2f9('0x3a')](_0x326f9b[_0xe2f9('0x35')][_0xe2f9('0x3a')]));_0x4cedc7['attributes']=_0x4cedc7[_0xe2f9('0x39')]['length']?_0x4cedc7['attributes']:_0x55365a[_0xe2f9('0x33')];if(_0x326f9b[_0xe2f9('0x35')]['includeAll']){_0x4cedc7[_0xe2f9('0x4a')]=[{'all':!![]}];}_0x4cedc7=_[_0xe2f9('0x42')]({},_0x4cedc7,_0x326f9b[_0xe2f9('0x44')]);return db[_0xe2f9('0x2e')][_0xe2f9('0x4b')](_0x4cedc7)[_0xe2f9('0x27')](handleEntityNotFound(_0x1173bd,null))[_0xe2f9('0x27')](respondWithResult(_0x1173bd,null))[_0xe2f9('0x48')](handleError(_0x1173bd,null));};exports[_0xe2f9('0x4c')]=function(_0x1444c4,_0x1539f9){return db[_0xe2f9('0x2e')][_0xe2f9('0x4c')](_0x1444c4[_0xe2f9('0x4d')],{})['then'](respondWithResult(_0x1539f9,0xc9))[_0xe2f9('0x48')](handleError(_0x1539f9,null));};exports['update']=function(_0xc3b553,_0x1eea33){if(_0xc3b553['body']['id']){delete _0xc3b553['body']['id'];}return db[_0xe2f9('0x2e')][_0xe2f9('0x4b')]({'where':{'id':_0xc3b553['params']['id']}})[_0xe2f9('0x27')](handleEntityNotFound(_0x1eea33,null))[_0xe2f9('0x27')](saveUpdates(_0xc3b553[_0xe2f9('0x4d')],null))['then'](respondWithResult(_0x1eea33,null))[_0xe2f9('0x48')](handleError(_0x1eea33,null));};exports[_0xe2f9('0x28')]=function(_0x287a93,_0x6431d0){return db[_0xe2f9('0x2e')][_0xe2f9('0x4b')]({'where':{'id':_0x287a93[_0xe2f9('0x4e')]['id']}})[_0xe2f9('0x27')](handleEntityNotFound(_0x6431d0,null))[_0xe2f9('0x27')](removeEntity(_0x6431d0,null))[_0xe2f9('0x48')](handleError(_0x6431d0,null));};exports[_0xe2f9('0x4f')]=function(_0x4c967b,_0x557a32,_0x2debf4){var _0x1db481={};var _0x5c2714={};var _0x2b6a43;var _0x5f2a13;return db[_0xe2f9('0x2e')][_0xe2f9('0x50')]({'where':{'id':_0x4c967b[_0xe2f9('0x4e')]['id']}})[_0xe2f9('0x27')](handleEntityNotFound(_0x557a32,null))['then'](function(_0x54c7e6){if(_0x54c7e6){_0x2b6a43=_0x54c7e6;_0x5c2714['model']=_[_0xe2f9('0x36')](db[_0xe2f9('0x51')]['rawAttributes']);_0x5c2714['query']=_[_0xe2f9('0x36')](_0x4c967b['query']);_0x5c2714['filters']=_[_0xe2f9('0x38')](_0x5c2714[_0xe2f9('0x33')],_0x5c2714[_0xe2f9('0x35')]);_0x1db481[_0xe2f9('0x39')]=_[_0xe2f9('0x38')](_0x5c2714['model'],qs[_0xe2f9('0x3a')](_0x4c967b[_0xe2f9('0x35')]['fields']));_0x1db481[_0xe2f9('0x39')]=_0x1db481[_0xe2f9('0x39')][_0xe2f9('0x52')]?_0x1db481[_0xe2f9('0x39')]:_0x5c2714[_0xe2f9('0x33')];_0x1db481[_0xe2f9('0x3d')]=qs[_0xe2f9('0x3e')](_0x4c967b[_0xe2f9('0x35')][_0xe2f9('0x3e')]);_0x1db481[_0xe2f9('0x3f')]=qs['filters'](_[_0xe2f9('0x40')](_0x4c967b['query'],_0x5c2714[_0xe2f9('0x37')]));if(_0x4c967b[_0xe2f9('0x35')][_0xe2f9('0x41')]){_0x1db481[_0xe2f9('0x3f')]=_[_0xe2f9('0x42')](_0x1db481[_0xe2f9('0x3f')],{'$or':_[_0xe2f9('0x34')](_0x1db481[_0xe2f9('0x39')],function(_0x266842){var _0x46108a={};_0x46108a[_0x266842]={'$like':'%'+_0x4c967b[_0xe2f9('0x35')][_0xe2f9('0x41')]+'%'};return _0x46108a;})});}_0x1db481=_[_0xe2f9('0x42')]({},_0x1db481,_0x4c967b[_0xe2f9('0x44')]);return _0x2b6a43[_0xe2f9('0x4f')](_0x1db481);}})[_0xe2f9('0x27')](function(_0x579ccd){if(_0x579ccd){_0x5f2a13=_0x579ccd['length'];if(!_0x4c967b['query'][_0xe2f9('0x3b')](_0xe2f9('0x3c'))){_0x1db481[_0xe2f9('0x20')]=qs['limit'](_0x4c967b[_0xe2f9('0x35')][_0xe2f9('0x20')]);_0x1db481[_0xe2f9('0x1e')]=qs[_0xe2f9('0x1e')](_0x4c967b['query'][_0xe2f9('0x1e')]);}return _0x2b6a43[_0xe2f9('0x4f')](_0x1db481);}})[_0xe2f9('0x27')](function(_0x739399){if(_0x739399){return _0x739399?{'count':_0x5f2a13,'rows':_0x739399}:null;}})[_0xe2f9('0x27')](respondWithResult(_0x557a32,null))['catch'](handleError(_0x557a32,null));};exports['addConfiguration']=function(_0x3f0099,_0x5451b0,_0x488d7a){if(_0x3f0099[_0xe2f9('0x4d')]['id']){delete _0x3f0099['body']['id'];}return db[_0xe2f9('0x2e')]['findOne']({'where':{'id':_0x3f0099[_0xe2f9('0x4e')]['id']}})[_0xe2f9('0x27')](handleEntityNotFound(_0x5451b0,null))[_0xe2f9('0x27')](function(_0x57cc58){if(_0x57cc58){_0x3f0099[_0xe2f9('0x4d')][_0xe2f9('0x53')]=_0x57cc58['id'];_0x3f0099['body'][_0xe2f9('0x54')]=integrations['getSubjects'](_0x3f0099['body'][_0xe2f9('0x55')],_0x3f0099['body'][_0xe2f9('0x31')]);_0x3f0099[_0xe2f9('0x4d')]['Descriptions']=integrations['getDescriptions'](_0x3f0099[_0xe2f9('0x4d')][_0xe2f9('0x55')],_0x3f0099[_0xe2f9('0x4d')]['type']);return db[_0xe2f9('0x51')][_0xe2f9('0x4c')](_0x3f0099[_0xe2f9('0x4d')],{'include':[{'model':db[_0xe2f9('0x56')],'as':'Subjects'},{'model':db[_0xe2f9('0x56')],'as':_0xe2f9('0x57')}]});}return null;})[_0xe2f9('0x27')](respondWithResult(_0x5451b0,null))[_0xe2f9('0x48')](handleError(_0x5451b0,null));};exports[_0xe2f9('0x58')]=function(_0x3b8b4b,_0x4469e2,_0x5f040a){var _0x1e0568='';var _0x17022a=['id',_0xe2f9('0x2b'),_0xe2f9('0x59'),'created_by','description','date_start',_0xe2f9('0x5a'),'duration_minutes','parent_id',_0xe2f9('0x5b'),'parent_name',_0xe2f9('0x5c')];return db['SugarcrmAccount'][_0xe2f9('0x50')]({'where':{'id':_0x3b8b4b[_0xe2f9('0x4e')]['id']},'attributes':['id','username',_0xe2f9('0x5d'),'remoteUri']})[_0xe2f9('0x27')](handleEntityNotFound(_0x4469e2,null))[_0xe2f9('0x27')](function(_0xa91142){if(_0xa91142){_0x1e0568=_0xa91142['remoteUri'];var _0x3be2ab=_0x1e0568[_0xe2f9('0x5e')](-0x1);if(_0x3be2ab==='/'){_0x1e0568=_0x1e0568[_0xe2f9('0x5f')](0x0,_0x1e0568[_0xe2f9('0x60')](_0x3be2ab));}return rp({'method':_0xe2f9('0x61'),'uri':util[_0xe2f9('0x62')]('%s%s',_0x1e0568,_0xe2f9('0x63')),'json':!![],'form':{'method':_0xe2f9('0x64'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe2f9('0x65')]({'user_auth':{'user_name':_0xa91142['username'],'password':_0xa91142[_0xe2f9('0x5d')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xe2f9('0x27')](function(_0x328ef6){if(_0x328ef6&&_0x328ef6[_0xe2f9('0x2b')]!=='Invalid\x20Login'&&_0x328ef6[_0xe2f9('0x2b')]!==_0xe2f9('0x66')){return rp({'method':_0xe2f9('0x61'),'uri':util[_0xe2f9('0x62')](_0xe2f9('0x67'),_0x1e0568,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe2f9('0x68'),'input_type':'JSON','response_type':_0xe2f9('0x69'),'rest_data':JSON[_0xe2f9('0x65')]({'session':_0x328ef6['id'],'module_name':_0xe2f9('0x6a')})}})[_0xe2f9('0x27')](function(_0x1c8998){if(_0x1c8998){var _0x4cafe4=_[_0xe2f9('0x6b')](_0x1c8998['module_fields']);_[_0xe2f9('0x6c')](_0x4cafe4,function(_0x5acc98){return _0x17022a['includes'](_0x5acc98['name']);});return{'count':_0x4cafe4['length'],'rows':_[_0xe2f9('0x34')](_0x4cafe4,function(_0x5540b3){return{'id':_0x5540b3[_0xe2f9('0x2b')],'name':_0x5540b3[_0xe2f9('0x6d')],'custom':_[_0xe2f9('0x6e')](_0x5540b3[_0xe2f9('0x2b')],'_c')?!![]:![],'options':_0x5540b3[_0xe2f9('0x44')]?_[_0xe2f9('0x34')](_[_0xe2f9('0x6b')](_0x5540b3[_0xe2f9('0x44')]),function(_0x13d5f4){return{'name':_0x13d5f4[_0xe2f9('0x6f')],'value':_0x13d5f4[_0xe2f9('0x2b')]};}):[]};})};}})[_0xe2f9('0x27')](respondWithResult(_0x4469e2,null))[_0xe2f9('0x48')](function(_0x504612){var _0x1cc22e=_0x3b8b4b[_0xe2f9('0x35')][_0xe2f9('0x70')]?0x1f4:_0x504612['statusCode']||0x1f4;logger['error'](_0xe2f9('0x71'),_0xe2f9('0x58'),_0x1cc22e,JSON[_0xe2f9('0x65')](_0x504612));delete _0x504612[_0xe2f9('0x2b')];if(_0x1cc22e===0x191){_0x1cc22e=0x190;}_0x4469e2[_0xe2f9('0x1b')](_0x1cc22e)['send'](_0x3b8b4b[_0xe2f9('0x35')][_0xe2f9('0x70')]?{'message':_0xe2f9('0x72'),'statusCode':_0x504612['statusCode']}:_0x504612);});}else{var _0x3b7633=0x1f4;_0x4469e2[_0xe2f9('0x1b')](_0x3b7633)['send']({'message':_0xe2f9('0x72'),'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 cd0ff79..99119e2 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 _0x76d5=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','api','moment','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x76d5,0x19b));var _0x576d=function(_0x4c9749,_0x5bc482){_0x4c9749=_0x4c9749-0x0;var _0xbb8999=_0x76d5[_0x4c9749];return _0xbb8999;};'use strict';var _=require(_0x576d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x576d('0x1'));var moment=require(_0x576d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x576d('0x3'));var rimraf=require(_0x576d('0x4'));var config=require(_0x576d('0x5'));var attributes=require(_0x576d('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x576d('0x7')]=function(_0x1d7f08,_0x468d8e){return _0x1d7f08[_0x576d('0x8')](_0x576d('0x9'),attributes,{'tableName':_0x576d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe99=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0xc50e8f,_0x113419){var _0x9c9851=function(_0x5cc84c){while(--_0x5cc84c){_0xc50e8f['push'](_0xc50e8f['shift']());}};_0x9c9851(++_0x113419);}(_0xbe99,0x1de));var _0x9be9=function(_0x4c627b,_0x2d588d){_0x4c627b=_0x4c627b-0x0;var _0x5c8a98=_0xbe99[_0x4c627b];return _0x5c8a98;};'use strict';var _=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var logger=require(_0x9be9('0x2'))(_0x9be9('0x3'));var moment=require(_0x9be9('0x4'));var BPromise=require(_0x9be9('0x5'));var rp=require(_0x9be9('0x6'));var fs=require('fs');var path=require(_0x9be9('0x7'));var rimraf=require('rimraf');var config=require(_0x9be9('0x8'));var attributes=require(_0x9be9('0x9'));var integrations=require(_0x9be9('0xa'));module[_0x9be9('0xb')]=function(_0x573b8e,_0x327265){return _0x573b8e['define'](_0x9be9('0xc'),attributes,{'tableName':_0x9be9('0xd'),'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 1404eac..3cef3a8 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 _0xf950=['info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xf950,0x1f0));var _0x0f95=function(_0x497fe6,_0x327a82){_0x497fe6=_0x497fe6-0x0;var _0x1c7bdb=_0xf950[_0x497fe6];return _0x1c7bdb;};'use strict';var _=require(_0x0f95('0x0'));var util=require(_0x0f95('0x1'));var moment=require('moment');var BPromise=require(_0x0f95('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f95('0x3'));var db=require(_0x0f95('0x4'))['db'];var utils=require(_0x0f95('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f95('0x6')][_0x0f95('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x203846,_0x435ca2,_0x57d5dc){return new BPromise(function(_0x58c74c,_0xb997cf){return client['request'](_0x203846,_0x57d5dc)[_0x0f95('0x8')](function(_0x13ee9c){logger['info'](_0x0f95('0x9'),_0x435ca2,_0x0f95('0xa'));logger[_0x0f95('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x435ca2,_0x0f95('0xa'),JSON[_0x0f95('0xc')](_0x13ee9c));if(_0x13ee9c[_0x0f95('0xd')]){if(_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xe')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x435ca2,_0x13ee9c[_0x0f95('0xd')]['message']);return _0xb997cf(_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xf')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x435ca2,_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xf')]);return _0x58c74c(_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xf')]);}else{logger[_0x0f95('0x10')](_0x0f95('0x9'),_0x435ca2,_0x0f95('0xa'));_0x58c74c(_0x13ee9c[_0x0f95('0x11')][_0x0f95('0xf')]);}})[_0x0f95('0x12')](function(_0x40287a){logger[_0x0f95('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x435ca2,_0x40287a);_0xb997cf(_0x40287a);});});}exports[_0x0f95('0x13')]=function(_0x218ff4){var _0x3629a6=this;return new Promise(function(_0x4afde6,_0x527d23){return db[_0x0f95('0x14')][_0x0f95('0x15')]({'raw':_0x218ff4['options']?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x17')]===undefined?!![]:![]:!![],'where':_0x218ff4['options']?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x18')]||null:null,'attributes':_0x218ff4[_0x0f95('0x16')]?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x19')]||null:null,'limit':_0x218ff4['options']?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x1a')]||null:null,'include':_0x218ff4[_0x0f95('0x16')]?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x218ff4['options'][_0x0f95('0x1b')],function(_0x366202){return{'model':db[_0x366202[_0x0f95('0x1d')]],'as':_0x366202['as'],'attributes':_0x366202[_0x0f95('0x19')],'include':_0x366202['include']?_[_0x0f95('0x1c')](_0x366202['include'],function(_0x515aa8){return{'model':db[_0x515aa8[_0x0f95('0x1d')]],'as':_0x515aa8['as'],'attributes':_0x515aa8[_0x0f95('0x19')],'include':_0x515aa8[_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x515aa8[_0x0f95('0x1b')],function(_0x3d522a){return{'model':db[_0x3d522a['model']],'as':_0x3d522a['as'],'attributes':_0x3d522a[_0x0f95('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0f95('0x8')](function(_0x27db74){logger[_0x0f95('0x10')]('GetSugarcrmAccount',_0x218ff4);logger[_0x0f95('0xb')](_0x0f95('0x13'),_0x218ff4,JSON['stringify'](_0x27db74));_0x4afde6(_0x27db74);})[_0x0f95('0x12')](function(_0x455de9){logger['error'](_0x0f95('0x13'),_0x455de9['message'],_0x218ff4);_0x527d23(_0x3629a6[_0x0f95('0xd')](0x1f4,_0x455de9['message']));});});};exports[_0x0f95('0x1e')]=function(_0x3d2f04){var _0x34da41=this;return new Promise(function(_0x351b77,_0x301f4d){return db['SugarcrmAccount'][_0x0f95('0x1f')]({'raw':_0x3d2f04['options']?_0x3d2f04[_0x0f95('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3d2f04[_0x0f95('0x16')]?_0x3d2f04[_0x0f95('0x16')]['where']||null:null,'attributes':_0x3d2f04[_0x0f95('0x16')]?_0x3d2f04['options'][_0x0f95('0x19')]||null:null,'include':_0x3d2f04[_0x0f95('0x16')]?_0x3d2f04['options'][_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x3d2f04[_0x0f95('0x16')][_0x0f95('0x1b')],function(_0x514f57){return{'model':db[_0x514f57[_0x0f95('0x1d')]],'as':_0x514f57['as'],'attributes':_0x514f57[_0x0f95('0x19')],'include':_0x514f57['include']?_['map'](_0x514f57[_0x0f95('0x1b')],function(_0x5d1b73){return{'model':db[_0x5d1b73[_0x0f95('0x1d')]],'as':_0x5d1b73['as'],'attributes':_0x5d1b73[_0x0f95('0x19')],'include':_0x5d1b73[_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x5d1b73[_0x0f95('0x1b')],function(_0x597524){return{'model':db[_0x597524[_0x0f95('0x1d')]],'as':_0x597524['as'],'attributes':_0x597524['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f95('0x8')](function(_0x525cf7){logger['info'](_0x0f95('0x1e'),_0x3d2f04);logger[_0x0f95('0xb')]('ShowSugarcrmAccount',_0x3d2f04,JSON['stringify'](_0x525cf7));_0x351b77(_0x525cf7);})['catch'](function(_0xe5180d){logger[_0x0f95('0xd')](_0x0f95('0x1e'),_0xe5180d[_0x0f95('0xf')],_0x3d2f04);_0x301f4d(_0x34da41[_0x0f95('0xd')](0x1f4,_0xe5180d[_0x0f95('0xf')]));});});}; \ No newline at end of file +var _0x336a=['catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','find','ShowSugarcrmAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result'];(function(_0xfd69c1,_0x502768){var _0x200ec8=function(_0x5c5bed){while(--_0x5c5bed){_0xfd69c1['push'](_0xfd69c1['shift']());}};_0x200ec8(++_0x502768);}(_0x336a,0xa2));var _0xa336=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x336a[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xa336('0x0'));var util=require('util');var moment=require(_0xa336('0x1'));var BPromise=require(_0xa336('0x2'));var rs=require(_0xa336('0x3'));var fs=require('fs');var Redis=require(_0xa336('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa336('0x5'));var logger=require(_0xa336('0x6'))('rpc');var config=require(_0xa336('0x7'));var jayson=require(_0xa336('0x8'));var client=jayson[_0xa336('0x9')][_0xa336('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a3342,_0x4f81ea,_0x3b99ef){return new BPromise(function(_0x367699,_0x52db96){return client[_0xa336('0xb')](_0x2a3342,_0x3b99ef)[_0xa336('0xc')](function(_0x1aeea0){logger[_0xa336('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x4f81ea,'request\x20sent');logger[_0xa336('0xe')](_0xa336('0xf'),_0x4f81ea,_0xa336('0x10'),JSON[_0xa336('0x11')](_0x1aeea0));if(_0x1aeea0[_0xa336('0x12')]){if(_0x1aeea0['error'][_0xa336('0x13')]===0x1f4){logger[_0xa336('0x12')](_0xa336('0x14'),_0x4f81ea,_0x1aeea0[_0xa336('0x12')][_0xa336('0x15')]);return _0x52db96(_0x1aeea0[_0xa336('0x12')][_0xa336('0x15')]);}logger[_0xa336('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x4f81ea,_0x1aeea0[_0xa336('0x12')]['message']);return _0x367699(_0x1aeea0[_0xa336('0x12')][_0xa336('0x15')]);}else{logger[_0xa336('0xd')](_0xa336('0x14'),_0x4f81ea,_0xa336('0x10'));_0x367699(_0x1aeea0[_0xa336('0x16')][_0xa336('0x15')]);}})[_0xa336('0x17')](function(_0x5e5f0d){logger[_0xa336('0x12')](_0xa336('0x14'),_0x4f81ea,_0x5e5f0d);_0x52db96(_0x5e5f0d);});});}exports['GetSugarcrmAccount']=function(_0x5c8028){var _0x711638=this;return new Promise(function(_0x401a20,_0x53707b){return db[_0xa336('0x18')][_0xa336('0x19')]({'raw':_0x5c8028[_0xa336('0x1a')]?_0x5c8028[_0xa336('0x1a')][_0xa336('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c8028['options']?_0x5c8028[_0xa336('0x1a')][_0xa336('0x1c')]||null:null,'attributes':_0x5c8028[_0xa336('0x1a')]?_0x5c8028[_0xa336('0x1a')][_0xa336('0x1d')]||null:null,'limit':_0x5c8028[_0xa336('0x1a')]?_0x5c8028['options'][_0xa336('0x1e')]||null:null,'include':_0x5c8028[_0xa336('0x1a')]?_0x5c8028[_0xa336('0x1a')][_0xa336('0x1f')]?_[_0xa336('0x20')](_0x5c8028[_0xa336('0x1a')]['include'],function(_0x9da031){return{'model':db[_0x9da031[_0xa336('0x21')]],'as':_0x9da031['as'],'attributes':_0x9da031[_0xa336('0x1d')],'include':_0x9da031['include']?_[_0xa336('0x20')](_0x9da031[_0xa336('0x1f')],function(_0x46283d){return{'model':db[_0x46283d[_0xa336('0x21')]],'as':_0x46283d['as'],'attributes':_0x46283d['attributes'],'include':_0x46283d[_0xa336('0x1f')]?_[_0xa336('0x20')](_0x46283d[_0xa336('0x1f')],function(_0x139745){return{'model':db[_0x139745[_0xa336('0x21')]],'as':_0x139745['as'],'attributes':_0x139745[_0xa336('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa336('0xc')](function(_0x2ef82e){logger[_0xa336('0xd')](_0xa336('0x22'),_0x5c8028);logger['debug']('GetSugarcrmAccount',_0x5c8028,JSON[_0xa336('0x11')](_0x2ef82e));_0x401a20(_0x2ef82e);})['catch'](function(_0x3214f1){logger['error']('GetSugarcrmAccount',_0x3214f1[_0xa336('0x15')],_0x5c8028);_0x53707b(_0x711638[_0xa336('0x12')](0x1f4,_0x3214f1[_0xa336('0x15')]));});});};exports['ShowSugarcrmAccount']=function(_0xe04d6c){var _0x4342ec=this;return new Promise(function(_0x1204d8,_0x3f2c21){return db[_0xa336('0x18')][_0xa336('0x23')]({'raw':_0xe04d6c[_0xa336('0x1a')]?_0xe04d6c['options'][_0xa336('0x1b')]===undefined?!![]:![]:!![],'where':_0xe04d6c[_0xa336('0x1a')]?_0xe04d6c[_0xa336('0x1a')][_0xa336('0x1c')]||null:null,'attributes':_0xe04d6c[_0xa336('0x1a')]?_0xe04d6c['options'][_0xa336('0x1d')]||null:null,'include':_0xe04d6c[_0xa336('0x1a')]?_0xe04d6c[_0xa336('0x1a')][_0xa336('0x1f')]?_[_0xa336('0x20')](_0xe04d6c['options'][_0xa336('0x1f')],function(_0x1744b4){return{'model':db[_0x1744b4[_0xa336('0x21')]],'as':_0x1744b4['as'],'attributes':_0x1744b4['attributes'],'include':_0x1744b4[_0xa336('0x1f')]?_[_0xa336('0x20')](_0x1744b4[_0xa336('0x1f')],function(_0x52ff26){return{'model':db[_0x52ff26[_0xa336('0x21')]],'as':_0x52ff26['as'],'attributes':_0x52ff26[_0xa336('0x1d')],'include':_0x52ff26[_0xa336('0x1f')]?_[_0xa336('0x20')](_0x52ff26[_0xa336('0x1f')],function(_0x1e83c0){return{'model':db[_0x1e83c0[_0xa336('0x21')]],'as':_0x1e83c0['as'],'attributes':_0x1e83c0[_0xa336('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa336('0xc')](function(_0x1ce8e7){logger[_0xa336('0xd')](_0xa336('0x24'),_0xe04d6c);logger[_0xa336('0xe')]('ShowSugarcrmAccount',_0xe04d6c,JSON['stringify'](_0x1ce8e7));_0x1204d8(_0x1ce8e7);})[_0xa336('0x17')](function(_0x5e57a6){logger['error']('ShowSugarcrmAccount',_0x5e57a6[_0xa336('0x15')],_0xe04d6c);_0x3f2c21(_0x4342ec['error'](0x1f4,_0x5e57a6[_0xa336('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 7e545d4..20e94cd 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 _0x175e=['create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x2399b1,_0x4daff9){var _0x5f1404=function(_0x54f088){while(--_0x54f088){_0x2399b1['push'](_0x2399b1['shift']());}};_0x5f1404(++_0x4daff9);}(_0x175e,0x1b4));var _0xe175=function(_0x306860,_0x504443){_0x306860=_0x306860-0x0;var _0xa0d46f=_0x175e[_0x306860];return _0xa0d46f;};'use strict';var multer=require('multer');var util=require(_0xe175('0x0'));var path=require(_0xe175('0x1'));var timeout=require(_0xe175('0x2'));var express=require(_0xe175('0x3'));var router=express[_0xe175('0x4')]();var fs_extra=require(_0xe175('0x5'));var auth=require(_0xe175('0x6'));var interaction=require(_0xe175('0x7'));var config=require(_0xe175('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xe175('0x9')]('/',auth[_0xe175('0xa')](),controller[_0xe175('0xb')]);router[_0xe175('0x9')](_0xe175('0xc'),auth[_0xe175('0xa')](),controller[_0xe175('0xd')]);router['get'](_0xe175('0xe'),auth[_0xe175('0xa')](),controller['getFields']);router[_0xe175('0x9')](_0xe175('0xf'),auth[_0xe175('0xa')](),controller[_0xe175('0x10')]);router['get'](_0xe175('0x11'),auth['isAuthenticated'](),controller[_0xe175('0x12')]);router[_0xe175('0x13')]('/',auth[_0xe175('0xa')](),controller[_0xe175('0x14')]);router[_0xe175('0x15')](_0xe175('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe175('0xc'),auth[_0xe175('0xa')](),controller[_0xe175('0x16')]);module[_0xe175('0x17')]=router; \ No newline at end of file +var _0x52c7=['/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show'];(function(_0x3f50a9,_0x55942c){var _0x4ecba1=function(_0x3cdb81){while(--_0x3cdb81){_0x3f50a9['push'](_0x3f50a9['shift']());}};_0x4ecba1(++_0x55942c);}(_0x52c7,0xab));var _0x752c=function(_0x222550,_0x3c0a0c){_0x222550=_0x222550-0x0;var _0x58ac61=_0x52c7[_0x222550];return _0x58ac61;};'use strict';var multer=require(_0x752c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x752c('0x1'));var express=require(_0x752c('0x2'));var router=express[_0x752c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x752c('0x4'));var interaction=require(_0x752c('0x5'));var config=require(_0x752c('0x6'));var controller=require(_0x752c('0x7'));router[_0x752c('0x8')]('/',auth['isAuthenticated'](),controller[_0x752c('0x9')]);router['get'](_0x752c('0xa'),auth[_0x752c('0xb')](),controller[_0x752c('0xc')]);router[_0x752c('0x8')](_0x752c('0xd'),auth[_0x752c('0xb')](),controller[_0x752c('0xe')]);router[_0x752c('0x8')](_0x752c('0xf'),auth[_0x752c('0xb')](),controller['getSubjects']);router[_0x752c('0x8')]('/:id/descriptions',auth[_0x752c('0xb')](),controller[_0x752c('0x10')]);router[_0x752c('0x11')]('/',auth[_0x752c('0xb')](),controller[_0x752c('0x12')]);router[_0x752c('0x13')](_0x752c('0xa'),auth['isAuthenticated'](),controller[_0x752c('0x14')]);router['delete'](_0x752c('0xa'),auth['isAuthenticated'](),controller[_0x752c('0x15')]);module[_0x752c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index bf55507..31d39c2 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 _0xff2f=['sequelize','exports','STRING'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xff2f,0x1b3));var _0xfff2=function(_0x59d692,_0x637365){_0x59d692=_0x59d692-0x0;var _0x13316a=_0xff2f[_0x59d692];return _0x13316a;};'use strict';var Sequelize=require(_0xfff2('0x0'));module[_0xfff2('0x1')]={'name':{'type':Sequelize[_0xfff2('0x2')]},'description':{'type':Sequelize[_0xfff2('0x2')]}}; \ No newline at end of file +var _0xa5eb=['STRING','sequelize','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa5eb,0x19f));var _0xba5e=function(_0x25601e,_0x94fe66){_0x25601e=_0x25601e-0x0;var _0xcf2596=_0xa5eb[_0x25601e];return _0xcf2596;};'use strict';var Sequelize=require(_0xba5e('0x0'));module[_0xba5e('0x1')]={'name':{'type':Sequelize[_0xba5e('0x2')]},'description':{'type':Sequelize[_0xba5e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index efc0c60..ee172e0 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 _0x7065=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','save','then','error','name','send','index','SugarcrmConfiguration','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','catch','update','body','getFields','findOne','getSubjects','SugarcrmField','nolimit','getDescriptions','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x54dc05,_0x2b6f1f){var _0xc92f99=function(_0x11d4b0){while(--_0x11d4b0){_0x54dc05['push'](_0x54dc05['shift']());}};_0xc92f99(++_0x2b6f1f);}(_0x7065,0x1c7));var _0x5706=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7065[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5706('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5706('0x1'));var BPromise=require(_0x5706('0x2'));var Mustache=require(_0x5706('0x3'));var util=require(_0x5706('0x4'));var path=require('path');var sox=require(_0x5706('0x5'));var csv=require('to-csv');var ejs=require(_0x5706('0x6'));var fs=require('fs');var fs_extra=require(_0x5706('0x7'));var _=require(_0x5706('0x8'));var squel=require(_0x5706('0x9'));var crypto=require(_0x5706('0xa'));var jsforce=require(_0x5706('0xb'));var deskjs=require(_0x5706('0xc'));var toCsv=require(_0x5706('0xd'));var querystring=require(_0x5706('0xe'));var Papa=require('papaparse');var Redis=require(_0x5706('0xf'));var authService=require(_0x5706('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5706('0x11'));var hardwareService=require(_0x5706('0x12'));var logger=require(_0x5706('0x13'))(_0x5706('0x14'));var utils=require(_0x5706('0x15'));var config=require(_0x5706('0x16'));var licenseUtil=require(_0x5706('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12e1e8,_0x1f6077){_0x1f6077=_0x1f6077||0xcc;return function(_0x1e8bd9){if(_0x1e8bd9){return _0x12e1e8[_0x5706('0x18')](_0x1f6077);}return _0x12e1e8[_0x5706('0x19')](_0x1f6077)[_0x5706('0x1a')]();};}function respondWithResult(_0x13e6ac,_0x96ef3c){_0x96ef3c=_0x96ef3c||0xc8;return function(_0x561abf){if(_0x561abf){return _0x13e6ac['status'](_0x96ef3c)['json'](_0x561abf);}};}function respondWithFilteredResult(_0x339429,_0x3070b8){return function(_0x27f939){if(_0x27f939){var _0x480e2f=typeof _0x3070b8[_0x5706('0x1b')]===_0x5706('0x1c')&&typeof _0x3070b8['limit']===_0x5706('0x1c');var _0x5765c3=_0x27f939[_0x5706('0x1d')];var _0x367f66=_0x480e2f?0x0:_0x3070b8[_0x5706('0x1b')];var _0x48b04f=_0x480e2f?_0x27f939[_0x5706('0x1d')]:_0x3070b8[_0x5706('0x1b')]+_0x3070b8['limit'];var _0x2370d6;if(_0x48b04f>=_0x5765c3){_0x48b04f=_0x5765c3;_0x2370d6=0xc8;}else{_0x2370d6=0xce;}_0x339429[_0x5706('0x19')](_0x2370d6);return _0x339429['set'](_0x5706('0x1e'),_0x367f66+'-'+_0x48b04f+'/'+_0x5765c3)[_0x5706('0x1f')](_0x27f939);}return null;};}function patchUpdates(_0x3e91dd){return function(_0x2f6142){try{jsonpatch[_0x5706('0x20')](_0x2f6142,_0x3e91dd,!![]);}catch(_0x55899f){return BPromise['reject'](_0x55899f);}return _0x2f6142[_0x5706('0x21')]();};}function saveUpdates(_0x413e80,_0x3d662e){return function(_0x5df464){if(_0x5df464){return _0x5df464['update'](_0x413e80)[_0x5706('0x22')](function(_0x5d3fae){return _0x5d3fae;});}return null;};}function removeEntity(_0x2f91cf,_0x374462){return function(_0x1546cf){if(_0x1546cf){return _0x1546cf['destroy']()['then'](function(){_0x2f91cf[_0x5706('0x19')](0xcc)[_0x5706('0x1a')]();});}};}function handleEntityNotFound(_0x46af48,_0x25a9b8){return function(_0x21fc9f){if(!_0x21fc9f){_0x46af48[_0x5706('0x18')](0x194);}return _0x21fc9f;};}function handleError(_0x29d875,_0x574149){_0x574149=_0x574149||0x1f4;return function(_0x33a774){logger[_0x5706('0x23')](_0x33a774['stack']);if(_0x33a774[_0x5706('0x24')]){delete _0x33a774[_0x5706('0x24')];}_0x29d875['status'](_0x574149)[_0x5706('0x25')](_0x33a774);};}exports[_0x5706('0x26')]=function(_0x17a630,_0x926238){var _0x1806df={},_0x4feb80={},_0x541e24={'count':0x0,'rows':[]};var _0x12ffb6=_['map'](db[_0x5706('0x27')]['rawAttributes'],function(_0x4ac8df){return{'name':_0x4ac8df[_0x5706('0x28')],'type':_0x4ac8df[_0x5706('0x29')]['key']};});_0x4feb80[_0x5706('0x2a')]=_[_0x5706('0x2b')](_0x12ffb6,_0x5706('0x24'));_0x4feb80[_0x5706('0x2c')]=_[_0x5706('0x2d')](_0x17a630[_0x5706('0x2c')]);_0x4feb80[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x4feb80[_0x5706('0x2a')],_0x4feb80[_0x5706('0x2c')]);_0x1806df[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x4feb80[_0x5706('0x2a')],qs['fields'](_0x17a630['query'][_0x5706('0x31')]));_0x1806df[_0x5706('0x30')]=_0x1806df[_0x5706('0x30')][_0x5706('0x32')]?_0x1806df[_0x5706('0x30')]:_0x4feb80[_0x5706('0x2a')];if(!_0x17a630['query'][_0x5706('0x33')]('nolimit')){_0x1806df['limit']=qs[_0x5706('0x34')](_0x17a630[_0x5706('0x2c')]['limit']);_0x1806df[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x17a630['query'][_0x5706('0x1b')]);}_0x1806df[_0x5706('0x35')]=qs[_0x5706('0x36')](_0x17a630[_0x5706('0x2c')]['sort']);_0x1806df[_0x5706('0x37')]=qs['filters'](_[_0x5706('0x38')](_0x17a630[_0x5706('0x2c')],_0x4feb80[_0x5706('0x2e')]),_0x12ffb6);if(_0x17a630[_0x5706('0x2c')][_0x5706('0x39')]){_0x1806df[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x1806df['where'],{'$or':_[_0x5706('0x2b')](_0x12ffb6,function(_0x2796ef){if(_0x2796ef[_0x5706('0x29')]!==_0x5706('0x3b')){var _0x152d6b={};_0x152d6b[_0x2796ef[_0x5706('0x24')]]={'$like':'%'+_0x17a630[_0x5706('0x2c')]['filter']+'%'};return _0x152d6b;}})});}_0x1806df=_['merge']({},_0x1806df,_0x17a630[_0x5706('0x3c')]);var _0x4873c9={'where':_0x1806df['where']};return db[_0x5706('0x27')][_0x5706('0x1d')](_0x4873c9)[_0x5706('0x22')](function(_0x52d6f8){_0x541e24[_0x5706('0x1d')]=_0x52d6f8;if(_0x17a630['query'][_0x5706('0x3d')]){_0x1806df[_0x5706('0x3e')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x5706('0x3f')](_0x1806df);})[_0x5706('0x22')](function(_0x5894f0){_0x541e24[_0x5706('0x40')]=_0x5894f0;return _0x541e24;})['then'](respondWithFilteredResult(_0x926238,_0x1806df))['catch'](handleError(_0x926238,null));};exports[_0x5706('0x41')]=function(_0x570771,_0x17a88a){var _0x23a184={'raw':![],'where':{'id':_0x570771[_0x5706('0x42')]['id']}},_0x43b268={};_0x43b268[_0x5706('0x2a')]=_[_0x5706('0x2d')](db[_0x5706('0x27')][_0x5706('0x43')]);_0x43b268['query']=_['keys'](_0x570771[_0x5706('0x2c')]);_0x43b268[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x43b268['model'],_0x43b268[_0x5706('0x2c')]);_0x23a184[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x43b268[_0x5706('0x2a')],qs[_0x5706('0x31')](_0x570771[_0x5706('0x2c')][_0x5706('0x31')]));_0x23a184['attributes']=_0x23a184[_0x5706('0x30')]['length']?_0x23a184[_0x5706('0x30')]:_0x43b268[_0x5706('0x2a')];if(_0x570771[_0x5706('0x2c')][_0x5706('0x3d')]){_0x23a184[_0x5706('0x3e')]=[{'all':!![]}];}_0x23a184=_['merge']({},_0x23a184,_0x570771[_0x5706('0x3c')]);return db[_0x5706('0x27')][_0x5706('0x44')](_0x23a184)['then'](handleEntityNotFound(_0x17a88a,null))[_0x5706('0x22')](respondWithResult(_0x17a88a,null))['catch'](handleError(_0x17a88a,null));};exports[_0x5706('0x45')]=function(_0x168d32,_0xa07369){return db['SugarcrmConfiguration']['create'](_0x168d32['body'],{})['then'](respondWithResult(_0xa07369,0xc9))[_0x5706('0x46')](handleError(_0xa07369,null));};exports[_0x5706('0x47')]=function(_0x49e7c8,_0x297ef6){if(_0x49e7c8[_0x5706('0x48')]['id']){delete _0x49e7c8[_0x5706('0x48')]['id'];}return db[_0x5706('0x27')][_0x5706('0x44')]({'where':{'id':_0x49e7c8[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x297ef6,null))[_0x5706('0x22')](saveUpdates(_0x49e7c8[_0x5706('0x48')],null))[_0x5706('0x22')](respondWithResult(_0x297ef6,null))[_0x5706('0x46')](handleError(_0x297ef6,null));};exports['destroy']=function(_0x11a8ab,_0x28669c){return db[_0x5706('0x27')][_0x5706('0x44')]({'where':{'id':_0x11a8ab[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x28669c,null))[_0x5706('0x22')](removeEntity(_0x28669c,null))[_0x5706('0x46')](handleError(_0x28669c,null));};exports[_0x5706('0x49')]=function(_0x2112b5,_0x5e2c1b,_0x1b8458){var _0x43e280={};var _0x1d3310={};var _0x5756c6;var _0x27dc86;return db[_0x5706('0x27')][_0x5706('0x4a')]({'where':{'id':_0x2112b5[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x5e2c1b,null))[_0x5706('0x22')](function(_0x587d05){if(_0x587d05){_0x5756c6=_0x587d05;_0x1d3310['model']=_[_0x5706('0x2d')](db['SugarcrmField'][_0x5706('0x43')]);_0x1d3310[_0x5706('0x2c')]=_[_0x5706('0x2d')](_0x2112b5[_0x5706('0x2c')]);_0x1d3310[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x1d3310[_0x5706('0x2a')],_0x1d3310[_0x5706('0x2c')]);_0x43e280['attributes']=_[_0x5706('0x2f')](_0x1d3310['model'],qs[_0x5706('0x31')](_0x2112b5[_0x5706('0x2c')][_0x5706('0x31')]));_0x43e280['attributes']=_0x43e280[_0x5706('0x30')]['length']?_0x43e280[_0x5706('0x30')]:_0x1d3310[_0x5706('0x2a')];_0x43e280[_0x5706('0x35')]=qs['sort'](_0x2112b5[_0x5706('0x2c')][_0x5706('0x36')]);_0x43e280[_0x5706('0x37')]=qs[_0x5706('0x2e')](_[_0x5706('0x38')](_0x2112b5['query'],_0x1d3310['filters']));if(_0x2112b5[_0x5706('0x2c')][_0x5706('0x39')]){_0x43e280[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x43e280['where'],{'$or':_['map'](_0x43e280[_0x5706('0x30')],function(_0x570628){var _0x379ed0={};_0x379ed0[_0x570628]={'$like':'%'+_0x2112b5[_0x5706('0x2c')][_0x5706('0x39')]+'%'};return _0x379ed0;})});}_0x43e280=_[_0x5706('0x3a')]({},_0x43e280,_0x2112b5[_0x5706('0x3c')]);return _0x5756c6[_0x5706('0x49')](_0x43e280);}})[_0x5706('0x22')](function(_0x3c0686){if(_0x3c0686){_0x27dc86=_0x3c0686[_0x5706('0x32')];if(!_0x2112b5['query'][_0x5706('0x33')]('nolimit')){_0x43e280[_0x5706('0x34')]=qs[_0x5706('0x34')](_0x2112b5[_0x5706('0x2c')]['limit']);_0x43e280[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x2112b5[_0x5706('0x2c')][_0x5706('0x1b')]);}return _0x5756c6[_0x5706('0x49')](_0x43e280);}})[_0x5706('0x22')](function(_0x40a0e9){if(_0x40a0e9){return _0x40a0e9?{'count':_0x27dc86,'rows':_0x40a0e9}:null;}})[_0x5706('0x22')](respondWithResult(_0x5e2c1b,null))[_0x5706('0x46')](handleError(_0x5e2c1b,null));};exports[_0x5706('0x4b')]=function(_0x578853,_0x317b83,_0x49f6f9){var _0x41a95c={};var _0x27a8b3={};var _0x1431d4;var _0x7233d0;return db['SugarcrmConfiguration'][_0x5706('0x4a')]({'where':{'id':_0x578853[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x317b83,null))[_0x5706('0x22')](function(_0x41f1d2){if(_0x41f1d2){_0x1431d4=_0x41f1d2;_0x27a8b3[_0x5706('0x2a')]=_[_0x5706('0x2d')](db[_0x5706('0x4c')][_0x5706('0x43')]);_0x27a8b3['query']=_[_0x5706('0x2d')](_0x578853[_0x5706('0x2c')]);_0x27a8b3[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x27a8b3[_0x5706('0x2a')],_0x27a8b3['query']);_0x41a95c[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x27a8b3[_0x5706('0x2a')],qs['fields'](_0x578853['query']['fields']));_0x41a95c[_0x5706('0x30')]=_0x41a95c['attributes'][_0x5706('0x32')]?_0x41a95c[_0x5706('0x30')]:_0x27a8b3[_0x5706('0x2a')];_0x41a95c[_0x5706('0x35')]=qs[_0x5706('0x36')](_0x578853[_0x5706('0x2c')][_0x5706('0x36')]);_0x41a95c[_0x5706('0x37')]=qs[_0x5706('0x2e')](_[_0x5706('0x38')](_0x578853['query'],_0x27a8b3[_0x5706('0x2e')]));if(_0x578853[_0x5706('0x2c')][_0x5706('0x39')]){_0x41a95c[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x41a95c[_0x5706('0x37')],{'$or':_[_0x5706('0x2b')](_0x41a95c[_0x5706('0x30')],function(_0x2db26a){var _0x141b9e={};_0x141b9e[_0x2db26a]={'$like':'%'+_0x578853[_0x5706('0x2c')][_0x5706('0x39')]+'%'};return _0x141b9e;})});}_0x41a95c=_['merge']({},_0x41a95c,_0x578853[_0x5706('0x3c')]);return _0x1431d4[_0x5706('0x4b')](_0x41a95c);}})['then'](function(_0x2df93b){if(_0x2df93b){_0x7233d0=_0x2df93b[_0x5706('0x32')];if(!_0x578853[_0x5706('0x2c')][_0x5706('0x33')](_0x5706('0x4d'))){_0x41a95c[_0x5706('0x34')]=qs['limit'](_0x578853[_0x5706('0x2c')][_0x5706('0x34')]);_0x41a95c[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x578853[_0x5706('0x2c')][_0x5706('0x1b')]);}return _0x1431d4['getSubjects'](_0x41a95c);}})[_0x5706('0x22')](function(_0xb02d1b){if(_0xb02d1b){return _0xb02d1b?{'count':_0x7233d0,'rows':_0xb02d1b}:null;}})[_0x5706('0x22')](respondWithResult(_0x317b83,null))['catch'](handleError(_0x317b83,null));};exports[_0x5706('0x4e')]=function(_0x3904a5,_0x324abe,_0x28eb29){var _0x57a399={};var _0x57e379={};var _0x23668e;var _0x9cf666;return db[_0x5706('0x27')]['findOne']({'where':{'id':_0x3904a5['params']['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x324abe,null))[_0x5706('0x22')](function(_0x1c55ad){if(_0x1c55ad){_0x23668e=_0x1c55ad;_0x57e379[_0x5706('0x2a')]=_[_0x5706('0x2d')](db[_0x5706('0x4c')][_0x5706('0x43')]);_0x57e379['query']=_[_0x5706('0x2d')](_0x3904a5['query']);_0x57e379[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x57e379[_0x5706('0x2a')],_0x57e379[_0x5706('0x2c')]);_0x57a399[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x57e379[_0x5706('0x2a')],qs[_0x5706('0x31')](_0x3904a5[_0x5706('0x2c')]['fields']));_0x57a399[_0x5706('0x30')]=_0x57a399[_0x5706('0x30')][_0x5706('0x32')]?_0x57a399['attributes']:_0x57e379[_0x5706('0x2a')];_0x57a399[_0x5706('0x35')]=qs[_0x5706('0x36')](_0x3904a5['query'][_0x5706('0x36')]);_0x57a399[_0x5706('0x37')]=qs[_0x5706('0x2e')](_['pick'](_0x3904a5[_0x5706('0x2c')],_0x57e379[_0x5706('0x2e')]));if(_0x3904a5[_0x5706('0x2c')][_0x5706('0x39')]){_0x57a399[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x57a399['where'],{'$or':_['map'](_0x57a399[_0x5706('0x30')],function(_0x2400b0){var _0xc9abba={};_0xc9abba[_0x2400b0]={'$like':'%'+_0x3904a5[_0x5706('0x2c')]['filter']+'%'};return _0xc9abba;})});}_0x57a399=_[_0x5706('0x3a')]({},_0x57a399,_0x3904a5[_0x5706('0x3c')]);return _0x23668e[_0x5706('0x4e')](_0x57a399);}})[_0x5706('0x22')](function(_0x1c799f){if(_0x1c799f){_0x9cf666=_0x1c799f[_0x5706('0x32')];if(!_0x3904a5[_0x5706('0x2c')][_0x5706('0x33')]('nolimit')){_0x57a399[_0x5706('0x34')]=qs[_0x5706('0x34')](_0x3904a5[_0x5706('0x2c')][_0x5706('0x34')]);_0x57a399[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x3904a5[_0x5706('0x2c')][_0x5706('0x1b')]);}return _0x23668e[_0x5706('0x4e')](_0x57a399);}})[_0x5706('0x22')](function(_0x514873){if(_0x514873){return _0x514873?{'count':_0x9cf666,'rows':_0x514873}:null;}})[_0x5706('0x22')](respondWithResult(_0x324abe,null))[_0x5706('0x46')](handleError(_0x324abe,null));}; \ No newline at end of file +var _0x07c5=['../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','SugarcrmConfiguration','type','key','model','map','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','body','params','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1ef911,_0x32a38b){var _0x5297f4=function(_0x3b1134){while(--_0x3b1134){_0x1ef911['push'](_0x1ef911['shift']());}};_0x5297f4(++_0x32a38b);}(_0x07c5,0x1d0));var _0x507c=function(_0x29880d,_0x2052c7){_0x29880d=_0x29880d-0x0;var _0x3966f8=_0x07c5[_0x29880d];return _0x3966f8;};'use strict';var emlformat=require(_0x507c('0x0'));var rimraf=require(_0x507c('0x1'));var zipdir=require(_0x507c('0x2'));var jsonpatch=require(_0x507c('0x3'));var rp=require(_0x507c('0x4'));var moment=require(_0x507c('0x5'));var BPromise=require(_0x507c('0x6'));var Mustache=require(_0x507c('0x7'));var util=require(_0x507c('0x8'));var path=require(_0x507c('0x9'));var sox=require('sox');var csv=require(_0x507c('0xa'));var ejs=require(_0x507c('0xb'));var fs=require('fs');var fs_extra=require(_0x507c('0xc'));var _=require(_0x507c('0xd'));var squel=require(_0x507c('0xe'));var crypto=require(_0x507c('0xf'));var jsforce=require(_0x507c('0x10'));var deskjs=require(_0x507c('0x11'));var toCsv=require(_0x507c('0xa'));var querystring=require('querystring');var Papa=require(_0x507c('0x12'));var Redis=require(_0x507c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x507c('0x14'));var as=require(_0x507c('0x15'));var hardwareService=require(_0x507c('0x16'));var logger=require('../../config/logger')(_0x507c('0x17'));var utils=require(_0x507c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x507c('0x19'));var db=require(_0x507c('0x1a'))['db'];function respondWithStatusCode(_0xa086a9,_0x843a27){_0x843a27=_0x843a27||0xcc;return function(_0x39dbdf){if(_0x39dbdf){return _0xa086a9['sendStatus'](_0x843a27);}return _0xa086a9['status'](_0x843a27)[_0x507c('0x1b')]();};}function respondWithResult(_0x41fa26,_0x4006e8){_0x4006e8=_0x4006e8||0xc8;return function(_0x5ce3f6){if(_0x5ce3f6){return _0x41fa26['status'](_0x4006e8)['json'](_0x5ce3f6);}};}function respondWithFilteredResult(_0x362624,_0x1777af){return function(_0x2bfe26){if(_0x2bfe26){var _0x3811d8=typeof _0x1777af[_0x507c('0x1c')]===_0x507c('0x1d')&&typeof _0x1777af[_0x507c('0x1e')]==='undefined';var _0x198d8a=_0x2bfe26[_0x507c('0x1f')];var _0xd011e2=_0x3811d8?0x0:_0x1777af[_0x507c('0x1c')];var _0x370af6=_0x3811d8?_0x2bfe26['count']:_0x1777af[_0x507c('0x1c')]+_0x1777af['limit'];var _0xacc344;if(_0x370af6>=_0x198d8a){_0x370af6=_0x198d8a;_0xacc344=0xc8;}else{_0xacc344=0xce;}_0x362624[_0x507c('0x20')](_0xacc344);return _0x362624[_0x507c('0x21')](_0x507c('0x22'),_0xd011e2+'-'+_0x370af6+'/'+_0x198d8a)[_0x507c('0x23')](_0x2bfe26);}return null;};}function patchUpdates(_0x2f2527){return function(_0x67ffaf){try{jsonpatch[_0x507c('0x24')](_0x67ffaf,_0x2f2527,!![]);}catch(_0x384b3f){return BPromise[_0x507c('0x25')](_0x384b3f);}return _0x67ffaf['save']();};}function saveUpdates(_0x147490,_0x39b563){return function(_0x1f59bb){if(_0x1f59bb){return _0x1f59bb[_0x507c('0x26')](_0x147490)[_0x507c('0x27')](function(_0x27b060){return _0x27b060;});}return null;};}function removeEntity(_0x3bbe41,_0x4b09c0){return function(_0x21a70a){if(_0x21a70a){return _0x21a70a[_0x507c('0x28')]()['then'](function(){_0x3bbe41[_0x507c('0x20')](0xcc)[_0x507c('0x1b')]();});}};}function handleEntityNotFound(_0x2aa052,_0x465e06){return function(_0x1d0561){if(!_0x1d0561){_0x2aa052['sendStatus'](0x194);}return _0x1d0561;};}function handleError(_0x57fd6e,_0x14eaa1){_0x14eaa1=_0x14eaa1||0x1f4;return function(_0x397d03){logger[_0x507c('0x29')](_0x397d03[_0x507c('0x2a')]);if(_0x397d03['name']){delete _0x397d03[_0x507c('0x2b')];}_0x57fd6e[_0x507c('0x20')](_0x14eaa1)[_0x507c('0x2c')](_0x397d03);};}exports['index']=function(_0x28536c,_0x1aa1f7){var _0x3268e0={},_0x77f96={},_0x1c3513={'count':0x0,'rows':[]};var _0x15d4c2=_['map'](db[_0x507c('0x2d')]['rawAttributes'],function(_0x4df19e){return{'name':_0x4df19e['fieldName'],'type':_0x4df19e[_0x507c('0x2e')][_0x507c('0x2f')]};});_0x77f96[_0x507c('0x30')]=_[_0x507c('0x31')](_0x15d4c2,_0x507c('0x2b'));_0x77f96['query']=_['keys'](_0x28536c['query']);_0x77f96[_0x507c('0x32')]=_[_0x507c('0x33')](_0x77f96[_0x507c('0x30')],_0x77f96['query']);_0x3268e0['attributes']=_[_0x507c('0x33')](_0x77f96['model'],qs[_0x507c('0x34')](_0x28536c[_0x507c('0x35')][_0x507c('0x34')]));_0x3268e0[_0x507c('0x36')]=_0x3268e0[_0x507c('0x36')][_0x507c('0x37')]?_0x3268e0[_0x507c('0x36')]:_0x77f96[_0x507c('0x30')];if(!_0x28536c[_0x507c('0x35')]['hasOwnProperty'](_0x507c('0x38'))){_0x3268e0[_0x507c('0x1e')]=qs[_0x507c('0x1e')](_0x28536c[_0x507c('0x35')][_0x507c('0x1e')]);_0x3268e0[_0x507c('0x1c')]=qs[_0x507c('0x1c')](_0x28536c['query'][_0x507c('0x1c')]);}_0x3268e0[_0x507c('0x39')]=qs['sort'](_0x28536c[_0x507c('0x35')][_0x507c('0x3a')]);_0x3268e0[_0x507c('0x3b')]=qs[_0x507c('0x32')](_[_0x507c('0x3c')](_0x28536c[_0x507c('0x35')],_0x77f96[_0x507c('0x32')]),_0x15d4c2);if(_0x28536c['query']['filter']){_0x3268e0['where']=_[_0x507c('0x3d')](_0x3268e0[_0x507c('0x3b')],{'$or':_[_0x507c('0x31')](_0x15d4c2,function(_0x113fd5){if(_0x113fd5[_0x507c('0x2e')]!=='VIRTUAL'){var _0x2bf9bb={};_0x2bf9bb[_0x113fd5[_0x507c('0x2b')]]={'$like':'%'+_0x28536c[_0x507c('0x35')][_0x507c('0x3e')]+'%'};return _0x2bf9bb;}})});}_0x3268e0=_[_0x507c('0x3d')]({},_0x3268e0,_0x28536c[_0x507c('0x3f')]);var _0x2784c3={'where':_0x3268e0[_0x507c('0x3b')]};return db[_0x507c('0x2d')][_0x507c('0x1f')](_0x2784c3)[_0x507c('0x27')](function(_0x23f84a){_0x1c3513[_0x507c('0x1f')]=_0x23f84a;if(_0x28536c[_0x507c('0x35')]['includeAll']){_0x3268e0[_0x507c('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x507c('0x41')](_0x3268e0);})[_0x507c('0x27')](function(_0x52748c){_0x1c3513[_0x507c('0x42')]=_0x52748c;return _0x1c3513;})[_0x507c('0x27')](respondWithFilteredResult(_0x1aa1f7,_0x3268e0))[_0x507c('0x43')](handleError(_0x1aa1f7,null));};exports[_0x507c('0x44')]=function(_0x11ce94,_0x1e9892){var _0x3e2c29={'raw':![],'where':{'id':_0x11ce94['params']['id']}},_0x36eda9={};_0x36eda9[_0x507c('0x30')]=_[_0x507c('0x45')](db[_0x507c('0x2d')][_0x507c('0x46')]);_0x36eda9[_0x507c('0x35')]=_[_0x507c('0x45')](_0x11ce94['query']);_0x36eda9['filters']=_[_0x507c('0x33')](_0x36eda9[_0x507c('0x30')],_0x36eda9[_0x507c('0x35')]);_0x3e2c29[_0x507c('0x36')]=_[_0x507c('0x33')](_0x36eda9[_0x507c('0x30')],qs[_0x507c('0x34')](_0x11ce94[_0x507c('0x35')]['fields']));_0x3e2c29[_0x507c('0x36')]=_0x3e2c29[_0x507c('0x36')][_0x507c('0x37')]?_0x3e2c29[_0x507c('0x36')]:_0x36eda9[_0x507c('0x30')];if(_0x11ce94['query'][_0x507c('0x47')]){_0x3e2c29['include']=[{'all':!![]}];}_0x3e2c29=_[_0x507c('0x3d')]({},_0x3e2c29,_0x11ce94[_0x507c('0x3f')]);return db['SugarcrmConfiguration'][_0x507c('0x48')](_0x3e2c29)[_0x507c('0x27')](handleEntityNotFound(_0x1e9892,null))[_0x507c('0x27')](respondWithResult(_0x1e9892,null))[_0x507c('0x43')](handleError(_0x1e9892,null));};exports['create']=function(_0x19c37c,_0x1a124a){return db[_0x507c('0x2d')]['create'](_0x19c37c['body'],{})[_0x507c('0x27')](respondWithResult(_0x1a124a,0xc9))[_0x507c('0x43')](handleError(_0x1a124a,null));};exports['update']=function(_0x3b24a4,_0x578ffd){if(_0x3b24a4[_0x507c('0x49')]['id']){delete _0x3b24a4['body']['id'];}return db[_0x507c('0x2d')]['find']({'where':{'id':_0x3b24a4[_0x507c('0x4a')]['id']}})[_0x507c('0x27')](handleEntityNotFound(_0x578ffd,null))[_0x507c('0x27')](saveUpdates(_0x3b24a4[_0x507c('0x49')],null))['then'](respondWithResult(_0x578ffd,null))['catch'](handleError(_0x578ffd,null));};exports['destroy']=function(_0x49592c,_0x5cb09b){return db['SugarcrmConfiguration'][_0x507c('0x48')]({'where':{'id':_0x49592c['params']['id']}})[_0x507c('0x27')](handleEntityNotFound(_0x5cb09b,null))[_0x507c('0x27')](removeEntity(_0x5cb09b,null))['catch'](handleError(_0x5cb09b,null));};exports[_0x507c('0x4b')]=function(_0x170b96,_0x4be9d6,_0x3a59ea){var _0x33515c={};var _0x4a71ec={};var _0x5f49f2;var _0x54edcf;return db[_0x507c('0x2d')][_0x507c('0x4c')]({'where':{'id':_0x170b96[_0x507c('0x4a')]['id']}})[_0x507c('0x27')](handleEntityNotFound(_0x4be9d6,null))[_0x507c('0x27')](function(_0x2e4f12){if(_0x2e4f12){_0x5f49f2=_0x2e4f12;_0x4a71ec[_0x507c('0x30')]=_[_0x507c('0x45')](db[_0x507c('0x4d')][_0x507c('0x46')]);_0x4a71ec[_0x507c('0x35')]=_[_0x507c('0x45')](_0x170b96[_0x507c('0x35')]);_0x4a71ec[_0x507c('0x32')]=_[_0x507c('0x33')](_0x4a71ec[_0x507c('0x30')],_0x4a71ec[_0x507c('0x35')]);_0x33515c[_0x507c('0x36')]=_[_0x507c('0x33')](_0x4a71ec['model'],qs['fields'](_0x170b96['query'][_0x507c('0x34')]));_0x33515c[_0x507c('0x36')]=_0x33515c[_0x507c('0x36')]['length']?_0x33515c[_0x507c('0x36')]:_0x4a71ec['model'];_0x33515c[_0x507c('0x39')]=qs[_0x507c('0x3a')](_0x170b96[_0x507c('0x35')][_0x507c('0x3a')]);_0x33515c['where']=qs['filters'](_['pick'](_0x170b96[_0x507c('0x35')],_0x4a71ec['filters']));if(_0x170b96[_0x507c('0x35')]['filter']){_0x33515c['where']=_[_0x507c('0x3d')](_0x33515c['where'],{'$or':_[_0x507c('0x31')](_0x33515c[_0x507c('0x36')],function(_0x1f9e6f){var _0x588317={};_0x588317[_0x1f9e6f]={'$like':'%'+_0x170b96[_0x507c('0x35')][_0x507c('0x3e')]+'%'};return _0x588317;})});}_0x33515c=_[_0x507c('0x3d')]({},_0x33515c,_0x170b96['options']);return _0x5f49f2[_0x507c('0x4b')](_0x33515c);}})[_0x507c('0x27')](function(_0x3bc14f){if(_0x3bc14f){_0x54edcf=_0x3bc14f[_0x507c('0x37')];if(!_0x170b96[_0x507c('0x35')][_0x507c('0x4e')](_0x507c('0x38'))){_0x33515c['limit']=qs[_0x507c('0x1e')](_0x170b96['query'][_0x507c('0x1e')]);_0x33515c['offset']=qs['offset'](_0x170b96['query'][_0x507c('0x1c')]);}return _0x5f49f2[_0x507c('0x4b')](_0x33515c);}})[_0x507c('0x27')](function(_0x349862){if(_0x349862){return _0x349862?{'count':_0x54edcf,'rows':_0x349862}:null;}})['then'](respondWithResult(_0x4be9d6,null))[_0x507c('0x43')](handleError(_0x4be9d6,null));};exports['getSubjects']=function(_0x3304b2,_0x3c058f,_0x26efcf){var _0x44494a={};var _0x144065={};var _0x278e45;var _0x4535fa;return db[_0x507c('0x2d')][_0x507c('0x4c')]({'where':{'id':_0x3304b2[_0x507c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c058f,null))[_0x507c('0x27')](function(_0x5a9b8c){if(_0x5a9b8c){_0x278e45=_0x5a9b8c;_0x144065['model']=_[_0x507c('0x45')](db[_0x507c('0x4d')][_0x507c('0x46')]);_0x144065[_0x507c('0x35')]=_[_0x507c('0x45')](_0x3304b2['query']);_0x144065['filters']=_['intersection'](_0x144065[_0x507c('0x30')],_0x144065['query']);_0x44494a[_0x507c('0x36')]=_[_0x507c('0x33')](_0x144065[_0x507c('0x30')],qs[_0x507c('0x34')](_0x3304b2[_0x507c('0x35')][_0x507c('0x34')]));_0x44494a[_0x507c('0x36')]=_0x44494a[_0x507c('0x36')]['length']?_0x44494a[_0x507c('0x36')]:_0x144065[_0x507c('0x30')];_0x44494a['order']=qs[_0x507c('0x3a')](_0x3304b2[_0x507c('0x35')][_0x507c('0x3a')]);_0x44494a[_0x507c('0x3b')]=qs[_0x507c('0x32')](_['pick'](_0x3304b2['query'],_0x144065[_0x507c('0x32')]));if(_0x3304b2[_0x507c('0x35')][_0x507c('0x3e')]){_0x44494a['where']=_[_0x507c('0x3d')](_0x44494a[_0x507c('0x3b')],{'$or':_[_0x507c('0x31')](_0x44494a[_0x507c('0x36')],function(_0x246126){var _0x220f2d={};_0x220f2d[_0x246126]={'$like':'%'+_0x3304b2[_0x507c('0x35')][_0x507c('0x3e')]+'%'};return _0x220f2d;})});}_0x44494a=_[_0x507c('0x3d')]({},_0x44494a,_0x3304b2[_0x507c('0x3f')]);return _0x278e45[_0x507c('0x4f')](_0x44494a);}})['then'](function(_0x3d2d17){if(_0x3d2d17){_0x4535fa=_0x3d2d17[_0x507c('0x37')];if(!_0x3304b2['query'][_0x507c('0x4e')](_0x507c('0x38'))){_0x44494a[_0x507c('0x1e')]=qs['limit'](_0x3304b2[_0x507c('0x35')][_0x507c('0x1e')]);_0x44494a[_0x507c('0x1c')]=qs[_0x507c('0x1c')](_0x3304b2[_0x507c('0x35')][_0x507c('0x1c')]);}return _0x278e45[_0x507c('0x4f')](_0x44494a);}})[_0x507c('0x27')](function(_0x14880a){if(_0x14880a){return _0x14880a?{'count':_0x4535fa,'rows':_0x14880a}:null;}})[_0x507c('0x27')](respondWithResult(_0x3c058f,null))[_0x507c('0x43')](handleError(_0x3c058f,null));};exports['getDescriptions']=function(_0x4fc37f,_0xf8159a,_0x54b38f){var _0x2ce4cf={};var _0x31971b={};var _0x397d93;var _0x561418;return db['SugarcrmConfiguration'][_0x507c('0x4c')]({'where':{'id':_0x4fc37f[_0x507c('0x4a')]['id']}})[_0x507c('0x27')](handleEntityNotFound(_0xf8159a,null))[_0x507c('0x27')](function(_0x490a4a){if(_0x490a4a){_0x397d93=_0x490a4a;_0x31971b[_0x507c('0x30')]=_[_0x507c('0x45')](db[_0x507c('0x4d')]['rawAttributes']);_0x31971b[_0x507c('0x35')]=_['keys'](_0x4fc37f['query']);_0x31971b[_0x507c('0x32')]=_['intersection'](_0x31971b[_0x507c('0x30')],_0x31971b['query']);_0x2ce4cf['attributes']=_['intersection'](_0x31971b[_0x507c('0x30')],qs[_0x507c('0x34')](_0x4fc37f[_0x507c('0x35')]['fields']));_0x2ce4cf[_0x507c('0x36')]=_0x2ce4cf['attributes']['length']?_0x2ce4cf['attributes']:_0x31971b[_0x507c('0x30')];_0x2ce4cf[_0x507c('0x39')]=qs[_0x507c('0x3a')](_0x4fc37f[_0x507c('0x35')][_0x507c('0x3a')]);_0x2ce4cf[_0x507c('0x3b')]=qs[_0x507c('0x32')](_[_0x507c('0x3c')](_0x4fc37f[_0x507c('0x35')],_0x31971b[_0x507c('0x32')]));if(_0x4fc37f[_0x507c('0x35')]['filter']){_0x2ce4cf[_0x507c('0x3b')]=_[_0x507c('0x3d')](_0x2ce4cf[_0x507c('0x3b')],{'$or':_[_0x507c('0x31')](_0x2ce4cf['attributes'],function(_0x2e9a9f){var _0x427c46={};_0x427c46[_0x2e9a9f]={'$like':'%'+_0x4fc37f[_0x507c('0x35')][_0x507c('0x3e')]+'%'};return _0x427c46;})});}_0x2ce4cf=_[_0x507c('0x3d')]({},_0x2ce4cf,_0x4fc37f[_0x507c('0x3f')]);return _0x397d93[_0x507c('0x50')](_0x2ce4cf);}})[_0x507c('0x27')](function(_0xea2d16){if(_0xea2d16){_0x561418=_0xea2d16[_0x507c('0x37')];if(!_0x4fc37f[_0x507c('0x35')][_0x507c('0x4e')](_0x507c('0x38'))){_0x2ce4cf[_0x507c('0x1e')]=qs[_0x507c('0x1e')](_0x4fc37f[_0x507c('0x35')][_0x507c('0x1e')]);_0x2ce4cf[_0x507c('0x1c')]=qs[_0x507c('0x1c')](_0x4fc37f[_0x507c('0x35')][_0x507c('0x1c')]);}return _0x397d93[_0x507c('0x50')](_0x2ce4cf);}})[_0x507c('0x27')](function(_0xdf0c2e){if(_0xdf0c2e){return _0xdf0c2e?{'count':_0x561418,'rows':_0xdf0c2e}:null;}})['then'](respondWithResult(_0xf8159a,null))['catch'](handleError(_0xf8159a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 15281d7..5693e55 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 _0xca55=['request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','bluebird'];(function(_0x52be8b,_0x53d732){var _0x3a2544=function(_0x26d9c5){while(--_0x26d9c5){_0x52be8b['push'](_0x52be8b['shift']());}};_0x3a2544(++_0x53d732);}(_0xca55,0x10a));var _0x5ca5=function(_0x25cf2a,_0x196f17){_0x25cf2a=_0x25cf2a-0x0;var _0x37fdf5=_0xca55[_0x25cf2a];return _0x37fdf5;};'use strict';var _=require(_0x5ca5('0x0'));var util=require(_0x5ca5('0x1'));var logger=require(_0x5ca5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ca5('0x3'));var rp=require(_0x5ca5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ca5('0x5'));var config=require(_0x5ca5('0x6'));var attributes=require(_0x5ca5('0x7'));module['exports']=function(_0x469c26,_0x4b9f7a){return _0x469c26['define'](_0x5ca5('0x8'),attributes,{'tableName':_0x5ca5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0798=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define'];(function(_0x206f81,_0x162277){var _0x2cf08f=function(_0x131532){while(--_0x131532){_0x206f81['push'](_0x206f81['shift']());}};_0x2cf08f(++_0x162277);}(_0x0798,0x157));var _0x8079=function(_0x4f6ae3,_0x255c4){_0x4f6ae3=_0x4f6ae3-0x0;var _0x956468=_0x0798[_0x4f6ae3];return _0x956468;};'use strict';var _=require(_0x8079('0x0'));var util=require('util');var logger=require(_0x8079('0x1'))(_0x8079('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8079('0x3'));var fs=require('fs');var path=require(_0x8079('0x4'));var rimraf=require(_0x8079('0x5'));var config=require(_0x8079('0x6'));var attributes=require(_0x8079('0x7'));module['exports']=function(_0x4454ec,_0x3bddce){return _0x4454ec[_0x8079('0x8')](_0x8079('0x9'),attributes,{'tableName':_0x8079('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index bacfcb4..36d9720 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 _0x40e3=['then','info','request\x20sent','debug','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0x40e3,0x1b4));var _0x340e=function(_0x3c2407,_0x3c9a47){_0x3c2407=_0x3c2407-0x0;var _0x5d2eac=_0x40e3[_0x3c2407];return _0x5d2eac;};'use strict';var _=require(_0x340e('0x0'));var util=require('util');var moment=require(_0x340e('0x1'));var BPromise=require(_0x340e('0x2'));var rs=require(_0x340e('0x3'));var fs=require('fs');var Redis=require(_0x340e('0x4'));var db=require(_0x340e('0x5'))['db'];var utils=require(_0x340e('0x6'));var logger=require(_0x340e('0x7'))(_0x340e('0x8'));var config=require(_0x340e('0x9'));var jayson=require(_0x340e('0xa'));var client=jayson[_0x340e('0xb')][_0x340e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1456bf,_0x4c66ae,_0x4a8f86){return new BPromise(function(_0x24e0d3,_0x1664df){return client[_0x340e('0xd')](_0x1456bf,_0x4a8f86)[_0x340e('0xe')](function(_0x3f7ebc){logger[_0x340e('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c66ae,_0x340e('0x10'));logger[_0x340e('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4c66ae,'request\x20sent',JSON[_0x340e('0x12')](_0x3f7ebc));if(_0x3f7ebc[_0x340e('0x13')]){if(_0x3f7ebc[_0x340e('0x13')][_0x340e('0x14')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c66ae,_0x3f7ebc[_0x340e('0x13')][_0x340e('0x15')]);return _0x1664df(_0x3f7ebc[_0x340e('0x13')][_0x340e('0x15')]);}logger[_0x340e('0x13')](_0x340e('0x16'),_0x4c66ae,_0x3f7ebc[_0x340e('0x13')][_0x340e('0x15')]);return _0x24e0d3(_0x3f7ebc[_0x340e('0x13')]['message']);}else{logger[_0x340e('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c66ae,'request\x20sent');_0x24e0d3(_0x3f7ebc[_0x340e('0x17')][_0x340e('0x15')]);}})[_0x340e('0x18')](function(_0x2f4509){logger[_0x340e('0x13')](_0x340e('0x16'),_0x4c66ae,_0x2f4509);_0x1664df(_0x2f4509);});});} \ No newline at end of file +var _0xf881=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x49c52e,_0x2fd41d){var _0x931127=function(_0x5b4081){while(--_0x5b4081){_0x49c52e['push'](_0x49c52e['shift']());}};_0x931127(++_0x2fd41d);}(_0xf881,0x15f));var _0x1f88=function(_0x2ad46a,_0x12a1bf){_0x2ad46a=_0x2ad46a-0x0;var _0x5cb601=_0xf881[_0x2ad46a];return _0x5cb601;};'use strict';var _=require(_0x1f88('0x0'));var util=require(_0x1f88('0x1'));var moment=require('moment');var BPromise=require(_0x1f88('0x2'));var rs=require(_0x1f88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f88('0x4'))['db'];var utils=require(_0x1f88('0x5'));var logger=require(_0x1f88('0x6'))(_0x1f88('0x7'));var config=require(_0x1f88('0x8'));var jayson=require(_0x1f88('0x9'));var client=jayson[_0x1f88('0xa')][_0x1f88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32a024,_0x4aa493,_0x4f18c5){return new BPromise(function(_0x459d03,_0x369bfe){return client[_0x1f88('0xc')](_0x32a024,_0x4f18c5)[_0x1f88('0xd')](function(_0x2fac80){logger[_0x1f88('0xe')](_0x1f88('0xf'),_0x4aa493,_0x1f88('0x10'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4aa493,'request\x20sent',JSON['stringify'](_0x2fac80));if(_0x2fac80['error']){if(_0x2fac80[_0x1f88('0x11')][_0x1f88('0x12')]===0x1f4){logger[_0x1f88('0x11')](_0x1f88('0xf'),_0x4aa493,_0x2fac80['error'][_0x1f88('0x13')]);return _0x369bfe(_0x2fac80[_0x1f88('0x11')]['message']);}logger[_0x1f88('0x11')](_0x1f88('0xf'),_0x4aa493,_0x2fac80['error']['message']);return _0x459d03(_0x2fac80[_0x1f88('0x11')][_0x1f88('0x13')]);}else{logger[_0x1f88('0xe')](_0x1f88('0xf'),_0x4aa493,_0x1f88('0x10'));_0x459d03(_0x2fac80[_0x1f88('0x14')]['message']);}})['catch'](function(_0x3f8ba0){logger[_0x1f88('0x11')](_0x1f88('0xf'),_0x4aa493,_0x3f8ba0);_0x369bfe(_0x3f8ba0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 67a8e7b..33302f4 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 _0x6b64=['put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x3610e6,_0x4da4fe){var _0xd42f01=function(_0x36e7e2){while(--_0x36e7e2){_0x3610e6['push'](_0x3610e6['shift']());}};_0xd42f01(++_0x4da4fe);}(_0x6b64,0x83));var _0x46b6=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x6b64[_0xd336fa];return _0x3370b1;};'use strict';var multer=require('multer');var util=require(_0x46b6('0x0'));var path=require('path');var timeout=require(_0x46b6('0x1'));var express=require(_0x46b6('0x2'));var router=express['Router']();var fs_extra=require(_0x46b6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x46b6('0x4'));var config=require(_0x46b6('0x5'));var controller=require(_0x46b6('0x6'));router[_0x46b6('0x7')]('/',auth['isAuthenticated'](),controller[_0x46b6('0x8')]);router[_0x46b6('0x7')](_0x46b6('0x9'),auth[_0x46b6('0xa')](),controller[_0x46b6('0xb')]);router[_0x46b6('0xc')]('/',auth[_0x46b6('0xa')](),controller['create']);router[_0x46b6('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x46b6('0xe')]);router[_0x46b6('0xf')](_0x46b6('0x9'),auth['isAuthenticated'](),controller[_0x46b6('0x10')]);module[_0x46b6('0x11')]=router; \ No newline at end of file +var _0x7247=['update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x53361f,_0x3b2cb6){var _0x279237=function(_0x317757){while(--_0x317757){_0x53361f['push'](_0x53361f['shift']());}};_0x279237(++_0x3b2cb6);}(_0x7247,0xbe));var _0x7724=function(_0x2ac2c0,_0x31df0f){_0x2ac2c0=_0x2ac2c0-0x0;var _0x1dde23=_0x7247[_0x2ac2c0];return _0x1dde23;};'use strict';var multer=require('multer');var util=require(_0x7724('0x0'));var path=require(_0x7724('0x1'));var timeout=require(_0x7724('0x2'));var express=require(_0x7724('0x3'));var router=express[_0x7724('0x4')]();var fs_extra=require(_0x7724('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7724('0x6'));router[_0x7724('0x7')]('/',auth[_0x7724('0x8')](),controller[_0x7724('0x9')]);router[_0x7724('0x7')](_0x7724('0xa'),auth[_0x7724('0x8')](),controller['show']);router[_0x7724('0xb')]('/',auth[_0x7724('0x8')](),controller[_0x7724('0xc')]);router[_0x7724('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x7724('0xe')]);router[_0x7724('0xf')](_0x7724('0xa'),auth[_0x7724('0x8')](),controller[_0x7724('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index ac2e130..14bdcf5 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 _0xcbaa=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x41abb4,_0x5861ee){var _0x51e2c2=function(_0x3d35ae){while(--_0x3d35ae){_0x41abb4['push'](_0x41abb4['shift']());}};_0x51e2c2(++_0x5861ee);}(_0xcbaa,0xfc));var _0xacba=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xcbaa[_0x284807];return _0x50c774;};'use strict';var Sequelize=require(_0xacba('0x0'));module[_0xacba('0x1')]={'type':{'type':Sequelize['ENUM'](_0xacba('0x2'),_0xacba('0x3'),_0xacba('0x4'),_0xacba('0x5'),_0xacba('0x6')),'defaultValue':_0xacba('0x2')},'content':{'type':Sequelize[_0xacba('0x7')]},'key':{'type':Sequelize[_0xacba('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xacba('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xacba('0x7')]},'idField':{'type':Sequelize[_0xacba('0x7')]},'nameField':{'type':Sequelize[_0xacba('0x7')]},'customField':{'type':Sequelize[_0xacba('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xacba('0x7')]}}; \ No newline at end of file +var _0x212c=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x17b8a9,_0x3bbf58){var _0x4add80=function(_0x683126){while(--_0x683126){_0x17b8a9['push'](_0x17b8a9['shift']());}};_0x4add80(++_0x3bbf58);}(_0x212c,0x11e));var _0xc212=function(_0x34421b,_0xdc7518){_0x34421b=_0x34421b-0x0;var _0x3739f7=_0x212c[_0x34421b];return _0x3739f7;};'use strict';var Sequelize=require(_0xc212('0x0'));module['exports']={'type':{'type':Sequelize[_0xc212('0x1')](_0xc212('0x2'),_0xc212('0x3'),_0xc212('0x4'),_0xc212('0x5'),_0xc212('0x6')),'defaultValue':_0xc212('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc212('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xc212('0x3'),_0xc212('0x4'))},'keyContent':{'type':Sequelize[_0xc212('0x7')]},'idField':{'type':Sequelize[_0xc212('0x7')]},'nameField':{'type':Sequelize[_0xc212('0x7')]},'customField':{'type':Sequelize[_0xc212('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc212('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 4da5550..f3fcc7e 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 _0x08f1=['filters','filter','merge','VIRTUAL','options','include','SugarcrmField','findAll','rows','show','keys','includeAll','find','catch','create','body','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','name','send','index','map','rawAttributes','type','query','model','attributes','intersection','fields','length','order','sort','where'];(function(_0x35082f,_0x57ea69){var _0x1ae051=function(_0x2c9737){while(--_0x2c9737){_0x35082f['push'](_0x35082f['shift']());}};_0x1ae051(++_0x57ea69);}(_0x08f1,0x1a3));var _0x108f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x08f1[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x108f('0x0'));var zipdir=require(_0x108f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x108f('0x2'));var moment=require(_0x108f('0x3'));var BPromise=require(_0x108f('0x4'));var Mustache=require(_0x108f('0x5'));var util=require('util');var path=require(_0x108f('0x6'));var sox=require('sox');var csv=require(_0x108f('0x7'));var ejs=require(_0x108f('0x8'));var fs=require('fs');var fs_extra=require(_0x108f('0x9'));var _=require(_0x108f('0xa'));var squel=require('squel');var crypto=require(_0x108f('0xb'));var jsforce=require(_0x108f('0xc'));var deskjs=require(_0x108f('0xd'));var toCsv=require(_0x108f('0x7'));var querystring=require(_0x108f('0xe'));var Papa=require(_0x108f('0xf'));var Redis=require(_0x108f('0x10'));var authService=require(_0x108f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x108f('0x12'));var hardwareService=require(_0x108f('0x13'));var logger=require(_0x108f('0x14'))(_0x108f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x108f('0x16'))['db'];function respondWithStatusCode(_0x5d51dc,_0x358297){_0x358297=_0x358297||0xcc;return function(_0x431269){if(_0x431269){return _0x5d51dc['sendStatus'](_0x358297);}return _0x5d51dc[_0x108f('0x17')](_0x358297)[_0x108f('0x18')]();};}function respondWithResult(_0x290fa4,_0x2a44f8){_0x2a44f8=_0x2a44f8||0xc8;return function(_0x17b4c5){if(_0x17b4c5){return _0x290fa4[_0x108f('0x17')](_0x2a44f8)[_0x108f('0x19')](_0x17b4c5);}};}function respondWithFilteredResult(_0x2dbdff,_0x169dd3){return function(_0x1a06d4){if(_0x1a06d4){var _0x5b7699=typeof _0x169dd3[_0x108f('0x1a')]==='undefined'&&typeof _0x169dd3[_0x108f('0x1b')]===_0x108f('0x1c');var _0x2d8bca=_0x1a06d4[_0x108f('0x1d')];var _0xe88c35=_0x5b7699?0x0:_0x169dd3[_0x108f('0x1a')];var _0xa53896=_0x5b7699?_0x1a06d4['count']:_0x169dd3[_0x108f('0x1a')]+_0x169dd3[_0x108f('0x1b')];var _0x59a39f;if(_0xa53896>=_0x2d8bca){_0xa53896=_0x2d8bca;_0x59a39f=0xc8;}else{_0x59a39f=0xce;}_0x2dbdff[_0x108f('0x17')](_0x59a39f);return _0x2dbdff['set'](_0x108f('0x1e'),_0xe88c35+'-'+_0xa53896+'/'+_0x2d8bca)['json'](_0x1a06d4);}return null;};}function patchUpdates(_0x3cf8d4){return function(_0x38cd4c){try{jsonpatch[_0x108f('0x1f')](_0x38cd4c,_0x3cf8d4,!![]);}catch(_0x396da3){return BPromise[_0x108f('0x20')](_0x396da3);}return _0x38cd4c['save']();};}function saveUpdates(_0x2a83c6,_0x2ace46){return function(_0x1213ea){if(_0x1213ea){return _0x1213ea['update'](_0x2a83c6)[_0x108f('0x21')](function(_0x4f7a07){return _0x4f7a07;});}return null;};}function removeEntity(_0xa305c0,_0x23760c){return function(_0xce9a1d){if(_0xce9a1d){return _0xce9a1d[_0x108f('0x22')]()[_0x108f('0x21')](function(){_0xa305c0[_0x108f('0x17')](0xcc)[_0x108f('0x18')]();});}};}function handleEntityNotFound(_0x5d8c8a,_0x1b8bb2){return function(_0x39e589){if(!_0x39e589){_0x5d8c8a['sendStatus'](0x194);}return _0x39e589;};}function handleError(_0x54bff2,_0x13a620){_0x13a620=_0x13a620||0x1f4;return function(_0x28b5d4){logger['error'](_0x28b5d4['stack']);if(_0x28b5d4[_0x108f('0x23')]){delete _0x28b5d4[_0x108f('0x23')];}_0x54bff2[_0x108f('0x17')](_0x13a620)[_0x108f('0x24')](_0x28b5d4);};}exports[_0x108f('0x25')]=function(_0x2a2384,_0x3cbf1d){var _0x1c7077={},_0x189dcc={},_0x5cea56={'count':0x0,'rows':[]};var _0x3d2ced=_[_0x108f('0x26')](db['SugarcrmField'][_0x108f('0x27')],function(_0x5ad7c6){return{'name':_0x5ad7c6['fieldName'],'type':_0x5ad7c6[_0x108f('0x28')]['key']};});_0x189dcc['model']=_[_0x108f('0x26')](_0x3d2ced,_0x108f('0x23'));_0x189dcc[_0x108f('0x29')]=_['keys'](_0x2a2384['query']);_0x189dcc['filters']=_['intersection'](_0x189dcc[_0x108f('0x2a')],_0x189dcc[_0x108f('0x29')]);_0x1c7077[_0x108f('0x2b')]=_[_0x108f('0x2c')](_0x189dcc['model'],qs[_0x108f('0x2d')](_0x2a2384['query']['fields']));_0x1c7077[_0x108f('0x2b')]=_0x1c7077[_0x108f('0x2b')][_0x108f('0x2e')]?_0x1c7077[_0x108f('0x2b')]:_0x189dcc[_0x108f('0x2a')];if(!_0x2a2384[_0x108f('0x29')]['hasOwnProperty']('nolimit')){_0x1c7077[_0x108f('0x1b')]=qs['limit'](_0x2a2384[_0x108f('0x29')][_0x108f('0x1b')]);_0x1c7077[_0x108f('0x1a')]=qs[_0x108f('0x1a')](_0x2a2384[_0x108f('0x29')][_0x108f('0x1a')]);}_0x1c7077[_0x108f('0x2f')]=qs[_0x108f('0x30')](_0x2a2384['query'][_0x108f('0x30')]);_0x1c7077[_0x108f('0x31')]=qs['filters'](_['pick'](_0x2a2384['query'],_0x189dcc[_0x108f('0x32')]),_0x3d2ced);if(_0x2a2384['query'][_0x108f('0x33')]){_0x1c7077[_0x108f('0x31')]=_[_0x108f('0x34')](_0x1c7077[_0x108f('0x31')],{'$or':_[_0x108f('0x26')](_0x3d2ced,function(_0x4e975d){if(_0x4e975d[_0x108f('0x28')]!==_0x108f('0x35')){var _0x3fd6d4={};_0x3fd6d4[_0x4e975d[_0x108f('0x23')]]={'$like':'%'+_0x2a2384[_0x108f('0x29')][_0x108f('0x33')]+'%'};return _0x3fd6d4;}})});}_0x1c7077=_[_0x108f('0x34')]({},_0x1c7077,_0x2a2384[_0x108f('0x36')]);var _0x2e340c={'where':_0x1c7077[_0x108f('0x31')]};return db['SugarcrmField'][_0x108f('0x1d')](_0x2e340c)[_0x108f('0x21')](function(_0x3bdada){_0x5cea56['count']=_0x3bdada;if(_0x2a2384[_0x108f('0x29')]['includeAll']){_0x1c7077[_0x108f('0x37')]=[{'all':!![]}];}return db[_0x108f('0x38')][_0x108f('0x39')](_0x1c7077);})[_0x108f('0x21')](function(_0x54e0f7){_0x5cea56[_0x108f('0x3a')]=_0x54e0f7;return _0x5cea56;})[_0x108f('0x21')](respondWithFilteredResult(_0x3cbf1d,_0x1c7077))['catch'](handleError(_0x3cbf1d,null));};exports[_0x108f('0x3b')]=function(_0x52d108,_0x553328){var _0x179b3e={'raw':!![],'where':{'id':_0x52d108['params']['id']}},_0x5dea67={};_0x5dea67[_0x108f('0x2a')]=_[_0x108f('0x3c')](db[_0x108f('0x38')][_0x108f('0x27')]);_0x5dea67[_0x108f('0x29')]=_[_0x108f('0x3c')](_0x52d108[_0x108f('0x29')]);_0x5dea67[_0x108f('0x32')]=_[_0x108f('0x2c')](_0x5dea67['model'],_0x5dea67[_0x108f('0x29')]);_0x179b3e[_0x108f('0x2b')]=_[_0x108f('0x2c')](_0x5dea67[_0x108f('0x2a')],qs[_0x108f('0x2d')](_0x52d108[_0x108f('0x29')][_0x108f('0x2d')]));_0x179b3e[_0x108f('0x2b')]=_0x179b3e[_0x108f('0x2b')][_0x108f('0x2e')]?_0x179b3e['attributes']:_0x5dea67[_0x108f('0x2a')];if(_0x52d108[_0x108f('0x29')][_0x108f('0x3d')]){_0x179b3e[_0x108f('0x37')]=[{'all':!![]}];}_0x179b3e=_[_0x108f('0x34')]({},_0x179b3e,_0x52d108[_0x108f('0x36')]);return db[_0x108f('0x38')][_0x108f('0x3e')](_0x179b3e)[_0x108f('0x21')](handleEntityNotFound(_0x553328,null))[_0x108f('0x21')](respondWithResult(_0x553328,null))[_0x108f('0x3f')](handleError(_0x553328,null));};exports[_0x108f('0x40')]=function(_0x1c919e,_0x589df4){return db[_0x108f('0x38')][_0x108f('0x40')](_0x1c919e[_0x108f('0x41')],{})['then'](respondWithResult(_0x589df4,0xc9))[_0x108f('0x3f')](handleError(_0x589df4,null));};exports['update']=function(_0x4eec33,_0x1867f8){if(_0x4eec33[_0x108f('0x41')]['id']){delete _0x4eec33[_0x108f('0x41')]['id'];}return db[_0x108f('0x38')]['find']({'where':{'id':_0x4eec33[_0x108f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1867f8,null))['then'](saveUpdates(_0x4eec33[_0x108f('0x41')],null))[_0x108f('0x21')](respondWithResult(_0x1867f8,null))[_0x108f('0x3f')](handleError(_0x1867f8,null));};exports[_0x108f('0x22')]=function(_0x2c8081,_0x27da92){return db[_0x108f('0x38')]['find']({'where':{'id':_0x2c8081[_0x108f('0x42')]['id']}})[_0x108f('0x21')](handleEntityNotFound(_0x27da92,null))[_0x108f('0x21')](removeEntity(_0x27da92,null))[_0x108f('0x3f')](handleError(_0x27da92,null));}; \ No newline at end of file +var _0xd056=['SugarcrmField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','update','rimraf','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','map'];(function(_0x10fa35,_0xaa46df){var _0x346d5d=function(_0x44a8cc){while(--_0x44a8cc){_0x10fa35['push'](_0x10fa35['shift']());}};_0x346d5d(++_0xaa46df);}(_0xd056,0xbf));var _0x6d05=function(_0xc73c7,_0x3e2230){_0xc73c7=_0xc73c7-0x0;var _0x2ba067=_0xd056[_0xc73c7];return _0x2ba067;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d05('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d05('0x1'));var rp=require(_0x6d05('0x2'));var moment=require(_0x6d05('0x3'));var BPromise=require(_0x6d05('0x4'));var Mustache=require(_0x6d05('0x5'));var util=require('util');var path=require(_0x6d05('0x6'));var sox=require(_0x6d05('0x7'));var csv=require(_0x6d05('0x8'));var ejs=require(_0x6d05('0x9'));var fs=require('fs');var fs_extra=require(_0x6d05('0xa'));var _=require(_0x6d05('0xb'));var squel=require(_0x6d05('0xc'));var crypto=require(_0x6d05('0xd'));var jsforce=require(_0x6d05('0xe'));var deskjs=require(_0x6d05('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6d05('0x10'));var Papa=require(_0x6d05('0x11'));var Redis=require(_0x6d05('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6d05('0x13'));var hardwareService=require(_0x6d05('0x14'));var logger=require(_0x6d05('0x15'))(_0x6d05('0x16'));var utils=require(_0x6d05('0x17'));var config=require(_0x6d05('0x18'));var licenseUtil=require(_0x6d05('0x19'));var db=require(_0x6d05('0x1a'))['db'];function respondWithStatusCode(_0x3b1ac0,_0x50724b){_0x50724b=_0x50724b||0xcc;return function(_0x8ec8cf){if(_0x8ec8cf){return _0x3b1ac0[_0x6d05('0x1b')](_0x50724b);}return _0x3b1ac0['status'](_0x50724b)['end']();};}function respondWithResult(_0x5856a3,_0x255e96){_0x255e96=_0x255e96||0xc8;return function(_0x234f60){if(_0x234f60){return _0x5856a3[_0x6d05('0x1c')](_0x255e96)['json'](_0x234f60);}};}function respondWithFilteredResult(_0x37a1f7,_0x2ff19e){return function(_0x2d1bb8){if(_0x2d1bb8){var _0x42e0ff=typeof _0x2ff19e[_0x6d05('0x1d')]==='undefined'&&typeof _0x2ff19e[_0x6d05('0x1e')]===_0x6d05('0x1f');var _0x200f7b=_0x2d1bb8[_0x6d05('0x20')];var _0x10fb9b=_0x42e0ff?0x0:_0x2ff19e['offset'];var _0x1cb516=_0x42e0ff?_0x2d1bb8[_0x6d05('0x20')]:_0x2ff19e[_0x6d05('0x1d')]+_0x2ff19e['limit'];var _0x194306;if(_0x1cb516>=_0x200f7b){_0x1cb516=_0x200f7b;_0x194306=0xc8;}else{_0x194306=0xce;}_0x37a1f7[_0x6d05('0x1c')](_0x194306);return _0x37a1f7[_0x6d05('0x21')]('Content-Range',_0x10fb9b+'-'+_0x1cb516+'/'+_0x200f7b)[_0x6d05('0x22')](_0x2d1bb8);}return null;};}function patchUpdates(_0x572417){return function(_0x8fec5d){try{jsonpatch[_0x6d05('0x23')](_0x8fec5d,_0x572417,!![]);}catch(_0x1c1543){return BPromise[_0x6d05('0x24')](_0x1c1543);}return _0x8fec5d[_0x6d05('0x25')]();};}function saveUpdates(_0x24f3b3,_0x528e07){return function(_0x4d415b){if(_0x4d415b){return _0x4d415b['update'](_0x24f3b3)[_0x6d05('0x26')](function(_0x4666f9){return _0x4666f9;});}return null;};}function removeEntity(_0x1f48c0,_0xd94c83){return function(_0x139b1a){if(_0x139b1a){return _0x139b1a[_0x6d05('0x27')]()['then'](function(){_0x1f48c0[_0x6d05('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd55f,_0x5b07cb){return function(_0x47cc54){if(!_0x47cc54){_0x1fd55f['sendStatus'](0x194);}return _0x47cc54;};}function handleError(_0x1e2b69,_0x4ace83){_0x4ace83=_0x4ace83||0x1f4;return function(_0x1d5266){logger[_0x6d05('0x28')](_0x1d5266[_0x6d05('0x29')]);if(_0x1d5266[_0x6d05('0x2a')]){delete _0x1d5266[_0x6d05('0x2a')];}_0x1e2b69[_0x6d05('0x1c')](_0x4ace83)[_0x6d05('0x2b')](_0x1d5266);};}exports[_0x6d05('0x2c')]=function(_0x3d9566,_0x3b7c49){var _0x4f50d4={},_0x245b83={},_0x5e4a3c={'count':0x0,'rows':[]};var _0x2cebc5=_[_0x6d05('0x2d')](db[_0x6d05('0x2e')][_0x6d05('0x2f')],function(_0x1ba3fe){return{'name':_0x1ba3fe[_0x6d05('0x30')],'type':_0x1ba3fe['type'][_0x6d05('0x31')]};});_0x245b83['model']=_['map'](_0x2cebc5,_0x6d05('0x2a'));_0x245b83[_0x6d05('0x32')]=_[_0x6d05('0x33')](_0x3d9566[_0x6d05('0x32')]);_0x245b83[_0x6d05('0x34')]=_[_0x6d05('0x35')](_0x245b83[_0x6d05('0x36')],_0x245b83[_0x6d05('0x32')]);_0x4f50d4[_0x6d05('0x37')]=_['intersection'](_0x245b83[_0x6d05('0x36')],qs[_0x6d05('0x38')](_0x3d9566[_0x6d05('0x32')][_0x6d05('0x38')]));_0x4f50d4[_0x6d05('0x37')]=_0x4f50d4[_0x6d05('0x37')][_0x6d05('0x39')]?_0x4f50d4['attributes']:_0x245b83[_0x6d05('0x36')];if(!_0x3d9566[_0x6d05('0x32')][_0x6d05('0x3a')](_0x6d05('0x3b'))){_0x4f50d4[_0x6d05('0x1e')]=qs[_0x6d05('0x1e')](_0x3d9566[_0x6d05('0x32')][_0x6d05('0x1e')]);_0x4f50d4[_0x6d05('0x1d')]=qs[_0x6d05('0x1d')](_0x3d9566[_0x6d05('0x32')][_0x6d05('0x1d')]);}_0x4f50d4[_0x6d05('0x3c')]=qs[_0x6d05('0x3d')](_0x3d9566[_0x6d05('0x32')][_0x6d05('0x3d')]);_0x4f50d4['where']=qs[_0x6d05('0x34')](_[_0x6d05('0x3e')](_0x3d9566[_0x6d05('0x32')],_0x245b83[_0x6d05('0x34')]),_0x2cebc5);if(_0x3d9566['query'][_0x6d05('0x3f')]){_0x4f50d4[_0x6d05('0x40')]=_[_0x6d05('0x41')](_0x4f50d4[_0x6d05('0x40')],{'$or':_[_0x6d05('0x2d')](_0x2cebc5,function(_0x4b9361){if(_0x4b9361[_0x6d05('0x42')]!==_0x6d05('0x43')){var _0x3be9cb={};_0x3be9cb[_0x4b9361[_0x6d05('0x2a')]]={'$like':'%'+_0x3d9566['query']['filter']+'%'};return _0x3be9cb;}})});}_0x4f50d4=_[_0x6d05('0x41')]({},_0x4f50d4,_0x3d9566['options']);var _0x3b6081={'where':_0x4f50d4[_0x6d05('0x40')]};return db[_0x6d05('0x2e')]['count'](_0x3b6081)[_0x6d05('0x26')](function(_0x147cb0){_0x5e4a3c[_0x6d05('0x20')]=_0x147cb0;if(_0x3d9566[_0x6d05('0x32')][_0x6d05('0x44')]){_0x4f50d4[_0x6d05('0x45')]=[{'all':!![]}];}return db[_0x6d05('0x2e')]['findAll'](_0x4f50d4);})[_0x6d05('0x26')](function(_0x1e13df){_0x5e4a3c[_0x6d05('0x46')]=_0x1e13df;return _0x5e4a3c;})[_0x6d05('0x26')](respondWithFilteredResult(_0x3b7c49,_0x4f50d4))[_0x6d05('0x47')](handleError(_0x3b7c49,null));};exports[_0x6d05('0x48')]=function(_0x51dfc1,_0x529b61){var _0x232bba={'raw':!![],'where':{'id':_0x51dfc1[_0x6d05('0x49')]['id']}},_0x411b41={};_0x411b41['model']=_['keys'](db[_0x6d05('0x2e')][_0x6d05('0x2f')]);_0x411b41[_0x6d05('0x32')]=_[_0x6d05('0x33')](_0x51dfc1[_0x6d05('0x32')]);_0x411b41[_0x6d05('0x34')]=_[_0x6d05('0x35')](_0x411b41[_0x6d05('0x36')],_0x411b41[_0x6d05('0x32')]);_0x232bba[_0x6d05('0x37')]=_['intersection'](_0x411b41[_0x6d05('0x36')],qs[_0x6d05('0x38')](_0x51dfc1[_0x6d05('0x32')][_0x6d05('0x38')]));_0x232bba[_0x6d05('0x37')]=_0x232bba['attributes'][_0x6d05('0x39')]?_0x232bba[_0x6d05('0x37')]:_0x411b41[_0x6d05('0x36')];if(_0x51dfc1[_0x6d05('0x32')][_0x6d05('0x44')]){_0x232bba[_0x6d05('0x45')]=[{'all':!![]}];}_0x232bba=_[_0x6d05('0x41')]({},_0x232bba,_0x51dfc1[_0x6d05('0x4a')]);return db['SugarcrmField'][_0x6d05('0x4b')](_0x232bba)[_0x6d05('0x26')](handleEntityNotFound(_0x529b61,null))[_0x6d05('0x26')](respondWithResult(_0x529b61,null))[_0x6d05('0x47')](handleError(_0x529b61,null));};exports[_0x6d05('0x4c')]=function(_0x5690c5,_0x5d8787){return db[_0x6d05('0x2e')]['create'](_0x5690c5[_0x6d05('0x4d')],{})[_0x6d05('0x26')](respondWithResult(_0x5d8787,0xc9))[_0x6d05('0x47')](handleError(_0x5d8787,null));};exports[_0x6d05('0x4e')]=function(_0xac405d,_0x1c8804){if(_0xac405d[_0x6d05('0x4d')]['id']){delete _0xac405d[_0x6d05('0x4d')]['id'];}return db[_0x6d05('0x2e')][_0x6d05('0x4b')]({'where':{'id':_0xac405d[_0x6d05('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c8804,null))[_0x6d05('0x26')](saveUpdates(_0xac405d[_0x6d05('0x4d')],null))[_0x6d05('0x26')](respondWithResult(_0x1c8804,null))[_0x6d05('0x47')](handleError(_0x1c8804,null));};exports['destroy']=function(_0x47f863,_0x77beb5){return db[_0x6d05('0x2e')][_0x6d05('0x4b')]({'where':{'id':_0x47f863[_0x6d05('0x49')]['id']}})[_0x6d05('0x26')](handleEntityNotFound(_0x77beb5,null))[_0x6d05('0x26')](removeEntity(_0x77beb5,null))[_0x6d05('0x47')](handleError(_0x77beb5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index b14d112..cb80b18 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 _0xcc0c=['api','bluebird','request-promise','rimraf','./intSugarcrmField.attributes','exports','SugarcrmField','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x19c522,_0x2ca7a5){var _0x501c23=function(_0x3e7597){while(--_0x3e7597){_0x19c522['push'](_0x19c522['shift']());}};_0x501c23(++_0x2ca7a5);}(_0xcc0c,0x1b9));var _0xccc0=function(_0x128607,_0x242e5f){_0x128607=_0x128607-0x0;var _0x4ba37b=_0xcc0c[_0x128607];return _0x4ba37b;};'use strict';var _=require(_0xccc0('0x0'));var util=require(_0xccc0('0x1'));var logger=require(_0xccc0('0x2'))(_0xccc0('0x3'));var moment=require('moment');var BPromise=require(_0xccc0('0x4'));var rp=require(_0xccc0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccc0('0x6'));var config=require('../../config/environment');var attributes=require(_0xccc0('0x7'));module[_0xccc0('0x8')]=function(_0x1e6e53,_0x2e4e54){return _0x1e6e53['define'](_0xccc0('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xccc0('0xa'),'fields':['idField',_0xccc0('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x26f0=['./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4edb36,_0x21ae6c){var _0x26fdd1=function(_0x2ef7a0){while(--_0x2ef7a0){_0x4edb36['push'](_0x4edb36['shift']());}};_0x26fdd1(++_0x21ae6c);}(_0x26f0,0x115));var _0x026f=function(_0x4153e6,_0x28392b){_0x4153e6=_0x4153e6-0x0;var _0x565a44=_0x26f0[_0x4153e6];return _0x565a44;};'use strict';var _=require(_0x026f('0x0'));var util=require('util');var logger=require(_0x026f('0x1'))('api');var moment=require(_0x026f('0x2'));var BPromise=require(_0x026f('0x3'));var rp=require(_0x026f('0x4'));var fs=require('fs');var path=require(_0x026f('0x5'));var rimraf=require(_0x026f('0x6'));var config=require(_0x026f('0x7'));var attributes=require(_0x026f('0x8'));module[_0x026f('0x9')]=function(_0x388130,_0x12542b){return _0x388130[_0x026f('0xa')](_0x026f('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x026f('0xc'),'fields':[_0x026f('0xd'),_0x026f('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 7992956..1606092 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 _0xd71e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x196c91,_0x109805){var _0x11e311=function(_0x1d8524){while(--_0x1d8524){_0x196c91['push'](_0x196c91['shift']());}};_0x11e311(++_0x109805);}(_0xd71e,0xbb));var _0xed71=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0xd71e[_0x1a7550];return _0x426e22;};'use strict';var _=require(_0xed71('0x0'));var util=require('util');var moment=require(_0xed71('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed71('0x2'));var db=require(_0xed71('0x3'))['db'];var utils=require(_0xed71('0x4'));var logger=require(_0xed71('0x5'))('rpc');var config=require(_0xed71('0x6'));var jayson=require(_0xed71('0x7'));var client=jayson[_0xed71('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x571a89,_0x7f47f3,_0x8f3f45){return new BPromise(function(_0x452dd9,_0x11043c){return client['request'](_0x571a89,_0x8f3f45)[_0xed71('0x9')](function(_0x32e360){logger[_0xed71('0xa')](_0xed71('0xb'),_0x7f47f3,_0xed71('0xc'));logger[_0xed71('0xd')](_0xed71('0xe'),_0x7f47f3,'request\x20sent',JSON[_0xed71('0xf')](_0x32e360));if(_0x32e360[_0xed71('0x10')]){if(_0x32e360[_0xed71('0x10')][_0xed71('0x11')]===0x1f4){logger[_0xed71('0x10')](_0xed71('0xb'),_0x7f47f3,_0x32e360[_0xed71('0x10')][_0xed71('0x12')]);return _0x11043c(_0x32e360[_0xed71('0x10')][_0xed71('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x7f47f3,_0x32e360[_0xed71('0x10')]['message']);return _0x452dd9(_0x32e360[_0xed71('0x10')][_0xed71('0x12')]);}else{logger[_0xed71('0xa')](_0xed71('0xb'),_0x7f47f3,_0xed71('0xc'));_0x452dd9(_0x32e360[_0xed71('0x13')][_0xed71('0x12')]);}})[_0xed71('0x14')](function(_0x19302c){logger[_0xed71('0x10')](_0xed71('0xb'),_0x7f47f3,_0x19302c);_0x11043c(_0x19302c);});});} \ No newline at end of file +var _0xcfb4=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','code','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfb4,0xbc));var _0x4cfb=function(_0x3a7d21,_0x389323){_0x3a7d21=_0x3a7d21-0x0;var _0x1adcca=_0xcfb4[_0x3a7d21];return _0x1adcca;};'use strict';var _=require(_0x4cfb('0x0'));var util=require(_0x4cfb('0x1'));var moment=require(_0x4cfb('0x2'));var BPromise=require(_0x4cfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4cfb('0x4'))['db'];var utils=require(_0x4cfb('0x5'));var logger=require(_0x4cfb('0x6'))(_0x4cfb('0x7'));var config=require(_0x4cfb('0x8'));var jayson=require(_0x4cfb('0x9'));var client=jayson[_0x4cfb('0xa')][_0x4cfb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b2889,_0x1f8cef,_0x448387){return new BPromise(function(_0x59fd71,_0x4902af){return client['request'](_0x4b2889,_0x448387)[_0x4cfb('0xc')](function(_0x53f043){logger[_0x4cfb('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x1f8cef,_0x4cfb('0xe'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1f8cef,'request\x20sent',JSON['stringify'](_0x53f043));if(_0x53f043[_0x4cfb('0xf')]){if(_0x53f043[_0x4cfb('0xf')][_0x4cfb('0x10')]===0x1f4){logger[_0x4cfb('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x1f8cef,_0x53f043['error'][_0x4cfb('0x11')]);return _0x4902af(_0x53f043[_0x4cfb('0xf')][_0x4cfb('0x11')]);}logger['error'](_0x4cfb('0x12'),_0x1f8cef,_0x53f043[_0x4cfb('0xf')][_0x4cfb('0x11')]);return _0x59fd71(_0x53f043[_0x4cfb('0xf')][_0x4cfb('0x11')]);}else{logger['info'](_0x4cfb('0x12'),_0x1f8cef,_0x4cfb('0xe'));_0x59fd71(_0x53f043[_0x4cfb('0x13')]['message']);}})[_0x4cfb('0x14')](function(_0x4c99e9){logger[_0x4cfb('0xf')](_0x4cfb('0x12'),_0x1f8cef,_0x4c99e9);_0x4902af(_0x4c99e9);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 027b722..a5fa757 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 _0x542b=['put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','create','addConfiguration'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0x542b,0xec));var _0xb542=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x542b[_0xbb14db];return _0x36bed7;};'use strict';var multer=require(_0xb542('0x0'));var util=require(_0xb542('0x1'));var path=require('path');var timeout=require(_0xb542('0x2'));var express=require(_0xb542('0x3'));var router=express[_0xb542('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb542('0x5'));var interaction=require(_0xb542('0x6'));var config=require('../../config/environment');var controller=require(_0xb542('0x7'));router['get']('/',auth[_0xb542('0x8')](),controller[_0xb542('0x9')]);router[_0xb542('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb542('0xb')]);router[_0xb542('0xa')]('/:id/configurations',auth[_0xb542('0x8')](),controller[_0xb542('0xc')]);router[_0xb542('0xa')](_0xb542('0xd'),auth[_0xb542('0x8')](),controller['getFields']);router['post']('/',auth[_0xb542('0x8')](),controller[_0xb542('0xe')]);router['post']('/:id/configurations',auth[_0xb542('0x8')](),controller[_0xb542('0xf')]);router[_0xb542('0x10')](_0xb542('0x11'),auth[_0xb542('0x8')](),controller['update']);router[_0xb542('0x12')]('/:id',auth[_0xb542('0x8')](),controller[_0xb542('0x13')]);module[_0xb542('0x14')]=router; \ No newline at end of file +var _0xccc9=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete'];(function(_0x4d900b,_0x3c793f){var _0x166220=function(_0x4b07b0){while(--_0x4b07b0){_0x4d900b['push'](_0x4d900b['shift']());}};_0x166220(++_0x3c793f);}(_0xccc9,0xf4));var _0x9ccc=function(_0x496786,_0x5d198b){_0x496786=_0x496786-0x0;var _0x261b49=_0xccc9[_0x496786];return _0x261b49;};'use strict';var multer=require(_0x9ccc('0x0'));var util=require(_0x9ccc('0x1'));var path=require(_0x9ccc('0x2'));var timeout=require(_0x9ccc('0x3'));var express=require('express');var router=express[_0x9ccc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ccc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ccc('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x9ccc('0x7')]('/',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x9')]);router[_0x9ccc('0x7')](_0x9ccc('0xa'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xb')]);router[_0x9ccc('0x7')](_0x9ccc('0xc'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xd')]);router[_0x9ccc('0x7')]('/:id/fields',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xe')]);router[_0x9ccc('0xf')]('/',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x10')]);router[_0x9ccc('0xf')](_0x9ccc('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9ccc('0x11')](_0x9ccc('0xa'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x12')]);router[_0x9ccc('0x13')](_0x9ccc('0xa'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x14')]);module[_0x9ccc('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 04cfbab..e2b464b 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 _0x01af=['STRING','sequelize','exports'];(function(_0x349c0a,_0x35383b){var _0x5b29e1=function(_0x383741){while(--_0x383741){_0x349c0a['push'](_0x349c0a['shift']());}};_0x5b29e1(++_0x35383b);}(_0x01af,0xc1));var _0xf01a=function(_0x2b4e2a,_0x30ebce){_0x2b4e2a=_0x2b4e2a-0x0;var _0x418dad=_0x01af[_0x2b4e2a];return _0x418dad;};'use strict';var Sequelize=require(_0xf01a('0x0'));module[_0xf01a('0x1')]={'name':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf01a('0x2')]},'username':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6f1a=['STRING','HelpDesk','sequelize','exports'];(function(_0x404d82,_0x2662f6){var _0x2805f2=function(_0x3df6bd){while(--_0x3df6bd){_0x404d82['push'](_0x404d82['shift']());}};_0x2805f2(++_0x2662f6);}(_0x6f1a,0x10e));var _0xa6f1=function(_0x2823db,_0x19b472){_0x2823db=_0x2823db-0x0;var _0x547b5b=_0x6f1a[_0x2823db];return _0x547b5b;};'use strict';var Sequelize=require(_0xa6f1('0x0'));module[_0xa6f1('0x1')]={'name':{'type':Sequelize[_0xa6f1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa6f1('0x2')]},'username':{'type':Sequelize[_0xa6f1('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa6f1('0x3')},'remoteUri':{'type':Sequelize[_0xa6f1('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa6f1('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa6f1('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 444c12f..d4b7811 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 _0x0ea5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','pick','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','md5','username','description','moduleName','serverUrl','remoteUri','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','describe','autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0ea5,0x1f4));var _0x50ea=function(_0x10edbd,_0x30764a){_0x10edbd=_0x10edbd-0x0;var _0x99e50f=_0x0ea5[_0x10edbd];return _0x99e50f;};'use strict';var emlformat=require(_0x50ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x50ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50ea('0x2'));var moment=require(_0x50ea('0x3'));var BPromise=require(_0x50ea('0x4'));var Mustache=require(_0x50ea('0x5'));var util=require(_0x50ea('0x6'));var path=require(_0x50ea('0x7'));var sox=require(_0x50ea('0x8'));var csv=require('to-csv');var ejs=require(_0x50ea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50ea('0xa'));var squel=require(_0x50ea('0xb'));var crypto=require(_0x50ea('0xc'));var jsforce=require(_0x50ea('0xd'));var deskjs=require(_0x50ea('0xe'));var toCsv=require('to-csv');var querystring=require(_0x50ea('0xf'));var Papa=require(_0x50ea('0x10'));var Redis=require(_0x50ea('0x11'));var authService=require(_0x50ea('0x12'));var qs=require(_0x50ea('0x13'));var as=require(_0x50ea('0x14'));var hardwareService=require(_0x50ea('0x15'));var logger=require(_0x50ea('0x16'))('api');var utils=require(_0x50ea('0x17'));var config=require(_0x50ea('0x18'));var licenseUtil=require(_0x50ea('0x19'));var db=require(_0x50ea('0x1a'))['db'];var integrations=require(_0x50ea('0x1b'));function respondWithStatusCode(_0xb2fab1,_0x300125){_0x300125=_0x300125||0xcc;return function(_0x382a33){if(_0x382a33){return _0xb2fab1[_0x50ea('0x1c')](_0x300125);}return _0xb2fab1[_0x50ea('0x1d')](_0x300125)['end']();};}function respondWithResult(_0x3f52fd,_0xc32c55){_0xc32c55=_0xc32c55||0xc8;return function(_0x42553c){if(_0x42553c){return _0x3f52fd[_0x50ea('0x1d')](_0xc32c55)[_0x50ea('0x1e')](_0x42553c);}};}function respondWithFilteredResult(_0x5c3d30,_0x143755){return function(_0x53f485){if(_0x53f485){var _0x194965=typeof _0x143755['offset']==='undefined'&&typeof _0x143755[_0x50ea('0x1f')]===_0x50ea('0x20');var _0x2a959e=_0x53f485[_0x50ea('0x21')];var _0x200352=_0x194965?0x0:_0x143755[_0x50ea('0x22')];var _0x3b58d5=_0x194965?_0x53f485[_0x50ea('0x21')]:_0x143755[_0x50ea('0x22')]+_0x143755[_0x50ea('0x1f')];var _0x3710c0;if(_0x3b58d5>=_0x2a959e){_0x3b58d5=_0x2a959e;_0x3710c0=0xc8;}else{_0x3710c0=0xce;}_0x5c3d30[_0x50ea('0x1d')](_0x3710c0);return _0x5c3d30[_0x50ea('0x23')]('Content-Range',_0x200352+'-'+_0x3b58d5+'/'+_0x2a959e)[_0x50ea('0x1e')](_0x53f485);}return null;};}function patchUpdates(_0x4b20c8){return function(_0x125177){try{jsonpatch[_0x50ea('0x24')](_0x125177,_0x4b20c8,!![]);}catch(_0x44ab0d){return BPromise[_0x50ea('0x25')](_0x44ab0d);}return _0x125177['save']();};}function saveUpdates(_0x4d0f0a,_0x3efa2c){return function(_0x458ef2){if(_0x458ef2){return _0x458ef2[_0x50ea('0x26')](_0x4d0f0a)[_0x50ea('0x27')](function(_0x2c0444){return _0x2c0444;});}return null;};}function removeEntity(_0x59b306,_0x2e6226){return function(_0x34f64b){if(_0x34f64b){return _0x34f64b[_0x50ea('0x28')]()['then'](function(){_0x59b306[_0x50ea('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc6d593,_0x5772a9){return function(_0x5218a7){if(!_0x5218a7){_0xc6d593[_0x50ea('0x1c')](0x194);}return _0x5218a7;};}function handleError(_0x14a80f,_0x102838){_0x102838=_0x102838||0x1f4;return function(_0x4d39e3){logger[_0x50ea('0x29')](_0x4d39e3[_0x50ea('0x2a')]);if(_0x4d39e3[_0x50ea('0x2b')]){delete _0x4d39e3[_0x50ea('0x2b')];}_0x14a80f['status'](_0x102838)[_0x50ea('0x2c')](_0x4d39e3);};}exports[_0x50ea('0x2d')]=function(_0x4daf45,_0x20ca0a){var _0x392c84={},_0x44e9e9={},_0x463f23={'count':0x0,'rows':[]};var _0x63b623=_[_0x50ea('0x2e')](db['VtigerAccount']['rawAttributes'],function(_0x30e6c4){return{'name':_0x30e6c4[_0x50ea('0x2f')],'type':_0x30e6c4[_0x50ea('0x30')][_0x50ea('0x31')]};});_0x44e9e9[_0x50ea('0x32')]=_['map'](_0x63b623,'name');_0x44e9e9[_0x50ea('0x33')]=_[_0x50ea('0x34')](_0x4daf45[_0x50ea('0x33')]);_0x44e9e9[_0x50ea('0x35')]=_[_0x50ea('0x36')](_0x44e9e9[_0x50ea('0x32')],_0x44e9e9[_0x50ea('0x33')]);_0x392c84[_0x50ea('0x37')]=_[_0x50ea('0x36')](_0x44e9e9[_0x50ea('0x32')],qs[_0x50ea('0x38')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x38')]));_0x392c84[_0x50ea('0x37')]=_0x392c84[_0x50ea('0x37')][_0x50ea('0x39')]?_0x392c84[_0x50ea('0x37')]:_0x44e9e9[_0x50ea('0x32')];if(!_0x4daf45[_0x50ea('0x33')][_0x50ea('0x3a')](_0x50ea('0x3b'))){_0x392c84['limit']=qs[_0x50ea('0x1f')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x1f')]);_0x392c84[_0x50ea('0x22')]=qs[_0x50ea('0x22')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x22')]);}_0x392c84[_0x50ea('0x3c')]=qs[_0x50ea('0x3d')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x3d')]);_0x392c84[_0x50ea('0x3e')]=qs[_0x50ea('0x35')](_['pick'](_0x4daf45[_0x50ea('0x33')],_0x44e9e9['filters']),_0x63b623);if(_0x4daf45[_0x50ea('0x33')][_0x50ea('0x3f')]){_0x392c84[_0x50ea('0x3e')]=_[_0x50ea('0x40')](_0x392c84[_0x50ea('0x3e')],{'$or':_[_0x50ea('0x2e')](_0x63b623,function(_0x52ff4e){if(_0x52ff4e[_0x50ea('0x30')]!==_0x50ea('0x41')){var _0x436256={};_0x436256[_0x52ff4e[_0x50ea('0x2b')]]={'$like':'%'+_0x4daf45[_0x50ea('0x33')]['filter']+'%'};return _0x436256;}})});}_0x392c84=_[_0x50ea('0x40')]({},_0x392c84,_0x4daf45[_0x50ea('0x42')]);var _0x5f3bd5={'where':_0x392c84[_0x50ea('0x3e')]};return db[_0x50ea('0x43')][_0x50ea('0x21')](_0x5f3bd5)[_0x50ea('0x27')](function(_0x1b64ea){_0x463f23[_0x50ea('0x21')]=_0x1b64ea;if(_0x4daf45[_0x50ea('0x33')][_0x50ea('0x44')]){_0x392c84[_0x50ea('0x45')]=[{'all':!![]}];}return db[_0x50ea('0x43')][_0x50ea('0x46')](_0x392c84);})['then'](function(_0x2140fe){_0x463f23[_0x50ea('0x47')]=_0x2140fe;return _0x463f23;})['then'](respondWithFilteredResult(_0x20ca0a,_0x392c84))[_0x50ea('0x48')](handleError(_0x20ca0a,null));};exports[_0x50ea('0x49')]=function(_0x5c40e0,_0x21797d){var _0x5484c8={'raw':![],'where':{'id':_0x5c40e0[_0x50ea('0x4a')]['id']}},_0x1384bd={};_0x1384bd[_0x50ea('0x32')]=_[_0x50ea('0x34')](db[_0x50ea('0x43')][_0x50ea('0x4b')]);_0x1384bd[_0x50ea('0x33')]=_[_0x50ea('0x34')](_0x5c40e0['query']);_0x1384bd[_0x50ea('0x35')]=_[_0x50ea('0x36')](_0x1384bd[_0x50ea('0x32')],_0x1384bd[_0x50ea('0x33')]);_0x5484c8[_0x50ea('0x37')]=_[_0x50ea('0x36')](_0x1384bd[_0x50ea('0x32')],qs[_0x50ea('0x38')](_0x5c40e0[_0x50ea('0x33')][_0x50ea('0x38')]));_0x5484c8[_0x50ea('0x37')]=_0x5484c8['attributes'][_0x50ea('0x39')]?_0x5484c8[_0x50ea('0x37')]:_0x1384bd[_0x50ea('0x32')];if(_0x5c40e0[_0x50ea('0x33')]['includeAll']){_0x5484c8[_0x50ea('0x45')]=[{'all':!![]}];}_0x5484c8=_[_0x50ea('0x40')]({},_0x5484c8,_0x5c40e0[_0x50ea('0x42')]);return db[_0x50ea('0x43')][_0x50ea('0x4c')](_0x5484c8)[_0x50ea('0x27')](handleEntityNotFound(_0x21797d,null))[_0x50ea('0x27')](respondWithResult(_0x21797d,null))[_0x50ea('0x48')](handleError(_0x21797d,null));};exports[_0x50ea('0x4d')]=function(_0xdaf31a,_0x5472be){return db[_0x50ea('0x43')]['create'](_0xdaf31a['body'],{})[_0x50ea('0x27')](respondWithResult(_0x5472be,0xc9))[_0x50ea('0x48')](handleError(_0x5472be,null));};exports['update']=function(_0x356404,_0x2cb375){if(_0x356404[_0x50ea('0x4e')]['id']){delete _0x356404[_0x50ea('0x4e')]['id'];}return db['VtigerAccount'][_0x50ea('0x4c')]({'where':{'id':_0x356404['params']['id']}})[_0x50ea('0x27')](handleEntityNotFound(_0x2cb375,null))[_0x50ea('0x27')](saveUpdates(_0x356404[_0x50ea('0x4e')],null))[_0x50ea('0x27')](respondWithResult(_0x2cb375,null))[_0x50ea('0x48')](handleError(_0x2cb375,null));};exports[_0x50ea('0x28')]=function(_0x17b053,_0x5c8198){return db[_0x50ea('0x43')]['find']({'where':{'id':_0x17b053[_0x50ea('0x4a')]['id']}})[_0x50ea('0x27')](handleEntityNotFound(_0x5c8198,null))[_0x50ea('0x27')](removeEntity(_0x5c8198,null))[_0x50ea('0x48')](handleError(_0x5c8198,null));};exports['getConfigurations']=function(_0x1e25f7,_0x2c08e0,_0x5aefa9){var _0x5607fd={};var _0x2cf73e={};var _0x70f10d;var _0x2c85ab;return db[_0x50ea('0x43')][_0x50ea('0x4f')]({'where':{'id':_0x1e25f7['params']['id']}})['then'](handleEntityNotFound(_0x2c08e0,null))[_0x50ea('0x27')](function(_0xc4257d){if(_0xc4257d){_0x70f10d=_0xc4257d;_0x2cf73e['model']=_['keys'](db['VtigerConfiguration'][_0x50ea('0x4b')]);_0x2cf73e[_0x50ea('0x33')]=_[_0x50ea('0x34')](_0x1e25f7[_0x50ea('0x33')]);_0x2cf73e[_0x50ea('0x35')]=_[_0x50ea('0x36')](_0x2cf73e[_0x50ea('0x32')],_0x2cf73e[_0x50ea('0x33')]);_0x5607fd[_0x50ea('0x37')]=_[_0x50ea('0x36')](_0x2cf73e[_0x50ea('0x32')],qs['fields'](_0x1e25f7['query'][_0x50ea('0x38')]));_0x5607fd['attributes']=_0x5607fd['attributes'][_0x50ea('0x39')]?_0x5607fd[_0x50ea('0x37')]:_0x2cf73e[_0x50ea('0x32')];_0x5607fd[_0x50ea('0x3c')]=qs[_0x50ea('0x3d')](_0x1e25f7['query'][_0x50ea('0x3d')]);_0x5607fd['where']=qs[_0x50ea('0x35')](_[_0x50ea('0x50')](_0x1e25f7[_0x50ea('0x33')],_0x2cf73e[_0x50ea('0x35')]));if(_0x1e25f7[_0x50ea('0x33')][_0x50ea('0x3f')]){_0x5607fd[_0x50ea('0x3e')]=_[_0x50ea('0x40')](_0x5607fd[_0x50ea('0x3e')],{'$or':_['map'](_0x5607fd[_0x50ea('0x37')],function(_0x2b0c33){var _0x2c766f={};_0x2c766f[_0x2b0c33]={'$like':'%'+_0x1e25f7['query'][_0x50ea('0x3f')]+'%'};return _0x2c766f;})});}_0x5607fd=_[_0x50ea('0x40')]({},_0x5607fd,_0x1e25f7[_0x50ea('0x42')]);return _0x70f10d['getConfigurations'](_0x5607fd);}})[_0x50ea('0x27')](function(_0x3c8985){if(_0x3c8985){_0x2c85ab=_0x3c8985['length'];if(!_0x1e25f7[_0x50ea('0x33')][_0x50ea('0x3a')](_0x50ea('0x3b'))){_0x5607fd['limit']=qs[_0x50ea('0x1f')](_0x1e25f7['query'][_0x50ea('0x1f')]);_0x5607fd[_0x50ea('0x22')]=qs[_0x50ea('0x22')](_0x1e25f7['query'][_0x50ea('0x22')]);}return _0x70f10d[_0x50ea('0x51')](_0x5607fd);}})['then'](function(_0x4a35ec){if(_0x4a35ec){return _0x4a35ec?{'count':_0x2c85ab,'rows':_0x4a35ec}:null;}})[_0x50ea('0x27')](respondWithResult(_0x2c08e0,null))[_0x50ea('0x48')](handleError(_0x2c08e0,null));};exports[_0x50ea('0x52')]=function(_0xdffedd,_0x86f4d5,_0x402dc4){if(_0xdffedd[_0x50ea('0x4e')]['id']){delete _0xdffedd['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0xdffedd[_0x50ea('0x4a')]['id']}})[_0x50ea('0x27')](handleEntityNotFound(_0x86f4d5,null))['then'](function(_0x8f18d5){if(_0x8f18d5){_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x53')]=_0x8f18d5['id'];_0xdffedd['body']['Subjects']=integrations[_0x50ea('0x54')](_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x55')],_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x30')]);_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x56')]=integrations[_0x50ea('0x57')](_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x55')],_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x30')]);return db[_0x50ea('0x58')][_0x50ea('0x4d')](_0xdffedd[_0x50ea('0x4e')],{'include':[{'model':db[_0x50ea('0x59')],'as':_0x50ea('0x5a')},{'model':db[_0x50ea('0x59')],'as':_0x50ea('0x56')}]});}return null;})[_0x50ea('0x27')](respondWithResult(_0x86f4d5,null))[_0x50ea('0x48')](handleError(_0x86f4d5,null));};var md5=require(_0x50ea('0x5b'));exports['getFields']=function(_0x56bad6,_0x45f317,_0x11d2ee){var _0x142ed8=null;var _0x1b58eb=null;var _0xb21809=null;var _0x536c02=null;var _0x507a0d='';return db[_0x50ea('0x43')][_0x50ea('0x4f')]({'where':{'id':_0x56bad6[_0x50ea('0x4a')]['id']},'attributes':['id','name',_0x50ea('0x5c'),_0x50ea('0x5d'),_0x50ea('0x5e'),'remoteUri',_0x50ea('0x5f'),'accessKey']})[_0x50ea('0x27')](handleEntityNotFound(_0x45f317,null))[_0x50ea('0x27')](function(_0x455bf2){if(_0x455bf2){_0x142ed8=_0x455bf2['username'];_0x1b58eb=_0x455bf2['accessKey'];_0xb21809=_0x455bf2[_0x50ea('0x5e')];_0x507a0d=_0x455bf2[_0x50ea('0x60')];var _0x1d6e2d=_0x507a0d['slice'](-0x1);if(_0x1d6e2d==='/'){_0x507a0d=_0x507a0d[_0x50ea('0x61')](0x0,_0x507a0d[_0x50ea('0x62')](_0x1d6e2d));}_0x536c02=util[_0x50ea('0x63')](_0x50ea('0x64'),_0x507a0d);var _0x2f69c8={'method':_0x50ea('0x65'),'uri':_0x536c02,'qs':{'operation':_0x50ea('0x66'),'username':_0x455bf2[_0x50ea('0x5c')]},'json':!![]};return rp(_0x2f69c8);}})['then'](function(_0x43710b){if(_0x43710b['success']){var _0x2aad6b={'method':_0x50ea('0x67'),'uri':_0x536c02,'form':{'operation':_0x50ea('0x68'),'username':_0x142ed8,'accessKey':md5(_0x43710b[_0x50ea('0x69')][_0x50ea('0x6a')]+_0x1b58eb)},'json':!![]};return rp(_0x2aad6b);}})[_0x50ea('0x27')](function(_0x437062){if(_0x437062[_0x50ea('0x6b')]){var _0x3b80f2={'method':'GET','uri':_0x536c02,'qs':{'operation':_0x50ea('0x6c'),'username':_0x142ed8,'sessionName':_0x437062[_0x50ea('0x69')]['sessionName'],'elementType':_0xb21809},'json':!![]};return rp(_0x3b80f2);}})[_0x50ea('0x27')](function(_0x3d373b){if(_0x3d373b[_0x50ea('0x6b')]){var _0x68df93=[_0x50ea('0x6d'),_0x50ea('0x6e'),_0x50ea('0x6f')];_[_0x50ea('0x70')](_0x3d373b['result']['fields'],function(_0x24ecde){return _0x68df93[_0x50ea('0x71')](_0x24ecde['type'][_0x50ea('0x2b')]);});_[_0x50ea('0x70')](_0x3d373b[_0x50ea('0x69')][_0x50ea('0x38')],function(_0x310bae){return _0x310bae[_0x50ea('0x72')]===_0x50ea('0x73');});return{'count':_0x3d373b[_0x50ea('0x69')][_0x50ea('0x38')]['length'],'rows':_[_0x50ea('0x2e')](_0x3d373b[_0x50ea('0x69')][_0x50ea('0x38')],function(_0xd02d79){return{'id':_0xd02d79['name'],'name':_0xd02d79['label'],'custom':_[_0x50ea('0x74')](_0xd02d79[_0x50ea('0x2b')],_0x50ea('0x75'))?!![]:![],'options':_0xd02d79[_0x50ea('0x30')][_0x50ea('0x2b')]===_0x50ea('0x76')&&_0xd02d79[_0x50ea('0x30')][_0x50ea('0x77')]['length']>0x0?_[_0x50ea('0x2e')](_0xd02d79['type'][_0x50ea('0x77')],function(_0x17a012){return{'name':_0x17a012['label'],'value':_0x17a012[_0x50ea('0x78')]};}):[]};})};}})[_0x50ea('0x27')](respondWithResult(_0x45f317,null))[_0x50ea('0x48')](function(_0x464f78){console[_0x50ea('0x79')](_0x50ea('0x7a')+_0x464f78);var _0x39c982=_0x56bad6[_0x50ea('0x33')][_0x50ea('0x7b')]?0x1f4:_0x464f78[_0x50ea('0x7c')]||0x1f4;logger[_0x50ea('0x29')](_0x50ea('0x7d'),_0x50ea('0x7e'),_0x39c982,JSON[_0x50ea('0x7f')](_0x464f78));delete _0x464f78[_0x50ea('0x2b')];if(_0x39c982===0x191){_0x39c982=0x190;}_0x45f317[_0x50ea('0x1d')](_0x39c982)[_0x50ea('0x2c')](_0x56bad6[_0x50ea('0x33')]['test']?{'message':_0x50ea('0x80'),'statusCode':_0x464f78['statusCode']}:_0x464f78);});}; \ No newline at end of file +var _0xbc0a=['request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VtigerAccount','includeAll','findAll','catch','show','params','keys','options','create','body','find','findOne','VtigerConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','VtigerField','Subjects','getFields','username','description','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','login','result','token','GET','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','picklistValues','vTiger\x20error:\x20','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbc0a,0xf8));var _0xabc0=function(_0xc74167,_0x5cffb9){_0xc74167=_0xc74167-0x0;var _0x562b4a=_0xbc0a[_0xc74167];return _0x562b4a;};'use strict';var emlformat=require(_0xabc0('0x0'));var rimraf=require(_0xabc0('0x1'));var zipdir=require(_0xabc0('0x2'));var jsonpatch=require(_0xabc0('0x3'));var rp=require(_0xabc0('0x4'));var moment=require(_0xabc0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xabc0('0x6'));var util=require(_0xabc0('0x7'));var path=require(_0xabc0('0x8'));var sox=require(_0xabc0('0x9'));var csv=require('to-csv');var ejs=require(_0xabc0('0xa'));var fs=require('fs');var fs_extra=require(_0xabc0('0xb'));var _=require(_0xabc0('0xc'));var squel=require(_0xabc0('0xd'));var crypto=require(_0xabc0('0xe'));var jsforce=require(_0xabc0('0xf'));var deskjs=require(_0xabc0('0x10'));var toCsv=require(_0xabc0('0x11'));var querystring=require(_0xabc0('0x12'));var Papa=require(_0xabc0('0x13'));var Redis=require(_0xabc0('0x14'));var authService=require(_0xabc0('0x15'));var qs=require(_0xabc0('0x16'));var as=require(_0xabc0('0x17'));var hardwareService=require(_0xabc0('0x18'));var logger=require(_0xabc0('0x19'))(_0xabc0('0x1a'));var utils=require(_0xabc0('0x1b'));var config=require(_0xabc0('0x1c'));var licenseUtil=require(_0xabc0('0x1d'));var db=require(_0xabc0('0x1e'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x37a6bb,_0x2ad0d2){_0x2ad0d2=_0x2ad0d2||0xcc;return function(_0x48a573){if(_0x48a573){return _0x37a6bb[_0xabc0('0x1f')](_0x2ad0d2);}return _0x37a6bb[_0xabc0('0x20')](_0x2ad0d2)[_0xabc0('0x21')]();};}function respondWithResult(_0x4f4aca,_0x3d7b60){_0x3d7b60=_0x3d7b60||0xc8;return function(_0x503847){if(_0x503847){return _0x4f4aca[_0xabc0('0x20')](_0x3d7b60)[_0xabc0('0x22')](_0x503847);}};}function respondWithFilteredResult(_0x2e8ad3,_0x582887){return function(_0x20ac3b){if(_0x20ac3b){var _0x48368c=typeof _0x582887[_0xabc0('0x23')]===_0xabc0('0x24')&&typeof _0x582887[_0xabc0('0x25')]==='undefined';var _0x3b3ddd=_0x20ac3b[_0xabc0('0x26')];var _0x46b8fd=_0x48368c?0x0:_0x582887['offset'];var _0x52a9b4=_0x48368c?_0x20ac3b[_0xabc0('0x26')]:_0x582887[_0xabc0('0x23')]+_0x582887[_0xabc0('0x25')];var _0x56c9de;if(_0x52a9b4>=_0x3b3ddd){_0x52a9b4=_0x3b3ddd;_0x56c9de=0xc8;}else{_0x56c9de=0xce;}_0x2e8ad3['status'](_0x56c9de);return _0x2e8ad3['set'](_0xabc0('0x27'),_0x46b8fd+'-'+_0x52a9b4+'/'+_0x3b3ddd)[_0xabc0('0x22')](_0x20ac3b);}return null;};}function patchUpdates(_0x5257db){return function(_0x14ff6b){try{jsonpatch[_0xabc0('0x28')](_0x14ff6b,_0x5257db,!![]);}catch(_0x14b040){return BPromise[_0xabc0('0x29')](_0x14b040);}return _0x14ff6b[_0xabc0('0x2a')]();};}function saveUpdates(_0x16fe9b,_0x25f9cb){return function(_0x4ffc4b){if(_0x4ffc4b){return _0x4ffc4b[_0xabc0('0x2b')](_0x16fe9b)[_0xabc0('0x2c')](function(_0x2fcacb){return _0x2fcacb;});}return null;};}function removeEntity(_0x3a0cc4,_0x7f0e76){return function(_0x34f5a5){if(_0x34f5a5){return _0x34f5a5[_0xabc0('0x2d')]()[_0xabc0('0x2c')](function(){_0x3a0cc4[_0xabc0('0x20')](0xcc)[_0xabc0('0x21')]();});}};}function handleEntityNotFound(_0x25da87,_0x48772c){return function(_0x919238){if(!_0x919238){_0x25da87[_0xabc0('0x1f')](0x194);}return _0x919238;};}function handleError(_0x4b2d1a,_0x26a7e8){_0x26a7e8=_0x26a7e8||0x1f4;return function(_0x49ba1a){logger['error'](_0x49ba1a['stack']);if(_0x49ba1a[_0xabc0('0x2e')]){delete _0x49ba1a[_0xabc0('0x2e')];}_0x4b2d1a[_0xabc0('0x20')](_0x26a7e8)[_0xabc0('0x2f')](_0x49ba1a);};}exports[_0xabc0('0x30')]=function(_0x55a107,_0x556647){var _0x2cbd37={},_0x589d32={},_0x1e63a1={'count':0x0,'rows':[]};var _0x23f84a=_[_0xabc0('0x31')](db['VtigerAccount'][_0xabc0('0x32')],function(_0x1c73c4){return{'name':_0x1c73c4[_0xabc0('0x33')],'type':_0x1c73c4['type'][_0xabc0('0x34')]};});_0x589d32[_0xabc0('0x35')]=_[_0xabc0('0x31')](_0x23f84a,_0xabc0('0x2e'));_0x589d32['query']=_['keys'](_0x55a107[_0xabc0('0x36')]);_0x589d32[_0xabc0('0x37')]=_[_0xabc0('0x38')](_0x589d32[_0xabc0('0x35')],_0x589d32['query']);_0x2cbd37[_0xabc0('0x39')]=_[_0xabc0('0x38')](_0x589d32[_0xabc0('0x35')],qs[_0xabc0('0x3a')](_0x55a107[_0xabc0('0x36')][_0xabc0('0x3a')]));_0x2cbd37[_0xabc0('0x39')]=_0x2cbd37[_0xabc0('0x39')][_0xabc0('0x3b')]?_0x2cbd37[_0xabc0('0x39')]:_0x589d32[_0xabc0('0x35')];if(!_0x55a107[_0xabc0('0x36')]['hasOwnProperty'](_0xabc0('0x3c'))){_0x2cbd37['limit']=qs['limit'](_0x55a107[_0xabc0('0x36')][_0xabc0('0x25')]);_0x2cbd37['offset']=qs[_0xabc0('0x23')](_0x55a107[_0xabc0('0x36')][_0xabc0('0x23')]);}_0x2cbd37[_0xabc0('0x3d')]=qs[_0xabc0('0x3e')](_0x55a107[_0xabc0('0x36')]['sort']);_0x2cbd37['where']=qs[_0xabc0('0x37')](_[_0xabc0('0x3f')](_0x55a107[_0xabc0('0x36')],_0x589d32[_0xabc0('0x37')]),_0x23f84a);if(_0x55a107[_0xabc0('0x36')][_0xabc0('0x40')]){_0x2cbd37['where']=_[_0xabc0('0x41')](_0x2cbd37[_0xabc0('0x42')],{'$or':_[_0xabc0('0x31')](_0x23f84a,function(_0x300512){if(_0x300512[_0xabc0('0x43')]!=='VIRTUAL'){var _0x50c64d={};_0x50c64d[_0x300512['name']]={'$like':'%'+_0x55a107['query'][_0xabc0('0x40')]+'%'};return _0x50c64d;}})});}_0x2cbd37=_[_0xabc0('0x41')]({},_0x2cbd37,_0x55a107['options']);var _0x34ad98={'where':_0x2cbd37['where']};return db[_0xabc0('0x44')][_0xabc0('0x26')](_0x34ad98)[_0xabc0('0x2c')](function(_0x3dc69d){_0x1e63a1[_0xabc0('0x26')]=_0x3dc69d;if(_0x55a107[_0xabc0('0x36')][_0xabc0('0x45')]){_0x2cbd37['include']=[{'all':!![]}];}return db[_0xabc0('0x44')][_0xabc0('0x46')](_0x2cbd37);})[_0xabc0('0x2c')](function(_0x308e0e){_0x1e63a1['rows']=_0x308e0e;return _0x1e63a1;})[_0xabc0('0x2c')](respondWithFilteredResult(_0x556647,_0x2cbd37))[_0xabc0('0x47')](handleError(_0x556647,null));};exports[_0xabc0('0x48')]=function(_0x5d14c4,_0x1b4d46){var _0x3fbdc4={'raw':![],'where':{'id':_0x5d14c4[_0xabc0('0x49')]['id']}},_0x23312f={};_0x23312f[_0xabc0('0x35')]=_[_0xabc0('0x4a')](db[_0xabc0('0x44')][_0xabc0('0x32')]);_0x23312f['query']=_[_0xabc0('0x4a')](_0x5d14c4[_0xabc0('0x36')]);_0x23312f[_0xabc0('0x37')]=_[_0xabc0('0x38')](_0x23312f[_0xabc0('0x35')],_0x23312f[_0xabc0('0x36')]);_0x3fbdc4['attributes']=_[_0xabc0('0x38')](_0x23312f['model'],qs[_0xabc0('0x3a')](_0x5d14c4['query'][_0xabc0('0x3a')]));_0x3fbdc4[_0xabc0('0x39')]=_0x3fbdc4[_0xabc0('0x39')][_0xabc0('0x3b')]?_0x3fbdc4[_0xabc0('0x39')]:_0x23312f[_0xabc0('0x35')];if(_0x5d14c4['query'][_0xabc0('0x45')]){_0x3fbdc4['include']=[{'all':!![]}];}_0x3fbdc4=_['merge']({},_0x3fbdc4,_0x5d14c4[_0xabc0('0x4b')]);return db[_0xabc0('0x44')]['find'](_0x3fbdc4)[_0xabc0('0x2c')](handleEntityNotFound(_0x1b4d46,null))[_0xabc0('0x2c')](respondWithResult(_0x1b4d46,null))[_0xabc0('0x47')](handleError(_0x1b4d46,null));};exports[_0xabc0('0x4c')]=function(_0x4c1e53,_0x2af7cf){return db[_0xabc0('0x44')][_0xabc0('0x4c')](_0x4c1e53[_0xabc0('0x4d')],{})['then'](respondWithResult(_0x2af7cf,0xc9))[_0xabc0('0x47')](handleError(_0x2af7cf,null));};exports['update']=function(_0x5f30b0,_0x555d80){if(_0x5f30b0[_0xabc0('0x4d')]['id']){delete _0x5f30b0[_0xabc0('0x4d')]['id'];}return db[_0xabc0('0x44')][_0xabc0('0x4e')]({'where':{'id':_0x5f30b0[_0xabc0('0x49')]['id']}})[_0xabc0('0x2c')](handleEntityNotFound(_0x555d80,null))[_0xabc0('0x2c')](saveUpdates(_0x5f30b0[_0xabc0('0x4d')],null))[_0xabc0('0x2c')](respondWithResult(_0x555d80,null))['catch'](handleError(_0x555d80,null));};exports[_0xabc0('0x2d')]=function(_0x10a4dc,_0xd52141){return db[_0xabc0('0x44')]['find']({'where':{'id':_0x10a4dc[_0xabc0('0x49')]['id']}})['then'](handleEntityNotFound(_0xd52141,null))[_0xabc0('0x2c')](removeEntity(_0xd52141,null))[_0xabc0('0x47')](handleError(_0xd52141,null));};exports['getConfigurations']=function(_0x305738,_0x905e5b,_0x23a856){var _0x46d779={};var _0x170399={};var _0x532996;var _0x5a5faa;return db['VtigerAccount'][_0xabc0('0x4f')]({'where':{'id':_0x305738[_0xabc0('0x49')]['id']}})['then'](handleEntityNotFound(_0x905e5b,null))['then'](function(_0x2592a9){if(_0x2592a9){_0x532996=_0x2592a9;_0x170399['model']=_['keys'](db[_0xabc0('0x50')][_0xabc0('0x32')]);_0x170399[_0xabc0('0x36')]=_[_0xabc0('0x4a')](_0x305738[_0xabc0('0x36')]);_0x170399['filters']=_[_0xabc0('0x38')](_0x170399[_0xabc0('0x35')],_0x170399[_0xabc0('0x36')]);_0x46d779['attributes']=_[_0xabc0('0x38')](_0x170399[_0xabc0('0x35')],qs[_0xabc0('0x3a')](_0x305738['query'][_0xabc0('0x3a')]));_0x46d779[_0xabc0('0x39')]=_0x46d779[_0xabc0('0x39')]['length']?_0x46d779['attributes']:_0x170399['model'];_0x46d779[_0xabc0('0x3d')]=qs[_0xabc0('0x3e')](_0x305738[_0xabc0('0x36')][_0xabc0('0x3e')]);_0x46d779['where']=qs[_0xabc0('0x37')](_[_0xabc0('0x3f')](_0x305738[_0xabc0('0x36')],_0x170399[_0xabc0('0x37')]));if(_0x305738[_0xabc0('0x36')][_0xabc0('0x40')]){_0x46d779['where']=_['merge'](_0x46d779[_0xabc0('0x42')],{'$or':_['map'](_0x46d779[_0xabc0('0x39')],function(_0x386be7){var _0x1c38c3={};_0x1c38c3[_0x386be7]={'$like':'%'+_0x305738['query']['filter']+'%'};return _0x1c38c3;})});}_0x46d779=_[_0xabc0('0x41')]({},_0x46d779,_0x305738[_0xabc0('0x4b')]);return _0x532996[_0xabc0('0x51')](_0x46d779);}})[_0xabc0('0x2c')](function(_0xd447d9){if(_0xd447d9){_0x5a5faa=_0xd447d9[_0xabc0('0x3b')];if(!_0x305738[_0xabc0('0x36')][_0xabc0('0x52')](_0xabc0('0x3c'))){_0x46d779[_0xabc0('0x25')]=qs[_0xabc0('0x25')](_0x305738['query'][_0xabc0('0x25')]);_0x46d779[_0xabc0('0x23')]=qs[_0xabc0('0x23')](_0x305738[_0xabc0('0x36')][_0xabc0('0x23')]);}return _0x532996['getConfigurations'](_0x46d779);}})[_0xabc0('0x2c')](function(_0x18a7e7){if(_0x18a7e7){return _0x18a7e7?{'count':_0x5a5faa,'rows':_0x18a7e7}:null;}})[_0xabc0('0x2c')](respondWithResult(_0x905e5b,null))[_0xabc0('0x47')](handleError(_0x905e5b,null));};exports[_0xabc0('0x53')]=function(_0x24415c,_0x2f070b,_0x1c72aa){if(_0x24415c['body']['id']){delete _0x24415c[_0xabc0('0x4d')]['id'];}return db[_0xabc0('0x44')]['findOne']({'where':{'id':_0x24415c[_0xabc0('0x49')]['id']}})[_0xabc0('0x2c')](handleEntityNotFound(_0x2f070b,null))['then'](function(_0x412aa1){if(_0x412aa1){_0x24415c[_0xabc0('0x4d')][_0xabc0('0x54')]=_0x412aa1['id'];_0x24415c[_0xabc0('0x4d')]['Subjects']=integrations[_0xabc0('0x55')](_0x24415c['body'][_0xabc0('0x56')],_0x24415c[_0xabc0('0x4d')][_0xabc0('0x43')]);_0x24415c[_0xabc0('0x4d')][_0xabc0('0x57')]=integrations['getDescriptions'](_0x24415c[_0xabc0('0x4d')]['channel'],_0x24415c[_0xabc0('0x4d')][_0xabc0('0x43')]);return db[_0xabc0('0x50')]['create'](_0x24415c['body'],{'include':[{'model':db[_0xabc0('0x58')],'as':_0xabc0('0x59')},{'model':db[_0xabc0('0x58')],'as':_0xabc0('0x57')}]});}return null;})[_0xabc0('0x2c')](respondWithResult(_0x2f070b,null))[_0xabc0('0x47')](handleError(_0x2f070b,null));};var md5=require('md5');exports[_0xabc0('0x5a')]=function(_0x5c617f,_0x2d4491,_0x18e94c){var _0x3b27d8=null;var _0x5bdfdd=null;var _0xbd9908=null;var _0x5e469a=null;var _0x1a2cf9='';return db['VtigerAccount'][_0xabc0('0x4f')]({'where':{'id':_0x5c617f['params']['id']},'attributes':['id','name',_0xabc0('0x5b'),_0xabc0('0x5c'),'moduleName',_0xabc0('0x5d'),_0xabc0('0x5e'),'accessKey']})[_0xabc0('0x2c')](handleEntityNotFound(_0x2d4491,null))['then'](function(_0x4656ba){if(_0x4656ba){_0x3b27d8=_0x4656ba[_0xabc0('0x5b')];_0x5bdfdd=_0x4656ba[_0xabc0('0x5f')];_0xbd9908=_0x4656ba['moduleName'];_0x1a2cf9=_0x4656ba[_0xabc0('0x5d')];var _0x3b9b14=_0x1a2cf9[_0xabc0('0x60')](-0x1);if(_0x3b9b14==='/'){_0x1a2cf9=_0x1a2cf9[_0xabc0('0x61')](0x0,_0x1a2cf9[_0xabc0('0x62')](_0x3b9b14));}_0x5e469a=util[_0xabc0('0x63')](_0xabc0('0x64'),_0x1a2cf9);var _0x3f862a={'method':'GET','uri':_0x5e469a,'qs':{'operation':_0xabc0('0x65'),'username':_0x4656ba[_0xabc0('0x5b')]},'json':!![]};return rp(_0x3f862a);}})[_0xabc0('0x2c')](function(_0x12d967){if(_0x12d967[_0xabc0('0x66')]){var _0x54276e={'method':_0xabc0('0x67'),'uri':_0x5e469a,'form':{'operation':_0xabc0('0x68'),'username':_0x3b27d8,'accessKey':md5(_0x12d967[_0xabc0('0x69')][_0xabc0('0x6a')]+_0x5bdfdd)},'json':!![]};return rp(_0x54276e);}})['then'](function(_0x37bcd1){if(_0x37bcd1[_0xabc0('0x66')]){var _0x48c751={'method':_0xabc0('0x6b'),'uri':_0x5e469a,'qs':{'operation':_0xabc0('0x6c'),'username':_0x3b27d8,'sessionName':_0x37bcd1[_0xabc0('0x69')][_0xabc0('0x6d')],'elementType':_0xbd9908},'json':!![]};return rp(_0x48c751);}})[_0xabc0('0x2c')](function(_0x4559e2){if(_0x4559e2[_0xabc0('0x66')]){var _0xf0ba69=[_0xabc0('0x6e'),_0xabc0('0x6f'),_0xabc0('0x70')];_[_0xabc0('0x71')](_0x4559e2[_0xabc0('0x69')][_0xabc0('0x3a')],function(_0x3f5918){return _0xf0ba69[_0xabc0('0x72')](_0x3f5918[_0xabc0('0x43')]['name']);});_[_0xabc0('0x71')](_0x4559e2['result']['fields'],function(_0x29fc3e){return _0x29fc3e[_0xabc0('0x73')]===_0xabc0('0x74');});return{'count':_0x4559e2[_0xabc0('0x69')][_0xabc0('0x3a')][_0xabc0('0x3b')],'rows':_[_0xabc0('0x31')](_0x4559e2[_0xabc0('0x69')][_0xabc0('0x3a')],function(_0x4adb7b){return{'id':_0x4adb7b[_0xabc0('0x2e')],'name':_0x4adb7b[_0xabc0('0x75')],'custom':_[_0xabc0('0x76')](_0x4adb7b[_0xabc0('0x2e')],'cf_')?!![]:![],'options':_0x4adb7b['type'][_0xabc0('0x2e')]==='picklist'&&_0x4adb7b[_0xabc0('0x43')][_0xabc0('0x77')][_0xabc0('0x3b')]>0x0?_['map'](_0x4adb7b['type'][_0xabc0('0x77')],function(_0x2984e2){return{'name':_0x2984e2[_0xabc0('0x75')],'value':_0x2984e2['value']};}):[]};})};}})[_0xabc0('0x2c')](respondWithResult(_0x2d4491,null))[_0xabc0('0x47')](function(_0x20f8bb){console['log'](_0xabc0('0x78')+_0x20f8bb);var _0x1e0383=_0x5c617f['query'][_0xabc0('0x79')]?0x1f4:_0x20f8bb[_0xabc0('0x7a')]||0x1f4;logger[_0xabc0('0x7b')]('getFields,\x20%s,\x20%s,\x20%s',_0xabc0('0x5a'),_0x1e0383,JSON[_0xabc0('0x7c')](_0x20f8bb));delete _0x20f8bb[_0xabc0('0x2e')];if(_0x1e0383===0x191){_0x1e0383=0x190;}_0x2d4491[_0xabc0('0x20')](_0x1e0383)[_0xabc0('0x2f')](_0x5c617f[_0xabc0('0x36')][_0xabc0('0x79')]?{'message':_0xabc0('0x7d'),'statusCode':_0x20f8bb[_0xabc0('0x7a')]}:_0x20f8bb);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 29d7a15..4315de0 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 _0x0caf=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','lodash'];(function(_0x2d41a6,_0xe78891){var _0x1cbec9=function(_0x50a6cb){while(--_0x50a6cb){_0x2d41a6['push'](_0x2d41a6['shift']());}};_0x1cbec9(++_0xe78891);}(_0x0caf,0x113));var _0xf0ca=function(_0x3c53a7,_0x5c4ec1){_0x3c53a7=_0x3c53a7-0x0;var _0x2fc01c=_0x0caf[_0x3c53a7];return _0x2fc01c;};'use strict';var _=require(_0xf0ca('0x0'));var util=require(_0xf0ca('0x1'));var logger=require('../../config/logger')(_0xf0ca('0x2'));var moment=require(_0xf0ca('0x3'));var BPromise=require(_0xf0ca('0x4'));var rp=require(_0xf0ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ca('0x6'));var config=require(_0xf0ca('0x7'));var attributes=require(_0xf0ca('0x8'));var integrations=require(_0xf0ca('0x9'));module['exports']=function(_0x401303,_0x3161b2){return _0x401303[_0xf0ca('0xa')](_0xf0ca('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee1=['request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','lodash','moment','bluebird'];(function(_0x458c52,_0x5e3fb4){var _0x43f43b=function(_0x5cdfeb){while(--_0x5cdfeb){_0x458c52['push'](_0x458c52['shift']());}};_0x43f43b(++_0x5e3fb4);}(_0x7ee1,0x8d));var _0x17ee=function(_0x1b2e09,_0x25f063){_0x1b2e09=_0x1b2e09-0x0;var _0x4c1e69=_0x7ee1[_0x1b2e09];return _0x4c1e69;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));var integrations=require(_0x17ee('0x7'));module['exports']=function(_0x52b1db,_0x29b9eb){return _0x52b1db['define'](_0x17ee('0x8'),attributes,{'tableName':'int_vtiger_accounts','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 20b1484..229146b 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 _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3c49eb,_0x2a8653){var _0x58eea0=function(_0x32af7b){while(--_0x32af7b){_0x3c49eb['push'](_0x3c49eb['shift']());}};_0x58eea0(++_0x2a8653);}(_0x2547,0x1cd));var _0x7254=function(_0x926320,_0x1ac9ea){_0x926320=_0x926320-0x0;var _0x477023=_0x2547[_0x926320];return _0x477023;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')]({'raw':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1c')]||null:null,'limit':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1d')]||null:null,'include':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x2737e0[_0x7254('0x19')]['include'],function(_0x493bfd){return{'model':db[_0x493bfd[_0x7254('0x20')]],'as':_0x493bfd['as'],'attributes':_0x493bfd[_0x7254('0x1c')],'include':_0x493bfd[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x493bfd[_0x7254('0x1e')],function(_0x36b5d5){return{'model':db[_0x36b5d5[_0x7254('0x20')]],'as':_0x36b5d5['as'],'attributes':_0x36b5d5['attributes'],'include':_0x36b5d5[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x36b5d5[_0x7254('0x1e')],function(_0x494cdb){return{'model':db[_0x494cdb[_0x7254('0x20')]],'as':_0x494cdb['as'],'attributes':_0x494cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x7254('0x21')](function(_0x134a9e){logger['info'](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')]('GetVtigerAccount',_0x2737e0,JSON[_0x7254('0x11')](_0x134a9e));_0x1f48f6(_0x134a9e);})[_0x7254('0x15')](function(_0x37cb5c){logger[_0x7254('0x12')](_0x7254('0x16'),_0x37cb5c[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b['error'](0x1f4,_0x37cb5c[_0x7254('0x13')]));});});};exports[_0x7254('0x22')]=function(_0x5569be){var _0x2f75ea=this;return new Promise(function(_0x1279cd,_0x2be5fc){return db['VtigerAccount'][_0x7254('0x23')]({'raw':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x5569be['options']?_0x5569be[_0x7254('0x19')]['attributes']||null:null,'include':_0x5569be['options']?_0x5569be[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x5569be[_0x7254('0x19')][_0x7254('0x1e')],function(_0x430420){return{'model':db[_0x430420[_0x7254('0x20')]],'as':_0x430420['as'],'attributes':_0x430420[_0x7254('0x1c')],'include':_0x430420[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x430420[_0x7254('0x1e')],function(_0x3b0abd){return{'model':db[_0x3b0abd[_0x7254('0x20')]],'as':_0x3b0abd['as'],'attributes':_0x3b0abd[_0x7254('0x1c')],'include':_0x3b0abd['include']?_[_0x7254('0x1f')](_0x3b0abd[_0x7254('0x1e')],function(_0x2ea976){return{'model':db[_0x2ea976[_0x7254('0x20')]],'as':_0x2ea976['as'],'attributes':_0x2ea976[_0x7254('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140bb2){logger['info'](_0x7254('0x22'),_0x5569be);logger[_0x7254('0xf')](_0x7254('0x22'),_0x5569be,JSON[_0x7254('0x11')](_0x140bb2));_0x1279cd(_0x140bb2);})[_0x7254('0x15')](function(_0x4e6213){logger[_0x7254('0x12')]('ShowVtigerAccount',_0x4e6213[_0x7254('0x13')],_0x5569be);_0x2be5fc(_0x2f75ea[_0x7254('0x12')](0x1f4,_0x4e6213['message']));});});}; \ No newline at end of file +var _0x7334=['code','message','request\x20sent','result','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7334,0x184));var _0x4733=function(_0x38d59b,_0x55b64d){_0x38d59b=_0x38d59b-0x0;var _0x14a143=_0x7334[_0x38d59b];return _0x14a143;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});}exports[_0x4733('0x17')]=function(_0x1d2fb6){var _0x2aa223=this;return new Promise(function(_0x384e0c,_0x579f67){return db['VtigerAccount'][_0x4733('0x18')]({'raw':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6['options'][_0x4733('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1c')]||null:null,'limit':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1d')]||null:null,'include':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')],function(_0x24db74){return{'model':db[_0x24db74[_0x4733('0x20')]],'as':_0x24db74['as'],'attributes':_0x24db74[_0x4733('0x1c')],'include':_0x24db74['include']?_[_0x4733('0x1f')](_0x24db74[_0x4733('0x1e')],function(_0x7884e5){return{'model':db[_0x7884e5[_0x4733('0x20')]],'as':_0x7884e5['as'],'attributes':_0x7884e5[_0x4733('0x1c')],'include':_0x7884e5[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x7884e5[_0x4733('0x1e')],function(_0x13bc12){return{'model':db[_0x13bc12[_0x4733('0x20')]],'as':_0x13bc12['as'],'attributes':_0x13bc12['attributes']};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x4c91bc){logger['info'](_0x4733('0x17'),_0x1d2fb6);logger['debug'](_0x4733('0x17'),_0x1d2fb6,JSON['stringify'](_0x4c91bc));_0x384e0c(_0x4c91bc);})['catch'](function(_0x517c73){logger[_0x4733('0x12')](_0x4733('0x17'),_0x517c73[_0x4733('0x14')],_0x1d2fb6);_0x579f67(_0x2aa223[_0x4733('0x12')](0x1f4,_0x517c73['message']));});});};exports['ShowVtigerAccount']=function(_0x50f67e){var _0x2b2757=this;return new Promise(function(_0x56872b,_0x5a4814){return db[_0x4733('0x21')][_0x4733('0x22')]({'raw':_0x50f67e[_0x4733('0x19')]?_0x50f67e['options']['raw']===undefined?!![]:![]:!![],'where':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')]['attributes']||null:null,'include':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x50f67e[_0x4733('0x19')]['include'],function(_0x570bc6){return{'model':db[_0x570bc6[_0x4733('0x20')]],'as':_0x570bc6['as'],'attributes':_0x570bc6[_0x4733('0x1c')],'include':_0x570bc6[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x570bc6[_0x4733('0x1e')],function(_0x5e31c8){return{'model':db[_0x5e31c8[_0x4733('0x20')]],'as':_0x5e31c8['as'],'attributes':_0x5e31c8[_0x4733('0x1c')],'include':_0x5e31c8[_0x4733('0x1e')]?_['map'](_0x5e31c8[_0x4733('0x1e')],function(_0x10a5e9){return{'model':db[_0x10a5e9[_0x4733('0x20')]],'as':_0x10a5e9['as'],'attributes':_0x10a5e9[_0x4733('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x311c1d){logger[_0x4733('0xd')](_0x4733('0x23'),_0x50f67e);logger['debug'](_0x4733('0x23'),_0x50f67e,JSON['stringify'](_0x311c1d));_0x56872b(_0x311c1d);})[_0x4733('0x24')](function(_0x29db03){logger[_0x4733('0x12')](_0x4733('0x23'),_0x29db03[_0x4733('0x14')],_0x50f67e);_0x5a4814(_0x2b2757[_0x4733('0x12')](0x1f4,_0x29db03[_0x4733('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 6e51fc6..dfbdd69 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 _0x63ad=['getFields','/:id/descriptions','getDescriptions','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id/fields','isAuthenticated'];(function(_0x70d977,_0x41bc6e){var _0x45a9bf=function(_0x3c9d7a){while(--_0x3c9d7a){_0x70d977['push'](_0x70d977['shift']());}};_0x45a9bf(++_0x41bc6e);}(_0x63ad,0x1ed));var _0xd63a=function(_0xb53cf3,_0x506b5c){_0xb53cf3=_0xb53cf3-0x0;var _0x4e23f9=_0x63ad[_0xb53cf3];return _0x4e23f9;};'use strict';var multer=require(_0xd63a('0x0'));var util=require(_0xd63a('0x1'));var path=require(_0xd63a('0x2'));var timeout=require(_0xd63a('0x3'));var express=require(_0xd63a('0x4'));var router=express[_0xd63a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd63a('0x6'));var interaction=require(_0xd63a('0x7'));var config=require(_0xd63a('0x8'));var controller=require(_0xd63a('0x9'));router[_0xd63a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd63a('0xa')](_0xd63a('0xb'),auth[_0xd63a('0xc')](),controller[_0xd63a('0xd')]);router[_0xd63a('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xd63a('0xa')](_0xd63a('0xe'),auth[_0xd63a('0xc')](),controller[_0xd63a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd63a('0x10')](_0xd63a('0x11'),auth[_0xd63a('0xc')](),controller[_0xd63a('0x12')]);router[_0xd63a('0x13')](_0xd63a('0x11'),auth[_0xd63a('0xc')](),controller[_0xd63a('0x14')]);module[_0xd63a('0x15')]=router; \ No newline at end of file +var _0xab64=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0xab64,0x180));var _0x4ab6=function(_0x2c1de4,_0x4a9427){_0x2c1de4=_0x2c1de4-0x0;var _0x2b7591=_0xab64[_0x2c1de4];return _0x2b7591;};'use strict';var multer=require('multer');var util=require(_0x4ab6('0x0'));var path=require(_0x4ab6('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ab6('0x2'));var router=express['Router']();var fs_extra=require(_0x4ab6('0x3'));var auth=require(_0x4ab6('0x4'));var interaction=require(_0x4ab6('0x5'));var config=require(_0x4ab6('0x6'));var controller=require(_0x4ab6('0x7'));router[_0x4ab6('0x8')]('/',auth['isAuthenticated'](),controller[_0x4ab6('0x9')]);router['get']('/:id',auth[_0x4ab6('0xa')](),controller[_0x4ab6('0xb')]);router['get'](_0x4ab6('0xc'),auth[_0x4ab6('0xa')](),controller[_0x4ab6('0xd')]);router[_0x4ab6('0x8')]('/:id/subjects',auth[_0x4ab6('0xa')](),controller['getSubjects']);router[_0x4ab6('0x8')](_0x4ab6('0xe'),auth[_0x4ab6('0xa')](),controller[_0x4ab6('0xf')]);router[_0x4ab6('0x10')]('/',auth[_0x4ab6('0xa')](),controller[_0x4ab6('0x11')]);router[_0x4ab6('0x12')](_0x4ab6('0x13'),auth[_0x4ab6('0xa')](),controller[_0x4ab6('0x14')]);router[_0x4ab6('0x15')](_0x4ab6('0x13'),auth[_0x4ab6('0xa')](),controller[_0x4ab6('0x16')]);module[_0x4ab6('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 92759d1..c8d068e 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 _0xcac9=['exports','STRING'];(function(_0x17a99d,_0x1f8349){var _0x4132e7=function(_0x280d8c){while(--_0x280d8c){_0x17a99d['push'](_0x17a99d['shift']());}};_0x4132e7(++_0x1f8349);}(_0xcac9,0xa8));var _0x9cac=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0xcac9[_0x459a0a];return _0x4ab46c;};'use strict';var Sequelize=require('sequelize');module[_0x9cac('0x0')]={'name':{'type':Sequelize[_0x9cac('0x1')]},'description':{'type':Sequelize[_0x9cac('0x1')]}}; \ No newline at end of file +var _0x1172=['sequelize','exports','STRING'];(function(_0x2352ba,_0x17df46){var _0x349bdb=function(_0x40dc92){while(--_0x40dc92){_0x2352ba['push'](_0x2352ba['shift']());}};_0x349bdb(++_0x17df46);}(_0x1172,0xb7));var _0x2117=function(_0x5da319,_0x25fd3){_0x5da319=_0x5da319-0x0;var _0xc51617=_0x1172[_0x5da319];return _0xc51617;};'use strict';var Sequelize=require(_0x2117('0x0'));module[_0x2117('0x1')]={'name':{'type':Sequelize[_0x2117('0x2')]},'description':{'type':Sequelize[_0x2117('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 382bec8..5ba5647 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 _0x1596=['then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','include','findAll','catch','show','params','includeAll','options','find','create','body','VtigerField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x1596,0x16f));var _0x6159=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1596[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x6159('0x0'));var rimraf=require(_0x6159('0x1'));var zipdir=require(_0x6159('0x2'));var jsonpatch=require(_0x6159('0x3'));var rp=require('request-promise');var moment=require(_0x6159('0x4'));var BPromise=require(_0x6159('0x5'));var Mustache=require(_0x6159('0x6'));var util=require('util');var path=require(_0x6159('0x7'));var sox=require(_0x6159('0x8'));var csv=require(_0x6159('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6159('0xa'));var _=require(_0x6159('0xb'));var squel=require(_0x6159('0xc'));var crypto=require(_0x6159('0xd'));var jsforce=require(_0x6159('0xe'));var deskjs=require(_0x6159('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6159('0x10'));var Papa=require('papaparse');var Redis=require(_0x6159('0x11'));var authService=require(_0x6159('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6159('0x13'));var hardwareService=require(_0x6159('0x14'));var logger=require(_0x6159('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6159('0x16'));var licenseUtil=require(_0x6159('0x17'));var db=require(_0x6159('0x18'))['db'];function respondWithStatusCode(_0x366dda,_0x2864b5){_0x2864b5=_0x2864b5||0xcc;return function(_0x2d2f8b){if(_0x2d2f8b){return _0x366dda[_0x6159('0x19')](_0x2864b5);}return _0x366dda[_0x6159('0x1a')](_0x2864b5)[_0x6159('0x1b')]();};}function respondWithResult(_0x17cb83,_0x2e0cd9){_0x2e0cd9=_0x2e0cd9||0xc8;return function(_0x1c50e5){if(_0x1c50e5){return _0x17cb83[_0x6159('0x1a')](_0x2e0cd9)[_0x6159('0x1c')](_0x1c50e5);}};}function respondWithFilteredResult(_0x3572c0,_0xe3f67d){return function(_0x210fe8){if(_0x210fe8){var _0x35b27c=typeof _0xe3f67d['offset']==='undefined'&&typeof _0xe3f67d[_0x6159('0x1d')]===_0x6159('0x1e');var _0x143c7f=_0x210fe8['count'];var _0x368d1f=_0x35b27c?0x0:_0xe3f67d[_0x6159('0x1f')];var _0x141199=_0x35b27c?_0x210fe8[_0x6159('0x20')]:_0xe3f67d['offset']+_0xe3f67d[_0x6159('0x1d')];var _0x47deee;if(_0x141199>=_0x143c7f){_0x141199=_0x143c7f;_0x47deee=0xc8;}else{_0x47deee=0xce;}_0x3572c0[_0x6159('0x1a')](_0x47deee);return _0x3572c0[_0x6159('0x21')](_0x6159('0x22'),_0x368d1f+'-'+_0x141199+'/'+_0x143c7f)['json'](_0x210fe8);}return null;};}function patchUpdates(_0x54f210){return function(_0x2ece57){try{jsonpatch['apply'](_0x2ece57,_0x54f210,!![]);}catch(_0x31dd68){return BPromise[_0x6159('0x23')](_0x31dd68);}return _0x2ece57[_0x6159('0x24')]();};}function saveUpdates(_0x1f1ec5,_0x4a0863){return function(_0x1fe11d){if(_0x1fe11d){return _0x1fe11d[_0x6159('0x25')](_0x1f1ec5)[_0x6159('0x26')](function(_0x130d73){return _0x130d73;});}return null;};}function removeEntity(_0xba9d9,_0x29024f){return function(_0x5685a7){if(_0x5685a7){return _0x5685a7[_0x6159('0x27')]()['then'](function(){_0xba9d9[_0x6159('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf0c1,_0x9d9968){return function(_0x526a03){if(!_0x526a03){_0x4bf0c1[_0x6159('0x19')](0x194);}return _0x526a03;};}function handleError(_0x502903,_0x1e739e){_0x1e739e=_0x1e739e||0x1f4;return function(_0x178004){logger[_0x6159('0x28')](_0x178004[_0x6159('0x29')]);if(_0x178004['name']){delete _0x178004[_0x6159('0x2a')];}_0x502903[_0x6159('0x1a')](_0x1e739e)[_0x6159('0x2b')](_0x178004);};}exports[_0x6159('0x2c')]=function(_0x4fa594,_0x35ec60){var _0x53f158={},_0x318e41={},_0x4f88bd={'count':0x0,'rows':[]};var _0x169b5f=_[_0x6159('0x2d')](db[_0x6159('0x2e')][_0x6159('0x2f')],function(_0x426411){return{'name':_0x426411[_0x6159('0x30')],'type':_0x426411[_0x6159('0x31')][_0x6159('0x32')]};});_0x318e41['model']=_[_0x6159('0x2d')](_0x169b5f,_0x6159('0x2a'));_0x318e41[_0x6159('0x33')]=_[_0x6159('0x34')](_0x4fa594['query']);_0x318e41['filters']=_[_0x6159('0x35')](_0x318e41[_0x6159('0x36')],_0x318e41[_0x6159('0x33')]);_0x53f158[_0x6159('0x37')]=_['intersection'](_0x318e41[_0x6159('0x36')],qs[_0x6159('0x38')](_0x4fa594[_0x6159('0x33')][_0x6159('0x38')]));_0x53f158['attributes']=_0x53f158[_0x6159('0x37')][_0x6159('0x39')]?_0x53f158[_0x6159('0x37')]:_0x318e41[_0x6159('0x36')];if(!_0x4fa594[_0x6159('0x33')][_0x6159('0x3a')](_0x6159('0x3b'))){_0x53f158[_0x6159('0x1d')]=qs[_0x6159('0x1d')](_0x4fa594[_0x6159('0x33')][_0x6159('0x1d')]);_0x53f158[_0x6159('0x1f')]=qs[_0x6159('0x1f')](_0x4fa594[_0x6159('0x33')][_0x6159('0x1f')]);}_0x53f158[_0x6159('0x3c')]=qs['sort'](_0x4fa594[_0x6159('0x33')][_0x6159('0x3d')]);_0x53f158[_0x6159('0x3e')]=qs[_0x6159('0x3f')](_[_0x6159('0x40')](_0x4fa594[_0x6159('0x33')],_0x318e41[_0x6159('0x3f')]),_0x169b5f);if(_0x4fa594[_0x6159('0x33')][_0x6159('0x41')]){_0x53f158[_0x6159('0x3e')]=_['merge'](_0x53f158[_0x6159('0x3e')],{'$or':_['map'](_0x169b5f,function(_0x5756fa){if(_0x5756fa[_0x6159('0x31')]!=='VIRTUAL'){var _0x440dee={};_0x440dee[_0x5756fa[_0x6159('0x2a')]]={'$like':'%'+_0x4fa594['query'][_0x6159('0x41')]+'%'};return _0x440dee;}})});}_0x53f158=_[_0x6159('0x42')]({},_0x53f158,_0x4fa594['options']);var _0xfcba7d={'where':_0x53f158[_0x6159('0x3e')]};return db[_0x6159('0x2e')][_0x6159('0x20')](_0xfcba7d)['then'](function(_0x8b8334){_0x4f88bd[_0x6159('0x20')]=_0x8b8334;if(_0x4fa594[_0x6159('0x33')]['includeAll']){_0x53f158[_0x6159('0x43')]=[{'all':!![]}];}return db[_0x6159('0x2e')][_0x6159('0x44')](_0x53f158);})[_0x6159('0x26')](function(_0x4f26d3){_0x4f88bd['rows']=_0x4f26d3;return _0x4f88bd;})[_0x6159('0x26')](respondWithFilteredResult(_0x35ec60,_0x53f158))[_0x6159('0x45')](handleError(_0x35ec60,null));};exports[_0x6159('0x46')]=function(_0x3c1265,_0x389af4){var _0x5cfb8b={'raw':![],'where':{'id':_0x3c1265[_0x6159('0x47')]['id']}},_0x6bfa40={};_0x6bfa40[_0x6159('0x36')]=_[_0x6159('0x34')](db['VtigerConfiguration'][_0x6159('0x2f')]);_0x6bfa40[_0x6159('0x33')]=_['keys'](_0x3c1265[_0x6159('0x33')]);_0x6bfa40[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x6bfa40[_0x6159('0x36')],_0x6bfa40[_0x6159('0x33')]);_0x5cfb8b[_0x6159('0x37')]=_[_0x6159('0x35')](_0x6bfa40[_0x6159('0x36')],qs[_0x6159('0x38')](_0x3c1265[_0x6159('0x33')]['fields']));_0x5cfb8b['attributes']=_0x5cfb8b[_0x6159('0x37')][_0x6159('0x39')]?_0x5cfb8b[_0x6159('0x37')]:_0x6bfa40[_0x6159('0x36')];if(_0x3c1265['query'][_0x6159('0x48')]){_0x5cfb8b[_0x6159('0x43')]=[{'all':!![]}];}_0x5cfb8b=_[_0x6159('0x42')]({},_0x5cfb8b,_0x3c1265[_0x6159('0x49')]);return db[_0x6159('0x2e')][_0x6159('0x4a')](_0x5cfb8b)[_0x6159('0x26')](handleEntityNotFound(_0x389af4,null))[_0x6159('0x26')](respondWithResult(_0x389af4,null))[_0x6159('0x45')](handleError(_0x389af4,null));};exports[_0x6159('0x4b')]=function(_0x1ee2ea,_0x1beded){return db[_0x6159('0x2e')][_0x6159('0x4b')](_0x1ee2ea['body'],{})[_0x6159('0x26')](respondWithResult(_0x1beded,0xc9))['catch'](handleError(_0x1beded,null));};exports[_0x6159('0x25')]=function(_0x4d581f,_0x45e002){if(_0x4d581f['body']['id']){delete _0x4d581f['body']['id'];}return db[_0x6159('0x2e')]['find']({'where':{'id':_0x4d581f[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x45e002,null))[_0x6159('0x26')](saveUpdates(_0x4d581f[_0x6159('0x4c')],null))[_0x6159('0x26')](respondWithResult(_0x45e002,null))[_0x6159('0x45')](handleError(_0x45e002,null));};exports[_0x6159('0x27')]=function(_0x534864,_0x381447){return db[_0x6159('0x2e')]['find']({'where':{'id':_0x534864[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x381447,null))['then'](removeEntity(_0x381447,null))['catch'](handleError(_0x381447,null));};exports['getFields']=function(_0x12455a,_0x21e0b1,_0x2b4d38){var _0x12ecad={};var _0x4044ac={};var _0x1a56b6;var _0x56381d;return db[_0x6159('0x2e')]['findOne']({'where':{'id':_0x12455a[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x21e0b1,null))[_0x6159('0x26')](function(_0x2d012c){if(_0x2d012c){_0x1a56b6=_0x2d012c;_0x4044ac[_0x6159('0x36')]=_[_0x6159('0x34')](db[_0x6159('0x4d')][_0x6159('0x2f')]);_0x4044ac[_0x6159('0x33')]=_[_0x6159('0x34')](_0x12455a[_0x6159('0x33')]);_0x4044ac[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x4044ac[_0x6159('0x36')],_0x4044ac[_0x6159('0x33')]);_0x12ecad[_0x6159('0x37')]=_[_0x6159('0x35')](_0x4044ac[_0x6159('0x36')],qs[_0x6159('0x38')](_0x12455a[_0x6159('0x33')][_0x6159('0x38')]));_0x12ecad[_0x6159('0x37')]=_0x12ecad[_0x6159('0x37')]['length']?_0x12ecad[_0x6159('0x37')]:_0x4044ac['model'];_0x12ecad[_0x6159('0x3c')]=qs['sort'](_0x12455a[_0x6159('0x33')]['sort']);_0x12ecad[_0x6159('0x3e')]=qs[_0x6159('0x3f')](_['pick'](_0x12455a['query'],_0x4044ac[_0x6159('0x3f')]));if(_0x12455a[_0x6159('0x33')][_0x6159('0x41')]){_0x12ecad[_0x6159('0x3e')]=_[_0x6159('0x42')](_0x12ecad[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x12ecad['attributes'],function(_0x10d12d){var _0x4fc377={};_0x4fc377[_0x10d12d]={'$like':'%'+_0x12455a[_0x6159('0x33')][_0x6159('0x41')]+'%'};return _0x4fc377;})});}_0x12ecad=_['merge']({},_0x12ecad,_0x12455a['options']);return _0x1a56b6['getFields'](_0x12ecad);}})[_0x6159('0x26')](function(_0x25561a){if(_0x25561a){_0x56381d=_0x25561a[_0x6159('0x39')];if(!_0x12455a['query'][_0x6159('0x3a')]('nolimit')){_0x12ecad['limit']=qs[_0x6159('0x1d')](_0x12455a['query'][_0x6159('0x1d')]);_0x12ecad[_0x6159('0x1f')]=qs['offset'](_0x12455a[_0x6159('0x33')][_0x6159('0x1f')]);}return _0x1a56b6['getFields'](_0x12ecad);}})[_0x6159('0x26')](function(_0x4cd8ee){if(_0x4cd8ee){return _0x4cd8ee?{'count':_0x56381d,'rows':_0x4cd8ee}:null;}})[_0x6159('0x26')](respondWithResult(_0x21e0b1,null))[_0x6159('0x45')](handleError(_0x21e0b1,null));};exports[_0x6159('0x4e')]=function(_0xce2404,_0x5b8a8c,_0x576dcd){var _0x59a2d5={};var _0x36a3c0={};var _0x35857b;var _0x5471fc;return db[_0x6159('0x2e')][_0x6159('0x4f')]({'where':{'id':_0xce2404[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x5b8a8c,null))[_0x6159('0x26')](function(_0x1803c){if(_0x1803c){_0x35857b=_0x1803c;_0x36a3c0['model']=_['keys'](db[_0x6159('0x4d')][_0x6159('0x2f')]);_0x36a3c0[_0x6159('0x33')]=_[_0x6159('0x34')](_0xce2404[_0x6159('0x33')]);_0x36a3c0[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x36a3c0['model'],_0x36a3c0[_0x6159('0x33')]);_0x59a2d5[_0x6159('0x37')]=_[_0x6159('0x35')](_0x36a3c0[_0x6159('0x36')],qs['fields'](_0xce2404[_0x6159('0x33')][_0x6159('0x38')]));_0x59a2d5[_0x6159('0x37')]=_0x59a2d5[_0x6159('0x37')][_0x6159('0x39')]?_0x59a2d5[_0x6159('0x37')]:_0x36a3c0[_0x6159('0x36')];_0x59a2d5['order']=qs['sort'](_0xce2404[_0x6159('0x33')]['sort']);_0x59a2d5['where']=qs[_0x6159('0x3f')](_[_0x6159('0x40')](_0xce2404[_0x6159('0x33')],_0x36a3c0[_0x6159('0x3f')]));if(_0xce2404[_0x6159('0x33')][_0x6159('0x41')]){_0x59a2d5[_0x6159('0x3e')]=_['merge'](_0x59a2d5[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x59a2d5[_0x6159('0x37')],function(_0x3da6c6){var _0x19e747={};_0x19e747[_0x3da6c6]={'$like':'%'+_0xce2404['query']['filter']+'%'};return _0x19e747;})});}_0x59a2d5=_[_0x6159('0x42')]({},_0x59a2d5,_0xce2404[_0x6159('0x49')]);return _0x35857b['getSubjects'](_0x59a2d5);}})[_0x6159('0x26')](function(_0x8a5228){if(_0x8a5228){_0x5471fc=_0x8a5228['length'];if(!_0xce2404[_0x6159('0x33')]['hasOwnProperty'](_0x6159('0x3b'))){_0x59a2d5['limit']=qs[_0x6159('0x1d')](_0xce2404['query'][_0x6159('0x1d')]);_0x59a2d5[_0x6159('0x1f')]=qs['offset'](_0xce2404[_0x6159('0x33')]['offset']);}return _0x35857b[_0x6159('0x4e')](_0x59a2d5);}})['then'](function(_0x210c00){if(_0x210c00){return _0x210c00?{'count':_0x5471fc,'rows':_0x210c00}:null;}})[_0x6159('0x26')](respondWithResult(_0x5b8a8c,null))[_0x6159('0x45')](handleError(_0x5b8a8c,null));};exports[_0x6159('0x50')]=function(_0x57f5dd,_0x57b2d6,_0x3bff9c){var _0x2100c8={};var _0x429f7b={};var _0x5573a1;var _0x43f361;return db[_0x6159('0x2e')][_0x6159('0x4f')]({'where':{'id':_0x57f5dd['params']['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x57b2d6,null))['then'](function(_0x21ed85){if(_0x21ed85){_0x5573a1=_0x21ed85;_0x429f7b['model']=_[_0x6159('0x34')](db[_0x6159('0x4d')][_0x6159('0x2f')]);_0x429f7b['query']=_[_0x6159('0x34')](_0x57f5dd[_0x6159('0x33')]);_0x429f7b[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x429f7b[_0x6159('0x36')],_0x429f7b['query']);_0x2100c8['attributes']=_[_0x6159('0x35')](_0x429f7b[_0x6159('0x36')],qs[_0x6159('0x38')](_0x57f5dd[_0x6159('0x33')]['fields']));_0x2100c8[_0x6159('0x37')]=_0x2100c8[_0x6159('0x37')][_0x6159('0x39')]?_0x2100c8['attributes']:_0x429f7b['model'];_0x2100c8[_0x6159('0x3c')]=qs[_0x6159('0x3d')](_0x57f5dd['query']['sort']);_0x2100c8['where']=qs[_0x6159('0x3f')](_['pick'](_0x57f5dd['query'],_0x429f7b[_0x6159('0x3f')]));if(_0x57f5dd[_0x6159('0x33')][_0x6159('0x41')]){_0x2100c8[_0x6159('0x3e')]=_[_0x6159('0x42')](_0x2100c8[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x2100c8['attributes'],function(_0x4a6d2d){var _0x5536d5={};_0x5536d5[_0x4a6d2d]={'$like':'%'+_0x57f5dd[_0x6159('0x33')]['filter']+'%'};return _0x5536d5;})});}_0x2100c8=_[_0x6159('0x42')]({},_0x2100c8,_0x57f5dd['options']);return _0x5573a1[_0x6159('0x50')](_0x2100c8);}})[_0x6159('0x26')](function(_0x5d1cbe){if(_0x5d1cbe){_0x43f361=_0x5d1cbe[_0x6159('0x39')];if(!_0x57f5dd['query'][_0x6159('0x3a')](_0x6159('0x3b'))){_0x2100c8['limit']=qs[_0x6159('0x1d')](_0x57f5dd[_0x6159('0x33')][_0x6159('0x1d')]);_0x2100c8['offset']=qs['offset'](_0x57f5dd['query'][_0x6159('0x1f')]);}return _0x5573a1['getDescriptions'](_0x2100c8);}})['then'](function(_0x53ec6a){if(_0x53ec6a){return _0x53ec6a?{'count':_0x43f361,'rows':_0x53ec6a}:null;}})[_0x6159('0x26')](respondWithResult(_0x57b2d6,null))[_0x6159('0x45')](handleError(_0x57b2d6,null));}; \ No newline at end of file +var _0x25dc=['fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','limit','undefined','count','offset','set','json','reject','save','update','then','destroy','error','stack','name','map','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','params','rawAttributes','length','find','catch','create','body','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs'];(function(_0x3c1d19,_0x899864){var _0x312a39=function(_0xa63467){while(--_0xa63467){_0x3c1d19['push'](_0x3c1d19['shift']());}};_0x312a39(++_0x899864);}(_0x25dc,0x135));var _0xc25d=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x25dc[_0x5d860f];return _0x236490;};'use strict';var emlformat=require(_0xc25d('0x0'));var rimraf=require(_0xc25d('0x1'));var zipdir=require(_0xc25d('0x2'));var jsonpatch=require(_0xc25d('0x3'));var rp=require(_0xc25d('0x4'));var moment=require(_0xc25d('0x5'));var BPromise=require(_0xc25d('0x6'));var Mustache=require(_0xc25d('0x7'));var util=require(_0xc25d('0x8'));var path=require(_0xc25d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc25d('0xa'));var fs=require('fs');var fs_extra=require(_0xc25d('0xb'));var _=require(_0xc25d('0xc'));var squel=require(_0xc25d('0xd'));var crypto=require('crypto');var jsforce=require(_0xc25d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc25d('0xf'));var querystring=require(_0xc25d('0x10'));var Papa=require(_0xc25d('0x11'));var Redis=require(_0xc25d('0x12'));var authService=require(_0xc25d('0x13'));var qs=require(_0xc25d('0x14'));var as=require(_0xc25d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc25d('0x16'))(_0xc25d('0x17'));var utils=require(_0xc25d('0x18'));var config=require(_0xc25d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f6610,_0x43164a){_0x43164a=_0x43164a||0xcc;return function(_0x50b799){if(_0x50b799){return _0x2f6610[_0xc25d('0x1a')](_0x43164a);}return _0x2f6610['status'](_0x43164a)[_0xc25d('0x1b')]();};}function respondWithResult(_0x2077b,_0x3b6325){_0x3b6325=_0x3b6325||0xc8;return function(_0x31abc6){if(_0x31abc6){return _0x2077b[_0xc25d('0x1c')](_0x3b6325)['json'](_0x31abc6);}};}function respondWithFilteredResult(_0x13b983,_0x1c6700){return function(_0x554ea2){if(_0x554ea2){var _0x2447b9=typeof _0x1c6700['offset']==='undefined'&&typeof _0x1c6700[_0xc25d('0x1d')]===_0xc25d('0x1e');var _0x2be5eb=_0x554ea2[_0xc25d('0x1f')];var _0x432621=_0x2447b9?0x0:_0x1c6700[_0xc25d('0x20')];var _0x568a1f=_0x2447b9?_0x554ea2[_0xc25d('0x1f')]:_0x1c6700[_0xc25d('0x20')]+_0x1c6700[_0xc25d('0x1d')];var _0x177030;if(_0x568a1f>=_0x2be5eb){_0x568a1f=_0x2be5eb;_0x177030=0xc8;}else{_0x177030=0xce;}_0x13b983[_0xc25d('0x1c')](_0x177030);return _0x13b983[_0xc25d('0x21')]('Content-Range',_0x432621+'-'+_0x568a1f+'/'+_0x2be5eb)[_0xc25d('0x22')](_0x554ea2);}return null;};}function patchUpdates(_0x11298b){return function(_0x1d8cea){try{jsonpatch['apply'](_0x1d8cea,_0x11298b,!![]);}catch(_0x5d46be){return BPromise[_0xc25d('0x23')](_0x5d46be);}return _0x1d8cea[_0xc25d('0x24')]();};}function saveUpdates(_0x4b2243,_0x246084){return function(_0x18a07c){if(_0x18a07c){return _0x18a07c[_0xc25d('0x25')](_0x4b2243)[_0xc25d('0x26')](function(_0x7c65ee){return _0x7c65ee;});}return null;};}function removeEntity(_0x201af4,_0x30fc52){return function(_0x917a45){if(_0x917a45){return _0x917a45[_0xc25d('0x27')]()[_0xc25d('0x26')](function(){_0x201af4[_0xc25d('0x1c')](0xcc)[_0xc25d('0x1b')]();});}};}function handleEntityNotFound(_0x429d95,_0x29a685){return function(_0x314116){if(!_0x314116){_0x429d95[_0xc25d('0x1a')](0x194);}return _0x314116;};}function handleError(_0x60891d,_0x1d7ea3){_0x1d7ea3=_0x1d7ea3||0x1f4;return function(_0x5af25f){logger[_0xc25d('0x28')](_0x5af25f[_0xc25d('0x29')]);if(_0x5af25f['name']){delete _0x5af25f[_0xc25d('0x2a')];}_0x60891d[_0xc25d('0x1c')](_0x1d7ea3)['send'](_0x5af25f);};}exports['index']=function(_0x4ddee7,_0x2b93ff){var _0x38171c={},_0x343e0b={},_0x2ed1d6={'count':0x0,'rows':[]};var _0x4fd418=_[_0xc25d('0x2b')](db['VtigerConfiguration']['rawAttributes'],function(_0x265ab9){return{'name':_0x265ab9[_0xc25d('0x2c')],'type':_0x265ab9[_0xc25d('0x2d')][_0xc25d('0x2e')]};});_0x343e0b[_0xc25d('0x2f')]=_['map'](_0x4fd418,'name');_0x343e0b['query']=_[_0xc25d('0x30')](_0x4ddee7['query']);_0x343e0b[_0xc25d('0x31')]=_[_0xc25d('0x32')](_0x343e0b[_0xc25d('0x2f')],_0x343e0b[_0xc25d('0x33')]);_0x38171c['attributes']=_[_0xc25d('0x32')](_0x343e0b[_0xc25d('0x2f')],qs[_0xc25d('0x34')](_0x4ddee7[_0xc25d('0x33')][_0xc25d('0x34')]));_0x38171c[_0xc25d('0x35')]=_0x38171c[_0xc25d('0x35')]['length']?_0x38171c[_0xc25d('0x35')]:_0x343e0b['model'];if(!_0x4ddee7['query'][_0xc25d('0x36')](_0xc25d('0x37'))){_0x38171c[_0xc25d('0x1d')]=qs[_0xc25d('0x1d')](_0x4ddee7[_0xc25d('0x33')][_0xc25d('0x1d')]);_0x38171c[_0xc25d('0x20')]=qs[_0xc25d('0x20')](_0x4ddee7[_0xc25d('0x33')][_0xc25d('0x20')]);}_0x38171c[_0xc25d('0x38')]=qs[_0xc25d('0x39')](_0x4ddee7[_0xc25d('0x33')][_0xc25d('0x39')]);_0x38171c[_0xc25d('0x3a')]=qs[_0xc25d('0x31')](_[_0xc25d('0x3b')](_0x4ddee7['query'],_0x343e0b[_0xc25d('0x31')]),_0x4fd418);if(_0x4ddee7[_0xc25d('0x33')][_0xc25d('0x3c')]){_0x38171c[_0xc25d('0x3a')]=_[_0xc25d('0x3d')](_0x38171c['where'],{'$or':_[_0xc25d('0x2b')](_0x4fd418,function(_0x5c2f0a){if(_0x5c2f0a[_0xc25d('0x2d')]!==_0xc25d('0x3e')){var _0x52845d={};_0x52845d[_0x5c2f0a[_0xc25d('0x2a')]]={'$like':'%'+_0x4ddee7['query'][_0xc25d('0x3c')]+'%'};return _0x52845d;}})});}_0x38171c=_[_0xc25d('0x3d')]({},_0x38171c,_0x4ddee7[_0xc25d('0x3f')]);var _0x1be665={'where':_0x38171c[_0xc25d('0x3a')]};return db[_0xc25d('0x40')]['count'](_0x1be665)['then'](function(_0x4bb108){_0x2ed1d6[_0xc25d('0x1f')]=_0x4bb108;if(_0x4ddee7[_0xc25d('0x33')][_0xc25d('0x41')]){_0x38171c[_0xc25d('0x42')]=[{'all':!![]}];}return db[_0xc25d('0x40')][_0xc25d('0x43')](_0x38171c);})[_0xc25d('0x26')](function(_0x29a9e6){_0x2ed1d6['rows']=_0x29a9e6;return _0x2ed1d6;})[_0xc25d('0x26')](respondWithFilteredResult(_0x2b93ff,_0x38171c))['catch'](handleError(_0x2b93ff,null));};exports['show']=function(_0xe06a8e,_0x64a6c3){var _0xd22f4e={'raw':![],'where':{'id':_0xe06a8e[_0xc25d('0x44')]['id']}},_0x144094={};_0x144094[_0xc25d('0x2f')]=_['keys'](db['VtigerConfiguration'][_0xc25d('0x45')]);_0x144094[_0xc25d('0x33')]=_['keys'](_0xe06a8e[_0xc25d('0x33')]);_0x144094['filters']=_['intersection'](_0x144094[_0xc25d('0x2f')],_0x144094['query']);_0xd22f4e[_0xc25d('0x35')]=_['intersection'](_0x144094[_0xc25d('0x2f')],qs[_0xc25d('0x34')](_0xe06a8e['query'][_0xc25d('0x34')]));_0xd22f4e[_0xc25d('0x35')]=_0xd22f4e['attributes'][_0xc25d('0x46')]?_0xd22f4e[_0xc25d('0x35')]:_0x144094['model'];if(_0xe06a8e['query']['includeAll']){_0xd22f4e[_0xc25d('0x42')]=[{'all':!![]}];}_0xd22f4e=_[_0xc25d('0x3d')]({},_0xd22f4e,_0xe06a8e[_0xc25d('0x3f')]);return db[_0xc25d('0x40')][_0xc25d('0x47')](_0xd22f4e)[_0xc25d('0x26')](handleEntityNotFound(_0x64a6c3,null))[_0xc25d('0x26')](respondWithResult(_0x64a6c3,null))[_0xc25d('0x48')](handleError(_0x64a6c3,null));};exports[_0xc25d('0x49')]=function(_0x5ed3f8,_0x49fedc){return db['VtigerConfiguration'][_0xc25d('0x49')](_0x5ed3f8['body'],{})[_0xc25d('0x26')](respondWithResult(_0x49fedc,0xc9))['catch'](handleError(_0x49fedc,null));};exports[_0xc25d('0x25')]=function(_0x1270dd,_0x2402f7){if(_0x1270dd[_0xc25d('0x4a')]['id']){delete _0x1270dd[_0xc25d('0x4a')]['id'];}return db['VtigerConfiguration'][_0xc25d('0x47')]({'where':{'id':_0x1270dd[_0xc25d('0x44')]['id']}})[_0xc25d('0x26')](handleEntityNotFound(_0x2402f7,null))[_0xc25d('0x26')](saveUpdates(_0x1270dd[_0xc25d('0x4a')],null))[_0xc25d('0x26')](respondWithResult(_0x2402f7,null))[_0xc25d('0x48')](handleError(_0x2402f7,null));};exports[_0xc25d('0x27')]=function(_0x47bf22,_0x2749d7){return db[_0xc25d('0x40')][_0xc25d('0x47')]({'where':{'id':_0x47bf22['params']['id']}})[_0xc25d('0x26')](handleEntityNotFound(_0x2749d7,null))['then'](removeEntity(_0x2749d7,null))[_0xc25d('0x48')](handleError(_0x2749d7,null));};exports[_0xc25d('0x4b')]=function(_0x50d4b8,_0x530017,_0xa6692c){var _0x4464c4={};var _0x246d83={};var _0x31d355;var _0x104f37;return db[_0xc25d('0x40')]['findOne']({'where':{'id':_0x50d4b8['params']['id']}})[_0xc25d('0x26')](handleEntityNotFound(_0x530017,null))[_0xc25d('0x26')](function(_0x30e7c9){if(_0x30e7c9){_0x31d355=_0x30e7c9;_0x246d83[_0xc25d('0x2f')]=_[_0xc25d('0x30')](db[_0xc25d('0x4c')][_0xc25d('0x45')]);_0x246d83[_0xc25d('0x33')]=_[_0xc25d('0x30')](_0x50d4b8[_0xc25d('0x33')]);_0x246d83['filters']=_[_0xc25d('0x32')](_0x246d83[_0xc25d('0x2f')],_0x246d83['query']);_0x4464c4[_0xc25d('0x35')]=_[_0xc25d('0x32')](_0x246d83['model'],qs[_0xc25d('0x34')](_0x50d4b8[_0xc25d('0x33')][_0xc25d('0x34')]));_0x4464c4['attributes']=_0x4464c4[_0xc25d('0x35')][_0xc25d('0x46')]?_0x4464c4[_0xc25d('0x35')]:_0x246d83[_0xc25d('0x2f')];_0x4464c4[_0xc25d('0x38')]=qs['sort'](_0x50d4b8[_0xc25d('0x33')]['sort']);_0x4464c4[_0xc25d('0x3a')]=qs[_0xc25d('0x31')](_['pick'](_0x50d4b8[_0xc25d('0x33')],_0x246d83['filters']));if(_0x50d4b8[_0xc25d('0x33')][_0xc25d('0x3c')]){_0x4464c4[_0xc25d('0x3a')]=_[_0xc25d('0x3d')](_0x4464c4['where'],{'$or':_[_0xc25d('0x2b')](_0x4464c4[_0xc25d('0x35')],function(_0x5d2dfd){var _0x4e1682={};_0x4e1682[_0x5d2dfd]={'$like':'%'+_0x50d4b8[_0xc25d('0x33')]['filter']+'%'};return _0x4e1682;})});}_0x4464c4=_[_0xc25d('0x3d')]({},_0x4464c4,_0x50d4b8[_0xc25d('0x3f')]);return _0x31d355[_0xc25d('0x4b')](_0x4464c4);}})[_0xc25d('0x26')](function(_0x2d6210){if(_0x2d6210){_0x104f37=_0x2d6210[_0xc25d('0x46')];if(!_0x50d4b8['query'][_0xc25d('0x36')](_0xc25d('0x37'))){_0x4464c4[_0xc25d('0x1d')]=qs[_0xc25d('0x1d')](_0x50d4b8[_0xc25d('0x33')]['limit']);_0x4464c4[_0xc25d('0x20')]=qs[_0xc25d('0x20')](_0x50d4b8[_0xc25d('0x33')][_0xc25d('0x20')]);}return _0x31d355[_0xc25d('0x4b')](_0x4464c4);}})[_0xc25d('0x26')](function(_0x4d8aa4){if(_0x4d8aa4){return _0x4d8aa4?{'count':_0x104f37,'rows':_0x4d8aa4}:null;}})[_0xc25d('0x26')](respondWithResult(_0x530017,null))[_0xc25d('0x48')](handleError(_0x530017,null));};exports[_0xc25d('0x4d')]=function(_0x5c3ab7,_0x307bce,_0x5ba5e3){var _0x941521={};var _0x3b392c={};var _0x396e12;var _0x58ad67;return db['VtigerConfiguration'][_0xc25d('0x4e')]({'where':{'id':_0x5c3ab7[_0xc25d('0x44')]['id']}})[_0xc25d('0x26')](handleEntityNotFound(_0x307bce,null))[_0xc25d('0x26')](function(_0x2f6f3c){if(_0x2f6f3c){_0x396e12=_0x2f6f3c;_0x3b392c[_0xc25d('0x2f')]=_[_0xc25d('0x30')](db[_0xc25d('0x4c')][_0xc25d('0x45')]);_0x3b392c[_0xc25d('0x33')]=_[_0xc25d('0x30')](_0x5c3ab7[_0xc25d('0x33')]);_0x3b392c[_0xc25d('0x31')]=_['intersection'](_0x3b392c[_0xc25d('0x2f')],_0x3b392c[_0xc25d('0x33')]);_0x941521[_0xc25d('0x35')]=_[_0xc25d('0x32')](_0x3b392c['model'],qs[_0xc25d('0x34')](_0x5c3ab7[_0xc25d('0x33')]['fields']));_0x941521[_0xc25d('0x35')]=_0x941521[_0xc25d('0x35')][_0xc25d('0x46')]?_0x941521[_0xc25d('0x35')]:_0x3b392c['model'];_0x941521[_0xc25d('0x38')]=qs[_0xc25d('0x39')](_0x5c3ab7[_0xc25d('0x33')][_0xc25d('0x39')]);_0x941521[_0xc25d('0x3a')]=qs[_0xc25d('0x31')](_[_0xc25d('0x3b')](_0x5c3ab7[_0xc25d('0x33')],_0x3b392c['filters']));if(_0x5c3ab7['query'][_0xc25d('0x3c')]){_0x941521['where']=_[_0xc25d('0x3d')](_0x941521[_0xc25d('0x3a')],{'$or':_[_0xc25d('0x2b')](_0x941521['attributes'],function(_0x3761c3){var _0x2e36ef={};_0x2e36ef[_0x3761c3]={'$like':'%'+_0x5c3ab7[_0xc25d('0x33')][_0xc25d('0x3c')]+'%'};return _0x2e36ef;})});}_0x941521=_['merge']({},_0x941521,_0x5c3ab7[_0xc25d('0x3f')]);return _0x396e12['getSubjects'](_0x941521);}})['then'](function(_0x230947){if(_0x230947){_0x58ad67=_0x230947[_0xc25d('0x46')];if(!_0x5c3ab7['query'][_0xc25d('0x36')](_0xc25d('0x37'))){_0x941521[_0xc25d('0x1d')]=qs[_0xc25d('0x1d')](_0x5c3ab7[_0xc25d('0x33')][_0xc25d('0x1d')]);_0x941521[_0xc25d('0x20')]=qs[_0xc25d('0x20')](_0x5c3ab7[_0xc25d('0x33')][_0xc25d('0x20')]);}return _0x396e12['getSubjects'](_0x941521);}})[_0xc25d('0x26')](function(_0x345432){if(_0x345432){return _0x345432?{'count':_0x58ad67,'rows':_0x345432}:null;}})[_0xc25d('0x26')](respondWithResult(_0x307bce,null))[_0xc25d('0x48')](handleError(_0x307bce,null));};exports[_0xc25d('0x4f')]=function(_0x334263,_0x39267f,_0x2c1b48){var _0x21a1bf={};var _0x16133d={};var _0x3a8b37;var _0x1938e0;return db[_0xc25d('0x40')][_0xc25d('0x4e')]({'where':{'id':_0x334263[_0xc25d('0x44')]['id']}})['then'](handleEntityNotFound(_0x39267f,null))[_0xc25d('0x26')](function(_0x1377fa){if(_0x1377fa){_0x3a8b37=_0x1377fa;_0x16133d['model']=_['keys'](db['VtigerField'][_0xc25d('0x45')]);_0x16133d['query']=_[_0xc25d('0x30')](_0x334263[_0xc25d('0x33')]);_0x16133d[_0xc25d('0x31')]=_[_0xc25d('0x32')](_0x16133d[_0xc25d('0x2f')],_0x16133d['query']);_0x21a1bf[_0xc25d('0x35')]=_[_0xc25d('0x32')](_0x16133d[_0xc25d('0x2f')],qs['fields'](_0x334263[_0xc25d('0x33')]['fields']));_0x21a1bf['attributes']=_0x21a1bf[_0xc25d('0x35')]['length']?_0x21a1bf[_0xc25d('0x35')]:_0x16133d[_0xc25d('0x2f')];_0x21a1bf[_0xc25d('0x38')]=qs[_0xc25d('0x39')](_0x334263[_0xc25d('0x33')]['sort']);_0x21a1bf[_0xc25d('0x3a')]=qs[_0xc25d('0x31')](_[_0xc25d('0x3b')](_0x334263['query'],_0x16133d[_0xc25d('0x31')]));if(_0x334263[_0xc25d('0x33')][_0xc25d('0x3c')]){_0x21a1bf[_0xc25d('0x3a')]=_['merge'](_0x21a1bf['where'],{'$or':_[_0xc25d('0x2b')](_0x21a1bf[_0xc25d('0x35')],function(_0x2b621e){var _0x38c1a3={};_0x38c1a3[_0x2b621e]={'$like':'%'+_0x334263[_0xc25d('0x33')][_0xc25d('0x3c')]+'%'};return _0x38c1a3;})});}_0x21a1bf=_[_0xc25d('0x3d')]({},_0x21a1bf,_0x334263[_0xc25d('0x3f')]);return _0x3a8b37[_0xc25d('0x4f')](_0x21a1bf);}})['then'](function(_0x59f9d2){if(_0x59f9d2){_0x1938e0=_0x59f9d2[_0xc25d('0x46')];if(!_0x334263[_0xc25d('0x33')]['hasOwnProperty'](_0xc25d('0x37'))){_0x21a1bf[_0xc25d('0x1d')]=qs[_0xc25d('0x1d')](_0x334263[_0xc25d('0x33')][_0xc25d('0x1d')]);_0x21a1bf[_0xc25d('0x20')]=qs['offset'](_0x334263[_0xc25d('0x33')][_0xc25d('0x20')]);}return _0x3a8b37[_0xc25d('0x4f')](_0x21a1bf);}})[_0xc25d('0x26')](function(_0x257d39){if(_0x257d39){return _0x257d39?{'count':_0x1938e0,'rows':_0x257d39}:null;}})['then'](respondWithResult(_0x39267f,null))[_0xc25d('0x48')](handleError(_0x39267f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 01c098a..d142fa3 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 _0x5af4=['../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerConfiguration.attributes','define','int_vtiger_configurations','lodash'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x5af4,0x17b));var _0x45af=function(_0x1403e0,_0x2c70a3){_0x1403e0=_0x1403e0-0x0;var _0x41a31f=_0x5af4[_0x1403e0];return _0x41a31f;};'use strict';var _=require(_0x45af('0x0'));var util=require('util');var logger=require(_0x45af('0x1'))(_0x45af('0x2'));var moment=require(_0x45af('0x3'));var BPromise=require(_0x45af('0x4'));var rp=require(_0x45af('0x5'));var fs=require('fs');var path=require(_0x45af('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x45af('0x7'));module['exports']=function(_0x3481ae,_0x25ad36){return _0x3481ae[_0x45af('0x8')]('VtigerConfiguration',attributes,{'tableName':_0x45af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ba=['define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes'];(function(_0x514305,_0x2ba656){var _0x34ed1b=function(_0xa50378){while(--_0xa50378){_0x514305['push'](_0x514305['shift']());}};_0x34ed1b(++_0x2ba656);}(_0xd2ba,0x6f));var _0xad2b=function(_0x3ef5bb,_0x27e3ac){_0x3ef5bb=_0x3ef5bb-0x0;var _0x59d620=_0xd2ba[_0x3ef5bb];return _0x59d620;};'use strict';var _=require(_0xad2b('0x0'));var util=require(_0xad2b('0x1'));var logger=require(_0xad2b('0x2'))('api');var moment=require(_0xad2b('0x3'));var BPromise=require(_0xad2b('0x4'));var rp=require(_0xad2b('0x5'));var fs=require('fs');var path=require(_0xad2b('0x6'));var rimraf=require(_0xad2b('0x7'));var config=require('../../config/environment');var attributes=require(_0xad2b('0x8'));module['exports']=function(_0x55173f,_0xfcf84c){return _0x55173f[_0xad2b('0x9')](_0xad2b('0xa'),attributes,{'tableName':_0xad2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 1d089b5..950f3c2 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 _0x0138=['message','info','catch','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0138,0x1cf));var _0x8013=function(_0x124042,_0x54227d){_0x124042=_0x124042-0x0;var _0x26e3bd=_0x0138[_0x124042];return _0x26e3bd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8013('0x0'));var BPromise=require(_0x8013('0x1'));var rs=require(_0x8013('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8013('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8013('0x4'));var config=require(_0x8013('0x5'));var jayson=require(_0x8013('0x6'));var client=jayson[_0x8013('0x7')][_0x8013('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b0f01,_0x549269,_0x21f6be){return new BPromise(function(_0x5e84e9,_0x52d561){return client[_0x8013('0x9')](_0x1b0f01,_0x21f6be)[_0x8013('0xa')](function(_0x2f0ea7){logger['info'](_0x8013('0xb'),_0x549269,_0x8013('0xc'));logger['debug'](_0x8013('0xd'),_0x549269,_0x8013('0xc'),JSON[_0x8013('0xe')](_0x2f0ea7));if(_0x2f0ea7['error']){if(_0x2f0ea7[_0x8013('0xf')][_0x8013('0x10')]===0x1f4){logger[_0x8013('0xf')](_0x8013('0xb'),_0x549269,_0x2f0ea7['error'][_0x8013('0x11')]);return _0x52d561(_0x2f0ea7['error'][_0x8013('0x11')]);}logger[_0x8013('0xf')](_0x8013('0xb'),_0x549269,_0x2f0ea7[_0x8013('0xf')]['message']);return _0x5e84e9(_0x2f0ea7[_0x8013('0xf')]['message']);}else{logger[_0x8013('0x12')](_0x8013('0xb'),_0x549269,'request\x20sent');_0x5e84e9(_0x2f0ea7['result'][_0x8013('0x11')]);}})[_0x8013('0x13')](function(_0xe45672){logger[_0x8013('0xf')](_0x8013('0xb'),_0x549269,_0xe45672);_0x52d561(_0xe45672);});});} \ No newline at end of file +var _0xfd24=['request','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xfd24,0xfa));var _0x4fd2=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0xfd24[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0x4fd2('0x0'));var util=require('util');var moment=require(_0x4fd2('0x1'));var BPromise=require(_0x4fd2('0x2'));var rs=require(_0x4fd2('0x3'));var fs=require('fs');var Redis=require(_0x4fd2('0x4'));var db=require(_0x4fd2('0x5'))['db'];var utils=require(_0x4fd2('0x6'));var logger=require('../../config/logger')(_0x4fd2('0x7'));var config=require(_0x4fd2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4fd2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46b49a,_0x1e0f35,_0x472edd){return new BPromise(function(_0x24fdca,_0x19fc1d){return client[_0x4fd2('0xa')](_0x46b49a,_0x472edd)['then'](function(_0xc1c837){logger['info'](_0x4fd2('0xb'),_0x1e0f35,'request\x20sent');logger[_0x4fd2('0xc')](_0x4fd2('0xd'),_0x1e0f35,_0x4fd2('0xe'),JSON[_0x4fd2('0xf')](_0xc1c837));if(_0xc1c837['error']){if(_0xc1c837['error'][_0x4fd2('0x10')]===0x1f4){logger['error'](_0x4fd2('0xb'),_0x1e0f35,_0xc1c837[_0x4fd2('0x11')]['message']);return _0x19fc1d(_0xc1c837[_0x4fd2('0x11')][_0x4fd2('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1e0f35,_0xc1c837['error'][_0x4fd2('0x12')]);return _0x24fdca(_0xc1c837[_0x4fd2('0x11')][_0x4fd2('0x12')]);}else{logger[_0x4fd2('0x13')](_0x4fd2('0xb'),_0x1e0f35,_0x4fd2('0xe'));_0x24fdca(_0xc1c837['result']['message']);}})['catch'](function(_0x4292ba){logger[_0x4fd2('0x11')](_0x4fd2('0xb'),_0x1e0f35,_0x4292ba);_0x19fc1d(_0x4292ba);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b722a8f..c2fd4e8 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 _0x2aab=['fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x2aab,0x118));var _0xb2aa=function(_0xd278a3,_0x22bd2f){_0xd278a3=_0xd278a3-0x0;var _0x2a4332=_0x2aab[_0xd278a3];return _0x2a4332;};'use strict';var multer=require('multer');var util=require(_0xb2aa('0x0'));var path=require(_0xb2aa('0x1'));var timeout=require(_0xb2aa('0x2'));var express=require(_0xb2aa('0x3'));var router=express[_0xb2aa('0x4')]();var fs_extra=require(_0xb2aa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb2aa('0x6'));var config=require(_0xb2aa('0x7'));var controller=require(_0xb2aa('0x8'));router[_0xb2aa('0x9')]('/',auth[_0xb2aa('0xa')](),controller[_0xb2aa('0xb')]);router['get'](_0xb2aa('0xc'),auth['isAuthenticated'](),controller[_0xb2aa('0xd')]);router[_0xb2aa('0xe')]('/',auth['isAuthenticated'](),controller[_0xb2aa('0xf')]);router[_0xb2aa('0x10')]('/:id',auth[_0xb2aa('0xa')](),controller['update']);router[_0xb2aa('0x11')](_0xb2aa('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb2aa('0x12')]=router; \ No newline at end of file +var _0xd45d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0xd45d,0x15a));var _0xdd45=function(_0x39e2bb,_0x79999e){_0x39e2bb=_0x39e2bb-0x0;var _0x3066a3=_0xd45d[_0x39e2bb];return _0x3066a3;};'use strict';var multer=require(_0xdd45('0x0'));var util=require(_0xdd45('0x1'));var path=require(_0xdd45('0x2'));var timeout=require(_0xdd45('0x3'));var express=require(_0xdd45('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdd45('0x5'));var config=require(_0xdd45('0x6'));var controller=require('./intVtigerField.controller');router[_0xdd45('0x7')]('/',auth[_0xdd45('0x8')](),controller[_0xdd45('0x9')]);router[_0xdd45('0x7')](_0xdd45('0xa'),auth[_0xdd45('0x8')](),controller[_0xdd45('0xb')]);router[_0xdd45('0xc')]('/',auth[_0xdd45('0x8')](),controller[_0xdd45('0xd')]);router['put'](_0xdd45('0xa'),auth[_0xdd45('0x8')](),controller[_0xdd45('0xe')]);router[_0xdd45('0xf')]('/:id',auth[_0xdd45('0x8')](),controller[_0xdd45('0x10')]);module[_0xdd45('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 59108ca..54aadf2 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 _0x2191=['BOOLEAN','sequelize','ENUM','string','customVariable','picklist','STRING'];(function(_0x7446dd,_0x4f9f79){var _0x3cf9b6=function(_0x7d02ef){while(--_0x7d02ef){_0x7446dd['push'](_0x7446dd['shift']());}};_0x3cf9b6(++_0x4f9f79);}(_0x2191,0x1d6));var _0x1219=function(_0x7e9ff7,_0x1ab0af){_0x7e9ff7=_0x7e9ff7-0x0;var _0x29c7c2=_0x2191[_0x7e9ff7];return _0x29c7c2;};'use strict';var Sequelize=require(_0x1219('0x0'));module['exports']={'type':{'type':Sequelize[_0x1219('0x1')](_0x1219('0x2'),'variable',_0x1219('0x3'),'keyValue',_0x1219('0x4')),'defaultValue':_0x1219('0x2')},'content':{'type':Sequelize[_0x1219('0x5')]},'key':{'type':Sequelize[_0x1219('0x5')]},'keyType':{'type':Sequelize[_0x1219('0x1')](_0x1219('0x2'),'variable',_0x1219('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1219('0x5')]},'customField':{'type':Sequelize[_0x1219('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1219('0x5')]}}; \ No newline at end of file +var _0x5f1b=['string','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x5a5349,_0x3de072){var _0x305b1a=function(_0x374710){while(--_0x374710){_0x5a5349['push'](_0x5a5349['shift']());}};_0x305b1a(++_0x3de072);}(_0x5f1b,0x18e));var _0xb5f1=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0x5f1b[_0xc55d64];return _0x4194f6;};'use strict';var Sequelize=require('sequelize');module[_0xb5f1('0x0')]={'type':{'type':Sequelize[_0xb5f1('0x1')](_0xb5f1('0x2'),'variable',_0xb5f1('0x3'),_0xb5f1('0x4'),_0xb5f1('0x5')),'defaultValue':_0xb5f1('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb5f1('0x6')]},'keyType':{'type':Sequelize[_0xb5f1('0x1')](_0xb5f1('0x2'),'variable',_0xb5f1('0x3'))},'keyContent':{'type':Sequelize[_0xb5f1('0x6')]},'idField':{'type':Sequelize[_0xb5f1('0x6')]},'nameField':{'type':Sequelize[_0xb5f1('0x6')]},'customField':{'type':Sequelize[_0xb5f1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb5f1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 526b745..75dcf72 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 _0x9bf4=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','VtigerField','fieldName','type','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1e8367,_0x4c2b73){var _0x186fe6=function(_0x2a0ef9){while(--_0x2a0ef9){_0x1e8367['push'](_0x1e8367['shift']());}};_0x186fe6(++_0x4c2b73);}(_0x9bf4,0x120));var _0x49bf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9bf4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x49bf('0x0'));var rimraf=require(_0x49bf('0x1'));var zipdir=require(_0x49bf('0x2'));var jsonpatch=require(_0x49bf('0x3'));var rp=require(_0x49bf('0x4'));var moment=require(_0x49bf('0x5'));var BPromise=require(_0x49bf('0x6'));var Mustache=require('mustache');var util=require(_0x49bf('0x7'));var path=require(_0x49bf('0x8'));var sox=require(_0x49bf('0x9'));var csv=require(_0x49bf('0xa'));var ejs=require(_0x49bf('0xb'));var fs=require('fs');var fs_extra=require(_0x49bf('0xc'));var _=require(_0x49bf('0xd'));var squel=require(_0x49bf('0xe'));var crypto=require(_0x49bf('0xf'));var jsforce=require(_0x49bf('0x10'));var deskjs=require(_0x49bf('0x11'));var toCsv=require('to-csv');var querystring=require(_0x49bf('0x12'));var Papa=require(_0x49bf('0x13'));var Redis=require('ioredis');var authService=require(_0x49bf('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x49bf('0x15'));var hardwareService=require(_0x49bf('0x16'));var logger=require(_0x49bf('0x17'))(_0x49bf('0x18'));var utils=require(_0x49bf('0x19'));var config=require(_0x49bf('0x1a'));var licenseUtil=require(_0x49bf('0x1b'));var db=require(_0x49bf('0x1c'))['db'];function respondWithStatusCode(_0x35221c,_0x3a4e6b){_0x3a4e6b=_0x3a4e6b||0xcc;return function(_0x233619){if(_0x233619){return _0x35221c[_0x49bf('0x1d')](_0x3a4e6b);}return _0x35221c[_0x49bf('0x1e')](_0x3a4e6b)['end']();};}function respondWithResult(_0x6a416f,_0x262246){_0x262246=_0x262246||0xc8;return function(_0x17648e){if(_0x17648e){return _0x6a416f[_0x49bf('0x1e')](_0x262246)[_0x49bf('0x1f')](_0x17648e);}};}function respondWithFilteredResult(_0x470330,_0x1f59da){return function(_0x191d8a){if(_0x191d8a){var _0x5edc49=typeof _0x1f59da[_0x49bf('0x20')]===_0x49bf('0x21')&&typeof _0x1f59da[_0x49bf('0x22')]===_0x49bf('0x21');var _0xb93f17=_0x191d8a[_0x49bf('0x23')];var _0x47fce0=_0x5edc49?0x0:_0x1f59da[_0x49bf('0x20')];var _0x5deca6=_0x5edc49?_0x191d8a[_0x49bf('0x23')]:_0x1f59da[_0x49bf('0x20')]+_0x1f59da['limit'];var _0x4e2824;if(_0x5deca6>=_0xb93f17){_0x5deca6=_0xb93f17;_0x4e2824=0xc8;}else{_0x4e2824=0xce;}_0x470330[_0x49bf('0x1e')](_0x4e2824);return _0x470330[_0x49bf('0x24')](_0x49bf('0x25'),_0x47fce0+'-'+_0x5deca6+'/'+_0xb93f17)['json'](_0x191d8a);}return null;};}function patchUpdates(_0x1975da){return function(_0x5ec749){try{jsonpatch[_0x49bf('0x26')](_0x5ec749,_0x1975da,!![]);}catch(_0x5a8c43){return BPromise[_0x49bf('0x27')](_0x5a8c43);}return _0x5ec749['save']();};}function saveUpdates(_0x20ac6c,_0x5a4348){return function(_0x3bf3f5){if(_0x3bf3f5){return _0x3bf3f5[_0x49bf('0x28')](_0x20ac6c)[_0x49bf('0x29')](function(_0x87a155){return _0x87a155;});}return null;};}function removeEntity(_0x97b624,_0x5d1394){return function(_0x1b45dd){if(_0x1b45dd){return _0x1b45dd[_0x49bf('0x2a')]()[_0x49bf('0x29')](function(){_0x97b624[_0x49bf('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce608,_0xbd6dd8){return function(_0x5dd936){if(!_0x5dd936){_0x2ce608[_0x49bf('0x1d')](0x194);}return _0x5dd936;};}function handleError(_0x4e9822,_0x57f754){_0x57f754=_0x57f754||0x1f4;return function(_0xb195fe){logger[_0x49bf('0x2b')](_0xb195fe[_0x49bf('0x2c')]);if(_0xb195fe[_0x49bf('0x2d')]){delete _0xb195fe[_0x49bf('0x2d')];}_0x4e9822['status'](_0x57f754)['send'](_0xb195fe);};}exports['index']=function(_0xeefb34,_0x50eb75){var _0x2b1ca2={},_0x313516={},_0x378574={'count':0x0,'rows':[]};var _0x5d4abe=_[_0x49bf('0x2e')](db[_0x49bf('0x2f')]['rawAttributes'],function(_0x5de8fa){return{'name':_0x5de8fa[_0x49bf('0x30')],'type':_0x5de8fa[_0x49bf('0x31')]['key']};});_0x313516['model']=_[_0x49bf('0x2e')](_0x5d4abe,'name');_0x313516[_0x49bf('0x32')]=_[_0x49bf('0x33')](_0xeefb34[_0x49bf('0x32')]);_0x313516['filters']=_[_0x49bf('0x34')](_0x313516[_0x49bf('0x35')],_0x313516[_0x49bf('0x32')]);_0x2b1ca2[_0x49bf('0x36')]=_[_0x49bf('0x34')](_0x313516[_0x49bf('0x35')],qs[_0x49bf('0x37')](_0xeefb34[_0x49bf('0x32')][_0x49bf('0x37')]));_0x2b1ca2[_0x49bf('0x36')]=_0x2b1ca2[_0x49bf('0x36')][_0x49bf('0x38')]?_0x2b1ca2[_0x49bf('0x36')]:_0x313516['model'];if(!_0xeefb34['query']['hasOwnProperty']('nolimit')){_0x2b1ca2[_0x49bf('0x22')]=qs['limit'](_0xeefb34[_0x49bf('0x32')][_0x49bf('0x22')]);_0x2b1ca2[_0x49bf('0x20')]=qs['offset'](_0xeefb34['query']['offset']);}_0x2b1ca2[_0x49bf('0x39')]=qs[_0x49bf('0x3a')](_0xeefb34['query'][_0x49bf('0x3a')]);_0x2b1ca2[_0x49bf('0x3b')]=qs[_0x49bf('0x3c')](_[_0x49bf('0x3d')](_0xeefb34['query'],_0x313516[_0x49bf('0x3c')]),_0x5d4abe);if(_0xeefb34[_0x49bf('0x32')][_0x49bf('0x3e')]){_0x2b1ca2[_0x49bf('0x3b')]=_[_0x49bf('0x3f')](_0x2b1ca2['where'],{'$or':_[_0x49bf('0x2e')](_0x5d4abe,function(_0x554c71){if(_0x554c71['type']!=='VIRTUAL'){var _0xcca027={};_0xcca027[_0x554c71[_0x49bf('0x2d')]]={'$like':'%'+_0xeefb34[_0x49bf('0x32')]['filter']+'%'};return _0xcca027;}})});}_0x2b1ca2=_['merge']({},_0x2b1ca2,_0xeefb34[_0x49bf('0x40')]);var _0x5104a2={'where':_0x2b1ca2['where']};return db['VtigerField']['count'](_0x5104a2)['then'](function(_0x4603ab){_0x378574[_0x49bf('0x23')]=_0x4603ab;if(_0xeefb34['query'][_0x49bf('0x41')]){_0x2b1ca2[_0x49bf('0x42')]=[{'all':!![]}];}return db[_0x49bf('0x2f')][_0x49bf('0x43')](_0x2b1ca2);})[_0x49bf('0x29')](function(_0xd8890f){_0x378574[_0x49bf('0x44')]=_0xd8890f;return _0x378574;})[_0x49bf('0x29')](respondWithFilteredResult(_0x50eb75,_0x2b1ca2))[_0x49bf('0x45')](handleError(_0x50eb75,null));};exports[_0x49bf('0x46')]=function(_0x5ba44d,_0x109ae0){var _0x1217d3={'raw':!![],'where':{'id':_0x5ba44d[_0x49bf('0x47')]['id']}},_0x40834a={};_0x40834a['model']=_[_0x49bf('0x33')](db[_0x49bf('0x2f')][_0x49bf('0x48')]);_0x40834a[_0x49bf('0x32')]=_[_0x49bf('0x33')](_0x5ba44d[_0x49bf('0x32')]);_0x40834a['filters']=_['intersection'](_0x40834a[_0x49bf('0x35')],_0x40834a[_0x49bf('0x32')]);_0x1217d3[_0x49bf('0x36')]=_[_0x49bf('0x34')](_0x40834a[_0x49bf('0x35')],qs[_0x49bf('0x37')](_0x5ba44d[_0x49bf('0x32')][_0x49bf('0x37')]));_0x1217d3[_0x49bf('0x36')]=_0x1217d3[_0x49bf('0x36')][_0x49bf('0x38')]?_0x1217d3[_0x49bf('0x36')]:_0x40834a[_0x49bf('0x35')];if(_0x5ba44d['query'][_0x49bf('0x41')]){_0x1217d3[_0x49bf('0x42')]=[{'all':!![]}];}_0x1217d3=_[_0x49bf('0x3f')]({},_0x1217d3,_0x5ba44d[_0x49bf('0x40')]);return db[_0x49bf('0x2f')]['find'](_0x1217d3)[_0x49bf('0x29')](handleEntityNotFound(_0x109ae0,null))['then'](respondWithResult(_0x109ae0,null))[_0x49bf('0x45')](handleError(_0x109ae0,null));};exports[_0x49bf('0x49')]=function(_0x5d5095,_0x5744de){return db[_0x49bf('0x2f')]['create'](_0x5d5095[_0x49bf('0x4a')],{})['then'](respondWithResult(_0x5744de,0xc9))[_0x49bf('0x45')](handleError(_0x5744de,null));};exports['update']=function(_0x3194d4,_0x2ce431){if(_0x3194d4[_0x49bf('0x4a')]['id']){delete _0x3194d4['body']['id'];}return db[_0x49bf('0x2f')][_0x49bf('0x4b')]({'where':{'id':_0x3194d4['params']['id']}})[_0x49bf('0x29')](handleEntityNotFound(_0x2ce431,null))[_0x49bf('0x29')](saveUpdates(_0x3194d4[_0x49bf('0x4a')],null))['then'](respondWithResult(_0x2ce431,null))[_0x49bf('0x45')](handleError(_0x2ce431,null));};exports[_0x49bf('0x2a')]=function(_0x3b4044,_0x44becc){return db[_0x49bf('0x2f')][_0x49bf('0x4b')]({'where':{'id':_0x3b4044[_0x49bf('0x47')]['id']}})['then'](handleEntityNotFound(_0x44becc,null))[_0x49bf('0x29')](removeEntity(_0x44becc,null))[_0x49bf('0x45')](handleError(_0x44becc,null));}; \ No newline at end of file +var _0xfb30=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','stack','send','index','map','VtigerField','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb30,0x1f1));var _0x0fb3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfb30[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x0fb3('0x0'));var rimraf=require(_0x0fb3('0x1'));var zipdir=require(_0x0fb3('0x2'));var jsonpatch=require(_0x0fb3('0x3'));var rp=require(_0x0fb3('0x4'));var moment=require(_0x0fb3('0x5'));var BPromise=require(_0x0fb3('0x6'));var Mustache=require('mustache');var util=require(_0x0fb3('0x7'));var path=require(_0x0fb3('0x8'));var sox=require(_0x0fb3('0x9'));var csv=require(_0x0fb3('0xa'));var ejs=require(_0x0fb3('0xb'));var fs=require('fs');var fs_extra=require(_0x0fb3('0xc'));var _=require(_0x0fb3('0xd'));var squel=require('squel');var crypto=require(_0x0fb3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0fb3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0fb3('0x10'));var Papa=require(_0x0fb3('0x11'));var Redis=require('ioredis');var authService=require(_0x0fb3('0x12'));var qs=require(_0x0fb3('0x13'));var as=require(_0x0fb3('0x14'));var hardwareService=require(_0x0fb3('0x15'));var logger=require(_0x0fb3('0x16'))(_0x0fb3('0x17'));var utils=require(_0x0fb3('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fb3('0x19'))['db'];function respondWithStatusCode(_0x2aab28,_0x3f4227){_0x3f4227=_0x3f4227||0xcc;return function(_0x3a55e0){if(_0x3a55e0){return _0x2aab28['sendStatus'](_0x3f4227);}return _0x2aab28['status'](_0x3f4227)['end']();};}function respondWithResult(_0x45b4af,_0x22e566){_0x22e566=_0x22e566||0xc8;return function(_0x1a85a4){if(_0x1a85a4){return _0x45b4af[_0x0fb3('0x1a')](_0x22e566)['json'](_0x1a85a4);}};}function respondWithFilteredResult(_0x171a86,_0x569ba6){return function(_0x1bb3f7){if(_0x1bb3f7){var _0x3dc181=typeof _0x569ba6[_0x0fb3('0x1b')]===_0x0fb3('0x1c')&&typeof _0x569ba6['limit']===_0x0fb3('0x1c');var _0x38c1c0=_0x1bb3f7[_0x0fb3('0x1d')];var _0x12326e=_0x3dc181?0x0:_0x569ba6['offset'];var _0x4304bd=_0x3dc181?_0x1bb3f7[_0x0fb3('0x1d')]:_0x569ba6[_0x0fb3('0x1b')]+_0x569ba6[_0x0fb3('0x1e')];var _0x17c750;if(_0x4304bd>=_0x38c1c0){_0x4304bd=_0x38c1c0;_0x17c750=0xc8;}else{_0x17c750=0xce;}_0x171a86[_0x0fb3('0x1a')](_0x17c750);return _0x171a86['set'](_0x0fb3('0x1f'),_0x12326e+'-'+_0x4304bd+'/'+_0x38c1c0)[_0x0fb3('0x20')](_0x1bb3f7);}return null;};}function patchUpdates(_0x46ca9e){return function(_0x246592){try{jsonpatch['apply'](_0x246592,_0x46ca9e,!![]);}catch(_0x4f74ec){return BPromise[_0x0fb3('0x21')](_0x4f74ec);}return _0x246592[_0x0fb3('0x22')]();};}function saveUpdates(_0x1a4dc5,_0x4793a2){return function(_0x30fdc7){if(_0x30fdc7){return _0x30fdc7[_0x0fb3('0x23')](_0x1a4dc5)[_0x0fb3('0x24')](function(_0x537c47){return _0x537c47;});}return null;};}function removeEntity(_0x20f143,_0x3b954b){return function(_0x1edcf1){if(_0x1edcf1){return _0x1edcf1[_0x0fb3('0x25')]()[_0x0fb3('0x24')](function(){_0x20f143[_0x0fb3('0x1a')](0xcc)[_0x0fb3('0x26')]();});}};}function handleEntityNotFound(_0xda6b6,_0x33bdb7){return function(_0x70010b){if(!_0x70010b){_0xda6b6[_0x0fb3('0x27')](0x194);}return _0x70010b;};}function handleError(_0x2eac01,_0x201229){_0x201229=_0x201229||0x1f4;return function(_0x3fbf62){logger['error'](_0x3fbf62[_0x0fb3('0x28')]);if(_0x3fbf62['name']){delete _0x3fbf62['name'];}_0x2eac01[_0x0fb3('0x1a')](_0x201229)[_0x0fb3('0x29')](_0x3fbf62);};}exports[_0x0fb3('0x2a')]=function(_0x1b8427,_0x30d787){var _0x158d0e={},_0x372af9={},_0x4092ad={'count':0x0,'rows':[]};var _0x2978ef=_[_0x0fb3('0x2b')](db[_0x0fb3('0x2c')][_0x0fb3('0x2d')],function(_0x5ed33f){return{'name':_0x5ed33f[_0x0fb3('0x2e')],'type':_0x5ed33f[_0x0fb3('0x2f')]['key']};});_0x372af9['model']=_[_0x0fb3('0x2b')](_0x2978ef,_0x0fb3('0x30'));_0x372af9[_0x0fb3('0x31')]=_[_0x0fb3('0x32')](_0x1b8427[_0x0fb3('0x31')]);_0x372af9[_0x0fb3('0x33')]=_[_0x0fb3('0x34')](_0x372af9[_0x0fb3('0x35')],_0x372af9[_0x0fb3('0x31')]);_0x158d0e[_0x0fb3('0x36')]=_['intersection'](_0x372af9[_0x0fb3('0x35')],qs[_0x0fb3('0x37')](_0x1b8427[_0x0fb3('0x31')][_0x0fb3('0x37')]));_0x158d0e['attributes']=_0x158d0e['attributes'][_0x0fb3('0x38')]?_0x158d0e[_0x0fb3('0x36')]:_0x372af9['model'];if(!_0x1b8427[_0x0fb3('0x31')]['hasOwnProperty'](_0x0fb3('0x39'))){_0x158d0e['limit']=qs['limit'](_0x1b8427[_0x0fb3('0x31')][_0x0fb3('0x1e')]);_0x158d0e[_0x0fb3('0x1b')]=qs[_0x0fb3('0x1b')](_0x1b8427[_0x0fb3('0x31')]['offset']);}_0x158d0e['order']=qs['sort'](_0x1b8427['query'][_0x0fb3('0x3a')]);_0x158d0e[_0x0fb3('0x3b')]=qs[_0x0fb3('0x33')](_['pick'](_0x1b8427[_0x0fb3('0x31')],_0x372af9[_0x0fb3('0x33')]),_0x2978ef);if(_0x1b8427[_0x0fb3('0x31')][_0x0fb3('0x3c')]){_0x158d0e[_0x0fb3('0x3b')]=_['merge'](_0x158d0e[_0x0fb3('0x3b')],{'$or':_[_0x0fb3('0x2b')](_0x2978ef,function(_0x45dcff){if(_0x45dcff[_0x0fb3('0x2f')]!=='VIRTUAL'){var _0x5d491d={};_0x5d491d[_0x45dcff[_0x0fb3('0x30')]]={'$like':'%'+_0x1b8427['query'][_0x0fb3('0x3c')]+'%'};return _0x5d491d;}})});}_0x158d0e=_[_0x0fb3('0x3d')]({},_0x158d0e,_0x1b8427[_0x0fb3('0x3e')]);var _0x4cedfd={'where':_0x158d0e['where']};return db['VtigerField']['count'](_0x4cedfd)[_0x0fb3('0x24')](function(_0x3b212d){_0x4092ad[_0x0fb3('0x1d')]=_0x3b212d;if(_0x1b8427[_0x0fb3('0x31')]['includeAll']){_0x158d0e[_0x0fb3('0x3f')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x158d0e);})[_0x0fb3('0x24')](function(_0x1f8d6f){_0x4092ad[_0x0fb3('0x40')]=_0x1f8d6f;return _0x4092ad;})[_0x0fb3('0x24')](respondWithFilteredResult(_0x30d787,_0x158d0e))[_0x0fb3('0x41')](handleError(_0x30d787,null));};exports[_0x0fb3('0x42')]=function(_0x248944,_0x4fe98b){var _0x4ffdda={'raw':!![],'where':{'id':_0x248944[_0x0fb3('0x43')]['id']}},_0x3d95a4={};_0x3d95a4['model']=_[_0x0fb3('0x32')](db['VtigerField'][_0x0fb3('0x2d')]);_0x3d95a4[_0x0fb3('0x31')]=_[_0x0fb3('0x32')](_0x248944[_0x0fb3('0x31')]);_0x3d95a4[_0x0fb3('0x33')]=_[_0x0fb3('0x34')](_0x3d95a4[_0x0fb3('0x35')],_0x3d95a4[_0x0fb3('0x31')]);_0x4ffdda[_0x0fb3('0x36')]=_[_0x0fb3('0x34')](_0x3d95a4[_0x0fb3('0x35')],qs['fields'](_0x248944['query']['fields']));_0x4ffdda[_0x0fb3('0x36')]=_0x4ffdda[_0x0fb3('0x36')][_0x0fb3('0x38')]?_0x4ffdda[_0x0fb3('0x36')]:_0x3d95a4[_0x0fb3('0x35')];if(_0x248944[_0x0fb3('0x31')][_0x0fb3('0x44')]){_0x4ffdda[_0x0fb3('0x3f')]=[{'all':!![]}];}_0x4ffdda=_[_0x0fb3('0x3d')]({},_0x4ffdda,_0x248944[_0x0fb3('0x3e')]);return db[_0x0fb3('0x2c')][_0x0fb3('0x45')](_0x4ffdda)[_0x0fb3('0x24')](handleEntityNotFound(_0x4fe98b,null))['then'](respondWithResult(_0x4fe98b,null))[_0x0fb3('0x41')](handleError(_0x4fe98b,null));};exports['create']=function(_0x547172,_0x2d548d){return db[_0x0fb3('0x2c')][_0x0fb3('0x46')](_0x547172[_0x0fb3('0x47')],{})[_0x0fb3('0x24')](respondWithResult(_0x2d548d,0xc9))[_0x0fb3('0x41')](handleError(_0x2d548d,null));};exports[_0x0fb3('0x23')]=function(_0x92625e,_0x199f06){if(_0x92625e[_0x0fb3('0x47')]['id']){delete _0x92625e[_0x0fb3('0x47')]['id'];}return db['VtigerField'][_0x0fb3('0x45')]({'where':{'id':_0x92625e[_0x0fb3('0x43')]['id']}})[_0x0fb3('0x24')](handleEntityNotFound(_0x199f06,null))[_0x0fb3('0x24')](saveUpdates(_0x92625e[_0x0fb3('0x47')],null))[_0x0fb3('0x24')](respondWithResult(_0x199f06,null))[_0x0fb3('0x41')](handleError(_0x199f06,null));};exports[_0x0fb3('0x25')]=function(_0x39f334,_0x3cca1a){return db[_0x0fb3('0x2c')][_0x0fb3('0x45')]({'where':{'id':_0x39f334[_0x0fb3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3cca1a,null))['then'](removeEntity(_0x3cca1a,null))[_0x0fb3('0x41')](handleError(_0x3cca1a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d6bbbd6..f617c36 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 _0xc1cb=['exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x40cea0,_0x500d4e){var _0x322a8b=function(_0x30e2d3){while(--_0x30e2d3){_0x40cea0['push'](_0x40cea0['shift']());}};_0x322a8b(++_0x500d4e);}(_0xc1cb,0xac));var _0xbc1c=function(_0x526093,_0x2f534e){_0x526093=_0x526093-0x0;var _0x1c0e99=_0xc1cb[_0x526093];return _0x1c0e99;};'use strict';var _=require(_0xbc1c('0x0'));var util=require(_0xbc1c('0x1'));var logger=require('../../config/logger')(_0xbc1c('0x2'));var moment=require(_0xbc1c('0x3'));var BPromise=require(_0xbc1c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc1c('0x5'));var rimraf=require(_0xbc1c('0x6'));var config=require(_0xbc1c('0x7'));var attributes=require('./intVtigerField.attributes');module[_0xbc1c('0x8')]=function(_0x297a03,_0x67ae9b){return _0x297a03[_0xbc1c('0x9')](_0xbc1c('0xa'),attributes,{'tableName':_0xbc1c('0xb'),'paranoid':![],'indexes':[{'name':_0xbc1c('0xc'),'fields':[_0xbc1c('0xd'),_0xbc1c('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94a0=['bluebird','path','../../config/environment','./intVtigerField.attributes','vtiger_unique_index','idField','lodash','api','moment'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x94a0,0x96));var _0x094a=function(_0x43489d,_0x13a7d9){_0x43489d=_0x43489d-0x0;var _0x4284a2=_0x94a0[_0x43489d];return _0x4284a2;};'use strict';var _=require(_0x094a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x094a('0x1'));var moment=require(_0x094a('0x2'));var BPromise=require(_0x094a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x094a('0x4'));var rimraf=require('rimraf');var config=require(_0x094a('0x5'));var attributes=require(_0x094a('0x6'));module['exports']=function(_0x3cdd49,_0x5decde){return _0x3cdd49['define']('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x094a('0x7'),'fields':[_0x094a('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 3fdf38c..2971ba5 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 _0x923d=['catch','util','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x19ddfd,_0x2bd2d9){var _0x523a04=function(_0x11dee9){while(--_0x11dee9){_0x19ddfd['push'](_0x19ddfd['shift']());}};_0x523a04(++_0x2bd2d9);}(_0x923d,0x11e));var _0xd923=function(_0x1ece20,_0x17576b){_0x1ece20=_0x1ece20-0x0;var _0x27eacf=_0x923d[_0x1ece20];return _0x27eacf;};'use strict';var _=require('lodash');var util=require(_0xd923('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd923('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xd923('0x2'));var logger=require(_0xd923('0x3'))('rpc');var config=require(_0xd923('0x4'));var jayson=require(_0xd923('0x5'));var client=jayson[_0xd923('0x6')][_0xd923('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e3e70,_0x2bb0de,_0x354e79){return new BPromise(function(_0x59215c,_0x1abc46){return client[_0xd923('0x8')](_0x4e3e70,_0x354e79)['then'](function(_0x296f34){logger[_0xd923('0x9')](_0xd923('0xa'),_0x2bb0de,_0xd923('0xb'));logger[_0xd923('0xc')](_0xd923('0xd'),_0x2bb0de,_0xd923('0xb'),JSON[_0xd923('0xe')](_0x296f34));if(_0x296f34[_0xd923('0xf')]){if(_0x296f34[_0xd923('0xf')]['code']===0x1f4){logger[_0xd923('0xf')]('VtigerField,\x20%s,\x20%s',_0x2bb0de,_0x296f34[_0xd923('0xf')][_0xd923('0x10')]);return _0x1abc46(_0x296f34[_0xd923('0xf')][_0xd923('0x10')]);}logger[_0xd923('0xf')]('VtigerField,\x20%s,\x20%s',_0x2bb0de,_0x296f34[_0xd923('0xf')][_0xd923('0x10')]);return _0x59215c(_0x296f34['error'][_0xd923('0x10')]);}else{logger[_0xd923('0x9')](_0xd923('0xa'),_0x2bb0de,'request\x20sent');_0x59215c(_0x296f34[_0xd923('0x11')]['message']);}})[_0xd923('0x12')](function(_0x16b5b9){logger[_0xd923('0xf')](_0xd923('0xa'),_0x2bb0de,_0x16b5b9);_0x1abc46(_0x16b5b9);});});} \ No newline at end of file +var _0xf909=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xf909,0x11e));var _0x9f90=function(_0x18de79,_0x28f5c){_0x18de79=_0x18de79-0x0;var _0xec247=_0xf909[_0x18de79];return _0xec247;};'use strict';var _=require(_0x9f90('0x0'));var util=require(_0x9f90('0x1'));var moment=require(_0x9f90('0x2'));var BPromise=require(_0x9f90('0x3'));var rs=require(_0x9f90('0x4'));var fs=require('fs');var Redis=require(_0x9f90('0x5'));var db=require(_0x9f90('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f90('0x7'))(_0x9f90('0x8'));var config=require('../../config/environment');var jayson=require(_0x9f90('0x9'));var client=jayson[_0x9f90('0xa')][_0x9f90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1046bf,_0x55aeb2,_0x2a2f8d){return new BPromise(function(_0x63b5fd,_0x1d3785){return client[_0x9f90('0xc')](_0x1046bf,_0x2a2f8d)['then'](function(_0xdf6328){logger['info'](_0x9f90('0xd'),_0x55aeb2,_0x9f90('0xe'));logger[_0x9f90('0xf')](_0x9f90('0x10'),_0x55aeb2,_0x9f90('0xe'),JSON[_0x9f90('0x11')](_0xdf6328));if(_0xdf6328[_0x9f90('0x12')]){if(_0xdf6328[_0x9f90('0x12')][_0x9f90('0x13')]===0x1f4){logger[_0x9f90('0x12')](_0x9f90('0xd'),_0x55aeb2,_0xdf6328[_0x9f90('0x12')]['message']);return _0x1d3785(_0xdf6328[_0x9f90('0x12')][_0x9f90('0x14')]);}logger['error'](_0x9f90('0xd'),_0x55aeb2,_0xdf6328[_0x9f90('0x12')][_0x9f90('0x14')]);return _0x63b5fd(_0xdf6328[_0x9f90('0x12')]['message']);}else{logger[_0x9f90('0x15')](_0x9f90('0xd'),_0x55aeb2,_0x9f90('0xe'));_0x63b5fd(_0xdf6328[_0x9f90('0x16')]['message']);}})['catch'](function(_0x9f891a){logger['error'](_0x9f90('0xd'),_0x55aeb2,_0x9f891a);_0x1d3785(_0x9f891a);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 07fa8b7..ce93495 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 _0xbcf3=['post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields'];(function(_0x858618,_0x1ad2ea){var _0x2b22a0=function(_0x324cb4){while(--_0x324cb4){_0x858618['push'](_0x858618['shift']());}};_0x2b22a0(++_0x1ad2ea);}(_0xbcf3,0x17e));var _0x3bcf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbcf3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3bcf('0x0'));var util=require(_0x3bcf('0x1'));var path=require(_0x3bcf('0x2'));var timeout=require(_0x3bcf('0x3'));var express=require(_0x3bcf('0x4'));var router=express[_0x3bcf('0x5')]();var fs_extra=require(_0x3bcf('0x6'));var auth=require(_0x3bcf('0x7'));var interaction=require(_0x3bcf('0x8'));var config=require(_0x3bcf('0x9'));var controller=require('./intZendeskAccount.controller');router[_0x3bcf('0xa')]('/',auth[_0x3bcf('0xb')](),controller[_0x3bcf('0xc')]);router[_0x3bcf('0xa')](_0x3bcf('0xd'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0xe')]);router[_0x3bcf('0xa')](_0x3bcf('0xf'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x10')]);router[_0x3bcf('0xa')]('/:id/fields',auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x11')]);router[_0x3bcf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3bcf('0xf'),auth['isAuthenticated'](),controller[_0x3bcf('0x13')]);router[_0x3bcf('0x14')](_0x3bcf('0xd'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x15')]);router[_0x3bcf('0x16')](_0x3bcf('0xd'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x17')]);module[_0x3bcf('0x18')]=router; \ No newline at end of file +var _0x3ff9=['create','addConfiguration','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id/configurations','/:id/fields','getFields','post'];(function(_0x249b27,_0x3bcb0a){var _0x481c5c=function(_0x4236e6){while(--_0x4236e6){_0x249b27['push'](_0x249b27['shift']());}};_0x481c5c(++_0x3bcb0a);}(_0x3ff9,0x1be));var _0x93ff=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3ff9[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x93ff('0x0'));var util=require(_0x93ff('0x1'));var path=require('path');var timeout=require(_0x93ff('0x2'));var express=require(_0x93ff('0x3'));var router=express[_0x93ff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x93ff('0x5'));var interaction=require(_0x93ff('0x6'));var config=require(_0x93ff('0x7'));var controller=require(_0x93ff('0x8'));router['get']('/',auth[_0x93ff('0x9')](),controller[_0x93ff('0xa')]);router[_0x93ff('0xb')]('/:id',auth[_0x93ff('0x9')](),controller['show']);router[_0x93ff('0xb')](_0x93ff('0xc'),auth[_0x93ff('0x9')](),controller['getConfigurations']);router['get'](_0x93ff('0xd'),auth[_0x93ff('0x9')](),controller[_0x93ff('0xe')]);router[_0x93ff('0xf')]('/',auth[_0x93ff('0x9')](),controller[_0x93ff('0x10')]);router[_0x93ff('0xf')](_0x93ff('0xc'),auth[_0x93ff('0x9')](),controller[_0x93ff('0x11')]);router['put']('/:id',auth[_0x93ff('0x9')](),controller[_0x93ff('0x12')]);router[_0x93ff('0x13')]('/:id',auth[_0x93ff('0x9')](),controller[_0x93ff('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index a5b738a..d92432b 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 _0xce22=['sequelize','exports','STRING','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x488ea0,_0x1e78fa){var _0x4a225e=function(_0x39c8c6){while(--_0x39c8c6){_0x488ea0['push'](_0x488ea0['shift']());}};_0x4a225e(++_0x1e78fa);}(_0xce22,0xea));var _0x2ce2=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0xce22[_0x4e8286];return _0x44a440;};'use strict';var Sequelize=require(_0x2ce2('0x0'));module[_0x2ce2('0x1')]={'name':{'type':Sequelize[_0x2ce2('0x2')]},'description':{'type':Sequelize[_0x2ce2('0x2')]},'username':{'type':Sequelize[_0x2ce2('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x2ce2('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2ce2('0x2')],'unique':_0x2ce2('0x3')},'authType':{'type':Sequelize[_0x2ce2('0x4')](_0x2ce2('0x5'),_0x2ce2('0x6')),'defaultValue':_0x2ce2('0x5')},'serverUrl':{'type':Sequelize[_0x2ce2('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2ce2('0x7'),_0x2ce2('0x8')),'defaultValue':_0x2ce2('0x7')}}; \ No newline at end of file +var _0x6050=['STRING','username','remoteUri','password','newTab','integrationTab','sequelize','exports'];(function(_0x29279c,_0x570176){var _0x279b1f=function(_0xd36d1f){while(--_0xd36d1f){_0x29279c['push'](_0x29279c['shift']());}};_0x279b1f(++_0x570176);}(_0x6050,0x196));var _0x0605=function(_0x3cb26a,_0x24ddb8){_0x3cb26a=_0x3cb26a-0x0;var _0x315303=_0x6050[_0x3cb26a];return _0x315303;};'use strict';var Sequelize=require(_0x0605('0x0'));module[_0x0605('0x1')]={'name':{'type':Sequelize[_0x0605('0x2')]},'description':{'type':Sequelize[_0x0605('0x2')]},'username':{'type':Sequelize[_0x0605('0x2')],'unique':_0x0605('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0605('0x2')]},'remoteUri':{'type':Sequelize[_0x0605('0x2')],'unique':_0x0605('0x4')},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':_0x0605('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x0605('0x6')),'defaultValue':_0x0605('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 010ff59..642f61d 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 _0x69d3=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','rows','show','keys','find','catch','create','update','body','params','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','remoteUri','slice','lastIndexOf','format','ticket_fields','authType','password','Basic\x20%s','%s:%s','base64','headers','%s/token:%s','toString','Unknown\x20authentication\x20type','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x1d41a2,_0x33011b){var _0x241d1c=function(_0x1c8b0a){while(--_0x1c8b0a){_0x1d41a2['push'](_0x1d41a2['shift']());}};_0x241d1c(++_0x33011b);}(_0x69d3,0xda));var _0x369d=function(_0x23d5d6,_0x44824b){_0x23d5d6=_0x23d5d6-0x0;var _0x53aef8=_0x69d3[_0x23d5d6];return _0x53aef8;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];var integrations=require(_0x369d('0x17'));function respondWithStatusCode(_0x52c126,_0x15b417){_0x15b417=_0x15b417||0xcc;return function(_0x9d016){if(_0x9d016){return _0x52c126[_0x369d('0x18')](_0x15b417);}return _0x52c126[_0x369d('0x19')](_0x15b417)[_0x369d('0x1a')]();};}function respondWithResult(_0x539536,_0x5cd4c3){_0x5cd4c3=_0x5cd4c3||0xc8;return function(_0x5485a1){if(_0x5485a1){return _0x539536[_0x369d('0x19')](_0x5cd4c3)[_0x369d('0x1b')](_0x5485a1);}};}function respondWithFilteredResult(_0x389c43,_0x5b4f55){return function(_0x2c1a4a){if(_0x2c1a4a){var _0x29c1fe=typeof _0x5b4f55[_0x369d('0x1c')]==='undefined'&&typeof _0x5b4f55[_0x369d('0x1d')]===_0x369d('0x1e');var _0x4ea6c2=_0x2c1a4a['count'];var _0x597b67=_0x29c1fe?0x0:_0x5b4f55[_0x369d('0x1c')];var _0x4494b3=_0x29c1fe?_0x2c1a4a[_0x369d('0x1f')]:_0x5b4f55['offset']+_0x5b4f55[_0x369d('0x1d')];var _0x24dfff;if(_0x4494b3>=_0x4ea6c2){_0x4494b3=_0x4ea6c2;_0x24dfff=0xc8;}else{_0x24dfff=0xce;}_0x389c43[_0x369d('0x19')](_0x24dfff);return _0x389c43[_0x369d('0x20')](_0x369d('0x21'),_0x597b67+'-'+_0x4494b3+'/'+_0x4ea6c2)['json'](_0x2c1a4a);}return null;};}function patchUpdates(_0x5c9fdd){return function(_0x448e6e){try{jsonpatch[_0x369d('0x22')](_0x448e6e,_0x5c9fdd,!![]);}catch(_0x11ac1d){return BPromise[_0x369d('0x23')](_0x11ac1d);}return _0x448e6e[_0x369d('0x24')]();};}function saveUpdates(_0x15fbef,_0x1b262a){return function(_0x54a42e){if(_0x54a42e){return _0x54a42e['update'](_0x15fbef)[_0x369d('0x25')](function(_0xed16e){return _0xed16e;});}return null;};}function removeEntity(_0xf7bc3a,_0xcae58){return function(_0x30e7c5){if(_0x30e7c5){return _0x30e7c5[_0x369d('0x26')]()[_0x369d('0x25')](function(){_0xf7bc3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16145e,_0x46de2b){return function(_0x15cd81){if(!_0x15cd81){_0x16145e[_0x369d('0x18')](0x194);}return _0x15cd81;};}function handleError(_0x8aa521,_0x41e0cf){_0x41e0cf=_0x41e0cf||0x1f4;return function(_0x8090b0){logger['error'](_0x8090b0[_0x369d('0x27')]);if(_0x8090b0[_0x369d('0x28')]){delete _0x8090b0[_0x369d('0x28')];}_0x8aa521[_0x369d('0x19')](_0x41e0cf)[_0x369d('0x29')](_0x8090b0);};}exports[_0x369d('0x2a')]=function(_0x3d1ce0,_0x4d42ea){var _0x157291={},_0x56efb1={},_0x57b94c={'count':0x0,'rows':[]};var _0x38feda=_[_0x369d('0x2b')](db['ZendeskAccount'][_0x369d('0x2c')],function(_0x5a14ce){return{'name':_0x5a14ce[_0x369d('0x2d')],'type':_0x5a14ce[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x56efb1[_0x369d('0x30')]=_[_0x369d('0x2b')](_0x38feda,_0x369d('0x28'));_0x56efb1[_0x369d('0x31')]=_['keys'](_0x3d1ce0[_0x369d('0x31')]);_0x56efb1[_0x369d('0x32')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],_0x56efb1[_0x369d('0x31')]);_0x157291[_0x369d('0x34')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],qs['fields'](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x35')]));_0x157291[_0x369d('0x34')]=_0x157291[_0x369d('0x34')][_0x369d('0x36')]?_0x157291['attributes']:_0x56efb1[_0x369d('0x30')];if(!_0x3d1ce0[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x157291[_0x369d('0x1d')]=qs[_0x369d('0x1d')](_0x3d1ce0['query'][_0x369d('0x1d')]);_0x157291[_0x369d('0x1c')]=qs[_0x369d('0x1c')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x1c')]);}_0x157291[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3a')]);_0x157291[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x3d1ce0[_0x369d('0x31')],_0x56efb1[_0x369d('0x32')]),_0x38feda);if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3d')]){_0x157291[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x157291[_0x369d('0x3b')],{'$or':_[_0x369d('0x2b')](_0x38feda,function(_0x10c5b6){if(_0x10c5b6[_0x369d('0x2e')]!==_0x369d('0x3f')){var _0xd58366={};_0xd58366[_0x10c5b6['name']]={'$like':'%'+_0x3d1ce0['query'][_0x369d('0x3d')]+'%'};return _0xd58366;}})});}_0x157291=_[_0x369d('0x3e')]({},_0x157291,_0x3d1ce0[_0x369d('0x40')]);var _0x401bc7={'where':_0x157291[_0x369d('0x3b')]};return db[_0x369d('0x41')][_0x369d('0x1f')](_0x401bc7)[_0x369d('0x25')](function(_0x46c940){_0x57b94c['count']=_0x46c940;if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x42')]){_0x157291[_0x369d('0x43')]=[{'all':!![]}];}return db[_0x369d('0x41')][_0x369d('0x44')](_0x157291);})[_0x369d('0x25')](function(_0x28803c){_0x57b94c[_0x369d('0x45')]=_0x28803c;return _0x57b94c;})['then'](respondWithFilteredResult(_0x4d42ea,_0x157291))['catch'](handleError(_0x4d42ea,null));};exports[_0x369d('0x46')]=function(_0x3222ce,_0x30909a){var _0x4dad71={'raw':![],'where':{'id':_0x3222ce['params']['id']}},_0x4d07ac={};_0x4d07ac[_0x369d('0x30')]=_[_0x369d('0x47')](db['ZendeskAccount'][_0x369d('0x2c')]);_0x4d07ac[_0x369d('0x31')]=_[_0x369d('0x47')](_0x3222ce[_0x369d('0x31')]);_0x4d07ac['filters']=_[_0x369d('0x33')](_0x4d07ac['model'],_0x4d07ac[_0x369d('0x31')]);_0x4dad71['attributes']=_[_0x369d('0x33')](_0x4d07ac[_0x369d('0x30')],qs[_0x369d('0x35')](_0x3222ce['query']['fields']));_0x4dad71[_0x369d('0x34')]=_0x4dad71[_0x369d('0x34')][_0x369d('0x36')]?_0x4dad71['attributes']:_0x4d07ac[_0x369d('0x30')];if(_0x3222ce[_0x369d('0x31')][_0x369d('0x42')]){_0x4dad71[_0x369d('0x43')]=[{'all':!![]}];}_0x4dad71=_[_0x369d('0x3e')]({},_0x4dad71,_0x3222ce[_0x369d('0x40')]);return db[_0x369d('0x41')][_0x369d('0x48')](_0x4dad71)[_0x369d('0x25')](handleEntityNotFound(_0x30909a,null))['then'](respondWithResult(_0x30909a,null))[_0x369d('0x49')](handleError(_0x30909a,null));};exports[_0x369d('0x4a')]=function(_0xcc1465,_0x257c3d){return db[_0x369d('0x41')][_0x369d('0x4a')](_0xcc1465['body'],{})[_0x369d('0x25')](respondWithResult(_0x257c3d,0xc9))[_0x369d('0x49')](handleError(_0x257c3d,null));};exports[_0x369d('0x4b')]=function(_0x44a357,_0x1b04d9){if(_0x44a357[_0x369d('0x4c')]['id']){delete _0x44a357[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x48')]({'where':{'id':_0x44a357[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1b04d9,null))[_0x369d('0x25')](saveUpdates(_0x44a357['body'],null))[_0x369d('0x25')](respondWithResult(_0x1b04d9,null))[_0x369d('0x49')](handleError(_0x1b04d9,null));};exports[_0x369d('0x26')]=function(_0x85edd6,_0x648a0d){return db['ZendeskAccount'][_0x369d('0x48')]({'where':{'id':_0x85edd6['params']['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x648a0d,null))[_0x369d('0x25')](removeEntity(_0x648a0d,null))[_0x369d('0x49')](handleError(_0x648a0d,null));};exports[_0x369d('0x4e')]=function(_0x46c62c,_0x1bd31c,_0x22e2d4){var _0x418cab={};var _0x1cdeca={};var _0x9f1544;var _0x4d582a;return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x46c62c[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1bd31c,null))[_0x369d('0x25')](function(_0x347df4){if(_0x347df4){_0x9f1544=_0x347df4;_0x1cdeca['model']=_['keys'](db[_0x369d('0x50')][_0x369d('0x2c')]);_0x1cdeca['query']=_[_0x369d('0x47')](_0x46c62c['query']);_0x1cdeca[_0x369d('0x32')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],_0x1cdeca['query']);_0x418cab[_0x369d('0x34')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],qs[_0x369d('0x35')](_0x46c62c['query']['fields']));_0x418cab[_0x369d('0x34')]=_0x418cab[_0x369d('0x34')][_0x369d('0x36')]?_0x418cab['attributes']:_0x1cdeca[_0x369d('0x30')];_0x418cab[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x46c62c['query']['sort']);_0x418cab[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x46c62c[_0x369d('0x31')],_0x1cdeca['filters']));if(_0x46c62c[_0x369d('0x31')][_0x369d('0x3d')]){_0x418cab[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x418cab[_0x369d('0x3b')],{'$or':_['map'](_0x418cab[_0x369d('0x34')],function(_0x304a9e){var _0x28b752={};_0x28b752[_0x304a9e]={'$like':'%'+_0x46c62c['query'][_0x369d('0x3d')]+'%'};return _0x28b752;})});}_0x418cab=_['merge']({},_0x418cab,_0x46c62c[_0x369d('0x40')]);return _0x9f1544['getConfigurations'](_0x418cab);}})['then'](function(_0x5f440e){if(_0x5f440e){_0x4d582a=_0x5f440e['length'];if(!_0x46c62c[_0x369d('0x31')]['hasOwnProperty'](_0x369d('0x38'))){_0x418cab['limit']=qs[_0x369d('0x1d')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1d')]);_0x418cab['offset']=qs[_0x369d('0x1c')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1c')]);}return _0x9f1544[_0x369d('0x4e')](_0x418cab);}})[_0x369d('0x25')](function(_0xe63e0f){if(_0xe63e0f){return _0xe63e0f?{'count':_0x4d582a,'rows':_0xe63e0f}:null;}})['then'](respondWithResult(_0x1bd31c,null))[_0x369d('0x49')](handleError(_0x1bd31c,null));};exports['addConfiguration']=function(_0x5706be,_0x56c98e,_0x36e990){if(_0x5706be[_0x369d('0x4c')]['id']){delete _0x5706be[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x4f')]({'where':{'id':_0x5706be[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x56c98e,null))[_0x369d('0x25')](function(_0x1c9683){if(_0x1c9683){_0x5706be[_0x369d('0x4c')][_0x369d('0x51')]=_0x1c9683['id'];_0x5706be[_0x369d('0x4c')][_0x369d('0x52')]=integrations[_0x369d('0x53')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be['body'][_0x369d('0x2e')]);_0x5706be['body'][_0x369d('0x55')]=integrations[_0x369d('0x56')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be[_0x369d('0x4c')]['type']);return db[_0x369d('0x50')]['create'](_0x5706be['body'],{'include':[{'model':db[_0x369d('0x57')],'as':_0x369d('0x52')},{'model':db[_0x369d('0x57')],'as':_0x369d('0x55')}]});}return null;})[_0x369d('0x25')](respondWithResult(_0x56c98e,null))[_0x369d('0x49')](handleError(_0x56c98e,null));};exports[_0x369d('0x58')]=function(_0x11ac7d,_0x55a811,_0x461782){var _0x24e70d='';return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x11ac7d[_0x369d('0x4d')]['id']},'attributes':['id',_0x369d('0x59'),'password',_0x369d('0x5a'),'authType',_0x369d('0x5b')]})[_0x369d('0x25')](handleEntityNotFound(_0x55a811,null))[_0x369d('0x25')](function(_0x369199){if(_0x369199){_0x24e70d=_0x369199[_0x369d('0x5b')];var _0x1a9a01=_0x24e70d[_0x369d('0x5c')](-0x1);if(_0x1a9a01==='/'){_0x24e70d=_0x24e70d['substring'](0x0,_0x24e70d[_0x369d('0x5d')](_0x1a9a01));}var _0x7e8d08={'method':'GET','uri':util[_0x369d('0x5e')]('%s/%s',_0x24e70d,_0x369d('0x5f')),'json':!![]};switch(_0x369199[_0x369d('0x60')]){case _0x369d('0x61'):_0x7e8d08['headers']={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x63'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x61')]))['toString'](_0x369d('0x64')))};break;case _0x369d('0x5a'):_0x7e8d08[_0x369d('0x65')]={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x66'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x5a')]))[_0x369d('0x67')](_0x369d('0x64')))};break;default:throw new db['Sequelize']['ValidationError'](_0x369d('0x68'));}return rp(_0x7e8d08);}})[_0x369d('0x25')](function(_0x2307fc){if(_0x2307fc){var _0x11b348=[_0x369d('0x69'),_0x369d('0x6a'),'group',_0x369d('0x6b')];_[_0x369d('0x6c')](_0x2307fc['ticket_fields'],function(_0x6c8235){return _0x11b348['includes'](_0x6c8235[_0x369d('0x2e')]);});return{'count':_0x2307fc['ticket_fields'][_0x369d('0x36')],'rows':_[_0x369d('0x2b')](_0x2307fc['ticket_fields'],function(_0x4148a9){return{'id':_0x4148a9['id'],'name':_0x4148a9['position']>0x7?_0x4148a9[_0x369d('0x6d')]:_0x4148a9['type'],'custom':_0x4148a9['position']>0x7?!![]:![],'options':_0x4148a9[_0x369d('0x6e')]?_0x4148a9[_0x369d('0x6e')]:_0x4148a9[_0x369d('0x6f')]?_0x4148a9[_0x369d('0x6f')]:[]};})};}})[_0x369d('0x25')](respondWithResult(_0x55a811,null))['catch'](function(_0x28ec32){var _0xaff7cc=_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?0x1f4:_0x28ec32[_0x369d('0x71')]||0x1f4;logger[_0x369d('0x72')](_0x369d('0x73'),_0x369d('0x58'),_0xaff7cc,JSON[_0x369d('0x74')](_0x28ec32));delete _0x28ec32['name'];if(_0xaff7cc===0x191){_0xaff7cc=0x190;}_0x55a811[_0x369d('0x19')](_0xaff7cc)[_0x369d('0x29')](_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x28ec32[_0x369d('0x71')]}:_0x28ec32);});}; \ No newline at end of file +var _0xae60=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','getConfigurations','findOne','ZendeskConfiguration','order','sort','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','assignee','remove','position','title','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x4ecf60,_0x168bd2){var _0x263d41=function(_0x3321f8){while(--_0x3321f8){_0x4ecf60['push'](_0x4ecf60['shift']());}};_0x263d41(++_0x168bd2);}(_0xae60,0x1c7));var _0x0ae6=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xae60[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];var integrations=require(_0x0ae6('0x1c'));function respondWithStatusCode(_0x30f8f9,_0x1aefd5){_0x1aefd5=_0x1aefd5||0xcc;return function(_0xf86cad){if(_0xf86cad){return _0x30f8f9[_0x0ae6('0x1d')](_0x1aefd5);}return _0x30f8f9[_0x0ae6('0x1e')](_0x1aefd5)['end']();};}function respondWithResult(_0x3809c6,_0x10c3bc){_0x10c3bc=_0x10c3bc||0xc8;return function(_0x1c997a){if(_0x1c997a){return _0x3809c6[_0x0ae6('0x1e')](_0x10c3bc)[_0x0ae6('0x1f')](_0x1c997a);}};}function respondWithFilteredResult(_0x3a1e26,_0x151144){return function(_0x3b64ac){if(_0x3b64ac){var _0xa797bb=typeof _0x151144[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x151144[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xd0362c=_0x3b64ac[_0x0ae6('0x23')];var _0x3f5c41=_0xa797bb?0x0:_0x151144[_0x0ae6('0x20')];var _0x1735ba=_0xa797bb?_0x3b64ac[_0x0ae6('0x23')]:_0x151144[_0x0ae6('0x20')]+_0x151144[_0x0ae6('0x22')];var _0x191eaf;if(_0x1735ba>=_0xd0362c){_0x1735ba=_0xd0362c;_0x191eaf=0xc8;}else{_0x191eaf=0xce;}_0x3a1e26['status'](_0x191eaf);return _0x3a1e26[_0x0ae6('0x24')](_0x0ae6('0x25'),_0x3f5c41+'-'+_0x1735ba+'/'+_0xd0362c)[_0x0ae6('0x1f')](_0x3b64ac);}return null;};}function patchUpdates(_0x1027c2){return function(_0x9c4075){try{jsonpatch[_0x0ae6('0x26')](_0x9c4075,_0x1027c2,!![]);}catch(_0x210ca4){return BPromise[_0x0ae6('0x27')](_0x210ca4);}return _0x9c4075['save']();};}function saveUpdates(_0x39b22e,_0x2a6484){return function(_0x2e86e8){if(_0x2e86e8){return _0x2e86e8[_0x0ae6('0x28')](_0x39b22e)[_0x0ae6('0x29')](function(_0x4eba72){return _0x4eba72;});}return null;};}function removeEntity(_0x296a9d,_0x4e1242){return function(_0xccd1c5){if(_0xccd1c5){return _0xccd1c5[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x296a9d[_0x0ae6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3630e6,_0x2dcdb7){return function(_0x519f17){if(!_0x519f17){_0x3630e6['sendStatus'](0x194);}return _0x519f17;};}function handleError(_0x44eb95,_0x3255a7){_0x3255a7=_0x3255a7||0x1f4;return function(_0x17360e){logger['error'](_0x17360e[_0x0ae6('0x2b')]);if(_0x17360e[_0x0ae6('0x2c')]){delete _0x17360e[_0x0ae6('0x2c')];}_0x44eb95['status'](_0x3255a7)[_0x0ae6('0x2d')](_0x17360e);};}exports[_0x0ae6('0x2e')]=function(_0x449c33,_0x232fbd){var _0x14eed5={},_0x257af5={},_0x4fc7bd={'count':0x0,'rows':[]};var _0x5b2ad6=_[_0x0ae6('0x2f')](db[_0x0ae6('0x30')]['rawAttributes'],function(_0x4a06f1){return{'name':_0x4a06f1[_0x0ae6('0x31')],'type':_0x4a06f1[_0x0ae6('0x32')][_0x0ae6('0x33')]};});_0x257af5[_0x0ae6('0x34')]=_['map'](_0x5b2ad6,_0x0ae6('0x2c'));_0x257af5[_0x0ae6('0x35')]=_[_0x0ae6('0x36')](_0x449c33['query']);_0x257af5[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x257af5[_0x0ae6('0x34')],_0x257af5[_0x0ae6('0x35')]);_0x14eed5[_0x0ae6('0x39')]=_[_0x0ae6('0x38')](_0x257af5[_0x0ae6('0x34')],qs[_0x0ae6('0x3a')](_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3a')]));_0x14eed5['attributes']=_0x14eed5[_0x0ae6('0x39')][_0x0ae6('0x3b')]?_0x14eed5['attributes']:_0x257af5[_0x0ae6('0x34')];if(!_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3c')]('nolimit')){_0x14eed5[_0x0ae6('0x22')]=qs['limit'](_0x449c33['query'][_0x0ae6('0x22')]);_0x14eed5[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x20')]);}_0x14eed5['order']=qs['sort'](_0x449c33[_0x0ae6('0x35')]['sort']);_0x14eed5[_0x0ae6('0x3d')]=qs['filters'](_[_0x0ae6('0x3e')](_0x449c33['query'],_0x257af5[_0x0ae6('0x37')]),_0x5b2ad6);if(_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3f')]){_0x14eed5[_0x0ae6('0x3d')]=_['merge'](_0x14eed5['where'],{'$or':_[_0x0ae6('0x2f')](_0x5b2ad6,function(_0x34b547){if(_0x34b547[_0x0ae6('0x32')]!=='VIRTUAL'){var _0xaeb354={};_0xaeb354[_0x34b547['name']]={'$like':'%'+_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3f')]+'%'};return _0xaeb354;}})});}_0x14eed5=_[_0x0ae6('0x40')]({},_0x14eed5,_0x449c33[_0x0ae6('0x41')]);var _0x450f00={'where':_0x14eed5[_0x0ae6('0x3d')]};return db['ZendeskAccount'][_0x0ae6('0x23')](_0x450f00)[_0x0ae6('0x29')](function(_0x24d9ec){_0x4fc7bd[_0x0ae6('0x23')]=_0x24d9ec;if(_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x42')]){_0x14eed5[_0x0ae6('0x43')]=[{'all':!![]}];}return db[_0x0ae6('0x30')]['findAll'](_0x14eed5);})[_0x0ae6('0x29')](function(_0xba3183){_0x4fc7bd[_0x0ae6('0x44')]=_0xba3183;return _0x4fc7bd;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x232fbd,_0x14eed5))[_0x0ae6('0x45')](handleError(_0x232fbd,null));};exports[_0x0ae6('0x46')]=function(_0x24c021,_0x21431e){var _0xb38cbb={'raw':![],'where':{'id':_0x24c021[_0x0ae6('0x47')]['id']}},_0x156841={};_0x156841[_0x0ae6('0x34')]=_[_0x0ae6('0x36')](db[_0x0ae6('0x30')][_0x0ae6('0x48')]);_0x156841[_0x0ae6('0x35')]=_[_0x0ae6('0x36')](_0x24c021[_0x0ae6('0x35')]);_0x156841['filters']=_[_0x0ae6('0x38')](_0x156841[_0x0ae6('0x34')],_0x156841[_0x0ae6('0x35')]);_0xb38cbb[_0x0ae6('0x39')]=_[_0x0ae6('0x38')](_0x156841[_0x0ae6('0x34')],qs['fields'](_0x24c021[_0x0ae6('0x35')][_0x0ae6('0x3a')]));_0xb38cbb[_0x0ae6('0x39')]=_0xb38cbb[_0x0ae6('0x39')]['length']?_0xb38cbb['attributes']:_0x156841['model'];if(_0x24c021[_0x0ae6('0x35')][_0x0ae6('0x42')]){_0xb38cbb[_0x0ae6('0x43')]=[{'all':!![]}];}_0xb38cbb=_['merge']({},_0xb38cbb,_0x24c021[_0x0ae6('0x41')]);return db[_0x0ae6('0x30')]['find'](_0xb38cbb)[_0x0ae6('0x29')](handleEntityNotFound(_0x21431e,null))[_0x0ae6('0x29')](respondWithResult(_0x21431e,null))['catch'](handleError(_0x21431e,null));};exports[_0x0ae6('0x49')]=function(_0x3d1e75,_0x587ab4){return db[_0x0ae6('0x30')][_0x0ae6('0x49')](_0x3d1e75[_0x0ae6('0x4a')],{})['then'](respondWithResult(_0x587ab4,0xc9))[_0x0ae6('0x45')](handleError(_0x587ab4,null));};exports[_0x0ae6('0x28')]=function(_0x46075a,_0x3b1af0){if(_0x46075a[_0x0ae6('0x4a')]['id']){delete _0x46075a[_0x0ae6('0x4a')]['id'];}return db[_0x0ae6('0x30')]['find']({'where':{'id':_0x46075a['params']['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x3b1af0,null))[_0x0ae6('0x29')](saveUpdates(_0x46075a[_0x0ae6('0x4a')],null))['then'](respondWithResult(_0x3b1af0,null))[_0x0ae6('0x45')](handleError(_0x3b1af0,null));};exports['destroy']=function(_0x582a5e,_0x23454a){return db[_0x0ae6('0x30')][_0x0ae6('0x4b')]({'where':{'id':_0x582a5e['params']['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x23454a,null))[_0x0ae6('0x29')](removeEntity(_0x23454a,null))[_0x0ae6('0x45')](handleError(_0x23454a,null));};exports[_0x0ae6('0x4c')]=function(_0x173acd,_0x2e5ea6,_0x9a64b8){var _0x36be39={};var _0x102573={};var _0x117d24;var _0x1cc515;return db[_0x0ae6('0x30')][_0x0ae6('0x4d')]({'where':{'id':_0x173acd[_0x0ae6('0x47')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2e5ea6,null))['then'](function(_0x4cbe19){if(_0x4cbe19){_0x117d24=_0x4cbe19;_0x102573[_0x0ae6('0x34')]=_[_0x0ae6('0x36')](db[_0x0ae6('0x4e')][_0x0ae6('0x48')]);_0x102573[_0x0ae6('0x35')]=_[_0x0ae6('0x36')](_0x173acd[_0x0ae6('0x35')]);_0x102573[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x102573[_0x0ae6('0x34')],_0x102573[_0x0ae6('0x35')]);_0x36be39[_0x0ae6('0x39')]=_[_0x0ae6('0x38')](_0x102573[_0x0ae6('0x34')],qs[_0x0ae6('0x3a')](_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x3a')]));_0x36be39[_0x0ae6('0x39')]=_0x36be39['attributes'][_0x0ae6('0x3b')]?_0x36be39[_0x0ae6('0x39')]:_0x102573[_0x0ae6('0x34')];_0x36be39[_0x0ae6('0x4f')]=qs[_0x0ae6('0x50')](_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x50')]);_0x36be39[_0x0ae6('0x3d')]=qs[_0x0ae6('0x37')](_[_0x0ae6('0x3e')](_0x173acd['query'],_0x102573[_0x0ae6('0x37')]));if(_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x3f')]){_0x36be39[_0x0ae6('0x3d')]=_[_0x0ae6('0x40')](_0x36be39[_0x0ae6('0x3d')],{'$or':_[_0x0ae6('0x2f')](_0x36be39[_0x0ae6('0x39')],function(_0x1cbada){var _0x59acf0={};_0x59acf0[_0x1cbada]={'$like':'%'+_0x173acd['query'][_0x0ae6('0x3f')]+'%'};return _0x59acf0;})});}_0x36be39=_[_0x0ae6('0x40')]({},_0x36be39,_0x173acd['options']);return _0x117d24['getConfigurations'](_0x36be39);}})[_0x0ae6('0x29')](function(_0x160dcf){if(_0x160dcf){_0x1cc515=_0x160dcf[_0x0ae6('0x3b')];if(!_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x3c')](_0x0ae6('0x51'))){_0x36be39[_0x0ae6('0x22')]=qs['limit'](_0x173acd[_0x0ae6('0x35')]['limit']);_0x36be39[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x173acd['query'][_0x0ae6('0x20')]);}return _0x117d24[_0x0ae6('0x4c')](_0x36be39);}})[_0x0ae6('0x29')](function(_0x593667){if(_0x593667){return _0x593667?{'count':_0x1cc515,'rows':_0x593667}:null;}})[_0x0ae6('0x29')](respondWithResult(_0x2e5ea6,null))['catch'](handleError(_0x2e5ea6,null));};exports[_0x0ae6('0x52')]=function(_0x2e0a75,_0x19f63f,_0x12c43d){if(_0x2e0a75['body']['id']){delete _0x2e0a75['body']['id'];}return db[_0x0ae6('0x30')][_0x0ae6('0x4d')]({'where':{'id':_0x2e0a75[_0x0ae6('0x47')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x19f63f,null))[_0x0ae6('0x29')](function(_0x2d9f33){if(_0x2d9f33){_0x2e0a75['body']['AccountId']=_0x2d9f33['id'];_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x53')]=integrations[_0x0ae6('0x54')](_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x55')],_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x32')]);_0x2e0a75[_0x0ae6('0x4a')]['Descriptions']=integrations[_0x0ae6('0x56')](_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x55')],_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x32')]);return db[_0x0ae6('0x4e')]['create'](_0x2e0a75['body'],{'include':[{'model':db[_0x0ae6('0x57')],'as':_0x0ae6('0x53')},{'model':db['ZendeskField'],'as':_0x0ae6('0x58')}]});}return null;})[_0x0ae6('0x29')](respondWithResult(_0x19f63f,null))[_0x0ae6('0x45')](handleError(_0x19f63f,null));};exports[_0x0ae6('0x59')]=function(_0x5cd03b,_0x2d9ec4,_0x243e86){var _0x42470='';return db[_0x0ae6('0x30')][_0x0ae6('0x4d')]({'where':{'id':_0x5cd03b[_0x0ae6('0x47')]['id']},'attributes':['id',_0x0ae6('0x5a'),_0x0ae6('0x5b'),'token',_0x0ae6('0x5c'),_0x0ae6('0x5d')]})[_0x0ae6('0x29')](handleEntityNotFound(_0x2d9ec4,null))[_0x0ae6('0x29')](function(_0x206021){if(_0x206021){_0x42470=_0x206021[_0x0ae6('0x5d')];var _0x20032f=_0x42470[_0x0ae6('0x5e')](-0x1);if(_0x20032f==='/'){_0x42470=_0x42470[_0x0ae6('0x5f')](0x0,_0x42470[_0x0ae6('0x60')](_0x20032f));}var _0x3db11f={'method':_0x0ae6('0x61'),'uri':util[_0x0ae6('0x62')](_0x0ae6('0x63'),_0x42470,_0x0ae6('0x64')),'json':!![]};switch(_0x206021[_0x0ae6('0x5c')]){case _0x0ae6('0x5b'):_0x3db11f[_0x0ae6('0x65')]={'Authorization':util[_0x0ae6('0x62')](_0x0ae6('0x66'),new Buffer(util[_0x0ae6('0x62')]('%s:%s',_0x206021[_0x0ae6('0x5a')],_0x206021[_0x0ae6('0x5b')]))[_0x0ae6('0x67')](_0x0ae6('0x68')))};break;case'token':_0x3db11f[_0x0ae6('0x65')]={'Authorization':util[_0x0ae6('0x62')](_0x0ae6('0x66'),new Buffer(util[_0x0ae6('0x62')](_0x0ae6('0x69'),_0x206021[_0x0ae6('0x5a')],_0x206021['token']))[_0x0ae6('0x67')]('base64'))};break;default:throw new db[(_0x0ae6('0x6a'))][(_0x0ae6('0x6b'))](_0x0ae6('0x6c'));}return rp(_0x3db11f);}})[_0x0ae6('0x29')](function(_0x1f0b9e){if(_0x1f0b9e){var _0x15003f=[_0x0ae6('0x6d'),'description','group',_0x0ae6('0x6e')];_[_0x0ae6('0x6f')](_0x1f0b9e[_0x0ae6('0x64')],function(_0x104625){return _0x15003f['includes'](_0x104625[_0x0ae6('0x32')]);});return{'count':_0x1f0b9e[_0x0ae6('0x64')]['length'],'rows':_[_0x0ae6('0x2f')](_0x1f0b9e[_0x0ae6('0x64')],function(_0x1af034){return{'id':_0x1af034['id'],'name':_0x1af034[_0x0ae6('0x70')]>0x7?_0x1af034[_0x0ae6('0x71')]:_0x1af034[_0x0ae6('0x32')],'custom':_0x1af034['position']>0x7?!![]:![],'options':_0x1af034['system_field_options']?_0x1af034['system_field_options']:_0x1af034[_0x0ae6('0x72')]?_0x1af034['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x2d9ec4,null))['catch'](function(_0x58517f){var _0xc69e9d=_0x5cd03b['query'][_0x0ae6('0x73')]?0x1f4:_0x58517f['statusCode']||0x1f4;logger[_0x0ae6('0x74')](_0x0ae6('0x75'),_0x0ae6('0x59'),_0xc69e9d,JSON[_0x0ae6('0x76')](_0x58517f));delete _0x58517f[_0x0ae6('0x2c')];if(_0xc69e9d===0x191){_0xc69e9d=0x190;}_0x2d9ec4['status'](_0xc69e9d)[_0x0ae6('0x2d')](_0x5cd03b[_0x0ae6('0x35')][_0x0ae6('0x73')]?{'message':_0x0ae6('0x77'),'statusCode':_0x58517f[_0x0ae6('0x78')]}:_0x58517f);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 42c0c33..3d8e6b9 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 _0xed2a=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x36f931,_0x5f2a5f){var _0x3073fe=function(_0x143dd7){while(--_0x143dd7){_0x36f931['push'](_0x36f931['shift']());}};_0x3073fe(++_0x5f2a5f);}(_0xed2a,0xe9));var _0xaed2=function(_0x342070,_0x5e04ed){_0x342070=_0x342070-0x0;var _0x1f6b1f=_0xed2a[_0x342070];return _0x1f6b1f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xaed2('0x0'));var moment=require('moment');var BPromise=require(_0xaed2('0x1'));var rp=require(_0xaed2('0x2'));var fs=require('fs');var path=require(_0xaed2('0x3'));var rimraf=require(_0xaed2('0x4'));var config=require(_0xaed2('0x5'));var attributes=require(_0xaed2('0x6'));var integrations=require(_0xaed2('0x7'));module[_0xaed2('0x8')]=function(_0x1c1831,_0x4174ca){return _0x1c1831[_0xaed2('0x9')](_0xaed2('0xa'),attributes,{'tableName':_0xaed2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe62e=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','api','moment','bluebird'];(function(_0x4fa346,_0x42d288){var _0x1a4ab2=function(_0x5a36d7){while(--_0x5a36d7){_0x4fa346['push'](_0x4fa346['shift']());}};_0x1a4ab2(++_0x42d288);}(_0xe62e,0x97));var _0xee62=function(_0x4229f7,_0x52165d){_0x4229f7=_0x4229f7-0x0;var _0x1d9cab=_0xe62e[_0x4229f7];return _0x1d9cab;};'use strict';var _=require('lodash');var util=require(_0xee62('0x0'));var logger=require(_0xee62('0x1'))(_0xee62('0x2'));var moment=require(_0xee62('0x3'));var BPromise=require(_0xee62('0x4'));var rp=require(_0xee62('0x5'));var fs=require('fs');var path=require(_0xee62('0x6'));var rimraf=require(_0xee62('0x7'));var config=require(_0xee62('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xee62('0x9'));module[_0xee62('0xa')]=function(_0x6cc9b8,_0x42d893){return _0x6cc9b8[_0xee62('0xb')](_0xee62('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index bb53350..8f7c78a 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 _0x9cb3=['result','GetZendeskAccount','options','raw','include','map','model','attributes','ZendeskAccount','find','where','ShowZendeskAccount','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent'];(function(_0x2fe432,_0x40ee63){var _0x231627=function(_0x123b40){while(--_0x123b40){_0x2fe432['push'](_0x2fe432['shift']());}};_0x231627(++_0x40ee63);}(_0x9cb3,0x13f));var _0x39cb=function(_0x402565,_0x431efa){_0x402565=_0x402565-0x0;var _0x2ed987=_0x9cb3[_0x402565];return _0x2ed987;};'use strict';var _=require('lodash');var util=require(_0x39cb('0x0'));var moment=require(_0x39cb('0x1'));var BPromise=require(_0x39cb('0x2'));var rs=require(_0x39cb('0x3'));var fs=require('fs');var Redis=require(_0x39cb('0x4'));var db=require(_0x39cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39cb('0x6'));var config=require(_0x39cb('0x7'));var jayson=require(_0x39cb('0x8'));var client=jayson[_0x39cb('0x9')][_0x39cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29285c,_0x25ed5c,_0x448d3b){return new BPromise(function(_0x41953,_0x195e81){return client[_0x39cb('0xb')](_0x29285c,_0x448d3b)[_0x39cb('0xc')](function(_0x274c06){logger[_0x39cb('0xd')](_0x39cb('0xe'),_0x25ed5c,'request\x20sent');logger[_0x39cb('0xf')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x25ed5c,'request\x20sent',JSON[_0x39cb('0x10')](_0x274c06));if(_0x274c06[_0x39cb('0x11')]){if(_0x274c06[_0x39cb('0x11')][_0x39cb('0x12')]===0x1f4){logger['error'](_0x39cb('0xe'),_0x25ed5c,_0x274c06[_0x39cb('0x11')]['message']);return _0x195e81(_0x274c06['error'][_0x39cb('0x13')]);}logger[_0x39cb('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x25ed5c,_0x274c06[_0x39cb('0x11')]['message']);return _0x41953(_0x274c06['error']['message']);}else{logger['info'](_0x39cb('0xe'),_0x25ed5c,_0x39cb('0x14'));_0x41953(_0x274c06[_0x39cb('0x15')][_0x39cb('0x13')]);}})['catch'](function(_0x23c0f2){logger[_0x39cb('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x25ed5c,_0x23c0f2);_0x195e81(_0x23c0f2);});});}exports[_0x39cb('0x16')]=function(_0x5aaf16){var _0x35e650=this;return new Promise(function(_0x39cf46,_0x48aaa2){return db['ZendeskAccount']['findAll']({'raw':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16['options'][_0x39cb('0x18')]===undefined?!![]:![]:!![],'where':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16['options']['where']||null:null,'attributes':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16[_0x39cb('0x17')]['attributes']||null:null,'limit':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16[_0x39cb('0x17')]['limit']||null:null,'include':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16[_0x39cb('0x17')][_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x5aaf16[_0x39cb('0x17')][_0x39cb('0x19')],function(_0x50233c){return{'model':db[_0x50233c[_0x39cb('0x1b')]],'as':_0x50233c['as'],'attributes':_0x50233c[_0x39cb('0x1c')],'include':_0x50233c[_0x39cb('0x19')]?_['map'](_0x50233c['include'],function(_0x30aae6){return{'model':db[_0x30aae6[_0x39cb('0x1b')]],'as':_0x30aae6['as'],'attributes':_0x30aae6['attributes'],'include':_0x30aae6[_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x30aae6[_0x39cb('0x19')],function(_0x56ffeb){return{'model':db[_0x56ffeb['model']],'as':_0x56ffeb['as'],'attributes':_0x56ffeb[_0x39cb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x142542){logger['info'](_0x39cb('0x16'),_0x5aaf16);logger[_0x39cb('0xf')](_0x39cb('0x16'),_0x5aaf16,JSON[_0x39cb('0x10')](_0x142542));_0x39cf46(_0x142542);})['catch'](function(_0xea89b9){logger['error']('GetZendeskAccount',_0xea89b9[_0x39cb('0x13')],_0x5aaf16);_0x48aaa2(_0x35e650['error'](0x1f4,_0xea89b9[_0x39cb('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x2157c4){var _0x4aa421=this;return new Promise(function(_0x19fe35,_0x313078){return db[_0x39cb('0x1d')][_0x39cb('0x1e')]({'raw':_0x2157c4[_0x39cb('0x17')]?_0x2157c4[_0x39cb('0x17')][_0x39cb('0x18')]===undefined?!![]:![]:!![],'where':_0x2157c4[_0x39cb('0x17')]?_0x2157c4[_0x39cb('0x17')][_0x39cb('0x1f')]||null:null,'attributes':_0x2157c4[_0x39cb('0x17')]?_0x2157c4[_0x39cb('0x17')]['attributes']||null:null,'include':_0x2157c4[_0x39cb('0x17')]?_0x2157c4['options']['include']?_[_0x39cb('0x1a')](_0x2157c4[_0x39cb('0x17')][_0x39cb('0x19')],function(_0x128757){return{'model':db[_0x128757['model']],'as':_0x128757['as'],'attributes':_0x128757[_0x39cb('0x1c')],'include':_0x128757[_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x128757[_0x39cb('0x19')],function(_0x549e6f){return{'model':db[_0x549e6f['model']],'as':_0x549e6f['as'],'attributes':_0x549e6f[_0x39cb('0x1c')],'include':_0x549e6f[_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x549e6f['include'],function(_0x1af734){return{'model':db[_0x1af734['model']],'as':_0x1af734['as'],'attributes':_0x1af734[_0x39cb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x39cb('0xc')](function(_0x1bec2a){logger[_0x39cb('0xd')](_0x39cb('0x20'),_0x2157c4);logger['debug']('ShowZendeskAccount',_0x2157c4,JSON[_0x39cb('0x10')](_0x1bec2a));_0x19fe35(_0x1bec2a);})[_0x39cb('0x21')](function(_0x2348b0){logger[_0x39cb('0x11')]('ShowZendeskAccount',_0x2348b0['message'],_0x2157c4);_0x313078(_0x4aa421[_0x39cb('0x11')](0x1f4,_0x2348b0[_0x39cb('0x13')]));});});}; \ No newline at end of file +var _0x0699=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetZendeskAccount','options','raw','where','attributes','limit','include','map','model','info','ShowZendeskAccount','ZendeskAccount','find'];(function(_0x1d564d,_0x566ac2){var _0x91ec4c=function(_0x16f134){while(--_0x16f134){_0x1d564d['push'](_0x1d564d['shift']());}};_0x91ec4c(++_0x566ac2);}(_0x0699,0x181));var _0x9069=function(_0x4ceeb7,_0x1bfc4e){_0x4ceeb7=_0x4ceeb7-0x0;var _0x579921=_0x0699[_0x4ceeb7];return _0x579921;};'use strict';var _=require(_0x9069('0x0'));var util=require(_0x9069('0x1'));var moment=require(_0x9069('0x2'));var BPromise=require(_0x9069('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9069('0x4'));var db=require(_0x9069('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9069('0x6'))(_0x9069('0x7'));var config=require(_0x9069('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9069('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19152e,_0x2904e6,_0x44a634){return new BPromise(function(_0x2db100,_0x5ab367){return client[_0x9069('0xa')](_0x19152e,_0x44a634)[_0x9069('0xb')](function(_0x1b5e72){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x2904e6,'request\x20sent');logger[_0x9069('0xc')](_0x9069('0xd'),_0x2904e6,'request\x20sent',JSON[_0x9069('0xe')](_0x1b5e72));if(_0x1b5e72[_0x9069('0xf')]){if(_0x1b5e72['error'][_0x9069('0x10')]===0x1f4){logger[_0x9069('0xf')](_0x9069('0x11'),_0x2904e6,_0x1b5e72[_0x9069('0xf')][_0x9069('0x12')]);return _0x5ab367(_0x1b5e72['error'][_0x9069('0x12')]);}logger['error'](_0x9069('0x11'),_0x2904e6,_0x1b5e72[_0x9069('0xf')]['message']);return _0x2db100(_0x1b5e72[_0x9069('0xf')][_0x9069('0x12')]);}else{logger['info'](_0x9069('0x11'),_0x2904e6,_0x9069('0x13'));_0x2db100(_0x1b5e72[_0x9069('0x14')]['message']);}})[_0x9069('0x15')](function(_0x1ed374){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x2904e6,_0x1ed374);_0x5ab367(_0x1ed374);});});}exports[_0x9069('0x16')]=function(_0xb7b17a){var _0x4809cf=this;return new Promise(function(_0x5b645e,_0x295ee0){return db['ZendeskAccount']['findAll']({'raw':_0xb7b17a[_0x9069('0x17')]?_0xb7b17a[_0x9069('0x17')][_0x9069('0x18')]===undefined?!![]:![]:!![],'where':_0xb7b17a[_0x9069('0x17')]?_0xb7b17a[_0x9069('0x17')][_0x9069('0x19')]||null:null,'attributes':_0xb7b17a[_0x9069('0x17')]?_0xb7b17a[_0x9069('0x17')][_0x9069('0x1a')]||null:null,'limit':_0xb7b17a[_0x9069('0x17')]?_0xb7b17a[_0x9069('0x17')][_0x9069('0x1b')]||null:null,'include':_0xb7b17a[_0x9069('0x17')]?_0xb7b17a[_0x9069('0x17')][_0x9069('0x1c')]?_[_0x9069('0x1d')](_0xb7b17a[_0x9069('0x17')]['include'],function(_0x5c1950){return{'model':db[_0x5c1950[_0x9069('0x1e')]],'as':_0x5c1950['as'],'attributes':_0x5c1950[_0x9069('0x1a')],'include':_0x5c1950[_0x9069('0x1c')]?_[_0x9069('0x1d')](_0x5c1950[_0x9069('0x1c')],function(_0x20e4e7){return{'model':db[_0x20e4e7[_0x9069('0x1e')]],'as':_0x20e4e7['as'],'attributes':_0x20e4e7[_0x9069('0x1a')],'include':_0x20e4e7[_0x9069('0x1c')]?_[_0x9069('0x1d')](_0x20e4e7['include'],function(_0x192592){return{'model':db[_0x192592['model']],'as':_0x192592['as'],'attributes':_0x192592[_0x9069('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9069('0xb')](function(_0x127adf){logger[_0x9069('0x1f')](_0x9069('0x16'),_0xb7b17a);logger[_0x9069('0xc')](_0x9069('0x16'),_0xb7b17a,JSON['stringify'](_0x127adf));_0x5b645e(_0x127adf);})[_0x9069('0x15')](function(_0x16c2b7){logger['error'](_0x9069('0x16'),_0x16c2b7['message'],_0xb7b17a);_0x295ee0(_0x4809cf['error'](0x1f4,_0x16c2b7[_0x9069('0x12')]));});});};exports[_0x9069('0x20')]=function(_0xf51491){var _0x308b29=this;return new Promise(function(_0x41db38,_0x1cc454){return db[_0x9069('0x21')][_0x9069('0x22')]({'raw':_0xf51491['options']?_0xf51491[_0x9069('0x17')][_0x9069('0x18')]===undefined?!![]:![]:!![],'where':_0xf51491['options']?_0xf51491[_0x9069('0x17')][_0x9069('0x19')]||null:null,'attributes':_0xf51491[_0x9069('0x17')]?_0xf51491[_0x9069('0x17')]['attributes']||null:null,'include':_0xf51491['options']?_0xf51491[_0x9069('0x17')][_0x9069('0x1c')]?_[_0x9069('0x1d')](_0xf51491['options']['include'],function(_0x268bf2){return{'model':db[_0x268bf2[_0x9069('0x1e')]],'as':_0x268bf2['as'],'attributes':_0x268bf2[_0x9069('0x1a')],'include':_0x268bf2[_0x9069('0x1c')]?_[_0x9069('0x1d')](_0x268bf2['include'],function(_0x5004df){return{'model':db[_0x5004df['model']],'as':_0x5004df['as'],'attributes':_0x5004df[_0x9069('0x1a')],'include':_0x5004df[_0x9069('0x1c')]?_['map'](_0x5004df[_0x9069('0x1c')],function(_0x2671d6){return{'model':db[_0x2671d6['model']],'as':_0x2671d6['as'],'attributes':_0x2671d6[_0x9069('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9069('0xb')](function(_0x5898f1){logger['info']('ShowZendeskAccount',_0xf51491);logger[_0x9069('0xc')]('ShowZendeskAccount',_0xf51491,JSON[_0x9069('0xe')](_0x5898f1));_0x41db38(_0x5898f1);})[_0x9069('0x15')](function(_0x3fa728){logger[_0x9069('0xf')](_0x9069('0x20'),_0x3fa728[_0x9069('0x12')],_0xf51491);_0x1cc454(_0x308b29[_0x9069('0xf')](0x1f4,_0x3fa728[_0x9069('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 6fee046..fdf1f26 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_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('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file +var _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0xe2ac77,_0x5722ed){var _0x312c5a=function(_0x45ac7c){while(--_0x45ac7c){_0xe2ac77['push'](_0xe2ac77['shift']());}};_0x312c5a(++_0x5722ed);}(_0x087b,0x11a));var _0xb087=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x087b[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);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 2154d99..f823f3f 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 _0x2973=['STRING','exports'];(function(_0x528a18,_0x5eb85e){var _0x5543a5=function(_0x45e64a){while(--_0x45e64a){_0x528a18['push'](_0x528a18['shift']());}};_0x5543a5(++_0x5eb85e);}(_0x2973,0x191));var _0x3297=function(_0x57d3d9,_0x2d605b){_0x57d3d9=_0x57d3d9-0x0;var _0x46730c=_0x2973[_0x57d3d9];return _0x46730c;};'use strict';var Sequelize=require('sequelize');module[_0x3297('0x0')]={'name':{'type':Sequelize[_0x3297('0x1')]},'description':{'type':Sequelize[_0x3297('0x1')]}}; \ No newline at end of file +var _0x9441=['STRING','sequelize','exports'];(function(_0x5bf4e6,_0x2dd6ae){var _0x472ba7=function(_0x80e18e){while(--_0x80e18e){_0x5bf4e6['push'](_0x5bf4e6['shift']());}};_0x472ba7(++_0x2dd6ae);}(_0x9441,0xf1));var _0x1944=function(_0x303b58,_0x371906){_0x303b58=_0x303b58-0x0;var _0x2f7896=_0x9441[_0x303b58];return _0x2f7896;};'use strict';var Sequelize=require(_0x1944('0x0'));module[_0x1944('0x1')]={'name':{'type':Sequelize[_0x1944('0x2')]},'description':{'type':Sequelize[_0x1944('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f31966e..9504f34 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 _0x3a9d=['util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','ZendeskConfiguration','include','findAll','rows','catch','includeAll','find','create','body','params','getFields','findOne','getSubjects','ZendeskField','getDescriptions','getTags','Tag','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x3a9d,0x199));var _0xd3a9=function(_0x111d6a,_0x77eee1){_0x111d6a=_0x111d6a-0x0;var _0x146b6f=_0x3a9d[_0x111d6a];return _0x146b6f;};'use strict';var emlformat=require(_0xd3a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3a9('0x1'));var jsonpatch=require(_0xd3a9('0x2'));var rp=require(_0xd3a9('0x3'));var moment=require(_0xd3a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd3a9('0x5'));var util=require(_0xd3a9('0x6'));var path=require(_0xd3a9('0x7'));var sox=require('sox');var csv=require(_0xd3a9('0x8'));var ejs=require(_0xd3a9('0x9'));var fs=require('fs');var fs_extra=require(_0xd3a9('0xa'));var _=require(_0xd3a9('0xb'));var squel=require(_0xd3a9('0xc'));var crypto=require('crypto');var jsforce=require(_0xd3a9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd3a9('0xe'));var Papa=require(_0xd3a9('0xf'));var Redis=require(_0xd3a9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd3a9('0x11'));var as=require(_0xd3a9('0x12'));var hardwareService=require(_0xd3a9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd3a9('0x14'));var config=require(_0xd3a9('0x15'));var licenseUtil=require(_0xd3a9('0x16'));var db=require(_0xd3a9('0x17'))['db'];function respondWithStatusCode(_0x42b29c,_0x8db17c){_0x8db17c=_0x8db17c||0xcc;return function(_0x3c7bc2){if(_0x3c7bc2){return _0x42b29c['sendStatus'](_0x8db17c);}return _0x42b29c[_0xd3a9('0x18')](_0x8db17c)[_0xd3a9('0x19')]();};}function respondWithResult(_0x2ba346,_0x2d15a8){_0x2d15a8=_0x2d15a8||0xc8;return function(_0x3726a8){if(_0x3726a8){return _0x2ba346[_0xd3a9('0x18')](_0x2d15a8)[_0xd3a9('0x1a')](_0x3726a8);}};}function respondWithFilteredResult(_0x207a09,_0x1a5097){return function(_0x113041){if(_0x113041){var _0x123263=typeof _0x1a5097[_0xd3a9('0x1b')]===_0xd3a9('0x1c')&&typeof _0x1a5097[_0xd3a9('0x1d')]===_0xd3a9('0x1c');var _0x1e440d=_0x113041[_0xd3a9('0x1e')];var _0x8c9c1=_0x123263?0x0:_0x1a5097['offset'];var _0x1f2674=_0x123263?_0x113041[_0xd3a9('0x1e')]:_0x1a5097[_0xd3a9('0x1b')]+_0x1a5097[_0xd3a9('0x1d')];var _0x563ed9;if(_0x1f2674>=_0x1e440d){_0x1f2674=_0x1e440d;_0x563ed9=0xc8;}else{_0x563ed9=0xce;}_0x207a09[_0xd3a9('0x18')](_0x563ed9);return _0x207a09['set']('Content-Range',_0x8c9c1+'-'+_0x1f2674+'/'+_0x1e440d)[_0xd3a9('0x1a')](_0x113041);}return null;};}function patchUpdates(_0x247215){return function(_0x45fac9){try{jsonpatch[_0xd3a9('0x1f')](_0x45fac9,_0x247215,!![]);}catch(_0x1c60b7){return BPromise[_0xd3a9('0x20')](_0x1c60b7);}return _0x45fac9[_0xd3a9('0x21')]();};}function saveUpdates(_0x590ac4,_0x2b9bc2){return function(_0x45d175){if(_0x45d175){return _0x45d175[_0xd3a9('0x22')](_0x590ac4)[_0xd3a9('0x23')](function(_0x16aa29){return _0x16aa29;});}return null;};}function removeEntity(_0x157942,_0x529242){return function(_0x9e2a69){if(_0x9e2a69){return _0x9e2a69[_0xd3a9('0x24')]()[_0xd3a9('0x23')](function(){_0x157942[_0xd3a9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6cf8a7,_0x26a66b){return function(_0x3d5724){if(!_0x3d5724){_0x6cf8a7[_0xd3a9('0x25')](0x194);}return _0x3d5724;};}function handleError(_0x444b5c,_0x14cb81){_0x14cb81=_0x14cb81||0x1f4;return function(_0x59963b){logger[_0xd3a9('0x26')](_0x59963b[_0xd3a9('0x27')]);if(_0x59963b[_0xd3a9('0x28')]){delete _0x59963b['name'];}_0x444b5c[_0xd3a9('0x18')](_0x14cb81)['send'](_0x59963b);};}exports[_0xd3a9('0x29')]=function(_0x3c6d50,_0x459169){var _0x21497f={},_0x33d34b={},_0xd383dc={'count':0x0,'rows':[]};var _0x3165aa=_[_0xd3a9('0x2a')](db['ZendeskConfiguration'][_0xd3a9('0x2b')],function(_0x356e8c){return{'name':_0x356e8c[_0xd3a9('0x2c')],'type':_0x356e8c[_0xd3a9('0x2d')][_0xd3a9('0x2e')]};});_0x33d34b[_0xd3a9('0x2f')]=_['map'](_0x3165aa,'name');_0x33d34b[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x3c6d50[_0xd3a9('0x30')]);_0x33d34b['filters']=_[_0xd3a9('0x32')](_0x33d34b[_0xd3a9('0x2f')],_0x33d34b['query']);_0x21497f[_0xd3a9('0x33')]=_[_0xd3a9('0x32')](_0x33d34b[_0xd3a9('0x2f')],qs[_0xd3a9('0x34')](_0x3c6d50[_0xd3a9('0x30')]['fields']));_0x21497f[_0xd3a9('0x33')]=_0x21497f[_0xd3a9('0x33')][_0xd3a9('0x35')]?_0x21497f[_0xd3a9('0x33')]:_0x33d34b[_0xd3a9('0x2f')];if(!_0x3c6d50['query'][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x21497f[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x3c6d50['query'][_0xd3a9('0x1d')]);_0x21497f[_0xd3a9('0x1b')]=qs[_0xd3a9('0x1b')](_0x3c6d50[_0xd3a9('0x30')][_0xd3a9('0x1b')]);}_0x21497f[_0xd3a9('0x38')]=qs['sort'](_0x3c6d50['query'][_0xd3a9('0x39')]);_0x21497f[_0xd3a9('0x3a')]=qs['filters'](_[_0xd3a9('0x3b')](_0x3c6d50['query'],_0x33d34b[_0xd3a9('0x3c')]),_0x3165aa);if(_0x3c6d50[_0xd3a9('0x30')][_0xd3a9('0x3d')]){_0x21497f[_0xd3a9('0x3a')]=_['merge'](_0x21497f[_0xd3a9('0x3a')],{'$or':_[_0xd3a9('0x2a')](_0x3165aa,function(_0x50cd33){if(_0x50cd33[_0xd3a9('0x2d')]!==_0xd3a9('0x3e')){var _0x450850={};_0x450850[_0x50cd33[_0xd3a9('0x28')]]={'$like':'%'+_0x3c6d50[_0xd3a9('0x30')][_0xd3a9('0x3d')]+'%'};return _0x450850;}})});}_0x21497f=_[_0xd3a9('0x3f')]({},_0x21497f,_0x3c6d50[_0xd3a9('0x40')]);var _0x4a7e55={'where':_0x21497f['where']};return db[_0xd3a9('0x41')][_0xd3a9('0x1e')](_0x4a7e55)[_0xd3a9('0x23')](function(_0x1cf802){_0xd383dc[_0xd3a9('0x1e')]=_0x1cf802;if(_0x3c6d50['query']['includeAll']){_0x21497f[_0xd3a9('0x42')]=[{'all':!![]}];}return db[_0xd3a9('0x41')][_0xd3a9('0x43')](_0x21497f);})[_0xd3a9('0x23')](function(_0x1071c3){_0xd383dc[_0xd3a9('0x44')]=_0x1071c3;return _0xd383dc;})['then'](respondWithFilteredResult(_0x459169,_0x21497f))[_0xd3a9('0x45')](handleError(_0x459169,null));};exports['show']=function(_0x2b3faf,_0x44847b){var _0x3768ec={'raw':![],'where':{'id':_0x2b3faf['params']['id']}},_0x52de91={};_0x52de91['model']=_[_0xd3a9('0x31')](db[_0xd3a9('0x41')][_0xd3a9('0x2b')]);_0x52de91[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x2b3faf[_0xd3a9('0x30')]);_0x52de91['filters']=_[_0xd3a9('0x32')](_0x52de91[_0xd3a9('0x2f')],_0x52de91['query']);_0x3768ec[_0xd3a9('0x33')]=_['intersection'](_0x52de91[_0xd3a9('0x2f')],qs['fields'](_0x2b3faf[_0xd3a9('0x30')]['fields']));_0x3768ec[_0xd3a9('0x33')]=_0x3768ec[_0xd3a9('0x33')]['length']?_0x3768ec[_0xd3a9('0x33')]:_0x52de91['model'];if(_0x2b3faf[_0xd3a9('0x30')][_0xd3a9('0x46')]){_0x3768ec[_0xd3a9('0x42')]=[{'all':!![]}];}_0x3768ec=_[_0xd3a9('0x3f')]({},_0x3768ec,_0x2b3faf[_0xd3a9('0x40')]);return db[_0xd3a9('0x41')][_0xd3a9('0x47')](_0x3768ec)['then'](handleEntityNotFound(_0x44847b,null))[_0xd3a9('0x23')](respondWithResult(_0x44847b,null))[_0xd3a9('0x45')](handleError(_0x44847b,null));};exports[_0xd3a9('0x48')]=function(_0x58e763,_0x19c4a9){return db['ZendeskConfiguration']['create'](_0x58e763[_0xd3a9('0x49')],{})[_0xd3a9('0x23')](respondWithResult(_0x19c4a9,0xc9))['catch'](handleError(_0x19c4a9,null));};exports['update']=function(_0x30855a,_0x2960b4){if(_0x30855a[_0xd3a9('0x49')]['id']){delete _0x30855a['body']['id'];}return db[_0xd3a9('0x41')][_0xd3a9('0x47')]({'where':{'id':_0x30855a[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x2960b4,null))[_0xd3a9('0x23')](saveUpdates(_0x30855a['body'],null))[_0xd3a9('0x23')](respondWithResult(_0x2960b4,null))[_0xd3a9('0x45')](handleError(_0x2960b4,null));};exports[_0xd3a9('0x24')]=function(_0x4cd90d,_0x3b2760){return db[_0xd3a9('0x41')][_0xd3a9('0x47')]({'where':{'id':_0x4cd90d[_0xd3a9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b2760,null))[_0xd3a9('0x23')](removeEntity(_0x3b2760,null))[_0xd3a9('0x45')](handleError(_0x3b2760,null));};exports[_0xd3a9('0x4b')]=function(_0x562148,_0xaf64cf,_0x52efa4){var _0x105e5f={};var _0x51c37f={};var _0x5127f8;var _0x75a9e5;return db['ZendeskConfiguration'][_0xd3a9('0x4c')]({'where':{'id':_0x562148['params']['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0xaf64cf,null))[_0xd3a9('0x23')](function(_0x482ef8){if(_0x482ef8){_0x5127f8=_0x482ef8;_0x51c37f['model']=_[_0xd3a9('0x31')](db['ZendeskField']['rawAttributes']);_0x51c37f[_0xd3a9('0x30')]=_['keys'](_0x562148[_0xd3a9('0x30')]);_0x51c37f[_0xd3a9('0x3c')]=_[_0xd3a9('0x32')](_0x51c37f[_0xd3a9('0x2f')],_0x51c37f[_0xd3a9('0x30')]);_0x105e5f[_0xd3a9('0x33')]=_['intersection'](_0x51c37f['model'],qs['fields'](_0x562148[_0xd3a9('0x30')][_0xd3a9('0x34')]));_0x105e5f[_0xd3a9('0x33')]=_0x105e5f[_0xd3a9('0x33')]['length']?_0x105e5f[_0xd3a9('0x33')]:_0x51c37f[_0xd3a9('0x2f')];_0x105e5f['order']=qs[_0xd3a9('0x39')](_0x562148[_0xd3a9('0x30')][_0xd3a9('0x39')]);_0x105e5f[_0xd3a9('0x3a')]=qs[_0xd3a9('0x3c')](_[_0xd3a9('0x3b')](_0x562148['query'],_0x51c37f['filters']));if(_0x562148[_0xd3a9('0x30')][_0xd3a9('0x3d')]){_0x105e5f[_0xd3a9('0x3a')]=_[_0xd3a9('0x3f')](_0x105e5f[_0xd3a9('0x3a')],{'$or':_[_0xd3a9('0x2a')](_0x105e5f[_0xd3a9('0x33')],function(_0xecf191){var _0x210537={};_0x210537[_0xecf191]={'$like':'%'+_0x562148[_0xd3a9('0x30')][_0xd3a9('0x3d')]+'%'};return _0x210537;})});}_0x105e5f=_[_0xd3a9('0x3f')]({},_0x105e5f,_0x562148[_0xd3a9('0x40')]);return _0x5127f8[_0xd3a9('0x4b')](_0x105e5f);}})[_0xd3a9('0x23')](function(_0x17c9ca){if(_0x17c9ca){_0x75a9e5=_0x17c9ca['length'];if(!_0x562148[_0xd3a9('0x30')][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x105e5f[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x562148[_0xd3a9('0x30')][_0xd3a9('0x1d')]);_0x105e5f[_0xd3a9('0x1b')]=qs[_0xd3a9('0x1b')](_0x562148['query'][_0xd3a9('0x1b')]);}return _0x5127f8[_0xd3a9('0x4b')](_0x105e5f);}})[_0xd3a9('0x23')](function(_0xd188e1){if(_0xd188e1){return _0xd188e1?{'count':_0x75a9e5,'rows':_0xd188e1}:null;}})[_0xd3a9('0x23')](respondWithResult(_0xaf64cf,null))[_0xd3a9('0x45')](handleError(_0xaf64cf,null));};exports[_0xd3a9('0x4d')]=function(_0x16f915,_0x15bbaa,_0x2bb38d){var _0x577e2b={};var _0x5f3f2d={};var _0x4087f2;var _0x3b72be;return db[_0xd3a9('0x41')]['findOne']({'where':{'id':_0x16f915[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x15bbaa,null))[_0xd3a9('0x23')](function(_0x2638c0){if(_0x2638c0){_0x4087f2=_0x2638c0;_0x5f3f2d[_0xd3a9('0x2f')]=_[_0xd3a9('0x31')](db[_0xd3a9('0x4e')][_0xd3a9('0x2b')]);_0x5f3f2d[_0xd3a9('0x30')]=_['keys'](_0x16f915[_0xd3a9('0x30')]);_0x5f3f2d['filters']=_[_0xd3a9('0x32')](_0x5f3f2d[_0xd3a9('0x2f')],_0x5f3f2d['query']);_0x577e2b[_0xd3a9('0x33')]=_['intersection'](_0x5f3f2d[_0xd3a9('0x2f')],qs['fields'](_0x16f915['query'][_0xd3a9('0x34')]));_0x577e2b[_0xd3a9('0x33')]=_0x577e2b['attributes']['length']?_0x577e2b['attributes']:_0x5f3f2d[_0xd3a9('0x2f')];_0x577e2b[_0xd3a9('0x38')]=qs['sort'](_0x16f915['query']['sort']);_0x577e2b[_0xd3a9('0x3a')]=qs[_0xd3a9('0x3c')](_[_0xd3a9('0x3b')](_0x16f915[_0xd3a9('0x30')],_0x5f3f2d[_0xd3a9('0x3c')]));if(_0x16f915[_0xd3a9('0x30')]['filter']){_0x577e2b[_0xd3a9('0x3a')]=_[_0xd3a9('0x3f')](_0x577e2b[_0xd3a9('0x3a')],{'$or':_['map'](_0x577e2b['attributes'],function(_0x47370e){var _0x131071={};_0x131071[_0x47370e]={'$like':'%'+_0x16f915['query'][_0xd3a9('0x3d')]+'%'};return _0x131071;})});}_0x577e2b=_['merge']({},_0x577e2b,_0x16f915[_0xd3a9('0x40')]);return _0x4087f2[_0xd3a9('0x4d')](_0x577e2b);}})[_0xd3a9('0x23')](function(_0x42a8d5){if(_0x42a8d5){_0x3b72be=_0x42a8d5[_0xd3a9('0x35')];if(!_0x16f915[_0xd3a9('0x30')][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x577e2b['limit']=qs[_0xd3a9('0x1d')](_0x16f915['query'][_0xd3a9('0x1d')]);_0x577e2b['offset']=qs['offset'](_0x16f915[_0xd3a9('0x30')][_0xd3a9('0x1b')]);}return _0x4087f2[_0xd3a9('0x4d')](_0x577e2b);}})[_0xd3a9('0x23')](function(_0x2ebcbd){if(_0x2ebcbd){return _0x2ebcbd?{'count':_0x3b72be,'rows':_0x2ebcbd}:null;}})[_0xd3a9('0x23')](respondWithResult(_0x15bbaa,null))[_0xd3a9('0x45')](handleError(_0x15bbaa,null));};exports[_0xd3a9('0x4f')]=function(_0x270c09,_0xd1c3cb,_0x47993b){var _0x46de3a={};var _0xbe4ae7={};var _0x21ad50;var _0x4fba73;return db[_0xd3a9('0x41')][_0xd3a9('0x4c')]({'where':{'id':_0x270c09[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0xd1c3cb,null))[_0xd3a9('0x23')](function(_0x450146){if(_0x450146){_0x21ad50=_0x450146;_0xbe4ae7['model']=_['keys'](db[_0xd3a9('0x4e')][_0xd3a9('0x2b')]);_0xbe4ae7[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x270c09[_0xd3a9('0x30')]);_0xbe4ae7['filters']=_[_0xd3a9('0x32')](_0xbe4ae7[_0xd3a9('0x2f')],_0xbe4ae7['query']);_0x46de3a[_0xd3a9('0x33')]=_[_0xd3a9('0x32')](_0xbe4ae7[_0xd3a9('0x2f')],qs[_0xd3a9('0x34')](_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x34')]));_0x46de3a[_0xd3a9('0x33')]=_0x46de3a[_0xd3a9('0x33')][_0xd3a9('0x35')]?_0x46de3a[_0xd3a9('0x33')]:_0xbe4ae7['model'];_0x46de3a[_0xd3a9('0x38')]=qs['sort'](_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x39')]);_0x46de3a[_0xd3a9('0x3a')]=qs['filters'](_[_0xd3a9('0x3b')](_0x270c09[_0xd3a9('0x30')],_0xbe4ae7[_0xd3a9('0x3c')]));if(_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x3d')]){_0x46de3a[_0xd3a9('0x3a')]=_['merge'](_0x46de3a[_0xd3a9('0x3a')],{'$or':_[_0xd3a9('0x2a')](_0x46de3a[_0xd3a9('0x33')],function(_0x3ec44e){var _0x5edafe={};_0x5edafe[_0x3ec44e]={'$like':'%'+_0x270c09[_0xd3a9('0x30')]['filter']+'%'};return _0x5edafe;})});}_0x46de3a=_[_0xd3a9('0x3f')]({},_0x46de3a,_0x270c09[_0xd3a9('0x40')]);return _0x21ad50[_0xd3a9('0x4f')](_0x46de3a);}})[_0xd3a9('0x23')](function(_0x4ec1ec){if(_0x4ec1ec){_0x4fba73=_0x4ec1ec[_0xd3a9('0x35')];if(!_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x46de3a[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x270c09[_0xd3a9('0x30')]['limit']);_0x46de3a['offset']=qs[_0xd3a9('0x1b')](_0x270c09[_0xd3a9('0x30')]['offset']);}return _0x21ad50[_0xd3a9('0x4f')](_0x46de3a);}})['then'](function(_0x1b6690){if(_0x1b6690){return _0x1b6690?{'count':_0x4fba73,'rows':_0x1b6690}:null;}})['then'](respondWithResult(_0xd1c3cb,null))['catch'](handleError(_0xd1c3cb,null));};exports[_0xd3a9('0x50')]=function(_0x12d76f,_0x29efd8,_0x36a347){var _0x17f617={};var _0x4904d5={};var _0x2e466e;var _0x5c3868;return db['ZendeskConfiguration'][_0xd3a9('0x4c')]({'where':{'id':_0x12d76f['params']['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x29efd8,null))[_0xd3a9('0x23')](function(_0x3e61ca){if(_0x3e61ca){_0x2e466e=_0x3e61ca;_0x4904d5[_0xd3a9('0x2f')]=_[_0xd3a9('0x31')](db[_0xd3a9('0x51')][_0xd3a9('0x2b')]);_0x4904d5[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x12d76f['query']);_0x4904d5[_0xd3a9('0x3c')]=_[_0xd3a9('0x32')](_0x4904d5[_0xd3a9('0x2f')],_0x4904d5[_0xd3a9('0x30')]);_0x17f617[_0xd3a9('0x33')]=_[_0xd3a9('0x32')](_0x4904d5[_0xd3a9('0x2f')],qs[_0xd3a9('0x34')](_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x34')]));_0x17f617[_0xd3a9('0x33')]=_0x17f617[_0xd3a9('0x33')]['length']?_0x17f617['attributes']:_0x4904d5['model'];_0x17f617[_0xd3a9('0x38')]=qs['sort'](_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x39')]);_0x17f617['where']=qs[_0xd3a9('0x3c')](_[_0xd3a9('0x3b')](_0x12d76f['query'],_0x4904d5['filters']));if(_0x12d76f[_0xd3a9('0x30')]['filter']){_0x17f617[_0xd3a9('0x3a')]=_[_0xd3a9('0x3f')](_0x17f617['where'],{'$or':_['map'](_0x17f617['attributes'],function(_0x65578e){var _0x507e47={};_0x507e47[_0x65578e]={'$like':'%'+_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x3d')]+'%'};return _0x507e47;})});}_0x17f617=_['merge']({},_0x17f617,_0x12d76f['options']);return _0x2e466e['getTags'](_0x17f617);}})[_0xd3a9('0x23')](function(_0x5811d4){if(_0x5811d4){_0x5c3868=_0x5811d4[_0xd3a9('0x35')];if(!_0x12d76f[_0xd3a9('0x30')]['hasOwnProperty'](_0xd3a9('0x37'))){_0x17f617[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x12d76f[_0xd3a9('0x30')]['limit']);_0x17f617['offset']=qs[_0xd3a9('0x1b')](_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x1b')]);}return _0x2e466e['getTags'](_0x17f617);}})[_0xd3a9('0x23')](function(_0x5e94da){if(_0x5e94da){return _0x5e94da?{'count':_0x5c3868,'rows':_0x5e94da}:null;}})[_0xd3a9('0x23')](respondWithResult(_0x29efd8,null))[_0xd3a9('0x45')](handleError(_0x29efd8,null));};exports['setTags']=function(_0x519a68,_0x3381f4,_0x4d8dd3){if(_0x519a68['body']['id']){delete _0x519a68[_0xd3a9('0x49')]['id'];}return db[_0xd3a9('0x41')]['findOne']({'where':{'id':_0x519a68[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x3381f4,null))[_0xd3a9('0x23')](function(_0x49d233){if(_0x49d233){return _0x49d233['setTags'](_0x519a68[_0xd3a9('0x49')][_0xd3a9('0x52')]||[]);}return null;})[_0xd3a9('0x23')](respondWithResult(_0x3381f4,null))['catch'](handleError(_0x3381f4,null));}; \ No newline at end of file +var _0xd3e0=['end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','update','params','find','getFields','ZendeskField','pick','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x11166a,_0x4ff4c2){var _0x2633b1=function(_0xef7e0d){while(--_0xef7e0d){_0x11166a['push'](_0x11166a['shift']());}};_0x2633b1(++_0x4ff4c2);}(_0xd3e0,0x1df));var _0x0d3e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd3e0[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x0d3e('0x0'));var rimraf=require(_0x0d3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d3e('0x2'));var moment=require(_0x0d3e('0x3'));var BPromise=require(_0x0d3e('0x4'));var Mustache=require(_0x0d3e('0x5'));var util=require(_0x0d3e('0x6'));var path=require(_0x0d3e('0x7'));var sox=require(_0x0d3e('0x8'));var csv=require(_0x0d3e('0x9'));var ejs=require(_0x0d3e('0xa'));var fs=require('fs');var fs_extra=require(_0x0d3e('0xb'));var _=require(_0x0d3e('0xc'));var squel=require('squel');var crypto=require(_0x0d3e('0xd'));var jsforce=require(_0x0d3e('0xe'));var deskjs=require(_0x0d3e('0xf'));var toCsv=require(_0x0d3e('0x9'));var querystring=require('querystring');var Papa=require(_0x0d3e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0d3e('0x11'));var as=require(_0x0d3e('0x12'));var hardwareService=require(_0x0d3e('0x13'));var logger=require(_0x0d3e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0d3e('0x15'));var licenseUtil=require(_0x0d3e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12ac74,_0x1e886e){_0x1e886e=_0x1e886e||0xcc;return function(_0x29fb6f){if(_0x29fb6f){return _0x12ac74[_0x0d3e('0x17')](_0x1e886e);}return _0x12ac74[_0x0d3e('0x18')](_0x1e886e)[_0x0d3e('0x19')]();};}function respondWithResult(_0x4bbeca,_0x264fe8){_0x264fe8=_0x264fe8||0xc8;return function(_0x3a204d){if(_0x3a204d){return _0x4bbeca[_0x0d3e('0x18')](_0x264fe8)['json'](_0x3a204d);}};}function respondWithFilteredResult(_0x3ac676,_0x32448a){return function(_0x3826b1){if(_0x3826b1){var _0x197fc4=typeof _0x32448a[_0x0d3e('0x1a')]===_0x0d3e('0x1b')&&typeof _0x32448a[_0x0d3e('0x1c')]===_0x0d3e('0x1b');var _0xf36f31=_0x3826b1[_0x0d3e('0x1d')];var _0x2c1c68=_0x197fc4?0x0:_0x32448a[_0x0d3e('0x1a')];var _0x2779c8=_0x197fc4?_0x3826b1[_0x0d3e('0x1d')]:_0x32448a['offset']+_0x32448a[_0x0d3e('0x1c')];var _0x196a85;if(_0x2779c8>=_0xf36f31){_0x2779c8=_0xf36f31;_0x196a85=0xc8;}else{_0x196a85=0xce;}_0x3ac676[_0x0d3e('0x18')](_0x196a85);return _0x3ac676[_0x0d3e('0x1e')](_0x0d3e('0x1f'),_0x2c1c68+'-'+_0x2779c8+'/'+_0xf36f31)[_0x0d3e('0x20')](_0x3826b1);}return null;};}function patchUpdates(_0x3097b4){return function(_0x3d30b1){try{jsonpatch[_0x0d3e('0x21')](_0x3d30b1,_0x3097b4,!![]);}catch(_0x1ac688){return BPromise[_0x0d3e('0x22')](_0x1ac688);}return _0x3d30b1['save']();};}function saveUpdates(_0x2817e0,_0x24f7a6){return function(_0x3ae55f){if(_0x3ae55f){return _0x3ae55f['update'](_0x2817e0)[_0x0d3e('0x23')](function(_0x16f745){return _0x16f745;});}return null;};}function removeEntity(_0x585a9e,_0x145b05){return function(_0x13eb50){if(_0x13eb50){return _0x13eb50[_0x0d3e('0x24')]()['then'](function(){_0x585a9e[_0x0d3e('0x18')](0xcc)[_0x0d3e('0x19')]();});}};}function handleEntityNotFound(_0x439485,_0x247118){return function(_0x3644e7){if(!_0x3644e7){_0x439485[_0x0d3e('0x17')](0x194);}return _0x3644e7;};}function handleError(_0x29d807,_0x353b19){_0x353b19=_0x353b19||0x1f4;return function(_0x2c1883){logger[_0x0d3e('0x25')](_0x2c1883[_0x0d3e('0x26')]);if(_0x2c1883['name']){delete _0x2c1883[_0x0d3e('0x27')];}_0x29d807[_0x0d3e('0x18')](_0x353b19)['send'](_0x2c1883);};}exports[_0x0d3e('0x28')]=function(_0x3a8ecc,_0x5a757d){var _0x265a51={},_0x2f99ef={},_0xecf6ea={'count':0x0,'rows':[]};var _0x5d2546=_[_0x0d3e('0x29')](db[_0x0d3e('0x2a')][_0x0d3e('0x2b')],function(_0x57641b){return{'name':_0x57641b[_0x0d3e('0x2c')],'type':_0x57641b['type'][_0x0d3e('0x2d')]};});_0x2f99ef[_0x0d3e('0x2e')]=_[_0x0d3e('0x29')](_0x5d2546,_0x0d3e('0x27'));_0x2f99ef[_0x0d3e('0x2f')]=_[_0x0d3e('0x30')](_0x3a8ecc['query']);_0x2f99ef[_0x0d3e('0x31')]=_[_0x0d3e('0x32')](_0x2f99ef[_0x0d3e('0x2e')],_0x2f99ef['query']);_0x265a51[_0x0d3e('0x33')]=_['intersection'](_0x2f99ef[_0x0d3e('0x2e')],qs[_0x0d3e('0x34')](_0x3a8ecc[_0x0d3e('0x2f')][_0x0d3e('0x34')]));_0x265a51[_0x0d3e('0x33')]=_0x265a51[_0x0d3e('0x33')][_0x0d3e('0x35')]?_0x265a51[_0x0d3e('0x33')]:_0x2f99ef[_0x0d3e('0x2e')];if(!_0x3a8ecc[_0x0d3e('0x2f')][_0x0d3e('0x36')](_0x0d3e('0x37'))){_0x265a51[_0x0d3e('0x1c')]=qs[_0x0d3e('0x1c')](_0x3a8ecc['query'][_0x0d3e('0x1c')]);_0x265a51[_0x0d3e('0x1a')]=qs['offset'](_0x3a8ecc['query']['offset']);}_0x265a51[_0x0d3e('0x38')]=qs[_0x0d3e('0x39')](_0x3a8ecc['query'][_0x0d3e('0x39')]);_0x265a51[_0x0d3e('0x3a')]=qs[_0x0d3e('0x31')](_['pick'](_0x3a8ecc[_0x0d3e('0x2f')],_0x2f99ef[_0x0d3e('0x31')]),_0x5d2546);if(_0x3a8ecc[_0x0d3e('0x2f')][_0x0d3e('0x3b')]){_0x265a51[_0x0d3e('0x3a')]=_[_0x0d3e('0x3c')](_0x265a51['where'],{'$or':_[_0x0d3e('0x29')](_0x5d2546,function(_0x5da091){if(_0x5da091[_0x0d3e('0x3d')]!==_0x0d3e('0x3e')){var _0x5b4f37={};_0x5b4f37[_0x5da091[_0x0d3e('0x27')]]={'$like':'%'+_0x3a8ecc[_0x0d3e('0x2f')][_0x0d3e('0x3b')]+'%'};return _0x5b4f37;}})});}_0x265a51=_[_0x0d3e('0x3c')]({},_0x265a51,_0x3a8ecc[_0x0d3e('0x3f')]);var _0x3c9c41={'where':_0x265a51[_0x0d3e('0x3a')]};return db[_0x0d3e('0x2a')][_0x0d3e('0x1d')](_0x3c9c41)['then'](function(_0x5d0db4){_0xecf6ea[_0x0d3e('0x1d')]=_0x5d0db4;if(_0x3a8ecc[_0x0d3e('0x2f')][_0x0d3e('0x40')]){_0x265a51[_0x0d3e('0x41')]=[{'all':!![]}];}return db[_0x0d3e('0x2a')]['findAll'](_0x265a51);})[_0x0d3e('0x23')](function(_0x137e14){_0xecf6ea[_0x0d3e('0x42')]=_0x137e14;return _0xecf6ea;})[_0x0d3e('0x23')](respondWithFilteredResult(_0x5a757d,_0x265a51))[_0x0d3e('0x43')](handleError(_0x5a757d,null));};exports[_0x0d3e('0x44')]=function(_0x32ef9c,_0x2d1abe){var _0x109534={'raw':![],'where':{'id':_0x32ef9c['params']['id']}},_0x12f2c6={};_0x12f2c6[_0x0d3e('0x2e')]=_[_0x0d3e('0x30')](db[_0x0d3e('0x2a')][_0x0d3e('0x2b')]);_0x12f2c6[_0x0d3e('0x2f')]=_[_0x0d3e('0x30')](_0x32ef9c[_0x0d3e('0x2f')]);_0x12f2c6[_0x0d3e('0x31')]=_[_0x0d3e('0x32')](_0x12f2c6['model'],_0x12f2c6[_0x0d3e('0x2f')]);_0x109534[_0x0d3e('0x33')]=_[_0x0d3e('0x32')](_0x12f2c6[_0x0d3e('0x2e')],qs[_0x0d3e('0x34')](_0x32ef9c['query'][_0x0d3e('0x34')]));_0x109534[_0x0d3e('0x33')]=_0x109534['attributes'][_0x0d3e('0x35')]?_0x109534[_0x0d3e('0x33')]:_0x12f2c6[_0x0d3e('0x2e')];if(_0x32ef9c[_0x0d3e('0x2f')][_0x0d3e('0x40')]){_0x109534[_0x0d3e('0x41')]=[{'all':!![]}];}_0x109534=_[_0x0d3e('0x3c')]({},_0x109534,_0x32ef9c['options']);return db['ZendeskConfiguration']['find'](_0x109534)[_0x0d3e('0x23')](handleEntityNotFound(_0x2d1abe,null))['then'](respondWithResult(_0x2d1abe,null))['catch'](handleError(_0x2d1abe,null));};exports[_0x0d3e('0x45')]=function(_0x272e64,_0x21da7a){return db[_0x0d3e('0x2a')][_0x0d3e('0x45')](_0x272e64[_0x0d3e('0x46')],{})[_0x0d3e('0x23')](respondWithResult(_0x21da7a,0xc9))['catch'](handleError(_0x21da7a,null));};exports[_0x0d3e('0x47')]=function(_0x36444a,_0x592fc6){if(_0x36444a[_0x0d3e('0x46')]['id']){delete _0x36444a[_0x0d3e('0x46')]['id'];}return db[_0x0d3e('0x2a')]['find']({'where':{'id':_0x36444a[_0x0d3e('0x48')]['id']}})[_0x0d3e('0x23')](handleEntityNotFound(_0x592fc6,null))[_0x0d3e('0x23')](saveUpdates(_0x36444a[_0x0d3e('0x46')],null))[_0x0d3e('0x23')](respondWithResult(_0x592fc6,null))['catch'](handleError(_0x592fc6,null));};exports[_0x0d3e('0x24')]=function(_0x458156,_0x324234){return db[_0x0d3e('0x2a')][_0x0d3e('0x49')]({'where':{'id':_0x458156[_0x0d3e('0x48')]['id']}})[_0x0d3e('0x23')](handleEntityNotFound(_0x324234,null))['then'](removeEntity(_0x324234,null))[_0x0d3e('0x43')](handleError(_0x324234,null));};exports[_0x0d3e('0x4a')]=function(_0x3a5847,_0x3c34cb,_0x10a362){var _0x63f2c2={};var _0x46f8a6={};var _0x55a131;var _0xe5add9;return db[_0x0d3e('0x2a')]['findOne']({'where':{'id':_0x3a5847[_0x0d3e('0x48')]['id']}})[_0x0d3e('0x23')](handleEntityNotFound(_0x3c34cb,null))[_0x0d3e('0x23')](function(_0x509508){if(_0x509508){_0x55a131=_0x509508;_0x46f8a6[_0x0d3e('0x2e')]=_[_0x0d3e('0x30')](db[_0x0d3e('0x4b')][_0x0d3e('0x2b')]);_0x46f8a6['query']=_[_0x0d3e('0x30')](_0x3a5847['query']);_0x46f8a6['filters']=_['intersection'](_0x46f8a6[_0x0d3e('0x2e')],_0x46f8a6['query']);_0x63f2c2['attributes']=_[_0x0d3e('0x32')](_0x46f8a6[_0x0d3e('0x2e')],qs[_0x0d3e('0x34')](_0x3a5847[_0x0d3e('0x2f')]['fields']));_0x63f2c2[_0x0d3e('0x33')]=_0x63f2c2[_0x0d3e('0x33')][_0x0d3e('0x35')]?_0x63f2c2[_0x0d3e('0x33')]:_0x46f8a6[_0x0d3e('0x2e')];_0x63f2c2['order']=qs[_0x0d3e('0x39')](_0x3a5847[_0x0d3e('0x2f')]['sort']);_0x63f2c2[_0x0d3e('0x3a')]=qs[_0x0d3e('0x31')](_[_0x0d3e('0x4c')](_0x3a5847[_0x0d3e('0x2f')],_0x46f8a6[_0x0d3e('0x31')]));if(_0x3a5847['query'][_0x0d3e('0x3b')]){_0x63f2c2[_0x0d3e('0x3a')]=_[_0x0d3e('0x3c')](_0x63f2c2[_0x0d3e('0x3a')],{'$or':_[_0x0d3e('0x29')](_0x63f2c2[_0x0d3e('0x33')],function(_0x190892){var _0x2d230f={};_0x2d230f[_0x190892]={'$like':'%'+_0x3a5847['query'][_0x0d3e('0x3b')]+'%'};return _0x2d230f;})});}_0x63f2c2=_[_0x0d3e('0x3c')]({},_0x63f2c2,_0x3a5847[_0x0d3e('0x3f')]);return _0x55a131[_0x0d3e('0x4a')](_0x63f2c2);}})[_0x0d3e('0x23')](function(_0x4d6461){if(_0x4d6461){_0xe5add9=_0x4d6461[_0x0d3e('0x35')];if(!_0x3a5847[_0x0d3e('0x2f')][_0x0d3e('0x36')](_0x0d3e('0x37'))){_0x63f2c2[_0x0d3e('0x1c')]=qs[_0x0d3e('0x1c')](_0x3a5847[_0x0d3e('0x2f')][_0x0d3e('0x1c')]);_0x63f2c2['offset']=qs[_0x0d3e('0x1a')](_0x3a5847[_0x0d3e('0x2f')][_0x0d3e('0x1a')]);}return _0x55a131[_0x0d3e('0x4a')](_0x63f2c2);}})[_0x0d3e('0x23')](function(_0xc45aa){if(_0xc45aa){return _0xc45aa?{'count':_0xe5add9,'rows':_0xc45aa}:null;}})[_0x0d3e('0x23')](respondWithResult(_0x3c34cb,null))['catch'](handleError(_0x3c34cb,null));};exports['getSubjects']=function(_0x1a681d,_0x21a4dc,_0x3aba16){var _0x57f9bf={};var _0x26b998={};var _0x4cc07f;var _0x5b92fe;return db[_0x0d3e('0x2a')][_0x0d3e('0x4d')]({'where':{'id':_0x1a681d['params']['id']}})[_0x0d3e('0x23')](handleEntityNotFound(_0x21a4dc,null))[_0x0d3e('0x23')](function(_0x29fd56){if(_0x29fd56){_0x4cc07f=_0x29fd56;_0x26b998[_0x0d3e('0x2e')]=_[_0x0d3e('0x30')](db[_0x0d3e('0x4b')]['rawAttributes']);_0x26b998[_0x0d3e('0x2f')]=_[_0x0d3e('0x30')](_0x1a681d[_0x0d3e('0x2f')]);_0x26b998[_0x0d3e('0x31')]=_[_0x0d3e('0x32')](_0x26b998[_0x0d3e('0x2e')],_0x26b998[_0x0d3e('0x2f')]);_0x57f9bf[_0x0d3e('0x33')]=_[_0x0d3e('0x32')](_0x26b998[_0x0d3e('0x2e')],qs[_0x0d3e('0x34')](_0x1a681d[_0x0d3e('0x2f')][_0x0d3e('0x34')]));_0x57f9bf['attributes']=_0x57f9bf[_0x0d3e('0x33')][_0x0d3e('0x35')]?_0x57f9bf[_0x0d3e('0x33')]:_0x26b998['model'];_0x57f9bf[_0x0d3e('0x38')]=qs[_0x0d3e('0x39')](_0x1a681d[_0x0d3e('0x2f')][_0x0d3e('0x39')]);_0x57f9bf[_0x0d3e('0x3a')]=qs[_0x0d3e('0x31')](_[_0x0d3e('0x4c')](_0x1a681d[_0x0d3e('0x2f')],_0x26b998[_0x0d3e('0x31')]));if(_0x1a681d['query']['filter']){_0x57f9bf[_0x0d3e('0x3a')]=_[_0x0d3e('0x3c')](_0x57f9bf[_0x0d3e('0x3a')],{'$or':_[_0x0d3e('0x29')](_0x57f9bf[_0x0d3e('0x33')],function(_0x30c170){var _0x213a36={};_0x213a36[_0x30c170]={'$like':'%'+_0x1a681d['query']['filter']+'%'};return _0x213a36;})});}_0x57f9bf=_['merge']({},_0x57f9bf,_0x1a681d['options']);return _0x4cc07f[_0x0d3e('0x4e')](_0x57f9bf);}})[_0x0d3e('0x23')](function(_0x186fe3){if(_0x186fe3){_0x5b92fe=_0x186fe3['length'];if(!_0x1a681d[_0x0d3e('0x2f')]['hasOwnProperty'](_0x0d3e('0x37'))){_0x57f9bf[_0x0d3e('0x1c')]=qs[_0x0d3e('0x1c')](_0x1a681d[_0x0d3e('0x2f')][_0x0d3e('0x1c')]);_0x57f9bf['offset']=qs[_0x0d3e('0x1a')](_0x1a681d[_0x0d3e('0x2f')]['offset']);}return _0x4cc07f['getSubjects'](_0x57f9bf);}})[_0x0d3e('0x23')](function(_0x351cc0){if(_0x351cc0){return _0x351cc0?{'count':_0x5b92fe,'rows':_0x351cc0}:null;}})[_0x0d3e('0x23')](respondWithResult(_0x21a4dc,null))[_0x0d3e('0x43')](handleError(_0x21a4dc,null));};exports[_0x0d3e('0x4f')]=function(_0x519ae6,_0x4660fc,_0x67228e){var _0x3c88f4={};var _0x84301d={};var _0x4c2084;var _0x4c8dc3;return db[_0x0d3e('0x2a')]['findOne']({'where':{'id':_0x519ae6[_0x0d3e('0x48')]['id']}})[_0x0d3e('0x23')](handleEntityNotFound(_0x4660fc,null))[_0x0d3e('0x23')](function(_0x4c2b0e){if(_0x4c2b0e){_0x4c2084=_0x4c2b0e;_0x84301d[_0x0d3e('0x2e')]=_['keys'](db[_0x0d3e('0x4b')][_0x0d3e('0x2b')]);_0x84301d[_0x0d3e('0x2f')]=_['keys'](_0x519ae6[_0x0d3e('0x2f')]);_0x84301d[_0x0d3e('0x31')]=_[_0x0d3e('0x32')](_0x84301d[_0x0d3e('0x2e')],_0x84301d[_0x0d3e('0x2f')]);_0x3c88f4['attributes']=_[_0x0d3e('0x32')](_0x84301d['model'],qs[_0x0d3e('0x34')](_0x519ae6[_0x0d3e('0x2f')]['fields']));_0x3c88f4[_0x0d3e('0x33')]=_0x3c88f4['attributes'][_0x0d3e('0x35')]?_0x3c88f4[_0x0d3e('0x33')]:_0x84301d[_0x0d3e('0x2e')];_0x3c88f4[_0x0d3e('0x38')]=qs[_0x0d3e('0x39')](_0x519ae6[_0x0d3e('0x2f')]['sort']);_0x3c88f4[_0x0d3e('0x3a')]=qs[_0x0d3e('0x31')](_['pick'](_0x519ae6[_0x0d3e('0x2f')],_0x84301d[_0x0d3e('0x31')]));if(_0x519ae6['query']['filter']){_0x3c88f4['where']=_['merge'](_0x3c88f4['where'],{'$or':_['map'](_0x3c88f4['attributes'],function(_0x4841ae){var _0x3d309f={};_0x3d309f[_0x4841ae]={'$like':'%'+_0x519ae6[_0x0d3e('0x2f')][_0x0d3e('0x3b')]+'%'};return _0x3d309f;})});}_0x3c88f4=_[_0x0d3e('0x3c')]({},_0x3c88f4,_0x519ae6['options']);return _0x4c2084[_0x0d3e('0x4f')](_0x3c88f4);}})['then'](function(_0x9323d0){if(_0x9323d0){_0x4c8dc3=_0x9323d0[_0x0d3e('0x35')];if(!_0x519ae6[_0x0d3e('0x2f')][_0x0d3e('0x36')](_0x0d3e('0x37'))){_0x3c88f4[_0x0d3e('0x1c')]=qs[_0x0d3e('0x1c')](_0x519ae6[_0x0d3e('0x2f')]['limit']);_0x3c88f4[_0x0d3e('0x1a')]=qs[_0x0d3e('0x1a')](_0x519ae6[_0x0d3e('0x2f')][_0x0d3e('0x1a')]);}return _0x4c2084[_0x0d3e('0x4f')](_0x3c88f4);}})[_0x0d3e('0x23')](function(_0x147399){if(_0x147399){return _0x147399?{'count':_0x4c8dc3,'rows':_0x147399}:null;}})['then'](respondWithResult(_0x4660fc,null))['catch'](handleError(_0x4660fc,null));};exports[_0x0d3e('0x50')]=function(_0x531be2,_0x19c7e3,_0x183228){var _0x66b119={};var _0x105c29={};var _0x551824;var _0x2cf26f;return db[_0x0d3e('0x2a')][_0x0d3e('0x4d')]({'where':{'id':_0x531be2[_0x0d3e('0x48')]['id']}})['then'](handleEntityNotFound(_0x19c7e3,null))['then'](function(_0x234ad0){if(_0x234ad0){_0x551824=_0x234ad0;_0x105c29['model']=_[_0x0d3e('0x30')](db[_0x0d3e('0x51')][_0x0d3e('0x2b')]);_0x105c29[_0x0d3e('0x2f')]=_[_0x0d3e('0x30')](_0x531be2['query']);_0x105c29[_0x0d3e('0x31')]=_[_0x0d3e('0x32')](_0x105c29[_0x0d3e('0x2e')],_0x105c29[_0x0d3e('0x2f')]);_0x66b119['attributes']=_['intersection'](_0x105c29[_0x0d3e('0x2e')],qs[_0x0d3e('0x34')](_0x531be2['query'][_0x0d3e('0x34')]));_0x66b119['attributes']=_0x66b119[_0x0d3e('0x33')][_0x0d3e('0x35')]?_0x66b119[_0x0d3e('0x33')]:_0x105c29['model'];_0x66b119[_0x0d3e('0x38')]=qs[_0x0d3e('0x39')](_0x531be2[_0x0d3e('0x2f')][_0x0d3e('0x39')]);_0x66b119[_0x0d3e('0x3a')]=qs['filters'](_[_0x0d3e('0x4c')](_0x531be2[_0x0d3e('0x2f')],_0x105c29[_0x0d3e('0x31')]));if(_0x531be2[_0x0d3e('0x2f')]['filter']){_0x66b119[_0x0d3e('0x3a')]=_[_0x0d3e('0x3c')](_0x66b119[_0x0d3e('0x3a')],{'$or':_[_0x0d3e('0x29')](_0x66b119[_0x0d3e('0x33')],function(_0x354015){var _0x275a04={};_0x275a04[_0x354015]={'$like':'%'+_0x531be2[_0x0d3e('0x2f')][_0x0d3e('0x3b')]+'%'};return _0x275a04;})});}_0x66b119=_[_0x0d3e('0x3c')]({},_0x66b119,_0x531be2[_0x0d3e('0x3f')]);return _0x551824[_0x0d3e('0x50')](_0x66b119);}})[_0x0d3e('0x23')](function(_0x35165d){if(_0x35165d){_0x2cf26f=_0x35165d[_0x0d3e('0x35')];if(!_0x531be2[_0x0d3e('0x2f')][_0x0d3e('0x36')](_0x0d3e('0x37'))){_0x66b119[_0x0d3e('0x1c')]=qs[_0x0d3e('0x1c')](_0x531be2[_0x0d3e('0x2f')][_0x0d3e('0x1c')]);_0x66b119[_0x0d3e('0x1a')]=qs[_0x0d3e('0x1a')](_0x531be2[_0x0d3e('0x2f')][_0x0d3e('0x1a')]);}return _0x551824[_0x0d3e('0x50')](_0x66b119);}})['then'](function(_0x4f7653){if(_0x4f7653){return _0x4f7653?{'count':_0x2cf26f,'rows':_0x4f7653}:null;}})[_0x0d3e('0x23')](respondWithResult(_0x19c7e3,null))[_0x0d3e('0x43')](handleError(_0x19c7e3,null));};exports['setTags']=function(_0x2b0355,_0xa21a54,_0x158684){if(_0x2b0355['body']['id']){delete _0x2b0355[_0x0d3e('0x46')]['id'];}return db['ZendeskConfiguration'][_0x0d3e('0x4d')]({'where':{'id':_0x2b0355['params']['id']}})[_0x0d3e('0x23')](handleEntityNotFound(_0xa21a54,null))[_0x0d3e('0x23')](function(_0x2c2eef){if(_0x2c2eef){return _0x2c2eef[_0x0d3e('0x52')](_0x2b0355[_0x0d3e('0x46')][_0x0d3e('0x53')]||[]);}return null;})[_0x0d3e('0x23')](respondWithResult(_0xa21a54,null))[_0x0d3e('0x43')](handleError(_0xa21a54,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 409d016..e19d8e5 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 _0x93e9=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x3bf00b,_0x12d037){var _0x42f473=function(_0x19baa8){while(--_0x19baa8){_0x3bf00b['push'](_0x3bf00b['shift']());}};_0x42f473(++_0x12d037);}(_0x93e9,0xcc));var _0x993e=function(_0x580c96,_0x2d89ee){_0x580c96=_0x580c96-0x0;var _0x532ae6=_0x93e9[_0x580c96];return _0x532ae6;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7b4=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment'];(function(_0x27c933,_0x48c749){var _0x4c170b=function(_0x582190){while(--_0x582190){_0x27c933['push'](_0x27c933['shift']());}};_0x4c170b(++_0x48c749);}(_0xf7b4,0x152));var _0x4f7b=function(_0x19f508,_0x18628a){_0x19f508=_0x19f508-0x0;var _0x97526e=_0xf7b4[_0x19f508];return _0x97526e;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index ef0498e..f399bec 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 _0xdd05=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x14816b,_0x454721){var _0x43516a=function(_0x21091e){while(--_0x21091e){_0x14816b['push'](_0x14816b['shift']());}};_0x43516a(++_0x454721);}(_0xdd05,0x192));var _0x5dd0=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xdd05[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x5dd0('0x0'));var util=require(_0x5dd0('0x1'));var moment=require(_0x5dd0('0x2'));var BPromise=require(_0x5dd0('0x3'));var rs=require(_0x5dd0('0x4'));var fs=require('fs');var Redis=require(_0x5dd0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5dd0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5dd0('0x7')][_0x5dd0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45fbf7,_0x46796d,_0x10dc26){return new BPromise(function(_0x46b8ab,_0xde5129){return client['request'](_0x45fbf7,_0x10dc26)[_0x5dd0('0x9')](function(_0x101de4){logger[_0x5dd0('0xa')](_0x5dd0('0xb'),_0x46796d,'request\x20sent');logger[_0x5dd0('0xc')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x46796d,_0x5dd0('0xd'),JSON[_0x5dd0('0xe')](_0x101de4));if(_0x101de4[_0x5dd0('0xf')]){if(_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x10')]===0x1f4){logger[_0x5dd0('0xf')](_0x5dd0('0xb'),_0x46796d,_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x11')]);return _0xde5129(_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x11')]);}logger[_0x5dd0('0xf')](_0x5dd0('0xb'),_0x46796d,_0x101de4[_0x5dd0('0xf')]['message']);return _0x46b8ab(_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x11')]);}else{logger[_0x5dd0('0xa')](_0x5dd0('0xb'),_0x46796d,_0x5dd0('0xd'));_0x46b8ab(_0x101de4[_0x5dd0('0x12')]['message']);}})[_0x5dd0('0x13')](function(_0x37fc22){logger['error'](_0x5dd0('0xb'),_0x46796d,_0x37fc22);_0xde5129(_0x37fc22);});});} \ No newline at end of file +var _0x31df=['info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x31df,0x186));var _0xf31d=function(_0x173d1c,_0x4dd41c){_0x173d1c=_0x173d1c-0x0;var _0x36eaad=_0x31df[_0x173d1c];return _0x36eaad;};'use strict';var _=require(_0xf31d('0x0'));var util=require('util');var moment=require(_0xf31d('0x1'));var BPromise=require(_0xf31d('0x2'));var rs=require(_0xf31d('0x3'));var fs=require('fs');var Redis=require(_0xf31d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf31d('0x5'));var logger=require('../../config/logger')(_0xf31d('0x6'));var config=require(_0xf31d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf31d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18a384,_0x438e6d,_0x1e4cef){return new BPromise(function(_0x4376e7,_0x2f2fdc){return client['request'](_0x18a384,_0x1e4cef)['then'](function(_0x196398){logger[_0xf31d('0x9')]('ZendeskConfiguration,\x20%s,\x20%s',_0x438e6d,'request\x20sent');logger[_0xf31d('0xa')](_0xf31d('0xb'),_0x438e6d,'request\x20sent',JSON[_0xf31d('0xc')](_0x196398));if(_0x196398[_0xf31d('0xd')]){if(_0x196398['error']['code']===0x1f4){logger[_0xf31d('0xd')](_0xf31d('0xe'),_0x438e6d,_0x196398[_0xf31d('0xd')][_0xf31d('0xf')]);return _0x2f2fdc(_0x196398[_0xf31d('0xd')][_0xf31d('0xf')]);}logger[_0xf31d('0xd')](_0xf31d('0xe'),_0x438e6d,_0x196398[_0xf31d('0xd')][_0xf31d('0xf')]);return _0x4376e7(_0x196398[_0xf31d('0xd')]['message']);}else{logger[_0xf31d('0x9')](_0xf31d('0xe'),_0x438e6d,_0xf31d('0x10'));_0x4376e7(_0x196398[_0xf31d('0x11')][_0xf31d('0xf')]);}})[_0xf31d('0x12')](function(_0x54af9f){logger[_0xf31d('0xd')](_0xf31d('0xe'),_0x438e6d,_0x54af9f);_0x2f2fdc(_0x54af9f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5b69506..384950c 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 _0x17cb=['delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','create','put'];(function(_0xe17399,_0x42b7b4){var _0x208a1d=function(_0xb97c08){while(--_0xb97c08){_0xe17399['push'](_0xe17399['shift']());}};_0x208a1d(++_0x42b7b4);}(_0x17cb,0xd2));var _0xb17c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x17cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb17c('0x0'));var path=require(_0xb17c('0x1'));var timeout=require(_0xb17c('0x2'));var express=require(_0xb17c('0x3'));var router=express[_0xb17c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb17c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb17c('0x6'));var controller=require(_0xb17c('0x7'));router[_0xb17c('0x8')]('/',auth[_0xb17c('0x9')](),controller[_0xb17c('0xa')]);router[_0xb17c('0x8')](_0xb17c('0xb'),auth[_0xb17c('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb17c('0xc')]);router[_0xb17c('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb17c('0xe')](_0xb17c('0xb'),auth[_0xb17c('0x9')](),controller['destroy']);module[_0xb17c('0xf')]=router; \ No newline at end of file +var _0xc68f=['create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post'];(function(_0x71dd2d,_0x36e297){var _0x1296fc=function(_0x4afaf0){while(--_0x4afaf0){_0x71dd2d['push'](_0x71dd2d['shift']());}};_0x1296fc(++_0x36e297);}(_0xc68f,0x182));var _0xfc68=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc68f[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xfc68('0x0'));var util=require(_0xfc68('0x1'));var path=require(_0xfc68('0x2'));var timeout=require(_0xfc68('0x3'));var express=require(_0xfc68('0x4'));var router=express['Router']();var fs_extra=require(_0xfc68('0x5'));var auth=require(_0xfc68('0x6'));var interaction=require(_0xfc68('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xfc68('0x8')]('/',auth[_0xfc68('0x9')](),controller[_0xfc68('0xa')]);router[_0xfc68('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfc68('0xb')]);router[_0xfc68('0xc')]('/',auth[_0xfc68('0x9')](),controller[_0xfc68('0xd')]);router[_0xfc68('0xe')](_0xfc68('0xf'),auth[_0xfc68('0x9')](),controller[_0xfc68('0x10')]);router[_0xfc68('0x11')](_0xfc68('0xf'),auth['isAuthenticated'](),controller[_0xfc68('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 599b582..e1ad29f 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 _0x9c74=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x32a94c,_0x29f028){var _0x1841ae=function(_0x3813fa){while(--_0x3813fa){_0x32a94c['push'](_0x32a94c['shift']());}};_0x1841ae(++_0x29f028);}(_0x9c74,0x127));var _0x49c7=function(_0x442dcb,_0x179c35){_0x442dcb=_0x442dcb-0x0;var _0x593554=_0x9c74[_0x442dcb];return _0x593554;};'use strict';var Sequelize=require(_0x49c7('0x0'));module[_0x49c7('0x1')]={'type':{'type':Sequelize[_0x49c7('0x2')](_0x49c7('0x3'),_0x49c7('0x4'),_0x49c7('0x5'),'keyValue',_0x49c7('0x6')),'defaultValue':_0x49c7('0x3')},'content':{'type':Sequelize[_0x49c7('0x7')]},'key':{'type':Sequelize[_0x49c7('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x49c7('0x3'),_0x49c7('0x4'),_0x49c7('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x49c7('0x7')]},'customField':{'type':Sequelize[_0x49c7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49c7('0x7')]}}; \ No newline at end of file +var _0x54ee=['picklist','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x204628,_0x128a53){var _0x38cedd=function(_0x29e181){while(--_0x29e181){_0x204628['push'](_0x204628['shift']());}};_0x38cedd(++_0x128a53);}(_0x54ee,0xff));var _0xe54e=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x54ee[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require(_0xe54e('0x0'));module[_0xe54e('0x1')]={'type':{'type':Sequelize[_0xe54e('0x2')]('string',_0xe54e('0x3'),'customVariable',_0xe54e('0x4'),_0xe54e('0x5')),'defaultValue':_0xe54e('0x6')},'content':{'type':Sequelize[_0xe54e('0x7')]},'key':{'type':Sequelize[_0xe54e('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xe54e('0x6'),_0xe54e('0x3'),_0xe54e('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe54e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe54e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe54e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 4bab8b4..cd60abd 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 _0x4899=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','type','key','model','map'];(function(_0x317744,_0x5ae1c3){var _0x2b8fcc=function(_0xbdd448){while(--_0xbdd448){_0x317744['push'](_0x317744['shift']());}};_0x2b8fcc(++_0x5ae1c3);}(_0x4899,0x142));var _0x9489=function(_0x1387c4,_0x4d9cb5){_0x1387c4=_0x1387c4-0x0;var _0x783cbb=_0x4899[_0x1387c4];return _0x783cbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9489('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9489('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9489('0x2'));var Mustache=require(_0x9489('0x3'));var util=require(_0x9489('0x4'));var path=require(_0x9489('0x5'));var sox=require(_0x9489('0x6'));var csv=require('to-csv');var ejs=require(_0x9489('0x7'));var fs=require('fs');var fs_extra=require(_0x9489('0x8'));var _=require(_0x9489('0x9'));var squel=require(_0x9489('0xa'));var crypto=require(_0x9489('0xb'));var jsforce=require(_0x9489('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9489('0xd'));var Papa=require(_0x9489('0xe'));var Redis=require(_0x9489('0xf'));var authService=require(_0x9489('0x10'));var qs=require(_0x9489('0x11'));var as=require(_0x9489('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9489('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9489('0x14'));var licenseUtil=require(_0x9489('0x15'));var db=require(_0x9489('0x16'))['db'];function respondWithStatusCode(_0x37f02e,_0x2a28a2){_0x2a28a2=_0x2a28a2||0xcc;return function(_0x42a236){if(_0x42a236){return _0x37f02e[_0x9489('0x17')](_0x2a28a2);}return _0x37f02e[_0x9489('0x18')](_0x2a28a2)[_0x9489('0x19')]();};}function respondWithResult(_0x2b4e63,_0x46e3ec){_0x46e3ec=_0x46e3ec||0xc8;return function(_0x35d043){if(_0x35d043){return _0x2b4e63[_0x9489('0x18')](_0x46e3ec)[_0x9489('0x1a')](_0x35d043);}};}function respondWithFilteredResult(_0x2c88be,_0x52e975){return function(_0x38921c){if(_0x38921c){var _0x192f58=typeof _0x52e975['offset']===_0x9489('0x1b')&&typeof _0x52e975[_0x9489('0x1c')]===_0x9489('0x1b');var _0x57b55d=_0x38921c[_0x9489('0x1d')];var _0xef4bf8=_0x192f58?0x0:_0x52e975[_0x9489('0x1e')];var _0x1eb693=_0x192f58?_0x38921c[_0x9489('0x1d')]:_0x52e975[_0x9489('0x1e')]+_0x52e975[_0x9489('0x1c')];var _0x33906b;if(_0x1eb693>=_0x57b55d){_0x1eb693=_0x57b55d;_0x33906b=0xc8;}else{_0x33906b=0xce;}_0x2c88be[_0x9489('0x18')](_0x33906b);return _0x2c88be['set'](_0x9489('0x1f'),_0xef4bf8+'-'+_0x1eb693+'/'+_0x57b55d)[_0x9489('0x1a')](_0x38921c);}return null;};}function patchUpdates(_0x4644a8){return function(_0x36e536){try{jsonpatch[_0x9489('0x20')](_0x36e536,_0x4644a8,!![]);}catch(_0x49c18e){return BPromise[_0x9489('0x21')](_0x49c18e);}return _0x36e536['save']();};}function saveUpdates(_0x280ec8,_0x554bea){return function(_0x569fbc){if(_0x569fbc){return _0x569fbc[_0x9489('0x22')](_0x280ec8)[_0x9489('0x23')](function(_0x1b9e86){return _0x1b9e86;});}return null;};}function removeEntity(_0x14c3ae,_0x45fb3c){return function(_0x5c4363){if(_0x5c4363){return _0x5c4363[_0x9489('0x24')]()['then'](function(){_0x14c3ae[_0x9489('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e5983,_0x1ac1fb){return function(_0x1ac5f8){if(!_0x1ac5f8){_0x4e5983['sendStatus'](0x194);}return _0x1ac5f8;};}function handleError(_0x28237e,_0xecebed){_0xecebed=_0xecebed||0x1f4;return function(_0x32e33e){logger[_0x9489('0x25')](_0x32e33e[_0x9489('0x26')]);if(_0x32e33e[_0x9489('0x27')]){delete _0x32e33e[_0x9489('0x27')];}_0x28237e[_0x9489('0x18')](_0xecebed)[_0x9489('0x28')](_0x32e33e);};}exports[_0x9489('0x29')]=function(_0x191dee,_0x1ecf15){var _0x3c7f5a={},_0x20e01b={},_0x2d6931={'count':0x0,'rows':[]};var _0x106b5f=_['map'](db[_0x9489('0x2a')][_0x9489('0x2b')],function(_0x5c10ea){return{'name':_0x5c10ea['fieldName'],'type':_0x5c10ea[_0x9489('0x2c')][_0x9489('0x2d')]};});_0x20e01b[_0x9489('0x2e')]=_[_0x9489('0x2f')](_0x106b5f,'name');_0x20e01b[_0x9489('0x30')]=_[_0x9489('0x31')](_0x191dee[_0x9489('0x30')]);_0x20e01b['filters']=_[_0x9489('0x32')](_0x20e01b[_0x9489('0x2e')],_0x20e01b[_0x9489('0x30')]);_0x3c7f5a[_0x9489('0x33')]=_['intersection'](_0x20e01b[_0x9489('0x2e')],qs[_0x9489('0x34')](_0x191dee[_0x9489('0x30')][_0x9489('0x34')]));_0x3c7f5a[_0x9489('0x33')]=_0x3c7f5a['attributes'][_0x9489('0x35')]?_0x3c7f5a[_0x9489('0x33')]:_0x20e01b[_0x9489('0x2e')];if(!_0x191dee[_0x9489('0x30')][_0x9489('0x36')](_0x9489('0x37'))){_0x3c7f5a['limit']=qs[_0x9489('0x1c')](_0x191dee['query'][_0x9489('0x1c')]);_0x3c7f5a['offset']=qs[_0x9489('0x1e')](_0x191dee[_0x9489('0x30')][_0x9489('0x1e')]);}_0x3c7f5a[_0x9489('0x38')]=qs['sort'](_0x191dee['query'][_0x9489('0x39')]);_0x3c7f5a['where']=qs['filters'](_[_0x9489('0x3a')](_0x191dee[_0x9489('0x30')],_0x20e01b[_0x9489('0x3b')]),_0x106b5f);if(_0x191dee[_0x9489('0x30')][_0x9489('0x3c')]){_0x3c7f5a['where']=_[_0x9489('0x3d')](_0x3c7f5a[_0x9489('0x3e')],{'$or':_[_0x9489('0x2f')](_0x106b5f,function(_0x5239c3){if(_0x5239c3[_0x9489('0x2c')]!==_0x9489('0x3f')){var _0x4a469c={};_0x4a469c[_0x5239c3[_0x9489('0x27')]]={'$like':'%'+_0x191dee[_0x9489('0x30')]['filter']+'%'};return _0x4a469c;}})});}_0x3c7f5a=_[_0x9489('0x3d')]({},_0x3c7f5a,_0x191dee[_0x9489('0x40')]);var _0xac2d11={'where':_0x3c7f5a[_0x9489('0x3e')]};return db[_0x9489('0x2a')][_0x9489('0x1d')](_0xac2d11)['then'](function(_0x46d3ba){_0x2d6931[_0x9489('0x1d')]=_0x46d3ba;if(_0x191dee[_0x9489('0x30')][_0x9489('0x41')]){_0x3c7f5a[_0x9489('0x42')]=[{'all':!![]}];}return db[_0x9489('0x2a')]['findAll'](_0x3c7f5a);})[_0x9489('0x23')](function(_0x2384e1){_0x2d6931[_0x9489('0x43')]=_0x2384e1;return _0x2d6931;})[_0x9489('0x23')](respondWithFilteredResult(_0x1ecf15,_0x3c7f5a))[_0x9489('0x44')](handleError(_0x1ecf15,null));};exports[_0x9489('0x45')]=function(_0x4bb36d,_0xa519f4){var _0xf2b578={'raw':!![],'where':{'id':_0x4bb36d[_0x9489('0x46')]['id']}},_0x37ed01={};_0x37ed01['model']=_[_0x9489('0x31')](db['ZendeskField'][_0x9489('0x2b')]);_0x37ed01[_0x9489('0x30')]=_['keys'](_0x4bb36d[_0x9489('0x30')]);_0x37ed01['filters']=_['intersection'](_0x37ed01[_0x9489('0x2e')],_0x37ed01[_0x9489('0x30')]);_0xf2b578[_0x9489('0x33')]=_[_0x9489('0x32')](_0x37ed01['model'],qs[_0x9489('0x34')](_0x4bb36d['query'][_0x9489('0x34')]));_0xf2b578[_0x9489('0x33')]=_0xf2b578[_0x9489('0x33')]['length']?_0xf2b578[_0x9489('0x33')]:_0x37ed01[_0x9489('0x2e')];if(_0x4bb36d[_0x9489('0x30')][_0x9489('0x41')]){_0xf2b578[_0x9489('0x42')]=[{'all':!![]}];}_0xf2b578=_[_0x9489('0x3d')]({},_0xf2b578,_0x4bb36d[_0x9489('0x40')]);return db[_0x9489('0x2a')][_0x9489('0x47')](_0xf2b578)[_0x9489('0x23')](handleEntityNotFound(_0xa519f4,null))[_0x9489('0x23')](respondWithResult(_0xa519f4,null))['catch'](handleError(_0xa519f4,null));};exports[_0x9489('0x48')]=function(_0x1637c4,_0x46f588){return db[_0x9489('0x2a')]['create'](_0x1637c4[_0x9489('0x49')],{})[_0x9489('0x23')](respondWithResult(_0x46f588,0xc9))[_0x9489('0x44')](handleError(_0x46f588,null));};exports['update']=function(_0x303e37,_0x19349a){if(_0x303e37[_0x9489('0x49')]['id']){delete _0x303e37[_0x9489('0x49')]['id'];}return db[_0x9489('0x2a')][_0x9489('0x47')]({'where':{'id':_0x303e37[_0x9489('0x46')]['id']}})[_0x9489('0x23')](handleEntityNotFound(_0x19349a,null))[_0x9489('0x23')](saveUpdates(_0x303e37[_0x9489('0x49')],null))['then'](respondWithResult(_0x19349a,null))[_0x9489('0x44')](handleError(_0x19349a,null));};exports[_0x9489('0x24')]=function(_0xa139c,_0x2670f1){return db[_0x9489('0x2a')][_0x9489('0x47')]({'where':{'id':_0xa139c[_0x9489('0x46')]['id']}})[_0x9489('0x23')](handleEntityNotFound(_0x2670f1,null))['then'](removeEntity(_0x2670f1,null))[_0x9489('0x44')](handleError(_0x2670f1,null));}; \ No newline at end of file +var _0x5981=['params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','ZendeskField','rawAttributes','fieldName','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0x5981,0xa7));var _0x1598=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5981[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1598('0x0'));var rimraf=require(_0x1598('0x1'));var zipdir=require(_0x1598('0x2'));var jsonpatch=require(_0x1598('0x3'));var rp=require(_0x1598('0x4'));var moment=require(_0x1598('0x5'));var BPromise=require(_0x1598('0x6'));var Mustache=require(_0x1598('0x7'));var util=require(_0x1598('0x8'));var path=require(_0x1598('0x9'));var sox=require('sox');var csv=require(_0x1598('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1598('0xb'));var _=require(_0x1598('0xc'));var squel=require(_0x1598('0xd'));var crypto=require(_0x1598('0xe'));var jsforce=require(_0x1598('0xf'));var deskjs=require(_0x1598('0x10'));var toCsv=require(_0x1598('0xa'));var querystring=require(_0x1598('0x11'));var Papa=require(_0x1598('0x12'));var Redis=require(_0x1598('0x13'));var authService=require(_0x1598('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1598('0x15'));var hardwareService=require(_0x1598('0x16'));var logger=require(_0x1598('0x17'))(_0x1598('0x18'));var utils=require(_0x1598('0x19'));var config=require(_0x1598('0x1a'));var licenseUtil=require(_0x1598('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cab3e,_0x54bf09){_0x54bf09=_0x54bf09||0xcc;return function(_0xa31ee3){if(_0xa31ee3){return _0x1cab3e[_0x1598('0x1c')](_0x54bf09);}return _0x1cab3e[_0x1598('0x1d')](_0x54bf09)[_0x1598('0x1e')]();};}function respondWithResult(_0xb18a75,_0x142c30){_0x142c30=_0x142c30||0xc8;return function(_0xf22672){if(_0xf22672){return _0xb18a75[_0x1598('0x1d')](_0x142c30)[_0x1598('0x1f')](_0xf22672);}};}function respondWithFilteredResult(_0x56c25a,_0x2b9898){return function(_0xc19b97){if(_0xc19b97){var _0xff7ff9=typeof _0x2b9898[_0x1598('0x20')]===_0x1598('0x21')&&typeof _0x2b9898[_0x1598('0x22')]===_0x1598('0x21');var _0x25799e=_0xc19b97[_0x1598('0x23')];var _0x47afe8=_0xff7ff9?0x0:_0x2b9898['offset'];var _0x201168=_0xff7ff9?_0xc19b97[_0x1598('0x23')]:_0x2b9898[_0x1598('0x20')]+_0x2b9898[_0x1598('0x22')];var _0xf04503;if(_0x201168>=_0x25799e){_0x201168=_0x25799e;_0xf04503=0xc8;}else{_0xf04503=0xce;}_0x56c25a[_0x1598('0x1d')](_0xf04503);return _0x56c25a['set'](_0x1598('0x24'),_0x47afe8+'-'+_0x201168+'/'+_0x25799e)[_0x1598('0x1f')](_0xc19b97);}return null;};}function patchUpdates(_0x3f2e50){return function(_0x2f0c85){try{jsonpatch[_0x1598('0x25')](_0x2f0c85,_0x3f2e50,!![]);}catch(_0x8b7aae){return BPromise[_0x1598('0x26')](_0x8b7aae);}return _0x2f0c85[_0x1598('0x27')]();};}function saveUpdates(_0x441375,_0x36ca74){return function(_0x58aac1){if(_0x58aac1){return _0x58aac1[_0x1598('0x28')](_0x441375)['then'](function(_0xdcf273){return _0xdcf273;});}return null;};}function removeEntity(_0x474fc8,_0x45a699){return function(_0x2b9d81){if(_0x2b9d81){return _0x2b9d81['destroy']()[_0x1598('0x29')](function(){_0x474fc8[_0x1598('0x1d')](0xcc)[_0x1598('0x1e')]();});}};}function handleEntityNotFound(_0xe8cfb5,_0x3f0d08){return function(_0x125d16){if(!_0x125d16){_0xe8cfb5[_0x1598('0x1c')](0x194);}return _0x125d16;};}function handleError(_0x49b092,_0x16936d){_0x16936d=_0x16936d||0x1f4;return function(_0x1ffb51){logger[_0x1598('0x2a')](_0x1ffb51[_0x1598('0x2b')]);if(_0x1ffb51['name']){delete _0x1ffb51[_0x1598('0x2c')];}_0x49b092[_0x1598('0x1d')](_0x16936d)['send'](_0x1ffb51);};}exports[_0x1598('0x2d')]=function(_0x520de3,_0x37e30b){var _0x5b2aef={},_0x512b43={},_0x2ad8ed={'count':0x0,'rows':[]};var _0x924754=_['map'](db[_0x1598('0x2e')][_0x1598('0x2f')],function(_0x5874dd){return{'name':_0x5874dd[_0x1598('0x30')],'type':_0x5874dd['type'][_0x1598('0x31')]};});_0x512b43[_0x1598('0x32')]=_[_0x1598('0x33')](_0x924754,_0x1598('0x2c'));_0x512b43['query']=_[_0x1598('0x34')](_0x520de3['query']);_0x512b43['filters']=_[_0x1598('0x35')](_0x512b43[_0x1598('0x32')],_0x512b43[_0x1598('0x36')]);_0x5b2aef[_0x1598('0x37')]=_['intersection'](_0x512b43[_0x1598('0x32')],qs[_0x1598('0x38')](_0x520de3[_0x1598('0x36')]['fields']));_0x5b2aef['attributes']=_0x5b2aef['attributes'][_0x1598('0x39')]?_0x5b2aef[_0x1598('0x37')]:_0x512b43[_0x1598('0x32')];if(!_0x520de3[_0x1598('0x36')][_0x1598('0x3a')](_0x1598('0x3b'))){_0x5b2aef[_0x1598('0x22')]=qs['limit'](_0x520de3[_0x1598('0x36')][_0x1598('0x22')]);_0x5b2aef['offset']=qs[_0x1598('0x20')](_0x520de3['query']['offset']);}_0x5b2aef[_0x1598('0x3c')]=qs['sort'](_0x520de3[_0x1598('0x36')][_0x1598('0x3d')]);_0x5b2aef[_0x1598('0x3e')]=qs[_0x1598('0x3f')](_[_0x1598('0x40')](_0x520de3[_0x1598('0x36')],_0x512b43[_0x1598('0x3f')]),_0x924754);if(_0x520de3['query'][_0x1598('0x41')]){_0x5b2aef[_0x1598('0x3e')]=_[_0x1598('0x42')](_0x5b2aef['where'],{'$or':_[_0x1598('0x33')](_0x924754,function(_0x209d1a){if(_0x209d1a[_0x1598('0x43')]!==_0x1598('0x44')){var _0x9c3bd8={};_0x9c3bd8[_0x209d1a['name']]={'$like':'%'+_0x520de3['query'][_0x1598('0x41')]+'%'};return _0x9c3bd8;}})});}_0x5b2aef=_[_0x1598('0x42')]({},_0x5b2aef,_0x520de3[_0x1598('0x45')]);var _0x203a24={'where':_0x5b2aef['where']};return db[_0x1598('0x2e')]['count'](_0x203a24)[_0x1598('0x29')](function(_0x23b191){_0x2ad8ed['count']=_0x23b191;if(_0x520de3[_0x1598('0x36')][_0x1598('0x46')]){_0x5b2aef[_0x1598('0x47')]=[{'all':!![]}];}return db[_0x1598('0x2e')][_0x1598('0x48')](_0x5b2aef);})['then'](function(_0x208d11){_0x2ad8ed[_0x1598('0x49')]=_0x208d11;return _0x2ad8ed;})['then'](respondWithFilteredResult(_0x37e30b,_0x5b2aef))[_0x1598('0x4a')](handleError(_0x37e30b,null));};exports[_0x1598('0x4b')]=function(_0x155025,_0x30a57b){var _0x30f5ea={'raw':!![],'where':{'id':_0x155025[_0x1598('0x4c')]['id']}},_0x4bbecc={};_0x4bbecc['model']=_['keys'](db['ZendeskField'][_0x1598('0x2f')]);_0x4bbecc[_0x1598('0x36')]=_[_0x1598('0x34')](_0x155025[_0x1598('0x36')]);_0x4bbecc[_0x1598('0x3f')]=_['intersection'](_0x4bbecc['model'],_0x4bbecc[_0x1598('0x36')]);_0x30f5ea['attributes']=_[_0x1598('0x35')](_0x4bbecc[_0x1598('0x32')],qs[_0x1598('0x38')](_0x155025['query'][_0x1598('0x38')]));_0x30f5ea[_0x1598('0x37')]=_0x30f5ea['attributes']['length']?_0x30f5ea['attributes']:_0x4bbecc['model'];if(_0x155025[_0x1598('0x36')][_0x1598('0x46')]){_0x30f5ea[_0x1598('0x47')]=[{'all':!![]}];}_0x30f5ea=_[_0x1598('0x42')]({},_0x30f5ea,_0x155025['options']);return db[_0x1598('0x2e')][_0x1598('0x4d')](_0x30f5ea)[_0x1598('0x29')](handleEntityNotFound(_0x30a57b,null))[_0x1598('0x29')](respondWithResult(_0x30a57b,null))[_0x1598('0x4a')](handleError(_0x30a57b,null));};exports[_0x1598('0x4e')]=function(_0x25957c,_0x2442d2){return db[_0x1598('0x2e')]['create'](_0x25957c['body'],{})[_0x1598('0x29')](respondWithResult(_0x2442d2,0xc9))[_0x1598('0x4a')](handleError(_0x2442d2,null));};exports[_0x1598('0x28')]=function(_0x9988c,_0x4e408e){if(_0x9988c[_0x1598('0x4f')]['id']){delete _0x9988c[_0x1598('0x4f')]['id'];}return db['ZendeskField'][_0x1598('0x4d')]({'where':{'id':_0x9988c[_0x1598('0x4c')]['id']}})[_0x1598('0x29')](handleEntityNotFound(_0x4e408e,null))['then'](saveUpdates(_0x9988c['body'],null))[_0x1598('0x29')](respondWithResult(_0x4e408e,null))[_0x1598('0x4a')](handleError(_0x4e408e,null));};exports[_0x1598('0x50')]=function(_0x2fefe0,_0x12e5be){return db[_0x1598('0x2e')][_0x1598('0x4d')]({'where':{'id':_0x2fefe0[_0x1598('0x4c')]['id']}})[_0x1598('0x29')](handleEntityNotFound(_0x12e5be,null))[_0x1598('0x29')](removeEntity(_0x12e5be,null))[_0x1598('0x4a')](handleError(_0x12e5be,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 4165fea..5058228 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 _0x4647=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x5025ba,_0x2ee68a){var _0x3e837a=function(_0xc21e86){while(--_0xc21e86){_0x5025ba['push'](_0x5025ba['shift']());}};_0x3e837a(++_0x2ee68a);}(_0x4647,0xd4));var _0x7464=function(_0x3e2ece,_0x130114){_0x3e2ece=_0x3e2ece-0x0;var _0x15d8c8=_0x4647[_0x3e2ece];return _0x15d8c8;};'use strict';var _=require(_0x7464('0x0'));var util=require('util');var logger=require(_0x7464('0x1'))(_0x7464('0x2'));var moment=require(_0x7464('0x3'));var BPromise=require(_0x7464('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7464('0x5'));var rimraf=require(_0x7464('0x6'));var config=require(_0x7464('0x7'));var attributes=require(_0x7464('0x8'));module[_0x7464('0x9')]=function(_0x4088bb,_0x4683c7){return _0x4088bb[_0x7464('0xa')](_0x7464('0xb'),attributes,{'tableName':_0x7464('0xc'),'paranoid':![],'indexes':[{'name':_0x7464('0xd'),'fields':[_0x7464('0xe'),_0x7464('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3869=['../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x156448,_0x1c7033){var _0xa058fb=function(_0x40edf7){while(--_0x40edf7){_0x156448['push'](_0x156448['shift']());}};_0xa058fb(++_0x1c7033);}(_0x3869,0x151));var _0x9386=function(_0x3a42de,_0x5b7be5){_0x3a42de=_0x3a42de-0x0;var _0x313973=_0x3869[_0x3a42de];return _0x313973;};'use strict';var _=require(_0x9386('0x0'));var util=require(_0x9386('0x1'));var logger=require('../../config/logger')(_0x9386('0x2'));var moment=require(_0x9386('0x3'));var BPromise=require(_0x9386('0x4'));var rp=require(_0x9386('0x5'));var fs=require('fs');var path=require(_0x9386('0x6'));var rimraf=require(_0x9386('0x7'));var config=require(_0x9386('0x8'));var attributes=require(_0x9386('0x9'));module[_0x9386('0xa')]=function(_0x24de4f,_0x3771b5){return _0x24de4f['define'](_0x9386('0xb'),attributes,{'tableName':_0x9386('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x9386('0xd'),_0x9386('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index fc22f54..c0c81fd 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 _0x4afe=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','catch','lodash','util'];(function(_0x4e516d,_0x482c2f){var _0x4adae3=function(_0x28afb9){while(--_0x28afb9){_0x4e516d['push'](_0x4e516d['shift']());}};_0x4adae3(++_0x482c2f);}(_0x4afe,0x67));var _0xe4af=function(_0x35f6d8,_0x28581){_0x35f6d8=_0x35f6d8-0x0;var _0x3f3a77=_0x4afe[_0x35f6d8];return _0x3f3a77;};'use strict';var _=require(_0xe4af('0x0'));var util=require(_0xe4af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe4af('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4af('0x3'))['db'];var utils=require(_0xe4af('0x4'));var logger=require('../../config/logger')(_0xe4af('0x5'));var config=require(_0xe4af('0x6'));var jayson=require(_0xe4af('0x7'));var client=jayson[_0xe4af('0x8')][_0xe4af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0ccc,_0x551439,_0x354a5d){return new BPromise(function(_0x1f50a1,_0x4ca0c5){return client[_0xe4af('0xa')](_0x5e0ccc,_0x354a5d)[_0xe4af('0xb')](function(_0x1b4fca){logger[_0xe4af('0xc')]('ZendeskField,\x20%s,\x20%s',_0x551439,'request\x20sent');logger['debug'](_0xe4af('0xd'),_0x551439,_0xe4af('0xe'),JSON[_0xe4af('0xf')](_0x1b4fca));if(_0x1b4fca[_0xe4af('0x10')]){if(_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x11')]===0x1f4){logger[_0xe4af('0x10')]('ZendeskField,\x20%s,\x20%s',_0x551439,_0x1b4fca['error'][_0xe4af('0x12')]);return _0x4ca0c5(_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x12')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x551439,_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x12')]);return _0x1f50a1(_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x12')]);}else{logger[_0xe4af('0xc')](_0xe4af('0x13'),_0x551439,_0xe4af('0xe'));_0x1f50a1(_0x1b4fca['result'][_0xe4af('0x12')]);}})[_0xe4af('0x14')](function(_0x8d8c1c){logger[_0xe4af('0x10')](_0xe4af('0x13'),_0x551439,_0x8d8c1c);_0x4ca0c5(_0x8d8c1c);});});} \ No newline at end of file +var _0x414d=['ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x570851,_0x32f4bf){var _0x472aaa=function(_0x1233c9){while(--_0x1233c9){_0x570851['push'](_0x570851['shift']());}};_0x472aaa(++_0x32f4bf);}(_0x414d,0x19b));var _0xd414=function(_0x27e6f2,_0x413871){_0x27e6f2=_0x27e6f2-0x0;var _0x2ac6ed=_0x414d[_0x27e6f2];return _0x2ac6ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd414('0x0'));var rs=require(_0xd414('0x1'));var fs=require('fs');var Redis=require(_0xd414('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd414('0x3'));var config=require(_0xd414('0x4'));var jayson=require(_0xd414('0x5'));var client=jayson[_0xd414('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d4442,_0x299be2,_0x338210){return new BPromise(function(_0x5d503e,_0x138f52){return client[_0xd414('0x7')](_0x2d4442,_0x338210)[_0xd414('0x8')](function(_0x3e2d82){logger['info'](_0xd414('0x9'),_0x299be2,'request\x20sent');logger[_0xd414('0xa')](_0xd414('0xb'),_0x299be2,_0xd414('0xc'),JSON[_0xd414('0xd')](_0x3e2d82));if(_0x3e2d82['error']){if(_0x3e2d82[_0xd414('0xe')][_0xd414('0xf')]===0x1f4){logger['error'](_0xd414('0x9'),_0x299be2,_0x3e2d82['error'][_0xd414('0x10')]);return _0x138f52(_0x3e2d82['error'][_0xd414('0x10')]);}logger[_0xd414('0xe')](_0xd414('0x9'),_0x299be2,_0x3e2d82[_0xd414('0xe')][_0xd414('0x10')]);return _0x5d503e(_0x3e2d82[_0xd414('0xe')]['message']);}else{logger[_0xd414('0x11')]('ZendeskField,\x20%s,\x20%s',_0x299be2,'request\x20sent');_0x5d503e(_0x3e2d82[_0xd414('0x12')]['message']);}})[_0xd414('0x13')](function(_0x761ded){logger[_0xd414('0xe')](_0xd414('0x9'),_0x299be2,_0x761ded);_0x138f52(_0x761ded);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index b727896..04a16a5 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 _0xfa8b=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','create','/:id/configurations','addConfiguration','put'];(function(_0x1e06ca,_0xd291f){var _0x34f498=function(_0x46a5c9){while(--_0x46a5c9){_0x1e06ca['push'](_0x1e06ca['shift']());}};_0x34f498(++_0xd291f);}(_0xfa8b,0xd3));var _0xbfa8=function(_0x4bae9c,_0x48594f){_0x4bae9c=_0x4bae9c-0x0;var _0x5c2f2e=_0xfa8b[_0x4bae9c];return _0x5c2f2e;};'use strict';var multer=require(_0xbfa8('0x0'));var util=require(_0xbfa8('0x1'));var path=require(_0xbfa8('0x2'));var timeout=require(_0xbfa8('0x3'));var express=require(_0xbfa8('0x4'));var router=express[_0xbfa8('0x5')]();var fs_extra=require(_0xbfa8('0x6'));var auth=require(_0xbfa8('0x7'));var interaction=require(_0xbfa8('0x8'));var config=require('../../config/environment');var controller=require(_0xbfa8('0x9'));router[_0xbfa8('0xa')]('/',auth[_0xbfa8('0xb')](),controller['index']);router[_0xbfa8('0xa')](_0xbfa8('0xc'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0xd')]);router[_0xbfa8('0xa')]('/:id/configurations',auth[_0xbfa8('0xb')](),controller[_0xbfa8('0xe')]);router[_0xbfa8('0xa')]('/:id/fields',auth[_0xbfa8('0xb')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xbfa8('0xf')]);router['post'](_0xbfa8('0x10'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0x11')]);router[_0xbfa8('0x12')](_0xbfa8('0xc'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0x13')]);router[_0xbfa8('0x14')](_0xbfa8('0xc'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0x15')]);module[_0xbfa8('0x16')]=router; \ No newline at end of file +var _0x64ce=['destroy','exports','util','express','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration','delete'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x64ce,0x1a2));var _0xe64c=function(_0x36f24e,_0x2757c7){_0x36f24e=_0x36f24e-0x0;var _0xbc94c8=_0x64ce[_0x36f24e];return _0xbc94c8;};'use strict';var multer=require('multer');var util=require(_0xe64c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe64c('0x1'));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(_0xe64c('0x2'));var controller=require(_0xe64c('0x3'));router[_0xe64c('0x4')]('/',auth[_0xe64c('0x5')](),controller[_0xe64c('0x6')]);router['get'](_0xe64c('0x7'),auth[_0xe64c('0x5')](),controller['show']);router[_0xe64c('0x4')](_0xe64c('0x8'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe64c('0x4')](_0xe64c('0x9'),auth[_0xe64c('0x5')](),controller[_0xe64c('0xa')]);router[_0xe64c('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xe64c('0x8'),auth[_0xe64c('0x5')](),controller[_0xe64c('0xc')]);router['put'](_0xe64c('0x7'),auth[_0xe64c('0x5')](),controller['update']);router[_0xe64c('0xd')](_0xe64c('0x7'),auth[_0xe64c('0x5')](),controller[_0xe64c('0xe')]);module[_0xe64c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index f106027..ed49a6c 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 _0x34e8=['sequelize','exports','STRING'];(function(_0x9dca4c,_0xc09e49){var _0x4c8506=function(_0x8305bf){while(--_0x8305bf){_0x9dca4c['push'](_0x9dca4c['shift']());}};_0x4c8506(++_0xc09e49);}(_0x34e8,0x12c));var _0x834e=function(_0x3aff3f,_0x27af06){_0x3aff3f=_0x3aff3f-0x0;var _0x171738=_0x34e8[_0x3aff3f];return _0x171738;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file +var _0xd64b=['STRING','sequelize'];(function(_0x5df150,_0xf20c4f){var _0x16d353=function(_0x2b6ca8){while(--_0x2b6ca8){_0x5df150['push'](_0x5df150['shift']());}};_0x16d353(++_0xf20c4f);}(_0xd64b,0xc1));var _0xbd64=function(_0x1250c9,_0x4034c2){_0x1250c9=_0x1250c9-0x0;var _0x6fbaa=_0xd64b[_0x1250c9];return _0x6fbaa;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('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 25361b1..43478ad 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 _0x2a75=['includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','findOne','ZohoConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','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','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','refreshToken','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a75,0x91));var _0x52a7=function(_0x28dfea,_0x35cdf7){_0x28dfea=_0x28dfea-0x0;var _0x444c20=_0x2a75[_0x28dfea];return _0x444c20;};'use strict';var emlformat=require(_0x52a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x52a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52a7('0x2'));var moment=require(_0x52a7('0x3'));var BPromise=require(_0x52a7('0x4'));var Mustache=require(_0x52a7('0x5'));var util=require(_0x52a7('0x6'));var path=require(_0x52a7('0x7'));var sox=require(_0x52a7('0x8'));var csv=require(_0x52a7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x52a7('0xa'));var squel=require('squel');var crypto=require(_0x52a7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x52a7('0xc'));var toCsv=require(_0x52a7('0x9'));var querystring=require('querystring');var Papa=require(_0x52a7('0xd'));var Redis=require(_0x52a7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x52a7('0xf'));var as=require(_0x52a7('0x10'));var hardwareService=require(_0x52a7('0x11'));var logger=require('../../config/logger')(_0x52a7('0x12'));var utils=require('../../config/utils');var config=require(_0x52a7('0x13'));var licenseUtil=require(_0x52a7('0x14'));var db=require(_0x52a7('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xe8028b,_0x4dd943){_0x4dd943=_0x4dd943||0xcc;return function(_0x331509){if(_0x331509){return _0xe8028b['sendStatus'](_0x4dd943);}return _0xe8028b['status'](_0x4dd943)['end']();};}function respondWithResult(_0x4b77d6,_0x4847b2){_0x4847b2=_0x4847b2||0xc8;return function(_0x1b3172){if(_0x1b3172){return _0x4b77d6['status'](_0x4847b2)['json'](_0x1b3172);}};}function respondWithFilteredResult(_0x4063ac,_0x2e4e44){return function(_0x6c3623){if(_0x6c3623){var _0x9ddb3e=typeof _0x2e4e44['offset']===_0x52a7('0x16')&&typeof _0x2e4e44[_0x52a7('0x17')]==='undefined';var _0x11adad=_0x6c3623[_0x52a7('0x18')];var _0x5b9be2=_0x9ddb3e?0x0:_0x2e4e44[_0x52a7('0x19')];var _0x55f770=_0x9ddb3e?_0x6c3623[_0x52a7('0x18')]:_0x2e4e44['offset']+_0x2e4e44[_0x52a7('0x17')];var _0x3a8077;if(_0x55f770>=_0x11adad){_0x55f770=_0x11adad;_0x3a8077=0xc8;}else{_0x3a8077=0xce;}_0x4063ac[_0x52a7('0x1a')](_0x3a8077);return _0x4063ac[_0x52a7('0x1b')](_0x52a7('0x1c'),_0x5b9be2+'-'+_0x55f770+'/'+_0x11adad)[_0x52a7('0x1d')](_0x6c3623);}return null;};}function patchUpdates(_0x4fb958){return function(_0x2a3a14){try{jsonpatch[_0x52a7('0x1e')](_0x2a3a14,_0x4fb958,!![]);}catch(_0x218d4d){return BPromise[_0x52a7('0x1f')](_0x218d4d);}return _0x2a3a14['save']();};}function saveUpdates(_0x349142,_0x1f835b){return function(_0x59b3e8){if(_0x59b3e8){return _0x59b3e8[_0x52a7('0x20')](_0x349142)[_0x52a7('0x21')](function(_0x2e8bd0){return _0x2e8bd0;});}return null;};}function removeEntity(_0x202f8b,_0x413aa5){return function(_0x5786ef){if(_0x5786ef){return _0x5786ef['destroy']()[_0x52a7('0x21')](function(){_0x202f8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x111ce3,_0x16a4ad){return function(_0x3269b5){if(!_0x3269b5){_0x111ce3[_0x52a7('0x22')](0x194);}return _0x3269b5;};}function handleError(_0x15f14a,_0x407d8a){_0x407d8a=_0x407d8a||0x1f4;return function(_0x54cc06){logger[_0x52a7('0x23')](_0x54cc06[_0x52a7('0x24')]);if(_0x54cc06[_0x52a7('0x25')]){delete _0x54cc06[_0x52a7('0x25')];}_0x15f14a[_0x52a7('0x1a')](_0x407d8a)[_0x52a7('0x26')](_0x54cc06);};}exports[_0x52a7('0x27')]=function(_0x21d8c4,_0x3efb39){var _0x22a7af={},_0x111545={},_0x228389={'count':0x0,'rows':[]};var _0x516e8a=_['map'](db['ZohoAccount'][_0x52a7('0x28')],function(_0x3c431c){return{'name':_0x3c431c[_0x52a7('0x29')],'type':_0x3c431c[_0x52a7('0x2a')][_0x52a7('0x2b')]};});_0x111545['model']=_[_0x52a7('0x2c')](_0x516e8a,'name');_0x111545[_0x52a7('0x2d')]=_[_0x52a7('0x2e')](_0x21d8c4[_0x52a7('0x2d')]);_0x111545[_0x52a7('0x2f')]=_[_0x52a7('0x30')](_0x111545[_0x52a7('0x31')],_0x111545[_0x52a7('0x2d')]);_0x22a7af[_0x52a7('0x32')]=_[_0x52a7('0x30')](_0x111545[_0x52a7('0x31')],qs[_0x52a7('0x33')](_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x33')]));_0x22a7af[_0x52a7('0x32')]=_0x22a7af['attributes']['length']?_0x22a7af['attributes']:_0x111545[_0x52a7('0x31')];if(!_0x21d8c4['query'][_0x52a7('0x34')]('nolimit')){_0x22a7af[_0x52a7('0x17')]=qs[_0x52a7('0x17')](_0x21d8c4[_0x52a7('0x2d')]['limit']);_0x22a7af['offset']=qs[_0x52a7('0x19')](_0x21d8c4[_0x52a7('0x2d')]['offset']);}_0x22a7af[_0x52a7('0x35')]=qs['sort'](_0x21d8c4['query'][_0x52a7('0x36')]);_0x22a7af[_0x52a7('0x37')]=qs[_0x52a7('0x2f')](_['pick'](_0x21d8c4[_0x52a7('0x2d')],_0x111545[_0x52a7('0x2f')]),_0x516e8a);if(_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x38')]){_0x22a7af[_0x52a7('0x37')]=_[_0x52a7('0x39')](_0x22a7af['where'],{'$or':_[_0x52a7('0x2c')](_0x516e8a,function(_0x496fcd){if(_0x496fcd[_0x52a7('0x2a')]!==_0x52a7('0x3a')){var _0x4f8de7={};_0x4f8de7[_0x496fcd[_0x52a7('0x25')]]={'$like':'%'+_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x38')]+'%'};return _0x4f8de7;}})});}_0x22a7af=_[_0x52a7('0x39')]({},_0x22a7af,_0x21d8c4['options']);var _0x5db879={'where':_0x22a7af[_0x52a7('0x37')]};return db[_0x52a7('0x3b')][_0x52a7('0x18')](_0x5db879)[_0x52a7('0x21')](function(_0x4fa3b6){_0x228389[_0x52a7('0x18')]=_0x4fa3b6;if(_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x3c')]){_0x22a7af[_0x52a7('0x3d')]=[{'all':!![]}];}return db[_0x52a7('0x3b')][_0x52a7('0x3e')](_0x22a7af);})[_0x52a7('0x21')](function(_0x3e8b0c){_0x228389[_0x52a7('0x3f')]=_0x3e8b0c;return _0x228389;})[_0x52a7('0x21')](respondWithFilteredResult(_0x3efb39,_0x22a7af))[_0x52a7('0x40')](handleError(_0x3efb39,null));};exports[_0x52a7('0x41')]=function(_0x3a260a,_0x1f8e8b){var _0x59f1f9={'raw':![],'where':{'id':_0x3a260a[_0x52a7('0x42')]['id']}},_0x3c4774={};_0x3c4774[_0x52a7('0x31')]=_[_0x52a7('0x2e')](db[_0x52a7('0x3b')][_0x52a7('0x28')]);_0x3c4774[_0x52a7('0x2d')]=_['keys'](_0x3a260a[_0x52a7('0x2d')]);_0x3c4774[_0x52a7('0x2f')]=_[_0x52a7('0x30')](_0x3c4774[_0x52a7('0x31')],_0x3c4774[_0x52a7('0x2d')]);_0x59f1f9[_0x52a7('0x32')]=_['intersection'](_0x3c4774[_0x52a7('0x31')],qs['fields'](_0x3a260a['query']['fields']));_0x59f1f9['attributes']=_0x59f1f9[_0x52a7('0x32')][_0x52a7('0x43')]?_0x59f1f9[_0x52a7('0x32')]:_0x3c4774[_0x52a7('0x31')];if(_0x3a260a[_0x52a7('0x2d')]['includeAll']){_0x59f1f9[_0x52a7('0x3d')]=[{'all':!![]}];}_0x59f1f9=_['merge']({},_0x59f1f9,_0x3a260a[_0x52a7('0x44')]);return db[_0x52a7('0x3b')][_0x52a7('0x45')](_0x59f1f9)[_0x52a7('0x21')](handleEntityNotFound(_0x1f8e8b,null))[_0x52a7('0x21')](respondWithResult(_0x1f8e8b,null))[_0x52a7('0x40')](handleError(_0x1f8e8b,null));};exports['create']=function(_0x3a3a8d,_0x349640){return db[_0x52a7('0x3b')][_0x52a7('0x46')](_0x3a3a8d[_0x52a7('0x47')],{})[_0x52a7('0x21')](respondWithResult(_0x349640,0xc9))['catch'](handleError(_0x349640,null));};exports['update']=function(_0x313bdc,_0x4c0262){if(_0x313bdc[_0x52a7('0x47')]['id']){delete _0x313bdc[_0x52a7('0x47')]['id'];}return db[_0x52a7('0x3b')][_0x52a7('0x45')]({'where':{'id':_0x313bdc[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x4c0262,null))[_0x52a7('0x21')](saveUpdates(_0x313bdc[_0x52a7('0x47')],null))['then'](respondWithResult(_0x4c0262,null))[_0x52a7('0x40')](handleError(_0x4c0262,null));};exports['destroy']=function(_0x22fd34,_0x4067bd){return db[_0x52a7('0x3b')]['find']({'where':{'id':_0x22fd34[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x4067bd,null))[_0x52a7('0x21')](removeEntity(_0x4067bd,null))[_0x52a7('0x40')](handleError(_0x4067bd,null));};exports['getConfigurations']=function(_0x1cdd4a,_0x41086f,_0x3472b0){var _0x27d151={};var _0x30c71b={};var _0x4322c7;var _0x2bd516;return db['ZohoAccount'][_0x52a7('0x48')]({'where':{'id':_0x1cdd4a[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x41086f,null))[_0x52a7('0x21')](function(_0x28a262){if(_0x28a262){_0x4322c7=_0x28a262;_0x30c71b[_0x52a7('0x31')]=_[_0x52a7('0x2e')](db[_0x52a7('0x49')]['rawAttributes']);_0x30c71b[_0x52a7('0x2d')]=_[_0x52a7('0x2e')](_0x1cdd4a[_0x52a7('0x2d')]);_0x30c71b['filters']=_[_0x52a7('0x30')](_0x30c71b[_0x52a7('0x31')],_0x30c71b[_0x52a7('0x2d')]);_0x27d151['attributes']=_['intersection'](_0x30c71b[_0x52a7('0x31')],qs[_0x52a7('0x33')](_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x33')]));_0x27d151['attributes']=_0x27d151['attributes'][_0x52a7('0x43')]?_0x27d151[_0x52a7('0x32')]:_0x30c71b[_0x52a7('0x31')];_0x27d151['order']=qs[_0x52a7('0x36')](_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x36')]);_0x27d151['where']=qs[_0x52a7('0x2f')](_[_0x52a7('0x4a')](_0x1cdd4a['query'],_0x30c71b[_0x52a7('0x2f')]));if(_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x38')]){_0x27d151['where']=_[_0x52a7('0x39')](_0x27d151['where'],{'$or':_[_0x52a7('0x2c')](_0x27d151[_0x52a7('0x32')],function(_0x46f8b5){var _0x2cf7bc={};_0x2cf7bc[_0x46f8b5]={'$like':'%'+_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x38')]+'%'};return _0x2cf7bc;})});}_0x27d151=_['merge']({},_0x27d151,_0x1cdd4a[_0x52a7('0x44')]);return _0x4322c7[_0x52a7('0x4b')](_0x27d151);}})[_0x52a7('0x21')](function(_0xcd2759){if(_0xcd2759){_0x2bd516=_0xcd2759['length'];if(!_0x1cdd4a['query'][_0x52a7('0x34')]('nolimit')){_0x27d151['limit']=qs[_0x52a7('0x17')](_0x1cdd4a['query'][_0x52a7('0x17')]);_0x27d151[_0x52a7('0x19')]=qs[_0x52a7('0x19')](_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x19')]);}return _0x4322c7['getConfigurations'](_0x27d151);}})[_0x52a7('0x21')](function(_0xcbc816){if(_0xcbc816){return _0xcbc816?{'count':_0x2bd516,'rows':_0xcbc816}:null;}})[_0x52a7('0x21')](respondWithResult(_0x41086f,null))[_0x52a7('0x40')](handleError(_0x41086f,null));};exports[_0x52a7('0x4c')]=function(_0x2ea570,_0x20948b,_0x3fd3ed){if(_0x2ea570[_0x52a7('0x47')]['id']){delete _0x2ea570['body']['id'];}return db[_0x52a7('0x3b')]['findOne']({'where':{'id':_0x2ea570[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x20948b,null))[_0x52a7('0x21')](function(_0x4aeeb6){if(_0x4aeeb6){_0x2ea570['body'][_0x52a7('0x4d')]=_0x4aeeb6['id'];_0x2ea570[_0x52a7('0x47')][_0x52a7('0x4e')]=integrations['getSubjects'](_0x2ea570[_0x52a7('0x47')]['channel'],_0x2ea570['body']['type']);_0x2ea570[_0x52a7('0x47')][_0x52a7('0x4f')]=integrations[_0x52a7('0x50')](_0x2ea570['body'][_0x52a7('0x51')],_0x2ea570['body'][_0x52a7('0x2a')]);return db[_0x52a7('0x49')][_0x52a7('0x46')](_0x2ea570[_0x52a7('0x47')],{'include':[{'model':db[_0x52a7('0x52')],'as':_0x52a7('0x4e')},{'model':db[_0x52a7('0x52')],'as':_0x52a7('0x4f')}]});}return null;})[_0x52a7('0x21')](respondWithResult(_0x20948b,null))[_0x52a7('0x40')](handleError(_0x20948b,null));};function getAccessToken(_0xf72072){return new Promise(function(_0x3bdfe7,_0x11f37b){var _0x5b8485;switch(_0xf72072[_0x52a7('0x53')]){case'US':_0x5b8485=_0x52a7('0x54');break;case'AU':_0x5b8485=_0x52a7('0x55');break;case'EU':_0x5b8485=_0x52a7('0x56');break;case'IN':_0x5b8485=_0x52a7('0x57');break;case'CN':_0x5b8485=_0x52a7('0x58');break;default:_0x5b8485=_0x52a7('0x56');break;}var _0x1e1e00={'method':_0x52a7('0x59'),'uri':_0x5b8485+_0x52a7('0x5a'),'qs':{'refresh_token':_0xf72072['refreshToken'],'client_id':_0xf72072[_0x52a7('0x5b')],'client_secret':_0xf72072[_0x52a7('0x5c')],'grant_type':_0x52a7('0x5d')},'json':!![]};return rp(_0x1e1e00)[_0x52a7('0x21')](function(_0x3f1dc9){if(_0x3f1dc9[_0x52a7('0x5e')]){_0x3bdfe7(_0x3f1dc9[_0x52a7('0x5e')]);}else{_0x11f37b(_0x52a7('0x5f'));}})['catch'](function(_0x1a5a13){_0x11f37b(_0x1a5a13);});});}exports['getFields']=function(_0x393a67,_0xa21cd4,_0x45322e){var _0x3f4d74,_0x284936,_0x319f2b,_0x81ecd2,_0x2f4d6d;return db[_0x52a7('0x3b')][_0x52a7('0x48')]({'where':{'id':_0x393a67[_0x52a7('0x42')]['id']},'attributes':['id',_0x52a7('0x60'),_0x52a7('0x53'),_0x52a7('0x5b'),'clientSecret',_0x52a7('0x61'),_0x52a7('0x62'),_0x52a7('0x63')]})[_0x52a7('0x21')](handleEntityNotFound(_0xa21cd4,null))[_0x52a7('0x21')](function(_0x93a48b){_0x2f4d6d=_0x93a48b;_0x3f4d74=_0x2f4d6d[_0x52a7('0x60')];_0x284936=_0x3f4d74===_0x52a7('0x64')?'eu':_0x52a7('0x65');_0x319f2b=_0x2f4d6d[_0x52a7('0x61')];var _0x458329=_0x319f2b[_0x52a7('0x66')](-0x1);if(_0x458329==='/'||_0x458329==='\x5c'||_0x458329===':'){_0x319f2b=_0x319f2b[_0x52a7('0x67')](0x0,_0x319f2b['lastIndexOf'](_0x458329));}if(!_0x2f4d6d['refreshToken']){throw new Error(_0x52a7('0x68'));}return getAccessToken(_0x2f4d6d);})[_0x52a7('0x21')](function(_0xabcc28){if(_0xabcc28){return rp({'method':_0x52a7('0x69'),'uri':util[_0x52a7('0x6a')](_0x52a7('0x6b'),_0x284936),'qs':{'module':'Calls'},'headers':{'Authorization':_0x52a7('0x6c')+_0xabcc28},'json':!![]});}})[_0x52a7('0x21')](function(_0x4ebbea){if(_0x4ebbea){if(_0x4ebbea[_0x52a7('0x6d')]&&_0x4ebbea[_0x52a7('0x6d')][_0x52a7('0x23')]){throw new Error(_0x4ebbea[_0x52a7('0x6d')][_0x52a7('0x23')][_0x52a7('0x6e')]);}var _0x28b085=[];var _0x1e026b=[];var _0x1158de=[_0x52a7('0x6f'),_0x52a7('0x70'),_0x52a7('0x71'),_0x52a7('0x72'),_0x52a7('0x73'),'Call_Result','Call_Start_Time',_0x52a7('0x74')];_0x1e026b=_['remove'](_0x4ebbea['fields'],function(_0x2d0cb7){return _0x1158de[_0x52a7('0x75')](_0x2d0cb7[_0x52a7('0x76')]);});for(var _0x5f3d12=0x0;_0x5f3d12<_0x1e026b['length'];_0x5f3d12++){if(_0x1e026b[_0x5f3d12][_0x52a7('0x77')]===![]){_0x28b085[_0x52a7('0x78')]({'id':_0x1e026b[_0x5f3d12]['id'],'name':_0x1e026b[_0x5f3d12][_0x52a7('0x79')],'custom':_0x1e026b[_0x5f3d12][_0x52a7('0x7a')],'options':_0x1e026b[_0x5f3d12][_0x52a7('0x7b')]===_0x52a7('0x7c')&&_0x1e026b[_0x5f3d12][_0x52a7('0x7d')]['length']>-0x1?_[_0x52a7('0x2c')](_0x1e026b[_0x5f3d12][_0x52a7('0x7d')],function(_0x3b1edd){return{'name':_0x3b1edd,'value':_0x3b1edd};}):[]});}}return{'count':_0x28b085[_0x52a7('0x43')],'rows':_0x28b085};}else{return{'count':0x0,'rows':[]};}})[_0x52a7('0x21')](respondWithResult(_0xa21cd4,null))[_0x52a7('0x40')](function(_0x29949e){var _0x3992d9=_0x393a67['query'][_0x52a7('0x7e')]?0x1f4:_0x29949e[_0x52a7('0x7f')]||0x1f4;logger[_0x52a7('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x52a7('0x80'),_0x3992d9,JSON[_0x52a7('0x81')](_0x29949e));delete _0x29949e[_0x52a7('0x25')];if(_0x3992d9===0x191){_0x3992d9=0x190;}_0xa21cd4[_0x52a7('0x1a')](_0x3992d9)[_0x52a7('0x26')](_0x393a67[_0x52a7('0x2d')][_0x52a7('0x7e')]?{'message':_0x52a7('0x82'),'statusCode':_0x29949e[_0x52a7('0x7f')]}:_0x29949e);});}; \ No newline at end of file +var _0x5f31=['GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','api_name','length','system_mandatory','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','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','filter','options','ZohoAccount','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','Subjects','getSubjects','channel','Descriptions','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','clientSecret','refresh_token','access_token','getFields','host','clientId','serverUrl','code','zoho.eu','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account'];(function(_0x44881b,_0x541447){var _0x59b5cf=function(_0x13b51e){while(--_0x13b51e){_0x44881b['push'](_0x44881b['shift']());}};_0x59b5cf(++_0x541447);}(_0x5f31,0x1a7));var _0x15f3=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x5f31[_0x3b2244];return _0x2dcc14;};'use strict';var emlformat=require(_0x15f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15f3('0x1'));var jsonpatch=require(_0x15f3('0x2'));var rp=require('request-promise');var moment=require(_0x15f3('0x3'));var BPromise=require(_0x15f3('0x4'));var Mustache=require(_0x15f3('0x5'));var util=require(_0x15f3('0x6'));var path=require(_0x15f3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x15f3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15f3('0x9'));var squel=require(_0x15f3('0xa'));var crypto=require('crypto');var jsforce=require(_0x15f3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x15f3('0xc'));var querystring=require(_0x15f3('0xd'));var Papa=require(_0x15f3('0xe'));var Redis=require(_0x15f3('0xf'));var authService=require(_0x15f3('0x10'));var qs=require(_0x15f3('0x11'));var as=require(_0x15f3('0x12'));var hardwareService=require(_0x15f3('0x13'));var logger=require(_0x15f3('0x14'))(_0x15f3('0x15'));var utils=require(_0x15f3('0x16'));var config=require(_0x15f3('0x17'));var licenseUtil=require(_0x15f3('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x15f3('0x19'));function respondWithStatusCode(_0x2ba536,_0x38bec9){_0x38bec9=_0x38bec9||0xcc;return function(_0x17cbfe){if(_0x17cbfe){return _0x2ba536[_0x15f3('0x1a')](_0x38bec9);}return _0x2ba536['status'](_0x38bec9)[_0x15f3('0x1b')]();};}function respondWithResult(_0x3f66b7,_0x4ce23b){_0x4ce23b=_0x4ce23b||0xc8;return function(_0x2b5c9e){if(_0x2b5c9e){return _0x3f66b7[_0x15f3('0x1c')](_0x4ce23b)['json'](_0x2b5c9e);}};}function respondWithFilteredResult(_0x9aea97,_0x277f11){return function(_0x52422e){if(_0x52422e){var _0x4516cf=typeof _0x277f11['offset']===_0x15f3('0x1d')&&typeof _0x277f11[_0x15f3('0x1e')]==='undefined';var _0xc0248a=_0x52422e[_0x15f3('0x1f')];var _0x1c7672=_0x4516cf?0x0:_0x277f11[_0x15f3('0x20')];var _0x2596e6=_0x4516cf?_0x52422e['count']:_0x277f11['offset']+_0x277f11[_0x15f3('0x1e')];var _0x5b59e0;if(_0x2596e6>=_0xc0248a){_0x2596e6=_0xc0248a;_0x5b59e0=0xc8;}else{_0x5b59e0=0xce;}_0x9aea97[_0x15f3('0x1c')](_0x5b59e0);return _0x9aea97[_0x15f3('0x21')](_0x15f3('0x22'),_0x1c7672+'-'+_0x2596e6+'/'+_0xc0248a)[_0x15f3('0x23')](_0x52422e);}return null;};}function patchUpdates(_0x280543){return function(_0x11acaa){try{jsonpatch[_0x15f3('0x24')](_0x11acaa,_0x280543,!![]);}catch(_0x4f6268){return BPromise[_0x15f3('0x25')](_0x4f6268);}return _0x11acaa[_0x15f3('0x26')]();};}function saveUpdates(_0x11714f,_0x253d14){return function(_0x3ec0ef){if(_0x3ec0ef){return _0x3ec0ef['update'](_0x11714f)[_0x15f3('0x27')](function(_0x506d93){return _0x506d93;});}return null;};}function removeEntity(_0x2179b0,_0x1478cd){return function(_0x21c007){if(_0x21c007){return _0x21c007[_0x15f3('0x28')]()['then'](function(){_0x2179b0[_0x15f3('0x1c')](0xcc)[_0x15f3('0x1b')]();});}};}function handleEntityNotFound(_0x453203,_0x457417){return function(_0x2750af){if(!_0x2750af){_0x453203[_0x15f3('0x1a')](0x194);}return _0x2750af;};}function handleError(_0x359926,_0x561bfb){_0x561bfb=_0x561bfb||0x1f4;return function(_0x593842){logger[_0x15f3('0x29')](_0x593842[_0x15f3('0x2a')]);if(_0x593842['name']){delete _0x593842[_0x15f3('0x2b')];}_0x359926[_0x15f3('0x1c')](_0x561bfb)[_0x15f3('0x2c')](_0x593842);};}exports[_0x15f3('0x2d')]=function(_0x108304,_0x2cf2ee){var _0x168a4b={},_0x6722dc={},_0x4b8af6={'count':0x0,'rows':[]};var _0x2baa27=_['map'](db['ZohoAccount']['rawAttributes'],function(_0x18219b){return{'name':_0x18219b[_0x15f3('0x2e')],'type':_0x18219b[_0x15f3('0x2f')][_0x15f3('0x30')]};});_0x6722dc[_0x15f3('0x31')]=_[_0x15f3('0x32')](_0x2baa27,_0x15f3('0x2b'));_0x6722dc[_0x15f3('0x33')]=_[_0x15f3('0x34')](_0x108304['query']);_0x6722dc[_0x15f3('0x35')]=_[_0x15f3('0x36')](_0x6722dc[_0x15f3('0x31')],_0x6722dc['query']);_0x168a4b[_0x15f3('0x37')]=_[_0x15f3('0x36')](_0x6722dc[_0x15f3('0x31')],qs[_0x15f3('0x38')](_0x108304[_0x15f3('0x33')][_0x15f3('0x38')]));_0x168a4b['attributes']=_0x168a4b['attributes']['length']?_0x168a4b['attributes']:_0x6722dc['model'];if(!_0x108304[_0x15f3('0x33')][_0x15f3('0x39')](_0x15f3('0x3a'))){_0x168a4b[_0x15f3('0x1e')]=qs[_0x15f3('0x1e')](_0x108304[_0x15f3('0x33')][_0x15f3('0x1e')]);_0x168a4b[_0x15f3('0x20')]=qs[_0x15f3('0x20')](_0x108304[_0x15f3('0x33')][_0x15f3('0x20')]);}_0x168a4b[_0x15f3('0x3b')]=qs['sort'](_0x108304[_0x15f3('0x33')][_0x15f3('0x3c')]);_0x168a4b[_0x15f3('0x3d')]=qs[_0x15f3('0x35')](_[_0x15f3('0x3e')](_0x108304['query'],_0x6722dc[_0x15f3('0x35')]),_0x2baa27);if(_0x108304[_0x15f3('0x33')]['filter']){_0x168a4b[_0x15f3('0x3d')]=_[_0x15f3('0x3f')](_0x168a4b[_0x15f3('0x3d')],{'$or':_[_0x15f3('0x32')](_0x2baa27,function(_0x40c47d){if(_0x40c47d[_0x15f3('0x2f')]!==_0x15f3('0x40')){var _0x47706a={};_0x47706a[_0x40c47d['name']]={'$like':'%'+_0x108304['query'][_0x15f3('0x41')]+'%'};return _0x47706a;}})});}_0x168a4b=_['merge']({},_0x168a4b,_0x108304[_0x15f3('0x42')]);var _0x4866fe={'where':_0x168a4b[_0x15f3('0x3d')]};return db[_0x15f3('0x43')]['count'](_0x4866fe)[_0x15f3('0x27')](function(_0x3e7641){_0x4b8af6[_0x15f3('0x1f')]=_0x3e7641;if(_0x108304['query'][_0x15f3('0x44')]){_0x168a4b[_0x15f3('0x45')]=[{'all':!![]}];}return db[_0x15f3('0x43')][_0x15f3('0x46')](_0x168a4b);})['then'](function(_0x3a0084){_0x4b8af6['rows']=_0x3a0084;return _0x4b8af6;})[_0x15f3('0x27')](respondWithFilteredResult(_0x2cf2ee,_0x168a4b))[_0x15f3('0x47')](handleError(_0x2cf2ee,null));};exports['show']=function(_0x1df69c,_0x35be95){var _0xb9f7d={'raw':![],'where':{'id':_0x1df69c[_0x15f3('0x48')]['id']}},_0x3a1fb4={};_0x3a1fb4[_0x15f3('0x31')]=_[_0x15f3('0x34')](db[_0x15f3('0x43')][_0x15f3('0x49')]);_0x3a1fb4[_0x15f3('0x33')]=_[_0x15f3('0x34')](_0x1df69c[_0x15f3('0x33')]);_0x3a1fb4[_0x15f3('0x35')]=_[_0x15f3('0x36')](_0x3a1fb4[_0x15f3('0x31')],_0x3a1fb4[_0x15f3('0x33')]);_0xb9f7d[_0x15f3('0x37')]=_['intersection'](_0x3a1fb4[_0x15f3('0x31')],qs['fields'](_0x1df69c[_0x15f3('0x33')][_0x15f3('0x38')]));_0xb9f7d[_0x15f3('0x37')]=_0xb9f7d['attributes']['length']?_0xb9f7d['attributes']:_0x3a1fb4[_0x15f3('0x31')];if(_0x1df69c['query'][_0x15f3('0x44')]){_0xb9f7d['include']=[{'all':!![]}];}_0xb9f7d=_[_0x15f3('0x3f')]({},_0xb9f7d,_0x1df69c[_0x15f3('0x42')]);return db[_0x15f3('0x43')][_0x15f3('0x4a')](_0xb9f7d)[_0x15f3('0x27')](handleEntityNotFound(_0x35be95,null))[_0x15f3('0x27')](respondWithResult(_0x35be95,null))['catch'](handleError(_0x35be95,null));};exports[_0x15f3('0x4b')]=function(_0x50a2df,_0x5b632e){return db[_0x15f3('0x43')]['create'](_0x50a2df[_0x15f3('0x4c')],{})[_0x15f3('0x27')](respondWithResult(_0x5b632e,0xc9))[_0x15f3('0x47')](handleError(_0x5b632e,null));};exports[_0x15f3('0x4d')]=function(_0x201ce5,_0x56e89b){if(_0x201ce5[_0x15f3('0x4c')]['id']){delete _0x201ce5[_0x15f3('0x4c')]['id'];}return db['ZohoAccount'][_0x15f3('0x4a')]({'where':{'id':_0x201ce5[_0x15f3('0x48')]['id']}})[_0x15f3('0x27')](handleEntityNotFound(_0x56e89b,null))[_0x15f3('0x27')](saveUpdates(_0x201ce5[_0x15f3('0x4c')],null))[_0x15f3('0x27')](respondWithResult(_0x56e89b,null))[_0x15f3('0x47')](handleError(_0x56e89b,null));};exports[_0x15f3('0x28')]=function(_0x5c60ea,_0x2ef905){return db[_0x15f3('0x43')]['find']({'where':{'id':_0x5c60ea['params']['id']}})[_0x15f3('0x27')](handleEntityNotFound(_0x2ef905,null))[_0x15f3('0x27')](removeEntity(_0x2ef905,null))['catch'](handleError(_0x2ef905,null));};exports[_0x15f3('0x4e')]=function(_0x290bb9,_0x4b8dd7,_0x1ccb58){var _0x512d9f={};var _0x10e87c={};var _0x2c55e3;var _0x56ac9b;return db['ZohoAccount'][_0x15f3('0x4f')]({'where':{'id':_0x290bb9[_0x15f3('0x48')]['id']}})[_0x15f3('0x27')](handleEntityNotFound(_0x4b8dd7,null))[_0x15f3('0x27')](function(_0x1d3ec2){if(_0x1d3ec2){_0x2c55e3=_0x1d3ec2;_0x10e87c['model']=_['keys'](db[_0x15f3('0x50')][_0x15f3('0x49')]);_0x10e87c[_0x15f3('0x33')]=_[_0x15f3('0x34')](_0x290bb9[_0x15f3('0x33')]);_0x10e87c['filters']=_[_0x15f3('0x36')](_0x10e87c[_0x15f3('0x31')],_0x10e87c[_0x15f3('0x33')]);_0x512d9f[_0x15f3('0x37')]=_['intersection'](_0x10e87c[_0x15f3('0x31')],qs[_0x15f3('0x38')](_0x290bb9['query']['fields']));_0x512d9f[_0x15f3('0x37')]=_0x512d9f[_0x15f3('0x37')]['length']?_0x512d9f['attributes']:_0x10e87c[_0x15f3('0x31')];_0x512d9f[_0x15f3('0x3b')]=qs[_0x15f3('0x3c')](_0x290bb9[_0x15f3('0x33')][_0x15f3('0x3c')]);_0x512d9f['where']=qs['filters'](_['pick'](_0x290bb9['query'],_0x10e87c[_0x15f3('0x35')]));if(_0x290bb9[_0x15f3('0x33')][_0x15f3('0x41')]){_0x512d9f['where']=_[_0x15f3('0x3f')](_0x512d9f[_0x15f3('0x3d')],{'$or':_['map'](_0x512d9f[_0x15f3('0x37')],function(_0x1819ad){var _0x163003={};_0x163003[_0x1819ad]={'$like':'%'+_0x290bb9[_0x15f3('0x33')][_0x15f3('0x41')]+'%'};return _0x163003;})});}_0x512d9f=_[_0x15f3('0x3f')]({},_0x512d9f,_0x290bb9[_0x15f3('0x42')]);return _0x2c55e3[_0x15f3('0x4e')](_0x512d9f);}})[_0x15f3('0x27')](function(_0x1275ab){if(_0x1275ab){_0x56ac9b=_0x1275ab['length'];if(!_0x290bb9[_0x15f3('0x33')]['hasOwnProperty']('nolimit')){_0x512d9f[_0x15f3('0x1e')]=qs['limit'](_0x290bb9[_0x15f3('0x33')]['limit']);_0x512d9f[_0x15f3('0x20')]=qs[_0x15f3('0x20')](_0x290bb9[_0x15f3('0x33')][_0x15f3('0x20')]);}return _0x2c55e3[_0x15f3('0x4e')](_0x512d9f);}})[_0x15f3('0x27')](function(_0x3a9762){if(_0x3a9762){return _0x3a9762?{'count':_0x56ac9b,'rows':_0x3a9762}:null;}})['then'](respondWithResult(_0x4b8dd7,null))[_0x15f3('0x47')](handleError(_0x4b8dd7,null));};exports['addConfiguration']=function(_0x18c4a5,_0x3d29ca,_0x587103){if(_0x18c4a5[_0x15f3('0x4c')]['id']){delete _0x18c4a5[_0x15f3('0x4c')]['id'];}return db[_0x15f3('0x43')]['findOne']({'where':{'id':_0x18c4a5[_0x15f3('0x48')]['id']}})[_0x15f3('0x27')](handleEntityNotFound(_0x3d29ca,null))[_0x15f3('0x27')](function(_0x2c7365){if(_0x2c7365){_0x18c4a5['body']['AccountId']=_0x2c7365['id'];_0x18c4a5[_0x15f3('0x4c')][_0x15f3('0x51')]=integrations[_0x15f3('0x52')](_0x18c4a5[_0x15f3('0x4c')][_0x15f3('0x53')],_0x18c4a5['body'][_0x15f3('0x2f')]);_0x18c4a5[_0x15f3('0x4c')][_0x15f3('0x54')]=integrations['getDescriptions'](_0x18c4a5[_0x15f3('0x4c')][_0x15f3('0x53')],_0x18c4a5[_0x15f3('0x4c')][_0x15f3('0x2f')]);return db['ZohoConfiguration']['create'](_0x18c4a5[_0x15f3('0x4c')],{'include':[{'model':db[_0x15f3('0x55')],'as':_0x15f3('0x51')},{'model':db[_0x15f3('0x55')],'as':_0x15f3('0x54')}]});}return null;})[_0x15f3('0x27')](respondWithResult(_0x3d29ca,null))[_0x15f3('0x47')](handleError(_0x3d29ca,null));};function getAccessToken(_0x31c589){return new Promise(function(_0x4c35f5,_0x3b2c11){var _0x49f599;switch(_0x31c589[_0x15f3('0x56')]){case'US':_0x49f599=_0x15f3('0x57');break;case'AU':_0x49f599=_0x15f3('0x58');break;case'EU':_0x49f599=_0x15f3('0x59');break;case'IN':_0x49f599='https://accounts.zoho.in';break;case'CN':_0x49f599=_0x15f3('0x5a');break;default:_0x49f599='https://accounts.zoho.eu';break;}var _0xf33cfd={'method':_0x15f3('0x5b'),'uri':_0x49f599+_0x15f3('0x5c'),'qs':{'refresh_token':_0x31c589[_0x15f3('0x5d')],'client_id':_0x31c589['clientId'],'client_secret':_0x31c589[_0x15f3('0x5e')],'grant_type':_0x15f3('0x5f')},'json':!![]};return rp(_0xf33cfd)[_0x15f3('0x27')](function(_0x29c798){if(_0x29c798[_0x15f3('0x60')]){_0x4c35f5(_0x29c798[_0x15f3('0x60')]);}else{_0x3b2c11('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x15f3('0x47')](function(_0x23647d){_0x3b2c11(_0x23647d);});});}exports[_0x15f3('0x61')]=function(_0xa62b87,_0x1699d7,_0x5e8150){var _0x366186,_0x48e6c6,_0xf65a7d,_0x50d404,_0x2b4229;return db[_0x15f3('0x43')][_0x15f3('0x4f')]({'where':{'id':_0xa62b87['params']['id']},'attributes':['id',_0x15f3('0x62'),_0x15f3('0x56'),_0x15f3('0x63'),_0x15f3('0x5e'),_0x15f3('0x64'),_0x15f3('0x65'),_0x15f3('0x5d')]})[_0x15f3('0x27')](handleEntityNotFound(_0x1699d7,null))[_0x15f3('0x27')](function(_0x214245){_0x2b4229=_0x214245;_0x366186=_0x2b4229['host'];_0x48e6c6=_0x366186===_0x15f3('0x66')?'eu':'com';_0xf65a7d=_0x2b4229[_0x15f3('0x64')];var _0x13284e=_0xf65a7d[_0x15f3('0x67')](-0x1);if(_0x13284e==='/'||_0x13284e==='\x5c'||_0x13284e===':'){_0xf65a7d=_0xf65a7d['substring'](0x0,_0xf65a7d['lastIndexOf'](_0x13284e));}if(!_0x2b4229['refreshToken']){throw new Error(_0x15f3('0x68'));}return getAccessToken(_0x2b4229);})['then'](function(_0x4ce80e){if(_0x4ce80e){return rp({'method':_0x15f3('0x69'),'uri':util[_0x15f3('0x6a')](_0x15f3('0x6b'),_0x48e6c6),'qs':{'module':_0x15f3('0x6c')},'headers':{'Authorization':_0x15f3('0x6d')+_0x4ce80e},'json':!![]});}})[_0x15f3('0x27')](function(_0x191bbc){if(_0x191bbc){if(_0x191bbc['response']&&_0x191bbc[_0x15f3('0x6e')]['error']){throw new Error(_0x191bbc['response'][_0x15f3('0x29')][_0x15f3('0x6f')]);}var _0x2c3d33=[];var _0x1b9f2b=[];var _0x5703d7=[_0x15f3('0x70'),_0x15f3('0x71'),_0x15f3('0x72'),_0x15f3('0x73'),'Call_Duration',_0x15f3('0x74'),_0x15f3('0x75'),_0x15f3('0x76')];_0x1b9f2b=_[_0x15f3('0x77')](_0x191bbc['fields'],function(_0x1482a4){return _0x5703d7['includes'](_0x1482a4[_0x15f3('0x78')]);});for(var _0x1843c4=0x0;_0x1843c4<_0x1b9f2b[_0x15f3('0x79')];_0x1843c4++){if(_0x1b9f2b[_0x1843c4][_0x15f3('0x7a')]===![]){_0x2c3d33['push']({'id':_0x1b9f2b[_0x1843c4]['id'],'name':_0x1b9f2b[_0x1843c4][_0x15f3('0x7b')],'custom':_0x1b9f2b[_0x1843c4][_0x15f3('0x7c')],'options':_0x1b9f2b[_0x1843c4][_0x15f3('0x7d')]==='picklist'&&_0x1b9f2b[_0x1843c4][_0x15f3('0x7e')][_0x15f3('0x79')]>-0x1?_[_0x15f3('0x32')](_0x1b9f2b[_0x1843c4][_0x15f3('0x7e')],function(_0x1c51ee){return{'name':_0x1c51ee,'value':_0x1c51ee};}):[]});}}return{'count':_0x2c3d33['length'],'rows':_0x2c3d33};}else{return{'count':0x0,'rows':[]};}})[_0x15f3('0x27')](respondWithResult(_0x1699d7,null))['catch'](function(_0x2f71a2){var _0x3ce6db=_0xa62b87[_0x15f3('0x33')][_0x15f3('0x7f')]?0x1f4:_0x2f71a2[_0x15f3('0x80')]||0x1f4;logger[_0x15f3('0x29')](_0x15f3('0x81'),'getFields',_0x3ce6db,JSON[_0x15f3('0x82')](_0x2f71a2));delete _0x2f71a2[_0x15f3('0x2b')];if(_0x3ce6db===0x191){_0x3ce6db=0x190;}_0x1699d7['status'](_0x3ce6db)[_0x15f3('0x2c')](_0xa62b87[_0x15f3('0x33')][_0x15f3('0x7f')]?{'message':_0x15f3('0x83'),'statusCode':_0x2f71a2[_0x15f3('0x80')]}:_0x2f71a2);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 0db5314..9638afb 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 _0x1297=['rimraf','../../config/environment','./intZohoAccount.attributes','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','slice','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf','https://accounts.zoho.com','then','refreshToken','format','error','lodash','util','../../config/logger','moment','path'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x1297,0xeb));var _0x7129=function(_0x818799,_0x4e1c9e){_0x818799=_0x818799-0x0;var _0x69f4c2=_0x1297[_0x818799];return _0x69f4c2;};'use strict';var _=require(_0x7129('0x0'));var util=require(_0x7129('0x1'));var logger=require(_0x7129('0x2'))('api');var moment=require(_0x7129('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7129('0x4'));var rimraf=require(_0x7129('0x5'));var config=require(_0x7129('0x6'));var attributes=require(_0x7129('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x6325a0,_0x10af6f){return _0x6325a0[_0x7129('0x8')](_0x7129('0x9'),attributes,{'tableName':_0x7129('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe3c37,_0x5eddf5,_0xe499b4){if(_0xe3c37[_0x7129('0xb')](_0x7129('0xc'))||_0xe3c37[_0x7129('0xb')](_0x7129('0xd'))||_0xe3c37['changed'](_0x7129('0xe'))||_0xe3c37[_0x7129('0xb')](_0x7129('0xf'))||_0xe3c37['changed'](_0x7129('0x10'))||_0xe3c37[_0x7129('0xb')]('host')){var _0x447540,_0x1e6c5d;_0x447540=_0xe3c37['serverUrl'];var _0x462d0c=_0x447540[_0x7129('0x11')](-0x1);if(_0x462d0c==='/'||_0x462d0c==='\x5c'||_0x462d0c===':'){_0x447540=_0x447540['substring'](0x0,_0x447540['lastIndexOf'](_0x462d0c));}switch(_0xe3c37[_0x7129('0xc')]){case'US':_0x1e6c5d='https://accounts.zoho.com';break;case'AU':_0x1e6c5d=_0x7129('0x12');break;case'IN':_0x1e6c5d=_0x7129('0x13');break;case'CN':_0x1e6c5d=_0x7129('0x14');break;default:_0x1e6c5d=_0x7129('0x15');break;}var _0x3f2809={'method':_0x7129('0x16'),'uri':_0x1e6c5d+_0x7129('0x17'),'form':{'grant_type':_0x7129('0x18'),'client_id':_0xe3c37[_0x7129('0xe')],'client_secret':_0xe3c37[_0x7129('0xf')],'redirect_uri':_0xe3c37['serverUrl'],'code':_0xe3c37[_0x7129('0x10')]},'headers':{'Content-Type':_0x7129('0x19')}};return rp(_0x3f2809)['then'](function(_0x138720){var _0x212f67=JSON[_0x7129('0x1a')](_0x138720);if(_0x212f67[_0x7129('0x1b')]){_0xe3c37['refreshToken']=_0x212f67['refresh_token'];logger[_0x7129('0x1c')](util['format'](_0x7129('0x1d'),_0xe3c37[_0x7129('0x1e')],_0xe3c37['id']));}else{logger['error'](util['format'](_0x7129('0x1f'),_0xe3c37[_0x7129('0x1e')],_0xe3c37['id']),util[_0x7129('0x20')](_0x212f67,{'showHidden':![],'depth':null}));}return _0xe499b4(null,_0x5eddf5);})[_0x7129('0x21')](function(_0x5d2f47){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xe3c37[_0x7129('0x1e')],_0xe3c37['id']),util[_0x7129('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0xe499b4(_0x5d2f47);});}else{return _0xe499b4(null,_0x5eddf5);}},'beforeUpdate':function(_0x1403e2,_0x32e1a8,_0x51f9a4){if(_0x1403e2['changed'](_0x7129('0xc'))||_0x1403e2['changed']('serverUrl')||_0x1403e2[_0x7129('0xb')](_0x7129('0xe'))||_0x1403e2[_0x7129('0xb')]('clientSecret')||_0x1403e2[_0x7129('0xb')](_0x7129('0x10'))||_0x1403e2[_0x7129('0xb')]('host')){var _0x4280ed,_0x47b0c4;_0x4280ed=_0x1403e2[_0x7129('0xd')];var _0x334eab=_0x4280ed['slice'](-0x1);if(_0x334eab==='/'||_0x334eab==='\x5c'||_0x334eab===':'){_0x4280ed=_0x4280ed['substring'](0x0,_0x4280ed[_0x7129('0x22')](_0x334eab));}switch(_0x1403e2[_0x7129('0xc')]){case'US':_0x47b0c4=_0x7129('0x23');break;case'AU':_0x47b0c4=_0x7129('0x12');break;case'IN':_0x47b0c4=_0x7129('0x13');break;case'CN':_0x47b0c4=_0x7129('0x14');break;default:_0x47b0c4=_0x7129('0x15');break;}var _0x2d7e65={'method':'POST','uri':_0x47b0c4+'/oauth/v2/token','form':{'grant_type':_0x7129('0x18'),'client_id':_0x1403e2[_0x7129('0xe')],'client_secret':_0x1403e2[_0x7129('0xf')],'redirect_uri':_0x1403e2[_0x7129('0xd')],'code':_0x1403e2['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2d7e65)[_0x7129('0x24')](function(_0x23fa7c){var _0x5b18f6=JSON[_0x7129('0x1a')](_0x23fa7c);if(_0x5b18f6[_0x7129('0x1b')]){_0x1403e2[_0x7129('0x25')]=_0x5b18f6[_0x7129('0x1b')];logger[_0x7129('0x1c')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1403e2[_0x7129('0x1e')],_0x1403e2['id']));}else{logger['error'](util[_0x7129('0x26')](_0x7129('0x1f'),_0x1403e2[_0x7129('0x1e')],_0x1403e2['id']),util[_0x7129('0x20')](_0x5b18f6,{'showHidden':![],'depth':null}));}return _0x51f9a4(null,_0x32e1a8);})[_0x7129('0x21')](function(_0x53e09d){logger[_0x7129('0x27')](util[_0x7129('0x26')](_0x7129('0x1f'),_0x1403e2[_0x7129('0x1e')],_0x1403e2['id']),util[_0x7129('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x51f9a4(_0x53e09d);});}else{return _0x51f9a4(null,_0x32e1a8);}}}});}; \ No newline at end of file +var _0x9e14=['/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','https://accounts.zoho.in','https://accounts.zoho.eu','lodash','util','../../config/logger','api','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','POST'];(function(_0x256658,_0x4bff0a){var _0x1cfb42=function(_0x279ece){while(--_0x279ece){_0x256658['push'](_0x256658['shift']());}};_0x1cfb42(++_0x4bff0a);}(_0x9e14,0x1f2));var _0x49e1=function(_0x5b3494,_0x191ce4){_0x5b3494=_0x5b3494-0x0;var _0x42a2e2=_0x9e14[_0x5b3494];return _0x42a2e2;};'use strict';var _=require(_0x49e1('0x0'));var util=require(_0x49e1('0x1'));var logger=require(_0x49e1('0x2'))(_0x49e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49e1('0x4'));var fs=require('fs');var path=require(_0x49e1('0x5'));var rimraf=require(_0x49e1('0x6'));var config=require('../../config/environment');var attributes=require(_0x49e1('0x7'));var integrations=require(_0x49e1('0x8'));module[_0x49e1('0x9')]=function(_0x39164a,_0x24d704){return _0x39164a['define'](_0x49e1('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x177b1a,_0x5e2312,_0x197592){if(_0x177b1a[_0x49e1('0xb')](_0x49e1('0xc'))||_0x177b1a[_0x49e1('0xb')](_0x49e1('0xd'))||_0x177b1a[_0x49e1('0xb')](_0x49e1('0xe'))||_0x177b1a[_0x49e1('0xb')](_0x49e1('0xf'))||_0x177b1a[_0x49e1('0xb')]('code')||_0x177b1a[_0x49e1('0xb')](_0x49e1('0x10'))){var _0x589f07,_0x10f2f1;_0x589f07=_0x177b1a[_0x49e1('0xd')];var _0x4d93fe=_0x589f07[_0x49e1('0x11')](-0x1);if(_0x4d93fe==='/'||_0x4d93fe==='\x5c'||_0x4d93fe===':'){_0x589f07=_0x589f07['substring'](0x0,_0x589f07[_0x49e1('0x12')](_0x4d93fe));}switch(_0x177b1a[_0x49e1('0xc')]){case'US':_0x10f2f1=_0x49e1('0x13');break;case'AU':_0x10f2f1=_0x49e1('0x14');break;case'IN':_0x10f2f1='https://accounts.zoho.in';break;case'CN':_0x10f2f1='https://accounts.zoho.com.cn';break;default:_0x10f2f1='https://accounts.zoho.eu';break;}var _0x4f3df0={'method':_0x49e1('0x15'),'uri':_0x10f2f1+_0x49e1('0x16'),'form':{'grant_type':_0x49e1('0x17'),'client_id':_0x177b1a['clientId'],'client_secret':_0x177b1a[_0x49e1('0xf')],'redirect_uri':_0x177b1a[_0x49e1('0xd')],'code':_0x177b1a[_0x49e1('0x18')]},'headers':{'Content-Type':_0x49e1('0x19')}};return rp(_0x4f3df0)[_0x49e1('0x1a')](function(_0x2d02d1){var _0x3c5191=JSON[_0x49e1('0x1b')](_0x2d02d1);if(_0x3c5191['refresh_token']){_0x177b1a[_0x49e1('0x1c')]=_0x3c5191['refresh_token'];logger[_0x49e1('0x1d')](util['format'](_0x49e1('0x1e'),_0x177b1a[_0x49e1('0x1f')],_0x177b1a['id']));}else{logger[_0x49e1('0x20')](util[_0x49e1('0x21')](_0x49e1('0x22'),_0x177b1a['name'],_0x177b1a['id']),util[_0x49e1('0x23')](_0x3c5191,{'showHidden':![],'depth':null}));}return _0x197592(null,_0x5e2312);})[_0x49e1('0x24')](function(_0x4eadbb){logger['error'](util[_0x49e1('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x177b1a['name'],_0x177b1a['id']),util[_0x49e1('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x197592(_0x4eadbb);});}else{return _0x197592(null,_0x5e2312);}},'beforeUpdate':function(_0x541115,_0x2a5071,_0x3ea7b0){if(_0x541115[_0x49e1('0xb')](_0x49e1('0xc'))||_0x541115['changed'](_0x49e1('0xd'))||_0x541115[_0x49e1('0xb')](_0x49e1('0xe'))||_0x541115[_0x49e1('0xb')](_0x49e1('0xf'))||_0x541115[_0x49e1('0xb')](_0x49e1('0x18'))||_0x541115[_0x49e1('0xb')](_0x49e1('0x10'))){var _0x3b4adb,_0xd00ff9;_0x3b4adb=_0x541115[_0x49e1('0xd')];var _0x87c27c=_0x3b4adb[_0x49e1('0x11')](-0x1);if(_0x87c27c==='/'||_0x87c27c==='\x5c'||_0x87c27c===':'){_0x3b4adb=_0x3b4adb[_0x49e1('0x25')](0x0,_0x3b4adb['lastIndexOf'](_0x87c27c));}switch(_0x541115[_0x49e1('0xc')]){case'US':_0xd00ff9=_0x49e1('0x13');break;case'AU':_0xd00ff9=_0x49e1('0x14');break;case'IN':_0xd00ff9=_0x49e1('0x26');break;case'CN':_0xd00ff9='https://accounts.zoho.com.cn';break;default:_0xd00ff9=_0x49e1('0x27');break;}var _0x5736cc={'method':_0x49e1('0x15'),'uri':_0xd00ff9+_0x49e1('0x16'),'form':{'grant_type':_0x49e1('0x17'),'client_id':_0x541115[_0x49e1('0xe')],'client_secret':_0x541115[_0x49e1('0xf')],'redirect_uri':_0x541115['serverUrl'],'code':_0x541115['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5736cc)[_0x49e1('0x1a')](function(_0xb0c15f){var _0x1a69a1=JSON[_0x49e1('0x1b')](_0xb0c15f);if(_0x1a69a1['refresh_token']){_0x541115['refreshToken']=_0x1a69a1['refresh_token'];logger[_0x49e1('0x1d')](util[_0x49e1('0x21')](_0x49e1('0x1e'),_0x541115[_0x49e1('0x1f')],_0x541115['id']));}else{logger[_0x49e1('0x20')](util[_0x49e1('0x21')](_0x49e1('0x22'),_0x541115[_0x49e1('0x1f')],_0x541115['id']),util[_0x49e1('0x23')](_0x1a69a1,{'showHidden':![],'depth':null}));}return _0x3ea7b0(null,_0x2a5071);})[_0x49e1('0x24')](function(_0x10f7e6){logger[_0x49e1('0x20')](util[_0x49e1('0x21')](_0x49e1('0x22'),_0x541115[_0x49e1('0x1f')],_0x541115['id']),util[_0x49e1('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ea7b0(_0x10f7e6);});}else{return _0x3ea7b0(null,_0x2a5071);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index e637576..e61b1da 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 _0x6144=['limit','include','map','model','attributes','then','ShowZohoAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','where'];(function(_0x1a2b1f,_0x412f6c){var _0x3a6bed=function(_0x3f8d85){while(--_0x3f8d85){_0x1a2b1f['push'](_0x1a2b1f['shift']());}};_0x3a6bed(++_0x412f6c);}(_0x6144,0x99));var _0x4614=function(_0x5dd4bd,_0x42501c){_0x5dd4bd=_0x5dd4bd-0x0;var _0x29548f=_0x6144[_0x5dd4bd];return _0x29548f;};'use strict';var _=require(_0x4614('0x0'));var util=require(_0x4614('0x1'));var moment=require(_0x4614('0x2'));var BPromise=require(_0x4614('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4614('0x4'));var db=require(_0x4614('0x5'))['db'];var utils=require(_0x4614('0x6'));var logger=require(_0x4614('0x7'))('rpc');var config=require(_0x4614('0x8'));var jayson=require(_0x4614('0x9'));var client=jayson[_0x4614('0xa')][_0x4614('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d6142,_0x4a1030,_0x45e5f2){return new BPromise(function(_0x3eb8ea,_0x4035f3){return client[_0x4614('0xc')](_0x3d6142,_0x45e5f2)['then'](function(_0x3c3afa){logger[_0x4614('0xd')](_0x4614('0xe'),_0x4a1030,_0x4614('0xf'));logger[_0x4614('0x10')](_0x4614('0x11'),_0x4a1030,_0x4614('0xf'),JSON['stringify'](_0x3c3afa));if(_0x3c3afa[_0x4614('0x12')]){if(_0x3c3afa[_0x4614('0x12')][_0x4614('0x13')]===0x1f4){logger[_0x4614('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x4a1030,_0x3c3afa['error'][_0x4614('0x14')]);return _0x4035f3(_0x3c3afa[_0x4614('0x12')][_0x4614('0x14')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4a1030,_0x3c3afa['error'][_0x4614('0x14')]);return _0x3eb8ea(_0x3c3afa[_0x4614('0x12')]['message']);}else{logger[_0x4614('0xd')](_0x4614('0xe'),_0x4a1030,_0x4614('0xf'));_0x3eb8ea(_0x3c3afa['result'][_0x4614('0x14')]);}})[_0x4614('0x15')](function(_0x1f30b0){logger[_0x4614('0x12')](_0x4614('0xe'),_0x4a1030,_0x1f30b0);_0x4035f3(_0x1f30b0);});});}exports[_0x4614('0x16')]=function(_0x5d10fc){var _0x29f526=this;return new Promise(function(_0x195eac,_0x53a14c){return db[_0x4614('0x17')][_0x4614('0x18')]({'raw':_0x5d10fc[_0x4614('0x19')]?_0x5d10fc['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d10fc[_0x4614('0x19')]?_0x5d10fc[_0x4614('0x19')][_0x4614('0x1a')]||null:null,'attributes':_0x5d10fc['options']?_0x5d10fc[_0x4614('0x19')]['attributes']||null:null,'limit':_0x5d10fc['options']?_0x5d10fc[_0x4614('0x19')][_0x4614('0x1b')]||null:null,'include':_0x5d10fc[_0x4614('0x19')]?_0x5d10fc['options'][_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x5d10fc[_0x4614('0x19')]['include'],function(_0x341fa5){return{'model':db[_0x341fa5[_0x4614('0x1e')]],'as':_0x341fa5['as'],'attributes':_0x341fa5['attributes'],'include':_0x341fa5[_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x341fa5[_0x4614('0x1c')],function(_0x51edf0){return{'model':db[_0x51edf0[_0x4614('0x1e')]],'as':_0x51edf0['as'],'attributes':_0x51edf0['attributes'],'include':_0x51edf0[_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x51edf0[_0x4614('0x1c')],function(_0x5ecfa6){return{'model':db[_0x5ecfa6['model']],'as':_0x5ecfa6['as'],'attributes':_0x5ecfa6[_0x4614('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4614('0x20')](function(_0x48bf58){logger['info'](_0x4614('0x16'),_0x5d10fc);logger[_0x4614('0x10')](_0x4614('0x16'),_0x5d10fc,JSON['stringify'](_0x48bf58));_0x195eac(_0x48bf58);})[_0x4614('0x15')](function(_0xc57a63){logger[_0x4614('0x12')](_0x4614('0x16'),_0xc57a63[_0x4614('0x14')],_0x5d10fc);_0x53a14c(_0x29f526[_0x4614('0x12')](0x1f4,_0xc57a63[_0x4614('0x14')]));});});};exports[_0x4614('0x21')]=function(_0x1bbe82){var _0x1a0f26=this;return new Promise(function(_0x2ebe8d,_0x521651){return db[_0x4614('0x17')][_0x4614('0x22')]({'raw':_0x1bbe82[_0x4614('0x19')]?_0x1bbe82[_0x4614('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1bbe82[_0x4614('0x19')]?_0x1bbe82['options'][_0x4614('0x1a')]||null:null,'attributes':_0x1bbe82[_0x4614('0x19')]?_0x1bbe82[_0x4614('0x19')][_0x4614('0x1f')]||null:null,'include':_0x1bbe82['options']?_0x1bbe82[_0x4614('0x19')][_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x1bbe82['options']['include'],function(_0x2ac72b){return{'model':db[_0x2ac72b[_0x4614('0x1e')]],'as':_0x2ac72b['as'],'attributes':_0x2ac72b['attributes'],'include':_0x2ac72b[_0x4614('0x1c')]?_['map'](_0x2ac72b[_0x4614('0x1c')],function(_0x6c0ba2){return{'model':db[_0x6c0ba2[_0x4614('0x1e')]],'as':_0x6c0ba2['as'],'attributes':_0x6c0ba2[_0x4614('0x1f')],'include':_0x6c0ba2[_0x4614('0x1c')]?_['map'](_0x6c0ba2['include'],function(_0x2bfe09){return{'model':db[_0x2bfe09['model']],'as':_0x2bfe09['as'],'attributes':_0x2bfe09['attributes']};}):[]};}):[]};}):[]:[]})[_0x4614('0x20')](function(_0x10f8b8){logger['info'](_0x4614('0x21'),_0x1bbe82);logger[_0x4614('0x10')](_0x4614('0x21'),_0x1bbe82,JSON[_0x4614('0x23')](_0x10f8b8));_0x2ebe8d(_0x10f8b8);})[_0x4614('0x15')](function(_0x11668d){logger[_0x4614('0x12')](_0x4614('0x21'),_0x11668d[_0x4614('0x14')],_0x1bbe82);_0x521651(_0x1a0f26[_0x4614('0x12')](0x1f4,_0x11668d[_0x4614('0x14')]));});});}; \ No newline at end of file +var _0xf79e=['message','result','catch','GetZohoAccount','findAll','options','attributes','limit','include','map','model','ShowZohoAccount','ZohoAccount','raw','where','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2817ae,_0x1caf58){var _0x52343d=function(_0x4689ed){while(--_0x4689ed){_0x2817ae['push'](_0x2817ae['shift']());}};_0x52343d(++_0x1caf58);}(_0xf79e,0x185));var _0xef79=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0xf79e[_0x43776a];return _0x18eb8f;};'use strict';var _=require('lodash');var util=require(_0xef79('0x0'));var moment=require(_0xef79('0x1'));var BPromise=require(_0xef79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef79('0x3'));var db=require(_0xef79('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef79('0x5'));var config=require(_0xef79('0x6'));var jayson=require(_0xef79('0x7'));var client=jayson[_0xef79('0x8')][_0xef79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa668,_0x49d0ea,_0x1e7443){return new BPromise(function(_0x4a8de0,_0x33b384){return client[_0xef79('0xa')](_0x2fa668,_0x1e7443)['then'](function(_0x42dee6){logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));logger[_0xef79('0xe')](_0xef79('0xf'),_0x49d0ea,_0xef79('0xd'),JSON[_0xef79('0x10')](_0x42dee6));if(_0x42dee6['error']){if(_0x42dee6[_0xef79('0x11')][_0xef79('0x12')]===0x1f4){logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);return _0x33b384(_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);}logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6['error']['message']);return _0x4a8de0(_0x42dee6['error']['message']);}else{logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));_0x4a8de0(_0x42dee6[_0xef79('0x14')]['message']);}})[_0xef79('0x15')](function(_0x6a689c){logger['error'](_0xef79('0xc'),_0x49d0ea,_0x6a689c);_0x33b384(_0x6a689c);});});}exports[_0xef79('0x16')]=function(_0x249a8c){var _0x406ca2=this;return new Promise(function(_0x55492c,_0x276b8b){return db['ZohoAccount'][_0xef79('0x17')]({'raw':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['where']||null:null,'attributes':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x19')]||null:null,'limit':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x1a')]||null:null,'include':_0x249a8c[_0xef79('0x18')]?_0x249a8c['options'][_0xef79('0x1b')]?_['map'](_0x249a8c['options'][_0xef79('0x1b')],function(_0x196672){return{'model':db[_0x196672['model']],'as':_0x196672['as'],'attributes':_0x196672[_0xef79('0x19')],'include':_0x196672[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x196672[_0xef79('0x1b')],function(_0x5b4017){return{'model':db[_0x5b4017[_0xef79('0x1d')]],'as':_0x5b4017['as'],'attributes':_0x5b4017[_0xef79('0x19')],'include':_0x5b4017[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x5b4017['include'],function(_0x38ec60){return{'model':db[_0x38ec60['model']],'as':_0x38ec60['as'],'attributes':_0x38ec60[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102d6f){logger[_0xef79('0xb')](_0xef79('0x16'),_0x249a8c);logger[_0xef79('0xe')](_0xef79('0x16'),_0x249a8c,JSON[_0xef79('0x10')](_0x102d6f));_0x55492c(_0x102d6f);})[_0xef79('0x15')](function(_0x2e3bbf){logger['error'](_0xef79('0x16'),_0x2e3bbf['message'],_0x249a8c);_0x276b8b(_0x406ca2[_0xef79('0x11')](0x1f4,_0x2e3bbf[_0xef79('0x13')]));});});};exports[_0xef79('0x1e')]=function(_0x34db2f){var _0x84ad52=this;return new Promise(function(_0x3bb745,_0x2d70ce){return db[_0xef79('0x1f')]['find']({'raw':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x20')]===undefined?!![]:![]:!![],'where':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x21')]||null:null,'attributes':_0x34db2f[_0xef79('0x18')]?_0x34db2f['options'][_0xef79('0x19')]||null:null,'include':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')],function(_0x360b28){return{'model':db[_0x360b28[_0xef79('0x1d')]],'as':_0x360b28['as'],'attributes':_0x360b28[_0xef79('0x19')],'include':_0x360b28[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x360b28[_0xef79('0x1b')],function(_0x41d36b){return{'model':db[_0x41d36b[_0xef79('0x1d')]],'as':_0x41d36b['as'],'attributes':_0x41d36b[_0xef79('0x19')],'include':_0x41d36b[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x41d36b[_0xef79('0x1b')],function(_0x565cf1){return{'model':db[_0x565cf1['model']],'as':_0x565cf1['as'],'attributes':_0x565cf1[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bc12a){logger['info'](_0xef79('0x1e'),_0x34db2f);logger[_0xef79('0xe')]('ShowZohoAccount',_0x34db2f,JSON[_0xef79('0x10')](_0x4bc12a));_0x3bb745(_0x4bc12a);})['catch'](function(_0x529bb4){logger['error'](_0xef79('0x1e'),_0x529bb4[_0xef79('0x13')],_0x34db2f);_0x2d70ce(_0x84ad52[_0xef79('0x11')](0x1f4,_0x529bb4[_0xef79('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 85eda9c..75d159a 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 _0x9979=['destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x9979,0x122));var _0x9997=function(_0x4766cf,_0x110454){_0x4766cf=_0x4766cf-0x0;var _0x1b0f93=_0x9979[_0x4766cf];return _0x1b0f93;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9997('0x0'));var express=require(_0x9997('0x1'));var router=express[_0x9997('0x2')]();var fs_extra=require(_0x9997('0x3'));var auth=require(_0x9997('0x4'));var interaction=require(_0x9997('0x5'));var config=require(_0x9997('0x6'));var controller=require(_0x9997('0x7'));router['get']('/',auth[_0x9997('0x8')](),controller[_0x9997('0x9')]);router[_0x9997('0xa')](_0x9997('0xb'),auth[_0x9997('0x8')](),controller[_0x9997('0xc')]);router['get'](_0x9997('0xd'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x9997('0xe'),auth[_0x9997('0x8')](),controller[_0x9997('0xf')]);router['get']('/:id/descriptions',auth[_0x9997('0x8')](),controller[_0x9997('0x10')]);router[_0x9997('0x11')]('/',auth[_0x9997('0x8')](),controller[_0x9997('0x12')]);router[_0x9997('0x13')](_0x9997('0xb'),auth[_0x9997('0x8')](),controller[_0x9997('0x14')]);router[_0x9997('0x15')](_0x9997('0xb'),auth['isAuthenticated'](),controller[_0x9997('0x16')]);module[_0x9997('0x17')]=router; \ No newline at end of file +var _0x4505=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated','index','get'];(function(_0x34c2b3,_0x46b3fc){var _0x36a73f=function(_0x2424a4){while(--_0x2424a4){_0x34c2b3['push'](_0x34c2b3['shift']());}};_0x36a73f(++_0x46b3fc);}(_0x4505,0x15d));var _0x5450=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x4505[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x5450('0x0'));var util=require('util');var path=require(_0x5450('0x1'));var timeout=require(_0x5450('0x2'));var express=require(_0x5450('0x3'));var router=express[_0x5450('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5450('0x5'));var interaction=require(_0x5450('0x6'));var config=require('../../config/environment');var controller=require(_0x5450('0x7'));router['get']('/',auth[_0x5450('0x8')](),controller[_0x5450('0x9')]);router[_0x5450('0xa')]('/:id',auth[_0x5450('0x8')](),controller[_0x5450('0xb')]);router[_0x5450('0xa')](_0x5450('0xc'),auth[_0x5450('0x8')](),controller[_0x5450('0xd')]);router[_0x5450('0xa')](_0x5450('0xe'),auth[_0x5450('0x8')](),controller[_0x5450('0xf')]);router[_0x5450('0xa')](_0x5450('0x10'),auth[_0x5450('0x8')](),controller['getDescriptions']);router[_0x5450('0x11')]('/',auth[_0x5450('0x8')](),controller[_0x5450('0x12')]);router[_0x5450('0x13')](_0x5450('0x14'),auth[_0x5450('0x8')](),controller[_0x5450('0x15')]);router[_0x5450('0x16')](_0x5450('0x14'),auth[_0x5450('0x8')](),controller['destroy']);module[_0x5450('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 18540be..71bd3b4 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 _0xa296=['exports','STRING','ENUM','contact','nothing','contact_lead','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa296,0x1d4));var _0x6a29=function(_0x53e19d,_0x604957){_0x53e19d=_0x53e19d-0x0;var _0x5ba332=_0xa296[_0x53e19d];return _0x5ba332;};'use strict';var Sequelize=require(_0x6a29('0x0'));module[_0x6a29('0x1')]={'name':{'type':Sequelize[_0x6a29('0x2')]},'moduleCreate':{'type':Sequelize[_0x6a29('0x3')]('lead',_0x6a29('0x4'),_0x6a29('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x6a29('0x3')]('contact_lead',_0x6a29('0x4'),'lead'),'defaultValue':_0x6a29('0x6')},'description':{'type':Sequelize[_0x6a29('0x2')]}}; \ No newline at end of file +var _0x84cc=['STRING','ENUM','lead','nothing','contact','contact_lead','sequelize'];(function(_0x2fe88c,_0x111aea){var _0x1156ae=function(_0x3f7fa7){while(--_0x3f7fa7){_0x2fe88c['push'](_0x2fe88c['shift']());}};_0x1156ae(++_0x111aea);}(_0x84cc,0x1c6));var _0xc84c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x84cc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc84c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc84c('0x1')]},'moduleCreate':{'type':Sequelize[_0xc84c('0x2')](_0xc84c('0x3'),'contact',_0xc84c('0x4')),'defaultValue':_0xc84c('0x3')},'moduleSearch':{'type':Sequelize[_0xc84c('0x2')]('contact_lead',_0xc84c('0x5'),_0xc84c('0x3')),'defaultValue':_0xc84c('0x6')},'description':{'type':Sequelize[_0xc84c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index b5a0dcf..bc7b909 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 _0xfc88=['apply','reject','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','ZohoConfiguration','catch','show','params','include','options','find','create','body','getFields','findOne','keys','ZohoField','length','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','limit','Content-Range'];(function(_0x3255ab,_0x663999){var _0x18b7d7=function(_0x44b616){while(--_0x44b616){_0x3255ab['push'](_0x3255ab['shift']());}};_0x18b7d7(++_0x663999);}(_0xfc88,0x115));var _0x8fc8=function(_0x3707b2,_0x238fa9){_0x3707b2=_0x3707b2-0x0;var _0x5ed5d6=_0xfc88[_0x3707b2];return _0x5ed5d6;};'use strict';var emlformat=require(_0x8fc8('0x0'));var rimraf=require(_0x8fc8('0x1'));var zipdir=require(_0x8fc8('0x2'));var jsonpatch=require(_0x8fc8('0x3'));var rp=require(_0x8fc8('0x4'));var moment=require(_0x8fc8('0x5'));var BPromise=require(_0x8fc8('0x6'));var Mustache=require(_0x8fc8('0x7'));var util=require('util');var path=require(_0x8fc8('0x8'));var sox=require(_0x8fc8('0x9'));var csv=require(_0x8fc8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fc8('0xb'));var _=require('lodash');var squel=require(_0x8fc8('0xc'));var crypto=require('crypto');var jsforce=require(_0x8fc8('0xd'));var deskjs=require(_0x8fc8('0xe'));var toCsv=require(_0x8fc8('0xa'));var querystring=require('querystring');var Papa=require(_0x8fc8('0xf'));var Redis=require('ioredis');var authService=require(_0x8fc8('0x10'));var qs=require(_0x8fc8('0x11'));var as=require(_0x8fc8('0x12'));var hardwareService=require(_0x8fc8('0x13'));var logger=require(_0x8fc8('0x14'))('api');var utils=require(_0x8fc8('0x15'));var config=require(_0x8fc8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fc8('0x17'))['db'];function respondWithStatusCode(_0x409873,_0x5b29f8){_0x5b29f8=_0x5b29f8||0xcc;return function(_0x740486){if(_0x740486){return _0x409873[_0x8fc8('0x18')](_0x5b29f8);}return _0x409873[_0x8fc8('0x19')](_0x5b29f8)['end']();};}function respondWithResult(_0x195ad1,_0x37618d){_0x37618d=_0x37618d||0xc8;return function(_0x4be489){if(_0x4be489){return _0x195ad1[_0x8fc8('0x19')](_0x37618d)[_0x8fc8('0x1a')](_0x4be489);}};}function respondWithFilteredResult(_0x28ecaa,_0x45fbc9){return function(_0x3868d5){if(_0x3868d5){var _0x3c6007=typeof _0x45fbc9['offset']===_0x8fc8('0x1b')&&typeof _0x45fbc9['limit']===_0x8fc8('0x1b');var _0x48947f=_0x3868d5['count'];var _0x5b51ea=_0x3c6007?0x0:_0x45fbc9[_0x8fc8('0x1c')];var _0x274276=_0x3c6007?_0x3868d5['count']:_0x45fbc9['offset']+_0x45fbc9[_0x8fc8('0x1d')];var _0x3fc374;if(_0x274276>=_0x48947f){_0x274276=_0x48947f;_0x3fc374=0xc8;}else{_0x3fc374=0xce;}_0x28ecaa[_0x8fc8('0x19')](_0x3fc374);return _0x28ecaa['set'](_0x8fc8('0x1e'),_0x5b51ea+'-'+_0x274276+'/'+_0x48947f)[_0x8fc8('0x1a')](_0x3868d5);}return null;};}function patchUpdates(_0x15c87a){return function(_0x4e9309){try{jsonpatch[_0x8fc8('0x1f')](_0x4e9309,_0x15c87a,!![]);}catch(_0x2b8cea){return BPromise[_0x8fc8('0x20')](_0x2b8cea);}return _0x4e9309['save']();};}function saveUpdates(_0x41bba0,_0x116bb6){return function(_0x5efe37){if(_0x5efe37){return _0x5efe37[_0x8fc8('0x21')](_0x41bba0)[_0x8fc8('0x22')](function(_0x32b0d1){return _0x32b0d1;});}return null;};}function removeEntity(_0x16984e,_0x32f897){return function(_0x6baa64){if(_0x6baa64){return _0x6baa64[_0x8fc8('0x23')]()[_0x8fc8('0x22')](function(){_0x16984e[_0x8fc8('0x19')](0xcc)[_0x8fc8('0x24')]();});}};}function handleEntityNotFound(_0x150690,_0x3b236e){return function(_0x3cd8cc){if(!_0x3cd8cc){_0x150690[_0x8fc8('0x18')](0x194);}return _0x3cd8cc;};}function handleError(_0x35278f,_0x285dd4){_0x285dd4=_0x285dd4||0x1f4;return function(_0x5d9991){logger[_0x8fc8('0x25')](_0x5d9991['stack']);if(_0x5d9991[_0x8fc8('0x26')]){delete _0x5d9991[_0x8fc8('0x26')];}_0x35278f[_0x8fc8('0x19')](_0x285dd4)[_0x8fc8('0x27')](_0x5d9991);};}exports['index']=function(_0x3469ef,_0x3a4b89){var _0x2cd727={},_0x5ea6bf={},_0x2f0703={'count':0x0,'rows':[]};var _0x45e035=_[_0x8fc8('0x28')](db['ZohoConfiguration'][_0x8fc8('0x29')],function(_0x378310){return{'name':_0x378310[_0x8fc8('0x2a')],'type':_0x378310[_0x8fc8('0x2b')][_0x8fc8('0x2c')]};});_0x5ea6bf['model']=_[_0x8fc8('0x28')](_0x45e035,_0x8fc8('0x26'));_0x5ea6bf[_0x8fc8('0x2d')]=_['keys'](_0x3469ef[_0x8fc8('0x2d')]);_0x5ea6bf[_0x8fc8('0x2e')]=_[_0x8fc8('0x2f')](_0x5ea6bf[_0x8fc8('0x30')],_0x5ea6bf[_0x8fc8('0x2d')]);_0x2cd727['attributes']=_[_0x8fc8('0x2f')](_0x5ea6bf['model'],qs[_0x8fc8('0x31')](_0x3469ef['query'][_0x8fc8('0x31')]));_0x2cd727[_0x8fc8('0x32')]=_0x2cd727[_0x8fc8('0x32')]['length']?_0x2cd727[_0x8fc8('0x32')]:_0x5ea6bf[_0x8fc8('0x30')];if(!_0x3469ef['query']['hasOwnProperty'](_0x8fc8('0x33'))){_0x2cd727[_0x8fc8('0x1d')]=qs[_0x8fc8('0x1d')](_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x1d')]);_0x2cd727[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}_0x2cd727[_0x8fc8('0x34')]=qs[_0x8fc8('0x35')](_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x35')]);_0x2cd727[_0x8fc8('0x36')]=qs['filters'](_[_0x8fc8('0x37')](_0x3469ef[_0x8fc8('0x2d')],_0x5ea6bf[_0x8fc8('0x2e')]),_0x45e035);if(_0x3469ef['query'][_0x8fc8('0x38')]){_0x2cd727[_0x8fc8('0x36')]=_[_0x8fc8('0x39')](_0x2cd727['where'],{'$or':_['map'](_0x45e035,function(_0x2d8d1a){if(_0x2d8d1a[_0x8fc8('0x2b')]!==_0x8fc8('0x3a')){var _0x46152f={};_0x46152f[_0x2d8d1a['name']]={'$like':'%'+_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x38')]+'%'};return _0x46152f;}})});}_0x2cd727=_[_0x8fc8('0x39')]({},_0x2cd727,_0x3469ef['options']);var _0xcc8ef8={'where':_0x2cd727[_0x8fc8('0x36')]};return db['ZohoConfiguration']['count'](_0xcc8ef8)['then'](function(_0x10e485){_0x2f0703[_0x8fc8('0x3b')]=_0x10e485;if(_0x3469ef[_0x8fc8('0x2d')]['includeAll']){_0x2cd727['include']=[{'all':!![]}];}return db[_0x8fc8('0x3c')]['findAll'](_0x2cd727);})[_0x8fc8('0x22')](function(_0x77e85b){_0x2f0703['rows']=_0x77e85b;return _0x2f0703;})[_0x8fc8('0x22')](respondWithFilteredResult(_0x3a4b89,_0x2cd727))[_0x8fc8('0x3d')](handleError(_0x3a4b89,null));};exports[_0x8fc8('0x3e')]=function(_0x4e302f,_0x1d14e2){var _0x526f2b={'raw':![],'where':{'id':_0x4e302f[_0x8fc8('0x3f')]['id']}},_0x3dd2cf={};_0x3dd2cf[_0x8fc8('0x30')]=_['keys'](db[_0x8fc8('0x3c')][_0x8fc8('0x29')]);_0x3dd2cf[_0x8fc8('0x2d')]=_['keys'](_0x4e302f[_0x8fc8('0x2d')]);_0x3dd2cf['filters']=_[_0x8fc8('0x2f')](_0x3dd2cf[_0x8fc8('0x30')],_0x3dd2cf[_0x8fc8('0x2d')]);_0x526f2b[_0x8fc8('0x32')]=_[_0x8fc8('0x2f')](_0x3dd2cf['model'],qs[_0x8fc8('0x31')](_0x4e302f[_0x8fc8('0x2d')][_0x8fc8('0x31')]));_0x526f2b['attributes']=_0x526f2b['attributes']['length']?_0x526f2b[_0x8fc8('0x32')]:_0x3dd2cf[_0x8fc8('0x30')];if(_0x4e302f['query']['includeAll']){_0x526f2b[_0x8fc8('0x40')]=[{'all':!![]}];}_0x526f2b=_['merge']({},_0x526f2b,_0x4e302f[_0x8fc8('0x41')]);return db[_0x8fc8('0x3c')][_0x8fc8('0x42')](_0x526f2b)['then'](handleEntityNotFound(_0x1d14e2,null))[_0x8fc8('0x22')](respondWithResult(_0x1d14e2,null))['catch'](handleError(_0x1d14e2,null));};exports[_0x8fc8('0x43')]=function(_0x5eb64b,_0x7b5644){return db[_0x8fc8('0x3c')][_0x8fc8('0x43')](_0x5eb64b[_0x8fc8('0x44')],{})[_0x8fc8('0x22')](respondWithResult(_0x7b5644,0xc9))[_0x8fc8('0x3d')](handleError(_0x7b5644,null));};exports[_0x8fc8('0x21')]=function(_0x4325d4,_0x404259){if(_0x4325d4[_0x8fc8('0x44')]['id']){delete _0x4325d4[_0x8fc8('0x44')]['id'];}return db['ZohoConfiguration'][_0x8fc8('0x42')]({'where':{'id':_0x4325d4[_0x8fc8('0x3f')]['id']}})[_0x8fc8('0x22')](handleEntityNotFound(_0x404259,null))[_0x8fc8('0x22')](saveUpdates(_0x4325d4['body'],null))[_0x8fc8('0x22')](respondWithResult(_0x404259,null))[_0x8fc8('0x3d')](handleError(_0x404259,null));};exports[_0x8fc8('0x23')]=function(_0x146076,_0x5390b8){return db['ZohoConfiguration']['find']({'where':{'id':_0x146076[_0x8fc8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5390b8,null))[_0x8fc8('0x22')](removeEntity(_0x5390b8,null))[_0x8fc8('0x3d')](handleError(_0x5390b8,null));};exports[_0x8fc8('0x45')]=function(_0x5c1bec,_0x5ad070,_0x3b9dfe){var _0x332eeb={};var _0x5d1262={};var _0x1f80fd;var _0x577a27;return db['ZohoConfiguration'][_0x8fc8('0x46')]({'where':{'id':_0x5c1bec[_0x8fc8('0x3f')]['id']}})[_0x8fc8('0x22')](handleEntityNotFound(_0x5ad070,null))['then'](function(_0x55f397){if(_0x55f397){_0x1f80fd=_0x55f397;_0x5d1262[_0x8fc8('0x30')]=_[_0x8fc8('0x47')](db[_0x8fc8('0x48')][_0x8fc8('0x29')]);_0x5d1262[_0x8fc8('0x2d')]=_[_0x8fc8('0x47')](_0x5c1bec[_0x8fc8('0x2d')]);_0x5d1262['filters']=_['intersection'](_0x5d1262['model'],_0x5d1262['query']);_0x332eeb[_0x8fc8('0x32')]=_[_0x8fc8('0x2f')](_0x5d1262['model'],qs[_0x8fc8('0x31')](_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x31')]));_0x332eeb[_0x8fc8('0x32')]=_0x332eeb[_0x8fc8('0x32')][_0x8fc8('0x49')]?_0x332eeb[_0x8fc8('0x32')]:_0x5d1262[_0x8fc8('0x30')];_0x332eeb['order']=qs[_0x8fc8('0x35')](_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x35')]);_0x332eeb[_0x8fc8('0x36')]=qs[_0x8fc8('0x2e')](_[_0x8fc8('0x37')](_0x5c1bec['query'],_0x5d1262[_0x8fc8('0x2e')]));if(_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x38')]){_0x332eeb['where']=_['merge'](_0x332eeb[_0x8fc8('0x36')],{'$or':_['map'](_0x332eeb[_0x8fc8('0x32')],function(_0xd5aec2){var _0x4b42b8={};_0x4b42b8[_0xd5aec2]={'$like':'%'+_0x5c1bec['query'][_0x8fc8('0x38')]+'%'};return _0x4b42b8;})});}_0x332eeb=_[_0x8fc8('0x39')]({},_0x332eeb,_0x5c1bec[_0x8fc8('0x41')]);return _0x1f80fd[_0x8fc8('0x45')](_0x332eeb);}})[_0x8fc8('0x22')](function(_0x295b95){if(_0x295b95){_0x577a27=_0x295b95[_0x8fc8('0x49')];if(!_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x4a')]('nolimit')){_0x332eeb['limit']=qs[_0x8fc8('0x1d')](_0x5c1bec[_0x8fc8('0x2d')]['limit']);_0x332eeb[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}return _0x1f80fd[_0x8fc8('0x45')](_0x332eeb);}})[_0x8fc8('0x22')](function(_0xc6ef1e){if(_0xc6ef1e){return _0xc6ef1e?{'count':_0x577a27,'rows':_0xc6ef1e}:null;}})['then'](respondWithResult(_0x5ad070,null))[_0x8fc8('0x3d')](handleError(_0x5ad070,null));};exports[_0x8fc8('0x4b')]=function(_0x32eaa8,_0x385d04,_0x5bd28d){var _0x3a2c4c={};var _0x3efc81={};var _0x401279;var _0x29e39c;return db[_0x8fc8('0x3c')][_0x8fc8('0x46')]({'where':{'id':_0x32eaa8[_0x8fc8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x385d04,null))[_0x8fc8('0x22')](function(_0x302abe){if(_0x302abe){_0x401279=_0x302abe;_0x3efc81[_0x8fc8('0x30')]=_[_0x8fc8('0x47')](db['ZohoField']['rawAttributes']);_0x3efc81[_0x8fc8('0x2d')]=_[_0x8fc8('0x47')](_0x32eaa8[_0x8fc8('0x2d')]);_0x3efc81['filters']=_['intersection'](_0x3efc81[_0x8fc8('0x30')],_0x3efc81[_0x8fc8('0x2d')]);_0x3a2c4c['attributes']=_['intersection'](_0x3efc81[_0x8fc8('0x30')],qs[_0x8fc8('0x31')](_0x32eaa8['query'][_0x8fc8('0x31')]));_0x3a2c4c[_0x8fc8('0x32')]=_0x3a2c4c[_0x8fc8('0x32')][_0x8fc8('0x49')]?_0x3a2c4c[_0x8fc8('0x32')]:_0x3efc81[_0x8fc8('0x30')];_0x3a2c4c[_0x8fc8('0x34')]=qs['sort'](_0x32eaa8['query'][_0x8fc8('0x35')]);_0x3a2c4c[_0x8fc8('0x36')]=qs[_0x8fc8('0x2e')](_[_0x8fc8('0x37')](_0x32eaa8[_0x8fc8('0x2d')],_0x3efc81['filters']));if(_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x38')]){_0x3a2c4c['where']=_[_0x8fc8('0x39')](_0x3a2c4c['where'],{'$or':_[_0x8fc8('0x28')](_0x3a2c4c[_0x8fc8('0x32')],function(_0x46b68a){var _0x564515={};_0x564515[_0x46b68a]={'$like':'%'+_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x38')]+'%'};return _0x564515;})});}_0x3a2c4c=_['merge']({},_0x3a2c4c,_0x32eaa8[_0x8fc8('0x41')]);return _0x401279[_0x8fc8('0x4b')](_0x3a2c4c);}})[_0x8fc8('0x22')](function(_0x132087){if(_0x132087){_0x29e39c=_0x132087[_0x8fc8('0x49')];if(!_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x4a')](_0x8fc8('0x33'))){_0x3a2c4c[_0x8fc8('0x1d')]=qs['limit'](_0x32eaa8[_0x8fc8('0x2d')]['limit']);_0x3a2c4c[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}return _0x401279[_0x8fc8('0x4b')](_0x3a2c4c);}})[_0x8fc8('0x22')](function(_0x5e7d9e){if(_0x5e7d9e){return _0x5e7d9e?{'count':_0x29e39c,'rows':_0x5e7d9e}:null;}})[_0x8fc8('0x22')](respondWithResult(_0x385d04,null))[_0x8fc8('0x3d')](handleError(_0x385d04,null));};exports['getDescriptions']=function(_0x5a177a,_0x4621ac,_0x58b3f7){var _0x44e732={};var _0x2e2148={};var _0x9523b5;var _0x100b6c;return db[_0x8fc8('0x3c')]['findOne']({'where':{'id':_0x5a177a[_0x8fc8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4621ac,null))[_0x8fc8('0x22')](function(_0x12d0ed){if(_0x12d0ed){_0x9523b5=_0x12d0ed;_0x2e2148[_0x8fc8('0x30')]=_[_0x8fc8('0x47')](db[_0x8fc8('0x48')][_0x8fc8('0x29')]);_0x2e2148[_0x8fc8('0x2d')]=_[_0x8fc8('0x47')](_0x5a177a[_0x8fc8('0x2d')]);_0x2e2148['filters']=_[_0x8fc8('0x2f')](_0x2e2148[_0x8fc8('0x30')],_0x2e2148[_0x8fc8('0x2d')]);_0x44e732[_0x8fc8('0x32')]=_[_0x8fc8('0x2f')](_0x2e2148[_0x8fc8('0x30')],qs[_0x8fc8('0x31')](_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x31')]));_0x44e732['attributes']=_0x44e732['attributes'][_0x8fc8('0x49')]?_0x44e732[_0x8fc8('0x32')]:_0x2e2148[_0x8fc8('0x30')];_0x44e732[_0x8fc8('0x34')]=qs[_0x8fc8('0x35')](_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x35')]);_0x44e732['where']=qs[_0x8fc8('0x2e')](_[_0x8fc8('0x37')](_0x5a177a[_0x8fc8('0x2d')],_0x2e2148['filters']));if(_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x38')]){_0x44e732[_0x8fc8('0x36')]=_[_0x8fc8('0x39')](_0x44e732[_0x8fc8('0x36')],{'$or':_['map'](_0x44e732[_0x8fc8('0x32')],function(_0xaddc5a){var _0x137771={};_0x137771[_0xaddc5a]={'$like':'%'+_0x5a177a['query'][_0x8fc8('0x38')]+'%'};return _0x137771;})});}_0x44e732=_[_0x8fc8('0x39')]({},_0x44e732,_0x5a177a['options']);return _0x9523b5[_0x8fc8('0x4c')](_0x44e732);}})['then'](function(_0x2a683b){if(_0x2a683b){_0x100b6c=_0x2a683b[_0x8fc8('0x49')];if(!_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x4a')](_0x8fc8('0x33'))){_0x44e732[_0x8fc8('0x1d')]=qs['limit'](_0x5a177a['query'][_0x8fc8('0x1d')]);_0x44e732[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}return _0x9523b5[_0x8fc8('0x4c')](_0x44e732);}})[_0x8fc8('0x22')](function(_0x58f27c){if(_0x58f27c){return _0x58f27c?{'count':_0x100b6c,'rows':_0x58f27c}:null;}})[_0x8fc8('0x22')](respondWithResult(_0x4621ac,null))['catch'](handleError(_0x4621ac,null));}; \ No newline at end of file +var _0xbe3f=['body','getFields','findOne','order','pick','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','then','includeAll','findAll','rows','catch','params','keys','include','find','create'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xbe3f,0x1e8));var _0xfbe3=function(_0x1d6537,_0x5aab59){_0x1d6537=_0x1d6537-0x0;var _0x1acbfc=_0xbe3f[_0x1d6537];return _0x1acbfc;};'use strict';var emlformat=require(_0xfbe3('0x0'));var rimraf=require(_0xfbe3('0x1'));var zipdir=require(_0xfbe3('0x2'));var jsonpatch=require(_0xfbe3('0x3'));var rp=require(_0xfbe3('0x4'));var moment=require(_0xfbe3('0x5'));var BPromise=require(_0xfbe3('0x6'));var Mustache=require(_0xfbe3('0x7'));var util=require(_0xfbe3('0x8'));var path=require(_0xfbe3('0x9'));var sox=require(_0xfbe3('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbe3('0xb'));var squel=require('squel');var crypto=require(_0xfbe3('0xc'));var jsforce=require(_0xfbe3('0xd'));var deskjs=require(_0xfbe3('0xe'));var toCsv=require(_0xfbe3('0xf'));var querystring=require('querystring');var Papa=require(_0xfbe3('0x10'));var Redis=require(_0xfbe3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbe3('0x12'));var hardwareService=require(_0xfbe3('0x13'));var logger=require(_0xfbe3('0x14'))(_0xfbe3('0x15'));var utils=require(_0xfbe3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfbe3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ccf3e,_0x4136ad){_0x4136ad=_0x4136ad||0xcc;return function(_0x2e59f9){if(_0x2e59f9){return _0x2ccf3e[_0xfbe3('0x18')](_0x4136ad);}return _0x2ccf3e[_0xfbe3('0x19')](_0x4136ad)[_0xfbe3('0x1a')]();};}function respondWithResult(_0xde866e,_0x4e53e8){_0x4e53e8=_0x4e53e8||0xc8;return function(_0x2e9922){if(_0x2e9922){return _0xde866e[_0xfbe3('0x19')](_0x4e53e8)[_0xfbe3('0x1b')](_0x2e9922);}};}function respondWithFilteredResult(_0x2bcaaa,_0x3bbcb2){return function(_0x421029){if(_0x421029){var _0x67bf03=typeof _0x3bbcb2[_0xfbe3('0x1c')]===_0xfbe3('0x1d')&&typeof _0x3bbcb2[_0xfbe3('0x1e')]===_0xfbe3('0x1d');var _0x46bc63=_0x421029['count'];var _0x524d40=_0x67bf03?0x0:_0x3bbcb2[_0xfbe3('0x1c')];var _0x360e6a=_0x67bf03?_0x421029[_0xfbe3('0x1f')]:_0x3bbcb2['offset']+_0x3bbcb2[_0xfbe3('0x1e')];var _0x1188b1;if(_0x360e6a>=_0x46bc63){_0x360e6a=_0x46bc63;_0x1188b1=0xc8;}else{_0x1188b1=0xce;}_0x2bcaaa['status'](_0x1188b1);return _0x2bcaaa[_0xfbe3('0x20')](_0xfbe3('0x21'),_0x524d40+'-'+_0x360e6a+'/'+_0x46bc63)[_0xfbe3('0x1b')](_0x421029);}return null;};}function patchUpdates(_0x2e7083){return function(_0x146545){try{jsonpatch[_0xfbe3('0x22')](_0x146545,_0x2e7083,!![]);}catch(_0x524d1e){return BPromise['reject'](_0x524d1e);}return _0x146545[_0xfbe3('0x23')]();};}function saveUpdates(_0x7b9a73,_0x4218ec){return function(_0x17e046){if(_0x17e046){return _0x17e046[_0xfbe3('0x24')](_0x7b9a73)['then'](function(_0x1018c8){return _0x1018c8;});}return null;};}function removeEntity(_0x368053,_0x54d698){return function(_0x37735d){if(_0x37735d){return _0x37735d[_0xfbe3('0x25')]()['then'](function(){_0x368053[_0xfbe3('0x19')](0xcc)[_0xfbe3('0x1a')]();});}};}function handleEntityNotFound(_0x1af46b,_0x46deb6){return function(_0x263c70){if(!_0x263c70){_0x1af46b['sendStatus'](0x194);}return _0x263c70;};}function handleError(_0x1a7681,_0x433fb9){_0x433fb9=_0x433fb9||0x1f4;return function(_0x5907b8){logger[_0xfbe3('0x26')](_0x5907b8['stack']);if(_0x5907b8[_0xfbe3('0x27')]){delete _0x5907b8[_0xfbe3('0x27')];}_0x1a7681[_0xfbe3('0x19')](_0x433fb9)[_0xfbe3('0x28')](_0x5907b8);};}exports[_0xfbe3('0x29')]=function(_0x581038,_0x1252b1){var _0x2d95d7={},_0xeeee1d={},_0x3d7982={'count':0x0,'rows':[]};var _0xc18f17=_[_0xfbe3('0x2a')](db[_0xfbe3('0x2b')][_0xfbe3('0x2c')],function(_0x596d0d){return{'name':_0x596d0d[_0xfbe3('0x2d')],'type':_0x596d0d[_0xfbe3('0x2e')]['key']};});_0xeeee1d[_0xfbe3('0x2f')]=_[_0xfbe3('0x2a')](_0xc18f17,'name');_0xeeee1d[_0xfbe3('0x30')]=_['keys'](_0x581038[_0xfbe3('0x30')]);_0xeeee1d['filters']=_[_0xfbe3('0x31')](_0xeeee1d['model'],_0xeeee1d[_0xfbe3('0x30')]);_0x2d95d7[_0xfbe3('0x32')]=_[_0xfbe3('0x31')](_0xeeee1d[_0xfbe3('0x2f')],qs[_0xfbe3('0x33')](_0x581038[_0xfbe3('0x30')][_0xfbe3('0x33')]));_0x2d95d7[_0xfbe3('0x32')]=_0x2d95d7[_0xfbe3('0x32')][_0xfbe3('0x34')]?_0x2d95d7[_0xfbe3('0x32')]:_0xeeee1d[_0xfbe3('0x2f')];if(!_0x581038['query'][_0xfbe3('0x35')](_0xfbe3('0x36'))){_0x2d95d7['limit']=qs[_0xfbe3('0x1e')](_0x581038[_0xfbe3('0x30')][_0xfbe3('0x1e')]);_0x2d95d7[_0xfbe3('0x1c')]=qs['offset'](_0x581038['query'][_0xfbe3('0x1c')]);}_0x2d95d7['order']=qs[_0xfbe3('0x37')](_0x581038[_0xfbe3('0x30')][_0xfbe3('0x37')]);_0x2d95d7[_0xfbe3('0x38')]=qs['filters'](_['pick'](_0x581038['query'],_0xeeee1d[_0xfbe3('0x39')]),_0xc18f17);if(_0x581038[_0xfbe3('0x30')]['filter']){_0x2d95d7[_0xfbe3('0x38')]=_[_0xfbe3('0x3a')](_0x2d95d7[_0xfbe3('0x38')],{'$or':_[_0xfbe3('0x2a')](_0xc18f17,function(_0x206019){if(_0x206019[_0xfbe3('0x2e')]!==_0xfbe3('0x3b')){var _0x298446={};_0x298446[_0x206019['name']]={'$like':'%'+_0x581038[_0xfbe3('0x30')][_0xfbe3('0x3c')]+'%'};return _0x298446;}})});}_0x2d95d7=_[_0xfbe3('0x3a')]({},_0x2d95d7,_0x581038[_0xfbe3('0x3d')]);var _0x31495={'where':_0x2d95d7[_0xfbe3('0x38')]};return db['ZohoConfiguration'][_0xfbe3('0x1f')](_0x31495)[_0xfbe3('0x3e')](function(_0x5a8d17){_0x3d7982[_0xfbe3('0x1f')]=_0x5a8d17;if(_0x581038[_0xfbe3('0x30')][_0xfbe3('0x3f')]){_0x2d95d7['include']=[{'all':!![]}];}return db[_0xfbe3('0x2b')][_0xfbe3('0x40')](_0x2d95d7);})['then'](function(_0x46b0fa){_0x3d7982[_0xfbe3('0x41')]=_0x46b0fa;return _0x3d7982;})[_0xfbe3('0x3e')](respondWithFilteredResult(_0x1252b1,_0x2d95d7))[_0xfbe3('0x42')](handleError(_0x1252b1,null));};exports['show']=function(_0x2e3e16,_0x278d07){var _0x67d98d={'raw':![],'where':{'id':_0x2e3e16[_0xfbe3('0x43')]['id']}},_0x175a56={};_0x175a56[_0xfbe3('0x2f')]=_[_0xfbe3('0x44')](db[_0xfbe3('0x2b')]['rawAttributes']);_0x175a56['query']=_[_0xfbe3('0x44')](_0x2e3e16[_0xfbe3('0x30')]);_0x175a56['filters']=_[_0xfbe3('0x31')](_0x175a56[_0xfbe3('0x2f')],_0x175a56[_0xfbe3('0x30')]);_0x67d98d[_0xfbe3('0x32')]=_[_0xfbe3('0x31')](_0x175a56[_0xfbe3('0x2f')],qs[_0xfbe3('0x33')](_0x2e3e16['query'][_0xfbe3('0x33')]));_0x67d98d[_0xfbe3('0x32')]=_0x67d98d[_0xfbe3('0x32')]['length']?_0x67d98d[_0xfbe3('0x32')]:_0x175a56[_0xfbe3('0x2f')];if(_0x2e3e16['query'][_0xfbe3('0x3f')]){_0x67d98d[_0xfbe3('0x45')]=[{'all':!![]}];}_0x67d98d=_['merge']({},_0x67d98d,_0x2e3e16[_0xfbe3('0x3d')]);return db[_0xfbe3('0x2b')][_0xfbe3('0x46')](_0x67d98d)[_0xfbe3('0x3e')](handleEntityNotFound(_0x278d07,null))['then'](respondWithResult(_0x278d07,null))[_0xfbe3('0x42')](handleError(_0x278d07,null));};exports['create']=function(_0x53cec5,_0x16cec4){return db['ZohoConfiguration'][_0xfbe3('0x47')](_0x53cec5['body'],{})[_0xfbe3('0x3e')](respondWithResult(_0x16cec4,0xc9))['catch'](handleError(_0x16cec4,null));};exports[_0xfbe3('0x24')]=function(_0x3b34c3,_0x3ed19a){if(_0x3b34c3[_0xfbe3('0x48')]['id']){delete _0x3b34c3[_0xfbe3('0x48')]['id'];}return db['ZohoConfiguration'][_0xfbe3('0x46')]({'where':{'id':_0x3b34c3[_0xfbe3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ed19a,null))[_0xfbe3('0x3e')](saveUpdates(_0x3b34c3[_0xfbe3('0x48')],null))[_0xfbe3('0x3e')](respondWithResult(_0x3ed19a,null))[_0xfbe3('0x42')](handleError(_0x3ed19a,null));};exports[_0xfbe3('0x25')]=function(_0xf8f883,_0xc48ed0){return db['ZohoConfiguration']['find']({'where':{'id':_0xf8f883[_0xfbe3('0x43')]['id']}})[_0xfbe3('0x3e')](handleEntityNotFound(_0xc48ed0,null))[_0xfbe3('0x3e')](removeEntity(_0xc48ed0,null))[_0xfbe3('0x42')](handleError(_0xc48ed0,null));};exports[_0xfbe3('0x49')]=function(_0x1c201b,_0x4942fd,_0x244b18){var _0x4680b9={};var _0x158528={};var _0x30b792;var _0x532d64;return db['ZohoConfiguration'][_0xfbe3('0x4a')]({'where':{'id':_0x1c201b[_0xfbe3('0x43')]['id']}})[_0xfbe3('0x3e')](handleEntityNotFound(_0x4942fd,null))['then'](function(_0x516b3d){if(_0x516b3d){_0x30b792=_0x516b3d;_0x158528['model']=_[_0xfbe3('0x44')](db['ZohoField'][_0xfbe3('0x2c')]);_0x158528[_0xfbe3('0x30')]=_[_0xfbe3('0x44')](_0x1c201b[_0xfbe3('0x30')]);_0x158528[_0xfbe3('0x39')]=_[_0xfbe3('0x31')](_0x158528['model'],_0x158528[_0xfbe3('0x30')]);_0x4680b9[_0xfbe3('0x32')]=_[_0xfbe3('0x31')](_0x158528[_0xfbe3('0x2f')],qs['fields'](_0x1c201b['query'][_0xfbe3('0x33')]));_0x4680b9[_0xfbe3('0x32')]=_0x4680b9[_0xfbe3('0x32')][_0xfbe3('0x34')]?_0x4680b9[_0xfbe3('0x32')]:_0x158528[_0xfbe3('0x2f')];_0x4680b9[_0xfbe3('0x4b')]=qs[_0xfbe3('0x37')](_0x1c201b['query'][_0xfbe3('0x37')]);_0x4680b9[_0xfbe3('0x38')]=qs[_0xfbe3('0x39')](_[_0xfbe3('0x4c')](_0x1c201b[_0xfbe3('0x30')],_0x158528['filters']));if(_0x1c201b[_0xfbe3('0x30')][_0xfbe3('0x3c')]){_0x4680b9['where']=_['merge'](_0x4680b9['where'],{'$or':_[_0xfbe3('0x2a')](_0x4680b9[_0xfbe3('0x32')],function(_0x2f7285){var _0x3ce291={};_0x3ce291[_0x2f7285]={'$like':'%'+_0x1c201b['query'][_0xfbe3('0x3c')]+'%'};return _0x3ce291;})});}_0x4680b9=_[_0xfbe3('0x3a')]({},_0x4680b9,_0x1c201b[_0xfbe3('0x3d')]);return _0x30b792[_0xfbe3('0x49')](_0x4680b9);}})[_0xfbe3('0x3e')](function(_0x5ebbe0){if(_0x5ebbe0){_0x532d64=_0x5ebbe0['length'];if(!_0x1c201b[_0xfbe3('0x30')][_0xfbe3('0x35')](_0xfbe3('0x36'))){_0x4680b9[_0xfbe3('0x1e')]=qs[_0xfbe3('0x1e')](_0x1c201b[_0xfbe3('0x30')]['limit']);_0x4680b9['offset']=qs[_0xfbe3('0x1c')](_0x1c201b[_0xfbe3('0x30')][_0xfbe3('0x1c')]);}return _0x30b792[_0xfbe3('0x49')](_0x4680b9);}})[_0xfbe3('0x3e')](function(_0x16a859){if(_0x16a859){return _0x16a859?{'count':_0x532d64,'rows':_0x16a859}:null;}})['then'](respondWithResult(_0x4942fd,null))['catch'](handleError(_0x4942fd,null));};exports[_0xfbe3('0x4d')]=function(_0x5603b1,_0x3903a9,_0x2142d7){var _0x13478b={};var _0x5b8268={};var _0x166124;var _0x12b69b;return db[_0xfbe3('0x2b')][_0xfbe3('0x4a')]({'where':{'id':_0x5603b1['params']['id']}})[_0xfbe3('0x3e')](handleEntityNotFound(_0x3903a9,null))['then'](function(_0x585aa3){if(_0x585aa3){_0x166124=_0x585aa3;_0x5b8268[_0xfbe3('0x2f')]=_['keys'](db[_0xfbe3('0x4e')][_0xfbe3('0x2c')]);_0x5b8268[_0xfbe3('0x30')]=_['keys'](_0x5603b1['query']);_0x5b8268[_0xfbe3('0x39')]=_[_0xfbe3('0x31')](_0x5b8268[_0xfbe3('0x2f')],_0x5b8268['query']);_0x13478b[_0xfbe3('0x32')]=_[_0xfbe3('0x31')](_0x5b8268[_0xfbe3('0x2f')],qs['fields'](_0x5603b1[_0xfbe3('0x30')][_0xfbe3('0x33')]));_0x13478b[_0xfbe3('0x32')]=_0x13478b[_0xfbe3('0x32')][_0xfbe3('0x34')]?_0x13478b[_0xfbe3('0x32')]:_0x5b8268[_0xfbe3('0x2f')];_0x13478b[_0xfbe3('0x4b')]=qs['sort'](_0x5603b1[_0xfbe3('0x30')]['sort']);_0x13478b[_0xfbe3('0x38')]=qs[_0xfbe3('0x39')](_['pick'](_0x5603b1[_0xfbe3('0x30')],_0x5b8268[_0xfbe3('0x39')]));if(_0x5603b1[_0xfbe3('0x30')]['filter']){_0x13478b[_0xfbe3('0x38')]=_['merge'](_0x13478b[_0xfbe3('0x38')],{'$or':_[_0xfbe3('0x2a')](_0x13478b['attributes'],function(_0x57c8cd){var _0x3be1a3={};_0x3be1a3[_0x57c8cd]={'$like':'%'+_0x5603b1[_0xfbe3('0x30')]['filter']+'%'};return _0x3be1a3;})});}_0x13478b=_['merge']({},_0x13478b,_0x5603b1[_0xfbe3('0x3d')]);return _0x166124[_0xfbe3('0x4d')](_0x13478b);}})[_0xfbe3('0x3e')](function(_0x50567f){if(_0x50567f){_0x12b69b=_0x50567f[_0xfbe3('0x34')];if(!_0x5603b1['query'][_0xfbe3('0x35')](_0xfbe3('0x36'))){_0x13478b['limit']=qs[_0xfbe3('0x1e')](_0x5603b1['query']['limit']);_0x13478b[_0xfbe3('0x1c')]=qs[_0xfbe3('0x1c')](_0x5603b1[_0xfbe3('0x30')][_0xfbe3('0x1c')]);}return _0x166124[_0xfbe3('0x4d')](_0x13478b);}})[_0xfbe3('0x3e')](function(_0x41993d){if(_0x41993d){return _0x41993d?{'count':_0x12b69b,'rows':_0x41993d}:null;}})[_0xfbe3('0x3e')](respondWithResult(_0x3903a9,null))[_0xfbe3('0x42')](handleError(_0x3903a9,null));};exports[_0xfbe3('0x4f')]=function(_0x5ebe0c,_0x377077,_0x24c806){var _0xcadc45={};var _0x348ff5={};var _0x4bf7f0;var _0x4f4416;return db['ZohoConfiguration'][_0xfbe3('0x4a')]({'where':{'id':_0x5ebe0c[_0xfbe3('0x43')]['id']}})[_0xfbe3('0x3e')](handleEntityNotFound(_0x377077,null))[_0xfbe3('0x3e')](function(_0x2ddc26){if(_0x2ddc26){_0x4bf7f0=_0x2ddc26;_0x348ff5['model']=_[_0xfbe3('0x44')](db[_0xfbe3('0x4e')][_0xfbe3('0x2c')]);_0x348ff5[_0xfbe3('0x30')]=_['keys'](_0x5ebe0c[_0xfbe3('0x30')]);_0x348ff5[_0xfbe3('0x39')]=_['intersection'](_0x348ff5[_0xfbe3('0x2f')],_0x348ff5[_0xfbe3('0x30')]);_0xcadc45[_0xfbe3('0x32')]=_[_0xfbe3('0x31')](_0x348ff5[_0xfbe3('0x2f')],qs[_0xfbe3('0x33')](_0x5ebe0c['query']['fields']));_0xcadc45[_0xfbe3('0x32')]=_0xcadc45['attributes']['length']?_0xcadc45['attributes']:_0x348ff5[_0xfbe3('0x2f')];_0xcadc45[_0xfbe3('0x4b')]=qs[_0xfbe3('0x37')](_0x5ebe0c[_0xfbe3('0x30')]['sort']);_0xcadc45[_0xfbe3('0x38')]=qs[_0xfbe3('0x39')](_[_0xfbe3('0x4c')](_0x5ebe0c[_0xfbe3('0x30')],_0x348ff5[_0xfbe3('0x39')]));if(_0x5ebe0c[_0xfbe3('0x30')]['filter']){_0xcadc45[_0xfbe3('0x38')]=_[_0xfbe3('0x3a')](_0xcadc45[_0xfbe3('0x38')],{'$or':_[_0xfbe3('0x2a')](_0xcadc45[_0xfbe3('0x32')],function(_0x4821c4){var _0x36548b={};_0x36548b[_0x4821c4]={'$like':'%'+_0x5ebe0c[_0xfbe3('0x30')][_0xfbe3('0x3c')]+'%'};return _0x36548b;})});}_0xcadc45=_[_0xfbe3('0x3a')]({},_0xcadc45,_0x5ebe0c[_0xfbe3('0x3d')]);return _0x4bf7f0[_0xfbe3('0x4f')](_0xcadc45);}})['then'](function(_0x20a329){if(_0x20a329){_0x4f4416=_0x20a329['length'];if(!_0x5ebe0c[_0xfbe3('0x30')][_0xfbe3('0x35')](_0xfbe3('0x36'))){_0xcadc45[_0xfbe3('0x1e')]=qs[_0xfbe3('0x1e')](_0x5ebe0c[_0xfbe3('0x30')]['limit']);_0xcadc45[_0xfbe3('0x1c')]=qs['offset'](_0x5ebe0c[_0xfbe3('0x30')][_0xfbe3('0x1c')]);}return _0x4bf7f0[_0xfbe3('0x4f')](_0xcadc45);}})[_0xfbe3('0x3e')](function(_0x3871c1){if(_0x3871c1){return _0x3871c1?{'count':_0x4f4416,'rows':_0x3871c1}:null;}})['then'](respondWithResult(_0x377077,null))[_0xfbe3('0x42')](handleError(_0x377077,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 8a76b6f..7ccef50 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 _0xc910=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','../../config/logger','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc910,0x104));var _0x0c91=function(_0x15f4b7,_0x385011){_0x15f4b7=_0x15f4b7-0x0;var _0x131e2d=_0xc910[_0x15f4b7];return _0x131e2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c91('0x0'))('api');var moment=require(_0x0c91('0x1'));var BPromise=require(_0x0c91('0x2'));var rp=require(_0x0c91('0x3'));var fs=require('fs');var path=require(_0x0c91('0x4'));var rimraf=require(_0x0c91('0x5'));var config=require(_0x0c91('0x6'));var attributes=require(_0x0c91('0x7'));module[_0x0c91('0x8')]=function(_0x42d4cf,_0xe48a50){return _0x42d4cf[_0x0c91('0x9')](_0x0c91('0xa'),attributes,{'tableName':_0x0c91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0810=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x351192,_0x4db98c){var _0x5287e0=function(_0x3379a7){while(--_0x3379a7){_0x351192['push'](_0x351192['shift']());}};_0x5287e0(++_0x4db98c);}(_0x0810,0x185));var _0x0081=function(_0xc8a34b,_0x1d0249){_0xc8a34b=_0xc8a34b-0x0;var _0x9fc19=_0x0810[_0xc8a34b];return _0x9fc19;};'use strict';var _=require(_0x0081('0x0'));var util=require(_0x0081('0x1'));var logger=require(_0x0081('0x2'))(_0x0081('0x3'));var moment=require(_0x0081('0x4'));var BPromise=require(_0x0081('0x5'));var rp=require(_0x0081('0x6'));var fs=require('fs');var path=require(_0x0081('0x7'));var rimraf=require(_0x0081('0x8'));var config=require(_0x0081('0x9'));var attributes=require(_0x0081('0xa'));module[_0x0081('0xb')]=function(_0x3a6259,_0x43e402){return _0x3a6259[_0x0081('0xc')](_0x0081('0xd'),attributes,{'tableName':_0x0081('0xe'),'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 8a7bdb4..edfea4e 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 _0x9dda=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x9dda,0x6d));var _0xa9dd=function(_0x34a500,_0x23d8df){_0x34a500=_0x34a500-0x0;var _0x5f3f27=_0x9dda[_0x34a500];return _0x5f3f27;};'use strict';var _=require(_0xa9dd('0x0'));var util=require(_0xa9dd('0x1'));var moment=require(_0xa9dd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa9dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9dd('0x4'))['db'];var utils=require(_0xa9dd('0x5'));var logger=require(_0xa9dd('0x6'))('rpc');var config=require(_0xa9dd('0x7'));var jayson=require(_0xa9dd('0x8'));var client=jayson['client'][_0xa9dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbeb10a,_0xb473c8,_0x48d4c1){return new BPromise(function(_0x5952a4,_0x5e7d17){return client[_0xa9dd('0xa')](_0xbeb10a,_0x48d4c1)[_0xa9dd('0xb')](function(_0x201bea){logger[_0xa9dd('0xc')](_0xa9dd('0xd'),_0xb473c8,_0xa9dd('0xe'));logger[_0xa9dd('0xf')](_0xa9dd('0x10'),_0xb473c8,_0xa9dd('0xe'),JSON[_0xa9dd('0x11')](_0x201bea));if(_0x201bea['error']){if(_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x13')]===0x1f4){logger[_0xa9dd('0x12')](_0xa9dd('0xd'),_0xb473c8,_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);return _0x5e7d17(_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);}logger[_0xa9dd('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xb473c8,_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);return _0x5952a4(_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);}else{logger[_0xa9dd('0xc')](_0xa9dd('0xd'),_0xb473c8,_0xa9dd('0xe'));_0x5952a4(_0x201bea[_0xa9dd('0x15')][_0xa9dd('0x14')]);}})['catch'](function(_0x191a02){logger[_0xa9dd('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xb473c8,_0x191a02);_0x5e7d17(_0x191a02);});});} \ No newline at end of file +var _0xe098=['error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x98e24f,_0x538150){var _0x2f2fe7=function(_0x41ebff){while(--_0x41ebff){_0x98e24f['push'](_0x98e24f['shift']());}};_0x2f2fe7(++_0x538150);}(_0xe098,0x186));var _0x8e09=function(_0x73eac8,_0x3b31a1){_0x73eac8=_0x73eac8-0x0;var _0x5652b3=_0xe098[_0x73eac8];return _0x5652b3;};'use strict';var _=require(_0x8e09('0x0'));var util=require(_0x8e09('0x1'));var moment=require(_0x8e09('0x2'));var BPromise=require(_0x8e09('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e09('0x4'))['db'];var utils=require(_0x8e09('0x5'));var logger=require(_0x8e09('0x6'))(_0x8e09('0x7'));var config=require(_0x8e09('0x8'));var jayson=require(_0x8e09('0x9'));var client=jayson[_0x8e09('0xa')][_0x8e09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c9b8e,_0x210e70,_0x359396){return new BPromise(function(_0x1568e7,_0x14a545){return client[_0x8e09('0xc')](_0x3c9b8e,_0x359396)[_0x8e09('0xd')](function(_0x55ee9b){logger[_0x8e09('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x210e70,'request\x20sent');logger[_0x8e09('0xf')](_0x8e09('0x10'),_0x210e70,'request\x20sent',JSON[_0x8e09('0x11')](_0x55ee9b));if(_0x55ee9b['error']){if(_0x55ee9b[_0x8e09('0x12')][_0x8e09('0x13')]===0x1f4){logger[_0x8e09('0x12')](_0x8e09('0x14'),_0x210e70,_0x55ee9b[_0x8e09('0x12')][_0x8e09('0x15')]);return _0x14a545(_0x55ee9b[_0x8e09('0x12')][_0x8e09('0x15')]);}logger[_0x8e09('0x12')](_0x8e09('0x14'),_0x210e70,_0x55ee9b[_0x8e09('0x12')][_0x8e09('0x15')]);return _0x1568e7(_0x55ee9b[_0x8e09('0x12')][_0x8e09('0x15')]);}else{logger[_0x8e09('0xe')](_0x8e09('0x14'),_0x210e70,'request\x20sent');_0x1568e7(_0x55ee9b[_0x8e09('0x16')][_0x8e09('0x15')]);}})[_0x8e09('0x17')](function(_0x1dd476){logger[_0x8e09('0x12')](_0x8e09('0x14'),_0x210e70,_0x1dd476);_0x14a545(_0x1dd476);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 24cdee4..8ebbcdd 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 _0x2d0c=['fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x32abd7,_0x2a2a77){var _0x12878c=function(_0x3a12c7){while(--_0x3a12c7){_0x32abd7['push'](_0x32abd7['shift']());}};_0x12878c(++_0x2a2a77);}(_0x2d0c,0xc1));var _0xc2d0=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0x2d0c[_0x38f5f8];return _0x34e820;};'use strict';var multer=require(_0xc2d0('0x0'));var util=require(_0xc2d0('0x1'));var path=require('path');var timeout=require(_0xc2d0('0x2'));var express=require(_0xc2d0('0x3'));var router=express[_0xc2d0('0x4')]();var fs_extra=require(_0xc2d0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc2d0('0x6'));var controller=require(_0xc2d0('0x7'));router[_0xc2d0('0x8')]('/',auth[_0xc2d0('0x9')](),controller['index']);router['get'](_0xc2d0('0xa'),auth[_0xc2d0('0x9')](),controller[_0xc2d0('0xb')]);router[_0xc2d0('0xc')]('/',auth[_0xc2d0('0x9')](),controller[_0xc2d0('0xd')]);router['put'](_0xc2d0('0xa'),auth['isAuthenticated'](),controller[_0xc2d0('0xe')]);router[_0xc2d0('0xf')](_0xc2d0('0xa'),auth[_0xc2d0('0x9')](),controller[_0xc2d0('0x10')]);module[_0xc2d0('0x11')]=router; \ No newline at end of file +var _0x3244=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','post','create'];(function(_0x530b95,_0x575518){var _0x482984=function(_0x32a100){while(--_0x32a100){_0x530b95['push'](_0x530b95['shift']());}};_0x482984(++_0x575518);}(_0x3244,0x65));var _0x4324=function(_0x203a98,_0x4a12e2){_0x203a98=_0x203a98-0x0;var _0x52e099=_0x3244[_0x203a98];return _0x52e099;};'use strict';var multer=require(_0x4324('0x0'));var util=require(_0x4324('0x1'));var path=require(_0x4324('0x2'));var timeout=require(_0x4324('0x3'));var express=require('express');var router=express[_0x4324('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4324('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4324('0x6'));var controller=require(_0x4324('0x7'));router[_0x4324('0x8')]('/',auth[_0x4324('0x9')](),controller[_0x4324('0xa')]);router[_0x4324('0x8')]('/:id',auth[_0x4324('0x9')](),controller['show']);router[_0x4324('0xb')]('/',auth['isAuthenticated'](),controller[_0x4324('0xc')]);router[_0x4324('0xd')](_0x4324('0xe'),auth['isAuthenticated'](),controller[_0x4324('0xf')]);router[_0x4324('0x10')](_0x4324('0xe'),auth[_0x4324('0x9')](),controller[_0x4324('0x11')]);module[_0x4324('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 81ae3ad..40261a1 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 _0x8a63=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0x2adfb1,_0x406e6e){var _0xa52d45=function(_0x2de16c){while(--_0x2de16c){_0x2adfb1['push'](_0x2adfb1['shift']());}};_0xa52d45(++_0x406e6e);}(_0x8a63,0x155));var _0x38a6=function(_0x59145c,_0x94d69a){_0x59145c=_0x59145c-0x0;var _0x4651d0=_0x8a63[_0x59145c];return _0x4651d0;};'use strict';var Sequelize=require(_0x38a6('0x0'));module[_0x38a6('0x1')]={'type':{'type':Sequelize[_0x38a6('0x2')](_0x38a6('0x3'),_0x38a6('0x4'),_0x38a6('0x5'),'keyValue',_0x38a6('0x6')),'defaultValue':_0x38a6('0x3')},'content':{'type':Sequelize[_0x38a6('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x38a6('0x2')](_0x38a6('0x3'),_0x38a6('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x38a6('0x7')]},'idField':{'type':Sequelize[_0x38a6('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38a6('0x7')]}}; \ No newline at end of file +var _0x1de2=['ENUM','BOOLEAN','exports','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x5b23d6,_0x40f32f){var _0x2ba9ce=function(_0x3b8fc2){while(--_0x3b8fc2){_0x5b23d6['push'](_0x5b23d6['shift']());}};_0x2ba9ce(++_0x40f32f);}(_0x1de2,0x1bb));var _0x21de=function(_0x2c5340,_0x5c86e5){_0x2c5340=_0x2c5340-0x0;var _0x3c505e=_0x1de2[_0x2c5340];return _0x3c505e;};'use strict';var Sequelize=require('sequelize');module[_0x21de('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x21de('0x1'),_0x21de('0x2'),_0x21de('0x3'),_0x21de('0x4')),'defaultValue':_0x21de('0x5')},'content':{'type':Sequelize[_0x21de('0x6')]},'key':{'type':Sequelize[_0x21de('0x6')]},'keyType':{'type':Sequelize[_0x21de('0x7')](_0x21de('0x5'),_0x21de('0x1'),_0x21de('0x2'))},'keyContent':{'type':Sequelize[_0x21de('0x6')]},'idField':{'type':Sequelize[_0x21de('0x6')]},'nameField':{'type':Sequelize[_0x21de('0x6')]},'customField':{'type':Sequelize[_0x21de('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x21de('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index dbc7cbf..33bcf24 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 _0xb716=['set','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','fields','find','body','update','eml-format','rimraf','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x1e8401,_0x18738d){var _0x25ce7e=function(_0x568a2a){while(--_0x568a2a){_0x1e8401['push'](_0x1e8401['shift']());}};_0x25ce7e(++_0x18738d);}(_0xb716,0x14b));var _0x6b71=function(_0x3ab52f,_0x195d89){_0x3ab52f=_0x3ab52f-0x0;var _0x5ee3ca=_0xb716[_0x3ab52f];return _0x5ee3ca;};'use strict';var emlformat=require(_0x6b71('0x0'));var rimraf=require(_0x6b71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b71('0x2'));var moment=require('moment');var BPromise=require(_0x6b71('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b71('0x4'));var sox=require('sox');var csv=require(_0x6b71('0x5'));var ejs=require(_0x6b71('0x6'));var fs=require('fs');var fs_extra=require(_0x6b71('0x7'));var _=require('lodash');var squel=require(_0x6b71('0x8'));var crypto=require(_0x6b71('0x9'));var jsforce=require(_0x6b71('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6b71('0x5'));var querystring=require('querystring');var Papa=require(_0x6b71('0xb'));var Redis=require('ioredis');var authService=require(_0x6b71('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6b71('0xd'));var hardwareService=require(_0x6b71('0xe'));var logger=require(_0x6b71('0xf'))(_0x6b71('0x10'));var utils=require(_0x6b71('0x11'));var config=require(_0x6b71('0x12'));var licenseUtil=require(_0x6b71('0x13'));var db=require(_0x6b71('0x14'))['db'];function respondWithStatusCode(_0x2e5868,_0x4718a5){_0x4718a5=_0x4718a5||0xcc;return function(_0x584169){if(_0x584169){return _0x2e5868[_0x6b71('0x15')](_0x4718a5);}return _0x2e5868[_0x6b71('0x16')](_0x4718a5)[_0x6b71('0x17')]();};}function respondWithResult(_0x40d19f,_0x114ac5){_0x114ac5=_0x114ac5||0xc8;return function(_0x235812){if(_0x235812){return _0x40d19f['status'](_0x114ac5)[_0x6b71('0x18')](_0x235812);}};}function respondWithFilteredResult(_0x461ed9,_0x30667f){return function(_0x843cb7){if(_0x843cb7){var _0x3e09c8=typeof _0x30667f[_0x6b71('0x19')]===_0x6b71('0x1a')&&typeof _0x30667f[_0x6b71('0x1b')]===_0x6b71('0x1a');var _0x5815db=_0x843cb7[_0x6b71('0x1c')];var _0x5cb7ee=_0x3e09c8?0x0:_0x30667f['offset'];var _0x435174=_0x3e09c8?_0x843cb7['count']:_0x30667f[_0x6b71('0x19')]+_0x30667f[_0x6b71('0x1b')];var _0x5c5782;if(_0x435174>=_0x5815db){_0x435174=_0x5815db;_0x5c5782=0xc8;}else{_0x5c5782=0xce;}_0x461ed9[_0x6b71('0x16')](_0x5c5782);return _0x461ed9[_0x6b71('0x1d')]('Content-Range',_0x5cb7ee+'-'+_0x435174+'/'+_0x5815db)[_0x6b71('0x18')](_0x843cb7);}return null;};}function patchUpdates(_0x578b53){return function(_0x3a8631){try{jsonpatch[_0x6b71('0x1e')](_0x3a8631,_0x578b53,!![]);}catch(_0x13f405){return BPromise[_0x6b71('0x1f')](_0x13f405);}return _0x3a8631[_0x6b71('0x20')]();};}function saveUpdates(_0x40313f,_0x1cf74b){return function(_0x48e1c8){if(_0x48e1c8){return _0x48e1c8['update'](_0x40313f)[_0x6b71('0x21')](function(_0x4fd6c2){return _0x4fd6c2;});}return null;};}function removeEntity(_0x50563f,_0x2182d3){return function(_0x4d25b7){if(_0x4d25b7){return _0x4d25b7[_0x6b71('0x22')]()['then'](function(){_0x50563f[_0x6b71('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222ddd,_0xe02d84){return function(_0x144081){if(!_0x144081){_0x222ddd['sendStatus'](0x194);}return _0x144081;};}function handleError(_0x28bb71,_0x41efed){_0x41efed=_0x41efed||0x1f4;return function(_0x55aa18){logger[_0x6b71('0x23')](_0x55aa18['stack']);if(_0x55aa18['name']){delete _0x55aa18[_0x6b71('0x24')];}_0x28bb71[_0x6b71('0x16')](_0x41efed)[_0x6b71('0x25')](_0x55aa18);};}exports[_0x6b71('0x26')]=function(_0x410468,_0x3b7708){var _0x4e70a9={},_0x58790e={},_0x29761a={'count':0x0,'rows':[]};var _0x4e5eb6=_[_0x6b71('0x27')](db['ZohoField'][_0x6b71('0x28')],function(_0x2395a4){return{'name':_0x2395a4[_0x6b71('0x29')],'type':_0x2395a4[_0x6b71('0x2a')][_0x6b71('0x2b')]};});_0x58790e[_0x6b71('0x2c')]=_[_0x6b71('0x27')](_0x4e5eb6,_0x6b71('0x24'));_0x58790e[_0x6b71('0x2d')]=_[_0x6b71('0x2e')](_0x410468[_0x6b71('0x2d')]);_0x58790e[_0x6b71('0x2f')]=_[_0x6b71('0x30')](_0x58790e[_0x6b71('0x2c')],_0x58790e['query']);_0x4e70a9[_0x6b71('0x31')]=_['intersection'](_0x58790e[_0x6b71('0x2c')],qs['fields'](_0x410468[_0x6b71('0x2d')]['fields']));_0x4e70a9[_0x6b71('0x31')]=_0x4e70a9[_0x6b71('0x31')][_0x6b71('0x32')]?_0x4e70a9[_0x6b71('0x31')]:_0x58790e[_0x6b71('0x2c')];if(!_0x410468[_0x6b71('0x2d')]['hasOwnProperty'](_0x6b71('0x33'))){_0x4e70a9['limit']=qs[_0x6b71('0x1b')](_0x410468[_0x6b71('0x2d')]['limit']);_0x4e70a9[_0x6b71('0x19')]=qs['offset'](_0x410468[_0x6b71('0x2d')]['offset']);}_0x4e70a9[_0x6b71('0x34')]=qs[_0x6b71('0x35')](_0x410468[_0x6b71('0x2d')][_0x6b71('0x35')]);_0x4e70a9[_0x6b71('0x36')]=qs[_0x6b71('0x2f')](_[_0x6b71('0x37')](_0x410468['query'],_0x58790e[_0x6b71('0x2f')]),_0x4e5eb6);if(_0x410468[_0x6b71('0x2d')][_0x6b71('0x38')]){_0x4e70a9['where']=_[_0x6b71('0x39')](_0x4e70a9[_0x6b71('0x36')],{'$or':_[_0x6b71('0x27')](_0x4e5eb6,function(_0x284fd6){if(_0x284fd6['type']!==_0x6b71('0x3a')){var _0x155b39={};_0x155b39[_0x284fd6[_0x6b71('0x24')]]={'$like':'%'+_0x410468[_0x6b71('0x2d')][_0x6b71('0x38')]+'%'};return _0x155b39;}})});}_0x4e70a9=_[_0x6b71('0x39')]({},_0x4e70a9,_0x410468[_0x6b71('0x3b')]);var _0x22b4a3={'where':_0x4e70a9['where']};return db[_0x6b71('0x3c')][_0x6b71('0x1c')](_0x22b4a3)['then'](function(_0xc36f02){_0x29761a[_0x6b71('0x1c')]=_0xc36f02;if(_0x410468[_0x6b71('0x2d')][_0x6b71('0x3d')]){_0x4e70a9[_0x6b71('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x6b71('0x3f')](_0x4e70a9);})[_0x6b71('0x21')](function(_0x7a8053){_0x29761a[_0x6b71('0x40')]=_0x7a8053;return _0x29761a;})['then'](respondWithFilteredResult(_0x3b7708,_0x4e70a9))[_0x6b71('0x41')](handleError(_0x3b7708,null));};exports[_0x6b71('0x42')]=function(_0x3faec5,_0x20adc6){var _0x51326d={'raw':!![],'where':{'id':_0x3faec5[_0x6b71('0x43')]['id']}},_0x5baa0b={};_0x5baa0b['model']=_[_0x6b71('0x2e')](db[_0x6b71('0x3c')]['rawAttributes']);_0x5baa0b['query']=_[_0x6b71('0x2e')](_0x3faec5[_0x6b71('0x2d')]);_0x5baa0b[_0x6b71('0x2f')]=_[_0x6b71('0x30')](_0x5baa0b[_0x6b71('0x2c')],_0x5baa0b[_0x6b71('0x2d')]);_0x51326d['attributes']=_[_0x6b71('0x30')](_0x5baa0b[_0x6b71('0x2c')],qs[_0x6b71('0x44')](_0x3faec5['query'][_0x6b71('0x44')]));_0x51326d[_0x6b71('0x31')]=_0x51326d[_0x6b71('0x31')][_0x6b71('0x32')]?_0x51326d[_0x6b71('0x31')]:_0x5baa0b[_0x6b71('0x2c')];if(_0x3faec5[_0x6b71('0x2d')][_0x6b71('0x3d')]){_0x51326d['include']=[{'all':!![]}];}_0x51326d=_[_0x6b71('0x39')]({},_0x51326d,_0x3faec5[_0x6b71('0x3b')]);return db[_0x6b71('0x3c')][_0x6b71('0x45')](_0x51326d)[_0x6b71('0x21')](handleEntityNotFound(_0x20adc6,null))['then'](respondWithResult(_0x20adc6,null))[_0x6b71('0x41')](handleError(_0x20adc6,null));};exports['create']=function(_0x4642f5,_0x4a23e3){return db[_0x6b71('0x3c')]['create'](_0x4642f5[_0x6b71('0x46')],{})[_0x6b71('0x21')](respondWithResult(_0x4a23e3,0xc9))[_0x6b71('0x41')](handleError(_0x4a23e3,null));};exports[_0x6b71('0x47')]=function(_0x35e436,_0x54dbf7){if(_0x35e436[_0x6b71('0x46')]['id']){delete _0x35e436[_0x6b71('0x46')]['id'];}return db[_0x6b71('0x3c')]['find']({'where':{'id':_0x35e436[_0x6b71('0x43')]['id']}})[_0x6b71('0x21')](handleEntityNotFound(_0x54dbf7,null))[_0x6b71('0x21')](saveUpdates(_0x35e436[_0x6b71('0x46')],null))[_0x6b71('0x21')](respondWithResult(_0x54dbf7,null))[_0x6b71('0x41')](handleError(_0x54dbf7,null));};exports[_0x6b71('0x22')]=function(_0x1d8bb7,_0x4f8c13){return db[_0x6b71('0x3c')]['find']({'where':{'id':_0x1d8bb7[_0x6b71('0x43')]['id']}})[_0x6b71('0x21')](handleEntityNotFound(_0x4f8c13,null))['then'](removeEntity(_0x4f8c13,null))[_0x6b71('0x41')](handleError(_0x4f8c13,null));}; \ No newline at end of file +var _0xaacd=['limit','count','Content-Range','save','update','then','error','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','merge','VIRTUAL','filter','ZohoField','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x378c4d,_0x4b7ea7){var _0x41f531=function(_0x138e92){while(--_0x138e92){_0x378c4d['push'](_0x378c4d['shift']());}};_0x41f531(++_0x4b7ea7);}(_0xaacd,0x1de));var _0xdaac=function(_0x318cbe,_0x14b6e0){_0x318cbe=_0x318cbe-0x0;var _0x3dba4c=_0xaacd[_0x318cbe];return _0x3dba4c;};'use strict';var emlformat=require(_0xdaac('0x0'));var rimraf=require(_0xdaac('0x1'));var zipdir=require(_0xdaac('0x2'));var jsonpatch=require(_0xdaac('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdaac('0x4'));var Mustache=require(_0xdaac('0x5'));var util=require(_0xdaac('0x6'));var path=require(_0xdaac('0x7'));var sox=require(_0xdaac('0x8'));var csv=require('to-csv');var ejs=require(_0xdaac('0x9'));var fs=require('fs');var fs_extra=require(_0xdaac('0xa'));var _=require(_0xdaac('0xb'));var squel=require(_0xdaac('0xc'));var crypto=require(_0xdaac('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdaac('0xe'));var toCsv=require(_0xdaac('0xf'));var querystring=require(_0xdaac('0x10'));var Papa=require(_0xdaac('0x11'));var Redis=require(_0xdaac('0x12'));var authService=require(_0xdaac('0x13'));var qs=require(_0xdaac('0x14'));var as=require(_0xdaac('0x15'));var hardwareService=require(_0xdaac('0x16'));var logger=require('../../config/logger')(_0xdaac('0x17'));var utils=require(_0xdaac('0x18'));var config=require(_0xdaac('0x19'));var licenseUtil=require(_0xdaac('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdf2342,_0x453263){_0x453263=_0x453263||0xcc;return function(_0x67ae86){if(_0x67ae86){return _0xdf2342[_0xdaac('0x1b')](_0x453263);}return _0xdf2342[_0xdaac('0x1c')](_0x453263)[_0xdaac('0x1d')]();};}function respondWithResult(_0x3d858a,_0x13e95e){_0x13e95e=_0x13e95e||0xc8;return function(_0x4ddd0b){if(_0x4ddd0b){return _0x3d858a[_0xdaac('0x1c')](_0x13e95e)[_0xdaac('0x1e')](_0x4ddd0b);}};}function respondWithFilteredResult(_0x3e6553,_0x3fa6ba){return function(_0x566d82){if(_0x566d82){var _0x41a6ff=typeof _0x3fa6ba[_0xdaac('0x1f')]===_0xdaac('0x20')&&typeof _0x3fa6ba[_0xdaac('0x21')]===_0xdaac('0x20');var _0x6f06aa=_0x566d82['count'];var _0x1175c1=_0x41a6ff?0x0:_0x3fa6ba[_0xdaac('0x1f')];var _0x5c62dd=_0x41a6ff?_0x566d82[_0xdaac('0x22')]:_0x3fa6ba[_0xdaac('0x1f')]+_0x3fa6ba['limit'];var _0x145b2e;if(_0x5c62dd>=_0x6f06aa){_0x5c62dd=_0x6f06aa;_0x145b2e=0xc8;}else{_0x145b2e=0xce;}_0x3e6553[_0xdaac('0x1c')](_0x145b2e);return _0x3e6553['set'](_0xdaac('0x23'),_0x1175c1+'-'+_0x5c62dd+'/'+_0x6f06aa)[_0xdaac('0x1e')](_0x566d82);}return null;};}function patchUpdates(_0x634790){return function(_0x5bad9f){try{jsonpatch['apply'](_0x5bad9f,_0x634790,!![]);}catch(_0x4873ac){return BPromise['reject'](_0x4873ac);}return _0x5bad9f[_0xdaac('0x24')]();};}function saveUpdates(_0x166428,_0x44acb1){return function(_0x37b67d){if(_0x37b67d){return _0x37b67d[_0xdaac('0x25')](_0x166428)[_0xdaac('0x26')](function(_0x32190a){return _0x32190a;});}return null;};}function removeEntity(_0x3ec6ee,_0x585dd3){return function(_0x3de95c){if(_0x3de95c){return _0x3de95c['destroy']()[_0xdaac('0x26')](function(){_0x3ec6ee[_0xdaac('0x1c')](0xcc)[_0xdaac('0x1d')]();});}};}function handleEntityNotFound(_0x316d1b,_0x2d2575){return function(_0x650e48){if(!_0x650e48){_0x316d1b[_0xdaac('0x1b')](0x194);}return _0x650e48;};}function handleError(_0xea0a84,_0x3f9577){_0x3f9577=_0x3f9577||0x1f4;return function(_0x1deaba){logger[_0xdaac('0x27')](_0x1deaba[_0xdaac('0x28')]);if(_0x1deaba[_0xdaac('0x29')]){delete _0x1deaba[_0xdaac('0x29')];}_0xea0a84[_0xdaac('0x1c')](_0x3f9577)[_0xdaac('0x2a')](_0x1deaba);};}exports[_0xdaac('0x2b')]=function(_0x374255,_0x523c59){var _0x4b811a={},_0x37b2e1={},_0x444966={'count':0x0,'rows':[]};var _0x2f889b=_[_0xdaac('0x2c')](db['ZohoField'][_0xdaac('0x2d')],function(_0x49f7a3){return{'name':_0x49f7a3['fieldName'],'type':_0x49f7a3[_0xdaac('0x2e')]['key']};});_0x37b2e1[_0xdaac('0x2f')]=_['map'](_0x2f889b,_0xdaac('0x29'));_0x37b2e1['query']=_[_0xdaac('0x30')](_0x374255[_0xdaac('0x31')]);_0x37b2e1[_0xdaac('0x32')]=_['intersection'](_0x37b2e1['model'],_0x37b2e1['query']);_0x4b811a[_0xdaac('0x33')]=_[_0xdaac('0x34')](_0x37b2e1[_0xdaac('0x2f')],qs[_0xdaac('0x35')](_0x374255[_0xdaac('0x31')][_0xdaac('0x35')]));_0x4b811a[_0xdaac('0x33')]=_0x4b811a[_0xdaac('0x33')][_0xdaac('0x36')]?_0x4b811a[_0xdaac('0x33')]:_0x37b2e1[_0xdaac('0x2f')];if(!_0x374255[_0xdaac('0x31')]['hasOwnProperty']('nolimit')){_0x4b811a[_0xdaac('0x21')]=qs[_0xdaac('0x21')](_0x374255[_0xdaac('0x31')][_0xdaac('0x21')]);_0x4b811a['offset']=qs[_0xdaac('0x1f')](_0x374255[_0xdaac('0x31')][_0xdaac('0x1f')]);}_0x4b811a[_0xdaac('0x37')]=qs[_0xdaac('0x38')](_0x374255['query'][_0xdaac('0x38')]);_0x4b811a[_0xdaac('0x39')]=qs[_0xdaac('0x32')](_['pick'](_0x374255[_0xdaac('0x31')],_0x37b2e1[_0xdaac('0x32')]),_0x2f889b);if(_0x374255[_0xdaac('0x31')]['filter']){_0x4b811a['where']=_[_0xdaac('0x3a')](_0x4b811a[_0xdaac('0x39')],{'$or':_[_0xdaac('0x2c')](_0x2f889b,function(_0x596b00){if(_0x596b00['type']!==_0xdaac('0x3b')){var _0x3d44ca={};_0x3d44ca[_0x596b00[_0xdaac('0x29')]]={'$like':'%'+_0x374255[_0xdaac('0x31')][_0xdaac('0x3c')]+'%'};return _0x3d44ca;}})});}_0x4b811a=_['merge']({},_0x4b811a,_0x374255['options']);var _0x361480={'where':_0x4b811a[_0xdaac('0x39')]};return db[_0xdaac('0x3d')]['count'](_0x361480)[_0xdaac('0x26')](function(_0x54d83f){_0x444966[_0xdaac('0x22')]=_0x54d83f;if(_0x374255[_0xdaac('0x31')][_0xdaac('0x3e')]){_0x4b811a[_0xdaac('0x3f')]=[{'all':!![]}];}return db[_0xdaac('0x3d')][_0xdaac('0x40')](_0x4b811a);})[_0xdaac('0x26')](function(_0x5dfae9){_0x444966[_0xdaac('0x41')]=_0x5dfae9;return _0x444966;})[_0xdaac('0x26')](respondWithFilteredResult(_0x523c59,_0x4b811a))[_0xdaac('0x42')](handleError(_0x523c59,null));};exports['show']=function(_0xb8c394,_0x1b409d){var _0x5c5aaf={'raw':!![],'where':{'id':_0xb8c394[_0xdaac('0x43')]['id']}},_0x16ce56={};_0x16ce56[_0xdaac('0x2f')]=_[_0xdaac('0x30')](db['ZohoField'][_0xdaac('0x2d')]);_0x16ce56[_0xdaac('0x31')]=_['keys'](_0xb8c394[_0xdaac('0x31')]);_0x16ce56['filters']=_[_0xdaac('0x34')](_0x16ce56[_0xdaac('0x2f')],_0x16ce56[_0xdaac('0x31')]);_0x5c5aaf[_0xdaac('0x33')]=_[_0xdaac('0x34')](_0x16ce56[_0xdaac('0x2f')],qs[_0xdaac('0x35')](_0xb8c394[_0xdaac('0x31')]['fields']));_0x5c5aaf[_0xdaac('0x33')]=_0x5c5aaf[_0xdaac('0x33')][_0xdaac('0x36')]?_0x5c5aaf[_0xdaac('0x33')]:_0x16ce56['model'];if(_0xb8c394[_0xdaac('0x31')][_0xdaac('0x3e')]){_0x5c5aaf[_0xdaac('0x3f')]=[{'all':!![]}];}_0x5c5aaf=_[_0xdaac('0x3a')]({},_0x5c5aaf,_0xb8c394[_0xdaac('0x44')]);return db[_0xdaac('0x3d')][_0xdaac('0x45')](_0x5c5aaf)[_0xdaac('0x26')](handleEntityNotFound(_0x1b409d,null))[_0xdaac('0x26')](respondWithResult(_0x1b409d,null))[_0xdaac('0x42')](handleError(_0x1b409d,null));};exports[_0xdaac('0x46')]=function(_0x5058f8,_0x3d8772){return db[_0xdaac('0x3d')]['create'](_0x5058f8[_0xdaac('0x47')],{})['then'](respondWithResult(_0x3d8772,0xc9))[_0xdaac('0x42')](handleError(_0x3d8772,null));};exports['update']=function(_0x5dbb7f,_0x58b580){if(_0x5dbb7f[_0xdaac('0x47')]['id']){delete _0x5dbb7f[_0xdaac('0x47')]['id'];}return db['ZohoField'][_0xdaac('0x45')]({'where':{'id':_0x5dbb7f['params']['id']}})[_0xdaac('0x26')](handleEntityNotFound(_0x58b580,null))[_0xdaac('0x26')](saveUpdates(_0x5dbb7f[_0xdaac('0x47')],null))[_0xdaac('0x26')](respondWithResult(_0x58b580,null))[_0xdaac('0x42')](handleError(_0x58b580,null));};exports[_0xdaac('0x48')]=function(_0x53a032,_0x54162e){return db['ZohoField']['find']({'where':{'id':_0x53a032[_0xdaac('0x43')]['id']}})[_0xdaac('0x26')](handleEntityNotFound(_0x54162e,null))[_0xdaac('0x26')](removeEntity(_0x54162e,null))[_0xdaac('0x42')](handleError(_0x54162e,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 7738b95..066c5cc 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 _0x6d11=['exports','define','ZohoField','int_zoho_fields','lodash','util','../../config/logger','moment','request-promise','path','./intZohoField.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d11,0xbf));var _0x16d1=function(_0x18e6bf,_0xbbf810){_0x18e6bf=_0x18e6bf-0x0;var _0x3bb89a=_0x6d11[_0x18e6bf];return _0x3bb89a;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['path','rimraf','../../config/environment','./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1261,0x144));var _0x1126=function(_0x54597a,_0x4ea42f){_0x54597a=_0x54597a-0x0;var _0x5a764f=_0x1261[_0x54597a];return _0x5a764f;};'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')]('ZohoField',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xd'),_0x1126('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 0f6f7a8..a289a63 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 _0x59bc=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','ZohoField,\x20%s,\x20%s','info'];(function(_0x2e5daf,_0x41df75){var _0x28be81=function(_0x34fa30){while(--_0x34fa30){_0x2e5daf['push'](_0x2e5daf['shift']());}};_0x28be81(++_0x41df75);}(_0x59bc,0x8c));var _0xc59b=function(_0x9de2c0,_0x1b3b0b){_0x9de2c0=_0x9de2c0-0x0;var _0x168de1=_0x59bc[_0x9de2c0];return _0x168de1;};'use strict';var _=require(_0xc59b('0x0'));var util=require(_0xc59b('0x1'));var moment=require('moment');var BPromise=require(_0xc59b('0x2'));var rs=require(_0xc59b('0x3'));var fs=require('fs');var Redis=require(_0xc59b('0x4'));var db=require(_0xc59b('0x5'))['db'];var utils=require(_0xc59b('0x6'));var logger=require('../../config/logger')(_0xc59b('0x7'));var config=require('../../config/environment');var jayson=require(_0xc59b('0x8'));var client=jayson[_0xc59b('0x9')][_0xc59b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cbebb,_0x51be51,_0x3c66d3){return new BPromise(function(_0x300e1f,_0x3d77e6){return client[_0xc59b('0xb')](_0x5cbebb,_0x3c66d3)[_0xc59b('0xc')](function(_0x833cc){logger['info']('ZohoField,\x20%s,\x20%s',_0x51be51,_0xc59b('0xd'));logger[_0xc59b('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x51be51,_0xc59b('0xd'),JSON[_0xc59b('0xf')](_0x833cc));if(_0x833cc['error']){if(_0x833cc[_0xc59b('0x10')][_0xc59b('0x11')]===0x1f4){logger[_0xc59b('0x10')]('ZohoField,\x20%s,\x20%s',_0x51be51,_0x833cc['error']['message']);return _0x3d77e6(_0x833cc['error'][_0xc59b('0x12')]);}logger[_0xc59b('0x10')](_0xc59b('0x13'),_0x51be51,_0x833cc[_0xc59b('0x10')][_0xc59b('0x12')]);return _0x300e1f(_0x833cc[_0xc59b('0x10')]['message']);}else{logger[_0xc59b('0x14')](_0xc59b('0x13'),_0x51be51,_0xc59b('0xd'));_0x300e1f(_0x833cc[_0xc59b('0x15')][_0xc59b('0x12')]);}})[_0xc59b('0x16')](function(_0x408937){logger[_0xc59b('0x10')](_0xc59b('0x13'),_0x51be51,_0x408937);_0x3d77e6(_0x408937);});});} \ No newline at end of file +var _0x0f14=['http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x192ec2,_0xc3a237){var _0x4abd11=function(_0x2d0745){while(--_0x2d0745){_0x192ec2['push'](_0x192ec2['shift']());}};_0x4abd11(++_0xc3a237);}(_0x0f14,0xe8));var _0x40f1=function(_0x3ab166,_0x1c7281){_0x3ab166=_0x3ab166-0x0;var _0x56a3c1=_0x0f14[_0x3ab166];return _0x56a3c1;};'use strict';var _=require(_0x40f1('0x0'));var util=require(_0x40f1('0x1'));var moment=require('moment');var BPromise=require(_0x40f1('0x2'));var rs=require(_0x40f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40f1('0x4'))['db'];var utils=require(_0x40f1('0x5'));var logger=require(_0x40f1('0x6'))('rpc');var config=require(_0x40f1('0x7'));var jayson=require(_0x40f1('0x8'));var client=jayson[_0x40f1('0x9')][_0x40f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16f58d,_0x325980,_0x41cf17){return new BPromise(function(_0x44b369,_0x2d6ded){return client[_0x40f1('0xb')](_0x16f58d,_0x41cf17)['then'](function(_0x2c41f4){logger[_0x40f1('0xc')](_0x40f1('0xd'),_0x325980,_0x40f1('0xe'));logger[_0x40f1('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x325980,_0x40f1('0xe'),JSON[_0x40f1('0x10')](_0x2c41f4));if(_0x2c41f4['error']){if(_0x2c41f4[_0x40f1('0x11')][_0x40f1('0x12')]===0x1f4){logger[_0x40f1('0x11')]('ZohoField,\x20%s,\x20%s',_0x325980,_0x2c41f4[_0x40f1('0x11')]['message']);return _0x2d6ded(_0x2c41f4[_0x40f1('0x11')][_0x40f1('0x13')]);}logger[_0x40f1('0x11')](_0x40f1('0xd'),_0x325980,_0x2c41f4[_0x40f1('0x11')][_0x40f1('0x13')]);return _0x44b369(_0x2c41f4['error']['message']);}else{logger[_0x40f1('0xc')]('ZohoField,\x20%s,\x20%s',_0x325980,_0x40f1('0xe'));_0x44b369(_0x2c41f4[_0x40f1('0x14')][_0x40f1('0x13')]);}})[_0x40f1('0x15')](function(_0x459d01){logger[_0x40f1('0x11')]('ZohoField,\x20%s,\x20%s',_0x325980,_0x459d01);_0x2d6ded(_0x459d01);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 4b5201a..a35794f 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x28e58a,_0x491504){var _0x36c438=function(_0x1cf223){while(--_0x1cf223){_0x28e58a['push'](_0x28e58a['shift']());}};_0x36c438(++_0x491504);}(_0xe706,0xa3));var _0x6e70=function(_0x40dcd1,_0x5cd1da){_0x40dcd1=_0x40dcd1-0x0;var _0x5c056b=_0xe706[_0x40dcd1];return _0x5c056b;};'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(_0x4c923a,_0x170032){var _0x1bdd1c=function(_0x3fa7e6){while(--_0x3fa7e6){_0x4c923a['push'](_0x4c923a['shift']());}};_0x1bdd1c(++_0x170032);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index cbec35d..c4be697 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 _0x4a55=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','STRING'];(function(_0x3f9a2b,_0x4afa12){var _0x5c9193=function(_0x2d46aa){while(--_0x2d46aa){_0x3f9a2b['push'](_0x3f9a2b['shift']());}};_0x5c9193(++_0x4afa12);}(_0x4a55,0x124));var _0x54a5=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x4a55[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x54a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x54a5('0x1')],'allowNull':![],'unique':_0x54a5('0x2')},'version':{'type':Sequelize[_0x54a5('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x54a5('0x1')],'defaultValue':_0x54a5('0x3')},'filename':{'type':Sequelize[_0x54a5('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x54a5('0x4')]},'active':{'type':Sequelize[_0x54a5('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x54a5('0x6')},'description':{'type':Sequelize[_0x54a5('0x1')]},'title':{'type':Sequelize[_0x54a5('0x1')]},'remoteUri':{'type':Sequelize[_0x54a5('0x1')]},'link':{'type':Sequelize[_0x54a5('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xa7b5=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x28474c,_0x123819){var _0x1e3e15=function(_0xff9275){while(--_0xff9275){_0x28474c['push'](_0x28474c['shift']());}};_0x1e3e15(++_0x123819);}(_0xa7b5,0x162));var _0x5a7b=function(_0x34467f,_0x1ea291){_0x34467f=_0x34467f-0x0;var _0x141540=_0xa7b5[_0x34467f];return _0x141540;};'use strict';var Sequelize=require(_0x5a7b('0x0'));module[_0x5a7b('0x1')]={'name':{'type':Sequelize[_0x5a7b('0x2')],'allowNull':![],'unique':_0x5a7b('0x3')},'version':{'type':Sequelize[_0x5a7b('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x5a7b('0x2')],'defaultValue':_0x5a7b('0x4')},'filename':{'type':Sequelize[_0x5a7b('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x5a7b('0x5')]},'active':{'type':Sequelize[_0x5a7b('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x5a7b('0x2')]},'state':{'type':Sequelize[_0x5a7b('0x2')],'unique':_0x5a7b('0x7')},'description':{'type':Sequelize[_0x5a7b('0x2')]},'title':{'type':Sequelize[_0x5a7b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x5a7b('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 35b33c6..b4fecd5 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 _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x5c3a22,_0xf9eb07){var _0x2e8fb8=function(_0x4593a1){while(--_0x4593a1){_0x5c3a22['push'](_0x5c3a22['shift']());}};_0x2e8fb8(++_0xf9eb07);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1945d3,_0x18336b){_0x1945d3=_0x1945d3-0x0;var _0x4b97ec=_0xc1c6[_0x1945d3];return _0x4b97ec;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file +var _0x1967=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Integration','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x1967,0x173));var _0x7196=function(_0x5103a3,_0x1cd664){_0x5103a3=_0x5103a3-0x0;var _0x1fb656=_0x1967[_0x5103a3];return _0x1fb656;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['Integration'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['create']=function(_0x29c7e8,_0x582884){return db['Integration'][_0x7196('0x49')](_0x29c7e8['body'],{})['then'](respondWithResult(_0x582884,0xc9))['catch'](handleError(_0x582884,null));};exports[_0x7196('0x26')]=function(_0x5052ee,_0x48e3b5){if(_0x5052ee[_0x7196('0x4a')]['id']){delete _0x5052ee[_0x7196('0x4a')]['id'];}return db[_0x7196('0x3e')][_0x7196('0x47')]({'where':{'id':_0x5052ee['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x48e3b5,null))['then'](saveUpdates(_0x5052ee[_0x7196('0x4a')],null))[_0x7196('0x27')](respondWithResult(_0x48e3b5,null))['catch'](handleError(_0x48e3b5,null));};exports[_0x7196('0x4b')]=function(_0x2fd056,_0x3fe092){return db['Integration'][_0x7196('0x47')]({'where':{'id':_0x2fd056['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x3fe092,null))[_0x7196('0x27')](removeEntity(_0x3fe092,null))[_0x7196('0x48')](handleError(_0x3fe092,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index e34b6ef..165a8a4 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 _0xc912=['define','Integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2c73fa,_0x41b660){var _0x201374=function(_0xb0a36c){while(--_0xb0a36c){_0x2c73fa['push'](_0x2c73fa['shift']());}};_0x201374(++_0x41b660);}(_0xc912,0xce));var _0x2c91=function(_0x512c1e,_0x273792){_0x512c1e=_0x512c1e-0x0;var _0x303d05=_0xc912[_0x512c1e];return _0x303d05;};'use strict';var _=require(_0x2c91('0x0'));var util=require(_0x2c91('0x1'));var logger=require(_0x2c91('0x2'))(_0x2c91('0x3'));var moment=require(_0x2c91('0x4'));var BPromise=require(_0x2c91('0x5'));var rp=require(_0x2c91('0x6'));var fs=require('fs');var path=require(_0x2c91('0x7'));var rimraf=require(_0x2c91('0x8'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x2c91('0x9')]=function(_0x1e1b74,_0x441dcf){return _0x1e1b74[_0x2c91('0xa')](_0x2c91('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7eea=['util','../../config/logger','api','moment','request-promise','path','rimraf','./integration.attributes','define','Integration','integrations','lodash'];(function(_0xe27035,_0x1f4876){var _0x3745bc=function(_0xfa83f4){while(--_0xfa83f4){_0xe27035['push'](_0xe27035['shift']());}};_0x3745bc(++_0x1f4876);}(_0x7eea,0x1df));var _0xa7ee=function(_0xe2b3f6,_0x352ea4){_0xe2b3f6=_0xe2b3f6-0x0;var _0x3e7fe6=_0x7eea[_0xe2b3f6];return _0x3e7fe6;};'use strict';var _=require(_0xa7ee('0x0'));var util=require(_0xa7ee('0x1'));var logger=require(_0xa7ee('0x2'))(_0xa7ee('0x3'));var moment=require(_0xa7ee('0x4'));var BPromise=require('bluebird');var rp=require(_0xa7ee('0x5'));var fs=require('fs');var path=require(_0xa7ee('0x6'));var rimraf=require(_0xa7ee('0x7'));var config=require('../../config/environment');var attributes=require(_0xa7ee('0x8'));module['exports']=function(_0x40b7cd,_0x234046){return _0x40b7cd[_0xa7ee('0x9')](_0xa7ee('0xa'),attributes,{'tableName':_0xa7ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 89088a4..dba05d9 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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2933ec,_0x176f03){var _0x3fa3a2=function(_0x3609a2){while(--_0x3609a2){_0x2933ec['push'](_0x2933ec['shift']());}};_0x3fa3a2(++_0x176f03);}(_0x7880,0x1f4));var _0x0788=function(_0x56f604,_0x31e0fc){_0x56f604=_0x56f604-0x0;var _0x5c3f23=_0x7880[_0x56f604];return _0x5c3f23;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x7b8a87,_0x2f2523){var _0x2131a1=function(_0x856847){while(--_0x856847){_0x7b8a87['push'](_0x7b8a87['shift']());}};_0x2131a1(++_0x2f2523);}(_0x2ef3,0xba));var _0x32ef=function(_0x26f3b3,_0x152f36){_0x26f3b3=_0x26f3b3-0x0;var _0x3d7052=_0x2ef3[_0x26f3b3];return _0x3d7052;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ea7a7b0..7f3f2b2 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 _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x475153,_0x168313){var _0x5cedf8=function(_0x595baa){while(--_0x595baa){_0x475153['push'](_0x475153['shift']());}};_0x5cedf8(++_0x168313);}(_0x2542,0x169));var _0x2254=function(_0x3ff59f,_0x546438){_0x3ff59f=_0x3ff59f-0x0;var _0x40256d=_0x2542[_0x3ff59f];return _0x40256d;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x2931b2,_0x18fb32){var _0x17499c=function(_0x262e9e){while(--_0x262e9e){_0x2931b2['push'](_0x2931b2['shift']());}};_0x17499c(++_0x18fb32);}(_0x524e,0x15e));var _0xe524=function(_0x9ada74,_0x160421){_0x9ada74=_0x9ada74-0x0;var _0x75c8c=_0x524e[_0x9ada74];return _0x75c8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 427f655..871eb44 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 _0x71d9=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x71d9,0x13f));var _0x971d=function(_0x314723,_0x121c53){_0x314723=_0x314723-0x0;var _0x340cc1=_0x71d9[_0x314723];return _0x340cc1;};'use strict';var Sequelize=require(_0x971d('0x0'));module[_0x971d('0x1')]={'integration':{'type':Sequelize[_0x971d('0x2')]},'eventChannel':{'type':Sequelize[_0x971d('0x2')]},'exitStatus':{'type':Sequelize[_0x971d('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x971d('0x3')]},'contacts':{'type':Sequelize[_0x971d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x971d('0x2')]},'queue':{'type':Sequelize[_0x971d('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x971d('0x4')]},'agentconnectAt':{'type':Sequelize[_0x971d('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x971d('0x4')]},'talktime':{'type':Sequelize[_0x971d('0x3')]},'agentacw':{'type':Sequelize[_0x971d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x971d('0x3')]},'reason':{'type':Sequelize[_0x971d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x971d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x971d('0x4')]},'agentdump':{'type':Sequelize[_0x971d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x971d('0x4')]},'lastevent':{'type':Sequelize[_0x971d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x971d('0x3')]},'channelstatedesc':{'type':Sequelize[_0x971d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x971d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x971d('0x2')]},'context':{'type':Sequelize[_0x971d('0x2')]},'exten':{'type':Sequelize[_0x971d('0x2')]},'priority':{'type':Sequelize[_0x971d('0x2')]},'destchannel':{'type':Sequelize[_0x971d('0x2')]},'destchannelstate':{'type':Sequelize[_0x971d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x971d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x971d('0x2')]},'destcalleridname':{'type':Sequelize[_0x971d('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x971d('0x2')]},'destlanguage':{'type':Sequelize[_0x971d('0x2')]},'destaccountcode':{'type':Sequelize[_0x971d('0x2')]},'destcontext':{'type':Sequelize[_0x971d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x971d('0x2')]},'destuniqueid':{'type':Sequelize[_0x971d('0x2')]},'messageId':{'type':Sequelize[_0x971d('0x2')]},'inReplyTo':{'type':Sequelize[_0x971d('0x2')]},'subject':{'type':Sequelize[_0x971d('0x2')]},'from':{'type':Sequelize[_0x971d('0x2')]},'to':{'type':Sequelize[_0x971d('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x971d('0x6')]},'html':{'type':Sequelize[_0x971d('0x6')]},'text':{'type':Sequelize[_0x971d('0x6')]},'status':{'type':Sequelize[_0x971d('0x7')]('SENT',_0x971d('0x8'),_0x971d('0x9'),_0x971d('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x971d('0x2')]},'appdata':{'type':Sequelize[_0x971d('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1f88=['BOOLEAN','TEXT','ENUM','FAILED','sequelize','STRING','INTEGER','DATE'];(function(_0x214c77,_0x4394bf){var _0x213cd9=function(_0x18b4f5){while(--_0x18b4f5){_0x214c77['push'](_0x214c77['shift']());}};_0x213cd9(++_0x4394bf);}(_0x1f88,0x164));var _0x81f8=function(_0x3b471b,_0x2404fc){_0x3b471b=_0x3b471b-0x0;var _0x2890f6=_0x1f88[_0x3b471b];return _0x2890f6;};'use strict';var Sequelize=require(_0x81f8('0x0'));module['exports']={'integration':{'type':Sequelize[_0x81f8('0x1')]},'eventChannel':{'type':Sequelize[_0x81f8('0x1')]},'exitStatus':{'type':Sequelize[_0x81f8('0x1')]},'ticketId':{'type':Sequelize[_0x81f8('0x1')]},'integrationId':{'type':Sequelize[_0x81f8('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x81f8('0x1')]},'calleridnum':{'type':Sequelize[_0x81f8('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x81f8('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x81f8('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x81f8('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x81f8('0x3')]},'talktime':{'type':Sequelize[_0x81f8('0x2')]},'agentacw':{'type':Sequelize[_0x81f8('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x81f8('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x81f8('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x81f8('0x3')]},'agentdump':{'type':Sequelize[_0x81f8('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x81f8('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x81f8('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x81f8('0x1')]},'language':{'type':Sequelize[_0x81f8('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x81f8('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x81f8('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x81f8('0x1')]},'destcalleridnum':{'type':Sequelize[_0x81f8('0x1')]},'destcalleridname':{'type':Sequelize[_0x81f8('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x81f8('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x81f8('0x1')]},'destexten':{'type':Sequelize[_0x81f8('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x81f8('0x1')]},'subject':{'type':Sequelize[_0x81f8('0x1')]},'from':{'type':Sequelize[_0x81f8('0x1')]},'to':{'type':Sequelize[_0x81f8('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x81f8('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x81f8('0x5')]},'status':{'type':Sequelize[_0x81f8('0x6')]('SENT','SENDING','RECEIVED',_0x81f8('0x7'))},'url':{'type':Sequelize[_0x81f8('0x1')]},'app':{'type':Sequelize[_0x81f8('0x1')]},'appdata':{'type':Sequelize[_0x81f8('0x1')]},'projectId':{'type':Sequelize[_0x81f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 8105923..e13007f 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 _0xd9fb=['mustache','util','path','to-csv','ejs','fs-extra','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','IntegrationReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','create','body','destroy','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1e5098,_0x26e3f4){var _0x551a09=function(_0x1cef04){while(--_0x1cef04){_0x1e5098['push'](_0x1e5098['shift']());}};_0x551a09(++_0x26e3f4);}(_0xd9fb,0xe8));var _0xbd9f=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xd9fb[_0x1f9f37];return _0x21c080;};'use strict';var emlformat=require(_0xbd9f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbd9f('0x1'));var rp=require(_0xbd9f('0x2'));var moment=require(_0xbd9f('0x3'));var BPromise=require(_0xbd9f('0x4'));var Mustache=require(_0xbd9f('0x5'));var util=require(_0xbd9f('0x6'));var path=require(_0xbd9f('0x7'));var sox=require('sox');var csv=require(_0xbd9f('0x8'));var ejs=require(_0xbd9f('0x9'));var fs=require('fs');var fs_extra=require(_0xbd9f('0xa'));var _=require('lodash');var squel=require(_0xbd9f('0xb'));var crypto=require(_0xbd9f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbd9f('0xd'));var toCsv=require(_0xbd9f('0x8'));var querystring=require(_0xbd9f('0xe'));var Papa=require(_0xbd9f('0xf'));var Redis=require('ioredis');var authService=require(_0xbd9f('0x10'));var qs=require(_0xbd9f('0x11'));var as=require(_0xbd9f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd9f('0x13'))(_0xbd9f('0x14'));var utils=require(_0xbd9f('0x15'));var config=require(_0xbd9f('0x16'));var licenseUtil=require(_0xbd9f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x384613,_0x177a57){_0x177a57=_0x177a57||0xcc;return function(_0x28b30e){if(_0x28b30e){return _0x384613[_0xbd9f('0x18')](_0x177a57);}return _0x384613[_0xbd9f('0x19')](_0x177a57)['end']();};}function respondWithResult(_0x30b34f,_0x3cb2f5){_0x3cb2f5=_0x3cb2f5||0xc8;return function(_0x1504fe){if(_0x1504fe){return _0x30b34f[_0xbd9f('0x19')](_0x3cb2f5)[_0xbd9f('0x1a')](_0x1504fe);}};}function respondWithFilteredResult(_0x2ab7da,_0x5a4ee7){return function(_0x5e217f){if(_0x5e217f){var _0x3e14b=typeof _0x5a4ee7[_0xbd9f('0x1b')]===_0xbd9f('0x1c')&&typeof _0x5a4ee7[_0xbd9f('0x1d')]==='undefined';var _0x5bdd6c=_0x5e217f['count'];var _0xd1470a=_0x3e14b?0x0:_0x5a4ee7[_0xbd9f('0x1b')];var _0x5534a0=_0x3e14b?_0x5e217f[_0xbd9f('0x1e')]:_0x5a4ee7[_0xbd9f('0x1b')]+_0x5a4ee7[_0xbd9f('0x1d')];var _0x1dfcd6;if(_0x5534a0>=_0x5bdd6c){_0x5534a0=_0x5bdd6c;_0x1dfcd6=0xc8;}else{_0x1dfcd6=0xce;}_0x2ab7da[_0xbd9f('0x19')](_0x1dfcd6);return _0x2ab7da[_0xbd9f('0x1f')](_0xbd9f('0x20'),_0xd1470a+'-'+_0x5534a0+'/'+_0x5bdd6c)['json'](_0x5e217f);}return null;};}function patchUpdates(_0x26ca50){return function(_0x4f1907){try{jsonpatch[_0xbd9f('0x21')](_0x4f1907,_0x26ca50,!![]);}catch(_0x3d062a){return BPromise[_0xbd9f('0x22')](_0x3d062a);}return _0x4f1907[_0xbd9f('0x23')]();};}function saveUpdates(_0x3fa1ad,_0xb52434){return function(_0x1babcd){if(_0x1babcd){return _0x1babcd[_0xbd9f('0x24')](_0x3fa1ad)[_0xbd9f('0x25')](function(_0x311b2d){return _0x311b2d;});}return null;};}function removeEntity(_0x4c96a5,_0x5cd018){return function(_0xe54b5a){if(_0xe54b5a){return _0xe54b5a['destroy']()[_0xbd9f('0x25')](function(){_0x4c96a5[_0xbd9f('0x19')](0xcc)[_0xbd9f('0x26')]();});}};}function handleEntityNotFound(_0x2a81a6,_0x10cfa2){return function(_0x17c0ae){if(!_0x17c0ae){_0x2a81a6[_0xbd9f('0x18')](0x194);}return _0x17c0ae;};}function handleError(_0x324089,_0x52ca20){_0x52ca20=_0x52ca20||0x1f4;return function(_0x25a988){logger[_0xbd9f('0x27')](_0x25a988['stack']);if(_0x25a988[_0xbd9f('0x28')]){delete _0x25a988[_0xbd9f('0x28')];}_0x324089['status'](_0x52ca20)[_0xbd9f('0x29')](_0x25a988);};}exports[_0xbd9f('0x2a')]=function(_0x16ce5a,_0x133ed3){var _0x433a67={},_0x9ad699={},_0xd6e178={'count':0x0,'rows':[]};var _0x510e8a=_['map'](db[_0xbd9f('0x2b')]['rawAttributes'],function(_0x1b6077){return{'name':_0x1b6077[_0xbd9f('0x2c')],'type':_0x1b6077[_0xbd9f('0x2d')][_0xbd9f('0x2e')]};});_0x9ad699[_0xbd9f('0x2f')]=_['map'](_0x510e8a,_0xbd9f('0x28'));_0x9ad699[_0xbd9f('0x30')]=_['keys'](_0x16ce5a[_0xbd9f('0x30')]);_0x9ad699[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x9ad699[_0xbd9f('0x2f')],_0x9ad699['query']);_0x433a67['attributes']=_['intersection'](_0x9ad699['model'],qs[_0xbd9f('0x33')](_0x16ce5a['query'][_0xbd9f('0x33')]));_0x433a67[_0xbd9f('0x34')]=_0x433a67[_0xbd9f('0x34')][_0xbd9f('0x35')]?_0x433a67[_0xbd9f('0x34')]:_0x9ad699['model'];if(!_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x36')](_0xbd9f('0x37'))){_0x433a67['limit']=qs[_0xbd9f('0x1d')](_0x16ce5a[_0xbd9f('0x30')]['limit']);_0x433a67[_0xbd9f('0x1b')]=qs[_0xbd9f('0x1b')](_0x16ce5a[_0xbd9f('0x30')]['offset']);}_0x433a67[_0xbd9f('0x38')]=qs['sort'](_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x39')]);_0x433a67['where']=qs[_0xbd9f('0x31')](_[_0xbd9f('0x3a')](_0x16ce5a[_0xbd9f('0x30')],_0x9ad699[_0xbd9f('0x31')]),_0x510e8a);if(_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x3b')]){_0x433a67[_0xbd9f('0x3c')]=_[_0xbd9f('0x3d')](_0x433a67['where'],{'$or':_[_0xbd9f('0x3e')](_0x510e8a,function(_0x41f499){if(_0x41f499[_0xbd9f('0x2d')]!==_0xbd9f('0x3f')){var _0x3aa93a={};_0x3aa93a[_0x41f499['name']]={'$like':'%'+_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x3b')]+'%'};return _0x3aa93a;}})});}_0x433a67=_[_0xbd9f('0x3d')]({},_0x433a67,_0x16ce5a[_0xbd9f('0x40')]);var _0x2c03bc={'where':_0x433a67[_0xbd9f('0x3c')]};return db[_0xbd9f('0x2b')][_0xbd9f('0x1e')](_0x2c03bc)[_0xbd9f('0x25')](function(_0x18c822){_0xd6e178[_0xbd9f('0x1e')]=_0x18c822;if(_0x16ce5a['query'][_0xbd9f('0x41')]){_0x433a67[_0xbd9f('0x42')]=[{'all':!![]}];}return db['IntegrationReport'][_0xbd9f('0x43')](_0x433a67);})[_0xbd9f('0x25')](function(_0x590cf6){_0xd6e178[_0xbd9f('0x44')]=_0x590cf6;return _0xd6e178;})[_0xbd9f('0x25')](respondWithFilteredResult(_0x133ed3,_0x433a67))[_0xbd9f('0x45')](handleError(_0x133ed3,null));};exports[_0xbd9f('0x46')]=function(_0x3dfc8c,_0x5e4475){var _0xda6942={'raw':![],'where':{'id':_0x3dfc8c['params']['id']}},_0x68d586={};_0x68d586[_0xbd9f('0x2f')]=_['keys'](db[_0xbd9f('0x2b')][_0xbd9f('0x47')]);_0x68d586[_0xbd9f('0x30')]=_[_0xbd9f('0x48')](_0x3dfc8c[_0xbd9f('0x30')]);_0x68d586[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x68d586[_0xbd9f('0x2f')],_0x68d586['query']);_0xda6942['attributes']=_[_0xbd9f('0x32')](_0x68d586[_0xbd9f('0x2f')],qs[_0xbd9f('0x33')](_0x3dfc8c['query'][_0xbd9f('0x33')]));_0xda6942[_0xbd9f('0x34')]=_0xda6942['attributes'][_0xbd9f('0x35')]?_0xda6942['attributes']:_0x68d586[_0xbd9f('0x2f')];if(_0x3dfc8c['query'][_0xbd9f('0x41')]){_0xda6942[_0xbd9f('0x42')]=[{'all':!![]}];}_0xda6942=_[_0xbd9f('0x3d')]({},_0xda6942,_0x3dfc8c[_0xbd9f('0x40')]);return db['IntegrationReport'][_0xbd9f('0x49')](_0xda6942)[_0xbd9f('0x25')](handleEntityNotFound(_0x5e4475,null))[_0xbd9f('0x25')](respondWithResult(_0x5e4475,null))['catch'](handleError(_0x5e4475,null));};exports[_0xbd9f('0x4a')]=function(_0x35ba4e,_0x16cfcc){return db[_0xbd9f('0x2b')][_0xbd9f('0x4a')](_0x35ba4e[_0xbd9f('0x4b')],{})[_0xbd9f('0x25')](respondWithResult(_0x16cfcc,0xc9))[_0xbd9f('0x45')](handleError(_0x16cfcc,null));};exports[_0xbd9f('0x24')]=function(_0x2768f0,_0x246bb6){if(_0x2768f0['body']['id']){delete _0x2768f0['body']['id'];}return db[_0xbd9f('0x2b')][_0xbd9f('0x49')]({'where':{'id':_0x2768f0['params']['id']}})['then'](handleEntityNotFound(_0x246bb6,null))[_0xbd9f('0x25')](saveUpdates(_0x2768f0[_0xbd9f('0x4b')],null))['then'](respondWithResult(_0x246bb6,null))[_0xbd9f('0x45')](handleError(_0x246bb6,null));};exports[_0xbd9f('0x4c')]=function(_0x4ff60d,_0x281a83){return db[_0xbd9f('0x2b')]['find']({'where':{'id':_0x4ff60d[_0xbd9f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x281a83,null))[_0xbd9f('0x25')](removeEntity(_0x281a83,null))[_0xbd9f('0x45')](handleError(_0x281a83,null));};exports[_0xbd9f('0x4e')]=function(_0x140af6,_0x12c39b){return db['IntegrationReport'][_0xbd9f('0x4e')]()['then'](respondWithResult(_0x12c39b,null))['catch'](handleError(_0x12c39b,null));}; \ No newline at end of file +var _0x1cbb=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','limit','apply','reject','save','then','sendStatus','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x1af9b1,_0x4978e7){var _0x17d9a3=function(_0x1ed6b9){while(--_0x1ed6b9){_0x1af9b1['push'](_0x1af9b1['shift']());}};_0x17d9a3(++_0x4978e7);}(_0x1cbb,0x65));var _0xb1cb=function(_0x7eadfa,_0x1d5ec4){_0x7eadfa=_0x7eadfa-0x0;var _0x1dc16d=_0x1cbb[_0x7eadfa];return _0x1dc16d;};'use strict';var emlformat=require(_0xb1cb('0x0'));var rimraf=require(_0xb1cb('0x1'));var zipdir=require(_0xb1cb('0x2'));var jsonpatch=require(_0xb1cb('0x3'));var rp=require(_0xb1cb('0x4'));var moment=require('moment');var BPromise=require(_0xb1cb('0x5'));var Mustache=require(_0xb1cb('0x6'));var util=require(_0xb1cb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb1cb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1cb('0x9'));var squel=require(_0xb1cb('0xa'));var crypto=require('crypto');var jsforce=require(_0xb1cb('0xb'));var deskjs=require(_0xb1cb('0xc'));var toCsv=require(_0xb1cb('0x8'));var querystring=require(_0xb1cb('0xd'));var Papa=require(_0xb1cb('0xe'));var Redis=require(_0xb1cb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb1cb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1cb('0x11'));var logger=require(_0xb1cb('0x12'))(_0xb1cb('0x13'));var utils=require(_0xb1cb('0x14'));var config=require(_0xb1cb('0x15'));var licenseUtil=require(_0xb1cb('0x16'));var db=require(_0xb1cb('0x17'))['db'];function respondWithStatusCode(_0xc8ae3b,_0x19fa0f){_0x19fa0f=_0x19fa0f||0xcc;return function(_0x5c3dd0){if(_0x5c3dd0){return _0xc8ae3b['sendStatus'](_0x19fa0f);}return _0xc8ae3b[_0xb1cb('0x18')](_0x19fa0f)[_0xb1cb('0x19')]();};}function respondWithResult(_0x54e31d,_0x2ccbd2){_0x2ccbd2=_0x2ccbd2||0xc8;return function(_0x133166){if(_0x133166){return _0x54e31d[_0xb1cb('0x18')](_0x2ccbd2)[_0xb1cb('0x1a')](_0x133166);}};}function respondWithFilteredResult(_0x4d8718,_0x5078a3){return function(_0x17e1e1){if(_0x17e1e1){var _0xeb6275=typeof _0x5078a3['offset']==='undefined'&&typeof _0x5078a3['limit']===_0xb1cb('0x1b');var _0x3a8f9e=_0x17e1e1[_0xb1cb('0x1c')];var _0x1c4525=_0xeb6275?0x0:_0x5078a3['offset'];var _0x242a49=_0xeb6275?_0x17e1e1[_0xb1cb('0x1c')]:_0x5078a3['offset']+_0x5078a3[_0xb1cb('0x1d')];var _0x55861b;if(_0x242a49>=_0x3a8f9e){_0x242a49=_0x3a8f9e;_0x55861b=0xc8;}else{_0x55861b=0xce;}_0x4d8718[_0xb1cb('0x18')](_0x55861b);return _0x4d8718['set']('Content-Range',_0x1c4525+'-'+_0x242a49+'/'+_0x3a8f9e)[_0xb1cb('0x1a')](_0x17e1e1);}return null;};}function patchUpdates(_0x3eccc6){return function(_0x46443c){try{jsonpatch[_0xb1cb('0x1e')](_0x46443c,_0x3eccc6,!![]);}catch(_0x3b70f5){return BPromise[_0xb1cb('0x1f')](_0x3b70f5);}return _0x46443c[_0xb1cb('0x20')]();};}function saveUpdates(_0x1f6d5e,_0x5b78f5){return function(_0x193f4f){if(_0x193f4f){return _0x193f4f['update'](_0x1f6d5e)[_0xb1cb('0x21')](function(_0x41500f){return _0x41500f;});}return null;};}function removeEntity(_0x4635e0,_0x17380c){return function(_0x2ddd50){if(_0x2ddd50){return _0x2ddd50['destroy']()[_0xb1cb('0x21')](function(){_0x4635e0['status'](0xcc)[_0xb1cb('0x19')]();});}};}function handleEntityNotFound(_0xcb9cd8,_0x116cad){return function(_0x4ad30d){if(!_0x4ad30d){_0xcb9cd8[_0xb1cb('0x22')](0x194);}return _0x4ad30d;};}function handleError(_0x300e2b,_0x380d99){_0x380d99=_0x380d99||0x1f4;return function(_0x4c5902){logger['error'](_0x4c5902['stack']);if(_0x4c5902[_0xb1cb('0x23')]){delete _0x4c5902[_0xb1cb('0x23')];}_0x300e2b[_0xb1cb('0x18')](_0x380d99)[_0xb1cb('0x24')](_0x4c5902);};}exports[_0xb1cb('0x25')]=function(_0x47d723,_0x183c63){var _0x3c1621={},_0x57e5b6={},_0xf8f666={'count':0x0,'rows':[]};var _0x23b219=_[_0xb1cb('0x26')](db[_0xb1cb('0x27')][_0xb1cb('0x28')],function(_0x98290e){return{'name':_0x98290e[_0xb1cb('0x29')],'type':_0x98290e[_0xb1cb('0x2a')][_0xb1cb('0x2b')]};});_0x57e5b6[_0xb1cb('0x2c')]=_[_0xb1cb('0x26')](_0x23b219,_0xb1cb('0x23'));_0x57e5b6[_0xb1cb('0x2d')]=_['keys'](_0x47d723[_0xb1cb('0x2d')]);_0x57e5b6[_0xb1cb('0x2e')]=_[_0xb1cb('0x2f')](_0x57e5b6[_0xb1cb('0x2c')],_0x57e5b6['query']);_0x3c1621[_0xb1cb('0x30')]=_[_0xb1cb('0x2f')](_0x57e5b6['model'],qs['fields'](_0x47d723[_0xb1cb('0x2d')][_0xb1cb('0x31')]));_0x3c1621['attributes']=_0x3c1621['attributes'][_0xb1cb('0x32')]?_0x3c1621[_0xb1cb('0x30')]:_0x57e5b6[_0xb1cb('0x2c')];if(!_0x47d723[_0xb1cb('0x2d')][_0xb1cb('0x33')](_0xb1cb('0x34'))){_0x3c1621[_0xb1cb('0x1d')]=qs[_0xb1cb('0x1d')](_0x47d723[_0xb1cb('0x2d')][_0xb1cb('0x1d')]);_0x3c1621['offset']=qs[_0xb1cb('0x35')](_0x47d723[_0xb1cb('0x2d')][_0xb1cb('0x35')]);}_0x3c1621['order']=qs['sort'](_0x47d723[_0xb1cb('0x2d')][_0xb1cb('0x36')]);_0x3c1621[_0xb1cb('0x37')]=qs[_0xb1cb('0x2e')](_[_0xb1cb('0x38')](_0x47d723[_0xb1cb('0x2d')],_0x57e5b6[_0xb1cb('0x2e')]),_0x23b219);if(_0x47d723[_0xb1cb('0x2d')][_0xb1cb('0x39')]){_0x3c1621[_0xb1cb('0x37')]=_[_0xb1cb('0x3a')](_0x3c1621[_0xb1cb('0x37')],{'$or':_[_0xb1cb('0x26')](_0x23b219,function(_0x2a405b){if(_0x2a405b[_0xb1cb('0x2a')]!==_0xb1cb('0x3b')){var _0x594a15={};_0x594a15[_0x2a405b[_0xb1cb('0x23')]]={'$like':'%'+_0x47d723[_0xb1cb('0x2d')]['filter']+'%'};return _0x594a15;}})});}_0x3c1621=_['merge']({},_0x3c1621,_0x47d723[_0xb1cb('0x3c')]);var _0x4c996c={'where':_0x3c1621[_0xb1cb('0x37')]};return db['IntegrationReport']['count'](_0x4c996c)[_0xb1cb('0x21')](function(_0x487ee1){_0xf8f666[_0xb1cb('0x1c')]=_0x487ee1;if(_0x47d723['query'][_0xb1cb('0x3d')]){_0x3c1621['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xb1cb('0x3e')](_0x3c1621);})[_0xb1cb('0x21')](function(_0xcd42af){_0xf8f666[_0xb1cb('0x3f')]=_0xcd42af;return _0xf8f666;})['then'](respondWithFilteredResult(_0x183c63,_0x3c1621))['catch'](handleError(_0x183c63,null));};exports[_0xb1cb('0x40')]=function(_0x51d4b1,_0x76911c){var _0x496523={'raw':![],'where':{'id':_0x51d4b1[_0xb1cb('0x41')]['id']}},_0x4815d4={};_0x4815d4[_0xb1cb('0x2c')]=_[_0xb1cb('0x42')](db[_0xb1cb('0x27')][_0xb1cb('0x28')]);_0x4815d4[_0xb1cb('0x2d')]=_[_0xb1cb('0x42')](_0x51d4b1[_0xb1cb('0x2d')]);_0x4815d4[_0xb1cb('0x2e')]=_[_0xb1cb('0x2f')](_0x4815d4['model'],_0x4815d4['query']);_0x496523[_0xb1cb('0x30')]=_[_0xb1cb('0x2f')](_0x4815d4[_0xb1cb('0x2c')],qs[_0xb1cb('0x31')](_0x51d4b1[_0xb1cb('0x2d')][_0xb1cb('0x31')]));_0x496523['attributes']=_0x496523[_0xb1cb('0x30')][_0xb1cb('0x32')]?_0x496523['attributes']:_0x4815d4[_0xb1cb('0x2c')];if(_0x51d4b1[_0xb1cb('0x2d')][_0xb1cb('0x3d')]){_0x496523[_0xb1cb('0x43')]=[{'all':!![]}];}_0x496523=_[_0xb1cb('0x3a')]({},_0x496523,_0x51d4b1['options']);return db['IntegrationReport'][_0xb1cb('0x44')](_0x496523)['then'](handleEntityNotFound(_0x76911c,null))['then'](respondWithResult(_0x76911c,null))[_0xb1cb('0x45')](handleError(_0x76911c,null));};exports[_0xb1cb('0x46')]=function(_0x2b91ef,_0x4e14fd){return db['IntegrationReport'][_0xb1cb('0x46')](_0x2b91ef[_0xb1cb('0x47')],{})[_0xb1cb('0x21')](respondWithResult(_0x4e14fd,0xc9))[_0xb1cb('0x45')](handleError(_0x4e14fd,null));};exports[_0xb1cb('0x48')]=function(_0x2952ec,_0x571df7){if(_0x2952ec[_0xb1cb('0x47')]['id']){delete _0x2952ec['body']['id'];}return db[_0xb1cb('0x27')]['find']({'where':{'id':_0x2952ec[_0xb1cb('0x41')]['id']}})['then'](handleEntityNotFound(_0x571df7,null))[_0xb1cb('0x21')](saveUpdates(_0x2952ec[_0xb1cb('0x47')],null))[_0xb1cb('0x21')](respondWithResult(_0x571df7,null))['catch'](handleError(_0x571df7,null));};exports['destroy']=function(_0x597b55,_0x49f6c1){return db[_0xb1cb('0x27')][_0xb1cb('0x44')]({'where':{'id':_0x597b55[_0xb1cb('0x41')]['id']}})[_0xb1cb('0x21')](handleEntityNotFound(_0x49f6c1,null))[_0xb1cb('0x21')](removeEntity(_0x49f6c1,null))['catch'](handleError(_0x49f6c1,null));};exports[_0xb1cb('0x49')]=function(_0x2f3287,_0x1c6002){return db[_0xb1cb('0x27')][_0xb1cb('0x49')]()[_0xb1cb('0x21')](respondWithResult(_0x1c6002,null))[_0xb1cb('0x45')](handleError(_0x1c6002,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 73ad8b2..9b30521 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 _0x36a3=['IntegrationReport','report_integration','util','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x52217d,_0x30baef){var _0x8deff8=function(_0x30684b){while(--_0x30684b){_0x52217d['push'](_0x52217d['shift']());}};_0x8deff8(++_0x30baef);}(_0x36a3,0x106));var _0x336a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x36a3[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require(_0x336a('0x0'));var logger=require('../../config/logger')(_0x336a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x336a('0x2'));var fs=require('fs');var path=require(_0x336a('0x3'));var rimraf=require(_0x336a('0x4'));var config=require(_0x336a('0x5'));var attributes=require('./integrationReport.attributes');module[_0x336a('0x6')]=function(_0x5dbaa5,_0x1da051){return _0x5dbaa5[_0x336a('0x7')](_0x336a('0x8'),attributes,{'tableName':_0x336a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7a8=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4181e3,_0x7c2394){var _0x53a115=function(_0x2f15e3){while(--_0x2f15e3){_0x4181e3['push'](_0x4181e3['shift']());}};_0x53a115(++_0x7c2394);}(_0xb7a8,0xc6));var _0x8b7a=function(_0x350eb5,_0x2a5317){_0x350eb5=_0x350eb5-0x0;var _0x559311=_0xb7a8[_0x350eb5];return _0x559311;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))(_0x8b7a('0x2'));var moment=require('moment');var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require(_0x8b7a('0x5'));var rimraf=require(_0x8b7a('0x6'));var config=require(_0x8b7a('0x7'));var attributes=require(_0x8b7a('0x8'));module[_0x8b7a('0x9')]=function(_0x22c732,_0x52d166){return _0x22c732[_0x8b7a('0xa')](_0x8b7a('0xb'),attributes,{'tableName':'report_integration','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 b9c1c79..274767e 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 _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1939f8,_0x5793d8){var _0x187d48=function(_0x38ae9){while(--_0x38ae9){_0x1939f8['push'](_0x1939f8['shift']());}};_0x187d48(++_0x5793d8);}(_0x326f,0xd1));var _0xf326=function(_0x14b105,_0x24a5e1){_0x14b105=_0x14b105-0x0;var _0x18c81e=_0x326f[_0x14b105];return _0x18c81e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x4975,0x86));var _0x5497=function(_0x3efe7c,_0x491173){_0x3efe7c=_0x3efe7c-0x0;var _0x1698e8=_0x4975[_0x3efe7c];return _0x1698e8;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d2bb1bb..59f4e7b 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 _0xa751=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','addIntervals','put','exports','multer','util','path','connect-timeout','Router'];(function(_0x4c14b0,_0x232350){var _0x12b649=function(_0x35b48c){while(--_0x35b48c){_0x4c14b0['push'](_0x4c14b0['shift']());}};_0x12b649(++_0x232350);}(_0xa751,0x175));var _0x1a75=function(_0x27c30f,_0x470639){_0x27c30f=_0x27c30f-0x0;var _0x106ab2=_0xa751[_0x27c30f];return _0x106ab2;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a75('0x5'));var interaction=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var controller=require('./interval.controller');router[_0x1a75('0x8')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xa')]);router[_0x1a75('0x8')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xc')]);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x1a75('0xd')]);router[_0x1a75('0xe')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xf')]);router[_0x1a75('0xe')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller[_0x1a75('0x11')]);router['post']('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x1a75('0x12')]);router[_0x1a75('0x13')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller['update']);router['delete'](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller['destroy']);module[_0x1a75('0x14')]=router; \ No newline at end of file +var _0xc963=['get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addIntervals','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller'];(function(_0x4828f8,_0x151250){var _0x5a57cc=function(_0x9eba8c){while(--_0x9eba8c){_0x4828f8['push'](_0x4828f8['shift']());}};_0x5a57cc(++_0x151250);}(_0xc963,0x17f));var _0x3c96=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc963[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x3c96('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3c96('0x1'));var express=require(_0x3c96('0x2'));var router=express[_0x3c96('0x3')]();var fs_extra=require(_0x3c96('0x4'));var auth=require(_0x3c96('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3c96('0x6'));var controller=require(_0x3c96('0x7'));router[_0x3c96('0x8')]('/',auth[_0x3c96('0x9')](),controller[_0x3c96('0xa')]);router['get'](_0x3c96('0xb'),auth[_0x3c96('0x9')](),controller[_0x3c96('0xc')]);router[_0x3c96('0x8')](_0x3c96('0xd'),auth[_0x3c96('0x9')](),controller[_0x3c96('0xe')]);router[_0x3c96('0xf')]('/',auth['isAuthenticated'](),controller[_0x3c96('0x10')]);router['post'](_0x3c96('0xd'),auth[_0x3c96('0x9')](),controller['addInterval']);router[_0x3c96('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x3c96('0x11')]);router[_0x3c96('0x12')](_0x3c96('0xb'),auth[_0x3c96('0x9')](),controller[_0x3c96('0x13')]);router[_0x3c96('0x14')](_0x3c96('0xb'),auth[_0x3c96('0x9')](),controller[_0x3c96('0x15')]);module[_0x3c96('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a4cbc4c..e430f62 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 _0x7bc7=['sequelize','exports','STRING'];(function(_0x17168f,_0x4257d1){var _0x29d923=function(_0x1288c7){while(--_0x1288c7){_0x17168f['push'](_0x17168f['shift']());}};_0x29d923(++_0x4257d1);}(_0x7bc7,0xfc));var _0x77bc=function(_0x5572ed,_0x39cdda){_0x5572ed=_0x5572ed-0x0;var _0x232527=_0x7bc7[_0x5572ed];return _0x232527;};'use strict';var Sequelize=require(_0x77bc('0x0'));module[_0x77bc('0x1')]={'name':{'type':Sequelize[_0x77bc('0x2')]},'description':{'type':Sequelize[_0x77bc('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xe49a=['sequelize','exports','STRING'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xe49a,0x1b9));var _0xae49=function(_0x1cc51a,_0x11952b){_0x1cc51a=_0x1cc51a-0x0;var _0x4903f0=_0xe49a[_0x1cc51a];return _0x4903f0;};'use strict';var Sequelize=require(_0xae49('0x0'));module[_0xae49('0x1')]={'name':{'type':Sequelize[_0xae49('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xae49('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index f5d80ec..54992eb 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 _0x3f69=['set','Content-Range','apply','save','destroy','Intervals','then','stack','name','send','index','Interval','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','options','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','error','update','addInterval','IntervalId','getIntervals','findOne','rawAttributes','pick','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count'];(function(_0x229eb5,_0x462412){var _0x2a093d=function(_0x5c2d9c){while(--_0x5c2d9c){_0x229eb5['push'](_0x229eb5['shift']());}};_0x2a093d(++_0x462412);}(_0x3f69,0xf5));var _0x93f6=function(_0x5ba6cb,_0x5b0843){_0x5ba6cb=_0x5ba6cb-0x0;var _0x4179c9=_0x3f69[_0x5ba6cb];return _0x4179c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93f6('0x0'));var zipdir=require(_0x93f6('0x1'));var jsonpatch=require(_0x93f6('0x2'));var rp=require(_0x93f6('0x3'));var moment=require(_0x93f6('0x4'));var BPromise=require(_0x93f6('0x5'));var Mustache=require(_0x93f6('0x6'));var util=require(_0x93f6('0x7'));var path=require(_0x93f6('0x8'));var sox=require(_0x93f6('0x9'));var csv=require(_0x93f6('0xa'));var ejs=require(_0x93f6('0xb'));var fs=require('fs');var fs_extra=require(_0x93f6('0xc'));var _=require(_0x93f6('0xd'));var squel=require(_0x93f6('0xe'));var crypto=require(_0x93f6('0xf'));var jsforce=require(_0x93f6('0x10'));var deskjs=require(_0x93f6('0x11'));var toCsv=require(_0x93f6('0xa'));var querystring=require(_0x93f6('0x12'));var Papa=require(_0x93f6('0x13'));var Redis=require(_0x93f6('0x14'));var authService=require(_0x93f6('0x15'));var qs=require(_0x93f6('0x16'));var as=require(_0x93f6('0x17'));var hardwareService=require(_0x93f6('0x18'));var logger=require(_0x93f6('0x19'))(_0x93f6('0x1a'));var utils=require(_0x93f6('0x1b'));var config=require(_0x93f6('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x93f6('0x1d'));function respondWithStatusCode(_0x57b168,_0x512deb){_0x512deb=_0x512deb||0xcc;return function(_0x3cfd04){if(_0x3cfd04){return _0x57b168[_0x93f6('0x1e')](_0x512deb);}return _0x57b168[_0x93f6('0x1f')](_0x512deb)[_0x93f6('0x20')]();};}function respondWithResult(_0x4c88c3,_0x37ddae){_0x37ddae=_0x37ddae||0xc8;return function(_0x456d3e){if(_0x456d3e){return _0x4c88c3[_0x93f6('0x1f')](_0x37ddae)[_0x93f6('0x21')](_0x456d3e);}};}function respondWithFilteredResult(_0x3cb8f7,_0x5b8a10){return function(_0x3e7d0e){if(_0x3e7d0e){var _0x4e31c6=typeof _0x5b8a10[_0x93f6('0x22')]===_0x93f6('0x23')&&typeof _0x5b8a10['limit']===_0x93f6('0x23');var _0x1efc01=_0x3e7d0e[_0x93f6('0x24')];var _0x5bfcc7=_0x4e31c6?0x0:_0x5b8a10[_0x93f6('0x22')];var _0x3acf2e=_0x4e31c6?_0x3e7d0e[_0x93f6('0x24')]:_0x5b8a10['offset']+_0x5b8a10['limit'];var _0x2a6577;if(_0x3acf2e>=_0x1efc01){_0x3acf2e=_0x1efc01;_0x2a6577=0xc8;}else{_0x2a6577=0xce;}_0x3cb8f7[_0x93f6('0x1f')](_0x2a6577);return _0x3cb8f7[_0x93f6('0x25')](_0x93f6('0x26'),_0x5bfcc7+'-'+_0x3acf2e+'/'+_0x1efc01)['json'](_0x3e7d0e);}return null;};}function patchUpdates(_0x4d0aa4){return function(_0x19fe55){try{jsonpatch[_0x93f6('0x27')](_0x19fe55,_0x4d0aa4,!![]);}catch(_0x31b077){return BPromise['reject'](_0x31b077);}return _0x19fe55[_0x93f6('0x28')]();};}function saveUpdates(_0x4152e2,_0x5e3c55){return function(_0xcb04e0){if(_0xcb04e0){return _0xcb04e0['update'](_0x4152e2)['then'](function(_0x4e6394){return _0x4e6394;});}return null;};}function removeEntity(_0x5a5266,_0xb71f3f){return function(_0x4d8a62){if(_0x4d8a62){return _0x4d8a62[_0x93f6('0x29')]()['then'](function(){var _0x29422c=_0x4d8a62['get']({'plain':!![]});var _0x16b436=_0x93f6('0x2a');return db['UserProfileResource'][_0x93f6('0x29')]({'where':{'type':_0x16b436,'resourceId':_0x29422c['id']}})['then'](function(){return _0x4d8a62;});})[_0x93f6('0x2b')](function(){_0x5a5266[_0x93f6('0x1f')](0xcc)[_0x93f6('0x20')]();});}};}function handleEntityNotFound(_0x566789,_0x105fe0){return function(_0x2bc9e7){if(!_0x2bc9e7){_0x566789[_0x93f6('0x1e')](0x194);}return _0x2bc9e7;};}function handleError(_0x3d637a,_0x10e38d){_0x10e38d=_0x10e38d||0x1f4;return function(_0x4f62c0){logger['error'](_0x4f62c0[_0x93f6('0x2c')]);if(_0x4f62c0[_0x93f6('0x2d')]){delete _0x4f62c0['name'];}_0x3d637a[_0x93f6('0x1f')](_0x10e38d)[_0x93f6('0x2e')](_0x4f62c0);};}exports[_0x93f6('0x2f')]=function(_0x541b98,_0x43ac42){var _0x5e8e14={},_0x4e5a6f={},_0x483f3f={'count':0x0,'rows':[]};var _0x2efd5b=_['map'](db[_0x93f6('0x30')]['rawAttributes'],function(_0x1cf073){return{'name':_0x1cf073[_0x93f6('0x31')],'type':_0x1cf073[_0x93f6('0x32')]['key']};});_0x4e5a6f['model']=_['map'](_0x2efd5b,_0x93f6('0x2d'));_0x4e5a6f['query']=_[_0x93f6('0x33')](_0x541b98[_0x93f6('0x34')]);_0x4e5a6f[_0x93f6('0x35')]=_[_0x93f6('0x36')](_0x4e5a6f[_0x93f6('0x37')],_0x4e5a6f['query']);_0x5e8e14[_0x93f6('0x38')]=_[_0x93f6('0x36')](_0x4e5a6f[_0x93f6('0x37')],qs[_0x93f6('0x39')](_0x541b98[_0x93f6('0x34')]['fields']));_0x5e8e14['attributes']=_0x5e8e14[_0x93f6('0x38')][_0x93f6('0x3a')]?_0x5e8e14[_0x93f6('0x38')]:_0x4e5a6f[_0x93f6('0x37')];if(!_0x541b98[_0x93f6('0x34')][_0x93f6('0x3b')](_0x93f6('0x3c'))){_0x5e8e14[_0x93f6('0x3d')]=qs['limit'](_0x541b98[_0x93f6('0x34')][_0x93f6('0x3d')]);_0x5e8e14[_0x93f6('0x22')]=qs[_0x93f6('0x22')](_0x541b98['query']['offset']);}_0x5e8e14[_0x93f6('0x3e')]=qs['sort'](_0x541b98[_0x93f6('0x34')][_0x93f6('0x3f')]);_0x5e8e14[_0x93f6('0x40')]=qs[_0x93f6('0x35')](_['pick'](_0x541b98[_0x93f6('0x34')],_0x4e5a6f[_0x93f6('0x35')]),_0x2efd5b);if(_0x541b98[_0x93f6('0x34')][_0x93f6('0x41')]){_0x5e8e14[_0x93f6('0x40')]=_[_0x93f6('0x42')](_0x5e8e14[_0x93f6('0x40')],{'$or':_[_0x93f6('0x43')](_0x2efd5b,function(_0x414cff){if(_0x414cff[_0x93f6('0x32')]!=='VIRTUAL'){var _0x43d53b={};_0x43d53b[_0x414cff[_0x93f6('0x2d')]]={'$like':'%'+_0x541b98[_0x93f6('0x34')][_0x93f6('0x41')]+'%'};return _0x43d53b;}})});}_0x5e8e14=_[_0x93f6('0x42')]({},_0x5e8e14,_0x541b98[_0x93f6('0x44')]);var _0x251212={'where':_0x5e8e14[_0x93f6('0x40')]};return db['Interval']['count'](_0x251212)['then'](function(_0x5c9526){_0x483f3f[_0x93f6('0x24')]=_0x5c9526;if(_0x541b98[_0x93f6('0x34')][_0x93f6('0x45')]){_0x5e8e14['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x5e8e14);})[_0x93f6('0x2b')](function(_0x1077c0){_0x483f3f[_0x93f6('0x46')]=_0x1077c0;return _0x483f3f;})[_0x93f6('0x2b')](respondWithFilteredResult(_0x43ac42,_0x5e8e14))[_0x93f6('0x47')](handleError(_0x43ac42,null));};exports[_0x93f6('0x48')]=function(_0x2b1322,_0x4e479f){var _0x324108={'raw':!![],'where':{'id':_0x2b1322[_0x93f6('0x49')]['id']}},_0x3eccdd={};_0x3eccdd[_0x93f6('0x37')]=_[_0x93f6('0x33')](db[_0x93f6('0x30')]['rawAttributes']);_0x3eccdd[_0x93f6('0x34')]=_['keys'](_0x2b1322[_0x93f6('0x34')]);_0x3eccdd['filters']=_[_0x93f6('0x36')](_0x3eccdd[_0x93f6('0x37')],_0x3eccdd[_0x93f6('0x34')]);_0x324108['attributes']=_['intersection'](_0x3eccdd[_0x93f6('0x37')],qs[_0x93f6('0x39')](_0x2b1322[_0x93f6('0x34')][_0x93f6('0x39')]));_0x324108[_0x93f6('0x38')]=_0x324108[_0x93f6('0x38')][_0x93f6('0x3a')]?_0x324108['attributes']:_0x3eccdd[_0x93f6('0x37')];if(_0x2b1322[_0x93f6('0x34')]['includeAll']){_0x324108[_0x93f6('0x4a')]=[{'all':!![]}];}_0x324108=_[_0x93f6('0x42')]({},_0x324108,_0x2b1322[_0x93f6('0x44')]);return db['Interval'][_0x93f6('0x4b')](_0x324108)[_0x93f6('0x2b')](handleEntityNotFound(_0x4e479f,null))[_0x93f6('0x2b')](respondWithResult(_0x4e479f,null))[_0x93f6('0x47')](handleError(_0x4e479f,null));};exports[_0x93f6('0x4c')]=function(_0x3479be,_0x1ea61a){return db['Interval']['create'](_0x3479be[_0x93f6('0x4d')],{})['then'](function(_0x3863ba){var _0x38e8e6=_0x3479be[_0x93f6('0x4e')]['get']({'plain':!![]});if(!_0x38e8e6)throw new Error(_0x93f6('0x4f'));if(_0x38e8e6[_0x93f6('0x50')]===_0x93f6('0x4e')){var _0x41c73a=_0x3863ba['get']({'plain':!![]});var _0x252389='Intervals';return db['UserProfileSection'][_0x93f6('0x4b')]({'where':{'name':_0x252389,'userProfileId':_0x38e8e6['userProfileId']},'raw':!![]})[_0x93f6('0x2b')](function(_0x2318a3){if(_0x2318a3&&_0x2318a3['autoAssociation']===0x0){return db[_0x93f6('0x51')]['create']({'name':_0x41c73a[_0x93f6('0x2d')],'resourceId':_0x41c73a['id'],'type':_0x2318a3[_0x93f6('0x2d')],'sectionId':_0x2318a3['id']},{})[_0x93f6('0x2b')](function(){return _0x3863ba;});}else{return _0x3863ba;}})[_0x93f6('0x47')](function(_0x5c11a0){logger[_0x93f6('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c11a0);throw _0x5c11a0;});}return _0x3863ba;})[_0x93f6('0x2b')](respondWithResult(_0x1ea61a,0xc9))[_0x93f6('0x47')](handleError(_0x1ea61a,null));};exports[_0x93f6('0x53')]=function(_0x5adc6e,_0xd7e727){if(_0x5adc6e['body']['id']){delete _0x5adc6e[_0x93f6('0x4d')]['id'];}return db[_0x93f6('0x30')][_0x93f6('0x4b')]({'where':{'id':_0x5adc6e[_0x93f6('0x49')]['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0xd7e727,null))['then'](saveUpdates(_0x5adc6e[_0x93f6('0x4d')],null))[_0x93f6('0x2b')](respondWithResult(_0xd7e727,null))[_0x93f6('0x47')](handleError(_0xd7e727,null));};exports[_0x93f6('0x29')]=function(_0x4300af,_0x2df28d){return db[_0x93f6('0x30')][_0x93f6('0x4b')]({'where':{'id':_0x4300af[_0x93f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x2df28d,null))[_0x93f6('0x2b')](removeEntity(_0x2df28d,null))[_0x93f6('0x47')](handleError(_0x2df28d,null));};exports[_0x93f6('0x54')]=function(_0x369752,_0x3c9399,_0x4c0c16){if(_0x369752[_0x93f6('0x4d')]['id']){delete _0x369752[_0x93f6('0x4d')]['id'];}return db['Interval'][_0x93f6('0x4b')]({'where':{'id':_0x369752['params']['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0x3c9399,null))[_0x93f6('0x2b')](function(_0xfb4f35){if(_0xfb4f35){_0x369752[_0x93f6('0x4d')][_0x93f6('0x55')]=_0xfb4f35['id'];return db['Interval'][_0x93f6('0x4c')](_0x369752[_0x93f6('0x4d')]);}})['then'](respondWithResult(_0x3c9399,null))[_0x93f6('0x47')](handleError(_0x3c9399,null));};exports[_0x93f6('0x56')]=function(_0x2fb402,_0x3759f9,_0x363241){var _0x512e17={};var _0x30a54a={};var _0x5b956d;var _0xb345b0;return db[_0x93f6('0x30')][_0x93f6('0x57')]({'where':{'id':_0x2fb402[_0x93f6('0x49')]['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0x3759f9,null))[_0x93f6('0x2b')](function(_0x285b05){if(_0x285b05){_0x5b956d=_0x285b05;_0x30a54a['model']=_[_0x93f6('0x33')](db[_0x93f6('0x30')][_0x93f6('0x58')]);_0x30a54a[_0x93f6('0x34')]=_[_0x93f6('0x33')](_0x2fb402[_0x93f6('0x34')]);_0x30a54a[_0x93f6('0x35')]=_['intersection'](_0x30a54a['model'],_0x30a54a['query']);_0x512e17['attributes']=_[_0x93f6('0x36')](_0x30a54a[_0x93f6('0x37')],qs[_0x93f6('0x39')](_0x2fb402[_0x93f6('0x34')][_0x93f6('0x39')]));_0x512e17[_0x93f6('0x38')]=_0x512e17[_0x93f6('0x38')]['length']?_0x512e17[_0x93f6('0x38')]:_0x30a54a['model'];_0x512e17[_0x93f6('0x3e')]=qs['sort'](_0x2fb402['query']['sort']);_0x512e17[_0x93f6('0x40')]=qs['filters'](_[_0x93f6('0x59')](_0x2fb402['query'],_0x30a54a[_0x93f6('0x35')]));if(_0x2fb402['query'][_0x93f6('0x41')]){_0x512e17[_0x93f6('0x40')]=_[_0x93f6('0x42')](_0x512e17['where'],{'$or':_[_0x93f6('0x43')](_0x512e17[_0x93f6('0x38')],function(_0x335d8b){var _0x499359={};_0x499359[_0x335d8b]={'$like':'%'+_0x2fb402[_0x93f6('0x34')][_0x93f6('0x41')]+'%'};return _0x499359;})});}_0x512e17=_[_0x93f6('0x42')]({},_0x512e17,_0x2fb402['options']);return _0x5b956d[_0x93f6('0x56')](_0x512e17);}})[_0x93f6('0x2b')](function(_0x283ad9){if(_0x283ad9){_0xb345b0=_0x283ad9[_0x93f6('0x3a')];if(!_0x2fb402[_0x93f6('0x34')][_0x93f6('0x3b')](_0x93f6('0x3c'))){_0x512e17[_0x93f6('0x3d')]=qs[_0x93f6('0x3d')](_0x2fb402[_0x93f6('0x34')][_0x93f6('0x3d')]);_0x512e17[_0x93f6('0x22')]=qs[_0x93f6('0x22')](_0x2fb402[_0x93f6('0x34')][_0x93f6('0x22')]);}return _0x5b956d['getIntervals'](_0x512e17);}})[_0x93f6('0x2b')](function(_0x124bfe){if(_0x124bfe){return _0x124bfe?{'count':_0xb345b0,'rows':_0x124bfe}:null;}})[_0x93f6('0x2b')](respondWithResult(_0x3759f9,null))[_0x93f6('0x47')](handleError(_0x3759f9,null));};exports[_0x93f6('0x5a')]=function(_0x271ebb,_0x44b5b9,_0x86208){return db[_0x93f6('0x30')][_0x93f6('0x57')]({'where':{'id':_0x271ebb[_0x93f6('0x49')]['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0x44b5b9,null))[_0x93f6('0x2b')](function(_0x5648e1){if(_0x5648e1){return db[_0x93f6('0x5b')][_0x93f6('0x5c')](function(_0xb06e7){return db[_0x93f6('0x30')][_0x93f6('0x29')]({'where':{'IntervalId':_0x271ebb[_0x93f6('0x49')]['id']},'transaction':_0xb06e7})[_0x93f6('0x2b')](function(_0x3f52a6){var _0x70b871=_['map'](_0x271ebb['body'],function(_0x25158c){delete _0x25158c['id'];_0x25158c['IntervalId']=_0x271ebb[_0x93f6('0x49')]['id'];return _0x25158c;});return db[_0x93f6('0x30')][_0x93f6('0x5d')](_0x70b871,{'transaction':_0xb06e7});});})[_0x93f6('0x2b')](function(){return db[_0x93f6('0x30')]['findAll']({'where':{'IntervalId':_0x271ebb[_0x93f6('0x49')]['id']}});});}})[_0x93f6('0x2b')](respondWithResult(_0x44b5b9,null))[_0x93f6('0x47')](handleError(_0x44b5b9,null));}; \ No newline at end of file +var _0x9851=['Content-Range','apply','reject','save','then','get','Intervals','UserProfileResource','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','Interval','findAll','show','params','rawAttributes','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','order','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x3739de,_0x4fbb80){var _0x972ffc=function(_0x415dce){while(--_0x415dce){_0x3739de['push'](_0x3739de['shift']());}};_0x972ffc(++_0x4fbb80);}(_0x9851,0x156));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x1985('0x0'));var rimraf=require(_0x1985('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1985('0x2'));var moment=require(_0x1985('0x3'));var BPromise=require(_0x1985('0x4'));var Mustache=require('mustache');var util=require(_0x1985('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1985('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1985('0x7'));var squel=require(_0x1985('0x8'));var crypto=require(_0x1985('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1985('0xa'));var toCsv=require(_0x1985('0xb'));var querystring=require(_0x1985('0xc'));var Papa=require(_0x1985('0xd'));var Redis=require('ioredis');var authService=require(_0x1985('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1985('0xf'));var hardwareService=require(_0x1985('0x10'));var logger=require(_0x1985('0x11'))(_0x1985('0x12'));var utils=require('../../config/utils');var config=require(_0x1985('0x13'));var licenseUtil=require(_0x1985('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0x1985('0x15'));function respondWithStatusCode(_0x4f270b,_0xb58d66){_0xb58d66=_0xb58d66||0xcc;return function(_0x2f18e4){if(_0x2f18e4){return _0x4f270b[_0x1985('0x16')](_0xb58d66);}return _0x4f270b[_0x1985('0x17')](_0xb58d66)[_0x1985('0x18')]();};}function respondWithResult(_0x20ce98,_0x54b206){_0x54b206=_0x54b206||0xc8;return function(_0x2553d6){if(_0x2553d6){return _0x20ce98[_0x1985('0x17')](_0x54b206)[_0x1985('0x19')](_0x2553d6);}};}function respondWithFilteredResult(_0x58d6b4,_0x89e5b1){return function(_0x512b68){if(_0x512b68){var _0x552add=typeof _0x89e5b1[_0x1985('0x1a')]==='undefined'&&typeof _0x89e5b1[_0x1985('0x1b')]==='undefined';var _0x2f888e=_0x512b68[_0x1985('0x1c')];var _0x3902b6=_0x552add?0x0:_0x89e5b1['offset'];var _0x26bf86=_0x552add?_0x512b68[_0x1985('0x1c')]:_0x89e5b1['offset']+_0x89e5b1[_0x1985('0x1b')];var _0x57d9ca;if(_0x26bf86>=_0x2f888e){_0x26bf86=_0x2f888e;_0x57d9ca=0xc8;}else{_0x57d9ca=0xce;}_0x58d6b4[_0x1985('0x17')](_0x57d9ca);return _0x58d6b4[_0x1985('0x1d')](_0x1985('0x1e'),_0x3902b6+'-'+_0x26bf86+'/'+_0x2f888e)[_0x1985('0x19')](_0x512b68);}return null;};}function patchUpdates(_0x2cc927){return function(_0xfa9e1e){try{jsonpatch[_0x1985('0x1f')](_0xfa9e1e,_0x2cc927,!![]);}catch(_0x300496){return BPromise[_0x1985('0x20')](_0x300496);}return _0xfa9e1e[_0x1985('0x21')]();};}function saveUpdates(_0x4188ce,_0x599937){return function(_0x1778be){if(_0x1778be){return _0x1778be['update'](_0x4188ce)[_0x1985('0x22')](function(_0x3d3627){return _0x3d3627;});}return null;};}function removeEntity(_0x25b11d,_0x597bae){return function(_0x449b11){if(_0x449b11){return _0x449b11['destroy']()['then'](function(){var _0x17ef31=_0x449b11[_0x1985('0x23')]({'plain':!![]});var _0x4dc89b=_0x1985('0x24');return db[_0x1985('0x25')][_0x1985('0x26')]({'where':{'type':_0x4dc89b,'resourceId':_0x17ef31['id']}})[_0x1985('0x22')](function(){return _0x449b11;});})[_0x1985('0x22')](function(){_0x25b11d[_0x1985('0x17')](0xcc)[_0x1985('0x18')]();});}};}function handleEntityNotFound(_0x204e4e,_0x394227){return function(_0x312c5d){if(!_0x312c5d){_0x204e4e[_0x1985('0x16')](0x194);}return _0x312c5d;};}function handleError(_0x57ccf9,_0x15cf61){_0x15cf61=_0x15cf61||0x1f4;return function(_0x30f697){logger[_0x1985('0x27')](_0x30f697[_0x1985('0x28')]);if(_0x30f697[_0x1985('0x29')]){delete _0x30f697[_0x1985('0x29')];}_0x57ccf9['status'](_0x15cf61)[_0x1985('0x2a')](_0x30f697);};}exports[_0x1985('0x2b')]=function(_0x2d4fa4,_0x1ec43f){var _0x3dc0e4={},_0x391cb3={},_0x2a98d7={'count':0x0,'rows':[]};var _0x5a4833=_[_0x1985('0x2c')](db['Interval']['rawAttributes'],function(_0x5cbfd6){return{'name':_0x5cbfd6[_0x1985('0x2d')],'type':_0x5cbfd6[_0x1985('0x2e')][_0x1985('0x2f')]};});_0x391cb3[_0x1985('0x30')]=_[_0x1985('0x2c')](_0x5a4833,'name');_0x391cb3[_0x1985('0x31')]=_[_0x1985('0x32')](_0x2d4fa4[_0x1985('0x31')]);_0x391cb3[_0x1985('0x33')]=_[_0x1985('0x34')](_0x391cb3[_0x1985('0x30')],_0x391cb3[_0x1985('0x31')]);_0x3dc0e4['attributes']=_['intersection'](_0x391cb3['model'],qs['fields'](_0x2d4fa4[_0x1985('0x31')][_0x1985('0x35')]));_0x3dc0e4[_0x1985('0x36')]=_0x3dc0e4[_0x1985('0x36')]['length']?_0x3dc0e4[_0x1985('0x36')]:_0x391cb3[_0x1985('0x30')];if(!_0x2d4fa4['query']['hasOwnProperty'](_0x1985('0x37'))){_0x3dc0e4[_0x1985('0x1b')]=qs[_0x1985('0x1b')](_0x2d4fa4[_0x1985('0x31')][_0x1985('0x1b')]);_0x3dc0e4[_0x1985('0x1a')]=qs['offset'](_0x2d4fa4[_0x1985('0x31')][_0x1985('0x1a')]);}_0x3dc0e4['order']=qs[_0x1985('0x38')](_0x2d4fa4[_0x1985('0x31')][_0x1985('0x38')]);_0x3dc0e4[_0x1985('0x39')]=qs['filters'](_[_0x1985('0x3a')](_0x2d4fa4[_0x1985('0x31')],_0x391cb3[_0x1985('0x33')]),_0x5a4833);if(_0x2d4fa4[_0x1985('0x31')][_0x1985('0x3b')]){_0x3dc0e4[_0x1985('0x39')]=_[_0x1985('0x3c')](_0x3dc0e4[_0x1985('0x39')],{'$or':_[_0x1985('0x2c')](_0x5a4833,function(_0x2c23d7){if(_0x2c23d7[_0x1985('0x2e')]!==_0x1985('0x3d')){var _0x13bb2e={};_0x13bb2e[_0x2c23d7[_0x1985('0x29')]]={'$like':'%'+_0x2d4fa4['query'][_0x1985('0x3b')]+'%'};return _0x13bb2e;}})});}_0x3dc0e4=_['merge']({},_0x3dc0e4,_0x2d4fa4[_0x1985('0x3e')]);var _0x589a74={'where':_0x3dc0e4['where']};return db['Interval'][_0x1985('0x1c')](_0x589a74)[_0x1985('0x22')](function(_0x4c2820){_0x2a98d7[_0x1985('0x1c')]=_0x4c2820;if(_0x2d4fa4[_0x1985('0x31')]['includeAll']){_0x3dc0e4[_0x1985('0x3f')]=[{'all':!![]}];}return db[_0x1985('0x40')][_0x1985('0x41')](_0x3dc0e4);})[_0x1985('0x22')](function(_0x467c47){_0x2a98d7['rows']=_0x467c47;return _0x2a98d7;})[_0x1985('0x22')](respondWithFilteredResult(_0x1ec43f,_0x3dc0e4))['catch'](handleError(_0x1ec43f,null));};exports[_0x1985('0x42')]=function(_0x4a09db,_0x5d5160){var _0xbf9d11={'raw':!![],'where':{'id':_0x4a09db[_0x1985('0x43')]['id']}},_0x52598b={};_0x52598b[_0x1985('0x30')]=_[_0x1985('0x32')](db['Interval'][_0x1985('0x44')]);_0x52598b[_0x1985('0x31')]=_['keys'](_0x4a09db[_0x1985('0x31')]);_0x52598b[_0x1985('0x33')]=_[_0x1985('0x34')](_0x52598b[_0x1985('0x30')],_0x52598b['query']);_0xbf9d11['attributes']=_[_0x1985('0x34')](_0x52598b['model'],qs[_0x1985('0x35')](_0x4a09db[_0x1985('0x31')][_0x1985('0x35')]));_0xbf9d11[_0x1985('0x36')]=_0xbf9d11[_0x1985('0x36')][_0x1985('0x45')]?_0xbf9d11[_0x1985('0x36')]:_0x52598b['model'];if(_0x4a09db[_0x1985('0x31')][_0x1985('0x46')]){_0xbf9d11['include']=[{'all':!![]}];}_0xbf9d11=_[_0x1985('0x3c')]({},_0xbf9d11,_0x4a09db[_0x1985('0x3e')]);return db[_0x1985('0x40')][_0x1985('0x47')](_0xbf9d11)['then'](handleEntityNotFound(_0x5d5160,null))[_0x1985('0x22')](respondWithResult(_0x5d5160,null))[_0x1985('0x48')](handleError(_0x5d5160,null));};exports[_0x1985('0x49')]=function(_0x2d596a,_0x486c81){return db['Interval']['create'](_0x2d596a[_0x1985('0x4a')],{})[_0x1985('0x22')](function(_0x5c8fbe){var _0x391151=_0x2d596a[_0x1985('0x4b')][_0x1985('0x23')]({'plain':!![]});if(!_0x391151)throw new Error(_0x1985('0x4c'));if(_0x391151[_0x1985('0x4d')]===_0x1985('0x4b')){var _0x26649b=_0x5c8fbe[_0x1985('0x23')]({'plain':!![]});var _0x5cd196=_0x1985('0x24');return db[_0x1985('0x4e')][_0x1985('0x47')]({'where':{'name':_0x5cd196,'userProfileId':_0x391151[_0x1985('0x4f')]},'raw':!![]})['then'](function(_0x2e39fb){if(_0x2e39fb&&_0x2e39fb[_0x1985('0x50')]===0x0){return db[_0x1985('0x25')][_0x1985('0x49')]({'name':_0x26649b[_0x1985('0x29')],'resourceId':_0x26649b['id'],'type':_0x2e39fb[_0x1985('0x29')],'sectionId':_0x2e39fb['id']},{})['then'](function(){return _0x5c8fbe;});}else{return _0x5c8fbe;}})['catch'](function(_0x461dc5){logger[_0x1985('0x27')](_0x1985('0x51'),_0x461dc5);throw _0x461dc5;});}return _0x5c8fbe;})[_0x1985('0x22')](respondWithResult(_0x486c81,0xc9))[_0x1985('0x48')](handleError(_0x486c81,null));};exports[_0x1985('0x52')]=function(_0x22b28c,_0x1da6b4){if(_0x22b28c[_0x1985('0x4a')]['id']){delete _0x22b28c[_0x1985('0x4a')]['id'];}return db[_0x1985('0x40')][_0x1985('0x47')]({'where':{'id':_0x22b28c[_0x1985('0x43')]['id']}})['then'](handleEntityNotFound(_0x1da6b4,null))[_0x1985('0x22')](saveUpdates(_0x22b28c['body'],null))['then'](respondWithResult(_0x1da6b4,null))['catch'](handleError(_0x1da6b4,null));};exports['destroy']=function(_0x156543,_0x65c042){return db[_0x1985('0x40')][_0x1985('0x47')]({'where':{'id':_0x156543[_0x1985('0x43')]['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x65c042,null))[_0x1985('0x22')](removeEntity(_0x65c042,null))[_0x1985('0x48')](handleError(_0x65c042,null));};exports[_0x1985('0x53')]=function(_0x19b1ef,_0x11ad82,_0x1de58c){if(_0x19b1ef[_0x1985('0x4a')]['id']){delete _0x19b1ef[_0x1985('0x4a')]['id'];}return db[_0x1985('0x40')][_0x1985('0x47')]({'where':{'id':_0x19b1ef[_0x1985('0x43')]['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x11ad82,null))[_0x1985('0x22')](function(_0x508b1c){if(_0x508b1c){_0x19b1ef['body'][_0x1985('0x54')]=_0x508b1c['id'];return db[_0x1985('0x40')][_0x1985('0x49')](_0x19b1ef['body']);}})[_0x1985('0x22')](respondWithResult(_0x11ad82,null))['catch'](handleError(_0x11ad82,null));};exports[_0x1985('0x55')]=function(_0x4469e5,_0x580470,_0x4ca693){var _0x200b01={};var _0x92b2df={};var _0x4e1155;var _0x3c0c44;return db[_0x1985('0x40')][_0x1985('0x56')]({'where':{'id':_0x4469e5['params']['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x580470,null))['then'](function(_0x4a489c){if(_0x4a489c){_0x4e1155=_0x4a489c;_0x92b2df[_0x1985('0x30')]=_[_0x1985('0x32')](db[_0x1985('0x40')][_0x1985('0x44')]);_0x92b2df[_0x1985('0x31')]=_[_0x1985('0x32')](_0x4469e5[_0x1985('0x31')]);_0x92b2df[_0x1985('0x33')]=_[_0x1985('0x34')](_0x92b2df['model'],_0x92b2df[_0x1985('0x31')]);_0x200b01[_0x1985('0x36')]=_[_0x1985('0x34')](_0x92b2df[_0x1985('0x30')],qs[_0x1985('0x35')](_0x4469e5[_0x1985('0x31')][_0x1985('0x35')]));_0x200b01['attributes']=_0x200b01[_0x1985('0x36')]['length']?_0x200b01[_0x1985('0x36')]:_0x92b2df[_0x1985('0x30')];_0x200b01[_0x1985('0x57')]=qs[_0x1985('0x38')](_0x4469e5[_0x1985('0x31')][_0x1985('0x38')]);_0x200b01[_0x1985('0x39')]=qs[_0x1985('0x33')](_['pick'](_0x4469e5[_0x1985('0x31')],_0x92b2df[_0x1985('0x33')]));if(_0x4469e5[_0x1985('0x31')][_0x1985('0x3b')]){_0x200b01[_0x1985('0x39')]=_[_0x1985('0x3c')](_0x200b01[_0x1985('0x39')],{'$or':_[_0x1985('0x2c')](_0x200b01[_0x1985('0x36')],function(_0x2ed1ee){var _0x747f33={};_0x747f33[_0x2ed1ee]={'$like':'%'+_0x4469e5[_0x1985('0x31')][_0x1985('0x3b')]+'%'};return _0x747f33;})});}_0x200b01=_[_0x1985('0x3c')]({},_0x200b01,_0x4469e5[_0x1985('0x3e')]);return _0x4e1155[_0x1985('0x55')](_0x200b01);}})[_0x1985('0x22')](function(_0x5124b3){if(_0x5124b3){_0x3c0c44=_0x5124b3['length'];if(!_0x4469e5[_0x1985('0x31')][_0x1985('0x58')](_0x1985('0x37'))){_0x200b01['limit']=qs['limit'](_0x4469e5['query'][_0x1985('0x1b')]);_0x200b01[_0x1985('0x1a')]=qs[_0x1985('0x1a')](_0x4469e5['query']['offset']);}return _0x4e1155[_0x1985('0x55')](_0x200b01);}})[_0x1985('0x22')](function(_0x5076ee){if(_0x5076ee){return _0x5076ee?{'count':_0x3c0c44,'rows':_0x5076ee}:null;}})['then'](respondWithResult(_0x580470,null))[_0x1985('0x48')](handleError(_0x580470,null));};exports[_0x1985('0x59')]=function(_0x220f2a,_0x4dbd99,_0x4f54c9){return db[_0x1985('0x40')][_0x1985('0x56')]({'where':{'id':_0x220f2a[_0x1985('0x43')]['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x4dbd99,null))[_0x1985('0x22')](function(_0x175a15){if(_0x175a15){return db[_0x1985('0x5a')][_0x1985('0x5b')](function(_0x36388e){return db[_0x1985('0x40')][_0x1985('0x26')]({'where':{'IntervalId':_0x220f2a['params']['id']},'transaction':_0x36388e})[_0x1985('0x22')](function(_0x5c22d8){var _0x38d161=_[_0x1985('0x2c')](_0x220f2a[_0x1985('0x4a')],function(_0x4e4172){delete _0x4e4172['id'];_0x4e4172['IntervalId']=_0x220f2a[_0x1985('0x43')]['id'];return _0x4e4172;});return db[_0x1985('0x40')][_0x1985('0x5c')](_0x38d161,{'transaction':_0x36388e});});})['then'](function(){return db[_0x1985('0x40')][_0x1985('0x41')]({'where':{'IntervalId':_0x220f2a['params']['id']}});});}})[_0x1985('0x22')](respondWithResult(_0x4dbd99,null))[_0x1985('0x48')](handleError(_0x4dbd99,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 82a67dd..5180fd8 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 _0x2645=['interval','getIntervals','then','ifTime','../../utils/iftime','iftime','exports','tools_intervals','rewrite'];(function(_0x485aa6,_0x82cc72){var _0x36bade=function(_0x4d346c){while(--_0x4d346c){_0x485aa6['push'](_0x485aa6['shift']());}};_0x36bade(++_0x82cc72);}(_0x2645,0x9d));var _0x5264=function(_0x347583,_0x138a1e){_0x347583=_0x347583-0x0;var _0x2e9668=_0x2645[_0x347583];return _0x2e9668;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x5264('0x0'))[_0x5264('0x1')];module[_0x5264('0x2')]=function(_0x2f4c5b){return _0x2f4c5b['define']('Interval',attributes,{'tableName':_0x5264('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4395f0){extensions[_0x5264('0x4')](_0x2f4c5b,_0x4395f0);},'afterBulkCreate':function(_0x42e815,_0x945ce0,_0x2e7027){_0x2e7027();extensions[_0x5264('0x4')](_0x2f4c5b,_0x42e815[0x0]);},'afterUpdate':function(_0x57a582){extensions[_0x5264('0x4')](_0x2f4c5b,_0x57a582);},'afterDestroy':function(_0x27dfb7){extensions['rewrite'](_0x2f4c5b,_0x27dfb7);}},'instanceMethods':{'ifTime':function(_0x5d363e=undefined,_0x7715f4=new Date()){if(typeof this[_0x5264('0x5')]==='string'){return iftime(this[_0x5264('0x5')],_0x5d363e,_0x7715f4);}else{return this[_0x5264('0x6')]()[_0x5264('0x7')](function(_0x401ede){return Promise['all'](_0x401ede['map'](function(_0x2851a3){return _0x2851a3[_0x5264('0x8')](_0x5d363e,_0x7715f4);}));})[_0x5264('0x7')](function(_0xd32d9a){return _0xd32d9a['reduce'](function(_0x26f54c,_0x38b08f){return _0x26f54c||_0x38b08f;},![]);});}}}});}; \ No newline at end of file +var _0x02d9=['../../utils/iftime','iftime','define','Interval','tools_intervals','rewrite','interval','string','getIntervals','then','map','ifTime','reduce','./interval.attributes'];(function(_0x37102d,_0x44b823){var _0x5b68cc=function(_0x3ff90a){while(--_0x3ff90a){_0x37102d['push'](_0x37102d['shift']());}};_0x5b68cc(++_0x44b823);}(_0x02d9,0xdf));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x902d('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x902d('0x1'))[_0x902d('0x2')];module['exports']=function(_0x5e9806){return _0x5e9806[_0x902d('0x3')](_0x902d('0x4'),attributes,{'tableName':_0x902d('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x469907){extensions[_0x902d('0x6')](_0x5e9806,_0x469907);},'afterBulkCreate':function(_0x174c5a,_0x322b8e,_0x2143a8){_0x2143a8();extensions[_0x902d('0x6')](_0x5e9806,_0x174c5a[0x0]);},'afterUpdate':function(_0x5de7a1){extensions['rewrite'](_0x5e9806,_0x5de7a1);},'afterDestroy':function(_0x145f4d){extensions[_0x902d('0x6')](_0x5e9806,_0x145f4d);}},'instanceMethods':{'ifTime':function(_0x40489d=undefined,_0xed4b34=new Date()){if(typeof this[_0x902d('0x7')]===_0x902d('0x8')){return iftime(this[_0x902d('0x7')],_0x40489d,_0xed4b34);}else{return this[_0x902d('0x9')]()[_0x902d('0xa')](function(_0x141c8e){return Promise['all'](_0x141c8e[_0x902d('0xb')](function(_0x103a51){return _0x103a51[_0x902d('0xc')](_0x40489d,_0xed4b34);}));})[_0x902d('0xa')](function(_0x34f4ad){return _0x34f4ad[_0x902d('0xd')](function(_0x344f68,_0x519472){return _0x344f68||_0x519472;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6bc5b7d..0624bcb 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 _0x6bac=['reduce','util','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','find','ShowInterval','findAll','ifTime','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','format','name','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve'];(function(_0x21660c,_0x1e5526){var _0x4959f0=function(_0x3db959){while(--_0x3db959){_0x21660c['push'](_0x21660c['shift']());}};_0x4959f0(++_0x1e5526);}(_0x6bac,0x7f));var _0xc6ba=function(_0x364a3a,_0x5b4fe4){_0x364a3a=_0x364a3a-0x0;var _0x17fef8=_0x6bac[_0x364a3a];return _0x17fef8;};'use strict';var _=require('lodash');var util=require(_0xc6ba('0x0'));var db=require('../../mysqldb')['db'];var iftime=require(_0xc6ba('0x1'))[_0xc6ba('0x2')];var logger=require(_0xc6ba('0x3'))('rpc');exports[_0xc6ba('0x4')]=function(_0xc985f9){var _0x5d0c7e=this;return new Promise(function(_0x3a78af,_0x260ede){return db[_0xc6ba('0x5')]['findAll']({'raw':_0xc985f9[_0xc6ba('0x6')]?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0x7')]===undefined?!![]:![]:!![],'where':_0xc985f9[_0xc6ba('0x6')]?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0x8')]||null:null,'attributes':_0xc985f9[_0xc6ba('0x6')]?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0x9')]||null:null,'limit':_0xc985f9['options']?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0xa')]||null:null,'include':_0xc985f9['options']?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0xb')]?_[_0xc6ba('0xc')](_0xc985f9['options'][_0xc6ba('0xb')],function(_0x387eec){return{'model':db[_0x387eec['model']],'as':_0x387eec['as'],'attributes':_0x387eec[_0xc6ba('0x9')],'include':_0x387eec[_0xc6ba('0xb')]?_['map'](_0x387eec[_0xc6ba('0xb')],function(_0x3190bc){return{'model':db[_0x3190bc[_0xc6ba('0xd')]],'as':_0x3190bc['as'],'attributes':_0x3190bc[_0xc6ba('0x9')],'include':_0x3190bc[_0xc6ba('0xb')]?_[_0xc6ba('0xc')](_0x3190bc[_0xc6ba('0xb')],function(_0x4f23a7){return{'model':db[_0x4f23a7[_0xc6ba('0xd')]],'as':_0x4f23a7['as'],'attributes':_0x4f23a7['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6ba('0xe')](function(_0x12f9df){logger[_0xc6ba('0xf')](_0xc6ba('0x4'),_0xc985f9);logger[_0xc6ba('0x10')](_0xc6ba('0x4'),_0xc985f9,JSON[_0xc6ba('0x11')](_0x12f9df));_0x3a78af(_0x12f9df);})[_0xc6ba('0x12')](function(_0x5b3590){logger[_0xc6ba('0x13')](_0xc6ba('0x4'),_0x5b3590['message'],_0xc985f9);_0x260ede(_0x5d0c7e[_0xc6ba('0x13')](0x1f4,_0x5b3590[_0xc6ba('0x14')]));});});};exports['ShowInterval']=function(_0x34c8b3){var _0x49148b=this;return new Promise(function(_0x1a98d5,_0x352641){return db['Interval'][_0xc6ba('0x15')]({'raw':_0x34c8b3[_0xc6ba('0x6')]?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0x7')]===undefined?!![]:![]:!![],'where':_0x34c8b3['options']?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0x8')]||null:null,'attributes':_0x34c8b3[_0xc6ba('0x6')]?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0x9')]||null:null,'include':_0x34c8b3[_0xc6ba('0x6')]?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0xb')]?_[_0xc6ba('0xc')](_0x34c8b3['options'][_0xc6ba('0xb')],function(_0x5ef128){return{'model':db[_0x5ef128['model']],'as':_0x5ef128['as'],'attributes':_0x5ef128['attributes'],'include':_0x5ef128['include']?_[_0xc6ba('0xc')](_0x5ef128['include'],function(_0x5ab2f6){return{'model':db[_0x5ab2f6[_0xc6ba('0xd')]],'as':_0x5ab2f6['as'],'attributes':_0x5ab2f6['attributes'],'include':_0x5ab2f6['include']?_[_0xc6ba('0xc')](_0x5ab2f6[_0xc6ba('0xb')],function(_0xd1e7fa){return{'model':db[_0xd1e7fa[_0xc6ba('0xd')]],'as':_0xd1e7fa['as'],'attributes':_0xd1e7fa[_0xc6ba('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aa58e){logger['info'](_0xc6ba('0x16'),_0x34c8b3);logger[_0xc6ba('0x10')](_0xc6ba('0x16'),_0x34c8b3,JSON['stringify'](_0x4aa58e));_0x1a98d5(_0x4aa58e);})[_0xc6ba('0x12')](function(_0x43ded8){logger['error'](_0xc6ba('0x16'),_0x43ded8[_0xc6ba('0x14')],_0x34c8b3);_0x352641(_0x49148b[_0xc6ba('0x13')](0x1f4,_0x43ded8[_0xc6ba('0x14')]));});});};function checkArrayOfIntervals(_0x18c56b,_0x495886){var _0x5f3184=[];return db['Interval'][_0xc6ba('0x17')]({'where':{'id':_0x18c56b}})[_0xc6ba('0xe')](function(_0x4e0557){_0x5f3184=_0x4e0557;return Promise['all'](_0x5f3184[_0xc6ba('0xc')](function(_0x484a8a){return _0x484a8a[_0xc6ba('0x18')](_0x495886);}));})[_0xc6ba('0xe')](function(_0x1cd885){var _0xec6eef=_0x1cd885['reduce'](function(_0x4e135a,_0x460b80){return _0x4e135a||_0x460b80;},![]);logger[_0xc6ba('0xf')](util['format'](_0xc6ba('0x19'),_0x5f3184[_0xc6ba('0xc')](function(_0x519a6a){return _0x519a6a['name'];})['join'](',\x20'),_0x5f3184[_0xc6ba('0xc')](function(_0x2e8ec1){return _0x2e8ec1['id'];})[_0xc6ba('0x1a')](',\x20')));return _0xec6eef;});}function checkSingleInterval(_0x308b8e,_0x273ea6){return db[_0xc6ba('0x5')][_0xc6ba('0x1b')](_0x308b8e)['then'](function(_0xe43962){if(_0xe43962){logger[_0xc6ba('0xf')](util[_0xc6ba('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0xe43962[_0xc6ba('0x1d')],_0xe43962['id']));return _0xe43962[_0xc6ba('0x18')](_0x273ea6);}});}exports[_0xc6ba('0x1e')]=function(_0x112a22){var _0x1df5b7=_0x112a22[_0xc6ba('0x1f')];var _0xc5bdaf=Array[_0xc6ba('0x20')](_0x112a22['intervals'])?_0x112a22['intervals']:typeof _0x112a22[_0xc6ba('0x21')]===_0xc6ba('0x22')?[_0x112a22[_0xc6ba('0x21')]]:[];var _0x53b471=_0x112a22[_0xc6ba('0x23')]||undefined;var _0x3f5b5e=![];if(_0xc5bdaf[_0xc6ba('0x24')]){logger[_0xc6ba('0xf')](util['format'](_0xc6ba('0x25'),_0xc5bdaf[_0xc6ba('0x1a')](';\x20')));}if(_0x53b471){logger[_0xc6ba('0xf')](util[_0xc6ba('0x1c')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x53b471));}logger[_0xc6ba('0x10')](_0xc6ba('0x26'),_0x3f5b5e);logger[_0xc6ba('0x27')](_0xc6ba('0x1e'),_0x112a22);return Promise[_0xc6ba('0x28')]()['then'](function(){if(Array[_0xc6ba('0x20')](_0x1df5b7)){return checkArrayOfIntervals(_0x1df5b7,_0x53b471);}else if(_0x1df5b7){return checkSingleInterval(_0x1df5b7,_0x53b471);}})['then'](function(_0x1f51ea){var _0x3712c0=_0xc5bdaf[_0xc6ba('0x29')](function(_0x20a74e,_0x421407){return _0x20a74e||iftime(_0x421407,_0x53b471);},![]);_0x3f5b5e=_0x1f51ea||_0x3712c0;return _0x3f5b5e;})[_0xc6ba('0x12')](function(_0x402a87){logger['error']('IntervalIftime',_0x112a22,_0x402a87);throw this[_0xc6ba('0x13')](0x1f4,_0x402a87[_0xc6ba('0x14')]);});}; \ No newline at end of file +var _0x2bf8=['rpc','GetInterval','options','raw','where','attributes','limit','map','model','include','then','info','debug','catch','error','message','Interval','ShowInterval','stringify','findAll','all','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','timezone','length','format','IntervalIftime:\x20interval\x20strings\x20=\x20%s','silly','reduce','lodash','../../mysqldb','iftime','../../config/logger'];(function(_0x34c612,_0x47f113){var _0x29a140=function(_0x46b06b){while(--_0x46b06b){_0x34c612['push'](_0x34c612['shift']());}};_0x29a140(++_0x47f113);}(_0x2bf8,0x74));var _0x82bf=function(_0xc77e42,_0x48f2a6){_0xc77e42=_0xc77e42-0x0;var _0x5fb943=_0x2bf8[_0xc77e42];return _0x5fb943;};'use strict';var _=require(_0x82bf('0x0'));var util=require('util');var db=require(_0x82bf('0x1'))['db'];var iftime=require('../../utils/iftime')[_0x82bf('0x2')];var logger=require(_0x82bf('0x3'))(_0x82bf('0x4'));exports[_0x82bf('0x5')]=function(_0x5ae70b){var _0x1c25ed=this;return new Promise(function(_0x1426b1,_0x15c7a3){return db['Interval']['findAll']({'raw':_0x5ae70b[_0x82bf('0x6')]?_0x5ae70b['options'][_0x82bf('0x7')]===undefined?!![]:![]:!![],'where':_0x5ae70b[_0x82bf('0x6')]?_0x5ae70b[_0x82bf('0x6')][_0x82bf('0x8')]||null:null,'attributes':_0x5ae70b[_0x82bf('0x6')]?_0x5ae70b['options'][_0x82bf('0x9')]||null:null,'limit':_0x5ae70b[_0x82bf('0x6')]?_0x5ae70b[_0x82bf('0x6')][_0x82bf('0xa')]||null:null,'include':_0x5ae70b['options']?_0x5ae70b[_0x82bf('0x6')]['include']?_[_0x82bf('0xb')](_0x5ae70b[_0x82bf('0x6')]['include'],function(_0xc7c910){return{'model':db[_0xc7c910[_0x82bf('0xc')]],'as':_0xc7c910['as'],'attributes':_0xc7c910['attributes'],'include':_0xc7c910[_0x82bf('0xd')]?_[_0x82bf('0xb')](_0xc7c910[_0x82bf('0xd')],function(_0x34a6f9){return{'model':db[_0x34a6f9[_0x82bf('0xc')]],'as':_0x34a6f9['as'],'attributes':_0x34a6f9[_0x82bf('0x9')],'include':_0x34a6f9[_0x82bf('0xd')]?_['map'](_0x34a6f9[_0x82bf('0xd')],function(_0x48be4b){return{'model':db[_0x48be4b['model']],'as':_0x48be4b['as'],'attributes':_0x48be4b[_0x82bf('0x9')]};}):[]};}):[]};}):[]:[]})[_0x82bf('0xe')](function(_0x5b7b6e){logger[_0x82bf('0xf')](_0x82bf('0x5'),_0x5ae70b);logger[_0x82bf('0x10')](_0x82bf('0x5'),_0x5ae70b,JSON['stringify'](_0x5b7b6e));_0x1426b1(_0x5b7b6e);})[_0x82bf('0x11')](function(_0x1f36ac){logger[_0x82bf('0x12')]('GetInterval',_0x1f36ac[_0x82bf('0x13')],_0x5ae70b);_0x15c7a3(_0x1c25ed[_0x82bf('0x12')](0x1f4,_0x1f36ac[_0x82bf('0x13')]));});});};exports['ShowInterval']=function(_0x1e6935){var _0x4c03ca=this;return new Promise(function(_0x20af9a,_0x259b85){return db[_0x82bf('0x14')]['find']({'raw':_0x1e6935['options']?_0x1e6935[_0x82bf('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x1e6935[_0x82bf('0x6')]?_0x1e6935[_0x82bf('0x6')][_0x82bf('0x8')]||null:null,'attributes':_0x1e6935['options']?_0x1e6935[_0x82bf('0x6')]['attributes']||null:null,'include':_0x1e6935[_0x82bf('0x6')]?_0x1e6935[_0x82bf('0x6')]['include']?_[_0x82bf('0xb')](_0x1e6935[_0x82bf('0x6')]['include'],function(_0xcfc2e3){return{'model':db[_0xcfc2e3['model']],'as':_0xcfc2e3['as'],'attributes':_0xcfc2e3[_0x82bf('0x9')],'include':_0xcfc2e3[_0x82bf('0xd')]?_[_0x82bf('0xb')](_0xcfc2e3[_0x82bf('0xd')],function(_0x149e2b){return{'model':db[_0x149e2b[_0x82bf('0xc')]],'as':_0x149e2b['as'],'attributes':_0x149e2b[_0x82bf('0x9')],'include':_0x149e2b['include']?_['map'](_0x149e2b[_0x82bf('0xd')],function(_0x1c71cd){return{'model':db[_0x1c71cd[_0x82bf('0xc')]],'as':_0x1c71cd['as'],'attributes':_0x1c71cd[_0x82bf('0x9')]};}):[]};}):[]};}):[]:[]})[_0x82bf('0xe')](function(_0x5b11c3){logger['info'](_0x82bf('0x15'),_0x1e6935);logger['debug'](_0x82bf('0x15'),_0x1e6935,JSON[_0x82bf('0x16')](_0x5b11c3));_0x20af9a(_0x5b11c3);})[_0x82bf('0x11')](function(_0x3a4157){logger[_0x82bf('0x12')](_0x82bf('0x15'),_0x3a4157['message'],_0x1e6935);_0x259b85(_0x4c03ca[_0x82bf('0x12')](0x1f4,_0x3a4157[_0x82bf('0x13')]));});});};function checkArrayOfIntervals(_0x25ada9,_0x47f0cd){var _0x34b6f9=[];return db[_0x82bf('0x14')][_0x82bf('0x17')]({'where':{'id':_0x25ada9}})[_0x82bf('0xe')](function(_0x41dde0){_0x34b6f9=_0x41dde0;return Promise[_0x82bf('0x18')](_0x34b6f9[_0x82bf('0xb')](function(_0x35a598){return _0x35a598['ifTime'](_0x47f0cd);}));})[_0x82bf('0xe')](function(_0x36a9fa){var _0x23f715=_0x36a9fa['reduce'](function(_0xd7f2e0,_0x424508){return _0xd7f2e0||_0x424508;},![]);logger[_0x82bf('0xf')](util['format'](_0x82bf('0x19'),_0x34b6f9[_0x82bf('0xb')](function(_0x2e83b6){return _0x2e83b6[_0x82bf('0x1a')];})[_0x82bf('0x1b')](',\x20'),_0x34b6f9[_0x82bf('0xb')](function(_0x4866d7){return _0x4866d7['id'];})[_0x82bf('0x1b')](',\x20')));return _0x23f715;});}function checkSingleInterval(_0x11138a,_0x2ce64f){return db[_0x82bf('0x14')][_0x82bf('0x1c')](_0x11138a)[_0x82bf('0xe')](function(_0x1b0266){if(_0x1b0266){logger[_0x82bf('0xf')](util['format'](_0x82bf('0x1d'),_0x1b0266[_0x82bf('0x1a')],_0x1b0266['id']));return _0x1b0266['ifTime'](_0x2ce64f);}});}exports[_0x82bf('0x1e')]=function(_0x3acd67){var _0x4d8c67=_0x3acd67[_0x82bf('0x1f')];var _0x350fbd=Array[_0x82bf('0x20')](_0x3acd67[_0x82bf('0x21')])?_0x3acd67[_0x82bf('0x21')]:typeof _0x3acd67['intervals']==='string'?[_0x3acd67[_0x82bf('0x21')]]:[];var _0x265d85=_0x3acd67[_0x82bf('0x22')]||undefined;var _0x220967=![];if(_0x350fbd[_0x82bf('0x23')]){logger['info'](util[_0x82bf('0x24')](_0x82bf('0x25'),_0x350fbd[_0x82bf('0x1b')](';\x20')));}if(_0x265d85){logger['info'](util[_0x82bf('0x24')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x265d85));}logger['debug']('Iftime',_0x220967);logger[_0x82bf('0x26')]('IntervalIftime',_0x3acd67);return Promise['resolve']()['then'](function(){if(Array['isArray'](_0x4d8c67)){return checkArrayOfIntervals(_0x4d8c67,_0x265d85);}else if(_0x4d8c67){return checkSingleInterval(_0x4d8c67,_0x265d85);}})['then'](function(_0x3a0209){var _0xe9a483=_0x350fbd[_0x82bf('0x27')](function(_0x1d9a68,_0xf19024){return _0x1d9a68||iftime(_0xf19024,_0x265d85);},![]);_0x220967=_0x3a0209||_0xe9a483;return _0x220967;})[_0x82bf('0x11')](function(_0x3e4c51){logger[_0x82bf('0x12')](_0x82bf('0x1e'),_0x3acd67,_0x3e4c51);throw this[_0x82bf('0x12')](0x1f4,_0x3e4c51[_0x82bf('0x13')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 429d021..d176c90 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0x0b0e[_0x5302fb];return _0x43e6a4;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2ee227,_0x3545d4){var _0x40cc61=function(_0x3c105e){while(--_0x3c105e){_0x2ee227['push'](_0x2ee227['shift']());}};_0x40cc61(++_0x3545d4);}(_0x2032,0xd9));var _0x2203=function(_0x5e4952,_0x594394){_0x5e4952=_0x5e4952-0x0;var _0x50b4aa=_0x2032[_0x5e4952];return _0x50b4aa;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 30c9e62..3349f50 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 _0xa893=['remoteAddress','bluebird','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','stringify','request','setEncoding','data','end','status','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body','headers','connection','socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa893,0xdd));var _0x3a89=function(_0x3d5963,_0x5a3ebf){_0x3d5963=_0x3d5963-0x0;var _0x22726b=_0xa893[_0x3d5963];return _0x22726b;};'use strict';var BPromise=require(_0x3a89('0x0'));var https=require('https');var logger=require(_0x3a89('0x1'))('api');var USERNAME=_0x3a89('0x2');var PASSWORD=_0x3a89('0x3');function openIssue(_0x5275dc,_0x5002bd){var _0x58f8d8={'fields':{'project':{'key':_0x5275dc[_0x3a89('0x4')]||_0x3a89('0x5')},'summary':(_0x5275dc['summary']||_0x3a89('0x6'))+_0x3a89('0x7')+_0x5275dc['ip'],'description':_0x5275dc[_0x3a89('0x8')]||JSON['stringify'](_0x5275dc),'issuetype':{'name':_0x5275dc[_0x3a89('0x9')]||'Bug'}}};_0x58f8d8[_0x3a89('0xa')][_0x3a89('0xb')]=_0x5275dc[_0x3a89('0xc')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0xd')]=_0x5275dc[_0x3a89('0xe')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0xf')]=_0x5275dc[_0x3a89('0x10')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0x11')]=_0x5275dc[_0x3a89('0x12')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0x13')]=_0x5275dc[_0x3a89('0x14')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0x15')]=_0x5275dc['ip'];var _0x19bbf8={'host':_0x3a89('0x16'),'port':0x1bb,'path':_0x3a89('0x17'),'method':_0x3a89('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x3a89('0x19'),'Authorization':_0x3a89('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3a89('0x1b'))}};var _0x524878=JSON[_0x3a89('0x1c')](_0x58f8d8);var _0x4f7019=https[_0x3a89('0x1d')](_0x19bbf8,function(_0x32a677){_0x32a677[_0x3a89('0x1e')]('utf8');var _0x30e7a4='';_0x32a677['on'](_0x3a89('0x1f'),function(_0x1df99e){_0x30e7a4+=_0x1df99e;});_0x32a677['on'](_0x3a89('0x20'),function(){if(_0x5002bd){return _0x5002bd[_0x3a89('0x21')](_0x32a677['statusCode'])['json'](JSON[_0x3a89('0x22')](_0x30e7a4));}});});_0x4f7019['on'](_0x3a89('0x23'),function(_0x3d5ad4){if(_0x5002bd){return _0x5002bd[_0x3a89('0x21')](0x1f4)['json']({'errors':[{'message':_0x3a89('0x24'),'type':_0x3a89('0x25')}]});}});_0x4f7019[_0x3a89('0x26')](_0x524878);_0x4f7019[_0x3a89('0x20')]();}exports['openIssue']=openIssue;exports['send']=function(_0x218b8e,_0x1cae93){_0x218b8e[_0x3a89('0x27')]['ip']=_0x218b8e[_0x3a89('0x28')]['x-forwarded-for']||_0x218b8e[_0x3a89('0x29')]['remoteAddress']||_0x218b8e[_0x3a89('0x2a')][_0x3a89('0x2b')]||_0x218b8e[_0x3a89('0x29')]['socket']['remoteAddress'];return openIssue(_0x218b8e[_0x3a89('0x27')],_0x1cae93);}; \ No newline at end of file +var _0x7bb4=['remoteAddress','socket','https','api','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','Bug','customfield_11500','customfield_11501','oldToken','fields','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','utf8','data','statusCode','json','parse','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','end','openIssue','body','headers','x-forwarded-for','connection'];(function(_0x4b3d12,_0x1d4133){var _0x104e8c=function(_0x55db69){while(--_0x55db69){_0x4b3d12['push'](_0x4b3d12['shift']());}};_0x104e8c(++_0x1d4133);}(_0x7bb4,0x7a));var _0x47bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bb4[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var https=require(_0x47bb('0x0'));var logger=require('../../config/logger')(_0x47bb('0x1'));var USERNAME='support';var PASSWORD=_0x47bb('0x2');function openIssue(_0x436f34,_0x5881fc){var _0x412967={'fields':{'project':{'key':_0x436f34[_0x47bb('0x3')]||'MOTGUI'},'summary':(_0x436f34[_0x47bb('0x4')]||_0x47bb('0x5'))+_0x47bb('0x6')+_0x436f34['ip'],'description':_0x436f34[_0x47bb('0x7')]||JSON[_0x47bb('0x8')](_0x436f34),'issuetype':{'name':_0x436f34['issuetype']||_0x47bb('0x9')}}};_0x412967['fields'][_0x47bb('0xa')]=_0x436f34['email'];_0x412967['fields'][_0x47bb('0xb')]=_0x436f34[_0x47bb('0xc')];_0x412967[_0x47bb('0xd')][_0x47bb('0xe')]=_0x436f34['newToken'];_0x412967[_0x47bb('0xd')][_0x47bb('0xf')]=_0x436f34[_0x47bb('0x10')];_0x412967[_0x47bb('0xd')][_0x47bb('0x11')]=_0x436f34[_0x47bb('0x12')];_0x412967[_0x47bb('0xd')][_0x47bb('0x13')]=_0x436f34['ip'];var _0x46933d={'host':_0x47bb('0x14'),'port':0x1bb,'path':_0x47bb('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x47bb('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x47bb('0x17')]('base64')}};var _0x33c6a7=JSON[_0x47bb('0x8')](_0x412967);var _0x28fbcc=https['request'](_0x46933d,function(_0x466f34){_0x466f34['setEncoding'](_0x47bb('0x18'));var _0x1d46ef='';_0x466f34['on'](_0x47bb('0x19'),function(_0x3cd13c){_0x1d46ef+=_0x3cd13c;});_0x466f34['on']('end',function(){if(_0x5881fc){return _0x5881fc['status'](_0x466f34[_0x47bb('0x1a')])[_0x47bb('0x1b')](JSON[_0x47bb('0x1c')](_0x1d46ef));}});});_0x28fbcc['on']('error',function(_0x1cbf55){if(_0x5881fc){return _0x5881fc[_0x47bb('0x1d')](0x1f4)[_0x47bb('0x1b')]({'errors':[{'message':_0x47bb('0x1e'),'type':'api.jira'}]});}});_0x28fbcc[_0x47bb('0x1f')](_0x33c6a7);_0x28fbcc[_0x47bb('0x20')]();}exports[_0x47bb('0x21')]=openIssue;exports['send']=function(_0x304143,_0x2bc402){_0x304143[_0x47bb('0x22')]['ip']=_0x304143[_0x47bb('0x23')][_0x47bb('0x24')]||_0x304143[_0x47bb('0x25')][_0x47bb('0x26')]||_0x304143[_0x47bb('0x27')]['remoteAddress']||_0x304143['connection'][_0x47bb('0x27')][_0x47bb('0x26')];return openIssue(_0x304143[_0x47bb('0x22')],_0x2bc402);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 2d8a30b..9a587c1 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 _0xbdb7=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get','describe','show','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4a152a,_0x300e21){var _0x3aaf5a=function(_0x27238b){while(--_0x27238b){_0x4a152a['push'](_0x4a152a['shift']());}};_0x3aaf5a(++_0x300e21);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5208fa,_0x2e0115){_0x5208fa=_0x5208fa-0x0;var _0x340255=_0xbdb7[_0x5208fa];return _0x340255;};'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(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')]('/',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')](_0x7bdb('0x12'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0x14')]);module[_0x7bdb('0x15')]=router; \ No newline at end of file +var _0xb58b=['get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x84c0f5,_0x2004b0){var _0x154fba=function(_0xe21b7a){while(--_0xe21b7a){_0x84c0f5['push'](_0x84c0f5['shift']());}};_0x154fba(++_0x2004b0);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4debfd,_0x293699){_0x4debfd=_0x4debfd-0x0;var _0xfac19=_0xb58b[_0x4debfd];return _0xfac19;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0xd')]('/',auth[_0xbb58('0x8')](),controller[_0xbb58('0xe')]);router['put'](_0xbb58('0xb'),auth['isAuthenticated'](),controller[_0xbb58('0xf')]);router[_0xbb58('0x10')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['destroy']);module[_0xbb58('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 9612dc7..10a8c50 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x452fb0,_0x426c0e){_0x452fb0=_0x452fb0-0x0;var _0x361f0d=_0x7a54[_0x452fb0];return _0x361f0d;};'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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x29fe8f,_0x35288d){_0x29fe8f=_0x29fe8f-0x0;var _0x1036f8=_0x7a54[_0x29fe8f];return _0x1036f8;};'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 fdca220..fc74067 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 _0x815b=['length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','JscriptyAnswerReport','findAll','rows','show','rawAttributes','intersection','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','fieldName','key','model','map','keys','query','attributes','fields'];(function(_0x56357c,_0x3aa63a){var _0x423f55=function(_0x460877){while(--_0x460877){_0x56357c['push'](_0x56357c['shift']());}};_0x423f55(++_0x3aa63a);}(_0x815b,0xb4));var _0xb815=function(_0x86f275,_0x5ec44){_0x86f275=_0x86f275-0x0;var _0x2527ab=_0x815b[_0x86f275];return _0x2527ab;};'use strict';var emlformat=require(_0xb815('0x0'));var rimraf=require(_0xb815('0x1'));var zipdir=require(_0xb815('0x2'));var jsonpatch=require(_0xb815('0x3'));var rp=require(_0xb815('0x4'));var moment=require('moment');var BPromise=require(_0xb815('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb815('0x6'));var sox=require(_0xb815('0x7'));var csv=require(_0xb815('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb815('0x9'));var _=require(_0xb815('0xa'));var squel=require('squel');var crypto=require(_0xb815('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb815('0x8'));var querystring=require(_0xb815('0xc'));var Papa=require(_0xb815('0xd'));var Redis=require(_0xb815('0xe'));var authService=require(_0xb815('0xf'));var qs=require(_0xb815('0x10'));var as=require(_0xb815('0x11'));var hardwareService=require(_0xb815('0x12'));var logger=require('../../config/logger')(_0xb815('0x13'));var utils=require(_0xb815('0x14'));var config=require(_0xb815('0x15'));var licenseUtil=require(_0xb815('0x16'));var db=require(_0xb815('0x17'))['db'];function respondWithStatusCode(_0x3ce2fb,_0x3e5c50){_0x3e5c50=_0x3e5c50||0xcc;return function(_0x5af22a){if(_0x5af22a){return _0x3ce2fb['sendStatus'](_0x3e5c50);}return _0x3ce2fb[_0xb815('0x18')](_0x3e5c50)[_0xb815('0x19')]();};}function respondWithResult(_0x13a09e,_0xff2720){_0xff2720=_0xff2720||0xc8;return function(_0x32b50a){if(_0x32b50a){return _0x13a09e[_0xb815('0x18')](_0xff2720)[_0xb815('0x1a')](_0x32b50a);}};}function respondWithFilteredResult(_0x4636c7,_0x966544){return function(_0xf456ca){if(_0xf456ca){var _0x3fd87d=typeof _0x966544[_0xb815('0x1b')]===_0xb815('0x1c')&&typeof _0x966544['limit']==='undefined';var _0x41445e=_0xf456ca[_0xb815('0x1d')];var _0x3f56ab=_0x3fd87d?0x0:_0x966544[_0xb815('0x1b')];var _0x324452=_0x3fd87d?_0xf456ca[_0xb815('0x1d')]:_0x966544[_0xb815('0x1b')]+_0x966544[_0xb815('0x1e')];var _0x839f08;if(_0x324452>=_0x41445e){_0x324452=_0x41445e;_0x839f08=0xc8;}else{_0x839f08=0xce;}_0x4636c7['status'](_0x839f08);return _0x4636c7['set'](_0xb815('0x1f'),_0x3f56ab+'-'+_0x324452+'/'+_0x41445e)['json'](_0xf456ca);}return null;};}function patchUpdates(_0x261b8d){return function(_0x1ebe78){try{jsonpatch[_0xb815('0x20')](_0x1ebe78,_0x261b8d,!![]);}catch(_0x3d7291){return BPromise['reject'](_0x3d7291);}return _0x1ebe78[_0xb815('0x21')]();};}function saveUpdates(_0x3c787e,_0x590eff){return function(_0x3f0f44){if(_0x3f0f44){return _0x3f0f44[_0xb815('0x22')](_0x3c787e)[_0xb815('0x23')](function(_0x37cf47){return _0x37cf47;});}return null;};}function removeEntity(_0x2ecffe,_0x19877b){return function(_0x100113){if(_0x100113){return _0x100113[_0xb815('0x24')]()[_0xb815('0x23')](function(){_0x2ecffe[_0xb815('0x18')](0xcc)[_0xb815('0x19')]();});}};}function handleEntityNotFound(_0x1a460c,_0x55b714){return function(_0x1a07cc){if(!_0x1a07cc){_0x1a460c[_0xb815('0x25')](0x194);}return _0x1a07cc;};}function handleError(_0x350448,_0x33211e){_0x33211e=_0x33211e||0x1f4;return function(_0x5f2eaf){logger[_0xb815('0x26')](_0x5f2eaf[_0xb815('0x27')]);if(_0x5f2eaf[_0xb815('0x28')]){delete _0x5f2eaf['name'];}_0x350448[_0xb815('0x18')](_0x33211e)[_0xb815('0x29')](_0x5f2eaf);};}exports[_0xb815('0x2a')]=function(_0x26bef8,_0x2e9199){var _0x3b0152={},_0x7e8a20={},_0xd22488={'count':0x0,'rows':[]};var _0x46c545=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x45b5e5){return{'name':_0x45b5e5[_0xb815('0x2b')],'type':_0x45b5e5['type'][_0xb815('0x2c')]};});_0x7e8a20[_0xb815('0x2d')]=_[_0xb815('0x2e')](_0x46c545,_0xb815('0x28'));_0x7e8a20['query']=_[_0xb815('0x2f')](_0x26bef8[_0xb815('0x30')]);_0x7e8a20['filters']=_['intersection'](_0x7e8a20[_0xb815('0x2d')],_0x7e8a20['query']);_0x3b0152[_0xb815('0x31')]=_['intersection'](_0x7e8a20[_0xb815('0x2d')],qs['fields'](_0x26bef8[_0xb815('0x30')][_0xb815('0x32')]));_0x3b0152[_0xb815('0x31')]=_0x3b0152['attributes'][_0xb815('0x33')]?_0x3b0152[_0xb815('0x31')]:_0x7e8a20['model'];if(!_0x26bef8[_0xb815('0x30')][_0xb815('0x34')](_0xb815('0x35'))){_0x3b0152[_0xb815('0x1e')]=qs[_0xb815('0x1e')](_0x26bef8[_0xb815('0x30')]['limit']);_0x3b0152[_0xb815('0x1b')]=qs[_0xb815('0x1b')](_0x26bef8[_0xb815('0x30')][_0xb815('0x1b')]);}_0x3b0152[_0xb815('0x36')]=qs['sort'](_0x26bef8['query']['sort']);_0x3b0152[_0xb815('0x37')]=qs['filters'](_[_0xb815('0x38')](_0x26bef8[_0xb815('0x30')],_0x7e8a20[_0xb815('0x39')]),_0x46c545);if(_0x26bef8[_0xb815('0x30')][_0xb815('0x3a')]){_0x3b0152[_0xb815('0x37')]=_[_0xb815('0x3b')](_0x3b0152[_0xb815('0x37')],{'$or':_[_0xb815('0x2e')](_0x46c545,function(_0x26cfe3){if(_0x26cfe3[_0xb815('0x3c')]!==_0xb815('0x3d')){var _0x1dcdb3={};_0x1dcdb3[_0x26cfe3[_0xb815('0x28')]]={'$like':'%'+_0x26bef8[_0xb815('0x30')][_0xb815('0x3a')]+'%'};return _0x1dcdb3;}})});}_0x3b0152=_[_0xb815('0x3b')]({},_0x3b0152,_0x26bef8[_0xb815('0x3e')]);var _0x554495={'where':_0x3b0152['where']};return db['JscriptyAnswerReport'][_0xb815('0x1d')](_0x554495)[_0xb815('0x23')](function(_0x563ea2){_0xd22488[_0xb815('0x1d')]=_0x563ea2;if(_0x26bef8[_0xb815('0x30')][_0xb815('0x3f')]){_0x3b0152[_0xb815('0x40')]=[{'all':!![]}];}return db[_0xb815('0x41')][_0xb815('0x42')](_0x3b0152);})['then'](function(_0x572803){_0xd22488[_0xb815('0x43')]=_0x572803;return _0xd22488;})['then'](respondWithFilteredResult(_0x2e9199,_0x3b0152))['catch'](handleError(_0x2e9199,null));};exports[_0xb815('0x44')]=function(_0xdd9e31,_0x2ff7a7){var _0x388754={'raw':!![],'where':{'id':_0xdd9e31['params']['id']}},_0x4c8655={};_0x4c8655[_0xb815('0x2d')]=_[_0xb815('0x2f')](db[_0xb815('0x41')][_0xb815('0x45')]);_0x4c8655[_0xb815('0x30')]=_[_0xb815('0x2f')](_0xdd9e31[_0xb815('0x30')]);_0x4c8655[_0xb815('0x39')]=_[_0xb815('0x46')](_0x4c8655['model'],_0x4c8655[_0xb815('0x30')]);_0x388754['attributes']=_[_0xb815('0x46')](_0x4c8655['model'],qs[_0xb815('0x32')](_0xdd9e31[_0xb815('0x30')][_0xb815('0x32')]));_0x388754['attributes']=_0x388754['attributes'][_0xb815('0x33')]?_0x388754[_0xb815('0x31')]:_0x4c8655[_0xb815('0x2d')];if(_0xdd9e31['query'][_0xb815('0x3f')]){_0x388754[_0xb815('0x40')]=[{'all':!![]}];}_0x388754=_[_0xb815('0x3b')]({},_0x388754,_0xdd9e31[_0xb815('0x3e')]);return db[_0xb815('0x41')][_0xb815('0x47')](_0x388754)[_0xb815('0x23')](handleEntityNotFound(_0x2ff7a7,null))[_0xb815('0x23')](respondWithResult(_0x2ff7a7,null))['catch'](handleError(_0x2ff7a7,null));};exports['create']=function(_0x17c39c,_0x3a46f3){return db[_0xb815('0x41')][_0xb815('0x48')](_0x17c39c['body'],{})['then'](respondWithResult(_0x3a46f3,0xc9))[_0xb815('0x49')](handleError(_0x3a46f3,null));};exports[_0xb815('0x22')]=function(_0x549106,_0xfb3946){if(_0x549106['body']['id']){delete _0x549106[_0xb815('0x4a')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x549106[_0xb815('0x4b')]['id']}})['then'](handleEntityNotFound(_0xfb3946,null))[_0xb815('0x23')](saveUpdates(_0x549106[_0xb815('0x4a')],null))[_0xb815('0x23')](respondWithResult(_0xfb3946,null))['catch'](handleError(_0xfb3946,null));};exports[_0xb815('0x24')]=function(_0xe75271,_0x1ce83d){return db[_0xb815('0x41')][_0xb815('0x47')]({'where':{'id':_0xe75271[_0xb815('0x4b')]['id']}})[_0xb815('0x23')](handleEntityNotFound(_0x1ce83d,null))['then'](removeEntity(_0x1ce83d,null))[_0xb815('0x49')](handleError(_0x1ce83d,null));};exports[_0xb815('0x4c')]=function(_0x2ef92a,_0x4d74fc){return db['JscriptyAnswerReport'][_0xb815('0x4c')]()[_0xb815('0x23')](respondWithResult(_0x4d74fc,null))[_0xb815('0x49')](handleError(_0x4d74fc,null));}; \ No newline at end of file +var _0x1dcc=['then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','set','Content-Range','reject','save','update'];(function(_0x53dfa0,_0x710b39){var _0xd9fd4d=function(_0x4b4505){while(--_0x4b4505){_0x53dfa0['push'](_0x53dfa0['shift']());}};_0xd9fd4d(++_0x710b39);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x206b01,_0x524864){_0x206b01=_0x206b01-0x0;var _0x140a5e=_0x1dcc[_0x206b01];return _0x140a5e;};'use strict';var emlformat=require(_0xc1dc('0x0'));var rimraf=require(_0xc1dc('0x1'));var zipdir=require(_0xc1dc('0x2'));var jsonpatch=require(_0xc1dc('0x3'));var rp=require('request-promise');var moment=require(_0xc1dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1dc('0x5'));var util=require(_0xc1dc('0x6'));var path=require(_0xc1dc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc1dc('0x8'));var fs=require('fs');var fs_extra=require(_0xc1dc('0x9'));var _=require(_0xc1dc('0xa'));var squel=require('squel');var crypto=require(_0xc1dc('0xb'));var jsforce=require(_0xc1dc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1dc('0xd'));var querystring=require('querystring');var Papa=require(_0xc1dc('0xe'));var Redis=require('ioredis');var authService=require(_0xc1dc('0xf'));var qs=require(_0xc1dc('0x10'));var as=require(_0xc1dc('0x11'));var hardwareService=require(_0xc1dc('0x12'));var logger=require(_0xc1dc('0x13'))(_0xc1dc('0x14'));var utils=require(_0xc1dc('0x15'));var config=require(_0xc1dc('0x16'));var licenseUtil=require(_0xc1dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226ba3,_0x2c5f41){_0x2c5f41=_0x2c5f41||0xcc;return function(_0xb7e667){if(_0xb7e667){return _0x226ba3['sendStatus'](_0x2c5f41);}return _0x226ba3[_0xc1dc('0x18')](_0x2c5f41)[_0xc1dc('0x19')]();};}function respondWithResult(_0x299520,_0xd51b1e){_0xd51b1e=_0xd51b1e||0xc8;return function(_0x145708){if(_0x145708){return _0x299520[_0xc1dc('0x18')](_0xd51b1e)[_0xc1dc('0x1a')](_0x145708);}};}function respondWithFilteredResult(_0x21aed1,_0x265929){return function(_0x37b23a){if(_0x37b23a){var _0x1cbbfe=typeof _0x265929['offset']===_0xc1dc('0x1b')&&typeof _0x265929[_0xc1dc('0x1c')]===_0xc1dc('0x1b');var _0x3d3315=_0x37b23a['count'];var _0x332400=_0x1cbbfe?0x0:_0x265929[_0xc1dc('0x1d')];var _0x499a42=_0x1cbbfe?_0x37b23a['count']:_0x265929[_0xc1dc('0x1d')]+_0x265929[_0xc1dc('0x1c')];var _0x197941;if(_0x499a42>=_0x3d3315){_0x499a42=_0x3d3315;_0x197941=0xc8;}else{_0x197941=0xce;}_0x21aed1[_0xc1dc('0x18')](_0x197941);return _0x21aed1[_0xc1dc('0x1e')](_0xc1dc('0x1f'),_0x332400+'-'+_0x499a42+'/'+_0x3d3315)[_0xc1dc('0x1a')](_0x37b23a);}return null;};}function patchUpdates(_0xd5a2e){return function(_0x5762e5){try{jsonpatch['apply'](_0x5762e5,_0xd5a2e,!![]);}catch(_0x4efe0d){return BPromise[_0xc1dc('0x20')](_0x4efe0d);}return _0x5762e5[_0xc1dc('0x21')]();};}function saveUpdates(_0x47af1e,_0x367965){return function(_0x19325f){if(_0x19325f){return _0x19325f[_0xc1dc('0x22')](_0x47af1e)[_0xc1dc('0x23')](function(_0x22b80d){return _0x22b80d;});}return null;};}function removeEntity(_0x2944a2,_0x353bf3){return function(_0x18ba56){if(_0x18ba56){return _0x18ba56[_0xc1dc('0x24')]()[_0xc1dc('0x23')](function(){_0x2944a2['status'](0xcc)[_0xc1dc('0x19')]();});}};}function handleEntityNotFound(_0xfeb0b1,_0x17ce2b){return function(_0x52b0b9){if(!_0x52b0b9){_0xfeb0b1['sendStatus'](0x194);}return _0x52b0b9;};}function handleError(_0x296523,_0x109e88){_0x109e88=_0x109e88||0x1f4;return function(_0xfd3f88){logger[_0xc1dc('0x25')](_0xfd3f88[_0xc1dc('0x26')]);if(_0xfd3f88[_0xc1dc('0x27')]){delete _0xfd3f88[_0xc1dc('0x27')];}_0x296523[_0xc1dc('0x18')](_0x109e88)[_0xc1dc('0x28')](_0xfd3f88);};}exports['index']=function(_0x2d5a57,_0x25b7bf){var _0xd77537={},_0x27e54d={},_0x52b0ff={'count':0x0,'rows':[]};var _0x4750a9=_[_0xc1dc('0x29')](db[_0xc1dc('0x2a')][_0xc1dc('0x2b')],function(_0x1182a4){return{'name':_0x1182a4[_0xc1dc('0x2c')],'type':_0x1182a4['type'][_0xc1dc('0x2d')]};});_0x27e54d[_0xc1dc('0x2e')]=_[_0xc1dc('0x29')](_0x4750a9,_0xc1dc('0x27'));_0x27e54d[_0xc1dc('0x2f')]=_[_0xc1dc('0x30')](_0x2d5a57[_0xc1dc('0x2f')]);_0x27e54d[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x27e54d['model'],_0x27e54d['query']);_0xd77537[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x27e54d[_0xc1dc('0x2e')],qs[_0xc1dc('0x34')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x34')]));_0xd77537['attributes']=_0xd77537[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0xd77537['attributes']:_0x27e54d[_0xc1dc('0x2e')];if(!_0x2d5a57[_0xc1dc('0x2f')]['hasOwnProperty'](_0xc1dc('0x36'))){_0xd77537[_0xc1dc('0x1c')]=qs[_0xc1dc('0x1c')](_0x2d5a57['query'][_0xc1dc('0x1c')]);_0xd77537[_0xc1dc('0x1d')]=qs[_0xc1dc('0x1d')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x1d')]);}_0xd77537[_0xc1dc('0x37')]=qs[_0xc1dc('0x38')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x38')]);_0xd77537['where']=qs[_0xc1dc('0x31')](_[_0xc1dc('0x39')](_0x2d5a57[_0xc1dc('0x2f')],_0x27e54d['filters']),_0x4750a9);if(_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]){_0xd77537[_0xc1dc('0x3b')]=_[_0xc1dc('0x3c')](_0xd77537[_0xc1dc('0x3b')],{'$or':_[_0xc1dc('0x29')](_0x4750a9,function(_0x2e8d34){if(_0x2e8d34[_0xc1dc('0x3d')]!=='VIRTUAL'){var _0x16356d={};_0x16356d[_0x2e8d34[_0xc1dc('0x27')]]={'$like':'%'+_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]+'%'};return _0x16356d;}})});}_0xd77537=_[_0xc1dc('0x3c')]({},_0xd77537,_0x2d5a57[_0xc1dc('0x3e')]);var _0x503ec8={'where':_0xd77537[_0xc1dc('0x3b')]};return db[_0xc1dc('0x2a')][_0xc1dc('0x3f')](_0x503ec8)[_0xc1dc('0x23')](function(_0x1bcf3d){_0x52b0ff['count']=_0x1bcf3d;if(_0x2d5a57['query'][_0xc1dc('0x40')]){_0xd77537[_0xc1dc('0x41')]=[{'all':!![]}];}return db[_0xc1dc('0x2a')][_0xc1dc('0x42')](_0xd77537);})[_0xc1dc('0x23')](function(_0x2b4190){_0x52b0ff[_0xc1dc('0x43')]=_0x2b4190;return _0x52b0ff;})['then'](respondWithFilteredResult(_0x25b7bf,_0xd77537))[_0xc1dc('0x44')](handleError(_0x25b7bf,null));};exports[_0xc1dc('0x45')]=function(_0xe5c170,_0x4f99ea){var _0x402d3a={'raw':!![],'where':{'id':_0xe5c170[_0xc1dc('0x46')]['id']}},_0x2f52f7={};_0x2f52f7[_0xc1dc('0x2e')]=_['keys'](db['JscriptyAnswerReport'][_0xc1dc('0x2b')]);_0x2f52f7[_0xc1dc('0x2f')]=_['keys'](_0xe5c170[_0xc1dc('0x2f')]);_0x2f52f7[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x2f52f7[_0xc1dc('0x2e')],_0x2f52f7[_0xc1dc('0x2f')]);_0x402d3a[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x2f52f7['model'],qs['fields'](_0xe5c170[_0xc1dc('0x2f')]['fields']));_0x402d3a[_0xc1dc('0x33')]=_0x402d3a[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0x402d3a[_0xc1dc('0x33')]:_0x2f52f7[_0xc1dc('0x2e')];if(_0xe5c170[_0xc1dc('0x2f')][_0xc1dc('0x40')]){_0x402d3a[_0xc1dc('0x41')]=[{'all':!![]}];}_0x402d3a=_['merge']({},_0x402d3a,_0xe5c170[_0xc1dc('0x3e')]);return db[_0xc1dc('0x2a')][_0xc1dc('0x47')](_0x402d3a)[_0xc1dc('0x23')](handleEntityNotFound(_0x4f99ea,null))[_0xc1dc('0x23')](respondWithResult(_0x4f99ea,null))[_0xc1dc('0x44')](handleError(_0x4f99ea,null));};exports[_0xc1dc('0x48')]=function(_0x9a48b7,_0x2ca7f1){return db[_0xc1dc('0x2a')]['create'](_0x9a48b7['body'],{})['then'](respondWithResult(_0x2ca7f1,0xc9))[_0xc1dc('0x44')](handleError(_0x2ca7f1,null));};exports[_0xc1dc('0x22')]=function(_0x57b792,_0x129e23){if(_0x57b792[_0xc1dc('0x49')]['id']){delete _0x57b792['body']['id'];}return db[_0xc1dc('0x2a')]['find']({'where':{'id':_0x57b792[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x129e23,null))[_0xc1dc('0x23')](saveUpdates(_0x57b792[_0xc1dc('0x49')],null))[_0xc1dc('0x23')](respondWithResult(_0x129e23,null))[_0xc1dc('0x44')](handleError(_0x129e23,null));};exports[_0xc1dc('0x24')]=function(_0x34667b,_0x4d4240){return db[_0xc1dc('0x2a')][_0xc1dc('0x47')]({'where':{'id':_0x34667b[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x4d4240,null))['then'](removeEntity(_0x4d4240,null))[_0xc1dc('0x44')](handleError(_0x4d4240,null));};exports[_0xc1dc('0x4a')]=function(_0x3e3e6c,_0x1755cb){return db[_0xc1dc('0x2a')][_0xc1dc('0x4a')]()[_0xc1dc('0x23')](respondWithResult(_0x1755cb,null))[_0xc1dc('0x44')](handleError(_0x1755cb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b9e88a6..44a2eee 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 _0xb5c4=['exports','define','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x4a278a,_0x50106e){var _0x2e8e42=function(_0x38a7a3){while(--_0x38a7a3){_0x4a278a['push'](_0x4a278a['shift']());}};_0x2e8e42(++_0x50106e);}(_0xb5c4,0x6e));var _0x4b5c=function(_0x1f45e5,_0x568b84){_0x1f45e5=_0x1f45e5-0x0;var _0xcb83ff=_0xb5c4[_0x1f45e5];return _0xcb83ff;};'use strict';var _=require(_0x4b5c('0x0'));var util=require(_0x4b5c('0x1'));var logger=require('../../config/logger')(_0x4b5c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b5c('0x3'));var fs=require('fs');var path=require(_0x4b5c('0x4'));var rimraf=require(_0x4b5c('0x5'));var config=require(_0x4b5c('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x4b5c('0x7')]=function(_0x376657,_0x40202d){return _0x376657[_0x4b5c('0x8')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x060f=['path','rimraf','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','bluebird'];(function(_0x36fe34,_0x21301c){var _0x31fedd=function(_0x2172ce){while(--_0x2172ce){_0x36fe34['push'](_0x36fe34['shift']());}};_0x31fedd(++_0x21301c);}(_0x060f,0x132));var _0xf060=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0x060f[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0xf060('0x0'));var util=require(_0xf060('0x1'));var logger=require(_0xf060('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf060('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf060('0x4'));var rimraf=require(_0xf060('0x5'));var config=require('../../config/environment');var attributes=require(_0xf060('0x6'));module['exports']=function(_0x483f3c,_0x138e26){return _0x483f3c[_0xf060('0x7')](_0xf060('0x8'),attributes,{'tableName':_0xf060('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 7662905..8acd9a9 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 _0xd2a3=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x417211,_0x473c09){var _0x2c04a5=function(_0x4a3bb8){while(--_0x4a3bb8){_0x417211['push'](_0x417211['shift']());}};_0x2c04a5(++_0x473c09);}(_0xd2a3,0x184));var _0x3d2a=function(_0x399116,_0x31c89a){_0x399116=_0x399116-0x0;var _0x45731a=_0xd2a3[_0x399116];return _0x45731a;};'use strict';var _=require(_0x3d2a('0x0'));var util=require(_0x3d2a('0x1'));var moment=require('moment');var BPromise=require(_0x3d2a('0x2'));var rs=require(_0x3d2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d2a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d2a('0x5'))(_0x3d2a('0x6'));var config=require(_0x3d2a('0x7'));var jayson=require(_0x3d2a('0x8'));var client=jayson['client'][_0x3d2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d958c,_0x47221c,_0x2c4dc5){return new BPromise(function(_0x15883f,_0x4bc1ca){return client[_0x3d2a('0xa')](_0x5d958c,_0x2c4dc5)[_0x3d2a('0xb')](function(_0x5161e9){logger[_0x3d2a('0xc')](_0x3d2a('0xd'),_0x47221c,'request\x20sent');logger[_0x3d2a('0xe')](_0x3d2a('0xf'),_0x47221c,'request\x20sent',JSON['stringify'](_0x5161e9));if(_0x5161e9['error']){if(_0x5161e9[_0x3d2a('0x10')][_0x3d2a('0x11')]===0x1f4){logger[_0x3d2a('0x10')](_0x3d2a('0xd'),_0x47221c,_0x5161e9['error'][_0x3d2a('0x12')]);return _0x4bc1ca(_0x5161e9[_0x3d2a('0x10')][_0x3d2a('0x12')]);}logger[_0x3d2a('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x47221c,_0x5161e9['error'][_0x3d2a('0x12')]);return _0x15883f(_0x5161e9[_0x3d2a('0x10')]['message']);}else{logger['info'](_0x3d2a('0xd'),_0x47221c,_0x3d2a('0x13'));_0x15883f(_0x5161e9[_0x3d2a('0x14')][_0x3d2a('0x12')]);}})['catch'](function(_0x2a7b7a){logger['error'](_0x3d2a('0xd'),_0x47221c,_0x2a7b7a);_0x4bc1ca(_0x2a7b7a);});});} \ No newline at end of file +var _0xb8c9=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0xb8c9,0x9c));var _0x9b8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9b8c('0x0'));var moment=require(_0x9b8c('0x1'));var BPromise=require(_0x9b8c('0x2'));var rs=require(_0x9b8c('0x3'));var fs=require('fs');var Redis=require(_0x9b8c('0x4'));var db=require(_0x9b8c('0x5'))['db'];var utils=require(_0x9b8c('0x6'));var logger=require(_0x9b8c('0x7'))(_0x9b8c('0x8'));var config=require(_0x9b8c('0x9'));var jayson=require(_0x9b8c('0xa'));var client=jayson['client'][_0x9b8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eb073,_0x470803,_0x23b0d0){return new BPromise(function(_0x1a37ec,_0x7d1ef3){return client[_0x9b8c('0xc')](_0x3eb073,_0x23b0d0)[_0x9b8c('0xd')](function(_0x50ee19){logger[_0x9b8c('0xe')](_0x9b8c('0xf'),_0x470803,_0x9b8c('0x10'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x470803,_0x9b8c('0x10'),JSON[_0x9b8c('0x11')](_0x50ee19));if(_0x50ee19['error']){if(_0x50ee19[_0x9b8c('0x12')][_0x9b8c('0x13')]===0x1f4){logger[_0x9b8c('0x12')](_0x9b8c('0xf'),_0x470803,_0x50ee19['error'][_0x9b8c('0x14')]);return _0x7d1ef3(_0x50ee19[_0x9b8c('0x12')][_0x9b8c('0x14')]);}logger[_0x9b8c('0x12')](_0x9b8c('0xf'),_0x470803,_0x50ee19[_0x9b8c('0x12')][_0x9b8c('0x14')]);return _0x1a37ec(_0x50ee19[_0x9b8c('0x12')][_0x9b8c('0x14')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x470803,_0x9b8c('0x10'));_0x1a37ec(_0x50ee19['result']['message']);}})['catch'](function(_0x2c91a6){logger[_0x9b8c('0x12')](_0x9b8c('0xf'),_0x470803,_0x2c91a6);_0x7d1ef3(_0x2c91a6);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9241a3c..46f7785 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 _0x07a4=['/:id','show','/:id/sessions','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x48a57b,_0x1ea57c){var _0x31f116=function(_0x1dd179){while(--_0x1dd179){_0x48a57b['push'](_0x48a57b['shift']());}};_0x31f116(++_0x1ea57c);}(_0x07a4,0x1bf));var _0x407a=function(_0x338d16,_0x5d3b29){_0x338d16=_0x338d16-0x0;var _0x37a0b7=_0x07a4[_0x338d16];return _0x37a0b7;};'use strict';var multer=require(_0x407a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x407a('0x1'));var express=require(_0x407a('0x2'));var router=express[_0x407a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x407a('0x4'));var config=require(_0x407a('0x5'));var controller=require('./jscriptyProject.controller');router[_0x407a('0x6')]('/',auth[_0x407a('0x7')](),controller[_0x407a('0x8')]);router[_0x407a('0x6')](_0x407a('0x9'),auth['isAuthenticated'](),controller[_0x407a('0xa')]);router[_0x407a('0x6')](_0x407a('0xb'),auth[_0x407a('0x7')](),controller['getSessions']);router[_0x407a('0x6')]('/:id/answers',auth[_0x407a('0x7')](),controller[_0x407a('0xc')]);router[_0x407a('0x6')](_0x407a('0xd'),auth[_0x407a('0x7')](),timeout('30s'),controller[_0x407a('0xe')]);router[_0x407a('0xf')]('/',auth[_0x407a('0x7')](),controller[_0x407a('0x10')]);router['post'](_0x407a('0x11'),auth[_0x407a('0x7')](),controller[_0x407a('0x12')]);router[_0x407a('0x13')]('/:id',auth[_0x407a('0x7')](),controller[_0x407a('0x14')]);router[_0x407a('0x15')](_0x407a('0x9'),auth[_0x407a('0x7')](),controller[_0x407a('0x16')]);module[_0x407a('0x17')]=router; \ No newline at end of file +var _0x7697=['get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated'];(function(_0x536593,_0x5571c5){var _0x198d19=function(_0x2251a3){while(--_0x2251a3){_0x536593['push'](_0x536593['shift']());}};_0x198d19(++_0x5571c5);}(_0x7697,0x68));var _0x7769=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0x7697[_0x273f77];return _0x71e147;};'use strict';var multer=require(_0x7769('0x0'));var util=require(_0x7769('0x1'));var path=require(_0x7769('0x2'));var timeout=require(_0x7769('0x3'));var express=require(_0x7769('0x4'));var router=express[_0x7769('0x5')]();var fs_extra=require(_0x7769('0x6'));var auth=require(_0x7769('0x7'));var interaction=require(_0x7769('0x8'));var config=require(_0x7769('0x9'));var controller=require(_0x7769('0xa'));router['get']('/',auth[_0x7769('0xb')](),controller['index']);router[_0x7769('0xc')](_0x7769('0xd'),auth[_0x7769('0xb')](),controller[_0x7769('0xe')]);router[_0x7769('0xc')](_0x7769('0xf'),auth[_0x7769('0xb')](),controller[_0x7769('0x10')]);router['get'](_0x7769('0x11'),auth[_0x7769('0xb')](),controller[_0x7769('0x12')]);router[_0x7769('0xc')](_0x7769('0x13'),auth[_0x7769('0xb')](),timeout(_0x7769('0x14')),controller[_0x7769('0x15')]);router[_0x7769('0x16')]('/',auth[_0x7769('0xb')](),controller['create']);router[_0x7769('0x16')](_0x7769('0x17'),auth[_0x7769('0xb')](),controller['clone']);router[_0x7769('0x18')](_0x7769('0xd'),auth[_0x7769('0xb')](),controller[_0x7769('0x19')]);router[_0x7769('0x1a')](_0x7769('0xd'),auth[_0x7769('0xb')](),controller[_0x7769('0x1b')]);module[_0x7769('0x1c')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 1c3fc92..5fbcf16 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 _0xcc27=['description','BOOLEAN','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','isString','setDataValue','formData','getDataValue'];(function(_0x44f906,_0x4c4a31){var _0x2a6cc6=function(_0x5037d4){while(--_0x5037d4){_0x44f906['push'](_0x44f906['shift']());}};_0x2a6cc6(++_0x4c4a31);}(_0xcc27,0x64));var _0x7cc2=function(_0xe1066,_0x263690){_0xe1066=_0xe1066-0x0;var _0x5a731f=_0xcc27[_0xe1066];return _0x5a731f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7cc2('0x0'));var util=require(_0x7cc2('0x1'));module[_0x7cc2('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x7cc2('0x3')},'description':{'type':Sequelize[_0x7cc2('0x4')]},'formData':{'type':Sequelize[_0x7cc2('0x5')](_0x7cc2('0x6')),'set':function(_0x594490){if(_[_0x7cc2('0x7')](_0x594490)){this['setDataValue']('formData',JSON['stringify'](_0x594490));}else if(_[_0x7cc2('0x8')](_0x594490)){this[_0x7cc2('0x9')](_0x7cc2('0xa'),_0x594490);}else{this['setDataValue'](_0x7cc2('0xa'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x7cc2('0xb')](_0x7cc2('0x3'))||'',this[_0x7cc2('0xb')](_0x7cc2('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7cc2('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7cc2('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xeb7a=['exports','STRING','name','TEXT','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash'];(function(_0x378347,_0x59db26){var _0x145634=function(_0x6a38aa){while(--_0x6a38aa){_0x378347['push'](_0x378347['shift']());}};_0x145634(++_0x59db26);}(_0xeb7a,0x178));var _0xaeb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb7a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xaeb7('0x0'));var _=require(_0xaeb7('0x1'));var util=require('util');module[_0xaeb7('0x2')]={'name':{'type':Sequelize[_0xaeb7('0x3')],'unique':_0xaeb7('0x4')},'description':{'type':Sequelize[_0xaeb7('0x3')]},'formData':{'type':Sequelize[_0xaeb7('0x5')]('long'),'set':function(_0x3bc821){if(_[_0xaeb7('0x6')](_0x3bc821)){this[_0xaeb7('0x7')](_0xaeb7('0x8'),JSON['stringify'](_0x3bc821));}else if(_[_0xaeb7('0x9')](_0x3bc821)){this[_0xaeb7('0x7')](_0xaeb7('0x8'),_0x3bc821);}else{this[_0xaeb7('0x7')](_0xaeb7('0x8'),util[_0xaeb7('0xa')](_0xaeb7('0xb'),this[_0xaeb7('0xc')](_0xaeb7('0x4'))||'',this[_0xaeb7('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xaeb7('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 2092553..adc3ce3 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 _0xaa2d=['show','keys','attributes','intersection','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','params','omit','createdAt','updatedAt','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','order','ProjectId','findAll','getAnswers','JscriptyAnswerReport','hasOwnProperty','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','rimraf','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','stack','name','index','JscriptyProject','rawAttributes','fieldName','type','model','map','query','filters','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows'];(function(_0x37d4ac,_0x4e47d6){var _0x5e727a=function(_0x5adbff){while(--_0x5adbff){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x5e727a(++_0x4e47d6);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdaa2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdaa2('0x1'));var BPromise=require(_0xdaa2('0x2'));var Mustache=require(_0xdaa2('0x3'));var util=require('util');var path=require(_0xdaa2('0x4'));var sox=require(_0xdaa2('0x5'));var csv=require(_0xdaa2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdaa2('0x7'));var squel=require('squel');var crypto=require(_0xdaa2('0x8'));var jsforce=require(_0xdaa2('0x9'));var deskjs=require(_0xdaa2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xdaa2('0xb'));var Papa=require(_0xdaa2('0xc'));var Redis=require(_0xdaa2('0xd'));var authService=require(_0xdaa2('0xe'));var qs=require(_0xdaa2('0xf'));var as=require(_0xdaa2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdaa2('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdaa2('0x12'))['db'];function respondWithStatusCode(_0x3c91fa,_0x5c2797){_0x5c2797=_0x5c2797||0xcc;return function(_0x3e6a73){if(_0x3e6a73){return _0x3c91fa[_0xdaa2('0x13')](_0x5c2797);}return _0x3c91fa[_0xdaa2('0x14')](_0x5c2797)[_0xdaa2('0x15')]();};}function respondWithResult(_0x32172b,_0x878f25){_0x878f25=_0x878f25||0xc8;return function(_0x29bc7b){if(_0x29bc7b){return _0x32172b[_0xdaa2('0x14')](_0x878f25)[_0xdaa2('0x16')](_0x29bc7b);}};}function respondWithFilteredResult(_0x2585db,_0x185857){return function(_0x262ce4){if(_0x262ce4){var _0x1970fe=typeof _0x185857[_0xdaa2('0x17')]===_0xdaa2('0x18')&&typeof _0x185857[_0xdaa2('0x19')]==='undefined';var _0x199f80=_0x262ce4['count'];var _0x303391=_0x1970fe?0x0:_0x185857['offset'];var _0x3b56c8=_0x1970fe?_0x262ce4[_0xdaa2('0x1a')]:_0x185857[_0xdaa2('0x17')]+_0x185857['limit'];var _0x22a76b;if(_0x3b56c8>=_0x199f80){_0x3b56c8=_0x199f80;_0x22a76b=0xc8;}else{_0x22a76b=0xce;}_0x2585db[_0xdaa2('0x14')](_0x22a76b);return _0x2585db[_0xdaa2('0x1b')](_0xdaa2('0x1c'),_0x303391+'-'+_0x3b56c8+'/'+_0x199f80)[_0xdaa2('0x16')](_0x262ce4);}return null;};}function patchUpdates(_0x391808){return function(_0x2d9a81){try{jsonpatch[_0xdaa2('0x1d')](_0x2d9a81,_0x391808,!![]);}catch(_0x4ba73d){return BPromise[_0xdaa2('0x1e')](_0x4ba73d);}return _0x2d9a81[_0xdaa2('0x1f')]();};}function saveUpdates(_0x3e93e1,_0x3d36bb){return function(_0x5893f7){if(_0x5893f7){return _0x5893f7[_0xdaa2('0x20')](_0x3e93e1)['then'](function(_0x40ae26){return _0x40ae26;});}return null;};}function removeEntity(_0x43e2ec,_0x470242){return function(_0x1c1a6a){if(_0x1c1a6a){return _0x1c1a6a[_0xdaa2('0x21')]()[_0xdaa2('0x22')](function(){var _0x36d005=_0x1c1a6a[_0xdaa2('0x23')]({'plain':!![]});var _0x5e9646=_0xdaa2('0x24');return db[_0xdaa2('0x25')]['destroy']({'where':{'type':_0x5e9646,'resourceId':_0x36d005['id']}})[_0xdaa2('0x22')](function(){return _0x1c1a6a;});})[_0xdaa2('0x22')](function(){_0x43e2ec[_0xdaa2('0x14')](0xcc)[_0xdaa2('0x15')]();});}};}function handleEntityNotFound(_0x492797,_0x12cb4f){return function(_0xfc982d){if(!_0xfc982d){_0x492797[_0xdaa2('0x13')](0x194);}return _0xfc982d;};}function handleError(_0x54f91d,_0x489961){_0x489961=_0x489961||0x1f4;return function(_0x5e7380){logger['error'](_0x5e7380[_0xdaa2('0x26')]);if(_0x5e7380[_0xdaa2('0x27')]){delete _0x5e7380[_0xdaa2('0x27')];}_0x54f91d[_0xdaa2('0x14')](_0x489961)['send'](_0x5e7380);};}exports[_0xdaa2('0x28')]=function(_0x56fd7c,_0x550c28){var _0x356832={},_0x225b1a={},_0x27f456={'count':0x0,'rows':[]};var _0x1d3c16=_['map'](db[_0xdaa2('0x29')][_0xdaa2('0x2a')],function(_0x586742){return{'name':_0x586742[_0xdaa2('0x2b')],'type':_0x586742[_0xdaa2('0x2c')]['key']};});_0x225b1a[_0xdaa2('0x2d')]=_[_0xdaa2('0x2e')](_0x1d3c16,_0xdaa2('0x27'));_0x225b1a[_0xdaa2('0x2f')]=_['keys'](_0x56fd7c[_0xdaa2('0x2f')]);_0x225b1a[_0xdaa2('0x30')]=_['intersection'](_0x225b1a[_0xdaa2('0x2d')],_0x225b1a[_0xdaa2('0x2f')]);_0x356832['attributes']=_['intersection'](_0x225b1a['model'],qs[_0xdaa2('0x31')](_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x31')]));_0x356832['attributes']=_0x356832['attributes'][_0xdaa2('0x32')]?_0x356832['attributes']:_0x225b1a[_0xdaa2('0x2d')];if(!_0x56fd7c[_0xdaa2('0x2f')]['hasOwnProperty'](_0xdaa2('0x33'))){_0x356832[_0xdaa2('0x19')]=qs[_0xdaa2('0x19')](_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x19')]);_0x356832[_0xdaa2('0x17')]=qs[_0xdaa2('0x17')](_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x17')]);}_0x356832['order']=qs[_0xdaa2('0x34')](_0x56fd7c[_0xdaa2('0x2f')]['sort']);_0x356832['where']=qs[_0xdaa2('0x30')](_[_0xdaa2('0x35')](_0x56fd7c[_0xdaa2('0x2f')],_0x225b1a[_0xdaa2('0x30')]),_0x1d3c16);if(_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x36')]){_0x356832[_0xdaa2('0x37')]=_['merge'](_0x356832[_0xdaa2('0x37')],{'$or':_[_0xdaa2('0x2e')](_0x1d3c16,function(_0x37371e){if(_0x37371e[_0xdaa2('0x2c')]!==_0xdaa2('0x38')){var _0xa016cc={};_0xa016cc[_0x37371e['name']]={'$like':'%'+_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x36')]+'%'};return _0xa016cc;}})});}_0x356832=_['merge']({},_0x356832,_0x56fd7c[_0xdaa2('0x39')]);var _0x205c1c={'where':_0x356832[_0xdaa2('0x37')]};return db[_0xdaa2('0x29')][_0xdaa2('0x1a')](_0x205c1c)[_0xdaa2('0x22')](function(_0x484f87){_0x27f456[_0xdaa2('0x1a')]=_0x484f87;if(_0x56fd7c['query'][_0xdaa2('0x3a')]){_0x356832[_0xdaa2('0x3b')]=[{'all':!![]}];}return db[_0xdaa2('0x29')]['findAll'](_0x356832);})[_0xdaa2('0x22')](function(_0x31f362){_0x27f456[_0xdaa2('0x3c')]=_0x31f362;return _0x27f456;})['then'](respondWithFilteredResult(_0x550c28,_0x356832))['catch'](handleError(_0x550c28,null));};exports[_0xdaa2('0x3d')]=function(_0x2039a8,_0x359b8e){var _0x3aa19e={'raw':![],'where':{'id':_0x2039a8['params']['id']}},_0x1a26ed={};_0x1a26ed[_0xdaa2('0x2d')]=_['keys'](db[_0xdaa2('0x29')][_0xdaa2('0x2a')]);_0x1a26ed[_0xdaa2('0x2f')]=_[_0xdaa2('0x3e')](_0x2039a8[_0xdaa2('0x2f')]);_0x1a26ed[_0xdaa2('0x30')]=_['intersection'](_0x1a26ed['model'],_0x1a26ed[_0xdaa2('0x2f')]);_0x3aa19e[_0xdaa2('0x3f')]=_[_0xdaa2('0x40')](_0x1a26ed['model'],qs[_0xdaa2('0x31')](_0x2039a8['query'][_0xdaa2('0x31')]));_0x3aa19e[_0xdaa2('0x3f')]=_0x3aa19e[_0xdaa2('0x3f')]['length']?_0x3aa19e[_0xdaa2('0x3f')]:_0x1a26ed[_0xdaa2('0x2d')];if(_0x2039a8[_0xdaa2('0x2f')]['includeAll']){_0x3aa19e[_0xdaa2('0x3b')]=[{'all':!![]}];}_0x3aa19e=_[_0xdaa2('0x41')]({},_0x3aa19e,_0x2039a8[_0xdaa2('0x39')]);return db['JscriptyProject'][_0xdaa2('0x42')](_0x3aa19e)[_0xdaa2('0x22')](handleEntityNotFound(_0x359b8e,null))[_0xdaa2('0x22')](respondWithResult(_0x359b8e,null))[_0xdaa2('0x43')](handleError(_0x359b8e,null));};exports['create']=function(_0x254a7b,_0x1966ad){return db[_0xdaa2('0x29')][_0xdaa2('0x44')](_0x254a7b[_0xdaa2('0x45')],{})['then'](function(_0x15f2d8){var _0x1ec228=_0x254a7b['user'][_0xdaa2('0x23')]({'plain':!![]});if(!_0x1ec228)throw new Error(_0xdaa2('0x46'));if(_0x1ec228[_0xdaa2('0x47')]==='user'){var _0x78bb5b=_0x15f2d8[_0xdaa2('0x23')]({'plain':!![]});var _0x5f20ab=_0xdaa2('0x24');return db[_0xdaa2('0x48')][_0xdaa2('0x42')]({'where':{'name':_0x5f20ab,'userProfileId':_0x1ec228[_0xdaa2('0x49')]},'raw':!![]})[_0xdaa2('0x22')](function(_0x28bc5d){if(_0x28bc5d&&_0x28bc5d[_0xdaa2('0x4a')]===0x0){return db[_0xdaa2('0x25')][_0xdaa2('0x44')]({'name':_0x78bb5b[_0xdaa2('0x27')],'resourceId':_0x78bb5b['id'],'type':_0x28bc5d[_0xdaa2('0x27')],'sectionId':_0x28bc5d['id']},{})['then'](function(){return _0x15f2d8;});}else{return _0x15f2d8;}})[_0xdaa2('0x43')](function(_0x26f69b){logger[_0xdaa2('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26f69b);throw _0x26f69b;});}return _0x15f2d8;})['then'](respondWithResult(_0x1966ad,0xc9))[_0xdaa2('0x43')](handleError(_0x1966ad,null));};exports['clone']=function(_0x5a9291,_0x52e3d0){var _0x25c095={'where':{'id':_0x5a9291[_0xdaa2('0x4c')]['id']}},_0x239fb1={};_0x239fb1[_0xdaa2('0x2d')]=_['keys'](db['JscriptyProject'][_0xdaa2('0x2a')]);_0x25c095['attributes']=_[_0xdaa2('0x40')](_0x239fb1[_0xdaa2('0x2d')],qs[_0xdaa2('0x31')](_0x5a9291[_0xdaa2('0x2f')][_0xdaa2('0x31')]));_0x25c095['attributes']=_0x25c095[_0xdaa2('0x3f')][_0xdaa2('0x32')]?_0x25c095[_0xdaa2('0x3f')]:_0x239fb1[_0xdaa2('0x2d')];if(_0x5a9291[_0xdaa2('0x2f')][_0xdaa2('0x3a')]){_0x25c095[_0xdaa2('0x3b')]=[{'all':!![]}];}_0x25c095=_[_0xdaa2('0x41')]({},_0x25c095,_0x5a9291[_0xdaa2('0x39')]);return db[_0xdaa2('0x29')][_0xdaa2('0x42')](_0x25c095)[_0xdaa2('0x22')](handleEntityNotFound(_0x52e3d0,null))[_0xdaa2('0x22')](function(_0x409d39){if(_0x409d39){var _0x39fad3=_0x409d39[_0xdaa2('0x23')]({'plain':!![]});_0x39fad3=qs[_0xdaa2('0x4d')](_0x39fad3,['id',_0xdaa2('0x4e'),_0xdaa2('0x4f')]);_0x5a9291[_0xdaa2('0x45')]=_[_0xdaa2('0x4d')](_0x5a9291[_0xdaa2('0x45')],['id',_0xdaa2('0x4e'),_0xdaa2('0x4f')]);return db['JscriptyProject'][_0xdaa2('0x44')](_[_0xdaa2('0x41')](_0x39fad3,_0x5a9291[_0xdaa2('0x45')]),{'include':_0x5a9291[_0xdaa2('0x2f')][_0xdaa2('0x3a')]?[{'all':!![]}]:undefined})[_0xdaa2('0x22')](function(_0x35dd76){var _0x5652d6=_0x5a9291[_0xdaa2('0x50')][_0xdaa2('0x23')]({'plain':!![]});if(!_0x5652d6)throw new Error(_0xdaa2('0x46'));if(_0x5652d6[_0xdaa2('0x47')]===_0xdaa2('0x50')){var _0x5d43ef=_0x35dd76[_0xdaa2('0x23')]({'plain':!![]});var _0x1f8a3a=_0xdaa2('0x24');return db[_0xdaa2('0x48')][_0xdaa2('0x42')]({'where':{'name':_0x1f8a3a,'userProfileId':_0x5652d6[_0xdaa2('0x49')]},'raw':!![]})[_0xdaa2('0x22')](function(_0x493337){if(_0x493337&&_0x493337[_0xdaa2('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d43ef[_0xdaa2('0x27')],'resourceId':_0x5d43ef['id'],'type':_0x493337[_0xdaa2('0x27')],'sectionId':_0x493337['id']},{})[_0xdaa2('0x22')](function(){return _0x35dd76;});}else{return _0x35dd76;}})[_0xdaa2('0x43')](function(_0x4531a7){logger['error'](_0xdaa2('0x51'),_0x4531a7);throw _0x4531a7;});}return _0x35dd76;});}})[_0xdaa2('0x22')](respondWithResult(_0x52e3d0,0xc9))[_0xdaa2('0x43')](handleError(_0x52e3d0,null));};exports[_0xdaa2('0x20')]=function(_0x4ec8ce,_0x57604e){if(_0x4ec8ce['body']['id']){delete _0x4ec8ce[_0xdaa2('0x45')]['id'];}return db[_0xdaa2('0x29')][_0xdaa2('0x42')]({'where':{'id':_0x4ec8ce[_0xdaa2('0x4c')]['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x57604e,null))[_0xdaa2('0x22')](saveUpdates(_0x4ec8ce['body'],null))[_0xdaa2('0x22')](respondWithResult(_0x57604e,null))['catch'](handleError(_0x57604e,null));};exports['destroy']=function(_0x30b289,_0x3f33ff){return db[_0xdaa2('0x29')][_0xdaa2('0x42')]({'where':{'id':_0x30b289[_0xdaa2('0x4c')]['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x3f33ff,null))[_0xdaa2('0x22')](removeEntity(_0x3f33ff,null))[_0xdaa2('0x43')](handleError(_0x3f33ff,null));};exports[_0xdaa2('0x52')]=function(_0xdef8f6,_0x271a36,_0x568ed6){var _0x224f1c={'raw':!![],'where':{}};var _0x59bb12={};var _0xfa2648={'count':0x0,'rows':[]};return db[_0xdaa2('0x29')][_0xdaa2('0x53')]({'where':{'id':_0xdef8f6['params']['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x271a36,null))[_0xdaa2('0x22')](function(_0x568254){if(_0x568254){_0x59bb12[_0xdaa2('0x2d')]=_[_0xdaa2('0x3e')](db[_0xdaa2('0x54')][_0xdaa2('0x2a')]);_0x59bb12[_0xdaa2('0x2f')]=_[_0xdaa2('0x3e')](_0xdef8f6['query']);_0x59bb12[_0xdaa2('0x30')]=_['intersection'](_0x59bb12[_0xdaa2('0x2d')],_0x59bb12['query']);_0x224f1c['attributes']=_['intersection'](_0x59bb12['model'],qs[_0xdaa2('0x31')](_0xdef8f6[_0xdaa2('0x2f')]['fields']));_0x224f1c['attributes']=_0x224f1c[_0xdaa2('0x3f')][_0xdaa2('0x32')]?_0x224f1c[_0xdaa2('0x3f')]:_0x59bb12['model'];if(!_0xdef8f6[_0xdaa2('0x2f')]['hasOwnProperty']('nolimit')){_0x224f1c['limit']=qs['limit'](_0xdef8f6[_0xdaa2('0x2f')]['limit']);_0x224f1c[_0xdaa2('0x17')]=qs[_0xdaa2('0x17')](_0xdef8f6[_0xdaa2('0x2f')][_0xdaa2('0x17')]);}_0x224f1c[_0xdaa2('0x55')]=qs[_0xdaa2('0x34')](_0xdef8f6['query'][_0xdaa2('0x34')]);_0x224f1c['where']=qs[_0xdaa2('0x30')](_[_0xdaa2('0x35')](_0xdef8f6[_0xdaa2('0x2f')],_0x59bb12[_0xdaa2('0x30')]));_0x224f1c[_0xdaa2('0x37')][_0xdaa2('0x56')]=_0x568254['id'];if(_0xdef8f6['query'][_0xdaa2('0x36')]){_0x224f1c[_0xdaa2('0x37')]=_[_0xdaa2('0x41')](_0x224f1c[_0xdaa2('0x37')],{'$or':_[_0xdaa2('0x2e')](_0x224f1c[_0xdaa2('0x3f')],function(_0x361f0a){var _0x57a869={};_0x57a869[_0x361f0a]={'$like':'%'+_0xdef8f6[_0xdaa2('0x2f')]['filter']+'%'};return _0x57a869;})});}_0x224f1c=_[_0xdaa2('0x41')]({},_0x224f1c,_0xdef8f6[_0xdaa2('0x39')]);return db[_0xdaa2('0x54')]['count']({'where':_0x224f1c[_0xdaa2('0x37')]})[_0xdaa2('0x22')](function(_0x2f4192){_0xfa2648[_0xdaa2('0x1a')]=_0x2f4192;if(_0xdef8f6['query'][_0xdaa2('0x3a')]){_0x224f1c[_0xdaa2('0x3b')]=[{'all':!![]}];}return db[_0xdaa2('0x54')][_0xdaa2('0x57')](_0x224f1c);})['then'](function(_0x1d9ebb){_0xfa2648['rows']=_0x1d9ebb;return _0xfa2648;});}})[_0xdaa2('0x22')](respondWithFilteredResult(_0x271a36,_0x224f1c))['catch'](handleError(_0x271a36,null));};exports[_0xdaa2('0x58')]=function(_0x8ac361,_0x269358,_0x119f4a){var _0x3da14c={'raw':!![],'where':{}};var _0x281946={};var _0xa4a444={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xdaa2('0x53')]({'where':{'id':_0x8ac361[_0xdaa2('0x4c')]['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x269358,null))['then'](function(_0x29775b){if(_0x29775b){_0x281946[_0xdaa2('0x2d')]=_['keys'](db[_0xdaa2('0x59')]['rawAttributes']);_0x281946[_0xdaa2('0x2f')]=_['keys'](_0x8ac361[_0xdaa2('0x2f')]);_0x281946[_0xdaa2('0x30')]=_[_0xdaa2('0x40')](_0x281946[_0xdaa2('0x2d')],_0x281946[_0xdaa2('0x2f')]);_0x3da14c['attributes']=_['intersection'](_0x281946[_0xdaa2('0x2d')],qs[_0xdaa2('0x31')](_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x31')]));_0x3da14c[_0xdaa2('0x3f')]=_0x3da14c[_0xdaa2('0x3f')]['length']?_0x3da14c[_0xdaa2('0x3f')]:_0x281946['model'];if(!_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x5a')](_0xdaa2('0x33'))){_0x3da14c[_0xdaa2('0x19')]=qs[_0xdaa2('0x19')](_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x19')]);_0x3da14c[_0xdaa2('0x17')]=qs[_0xdaa2('0x17')](_0x8ac361['query'][_0xdaa2('0x17')]);}_0x3da14c[_0xdaa2('0x55')]=qs['sort'](_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x34')]);_0x3da14c[_0xdaa2('0x37')]=qs[_0xdaa2('0x30')](_['pick'](_0x8ac361['query'],_0x281946[_0xdaa2('0x30')]));_0x3da14c[_0xdaa2('0x37')][_0xdaa2('0x56')]=_0x29775b['id'];if(_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x36')]){_0x3da14c['where']=_[_0xdaa2('0x41')](_0x3da14c['where'],{'$or':_[_0xdaa2('0x2e')](_0x3da14c[_0xdaa2('0x3f')],function(_0x2c009c){var _0x551922={};_0x551922[_0x2c009c]={'$like':'%'+_0x8ac361['query'][_0xdaa2('0x36')]+'%'};return _0x551922;})});}_0x3da14c=_[_0xdaa2('0x41')]({},_0x3da14c,_0x8ac361['options']);return db[_0xdaa2('0x59')]['count']({'where':_0x3da14c['where']})[_0xdaa2('0x22')](function(_0x366858){_0xa4a444['count']=_0x366858;if(_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x3a')]){_0x3da14c[_0xdaa2('0x3b')]=[{'all':!![]}];}return db[_0xdaa2('0x59')]['findAll'](_0x3da14c);})[_0xdaa2('0x22')](function(_0x338d10){_0xa4a444['rows']=_0x338d10;return _0xa4a444;});}})['then'](respondWithFilteredResult(_0x269358,_0x3da14c))[_0xdaa2('0x43')](handleError(_0x269358,null));};function char(_0x563919){return _0xdaa2('0x5b')===typeof _0x563919?String[_0xdaa2('0x5c')][_0xdaa2('0x1d')](null,arguments):_0x563919;}function needsEncapsulation(_0x48c92e){return!!_0x48c92e&&(_0x48c92e[_0xdaa2('0x5d')]()[_0xdaa2('0x5e')](char(0xd))>=0x0||_0x48c92e['toString']()[_0xdaa2('0x5e')](char(0xa))>=0x0||_0x48c92e[_0xdaa2('0x5d')]()[_0xdaa2('0x5e')](char(0x2c))>=0x0||_0x48c92e['toString']()[_0xdaa2('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x16e8c5){var _0x2ba7d5=char(0x22),_0x4f42ba='\x5c'+char(0x22),_0x4a30c3=_0x16e8c5['toString']()[_0xdaa2('0x5f')](new RegExp(_0x2ba7d5,'g'),_0x4f42ba);return _0x2ba7d5+_0x4a30c3+_0x2ba7d5;}exports[_0xdaa2('0x60')]=function(_0x56c6fe,_0x361d40,_0x44a81a){var _0x996ca0,_0x3eaee1;var _0x28c921={'where':{'ProjectId':_0x56c6fe[_0xdaa2('0x4c')]['id']}};if(_0x56c6fe['query'][_0xdaa2('0x61')]){_0x28c921[_0xdaa2('0x37')][_0xdaa2('0x62')]=JSON[_0xdaa2('0x63')](_0x56c6fe[_0xdaa2('0x2f')][_0xdaa2('0x61')]);}return db[_0xdaa2('0x54')][_0xdaa2('0x57')](_0x28c921)[_0xdaa2('0x22')](handleEntityNotFound(_0x361d40,null))[_0xdaa2('0x22')](function(_0x515a04){if(_0x515a04){_0x996ca0=_0x515a04;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_['map'](_0x996ca0,'id')},'ProjectId':_0x56c6fe[_0xdaa2('0x4c')]['id']},'order':_0xdaa2('0x64')});}})[_0xdaa2('0x22')](handleEntityNotFound(_0x361d40,null))['then'](function(_0x199cc9){if(_0x199cc9){_0x3eaee1=_0x199cc9;var _0x246602={};for(var _0x407553=0x0,_0x343fb8=_0x3eaee1[_0xdaa2('0x32')];_0x407553<_0x343fb8;_0x407553++){if(!_0x246602[_0xdaa2('0x5a')](_0x3eaee1[_0x407553][_0xdaa2('0x65')])){_0x246602[_0x3eaee1[_0x407553][_0xdaa2('0x65')]]=needsEncapsulation(_0x3eaee1[_0x407553][_0xdaa2('0x66')])?encapsulate(_0x3eaee1[_0x407553][_0xdaa2('0x66')]):_0x3eaee1[_0x407553][_0xdaa2('0x66')];}}var _0x2fe3c8=[],_0x374d70={};for(var _0x4ada13=0x0,_0x2c5d6a=_0x996ca0[_0xdaa2('0x32')];_0x4ada13<_0x2c5d6a;_0x4ada13++){_0x374d70={'ProjectId':_0x56c6fe[_0xdaa2('0x4c')]['id'],'SessionId':_0x996ca0[_0x4ada13]['id'],'StartTime':moment(_0x996ca0[_0x4ada13][_0xdaa2('0x62')])[_0xdaa2('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x57b3ec=0x0,_0x132820=_0x3eaee1[_0xdaa2('0x32')];_0x57b3ec<_0x132820;_0x57b3ec++){if(_0x3eaee1[_0x57b3ec][_0xdaa2('0x68')]==_0x996ca0[_0x4ada13]['id']&&_0x246602[_0xdaa2('0x5a')](_0x3eaee1[_0x57b3ec]['questionId'])){_0x374d70[_0x246602[_0x3eaee1[_0x57b3ec][_0xdaa2('0x65')]]]=_0x3eaee1[_0x57b3ec][_0xdaa2('0x69')];}}for(var _0x2530cb in _0x246602){if(!_0x374d70[_0xdaa2('0x5a')](_0x246602[_0x2530cb])){_0x374d70[_0x246602[_0x2530cb]]=null;}}_0x2fe3c8[_0xdaa2('0x6a')](_0x374d70);}return _0x2fe3c8;}})['then'](function(_0x371e47){if(!_['isEmpty'](_0x371e47)){var _0x37577f=toCsv(_0x371e47);var _0x3ff486=Date[_0xdaa2('0x6b')]();fs[_0xdaa2('0x6c')](util[_0xdaa2('0x67')](_0xdaa2('0x6d'),_0x56c6fe[_0xdaa2('0x4c')]['id'],_0x3ff486),_0x37577f);_0x361d40['setHeader']('Content-disposition','attachment;\x20filename='+util[_0xdaa2('0x67')](_0xdaa2('0x6e'),_0x56c6fe[_0xdaa2('0x4c')]['id'],_0x3ff486));_0x361d40[_0xdaa2('0x6f')](_0xdaa2('0x70'),_0xdaa2('0x71'));return _0x361d40[_0xdaa2('0x72')](util[_0xdaa2('0x67')](_0xdaa2('0x6d'),_0x56c6fe[_0xdaa2('0x4c')]['id'],_0x3ff486));}else{return _0x361d40[_0xdaa2('0x13')](0xcc);}})['catch'](handleError(_0x361d40,null));}; \ No newline at end of file +var _0x6f3e=['body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','getSessions','findOne','pick','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','Content-disposition','attachment;\x20filename=','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','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','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','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'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_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['JscriptyProject'][_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['JscriptyProject'][_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['JscriptyProject']['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['JscriptySessionReport'][_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['JscriptySessionReport'][_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')]['ProjectId']=_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['JscriptyAnswerReport'][_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));};function char(_0x3ab43e){return _0xe6f3('0x61')===typeof _0x3ab43e?String['fromCharCode'][_0xe6f3('0x23')](null,arguments):_0x3ab43e;}function needsEncapsulation(_0x3682ca){return!!_0x3682ca&&(_0x3682ca[_0xe6f3('0x62')]()[_0xe6f3('0x63')](char(0xd))>=0x0||_0x3682ca[_0xe6f3('0x62')]()[_0xe6f3('0x63')](char(0xa))>=0x0||_0x3682ca[_0xe6f3('0x62')]()[_0xe6f3('0x63')](char(0x2c))>=0x0||_0x3682ca[_0xe6f3('0x62')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x1b9904){var _0x160ce0=char(0x22),_0x35bc23='\x5c'+char(0x22),_0x1782c0=_0x1b9904['toString']()[_0xe6f3('0x64')](new RegExp(_0x160ce0,'g'),_0x35bc23);return _0x160ce0+_0x1782c0+_0x160ce0;}exports[_0xe6f3('0x65')]=function(_0x593951,_0x22dd14,_0x6baa20){var _0x38adc3,_0x2b3899;var _0x39271b={'where':{'ProjectId':_0x593951[_0xe6f3('0x4c')]['id']}};if(_0x593951[_0xe6f3('0x36')][_0xe6f3('0x66')]){_0x39271b[_0xe6f3('0x42')]['starttime']=JSON[_0xe6f3('0x67')](_0x593951[_0xe6f3('0x36')][_0xe6f3('0x66')]);}return db['JscriptySessionReport'][_0xe6f3('0x48')](_0x39271b)[_0xe6f3('0x27')](handleEntityNotFound(_0x22dd14,null))[_0xe6f3('0x27')](function(_0x498888){if(_0x498888){_0x38adc3=_0x498888;return db['JscriptyQuestionReport'][_0xe6f3('0x48')]({'where':{'SessionId':{'$in':_[_0xe6f3('0x30')](_0x38adc3,'id')},'ProjectId':_0x593951[_0xe6f3('0x4c')]['id']},'order':_0xe6f3('0x68')});}})['then'](handleEntityNotFound(_0x22dd14,null))[_0xe6f3('0x27')](function(_0x218ee7){if(_0x218ee7){_0x2b3899=_0x218ee7;var _0x5bae26={};for(var _0xad3fd5=0x0,_0x1b09d1=_0x2b3899[_0xe6f3('0x3c')];_0xad3fd5<_0x1b09d1;_0xad3fd5++){if(!_0x5bae26[_0xe6f3('0x3d')](_0x2b3899[_0xad3fd5][_0xe6f3('0x69')])){_0x5bae26[_0x2b3899[_0xad3fd5][_0xe6f3('0x69')]]=needsEncapsulation(_0x2b3899[_0xad3fd5][_0xe6f3('0x6a')])?encapsulate(_0x2b3899[_0xad3fd5]['question']):_0x2b3899[_0xad3fd5][_0xe6f3('0x6a')];}}var _0x218927=[],_0x2237c5={};for(var _0x497b52=0x0,_0x92dc95=_0x38adc3['length'];_0x497b52<_0x92dc95;_0x497b52++){_0x2237c5={'ProjectId':_0x593951[_0xe6f3('0x4c')]['id'],'SessionId':_0x38adc3[_0x497b52]['id'],'StartTime':moment(_0x38adc3[_0x497b52]['starttime'])[_0xe6f3('0x6b')](_0xe6f3('0x6c'))};for(var _0x227bb0=0x0,_0x26f5aa=_0x2b3899[_0xe6f3('0x3c')];_0x227bb0<_0x26f5aa;_0x227bb0++){if(_0x2b3899[_0x227bb0][_0xe6f3('0x6d')]==_0x38adc3[_0x497b52]['id']&&_0x5bae26[_0xe6f3('0x3d')](_0x2b3899[_0x227bb0]['questionId'])){_0x2237c5[_0x5bae26[_0x2b3899[_0x227bb0]['questionId']]]=_0x2b3899[_0x227bb0][_0xe6f3('0x6e')];}}for(var _0x3264af in _0x5bae26){if(!_0x2237c5[_0xe6f3('0x3d')](_0x5bae26[_0x3264af])){_0x2237c5[_0x5bae26[_0x3264af]]=null;}}_0x218927[_0xe6f3('0x6f')](_0x2237c5);}return _0x218927;}})[_0xe6f3('0x27')](function(_0x5e29a7){if(!_[_0xe6f3('0x70')](_0x5e29a7)){var _0x3f0e80=toCsv(_0x5e29a7);var _0xceee00=Date[_0xe6f3('0x71')]();fs['writeFileSync'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x593951['params']['id'],_0xceee00),_0x3f0e80);_0x22dd14['setHeader'](_0xe6f3('0x72'),_0xe6f3('0x73')+util[_0xe6f3('0x6b')]('Jscripty_Project_%d_Summary_%s.csv',_0x593951[_0xe6f3('0x4c')]['id'],_0xceee00));_0x22dd14['setHeader'](_0xe6f3('0x74'),'text/csv');return _0x22dd14[_0xe6f3('0x75')](util[_0xe6f3('0x6b')](_0xe6f3('0x76'),_0x593951[_0xe6f3('0x4c')]['id'],_0xceee00));}else{return _0x22dd14['sendStatus'](0xcc);}})[_0xe6f3('0x4a')](handleError(_0x22dd14,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e1b1337..94f04f1 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 _0x8ba0=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x210065,_0xcfa31b){_0x210065=_0x210065-0x0;var _0x40867f=_0x8ba0[_0x210065];return _0x40867f;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var logger=require(_0x08ba('0x2'))(_0x08ba('0x3'));var moment=require(_0x08ba('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08ba('0x5'));var rimraf=require(_0x08ba('0x6'));var config=require(_0x08ba('0x7'));var attributes=require(_0x08ba('0x8'));module[_0x08ba('0x9')]=function(_0x161a9d,_0x5f29fa){return _0x161a9d[_0x08ba('0xa')](_0x08ba('0xb'),attributes,{'tableName':_0x08ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6aa7,0x178));var _0x76aa=function(_0x77fb0e,_0x14967d){_0x77fb0e=_0x77fb0e-0x0;var _0x1f8d5c=_0x6aa7[_0x77fb0e];return _0x1f8d5c;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 5830a0f..60326be 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x18cf86,_0xfb299){var _0x1af149=function(_0x2cb007){while(--_0x2cb007){_0x18cf86['push'](_0x18cf86['shift']());}};_0x1af149(++_0xfb299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2726ab,_0x54dfa4){var _0x583850=function(_0x368675){while(--_0x368675){_0x2726ab['push'](_0x2726ab['shift']());}};_0x583850(++_0x54dfa4);}(_0xaa88,0x137));var _0x8aa8=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xaa88[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 0fed8ea..346a62d 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 _0xb20b=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x10783c,_0x20e9e9){var _0x4747df=function(_0x54798a){while(--_0x54798a){_0x10783c['push'](_0x10783c['shift']());}};_0x4747df(++_0x20e9e9);}(_0xb20b,0x105));var _0xbb20=function(_0x4d9bfe,_0x4c30cf){_0x4d9bfe=_0x4d9bfe-0x0;var _0xbbae7b=_0xb20b[_0x4d9bfe];return _0xbbae7b;};'use strict';var multer=require(_0xbb20('0x0'));var util=require(_0xbb20('0x1'));var path=require(_0xbb20('0x2'));var timeout=require(_0xbb20('0x3'));var express=require(_0xbb20('0x4'));var router=express[_0xbb20('0x5')]();var fs_extra=require(_0xbb20('0x6'));var auth=require(_0xbb20('0x7'));var interaction=require(_0xbb20('0x8'));var config=require('../../config/environment');var controller=require(_0xbb20('0x9'));router[_0xbb20('0xa')]('/',auth[_0xbb20('0xb')](),controller[_0xbb20('0xc')]);router[_0xbb20('0xa')](_0xbb20('0xd'),auth[_0xbb20('0xb')](),controller[_0xbb20('0xe')]);router[_0xbb20('0xa')](_0xbb20('0xf'),auth['isAuthenticated'](),controller[_0xbb20('0x10')]);router[_0xbb20('0x11')]('/',auth[_0xbb20('0xb')](),controller[_0xbb20('0x12')]);router[_0xbb20('0x13')](_0xbb20('0xf'),auth[_0xbb20('0xb')](),controller['update']);router[_0xbb20('0x14')]('/:id',auth[_0xbb20('0xb')](),controller[_0xbb20('0x15')]);module[_0xbb20('0x16')]=router; \ No newline at end of file +var _0xacc1=['index','/describe','describe','/:id','post','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x5a9864,_0x3dc528){var _0x458244=function(_0x2b27c3){while(--_0x2b27c3){_0x5a9864['push'](_0x5a9864['shift']());}};_0x458244(++_0x3dc528);}(_0xacc1,0xd5));var _0x1acc=function(_0x3169bf,_0x30413c){_0x3169bf=_0x3169bf-0x0;var _0x303cde=_0xacc1[_0x3169bf];return _0x303cde;};'use strict';var multer=require('multer');var util=require(_0x1acc('0x0'));var path=require('path');var timeout=require(_0x1acc('0x1'));var express=require(_0x1acc('0x2'));var router=express['Router']();var fs_extra=require(_0x1acc('0x3'));var auth=require(_0x1acc('0x4'));var interaction=require(_0x1acc('0x5'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x1acc('0x6')]('/',auth[_0x1acc('0x7')](),controller[_0x1acc('0x8')]);router[_0x1acc('0x6')](_0x1acc('0x9'),auth[_0x1acc('0x7')](),controller[_0x1acc('0xa')]);router[_0x1acc('0x6')](_0x1acc('0xb'),auth[_0x1acc('0x7')](),controller['show']);router[_0x1acc('0xc')]('/',auth[_0x1acc('0x7')](),controller['create']);router['put'](_0x1acc('0xb'),auth[_0x1acc('0x7')](),controller[_0x1acc('0xd')]);router[_0x1acc('0xe')](_0x1acc('0xb'),auth[_0x1acc('0x7')](),controller[_0x1acc('0xf')]);module[_0x1acc('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 8df9f7f..59a6d99 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x1274e8,_0x1a2d1e){_0x1274e8=_0x1274e8-0x0;var _0x287918=_0x7a54[_0x1274e8];return _0x287918;};'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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x533575,_0x105fbd){_0x533575=_0x533575-0x0;var _0x54ccca=_0x7a54[_0x533575];return _0x54ccca;};'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 75dd53d..029e088 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 _0xf9a8=['zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','find','params','describe','eml-format','rimraf'];(function(_0x5a343c,_0x24e10f){var _0x24f656=function(_0x224205){while(--_0x224205){_0x5a343c['push'](_0x5a343c['shift']());}};_0x24f656(++_0x24e10f);}(_0xf9a8,0xdf));var _0x8f9a=function(_0x2417a4,_0x226e88){_0x2417a4=_0x2417a4-0x0;var _0x16d6be=_0xf9a8[_0x2417a4];return _0x16d6be;};'use strict';var emlformat=require(_0x8f9a('0x0'));var rimraf=require(_0x8f9a('0x1'));var zipdir=require(_0x8f9a('0x2'));var jsonpatch=require(_0x8f9a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f9a('0x4'));var Mustache=require('mustache');var util=require(_0x8f9a('0x5'));var path=require(_0x8f9a('0x6'));var sox=require(_0x8f9a('0x7'));var csv=require('to-csv');var ejs=require(_0x8f9a('0x8'));var fs=require('fs');var fs_extra=require(_0x8f9a('0x9'));var _=require(_0x8f9a('0xa'));var squel=require(_0x8f9a('0xb'));var crypto=require(_0x8f9a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8f9a('0xd'));var querystring=require(_0x8f9a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8f9a('0xf'));var qs=require(_0x8f9a('0x10'));var as=require(_0x8f9a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f9a('0x12'))(_0x8f9a('0x13'));var utils=require(_0x8f9a('0x14'));var config=require(_0x8f9a('0x15'));var licenseUtil=require(_0x8f9a('0x16'));var db=require(_0x8f9a('0x17'))['db'];function respondWithStatusCode(_0x29cdf5,_0x33ee71){_0x33ee71=_0x33ee71||0xcc;return function(_0x249a38){if(_0x249a38){return _0x29cdf5['sendStatus'](_0x33ee71);}return _0x29cdf5[_0x8f9a('0x18')](_0x33ee71)[_0x8f9a('0x19')]();};}function respondWithResult(_0x588a3f,_0x4c1087){_0x4c1087=_0x4c1087||0xc8;return function(_0xb78a99){if(_0xb78a99){return _0x588a3f['status'](_0x4c1087)[_0x8f9a('0x1a')](_0xb78a99);}};}function respondWithFilteredResult(_0x587c23,_0x2ab875){return function(_0x1c539c){if(_0x1c539c){var _0x4a380f=typeof _0x2ab875['offset']==='undefined'&&typeof _0x2ab875[_0x8f9a('0x1b')]==='undefined';var _0x2e0f37=_0x1c539c['count'];var _0x5f364f=_0x4a380f?0x0:_0x2ab875['offset'];var _0x2eec68=_0x4a380f?_0x1c539c[_0x8f9a('0x1c')]:_0x2ab875[_0x8f9a('0x1d')]+_0x2ab875['limit'];var _0x58477f;if(_0x2eec68>=_0x2e0f37){_0x2eec68=_0x2e0f37;_0x58477f=0xc8;}else{_0x58477f=0xce;}_0x587c23[_0x8f9a('0x18')](_0x58477f);return _0x587c23['set'](_0x8f9a('0x1e'),_0x5f364f+'-'+_0x2eec68+'/'+_0x2e0f37)['json'](_0x1c539c);}return null;};}function patchUpdates(_0x49564d){return function(_0x4ebf4e){try{jsonpatch[_0x8f9a('0x1f')](_0x4ebf4e,_0x49564d,!![]);}catch(_0x55c86d){return BPromise[_0x8f9a('0x20')](_0x55c86d);}return _0x4ebf4e[_0x8f9a('0x21')]();};}function saveUpdates(_0x27415c,_0x5934a5){return function(_0x8c90c8){if(_0x8c90c8){return _0x8c90c8[_0x8f9a('0x22')](_0x27415c)['then'](function(_0x8df1e4){return _0x8df1e4;});}return null;};}function removeEntity(_0x2285d9,_0x4d4a93){return function(_0x31e85b){if(_0x31e85b){return _0x31e85b[_0x8f9a('0x23')]()[_0x8f9a('0x24')](function(){_0x2285d9[_0x8f9a('0x18')](0xcc)[_0x8f9a('0x19')]();});}};}function handleEntityNotFound(_0x1efa5e,_0x12c0ab){return function(_0x4be2fa){if(!_0x4be2fa){_0x1efa5e[_0x8f9a('0x25')](0x194);}return _0x4be2fa;};}function handleError(_0x3841c5,_0x3335c3){_0x3335c3=_0x3335c3||0x1f4;return function(_0x58e0f8){logger[_0x8f9a('0x26')](_0x58e0f8[_0x8f9a('0x27')]);if(_0x58e0f8[_0x8f9a('0x28')]){delete _0x58e0f8[_0x8f9a('0x28')];}_0x3841c5['status'](_0x3335c3)[_0x8f9a('0x29')](_0x58e0f8);};}exports['index']=function(_0x104aec,_0x2a4d05){var _0x4cd43d={},_0x32313f={},_0x3edf44={'count':0x0,'rows':[]};var _0x58db45=_[_0x8f9a('0x2a')](db[_0x8f9a('0x2b')][_0x8f9a('0x2c')],function(_0x2a09d7){return{'name':_0x2a09d7[_0x8f9a('0x2d')],'type':_0x2a09d7['type'][_0x8f9a('0x2e')]};});_0x32313f[_0x8f9a('0x2f')]=_['map'](_0x58db45,_0x8f9a('0x28'));_0x32313f[_0x8f9a('0x30')]=_[_0x8f9a('0x31')](_0x104aec[_0x8f9a('0x30')]);_0x32313f[_0x8f9a('0x32')]=_[_0x8f9a('0x33')](_0x32313f[_0x8f9a('0x2f')],_0x32313f[_0x8f9a('0x30')]);_0x4cd43d[_0x8f9a('0x34')]=_[_0x8f9a('0x33')](_0x32313f[_0x8f9a('0x2f')],qs['fields'](_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x35')]));_0x4cd43d['attributes']=_0x4cd43d['attributes'][_0x8f9a('0x36')]?_0x4cd43d[_0x8f9a('0x34')]:_0x32313f[_0x8f9a('0x2f')];if(!_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x37')](_0x8f9a('0x38'))){_0x4cd43d['limit']=qs[_0x8f9a('0x1b')](_0x104aec[_0x8f9a('0x30')]['limit']);_0x4cd43d[_0x8f9a('0x1d')]=qs[_0x8f9a('0x1d')](_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x1d')]);}_0x4cd43d[_0x8f9a('0x39')]=qs[_0x8f9a('0x3a')](_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x3a')]);_0x4cd43d[_0x8f9a('0x3b')]=qs['filters'](_[_0x8f9a('0x3c')](_0x104aec[_0x8f9a('0x30')],_0x32313f['filters']),_0x58db45);if(_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x3d')]){_0x4cd43d[_0x8f9a('0x3b')]=_[_0x8f9a('0x3e')](_0x4cd43d[_0x8f9a('0x3b')],{'$or':_[_0x8f9a('0x2a')](_0x58db45,function(_0x420641){if(_0x420641['type']!==_0x8f9a('0x3f')){var _0x3f3115={};_0x3f3115[_0x420641['name']]={'$like':'%'+_0x104aec['query'][_0x8f9a('0x3d')]+'%'};return _0x3f3115;}})});}_0x4cd43d=_[_0x8f9a('0x3e')]({},_0x4cd43d,_0x104aec[_0x8f9a('0x40')]);var _0x4c5907={'where':_0x4cd43d[_0x8f9a('0x3b')]};return db['JscriptyQuestionReport'][_0x8f9a('0x1c')](_0x4c5907)[_0x8f9a('0x24')](function(_0x2cd02e){_0x3edf44[_0x8f9a('0x1c')]=_0x2cd02e;if(_0x104aec['query'][_0x8f9a('0x41')]){_0x4cd43d[_0x8f9a('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8f9a('0x43')](_0x4cd43d);})[_0x8f9a('0x24')](function(_0x41b44f){_0x3edf44['rows']=_0x41b44f;return _0x3edf44;})[_0x8f9a('0x24')](respondWithFilteredResult(_0x2a4d05,_0x4cd43d))['catch'](handleError(_0x2a4d05,null));};exports[_0x8f9a('0x44')]=function(_0x1f8bd0,_0x24e653){var _0x23a6f3={'raw':!![],'where':{'id':_0x1f8bd0['params']['id']}},_0x4307d2={};_0x4307d2[_0x8f9a('0x2f')]=_[_0x8f9a('0x31')](db[_0x8f9a('0x2b')]['rawAttributes']);_0x4307d2[_0x8f9a('0x30')]=_[_0x8f9a('0x31')](_0x1f8bd0[_0x8f9a('0x30')]);_0x4307d2['filters']=_[_0x8f9a('0x33')](_0x4307d2[_0x8f9a('0x2f')],_0x4307d2[_0x8f9a('0x30')]);_0x23a6f3['attributes']=_['intersection'](_0x4307d2[_0x8f9a('0x2f')],qs['fields'](_0x1f8bd0[_0x8f9a('0x30')]['fields']));_0x23a6f3[_0x8f9a('0x34')]=_0x23a6f3[_0x8f9a('0x34')]['length']?_0x23a6f3['attributes']:_0x4307d2['model'];if(_0x1f8bd0[_0x8f9a('0x30')][_0x8f9a('0x41')]){_0x23a6f3[_0x8f9a('0x42')]=[{'all':!![]}];}_0x23a6f3=_['merge']({},_0x23a6f3,_0x1f8bd0[_0x8f9a('0x40')]);return db[_0x8f9a('0x2b')]['find'](_0x23a6f3)['then'](handleEntityNotFound(_0x24e653,null))[_0x8f9a('0x24')](respondWithResult(_0x24e653,null))[_0x8f9a('0x45')](handleError(_0x24e653,null));};exports[_0x8f9a('0x46')]=function(_0x1971e1,_0x2d038a){return db[_0x8f9a('0x2b')][_0x8f9a('0x46')](_0x1971e1['body'],{})[_0x8f9a('0x24')](respondWithResult(_0x2d038a,0xc9))[_0x8f9a('0x45')](handleError(_0x2d038a,null));};exports[_0x8f9a('0x22')]=function(_0x150ae1,_0x3f8b0d){if(_0x150ae1[_0x8f9a('0x47')]['id']){delete _0x150ae1['body']['id'];}return db[_0x8f9a('0x2b')][_0x8f9a('0x48')]({'where':{'id':_0x150ae1[_0x8f9a('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f8b0d,null))[_0x8f9a('0x24')](saveUpdates(_0x150ae1[_0x8f9a('0x47')],null))[_0x8f9a('0x24')](respondWithResult(_0x3f8b0d,null))['catch'](handleError(_0x3f8b0d,null));};exports[_0x8f9a('0x23')]=function(_0x2bacb7,_0x473a52){return db['JscriptyQuestionReport'][_0x8f9a('0x48')]({'where':{'id':_0x2bacb7[_0x8f9a('0x49')]['id']}})['then'](handleEntityNotFound(_0x473a52,null))[_0x8f9a('0x24')](removeEntity(_0x473a52,null))[_0x8f9a('0x45')](handleError(_0x473a52,null));};exports[_0x8f9a('0x4a')]=function(_0x459693,_0x2b07ae){return db[_0x8f9a('0x2b')][_0x8f9a('0x4a')]()[_0x8f9a('0x24')](respondWithResult(_0x2b07ae,null))[_0x8f9a('0x45')](handleError(_0x2b07ae,null));}; \ No newline at end of file +var _0x8475=['rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','destroy','stack','name','send','index','map'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x8475,0x64));var _0x5847=function(_0x3b0276,_0x323f9d){_0x3b0276=_0x3b0276-0x0;var _0x4ad57f=_0x8475[_0x3b0276];return _0x4ad57f;};'use strict';var emlformat=require(_0x5847('0x0'));var rimraf=require(_0x5847('0x1'));var zipdir=require(_0x5847('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5847('0x4'));var util=require(_0x5847('0x5'));var path=require('path');var sox=require(_0x5847('0x6'));var csv=require(_0x5847('0x7'));var ejs=require(_0x5847('0x8'));var fs=require('fs');var fs_extra=require(_0x5847('0x9'));var _=require(_0x5847('0xa'));var squel=require(_0x5847('0xb'));var crypto=require(_0x5847('0xc'));var jsforce=require(_0x5847('0xd'));var deskjs=require(_0x5847('0xe'));var toCsv=require(_0x5847('0x7'));var querystring=require(_0x5847('0xf'));var Papa=require('papaparse');var Redis=require(_0x5847('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5847('0x11'));var as=require(_0x5847('0x12'));var hardwareService=require(_0x5847('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5847('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5847('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x131244,_0x318a08){_0x318a08=_0x318a08||0xcc;return function(_0xc35e67){if(_0xc35e67){return _0x131244[_0x5847('0x16')](_0x318a08);}return _0x131244[_0x5847('0x17')](_0x318a08)[_0x5847('0x18')]();};}function respondWithResult(_0x5d3dcf,_0x2d1016){_0x2d1016=_0x2d1016||0xc8;return function(_0x45ae56){if(_0x45ae56){return _0x5d3dcf[_0x5847('0x17')](_0x2d1016)[_0x5847('0x19')](_0x45ae56);}};}function respondWithFilteredResult(_0x171dfe,_0x49b643){return function(_0x2e20c9){if(_0x2e20c9){var _0x5d66c1=typeof _0x49b643[_0x5847('0x1a')]==='undefined'&&typeof _0x49b643[_0x5847('0x1b')]===_0x5847('0x1c');var _0xc731d3=_0x2e20c9[_0x5847('0x1d')];var _0x4b7b5f=_0x5d66c1?0x0:_0x49b643[_0x5847('0x1a')];var _0x4b2ae6=_0x5d66c1?_0x2e20c9[_0x5847('0x1d')]:_0x49b643[_0x5847('0x1a')]+_0x49b643[_0x5847('0x1b')];var _0x2d8d6e;if(_0x4b2ae6>=_0xc731d3){_0x4b2ae6=_0xc731d3;_0x2d8d6e=0xc8;}else{_0x2d8d6e=0xce;}_0x171dfe['status'](_0x2d8d6e);return _0x171dfe[_0x5847('0x1e')]('Content-Range',_0x4b7b5f+'-'+_0x4b2ae6+'/'+_0xc731d3)[_0x5847('0x19')](_0x2e20c9);}return null;};}function patchUpdates(_0x2765ee){return function(_0x21f337){try{jsonpatch['apply'](_0x21f337,_0x2765ee,!![]);}catch(_0xad4cae){return BPromise['reject'](_0xad4cae);}return _0x21f337[_0x5847('0x1f')]();};}function saveUpdates(_0x1ff483,_0x172f6b){return function(_0xcb3bc8){if(_0xcb3bc8){return _0xcb3bc8[_0x5847('0x20')](_0x1ff483)[_0x5847('0x21')](function(_0x3c2581){return _0x3c2581;});}return null;};}function removeEntity(_0xef43aa,_0x41eaf1){return function(_0x41a2eb){if(_0x41a2eb){return _0x41a2eb[_0x5847('0x22')]()[_0x5847('0x21')](function(){_0xef43aa[_0x5847('0x17')](0xcc)[_0x5847('0x18')]();});}};}function handleEntityNotFound(_0x35568e,_0x264444){return function(_0x4a1fc7){if(!_0x4a1fc7){_0x35568e[_0x5847('0x16')](0x194);}return _0x4a1fc7;};}function handleError(_0x4381c9,_0x4e1666){_0x4e1666=_0x4e1666||0x1f4;return function(_0x7ec5a0){logger['error'](_0x7ec5a0[_0x5847('0x23')]);if(_0x7ec5a0[_0x5847('0x24')]){delete _0x7ec5a0[_0x5847('0x24')];}_0x4381c9[_0x5847('0x17')](_0x4e1666)[_0x5847('0x25')](_0x7ec5a0);};}exports[_0x5847('0x26')]=function(_0x526c9f,_0x46bf1f){var _0x5af85c={},_0x5c7c1a={},_0x5e7b78={'count':0x0,'rows':[]};var _0x3970be=_[_0x5847('0x27')](db['JscriptyQuestionReport'][_0x5847('0x28')],function(_0x4a7a04){return{'name':_0x4a7a04['fieldName'],'type':_0x4a7a04[_0x5847('0x29')]['key']};});_0x5c7c1a[_0x5847('0x2a')]=_[_0x5847('0x27')](_0x3970be,_0x5847('0x24'));_0x5c7c1a[_0x5847('0x2b')]=_[_0x5847('0x2c')](_0x526c9f[_0x5847('0x2b')]);_0x5c7c1a[_0x5847('0x2d')]=_[_0x5847('0x2e')](_0x5c7c1a[_0x5847('0x2a')],_0x5c7c1a['query']);_0x5af85c[_0x5847('0x2f')]=_['intersection'](_0x5c7c1a[_0x5847('0x2a')],qs['fields'](_0x526c9f[_0x5847('0x2b')][_0x5847('0x30')]));_0x5af85c[_0x5847('0x2f')]=_0x5af85c[_0x5847('0x2f')][_0x5847('0x31')]?_0x5af85c[_0x5847('0x2f')]:_0x5c7c1a[_0x5847('0x2a')];if(!_0x526c9f[_0x5847('0x2b')]['hasOwnProperty'](_0x5847('0x32'))){_0x5af85c['limit']=qs['limit'](_0x526c9f[_0x5847('0x2b')][_0x5847('0x1b')]);_0x5af85c[_0x5847('0x1a')]=qs[_0x5847('0x1a')](_0x526c9f[_0x5847('0x2b')][_0x5847('0x1a')]);}_0x5af85c[_0x5847('0x33')]=qs[_0x5847('0x34')](_0x526c9f[_0x5847('0x2b')]['sort']);_0x5af85c[_0x5847('0x35')]=qs[_0x5847('0x2d')](_[_0x5847('0x36')](_0x526c9f[_0x5847('0x2b')],_0x5c7c1a[_0x5847('0x2d')]),_0x3970be);if(_0x526c9f[_0x5847('0x2b')][_0x5847('0x37')]){_0x5af85c[_0x5847('0x35')]=_[_0x5847('0x38')](_0x5af85c['where'],{'$or':_[_0x5847('0x27')](_0x3970be,function(_0x1df8f1){if(_0x1df8f1[_0x5847('0x29')]!==_0x5847('0x39')){var _0x10b7ce={};_0x10b7ce[_0x1df8f1[_0x5847('0x24')]]={'$like':'%'+_0x526c9f[_0x5847('0x2b')][_0x5847('0x37')]+'%'};return _0x10b7ce;}})});}_0x5af85c=_[_0x5847('0x38')]({},_0x5af85c,_0x526c9f[_0x5847('0x3a')]);var _0x4ee6b4={'where':_0x5af85c[_0x5847('0x35')]};return db[_0x5847('0x3b')][_0x5847('0x1d')](_0x4ee6b4)[_0x5847('0x21')](function(_0x47f1a1){_0x5e7b78['count']=_0x47f1a1;if(_0x526c9f[_0x5847('0x2b')][_0x5847('0x3c')]){_0x5af85c[_0x5847('0x3d')]=[{'all':!![]}];}return db[_0x5847('0x3b')][_0x5847('0x3e')](_0x5af85c);})[_0x5847('0x21')](function(_0x447497){_0x5e7b78['rows']=_0x447497;return _0x5e7b78;})[_0x5847('0x21')](respondWithFilteredResult(_0x46bf1f,_0x5af85c))['catch'](handleError(_0x46bf1f,null));};exports[_0x5847('0x3f')]=function(_0x8b4c3f,_0xc18662){var _0x587591={'raw':!![],'where':{'id':_0x8b4c3f[_0x5847('0x40')]['id']}},_0x3f8ce2={};_0x3f8ce2[_0x5847('0x2a')]=_['keys'](db[_0x5847('0x3b')][_0x5847('0x28')]);_0x3f8ce2[_0x5847('0x2b')]=_[_0x5847('0x2c')](_0x8b4c3f[_0x5847('0x2b')]);_0x3f8ce2[_0x5847('0x2d')]=_['intersection'](_0x3f8ce2[_0x5847('0x2a')],_0x3f8ce2[_0x5847('0x2b')]);_0x587591['attributes']=_[_0x5847('0x2e')](_0x3f8ce2[_0x5847('0x2a')],qs[_0x5847('0x30')](_0x8b4c3f[_0x5847('0x2b')][_0x5847('0x30')]));_0x587591[_0x5847('0x2f')]=_0x587591[_0x5847('0x2f')][_0x5847('0x31')]?_0x587591[_0x5847('0x2f')]:_0x3f8ce2[_0x5847('0x2a')];if(_0x8b4c3f['query'][_0x5847('0x3c')]){_0x587591[_0x5847('0x3d')]=[{'all':!![]}];}_0x587591=_[_0x5847('0x38')]({},_0x587591,_0x8b4c3f['options']);return db[_0x5847('0x3b')]['find'](_0x587591)['then'](handleEntityNotFound(_0xc18662,null))[_0x5847('0x21')](respondWithResult(_0xc18662,null))[_0x5847('0x41')](handleError(_0xc18662,null));};exports['create']=function(_0x3df2df,_0x563308){return db[_0x5847('0x3b')][_0x5847('0x42')](_0x3df2df[_0x5847('0x43')],{})[_0x5847('0x21')](respondWithResult(_0x563308,0xc9))['catch'](handleError(_0x563308,null));};exports['update']=function(_0x1a5a79,_0x42a4aa){if(_0x1a5a79[_0x5847('0x43')]['id']){delete _0x1a5a79['body']['id'];}return db[_0x5847('0x3b')][_0x5847('0x44')]({'where':{'id':_0x1a5a79[_0x5847('0x40')]['id']}})['then'](handleEntityNotFound(_0x42a4aa,null))[_0x5847('0x21')](saveUpdates(_0x1a5a79['body'],null))[_0x5847('0x21')](respondWithResult(_0x42a4aa,null))['catch'](handleError(_0x42a4aa,null));};exports[_0x5847('0x22')]=function(_0x1ec9fe,_0x59d064){return db[_0x5847('0x3b')][_0x5847('0x44')]({'where':{'id':_0x1ec9fe[_0x5847('0x40')]['id']}})['then'](handleEntityNotFound(_0x59d064,null))[_0x5847('0x21')](removeEntity(_0x59d064,null))['catch'](handleError(_0x59d064,null));};exports['describe']=function(_0x42073d,_0x7776f8){return db[_0x5847('0x3b')][_0x5847('0x45')]()[_0x5847('0x21')](respondWithResult(_0x7776f8,null))[_0x5847('0x41')](handleError(_0x7776f8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index ae3a913..77503b7 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 _0x89b6=['path','rimraf','../../config/environment','exports','JscriptyQuestionReport','../../config/logger','api','moment','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x89b6,0x152));var _0x689b=function(_0x1b6c0c,_0x51ef20){_0x1b6c0c=_0x1b6c0c-0x0;var _0x178991=_0x89b6[_0x1b6c0c];return _0x178991;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x689b('0x0'))(_0x689b('0x1'));var moment=require(_0x689b('0x2'));var BPromise=require('bluebird');var rp=require(_0x689b('0x3'));var fs=require('fs');var path=require(_0x689b('0x4'));var rimraf=require(_0x689b('0x5'));var config=require(_0x689b('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x689b('0x7')]=function(_0x1d48cb,_0xd7ecc8){return _0x1d48cb['define'](_0x689b('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ddf=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports'];(function(_0x329935,_0x24b29f){var _0x26d30a=function(_0x4a669f){while(--_0x4a669f){_0x329935['push'](_0x329935['shift']());}};_0x26d30a(++_0x24b29f);}(_0x0ddf,0xb7));var _0xf0dd=function(_0xd6b599,_0x52a7ae){_0xd6b599=_0xd6b599-0x0;var _0x243069=_0x0ddf[_0xd6b599];return _0x243069;};'use strict';var _=require(_0xf0dd('0x0'));var util=require(_0xf0dd('0x1'));var logger=require('../../config/logger')(_0xf0dd('0x2'));var moment=require(_0xf0dd('0x3'));var BPromise=require('bluebird');var rp=require(_0xf0dd('0x4'));var fs=require('fs');var path=require(_0xf0dd('0x5'));var rimraf=require(_0xf0dd('0x6'));var config=require('../../config/environment');var attributes=require(_0xf0dd('0x7'));module[_0xf0dd('0x8')]=function(_0x55b063,_0x5110c7){return _0x55b063[_0xf0dd('0x9')](_0xf0dd('0xa'),attributes,{'tableName':_0xf0dd('0xb'),'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 9ed5b97..2634ffa 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 _0xe7a5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xe7a5,0x139));var _0x5e7a=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xe7a5[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require('lodash');var util=require(_0x5e7a('0x0'));var moment=require(_0x5e7a('0x1'));var BPromise=require(_0x5e7a('0x2'));var rs=require(_0x5e7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e7a('0x4'))['db'];var utils=require(_0x5e7a('0x5'));var logger=require(_0x5e7a('0x6'))('rpc');var config=require(_0x5e7a('0x7'));var jayson=require(_0x5e7a('0x8'));var client=jayson[_0x5e7a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47ddf8,_0x5049c8,_0x40e5a7){return new BPromise(function(_0x248c71,_0x5099f3){return client['request'](_0x47ddf8,_0x40e5a7)[_0x5e7a('0xa')](function(_0x5dfae4){logger[_0x5e7a('0xb')](_0x5e7a('0xc'),_0x5049c8,'request\x20sent');logger[_0x5e7a('0xd')](_0x5e7a('0xe'),_0x5049c8,_0x5e7a('0xf'),JSON[_0x5e7a('0x10')](_0x5dfae4));if(_0x5dfae4[_0x5e7a('0x11')]){if(_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x12')]===0x1f4){logger['error'](_0x5e7a('0xc'),_0x5049c8,_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);return _0x5099f3(_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);}logger[_0x5e7a('0x11')](_0x5e7a('0xc'),_0x5049c8,_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);return _0x248c71(_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);}else{logger[_0x5e7a('0xb')](_0x5e7a('0xc'),_0x5049c8,_0x5e7a('0xf'));_0x248c71(_0x5dfae4[_0x5e7a('0x14')][_0x5e7a('0x13')]);}})['catch'](function(_0x296726){logger[_0x5e7a('0x11')](_0x5e7a('0xc'),_0x5049c8,_0x296726);_0x5099f3(_0x296726);});});} \ No newline at end of file +var _0x71e9=['message','util','randomstring','../../mysqldb','../../config/utils','client','http','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x3fcbc8,_0x2138d){var _0x340762=function(_0x3e6889){while(--_0x3e6889){_0x3fcbc8['push'](_0x3fcbc8['shift']());}};_0x340762(++_0x2138d);}(_0x71e9,0x11e));var _0x971e=function(_0x4d8769,_0x29caca){_0x4d8769=_0x4d8769-0x0;var _0x20c789=_0x71e9[_0x4d8769];return _0x20c789;};'use strict';var _=require('lodash');var util=require(_0x971e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x971e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x971e('0x2'))['db'];var utils=require(_0x971e('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x971e('0x4')][_0x971e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x53c47e,_0x27d2b0,_0xfb7983){return new BPromise(function(_0x268c7b,_0x4256d2){return client['request'](_0x53c47e,_0xfb7983)[_0x971e('0x6')](function(_0x112453){logger[_0x971e('0x7')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x27d2b0,_0x971e('0x8'));logger[_0x971e('0x9')](_0x971e('0xa'),_0x27d2b0,'request\x20sent',JSON[_0x971e('0xb')](_0x112453));if(_0x112453[_0x971e('0xc')]){if(_0x112453['error']['code']===0x1f4){logger['error'](_0x971e('0xd'),_0x27d2b0,_0x112453[_0x971e('0xc')]['message']);return _0x4256d2(_0x112453[_0x971e('0xc')][_0x971e('0xe')]);}logger[_0x971e('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x27d2b0,_0x112453['error']['message']);return _0x268c7b(_0x112453[_0x971e('0xc')][_0x971e('0xe')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x27d2b0,_0x971e('0x8'));_0x268c7b(_0x112453['result'][_0x971e('0xe')]);}})['catch'](function(_0x4af1fd){logger[_0x971e('0xc')](_0x971e('0xd'),_0x27d2b0,_0x4af1fd);_0x4256d2(_0x4af1fd);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 7366e60..4ef370c 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 _0x52c3=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','show','/:id/questions','getQuestions','post','create','put','/:id','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x52c3,0xbf));var _0x352c=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0x52c3[_0x50f0a9];return _0x5a33d9;};'use strict';var multer=require(_0x352c('0x0'));var util=require(_0x352c('0x1'));var path=require(_0x352c('0x2'));var timeout=require('connect-timeout');var express=require(_0x352c('0x3'));var router=express[_0x352c('0x4')]();var fs_extra=require(_0x352c('0x5'));var auth=require(_0x352c('0x6'));var interaction=require(_0x352c('0x7'));var config=require(_0x352c('0x8'));var controller=require(_0x352c('0x9'));router['get']('/',auth[_0x352c('0xa')](),controller[_0x352c('0xb')]);router[_0x352c('0xc')](_0x352c('0xd'),auth[_0x352c('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x352c('0xe')]);router[_0x352c('0xc')](_0x352c('0xf'),auth['isAuthenticated'](),controller[_0x352c('0x10')]);router[_0x352c('0x11')]('/',auth[_0x352c('0xa')](),controller[_0x352c('0x12')]);router[_0x352c('0x13')](_0x352c('0x14'),auth[_0x352c('0xa')](),controller['update']);router[_0x352c('0x15')](_0x352c('0x14'),auth[_0x352c('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xae29=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getQuestions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x566ec4,_0x51e6d4){var _0x5421ef=function(_0x345994){while(--_0x345994){_0x566ec4['push'](_0x566ec4['shift']());}};_0x5421ef(++_0x51e6d4);}(_0xae29,0x1c7));var _0x9ae2=function(_0x3d82e6,_0x48d650){_0x3d82e6=_0x3d82e6-0x0;var _0x2c9e73=_0xae29[_0x3d82e6];return _0x2c9e73;};'use strict';var multer=require(_0x9ae2('0x0'));var util=require(_0x9ae2('0x1'));var path=require(_0x9ae2('0x2'));var timeout=require(_0x9ae2('0x3'));var express=require(_0x9ae2('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9ae2('0x5'));var interaction=require(_0x9ae2('0x6'));var config=require(_0x9ae2('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x9ae2('0x8')]('/',auth[_0x9ae2('0x9')](),controller[_0x9ae2('0xa')]);router['get']('/describe',auth[_0x9ae2('0x9')](),controller['describe']);router[_0x9ae2('0x8')](_0x9ae2('0xb'),auth['isAuthenticated'](),controller[_0x9ae2('0xc')]);router[_0x9ae2('0x8')]('/:id/questions',auth[_0x9ae2('0x9')](),controller[_0x9ae2('0xd')]);router[_0x9ae2('0xe')]('/',auth[_0x9ae2('0x9')](),controller[_0x9ae2('0xf')]);router[_0x9ae2('0x10')](_0x9ae2('0xb'),auth[_0x9ae2('0x9')](),controller[_0x9ae2('0x11')]);router[_0x9ae2('0x12')](_0x9ae2('0xb'),auth[_0x9ae2('0x9')](),controller['destroy']);module[_0x9ae2('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ebf63ce..f770475 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 _0xdadf=['BOOLEAN','moment','sequelize','exports','DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x2e13b5,_0x4fe598){var _0x107502=function(_0x221356){while(--_0x221356){_0x2e13b5['push'](_0x2e13b5['shift']());}};_0x107502(++_0x4fe598);}(_0xdadf,0xc7));var _0xfdad=function(_0x59d2dd,_0x1de825){_0x59d2dd=_0x59d2dd-0x0;var _0x3992c2=_0xdadf[_0x59d2dd];return _0x3992c2;};'use strict';var moment=require(_0xfdad('0x0'));var Sequelize=require(_0xfdad('0x1'));module[_0xfdad('0x2')]={'starttime':{'type':Sequelize[_0xfdad('0x3')],'set':function(_0x546a87){this['setDataValue'](_0xfdad('0x4'),_0x546a87);this[_0xfdad('0x5')](_0xfdad('0x6'),moment()[_0xfdad('0x7')](_0xfdad('0x8')));}},'endtime':{'type':Sequelize[_0xfdad('0x3')]},'membername':{'type':Sequelize[_0xfdad('0x9')]},'projectname':{'type':Sequelize[_0xfdad('0x9')]},'queue':{'type':Sequelize[_0xfdad('0x9')]},'uniqueid':{'type':Sequelize[_0xfdad('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xfdad('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x3526=['sequelize','exports','DATE','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x3526,0x1ef));var _0x6352=function(_0x58e907,_0x2cd679){_0x58e907=_0x58e907-0x0;var _0x6306eb=_0x3526[_0x58e907];return _0x6306eb;};'use strict';var moment=require(_0x6352('0x0'));var Sequelize=require(_0x6352('0x1'));module[_0x6352('0x2')]={'starttime':{'type':Sequelize[_0x6352('0x3')],'set':function(_0x127bbf){this['setDataValue'](_0x6352('0x4'),_0x127bbf);this['setDataValue']('endtime',moment()[_0x6352('0x5')](_0x6352('0x6')));}},'endtime':{'type':Sequelize[_0x6352('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x6352('0x7')]},'queue':{'type':Sequelize[_0x6352('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6352('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a6cb59e..39f7f2d 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 _0x8b07=['where','pick','filter','merge','options','include','rows','catch','show','params','includeAll','create','body','update','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','then','error','stack','name','send','index','JscriptySessionReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0x8b07,0x106));var _0x78b0=function(_0x4f8a06,_0x83dc2d){_0x4f8a06=_0x4f8a06-0x0;var _0x1e6a4b=_0x8b07[_0x4f8a06];return _0x1e6a4b;};'use strict';var emlformat=require(_0x78b0('0x0'));var rimraf=require(_0x78b0('0x1'));var zipdir=require(_0x78b0('0x2'));var jsonpatch=require(_0x78b0('0x3'));var rp=require(_0x78b0('0x4'));var moment=require(_0x78b0('0x5'));var BPromise=require(_0x78b0('0x6'));var Mustache=require(_0x78b0('0x7'));var util=require(_0x78b0('0x8'));var path=require(_0x78b0('0x9'));var sox=require(_0x78b0('0xa'));var csv=require(_0x78b0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78b0('0xc'));var _=require('lodash');var squel=require(_0x78b0('0xd'));var crypto=require(_0x78b0('0xe'));var jsforce=require(_0x78b0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x78b0('0xb'));var querystring=require('querystring');var Papa=require(_0x78b0('0x10'));var Redis=require(_0x78b0('0x11'));var authService=require(_0x78b0('0x12'));var qs=require(_0x78b0('0x13'));var as=require(_0x78b0('0x14'));var hardwareService=require(_0x78b0('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x78b0('0x16'));var config=require(_0x78b0('0x17'));var licenseUtil=require(_0x78b0('0x18'));var db=require(_0x78b0('0x19'))['db'];function respondWithStatusCode(_0x542711,_0x21910f){_0x21910f=_0x21910f||0xcc;return function(_0x554cb6){if(_0x554cb6){return _0x542711['sendStatus'](_0x21910f);}return _0x542711[_0x78b0('0x1a')](_0x21910f)[_0x78b0('0x1b')]();};}function respondWithResult(_0x2ceae8,_0x22fbd7){_0x22fbd7=_0x22fbd7||0xc8;return function(_0x11686d){if(_0x11686d){return _0x2ceae8[_0x78b0('0x1a')](_0x22fbd7)[_0x78b0('0x1c')](_0x11686d);}};}function respondWithFilteredResult(_0xbd52e5,_0x9b34c8){return function(_0x2ee36c){if(_0x2ee36c){var _0x24d2d0=typeof _0x9b34c8[_0x78b0('0x1d')]===_0x78b0('0x1e')&&typeof _0x9b34c8[_0x78b0('0x1f')]===_0x78b0('0x1e');var _0x5cf6a8=_0x2ee36c[_0x78b0('0x20')];var _0x4bcb50=_0x24d2d0?0x0:_0x9b34c8['offset'];var _0x5b026d=_0x24d2d0?_0x2ee36c[_0x78b0('0x20')]:_0x9b34c8[_0x78b0('0x1d')]+_0x9b34c8[_0x78b0('0x1f')];var _0x4b555f;if(_0x5b026d>=_0x5cf6a8){_0x5b026d=_0x5cf6a8;_0x4b555f=0xc8;}else{_0x4b555f=0xce;}_0xbd52e5['status'](_0x4b555f);return _0xbd52e5[_0x78b0('0x21')]('Content-Range',_0x4bcb50+'-'+_0x5b026d+'/'+_0x5cf6a8)['json'](_0x2ee36c);}return null;};}function patchUpdates(_0xe6e453){return function(_0x3540eb){try{jsonpatch['apply'](_0x3540eb,_0xe6e453,!![]);}catch(_0x1e33cf){return BPromise[_0x78b0('0x22')](_0x1e33cf);}return _0x3540eb['save']();};}function saveUpdates(_0xbeaf64,_0x35c9de){return function(_0x3f0946){if(_0x3f0946){return _0x3f0946['update'](_0xbeaf64)[_0x78b0('0x23')](function(_0x3dd056){return _0x3dd056;});}return null;};}function removeEntity(_0x21fe63,_0xeaaee6){return function(_0x149aa6){if(_0x149aa6){return _0x149aa6['destroy']()[_0x78b0('0x23')](function(){_0x21fe63[_0x78b0('0x1a')](0xcc)[_0x78b0('0x1b')]();});}};}function handleEntityNotFound(_0x1b8985,_0x42b8e5){return function(_0x5ad61e){if(!_0x5ad61e){_0x1b8985['sendStatus'](0x194);}return _0x5ad61e;};}function handleError(_0x4307e0,_0xdc9d10){_0xdc9d10=_0xdc9d10||0x1f4;return function(_0x4929cb){logger[_0x78b0('0x24')](_0x4929cb[_0x78b0('0x25')]);if(_0x4929cb['name']){delete _0x4929cb[_0x78b0('0x26')];}_0x4307e0[_0x78b0('0x1a')](_0xdc9d10)[_0x78b0('0x27')](_0x4929cb);};}exports[_0x78b0('0x28')]=function(_0x1717bf,_0x39e2a3){var _0x16d3d9={},_0x3a32ad={},_0x106c5e={'count':0x0,'rows':[]};var _0x17392a=_['map'](db[_0x78b0('0x29')][_0x78b0('0x2a')],function(_0x4c362d){return{'name':_0x4c362d['fieldName'],'type':_0x4c362d[_0x78b0('0x2b')][_0x78b0('0x2c')]};});_0x3a32ad['model']=_[_0x78b0('0x2d')](_0x17392a,'name');_0x3a32ad[_0x78b0('0x2e')]=_[_0x78b0('0x2f')](_0x1717bf[_0x78b0('0x2e')]);_0x3a32ad[_0x78b0('0x30')]=_[_0x78b0('0x31')](_0x3a32ad[_0x78b0('0x32')],_0x3a32ad[_0x78b0('0x2e')]);_0x16d3d9[_0x78b0('0x33')]=_[_0x78b0('0x31')](_0x3a32ad['model'],qs[_0x78b0('0x34')](_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x34')]));_0x16d3d9[_0x78b0('0x33')]=_0x16d3d9[_0x78b0('0x33')][_0x78b0('0x35')]?_0x16d3d9['attributes']:_0x3a32ad[_0x78b0('0x32')];if(!_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x36')](_0x78b0('0x37'))){_0x16d3d9[_0x78b0('0x1f')]=qs[_0x78b0('0x1f')](_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x1f')]);_0x16d3d9['offset']=qs[_0x78b0('0x1d')](_0x1717bf['query'][_0x78b0('0x1d')]);}_0x16d3d9[_0x78b0('0x38')]=qs[_0x78b0('0x39')](_0x1717bf['query'][_0x78b0('0x39')]);_0x16d3d9[_0x78b0('0x3a')]=qs[_0x78b0('0x30')](_[_0x78b0('0x3b')](_0x1717bf[_0x78b0('0x2e')],_0x3a32ad['filters']),_0x17392a);if(_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x3c')]){_0x16d3d9[_0x78b0('0x3a')]=_[_0x78b0('0x3d')](_0x16d3d9[_0x78b0('0x3a')],{'$or':_[_0x78b0('0x2d')](_0x17392a,function(_0x762096){if(_0x762096['type']!=='VIRTUAL'){var _0x1adc79={};_0x1adc79[_0x762096[_0x78b0('0x26')]]={'$like':'%'+_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x3c')]+'%'};return _0x1adc79;}})});}_0x16d3d9=_[_0x78b0('0x3d')]({},_0x16d3d9,_0x1717bf[_0x78b0('0x3e')]);var _0x515951={'where':_0x16d3d9[_0x78b0('0x3a')]};return db[_0x78b0('0x29')]['count'](_0x515951)[_0x78b0('0x23')](function(_0x404cdc){_0x106c5e['count']=_0x404cdc;if(_0x1717bf[_0x78b0('0x2e')]['includeAll']){_0x16d3d9[_0x78b0('0x3f')]=[{'all':!![]}];}return db[_0x78b0('0x29')]['findAll'](_0x16d3d9);})[_0x78b0('0x23')](function(_0x3b8bb5){_0x106c5e[_0x78b0('0x40')]=_0x3b8bb5;return _0x106c5e;})[_0x78b0('0x23')](respondWithFilteredResult(_0x39e2a3,_0x16d3d9))[_0x78b0('0x41')](handleError(_0x39e2a3,null));};exports[_0x78b0('0x42')]=function(_0x2580fa,_0x494d52){var _0x50205d={'raw':!![],'where':{'id':_0x2580fa[_0x78b0('0x43')]['id']}},_0x5ac8e4={};_0x5ac8e4[_0x78b0('0x32')]=_['keys'](db[_0x78b0('0x29')]['rawAttributes']);_0x5ac8e4[_0x78b0('0x2e')]=_[_0x78b0('0x2f')](_0x2580fa[_0x78b0('0x2e')]);_0x5ac8e4[_0x78b0('0x30')]=_[_0x78b0('0x31')](_0x5ac8e4[_0x78b0('0x32')],_0x5ac8e4[_0x78b0('0x2e')]);_0x50205d['attributes']=_[_0x78b0('0x31')](_0x5ac8e4[_0x78b0('0x32')],qs[_0x78b0('0x34')](_0x2580fa[_0x78b0('0x2e')][_0x78b0('0x34')]));_0x50205d['attributes']=_0x50205d['attributes'][_0x78b0('0x35')]?_0x50205d[_0x78b0('0x33')]:_0x5ac8e4[_0x78b0('0x32')];if(_0x2580fa[_0x78b0('0x2e')][_0x78b0('0x44')]){_0x50205d['include']=[{'all':!![]}];}_0x50205d=_['merge']({},_0x50205d,_0x2580fa[_0x78b0('0x3e')]);return db['JscriptySessionReport']['find'](_0x50205d)[_0x78b0('0x23')](handleEntityNotFound(_0x494d52,null))[_0x78b0('0x23')](respondWithResult(_0x494d52,null))[_0x78b0('0x41')](handleError(_0x494d52,null));};exports[_0x78b0('0x45')]=function(_0x37e3a7,_0x3f1dea){return db[_0x78b0('0x29')][_0x78b0('0x45')](_0x37e3a7[_0x78b0('0x46')],{})[_0x78b0('0x23')](respondWithResult(_0x3f1dea,0xc9))[_0x78b0('0x41')](handleError(_0x3f1dea,null));};exports[_0x78b0('0x47')]=function(_0x51d052,_0x5185c0){if(_0x51d052[_0x78b0('0x46')]['id']){delete _0x51d052[_0x78b0('0x46')]['id'];}return db[_0x78b0('0x29')][_0x78b0('0x48')]({'where':{'id':_0x51d052['params']['id']}})[_0x78b0('0x23')](handleEntityNotFound(_0x5185c0,null))['then'](saveUpdates(_0x51d052[_0x78b0('0x46')],null))[_0x78b0('0x23')](respondWithResult(_0x5185c0,null))[_0x78b0('0x41')](handleError(_0x5185c0,null));};exports[_0x78b0('0x49')]=function(_0x275dcf,_0xc5d981){return db['JscriptySessionReport'][_0x78b0('0x48')]({'where':{'id':_0x275dcf['params']['id']}})['then'](handleEntityNotFound(_0xc5d981,null))[_0x78b0('0x23')](removeEntity(_0xc5d981,null))[_0x78b0('0x41')](handleError(_0xc5d981,null));};exports[_0x78b0('0x4a')]=function(_0x22dd29,_0x552efb){return db[_0x78b0('0x29')]['describe']()[_0x78b0('0x23')](respondWithResult(_0x552efb,null))[_0x78b0('0x41')](handleError(_0x552efb,null));};exports[_0x78b0('0x4b')]=function(_0x2b2275,_0x3717bf,_0x494c7d){var _0x3302d5={'raw':!![],'where':{}};var _0x4063d0={};var _0x4af026={'count':0x0,'rows':[]};return db[_0x78b0('0x29')][_0x78b0('0x4c')]({'where':{'id':_0x2b2275[_0x78b0('0x43')]['id']}})[_0x78b0('0x23')](handleEntityNotFound(_0x3717bf,null))[_0x78b0('0x23')](function(_0x522588){if(_0x522588){_0x4063d0[_0x78b0('0x32')]=_['keys'](db[_0x78b0('0x4d')]['rawAttributes']);_0x4063d0['query']=_[_0x78b0('0x2f')](_0x2b2275[_0x78b0('0x2e')]);_0x4063d0[_0x78b0('0x30')]=_['intersection'](_0x4063d0['model'],_0x4063d0[_0x78b0('0x2e')]);_0x3302d5[_0x78b0('0x33')]=_['intersection'](_0x4063d0['model'],qs[_0x78b0('0x34')](_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x34')]));_0x3302d5[_0x78b0('0x33')]=_0x3302d5[_0x78b0('0x33')][_0x78b0('0x35')]?_0x3302d5[_0x78b0('0x33')]:_0x4063d0[_0x78b0('0x32')];if(!_0x2b2275[_0x78b0('0x2e')]['hasOwnProperty'](_0x78b0('0x37'))){_0x3302d5[_0x78b0('0x1f')]=qs[_0x78b0('0x1f')](_0x2b2275[_0x78b0('0x2e')]['limit']);_0x3302d5['offset']=qs['offset'](_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x1d')]);}_0x3302d5['order']=qs[_0x78b0('0x39')](_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x39')]);_0x3302d5[_0x78b0('0x3a')]=qs[_0x78b0('0x30')](_['pick'](_0x2b2275[_0x78b0('0x2e')],_0x4063d0[_0x78b0('0x30')]));_0x3302d5[_0x78b0('0x3a')][_0x78b0('0x4e')]=_0x522588['id'];if(_0x2b2275[_0x78b0('0x2e')]['filter']){_0x3302d5[_0x78b0('0x3a')]=_['merge'](_0x3302d5[_0x78b0('0x3a')],{'$or':_['map'](_0x3302d5[_0x78b0('0x33')],function(_0x3bb197){var _0x14d1f6={};_0x14d1f6[_0x3bb197]={'$like':'%'+_0x2b2275[_0x78b0('0x2e')]['filter']+'%'};return _0x14d1f6;})});}_0x3302d5=_[_0x78b0('0x3d')]({},_0x3302d5,_0x2b2275['options']);return db[_0x78b0('0x4d')]['count']({'where':_0x3302d5[_0x78b0('0x3a')]})[_0x78b0('0x23')](function(_0x544170){_0x4af026['count']=_0x544170;if(_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x44')]){_0x3302d5[_0x78b0('0x3f')]=[{'all':!![]}];}return db[_0x78b0('0x4d')][_0x78b0('0x4f')](_0x3302d5);})[_0x78b0('0x23')](function(_0x530464){_0x4af026[_0x78b0('0x40')]=_0x530464;return _0x4af026;});}})[_0x78b0('0x23')](respondWithFilteredResult(_0x3717bf,_0x3302d5))[_0x78b0('0x41')](handleError(_0x3717bf,null));}; \ No newline at end of file +var _0x6f20=['JscriptyQuestionReport','SessionId','includeAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','show','find','create','body','params','describe','getQuestions','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f20,0xe5));var _0x06f2=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x6f20[_0x39bfb6];return _0x23fef9;};'use strict';var emlformat=require(_0x06f2('0x0'));var rimraf=require(_0x06f2('0x1'));var zipdir=require(_0x06f2('0x2'));var jsonpatch=require(_0x06f2('0x3'));var rp=require(_0x06f2('0x4'));var moment=require(_0x06f2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x06f2('0x6'));var util=require('util');var path=require(_0x06f2('0x7'));var sox=require('sox');var csv=require(_0x06f2('0x8'));var ejs=require(_0x06f2('0x9'));var fs=require('fs');var fs_extra=require(_0x06f2('0xa'));var _=require(_0x06f2('0xb'));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(_0x06f2('0xc'));var Redis=require(_0x06f2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x06f2('0xe'));var as=require(_0x06f2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x06f2('0x10'));var db=require(_0x06f2('0x11'))['db'];function respondWithStatusCode(_0x169ea5,_0x2171b){_0x2171b=_0x2171b||0xcc;return function(_0x2de956){if(_0x2de956){return _0x169ea5[_0x06f2('0x12')](_0x2171b);}return _0x169ea5[_0x06f2('0x13')](_0x2171b)['end']();};}function respondWithResult(_0x153484,_0x5b9372){_0x5b9372=_0x5b9372||0xc8;return function(_0x5e0a93){if(_0x5e0a93){return _0x153484[_0x06f2('0x13')](_0x5b9372)[_0x06f2('0x14')](_0x5e0a93);}};}function respondWithFilteredResult(_0xc47c45,_0x5c9eb6){return function(_0x209375){if(_0x209375){var _0x36f717=typeof _0x5c9eb6['offset']===_0x06f2('0x15')&&typeof _0x5c9eb6[_0x06f2('0x16')]==='undefined';var _0x12549a=_0x209375['count'];var _0x36540e=_0x36f717?0x0:_0x5c9eb6[_0x06f2('0x17')];var _0x2d3ce6=_0x36f717?_0x209375[_0x06f2('0x18')]:_0x5c9eb6[_0x06f2('0x17')]+_0x5c9eb6[_0x06f2('0x16')];var _0x199bd7;if(_0x2d3ce6>=_0x12549a){_0x2d3ce6=_0x12549a;_0x199bd7=0xc8;}else{_0x199bd7=0xce;}_0xc47c45['status'](_0x199bd7);return _0xc47c45['set'](_0x06f2('0x19'),_0x36540e+'-'+_0x2d3ce6+'/'+_0x12549a)['json'](_0x209375);}return null;};}function patchUpdates(_0x487255){return function(_0x532d74){try{jsonpatch[_0x06f2('0x1a')](_0x532d74,_0x487255,!![]);}catch(_0x4f633f){return BPromise[_0x06f2('0x1b')](_0x4f633f);}return _0x532d74[_0x06f2('0x1c')]();};}function saveUpdates(_0x40b798,_0x1c497e){return function(_0x48fda1){if(_0x48fda1){return _0x48fda1[_0x06f2('0x1d')](_0x40b798)[_0x06f2('0x1e')](function(_0x335de4){return _0x335de4;});}return null;};}function removeEntity(_0x4e2b3b,_0x5bf88b){return function(_0x84bd2d){if(_0x84bd2d){return _0x84bd2d[_0x06f2('0x1f')]()[_0x06f2('0x1e')](function(){_0x4e2b3b[_0x06f2('0x13')](0xcc)[_0x06f2('0x20')]();});}};}function handleEntityNotFound(_0x11f8df,_0x11ad81){return function(_0x6afef4){if(!_0x6afef4){_0x11f8df[_0x06f2('0x12')](0x194);}return _0x6afef4;};}function handleError(_0x3ed26f,_0x1ca947){_0x1ca947=_0x1ca947||0x1f4;return function(_0x49575b){logger[_0x06f2('0x21')](_0x49575b[_0x06f2('0x22')]);if(_0x49575b['name']){delete _0x49575b['name'];}_0x3ed26f[_0x06f2('0x13')](_0x1ca947)['send'](_0x49575b);};}exports[_0x06f2('0x23')]=function(_0x5422ad,_0xe176e){var _0x2f121a={},_0x49a524={},_0x3017a6={'count':0x0,'rows':[]};var _0x28d8a8=_[_0x06f2('0x24')](db[_0x06f2('0x25')][_0x06f2('0x26')],function(_0x34a7ab){return{'name':_0x34a7ab[_0x06f2('0x27')],'type':_0x34a7ab['type'][_0x06f2('0x28')]};});_0x49a524[_0x06f2('0x29')]=_[_0x06f2('0x24')](_0x28d8a8,_0x06f2('0x2a'));_0x49a524[_0x06f2('0x2b')]=_[_0x06f2('0x2c')](_0x5422ad['query']);_0x49a524[_0x06f2('0x2d')]=_[_0x06f2('0x2e')](_0x49a524[_0x06f2('0x29')],_0x49a524[_0x06f2('0x2b')]);_0x2f121a[_0x06f2('0x2f')]=_[_0x06f2('0x2e')](_0x49a524[_0x06f2('0x29')],qs[_0x06f2('0x30')](_0x5422ad['query']['fields']));_0x2f121a[_0x06f2('0x2f')]=_0x2f121a[_0x06f2('0x2f')][_0x06f2('0x31')]?_0x2f121a[_0x06f2('0x2f')]:_0x49a524[_0x06f2('0x29')];if(!_0x5422ad[_0x06f2('0x2b')][_0x06f2('0x32')](_0x06f2('0x33'))){_0x2f121a[_0x06f2('0x16')]=qs['limit'](_0x5422ad['query'][_0x06f2('0x16')]);_0x2f121a[_0x06f2('0x17')]=qs['offset'](_0x5422ad[_0x06f2('0x2b')][_0x06f2('0x17')]);}_0x2f121a[_0x06f2('0x34')]=qs[_0x06f2('0x35')](_0x5422ad[_0x06f2('0x2b')][_0x06f2('0x35')]);_0x2f121a['where']=qs[_0x06f2('0x2d')](_[_0x06f2('0x36')](_0x5422ad[_0x06f2('0x2b')],_0x49a524['filters']),_0x28d8a8);if(_0x5422ad['query'][_0x06f2('0x37')]){_0x2f121a['where']=_[_0x06f2('0x38')](_0x2f121a[_0x06f2('0x39')],{'$or':_[_0x06f2('0x24')](_0x28d8a8,function(_0x496966){if(_0x496966['type']!==_0x06f2('0x3a')){var _0x2661e2={};_0x2661e2[_0x496966[_0x06f2('0x2a')]]={'$like':'%'+_0x5422ad[_0x06f2('0x2b')][_0x06f2('0x37')]+'%'};return _0x2661e2;}})});}_0x2f121a=_[_0x06f2('0x38')]({},_0x2f121a,_0x5422ad[_0x06f2('0x3b')]);var _0x35bb61={'where':_0x2f121a[_0x06f2('0x39')]};return db[_0x06f2('0x25')]['count'](_0x35bb61)[_0x06f2('0x1e')](function(_0x6da5a9){_0x3017a6[_0x06f2('0x18')]=_0x6da5a9;if(_0x5422ad[_0x06f2('0x2b')]['includeAll']){_0x2f121a[_0x06f2('0x3c')]=[{'all':!![]}];}return db[_0x06f2('0x25')][_0x06f2('0x3d')](_0x2f121a);})[_0x06f2('0x1e')](function(_0x143dd4){_0x3017a6['rows']=_0x143dd4;return _0x3017a6;})[_0x06f2('0x1e')](respondWithFilteredResult(_0xe176e,_0x2f121a))[_0x06f2('0x3e')](handleError(_0xe176e,null));};exports[_0x06f2('0x3f')]=function(_0x3e81c1,_0x531dd7){var _0x36b134={'raw':!![],'where':{'id':_0x3e81c1['params']['id']}},_0x374690={};_0x374690['model']=_[_0x06f2('0x2c')](db[_0x06f2('0x25')][_0x06f2('0x26')]);_0x374690['query']=_['keys'](_0x3e81c1[_0x06f2('0x2b')]);_0x374690['filters']=_['intersection'](_0x374690[_0x06f2('0x29')],_0x374690[_0x06f2('0x2b')]);_0x36b134[_0x06f2('0x2f')]=_[_0x06f2('0x2e')](_0x374690['model'],qs['fields'](_0x3e81c1[_0x06f2('0x2b')][_0x06f2('0x30')]));_0x36b134[_0x06f2('0x2f')]=_0x36b134[_0x06f2('0x2f')]['length']?_0x36b134[_0x06f2('0x2f')]:_0x374690[_0x06f2('0x29')];if(_0x3e81c1[_0x06f2('0x2b')]['includeAll']){_0x36b134['include']=[{'all':!![]}];}_0x36b134=_[_0x06f2('0x38')]({},_0x36b134,_0x3e81c1['options']);return db[_0x06f2('0x25')][_0x06f2('0x40')](_0x36b134)['then'](handleEntityNotFound(_0x531dd7,null))[_0x06f2('0x1e')](respondWithResult(_0x531dd7,null))['catch'](handleError(_0x531dd7,null));};exports['create']=function(_0x57e9f1,_0x337033){return db[_0x06f2('0x25')][_0x06f2('0x41')](_0x57e9f1['body'],{})[_0x06f2('0x1e')](respondWithResult(_0x337033,0xc9))['catch'](handleError(_0x337033,null));};exports['update']=function(_0x24eef4,_0x368c0b){if(_0x24eef4[_0x06f2('0x42')]['id']){delete _0x24eef4[_0x06f2('0x42')]['id'];}return db[_0x06f2('0x25')][_0x06f2('0x40')]({'where':{'id':_0x24eef4[_0x06f2('0x43')]['id']}})[_0x06f2('0x1e')](handleEntityNotFound(_0x368c0b,null))[_0x06f2('0x1e')](saveUpdates(_0x24eef4[_0x06f2('0x42')],null))[_0x06f2('0x1e')](respondWithResult(_0x368c0b,null))[_0x06f2('0x3e')](handleError(_0x368c0b,null));};exports[_0x06f2('0x1f')]=function(_0x5c3de7,_0x45fdef){return db['JscriptySessionReport'][_0x06f2('0x40')]({'where':{'id':_0x5c3de7[_0x06f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x45fdef,null))[_0x06f2('0x1e')](removeEntity(_0x45fdef,null))[_0x06f2('0x3e')](handleError(_0x45fdef,null));};exports[_0x06f2('0x44')]=function(_0x21ef24,_0x4987c0){return db[_0x06f2('0x25')]['describe']()[_0x06f2('0x1e')](respondWithResult(_0x4987c0,null))[_0x06f2('0x3e')](handleError(_0x4987c0,null));};exports[_0x06f2('0x45')]=function(_0x952282,_0x2273a7,_0x32c636){var _0x144cb1={'raw':!![],'where':{}};var _0x4ba564={};var _0x43c50e={'count':0x0,'rows':[]};return db[_0x06f2('0x25')][_0x06f2('0x46')]({'where':{'id':_0x952282[_0x06f2('0x43')]['id']}})[_0x06f2('0x1e')](handleEntityNotFound(_0x2273a7,null))[_0x06f2('0x1e')](function(_0x4ed560){if(_0x4ed560){_0x4ba564[_0x06f2('0x29')]=_[_0x06f2('0x2c')](db[_0x06f2('0x47')][_0x06f2('0x26')]);_0x4ba564['query']=_[_0x06f2('0x2c')](_0x952282[_0x06f2('0x2b')]);_0x4ba564[_0x06f2('0x2d')]=_['intersection'](_0x4ba564['model'],_0x4ba564[_0x06f2('0x2b')]);_0x144cb1[_0x06f2('0x2f')]=_[_0x06f2('0x2e')](_0x4ba564[_0x06f2('0x29')],qs[_0x06f2('0x30')](_0x952282[_0x06f2('0x2b')][_0x06f2('0x30')]));_0x144cb1[_0x06f2('0x2f')]=_0x144cb1[_0x06f2('0x2f')]['length']?_0x144cb1[_0x06f2('0x2f')]:_0x4ba564[_0x06f2('0x29')];if(!_0x952282[_0x06f2('0x2b')][_0x06f2('0x32')]('nolimit')){_0x144cb1['limit']=qs[_0x06f2('0x16')](_0x952282[_0x06f2('0x2b')][_0x06f2('0x16')]);_0x144cb1[_0x06f2('0x17')]=qs[_0x06f2('0x17')](_0x952282['query'][_0x06f2('0x17')]);}_0x144cb1[_0x06f2('0x34')]=qs[_0x06f2('0x35')](_0x952282[_0x06f2('0x2b')][_0x06f2('0x35')]);_0x144cb1[_0x06f2('0x39')]=qs[_0x06f2('0x2d')](_['pick'](_0x952282[_0x06f2('0x2b')],_0x4ba564[_0x06f2('0x2d')]));_0x144cb1['where'][_0x06f2('0x48')]=_0x4ed560['id'];if(_0x952282['query'][_0x06f2('0x37')]){_0x144cb1['where']=_[_0x06f2('0x38')](_0x144cb1[_0x06f2('0x39')],{'$or':_[_0x06f2('0x24')](_0x144cb1['attributes'],function(_0x374d4f){var _0x4812af={};_0x4812af[_0x374d4f]={'$like':'%'+_0x952282[_0x06f2('0x2b')][_0x06f2('0x37')]+'%'};return _0x4812af;})});}_0x144cb1=_[_0x06f2('0x38')]({},_0x144cb1,_0x952282['options']);return db[_0x06f2('0x47')][_0x06f2('0x18')]({'where':_0x144cb1[_0x06f2('0x39')]})[_0x06f2('0x1e')](function(_0x20b464){_0x43c50e[_0x06f2('0x18')]=_0x20b464;if(_0x952282['query'][_0x06f2('0x49')]){_0x144cb1[_0x06f2('0x3c')]=[{'all':!![]}];}return db[_0x06f2('0x47')][_0x06f2('0x3d')](_0x144cb1);})[_0x06f2('0x1e')](function(_0x28089d){_0x43c50e[_0x06f2('0x4a')]=_0x28089d;return _0x43c50e;});}})[_0x06f2('0x1e')](respondWithFilteredResult(_0x2273a7,_0x144cb1))[_0x06f2('0x3e')](handleError(_0x2273a7,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 0d5e312..6f60948 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 _0xafb9=['request-promise','path','rimraf','exports','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x340741,_0x20d974){var _0x45902e=function(_0x13be6f){while(--_0x13be6f){_0x340741['push'](_0x340741['shift']());}};_0x45902e(++_0x20d974);}(_0xafb9,0x68));var _0x9afb=function(_0x18d997,_0x2d08ed){_0x18d997=_0x18d997-0x0;var _0x43ac1c=_0xafb9[_0x18d997];return _0x43ac1c;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('JscriptySessionReport',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x182891,_0x4716b0){var _0x166fb5=function(_0x477230){while(--_0x477230){_0x182891['push'](_0x182891['shift']());}};_0x166fb5(++_0x4716b0);}(_0x7a54,0x106));var _0x47a5=function(_0x549359,_0x14cff4){_0x549359=_0x549359-0x0;var _0x2795de=_0x7a54[_0x549359];return _0x2795de;};'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/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 7ac5016..7b0a89d 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x29a8d8,_0x5961a8){var _0x387e9d=function(_0xc339c2){while(--_0xc339c2){_0x29a8d8['push'](_0x29a8d8['shift']());}};_0x387e9d(++_0x5961a8);}(_0x187d,0x93));var _0xd187=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x187d[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch'];(function(_0x46dd21,_0xdf19e0){var _0x174e61=function(_0x597a66){while(--_0x597a66){_0x46dd21['push'](_0x46dd21['shift']());}};_0x174e61(++_0xdf19e0);}(_0xb44a,0x1c2));var _0xab44=function(_0xe9c8e4,_0x3aa2f6){_0xe9c8e4=_0xe9c8e4-0x0;var _0x2037fa=_0xb44a[_0xe9c8e4];return _0x2037fa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 3fdd6e7..8c3666a 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 _0xd3a1=['../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','downloadLogFile','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x989dd,_0x5ccf13){var _0x2b9ad1=function(_0x343e9f){while(--_0x343e9f){_0x989dd['push'](_0x989dd['shift']());}};_0x2b9ad1(++_0x5ccf13);}(_0xd3a1,0xe5));var _0x1d3a=function(_0x54c15d,_0x52ffeb){_0x54c15d=_0x54c15d-0x0;var _0x2f769b=_0xd3a1[_0x54c15d];return _0x2f769b;};'use strict';var multer=require(_0x1d3a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3a('0x1'));var router=express['Router']();var fs_extra=require(_0x1d3a('0x2'));var auth=require(_0x1d3a('0x3'));var interaction=require(_0x1d3a('0x4'));var config=require(_0x1d3a('0x5'));var controller=require(_0x1d3a('0x6'));router[_0x1d3a('0x7')]('/',controller['index']);router[_0x1d3a('0x8')](_0x1d3a('0x9'),auth[_0x1d3a('0xa')](),controller[_0x1d3a('0xb')]);router[_0x1d3a('0x7')]('/download_log_file',auth[_0x1d3a('0xa')](),controller[_0x1d3a('0xc')]);module['exports']=router; \ No newline at end of file +var _0x965f=['connect-timeout','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update','downloadLogFile','exports','multer'];(function(_0x3107a7,_0x15ffde){var _0x33862c=function(_0x147a2a){while(--_0x147a2a){_0x3107a7['push'](_0x3107a7['shift']());}};_0x33862c(++_0x15ffde);}(_0x965f,0xfb));var _0xf965=function(_0x1e0c7f,_0x267acc){_0x1e0c7f=_0x1e0c7f-0x0;var _0x329c63=_0x965f[_0x1e0c7f];return _0x329c63;};'use strict';var multer=require(_0xf965('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf965('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf965('0x2'));var config=require(_0xf965('0x3'));var controller=require(_0xf965('0x4'));router[_0xf965('0x5')]('/',controller[_0xf965('0x6')]);router['put'](_0xf965('0x7'),auth[_0xf965('0x8')](),controller[_0xf965('0x9')]);router['get']('/download_log_file',auth['isAuthenticated'](),controller[_0xf965('0xa')]);module[_0xf965('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index cb620fd..c84c043 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 _0xdc4d=['TEXT','STRING','INTEGER','exports'];(function(_0x374870,_0x82a474){var _0x4de8f4=function(_0xc42b7){while(--_0xc42b7){_0x374870['push'](_0x374870['shift']());}};_0x4de8f4(++_0x82a474);}(_0xdc4d,0x1bb));var _0xddc4=function(_0x373196,_0x4dba14){_0x373196=_0x373196-0x0;var _0x3bac92=_0xdc4d[_0x373196];return _0x3bac92;};'use strict';var Sequelize=require('sequelize');module[_0xddc4('0x0')]={'license':{'type':Sequelize[_0xddc4('0x1')]},'data1':{'type':Sequelize[_0xddc4('0x2')]},'data2':{'type':Sequelize[_0xddc4('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xddc4('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3c8e=['INTEGER','sequelize','exports','TEXT'];(function(_0x26b38d,_0x323840){var _0x4e2c0b=function(_0x3ec915){while(--_0x3ec915){_0x26b38d['push'](_0x26b38d['shift']());}};_0x4e2c0b(++_0x323840);}(_0x3c8e,0x141));var _0xe3c8=function(_0x28ce12,_0x5dbc74){_0x28ce12=_0x28ce12-0x0;var _0x1a0479=_0x3c8e[_0x28ce12];return _0x1a0479;};'use strict';var Sequelize=require(_0xe3c8('0x0'));module[_0xe3c8('0x1')]={'license':{'type':Sequelize[_0xe3c8('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xe3c8('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index ea1bd4c..70071ef 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 _0x9955=['reject','save','update','then','error','name','send','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','body','find','params','get','key','demo','catch','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply'];(function(_0x8aa45a,_0x1f2084){var _0x4fba94=function(_0x29861c){while(--_0x29861c){_0x8aa45a['push'](_0x8aa45a['shift']());}};_0x4fba94(++_0x1f2084);}(_0x9955,0xb3));var _0x5995=function(_0x518c07,_0xca9514){_0x518c07=_0x518c07-0x0;var _0xd232a6=_0x9955[_0x518c07];return _0xd232a6;};'use strict';var emlformat=require(_0x5995('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5995('0x1'));var jsonpatch=require(_0x5995('0x2'));var rp=require(_0x5995('0x3'));var moment=require(_0x5995('0x4'));var BPromise=require(_0x5995('0x5'));var Mustache=require(_0x5995('0x6'));var util=require(_0x5995('0x7'));var path=require(_0x5995('0x8'));var sox=require(_0x5995('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5995('0xa'));var _=require(_0x5995('0xb'));var squel=require(_0x5995('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5995('0xd'));var toCsv=require(_0x5995('0xe'));var querystring=require(_0x5995('0xf'));var Papa=require(_0x5995('0x10'));var Redis=require('ioredis');var authService=require(_0x5995('0x11'));var qs=require(_0x5995('0x12'));var as=require(_0x5995('0x13'));var hardwareService=require(_0x5995('0x14'));var logger=require('../../config/logger')(_0x5995('0x15'));var utils=require(_0x5995('0x16'));var config=require(_0x5995('0x17'));var licenseUtil=require(_0x5995('0x18'));var db=require(_0x5995('0x19'))['db'];function respondWithStatusCode(_0x2fc968,_0x5be7c7){_0x5be7c7=_0x5be7c7||0xcc;return function(_0x229c25){if(_0x229c25){return _0x2fc968[_0x5995('0x1a')](_0x5be7c7);}return _0x2fc968[_0x5995('0x1b')](_0x5be7c7)[_0x5995('0x1c')]();};}function respondWithResult(_0x533c24,_0x1af6cf){_0x1af6cf=_0x1af6cf||0xc8;return function(_0x1ce6c9){if(_0x1ce6c9){return _0x533c24[_0x5995('0x1b')](_0x1af6cf)[_0x5995('0x1d')](_0x1ce6c9);}};}function respondWithFilteredResult(_0x482fe7,_0x4ea965){return function(_0x5be87d){if(_0x5be87d){var _0x4befe9=typeof _0x4ea965[_0x5995('0x1e')]==='undefined'&&typeof _0x4ea965['limit']===_0x5995('0x1f');var _0x5dd93a=_0x5be87d[_0x5995('0x20')];var _0x36aab3=_0x4befe9?0x0:_0x4ea965[_0x5995('0x1e')];var _0x53c0e0=_0x4befe9?_0x5be87d[_0x5995('0x20')]:_0x4ea965[_0x5995('0x1e')]+_0x4ea965['limit'];var _0x4b0382;if(_0x53c0e0>=_0x5dd93a){_0x53c0e0=_0x5dd93a;_0x4b0382=0xc8;}else{_0x4b0382=0xce;}_0x482fe7[_0x5995('0x1b')](_0x4b0382);return _0x482fe7['set']('Content-Range',_0x36aab3+'-'+_0x53c0e0+'/'+_0x5dd93a)[_0x5995('0x1d')](_0x5be87d);}return null;};}function patchUpdates(_0x840e39){return function(_0x4f4abc){try{jsonpatch[_0x5995('0x21')](_0x4f4abc,_0x840e39,!![]);}catch(_0x35ca4b){return BPromise[_0x5995('0x22')](_0x35ca4b);}return _0x4f4abc[_0x5995('0x23')]();};}function saveUpdates(_0x1b7048,_0x1335ee){return function(_0x4edc7d){if(_0x4edc7d){return _0x4edc7d[_0x5995('0x24')](_0x1b7048)[_0x5995('0x25')](function(_0x3f5dc8){return _0x3f5dc8;});}return null;};}function removeEntity(_0xcc7cd7,_0x448c0d){return function(_0x3c8a6f){if(_0x3c8a6f){return _0x3c8a6f['destroy']()[_0x5995('0x25')](function(){_0xcc7cd7['status'](0xcc)[_0x5995('0x1c')]();});}};}function handleEntityNotFound(_0x249175,_0x3763b1){return function(_0x509831){if(!_0x509831){_0x249175[_0x5995('0x1a')](0x194);}return _0x509831;};}function handleError(_0x270dd4,_0x491bda){_0x491bda=_0x491bda||0x1f4;return function(_0x204dff){logger[_0x5995('0x26')](_0x204dff['stack']);if(_0x204dff[_0x5995('0x27')]){delete _0x204dff[_0x5995('0x27')];}_0x270dd4[_0x5995('0x1b')](_0x491bda)[_0x5995('0x28')](_0x204dff);};}var utilLicense=require(_0x5995('0x18'));exports['index']=function(_0x10c19b,_0x6a9630){var _0x2f9c14={'raw':!![],'where':{'id':0x1}},_0x14523d={};_0x14523d[_0x5995('0x29')]=_[_0x5995('0x2a')](db[_0x5995('0x2b')][_0x5995('0x2c')]);_0x14523d[_0x5995('0x2d')]=_[_0x5995('0x2a')](_0x10c19b[_0x5995('0x2d')]);_0x14523d[_0x5995('0x2e')]=_[_0x5995('0x2f')](_0x14523d[_0x5995('0x29')],_0x14523d[_0x5995('0x2d')]);_0x2f9c14[_0x5995('0x30')]=_['intersection'](_0x14523d[_0x5995('0x29')],qs[_0x5995('0x31')](_0x10c19b[_0x5995('0x2d')][_0x5995('0x31')]));_0x2f9c14[_0x5995('0x30')]=_0x2f9c14['attributes'][_0x5995('0x32')]?_0x2f9c14[_0x5995('0x30')]:_0x14523d[_0x5995('0x29')];_0x2f9c14=_[_0x5995('0x33')]({},_0x2f9c14,_0x10c19b[_0x5995('0x34')]);return utilLicense[_0x5995('0x35')](_0x2f9c14)['then'](respondWithResult(_0x6a9630,null))['catch'](handleError(_0x6a9630,null));};exports[_0x5995('0x24')]=function(_0x291fc9,_0x53b70a){if(_0x291fc9[_0x5995('0x36')]['id']){delete _0x291fc9[_0x5995('0x36')]['id'];}return db[_0x5995('0x2b')][_0x5995('0x37')]({'where':{'id':_0x291fc9[_0x5995('0x38')]['id']}})[_0x5995('0x25')](handleEntityNotFound(_0x53b70a,null))[_0x5995('0x25')](function(_0x2f8584){var _0x3e80fe=_0x2f8584[_0x5995('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x3e80fe,_0x291fc9[_0x5995('0x36')][_0x5995('0x3a')]);})[_0x5995('0x25')](function(_0x48f1cb){if(!_0x48f1cb[_0x5995('0x3b')]){return saveUpdates(_0x291fc9[_0x5995('0x36')],null);}return _0x48f1cb;})[_0x5995('0x25')](respondWithResult(_0x53b70a,null))[_0x5995('0x3c')](handleError(_0x53b70a,null));};exports['downloadLogFile']=function(_0x4665a0,_0x418d2e){var _0x1837cb=_0x5995('0x3d');var _0x28b287=path[_0x5995('0x3e')](_0x5995('0x3f'),_0x5995('0x40'),_0x5995('0x41'),_0x1837cb);_0x418d2e[_0x5995('0x42')](_0x5995('0x43'),_0x5995('0x44')+_0x1837cb);_0x418d2e['set']('Content-Type',_0x5995('0x45'));_0x418d2e[_0x5995('0x46')](_0x28b287);}; \ No newline at end of file +var _0x96e6=['checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','xcally','setHeader','Content-disposition','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','getLicense','catch','body','find','params','get'];(function(_0x4a3553,_0x12e68f){var _0x569d42=function(_0x28860d){while(--_0x28860d){_0x4a3553['push'](_0x4a3553['shift']());}};_0x569d42(++_0x12e68f);}(_0x96e6,0x178));var _0x696e=function(_0x3c97b9,_0x39c5b3){_0x3c97b9=_0x3c97b9-0x0;var _0x377e20=_0x96e6[_0x3c97b9];return _0x377e20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x696e('0x0'));var zipdir=require(_0x696e('0x1'));var jsonpatch=require(_0x696e('0x2'));var rp=require(_0x696e('0x3'));var moment=require(_0x696e('0x4'));var BPromise=require(_0x696e('0x5'));var Mustache=require(_0x696e('0x6'));var util=require('util');var path=require(_0x696e('0x7'));var sox=require(_0x696e('0x8'));var csv=require('to-csv');var ejs=require(_0x696e('0x9'));var fs=require('fs');var fs_extra=require(_0x696e('0xa'));var _=require(_0x696e('0xb'));var squel=require(_0x696e('0xc'));var crypto=require(_0x696e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x696e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x696e('0xf'));var Papa=require(_0x696e('0x10'));var Redis=require(_0x696e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x696e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x696e('0x13'));var logger=require(_0x696e('0x14'))(_0x696e('0x15'));var utils=require('../../config/utils');var config=require(_0x696e('0x16'));var licenseUtil=require(_0x696e('0x17'));var db=require(_0x696e('0x18'))['db'];function respondWithStatusCode(_0xc94c72,_0x592f33){_0x592f33=_0x592f33||0xcc;return function(_0x4ee8de){if(_0x4ee8de){return _0xc94c72['sendStatus'](_0x592f33);}return _0xc94c72['status'](_0x592f33)[_0x696e('0x19')]();};}function respondWithResult(_0x482354,_0x261d37){_0x261d37=_0x261d37||0xc8;return function(_0x2c0179){if(_0x2c0179){return _0x482354[_0x696e('0x1a')](_0x261d37)['json'](_0x2c0179);}};}function respondWithFilteredResult(_0x345f9f,_0x1ad4ec){return function(_0x227e9d){if(_0x227e9d){var _0x50d25e=typeof _0x1ad4ec['offset']===_0x696e('0x1b')&&typeof _0x1ad4ec[_0x696e('0x1c')]===_0x696e('0x1b');var _0x55763b=_0x227e9d[_0x696e('0x1d')];var _0x379b39=_0x50d25e?0x0:_0x1ad4ec[_0x696e('0x1e')];var _0x5793c2=_0x50d25e?_0x227e9d['count']:_0x1ad4ec[_0x696e('0x1e')]+_0x1ad4ec[_0x696e('0x1c')];var _0x334a9c;if(_0x5793c2>=_0x55763b){_0x5793c2=_0x55763b;_0x334a9c=0xc8;}else{_0x334a9c=0xce;}_0x345f9f['status'](_0x334a9c);return _0x345f9f[_0x696e('0x1f')](_0x696e('0x20'),_0x379b39+'-'+_0x5793c2+'/'+_0x55763b)[_0x696e('0x21')](_0x227e9d);}return null;};}function patchUpdates(_0x28c5d4){return function(_0x1e6975){try{jsonpatch[_0x696e('0x22')](_0x1e6975,_0x28c5d4,!![]);}catch(_0x1bae36){return BPromise[_0x696e('0x23')](_0x1bae36);}return _0x1e6975[_0x696e('0x24')]();};}function saveUpdates(_0x5bed4c,_0x4f91cd){return function(_0x267edf){if(_0x267edf){return _0x267edf[_0x696e('0x25')](_0x5bed4c)[_0x696e('0x26')](function(_0x3cf787){return _0x3cf787;});}return null;};}function removeEntity(_0x507199,_0x458162){return function(_0xb98d09){if(_0xb98d09){return _0xb98d09[_0x696e('0x27')]()[_0x696e('0x26')](function(){_0x507199['status'](0xcc)[_0x696e('0x19')]();});}};}function handleEntityNotFound(_0x214d46,_0x217b22){return function(_0x567fc8){if(!_0x567fc8){_0x214d46[_0x696e('0x28')](0x194);}return _0x567fc8;};}function handleError(_0x14e802,_0x9b74c9){_0x9b74c9=_0x9b74c9||0x1f4;return function(_0xe75a68){logger[_0x696e('0x29')](_0xe75a68[_0x696e('0x2a')]);if(_0xe75a68[_0x696e('0x2b')]){delete _0xe75a68[_0x696e('0x2b')];}_0x14e802[_0x696e('0x1a')](_0x9b74c9)[_0x696e('0x2c')](_0xe75a68);};}var utilLicense=require(_0x696e('0x17'));exports[_0x696e('0x2d')]=function(_0x4dd7b6,_0x34f639){var _0x1d142a={'raw':!![],'where':{'id':0x1}},_0x3d006b={};_0x3d006b[_0x696e('0x2e')]=_[_0x696e('0x2f')](db[_0x696e('0x30')][_0x696e('0x31')]);_0x3d006b[_0x696e('0x32')]=_[_0x696e('0x2f')](_0x4dd7b6['query']);_0x3d006b['filters']=_[_0x696e('0x33')](_0x3d006b[_0x696e('0x2e')],_0x3d006b['query']);_0x1d142a[_0x696e('0x34')]=_[_0x696e('0x33')](_0x3d006b[_0x696e('0x2e')],qs[_0x696e('0x35')](_0x4dd7b6[_0x696e('0x32')]['fields']));_0x1d142a[_0x696e('0x34')]=_0x1d142a[_0x696e('0x34')][_0x696e('0x36')]?_0x1d142a[_0x696e('0x34')]:_0x3d006b[_0x696e('0x2e')];_0x1d142a=_[_0x696e('0x37')]({},_0x1d142a,_0x4dd7b6['options']);return utilLicense[_0x696e('0x38')](_0x1d142a)['then'](respondWithResult(_0x34f639,null))[_0x696e('0x39')](handleError(_0x34f639,null));};exports[_0x696e('0x25')]=function(_0xfd6b0,_0x20c0f9){if(_0xfd6b0[_0x696e('0x3a')]['id']){delete _0xfd6b0['body']['id'];}return db[_0x696e('0x30')][_0x696e('0x3b')]({'where':{'id':_0xfd6b0[_0x696e('0x3c')]['id']}})[_0x696e('0x26')](handleEntityNotFound(_0x20c0f9,null))[_0x696e('0x26')](function(_0xae85fc){var _0x553b83=_0xae85fc[_0x696e('0x3d')]({'plain':!![]});return utilLicense[_0x696e('0x3e')](_0x553b83,_0xfd6b0['body'][_0x696e('0x3f')]);})[_0x696e('0x26')](function(_0x279453){if(!_0x279453[_0x696e('0x40')]){return saveUpdates(_0xfd6b0['body'],null);}return _0x279453;})['then'](respondWithResult(_0x20c0f9,null))[_0x696e('0x39')](handleError(_0x20c0f9,null));};exports[_0x696e('0x41')]=function(_0x4e7a72,_0x3868c7){var _0x469737=_0x696e('0x42');var _0x3798c2=path[_0x696e('0x43')](_0x696e('0x44'),'log',_0x696e('0x45'),_0x469737);_0x3868c7[_0x696e('0x46')](_0x696e('0x47'),'attachment;\x20filename='+_0x469737);_0x3868c7['set']('Content-Type','text/plain');_0x3868c7[_0x696e('0x48')](_0x3798c2);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 7131495..2b332ed 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 _0x9612=['bluebird','request-promise','../../config/environment','exports','define','License','license','lodash','util','../../config/logger','api','moment'];(function(_0x245a7d,_0x253c2f){var _0x24789d=function(_0x189e60){while(--_0x189e60){_0x245a7d['push'](_0x245a7d['shift']());}};_0x24789d(++_0x253c2f);}(_0x9612,0x67));var _0x2961=function(_0x457a98,_0x19003c){_0x457a98=_0x457a98-0x0;var _0x2a7a45=_0x9612[_0x457a98];return _0x2a7a45;};'use strict';var _=require(_0x2961('0x0'));var util=require(_0x2961('0x1'));var logger=require(_0x2961('0x2'))(_0x2961('0x3'));var moment=require(_0x2961('0x4'));var BPromise=require(_0x2961('0x5'));var rp=require(_0x2961('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2961('0x7'));var attributes=require('./license.attributes');module[_0x2961('0x8')]=function(_0x22cda7,_0x4c9e2b){return _0x22cda7[_0x2961('0x9')](_0x2961('0xa'),attributes,{'tableName':_0x2961('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fad=['../../config/environment','./license.attributes','exports','define','License','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x29ad71,_0x962dfe){var _0x20b641=function(_0x26992e){while(--_0x26992e){_0x29ad71['push'](_0x29ad71['shift']());}};_0x20b641(++_0x962dfe);}(_0x5fad,0x171));var _0xd5fa=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x5fad[_0x33bc64];return _0x3fdd34;};'use strict';var _=require('lodash');var util=require(_0xd5fa('0x0'));var logger=require(_0xd5fa('0x1'))(_0xd5fa('0x2'));var moment=require(_0xd5fa('0x3'));var BPromise=require(_0xd5fa('0x4'));var rp=require(_0xd5fa('0x5'));var fs=require('fs');var path=require(_0xd5fa('0x6'));var rimraf=require(_0xd5fa('0x7'));var config=require(_0xd5fa('0x8'));var attributes=require(_0xd5fa('0x9'));module[_0xd5fa('0xa')]=function(_0x271f68,_0x5d9512){return _0x271f68[_0xd5fa('0xb')](_0xd5fa('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 6b6fc6c..3d327a6 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 _0xcf40=['result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xcf40,0x17d));var _0x0cf4=function(_0x4b5b94,_0x3a5ad5){_0x4b5b94=_0x4b5b94-0x0;var _0x50a599=_0xcf40[_0x4b5b94];return _0x50a599;};'use strict';var _=require('lodash');var util=require(_0x0cf4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0cf4('0x1'));var fs=require('fs');var Redis=require(_0x0cf4('0x2'));var db=require(_0x0cf4('0x3'))['db'];var utils=require(_0x0cf4('0x4'));var logger=require(_0x0cf4('0x5'))('rpc');var config=require(_0x0cf4('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0cf4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa61d48,_0x52762e,_0x528f21){return new BPromise(function(_0xf81095,_0x1c7974){return client[_0x0cf4('0x8')](_0xa61d48,_0x528f21)[_0x0cf4('0x9')](function(_0x3c05b2){logger['info'](_0x0cf4('0xa'),_0x52762e,_0x0cf4('0xb'));logger[_0x0cf4('0xc')](_0x0cf4('0xd'),_0x52762e,_0x0cf4('0xb'),JSON[_0x0cf4('0xe')](_0x3c05b2));if(_0x3c05b2[_0x0cf4('0xf')]){if(_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x10')]===0x1f4){logger[_0x0cf4('0xf')](_0x0cf4('0xa'),_0x52762e,_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x11')]);return _0x1c7974(_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x11')]);}logger[_0x0cf4('0xf')]('License,\x20%s,\x20%s',_0x52762e,_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x11')]);return _0xf81095(_0x3c05b2['error'][_0x0cf4('0x11')]);}else{logger[_0x0cf4('0x12')]('License,\x20%s,\x20%s',_0x52762e,_0x0cf4('0xb'));_0xf81095(_0x3c05b2[_0x0cf4('0x13')][_0x0cf4('0x11')]);}})['catch'](function(_0x76c888){logger[_0x0cf4('0xf')](_0x0cf4('0xa'),_0x52762e,_0x76c888);_0x1c7974(_0x76c888);});});} \ No newline at end of file +var _0xeb90=['rpc','../../config/environment','jayson/promise','client','http','then','License,\x20%s,\x20%s,\x20%s','stringify','error','message','License,\x20%s,\x20%s','info','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1fbc48,_0x11cb89){var _0x2a86e2=function(_0x1d0289){while(--_0x1d0289){_0x1fbc48['push'](_0x1fbc48['shift']());}};_0x2a86e2(++_0x11cb89);}(_0xeb90,0xea));var _0x0eb9=function(_0x545217,_0x1da72d){_0x545217=_0x545217-0x0;var _0x1db820=_0xeb90[_0x545217];return _0x1db820;};'use strict';var _=require(_0x0eb9('0x0'));var util=require(_0x0eb9('0x1'));var moment=require(_0x0eb9('0x2'));var BPromise=require(_0x0eb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0eb9('0x4'));var db=require(_0x0eb9('0x5'))['db'];var utils=require(_0x0eb9('0x6'));var logger=require(_0x0eb9('0x7'))(_0x0eb9('0x8'));var config=require(_0x0eb9('0x9'));var jayson=require(_0x0eb9('0xa'));var client=jayson[_0x0eb9('0xb')][_0x0eb9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a22f3,_0x49f569,_0x1d1677){return new BPromise(function(_0x36ca8f,_0x14b4ab){return client['request'](_0x5a22f3,_0x1d1677)[_0x0eb9('0xd')](function(_0x580ece){logger['info']('License,\x20%s,\x20%s',_0x49f569,'request\x20sent');logger['debug'](_0x0eb9('0xe'),_0x49f569,'request\x20sent',JSON[_0x0eb9('0xf')](_0x580ece));if(_0x580ece[_0x0eb9('0x10')]){if(_0x580ece[_0x0eb9('0x10')]['code']===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x49f569,_0x580ece[_0x0eb9('0x10')][_0x0eb9('0x11')]);return _0x14b4ab(_0x580ece[_0x0eb9('0x10')][_0x0eb9('0x11')]);}logger[_0x0eb9('0x10')](_0x0eb9('0x12'),_0x49f569,_0x580ece[_0x0eb9('0x10')][_0x0eb9('0x11')]);return _0x36ca8f(_0x580ece['error'][_0x0eb9('0x11')]);}else{logger[_0x0eb9('0x13')](_0x0eb9('0x12'),_0x49f569,_0x0eb9('0x14'));_0x36ca8f(_0x580ece['result'][_0x0eb9('0x11')]);}})[_0x0eb9('0x15')](function(_0x2c3ee3){logger[_0x0eb9('0x10')](_0x0eb9('0x12'),_0x49f569,_0x2c3ee3);_0x14b4ab(_0x2c3ee3);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 5a0679e..c98fc7f 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 _0x6c9a=['/:id/in_servers','addImap','/:id/out_servers','addInteraction','/:id/send','send','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','destroy','exports','multer','path','connect-timeout','express','Router','./mailAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getImap','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','/:id/dispositions','addDisposition','addAnswer','post'];(function(_0x302d60,_0x30b060){var _0xc0b6df=function(_0x2407e8){while(--_0x2407e8){_0x302d60['push'](_0x302d60['shift']());}};_0xc0b6df(++_0x30b060);}(_0x6c9a,0x17f));var _0xa6c9=function(_0xef36e7,_0x4b51d5){_0xef36e7=_0xef36e7-0x0;var _0x10d3a2=_0x6c9a[_0xef36e7];return _0x10d3a2;};'use strict';var multer=require(_0xa6c9('0x0'));var util=require('util');var path=require(_0xa6c9('0x1'));var timeout=require(_0xa6c9('0x2'));var express=require(_0xa6c9('0x3'));var router=express[_0xa6c9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa6c9('0x5'));router['get']('/',auth[_0xa6c9('0x6')](),controller['index']);router[_0xa6c9('0x7')](_0xa6c9('0x8'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x9')]);router[_0xa6c9('0x7')](_0xa6c9('0xa'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0xb')]);router['get']('/:id/dispositions',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0xc')]);router[_0xa6c9('0x7')](_0xa6c9('0xd'),auth[_0xa6c9('0x6')](),controller['getAnswers']);router[_0xa6c9('0x7')]('/:id/in_servers',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0xe')]);router[_0xa6c9('0x7')]('/:id/out_servers',auth[_0xa6c9('0x6')](),controller['getSmtp']);router['get'](_0xa6c9('0xf'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x10')]);router['get'](_0xa6c9('0x11'),auth[_0xa6c9('0x6')](),controller['getApplications']);router[_0xa6c9('0x7')](_0xa6c9('0x12'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x13')]);router['get'](_0xa6c9('0x14'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x15')]);router[_0xa6c9('0x7')](_0xa6c9('0x16'),auth[_0xa6c9('0x6')](),controller['getAgents']);router['post'](_0xa6c9('0x17'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x18')]);router['post'](_0xa6c9('0xd'),auth['isAuthenticated'](),controller[_0xa6c9('0x19')]);router[_0xa6c9('0x1a')]('/',auth[_0xa6c9('0x6')](),controller['create']);router[_0xa6c9('0x1a')](_0xa6c9('0x1b'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x1c')]);router[_0xa6c9('0x1a')](_0xa6c9('0x1d'),auth['isAuthenticated'](),controller['addSmtp']);router[_0xa6c9('0x1a')](_0xa6c9('0xf'),auth['isAuthenticated'](),controller[_0xa6c9('0x1e')]);router[_0xa6c9('0x1a')](_0xa6c9('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa6c9('0x1a')](_0xa6c9('0x1f'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x20')]);router[_0xa6c9('0x1a')](_0xa6c9('0x16'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x21')]);router['put']('/:id',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x22')]);router[_0xa6c9('0x23')](_0xa6c9('0x17'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x24')]);router[_0xa6c9('0x23')]('/:id/canned_answers',auth[_0xa6c9('0x6')](),controller['removeAnswers']);router['delete'](_0xa6c9('0x1b'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x25')]);router[_0xa6c9('0x23')]('/:id/out_servers',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x26')]);router[_0xa6c9('0x23')](_0xa6c9('0xa'),auth['isAuthenticated'](),controller[_0xa6c9('0x27')]);router['delete'](_0xa6c9('0x16'),auth[_0xa6c9('0x6')](),controller['removeAgents']);module[_0xa6c9('0x28')]=router; \ No newline at end of file +var _0xdd73=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','index','/describe','isAuthenticated','describe','get','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','create','addImap','addSmtp','/:id/applications','/:id/send','addAgents','put','update','delete','removeAnswers','removeImap','destroy','removeAgents'];(function(_0x272827,_0x5eecb1){var _0x166534=function(_0x8d636e){while(--_0x8d636e){_0x272827['push'](_0x272827['shift']());}};_0x166534(++_0x5eecb1);}(_0xdd73,0x1c3));var _0x3dd7=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xdd73[_0x47a12a];return _0x30cd40;};'use strict';var multer=require(_0x3dd7('0x0'));var util=require('util');var path=require(_0x3dd7('0x1'));var timeout=require(_0x3dd7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3dd7('0x3'));var auth=require(_0x3dd7('0x4'));var interaction=require(_0x3dd7('0x5'));var config=require(_0x3dd7('0x6'));var controller=require(_0x3dd7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3dd7('0x8')]);router['get'](_0x3dd7('0x9'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0xb')]);router[_0x3dd7('0xc')](_0x3dd7('0xd'),auth[_0x3dd7('0xa')](),controller['show']);router['get']('/:id/dispositions',auth[_0x3dd7('0xa')](),controller[_0x3dd7('0xe')]);router[_0x3dd7('0xc')](_0x3dd7('0xf'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x10')]);router[_0x3dd7('0xc')](_0x3dd7('0x11'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x12')]);router[_0x3dd7('0xc')](_0x3dd7('0x13'),auth['isAuthenticated'](),controller[_0x3dd7('0x14')]);router[_0x3dd7('0xc')](_0x3dd7('0x15'),auth['isAuthenticated'](),controller[_0x3dd7('0x16')]);router[_0x3dd7('0xc')]('/:id/applications',auth[_0x3dd7('0xa')](),controller['getApplications']);router['get'](_0x3dd7('0x17'),auth['isAuthenticated'](),controller['getMessages']);router[_0x3dd7('0xc')](_0x3dd7('0x18'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x19')]);router[_0x3dd7('0xc')](_0x3dd7('0x1a'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x1b')]);router[_0x3dd7('0x1c')](_0x3dd7('0x1d'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x1e')]);router[_0x3dd7('0x1c')](_0x3dd7('0xf'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x3dd7('0x1c')]('/',auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x1f')]);router[_0x3dd7('0x1c')](_0x3dd7('0x11'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x20')]);router['post'](_0x3dd7('0x13'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x21')]);router[_0x3dd7('0x1c')]('/:id/interactions',auth[_0x3dd7('0xa')](),controller['addInteraction']);router[_0x3dd7('0x1c')](_0x3dd7('0x22'),auth[_0x3dd7('0xa')](),controller['addApplications']);router[_0x3dd7('0x1c')](_0x3dd7('0x23'),auth[_0x3dd7('0xa')](),controller['send']);router['post'](_0x3dd7('0x1a'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x24')]);router[_0x3dd7('0x25')](_0x3dd7('0xd'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x26')]);router[_0x3dd7('0x27')](_0x3dd7('0x1d'),auth[_0x3dd7('0xa')](),controller['removeDispositions']);router[_0x3dd7('0x27')]('/:id/canned_answers',auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x28')]);router[_0x3dd7('0x27')](_0x3dd7('0x11'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x29')]);router['delete'](_0x3dd7('0x13'),auth[_0x3dd7('0xa')](),controller['removeSmtp']);router[_0x3dd7('0x27')](_0x3dd7('0xd'),auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x2a')]);router['delete']('/:id/users',auth[_0x3dd7('0xa')](),controller[_0x3dd7('0x2b')]);module[_0x3dd7('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 140bd9a..fffd592 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 _0xa264=['mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','custom','provider','STRING','TEXT','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','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'];(function(_0x2e5b51,_0x47523d){var _0x423bd0=function(_0x545607){while(--_0x545607){_0x2e5b51['push'](_0x2e5b51['shift']());}};_0x423bd0(++_0x47523d);}(_0xa264,0x1d3));var _0x4a26=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0xa264[_0x4450b1];return _0x399b0b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x4a26('0x0')]},'name':{'type':Sequelize[_0x4a26('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x4a26('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x4a26('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x4a26('0x1')]},'markAsUnread':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4a26('0x3')},'fontSize':{'type':Sequelize[_0x4a26('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4a26('0x1')],'defaultValue':function(){return _0x4a26('0x5');}},'notificationSound':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4a26('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4a26('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4a26('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x4a26('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![],'comment':_0x4a26('0x7'),'set':function(_0x30dfe7){if(!_0x30dfe7)this[_0x4a26('0x8')]('mandatoryDispositionPauseId',null);this[_0x4a26('0x8')](_0x4a26('0x9'),_0x30dfe7);}},'provider':{'type':Sequelize[_0x4a26('0xa')](_0x4a26('0xb'),_0x4a26('0xc'),_0x4a26('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x4a26('0xe')]('provider'))return _0x4a26('0xf');return this[_0x4a26('0xe')](_0x4a26('0x10'));},'set':function(_0x35c0e0){if(_0x35c0e0===_0x4a26('0xf'))_0x35c0e0=null;return this['setDataValue'](_0x4a26('0x10'),_0x35c0e0);}}}; \ No newline at end of file +var _0x8e32=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','hotmail','getDataValue','provider','custom','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif'];(function(_0x206f4a,_0xea896d){var _0x461514=function(_0x184f99){while(--_0x184f99){_0x206f4a['push'](_0x206f4a['shift']());}};_0x461514(++_0xea896d);}(_0x8e32,0x13b));var _0x28e3=function(_0x7dd0d,_0x597fcb){_0x7dd0d=_0x7dd0d-0x0;var _0x56946b=_0x8e32[_0x7dd0d];return _0x56946b;};'use strict';var Sequelize=require('sequelize');module[_0x28e3('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x28e3('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x28e3('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x28e3('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x28e3('0x3')]},'markAsUnread':{'type':Sequelize[_0x28e3('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x28e3('0x4')},'fontSize':{'type':Sequelize[_0x28e3('0x5')](0x2)[_0x28e3('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x28e3('0x3')],'defaultValue':function(){return _0x28e3('0x7');}},'notificationSound':{'type':Sequelize[_0x28e3('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x28e3('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x28e3('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x28e3('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x28e3('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x28e3('0x1')],'defaultValue':![],'comment':_0x28e3('0x8'),'set':function(_0x3af636){if(!_0x3af636)this[_0x28e3('0x9')]('mandatoryDispositionPauseId',null);this[_0x28e3('0x9')](_0x28e3('0xa'),_0x3af636);}},'provider':{'type':Sequelize[_0x28e3('0xb')]('gmail',_0x28e3('0xc'),'yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this[_0x28e3('0xd')](_0x28e3('0xe')))return'custom';return this[_0x28e3('0xd')](_0x28e3('0xe'));},'set':function(_0x1f4a68){if(_0x1f4a68===_0x28e3('0xf'))_0x1f4a68=null;return this['setDataValue'](_0x28e3('0xe'),_0x1f4a68);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 97c3a36..424757f 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 _0x0511=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','User','internal','Tag','color','tag','findAll','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','destroy','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','DESC','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','CloudProvider','getSmtpOptions','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','MailAccounts','UserProfileResource','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','port','host','service','authentication','username','Imap','Smtp','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','Pause','body','custom','find','update','describe','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','provider','email','isNil','active','description'];(function(_0x108ef6,_0x510b4c){var _0x3e04d0=function(_0x4f112b){while(--_0x4f112b){_0x108ef6['push'](_0x108ef6['shift']());}};_0x3e04d0(++_0x510b4c);}(_0x0511,0x1bd));var _0x1051=function(_0x4e3ffc,_0x570704){_0x4e3ffc=_0x4e3ffc-0x0;var _0x543119=_0x0511[_0x4e3ffc];return _0x543119;};'use strict';var moment=require(_0x1051('0x0'));var BPromise=require('bluebird');var util=require(_0x1051('0x1'));var path=require(_0x1051('0x2'));var _=require(_0x1051('0x3'));var juice=require('juice');var Redis=require(_0x1051('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x1051('0x5'))(_0x1051('0x6'));var config=require(_0x1051('0x7'));var db=require(_0x1051('0x8'))['db'];config['redis']=_[_0x1051('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1051('0xa')]));require(_0x1051('0xb'))[_0x1051('0xc')](socket);var jayson=require(_0x1051('0xd'));var client=jayson[_0x1051('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x2ab7d3,_0x467d9c,_0x383d9e,_0x40e368){return new BPromise(function(_0x250eee,_0x48744b){var _0x1a5d10=_0x40e368||client;return _0x1a5d10[_0x1051('0xf')](_0x2ab7d3,_0x383d9e)[_0x1051('0x10')](function(_0x4b2058){logger[_0x1051('0x11')](_0x1051('0x12'),_0x467d9c,'request\x20sent');logger[_0x1051('0x13')](_0x1051('0x14'),_0x467d9c,_0x1051('0x15'),JSON[_0x1051('0x16')](_0x4b2058));if(_0x4b2058[_0x1051('0x17')]){if(_0x4b2058[_0x1051('0x17')]['code']===0x1f4){logger[_0x1051('0x17')]('MailAccount,\x20%s,\x20%s',_0x467d9c,_0x4b2058[_0x1051('0x17')][_0x1051('0x18')]);return _0x48744b(_0x4b2058[_0x1051('0x17')][_0x1051('0x18')]);}logger[_0x1051('0x17')](_0x1051('0x12'),_0x467d9c,_0x4b2058[_0x1051('0x17')]['message']);return _0x250eee(_0x4b2058['error'][_0x1051('0x18')]);}else{logger[_0x1051('0x11')](_0x1051('0x12'),_0x467d9c,_0x1051('0x15'));_0x250eee(_0x4b2058[_0x1051('0x19')]['message']);}})[_0x1051('0x1a')](function(_0x473c18){logger[_0x1051('0x17')](_0x1051('0x12'),_0x467d9c,_0x473c18);_0x48744b(_0x473c18);});});}function respondWithStatusCode(_0xcd2dba,_0x3b2e42){_0x3b2e42=_0x3b2e42||0xcc;return function(_0x1256a0){if(_0x1256a0){return _0xcd2dba[_0x1051('0x1b')](_0x3b2e42);}return _0xcd2dba[_0x1051('0x1c')](_0x3b2e42)[_0x1051('0x1d')]();};}function respondWithResult(_0x144733,_0xdbb929){_0xdbb929=_0xdbb929||0xc8;return function(_0x1eef09){if(_0x1eef09){return _0x144733[_0x1051('0x1c')](_0xdbb929)['json'](_0x1eef09);}};}function respondWithFilteredResult(_0x76bcb3,_0x24e93c){return function(_0xf91436){if(_0xf91436){var _0x31e27c=typeof _0x24e93c[_0x1051('0x1e')]===_0x1051('0x1f')&&typeof _0x24e93c['limit']===_0x1051('0x1f');var _0x521e2a=_0xf91436[_0x1051('0x20')];var _0x17386a=_0x31e27c?0x0:_0x24e93c[_0x1051('0x1e')];var _0x305463=_0x31e27c?_0xf91436[_0x1051('0x20')]:_0x24e93c[_0x1051('0x1e')]+_0x24e93c[_0x1051('0x21')];var _0x4acef4;if(_0x305463>=_0x521e2a){_0x305463=_0x521e2a;_0x4acef4=0xc8;}else{_0x4acef4=0xce;}_0x76bcb3['status'](_0x4acef4);return _0x76bcb3[_0x1051('0x22')](_0x1051('0x23'),_0x17386a+'-'+_0x305463+'/'+_0x521e2a)[_0x1051('0x24')](_0xf91436);}return null;};}function saveUpdates(_0x22ff1e){return function(_0x5d601d){if(_0x5d601d){return _0x5d601d['update'](_0x22ff1e)[_0x1051('0x10')](function(_0x3eaf42){return _0x3eaf42;});}return null;};}function removeEntity(_0x53caff){return function(_0x340edf){if(_0x340edf){return _0x340edf['destroy']()[_0x1051('0x10')](function(){var _0x1f1daa=_0x340edf['get']({'plain':!![]});var _0x324c03=_0x1051('0x25');return db[_0x1051('0x26')]['destroy']({'where':{'type':_0x324c03,'resourceId':_0x1f1daa['id']}})[_0x1051('0x10')](function(){return _0x340edf;});})[_0x1051('0x10')](function(){_0x53caff[_0x1051('0x1c')](0xcc)[_0x1051('0x1d')]();});}};}function handleEntityNotFound(_0x5fe3a0){return function(_0x5e17bb){if(!_0x5e17bb){_0x5fe3a0['sendStatus'](0x194);}return _0x5e17bb;};}function handleError(_0x547d40,_0x524b55){_0x524b55=_0x524b55||0x1f4;return function(_0x3e5213){logger[_0x1051('0x17')](_0x3e5213[_0x1051('0x27')]);if(_0x3e5213['name']){delete _0x3e5213[_0x1051('0x28')];}_0x547d40['status'](_0x524b55)[_0x1051('0x29')](_0x3e5213);};}function getImapHost(_0x22f372){switch(_0x22f372){case _0x1051('0x2a'):return'imap.gmail.com';case _0x1051('0x2b'):return _0x1051('0x2c');case _0x1051('0x2d'):return'imap-mail.outlook.com';case _0x1051('0x2e'):return _0x1051('0x2f');}throw new Error(_0x1051('0x30'),_0x22f372);}function getSmtpHost(_0x3346cc){switch(_0x3346cc){case _0x1051('0x2a'):return'smtp.gmail.com';case _0x1051('0x2b'):return _0x1051('0x31');case _0x1051('0x2d'):return _0x1051('0x32');case'outlook365':return _0x1051('0x33');}throw new Error(_0x1051('0x30'),_0x3346cc);}function getAuthenticationOptions(_0x25ec12,_0x2f9b27){var _0x1ec1f0={};var _0x21f06f={};if(_0x25ec12){_0x1ec1f0['user']=_0x21f06f[_0x1051('0x34')]=_0x2f9b27['username'];_0x1ec1f0[_0x1051('0x35')]=_0x21f06f[_0x1051('0x36')]=_0x2f9b27[_0x1051('0x35')];if(_0x2f9b27[_0x1051('0x37')]){_0x1ec1f0[_0x1051('0x37')]=_0x21f06f[_0x1051('0x37')]=!![];_0x1ec1f0[_0x1051('0x38')]=_0x21f06f[_0x1051('0x38')]=_0x2f9b27[_0x1051('0x38')];_0x1ec1f0[_0x1051('0x35')]=_0x21f06f['pass']=null;}else{_0x1ec1f0[_0x1051('0x38')]=_0x21f06f[_0x1051('0x38')]=null;}_0x1ec1f0['host']=getImapHost(_0x25ec12);_0x1ec1f0[_0x1051('0x39')]=0x3e1;_0x21f06f[_0x1051('0x3a')]=getSmtpHost(_0x25ec12);_0x21f06f[_0x1051('0x39')]=0x24b;_0x21f06f['secure']=![];_0x1ec1f0[_0x1051('0x3b')]=_0x21f06f[_0x1051('0x3b')]=null;}else{if(_0x2f9b27[_0x1051('0x3c')]){_0x1ec1f0[_0x1051('0x34')]=_0x21f06f[_0x1051('0x34')]=_0x2f9b27[_0x1051('0x3d')];_0x1ec1f0[_0x1051('0x35')]=_0x21f06f[_0x1051('0x36')]=_0x2f9b27[_0x1051('0x35')];}else{_0x1ec1f0['authentication']=_0x21f06f[_0x1051('0x3c')]=![];_0x1ec1f0[_0x1051('0x34')]=_0x21f06f[_0x1051('0x34')]=null;_0x1ec1f0['password']=_0x21f06f[_0x1051('0x36')]=null;}_0x1ec1f0['host']=_0x2f9b27[_0x1051('0x3e')][_0x1051('0x3a')];_0x1ec1f0['port']=_0x2f9b27[_0x1051('0x3e')][_0x1051('0x39')];_0x21f06f[_0x1051('0x3a')]=_0x2f9b27['Smtp'][_0x1051('0x3a')];_0x21f06f[_0x1051('0x39')]=_0x2f9b27[_0x1051('0x3f')][_0x1051('0x39')];}return{'Imap':_0x1ec1f0,'Smtp':_0x21f06f};}exports['index']=function(_0x5423f1,_0x16c731){var _0x31f3cb={'include':[{'model':db[_0x1051('0x40')],'as':_0x1051('0x3e')},{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f')},{'model':db['Pause'],'as':_0x1051('0x42')}]},_0x254b4a={},_0x3f3c87={'count':0x0,'rows':[]};var _0x57fd36=_[_0x1051('0x43')](db[_0x1051('0x44')][_0x1051('0x45')],function(_0x5b8631){return{'name':_0x5b8631['fieldName'],'type':_0x5b8631[_0x1051('0x46')][_0x1051('0x47')]};});_0x254b4a[_0x1051('0x48')]=_['map'](_0x57fd36,_0x1051('0x28'));_0x254b4a['query']=_[_0x1051('0x49')](_0x5423f1[_0x1051('0x4a')]);_0x254b4a[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x254b4a[_0x1051('0x48')],_0x254b4a[_0x1051('0x4a')]);_0x31f3cb[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x254b4a[_0x1051('0x48')],qs[_0x1051('0x4e')](_0x5423f1[_0x1051('0x4a')]['fields']));_0x31f3cb['attributes']=_0x31f3cb['attributes'][_0x1051('0x4f')]?_0x31f3cb[_0x1051('0x4d')]:_0x254b4a[_0x1051('0x48')];if(!_0x5423f1[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x31f3cb[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x5423f1[_0x1051('0x4a')][_0x1051('0x21')]);_0x31f3cb['offset']=qs[_0x1051('0x1e')](_0x5423f1[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x31f3cb[_0x1051('0x52')]=qs['sort'](_0x5423f1[_0x1051('0x4a')][_0x1051('0x53')]);_0x31f3cb[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0x5423f1[_0x1051('0x4a')],_0x254b4a[_0x1051('0x4b')]),_0x57fd36);if(_0x5423f1['query'][_0x1051('0x56')]){_0x31f3cb['where']=_[_0x1051('0x57')](_0x31f3cb[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x57fd36,function(_0x3352ee){if(_0x3352ee[_0x1051('0x46')]!==_0x1051('0x58')){var _0x412c7d={};_0x412c7d[_0x3352ee[_0x1051('0x28')]]={'$like':'%'+_0x5423f1[_0x1051('0x4a')]['filter']+'%'};return _0x412c7d;}})});}_0x31f3cb=_['merge']({},_0x31f3cb,_0x5423f1[_0x1051('0x59')]);var _0x995125={'where':_0x31f3cb[_0x1051('0x54')]};return db[_0x1051('0x44')][_0x1051('0x20')](_0x995125)[_0x1051('0x10')](function(_0x478c18){_0x3f3c87[_0x1051('0x20')]=_0x478c18;if(_0x5423f1['query'][_0x1051('0x5a')]){_0x31f3cb[_0x1051('0x5b')]=[{'all':!![]}];}return db[_0x1051('0x44')]['findAll'](_0x31f3cb);})[_0x1051('0x10')](function(_0x4551b9){_0x3f3c87[_0x1051('0x5c')]=_0x4551b9;return _0x3f3c87;})[_0x1051('0x10')](respondWithFilteredResult(_0x16c731,_0x31f3cb))['catch'](handleError(_0x16c731,null));};exports[_0x1051('0x5d')]=function(_0xcda895,_0x2b1cb3){var _0x43c252={'raw':![],'where':{'id':_0xcda895[_0x1051('0x5e')]['id']},'include':[{'model':db[_0x1051('0x40')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x1051('0x5f')],'as':_0x1051('0x42')}]},_0x5913d8={};_0x5913d8[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x44')][_0x1051('0x45')]);_0x5913d8[_0x1051('0x4a')]=_[_0x1051('0x49')](_0xcda895[_0x1051('0x4a')]);_0x5913d8[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x5913d8[_0x1051('0x48')],_0x5913d8['query']);_0x43c252[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x5913d8[_0x1051('0x48')],qs[_0x1051('0x4e')](_0xcda895[_0x1051('0x4a')][_0x1051('0x4e')]));_0x43c252[_0x1051('0x4d')]=_0x43c252[_0x1051('0x4d')][_0x1051('0x4f')]?_0x43c252['attributes']:_0x5913d8[_0x1051('0x48')];if(_0xcda895[_0x1051('0x4a')][_0x1051('0x5a')]){_0x43c252[_0x1051('0x5b')]=[{'all':!![]}];}_0x43c252=_[_0x1051('0x57')]({},_0x43c252,_0xcda895['options']);return db[_0x1051('0x44')]['find'](_0x43c252)[_0x1051('0x10')](handleEntityNotFound(_0x2b1cb3,null))[_0x1051('0x10')](respondWithResult(_0x2b1cb3,null))[_0x1051('0x1a')](handleError(_0x2b1cb3,null));};exports['update']=function(_0x2f8043,_0x3786bb){if(_0x2f8043[_0x1051('0x60')]['id']){delete _0x2f8043[_0x1051('0x60')]['id'];}var _0x1b76ce=_0x2f8043[_0x1051('0x60')]['provider']===_0x1051('0x61')?null:_0x2f8043[_0x1051('0x60')]['provider'];var _0x508dca=_0x2f8043[_0x1051('0x60')][_0x1051('0x3e')]||{};var _0x468c5a=_0x2f8043[_0x1051('0x60')][_0x1051('0x3f')]||{};if(_0x1b76ce){_0x508dca[_0x1051('0x3a')]=getImapHost(_0x1b76ce);_0x508dca[_0x1051('0x39')]=0x3e1;_0x468c5a[_0x1051('0x3a')]=getSmtpHost(_0x1b76ce);_0x468c5a[_0x1051('0x39')]=0x24b;_0x468c5a['secure']=![];}if(_0x468c5a['modernAuthentication']){_0x468c5a['secure']=![];}else{_0x468c5a[_0x1051('0x38')]=null;}if(!_0x508dca[_0x1051('0x37')])_0x508dca['CloudProviderId']=null;_0x2f8043['body'][_0x1051('0x3e')]=_0x508dca;_0x2f8043[_0x1051('0x60')][_0x1051('0x3f')]=_0x468c5a;return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x2f8043[_0x1051('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1051('0x3e')},{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f')},{'model':db[_0x1051('0x5f')],'as':_0x1051('0x42')}]})['then'](handleEntityNotFound(_0x3786bb,null))['then'](function(_0x3eb8e2){if(!_0x3eb8e2)throw new Error('Mail\x20Account\x20not\x20found');if(_0x3eb8e2[_0x1051('0x3b')])delete _0x2f8043[_0x1051('0x60')][_0x1051('0x3e')];return _0x3eb8e2;})[_0x1051('0x10')](saveUpdates(_0x2f8043['body'],null))[_0x1051('0x10')](function(_0x31d14e){if(!_0x2f8043[_0x1051('0x60')]['Imap'])return _0x31d14e;return db['MailServerIn'][_0x1051('0x63')](_0x2f8043[_0x1051('0x60')][_0x1051('0x3e')],{'where':{'MailAccountId':_0x31d14e['id']}})[_0x1051('0x10')](function(){return _0x31d14e;});})[_0x1051('0x10')](function(_0x43ed5f){if(!_0x2f8043[_0x1051('0x60')]['Smtp'])return _0x43ed5f;return db[_0x1051('0x41')][_0x1051('0x63')](_0x2f8043[_0x1051('0x60')][_0x1051('0x3f')],{'where':{'MailAccountId':_0x43ed5f['id']}})[_0x1051('0x10')](function(){return _0x43ed5f;});})[_0x1051('0x10')](respondWithResult(_0x3786bb,null))[_0x1051('0x1a')](handleError(_0x3786bb,null));};exports[_0x1051('0x64')]=function(_0x463c24,_0x7db7ee){return db[_0x1051('0x44')][_0x1051('0x64')]()[_0x1051('0x10')](respondWithResult(_0x7db7ee,null))[_0x1051('0x1a')](handleError(_0x7db7ee,null));};exports['addDisposition']=function(_0x4acaad,_0x56191e){if(_0x4acaad[_0x1051('0x60')]['id']){delete _0x4acaad[_0x1051('0x60')]['id'];}return db[_0x1051('0x44')]['find']({'where':{'id':_0x4acaad[_0x1051('0x5e')]['id']}})['then'](handleEntityNotFound(_0x56191e,null))[_0x1051('0x10')](function(_0x505500){if(_0x505500){_0x4acaad[_0x1051('0x60')][_0x1051('0x65')]=_0x505500['id'];return db[_0x1051('0x66')][_0x1051('0x67')](_0x4acaad['body']);}})[_0x1051('0x10')](respondWithResult(_0x56191e,null))[_0x1051('0x1a')](handleError(_0x56191e,null));};exports[_0x1051('0x68')]=function(_0x501472,_0x551027){var _0x359be0={'raw':![],'where':{}};var _0x5b5744={};var _0x123421={'count':0x0,'rows':[]};return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x501472[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x551027,null))[_0x1051('0x10')](function(_0x2089f3){if(_0x2089f3){_0x5b5744[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x66')][_0x1051('0x45')]);_0x5b5744[_0x1051('0x4a')]=_[_0x1051('0x49')](_0x501472[_0x1051('0x4a')]);_0x5b5744[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x5b5744[_0x1051('0x48')],_0x5b5744[_0x1051('0x4a')]);_0x359be0[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x5b5744[_0x1051('0x48')],qs['fields'](_0x501472[_0x1051('0x4a')][_0x1051('0x4e')]));_0x359be0[_0x1051('0x4d')]=_0x359be0['attributes']['length']?_0x359be0[_0x1051('0x4d')]:_0x5b5744[_0x1051('0x48')];if(!_0x501472[_0x1051('0x4a')]['hasOwnProperty'](_0x1051('0x51'))){_0x359be0[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x501472[_0x1051('0x4a')][_0x1051('0x21')]);_0x359be0['offset']=qs[_0x1051('0x1e')](_0x501472[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x359be0[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x501472[_0x1051('0x4a')][_0x1051('0x53')]);_0x359be0[_0x1051('0x54')]=qs[_0x1051('0x4b')](_['pick'](_0x501472['query'],_0x5b5744[_0x1051('0x4b')]));_0x359be0[_0x1051('0x54')]['MailAccountId']=_0x2089f3['id'];if(_0x501472[_0x1051('0x4a')][_0x1051('0x56')]){_0x359be0[_0x1051('0x54')]=_[_0x1051('0x57')](_0x359be0[_0x1051('0x54')],{'$or':_['map'](_0x359be0[_0x1051('0x4d')],function(_0x368794){var _0x401d68={};_0x401d68[_0x368794]={'$like':'%'+_0x501472['query']['filter']+'%'};return _0x401d68;})});}_0x359be0=_[_0x1051('0x57')]({},_0x359be0,_0x501472[_0x1051('0x59')]);return db[_0x1051('0x66')]['count']({'where':_0x359be0[_0x1051('0x54')]})['then'](function(_0x451dbd){_0x123421[_0x1051('0x20')]=_0x451dbd;if(_0x501472['query'][_0x1051('0x5a')]){_0x359be0['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x359be0);})[_0x1051('0x10')](function(_0x3ebe2c){_0x123421[_0x1051('0x5c')]=_0x3ebe2c;return _0x123421;});}})['then'](respondWithFilteredResult(_0x551027,_0x359be0))[_0x1051('0x1a')](handleError(_0x551027,null));};exports[_0x1051('0x6a')]=function(_0x407096,_0x4f3fad){return db[_0x1051('0x44')]['find']({'where':{'id':_0x407096[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x4f3fad,null))[_0x1051('0x10')](function(_0x569d16){if(_0x569d16){return _0x569d16[_0x1051('0x6a')](_0x407096['query'][_0x1051('0x6b')]);}})[_0x1051('0x10')](respondWithStatusCode(_0x4f3fad,null))[_0x1051('0x1a')](handleError(_0x4f3fad,null));};exports[_0x1051('0x6c')]=function(_0x477fbb,_0x55944d){if(_0x477fbb[_0x1051('0x60')]['id']){delete _0x477fbb['body']['id'];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x477fbb[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x55944d,null))[_0x1051('0x10')](function(_0x592383){if(_0x592383){_0x477fbb['body'][_0x1051('0x65')]=_0x592383['id'];return db['CannedAnswer'][_0x1051('0x67')](_0x477fbb[_0x1051('0x60')]);}})[_0x1051('0x10')](respondWithResult(_0x55944d,null))[_0x1051('0x1a')](handleError(_0x55944d,null));};exports['getAnswers']=function(_0x119732,_0xce554e){var _0x63f1f5={'raw':![],'where':{}};var _0x720dc1={};var _0x521126={'count':0x0,'rows':[]};return db[_0x1051('0x44')]['findOne']({'where':{'id':_0x119732[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0xce554e,null))[_0x1051('0x10')](function(_0x3539d4){if(_0x3539d4){_0x720dc1[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x6d')][_0x1051('0x45')]);_0x720dc1['query']=_[_0x1051('0x49')](_0x119732['query']);_0x720dc1[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x720dc1[_0x1051('0x48')],_0x720dc1[_0x1051('0x4a')]);_0x63f1f5[_0x1051('0x4d')]=_['intersection'](_0x720dc1[_0x1051('0x48')],qs[_0x1051('0x4e')](_0x119732[_0x1051('0x4a')][_0x1051('0x4e')]));_0x63f1f5['attributes']=_0x63f1f5[_0x1051('0x4d')][_0x1051('0x4f')]?_0x63f1f5[_0x1051('0x4d')]:_0x720dc1[_0x1051('0x48')];if(!_0x119732[_0x1051('0x4a')][_0x1051('0x50')]('nolimit')){_0x63f1f5[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x119732[_0x1051('0x4a')][_0x1051('0x21')]);_0x63f1f5[_0x1051('0x1e')]=qs[_0x1051('0x1e')](_0x119732[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x63f1f5[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x119732[_0x1051('0x4a')][_0x1051('0x53')]);_0x63f1f5[_0x1051('0x54')]=qs['filters'](_[_0x1051('0x55')](_0x119732[_0x1051('0x4a')],_0x720dc1[_0x1051('0x4b')]));_0x63f1f5[_0x1051('0x54')][_0x1051('0x65')]=_0x3539d4['id'];if(_0x119732[_0x1051('0x4a')]['filter']){_0x63f1f5[_0x1051('0x54')]=_[_0x1051('0x57')](_0x63f1f5[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x63f1f5[_0x1051('0x4d')],function(_0x4bea2a){var _0x226250={};_0x226250[_0x4bea2a]={'$like':'%'+_0x119732[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x226250;})});}_0x63f1f5=_['merge']({},_0x63f1f5,_0x119732[_0x1051('0x59')]);return db[_0x1051('0x6d')][_0x1051('0x20')]({'where':_0x63f1f5[_0x1051('0x54')]})[_0x1051('0x10')](function(_0xf13e38){_0x521126['count']=_0xf13e38;if(_0x119732['query'][_0x1051('0x5a')]){_0x63f1f5[_0x1051('0x5b')]=[{'all':!![]}];}return db[_0x1051('0x6d')]['findAll'](_0x63f1f5);})[_0x1051('0x10')](function(_0x294aa4){_0x521126[_0x1051('0x5c')]=_0x294aa4;return _0x521126;});}})['then'](respondWithFilteredResult(_0xce554e,_0x63f1f5))['catch'](handleError(_0xce554e,null));};exports[_0x1051('0x6e')]=function(_0x4e0b73,_0x494485){return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x4e0b73['params']['id']}})['then'](handleEntityNotFound(_0x494485,null))[_0x1051('0x10')](function(_0x4666bb){if(_0x4666bb){return _0x4666bb[_0x1051('0x6e')](_0x4e0b73[_0x1051('0x4a')][_0x1051('0x6b')]);}})['then'](respondWithStatusCode(_0x494485,null))['catch'](handleError(_0x494485,null));};exports[_0x1051('0x67')]=function(_0x584bfa,_0x5ea471){var _0x38d4f8={'name':_0x584bfa[_0x1051('0x60')]['name'],'key':_0x584bfa[_0x1051('0x60')][_0x1051('0x47')],'provider':_0x584bfa['body'][_0x1051('0x6f')]==='custom'?null:_0x584bfa[_0x1051('0x60')]['provider'],'email':_0x584bfa[_0x1051('0x60')][_0x1051('0x70')],'ListId':_0x584bfa['body']['ListId'],'active':!_[_0x1051('0x71')](_0x584bfa[_0x1051('0x60')][_0x1051('0x72')])?_0x584bfa[_0x1051('0x60')][_0x1051('0x72')]:!![],'description':_0x584bfa[_0x1051('0x60')][_0x1051('0x73')]||null};var _0x24d984=getAuthenticationOptions(_0x38d4f8[_0x1051('0x6f')],_0x584bfa[_0x1051('0x60')]);_0x38d4f8[_0x1051('0x3e')]=_0x24d984['Imap'];_0x38d4f8[_0x1051('0x3f')]=_0x24d984[_0x1051('0x3f')];return db[_0x1051('0x44')][_0x1051('0x67')](_0x38d4f8,{'include':[{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f')},{'model':db[_0x1051('0x40')],'as':'Imap'}]})[_0x1051('0x10')](function(_0x39df30){var _0x4c47dd=_0x584bfa['user'][_0x1051('0x74')]({'plain':!![]});if(!_0x4c47dd)throw new Error(_0x1051('0x75'));if(_0x4c47dd[_0x1051('0x76')]===_0x1051('0x34')){var _0x11fd19=_0x39df30[_0x1051('0x74')]({'plain':!![]});return db['UserProfileSection'][_0x1051('0x62')]({'where':{'name':_0x1051('0x25'),'userProfileId':_0x4c47dd['userProfileId']},'raw':!![]})[_0x1051('0x10')](function(_0x356146){if(_0x356146&&_0x356146['autoAssociation']===0x0){return db[_0x1051('0x26')][_0x1051('0x67')]({'name':_0x11fd19[_0x1051('0x28')],'resourceId':_0x11fd19['id'],'type':_0x356146[_0x1051('0x28')],'sectionId':_0x356146['id']},{})[_0x1051('0x10')](function(){return _0x39df30;});}else{return _0x39df30;}})['catch'](function(_0x38f2d4){logger[_0x1051('0x17')](_0x1051('0x77'),_0x38f2d4);throw _0x38f2d4;});}return _0x39df30;})['then'](respondWithResult(_0x5ea471,0xc9))[_0x1051('0x1a')](handleError(_0x5ea471,null));};exports[_0x1051('0x78')]=function(_0x24dd4f,_0x5514dd){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x24dd4f[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x5514dd,null))[_0x1051('0x10')](function(_0x4c935c){if(_0x4c935c){return _0x4c935c[_0x1051('0x78')]();}return null;})[_0x1051('0x10')](respondWithResult(_0x5514dd,null))['catch'](handleError(_0x5514dd,null));};exports[_0x1051('0x79')]=function(_0x36142a,_0x3559e9){if(_0x36142a[_0x1051('0x60')]['id']){delete _0x36142a[_0x1051('0x60')]['id'];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x36142a['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x3559e9,null))[_0x1051('0x10')](function(_0x4f646a){if(_0x4f646a){_0x36142a[_0x1051('0x60')][_0x1051('0x65')]=_0x4f646a['id'];return db['MailServerIn'][_0x1051('0x67')](_0x36142a[_0x1051('0x60')]);}})[_0x1051('0x10')](respondWithResult(_0x3559e9,null))[_0x1051('0x1a')](handleError(_0x3559e9,null));};exports['removeImap']=function(_0x39a73f,_0x498a){return db['MailAccount']['findOne']({'where':{'id':_0x39a73f[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x498a,null))[_0x1051('0x10')](function(_0x5d0ff7){if(_0x5d0ff7){return _0x5d0ff7[_0x1051('0x7a')](null);}return null;})[_0x1051('0x10')](respondWithStatusCode(_0x498a,null))[_0x1051('0x1a')](handleError(_0x498a,null));};exports[_0x1051('0x7b')]=function(_0x29c43e,_0x1f661f){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x29c43e[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x1f661f,null))[_0x1051('0x10')](function(_0x542512){if(_0x542512){return _0x542512['getSmtp']();}return null;})[_0x1051('0x10')](respondWithResult(_0x1f661f,null))[_0x1051('0x1a')](handleError(_0x1f661f,null));};exports['addSmtp']=function(_0x10c960,_0xe801d3){if(_0x10c960[_0x1051('0x60')]['id']){delete _0x10c960[_0x1051('0x60')]['id'];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x10c960[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0xe801d3,null))[_0x1051('0x10')](function(_0x281e2a){if(_0x281e2a){_0x10c960[_0x1051('0x60')][_0x1051('0x65')]=_0x281e2a['id'];return db['MailServerOut'][_0x1051('0x67')](_0x10c960['body']);}})[_0x1051('0x10')](respondWithResult(_0xe801d3,null))[_0x1051('0x1a')](handleError(_0xe801d3,null));};exports['removeSmtp']=function(_0x1e8e92,_0x22107d){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x1e8e92[_0x1051('0x5e')]['id']}})['then'](handleEntityNotFound(_0x22107d,null))[_0x1051('0x10')](function(_0x4441d2){if(_0x4441d2){return _0x4441d2[_0x1051('0x7c')](null);}return null;})[_0x1051('0x10')](respondWithStatusCode(_0x22107d,null))['catch'](handleError(_0x22107d,null));};exports['addInteraction']=function(_0x339940,_0x484e89){return db[_0x1051('0x7d')]['find']({'where':{'id':_0x339940[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x484e89,null))[_0x1051('0x10')](function(_0x1ed52f){if(_0x1ed52f){return _0x1ed52f[_0x1051('0x7e')](_0x339940['body'][_0x1051('0x6b')],_[_0x1051('0x7f')](_0x339940['body'],[_0x1051('0x6b'),'id'])||{});}})[_0x1051('0x10')](respondWithResult(_0x484e89,null))[_0x1051('0x1a')](handleError(_0x484e89,null));};exports[_0x1051('0x80')]=function(_0x1f0102,_0x2f2d80){var _0x512a8c={'raw':![],'where':{}};var _0x36fe0b={};var _0x273195={'count':0x0,'rows':[]};return db['MailAccount'][_0x1051('0x69')]({'where':{'id':_0x1f0102[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x2f2d80,null))[_0x1051('0x10')](function(_0x5598f6){if(_0x5598f6){_0x36fe0b[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x7d')][_0x1051('0x45')]);_0x36fe0b[_0x1051('0x4a')]=_[_0x1051('0x49')](_0x1f0102[_0x1051('0x4a')]);_0x36fe0b[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x36fe0b[_0x1051('0x48')],_0x36fe0b[_0x1051('0x4a')]);_0x512a8c['attributes']=_[_0x1051('0x4c')](_0x36fe0b[_0x1051('0x48')],qs[_0x1051('0x4e')](_0x1f0102[_0x1051('0x4a')][_0x1051('0x4e')]));_0x512a8c[_0x1051('0x4d')]=_0x512a8c[_0x1051('0x4d')][_0x1051('0x4f')]?_0x512a8c[_0x1051('0x4d')]:_0x36fe0b['model'];if(!_0x1f0102[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x512a8c[_0x1051('0x21')]=qs['limit'](_0x1f0102['query']['limit']);_0x512a8c[_0x1051('0x1e')]=qs[_0x1051('0x1e')](_0x1f0102[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x512a8c['order']=qs['sort'](_0x1f0102[_0x1051('0x4a')][_0x1051('0x53')]);_0x512a8c[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0x1f0102[_0x1051('0x4a')],_0x36fe0b['filters']));_0x512a8c['where'][_0x1051('0x65')]=_0x5598f6['id'];if(_0x1f0102[_0x1051('0x4a')][_0x1051('0x56')]){_0x512a8c[_0x1051('0x54')]=_[_0x1051('0x57')](_0x512a8c['where'],{'$or':_[_0x1051('0x43')](_0x512a8c[_0x1051('0x4d')],function(_0x483f25){var _0xc5f801={};_0xc5f801[_0x483f25]={'$like':'%'+_0x1f0102['query'][_0x1051('0x56')]+'%'};return _0xc5f801;})});}_0x512a8c=_['merge']({},_0x512a8c,_0x1f0102[_0x1051('0x59')]);return db[_0x1051('0x7d')][_0x1051('0x20')]({'where':_0x512a8c[_0x1051('0x54')]})[_0x1051('0x10')](function(_0x4fd46c){_0x273195[_0x1051('0x20')]=_0x4fd46c;if(_0x1f0102[_0x1051('0x4a')][_0x1051('0x5a')]){_0x512a8c[_0x1051('0x5b')]=[{'model':db[_0x1051('0x81')],'as':'Contact','required':![]},{'model':db[_0x1051('0x82')],'as':'Owner','attributes':[_0x1051('0x28'),'fullname',_0x1051('0x83')],'required':![]},{'model':db[_0x1051('0x84')],'as':'Tags','attributes':['id',_0x1051('0x28'),_0x1051('0x85')],'where':_0x1f0102[_0x1051('0x4a')][_0x1051('0x86')]?{'id':_0x1f0102[_0x1051('0x4a')][_0x1051('0x86')]}:undefined,'required':_0x1f0102[_0x1051('0x4a')][_0x1051('0x86')]?!![]:![]}];}return db[_0x1051('0x7d')][_0x1051('0x87')](_0x512a8c);})[_0x1051('0x10')](function(_0x1d415e){_0x273195[_0x1051('0x5c')]=_0x1d415e;return _0x273195;});}})[_0x1051('0x10')](respondWithFilteredResult(_0x2f2d80,_0x512a8c))[_0x1051('0x1a')](handleError(_0x2f2d80,null));};exports[_0x1051('0x88')]=function addApplications(_0x1ae1e1,_0x5e3663){var _0x50fc30=_0x1ae1e1[_0x1051('0x5e')]['id'];var _0x3053c1=_0x1ae1e1[_0x1051('0x60')];var _0x8dc6c1=0xc8;var _0x38ff9c=null;return db[_0x1051('0x89')][_0x1051('0x8a')]({'isolationLevel':db[_0x1051('0x89')][_0x1051('0x8b')][_0x1051('0x8c')][_0x1051('0x8d')]},function(_0x53ed17){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x50fc30},'transaction':_0x53ed17})[_0x1051('0x10')](function(_0x41fca3){if(_0x41fca3){return db[_0x1051('0x8e')][_0x1051('0x8f')]({'where':{'MailAccountId':_0x50fc30},'transaction':_0x53ed17})[_0x1051('0x10')](function(){var _0x44abd7=_[_0x1051('0x43')](_0x3053c1,function(_0x4f7bae){_0x4f7bae['MailAccountId']=_0x50fc30;return _0x4f7bae;});return db[_0x1051('0x8e')]['bulkCreate'](_0x44abd7,{'transaction':_0x53ed17});});}else{_0x8dc6c1=0x194;_0x38ff9c=[];}});})['then'](function(){if(_0x8dc6c1!==0x194){return db['MailApplication'][_0x1051('0x90')]({'where':{'MailAccountId':_0x50fc30},'order':_0x1051('0x91')})[_0x1051('0x10')](function(_0x1de4dd){_0x38ff9c=_0x1de4dd;});}})[_0x1051('0x1a')](function(_0x46bd28){_0x8dc6c1=0x1f4;logger[_0x1051('0x17')](_0x46bd28[_0x1051('0x27')]);if(_0x46bd28['name']){delete _0x46bd28[_0x1051('0x28')];}_0x38ff9c=_0x46bd28;})[_0x1051('0x92')](function(){if(_0x38ff9c===null){_0x5e3663['sendStatus'](_0x8dc6c1);}else{if(_0x8dc6c1===0x1f4){_0x5e3663[_0x1051('0x1c')](_0x8dc6c1)[_0x1051('0x29')](_0x38ff9c);}else{_0x5e3663[_0x1051('0x1c')](_0x8dc6c1)[_0x1051('0x24')](_0x38ff9c);}}});};exports[_0x1051('0x93')]=function(_0x2559d6,_0x1db0ac){var _0x4ebe5b={};var _0x11b1fc={};var _0x1a41f8;var _0xf706b3;return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x2559d6['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x1db0ac,null))[_0x1051('0x10')](function(_0x1e2650){if(_0x1e2650){_0x1a41f8=_0x1e2650;_0x11b1fc['model']=_[_0x1051('0x49')](db[_0x1051('0x8e')]['rawAttributes']);_0x11b1fc['query']=_[_0x1051('0x49')](_0x2559d6['query']);_0x11b1fc[_0x1051('0x4b')]=_['intersection'](_0x11b1fc[_0x1051('0x48')],_0x11b1fc['query']);_0x4ebe5b[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x11b1fc['model'],qs[_0x1051('0x4e')](_0x2559d6[_0x1051('0x4a')][_0x1051('0x4e')]));_0x4ebe5b[_0x1051('0x4d')]=_0x4ebe5b[_0x1051('0x4d')][_0x1051('0x4f')]?_0x4ebe5b['attributes']:_0x11b1fc[_0x1051('0x48')];_0x4ebe5b[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x2559d6['query'][_0x1051('0x53')]);_0x4ebe5b[_0x1051('0x54')]=qs['filters'](_[_0x1051('0x55')](_0x2559d6[_0x1051('0x4a')],_0x11b1fc[_0x1051('0x4b')]));if(_0x2559d6[_0x1051('0x4a')][_0x1051('0x56')]){_0x4ebe5b[_0x1051('0x54')]=_['merge'](_0x4ebe5b[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x4ebe5b[_0x1051('0x4d')],function(_0x366473){var _0x1d6658={};_0x1d6658[_0x366473]={'$like':'%'+_0x2559d6[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x1d6658;})});}_0x4ebe5b=_[_0x1051('0x57')]({},_0x4ebe5b,_0x2559d6[_0x1051('0x59')]);return _0x1a41f8[_0x1051('0x93')](_0x4ebe5b);}})[_0x1051('0x10')](function(_0x4d5edc){if(_0x4d5edc){_0xf706b3=_0x4d5edc[_0x1051('0x4f')];if(!_0x2559d6[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x4ebe5b[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x2559d6[_0x1051('0x4a')]['limit']);_0x4ebe5b['offset']=qs[_0x1051('0x1e')](_0x2559d6[_0x1051('0x4a')]['offset']);}return _0x1a41f8['getApplications'](_0x4ebe5b);}})[_0x1051('0x10')](function(_0x3a0aa1){if(_0x3a0aa1){return _0x3a0aa1?{'count':_0xf706b3,'rows':_0x3a0aa1}:null;}})['then'](respondWithResult(_0x1db0ac,null))[_0x1051('0x1a')](handleError(_0x1db0ac,null));};exports[_0x1051('0x94')]=function(_0x38bd49,_0x269d2b){var _0x232529={'raw':!![],'where':{}};var _0x2714f6={};var _0x1a6c27={'count':0x0,'rows':[]};return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x38bd49['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x269d2b,null))['then'](function(_0x1908d2){if(_0x1908d2){_0x2714f6[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x95')]['rawAttributes']);_0x2714f6[_0x1051('0x4a')]=_[_0x1051('0x49')](_0x38bd49['query']);_0x2714f6[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x2714f6[_0x1051('0x48')],_0x2714f6[_0x1051('0x4a')]);_0x232529[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x2714f6['model'],qs[_0x1051('0x4e')](_0x38bd49[_0x1051('0x4a')]['fields']));_0x232529[_0x1051('0x4d')]=_0x232529['attributes']['length']?_0x232529[_0x1051('0x4d')]:_0x2714f6[_0x1051('0x48')];if(!_0x38bd49['query'][_0x1051('0x50')](_0x1051('0x51'))){_0x232529[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x38bd49[_0x1051('0x4a')]['limit']);_0x232529[_0x1051('0x1e')]=qs['offset'](_0x38bd49[_0x1051('0x4a')]['offset']);}_0x232529[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x38bd49[_0x1051('0x4a')][_0x1051('0x53')]);_0x232529[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0x38bd49[_0x1051('0x4a')],_0x2714f6[_0x1051('0x4b')]));_0x232529[_0x1051('0x54')][_0x1051('0x65')]=_0x1908d2['id'];if(_0x38bd49[_0x1051('0x4a')][_0x1051('0x56')]){_0x232529[_0x1051('0x54')]=_[_0x1051('0x57')](_0x232529[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x232529['attributes'],function(_0x174808){var _0x504d8b={};_0x504d8b[_0x174808]={'$like':'%'+_0x38bd49[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x504d8b;})});}if(_0x38bd49[_0x1051('0x4a')][_0x1051('0x96')]){var _0x361b8b=_0x38bd49[_0x1051('0x4a')][_0x1051('0x96')][_0x1051('0x97')](',');var _0x33ea60={};_0x33ea60[_0x361b8b[0x0]]={'$gte':moment(_0x361b8b[0x1])['format'](_0x1051('0x98'))};_0x232529[_0x1051('0x54')]=_[_0x1051('0x57')](_0x232529['where'],_0x33ea60);}_0x232529=_['merge']({},_0x232529,_0x38bd49[_0x1051('0x59')]);return db['MailMessage'][_0x1051('0x20')]({'where':_0x232529['where']})['then'](function(_0x588643){_0x1a6c27['count']=_0x588643;if(_0x38bd49['query'][_0x1051('0x5a')]){_0x232529[_0x1051('0x5b')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x232529);})[_0x1051('0x10')](function(_0xdda736){if(_0x38bd49[_0x1051('0x4a')]['inlineCss']===_0x1051('0x99')){for(var _0x5db9b9=0x0;_0x5db9b9<_0xdda736[_0x1051('0x4f')];_0x5db9b9++){_0xdda736[_0x5db9b9][_0x1051('0x60')]=juice(_0xdda736[_0x5db9b9]['body']);}}_0x1a6c27[_0x1051('0x5c')]=_0xdda736;return _0x1a6c27;});}})[_0x1051('0x10')](respondWithFilteredResult(_0x269d2b,_0x232529))[_0x1051('0x1a')](handleError(_0x269d2b,null));};exports[_0x1051('0x29')]=function(_0x19547b,_0x354957){var _0x4a1983,_0x100f73={},_0x93e7d6;if(_0x19547b[_0x1051('0x60')]['to']){_0x93e7d6=_0x19547b[_0x1051('0x60')]['to']['split'](',')[0x0];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x19547b[_0x1051('0x5e')]['id']},'include':[{'model':db[_0x1051('0x9a')],'as':_0x1051('0x9b'),'include':[{'model':db['CmContact'],'as':_0x1051('0x9c'),'where':{'email':_0x93e7d6},'limit':0x1,'order':[['updatedAt',_0x1051('0x9d')]]}]},{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x1051('0x10')](handleEntityNotFound(_0x354957,null))['then'](function(_0x1254fd){if(!_0x1254fd)return;_0x4a1983=_0x1254fd;if(!_0x1254fd['Smtp'])throw new Error(_0x1051('0x9e'));if(_['isNil'](_0x19547b['body'][_0x1051('0x9f')])){_0x19547b['body'][_0x1051('0x9f')]=util[_0x1051('0xa0')](_0x1051('0xa1'),_0x1254fd[_0x1051('0x28')],_0x1254fd[_0x1051('0x70')]||_0x1254fd[_0x1051('0x3f')][_0x1051('0x34')]);}if(_0x19547b['body'][_0x1051('0xa2')]&&_0x19547b[_0x1051('0x60')]['attachments'][_0x1051('0x4f')]){for(var _0x288722=0x0;_0x288722<_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x1051('0x4f')];_0x288722+=0x1){_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x288722]={'filename':_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x288722]['name'],'path':path[_0x1051('0xa3')](config[_0x1051('0xa4')],_0x1051('0xa5'),_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x288722][_0x1051('0xa6')])};}}var _0x4fa89f=_0x1254fd['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x1051('0xa7'),{'account':_0x4fa89f,'message':_0x19547b[_0x1051('0x60')]});})[_0x1051('0x10')](function(_0x33945e){if(!_0x33945e)return;_0x100f73=_0x33945e;if(!_0x4a1983[_0x1051('0x9b')])throw new Error(_0x1051('0xa8'));if(_0x4a1983[_0x1051('0x9b')][_0x1051('0x9c')][_0x1051('0x4f')])return _0x4a1983['List']['Contacts'][0x0];return db[_0x1051('0x81')]['create'](_['defaults'](_0x19547b[_0x1051('0x60')],{'firstName':_0x19547b[_0x1051('0x60')]['to'],'email':_0x19547b[_0x1051('0x60')]['to'],'phone':_0x19547b[_0x1051('0x60')]['to'],'ListId':_0x4a1983[_0x1051('0xa9')]}));})['then'](function(_0x2e311d){if(!_0x2e311d)return;var _0x4c3a2a={'UserId':_0x19547b[_0x1051('0x34')]['id'],'ContactId':_0x2e311d['id'],'MailAccountId':_0x4a1983['id'],'inReplyTo':_0x100f73[_0x1051('0xaa')],'to':_0x19547b[_0x1051('0x60')][_0x1051('0x9f')],'cc':_0x19547b[_0x1051('0x60')]['cc'],'subject':_0x19547b[_0x1051('0x60')][_0x1051('0xab')],'attach':_0x19547b[_0x1051('0x60')][_0x1051('0xac')],'firstMsgDirection':_0x1051('0xad'),'lastMsgAt':moment()[_0x1051('0xa0')](_0x1051('0x98')),'lastMsgDirection':'out','Messages':[_['merge'](_0x19547b[_0x1051('0x60')],{'messageId':_0x100f73[_0x1051('0xaa')],'sentAt':moment()['format'](_0x1051('0x98')),'read':!![],'MailAccountId':_0x4a1983['id'],'UserId':_0x19547b[_0x1051('0x34')]['id'],'ContactId':_0x2e311d['id']})]};if(_0x19547b[_0x1051('0x60')][_0x1051('0xae')]){_0x4c3a2a=_[_0x1051('0x57')](_0x4c3a2a,_0x19547b[_0x1051('0x60')][_0x1051('0xae')]);}return db['MailInteraction'][_0x1051('0x67')](_0x4c3a2a,{'include':[{'model':db['MailMessage'],'as':_0x1051('0xaf')}]});})[_0x1051('0x10')](respondWithResult(_0x354957,null))[_0x1051('0x1a')](handleError(_0x354957,null));};exports['verifySmtp']=function(_0x597187,_0xf71d56){return db['MailAccount'][_0x1051('0x62')]({'where':{'id':_0x597187[_0x1051('0x5e')]['id']},'include':[{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1051('0xb0'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0xf71d56,null))['then'](function(_0x56203b){if(!_0x56203b[_0x1051('0x3f')])return;var _0x48248b=_0x56203b[_0x1051('0xb1')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x48248b});})[_0x1051('0x10')](respondWithResult(_0xf71d56,null))['catch'](handleError(_0xf71d56,null));};exports['destroy']=function(_0x606ab7,_0x236d68){return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x606ab7[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x236d68,null))[_0x1051('0x10')](function(_0x441296){if(_0x441296&&_0x441296[_0x1051('0x3b')]){throw new db['Sequelize'][(_0x1051('0xb2'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x441296;})[_0x1051('0x10')](removeEntity(_0x236d68,null))[_0x1051('0x1a')](handleError(_0x236d68,null));};exports[_0x1051('0xb3')]=function(_0x5adf9c,_0x43a252){return db[_0x1051('0x44')]['find']({'where':{'id':_0x5adf9c['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x43a252,null))['then'](function(_0x1ba58a){if(_0x1ba58a){return _0x1ba58a[_0x1051('0xb3')](_0x5adf9c[_0x1051('0x60')][_0x1051('0x6b')],_[_0x1051('0x7f')](_0x5adf9c[_0x1051('0x60')],['ids','id'])||{})[_0x1051('0xb4')](function(_0x5a733f){for(var _0x1edb55=0x0;_0x1edb55<_0x5adf9c[_0x1051('0x60')][_0x1051('0x6b')][_0x1051('0x4f')];_0x1edb55+=0x1){socket[_0x1051('0xb5')](_0x1051('0xb6'),{'UserId':Number(_0x5adf9c[_0x1051('0x60')]['ids'][_0x1edb55]),'MailAccountId':Number(_0x5adf9c[_0x1051('0x5e')]['id'])});}return _0x5a733f;});}})[_0x1051('0x10')](respondWithResult(_0x43a252,null))['catch'](handleError(_0x43a252,null));};exports[_0x1051('0xb7')]=function(_0x517be5,_0x53a801){return db['MailAccount']['find']({'where':{'id':_0x517be5[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x53a801,null))[_0x1051('0x10')](function(_0x4f8785){if(_0x4f8785){return _0x4f8785['removeAgents'](_0x517be5[_0x1051('0x4a')][_0x1051('0x6b')])['then'](function(){if(_[_0x1051('0xb8')](_0x517be5[_0x1051('0x4a')][_0x1051('0x6b')])){for(var _0x171306=0x0;_0x171306<_0x517be5['query'][_0x1051('0x6b')]['length'];_0x171306+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x517be5[_0x1051('0x4a')]['ids'][_0x171306]),'MailAccountId':Number(_0x517be5[_0x1051('0x5e')]['id'])});}}else{socket['emit'](_0x1051('0xb9'),{'UserId':Number(_0x517be5['query']['ids']),'MailAccountId':Number(_0x517be5['params']['id'])});}});}})[_0x1051('0x10')](respondWithStatusCode(_0x53a801,null))[_0x1051('0x1a')](handleError(_0x53a801,null));};exports[_0x1051('0xba')]=function(_0xec5813,_0x258d7f){var _0x1157d7={};var _0x2dcd0d={};var _0x2ecb97;var _0x504bc0;return db['MailAccount'][_0x1051('0x69')]({'where':{'id':_0xec5813['params']['id']}})['then'](handleEntityNotFound(_0x258d7f,null))[_0x1051('0x10')](function(_0x3d2ce1){if(_0x3d2ce1){_0x2ecb97=_0x3d2ce1;_0x2dcd0d[_0x1051('0x48')]=_['keys'](db[_0x1051('0x82')][_0x1051('0x45')]);_0x2dcd0d['query']=_[_0x1051('0x49')](_0xec5813[_0x1051('0x4a')]);_0x2dcd0d[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x2dcd0d['model'],_0x2dcd0d['query']);_0x1157d7[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x2dcd0d[_0x1051('0x48')],qs[_0x1051('0x4e')](_0xec5813[_0x1051('0x4a')]['fields']));_0x1157d7[_0x1051('0x4d')]=_0x1157d7[_0x1051('0x4d')][_0x1051('0x4f')]?_0x1157d7[_0x1051('0x4d')]:_0x2dcd0d[_0x1051('0x48')];_0x1157d7[_0x1051('0x52')]=qs['sort'](_0xec5813['query']['sort']);_0x1157d7[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0xec5813[_0x1051('0x4a')],_0x2dcd0d['filters']));if(_0xec5813['query'][_0x1051('0x56')]){_0x1157d7['where']=_['merge'](_0x1157d7[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x1157d7['attributes'],function(_0x33f403){var _0x3b767a={};_0x3b767a[_0x33f403]={'$like':'%'+_0xec5813[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x3b767a;})});}_0x1157d7=_['merge']({},_0x1157d7,_0xec5813[_0x1051('0x59')]);return _0x2ecb97[_0x1051('0xba')](_0x1157d7);}})[_0x1051('0x10')](function(_0x37cc71){if(_0x37cc71){_0x504bc0=_0x37cc71[_0x1051('0x4f')];if(!_0xec5813[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x1157d7['limit']=qs[_0x1051('0x21')](_0xec5813[_0x1051('0x4a')][_0x1051('0x21')]);_0x1157d7[_0x1051('0x1e')]=qs[_0x1051('0x1e')](_0xec5813[_0x1051('0x4a')][_0x1051('0x1e')]);}return _0x2ecb97['getAgents'](_0x1157d7);}})[_0x1051('0x10')](function(_0x4ce257){if(_0x4ce257){return _0x4ce257?{'count':_0x504bc0,'rows':_0x4ce257}:null;}})[_0x1051('0x10')](respondWithResult(_0x258d7f,null))[_0x1051('0x1a')](handleError(_0x258d7f,null));}; \ No newline at end of file +var _0xe7a7=['MailAccount','fieldName','type','key','model','filters','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','show','params','keys','rawAttributes','intersection','length','includeAll','options','find','body','provider','secure','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','create','getDispositions','pick','MailAccountId','rows','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','custom','email','ListId','isNil','active','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','getInteractions','User','Owner','fullname','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','send','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','List','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','attach','out','Interaction','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','update','destroy','get','MailAccounts','UserProfileResource','stack','name','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','Unknown\x20email\x20service\x20provider','gmail','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map'];(function(_0x28193e,_0x5427ec){var _0x49764e=function(_0x205c52){while(--_0x205c52){_0x28193e['push'](_0x28193e['shift']());}};_0x49764e(++_0x5427ec);}(_0xe7a7,0x1f1));var _0x7e7a=function(_0x3373aa,_0x38bb93){_0x3373aa=_0x3373aa-0x0;var _0x401426=_0xe7a7[_0x3373aa];return _0x401426;};'use strict';var moment=require(_0x7e7a('0x0'));var BPromise=require(_0x7e7a('0x1'));var util=require(_0x7e7a('0x2'));var path=require('path');var _=require(_0x7e7a('0x3'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x7e7a('0x4'));var logger=require(_0x7e7a('0x5'))(_0x7e7a('0x6'));var config=require('../../config/environment');var db=require(_0x7e7a('0x7'))['db'];config[_0x7e7a('0x8')]=_['defaults'](config[_0x7e7a('0x8')],{'host':_0x7e7a('0x9'),'port':0x18eb});var socket=require(_0x7e7a('0xa'))(new Redis(config[_0x7e7a('0x8')]));require(_0x7e7a('0xb'))[_0x7e7a('0xc')](socket);var jayson=require(_0x7e7a('0xd'));var client=jayson[_0x7e7a('0xe')][_0x7e7a('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x520cb4,_0x2580ee,_0xcbd2db,_0x411b9b){return new BPromise(function(_0x2e870c,_0x1e17ba){var _0x5caa60=_0x411b9b||client;return _0x5caa60[_0x7e7a('0x10')](_0x520cb4,_0xcbd2db)[_0x7e7a('0x11')](function(_0x48f2c1){logger[_0x7e7a('0x12')](_0x7e7a('0x13'),_0x2580ee,_0x7e7a('0x14'));logger[_0x7e7a('0x15')](_0x7e7a('0x16'),_0x2580ee,_0x7e7a('0x14'),JSON[_0x7e7a('0x17')](_0x48f2c1));if(_0x48f2c1['error']){if(_0x48f2c1[_0x7e7a('0x18')]['code']===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x2580ee,_0x48f2c1[_0x7e7a('0x18')][_0x7e7a('0x19')]);return _0x1e17ba(_0x48f2c1[_0x7e7a('0x18')][_0x7e7a('0x19')]);}logger['error'](_0x7e7a('0x13'),_0x2580ee,_0x48f2c1[_0x7e7a('0x18')][_0x7e7a('0x19')]);return _0x2e870c(_0x48f2c1[_0x7e7a('0x18')]['message']);}else{logger[_0x7e7a('0x12')]('MailAccount,\x20%s,\x20%s',_0x2580ee,_0x7e7a('0x14'));_0x2e870c(_0x48f2c1[_0x7e7a('0x1a')][_0x7e7a('0x19')]);}})[_0x7e7a('0x1b')](function(_0x113acb){logger['error'](_0x7e7a('0x13'),_0x2580ee,_0x113acb);_0x1e17ba(_0x113acb);});});}function respondWithStatusCode(_0xcb399a,_0x5bccd8){_0x5bccd8=_0x5bccd8||0xcc;return function(_0x5ef430){if(_0x5ef430){return _0xcb399a[_0x7e7a('0x1c')](_0x5bccd8);}return _0xcb399a['status'](_0x5bccd8)[_0x7e7a('0x1d')]();};}function respondWithResult(_0xebcbfb,_0x4875cb){_0x4875cb=_0x4875cb||0xc8;return function(_0x191b57){if(_0x191b57){return _0xebcbfb[_0x7e7a('0x1e')](_0x4875cb)[_0x7e7a('0x1f')](_0x191b57);}};}function respondWithFilteredResult(_0x42bc84,_0x2b4549){return function(_0x5d400b){if(_0x5d400b){var _0xc6bcfd=typeof _0x2b4549[_0x7e7a('0x20')]===_0x7e7a('0x21')&&typeof _0x2b4549[_0x7e7a('0x22')]==='undefined';var _0x57a8ce=_0x5d400b[_0x7e7a('0x23')];var _0x5d2f43=_0xc6bcfd?0x0:_0x2b4549['offset'];var _0x32ed72=_0xc6bcfd?_0x5d400b[_0x7e7a('0x23')]:_0x2b4549[_0x7e7a('0x20')]+_0x2b4549[_0x7e7a('0x22')];var _0x15d4fb;if(_0x32ed72>=_0x57a8ce){_0x32ed72=_0x57a8ce;_0x15d4fb=0xc8;}else{_0x15d4fb=0xce;}_0x42bc84[_0x7e7a('0x1e')](_0x15d4fb);return _0x42bc84['set']('Content-Range',_0x5d2f43+'-'+_0x32ed72+'/'+_0x57a8ce)[_0x7e7a('0x1f')](_0x5d400b);}return null;};}function saveUpdates(_0x24e477){return function(_0xf0f0e0){if(_0xf0f0e0){return _0xf0f0e0[_0x7e7a('0x24')](_0x24e477)[_0x7e7a('0x11')](function(_0x333af8){return _0x333af8;});}return null;};}function removeEntity(_0x110d8e){return function(_0x5772d0){if(_0x5772d0){return _0x5772d0[_0x7e7a('0x25')]()[_0x7e7a('0x11')](function(){var _0x15851b=_0x5772d0[_0x7e7a('0x26')]({'plain':!![]});var _0x3850a1=_0x7e7a('0x27');return db[_0x7e7a('0x28')][_0x7e7a('0x25')]({'where':{'type':_0x3850a1,'resourceId':_0x15851b['id']}})[_0x7e7a('0x11')](function(){return _0x5772d0;});})[_0x7e7a('0x11')](function(){_0x110d8e[_0x7e7a('0x1e')](0xcc)[_0x7e7a('0x1d')]();});}};}function handleEntityNotFound(_0x94cbb2){return function(_0xac6d94){if(!_0xac6d94){_0x94cbb2['sendStatus'](0x194);}return _0xac6d94;};}function handleError(_0x3d63d7,_0x11c0c1){_0x11c0c1=_0x11c0c1||0x1f4;return function(_0x283a25){logger['error'](_0x283a25[_0x7e7a('0x29')]);if(_0x283a25[_0x7e7a('0x2a')]){delete _0x283a25[_0x7e7a('0x2a')];}_0x3d63d7['status'](_0x11c0c1)['send'](_0x283a25);};}function getImapHost(_0xb8e837){switch(_0xb8e837){case'gmail':return _0x7e7a('0x2b');case _0x7e7a('0x2c'):return _0x7e7a('0x2d');case _0x7e7a('0x2e'):return'imap-mail.outlook.com';case _0x7e7a('0x2f'):return'outlook.office365.com';}throw new Error(_0x7e7a('0x30'),_0xb8e837);}function getSmtpHost(_0x4c40ea){switch(_0x4c40ea){case _0x7e7a('0x31'):return'smtp.gmail.com';case _0x7e7a('0x2c'):return _0x7e7a('0x32');case _0x7e7a('0x2e'):return _0x7e7a('0x33');case _0x7e7a('0x2f'):return'smtp.office365.com';}throw new Error(_0x7e7a('0x30'),_0x4c40ea);}function getAuthenticationOptions(_0x1eebac,_0x4003f9){var _0x476a85={};var _0x1934c3={};if(_0x1eebac){_0x476a85[_0x7e7a('0x34')]=_0x1934c3[_0x7e7a('0x34')]=_0x4003f9[_0x7e7a('0x35')];_0x476a85[_0x7e7a('0x36')]=_0x1934c3[_0x7e7a('0x37')]=_0x4003f9[_0x7e7a('0x36')];if(_0x4003f9[_0x7e7a('0x38')]){_0x476a85[_0x7e7a('0x38')]=_0x1934c3['modernAuthentication']=!![];_0x476a85[_0x7e7a('0x39')]=_0x1934c3[_0x7e7a('0x39')]=_0x4003f9['CloudProviderId'];_0x476a85[_0x7e7a('0x36')]=_0x1934c3[_0x7e7a('0x37')]=null;}else{_0x476a85[_0x7e7a('0x39')]=_0x1934c3[_0x7e7a('0x39')]=null;}_0x476a85[_0x7e7a('0x3a')]=getImapHost(_0x1eebac);_0x476a85[_0x7e7a('0x3b')]=0x3e1;_0x1934c3[_0x7e7a('0x3a')]=getSmtpHost(_0x1eebac);_0x1934c3['port']=0x24b;_0x1934c3['secure']=![];_0x476a85[_0x7e7a('0x3c')]=_0x1934c3['service']=null;}else{if(_0x4003f9[_0x7e7a('0x3d')]){_0x476a85[_0x7e7a('0x34')]=_0x1934c3['user']=_0x4003f9[_0x7e7a('0x35')];_0x476a85[_0x7e7a('0x36')]=_0x1934c3[_0x7e7a('0x37')]=_0x4003f9[_0x7e7a('0x36')];}else{_0x476a85[_0x7e7a('0x3d')]=_0x1934c3['authentication']=![];_0x476a85[_0x7e7a('0x34')]=_0x1934c3[_0x7e7a('0x34')]=null;_0x476a85[_0x7e7a('0x36')]=_0x1934c3[_0x7e7a('0x37')]=null;}_0x476a85['host']=_0x4003f9['Imap']['host'];_0x476a85[_0x7e7a('0x3b')]=_0x4003f9[_0x7e7a('0x3e')][_0x7e7a('0x3b')];_0x1934c3['host']=_0x4003f9[_0x7e7a('0x3f')][_0x7e7a('0x3a')];_0x1934c3[_0x7e7a('0x3b')]=_0x4003f9[_0x7e7a('0x3f')][_0x7e7a('0x3b')];}return{'Imap':_0x476a85,'Smtp':_0x1934c3};}exports[_0x7e7a('0x40')]=function(_0x1f4398,_0x35ec5c){var _0x306995={'include':[{'model':db[_0x7e7a('0x41')],'as':_0x7e7a('0x3e')},{'model':db[_0x7e7a('0x42')],'as':'Smtp'},{'model':db[_0x7e7a('0x43')],'as':_0x7e7a('0x44')}]},_0x1e6a2c={},_0x47f5d9={'count':0x0,'rows':[]};var _0xf02d41=_[_0x7e7a('0x45')](db[_0x7e7a('0x46')]['rawAttributes'],function(_0x29fa35){return{'name':_0x29fa35[_0x7e7a('0x47')],'type':_0x29fa35[_0x7e7a('0x48')][_0x7e7a('0x49')]};});_0x1e6a2c[_0x7e7a('0x4a')]=_[_0x7e7a('0x45')](_0xf02d41,'name');_0x1e6a2c['query']=_['keys'](_0x1f4398['query']);_0x1e6a2c[_0x7e7a('0x4b')]=_['intersection'](_0x1e6a2c['model'],_0x1e6a2c[_0x7e7a('0x4c')]);_0x306995[_0x7e7a('0x4d')]=_['intersection'](_0x1e6a2c[_0x7e7a('0x4a')],qs[_0x7e7a('0x4e')](_0x1f4398[_0x7e7a('0x4c')][_0x7e7a('0x4e')]));_0x306995[_0x7e7a('0x4d')]=_0x306995[_0x7e7a('0x4d')]['length']?_0x306995['attributes']:_0x1e6a2c[_0x7e7a('0x4a')];if(!_0x1f4398[_0x7e7a('0x4c')][_0x7e7a('0x4f')](_0x7e7a('0x50'))){_0x306995['limit']=qs['limit'](_0x1f4398[_0x7e7a('0x4c')][_0x7e7a('0x22')]);_0x306995[_0x7e7a('0x20')]=qs['offset'](_0x1f4398['query'][_0x7e7a('0x20')]);}_0x306995[_0x7e7a('0x51')]=qs[_0x7e7a('0x52')](_0x1f4398[_0x7e7a('0x4c')]['sort']);_0x306995[_0x7e7a('0x53')]=qs[_0x7e7a('0x4b')](_['pick'](_0x1f4398[_0x7e7a('0x4c')],_0x1e6a2c[_0x7e7a('0x4b')]),_0xf02d41);if(_0x1f4398[_0x7e7a('0x4c')][_0x7e7a('0x54')]){_0x306995[_0x7e7a('0x53')]=_[_0x7e7a('0x55')](_0x306995[_0x7e7a('0x53')],{'$or':_[_0x7e7a('0x45')](_0xf02d41,function(_0x3d6332){if(_0x3d6332[_0x7e7a('0x48')]!==_0x7e7a('0x56')){var _0x2d5dab={};_0x2d5dab[_0x3d6332[_0x7e7a('0x2a')]]={'$like':'%'+_0x1f4398[_0x7e7a('0x4c')][_0x7e7a('0x54')]+'%'};return _0x2d5dab;}})});}_0x306995=_[_0x7e7a('0x55')]({},_0x306995,_0x1f4398['options']);var _0x11940c={'where':_0x306995['where']};return db[_0x7e7a('0x46')][_0x7e7a('0x23')](_0x11940c)[_0x7e7a('0x11')](function(_0x2f4dda){_0x47f5d9['count']=_0x2f4dda;if(_0x1f4398['query']['includeAll']){_0x306995[_0x7e7a('0x57')]=[{'all':!![]}];}return db[_0x7e7a('0x46')][_0x7e7a('0x58')](_0x306995);})['then'](function(_0x19ee65){_0x47f5d9['rows']=_0x19ee65;return _0x47f5d9;})[_0x7e7a('0x11')](respondWithFilteredResult(_0x35ec5c,_0x306995))[_0x7e7a('0x1b')](handleError(_0x35ec5c,null));};exports[_0x7e7a('0x59')]=function(_0x26a030,_0x550afa){var _0x257bcf={'raw':![],'where':{'id':_0x26a030[_0x7e7a('0x5a')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x7e7a('0x42')],'as':_0x7e7a('0x3f')},{'model':db[_0x7e7a('0x43')],'as':_0x7e7a('0x44')}]},_0x53e031={};_0x53e031[_0x7e7a('0x4a')]=_[_0x7e7a('0x5b')](db[_0x7e7a('0x46')][_0x7e7a('0x5c')]);_0x53e031[_0x7e7a('0x4c')]=_[_0x7e7a('0x5b')](_0x26a030['query']);_0x53e031['filters']=_['intersection'](_0x53e031[_0x7e7a('0x4a')],_0x53e031[_0x7e7a('0x4c')]);_0x257bcf[_0x7e7a('0x4d')]=_[_0x7e7a('0x5d')](_0x53e031[_0x7e7a('0x4a')],qs['fields'](_0x26a030['query'][_0x7e7a('0x4e')]));_0x257bcf['attributes']=_0x257bcf[_0x7e7a('0x4d')][_0x7e7a('0x5e')]?_0x257bcf['attributes']:_0x53e031[_0x7e7a('0x4a')];if(_0x26a030[_0x7e7a('0x4c')][_0x7e7a('0x5f')]){_0x257bcf[_0x7e7a('0x57')]=[{'all':!![]}];}_0x257bcf=_[_0x7e7a('0x55')]({},_0x257bcf,_0x26a030[_0x7e7a('0x60')]);return db['MailAccount'][_0x7e7a('0x61')](_0x257bcf)[_0x7e7a('0x11')](handleEntityNotFound(_0x550afa,null))[_0x7e7a('0x11')](respondWithResult(_0x550afa,null))[_0x7e7a('0x1b')](handleError(_0x550afa,null));};exports[_0x7e7a('0x24')]=function(_0x16f977,_0x40e5e4){if(_0x16f977[_0x7e7a('0x62')]['id']){delete _0x16f977['body']['id'];}var _0x310df1=_0x16f977[_0x7e7a('0x62')][_0x7e7a('0x63')]==='custom'?null:_0x16f977[_0x7e7a('0x62')]['provider'];var _0x15edf6=_0x16f977[_0x7e7a('0x62')][_0x7e7a('0x3e')]||{};var _0x497114=_0x16f977[_0x7e7a('0x62')][_0x7e7a('0x3f')]||{};if(_0x310df1){_0x15edf6[_0x7e7a('0x3a')]=getImapHost(_0x310df1);_0x15edf6[_0x7e7a('0x3b')]=0x3e1;_0x497114[_0x7e7a('0x3a')]=getSmtpHost(_0x310df1);_0x497114[_0x7e7a('0x3b')]=0x24b;_0x497114[_0x7e7a('0x64')]=![];}if(_0x497114['modernAuthentication']){_0x497114[_0x7e7a('0x64')]=![];}else{_0x497114[_0x7e7a('0x39')]=null;}if(!_0x15edf6[_0x7e7a('0x38')])_0x15edf6[_0x7e7a('0x39')]=null;_0x16f977[_0x7e7a('0x62')]['Imap']=_0x15edf6;_0x16f977[_0x7e7a('0x62')][_0x7e7a('0x3f')]=_0x497114;return db[_0x7e7a('0x46')][_0x7e7a('0x61')]({'where':{'id':_0x16f977[_0x7e7a('0x5a')]['id']},'include':[{'model':db[_0x7e7a('0x41')],'as':_0x7e7a('0x3e')},{'model':db[_0x7e7a('0x42')],'as':'Smtp'},{'model':db[_0x7e7a('0x43')],'as':_0x7e7a('0x44')}]})[_0x7e7a('0x11')](handleEntityNotFound(_0x40e5e4,null))['then'](function(_0x57c576){if(!_0x57c576)throw new Error(_0x7e7a('0x65'));if(_0x57c576[_0x7e7a('0x3c')])delete _0x16f977['body']['Imap'];return _0x57c576;})[_0x7e7a('0x11')](saveUpdates(_0x16f977[_0x7e7a('0x62')],null))[_0x7e7a('0x11')](function(_0x5b04e1){if(!_0x16f977[_0x7e7a('0x62')][_0x7e7a('0x3e')])return _0x5b04e1;return db[_0x7e7a('0x41')][_0x7e7a('0x24')](_0x16f977[_0x7e7a('0x62')][_0x7e7a('0x3e')],{'where':{'MailAccountId':_0x5b04e1['id']}})['then'](function(){return _0x5b04e1;});})[_0x7e7a('0x11')](function(_0x496a43){if(!_0x16f977['body'][_0x7e7a('0x3f')])return _0x496a43;return db[_0x7e7a('0x42')][_0x7e7a('0x24')](_0x16f977['body'][_0x7e7a('0x3f')],{'where':{'MailAccountId':_0x496a43['id']}})[_0x7e7a('0x11')](function(){return _0x496a43;});})[_0x7e7a('0x11')](respondWithResult(_0x40e5e4,null))[_0x7e7a('0x1b')](handleError(_0x40e5e4,null));};exports[_0x7e7a('0x66')]=function(_0x250497,_0x45ea4f){return db[_0x7e7a('0x46')]['describe']()['then'](respondWithResult(_0x45ea4f,null))[_0x7e7a('0x1b')](handleError(_0x45ea4f,null));};exports[_0x7e7a('0x67')]=function(_0xcac55a,_0x43952b){if(_0xcac55a[_0x7e7a('0x62')]['id']){delete _0xcac55a['body']['id'];}return db['MailAccount'][_0x7e7a('0x61')]({'where':{'id':_0xcac55a[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x43952b,null))[_0x7e7a('0x11')](function(_0x2ff233){if(_0x2ff233){_0xcac55a[_0x7e7a('0x62')]['MailAccountId']=_0x2ff233['id'];return db[_0x7e7a('0x68')][_0x7e7a('0x69')](_0xcac55a[_0x7e7a('0x62')]);}})[_0x7e7a('0x11')](respondWithResult(_0x43952b,null))[_0x7e7a('0x1b')](handleError(_0x43952b,null));};exports[_0x7e7a('0x6a')]=function(_0x16993b,_0x1dd2f9){var _0x56a56b={'raw':![],'where':{}};var _0x4069cf={};var _0x2faef1={'count':0x0,'rows':[]};return db[_0x7e7a('0x46')]['findOne']({'where':{'id':_0x16993b[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x1dd2f9,null))[_0x7e7a('0x11')](function(_0xc72eae){if(_0xc72eae){_0x4069cf[_0x7e7a('0x4a')]=_[_0x7e7a('0x5b')](db[_0x7e7a('0x68')]['rawAttributes']);_0x4069cf[_0x7e7a('0x4c')]=_[_0x7e7a('0x5b')](_0x16993b[_0x7e7a('0x4c')]);_0x4069cf[_0x7e7a('0x4b')]=_[_0x7e7a('0x5d')](_0x4069cf[_0x7e7a('0x4a')],_0x4069cf[_0x7e7a('0x4c')]);_0x56a56b[_0x7e7a('0x4d')]=_[_0x7e7a('0x5d')](_0x4069cf[_0x7e7a('0x4a')],qs[_0x7e7a('0x4e')](_0x16993b['query'][_0x7e7a('0x4e')]));_0x56a56b[_0x7e7a('0x4d')]=_0x56a56b['attributes'][_0x7e7a('0x5e')]?_0x56a56b[_0x7e7a('0x4d')]:_0x4069cf[_0x7e7a('0x4a')];if(!_0x16993b[_0x7e7a('0x4c')]['hasOwnProperty'](_0x7e7a('0x50'))){_0x56a56b[_0x7e7a('0x22')]=qs[_0x7e7a('0x22')](_0x16993b[_0x7e7a('0x4c')][_0x7e7a('0x22')]);_0x56a56b[_0x7e7a('0x20')]=qs['offset'](_0x16993b[_0x7e7a('0x4c')][_0x7e7a('0x20')]);}_0x56a56b['order']=qs[_0x7e7a('0x52')](_0x16993b[_0x7e7a('0x4c')]['sort']);_0x56a56b[_0x7e7a('0x53')]=qs[_0x7e7a('0x4b')](_[_0x7e7a('0x6b')](_0x16993b[_0x7e7a('0x4c')],_0x4069cf['filters']));_0x56a56b[_0x7e7a('0x53')][_0x7e7a('0x6c')]=_0xc72eae['id'];if(_0x16993b[_0x7e7a('0x4c')]['filter']){_0x56a56b[_0x7e7a('0x53')]=_[_0x7e7a('0x55')](_0x56a56b[_0x7e7a('0x53')],{'$or':_[_0x7e7a('0x45')](_0x56a56b['attributes'],function(_0x5e29dc){var _0x15d791={};_0x15d791[_0x5e29dc]={'$like':'%'+_0x16993b[_0x7e7a('0x4c')]['filter']+'%'};return _0x15d791;})});}_0x56a56b=_['merge']({},_0x56a56b,_0x16993b['options']);return db['Disposition'][_0x7e7a('0x23')]({'where':_0x56a56b[_0x7e7a('0x53')]})[_0x7e7a('0x11')](function(_0xc35cc3){_0x2faef1[_0x7e7a('0x23')]=_0xc35cc3;if(_0x16993b[_0x7e7a('0x4c')][_0x7e7a('0x5f')]){_0x56a56b['include']=[{'all':!![]}];}return db[_0x7e7a('0x68')][_0x7e7a('0x58')](_0x56a56b);})[_0x7e7a('0x11')](function(_0x292a99){_0x2faef1[_0x7e7a('0x6d')]=_0x292a99;return _0x2faef1;});}})[_0x7e7a('0x11')](respondWithFilteredResult(_0x1dd2f9,_0x56a56b))[_0x7e7a('0x1b')](handleError(_0x1dd2f9,null));};exports[_0x7e7a('0x6e')]=function(_0x2e9162,_0x217bbc){return db[_0x7e7a('0x46')][_0x7e7a('0x61')]({'where':{'id':_0x2e9162[_0x7e7a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x217bbc,null))[_0x7e7a('0x11')](function(_0x3bd42e){if(_0x3bd42e){return _0x3bd42e[_0x7e7a('0x6e')](_0x2e9162['query'][_0x7e7a('0x6f')]);}})[_0x7e7a('0x11')](respondWithStatusCode(_0x217bbc,null))[_0x7e7a('0x1b')](handleError(_0x217bbc,null));};exports['addAnswer']=function(_0x308fc2,_0x1c0c1d){if(_0x308fc2[_0x7e7a('0x62')]['id']){delete _0x308fc2[_0x7e7a('0x62')]['id'];}return db[_0x7e7a('0x46')][_0x7e7a('0x61')]({'where':{'id':_0x308fc2[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x1c0c1d,null))[_0x7e7a('0x11')](function(_0x51aa04){if(_0x51aa04){_0x308fc2[_0x7e7a('0x62')][_0x7e7a('0x6c')]=_0x51aa04['id'];return db[_0x7e7a('0x70')][_0x7e7a('0x69')](_0x308fc2[_0x7e7a('0x62')]);}})[_0x7e7a('0x11')](respondWithResult(_0x1c0c1d,null))[_0x7e7a('0x1b')](handleError(_0x1c0c1d,null));};exports['getAnswers']=function(_0x425f0b,_0x4db26c){var _0x51070a={'raw':![],'where':{}};var _0x431212={};var _0x742194={'count':0x0,'rows':[]};return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0x425f0b[_0x7e7a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4db26c,null))[_0x7e7a('0x11')](function(_0x33a054){if(_0x33a054){_0x431212[_0x7e7a('0x4a')]=_[_0x7e7a('0x5b')](db[_0x7e7a('0x70')][_0x7e7a('0x5c')]);_0x431212[_0x7e7a('0x4c')]=_[_0x7e7a('0x5b')](_0x425f0b[_0x7e7a('0x4c')]);_0x431212[_0x7e7a('0x4b')]=_['intersection'](_0x431212[_0x7e7a('0x4a')],_0x431212[_0x7e7a('0x4c')]);_0x51070a['attributes']=_[_0x7e7a('0x5d')](_0x431212[_0x7e7a('0x4a')],qs[_0x7e7a('0x4e')](_0x425f0b[_0x7e7a('0x4c')][_0x7e7a('0x4e')]));_0x51070a[_0x7e7a('0x4d')]=_0x51070a['attributes']['length']?_0x51070a[_0x7e7a('0x4d')]:_0x431212[_0x7e7a('0x4a')];if(!_0x425f0b[_0x7e7a('0x4c')]['hasOwnProperty'](_0x7e7a('0x50'))){_0x51070a[_0x7e7a('0x22')]=qs[_0x7e7a('0x22')](_0x425f0b[_0x7e7a('0x4c')][_0x7e7a('0x22')]);_0x51070a['offset']=qs[_0x7e7a('0x20')](_0x425f0b['query'][_0x7e7a('0x20')]);}_0x51070a[_0x7e7a('0x51')]=qs[_0x7e7a('0x52')](_0x425f0b[_0x7e7a('0x4c')][_0x7e7a('0x52')]);_0x51070a[_0x7e7a('0x53')]=qs[_0x7e7a('0x4b')](_[_0x7e7a('0x6b')](_0x425f0b[_0x7e7a('0x4c')],_0x431212[_0x7e7a('0x4b')]));_0x51070a['where']['MailAccountId']=_0x33a054['id'];if(_0x425f0b[_0x7e7a('0x4c')][_0x7e7a('0x54')]){_0x51070a[_0x7e7a('0x53')]=_[_0x7e7a('0x55')](_0x51070a[_0x7e7a('0x53')],{'$or':_[_0x7e7a('0x45')](_0x51070a[_0x7e7a('0x4d')],function(_0x104e23){var _0x53ef4f={};_0x53ef4f[_0x104e23]={'$like':'%'+_0x425f0b[_0x7e7a('0x4c')][_0x7e7a('0x54')]+'%'};return _0x53ef4f;})});}_0x51070a=_[_0x7e7a('0x55')]({},_0x51070a,_0x425f0b[_0x7e7a('0x60')]);return db['CannedAnswer'][_0x7e7a('0x23')]({'where':_0x51070a['where']})[_0x7e7a('0x11')](function(_0x2e9266){_0x742194['count']=_0x2e9266;if(_0x425f0b[_0x7e7a('0x4c')][_0x7e7a('0x5f')]){_0x51070a['include']=[{'all':!![]}];}return db[_0x7e7a('0x70')][_0x7e7a('0x58')](_0x51070a);})[_0x7e7a('0x11')](function(_0x5d30d3){_0x742194[_0x7e7a('0x6d')]=_0x5d30d3;return _0x742194;});}})[_0x7e7a('0x11')](respondWithFilteredResult(_0x4db26c,_0x51070a))['catch'](handleError(_0x4db26c,null));};exports[_0x7e7a('0x72')]=function(_0x534d75,_0x4754d3){return db[_0x7e7a('0x46')][_0x7e7a('0x61')]({'where':{'id':_0x534d75[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x4754d3,null))[_0x7e7a('0x11')](function(_0x39f02a){if(_0x39f02a){return _0x39f02a['removeAnswers'](_0x534d75[_0x7e7a('0x4c')][_0x7e7a('0x6f')]);}})['then'](respondWithStatusCode(_0x4754d3,null))[_0x7e7a('0x1b')](handleError(_0x4754d3,null));};exports['create']=function(_0xbb2b14,_0x59fbb9){var _0x3ec43c={'name':_0xbb2b14[_0x7e7a('0x62')][_0x7e7a('0x2a')],'key':_0xbb2b14['body'][_0x7e7a('0x49')],'provider':_0xbb2b14[_0x7e7a('0x62')][_0x7e7a('0x63')]===_0x7e7a('0x73')?null:_0xbb2b14[_0x7e7a('0x62')][_0x7e7a('0x63')],'email':_0xbb2b14[_0x7e7a('0x62')][_0x7e7a('0x74')],'ListId':_0xbb2b14[_0x7e7a('0x62')][_0x7e7a('0x75')],'active':!_[_0x7e7a('0x76')](_0xbb2b14[_0x7e7a('0x62')][_0x7e7a('0x77')])?_0xbb2b14[_0x7e7a('0x62')]['active']:!![],'description':_0xbb2b14[_0x7e7a('0x62')]['description']||null};var _0x10a497=getAuthenticationOptions(_0x3ec43c['provider'],_0xbb2b14['body']);_0x3ec43c['Imap']=_0x10a497[_0x7e7a('0x3e')];_0x3ec43c[_0x7e7a('0x3f')]=_0x10a497[_0x7e7a('0x3f')];return db[_0x7e7a('0x46')][_0x7e7a('0x69')](_0x3ec43c,{'include':[{'model':db[_0x7e7a('0x42')],'as':'Smtp'},{'model':db[_0x7e7a('0x41')],'as':_0x7e7a('0x3e')}]})[_0x7e7a('0x11')](function(_0x15cc93){var _0x5aae86=_0xbb2b14[_0x7e7a('0x34')][_0x7e7a('0x26')]({'plain':!![]});if(!_0x5aae86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aae86[_0x7e7a('0x78')]===_0x7e7a('0x34')){var _0x2ec392=_0x15cc93[_0x7e7a('0x26')]({'plain':!![]});return db[_0x7e7a('0x79')][_0x7e7a('0x61')]({'where':{'name':_0x7e7a('0x27'),'userProfileId':_0x5aae86['userProfileId']},'raw':!![]})['then'](function(_0x18a767){if(_0x18a767&&_0x18a767[_0x7e7a('0x7a')]===0x0){return db[_0x7e7a('0x28')]['create']({'name':_0x2ec392[_0x7e7a('0x2a')],'resourceId':_0x2ec392['id'],'type':_0x18a767[_0x7e7a('0x2a')],'sectionId':_0x18a767['id']},{})[_0x7e7a('0x11')](function(){return _0x15cc93;});}else{return _0x15cc93;}})[_0x7e7a('0x1b')](function(_0x2e4a73){logger[_0x7e7a('0x18')](_0x7e7a('0x7b'),_0x2e4a73);throw _0x2e4a73;});}return _0x15cc93;})['then'](respondWithResult(_0x59fbb9,0xc9))[_0x7e7a('0x1b')](handleError(_0x59fbb9,null));};exports[_0x7e7a('0x7c')]=function(_0x35f167,_0x1dc5a5){return db[_0x7e7a('0x46')]['findOne']({'where':{'id':_0x35f167[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x1dc5a5,null))[_0x7e7a('0x11')](function(_0xdc0458){if(_0xdc0458){return _0xdc0458['getImap']();}return null;})[_0x7e7a('0x11')](respondWithResult(_0x1dc5a5,null))['catch'](handleError(_0x1dc5a5,null));};exports[_0x7e7a('0x7d')]=function(_0x159f3a,_0x4ea445){if(_0x159f3a[_0x7e7a('0x62')]['id']){delete _0x159f3a[_0x7e7a('0x62')]['id'];}return db['MailAccount'][_0x7e7a('0x61')]({'where':{'id':_0x159f3a[_0x7e7a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ea445,null))[_0x7e7a('0x11')](function(_0xe77534){if(_0xe77534){_0x159f3a[_0x7e7a('0x62')][_0x7e7a('0x6c')]=_0xe77534['id'];return db[_0x7e7a('0x41')][_0x7e7a('0x69')](_0x159f3a['body']);}})[_0x7e7a('0x11')](respondWithResult(_0x4ea445,null))[_0x7e7a('0x1b')](handleError(_0x4ea445,null));};exports[_0x7e7a('0x7e')]=function(_0x2f8805,_0x5a6426){return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0x2f8805['params']['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x5a6426,null))[_0x7e7a('0x11')](function(_0x2b8f0d){if(_0x2b8f0d){return _0x2b8f0d[_0x7e7a('0x7f')](null);}return null;})[_0x7e7a('0x11')](respondWithStatusCode(_0x5a6426,null))[_0x7e7a('0x1b')](handleError(_0x5a6426,null));};exports[_0x7e7a('0x80')]=function(_0x526176,_0x9e5368){return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0x526176['params']['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x9e5368,null))[_0x7e7a('0x11')](function(_0x5551f8){if(_0x5551f8){return _0x5551f8[_0x7e7a('0x80')]();}return null;})[_0x7e7a('0x11')](respondWithResult(_0x9e5368,null))[_0x7e7a('0x1b')](handleError(_0x9e5368,null));};exports[_0x7e7a('0x81')]=function(_0x4b699d,_0x5e0e27){if(_0x4b699d['body']['id']){delete _0x4b699d[_0x7e7a('0x62')]['id'];}return db['MailAccount'][_0x7e7a('0x61')]({'where':{'id':_0x4b699d[_0x7e7a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5e0e27,null))[_0x7e7a('0x11')](function(_0x1ca29e){if(_0x1ca29e){_0x4b699d[_0x7e7a('0x62')][_0x7e7a('0x6c')]=_0x1ca29e['id'];return db[_0x7e7a('0x42')][_0x7e7a('0x69')](_0x4b699d[_0x7e7a('0x62')]);}})['then'](respondWithResult(_0x5e0e27,null))[_0x7e7a('0x1b')](handleError(_0x5e0e27,null));};exports[_0x7e7a('0x82')]=function(_0x12438c,_0x2ca14e){return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0x12438c[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x2ca14e,null))[_0x7e7a('0x11')](function(_0x17d9f1){if(_0x17d9f1){return _0x17d9f1[_0x7e7a('0x83')](null);}return null;})[_0x7e7a('0x11')](respondWithStatusCode(_0x2ca14e,null))[_0x7e7a('0x1b')](handleError(_0x2ca14e,null));};exports['addInteraction']=function(_0x4ddb8f,_0x146421){return db[_0x7e7a('0x84')]['find']({'where':{'id':_0x4ddb8f['params']['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x146421,null))['then'](function(_0x359d6a){if(_0x359d6a){return _0x359d6a['addInteraction'](_0x4ddb8f[_0x7e7a('0x62')]['ids'],_['omit'](_0x4ddb8f[_0x7e7a('0x62')],['ids','id'])||{});}})[_0x7e7a('0x11')](respondWithResult(_0x146421,null))[_0x7e7a('0x1b')](handleError(_0x146421,null));};exports[_0x7e7a('0x85')]=function(_0xcc60c4,_0x48688f){var _0x5c0669={'raw':![],'where':{}};var _0x11f6b8={};var _0x47664f={'count':0x0,'rows':[]};return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0xcc60c4[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x48688f,null))[_0x7e7a('0x11')](function(_0x48d8e9){if(_0x48d8e9){_0x11f6b8[_0x7e7a('0x4a')]=_[_0x7e7a('0x5b')](db['MailInteraction'][_0x7e7a('0x5c')]);_0x11f6b8[_0x7e7a('0x4c')]=_[_0x7e7a('0x5b')](_0xcc60c4[_0x7e7a('0x4c')]);_0x11f6b8[_0x7e7a('0x4b')]=_[_0x7e7a('0x5d')](_0x11f6b8['model'],_0x11f6b8[_0x7e7a('0x4c')]);_0x5c0669[_0x7e7a('0x4d')]=_['intersection'](_0x11f6b8[_0x7e7a('0x4a')],qs[_0x7e7a('0x4e')](_0xcc60c4[_0x7e7a('0x4c')][_0x7e7a('0x4e')]));_0x5c0669[_0x7e7a('0x4d')]=_0x5c0669[_0x7e7a('0x4d')][_0x7e7a('0x5e')]?_0x5c0669[_0x7e7a('0x4d')]:_0x11f6b8['model'];if(!_0xcc60c4[_0x7e7a('0x4c')]['hasOwnProperty']('nolimit')){_0x5c0669[_0x7e7a('0x22')]=qs[_0x7e7a('0x22')](_0xcc60c4[_0x7e7a('0x4c')][_0x7e7a('0x22')]);_0x5c0669[_0x7e7a('0x20')]=qs[_0x7e7a('0x20')](_0xcc60c4[_0x7e7a('0x4c')][_0x7e7a('0x20')]);}_0x5c0669['order']=qs['sort'](_0xcc60c4[_0x7e7a('0x4c')]['sort']);_0x5c0669[_0x7e7a('0x53')]=qs[_0x7e7a('0x4b')](_[_0x7e7a('0x6b')](_0xcc60c4['query'],_0x11f6b8[_0x7e7a('0x4b')]));_0x5c0669[_0x7e7a('0x53')]['MailAccountId']=_0x48d8e9['id'];if(_0xcc60c4[_0x7e7a('0x4c')][_0x7e7a('0x54')]){_0x5c0669[_0x7e7a('0x53')]=_[_0x7e7a('0x55')](_0x5c0669[_0x7e7a('0x53')],{'$or':_[_0x7e7a('0x45')](_0x5c0669[_0x7e7a('0x4d')],function(_0x579d3f){var _0x390e3c={};_0x390e3c[_0x579d3f]={'$like':'%'+_0xcc60c4[_0x7e7a('0x4c')][_0x7e7a('0x54')]+'%'};return _0x390e3c;})});}_0x5c0669=_[_0x7e7a('0x55')]({},_0x5c0669,_0xcc60c4[_0x7e7a('0x60')]);return db[_0x7e7a('0x84')][_0x7e7a('0x23')]({'where':_0x5c0669[_0x7e7a('0x53')]})[_0x7e7a('0x11')](function(_0x54d4d4){_0x47664f[_0x7e7a('0x23')]=_0x54d4d4;if(_0xcc60c4['query']['includeAll']){_0x5c0669[_0x7e7a('0x57')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x7e7a('0x86')],'as':_0x7e7a('0x87'),'attributes':[_0x7e7a('0x2a'),_0x7e7a('0x88'),'internal'],'required':![]},{'model':db[_0x7e7a('0x89')],'as':_0x7e7a('0x8a'),'attributes':['id','name',_0x7e7a('0x8b')],'where':_0xcc60c4[_0x7e7a('0x4c')][_0x7e7a('0x8c')]?{'id':_0xcc60c4['query'][_0x7e7a('0x8c')]}:undefined,'required':_0xcc60c4[_0x7e7a('0x4c')]['tag']?!![]:![]}];}return db[_0x7e7a('0x84')][_0x7e7a('0x58')](_0x5c0669);})[_0x7e7a('0x11')](function(_0x4417ae){_0x47664f[_0x7e7a('0x6d')]=_0x4417ae;return _0x47664f;});}})[_0x7e7a('0x11')](respondWithFilteredResult(_0x48688f,_0x5c0669))[_0x7e7a('0x1b')](handleError(_0x48688f,null));};exports['addApplications']=function addApplications(_0x2cd649,_0x35a3dd){var _0x432be9=_0x2cd649[_0x7e7a('0x5a')]['id'];var _0x342067=_0x2cd649[_0x7e7a('0x62')];var _0x2dbc72=0xc8;var _0x4b9352=null;return db[_0x7e7a('0x8d')]['transaction']({'isolationLevel':db[_0x7e7a('0x8d')][_0x7e7a('0x8e')][_0x7e7a('0x8f')][_0x7e7a('0x90')]},function(_0x426ffe){return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0x432be9},'transaction':_0x426ffe})[_0x7e7a('0x11')](function(_0x52e982){if(_0x52e982){return db[_0x7e7a('0x91')]['destroy']({'where':{'MailAccountId':_0x432be9},'transaction':_0x426ffe})[_0x7e7a('0x11')](function(){var _0xc1c700=_['map'](_0x342067,function(_0x32df28){_0x32df28[_0x7e7a('0x6c')]=_0x432be9;return _0x32df28;});return db[_0x7e7a('0x91')]['bulkCreate'](_0xc1c700,{'transaction':_0x426ffe});});}else{_0x2dbc72=0x194;_0x4b9352=[];}});})[_0x7e7a('0x11')](function(){if(_0x2dbc72!==0x194){return db[_0x7e7a('0x91')][_0x7e7a('0x92')]({'where':{'MailAccountId':_0x432be9},'order':_0x7e7a('0x93')})[_0x7e7a('0x11')](function(_0x36997b){_0x4b9352=_0x36997b;});}})[_0x7e7a('0x1b')](function(_0x2421c7){_0x2dbc72=0x1f4;logger['error'](_0x2421c7[_0x7e7a('0x29')]);if(_0x2421c7[_0x7e7a('0x2a')]){delete _0x2421c7[_0x7e7a('0x2a')];}_0x4b9352=_0x2421c7;})[_0x7e7a('0x94')](function(){if(_0x4b9352===null){_0x35a3dd['sendStatus'](_0x2dbc72);}else{if(_0x2dbc72===0x1f4){_0x35a3dd[_0x7e7a('0x1e')](_0x2dbc72)[_0x7e7a('0x95')](_0x4b9352);}else{_0x35a3dd[_0x7e7a('0x1e')](_0x2dbc72)[_0x7e7a('0x1f')](_0x4b9352);}}});};exports[_0x7e7a('0x96')]=function(_0x43bb95,_0x4508cf){var _0x2371a3={};var _0x248b6e={};var _0x5c93f6;var _0x53d61e;return db[_0x7e7a('0x46')]['findOne']({'where':{'id':_0x43bb95['params']['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x4508cf,null))['then'](function(_0x4315fa){if(_0x4315fa){_0x5c93f6=_0x4315fa;_0x248b6e[_0x7e7a('0x4a')]=_[_0x7e7a('0x5b')](db['MailApplication']['rawAttributes']);_0x248b6e[_0x7e7a('0x4c')]=_['keys'](_0x43bb95['query']);_0x248b6e[_0x7e7a('0x4b')]=_[_0x7e7a('0x5d')](_0x248b6e[_0x7e7a('0x4a')],_0x248b6e[_0x7e7a('0x4c')]);_0x2371a3['attributes']=_[_0x7e7a('0x5d')](_0x248b6e[_0x7e7a('0x4a')],qs[_0x7e7a('0x4e')](_0x43bb95[_0x7e7a('0x4c')][_0x7e7a('0x4e')]));_0x2371a3[_0x7e7a('0x4d')]=_0x2371a3['attributes']['length']?_0x2371a3['attributes']:_0x248b6e[_0x7e7a('0x4a')];_0x2371a3[_0x7e7a('0x51')]=qs[_0x7e7a('0x52')](_0x43bb95[_0x7e7a('0x4c')][_0x7e7a('0x52')]);_0x2371a3[_0x7e7a('0x53')]=qs['filters'](_[_0x7e7a('0x6b')](_0x43bb95['query'],_0x248b6e[_0x7e7a('0x4b')]));if(_0x43bb95[_0x7e7a('0x4c')]['filter']){_0x2371a3['where']=_[_0x7e7a('0x55')](_0x2371a3[_0x7e7a('0x53')],{'$or':_[_0x7e7a('0x45')](_0x2371a3[_0x7e7a('0x4d')],function(_0x22d056){var _0x106e2e={};_0x106e2e[_0x22d056]={'$like':'%'+_0x43bb95[_0x7e7a('0x4c')]['filter']+'%'};return _0x106e2e;})});}_0x2371a3=_[_0x7e7a('0x55')]({},_0x2371a3,_0x43bb95[_0x7e7a('0x60')]);return _0x5c93f6[_0x7e7a('0x96')](_0x2371a3);}})[_0x7e7a('0x11')](function(_0x135e55){if(_0x135e55){_0x53d61e=_0x135e55[_0x7e7a('0x5e')];if(!_0x43bb95[_0x7e7a('0x4c')][_0x7e7a('0x4f')](_0x7e7a('0x50'))){_0x2371a3['limit']=qs[_0x7e7a('0x22')](_0x43bb95[_0x7e7a('0x4c')][_0x7e7a('0x22')]);_0x2371a3[_0x7e7a('0x20')]=qs['offset'](_0x43bb95[_0x7e7a('0x4c')]['offset']);}return _0x5c93f6[_0x7e7a('0x96')](_0x2371a3);}})[_0x7e7a('0x11')](function(_0x5deff5){if(_0x5deff5){return _0x5deff5?{'count':_0x53d61e,'rows':_0x5deff5}:null;}})[_0x7e7a('0x11')](respondWithResult(_0x4508cf,null))[_0x7e7a('0x1b')](handleError(_0x4508cf,null));};exports[_0x7e7a('0x97')]=function(_0x1a4854,_0x514fa9){var _0x558873={'raw':!![],'where':{}};var _0x59c520={};var _0x54ba93={'count':0x0,'rows':[]};return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0x1a4854[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x514fa9,null))[_0x7e7a('0x11')](function(_0x1412ec){if(_0x1412ec){_0x59c520['model']=_[_0x7e7a('0x5b')](db[_0x7e7a('0x98')][_0x7e7a('0x5c')]);_0x59c520['query']=_[_0x7e7a('0x5b')](_0x1a4854[_0x7e7a('0x4c')]);_0x59c520['filters']=_['intersection'](_0x59c520[_0x7e7a('0x4a')],_0x59c520[_0x7e7a('0x4c')]);_0x558873[_0x7e7a('0x4d')]=_[_0x7e7a('0x5d')](_0x59c520[_0x7e7a('0x4a')],qs['fields'](_0x1a4854[_0x7e7a('0x4c')][_0x7e7a('0x4e')]));_0x558873['attributes']=_0x558873[_0x7e7a('0x4d')][_0x7e7a('0x5e')]?_0x558873[_0x7e7a('0x4d')]:_0x59c520['model'];if(!_0x1a4854['query'][_0x7e7a('0x4f')](_0x7e7a('0x50'))){_0x558873['limit']=qs[_0x7e7a('0x22')](_0x1a4854[_0x7e7a('0x4c')]['limit']);_0x558873[_0x7e7a('0x20')]=qs[_0x7e7a('0x20')](_0x1a4854['query'][_0x7e7a('0x20')]);}_0x558873['order']=qs[_0x7e7a('0x52')](_0x1a4854[_0x7e7a('0x4c')][_0x7e7a('0x52')]);_0x558873[_0x7e7a('0x53')]=qs['filters'](_['pick'](_0x1a4854[_0x7e7a('0x4c')],_0x59c520[_0x7e7a('0x4b')]));_0x558873[_0x7e7a('0x53')][_0x7e7a('0x6c')]=_0x1412ec['id'];if(_0x1a4854[_0x7e7a('0x4c')][_0x7e7a('0x54')]){_0x558873[_0x7e7a('0x53')]=_[_0x7e7a('0x55')](_0x558873[_0x7e7a('0x53')],{'$or':_['map'](_0x558873[_0x7e7a('0x4d')],function(_0x50cedc){var _0x116650={};_0x116650[_0x50cedc]={'$like':'%'+_0x1a4854[_0x7e7a('0x4c')][_0x7e7a('0x54')]+'%'};return _0x116650;})});}if(_0x1a4854['query']['$gte']){var _0x1eafe1=_0x1a4854[_0x7e7a('0x4c')][_0x7e7a('0x99')]['split'](',');var _0x55e474={};_0x55e474[_0x1eafe1[0x0]]={'$gte':moment(_0x1eafe1[0x1])[_0x7e7a('0x9a')](_0x7e7a('0x9b'))};_0x558873[_0x7e7a('0x53')]=_[_0x7e7a('0x55')](_0x558873['where'],_0x55e474);}_0x558873=_['merge']({},_0x558873,_0x1a4854[_0x7e7a('0x60')]);return db[_0x7e7a('0x98')][_0x7e7a('0x23')]({'where':_0x558873[_0x7e7a('0x53')]})[_0x7e7a('0x11')](function(_0x177f02){_0x54ba93[_0x7e7a('0x23')]=_0x177f02;if(_0x1a4854[_0x7e7a('0x4c')]['includeAll']){_0x558873['include']=[{'all':!![]}];}return db['MailMessage'][_0x7e7a('0x58')](_0x558873);})[_0x7e7a('0x11')](function(_0xbf7771){if(_0x1a4854[_0x7e7a('0x4c')][_0x7e7a('0x9c')]===_0x7e7a('0x9d')){for(var _0x338f80=0x0;_0x338f80<_0xbf7771['length'];_0x338f80++){_0xbf7771[_0x338f80][_0x7e7a('0x62')]=juice(_0xbf7771[_0x338f80][_0x7e7a('0x62')]);}}_0x54ba93[_0x7e7a('0x6d')]=_0xbf7771;return _0x54ba93;});}})[_0x7e7a('0x11')](respondWithFilteredResult(_0x514fa9,_0x558873))[_0x7e7a('0x1b')](handleError(_0x514fa9,null));};exports[_0x7e7a('0x95')]=function(_0x1c89b5,_0x3982bd){var _0x212f5f,_0x2d3064={},_0x45215b;if(_0x1c89b5[_0x7e7a('0x62')]['to']){_0x45215b=_0x1c89b5[_0x7e7a('0x62')]['to'][_0x7e7a('0x9e')](',')[0x0];}return db[_0x7e7a('0x46')][_0x7e7a('0x61')]({'where':{'id':_0x1c89b5[_0x7e7a('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x7e7a('0x9f'),'include':[{'model':db[_0x7e7a('0xa0')],'as':_0x7e7a('0xa1'),'where':{'email':_0x45215b},'limit':0x1,'order':[[_0x7e7a('0xa2'),_0x7e7a('0xa3')]]}]},{'model':db[_0x7e7a('0x42')],'as':_0x7e7a('0x3f'),'raw':!![],'include':[{'model':db[_0x7e7a('0xa4')],'as':_0x7e7a('0xa4'),'raw':!![]}]}]})[_0x7e7a('0x11')](handleEntityNotFound(_0x3982bd,null))[_0x7e7a('0x11')](function(_0x40391e){if(!_0x40391e)return;_0x212f5f=_0x40391e;if(!_0x40391e[_0x7e7a('0x3f')])throw new Error(_0x7e7a('0xa5'));if(_['isNil'](_0x1c89b5[_0x7e7a('0x62')][_0x7e7a('0xa6')])){_0x1c89b5[_0x7e7a('0x62')][_0x7e7a('0xa6')]=util[_0x7e7a('0x9a')]('%s\x20<%s>',_0x40391e[_0x7e7a('0x2a')],_0x40391e[_0x7e7a('0x74')]||_0x40391e['Smtp'][_0x7e7a('0x34')]);}if(_0x1c89b5[_0x7e7a('0x62')][_0x7e7a('0xa7')]&&_0x1c89b5['body'][_0x7e7a('0xa7')][_0x7e7a('0x5e')]){for(var _0x58be4c=0x0;_0x58be4c<_0x1c89b5['body'][_0x7e7a('0xa7')]['length'];_0x58be4c+=0x1){_0x1c89b5['body'][_0x7e7a('0xa7')][_0x58be4c]={'filename':_0x1c89b5[_0x7e7a('0x62')][_0x7e7a('0xa7')][_0x58be4c]['name'],'path':path[_0x7e7a('0xa8')](config[_0x7e7a('0xa9')],_0x7e7a('0xaa'),_0x1c89b5[_0x7e7a('0x62')]['attachments'][_0x58be4c][_0x7e7a('0xab')])};}}var _0x3c818c=_0x40391e[_0x7e7a('0xac')]();return respondWithRpcPromise(_0x7e7a('0xad'),_0x7e7a('0xae'),{'account':_0x3c818c,'message':_0x1c89b5[_0x7e7a('0x62')]});})[_0x7e7a('0x11')](function(_0x508fbd){if(!_0x508fbd)return;_0x2d3064=_0x508fbd;if(!_0x212f5f[_0x7e7a('0x9f')])throw new Error(_0x7e7a('0xaf'));if(_0x212f5f['List']['Contacts'][_0x7e7a('0x5e')])return _0x212f5f['List']['Contacts'][0x0];return db['CmContact']['create'](_['defaults'](_0x1c89b5['body'],{'firstName':_0x1c89b5[_0x7e7a('0x62')]['to'],'email':_0x1c89b5['body']['to'],'phone':_0x1c89b5[_0x7e7a('0x62')]['to'],'ListId':_0x212f5f['ListId']}));})['then'](function(_0x179e93){if(!_0x179e93)return;var _0x25764d={'UserId':_0x1c89b5[_0x7e7a('0x34')]['id'],'ContactId':_0x179e93['id'],'MailAccountId':_0x212f5f['id'],'inReplyTo':_0x2d3064['messageId'],'to':_0x1c89b5[_0x7e7a('0x62')]['from'],'cc':_0x1c89b5[_0x7e7a('0x62')]['cc'],'subject':_0x1c89b5['body']['subject'],'attach':_0x1c89b5[_0x7e7a('0x62')][_0x7e7a('0xb0')],'firstMsgDirection':_0x7e7a('0xb1'),'lastMsgAt':moment()[_0x7e7a('0x9a')](_0x7e7a('0x9b')),'lastMsgDirection':_0x7e7a('0xb1'),'Messages':[_[_0x7e7a('0x55')](_0x1c89b5[_0x7e7a('0x62')],{'messageId':_0x2d3064['messageId'],'sentAt':moment()[_0x7e7a('0x9a')](_0x7e7a('0x9b')),'read':!![],'MailAccountId':_0x212f5f['id'],'UserId':_0x1c89b5['user']['id'],'ContactId':_0x179e93['id']})]};if(_0x1c89b5['body']['Interaction']){_0x25764d=_['merge'](_0x25764d,_0x1c89b5['body'][_0x7e7a('0xb2')]);}return db['MailInteraction'][_0x7e7a('0x69')](_0x25764d,{'include':[{'model':db[_0x7e7a('0x98')],'as':'Messages'}]});})[_0x7e7a('0x11')](respondWithResult(_0x3982bd,null))[_0x7e7a('0x1b')](handleError(_0x3982bd,null));};exports['verifySmtp']=function(_0x5b8fd8,_0x20b81d){return db[_0x7e7a('0x46')]['find']({'where':{'id':_0x5b8fd8[_0x7e7a('0x5a')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x7e7a('0x3f'),'raw':!![],'include':[{'model':db[_0x7e7a('0xa4')],'as':'CloudProvider','raw':!![]}]}]})[_0x7e7a('0x11')](handleEntityNotFound(_0x20b81d,null))[_0x7e7a('0x11')](function(_0x418032){if(!_0x418032[_0x7e7a('0x3f')])return;var _0x220722=_0x418032[_0x7e7a('0xac')]();return respondWithRpcPromise('VerifySmtp',_0x7e7a('0xb3'),{'account':_0x220722});})['then'](respondWithResult(_0x20b81d,null))[_0x7e7a('0x1b')](handleError(_0x20b81d,null));};exports[_0x7e7a('0x25')]=function(_0x3d8465,_0x409bed){return db['MailAccount']['find']({'where':{'id':_0x3d8465[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x409bed,null))[_0x7e7a('0x11')](function(_0x5b0eed){if(_0x5b0eed&&_0x5b0eed[_0x7e7a('0x3c')]){throw new db['Sequelize'][(_0x7e7a('0xb4'))](_0x7e7a('0xb5'));}return _0x5b0eed;})[_0x7e7a('0x11')](removeEntity(_0x409bed,null))[_0x7e7a('0x1b')](handleError(_0x409bed,null));};exports[_0x7e7a('0xb6')]=function(_0x19e776,_0x5c19ad){return db[_0x7e7a('0x46')][_0x7e7a('0x61')]({'where':{'id':_0x19e776[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x5c19ad,null))['then'](function(_0x36c688){if(_0x36c688){return _0x36c688[_0x7e7a('0xb6')](_0x19e776['body'][_0x7e7a('0x6f')],_['omit'](_0x19e776[_0x7e7a('0x62')],[_0x7e7a('0x6f'),'id'])||{})[_0x7e7a('0xb7')](function(_0x4a907b){for(var _0x4cc1de=0x0;_0x4cc1de<_0x19e776[_0x7e7a('0x62')][_0x7e7a('0x6f')][_0x7e7a('0x5e')];_0x4cc1de+=0x1){socket[_0x7e7a('0xb8')](_0x7e7a('0xb9'),{'UserId':Number(_0x19e776[_0x7e7a('0x62')][_0x7e7a('0x6f')][_0x4cc1de]),'MailAccountId':Number(_0x19e776[_0x7e7a('0x5a')]['id'])});}return _0x4a907b;});}})[_0x7e7a('0x11')](respondWithResult(_0x5c19ad,null))[_0x7e7a('0x1b')](handleError(_0x5c19ad,null));};exports[_0x7e7a('0xba')]=function(_0x5d51ce,_0x19d449){return db[_0x7e7a('0x46')][_0x7e7a('0x61')]({'where':{'id':_0x5d51ce[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x19d449,null))['then'](function(_0x4afa81){if(_0x4afa81){return _0x4afa81[_0x7e7a('0xba')](_0x5d51ce[_0x7e7a('0x4c')][_0x7e7a('0x6f')])['then'](function(){if(_['isArray'](_0x5d51ce[_0x7e7a('0x4c')][_0x7e7a('0x6f')])){for(var _0x4ce88e=0x0;_0x4ce88e<_0x5d51ce[_0x7e7a('0x4c')]['ids'][_0x7e7a('0x5e')];_0x4ce88e+=0x1){socket[_0x7e7a('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x5d51ce[_0x7e7a('0x4c')][_0x7e7a('0x6f')][_0x4ce88e]),'MailAccountId':Number(_0x5d51ce[_0x7e7a('0x5a')]['id'])});}}else{socket[_0x7e7a('0xb8')](_0x7e7a('0xbb'),{'UserId':Number(_0x5d51ce['query'][_0x7e7a('0x6f')]),'MailAccountId':Number(_0x5d51ce[_0x7e7a('0x5a')]['id'])});}});}})[_0x7e7a('0x11')](respondWithStatusCode(_0x19d449,null))[_0x7e7a('0x1b')](handleError(_0x19d449,null));};exports[_0x7e7a('0xbc')]=function(_0x1c11d9,_0x52e2a0){var _0x4b3515={};var _0x236c2f={};var _0x340cd2;var _0x4e4a1f;return db[_0x7e7a('0x46')][_0x7e7a('0x71')]({'where':{'id':_0x1c11d9[_0x7e7a('0x5a')]['id']}})[_0x7e7a('0x11')](handleEntityNotFound(_0x52e2a0,null))[_0x7e7a('0x11')](function(_0x59e9ac){if(_0x59e9ac){_0x340cd2=_0x59e9ac;_0x236c2f[_0x7e7a('0x4a')]=_['keys'](db[_0x7e7a('0x86')]['rawAttributes']);_0x236c2f[_0x7e7a('0x4c')]=_['keys'](_0x1c11d9[_0x7e7a('0x4c')]);_0x236c2f[_0x7e7a('0x4b')]=_[_0x7e7a('0x5d')](_0x236c2f[_0x7e7a('0x4a')],_0x236c2f['query']);_0x4b3515['attributes']=_[_0x7e7a('0x5d')](_0x236c2f[_0x7e7a('0x4a')],qs[_0x7e7a('0x4e')](_0x1c11d9[_0x7e7a('0x4c')][_0x7e7a('0x4e')]));_0x4b3515[_0x7e7a('0x4d')]=_0x4b3515[_0x7e7a('0x4d')]['length']?_0x4b3515[_0x7e7a('0x4d')]:_0x236c2f[_0x7e7a('0x4a')];_0x4b3515[_0x7e7a('0x51')]=qs[_0x7e7a('0x52')](_0x1c11d9[_0x7e7a('0x4c')][_0x7e7a('0x52')]);_0x4b3515[_0x7e7a('0x53')]=qs[_0x7e7a('0x4b')](_[_0x7e7a('0x6b')](_0x1c11d9[_0x7e7a('0x4c')],_0x236c2f['filters']));if(_0x1c11d9[_0x7e7a('0x4c')][_0x7e7a('0x54')]){_0x4b3515[_0x7e7a('0x53')]=_[_0x7e7a('0x55')](_0x4b3515[_0x7e7a('0x53')],{'$or':_[_0x7e7a('0x45')](_0x4b3515[_0x7e7a('0x4d')],function(_0x2e417d){var _0x566b6a={};_0x566b6a[_0x2e417d]={'$like':'%'+_0x1c11d9[_0x7e7a('0x4c')][_0x7e7a('0x54')]+'%'};return _0x566b6a;})});}_0x4b3515=_[_0x7e7a('0x55')]({},_0x4b3515,_0x1c11d9[_0x7e7a('0x60')]);return _0x340cd2[_0x7e7a('0xbc')](_0x4b3515);}})['then'](function(_0x518f6b){if(_0x518f6b){_0x4e4a1f=_0x518f6b[_0x7e7a('0x5e')];if(!_0x1c11d9[_0x7e7a('0x4c')][_0x7e7a('0x4f')](_0x7e7a('0x50'))){_0x4b3515[_0x7e7a('0x22')]=qs[_0x7e7a('0x22')](_0x1c11d9[_0x7e7a('0x4c')][_0x7e7a('0x22')]);_0x4b3515['offset']=qs[_0x7e7a('0x20')](_0x1c11d9[_0x7e7a('0x4c')]['offset']);}return _0x340cd2['getAgents'](_0x4b3515);}})['then'](function(_0x276aa9){if(_0x276aa9){return _0x276aa9?{'count':_0x4e4a1f,'rows':_0x276aa9}:null;}})[_0x7e7a('0x11')](respondWithResult(_0x52e2a0,null))[_0x7e7a('0x1b')](handleError(_0x52e2a0,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index d8e6679..76d1bab 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 _0xe861=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x30e228,_0x1dd9ba){var _0x27d19a=function(_0x31a41b){while(--_0x31a41b){_0x30e228['push'](_0x30e228['shift']());}};_0x27d19a(++_0x1dd9ba);}(_0xe861,0xb3));var _0x1e86=function(_0x116565,_0x5714af){_0x116565=_0x116565-0x0;var _0x583469=_0xe861[_0x116565];return _0x583469;};'use strict';var EventEmitter=require(_0x1e86('0x0'));var MailAccount=require(_0x1e86('0x1'))['db'][_0x1e86('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1e86('0x3')](0x0);var events={'afterCreate':_0x1e86('0x4'),'afterUpdate':_0x1e86('0x5'),'afterDestroy':_0x1e86('0x6')};function emitEvent(_0x534eb7){return function(_0x3f9a95,_0x1f3588,_0x2609f4){MailAccountEvents[_0x1e86('0x7')](_0x534eb7+':'+_0x3f9a95['id'],_0x3f9a95);MailAccountEvents['emit'](_0x534eb7,_0x3f9a95);_0x2609f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x1e86('0x8')](e,emitEvent(event));}}module[_0x1e86('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x9b8e=['events','MailAccount','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x566210,_0x23abc9){var _0x24a805=function(_0x8c55e0){while(--_0x8c55e0){_0x566210['push'](_0x566210['shift']());}};_0x24a805(++_0x23abc9);}(_0x9b8e,0x158));var _0xe9b8=function(_0x47f368,_0x35bab9){_0x47f368=_0x47f368-0x0;var _0x42dd55=_0x9b8e[_0x47f368];return _0x42dd55;};'use strict';var EventEmitter=require(_0xe9b8('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xe9b8('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe9b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe9b8('0x3')};function emitEvent(_0x56068b){return function(_0x1fb7b1,_0x175526,_0x5dc89c){MailAccountEvents[_0xe9b8('0x4')](_0x56068b+':'+_0x1fb7b1['id'],_0x1fb7b1);MailAccountEvents[_0xe9b8('0x4')](_0x56068b,_0x1fb7b1);_0x5dc89c(null);};}for(var e in events){if(events[_0xe9b8('0x5')](e)){var event=events[e];MailAccount[_0xe9b8('0x6')](e,emitEvent(event));}}module[_0xe9b8('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 8670ceb..d200a96 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 _0x2792=['./mailAccount.attributes','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','pass'];(function(_0x1e6234,_0x912787){var _0x54090d=function(_0x578d17){while(--_0x578d17){_0x1e6234['push'](_0x1e6234['shift']());}};_0x54090d(++_0x912787);}(_0x2792,0x169));var _0x2279=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0x2792[_0x403fc7];return _0x5d0827;};'use strict';var attributes=require(_0x2279('0x0'));module['exports']=function(_0x2e9a9b){return _0x2e9a9b[_0x2279('0x1')](_0x2279('0x2'),attributes,{'tableName':_0x2279('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x260805=this;var _0x295f6a={'id':_0x260805['id'],'tls':{'rejectUnauthorized':![]}};if(_0x260805[_0x2279('0x4')]!==_0x2279('0x5')){_0x295f6a[_0x2279('0x6')]=_0x260805[_0x2279('0x4')];}else{_0x295f6a[_0x2279('0x7')]=_0x260805[_0x2279('0x8')]['host'];_0x295f6a[_0x2279('0x9')]=_0x260805[_0x2279('0x8')][_0x2279('0x9')];_0x295f6a[_0x2279('0xa')]=_0x260805['Smtp'][_0x2279('0xa')];}if(_0x260805['Smtp'][_0x2279('0xb')]){if(_0x260805[_0x2279('0x8')][_0x2279('0xc')]){if(!_0x260805[_0x2279('0x8')][_0x2279('0xd')])throw new Error(_0x2279('0xe'));_0x295f6a['auth']={'type':_0x2279('0xf'),'user':_0x260805[_0x2279('0x8')][_0x2279('0x10')],'accessToken':_0x260805[_0x2279('0x8')][_0x2279('0xd')][_0x2279('0x11')]};}else{_0x295f6a['auth']={'user':_0x260805[_0x2279('0x8')][_0x2279('0x10')],'pass':_0x260805[_0x2279('0x8')][_0x2279('0x12')]};}}return _0x295f6a;}}});}; \ No newline at end of file +var _0x817f=['define','MailAccount','mail_accounts','provider','custom','service','port','Smtp','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','pass','./mailAccount.attributes','exports'];(function(_0x307239,_0x1cdebe){var _0x4a09b3=function(_0x8e02cc){while(--_0x8e02cc){_0x307239['push'](_0x307239['shift']());}};_0x4a09b3(++_0x1cdebe);}(_0x817f,0x141));var _0xf817=function(_0x41c44d,_0x31d1eb){_0x41c44d=_0x41c44d-0x0;var _0x5e00f5=_0x817f[_0x41c44d];return _0x5e00f5;};'use strict';var attributes=require(_0xf817('0x0'));module[_0xf817('0x1')]=function(_0x4bf32e){return _0x4bf32e[_0xf817('0x2')](_0xf817('0x3'),attributes,{'tableName':_0xf817('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4eb2e1=this;var _0x59d348={'id':_0x4eb2e1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4eb2e1[_0xf817('0x5')]!==_0xf817('0x6')){_0x59d348[_0xf817('0x7')]=_0x4eb2e1[_0xf817('0x5')];}else{_0x59d348['host']=_0x4eb2e1['Smtp']['host'];_0x59d348[_0xf817('0x8')]=_0x4eb2e1[_0xf817('0x9')][_0xf817('0x8')];_0x59d348[_0xf817('0xa')]=_0x4eb2e1[_0xf817('0x9')][_0xf817('0xa')];}if(_0x4eb2e1['Smtp']['authentication']){if(_0x4eb2e1[_0xf817('0x9')]['modernAuthentication']){if(!_0x4eb2e1[_0xf817('0x9')][_0xf817('0xb')])throw new Error(_0xf817('0xc'));_0x59d348['auth']={'type':_0xf817('0xd'),'user':_0x4eb2e1[_0xf817('0x9')][_0xf817('0xe')],'accessToken':_0x4eb2e1[_0xf817('0x9')][_0xf817('0xb')][_0xf817('0xf')]};}else{_0x59d348['auth']={'user':_0x4eb2e1['Smtp'][_0xf817('0xe')],'pass':_0x4eb2e1[_0xf817('0x9')][_0xf817('0x10')]};}}return _0x59d348;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index cacc0a7..aca144c 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 _0xe2fe=['list','List','priority','asc','autoclose','push','length','close','Contacts','defaults','ListId','CmContact','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','Contact\x20not\x20found','spread','interaction','MailMessage','originCc','Attachments','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','then','debug','catch','ShowMailAccount','raw','smtp','smtpOptions','getSmtpOptions','body','mail','keys','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Smtp','CloudProvider','get','omit','Applications','applications'];(function(_0x403ccf,_0x51f168){var _0x1651f6=function(_0x14225c){while(--_0x14225c){_0x403ccf['push'](_0x403ccf['shift']());}};_0x1651f6(++_0x51f168);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee2f('0x1'));var Redis=require('ioredis');var db=require(_0xee2f('0x2'))['db'];var logger=require(_0xee2f('0x3'))(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var jayson=require(_0xee2f('0x6'));var client=jayson['client'][_0xee2f('0x7')]({'port':0x232c});config[_0xee2f('0x8')]=_['defaults'](config[_0xee2f('0x8')],{'host':_0xee2f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0x8')]));require('./mailAccount.socket')[_0xee2f('0xa')](socket);function respondWithRpcPromise(_0x36920f,_0x53f7dd,_0x3a49bb){return new BPromise(function(_0x43f451,_0x4bf3c3){return client['request'](_0x36920f,_0x3a49bb)['then'](function(_0x56bbea){logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,'request\x20sent');logger['debug'](_0xee2f('0xc'),_0x53f7dd,_0xee2f('0xd'),JSON[_0xee2f('0xe')](_0x56bbea));if(_0x56bbea[_0xee2f('0xf')]){if(_0x56bbea[_0xee2f('0xf')][_0xee2f('0x10')]===0x1f4){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x56bbea['error'][_0xee2f('0x12')]);return _0x4bf3c3(_0x56bbea[_0xee2f('0xf')]['message']);}logger[_0xee2f('0xf')](_0xee2f('0x11'),_0x53f7dd,_0x56bbea[_0xee2f('0xf')][_0xee2f('0x12')]);return _0x43f451(_0x56bbea[_0xee2f('0xf')]['message']);}else{logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,_0xee2f('0xd'));_0x43f451(_0x56bbea[_0xee2f('0x13')]['message']);}})['catch'](function(_0x40b5bc){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x40b5bc);_0x4bf3c3(_0x40b5bc);});});}exports[_0xee2f('0x14')]=function(_0x28549d){var _0x5b83b5=this;return new Promise(function(_0x35e1a4,_0x1e70aa){return db[_0xee2f('0x15')][_0xee2f('0x16')]({'raw':_0x28549d[_0xee2f('0x17')]?_0x28549d['options']['raw']===undefined?!![]:![]:!![],'where':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x18')]||null:null,'attributes':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'limit':_0x28549d[_0xee2f('0x17')]?_0x28549d['options'][_0xee2f('0x1a')]||null:null,'include':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x13013f){return{'model':db[_0x13013f[_0xee2f('0x1d')]],'as':_0x13013f['as'],'attributes':_0x13013f[_0xee2f('0x19')],'include':_0x13013f[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x13013f[_0xee2f('0x1b')],function(_0x45c4a0){return{'model':db[_0x45c4a0['model']],'as':_0x45c4a0['as'],'attributes':_0x45c4a0['attributes'],'include':_0x45c4a0['include']?_[_0xee2f('0x1c')](_0x45c4a0[_0xee2f('0x1b')],function(_0x2cb0cb){return{'model':db[_0x2cb0cb[_0xee2f('0x1d')]],'as':_0x2cb0cb['as'],'attributes':_0x2cb0cb[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x4d8398){logger[_0xee2f('0xb')]('GetMailAccount',_0x28549d);logger[_0xee2f('0x1f')](_0xee2f('0x14'),_0x28549d,JSON[_0xee2f('0xe')](_0x4d8398));_0x35e1a4(_0x4d8398);})[_0xee2f('0x20')](function(_0x3ddbe3){logger['error'](_0xee2f('0x14'),_0x3ddbe3[_0xee2f('0x12')],_0x28549d);_0x1e70aa(_0x5b83b5['error'](0x1f4,_0x3ddbe3['message']));});});};exports[_0xee2f('0x21')]=function(_0x574899){var _0x33c426=this;return new Promise(function(_0xc447e,_0x53d9b7){return db[_0xee2f('0x15')]['find']({'raw':_0x574899['options']?_0x574899['options'][_0xee2f('0x22')]===undefined?!![]:![]:!![],'where':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x18')]||null:null,'attributes':_0x574899[_0xee2f('0x17')]?_0x574899[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'include':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x1b')]?_['map'](_0x574899[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x3dcb9e){return{'model':db[_0x3dcb9e['model']],'as':_0x3dcb9e['as'],'attributes':_0x3dcb9e[_0xee2f('0x19')],'include':_0x3dcb9e['include']?_[_0xee2f('0x1c')](_0x3dcb9e['include'],function(_0x3e6dcc){return{'model':db[_0x3e6dcc[_0xee2f('0x1d')]],'as':_0x3e6dcc['as'],'attributes':_0x3e6dcc[_0xee2f('0x19')],'include':_0x3e6dcc[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x3e6dcc[_0xee2f('0x1b')],function(_0x24380b){return{'model':db[_0x24380b[_0xee2f('0x1d')]],'as':_0x24380b['as'],'attributes':_0x24380b[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x433547){if(_0x574899['options'][_0xee2f('0x23')]===!![])_0x433547['setDataValue'](_0xee2f('0x24'),_0x433547[_0xee2f('0x25')]());logger[_0xee2f('0xb')](_0xee2f('0x21'),_0x574899);logger[_0xee2f('0x1f')](_0xee2f('0x21'),_0x574899,JSON[_0xee2f('0xe')](_0x433547));_0xc447e(_0x433547);})[_0xee2f('0x20')](function(_0x50ddd2){logger['error']('ShowMailAccount',_0x50ddd2[_0xee2f('0x12')],_0x574899);_0x53d9b7(_0x33c426['error'](0x1f4,_0x50ddd2[_0xee2f('0x12')]));});});};exports['NotifyMailAccount']=function(_0x558aa3){var _0x5027a6=this;return new Promise(function(_0x58e361,_0x430ac1){var _0x692686={'body':_0x558aa3[_0xee2f('0x26')],'channel':_0xee2f('0x27')};var _0x4823a7=_['difference'](_[_0xee2f('0x28')](db['CmContact']['rawAttributes']),[_0xee2f('0x29'),_0xee2f('0x2a'),_0xee2f('0x2b'),'ListId']);var _0x3bc173=![];if(_0x558aa3[_0xee2f('0x26')]['id']){delete _0x558aa3[_0xee2f('0x26')]['id'];}if(_['isNil'](_0x558aa3['body'][_0xee2f('0x2c')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2d')));}if(_[_0xee2f('0x2e')](_0x558aa3['body'][_0xee2f('0x26')])||_0x558aa3[_0xee2f('0x26')][_0xee2f('0x26')]===''){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2f')));}if(_[_0xee2f('0x2e')](_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x31')+_0x4823a7));}if(!_['includes'](_0x4823a7,_0x558aa3['body']['mapKey'])){return _0x430ac1(_0x5027a6['error'](0x1f4,_0xee2f('0x32')+_0x4823a7));}var _0x3e0d7b={};_0x3e0d7b[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3[_0xee2f('0x26')]['from'];return db[_0xee2f('0x15')][_0xee2f('0x33')]({'where':{'id':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db[_0xee2f('0x35')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3e0d7b,'limit':0x1,'order':[[_0xee2f('0x2a'),'DESC']]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xee2f('0x36'),'include':[{'model':db[_0xee2f('0x37')],'as':_0xee2f('0x37')}]}]})['then'](function(_0x22506e){if(_0x22506e&&_0x22506e['List']){var _0x3d95b8=_0x22506e[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x34')]=_[_0xee2f('0x39')](_0x3d95b8,[_0xee2f('0x3a'),'List']);_0x692686['account'][_0xee2f('0x24')]=_0x22506e['getSmtpOptions']();_0x692686[_0xee2f('0x3b')]=_0x3d95b8[_0xee2f('0x3a')];_0x692686[_0xee2f('0x3c')]=_0x3d95b8[_0xee2f('0x3d')];_0x692686['applications']=_['orderBy'](_0x692686[_0xee2f('0x3b')],[_0xee2f('0x3e')],[_0xee2f('0x3f')]);if(_0x692686[_0xee2f('0x34')]&&_0x692686[_0xee2f('0x34')][_0xee2f('0x40')]){_0x692686[_0xee2f('0x3b')][_0xee2f('0x41')]({'id':0x0,'priority':_0x692686[_0xee2f('0x3b')][_0xee2f('0x42')]+0x1,'app':_0xee2f('0x43'),'appdata':_0xee2f('0x40'),'interval':'*,*,*,*'});}if(_0x692686[_0xee2f('0x34')][_0xee2f('0x3a')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3a')];}if(_0x692686['account'][_0xee2f('0x3d')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3d')];}if(_0x3d95b8[_0xee2f('0x3d')][_0xee2f('0x44')]['length']){return _0x3d95b8[_0xee2f('0x3d')]['Contacts'][0x0];}var _0x4db455=_[_0xee2f('0x45')](_0x558aa3[_0xee2f('0x26')],{'firstName':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x2c')],'ListId':_0x3d95b8[_0xee2f('0x46')]});_0x4db455[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3['body'][_0xee2f('0x2c')];return db[_0xee2f('0x47')][_0xee2f('0x48')](_0x4db455);}else{throw new Error(_0xee2f('0x49'));}})[_0xee2f('0x1e')](function(_0x3e1184){_0x692686[_0xee2f('0x4a')]=_0x3e1184;if(_0x3e1184){if(!_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['messageId']){_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4b')]=rs[_0xee2f('0x4c')]()+'\x20'+_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')];}var _0x5ee444={'ContactId':_0x3e1184['id'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3['body']['message']['from'],'cc':_0x558aa3['body']['message']['cc'],'subject':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4d')],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'lastMsgAt':moment()[_0xee2f('0x4f')](_0xee2f('0x50')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xee2f('0x51'),'attributes':['messageId'],'where':{'messageId':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x52')]}}]})[_0xee2f('0x1e')](function(_0x2f419c){if(_0x2f419c){return[_0x2f419c,![]];}return db['MailInteraction'][_0xee2f('0x48')](_0x5ee444)[_0xee2f('0x1e')](function(_0x3bdfc5){return[_0x3bdfc5,!![]];});});}else{throw new Error(_0xee2f('0x53'));}})[_0xee2f('0x54')](function(_0x486146,_0xf0c721){if(_0x486146){_0x3bc173=_0xf0c721;if(!_0xf0c721){return _0x486146['update']({'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4d')],'attach':_0x486146['attach']?_0x486146[_0xee2f('0x4e')]:_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0xee2f('0x50')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x486146;}}})[_0xee2f('0x1e')](function(_0x46ecac){_0x692686[_0xee2f('0x55')]=_0x46ecac[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x55')]['created']=_0x3bc173;return db[_0xee2f('0x56')][_0xee2f('0x48')]({'body':_0x558aa3[_0xee2f('0x26')]['body'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'MailInteractionId':_0x46ecac['id'],'direction':'in','ContactId':_0x692686[_0xee2f('0x4a')]['id'],'messageId':_0x558aa3['body'][_0xee2f('0x12')][_0xee2f('0x4b')],'from':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['to'],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3['body']['message']['subject'],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'Attachments':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['attachments'],'originTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originTo'],'originCc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x57')],'bcc':_0x558aa3['body'][_0xee2f('0x12')]['bcc'],'ChatWebsiteId':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['ChatWebsiteId']||null,'originChannel':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originChannel']||'Email','ChatOfflineMessageId':_0x558aa3['body'][_0xee2f('0x12')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xee2f('0x58')}]});})[_0xee2f('0x1e')](function(_0x50a972){_0x692686[_0xee2f('0x12')]=_0x50a972;if(_0x692686['interaction'][_0xee2f('0x59')]){return db[_0xee2f('0x5a')][_0xee2f('0x33')]({'attributes':['id',_0xee2f('0x5b')],'where':{'id':_0x692686[_0xee2f('0x55')][_0xee2f('0x59')]}})[_0xee2f('0x1e')](function(_0x58da0d){if(_0x58da0d){_0x692686[_0xee2f('0x3b')][_0xee2f('0x5c')]({'id':0x0,'priority':0x0,'app':_0xee2f('0x5d'),'appdata':_0x58da0d[_0xee2f('0x5b')]+','+(_0x692686[_0xee2f('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0xee2f('0x5e')});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);})[_0xee2f('0x1e')](function(_0x4c3b2f){_0x58e361(_0x4c3b2f);})['catch'](function(_0x4051a7){_0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0x4051a7[_0xee2f('0x12')]));});});}; \ No newline at end of file +var _0x896e=['createdAt','updatedAt','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','list','orderBy','asc','autoclose','applications','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','interaction','get','attachments','originTo','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','limit','include','map','model','then','ShowMailAccount','find','setDataValue','smtpOptions','getSmtpOptions','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes'];(function(_0x24c446,_0x476d0b){var _0xf0de75=function(_0x5cc5da){while(--_0x5cc5da){_0x24c446['push'](_0x24c446['shift']());}};_0xf0de75(++_0x476d0b);}(_0x896e,0x1e9));var _0xe896=function(_0x3ff28b,_0x514a03){_0x3ff28b=_0x3ff28b-0x0;var _0x1d7265=_0x896e[_0x3ff28b];return _0x1d7265;};'use strict';var _=require(_0xe896('0x0'));var moment=require(_0xe896('0x1'));var BPromise=require(_0xe896('0x2'));var rs=require(_0xe896('0x3'));var Redis=require(_0xe896('0x4'));var db=require(_0xe896('0x5'))['db'];var logger=require(_0xe896('0x6'))(_0xe896('0x7'));var config=require(_0xe896('0x8'));var jayson=require(_0xe896('0x9'));var client=jayson[_0xe896('0xa')][_0xe896('0xb')]({'port':0x232c});config['redis']=_[_0xe896('0xc')](config[_0xe896('0xd')],{'host':_0xe896('0xe'),'port':0x18eb});var socket=require(_0xe896('0xf'))(new Redis(config[_0xe896('0xd')]));require('./mailAccount.socket')[_0xe896('0x10')](socket);function respondWithRpcPromise(_0x14b7e4,_0x37a90d,_0x4afd3f){return new BPromise(function(_0x305616,_0x48251e){return client[_0xe896('0x11')](_0x14b7e4,_0x4afd3f)['then'](function(_0x409eaf){logger[_0xe896('0x12')](_0xe896('0x13'),_0x37a90d,'request\x20sent');logger[_0xe896('0x14')](_0xe896('0x15'),_0x37a90d,_0xe896('0x16'),JSON['stringify'](_0x409eaf));if(_0x409eaf[_0xe896('0x17')]){if(_0x409eaf[_0xe896('0x17')][_0xe896('0x18')]===0x1f4){logger['error'](_0xe896('0x13'),_0x37a90d,_0x409eaf[_0xe896('0x17')][_0xe896('0x19')]);return _0x48251e(_0x409eaf['error']['message']);}logger[_0xe896('0x17')](_0xe896('0x13'),_0x37a90d,_0x409eaf['error']['message']);return _0x305616(_0x409eaf[_0xe896('0x17')][_0xe896('0x19')]);}else{logger['info'](_0xe896('0x13'),_0x37a90d,'request\x20sent');_0x305616(_0x409eaf[_0xe896('0x1a')][_0xe896('0x19')]);}})[_0xe896('0x1b')](function(_0x5dc89d){logger[_0xe896('0x17')](_0xe896('0x13'),_0x37a90d,_0x5dc89d);_0x48251e(_0x5dc89d);});});}exports[_0xe896('0x1c')]=function(_0xbebbe1){var _0x2693d6=this;return new Promise(function(_0x3ac8b8,_0x388c2e){return db[_0xe896('0x1d')]['findAll']({'raw':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1['options']['raw']===undefined?!![]:![]:!![],'where':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1[_0xe896('0x1e')][_0xe896('0x1f')]||null:null,'attributes':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1['options'][_0xe896('0x20')]||null:null,'limit':_0xbebbe1['options']?_0xbebbe1['options'][_0xe896('0x21')]||null:null,'include':_0xbebbe1[_0xe896('0x1e')]?_0xbebbe1[_0xe896('0x1e')][_0xe896('0x22')]?_[_0xe896('0x23')](_0xbebbe1[_0xe896('0x1e')][_0xe896('0x22')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x24')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x22')]?_['map'](_0x4b71cc[_0xe896('0x22')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x24')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')],'include':_0xd50fe2[_0xe896('0x22')]?_[_0xe896('0x23')](_0xd50fe2['include'],function(_0x10adad){return{'model':db[_0x10adad[_0xe896('0x24')]],'as':_0x10adad['as'],'attributes':_0x10adad[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0x25')](function(_0xace03f){logger['info']('GetMailAccount',_0xbebbe1);logger['debug']('GetMailAccount',_0xbebbe1,JSON['stringify'](_0xace03f));_0x3ac8b8(_0xace03f);})[_0xe896('0x1b')](function(_0x29a18e){logger[_0xe896('0x17')](_0xe896('0x1c'),_0x29a18e[_0xe896('0x19')],_0xbebbe1);_0x388c2e(_0x2693d6[_0xe896('0x17')](0x1f4,_0x29a18e[_0xe896('0x19')]));});});};exports[_0xe896('0x26')]=function(_0x4ab96b){var _0x4ce052=this;return new Promise(function(_0x142d29,_0x255dd1){return db[_0xe896('0x1d')][_0xe896('0x27')]({'raw':_0x4ab96b['options']?_0x4ab96b[_0xe896('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4ab96b['options']?_0x4ab96b[_0xe896('0x1e')][_0xe896('0x1f')]||null:null,'attributes':_0x4ab96b[_0xe896('0x1e')]?_0x4ab96b['options']['attributes']||null:null,'include':_0x4ab96b['options']?_0x4ab96b[_0xe896('0x1e')][_0xe896('0x22')]?_[_0xe896('0x23')](_0x4ab96b[_0xe896('0x1e')][_0xe896('0x22')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x24')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x22')]?_[_0xe896('0x23')](_0x486eb5[_0xe896('0x22')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x24')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')],'include':_0x2cce09['include']?_[_0xe896('0x23')](_0x2cce09[_0xe896('0x22')],function(_0x5a2dd2){return{'model':db[_0x5a2dd2[_0xe896('0x24')]],'as':_0x5a2dd2['as'],'attributes':_0x5a2dd2['attributes']};}):[]};}):[]};}):[]:[]})[_0xe896('0x25')](function(_0x4f164f){if(_0x4ab96b[_0xe896('0x1e')]['smtp']===!![])_0x4f164f[_0xe896('0x28')](_0xe896('0x29'),_0x4f164f[_0xe896('0x2a')]());logger[_0xe896('0x12')](_0xe896('0x26'),_0x4ab96b);logger['debug']('ShowMailAccount',_0x4ab96b,JSON[_0xe896('0x2b')](_0x4f164f));_0x142d29(_0x4f164f);})[_0xe896('0x1b')](function(_0x387cc6){logger[_0xe896('0x17')](_0xe896('0x26'),_0x387cc6['message'],_0x4ab96b);_0x255dd1(_0x4ce052['error'](0x1f4,_0x387cc6[_0xe896('0x19')]));});});};exports[_0xe896('0x2c')]=function(_0x5890b1){var _0x57e194=this;return new Promise(function(_0x19d2fd,_0x3b1de8){var _0x911adb={'body':_0x5890b1[_0xe896('0x2d')],'channel':_0xe896('0x2e')};var _0x41fa6f=_[_0xe896('0x2f')](_[_0xe896('0x30')](db[_0xe896('0x31')][_0xe896('0x32')]),[_0xe896('0x33'),_0xe896('0x34'),'CompanyId',_0xe896('0x35')]);var _0x143ad4=![];if(_0x5890b1['body']['id']){delete _0x5890b1['body']['id'];}if(_['isNil'](_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')])){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xe896('0x37')](_0x5890b1[_0xe896('0x2d')]['body'])||_0x5890b1['body']['body']===''){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,_0xe896('0x38')));}if(_[_0xe896('0x37')](_0x5890b1[_0xe896('0x2d')][_0xe896('0x39')])){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41fa6f));}if(!_[_0xe896('0x3a')](_0x41fa6f,_0x5890b1[_0xe896('0x2d')]['mapKey'])){return _0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,_0xe896('0x3b')+_0x41fa6f));}var _0x179fc2={};_0x179fc2[_0x5890b1[_0xe896('0x2d')]['mapKey']]=_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')];return db[_0xe896('0x1d')][_0xe896('0x27')]({'where':{'id':_0x5890b1[_0xe896('0x3c')]['id']},'include':[{'model':db[_0xe896('0x3d')],'as':'List','include':[{'model':db[_0xe896('0x31')],'as':'Contacts','where':_0x179fc2,'limit':0x1,'order':[[_0xe896('0x34'),_0xe896('0x3e')]]}]},{'model':db[_0xe896('0x3f')],'as':_0xe896('0x40')},{'model':db[_0xe896('0x41')],'as':_0xe896('0x42'),'include':[{'model':db['CloudProvider'],'as':_0xe896('0x43')}]}]})[_0xe896('0x25')](function(_0x4818cd){if(_0x4818cd&&_0x4818cd[_0xe896('0x44')]){var _0x355443=_0x4818cd['get']({'plain':!![]});_0x911adb[_0xe896('0x3c')]=_['omit'](_0x355443,[_0xe896('0x40'),_0xe896('0x44')]);_0x911adb[_0xe896('0x3c')][_0xe896('0x29')]=_0x4818cd[_0xe896('0x2a')]();_0x911adb['applications']=_0x355443[_0xe896('0x40')];_0x911adb[_0xe896('0x45')]=_0x355443[_0xe896('0x44')];_0x911adb['applications']=_[_0xe896('0x46')](_0x911adb['applications'],['priority'],[_0xe896('0x47')]);if(_0x911adb[_0xe896('0x3c')]&&_0x911adb['account'][_0xe896('0x48')]){_0x911adb[_0xe896('0x49')]['push']({'id':0x0,'priority':_0x911adb['applications'][_0xe896('0x4a')]+0x1,'app':_0xe896('0x4b'),'appdata':'autoclose','interval':_0xe896('0x4c')});}if(_0x911adb[_0xe896('0x3c')][_0xe896('0x40')]){delete _0x911adb[_0xe896('0x3c')][_0xe896('0x40')];}if(_0x911adb[_0xe896('0x3c')][_0xe896('0x44')]){delete _0x911adb[_0xe896('0x3c')][_0xe896('0x44')];}if(_0x355443[_0xe896('0x44')][_0xe896('0x4d')]['length']){return _0x355443[_0xe896('0x44')][_0xe896('0x4d')][0x0];}var _0x131c1c=_[_0xe896('0xc')](_0x5890b1[_0xe896('0x2d')],{'firstName':_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')],'ListId':_0x355443[_0xe896('0x35')]});_0x131c1c[_0x5890b1[_0xe896('0x2d')][_0xe896('0x39')]]=_0x5890b1[_0xe896('0x2d')][_0xe896('0x36')];return db['CmContact'][_0xe896('0x4e')](_0x131c1c);}else{throw new Error(_0xe896('0x4f'));}})[_0xe896('0x25')](function(_0x5180b6){_0x911adb['contact']=_0x5180b6;if(_0x5180b6){if(!_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x50')]){_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['messageId']=rs[_0xe896('0x51')]()+'\x20'+_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x36')];}var _0x5d6c1c={'ContactId':_0x5180b6['id'],'MailAccountId':_0x5890b1[_0xe896('0x3c')]['id'],'inReplyTo':_0x5890b1[_0xe896('0x2d')]['message'][_0xe896('0x50')],'to':_0x5890b1[_0xe896('0x2d')]['message']['from'],'cc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['cc'],'subject':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x52')],'attach':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x53')],'lastMsgAt':moment()[_0xe896('0x54')](_0xe896('0x55')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x5890b1[_0xe896('0x3c')]['id']},'include':[{'model':db[_0xe896('0x56')],'as':'Messages','attributes':[_0xe896('0x50')],'where':{'messageId':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x57')]}}]})[_0xe896('0x25')](function(_0x3cc348){if(_0x3cc348){return[_0x3cc348,![]];}return db[_0xe896('0x58')][_0xe896('0x4e')](_0x5d6c1c)[_0xe896('0x25')](function(_0x117e92){return[_0x117e92,!![]];});});}else{throw new Error(_0xe896('0x59'));}})[_0xe896('0x5a')](function(_0xcb329a,_0x3248e6){if(_0xcb329a){_0x143ad4=_0x3248e6;if(!_0x3248e6){return _0xcb329a[_0xe896('0x5b')]({'inReplyTo':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x50')],'to':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x36')],'cc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['cc'],'subject':_0x5890b1[_0xe896('0x2d')]['message']['subject'],'attach':_0xcb329a[_0xe896('0x53')]?_0xcb329a[_0xe896('0x53')]:_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x53')],'substatus':null,'substatusAt':moment()[_0xe896('0x54')](_0xe896('0x55')),'lastMsgAt':moment()[_0xe896('0x54')](_0xe896('0x55')),'lastMsgDirection':'in'});}else{return _0xcb329a;}}})[_0xe896('0x25')](function(_0x40e91d){_0x911adb[_0xe896('0x5c')]=_0x40e91d[_0xe896('0x5d')]({'plain':!![]});_0x911adb[_0xe896('0x5c')]['created']=_0x143ad4;return db[_0xe896('0x56')][_0xe896('0x4e')]({'body':_0x5890b1['body'][_0xe896('0x2d')],'MailAccountId':_0x5890b1['account']['id'],'MailInteractionId':_0x40e91d['id'],'direction':'in','ContactId':_0x911adb['contact']['id'],'messageId':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['messageId'],'from':_0x5890b1['body'][_0xe896('0x19')]['from'],'to':_0x5890b1['body'][_0xe896('0x19')]['to'],'cc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['cc'],'subject':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x52')],'attach':_0x5890b1[_0xe896('0x2d')]['message'][_0xe896('0x53')],'Attachments':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x5e')],'originTo':_0x5890b1['body'][_0xe896('0x19')][_0xe896('0x5f')],'originCc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['originCc'],'bcc':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')]['bcc'],'ChatWebsiteId':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x60')]||null,'originChannel':_0x5890b1[_0xe896('0x2d')]['message'][_0xe896('0x61')]||_0xe896('0x62'),'ChatOfflineMessageId':_0x5890b1[_0xe896('0x2d')][_0xe896('0x19')][_0xe896('0x63')]||null},{'include':[{'model':db[_0xe896('0x64')],'as':'Attachments'}]});})['then'](function(_0x48b523){_0x911adb[_0xe896('0x19')]=_0x48b523;if(_0x911adb[_0xe896('0x5c')][_0xe896('0x65')]){return db[_0xe896('0x66')][_0xe896('0x27')]({'attributes':['id',_0xe896('0x67')],'where':{'id':_0x911adb[_0xe896('0x5c')]['UserId']}})['then'](function(_0x4674ba){if(_0x4674ba){_0x911adb['applications'][_0xe896('0x68')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4674ba[_0xe896('0x67')]+','+(_0x911adb['account'][_0xe896('0x69')]||0xa),'interval':_0xe896('0x4c')});}return respondWithRpcPromise(_0xe896('0x6a'),_0xe896('0x6b'),_0x911adb);});}return respondWithRpcPromise(_0xe896('0x6a'),'startRouting',_0x911adb);})[_0xe896('0x25')](function(_0x35306d){_0x19d2fd(_0x35306d);})[_0xe896('0x1b')](function(_0x1bcfda){_0x3b1de8(_0x57e194[_0xe896('0x17')](0x1f4,_0x1bcfda[_0xe896('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 2fc0a3e..76ca9bb 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 _0x4cf5=['length','./mailAccount.events','save','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cf5,0x12e));var _0x54cf=function(_0x50f284,_0x39fe33){_0x50f284=_0x50f284-0x0;var _0x2d718e=_0x4cf5[_0x50f284];return _0x2d718e;};'use strict';var MailAccountEvents=require(_0x54cf('0x0'));var events=[_0x54cf('0x1'),_0x54cf('0x2'),_0x54cf('0x3')];function createListener(_0x3fafa7,_0x49d774){return function(_0x486c85){_0x49d774[_0x54cf('0x4')](_0x3fafa7,_0x486c85);};}function removeListener(_0x3c89db,_0x3b4c12){return function(){MailAccountEvents['removeListener'](_0x3c89db,_0x3b4c12);};}exports[_0x54cf('0x5')]=function(_0x4c7639){for(var _0x98c00b=0x0,_0x4308fb=events[_0x54cf('0x6')];_0x98c00b<_0x4308fb;_0x98c00b++){var _0x3342d9=events[_0x98c00b];var _0x446671=createListener('mailAccount:'+_0x3342d9,_0x4c7639);MailAccountEvents['on'](_0x3342d9,_0x446671);}}; \ No newline at end of file +var _0xae24=['update','emit','removeListener','register','length','mailAccount:','remove'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0xae24,0x180));var _0x4ae2=function(_0x30e920,_0x232774){_0x30e920=_0x30e920-0x0;var _0x5d0b59=_0xae24[_0x30e920];return _0x5d0b59;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x4ae2('0x0'),_0x4ae2('0x1')];function createListener(_0x41274f,_0x77cc06){return function(_0x9b297d){_0x77cc06[_0x4ae2('0x2')](_0x41274f,_0x9b297d);};}function removeListener(_0x3987a2,_0x53713e){return function(){MailAccountEvents[_0x4ae2('0x3')](_0x3987a2,_0x53713e);};}exports[_0x4ae2('0x4')]=function(_0x526b01){for(var _0x497634=0x0,_0x46b90b=events[_0x4ae2('0x5')];_0x497634<_0x46b90b;_0x497634++){var _0x596c50=events[_0x497634];var _0x583af6=createListener(_0x4ae2('0x6')+_0x596c50,_0x526b01);MailAccountEvents['on'](_0x596c50,_0x583af6);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8020d49..b1ab483 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 _0x26a4=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x3ad1aa,_0x1e5418){var _0x535c08=function(_0x2db35b){while(--_0x2db35b){_0x3ad1aa['push'](_0x3ad1aa['shift']());}};_0x535c08(++_0x1e5418);}(_0x26a4,0x189));var _0x426a=function(_0x5a6b33,_0xfd9c0c){_0x5a6b33=_0x5a6b33-0x0;var _0x55f37c=_0x26a4[_0x5a6b33];return _0x55f37c;};'use strict';var multer=require(_0x426a('0x0'));var util=require(_0x426a('0x1'));var path=require(_0x426a('0x2'));var timeout=require(_0x426a('0x3'));var express=require(_0x426a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x426a('0x5'));var interaction=require(_0x426a('0x6'));var config=require(_0x426a('0x7'));var controller=require(_0x426a('0x8'));router[_0x426a('0x9')](_0x426a('0xa'),auth[_0x426a('0xb')](),controller[_0x426a('0xc')]);router[_0x426a('0xd')](_0x426a('0xa'),auth['isAuthenticated'](),controller[_0x426a('0xe')]);router['delete'](_0x426a('0xa'),auth[_0x426a('0xb')](),controller[_0x426a('0xf')]);module[_0x426a('0x10')]=router; \ No newline at end of file +var _0x03d1=['./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59e62a,_0x24befb){var _0x283057=function(_0x30166d){while(--_0x30166d){_0x59e62a['push'](_0x59e62a['shift']());}};_0x283057(++_0x24befb);}(_0x03d1,0x68));var _0x103d=function(_0x3fc36a,_0x1c85c8){_0x3fc36a=_0x3fc36a-0x0;var _0x1a0aad=_0x03d1[_0x3fc36a];return _0x1a0aad;};'use strict';var multer=require(_0x103d('0x0'));var util=require(_0x103d('0x1'));var path=require(_0x103d('0x2'));var timeout=require('connect-timeout');var express=require(_0x103d('0x3'));var router=express[_0x103d('0x4')]();var fs_extra=require(_0x103d('0x5'));var auth=require(_0x103d('0x6'));var interaction=require(_0x103d('0x7'));var config=require('../../config/environment');var controller=require(_0x103d('0x8'));router[_0x103d('0x9')](_0x103d('0xa'),auth[_0x103d('0xb')](),controller[_0x103d('0xc')]);router[_0x103d('0xd')](_0x103d('0xa'),auth[_0x103d('0xb')](),controller[_0x103d('0xe')]);router['delete'](_0x103d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x103d('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index f430292..ebda4e5 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 _0x1147=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x1147,0xf5));var _0x7114=function(_0x356db9,_0x7b6cb1){_0x356db9=_0x356db9-0x0;var _0x117930=_0x1147[_0x356db9];return _0x117930;};'use strict';var Sequelize=require(_0x7114('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7114('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7114('0x2')],'allowNull':![],'defaultValue':_0x7114('0x3')},'appdata':{'type':Sequelize[_0x7114('0x4')]()},'description':{'type':Sequelize[_0x7114('0x2')]},'interval':{'type':Sequelize[_0x7114('0x2')],'defaultValue':_0x7114('0x5')}}; \ No newline at end of file +var _0xa1e9=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x353932,_0x1abecf){var _0x3f9e8c=function(_0x16c01e){while(--_0x16c01e){_0x353932['push'](_0x353932['shift']());}};_0x3f9e8c(++_0x1abecf);}(_0xa1e9,0x69));var _0x9a1e=function(_0x8fb092,_0x883290){_0x8fb092=_0x8fb092-0x0;var _0xd63883=_0xa1e9[_0x8fb092];return _0xd63883;};'use strict';var Sequelize=require(_0x9a1e('0x0'));module[_0x9a1e('0x1')]={'priority':{'type':Sequelize[_0x9a1e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9a1e('0x3')],'allowNull':![],'defaultValue':_0x9a1e('0x4')},'appdata':{'type':Sequelize[_0x9a1e('0x5')]()},'description':{'type':Sequelize[_0x9a1e('0x3')]},'interval':{'type':Sequelize[_0x9a1e('0x3')],'defaultValue':_0x9a1e('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index be6f06e..c7045b6 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 _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x188e57,_0x2b82e0){var _0x50a74f=function(_0x7732d9){while(--_0x7732d9){_0x188e57['push'](_0x188e57['shift']());}};_0x50a74f(++_0x2b82e0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3f37d2,_0x470187){_0x3f37d2=_0x3f37d2-0x0;var _0x56c563=_0xf4eb[_0x3f37d2];return _0x56c563;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file +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(_0x45b374,_0x20dccb){var _0x24fc74=function(_0x357eaf){while(--_0x357eaf){_0x45b374['push'](_0x45b374['shift']());}};_0x24fc74(++_0x20dccb);}(_0x70e0,0x17b));var _0x070e=function(_0x5bbdfa,_0x434897){_0x5bbdfa=_0x5bbdfa-0x0;var _0x92e339=_0x70e0[_0x5bbdfa];return _0x92e339;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2fa2c20..d12bf5b 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 _0x342e=['./mailApplication.attributes','exports','MailApplication','utf8mb4','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x2ef16c,_0xd211ba){var _0x128a71=function(_0x4c12f4){while(--_0x4c12f4){_0x2ef16c['push'](_0x2ef16c['shift']());}};_0x128a71(++_0xd211ba);}(_0x342e,0xae));var _0xe342=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x342e[_0x245afe];return _0x4eefde;};'use strict';var _=require('lodash');var util=require(_0xe342('0x0'));var logger=require(_0xe342('0x1'))(_0xe342('0x2'));var moment=require(_0xe342('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe342('0x4'));var config=require(_0xe342('0x5'));var attributes=require(_0xe342('0x6'));module[_0xe342('0x7')]=function(_0x12ad72,_0x9cfc64){return _0x12ad72['define'](_0xe342('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe342('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf082=['api','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0xf082,0x189));var _0x2f08=function(_0x4c85c4,_0x282978){_0x4c85c4=_0x4c85c4-0x0;var _0x33d984=_0xf082[_0x4c85c4];return _0x33d984;};'use strict';var _=require(_0x2f08('0x0'));var util=require(_0x2f08('0x1'));var logger=require(_0x2f08('0x2'))(_0x2f08('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2f08('0x4'));var config=require(_0x2f08('0x5'));var attributes=require(_0x2f08('0x6'));module[_0x2f08('0x7')]=function(_0x5c9c45,_0x3b8010){return _0x5c9c45[_0x2f08('0x8')](_0x2f08('0x9'),attributes,{'tableName':_0x2f08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f08('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6aa42bc..c86fae7 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 _0x8f92=['http','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','MailApplication','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x3cff07,_0x30f413){var _0x468e93=function(_0xbf15e5){while(--_0xbf15e5){_0x3cff07['push'](_0x3cff07['shift']());}};_0x468e93(++_0x30f413);}(_0x8f92,0x15d));var _0x28f9=function(_0x1a74c0,_0x3147d2){_0x1a74c0=_0x1a74c0-0x0;var _0x5ebc15=_0x8f92[_0x1a74c0];return _0x5ebc15;};'use strict';var _=require(_0x28f9('0x0'));var util=require(_0x28f9('0x1'));var moment=require(_0x28f9('0x2'));var BPromise=require(_0x28f9('0x3'));var rs=require(_0x28f9('0x4'));var fs=require('fs');var Redis=require(_0x28f9('0x5'));var db=require(_0x28f9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x28f9('0x7'))(_0x28f9('0x8'));var config=require(_0x28f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x28f9('0xa')][_0x28f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1488a1,_0x84ac35,_0x40ac1f){return new BPromise(function(_0xcf0f57,_0x1f5b5e){return client['request'](_0x1488a1,_0x40ac1f)['then'](function(_0x4cb4f2){logger[_0x28f9('0xc')](_0x28f9('0xd'),_0x84ac35,'request\x20sent');logger['debug'](_0x28f9('0xe'),_0x84ac35,_0x28f9('0xf'),JSON[_0x28f9('0x10')](_0x4cb4f2));if(_0x4cb4f2[_0x28f9('0x11')]){if(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x12')]===0x1f4){logger[_0x28f9('0x11')](_0x28f9('0xd'),_0x84ac35,_0x4cb4f2['error'][_0x28f9('0x13')]);return _0x1f5b5e(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x13')]);}logger[_0x28f9('0x11')](_0x28f9('0xd'),_0x84ac35,_0x4cb4f2['error']['message']);return _0xcf0f57(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x13')]);}else{logger[_0x28f9('0xc')](_0x28f9('0xd'),_0x84ac35,'request\x20sent');_0xcf0f57(_0x4cb4f2[_0x28f9('0x14')]['message']);}})['catch'](function(_0x19f806){logger[_0x28f9('0x11')]('MailApplication,\x20%s,\x20%s',_0x84ac35,_0x19f806);_0x1f5b5e(_0x19f806);});});}exports['UpdateMailApplication']=function(_0x235b02){var _0x39a093=this;return new Promise(function(_0x4ab86f,_0xcf16cf){return db[_0x28f9('0x15')]['update'](_0x235b02[_0x28f9('0x16')],{'raw':_0x235b02[_0x28f9('0x17')]?_0x235b02[_0x28f9('0x17')][_0x28f9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235b02[_0x28f9('0x17')]?_0x235b02[_0x28f9('0x17')][_0x28f9('0x19')]||null:null,'attributes':_0x235b02[_0x28f9('0x17')]?_0x235b02['options'][_0x28f9('0x1a')]||null:null,'limit':_0x235b02['options']?_0x235b02[_0x28f9('0x17')][_0x28f9('0x1b')]||null:null})[_0x28f9('0x1c')](function(_0x1a1c5a){logger['info'](_0x28f9('0x1d'),_0x235b02);logger['debug'](_0x28f9('0x1d'),_0x235b02,JSON[_0x28f9('0x10')](_0x1a1c5a));_0x4ab86f(_0x1a1c5a);})['catch'](function(_0x363a8f){logger['error'](_0x28f9('0x1d'),_0x363a8f[_0x28f9('0x13')],_0x235b02);_0xcf16cf(_0x39a093[_0x28f9('0x11')](0x1f4,_0x363a8f[_0x28f9('0x13')]));});});}; \ No newline at end of file +var _0xf058=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','MailApplication,\x20%s,\x20%s','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','stringify','catch'];(function(_0x1c02b6,_0x3076ec){var _0x4c1c28=function(_0x416e17){while(--_0x416e17){_0x1c02b6['push'](_0x1c02b6['shift']());}};_0x4c1c28(++_0x3076ec);}(_0xf058,0x1ef));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8f05('0x0'));var util=require(_0x8f05('0x1'));var moment=require(_0x8f05('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f05('0x3'));var fs=require('fs');var Redis=require(_0x8f05('0x4'));var db=require(_0x8f05('0x5'))['db'];var utils=require(_0x8f05('0x6'));var logger=require(_0x8f05('0x7'))(_0x8f05('0x8'));var config=require(_0x8f05('0x9'));var jayson=require(_0x8f05('0xa'));var client=jayson[_0x8f05('0xb')][_0x8f05('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d0e84,_0x41281f,_0x17796a){return new BPromise(function(_0x58b3c1,_0x45236f){return client[_0x8f05('0xd')](_0x5d0e84,_0x17796a)[_0x8f05('0xe')](function(_0x219759){logger[_0x8f05('0xf')]('MailApplication,\x20%s,\x20%s',_0x41281f,_0x8f05('0x10'));logger[_0x8f05('0x11')](_0x8f05('0x12'),_0x41281f,'request\x20sent',JSON['stringify'](_0x219759));if(_0x219759['error']){if(_0x219759[_0x8f05('0x13')][_0x8f05('0x14')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x41281f,_0x219759[_0x8f05('0x13')][_0x8f05('0x15')]);return _0x45236f(_0x219759[_0x8f05('0x13')][_0x8f05('0x15')]);}logger['error'](_0x8f05('0x16'),_0x41281f,_0x219759[_0x8f05('0x13')][_0x8f05('0x15')]);return _0x58b3c1(_0x219759[_0x8f05('0x13')][_0x8f05('0x15')]);}else{logger['info'](_0x8f05('0x16'),_0x41281f,_0x8f05('0x10'));_0x58b3c1(_0x219759['result'][_0x8f05('0x15')]);}})['catch'](function(_0x261f2b){logger[_0x8f05('0x13')](_0x8f05('0x16'),_0x41281f,_0x261f2b);_0x45236f(_0x261f2b);});});}exports[_0x8f05('0x17')]=function(_0x580712){var _0x4780b0=this;return new Promise(function(_0x40b6e2,_0x43d6bd){return db[_0x8f05('0x18')][_0x8f05('0x19')](_0x580712[_0x8f05('0x1a')],{'raw':_0x580712[_0x8f05('0x1b')]?_0x580712[_0x8f05('0x1b')][_0x8f05('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x580712[_0x8f05('0x1b')]?_0x580712['options']['where']||null:null,'attributes':_0x580712[_0x8f05('0x1b')]?_0x580712['options'][_0x8f05('0x1d')]||null:null,'limit':_0x580712['options']?_0x580712[_0x8f05('0x1b')][_0x8f05('0x1e')]||null:null})[_0x8f05('0xe')](function(_0x5bc9ab){logger[_0x8f05('0xf')](_0x8f05('0x17'),_0x580712);logger[_0x8f05('0x11')](_0x8f05('0x17'),_0x580712,JSON[_0x8f05('0x1f')](_0x5bc9ab));_0x40b6e2(_0x5bc9ab);})[_0x8f05('0x20')](function(_0x40047a){logger[_0x8f05('0x13')](_0x8f05('0x17'),_0x40047a[_0x8f05('0x15')],_0x580712);_0x43d6bd(_0x4780b0[_0x8f05('0x13')](0x1f4,_0x40047a[_0x8f05('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index e287bae..d05bbcd 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 _0x4223=['removeTags','exports','express','../../components/auth/service','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','mail','addTags','put','/:id','mailinteraction:update','update','mailinteraction:destroy','delete'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x4223,0x152));var _0x3422=function(_0x3f7c1a,_0x505f3e){_0x3f7c1a=_0x3f7c1a-0x0;var _0x2a6066=_0x4223[_0x3f7c1a];return _0x2a6066;};'use strict';var express=require(_0x3422('0x0'));var router=express['Router']();var auth=require(_0x3422('0x1'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x3422('0x2')]('/',auth[_0x3422('0x3')](),controller[_0x3422('0x4')]);router[_0x3422('0x2')]('/describe',auth[_0x3422('0x3')](),controller[_0x3422('0x5')]);router[_0x3422('0x2')]('/:id',auth[_0x3422('0x3')](),controller[_0x3422('0x6')]);router[_0x3422('0x2')](_0x3422('0x7'),auth[_0x3422('0x3')](),controller[_0x3422('0x8')]);router[_0x3422('0x2')](_0x3422('0x9'),auth[_0x3422('0x3')](),controller[_0x3422('0xa')]);router[_0x3422('0xb')]('/',auth[_0x3422('0x3')](),controller['create']);router['post'](_0x3422('0x7'),auth['isAuthenticated'](),controller['addMessage']);router[_0x3422('0xb')](_0x3422('0xc'),auth[_0x3422('0x3')](),interaction[_0x3422('0xd')](_0x3422('0xe'),'mailinteraction:addtags'),controller[_0x3422('0xf')]);router[_0x3422('0x10')](_0x3422('0x11'),auth[_0x3422('0x3')](),interaction['tracked'](_0x3422('0xe'),_0x3422('0x12')),controller[_0x3422('0x13')]);router['delete'](_0x3422('0x11'),auth[_0x3422('0x3')](),interaction[_0x3422('0xd')](_0x3422('0xe'),_0x3422('0x14')),controller['destroy']);router[_0x3422('0x15')](_0x3422('0xc'),auth['isAuthenticated'](),controller[_0x3422('0x16')]);module[_0x3422('0x17')]=router; \ No newline at end of file +var _0x7520=['getMessages','post','addMessage','tracked','mail','mailinteraction:addtags','addTags','delete','exports','express','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages'];(function(_0x11d096,_0x3b70f2){var _0xf3a7b3=function(_0x480f58){while(--_0x480f58){_0x11d096['push'](_0x11d096['shift']());}};_0xf3a7b3(++_0x3b70f2);}(_0x7520,0x15f));var _0x0752=function(_0x136228,_0x47fec5){_0x136228=_0x136228-0x0;var _0x5ea256=_0x7520[_0x136228];return _0x5ea256;};'use strict';var express=require(_0x0752('0x0'));var router=express['Router']();var auth=require(_0x0752('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x0752('0x2'));router[_0x0752('0x3')]('/',auth[_0x0752('0x4')](),controller[_0x0752('0x5')]);router[_0x0752('0x3')](_0x0752('0x6'),auth[_0x0752('0x4')](),controller[_0x0752('0x7')]);router[_0x0752('0x3')](_0x0752('0x8'),auth[_0x0752('0x4')](),controller['show']);router[_0x0752('0x3')](_0x0752('0x9'),auth[_0x0752('0x4')](),controller[_0x0752('0xa')]);router[_0x0752('0x3')]('/:id/download',auth[_0x0752('0x4')](),controller['download']);router[_0x0752('0xb')]('/',auth[_0x0752('0x4')](),controller['create']);router[_0x0752('0xb')](_0x0752('0x9'),auth[_0x0752('0x4')](),controller[_0x0752('0xc')]);router[_0x0752('0xb')]('/:id/tags',auth[_0x0752('0x4')](),interaction[_0x0752('0xd')](_0x0752('0xe'),_0x0752('0xf')),controller[_0x0752('0x10')]);router['put'](_0x0752('0x8'),auth[_0x0752('0x4')](),interaction['tracked']('mail','mailinteraction:update'),controller['update']);router[_0x0752('0x11')](_0x0752('0x8'),auth[_0x0752('0x4')](),interaction[_0x0752('0xd')](_0x0752('0xe'),'mailinteraction:destroy'),controller['destroy']);router[_0x0752('0x11')]('/:id/tags',auth[_0x0752('0x4')](),controller['removeTags']);module[_0x0752('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4382178..a80e8ad 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 _0xbde1=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','out','ENUM','sequelize'];(function(_0x418ad2,_0x2eb809){var _0x53e614=function(_0x32fc8e){while(--_0x32fc8e){_0x418ad2['push'](_0x418ad2['shift']());}};_0x53e614(++_0x2eb809);}(_0xbde1,0x1c1));var _0x1bde=function(_0x1193ea,_0xc04ef0){_0x1193ea=_0x1193ea-0x0;var _0x5e4000=_0xbde1[_0x1193ea];return _0x5e4000;};'use strict';var Sequelize=require(_0x1bde('0x0'));var iconv=require(_0x1bde('0x1'));module[_0x1bde('0x2')]={'closed':{'type':Sequelize[_0x1bde('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1bde('0x4')]},'disposition':{'type':Sequelize[_0x1bde('0x5')]},'secondDisposition':{'type':Sequelize[_0x1bde('0x5')]},'thirdDisposition':{'type':Sequelize[_0x1bde('0x5')]},'note':{'type':Sequelize[_0x1bde('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1bde('0x6')](_0x1bde('0x7'))},'subject':{'type':Sequelize[_0x1bde('0x6')]()},'attach':{'type':Sequelize[_0x1bde('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1bde('0x4')]},'substatus':{'type':Sequelize[_0x1bde('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x1bde('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1bde('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1bde('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1bde('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1bde('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2462=['sequelize','iconv','DATE','STRING','TEXT','long','BOOLEAN','ENUM','out'];(function(_0x29f92c,_0x308868){var _0x52e2c3=function(_0x3caedf){while(--_0x3caedf){_0x29f92c['push'](_0x29f92c['shift']());}};_0x52e2c3(++_0x308868);}(_0x2462,0x10e));var _0x2246=function(_0x3dbd4b,_0x16022f){_0x3dbd4b=_0x3dbd4b-0x0;var _0x1b8794=_0x2462[_0x3dbd4b];return _0x1b8794;};'use strict';var Sequelize=require(_0x2246('0x0'));var iconv=require(_0x2246('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2246('0x2')]},'disposition':{'type':Sequelize[_0x2246('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2246('0x3')]},'inReplyTo':{'type':Sequelize[_0x2246('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x2246('0x4')](_0x2246('0x5'))},'subject':{'type':Sequelize[_0x2246('0x4')]()},'attach':{'type':Sequelize[_0x2246('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x2246('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2246('0x7')]('in',_0x2246('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2246('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2246('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2246('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 769f0b8..8f97c8e 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 _0x1098=['nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','color','emit','removeTags','download','unix','toString','root','server','tmp','join','files','transcript-%d-%s.zip','attachments','push','Messages','bcc','createdAt','from','missing.recipient@your.company.com','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','juice','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','count','limit','Content-Range','then','destroy','end','error','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','mail','query','user','catch','show','params','keys','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','create','body','describe','MailMessage','addMessage','ids','omit','getMessages','filters','hasOwnProperty'];(function(_0x36f3f3,_0x555fd4){var _0x115842=function(_0x14e220){while(--_0x14e220){_0x36f3f3['push'](_0x36f3f3['shift']());}};_0x115842(++_0x555fd4);}(_0x1098,0x10b));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8109('0x0'));var rimraf=require(_0x8109('0x1'));var zipdir=require(_0x8109('0x2'));var moment=require(_0x8109('0x3'));var BPromise=require(_0x8109('0x4'));var util=require(_0x8109('0x5'));var path=require('path');var fs=require('fs');var _=require(_0x8109('0x6'));var juice=require(_0x8109('0x7'));var Redis=require(_0x8109('0x8'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x8109('0x9'))('api');var config=require(_0x8109('0xa'));var db=require(_0x8109('0xb'))['db'];var htmlEntities=require('html-entities');config[_0x8109('0xc')]=_[_0x8109('0xd')](config['redis'],{'host':_0x8109('0xe'),'port':0x18eb});var socket=require(_0x8109('0xf'))(new Redis(config[_0x8109('0xc')]));require(_0x8109('0x10'))[_0x8109('0x11')](socket);function respondWithStatusCode(_0x26ec91,_0x4a59b7){_0x4a59b7=_0x4a59b7||0xcc;return function(_0xbaaa7e){if(_0xbaaa7e){return _0x26ec91[_0x8109('0x12')](_0x4a59b7);}return _0x26ec91[_0x8109('0x13')](_0x4a59b7)['end']();};}function respondWithResult(_0x58600c,_0x4be75d){_0x4be75d=_0x4be75d||0xc8;return function(_0x305c75){if(_0x305c75){return _0x58600c['status'](_0x4be75d)[_0x8109('0x14')](_0x305c75);}};}function respondWithFilteredResult(_0x17cc75,_0x24d64c){return function(_0x29d3c4){if(_0x29d3c4){var _0x3a1f3c=typeof _0x24d64c[_0x8109('0x15')]==='undefined'&&typeof _0x24d64c['limit']==='undefined';var _0x31f6ad=_0x29d3c4[_0x8109('0x16')];var _0x26fbc3=_0x3a1f3c?0x0:_0x24d64c[_0x8109('0x15')];var _0x538f7e=_0x3a1f3c?_0x29d3c4[_0x8109('0x16')]:_0x24d64c[_0x8109('0x15')]+_0x24d64c[_0x8109('0x17')];var _0x36be85;if(_0x538f7e>=_0x31f6ad){_0x538f7e=_0x31f6ad;_0x36be85=0xc8;}else{_0x36be85=0xce;}_0x17cc75['status'](_0x36be85);return _0x17cc75['set'](_0x8109('0x18'),_0x26fbc3+'-'+_0x538f7e+'/'+_0x31f6ad)[_0x8109('0x14')](_0x29d3c4);}return null;};}function saveUpdates(_0x29b088){return function(_0x5d28a3){if(_0x5d28a3){return _0x5d28a3['update'](_0x29b088)[_0x8109('0x19')](function(_0x35c06a){return _0x35c06a;});}return null;};}function removeEntity(_0x383060){return function(_0x34bec5){if(_0x34bec5){return _0x34bec5[_0x8109('0x1a')]()['then'](function(){_0x383060[_0x8109('0x13')](0xcc)[_0x8109('0x1b')]();});}};}function handleEntityNotFound(_0x4ae963){return function(_0x3be128){if(!_0x3be128){_0x4ae963[_0x8109('0x12')](0x194);}return _0x3be128;};}function handleError(_0x2abf4d,_0x282be9){_0x282be9=_0x282be9||0x1f4;return function(_0x40c986){logger[_0x8109('0x1c')](_0x40c986[_0x8109('0x1d')]);if(_0x40c986[_0x8109('0x1e')]){delete _0x40c986[_0x8109('0x1e')];}_0x2abf4d[_0x8109('0x13')](_0x282be9)[_0x8109('0x1f')](_0x40c986);};}exports['index']=function(_0x55329b,_0x10f059){var _0x203346={};var _0x93e01d=_[_0x8109('0x20')](db[_0x8109('0x21')][_0x8109('0x22')],function(_0x20329e){return{'name':_0x20329e[_0x8109('0x23')],'type':_0x20329e[_0x8109('0x24')][_0x8109('0x25')]};});_0x203346=qs[_0x8109('0x26')](_0x93e01d,_0x55329b);return interaction['findAll'](_0x8109('0x27'),_0x55329b[_0x8109('0x28')],_0x55329b[_0x8109('0x29')],_0x203346,_0x93e01d)[_0x8109('0x19')](respondWithFilteredResult(_0x10f059,_0x203346))[_0x8109('0x2a')](handleError(_0x10f059,null));};exports[_0x8109('0x2b')]=function(_0x264bcf,_0x436c10){var _0x1462a3={'raw':![],'where':{'id':_0x264bcf[_0x8109('0x2c')]['id']}},_0x25084e={};_0x25084e['model']=_[_0x8109('0x2d')](db[_0x8109('0x21')][_0x8109('0x22')]);_0x25084e['query']=_[_0x8109('0x2d')](_0x264bcf[_0x8109('0x28')]);_0x25084e['filters']=_[_0x8109('0x2e')](_0x25084e['model'],_0x25084e[_0x8109('0x28')]);_0x1462a3[_0x8109('0x2f')]=_[_0x8109('0x2e')](_0x25084e[_0x8109('0x30')],qs[_0x8109('0x31')](_0x264bcf[_0x8109('0x28')][_0x8109('0x31')]));_0x1462a3['attributes']=_0x1462a3[_0x8109('0x2f')][_0x8109('0x32')]?_0x1462a3[_0x8109('0x2f')]:_0x25084e[_0x8109('0x30')];if(_0x264bcf[_0x8109('0x28')][_0x8109('0x33')]){_0x1462a3[_0x8109('0x34')]=[{'all':!![]}];}_0x1462a3=_[_0x8109('0x35')]({},_0x1462a3,_0x264bcf[_0x8109('0x36')]);return db[_0x8109('0x21')][_0x8109('0x37')](_0x1462a3)[_0x8109('0x19')](handleEntityNotFound(_0x436c10,null))[_0x8109('0x19')](respondWithResult(_0x436c10,null))['catch'](handleError(_0x436c10,null));};exports[_0x8109('0x38')]=function(_0x42731f,_0x1f2875){return db[_0x8109('0x21')][_0x8109('0x38')](_0x42731f['body'],{})[_0x8109('0x19')](respondWithResult(_0x1f2875,0xc9))['catch'](handleError(_0x1f2875,null));};exports['update']=function(_0x556d88,_0x404e67){if(_0x556d88[_0x8109('0x39')]['id']){delete _0x556d88[_0x8109('0x39')]['id'];}return db[_0x8109('0x21')][_0x8109('0x37')]({'where':{'id':_0x556d88[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x404e67,null))[_0x8109('0x19')](saveUpdates(_0x556d88[_0x8109('0x39')],null))[_0x8109('0x19')](respondWithResult(_0x404e67,null))['catch'](handleError(_0x404e67,null));};exports[_0x8109('0x1a')]=function(_0x469d64,_0xc804cd){return db['MailInteraction'][_0x8109('0x37')]({'where':{'id':_0x469d64[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0xc804cd,null))[_0x8109('0x19')](removeEntity(_0xc804cd,null))[_0x8109('0x2a')](handleError(_0xc804cd,null));};exports[_0x8109('0x3a')]=function(_0x12f77f,_0xdfb9b3){return db['MailInteraction'][_0x8109('0x3a')]()[_0x8109('0x19')](respondWithResult(_0xdfb9b3,null))['catch'](handleError(_0xdfb9b3,null));};exports['addMessage']=function(_0x263073,_0x1eaa62){return db[_0x8109('0x3b')][_0x8109('0x37')]({'where':{'id':_0x263073[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x1eaa62,null))[_0x8109('0x19')](function(_0x5b7f0f){if(_0x5b7f0f){return _0x5b7f0f[_0x8109('0x3c')](_0x263073[_0x8109('0x39')][_0x8109('0x3d')],_[_0x8109('0x3e')](_0x263073['body'],[_0x8109('0x3d'),'id'])||{});}})[_0x8109('0x19')](respondWithResult(_0x1eaa62,null))[_0x8109('0x2a')](handleError(_0x1eaa62,null));};exports[_0x8109('0x3f')]=function(_0x4d72e5,_0x36b096){var _0x5d5da2={'raw':![],'where':{}};var _0x4e82ad={};var _0x31ef30={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x4d72e5['params']['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x36b096,null))[_0x8109('0x19')](function(_0x18710a){if(_0x18710a){_0x4e82ad['model']=_[_0x8109('0x2d')](db[_0x8109('0x3b')]['rawAttributes']);_0x4e82ad[_0x8109('0x28')]=_[_0x8109('0x2d')](_0x4d72e5[_0x8109('0x28')]);_0x4e82ad[_0x8109('0x40')]=_[_0x8109('0x2e')](_0x4e82ad['model'],_0x4e82ad[_0x8109('0x28')]);_0x5d5da2[_0x8109('0x2f')]=_[_0x8109('0x2e')](_0x4e82ad['model'],qs[_0x8109('0x31')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x31')]));_0x5d5da2[_0x8109('0x2f')]=_0x5d5da2[_0x8109('0x2f')][_0x8109('0x32')]?_0x5d5da2[_0x8109('0x2f')]:_0x4e82ad[_0x8109('0x30')];if(!_0x4d72e5[_0x8109('0x28')][_0x8109('0x41')](_0x8109('0x42'))){_0x5d5da2['limit']=qs[_0x8109('0x17')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x17')]);_0x5d5da2[_0x8109('0x15')]=qs[_0x8109('0x15')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x15')]);}_0x5d5da2[_0x8109('0x43')]=qs[_0x8109('0x44')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x44')]);_0x5d5da2[_0x8109('0x45')]=qs[_0x8109('0x40')](_[_0x8109('0x46')](_0x4d72e5[_0x8109('0x28')],_0x4e82ad[_0x8109('0x40')]));_0x5d5da2[_0x8109('0x45')][_0x8109('0x47')]=_0x18710a['id'];if(_0x4d72e5[_0x8109('0x28')][_0x8109('0x48')]){_0x5d5da2[_0x8109('0x45')]=_[_0x8109('0x35')](_0x5d5da2['where'],{'$or':_['map'](_0x5d5da2[_0x8109('0x2f')],function(_0x411455){var _0x366bb4={};_0x366bb4[_0x411455]={'$like':'%'+_0x4d72e5[_0x8109('0x28')][_0x8109('0x48')]+'%'};return _0x366bb4;})});}if(_0x4d72e5['query'][_0x8109('0x49')]){var _0x3b3398=_0x4d72e5[_0x8109('0x28')]['$gte']['split'](',');var _0x5a3c88={};_0x5a3c88[_0x3b3398[0x0]]={'$gte':moment(_0x3b3398[0x1])[_0x8109('0x4a')](_0x8109('0x4b'))};_0x5d5da2[_0x8109('0x45')]=_['merge'](_0x5d5da2[_0x8109('0x45')],_0x5a3c88);}_0x5d5da2=_['merge']({},_0x5d5da2,_0x4d72e5[_0x8109('0x36')]);return db[_0x8109('0x3b')][_0x8109('0x16')]({'where':_0x5d5da2['where']})['then'](function(_0x5a84ee){_0x31ef30[_0x8109('0x16')]=_0x5a84ee;if(_0x4d72e5[_0x8109('0x28')][_0x8109('0x33')]){_0x5d5da2[_0x8109('0x34')]=[{'all':!![]}];}return db['MailMessage'][_0x8109('0x4c')](_0x5d5da2);})[_0x8109('0x19')](function(_0x1d51f0){if(_0x4d72e5[_0x8109('0x28')][_0x8109('0x4d')]===_0x8109('0x4e')){for(var _0x37a2e7=0x0;_0x37a2e7<_0x1d51f0[_0x8109('0x32')];_0x37a2e7++){_0x1d51f0[_0x37a2e7][_0x8109('0x39')]=juice(_0x1d51f0[_0x37a2e7]['body']);}}_0x31ef30[_0x8109('0x4f')]=_0x1d51f0;return _0x31ef30;});}})[_0x8109('0x19')](respondWithFilteredResult(_0x36b096,_0x5d5da2))[_0x8109('0x2a')](handleError(_0x36b096,null));};exports[_0x8109('0x50')]=function(_0x52eba1,_0x21d8a0){return db[_0x8109('0x21')][_0x8109('0x37')]({'where':{'id':_0x52eba1[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x21d8a0,null))['then'](function(_0x2d7a57){if(_0x2d7a57){return _0x2d7a57[_0x8109('0x51')](_0x52eba1[_0x8109('0x39')][_0x8109('0x3d')],_[_0x8109('0x3e')](_0x52eba1[_0x8109('0x39')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x8109('0x1e'),_0x8109('0x52')],'where':{'id':_0x52eba1[_0x8109('0x39')][_0x8109('0x3d')]}});})['then'](function(_0x37ba68){socket[_0x8109('0x53')]('mailInteractionTags:save',{'id':Number(_0x52eba1[_0x8109('0x2c')]['id']),'tags':_0x37ba68||[]});return{'id':Number(_0x52eba1[_0x8109('0x2c')]['id']),'tags':_0x37ba68||[]};});}})[_0x8109('0x19')](respondWithResult(_0x21d8a0,null))[_0x8109('0x2a')](handleError(_0x21d8a0,null));};exports[_0x8109('0x54')]=function(_0x4ece83,_0x24b47d){return db[_0x8109('0x21')]['find']({'where':{'id':_0x4ece83[_0x8109('0x2c')]['id']}})['then'](handleEntityNotFound(_0x24b47d,null))[_0x8109('0x19')](function(_0x4199eb){if(_0x4199eb){return _0x4199eb[_0x8109('0x54')](_0x4ece83[_0x8109('0x28')][_0x8109('0x3d')]);}})[_0x8109('0x19')](respondWithStatusCode(_0x24b47d,null))[_0x8109('0x2a')](handleError(_0x24b47d,null));};exports[_0x8109('0x55')]=function(_0x422f4d,_0x16e3b9){var _0x1737bc=moment()[_0x8109('0x56')]()[_0x8109('0x57')]();var _0x4e700b=path['join'](config[_0x8109('0x58')],_0x8109('0x59'),'files',_0x8109('0x5a'));var _0x2df27c=path[_0x8109('0x5b')](config['root'],_0x8109('0x59'),_0x8109('0x5c'),'attachments');var _0x2614b5=path['join'](_0x4e700b,_0x1737bc);var _0x1694f9=util[_0x8109('0x4a')](_0x8109('0x5d'),_0x422f4d[_0x8109('0x2c')]['id'],_0x1737bc);var _0x139813=path[_0x8109('0x5b')](_0x4e700b,_0x1694f9);var _0x1e9bab=[];if(_0x422f4d['query'][_0x8109('0x5e')]){_0x1e9bab[_0x8109('0x5f')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x2a0d18=[{'model':db[_0x8109('0x3b')],'as':_0x8109('0x60'),'attributes':['id',_0x8109('0x39'),'from','to','cc',_0x8109('0x61'),'subject',_0x8109('0x62')],'where':{'secret':![]},'order':qs[_0x8109('0x44')]('id'),'include':_0x1e9bab}];return db['MailInteraction']['find']({'where':{'id':_0x422f4d[_0x8109('0x2c')]['id']},'include':_0x2a0d18})[_0x8109('0x19')](handleEntityNotFound(_0x16e3b9,null))[_0x8109('0x19')](function(_0x19deeb){if(_0x19deeb&&_0x19deeb[_0x8109('0x60')]){var _0x46a940=_0x19deeb['get']({'plain':!![]});fs['mkdirSync'](_0x2614b5);return BPromise['each'](_0x46a940['Messages'],function(_0x1addbe,_0x403a7d){var _0x2ac638={'from':_0x1addbe[_0x8109('0x63')],'to':_0x1addbe['to']||_0x8109('0x64'),'subject':_0x1addbe[_0x8109('0x65')],'html':htmlEntities['decode'](_0x1addbe[_0x8109('0x39')]),'headers':{'Date':moment(_0x1addbe[_0x8109('0x62')])['format'](_0x8109('0x66'))},'attachments':[]};if(_0x1addbe['cc']){_0x2ac638[_0x8109('0x67')]['Cc']=_0x1addbe['cc'];}if(_0x1addbe[_0x8109('0x61')]){_0x2ac638[_0x8109('0x67')][_0x8109('0x68')]=_0x1addbe[_0x8109('0x61')];}return new BPromise(function(_0x2f3427,_0x4284a9){if(_0x1addbe[_0x8109('0x69')]){for(var _0x4dc5e6=0x0;_0x4dc5e6<_0x1addbe[_0x8109('0x69')]['length'];_0x4dc5e6++){var _0x3e043=_0x1addbe['Attachments'][_0x4dc5e6];var _0x248d3f=path['join'](_0x2df27c,_0x3e043['basename']);if(fs[_0x8109('0x6a')](_0x248d3f)){_0x2ac638['attachments']['push']({'name':_0x3e043[_0x8109('0x1e')],'contentType':_0x3e043[_0x8109('0x24')],'data':fs[_0x8109('0x6b')](_0x248d3f)});}}}emlformat[_0x8109('0x6c')](_0x2ac638,function(_0x207c67,_0x5199d1){if(_0x207c67)return _0x4284a9(_0x207c67);fs[_0x8109('0x6d')](path['join'](_0x2614b5,util[_0x8109('0x4a')]('message%d.eml',_0x403a7d)),_0x5199d1);return _0x2f3427(_0x5199d1);});});})[_0x8109('0x19')](function(){return new BPromise(function(_0x19e12d,_0x4e5cc5){zipdir(_0x2614b5,{'saveTo':_0x139813},function(_0x58d938,_0x544e45){if(_0x58d938)return _0x4e5cc5(_0x58d938);return _0x19e12d(_0x544e45);});})['then'](function(){return new BPromise(function(_0x2c2b89,_0x346f6c){rimraf(_0x2614b5,function(_0x806d7c){if(_0x806d7c)_0x346f6c(_0x806d7c);return _0x2c2b89();});});})[_0x8109('0x19')](function(){return _0x16e3b9[_0x8109('0x55')](_0x139813,_0x1694f9,function(_0x122a30){if(!_0x122a30)fs[_0x8109('0x6e')](_0x139813);});});});}else{return _0x16e3b9[_0x8109('0x12')](0xc8);}})[_0x8109('0x2a')](handleError(_0x16e3b9,null));}; \ No newline at end of file +var _0x3213=['attachments','join','push','Attachment','from','bcc','createdAt','Messages','get','mkdirSync','each','missing.recipient@your.company.com','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','destroy','then','error','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','keys','model','attributes','fields','length','include','merge','create','update','body','find','params','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','filters','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','inlineCss','rows','spread','Tag','color','emit','removeTags','download','toString','root','server','files','tmp'];(function(_0x28e43a,_0x4d5664){var _0x1c4767=function(_0x3dc8dc){while(--_0x3dc8dc){_0x28e43a['push'](_0x28e43a['shift']());}};_0x1c4767(++_0x4d5664);}(_0x3213,0x88));var _0x3321=function(_0x228677,_0x2e4ec3){_0x228677=_0x228677-0x0;var _0x355360=_0x3213[_0x228677];return _0x355360;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3321('0x0'));var moment=require(_0x3321('0x1'));var BPromise=require(_0x3321('0x2'));var util=require(_0x3321('0x3'));var path=require(_0x3321('0x4'));var fs=require('fs');var _=require(_0x3321('0x5'));var juice=require(_0x3321('0x6'));var Redis=require(_0x3321('0x7'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3321('0x8'));var config=require(_0x3321('0x9'));var db=require(_0x3321('0xa'))['db'];var htmlEntities=require(_0x3321('0xb'));config[_0x3321('0xc')]=_[_0x3321('0xd')](config['redis'],{'host':_0x3321('0xe'),'port':0x18eb});var socket=require(_0x3321('0xf'))(new Redis(config[_0x3321('0xc')]));require('./mailInteraction.socket')[_0x3321('0x10')](socket);function respondWithStatusCode(_0x3a830a,_0x3fb386){_0x3fb386=_0x3fb386||0xcc;return function(_0x59e40b){if(_0x59e40b){return _0x3a830a[_0x3321('0x11')](_0x3fb386);}return _0x3a830a[_0x3321('0x12')](_0x3fb386)[_0x3321('0x13')]();};}function respondWithResult(_0x28692e,_0x16c51c){_0x16c51c=_0x16c51c||0xc8;return function(_0x3da6cc){if(_0x3da6cc){return _0x28692e[_0x3321('0x12')](_0x16c51c)[_0x3321('0x14')](_0x3da6cc);}};}function respondWithFilteredResult(_0x10a03d,_0x1c494d){return function(_0xbd9248){if(_0xbd9248){var _0x25a785=typeof _0x1c494d[_0x3321('0x15')]===_0x3321('0x16')&&typeof _0x1c494d[_0x3321('0x17')]===_0x3321('0x16');var _0x19a185=_0xbd9248[_0x3321('0x18')];var _0x315607=_0x25a785?0x0:_0x1c494d[_0x3321('0x15')];var _0x50aecc=_0x25a785?_0xbd9248['count']:_0x1c494d[_0x3321('0x15')]+_0x1c494d[_0x3321('0x17')];var _0x2b8eb6;if(_0x50aecc>=_0x19a185){_0x50aecc=_0x19a185;_0x2b8eb6=0xc8;}else{_0x2b8eb6=0xce;}_0x10a03d[_0x3321('0x12')](_0x2b8eb6);return _0x10a03d['set'](_0x3321('0x19'),_0x315607+'-'+_0x50aecc+'/'+_0x19a185)['json'](_0xbd9248);}return null;};}function saveUpdates(_0x2eac41){return function(_0x33dcb6){if(_0x33dcb6){return _0x33dcb6['update'](_0x2eac41)['then'](function(_0x2fb07d){return _0x2fb07d;});}return null;};}function removeEntity(_0xe88c64){return function(_0x3c1928){if(_0x3c1928){return _0x3c1928[_0x3321('0x1a')]()[_0x3321('0x1b')](function(){_0xe88c64['status'](0xcc)[_0x3321('0x13')]();});}};}function handleEntityNotFound(_0x171281){return function(_0x1a001d){if(!_0x1a001d){_0x171281[_0x3321('0x11')](0x194);}return _0x1a001d;};}function handleError(_0x3f5637,_0xc6d516){_0xc6d516=_0xc6d516||0x1f4;return function(_0x4facbb){logger[_0x3321('0x1c')](_0x4facbb['stack']);if(_0x4facbb[_0x3321('0x1d')]){delete _0x4facbb[_0x3321('0x1d')];}_0x3f5637[_0x3321('0x12')](_0xc6d516)[_0x3321('0x1e')](_0x4facbb);};}exports[_0x3321('0x1f')]=function(_0x545312,_0x23829b){var _0x2ee6e9={};var _0x907a29=_[_0x3321('0x20')](db[_0x3321('0x21')][_0x3321('0x22')],function(_0x49dee3){return{'name':_0x49dee3[_0x3321('0x23')],'type':_0x49dee3[_0x3321('0x24')][_0x3321('0x25')]};});_0x2ee6e9=qs['getOptions'](_0x907a29,_0x545312);return interaction[_0x3321('0x26')]('mail',_0x545312[_0x3321('0x27')],_0x545312[_0x3321('0x28')],_0x2ee6e9,_0x907a29)[_0x3321('0x1b')](respondWithFilteredResult(_0x23829b,_0x2ee6e9))[_0x3321('0x29')](handleError(_0x23829b,null));};exports[_0x3321('0x2a')]=function(_0x5f2bd9,_0x35a70c){var _0x1cd668={'raw':![],'where':{'id':_0x5f2bd9['params']['id']}},_0x7c520e={};_0x7c520e['model']=_[_0x3321('0x2b')](db[_0x3321('0x21')][_0x3321('0x22')]);_0x7c520e[_0x3321('0x27')]=_[_0x3321('0x2b')](_0x5f2bd9[_0x3321('0x27')]);_0x7c520e['filters']=_['intersection'](_0x7c520e[_0x3321('0x2c')],_0x7c520e[_0x3321('0x27')]);_0x1cd668[_0x3321('0x2d')]=_['intersection'](_0x7c520e[_0x3321('0x2c')],qs[_0x3321('0x2e')](_0x5f2bd9[_0x3321('0x27')][_0x3321('0x2e')]));_0x1cd668[_0x3321('0x2d')]=_0x1cd668['attributes'][_0x3321('0x2f')]?_0x1cd668[_0x3321('0x2d')]:_0x7c520e[_0x3321('0x2c')];if(_0x5f2bd9[_0x3321('0x27')]['includeAll']){_0x1cd668[_0x3321('0x30')]=[{'all':!![]}];}_0x1cd668=_[_0x3321('0x31')]({},_0x1cd668,_0x5f2bd9['options']);return db['MailInteraction']['find'](_0x1cd668)[_0x3321('0x1b')](handleEntityNotFound(_0x35a70c,null))[_0x3321('0x1b')](respondWithResult(_0x35a70c,null))['catch'](handleError(_0x35a70c,null));};exports[_0x3321('0x32')]=function(_0x57f52c,_0x20995e){return db[_0x3321('0x21')][_0x3321('0x32')](_0x57f52c['body'],{})['then'](respondWithResult(_0x20995e,0xc9))[_0x3321('0x29')](handleError(_0x20995e,null));};exports[_0x3321('0x33')]=function(_0x2f02c3,_0x14d90f){if(_0x2f02c3[_0x3321('0x34')]['id']){delete _0x2f02c3[_0x3321('0x34')]['id'];}return db['MailInteraction'][_0x3321('0x35')]({'where':{'id':_0x2f02c3[_0x3321('0x36')]['id']}})[_0x3321('0x1b')](handleEntityNotFound(_0x14d90f,null))[_0x3321('0x1b')](saveUpdates(_0x2f02c3[_0x3321('0x34')],null))[_0x3321('0x1b')](respondWithResult(_0x14d90f,null))[_0x3321('0x29')](handleError(_0x14d90f,null));};exports[_0x3321('0x1a')]=function(_0x541176,_0x437b54){return db[_0x3321('0x21')][_0x3321('0x35')]({'where':{'id':_0x541176['params']['id']}})['then'](handleEntityNotFound(_0x437b54,null))[_0x3321('0x1b')](removeEntity(_0x437b54,null))[_0x3321('0x29')](handleError(_0x437b54,null));};exports[_0x3321('0x37')]=function(_0x43f573,_0x24a5bf){return db['MailInteraction'][_0x3321('0x37')]()[_0x3321('0x1b')](respondWithResult(_0x24a5bf,null))[_0x3321('0x29')](handleError(_0x24a5bf,null));};exports[_0x3321('0x38')]=function(_0x32d0a1,_0x12b68f){return db[_0x3321('0x39')]['find']({'where':{'id':_0x32d0a1[_0x3321('0x36')]['id']}})[_0x3321('0x1b')](handleEntityNotFound(_0x12b68f,null))['then'](function(_0x3ea6b6){if(_0x3ea6b6){return _0x3ea6b6[_0x3321('0x38')](_0x32d0a1[_0x3321('0x34')][_0x3321('0x3a')],_[_0x3321('0x3b')](_0x32d0a1['body'],[_0x3321('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x12b68f,null))[_0x3321('0x29')](handleError(_0x12b68f,null));};exports[_0x3321('0x3c')]=function(_0x4e5012,_0x3d0664){var _0x57f5af={'raw':![],'where':{}};var _0x3c1387={};var _0x5efe84={'count':0x0,'rows':[]};return db[_0x3321('0x21')][_0x3321('0x3d')]({'where':{'id':_0x4e5012[_0x3321('0x36')]['id']}})[_0x3321('0x1b')](handleEntityNotFound(_0x3d0664,null))[_0x3321('0x1b')](function(_0x218570){if(_0x218570){_0x3c1387[_0x3321('0x2c')]=_['keys'](db['MailMessage'][_0x3321('0x22')]);_0x3c1387['query']=_['keys'](_0x4e5012[_0x3321('0x27')]);_0x3c1387[_0x3321('0x3e')]=_[_0x3321('0x3f')](_0x3c1387[_0x3321('0x2c')],_0x3c1387[_0x3321('0x27')]);_0x57f5af[_0x3321('0x2d')]=_[_0x3321('0x3f')](_0x3c1387[_0x3321('0x2c')],qs[_0x3321('0x2e')](_0x4e5012[_0x3321('0x27')][_0x3321('0x2e')]));_0x57f5af[_0x3321('0x2d')]=_0x57f5af['attributes'][_0x3321('0x2f')]?_0x57f5af[_0x3321('0x2d')]:_0x3c1387[_0x3321('0x2c')];if(!_0x4e5012[_0x3321('0x27')][_0x3321('0x40')](_0x3321('0x41'))){_0x57f5af[_0x3321('0x17')]=qs[_0x3321('0x17')](_0x4e5012['query']['limit']);_0x57f5af[_0x3321('0x15')]=qs[_0x3321('0x15')](_0x4e5012[_0x3321('0x27')]['offset']);}_0x57f5af[_0x3321('0x42')]=qs[_0x3321('0x43')](_0x4e5012['query']['sort']);_0x57f5af[_0x3321('0x44')]=qs[_0x3321('0x3e')](_[_0x3321('0x45')](_0x4e5012[_0x3321('0x27')],_0x3c1387[_0x3321('0x3e')]));_0x57f5af[_0x3321('0x44')]['MailInteractionId']=_0x218570['id'];if(_0x4e5012[_0x3321('0x27')][_0x3321('0x46')]){_0x57f5af[_0x3321('0x44')]=_[_0x3321('0x31')](_0x57f5af[_0x3321('0x44')],{'$or':_[_0x3321('0x20')](_0x57f5af[_0x3321('0x2d')],function(_0x26315d){var _0x28d3aa={};_0x28d3aa[_0x26315d]={'$like':'%'+_0x4e5012[_0x3321('0x27')][_0x3321('0x46')]+'%'};return _0x28d3aa;})});}if(_0x4e5012['query']['$gte']){var _0xa405c6=_0x4e5012[_0x3321('0x27')][_0x3321('0x47')][_0x3321('0x48')](',');var _0x3da66f={};_0x3da66f[_0xa405c6[0x0]]={'$gte':moment(_0xa405c6[0x1])[_0x3321('0x49')](_0x3321('0x4a'))};_0x57f5af[_0x3321('0x44')]=_['merge'](_0x57f5af[_0x3321('0x44')],_0x3da66f);}_0x57f5af=_[_0x3321('0x31')]({},_0x57f5af,_0x4e5012[_0x3321('0x4b')]);return db[_0x3321('0x39')][_0x3321('0x18')]({'where':_0x57f5af[_0x3321('0x44')]})[_0x3321('0x1b')](function(_0x4d98da){_0x5efe84[_0x3321('0x18')]=_0x4d98da;if(_0x4e5012[_0x3321('0x27')][_0x3321('0x4c')]){_0x57f5af[_0x3321('0x30')]=[{'all':!![]}];}return db[_0x3321('0x39')]['findAll'](_0x57f5af);})[_0x3321('0x1b')](function(_0x27a709){if(_0x4e5012[_0x3321('0x27')][_0x3321('0x4d')]==='true'){for(var _0x2718c5=0x0;_0x2718c5<_0x27a709[_0x3321('0x2f')];_0x2718c5++){_0x27a709[_0x2718c5][_0x3321('0x34')]=juice(_0x27a709[_0x2718c5][_0x3321('0x34')]);}}_0x5efe84[_0x3321('0x4e')]=_0x27a709;return _0x5efe84;});}})[_0x3321('0x1b')](respondWithFilteredResult(_0x3d0664,_0x57f5af))['catch'](handleError(_0x3d0664,null));};exports['addTags']=function(_0x46310e,_0x34c107){return db[_0x3321('0x21')]['find']({'where':{'id':_0x46310e[_0x3321('0x36')]['id']}})[_0x3321('0x1b')](handleEntityNotFound(_0x34c107,null))[_0x3321('0x1b')](function(_0x490f4e){if(_0x490f4e){return _0x490f4e['setTags'](_0x46310e[_0x3321('0x34')]['ids'],_[_0x3321('0x3b')](_0x46310e[_0x3321('0x34')],[_0x3321('0x3a'),'id'])||{})[_0x3321('0x4f')](function(){return db[_0x3321('0x50')]['findAll']({'attributes':['id',_0x3321('0x1d'),_0x3321('0x51')],'where':{'id':_0x46310e[_0x3321('0x34')][_0x3321('0x3a')]}});})['then'](function(_0x40c23b){socket[_0x3321('0x52')]('mailInteractionTags:save',{'id':Number(_0x46310e[_0x3321('0x36')]['id']),'tags':_0x40c23b||[]});return{'id':Number(_0x46310e[_0x3321('0x36')]['id']),'tags':_0x40c23b||[]};});}})[_0x3321('0x1b')](respondWithResult(_0x34c107,null))['catch'](handleError(_0x34c107,null));};exports[_0x3321('0x53')]=function(_0x4042f5,_0x53622c){return db[_0x3321('0x21')]['find']({'where':{'id':_0x4042f5['params']['id']}})[_0x3321('0x1b')](handleEntityNotFound(_0x53622c,null))[_0x3321('0x1b')](function(_0x871d52){if(_0x871d52){return _0x871d52[_0x3321('0x53')](_0x4042f5[_0x3321('0x27')][_0x3321('0x3a')]);}})[_0x3321('0x1b')](respondWithStatusCode(_0x53622c,null))[_0x3321('0x29')](handleError(_0x53622c,null));};exports[_0x3321('0x54')]=function(_0x302f2d,_0x2b9468){var _0x293a56=moment()['unix']()[_0x3321('0x55')]();var _0x39ffa9=path['join'](config[_0x3321('0x56')],_0x3321('0x57'),_0x3321('0x58'),_0x3321('0x59'));var _0x54baac=path['join'](config[_0x3321('0x56')],'server',_0x3321('0x58'),_0x3321('0x5a'));var _0x15f059=path[_0x3321('0x5b')](_0x39ffa9,_0x293a56);var _0x5e5cb4=util[_0x3321('0x49')]('transcript-%d-%s.zip',_0x302f2d[_0x3321('0x36')]['id'],_0x293a56);var _0x3c191b=path[_0x3321('0x5b')](_0x39ffa9,_0x5e5cb4);var _0x379084=[];if(_0x302f2d['query'][_0x3321('0x5a')]){_0x379084[_0x3321('0x5c')]({'model':db[_0x3321('0x5d')],'as':'Attachments','raw':!![]});}var _0x4715bb=[{'model':db[_0x3321('0x39')],'as':'Messages','attributes':['id',_0x3321('0x34'),_0x3321('0x5e'),'to','cc',_0x3321('0x5f'),'subject',_0x3321('0x60')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x379084}];return db[_0x3321('0x21')][_0x3321('0x35')]({'where':{'id':_0x302f2d[_0x3321('0x36')]['id']},'include':_0x4715bb})[_0x3321('0x1b')](handleEntityNotFound(_0x2b9468,null))[_0x3321('0x1b')](function(_0x48233e){if(_0x48233e&&_0x48233e[_0x3321('0x61')]){var _0x2b1191=_0x48233e[_0x3321('0x62')]({'plain':!![]});fs[_0x3321('0x63')](_0x15f059);return BPromise[_0x3321('0x64')](_0x2b1191[_0x3321('0x61')],function(_0x45434c,_0x256559){var _0x37b039={'from':_0x45434c[_0x3321('0x5e')],'to':_0x45434c['to']||_0x3321('0x65'),'subject':_0x45434c[_0x3321('0x66')],'html':htmlEntities[_0x3321('0x67')](_0x45434c[_0x3321('0x34')]),'headers':{'Date':moment(_0x45434c[_0x3321('0x60')])[_0x3321('0x49')](_0x3321('0x68'))},'attachments':[]};if(_0x45434c['cc']){_0x37b039[_0x3321('0x69')]['Cc']=_0x45434c['cc'];}if(_0x45434c[_0x3321('0x5f')]){_0x37b039['headers'][_0x3321('0x6a')]=_0x45434c[_0x3321('0x5f')];}return new BPromise(function(_0x8d93e2,_0x57d43d){if(_0x45434c[_0x3321('0x6b')]){for(var _0x421fb2=0x0;_0x421fb2<_0x45434c['Attachments'][_0x3321('0x2f')];_0x421fb2++){var _0x3ece34=_0x45434c[_0x3321('0x6b')][_0x421fb2];var _0x43ee4f=path['join'](_0x54baac,_0x3ece34['basename']);if(fs['existsSync'](_0x43ee4f)){_0x37b039[_0x3321('0x5a')][_0x3321('0x5c')]({'name':_0x3ece34[_0x3321('0x1d')],'contentType':_0x3ece34[_0x3321('0x24')],'data':fs[_0x3321('0x6c')](_0x43ee4f)});}}}emlformat[_0x3321('0x6d')](_0x37b039,function(_0x8013c7,_0x20d463){if(_0x8013c7)return _0x57d43d(_0x8013c7);fs[_0x3321('0x6e')](path[_0x3321('0x5b')](_0x15f059,util[_0x3321('0x49')](_0x3321('0x6f'),_0x256559)),_0x20d463);return _0x8d93e2(_0x20d463);});});})[_0x3321('0x1b')](function(){return new BPromise(function(_0xa69108,_0x25ba29){zipdir(_0x15f059,{'saveTo':_0x3c191b},function(_0x738dce,_0xc7eccf){if(_0x738dce)return _0x25ba29(_0x738dce);return _0xa69108(_0xc7eccf);});})['then'](function(){return new BPromise(function(_0x2ffdec,_0x264c46){rimraf(_0x15f059,function(_0x2a3a62){if(_0x2a3a62)_0x264c46(_0x2a3a62);return _0x2ffdec();});});})['then'](function(){return _0x2b9468[_0x3321('0x54')](_0x3c191b,_0x5e5cb4,function(_0x4c85e2){if(!_0x4c85e2)fs[_0x3321('0x70')](_0x3c191b);});});});}else{return _0x2b9468[_0x3321('0x11')](0xc8);}})[_0x3321('0x29')](handleError(_0x2b9468,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b205732..7d359bd 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 _0xee0e=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0xee0e,0x71));var _0xeee0=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xee0e[_0x31991b];return _0x307304;};'use strict';var EventEmitter=require(_0xeee0('0x0'));var MailInteraction=require(_0xeee0('0x1'))['db'][_0xeee0('0x2')];var MailMessage=require(_0xeee0('0x1'))['db'][_0xeee0('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xeee0('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeee0('0x5'),'afterDestroy':_0xeee0('0x6')};function emitEvent(_0x195dba){return function(_0x43efd9,_0x1ddffe,_0x58ccbb){_0x43efd9['getUsers']({'attributes':['id'],'raw':!![]})[_0xeee0('0x7')](function(_0x16dde9){_0x43efd9[_0xeee0('0x8')](_0xeee0('0x9'),_0x16dde9[_0xeee0('0xa')](function(_0x33f7ec){return{'id':_0x33f7ec['id']};}));return MailMessage[_0xeee0('0xb')]({'where':{'MailInteractionId':_0x43efd9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeee0('0x7')](function(_0x54d430){_0x43efd9[_0xeee0('0x8')](_0xeee0('0xc'),_0x54d430['length']);MailInteractionEvents['emit'](_0x195dba+':'+_0x43efd9['id'],_0x43efd9);MailInteractionEvents[_0xeee0('0xd')](_0x195dba,_0x43efd9);_0x58ccbb(null);})[_0xeee0('0xe')](_0x58ccbb(null));};}for(var e in events){if(events[_0xeee0('0xf')](e)){var event=events[e];MailInteraction[_0xeee0('0x10')](e,emitEvent(event));}}module[_0xeee0('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x5e16=['then','Users','map','findAll','setDataValue','unreadMessages','length','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5e16,0xf7));var _0x65e1=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x5e16[_0x1e06f1];return _0x34f77e;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x65e1('0x0'))['db'][_0x65e1('0x1')];var MailMessage=require(_0x65e1('0x0'))['db'][_0x65e1('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x65e1('0x3')](0x0);var events={'afterCreate':_0x65e1('0x4'),'afterUpdate':_0x65e1('0x5'),'afterDestroy':_0x65e1('0x6')};function emitEvent(_0x2c5db1){return function(_0x7a01c9,_0x25b752,_0x3407dd){_0x7a01c9[_0x65e1('0x7')]({'attributes':['id'],'raw':!![]})[_0x65e1('0x8')](function(_0x671c35){_0x7a01c9['setDataValue'](_0x65e1('0x9'),_0x671c35[_0x65e1('0xa')](function(_0x283a1f){return{'id':_0x283a1f['id']};}));return MailMessage[_0x65e1('0xb')]({'where':{'MailInteractionId':_0x7a01c9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x65e1('0x8')](function(_0x122031){_0x7a01c9[_0x65e1('0xc')](_0x65e1('0xd'),_0x122031[_0x65e1('0xe')]);MailInteractionEvents['emit'](_0x2c5db1+':'+_0x7a01c9['id'],_0x7a01c9);MailInteractionEvents['emit'](_0x2c5db1,_0x7a01c9);_0x3407dd(null);})['catch'](_0x3407dd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x65e1('0xf')](e,emitEvent(event));}}module[_0x65e1('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index ebf325d..81a6d59 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 _0xda61=['changed','substatusAt','closedAt','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0xda61,0x1de));var _0x1da6=function(_0x3e4811,_0x509c4e){_0x3e4811=_0x3e4811-0x0;var _0x37abad=_0xda61[_0x3e4811];return _0x37abad;};'use strict';var _=require(_0x1da6('0x0'));var util=require(_0x1da6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1da6('0x2'));var BPromise=require(_0x1da6('0x3'));var rp=require(_0x1da6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1da6('0x5'));var attributes=require(_0x1da6('0x6'));module['exports']=function(_0x729e37,_0x1b1220){return _0x729e37[_0x1da6('0x7')](_0x1da6('0x8'),attributes,{'tableName':_0x1da6('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1da6('0xa'),'to'],'type':_0x1da6('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28ce98,_0x14c4c3,_0x35845e){if(_0x28ce98[_0x1da6('0xc')]){_0x28ce98['substatusAt']=moment()[_0x1da6('0xd')](_0x1da6('0xe'));}if(_0x28ce98[_0x1da6('0xf')]){_0x28ce98['closedAt']=moment()[_0x1da6('0xd')](_0x1da6('0xe'));}_0x35845e(null,_0x14c4c3);},'beforeUpdate':function(_0x2c6303,_0x1c72b7,_0x38a628){if(_0x2c6303[_0x1da6('0x10')](_0x1da6('0xc'))){_0x2c6303[_0x1da6('0x11')]=_0x2c6303[_0x1da6('0xc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2c6303[_0x1da6('0x10')](_0x1da6('0xf'))){_0x2c6303[_0x1da6('0x12')]=moment()[_0x1da6('0xd')](_0x1da6('0xe'));_0x2c6303[_0x1da6('0xc')]=null;_0x2c6303[_0x1da6('0x11')]=null;}_0x38a628(null,_0x2c6303);},'afterUpdate':function(_0x44448b,_0x4974fa,_0x52de81){var _0x90e589=_0x729e37[_0x1da6('0x13')];var _0x102642=_0x44448b[_0x1da6('0x14')]({'plain':!![]});if(_0x102642[_0x1da6('0xf')]){return _0x90e589[_0x1da6('0x15')][_0x1da6('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x102642['id']}})[_0x1da6('0x17')](function(){_0x52de81();})['catch'](function(_0x46e7a8){_0x52de81(_0x46e7a8);});}else{_0x52de81();}}},'charset':_0x1da6('0x18'),'collate':_0x1da6('0x19')});}; \ No newline at end of file +var _0x83b2=['rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','path'];(function(_0x2822b3,_0x49842b){var _0x4b9178=function(_0x265ccd){while(--_0x265ccd){_0x2822b3['push'](_0x2822b3['shift']());}};_0x4b9178(++_0x49842b);}(_0x83b2,0x1be));var _0x283b=function(_0x2d963d,_0x5e883c){_0x2d963d=_0x2d963d-0x0;var _0x141b67=_0x83b2[_0x2d963d];return _0x141b67;};'use strict';var _=require(_0x283b('0x0'));var util=require(_0x283b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x283b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x283b('0x3'));var rimraf=require(_0x283b('0x4'));var config=require(_0x283b('0x5'));var attributes=require(_0x283b('0x6'));module[_0x283b('0x7')]=function(_0x31da83,_0x35c164){return _0x31da83['define'](_0x283b('0x8'),attributes,{'tableName':_0x283b('0x9'),'paranoid':![],'indexes':[{'name':_0x283b('0xa'),'fields':[_0x283b('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xba713a,_0x48d4da,_0x48d005){if(_0xba713a[_0x283b('0xc')]){_0xba713a[_0x283b('0xd')]=moment()[_0x283b('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xba713a[_0x283b('0xf')]){_0xba713a['closedAt']=moment()[_0x283b('0xe')](_0x283b('0x10'));}_0x48d005(null,_0x48d4da);},'beforeUpdate':function(_0x5ac61a,_0x2e6461,_0x569f5e){if(_0x5ac61a[_0x283b('0x11')](_0x283b('0xc'))){_0x5ac61a['substatusAt']=_0x5ac61a[_0x283b('0xc')]?moment()[_0x283b('0xe')](_0x283b('0x10')):null;}if(_0x5ac61a[_0x283b('0x11')]('closed')){_0x5ac61a['closedAt']=moment()[_0x283b('0xe')](_0x283b('0x10'));_0x5ac61a[_0x283b('0xc')]=null;_0x5ac61a[_0x283b('0xd')]=null;}_0x569f5e(null,_0x5ac61a);},'afterUpdate':function(_0x203a59,_0x1171e2,_0x5f20cd){var _0x1df2c9=_0x31da83['models'];var _0x3c3cce=_0x203a59[_0x283b('0x12')]({'plain':!![]});if(_0x3c3cce[_0x283b('0xf')]){return _0x1df2c9[_0x283b('0x13')][_0x283b('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x3c3cce['id']}})[_0x283b('0x15')](function(){_0x5f20cd();})[_0x283b('0x16')](function(_0x195907){_0x5f20cd(_0x195907);});}else{_0x5f20cd();}}},'charset':_0x283b('0x17'),'collate':_0x283b('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 7aed15c..99d177a 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 _0x5a43=['ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailInteraction','update','options','raw','where','attributes','UpdateMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x123f0b,_0x30123a){var _0x441a2a=function(_0xf33b67){while(--_0xf33b67){_0x123f0b['push'](_0x123f0b['shift']());}};_0x441a2a(++_0x30123a);}(_0x5a43,0xf1));var _0x35a4=function(_0x565bf0,_0x4a59b5){_0x565bf0=_0x565bf0-0x0;var _0x21ee7f=_0x5a43[_0x565bf0];return _0x21ee7f;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require(_0x35a4('0x2'));var BPromise=require(_0x35a4('0x3'));var rs=require(_0x35a4('0x4'));var fs=require('fs');var Redis=require(_0x35a4('0x5'));var db=require(_0x35a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});config[_0x35a4('0xa')]=_[_0x35a4('0xb')](config[_0x35a4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a4('0xc'))(new Redis(config[_0x35a4('0xa')]));require(_0x35a4('0xd'))[_0x35a4('0xe')](socket);function respondWithRpcPromise(_0x43df6d,_0x351402,_0x4acf73){return new BPromise(function(_0x501e7e,_0x55910f){return client[_0x35a4('0xf')](_0x43df6d,_0x4acf73)['then'](function(_0x3d777f){logger[_0x35a4('0x10')](_0x35a4('0x11'),_0x351402,'request\x20sent');logger[_0x35a4('0x12')](_0x35a4('0x13'),_0x351402,_0x35a4('0x14'),JSON[_0x35a4('0x15')](_0x3d777f));if(_0x3d777f['error']){if(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x17')]===0x1f4){logger['error'](_0x35a4('0x11'),_0x351402,_0x3d777f['error'][_0x35a4('0x18')]);return _0x55910f(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);return _0x501e7e(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}else{logger['info'](_0x35a4('0x11'),_0x351402,_0x35a4('0x14'));_0x501e7e(_0x3d777f[_0x35a4('0x19')][_0x35a4('0x18')]);}})[_0x35a4('0x1a')](function(_0x1197b0){logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x1197b0);_0x55910f(_0x1197b0);});});}exports['UpdateMailInteraction']=function(_0x15113f){var _0x5f2b95=this;return new Promise(function(_0x4dcdb2,_0x3e48b3){return db[_0x35a4('0x1b')][_0x35a4('0x1c')](_0x15113f['body'],{'raw':_0x15113f[_0x35a4('0x1d')]?_0x15113f[_0x35a4('0x1d')][_0x35a4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15113f['options']?_0x15113f[_0x35a4('0x1d')][_0x35a4('0x1f')]||null:null,'attributes':_0x15113f['options']?_0x15113f[_0x35a4('0x1d')][_0x35a4('0x20')]||null:null,'limit':_0x15113f[_0x35a4('0x1d')]?_0x15113f[_0x35a4('0x1d')]['limit']||null:null})['then'](function(_0x7a193c){logger['info'](_0x35a4('0x21'),_0x15113f);logger[_0x35a4('0x12')](_0x35a4('0x21'),_0x15113f,JSON[_0x35a4('0x15')](_0x7a193c));_0x4dcdb2(_0x7a193c);})[_0x35a4('0x1a')](function(_0x2f8e6c){logger['error']('UpdateMailInteraction',_0x2f8e6c['message'],_0x15113f);_0x3e48b3(_0x5f2b95[_0x35a4('0x16')](0x1f4,_0x2f8e6c[_0x35a4('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x490002){return new Promise(function(_0x7d2c5,_0x410aa9){return db[_0x35a4('0x1b')][_0x35a4('0x22')]({'where':_0x490002['options']?_0x490002['options']['where']||null:null})['then'](function(_0x12863a){if(_0x12863a){return _0x12863a[_0x35a4('0x23')](_0x490002[_0x35a4('0x24')][_0x35a4('0x25')],_[_0x35a4('0x26')](_0x490002[_0x35a4('0x24')],[_0x35a4('0x25'),'id'])||{});}})[_0x35a4('0x27')](function(_0x2a8e5e){logger[_0x35a4('0x10')](_0x35a4('0x28'),_0x490002);logger[_0x35a4('0x12')](_0x35a4('0x28'),_0x490002,JSON[_0x35a4('0x15')](_0x2a8e5e));_0x7d2c5(_0x2a8e5e);})[_0x35a4('0x1a')](function(_0x2cb4bf){logger['error'](_0x35a4('0x28'),_0x2cb4bf[_0x35a4('0x18')],_0x490002);_0x410aa9(_this[_0x35a4('0x16')](0x1f4,_0x2cb4bf['message']));});});}; \ No newline at end of file +var _0x1c3a=['request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateMailInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToMailInteraction','MailInteraction','find','addTags','omit','ids','spread','AddTags','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x377cce,_0x3b4f48){var _0x256bc9=function(_0x45d5ce){while(--_0x45d5ce){_0x377cce['push'](_0x377cce['shift']());}};_0x256bc9(++_0x3b4f48);}(_0x1c3a,0x9d));var _0xa1c3=function(_0x1b11ea,_0xe164b){_0x1b11ea=_0x1b11ea-0x0;var _0x5e9a75=_0x1c3a[_0x1b11ea];return _0x5e9a75;};'use strict';var _=require(_0xa1c3('0x0'));var util=require(_0xa1c3('0x1'));var moment=require(_0xa1c3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1c3('0x3'));var fs=require('fs');var Redis=require(_0xa1c3('0x4'));var db=require(_0xa1c3('0x5'))['db'];var utils=require(_0xa1c3('0x6'));var logger=require('../../config/logger')(_0xa1c3('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1c3('0x8'));var client=jayson['client'][_0xa1c3('0x9')]({'port':0x232a});config[_0xa1c3('0xa')]=_[_0xa1c3('0xb')](config[_0xa1c3('0xa')],{'host':_0xa1c3('0xc'),'port':0x18eb});var socket=require(_0xa1c3('0xd'))(new Redis(config[_0xa1c3('0xa')]));require('./mailInteraction.socket')[_0xa1c3('0xe')](socket);function respondWithRpcPromise(_0x395824,_0xfb31b6,_0x8b7bd9){return new BPromise(function(_0x2f3899,_0x4028ad){return client[_0xa1c3('0xf')](_0x395824,_0x8b7bd9)[_0xa1c3('0x10')](function(_0x4dfe1f){logger['info'](_0xa1c3('0x11'),_0xfb31b6,_0xa1c3('0x12'));logger['debug'](_0xa1c3('0x13'),_0xfb31b6,'request\x20sent',JSON['stringify'](_0x4dfe1f));if(_0x4dfe1f[_0xa1c3('0x14')]){if(_0x4dfe1f[_0xa1c3('0x14')][_0xa1c3('0x15')]===0x1f4){logger[_0xa1c3('0x14')](_0xa1c3('0x11'),_0xfb31b6,_0x4dfe1f[_0xa1c3('0x14')][_0xa1c3('0x16')]);return _0x4028ad(_0x4dfe1f[_0xa1c3('0x14')][_0xa1c3('0x16')]);}logger[_0xa1c3('0x14')](_0xa1c3('0x11'),_0xfb31b6,_0x4dfe1f['error'][_0xa1c3('0x16')]);return _0x2f3899(_0x4dfe1f['error'][_0xa1c3('0x16')]);}else{logger[_0xa1c3('0x17')]('MailInteraction,\x20%s,\x20%s',_0xfb31b6,_0xa1c3('0x12'));_0x2f3899(_0x4dfe1f[_0xa1c3('0x18')][_0xa1c3('0x16')]);}})[_0xa1c3('0x19')](function(_0x1d7d0b){logger[_0xa1c3('0x14')](_0xa1c3('0x11'),_0xfb31b6,_0x1d7d0b);_0x4028ad(_0x1d7d0b);});});}exports[_0xa1c3('0x1a')]=function(_0x152f3d){var _0x510dac=this;return new Promise(function(_0x454690,_0x5f4221){return db['MailInteraction']['update'](_0x152f3d[_0xa1c3('0x1b')],{'raw':_0x152f3d['options']?_0x152f3d[_0xa1c3('0x1c')][_0xa1c3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152f3d[_0xa1c3('0x1c')]?_0x152f3d['options'][_0xa1c3('0x1e')]||null:null,'attributes':_0x152f3d[_0xa1c3('0x1c')]?_0x152f3d[_0xa1c3('0x1c')][_0xa1c3('0x1f')]||null:null,'limit':_0x152f3d[_0xa1c3('0x1c')]?_0x152f3d[_0xa1c3('0x1c')][_0xa1c3('0x20')]||null:null})[_0xa1c3('0x10')](function(_0x120a7c){logger[_0xa1c3('0x17')](_0xa1c3('0x1a'),_0x152f3d);logger['debug'](_0xa1c3('0x1a'),_0x152f3d,JSON[_0xa1c3('0x21')](_0x120a7c));_0x454690(_0x120a7c);})[_0xa1c3('0x19')](function(_0x31f51d){logger[_0xa1c3('0x14')](_0xa1c3('0x1a'),_0x31f51d[_0xa1c3('0x16')],_0x152f3d);_0x5f4221(_0x510dac[_0xa1c3('0x14')](0x1f4,_0x31f51d[_0xa1c3('0x16')]));});});};exports[_0xa1c3('0x22')]=function(_0x220923){return new Promise(function(_0x540029,_0x333dd1){return db[_0xa1c3('0x23')][_0xa1c3('0x24')]({'where':_0x220923[_0xa1c3('0x1c')]?_0x220923[_0xa1c3('0x1c')][_0xa1c3('0x1e')]||null:null})[_0xa1c3('0x10')](function(_0x8c519f){if(_0x8c519f){return _0x8c519f[_0xa1c3('0x25')](_0x220923['body']['ids'],_[_0xa1c3('0x26')](_0x220923[_0xa1c3('0x1b')],[_0xa1c3('0x27'),'id'])||{});}})[_0xa1c3('0x28')](function(_0x2e97d9){logger['info'](_0xa1c3('0x29'),_0x220923);logger[_0xa1c3('0x2a')](_0xa1c3('0x29'),_0x220923,JSON[_0xa1c3('0x21')](_0x2e97d9));_0x540029(_0x2e97d9);})[_0xa1c3('0x19')](function(_0x2dd121){logger['error']('AddTags',_0x2dd121[_0xa1c3('0x16')],_0x220923);_0x333dd1(_this['error'](0x1f4,_0x2dd121[_0xa1c3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 93ed81b..9292274 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 _0xaf9a=['register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x430277,_0x249d02){var _0x8ea915=function(_0x3e792b){while(--_0x3e792b){_0x430277['push'](_0x430277['shift']());}};_0x8ea915(++_0x249d02);}(_0xaf9a,0x1a1));var _0xaaf9=function(_0x1c3f09,_0x1b7b17){_0x1c3f09=_0x1c3f09-0x0;var _0xa6efb8=_0xaf9a[_0x1c3f09];return _0xa6efb8;};'use strict';var MailInteractionEvents=require(_0xaaf9('0x0'));var events=[_0xaaf9('0x1'),_0xaaf9('0x2'),_0xaaf9('0x3')];function createListener(_0x440976,_0x5b26e9){return function(_0x3db4b5){_0x5b26e9[_0xaaf9('0x4')](_0x440976,_0x3db4b5);};}function removeListener(_0x5cb87f,_0x5e0214){return function(){MailInteractionEvents[_0xaaf9('0x5')](_0x5cb87f,_0x5e0214);};}exports[_0xaaf9('0x6')]=function(_0x56d4c0){for(var _0xe96fef=0x0,_0x5b57d3=events[_0xaaf9('0x7')];_0xe96fef<_0x5b57d3;_0xe96fef++){var _0x1ab199=events[_0xe96fef];var _0x32865a=createListener(_0xaaf9('0x8')+_0x1ab199,_0x56d4c0);MailInteractionEvents['on'](_0x1ab199,_0x32865a);}}; \ No newline at end of file +var _0x3102=['length','save','update','removeListener','register'];(function(_0x4a8d6e,_0x35b6ea){var _0x16dd8b=function(_0x4b426d){while(--_0x4b426d){_0x4a8d6e['push'](_0x4a8d6e['shift']());}};_0x16dd8b(++_0x35b6ea);}(_0x3102,0x137));var _0x2310=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x3102[_0x2c7618];return _0x5ce3f0;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2310('0x0'),'remove',_0x2310('0x1')];function createListener(_0x527c36,_0x2e45ec){return function(_0x22d090){_0x2e45ec['emit'](_0x527c36,_0x22d090);};}function removeListener(_0x45a5cc,_0x4dd5d3){return function(){MailInteractionEvents[_0x2310('0x2')](_0x45a5cc,_0x4dd5d3);};}exports[_0x2310('0x3')]=function(_0x25a950){for(var _0x4c9191=0x0,_0x5d4242=events[_0x2310('0x4')];_0x4c9191<_0x5d4242;_0x4c9191++){var _0x197d70=events[_0x4c9191];var _0xc99706=createListener('mailInteraction:'+_0x197d70,_0x25a950);MailInteractionEvents['on'](_0x197d70,_0xc99706);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f0a10d3..5e242a6 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 _0x0545=['/:id/accept','accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mailmessage:create','put','update'];(function(_0x2ec6e3,_0x2a1c97){var _0x1108bd=function(_0x42a454){while(--_0x42a454){_0x2ec6e3['push'](_0x2ec6e3['shift']());}};_0x1108bd(++_0x2a1c97);}(_0x0545,0x17e));var _0x5054=function(_0x74781d,_0x2b44f9){_0x74781d=_0x74781d-0x0;var _0x392d4f=_0x0545[_0x74781d];return _0x392d4f;};'use strict';var multer=require(_0x5054('0x0'));var util=require(_0x5054('0x1'));var path=require(_0x5054('0x2'));var timeout=require(_0x5054('0x3'));var express=require(_0x5054('0x4'));var router=express[_0x5054('0x5')]();var fs_extra=require(_0x5054('0x6'));var auth=require(_0x5054('0x7'));var interaction=require(_0x5054('0x8'));var config=require(_0x5054('0x9'));var controller=require(_0x5054('0xa'));router[_0x5054('0xb')]('/',auth[_0x5054('0xc')](),controller[_0x5054('0xd')]);router[_0x5054('0xb')](_0x5054('0xe'),auth[_0x5054('0xc')](),controller[_0x5054('0xf')]);router[_0x5054('0xb')](_0x5054('0x10'),auth['isAuthenticated'](),controller[_0x5054('0x11')]);router[_0x5054('0xb')](_0x5054('0x12'),auth[_0x5054('0xc')](),controller[_0x5054('0x13')]);router[_0x5054('0x14')]('/',auth[_0x5054('0xc')](),interaction['tracked']('mail',_0x5054('0x15')),controller['create']);router[_0x5054('0x16')](_0x5054('0x10'),auth[_0x5054('0xc')](),controller[_0x5054('0x17')]);router[_0x5054('0x16')](_0x5054('0x18'),auth[_0x5054('0xc')](),controller[_0x5054('0x19')]);router[_0x5054('0x16')](_0x5054('0x1a'),auth[_0x5054('0xc')](),controller[_0x5054('0x1b')]);router['delete'](_0x5054('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x5054('0x1c')]=router; \ No newline at end of file +var _0xaf4c=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','get','/describe','describe','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','delete','destroy','exports','util'];(function(_0x4d7bb8,_0x5df95e){var _0x4b1689=function(_0x5bf1f5){while(--_0x5bf1f5){_0x4d7bb8['push'](_0x4d7bb8['shift']());}};_0x4b1689(++_0x5df95e);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x339916,_0xca7e68){_0x339916=_0x339916-0x0;var _0x57bf01=_0xaf4c[_0x339916];return _0x57bf01;};'use strict';var multer=require('multer');var util=require(_0xcaf4('0x0'));var path=require(_0xcaf4('0x1'));var timeout=require('connect-timeout');var express=require(_0xcaf4('0x2'));var router=express[_0xcaf4('0x3')]();var fs_extra=require(_0xcaf4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var controller=require(_0xcaf4('0x7'));router['get']('/',auth[_0xcaf4('0x8')](),controller['index']);router[_0xcaf4('0x9')](_0xcaf4('0xa'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0xb')]);router[_0xcaf4('0x9')](_0xcaf4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcaf4('0x9')](_0xcaf4('0xd'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0xe')]);router[_0xcaf4('0xf')]('/',auth[_0xcaf4('0x8')](),interaction[_0xcaf4('0x10')](_0xcaf4('0x11'),_0xcaf4('0x12')),controller['create']);router[_0xcaf4('0x13')](_0xcaf4('0xc'),auth['isAuthenticated'](),controller[_0xcaf4('0x14')]);router[_0xcaf4('0x13')](_0xcaf4('0x15'),auth['isAuthenticated'](),controller[_0xcaf4('0x16')]);router[_0xcaf4('0x13')]('/:id/reject',auth[_0xcaf4('0x8')](),controller['reject']);router[_0xcaf4('0x17')](_0xcaf4('0xc'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0x18')]);module[_0xcaf4('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 823bb75..67627b8 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 _0x4086=['TEXT','long','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email','lodash','exports'];(function(_0x22a4ce,_0x174559){var _0x1c173a=function(_0x389ac8){while(--_0x389ac8){_0x22a4ce['push'](_0x22a4ce['shift']());}};_0x1c173a(++_0x174559);}(_0x4086,0x1e2));var _0x6408=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4086[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6408('0x0'));module[_0x6408('0x1')]={'body':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6408('0x2')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6408('0x4')]('in',_0x6408('0x5')),'defaultValue':_0x6408('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6408('0x6')](0x1fe)},'from':{'type':Sequelize[_0x6408('0x6')]},'to':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'subject':{'type':Sequelize[_0x6408('0x2')]},'sentAt':{'type':Sequelize[_0x6408('0x7')]},'attach':{'type':Sequelize[_0x6408('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6408('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6408('0x7')]},'originTo':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'originCc':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'originChannel':{'type':Sequelize[_0x6408('0x4')](_0x6408('0xa'),'Chat'),'defaultValue':_0x6408('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xfac4=['exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email','Chat','sequelize'];(function(_0x18a16d,_0x199976){var _0x21cf0c=function(_0x2717d1){while(--_0x2717d1){_0x18a16d['push'](_0x18a16d['shift']());}};_0x21cf0c(++_0x199976);}(_0xfac4,0x8e));var _0x4fac=function(_0x665c44,_0x298ca5){_0x665c44=_0x665c44-0x0;var _0x70b196=_0xfac4[_0x665c44];return _0x70b196;};'use strict';var Sequelize=require(_0x4fac('0x0'));var _=require('lodash');module[_0x4fac('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4fac('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4fac('0x3')](_0x4fac('0x4'))},'read':{'type':Sequelize[_0x4fac('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4fac('0x6')]('in','out'),'defaultValue':_0x4fac('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4fac('0x8')]},'to':{'type':Sequelize[_0x4fac('0x3')](_0x4fac('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x4fac('0x2'))},'bcc':{'type':Sequelize[_0x4fac('0x3')](_0x4fac('0x2'))},'subject':{'type':Sequelize[_0x4fac('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x4fac('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4fac('0xa')]},'originTo':{'type':Sequelize[_0x4fac('0x3')]('long')},'originCc':{'type':Sequelize[_0x4fac('0x3')]('long')},'originChannel':{'type':Sequelize[_0x4fac('0x6')](_0x4fac('0xb'),_0x4fac('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index bb46fdf..25600d6 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 _0xd16d=['SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail','read','UserId','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','email','SIP/%s','channel','event','fromString','EventManager','acceptmessage','role','RejectMessage','Sequelize','fullname','interface','motionChannel','reject','rejectmessage','download','unix','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','existsSync','push','readFileSync','build','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','name','index','MailMessage','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','body','find','destroy','describe','create','direction','split','MailAccount','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found'];(function(_0x4fcfbe,_0x107dc6){var _0x50b203=function(_0x3a9083){while(--_0x3a9083){_0x4fcfbe['push'](_0x4fcfbe['shift']());}};_0x50b203(++_0x107dc6);}(_0xd16d,0xdb));var _0xdd16=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd16d[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xdd16('0x0'));var moment=require(_0xdd16('0x1'));var BPromise=require('bluebird');var util=require(_0xdd16('0x2'));var path=require(_0xdd16('0x3'));var fs=require('fs');var _=require(_0xdd16('0x4'));var Redis=require(_0xdd16('0x5'));var htmlToText=require(_0xdd16('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xdd16('0x7'))(_0xdd16('0x8'));var interaction_log=require(_0xdd16('0x7'))(_0xdd16('0x9'));var config=require('../../config/environment');var db=require(_0xdd16('0xa'))['db'];config[_0xdd16('0xb')]=_[_0xdd16('0xc')](config[_0xdd16('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd16('0xd'))(new Redis(config[_0xdd16('0xb')]));var htmlEntities=require('html-entities');require(_0xdd16('0xe'))[_0xdd16('0xf')](socket);var jayson=require(_0xdd16('0x10'));var client=jayson[_0xdd16('0x11')][_0xdd16('0x12')]({'port':0x232c});var client9003=jayson[_0xdd16('0x11')]['http']({'port':0x232b});var client9002=jayson[_0xdd16('0x11')][_0xdd16('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x513b80,_0x55794f,_0x1b866a,_0x4129c0){return new BPromise(function(_0x26f087,_0x32128e){var _0x31fcf5=_0x4129c0||client;return _0x31fcf5[_0xdd16('0x13')](_0x513b80,_0x1b866a)['then'](function(_0x1d6b61){logger[_0xdd16('0x14')](_0xdd16('0x15'),_0x55794f,_0xdd16('0x16'));logger[_0xdd16('0x17')](_0xdd16('0x18'),_0x55794f,_0xdd16('0x16'),JSON['stringify'](_0x1d6b61));if(_0x1d6b61[_0xdd16('0x19')]){if(_0x1d6b61[_0xdd16('0x19')]['code']===0x1f4){logger[_0xdd16('0x19')](_0xdd16('0x15'),_0x55794f,_0x1d6b61[_0xdd16('0x19')]['message']);return _0x32128e(_0x1d6b61[_0xdd16('0x19')][_0xdd16('0x1a')]);}logger[_0xdd16('0x19')](_0xdd16('0x15'),_0x55794f,_0x1d6b61[_0xdd16('0x19')][_0xdd16('0x1a')]);return _0x26f087(_0x1d6b61[_0xdd16('0x19')][_0xdd16('0x1a')]);}else{logger[_0xdd16('0x14')](_0xdd16('0x15'),_0x55794f,_0xdd16('0x16'));_0x26f087(_0x1d6b61[_0xdd16('0x1b')][_0xdd16('0x1a')]);}})[_0xdd16('0x1c')](function(_0x541a7b){logger[_0xdd16('0x19')]('MailMessage,\x20%s,\x20%s',_0x55794f,_0x541a7b);_0x32128e(_0x541a7b);});});}function respondWithResult(_0x2193da,_0x2e5473){_0x2e5473=_0x2e5473||0xc8;return function(_0xe86ba2){if(_0xe86ba2){return _0x2193da[_0xdd16('0x1d')](_0x2e5473)[_0xdd16('0x1e')](_0xe86ba2);}};}function respondWithFilteredResult(_0x15d2ba,_0x22e644){return function(_0x4b547a){if(_0x4b547a){var _0x563ef0=typeof _0x22e644[_0xdd16('0x1f')]===_0xdd16('0x20')&&typeof _0x22e644[_0xdd16('0x21')]===_0xdd16('0x20');var _0x28c416=_0x4b547a[_0xdd16('0x22')];var _0x4103bd=_0x563ef0?0x0:_0x22e644['offset'];var _0x2b5d59=_0x563ef0?_0x4b547a[_0xdd16('0x22')]:_0x22e644[_0xdd16('0x1f')]+_0x22e644[_0xdd16('0x21')];var _0x2638cd;if(_0x2b5d59>=_0x28c416){_0x2b5d59=_0x28c416;_0x2638cd=0xc8;}else{_0x2638cd=0xce;}_0x15d2ba[_0xdd16('0x1d')](_0x2638cd);return _0x15d2ba[_0xdd16('0x23')](_0xdd16('0x24'),_0x4103bd+'-'+_0x2b5d59+'/'+_0x28c416)['json'](_0x4b547a);}return null;};}function saveUpdates(_0xfbab32){return function(_0x336d0b){if(_0x336d0b){return _0x336d0b[_0xdd16('0x25')](_0xfbab32)[_0xdd16('0x26')](function(_0x3ebb9d){return _0x3ebb9d;});}return null;};}function removeEntity(_0x3bcfd2){return function(_0x5d6fe8){if(_0x5d6fe8){return _0x5d6fe8['destroy']()['then'](function(){_0x3bcfd2[_0xdd16('0x1d')](0xcc)[_0xdd16('0x27')]();});}};}function handleEntityNotFound(_0x1fbedd){return function(_0x4bc2f2){if(!_0x4bc2f2){_0x1fbedd[_0xdd16('0x28')](0x194);}return _0x4bc2f2;};}function handleError(_0x55d230,_0x3038c4){_0x3038c4=_0x3038c4||0x1f4;return function(_0x298f8b){logger[_0xdd16('0x19')](_0x298f8b['stack']);if(_0x298f8b[_0xdd16('0x29')]){delete _0x298f8b[_0xdd16('0x29')];}_0x55d230['status'](_0x3038c4)['send'](_0x298f8b);};}exports[_0xdd16('0x2a')]=function(_0x410f2a,_0x1a7111){var _0x350ade={},_0x3c0f60={},_0x5a1111={'count':0x0,'rows':[]};var _0x3f98ad=_['map'](db[_0xdd16('0x2b')][_0xdd16('0x2c')],function(_0x1b780f){return{'name':_0x1b780f[_0xdd16('0x2d')],'type':_0x1b780f[_0xdd16('0x2e')]['key']};});_0x3c0f60[_0xdd16('0x2f')]=_[_0xdd16('0x30')](_0x3f98ad,_0xdd16('0x29'));_0x3c0f60[_0xdd16('0x31')]=_['keys'](_0x410f2a['query']);_0x3c0f60['filters']=_[_0xdd16('0x32')](_0x3c0f60[_0xdd16('0x2f')],_0x3c0f60[_0xdd16('0x31')]);_0x350ade[_0xdd16('0x33')]=_[_0xdd16('0x32')](_0x3c0f60[_0xdd16('0x2f')],qs[_0xdd16('0x34')](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x34')]));_0x350ade[_0xdd16('0x33')]=_0x350ade[_0xdd16('0x33')][_0xdd16('0x35')]?_0x350ade[_0xdd16('0x33')]:_0x3c0f60[_0xdd16('0x2f')];if(!_0x410f2a[_0xdd16('0x31')][_0xdd16('0x36')](_0xdd16('0x37'))){_0x350ade[_0xdd16('0x21')]=qs[_0xdd16('0x21')](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x21')]);_0x350ade['offset']=qs['offset'](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x1f')]);}_0x350ade[_0xdd16('0x38')]=qs['sort'](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x39')]);_0x350ade[_0xdd16('0x3a')]=qs[_0xdd16('0x3b')](_[_0xdd16('0x3c')](_0x410f2a[_0xdd16('0x31')],_0x3c0f60[_0xdd16('0x3b')]),_0x3f98ad);if(_0x410f2a[_0xdd16('0x31')]['filter']){_0x350ade['where']=_['merge'](_0x350ade[_0xdd16('0x3a')],{'$or':_['map'](_0x3f98ad,function(_0x1015b2){if(_0x1015b2['type']!==_0xdd16('0x3d')){var _0x191304={};_0x191304[_0x1015b2['name']]={'$like':'%'+_0x410f2a['query'][_0xdd16('0x3e')]+'%'};return _0x191304;}})});}_0x350ade=_['merge']({},_0x350ade,_0x410f2a[_0xdd16('0x3f')]);var _0xfebe8c={'where':_0x350ade[_0xdd16('0x3a')]};return db[_0xdd16('0x2b')][_0xdd16('0x22')](_0xfebe8c)[_0xdd16('0x26')](function(_0x1fc0da){_0x5a1111['count']=_0x1fc0da;if(_0x410f2a[_0xdd16('0x31')][_0xdd16('0x40')]){_0x350ade[_0xdd16('0x41')]=[{'all':!![]}];}return db[_0xdd16('0x2b')][_0xdd16('0x42')](_0x350ade);})[_0xdd16('0x26')](function(_0x1139aa){_0x5a1111[_0xdd16('0x43')]=_0x1139aa;return _0x5a1111;})['then'](respondWithFilteredResult(_0x1a7111,_0x350ade))[_0xdd16('0x1c')](handleError(_0x1a7111,null));};exports[_0xdd16('0x44')]=function(_0x2c396f,_0x20d794){var _0x5a9aca={'raw':!![],'where':{'id':_0x2c396f[_0xdd16('0x45')]['id']}},_0x100dfc={};_0x100dfc['model']=_[_0xdd16('0x46')](db['MailMessage'][_0xdd16('0x2c')]);_0x100dfc[_0xdd16('0x31')]=_[_0xdd16('0x46')](_0x2c396f[_0xdd16('0x31')]);_0x100dfc[_0xdd16('0x3b')]=_['intersection'](_0x100dfc[_0xdd16('0x2f')],_0x100dfc['query']);_0x5a9aca[_0xdd16('0x33')]=_[_0xdd16('0x32')](_0x100dfc[_0xdd16('0x2f')],qs[_0xdd16('0x34')](_0x2c396f['query'][_0xdd16('0x34')]));_0x5a9aca['attributes']=_0x5a9aca['attributes'][_0xdd16('0x35')]?_0x5a9aca[_0xdd16('0x33')]:_0x100dfc[_0xdd16('0x2f')];if(_0x2c396f[_0xdd16('0x31')][_0xdd16('0x40')]){_0x5a9aca[_0xdd16('0x41')]=[{'all':!![]}];}_0x5a9aca=_[_0xdd16('0x47')]({},_0x5a9aca,_0x2c396f[_0xdd16('0x3f')]);return db[_0xdd16('0x2b')]['find'](_0x5a9aca)['then'](handleEntityNotFound(_0x20d794,null))['then'](respondWithResult(_0x20d794,null))['catch'](handleError(_0x20d794,null));};exports[_0xdd16('0x25')]=function(_0x1e03c2,_0x159f60){if(_0x1e03c2[_0xdd16('0x48')]['id']){delete _0x1e03c2['body']['id'];}return db[_0xdd16('0x2b')][_0xdd16('0x49')]({'where':{'id':_0x1e03c2[_0xdd16('0x45')]['id']}})[_0xdd16('0x26')](handleEntityNotFound(_0x159f60,null))[_0xdd16('0x26')](saveUpdates(_0x1e03c2['body'],null))[_0xdd16('0x26')](respondWithResult(_0x159f60,null))['catch'](handleError(_0x159f60,null));};exports[_0xdd16('0x4a')]=function(_0x41efce,_0x1f38ab){return db['MailMessage'][_0xdd16('0x49')]({'where':{'id':_0x41efce[_0xdd16('0x45')]['id']}})[_0xdd16('0x26')](handleEntityNotFound(_0x1f38ab,null))[_0xdd16('0x26')](removeEntity(_0x1f38ab,null))[_0xdd16('0x1c')](handleError(_0x1f38ab,null));};exports[_0xdd16('0x4b')]=function(_0x4d4914,_0x4d7b4e){return db['MailMessage'][_0xdd16('0x4b')]()[_0xdd16('0x26')](respondWithResult(_0x4d7b4e,null))[_0xdd16('0x1c')](handleError(_0x4d7b4e,null));};exports['create']=function(_0x53453e,_0x11ed05){return db[_0xdd16('0x2b')][_0xdd16('0x4c')](_0x53453e['body'])[_0xdd16('0x26')](function(_0x4359f8){if(_0x4359f8){if(_0x4359f8[_0xdd16('0x4d')]==='out'&&!_0x4359f8['secret']){var _0x30585d,_0x590194,_0x540f86;if(_0x53453e['body']['to']){_0x590194=_0x53453e[_0xdd16('0x48')]['to'][_0xdd16('0x4e')](',')[0x0];}return db[_0xdd16('0x4f')]['findOne']({'where':{'id':_0x4359f8['MailAccountId']},'include':[{'model':db[_0xdd16('0x50')],'as':_0xdd16('0x51'),'include':[{'model':db[_0xdd16('0x52')],'as':_0xdd16('0x53'),'where':{'email':_0x590194},'limit':0x1,'order':[[_0xdd16('0x54'),'DESC']]}]},{'model':db[_0xdd16('0x55')],'as':_0xdd16('0x56'),'raw':!![],'include':[{'model':db[_0xdd16('0x57')],'as':_0xdd16('0x57'),'raw':!![]}]}]})[_0xdd16('0x26')](function(_0x4d77e8){_0x30585d=_0x4d77e8;if(!_0x30585d||!_0x30585d['Smtp'])return;var _0x284b2f=_0x30585d['getSmtpOptions']();if(_0x53453e[_0xdd16('0x48')]['attachments']&&_0x53453e[_0xdd16('0x48')]['attachments'][_0xdd16('0x35')]){for(var _0x38e9eb=0x0;_0x38e9eb<_0x53453e[_0xdd16('0x48')][_0xdd16('0x58')][_0xdd16('0x35')];_0x38e9eb+=0x1){_0x53453e[_0xdd16('0x48')][_0xdd16('0x58')][_0x38e9eb]={'filename':_0x53453e[_0xdd16('0x48')][_0xdd16('0x58')][_0x38e9eb][_0xdd16('0x29')],'path':path[_0xdd16('0x59')](config[_0xdd16('0x5a')],_0xdd16('0x5b'),_0x53453e[_0xdd16('0x48')]['attachments'][_0x38e9eb][_0xdd16('0x5c')])};}}_0x540f86={'account':_0x284b2f,'message':_0x53453e['body']};return;})[_0xdd16('0x26')](function(){if(_0x30585d['List']){if(_0x30585d[_0xdd16('0x51')]['Contacts']['length']){return _0x30585d[_0xdd16('0x51')][_0xdd16('0x53')][0x0];}else{return db[_0xdd16('0x52')][_0xdd16('0x4c')](_[_0xdd16('0xc')](_0x53453e[_0xdd16('0x48')],{'firstName':_0x53453e[_0xdd16('0x48')]['to'],'email':_0x53453e['body']['to'],'phone':_0x53453e[_0xdd16('0x48')]['to'],'ListId':_0x30585d[_0xdd16('0x5d')]}));}}else{throw new Error(_0xdd16('0x5e'));}})[_0xdd16('0x26')](function(){if(_0x540f86){return respondWithRpcPromise(_0xdd16('0x5f'),_0xdd16('0x60'),_0x540f86,client9003)['then'](function(_0x3f2de6){return _0x4359f8[_0xdd16('0x25')]({'read':!![],'messageId':_0x3f2de6['messageId'],'sentAt':moment()[_0xdd16('0x61')](_0xdd16('0x62'))});})[_0xdd16('0x1c')](function(_0x393d55){logger[_0xdd16('0x19')]('%s',JSON[_0xdd16('0x63')](_0x393d55));return _0x4359f8;});}return _0x4359f8;});}return _0x4359f8;}})[_0xdd16('0x26')](respondWithResult(_0x11ed05,0xc9))[_0xdd16('0x1c')](handleError(_0x11ed05,null));};exports['accept']=function(_0x15126e,_0x498a10){var _0x4938c5={'agent':{},'channel':_0xdd16('0x64')};if(_0x15126e[_0xdd16('0x48')]['id']){delete _0x15126e['body']['id'];}_0x15126e['body'][_0xdd16('0x65')]=!![];_0x15126e['body']['readAt']=moment()[_0xdd16('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x15126e['body'][_0xdd16('0x66')]=_0x15126e[_0xdd16('0x48')]['UserId']||_0x15126e['user']['id'];_0x4938c5['agent']['id']=_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')];return db['MailMessage'][_0xdd16('0x49')]({'where':{'id':_0x15126e['params']['id'],'UserId':null}})[_0xdd16('0x26')](handleEntityNotFound(_0x498a10,null))['then'](saveUpdates(_0x15126e[_0xdd16('0x48')],null))['then'](function(_0xd24135){if(_0xd24135){_0x4938c5[_0xdd16('0x1a')]=_0xd24135[_0xdd16('0x67')]({'plain':!![]});return db[_0xdd16('0x68')][_0xdd16('0x49')]({'where':{'id':_0xd24135[_0xdd16('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x498a10,null))[_0xdd16('0x26')](function(_0x458bec){if(_0x458bec){return _0x458bec[_0xdd16('0x25')]({'UserId':_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')],'read1stAt':_[_0xdd16('0x6a')](_0x458bec['read1stAt'])?moment()[_0xdd16('0x61')](_0xdd16('0x62')):undefined});}return null;})[_0xdd16('0x26')](function(_0x32cf2b){if(_0x32cf2b){_0x4938c5[_0xdd16('0x6b')]=_0x32cf2b[_0xdd16('0x67')]({'plain':!![]});interaction_log['info'](_0xdd16('0x6c'),_0x15126e[_0xdd16('0x6d')]['id'],_0x15126e['user'][_0xdd16('0x29')],_0x15126e[_0xdd16('0x6d')]['role'],_0x4938c5[_0xdd16('0x6b')]['id'],_0x15126e[_0xdd16('0x48')]?JSON[_0xdd16('0x63')](_0x15126e['body']):_0xdd16('0x6e'));return respondWithRpcPromise(_0xdd16('0x6f'),_0xdd16('0x70'),_0x4938c5);}return null;})[_0xdd16('0x26')](function(_0x114364){var _0x1e8af9=_0xdd16('0x71')+_0x114364[_0xdd16('0x1a')][_0xdd16('0x72')];return db[_0xdd16('0x73')][_0xdd16('0x31')](_0x1e8af9,{'type':db['Sequelize'][_0xdd16('0x74')][_0xdd16('0x75')],'raw':!![]})[_0xdd16('0x26')](function(_0x56a469){return _0x56a469;});})[_0xdd16('0x26')](function(_0x400f09){if(_0x400f09){_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x76')]=_0x400f09[0x0];if(!_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')])return;return db[_0xdd16('0x77')][_0xdd16('0x49')]({'where':{'id':_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')],'role':_0xdd16('0x78')},'attributes':['id',_0xdd16('0x29'),'fullname',_0xdd16('0x79'),'internal'],'raw':!![]});}return null;})[_0xdd16('0x26')](function(_0x3520f2){if(!_0x3520f2)return null;_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x78')]=_0x3520f2;return _0x4938c5;})[_0xdd16('0x26')](function(_0x20a704){if(_0x20a704){if(_0x15126e[_0xdd16('0x48')]['manual']){_0x4938c5[_0xdd16('0x1a')]['interface']=util[_0xdd16('0x61')](_0xdd16('0x7a'),_0x15126e[_0xdd16('0x6d')][_0xdd16('0x29')]);_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x7b')]=_0x4938c5[_0xdd16('0x7b')];_0x4938c5['message']['motionChannel']=_0x4938c5['channel'];_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x7c')]='accept';_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x48')]=htmlToText[_0xdd16('0x7d')](_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x48')]);return respondWithRpcPromise(_0xdd16('0x7e'),'EventManager',{'event':_0xdd16('0x7f'),'message':_0x4938c5['message']},client9002)[_0xdd16('0x26')](function(){return _0x4938c5;});}return _0x4938c5;}return null;})[_0xdd16('0x26')](respondWithResult(_0x498a10,null))[_0xdd16('0x1c')](handleError(_0x498a10,null));};exports['reject']=function(_0x2cfc74,_0x3771af){var _0x49fbc3={'agent':{},'channel':_0xdd16('0x64')};if(_0x2cfc74[_0xdd16('0x48')]['id']){delete _0x2cfc74[_0xdd16('0x48')]['id'];}_0x2cfc74[_0xdd16('0x48')][_0xdd16('0x66')]=_0x2cfc74[_0xdd16('0x48')]['UserId']||_0x2cfc74[_0xdd16('0x6d')]['id'];_0x49fbc3['agent']['id']=_0x2cfc74[_0xdd16('0x48')][_0xdd16('0x66')];return db[_0xdd16('0x2b')][_0xdd16('0x49')]({'where':{'id':_0x2cfc74[_0xdd16('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3771af,null))[_0xdd16('0x26')](function(_0x425092){if(_0x425092){_0x49fbc3['message']=_0x425092[_0xdd16('0x67')]({'plain':!![]});return db[_0xdd16('0x68')][_0xdd16('0x49')]({'where':{'id':_0x425092[_0xdd16('0x69')]}});}return null;})[_0xdd16('0x26')](handleEntityNotFound(_0x3771af,null))[_0xdd16('0x26')](function(_0x36e76b){if(_0x36e76b){_0x49fbc3[_0xdd16('0x6b')]=_0x36e76b[_0xdd16('0x67')]({'plain':!![]});interaction_log[_0xdd16('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cfc74[_0xdd16('0x6d')]['id'],_0x2cfc74[_0xdd16('0x6d')][_0xdd16('0x29')],_0x2cfc74[_0xdd16('0x6d')][_0xdd16('0x80')],_0x49fbc3['interaction']['id'],_0x2cfc74[_0xdd16('0x48')]?JSON[_0xdd16('0x63')](_0x2cfc74[_0xdd16('0x48')]):_0xdd16('0x6e'));return respondWithRpcPromise(_0xdd16('0x81'),'rejectMessage',_0x49fbc3);}return null;})[_0xdd16('0x26')](function(_0x3ecd35){var _0x4b2954=_0xdd16('0x71')+_0x3ecd35[_0xdd16('0x1a')][_0xdd16('0x72')];return db[_0xdd16('0x73')][_0xdd16('0x31')](_0x4b2954,{'type':db[_0xdd16('0x82')]['QueryTypes'][_0xdd16('0x75')],'raw':!![]})[_0xdd16('0x26')](function(_0x1f2f2b){return _0x1f2f2b;});})[_0xdd16('0x26')](function(_0x553004){if(_0x553004){_0x49fbc3[_0xdd16('0x1a')][_0xdd16('0x76')]=_0x553004[0x0];if(!_0x2cfc74[_0xdd16('0x48')][_0xdd16('0x66')])return;return db[_0xdd16('0x77')][_0xdd16('0x49')]({'where':{'id':_0x2cfc74['body']['UserId'],'role':_0xdd16('0x78')},'attributes':['id',_0xdd16('0x29'),_0xdd16('0x83'),_0xdd16('0x79'),'internal'],'raw':!![]});}return null;})[_0xdd16('0x26')](function(_0x3eeb2e){if(!_0x3eeb2e)return null;_0x49fbc3[_0xdd16('0x1a')][_0xdd16('0x78')]=_0x3eeb2e;return _0x49fbc3;})[_0xdd16('0x26')](function(_0x4cb160){if(_0x4cb160){_0x4cb160[_0xdd16('0x1a')][_0xdd16('0x84')]=util['format'](_0xdd16('0x7a'),_0x2cfc74[_0xdd16('0x6d')][_0xdd16('0x29')]);_0x4cb160[_0xdd16('0x1a')][_0xdd16('0x7b')]=_0x49fbc3[_0xdd16('0x7b')];_0x4cb160['message'][_0xdd16('0x85')]=_0x49fbc3[_0xdd16('0x7b')];_0x4cb160['message']['event']=_0xdd16('0x86');_0x4cb160[_0xdd16('0x1a')][_0xdd16('0x48')]=htmlToText[_0xdd16('0x7d')](_0x49fbc3[_0xdd16('0x1a')][_0xdd16('0x48')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0xdd16('0x87'),'message':_0x4cb160[_0xdd16('0x1a')]},client9002);return _0x49fbc3;}return null;})[_0xdd16('0x26')](respondWithResult(_0x3771af,null))[_0xdd16('0x1c')](handleError(_0x3771af,null));};exports[_0xdd16('0x88')]=function(_0x14ae40,_0x3e4424){var _0x2e6cf1=moment()[_0xdd16('0x89')]()['toString']();var _0x337e31=path[_0xdd16('0x59')](config[_0xdd16('0x5a')],_0xdd16('0x8a'),_0xdd16('0x8b'),_0xdd16('0x8c'));var _0x5f4517=path[_0xdd16('0x59')](config['root'],_0xdd16('0x8a'),'files','attachments');var _0x275c8a=util[_0xdd16('0x61')](_0xdd16('0x8d'),_0x2e6cf1);return db[_0xdd16('0x2b')][_0xdd16('0x49')]({'where':{'id':_0x14ae40['params']['id']},'attributes':['id',_0xdd16('0x48'),_0xdd16('0x8e'),'to','cc','bcc',_0xdd16('0x8f'),_0xdd16('0x90')],'include':_0x14ae40['query'][_0xdd16('0x58')]?[{'model':db[_0xdd16('0x91')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x3e4424,null))['then'](function(_0x691d01){if(_0x691d01){var _0x457e48=_0x691d01;var _0x41b3bf={'from':_0x457e48[_0xdd16('0x8e')],'to':_0x457e48['to'],'subject':_0x457e48[_0xdd16('0x8f')],'html':htmlEntities[_0xdd16('0x92')](_0x457e48[_0xdd16('0x48')]),'headers':{'Date':moment(_0x457e48[_0xdd16('0x90')])[_0xdd16('0x61')](_0xdd16('0x93'))},'attachments':[]};if(_0x691d01['cc']){_0x41b3bf[_0xdd16('0x94')]['Cc']=_0x691d01['cc'];}if(_0x691d01[_0xdd16('0x95')]){_0x41b3bf['headers'][_0xdd16('0x96')]=_0x691d01['bcc'];}return new BPromise(function(_0x4f4a31,_0x2eb356){if(_0x691d01['Attachments']){for(var _0x3123c0=0x0;_0x3123c0<_0x691d01[_0xdd16('0x97')][_0xdd16('0x35')];_0x3123c0++){var _0x5eae58=_0x691d01[_0xdd16('0x97')][_0x3123c0];var _0x13e869=path['join'](_0x5f4517,_0x5eae58[_0xdd16('0x5c')]);if(fs[_0xdd16('0x98')](_0x13e869)){_0x41b3bf[_0xdd16('0x58')][_0xdd16('0x99')]({'name':_0x5eae58[_0xdd16('0x29')],'contentType':_0x5eae58[_0xdd16('0x2e')],'data':fs[_0xdd16('0x9a')](_0x13e869)});}}}emlformat[_0xdd16('0x9b')](_0x41b3bf,function(_0x83238f,_0x5713c5){if(_0x83238f)return _0x2eb356(_0x83238f);fs['writeFileSync'](path['join'](_0x337e31,_0x275c8a),_0x5713c5);return _0x4f4a31(_0x5713c5);});});}})[_0xdd16('0x26')](function(_0x19a1e9){if(_0x19a1e9){return _0x3e4424[_0xdd16('0x88')](path['join'](_0x337e31,_0x275c8a),_0x275c8a,function(_0x3ebf78){if(!_0x3ebf78)fs[_0xdd16('0x9c')](path[_0xdd16('0x59')](_0x337e31,_0x275c8a));});}})['catch'](handleError(_0x3e4424,null));}; \ No newline at end of file +var _0xad7b=['update','destroy','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','CmContact','defaults','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','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','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','channel','motionChannel','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','email','SIP/%s','event','rejectmessage','download','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','decode','headers','Bcc','Attachments','existsSync','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','html-entities','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','status','json','offset','limit','undefined','count','Content-Range'];(function(_0x529bee,_0x4562f8){var _0x391581=function(_0x38b40d){while(--_0x38b40d){_0x529bee['push'](_0x529bee['shift']());}};_0x391581(++_0x4562f8);}(_0xad7b,0x7c));var _0xbad7=function(_0x1b5566,_0x9895dc){_0x1b5566=_0x1b5566-0x0;var _0xa5101=_0xad7b[_0x1b5566];return _0xa5101;};'use strict';var emlformat=require(_0xbad7('0x0'));var moment=require(_0xbad7('0x1'));var BPromise=require(_0xbad7('0x2'));var util=require(_0xbad7('0x3'));var path=require(_0xbad7('0x4'));var fs=require('fs');var _=require(_0xbad7('0x5'));var Redis=require(_0xbad7('0x6'));var htmlToText=require('html-to-text');var qs=require(_0xbad7('0x7'));var logger=require('../../config/logger')('api');var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xbad7('0x8'));var db=require(_0xbad7('0x9'))['db'];config['redis']=_['defaults'](config[_0xbad7('0xa')],{'host':_0xbad7('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbad7('0xa')]));var htmlEntities=require(_0xbad7('0xc'));require('./mailMessage.socket')[_0xbad7('0xd')](socket);var jayson=require(_0xbad7('0xe'));var client=jayson[_0xbad7('0xf')][_0xbad7('0x10')]({'port':0x232c});var client9003=jayson[_0xbad7('0xf')][_0xbad7('0x10')]({'port':0x232b});var client9002=jayson[_0xbad7('0xf')][_0xbad7('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x21894c,_0x4a119f,_0x2b2c3c,_0x544e53){return new BPromise(function(_0xc407fd,_0x1d6fa4){var _0x37794d=_0x544e53||client;return _0x37794d[_0xbad7('0x11')](_0x21894c,_0x2b2c3c)[_0xbad7('0x12')](function(_0x895d75){logger[_0xbad7('0x13')](_0xbad7('0x14'),_0x4a119f,'request\x20sent');logger[_0xbad7('0x15')](_0xbad7('0x16'),_0x4a119f,_0xbad7('0x17'),JSON['stringify'](_0x895d75));if(_0x895d75[_0xbad7('0x18')]){if(_0x895d75[_0xbad7('0x18')][_0xbad7('0x19')]===0x1f4){logger[_0xbad7('0x18')]('MailMessage,\x20%s,\x20%s',_0x4a119f,_0x895d75[_0xbad7('0x18')][_0xbad7('0x1a')]);return _0x1d6fa4(_0x895d75[_0xbad7('0x18')][_0xbad7('0x1a')]);}logger[_0xbad7('0x18')]('MailMessage,\x20%s,\x20%s',_0x4a119f,_0x895d75[_0xbad7('0x18')][_0xbad7('0x1a')]);return _0xc407fd(_0x895d75['error']['message']);}else{logger['info'](_0xbad7('0x14'),_0x4a119f,_0xbad7('0x17'));_0xc407fd(_0x895d75['result']['message']);}})[_0xbad7('0x1b')](function(_0x1288fb){logger[_0xbad7('0x18')](_0xbad7('0x14'),_0x4a119f,_0x1288fb);_0x1d6fa4(_0x1288fb);});});}function respondWithResult(_0x289f0a,_0x36a23e){_0x36a23e=_0x36a23e||0xc8;return function(_0x3cb183){if(_0x3cb183){return _0x289f0a[_0xbad7('0x1c')](_0x36a23e)[_0xbad7('0x1d')](_0x3cb183);}};}function respondWithFilteredResult(_0x4f00d1,_0xda50dc){return function(_0x203774){if(_0x203774){var _0x20ee20=typeof _0xda50dc[_0xbad7('0x1e')]==='undefined'&&typeof _0xda50dc[_0xbad7('0x1f')]===_0xbad7('0x20');var _0x25364b=_0x203774[_0xbad7('0x21')];var _0x2fab43=_0x20ee20?0x0:_0xda50dc[_0xbad7('0x1e')];var _0x1cc8f1=_0x20ee20?_0x203774[_0xbad7('0x21')]:_0xda50dc[_0xbad7('0x1e')]+_0xda50dc[_0xbad7('0x1f')];var _0x339d18;if(_0x1cc8f1>=_0x25364b){_0x1cc8f1=_0x25364b;_0x339d18=0xc8;}else{_0x339d18=0xce;}_0x4f00d1[_0xbad7('0x1c')](_0x339d18);return _0x4f00d1['set'](_0xbad7('0x22'),_0x2fab43+'-'+_0x1cc8f1+'/'+_0x25364b)['json'](_0x203774);}return null;};}function saveUpdates(_0x3783de){return function(_0x4f3d3a){if(_0x4f3d3a){return _0x4f3d3a[_0xbad7('0x23')](_0x3783de)[_0xbad7('0x12')](function(_0x47a8cd){return _0x47a8cd;});}return null;};}function removeEntity(_0x155e6c){return function(_0x44e69c){if(_0x44e69c){return _0x44e69c[_0xbad7('0x24')]()[_0xbad7('0x12')](function(){_0x155e6c[_0xbad7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f39b){return function(_0x2a7ffb){if(!_0x2a7ffb){_0x38f39b['sendStatus'](0x194);}return _0x2a7ffb;};}function handleError(_0x50a669,_0x13eade){_0x13eade=_0x13eade||0x1f4;return function(_0x32184d){logger[_0xbad7('0x18')](_0x32184d[_0xbad7('0x25')]);if(_0x32184d[_0xbad7('0x26')]){delete _0x32184d[_0xbad7('0x26')];}_0x50a669[_0xbad7('0x1c')](_0x13eade)[_0xbad7('0x27')](_0x32184d);};}exports[_0xbad7('0x28')]=function(_0x413c4c,_0x257311){var _0x515e89={},_0x5f53eb={},_0x1445c2={'count':0x0,'rows':[]};var _0x54023f=_['map'](db[_0xbad7('0x29')][_0xbad7('0x2a')],function(_0x97c48a){return{'name':_0x97c48a[_0xbad7('0x2b')],'type':_0x97c48a[_0xbad7('0x2c')][_0xbad7('0x2d')]};});_0x5f53eb['model']=_[_0xbad7('0x2e')](_0x54023f,'name');_0x5f53eb[_0xbad7('0x2f')]=_[_0xbad7('0x30')](_0x413c4c[_0xbad7('0x2f')]);_0x5f53eb[_0xbad7('0x31')]=_[_0xbad7('0x32')](_0x5f53eb[_0xbad7('0x33')],_0x5f53eb['query']);_0x515e89[_0xbad7('0x34')]=_['intersection'](_0x5f53eb[_0xbad7('0x33')],qs[_0xbad7('0x35')](_0x413c4c['query']['fields']));_0x515e89[_0xbad7('0x34')]=_0x515e89[_0xbad7('0x34')][_0xbad7('0x36')]?_0x515e89[_0xbad7('0x34')]:_0x5f53eb[_0xbad7('0x33')];if(!_0x413c4c[_0xbad7('0x2f')]['hasOwnProperty'](_0xbad7('0x37'))){_0x515e89['limit']=qs[_0xbad7('0x1f')](_0x413c4c[_0xbad7('0x2f')][_0xbad7('0x1f')]);_0x515e89[_0xbad7('0x1e')]=qs[_0xbad7('0x1e')](_0x413c4c[_0xbad7('0x2f')][_0xbad7('0x1e')]);}_0x515e89['order']=qs[_0xbad7('0x38')](_0x413c4c[_0xbad7('0x2f')][_0xbad7('0x38')]);_0x515e89[_0xbad7('0x39')]=qs['filters'](_[_0xbad7('0x3a')](_0x413c4c[_0xbad7('0x2f')],_0x5f53eb[_0xbad7('0x31')]),_0x54023f);if(_0x413c4c['query'][_0xbad7('0x3b')]){_0x515e89[_0xbad7('0x39')]=_[_0xbad7('0x3c')](_0x515e89['where'],{'$or':_[_0xbad7('0x2e')](_0x54023f,function(_0x16541f){if(_0x16541f['type']!==_0xbad7('0x3d')){var _0x12cc5a={};_0x12cc5a[_0x16541f[_0xbad7('0x26')]]={'$like':'%'+_0x413c4c[_0xbad7('0x2f')][_0xbad7('0x3b')]+'%'};return _0x12cc5a;}})});}_0x515e89=_[_0xbad7('0x3c')]({},_0x515e89,_0x413c4c['options']);var _0x591e1e={'where':_0x515e89[_0xbad7('0x39')]};return db[_0xbad7('0x29')][_0xbad7('0x21')](_0x591e1e)[_0xbad7('0x12')](function(_0x48efdb){_0x1445c2[_0xbad7('0x21')]=_0x48efdb;if(_0x413c4c[_0xbad7('0x2f')][_0xbad7('0x3e')]){_0x515e89[_0xbad7('0x3f')]=[{'all':!![]}];}return db[_0xbad7('0x29')][_0xbad7('0x40')](_0x515e89);})[_0xbad7('0x12')](function(_0x8a8921){_0x1445c2[_0xbad7('0x41')]=_0x8a8921;return _0x1445c2;})[_0xbad7('0x12')](respondWithFilteredResult(_0x257311,_0x515e89))['catch'](handleError(_0x257311,null));};exports[_0xbad7('0x42')]=function(_0x1e4f4f,_0x39411a){var _0x554802={'raw':!![],'where':{'id':_0x1e4f4f[_0xbad7('0x43')]['id']}},_0xe68666={};_0xe68666[_0xbad7('0x33')]=_[_0xbad7('0x30')](db[_0xbad7('0x29')]['rawAttributes']);_0xe68666['query']=_[_0xbad7('0x30')](_0x1e4f4f[_0xbad7('0x2f')]);_0xe68666[_0xbad7('0x31')]=_['intersection'](_0xe68666[_0xbad7('0x33')],_0xe68666[_0xbad7('0x2f')]);_0x554802['attributes']=_[_0xbad7('0x32')](_0xe68666['model'],qs[_0xbad7('0x35')](_0x1e4f4f[_0xbad7('0x2f')][_0xbad7('0x35')]));_0x554802['attributes']=_0x554802[_0xbad7('0x34')]['length']?_0x554802['attributes']:_0xe68666['model'];if(_0x1e4f4f[_0xbad7('0x2f')][_0xbad7('0x3e')]){_0x554802[_0xbad7('0x3f')]=[{'all':!![]}];}_0x554802=_[_0xbad7('0x3c')]({},_0x554802,_0x1e4f4f[_0xbad7('0x44')]);return db[_0xbad7('0x29')][_0xbad7('0x45')](_0x554802)[_0xbad7('0x12')](handleEntityNotFound(_0x39411a,null))['then'](respondWithResult(_0x39411a,null))[_0xbad7('0x1b')](handleError(_0x39411a,null));};exports[_0xbad7('0x23')]=function(_0xb78bb2,_0x50ad5d){if(_0xb78bb2[_0xbad7('0x46')]['id']){delete _0xb78bb2[_0xbad7('0x46')]['id'];}return db[_0xbad7('0x29')]['find']({'where':{'id':_0xb78bb2[_0xbad7('0x43')]['id']}})[_0xbad7('0x12')](handleEntityNotFound(_0x50ad5d,null))[_0xbad7('0x12')](saveUpdates(_0xb78bb2['body'],null))[_0xbad7('0x12')](respondWithResult(_0x50ad5d,null))[_0xbad7('0x1b')](handleError(_0x50ad5d,null));};exports[_0xbad7('0x24')]=function(_0x360db7,_0x144574){return db['MailMessage'][_0xbad7('0x45')]({'where':{'id':_0x360db7[_0xbad7('0x43')]['id']}})[_0xbad7('0x12')](handleEntityNotFound(_0x144574,null))['then'](removeEntity(_0x144574,null))[_0xbad7('0x1b')](handleError(_0x144574,null));};exports[_0xbad7('0x47')]=function(_0x188452,_0x5c72ba){return db[_0xbad7('0x29')][_0xbad7('0x47')]()[_0xbad7('0x12')](respondWithResult(_0x5c72ba,null))[_0xbad7('0x1b')](handleError(_0x5c72ba,null));};exports[_0xbad7('0x48')]=function(_0x2ebc84,_0x4295ba){return db['MailMessage'][_0xbad7('0x48')](_0x2ebc84[_0xbad7('0x46')])[_0xbad7('0x12')](function(_0x3dd40d){if(_0x3dd40d){if(_0x3dd40d[_0xbad7('0x49')]===_0xbad7('0x4a')&&!_0x3dd40d[_0xbad7('0x4b')]){var _0x39513f,_0x162b8c,_0x1465d3;if(_0x2ebc84['body']['to']){_0x162b8c=_0x2ebc84[_0xbad7('0x46')]['to'][_0xbad7('0x4c')](',')[0x0];}return db[_0xbad7('0x4d')][_0xbad7('0x4e')]({'where':{'id':_0x3dd40d[_0xbad7('0x4f')]},'include':[{'model':db['CmList'],'as':_0xbad7('0x50'),'include':[{'model':db['CmContact'],'as':_0xbad7('0x51'),'where':{'email':_0x162b8c},'limit':0x1,'order':[[_0xbad7('0x52'),_0xbad7('0x53')]]}]},{'model':db[_0xbad7('0x54')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xbad7('0x55')],'as':'CloudProvider','raw':!![]}]}]})[_0xbad7('0x12')](function(_0x4a39c){_0x39513f=_0x4a39c;if(!_0x39513f||!_0x39513f[_0xbad7('0x56')])return;var _0x4e64bb=_0x39513f[_0xbad7('0x57')]();if(_0x2ebc84[_0xbad7('0x46')]['attachments']&&_0x2ebc84[_0xbad7('0x46')][_0xbad7('0x58')]['length']){for(var _0x5dec56=0x0;_0x5dec56<_0x2ebc84[_0xbad7('0x46')][_0xbad7('0x58')][_0xbad7('0x36')];_0x5dec56+=0x1){_0x2ebc84['body'][_0xbad7('0x58')][_0x5dec56]={'filename':_0x2ebc84[_0xbad7('0x46')][_0xbad7('0x58')][_0x5dec56]['name'],'path':path[_0xbad7('0x59')](config[_0xbad7('0x5a')],_0xbad7('0x5b'),_0x2ebc84[_0xbad7('0x46')][_0xbad7('0x58')][_0x5dec56]['basename'])};}}_0x1465d3={'account':_0x4e64bb,'message':_0x2ebc84['body']};return;})['then'](function(){if(_0x39513f['List']){if(_0x39513f['List'][_0xbad7('0x51')][_0xbad7('0x36')]){return _0x39513f['List'][_0xbad7('0x51')][0x0];}else{return db[_0xbad7('0x5c')][_0xbad7('0x48')](_[_0xbad7('0x5d')](_0x2ebc84[_0xbad7('0x46')],{'firstName':_0x2ebc84[_0xbad7('0x46')]['to'],'email':_0x2ebc84[_0xbad7('0x46')]['to'],'phone':_0x2ebc84['body']['to'],'ListId':_0x39513f[_0xbad7('0x5e')]}));}}else{throw new Error(_0xbad7('0x5f'));}})[_0xbad7('0x12')](function(){if(_0x1465d3){return respondWithRpcPromise(_0xbad7('0x60'),'sendMail',_0x1465d3,client9003)[_0xbad7('0x12')](function(_0x3fde29){return _0x3dd40d[_0xbad7('0x23')]({'read':!![],'messageId':_0x3fde29[_0xbad7('0x61')],'sentAt':moment()[_0xbad7('0x62')](_0xbad7('0x63'))});})[_0xbad7('0x1b')](function(_0x35ab3d){logger[_0xbad7('0x18')]('%s',JSON[_0xbad7('0x64')](_0x35ab3d));return _0x3dd40d;});}return _0x3dd40d;});}return _0x3dd40d;}})[_0xbad7('0x12')](respondWithResult(_0x4295ba,0xc9))['catch'](handleError(_0x4295ba,null));};exports[_0xbad7('0x65')]=function(_0x1d197a,_0x56eae9){var _0x13e2ef={'agent':{},'channel':_0xbad7('0x66')};if(_0x1d197a[_0xbad7('0x46')]['id']){delete _0x1d197a[_0xbad7('0x46')]['id'];}_0x1d197a[_0xbad7('0x46')][_0xbad7('0x67')]=!![];_0x1d197a[_0xbad7('0x46')][_0xbad7('0x68')]=moment()[_0xbad7('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d197a['body']['UserId']=_0x1d197a[_0xbad7('0x46')][_0xbad7('0x69')]||_0x1d197a[_0xbad7('0x6a')]['id'];_0x13e2ef[_0xbad7('0x6b')]['id']=_0x1d197a[_0xbad7('0x46')][_0xbad7('0x69')];return db['MailMessage'][_0xbad7('0x45')]({'where':{'id':_0x1d197a[_0xbad7('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x56eae9,null))[_0xbad7('0x12')](saveUpdates(_0x1d197a[_0xbad7('0x46')],null))[_0xbad7('0x12')](function(_0x3ac76a){if(_0x3ac76a){_0x13e2ef[_0xbad7('0x1a')]=_0x3ac76a[_0xbad7('0x6c')]({'plain':!![]});return db[_0xbad7('0x6d')][_0xbad7('0x45')]({'where':{'id':_0x3ac76a[_0xbad7('0x6e')]}});}return null;})[_0xbad7('0x12')](handleEntityNotFound(_0x56eae9,null))[_0xbad7('0x12')](function(_0x4040a0){if(_0x4040a0){return _0x4040a0[_0xbad7('0x23')]({'UserId':_0x1d197a[_0xbad7('0x46')][_0xbad7('0x69')],'read1stAt':_[_0xbad7('0x6f')](_0x4040a0['read1stAt'])?moment()[_0xbad7('0x62')](_0xbad7('0x63')):undefined});}return null;})[_0xbad7('0x12')](function(_0x58f1fb){if(_0x58f1fb){_0x13e2ef[_0xbad7('0x70')]=_0x58f1fb[_0xbad7('0x6c')]({'plain':!![]});interaction_log[_0xbad7('0x13')](_0xbad7('0x71'),_0x1d197a[_0xbad7('0x6a')]['id'],_0x1d197a['user'][_0xbad7('0x26')],_0x1d197a[_0xbad7('0x6a')][_0xbad7('0x72')],_0x13e2ef[_0xbad7('0x70')]['id'],_0x1d197a[_0xbad7('0x46')]?JSON[_0xbad7('0x64')](_0x1d197a[_0xbad7('0x46')]):_0xbad7('0x73'));return respondWithRpcPromise(_0xbad7('0x74'),_0xbad7('0x75'),_0x13e2ef);}return null;})[_0xbad7('0x12')](function(_0x84427b){var _0x315189=_0xbad7('0x76')+_0x84427b['message'][_0xbad7('0x77')];return db['sequelize'][_0xbad7('0x2f')](_0x315189,{'type':db[_0xbad7('0x78')][_0xbad7('0x79')][_0xbad7('0x7a')],'raw':!![]})[_0xbad7('0x12')](function(_0x38ee53){return _0x38ee53;});})['then'](function(_0x567bca){if(_0x567bca){_0x13e2ef[_0xbad7('0x1a')][_0xbad7('0x7b')]=_0x567bca[0x0];if(!_0x1d197a[_0xbad7('0x46')]['UserId'])return;return db[_0xbad7('0x7c')][_0xbad7('0x45')]({'where':{'id':_0x1d197a[_0xbad7('0x46')][_0xbad7('0x69')],'role':_0xbad7('0x6b')},'attributes':['id',_0xbad7('0x26'),_0xbad7('0x7d'),'email',_0xbad7('0x7e')],'raw':!![]});}return null;})[_0xbad7('0x12')](function(_0x521ba8){if(!_0x521ba8)return null;_0x13e2ef[_0xbad7('0x1a')]['agent']=_0x521ba8;return _0x13e2ef;})[_0xbad7('0x12')](function(_0x42de3c){if(_0x42de3c){if(_0x1d197a[_0xbad7('0x46')]['manual']){_0x13e2ef['message'][_0xbad7('0x7f')]=util[_0xbad7('0x62')]('SIP/%s',_0x1d197a[_0xbad7('0x6a')][_0xbad7('0x26')]);_0x13e2ef[_0xbad7('0x1a')]['channel']=_0x13e2ef[_0xbad7('0x80')];_0x13e2ef[_0xbad7('0x1a')][_0xbad7('0x81')]=_0x13e2ef['channel'];_0x13e2ef[_0xbad7('0x1a')]['event']=_0xbad7('0x65');_0x13e2ef[_0xbad7('0x1a')][_0xbad7('0x46')]=htmlToText[_0xbad7('0x82')](_0x13e2ef[_0xbad7('0x1a')][_0xbad7('0x46')]);return respondWithRpcPromise(_0xbad7('0x83'),_0xbad7('0x83'),{'event':'acceptmessage','message':_0x13e2ef['message']},client9002)[_0xbad7('0x12')](function(){return _0x13e2ef;});}return _0x13e2ef;}return null;})[_0xbad7('0x12')](respondWithResult(_0x56eae9,null))[_0xbad7('0x1b')](handleError(_0x56eae9,null));};exports[_0xbad7('0x84')]=function(_0x163d74,_0x234fcb){var _0x16474a={'agent':{},'channel':_0xbad7('0x66')};if(_0x163d74['body']['id']){delete _0x163d74[_0xbad7('0x46')]['id'];}_0x163d74[_0xbad7('0x46')]['UserId']=_0x163d74['body'][_0xbad7('0x69')]||_0x163d74[_0xbad7('0x6a')]['id'];_0x16474a['agent']['id']=_0x163d74['body'][_0xbad7('0x69')];return db['MailMessage']['find']({'where':{'id':_0x163d74[_0xbad7('0x43')]['id'],'UserId':null}})[_0xbad7('0x12')](handleEntityNotFound(_0x234fcb,null))[_0xbad7('0x12')](function(_0x250829){if(_0x250829){_0x16474a[_0xbad7('0x1a')]=_0x250829[_0xbad7('0x6c')]({'plain':!![]});return db['MailInteraction'][_0xbad7('0x45')]({'where':{'id':_0x250829[_0xbad7('0x6e')]}});}return null;})[_0xbad7('0x12')](handleEntityNotFound(_0x234fcb,null))[_0xbad7('0x12')](function(_0x5ebd80){if(_0x5ebd80){_0x16474a['interaction']=_0x5ebd80[_0xbad7('0x6c')]({'plain':!![]});interaction_log[_0xbad7('0x13')](_0xbad7('0x85'),_0x163d74[_0xbad7('0x6a')]['id'],_0x163d74['user'][_0xbad7('0x26')],_0x163d74[_0xbad7('0x6a')]['role'],_0x16474a[_0xbad7('0x70')]['id'],_0x163d74[_0xbad7('0x46')]?JSON[_0xbad7('0x64')](_0x163d74[_0xbad7('0x46')]):_0xbad7('0x73'));return respondWithRpcPromise(_0xbad7('0x86'),_0xbad7('0x87'),_0x16474a);}return null;})[_0xbad7('0x12')](function(_0x283069){var _0x5bf92f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x283069[_0xbad7('0x1a')][_0xbad7('0x77')];return db[_0xbad7('0x88')][_0xbad7('0x2f')](_0x5bf92f,{'type':db[_0xbad7('0x78')][_0xbad7('0x79')]['SELECT'],'raw':!![]})['then'](function(_0x33d29a){return _0x33d29a;});})[_0xbad7('0x12')](function(_0x504d90){if(_0x504d90){_0x16474a['message'][_0xbad7('0x7b')]=_0x504d90[0x0];if(!_0x163d74[_0xbad7('0x46')]['UserId'])return;return db['User'][_0xbad7('0x45')]({'where':{'id':_0x163d74[_0xbad7('0x46')][_0xbad7('0x69')],'role':_0xbad7('0x6b')},'attributes':['id',_0xbad7('0x26'),_0xbad7('0x7d'),_0xbad7('0x89'),_0xbad7('0x7e')],'raw':!![]});}return null;})['then'](function(_0x5dfc46){if(!_0x5dfc46)return null;_0x16474a[_0xbad7('0x1a')][_0xbad7('0x6b')]=_0x5dfc46;return _0x16474a;})[_0xbad7('0x12')](function(_0x2a3202){if(_0x2a3202){_0x2a3202[_0xbad7('0x1a')][_0xbad7('0x7f')]=util[_0xbad7('0x62')](_0xbad7('0x8a'),_0x163d74[_0xbad7('0x6a')]['name']);_0x2a3202[_0xbad7('0x1a')][_0xbad7('0x80')]=_0x16474a[_0xbad7('0x80')];_0x2a3202[_0xbad7('0x1a')]['motionChannel']=_0x16474a['channel'];_0x2a3202[_0xbad7('0x1a')][_0xbad7('0x8b')]='reject';_0x2a3202['message']['body']=htmlToText[_0xbad7('0x82')](_0x16474a['message'][_0xbad7('0x46')]);respondWithRpcPromise(_0xbad7('0x83'),_0xbad7('0x83'),{'event':_0xbad7('0x8c'),'message':_0x2a3202[_0xbad7('0x1a')]},client9002);return _0x16474a;}return null;})[_0xbad7('0x12')](respondWithResult(_0x234fcb,null))[_0xbad7('0x1b')](handleError(_0x234fcb,null));};exports[_0xbad7('0x8d')]=function(_0x3bcb62,_0x39d7a0){var _0x33f120=moment()['unix']()[_0xbad7('0x8e')]();var _0x4008aa=path[_0xbad7('0x59')](config[_0xbad7('0x5a')],_0xbad7('0x8f'),_0xbad7('0x90'),_0xbad7('0x91'));var _0x16d823=path[_0xbad7('0x59')](config['root'],'server','files',_0xbad7('0x58'));var _0x85649b=util[_0xbad7('0x62')](_0xbad7('0x92'),_0x33f120);return db['MailMessage'][_0xbad7('0x45')]({'where':{'id':_0x3bcb62[_0xbad7('0x43')]['id']},'attributes':['id',_0xbad7('0x46'),_0xbad7('0x93'),'to','cc',_0xbad7('0x94'),_0xbad7('0x95'),_0xbad7('0x96')],'include':_0x3bcb62[_0xbad7('0x2f')][_0xbad7('0x58')]?[{'model':db[_0xbad7('0x97')],'as':'Attachments'}]:undefined})[_0xbad7('0x12')](handleEntityNotFound(_0x39d7a0,null))['then'](function(_0x4a8a77){if(_0x4a8a77){var _0x3e24b1=_0x4a8a77;var _0x242380={'from':_0x3e24b1['from'],'to':_0x3e24b1['to'],'subject':_0x3e24b1[_0xbad7('0x95')],'html':htmlEntities[_0xbad7('0x98')](_0x3e24b1[_0xbad7('0x46')]),'headers':{'Date':moment(_0x3e24b1[_0xbad7('0x96')])[_0xbad7('0x62')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4a8a77['cc']){_0x242380[_0xbad7('0x99')]['Cc']=_0x4a8a77['cc'];}if(_0x4a8a77['bcc']){_0x242380[_0xbad7('0x99')][_0xbad7('0x9a')]=_0x4a8a77['bcc'];}return new BPromise(function(_0x3e982c,_0x1c67e8){if(_0x4a8a77[_0xbad7('0x9b')]){for(var _0x4d66c9=0x0;_0x4d66c9<_0x4a8a77['Attachments'][_0xbad7('0x36')];_0x4d66c9++){var _0x2a5c8e=_0x4a8a77[_0xbad7('0x9b')][_0x4d66c9];var _0x27ef89=path['join'](_0x16d823,_0x2a5c8e['basename']);if(fs[_0xbad7('0x9c')](_0x27ef89)){_0x242380['attachments']['push']({'name':_0x2a5c8e[_0xbad7('0x26')],'contentType':_0x2a5c8e[_0xbad7('0x2c')],'data':fs['readFileSync'](_0x27ef89)});}}}emlformat[_0xbad7('0x9d')](_0x242380,function(_0x3ffd22,_0x16632d){if(_0x3ffd22)return _0x1c67e8(_0x3ffd22);fs['writeFileSync'](path[_0xbad7('0x59')](_0x4008aa,_0x85649b),_0x16632d);return _0x3e982c(_0x16632d);});});}})[_0xbad7('0x12')](function(_0x4cbfa1){if(_0x4cbfa1){return _0x39d7a0[_0xbad7('0x8d')](path[_0xbad7('0x59')](_0x4008aa,_0x85649b),_0x85649b,function(_0x26c279){if(!_0x26c279)fs[_0xbad7('0x9e')](path[_0xbad7('0x59')](_0x4008aa,_0x85649b));});}})[_0xbad7('0x1b')](handleError(_0x39d7a0,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 5c954f7..1ec44db 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 _0xf5bc=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x10596a,_0x45c477){var _0x3d85bf=function(_0x6b9c9d){while(--_0x6b9c9d){_0x10596a['push'](_0x10596a['shift']());}};_0x3d85bf(++_0x45c477);}(_0xf5bc,0x13a));var _0xcf5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bc[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xcf5b('0x0'))['db'][_0xcf5b('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcf5b('0x2')](0x0);var events={'afterCreate':_0xcf5b('0x3'),'afterUpdate':_0xcf5b('0x4'),'afterDestroy':_0xcf5b('0x5')};function emitEvent(_0x2503d6){return function(_0x3a53a4,_0x3455c6,_0x1cabbe){MailMessageEvents[_0xcf5b('0x6')](_0x2503d6+':'+_0x3a53a4['id'],_0x3a53a4);MailMessageEvents[_0xcf5b('0x6')](_0x2503d6,_0x3a53a4);_0x1cabbe(null);};}for(var e in events){if(events[_0xcf5b('0x7')](e)){var event=events[e];MailMessage[_0xcf5b('0x8')](e,emitEvent(event));}}module[_0xcf5b('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x163d=['emit','hasOwnProperty','hook','events','MailMessage','setMaxListeners','save','update','remove'];(function(_0x4bd345,_0x465e2a){var _0x29ec51=function(_0x203106){while(--_0x203106){_0x4bd345['push'](_0x4bd345['shift']());}};_0x29ec51(++_0x465e2a);}(_0x163d,0x108));var _0xd163=function(_0x4e9f27,_0x4d3785){_0x4e9f27=_0x4e9f27-0x0;var _0x44cb5a=_0x163d[_0x4e9f27];return _0x44cb5a;};'use strict';var EventEmitter=require(_0xd163('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xd163('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xd163('0x2')](0x0);var events={'afterCreate':_0xd163('0x3'),'afterUpdate':_0xd163('0x4'),'afterDestroy':_0xd163('0x5')};function emitEvent(_0x270f58){return function(_0xea8581,_0x3bd6e4,_0x338582){MailMessageEvents[_0xd163('0x6')](_0x270f58+':'+_0xea8581['id'],_0xea8581);MailMessageEvents['emit'](_0x270f58,_0xea8581);_0x338582(null);};}for(var e in events){if(events[_0xd163('0x7')](e)){var event=events[e];MailMessage[_0xd163('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 5ab6fd9..e821efb 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 _0x04fc=['html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','secret','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise'];(function(_0x238078,_0x3a6c92){var _0x549178=function(_0x58f173){while(--_0x58f173){_0x238078['push'](_0x238078['shift']());}};_0x549178(++_0x3a6c92);}(_0x04fc,0xae));var _0xc04f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x04fc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc04f('0x0'));var util=require(_0xc04f('0x1'));var logger=require('../../config/logger')(_0xc04f('0x2'));var moment=require(_0xc04f('0x3'));var BPromise=require(_0xc04f('0x4'));var rp=require(_0xc04f('0x5'));var htmlToText=require(_0xc04f('0x6'));var fs=require('fs');var path=require(_0xc04f('0x7'));var rimraf=require(_0xc04f('0x8'));var config=require(_0xc04f('0x9'));var attributes=require(_0xc04f('0xa'));module[_0xc04f('0xb')]=function(_0x2435f0,_0x1bc27e){return _0x2435f0[_0xc04f('0xc')](_0xc04f('0xd'),attributes,{'tableName':_0xc04f('0xe'),'paranoid':![],'indexes':[{'name':_0xc04f('0xf'),'fields':[_0xc04f('0xf')]},{'name':'fti_mail_messages','fields':[_0xc04f('0x10'),_0xc04f('0x11')],'type':_0xc04f('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d2d4c,_0x26fad0,_0x410eff){if(_0x1d2d4c[_0xc04f('0x13')]){_0x1d2d4c['plainBody']=htmlToText[_0xc04f('0x14')](_0x1d2d4c[_0xc04f('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x410eff(null,_0x26fad0);},'afterCreate':function(_0x8e3b47,_0x2c0b5b,_0xb6d5f0){var _0x3176d9=_0x2435f0[_0xc04f('0x15')];var _0x48b413=_0x8e3b47[_0xc04f('0x16')]({'plain':!![]});if(_0x48b413['direction'][_0xc04f('0x17')]()==='in'||_0x48b413[_0xc04f('0x18')][_0xc04f('0x17')]()===_0xc04f('0x19')&&!_0x48b413[_0xc04f('0x1a')]&&!_['isNil'](_0x48b413[_0xc04f('0x1b')])){_0x3176d9['MailInteraction'][_0xc04f('0x1c')]({'where':{'id':_0x48b413[_0xc04f('0x1d')]}})[_0xc04f('0x1e')](function(_0x41dfe5){if(_0x41dfe5){_0x41dfe5[_0xc04f('0x1f')]({'lastMsgAt':_0x48b413[_0xc04f('0x20')],'lastMsgDirection':_0x48b413['direction']['toLowerCase']()});}})[_0xc04f('0x21')](function(_0x5cd3c4){console[_0xc04f('0x22')](_0x5cd3c4);});}_0xb6d5f0();}},'charset':_0xc04f('0x23'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa7e0=['moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','mail_messages','messageId','plainBody','FULLTEXT','fromString','body','models','get','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','then','update','createdAt','direction','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7e0,0x1b6));var _0x0a7e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa7e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a7e('0x0'));var util=require(_0x0a7e('0x1'));var logger=require(_0x0a7e('0x2'))(_0x0a7e('0x3'));var moment=require(_0x0a7e('0x4'));var BPromise=require(_0x0a7e('0x5'));var rp=require(_0x0a7e('0x6'));var htmlToText=require(_0x0a7e('0x7'));var fs=require('fs');var path=require(_0x0a7e('0x8'));var rimraf=require(_0x0a7e('0x9'));var config=require(_0x0a7e('0xa'));var attributes=require('./mailMessage.attributes');module[_0x0a7e('0xb')]=function(_0x289c1b,_0x5c1784){return _0x289c1b[_0x0a7e('0xc')]('MailMessage',attributes,{'tableName':_0x0a7e('0xd'),'paranoid':![],'indexes':[{'name':_0x0a7e('0xe'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x0a7e('0xf'),'subject'],'type':_0x0a7e('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4cb7e1,_0xc49d1c,_0x4bccd8){if(_0x4cb7e1['body']){_0x4cb7e1['plainBody']=htmlToText[_0x0a7e('0x11')](_0x4cb7e1[_0x0a7e('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4bccd8(null,_0xc49d1c);},'afterCreate':function(_0x54087c,_0x197771,_0x594537){var _0x333e1e=_0x289c1b[_0x0a7e('0x13')];var _0x1301b0=_0x54087c[_0x0a7e('0x14')]({'plain':!![]});if(_0x1301b0['direction'][_0x0a7e('0x15')]()==='in'||_0x1301b0['direction']['toLowerCase']()==='out'&&!_0x1301b0[_0x0a7e('0x16')]&&!_[_0x0a7e('0x17')](_0x1301b0[_0x0a7e('0x18')])){_0x333e1e[_0x0a7e('0x19')][_0x0a7e('0x1a')]({'where':{'id':_0x1301b0['MailInteractionId']}})[_0x0a7e('0x1b')](function(_0x160216){if(_0x160216){_0x160216[_0x0a7e('0x1c')]({'lastMsgAt':_0x1301b0[_0x0a7e('0x1d')],'lastMsgDirection':_0x1301b0[_0x0a7e('0x1e')][_0x0a7e('0x15')]()});}})['catch'](function(_0x5cdfd4){console[_0x0a7e('0x1f')](_0x5cdfd4);});}_0x594537();}},'charset':_0x0a7e('0x20'),'collate':_0x0a7e('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 238a04f..edbac2f 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 _0x2272=['MailMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateMailMessage'];(function(_0x27e367,_0x3fde2f){var _0x58cf10=function(_0x164ae0){while(--_0x164ae0){_0x27e367['push'](_0x27e367['shift']());}};_0x58cf10(++_0x3fde2f);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});config[_0x2227('0xb')]=_[_0x2227('0xc')](config[_0x2227('0xb')],{'host':_0x2227('0xd'),'port':0x18eb});var socket=require(_0x2227('0xe'))(new Redis(config[_0x2227('0xb')]));require(_0x2227('0xf'))['register'](socket);function respondWithRpcPromise(_0x799370,_0x5c1cba,_0x2f66ca){return new BPromise(function(_0x2d1c39,_0x164735){return client[_0x2227('0x10')](_0x799370,_0x2f66ca)[_0x2227('0x11')](function(_0x51ed54){logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,_0x2227('0x14'));logger[_0x2227('0x15')](_0x2227('0x16'),_0x5c1cba,_0x2227('0x14'),JSON['stringify'](_0x51ed54));if(_0x51ed54['error']){if(_0x51ed54['error'][_0x2227('0x17')]===0x1f4){logger['error'](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')]['message']);return _0x164735(_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);}logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);return _0x2d1c39(_0x51ed54['error'][_0x2227('0x19')]);}else{logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,'request\x20sent');_0x2d1c39(_0x51ed54[_0x2227('0x1a')][_0x2227('0x19')]);}})[_0x2227('0x1b')](function(_0x2482ba){logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x2482ba);_0x164735(_0x2482ba);});});}exports[_0x2227('0x1c')]=function(_0x4e0bba){var _0x386e6a=this;return new Promise(function(_0x59f988,_0x2b26b7){return db[_0x2227('0x1d')][_0x2227('0x1e')](_0x4e0bba[_0x2227('0x1f')],{'raw':_0x4e0bba[_0x2227('0x20')]?_0x4e0bba[_0x2227('0x20')][_0x2227('0x21')]===undefined?!![]:![]:!![]})[_0x2227('0x11')](function(_0x3299fd){logger[_0x2227('0x12')](_0x2227('0x1c'),_0x4e0bba);logger['debug'](_0x2227('0x1c'),_0x4e0bba,JSON[_0x2227('0x22')](_0x3299fd));_0x59f988(_0x3299fd);})['catch'](function(_0x2cef4b){logger[_0x2227('0x18')]('CreateMailMessage',_0x2cef4b['message'],_0x4e0bba);_0x2b26b7(_0x386e6a[_0x2227('0x18')](0x1f4,_0x2cef4b[_0x2227('0x19')]));});});}; \ No newline at end of file +var _0x1775=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0x1775,0x1db));var _0x5177=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1775[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});config[_0x5177('0xd')]=_[_0x5177('0xe')](config[_0x5177('0xd')],{'host':_0x5177('0xf'),'port':0x18eb});var socket=require(_0x5177('0x10'))(new Redis(config[_0x5177('0xd')]));require(_0x5177('0x11'))[_0x5177('0x12')](socket);function respondWithRpcPromise(_0x206035,_0x5bdca9,_0x4ae3d2){return new BPromise(function(_0x13c7f6,_0x1d7116){return client[_0x5177('0x13')](_0x206035,_0x4ae3d2)[_0x5177('0x14')](function(_0x301db2){logger['info'](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));logger[_0x5177('0x17')](_0x5177('0x18'),_0x5bdca9,_0x5177('0x16'),JSON[_0x5177('0x19')](_0x301db2));if(_0x301db2[_0x5177('0x1a')]){if(_0x301db2[_0x5177('0x1a')][_0x5177('0x1b')]===0x1f4){logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x1d7116(_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);}logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x13c7f6(_0x301db2['error'][_0x5177('0x1c')]);}else{logger[_0x5177('0x1d')](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));_0x13c7f6(_0x301db2['result'][_0x5177('0x1c')]);}})[_0x5177('0x1e')](function(_0x13d5d4){logger['error'](_0x5177('0x15'),_0x5bdca9,_0x13d5d4);_0x1d7116(_0x13d5d4);});});}exports['CreateMailMessage']=function(_0xc2b2b5){var _0xe221b3=this;return new Promise(function(_0x219744,_0x27b732){return db[_0x5177('0x1f')][_0x5177('0x20')](_0xc2b2b5[_0x5177('0x21')],{'raw':_0xc2b2b5[_0x5177('0x22')]?_0xc2b2b5[_0x5177('0x22')][_0x5177('0x23')]===undefined?!![]:![]:!![]})[_0x5177('0x14')](function(_0x3b0c37){logger['info'](_0x5177('0x24'),_0xc2b2b5);logger['debug'](_0x5177('0x24'),_0xc2b2b5,JSON[_0x5177('0x19')](_0x3b0c37));_0x219744(_0x3b0c37);})[_0x5177('0x1e')](function(_0x2d51d0){logger['error'](_0x5177('0x24'),_0x2d51d0['message'],_0xc2b2b5);_0x27b732(_0xe221b3['error'](0x1f4,_0x2d51d0[_0x5177('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f6634be..b3061b5 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 _0x0751=['update','emit','removeListener','register','./mailMessage.events','save','remove'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0751,0xd6));var _0x1075=function(_0x2fc83e,_0x7eddee){_0x2fc83e=_0x2fc83e-0x0;var _0x2f6e38=_0x0751[_0x2fc83e];return _0x2f6e38;};'use strict';var MailMessageEvents=require(_0x1075('0x0'));var events=[_0x1075('0x1'),_0x1075('0x2'),_0x1075('0x3')];function createListener(_0x5ba0ae,_0x42781e){return function(_0xd4a405){_0x42781e[_0x1075('0x4')](_0x5ba0ae,_0xd4a405);};}function removeListener(_0x63e36b,_0x5d57f3){return function(){MailMessageEvents[_0x1075('0x5')](_0x63e36b,_0x5d57f3);};}exports[_0x1075('0x6')]=function(_0x326346){for(var _0x57e76a=0x0,_0x2c5597=events['length'];_0x57e76a<_0x2c5597;_0x57e76a++){var _0x1a0733=events[_0x57e76a];var _0xd4f952=createListener('mailMessage:'+_0x1a0733,_0x326346);MailMessageEvents['on'](_0x1a0733,_0xd4f952);}}; \ No newline at end of file +var _0xec02=['save','remove','emit','length','mailMessage:'];(function(_0x1b78fc,_0x3d392e){var _0x5b2f71=function(_0x55b352){while(--_0x55b352){_0x1b78fc['push'](_0x1b78fc['shift']());}};_0x5b2f71(++_0x3d392e);}(_0xec02,0x1ef));var _0x2ec0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xec02[_0x167cc1];return _0x10bc4b;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x2ec0('0x0'),_0x2ec0('0x1'),'update'];function createListener(_0x1728b0,_0xc1ae03){return function(_0xcecb1){_0xc1ae03[_0x2ec0('0x2')](_0x1728b0,_0xcecb1);};}function removeListener(_0x54c2f6,_0x4ca213){return function(){MailMessageEvents['removeListener'](_0x54c2f6,_0x4ca213);};}exports['register']=function(_0x2b99f5){for(var _0x2f9855=0x0,_0x2d20c8=events[_0x2ec0('0x3')];_0x2f9855<_0x2d20c8;_0x2f9855++){var _0x218186=events[_0x2f9855];var _0xb7c433=createListener(_0x2ec0('0x4')+_0x218186,_0x2b99f5);MailMessageEvents['on'](_0x218186,_0xb7c433);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8582b2c..95775dc 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 _0x092d=['/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x092d,0x7f));var _0xd092=function(_0x5de390,_0x3b9908){_0x5de390=_0x5de390-0x0;var _0x12bf75=_0x092d[_0x5de390];return _0x12bf75;};'use strict';var multer=require('multer');var util=require(_0xd092('0x0'));var path=require('path');var timeout=require(_0xd092('0x1'));var express=require(_0xd092('0x2'));var router=express[_0xd092('0x3')]();var fs_extra=require(_0xd092('0x4'));var auth=require(_0xd092('0x5'));var interaction=require(_0xd092('0x6'));var config=require(_0xd092('0x7'));var controller=require('./mailQueue.controller');router[_0xd092('0x8')]('/',auth[_0xd092('0x9')](),controller[_0xd092('0xa')]);router[_0xd092('0x8')](_0xd092('0xb'),auth[_0xd092('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd092('0xc')]);router[_0xd092('0x8')](_0xd092('0xd'),auth[_0xd092('0x9')](),controller['getMembers']);router[_0xd092('0x8')](_0xd092('0xe'),auth[_0xd092('0x9')](),controller[_0xd092('0xf')]);router[_0xd092('0x8')](_0xd092('0x10'),auth[_0xd092('0x9')](),controller[_0xd092('0x11')]);router[_0xd092('0x12')]('/',auth['isAuthenticated'](),controller[_0xd092('0x13')]);router['post'](_0xd092('0xe'),auth['isAuthenticated'](),controller[_0xd092('0x14')]);router[_0xd092('0x12')](_0xd092('0x10'),auth[_0xd092('0x9')](),controller[_0xd092('0x15')]);router[_0xd092('0x16')](_0xd092('0x17'),auth[_0xd092('0x9')](),controller[_0xd092('0x18')]);router[_0xd092('0x19')]('/:id',auth[_0xd092('0x9')](),controller[_0xd092('0x1a')]);router[_0xd092('0x19')](_0xd092('0xe'),auth[_0xd092('0x9')](),controller['removeTeams']);router[_0xd092('0x19')](_0xd092('0x10'),auth[_0xd092('0x9')](),controller['removeAgents']);module[_0xd092('0x1b')]=router; \ No newline at end of file +var _0x787f=['/:id/teams','getTeams','/:id/users','create','post','addTeams','put','/:id','update','delete','removeAgents','exports','multer','path','Router','fs-extra','../../config/environment','./mailQueue.controller','isAuthenticated','index','/describe','describe','get','show','/:id/members','getMembers'];(function(_0x57500a,_0x42ad7c){var _0x3d38b9=function(_0x3278e4){while(--_0x3278e4){_0x57500a['push'](_0x57500a['shift']());}};_0x3d38b9(++_0x42ad7c);}(_0x787f,0x74));var _0xf787=function(_0x784035,_0x318960){_0x784035=_0x784035-0x0;var _0x18eb99=_0x787f[_0x784035];return _0x18eb99;};'use strict';var multer=require(_0xf787('0x0'));var util=require('util');var path=require(_0xf787('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf787('0x2')]();var fs_extra=require(_0xf787('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf787('0x4'));var controller=require(_0xf787('0x5'));router['get']('/',auth[_0xf787('0x6')](),controller[_0xf787('0x7')]);router['get'](_0xf787('0x8'),auth[_0xf787('0x6')](),controller[_0xf787('0x9')]);router[_0xf787('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf787('0xb')]);router[_0xf787('0xa')](_0xf787('0xc'),auth[_0xf787('0x6')](),controller[_0xf787('0xd')]);router[_0xf787('0xa')](_0xf787('0xe'),auth[_0xf787('0x6')](),controller[_0xf787('0xf')]);router[_0xf787('0xa')](_0xf787('0x10'),auth[_0xf787('0x6')](),controller['getAgents']);router['post']('/',auth[_0xf787('0x6')](),controller[_0xf787('0x11')]);router[_0xf787('0x12')]('/:id/teams',auth[_0xf787('0x6')](),controller[_0xf787('0x13')]);router[_0xf787('0x12')]('/:id/users',auth[_0xf787('0x6')](),controller['addAgents']);router[_0xf787('0x14')](_0xf787('0x15'),auth[_0xf787('0x6')](),controller[_0xf787('0x16')]);router[_0xf787('0x17')]('/:id',auth[_0xf787('0x6')](),controller['destroy']);router[_0xf787('0x17')]('/:id/teams',auth[_0xf787('0x6')](),controller['removeTeams']);router['delete'](_0xf787('0x10'),auth[_0xf787('0x6')](),controller[_0xf787('0x18')]);module[_0xf787('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4fcc1e0..5937669 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 _0x0676=['sequelize','exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x13f6fe,_0x4864c0){var _0x49aafb=function(_0x61e319){while(--_0x61e319){_0x13f6fe['push'](_0x13f6fe['shift']());}};_0x49aafb(++_0x4864c0);}(_0x0676,0x150));var _0x6067=function(_0x43cddf,_0x2d5bfb){_0x43cddf=_0x43cddf-0x0;var _0x1b2562=_0x0676[_0x43cddf];return _0x1b2562;};'use strict';var Sequelize=require(_0x6067('0x0'));module[_0x6067('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6067('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6067('0x3')](_0x6067('0x4'),_0x6067('0x5'),_0x6067('0x6'))}}; \ No newline at end of file +var _0xae55=['sequelize','STRING','name','INTEGER','rrmemory'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0xae55,0x12c));var _0x5ae5=function(_0x13c1c7,_0x427529){_0x13c1c7=_0x13c1c7-0x0;var _0x5d7551=_0xae55[_0x13c1c7];return _0x5d7551;};'use strict';var Sequelize=require(_0x5ae5('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ae5('0x1')],'unique':_0x5ae5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5ae5('0x1')]},'timeout':{'type':Sequelize[_0x5ae5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5ae5('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 27c0050..97f062e 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 _0x26ab=['mustache','util','path','sox','to-csv','fs-extra','lodash','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','redis','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','MailQueues','UserProfileResource','destroy','error','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','name','options','includeAll','include','findAll','rows','catch','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserMailQueue','findAndCountAll','UserId','agent','updatedAt','format','SIP','mailPause','createdAt','getTeams','Team','addTeams','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x2b18d8,_0x21778e){var _0x2bcce2=function(_0xc14e4b){while(--_0xc14e4b){_0x2b18d8['push'](_0x2b18d8['shift']());}};_0x2bcce2(++_0x21778e);}(_0x26ab,0x117));var _0xb26a=function(_0x4a06c4,_0x1fb8fa){_0x4a06c4=_0x4a06c4-0x0;var _0x4ced39=_0x26ab[_0x4a06c4];return _0x4ced39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb26a('0x0'));var zipdir=require(_0xb26a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb26a('0x2'));var moment=require(_0xb26a('0x3'));var BPromise=require(_0xb26a('0x4'));var Mustache=require(_0xb26a('0x5'));var util=require(_0xb26a('0x6'));var path=require(_0xb26a('0x7'));var sox=require(_0xb26a('0x8'));var csv=require(_0xb26a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb26a('0xa'));var _=require(_0xb26a('0xb'));var squel=require('squel');var crypto=require(_0xb26a('0xc'));var jsforce=require(_0xb26a('0xd'));var deskjs=require(_0xb26a('0xe'));var toCsv=require(_0xb26a('0x9'));var querystring=require(_0xb26a('0xf'));var Papa=require(_0xb26a('0x10'));var Redis=require(_0xb26a('0x11'));var authService=require(_0xb26a('0x12'));var qs=require(_0xb26a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb26a('0x14'));var logger=require(_0xb26a('0x15'))(_0xb26a('0x16'));var utils=require('../../config/utils');var config=require(_0xb26a('0x17'));var licenseUtil=require(_0xb26a('0x18'));var db=require(_0xb26a('0x19'))['db'];config['redis']=_['defaults'](config[_0xb26a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb26a('0x1b'))[_0xb26a('0x1c')](socket);function respondWithStatusCode(_0x5799d4,_0x5c7db2){_0x5c7db2=_0x5c7db2||0xcc;return function(_0x33edf6){if(_0x33edf6){return _0x5799d4[_0xb26a('0x1d')](_0x5c7db2);}return _0x5799d4[_0xb26a('0x1e')](_0x5c7db2)[_0xb26a('0x1f')]();};}function respondWithResult(_0x53e9fd,_0x4acc51){_0x4acc51=_0x4acc51||0xc8;return function(_0x3d7edd){if(_0x3d7edd){return _0x53e9fd['status'](_0x4acc51)['json'](_0x3d7edd);}};}function respondWithFilteredResult(_0x491f13,_0x1c6eeb){return function(_0x182de2){if(_0x182de2){var _0x133731=typeof _0x1c6eeb[_0xb26a('0x20')]===_0xb26a('0x21')&&typeof _0x1c6eeb[_0xb26a('0x22')]===_0xb26a('0x21');var _0x5b530f=_0x182de2[_0xb26a('0x23')];var _0x2c2d9e=_0x133731?0x0:_0x1c6eeb[_0xb26a('0x20')];var _0x5eb8bd=_0x133731?_0x182de2[_0xb26a('0x23')]:_0x1c6eeb[_0xb26a('0x20')]+_0x1c6eeb[_0xb26a('0x22')];var _0x6f0455;if(_0x5eb8bd>=_0x5b530f){_0x5eb8bd=_0x5b530f;_0x6f0455=0xc8;}else{_0x6f0455=0xce;}_0x491f13[_0xb26a('0x1e')](_0x6f0455);return _0x491f13['set'](_0xb26a('0x24'),_0x2c2d9e+'-'+_0x5eb8bd+'/'+_0x5b530f)[_0xb26a('0x25')](_0x182de2);}return null;};}function patchUpdates(_0xfc1b6f){return function(_0x30434a){try{jsonpatch[_0xb26a('0x26')](_0x30434a,_0xfc1b6f,!![]);}catch(_0x10493e){return BPromise[_0xb26a('0x27')](_0x10493e);}return _0x30434a[_0xb26a('0x28')]();};}function saveUpdates(_0x240aae,_0x1e116){return function(_0x735046){if(_0x735046){return _0x735046[_0xb26a('0x29')](_0x240aae)[_0xb26a('0x2a')](function(_0xcde346){return _0xcde346;});}return null;};}function removeEntity(_0xa9b8e1,_0x424fd0){return function(_0x161f32){if(_0x161f32){return _0x161f32['destroy']()[_0xb26a('0x2a')](function(){var _0x3ee3d3=_0x161f32['get']({'plain':!![]});var _0x5a13f8=_0xb26a('0x2b');return db[_0xb26a('0x2c')][_0xb26a('0x2d')]({'where':{'type':_0x5a13f8,'resourceId':_0x3ee3d3['id']}})[_0xb26a('0x2a')](function(){return _0x161f32;});})[_0xb26a('0x2a')](function(){_0xa9b8e1[_0xb26a('0x1e')](0xcc)[_0xb26a('0x1f')]();});}};}function handleEntityNotFound(_0x291b2f,_0x2ec380){return function(_0x2b265e){if(!_0x2b265e){_0x291b2f[_0xb26a('0x1d')](0x194);}return _0x2b265e;};}function handleError(_0x35e2dc,_0x26040b){_0x26040b=_0x26040b||0x1f4;return function(_0xb08903){logger[_0xb26a('0x2e')](_0xb08903['stack']);if(_0xb08903['name']){delete _0xb08903['name'];}_0x35e2dc['status'](_0x26040b)[_0xb26a('0x2f')](_0xb08903);};}exports[_0xb26a('0x30')]=function(_0x2a8363,_0x2e636a){var _0x1172be={},_0x166105={},_0x44fe3b={'count':0x0,'rows':[]};var _0x43bd70=_[_0xb26a('0x31')](db[_0xb26a('0x32')][_0xb26a('0x33')],function(_0x1c980a){return{'name':_0x1c980a[_0xb26a('0x34')],'type':_0x1c980a[_0xb26a('0x35')][_0xb26a('0x36')]};});_0x166105[_0xb26a('0x37')]=_['map'](_0x43bd70,'name');_0x166105[_0xb26a('0x38')]=_[_0xb26a('0x39')](_0x2a8363[_0xb26a('0x38')]);_0x166105[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x166105['model'],_0x166105[_0xb26a('0x38')]);_0x1172be[_0xb26a('0x3c')]=_['intersection'](_0x166105[_0xb26a('0x37')],qs[_0xb26a('0x3d')](_0x2a8363[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x1172be[_0xb26a('0x3c')]=_0x1172be['attributes'][_0xb26a('0x3e')]?_0x1172be[_0xb26a('0x3c')]:_0x166105[_0xb26a('0x37')];if(!_0x2a8363[_0xb26a('0x38')][_0xb26a('0x3f')](_0xb26a('0x40'))){_0x1172be[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x2a8363[_0xb26a('0x38')][_0xb26a('0x22')]);_0x1172be[_0xb26a('0x20')]=qs[_0xb26a('0x20')](_0x2a8363['query'][_0xb26a('0x20')]);}_0x1172be[_0xb26a('0x41')]=qs[_0xb26a('0x42')](_0x2a8363['query']['sort']);_0x1172be[_0xb26a('0x43')]=qs[_0xb26a('0x3a')](_[_0xb26a('0x44')](_0x2a8363[_0xb26a('0x38')],_0x166105[_0xb26a('0x3a')]),_0x43bd70);if(_0x2a8363['query'][_0xb26a('0x45')]){_0x1172be[_0xb26a('0x43')]=_[_0xb26a('0x46')](_0x1172be[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x43bd70,function(_0x1c4e99){if(_0x1c4e99[_0xb26a('0x35')]!=='VIRTUAL'){var _0x112a1f={};_0x112a1f[_0x1c4e99[_0xb26a('0x47')]]={'$like':'%'+_0x2a8363[_0xb26a('0x38')][_0xb26a('0x45')]+'%'};return _0x112a1f;}})});}_0x1172be=_['merge']({},_0x1172be,_0x2a8363[_0xb26a('0x48')]);var _0xa023fe={'where':_0x1172be[_0xb26a('0x43')]};return db[_0xb26a('0x32')]['count'](_0xa023fe)[_0xb26a('0x2a')](function(_0x264658){_0x44fe3b[_0xb26a('0x23')]=_0x264658;if(_0x2a8363[_0xb26a('0x38')][_0xb26a('0x49')]){_0x1172be[_0xb26a('0x4a')]=[{'all':!![]}];}return db[_0xb26a('0x32')][_0xb26a('0x4b')](_0x1172be);})['then'](function(_0x1be235){_0x44fe3b[_0xb26a('0x4c')]=_0x1be235;return _0x44fe3b;})[_0xb26a('0x2a')](respondWithFilteredResult(_0x2e636a,_0x1172be))[_0xb26a('0x4d')](handleError(_0x2e636a,null));};exports[_0xb26a('0x4e')]=function(_0xc6f13f,_0xb143bd){var _0xe35bbb={'raw':!![],'where':{'id':_0xc6f13f['params']['id']}},_0x19157f={};_0x19157f['model']=_['keys'](db[_0xb26a('0x32')][_0xb26a('0x33')]);_0x19157f['query']=_[_0xb26a('0x39')](_0xc6f13f[_0xb26a('0x38')]);_0x19157f[_0xb26a('0x3a')]=_['intersection'](_0x19157f['model'],_0x19157f[_0xb26a('0x38')]);_0xe35bbb[_0xb26a('0x3c')]=_['intersection'](_0x19157f['model'],qs[_0xb26a('0x3d')](_0xc6f13f['query'][_0xb26a('0x3d')]));_0xe35bbb[_0xb26a('0x3c')]=_0xe35bbb[_0xb26a('0x3c')]['length']?_0xe35bbb[_0xb26a('0x3c')]:_0x19157f[_0xb26a('0x37')];if(_0xc6f13f[_0xb26a('0x38')][_0xb26a('0x49')]){_0xe35bbb['include']=[{'all':!![]}];}_0xe35bbb=_[_0xb26a('0x46')]({},_0xe35bbb,_0xc6f13f[_0xb26a('0x48')]);return db[_0xb26a('0x32')][_0xb26a('0x4f')](_0xe35bbb)['then'](handleEntityNotFound(_0xb143bd,null))['then'](respondWithResult(_0xb143bd,null))['catch'](handleError(_0xb143bd,null));};exports[_0xb26a('0x50')]=function(_0x2ff8fd,_0xc716a7){return db[_0xb26a('0x32')][_0xb26a('0x50')](_0x2ff8fd['body'],{})['then'](function(_0x277690){var _0x373a51=_0x2ff8fd[_0xb26a('0x51')][_0xb26a('0x52')]({'plain':!![]});if(!_0x373a51)throw new Error(_0xb26a('0x53'));if(_0x373a51[_0xb26a('0x54')]===_0xb26a('0x51')){var _0x41fc41=_0x277690[_0xb26a('0x52')]({'plain':!![]});var _0x5e197f=_0xb26a('0x2b');return db[_0xb26a('0x55')][_0xb26a('0x4f')]({'where':{'name':_0x5e197f,'userProfileId':_0x373a51['userProfileId']},'raw':!![]})[_0xb26a('0x2a')](function(_0x40ada1){if(_0x40ada1&&_0x40ada1['autoAssociation']===0x0){return db[_0xb26a('0x2c')][_0xb26a('0x50')]({'name':_0x41fc41[_0xb26a('0x47')],'resourceId':_0x41fc41['id'],'type':_0x40ada1[_0xb26a('0x47')],'sectionId':_0x40ada1['id']},{})['then'](function(){return _0x277690;});}else{return _0x277690;}})[_0xb26a('0x4d')](function(_0x35349a){logger[_0xb26a('0x2e')](_0xb26a('0x56'),_0x35349a);throw _0x35349a;});}return _0x277690;})['then'](respondWithResult(_0xc716a7,0xc9))['catch'](handleError(_0xc716a7,null));};exports[_0xb26a('0x29')]=function(_0x338df9,_0x3234cc){if(_0x338df9[_0xb26a('0x57')]['id']){delete _0x338df9[_0xb26a('0x57')]['id'];}return db['MailQueue'][_0xb26a('0x4f')]({'where':{'id':_0x338df9[_0xb26a('0x58')]['id']}})['then'](handleEntityNotFound(_0x3234cc,null))[_0xb26a('0x2a')](saveUpdates(_0x338df9[_0xb26a('0x57')],null))[_0xb26a('0x2a')](respondWithResult(_0x3234cc,null))[_0xb26a('0x4d')](handleError(_0x3234cc,null));};exports[_0xb26a('0x2d')]=function(_0x13c0a5,_0x3af632){return db['MailQueue'][_0xb26a('0x4f')]({'where':{'id':_0x13c0a5[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x3af632,null))[_0xb26a('0x2a')](removeEntity(_0x3af632,null))[_0xb26a('0x4d')](handleError(_0x3af632,null));};exports[_0xb26a('0x59')]=function(_0x9fe7e7,_0xeb861a){return db[_0xb26a('0x32')][_0xb26a('0x59')]()[_0xb26a('0x2a')](respondWithResult(_0xeb861a,null))['catch'](handleError(_0xeb861a,null));};exports['getMembers']=function(_0x369271,_0x2c1988,_0x54a40a){var _0x501099={'raw':!![],'where':{}},_0x331ad8={},_0x567038;return db[_0xb26a('0x32')][_0xb26a('0x5a')]({'where':{'id':_0x369271[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x2c1988,null))[_0xb26a('0x2a')](function(_0x103e93){if(_0x103e93){_0x567038=_0x103e93['get']({'plain':!![]});_0x331ad8[_0xb26a('0x37')]=_[_0xb26a('0x39')](db[_0xb26a('0x5b')]['rawAttributes']);_0x331ad8[_0xb26a('0x38')]=_[_0xb26a('0x39')](_0x369271['query']);_0x331ad8[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x331ad8['model'],_0x331ad8[_0xb26a('0x38')]);_0x501099[_0xb26a('0x3c')]=_[_0xb26a('0x3b')](_0x331ad8[_0xb26a('0x37')],qs[_0xb26a('0x3d')](_0x369271[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x501099[_0xb26a('0x3c')]=_0x501099[_0xb26a('0x3c')][_0xb26a('0x3e')]?_0x501099[_0xb26a('0x3c')]:_0x331ad8[_0xb26a('0x37')];if(!_0x369271['query'][_0xb26a('0x3f')]('nolimit')){_0x501099[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x369271[_0xb26a('0x38')][_0xb26a('0x22')]);_0x501099[_0xb26a('0x20')]=qs['offset'](_0x369271[_0xb26a('0x38')][_0xb26a('0x20')]);}_0x501099['order']=qs[_0xb26a('0x42')](_0x369271[_0xb26a('0x38')][_0xb26a('0x42')]);_0x501099[_0xb26a('0x43')]=qs[_0xb26a('0x3a')](_[_0xb26a('0x44')](_0x369271[_0xb26a('0x38')],_0x331ad8[_0xb26a('0x3a')]));_0x501099[_0xb26a('0x43')]['MailQueueId']=_0x103e93['id'];if(_0x369271['query']['filter']){_0x501099[_0xb26a('0x43')]=_['merge'](_0x501099[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x501099['attributes'],function(_0x172b4a){var _0x37851c={};_0x37851c[_0x172b4a]={'$like':'%'+_0x369271[_0xb26a('0x38')]['filter']+'%'};return _0x37851c;})});}_0x501099=_[_0xb26a('0x46')]({},_0x501099,_0x369271[_0xb26a('0x48')]);return db['UserMailQueue'][_0xb26a('0x4b')](_0x501099);}})[_0xb26a('0x2a')](function(_0x5a25e6){if(_0x5a25e6){return db['User'][_0xb26a('0x5c')]({'where':{'id':_[_0xb26a('0x31')](_0x5a25e6,_0xb26a('0x5d')),'role':_0xb26a('0x5e')},'attributes':['id',_0xb26a('0x47'),'mailPause',_0xb26a('0x5f'),'createdAt']});}})[_0xb26a('0x2a')](function(_0x4c26f2){if(_0x4c26f2){return{'count':_0x4c26f2[_0xb26a('0x23')],'rows':_[_0xb26a('0x31')](_0x4c26f2[_0xb26a('0x4c')],function(_0x3995ba){return{'membername':_0x3995ba['name'],'UserId':_0x3995ba['id'],'queue_name':_0x567038[_0xb26a('0x47')],'MailQueueId':_0x567038['id'],'interface':util[_0xb26a('0x60')]('%s/%s',_0xb26a('0x61'),_0x3995ba[_0xb26a('0x47')]),'penalty':0x0,'paused':_0x3995ba[_0xb26a('0x62')],'createdAt':_0x3995ba[_0xb26a('0x63')],'updatedAt':_0x3995ba[_0xb26a('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb26a('0x2a')](respondWithFilteredResult(_0x2c1988,_0x501099))['catch'](handleError(_0x2c1988,null));};exports[_0xb26a('0x64')]=function(_0x3dda48,_0x50cfd0,_0x6723a2){var _0x67678c={};var _0x3eae8e={};var _0x26796f;var _0xac117f;return db[_0xb26a('0x32')][_0xb26a('0x5a')]({'where':{'id':_0x3dda48[_0xb26a('0x58')]['id']}})['then'](handleEntityNotFound(_0x50cfd0,null))[_0xb26a('0x2a')](function(_0x2fbf8b){if(_0x2fbf8b){_0x26796f=_0x2fbf8b;_0x3eae8e[_0xb26a('0x37')]=_['keys'](db[_0xb26a('0x65')][_0xb26a('0x33')]);_0x3eae8e[_0xb26a('0x38')]=_[_0xb26a('0x39')](_0x3dda48[_0xb26a('0x38')]);_0x3eae8e[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x3eae8e[_0xb26a('0x37')],_0x3eae8e[_0xb26a('0x38')]);_0x67678c[_0xb26a('0x3c')]=_[_0xb26a('0x3b')](_0x3eae8e[_0xb26a('0x37')],qs['fields'](_0x3dda48[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x67678c['attributes']=_0x67678c[_0xb26a('0x3c')]['length']?_0x67678c[_0xb26a('0x3c')]:_0x3eae8e[_0xb26a('0x37')];_0x67678c[_0xb26a('0x41')]=qs[_0xb26a('0x42')](_0x3dda48[_0xb26a('0x38')][_0xb26a('0x42')]);_0x67678c[_0xb26a('0x43')]=qs[_0xb26a('0x3a')](_['pick'](_0x3dda48[_0xb26a('0x38')],_0x3eae8e[_0xb26a('0x3a')]));if(_0x3dda48[_0xb26a('0x38')][_0xb26a('0x45')]){_0x67678c[_0xb26a('0x43')]=_[_0xb26a('0x46')](_0x67678c[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x67678c[_0xb26a('0x3c')],function(_0x133505){var _0x24ab70={};_0x24ab70[_0x133505]={'$like':'%'+_0x3dda48[_0xb26a('0x38')][_0xb26a('0x45')]+'%'};return _0x24ab70;})});}_0x67678c=_[_0xb26a('0x46')]({},_0x67678c,_0x3dda48[_0xb26a('0x48')]);return _0x26796f['getTeams'](_0x67678c);}})[_0xb26a('0x2a')](function(_0x165972){if(_0x165972){_0xac117f=_0x165972['length'];if(!_0x3dda48[_0xb26a('0x38')][_0xb26a('0x3f')](_0xb26a('0x40'))){_0x67678c[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x3dda48['query'][_0xb26a('0x22')]);_0x67678c['offset']=qs['offset'](_0x3dda48[_0xb26a('0x38')][_0xb26a('0x20')]);}return _0x26796f[_0xb26a('0x64')](_0x67678c);}})[_0xb26a('0x2a')](function(_0x4bef74){if(_0x4bef74){return _0x4bef74?{'count':_0xac117f,'rows':_0x4bef74}:null;}})[_0xb26a('0x2a')](respondWithResult(_0x50cfd0,null))[_0xb26a('0x4d')](handleError(_0x50cfd0,null));};exports[_0xb26a('0x66')]=function(_0xc4cf2c,_0xf332ab,_0x346c63){var _0x39a6af=_0xc4cf2c['body']['ids'];return db['Team'][_0xb26a('0x4b')]({'where':{'id':_0x39a6af},'attributes':['id'],'include':[{'model':db[_0xb26a('0x67')],'as':_0xb26a('0x68'),'attributes':['id',_0xb26a('0x47'),_0xb26a('0x69'),_0xb26a('0x6a'),'interface'],'raw':!![]}]})[_0xb26a('0x2a')](function(_0x34b73a){if(_0x34b73a){var _0x2eb67e=_[_0xb26a('0x6b')](_0x34b73a,function(_0x422c00){var _0xfeeb21=_0x422c00[_0xb26a('0x52')]({'plain':!![]});return _0xfeeb21[_0xb26a('0x68')];});return db[_0xb26a('0x32')]['find']({'where':{'id':_0xc4cf2c[_0xb26a('0x58')]['id']}})['then'](function(_0x2c0dc7){return db[_0xb26a('0x6c')][_0xb26a('0x6d')](function(_0x257cc2){return _0x2c0dc7[_0xb26a('0x66')](_0x39a6af,{'transaction':_0x257cc2})['then'](function(){return BPromise[_0xb26a('0x6e')](_0x2eb67e,function(_0x582286){return db[_0xb26a('0x5b')]['findOrCreate']({'where':{'UserId':_0x582286['id'],'MailQueueId':_0xc4cf2c[_0xb26a('0x58')]['id']},'transaction':_0x257cc2});});})['then'](function(){_0x2eb67e[_0xb26a('0x6f')](function(_0x545f3c){socket['emit'](_0xb26a('0x70'),{'UserId':_0x545f3c['id'],'MailQueueId':_0x2c0dc7['id']});});});});});}})[_0xb26a('0x2a')](respondWithStatusCode(_0xf332ab,null))[_0xb26a('0x4d')](handleError(_0xf332ab,null));};exports[_0xb26a('0x71')]=function(_0x15e922,_0x3c079a,_0x16e0d0){return db[_0xb26a('0x65')][_0xb26a('0x4b')]({'where':{'id':_0x15e922[_0xb26a('0x38')][_0xb26a('0x72')]},'attributes':['id'],'include':[{'model':db[_0xb26a('0x67')],'as':_0xb26a('0x68'),'attributes':['id'],'raw':!![]}]})[_0xb26a('0x2a')](handleEntityNotFound(_0x3c079a,null))['then'](function(_0x4a4b51){var _0x10a814=_[_0xb26a('0x31')](_0x4a4b51,'id');var _0x14d228=[];var _0x3d64a6=[];var _0x2d1138=squel[_0xb26a('0x73')]();_0x2d1138[_0xb26a('0x74')](_0xb26a('0x75'))[_0xb26a('0x76')](_0xb26a('0x77'),'tq')[_0xb26a('0x78')](_0xb26a('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb26a('0x7a'),_0x15e922[_0xb26a('0x58')]['id']);for(var _0x2f2911=0x0;_0x2f2911<_0x4a4b51[_0xb26a('0x3e')];_0x2f2911+=0x1){let _0x2c114d=_0x4a4b51[_0x2f2911];for(var _0x41d1ea=0x0;_0x41d1ea<_0x2c114d[_0xb26a('0x68')]['length'];_0x41d1ea+=0x1){let _0x2d732a=_0x2c114d[_0xb26a('0x68')][_0x41d1ea];var _0x4a764f=_0x2d1138[_0xb26a('0x7b')]();_0x4a764f['where'](_0xb26a('0x7c'),_0x2d732a['id']);_0x3d64a6[_0xb26a('0x7d')](db[_0xb26a('0x6c')]['query'](_0x4a764f[_0xb26a('0x7e')](),{'type':db[_0xb26a('0x6c')][_0xb26a('0x7f')][_0xb26a('0x80')]})[_0xb26a('0x2a')](function(_0x170172){if(_0x170172[_0xb26a('0x3e')]===0x1){return _0x2d732a['id'];}else{var _0x49af45=_[_0xb26a('0x81')](_[_0xb26a('0x31')](_0x170172,_0xb26a('0x82')),function(_0x413d9e){return _['includes'](_0x10a814,_0x413d9e);});if(_0x49af45){return _0x2d732a['id'];}}}));}}return BPromise[_0xb26a('0x83')](_0x3d64a6)[_0xb26a('0x2a')](function(_0x48af68){_0x14d228=_(_0x14d228)[_0xb26a('0x84')](_0x48af68)['compact']()['value']();return db['MailQueue'][_0xb26a('0x4f')]({'where':{'id':_0x15e922[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](function(_0xd3800b){return db[_0xb26a('0x6c')][_0xb26a('0x6d')](function(_0x4e8e44){return _0xd3800b[_0xb26a('0x71')](_0x15e922[_0xb26a('0x38')]['ids'],{'transaction':_0x4e8e44})['then'](function(){if(!_[_0xb26a('0x85')](_0x14d228)){return _0xd3800b[_0xb26a('0x86')](_0x14d228,{'transaction':_0x4e8e44});}})[_0xb26a('0x2a')](function(){_0x14d228[_0xb26a('0x6f')](function(_0x19a5fd){socket['emit'](_0xb26a('0x87'),{'UserId':_0x19a5fd,'MailQueueId':_0xd3800b['id']});});});});});});})[_0xb26a('0x2a')](respondWithStatusCode(_0x3c079a,null))[_0xb26a('0x4d')](handleError(_0x3c079a,null));};exports[_0xb26a('0x88')]=function(_0x3aec87,_0x36daf4,_0x4e852a){return db[_0xb26a('0x32')][_0xb26a('0x4f')]({'where':{'id':_0x3aec87[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x36daf4,null))[_0xb26a('0x2a')](function(_0x31dd18){if(_0x31dd18){return _0x31dd18[_0xb26a('0x88')](_0x3aec87['body']['ids'],_[_0xb26a('0x89')](_0x3aec87[_0xb26a('0x57')],[_0xb26a('0x72'),'id'])||{})[_0xb26a('0x8a')](function(_0x5f3868){for(var _0x17e0a0=0x0;_0x17e0a0<_0x3aec87[_0xb26a('0x57')]['ids'][_0xb26a('0x3e')];_0x17e0a0+=0x1){socket['emit'](_0xb26a('0x70'),{'UserId':Number(_0x3aec87[_0xb26a('0x57')][_0xb26a('0x72')][_0x17e0a0]),'MailQueueId':Number(_0x3aec87[_0xb26a('0x58')]['id'])});}return _0x5f3868;});}})[_0xb26a('0x2a')](respondWithResult(_0x36daf4,null))['catch'](handleError(_0x36daf4,null));};exports[_0xb26a('0x86')]=function(_0x45fd1b,_0x3b90a8,_0x5bad13){return db['MailQueue']['find']({'where':{'id':_0x45fd1b[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x3b90a8,null))[_0xb26a('0x2a')](function(_0x38c8c4){if(_0x38c8c4){return _0x38c8c4['removeAgents'](_0x45fd1b['query'][_0xb26a('0x72')])[_0xb26a('0x2a')](function(){if(_[_0xb26a('0x8b')](_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')])){for(var _0x54c42c=0x0;_0x54c42c<_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')][_0xb26a('0x3e')];_0x54c42c+=0x1){socket[_0xb26a('0x8c')](_0xb26a('0x87'),{'UserId':Number(_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')][_0x54c42c]),'MailQueueId':Number(_0x45fd1b[_0xb26a('0x58')]['id'])});}}else{socket['emit'](_0xb26a('0x87'),{'UserId':Number(_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')]),'MailQueueId':Number(_0x45fd1b[_0xb26a('0x58')]['id'])});}});}})[_0xb26a('0x2a')](respondWithStatusCode(_0x3b90a8,null))[_0xb26a('0x4d')](handleError(_0x3b90a8,null));};exports['getAgents']=function(_0x5dd897,_0x2a4889,_0x59d3fc){var _0x1fba4c={};var _0x1a35a7={};var _0xa9f266;var _0x2bcde3;return db[_0xb26a('0x32')][_0xb26a('0x5a')]({'where':{'id':_0x5dd897['params']['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x2a4889,null))[_0xb26a('0x2a')](function(_0x44507a){if(_0x44507a){_0xa9f266=_0x44507a;_0x1a35a7['model']=_[_0xb26a('0x39')](db[_0xb26a('0x67')][_0xb26a('0x33')]);_0x1a35a7[_0xb26a('0x38')]=_['keys'](_0x5dd897[_0xb26a('0x38')]);_0x1a35a7[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x1a35a7[_0xb26a('0x37')],_0x1a35a7[_0xb26a('0x38')]);_0x1fba4c['attributes']=_[_0xb26a('0x3b')](_0x1a35a7[_0xb26a('0x37')],qs[_0xb26a('0x3d')](_0x5dd897[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x1fba4c[_0xb26a('0x3c')]=_0x1fba4c[_0xb26a('0x3c')]['length']?_0x1fba4c[_0xb26a('0x3c')]:_0x1a35a7[_0xb26a('0x37')];_0x1fba4c[_0xb26a('0x41')]=qs[_0xb26a('0x42')](_0x5dd897[_0xb26a('0x38')][_0xb26a('0x42')]);_0x1fba4c[_0xb26a('0x43')]=qs['filters'](_['pick'](_0x5dd897[_0xb26a('0x38')],_0x1a35a7[_0xb26a('0x3a')]));if(_0x5dd897['query'][_0xb26a('0x45')]){_0x1fba4c[_0xb26a('0x43')]=_[_0xb26a('0x46')](_0x1fba4c[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x1fba4c[_0xb26a('0x3c')],function(_0x2cda82){var _0x5a1254={};_0x5a1254[_0x2cda82]={'$like':'%'+_0x5dd897[_0xb26a('0x38')]['filter']+'%'};return _0x5a1254;})});}_0x1fba4c=_[_0xb26a('0x46')]({},_0x1fba4c,_0x5dd897[_0xb26a('0x48')]);return _0xa9f266[_0xb26a('0x8d')](_0x1fba4c);}})[_0xb26a('0x2a')](function(_0x23bfbf){if(_0x23bfbf){_0x2bcde3=_0x23bfbf[_0xb26a('0x3e')];if(!_0x5dd897['query']['hasOwnProperty'](_0xb26a('0x40'))){_0x1fba4c[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x5dd897[_0xb26a('0x38')][_0xb26a('0x22')]);_0x1fba4c[_0xb26a('0x20')]=qs['offset'](_0x5dd897['query']['offset']);}return _0xa9f266[_0xb26a('0x8d')](_0x1fba4c);}})[_0xb26a('0x2a')](function(_0x2cf70c){if(_0x2cf70c){return _0x2cf70c?{'count':_0x2bcde3,'rows':_0x2cf70c}:null;}})['then'](respondWithResult(_0x2a4889,null))[_0xb26a('0x4d')](handleError(_0x2a4889,null));}; \ No newline at end of file +var _0x264f=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./mailQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','MailQueues','UserProfileResource','destroy','error','stack','name','send','map','MailQueue','rawAttributes','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','keys','UserMailQueue','nolimit','pick','MailQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x264f,0x19e));var _0xf264=function(_0x93fb49,_0x4f257d){_0x93fb49=_0x93fb49-0x0;var _0x41589f=_0x264f[_0x93fb49];return _0x41589f;};'use strict';var emlformat=require(_0xf264('0x0'));var rimraf=require(_0xf264('0x1'));var zipdir=require(_0xf264('0x2'));var jsonpatch=require(_0xf264('0x3'));var rp=require(_0xf264('0x4'));var moment=require(_0xf264('0x5'));var BPromise=require(_0xf264('0x6'));var Mustache=require(_0xf264('0x7'));var util=require(_0xf264('0x8'));var path=require(_0xf264('0x9'));var sox=require('sox');var csv=require(_0xf264('0xa'));var ejs=require(_0xf264('0xb'));var fs=require('fs');var fs_extra=require(_0xf264('0xc'));var _=require('lodash');var squel=require(_0xf264('0xd'));var crypto=require(_0xf264('0xe'));var jsforce=require(_0xf264('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf264('0xa'));var querystring=require(_0xf264('0x10'));var Papa=require(_0xf264('0x11'));var Redis=require(_0xf264('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf264('0x13'));var as=require(_0xf264('0x14'));var hardwareService=require(_0xf264('0x15'));var logger=require(_0xf264('0x16'))(_0xf264('0x17'));var utils=require('../../config/utils');var config=require(_0xf264('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf264('0x19'))['db'];config[_0xf264('0x1a')]=_[_0xf264('0x1b')](config[_0xf264('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf264('0x1a')]));require(_0xf264('0x1c'))[_0xf264('0x1d')](socket);function respondWithStatusCode(_0x535902,_0x34bb63){_0x34bb63=_0x34bb63||0xcc;return function(_0x2266fd){if(_0x2266fd){return _0x535902[_0xf264('0x1e')](_0x34bb63);}return _0x535902['status'](_0x34bb63)[_0xf264('0x1f')]();};}function respondWithResult(_0x1c797b,_0x47220b){_0x47220b=_0x47220b||0xc8;return function(_0x453ff6){if(_0x453ff6){return _0x1c797b[_0xf264('0x20')](_0x47220b)['json'](_0x453ff6);}};}function respondWithFilteredResult(_0x294da4,_0x4db669){return function(_0x23b8ba){if(_0x23b8ba){var _0x2c536c=typeof _0x4db669[_0xf264('0x21')]===_0xf264('0x22')&&typeof _0x4db669[_0xf264('0x23')]===_0xf264('0x22');var _0x596f99=_0x23b8ba[_0xf264('0x24')];var _0x4600f7=_0x2c536c?0x0:_0x4db669[_0xf264('0x21')];var _0x5b56bc=_0x2c536c?_0x23b8ba['count']:_0x4db669[_0xf264('0x21')]+_0x4db669['limit'];var _0x39be03;if(_0x5b56bc>=_0x596f99){_0x5b56bc=_0x596f99;_0x39be03=0xc8;}else{_0x39be03=0xce;}_0x294da4['status'](_0x39be03);return _0x294da4['set'](_0xf264('0x25'),_0x4600f7+'-'+_0x5b56bc+'/'+_0x596f99)[_0xf264('0x26')](_0x23b8ba);}return null;};}function patchUpdates(_0x5728e8){return function(_0x199259){try{jsonpatch[_0xf264('0x27')](_0x199259,_0x5728e8,!![]);}catch(_0x3c7827){return BPromise[_0xf264('0x28')](_0x3c7827);}return _0x199259[_0xf264('0x29')]();};}function saveUpdates(_0x5c7a92,_0x1e7056){return function(_0x110c12){if(_0x110c12){return _0x110c12[_0xf264('0x2a')](_0x5c7a92)[_0xf264('0x2b')](function(_0xce2416){return _0xce2416;});}return null;};}function removeEntity(_0x15fd27,_0x18f62d){return function(_0x2d2073){if(_0x2d2073){return _0x2d2073['destroy']()[_0xf264('0x2b')](function(){var _0x5a7715=_0x2d2073[_0xf264('0x2c')]({'plain':!![]});var _0x4757ba=_0xf264('0x2d');return db[_0xf264('0x2e')][_0xf264('0x2f')]({'where':{'type':_0x4757ba,'resourceId':_0x5a7715['id']}})['then'](function(){return _0x2d2073;});})['then'](function(){_0x15fd27[_0xf264('0x20')](0xcc)[_0xf264('0x1f')]();});}};}function handleEntityNotFound(_0x574db2,_0x38f194){return function(_0x498e85){if(!_0x498e85){_0x574db2[_0xf264('0x1e')](0x194);}return _0x498e85;};}function handleError(_0x496811,_0x22a5b2){_0x22a5b2=_0x22a5b2||0x1f4;return function(_0x2606fb){logger[_0xf264('0x30')](_0x2606fb[_0xf264('0x31')]);if(_0x2606fb[_0xf264('0x32')]){delete _0x2606fb[_0xf264('0x32')];}_0x496811['status'](_0x22a5b2)[_0xf264('0x33')](_0x2606fb);};}exports['index']=function(_0x393a6b,_0x40c189){var _0x295b1b={},_0x399a1f={},_0x19c1f3={'count':0x0,'rows':[]};var _0x4f45f3=_[_0xf264('0x34')](db[_0xf264('0x35')][_0xf264('0x36')],function(_0x3463b2){return{'name':_0x3463b2['fieldName'],'type':_0x3463b2['type'][_0xf264('0x37')]};});_0x399a1f['model']=_[_0xf264('0x34')](_0x4f45f3,'name');_0x399a1f[_0xf264('0x38')]=_['keys'](_0x393a6b['query']);_0x399a1f[_0xf264('0x39')]=_[_0xf264('0x3a')](_0x399a1f[_0xf264('0x3b')],_0x399a1f[_0xf264('0x38')]);_0x295b1b[_0xf264('0x3c')]=_[_0xf264('0x3a')](_0x399a1f['model'],qs[_0xf264('0x3d')](_0x393a6b[_0xf264('0x38')]['fields']));_0x295b1b[_0xf264('0x3c')]=_0x295b1b['attributes']['length']?_0x295b1b['attributes']:_0x399a1f[_0xf264('0x3b')];if(!_0x393a6b[_0xf264('0x38')][_0xf264('0x3e')]('nolimit')){_0x295b1b[_0xf264('0x23')]=qs['limit'](_0x393a6b[_0xf264('0x38')][_0xf264('0x23')]);_0x295b1b[_0xf264('0x21')]=qs[_0xf264('0x21')](_0x393a6b[_0xf264('0x38')][_0xf264('0x21')]);}_0x295b1b[_0xf264('0x3f')]=qs[_0xf264('0x40')](_0x393a6b[_0xf264('0x38')][_0xf264('0x40')]);_0x295b1b[_0xf264('0x41')]=qs[_0xf264('0x39')](_['pick'](_0x393a6b[_0xf264('0x38')],_0x399a1f[_0xf264('0x39')]),_0x4f45f3);if(_0x393a6b[_0xf264('0x38')][_0xf264('0x42')]){_0x295b1b[_0xf264('0x41')]=_[_0xf264('0x43')](_0x295b1b['where'],{'$or':_[_0xf264('0x34')](_0x4f45f3,function(_0xbc70c8){if(_0xbc70c8[_0xf264('0x44')]!==_0xf264('0x45')){var _0x252504={};_0x252504[_0xbc70c8[_0xf264('0x32')]]={'$like':'%'+_0x393a6b[_0xf264('0x38')][_0xf264('0x42')]+'%'};return _0x252504;}})});}_0x295b1b=_[_0xf264('0x43')]({},_0x295b1b,_0x393a6b[_0xf264('0x46')]);var _0x1774ed={'where':_0x295b1b[_0xf264('0x41')]};return db[_0xf264('0x35')]['count'](_0x1774ed)[_0xf264('0x2b')](function(_0x55dd81){_0x19c1f3['count']=_0x55dd81;if(_0x393a6b[_0xf264('0x38')][_0xf264('0x47')]){_0x295b1b[_0xf264('0x48')]=[{'all':!![]}];}return db[_0xf264('0x35')]['findAll'](_0x295b1b);})['then'](function(_0x332594){_0x19c1f3['rows']=_0x332594;return _0x19c1f3;})[_0xf264('0x2b')](respondWithFilteredResult(_0x40c189,_0x295b1b))['catch'](handleError(_0x40c189,null));};exports[_0xf264('0x49')]=function(_0x59c59a,_0x8d9169){var _0x2aeec9={'raw':!![],'where':{'id':_0x59c59a[_0xf264('0x4a')]['id']}},_0xa99248={};_0xa99248[_0xf264('0x3b')]=_['keys'](db[_0xf264('0x35')][_0xf264('0x36')]);_0xa99248[_0xf264('0x38')]=_['keys'](_0x59c59a[_0xf264('0x38')]);_0xa99248[_0xf264('0x39')]=_['intersection'](_0xa99248[_0xf264('0x3b')],_0xa99248[_0xf264('0x38')]);_0x2aeec9[_0xf264('0x3c')]=_[_0xf264('0x3a')](_0xa99248[_0xf264('0x3b')],qs[_0xf264('0x3d')](_0x59c59a['query'][_0xf264('0x3d')]));_0x2aeec9['attributes']=_0x2aeec9[_0xf264('0x3c')][_0xf264('0x4b')]?_0x2aeec9[_0xf264('0x3c')]:_0xa99248['model'];if(_0x59c59a[_0xf264('0x38')][_0xf264('0x47')]){_0x2aeec9[_0xf264('0x48')]=[{'all':!![]}];}_0x2aeec9=_[_0xf264('0x43')]({},_0x2aeec9,_0x59c59a['options']);return db[_0xf264('0x35')][_0xf264('0x4c')](_0x2aeec9)['then'](handleEntityNotFound(_0x8d9169,null))['then'](respondWithResult(_0x8d9169,null))[_0xf264('0x4d')](handleError(_0x8d9169,null));};exports[_0xf264('0x4e')]=function(_0x5782af,_0x2026bc){return db[_0xf264('0x35')]['create'](_0x5782af[_0xf264('0x4f')],{})['then'](function(_0x52e4c8){var _0x43cab0=_0x5782af[_0xf264('0x50')][_0xf264('0x2c')]({'plain':!![]});if(!_0x43cab0)throw new Error(_0xf264('0x51'));if(_0x43cab0[_0xf264('0x52')]==='user'){var _0xa3e07c=_0x52e4c8[_0xf264('0x2c')]({'plain':!![]});var _0x50d966=_0xf264('0x2d');return db[_0xf264('0x53')][_0xf264('0x4c')]({'where':{'name':_0x50d966,'userProfileId':_0x43cab0['userProfileId']},'raw':!![]})[_0xf264('0x2b')](function(_0x422b01){if(_0x422b01&&_0x422b01[_0xf264('0x54')]===0x0){return db[_0xf264('0x2e')][_0xf264('0x4e')]({'name':_0xa3e07c[_0xf264('0x32')],'resourceId':_0xa3e07c['id'],'type':_0x422b01[_0xf264('0x32')],'sectionId':_0x422b01['id']},{})[_0xf264('0x2b')](function(){return _0x52e4c8;});}else{return _0x52e4c8;}})[_0xf264('0x4d')](function(_0x29295c){logger[_0xf264('0x30')](_0xf264('0x55'),_0x29295c);throw _0x29295c;});}return _0x52e4c8;})[_0xf264('0x2b')](respondWithResult(_0x2026bc,0xc9))['catch'](handleError(_0x2026bc,null));};exports['update']=function(_0x4fb41e,_0x3ca426){if(_0x4fb41e['body']['id']){delete _0x4fb41e['body']['id'];}return db[_0xf264('0x35')][_0xf264('0x4c')]({'where':{'id':_0x4fb41e[_0xf264('0x4a')]['id']}})[_0xf264('0x2b')](handleEntityNotFound(_0x3ca426,null))[_0xf264('0x2b')](saveUpdates(_0x4fb41e[_0xf264('0x4f')],null))[_0xf264('0x2b')](respondWithResult(_0x3ca426,null))['catch'](handleError(_0x3ca426,null));};exports[_0xf264('0x2f')]=function(_0x2aa5be,_0x15a0c1){return db[_0xf264('0x35')][_0xf264('0x4c')]({'where':{'id':_0x2aa5be['params']['id']}})['then'](handleEntityNotFound(_0x15a0c1,null))[_0xf264('0x2b')](removeEntity(_0x15a0c1,null))['catch'](handleError(_0x15a0c1,null));};exports[_0xf264('0x56')]=function(_0x5b1646,_0x5c40f2){return db[_0xf264('0x35')][_0xf264('0x56')]()[_0xf264('0x2b')](respondWithResult(_0x5c40f2,null))[_0xf264('0x4d')](handleError(_0x5c40f2,null));};exports[_0xf264('0x57')]=function(_0x107886,_0x284a04,_0x2e73fd){var _0x179c58={'raw':!![],'where':{}},_0x134d5a={},_0x3f0a78;return db[_0xf264('0x35')][_0xf264('0x58')]({'where':{'id':_0x107886[_0xf264('0x4a')]['id']}})['then'](handleEntityNotFound(_0x284a04,null))[_0xf264('0x2b')](function(_0x3a91e6){if(_0x3a91e6){_0x3f0a78=_0x3a91e6[_0xf264('0x2c')]({'plain':!![]});_0x134d5a[_0xf264('0x3b')]=_[_0xf264('0x59')](db[_0xf264('0x5a')][_0xf264('0x36')]);_0x134d5a[_0xf264('0x38')]=_['keys'](_0x107886[_0xf264('0x38')]);_0x134d5a[_0xf264('0x39')]=_[_0xf264('0x3a')](_0x134d5a[_0xf264('0x3b')],_0x134d5a[_0xf264('0x38')]);_0x179c58['attributes']=_[_0xf264('0x3a')](_0x134d5a['model'],qs[_0xf264('0x3d')](_0x107886[_0xf264('0x38')][_0xf264('0x3d')]));_0x179c58['attributes']=_0x179c58['attributes'][_0xf264('0x4b')]?_0x179c58[_0xf264('0x3c')]:_0x134d5a[_0xf264('0x3b')];if(!_0x107886['query'][_0xf264('0x3e')](_0xf264('0x5b'))){_0x179c58[_0xf264('0x23')]=qs[_0xf264('0x23')](_0x107886[_0xf264('0x38')][_0xf264('0x23')]);_0x179c58[_0xf264('0x21')]=qs[_0xf264('0x21')](_0x107886[_0xf264('0x38')][_0xf264('0x21')]);}_0x179c58[_0xf264('0x3f')]=qs[_0xf264('0x40')](_0x107886[_0xf264('0x38')][_0xf264('0x40')]);_0x179c58['where']=qs['filters'](_[_0xf264('0x5c')](_0x107886[_0xf264('0x38')],_0x134d5a[_0xf264('0x39')]));_0x179c58['where'][_0xf264('0x5d')]=_0x3a91e6['id'];if(_0x107886['query'][_0xf264('0x42')]){_0x179c58[_0xf264('0x41')]=_[_0xf264('0x43')](_0x179c58[_0xf264('0x41')],{'$or':_[_0xf264('0x34')](_0x179c58[_0xf264('0x3c')],function(_0x2db3db){var _0x56aa09={};_0x56aa09[_0x2db3db]={'$like':'%'+_0x107886[_0xf264('0x38')]['filter']+'%'};return _0x56aa09;})});}_0x179c58=_[_0xf264('0x43')]({},_0x179c58,_0x107886[_0xf264('0x46')]);return db[_0xf264('0x5a')]['findAll'](_0x179c58);}})[_0xf264('0x2b')](function(_0x486979){if(_0x486979){return db[_0xf264('0x5e')][_0xf264('0x5f')]({'where':{'id':_[_0xf264('0x34')](_0x486979,_0xf264('0x60')),'role':'agent'},'attributes':['id',_0xf264('0x32'),'mailPause',_0xf264('0x61'),_0xf264('0x62')]});}})['then'](function(_0x2034a7){if(_0x2034a7){return{'count':_0x2034a7['count'],'rows':_['map'](_0x2034a7['rows'],function(_0x1d0ba9){return{'membername':_0x1d0ba9['name'],'UserId':_0x1d0ba9['id'],'queue_name':_0x3f0a78['name'],'MailQueueId':_0x3f0a78['id'],'interface':util[_0xf264('0x63')]('%s/%s',_0xf264('0x64'),_0x1d0ba9['name']),'penalty':0x0,'paused':_0x1d0ba9['mailPause'],'createdAt':_0x1d0ba9[_0xf264('0x62')],'updatedAt':_0x1d0ba9['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf264('0x2b')](respondWithFilteredResult(_0x284a04,_0x179c58))[_0xf264('0x4d')](handleError(_0x284a04,null));};exports[_0xf264('0x65')]=function(_0x46fa6e,_0x2df538,_0x583697){var _0x3255ee={};var _0x97e3d5={};var _0x57b9d4;var _0x2d464a;return db[_0xf264('0x35')][_0xf264('0x58')]({'where':{'id':_0x46fa6e[_0xf264('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2df538,null))['then'](function(_0x1cfb24){if(_0x1cfb24){_0x57b9d4=_0x1cfb24;_0x97e3d5['model']=_[_0xf264('0x59')](db[_0xf264('0x66')][_0xf264('0x36')]);_0x97e3d5[_0xf264('0x38')]=_['keys'](_0x46fa6e[_0xf264('0x38')]);_0x97e3d5[_0xf264('0x39')]=_[_0xf264('0x3a')](_0x97e3d5[_0xf264('0x3b')],_0x97e3d5[_0xf264('0x38')]);_0x3255ee[_0xf264('0x3c')]=_[_0xf264('0x3a')](_0x97e3d5[_0xf264('0x3b')],qs[_0xf264('0x3d')](_0x46fa6e[_0xf264('0x38')][_0xf264('0x3d')]));_0x3255ee[_0xf264('0x3c')]=_0x3255ee[_0xf264('0x3c')][_0xf264('0x4b')]?_0x3255ee[_0xf264('0x3c')]:_0x97e3d5[_0xf264('0x3b')];_0x3255ee['order']=qs['sort'](_0x46fa6e['query']['sort']);_0x3255ee[_0xf264('0x41')]=qs[_0xf264('0x39')](_['pick'](_0x46fa6e[_0xf264('0x38')],_0x97e3d5['filters']));if(_0x46fa6e[_0xf264('0x38')][_0xf264('0x42')]){_0x3255ee['where']=_[_0xf264('0x43')](_0x3255ee['where'],{'$or':_[_0xf264('0x34')](_0x3255ee[_0xf264('0x3c')],function(_0x5d3b6c){var _0x19bcf1={};_0x19bcf1[_0x5d3b6c]={'$like':'%'+_0x46fa6e[_0xf264('0x38')][_0xf264('0x42')]+'%'};return _0x19bcf1;})});}_0x3255ee=_['merge']({},_0x3255ee,_0x46fa6e[_0xf264('0x46')]);return _0x57b9d4[_0xf264('0x65')](_0x3255ee);}})[_0xf264('0x2b')](function(_0x4b913c){if(_0x4b913c){_0x2d464a=_0x4b913c[_0xf264('0x4b')];if(!_0x46fa6e[_0xf264('0x38')][_0xf264('0x3e')](_0xf264('0x5b'))){_0x3255ee[_0xf264('0x23')]=qs[_0xf264('0x23')](_0x46fa6e[_0xf264('0x38')][_0xf264('0x23')]);_0x3255ee[_0xf264('0x21')]=qs[_0xf264('0x21')](_0x46fa6e['query'][_0xf264('0x21')]);}return _0x57b9d4[_0xf264('0x65')](_0x3255ee);}})['then'](function(_0x2e4469){if(_0x2e4469){return _0x2e4469?{'count':_0x2d464a,'rows':_0x2e4469}:null;}})[_0xf264('0x2b')](respondWithResult(_0x2df538,null))[_0xf264('0x4d')](handleError(_0x2df538,null));};exports[_0xf264('0x67')]=function(_0x3cf1f3,_0x582ddf,_0x128684){var _0x4cc86b=_0x3cf1f3[_0xf264('0x4f')][_0xf264('0x68')];return db[_0xf264('0x66')][_0xf264('0x69')]({'where':{'id':_0x4cc86b},'attributes':['id'],'include':[{'model':db[_0xf264('0x5e')],'as':_0xf264('0x6a'),'attributes':['id',_0xf264('0x32'),_0xf264('0x6b'),_0xf264('0x6c'),_0xf264('0x6d')],'raw':!![]}]})[_0xf264('0x2b')](function(_0x336d90){if(_0x336d90){var _0x43c89b=_[_0xf264('0x6e')](_0x336d90,function(_0x367600){var _0x57804c=_0x367600[_0xf264('0x2c')]({'plain':!![]});return _0x57804c[_0xf264('0x6a')];});return db[_0xf264('0x35')][_0xf264('0x4c')]({'where':{'id':_0x3cf1f3['params']['id']}})[_0xf264('0x2b')](function(_0x3d999e){return db[_0xf264('0x6f')]['transaction'](function(_0x3c52fe){return _0x3d999e['addTeams'](_0x4cc86b,{'transaction':_0x3c52fe})[_0xf264('0x2b')](function(){return BPromise['each'](_0x43c89b,function(_0x1832f7){return db['UserMailQueue'][_0xf264('0x70')]({'where':{'UserId':_0x1832f7['id'],'MailQueueId':_0x3cf1f3[_0xf264('0x4a')]['id']},'transaction':_0x3c52fe});});})[_0xf264('0x2b')](function(){_0x43c89b[_0xf264('0x71')](function(_0x548ae){socket[_0xf264('0x72')](_0xf264('0x73'),{'UserId':_0x548ae['id'],'MailQueueId':_0x3d999e['id']});});});});});}})[_0xf264('0x2b')](respondWithStatusCode(_0x582ddf,null))[_0xf264('0x4d')](handleError(_0x582ddf,null));};exports[_0xf264('0x74')]=function(_0x4d24a3,_0x2acc80,_0x5c68d5){return db['Team']['findAll']({'where':{'id':_0x4d24a3[_0xf264('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf264('0x5e')],'as':_0xf264('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf264('0x2b')](handleEntityNotFound(_0x2acc80,null))[_0xf264('0x2b')](function(_0x588f13){var _0x141fde=_[_0xf264('0x34')](_0x588f13,'id');var _0x44b0aa=[];var _0x56cb8b=[];var _0x4b4e99=squel[_0xf264('0x75')]();_0x4b4e99[_0xf264('0x76')](_0xf264('0x77'))['from'](_0xf264('0x78'),'tq')['join'](_0xf264('0x79'),'ut',_0xf264('0x7a'))['where'](_0xf264('0x7b'),_0x4d24a3[_0xf264('0x4a')]['id']);for(var _0x2b6023=0x0;_0x2b6023<_0x588f13[_0xf264('0x4b')];_0x2b6023+=0x1){let _0x40259a=_0x588f13[_0x2b6023];for(var _0x186a5b=0x0;_0x186a5b<_0x40259a[_0xf264('0x6a')][_0xf264('0x4b')];_0x186a5b+=0x1){let _0x1be4e2=_0x40259a[_0xf264('0x6a')][_0x186a5b];var _0x15913f=_0x4b4e99[_0xf264('0x7c')]();_0x15913f['where'](_0xf264('0x7d'),_0x1be4e2['id']);_0x56cb8b[_0xf264('0x7e')](db[_0xf264('0x6f')]['query'](_0x15913f[_0xf264('0x7f')](),{'type':db[_0xf264('0x6f')]['QueryTypes'][_0xf264('0x80')]})[_0xf264('0x2b')](function(_0x1a7327){if(_0x1a7327[_0xf264('0x4b')]===0x1){return _0x1be4e2['id'];}else{var _0x113f06=_[_0xf264('0x81')](_[_0xf264('0x34')](_0x1a7327,_0xf264('0x82')),function(_0x4c0eb7){return _[_0xf264('0x83')](_0x141fde,_0x4c0eb7);});if(_0x113f06){return _0x1be4e2['id'];}}}));}}return BPromise[_0xf264('0x84')](_0x56cb8b)['then'](function(_0x214c77){_0x44b0aa=_(_0x44b0aa)[_0xf264('0x85')](_0x214c77)['compact']()[_0xf264('0x86')]();return db['MailQueue'][_0xf264('0x4c')]({'where':{'id':_0x4d24a3[_0xf264('0x4a')]['id']}})[_0xf264('0x2b')](function(_0x420b00){return db['sequelize'][_0xf264('0x87')](function(_0x58f2f7){return _0x420b00[_0xf264('0x74')](_0x4d24a3[_0xf264('0x38')]['ids'],{'transaction':_0x58f2f7})[_0xf264('0x2b')](function(){if(!_[_0xf264('0x88')](_0x44b0aa)){return _0x420b00['removeAgents'](_0x44b0aa,{'transaction':_0x58f2f7});}})[_0xf264('0x2b')](function(){_0x44b0aa[_0xf264('0x71')](function(_0x4b9422){socket[_0xf264('0x72')](_0xf264('0x89'),{'UserId':_0x4b9422,'MailQueueId':_0x420b00['id']});});});});});});})['then'](respondWithStatusCode(_0x2acc80,null))[_0xf264('0x4d')](handleError(_0x2acc80,null));};exports[_0xf264('0x8a')]=function(_0x11bb0d,_0x3a1bd3,_0x591ea4){return db[_0xf264('0x35')][_0xf264('0x4c')]({'where':{'id':_0x11bb0d[_0xf264('0x4a')]['id']}})[_0xf264('0x2b')](handleEntityNotFound(_0x3a1bd3,null))['then'](function(_0x1a74fb){if(_0x1a74fb){return _0x1a74fb['addAgents'](_0x11bb0d[_0xf264('0x4f')][_0xf264('0x68')],_[_0xf264('0x8b')](_0x11bb0d[_0xf264('0x4f')],[_0xf264('0x68'),'id'])||{})[_0xf264('0x8c')](function(_0x5bf376){for(var _0x4b5951=0x0;_0x4b5951<_0x11bb0d[_0xf264('0x4f')][_0xf264('0x68')]['length'];_0x4b5951+=0x1){socket[_0xf264('0x72')]('userMailQueue:save',{'UserId':Number(_0x11bb0d['body'][_0xf264('0x68')][_0x4b5951]),'MailQueueId':Number(_0x11bb0d['params']['id'])});}return _0x5bf376;});}})[_0xf264('0x2b')](respondWithResult(_0x3a1bd3,null))[_0xf264('0x4d')](handleError(_0x3a1bd3,null));};exports[_0xf264('0x8d')]=function(_0x3fbb3b,_0xaba9e5,_0x1e3fcb){return db[_0xf264('0x35')][_0xf264('0x4c')]({'where':{'id':_0x3fbb3b[_0xf264('0x4a')]['id']}})['then'](handleEntityNotFound(_0xaba9e5,null))['then'](function(_0x2eed6d){if(_0x2eed6d){return _0x2eed6d['removeAgents'](_0x3fbb3b['query'][_0xf264('0x68')])[_0xf264('0x2b')](function(){if(_[_0xf264('0x8e')](_0x3fbb3b['query'][_0xf264('0x68')])){for(var _0x1bff9f=0x0;_0x1bff9f<_0x3fbb3b['query'][_0xf264('0x68')][_0xf264('0x4b')];_0x1bff9f+=0x1){socket[_0xf264('0x72')](_0xf264('0x89'),{'UserId':Number(_0x3fbb3b[_0xf264('0x38')]['ids'][_0x1bff9f]),'MailQueueId':Number(_0x3fbb3b[_0xf264('0x4a')]['id'])});}}else{socket[_0xf264('0x72')](_0xf264('0x89'),{'UserId':Number(_0x3fbb3b[_0xf264('0x38')][_0xf264('0x68')]),'MailQueueId':Number(_0x3fbb3b[_0xf264('0x4a')]['id'])});}});}})[_0xf264('0x2b')](respondWithStatusCode(_0xaba9e5,null))[_0xf264('0x4d')](handleError(_0xaba9e5,null));};exports[_0xf264('0x8f')]=function(_0x2d843f,_0x1faf1f,_0xa9fb79){var _0x254f0a={};var _0x475ab6={};var _0x5e5776;var _0x56919a;return db['MailQueue'][_0xf264('0x58')]({'where':{'id':_0x2d843f[_0xf264('0x4a')]['id']}})[_0xf264('0x2b')](handleEntityNotFound(_0x1faf1f,null))[_0xf264('0x2b')](function(_0xecce92){if(_0xecce92){_0x5e5776=_0xecce92;_0x475ab6[_0xf264('0x3b')]=_[_0xf264('0x59')](db[_0xf264('0x5e')][_0xf264('0x36')]);_0x475ab6[_0xf264('0x38')]=_[_0xf264('0x59')](_0x2d843f[_0xf264('0x38')]);_0x475ab6['filters']=_['intersection'](_0x475ab6[_0xf264('0x3b')],_0x475ab6[_0xf264('0x38')]);_0x254f0a['attributes']=_[_0xf264('0x3a')](_0x475ab6[_0xf264('0x3b')],qs[_0xf264('0x3d')](_0x2d843f['query']['fields']));_0x254f0a['attributes']=_0x254f0a[_0xf264('0x3c')]['length']?_0x254f0a['attributes']:_0x475ab6[_0xf264('0x3b')];_0x254f0a[_0xf264('0x3f')]=qs[_0xf264('0x40')](_0x2d843f[_0xf264('0x38')]['sort']);_0x254f0a[_0xf264('0x41')]=qs[_0xf264('0x39')](_['pick'](_0x2d843f[_0xf264('0x38')],_0x475ab6[_0xf264('0x39')]));if(_0x2d843f['query'][_0xf264('0x42')]){_0x254f0a[_0xf264('0x41')]=_[_0xf264('0x43')](_0x254f0a[_0xf264('0x41')],{'$or':_['map'](_0x254f0a[_0xf264('0x3c')],function(_0x3fae75){var _0x20a377={};_0x20a377[_0x3fae75]={'$like':'%'+_0x2d843f[_0xf264('0x38')][_0xf264('0x42')]+'%'};return _0x20a377;})});}_0x254f0a=_[_0xf264('0x43')]({},_0x254f0a,_0x2d843f['options']);return _0x5e5776['getAgents'](_0x254f0a);}})[_0xf264('0x2b')](function(_0x432980){if(_0x432980){_0x56919a=_0x432980[_0xf264('0x4b')];if(!_0x2d843f['query'][_0xf264('0x3e')](_0xf264('0x5b'))){_0x254f0a[_0xf264('0x23')]=qs[_0xf264('0x23')](_0x2d843f[_0xf264('0x38')][_0xf264('0x23')]);_0x254f0a['offset']=qs[_0xf264('0x21')](_0x2d843f[_0xf264('0x38')][_0xf264('0x21')]);}return _0x5e5776[_0xf264('0x8f')](_0x254f0a);}})[_0xf264('0x2b')](function(_0xa816a6){if(_0xa816a6){return _0xa816a6?{'count':_0x56919a,'rows':_0xa816a6}:null;}})['then'](respondWithResult(_0x1faf1f,null))[_0xf264('0x4d')](handleError(_0x1faf1f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6de50c8..ff1316d 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 _0x4304=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x31b7ff,_0x4d3503){var _0x33ba84=function(_0x1e90b7){while(--_0x1e90b7){_0x31b7ff['push'](_0x31b7ff['shift']());}};_0x33ba84(++_0x4d3503);}(_0x4304,0x190));var _0x4430=function(_0x551ff4,_0x165eeb){_0x551ff4=_0x551ff4-0x0;var _0x26221f=_0x4304[_0x551ff4];return _0x26221f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x4430('0x0'))['db'][_0x4430('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4430('0x2')](0x0);var events={'afterCreate':_0x4430('0x3'),'afterUpdate':_0x4430('0x4'),'afterDestroy':_0x4430('0x5')};function emitEvent(_0x2be81b){return function(_0x4269dd,_0x368cc0,_0x1cfcac){MailQueueEvents[_0x4430('0x6')](_0x2be81b+':'+_0x4269dd['id'],_0x4269dd);MailQueueEvents['emit'](_0x2be81b,_0x4269dd);_0x1cfcac(null);};}for(var e in events){if(events[_0x4430('0x7')](e)){var event=events[e];MailQueue[_0x4430('0x8')](e,emitEvent(event));}}module[_0x4430('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xbaa1=['exports','events','../../mysqldb','MailQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d3a41,_0x2ac941){var _0x45a398=function(_0x35d07c){while(--_0x35d07c){_0x3d3a41['push'](_0x3d3a41['shift']());}};_0x45a398(++_0x2ac941);}(_0xbaa1,0x1a5));var _0x1baa=function(_0x18b676,_0x403d05){_0x18b676=_0x18b676-0x0;var _0x57d20d=_0xbaa1[_0x18b676];return _0x57d20d;};'use strict';var EventEmitter=require(_0x1baa('0x0'));var MailQueue=require(_0x1baa('0x1'))['db'][_0x1baa('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1baa('0x3'),'afterUpdate':_0x1baa('0x4'),'afterDestroy':_0x1baa('0x5')};function emitEvent(_0x41dd8e){return function(_0x586f15,_0x52d1bf,_0x260380){MailQueueEvents['emit'](_0x41dd8e+':'+_0x586f15['id'],_0x586f15);MailQueueEvents[_0x1baa('0x6')](_0x41dd8e,_0x586f15);_0x260380(null);};}for(var e in events){if(events[_0x1baa('0x7')](e)){var event=events[e];MailQueue[_0x1baa('0x8')](e,emitEvent(event));}}module[_0x1baa('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9f82ef9..957a3b9 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 _0xe503=['mail_queues','../../config/logger','api','bluebird','rimraf','exports','MailQueue'];(function(_0x760fc6,_0x4c9843){var _0x41e10c=function(_0x3b2796){while(--_0x3b2796){_0x760fc6['push'](_0x760fc6['shift']());}};_0x41e10c(++_0x4c9843);}(_0xe503,0xbe));var _0x3e50=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xe503[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3e50('0x0'))(_0x3e50('0x1'));var moment=require('moment');var BPromise=require(_0x3e50('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3e50('0x3'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x3e50('0x4')]=function(_0x5600cb,_0x475ab8){return _0x5600cb['define'](_0x3e50('0x5'),attributes,{'tableName':_0x3e50('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9fe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','lodash','util','../../config/logger'];(function(_0x49ddae,_0x2d5978){var _0x2a8c69=function(_0x56fe35){while(--_0x56fe35){_0x49ddae['push'](_0x49ddae['shift']());}};_0x2a8c69(++_0x2d5978);}(_0xd9fe,0x13d));var _0xed9f=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0xd9fe[_0x164af1];return _0x5d81a2;};'use strict';var _=require(_0xed9f('0x0'));var util=require(_0xed9f('0x1'));var logger=require(_0xed9f('0x2'))('api');var moment=require(_0xed9f('0x3'));var BPromise=require(_0xed9f('0x4'));var rp=require(_0xed9f('0x5'));var fs=require('fs');var path=require(_0xed9f('0x6'));var rimraf=require(_0xed9f('0x7'));var config=require(_0xed9f('0x8'));var attributes=require(_0xed9f('0x9'));module['exports']=function(_0x16faaa,_0x125c5a){return _0x16faaa['define']('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index c911b92..5d6999a 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 _0x81a4=['MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetMailQueue','MailQueue','options','raw','attributes','limit','map','include','model','stringify','ShowMailQueue','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x345ed1,_0x37c0b){var _0x5d5f7a=function(_0x57e0cb){while(--_0x57e0cb){_0x345ed1['push'](_0x345ed1['shift']());}};_0x5d5f7a(++_0x37c0b);}(_0x81a4,0x125));var _0x481a=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x81a4[_0x2797c6];return _0x54809f;};'use strict';var _=require('lodash');var util=require(_0x481a('0x0'));var moment=require(_0x481a('0x1'));var BPromise=require(_0x481a('0x2'));var rs=require(_0x481a('0x3'));var fs=require('fs');var Redis=require(_0x481a('0x4'));var db=require(_0x481a('0x5'))['db'];var utils=require(_0x481a('0x6'));var logger=require(_0x481a('0x7'))(_0x481a('0x8'));var config=require(_0x481a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x481a('0xa')][_0x481a('0xb')]({'port':0x232a});config['redis']=_[_0x481a('0xc')](config[_0x481a('0xd')],{'host':_0x481a('0xe'),'port':0x18eb});var socket=require(_0x481a('0xf'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x481a('0x10')](socket);function respondWithRpcPromise(_0x12506c,_0x5bf7d6,_0x4ece3f){return new BPromise(function(_0x468e63,_0x3f367e){return client['request'](_0x12506c,_0x4ece3f)[_0x481a('0x11')](function(_0x96066){logger[_0x481a('0x12')](_0x481a('0x13'),_0x5bf7d6,'request\x20sent');logger[_0x481a('0x14')](_0x481a('0x15'),_0x5bf7d6,_0x481a('0x16'),JSON['stringify'](_0x96066));if(_0x96066[_0x481a('0x17')]){if(_0x96066[_0x481a('0x17')][_0x481a('0x18')]===0x1f4){logger[_0x481a('0x17')]('MailQueue,\x20%s,\x20%s',_0x5bf7d6,_0x96066[_0x481a('0x17')][_0x481a('0x19')]);return _0x3f367e(_0x96066[_0x481a('0x17')][_0x481a('0x19')]);}logger[_0x481a('0x17')]('MailQueue,\x20%s,\x20%s',_0x5bf7d6,_0x96066[_0x481a('0x17')][_0x481a('0x19')]);return _0x468e63(_0x96066['error'][_0x481a('0x19')]);}else{logger['info'](_0x481a('0x13'),_0x5bf7d6,_0x481a('0x16'));_0x468e63(_0x96066['result'][_0x481a('0x19')]);}})[_0x481a('0x1a')](function(_0x21e435){logger[_0x481a('0x17')](_0x481a('0x13'),_0x5bf7d6,_0x21e435);_0x3f367e(_0x21e435);});});}exports[_0x481a('0x1b')]=function(_0x3b9362){var _0x587e8a=this;return new Promise(function(_0x2d6123,_0x4391e0){return db[_0x481a('0x1c')]['findAll']({'raw':_0x3b9362[_0x481a('0x1d')]?_0x3b9362[_0x481a('0x1d')][_0x481a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b9362['options']?_0x3b9362[_0x481a('0x1d')]['where']||null:null,'attributes':_0x3b9362[_0x481a('0x1d')]?_0x3b9362['options'][_0x481a('0x1f')]||null:null,'limit':_0x3b9362[_0x481a('0x1d')]?_0x3b9362[_0x481a('0x1d')][_0x481a('0x20')]||null:null,'include':_0x3b9362[_0x481a('0x1d')]?_0x3b9362[_0x481a('0x1d')]['include']?_[_0x481a('0x21')](_0x3b9362['options'][_0x481a('0x22')],function(_0x1bd826){return{'model':db[_0x1bd826[_0x481a('0x23')]],'as':_0x1bd826['as'],'attributes':_0x1bd826[_0x481a('0x1f')],'include':_0x1bd826[_0x481a('0x22')]?_[_0x481a('0x21')](_0x1bd826[_0x481a('0x22')],function(_0x111234){return{'model':db[_0x111234[_0x481a('0x23')]],'as':_0x111234['as'],'attributes':_0x111234['attributes'],'include':_0x111234[_0x481a('0x22')]?_[_0x481a('0x21')](_0x111234['include'],function(_0x4bc5cd){return{'model':db[_0x4bc5cd[_0x481a('0x23')]],'as':_0x4bc5cd['as'],'attributes':_0x4bc5cd[_0x481a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x159246){logger[_0x481a('0x12')]('GetMailQueue',_0x3b9362);logger[_0x481a('0x14')]('GetMailQueue',_0x3b9362,JSON[_0x481a('0x24')](_0x159246));_0x2d6123(_0x159246);})[_0x481a('0x1a')](function(_0x509a06){logger['error']('GetMailQueue',_0x509a06[_0x481a('0x19')],_0x3b9362);_0x4391e0(_0x587e8a[_0x481a('0x17')](0x1f4,_0x509a06[_0x481a('0x19')]));});});};exports[_0x481a('0x25')]=function(_0x9ab0b2){var _0x439677=this;return new Promise(function(_0xa6937,_0x2a290e){return db[_0x481a('0x1c')]['find']({'raw':_0x9ab0b2['options']?_0x9ab0b2['options'][_0x481a('0x1e')]===undefined?!![]:![]:!![],'where':_0x9ab0b2['options']?_0x9ab0b2[_0x481a('0x1d')][_0x481a('0x26')]||null:null,'attributes':_0x9ab0b2['options']?_0x9ab0b2[_0x481a('0x1d')]['attributes']||null:null,'include':_0x9ab0b2[_0x481a('0x1d')]?_0x9ab0b2['options'][_0x481a('0x22')]?_[_0x481a('0x21')](_0x9ab0b2[_0x481a('0x1d')][_0x481a('0x22')],function(_0x325f9b){return{'model':db[_0x325f9b[_0x481a('0x23')]],'as':_0x325f9b['as'],'attributes':_0x325f9b[_0x481a('0x1f')],'include':_0x325f9b[_0x481a('0x22')]?_[_0x481a('0x21')](_0x325f9b['include'],function(_0x1e6edc){return{'model':db[_0x1e6edc[_0x481a('0x23')]],'as':_0x1e6edc['as'],'attributes':_0x1e6edc[_0x481a('0x1f')],'include':_0x1e6edc[_0x481a('0x22')]?_[_0x481a('0x21')](_0x1e6edc['include'],function(_0x308765){return{'model':db[_0x308765[_0x481a('0x23')]],'as':_0x308765['as'],'attributes':_0x308765['attributes']};}):[]};}):[]};}):[]:[]})[_0x481a('0x11')](function(_0x1d4f65){logger[_0x481a('0x12')](_0x481a('0x25'),_0x9ab0b2);logger[_0x481a('0x14')](_0x481a('0x25'),_0x9ab0b2,JSON['stringify'](_0x1d4f65));_0xa6937(_0x1d4f65);})[_0x481a('0x1a')](function(_0x44802d){logger[_0x481a('0x17')](_0x481a('0x25'),_0x44802d['message'],_0x9ab0b2);_0x2a290e(_0x439677[_0x481a('0x17')](0x1f4,_0x44802d[_0x481a('0x19')]));});});}; \ No newline at end of file +var _0xa00e=['socket.io-emitter','./mailQueue.socket','register','then','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowMailQueue','MailQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x4613d8,_0xfd75eb){var _0x1be84a=function(_0x4569bf){while(--_0x4569bf){_0x4613d8['push'](_0x4613d8['shift']());}};_0x1be84a(++_0xfd75eb);}(_0xa00e,0x170));var _0xea00=function(_0x5a19b1,_0x11e515){_0x5a19b1=_0x5a19b1-0x0;var _0x3d1ca4=_0xa00e[_0x5a19b1];return _0x3d1ca4;};'use strict';var _=require(_0xea00('0x0'));var util=require('util');var moment=require(_0xea00('0x1'));var BPromise=require(_0xea00('0x2'));var rs=require(_0xea00('0x3'));var fs=require('fs');var Redis=require(_0xea00('0x4'));var db=require(_0xea00('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea00('0x6'))('rpc');var config=require(_0xea00('0x7'));var jayson=require(_0xea00('0x8'));var client=jayson['client'][_0xea00('0x9')]({'port':0x232a});config[_0xea00('0xa')]=_['defaults'](config['redis'],{'host':_0xea00('0xb'),'port':0x18eb});var socket=require(_0xea00('0xc'))(new Redis(config[_0xea00('0xa')]));require(_0xea00('0xd'))[_0xea00('0xe')](socket);function respondWithRpcPromise(_0x3ea5f3,_0x4515bd,_0x36d2c0){return new BPromise(function(_0x318d1d,_0x5ce5d3){return client['request'](_0x3ea5f3,_0x36d2c0)[_0xea00('0xf')](function(_0x4c0cb1){logger['info'](_0xea00('0x10'),_0x4515bd,_0xea00('0x11'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x4515bd,'request\x20sent',JSON[_0xea00('0x12')](_0x4c0cb1));if(_0x4c0cb1[_0xea00('0x13')]){if(_0x4c0cb1[_0xea00('0x13')]['code']===0x1f4){logger['error'](_0xea00('0x10'),_0x4515bd,_0x4c0cb1[_0xea00('0x13')][_0xea00('0x14')]);return _0x5ce5d3(_0x4c0cb1[_0xea00('0x13')][_0xea00('0x14')]);}logger[_0xea00('0x13')](_0xea00('0x10'),_0x4515bd,_0x4c0cb1[_0xea00('0x13')][_0xea00('0x14')]);return _0x318d1d(_0x4c0cb1[_0xea00('0x13')]['message']);}else{logger[_0xea00('0x15')](_0xea00('0x10'),_0x4515bd,_0xea00('0x11'));_0x318d1d(_0x4c0cb1[_0xea00('0x16')][_0xea00('0x14')]);}})['catch'](function(_0x2a1785){logger[_0xea00('0x13')]('MailQueue,\x20%s,\x20%s',_0x4515bd,_0x2a1785);_0x5ce5d3(_0x2a1785);});});}exports[_0xea00('0x17')]=function(_0x470054){var _0x3f04e4=this;return new Promise(function(_0x109a91,_0x4d667a){return db['MailQueue'][_0xea00('0x18')]({'raw':_0x470054['options']?_0x470054[_0xea00('0x19')][_0xea00('0x1a')]===undefined?!![]:![]:!![],'where':_0x470054['options']?_0x470054[_0xea00('0x19')][_0xea00('0x1b')]||null:null,'attributes':_0x470054['options']?_0x470054[_0xea00('0x19')][_0xea00('0x1c')]||null:null,'limit':_0x470054[_0xea00('0x19')]?_0x470054[_0xea00('0x19')][_0xea00('0x1d')]||null:null,'include':_0x470054[_0xea00('0x19')]?_0x470054[_0xea00('0x19')][_0xea00('0x1e')]?_[_0xea00('0x1f')](_0x470054[_0xea00('0x19')][_0xea00('0x1e')],function(_0x2ecb1b){return{'model':db[_0x2ecb1b[_0xea00('0x20')]],'as':_0x2ecb1b['as'],'attributes':_0x2ecb1b[_0xea00('0x1c')],'include':_0x2ecb1b[_0xea00('0x1e')]?_['map'](_0x2ecb1b[_0xea00('0x1e')],function(_0x53a9b5){return{'model':db[_0x53a9b5['model']],'as':_0x53a9b5['as'],'attributes':_0x53a9b5[_0xea00('0x1c')],'include':_0x53a9b5['include']?_[_0xea00('0x1f')](_0x53a9b5[_0xea00('0x1e')],function(_0x271ee9){return{'model':db[_0x271ee9[_0xea00('0x20')]],'as':_0x271ee9['as'],'attributes':_0x271ee9[_0xea00('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea00('0xf')](function(_0x85a606){logger[_0xea00('0x15')](_0xea00('0x17'),_0x470054);logger[_0xea00('0x21')]('GetMailQueue',_0x470054,JSON['stringify'](_0x85a606));_0x109a91(_0x85a606);})[_0xea00('0x22')](function(_0x1a0507){logger[_0xea00('0x13')]('GetMailQueue',_0x1a0507[_0xea00('0x14')],_0x470054);_0x4d667a(_0x3f04e4[_0xea00('0x13')](0x1f4,_0x1a0507[_0xea00('0x14')]));});});};exports[_0xea00('0x23')]=function(_0x30f293){var _0x5a07fb=this;return new Promise(function(_0x52957e,_0xfb05d7){return db[_0xea00('0x24')][_0xea00('0x25')]({'raw':_0x30f293[_0xea00('0x19')]?_0x30f293[_0xea00('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x30f293[_0xea00('0x19')]?_0x30f293[_0xea00('0x19')][_0xea00('0x1b')]||null:null,'attributes':_0x30f293['options']?_0x30f293[_0xea00('0x19')][_0xea00('0x1c')]||null:null,'include':_0x30f293[_0xea00('0x19')]?_0x30f293['options'][_0xea00('0x1e')]?_[_0xea00('0x1f')](_0x30f293[_0xea00('0x19')][_0xea00('0x1e')],function(_0x3c4ff0){return{'model':db[_0x3c4ff0[_0xea00('0x20')]],'as':_0x3c4ff0['as'],'attributes':_0x3c4ff0[_0xea00('0x1c')],'include':_0x3c4ff0[_0xea00('0x1e')]?_[_0xea00('0x1f')](_0x3c4ff0[_0xea00('0x1e')],function(_0x176e54){return{'model':db[_0x176e54[_0xea00('0x20')]],'as':_0x176e54['as'],'attributes':_0x176e54[_0xea00('0x1c')],'include':_0x176e54[_0xea00('0x1e')]?_[_0xea00('0x1f')](_0x176e54[_0xea00('0x1e')],function(_0x37578d){return{'model':db[_0x37578d[_0xea00('0x20')]],'as':_0x37578d['as'],'attributes':_0x37578d[_0xea00('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea00('0xf')](function(_0x136818){logger[_0xea00('0x15')](_0xea00('0x23'),_0x30f293);logger[_0xea00('0x21')](_0xea00('0x23'),_0x30f293,JSON[_0xea00('0x12')](_0x136818));_0x52957e(_0x136818);})['catch'](function(_0x2a3e69){logger['error'](_0xea00('0x23'),_0x2a3e69['message'],_0x30f293);_0xfb05d7(_0x5a07fb[_0xea00('0x13')](0x1f4,_0x2a3e69[_0xea00('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 4feb15c..24c04ed 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 _0xbf06=['mailQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x2a54a9,_0x4ba8f0){var _0x4ce558=function(_0x2708fd){while(--_0x2708fd){_0x2a54a9['push'](_0x2a54a9['shift']());}};_0x4ce558(++_0x4ba8f0);}(_0xbf06,0x101));var _0x6bf0=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xbf06[_0x9cd4c3];return _0x4c9025;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x6bf0('0x0'),_0x6bf0('0x1'),_0x6bf0('0x2')];function createListener(_0x1a969b,_0x208ee9){return function(_0x23f48c){_0x208ee9[_0x6bf0('0x3')](_0x1a969b,_0x23f48c);};}function removeListener(_0x58b98a,_0x58a2c6){return function(){MailQueueEvents[_0x6bf0('0x4')](_0x58b98a,_0x58a2c6);};}exports[_0x6bf0('0x5')]=function(_0x219a41){for(var _0x255ed6=0x0,_0x4fc26f=events[_0x6bf0('0x6')];_0x255ed6<_0x4fc26f;_0x255ed6++){var _0x29f59d=events[_0x255ed6];var _0x1db2a7=createListener(_0x6bf0('0x7')+_0x29f59d,_0x219a41);MailQueueEvents['on'](_0x29f59d,_0x1db2a7);}}; \ No newline at end of file +var _0xe50e=['./mailQueue.events','save','remove','emit','length','mailQueue:'];(function(_0x5533b6,_0x2d3021){var _0x4174aa=function(_0x41bd6c){while(--_0x41bd6c){_0x5533b6['push'](_0x5533b6['shift']());}};_0x4174aa(++_0x2d3021);}(_0xe50e,0x7e));var _0xee50=function(_0xb5677c,_0x2f5d57){_0xb5677c=_0xb5677c-0x0;var _0x145904=_0xe50e[_0xb5677c];return _0x145904;};'use strict';var MailQueueEvents=require(_0xee50('0x0'));var events=[_0xee50('0x1'),_0xee50('0x2'),'update'];function createListener(_0x5f1798,_0x419bad){return function(_0x573896){_0x419bad[_0xee50('0x3')](_0x5f1798,_0x573896);};}function removeListener(_0x3c22ca,_0x51d361){return function(){MailQueueEvents['removeListener'](_0x3c22ca,_0x51d361);};}exports['register']=function(_0xf35af1){for(var _0x3b24f7=0x0,_0xb4f83d=events[_0xee50('0x4')];_0x3b24f7<_0xb4f83d;_0x3b24f7++){var _0x542dda=events[_0x3b24f7];var _0x3932c0=createListener(_0xee50('0x5')+_0x542dda,_0xf35af1);MailQueueEvents['on'](_0x542dda,_0x3932c0);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e659698..95a768c 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 _0x68f6=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','put','update','delete','destroy'];(function(_0x55c6de,_0x972148){var _0x4fa991=function(_0x15cad8){while(--_0x15cad8){_0x55c6de['push'](_0x55c6de['shift']());}};_0x4fa991(++_0x972148);}(_0x68f6,0x86));var _0x668f=function(_0x4e8245,_0xb91617){_0x4e8245=_0x4e8245-0x0;var _0x2da502=_0x68f6[_0x4e8245];return _0x2da502;};'use strict';var multer=require(_0x668f('0x0'));var util=require(_0x668f('0x1'));var path=require(_0x668f('0x2'));var timeout=require(_0x668f('0x3'));var express=require('express');var router=express[_0x668f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x668f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x668f('0x6'));var controller=require(_0x668f('0x7'));router[_0x668f('0x8')]('/',auth['isAuthenticated'](),controller[_0x668f('0x9')]);router[_0x668f('0x8')](_0x668f('0xa'),auth[_0x668f('0xb')](),controller['describe']);router['get'](_0x668f('0xc'),auth[_0x668f('0xb')](),controller[_0x668f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x668f('0xe')]('/:id',auth[_0x668f('0xb')](),controller[_0x668f('0xf')]);router[_0x668f('0x10')](_0x668f('0xc'),auth[_0x668f('0xb')](),controller[_0x668f('0x11')]);module[_0x668f('0x12')]=router; \ No newline at end of file +var _0x0902=['Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','show','create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x0902,0x7a));var _0x2090=function(_0x518f9f,_0x1a6f19){_0x518f9f=_0x518f9f-0x0;var _0x274520=_0x0902[_0x518f9f];return _0x274520;};'use strict';var multer=require(_0x2090('0x0'));var util=require(_0x2090('0x1'));var path=require('path');var timeout=require(_0x2090('0x2'));var express=require(_0x2090('0x3'));var router=express[_0x2090('0x4')]();var fs_extra=require(_0x2090('0x5'));var auth=require(_0x2090('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2090('0x7'));var controller=require(_0x2090('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2090('0x9')]('/:id',auth[_0x2090('0xa')](),controller[_0x2090('0xb')]);router['post']('/',auth[_0x2090('0xa')](),controller[_0x2090('0xc')]);router[_0x2090('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x2090('0xe')]);router[_0x2090('0xf')](_0x2090('0x10'),auth[_0x2090('0xa')](),controller[_0x2090('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 8caf4ba..70555d1 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 _0x7c1c=['exports','STRING','DATE','moment'];(function(_0x17dd2e,_0x2d8c48){var _0x126a5e=function(_0x32da8e){while(--_0x32da8e){_0x17dd2e['push'](_0x17dd2e['shift']());}};_0x126a5e(++_0x2d8c48);}(_0x7c1c,0x1d3));var _0xc7c1=function(_0x26447e,_0x2e9c94){_0x26447e=_0x26447e-0x0;var _0x38cc1a=_0x7c1c[_0x26447e];return _0x38cc1a;};'use strict';var moment=require(_0xc7c1('0x0'));var Sequelize=require('sequelize');module[_0xc7c1('0x1')]={'uniqueid':{'type':Sequelize[_0xc7c1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc7c1('0x2')]},'joinAt':{'type':Sequelize[_0xc7c1('0x3')]},'leaveAt':{'type':Sequelize[_0xc7c1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc7c1('0x3')]},'reason':{'type':Sequelize[_0xc7c1('0x2')]}}; \ No newline at end of file +var _0x1b11=['sequelize','STRING','DATE','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1b11,0xf7));var _0x11b1=function(_0x1f55f3,_0x52310e){_0x1f55f3=_0x1f55f3-0x0;var _0x3fd49c=_0x1b11[_0x1f55f3];return _0x3fd49c;};'use strict';var moment=require(_0x11b1('0x0'));var Sequelize=require(_0x11b1('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x11b1('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x11b1('0x3')]},'leaveAt':{'type':Sequelize[_0x11b1('0x3')]},'acceptAt':{'type':Sequelize[_0x11b1('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x11b1('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index af54737..5e90f32 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 _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x43c04b,_0x505017){var _0x428588=function(_0x1ec084){while(--_0x1ec084){_0x43c04b['push'](_0x43c04b['shift']());}};_0x428588(++_0x505017);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['MailQueueReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));}; \ No newline at end of file +var _0xe2fe=['find','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','MailQueueReport','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x2c843d,_0x144e01){var _0x159a78=function(_0x15fff3){while(--_0x15fff3){_0x2c843d['push'](_0x2c843d['shift']());}};_0x159a78(++_0x144e01);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['MailQueueReport']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':!![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['MailQueueReport']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));};exports[_0xee2f('0x40')]=function(_0x3acae6,_0x2a450f){return db[_0xee2f('0x23')][_0xee2f('0x40')]()[_0xee2f('0x1c')](respondWithResult(_0x2a450f,null))[_0xee2f('0x3b')](handleError(_0x2a450f,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b794213..add108f 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 _0x394d=['report_mail_queue','uniqueid','lodash','moment','bluebird','path','../../config/environment','define'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x394d,0x12a));var _0xd394=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x394d[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xd394('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd394('0x1'));var BPromise=require(_0xd394('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd394('0x3'));var rimraf=require('rimraf');var config=require(_0xd394('0x4'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x24558b,_0x59a7fd){return _0x24558b[_0xd394('0x5')]('MailQueueReport',attributes,{'tableName':_0xd394('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd394('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23dd=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','api','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x23dd,0x163));var _0xd23d=function(_0x12aaff,_0x371ff6){_0x12aaff=_0x12aaff-0x0;var _0x2395f4=_0x23dd[_0x12aaff];return _0x2395f4;};'use strict';var _=require(_0xd23d('0x0'));var util=require(_0xd23d('0x1'));var logger=require('../../config/logger')(_0xd23d('0x2'));var moment=require('moment');var BPromise=require(_0xd23d('0x3'));var rp=require(_0xd23d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd23d('0x5'));var config=require(_0xd23d('0x6'));var attributes=require(_0xd23d('0x7'));module[_0xd23d('0x8')]=function(_0x4f06d8,_0x4e30fe){return _0x4f06d8[_0xd23d('0x9')](_0xd23d('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd23d('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 99d171e..34b2842 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x575321,_0x54f6b0){var _0x419a7a=function(_0x32f99b){while(--_0x32f99b){_0x575321['push'](_0x575321['shift']());}};_0x419a7a(++_0x54f6b0);}(_0x7a54,0x106));var _0x47a5=function(_0x1028b4,_0xb8da2e){_0x1028b4=_0x1028b4-0x0;var _0x21b84c=_0x7a54[_0x1028b4];return _0x21b84c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x215fba,_0x1b6a2a){var _0x5e31f3=function(_0x2ca5c8){while(--_0x2ca5c8){_0x215fba['push'](_0x215fba['shift']());}};_0x5e31f3(++_0x1b6a2a);}(_0x1261,0x144));var _0x1126=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x1261[_0x2074db];return _0x27324c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 5243ee0..a689bf7 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x421c79,_0x199886){var _0x2c87cf=function(_0x249c12){while(--_0x249c12){_0x421c79['push'](_0x421c79['shift']());}};_0x2c87cf(++_0x199886);}(_0x70e0,0x17b));var _0x070e=function(_0xa110c4,_0x24d9e7){_0xa110c4=_0xa110c4-0x0;var _0x407941=_0x70e0[_0xa110c4];return _0x407941;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ceaf4,_0x25b0c9){var _0x36f233=function(_0x136b8b){while(--_0x136b8b){_0x2ceaf4['push'](_0x2ceaf4['shift']());}};_0x36f233(++_0x25b0c9);}(_0xe706,0xa3));var _0x6e70=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0xe706[_0x1d7037];return _0x4d6568;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 3b6ca0c..cbe5d95 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 _0x8069=['BOOLEAN','INTEGER','INBOX','STRING'];(function(_0xa06b3f,_0x2cee0b){var _0x1c007e=function(_0x322345){while(--_0x322345){_0xa06b3f['push'](_0xa06b3f['shift']());}};_0x1c007e(++_0x2cee0b);}(_0x8069,0x67));var _0x9806=function(_0x3bcaac,_0x2f1612){_0x3bcaac=_0x3bcaac-0x0;var _0x2cdf61=_0x8069[_0x3bcaac];return _0x2cdf61;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9806('0x0')]},'host':{'type':Sequelize[_0x9806('0x0')]},'authentication':{'type':Sequelize[_0x9806('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9806('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9806('0x2')]},'tls':{'type':Sequelize[_0x9806('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9806('0x0')],'defaultValue':_0x9806('0x3')},'connTimeout':{'type':Sequelize[_0x9806('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9806('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9806('0x0')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe469=['STRING','BOOLEAN','INTEGER'];(function(_0x42831b,_0x2ab896){var _0x2381b4=function(_0x43c5db){while(--_0x43c5db){_0x42831b['push'](_0x42831b['shift']());}};_0x2381b4(++_0x2ab896);}(_0xe469,0x102));var _0x9e46=function(_0x34df04,_0x3ba3d2){_0x34df04=_0x34df04-0x0;var _0xbdc013=_0xe469[_0x34df04];return _0xbdc013;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9e46('0x0')]},'host':{'type':Sequelize[_0x9e46('0x0')]},'authentication':{'type':Sequelize[_0x9e46('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9e46('0x0')]},'password':{'type':Sequelize[_0x9e46('0x0')]},'port':{'type':Sequelize[_0x9e46('0x2')]},'tls':{'type':Sequelize[_0x9e46('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9e46('0x0')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9e46('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9e46('0x0')]},'modernAuthentication':{'type':Sequelize[_0x9e46('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e2e1743..cd384f7 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 _0x3e3c=['./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3e3c,0x1f0));var _0xc3e3=function(_0x25381c,_0x5a70bc){_0x25381c=_0x25381c-0x0;var _0x2aa5ad=_0x3e3c[_0x25381c];return _0x2aa5ad;};'use strict';var _=require(_0xc3e3('0x0'));var util=require(_0xc3e3('0x1'));var logger=require(_0xc3e3('0x2'))(_0xc3e3('0x3'));var moment=require(_0xc3e3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e3('0x5'));var rimraf=require(_0xc3e3('0x6'));var config=require(_0xc3e3('0x7'));var attributes=require(_0xc3e3('0x8'));module['exports']=function(_0x43b489,_0x132768){return _0x43b489[_0xc3e3('0x9')](_0xc3e3('0xa'),attributes,{'tableName':_0xc3e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb472=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x212a78,_0x5addfe){var _0x495749=function(_0x25b637){while(--_0x25b637){_0x212a78['push'](_0x212a78['shift']());}};_0x495749(++_0x5addfe);}(_0xb472,0x11b));var _0x2b47=function(_0xbb541e,_0x3a89ba){_0xbb541e=_0xbb541e-0x0;var _0xb12de4=_0xb472[_0xbb541e];return _0xb12de4;};'use strict';var _=require(_0x2b47('0x0'));var util=require(_0x2b47('0x1'));var logger=require(_0x2b47('0x2'))('api');var moment=require(_0x2b47('0x3'));var BPromise=require(_0x2b47('0x4'));var rp=require(_0x2b47('0x5'));var fs=require('fs');var path=require(_0x2b47('0x6'));var rimraf=require(_0x2b47('0x7'));var config=require(_0x2b47('0x8'));var attributes=require(_0x2b47('0x9'));module[_0x2b47('0xa')]=function(_0x1b126b,_0x3abbc1){return _0x1b126b['define'](_0x2b47('0xb'),attributes,{'tableName':_0x2b47('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 38b6474..681305b 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 _0xfbb4=['limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes'];(function(_0x47978a,_0x24c2c0){var _0x26ccf2=function(_0x26de97){while(--_0x26de97){_0x47978a['push'](_0x47978a['shift']());}};_0x26ccf2(++_0x24c2c0);}(_0xfbb4,0x186));var _0x4fbb=function(_0x566a82,_0x235929){_0x566a82=_0x566a82-0x0;var _0xe94f5c=_0xfbb4[_0x566a82];return _0xe94f5c;};'use strict';var _=require(_0x4fbb('0x0'));var util=require(_0x4fbb('0x1'));var moment=require(_0x4fbb('0x2'));var BPromise=require(_0x4fbb('0x3'));var rs=require(_0x4fbb('0x4'));var fs=require('fs');var Redis=require(_0x4fbb('0x5'));var db=require(_0x4fbb('0x6'))['db'];var utils=require(_0x4fbb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4fbb('0x8'));var jayson=require(_0x4fbb('0x9'));var client=jayson[_0x4fbb('0xa')][_0x4fbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f0b6b,_0x53a552,_0x4d1f58){return new BPromise(function(_0x4e57d7,_0xa17d45){return client[_0x4fbb('0xc')](_0x5f0b6b,_0x4d1f58)['then'](function(_0xc9ddea){logger[_0x4fbb('0xd')]('MailServerIn,\x20%s,\x20%s',_0x53a552,_0x4fbb('0xe'));logger[_0x4fbb('0xf')](_0x4fbb('0x10'),_0x53a552,_0x4fbb('0xe'),JSON[_0x4fbb('0x11')](_0xc9ddea));if(_0xc9ddea['error']){if(_0xc9ddea[_0x4fbb('0x12')][_0x4fbb('0x13')]===0x1f4){logger[_0x4fbb('0x12')](_0x4fbb('0x14'),_0x53a552,_0xc9ddea[_0x4fbb('0x12')]['message']);return _0xa17d45(_0xc9ddea['error'][_0x4fbb('0x15')]);}logger[_0x4fbb('0x12')](_0x4fbb('0x14'),_0x53a552,_0xc9ddea[_0x4fbb('0x12')]['message']);return _0x4e57d7(_0xc9ddea[_0x4fbb('0x12')]['message']);}else{logger['info'](_0x4fbb('0x14'),_0x53a552,_0x4fbb('0xe'));_0x4e57d7(_0xc9ddea['result'][_0x4fbb('0x15')]);}})[_0x4fbb('0x16')](function(_0x5ca84d){logger['error'](_0x4fbb('0x14'),_0x53a552,_0x5ca84d);_0xa17d45(_0x5ca84d);});});}exports[_0x4fbb('0x17')]=function(_0x288852){var _0x332737=this;return new Promise(function(_0x15633c,_0x6647c3){return db[_0x4fbb('0x18')][_0x4fbb('0x19')]({'raw':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1b')]===undefined?!![]:![]:!![],'where':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1c')]||null:null,'attributes':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1d')]||null:null,'limit':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1e')]||null:null,'include':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1f')]?_[_0x4fbb('0x20')](_0x288852['options']['include'],function(_0x39a309){return{'model':db[_0x39a309[_0x4fbb('0x21')]],'as':_0x39a309['as'],'attributes':_0x39a309[_0x4fbb('0x1d')],'include':_0x39a309[_0x4fbb('0x1f')]?_['map'](_0x39a309[_0x4fbb('0x1f')],function(_0x11ddd3){return{'model':db[_0x11ddd3['model']],'as':_0x11ddd3['as'],'attributes':_0x11ddd3['attributes'],'include':_0x11ddd3['include']?_[_0x4fbb('0x20')](_0x11ddd3[_0x4fbb('0x1f')],function(_0x26fc01){return{'model':db[_0x26fc01[_0x4fbb('0x21')]],'as':_0x26fc01['as'],'attributes':_0x26fc01['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fbb('0x22')](function(_0x288cf4){logger[_0x4fbb('0xd')]('GetMailServerIn',_0x288852);logger[_0x4fbb('0xf')](_0x4fbb('0x17'),_0x288852,JSON[_0x4fbb('0x11')](_0x288cf4));_0x15633c(_0x288cf4);})[_0x4fbb('0x16')](function(_0x1f068d){logger[_0x4fbb('0x12')](_0x4fbb('0x17'),_0x1f068d['message'],_0x288852);_0x6647c3(_0x332737[_0x4fbb('0x12')](0x1f4,_0x1f068d['message']));});});}; \ No newline at end of file +var _0x3f59=['include','model','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','map'];(function(_0x5d4600,_0x2c572f){var _0x5e71ef=function(_0x4f046f){while(--_0x4f046f){_0x5d4600['push'](_0x5d4600['shift']());}};_0x5e71ef(++_0x2c572f);}(_0x3f59,0x1b0));var _0x93f5=function(_0x2ed324,_0x3a392f){_0x2ed324=_0x2ed324-0x0;var _0xbdc124=_0x3f59[_0x2ed324];return _0xbdc124;};'use strict';var _=require(_0x93f5('0x0'));var util=require(_0x93f5('0x1'));var moment=require('moment');var BPromise=require(_0x93f5('0x2'));var rs=require(_0x93f5('0x3'));var fs=require('fs');var Redis=require(_0x93f5('0x4'));var db=require(_0x93f5('0x5'))['db'];var utils=require(_0x93f5('0x6'));var logger=require(_0x93f5('0x7'))(_0x93f5('0x8'));var config=require(_0x93f5('0x9'));var jayson=require(_0x93f5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb86c2d,_0x456295,_0x1e7b4d){return new BPromise(function(_0x24b75b,_0x16e2f6){return client['request'](_0xb86c2d,_0x1e7b4d)['then'](function(_0x491809){logger['info'](_0x93f5('0xb'),_0x456295,_0x93f5('0xc'));logger[_0x93f5('0xd')](_0x93f5('0xe'),_0x456295,'request\x20sent',JSON['stringify'](_0x491809));if(_0x491809[_0x93f5('0xf')]){if(_0x491809[_0x93f5('0xf')][_0x93f5('0x10')]===0x1f4){logger['error'](_0x93f5('0xb'),_0x456295,_0x491809['error'][_0x93f5('0x11')]);return _0x16e2f6(_0x491809[_0x93f5('0xf')][_0x93f5('0x11')]);}logger[_0x93f5('0xf')](_0x93f5('0xb'),_0x456295,_0x491809[_0x93f5('0xf')]['message']);return _0x24b75b(_0x491809[_0x93f5('0xf')][_0x93f5('0x11')]);}else{logger[_0x93f5('0x12')](_0x93f5('0xb'),_0x456295,_0x93f5('0xc'));_0x24b75b(_0x491809[_0x93f5('0x13')][_0x93f5('0x11')]);}})[_0x93f5('0x14')](function(_0x35afc3){logger[_0x93f5('0xf')](_0x93f5('0xb'),_0x456295,_0x35afc3);_0x16e2f6(_0x35afc3);});});}exports[_0x93f5('0x15')]=function(_0x4df4ec){var _0x8d8ffe=this;return new Promise(function(_0x3180f2,_0x45eac3){return db[_0x93f5('0x16')][_0x93f5('0x17')]({'raw':_0x4df4ec['options']?_0x4df4ec[_0x93f5('0x18')][_0x93f5('0x19')]===undefined?!![]:![]:!![],'where':_0x4df4ec[_0x93f5('0x18')]?_0x4df4ec[_0x93f5('0x18')][_0x93f5('0x1a')]||null:null,'attributes':_0x4df4ec[_0x93f5('0x18')]?_0x4df4ec[_0x93f5('0x18')][_0x93f5('0x1b')]||null:null,'limit':_0x4df4ec[_0x93f5('0x18')]?_0x4df4ec[_0x93f5('0x18')][_0x93f5('0x1c')]||null:null,'include':_0x4df4ec[_0x93f5('0x18')]?_0x4df4ec[_0x93f5('0x18')]['include']?_[_0x93f5('0x1d')](_0x4df4ec[_0x93f5('0x18')][_0x93f5('0x1e')],function(_0x3ffe51){return{'model':db[_0x3ffe51[_0x93f5('0x1f')]],'as':_0x3ffe51['as'],'attributes':_0x3ffe51[_0x93f5('0x1b')],'include':_0x3ffe51['include']?_[_0x93f5('0x1d')](_0x3ffe51[_0x93f5('0x1e')],function(_0x54955f){return{'model':db[_0x54955f[_0x93f5('0x1f')]],'as':_0x54955f['as'],'attributes':_0x54955f[_0x93f5('0x1b')],'include':_0x54955f['include']?_['map'](_0x54955f[_0x93f5('0x1e')],function(_0x11e86c){return{'model':db[_0x11e86c[_0x93f5('0x1f')]],'as':_0x11e86c['as'],'attributes':_0x11e86c[_0x93f5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bc6d1){logger['info'](_0x93f5('0x15'),_0x4df4ec);logger[_0x93f5('0xd')]('GetMailServerIn',_0x4df4ec,JSON[_0x93f5('0x20')](_0x2bc6d1));_0x3180f2(_0x2bc6d1);})[_0x93f5('0x14')](function(_0x136dc4){logger['error'](_0x93f5('0x15'),_0x136dc4['message'],_0x4df4ec);_0x45eac3(_0x8d8ffe[_0x93f5('0xf')](0x1f4,_0x136dc4['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 73023b8..8434dae 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index e039cdf..90d7636 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 _0x351d=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x13fd0a,_0x156b12){var _0x263ded=function(_0x4f8dc8){while(--_0x4f8dc8){_0x13fd0a['push'](_0x13fd0a['shift']());}};_0x263ded(++_0x156b12);}(_0x351d,0x90));var _0xd351=function(_0x25399f,_0x51bdce){_0x25399f=_0x25399f-0x0;var _0x71c33=_0x351d[_0x25399f];return _0x71c33;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'description':{'type':Sequelize[_0xd351('0x1')]},'host':{'type':Sequelize[_0xd351('0x1')]},'user':{'type':Sequelize[_0xd351('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd351('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xd351('0x1')]},'authentication':{'type':Sequelize[_0xd351('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb9be=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x4f00c6,_0x5bdf1b){var _0x4a107c=function(_0x20af0b){while(--_0x20af0b){_0x4f00c6['push'](_0x4f00c6['shift']());}};_0x4a107c(++_0x5bdf1b);}(_0xb9be,0xc5));var _0xeb9b=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xb9be[_0x67f95e];return _0x538f5a;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'description':{'type':Sequelize[_0xeb9b('0x2')]},'host':{'type':Sequelize[_0xeb9b('0x2')]},'user':{'type':Sequelize[_0xeb9b('0x2')]},'pass':{'type':Sequelize[_0xeb9b('0x2')]},'port':{'type':Sequelize[_0xeb9b('0x3')]},'secure':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xeb9b('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 54552e4..cd95215 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 _0xf7c4=['include','findAll','rows','show','intersection','find','catch','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','MailServerOut','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0xf7c4,0x9a));var _0x4f7c=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xf7c4[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0x4f7c('0x0'));var rimraf=require(_0x4f7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f7c('0x2'));var moment=require(_0x4f7c('0x3'));var BPromise=require(_0x4f7c('0x4'));var Mustache=require(_0x4f7c('0x5'));var util=require(_0x4f7c('0x6'));var path=require('path');var sox=require(_0x4f7c('0x7'));var csv=require('to-csv');var ejs=require(_0x4f7c('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7c('0x9'));var _=require(_0x4f7c('0xa'));var squel=require(_0x4f7c('0xb'));var crypto=require(_0x4f7c('0xc'));var jsforce=require(_0x4f7c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4f7c('0xe'));var querystring=require(_0x4f7c('0xf'));var Papa=require('papaparse');var Redis=require(_0x4f7c('0x10'));var authService=require(_0x4f7c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4f7c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f7c('0x13'))(_0x4f7c('0x14'));var utils=require(_0x4f7c('0x15'));var config=require(_0x4f7c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f7c('0x17'))['db'];function respondWithStatusCode(_0x2f3769,_0xa323a4){_0xa323a4=_0xa323a4||0xcc;return function(_0x488a5e){if(_0x488a5e){return _0x2f3769[_0x4f7c('0x18')](_0xa323a4);}return _0x2f3769[_0x4f7c('0x19')](_0xa323a4)['end']();};}function respondWithResult(_0x2b3a73,_0x5dce2a){_0x5dce2a=_0x5dce2a||0xc8;return function(_0x2482c6){if(_0x2482c6){return _0x2b3a73[_0x4f7c('0x19')](_0x5dce2a)['json'](_0x2482c6);}};}function respondWithFilteredResult(_0x45a443,_0x2b48e7){return function(_0x3e5863){if(_0x3e5863){var _0xd5c4ef=typeof _0x2b48e7[_0x4f7c('0x1a')]===_0x4f7c('0x1b')&&typeof _0x2b48e7[_0x4f7c('0x1c')]===_0x4f7c('0x1b');var _0x2e47c4=_0x3e5863[_0x4f7c('0x1d')];var _0xb1b556=_0xd5c4ef?0x0:_0x2b48e7[_0x4f7c('0x1a')];var _0x26a8a3=_0xd5c4ef?_0x3e5863[_0x4f7c('0x1d')]:_0x2b48e7['offset']+_0x2b48e7['limit'];var _0x2c159e;if(_0x26a8a3>=_0x2e47c4){_0x26a8a3=_0x2e47c4;_0x2c159e=0xc8;}else{_0x2c159e=0xce;}_0x45a443[_0x4f7c('0x19')](_0x2c159e);return _0x45a443['set'](_0x4f7c('0x1e'),_0xb1b556+'-'+_0x26a8a3+'/'+_0x2e47c4)[_0x4f7c('0x1f')](_0x3e5863);}return null;};}function patchUpdates(_0x3b9369){return function(_0x3068bc){try{jsonpatch[_0x4f7c('0x20')](_0x3068bc,_0x3b9369,!![]);}catch(_0x48232e){return BPromise[_0x4f7c('0x21')](_0x48232e);}return _0x3068bc[_0x4f7c('0x22')]();};}function saveUpdates(_0x3e28a7,_0x4b33bf){return function(_0xf1e226){if(_0xf1e226){return _0xf1e226[_0x4f7c('0x23')](_0x3e28a7)[_0x4f7c('0x24')](function(_0x1e82d6){return _0x1e82d6;});}return null;};}function removeEntity(_0x27abbe,_0x3b5da4){return function(_0x577d33){if(_0x577d33){return _0x577d33['destroy']()[_0x4f7c('0x24')](function(){_0x27abbe[_0x4f7c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5671db,_0x549314){return function(_0x17e996){if(!_0x17e996){_0x5671db[_0x4f7c('0x18')](0x194);}return _0x17e996;};}function handleError(_0x47db61,_0x55f59d){_0x55f59d=_0x55f59d||0x1f4;return function(_0x4cf5cf){logger[_0x4f7c('0x25')](_0x4cf5cf[_0x4f7c('0x26')]);if(_0x4cf5cf[_0x4f7c('0x27')]){delete _0x4cf5cf[_0x4f7c('0x27')];}_0x47db61[_0x4f7c('0x19')](_0x55f59d)[_0x4f7c('0x28')](_0x4cf5cf);};}exports[_0x4f7c('0x29')]=function(_0x5b6bb2,_0x149287){var _0x57bea0={},_0x289374={},_0x409857={'count':0x0,'rows':[]};var _0x3503d0=_[_0x4f7c('0x2a')](db[_0x4f7c('0x2b')]['rawAttributes'],function(_0x383304){return{'name':_0x383304[_0x4f7c('0x2c')],'type':_0x383304['type']['key']};});_0x289374[_0x4f7c('0x2d')]=_[_0x4f7c('0x2a')](_0x3503d0,'name');_0x289374[_0x4f7c('0x2e')]=_[_0x4f7c('0x2f')](_0x5b6bb2['query']);_0x289374[_0x4f7c('0x30')]=_['intersection'](_0x289374[_0x4f7c('0x2d')],_0x289374[_0x4f7c('0x2e')]);_0x57bea0[_0x4f7c('0x31')]=_['intersection'](_0x289374['model'],qs['fields'](_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x32')]));_0x57bea0[_0x4f7c('0x31')]=_0x57bea0[_0x4f7c('0x31')][_0x4f7c('0x33')]?_0x57bea0['attributes']:_0x289374[_0x4f7c('0x2d')];if(!_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x34')](_0x4f7c('0x35'))){_0x57bea0[_0x4f7c('0x1c')]=qs[_0x4f7c('0x1c')](_0x5b6bb2['query'][_0x4f7c('0x1c')]);_0x57bea0['offset']=qs[_0x4f7c('0x1a')](_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x1a')]);}_0x57bea0['order']=qs[_0x4f7c('0x36')](_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x36')]);_0x57bea0[_0x4f7c('0x37')]=qs[_0x4f7c('0x30')](_[_0x4f7c('0x38')](_0x5b6bb2[_0x4f7c('0x2e')],_0x289374[_0x4f7c('0x30')]),_0x3503d0);if(_0x5b6bb2['query']['filter']){_0x57bea0['where']=_[_0x4f7c('0x39')](_0x57bea0['where'],{'$or':_['map'](_0x3503d0,function(_0x2dd8f1){if(_0x2dd8f1[_0x4f7c('0x3a')]!==_0x4f7c('0x3b')){var _0x3d031d={};_0x3d031d[_0x2dd8f1[_0x4f7c('0x27')]]={'$like':'%'+_0x5b6bb2[_0x4f7c('0x2e')]['filter']+'%'};return _0x3d031d;}})});}_0x57bea0=_[_0x4f7c('0x39')]({},_0x57bea0,_0x5b6bb2[_0x4f7c('0x3c')]);var _0x2e9a37={'where':_0x57bea0[_0x4f7c('0x37')]};return db['MailServerOut'][_0x4f7c('0x1d')](_0x2e9a37)['then'](function(_0x426a0f){_0x409857[_0x4f7c('0x1d')]=_0x426a0f;if(_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x3d')]){_0x57bea0[_0x4f7c('0x3e')]=[{'all':!![]}];}return db[_0x4f7c('0x2b')][_0x4f7c('0x3f')](_0x57bea0);})[_0x4f7c('0x24')](function(_0xc61d07){_0x409857[_0x4f7c('0x40')]=_0xc61d07;return _0x409857;})[_0x4f7c('0x24')](respondWithFilteredResult(_0x149287,_0x57bea0))['catch'](handleError(_0x149287,null));};exports[_0x4f7c('0x41')]=function(_0x11712a,_0x2ccf78){var _0x4ba32e={'raw':!![],'where':{'id':_0x11712a['params']['id']}},_0x199610={};_0x199610[_0x4f7c('0x2d')]=_[_0x4f7c('0x2f')](db[_0x4f7c('0x2b')]['rawAttributes']);_0x199610['query']=_[_0x4f7c('0x2f')](_0x11712a['query']);_0x199610[_0x4f7c('0x30')]=_['intersection'](_0x199610[_0x4f7c('0x2d')],_0x199610[_0x4f7c('0x2e')]);_0x4ba32e[_0x4f7c('0x31')]=_[_0x4f7c('0x42')](_0x199610['model'],qs[_0x4f7c('0x32')](_0x11712a[_0x4f7c('0x2e')]['fields']));_0x4ba32e['attributes']=_0x4ba32e[_0x4f7c('0x31')]['length']?_0x4ba32e[_0x4f7c('0x31')]:_0x199610[_0x4f7c('0x2d')];if(_0x11712a[_0x4f7c('0x2e')][_0x4f7c('0x3d')]){_0x4ba32e[_0x4f7c('0x3e')]=[{'all':!![]}];}_0x4ba32e=_[_0x4f7c('0x39')]({},_0x4ba32e,_0x11712a[_0x4f7c('0x3c')]);return db[_0x4f7c('0x2b')][_0x4f7c('0x43')](_0x4ba32e)[_0x4f7c('0x24')](handleEntityNotFound(_0x2ccf78,null))[_0x4f7c('0x24')](respondWithResult(_0x2ccf78,null))[_0x4f7c('0x44')](handleError(_0x2ccf78,null));};exports[_0x4f7c('0x45')]=function(_0x3af557,_0x1ec4dd){return db['MailServerOut'][_0x4f7c('0x45')](_0x3af557[_0x4f7c('0x46')],{})[_0x4f7c('0x24')](respondWithResult(_0x1ec4dd,0xc9))[_0x4f7c('0x44')](handleError(_0x1ec4dd,null));};exports[_0x4f7c('0x23')]=function(_0x1b363a,_0x8a2408){if(_0x1b363a[_0x4f7c('0x46')]['id']){delete _0x1b363a[_0x4f7c('0x46')]['id'];}return db[_0x4f7c('0x2b')][_0x4f7c('0x43')]({'where':{'id':_0x1b363a['params']['id']}})[_0x4f7c('0x24')](handleEntityNotFound(_0x8a2408,null))[_0x4f7c('0x24')](saveUpdates(_0x1b363a[_0x4f7c('0x46')],null))[_0x4f7c('0x24')](respondWithResult(_0x8a2408,null))['catch'](handleError(_0x8a2408,null));};exports[_0x4f7c('0x47')]=function(_0x2f8beb,_0x54e997){return db[_0x4f7c('0x2b')]['find']({'where':{'id':_0x2f8beb['params']['id']}})[_0x4f7c('0x24')](handleEntityNotFound(_0x54e997,null))[_0x4f7c('0x24')](removeEntity(_0x54e997,null))['catch'](handleError(_0x54e997,null));}; \ No newline at end of file +var _0xcc5b=['set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','MailServerOut','findAll','rows','catch','params','length','includeAll','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0xcc5b,0x1b9));var _0xbcc5=function(_0x1a3470,_0x4b30e1){_0x1a3470=_0x1a3470-0x0;var _0x1837ad=_0xcc5b[_0x1a3470];return _0x1837ad;};'use strict';var emlformat=require(_0xbcc5('0x0'));var rimraf=require(_0xbcc5('0x1'));var zipdir=require(_0xbcc5('0x2'));var jsonpatch=require(_0xbcc5('0x3'));var rp=require(_0xbcc5('0x4'));var moment=require(_0xbcc5('0x5'));var BPromise=require(_0xbcc5('0x6'));var Mustache=require(_0xbcc5('0x7'));var util=require(_0xbcc5('0x8'));var path=require('path');var sox=require(_0xbcc5('0x9'));var csv=require(_0xbcc5('0xa'));var ejs=require(_0xbcc5('0xb'));var fs=require('fs');var fs_extra=require(_0xbcc5('0xc'));var _=require(_0xbcc5('0xd'));var squel=require(_0xbcc5('0xe'));var crypto=require(_0xbcc5('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbcc5('0xa'));var querystring=require(_0xbcc5('0x10'));var Papa=require(_0xbcc5('0x11'));var Redis=require(_0xbcc5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbcc5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcc5('0x14'));var logger=require(_0xbcc5('0x15'))(_0xbcc5('0x16'));var utils=require(_0xbcc5('0x17'));var config=require(_0xbcc5('0x18'));var licenseUtil=require(_0xbcc5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x119aab,_0x5da747){_0x5da747=_0x5da747||0xcc;return function(_0x481abe){if(_0x481abe){return _0x119aab[_0xbcc5('0x1a')](_0x5da747);}return _0x119aab[_0xbcc5('0x1b')](_0x5da747)['end']();};}function respondWithResult(_0x415f56,_0x334ccc){_0x334ccc=_0x334ccc||0xc8;return function(_0x29d32e){if(_0x29d32e){return _0x415f56[_0xbcc5('0x1b')](_0x334ccc)[_0xbcc5('0x1c')](_0x29d32e);}};}function respondWithFilteredResult(_0x23f676,_0x3809db){return function(_0x2f8d71){if(_0x2f8d71){var _0x590542=typeof _0x3809db[_0xbcc5('0x1d')]==='undefined'&&typeof _0x3809db[_0xbcc5('0x1e')]===_0xbcc5('0x1f');var _0x3917bb=_0x2f8d71[_0xbcc5('0x20')];var _0x73a6ed=_0x590542?0x0:_0x3809db['offset'];var _0x1f73fb=_0x590542?_0x2f8d71['count']:_0x3809db[_0xbcc5('0x1d')]+_0x3809db[_0xbcc5('0x1e')];var _0x3b7379;if(_0x1f73fb>=_0x3917bb){_0x1f73fb=_0x3917bb;_0x3b7379=0xc8;}else{_0x3b7379=0xce;}_0x23f676[_0xbcc5('0x1b')](_0x3b7379);return _0x23f676[_0xbcc5('0x21')](_0xbcc5('0x22'),_0x73a6ed+'-'+_0x1f73fb+'/'+_0x3917bb)[_0xbcc5('0x1c')](_0x2f8d71);}return null;};}function patchUpdates(_0x1ab8b9){return function(_0x4ca72e){try{jsonpatch[_0xbcc5('0x23')](_0x4ca72e,_0x1ab8b9,!![]);}catch(_0x58192f){return BPromise[_0xbcc5('0x24')](_0x58192f);}return _0x4ca72e[_0xbcc5('0x25')]();};}function saveUpdates(_0x5ef47d,_0x41af68){return function(_0x1d9221){if(_0x1d9221){return _0x1d9221[_0xbcc5('0x26')](_0x5ef47d)[_0xbcc5('0x27')](function(_0xfed8e2){return _0xfed8e2;});}return null;};}function removeEntity(_0x1309b8,_0x4a8c81){return function(_0x26b87a){if(_0x26b87a){return _0x26b87a[_0xbcc5('0x28')]()[_0xbcc5('0x27')](function(){_0x1309b8[_0xbcc5('0x1b')](0xcc)[_0xbcc5('0x29')]();});}};}function handleEntityNotFound(_0x575e4f,_0x5259d2){return function(_0x15a9b5){if(!_0x15a9b5){_0x575e4f[_0xbcc5('0x1a')](0x194);}return _0x15a9b5;};}function handleError(_0x199555,_0x13ce6a){_0x13ce6a=_0x13ce6a||0x1f4;return function(_0x4dbf57){logger[_0xbcc5('0x2a')](_0x4dbf57[_0xbcc5('0x2b')]);if(_0x4dbf57[_0xbcc5('0x2c')]){delete _0x4dbf57['name'];}_0x199555[_0xbcc5('0x1b')](_0x13ce6a)[_0xbcc5('0x2d')](_0x4dbf57);};}exports[_0xbcc5('0x2e')]=function(_0x423bb5,_0x3c6eee){var _0x4b87aa={},_0x5579f4={},_0x17624a={'count':0x0,'rows':[]};var _0x8832f2=_[_0xbcc5('0x2f')](db['MailServerOut'][_0xbcc5('0x30')],function(_0x215ff8){return{'name':_0x215ff8[_0xbcc5('0x31')],'type':_0x215ff8[_0xbcc5('0x32')][_0xbcc5('0x33')]};});_0x5579f4[_0xbcc5('0x34')]=_[_0xbcc5('0x2f')](_0x8832f2,'name');_0x5579f4[_0xbcc5('0x35')]=_[_0xbcc5('0x36')](_0x423bb5[_0xbcc5('0x35')]);_0x5579f4[_0xbcc5('0x37')]=_[_0xbcc5('0x38')](_0x5579f4['model'],_0x5579f4[_0xbcc5('0x35')]);_0x4b87aa[_0xbcc5('0x39')]=_['intersection'](_0x5579f4[_0xbcc5('0x34')],qs[_0xbcc5('0x3a')](_0x423bb5[_0xbcc5('0x35')]['fields']));_0x4b87aa[_0xbcc5('0x39')]=_0x4b87aa[_0xbcc5('0x39')]['length']?_0x4b87aa[_0xbcc5('0x39')]:_0x5579f4[_0xbcc5('0x34')];if(!_0x423bb5[_0xbcc5('0x35')][_0xbcc5('0x3b')](_0xbcc5('0x3c'))){_0x4b87aa['limit']=qs['limit'](_0x423bb5[_0xbcc5('0x35')][_0xbcc5('0x1e')]);_0x4b87aa[_0xbcc5('0x1d')]=qs[_0xbcc5('0x1d')](_0x423bb5[_0xbcc5('0x35')]['offset']);}_0x4b87aa[_0xbcc5('0x3d')]=qs[_0xbcc5('0x3e')](_0x423bb5['query'][_0xbcc5('0x3e')]);_0x4b87aa[_0xbcc5('0x3f')]=qs[_0xbcc5('0x37')](_[_0xbcc5('0x40')](_0x423bb5[_0xbcc5('0x35')],_0x5579f4['filters']),_0x8832f2);if(_0x423bb5[_0xbcc5('0x35')][_0xbcc5('0x41')]){_0x4b87aa[_0xbcc5('0x3f')]=_[_0xbcc5('0x42')](_0x4b87aa[_0xbcc5('0x3f')],{'$or':_[_0xbcc5('0x2f')](_0x8832f2,function(_0x2f42f3){if(_0x2f42f3[_0xbcc5('0x32')]!==_0xbcc5('0x43')){var _0x32e3de={};_0x32e3de[_0x2f42f3[_0xbcc5('0x2c')]]={'$like':'%'+_0x423bb5['query'][_0xbcc5('0x41')]+'%'};return _0x32e3de;}})});}_0x4b87aa=_[_0xbcc5('0x42')]({},_0x4b87aa,_0x423bb5[_0xbcc5('0x44')]);var _0x16363c={'where':_0x4b87aa['where']};return db['MailServerOut'][_0xbcc5('0x20')](_0x16363c)[_0xbcc5('0x27')](function(_0x495a4c){_0x17624a['count']=_0x495a4c;if(_0x423bb5[_0xbcc5('0x35')]['includeAll']){_0x4b87aa[_0xbcc5('0x45')]=[{'all':!![]}];}return db[_0xbcc5('0x46')][_0xbcc5('0x47')](_0x4b87aa);})[_0xbcc5('0x27')](function(_0x5dfabf){_0x17624a[_0xbcc5('0x48')]=_0x5dfabf;return _0x17624a;})[_0xbcc5('0x27')](respondWithFilteredResult(_0x3c6eee,_0x4b87aa))[_0xbcc5('0x49')](handleError(_0x3c6eee,null));};exports['show']=function(_0x1e7ef3,_0x167088){var _0x48abc9={'raw':!![],'where':{'id':_0x1e7ef3[_0xbcc5('0x4a')]['id']}},_0x37f314={};_0x37f314['model']=_['keys'](db[_0xbcc5('0x46')][_0xbcc5('0x30')]);_0x37f314[_0xbcc5('0x35')]=_[_0xbcc5('0x36')](_0x1e7ef3[_0xbcc5('0x35')]);_0x37f314['filters']=_[_0xbcc5('0x38')](_0x37f314[_0xbcc5('0x34')],_0x37f314[_0xbcc5('0x35')]);_0x48abc9[_0xbcc5('0x39')]=_['intersection'](_0x37f314[_0xbcc5('0x34')],qs[_0xbcc5('0x3a')](_0x1e7ef3[_0xbcc5('0x35')]['fields']));_0x48abc9[_0xbcc5('0x39')]=_0x48abc9[_0xbcc5('0x39')][_0xbcc5('0x4b')]?_0x48abc9[_0xbcc5('0x39')]:_0x37f314[_0xbcc5('0x34')];if(_0x1e7ef3[_0xbcc5('0x35')][_0xbcc5('0x4c')]){_0x48abc9[_0xbcc5('0x45')]=[{'all':!![]}];}_0x48abc9=_[_0xbcc5('0x42')]({},_0x48abc9,_0x1e7ef3[_0xbcc5('0x44')]);return db[_0xbcc5('0x46')][_0xbcc5('0x4d')](_0x48abc9)['then'](handleEntityNotFound(_0x167088,null))[_0xbcc5('0x27')](respondWithResult(_0x167088,null))[_0xbcc5('0x49')](handleError(_0x167088,null));};exports['create']=function(_0x1932c3,_0x1bf2ed){return db['MailServerOut']['create'](_0x1932c3['body'],{})[_0xbcc5('0x27')](respondWithResult(_0x1bf2ed,0xc9))[_0xbcc5('0x49')](handleError(_0x1bf2ed,null));};exports[_0xbcc5('0x26')]=function(_0x3fb0b1,_0xe1b06b){if(_0x3fb0b1[_0xbcc5('0x4e')]['id']){delete _0x3fb0b1[_0xbcc5('0x4e')]['id'];}return db[_0xbcc5('0x46')][_0xbcc5('0x4d')]({'where':{'id':_0x3fb0b1[_0xbcc5('0x4a')]['id']}})[_0xbcc5('0x27')](handleEntityNotFound(_0xe1b06b,null))[_0xbcc5('0x27')](saveUpdates(_0x3fb0b1[_0xbcc5('0x4e')],null))[_0xbcc5('0x27')](respondWithResult(_0xe1b06b,null))[_0xbcc5('0x49')](handleError(_0xe1b06b,null));};exports[_0xbcc5('0x28')]=function(_0x139954,_0x26aa84){return db[_0xbcc5('0x46')][_0xbcc5('0x4d')]({'where':{'id':_0x139954[_0xbcc5('0x4a')]['id']}})[_0xbcc5('0x27')](handleEntityNotFound(_0x26aa84,null))[_0xbcc5('0x27')](removeEntity(_0x26aa84,null))['catch'](handleError(_0x26aa84,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6dce186..9640e74 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 _0x1a09=['bluebird','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment'];(function(_0x2ddea8,_0x3d391a){var _0x3df821=function(_0x211b4c){while(--_0x211b4c){_0x2ddea8['push'](_0x2ddea8['shift']());}};_0x3df821(++_0x3d391a);}(_0x1a09,0xc2));var _0x91a0=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x1a09[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x91a0('0x0'));var util=require(_0x91a0('0x1'));var logger=require(_0x91a0('0x2'))('api');var moment=require(_0x91a0('0x3'));var BPromise=require(_0x91a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x91a0('0x5'));var config=require(_0x91a0('0x6'));var attributes=require(_0x91a0('0x7'));module['exports']=function(_0xf7a290,_0x1a5b62){return _0xf7a290[_0x91a0('0x8')](_0x91a0('0x9'),attributes,{'tableName':_0x91a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7a5=['define','mail_servers_out','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xf7a5,0x157));var _0x5f7a=function(_0x332d04,_0x969e42){_0x332d04=_0x332d04-0x0;var _0x1661f6=_0xf7a5[_0x332d04];return _0x1661f6;};'use strict';var _=require(_0x5f7a('0x0'));var util=require(_0x5f7a('0x1'));var logger=require('../../config/logger')(_0x5f7a('0x2'));var moment=require(_0x5f7a('0x3'));var BPromise=require(_0x5f7a('0x4'));var rp=require(_0x5f7a('0x5'));var fs=require('fs');var path=require(_0x5f7a('0x6'));var rimraf=require('rimraf');var config=require(_0x5f7a('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x5f7a('0x8')]=function(_0xfb9611,_0x247017){return _0xfb9611[_0x5f7a('0x9')]('MailServerOut',attributes,{'tableName':_0x5f7a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 07f2b16..3ba4f56 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0x2ef3,0xba));var _0x32ef=function(_0x3c692d,_0x3ed028){_0x3c692d=_0x3c692d-0x0;var _0x1b7d09=_0x2ef3[_0x3c692d];return _0x1b7d09;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x36400b,_0x9ad645){var _0x425f1f=function(_0x1fcfe7){while(--_0x1fcfe7){_0x36400b['push'](_0x36400b['shift']());}};_0x425f1f(++_0x9ad645);}(_0x1261,0x144));var _0x1126=function(_0x58a239,_0x4b5d29){_0x58a239=_0x58a239-0x0;var _0x3ba432=_0x1261[_0x58a239];return _0x3ba432;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ab2c815..dc3afef 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 _0x4f3b=['./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f95b5,_0x2f53e0){var _0x3770b9=function(_0x40d0fd){while(--_0x40d0fd){_0x2f95b5['push'](_0x2f95b5['shift']());}};_0x3770b9(++_0x2f53e0);}(_0x4f3b,0xf4));var _0xb4f3=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x4f3b[_0xc87d08];return _0x30a714;};'use strict';var multer=require(_0xb4f3('0x0'));var util=require('util');var path=require(_0xb4f3('0x1'));var timeout=require('connect-timeout');var express=require(_0xb4f3('0x2'));var router=express[_0xb4f3('0x3')]();var fs_extra=require(_0xb4f3('0x4'));var auth=require(_0xb4f3('0x5'));var interaction=require(_0xb4f3('0x6'));var config=require(_0xb4f3('0x7'));var controller=require(_0xb4f3('0x8'));router[_0xb4f3('0x9')]('/',auth[_0xb4f3('0xa')](),controller[_0xb4f3('0xb')]);router[_0xb4f3('0x9')](_0xb4f3('0xc'),auth['isAuthenticated'](),controller[_0xb4f3('0xd')]);router[_0xb4f3('0x9')](_0xb4f3('0xe'),auth[_0xb4f3('0xa')](),controller['show']);router['post']('/',auth[_0xb4f3('0xa')](),controller[_0xb4f3('0xf')]);router[_0xb4f3('0x10')](_0xb4f3('0xe'),auth[_0xb4f3('0xa')](),controller['update']);router[_0xb4f3('0x11')]('/:id',auth[_0xb4f3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9122=['../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53691d,_0x5d11a2){var _0x4849b0=function(_0x5b208c){while(--_0x5b208c){_0x53691d['push'](_0x53691d['shift']());}};_0x4849b0(++_0x5d11a2);}(_0x9122,0xfe));var _0x2912=function(_0x245262,_0x51e9c5){_0x245262=_0x245262-0x0;var _0x1236cd=_0x9122[_0x245262];return _0x1236cd;};'use strict';var multer=require(_0x2912('0x0'));var util=require(_0x2912('0x1'));var path=require('path');var timeout=require(_0x2912('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2912('0x3'));var auth=require(_0x2912('0x4'));var interaction=require(_0x2912('0x5'));var config=require(_0x2912('0x6'));var controller=require(_0x2912('0x7'));router['get']('/',auth[_0x2912('0x8')](),controller[_0x2912('0x9')]);router[_0x2912('0xa')](_0x2912('0xb'),auth[_0x2912('0x8')](),controller['describe']);router[_0x2912('0xa')](_0x2912('0xc'),auth[_0x2912('0x8')](),controller['show']);router[_0x2912('0xd')]('/',auth[_0x2912('0x8')](),controller[_0x2912('0xe')]);router[_0x2912('0xf')](_0x2912('0xc'),auth[_0x2912('0x8')](),controller[_0x2912('0x10')]);router[_0x2912('0x11')](_0x2912('0xc'),auth[_0x2912('0x8')](),controller[_0x2912('0x12')]);module[_0x2912('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index e9406c0..4010cae 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 _0x44e8=['name','STRING','sequelize'];(function(_0x2950c8,_0x5af4a0){var _0x5d00d3=function(_0xb02324){while(--_0xb02324){_0x2950c8['push'](_0x2950c8['shift']());}};_0x5d00d3(++_0x5af4a0);}(_0x44e8,0xd7));var _0x844e=function(_0x370bca,_0x2ba976){_0x370bca=_0x370bca-0x0;var _0x4daa59=_0x44e8[_0x370bca];return _0x4daa59;};'use strict';var Sequelize=require(_0x844e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x844e('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x844e('0x2')]}}; \ No newline at end of file +var _0x8375=['sequelize','exports','STRING'];(function(_0x56ec07,_0x56a55f){var _0x3ce6f7=function(_0x1915c6){while(--_0x1915c6){_0x56ec07['push'](_0x56ec07['shift']());}};_0x3ce6f7(++_0x56a55f);}(_0x8375,0xa8));var _0x5837=function(_0x471b43,_0x5f0aa3){_0x471b43=_0x471b43-0x0;var _0x5bc55c=_0x8375[_0x471b43];return _0x5bc55c;};'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 3454149..330fba3 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 _0x9fdd=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','keys','intersection','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x26e7d2,_0x59072){var _0x87b264=function(_0x257da1){while(--_0x257da1){_0x26e7d2['push'](_0x26e7d2['shift']());}};_0x87b264(++_0x59072);}(_0x9fdd,0x15c));var _0xd9fd=function(_0x3f40e6,_0x4c7df8){_0x3f40e6=_0x3f40e6-0x0;var _0x58df4f=_0x9fdd[_0x3f40e6];return _0x58df4f;};'use strict';var emlformat=require(_0xd9fd('0x0'));var rimraf=require(_0xd9fd('0x1'));var zipdir=require(_0xd9fd('0x2'));var jsonpatch=require(_0xd9fd('0x3'));var rp=require(_0xd9fd('0x4'));var moment=require(_0xd9fd('0x5'));var BPromise=require(_0xd9fd('0x6'));var Mustache=require(_0xd9fd('0x7'));var util=require(_0xd9fd('0x8'));var path=require('path');var sox=require(_0xd9fd('0x9'));var csv=require(_0xd9fd('0xa'));var ejs=require(_0xd9fd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9fd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9fd('0xd'));var toCsv=require(_0xd9fd('0xa'));var querystring=require('querystring');var Papa=require(_0xd9fd('0xe'));var Redis=require('ioredis');var authService=require(_0xd9fd('0xf'));var qs=require(_0xd9fd('0x10'));var as=require(_0xd9fd('0x11'));var hardwareService=require(_0xd9fd('0x12'));var logger=require(_0xd9fd('0x13'))('api');var utils=require(_0xd9fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd9fd('0x15'));var db=require(_0xd9fd('0x16'))['db'];function respondWithStatusCode(_0x2dda0a,_0x2b9086){_0x2b9086=_0x2b9086||0xcc;return function(_0xd377d2){if(_0xd377d2){return _0x2dda0a[_0xd9fd('0x17')](_0x2b9086);}return _0x2dda0a[_0xd9fd('0x18')](_0x2b9086)[_0xd9fd('0x19')]();};}function respondWithResult(_0x173d5a,_0x2f7b85){_0x2f7b85=_0x2f7b85||0xc8;return function(_0x42cd15){if(_0x42cd15){return _0x173d5a[_0xd9fd('0x18')](_0x2f7b85)['json'](_0x42cd15);}};}function respondWithFilteredResult(_0x564015,_0x3ce034){return function(_0x180d3c){if(_0x180d3c){var _0x4be8d1=typeof _0x3ce034[_0xd9fd('0x1a')]==='undefined'&&typeof _0x3ce034[_0xd9fd('0x1b')]===_0xd9fd('0x1c');var _0x40d1fe=_0x180d3c['count'];var _0x541ff4=_0x4be8d1?0x0:_0x3ce034[_0xd9fd('0x1a')];var _0x2f4366=_0x4be8d1?_0x180d3c[_0xd9fd('0x1d')]:_0x3ce034[_0xd9fd('0x1a')]+_0x3ce034[_0xd9fd('0x1b')];var _0x454044;if(_0x2f4366>=_0x40d1fe){_0x2f4366=_0x40d1fe;_0x454044=0xc8;}else{_0x454044=0xce;}_0x564015[_0xd9fd('0x18')](_0x454044);return _0x564015[_0xd9fd('0x1e')](_0xd9fd('0x1f'),_0x541ff4+'-'+_0x2f4366+'/'+_0x40d1fe)['json'](_0x180d3c);}return null;};}function patchUpdates(_0x4553d3){return function(_0x3d9ddc){try{jsonpatch[_0xd9fd('0x20')](_0x3d9ddc,_0x4553d3,!![]);}catch(_0x55551f){return BPromise['reject'](_0x55551f);}return _0x3d9ddc[_0xd9fd('0x21')]();};}function saveUpdates(_0x50c9e5,_0x2ea9ef){return function(_0x2ce741){if(_0x2ce741){return _0x2ce741[_0xd9fd('0x22')](_0x50c9e5)[_0xd9fd('0x23')](function(_0xd902f1){return _0xd902f1;});}return null;};}function removeEntity(_0x1ead67,_0x4a6e3b){return function(_0x52744e){if(_0x52744e){return _0x52744e[_0xd9fd('0x24')]()[_0xd9fd('0x23')](function(){_0x1ead67[_0xd9fd('0x18')](0xcc)[_0xd9fd('0x19')]();});}};}function handleEntityNotFound(_0x3b4f06,_0x1c7506){return function(_0x18e012){if(!_0x18e012){_0x3b4f06[_0xd9fd('0x17')](0x194);}return _0x18e012;};}function handleError(_0x24a8b9,_0x173c90){_0x173c90=_0x173c90||0x1f4;return function(_0x47c851){logger[_0xd9fd('0x25')](_0x47c851[_0xd9fd('0x26')]);if(_0x47c851[_0xd9fd('0x27')]){delete _0x47c851[_0xd9fd('0x27')];}_0x24a8b9[_0xd9fd('0x18')](_0x173c90)[_0xd9fd('0x28')](_0x47c851);};}exports[_0xd9fd('0x29')]=function(_0x222ed0,_0x394013){var _0x5dc23c={},_0x55d7f3={},_0x43f400={'count':0x0,'rows':[]};var _0x2dea57=_[_0xd9fd('0x2a')](db[_0xd9fd('0x2b')][_0xd9fd('0x2c')],function(_0x4614ed){return{'name':_0x4614ed[_0xd9fd('0x2d')],'type':_0x4614ed[_0xd9fd('0x2e')][_0xd9fd('0x2f')]};});_0x55d7f3[_0xd9fd('0x30')]=_[_0xd9fd('0x2a')](_0x2dea57,_0xd9fd('0x27'));_0x55d7f3['query']=_['keys'](_0x222ed0[_0xd9fd('0x31')]);_0x55d7f3[_0xd9fd('0x32')]=_['intersection'](_0x55d7f3['model'],_0x55d7f3[_0xd9fd('0x31')]);_0x5dc23c['attributes']=_['intersection'](_0x55d7f3['model'],qs[_0xd9fd('0x33')](_0x222ed0[_0xd9fd('0x31')]['fields']));_0x5dc23c[_0xd9fd('0x34')]=_0x5dc23c['attributes']['length']?_0x5dc23c[_0xd9fd('0x34')]:_0x55d7f3[_0xd9fd('0x30')];if(!_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x35')](_0xd9fd('0x36'))){_0x5dc23c['limit']=qs[_0xd9fd('0x1b')](_0x222ed0['query'][_0xd9fd('0x1b')]);_0x5dc23c[_0xd9fd('0x1a')]=qs[_0xd9fd('0x1a')](_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x1a')]);}_0x5dc23c['order']=qs[_0xd9fd('0x37')](_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x37')]);_0x5dc23c[_0xd9fd('0x38')]=qs['filters'](_['pick'](_0x222ed0['query'],_0x55d7f3[_0xd9fd('0x32')]),_0x2dea57);if(_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x39')]){_0x5dc23c[_0xd9fd('0x38')]=_[_0xd9fd('0x3a')](_0x5dc23c[_0xd9fd('0x38')],{'$or':_[_0xd9fd('0x2a')](_0x2dea57,function(_0x59aebd){if(_0x59aebd['type']!=='VIRTUAL'){var _0x5549b5={};_0x5549b5[_0x59aebd[_0xd9fd('0x27')]]={'$like':'%'+_0x222ed0['query'][_0xd9fd('0x39')]+'%'};return _0x5549b5;}})});}_0x5dc23c=_[_0xd9fd('0x3a')]({},_0x5dc23c,_0x222ed0[_0xd9fd('0x3b')]);var _0x2e5c09={'where':_0x5dc23c[_0xd9fd('0x38')]};return db[_0xd9fd('0x2b')]['count'](_0x2e5c09)[_0xd9fd('0x23')](function(_0x59802f){_0x43f400[_0xd9fd('0x1d')]=_0x59802f;if(_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x3c')]){_0x5dc23c['include']=[{'all':!![]}];}return db['MailSubstatus'][_0xd9fd('0x3d')](_0x5dc23c);})[_0xd9fd('0x23')](function(_0x386025){_0x43f400[_0xd9fd('0x3e')]=_0x386025;return _0x43f400;})[_0xd9fd('0x23')](respondWithFilteredResult(_0x394013,_0x5dc23c))[_0xd9fd('0x3f')](handleError(_0x394013,null));};exports[_0xd9fd('0x40')]=function(_0x275afe,_0x59922b){var _0x452e90={'raw':!![],'where':{'id':_0x275afe['params']['id']}},_0x397725={};_0x397725['model']=_[_0xd9fd('0x41')](db['MailSubstatus'][_0xd9fd('0x2c')]);_0x397725[_0xd9fd('0x31')]=_[_0xd9fd('0x41')](_0x275afe[_0xd9fd('0x31')]);_0x397725[_0xd9fd('0x32')]=_[_0xd9fd('0x42')](_0x397725[_0xd9fd('0x30')],_0x397725[_0xd9fd('0x31')]);_0x452e90[_0xd9fd('0x34')]=_[_0xd9fd('0x42')](_0x397725['model'],qs['fields'](_0x275afe['query'][_0xd9fd('0x33')]));_0x452e90[_0xd9fd('0x34')]=_0x452e90[_0xd9fd('0x34')][_0xd9fd('0x43')]?_0x452e90['attributes']:_0x397725[_0xd9fd('0x30')];if(_0x275afe[_0xd9fd('0x31')][_0xd9fd('0x3c')]){_0x452e90['include']=[{'all':!![]}];}_0x452e90=_[_0xd9fd('0x3a')]({},_0x452e90,_0x275afe[_0xd9fd('0x3b')]);return db[_0xd9fd('0x2b')][_0xd9fd('0x44')](_0x452e90)[_0xd9fd('0x23')](handleEntityNotFound(_0x59922b,null))['then'](respondWithResult(_0x59922b,null))['catch'](handleError(_0x59922b,null));};exports['create']=function(_0x976baf,_0x72bece){return db['MailSubstatus'][_0xd9fd('0x45')](_0x976baf[_0xd9fd('0x46')],{})[_0xd9fd('0x23')](respondWithResult(_0x72bece,0xc9))[_0xd9fd('0x3f')](handleError(_0x72bece,null));};exports[_0xd9fd('0x22')]=function(_0x2cf762,_0x342a4a){if(_0x2cf762[_0xd9fd('0x46')]['id']){delete _0x2cf762[_0xd9fd('0x46')]['id'];}return db[_0xd9fd('0x2b')][_0xd9fd('0x44')]({'where':{'id':_0x2cf762[_0xd9fd('0x47')]['id']}})[_0xd9fd('0x23')](handleEntityNotFound(_0x342a4a,null))[_0xd9fd('0x23')](saveUpdates(_0x2cf762[_0xd9fd('0x46')],null))[_0xd9fd('0x23')](respondWithResult(_0x342a4a,null))[_0xd9fd('0x3f')](handleError(_0x342a4a,null));};exports[_0xd9fd('0x24')]=function(_0x2ceec9,_0x1b7a58){return db['MailSubstatus'][_0xd9fd('0x44')]({'where':{'id':_0x2ceec9[_0xd9fd('0x47')]['id']}})[_0xd9fd('0x23')](handleEntityNotFound(_0x1b7a58,null))[_0xd9fd('0x23')](removeEntity(_0x1b7a58,null))[_0xd9fd('0x3f')](handleError(_0x1b7a58,null));};exports[_0xd9fd('0x48')]=function(_0x2cbc8e,_0x3474d4){return db[_0xd9fd('0x2b')][_0xd9fd('0x48')]()[_0xd9fd('0x23')](respondWithResult(_0x3474d4,null))[_0xd9fd('0x3f')](handleError(_0x3474d4,null));}; \ No newline at end of file +var _0xbc2b=['ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','nolimit','sort','where','pick','merge','filter','then','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbc2b,0xd7));var _0xbbc2=function(_0x3fd385,_0x45be97){_0x3fd385=_0x3fd385-0x0;var _0x16593d=_0xbc2b[_0x3fd385];return _0x16593d;};'use strict';var emlformat=require(_0xbbc2('0x0'));var rimraf=require(_0xbbc2('0x1'));var zipdir=require(_0xbbc2('0x2'));var jsonpatch=require(_0xbbc2('0x3'));var rp=require(_0xbbc2('0x4'));var moment=require(_0xbbc2('0x5'));var BPromise=require(_0xbbc2('0x6'));var Mustache=require(_0xbbc2('0x7'));var util=require(_0xbbc2('0x8'));var path=require(_0xbbc2('0x9'));var sox=require(_0xbbc2('0xa'));var csv=require(_0xbbc2('0xb'));var ejs=require(_0xbbc2('0xc'));var fs=require('fs');var fs_extra=require(_0xbbc2('0xd'));var _=require(_0xbbc2('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbbc2('0xf'));var deskjs=require(_0xbbc2('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbbc2('0x11'));var Papa=require(_0xbbc2('0x12'));var Redis=require(_0xbbc2('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbbc2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbbc2('0x15'));var utils=require(_0xbbc2('0x16'));var config=require(_0xbbc2('0x17'));var licenseUtil=require(_0xbbc2('0x18'));var db=require(_0xbbc2('0x19'))['db'];function respondWithStatusCode(_0x1708f7,_0x2e2d33){_0x2e2d33=_0x2e2d33||0xcc;return function(_0x216172){if(_0x216172){return _0x1708f7[_0xbbc2('0x1a')](_0x2e2d33);}return _0x1708f7[_0xbbc2('0x1b')](_0x2e2d33)[_0xbbc2('0x1c')]();};}function respondWithResult(_0x333dca,_0x24e3e0){_0x24e3e0=_0x24e3e0||0xc8;return function(_0x9d5a1d){if(_0x9d5a1d){return _0x333dca['status'](_0x24e3e0)[_0xbbc2('0x1d')](_0x9d5a1d);}};}function respondWithFilteredResult(_0x14ee8c,_0x26b935){return function(_0x24a065){if(_0x24a065){var _0x3be310=typeof _0x26b935['offset']===_0xbbc2('0x1e')&&typeof _0x26b935[_0xbbc2('0x1f')]===_0xbbc2('0x1e');var _0x4663d5=_0x24a065[_0xbbc2('0x20')];var _0x1198f2=_0x3be310?0x0:_0x26b935[_0xbbc2('0x21')];var _0x552b9d=_0x3be310?_0x24a065[_0xbbc2('0x20')]:_0x26b935[_0xbbc2('0x21')]+_0x26b935[_0xbbc2('0x1f')];var _0x46b490;if(_0x552b9d>=_0x4663d5){_0x552b9d=_0x4663d5;_0x46b490=0xc8;}else{_0x46b490=0xce;}_0x14ee8c[_0xbbc2('0x1b')](_0x46b490);return _0x14ee8c[_0xbbc2('0x22')](_0xbbc2('0x23'),_0x1198f2+'-'+_0x552b9d+'/'+_0x4663d5)[_0xbbc2('0x1d')](_0x24a065);}return null;};}function patchUpdates(_0x60f76f){return function(_0x33a567){try{jsonpatch[_0xbbc2('0x24')](_0x33a567,_0x60f76f,!![]);}catch(_0xbfd603){return BPromise[_0xbbc2('0x25')](_0xbfd603);}return _0x33a567[_0xbbc2('0x26')]();};}function saveUpdates(_0x3d94da,_0x39e8bc){return function(_0x206ce8){if(_0x206ce8){return _0x206ce8[_0xbbc2('0x27')](_0x3d94da)['then'](function(_0x2986b1){return _0x2986b1;});}return null;};}function removeEntity(_0x547859,_0x5365d5){return function(_0x20b73e){if(_0x20b73e){return _0x20b73e[_0xbbc2('0x28')]()['then'](function(){_0x547859[_0xbbc2('0x1b')](0xcc)[_0xbbc2('0x1c')]();});}};}function handleEntityNotFound(_0x341e89,_0x1999f2){return function(_0x12bfbb){if(!_0x12bfbb){_0x341e89['sendStatus'](0x194);}return _0x12bfbb;};}function handleError(_0x2f3d81,_0x37b8a2){_0x37b8a2=_0x37b8a2||0x1f4;return function(_0x1c16bc){logger[_0xbbc2('0x29')](_0x1c16bc[_0xbbc2('0x2a')]);if(_0x1c16bc['name']){delete _0x1c16bc[_0xbbc2('0x2b')];}_0x2f3d81[_0xbbc2('0x1b')](_0x37b8a2)[_0xbbc2('0x2c')](_0x1c16bc);};}exports[_0xbbc2('0x2d')]=function(_0x2b15d6,_0x3c4d6a){var _0x257e64={},_0x51a7b6={},_0x57d805={'count':0x0,'rows':[]};var _0x241f28=_['map'](db[_0xbbc2('0x2e')][_0xbbc2('0x2f')],function(_0x1228e4){return{'name':_0x1228e4['fieldName'],'type':_0x1228e4[_0xbbc2('0x30')][_0xbbc2('0x31')]};});_0x51a7b6[_0xbbc2('0x32')]=_[_0xbbc2('0x33')](_0x241f28,'name');_0x51a7b6['query']=_[_0xbbc2('0x34')](_0x2b15d6['query']);_0x51a7b6[_0xbbc2('0x35')]=_[_0xbbc2('0x36')](_0x51a7b6[_0xbbc2('0x32')],_0x51a7b6[_0xbbc2('0x37')]);_0x257e64[_0xbbc2('0x38')]=_[_0xbbc2('0x36')](_0x51a7b6[_0xbbc2('0x32')],qs[_0xbbc2('0x39')](_0x2b15d6[_0xbbc2('0x37')]['fields']));_0x257e64[_0xbbc2('0x38')]=_0x257e64['attributes']['length']?_0x257e64[_0xbbc2('0x38')]:_0x51a7b6[_0xbbc2('0x32')];if(!_0x2b15d6[_0xbbc2('0x37')]['hasOwnProperty'](_0xbbc2('0x3a'))){_0x257e64[_0xbbc2('0x1f')]=qs[_0xbbc2('0x1f')](_0x2b15d6[_0xbbc2('0x37')][_0xbbc2('0x1f')]);_0x257e64['offset']=qs[_0xbbc2('0x21')](_0x2b15d6[_0xbbc2('0x37')]['offset']);}_0x257e64['order']=qs['sort'](_0x2b15d6['query'][_0xbbc2('0x3b')]);_0x257e64[_0xbbc2('0x3c')]=qs[_0xbbc2('0x35')](_[_0xbbc2('0x3d')](_0x2b15d6['query'],_0x51a7b6['filters']),_0x241f28);if(_0x2b15d6[_0xbbc2('0x37')]['filter']){_0x257e64[_0xbbc2('0x3c')]=_[_0xbbc2('0x3e')](_0x257e64[_0xbbc2('0x3c')],{'$or':_[_0xbbc2('0x33')](_0x241f28,function(_0x1c8054){if(_0x1c8054[_0xbbc2('0x30')]!=='VIRTUAL'){var _0x33fe4a={};_0x33fe4a[_0x1c8054[_0xbbc2('0x2b')]]={'$like':'%'+_0x2b15d6[_0xbbc2('0x37')][_0xbbc2('0x3f')]+'%'};return _0x33fe4a;}})});}_0x257e64=_['merge']({},_0x257e64,_0x2b15d6['options']);var _0x168b94={'where':_0x257e64[_0xbbc2('0x3c')]};return db[_0xbbc2('0x2e')][_0xbbc2('0x20')](_0x168b94)[_0xbbc2('0x40')](function(_0x1321c9){_0x57d805[_0xbbc2('0x20')]=_0x1321c9;if(_0x2b15d6['query']['includeAll']){_0x257e64[_0xbbc2('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0xbbc2('0x42')](_0x257e64);})[_0xbbc2('0x40')](function(_0x54ce8c){_0x57d805[_0xbbc2('0x43')]=_0x54ce8c;return _0x57d805;})['then'](respondWithFilteredResult(_0x3c4d6a,_0x257e64))[_0xbbc2('0x44')](handleError(_0x3c4d6a,null));};exports[_0xbbc2('0x45')]=function(_0x7a669c,_0x3b0695){var _0x281564={'raw':!![],'where':{'id':_0x7a669c[_0xbbc2('0x46')]['id']}},_0x59d8b8={};_0x59d8b8[_0xbbc2('0x32')]=_[_0xbbc2('0x34')](db[_0xbbc2('0x2e')]['rawAttributes']);_0x59d8b8[_0xbbc2('0x37')]=_[_0xbbc2('0x34')](_0x7a669c[_0xbbc2('0x37')]);_0x59d8b8['filters']=_[_0xbbc2('0x36')](_0x59d8b8[_0xbbc2('0x32')],_0x59d8b8[_0xbbc2('0x37')]);_0x281564[_0xbbc2('0x38')]=_[_0xbbc2('0x36')](_0x59d8b8['model'],qs[_0xbbc2('0x39')](_0x7a669c[_0xbbc2('0x37')][_0xbbc2('0x39')]));_0x281564['attributes']=_0x281564[_0xbbc2('0x38')][_0xbbc2('0x47')]?_0x281564[_0xbbc2('0x38')]:_0x59d8b8['model'];if(_0x7a669c[_0xbbc2('0x37')][_0xbbc2('0x48')]){_0x281564[_0xbbc2('0x41')]=[{'all':!![]}];}_0x281564=_[_0xbbc2('0x3e')]({},_0x281564,_0x7a669c[_0xbbc2('0x49')]);return db[_0xbbc2('0x2e')][_0xbbc2('0x4a')](_0x281564)['then'](handleEntityNotFound(_0x3b0695,null))[_0xbbc2('0x40')](respondWithResult(_0x3b0695,null))['catch'](handleError(_0x3b0695,null));};exports[_0xbbc2('0x4b')]=function(_0xebdddc,_0x114456){return db[_0xbbc2('0x2e')][_0xbbc2('0x4b')](_0xebdddc[_0xbbc2('0x4c')],{})[_0xbbc2('0x40')](respondWithResult(_0x114456,0xc9))['catch'](handleError(_0x114456,null));};exports[_0xbbc2('0x27')]=function(_0x2c9abb,_0x516837){if(_0x2c9abb[_0xbbc2('0x4c')]['id']){delete _0x2c9abb[_0xbbc2('0x4c')]['id'];}return db['MailSubstatus'][_0xbbc2('0x4a')]({'where':{'id':_0x2c9abb['params']['id']}})[_0xbbc2('0x40')](handleEntityNotFound(_0x516837,null))[_0xbbc2('0x40')](saveUpdates(_0x2c9abb['body'],null))[_0xbbc2('0x40')](respondWithResult(_0x516837,null))[_0xbbc2('0x44')](handleError(_0x516837,null));};exports['destroy']=function(_0x11b720,_0xe82f9c){return db[_0xbbc2('0x2e')][_0xbbc2('0x4a')]({'where':{'id':_0x11b720[_0xbbc2('0x46')]['id']}})['then'](handleEntityNotFound(_0xe82f9c,null))[_0xbbc2('0x40')](removeEntity(_0xe82f9c,null))[_0xbbc2('0x44')](handleError(_0xe82f9c,null));};exports[_0xbbc2('0x4d')]=function(_0x10814a,_0xada14){return db[_0xbbc2('0x2e')][_0xbbc2('0x4d')]()[_0xbbc2('0x40')](respondWithResult(_0xada14,null))[_0xbbc2('0x44')](handleError(_0xada14,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 7e42f99..b51394b 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 _0x050c=['exports','events','../../mysqldb','MailSubstatus','update','emit'];(function(_0x44387c,_0xe02260){var _0x51f1a7=function(_0x5439ad){while(--_0x5439ad){_0x44387c['push'](_0x44387c['shift']());}};_0x51f1a7(++_0xe02260);}(_0x050c,0xdf));var _0xc050=function(_0x5d8f4b,_0x31e9a4){_0x5d8f4b=_0x5d8f4b-0x0;var _0x2efb10=_0x050c[_0x5d8f4b];return _0x2efb10;};'use strict';var EventEmitter=require(_0xc050('0x0'));var MailSubstatus=require(_0xc050('0x1'))['db'][_0xc050('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xc050('0x3')};function emitEvent(_0x37d2ed){return function(_0x1a06db,_0x21b581,_0x58ae2c){MailSubstatusEvents[_0xc050('0x4')](_0x37d2ed+':'+_0x1a06db['id'],_0x1a06db);MailSubstatusEvents['emit'](_0x37d2ed,_0x1a06db);_0x58ae2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xc050('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0xbb67=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b4ab2,_0x5eb1dd){var _0xd31bb9=function(_0x4a9a87){while(--_0x4a9a87){_0x4b4ab2['push'](_0x4b4ab2['shift']());}};_0xd31bb9(++_0x5eb1dd);}(_0xbb67,0x1c5));var _0x7bb6=function(_0x295556,_0xd4086b){_0x295556=_0x295556-0x0;var _0x6a3070=_0xbb67[_0x295556];return _0x6a3070;};'use strict';var EventEmitter=require(_0x7bb6('0x0'));var MailSubstatus=require(_0x7bb6('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x7bb6('0x2')};function emitEvent(_0xfc24a8){return function(_0x5d89a3,_0x38b6c7,_0x187ce8){MailSubstatusEvents[_0x7bb6('0x3')](_0xfc24a8+':'+_0x5d89a3['id'],_0x5d89a3);MailSubstatusEvents[_0x7bb6('0x3')](_0xfc24a8,_0x5d89a3);_0x187ce8(null);};}for(var e in events){if(events[_0x7bb6('0x4')](e)){var event=events[e];MailSubstatus[_0x7bb6('0x5')](e,emitEvent(event));}}module[_0x7bb6('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 1e8c31e..3856075 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 _0x1258=['define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','models'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x1258,0x196));var _0x8125=function(_0x1d785f,_0x7fcd6a){_0x1d785f=_0x1d785f-0x0;var _0x749ecf=_0x1258[_0x1d785f];return _0x749ecf;};'use strict';var attributes=require(_0x8125('0x0'));module['exports']=function(_0x3eb91d){var _0x3b4fa6=_0x3eb91d[_0x8125('0x1')];return _0x3eb91d[_0x8125('0x2')](_0x8125('0x3'),attributes,{'tableName':_0x8125('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x307c3b,_0xdaf434,_0x5577e5){return _0x3b4fa6[_0x8125('0x5')][_0x8125('0x6')]({'value':_0x307c3b[_0x8125('0x7')]},{'where':{'field':_0x8125('0x8'),'value':_0x307c3b[_0x8125('0x9')][_0x8125('0x7')]}})[_0x8125('0xa')](function(){_0x5577e5();})[_0x8125('0xb')](function(_0x1ff563){_0x5577e5(_0x1ff563);});}}});}; \ No newline at end of file +var _0xb838=['catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','name'];(function(_0x471645,_0x3ed174){var _0x2e8e28=function(_0x38eab3){while(--_0x38eab3){_0x471645['push'](_0x471645['shift']());}};_0x2e8e28(++_0x3ed174);}(_0xb838,0x14b));var _0x8b83=function(_0xf3b75,_0x32d575){_0xf3b75=_0xf3b75-0x0;var _0x357447=_0xb838[_0xf3b75];return _0x357447;};'use strict';var attributes=require(_0x8b83('0x0'));module[_0x8b83('0x1')]=function(_0x6371ac){var _0x1a832d=_0x6371ac[_0x8b83('0x2')];return _0x6371ac[_0x8b83('0x3')](_0x8b83('0x4'),attributes,{'tableName':_0x8b83('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x469d40,_0x1f685b,_0x886666){return _0x1a832d[_0x8b83('0x6')][_0x8b83('0x7')]({'value':_0x469d40['name']},{'where':{'field':_0x8b83('0x8'),'value':_0x469d40['_previousDataValues'][_0x8b83('0x9')]}})['then'](function(){_0x886666();})[_0x8b83('0xa')](function(_0x4a707e){_0x886666(_0x4a707e);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index beb6d6e..2d046b4 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 _0xe9a2=['request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x20dda3,_0xfcb775){var _0x547b71=function(_0x478410){while(--_0x478410){_0x20dda3['push'](_0x20dda3['shift']());}};_0x547b71(++_0xfcb775);}(_0xe9a2,0x71));var _0x2e9a=function(_0x296dd2,_0x2ab818){_0x296dd2=_0x296dd2-0x0;var _0x13142c=_0xe9a2[_0x296dd2];return _0x13142c;};'use strict';var _=require(_0x2e9a('0x0'));var util=require(_0x2e9a('0x1'));var moment=require(_0x2e9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e9a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e9a('0x4'));var logger=require('../../config/logger')(_0x2e9a('0x5'));var config=require(_0x2e9a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e9a('0x7')][_0x2e9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bdf65,_0x39aa91,_0x2a9275){return new BPromise(function(_0x2e7c1f,_0x2f1fa3){return client[_0x2e9a('0x9')](_0x4bdf65,_0x2a9275)[_0x2e9a('0xa')](function(_0x4b6906){logger[_0x2e9a('0xb')](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));logger[_0x2e9a('0xe')](_0x2e9a('0xf'),_0x39aa91,'request\x20sent',JSON[_0x2e9a('0x10')](_0x4b6906));if(_0x4b6906['error']){if(_0x4b6906[_0x2e9a('0x11')]['code']===0x1f4){logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2f1fa3(_0x4b6906['error'][_0x2e9a('0x12')]);}logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2e7c1f(_0x4b6906[_0x2e9a('0x11')][_0x2e9a('0x12')]);}else{logger['info'](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));_0x2e7c1f(_0x4b6906[_0x2e9a('0x13')][_0x2e9a('0x12')]);}})[_0x2e9a('0x14')](function(_0x35fe81){logger[_0x2e9a('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x39aa91,_0x35fe81);_0x2f1fa3(_0x35fe81);});});} \ No newline at end of file +var _0x023e=['util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','MailSubstatus,\x20%s,\x20%s','message','result','lodash'];(function(_0xbf8767,_0x46d83d){var _0x2cdddc=function(_0x5ed655){while(--_0x5ed655){_0xbf8767['push'](_0xbf8767['shift']());}};_0x2cdddc(++_0x46d83d);}(_0x023e,0x109));var _0xe023=function(_0x17996f,_0x49a4b0){_0x17996f=_0x17996f-0x0;var _0x374d99=_0x023e[_0x17996f];return _0x374d99;};'use strict';var _=require(_0xe023('0x0'));var util=require(_0xe023('0x1'));var moment=require(_0xe023('0x2'));var BPromise=require(_0xe023('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe023('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe023('0x5'))('rpc');var config=require(_0xe023('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe023('0x7')][_0xe023('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x397c0a,_0x195816,_0x56278e){return new BPromise(function(_0x51bf3d,_0x12b9bf){return client['request'](_0x397c0a,_0x56278e)[_0xe023('0x9')](function(_0x4d296d){logger[_0xe023('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x195816,_0xe023('0xb'));logger[_0xe023('0xc')](_0xe023('0xd'),_0x195816,_0xe023('0xb'),JSON['stringify'](_0x4d296d));if(_0x4d296d[_0xe023('0xe')]){if(_0x4d296d[_0xe023('0xe')][_0xe023('0xf')]===0x1f4){logger[_0xe023('0xe')](_0xe023('0x10'),_0x195816,_0x4d296d[_0xe023('0xe')][_0xe023('0x11')]);return _0x12b9bf(_0x4d296d[_0xe023('0xe')][_0xe023('0x11')]);}logger['error'](_0xe023('0x10'),_0x195816,_0x4d296d[_0xe023('0xe')][_0xe023('0x11')]);return _0x51bf3d(_0x4d296d[_0xe023('0xe')]['message']);}else{logger[_0xe023('0xa')](_0xe023('0x10'),_0x195816,_0xe023('0xb'));_0x51bf3d(_0x4d296d[_0xe023('0x12')][_0xe023('0x11')]);}})['catch'](function(_0x360d62){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x195816,_0x360d62);_0x12b9bf(_0x360d62);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index bba890e..b9d4b16 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 _0x6acb=['/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x6acb,0x17f));var _0xb6ac=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x6acb[_0x4ab3fb];return _0x34fe1e;};'use strict';var multer=require(_0xb6ac('0x0'));var util=require(_0xb6ac('0x1'));var path=require('path');var timeout=require(_0xb6ac('0x2'));var express=require(_0xb6ac('0x3'));var router=express[_0xb6ac('0x4')]();var fs_extra=require(_0xb6ac('0x5'));var auth=require(_0xb6ac('0x6'));var interaction=require(_0xb6ac('0x7'));var config=require(_0xb6ac('0x8'));var controller=require(_0xb6ac('0x9'));router[_0xb6ac('0xa')]('/',auth[_0xb6ac('0xb')](),controller[_0xb6ac('0xc')]);router[_0xb6ac('0xa')](_0xb6ac('0xd'),auth[_0xb6ac('0xb')](),controller[_0xb6ac('0xe')]);router[_0xb6ac('0xa')](_0xb6ac('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xb6ac('0x10')]('/',auth['isAuthenticated'](),controller[_0xb6ac('0x11')]);router[_0xb6ac('0x12')](_0xb6ac('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xb6ac('0x13')](_0xb6ac('0xf'),auth[_0xb6ac('0xb')](),controller[_0xb6ac('0x14')]);module[_0xb6ac('0x15')]=router; \ No newline at end of file +var _0x7693=['../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5bfda2,_0x1faa7a){var _0x15dd1b=function(_0x36a22a){while(--_0x36a22a){_0x5bfda2['push'](_0x5bfda2['shift']());}};_0x15dd1b(++_0x1faa7a);}(_0x7693,0x112));var _0x3769=function(_0x261de6,_0x166fa6){_0x261de6=_0x261de6-0x0;var _0x1d4251=_0x7693[_0x261de6];return _0x1d4251;};'use strict';var multer=require(_0x3769('0x0'));var util=require('util');var path=require(_0x3769('0x1'));var timeout=require(_0x3769('0x2'));var express=require(_0x3769('0x3'));var router=express[_0x3769('0x4')]();var fs_extra=require(_0x3769('0x5'));var auth=require(_0x3769('0x6'));var interaction=require(_0x3769('0x7'));var config=require('../../config/environment');var controller=require(_0x3769('0x8'));router['get']('/',auth[_0x3769('0x9')](),controller[_0x3769('0xa')]);router['get'](_0x3769('0xb'),auth[_0x3769('0x9')](),controller[_0x3769('0xc')]);router['get'](_0x3769('0xd'),auth[_0x3769('0x9')](),controller[_0x3769('0xe')]);router[_0x3769('0xf')]('/',auth[_0x3769('0x9')](),controller['create']);router[_0x3769('0x10')]('/:id',auth[_0x3769('0x9')](),controller[_0x3769('0x11')]);router['delete'](_0x3769('0xd'),auth[_0x3769('0x9')](),controller[_0x3769('0x12')]);module[_0x3769('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 8434f8b..bdfb918 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x125636,_0x4215c5){var _0x42fc39=function(_0x3d952a){while(--_0x3d952a){_0x125636['push'](_0x125636['shift']());}};_0x42fc39(++_0x4215c5);}(_0xedd9,0xfc));var _0x9edd=function(_0x22b0f7,_0x247a4d){_0x22b0f7=_0x22b0f7-0x0;var _0x5101e1=_0xedd9[_0x22b0f7];return _0x5101e1;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x527488,_0x4c1ffa){var _0x35d99a=function(_0xf8064c){while(--_0xf8064c){_0x527488['push'](_0x527488['shift']());}};_0x35d99a(++_0x4c1ffa);}(_0xedd9,0xfc));var _0x9edd=function(_0x3adf85,_0x430450){_0x3adf85=_0x3adf85-0x0;var _0x55da44=_0xedd9[_0x3adf85];return _0x55da44;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a7ce3f7..03c35c3 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 _0x921e=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x61032f,_0x24a6a4){var _0x9d3be9=function(_0x121a7f){while(--_0x121a7f){_0x61032f['push'](_0x61032f['shift']());}};_0x9d3be9(++_0x24a6a4);}(_0x921e,0x161));var _0xe921=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x921e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe921('0x0'));var rimraf=require(_0xe921('0x1'));var zipdir=require(_0xe921('0x2'));var jsonpatch=require(_0xe921('0x3'));var rp=require(_0xe921('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe921('0x5'));var util=require(_0xe921('0x6'));var path=require('path');var sox=require(_0xe921('0x7'));var csv=require(_0xe921('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe921('0x9'));var _=require(_0xe921('0xa'));var squel=require(_0xe921('0xb'));var crypto=require(_0xe921('0xc'));var jsforce=require(_0xe921('0xd'));var deskjs=require(_0xe921('0xe'));var toCsv=require(_0xe921('0x8'));var querystring=require(_0xe921('0xf'));var Papa=require(_0xe921('0x10'));var Redis=require('ioredis');var authService=require(_0xe921('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe921('0x12'));var logger=require('../../config/logger')(_0xe921('0x13'));var utils=require(_0xe921('0x14'));var config=require(_0xe921('0x15'));var licenseUtil=require(_0xe921('0x16'));var db=require(_0xe921('0x17'))['db'];function respondWithStatusCode(_0x17ff54,_0x4e4ebb){_0x4e4ebb=_0x4e4ebb||0xcc;return function(_0x3be8dc){if(_0x3be8dc){return _0x17ff54['sendStatus'](_0x4e4ebb);}return _0x17ff54[_0xe921('0x18')](_0x4e4ebb)[_0xe921('0x19')]();};}function respondWithResult(_0x58861f,_0x4f9648){_0x4f9648=_0x4f9648||0xc8;return function(_0x4430bc){if(_0x4430bc){return _0x58861f[_0xe921('0x18')](_0x4f9648)[_0xe921('0x1a')](_0x4430bc);}};}function respondWithFilteredResult(_0x2da7f8,_0x448268){return function(_0x313d94){if(_0x313d94){var _0x31c582=typeof _0x448268[_0xe921('0x1b')]===_0xe921('0x1c')&&typeof _0x448268[_0xe921('0x1d')]==='undefined';var _0x4e08ec=_0x313d94['count'];var _0x475eb1=_0x31c582?0x0:_0x448268[_0xe921('0x1b')];var _0x16f48c=_0x31c582?_0x313d94[_0xe921('0x1e')]:_0x448268[_0xe921('0x1b')]+_0x448268['limit'];var _0x542efb;if(_0x16f48c>=_0x4e08ec){_0x16f48c=_0x4e08ec;_0x542efb=0xc8;}else{_0x542efb=0xce;}_0x2da7f8[_0xe921('0x18')](_0x542efb);return _0x2da7f8[_0xe921('0x1f')]('Content-Range',_0x475eb1+'-'+_0x16f48c+'/'+_0x4e08ec)['json'](_0x313d94);}return null;};}function patchUpdates(_0x3716c9){return function(_0x4f0919){try{jsonpatch[_0xe921('0x20')](_0x4f0919,_0x3716c9,!![]);}catch(_0x460042){return BPromise['reject'](_0x460042);}return _0x4f0919[_0xe921('0x21')]();};}function saveUpdates(_0x1ace83,_0x184413){return function(_0x559e27){if(_0x559e27){return _0x559e27[_0xe921('0x22')](_0x1ace83)[_0xe921('0x23')](function(_0x385afc){return _0x385afc;});}return null;};}function removeEntity(_0x498c3e,_0x34a173){return function(_0x35d5e9){if(_0x35d5e9){return _0x35d5e9['destroy']()['then'](function(){_0x498c3e['status'](0xcc)[_0xe921('0x19')]();});}};}function handleEntityNotFound(_0x12d522,_0x26c88){return function(_0x63621b){if(!_0x63621b){_0x12d522[_0xe921('0x24')](0x194);}return _0x63621b;};}function handleError(_0x4cb185,_0x47bb93){_0x47bb93=_0x47bb93||0x1f4;return function(_0x3f46ed){logger['error'](_0x3f46ed[_0xe921('0x25')]);if(_0x3f46ed[_0xe921('0x26')]){delete _0x3f46ed[_0xe921('0x26')];}_0x4cb185[_0xe921('0x18')](_0x47bb93)[_0xe921('0x27')](_0x3f46ed);};}exports[_0xe921('0x28')]=function(_0x113fce,_0x582690){var _0x1496cc={},_0x46b242={},_0x38c978={'count':0x0,'rows':[]};var _0x23272f=_['map'](db[_0xe921('0x29')][_0xe921('0x2a')],function(_0x53a160){return{'name':_0x53a160[_0xe921('0x2b')],'type':_0x53a160[_0xe921('0x2c')][_0xe921('0x2d')]};});_0x46b242[_0xe921('0x2e')]=_[_0xe921('0x2f')](_0x23272f,_0xe921('0x26'));_0x46b242[_0xe921('0x30')]=_[_0xe921('0x31')](_0x113fce[_0xe921('0x30')]);_0x46b242[_0xe921('0x32')]=_[_0xe921('0x33')](_0x46b242[_0xe921('0x2e')],_0x46b242[_0xe921('0x30')]);_0x1496cc['attributes']=_[_0xe921('0x33')](_0x46b242[_0xe921('0x2e')],qs['fields'](_0x113fce['query'][_0xe921('0x34')]));_0x1496cc[_0xe921('0x35')]=_0x1496cc['attributes']['length']?_0x1496cc['attributes']:_0x46b242['model'];if(!_0x113fce[_0xe921('0x30')][_0xe921('0x36')](_0xe921('0x37'))){_0x1496cc[_0xe921('0x1d')]=qs[_0xe921('0x1d')](_0x113fce['query']['limit']);_0x1496cc[_0xe921('0x1b')]=qs[_0xe921('0x1b')](_0x113fce[_0xe921('0x30')][_0xe921('0x1b')]);}_0x1496cc[_0xe921('0x38')]=qs[_0xe921('0x39')](_0x113fce[_0xe921('0x30')][_0xe921('0x39')]);_0x1496cc[_0xe921('0x3a')]=qs[_0xe921('0x32')](_[_0xe921('0x3b')](_0x113fce[_0xe921('0x30')],_0x46b242[_0xe921('0x32')]),_0x23272f);if(_0x113fce[_0xe921('0x30')][_0xe921('0x3c')]){_0x1496cc['where']=_[_0xe921('0x3d')](_0x1496cc['where'],{'$or':_[_0xe921('0x2f')](_0x23272f,function(_0x22ad65){if(_0x22ad65['type']!==_0xe921('0x3e')){var _0x20c3d1={};_0x20c3d1[_0x22ad65[_0xe921('0x26')]]={'$like':'%'+_0x113fce[_0xe921('0x30')][_0xe921('0x3c')]+'%'};return _0x20c3d1;}})});}_0x1496cc=_['merge']({},_0x1496cc,_0x113fce[_0xe921('0x3f')]);var _0x3b77d3={'where':_0x1496cc['where']};return db[_0xe921('0x29')][_0xe921('0x1e')](_0x3b77d3)[_0xe921('0x23')](function(_0x3c3a11){_0x38c978[_0xe921('0x1e')]=_0x3c3a11;if(_0x113fce['query'][_0xe921('0x40')]){_0x1496cc[_0xe921('0x41')]=[{'all':!![]}];}return db['MailTransferReport'][_0xe921('0x42')](_0x1496cc);})[_0xe921('0x23')](function(_0x334c53){_0x38c978[_0xe921('0x43')]=_0x334c53;return _0x38c978;})['then'](respondWithFilteredResult(_0x582690,_0x1496cc))['catch'](handleError(_0x582690,null));};exports['show']=function(_0x547123,_0xd57c2f){var _0x119499={'raw':!![],'where':{'id':_0x547123[_0xe921('0x44')]['id']}},_0x419e5b={};_0x419e5b['model']=_['keys'](db['MailTransferReport'][_0xe921('0x2a')]);_0x419e5b[_0xe921('0x30')]=_[_0xe921('0x31')](_0x547123[_0xe921('0x30')]);_0x419e5b[_0xe921('0x32')]=_[_0xe921('0x33')](_0x419e5b[_0xe921('0x2e')],_0x419e5b[_0xe921('0x30')]);_0x119499[_0xe921('0x35')]=_[_0xe921('0x33')](_0x419e5b[_0xe921('0x2e')],qs[_0xe921('0x34')](_0x547123['query']['fields']));_0x119499[_0xe921('0x35')]=_0x119499['attributes']['length']?_0x119499[_0xe921('0x35')]:_0x419e5b[_0xe921('0x2e')];if(_0x547123['query'][_0xe921('0x40')]){_0x119499['include']=[{'all':!![]}];}_0x119499=_[_0xe921('0x3d')]({},_0x119499,_0x547123[_0xe921('0x3f')]);return db[_0xe921('0x29')][_0xe921('0x45')](_0x119499)[_0xe921('0x23')](handleEntityNotFound(_0xd57c2f,null))['then'](respondWithResult(_0xd57c2f,null))[_0xe921('0x46')](handleError(_0xd57c2f,null));};exports['create']=function(_0x3b84a0,_0x51eebc){return db['MailTransferReport'][_0xe921('0x47')](_0x3b84a0['body'],{})[_0xe921('0x23')](respondWithResult(_0x51eebc,0xc9))['catch'](handleError(_0x51eebc,null));};exports['update']=function(_0xcf8da2,_0x33430b){if(_0xcf8da2[_0xe921('0x48')]['id']){delete _0xcf8da2[_0xe921('0x48')]['id'];}return db[_0xe921('0x29')]['find']({'where':{'id':_0xcf8da2[_0xe921('0x44')]['id']}})[_0xe921('0x23')](handleEntityNotFound(_0x33430b,null))['then'](saveUpdates(_0xcf8da2[_0xe921('0x48')],null))[_0xe921('0x23')](respondWithResult(_0x33430b,null))[_0xe921('0x46')](handleError(_0x33430b,null));};exports[_0xe921('0x49')]=function(_0x42eff7,_0x3c7ef8){return db[_0xe921('0x29')][_0xe921('0x45')]({'where':{'id':_0x42eff7[_0xe921('0x44')]['id']}})[_0xe921('0x23')](handleEntityNotFound(_0x3c7ef8,null))['then'](removeEntity(_0x3c7ef8,null))[_0xe921('0x46')](handleError(_0x3c7ef8,null));};exports[_0xe921('0x4a')]=function(_0x3be781,_0x5e7528){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x5e7528,null))[_0xe921('0x46')](handleError(_0x5e7528,null));}; \ No newline at end of file +var _0x6f2b=['keys','include','options','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','save','destroy','then','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show'];(function(_0x1edc06,_0x21290b){var _0x2e3c36=function(_0xc7bcf1){while(--_0xc7bcf1){_0x1edc06['push'](_0x1edc06['shift']());}};_0x2e3c36(++_0x21290b);}(_0x6f2b,0xa7));var _0xb6f2=function(_0x1b6662,_0x3174b7){_0x1b6662=_0x1b6662-0x0;var _0x177d36=_0x6f2b[_0x1b6662];return _0x177d36;};'use strict';var emlformat=require(_0xb6f2('0x0'));var rimraf=require(_0xb6f2('0x1'));var zipdir=require(_0xb6f2('0x2'));var jsonpatch=require(_0xb6f2('0x3'));var rp=require(_0xb6f2('0x4'));var moment=require(_0xb6f2('0x5'));var BPromise=require(_0xb6f2('0x6'));var Mustache=require(_0xb6f2('0x7'));var util=require(_0xb6f2('0x8'));var path=require(_0xb6f2('0x9'));var sox=require(_0xb6f2('0xa'));var csv=require(_0xb6f2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb6f2('0xc'));var crypto=require('crypto');var jsforce=require(_0xb6f2('0xd'));var deskjs=require(_0xb6f2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb6f2('0xf'));var Papa=require(_0xb6f2('0x10'));var Redis=require(_0xb6f2('0x11'));var authService=require(_0xb6f2('0x12'));var qs=require(_0xb6f2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6f2('0x14'));var logger=require(_0xb6f2('0x15'))(_0xb6f2('0x16'));var utils=require(_0xb6f2('0x17'));var config=require(_0xb6f2('0x18'));var licenseUtil=require(_0xb6f2('0x19'));var db=require(_0xb6f2('0x1a'))['db'];function respondWithStatusCode(_0x3a1979,_0x5d259){_0x5d259=_0x5d259||0xcc;return function(_0x1d0ac8){if(_0x1d0ac8){return _0x3a1979[_0xb6f2('0x1b')](_0x5d259);}return _0x3a1979[_0xb6f2('0x1c')](_0x5d259)[_0xb6f2('0x1d')]();};}function respondWithResult(_0x324e1d,_0x4975c3){_0x4975c3=_0x4975c3||0xc8;return function(_0x67599c){if(_0x67599c){return _0x324e1d['status'](_0x4975c3)['json'](_0x67599c);}};}function respondWithFilteredResult(_0x45aff0,_0x58a661){return function(_0x32c4fe){if(_0x32c4fe){var _0x5c392c=typeof _0x58a661[_0xb6f2('0x1e')]===_0xb6f2('0x1f')&&typeof _0x58a661['limit']==='undefined';var _0x290b16=_0x32c4fe['count'];var _0x2df3c7=_0x5c392c?0x0:_0x58a661[_0xb6f2('0x1e')];var _0x325c40=_0x5c392c?_0x32c4fe[_0xb6f2('0x20')]:_0x58a661['offset']+_0x58a661[_0xb6f2('0x21')];var _0xa00bf7;if(_0x325c40>=_0x290b16){_0x325c40=_0x290b16;_0xa00bf7=0xc8;}else{_0xa00bf7=0xce;}_0x45aff0[_0xb6f2('0x1c')](_0xa00bf7);return _0x45aff0[_0xb6f2('0x22')](_0xb6f2('0x23'),_0x2df3c7+'-'+_0x325c40+'/'+_0x290b16)[_0xb6f2('0x24')](_0x32c4fe);}return null;};}function patchUpdates(_0x42848c){return function(_0x21a262){try{jsonpatch['apply'](_0x21a262,_0x42848c,!![]);}catch(_0x34defa){return BPromise['reject'](_0x34defa);}return _0x21a262[_0xb6f2('0x25')]();};}function saveUpdates(_0x33b38b,_0x4d479e){return function(_0x3dde9f){if(_0x3dde9f){return _0x3dde9f['update'](_0x33b38b)['then'](function(_0x2edc12){return _0x2edc12;});}return null;};}function removeEntity(_0x1bc66c,_0xb2327e){return function(_0x25a398){if(_0x25a398){return _0x25a398[_0xb6f2('0x26')]()[_0xb6f2('0x27')](function(){_0x1bc66c[_0xb6f2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35e18b,_0x321504){return function(_0x23ad5e){if(!_0x23ad5e){_0x35e18b[_0xb6f2('0x1b')](0x194);}return _0x23ad5e;};}function handleError(_0x356a53,_0x37c3c2){_0x37c3c2=_0x37c3c2||0x1f4;return function(_0x9c857f){logger[_0xb6f2('0x28')](_0x9c857f['stack']);if(_0x9c857f[_0xb6f2('0x29')]){delete _0x9c857f['name'];}_0x356a53['status'](_0x37c3c2)[_0xb6f2('0x2a')](_0x9c857f);};}exports[_0xb6f2('0x2b')]=function(_0x56e9e5,_0x3706fa){var _0xb075fb={},_0x130731={},_0x3f9e78={'count':0x0,'rows':[]};var _0x539021=_[_0xb6f2('0x2c')](db[_0xb6f2('0x2d')][_0xb6f2('0x2e')],function(_0x3c5fa3){return{'name':_0x3c5fa3[_0xb6f2('0x2f')],'type':_0x3c5fa3['type'][_0xb6f2('0x30')]};});_0x130731['model']=_[_0xb6f2('0x2c')](_0x539021,_0xb6f2('0x29'));_0x130731[_0xb6f2('0x31')]=_['keys'](_0x56e9e5[_0xb6f2('0x31')]);_0x130731[_0xb6f2('0x32')]=_[_0xb6f2('0x33')](_0x130731[_0xb6f2('0x34')],_0x130731[_0xb6f2('0x31')]);_0xb075fb[_0xb6f2('0x35')]=_[_0xb6f2('0x33')](_0x130731[_0xb6f2('0x34')],qs[_0xb6f2('0x36')](_0x56e9e5[_0xb6f2('0x31')][_0xb6f2('0x36')]));_0xb075fb['attributes']=_0xb075fb[_0xb6f2('0x35')][_0xb6f2('0x37')]?_0xb075fb[_0xb6f2('0x35')]:_0x130731[_0xb6f2('0x34')];if(!_0x56e9e5[_0xb6f2('0x31')][_0xb6f2('0x38')](_0xb6f2('0x39'))){_0xb075fb['limit']=qs[_0xb6f2('0x21')](_0x56e9e5[_0xb6f2('0x31')][_0xb6f2('0x21')]);_0xb075fb[_0xb6f2('0x1e')]=qs[_0xb6f2('0x1e')](_0x56e9e5[_0xb6f2('0x31')][_0xb6f2('0x1e')]);}_0xb075fb[_0xb6f2('0x3a')]=qs[_0xb6f2('0x3b')](_0x56e9e5[_0xb6f2('0x31')][_0xb6f2('0x3b')]);_0xb075fb[_0xb6f2('0x3c')]=qs[_0xb6f2('0x32')](_[_0xb6f2('0x3d')](_0x56e9e5[_0xb6f2('0x31')],_0x130731['filters']),_0x539021);if(_0x56e9e5[_0xb6f2('0x31')]['filter']){_0xb075fb[_0xb6f2('0x3c')]=_[_0xb6f2('0x3e')](_0xb075fb[_0xb6f2('0x3c')],{'$or':_[_0xb6f2('0x2c')](_0x539021,function(_0x1ca54f){if(_0x1ca54f['type']!==_0xb6f2('0x3f')){var _0x2da263={};_0x2da263[_0x1ca54f['name']]={'$like':'%'+_0x56e9e5['query'][_0xb6f2('0x40')]+'%'};return _0x2da263;}})});}_0xb075fb=_[_0xb6f2('0x3e')]({},_0xb075fb,_0x56e9e5['options']);var _0x5f1420={'where':_0xb075fb['where']};return db['MailTransferReport'][_0xb6f2('0x20')](_0x5f1420)['then'](function(_0x40dfc1){_0x3f9e78[_0xb6f2('0x20')]=_0x40dfc1;if(_0x56e9e5[_0xb6f2('0x31')][_0xb6f2('0x41')]){_0xb075fb['include']=[{'all':!![]}];}return db['MailTransferReport'][_0xb6f2('0x42')](_0xb075fb);})[_0xb6f2('0x27')](function(_0x1750a0){_0x3f9e78[_0xb6f2('0x43')]=_0x1750a0;return _0x3f9e78;})[_0xb6f2('0x27')](respondWithFilteredResult(_0x3706fa,_0xb075fb))[_0xb6f2('0x44')](handleError(_0x3706fa,null));};exports[_0xb6f2('0x45')]=function(_0x65bc03,_0x19f66f){var _0x3752d5={'raw':!![],'where':{'id':_0x65bc03['params']['id']}},_0x1b3321={};_0x1b3321[_0xb6f2('0x34')]=_[_0xb6f2('0x46')](db[_0xb6f2('0x2d')]['rawAttributes']);_0x1b3321['query']=_[_0xb6f2('0x46')](_0x65bc03[_0xb6f2('0x31')]);_0x1b3321['filters']=_[_0xb6f2('0x33')](_0x1b3321[_0xb6f2('0x34')],_0x1b3321[_0xb6f2('0x31')]);_0x3752d5[_0xb6f2('0x35')]=_[_0xb6f2('0x33')](_0x1b3321[_0xb6f2('0x34')],qs[_0xb6f2('0x36')](_0x65bc03['query'][_0xb6f2('0x36')]));_0x3752d5[_0xb6f2('0x35')]=_0x3752d5[_0xb6f2('0x35')][_0xb6f2('0x37')]?_0x3752d5[_0xb6f2('0x35')]:_0x1b3321[_0xb6f2('0x34')];if(_0x65bc03[_0xb6f2('0x31')][_0xb6f2('0x41')]){_0x3752d5[_0xb6f2('0x47')]=[{'all':!![]}];}_0x3752d5=_[_0xb6f2('0x3e')]({},_0x3752d5,_0x65bc03[_0xb6f2('0x48')]);return db[_0xb6f2('0x2d')]['find'](_0x3752d5)[_0xb6f2('0x27')](handleEntityNotFound(_0x19f66f,null))[_0xb6f2('0x27')](respondWithResult(_0x19f66f,null))[_0xb6f2('0x44')](handleError(_0x19f66f,null));};exports[_0xb6f2('0x49')]=function(_0x1c7b7d,_0x5ca1fa){return db[_0xb6f2('0x2d')][_0xb6f2('0x49')](_0x1c7b7d[_0xb6f2('0x4a')],{})['then'](respondWithResult(_0x5ca1fa,0xc9))[_0xb6f2('0x44')](handleError(_0x5ca1fa,null));};exports[_0xb6f2('0x4b')]=function(_0x1ae620,_0x248ed8){if(_0x1ae620[_0xb6f2('0x4a')]['id']){delete _0x1ae620[_0xb6f2('0x4a')]['id'];}return db['MailTransferReport'][_0xb6f2('0x4c')]({'where':{'id':_0x1ae620['params']['id']}})['then'](handleEntityNotFound(_0x248ed8,null))[_0xb6f2('0x27')](saveUpdates(_0x1ae620[_0xb6f2('0x4a')],null))[_0xb6f2('0x27')](respondWithResult(_0x248ed8,null))[_0xb6f2('0x44')](handleError(_0x248ed8,null));};exports['destroy']=function(_0xde000e,_0x339964){return db[_0xb6f2('0x2d')][_0xb6f2('0x4c')]({'where':{'id':_0xde000e[_0xb6f2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x339964,null))[_0xb6f2('0x27')](removeEntity(_0x339964,null))[_0xb6f2('0x44')](handleError(_0x339964,null));};exports[_0xb6f2('0x4e')]=function(_0x330de8,_0x4dcdd9){return db[_0xb6f2('0x2d')][_0xb6f2('0x4e')]()['then'](respondWithResult(_0x4dcdd9,null))[_0xb6f2('0x44')](handleError(_0x4dcdd9,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c54fb73..554d05e 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 _0x6113=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','report_mail_transfer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6113,0x1c8));var _0x3611=function(_0x2bd1aa,_0x2077aa){_0x2bd1aa=_0x2bd1aa-0x0;var _0x4bf239=_0x6113[_0x2bd1aa];return _0x4bf239;};'use strict';var _=require(_0x3611('0x0'));var util=require(_0x3611('0x1'));var logger=require(_0x3611('0x2'))('api');var moment=require(_0x3611('0x3'));var BPromise=require(_0x3611('0x4'));var rp=require(_0x3611('0x5'));var fs=require('fs');var path=require(_0x3611('0x6'));var rimraf=require(_0x3611('0x7'));var config=require(_0x3611('0x8'));var attributes=require(_0x3611('0x9'));module['exports']=function(_0x377654,_0x18306f){return _0x377654[_0x3611('0xa')]('MailTransferReport',attributes,{'tableName':_0x3611('0xb'),'paranoid':![],'indexes':[{'name':_0x3611('0xc'),'fields':[_0x3611('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x975f=['uniqueid','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport'];(function(_0xab45fd,_0x6f8c32){var _0x1f6b61=function(_0x4747c4){while(--_0x4747c4){_0xab45fd['push'](_0xab45fd['shift']());}};_0x1f6b61(++_0x6f8c32);}(_0x975f,0x109));var _0xf975=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x975f[_0x56f7e2];return _0x36240b;};'use strict';var _=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf975('0x2'));var BPromise=require(_0xf975('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf975('0x4'));var rimraf=require(_0xf975('0x5'));var config=require(_0xf975('0x6'));var attributes=require(_0xf975('0x7'));module['exports']=function(_0x356f71,_0x5a9aca){return _0x356f71[_0xf975('0x8')](_0xf975('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xf975('0xa'),'fields':[_0xf975('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index d2a9452..4f27eaf 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 _0x79f6=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0xfb3b3,_0x10db7a){var _0x36cae7=function(_0x183814){while(--_0x183814){_0xfb3b3['push'](_0xfb3b3['shift']());}};_0x36cae7(++_0x10db7a);}(_0x79f6,0x98));var _0x679f=function(_0xd72f9,_0x6de4cd){_0xd72f9=_0xd72f9-0x0;var _0x1d5b47=_0x79f6[_0xd72f9];return _0x1d5b47;};'use strict';var _=require(_0x679f('0x0'));var util=require(_0x679f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x679f('0x2'));var fs=require('fs');var Redis=require(_0x679f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x679f('0x4'));var logger=require(_0x679f('0x5'))(_0x679f('0x6'));var config=require('../../config/environment');var jayson=require(_0x679f('0x7'));var client=jayson[_0x679f('0x8')][_0x679f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bb2a3,_0x2b8fab,_0x2e6514){return new BPromise(function(_0xeb5dd0,_0x9779b2){return client['request'](_0x3bb2a3,_0x2e6514)[_0x679f('0xa')](function(_0x38c563){logger[_0x679f('0xb')](_0x679f('0xc'),_0x2b8fab,_0x679f('0xd'));logger[_0x679f('0xe')](_0x679f('0xf'),_0x2b8fab,'request\x20sent',JSON[_0x679f('0x10')](_0x38c563));if(_0x38c563[_0x679f('0x11')]){if(_0x38c563['error'][_0x679f('0x12')]===0x1f4){logger[_0x679f('0x11')](_0x679f('0xc'),_0x2b8fab,_0x38c563[_0x679f('0x11')]['message']);return _0x9779b2(_0x38c563[_0x679f('0x11')][_0x679f('0x13')]);}logger[_0x679f('0x11')](_0x679f('0xc'),_0x2b8fab,_0x38c563[_0x679f('0x11')]['message']);return _0xeb5dd0(_0x38c563[_0x679f('0x11')]['message']);}else{logger[_0x679f('0xb')](_0x679f('0xc'),_0x2b8fab,'request\x20sent');_0xeb5dd0(_0x38c563[_0x679f('0x14')][_0x679f('0x13')]);}})[_0x679f('0x15')](function(_0x13ca3b){logger[_0x679f('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2b8fab,_0x13ca3b);_0x9779b2(_0x13ca3b);});});} \ No newline at end of file +var _0x4227=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','then','info'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x4227,0x171));var _0x7422=function(_0x3f8326,_0x327e75){_0x3f8326=_0x3f8326-0x0;var _0x2c3835=_0x4227[_0x3f8326];return _0x2c3835;};'use strict';var _=require('lodash');var util=require(_0x7422('0x0'));var moment=require(_0x7422('0x1'));var BPromise=require(_0x7422('0x2'));var rs=require(_0x7422('0x3'));var fs=require('fs');var Redis=require(_0x7422('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7422('0x5'));var logger=require('../../config/logger')(_0x7422('0x6'));var config=require('../../config/environment');var jayson=require(_0x7422('0x7'));var client=jayson['client'][_0x7422('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29d67f,_0x19a388,_0x507e43){return new BPromise(function(_0x51b8bc,_0x362f41){return client['request'](_0x29d67f,_0x507e43)[_0x7422('0x9')](function(_0x18f374){logger[_0x7422('0xa')](_0x7422('0xb'),_0x19a388,_0x7422('0xc'));logger[_0x7422('0xd')](_0x7422('0xe'),_0x19a388,_0x7422('0xc'),JSON[_0x7422('0xf')](_0x18f374));if(_0x18f374[_0x7422('0x10')]){if(_0x18f374[_0x7422('0x10')][_0x7422('0x11')]===0x1f4){logger[_0x7422('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x19a388,_0x18f374['error']['message']);return _0x362f41(_0x18f374[_0x7422('0x10')][_0x7422('0x12')]);}logger[_0x7422('0x10')](_0x7422('0xb'),_0x19a388,_0x18f374[_0x7422('0x10')]['message']);return _0x51b8bc(_0x18f374['error'][_0x7422('0x12')]);}else{logger[_0x7422('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x19a388,_0x7422('0xc'));_0x51b8bc(_0x18f374[_0x7422('0x13')][_0x7422('0x12')]);}})['catch'](function(_0x57f892){logger['error'](_0x7422('0xb'),_0x19a388,_0x57f892);_0x362f41(_0x57f892);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 1bf8c2d..4a4320d 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 _0x4a76=['get','/describe','describe','isAuthenticated','show','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0x521b96,_0x3446c9){var _0x1c0b54=function(_0x4dfbf6){while(--_0x4dfbf6){_0x521b96['push'](_0x521b96['shift']());}};_0x1c0b54(++_0x3446c9);}(_0x4a76,0x87));var _0x64a7=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4a76[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x64a7('0x0'));var util=require(_0x64a7('0x1'));var path=require(_0x64a7('0x2'));var timeout=require(_0x64a7('0x3'));var express=require(_0x64a7('0x4'));var router=express['Router']();var fs_extra=require(_0x64a7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x64a7('0x6'));var config=require(_0x64a7('0x7'));var controller=require(_0x64a7('0x8'));router[_0x64a7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x64a7('0xa'),auth['isAuthenticated'](),controller[_0x64a7('0xb')]);router[_0x64a7('0x9')]('/:id',auth[_0x64a7('0xc')](),controller[_0x64a7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x64a7('0xe')](_0x64a7('0xf'),auth[_0x64a7('0xc')](),controller['update']);router[_0x64a7('0x10')](_0x64a7('0xf'),auth[_0x64a7('0xc')](),controller[_0x64a7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3c61=['get','/describe','isAuthenticated','/:id','show','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x365cb1,_0x276c2c){var _0xfea71=function(_0x2b4bf8){while(--_0x2b4bf8){_0x365cb1['push'](_0x365cb1['shift']());}};_0xfea71(++_0x276c2c);}(_0x3c61,0x1a7));var _0x13c6=function(_0x57b31e,_0x5e8789){_0x57b31e=_0x57b31e-0x0;var _0x5ef8f5=_0x3c61[_0x57b31e];return _0x5ef8f5;};'use strict';var multer=require(_0x13c6('0x0'));var util=require(_0x13c6('0x1'));var path=require('path');var timeout=require(_0x13c6('0x2'));var express=require(_0x13c6('0x3'));var router=express[_0x13c6('0x4')]();var fs_extra=require(_0x13c6('0x5'));var auth=require(_0x13c6('0x6'));var interaction=require(_0x13c6('0x7'));var config=require(_0x13c6('0x8'));var controller=require('./memberReport.controller');router[_0x13c6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x13c6('0xa'),auth[_0x13c6('0xb')](),controller['describe']);router[_0x13c6('0x9')](_0x13c6('0xc'),auth[_0x13c6('0xb')](),controller[_0x13c6('0xd')]);router['post']('/',auth[_0x13c6('0xb')](),controller['create']);router[_0x13c6('0xe')](_0x13c6('0xc'),auth[_0x13c6('0xb')](),controller[_0x13c6('0xf')]);router[_0x13c6('0x10')](_0x13c6('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x13c6('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 0195514..310d711 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 _0x9c6f=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x9c6f,0x130));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf9c6('0x0'));var moment=require(_0xf9c6('0x1'));module[_0xf9c6('0x2')]={'channel':{'type':Sequelize[_0xf9c6('0x3')]},'membername':{'type':Sequelize[_0xf9c6('0x3')]},'interface':{'type':Sequelize[_0xf9c6('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xf9c6('0x4'),'comment':_0xf9c6('0x5')},'duration':{'type':Sequelize[_0xf9c6('0x6')]},'enterAt':{'type':Sequelize[_0xf9c6('0x7')]},'exitAt':{'type':Sequelize[_0xf9c6('0x7')],'set':function(_0x63297c){var _0x1c1b40=moment(_0x63297c);var _0x2afb80=moment(this[_0xf9c6('0x8')](_0xf9c6('0x9')));var _0x7fcf05=_0x1c1b40[_0xf9c6('0xa')](_0x2afb80,_0xf9c6('0xb'));this['setDataValue'](_0xf9c6('0xc'),_0x63297c);this['setDataValue']('duration',_0x7fcf05>=0x0?_0x7fcf05:null);}},'data1':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0xd')},'data2':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0xe')},'data3':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0xf')},'data4':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0x10')},'data5':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0x11')},'role':{'type':Sequelize[_0xf9c6('0x3')]},'internal':{'type':Sequelize[_0xf9c6('0x6')]},'uniqueid':{'type':Sequelize[_0xf9c6('0x3')]}}; \ No newline at end of file +var _0x01e8=['talk:[start]','talk:[destination]','talk:[dial\x20string]','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x2e7f80,_0x34f38b){var _0x5837fd=function(_0x2f4156){while(--_0x2f4156){_0x2e7f80['push'](_0x2e7f80['shift']());}};_0x5837fd(++_0x34f38b);}(_0x01e8,0x12f));var _0x801e=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x01e8[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x801e('0x0'));module[_0x801e('0x1')]={'channel':{'type':Sequelize[_0x801e('0x2')]},'membername':{'type':Sequelize[_0x801e('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x801e('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x801e('0x3')},'duration':{'type':Sequelize[_0x801e('0x4')]},'enterAt':{'type':Sequelize[_0x801e('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x1079db){var _0x39c6a6=moment(_0x1079db);var _0x14e4c9=moment(this[_0x801e('0x6')](_0x801e('0x7')));var _0x1cf8c4=_0x39c6a6[_0x801e('0x8')](_0x14e4c9,_0x801e('0x9'));this[_0x801e('0xa')]('exitAt',_0x1079db);this['setDataValue']('duration',_0x1cf8c4>=0x0?_0x1cf8c4:null);}},'data1':{'type':Sequelize[_0x801e('0x2')],'comment':_0x801e('0xb')},'data2':{'type':Sequelize[_0x801e('0x2')],'comment':_0x801e('0xc')},'data3':{'type':Sequelize[_0x801e('0x2')],'comment':_0x801e('0xd')},'data4':{'type':Sequelize[_0x801e('0x2')],'comment':_0x801e('0xe')},'data5':{'type':Sequelize[_0x801e('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x801e('0x2')]},'internal':{'type':Sequelize[_0x801e('0x4')]},'uniqueid':{'type':Sequelize[_0x801e('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index dbc7285..347f754 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x239a62,_0x3e82e6){var _0x4e1358=function(_0x208c53){while(--_0x208c53){_0x239a62['push'](_0x239a62['shift']());}};_0x4e1358(++_0x3e82e6);}(_0x008c,0x188));var _0xc008=function(_0x429a21,_0x43b4e0){_0x429a21=_0x429a21-0x0;var _0x3a8c04=_0x008c[_0x429a21];return _0x3a8c04;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x55ca,0x126));var _0xa55c=function(_0x4c39f5,_0x109684){_0x4c39f5=_0x4c39f5-0x0;var _0x1db24f=_0x55ca[_0x4c39f5];return _0x1db24f;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 255769e..555f5e1 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 _0x7cc4=['membername','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','membername_interface'];(function(_0x349a1a,_0x1a4e9c){var _0x30d1c5=function(_0xd57a1e){while(--_0xd57a1e){_0x349a1a['push'](_0x349a1a['shift']());}};_0x30d1c5(++_0x1a4e9c);}(_0x7cc4,0x155));var _0x47cc=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x7cc4[_0x5ad190];return _0x518ed3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x47cc('0x0'));var moment=require(_0x47cc('0x1'));var BPromise=require(_0x47cc('0x2'));var rp=require(_0x47cc('0x3'));var fs=require('fs');var path=require(_0x47cc('0x4'));var rimraf=require(_0x47cc('0x5'));var config=require(_0x47cc('0x6'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x514682,_0x1bd1e6){return _0x514682[_0x47cc('0x7')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x47cc('0x8'),'fields':[_0x47cc('0x9'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe5f5=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports'];(function(_0x87f431,_0xe8c16a){var _0x49a3c7=function(_0x7604be){while(--_0x7604be){_0x87f431['push'](_0x87f431['shift']());}};_0x49a3c7(++_0xe8c16a);}(_0xe5f5,0x1e6));var _0x5e5f=function(_0x1e9912,_0x50f826){_0x1e9912=_0x1e9912-0x0;var _0x193d70=_0xe5f5[_0x1e9912];return _0x193d70;};'use strict';var _=require(_0x5e5f('0x0'));var util=require(_0x5e5f('0x1'));var logger=require(_0x5e5f('0x2'))(_0x5e5f('0x3'));var moment=require('moment');var BPromise=require(_0x5e5f('0x4'));var rp=require(_0x5e5f('0x5'));var fs=require('fs');var path=require(_0x5e5f('0x6'));var rimraf=require(_0x5e5f('0x7'));var config=require('../../config/environment');var attributes=require(_0x5e5f('0x8'));module[_0x5e5f('0x9')]=function(_0x4dd894,_0x5304b1){return _0x4dd894[_0x5e5f('0xa')](_0x5e5f('0xb'),attributes,{'tableName':_0x5e5f('0xc'),'paranoid':![],'indexes':[{'name':_0x5e5f('0xd'),'fields':[_0x5e5f('0xe'),_0x5e5f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index f2affbf..eeee551 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 _0x5a4f=['map','model','GetMemberReport','debug','CreateMemberReport','create','raw','UpdateMemberReport','update','body','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MemberReport','findAll','options','attributes','limit','include'];(function(_0x4507fd,_0x3d8674){var _0x3a2fcb=function(_0x5e4a2b){while(--_0x5e4a2b){_0x4507fd['push'](_0x4507fd['shift']());}};_0x3a2fcb(++_0x3d8674);}(_0x5a4f,0x10d));var _0xf5a4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5a4f[_0x432682];return _0x463d05;};'use strict';var _=require(_0xf5a4('0x0'));var util=require('util');var moment=require(_0xf5a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf5a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5a4('0x3'))['db'];var utils=require(_0xf5a4('0x4'));var logger=require(_0xf5a4('0x5'))(_0xf5a4('0x6'));var config=require(_0xf5a4('0x7'));var jayson=require(_0xf5a4('0x8'));var client=jayson[_0xf5a4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354c7d,_0xac1c57,_0x3ef3da){return new BPromise(function(_0x1e7821,_0x363fd2){return client[_0xf5a4('0xa')](_0x354c7d,_0x3ef3da)[_0xf5a4('0xb')](function(_0x39c851){logger[_0xf5a4('0xc')](_0xf5a4('0xd'),_0xac1c57,_0xf5a4('0xe'));logger['debug'](_0xf5a4('0xf'),_0xac1c57,_0xf5a4('0xe'),JSON[_0xf5a4('0x10')](_0x39c851));if(_0x39c851[_0xf5a4('0x11')]){if(_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x12')]===0x1f4){logger['error'](_0xf5a4('0xd'),_0xac1c57,_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x13')]);return _0x363fd2(_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x13')]);}logger[_0xf5a4('0x11')](_0xf5a4('0xd'),_0xac1c57,_0x39c851['error'][_0xf5a4('0x13')]);return _0x1e7821(_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x13')]);}else{logger[_0xf5a4('0xc')](_0xf5a4('0xd'),_0xac1c57,_0xf5a4('0xe'));_0x1e7821(_0x39c851['result'][_0xf5a4('0x13')]);}})[_0xf5a4('0x14')](function(_0x499493){logger[_0xf5a4('0x11')]('MemberReport,\x20%s,\x20%s',_0xac1c57,_0x499493);_0x363fd2(_0x499493);});});}exports['GetMemberReport']=function(_0x1aad18){var _0x5ffb8c=this;return new Promise(function(_0x30d013,_0x3e48ba){return db[_0xf5a4('0x15')][_0xf5a4('0x16')]({'raw':_0x1aad18[_0xf5a4('0x17')]?_0x1aad18[_0xf5a4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1aad18[_0xf5a4('0x17')]?_0x1aad18[_0xf5a4('0x17')]['where']||null:null,'attributes':_0x1aad18['options']?_0x1aad18[_0xf5a4('0x17')][_0xf5a4('0x18')]||null:null,'limit':_0x1aad18[_0xf5a4('0x17')]?_0x1aad18[_0xf5a4('0x17')][_0xf5a4('0x19')]||null:null,'include':_0x1aad18['options']?_0x1aad18['options'][_0xf5a4('0x1a')]?_[_0xf5a4('0x1b')](_0x1aad18[_0xf5a4('0x17')][_0xf5a4('0x1a')],function(_0x139db6){return{'model':db[_0x139db6[_0xf5a4('0x1c')]],'as':_0x139db6['as'],'attributes':_0x139db6['attributes'],'include':_0x139db6[_0xf5a4('0x1a')]?_[_0xf5a4('0x1b')](_0x139db6['include'],function(_0x36d007){return{'model':db[_0x36d007['model']],'as':_0x36d007['as'],'attributes':_0x36d007[_0xf5a4('0x18')],'include':_0x36d007[_0xf5a4('0x1a')]?_[_0xf5a4('0x1b')](_0x36d007[_0xf5a4('0x1a')],function(_0x4ea5e0){return{'model':db[_0x4ea5e0[_0xf5a4('0x1c')]],'as':_0x4ea5e0['as'],'attributes':_0x4ea5e0[_0xf5a4('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf5a4('0xb')](function(_0x228b32){logger[_0xf5a4('0xc')](_0xf5a4('0x1d'),_0x1aad18);logger[_0xf5a4('0x1e')]('GetMemberReport',_0x1aad18,JSON[_0xf5a4('0x10')](_0x228b32));_0x30d013(_0x228b32);})[_0xf5a4('0x14')](function(_0x2c0ca8){logger[_0xf5a4('0x11')](_0xf5a4('0x1d'),_0x2c0ca8['message'],_0x1aad18);_0x3e48ba(_0x5ffb8c[_0xf5a4('0x11')](0x1f4,_0x2c0ca8[_0xf5a4('0x13')]));});});};exports[_0xf5a4('0x1f')]=function(_0x266a08){var _0x43ebf2=this;return new Promise(function(_0x12a363,_0x3405eb){return db[_0xf5a4('0x15')][_0xf5a4('0x20')](_0x266a08['body'],{'raw':_0x266a08['options']?_0x266a08[_0xf5a4('0x17')][_0xf5a4('0x21')]===undefined?!![]:![]:!![]})[_0xf5a4('0xb')](function(_0x43b66c){logger[_0xf5a4('0xc')]('CreateMemberReport',_0x266a08);logger[_0xf5a4('0x1e')](_0xf5a4('0x1f'),_0x266a08,JSON[_0xf5a4('0x10')](_0x43b66c));_0x12a363(_0x43b66c);})[_0xf5a4('0x14')](function(_0x5262c0){logger[_0xf5a4('0x11')](_0xf5a4('0x1f'),_0x5262c0[_0xf5a4('0x13')],_0x266a08);_0x3405eb(_0x43ebf2['error'](0x1f4,_0x5262c0['message']));});});};exports[_0xf5a4('0x22')]=function(_0x203293){var _0x19eaa6=this;return new Promise(function(_0xf38d8a,_0x2e69cd){return db[_0xf5a4('0x15')][_0xf5a4('0x23')](_0x203293[_0xf5a4('0x24')],{'raw':_0x203293[_0xf5a4('0x17')]?_0x203293['options'][_0xf5a4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x203293[_0xf5a4('0x17')]?_0x203293[_0xf5a4('0x17')]['where']||null:null,'attributes':_0x203293[_0xf5a4('0x17')]?_0x203293[_0xf5a4('0x17')]['attributes']||null:null,'limit':_0x203293[_0xf5a4('0x17')]?_0x203293[_0xf5a4('0x17')][_0xf5a4('0x19')]||null:null})[_0xf5a4('0xb')](function(_0x34a459){logger[_0xf5a4('0xc')]('UpdateMemberReport',_0x203293);logger['debug']('UpdateMemberReport',_0x203293,JSON[_0xf5a4('0x10')](_0x34a459));_0xf38d8a(_0x34a459);})['catch'](function(_0x2f46aa){logger[_0xf5a4('0x11')](_0xf5a4('0x22'),_0x2f46aa[_0xf5a4('0x13')],_0x203293);_0x2e69cd(_0x19eaa6[_0xf5a4('0x11')](0x1f4,_0x2f46aa['message']));});});}; \ No newline at end of file +var _0xd101=['request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','raw','options','attributes','include','map','model','CreateMemberReport','create','body','stringify','UpdateMemberReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd101,0xc1));var _0x1d10=function(_0x2ed532,_0x284b36){_0x2ed532=_0x2ed532-0x0;var _0x2c466e=_0xd101[_0x2ed532];return _0x2c466e;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var moment=require(_0x1d10('0x1'));var BPromise=require(_0x1d10('0x2'));var rs=require(_0x1d10('0x3'));var fs=require('fs');var Redis=require(_0x1d10('0x4'));var db=require(_0x1d10('0x5'))['db'];var utils=require(_0x1d10('0x6'));var logger=require(_0x1d10('0x7'))(_0x1d10('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d10('0x9'));var client=jayson[_0x1d10('0xa')][_0x1d10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27d569,_0xb9e08,_0x36335e){return new BPromise(function(_0x6d6def,_0x43df2c){return client[_0x1d10('0xc')](_0x27d569,_0x36335e)[_0x1d10('0xd')](function(_0xf7926b){logger[_0x1d10('0xe')](_0x1d10('0xf'),_0xb9e08,_0x1d10('0x10'));logger[_0x1d10('0x11')](_0x1d10('0x12'),_0xb9e08,_0x1d10('0x10'),JSON['stringify'](_0xf7926b));if(_0xf7926b[_0x1d10('0x13')]){if(_0xf7926b[_0x1d10('0x13')][_0x1d10('0x14')]===0x1f4){logger[_0x1d10('0x13')](_0x1d10('0xf'),_0xb9e08,_0xf7926b['error'][_0x1d10('0x15')]);return _0x43df2c(_0xf7926b[_0x1d10('0x13')][_0x1d10('0x15')]);}logger[_0x1d10('0x13')](_0x1d10('0xf'),_0xb9e08,_0xf7926b[_0x1d10('0x13')]['message']);return _0x6d6def(_0xf7926b[_0x1d10('0x13')][_0x1d10('0x15')]);}else{logger[_0x1d10('0xe')](_0x1d10('0xf'),_0xb9e08,'request\x20sent');_0x6d6def(_0xf7926b[_0x1d10('0x16')][_0x1d10('0x15')]);}})[_0x1d10('0x17')](function(_0x3f2f2b){logger[_0x1d10('0x13')](_0x1d10('0xf'),_0xb9e08,_0x3f2f2b);_0x43df2c(_0x3f2f2b);});});}exports[_0x1d10('0x18')]=function(_0x4f3e2a){var _0x23d604=this;return new Promise(function(_0x1163dd,_0x4ca1e8){return db[_0x1d10('0x19')][_0x1d10('0x1a')]({'raw':_0x4f3e2a['options']?_0x4f3e2a['options'][_0x1d10('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f3e2a['options']?_0x4f3e2a['options']['where']||null:null,'attributes':_0x4f3e2a[_0x1d10('0x1c')]?_0x4f3e2a[_0x1d10('0x1c')][_0x1d10('0x1d')]||null:null,'limit':_0x4f3e2a[_0x1d10('0x1c')]?_0x4f3e2a['options']['limit']||null:null,'include':_0x4f3e2a[_0x1d10('0x1c')]?_0x4f3e2a['options'][_0x1d10('0x1e')]?_[_0x1d10('0x1f')](_0x4f3e2a[_0x1d10('0x1c')][_0x1d10('0x1e')],function(_0x127b37){return{'model':db[_0x127b37[_0x1d10('0x20')]],'as':_0x127b37['as'],'attributes':_0x127b37[_0x1d10('0x1d')],'include':_0x127b37[_0x1d10('0x1e')]?_[_0x1d10('0x1f')](_0x127b37[_0x1d10('0x1e')],function(_0xf1e4c8){return{'model':db[_0xf1e4c8['model']],'as':_0xf1e4c8['as'],'attributes':_0xf1e4c8[_0x1d10('0x1d')],'include':_0xf1e4c8[_0x1d10('0x1e')]?_[_0x1d10('0x1f')](_0xf1e4c8[_0x1d10('0x1e')],function(_0x18e7d9){return{'model':db[_0x18e7d9[_0x1d10('0x20')]],'as':_0x18e7d9['as'],'attributes':_0x18e7d9[_0x1d10('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d10('0xd')](function(_0x4f7837){logger[_0x1d10('0xe')](_0x1d10('0x18'),_0x4f3e2a);logger['debug'](_0x1d10('0x18'),_0x4f3e2a,JSON['stringify'](_0x4f7837));_0x1163dd(_0x4f7837);})['catch'](function(_0x41b5b8){logger['error'](_0x1d10('0x18'),_0x41b5b8[_0x1d10('0x15')],_0x4f3e2a);_0x4ca1e8(_0x23d604[_0x1d10('0x13')](0x1f4,_0x41b5b8[_0x1d10('0x15')]));});});};exports[_0x1d10('0x21')]=function(_0x9c6cb9){var _0x4b5400=this;return new Promise(function(_0x4e30b2,_0x1ada44){return db[_0x1d10('0x19')][_0x1d10('0x22')](_0x9c6cb9[_0x1d10('0x23')],{'raw':_0x9c6cb9[_0x1d10('0x1c')]?_0x9c6cb9[_0x1d10('0x1c')][_0x1d10('0x1b')]===undefined?!![]:![]:!![]})[_0x1d10('0xd')](function(_0x8f4818){logger[_0x1d10('0xe')]('CreateMemberReport',_0x9c6cb9);logger[_0x1d10('0x11')]('CreateMemberReport',_0x9c6cb9,JSON[_0x1d10('0x24')](_0x8f4818));_0x4e30b2(_0x8f4818);})[_0x1d10('0x17')](function(_0x5d446b){logger[_0x1d10('0x13')]('CreateMemberReport',_0x5d446b[_0x1d10('0x15')],_0x9c6cb9);_0x1ada44(_0x4b5400[_0x1d10('0x13')](0x1f4,_0x5d446b[_0x1d10('0x15')]));});});};exports[_0x1d10('0x25')]=function(_0xd50250){var _0x5eb413=this;return new Promise(function(_0x4c3ef6,_0x35025e){return db[_0x1d10('0x19')][_0x1d10('0x26')](_0xd50250['body'],{'raw':_0xd50250['options']?_0xd50250['options'][_0x1d10('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd50250['options']?_0xd50250[_0x1d10('0x1c')][_0x1d10('0x27')]||null:null,'attributes':_0xd50250[_0x1d10('0x1c')]?_0xd50250[_0x1d10('0x1c')]['attributes']||null:null,'limit':_0xd50250['options']?_0xd50250[_0x1d10('0x1c')][_0x1d10('0x28')]||null:null})[_0x1d10('0xd')](function(_0x230c19){logger['info'](_0x1d10('0x25'),_0xd50250);logger['debug'](_0x1d10('0x25'),_0xd50250,JSON[_0x1d10('0x24')](_0x230c19));_0x4c3ef6(_0x230c19);})[_0x1d10('0x17')](function(_0x8d8405){logger[_0x1d10('0x13')](_0x1d10('0x25'),_0x8d8405[_0x1d10('0x15')],_0xd50250);_0x35025e(_0x5eb413[_0x1d10('0x13')](0x1f4,_0x8d8405[_0x1d10('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 932ddad..888f2d6 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 _0x91f6=['../../config/environment','./migration.controller','get','exports','path','express','fs-extra','../../components/interaction/service'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x91f6,0x7c));var _0x691f=function(_0x4260d0,_0x73ac34){_0x4260d0=_0x4260d0-0x0;var _0x5f34c2=_0x91f6[_0x4260d0];return _0x5f34c2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x691f('0x0'));var timeout=require('connect-timeout');var express=require(_0x691f('0x1'));var router=express['Router']();var fs_extra=require(_0x691f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x691f('0x3'));var config=require(_0x691f('0x4'));var controller=require(_0x691f('0x5'));router[_0x691f('0x6')]('/',controller['index']);module[_0x691f('0x7')]=router; \ No newline at end of file +var _0x2436=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports','util','path','connect-timeout','express','Router'];(function(_0x90e75c,_0x1ddf2f){var _0x586400=function(_0x21872e){while(--_0x21872e){_0x90e75c['push'](_0x90e75c['shift']());}};_0x586400(++_0x1ddf2f);}(_0x2436,0x1e7));var _0x6243=function(_0x38e929,_0x3b9b30){_0x38e929=_0x38e929-0x0;var _0x25bfce=_0x2436[_0x38e929];return _0x25bfce;};'use strict';var multer=require('multer');var util=require(_0x6243('0x0'));var path=require(_0x6243('0x1'));var timeout=require(_0x6243('0x2'));var express=require(_0x6243('0x3'));var router=express[_0x6243('0x4')]();var fs_extra=require(_0x6243('0x5'));var auth=require(_0x6243('0x6'));var interaction=require(_0x6243('0x7'));var config=require(_0x6243('0x8'));var controller=require(_0x6243('0x9'));router['get']('/',controller[_0x6243('0xa')]);module[_0x6243('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 7f2ec30..be0829e 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 _0xc491=['STRING','version','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc491,0xb0));var _0x1c49=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0xc491[_0xa9a245];return _0x2d0eaa;};'use strict';var Sequelize=require('sequelize');module[_0x1c49('0x0')]={'version':{'type':Sequelize[_0x1c49('0x1')],'unique':_0x1c49('0x2')}}; \ No newline at end of file +var _0x4c1b=['version','exports'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x4c1b,0x79));var _0xb4c1=function(_0x36e3b4,_0x5bdedd){_0x36e3b4=_0x36e3b4-0x0;var _0x1c7f0e=_0x4c1b[_0x36e3b4];return _0x1c7f0e;};'use strict';var Sequelize=require('sequelize');module[_0xb4c1('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xb4c1('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 2d66f5d..d7e5b3c 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 _0x591c=['includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','end','stack','name','send','index','map','Migration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x255584,_0x3bc5b6){var _0x82cc76=function(_0x5398d1){while(--_0x5398d1){_0x255584['push'](_0x255584['shift']());}};_0x82cc76(++_0x3bc5b6);}(_0x591c,0x8e));var _0xc591=function(_0x5e291f,_0x5be556){_0x5e291f=_0x5e291f-0x0;var _0x14c763=_0x591c[_0x5e291f];return _0x14c763;};'use strict';var emlformat=require(_0xc591('0x0'));var rimraf=require(_0xc591('0x1'));var zipdir=require(_0xc591('0x2'));var jsonpatch=require(_0xc591('0x3'));var rp=require(_0xc591('0x4'));var moment=require(_0xc591('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc591('0x6'));var util=require(_0xc591('0x7'));var path=require(_0xc591('0x8'));var sox=require('sox');var csv=require(_0xc591('0x9'));var ejs=require(_0xc591('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc591('0xb'));var squel=require(_0xc591('0xc'));var crypto=require(_0xc591('0xd'));var jsforce=require(_0xc591('0xe'));var deskjs=require(_0xc591('0xf'));var toCsv=require(_0xc591('0x9'));var querystring=require(_0xc591('0x10'));var Papa=require('papaparse');var Redis=require(_0xc591('0x11'));var authService=require(_0xc591('0x12'));var qs=require(_0xc591('0x13'));var as=require(_0xc591('0x14'));var hardwareService=require(_0xc591('0x15'));var logger=require(_0xc591('0x16'))(_0xc591('0x17'));var utils=require(_0xc591('0x18'));var config=require(_0xc591('0x19'));var licenseUtil=require(_0xc591('0x1a'));var db=require(_0xc591('0x1b'))['db'];function respondWithStatusCode(_0x3eb3cd,_0x4d822b){_0x4d822b=_0x4d822b||0xcc;return function(_0x550672){if(_0x550672){return _0x3eb3cd[_0xc591('0x1c')](_0x4d822b);}return _0x3eb3cd[_0xc591('0x1d')](_0x4d822b)['end']();};}function respondWithResult(_0x49dcb7,_0x413489){_0x413489=_0x413489||0xc8;return function(_0x2de654){if(_0x2de654){return _0x49dcb7[_0xc591('0x1d')](_0x413489)[_0xc591('0x1e')](_0x2de654);}};}function respondWithFilteredResult(_0x33dac0,_0x43beab){return function(_0x535134){if(_0x535134){var _0x4a1fd3=typeof _0x43beab['offset']===_0xc591('0x1f')&&typeof _0x43beab[_0xc591('0x20')]===_0xc591('0x1f');var _0x3940a7=_0x535134[_0xc591('0x21')];var _0x348434=_0x4a1fd3?0x0:_0x43beab[_0xc591('0x22')];var _0x31a3cb=_0x4a1fd3?_0x535134['count']:_0x43beab[_0xc591('0x22')]+_0x43beab[_0xc591('0x20')];var _0x1c3f23;if(_0x31a3cb>=_0x3940a7){_0x31a3cb=_0x3940a7;_0x1c3f23=0xc8;}else{_0x1c3f23=0xce;}_0x33dac0[_0xc591('0x1d')](_0x1c3f23);return _0x33dac0[_0xc591('0x23')](_0xc591('0x24'),_0x348434+'-'+_0x31a3cb+'/'+_0x3940a7)[_0xc591('0x1e')](_0x535134);}return null;};}function patchUpdates(_0x481742){return function(_0x4162da){try{jsonpatch[_0xc591('0x25')](_0x4162da,_0x481742,!![]);}catch(_0x24ea6b){return BPromise['reject'](_0x24ea6b);}return _0x4162da['save']();};}function saveUpdates(_0x3ccf30,_0x57bf64){return function(_0x50c0fc){if(_0x50c0fc){return _0x50c0fc[_0xc591('0x26')](_0x3ccf30)[_0xc591('0x27')](function(_0x4ec01f){return _0x4ec01f;});}return null;};}function removeEntity(_0x2d71a0,_0x13d86b){return function(_0x397b9f){if(_0x397b9f){return _0x397b9f['destroy']()[_0xc591('0x27')](function(){_0x2d71a0[_0xc591('0x1d')](0xcc)[_0xc591('0x28')]();});}};}function handleEntityNotFound(_0x2f2d65,_0x3c8611){return function(_0x4d8e88){if(!_0x4d8e88){_0x2f2d65[_0xc591('0x1c')](0x194);}return _0x4d8e88;};}function handleError(_0x3a5549,_0x4f7410){_0x4f7410=_0x4f7410||0x1f4;return function(_0xaaf778){logger['error'](_0xaaf778[_0xc591('0x29')]);if(_0xaaf778['name']){delete _0xaaf778[_0xc591('0x2a')];}_0x3a5549[_0xc591('0x1d')](_0x4f7410)[_0xc591('0x2b')](_0xaaf778);};}exports[_0xc591('0x2c')]=function(_0x36075a,_0x1f8650){var _0x4b3ab4={},_0x59c570={},_0x273e72={'count':0x0,'rows':[]};var _0x584c3e=_[_0xc591('0x2d')](db[_0xc591('0x2e')][_0xc591('0x2f')],function(_0x1d92aa){return{'name':_0x1d92aa['fieldName'],'type':_0x1d92aa[_0xc591('0x30')][_0xc591('0x31')]};});_0x59c570[_0xc591('0x32')]=_[_0xc591('0x2d')](_0x584c3e,_0xc591('0x2a'));_0x59c570[_0xc591('0x33')]=_[_0xc591('0x34')](_0x36075a['query']);_0x59c570['filters']=_[_0xc591('0x35')](_0x59c570[_0xc591('0x32')],_0x59c570[_0xc591('0x33')]);_0x4b3ab4['attributes']=_[_0xc591('0x35')](_0x59c570['model'],qs[_0xc591('0x36')](_0x36075a[_0xc591('0x33')][_0xc591('0x36')]));_0x4b3ab4[_0xc591('0x37')]=_0x4b3ab4[_0xc591('0x37')]['length']?_0x4b3ab4[_0xc591('0x37')]:_0x59c570[_0xc591('0x32')];if(!_0x36075a[_0xc591('0x33')][_0xc591('0x38')](_0xc591('0x39'))){_0x4b3ab4[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x36075a[_0xc591('0x33')]['limit']);_0x4b3ab4[_0xc591('0x22')]=qs['offset'](_0x36075a[_0xc591('0x33')][_0xc591('0x22')]);}_0x4b3ab4['order']=qs[_0xc591('0x3a')](_0x36075a[_0xc591('0x33')][_0xc591('0x3a')]);_0x4b3ab4[_0xc591('0x3b')]=qs[_0xc591('0x3c')](_[_0xc591('0x3d')](_0x36075a['query'],_0x59c570[_0xc591('0x3c')]),_0x584c3e);if(_0x36075a[_0xc591('0x33')][_0xc591('0x3e')]){_0x4b3ab4[_0xc591('0x3b')]=_[_0xc591('0x3f')](_0x4b3ab4[_0xc591('0x3b')],{'$or':_['map'](_0x584c3e,function(_0x50ab60){if(_0x50ab60[_0xc591('0x30')]!==_0xc591('0x40')){var _0x170bed={};_0x170bed[_0x50ab60[_0xc591('0x2a')]]={'$like':'%'+_0x36075a[_0xc591('0x33')][_0xc591('0x3e')]+'%'};return _0x170bed;}})});}_0x4b3ab4=_['merge']({},_0x4b3ab4,_0x36075a['options']);var _0x3f8062={'where':_0x4b3ab4[_0xc591('0x3b')]};return db['Migration'][_0xc591('0x21')](_0x3f8062)[_0xc591('0x27')](function(_0x207917){_0x273e72[_0xc591('0x21')]=_0x207917;if(_0x36075a[_0xc591('0x33')][_0xc591('0x41')]){_0x4b3ab4[_0xc591('0x42')]=[{'all':!![]}];}return db[_0xc591('0x2e')][_0xc591('0x43')](_0x4b3ab4);})[_0xc591('0x27')](function(_0x2317e7){_0x273e72['rows']=_0x2317e7;return _0x273e72;})['then'](respondWithFilteredResult(_0x1f8650,_0x4b3ab4))[_0xc591('0x44')](handleError(_0x1f8650,null));}; \ No newline at end of file +var _0x54d6=['order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Migration','rawAttributes','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x22491d,_0x3bad40){var _0x431173=function(_0x4fba3f){while(--_0x4fba3f){_0x22491d['push'](_0x22491d['shift']());}};_0x431173(++_0x3bad40);}(_0x54d6,0x15f));var _0x654d=function(_0x62f121,_0x202f73){_0x62f121=_0x62f121-0x0;var _0x1db7bc=_0x54d6[_0x62f121];return _0x1db7bc;};'use strict';var emlformat=require(_0x654d('0x0'));var rimraf=require(_0x654d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x654d('0x2'));var rp=require('request-promise');var moment=require(_0x654d('0x3'));var BPromise=require(_0x654d('0x4'));var Mustache=require('mustache');var util=require(_0x654d('0x5'));var path=require(_0x654d('0x6'));var sox=require(_0x654d('0x7'));var csv=require(_0x654d('0x8'));var ejs=require(_0x654d('0x9'));var fs=require('fs');var fs_extra=require(_0x654d('0xa'));var _=require(_0x654d('0xb'));var squel=require(_0x654d('0xc'));var crypto=require(_0x654d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x654d('0xe'));var toCsv=require(_0x654d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x654d('0xf'));var qs=require(_0x654d('0x10'));var as=require(_0x654d('0x11'));var hardwareService=require(_0x654d('0x12'));var logger=require(_0x654d('0x13'))(_0x654d('0x14'));var utils=require('../../config/utils');var config=require(_0x654d('0x15'));var licenseUtil=require(_0x654d('0x16'));var db=require(_0x654d('0x17'))['db'];function respondWithStatusCode(_0x55c19a,_0x68b7ef){_0x68b7ef=_0x68b7ef||0xcc;return function(_0x5c93b3){if(_0x5c93b3){return _0x55c19a['sendStatus'](_0x68b7ef);}return _0x55c19a['status'](_0x68b7ef)[_0x654d('0x18')]();};}function respondWithResult(_0x3d4c9f,_0x53e7c4){_0x53e7c4=_0x53e7c4||0xc8;return function(_0x4782cc){if(_0x4782cc){return _0x3d4c9f[_0x654d('0x19')](_0x53e7c4)[_0x654d('0x1a')](_0x4782cc);}};}function respondWithFilteredResult(_0x44f1ce,_0x2775f1){return function(_0xc6607a){if(_0xc6607a){var _0x2d17af=typeof _0x2775f1[_0x654d('0x1b')]===_0x654d('0x1c')&&typeof _0x2775f1['limit']===_0x654d('0x1c');var _0x43fcde=_0xc6607a[_0x654d('0x1d')];var _0x35043c=_0x2d17af?0x0:_0x2775f1[_0x654d('0x1b')];var _0xefa0f7=_0x2d17af?_0xc6607a[_0x654d('0x1d')]:_0x2775f1[_0x654d('0x1b')]+_0x2775f1[_0x654d('0x1e')];var _0x51086b;if(_0xefa0f7>=_0x43fcde){_0xefa0f7=_0x43fcde;_0x51086b=0xc8;}else{_0x51086b=0xce;}_0x44f1ce['status'](_0x51086b);return _0x44f1ce[_0x654d('0x1f')]('Content-Range',_0x35043c+'-'+_0xefa0f7+'/'+_0x43fcde)['json'](_0xc6607a);}return null;};}function patchUpdates(_0x43c360){return function(_0x1544b1){try{jsonpatch[_0x654d('0x20')](_0x1544b1,_0x43c360,!![]);}catch(_0x24eda9){return BPromise[_0x654d('0x21')](_0x24eda9);}return _0x1544b1[_0x654d('0x22')]();};}function saveUpdates(_0x1e5886,_0x445590){return function(_0x49e1bb){if(_0x49e1bb){return _0x49e1bb[_0x654d('0x23')](_0x1e5886)[_0x654d('0x24')](function(_0x1f2244){return _0x1f2244;});}return null;};}function removeEntity(_0x3b9e86,_0x75db26){return function(_0x2346ac){if(_0x2346ac){return _0x2346ac[_0x654d('0x25')]()[_0x654d('0x24')](function(){_0x3b9e86[_0x654d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b846d,_0x32f5c7){return function(_0x134fd1){if(!_0x134fd1){_0x4b846d[_0x654d('0x26')](0x194);}return _0x134fd1;};}function handleError(_0x317204,_0x2e9a66){_0x2e9a66=_0x2e9a66||0x1f4;return function(_0x490aa2){logger[_0x654d('0x27')](_0x490aa2[_0x654d('0x28')]);if(_0x490aa2[_0x654d('0x29')]){delete _0x490aa2['name'];}_0x317204[_0x654d('0x19')](_0x2e9a66)[_0x654d('0x2a')](_0x490aa2);};}exports['index']=function(_0x1ffc73,_0x344107){var _0x1f1a00={},_0x41e9b0={},_0x952f48={'count':0x0,'rows':[]};var _0x2c4863=_['map'](db[_0x654d('0x2b')][_0x654d('0x2c')],function(_0x40fef2){return{'name':_0x40fef2['fieldName'],'type':_0x40fef2[_0x654d('0x2d')]['key']};});_0x41e9b0['model']=_[_0x654d('0x2e')](_0x2c4863,_0x654d('0x29'));_0x41e9b0[_0x654d('0x2f')]=_[_0x654d('0x30')](_0x1ffc73[_0x654d('0x2f')]);_0x41e9b0[_0x654d('0x31')]=_[_0x654d('0x32')](_0x41e9b0['model'],_0x41e9b0[_0x654d('0x2f')]);_0x1f1a00[_0x654d('0x33')]=_[_0x654d('0x32')](_0x41e9b0[_0x654d('0x34')],qs[_0x654d('0x35')](_0x1ffc73['query'][_0x654d('0x35')]));_0x1f1a00[_0x654d('0x33')]=_0x1f1a00[_0x654d('0x33')][_0x654d('0x36')]?_0x1f1a00['attributes']:_0x41e9b0[_0x654d('0x34')];if(!_0x1ffc73[_0x654d('0x2f')][_0x654d('0x37')](_0x654d('0x38'))){_0x1f1a00[_0x654d('0x1e')]=qs[_0x654d('0x1e')](_0x1ffc73[_0x654d('0x2f')][_0x654d('0x1e')]);_0x1f1a00['offset']=qs[_0x654d('0x1b')](_0x1ffc73[_0x654d('0x2f')][_0x654d('0x1b')]);}_0x1f1a00[_0x654d('0x39')]=qs[_0x654d('0x3a')](_0x1ffc73[_0x654d('0x2f')][_0x654d('0x3a')]);_0x1f1a00[_0x654d('0x3b')]=qs[_0x654d('0x31')](_['pick'](_0x1ffc73['query'],_0x41e9b0['filters']),_0x2c4863);if(_0x1ffc73[_0x654d('0x2f')][_0x654d('0x3c')]){_0x1f1a00[_0x654d('0x3b')]=_[_0x654d('0x3d')](_0x1f1a00[_0x654d('0x3b')],{'$or':_[_0x654d('0x2e')](_0x2c4863,function(_0x370a85){if(_0x370a85['type']!=='VIRTUAL'){var _0x1054a4={};_0x1054a4[_0x370a85['name']]={'$like':'%'+_0x1ffc73[_0x654d('0x2f')][_0x654d('0x3c')]+'%'};return _0x1054a4;}})});}_0x1f1a00=_['merge']({},_0x1f1a00,_0x1ffc73[_0x654d('0x3e')]);var _0x4a1cf6={'where':_0x1f1a00['where']};return db[_0x654d('0x2b')][_0x654d('0x1d')](_0x4a1cf6)[_0x654d('0x24')](function(_0x152433){_0x952f48[_0x654d('0x1d')]=_0x152433;if(_0x1ffc73['query'][_0x654d('0x3f')]){_0x1f1a00[_0x654d('0x40')]=[{'all':!![]}];}return db[_0x654d('0x2b')][_0x654d('0x41')](_0x1f1a00);})[_0x654d('0x24')](function(_0x5ad8be){_0x952f48[_0x654d('0x42')]=_0x5ad8be;return _0x952f48;})['then'](respondWithFilteredResult(_0x344107,_0x1f1a00))[_0x654d('0x43')](handleError(_0x344107,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 36ee312..d5c1e20 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 _0xa783=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash'];(function(_0x19d9c9,_0x512c5b){var _0x45ae60=function(_0x4350d6){while(--_0x4350d6){_0x19d9c9['push'](_0x19d9c9['shift']());}};_0x45ae60(++_0x512c5b);}(_0xa783,0x81));var _0x3a78=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xa783[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x3a78('0x0'));var util=require(_0x3a78('0x1'));var logger=require(_0x3a78('0x2'))(_0x3a78('0x3'));var moment=require(_0x3a78('0x4'));var BPromise=require(_0x3a78('0x5'));var rp=require(_0x3a78('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a78('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a78('0x8'));module[_0x3a78('0x9')]=function(_0x7ac90d,_0xb27cdd){return _0x7ac90d[_0x3a78('0xa')](_0x3a78('0xb'),attributes,{'tableName':_0x3a78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35b5=['rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x35b5,0x8d));var _0x535b=function(_0x171831,_0x20580b){_0x171831=_0x171831-0x0;var _0x454c49=_0x35b5[_0x171831];return _0x454c49;};'use strict';var _=require(_0x535b('0x0'));var util=require(_0x535b('0x1'));var logger=require(_0x535b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x535b('0x3'));var config=require(_0x535b('0x4'));var attributes=require(_0x535b('0x5'));module[_0x535b('0x6')]=function(_0x4e5a00,_0x2973bf){return _0x4e5a00['define'](_0x535b('0x7'),attributes,{'tableName':_0x535b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 6683843..93c3a4b 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 _0xdbfc=['client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xcce8ef,_0x3e7a2c){var _0x241f38=function(_0x10464e){while(--_0x10464e){_0xcce8ef['push'](_0xcce8ef['shift']());}};_0x241f38(++_0x3e7a2c);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x3438fb,_0xde4967){_0x3438fb=_0x3438fb-0x0;var _0x2606b1=_0xdbfc[_0x3438fb];return _0x2606b1;};'use strict';var _=require(_0xcdbf('0x0'));var util=require(_0xcdbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcdbf('0x2'));var fs=require('fs');var Redis=require(_0xcdbf('0x3'));var db=require(_0xcdbf('0x4'))['db'];var utils=require(_0xcdbf('0x5'));var logger=require(_0xcdbf('0x6'))(_0xcdbf('0x7'));var config=require(_0xcdbf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcdbf('0x9')][_0xcdbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54aeaf,_0x369d61,_0x3c077d){return new BPromise(function(_0x409a4e,_0xf4dfb5){return client['request'](_0x54aeaf,_0x3c077d)[_0xcdbf('0xb')](function(_0x30e0a4){logger[_0xcdbf('0xc')](_0xcdbf('0xd'),_0x369d61,_0xcdbf('0xe'));logger['debug'](_0xcdbf('0xf'),_0x369d61,'request\x20sent',JSON[_0xcdbf('0x10')](_0x30e0a4));if(_0x30e0a4['error']){if(_0x30e0a4[_0xcdbf('0x11')]['code']===0x1f4){logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x30e0a4[_0xcdbf('0x11')]['message']);return _0xf4dfb5(_0x30e0a4[_0xcdbf('0x11')]['message']);}logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x30e0a4[_0xcdbf('0x11')][_0xcdbf('0x12')]);return _0x409a4e(_0x30e0a4[_0xcdbf('0x11')]['message']);}else{logger[_0xcdbf('0xc')](_0xcdbf('0xd'),_0x369d61,_0xcdbf('0xe'));_0x409a4e(_0x30e0a4[_0xcdbf('0x13')][_0xcdbf('0x12')]);}})[_0xcdbf('0x14')](function(_0x19b5bd){logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x19b5bd);_0xf4dfb5(_0x19b5bd);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','Migration,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x11b51f,_0x54280a){var _0x489282=function(_0x2224c0){while(--_0x2224c0){_0x11b51f['push'](_0x11b51f['shift']());}};_0x489282(++_0x54280a);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('Migration,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('Migration,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('Migration,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('Migration,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 12f7556..f76fdf3 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 _0x06ae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','update','destroy','util','path'];(function(_0x498ac3,_0x375d18){var _0x55ea69=function(_0x45b946){while(--_0x45b946){_0x498ac3['push'](_0x498ac3['shift']());}};_0x55ea69(++_0x375d18);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xe06a('0x0'));var path=require(_0xe06a('0x1'));var timeout=require(_0xe06a('0x2'));var express=require(_0xe06a('0x3'));var router=express[_0xe06a('0x4')]();var fs_extra=require(_0xe06a('0x5'));var auth=require(_0xe06a('0x6'));var interaction=require(_0xe06a('0x7'));var config=require(_0xe06a('0x8'));var controller=require('./network.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe06a('0x9')]);router[_0xe06a('0xa')](_0xe06a('0xb'),auth[_0xe06a('0xc')](),controller[_0xe06a('0xd')]);router['post']('/',auth[_0xe06a('0xc')](),controller['create']);router['put'](_0xe06a('0xb'),auth['isAuthenticated'](),controller[_0xe06a('0xe')]);router['delete']('/:id',auth[_0xe06a('0xc')](),controller[_0xe06a('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd906=['show','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated'];(function(_0x3e47df,_0xea5c36){var _0x58fa13=function(_0x43290d){while(--_0x43290d){_0x3e47df['push'](_0x3e47df['shift']());}};_0x58fa13(++_0xea5c36);}(_0xd906,0x6b));var _0x6d90=function(_0x3a8128,_0x4b3ae2){_0x3a8128=_0x3a8128-0x0;var _0x934bbb=_0xd906[_0x3a8128];return _0x934bbb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d90('0x0'));var timeout=require(_0x6d90('0x1'));var express=require(_0x6d90('0x2'));var router=express[_0x6d90('0x3')]();var fs_extra=require(_0x6d90('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6d90('0x5'));var config=require(_0x6d90('0x6'));var controller=require(_0x6d90('0x7'));router[_0x6d90('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d90('0x9')]);router[_0x6d90('0x8')](_0x6d90('0xa'),auth[_0x6d90('0xb')](),controller[_0x6d90('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6d90('0xd')](_0x6d90('0xa'),auth[_0x6d90('0xb')](),controller[_0x6d90('0xe')]);router[_0x6d90('0xf')](_0x6d90('0xa'),auth[_0x6d90('0xb')](),controller['destroy']);module[_0x6d90('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index c7b9e5d..ddc79a0 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 _0xf5c0=['exports','ENUM','externip','turn','STRING','sequelize'];(function(_0x4ae404,_0x4ca72d){var _0x45ddcd=function(_0x3f29ab){while(--_0x3f29ab){_0x4ae404['push'](_0x4ae404['shift']());}};_0x45ddcd(++_0x4ca72d);}(_0xf5c0,0x1eb));var _0x0f5c=function(_0x2c1ddd,_0x2a667f){_0x2c1ddd=_0x2c1ddd-0x0;var _0x49fa39=_0xf5c0[_0x2c1ddd];return _0x49fa39;};'use strict';var Sequelize=require(_0x0f5c('0x0'));module[_0x0f5c('0x1')]={'type':{'type':Sequelize[_0x0f5c('0x2')]('localnet',_0x0f5c('0x3'),'stun',_0x0f5c('0x4'))},'value':{'type':Sequelize[_0x0f5c('0x5')]},'username':{'type':Sequelize[_0x0f5c('0x5')]},'password':{'type':Sequelize[_0x0f5c('0x5')]}}; \ No newline at end of file +var _0x7ac5=['exports','ENUM','externip','stun','turn','STRING','sequelize'];(function(_0x41f9e5,_0x5974dd){var _0x14aec2=function(_0x158520){while(--_0x158520){_0x41f9e5['push'](_0x41f9e5['shift']());}};_0x14aec2(++_0x5974dd);}(_0x7ac5,0x68));var _0x57ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ac5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x57ac('0x0'));module[_0x57ac('0x1')]={'type':{'type':Sequelize[_0x57ac('0x2')]('localnet',_0x57ac('0x3'),_0x57ac('0x4'),_0x57ac('0x5'))},'value':{'type':Sequelize[_0x57ac('0x6')]},'username':{'type':Sequelize[_0x57ac('0x6')]},'password':{'type':Sequelize[_0x57ac('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 62d16bc..8f70e4b 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 _0xb172=['rows','show','params','rawAttributes','keys','model','find','create','body','findAll','type','toUpperCase','STUN','join','root','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','destroy','format','util','path','ejs','lodash','../../config/logger','api','../../config/environment','jayson/promise','client','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','set','Content-Range','update','then','end','sendStatus','stack','send','index','Network','fieldName','key','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x5ac8e5,_0x1501ea){var _0x30ef90=function(_0x56bc9a){while(--_0x56bc9a){_0x5ac8e5['push'](_0x5ac8e5['shift']());}};_0x30ef90(++_0x1501ea);}(_0xb172,0x17c));var _0x2b17=function(_0x213226,_0x18ecc7){_0x213226=_0x213226-0x0;var _0x3e5646=_0xb172[_0x213226];return _0x3e5646;};'use strict';var util=require(_0x2b17('0x0'));var path=require(_0x2b17('0x1'));var ejs=require(_0x2b17('0x2'));var fs=require('fs');var _=require(_0x2b17('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x2b17('0x4'))(_0x2b17('0x5'));var config=require(_0x2b17('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2b17('0x7'));var client=jayson[_0x2b17('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcbe35d,_0x6f76b1,_0x188629,_0x1b4791){return new Promise(function(_0xb42f41,_0x509199){var _0x94cf3b=_0x1b4791||client;return _0x94cf3b['request'](_0xcbe35d,_0x188629)['then'](function(_0x4f5f05){logger[_0x2b17('0x9')]('Network,\x20%s,\x20%s',_0x6f76b1,_0x2b17('0xa'));logger['debug'](_0x2b17('0xb'),_0x6f76b1,'request\x20sent',JSON[_0x2b17('0xc')](_0x4f5f05));if(_0x4f5f05[_0x2b17('0xd')]){if(_0x4f5f05[_0x2b17('0xd')]['code']===0x1f4){logger[_0x2b17('0xd')](_0x2b17('0xe'),_0x6f76b1,_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);return _0x509199(_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);}logger[_0x2b17('0xd')](_0x2b17('0xe'),_0x6f76b1,_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);return _0xb42f41(_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);}else{logger['info'](_0x2b17('0xe'),_0x6f76b1,_0x2b17('0xa'));_0xb42f41(_0x4f5f05[_0x2b17('0x10')][_0x2b17('0xf')]);}})[_0x2b17('0x11')](function(_0x1d8b53){logger[_0x2b17('0xd')](_0x2b17('0xe'),_0x6f76b1,_0x1d8b53);_0x509199(_0x1d8b53);});});}function respondWithResult(_0x139c18,_0x5c63cd){_0x5c63cd=_0x5c63cd||0xc8;return function(_0x109682){if(_0x109682){return _0x139c18[_0x2b17('0x12')](_0x5c63cd)[_0x2b17('0x13')](_0x109682);}};}function respondWithFilteredResult(_0x5d0a38,_0x3af5cb){return function(_0x585ec7){if(_0x585ec7){var _0x45a4fa=typeof _0x3af5cb[_0x2b17('0x14')]===_0x2b17('0x15')&&typeof _0x3af5cb['limit']==='undefined';var _0x4b6783=_0x585ec7[_0x2b17('0x16')];var _0x5d2af7=_0x45a4fa?0x0:_0x3af5cb[_0x2b17('0x14')];var _0x5776a8=_0x45a4fa?_0x585ec7[_0x2b17('0x16')]:_0x3af5cb['offset']+_0x3af5cb['limit'];var _0x5eb618;if(_0x5776a8>=_0x4b6783){_0x5776a8=_0x4b6783;_0x5eb618=0xc8;}else{_0x5eb618=0xce;}_0x5d0a38[_0x2b17('0x12')](_0x5eb618);return _0x5d0a38[_0x2b17('0x17')](_0x2b17('0x18'),_0x5d2af7+'-'+_0x5776a8+'/'+_0x4b6783)['json'](_0x585ec7);}return null;};}function saveUpdates(_0x4d850c){return function(_0x120a3d){if(_0x120a3d){return _0x120a3d[_0x2b17('0x19')](_0x4d850c)['then'](function(_0x35e7ab){return _0x35e7ab;});}return null;};}function removeEntity(_0x50829d){return function(_0x2cbca2){if(_0x2cbca2){return _0x2cbca2['destroy']()[_0x2b17('0x1a')](function(){_0x50829d['status'](0xcc)[_0x2b17('0x1b')]();});}};}function handleEntityNotFound(_0x312390){return function(_0xafc9d2){if(!_0xafc9d2){_0x312390[_0x2b17('0x1c')](0x194);}return _0xafc9d2;};}function handleError(_0x568546,_0x3a682b){_0x3a682b=_0x3a682b||0x1f4;return function(_0x32746e){logger[_0x2b17('0xd')](_0x32746e[_0x2b17('0x1d')]);if(_0x32746e['name']){delete _0x32746e['name'];}_0x568546[_0x2b17('0x12')](_0x3a682b)[_0x2b17('0x1e')](_0x32746e);};}exports[_0x2b17('0x1f')]=function(_0x244929,_0xb6f54a){var _0xa3f9f5={},_0x41e7d4={},_0x1d6d0e={'count':0x0,'rows':[]};var _0x206a52=_['map'](db[_0x2b17('0x20')]['rawAttributes'],function(_0x54833e){return{'name':_0x54833e[_0x2b17('0x21')],'type':_0x54833e['type'][_0x2b17('0x22')]};});_0x41e7d4['model']=_[_0x2b17('0x23')](_0x206a52,_0x2b17('0x24'));_0x41e7d4[_0x2b17('0x25')]=_['keys'](_0x244929[_0x2b17('0x25')]);_0x41e7d4[_0x2b17('0x26')]=_[_0x2b17('0x27')](_0x41e7d4['model'],_0x41e7d4['query']);_0xa3f9f5[_0x2b17('0x28')]=_[_0x2b17('0x27')](_0x41e7d4['model'],qs[_0x2b17('0x29')](_0x244929['query'][_0x2b17('0x29')]));_0xa3f9f5['attributes']=_0xa3f9f5[_0x2b17('0x28')][_0x2b17('0x2a')]?_0xa3f9f5[_0x2b17('0x28')]:_0x41e7d4['model'];if(!_0x244929[_0x2b17('0x25')][_0x2b17('0x2b')](_0x2b17('0x2c'))){_0xa3f9f5[_0x2b17('0x2d')]=qs['limit'](_0x244929[_0x2b17('0x25')][_0x2b17('0x2d')]);_0xa3f9f5[_0x2b17('0x14')]=qs[_0x2b17('0x14')](_0x244929['query'][_0x2b17('0x14')]);}_0xa3f9f5[_0x2b17('0x2e')]=qs[_0x2b17('0x2f')](_0x244929[_0x2b17('0x25')][_0x2b17('0x2f')]);_0xa3f9f5[_0x2b17('0x30')]=qs[_0x2b17('0x26')](_[_0x2b17('0x31')](_0x244929['query'],_0x41e7d4[_0x2b17('0x26')]),_0x206a52);if(_0x244929[_0x2b17('0x25')][_0x2b17('0x32')]){_0xa3f9f5[_0x2b17('0x30')]=_[_0x2b17('0x33')](_0xa3f9f5['where'],{'$or':_[_0x2b17('0x23')](_0x206a52,function(_0x209d6d){if(_0x209d6d['type']!=='VIRTUAL'){var _0x43d30c={};_0x43d30c[_0x209d6d[_0x2b17('0x24')]]={'$like':'%'+_0x244929[_0x2b17('0x25')]['filter']+'%'};return _0x43d30c;}})});}_0xa3f9f5=_[_0x2b17('0x33')]({},_0xa3f9f5,_0x244929[_0x2b17('0x34')]);var _0x1d9a7d={'where':_0xa3f9f5['where']};return db[_0x2b17('0x20')][_0x2b17('0x16')](_0x1d9a7d)['then'](function(_0x4669ce){_0x1d6d0e['count']=_0x4669ce;if(_0x244929['query'][_0x2b17('0x35')]){_0xa3f9f5[_0x2b17('0x36')]=[{'all':!![]}];}return db['Network']['findAll'](_0xa3f9f5);})[_0x2b17('0x1a')](function(_0x1469e6){_0x1d6d0e[_0x2b17('0x37')]=_0x1469e6;return _0x1d6d0e;})[_0x2b17('0x1a')](respondWithFilteredResult(_0xb6f54a,_0xa3f9f5))[_0x2b17('0x11')](handleError(_0xb6f54a,null));};exports[_0x2b17('0x38')]=function(_0x187407,_0x49d2ee){var _0x4b2081={'raw':!![],'where':{'id':_0x187407[_0x2b17('0x39')]['id']}},_0x4dacc7={};_0x4dacc7['model']=_['keys'](db[_0x2b17('0x20')][_0x2b17('0x3a')]);_0x4dacc7[_0x2b17('0x25')]=_[_0x2b17('0x3b')](_0x187407[_0x2b17('0x25')]);_0x4dacc7[_0x2b17('0x26')]=_[_0x2b17('0x27')](_0x4dacc7[_0x2b17('0x3c')],_0x4dacc7[_0x2b17('0x25')]);_0x4b2081[_0x2b17('0x28')]=_[_0x2b17('0x27')](_0x4dacc7[_0x2b17('0x3c')],qs['fields'](_0x187407[_0x2b17('0x25')][_0x2b17('0x29')]));_0x4b2081[_0x2b17('0x28')]=_0x4b2081['attributes']['length']?_0x4b2081[_0x2b17('0x28')]:_0x4dacc7[_0x2b17('0x3c')];if(_0x187407['query'][_0x2b17('0x35')]){_0x4b2081[_0x2b17('0x36')]=[{'all':!![]}];}_0x4b2081=_['merge']({},_0x4b2081,_0x187407[_0x2b17('0x34')]);return db[_0x2b17('0x20')][_0x2b17('0x3d')](_0x4b2081)['then'](handleEntityNotFound(_0x49d2ee,null))[_0x2b17('0x1a')](respondWithResult(_0x49d2ee,null))[_0x2b17('0x11')](handleError(_0x49d2ee,null));};exports[_0x2b17('0x3e')]=function(_0x28c707,_0xc04b17){var _0x13cd2a;return db[_0x2b17('0x20')][_0x2b17('0x3e')](_0x28c707[_0x2b17('0x3f')],{'raw':!![]})['then'](function(_0x23f364){_0x13cd2a=_0x23f364;return db[_0x2b17('0x20')][_0x2b17('0x40')]({'where':{'type':_0x28c707[_0x2b17('0x3f')][_0x2b17('0x41')]},'raw':!![]});})[_0x2b17('0x1a')](function(_0x3ec5f){if(_0x13cd2a['type'][_0x2b17('0x42')]()==_0x2b17('0x43')){var _0xb53c4a=fs['readFileSync'](path[_0x2b17('0x44')](config[_0x2b17('0x45')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x2d8317=ejs[_0x2b17('0x46')](_0xb53c4a,{'networks':_0x3ec5f||[]});fs['writeFileSync'](_0x2b17('0x47'),_0x2d8317);return respondWithRpcPromise('Reload','create',{'module':_0x2b17('0x48')});}else if(_0x13cd2a[_0x2b17('0x41')]['toUpperCase']()==_0x2b17('0x49')){var _0x530f3a=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x2b17('0x4b'));var _0x4617a3=ejs[_0x2b17('0x46')](_0x530f3a,{'networks':_0x3ec5f||[]});fs[_0x2b17('0x4c')](_0x2b17('0x4d'),_0x4617a3);return respondWithRpcPromise('Reload',_0x2b17('0x3e'),{'module':_0x2b17('0x48')});}else{var _0xa752c5=fs['readFileSync'](path[_0x2b17('0x44')](config[_0x2b17('0x45')],'server/files/templates/network.ejs'),'utf8');var _0x5c6407=ejs['render'](_0xa752c5,{'networks':_0x3ec5f||[]});fs[_0x2b17('0x4c')](util['format'](_0x2b17('0x4e'),_0x28c707['body'][_0x2b17('0x41')][_0x2b17('0x4f')]()),_0x5c6407);return respondWithRpcPromise(_0x2b17('0x50'),_0x2b17('0x3e'),{'module':_0x2b17('0x51')});}})[_0x2b17('0x1a')](function(){return _0x13cd2a;})[_0x2b17('0x1a')](respondWithResult(_0xc04b17,0xc9))[_0x2b17('0x11')](handleError(_0xc04b17,null));};exports[_0x2b17('0x19')]=function(_0x5c8853,_0x4e6141){var _0x62480a;return db[_0x2b17('0x20')][_0x2b17('0x3d')]({'where':{'id':_0x5c8853[_0x2b17('0x39')]['id']}})[_0x2b17('0x1a')](handleEntityNotFound(_0x4e6141,null))[_0x2b17('0x1a')](saveUpdates(_0x5c8853[_0x2b17('0x3f')],null))[_0x2b17('0x1a')](function(_0x538ba0){if(_0x538ba0){_0x62480a=_0x538ba0;return db[_0x2b17('0x20')][_0x2b17('0x40')]({'where':{'type':_0x62480a['type']},'raw':!![]});}return null;})[_0x2b17('0x1a')](function(_0x332ff5){if(_0x62480a[_0x2b17('0x41')][_0x2b17('0x42')]()=='STUN'){var _0x1fd73f=fs[_0x2b17('0x4a')](path['join'](config[_0x2b17('0x45')],_0x2b17('0x52')),_0x2b17('0x4b'));var _0x3fbb5a=ejs[_0x2b17('0x46')](_0x1fd73f,{'networks':_0x332ff5||[]});fs[_0x2b17('0x4c')]('/etc/asterisk/stun_xcally.conf',_0x3fbb5a);return respondWithRpcPromise(_0x2b17('0x50'),'update',{'module':_0x2b17('0x48')});}else if(_0x62480a[_0x2b17('0x41')][_0x2b17('0x42')]()==_0x2b17('0x49')){var _0x44cbc2=fs[_0x2b17('0x4a')](path['join'](config[_0x2b17('0x45')],_0x2b17('0x53')),_0x2b17('0x4b'));var _0x217282=ejs[_0x2b17('0x46')](_0x44cbc2,{'networks':_0x332ff5||[]});fs[_0x2b17('0x4c')](_0x2b17('0x4d'),_0x217282);return respondWithRpcPromise('Reload','update',{'module':_0x2b17('0x48')});}else{var _0x904a93=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config[_0x2b17('0x45')],_0x2b17('0x54')),_0x2b17('0x4b'));var _0x3a5885=ejs[_0x2b17('0x46')](_0x904a93,{'networks':_0x332ff5||[]});fs[_0x2b17('0x4c')](util['format'](_0x2b17('0x4e'),_0x5c8853['body'][_0x2b17('0x41')][_0x2b17('0x4f')]()),_0x3a5885);return respondWithRpcPromise(_0x2b17('0x50'),_0x2b17('0x19'),{'module':'chan_sip.so'});}})['then'](function(_0x5d7ab5){if(_0x5d7ab5){return _0x62480a;}return null;})[_0x2b17('0x1a')](respondWithResult(_0x4e6141,null))[_0x2b17('0x11')](handleError(_0x4e6141,null));};exports['destroy']=function(_0x45783e,_0x312272){var _0x37626e;return db[_0x2b17('0x20')]['find']({'where':{'id':_0x45783e['params']['id']}})[_0x2b17('0x1a')](function(_0x26c524){_0x37626e=_0x26c524;return _0x26c524;})[_0x2b17('0x1a')](handleEntityNotFound(_0x312272,null))['then'](removeEntity(_0x312272,null))[_0x2b17('0x1a')](function(){if(_0x37626e){return db[_0x2b17('0x20')][_0x2b17('0x40')]({'where':{'type':_0x37626e[_0x2b17('0x41')]},'raw':!![]});}})[_0x2b17('0x1a')](function(_0x27c469){if(_0x37626e[_0x2b17('0x41')][_0x2b17('0x42')]()==_0x2b17('0x43')){var _0x553989=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config[_0x2b17('0x45')],'server/files/templates/stun_multiple.ejs'),_0x2b17('0x4b'));var _0x57e1f8=ejs[_0x2b17('0x46')](_0x553989,{'networks':_0x27c469||[]});fs[_0x2b17('0x4c')](_0x2b17('0x47'),_0x57e1f8);return respondWithRpcPromise('Reload','destroy',{'module':_0x2b17('0x48')});}else if(_0x37626e['type'][_0x2b17('0x42')]()=='TURN'){var _0x3fc003=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config['root'],_0x2b17('0x53')),_0x2b17('0x4b'));var _0x4477fc=ejs[_0x2b17('0x46')](_0x3fc003,{'networks':_0x27c469||[]});fs[_0x2b17('0x4c')](_0x2b17('0x4d'),_0x4477fc);return respondWithRpcPromise(_0x2b17('0x50'),_0x2b17('0x55'),{'module':_0x2b17('0x48')});}else{var _0x26cf40=fs[_0x2b17('0x4a')](path['join'](config[_0x2b17('0x45')],_0x2b17('0x54')),_0x2b17('0x4b'));var _0x1f9041=ejs[_0x2b17('0x46')](_0x26cf40,{'networks':_0x27c469||[]});fs[_0x2b17('0x4c')](util[_0x2b17('0x56')]('/etc/asterisk/sip_xcally_%s.conf',_0x37626e['type']['toLowerCase']()),_0x1f9041);return respondWithRpcPromise('Reload',_0x2b17('0x55'),{'module':_0x2b17('0x51')});}})[_0x2b17('0x11')](handleError(_0x312272,null));}; \ No newline at end of file +var _0xf9fb=['key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','options','create','body','findAll','toUpperCase','STUN','readFileSync','join','root','utf8','writeFileSync','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','chan_sip.so','params','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','destroy','find','util','path','lodash','../../components/parsers/qs','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','offset','undefined','limit','count','status','set','Content-Range','json','update','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type'];(function(_0x15cd66,_0x22aaf2){var _0x3413bd=function(_0x1c0083){while(--_0x1c0083){_0x15cd66['push'](_0x15cd66['shift']());}};_0x3413bd(++_0x22aaf2);}(_0xf9fb,0xdb));var _0xbf9f=function(_0x3f5d88,_0x3d4ebb){_0x3f5d88=_0x3f5d88-0x0;var _0x520071=_0xf9fb[_0x3f5d88];return _0x520071;};'use strict';var util=require(_0xbf9f('0x0'));var path=require(_0xbf9f('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf9f('0x2'));var qs=require(_0xbf9f('0x3'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xbf9f('0x4'))['db'];var jayson=require(_0xbf9f('0x5'));var client=jayson[_0xbf9f('0x6')][_0xbf9f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31aeaa,_0x2a625c,_0x3a4934,_0x5d1669){return new Promise(function(_0x490c8e,_0x5268e3){var _0x538b93=_0x5d1669||client;return _0x538b93[_0xbf9f('0x8')](_0x31aeaa,_0x3a4934)[_0xbf9f('0x9')](function(_0x223287){logger[_0xbf9f('0xa')](_0xbf9f('0xb'),_0x2a625c,_0xbf9f('0xc'));logger[_0xbf9f('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x2a625c,_0xbf9f('0xc'),JSON[_0xbf9f('0xe')](_0x223287));if(_0x223287[_0xbf9f('0xf')]){if(_0x223287[_0xbf9f('0xf')]['code']===0x1f4){logger['error'](_0xbf9f('0xb'),_0x2a625c,_0x223287['error'][_0xbf9f('0x10')]);return _0x5268e3(_0x223287[_0xbf9f('0xf')]['message']);}logger[_0xbf9f('0xf')](_0xbf9f('0xb'),_0x2a625c,_0x223287[_0xbf9f('0xf')][_0xbf9f('0x10')]);return _0x490c8e(_0x223287['error']['message']);}else{logger[_0xbf9f('0xa')](_0xbf9f('0xb'),_0x2a625c,_0xbf9f('0xc'));_0x490c8e(_0x223287[_0xbf9f('0x11')][_0xbf9f('0x10')]);}})[_0xbf9f('0x12')](function(_0x4b80b5){logger['error']('Network,\x20%s,\x20%s',_0x2a625c,_0x4b80b5);_0x5268e3(_0x4b80b5);});});}function respondWithResult(_0x4a8e3d,_0x3ca390){_0x3ca390=_0x3ca390||0xc8;return function(_0x17cbec){if(_0x17cbec){return _0x4a8e3d['status'](_0x3ca390)['json'](_0x17cbec);}};}function respondWithFilteredResult(_0x3a9102,_0x182bec){return function(_0x14dce9){if(_0x14dce9){var _0x1ad540=typeof _0x182bec[_0xbf9f('0x13')]===_0xbf9f('0x14')&&typeof _0x182bec[_0xbf9f('0x15')]===_0xbf9f('0x14');var _0x1ad201=_0x14dce9['count'];var _0x3ac744=_0x1ad540?0x0:_0x182bec['offset'];var _0xcd6cb4=_0x1ad540?_0x14dce9[_0xbf9f('0x16')]:_0x182bec[_0xbf9f('0x13')]+_0x182bec[_0xbf9f('0x15')];var _0x52802f;if(_0xcd6cb4>=_0x1ad201){_0xcd6cb4=_0x1ad201;_0x52802f=0xc8;}else{_0x52802f=0xce;}_0x3a9102[_0xbf9f('0x17')](_0x52802f);return _0x3a9102[_0xbf9f('0x18')](_0xbf9f('0x19'),_0x3ac744+'-'+_0xcd6cb4+'/'+_0x1ad201)[_0xbf9f('0x1a')](_0x14dce9);}return null;};}function saveUpdates(_0x53fee9){return function(_0x26fe67){if(_0x26fe67){return _0x26fe67[_0xbf9f('0x1b')](_0x53fee9)[_0xbf9f('0x9')](function(_0xecdcde){return _0xecdcde;});}return null;};}function removeEntity(_0x564efb){return function(_0x5b446b){if(_0x5b446b){return _0x5b446b['destroy']()[_0xbf9f('0x9')](function(){_0x564efb[_0xbf9f('0x17')](0xcc)[_0xbf9f('0x1c')]();});}};}function handleEntityNotFound(_0x41d1bc){return function(_0x3cdd6e){if(!_0x3cdd6e){_0x41d1bc[_0xbf9f('0x1d')](0x194);}return _0x3cdd6e;};}function handleError(_0x182b96,_0x4abee4){_0x4abee4=_0x4abee4||0x1f4;return function(_0x19ca9e){logger[_0xbf9f('0xf')](_0x19ca9e[_0xbf9f('0x1e')]);if(_0x19ca9e[_0xbf9f('0x1f')]){delete _0x19ca9e[_0xbf9f('0x1f')];}_0x182b96['status'](_0x4abee4)[_0xbf9f('0x20')](_0x19ca9e);};}exports[_0xbf9f('0x21')]=function(_0x512a27,_0x13c1cd){var _0x58ff15={},_0x14186e={},_0x5b994c={'count':0x0,'rows':[]};var _0x4bc3ec=_[_0xbf9f('0x22')](db[_0xbf9f('0x23')][_0xbf9f('0x24')],function(_0x3cf195){return{'name':_0x3cf195[_0xbf9f('0x25')],'type':_0x3cf195[_0xbf9f('0x26')][_0xbf9f('0x27')]};});_0x14186e['model']=_['map'](_0x4bc3ec,_0xbf9f('0x1f'));_0x14186e['query']=_[_0xbf9f('0x28')](_0x512a27[_0xbf9f('0x29')]);_0x14186e[_0xbf9f('0x2a')]=_[_0xbf9f('0x2b')](_0x14186e[_0xbf9f('0x2c')],_0x14186e[_0xbf9f('0x29')]);_0x58ff15['attributes']=_[_0xbf9f('0x2b')](_0x14186e['model'],qs['fields'](_0x512a27[_0xbf9f('0x29')][_0xbf9f('0x2d')]));_0x58ff15[_0xbf9f('0x2e')]=_0x58ff15[_0xbf9f('0x2e')][_0xbf9f('0x2f')]?_0x58ff15['attributes']:_0x14186e[_0xbf9f('0x2c')];if(!_0x512a27['query'][_0xbf9f('0x30')](_0xbf9f('0x31'))){_0x58ff15[_0xbf9f('0x15')]=qs[_0xbf9f('0x15')](_0x512a27['query'][_0xbf9f('0x15')]);_0x58ff15[_0xbf9f('0x13')]=qs[_0xbf9f('0x13')](_0x512a27[_0xbf9f('0x29')][_0xbf9f('0x13')]);}_0x58ff15['order']=qs[_0xbf9f('0x32')](_0x512a27['query']['sort']);_0x58ff15[_0xbf9f('0x33')]=qs['filters'](_[_0xbf9f('0x34')](_0x512a27[_0xbf9f('0x29')],_0x14186e[_0xbf9f('0x2a')]),_0x4bc3ec);if(_0x512a27['query'][_0xbf9f('0x35')]){_0x58ff15[_0xbf9f('0x33')]=_[_0xbf9f('0x36')](_0x58ff15[_0xbf9f('0x33')],{'$or':_[_0xbf9f('0x22')](_0x4bc3ec,function(_0xc2f8dd){if(_0xc2f8dd[_0xbf9f('0x26')]!==_0xbf9f('0x37')){var _0x355213={};_0x355213[_0xc2f8dd[_0xbf9f('0x1f')]]={'$like':'%'+_0x512a27[_0xbf9f('0x29')]['filter']+'%'};return _0x355213;}})});}_0x58ff15=_[_0xbf9f('0x36')]({},_0x58ff15,_0x512a27['options']);var _0x113dbe={'where':_0x58ff15[_0xbf9f('0x33')]};return db['Network'][_0xbf9f('0x16')](_0x113dbe)[_0xbf9f('0x9')](function(_0x4ab3f4){_0x5b994c[_0xbf9f('0x16')]=_0x4ab3f4;if(_0x512a27[_0xbf9f('0x29')][_0xbf9f('0x38')]){_0x58ff15[_0xbf9f('0x39')]=[{'all':!![]}];}return db[_0xbf9f('0x23')]['findAll'](_0x58ff15);})[_0xbf9f('0x9')](function(_0x116c08){_0x5b994c[_0xbf9f('0x3a')]=_0x116c08;return _0x5b994c;})[_0xbf9f('0x9')](respondWithFilteredResult(_0x13c1cd,_0x58ff15))[_0xbf9f('0x12')](handleError(_0x13c1cd,null));};exports[_0xbf9f('0x3b')]=function(_0x1e07be,_0xb1ffdf){var _0x1e14f3={'raw':!![],'where':{'id':_0x1e07be['params']['id']}},_0x4e4016={};_0x4e4016[_0xbf9f('0x2c')]=_[_0xbf9f('0x28')](db['Network'][_0xbf9f('0x24')]);_0x4e4016[_0xbf9f('0x29')]=_[_0xbf9f('0x28')](_0x1e07be[_0xbf9f('0x29')]);_0x4e4016[_0xbf9f('0x2a')]=_['intersection'](_0x4e4016[_0xbf9f('0x2c')],_0x4e4016[_0xbf9f('0x29')]);_0x1e14f3[_0xbf9f('0x2e')]=_[_0xbf9f('0x2b')](_0x4e4016[_0xbf9f('0x2c')],qs['fields'](_0x1e07be[_0xbf9f('0x29')]['fields']));_0x1e14f3['attributes']=_0x1e14f3['attributes'][_0xbf9f('0x2f')]?_0x1e14f3[_0xbf9f('0x2e')]:_0x4e4016['model'];if(_0x1e07be['query'][_0xbf9f('0x38')]){_0x1e14f3[_0xbf9f('0x39')]=[{'all':!![]}];}_0x1e14f3=_[_0xbf9f('0x36')]({},_0x1e14f3,_0x1e07be[_0xbf9f('0x3c')]);return db[_0xbf9f('0x23')]['find'](_0x1e14f3)[_0xbf9f('0x9')](handleEntityNotFound(_0xb1ffdf,null))['then'](respondWithResult(_0xb1ffdf,null))[_0xbf9f('0x12')](handleError(_0xb1ffdf,null));};exports[_0xbf9f('0x3d')]=function(_0x31a6a2,_0x5abad1){var _0x3d7541;return db[_0xbf9f('0x23')][_0xbf9f('0x3d')](_0x31a6a2[_0xbf9f('0x3e')],{'raw':!![]})['then'](function(_0x1c4d1c){_0x3d7541=_0x1c4d1c;return db['Network'][_0xbf9f('0x3f')]({'where':{'type':_0x31a6a2[_0xbf9f('0x3e')][_0xbf9f('0x26')]},'raw':!![]});})[_0xbf9f('0x9')](function(_0x4680c9){if(_0x3d7541[_0xbf9f('0x26')][_0xbf9f('0x40')]()==_0xbf9f('0x41')){var _0x593710=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],'server/files/templates/stun_multiple.ejs'),_0xbf9f('0x45'));var _0x14a5ac=ejs['render'](_0x593710,{'networks':_0x4680c9||[]});fs[_0xbf9f('0x46')]('/etc/asterisk/stun_xcally.conf',_0x14a5ac);return respondWithRpcPromise(_0xbf9f('0x47'),_0xbf9f('0x3d'),{'module':_0xbf9f('0x48')});}else if(_0x3d7541['type'][_0xbf9f('0x40')]()=='TURN'){var _0x360a53=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],_0xbf9f('0x49')),'utf8');var _0x1610a0=ejs[_0xbf9f('0x4a')](_0x360a53,{'networks':_0x4680c9||[]});fs[_0xbf9f('0x46')](_0xbf9f('0x4b'),_0x1610a0);return respondWithRpcPromise(_0xbf9f('0x47'),'create',{'module':_0xbf9f('0x48')});}else{var _0x433f2d=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],'server/files/templates/network.ejs'),_0xbf9f('0x45'));var _0x4e3088=ejs[_0xbf9f('0x4a')](_0x433f2d,{'networks':_0x4680c9||[]});fs[_0xbf9f('0x46')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x31a6a2[_0xbf9f('0x3e')]['type']['toLowerCase']()),_0x4e3088);return respondWithRpcPromise('Reload','create',{'module':_0xbf9f('0x4c')});}})[_0xbf9f('0x9')](function(){return _0x3d7541;})['then'](respondWithResult(_0x5abad1,0xc9))['catch'](handleError(_0x5abad1,null));};exports['update']=function(_0x49e279,_0x2617a4){var _0x3e5f87;return db[_0xbf9f('0x23')]['find']({'where':{'id':_0x49e279[_0xbf9f('0x4d')]['id']}})[_0xbf9f('0x9')](handleEntityNotFound(_0x2617a4,null))[_0xbf9f('0x9')](saveUpdates(_0x49e279[_0xbf9f('0x3e')],null))[_0xbf9f('0x9')](function(_0x1ab388){if(_0x1ab388){_0x3e5f87=_0x1ab388;return db[_0xbf9f('0x23')][_0xbf9f('0x3f')]({'where':{'type':_0x3e5f87[_0xbf9f('0x26')]},'raw':!![]});}return null;})[_0xbf9f('0x9')](function(_0x339975){if(_0x3e5f87[_0xbf9f('0x26')]['toUpperCase']()==_0xbf9f('0x41')){var _0x3a9500=fs['readFileSync'](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],_0xbf9f('0x4e')),_0xbf9f('0x45'));var _0x52a42e=ejs[_0xbf9f('0x4a')](_0x3a9500,{'networks':_0x339975||[]});fs[_0xbf9f('0x46')](_0xbf9f('0x4f'),_0x52a42e);return respondWithRpcPromise(_0xbf9f('0x47'),_0xbf9f('0x1b'),{'module':'res_stun_monitor.so'});}else if(_0x3e5f87[_0xbf9f('0x26')]['toUpperCase']()=='TURN'){var _0x472a22=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],_0xbf9f('0x49')),_0xbf9f('0x45'));var _0x34bea9=ejs[_0xbf9f('0x4a')](_0x472a22,{'networks':_0x339975||[]});fs['writeFileSync'](_0xbf9f('0x4b'),_0x34bea9);return respondWithRpcPromise(_0xbf9f('0x47'),_0xbf9f('0x1b'),{'module':_0xbf9f('0x48')});}else{var _0x8b2210=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],_0xbf9f('0x50')),_0xbf9f('0x45'));var _0x57f638=ejs[_0xbf9f('0x4a')](_0x8b2210,{'networks':_0x339975||[]});fs[_0xbf9f('0x46')](util[_0xbf9f('0x51')](_0xbf9f('0x52'),_0x49e279[_0xbf9f('0x3e')]['type'][_0xbf9f('0x53')]()),_0x57f638);return respondWithRpcPromise(_0xbf9f('0x47'),'update',{'module':_0xbf9f('0x4c')});}})[_0xbf9f('0x9')](function(_0x28b5e3){if(_0x28b5e3){return _0x3e5f87;}return null;})[_0xbf9f('0x9')](respondWithResult(_0x2617a4,null))[_0xbf9f('0x12')](handleError(_0x2617a4,null));};exports[_0xbf9f('0x54')]=function(_0x5423dc,_0x277085){var _0x200a77;return db[_0xbf9f('0x23')][_0xbf9f('0x55')]({'where':{'id':_0x5423dc['params']['id']}})[_0xbf9f('0x9')](function(_0x41565c){_0x200a77=_0x41565c;return _0x41565c;})[_0xbf9f('0x9')](handleEntityNotFound(_0x277085,null))['then'](removeEntity(_0x277085,null))['then'](function(){if(_0x200a77){return db[_0xbf9f('0x23')][_0xbf9f('0x3f')]({'where':{'type':_0x200a77['type']},'raw':!![]});}})['then'](function(_0x5f3668){if(_0x200a77[_0xbf9f('0x26')][_0xbf9f('0x40')]()==_0xbf9f('0x41')){var _0x4d5bf3=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],'server/files/templates/stun_multiple.ejs'),_0xbf9f('0x45'));var _0x57ec4a=ejs[_0xbf9f('0x4a')](_0x4d5bf3,{'networks':_0x5f3668||[]});fs['writeFileSync'](_0xbf9f('0x4f'),_0x57ec4a);return respondWithRpcPromise('Reload',_0xbf9f('0x54'),{'module':_0xbf9f('0x48')});}else if(_0x200a77['type'][_0xbf9f('0x40')]()=='TURN'){var _0x52bbcc=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config[_0xbf9f('0x44')],_0xbf9f('0x49')),_0xbf9f('0x45'));var _0x52a622=ejs[_0xbf9f('0x4a')](_0x52bbcc,{'networks':_0x5f3668||[]});fs[_0xbf9f('0x46')]('/etc/asterisk/turn_xcally.conf',_0x52a622);return respondWithRpcPromise(_0xbf9f('0x47'),_0xbf9f('0x54'),{'module':_0xbf9f('0x48')});}else{var _0x2ba452=fs[_0xbf9f('0x42')](path[_0xbf9f('0x43')](config['root'],_0xbf9f('0x50')),'utf8');var _0x6e3469=ejs[_0xbf9f('0x4a')](_0x2ba452,{'networks':_0x5f3668||[]});fs[_0xbf9f('0x46')](util[_0xbf9f('0x51')](_0xbf9f('0x52'),_0x200a77[_0xbf9f('0x26')][_0xbf9f('0x53')]()),_0x6e3469);return respondWithRpcPromise(_0xbf9f('0x47'),_0xbf9f('0x54'),{'module':_0xbf9f('0x4c')});}})[_0xbf9f('0x12')](handleError(_0x277085,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3ef4baf..74f4d06 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 _0x0506=['network','lodash','util','../../config/logger','path','../../config/environment','define','Network'];(function(_0x1045b5,_0x3736f4){var _0x1fedfe=function(_0xf2c5fc){while(--_0xf2c5fc){_0x1045b5['push'](_0x1045b5['shift']());}};_0x1fedfe(++_0x3736f4);}(_0x0506,0x1d1));var _0x6050=function(_0x20a93c,_0x3d5b50){_0x20a93c=_0x20a93c-0x0;var _0x1abb6a=_0x0506[_0x20a93c];return _0x1abb6a;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var logger=require(_0x6050('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6050('0x3'));var rimraf=require('rimraf');var config=require(_0x6050('0x4'));var attributes=require('./network.attributes');module['exports']=function(_0xfd44cc,_0x269be3){return _0xfd44cc[_0x6050('0x5')](_0x6050('0x6'),attributes,{'tableName':_0x6050('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','../../config/logger','api'];(function(_0x3d7a50,_0xd5f02c){var _0xb8cd1b=function(_0xcf1401){while(--_0xcf1401){_0x3d7a50['push'](_0x3d7a50['shift']());}};_0xb8cd1b(++_0xd5f02c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 53ae817..ef3933b 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x24fe58,_0x266f79){_0x24fe58=_0x24fe58-0x0;var _0x9c8eb7=_0x7a54[_0x24fe58];return _0x9c8eb7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x26b20b,_0x240db6){var _0x3316d0=function(_0x2ccb9f){while(--_0x2ccb9f){_0x26b20b['push'](_0x26b20b['shift']());}};_0x3316d0(++_0x240db6);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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 da976a0..d0afc75 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 _0x9870=['getAgents','post','create','addDisposition','addAnswer','/:id/notify','addApplications','addAgents','/:id/send','send','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users'];(function(_0x23869c,_0x5abf59){var _0x449181=function(_0x2daace){while(--_0x2daace){_0x23869c['push'](_0x23869c['shift']());}};_0x449181(++_0x5abf59);}(_0x9870,0xe4));var _0x0987=function(_0x55b89b,_0x2b35b5){_0x55b89b=_0x55b89b-0x0;var _0x2797c7=_0x9870[_0x55b89b];return _0x2797c7;};'use strict';var multer=require(_0x0987('0x0'));var util=require(_0x0987('0x1'));var path=require(_0x0987('0x2'));var timeout=require(_0x0987('0x3'));var express=require(_0x0987('0x4'));var router=express[_0x0987('0x5')]();var fs_extra=require(_0x0987('0x6'));var auth=require(_0x0987('0x7'));var interaction=require(_0x0987('0x8'));var config=require(_0x0987('0x9'));var controller=require('./openchannelAccount.controller');router[_0x0987('0xa')]('/',auth[_0x0987('0xb')](),controller['index']);router['get'](_0x0987('0xc'),auth[_0x0987('0xb')](),controller[_0x0987('0xd')]);router['get'](_0x0987('0xe'),auth[_0x0987('0xb')](),controller[_0x0987('0xf')]);router['get'](_0x0987('0x10'),auth[_0x0987('0xb')](),controller[_0x0987('0x11')]);router['get'](_0x0987('0x12'),auth[_0x0987('0xb')](),controller[_0x0987('0x13')]);router[_0x0987('0xa')](_0x0987('0x14'),auth['isAuthenticated'](),controller[_0x0987('0x15')]);router['get']('/:id/interactions',auth[_0x0987('0xb')](),controller[_0x0987('0x16')]);router[_0x0987('0xa')](_0x0987('0x17'),auth['isAuthenticated'](),controller[_0x0987('0x18')]);router[_0x0987('0x19')]('/',auth['isAuthenticated'](),controller[_0x0987('0x1a')]);router['post'](_0x0987('0x10'),auth['isAuthenticated'](),controller[_0x0987('0x1b')]);router[_0x0987('0x19')](_0x0987('0x12'),auth[_0x0987('0xb')](),controller[_0x0987('0x1c')]);router[_0x0987('0x19')](_0x0987('0x1d'),controller['notify']);router['post'](_0x0987('0x14'),auth['isAuthenticated'](),controller[_0x0987('0x1e')]);router['post'](_0x0987('0x17'),auth[_0x0987('0xb')](),controller[_0x0987('0x1f')]);router[_0x0987('0x19')](_0x0987('0x20'),auth['isAuthenticated'](),controller[_0x0987('0x21')]);router[_0x0987('0x22')](_0x0987('0xe'),auth['isAuthenticated'](),controller[_0x0987('0x23')]);router['delete'](_0x0987('0xe'),auth[_0x0987('0xb')](),controller[_0x0987('0x24')]);router['delete'](_0x0987('0x10'),auth[_0x0987('0xb')](),controller[_0x0987('0x25')]);router[_0x0987('0x26')](_0x0987('0x12'),auth['isAuthenticated'](),controller[_0x0987('0x27')]);router[_0x0987('0x26')](_0x0987('0x17'),auth['isAuthenticated'](),controller[_0x0987('0x28')]);module[_0x0987('0x29')]=router; \ No newline at end of file +var _0xc51f=['../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','addApplications','addAgents','put','destroy','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2b619f,_0x95d339){var _0x2866fb=function(_0x2f9e00){while(--_0x2f9e00){_0x2b619f['push'](_0x2b619f['shift']());}};_0x2866fb(++_0x95d339);}(_0xc51f,0x18d));var _0xfc51=function(_0x285a14,_0x394a27){_0x285a14=_0x285a14-0x0;var _0x3430cc=_0xc51f[_0x285a14];return _0x3430cc;};'use strict';var multer=require(_0xfc51('0x0'));var util=require('util');var path=require(_0xfc51('0x1'));var timeout=require(_0xfc51('0x2'));var express=require(_0xfc51('0x3'));var router=express[_0xfc51('0x4')]();var fs_extra=require(_0xfc51('0x5'));var auth=require(_0xfc51('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfc51('0x7'));var controller=require('./openchannelAccount.controller');router[_0xfc51('0x8')]('/',auth['isAuthenticated'](),controller[_0xfc51('0x9')]);router[_0xfc51('0x8')](_0xfc51('0xa'),auth[_0xfc51('0xb')](),controller[_0xfc51('0xc')]);router[_0xfc51('0x8')](_0xfc51('0xd'),auth[_0xfc51('0xb')](),controller['show']);router[_0xfc51('0x8')]('/:id/dispositions',auth[_0xfc51('0xb')](),controller['getDispositions']);router[_0xfc51('0x8')]('/:id/canned_answers',auth[_0xfc51('0xb')](),controller['getAnswers']);router['get'](_0xfc51('0xe'),auth[_0xfc51('0xb')](),controller[_0xfc51('0xf')]);router['get'](_0xfc51('0x10'),auth[_0xfc51('0xb')](),controller['getInteractions']);router[_0xfc51('0x8')](_0xfc51('0x11'),auth[_0xfc51('0xb')](),controller[_0xfc51('0x12')]);router['post']('/',auth[_0xfc51('0xb')](),controller['create']);router['post'](_0xfc51('0x13'),auth[_0xfc51('0xb')](),controller[_0xfc51('0x14')]);router[_0xfc51('0x15')](_0xfc51('0x16'),auth[_0xfc51('0xb')](),controller[_0xfc51('0x17')]);router['post']('/:id/notify',controller['notify']);router['post'](_0xfc51('0xe'),auth[_0xfc51('0xb')](),controller[_0xfc51('0x18')]);router[_0xfc51('0x15')](_0xfc51('0x11'),auth['isAuthenticated'](),controller[_0xfc51('0x19')]);router[_0xfc51('0x15')]('/:id/send',auth[_0xfc51('0xb')](),controller['send']);router[_0xfc51('0x1a')](_0xfc51('0xd'),auth[_0xfc51('0xb')](),controller['update']);router['delete'](_0xfc51('0xd'),auth[_0xfc51('0xb')](),controller[_0xfc51('0x1b')]);router[_0xfc51('0x1c')](_0xfc51('0x13'),auth[_0xfc51('0xb')](),controller[_0xfc51('0x1d')]);router[_0xfc51('0x1c')](_0xfc51('0x16'),auth['isAuthenticated'](),controller[_0xfc51('0x1e')]);router['delete'](_0xfc51('0x11'),auth[_0xfc51('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2081346..2206243 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 _0xd8ff=['STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0x2b3cc5,_0x325f34){var _0x378ccb=function(_0x4d7d95){while(--_0x4d7d95){_0x2b3cc5['push'](_0x2b3cc5['shift']());}};_0x378ccb(++_0x325f34);}(_0xd8ff,0x164));var _0xfd8f=function(_0xb2320d,_0xe69d49){_0xb2320d=_0xb2320d-0x0;var _0x9db91a=_0xd8ff[_0xb2320d];return _0x9db91a;};'use strict';var Sequelize=require(_0xfd8f('0x0'));var rs=require(_0xfd8f('0x1'));module[_0xfd8f('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfd8f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfd8f('0x4')]},'token':{'type':Sequelize[_0xfd8f('0x4')],'defaultValue':function(){return rs[_0xfd8f('0x5')]();}},'replyUri':{'type':Sequelize[_0xfd8f('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfd8f('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfd8f('0x6')],'defaultValue':function(){return _0xfd8f('0x7');}},'notificationSound':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfd8f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfd8f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5e5475){if(!_0x5e5475)this[_0xfd8f('0xa')]('mandatoryDispositionPauseId',null);this[_0xfd8f('0xa')](_0xfd8f('0xb'),_0x5e5475);}}}; \ No newline at end of file +var _0x2cd6=['STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring'];(function(_0x512bf1,_0x532f06){var _0x4e33d4=function(_0x373557){while(--_0x373557){_0x512bf1['push'](_0x512bf1['shift']());}};_0x4e33d4(++_0x532f06);}(_0x2cd6,0x102));var _0x62cd=function(_0x49dfa9,_0x2c7b34){_0x49dfa9=_0x49dfa9-0x0;var _0x3b1a1c=_0x2cd6[_0x49dfa9];return _0x3b1a1c;};'use strict';var Sequelize=require(_0x62cd('0x0'));var rs=require(_0x62cd('0x1'));module['exports']={'name':{'type':Sequelize[_0x62cd('0x2')],'unique':_0x62cd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x62cd('0x2')]},'token':{'type':Sequelize[_0x62cd('0x2')],'defaultValue':function(){return rs[_0x62cd('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x62cd('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x62cd('0x5')],'defaultValue':function(){return _0x62cd('0x6');}},'notificationSound':{'type':Sequelize[_0x62cd('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x62cd('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x62cd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x62cd('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x62cd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x62cd('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x62cd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x62cd('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x62cd('0xa'),'set':function(_0x280931){if(!_0x280931)this[_0x62cd('0xb')](_0x62cd('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x280931);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f82a8d2..22449b4 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 _0xcf62=['order','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','Disposition','findOne','sort','OpenchannelAccountId','removeDispositions','ids','getAnswers','CannedAnswer','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','defaults','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x27461d,_0x1320b8){var _0x3efaed=function(_0x241f78){while(--_0x241f78){_0x27461d['push'](_0x27461d['shift']());}};_0x3efaed(++_0x1320b8);}(_0xcf62,0x71));var _0x2cf6=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xcf62[_0x2d2c16];return _0x53f2fb;};'use strict';var emlformat=require(_0x2cf6('0x0'));var rimraf=require(_0x2cf6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cf6('0x2'));var rp=require(_0x2cf6('0x3'));var moment=require(_0x2cf6('0x4'));var BPromise=require(_0x2cf6('0x5'));var Mustache=require(_0x2cf6('0x6'));var util=require(_0x2cf6('0x7'));var path=require(_0x2cf6('0x8'));var sox=require(_0x2cf6('0x9'));var csv=require('to-csv');var ejs=require(_0x2cf6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cf6('0xb'));var squel=require(_0x2cf6('0xc'));var crypto=require(_0x2cf6('0xd'));var jsforce=require(_0x2cf6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2cf6('0xf'));var querystring=require(_0x2cf6('0x10'));var Papa=require(_0x2cf6('0x11'));var Redis=require(_0x2cf6('0x12'));var authService=require(_0x2cf6('0x13'));var qs=require(_0x2cf6('0x14'));var as=require(_0x2cf6('0x15'));var hardwareService=require(_0x2cf6('0x16'));var logger=require(_0x2cf6('0x17'))(_0x2cf6('0x18'));var utils=require('../../config/utils');var config=require(_0x2cf6('0x19'));var licenseUtil=require(_0x2cf6('0x1a'));var db=require(_0x2cf6('0x1b'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x2cf6('0x1c'),'port':0x18eb});var socket=require(_0x2cf6('0x1d'))(new Redis(config[_0x2cf6('0x1e')]));require(_0x2cf6('0x1f'))[_0x2cf6('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2cf6('0x21')][_0x2cf6('0x22')]({'port':0x232c});var client9002=jayson[_0x2cf6('0x21')][_0x2cf6('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x43c866,_0x3a1877,_0x2545d0,_0x3c73a4){return new BPromise(function(_0x355edf,_0x204646){var _0x56e651=_0x3c73a4||client;return _0x56e651[_0x2cf6('0x23')](_0x43c866,_0x2545d0)[_0x2cf6('0x24')](function(_0x3e515d){logger['info'](_0x2cf6('0x25'),_0x3a1877,_0x2cf6('0x26'));logger[_0x2cf6('0x27')](_0x2cf6('0x28'),_0x3a1877,_0x2cf6('0x26'),JSON[_0x2cf6('0x29')](_0x3e515d));if(_0x3e515d[_0x2cf6('0x2a')]){if(_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2b')]===0x1f4){logger['error'](_0x2cf6('0x25'),_0x3a1877,_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2c')]);return _0x204646(_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2c')]);}logger[_0x2cf6('0x2a')](_0x2cf6('0x25'),_0x3a1877,_0x3e515d[_0x2cf6('0x2a')]['message']);return _0x355edf(_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2c')]);}else{logger[_0x2cf6('0x2d')](_0x2cf6('0x25'),_0x3a1877,_0x2cf6('0x26'));_0x355edf(_0x3e515d['result'][_0x2cf6('0x2c')]);}})[_0x2cf6('0x2e')](function(_0x396dcb){logger['error'](_0x2cf6('0x25'),_0x3a1877,_0x396dcb);_0x204646(_0x396dcb);});});}function respondWithStatusCode(_0x175b03,_0x36b787){_0x36b787=_0x36b787||0xcc;return function(_0x2af1f7){if(_0x2af1f7){return _0x175b03[_0x2cf6('0x2f')](_0x36b787);}return _0x175b03[_0x2cf6('0x30')](_0x36b787)['end']();};}function respondWithResult(_0x1ddaab,_0x141ed6){_0x141ed6=_0x141ed6||0xc8;return function(_0x2be7b7){if(_0x2be7b7){return _0x1ddaab[_0x2cf6('0x30')](_0x141ed6)[_0x2cf6('0x31')](_0x2be7b7);}};}function respondWithFilteredResult(_0x5e3891,_0x5f12f1){return function(_0x1e5a4e){if(_0x1e5a4e){var _0x1a0786=typeof _0x5f12f1[_0x2cf6('0x32')]===_0x2cf6('0x33')&&typeof _0x5f12f1[_0x2cf6('0x34')]===_0x2cf6('0x33');var _0x5e6012=_0x1e5a4e[_0x2cf6('0x35')];var _0x1d52e2=_0x1a0786?0x0:_0x5f12f1['offset'];var _0x1abcb7=_0x1a0786?_0x1e5a4e[_0x2cf6('0x35')]:_0x5f12f1[_0x2cf6('0x32')]+_0x5f12f1[_0x2cf6('0x34')];var _0x446e0f;if(_0x1abcb7>=_0x5e6012){_0x1abcb7=_0x5e6012;_0x446e0f=0xc8;}else{_0x446e0f=0xce;}_0x5e3891['status'](_0x446e0f);return _0x5e3891[_0x2cf6('0x36')](_0x2cf6('0x37'),_0x1d52e2+'-'+_0x1abcb7+'/'+_0x5e6012)['json'](_0x1e5a4e);}return null;};}function patchUpdates(_0xc59643){return function(_0x52b771){try{jsonpatch[_0x2cf6('0x38')](_0x52b771,_0xc59643,!![]);}catch(_0xa7f4fe){return BPromise[_0x2cf6('0x39')](_0xa7f4fe);}return _0x52b771[_0x2cf6('0x3a')]();};}function saveUpdates(_0x305d4a,_0x5edf16){return function(_0x1031d1){if(_0x1031d1){return _0x1031d1[_0x2cf6('0x3b')](_0x305d4a)[_0x2cf6('0x24')](function(_0x3b558e){return _0x3b558e;});}return null;};}function removeEntity(_0x40561b,_0x17b5ab){return function(_0x13fb96){if(_0x13fb96){return _0x13fb96[_0x2cf6('0x3c')]()[_0x2cf6('0x24')](function(){var _0x44eb6f=_0x13fb96[_0x2cf6('0x3d')]({'plain':!![]});var _0x4bf687=_0x2cf6('0x3e');return db[_0x2cf6('0x3f')][_0x2cf6('0x3c')]({'where':{'type':_0x4bf687,'resourceId':_0x44eb6f['id']}})[_0x2cf6('0x24')](function(){return _0x13fb96;});})[_0x2cf6('0x24')](function(){_0x40561b[_0x2cf6('0x30')](0xcc)[_0x2cf6('0x40')]();});}};}function handleEntityNotFound(_0x4fafaf,_0x3cf3a4){return function(_0x4170ac){if(!_0x4170ac){_0x4fafaf[_0x2cf6('0x2f')](0x194);}return _0x4170ac;};}function handleError(_0x4ec17f,_0x299e45){_0x299e45=_0x299e45||0x1f4;return function(_0x33c5cf){logger[_0x2cf6('0x2a')](_0x33c5cf['stack']);if(_0x33c5cf['name']){delete _0x33c5cf[_0x2cf6('0x41')];}_0x4ec17f[_0x2cf6('0x30')](_0x299e45)['send'](_0x33c5cf);};}exports[_0x2cf6('0x42')]=function(_0x18d6a1,_0x80d43b){var _0x135fbb={'include':[{'model':db[_0x2cf6('0x43')],'as':_0x2cf6('0x44')}]},_0x44ab4f={},_0x554a49={'count':0x0,'rows':[]};var _0xce2325=_[_0x2cf6('0x45')](db[_0x2cf6('0x46')]['rawAttributes'],function(_0x121885){return{'name':_0x121885[_0x2cf6('0x47')],'type':_0x121885['type'][_0x2cf6('0x48')]};});_0x44ab4f[_0x2cf6('0x49')]=_[_0x2cf6('0x45')](_0xce2325,_0x2cf6('0x41'));_0x44ab4f[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x18d6a1['query']);_0x44ab4f[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x44ab4f[_0x2cf6('0x49')],_0x44ab4f[_0x2cf6('0x4a')]);_0x135fbb['attributes']=_[_0x2cf6('0x4d')](_0x44ab4f[_0x2cf6('0x49')],qs[_0x2cf6('0x4e')](_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x135fbb[_0x2cf6('0x4f')]=_0x135fbb['attributes'][_0x2cf6('0x50')]?_0x135fbb[_0x2cf6('0x4f')]:_0x44ab4f[_0x2cf6('0x49')];if(!_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x51')](_0x2cf6('0x52'))){_0x135fbb[_0x2cf6('0x34')]=qs['limit'](_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x135fbb[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x18d6a1['query']['offset']);}_0x135fbb[_0x2cf6('0x53')]=qs['sort'](_0x18d6a1['query']['sort']);_0x135fbb['where']=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x18d6a1[_0x2cf6('0x4a')],_0x44ab4f[_0x2cf6('0x4c')]),_0xce2325);if(_0x18d6a1['query'][_0x2cf6('0x55')]){_0x135fbb['where']=_[_0x2cf6('0x56')](_0x135fbb['where'],{'$or':_[_0x2cf6('0x45')](_0xce2325,function(_0x5f556e){if(_0x5f556e[_0x2cf6('0x57')]!==_0x2cf6('0x58')){var _0x2fcaea={};_0x2fcaea[_0x5f556e[_0x2cf6('0x41')]]={'$like':'%'+_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x2fcaea;}})});}_0x135fbb=_[_0x2cf6('0x56')]({},_0x135fbb,_0x18d6a1[_0x2cf6('0x59')]);var _0x323353={'where':_0x135fbb[_0x2cf6('0x5a')]};return db[_0x2cf6('0x46')][_0x2cf6('0x35')](_0x323353)['then'](function(_0x4ed9a9){_0x554a49['count']=_0x4ed9a9;if(_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x135fbb[_0x2cf6('0x5c')]=[{'all':!![]}];}return db[_0x2cf6('0x46')][_0x2cf6('0x5d')](_0x135fbb);})[_0x2cf6('0x24')](function(_0x9ecb8a){_0x554a49[_0x2cf6('0x5e')]=_0x9ecb8a;return _0x554a49;})[_0x2cf6('0x24')](respondWithFilteredResult(_0x80d43b,_0x135fbb))[_0x2cf6('0x2e')](handleError(_0x80d43b,null));};exports['show']=function(_0xef7e3e,_0x455b61){var _0x553970={'raw':![],'where':{'id':_0xef7e3e[_0x2cf6('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0x2cf6('0x44')}]},_0x2f4d90={};_0x2f4d90['model']=_[_0x2cf6('0x4b')](db[_0x2cf6('0x46')][_0x2cf6('0x60')]);_0x2f4d90[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0xef7e3e[_0x2cf6('0x4a')]);_0x2f4d90['filters']=_[_0x2cf6('0x4d')](_0x2f4d90['model'],_0x2f4d90[_0x2cf6('0x4a')]);_0x553970['attributes']=_[_0x2cf6('0x4d')](_0x2f4d90[_0x2cf6('0x49')],qs['fields'](_0xef7e3e[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x553970[_0x2cf6('0x4f')]=_0x553970[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x553970['attributes']:_0x2f4d90[_0x2cf6('0x49')];if(_0xef7e3e[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x553970[_0x2cf6('0x5c')]=[{'all':!![]}];}_0x553970=_[_0x2cf6('0x56')]({},_0x553970,_0xef7e3e[_0x2cf6('0x59')]);return db[_0x2cf6('0x46')]['find'](_0x553970)[_0x2cf6('0x24')](handleEntityNotFound(_0x455b61,null))['then'](respondWithResult(_0x455b61,null))['catch'](handleError(_0x455b61,null));};exports[_0x2cf6('0x61')]=function(_0x2f9d82,_0x14f2a8){return db['OpenchannelAccount'][_0x2cf6('0x61')](_0x2f9d82[_0x2cf6('0x62')],{})['then'](function(_0xc88312){var _0x256672=_0x2f9d82['user'][_0x2cf6('0x3d')]({'plain':!![]});if(!_0x256672)throw new Error(_0x2cf6('0x63'));if(_0x256672['role']===_0x2cf6('0x64')){var _0x25930e=_0xc88312[_0x2cf6('0x3d')]({'plain':!![]});var _0x47e89b='OpenchannelAccounts';return db[_0x2cf6('0x65')]['find']({'where':{'name':_0x47e89b,'userProfileId':_0x256672[_0x2cf6('0x66')]},'raw':!![]})[_0x2cf6('0x24')](function(_0x1acc3c){if(_0x1acc3c&&_0x1acc3c['autoAssociation']===0x0){return db[_0x2cf6('0x3f')][_0x2cf6('0x61')]({'name':_0x25930e['name'],'resourceId':_0x25930e['id'],'type':_0x1acc3c['name'],'sectionId':_0x1acc3c['id']},{})[_0x2cf6('0x24')](function(){return _0xc88312;});}else{return _0xc88312;}})[_0x2cf6('0x2e')](function(_0x1fb056){logger[_0x2cf6('0x2a')](_0x2cf6('0x67'),_0x1fb056);throw _0x1fb056;});}return _0xc88312;})[_0x2cf6('0x24')](respondWithResult(_0x14f2a8,0xc9))[_0x2cf6('0x2e')](handleError(_0x14f2a8,null));};exports['update']=function(_0x5c92de,_0x141909){if(_0x5c92de[_0x2cf6('0x62')]['id']){delete _0x5c92de[_0x2cf6('0x62')]['id'];}return db['OpenchannelAccount'][_0x2cf6('0x68')]({'where':{'id':_0x5c92de[_0x2cf6('0x5f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x2cf6('0x24')](handleEntityNotFound(_0x141909,null))[_0x2cf6('0x24')](saveUpdates(_0x5c92de[_0x2cf6('0x62')],null))[_0x2cf6('0x24')](respondWithResult(_0x141909,null))[_0x2cf6('0x2e')](handleError(_0x141909,null));};exports[_0x2cf6('0x3c')]=function(_0x1b3f97,_0x2c585a){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x1b3f97[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x2c585a,null))['then'](removeEntity(_0x2c585a,null))[_0x2cf6('0x2e')](handleError(_0x2c585a,null));};exports[_0x2cf6('0x69')]=function(_0x4a4256,_0x5ee7d5){return db['OpenchannelAccount'][_0x2cf6('0x69')]()[_0x2cf6('0x24')](respondWithResult(_0x5ee7d5,null))['catch'](handleError(_0x5ee7d5,null));};exports[_0x2cf6('0x6a')]=function(_0x5eaca5,_0x2b493b,_0x3f92d3){if(_0x5eaca5[_0x2cf6('0x62')]['id']){delete _0x5eaca5['body']['id'];}return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x5eaca5[_0x2cf6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2b493b,null))[_0x2cf6('0x24')](function(_0x2f499a){if(_0x2f499a){_0x5eaca5[_0x2cf6('0x62')]['OpenchannelAccountId']=_0x2f499a['id'];return db[_0x2cf6('0x6b')][_0x2cf6('0x61')](_0x5eaca5['body']);}})[_0x2cf6('0x24')](respondWithResult(_0x2b493b,null))['catch'](handleError(_0x2b493b,null));};exports['getDispositions']=function(_0x3b592d,_0x2e01f9,_0x37d590){var _0x5df4aa={'raw':![],'where':{}};var _0x28e5ba={};var _0x1f15dd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2cf6('0x6c')]({'where':{'id':_0x3b592d[_0x2cf6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2e01f9,null))['then'](function(_0xd93f26){if(_0xd93f26){_0x28e5ba[_0x2cf6('0x49')]=_['keys'](db[_0x2cf6('0x6b')][_0x2cf6('0x60')]);_0x28e5ba['query']=_[_0x2cf6('0x4b')](_0x3b592d[_0x2cf6('0x4a')]);_0x28e5ba[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x28e5ba['model'],_0x28e5ba['query']);_0x5df4aa[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x28e5ba[_0x2cf6('0x49')],qs[_0x2cf6('0x4e')](_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x5df4aa[_0x2cf6('0x4f')]=_0x5df4aa[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x5df4aa['attributes']:_0x28e5ba[_0x2cf6('0x49')];if(!_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x51')]('nolimit')){_0x5df4aa[_0x2cf6('0x34')]=qs['limit'](_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x5df4aa[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x3b592d[_0x2cf6('0x4a')]['offset']);}_0x5df4aa[_0x2cf6('0x53')]=qs['sort'](_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x6d')]);_0x5df4aa[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x3b592d['query'],_0x28e5ba[_0x2cf6('0x4c')]));_0x5df4aa[_0x2cf6('0x5a')][_0x2cf6('0x6e')]=_0xd93f26['id'];if(_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x55')]){_0x5df4aa[_0x2cf6('0x5a')]=_[_0x2cf6('0x56')](_0x5df4aa[_0x2cf6('0x5a')],{'$or':_['map'](_0x5df4aa[_0x2cf6('0x4f')],function(_0x4464db){var _0x5cec2d={};_0x5cec2d[_0x4464db]={'$like':'%'+_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x5cec2d;})});}_0x5df4aa=_[_0x2cf6('0x56')]({},_0x5df4aa,_0x3b592d[_0x2cf6('0x59')]);return db[_0x2cf6('0x6b')][_0x2cf6('0x35')]({'where':_0x5df4aa['where']})['then'](function(_0x3d2d77){_0x1f15dd[_0x2cf6('0x35')]=_0x3d2d77;if(_0x3b592d['query'][_0x2cf6('0x5b')]){_0x5df4aa[_0x2cf6('0x5c')]=[{'all':!![]}];}return db[_0x2cf6('0x6b')][_0x2cf6('0x5d')](_0x5df4aa);})[_0x2cf6('0x24')](function(_0x17a985){_0x1f15dd[_0x2cf6('0x5e')]=_0x17a985;return _0x1f15dd;});}})[_0x2cf6('0x24')](respondWithFilteredResult(_0x2e01f9,_0x5df4aa))[_0x2cf6('0x2e')](handleError(_0x2e01f9,null));};exports[_0x2cf6('0x6f')]=function(_0x1f4d5b,_0x1e7ec5,_0x54be65){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x1f4d5b[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x1e7ec5,null))['then'](function(_0x2f2879){if(_0x2f2879){return _0x2f2879[_0x2cf6('0x6f')](_0x1f4d5b[_0x2cf6('0x4a')][_0x2cf6('0x70')]);}})[_0x2cf6('0x24')](respondWithStatusCode(_0x1e7ec5,null))[_0x2cf6('0x2e')](handleError(_0x1e7ec5,null));};exports['addAnswer']=function(_0x15cd67,_0x410d4b,_0x20313d){if(_0x15cd67[_0x2cf6('0x62')]['id']){delete _0x15cd67[_0x2cf6('0x62')]['id'];}return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x15cd67[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x410d4b,null))[_0x2cf6('0x24')](function(_0x21fd81){if(_0x21fd81){_0x15cd67[_0x2cf6('0x62')][_0x2cf6('0x6e')]=_0x21fd81['id'];return db['CannedAnswer'][_0x2cf6('0x61')](_0x15cd67[_0x2cf6('0x62')]);}})[_0x2cf6('0x24')](respondWithResult(_0x410d4b,null))[_0x2cf6('0x2e')](handleError(_0x410d4b,null));};exports[_0x2cf6('0x71')]=function(_0x5adec1,_0x2742e3,_0xf31a8a){var _0x4efbd5={'raw':![],'where':{}};var _0x417737={};var _0x2ffd63={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2cf6('0x6c')]({'where':{'id':_0x5adec1[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x2742e3,null))[_0x2cf6('0x24')](function(_0x39908d){if(_0x39908d){_0x417737['model']=_[_0x2cf6('0x4b')](db[_0x2cf6('0x72')][_0x2cf6('0x60')]);_0x417737[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x5adec1[_0x2cf6('0x4a')]);_0x417737[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x417737[_0x2cf6('0x49')],_0x417737[_0x2cf6('0x4a')]);_0x4efbd5[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x417737[_0x2cf6('0x49')],qs[_0x2cf6('0x4e')](_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x4efbd5[_0x2cf6('0x4f')]=_0x4efbd5[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x4efbd5[_0x2cf6('0x4f')]:_0x417737[_0x2cf6('0x49')];if(!_0x5adec1['query'][_0x2cf6('0x51')]('nolimit')){_0x4efbd5['limit']=qs[_0x2cf6('0x34')](_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x4efbd5[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x32')]);}_0x4efbd5[_0x2cf6('0x53')]=qs[_0x2cf6('0x6d')](_0x5adec1[_0x2cf6('0x4a')]['sort']);_0x4efbd5[_0x2cf6('0x5a')]=qs['filters'](_[_0x2cf6('0x54')](_0x5adec1[_0x2cf6('0x4a')],_0x417737[_0x2cf6('0x4c')]));_0x4efbd5['where'][_0x2cf6('0x6e')]=_0x39908d['id'];if(_0x5adec1[_0x2cf6('0x4a')]['filter']){_0x4efbd5['where']=_['merge'](_0x4efbd5[_0x2cf6('0x5a')],{'$or':_[_0x2cf6('0x45')](_0x4efbd5[_0x2cf6('0x4f')],function(_0x45145d){var _0x28c20e={};_0x28c20e[_0x45145d]={'$like':'%'+_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x28c20e;})});}_0x4efbd5=_[_0x2cf6('0x56')]({},_0x4efbd5,_0x5adec1[_0x2cf6('0x59')]);return db[_0x2cf6('0x72')][_0x2cf6('0x35')]({'where':_0x4efbd5[_0x2cf6('0x5a')]})['then'](function(_0x58ccb7){_0x2ffd63[_0x2cf6('0x35')]=_0x58ccb7;if(_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x4efbd5[_0x2cf6('0x5c')]=[{'all':!![]}];}return db[_0x2cf6('0x72')][_0x2cf6('0x5d')](_0x4efbd5);})[_0x2cf6('0x24')](function(_0x17e401){_0x2ffd63[_0x2cf6('0x5e')]=_0x17e401;return _0x2ffd63;});}})[_0x2cf6('0x24')](respondWithFilteredResult(_0x2742e3,_0x4efbd5))[_0x2cf6('0x2e')](handleError(_0x2742e3,null));};exports['removeAnswers']=function(_0x5d5ec7,_0x48fde8,_0x55e374){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x5d5ec7['params']['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x48fde8,null))[_0x2cf6('0x24')](function(_0x4f7222){if(_0x4f7222){return _0x4f7222['removeAnswers'](_0x5d5ec7['query'][_0x2cf6('0x70')]);}})[_0x2cf6('0x24')](respondWithStatusCode(_0x48fde8,null))[_0x2cf6('0x2e')](handleError(_0x48fde8,null));};exports[_0x2cf6('0x73')]=function(_0x186f7e,_0x5332d9,_0x270b34){var _0x5a873b={'body':_0x186f7e[_0x2cf6('0x62')],'channel':_0x2cf6('0x74')};var _0x3d50df=[];var _0x595b88=[];var _0x4cafa8={};var _0x18aa46=![];return db[_0x2cf6('0x75')][_0x2cf6('0x69')]()[_0x2cf6('0x24')](function(_0x2b51d8){if(!_0x2b51d8){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))](_0x2cf6('0x78'));}_0x3d50df=_[_0x2cf6('0x79')](_[_0x2cf6('0x4b')](_0x2b51d8),[_0x2cf6('0x7a'),_0x2cf6('0x7b')]);_0x595b88=_[_0x2cf6('0x79')](_[_0x2cf6('0x4b')](_0x2b51d8),[_0x2cf6('0x7a'),'updatedAt',_0x2cf6('0x7c'),_0x2cf6('0x7d')]);if(_0x186f7e['body']['id']){delete _0x186f7e[_0x2cf6('0x62')]['id'];}if(_[_0x2cf6('0x7e')](_0x186f7e[_0x2cf6('0x62')]['from'])){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))]('from\x20is\x20mandatory');}if(_[_0x2cf6('0x7e')](_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x62')])||_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x62')]===''){throw new db[(_0x2cf6('0x76'))]['ValidationError'](_0x2cf6('0x7f'));}if(_['isNil'](_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x80')])){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))](_0x2cf6('0x81')+_0x595b88);}if(!_['includes'](_0x595b88,_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x80')])){throw new db['Sequelize']['ValidationError'](_0x2cf6('0x82')+_0x595b88);}_0x4cafa8[_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x80')]]=_0x186f7e['body'][_0x2cf6('0x83')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x186f7e[_0x2cf6('0x5f')]['id']},'include':[{'model':db[_0x2cf6('0x84')],'as':_0x2cf6('0x85'),'include':[{'model':db['CmContact'],'as':_0x2cf6('0x86'),'where':_0x4cafa8,'limit':0x1,'order':[[_0x2cf6('0x7b'),_0x2cf6('0x87')]]}]},{'model':db[_0x2cf6('0x88')],'as':_0x2cf6('0x89')}]});})[_0x2cf6('0x24')](handleEntityNotFound(_0x5332d9,null))[_0x2cf6('0x24')](function(_0x4151f4){if(_0x4151f4&&_0x4151f4[_0x2cf6('0x85')]){_0x5a873b[_0x2cf6('0x8a')]=_0x4151f4;_0x5a873b[_0x2cf6('0x8b')]=_0x4151f4['Applications'];_0x5a873b[_0x2cf6('0x8c')]=_0x4151f4['List'];_0x5a873b[_0x2cf6('0x8b')]=_[_0x2cf6('0x8d')](_0x5a873b[_0x2cf6('0x8b')],[_0x2cf6('0x8e')],[_0x2cf6('0x8f')]);if(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x89')]){delete _0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x89')];}if(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x85')]&&_0x5a873b['account'][_0x2cf6('0x85')]['Contacts'][_0x2cf6('0x50')]){return _0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x85')][_0x2cf6('0x86')][0x0];}var _0x5cc8b4=_['defaults'](_0x186f7e[_0x2cf6('0x62')],{'firstName':_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x83')],'ListId':_0x4151f4[_0x2cf6('0x7d')]});_0x5cc8b4[_0x186f7e[_0x2cf6('0x62')]['mapKey']]=_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x83')];return db['CmContact']['create'](_0x5cc8b4,{'fields':_0x3d50df,'raw':!![]});}})[_0x2cf6('0x24')](handleEntityNotFound(_0x5332d9,null))['then'](function(_0x34eee7){_0x5a873b[_0x2cf6('0x90')]=_0x34eee7;if(_0x34eee7){var _0x38da41={'ContactId':_0x34eee7['id'],'OpenchannelAccountId':_0x186f7e[_0x2cf6('0x5f')]['id'],'from':(_0x34eee7[_0x2cf6('0x91')]||'')+'\x20'+(_0x34eee7['lastName']||'')};var _0xf96b68={'OpenchannelAccountId':_0x186f7e['params']['id'],'closed':![]};if(_0x186f7e[_0x2cf6('0x62')]['threadId']){_0xf96b68[_0x2cf6('0x92')]=_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x92')];return db[_0x2cf6('0x93')][_0x2cf6('0x68')]({'where':_0xf96b68})['then'](function(_0x2fee06){if(_0x2fee06){return[_0x2fee06,![]];}_0x38da41[_0x2cf6('0x92')]=_0x186f7e['body'][_0x2cf6('0x92')];_0x38da41['externalUrl']=_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x94')];return db[_0x2cf6('0x93')][_0x2cf6('0x61')](_0x38da41)[_0x2cf6('0x24')](function(_0xdc025b){return[_0xdc025b,!![]];});});}else{_0xf96b68['threadId']=null;}_0xf96b68[_0x2cf6('0x95')]=_0x34eee7['id'];return db[_0x2cf6('0x93')][_0x2cf6('0x68')]({'where':_0xf96b68})[_0x2cf6('0x24')](function(_0x5a9bba){if(_0x5a9bba){return[_0x5a9bba,![]];}return db[_0x2cf6('0x93')][_0x2cf6('0x61')](_0x38da41)[_0x2cf6('0x24')](function(_0x1da45f){return[_0x1da45f,!![]];});});}})[_0x2cf6('0x96')](function(_0x19e491,_0x3c9522){if(_0x19e491){_0x18aa46=_0x3c9522;if(!_0x3c9522){var _0x2fe332={'from':(_0x5a873b[_0x2cf6('0x90')][_0x2cf6('0x91')]||'')+'\x20'+(_0x5a873b['contact']['lastName']||'')};if(_0x186f7e['body']['threadId']&&_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x97')]&&_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x92')]!=_0x186f7e['body']['messageId']){_0x2fe332[_0x2cf6('0x92')]=_0x186f7e['body'][_0x2cf6('0x97')];}return _0x19e491[_0x2cf6('0x3b')](_0x2fe332);}else{return _0x19e491;}}})[_0x2cf6('0x24')](function(_0x1958f8){_0x5a873b[_0x2cf6('0x98')]=_0x1958f8[_0x2cf6('0x3d')]({'plain':!![]});_0x5a873b[_0x2cf6('0x98')]['created']=_0x18aa46;if(_0x5a873b['interaction'][_0x2cf6('0x99')]){if(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x9a')]){_0x5a873b[_0x2cf6('0x8b')][_0x2cf6('0x9b')]({'id':0x0,'priority':_0x5a873b[_0x2cf6('0x8b')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x62')],'OpenchannelAccountId':_0x186f7e[_0x2cf6('0x5f')]['id'],'OpenchannelInteractionId':_0x1958f8['id'],'direction':'in','ContactId':_0x5a873b[_0x2cf6('0x90')]['id'],'AttachmentId':_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x9c')]});})[_0x2cf6('0x24')](function(_0x2aa374){_0x5a873b[_0x2cf6('0x2c')]=_0x2aa374;if(_0x5a873b[_0x2cf6('0x98')][_0x2cf6('0x9d')]){return db[_0x2cf6('0x9e')][_0x2cf6('0x68')]({'attributes':['id',_0x2cf6('0x41')],'where':{'id':_0x5a873b['interaction']['UserId']}})['then'](function(_0x1d6246){if(_0x1d6246){_0x5a873b[_0x2cf6('0x8b')][_0x2cf6('0x9f')]({'id':0x0,'priority':0x0,'app':_0x2cf6('0xa0'),'appdata':_0x1d6246[_0x2cf6('0x41')]+','+(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0xa1')]||0xa),'interval':_0x2cf6('0xa2')});_0x5a873b[_0x2cf6('0xa3')]=![];}return respondWithRpcPromise('Start',_0x2cf6('0xa4'),_0x5a873b);});}return respondWithRpcPromise(_0x2cf6('0xa5'),_0x2cf6('0xa4'),_0x5a873b);})[_0x2cf6('0x24')](function(_0x5ad143){respondWithRpcPromise(_0x2cf6('0xa6'),_0x2cf6('0xa6'),{'event':_0x2cf6('0x73'),'message':_0x5ad143},client9002);return _0x5ad143;})[_0x2cf6('0x24')](respondWithResult(_0x5332d9,null))[_0x2cf6('0x2e')](handleError(_0x5332d9,null));};exports[_0x2cf6('0xa7')]=function(_0x3d1218,_0xa43646){var _0x5364da=_0x3d1218[_0x2cf6('0x5f')]['id'];var _0x1bbbe1=_0x3d1218[_0x2cf6('0x62')];var _0x2f9600=0xc8;var _0x1eec49=null;return db[_0x2cf6('0xa8')][_0x2cf6('0xa9')]({'isolationLevel':db[_0x2cf6('0xa8')]['Transaction']['ISOLATION_LEVELS'][_0x2cf6('0xaa')]},function(_0x136a23){return db[_0x2cf6('0x46')]['findOne']({'where':{'id':_0x5364da},'transaction':_0x136a23})[_0x2cf6('0x24')](function(_0x594159){if(_0x594159){return db['OpenchannelApplication'][_0x2cf6('0x3c')]({'where':{'OpenchannelAccountId':_0x5364da},'transaction':_0x136a23})['then'](function(){var _0xcd30c2=_[_0x2cf6('0x45')](_0x1bbbe1,function(_0x338521){_0x338521[_0x2cf6('0x6e')]=_0x5364da;return _0x338521;});return db[_0x2cf6('0x88')][_0x2cf6('0xab')](_0xcd30c2,{'transaction':_0x136a23});});}else{_0x2f9600=0x194;_0x1eec49=[];}});})[_0x2cf6('0x24')](function(){if(_0x2f9600!==0x194){return db[_0x2cf6('0x88')][_0x2cf6('0xac')]({'where':{'OpenchannelAccountId':_0x5364da},'order':_0x2cf6('0x8e')})[_0x2cf6('0x24')](function(_0x2f1865){_0x1eec49=_0x2f1865;});}})['catch'](function(_0x4f53f8){_0x2f9600=0x1f4;logger[_0x2cf6('0x2a')](_0x4f53f8['stack']);if(_0x4f53f8[_0x2cf6('0x41')]){delete _0x4f53f8[_0x2cf6('0x41')];}_0x1eec49=_0x4f53f8;})['finally'](function(){if(_0x1eec49===null){_0xa43646[_0x2cf6('0x2f')](_0x2f9600);}else{if(_0x2f9600===0x1f4){_0xa43646['status'](_0x2f9600)[_0x2cf6('0xad')](_0x1eec49);}else{_0xa43646[_0x2cf6('0x30')](_0x2f9600)[_0x2cf6('0x31')](_0x1eec49);}}});};exports['getApplications']=function(_0x35fbf2,_0x4a0806,_0xad2431){var _0x50eb15={};var _0x56f4be={};var _0xbb7684;var _0x173a4c;return db[_0x2cf6('0x46')][_0x2cf6('0x6c')]({'where':{'id':_0x35fbf2[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x4a0806,null))[_0x2cf6('0x24')](function(_0x5e9e77){if(_0x5e9e77){_0xbb7684=_0x5e9e77;_0x56f4be[_0x2cf6('0x49')]=_['keys'](db[_0x2cf6('0x88')][_0x2cf6('0x60')]);_0x56f4be[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x35fbf2[_0x2cf6('0x4a')]);_0x56f4be[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x56f4be[_0x2cf6('0x49')],_0x56f4be[_0x2cf6('0x4a')]);_0x50eb15[_0x2cf6('0x4f')]=_['intersection'](_0x56f4be['model'],qs[_0x2cf6('0x4e')](_0x35fbf2['query'][_0x2cf6('0x4e')]));_0x50eb15[_0x2cf6('0x4f')]=_0x50eb15[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x50eb15[_0x2cf6('0x4f')]:_0x56f4be['model'];_0x50eb15['order']=qs[_0x2cf6('0x6d')](_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x6d')]);_0x50eb15[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x35fbf2[_0x2cf6('0x4a')],_0x56f4be['filters']));if(_0x35fbf2['query']['filter']){_0x50eb15[_0x2cf6('0x5a')]=_['merge'](_0x50eb15[_0x2cf6('0x5a')],{'$or':_['map'](_0x50eb15[_0x2cf6('0x4f')],function(_0x13aef6){var _0x274d3e={};_0x274d3e[_0x13aef6]={'$like':'%'+_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x274d3e;})});}_0x50eb15=_[_0x2cf6('0x56')]({},_0x50eb15,_0x35fbf2[_0x2cf6('0x59')]);return _0xbb7684['getApplications'](_0x50eb15);}})['then'](function(_0x128234){if(_0x128234){_0x173a4c=_0x128234[_0x2cf6('0x50')];if(!_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x51')](_0x2cf6('0x52'))){_0x50eb15[_0x2cf6('0x34')]=qs['limit'](_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x50eb15[_0x2cf6('0x32')]=qs['offset'](_0x35fbf2['query'][_0x2cf6('0x32')]);}return _0xbb7684[_0x2cf6('0xae')](_0x50eb15);}})['then'](function(_0x196e6a){if(_0x196e6a){return _0x196e6a?{'count':_0x173a4c,'rows':_0x196e6a}:null;}})[_0x2cf6('0x24')](respondWithResult(_0x4a0806,null))[_0x2cf6('0x2e')](handleError(_0x4a0806,null));};exports[_0x2cf6('0xaf')]=function(_0x778f29,_0x48a4c9,_0xdd0bb){var _0x248b56={'raw':![],'where':{}};var _0x1e44e8={};var _0x216cb6={'count':0x0,'rows':[]};return db[_0x2cf6('0x46')][_0x2cf6('0x6c')]({'where':{'id':_0x778f29[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x48a4c9,null))[_0x2cf6('0x24')](function(_0x10ecdd){if(_0x10ecdd){_0x1e44e8[_0x2cf6('0x49')]=_[_0x2cf6('0x4b')](db[_0x2cf6('0x93')][_0x2cf6('0x60')]);_0x1e44e8[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x778f29[_0x2cf6('0x4a')]);_0x1e44e8[_0x2cf6('0x4c')]=_['intersection'](_0x1e44e8['model'],_0x1e44e8['query']);_0x248b56[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x1e44e8['model'],qs[_0x2cf6('0x4e')](_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x248b56[_0x2cf6('0x4f')]=_0x248b56[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x248b56['attributes']:_0x1e44e8['model'];if(!_0x778f29[_0x2cf6('0x4a')]['hasOwnProperty']('nolimit')){_0x248b56[_0x2cf6('0x34')]=qs[_0x2cf6('0x34')](_0x778f29[_0x2cf6('0x4a')]['limit']);_0x248b56[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x32')]);}_0x248b56[_0x2cf6('0x53')]=qs[_0x2cf6('0x6d')](_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x6d')]);_0x248b56[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x778f29['query'],_0x1e44e8[_0x2cf6('0x4c')]));_0x248b56[_0x2cf6('0x5a')][_0x2cf6('0x6e')]=_0x10ecdd['id'];if(_0x778f29[_0x2cf6('0x4a')]['filter']){_0x248b56['where']=_[_0x2cf6('0x56')](_0x248b56[_0x2cf6('0x5a')],{'$or':_[_0x2cf6('0x45')](_0x248b56[_0x2cf6('0x4f')],function(_0x3314d2){var _0x3e7076={};_0x3e7076[_0x3314d2]={'$like':'%'+_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x3e7076;})});}_0x248b56=_['merge']({},_0x248b56,_0x778f29[_0x2cf6('0x59')]);return db[_0x2cf6('0x93')][_0x2cf6('0x35')]({'where':_0x248b56[_0x2cf6('0x5a')]})[_0x2cf6('0x24')](function(_0x30cd3c){_0x216cb6['count']=_0x30cd3c;if(_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x248b56[_0x2cf6('0x5c')]=[{'model':db[_0x2cf6('0x75')],'as':_0x2cf6('0xb0'),'required':![]},{'model':db[_0x2cf6('0x9e')],'as':_0x2cf6('0xb1'),'attributes':[_0x2cf6('0x41'),_0x2cf6('0xb2'),_0x2cf6('0xb3')],'required':![]},{'model':db['Tag'],'as':_0x2cf6('0xb4'),'attributes':['id','name',_0x2cf6('0xb5')],'where':_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0xb6')]?{'id':_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0xb6')]}:undefined,'required':_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0xb6')]?!![]:![]}];}return db[_0x2cf6('0x93')]['findAll'](_0x248b56);})[_0x2cf6('0x24')](function(_0x4b264b){_0x216cb6['rows']=_0x4b264b;return _0x216cb6;});}})[_0x2cf6('0x24')](respondWithFilteredResult(_0x48a4c9,_0x248b56))[_0x2cf6('0x2e')](handleError(_0x48a4c9,null));};exports[_0x2cf6('0xb7')]=function(_0x14a8bf,_0x35f0c8,_0x168d2b){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x14a8bf['params']['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x35f0c8,null))['then'](function(_0x4ac108){if(_0x4ac108){return _0x4ac108[_0x2cf6('0xb7')](_0x14a8bf[_0x2cf6('0x62')][_0x2cf6('0x70')],_[_0x2cf6('0xb8')](_0x14a8bf[_0x2cf6('0x62')],[_0x2cf6('0x70'),'id'])||{})[_0x2cf6('0x96')](function(_0x2f8009){for(var _0x441b11=0x0;_0x441b11<_0x14a8bf[_0x2cf6('0x62')][_0x2cf6('0x70')][_0x2cf6('0x50')];_0x441b11+=0x1){socket['emit'](_0x2cf6('0xb9'),{'UserId':Number(_0x14a8bf['body'][_0x2cf6('0x70')][_0x441b11]),'OpenchannelAccountId':Number(_0x14a8bf[_0x2cf6('0x5f')]['id'])});}return _0x2f8009;});}})[_0x2cf6('0x24')](respondWithResult(_0x35f0c8,null))[_0x2cf6('0x2e')](handleError(_0x35f0c8,null));};exports[_0x2cf6('0xba')]=function(_0x1d9efa,_0x273b1e,_0x337e00){return db['OpenchannelAccount']['find']({'where':{'id':_0x1d9efa[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x273b1e,null))[_0x2cf6('0x24')](function(_0x2ba87f){if(_0x2ba87f){return _0x2ba87f['removeAgents'](_0x1d9efa[_0x2cf6('0x4a')]['ids'])[_0x2cf6('0x24')](function(){if(_[_0x2cf6('0xbb')](_0x1d9efa['query'][_0x2cf6('0x70')])){for(var _0x2c68dd=0x0;_0x2c68dd<_0x1d9efa['query'][_0x2cf6('0x70')]['length'];_0x2c68dd+=0x1){socket[_0x2cf6('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1d9efa[_0x2cf6('0x4a')]['ids'][_0x2c68dd]),'OpenchannelAccountId':Number(_0x1d9efa[_0x2cf6('0x5f')]['id'])});}}else{socket[_0x2cf6('0xbc')](_0x2cf6('0xbd'),{'UserId':Number(_0x1d9efa['query'][_0x2cf6('0x70')]),'OpenchannelAccountId':Number(_0x1d9efa[_0x2cf6('0x5f')]['id'])});}});}})[_0x2cf6('0x24')](respondWithStatusCode(_0x273b1e,null))[_0x2cf6('0x2e')](handleError(_0x273b1e,null));};exports['getAgents']=function(_0x308a8e,_0x24b7da,_0x110e57){var _0x2d42e6={};var _0x1a6ffc={};var _0x78f15b;var _0x5c6d2c;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x308a8e[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x24b7da,null))[_0x2cf6('0x24')](function(_0x6e3e78){if(_0x6e3e78){_0x78f15b=_0x6e3e78;_0x1a6ffc[_0x2cf6('0x49')]=_['keys'](db[_0x2cf6('0x9e')][_0x2cf6('0x60')]);_0x1a6ffc[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x308a8e['query']);_0x1a6ffc[_0x2cf6('0x4c')]=_['intersection'](_0x1a6ffc[_0x2cf6('0x49')],_0x1a6ffc[_0x2cf6('0x4a')]);_0x2d42e6[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x1a6ffc['model'],qs['fields'](_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x2d42e6['attributes']=_0x2d42e6[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x2d42e6['attributes']:_0x1a6ffc[_0x2cf6('0x49')];_0x2d42e6[_0x2cf6('0x53')]=qs['sort'](_0x308a8e[_0x2cf6('0x4a')]['sort']);_0x2d42e6[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x308a8e['query'],_0x1a6ffc[_0x2cf6('0x4c')]));if(_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x55')]){_0x2d42e6[_0x2cf6('0x5a')]=_[_0x2cf6('0x56')](_0x2d42e6[_0x2cf6('0x5a')],{'$or':_['map'](_0x2d42e6['attributes'],function(_0x3fc413){var _0x1be8c7={};_0x1be8c7[_0x3fc413]={'$like':'%'+_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x1be8c7;})});}_0x2d42e6=_['merge']({},_0x2d42e6,_0x308a8e[_0x2cf6('0x59')]);return _0x78f15b[_0x2cf6('0xbe')](_0x2d42e6);}})[_0x2cf6('0x24')](function(_0x183d8b){if(_0x183d8b){_0x5c6d2c=_0x183d8b['length'];if(!_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x51')](_0x2cf6('0x52'))){_0x2d42e6[_0x2cf6('0x34')]=qs[_0x2cf6('0x34')](_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x2d42e6['offset']=qs[_0x2cf6('0x32')](_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x32')]);}return _0x78f15b[_0x2cf6('0xbe')](_0x2d42e6);}})['then'](function(_0x410aef){if(_0x410aef){return _0x410aef?{'count':_0x5c6d2c,'rows':_0x410aef}:null;}})[_0x2cf6('0x24')](respondWithResult(_0x24b7da,null))[_0x2cf6('0x2e')](handleError(_0x24b7da,null));};exports[_0x2cf6('0xad')]=function(_0x5e30db,_0x527219,_0x1f7c4c){var _0x283483,_0x52236a,_0x44a5a1;if(_[_0x2cf6('0x7e')](_0x5e30db[_0x2cf6('0x62')][_0x2cf6('0x62')])||_0x5e30db[_0x2cf6('0x62')][_0x2cf6('0x62')]===''){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))](_0x2cf6('0x7f'));}if(_[_0x2cf6('0x7e')](_0x5e30db['body']['to'])){}_0x283483=_0x5e30db[_0x2cf6('0x62')]['to'];return db[_0x2cf6('0x46')]['findOne']({'where':{'id':_0x5e30db[_0x2cf6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x527219,null))[_0x2cf6('0x24')](function(_0x5123ef){if(_0x5123ef){return db[_0x2cf6('0x46')]['find']({'where':{'id':_0x5123ef['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2cf6('0x75')],'as':_0x2cf6('0x86'),'where':{[_0x5123ef['mapKey']]:_0x283483},'limit':0x1,'order':[['updatedAt',_0x2cf6('0x87')]]}]}]})[_0x2cf6('0x24')](handleEntityNotFound(_0x527219,null))[_0x2cf6('0x24')](function(_0x50d94e){if(_0x50d94e&&_0x50d94e[_0x2cf6('0x85')]){_0x52236a=_0x50d94e[_0x2cf6('0x3d')]({'plain':!![]});if(_0x52236a[_0x2cf6('0x85')]&&_0x52236a[_0x2cf6('0x85')][_0x2cf6('0x86')][_0x2cf6('0x50')]){return _0x52236a[_0x2cf6('0x85')][_0x2cf6('0x86')][0x0];}return db[_0x2cf6('0x75')][_0x2cf6('0x61')](_[_0x2cf6('0xbf')](_0x5e30db[_0x2cf6('0x62')],{'firstName':_0x283483,[_0x50d94e[_0x2cf6('0x80')]]:_0x283483,'phone':_0x283483,'ListId':_0x52236a[_0x2cf6('0x7d')]}));}})['then'](handleEntityNotFound(_0x527219,null))['then'](function(_0x55878e){if(_0x55878e){_0x44a5a1=_0x55878e;return db[_0x2cf6('0x93')]['find']({'where':{'ContactId':_0x44a5a1['id'],'closed':![],'OpenchannelAccountId':_0x52236a['id']}})[_0x2cf6('0x24')](function(_0x1396da){if(_0x1396da){return[_0x1396da,![]];}return db[_0x2cf6('0x93')]['create']({'UserId':_0x5e30db[_0x2cf6('0x64')]['id'],'ContactId':_0x44a5a1['id'],'OpenchannelAccountId':_0x52236a['id'],'lastMsgDirection':'out','firstMsgDirection':_0x2cf6('0xc0'),'Messages':[_['merge'](_0x5e30db[_0x2cf6('0x62')],{'read':![],'body':_0x5e30db['body'][_0x2cf6('0x62')],'OpenchannelAccountId':_0x52236a['id'],'UserId':_0x5e30db[_0x2cf6('0x64')]['id'],'ContactId':_0x44a5a1['id']})]},{'include':[{'model':db[_0x2cf6('0xc1')],'as':_0x2cf6('0xc2')}]})[_0x2cf6('0x24')](function(_0x97fe60){return[_0x97fe60,!![]];});});}})[_0x2cf6('0x96')](function(_0x3c900b,_0x905f21){if(_0x905f21){return _0x3c900b;}return db['OpenchannelMessage'][_0x2cf6('0x61')](_[_0x2cf6('0x56')](_0x5e30db[_0x2cf6('0x62')],{'read':![],'body':_0x5e30db[_0x2cf6('0x62')][_0x2cf6('0x62')],'OpenchannelAccountId':_0x52236a['id'],'OpenchannelInteractionId':_0x3c900b['id'],'UserId':_0x5e30db[_0x2cf6('0x64')]['id'],'ContactId':_0x44a5a1['id']}))[_0x2cf6('0x24')](function(_0x4e1ce8){_0x3c900b[_0x2cf6('0xc3')][_0x2cf6('0xc2')]=[];_0x3c900b[_0x2cf6('0xc3')][_0x2cf6('0xc2')][_0x2cf6('0x9b')](_0x4e1ce8[_0x2cf6('0xc3')]);return _0x3c900b;});});}})['then'](respondWithResult(_0x527219,null))[_0x2cf6('0x2e')](handleError(_0x527219,null));}; \ No newline at end of file +var _0xeb5d=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','result','message','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelAccount','include','findAll','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','includeAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','DESC','OpenchannelApplication','Applications','applications','list','orderBy','account','Contacts','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','lastName','messageId','created','interaction','push','close','unmanaged','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','getApplications','Contact','Owner','fullname','Tags','color','tag','addAgents','omit','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','spread','dataValues','Messages','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x5d449f,_0x5ccccc){var _0x3d2b68=function(_0x4de126){while(--_0x4de126){_0x5d449f['push'](_0x5d449f['shift']());}};_0x3d2b68(++_0x5ccccc);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xeb5d[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdeb5('0x0'));var zipdir=require(_0xdeb5('0x1'));var jsonpatch=require(_0xdeb5('0x2'));var rp=require(_0xdeb5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdeb5('0x4'));var util=require(_0xdeb5('0x5'));var path=require('path');var sox=require(_0xdeb5('0x6'));var csv=require(_0xdeb5('0x7'));var ejs=require(_0xdeb5('0x8'));var fs=require('fs');var fs_extra=require(_0xdeb5('0x9'));var _=require(_0xdeb5('0xa'));var squel=require(_0xdeb5('0xb'));var crypto=require(_0xdeb5('0xc'));var jsforce=require(_0xdeb5('0xd'));var deskjs=require(_0xdeb5('0xe'));var toCsv=require(_0xdeb5('0x7'));var querystring=require(_0xdeb5('0xf'));var Papa=require(_0xdeb5('0x10'));var Redis=require(_0xdeb5('0x11'));var authService=require(_0xdeb5('0x12'));var qs=require(_0xdeb5('0x13'));var as=require(_0xdeb5('0x14'));var hardwareService=require(_0xdeb5('0x15'));var logger=require('../../config/logger')(_0xdeb5('0x16'));var utils=require(_0xdeb5('0x17'));var config=require(_0xdeb5('0x18'));var licenseUtil=require(_0xdeb5('0x19'));var db=require(_0xdeb5('0x1a'))['db'];config[_0xdeb5('0x1b')]=_[_0xdeb5('0x1c')](config[_0xdeb5('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xdeb5('0x1d'))(new Redis(config['redis']));require(_0xdeb5('0x1e'))[_0xdeb5('0x1f')](socket);var jayson=require(_0xdeb5('0x20'));var client=jayson[_0xdeb5('0x21')][_0xdeb5('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xdeb5('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x384145,_0x5caec0,_0x17312b,_0x835c99){return new BPromise(function(_0x3521b2,_0x4ca7dd){var _0x5c6b5d=_0x835c99||client;return _0x5c6b5d[_0xdeb5('0x23')](_0x384145,_0x17312b)['then'](function(_0x1679ee){logger[_0xdeb5('0x24')](_0xdeb5('0x25'),_0x5caec0,'request\x20sent');logger[_0xdeb5('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5caec0,_0xdeb5('0x27'),JSON[_0xdeb5('0x28')](_0x1679ee));if(_0x1679ee[_0xdeb5('0x29')]){if(_0x1679ee[_0xdeb5('0x29')][_0xdeb5('0x2a')]===0x1f4){logger['error'](_0xdeb5('0x25'),_0x5caec0,_0x1679ee[_0xdeb5('0x29')]['message']);return _0x4ca7dd(_0x1679ee['error']['message']);}logger[_0xdeb5('0x29')](_0xdeb5('0x25'),_0x5caec0,_0x1679ee[_0xdeb5('0x29')]['message']);return _0x3521b2(_0x1679ee[_0xdeb5('0x29')]['message']);}else{logger[_0xdeb5('0x24')](_0xdeb5('0x25'),_0x5caec0,_0xdeb5('0x27'));_0x3521b2(_0x1679ee[_0xdeb5('0x2b')][_0xdeb5('0x2c')]);}})[_0xdeb5('0x2d')](function(_0x200e56){logger[_0xdeb5('0x29')](_0xdeb5('0x25'),_0x5caec0,_0x200e56);_0x4ca7dd(_0x200e56);});});}function respondWithStatusCode(_0x1a30b1,_0x5675a4){_0x5675a4=_0x5675a4||0xcc;return function(_0x466ca7){if(_0x466ca7){return _0x1a30b1[_0xdeb5('0x2e')](_0x5675a4);}return _0x1a30b1[_0xdeb5('0x2f')](_0x5675a4)[_0xdeb5('0x30')]();};}function respondWithResult(_0x546f86,_0x484d6e){_0x484d6e=_0x484d6e||0xc8;return function(_0x25e2f0){if(_0x25e2f0){return _0x546f86[_0xdeb5('0x2f')](_0x484d6e)['json'](_0x25e2f0);}};}function respondWithFilteredResult(_0x1321ba,_0x4eb19b){return function(_0x41bf2b){if(_0x41bf2b){var _0x37a417=typeof _0x4eb19b['offset']==='undefined'&&typeof _0x4eb19b[_0xdeb5('0x31')]===_0xdeb5('0x32');var _0x3da43a=_0x41bf2b[_0xdeb5('0x33')];var _0x12931a=_0x37a417?0x0:_0x4eb19b['offset'];var _0x196e4e=_0x37a417?_0x41bf2b[_0xdeb5('0x33')]:_0x4eb19b[_0xdeb5('0x34')]+_0x4eb19b[_0xdeb5('0x31')];var _0x3d5dfc;if(_0x196e4e>=_0x3da43a){_0x196e4e=_0x3da43a;_0x3d5dfc=0xc8;}else{_0x3d5dfc=0xce;}_0x1321ba[_0xdeb5('0x2f')](_0x3d5dfc);return _0x1321ba[_0xdeb5('0x35')](_0xdeb5('0x36'),_0x12931a+'-'+_0x196e4e+'/'+_0x3da43a)[_0xdeb5('0x37')](_0x41bf2b);}return null;};}function patchUpdates(_0x30f75f){return function(_0x50a38a){try{jsonpatch[_0xdeb5('0x38')](_0x50a38a,_0x30f75f,!![]);}catch(_0x256c77){return BPromise['reject'](_0x256c77);}return _0x50a38a[_0xdeb5('0x39')]();};}function saveUpdates(_0x5e16c5,_0x471f75){return function(_0x44cac8){if(_0x44cac8){return _0x44cac8[_0xdeb5('0x3a')](_0x5e16c5)['then'](function(_0x39c2e4){return _0x39c2e4;});}return null;};}function removeEntity(_0x4fcf9f,_0x51bfdb){return function(_0x341ccd){if(_0x341ccd){return _0x341ccd['destroy']()[_0xdeb5('0x3b')](function(){var _0x3015a7=_0x341ccd[_0xdeb5('0x3c')]({'plain':!![]});var _0x1e1a2c=_0xdeb5('0x3d');return db[_0xdeb5('0x3e')][_0xdeb5('0x3f')]({'where':{'type':_0x1e1a2c,'resourceId':_0x3015a7['id']}})[_0xdeb5('0x3b')](function(){return _0x341ccd;});})['then'](function(){_0x4fcf9f[_0xdeb5('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x105c3a,_0x1e3421){return function(_0x84f87b){if(!_0x84f87b){_0x105c3a[_0xdeb5('0x2e')](0x194);}return _0x84f87b;};}function handleError(_0x24a1b6,_0x33db4e){_0x33db4e=_0x33db4e||0x1f4;return function(_0x216c67){logger[_0xdeb5('0x29')](_0x216c67[_0xdeb5('0x40')]);if(_0x216c67[_0xdeb5('0x41')]){delete _0x216c67[_0xdeb5('0x41')];}_0x24a1b6[_0xdeb5('0x2f')](_0x33db4e)[_0xdeb5('0x42')](_0x216c67);};}exports[_0xdeb5('0x43')]=function(_0x44ed3c,_0x4c91ef){var _0x45f6fe={'include':[{'model':db[_0xdeb5('0x44')],'as':_0xdeb5('0x45')}]},_0x4f0d5e={},_0x322308={'count':0x0,'rows':[]};var _0x415e99=_[_0xdeb5('0x46')](db['OpenchannelAccount']['rawAttributes'],function(_0x1133c8){return{'name':_0x1133c8[_0xdeb5('0x47')],'type':_0x1133c8[_0xdeb5('0x48')]['key']};});_0x4f0d5e[_0xdeb5('0x49')]=_['map'](_0x415e99,_0xdeb5('0x41'));_0x4f0d5e[_0xdeb5('0x4a')]=_[_0xdeb5('0x4b')](_0x44ed3c['query']);_0x4f0d5e[_0xdeb5('0x4c')]=_[_0xdeb5('0x4d')](_0x4f0d5e[_0xdeb5('0x49')],_0x4f0d5e[_0xdeb5('0x4a')]);_0x45f6fe['attributes']=_[_0xdeb5('0x4d')](_0x4f0d5e[_0xdeb5('0x49')],qs['fields'](_0x44ed3c[_0xdeb5('0x4a')][_0xdeb5('0x4e')]));_0x45f6fe[_0xdeb5('0x4f')]=_0x45f6fe[_0xdeb5('0x4f')][_0xdeb5('0x50')]?_0x45f6fe[_0xdeb5('0x4f')]:_0x4f0d5e[_0xdeb5('0x49')];if(!_0x44ed3c[_0xdeb5('0x4a')][_0xdeb5('0x51')](_0xdeb5('0x52'))){_0x45f6fe['limit']=qs[_0xdeb5('0x31')](_0x44ed3c[_0xdeb5('0x4a')][_0xdeb5('0x31')]);_0x45f6fe[_0xdeb5('0x34')]=qs[_0xdeb5('0x34')](_0x44ed3c[_0xdeb5('0x4a')][_0xdeb5('0x34')]);}_0x45f6fe[_0xdeb5('0x53')]=qs[_0xdeb5('0x54')](_0x44ed3c['query'][_0xdeb5('0x54')]);_0x45f6fe[_0xdeb5('0x55')]=qs['filters'](_[_0xdeb5('0x56')](_0x44ed3c[_0xdeb5('0x4a')],_0x4f0d5e[_0xdeb5('0x4c')]),_0x415e99);if(_0x44ed3c[_0xdeb5('0x4a')]['filter']){_0x45f6fe[_0xdeb5('0x55')]=_[_0xdeb5('0x57')](_0x45f6fe['where'],{'$or':_['map'](_0x415e99,function(_0xaf5be0){if(_0xaf5be0[_0xdeb5('0x48')]!==_0xdeb5('0x58')){var _0x23b6f4={};_0x23b6f4[_0xaf5be0[_0xdeb5('0x41')]]={'$like':'%'+_0x44ed3c['query'][_0xdeb5('0x59')]+'%'};return _0x23b6f4;}})});}_0x45f6fe=_[_0xdeb5('0x57')]({},_0x45f6fe,_0x44ed3c[_0xdeb5('0x5a')]);var _0x31787b={'where':_0x45f6fe[_0xdeb5('0x55')]};return db[_0xdeb5('0x5b')][_0xdeb5('0x33')](_0x31787b)[_0xdeb5('0x3b')](function(_0x150a8f){_0x322308['count']=_0x150a8f;if(_0x44ed3c[_0xdeb5('0x4a')]['includeAll']){_0x45f6fe[_0xdeb5('0x5c')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xdeb5('0x5d')](_0x45f6fe);})[_0xdeb5('0x3b')](function(_0xeee8b9){_0x322308[_0xdeb5('0x5e')]=_0xeee8b9;return _0x322308;})[_0xdeb5('0x3b')](respondWithFilteredResult(_0x4c91ef,_0x45f6fe))[_0xdeb5('0x2d')](handleError(_0x4c91ef,null));};exports[_0xdeb5('0x5f')]=function(_0x154b5c,_0x46ad0d){var _0x9df710={'raw':![],'where':{'id':_0x154b5c[_0xdeb5('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0xdeb5('0x45')}]},_0x2853ed={};_0x2853ed[_0xdeb5('0x49')]=_[_0xdeb5('0x4b')](db['OpenchannelAccount'][_0xdeb5('0x61')]);_0x2853ed[_0xdeb5('0x4a')]=_[_0xdeb5('0x4b')](_0x154b5c['query']);_0x2853ed[_0xdeb5('0x4c')]=_[_0xdeb5('0x4d')](_0x2853ed[_0xdeb5('0x49')],_0x2853ed[_0xdeb5('0x4a')]);_0x9df710['attributes']=_[_0xdeb5('0x4d')](_0x2853ed['model'],qs[_0xdeb5('0x4e')](_0x154b5c[_0xdeb5('0x4a')]['fields']));_0x9df710[_0xdeb5('0x4f')]=_0x9df710[_0xdeb5('0x4f')][_0xdeb5('0x50')]?_0x9df710[_0xdeb5('0x4f')]:_0x2853ed[_0xdeb5('0x49')];if(_0x154b5c['query']['includeAll']){_0x9df710[_0xdeb5('0x5c')]=[{'all':!![]}];}_0x9df710=_[_0xdeb5('0x57')]({},_0x9df710,_0x154b5c['options']);return db['OpenchannelAccount'][_0xdeb5('0x62')](_0x9df710)[_0xdeb5('0x3b')](handleEntityNotFound(_0x46ad0d,null))[_0xdeb5('0x3b')](respondWithResult(_0x46ad0d,null))['catch'](handleError(_0x46ad0d,null));};exports['create']=function(_0x571d61,_0x1f1171){return db[_0xdeb5('0x5b')][_0xdeb5('0x63')](_0x571d61[_0xdeb5('0x64')],{})[_0xdeb5('0x3b')](function(_0x74b881){var _0xf12c77=_0x571d61[_0xdeb5('0x65')][_0xdeb5('0x3c')]({'plain':!![]});if(!_0xf12c77)throw new Error(_0xdeb5('0x66'));if(_0xf12c77['role']===_0xdeb5('0x65')){var _0xe8f948=_0x74b881[_0xdeb5('0x3c')]({'plain':!![]});var _0x116b5a='OpenchannelAccounts';return db[_0xdeb5('0x67')][_0xdeb5('0x62')]({'where':{'name':_0x116b5a,'userProfileId':_0xf12c77[_0xdeb5('0x68')]},'raw':!![]})['then'](function(_0x2df105){if(_0x2df105&&_0x2df105[_0xdeb5('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0xe8f948[_0xdeb5('0x41')],'resourceId':_0xe8f948['id'],'type':_0x2df105[_0xdeb5('0x41')],'sectionId':_0x2df105['id']},{})[_0xdeb5('0x3b')](function(){return _0x74b881;});}else{return _0x74b881;}})[_0xdeb5('0x2d')](function(_0x23acb6){logger['error'](_0xdeb5('0x6a'),_0x23acb6);throw _0x23acb6;});}return _0x74b881;})['then'](respondWithResult(_0x1f1171,0xc9))[_0xdeb5('0x2d')](handleError(_0x1f1171,null));};exports[_0xdeb5('0x3a')]=function(_0x449445,_0x51e3d8){if(_0x449445['body']['id']){delete _0x449445[_0xdeb5('0x64')]['id'];}return db['OpenchannelAccount'][_0xdeb5('0x62')]({'where':{'id':_0x449445[_0xdeb5('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0xdeb5('0x45')}]})[_0xdeb5('0x3b')](handleEntityNotFound(_0x51e3d8,null))[_0xdeb5('0x3b')](saveUpdates(_0x449445[_0xdeb5('0x64')],null))[_0xdeb5('0x3b')](respondWithResult(_0x51e3d8,null))[_0xdeb5('0x2d')](handleError(_0x51e3d8,null));};exports[_0xdeb5('0x3f')]=function(_0x2918a8,_0x4d4a0d){return db['OpenchannelAccount'][_0xdeb5('0x62')]({'where':{'id':_0x2918a8[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x4d4a0d,null))[_0xdeb5('0x3b')](removeEntity(_0x4d4a0d,null))[_0xdeb5('0x2d')](handleError(_0x4d4a0d,null));};exports['describe']=function(_0x408824,_0x38598f){return db[_0xdeb5('0x5b')][_0xdeb5('0x6b')]()[_0xdeb5('0x3b')](respondWithResult(_0x38598f,null))['catch'](handleError(_0x38598f,null));};exports[_0xdeb5('0x6c')]=function(_0x1cc113,_0x18589a,_0x5eb957){if(_0x1cc113['body']['id']){delete _0x1cc113['body']['id'];}return db[_0xdeb5('0x5b')][_0xdeb5('0x62')]({'where':{'id':_0x1cc113[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x18589a,null))[_0xdeb5('0x3b')](function(_0x1d7d1a){if(_0x1d7d1a){_0x1cc113['body'][_0xdeb5('0x6d')]=_0x1d7d1a['id'];return db[_0xdeb5('0x6e')]['create'](_0x1cc113[_0xdeb5('0x64')]);}})[_0xdeb5('0x3b')](respondWithResult(_0x18589a,null))[_0xdeb5('0x2d')](handleError(_0x18589a,null));};exports[_0xdeb5('0x6f')]=function(_0x3537b0,_0x2575a0,_0x1dad47){var _0xd4866b={'raw':![],'where':{}};var _0x4c80dc={};var _0x17f5ee={'count':0x0,'rows':[]};return db[_0xdeb5('0x5b')]['findOne']({'where':{'id':_0x3537b0[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x2575a0,null))[_0xdeb5('0x3b')](function(_0x1fb8f5){if(_0x1fb8f5){_0x4c80dc[_0xdeb5('0x49')]=_[_0xdeb5('0x4b')](db[_0xdeb5('0x6e')][_0xdeb5('0x61')]);_0x4c80dc[_0xdeb5('0x4a')]=_[_0xdeb5('0x4b')](_0x3537b0[_0xdeb5('0x4a')]);_0x4c80dc[_0xdeb5('0x4c')]=_[_0xdeb5('0x4d')](_0x4c80dc[_0xdeb5('0x49')],_0x4c80dc[_0xdeb5('0x4a')]);_0xd4866b[_0xdeb5('0x4f')]=_[_0xdeb5('0x4d')](_0x4c80dc[_0xdeb5('0x49')],qs['fields'](_0x3537b0['query'][_0xdeb5('0x4e')]));_0xd4866b[_0xdeb5('0x4f')]=_0xd4866b[_0xdeb5('0x4f')][_0xdeb5('0x50')]?_0xd4866b[_0xdeb5('0x4f')]:_0x4c80dc[_0xdeb5('0x49')];if(!_0x3537b0[_0xdeb5('0x4a')][_0xdeb5('0x51')]('nolimit')){_0xd4866b[_0xdeb5('0x31')]=qs['limit'](_0x3537b0[_0xdeb5('0x4a')]['limit']);_0xd4866b[_0xdeb5('0x34')]=qs[_0xdeb5('0x34')](_0x3537b0[_0xdeb5('0x4a')][_0xdeb5('0x34')]);}_0xd4866b[_0xdeb5('0x53')]=qs[_0xdeb5('0x54')](_0x3537b0[_0xdeb5('0x4a')][_0xdeb5('0x54')]);_0xd4866b['where']=qs['filters'](_[_0xdeb5('0x56')](_0x3537b0[_0xdeb5('0x4a')],_0x4c80dc[_0xdeb5('0x4c')]));_0xd4866b['where']['OpenchannelAccountId']=_0x1fb8f5['id'];if(_0x3537b0['query'][_0xdeb5('0x59')]){_0xd4866b['where']=_[_0xdeb5('0x57')](_0xd4866b[_0xdeb5('0x55')],{'$or':_['map'](_0xd4866b[_0xdeb5('0x4f')],function(_0xbfd2cd){var _0x2083aa={};_0x2083aa[_0xbfd2cd]={'$like':'%'+_0x3537b0[_0xdeb5('0x4a')][_0xdeb5('0x59')]+'%'};return _0x2083aa;})});}_0xd4866b=_[_0xdeb5('0x57')]({},_0xd4866b,_0x3537b0['options']);return db[_0xdeb5('0x6e')][_0xdeb5('0x33')]({'where':_0xd4866b[_0xdeb5('0x55')]})[_0xdeb5('0x3b')](function(_0x5a3d22){_0x17f5ee[_0xdeb5('0x33')]=_0x5a3d22;if(_0x3537b0[_0xdeb5('0x4a')][_0xdeb5('0x70')]){_0xd4866b[_0xdeb5('0x5c')]=[{'all':!![]}];}return db[_0xdeb5('0x6e')]['findAll'](_0xd4866b);})[_0xdeb5('0x3b')](function(_0x1fdb92){_0x17f5ee[_0xdeb5('0x5e')]=_0x1fdb92;return _0x17f5ee;});}})[_0xdeb5('0x3b')](respondWithFilteredResult(_0x2575a0,_0xd4866b))[_0xdeb5('0x2d')](handleError(_0x2575a0,null));};exports[_0xdeb5('0x71')]=function(_0x376a12,_0x54403f,_0x330434){return db['OpenchannelAccount'][_0xdeb5('0x62')]({'where':{'id':_0x376a12[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x54403f,null))[_0xdeb5('0x3b')](function(_0x1d619b){if(_0x1d619b){return _0x1d619b['removeDispositions'](_0x376a12[_0xdeb5('0x4a')][_0xdeb5('0x72')]);}})['then'](respondWithStatusCode(_0x54403f,null))[_0xdeb5('0x2d')](handleError(_0x54403f,null));};exports[_0xdeb5('0x73')]=function(_0xf7bd35,_0x3e0cce,_0x196624){if(_0xf7bd35[_0xdeb5('0x64')]['id']){delete _0xf7bd35[_0xdeb5('0x64')]['id'];}return db[_0xdeb5('0x5b')]['find']({'where':{'id':_0xf7bd35[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x3e0cce,null))[_0xdeb5('0x3b')](function(_0x54291d){if(_0x54291d){_0xf7bd35[_0xdeb5('0x64')][_0xdeb5('0x6d')]=_0x54291d['id'];return db['CannedAnswer'][_0xdeb5('0x63')](_0xf7bd35['body']);}})['then'](respondWithResult(_0x3e0cce,null))[_0xdeb5('0x2d')](handleError(_0x3e0cce,null));};exports[_0xdeb5('0x74')]=function(_0x6e10bd,_0x246740,_0x307306){var _0x407798={'raw':![],'where':{}};var _0x48e94e={};var _0x12ed42={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xdeb5('0x75')]({'where':{'id':_0x6e10bd[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x246740,null))[_0xdeb5('0x3b')](function(_0xf687a6){if(_0xf687a6){_0x48e94e['model']=_[_0xdeb5('0x4b')](db['CannedAnswer'][_0xdeb5('0x61')]);_0x48e94e[_0xdeb5('0x4a')]=_[_0xdeb5('0x4b')](_0x6e10bd[_0xdeb5('0x4a')]);_0x48e94e[_0xdeb5('0x4c')]=_['intersection'](_0x48e94e[_0xdeb5('0x49')],_0x48e94e[_0xdeb5('0x4a')]);_0x407798[_0xdeb5('0x4f')]=_[_0xdeb5('0x4d')](_0x48e94e[_0xdeb5('0x49')],qs[_0xdeb5('0x4e')](_0x6e10bd[_0xdeb5('0x4a')][_0xdeb5('0x4e')]));_0x407798[_0xdeb5('0x4f')]=_0x407798[_0xdeb5('0x4f')]['length']?_0x407798[_0xdeb5('0x4f')]:_0x48e94e['model'];if(!_0x6e10bd[_0xdeb5('0x4a')][_0xdeb5('0x51')](_0xdeb5('0x52'))){_0x407798[_0xdeb5('0x31')]=qs[_0xdeb5('0x31')](_0x6e10bd[_0xdeb5('0x4a')]['limit']);_0x407798[_0xdeb5('0x34')]=qs[_0xdeb5('0x34')](_0x6e10bd[_0xdeb5('0x4a')][_0xdeb5('0x34')]);}_0x407798[_0xdeb5('0x53')]=qs['sort'](_0x6e10bd[_0xdeb5('0x4a')][_0xdeb5('0x54')]);_0x407798[_0xdeb5('0x55')]=qs[_0xdeb5('0x4c')](_[_0xdeb5('0x56')](_0x6e10bd[_0xdeb5('0x4a')],_0x48e94e[_0xdeb5('0x4c')]));_0x407798[_0xdeb5('0x55')][_0xdeb5('0x6d')]=_0xf687a6['id'];if(_0x6e10bd[_0xdeb5('0x4a')][_0xdeb5('0x59')]){_0x407798['where']=_[_0xdeb5('0x57')](_0x407798[_0xdeb5('0x55')],{'$or':_[_0xdeb5('0x46')](_0x407798[_0xdeb5('0x4f')],function(_0x24f2fa){var _0x4abc70={};_0x4abc70[_0x24f2fa]={'$like':'%'+_0x6e10bd[_0xdeb5('0x4a')]['filter']+'%'};return _0x4abc70;})});}_0x407798=_['merge']({},_0x407798,_0x6e10bd['options']);return db[_0xdeb5('0x76')]['count']({'where':_0x407798['where']})[_0xdeb5('0x3b')](function(_0x15a2dd){_0x12ed42[_0xdeb5('0x33')]=_0x15a2dd;if(_0x6e10bd['query'][_0xdeb5('0x70')]){_0x407798['include']=[{'all':!![]}];}return db[_0xdeb5('0x76')]['findAll'](_0x407798);})[_0xdeb5('0x3b')](function(_0x3f3df3){_0x12ed42[_0xdeb5('0x5e')]=_0x3f3df3;return _0x12ed42;});}})['then'](respondWithFilteredResult(_0x246740,_0x407798))[_0xdeb5('0x2d')](handleError(_0x246740,null));};exports[_0xdeb5('0x77')]=function(_0xf58c28,_0xe1982d,_0xde5bf1){return db[_0xdeb5('0x5b')][_0xdeb5('0x62')]({'where':{'id':_0xf58c28[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0xe1982d,null))[_0xdeb5('0x3b')](function(_0x11c378){if(_0x11c378){return _0x11c378[_0xdeb5('0x77')](_0xf58c28['query'][_0xdeb5('0x72')]);}})[_0xdeb5('0x3b')](respondWithStatusCode(_0xe1982d,null))[_0xdeb5('0x2d')](handleError(_0xe1982d,null));};exports[_0xdeb5('0x78')]=function(_0x178c61,_0x39a161,_0x573621){var _0x1fca59={'body':_0x178c61['body'],'channel':_0xdeb5('0x79')};var _0x381c44=[];var _0x58dcc7=[];var _0xec38af={};var _0x22b585=![];return db[_0xdeb5('0x7a')][_0xdeb5('0x6b')]()[_0xdeb5('0x3b')](function(_0x3b9d72){if(!_0x3b9d72){throw new db[(_0xdeb5('0x7b'))][(_0xdeb5('0x7c'))]('no\x20available\x20attributes');}_0x381c44=_[_0xdeb5('0x7d')](_[_0xdeb5('0x4b')](_0x3b9d72),[_0xdeb5('0x7e'),_0xdeb5('0x7f')]);_0x58dcc7=_[_0xdeb5('0x7d')](_[_0xdeb5('0x4b')](_0x3b9d72),[_0xdeb5('0x7e'),_0xdeb5('0x7f'),_0xdeb5('0x80'),'ListId']);if(_0x178c61['body']['id']){delete _0x178c61[_0xdeb5('0x64')]['id'];}if(_[_0xdeb5('0x81')](_0x178c61[_0xdeb5('0x64')]['from'])){throw new db[(_0xdeb5('0x7b'))][(_0xdeb5('0x7c'))](_0xdeb5('0x82'));}if(_[_0xdeb5('0x81')](_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x64')])||_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x64')]===''){throw new db[(_0xdeb5('0x7b'))][(_0xdeb5('0x7c'))](_0xdeb5('0x83'));}if(_[_0xdeb5('0x81')](_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x84')])){throw new db[(_0xdeb5('0x7b'))][(_0xdeb5('0x7c'))](_0xdeb5('0x85')+_0x58dcc7);}if(!_[_0xdeb5('0x86')](_0x58dcc7,_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x84')])){throw new db[(_0xdeb5('0x7b'))][(_0xdeb5('0x7c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x58dcc7);}_0xec38af[_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x84')]]=_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x87')];})[_0xdeb5('0x3b')](function(){return db[_0xdeb5('0x5b')][_0xdeb5('0x62')]({'where':{'id':_0x178c61[_0xdeb5('0x60')]['id']},'include':[{'model':db[_0xdeb5('0x88')],'as':_0xdeb5('0x89'),'include':[{'model':db[_0xdeb5('0x7a')],'as':'Contacts','where':_0xec38af,'limit':0x1,'order':[[_0xdeb5('0x7f'),_0xdeb5('0x8a')]]}]},{'model':db[_0xdeb5('0x8b')],'as':_0xdeb5('0x8c')}]});})[_0xdeb5('0x3b')](handleEntityNotFound(_0x39a161,null))[_0xdeb5('0x3b')](function(_0x50b18e){if(_0x50b18e&&_0x50b18e['List']){_0x1fca59['account']=_0x50b18e;_0x1fca59[_0xdeb5('0x8d')]=_0x50b18e[_0xdeb5('0x8c')];_0x1fca59[_0xdeb5('0x8e')]=_0x50b18e[_0xdeb5('0x89')];_0x1fca59[_0xdeb5('0x8d')]=_[_0xdeb5('0x8f')](_0x1fca59[_0xdeb5('0x8d')],['priority'],['asc']);if(_0x1fca59[_0xdeb5('0x90')][_0xdeb5('0x8c')]){delete _0x1fca59[_0xdeb5('0x90')]['Applications'];}if(_0x1fca59[_0xdeb5('0x90')]['List']&&_0x1fca59[_0xdeb5('0x90')][_0xdeb5('0x89')][_0xdeb5('0x91')][_0xdeb5('0x50')]){return _0x1fca59[_0xdeb5('0x90')][_0xdeb5('0x89')][_0xdeb5('0x91')][0x0];}var _0x3c8d7d=_[_0xdeb5('0x1c')](_0x178c61[_0xdeb5('0x64')],{'firstName':_0x178c61['body'][_0xdeb5('0x87')],'ListId':_0x50b18e[_0xdeb5('0x92')]});_0x3c8d7d[_0x178c61['body'][_0xdeb5('0x84')]]=_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x87')];return db[_0xdeb5('0x7a')]['create'](_0x3c8d7d,{'fields':_0x381c44,'raw':!![]});}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x39a161,null))[_0xdeb5('0x3b')](function(_0x311b57){_0x1fca59[_0xdeb5('0x93')]=_0x311b57;if(_0x311b57){var _0x14de1d={'ContactId':_0x311b57['id'],'OpenchannelAccountId':_0x178c61[_0xdeb5('0x60')]['id'],'from':(_0x311b57[_0xdeb5('0x94')]||'')+'\x20'+(_0x311b57['lastName']||'')};var _0x5cc009={'OpenchannelAccountId':_0x178c61['params']['id'],'closed':![]};if(_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x95')]){_0x5cc009[_0xdeb5('0x95')]=_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x95')];return db[_0xdeb5('0x96')][_0xdeb5('0x62')]({'where':_0x5cc009})[_0xdeb5('0x3b')](function(_0x27fc17){if(_0x27fc17){return[_0x27fc17,![]];}_0x14de1d['threadId']=_0x178c61[_0xdeb5('0x64')]['threadId'];_0x14de1d['externalUrl']=_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x97')];return db[_0xdeb5('0x96')][_0xdeb5('0x63')](_0x14de1d)['then'](function(_0x235674){return[_0x235674,!![]];});});}else{_0x5cc009[_0xdeb5('0x95')]=null;}_0x5cc009['ContactId']=_0x311b57['id'];return db['OpenchannelInteraction'][_0xdeb5('0x62')]({'where':_0x5cc009})[_0xdeb5('0x3b')](function(_0x17c4e4){if(_0x17c4e4){return[_0x17c4e4,![]];}return db[_0xdeb5('0x96')][_0xdeb5('0x63')](_0x14de1d)[_0xdeb5('0x3b')](function(_0x2f8d1b){return[_0x2f8d1b,!![]];});});}})['spread'](function(_0x409594,_0x1843cf){if(_0x409594){_0x22b585=_0x1843cf;if(!_0x1843cf){var _0x18ebb6={'from':(_0x1fca59['contact']['firstName']||'')+'\x20'+(_0x1fca59[_0xdeb5('0x93')][_0xdeb5('0x98')]||'')};if(_0x178c61['body'][_0xdeb5('0x95')]&&_0x178c61['body'][_0xdeb5('0x99')]&&_0x178c61['body'][_0xdeb5('0x95')]!=_0x178c61[_0xdeb5('0x64')]['messageId']){_0x18ebb6['threadId']=_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x99')];}return _0x409594[_0xdeb5('0x3a')](_0x18ebb6);}else{return _0x409594;}}})[_0xdeb5('0x3b')](function(_0x2b6e51){_0x1fca59['interaction']=_0x2b6e51['get']({'plain':!![]});_0x1fca59['interaction'][_0xdeb5('0x9a')]=_0x22b585;if(_0x1fca59[_0xdeb5('0x9b')][_0xdeb5('0x9a')]){if(_0x1fca59['account']['autoclose']){_0x1fca59[_0xdeb5('0x8d')][_0xdeb5('0x9c')]({'id':0x0,'priority':_0x1fca59['applications'][_0xdeb5('0x50')]+0x1,'app':_0xdeb5('0x9d'),'appdata':_0xdeb5('0x9e'),'interval':_0xdeb5('0x9f')});}}return db['OpenchannelMessage'][_0xdeb5('0x63')]({'body':_0x178c61[_0xdeb5('0x64')][_0xdeb5('0x64')],'OpenchannelAccountId':_0x178c61[_0xdeb5('0x60')]['id'],'OpenchannelInteractionId':_0x2b6e51['id'],'direction':'in','ContactId':_0x1fca59[_0xdeb5('0x93')]['id'],'AttachmentId':_0x178c61[_0xdeb5('0x64')]['AttachmentId']});})['then'](function(_0x2bdd4d){_0x1fca59['message']=_0x2bdd4d;if(_0x1fca59[_0xdeb5('0x9b')][_0xdeb5('0xa0')]){return db[_0xdeb5('0xa1')][_0xdeb5('0x62')]({'attributes':['id',_0xdeb5('0x41')],'where':{'id':_0x1fca59[_0xdeb5('0x9b')][_0xdeb5('0xa0')]}})[_0xdeb5('0x3b')](function(_0x1fd4c9){if(_0x1fd4c9){_0x1fca59[_0xdeb5('0x8d')][_0xdeb5('0xa2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1fd4c9['name']+','+(_0x1fca59[_0xdeb5('0x90')][_0xdeb5('0xa3')]||0xa),'interval':'*,*,*,*'});_0x1fca59[_0xdeb5('0xa4')]=![];}return respondWithRpcPromise(_0xdeb5('0xa5'),'startRouting',_0x1fca59);});}return respondWithRpcPromise(_0xdeb5('0xa5'),_0xdeb5('0xa6'),_0x1fca59);})[_0xdeb5('0x3b')](function(_0x5e8f87){respondWithRpcPromise(_0xdeb5('0xa7'),_0xdeb5('0xa7'),{'event':'notify','message':_0x5e8f87},client9002);return _0x5e8f87;})[_0xdeb5('0x3b')](respondWithResult(_0x39a161,null))[_0xdeb5('0x2d')](handleError(_0x39a161,null));};exports[_0xdeb5('0xa8')]=function(_0x2b7e0e,_0x288f07){var _0x2aa89f=_0x2b7e0e[_0xdeb5('0x60')]['id'];var _0x203a7a=_0x2b7e0e[_0xdeb5('0x64')];var _0x22e091=0xc8;var _0x7737da=null;return db[_0xdeb5('0xa9')][_0xdeb5('0xaa')]({'isolationLevel':db[_0xdeb5('0xa9')][_0xdeb5('0xab')][_0xdeb5('0xac')][_0xdeb5('0xad')]},function(_0x32429b){return db[_0xdeb5('0x5b')]['findOne']({'where':{'id':_0x2aa89f},'transaction':_0x32429b})['then'](function(_0x209b43){if(_0x209b43){return db[_0xdeb5('0x8b')][_0xdeb5('0x3f')]({'where':{'OpenchannelAccountId':_0x2aa89f},'transaction':_0x32429b})['then'](function(){var _0x45cb9d=_['map'](_0x203a7a,function(_0x545941){_0x545941['OpenchannelAccountId']=_0x2aa89f;return _0x545941;});return db[_0xdeb5('0x8b')][_0xdeb5('0xae')](_0x45cb9d,{'transaction':_0x32429b});});}else{_0x22e091=0x194;_0x7737da=[];}});})[_0xdeb5('0x3b')](function(){if(_0x22e091!==0x194){return db[_0xdeb5('0x8b')][_0xdeb5('0xaf')]({'where':{'OpenchannelAccountId':_0x2aa89f},'order':_0xdeb5('0xb0')})[_0xdeb5('0x3b')](function(_0xfff6f4){_0x7737da=_0xfff6f4;});}})[_0xdeb5('0x2d')](function(_0x2b5535){_0x22e091=0x1f4;logger[_0xdeb5('0x29')](_0x2b5535[_0xdeb5('0x40')]);if(_0x2b5535[_0xdeb5('0x41')]){delete _0x2b5535[_0xdeb5('0x41')];}_0x7737da=_0x2b5535;})['finally'](function(){if(_0x7737da===null){_0x288f07[_0xdeb5('0x2e')](_0x22e091);}else{if(_0x22e091===0x1f4){_0x288f07[_0xdeb5('0x2f')](_0x22e091)[_0xdeb5('0x42')](_0x7737da);}else{_0x288f07[_0xdeb5('0x2f')](_0x22e091)[_0xdeb5('0x37')](_0x7737da);}}});};exports[_0xdeb5('0xb1')]=function(_0x5b0dce,_0x236c53,_0x1d77fd){var _0x182025={};var _0xd88b8={};var _0x43a2b0;var _0x3810dd;return db[_0xdeb5('0x5b')]['findOne']({'where':{'id':_0x5b0dce[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x236c53,null))[_0xdeb5('0x3b')](function(_0x44fc8f){if(_0x44fc8f){_0x43a2b0=_0x44fc8f;_0xd88b8[_0xdeb5('0x49')]=_[_0xdeb5('0x4b')](db['OpenchannelApplication'][_0xdeb5('0x61')]);_0xd88b8[_0xdeb5('0x4a')]=_[_0xdeb5('0x4b')](_0x5b0dce[_0xdeb5('0x4a')]);_0xd88b8['filters']=_[_0xdeb5('0x4d')](_0xd88b8['model'],_0xd88b8['query']);_0x182025['attributes']=_[_0xdeb5('0x4d')](_0xd88b8[_0xdeb5('0x49')],qs[_0xdeb5('0x4e')](_0x5b0dce[_0xdeb5('0x4a')][_0xdeb5('0x4e')]));_0x182025['attributes']=_0x182025[_0xdeb5('0x4f')]['length']?_0x182025[_0xdeb5('0x4f')]:_0xd88b8[_0xdeb5('0x49')];_0x182025[_0xdeb5('0x53')]=qs[_0xdeb5('0x54')](_0x5b0dce[_0xdeb5('0x4a')][_0xdeb5('0x54')]);_0x182025['where']=qs['filters'](_[_0xdeb5('0x56')](_0x5b0dce[_0xdeb5('0x4a')],_0xd88b8[_0xdeb5('0x4c')]));if(_0x5b0dce[_0xdeb5('0x4a')][_0xdeb5('0x59')]){_0x182025[_0xdeb5('0x55')]=_[_0xdeb5('0x57')](_0x182025[_0xdeb5('0x55')],{'$or':_[_0xdeb5('0x46')](_0x182025[_0xdeb5('0x4f')],function(_0x1480e6){var _0x18ac41={};_0x18ac41[_0x1480e6]={'$like':'%'+_0x5b0dce[_0xdeb5('0x4a')][_0xdeb5('0x59')]+'%'};return _0x18ac41;})});}_0x182025=_[_0xdeb5('0x57')]({},_0x182025,_0x5b0dce[_0xdeb5('0x5a')]);return _0x43a2b0[_0xdeb5('0xb1')](_0x182025);}})[_0xdeb5('0x3b')](function(_0x57e672){if(_0x57e672){_0x3810dd=_0x57e672['length'];if(!_0x5b0dce['query'][_0xdeb5('0x51')](_0xdeb5('0x52'))){_0x182025['limit']=qs[_0xdeb5('0x31')](_0x5b0dce[_0xdeb5('0x4a')][_0xdeb5('0x31')]);_0x182025[_0xdeb5('0x34')]=qs[_0xdeb5('0x34')](_0x5b0dce[_0xdeb5('0x4a')][_0xdeb5('0x34')]);}return _0x43a2b0[_0xdeb5('0xb1')](_0x182025);}})['then'](function(_0x52cc3b){if(_0x52cc3b){return _0x52cc3b?{'count':_0x3810dd,'rows':_0x52cc3b}:null;}})['then'](respondWithResult(_0x236c53,null))[_0xdeb5('0x2d')](handleError(_0x236c53,null));};exports['getInteractions']=function(_0x34c835,_0x32d0d8,_0x3114f5){var _0x34ed8b={'raw':![],'where':{}};var _0x3003ae={};var _0x45394a={'count':0x0,'rows':[]};return db[_0xdeb5('0x5b')][_0xdeb5('0x75')]({'where':{'id':_0x34c835[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x32d0d8,null))['then'](function(_0x39202a){if(_0x39202a){_0x3003ae[_0xdeb5('0x49')]=_[_0xdeb5('0x4b')](db[_0xdeb5('0x96')][_0xdeb5('0x61')]);_0x3003ae[_0xdeb5('0x4a')]=_[_0xdeb5('0x4b')](_0x34c835[_0xdeb5('0x4a')]);_0x3003ae['filters']=_[_0xdeb5('0x4d')](_0x3003ae[_0xdeb5('0x49')],_0x3003ae[_0xdeb5('0x4a')]);_0x34ed8b['attributes']=_[_0xdeb5('0x4d')](_0x3003ae['model'],qs[_0xdeb5('0x4e')](_0x34c835[_0xdeb5('0x4a')][_0xdeb5('0x4e')]));_0x34ed8b[_0xdeb5('0x4f')]=_0x34ed8b['attributes'][_0xdeb5('0x50')]?_0x34ed8b[_0xdeb5('0x4f')]:_0x3003ae[_0xdeb5('0x49')];if(!_0x34c835[_0xdeb5('0x4a')]['hasOwnProperty']('nolimit')){_0x34ed8b['limit']=qs['limit'](_0x34c835[_0xdeb5('0x4a')][_0xdeb5('0x31')]);_0x34ed8b[_0xdeb5('0x34')]=qs[_0xdeb5('0x34')](_0x34c835[_0xdeb5('0x4a')]['offset']);}_0x34ed8b['order']=qs[_0xdeb5('0x54')](_0x34c835['query'][_0xdeb5('0x54')]);_0x34ed8b[_0xdeb5('0x55')]=qs[_0xdeb5('0x4c')](_['pick'](_0x34c835['query'],_0x3003ae[_0xdeb5('0x4c')]));_0x34ed8b[_0xdeb5('0x55')]['OpenchannelAccountId']=_0x39202a['id'];if(_0x34c835[_0xdeb5('0x4a')][_0xdeb5('0x59')]){_0x34ed8b['where']=_['merge'](_0x34ed8b[_0xdeb5('0x55')],{'$or':_[_0xdeb5('0x46')](_0x34ed8b[_0xdeb5('0x4f')],function(_0x56902c){var _0x505aba={};_0x505aba[_0x56902c]={'$like':'%'+_0x34c835[_0xdeb5('0x4a')]['filter']+'%'};return _0x505aba;})});}_0x34ed8b=_[_0xdeb5('0x57')]({},_0x34ed8b,_0x34c835[_0xdeb5('0x5a')]);return db['OpenchannelInteraction']['count']({'where':_0x34ed8b['where']})[_0xdeb5('0x3b')](function(_0x26d8c1){_0x45394a['count']=_0x26d8c1;if(_0x34c835[_0xdeb5('0x4a')][_0xdeb5('0x70')]){_0x34ed8b['include']=[{'model':db['CmContact'],'as':_0xdeb5('0xb2'),'required':![]},{'model':db[_0xdeb5('0xa1')],'as':_0xdeb5('0xb3'),'attributes':[_0xdeb5('0x41'),_0xdeb5('0xb4'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xdeb5('0xb5'),'attributes':['id',_0xdeb5('0x41'),_0xdeb5('0xb6')],'where':_0x34c835[_0xdeb5('0x4a')][_0xdeb5('0xb7')]?{'id':_0x34c835[_0xdeb5('0x4a')][_0xdeb5('0xb7')]}:undefined,'required':_0x34c835['query'][_0xdeb5('0xb7')]?!![]:![]}];}return db[_0xdeb5('0x96')]['findAll'](_0x34ed8b);})['then'](function(_0x4c8236){_0x45394a[_0xdeb5('0x5e')]=_0x4c8236;return _0x45394a;});}})[_0xdeb5('0x3b')](respondWithFilteredResult(_0x32d0d8,_0x34ed8b))['catch'](handleError(_0x32d0d8,null));};exports[_0xdeb5('0xb8')]=function(_0x5a439b,_0x247865,_0x41b400){return db['OpenchannelAccount'][_0xdeb5('0x62')]({'where':{'id':_0x5a439b[_0xdeb5('0x60')]['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x247865,null))[_0xdeb5('0x3b')](function(_0x3cdbf8){if(_0x3cdbf8){return _0x3cdbf8[_0xdeb5('0xb8')](_0x5a439b['body'][_0xdeb5('0x72')],_[_0xdeb5('0xb9')](_0x5a439b[_0xdeb5('0x64')],[_0xdeb5('0x72'),'id'])||{})['spread'](function(_0x18c58a){for(var _0x35c279=0x0;_0x35c279<_0x5a439b[_0xdeb5('0x64')]['ids'][_0xdeb5('0x50')];_0x35c279+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x5a439b[_0xdeb5('0x64')]['ids'][_0x35c279]),'OpenchannelAccountId':Number(_0x5a439b[_0xdeb5('0x60')]['id'])});}return _0x18c58a;});}})[_0xdeb5('0x3b')](respondWithResult(_0x247865,null))[_0xdeb5('0x2d')](handleError(_0x247865,null));};exports[_0xdeb5('0xba')]=function(_0x58f4cd,_0x5bf9b7,_0x44218d){return db[_0xdeb5('0x5b')][_0xdeb5('0x62')]({'where':{'id':_0x58f4cd[_0xdeb5('0x60')]['id']}})['then'](handleEntityNotFound(_0x5bf9b7,null))[_0xdeb5('0x3b')](function(_0x5a04c){if(_0x5a04c){return _0x5a04c['removeAgents'](_0x58f4cd[_0xdeb5('0x4a')][_0xdeb5('0x72')])[_0xdeb5('0x3b')](function(){if(_['isArray'](_0x58f4cd[_0xdeb5('0x4a')]['ids'])){for(var _0x4364f5=0x0;_0x4364f5<_0x58f4cd[_0xdeb5('0x4a')]['ids'][_0xdeb5('0x50')];_0x4364f5+=0x1){socket[_0xdeb5('0xbb')](_0xdeb5('0xbc'),{'UserId':Number(_0x58f4cd[_0xdeb5('0x4a')][_0xdeb5('0x72')][_0x4364f5]),'OpenchannelAccountId':Number(_0x58f4cd['params']['id'])});}}else{socket[_0xdeb5('0xbb')](_0xdeb5('0xbc'),{'UserId':Number(_0x58f4cd[_0xdeb5('0x4a')][_0xdeb5('0x72')]),'OpenchannelAccountId':Number(_0x58f4cd[_0xdeb5('0x60')]['id'])});}});}})[_0xdeb5('0x3b')](respondWithStatusCode(_0x5bf9b7,null))[_0xdeb5('0x2d')](handleError(_0x5bf9b7,null));};exports[_0xdeb5('0xbd')]=function(_0x551569,_0x4635fd,_0x3d2924){var _0x38b616={};var _0x394543={};var _0x38375c;var _0x2b9d5a;return db[_0xdeb5('0x5b')][_0xdeb5('0x75')]({'where':{'id':_0x551569['params']['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x4635fd,null))[_0xdeb5('0x3b')](function(_0x50ca8c){if(_0x50ca8c){_0x38375c=_0x50ca8c;_0x394543[_0xdeb5('0x49')]=_['keys'](db['User']['rawAttributes']);_0x394543['query']=_[_0xdeb5('0x4b')](_0x551569['query']);_0x394543[_0xdeb5('0x4c')]=_['intersection'](_0x394543[_0xdeb5('0x49')],_0x394543[_0xdeb5('0x4a')]);_0x38b616['attributes']=_['intersection'](_0x394543['model'],qs['fields'](_0x551569[_0xdeb5('0x4a')][_0xdeb5('0x4e')]));_0x38b616['attributes']=_0x38b616[_0xdeb5('0x4f')][_0xdeb5('0x50')]?_0x38b616['attributes']:_0x394543[_0xdeb5('0x49')];_0x38b616['order']=qs[_0xdeb5('0x54')](_0x551569['query'][_0xdeb5('0x54')]);_0x38b616[_0xdeb5('0x55')]=qs[_0xdeb5('0x4c')](_[_0xdeb5('0x56')](_0x551569[_0xdeb5('0x4a')],_0x394543[_0xdeb5('0x4c')]));if(_0x551569[_0xdeb5('0x4a')][_0xdeb5('0x59')]){_0x38b616[_0xdeb5('0x55')]=_[_0xdeb5('0x57')](_0x38b616[_0xdeb5('0x55')],{'$or':_[_0xdeb5('0x46')](_0x38b616[_0xdeb5('0x4f')],function(_0x1c7387){var _0x27390f={};_0x27390f[_0x1c7387]={'$like':'%'+_0x551569['query'][_0xdeb5('0x59')]+'%'};return _0x27390f;})});}_0x38b616=_[_0xdeb5('0x57')]({},_0x38b616,_0x551569[_0xdeb5('0x5a')]);return _0x38375c['getAgents'](_0x38b616);}})[_0xdeb5('0x3b')](function(_0x5b651f){if(_0x5b651f){_0x2b9d5a=_0x5b651f['length'];if(!_0x551569['query']['hasOwnProperty'](_0xdeb5('0x52'))){_0x38b616['limit']=qs[_0xdeb5('0x31')](_0x551569[_0xdeb5('0x4a')][_0xdeb5('0x31')]);_0x38b616[_0xdeb5('0x34')]=qs[_0xdeb5('0x34')](_0x551569[_0xdeb5('0x4a')]['offset']);}return _0x38375c[_0xdeb5('0xbd')](_0x38b616);}})['then'](function(_0x4da035){if(_0x4da035){return _0x4da035?{'count':_0x2b9d5a,'rows':_0x4da035}:null;}})[_0xdeb5('0x3b')](respondWithResult(_0x4635fd,null))['catch'](handleError(_0x4635fd,null));};exports[_0xdeb5('0x42')]=function(_0x27365d,_0x2955c2,_0x5029be){var _0x3efb95,_0x7503c7,_0x3807f3;if(_[_0xdeb5('0x81')](_0x27365d[_0xdeb5('0x64')][_0xdeb5('0x64')])||_0x27365d[_0xdeb5('0x64')]['body']===''){throw new db[(_0xdeb5('0x7b'))][(_0xdeb5('0x7c'))](_0xdeb5('0x83'));}if(_[_0xdeb5('0x81')](_0x27365d['body']['to'])){}_0x3efb95=_0x27365d['body']['to'];return db[_0xdeb5('0x5b')]['findOne']({'where':{'id':_0x27365d['params']['id']}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x2955c2,null))[_0xdeb5('0x3b')](function(_0x1d087c){if(_0x1d087c){return db[_0xdeb5('0x5b')]['find']({'where':{'id':_0x1d087c['id']},'include':[{'model':db['CmList'],'as':_0xdeb5('0x89'),'include':[{'model':db['CmContact'],'as':_0xdeb5('0x91'),'where':{[_0x1d087c[_0xdeb5('0x84')]]:_0x3efb95},'limit':0x1,'order':[[_0xdeb5('0x7f'),'DESC']]}]}]})[_0xdeb5('0x3b')](handleEntityNotFound(_0x2955c2,null))['then'](function(_0x5b7440){if(_0x5b7440&&_0x5b7440[_0xdeb5('0x89')]){_0x7503c7=_0x5b7440[_0xdeb5('0x3c')]({'plain':!![]});if(_0x7503c7[_0xdeb5('0x89')]&&_0x7503c7['List'][_0xdeb5('0x91')]['length']){return _0x7503c7[_0xdeb5('0x89')][_0xdeb5('0x91')][0x0];}return db[_0xdeb5('0x7a')]['create'](_['defaults'](_0x27365d[_0xdeb5('0x64')],{'firstName':_0x3efb95,[_0x5b7440[_0xdeb5('0x84')]]:_0x3efb95,'phone':_0x3efb95,'ListId':_0x7503c7['ListId']}));}})[_0xdeb5('0x3b')](handleEntityNotFound(_0x2955c2,null))['then'](function(_0x9febca){if(_0x9febca){_0x3807f3=_0x9febca;return db[_0xdeb5('0x96')]['find']({'where':{'ContactId':_0x3807f3['id'],'closed':![],'OpenchannelAccountId':_0x7503c7['id']}})[_0xdeb5('0x3b')](function(_0x2a1cc9){if(_0x2a1cc9){return[_0x2a1cc9,![]];}return db[_0xdeb5('0x96')][_0xdeb5('0x63')]({'UserId':_0x27365d[_0xdeb5('0x65')]['id'],'ContactId':_0x3807f3['id'],'OpenchannelAccountId':_0x7503c7['id'],'lastMsgDirection':_0xdeb5('0xbe'),'firstMsgDirection':'out','Messages':[_[_0xdeb5('0x57')](_0x27365d[_0xdeb5('0x64')],{'read':![],'body':_0x27365d[_0xdeb5('0x64')][_0xdeb5('0x64')],'OpenchannelAccountId':_0x7503c7['id'],'UserId':_0x27365d[_0xdeb5('0x65')]['id'],'ContactId':_0x3807f3['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xdeb5('0x3b')](function(_0x49541a){return[_0x49541a,!![]];});});}})[_0xdeb5('0xbf')](function(_0x24f118,_0x306cb8){if(_0x306cb8){return _0x24f118;}return db['OpenchannelMessage']['create'](_[_0xdeb5('0x57')](_0x27365d[_0xdeb5('0x64')],{'read':![],'body':_0x27365d[_0xdeb5('0x64')][_0xdeb5('0x64')],'OpenchannelAccountId':_0x7503c7['id'],'OpenchannelInteractionId':_0x24f118['id'],'UserId':_0x27365d['user']['id'],'ContactId':_0x3807f3['id']}))[_0xdeb5('0x3b')](function(_0x42f904){_0x24f118[_0xdeb5('0xc0')]['Messages']=[];_0x24f118[_0xdeb5('0xc0')][_0xdeb5('0xc1')][_0xdeb5('0x9c')](_0x42f904[_0xdeb5('0xc0')]);return _0x24f118;});});}})[_0xdeb5('0x3b')](respondWithResult(_0x2955c2,null))[_0xdeb5('0x2d')](handleError(_0x2955c2,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 76d280a..aefdb33 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(_0x33d625,_0x4ea5b3){var _0x5c64a2=function(_0x58878e){while(--_0x58878e){_0x33d625['push'](_0x33d625['shift']());}};_0x5c64a2(++_0x4ea5b3);}(_0xee5b,0x1f4));var _0xbee5=function(_0xf9ff38,_0x368f9a){_0xf9ff38=_0xf9ff38-0x0;var _0x5efd3e=_0xee5b[_0xf9ff38];return _0x5efd3e;};'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 _0xb4e6=['update','remove','emit','hook','events','OpenchannelAccount','setMaxListeners','save'];(function(_0xd0a17d,_0x4414a7){var _0x129f82=function(_0x5d664c){while(--_0x5d664c){_0xd0a17d['push'](_0xd0a17d['shift']());}};_0x129f82(++_0x4414a7);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xb4e6[_0x5f5cce];return _0x705ecf;};'use strict';var EventEmitter=require(_0x6b4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x6b4e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6b4e('0x2')](0x0);var events={'afterCreate':_0x6b4e('0x3'),'afterUpdate':_0x6b4e('0x4'),'afterDestroy':_0x6b4e('0x5')};function emitEvent(_0x31e8ad){return function(_0x1929b8,_0x52313b,_0x40da90){OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad+':'+_0x1929b8['id'],_0x1929b8);OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad,_0x1929b8);_0x40da90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x6b4e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 7b94d2e..d959ec9 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(_0x47b271,_0x1cf1c8){var _0x12f803=function(_0x7b5392){while(--_0x7b5392){_0x47b271['push'](_0x47b271['shift']());}};_0x12f803(++_0x1cf1c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x4360c8,_0x232a3c){var _0x277305=function(_0x383a46){while(--_0x383a46){_0x4360c8['push'](_0x4360c8['shift']());}};_0x277305(++_0x232a3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 cb27bdf..98c2bd8 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 _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x2547,0x1cd));var _0x7254=function(_0x3a204c,_0x122ef3){_0x3a204c=_0x3a204c-0x0;var _0x2190f3=_0x2547[_0x3a204c];return _0x2190f3;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});config['redis']=_[_0x7254('0xc')](config[_0x7254('0xd')],{'host':_0x7254('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7254('0xd')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x51a750,_0x3036ab,_0x30086e){return new BPromise(function(_0x31d5a5,_0x310c21){return client[_0x7254('0xf')](_0x51a750,_0x30086e)[_0x7254('0x10')](function(_0x4d19e8){logger[_0x7254('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3036ab,_0x7254('0x12'));logger['debug'](_0x7254('0x13'),_0x3036ab,_0x7254('0x12'),JSON[_0x7254('0x14')](_0x4d19e8));if(_0x4d19e8[_0x7254('0x15')]){if(_0x4d19e8[_0x7254('0x15')][_0x7254('0x16')]===0x1f4){logger[_0x7254('0x15')](_0x7254('0x17'),_0x3036ab,_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);return _0x310c21(_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);}logger[_0x7254('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x3036ab,_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);return _0x31d5a5(_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);}else{logger[_0x7254('0x11')](_0x7254('0x17'),_0x3036ab,_0x7254('0x12'));_0x31d5a5(_0x4d19e8['result'][_0x7254('0x18')]);}})[_0x7254('0x19')](function(_0x1fb71c){logger[_0x7254('0x15')](_0x7254('0x17'),_0x3036ab,_0x1fb71c);_0x310c21(_0x1fb71c);});});} \ No newline at end of file +var _0xb574=['info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x32a7cc,_0x790100){var _0x3c3636=function(_0x1c9be8){while(--_0x1c9be8){_0x32a7cc['push'](_0x32a7cc['shift']());}};_0x3c3636(++_0x790100);}(_0xb574,0x106));var _0x4b57=function(_0x29c423,_0x445bfa){_0x29c423=_0x29c423-0x0;var _0xe2c754=_0xb574[_0x29c423];return _0xe2c754;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b57('0xa'))(new Redis(config[_0x4b57('0xb')]));require(_0x4b57('0xc'))[_0x4b57('0xd')](socket);function respondWithRpcPromise(_0xce47ad,_0x116958,_0x1db79a){return new BPromise(function(_0x43b108,_0x5593b8){return client[_0x4b57('0xe')](_0xce47ad,_0x1db79a)[_0x4b57('0xf')](function(_0x274912){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x4b57('0x10'));logger[_0x4b57('0x11')](_0x4b57('0x12'),_0x116958,_0x4b57('0x10'),JSON[_0x4b57('0x13')](_0x274912));if(_0x274912[_0x4b57('0x14')]){if(_0x274912[_0x4b57('0x14')][_0x4b57('0x15')]===0x1f4){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x5593b8(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}logger['error'](_0x4b57('0x17'),_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x43b108(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}else{logger[_0x4b57('0x18')](_0x4b57('0x17'),_0x116958,_0x4b57('0x10'));_0x43b108(_0x274912['result'][_0x4b57('0x16')]);}})[_0x4b57('0x19')](function(_0x53f29a){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x53f29a);_0x5593b8(_0x53f29a);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 2653c44..f249faf 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 _0x7a72=['removeListener','openchannelAccount:','save','remove'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x7a72,0x1be));var _0x27a7=function(_0x6d3047,_0x2b5604){_0x6d3047=_0x6d3047-0x0;var _0xe7b4b9=_0x7a72[_0x6d3047];return _0xe7b4b9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x27a7('0x0'),_0x27a7('0x1'),'update'];function createListener(_0x316bd3,_0x4b4ed5){return function(_0x15d71f){_0x4b4ed5['emit'](_0x316bd3,_0x15d71f);};}function removeListener(_0x30a1a8,_0x502521){return function(){OpenchannelAccountEvents[_0x27a7('0x2')](_0x30a1a8,_0x502521);};}exports['register']=function(_0x320fad){for(var _0x372bb8=0x0,_0x5d7305=events['length'];_0x372bb8<_0x5d7305;_0x372bb8++){var _0x1de957=events[_0x372bb8];var _0x54e6ee=createListener(_0x27a7('0x3')+_0x1de957,_0x320fad);OpenchannelAccountEvents['on'](_0x1de957,_0x54e6ee);}}; \ No newline at end of file +var _0x5f6a=['length','./openchannelAccount.events','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x4d6b74,_0x26a6c5){_0x4d6b74=_0x4d6b74-0x0;var _0x5bd13c=_0x5f6a[_0x4d6b74];return _0x5bd13c;};'use strict';var OpenchannelAccountEvents=require(_0xa5f6('0x0'));var events=['save','remove',_0xa5f6('0x1')];function createListener(_0x4be333,_0x2e23f3){return function(_0x1ec17a){_0x2e23f3['emit'](_0x4be333,_0x1ec17a);};}function removeListener(_0x2e8b33,_0x8e175a){return function(){OpenchannelAccountEvents[_0xa5f6('0x2')](_0x2e8b33,_0x8e175a);};}exports[_0xa5f6('0x3')]=function(_0xb6a42e){for(var _0x9c569c=0x0,_0x19ac7d=events[_0xa5f6('0x4')];_0x9c569c<_0x19ac7d;_0x9c569c++){var _0x2505d7=events[_0x9c569c];var _0x135782=createListener('openchannelAccount:'+_0x2505d7,_0xb6a42e);OpenchannelAccountEvents['on'](_0x2505d7,_0x135782);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4ac6ce6..fd2d96d 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 _0x9e88=['put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','create'];(function(_0x47fa1b,_0x2894e1){var _0x18a4cc=function(_0x421fbd){while(--_0x421fbd){_0x47fa1b['push'](_0x47fa1b['shift']());}};_0x18a4cc(++_0x2894e1);}(_0x9e88,0x1a2));var _0x89e8=function(_0x120a24,_0x2d8b1d){_0x120a24=_0x120a24-0x0;var _0x336213=_0x9e88[_0x120a24];return _0x336213;};'use strict';var multer=require(_0x89e8('0x0'));var util=require(_0x89e8('0x1'));var path=require(_0x89e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x89e8('0x3'));var router=express[_0x89e8('0x4')]();var fs_extra=require(_0x89e8('0x5'));var auth=require(_0x89e8('0x6'));var interaction=require(_0x89e8('0x7'));var config=require(_0x89e8('0x8'));var controller=require(_0x89e8('0x9'));router[_0x89e8('0xa')]('/',auth[_0x89e8('0xb')](),controller['index']);router['get'](_0x89e8('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x89e8('0xb')](),controller[_0x89e8('0xd')]);router[_0x89e8('0xe')](_0x89e8('0xc'),auth[_0x89e8('0xb')](),controller['update']);router[_0x89e8('0xf')]('/:id',auth[_0x89e8('0xb')](),controller[_0x89e8('0x10')]);module[_0x89e8('0x11')]=router; \ No newline at end of file +var _0x6d05=['multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x15447b,_0x4cdfd3){var _0x149869=function(_0xd558c6){while(--_0xd558c6){_0x15447b['push'](_0x15447b['shift']());}};_0x149869(++_0x4cdfd3);}(_0x6d05,0x159));var _0x56d0=function(_0x32c834,_0x46f908){_0x32c834=_0x32c834-0x0;var _0x43efdb=_0x6d05[_0x32c834];return _0x43efdb;};'use strict';var multer=require(_0x56d0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x56d0('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x56d0('0x2'));var interaction=require(_0x56d0('0x3'));var config=require(_0x56d0('0x4'));var controller=require('./openchannelApplication.controller');router[_0x56d0('0x5')]('/',auth[_0x56d0('0x6')](),controller[_0x56d0('0x7')]);router[_0x56d0('0x5')](_0x56d0('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x56d0('0x9')]('/',auth[_0x56d0('0x6')](),controller['create']);router[_0x56d0('0xa')](_0x56d0('0x8'),auth[_0x56d0('0x6')](),controller[_0x56d0('0xb')]);router[_0x56d0('0xc')](_0x56d0('0x8'),auth[_0x56d0('0x6')](),controller[_0x56d0('0xd')]);module[_0x56d0('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 5c4d966..c174e91 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 _0x8e5a=['noop','*,*,*,*','INTEGER','STRING'];(function(_0x578818,_0xd3b4ac){var _0x33aad8=function(_0x36946f){while(--_0x36946f){_0x578818['push'](_0x578818['shift']());}};_0x33aad8(++_0xd3b4ac);}(_0x8e5a,0x16a));var _0xa8e5=function(_0x38628f,_0x14e381){_0x38628f=_0x38628f-0x0;var _0x3771ee=_0x8e5a[_0x38628f];return _0x3771ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xa8e5('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xa8e5('0x1')],'allowNull':![],'defaultValue':_0xa8e5('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa8e5('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa8e5('0x3')}}; \ No newline at end of file +var _0xde8e=['noop','exports','INTEGER','STRING'];(function(_0x47321b,_0x2368f2){var _0x3bc610=function(_0x32fd1b){while(--_0x32fd1b){_0x47321b['push'](_0x47321b['shift']());}};_0x3bc610(++_0x2368f2);}(_0xde8e,0xf5));var _0xede8=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0xde8e[_0x23c73d];return _0x36ba47;};'use strict';var Sequelize=require('sequelize');module[_0xede8('0x0')]={'priority':{'type':Sequelize[_0xede8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xede8('0x2')],'allowNull':![],'defaultValue':_0xede8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xede8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 8e39fa0..c7d9ca9 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 _0xfb16=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','OpenchannelApplication','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0xa6d278,_0x1ffc26){var _0x242ed8=function(_0x260d54){while(--_0x260d54){_0xa6d278['push'](_0xa6d278['shift']());}};_0x242ed8(++_0x1ffc26);}(_0xfb16,0xef));var _0x6fb1=function(_0x1e92ef,_0x585884){_0x1e92ef=_0x1e92ef-0x0;var _0x295750=_0xfb16[_0x1e92ef];return _0x295750;};'use strict';var emlformat=require(_0x6fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fb1('0x1'));var jsonpatch=require(_0x6fb1('0x2'));var rp=require(_0x6fb1('0x3'));var moment=require(_0x6fb1('0x4'));var BPromise=require(_0x6fb1('0x5'));var Mustache=require(_0x6fb1('0x6'));var util=require(_0x6fb1('0x7'));var path=require(_0x6fb1('0x8'));var sox=require(_0x6fb1('0x9'));var csv=require(_0x6fb1('0xa'));var ejs=require(_0x6fb1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6fb1('0xc'));var squel=require('squel');var crypto=require(_0x6fb1('0xd'));var jsforce=require(_0x6fb1('0xe'));var deskjs=require(_0x6fb1('0xf'));var toCsv=require(_0x6fb1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6fb1('0x10'));var authService=require(_0x6fb1('0x11'));var qs=require(_0x6fb1('0x12'));var as=require(_0x6fb1('0x13'));var hardwareService=require(_0x6fb1('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6fb1('0x15'));var licenseUtil=require(_0x6fb1('0x16'));var db=require(_0x6fb1('0x17'))['db'];function respondWithStatusCode(_0x2ebfae,_0x491242){_0x491242=_0x491242||0xcc;return function(_0x9e0b88){if(_0x9e0b88){return _0x2ebfae[_0x6fb1('0x18')](_0x491242);}return _0x2ebfae[_0x6fb1('0x19')](_0x491242)[_0x6fb1('0x1a')]();};}function respondWithResult(_0x45ce9c,_0x66d35b){_0x66d35b=_0x66d35b||0xc8;return function(_0x5c254e){if(_0x5c254e){return _0x45ce9c['status'](_0x66d35b)[_0x6fb1('0x1b')](_0x5c254e);}};}function respondWithFilteredResult(_0x1c3eb8,_0x2fd2b3){return function(_0x4f3569){if(_0x4f3569){var _0x350013=typeof _0x2fd2b3['offset']===_0x6fb1('0x1c')&&typeof _0x2fd2b3[_0x6fb1('0x1d')]===_0x6fb1('0x1c');var _0x381b49=_0x4f3569['count'];var _0x5bbf7b=_0x350013?0x0:_0x2fd2b3[_0x6fb1('0x1e')];var _0x5d5f5c=_0x350013?_0x4f3569[_0x6fb1('0x1f')]:_0x2fd2b3[_0x6fb1('0x1e')]+_0x2fd2b3[_0x6fb1('0x1d')];var _0x1fa08a;if(_0x5d5f5c>=_0x381b49){_0x5d5f5c=_0x381b49;_0x1fa08a=0xc8;}else{_0x1fa08a=0xce;}_0x1c3eb8[_0x6fb1('0x19')](_0x1fa08a);return _0x1c3eb8['set']('Content-Range',_0x5bbf7b+'-'+_0x5d5f5c+'/'+_0x381b49)[_0x6fb1('0x1b')](_0x4f3569);}return null;};}function patchUpdates(_0x49547d){return function(_0x3f1eb3){try{jsonpatch[_0x6fb1('0x20')](_0x3f1eb3,_0x49547d,!![]);}catch(_0x59f6e1){return BPromise[_0x6fb1('0x21')](_0x59f6e1);}return _0x3f1eb3['save']();};}function saveUpdates(_0x120890,_0x538ceb){return function(_0x2a00e5){if(_0x2a00e5){return _0x2a00e5['update'](_0x120890)[_0x6fb1('0x22')](function(_0x528322){return _0x528322;});}return null;};}function removeEntity(_0x339268,_0x7aaf28){return function(_0x984a37){if(_0x984a37){return _0x984a37[_0x6fb1('0x23')]()[_0x6fb1('0x22')](function(){_0x339268[_0x6fb1('0x19')](0xcc)[_0x6fb1('0x1a')]();});}};}function handleEntityNotFound(_0x5a9203,_0x3bff38){return function(_0x59e29c){if(!_0x59e29c){_0x5a9203['sendStatus'](0x194);}return _0x59e29c;};}function handleError(_0x33ac30,_0x4bd6ae){_0x4bd6ae=_0x4bd6ae||0x1f4;return function(_0x17155b){logger[_0x6fb1('0x24')](_0x17155b[_0x6fb1('0x25')]);if(_0x17155b[_0x6fb1('0x26')]){delete _0x17155b[_0x6fb1('0x26')];}_0x33ac30[_0x6fb1('0x19')](_0x4bd6ae)[_0x6fb1('0x27')](_0x17155b);};}exports[_0x6fb1('0x28')]=function(_0x158b99,_0x13042b){var _0x538a10={},_0x13b4de={},_0xa7e660={'count':0x0,'rows':[]};var _0x2aaf3a=_['map'](db['OpenchannelApplication'][_0x6fb1('0x29')],function(_0x1adb6c){return{'name':_0x1adb6c['fieldName'],'type':_0x1adb6c[_0x6fb1('0x2a')][_0x6fb1('0x2b')]};});_0x13b4de[_0x6fb1('0x2c')]=_[_0x6fb1('0x2d')](_0x2aaf3a,_0x6fb1('0x26'));_0x13b4de[_0x6fb1('0x2e')]=_[_0x6fb1('0x2f')](_0x158b99['query']);_0x13b4de[_0x6fb1('0x30')]=_[_0x6fb1('0x31')](_0x13b4de[_0x6fb1('0x2c')],_0x13b4de[_0x6fb1('0x2e')]);_0x538a10['attributes']=_[_0x6fb1('0x31')](_0x13b4de[_0x6fb1('0x2c')],qs[_0x6fb1('0x32')](_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x32')]));_0x538a10[_0x6fb1('0x33')]=_0x538a10[_0x6fb1('0x33')][_0x6fb1('0x34')]?_0x538a10['attributes']:_0x13b4de[_0x6fb1('0x2c')];if(!_0x158b99['query'][_0x6fb1('0x35')](_0x6fb1('0x36'))){_0x538a10[_0x6fb1('0x1d')]=qs[_0x6fb1('0x1d')](_0x158b99['query']['limit']);_0x538a10[_0x6fb1('0x1e')]=qs[_0x6fb1('0x1e')](_0x158b99['query']['offset']);}_0x538a10[_0x6fb1('0x37')]=qs[_0x6fb1('0x38')](_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x38')]);_0x538a10['where']=qs['filters'](_[_0x6fb1('0x39')](_0x158b99[_0x6fb1('0x2e')],_0x13b4de[_0x6fb1('0x30')]),_0x2aaf3a);if(_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x3a')]){_0x538a10[_0x6fb1('0x3b')]=_[_0x6fb1('0x3c')](_0x538a10[_0x6fb1('0x3b')],{'$or':_[_0x6fb1('0x2d')](_0x2aaf3a,function(_0x5e9371){if(_0x5e9371[_0x6fb1('0x2a')]!==_0x6fb1('0x3d')){var _0x3468a6={};_0x3468a6[_0x5e9371[_0x6fb1('0x26')]]={'$like':'%'+_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x3a')]+'%'};return _0x3468a6;}})});}_0x538a10=_[_0x6fb1('0x3c')]({},_0x538a10,_0x158b99[_0x6fb1('0x3e')]);var _0x238a2a={'where':_0x538a10[_0x6fb1('0x3b')]};return db['OpenchannelApplication'][_0x6fb1('0x1f')](_0x238a2a)[_0x6fb1('0x22')](function(_0x4d4324){_0xa7e660[_0x6fb1('0x1f')]=_0x4d4324;if(_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x3f')]){_0x538a10[_0x6fb1('0x40')]=[{'all':!![]}];}return db[_0x6fb1('0x41')][_0x6fb1('0x42')](_0x538a10);})[_0x6fb1('0x22')](function(_0x557c84){_0xa7e660['rows']=_0x557c84;return _0xa7e660;})[_0x6fb1('0x22')](respondWithFilteredResult(_0x13042b,_0x538a10))[_0x6fb1('0x43')](handleError(_0x13042b,null));};exports[_0x6fb1('0x44')]=function(_0x3d43fc,_0x35814b){var _0x69cba7={'raw':!![],'where':{'id':_0x3d43fc[_0x6fb1('0x45')]['id']}},_0x2a43e6={};_0x2a43e6['model']=_[_0x6fb1('0x2f')](db[_0x6fb1('0x41')]['rawAttributes']);_0x2a43e6[_0x6fb1('0x2e')]=_['keys'](_0x3d43fc[_0x6fb1('0x2e')]);_0x2a43e6[_0x6fb1('0x30')]=_[_0x6fb1('0x31')](_0x2a43e6[_0x6fb1('0x2c')],_0x2a43e6[_0x6fb1('0x2e')]);_0x69cba7['attributes']=_[_0x6fb1('0x31')](_0x2a43e6[_0x6fb1('0x2c')],qs[_0x6fb1('0x32')](_0x3d43fc['query'][_0x6fb1('0x32')]));_0x69cba7[_0x6fb1('0x33')]=_0x69cba7['attributes'][_0x6fb1('0x34')]?_0x69cba7[_0x6fb1('0x33')]:_0x2a43e6[_0x6fb1('0x2c')];if(_0x3d43fc[_0x6fb1('0x2e')]['includeAll']){_0x69cba7[_0x6fb1('0x40')]=[{'all':!![]}];}_0x69cba7=_[_0x6fb1('0x3c')]({},_0x69cba7,_0x3d43fc[_0x6fb1('0x3e')]);return db[_0x6fb1('0x41')][_0x6fb1('0x46')](_0x69cba7)[_0x6fb1('0x22')](handleEntityNotFound(_0x35814b,null))[_0x6fb1('0x22')](respondWithResult(_0x35814b,null))[_0x6fb1('0x43')](handleError(_0x35814b,null));};exports[_0x6fb1('0x47')]=function(_0x56cb12,_0x2a8886){return db[_0x6fb1('0x41')][_0x6fb1('0x47')](_0x56cb12[_0x6fb1('0x48')],{})['then'](respondWithResult(_0x2a8886,0xc9))[_0x6fb1('0x43')](handleError(_0x2a8886,null));};exports[_0x6fb1('0x49')]=function(_0x4199bb,_0xe474db){if(_0x4199bb[_0x6fb1('0x48')]['id']){delete _0x4199bb[_0x6fb1('0x48')]['id'];}return db[_0x6fb1('0x41')][_0x6fb1('0x46')]({'where':{'id':_0x4199bb[_0x6fb1('0x45')]['id']}})['then'](handleEntityNotFound(_0xe474db,null))['then'](saveUpdates(_0x4199bb[_0x6fb1('0x48')],null))[_0x6fb1('0x22')](respondWithResult(_0xe474db,null))[_0x6fb1('0x43')](handleError(_0xe474db,null));};exports[_0x6fb1('0x23')]=function(_0x4209d6,_0xf4d864){return db[_0x6fb1('0x41')][_0x6fb1('0x46')]({'where':{'id':_0x4209d6['params']['id']}})[_0x6fb1('0x22')](handleEntityNotFound(_0xf4d864,null))[_0x6fb1('0x22')](removeEntity(_0xf4d864,null))[_0x6fb1('0x43')](handleError(_0xf4d864,null));}; \ No newline at end of file +var _0x4435=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','body','update','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x34c7f8,_0x20634c){var _0x2b10f8=function(_0x2aa706){while(--_0x2aa706){_0x34c7f8['push'](_0x34c7f8['shift']());}};_0x2b10f8(++_0x20634c);}(_0x4435,0x12b));var _0x5443=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x4435[_0x2aa0e7];return _0x1472c0;};'use strict';var emlformat=require(_0x5443('0x0'));var rimraf=require(_0x5443('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5443('0x2'));var rp=require(_0x5443('0x3'));var moment=require(_0x5443('0x4'));var BPromise=require(_0x5443('0x5'));var Mustache=require(_0x5443('0x6'));var util=require(_0x5443('0x7'));var path=require(_0x5443('0x8'));var sox=require(_0x5443('0x9'));var csv=require('to-csv');var ejs=require(_0x5443('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5443('0xb'));var crypto=require(_0x5443('0xc'));var jsforce=require(_0x5443('0xd'));var deskjs=require(_0x5443('0xe'));var toCsv=require(_0x5443('0xf'));var querystring=require(_0x5443('0x10'));var Papa=require('papaparse');var Redis=require(_0x5443('0x11'));var authService=require(_0x5443('0x12'));var qs=require(_0x5443('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5443('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5443('0x15'));var config=require(_0x5443('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5443('0x17'))['db'];function respondWithStatusCode(_0x310b5f,_0x458d14){_0x458d14=_0x458d14||0xcc;return function(_0x1b5826){if(_0x1b5826){return _0x310b5f['sendStatus'](_0x458d14);}return _0x310b5f[_0x5443('0x18')](_0x458d14)[_0x5443('0x19')]();};}function respondWithResult(_0x4ef646,_0x22d499){_0x22d499=_0x22d499||0xc8;return function(_0x5ca48c){if(_0x5ca48c){return _0x4ef646[_0x5443('0x18')](_0x22d499)['json'](_0x5ca48c);}};}function respondWithFilteredResult(_0x5bad10,_0xc7f874){return function(_0x4e9906){if(_0x4e9906){var _0x2aca0d=typeof _0xc7f874[_0x5443('0x1a')]===_0x5443('0x1b')&&typeof _0xc7f874[_0x5443('0x1c')]===_0x5443('0x1b');var _0x3fa8c7=_0x4e9906[_0x5443('0x1d')];var _0x1836e7=_0x2aca0d?0x0:_0xc7f874[_0x5443('0x1a')];var _0x137e08=_0x2aca0d?_0x4e9906[_0x5443('0x1d')]:_0xc7f874[_0x5443('0x1a')]+_0xc7f874[_0x5443('0x1c')];var _0xa2de19;if(_0x137e08>=_0x3fa8c7){_0x137e08=_0x3fa8c7;_0xa2de19=0xc8;}else{_0xa2de19=0xce;}_0x5bad10[_0x5443('0x18')](_0xa2de19);return _0x5bad10[_0x5443('0x1e')](_0x5443('0x1f'),_0x1836e7+'-'+_0x137e08+'/'+_0x3fa8c7)[_0x5443('0x20')](_0x4e9906);}return null;};}function patchUpdates(_0x19b186){return function(_0x433808){try{jsonpatch[_0x5443('0x21')](_0x433808,_0x19b186,!![]);}catch(_0x5553e2){return BPromise[_0x5443('0x22')](_0x5553e2);}return _0x433808[_0x5443('0x23')]();};}function saveUpdates(_0x439861,_0x2c5618){return function(_0x36da48){if(_0x36da48){return _0x36da48['update'](_0x439861)[_0x5443('0x24')](function(_0x34524a){return _0x34524a;});}return null;};}function removeEntity(_0x460149,_0x55857e){return function(_0x95d4f2){if(_0x95d4f2){return _0x95d4f2['destroy']()[_0x5443('0x24')](function(){_0x460149[_0x5443('0x18')](0xcc)[_0x5443('0x19')]();});}};}function handleEntityNotFound(_0x121fa5,_0x54421d){return function(_0x268e6a){if(!_0x268e6a){_0x121fa5[_0x5443('0x25')](0x194);}return _0x268e6a;};}function handleError(_0x38ef11,_0x39aef0){_0x39aef0=_0x39aef0||0x1f4;return function(_0x3f87fd){logger[_0x5443('0x26')](_0x3f87fd[_0x5443('0x27')]);if(_0x3f87fd['name']){delete _0x3f87fd[_0x5443('0x28')];}_0x38ef11[_0x5443('0x18')](_0x39aef0)[_0x5443('0x29')](_0x3f87fd);};}exports[_0x5443('0x2a')]=function(_0x4fc17a,_0x250479){var _0x4be363={},_0x4f0377={},_0x4aa387={'count':0x0,'rows':[]};var _0x2dc341=_[_0x5443('0x2b')](db[_0x5443('0x2c')][_0x5443('0x2d')],function(_0x500674){return{'name':_0x500674['fieldName'],'type':_0x500674[_0x5443('0x2e')][_0x5443('0x2f')]};});_0x4f0377[_0x5443('0x30')]=_[_0x5443('0x2b')](_0x2dc341,'name');_0x4f0377[_0x5443('0x31')]=_[_0x5443('0x32')](_0x4fc17a[_0x5443('0x31')]);_0x4f0377[_0x5443('0x33')]=_['intersection'](_0x4f0377[_0x5443('0x30')],_0x4f0377['query']);_0x4be363[_0x5443('0x34')]=_[_0x5443('0x35')](_0x4f0377[_0x5443('0x30')],qs[_0x5443('0x36')](_0x4fc17a['query']['fields']));_0x4be363[_0x5443('0x34')]=_0x4be363[_0x5443('0x34')][_0x5443('0x37')]?_0x4be363[_0x5443('0x34')]:_0x4f0377['model'];if(!_0x4fc17a[_0x5443('0x31')][_0x5443('0x38')](_0x5443('0x39'))){_0x4be363[_0x5443('0x1c')]=qs[_0x5443('0x1c')](_0x4fc17a[_0x5443('0x31')][_0x5443('0x1c')]);_0x4be363['offset']=qs[_0x5443('0x1a')](_0x4fc17a[_0x5443('0x31')][_0x5443('0x1a')]);}_0x4be363[_0x5443('0x3a')]=qs[_0x5443('0x3b')](_0x4fc17a[_0x5443('0x31')][_0x5443('0x3b')]);_0x4be363['where']=qs[_0x5443('0x33')](_[_0x5443('0x3c')](_0x4fc17a[_0x5443('0x31')],_0x4f0377[_0x5443('0x33')]),_0x2dc341);if(_0x4fc17a[_0x5443('0x31')][_0x5443('0x3d')]){_0x4be363[_0x5443('0x3e')]=_['merge'](_0x4be363[_0x5443('0x3e')],{'$or':_[_0x5443('0x2b')](_0x2dc341,function(_0x501bfd){if(_0x501bfd['type']!==_0x5443('0x3f')){var _0x554f45={};_0x554f45[_0x501bfd[_0x5443('0x28')]]={'$like':'%'+_0x4fc17a[_0x5443('0x31')][_0x5443('0x3d')]+'%'};return _0x554f45;}})});}_0x4be363=_['merge']({},_0x4be363,_0x4fc17a['options']);var _0x406f05={'where':_0x4be363['where']};return db[_0x5443('0x2c')][_0x5443('0x1d')](_0x406f05)[_0x5443('0x24')](function(_0x2f90e6){_0x4aa387[_0x5443('0x1d')]=_0x2f90e6;if(_0x4fc17a['query']['includeAll']){_0x4be363[_0x5443('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x5443('0x41')](_0x4be363);})['then'](function(_0x23b317){_0x4aa387[_0x5443('0x42')]=_0x23b317;return _0x4aa387;})[_0x5443('0x24')](respondWithFilteredResult(_0x250479,_0x4be363))[_0x5443('0x43')](handleError(_0x250479,null));};exports[_0x5443('0x44')]=function(_0x2ceb43,_0x16682f){var _0x447625={'raw':!![],'where':{'id':_0x2ceb43[_0x5443('0x45')]['id']}},_0x11a31f={};_0x11a31f['model']=_[_0x5443('0x32')](db[_0x5443('0x2c')]['rawAttributes']);_0x11a31f[_0x5443('0x31')]=_[_0x5443('0x32')](_0x2ceb43['query']);_0x11a31f[_0x5443('0x33')]=_['intersection'](_0x11a31f[_0x5443('0x30')],_0x11a31f[_0x5443('0x31')]);_0x447625[_0x5443('0x34')]=_[_0x5443('0x35')](_0x11a31f[_0x5443('0x30')],qs[_0x5443('0x36')](_0x2ceb43['query'][_0x5443('0x36')]));_0x447625[_0x5443('0x34')]=_0x447625[_0x5443('0x34')][_0x5443('0x37')]?_0x447625[_0x5443('0x34')]:_0x11a31f[_0x5443('0x30')];if(_0x2ceb43['query'][_0x5443('0x46')]){_0x447625[_0x5443('0x40')]=[{'all':!![]}];}_0x447625=_['merge']({},_0x447625,_0x2ceb43[_0x5443('0x47')]);return db[_0x5443('0x2c')]['find'](_0x447625)[_0x5443('0x24')](handleEntityNotFound(_0x16682f,null))[_0x5443('0x24')](respondWithResult(_0x16682f,null))[_0x5443('0x43')](handleError(_0x16682f,null));};exports['create']=function(_0x121a85,_0x42bd30){return db[_0x5443('0x2c')]['create'](_0x121a85[_0x5443('0x48')],{})[_0x5443('0x24')](respondWithResult(_0x42bd30,0xc9))[_0x5443('0x43')](handleError(_0x42bd30,null));};exports[_0x5443('0x49')]=function(_0x408b8a,_0x5b8606){if(_0x408b8a[_0x5443('0x48')]['id']){delete _0x408b8a[_0x5443('0x48')]['id'];}return db[_0x5443('0x2c')][_0x5443('0x4a')]({'where':{'id':_0x408b8a[_0x5443('0x45')]['id']}})[_0x5443('0x24')](handleEntityNotFound(_0x5b8606,null))['then'](saveUpdates(_0x408b8a[_0x5443('0x48')],null))[_0x5443('0x24')](respondWithResult(_0x5b8606,null))[_0x5443('0x43')](handleError(_0x5b8606,null));};exports[_0x5443('0x4b')]=function(_0x414510,_0x4fdd88){return db[_0x5443('0x2c')]['find']({'where':{'id':_0x414510[_0x5443('0x45')]['id']}})[_0x5443('0x24')](handleEntityNotFound(_0x4fdd88,null))[_0x5443('0x24')](removeEntity(_0x4fdd88,null))[_0x5443('0x43')](handleError(_0x4fdd88,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 0580479..f6c9ff8 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 _0x8d01=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x8d01,0x88));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x18d0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x18d0('0x1'));var BPromise=require(_0x18d0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18d0('0x3'));var rimraf=require(_0x18d0('0x4'));var config=require(_0x18d0('0x5'));var attributes=require(_0x18d0('0x6'));module[_0x18d0('0x7')]=function(_0x465461,_0x3956f2){return _0x465461[_0x18d0('0x8')](_0x18d0('0x9'),attributes,{'tableName':_0x18d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x18d0('0xb'),'collate':_0x18d0('0xc')});}; \ No newline at end of file +var _0x19fb=['request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x19fb,0x1eb));var _0xb19f=function(_0x5507c5,_0x3ca534){_0x5507c5=_0x5507c5-0x0;var _0x449d0e=_0x19fb[_0x5507c5];return _0x449d0e;};'use strict';var _=require(_0xb19f('0x0'));var util=require('util');var logger=require(_0xb19f('0x1'))(_0xb19f('0x2'));var moment=require(_0xb19f('0x3'));var BPromise=require(_0xb19f('0x4'));var rp=require(_0xb19f('0x5'));var fs=require('fs');var path=require(_0xb19f('0x6'));var rimraf=require(_0xb19f('0x7'));var config=require(_0xb19f('0x8'));var attributes=require(_0xb19f('0x9'));module[_0xb19f('0xa')]=function(_0x5345e2,_0x33954e){return _0x5345e2[_0xb19f('0xb')](_0xb19f('0xc'),attributes,{'tableName':_0xb19f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb19f('0xe'),'collate':_0xb19f('0xf')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 69fbaf9..5005035 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 _0x6e42=['OpenchannelApplication','update','body','options','where','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x3135f9,_0x18e84b){var _0x49b669=function(_0x3e9301){while(--_0x3e9301){_0x3135f9['push'](_0x3135f9['shift']());}};_0x49b669(++_0x18e84b);}(_0x6e42,0x17b));var _0x26e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e42[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x26e4('0x0'));var util=require('util');var moment=require(_0x26e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x26e4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26e4('0x3'))['db'];var utils=require(_0x26e4('0x4'));var logger=require(_0x26e4('0x5'))(_0x26e4('0x6'));var config=require(_0x26e4('0x7'));var jayson=require(_0x26e4('0x8'));var client=jayson[_0x26e4('0x9')][_0x26e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x166318,_0x1c9459,_0x5e7d9a){return new BPromise(function(_0x56c039,_0x425dd3){return client['request'](_0x166318,_0x5e7d9a)[_0x26e4('0xb')](function(_0x3d9604){logger[_0x26e4('0xc')](_0x26e4('0xd'),_0x1c9459,_0x26e4('0xe'));logger[_0x26e4('0xf')](_0x26e4('0x10'),_0x1c9459,_0x26e4('0xe'),JSON[_0x26e4('0x11')](_0x3d9604));if(_0x3d9604[_0x26e4('0x12')]){if(_0x3d9604[_0x26e4('0x12')][_0x26e4('0x13')]===0x1f4){logger[_0x26e4('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x1c9459,_0x3d9604[_0x26e4('0x12')][_0x26e4('0x14')]);return _0x425dd3(_0x3d9604[_0x26e4('0x12')][_0x26e4('0x14')]);}logger[_0x26e4('0x12')](_0x26e4('0xd'),_0x1c9459,_0x3d9604[_0x26e4('0x12')][_0x26e4('0x14')]);return _0x56c039(_0x3d9604['error'][_0x26e4('0x14')]);}else{logger[_0x26e4('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x1c9459,_0x26e4('0xe'));_0x56c039(_0x3d9604[_0x26e4('0x15')][_0x26e4('0x14')]);}})[_0x26e4('0x16')](function(_0x2923c5){logger[_0x26e4('0x12')](_0x26e4('0xd'),_0x1c9459,_0x2923c5);_0x425dd3(_0x2923c5);});});}exports[_0x26e4('0x17')]=function(_0x6afb79){var _0x62ea83=this;return new Promise(function(_0x25aa9b,_0x170ef0){return db[_0x26e4('0x18')][_0x26e4('0x19')](_0x6afb79[_0x26e4('0x1a')],{'raw':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79[_0x26e4('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79[_0x26e4('0x1b')][_0x26e4('0x1c')]||null:null,'attributes':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79[_0x26e4('0x1b')][_0x26e4('0x1d')]||null:null,'limit':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79['options'][_0x26e4('0x1e')]||null:null})[_0x26e4('0xb')](function(_0x5a9999){logger[_0x26e4('0xc')](_0x26e4('0x17'),_0x6afb79);logger[_0x26e4('0xf')](_0x26e4('0x17'),_0x6afb79,JSON[_0x26e4('0x11')](_0x5a9999));_0x25aa9b(_0x5a9999);})['catch'](function(_0x353e69){logger['error']('UpdateOpenchannelApplication',_0x353e69[_0x26e4('0x14')],_0x6afb79);_0x170ef0(_0x62ea83[_0x26e4('0x12')](0x1f4,_0x353e69[_0x26e4('0x14')]));});});}; \ No newline at end of file +var _0xba24=['stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x2da207,_0x1912c0){var _0x3e70f1=function(_0x4266a7){while(--_0x4266a7){_0x2da207['push'](_0x2da207['shift']());}};_0x3e70f1(++_0x1912c0);}(_0xba24,0x1f0));var _0x4ba2=function(_0xe31e88,_0x5e9f15){_0xe31e88=_0xe31e88-0x0;var _0x45febe=_0xba24[_0xe31e88];return _0x45febe;};'use strict';var _=require('lodash');var util=require(_0x4ba2('0x0'));var moment=require(_0x4ba2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ba2('0x2'));var fs=require('fs');var Redis=require(_0x4ba2('0x3'));var db=require(_0x4ba2('0x4'))['db'];var utils=require(_0x4ba2('0x5'));var logger=require(_0x4ba2('0x6'))(_0x4ba2('0x7'));var config=require(_0x4ba2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4ba2('0x9')][_0x4ba2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43969a,_0x4d5bd8,_0x282eb3){return new BPromise(function(_0x29c9ec,_0xa1aacb){return client['request'](_0x43969a,_0x282eb3)['then'](function(_0x2c4c21){logger[_0x4ba2('0xb')](_0x4ba2('0xc'),_0x4d5bd8,_0x4ba2('0xd'));logger[_0x4ba2('0xe')](_0x4ba2('0xf'),_0x4d5bd8,_0x4ba2('0xd'),JSON[_0x4ba2('0x10')](_0x2c4c21));if(_0x2c4c21['error']){if(_0x2c4c21[_0x4ba2('0x11')][_0x4ba2('0x12')]===0x1f4){logger[_0x4ba2('0x11')](_0x4ba2('0xc'),_0x4d5bd8,_0x2c4c21[_0x4ba2('0x11')][_0x4ba2('0x13')]);return _0xa1aacb(_0x2c4c21['error'][_0x4ba2('0x13')]);}logger[_0x4ba2('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x4d5bd8,_0x2c4c21[_0x4ba2('0x11')][_0x4ba2('0x13')]);return _0x29c9ec(_0x2c4c21[_0x4ba2('0x11')][_0x4ba2('0x13')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x4d5bd8,_0x4ba2('0xd'));_0x29c9ec(_0x2c4c21[_0x4ba2('0x14')]['message']);}})[_0x4ba2('0x15')](function(_0x56a2b8){logger[_0x4ba2('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x4d5bd8,_0x56a2b8);_0xa1aacb(_0x56a2b8);});});}exports[_0x4ba2('0x16')]=function(_0x500744){var _0x5f1e7b=this;return new Promise(function(_0x172931,_0x531653){return db[_0x4ba2('0x17')][_0x4ba2('0x18')](_0x500744[_0x4ba2('0x19')],{'raw':_0x500744[_0x4ba2('0x1a')]?_0x500744[_0x4ba2('0x1a')][_0x4ba2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x500744[_0x4ba2('0x1a')]?_0x500744[_0x4ba2('0x1a')][_0x4ba2('0x1c')]||null:null,'attributes':_0x500744[_0x4ba2('0x1a')]?_0x500744[_0x4ba2('0x1a')][_0x4ba2('0x1d')]||null:null,'limit':_0x500744[_0x4ba2('0x1a')]?_0x500744['options'][_0x4ba2('0x1e')]||null:null})[_0x4ba2('0x1f')](function(_0x24b813){logger[_0x4ba2('0xb')](_0x4ba2('0x16'),_0x500744);logger[_0x4ba2('0xe')](_0x4ba2('0x16'),_0x500744,JSON[_0x4ba2('0x10')](_0x24b813));_0x172931(_0x24b813);})[_0x4ba2('0x15')](function(_0x3e7288){logger[_0x4ba2('0x11')]('UpdateOpenchannelApplication',_0x3e7288[_0x4ba2('0x13')],_0x500744);_0x531653(_0x5f1e7b['error'](0x1f4,_0x3e7288[_0x4ba2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 28396de..3f9d6a4 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 _0x237e=['download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','util','express','Router','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download'];(function(_0x22bf79,_0x1d6034){var _0x3234e1=function(_0x20e4f3){while(--_0x20e4f3){_0x22bf79['push'](_0x22bf79['shift']());}};_0x3234e1(++_0x1d6034);}(_0x237e,0x66));var _0xe237=function(_0x4bb01b,_0x3cd563){_0x4bb01b=_0x4bb01b-0x0;var _0x5b881d=_0x237e[_0x4bb01b];return _0x5b881d;};'use strict';var multer=require('multer');var util=require(_0xe237('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe237('0x1'));var router=express[_0xe237('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe237('0x3'));var config=require('../../config/environment');var controller=require(_0xe237('0x4'));router[_0xe237('0x5')]('/',auth[_0xe237('0x6')](),controller[_0xe237('0x7')]);router[_0xe237('0x5')](_0xe237('0x8'),auth[_0xe237('0x6')](),controller[_0xe237('0x9')]);router[_0xe237('0x5')](_0xe237('0xa'),auth[_0xe237('0x6')](),controller[_0xe237('0xb')]);router[_0xe237('0x5')]('/:id/messages',auth[_0xe237('0x6')](),controller[_0xe237('0xc')]);router[_0xe237('0x5')](_0xe237('0xd'),auth[_0xe237('0x6')](),controller[_0xe237('0xe')]);router['post']('/',auth[_0xe237('0x6')](),controller['create']);router[_0xe237('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0xe237('0x10')]);router[_0xe237('0xf')](_0xe237('0x11'),auth[_0xe237('0x6')](),interaction[_0xe237('0x12')](_0xe237('0x13'),_0xe237('0x14')),controller[_0xe237('0x15')]);router[_0xe237('0x16')](_0xe237('0xa'),auth['isAuthenticated'](),interaction[_0xe237('0x12')](_0xe237('0x13'),_0xe237('0x17')),controller[_0xe237('0x18')]);router[_0xe237('0x19')](_0xe237('0xa'),auth[_0xe237('0x6')](),interaction[_0xe237('0x12')]('openchannel',_0xe237('0x1a')),controller[_0xe237('0x1b')]);router[_0xe237('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe237('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xe1b3=['express','Router','fs-extra','../../components/auth/service','./openchannelInteraction.controller','get','index','isAuthenticated','describe','/:id','/:id/messages','post','create','addMessage','tracked','openchannel','addTags','put','openchannelinteraction:update','update','delete','destroy','/:id/tags','exports','multer','path','connect-timeout'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe1b3,0x1e3));var _0x3e1b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe1b3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e1b('0x0'));var util=require('util');var path=require(_0x3e1b('0x1'));var timeout=require(_0x3e1b('0x2'));var express=require(_0x3e1b('0x3'));var router=express[_0x3e1b('0x4')]();var fs_extra=require(_0x3e1b('0x5'));var auth=require(_0x3e1b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e1b('0x7'));router[_0x3e1b('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e1b('0x9')]);router[_0x3e1b('0x8')]('/describe',auth[_0x3e1b('0xa')](),controller[_0x3e1b('0xb')]);router[_0x3e1b('0x8')](_0x3e1b('0xc'),auth[_0x3e1b('0xa')](),controller['show']);router['get'](_0x3e1b('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x3e1b('0x8')]('/:id/download',auth[_0x3e1b('0xa')](),controller['download']);router[_0x3e1b('0xe')]('/',auth[_0x3e1b('0xa')](),controller[_0x3e1b('0xf')]);router[_0x3e1b('0xe')](_0x3e1b('0xd'),auth['isAuthenticated'](),controller[_0x3e1b('0x10')]);router[_0x3e1b('0xe')]('/:id/tags',auth[_0x3e1b('0xa')](),interaction[_0x3e1b('0x11')](_0x3e1b('0x12'),'openchannelinteraction:addtags'),controller[_0x3e1b('0x13')]);router[_0x3e1b('0x14')](_0x3e1b('0xc'),auth['isAuthenticated'](),interaction[_0x3e1b('0x11')](_0x3e1b('0x12'),_0x3e1b('0x15')),controller[_0x3e1b('0x16')]);router[_0x3e1b('0x17')](_0x3e1b('0xc'),auth[_0x3e1b('0xa')](),interaction[_0x3e1b('0x11')]('openchannel','openchannelinteraction:destroy'),controller[_0x3e1b('0x18')]);router[_0x3e1b('0x17')](_0x3e1b('0x19'),auth[_0x3e1b('0xa')](),controller['removeTags']);module[_0x3e1b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 065f8bb..ff87229 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 _0x4d9e=['sequelize','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x373f6f,_0x50f55b){var _0x21031a=function(_0x2b09f8){while(--_0x2b09f8){_0x373f6f['push'](_0x373f6f['shift']());}};_0x21031a(++_0x50f55b);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5613e9,_0x5e9791){_0x5613e9=_0x5613e9-0x0;var _0x544988=_0x4d9e[_0x5613e9];return _0x544988;};'use strict';var Sequelize=require(_0xe4d9('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe4d9('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe4d9('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe4d9('0x2')]},'read1stAt':{'type':Sequelize[_0xe4d9('0x1')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xe4d9('0x2')]},'lastMsgAt':{'type':Sequelize[_0xe4d9('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xe4d9('0x3')]('in',_0xe4d9('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe4d9('0x3')]('in',_0xe4d9('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xe4d9('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xa37e=['DATE','STRING','ENUM','BOOLEAN'];(function(_0x4fc996,_0x125236){var _0x26067f=function(_0x1b56a1){while(--_0x1b56a1){_0x4fc996['push'](_0x4fc996['shift']());}};_0x26067f(++_0x125236);}(_0xa37e,0x97));var _0xea37=function(_0x1447b4,_0x59987f){_0x1447b4=_0x1447b4-0x0;var _0x16f17e=_0xa37e[_0x1447b4];return _0x16f17e;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xea37('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xea37('0x1')]},'disposition':{'type':Sequelize[_0xea37('0x2')]},'secondDisposition':{'type':Sequelize[_0xea37('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xea37('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xea37('0x2')]},'externalUrl':{'type':Sequelize[_0xea37('0x2')]},'lastMsgAt':{'type':Sequelize[_0xea37('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xea37('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xea37('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index f1c2d52..f84128b 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 _0x32ff=['set','Content-Range','json','update','then','end','error','stack','name','send','index','map','OpenchannelInteraction','fieldName','key','getOptions','query','catch','show','type','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','destroy','describe','addMessage','OpenchannelMessage','omit','ids','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','root','files','tmp','join','server','attachments','push','fullname','CmContact','Contact','firstName','lastName','Attachment','direction','secret','read','OpenchannelAccount','get','Openchannel','Account','Owner','N.A.','createdAt','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','User','System','value','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','zip-dir','util','ejs','lodash','../../components/export/pdf','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','undefined','limit','count','offset'];(function(_0x4494b7,_0x2e7f83){var _0xac798e=function(_0x3bbaa2){while(--_0x3bbaa2){_0x4494b7['push'](_0x4494b7['shift']());}};_0xac798e(++_0x2e7f83);}(_0x32ff,0xec));var _0xf32f=function(_0xa6be7f,_0x313e0d){_0xa6be7f=_0xa6be7f-0x0;var _0x2bc4c3=_0x32ff[_0xa6be7f];return _0x2bc4c3;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xf32f('0x0'));var moment=require('moment');var util=require(_0xf32f('0x1'));var path=require('path');var ejs=require(_0xf32f('0x2'));var fs=require('fs');var _=require(_0xf32f('0x3'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xf32f('0x4'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xf32f('0x5'))['db'];config[_0xf32f('0x6')]=_['defaults'](config[_0xf32f('0x6')],{'host':_0xf32f('0x7'),'port':0x18eb});var socket=require(_0xf32f('0x8'))(new Redis(config[_0xf32f('0x6')]));require(_0xf32f('0x9'))[_0xf32f('0xa')](socket);function respondWithStatusCode(_0x27f7ef,_0x52f1c5){_0x52f1c5=_0x52f1c5||0xcc;return function(_0xd6820b){if(_0xd6820b){return _0x27f7ef['sendStatus'](_0x52f1c5);}return _0x27f7ef['status'](_0x52f1c5)['end']();};}function respondWithResult(_0x3b719e,_0x368fd4){_0x368fd4=_0x368fd4||0xc8;return function(_0x9d9cbb){if(_0x9d9cbb){return _0x3b719e[_0xf32f('0xb')](_0x368fd4)['json'](_0x9d9cbb);}};}function respondWithFilteredResult(_0x49a02d,_0x27e817){return function(_0x18b340){if(_0x18b340){var _0x42b95c=typeof _0x27e817['offset']===_0xf32f('0xc')&&typeof _0x27e817[_0xf32f('0xd')]===_0xf32f('0xc');var _0x183dc2=_0x18b340[_0xf32f('0xe')];var _0xa2d93=_0x42b95c?0x0:_0x27e817[_0xf32f('0xf')];var _0x151e8e=_0x42b95c?_0x18b340[_0xf32f('0xe')]:_0x27e817[_0xf32f('0xf')]+_0x27e817[_0xf32f('0xd')];var _0x2c1516;if(_0x151e8e>=_0x183dc2){_0x151e8e=_0x183dc2;_0x2c1516=0xc8;}else{_0x2c1516=0xce;}_0x49a02d[_0xf32f('0xb')](_0x2c1516);return _0x49a02d[_0xf32f('0x10')](_0xf32f('0x11'),_0xa2d93+'-'+_0x151e8e+'/'+_0x183dc2)[_0xf32f('0x12')](_0x18b340);}return null;};}function saveUpdates(_0x31ef1f){return function(_0x776ebd){if(_0x776ebd){return _0x776ebd[_0xf32f('0x13')](_0x31ef1f)[_0xf32f('0x14')](function(_0x550421){return _0x550421;});}return null;};}function removeEntity(_0x19367b){return function(_0x152bff){if(_0x152bff){return _0x152bff['destroy']()['then'](function(){_0x19367b[_0xf32f('0xb')](0xcc)[_0xf32f('0x15')]();});}};}function handleEntityNotFound(_0x1c92ea){return function(_0x286495){if(!_0x286495){_0x1c92ea['sendStatus'](0x194);}return _0x286495;};}function handleError(_0x351aea,_0x4687f0){_0x4687f0=_0x4687f0||0x1f4;return function(_0x42b560){logger[_0xf32f('0x16')](_0x42b560[_0xf32f('0x17')]);if(_0x42b560[_0xf32f('0x18')]){delete _0x42b560[_0xf32f('0x18')];}_0x351aea['status'](_0x4687f0)[_0xf32f('0x19')](_0x42b560);};}exports[_0xf32f('0x1a')]=function(_0x4c98e7,_0xed2bb9){var _0x3023a2={};var _0x16e081=_[_0xf32f('0x1b')](db[_0xf32f('0x1c')]['rawAttributes'],function(_0x182c30){return{'name':_0x182c30[_0xf32f('0x1d')],'type':_0x182c30['type'][_0xf32f('0x1e')]};});_0x3023a2=qs[_0xf32f('0x1f')](_0x16e081,_0x4c98e7);return interaction['findAll']('openchannel',_0x4c98e7[_0xf32f('0x20')],_0x4c98e7['user'],_0x3023a2,_0x16e081)[_0xf32f('0x14')](respondWithFilteredResult(_0xed2bb9,_0x3023a2))[_0xf32f('0x21')](handleError(_0xed2bb9,null));};exports[_0xf32f('0x22')]=function(_0x4494c8,_0x87f9db){var _0x40b233={};if(_0x4494c8['query']['type']&&_0x4494c8['query'][_0xf32f('0x23')]===_0xf32f('0x24')){_0x40b233[_0xf32f('0x24')]=_0x4494c8[_0xf32f('0x25')]['id'];}else{_0x40b233['id']=_0x4494c8[_0xf32f('0x25')]['id'];}var _0x2b2235={'raw':![],'where':_0x40b233},_0x72039c={};_0x72039c[_0xf32f('0x26')]=_[_0xf32f('0x27')](db['OpenchannelInteraction']['rawAttributes']);_0x72039c[_0xf32f('0x20')]=_[_0xf32f('0x27')](_0x4494c8['query']);_0x72039c[_0xf32f('0x28')]=_[_0xf32f('0x29')](_0x72039c[_0xf32f('0x26')],_0x72039c[_0xf32f('0x20')]);_0x2b2235[_0xf32f('0x2a')]=_[_0xf32f('0x29')](_0x72039c['model'],qs['fields'](_0x4494c8[_0xf32f('0x20')][_0xf32f('0x2b')]));_0x2b2235[_0xf32f('0x2a')]=_0x2b2235[_0xf32f('0x2a')][_0xf32f('0x2c')]?_0x2b2235[_0xf32f('0x2a')]:_0x72039c[_0xf32f('0x26')];if(_0x4494c8[_0xf32f('0x20')][_0xf32f('0x2d')]){_0x2b2235['include']=[{'all':!![]}];}_0x2b2235=_['merge']({},_0x2b2235,_0x4494c8[_0xf32f('0x2e')]);return db[_0xf32f('0x1c')][_0xf32f('0x2f')](_0x2b2235)[_0xf32f('0x14')](handleEntityNotFound(_0x87f9db,null))[_0xf32f('0x14')](respondWithResult(_0x87f9db,null))[_0xf32f('0x21')](handleError(_0x87f9db,null));};exports[_0xf32f('0x30')]=function(_0x53b132,_0x366f50){return db[_0xf32f('0x1c')][_0xf32f('0x30')](_0x53b132[_0xf32f('0x31')],{})[_0xf32f('0x14')](respondWithResult(_0x366f50,0xc9))[_0xf32f('0x21')](handleError(_0x366f50,null));};exports['update']=function(_0x365e8b,_0x5e0176){if(_0x365e8b[_0xf32f('0x31')]['id']){delete _0x365e8b[_0xf32f('0x31')]['id'];}return db[_0xf32f('0x1c')][_0xf32f('0x2f')]({'where':{'id':_0x365e8b[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x5e0176,null))[_0xf32f('0x14')](saveUpdates(_0x365e8b[_0xf32f('0x31')],null))['then'](respondWithResult(_0x5e0176,null))[_0xf32f('0x21')](handleError(_0x5e0176,null));};exports[_0xf32f('0x32')]=function(_0x5ed619,_0xc7efa8){return db['OpenchannelInteraction'][_0xf32f('0x2f')]({'where':{'id':_0x5ed619['params']['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0xc7efa8,null))[_0xf32f('0x14')](removeEntity(_0xc7efa8,null))['catch'](handleError(_0xc7efa8,null));};exports[_0xf32f('0x33')]=function(_0x3b56ef,_0x3c5c10){return db['OpenchannelInteraction'][_0xf32f('0x33')]()[_0xf32f('0x14')](respondWithResult(_0x3c5c10,null))['catch'](handleError(_0x3c5c10,null));};exports[_0xf32f('0x34')]=function(_0x5257ee,_0x3951c0){return db[_0xf32f('0x35')][_0xf32f('0x2f')]({'where':{'id':_0x5257ee[_0xf32f('0x25')]['id']}})['then'](handleEntityNotFound(_0x3951c0,null))[_0xf32f('0x14')](function(_0xc1d676){if(_0xc1d676){return _0xc1d676[_0xf32f('0x34')](_0x5257ee[_0xf32f('0x31')]['ids'],_[_0xf32f('0x36')](_0x5257ee[_0xf32f('0x31')],[_0xf32f('0x37'),'id'])||{});}})['then'](respondWithResult(_0x3951c0,null))[_0xf32f('0x21')](handleError(_0x3951c0,null));};exports['getMessages']=function(_0x5a6265,_0x79aaf2){var _0x3d60d5={'raw':![],'where':{}};var _0x1d3460={};var _0x5518c8={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xf32f('0x38')]({'where':{'id':_0x5a6265[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x79aaf2,null))[_0xf32f('0x14')](function(_0x345e59){if(_0x345e59){_0x1d3460['model']=_['keys'](db[_0xf32f('0x35')][_0xf32f('0x39')]);_0x1d3460['query']=_[_0xf32f('0x27')](_0x5a6265['query']);_0x1d3460['filters']=_[_0xf32f('0x29')](_0x1d3460[_0xf32f('0x26')],_0x1d3460[_0xf32f('0x20')]);_0x3d60d5[_0xf32f('0x2a')]=_[_0xf32f('0x29')](_0x1d3460['model'],qs['fields'](_0x5a6265[_0xf32f('0x20')]['fields']));_0x3d60d5['attributes']=_0x3d60d5[_0xf32f('0x2a')]['length']?_0x3d60d5[_0xf32f('0x2a')]:_0x1d3460[_0xf32f('0x26')];if(!_0x5a6265[_0xf32f('0x20')][_0xf32f('0x3a')](_0xf32f('0x3b'))){_0x3d60d5[_0xf32f('0xd')]=qs[_0xf32f('0xd')](_0x5a6265[_0xf32f('0x20')]['limit']);_0x3d60d5[_0xf32f('0xf')]=qs[_0xf32f('0xf')](_0x5a6265[_0xf32f('0x20')][_0xf32f('0xf')]);}_0x3d60d5[_0xf32f('0x3c')]=qs[_0xf32f('0x3d')](_0x5a6265['query'][_0xf32f('0x3d')]);_0x3d60d5[_0xf32f('0x3e')]=qs[_0xf32f('0x28')](_[_0xf32f('0x3f')](_0x5a6265[_0xf32f('0x20')],_0x1d3460[_0xf32f('0x28')]));_0x3d60d5['where'][_0xf32f('0x40')]=_0x345e59['id'];if(_0x5a6265[_0xf32f('0x20')][_0xf32f('0x41')]){_0x3d60d5[_0xf32f('0x3e')]=_['merge'](_0x3d60d5[_0xf32f('0x3e')],{'$or':_[_0xf32f('0x1b')](_0x3d60d5[_0xf32f('0x2a')],function(_0x47ce1c){var _0x32cc59={};_0x32cc59[_0x47ce1c]={'$like':'%'+_0x5a6265[_0xf32f('0x20')][_0xf32f('0x41')]+'%'};return _0x32cc59;})});}if(_0x5a6265[_0xf32f('0x20')]['$gte']){var _0x2b5632=_0x5a6265[_0xf32f('0x20')][_0xf32f('0x42')][_0xf32f('0x43')](',');var _0x25a37e={};_0x25a37e[_0x2b5632[0x0]]={'$gte':moment(_0x2b5632[0x1])[_0xf32f('0x44')](_0xf32f('0x45'))};_0x3d60d5[_0xf32f('0x3e')]=_['merge'](_0x3d60d5[_0xf32f('0x3e')],_0x25a37e);}_0x3d60d5=_['merge']({},_0x3d60d5,_0x5a6265[_0xf32f('0x2e')]);return db[_0xf32f('0x35')][_0xf32f('0xe')]({'where':_0x3d60d5[_0xf32f('0x3e')]})[_0xf32f('0x14')](function(_0x52c0f3){_0x5518c8['count']=_0x52c0f3;if(_0x5a6265[_0xf32f('0x20')][_0xf32f('0x2d')]){_0x3d60d5[_0xf32f('0x46')]=[{'all':!![]}];}return db[_0xf32f('0x35')][_0xf32f('0x47')](_0x3d60d5);})[_0xf32f('0x14')](function(_0x50cfa9){_0x5518c8[_0xf32f('0x48')]=_0x50cfa9;return _0x5518c8;});}})[_0xf32f('0x14')](respondWithFilteredResult(_0x79aaf2,_0x3d60d5))[_0xf32f('0x21')](handleError(_0x79aaf2,null));};exports[_0xf32f('0x49')]=function(_0x403967,_0x224d7c){return db['OpenchannelInteraction'][_0xf32f('0x2f')]({'where':{'id':_0x403967[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x224d7c,null))[_0xf32f('0x14')](function(_0x33a6b6){if(_0x33a6b6){return _0x33a6b6['setTags'](_0x403967['body']['ids'],_['omit'](_0x403967[_0xf32f('0x31')],[_0xf32f('0x37'),'id'])||{})['spread'](function(){return db[_0xf32f('0x4a')][_0xf32f('0x47')]({'attributes':['id','name',_0xf32f('0x4b')],'where':{'id':_0x403967[_0xf32f('0x31')]['ids']}});})['then'](function(_0x56ce6a){socket[_0xf32f('0x4c')](_0xf32f('0x4d'),{'id':Number(_0x403967[_0xf32f('0x25')]['id']),'tags':_0x56ce6a||[]});return{'id':Number(_0x403967['params']['id']),'tags':_0x56ce6a||[]};});}})['then'](respondWithResult(_0x224d7c,null))[_0xf32f('0x21')](handleError(_0x224d7c,null));};exports['removeTags']=function(_0x3ad996,_0x31195a){return db[_0xf32f('0x1c')][_0xf32f('0x2f')]({'where':{'id':_0x3ad996[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x31195a,null))[_0xf32f('0x14')](function(_0x5b6a96){if(_0x5b6a96){return _0x5b6a96[_0xf32f('0x4e')](_0x3ad996[_0xf32f('0x20')][_0xf32f('0x37')]);}})[_0xf32f('0x14')](respondWithStatusCode(_0x31195a,null))[_0xf32f('0x21')](handleError(_0x31195a,null));};exports['download']=function(_0x5d249b,_0x3552f2){var _0x1ba029=moment()[_0xf32f('0x4f')]()[_0xf32f('0x50')]();var _0x47cefa=path['join'](config[_0xf32f('0x51')],'server',_0xf32f('0x52'),_0xf32f('0x53'));var _0x5b2a7d=path[_0xf32f('0x54')](config[_0xf32f('0x51')],_0xf32f('0x55'),_0xf32f('0x52'),_0xf32f('0x56'));var _0x9fd2b6=path['join'](_0x47cefa,_0x1ba029);var _0xc049ea=util[_0xf32f('0x44')]('transcript-%d-%s.zip',_0x5d249b[_0xf32f('0x25')]['id'],_0x1ba029);var _0x3ede56=path['join'](_0x47cefa,_0xc049ea);var _0x21db78=[];_0x21db78[_0xf32f('0x57')]({'model':db['User'],'as':'User','attributes':['id',_0xf32f('0x58')],'raw':!![]});_0x21db78[_0xf32f('0x57')]({'model':db[_0xf32f('0x59')],'as':_0xf32f('0x5a'),'attributes':['id',_0xf32f('0x5b'),_0xf32f('0x5c')],'raw':!![]});if(_0x5d249b[_0xf32f('0x20')][_0xf32f('0x56')]){_0x21db78['push']({'model':db[_0xf32f('0x5d')],'as':_0xf32f('0x5d'),'raw':!![]});}var _0x5f521d=[{'model':db[_0xf32f('0x35')],'as':'Messages','attributes':['id',_0xf32f('0x31'),'createdAt',_0xf32f('0x5e'),_0xf32f('0x5f'),_0xf32f('0x60')],'include':_0x21db78}];_0x5f521d[_0xf32f('0x57')]({'model':db[_0xf32f('0x61')],'as':'Account','attributes':['id',_0xf32f('0x18')]});_0x5f521d['push']({'model':db['User'],'as':'Owner','attributes':['id',_0xf32f('0x58')]});return db[_0xf32f('0x1c')][_0xf32f('0x2f')]({'where':{'id':_0x5d249b[_0xf32f('0x25')]['id']},'include':_0x5f521d})[_0xf32f('0x14')](handleEntityNotFound(_0x3552f2,null))[_0xf32f('0x14')](function(_0x16b6fd){if(_0x16b6fd){var _0x53a716=_0x16b6fd[_0xf32f('0x62')]({'plain':!![]});fs['mkdirSync'](_0x9fd2b6);var _0x1be65d={'channel':_0xf32f('0x63'),'account':_0x53a716[_0xf32f('0x64')][_0xf32f('0x18')],'agent':_0x53a716[_0xf32f('0x65')]?_0x53a716['Owner']['fullname']:_0xf32f('0x66'),'createdAt':moment(_0x53a716[_0xf32f('0x67')])[_0xf32f('0x44')](_0xf32f('0x45'))[_0xf32f('0x50')](),'closedAt':_0x53a716['closed']?moment(_0x53a716[_0xf32f('0x68')])[_0xf32f('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x53a716[_0xf32f('0x69')],'visibility':_0x53a716[_0xf32f('0x6a')]?_0xf32f('0x6b'):_0xf32f('0x6c'),'messages':_(_0x53a716[_0xf32f('0x6d')])[_0xf32f('0x41')]({'secret':![]})[_0xf32f('0x1b')](function(_0x70cae){if(_0x70cae[_0xf32f('0x5d')]){var _0x569aaa=path['join'](_0x5b2a7d,_0x70cae[_0xf32f('0x5d')][_0xf32f('0x6e')]);if(fs[_0xf32f('0x6f')](_0x569aaa)){fs[_0xf32f('0x70')](_0x569aaa)[_0xf32f('0x71')](fs[_0xf32f('0x72')](path[_0xf32f('0x54')](_0x9fd2b6,_0x70cae[_0xf32f('0x5d')][_0xf32f('0x6e')])));}}return{'date':moment(_0x70cae[_0xf32f('0x67')])[_0xf32f('0x44')](_0xf32f('0x45'))['toString'](),'sender':_0x70cae[_0xf32f('0x5e')]===_0xf32f('0x73')?_0x70cae['User']?_0x70cae[_0xf32f('0x74')][_0xf32f('0x58')]:_0xf32f('0x75'):_0x70cae[_0xf32f('0x5a')][_0xf32f('0x5b')]+(_0x70cae['Contact']['lastName']?'\x20'+_0x70cae[_0xf32f('0x5a')]['lastName']:''),'body':_0x70cae[_0xf32f('0x5d')]?_0x70cae[_0xf32f('0x5d')][_0xf32f('0x6e')]:_0x70cae[_0xf32f('0x31')],'direction':_0x70cae[_0xf32f('0x5e')]===_0xf32f('0x73')?'A':'C','secret':_0x70cae[_0xf32f('0x5f')],'read':_0x70cae[_0xf32f('0x60')],'attachment':_0x70cae[_0xf32f('0x5d')]};})[_0xf32f('0x76')]()};return ejs['renderFile'](path['join'](config[_0xf32f('0x51')],'server',_0xf32f('0x77'),_0xf32f('0x78')),{'interaction':_0x1be65d})['then'](function(_0x19b0c6){var _0x23a46d=path[_0xf32f('0x54')](_0x9fd2b6,_0xf32f('0x79')+_0x53a716['id']+'-'+_0x1ba029+'.pdf');var _0x1ec9e1={'path':_0x23a46d,'channel':'Openchannel','interactionId':_0x53a716['id']};return pdf[_0xf32f('0x7a')](_0x19b0c6,_0x1ec9e1);})[_0xf32f('0x14')](function(){return new Promise(function(_0x20845d,_0x2a846e){zipdir(_0x9fd2b6,{'saveTo':_0x3ede56},function(_0xb8244d,_0x481e49){if(_0xb8244d)return _0x2a846e(_0xb8244d);return _0x20845d(_0x481e49);});})['then'](function(){return new Promise(function(_0xc99fd,_0x2b090e){rimraf(_0x9fd2b6,function(_0x5081d8){if(_0x5081d8)_0x2b090e(_0x5081d8);return _0xc99fd();});});})[_0xf32f('0x14')](function(){return _0x3552f2['download'](_0x3ede56,_0xc049ea,function(_0x21bf51){if(_0x21bf51){logger[_0xf32f('0x16')](_0xf32f('0x7b'),_0x21bf51);}else{fs[_0xf32f('0x7c')](_0x3ede56);}});});});}else{return _0x3552f2[_0xf32f('0x7d')](0xc8);}})['catch'](handleError(_0x3552f2,null));}; \ No newline at end of file +var _0x75d8=['YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','Private','basename','existsSync','createReadStream','createWriteStream','out','System','Contact','direction','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','ejs','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','error','stack','name','map','fieldName','key','getOptions','findAll','openchannel','user','catch','show','query','type','from','params','model','keys','OpenchannelInteraction','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','addTags','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','files','attachments','join','push','User','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','fullname','N.A.'];(function(_0x2cc312,_0x3d452a){var _0x12edd2=function(_0x36fdcd){while(--_0x36fdcd){_0x2cc312['push'](_0x2cc312['shift']());}};_0x12edd2(++_0x3d452a);}(_0x75d8,0x19b));var _0x875d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75d8[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x875d('0x0'));var zipdir=require('zip-dir');var moment=require(_0x875d('0x1'));var util=require(_0x875d('0x2'));var path=require(_0x875d('0x3'));var ejs=require(_0x875d('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x875d('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x875d('0x6'));var logger=require(_0x875d('0x7'))(_0x875d('0x8'));var config=require(_0x875d('0x9'));var db=require(_0x875d('0xa'))['db'];config[_0x875d('0xb')]=_['defaults'](config[_0x875d('0xb')],{'host':_0x875d('0xc'),'port':0x18eb});var socket=require(_0x875d('0xd'))(new Redis(config[_0x875d('0xb')]));require(_0x875d('0xe'))[_0x875d('0xf')](socket);function respondWithStatusCode(_0x25bbea,_0x3e4eba){_0x3e4eba=_0x3e4eba||0xcc;return function(_0x54ace4){if(_0x54ace4){return _0x25bbea[_0x875d('0x10')](_0x3e4eba);}return _0x25bbea[_0x875d('0x11')](_0x3e4eba)['end']();};}function respondWithResult(_0x438169,_0x32cabe){_0x32cabe=_0x32cabe||0xc8;return function(_0x5aea54){if(_0x5aea54){return _0x438169['status'](_0x32cabe)[_0x875d('0x12')](_0x5aea54);}};}function respondWithFilteredResult(_0x60abf7,_0x13f9b4){return function(_0x6a4fea){if(_0x6a4fea){var _0x16b56e=typeof _0x13f9b4['offset']===_0x875d('0x13')&&typeof _0x13f9b4[_0x875d('0x14')]===_0x875d('0x13');var _0x57e663=_0x6a4fea[_0x875d('0x15')];var _0x5baff9=_0x16b56e?0x0:_0x13f9b4[_0x875d('0x16')];var _0x52aa1f=_0x16b56e?_0x6a4fea[_0x875d('0x15')]:_0x13f9b4[_0x875d('0x16')]+_0x13f9b4[_0x875d('0x14')];var _0x42ab71;if(_0x52aa1f>=_0x57e663){_0x52aa1f=_0x57e663;_0x42ab71=0xc8;}else{_0x42ab71=0xce;}_0x60abf7[_0x875d('0x11')](_0x42ab71);return _0x60abf7['set'](_0x875d('0x17'),_0x5baff9+'-'+_0x52aa1f+'/'+_0x57e663)['json'](_0x6a4fea);}return null;};}function saveUpdates(_0x34cc7a){return function(_0x1f2c7b){if(_0x1f2c7b){return _0x1f2c7b[_0x875d('0x18')](_0x34cc7a)[_0x875d('0x19')](function(_0x7378b3){return _0x7378b3;});}return null;};}function removeEntity(_0x160be2){return function(_0x57ce3a){if(_0x57ce3a){return _0x57ce3a[_0x875d('0x1a')]()[_0x875d('0x19')](function(){_0x160be2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b498){return function(_0x3b32c1){if(!_0x3b32c1){_0x35b498[_0x875d('0x10')](0x194);}return _0x3b32c1;};}function handleError(_0xaf1bcc,_0x47d3e9){_0x47d3e9=_0x47d3e9||0x1f4;return function(_0x3ac863){logger[_0x875d('0x1b')](_0x3ac863[_0x875d('0x1c')]);if(_0x3ac863[_0x875d('0x1d')]){delete _0x3ac863[_0x875d('0x1d')];}_0xaf1bcc['status'](_0x47d3e9)['send'](_0x3ac863);};}exports['index']=function(_0x427a07,_0xd32b7){var _0x2a1535={};var _0xb3d0b5=_[_0x875d('0x1e')](db['OpenchannelInteraction']['rawAttributes'],function(_0x1c4583){return{'name':_0x1c4583[_0x875d('0x1f')],'type':_0x1c4583['type'][_0x875d('0x20')]};});_0x2a1535=qs[_0x875d('0x21')](_0xb3d0b5,_0x427a07);return interaction[_0x875d('0x22')](_0x875d('0x23'),_0x427a07['query'],_0x427a07[_0x875d('0x24')],_0x2a1535,_0xb3d0b5)[_0x875d('0x19')](respondWithFilteredResult(_0xd32b7,_0x2a1535))[_0x875d('0x25')](handleError(_0xd32b7,null));};exports[_0x875d('0x26')]=function(_0x2b0c22,_0x5e4d56){var _0x3a7bf5={};if(_0x2b0c22[_0x875d('0x27')][_0x875d('0x28')]&&_0x2b0c22[_0x875d('0x27')]['type']==='from'){_0x3a7bf5[_0x875d('0x29')]=_0x2b0c22[_0x875d('0x2a')]['id'];}else{_0x3a7bf5['id']=_0x2b0c22[_0x875d('0x2a')]['id'];}var _0x2c5a86={'raw':![],'where':_0x3a7bf5},_0x199498={};_0x199498[_0x875d('0x2b')]=_[_0x875d('0x2c')](db[_0x875d('0x2d')][_0x875d('0x2e')]);_0x199498[_0x875d('0x27')]=_[_0x875d('0x2c')](_0x2b0c22[_0x875d('0x27')]);_0x199498[_0x875d('0x2f')]=_[_0x875d('0x30')](_0x199498[_0x875d('0x2b')],_0x199498[_0x875d('0x27')]);_0x2c5a86[_0x875d('0x31')]=_[_0x875d('0x30')](_0x199498['model'],qs[_0x875d('0x32')](_0x2b0c22[_0x875d('0x27')][_0x875d('0x32')]));_0x2c5a86[_0x875d('0x31')]=_0x2c5a86[_0x875d('0x31')][_0x875d('0x33')]?_0x2c5a86[_0x875d('0x31')]:_0x199498['model'];if(_0x2b0c22[_0x875d('0x27')][_0x875d('0x34')]){_0x2c5a86['include']=[{'all':!![]}];}_0x2c5a86=_[_0x875d('0x35')]({},_0x2c5a86,_0x2b0c22[_0x875d('0x36')]);return db['OpenchannelInteraction'][_0x875d('0x37')](_0x2c5a86)[_0x875d('0x19')](handleEntityNotFound(_0x5e4d56,null))[_0x875d('0x19')](respondWithResult(_0x5e4d56,null))[_0x875d('0x25')](handleError(_0x5e4d56,null));};exports['create']=function(_0x268d0b,_0x453b4c){return db[_0x875d('0x2d')][_0x875d('0x38')](_0x268d0b[_0x875d('0x39')],{})[_0x875d('0x19')](respondWithResult(_0x453b4c,0xc9))[_0x875d('0x25')](handleError(_0x453b4c,null));};exports[_0x875d('0x18')]=function(_0x112099,_0x25fc18){if(_0x112099[_0x875d('0x39')]['id']){delete _0x112099[_0x875d('0x39')]['id'];}return db[_0x875d('0x2d')][_0x875d('0x37')]({'where':{'id':_0x112099['params']['id']}})[_0x875d('0x19')](handleEntityNotFound(_0x25fc18,null))[_0x875d('0x19')](saveUpdates(_0x112099[_0x875d('0x39')],null))['then'](respondWithResult(_0x25fc18,null))[_0x875d('0x25')](handleError(_0x25fc18,null));};exports[_0x875d('0x1a')]=function(_0x9253b1,_0x4d9995){return db['OpenchannelInteraction'][_0x875d('0x37')]({'where':{'id':_0x9253b1['params']['id']}})[_0x875d('0x19')](handleEntityNotFound(_0x4d9995,null))[_0x875d('0x19')](removeEntity(_0x4d9995,null))[_0x875d('0x25')](handleError(_0x4d9995,null));};exports[_0x875d('0x3a')]=function(_0x167600,_0x3ddb32){return db['OpenchannelInteraction']['describe']()[_0x875d('0x19')](respondWithResult(_0x3ddb32,null))[_0x875d('0x25')](handleError(_0x3ddb32,null));};exports[_0x875d('0x3b')]=function(_0xc8bde2,_0x5570f7){return db[_0x875d('0x3c')][_0x875d('0x37')]({'where':{'id':_0xc8bde2[_0x875d('0x2a')]['id']}})[_0x875d('0x19')](handleEntityNotFound(_0x5570f7,null))['then'](function(_0x7277ca){if(_0x7277ca){return _0x7277ca[_0x875d('0x3b')](_0xc8bde2[_0x875d('0x39')][_0x875d('0x3d')],_[_0x875d('0x3e')](_0xc8bde2[_0x875d('0x39')],[_0x875d('0x3d'),'id'])||{});}})[_0x875d('0x19')](respondWithResult(_0x5570f7,null))[_0x875d('0x25')](handleError(_0x5570f7,null));};exports[_0x875d('0x3f')]=function(_0x55afba,_0x3f390d){var _0x225f9c={'raw':![],'where':{}};var _0x49355c={};var _0x14ac22={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x875d('0x40')]({'where':{'id':_0x55afba[_0x875d('0x2a')]['id']}})[_0x875d('0x19')](handleEntityNotFound(_0x3f390d,null))[_0x875d('0x19')](function(_0xd2d358){if(_0xd2d358){_0x49355c[_0x875d('0x2b')]=_[_0x875d('0x2c')](db['OpenchannelMessage'][_0x875d('0x2e')]);_0x49355c[_0x875d('0x27')]=_[_0x875d('0x2c')](_0x55afba[_0x875d('0x27')]);_0x49355c[_0x875d('0x2f')]=_[_0x875d('0x30')](_0x49355c[_0x875d('0x2b')],_0x49355c[_0x875d('0x27')]);_0x225f9c[_0x875d('0x31')]=_[_0x875d('0x30')](_0x49355c[_0x875d('0x2b')],qs[_0x875d('0x32')](_0x55afba[_0x875d('0x27')][_0x875d('0x32')]));_0x225f9c[_0x875d('0x31')]=_0x225f9c[_0x875d('0x31')][_0x875d('0x33')]?_0x225f9c['attributes']:_0x49355c[_0x875d('0x2b')];if(!_0x55afba['query']['hasOwnProperty'](_0x875d('0x41'))){_0x225f9c[_0x875d('0x14')]=qs['limit'](_0x55afba[_0x875d('0x27')][_0x875d('0x14')]);_0x225f9c[_0x875d('0x16')]=qs[_0x875d('0x16')](_0x55afba['query'][_0x875d('0x16')]);}_0x225f9c[_0x875d('0x42')]=qs[_0x875d('0x43')](_0x55afba['query'][_0x875d('0x43')]);_0x225f9c[_0x875d('0x44')]=qs[_0x875d('0x2f')](_[_0x875d('0x45')](_0x55afba['query'],_0x49355c[_0x875d('0x2f')]));_0x225f9c[_0x875d('0x44')][_0x875d('0x46')]=_0xd2d358['id'];if(_0x55afba[_0x875d('0x27')][_0x875d('0x47')]){_0x225f9c['where']=_[_0x875d('0x35')](_0x225f9c['where'],{'$or':_[_0x875d('0x1e')](_0x225f9c[_0x875d('0x31')],function(_0x1b5956){var _0x14796d={};_0x14796d[_0x1b5956]={'$like':'%'+_0x55afba['query'][_0x875d('0x47')]+'%'};return _0x14796d;})});}if(_0x55afba[_0x875d('0x27')][_0x875d('0x48')]){var _0xde4be5=_0x55afba['query'][_0x875d('0x48')][_0x875d('0x49')](',');var _0x3c48bb={};_0x3c48bb[_0xde4be5[0x0]]={'$gte':moment(_0xde4be5[0x1])[_0x875d('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x225f9c[_0x875d('0x44')]=_[_0x875d('0x35')](_0x225f9c[_0x875d('0x44')],_0x3c48bb);}_0x225f9c=_['merge']({},_0x225f9c,_0x55afba[_0x875d('0x36')]);return db[_0x875d('0x3c')][_0x875d('0x15')]({'where':_0x225f9c['where']})[_0x875d('0x19')](function(_0x4e611a){_0x14ac22[_0x875d('0x15')]=_0x4e611a;if(_0x55afba['query'][_0x875d('0x34')]){_0x225f9c['include']=[{'all':!![]}];}return db[_0x875d('0x3c')][_0x875d('0x22')](_0x225f9c);})[_0x875d('0x19')](function(_0x43b94c){_0x14ac22['rows']=_0x43b94c;return _0x14ac22;});}})['then'](respondWithFilteredResult(_0x3f390d,_0x225f9c))[_0x875d('0x25')](handleError(_0x3f390d,null));};exports[_0x875d('0x4b')]=function(_0xe00728,_0x541237){return db[_0x875d('0x2d')][_0x875d('0x37')]({'where':{'id':_0xe00728['params']['id']}})['then'](handleEntityNotFound(_0x541237,null))['then'](function(_0x35cf9e){if(_0x35cf9e){return _0x35cf9e[_0x875d('0x4c')](_0xe00728[_0x875d('0x39')][_0x875d('0x3d')],_[_0x875d('0x3e')](_0xe00728['body'],['ids','id'])||{})['spread'](function(){return db[_0x875d('0x4d')][_0x875d('0x22')]({'attributes':['id',_0x875d('0x1d'),_0x875d('0x4e')],'where':{'id':_0xe00728[_0x875d('0x39')]['ids']}});})[_0x875d('0x19')](function(_0x2e4cad){socket[_0x875d('0x4f')](_0x875d('0x50'),{'id':Number(_0xe00728['params']['id']),'tags':_0x2e4cad||[]});return{'id':Number(_0xe00728[_0x875d('0x2a')]['id']),'tags':_0x2e4cad||[]};});}})[_0x875d('0x19')](respondWithResult(_0x541237,null))[_0x875d('0x25')](handleError(_0x541237,null));};exports[_0x875d('0x51')]=function(_0x2825ba,_0x2cc5c3){return db['OpenchannelInteraction'][_0x875d('0x37')]({'where':{'id':_0x2825ba['params']['id']}})[_0x875d('0x19')](handleEntityNotFound(_0x2cc5c3,null))[_0x875d('0x19')](function(_0x16677d){if(_0x16677d){return _0x16677d[_0x875d('0x51')](_0x2825ba['query'][_0x875d('0x3d')]);}})[_0x875d('0x19')](respondWithStatusCode(_0x2cc5c3,null))['catch'](handleError(_0x2cc5c3,null));};exports[_0x875d('0x52')]=function(_0x5e8015,_0x35cb65){var _0x5057bc=moment()[_0x875d('0x53')]()[_0x875d('0x54')]();var _0x125ade=path['join'](config[_0x875d('0x55')],_0x875d('0x56'),'files',_0x875d('0x57'));var _0x47beeb=path['join'](config[_0x875d('0x55')],_0x875d('0x56'),_0x875d('0x58'),_0x875d('0x59'));var _0x26be70=path['join'](_0x125ade,_0x5057bc);var _0x8251f4=util['format']('transcript-%d-%s.zip',_0x5e8015['params']['id'],_0x5057bc);var _0x38514d=path[_0x875d('0x5a')](_0x125ade,_0x8251f4);var _0x3014f2=[];_0x3014f2[_0x875d('0x5b')]({'model':db[_0x875d('0x5c')],'as':_0x875d('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x3014f2[_0x875d('0x5b')]({'model':db[_0x875d('0x5d')],'as':'Contact','attributes':['id',_0x875d('0x5e'),_0x875d('0x5f')],'raw':!![]});if(_0x5e8015[_0x875d('0x27')][_0x875d('0x59')]){_0x3014f2['push']({'model':db[_0x875d('0x60')],'as':_0x875d('0x60'),'raw':!![]});}var _0xac05a9=[{'model':db[_0x875d('0x3c')],'as':_0x875d('0x61'),'attributes':['id',_0x875d('0x39'),_0x875d('0x62'),'direction',_0x875d('0x63'),_0x875d('0x64')],'include':_0x3014f2}];_0xac05a9[_0x875d('0x5b')]({'model':db[_0x875d('0x65')],'as':'Account','attributes':['id',_0x875d('0x1d')]});_0xac05a9[_0x875d('0x5b')]({'model':db['User'],'as':_0x875d('0x66'),'attributes':['id','fullname']});return db[_0x875d('0x2d')][_0x875d('0x37')]({'where':{'id':_0x5e8015['params']['id']},'include':_0xac05a9})['then'](handleEntityNotFound(_0x35cb65,null))[_0x875d('0x19')](function(_0x4766d8){if(_0x4766d8){var _0x21a070=_0x4766d8[_0x875d('0x67')]({'plain':!![]});fs[_0x875d('0x68')](_0x26be70);var _0x2d9481={'channel':_0x875d('0x69'),'account':_0x21a070[_0x875d('0x6a')]['name'],'agent':_0x21a070[_0x875d('0x66')]?_0x21a070[_0x875d('0x66')][_0x875d('0x6b')]:_0x875d('0x6c'),'createdAt':moment(_0x21a070[_0x875d('0x62')])[_0x875d('0x4a')](_0x875d('0x6d'))[_0x875d('0x54')](),'closedAt':_0x21a070[_0x875d('0x6e')]?moment(_0x21a070[_0x875d('0x6f')])[_0x875d('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x875d('0x54')]():'','disposition':_0x21a070['disposition'],'visibility':_0x21a070[_0x875d('0x70')]?'Public':_0x875d('0x71'),'messages':_(_0x21a070[_0x875d('0x61')])[_0x875d('0x47')]({'secret':![]})[_0x875d('0x1e')](function(_0x57ca48){if(_0x57ca48['Attachment']){var _0x14f9ed=path[_0x875d('0x5a')](_0x47beeb,_0x57ca48[_0x875d('0x60')][_0x875d('0x72')]);if(fs[_0x875d('0x73')](_0x14f9ed)){fs[_0x875d('0x74')](_0x14f9ed)['pipe'](fs[_0x875d('0x75')](path[_0x875d('0x5a')](_0x26be70,_0x57ca48['Attachment'][_0x875d('0x72')])));}}return{'date':moment(_0x57ca48[_0x875d('0x62')])[_0x875d('0x4a')](_0x875d('0x6d'))[_0x875d('0x54')](),'sender':_0x57ca48['direction']===_0x875d('0x76')?_0x57ca48[_0x875d('0x5c')]?_0x57ca48[_0x875d('0x5c')]['fullname']:_0x875d('0x77'):_0x57ca48[_0x875d('0x78')][_0x875d('0x5e')]+(_0x57ca48[_0x875d('0x78')][_0x875d('0x5f')]?'\x20'+_0x57ca48[_0x875d('0x78')]['lastName']:''),'body':_0x57ca48[_0x875d('0x60')]?_0x57ca48[_0x875d('0x60')][_0x875d('0x72')]:_0x57ca48[_0x875d('0x39')],'direction':_0x57ca48[_0x875d('0x79')]===_0x875d('0x76')?'A':'C','secret':_0x57ca48[_0x875d('0x63')],'read':_0x57ca48[_0x875d('0x64')],'attachment':_0x57ca48[_0x875d('0x60')]};})[_0x875d('0x7a')]()};return ejs['renderFile'](path['join'](config[_0x875d('0x55')],_0x875d('0x56'),_0x875d('0x7b'),_0x875d('0x7c')),{'interaction':_0x2d9481})['then'](function(_0x4a849f){var _0x3f67bd=path[_0x875d('0x5a')](_0x26be70,_0x875d('0x7d')+_0x21a070['id']+'-'+_0x5057bc+_0x875d('0x7e'));var _0x18e15c={'path':_0x3f67bd,'channel':_0x875d('0x69'),'interactionId':_0x21a070['id']};return pdf[_0x875d('0x7f')](_0x4a849f,_0x18e15c);})[_0x875d('0x19')](function(){return new Promise(function(_0x4d51d8,_0x55176a){zipdir(_0x26be70,{'saveTo':_0x38514d},function(_0x21cce8,_0x30c9ff){if(_0x21cce8)return _0x55176a(_0x21cce8);return _0x4d51d8(_0x30c9ff);});})['then'](function(){return new Promise(function(_0x527f7d,_0x474bca){rimraf(_0x26be70,function(_0xfd21a5){if(_0xfd21a5)_0x474bca(_0xfd21a5);return _0x527f7d();});});})[_0x875d('0x19')](function(){return _0x35cb65[_0x875d('0x52')](_0x38514d,_0x8251f4,function(_0x5e5fd5){if(_0x5e5fd5){logger[_0x875d('0x1b')](_0x875d('0x80'),_0x5e5fd5);}else{fs[_0x875d('0x81')](_0x38514d);}});});});}else{return _0x35cb65[_0x875d('0x10')](0xc8);}})['catch'](handleError(_0x35cb65,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 7508152..c52bfea 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 _0x2d91=['getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x2ee0fb,_0x561a05){var _0x590998=function(_0x334874){while(--_0x334874){_0x2ee0fb['push'](_0x2ee0fb['shift']());}};_0x590998(++_0x561a05);}(_0x2d91,0x1ba));var _0x12d9=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x2d91[_0x37b7b6];return _0x10c4c3;};'use strict';var EventEmitter=require(_0x12d9('0x0'));var OpenchannelInteraction=require(_0x12d9('0x1'))['db'][_0x12d9('0x2')];var OpenchannelMessage=require(_0x12d9('0x1'))['db'][_0x12d9('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x12d9('0x4')](0x0);var events={'afterCreate':_0x12d9('0x5'),'afterUpdate':_0x12d9('0x6'),'afterDestroy':_0x12d9('0x7')};function emitEvent(_0x34a00d){return function(_0x3a9c83,_0x545f00,_0x45383c){_0x3a9c83[_0x12d9('0x8')]({'attributes':['id'],'raw':!![]})[_0x12d9('0x9')](function(_0x3009ab){_0x3a9c83[_0x12d9('0xa')]('Users',_0x3009ab['map'](function(_0x4f3763){return{'id':_0x4f3763['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3a9c83['id'],'direction':'in','read':![]},'raw':!![]});})[_0x12d9('0x9')](function(_0x248f05){_0x3a9c83[_0x12d9('0xa')](_0x12d9('0xb'),_0x248f05[_0x12d9('0xc')]);OpenchannelInteractionEvents[_0x12d9('0xd')](_0x34a00d+':'+_0x3a9c83['id'],_0x3a9c83);OpenchannelInteractionEvents[_0x12d9('0xd')](_0x34a00d,_0x3a9c83);_0x45383c(null);})[_0x12d9('0xe')](_0x45383c(null));};}for(var e in events){if(events[_0x12d9('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x12d9('0x10')](e,emitEvent(event));}}module[_0x12d9('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1606=['hasOwnProperty','hook','exports','events','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','length','emit','catch'];(function(_0x265b60,_0x66cf64){var _0x9e3b4a=function(_0x277e55){while(--_0x277e55){_0x265b60['push'](_0x265b60['shift']());}};_0x9e3b4a(++_0x66cf64);}(_0x1606,0x192));var _0x6160=function(_0x481ecf,_0x134386){_0x481ecf=_0x481ecf-0x0;var _0x29104b=_0x1606[_0x481ecf];return _0x29104b;};'use strict';var EventEmitter=require(_0x6160('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x6160('0x1')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6160('0x2')](0x0);var events={'afterCreate':_0x6160('0x3'),'afterUpdate':_0x6160('0x4'),'afterDestroy':_0x6160('0x5')};function emitEvent(_0x23a05d){return function(_0x50e087,_0x3a67fc,_0x5ed968){_0x50e087[_0x6160('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xbc2972){_0x50e087['setDataValue'](_0x6160('0x7'),_0xbc2972[_0x6160('0x8')](function(_0x5a7712){return{'id':_0x5a7712['id']};}));return OpenchannelMessage[_0x6160('0x9')]({'where':{'OpenchannelInteractionId':_0x50e087['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6160('0xa')](function(_0x2f59f9){_0x50e087[_0x6160('0xb')](_0x6160('0xc'),_0x2f59f9[_0x6160('0xd')]);OpenchannelInteractionEvents['emit'](_0x23a05d+':'+_0x50e087['id'],_0x50e087);OpenchannelInteractionEvents[_0x6160('0xe')](_0x23a05d,_0x50e087);_0x5ed968(null);})[_0x6160('0xf')](_0x5ed968(null));};}for(var e in events){if(events[_0x6160('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x6160('0x11')](e,emitEvent(event));}}module[_0x6160('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index a526887..5a9c2e5 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 _0xfaff=['utf8mb4_unicode_ci','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4'];(function(_0x160d2e,_0x2d3f3a){var _0x4bacb3=function(_0x4fc73c){while(--_0x4fc73c){_0x160d2e['push'](_0x160d2e['shift']());}};_0x4bacb3(++_0x2d3f3a);}(_0xfaff,0x173));var _0xffaf=function(_0x371b47,_0x1e28da){_0x371b47=_0x371b47-0x0;var _0x48fb33=_0xfaff[_0x371b47];return _0x48fb33;};'use strict';var _=require(_0xffaf('0x0'));var util=require(_0xffaf('0x1'));var logger=require(_0xffaf('0x2'))('api');var moment=require(_0xffaf('0x3'));var BPromise=require(_0xffaf('0x4'));var rp=require(_0xffaf('0x5'));var fs=require('fs');var path=require(_0xffaf('0x6'));var rimraf=require('rimraf');var config=require(_0xffaf('0x7'));var attributes=require(_0xffaf('0x8'));module[_0xffaf('0x9')]=function(_0x5662d1,_0x55a923){return _0x5662d1[_0xffaf('0xa')](_0xffaf('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xffaf('0xc'),'collate':_0xffaf('0xd'),'hooks':{'beforeUpdate':function(_0x2657a1,_0x3cc10d,_0x36d787){if(_0x2657a1['changed']('closed')){_0x2657a1[_0xffaf('0xe')]=moment()[_0xffaf('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x36d787(null,_0x2657a1);}}});}; \ No newline at end of file +var _0xc131=['path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x531de2,_0x376663){var _0x5c9083=function(_0x4dfdaf){while(--_0x4dfdaf){_0x531de2['push'](_0x531de2['shift']());}};_0x5c9083(++_0x376663);}(_0xc131,0x8b));var _0x1c13=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc131[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x1c13('0x0'));var logger=require(_0x1c13('0x1'))('api');var moment=require(_0x1c13('0x2'));var BPromise=require(_0x1c13('0x3'));var rp=require(_0x1c13('0x4'));var fs=require('fs');var path=require(_0x1c13('0x5'));var rimraf=require(_0x1c13('0x6'));var config=require(_0x1c13('0x7'));var attributes=require(_0x1c13('0x8'));module[_0x1c13('0x9')]=function(_0x3d0a7d,_0x3ca5d0){return _0x3d0a7d[_0x1c13('0xa')](_0x1c13('0xb'),attributes,{'tableName':_0x1c13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c13('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5c753c,_0x27f400,_0x471a5b){if(_0x5c753c['changed'](_0x1c13('0xe'))){_0x5c753c[_0x1c13('0xf')]=moment()[_0x1c13('0x10')](_0x1c13('0x11'));}_0x471a5b(null,_0x5c753c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 1b3c83f..8343ff2 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 _0x2db0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','debug','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags'];(function(_0x3d6095,_0x57e878){var _0x2c25e2=function(_0x3c4255){while(--_0x3c4255){_0x3d6095['push'](_0x3d6095['shift']());}};_0x2c25e2(++_0x57e878);}(_0x2db0,0x126));var _0x02db=function(_0x23b8be,_0x4415fa){_0x23b8be=_0x23b8be-0x0;var _0x33ff77=_0x2db0[_0x23b8be];return _0x33ff77;};'use strict';var _=require('lodash');var util=require(_0x02db('0x0'));var moment=require(_0x02db('0x1'));var BPromise=require(_0x02db('0x2'));var rs=require(_0x02db('0x3'));var fs=require('fs');var Redis=require(_0x02db('0x4'));var db=require(_0x02db('0x5'))['db'];var utils=require(_0x02db('0x6'));var logger=require('../../config/logger')(_0x02db('0x7'));var config=require(_0x02db('0x8'));var jayson=require(_0x02db('0x9'));var client=jayson[_0x02db('0xa')]['http']({'port':0x232a});config[_0x02db('0xb')]=_[_0x02db('0xc')](config[_0x02db('0xb')],{'host':_0x02db('0xd'),'port':0x18eb});var socket=require(_0x02db('0xe'))(new Redis(config['redis']));require(_0x02db('0xf'))[_0x02db('0x10')](socket);function respondWithRpcPromise(_0x46f89d,_0x587380,_0x52c120){return new BPromise(function(_0x5b260c,_0x2585ae){return client[_0x02db('0x11')](_0x46f89d,_0x52c120)['then'](function(_0x1f20a3){logger[_0x02db('0x12')](_0x02db('0x13'),_0x587380,_0x02db('0x14'));logger['debug'](_0x02db('0x15'),_0x587380,_0x02db('0x14'),JSON[_0x02db('0x16')](_0x1f20a3));if(_0x1f20a3[_0x02db('0x17')]){if(_0x1f20a3[_0x02db('0x17')]['code']===0x1f4){logger[_0x02db('0x17')](_0x02db('0x13'),_0x587380,_0x1f20a3[_0x02db('0x17')]['message']);return _0x2585ae(_0x1f20a3[_0x02db('0x17')][_0x02db('0x18')]);}logger[_0x02db('0x17')](_0x02db('0x13'),_0x587380,_0x1f20a3[_0x02db('0x17')][_0x02db('0x18')]);return _0x5b260c(_0x1f20a3[_0x02db('0x17')][_0x02db('0x18')]);}else{logger[_0x02db('0x12')](_0x02db('0x13'),_0x587380,'request\x20sent');_0x5b260c(_0x1f20a3['result']['message']);}})[_0x02db('0x19')](function(_0x32b9d7){logger[_0x02db('0x17')](_0x02db('0x13'),_0x587380,_0x32b9d7);_0x2585ae(_0x32b9d7);});});}exports[_0x02db('0x1a')]=function(_0x29fed5){var _0x3dd145=this;return new Promise(function(_0x5570e0,_0x219280){return db[_0x02db('0x1b')][_0x02db('0x1c')](_0x29fed5[_0x02db('0x1d')],{'raw':_0x29fed5[_0x02db('0x1e')]?_0x29fed5[_0x02db('0x1e')][_0x02db('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29fed5[_0x02db('0x1e')]?_0x29fed5['options']['where']||null:null,'attributes':_0x29fed5[_0x02db('0x1e')]?_0x29fed5[_0x02db('0x1e')][_0x02db('0x20')]||null:null,'limit':_0x29fed5[_0x02db('0x1e')]?_0x29fed5[_0x02db('0x1e')]['limit']||null:null})['then'](function(_0x2d40cb){logger[_0x02db('0x12')](_0x02db('0x1a'),_0x29fed5);logger[_0x02db('0x21')](_0x02db('0x1a'),_0x29fed5,JSON[_0x02db('0x16')](_0x2d40cb));_0x5570e0(_0x2d40cb);})[_0x02db('0x19')](function(_0x157350){logger[_0x02db('0x17')](_0x02db('0x1a'),_0x157350['message'],_0x29fed5);_0x219280(_0x3dd145[_0x02db('0x17')](0x1f4,_0x157350[_0x02db('0x18')]));});});};exports[_0x02db('0x22')]=function(_0x119b1c){return new Promise(function(_0x84a412,_0x70322e){return db[_0x02db('0x1b')][_0x02db('0x23')]({'where':_0x119b1c[_0x02db('0x1e')]?_0x119b1c[_0x02db('0x1e')][_0x02db('0x24')]||null:null})['then'](function(_0x358a4e){if(_0x358a4e){return _0x358a4e[_0x02db('0x25')](_0x119b1c[_0x02db('0x1d')][_0x02db('0x26')],_[_0x02db('0x27')](_0x119b1c[_0x02db('0x1d')],[_0x02db('0x26'),'id'])||{});}})[_0x02db('0x28')](function(_0x5847a0){logger['info']('AddTags',_0x119b1c);logger['debug']('AddTags',_0x119b1c,JSON[_0x02db('0x16')](_0x5847a0));_0x84a412(_0x5847a0);})['catch'](function(_0x58c3b4){logger[_0x02db('0x17')](_0x02db('0x29'),_0x58c3b4[_0x02db('0x18')],_0x119b1c);_0x70322e(_this[_0x02db('0x17')](0x1f4,_0x58c3b4[_0x02db('0x18')]));});});}; \ No newline at end of file +var _0xe4e6=['message','result','UpdateOpenchannelInteraction','update','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','omit','ids','spread','AddTags','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error'];(function(_0x340d25,_0x4e40dd){var _0x5dfc22=function(_0x1b0821){while(--_0x1b0821){_0x340d25['push'](_0x340d25['shift']());}};_0x5dfc22(++_0x4e40dd);}(_0xe4e6,0x10d));var _0x6e4e=function(_0x30c495,_0x26da1f){_0x30c495=_0x30c495-0x0;var _0x5ae080=_0xe4e6[_0x30c495];return _0x5ae080;};'use strict';var _=require(_0x6e4e('0x0'));var util=require(_0x6e4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e4e('0x2'));var fs=require('fs');var Redis=require(_0x6e4e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e4e('0x4'));var logger=require(_0x6e4e('0x5'))(_0x6e4e('0x6'));var config=require(_0x6e4e('0x7'));var jayson=require(_0x6e4e('0x8'));var client=jayson[_0x6e4e('0x9')][_0x6e4e('0xa')]({'port':0x232a});config[_0x6e4e('0xb')]=_[_0x6e4e('0xc')](config[_0x6e4e('0xb')],{'host':_0x6e4e('0xd'),'port':0x18eb});var socket=require(_0x6e4e('0xe'))(new Redis(config[_0x6e4e('0xb')]));require(_0x6e4e('0xf'))[_0x6e4e('0x10')](socket);function respondWithRpcPromise(_0x3dd59b,_0x1e2815,_0x3d6c8f){return new BPromise(function(_0x3639b5,_0x43424d){return client[_0x6e4e('0x11')](_0x3dd59b,_0x3d6c8f)[_0x6e4e('0x12')](function(_0x141116){logger[_0x6e4e('0x13')](_0x6e4e('0x14'),_0x1e2815,_0x6e4e('0x15'));logger[_0x6e4e('0x16')](_0x6e4e('0x17'),_0x1e2815,_0x6e4e('0x15'),JSON['stringify'](_0x141116));if(_0x141116[_0x6e4e('0x18')]){if(_0x141116[_0x6e4e('0x18')]['code']===0x1f4){logger['error'](_0x6e4e('0x14'),_0x1e2815,_0x141116[_0x6e4e('0x18')][_0x6e4e('0x19')]);return _0x43424d(_0x141116[_0x6e4e('0x18')]['message']);}logger[_0x6e4e('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e2815,_0x141116[_0x6e4e('0x18')][_0x6e4e('0x19')]);return _0x3639b5(_0x141116[_0x6e4e('0x18')]['message']);}else{logger[_0x6e4e('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e2815,_0x6e4e('0x15'));_0x3639b5(_0x141116[_0x6e4e('0x1a')]['message']);}})['catch'](function(_0x190fa8){logger[_0x6e4e('0x18')](_0x6e4e('0x14'),_0x1e2815,_0x190fa8);_0x43424d(_0x190fa8);});});}exports[_0x6e4e('0x1b')]=function(_0x46c6a7){var _0x3bf63c=this;return new Promise(function(_0x1c5f0c,_0x34549e){return db['OpenchannelInteraction'][_0x6e4e('0x1c')](_0x46c6a7[_0x6e4e('0x1d')],{'raw':_0x46c6a7[_0x6e4e('0x1e')]?_0x46c6a7[_0x6e4e('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46c6a7[_0x6e4e('0x1e')]?_0x46c6a7[_0x6e4e('0x1e')][_0x6e4e('0x1f')]||null:null,'attributes':_0x46c6a7[_0x6e4e('0x1e')]?_0x46c6a7[_0x6e4e('0x1e')][_0x6e4e('0x20')]||null:null,'limit':_0x46c6a7[_0x6e4e('0x1e')]?_0x46c6a7['options'][_0x6e4e('0x21')]||null:null})[_0x6e4e('0x12')](function(_0x23028a){logger[_0x6e4e('0x13')](_0x6e4e('0x1b'),_0x46c6a7);logger[_0x6e4e('0x16')](_0x6e4e('0x1b'),_0x46c6a7,JSON['stringify'](_0x23028a));_0x1c5f0c(_0x23028a);})['catch'](function(_0x39b19a){logger['error']('UpdateOpenchannelInteraction',_0x39b19a[_0x6e4e('0x19')],_0x46c6a7);_0x34549e(_0x3bf63c['error'](0x1f4,_0x39b19a[_0x6e4e('0x19')]));});});};exports[_0x6e4e('0x22')]=function(_0x32ef74){return new Promise(function(_0x3cac81,_0x31f794){return db[_0x6e4e('0x23')][_0x6e4e('0x24')]({'where':_0x32ef74[_0x6e4e('0x1e')]?_0x32ef74[_0x6e4e('0x1e')][_0x6e4e('0x1f')]||null:null})[_0x6e4e('0x12')](function(_0x1e5f2b){if(_0x1e5f2b){return _0x1e5f2b['addTags'](_0x32ef74[_0x6e4e('0x1d')]['ids'],_[_0x6e4e('0x25')](_0x32ef74[_0x6e4e('0x1d')],[_0x6e4e('0x26'),'id'])||{});}})[_0x6e4e('0x27')](function(_0x9bf644){logger[_0x6e4e('0x13')](_0x6e4e('0x28'),_0x32ef74);logger['debug'](_0x6e4e('0x28'),_0x32ef74,JSON['stringify'](_0x9bf644));_0x3cac81(_0x9bf644);})[_0x6e4e('0x29')](function(_0x4f8195){logger[_0x6e4e('0x18')](_0x6e4e('0x28'),_0x4f8195['message'],_0x32ef74);_0x31f794(_this['error'](0x1f4,_0x4f8195[_0x6e4e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index fff69a7..1ae7adb 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 _0xf59f=['emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','update'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xf59f,0x1c4));var _0xff59=function(_0x50fa13,_0x5b4ac7){_0x50fa13=_0x50fa13-0x0;var _0x145e14=_0xf59f[_0x50fa13];return _0x145e14;};'use strict';var OpenchannelInteractionEvents=require(_0xff59('0x0'));var events=[_0xff59('0x1'),'remove',_0xff59('0x2')];function createListener(_0x2e34e1,_0x16749e){return function(_0x26948d){_0x16749e[_0xff59('0x3')](_0x2e34e1,_0x26948d);};}function removeListener(_0x438598,_0x149fa8){return function(){OpenchannelInteractionEvents['removeListener'](_0x438598,_0x149fa8);};}exports[_0xff59('0x4')]=function(_0x38fcc5){for(var _0x542e73=0x0,_0x19b3df=events[_0xff59('0x5')];_0x542e73<_0x19b3df;_0x542e73++){var _0xd1a8cf=events[_0x542e73];var _0x548ada=createListener(_0xff59('0x6')+_0xd1a8cf,_0x38fcc5);OpenchannelInteractionEvents['on'](_0xd1a8cf,_0x548ada);}}; \ No newline at end of file +var _0xffd1=['remove','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x54c191,_0x4a04ef){var _0x40ee4a=function(_0x200a79){while(--_0x200a79){_0x54c191['push'](_0x54c191['shift']());}};_0x40ee4a(++_0x4a04ef);}(_0xffd1,0x178));var _0x1ffd=function(_0x5ee6cd,_0x4016e1){_0x5ee6cd=_0x5ee6cd-0x0;var _0x2b6eb6=_0xffd1[_0x5ee6cd];return _0x2b6eb6;};'use strict';var OpenchannelInteractionEvents=require(_0x1ffd('0x0'));var events=[_0x1ffd('0x1'),_0x1ffd('0x2'),_0x1ffd('0x3')];function createListener(_0x4f3a82,_0x1cd506){return function(_0x1d85c4){_0x1cd506[_0x1ffd('0x4')](_0x4f3a82,_0x1d85c4);};}function removeListener(_0x3a6a19,_0x3a7980){return function(){OpenchannelInteractionEvents[_0x1ffd('0x5')](_0x3a6a19,_0x3a7980);};}exports[_0x1ffd('0x6')]=function(_0xc7e8b1){for(var _0x18303f=0x0,_0x1424a2=events[_0x1ffd('0x7')];_0x18303f<_0x1424a2;_0x18303f++){var _0x2fa552=events[_0x18303f];var _0x52592f=createListener(_0x1ffd('0x8')+_0x2fa552,_0xc7e8b1);OpenchannelInteractionEvents['on'](_0x2fa552,_0x52592f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 81c4d46..5296917 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x263aea,_0x5162bc){var _0x3e2cf9=function(_0x51eb1b){while(--_0x51eb1b){_0x263aea['push'](_0x263aea['shift']());}};_0x3e2cf9(++_0x5162bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x4f95f8,_0xb73784){var _0x123b8e=function(_0x89ad8f){while(--_0x89ad8f){_0x4f95f8['push'](_0x4f95f8['shift']());}};_0x123b8e(++_0xb73784);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xcb91[_0x3712e2];return _0x1faff4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index cc4d01f..fa80afb 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 _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x15e3be,_0x174987){var _0xf290b8=function(_0x4de871){while(--_0x4de871){_0x15e3be['push'](_0x15e3be['shift']());}};_0xf290b8(++_0x174987);}(_0x1bd1,0x123));var _0x11bd=function(_0x1307e4,_0xc6ad64){_0x1307e4=_0x1307e4-0x0;var _0x39ff19=_0x1bd1[_0x1307e4];return _0x39ff19;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}}; \ No newline at end of file +var _0x8603=['medium','ENUM','out','STRING','exports','TEXT'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x8603,0x190));var _0x3860=function(_0x6d72f0,_0x523beb){_0x6d72f0=_0x6d72f0-0x0;var _0x282377=_0x8603[_0x6d72f0];return _0x282377;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'body':{'type':Sequelize[_0x3860('0x1')](_0x3860('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3860('0x3')]('in',_0x3860('0x4')),'defaultValue':_0x3860('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3860('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 72e15d4..2b8e940 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 _0x148c=['json','apply','reject','save','update','then','destroy','name','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','isNil','read1stAt','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','QueryTypes','SELECT','contact','User','fullname','internal','agent','manual','channel','motionChannel','event','acceptmessage','../../config/logger','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','email','interface','SIP/%s','EventManager','rejectmessage','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','request','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0xd06eca,_0x509aa8){var _0x31e12f=function(_0x14e070){while(--_0x14e070){_0xd06eca['push'](_0xd06eca['shift']());}};_0x31e12f(++_0x509aa8);}(_0x148c,0xd3));var _0xc148=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x148c[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0xc148('0x0'));var rimraf=require(_0xc148('0x1'));var zipdir=require(_0xc148('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc148('0x3'));var Mustache=require(_0xc148('0x4'));var util=require(_0xc148('0x5'));var path=require(_0xc148('0x6'));var sox=require(_0xc148('0x7'));var csv=require(_0xc148('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc148('0x9'));var _=require(_0xc148('0xa'));var squel=require('squel');var crypto=require(_0xc148('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc148('0xc'));var toCsv=require(_0xc148('0x8'));var querystring=require(_0xc148('0xd'));var Papa=require(_0xc148('0xe'));var Redis=require('ioredis');var authService=require(_0xc148('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc148('0x10'));var hardwareService=require(_0xc148('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc148('0x12'));var config=require(_0xc148('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc148('0x14'))['db'];config[_0xc148('0x15')]=_[_0xc148('0x16')](config[_0xc148('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc148('0x17'))(new Redis(config[_0xc148('0x15')]));require(_0xc148('0x18'))['register'](socket);var jayson=require(_0xc148('0x19'));var client=jayson['client'][_0xc148('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xc148('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x23e794,_0x2dcc5d,_0x3a1525,_0x1b0d7d){return new BPromise(function(_0x51b2da,_0x20fc38){var _0x26f2c8=_0x1b0d7d||client;return _0x26f2c8[_0xc148('0x1b')](_0x23e794,_0x3a1525)['then'](function(_0x179518){logger[_0xc148('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x2dcc5d,'request\x20sent');logger[_0xc148('0x1d')](_0xc148('0x1e'),_0x2dcc5d,_0xc148('0x1f'),JSON[_0xc148('0x20')](_0x179518));if(_0x179518[_0xc148('0x21')]){if(_0x179518[_0xc148('0x21')][_0xc148('0x22')]===0x1f4){logger[_0xc148('0x21')](_0xc148('0x23'),_0x2dcc5d,_0x179518[_0xc148('0x21')][_0xc148('0x24')]);return _0x20fc38(_0x179518['error']['message']);}logger[_0xc148('0x21')](_0xc148('0x23'),_0x2dcc5d,_0x179518[_0xc148('0x21')]['message']);return _0x51b2da(_0x179518[_0xc148('0x21')]['message']);}else{logger[_0xc148('0x1c')](_0xc148('0x23'),_0x2dcc5d,_0xc148('0x1f'));_0x51b2da(_0x179518[_0xc148('0x25')][_0xc148('0x24')]);}})[_0xc148('0x26')](function(_0x1e1d41){logger[_0xc148('0x21')](_0xc148('0x23'),_0x2dcc5d,_0x1e1d41);_0x20fc38(_0x1e1d41);});});}function respondWithStatusCode(_0x33209c,_0x342943){_0x342943=_0x342943||0xcc;return function(_0x34555d){if(_0x34555d){return _0x33209c['sendStatus'](_0x342943);}return _0x33209c[_0xc148('0x27')](_0x342943)[_0xc148('0x28')]();};}function respondWithResult(_0x397477,_0xb620d5){_0xb620d5=_0xb620d5||0xc8;return function(_0x29e641){if(_0x29e641){return _0x397477[_0xc148('0x27')](_0xb620d5)['json'](_0x29e641);}};}function respondWithFilteredResult(_0x39f08e,_0x2edcdc){return function(_0x28c51){if(_0x28c51){var _0x41a565=typeof _0x2edcdc[_0xc148('0x29')]===_0xc148('0x2a')&&typeof _0x2edcdc[_0xc148('0x2b')]==='undefined';var _0x50d4fe=_0x28c51[_0xc148('0x2c')];var _0x310a6d=_0x41a565?0x0:_0x2edcdc[_0xc148('0x29')];var _0x2753d9=_0x41a565?_0x28c51[_0xc148('0x2c')]:_0x2edcdc[_0xc148('0x29')]+_0x2edcdc[_0xc148('0x2b')];var _0x5dcbef;if(_0x2753d9>=_0x50d4fe){_0x2753d9=_0x50d4fe;_0x5dcbef=0xc8;}else{_0x5dcbef=0xce;}_0x39f08e[_0xc148('0x27')](_0x5dcbef);return _0x39f08e[_0xc148('0x2d')](_0xc148('0x2e'),_0x310a6d+'-'+_0x2753d9+'/'+_0x50d4fe)[_0xc148('0x2f')](_0x28c51);}return null;};}function patchUpdates(_0x1db5ca){return function(_0x26424b){try{jsonpatch[_0xc148('0x30')](_0x26424b,_0x1db5ca,!![]);}catch(_0x42d4b0){return BPromise[_0xc148('0x31')](_0x42d4b0);}return _0x26424b[_0xc148('0x32')]();};}function saveUpdates(_0x209542,_0x5f23eb){return function(_0x471e59){if(_0x471e59){return _0x471e59[_0xc148('0x33')](_0x209542)[_0xc148('0x34')](function(_0x5bee43){return _0x5bee43;});}return null;};}function removeEntity(_0x2eb00b,_0x1b98e8){return function(_0x5cd2c0){if(_0x5cd2c0){return _0x5cd2c0[_0xc148('0x35')]()[_0xc148('0x34')](function(){_0x2eb00b[_0xc148('0x27')](0xcc)[_0xc148('0x28')]();});}};}function handleEntityNotFound(_0x1a7266,_0x3289a4){return function(_0x1688d6){if(!_0x1688d6){_0x1a7266['sendStatus'](0x194);}return _0x1688d6;};}function handleError(_0x71cf2d,_0x25aa90){_0x25aa90=_0x25aa90||0x1f4;return function(_0x2bda5a){logger[_0xc148('0x21')](_0x2bda5a['stack']);if(_0x2bda5a['name']){delete _0x2bda5a[_0xc148('0x36')];}_0x71cf2d[_0xc148('0x27')](_0x25aa90)['send'](_0x2bda5a);};}exports['index']=function(_0x2479f7,_0x4c4afe){var _0x4fde80={},_0x44aa73={},_0x411143={'count':0x0,'rows':[]};var _0x32970b=_['map'](db[_0xc148('0x37')][_0xc148('0x38')],function(_0x49e982){return{'name':_0x49e982[_0xc148('0x39')],'type':_0x49e982[_0xc148('0x3a')][_0xc148('0x3b')]};});_0x44aa73[_0xc148('0x3c')]=_['map'](_0x32970b,'name');_0x44aa73[_0xc148('0x3d')]=_[_0xc148('0x3e')](_0x2479f7['query']);_0x44aa73[_0xc148('0x3f')]=_['intersection'](_0x44aa73[_0xc148('0x3c')],_0x44aa73[_0xc148('0x3d')]);_0x4fde80['attributes']=_[_0xc148('0x40')](_0x44aa73[_0xc148('0x3c')],qs[_0xc148('0x41')](_0x2479f7[_0xc148('0x3d')][_0xc148('0x41')]));_0x4fde80[_0xc148('0x42')]=_0x4fde80[_0xc148('0x42')][_0xc148('0x43')]?_0x4fde80[_0xc148('0x42')]:_0x44aa73[_0xc148('0x3c')];if(!_0x2479f7[_0xc148('0x3d')][_0xc148('0x44')](_0xc148('0x45'))){_0x4fde80['limit']=qs[_0xc148('0x2b')](_0x2479f7[_0xc148('0x3d')][_0xc148('0x2b')]);_0x4fde80['offset']=qs[_0xc148('0x29')](_0x2479f7[_0xc148('0x3d')]['offset']);}_0x4fde80['order']=qs[_0xc148('0x46')](_0x2479f7[_0xc148('0x3d')]['sort']);_0x4fde80[_0xc148('0x47')]=qs['filters'](_[_0xc148('0x48')](_0x2479f7[_0xc148('0x3d')],_0x44aa73[_0xc148('0x3f')]),_0x32970b);if(_0x2479f7[_0xc148('0x3d')]['filter']){_0x4fde80[_0xc148('0x47')]=_[_0xc148('0x49')](_0x4fde80[_0xc148('0x47')],{'$or':_[_0xc148('0x4a')](_0x32970b,function(_0x44a81b){if(_0x44a81b[_0xc148('0x3a')]!==_0xc148('0x4b')){var _0x2573fb={};_0x2573fb[_0x44a81b['name']]={'$like':'%'+_0x2479f7[_0xc148('0x3d')]['filter']+'%'};return _0x2573fb;}})});}_0x4fde80=_[_0xc148('0x49')]({},_0x4fde80,_0x2479f7[_0xc148('0x4c')]);var _0x3408e4={'where':_0x4fde80[_0xc148('0x47')]};return db[_0xc148('0x37')]['count'](_0x3408e4)['then'](function(_0x3c0ed6){_0x411143[_0xc148('0x2c')]=_0x3c0ed6;if(_0x2479f7[_0xc148('0x3d')]['includeAll']){_0x4fde80[_0xc148('0x4d')]=[{'all':!![]}];}return db[_0xc148('0x37')][_0xc148('0x4e')](_0x4fde80);})['then'](function(_0x11f6bc){_0x411143[_0xc148('0x4f')]=_0x11f6bc;return _0x411143;})[_0xc148('0x34')](respondWithFilteredResult(_0x4c4afe,_0x4fde80))['catch'](handleError(_0x4c4afe,null));};exports[_0xc148('0x50')]=function(_0x20eb82,_0x144dbd){var _0x3bd637={'raw':!![],'where':{'id':_0x20eb82[_0xc148('0x51')]['id']}},_0x13efeb={};_0x13efeb[_0xc148('0x3c')]=_[_0xc148('0x3e')](db['OpenchannelMessage'][_0xc148('0x38')]);_0x13efeb['query']=_[_0xc148('0x3e')](_0x20eb82['query']);_0x13efeb[_0xc148('0x3f')]=_[_0xc148('0x40')](_0x13efeb['model'],_0x13efeb[_0xc148('0x3d')]);_0x3bd637[_0xc148('0x42')]=_[_0xc148('0x40')](_0x13efeb[_0xc148('0x3c')],qs[_0xc148('0x41')](_0x20eb82['query'][_0xc148('0x41')]));_0x3bd637[_0xc148('0x42')]=_0x3bd637[_0xc148('0x42')][_0xc148('0x43')]?_0x3bd637[_0xc148('0x42')]:_0x13efeb[_0xc148('0x3c')];if(_0x20eb82['query'][_0xc148('0x52')]){_0x3bd637[_0xc148('0x4d')]=[{'all':!![]}];}_0x3bd637=_[_0xc148('0x49')]({},_0x3bd637,_0x20eb82[_0xc148('0x4c')]);return db[_0xc148('0x37')][_0xc148('0x53')](_0x3bd637)['then'](handleEntityNotFound(_0x144dbd,null))[_0xc148('0x34')](respondWithResult(_0x144dbd,null))[_0xc148('0x26')](handleError(_0x144dbd,null));};exports[_0xc148('0x54')]=function(_0x431a77,_0x48b7fc){return db[_0xc148('0x37')][_0xc148('0x54')](_0x431a77[_0xc148('0x55')],{})[_0xc148('0x34')](respondWithResult(_0x48b7fc,0xc9))['catch'](handleError(_0x48b7fc,null));};exports[_0xc148('0x33')]=function(_0x3f9888,_0x1542c8){if(_0x3f9888[_0xc148('0x55')]['id']){delete _0x3f9888[_0xc148('0x55')]['id'];}return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x3f9888['params']['id']}})['then'](handleEntityNotFound(_0x1542c8,null))[_0xc148('0x34')](saveUpdates(_0x3f9888[_0xc148('0x55')],null))[_0xc148('0x34')](respondWithResult(_0x1542c8,null))[_0xc148('0x26')](handleError(_0x1542c8,null));};exports[_0xc148('0x35')]=function(_0x4a85b7,_0xfad2d8){return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x4a85b7['params']['id']}})['then'](handleEntityNotFound(_0xfad2d8,null))[_0xc148('0x34')](removeEntity(_0xfad2d8,null))[_0xc148('0x26')](handleError(_0xfad2d8,null));};exports[_0xc148('0x56')]=function(_0x40263a,_0x1dd1cd){return db[_0xc148('0x37')]['describe']()[_0xc148('0x34')](respondWithResult(_0x1dd1cd,null))[_0xc148('0x26')](handleError(_0x1dd1cd,null));};var interaction_log=require('../../config/logger')(_0xc148('0x57'));exports[_0xc148('0x58')]=function(_0x4c5a74,_0x221386,_0x5455aa){var _0x30d294={'agent':{},'channel':_0xc148('0x59')};if(_0x4c5a74[_0xc148('0x55')]['id']){delete _0x4c5a74[_0xc148('0x55')]['id'];}_0x4c5a74['body'][_0xc148('0x5a')]=!![];_0x4c5a74[_0xc148('0x55')][_0xc148('0x5b')]=moment()[_0xc148('0x5c')](_0xc148('0x5d'));_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')]=_0x4c5a74[_0xc148('0x55')]['UserId']||_0x4c5a74['user']['id'];_0x30d294['agent']['id']=_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')];return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x4c5a74[_0xc148('0x51')]['id'],'UserId':null}})[_0xc148('0x34')](handleEntityNotFound(_0x221386,null))[_0xc148('0x34')](saveUpdates(_0x4c5a74['body'],null))['then'](function(_0x5b2352){if(_0x5b2352){_0x30d294[_0xc148('0x24')]=_0x5b2352[_0xc148('0x5f')]({'plain':!![]});return db[_0xc148('0x60')][_0xc148('0x53')]({'where':{'id':_0x5b2352['OpenchannelInteractionId']}});}return null;})[_0xc148('0x34')](handleEntityNotFound(_0x221386,null))[_0xc148('0x34')](function(_0x434ce3){if(_0x434ce3){return _0x434ce3[_0xc148('0x33')]({'UserId':_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')],'read1stAt':_[_0xc148('0x61')](_0x434ce3[_0xc148('0x62')])?moment()['format'](_0xc148('0x5d')):undefined});}return null;})[_0xc148('0x34')](function(_0x20a747){if(_0x20a747){_0x30d294[_0xc148('0x63')]=_0x20a747['get']({'plain':!![]});interaction_log[_0xc148('0x1c')](_0xc148('0x64'),_0x4c5a74[_0xc148('0x65')]['id'],_0x4c5a74['user'][_0xc148('0x36')],_0x4c5a74[_0xc148('0x65')][_0xc148('0x66')],_0x30d294['interaction']['id'],_0x4c5a74[_0xc148('0x55')]?JSON[_0xc148('0x20')](_0x4c5a74['body']):_0xc148('0x67'));return respondWithRpcPromise('AcceptMessage',_0xc148('0x68'),_0x30d294);}return null;})['then'](function(_0x14627d){var _0x5ba9f9=_0xc148('0x69')+_0x14627d[_0xc148('0x24')][_0xc148('0x6a')];return db['sequelize'][_0xc148('0x3d')](_0x5ba9f9,{'type':db[_0xc148('0x6b')][_0xc148('0x6c')][_0xc148('0x6d')],'raw':!![]})[_0xc148('0x34')](function(_0x330e61){return _0x330e61;});})[_0xc148('0x34')](function(_0x185cf0){if(_0x185cf0){_0x30d294['message'][_0xc148('0x6e')]=_0x185cf0[0x0];if(!_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')])return;return db[_0xc148('0x6f')]['find']({'where':{'id':_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')],'role':'agent'},'attributes':['id',_0xc148('0x36'),_0xc148('0x70'),'email',_0xc148('0x71')],'raw':!![]});}return null;})[_0xc148('0x34')](function(_0x5f5d45){if(!_0x5f5d45)return null;_0x30d294[_0xc148('0x24')][_0xc148('0x72')]=_0x5f5d45;return _0x30d294;})['then'](function(_0x3165ae){if(_0x3165ae){if(_0x4c5a74['body'][_0xc148('0x73')]){_0x30d294[_0xc148('0x24')]['interface']=util[_0xc148('0x5c')]('SIP/%s',_0x4c5a74['user']['name']);_0x30d294[_0xc148('0x24')][_0xc148('0x74')]=_0x30d294[_0xc148('0x74')];_0x30d294['message'][_0xc148('0x75')]=_0x30d294[_0xc148('0x74')];_0x30d294[_0xc148('0x24')][_0xc148('0x76')]=_0xc148('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc148('0x77'),'message':_0x30d294[_0xc148('0x24')]},client9002)[_0xc148('0x34')](function(){return _0x30d294;});}return _0x30d294;}return null;})[_0xc148('0x34')](respondWithResult(_0x221386,null))[_0xc148('0x26')](handleError(_0x221386,null));};var interaction_log=require(_0xc148('0x78'))(_0xc148('0x57'));exports[_0xc148('0x31')]=function(_0x4b49a9,_0x459fcb,_0x1bd4e9){var _0x2c9187={'agent':{},'channel':_0xc148('0x59')};if(_0x4b49a9['body']['id']){delete _0x4b49a9[_0xc148('0x55')]['id'];}_0x4b49a9['body'][_0xc148('0x5e')]=_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')]||_0x4b49a9[_0xc148('0x65')]['id'];_0x2c9187['agent']['id']=_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')];return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x4b49a9[_0xc148('0x51')]['id'],'UserId':null}})[_0xc148('0x34')](handleEntityNotFound(_0x459fcb,null))[_0xc148('0x34')](function(_0x2527c0){if(_0x2527c0){_0x2c9187[_0xc148('0x24')]=_0x2527c0['get']({'plain':!![]});return db[_0xc148('0x60')][_0xc148('0x53')]({'where':{'id':_0x2527c0[_0xc148('0x79')]}});}return null;})[_0xc148('0x34')](handleEntityNotFound(_0x459fcb,null))['then'](function(_0x54d450){if(_0x54d450){_0x2c9187['interaction']=_0x54d450['get']({'plain':!![]});interaction_log[_0xc148('0x1c')](_0xc148('0x7a'),_0x4b49a9[_0xc148('0x65')]['id'],_0x4b49a9[_0xc148('0x65')]['name'],_0x4b49a9[_0xc148('0x65')][_0xc148('0x66')],_0x2c9187[_0xc148('0x63')]['id'],_0x4b49a9['body']?JSON[_0xc148('0x20')](_0x4b49a9[_0xc148('0x55')]):_0xc148('0x67'));return respondWithRpcPromise('RejectMessage',_0xc148('0x7b'),_0x2c9187);}return null;})[_0xc148('0x34')](function(_0x2f69af){var _0x2553fa=_0xc148('0x69')+_0x2f69af[_0xc148('0x24')][_0xc148('0x6a')];return db['sequelize'][_0xc148('0x3d')](_0x2553fa,{'type':db[_0xc148('0x6b')][_0xc148('0x6c')][_0xc148('0x6d')],'raw':!![]})[_0xc148('0x34')](function(_0x5d852b){return _0x5d852b;});})[_0xc148('0x34')](function(_0x315b7b){if(_0x315b7b){_0x2c9187['message']['contact']=_0x315b7b[0x0];if(!_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')])return;return db['User'][_0xc148('0x53')]({'where':{'id':_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')],'role':'agent'},'attributes':['id','name',_0xc148('0x70'),_0xc148('0x7c'),_0xc148('0x71')],'raw':!![]});}return null;})[_0xc148('0x34')](function(_0x455eaa){if(!_0x455eaa)return null;_0x2c9187[_0xc148('0x24')][_0xc148('0x72')]=_0x455eaa;return _0x2c9187;})[_0xc148('0x34')](function(_0x2d52e2){if(_0x2d52e2){_0x2d52e2['message'][_0xc148('0x7d')]=util[_0xc148('0x5c')](_0xc148('0x7e'),_0x4b49a9[_0xc148('0x65')][_0xc148('0x36')]);_0x2d52e2['message'][_0xc148('0x74')]=_0x2c9187['channel'];_0x2d52e2[_0xc148('0x24')][_0xc148('0x75')]=_0x2c9187[_0xc148('0x74')];_0x2d52e2[_0xc148('0x24')][_0xc148('0x76')]=_0xc148('0x31');respondWithRpcPromise(_0xc148('0x7f'),_0xc148('0x7f'),{'event':_0xc148('0x80'),'message':_0x2d52e2['message']},client9002);return _0x2c9187;}return null;})[_0xc148('0x34')](respondWithResult(_0x459fcb,null))['catch'](handleError(_0x459fcb,null));}; \ No newline at end of file +var _0x74c7=['ContactId','QueryTypes','email','event','rejectmessage','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','stack','name','index','map','OpenchannelMessage','fieldName','key','model','query','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','merge','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage'];(function(_0x395a03,_0x362943){var _0x8de6f=function(_0x56ae29){while(--_0x56ae29){_0x395a03['push'](_0x395a03['shift']());}};_0x8de6f(++_0x362943);}(_0x74c7,0x194));var _0x774c=function(_0x52ff52,_0x2121a6){_0x52ff52=_0x52ff52-0x0;var _0x1c3ba3=_0x74c7[_0x52ff52];return _0x1c3ba3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x774c('0x0'));var zipdir=require(_0x774c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x774c('0x2'));var moment=require(_0x774c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x774c('0x4'));var util=require(_0x774c('0x5'));var path=require(_0x774c('0x6'));var sox=require('sox');var csv=require(_0x774c('0x7'));var ejs=require(_0x774c('0x8'));var fs=require('fs');var fs_extra=require(_0x774c('0x9'));var _=require('lodash');var squel=require(_0x774c('0xa'));var crypto=require(_0x774c('0xb'));var jsforce=require(_0x774c('0xc'));var deskjs=require(_0x774c('0xd'));var toCsv=require(_0x774c('0x7'));var querystring=require(_0x774c('0xe'));var Papa=require(_0x774c('0xf'));var Redis=require(_0x774c('0x10'));var authService=require(_0x774c('0x11'));var qs=require(_0x774c('0x12'));var as=require(_0x774c('0x13'));var hardwareService=require(_0x774c('0x14'));var logger=require(_0x774c('0x15'))(_0x774c('0x16'));var utils=require(_0x774c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x774c('0x18'));var db=require('../../mysqldb')['db'];config[_0x774c('0x19')]=_[_0x774c('0x1a')](config[_0x774c('0x19')],{'host':_0x774c('0x1b'),'port':0x18eb});var socket=require(_0x774c('0x1c'))(new Redis(config[_0x774c('0x19')]));require(_0x774c('0x1d'))['register'](socket);var jayson=require(_0x774c('0x1e'));var client=jayson['client'][_0x774c('0x1f')]({'port':0x232c});var client9002=jayson[_0x774c('0x20')][_0x774c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4aa48d,_0x3ae704,_0x9c4659,_0x13b287){return new BPromise(function(_0x164e46,_0x251c44){var _0x45b42b=_0x13b287||client;return _0x45b42b[_0x774c('0x21')](_0x4aa48d,_0x9c4659)[_0x774c('0x22')](function(_0x41bbbe){logger[_0x774c('0x23')](_0x774c('0x24'),_0x3ae704,_0x774c('0x25'));logger[_0x774c('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3ae704,_0x774c('0x25'),JSON[_0x774c('0x27')](_0x41bbbe));if(_0x41bbbe['error']){if(_0x41bbbe[_0x774c('0x28')][_0x774c('0x29')]===0x1f4){logger['error'](_0x774c('0x24'),_0x3ae704,_0x41bbbe[_0x774c('0x28')][_0x774c('0x2a')]);return _0x251c44(_0x41bbbe[_0x774c('0x28')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3ae704,_0x41bbbe['error'][_0x774c('0x2a')]);return _0x164e46(_0x41bbbe['error'][_0x774c('0x2a')]);}else{logger[_0x774c('0x23')](_0x774c('0x24'),_0x3ae704,_0x774c('0x25'));_0x164e46(_0x41bbbe[_0x774c('0x2b')][_0x774c('0x2a')]);}})[_0x774c('0x2c')](function(_0x21ef49){logger['error'](_0x774c('0x24'),_0x3ae704,_0x21ef49);_0x251c44(_0x21ef49);});});}function respondWithStatusCode(_0x592ef3,_0x2b470c){_0x2b470c=_0x2b470c||0xcc;return function(_0x2d853a){if(_0x2d853a){return _0x592ef3[_0x774c('0x2d')](_0x2b470c);}return _0x592ef3[_0x774c('0x2e')](_0x2b470c)[_0x774c('0x2f')]();};}function respondWithResult(_0x521ef5,_0x53b0de){_0x53b0de=_0x53b0de||0xc8;return function(_0x58eed8){if(_0x58eed8){return _0x521ef5[_0x774c('0x2e')](_0x53b0de)['json'](_0x58eed8);}};}function respondWithFilteredResult(_0x5cd8a9,_0xa17989){return function(_0x290fc8){if(_0x290fc8){var _0x4b4e5a=typeof _0xa17989[_0x774c('0x30')]===_0x774c('0x31')&&typeof _0xa17989['limit']===_0x774c('0x31');var _0x1331c4=_0x290fc8[_0x774c('0x32')];var _0x3ce800=_0x4b4e5a?0x0:_0xa17989[_0x774c('0x30')];var _0x5838da=_0x4b4e5a?_0x290fc8[_0x774c('0x32')]:_0xa17989[_0x774c('0x30')]+_0xa17989[_0x774c('0x33')];var _0x5ea01c;if(_0x5838da>=_0x1331c4){_0x5838da=_0x1331c4;_0x5ea01c=0xc8;}else{_0x5ea01c=0xce;}_0x5cd8a9[_0x774c('0x2e')](_0x5ea01c);return _0x5cd8a9[_0x774c('0x34')](_0x774c('0x35'),_0x3ce800+'-'+_0x5838da+'/'+_0x1331c4)['json'](_0x290fc8);}return null;};}function patchUpdates(_0x4045c1){return function(_0xf9e4a6){try{jsonpatch['apply'](_0xf9e4a6,_0x4045c1,!![]);}catch(_0x56d6ee){return BPromise[_0x774c('0x36')](_0x56d6ee);}return _0xf9e4a6['save']();};}function saveUpdates(_0x315319,_0x25fd41){return function(_0x21eda6){if(_0x21eda6){return _0x21eda6[_0x774c('0x37')](_0x315319)['then'](function(_0x314347){return _0x314347;});}return null;};}function removeEntity(_0x56c305,_0x3bd587){return function(_0x574ce7){if(_0x574ce7){return _0x574ce7[_0x774c('0x38')]()['then'](function(){_0x56c305[_0x774c('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a85b1,_0xdd90e6){return function(_0x41ccdd){if(!_0x41ccdd){_0x1a85b1['sendStatus'](0x194);}return _0x41ccdd;};}function handleError(_0x4433f4,_0x355c5c){_0x355c5c=_0x355c5c||0x1f4;return function(_0x34bc91){logger[_0x774c('0x28')](_0x34bc91[_0x774c('0x39')]);if(_0x34bc91[_0x774c('0x3a')]){delete _0x34bc91['name'];}_0x4433f4[_0x774c('0x2e')](_0x355c5c)['send'](_0x34bc91);};}exports[_0x774c('0x3b')]=function(_0x29a8c9,_0x32b583){var _0x3c47be={},_0x12e11b={},_0x55f17b={'count':0x0,'rows':[]};var _0x15cd3d=_[_0x774c('0x3c')](db[_0x774c('0x3d')]['rawAttributes'],function(_0x31750b){return{'name':_0x31750b[_0x774c('0x3e')],'type':_0x31750b['type'][_0x774c('0x3f')]};});_0x12e11b[_0x774c('0x40')]=_[_0x774c('0x3c')](_0x15cd3d,_0x774c('0x3a'));_0x12e11b[_0x774c('0x41')]=_['keys'](_0x29a8c9['query']);_0x12e11b[_0x774c('0x42')]=_['intersection'](_0x12e11b[_0x774c('0x40')],_0x12e11b[_0x774c('0x41')]);_0x3c47be['attributes']=_[_0x774c('0x43')](_0x12e11b[_0x774c('0x40')],qs['fields'](_0x29a8c9[_0x774c('0x41')]['fields']));_0x3c47be[_0x774c('0x44')]=_0x3c47be[_0x774c('0x44')]['length']?_0x3c47be['attributes']:_0x12e11b[_0x774c('0x40')];if(!_0x29a8c9[_0x774c('0x41')][_0x774c('0x45')]('nolimit')){_0x3c47be[_0x774c('0x33')]=qs[_0x774c('0x33')](_0x29a8c9[_0x774c('0x41')]['limit']);_0x3c47be[_0x774c('0x30')]=qs['offset'](_0x29a8c9[_0x774c('0x41')][_0x774c('0x30')]);}_0x3c47be['order']=qs[_0x774c('0x46')](_0x29a8c9[_0x774c('0x41')][_0x774c('0x46')]);_0x3c47be[_0x774c('0x47')]=qs[_0x774c('0x42')](_[_0x774c('0x48')](_0x29a8c9[_0x774c('0x41')],_0x12e11b[_0x774c('0x42')]),_0x15cd3d);if(_0x29a8c9['query'][_0x774c('0x49')]){_0x3c47be['where']=_['merge'](_0x3c47be[_0x774c('0x47')],{'$or':_[_0x774c('0x3c')](_0x15cd3d,function(_0x49880f){if(_0x49880f[_0x774c('0x4a')]!==_0x774c('0x4b')){var _0x3c7363={};_0x3c7363[_0x49880f[_0x774c('0x3a')]]={'$like':'%'+_0x29a8c9[_0x774c('0x41')][_0x774c('0x49')]+'%'};return _0x3c7363;}})});}_0x3c47be=_['merge']({},_0x3c47be,_0x29a8c9[_0x774c('0x4c')]);var _0x3df317={'where':_0x3c47be[_0x774c('0x47')]};return db[_0x774c('0x3d')]['count'](_0x3df317)[_0x774c('0x22')](function(_0x305492){_0x55f17b[_0x774c('0x32')]=_0x305492;if(_0x29a8c9[_0x774c('0x41')][_0x774c('0x4d')]){_0x3c47be[_0x774c('0x4e')]=[{'all':!![]}];}return db[_0x774c('0x3d')][_0x774c('0x4f')](_0x3c47be);})[_0x774c('0x22')](function(_0x51a7e4){_0x55f17b[_0x774c('0x50')]=_0x51a7e4;return _0x55f17b;})[_0x774c('0x22')](respondWithFilteredResult(_0x32b583,_0x3c47be))['catch'](handleError(_0x32b583,null));};exports[_0x774c('0x51')]=function(_0x22f957,_0x3122e7){var _0x1bac06={'raw':!![],'where':{'id':_0x22f957[_0x774c('0x52')]['id']}},_0x4bb440={};_0x4bb440[_0x774c('0x40')]=_[_0x774c('0x53')](db['OpenchannelMessage'][_0x774c('0x54')]);_0x4bb440['query']=_[_0x774c('0x53')](_0x22f957[_0x774c('0x41')]);_0x4bb440[_0x774c('0x42')]=_[_0x774c('0x43')](_0x4bb440[_0x774c('0x40')],_0x4bb440[_0x774c('0x41')]);_0x1bac06[_0x774c('0x44')]=_[_0x774c('0x43')](_0x4bb440['model'],qs['fields'](_0x22f957[_0x774c('0x41')][_0x774c('0x55')]));_0x1bac06[_0x774c('0x44')]=_0x1bac06[_0x774c('0x44')]['length']?_0x1bac06['attributes']:_0x4bb440[_0x774c('0x40')];if(_0x22f957[_0x774c('0x41')][_0x774c('0x4d')]){_0x1bac06['include']=[{'all':!![]}];}_0x1bac06=_[_0x774c('0x56')]({},_0x1bac06,_0x22f957[_0x774c('0x4c')]);return db[_0x774c('0x3d')][_0x774c('0x57')](_0x1bac06)[_0x774c('0x22')](handleEntityNotFound(_0x3122e7,null))[_0x774c('0x22')](respondWithResult(_0x3122e7,null))[_0x774c('0x2c')](handleError(_0x3122e7,null));};exports['create']=function(_0x5e6bb7,_0x489e1d){return db[_0x774c('0x3d')][_0x774c('0x58')](_0x5e6bb7[_0x774c('0x59')],{})['then'](respondWithResult(_0x489e1d,0xc9))[_0x774c('0x2c')](handleError(_0x489e1d,null));};exports['update']=function(_0x56cc06,_0x15f956){if(_0x56cc06[_0x774c('0x59')]['id']){delete _0x56cc06[_0x774c('0x59')]['id'];}return db[_0x774c('0x3d')]['find']({'where':{'id':_0x56cc06[_0x774c('0x52')]['id']}})[_0x774c('0x22')](handleEntityNotFound(_0x15f956,null))[_0x774c('0x22')](saveUpdates(_0x56cc06[_0x774c('0x59')],null))[_0x774c('0x22')](respondWithResult(_0x15f956,null))[_0x774c('0x2c')](handleError(_0x15f956,null));};exports[_0x774c('0x38')]=function(_0x24a7ae,_0x2ca1a0){return db['OpenchannelMessage']['find']({'where':{'id':_0x24a7ae[_0x774c('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ca1a0,null))['then'](removeEntity(_0x2ca1a0,null))['catch'](handleError(_0x2ca1a0,null));};exports['describe']=function(_0x28a2fe,_0x35eec9){return db[_0x774c('0x3d')][_0x774c('0x5a')]()[_0x774c('0x22')](respondWithResult(_0x35eec9,null))[_0x774c('0x2c')](handleError(_0x35eec9,null));};var interaction_log=require(_0x774c('0x15'))(_0x774c('0x5b'));exports[_0x774c('0x5c')]=function(_0x5b2fc1,_0x2fc44e,_0x25a28a){var _0x16f19e={'agent':{},'channel':_0x774c('0x5d')};if(_0x5b2fc1[_0x774c('0x59')]['id']){delete _0x5b2fc1[_0x774c('0x59')]['id'];}_0x5b2fc1['body'][_0x774c('0x5e')]=!![];_0x5b2fc1['body'][_0x774c('0x5f')]=moment()[_0x774c('0x60')](_0x774c('0x61'));_0x5b2fc1[_0x774c('0x59')][_0x774c('0x62')]=_0x5b2fc1[_0x774c('0x59')]['UserId']||_0x5b2fc1[_0x774c('0x63')]['id'];_0x16f19e[_0x774c('0x64')]['id']=_0x5b2fc1[_0x774c('0x59')][_0x774c('0x62')];return db[_0x774c('0x3d')][_0x774c('0x57')]({'where':{'id':_0x5b2fc1['params']['id'],'UserId':null}})[_0x774c('0x22')](handleEntityNotFound(_0x2fc44e,null))['then'](saveUpdates(_0x5b2fc1[_0x774c('0x59')],null))[_0x774c('0x22')](function(_0xa1e605){if(_0xa1e605){_0x16f19e[_0x774c('0x2a')]=_0xa1e605[_0x774c('0x65')]({'plain':!![]});return db[_0x774c('0x66')][_0x774c('0x57')]({'where':{'id':_0xa1e605[_0x774c('0x67')]}});}return null;})[_0x774c('0x22')](handleEntityNotFound(_0x2fc44e,null))[_0x774c('0x22')](function(_0x4e806c){if(_0x4e806c){return _0x4e806c[_0x774c('0x37')]({'UserId':_0x5b2fc1[_0x774c('0x59')][_0x774c('0x62')],'read1stAt':_[_0x774c('0x68')](_0x4e806c[_0x774c('0x69')])?moment()['format'](_0x774c('0x61')):undefined});}return null;})[_0x774c('0x22')](function(_0x5696a0){if(_0x5696a0){_0x16f19e[_0x774c('0x6a')]=_0x5696a0[_0x774c('0x65')]({'plain':!![]});interaction_log[_0x774c('0x23')](_0x774c('0x6b'),_0x5b2fc1[_0x774c('0x63')]['id'],_0x5b2fc1[_0x774c('0x63')][_0x774c('0x3a')],_0x5b2fc1['user'][_0x774c('0x6c')],_0x16f19e[_0x774c('0x6a')]['id'],_0x5b2fc1['body']?JSON[_0x774c('0x27')](_0x5b2fc1[_0x774c('0x59')]):_0x774c('0x6d'));return respondWithRpcPromise(_0x774c('0x6e'),_0x774c('0x6f'),_0x16f19e);}return null;})[_0x774c('0x22')](function(_0xf7f5cb){var _0x1d2132='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xf7f5cb[_0x774c('0x2a')]['ContactId'];return db[_0x774c('0x70')]['query'](_0x1d2132,{'type':db[_0x774c('0x71')]['QueryTypes'][_0x774c('0x72')],'raw':!![]})[_0x774c('0x22')](function(_0x5645c2){return _0x5645c2;});})[_0x774c('0x22')](function(_0x5b379a){if(_0x5b379a){_0x16f19e[_0x774c('0x2a')][_0x774c('0x73')]=_0x5b379a[0x0];if(!_0x5b2fc1[_0x774c('0x59')][_0x774c('0x62')])return;return db[_0x774c('0x74')][_0x774c('0x57')]({'where':{'id':_0x5b2fc1[_0x774c('0x59')]['UserId'],'role':_0x774c('0x64')},'attributes':['id','name',_0x774c('0x75'),'email',_0x774c('0x76')],'raw':!![]});}return null;})[_0x774c('0x22')](function(_0x341e92){if(!_0x341e92)return null;_0x16f19e[_0x774c('0x2a')][_0x774c('0x64')]=_0x341e92;return _0x16f19e;})['then'](function(_0x3f2408){if(_0x3f2408){if(_0x5b2fc1[_0x774c('0x59')][_0x774c('0x77')]){_0x16f19e[_0x774c('0x2a')][_0x774c('0x78')]=util[_0x774c('0x60')](_0x774c('0x79'),_0x5b2fc1[_0x774c('0x63')][_0x774c('0x3a')]);_0x16f19e['message'][_0x774c('0x7a')]=_0x16f19e['channel'];_0x16f19e[_0x774c('0x2a')][_0x774c('0x7b')]=_0x16f19e['channel'];_0x16f19e[_0x774c('0x2a')]['event']='accept';return respondWithRpcPromise(_0x774c('0x7c'),_0x774c('0x7c'),{'event':_0x774c('0x7d'),'message':_0x16f19e[_0x774c('0x2a')]},client9002)[_0x774c('0x22')](function(){return _0x16f19e;});}return _0x16f19e;}return null;})[_0x774c('0x22')](respondWithResult(_0x2fc44e,null))['catch'](handleError(_0x2fc44e,null));};var interaction_log=require(_0x774c('0x15'))(_0x774c('0x5b'));exports[_0x774c('0x36')]=function(_0x57d5d3,_0x15bf47,_0xe8c5ac){var _0x369703={'agent':{},'channel':_0x774c('0x5d')};if(_0x57d5d3['body']['id']){delete _0x57d5d3['body']['id'];}_0x57d5d3[_0x774c('0x59')][_0x774c('0x62')]=_0x57d5d3['body'][_0x774c('0x62')]||_0x57d5d3[_0x774c('0x63')]['id'];_0x369703[_0x774c('0x64')]['id']=_0x57d5d3['body'][_0x774c('0x62')];return db[_0x774c('0x3d')][_0x774c('0x57')]({'where':{'id':_0x57d5d3[_0x774c('0x52')]['id'],'UserId':null}})[_0x774c('0x22')](handleEntityNotFound(_0x15bf47,null))['then'](function(_0x2af9f9){if(_0x2af9f9){_0x369703[_0x774c('0x2a')]=_0x2af9f9[_0x774c('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x774c('0x57')]({'where':{'id':_0x2af9f9['OpenchannelInteractionId']}});}return null;})[_0x774c('0x22')](handleEntityNotFound(_0x15bf47,null))['then'](function(_0x1a329f){if(_0x1a329f){_0x369703[_0x774c('0x6a')]=_0x1a329f[_0x774c('0x65')]({'plain':!![]});interaction_log['info'](_0x774c('0x7e'),_0x57d5d3['user']['id'],_0x57d5d3[_0x774c('0x63')]['name'],_0x57d5d3[_0x774c('0x63')][_0x774c('0x6c')],_0x369703[_0x774c('0x6a')]['id'],_0x57d5d3[_0x774c('0x59')]?JSON[_0x774c('0x27')](_0x57d5d3[_0x774c('0x59')]):_0x774c('0x6d'));return respondWithRpcPromise(_0x774c('0x7f'),'rejectMessage',_0x369703);}return null;})[_0x774c('0x22')](function(_0x12ab81){var _0x1a66a8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12ab81[_0x774c('0x2a')][_0x774c('0x80')];return db[_0x774c('0x70')][_0x774c('0x41')](_0x1a66a8,{'type':db[_0x774c('0x71')][_0x774c('0x81')][_0x774c('0x72')],'raw':!![]})[_0x774c('0x22')](function(_0x323c26){return _0x323c26;});})['then'](function(_0x4aa8c2){if(_0x4aa8c2){_0x369703[_0x774c('0x2a')][_0x774c('0x73')]=_0x4aa8c2[0x0];if(!_0x57d5d3['body'][_0x774c('0x62')])return;return db[_0x774c('0x74')]['find']({'where':{'id':_0x57d5d3[_0x774c('0x59')][_0x774c('0x62')],'role':_0x774c('0x64')},'attributes':['id','name',_0x774c('0x75'),_0x774c('0x82'),_0x774c('0x76')],'raw':!![]});}return null;})[_0x774c('0x22')](function(_0x4e9e22){if(!_0x4e9e22)return null;_0x369703['message'][_0x774c('0x64')]=_0x4e9e22;return _0x369703;})[_0x774c('0x22')](function(_0xe697aa){if(_0xe697aa){_0xe697aa[_0x774c('0x2a')][_0x774c('0x78')]=util[_0x774c('0x60')](_0x774c('0x79'),_0x57d5d3[_0x774c('0x63')][_0x774c('0x3a')]);_0xe697aa[_0x774c('0x2a')][_0x774c('0x7a')]=_0x369703[_0x774c('0x7a')];_0xe697aa['message'][_0x774c('0x7b')]=_0x369703[_0x774c('0x7a')];_0xe697aa['message'][_0x774c('0x83')]=_0x774c('0x36');respondWithRpcPromise('EventManager',_0x774c('0x7c'),{'event':_0x774c('0x84'),'message':_0xe697aa[_0x774c('0x2a')]},client9002);return _0x369703;}return null;})[_0x774c('0x22')](respondWithResult(_0x15bf47,null))[_0x774c('0x2c')](handleError(_0x15bf47,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index b9a3b0c..9464f10 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 _0x27cc=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x53317c,_0xe047d5){var _0x39d300=function(_0x81b27e){while(--_0x81b27e){_0x53317c['push'](_0x53317c['shift']());}};_0x39d300(++_0xe047d5);}(_0x27cc,0x77));var _0xc27c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x27cc[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0xc27c('0x0'));var OpenchannelMessage=require(_0xc27c('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc27c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc27c('0x3'),'afterDestroy':_0xc27c('0x4')};function emitEvent(_0x373637){return function(_0x323f4f,_0x37674a,_0x40b7f7){OpenchannelMessageEvents[_0xc27c('0x5')](_0x373637+':'+_0x323f4f['id'],_0x323f4f);OpenchannelMessageEvents['emit'](_0x373637,_0x323f4f);_0x40b7f7(null);};}for(var e in events){if(events[_0xc27c('0x6')](e)){var event=events[e];OpenchannelMessage[_0xc27c('0x7')](e,emitEvent(event));}}module[_0xc27c('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x94d4=['exports','../../mysqldb','OpenchannelMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3798a4,_0x3073c0){var _0x37450e=function(_0x26a555){while(--_0x26a555){_0x3798a4['push'](_0x3798a4['shift']());}};_0x37450e(++_0x3073c0);}(_0x94d4,0xac));var _0x494d=function(_0x27c134,_0x1af492){_0x27c134=_0x27c134-0x0;var _0x4a79cd=_0x94d4[_0x27c134];return _0x4a79cd;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x494d('0x0'))['db'][_0x494d('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x494d('0x2'),'afterUpdate':_0x494d('0x3'),'afterDestroy':_0x494d('0x4')};function emitEvent(_0x5b2f3c){return function(_0x2e4a98,_0x51d714,_0x59859f){OpenchannelMessageEvents[_0x494d('0x5')](_0x5b2f3c+':'+_0x2e4a98['id'],_0x2e4a98);OpenchannelMessageEvents[_0x494d('0x5')](_0x5b2f3c,_0x2e4a98);_0x59859f(null);};}for(var e in events){if(events[_0x494d('0x6')](e)){var event=events[e];OpenchannelMessage[_0x494d('0x7')](e,emitEvent(event));}}module[_0x494d('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 45248f1..43164d4 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 _0x10c8=['POST','method','GET','info','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','out','secret','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interaction'];(function(_0x1bce18,_0x2975c7){var _0x2889a=function(_0x253e65){while(--_0x253e65){_0x1bce18['push'](_0x1bce18['shift']());}};_0x2889a(++_0x2975c7);}(_0x10c8,0xee));var _0x810c=function(_0x24dc71,_0x17b0cd){_0x24dc71=_0x24dc71-0x0;var _0x4ad0bf=_0x10c8[_0x24dc71];return _0x4ad0bf;};'use strict';var _=require(_0x810c('0x0'));var util=require(_0x810c('0x1'));var logger=require(_0x810c('0x2'))(_0x810c('0x3'));var moment=require('moment');var BPromise=require(_0x810c('0x4'));var rp=require(_0x810c('0x5'));var fs=require('fs');var path=require(_0x810c('0x6'));var rimraf=require(_0x810c('0x7'));var config=require('../../config/environment');var attributes=require(_0x810c('0x8'));module[_0x810c('0x9')]=function(_0x3fd5e6,_0x59cd06){return _0x3fd5e6[_0x810c('0xa')](_0x810c('0xb'),attributes,{'tableName':_0x810c('0xc'),'paranoid':![],'indexes':[{'name':_0x810c('0xd'),'fields':[_0x810c('0xe')],'type':_0x810c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17d8bd,_0xeb9564,_0x2bb2c3){var _0x1eee85=_0x3fd5e6[_0x810c('0x10')];var _0x5bbed0=_0x17d8bd[_0x810c('0x11')]({'plain':!![]});if(_0x5bbed0['direction'][_0x810c('0x12')]()==='in'||_0x5bbed0[_0x810c('0x13')][_0x810c('0x12')]()==='out'&&!_0x5bbed0['secret']&&!_[_0x810c('0x14')](_0x5bbed0[_0x810c('0x15')])){_0x1eee85[_0x810c('0x16')][_0x810c('0x17')]({'where':{'id':_0x5bbed0[_0x810c('0x18')]}})['then'](function(_0x4826f6){if(_0x4826f6){_0x4826f6['update']({'lastMsgAt':_0x5bbed0[_0x810c('0x19')],'lastMsgDirection':_0x5bbed0[_0x810c('0x13')][_0x810c('0x12')]()});}})[_0x810c('0x1a')](function(_0x469973){console['error'](_0x469973);});}if(_0x5bbed0[_0x810c('0x13')]===_0x810c('0x1b')&&!_0x5bbed0[_0x810c('0x1c')]){var _0x427719;_0x1eee85['CmContact'][_0x810c('0x1d')]()[_0x810c('0x1e')](function(_0x248031){return _0x1eee85[_0x810c('0x1f')][_0x810c('0x20')]({'where':{'id':_0x5bbed0[_0x810c('0x21')]},'include':[{'model':_0x1eee85[_0x810c('0x16')],'as':_0x810c('0x22'),'where':{'id':_0x5bbed0['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x1eee85[_0x810c('0x23')],'as':_0x810c('0x24'),'attributes':_[_0x810c('0x25')](_0x248031)}]}]});})[_0x810c('0x1e')](function(_0x37e363){_0x427719=_0x37e363[_0x810c('0x11')]({'plain':!![]});if(_0x427719&&_0x427719[_0x810c('0x26')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x810c('0x27'),util['format'](_0x810c('0x28'),_0x5bbed0['id'],_0x427719[_0x810c('0x26')]));if(_0x427719[_0x810c('0x22')]&&_0x427719[_0x810c('0x22')]['length']){_0x5bbed0[_0x810c('0x29')]=_['omit'](_0x427719[_0x810c('0x22')][0x0],_0x810c('0x24'));_0x5bbed0[_0x810c('0x24')]=_0x427719[_0x810c('0x22')][0x0][_0x810c('0x24')];}var _0xeb9564={'method':_0x810c('0x2a'),'uri':encodeURI(_0x427719['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xeb9564[_0x810c('0x2b')]){case _0x810c('0x2c'):_0xeb9564['qs']=_0x5bbed0;break;case _0x810c('0x2a'):_0xeb9564[_0x810c('0xe')]=_0x5bbed0;break;}return rp(_0xeb9564)[_0x810c('0x1e')](function(_0x15b7dd){logger[_0x810c('0x2d')](_0x810c('0x2e'),_0x810c('0x27'),util[_0x810c('0x2f')](_0x810c('0x30'),_0x5bbed0['id'],_0x427719[_0x810c('0x26')]));if(_0x15b7dd['body']['threadId']&&_0x15b7dd['body'][_0x810c('0x31')]!=_0x5bbed0[_0x810c('0x29')][_0x810c('0x31')]){return _0x1eee85[_0x810c('0x16')][_0x810c('0x32')]({'threadId':_0x15b7dd['body'][_0x810c('0x31')]},{'where':{'id':_0x5bbed0[_0x810c('0x29')]['id']}});}else{return;}})[_0x810c('0x1e')](function(){return _0x17d8bd['update']({'read':!![]});})[_0x810c('0x1a')](function(_0x198943){logger[_0x810c('0x33')](_0x810c('0x2e'),'afterCreate',util[_0x810c('0x34')](_0x198943,{'showHidden':![],'depth':null}));_0x2bb2c3();});}else{_0x2bb2c3();}})[_0x810c('0x35')](function(){_0x2bb2c3();});}else{_0x2bb2c3();}}},'charset':_0x810c('0x36'),'collate':_0x810c('0x37')});}; \ No newline at end of file +var _0x6a68=['Contact','keys','then','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','Interaction','omit','POST','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','direction','toLowerCase','secret','OpenchannelInteraction','findOne','catch','error','CmContact','describe','OpenchannelAccountId','Interactions'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x6a68,0xc3));var _0x86a6=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x6a68[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x86a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x86a6('0x1'));var moment=require(_0x86a6('0x2'));var BPromise=require(_0x86a6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86a6('0x4'));var rimraf=require(_0x86a6('0x5'));var config=require(_0x86a6('0x6'));var attributes=require(_0x86a6('0x7'));module[_0x86a6('0x8')]=function(_0x4b2048,_0x24a55f){return _0x4b2048[_0x86a6('0x9')](_0x86a6('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x86a6('0xb'),'fields':[_0x86a6('0xc')],'type':_0x86a6('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xde9329,_0xf0e216,_0xb3eed){var _0x2b0840=_0x4b2048['models'];var _0xa7b0f6=_0xde9329['get']({'plain':!![]});if(_0xa7b0f6[_0x86a6('0xe')][_0x86a6('0xf')]()==='in'||_0xa7b0f6[_0x86a6('0xe')][_0x86a6('0xf')]()==='out'&&!_0xa7b0f6[_0x86a6('0x10')]&&!_['isNil'](_0xa7b0f6['UserId'])){_0x2b0840[_0x86a6('0x11')][_0x86a6('0x12')]({'where':{'id':_0xa7b0f6['OpenchannelInteractionId']}})['then'](function(_0x145df3){if(_0x145df3){_0x145df3['update']({'lastMsgAt':_0xa7b0f6['createdAt'],'lastMsgDirection':_0xa7b0f6[_0x86a6('0xe')]['toLowerCase']()});}})[_0x86a6('0x13')](function(_0x2de523){console[_0x86a6('0x14')](_0x2de523);});}if(_0xa7b0f6[_0x86a6('0xe')]==='out'&&!_0xa7b0f6[_0x86a6('0x10')]){var _0x2261ef;_0x2b0840[_0x86a6('0x15')][_0x86a6('0x16')]()['then'](function(_0x256ba6){return _0x2b0840['OpenchannelAccount']['find']({'where':{'id':_0xa7b0f6[_0x86a6('0x17')]},'include':[{'model':_0x2b0840[_0x86a6('0x11')],'as':_0x86a6('0x18'),'where':{'id':_0xa7b0f6['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2b0840['CmContact'],'as':_0x86a6('0x19'),'attributes':_[_0x86a6('0x1a')](_0x256ba6)}]}]});})[_0x86a6('0x1b')](function(_0x29c937){_0x2261ef=_0x29c937[_0x86a6('0x1c')]({'plain':!![]});if(_0x2261ef&&_0x2261ef[_0x86a6('0x1d')]){logger[_0x86a6('0x1e')](_0x86a6('0x1f'),_0x86a6('0x20'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0xa7b0f6['id'],_0x2261ef[_0x86a6('0x1d')]));if(_0x2261ef[_0x86a6('0x18')]&&_0x2261ef['Interactions'][_0x86a6('0x21')]){_0xa7b0f6[_0x86a6('0x22')]=_[_0x86a6('0x23')](_0x2261ef['Interactions'][0x0],_0x86a6('0x19'));_0xa7b0f6[_0x86a6('0x19')]=_0x2261ef[_0x86a6('0x18')][0x0][_0x86a6('0x19')];}var _0xf0e216={'method':_0x86a6('0x24'),'uri':encodeURI(_0x2261ef[_0x86a6('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xf0e216['method']){case _0x86a6('0x25'):_0xf0e216['qs']=_0xa7b0f6;break;case _0x86a6('0x24'):_0xf0e216[_0x86a6('0xc')]=_0xa7b0f6;break;}return rp(_0xf0e216)[_0x86a6('0x1b')](function(_0xbefbd5){logger[_0x86a6('0x1e')](_0x86a6('0x1f'),_0x86a6('0x20'),util[_0x86a6('0x26')](_0x86a6('0x27'),_0xa7b0f6['id'],_0x2261ef[_0x86a6('0x1d')]));if(_0xbefbd5[_0x86a6('0xc')][_0x86a6('0x28')]&&_0xbefbd5['body'][_0x86a6('0x28')]!=_0xa7b0f6['Interaction']['threadId']){return _0x2b0840[_0x86a6('0x11')]['update']({'threadId':_0xbefbd5['body'][_0x86a6('0x28')]},{'where':{'id':_0xa7b0f6[_0x86a6('0x22')]['id']}});}else{return;}})['then'](function(){return _0xde9329[_0x86a6('0x29')]({'read':!![]});})['catch'](function(_0x4062df){logger['error'](_0x86a6('0x1f'),_0x86a6('0x20'),util['inspect'](_0x4062df,{'showHidden':![],'depth':null}));_0xb3eed();});}else{_0xb3eed();}})['finally'](function(){_0xb3eed();});}else{_0xb3eed();}}},'charset':_0x86a6('0x2a'),'collate':_0x86a6('0x2b')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0864982..41315be 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 _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x45cd4b,_0x509c61){var _0x213105=function(_0x354a5c){while(--_0x354a5c){_0x45cd4b['push'](_0x45cd4b['shift']());}};_0x213105(++_0x509c61);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x0b0e[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xaebfa7,_0x5af539){var _0x1db390=function(_0x3e73b0){while(--_0x3e73b0){_0xaebfa7['push'](_0xaebfa7['shift']());}};_0x1db390(++_0x5af539);}(_0x5f2f,0x73));var _0xf5f2=function(_0x256db8,_0x248342){_0x256db8=_0x256db8-0x0;var _0x25b73a=_0x5f2f[_0x256db8];return _0x25b73a;};'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});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 6569556..c0059dd 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 _0x35c8=['remove','update','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x59e223,_0x410624){var _0x5f645a=function(_0x4834a6){while(--_0x4834a6){_0x59e223['push'](_0x59e223['shift']());}};_0x5f645a(++_0x410624);}(_0x35c8,0xa6));var _0x835c=function(_0x596664,_0x35d524){_0x596664=_0x596664-0x0;var _0x27f81f=_0x35c8[_0x596664];return _0x27f81f;};'use strict';var OpenchannelMessageEvents=require(_0x835c('0x0'));var events=[_0x835c('0x1'),_0x835c('0x2'),_0x835c('0x3')];function createListener(_0x306f59,_0x541bd6){return function(_0x5a9764){_0x541bd6[_0x835c('0x4')](_0x306f59,_0x5a9764);};}function removeListener(_0x1339d3,_0x10c49b){return function(){OpenchannelMessageEvents[_0x835c('0x5')](_0x1339d3,_0x10c49b);};}exports[_0x835c('0x6')]=function(_0x3c3f2f){for(var _0x37b9ce=0x0,_0x371249=events['length'];_0x37b9ce<_0x371249;_0x37b9ce++){var _0x7e199e=events[_0x37b9ce];var _0x217b8c=createListener(_0x835c('0x7')+_0x7e199e,_0x3c3f2f);OpenchannelMessageEvents['on'](_0x7e199e,_0x217b8c);}}; \ No newline at end of file +var _0xe03f=['removeListener','./openchannelMessage.events','save','remove','update','emit'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xe03f,0xa3));var _0xfe03=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe03f[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelMessageEvents=require(_0xfe03('0x0'));var events=[_0xfe03('0x1'),_0xfe03('0x2'),_0xfe03('0x3')];function createListener(_0x500322,_0x21302d){return function(_0x44c7bf){_0x21302d[_0xfe03('0x4')](_0x500322,_0x44c7bf);};}function removeListener(_0x232aeb,_0x4453a4){return function(){OpenchannelMessageEvents[_0xfe03('0x5')](_0x232aeb,_0x4453a4);};}exports['register']=function(_0x3bd5f7){for(var _0x23570e=0x0,_0x1042a9=events['length'];_0x23570e<_0x1042a9;_0x23570e++){var _0x2c2fd2=events[_0x23570e];var _0x1ec5be=createListener('openchannelMessage:'+_0x2c2fd2,_0x3bd5f7);OpenchannelMessageEvents['on'](_0x2c2fd2,_0x1ec5be);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 8f24b8d..4d20851 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 _0x22ab=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','addTeams','put','update','destroy','removeTeams','delete','removeAgents','exports','connect-timeout','express','fs-extra'];(function(_0x35a7ed,_0x5a9b57){var _0x4a8cdc=function(_0x416fda){while(--_0x416fda){_0x35a7ed['push'](_0x35a7ed['shift']());}};_0x4a8cdc(++_0x5a9b57);}(_0x22ab,0x11d));var _0xb22a=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x22ab[_0x51b0dc];return _0x13fa89;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb22a('0x0'));var express=require(_0xb22a('0x1'));var router=express['Router']();var fs_extra=require(_0xb22a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb22a('0x3'));var config=require(_0xb22a('0x4'));var controller=require(_0xb22a('0x5'));router[_0xb22a('0x6')]('/',auth[_0xb22a('0x7')](),controller['index']);router[_0xb22a('0x6')](_0xb22a('0x8'),auth[_0xb22a('0x7')](),controller['describe']);router[_0xb22a('0x6')](_0xb22a('0x9'),auth[_0xb22a('0x7')](),controller[_0xb22a('0xa')]);router[_0xb22a('0x6')](_0xb22a('0xb'),auth[_0xb22a('0x7')](),controller['getMembers']);router['get'](_0xb22a('0xc'),auth['isAuthenticated'](),controller['getTeams']);router[_0xb22a('0x6')](_0xb22a('0xd'),auth[_0xb22a('0x7')](),controller[_0xb22a('0xe')]);router[_0xb22a('0xf')]('/',auth[_0xb22a('0x7')](),controller['create']);router[_0xb22a('0xf')](_0xb22a('0xc'),auth[_0xb22a('0x7')](),controller[_0xb22a('0x10')]);router[_0xb22a('0xf')](_0xb22a('0xd'),auth[_0xb22a('0x7')](),controller['addAgents']);router[_0xb22a('0x11')](_0xb22a('0x9'),auth[_0xb22a('0x7')](),controller[_0xb22a('0x12')]);router['delete']('/:id',auth[_0xb22a('0x7')](),controller[_0xb22a('0x13')]);router['delete']('/:id/teams',auth[_0xb22a('0x7')](),controller[_0xb22a('0x14')]);router[_0xb22a('0x15')](_0xb22a('0xd'),auth['isAuthenticated'](),controller[_0xb22a('0x16')]);module[_0xb22a('0x17')]=router; \ No newline at end of file +var _0xa271=['get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addAgents','put','delete','removeTeams','/:id/users','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller'];(function(_0x1bff41,_0x386880){var _0x4db66b=function(_0x5aa7b6){while(--_0x5aa7b6){_0x1bff41['push'](_0x1bff41['shift']());}};_0x4db66b(++_0x386880);}(_0xa271,0x172));var _0x1a27=function(_0x46eb55,_0x3cbe36){_0x46eb55=_0x46eb55-0x0;var _0x2a98af=_0xa271[_0x46eb55];return _0x2a98af;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a27('0x0'));var timeout=require(_0x1a27('0x1'));var express=require(_0x1a27('0x2'));var router=express[_0x1a27('0x3')]();var fs_extra=require(_0x1a27('0x4'));var auth=require(_0x1a27('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a27('0x6'));var controller=require(_0x1a27('0x7'));router[_0x1a27('0x8')]('/',auth[_0x1a27('0x9')](),controller[_0x1a27('0xa')]);router['get']('/describe',auth[_0x1a27('0x9')](),controller[_0x1a27('0xb')]);router[_0x1a27('0x8')](_0x1a27('0xc'),auth[_0x1a27('0x9')](),controller[_0x1a27('0xd')]);router['get'](_0x1a27('0xe'),auth[_0x1a27('0x9')](),controller[_0x1a27('0xf')]);router[_0x1a27('0x8')](_0x1a27('0x10'),auth[_0x1a27('0x9')](),controller[_0x1a27('0x11')]);router[_0x1a27('0x8')]('/:id/users',auth[_0x1a27('0x9')](),controller[_0x1a27('0x12')]);router[_0x1a27('0x13')]('/',auth[_0x1a27('0x9')](),controller[_0x1a27('0x14')]);router['post'](_0x1a27('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x1a27('0x13')]('/:id/users',auth[_0x1a27('0x9')](),controller[_0x1a27('0x15')]);router[_0x1a27('0x16')](_0x1a27('0xc'),auth[_0x1a27('0x9')](),controller['update']);router[_0x1a27('0x17')]('/:id',auth[_0x1a27('0x9')](),controller['destroy']);router[_0x1a27('0x17')](_0x1a27('0x10'),auth[_0x1a27('0x9')](),controller[_0x1a27('0x18')]);router[_0x1a27('0x17')](_0x1a27('0x19'),auth[_0x1a27('0x9')](),controller['removeAgents']);module[_0x1a27('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index d3a7fa6..9833a50 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 _0x3458=['STRING','INTEGER','rrmemory','beepall','exports'];(function(_0x23d0fb,_0x57d383){var _0x5d22e8=function(_0x1bdb08){while(--_0x1bdb08){_0x23d0fb['push'](_0x23d0fb['shift']());}};_0x5d22e8(++_0x57d383);}(_0x3458,0xe5));var _0x8345=function(_0x3fc23b,_0x4fdda2){_0x3fc23b=_0x3fc23b-0x0;var _0x3ef5ca=_0x3458[_0x3fc23b];return _0x3ef5ca;};'use strict';var Sequelize=require('sequelize');module[_0x8345('0x0')]={'name':{'type':Sequelize[_0x8345('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8345('0x1')]},'timeout':{'type':Sequelize[_0x8345('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8345('0x3'),_0x8345('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x5b8d=['INTEGER','beepall','roundrobin','sequelize','STRING','name'];(function(_0x121fc4,_0x1cb70c){var _0x93e85e=function(_0x502637){while(--_0x502637){_0x121fc4['push'](_0x121fc4['shift']());}};_0x93e85e(++_0x1cb70c);}(_0x5b8d,0xdb));var _0xd5b8=function(_0x37b041,_0x55482f){_0x37b041=_0x37b041-0x0;var _0x24a3bc=_0x5b8d[_0x37b041];return _0x24a3bc;};'use strict';var Sequelize=require(_0xd5b8('0x0'));module['exports']={'name':{'type':Sequelize[_0xd5b8('0x1')],'unique':_0xd5b8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd5b8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd5b8('0x4'),_0xd5b8('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index a0f4a97..419cd8c 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 _0xd3d8=['register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','includeAll','include','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','rawAttributes','nolimit','OpenchannelQueueId','merge','findAll','User','findAndCountAll','UserId','agent','openchannelPause','rows','format','%s/%s','SIP','createdAt','getTeams','Team','pick','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x37c989,_0x1c95b8){var _0x4b15a6=function(_0x29b545){while(--_0x29b545){_0x37c989['push'](_0x37c989['shift']());}};_0x4b15a6(++_0x1c95b8);}(_0xd3d8,0x104));var _0x8d3d=function(_0x2445c0,_0x28d78e){_0x2445c0=_0x2445c0-0x0;var _0x4e8e3c=_0xd3d8[_0x2445c0];return _0x4e8e3c;};'use strict';var emlformat=require(_0x8d3d('0x0'));var rimraf=require(_0x8d3d('0x1'));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('mustache');var util=require(_0x8d3d('0x2'));var path=require(_0x8d3d('0x3'));var sox=require(_0x8d3d('0x4'));var csv=require(_0x8d3d('0x5'));var ejs=require(_0x8d3d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d3d('0x7'));var squel=require(_0x8d3d('0x8'));var crypto=require(_0x8d3d('0x9'));var jsforce=require(_0x8d3d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8d3d('0xb'));var Papa=require(_0x8d3d('0xc'));var Redis=require(_0x8d3d('0xd'));var authService=require(_0x8d3d('0xe'));var qs=require(_0x8d3d('0xf'));var as=require(_0x8d3d('0x10'));var hardwareService=require(_0x8d3d('0x11'));var logger=require(_0x8d3d('0x12'))(_0x8d3d('0x13'));var utils=require(_0x8d3d('0x14'));var config=require(_0x8d3d('0x15'));var licenseUtil=require(_0x8d3d('0x16'));var db=require('../../mysqldb')['db'];config[_0x8d3d('0x17')]=_[_0x8d3d('0x18')](config[_0x8d3d('0x17')],{'host':_0x8d3d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d3d('0x17')]));require('./openchannelQueue.socket')[_0x8d3d('0x1a')](socket);function respondWithStatusCode(_0x378d5e,_0x2d18e0){_0x2d18e0=_0x2d18e0||0xcc;return function(_0x8171f){if(_0x8171f){return _0x378d5e[_0x8d3d('0x1b')](_0x2d18e0);}return _0x378d5e[_0x8d3d('0x1c')](_0x2d18e0)[_0x8d3d('0x1d')]();};}function respondWithResult(_0x465e0a,_0x27fe48){_0x27fe48=_0x27fe48||0xc8;return function(_0x56cdaa){if(_0x56cdaa){return _0x465e0a[_0x8d3d('0x1c')](_0x27fe48)[_0x8d3d('0x1e')](_0x56cdaa);}};}function respondWithFilteredResult(_0x1a8e13,_0x404e0c){return function(_0x2c80c0){if(_0x2c80c0){var _0x4ea198=typeof _0x404e0c[_0x8d3d('0x1f')]==='undefined'&&typeof _0x404e0c[_0x8d3d('0x20')]===_0x8d3d('0x21');var _0x23fb3e=_0x2c80c0[_0x8d3d('0x22')];var _0x25b277=_0x4ea198?0x0:_0x404e0c[_0x8d3d('0x1f')];var _0x54d894=_0x4ea198?_0x2c80c0[_0x8d3d('0x22')]:_0x404e0c[_0x8d3d('0x1f')]+_0x404e0c['limit'];var _0x46e220;if(_0x54d894>=_0x23fb3e){_0x54d894=_0x23fb3e;_0x46e220=0xc8;}else{_0x46e220=0xce;}_0x1a8e13['status'](_0x46e220);return _0x1a8e13[_0x8d3d('0x23')]('Content-Range',_0x25b277+'-'+_0x54d894+'/'+_0x23fb3e)[_0x8d3d('0x1e')](_0x2c80c0);}return null;};}function patchUpdates(_0x4fc704){return function(_0x355711){try{jsonpatch['apply'](_0x355711,_0x4fc704,!![]);}catch(_0x19f3a1){return BPromise[_0x8d3d('0x24')](_0x19f3a1);}return _0x355711[_0x8d3d('0x25')]();};}function saveUpdates(_0x2cb05f,_0x192733){return function(_0x46e66a){if(_0x46e66a){return _0x46e66a[_0x8d3d('0x26')](_0x2cb05f)['then'](function(_0x3e3752){return _0x3e3752;});}return null;};}function removeEntity(_0xccaf8b,_0x182916){return function(_0x3ed4b4){if(_0x3ed4b4){return _0x3ed4b4[_0x8d3d('0x27')]()[_0x8d3d('0x28')](function(){var _0x3239e6=_0x3ed4b4['get']({'plain':!![]});var _0x199ef0='OpenchannelQueues';return db[_0x8d3d('0x29')]['destroy']({'where':{'type':_0x199ef0,'resourceId':_0x3239e6['id']}})[_0x8d3d('0x28')](function(){return _0x3ed4b4;});})[_0x8d3d('0x28')](function(){_0xccaf8b[_0x8d3d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa7ac,_0x2ce0a6){return function(_0x38e440){if(!_0x38e440){_0x3fa7ac[_0x8d3d('0x1b')](0x194);}return _0x38e440;};}function handleError(_0x250cfa,_0x4f6913){_0x4f6913=_0x4f6913||0x1f4;return function(_0x412e79){logger[_0x8d3d('0x2a')](_0x412e79[_0x8d3d('0x2b')]);if(_0x412e79[_0x8d3d('0x2c')]){delete _0x412e79[_0x8d3d('0x2c')];}_0x250cfa[_0x8d3d('0x1c')](_0x4f6913)[_0x8d3d('0x2d')](_0x412e79);};}exports[_0x8d3d('0x2e')]=function(_0x52288b,_0x5a8c22){var _0x379d7e={},_0xa8796a={},_0x1be178={'count':0x0,'rows':[]};var _0x29d905=_['map'](db[_0x8d3d('0x2f')]['rawAttributes'],function(_0x5b80b7){return{'name':_0x5b80b7['fieldName'],'type':_0x5b80b7['type']['key']};});_0xa8796a[_0x8d3d('0x30')]=_[_0x8d3d('0x31')](_0x29d905,'name');_0xa8796a[_0x8d3d('0x32')]=_[_0x8d3d('0x33')](_0x52288b['query']);_0xa8796a[_0x8d3d('0x34')]=_[_0x8d3d('0x35')](_0xa8796a[_0x8d3d('0x30')],_0xa8796a[_0x8d3d('0x32')]);_0x379d7e['attributes']=_[_0x8d3d('0x35')](_0xa8796a['model'],qs[_0x8d3d('0x36')](_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x36')]));_0x379d7e['attributes']=_0x379d7e[_0x8d3d('0x37')][_0x8d3d('0x38')]?_0x379d7e['attributes']:_0xa8796a[_0x8d3d('0x30')];if(!_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x39')]('nolimit')){_0x379d7e[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x52288b['query'][_0x8d3d('0x20')]);_0x379d7e[_0x8d3d('0x1f')]=qs[_0x8d3d('0x1f')](_0x52288b['query'][_0x8d3d('0x1f')]);}_0x379d7e[_0x8d3d('0x3a')]=qs[_0x8d3d('0x3b')](_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x3b')]);_0x379d7e[_0x8d3d('0x3c')]=qs[_0x8d3d('0x34')](_['pick'](_0x52288b[_0x8d3d('0x32')],_0xa8796a[_0x8d3d('0x34')]),_0x29d905);if(_0x52288b['query'][_0x8d3d('0x3d')]){_0x379d7e['where']=_['merge'](_0x379d7e['where'],{'$or':_['map'](_0x29d905,function(_0x56fdae){if(_0x56fdae[_0x8d3d('0x3e')]!==_0x8d3d('0x3f')){var _0x18e3dc={};_0x18e3dc[_0x56fdae['name']]={'$like':'%'+_0x52288b[_0x8d3d('0x32')]['filter']+'%'};return _0x18e3dc;}})});}_0x379d7e=_['merge']({},_0x379d7e,_0x52288b['options']);var _0xac8f41={'where':_0x379d7e[_0x8d3d('0x3c')]};return db[_0x8d3d('0x2f')][_0x8d3d('0x22')](_0xac8f41)[_0x8d3d('0x28')](function(_0x3a535e){_0x1be178[_0x8d3d('0x22')]=_0x3a535e;if(_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x40')]){_0x379d7e[_0x8d3d('0x41')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x379d7e);})[_0x8d3d('0x28')](function(_0x5da703){_0x1be178['rows']=_0x5da703;return _0x1be178;})['then'](respondWithFilteredResult(_0x5a8c22,_0x379d7e))['catch'](handleError(_0x5a8c22,null));};exports[_0x8d3d('0x42')]=function(_0x427c42,_0x4d6813){var _0x4b0fa9={'raw':!![],'where':{'id':_0x427c42[_0x8d3d('0x43')]['id']}},_0x3210a2={};_0x3210a2[_0x8d3d('0x30')]=_[_0x8d3d('0x33')](db[_0x8d3d('0x2f')]['rawAttributes']);_0x3210a2[_0x8d3d('0x32')]=_[_0x8d3d('0x33')](_0x427c42[_0x8d3d('0x32')]);_0x3210a2[_0x8d3d('0x34')]=_[_0x8d3d('0x35')](_0x3210a2[_0x8d3d('0x30')],_0x3210a2['query']);_0x4b0fa9[_0x8d3d('0x37')]=_[_0x8d3d('0x35')](_0x3210a2[_0x8d3d('0x30')],qs['fields'](_0x427c42['query'][_0x8d3d('0x36')]));_0x4b0fa9[_0x8d3d('0x37')]=_0x4b0fa9['attributes'][_0x8d3d('0x38')]?_0x4b0fa9['attributes']:_0x3210a2[_0x8d3d('0x30')];if(_0x427c42[_0x8d3d('0x32')]['includeAll']){_0x4b0fa9[_0x8d3d('0x41')]=[{'all':!![]}];}_0x4b0fa9=_['merge']({},_0x4b0fa9,_0x427c42[_0x8d3d('0x44')]);return db[_0x8d3d('0x2f')][_0x8d3d('0x45')](_0x4b0fa9)[_0x8d3d('0x28')](handleEntityNotFound(_0x4d6813,null))[_0x8d3d('0x28')](respondWithResult(_0x4d6813,null))['catch'](handleError(_0x4d6813,null));};exports[_0x8d3d('0x46')]=function(_0x4de290,_0x46923a){return db['OpenchannelQueue'][_0x8d3d('0x46')](_0x4de290['body'],{})[_0x8d3d('0x28')](function(_0x24460d){var _0x39f26b=_0x4de290[_0x8d3d('0x47')]['get']({'plain':!![]});if(!_0x39f26b)throw new Error(_0x8d3d('0x48'));if(_0x39f26b[_0x8d3d('0x49')]===_0x8d3d('0x47')){var _0xb205c=_0x24460d[_0x8d3d('0x4a')]({'plain':!![]});var _0x2e90fb=_0x8d3d('0x4b');return db[_0x8d3d('0x4c')][_0x8d3d('0x45')]({'where':{'name':_0x2e90fb,'userProfileId':_0x39f26b[_0x8d3d('0x4d')]},'raw':!![]})[_0x8d3d('0x28')](function(_0x397661){if(_0x397661&&_0x397661[_0x8d3d('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0xb205c[_0x8d3d('0x2c')],'resourceId':_0xb205c['id'],'type':_0x397661['name'],'sectionId':_0x397661['id']},{})[_0x8d3d('0x28')](function(){return _0x24460d;});}else{return _0x24460d;}})[_0x8d3d('0x4f')](function(_0x4b4845){logger['error'](_0x8d3d('0x50'),_0x4b4845);throw _0x4b4845;});}return _0x24460d;})[_0x8d3d('0x28')](respondWithResult(_0x46923a,0xc9))['catch'](handleError(_0x46923a,null));};exports[_0x8d3d('0x26')]=function(_0x2148c1,_0x313371){if(_0x2148c1[_0x8d3d('0x51')]['id']){delete _0x2148c1[_0x8d3d('0x51')]['id'];}return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x2148c1[_0x8d3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x313371,null))[_0x8d3d('0x28')](saveUpdates(_0x2148c1[_0x8d3d('0x51')],null))[_0x8d3d('0x28')](respondWithResult(_0x313371,null))['catch'](handleError(_0x313371,null));};exports[_0x8d3d('0x27')]=function(_0x47ce44,_0xc22ea6){return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x47ce44['params']['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0xc22ea6,null))['then'](removeEntity(_0xc22ea6,null))[_0x8d3d('0x4f')](handleError(_0xc22ea6,null));};exports[_0x8d3d('0x52')]=function(_0x1efa75,_0x3a29c6){return db[_0x8d3d('0x2f')][_0x8d3d('0x52')]()[_0x8d3d('0x28')](respondWithResult(_0x3a29c6,null))[_0x8d3d('0x4f')](handleError(_0x3a29c6,null));};exports[_0x8d3d('0x53')]=function(_0x28aac0,_0x5e1351,_0x38be85){var _0x39643c={'raw':!![],'where':{}},_0x15c63e={},_0x4d9e7b;return db['OpenchannelQueue'][_0x8d3d('0x54')]({'where':{'id':_0x28aac0['params']['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0x5e1351,null))[_0x8d3d('0x28')](function(_0x3fef2b){if(_0x3fef2b){_0x4d9e7b=_0x3fef2b[_0x8d3d('0x4a')]({'plain':!![]});_0x15c63e[_0x8d3d('0x30')]=_[_0x8d3d('0x33')](db[_0x8d3d('0x55')][_0x8d3d('0x56')]);_0x15c63e[_0x8d3d('0x32')]=_[_0x8d3d('0x33')](_0x28aac0[_0x8d3d('0x32')]);_0x15c63e['filters']=_['intersection'](_0x15c63e['model'],_0x15c63e[_0x8d3d('0x32')]);_0x39643c[_0x8d3d('0x37')]=_[_0x8d3d('0x35')](_0x15c63e[_0x8d3d('0x30')],qs[_0x8d3d('0x36')](_0x28aac0['query']['fields']));_0x39643c['attributes']=_0x39643c[_0x8d3d('0x37')][_0x8d3d('0x38')]?_0x39643c[_0x8d3d('0x37')]:_0x15c63e['model'];if(!_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x39')](_0x8d3d('0x57'))){_0x39643c[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x28aac0['query'][_0x8d3d('0x20')]);_0x39643c[_0x8d3d('0x1f')]=qs['offset'](_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x1f')]);}_0x39643c[_0x8d3d('0x3a')]=qs['sort'](_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x3b')]);_0x39643c[_0x8d3d('0x3c')]=qs['filters'](_['pick'](_0x28aac0[_0x8d3d('0x32')],_0x15c63e['filters']));_0x39643c['where'][_0x8d3d('0x58')]=_0x3fef2b['id'];if(_0x28aac0[_0x8d3d('0x32')]['filter']){_0x39643c[_0x8d3d('0x3c')]=_[_0x8d3d('0x59')](_0x39643c[_0x8d3d('0x3c')],{'$or':_[_0x8d3d('0x31')](_0x39643c[_0x8d3d('0x37')],function(_0x3d78aa){var _0x2a8b6f={};_0x2a8b6f[_0x3d78aa]={'$like':'%'+_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x3d')]+'%'};return _0x2a8b6f;})});}_0x39643c=_[_0x8d3d('0x59')]({},_0x39643c,_0x28aac0[_0x8d3d('0x44')]);return db['UserOpenchannelQueue'][_0x8d3d('0x5a')](_0x39643c);}})['then'](function(_0x4b91f7){if(_0x4b91f7){return db[_0x8d3d('0x5b')][_0x8d3d('0x5c')]({'where':{'id':_[_0x8d3d('0x31')](_0x4b91f7,_0x8d3d('0x5d')),'role':_0x8d3d('0x5e')},'attributes':['id',_0x8d3d('0x2c'),_0x8d3d('0x5f'),'updatedAt','createdAt']});}})['then'](function(_0x1a5e1b){if(_0x1a5e1b){return{'count':_0x1a5e1b['count'],'rows':_['map'](_0x1a5e1b[_0x8d3d('0x60')],function(_0x77a2bd){return{'membername':_0x77a2bd[_0x8d3d('0x2c')],'UserId':_0x77a2bd['id'],'queue_name':_0x4d9e7b[_0x8d3d('0x2c')],'OpenchannelQueueId':_0x4d9e7b['id'],'interface':util[_0x8d3d('0x61')](_0x8d3d('0x62'),_0x8d3d('0x63'),_0x77a2bd[_0x8d3d('0x2c')]),'penalty':0x0,'paused':_0x77a2bd[_0x8d3d('0x5f')],'createdAt':_0x77a2bd[_0x8d3d('0x64')],'updatedAt':_0x77a2bd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d3d('0x28')](respondWithFilteredResult(_0x5e1351,_0x39643c))[_0x8d3d('0x4f')](handleError(_0x5e1351,null));};exports[_0x8d3d('0x65')]=function(_0x3a712b,_0x32ab5c,_0x38c585){var _0x11a4e7={};var _0x5766fe={};var _0xf4bd65;var _0x23d4c7;return db[_0x8d3d('0x2f')]['findOne']({'where':{'id':_0x3a712b[_0x8d3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x32ab5c,null))[_0x8d3d('0x28')](function(_0x410dd9){if(_0x410dd9){_0xf4bd65=_0x410dd9;_0x5766fe[_0x8d3d('0x30')]=_['keys'](db[_0x8d3d('0x66')][_0x8d3d('0x56')]);_0x5766fe['query']=_[_0x8d3d('0x33')](_0x3a712b['query']);_0x5766fe['filters']=_[_0x8d3d('0x35')](_0x5766fe[_0x8d3d('0x30')],_0x5766fe[_0x8d3d('0x32')]);_0x11a4e7['attributes']=_['intersection'](_0x5766fe[_0x8d3d('0x30')],qs[_0x8d3d('0x36')](_0x3a712b['query']['fields']));_0x11a4e7[_0x8d3d('0x37')]=_0x11a4e7[_0x8d3d('0x37')]['length']?_0x11a4e7[_0x8d3d('0x37')]:_0x5766fe[_0x8d3d('0x30')];_0x11a4e7['order']=qs['sort'](_0x3a712b[_0x8d3d('0x32')][_0x8d3d('0x3b')]);_0x11a4e7[_0x8d3d('0x3c')]=qs['filters'](_[_0x8d3d('0x67')](_0x3a712b[_0x8d3d('0x32')],_0x5766fe[_0x8d3d('0x34')]));if(_0x3a712b['query']['filter']){_0x11a4e7[_0x8d3d('0x3c')]=_[_0x8d3d('0x59')](_0x11a4e7[_0x8d3d('0x3c')],{'$or':_[_0x8d3d('0x31')](_0x11a4e7['attributes'],function(_0x46fe25){var _0x5c8a98={};_0x5c8a98[_0x46fe25]={'$like':'%'+_0x3a712b[_0x8d3d('0x32')][_0x8d3d('0x3d')]+'%'};return _0x5c8a98;})});}_0x11a4e7=_[_0x8d3d('0x59')]({},_0x11a4e7,_0x3a712b[_0x8d3d('0x44')]);return _0xf4bd65[_0x8d3d('0x65')](_0x11a4e7);}})['then'](function(_0x486dfd){if(_0x486dfd){_0x23d4c7=_0x486dfd[_0x8d3d('0x38')];if(!_0x3a712b[_0x8d3d('0x32')][_0x8d3d('0x39')](_0x8d3d('0x57'))){_0x11a4e7[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x3a712b['query']['limit']);_0x11a4e7['offset']=qs[_0x8d3d('0x1f')](_0x3a712b[_0x8d3d('0x32')]['offset']);}return _0xf4bd65['getTeams'](_0x11a4e7);}})['then'](function(_0xb5ded4){if(_0xb5ded4){return _0xb5ded4?{'count':_0x23d4c7,'rows':_0xb5ded4}:null;}})[_0x8d3d('0x28')](respondWithResult(_0x32ab5c,null))[_0x8d3d('0x4f')](handleError(_0x32ab5c,null));};exports[_0x8d3d('0x68')]=function(_0x1f426c,_0x1e9dba,_0x388582){var _0x781359=_0x1f426c[_0x8d3d('0x51')]['ids'];return db[_0x8d3d('0x66')]['findAll']({'where':{'id':_0x781359},'attributes':['id'],'include':[{'model':db[_0x8d3d('0x5b')],'as':_0x8d3d('0x69'),'attributes':['id','name',_0x8d3d('0x6a'),_0x8d3d('0x6b'),_0x8d3d('0x6c')],'raw':!![]}]})[_0x8d3d('0x28')](function(_0x173038){if(_0x173038){var _0x38c6b3=_[_0x8d3d('0x6d')](_0x173038,function(_0x1fead1){var _0x5a6601=_0x1fead1[_0x8d3d('0x4a')]({'plain':!![]});return _0x5a6601[_0x8d3d('0x69')];});return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x1f426c[_0x8d3d('0x43')]['id']}})[_0x8d3d('0x28')](function(_0x107114){return db[_0x8d3d('0x6e')][_0x8d3d('0x6f')](function(_0x35f50b){return _0x107114[_0x8d3d('0x68')](_0x781359,{'transaction':_0x35f50b})[_0x8d3d('0x28')](function(){return BPromise['each'](_0x38c6b3,function(_0x55384c){return db[_0x8d3d('0x55')]['findOrCreate']({'where':{'UserId':_0x55384c['id'],'OpenchannelQueueId':_0x1f426c['params']['id']},'transaction':_0x35f50b});});})[_0x8d3d('0x28')](function(){_0x38c6b3[_0x8d3d('0x70')](function(_0x58ab1e){socket[_0x8d3d('0x71')](_0x8d3d('0x72'),{'UserId':_0x58ab1e['id'],'OpenchannelQueueId':_0x107114['id']});});});});});}})[_0x8d3d('0x28')](respondWithStatusCode(_0x1e9dba,null))[_0x8d3d('0x4f')](handleError(_0x1e9dba,null));};exports[_0x8d3d('0x73')]=function(_0x2aef99,_0xf75a23,_0xea1c1e){return db[_0x8d3d('0x66')][_0x8d3d('0x5a')]({'where':{'id':_0x2aef99[_0x8d3d('0x32')][_0x8d3d('0x74')]},'attributes':['id'],'include':[{'model':db[_0x8d3d('0x5b')],'as':_0x8d3d('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xf75a23,null))[_0x8d3d('0x28')](function(_0x2ca254){var _0x582df6=_[_0x8d3d('0x31')](_0x2ca254,'id');var _0x2e01fd=[];var _0x9d99e2=[];var _0x40f153=squel['select']();_0x40f153[_0x8d3d('0x75')](_0x8d3d('0x76'))[_0x8d3d('0x77')](_0x8d3d('0x78'),'tq')[_0x8d3d('0x79')](_0x8d3d('0x7a'),'ut',_0x8d3d('0x7b'))[_0x8d3d('0x3c')](_0x8d3d('0x7c'),_0x2aef99[_0x8d3d('0x43')]['id']);for(var _0x2d19e9=0x0;_0x2d19e9<_0x2ca254['length'];_0x2d19e9+=0x1){let _0x56f911=_0x2ca254[_0x2d19e9];for(var _0x36b048=0x0;_0x36b048<_0x56f911['Agents'][_0x8d3d('0x38')];_0x36b048+=0x1){let _0x275882=_0x56f911[_0x8d3d('0x69')][_0x36b048];var _0x29c803=_0x40f153[_0x8d3d('0x7d')]();_0x29c803[_0x8d3d('0x3c')](_0x8d3d('0x7e'),_0x275882['id']);_0x9d99e2['push'](db[_0x8d3d('0x6e')][_0x8d3d('0x32')](_0x29c803[_0x8d3d('0x7f')](),{'type':db[_0x8d3d('0x6e')]['QueryTypes'][_0x8d3d('0x80')]})[_0x8d3d('0x28')](function(_0x5c8345){if(_0x5c8345[_0x8d3d('0x38')]===0x1){return _0x275882['id'];}else{var _0x2dfa65=_[_0x8d3d('0x81')](_['map'](_0x5c8345,_0x8d3d('0x82')),function(_0x80f312){return _[_0x8d3d('0x83')](_0x582df6,_0x80f312);});if(_0x2dfa65){return _0x275882['id'];}}}));}}return BPromise[_0x8d3d('0x84')](_0x9d99e2)[_0x8d3d('0x28')](function(_0x15ac8f){_0x2e01fd=_(_0x2e01fd)[_0x8d3d('0x85')](_0x15ac8f)[_0x8d3d('0x86')]()[_0x8d3d('0x87')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x2aef99['params']['id']}})[_0x8d3d('0x28')](function(_0x485d5d){return db[_0x8d3d('0x6e')][_0x8d3d('0x6f')](function(_0x51d46c){return _0x485d5d[_0x8d3d('0x73')](_0x2aef99[_0x8d3d('0x32')][_0x8d3d('0x74')],{'transaction':_0x51d46c})['then'](function(){if(!_[_0x8d3d('0x88')](_0x2e01fd)){return _0x485d5d['removeAgents'](_0x2e01fd,{'transaction':_0x51d46c});}})['then'](function(){_0x2e01fd['forEach'](function(_0x535ce7){socket[_0x8d3d('0x71')]('userOpenchannelQueue:remove',{'UserId':_0x535ce7,'OpenchannelQueueId':_0x485d5d['id']});});});});});});})[_0x8d3d('0x28')](respondWithStatusCode(_0xf75a23,null))[_0x8d3d('0x4f')](handleError(_0xf75a23,null));};exports['addAgents']=function(_0x2f38e7,_0xef499e,_0x496996){return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x2f38e7[_0x8d3d('0x43')]['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0xef499e,null))['then'](function(_0x4b60d5){if(_0x4b60d5){return _0x4b60d5[_0x8d3d('0x89')](_0x2f38e7[_0x8d3d('0x51')][_0x8d3d('0x74')],_[_0x8d3d('0x8a')](_0x2f38e7[_0x8d3d('0x51')],[_0x8d3d('0x74'),'id'])||{})['spread'](function(_0x391416){for(var _0xa3f008=0x0;_0xa3f008<_0x2f38e7[_0x8d3d('0x51')][_0x8d3d('0x74')][_0x8d3d('0x38')];_0xa3f008+=0x1){socket[_0x8d3d('0x71')]('userOpenchannelQueue:save',{'UserId':Number(_0x2f38e7[_0x8d3d('0x51')]['ids'][_0xa3f008]),'OpenchannelQueueId':Number(_0x2f38e7[_0x8d3d('0x43')]['id'])});}return _0x391416;});}})['then'](respondWithResult(_0xef499e,null))[_0x8d3d('0x4f')](handleError(_0xef499e,null));};exports[_0x8d3d('0x8b')]=function(_0x2e264a,_0x4db11f,_0x5ebdf4){return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x2e264a['params']['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0x4db11f,null))[_0x8d3d('0x28')](function(_0x531e69){if(_0x531e69){return _0x531e69[_0x8d3d('0x8b')](_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')])['then'](function(){if(_[_0x8d3d('0x8c')](_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')])){for(var _0x2e4fab=0x0;_0x2e4fab<_0x2e264a['query'][_0x8d3d('0x74')][_0x8d3d('0x38')];_0x2e4fab+=0x1){socket[_0x8d3d('0x71')](_0x8d3d('0x8d'),{'UserId':Number(_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')][_0x2e4fab]),'OpenchannelQueueId':Number(_0x2e264a[_0x8d3d('0x43')]['id'])});}}else{socket[_0x8d3d('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')]),'OpenchannelQueueId':Number(_0x2e264a[_0x8d3d('0x43')]['id'])});}});}})['then'](respondWithStatusCode(_0x4db11f,null))['catch'](handleError(_0x4db11f,null));};exports[_0x8d3d('0x8e')]=function(_0x534868,_0x2f2cf0,_0x58cd18){var _0xed8ccb={};var _0x45cb43={};var _0x4a2a42;var _0xcaf71d;return db[_0x8d3d('0x2f')][_0x8d3d('0x54')]({'where':{'id':_0x534868[_0x8d3d('0x43')]['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0x2f2cf0,null))['then'](function(_0x5845d8){if(_0x5845d8){_0x4a2a42=_0x5845d8;_0x45cb43[_0x8d3d('0x30')]=_[_0x8d3d('0x33')](db[_0x8d3d('0x5b')][_0x8d3d('0x56')]);_0x45cb43[_0x8d3d('0x32')]=_['keys'](_0x534868[_0x8d3d('0x32')]);_0x45cb43['filters']=_[_0x8d3d('0x35')](_0x45cb43[_0x8d3d('0x30')],_0x45cb43['query']);_0xed8ccb[_0x8d3d('0x37')]=_[_0x8d3d('0x35')](_0x45cb43['model'],qs[_0x8d3d('0x36')](_0x534868[_0x8d3d('0x32')][_0x8d3d('0x36')]));_0xed8ccb[_0x8d3d('0x37')]=_0xed8ccb[_0x8d3d('0x37')][_0x8d3d('0x38')]?_0xed8ccb[_0x8d3d('0x37')]:_0x45cb43[_0x8d3d('0x30')];_0xed8ccb['order']=qs[_0x8d3d('0x3b')](_0x534868['query'][_0x8d3d('0x3b')]);_0xed8ccb[_0x8d3d('0x3c')]=qs[_0x8d3d('0x34')](_[_0x8d3d('0x67')](_0x534868[_0x8d3d('0x32')],_0x45cb43[_0x8d3d('0x34')]));if(_0x534868[_0x8d3d('0x32')]['filter']){_0xed8ccb['where']=_['merge'](_0xed8ccb[_0x8d3d('0x3c')],{'$or':_[_0x8d3d('0x31')](_0xed8ccb[_0x8d3d('0x37')],function(_0x460e64){var _0x46187a={};_0x46187a[_0x460e64]={'$like':'%'+_0x534868[_0x8d3d('0x32')][_0x8d3d('0x3d')]+'%'};return _0x46187a;})});}_0xed8ccb=_['merge']({},_0xed8ccb,_0x534868[_0x8d3d('0x44')]);return _0x4a2a42[_0x8d3d('0x8e')](_0xed8ccb);}})[_0x8d3d('0x28')](function(_0x413bf4){if(_0x413bf4){_0xcaf71d=_0x413bf4[_0x8d3d('0x38')];if(!_0x534868[_0x8d3d('0x32')][_0x8d3d('0x39')](_0x8d3d('0x57'))){_0xed8ccb[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x534868['query']['limit']);_0xed8ccb['offset']=qs['offset'](_0x534868[_0x8d3d('0x32')][_0x8d3d('0x1f')]);}return _0x4a2a42[_0x8d3d('0x8e')](_0xed8ccb);}})[_0x8d3d('0x28')](function(_0x1cb549){if(_0x1cb549){return _0x1cb549?{'count':_0xcaf71d,'rows':_0x1cb549}:null;}})[_0x8d3d('0x28')](respondWithResult(_0x2f2cf0,null))[_0x8d3d('0x4f')](handleError(_0x2f2cf0,null));}; \ No newline at end of file +var _0xf116=['TeamId','includes','all','union','value','userOpenchannelQueue:remove','addAgents','removeAgents','getAgents','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','filter','options','include','rows','show','params','keys','includeAll','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','catch','describe','getMembers','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','findAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','removeTeams','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every'];(function(_0x5c00b8,_0x1667ce){var _0x514b17=function(_0xb4259){while(--_0xb4259){_0x5c00b8['push'](_0x5c00b8['shift']());}};_0x514b17(++_0x1667ce);}(_0xf116,0x19b));var _0x6f11=function(_0x5be8cc,_0x4a6037){_0x5be8cc=_0x5be8cc-0x0;var _0x5f1b7e=_0xf116[_0x5be8cc];return _0x5f1b7e;};'use strict';var emlformat=require(_0x6f11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f11('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f11('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6f11('0x3'));var util=require(_0x6f11('0x4'));var path=require(_0x6f11('0x5'));var sox=require(_0x6f11('0x6'));var csv=require(_0x6f11('0x7'));var ejs=require(_0x6f11('0x8'));var fs=require('fs');var fs_extra=require(_0x6f11('0x9'));var _=require(_0x6f11('0xa'));var squel=require(_0x6f11('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6f11('0xc'));var toCsv=require(_0x6f11('0x7'));var querystring=require('querystring');var Papa=require(_0x6f11('0xd'));var Redis=require(_0x6f11('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6f11('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6f11('0x10'));var utils=require(_0x6f11('0x11'));var config=require(_0x6f11('0x12'));var licenseUtil=require(_0x6f11('0x13'));var db=require(_0x6f11('0x14'))['db'];config[_0x6f11('0x15')]=_[_0x6f11('0x16')](config[_0x6f11('0x15')],{'host':_0x6f11('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f11('0x15')]));require(_0x6f11('0x18'))[_0x6f11('0x19')](socket);function respondWithStatusCode(_0x30cde4,_0x30490f){_0x30490f=_0x30490f||0xcc;return function(_0x3b9a5c){if(_0x3b9a5c){return _0x30cde4['sendStatus'](_0x30490f);}return _0x30cde4[_0x6f11('0x1a')](_0x30490f)[_0x6f11('0x1b')]();};}function respondWithResult(_0x3f1b94,_0x112a85){_0x112a85=_0x112a85||0xc8;return function(_0x56e3d9){if(_0x56e3d9){return _0x3f1b94[_0x6f11('0x1a')](_0x112a85)[_0x6f11('0x1c')](_0x56e3d9);}};}function respondWithFilteredResult(_0x4b6156,_0x4b6033){return function(_0x2f4b6b){if(_0x2f4b6b){var _0x97799c=typeof _0x4b6033[_0x6f11('0x1d')]===_0x6f11('0x1e')&&typeof _0x4b6033[_0x6f11('0x1f')]===_0x6f11('0x1e');var _0x3ec9ea=_0x2f4b6b[_0x6f11('0x20')];var _0x49f0f6=_0x97799c?0x0:_0x4b6033['offset'];var _0x2a301d=_0x97799c?_0x2f4b6b[_0x6f11('0x20')]:_0x4b6033[_0x6f11('0x1d')]+_0x4b6033['limit'];var _0x3382de;if(_0x2a301d>=_0x3ec9ea){_0x2a301d=_0x3ec9ea;_0x3382de=0xc8;}else{_0x3382de=0xce;}_0x4b6156[_0x6f11('0x1a')](_0x3382de);return _0x4b6156[_0x6f11('0x21')]('Content-Range',_0x49f0f6+'-'+_0x2a301d+'/'+_0x3ec9ea)[_0x6f11('0x1c')](_0x2f4b6b);}return null;};}function patchUpdates(_0x186295){return function(_0x126aa9){try{jsonpatch[_0x6f11('0x22')](_0x126aa9,_0x186295,!![]);}catch(_0x55a499){return BPromise[_0x6f11('0x23')](_0x55a499);}return _0x126aa9[_0x6f11('0x24')]();};}function saveUpdates(_0xef74b9,_0x40f15b){return function(_0x40fe42){if(_0x40fe42){return _0x40fe42[_0x6f11('0x25')](_0xef74b9)['then'](function(_0x41d7a5){return _0x41d7a5;});}return null;};}function removeEntity(_0x1cd293,_0x197a4a){return function(_0x5e2dcc){if(_0x5e2dcc){return _0x5e2dcc[_0x6f11('0x26')]()[_0x6f11('0x27')](function(){var _0x4d6892=_0x5e2dcc[_0x6f11('0x28')]({'plain':!![]});var _0x5a0a1a=_0x6f11('0x29');return db[_0x6f11('0x2a')]['destroy']({'where':{'type':_0x5a0a1a,'resourceId':_0x4d6892['id']}})[_0x6f11('0x27')](function(){return _0x5e2dcc;});})[_0x6f11('0x27')](function(){_0x1cd293[_0x6f11('0x1a')](0xcc)[_0x6f11('0x1b')]();});}};}function handleEntityNotFound(_0x3ca9a4,_0x2d168b){return function(_0x27661f){if(!_0x27661f){_0x3ca9a4[_0x6f11('0x2b')](0x194);}return _0x27661f;};}function handleError(_0x3f6125,_0x47de9e){_0x47de9e=_0x47de9e||0x1f4;return function(_0x4f0469){logger[_0x6f11('0x2c')](_0x4f0469[_0x6f11('0x2d')]);if(_0x4f0469[_0x6f11('0x2e')]){delete _0x4f0469['name'];}_0x3f6125[_0x6f11('0x1a')](_0x47de9e)[_0x6f11('0x2f')](_0x4f0469);};}exports[_0x6f11('0x30')]=function(_0x39c976,_0x2cbc8c){var _0x9848bf={},_0x4f514f={},_0x537e89={'count':0x0,'rows':[]};var _0x1d959e=_[_0x6f11('0x31')](db[_0x6f11('0x32')][_0x6f11('0x33')],function(_0x24cf53){return{'name':_0x24cf53['fieldName'],'type':_0x24cf53['type']['key']};});_0x4f514f['model']=_['map'](_0x1d959e,'name');_0x4f514f['query']=_['keys'](_0x39c976[_0x6f11('0x34')]);_0x4f514f[_0x6f11('0x35')]=_[_0x6f11('0x36')](_0x4f514f[_0x6f11('0x37')],_0x4f514f[_0x6f11('0x34')]);_0x9848bf[_0x6f11('0x38')]=_['intersection'](_0x4f514f[_0x6f11('0x37')],qs[_0x6f11('0x39')](_0x39c976[_0x6f11('0x34')][_0x6f11('0x39')]));_0x9848bf[_0x6f11('0x38')]=_0x9848bf[_0x6f11('0x38')][_0x6f11('0x3a')]?_0x9848bf[_0x6f11('0x38')]:_0x4f514f[_0x6f11('0x37')];if(!_0x39c976[_0x6f11('0x34')][_0x6f11('0x3b')](_0x6f11('0x3c'))){_0x9848bf[_0x6f11('0x1f')]=qs[_0x6f11('0x1f')](_0x39c976['query'][_0x6f11('0x1f')]);_0x9848bf['offset']=qs[_0x6f11('0x1d')](_0x39c976[_0x6f11('0x34')][_0x6f11('0x1d')]);}_0x9848bf['order']=qs[_0x6f11('0x3d')](_0x39c976[_0x6f11('0x34')][_0x6f11('0x3d')]);_0x9848bf['where']=qs[_0x6f11('0x35')](_[_0x6f11('0x3e')](_0x39c976[_0x6f11('0x34')],_0x4f514f[_0x6f11('0x35')]),_0x1d959e);if(_0x39c976[_0x6f11('0x34')]['filter']){_0x9848bf[_0x6f11('0x3f')]=_[_0x6f11('0x40')](_0x9848bf[_0x6f11('0x3f')],{'$or':_[_0x6f11('0x31')](_0x1d959e,function(_0x5c8fed){if(_0x5c8fed[_0x6f11('0x41')]!=='VIRTUAL'){var _0x5d59ed={};_0x5d59ed[_0x5c8fed['name']]={'$like':'%'+_0x39c976['query'][_0x6f11('0x42')]+'%'};return _0x5d59ed;}})});}_0x9848bf=_['merge']({},_0x9848bf,_0x39c976[_0x6f11('0x43')]);var _0x2218e7={'where':_0x9848bf[_0x6f11('0x3f')]};return db['OpenchannelQueue'][_0x6f11('0x20')](_0x2218e7)[_0x6f11('0x27')](function(_0x7c9147){_0x537e89[_0x6f11('0x20')]=_0x7c9147;if(_0x39c976[_0x6f11('0x34')]['includeAll']){_0x9848bf[_0x6f11('0x44')]=[{'all':!![]}];}return db[_0x6f11('0x32')]['findAll'](_0x9848bf);})[_0x6f11('0x27')](function(_0x1c6bfa){_0x537e89[_0x6f11('0x45')]=_0x1c6bfa;return _0x537e89;})[_0x6f11('0x27')](respondWithFilteredResult(_0x2cbc8c,_0x9848bf))['catch'](handleError(_0x2cbc8c,null));};exports[_0x6f11('0x46')]=function(_0x5b1a10,_0x3e0658){var _0x37ec71={'raw':!![],'where':{'id':_0x5b1a10[_0x6f11('0x47')]['id']}},_0x4754ae={};_0x4754ae[_0x6f11('0x37')]=_[_0x6f11('0x48')](db[_0x6f11('0x32')]['rawAttributes']);_0x4754ae[_0x6f11('0x34')]=_['keys'](_0x5b1a10[_0x6f11('0x34')]);_0x4754ae[_0x6f11('0x35')]=_[_0x6f11('0x36')](_0x4754ae['model'],_0x4754ae[_0x6f11('0x34')]);_0x37ec71['attributes']=_[_0x6f11('0x36')](_0x4754ae['model'],qs[_0x6f11('0x39')](_0x5b1a10[_0x6f11('0x34')][_0x6f11('0x39')]));_0x37ec71[_0x6f11('0x38')]=_0x37ec71['attributes'][_0x6f11('0x3a')]?_0x37ec71[_0x6f11('0x38')]:_0x4754ae[_0x6f11('0x37')];if(_0x5b1a10[_0x6f11('0x34')][_0x6f11('0x49')]){_0x37ec71[_0x6f11('0x44')]=[{'all':!![]}];}_0x37ec71=_['merge']({},_0x37ec71,_0x5b1a10[_0x6f11('0x43')]);return db[_0x6f11('0x32')][_0x6f11('0x4a')](_0x37ec71)[_0x6f11('0x27')](handleEntityNotFound(_0x3e0658,null))[_0x6f11('0x27')](respondWithResult(_0x3e0658,null))['catch'](handleError(_0x3e0658,null));};exports[_0x6f11('0x4b')]=function(_0x2732b8,_0x559aef){return db[_0x6f11('0x32')][_0x6f11('0x4b')](_0x2732b8[_0x6f11('0x4c')],{})['then'](function(_0x375ddc){var _0x2574f1=_0x2732b8['user'][_0x6f11('0x28')]({'plain':!![]});if(!_0x2574f1)throw new Error(_0x6f11('0x4d'));if(_0x2574f1[_0x6f11('0x4e')]===_0x6f11('0x4f')){var _0xe59ee=_0x375ddc[_0x6f11('0x28')]({'plain':!![]});var _0x2ec223=_0x6f11('0x29');return db[_0x6f11('0x50')][_0x6f11('0x4a')]({'where':{'name':_0x2ec223,'userProfileId':_0x2574f1[_0x6f11('0x51')]},'raw':!![]})[_0x6f11('0x27')](function(_0x3043cd){if(_0x3043cd&&_0x3043cd[_0x6f11('0x52')]===0x0){return db[_0x6f11('0x2a')]['create']({'name':_0xe59ee[_0x6f11('0x2e')],'resourceId':_0xe59ee['id'],'type':_0x3043cd[_0x6f11('0x2e')],'sectionId':_0x3043cd['id']},{})[_0x6f11('0x27')](function(){return _0x375ddc;});}else{return _0x375ddc;}})['catch'](function(_0x46741f){logger[_0x6f11('0x2c')](_0x6f11('0x53'),_0x46741f);throw _0x46741f;});}return _0x375ddc;})[_0x6f11('0x27')](respondWithResult(_0x559aef,0xc9))[_0x6f11('0x54')](handleError(_0x559aef,null));};exports[_0x6f11('0x25')]=function(_0x2168ae,_0x2fd573){if(_0x2168ae['body']['id']){delete _0x2168ae[_0x6f11('0x4c')]['id'];}return db[_0x6f11('0x32')][_0x6f11('0x4a')]({'where':{'id':_0x2168ae[_0x6f11('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fd573,null))[_0x6f11('0x27')](saveUpdates(_0x2168ae['body'],null))[_0x6f11('0x27')](respondWithResult(_0x2fd573,null))[_0x6f11('0x54')](handleError(_0x2fd573,null));};exports['destroy']=function(_0x1815fe,_0x256455){return db[_0x6f11('0x32')][_0x6f11('0x4a')]({'where':{'id':_0x1815fe[_0x6f11('0x47')]['id']}})[_0x6f11('0x27')](handleEntityNotFound(_0x256455,null))[_0x6f11('0x27')](removeEntity(_0x256455,null))[_0x6f11('0x54')](handleError(_0x256455,null));};exports[_0x6f11('0x55')]=function(_0x51ca04,_0x592f47){return db['OpenchannelQueue']['describe']()[_0x6f11('0x27')](respondWithResult(_0x592f47,null))[_0x6f11('0x54')](handleError(_0x592f47,null));};exports[_0x6f11('0x56')]=function(_0x4899ba,_0x3752e6,_0x1690b6){var _0x5206ea={'raw':!![],'where':{}},_0x478919={},_0xa119fa;return db[_0x6f11('0x32')][_0x6f11('0x57')]({'where':{'id':_0x4899ba[_0x6f11('0x47')]['id']}})['then'](handleEntityNotFound(_0x3752e6,null))['then'](function(_0xd1b352){if(_0xd1b352){_0xa119fa=_0xd1b352[_0x6f11('0x28')]({'plain':!![]});_0x478919[_0x6f11('0x37')]=_[_0x6f11('0x48')](db[_0x6f11('0x58')][_0x6f11('0x33')]);_0x478919[_0x6f11('0x34')]=_[_0x6f11('0x48')](_0x4899ba[_0x6f11('0x34')]);_0x478919['filters']=_['intersection'](_0x478919[_0x6f11('0x37')],_0x478919[_0x6f11('0x34')]);_0x5206ea[_0x6f11('0x38')]=_[_0x6f11('0x36')](_0x478919['model'],qs[_0x6f11('0x39')](_0x4899ba[_0x6f11('0x34')]['fields']));_0x5206ea['attributes']=_0x5206ea[_0x6f11('0x38')]['length']?_0x5206ea[_0x6f11('0x38')]:_0x478919[_0x6f11('0x37')];if(!_0x4899ba[_0x6f11('0x34')][_0x6f11('0x3b')]('nolimit')){_0x5206ea[_0x6f11('0x1f')]=qs[_0x6f11('0x1f')](_0x4899ba[_0x6f11('0x34')][_0x6f11('0x1f')]);_0x5206ea['offset']=qs['offset'](_0x4899ba[_0x6f11('0x34')][_0x6f11('0x1d')]);}_0x5206ea[_0x6f11('0x59')]=qs['sort'](_0x4899ba['query']['sort']);_0x5206ea[_0x6f11('0x3f')]=qs['filters'](_[_0x6f11('0x3e')](_0x4899ba['query'],_0x478919[_0x6f11('0x35')]));_0x5206ea['where'][_0x6f11('0x5a')]=_0xd1b352['id'];if(_0x4899ba['query'][_0x6f11('0x42')]){_0x5206ea[_0x6f11('0x3f')]=_[_0x6f11('0x40')](_0x5206ea[_0x6f11('0x3f')],{'$or':_['map'](_0x5206ea[_0x6f11('0x38')],function(_0x333a7b){var _0x519a95={};_0x519a95[_0x333a7b]={'$like':'%'+_0x4899ba[_0x6f11('0x34')][_0x6f11('0x42')]+'%'};return _0x519a95;})});}_0x5206ea=_['merge']({},_0x5206ea,_0x4899ba[_0x6f11('0x43')]);return db[_0x6f11('0x58')][_0x6f11('0x5b')](_0x5206ea);}})['then'](function(_0x116165){if(_0x116165){return db['User']['findAndCountAll']({'where':{'id':_[_0x6f11('0x31')](_0x116165,_0x6f11('0x5c')),'role':_0x6f11('0x5d')},'attributes':['id','name',_0x6f11('0x5e'),'updatedAt',_0x6f11('0x5f')]});}})[_0x6f11('0x27')](function(_0x2b4e5c){if(_0x2b4e5c){return{'count':_0x2b4e5c['count'],'rows':_['map'](_0x2b4e5c[_0x6f11('0x45')],function(_0x36de14){return{'membername':_0x36de14['name'],'UserId':_0x36de14['id'],'queue_name':_0xa119fa['name'],'OpenchannelQueueId':_0xa119fa['id'],'interface':util[_0x6f11('0x60')](_0x6f11('0x61'),_0x6f11('0x62'),_0x36de14[_0x6f11('0x2e')]),'penalty':0x0,'paused':_0x36de14['openchannelPause'],'createdAt':_0x36de14['createdAt'],'updatedAt':_0x36de14[_0x6f11('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6f11('0x27')](respondWithFilteredResult(_0x3752e6,_0x5206ea))[_0x6f11('0x54')](handleError(_0x3752e6,null));};exports['getTeams']=function(_0x4cb680,_0x3461b6,_0x4e62b9){var _0x5aeee0={};var _0x204b30={};var _0x3e8c0d;var _0x3550a0;return db[_0x6f11('0x32')][_0x6f11('0x57')]({'where':{'id':_0x4cb680['params']['id']}})[_0x6f11('0x27')](handleEntityNotFound(_0x3461b6,null))[_0x6f11('0x27')](function(_0xf5ec35){if(_0xf5ec35){_0x3e8c0d=_0xf5ec35;_0x204b30[_0x6f11('0x37')]=_[_0x6f11('0x48')](db[_0x6f11('0x64')][_0x6f11('0x33')]);_0x204b30['query']=_[_0x6f11('0x48')](_0x4cb680['query']);_0x204b30[_0x6f11('0x35')]=_[_0x6f11('0x36')](_0x204b30['model'],_0x204b30[_0x6f11('0x34')]);_0x5aeee0[_0x6f11('0x38')]=_[_0x6f11('0x36')](_0x204b30['model'],qs['fields'](_0x4cb680['query'][_0x6f11('0x39')]));_0x5aeee0[_0x6f11('0x38')]=_0x5aeee0['attributes'][_0x6f11('0x3a')]?_0x5aeee0[_0x6f11('0x38')]:_0x204b30['model'];_0x5aeee0[_0x6f11('0x59')]=qs[_0x6f11('0x3d')](_0x4cb680['query']['sort']);_0x5aeee0[_0x6f11('0x3f')]=qs[_0x6f11('0x35')](_[_0x6f11('0x3e')](_0x4cb680[_0x6f11('0x34')],_0x204b30[_0x6f11('0x35')]));if(_0x4cb680[_0x6f11('0x34')]['filter']){_0x5aeee0['where']=_['merge'](_0x5aeee0[_0x6f11('0x3f')],{'$or':_[_0x6f11('0x31')](_0x5aeee0[_0x6f11('0x38')],function(_0x4a3c64){var _0x2e6c9d={};_0x2e6c9d[_0x4a3c64]={'$like':'%'+_0x4cb680[_0x6f11('0x34')][_0x6f11('0x42')]+'%'};return _0x2e6c9d;})});}_0x5aeee0=_[_0x6f11('0x40')]({},_0x5aeee0,_0x4cb680[_0x6f11('0x43')]);return _0x3e8c0d[_0x6f11('0x65')](_0x5aeee0);}})['then'](function(_0x3301b6){if(_0x3301b6){_0x3550a0=_0x3301b6[_0x6f11('0x3a')];if(!_0x4cb680[_0x6f11('0x34')][_0x6f11('0x3b')](_0x6f11('0x3c'))){_0x5aeee0[_0x6f11('0x1f')]=qs[_0x6f11('0x1f')](_0x4cb680[_0x6f11('0x34')][_0x6f11('0x1f')]);_0x5aeee0[_0x6f11('0x1d')]=qs['offset'](_0x4cb680[_0x6f11('0x34')][_0x6f11('0x1d')]);}return _0x3e8c0d['getTeams'](_0x5aeee0);}})[_0x6f11('0x27')](function(_0x2779c1){if(_0x2779c1){return _0x2779c1?{'count':_0x3550a0,'rows':_0x2779c1}:null;}})[_0x6f11('0x27')](respondWithResult(_0x3461b6,null))[_0x6f11('0x54')](handleError(_0x3461b6,null));};exports[_0x6f11('0x66')]=function(_0x6520f,_0x51684e,_0x5a52d1){var _0x171c5d=_0x6520f[_0x6f11('0x4c')][_0x6f11('0x67')];return db['Team'][_0x6f11('0x5b')]({'where':{'id':_0x171c5d},'attributes':['id'],'include':[{'model':db[_0x6f11('0x68')],'as':_0x6f11('0x69'),'attributes':['id',_0x6f11('0x2e'),_0x6f11('0x6a'),_0x6f11('0x6b'),_0x6f11('0x6c')],'raw':!![]}]})[_0x6f11('0x27')](function(_0x346937){if(_0x346937){var _0x490f83=_['flatMap'](_0x346937,function(_0x4b99d9){var _0x3a257e=_0x4b99d9[_0x6f11('0x28')]({'plain':!![]});return _0x3a257e[_0x6f11('0x69')];});return db[_0x6f11('0x32')][_0x6f11('0x4a')]({'where':{'id':_0x6520f['params']['id']}})['then'](function(_0x3319de){return db[_0x6f11('0x6d')][_0x6f11('0x6e')](function(_0x5ab0b4){return _0x3319de[_0x6f11('0x66')](_0x171c5d,{'transaction':_0x5ab0b4})[_0x6f11('0x27')](function(){return BPromise['each'](_0x490f83,function(_0x3afe21){return db[_0x6f11('0x58')]['findOrCreate']({'where':{'UserId':_0x3afe21['id'],'OpenchannelQueueId':_0x6520f[_0x6f11('0x47')]['id']},'transaction':_0x5ab0b4});});})['then'](function(){_0x490f83[_0x6f11('0x6f')](function(_0x100bd5){socket[_0x6f11('0x70')](_0x6f11('0x71'),{'UserId':_0x100bd5['id'],'OpenchannelQueueId':_0x3319de['id']});});});});});}})['then'](respondWithStatusCode(_0x51684e,null))[_0x6f11('0x54')](handleError(_0x51684e,null));};exports[_0x6f11('0x72')]=function(_0xbe42b6,_0x1a1dd4,_0x26f237){return db[_0x6f11('0x64')][_0x6f11('0x5b')]({'where':{'id':_0xbe42b6[_0x6f11('0x34')][_0x6f11('0x67')]},'attributes':['id'],'include':[{'model':db[_0x6f11('0x68')],'as':_0x6f11('0x69'),'attributes':['id'],'raw':!![]}]})[_0x6f11('0x27')](handleEntityNotFound(_0x1a1dd4,null))[_0x6f11('0x27')](function(_0x248f09){var _0x4726bb=_[_0x6f11('0x31')](_0x248f09,'id');var _0x4b9edd=[];var _0x5f276f=[];var _0x56a2ea=squel['select']();_0x56a2ea['field']('tq.TeamId')['from'](_0x6f11('0x73'),'tq')[_0x6f11('0x74')](_0x6f11('0x75'),'ut',_0x6f11('0x76'))[_0x6f11('0x3f')](_0x6f11('0x77'),_0xbe42b6[_0x6f11('0x47')]['id']);for(var _0x34add0=0x0;_0x34add0<_0x248f09['length'];_0x34add0+=0x1){let _0x5c636c=_0x248f09[_0x34add0];for(var _0x200fab=0x0;_0x200fab<_0x5c636c[_0x6f11('0x69')][_0x6f11('0x3a')];_0x200fab+=0x1){let _0x1e7784=_0x5c636c['Agents'][_0x200fab];var _0x58313e=_0x56a2ea['clone']();_0x58313e[_0x6f11('0x3f')](_0x6f11('0x78'),_0x1e7784['id']);_0x5f276f[_0x6f11('0x79')](db['sequelize'][_0x6f11('0x34')](_0x58313e[_0x6f11('0x7a')](),{'type':db[_0x6f11('0x6d')]['QueryTypes'][_0x6f11('0x7b')]})[_0x6f11('0x27')](function(_0x46b9b9){if(_0x46b9b9[_0x6f11('0x3a')]===0x1){return _0x1e7784['id'];}else{var _0x11ac91=_[_0x6f11('0x7c')](_[_0x6f11('0x31')](_0x46b9b9,_0x6f11('0x7d')),function(_0x1794f7){return _[_0x6f11('0x7e')](_0x4726bb,_0x1794f7);});if(_0x11ac91){return _0x1e7784['id'];}}}));}}return BPromise[_0x6f11('0x7f')](_0x5f276f)[_0x6f11('0x27')](function(_0x5b47cd){_0x4b9edd=_(_0x4b9edd)[_0x6f11('0x80')](_0x5b47cd)['compact']()[_0x6f11('0x81')]();return db['OpenchannelQueue']['find']({'where':{'id':_0xbe42b6[_0x6f11('0x47')]['id']}})['then'](function(_0x503787){return db[_0x6f11('0x6d')][_0x6f11('0x6e')](function(_0x121a5e){return _0x503787[_0x6f11('0x72')](_0xbe42b6['query']['ids'],{'transaction':_0x121a5e})[_0x6f11('0x27')](function(){if(!_['isEmpty'](_0x4b9edd)){return _0x503787['removeAgents'](_0x4b9edd,{'transaction':_0x121a5e});}})[_0x6f11('0x27')](function(){_0x4b9edd['forEach'](function(_0xc9a800){socket[_0x6f11('0x70')](_0x6f11('0x82'),{'UserId':_0xc9a800,'OpenchannelQueueId':_0x503787['id']});});});});});});})['then'](respondWithStatusCode(_0x1a1dd4,null))[_0x6f11('0x54')](handleError(_0x1a1dd4,null));};exports[_0x6f11('0x83')]=function(_0x39cf7b,_0x6ca0a2,_0x2f12af){return db['OpenchannelQueue'][_0x6f11('0x4a')]({'where':{'id':_0x39cf7b[_0x6f11('0x47')]['id']}})['then'](handleEntityNotFound(_0x6ca0a2,null))['then'](function(_0x4f28ca){if(_0x4f28ca){return _0x4f28ca[_0x6f11('0x83')](_0x39cf7b[_0x6f11('0x4c')][_0x6f11('0x67')],_['omit'](_0x39cf7b[_0x6f11('0x4c')],[_0x6f11('0x67'),'id'])||{})['spread'](function(_0xbc99dd){for(var _0x1ee72a=0x0;_0x1ee72a<_0x39cf7b[_0x6f11('0x4c')][_0x6f11('0x67')][_0x6f11('0x3a')];_0x1ee72a+=0x1){socket[_0x6f11('0x70')](_0x6f11('0x71'),{'UserId':Number(_0x39cf7b[_0x6f11('0x4c')]['ids'][_0x1ee72a]),'OpenchannelQueueId':Number(_0x39cf7b[_0x6f11('0x47')]['id'])});}return _0xbc99dd;});}})[_0x6f11('0x27')](respondWithResult(_0x6ca0a2,null))[_0x6f11('0x54')](handleError(_0x6ca0a2,null));};exports[_0x6f11('0x84')]=function(_0x463d17,_0x1678bc,_0x3485cf){return db['OpenchannelQueue'][_0x6f11('0x4a')]({'where':{'id':_0x463d17['params']['id']}})[_0x6f11('0x27')](handleEntityNotFound(_0x1678bc,null))[_0x6f11('0x27')](function(_0x496f5c){if(_0x496f5c){return _0x496f5c['removeAgents'](_0x463d17[_0x6f11('0x34')][_0x6f11('0x67')])[_0x6f11('0x27')](function(){if(_['isArray'](_0x463d17[_0x6f11('0x34')][_0x6f11('0x67')])){for(var _0x13fa7a=0x0;_0x13fa7a<_0x463d17[_0x6f11('0x34')][_0x6f11('0x67')][_0x6f11('0x3a')];_0x13fa7a+=0x1){socket[_0x6f11('0x70')](_0x6f11('0x82'),{'UserId':Number(_0x463d17['query'][_0x6f11('0x67')][_0x13fa7a]),'OpenchannelQueueId':Number(_0x463d17[_0x6f11('0x47')]['id'])});}}else{socket[_0x6f11('0x70')](_0x6f11('0x82'),{'UserId':Number(_0x463d17['query'][_0x6f11('0x67')]),'OpenchannelQueueId':Number(_0x463d17['params']['id'])});}});}})[_0x6f11('0x27')](respondWithStatusCode(_0x1678bc,null))[_0x6f11('0x54')](handleError(_0x1678bc,null));};exports[_0x6f11('0x85')]=function(_0x5482f9,_0x4d07c3,_0x26910e){var _0x4e5c3d={};var _0x322356={};var _0x565476;var _0x5ba0c3;return db[_0x6f11('0x32')][_0x6f11('0x57')]({'where':{'id':_0x5482f9[_0x6f11('0x47')]['id']}})[_0x6f11('0x27')](handleEntityNotFound(_0x4d07c3,null))[_0x6f11('0x27')](function(_0x1b6dbe){if(_0x1b6dbe){_0x565476=_0x1b6dbe;_0x322356[_0x6f11('0x37')]=_[_0x6f11('0x48')](db[_0x6f11('0x68')]['rawAttributes']);_0x322356[_0x6f11('0x34')]=_['keys'](_0x5482f9[_0x6f11('0x34')]);_0x322356['filters']=_[_0x6f11('0x36')](_0x322356[_0x6f11('0x37')],_0x322356[_0x6f11('0x34')]);_0x4e5c3d['attributes']=_['intersection'](_0x322356[_0x6f11('0x37')],qs[_0x6f11('0x39')](_0x5482f9[_0x6f11('0x34')]['fields']));_0x4e5c3d[_0x6f11('0x38')]=_0x4e5c3d[_0x6f11('0x38')]['length']?_0x4e5c3d[_0x6f11('0x38')]:_0x322356[_0x6f11('0x37')];_0x4e5c3d['order']=qs['sort'](_0x5482f9['query']['sort']);_0x4e5c3d['where']=qs['filters'](_['pick'](_0x5482f9[_0x6f11('0x34')],_0x322356['filters']));if(_0x5482f9[_0x6f11('0x34')]['filter']){_0x4e5c3d['where']=_['merge'](_0x4e5c3d[_0x6f11('0x3f')],{'$or':_['map'](_0x4e5c3d[_0x6f11('0x38')],function(_0x24049b){var _0x70cd92={};_0x70cd92[_0x24049b]={'$like':'%'+_0x5482f9['query'][_0x6f11('0x42')]+'%'};return _0x70cd92;})});}_0x4e5c3d=_[_0x6f11('0x40')]({},_0x4e5c3d,_0x5482f9['options']);return _0x565476[_0x6f11('0x85')](_0x4e5c3d);}})[_0x6f11('0x27')](function(_0x8eb97){if(_0x8eb97){_0x5ba0c3=_0x8eb97['length'];if(!_0x5482f9[_0x6f11('0x34')]['hasOwnProperty'](_0x6f11('0x3c'))){_0x4e5c3d['limit']=qs[_0x6f11('0x1f')](_0x5482f9[_0x6f11('0x34')]['limit']);_0x4e5c3d['offset']=qs[_0x6f11('0x1d')](_0x5482f9[_0x6f11('0x34')]['offset']);}return _0x565476[_0x6f11('0x85')](_0x4e5c3d);}})['then'](function(_0x51ed12){if(_0x51ed12){return _0x51ed12?{'count':_0x5ba0c3,'rows':_0x51ed12}:null;}})[_0x6f11('0x27')](respondWithResult(_0x4d07c3,null))[_0x6f11('0x54')](handleError(_0x4d07c3,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 993c6fb..10d67db 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 _0x15cb=['emit','hasOwnProperty','exports','../../mysqldb','update','remove'];(function(_0x34128e,_0x4124ea){var _0x186f86=function(_0x2846ff){while(--_0x2846ff){_0x34128e['push'](_0x34128e['shift']());}};_0x186f86(++_0x4124ea);}(_0x15cb,0x147));var _0xb15c=function(_0x4bbcd7,_0x400f15){_0x4bbcd7=_0x4bbcd7-0x0;var _0x56e720=_0x15cb[_0x4bbcd7];return _0x56e720;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xb15c('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb15c('0x1'),'afterDestroy':_0xb15c('0x2')};function emitEvent(_0x286b19){return function(_0x562f78,_0x21c637,_0x7a308b){OpenchannelQueueEvents[_0xb15c('0x3')](_0x286b19+':'+_0x562f78['id'],_0x562f78);OpenchannelQueueEvents[_0xb15c('0x3')](_0x286b19,_0x562f78);_0x7a308b(null);};}for(var e in events){if(events[_0xb15c('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xb15c('0x5')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x888a=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x3556b1,_0x4e84a7){var _0xcad360=function(_0x444b2c){while(--_0x444b2c){_0x3556b1['push'](_0x3556b1['shift']());}};_0xcad360(++_0x4e84a7);}(_0x888a,0x11c));var _0xa888=function(_0x586f51,_0x369eab){_0x586f51=_0x586f51-0x0;var _0x1518c0=_0x888a[_0x586f51];return _0x1518c0;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xa888('0x0'))['db'][_0xa888('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa888('0x2')](0x0);var events={'afterCreate':_0xa888('0x3'),'afterUpdate':_0xa888('0x4'),'afterDestroy':_0xa888('0x5')};function emitEvent(_0x2bf16b){return function(_0x5ec4ca,_0x16015a,_0x5dda18){OpenchannelQueueEvents[_0xa888('0x6')](_0x2bf16b+':'+_0x5ec4ca['id'],_0x5ec4ca);OpenchannelQueueEvents[_0xa888('0x6')](_0x2bf16b,_0x5ec4ca);_0x5dda18(null);};}for(var e in events){if(events[_0xa888('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xa888('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 53f0603..f21c54f 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 _0x8571=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','lodash'];(function(_0x206ad4,_0x15e511){var _0x1a4b91=function(_0x31fd78){while(--_0x31fd78){_0x206ad4['push'](_0x206ad4['shift']());}};_0x1a4b91(++_0x15e511);}(_0x8571,0x149));var _0x1857=function(_0x4c8891,_0x51fe93){_0x4c8891=_0x4c8891-0x0;var _0x171fca=_0x8571[_0x4c8891];return _0x171fca;};'use strict';var _=require(_0x1857('0x0'));var util=require(_0x1857('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1857('0x2'));var BPromise=require(_0x1857('0x3'));var rp=require(_0x1857('0x4'));var fs=require('fs');var path=require(_0x1857('0x5'));var rimraf=require(_0x1857('0x6'));var config=require(_0x1857('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x1857('0x8')]=function(_0x3ee6bf,_0x4c875f){return _0x3ee6bf[_0x1857('0x9')](_0x1857('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02b8=['./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4059b6,_0xc68ef8){var _0x538999=function(_0x2fc169){while(--_0x2fc169){_0x4059b6['push'](_0x4059b6['shift']());}};_0x538999(++_0xc68ef8);}(_0x02b8,0x1e5));var _0x802b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x02b8[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x802b('0x0'));var util=require(_0x802b('0x1'));var logger=require(_0x802b('0x2'))('api');var moment=require(_0x802b('0x3'));var BPromise=require(_0x802b('0x4'));var rp=require(_0x802b('0x5'));var fs=require('fs');var path=require(_0x802b('0x6'));var rimraf=require(_0x802b('0x7'));var config=require(_0x802b('0x8'));var attributes=require(_0x802b('0x9'));module[_0x802b('0xa')]=function(_0x51a8cc,_0x4e267e){return _0x51a8cc[_0x802b('0xb')]('OpenchannelQueue',attributes,{'tableName':_0x802b('0xc'),'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 2a1eccb..c46fac3 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 _0x5bcb=['GetOpenchannelQueue','findAll','options','raw','where','limit','include','map','attributes','model','then','debug','catch','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x1809a8,_0x279c18){var _0x5af15e=function(_0x564b3a){while(--_0x564b3a){_0x1809a8['push'](_0x1809a8['shift']());}};_0x5af15e(++_0x279c18);}(_0x5bcb,0x1e2));var _0xb5bc=function(_0x1d650e,_0x48edb5){_0x1d650e=_0x1d650e-0x0;var _0x33ca61=_0x5bcb[_0x1d650e];return _0x33ca61;};'use strict';var _=require('lodash');var util=require(_0xb5bc('0x0'));var moment=require(_0xb5bc('0x1'));var BPromise=require(_0xb5bc('0x2'));var rs=require(_0xb5bc('0x3'));var fs=require('fs');var Redis=require(_0xb5bc('0x4'));var db=require(_0xb5bc('0x5'))['db'];var utils=require(_0xb5bc('0x6'));var logger=require(_0xb5bc('0x7'))(_0xb5bc('0x8'));var config=require(_0xb5bc('0x9'));var jayson=require(_0xb5bc('0xa'));var client=jayson[_0xb5bc('0xb')]['http']({'port':0x232a});config[_0xb5bc('0xc')]=_[_0xb5bc('0xd')](config[_0xb5bc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5bc('0xe'))(new Redis(config[_0xb5bc('0xc')]));require(_0xb5bc('0xf'))[_0xb5bc('0x10')](socket);function respondWithRpcPromise(_0x5f3679,_0xd8a463,_0x32f989){return new BPromise(function(_0x1172b9,_0xb012f1){return client[_0xb5bc('0x11')](_0x5f3679,_0x32f989)['then'](function(_0x31ed7e){logger[_0xb5bc('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0xd8a463,_0xb5bc('0x13'));logger['debug'](_0xb5bc('0x14'),_0xd8a463,_0xb5bc('0x13'),JSON[_0xb5bc('0x15')](_0x31ed7e));if(_0x31ed7e[_0xb5bc('0x16')]){if(_0x31ed7e[_0xb5bc('0x16')]['code']===0x1f4){logger['error'](_0xb5bc('0x17'),_0xd8a463,_0x31ed7e[_0xb5bc('0x16')][_0xb5bc('0x18')]);return _0xb012f1(_0x31ed7e[_0xb5bc('0x16')][_0xb5bc('0x18')]);}logger[_0xb5bc('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0xd8a463,_0x31ed7e[_0xb5bc('0x16')][_0xb5bc('0x18')]);return _0x1172b9(_0x31ed7e['error'][_0xb5bc('0x18')]);}else{logger[_0xb5bc('0x12')](_0xb5bc('0x17'),_0xd8a463,_0xb5bc('0x13'));_0x1172b9(_0x31ed7e['result'][_0xb5bc('0x18')]);}})['catch'](function(_0x496ea5){logger[_0xb5bc('0x16')](_0xb5bc('0x17'),_0xd8a463,_0x496ea5);_0xb012f1(_0x496ea5);});});}exports[_0xb5bc('0x19')]=function(_0x2d3ef5){var _0x2cf7ee=this;return new Promise(function(_0x9d399e,_0x3f09ef){return db['OpenchannelQueue'][_0xb5bc('0x1a')]({'raw':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5[_0xb5bc('0x1b')][_0xb5bc('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5['options'][_0xb5bc('0x1d')]||null:null,'attributes':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5['options']['attributes']||null:null,'limit':_0x2d3ef5['options']?_0x2d3ef5[_0xb5bc('0x1b')][_0xb5bc('0x1e')]||null:null,'include':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5['options'][_0xb5bc('0x1f')]?_[_0xb5bc('0x20')](_0x2d3ef5[_0xb5bc('0x1b')][_0xb5bc('0x1f')],function(_0x55eff3){return{'model':db[_0x55eff3['model']],'as':_0x55eff3['as'],'attributes':_0x55eff3[_0xb5bc('0x21')],'include':_0x55eff3[_0xb5bc('0x1f')]?_['map'](_0x55eff3['include'],function(_0x53a01e){return{'model':db[_0x53a01e[_0xb5bc('0x22')]],'as':_0x53a01e['as'],'attributes':_0x53a01e[_0xb5bc('0x21')],'include':_0x53a01e['include']?_[_0xb5bc('0x20')](_0x53a01e[_0xb5bc('0x1f')],function(_0x563de0){return{'model':db[_0x563de0[_0xb5bc('0x22')]],'as':_0x563de0['as'],'attributes':_0x563de0['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5bc('0x23')](function(_0x380085){logger[_0xb5bc('0x12')](_0xb5bc('0x19'),_0x2d3ef5);logger[_0xb5bc('0x24')](_0xb5bc('0x19'),_0x2d3ef5,JSON[_0xb5bc('0x15')](_0x380085));_0x9d399e(_0x380085);})[_0xb5bc('0x25')](function(_0x5c4845){logger['error'](_0xb5bc('0x19'),_0x5c4845['message'],_0x2d3ef5);_0x3f09ef(_0x2cf7ee[_0xb5bc('0x16')](0x1f4,_0x5c4845[_0xb5bc('0x18')]));});});};exports[_0xb5bc('0x26')]=function(_0xc8f6e3){var _0x266448=this;return new Promise(function(_0x54027a,_0x338028){return db['OpenchannelQueue']['find']({'raw':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3['options'][_0xb5bc('0x1c')]===undefined?!![]:![]:!![],'where':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3[_0xb5bc('0x1b')]['where']||null:null,'attributes':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3[_0xb5bc('0x1b')][_0xb5bc('0x21')]||null:null,'include':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3[_0xb5bc('0x1b')][_0xb5bc('0x1f')]?_[_0xb5bc('0x20')](_0xc8f6e3[_0xb5bc('0x1b')][_0xb5bc('0x1f')],function(_0x141c2d){return{'model':db[_0x141c2d[_0xb5bc('0x22')]],'as':_0x141c2d['as'],'attributes':_0x141c2d[_0xb5bc('0x21')],'include':_0x141c2d['include']?_[_0xb5bc('0x20')](_0x141c2d[_0xb5bc('0x1f')],function(_0x4e4d10){return{'model':db[_0x4e4d10[_0xb5bc('0x22')]],'as':_0x4e4d10['as'],'attributes':_0x4e4d10['attributes'],'include':_0x4e4d10['include']?_[_0xb5bc('0x20')](_0x4e4d10[_0xb5bc('0x1f')],function(_0x3d64f3){return{'model':db[_0x3d64f3['model']],'as':_0x3d64f3['as'],'attributes':_0x3d64f3['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5bc('0x23')](function(_0x5d4b1d){logger[_0xb5bc('0x12')](_0xb5bc('0x26'),_0xc8f6e3);logger[_0xb5bc('0x24')](_0xb5bc('0x26'),_0xc8f6e3,JSON[_0xb5bc('0x15')](_0x5d4b1d));_0x54027a(_0x5d4b1d);})[_0xb5bc('0x25')](function(_0x571cce){logger[_0xb5bc('0x16')](_0xb5bc('0x26'),_0x571cce[_0xb5bc('0x18')],_0xc8f6e3);_0x338028(_0x266448[_0xb5bc('0x16')](0x1f4,_0x571cce[_0xb5bc('0x18')]));});});}; \ No newline at end of file +var _0x7a09=['request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','find','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x2e62c1,_0x2469d5){var _0x123212=function(_0x3bcb98){while(--_0x3bcb98){_0x2e62c1['push'](_0x2e62c1['shift']());}};_0x123212(++_0x2469d5);}(_0x7a09,0x1dd));var _0x97a0=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x7a09[_0x5c5c52];return _0x4229ff;};'use strict';var _=require(_0x97a0('0x0'));var util=require(_0x97a0('0x1'));var moment=require(_0x97a0('0x2'));var BPromise=require('bluebird');var rs=require(_0x97a0('0x3'));var fs=require('fs');var Redis=require(_0x97a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97a0('0x5'));var logger=require(_0x97a0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x97a0('0x7'));var client=jayson[_0x97a0('0x8')][_0x97a0('0x9')]({'port':0x232a});config[_0x97a0('0xa')]=_[_0x97a0('0xb')](config[_0x97a0('0xa')],{'host':_0x97a0('0xc'),'port':0x18eb});var socket=require(_0x97a0('0xd'))(new Redis(config[_0x97a0('0xa')]));require('./openchannelQueue.socket')[_0x97a0('0xe')](socket);function respondWithRpcPromise(_0x10a0b2,_0xa9b231,_0x5908d7){return new BPromise(function(_0x24896e,_0x42438b){return client[_0x97a0('0xf')](_0x10a0b2,_0x5908d7)[_0x97a0('0x10')](function(_0x2541a0){logger[_0x97a0('0x11')](_0x97a0('0x12'),_0xa9b231,_0x97a0('0x13'));logger['debug'](_0x97a0('0x14'),_0xa9b231,_0x97a0('0x13'),JSON[_0x97a0('0x15')](_0x2541a0));if(_0x2541a0[_0x97a0('0x16')]){if(_0x2541a0[_0x97a0('0x16')][_0x97a0('0x17')]===0x1f4){logger[_0x97a0('0x16')](_0x97a0('0x12'),_0xa9b231,_0x2541a0['error'][_0x97a0('0x18')]);return _0x42438b(_0x2541a0['error'][_0x97a0('0x18')]);}logger[_0x97a0('0x16')](_0x97a0('0x12'),_0xa9b231,_0x2541a0[_0x97a0('0x16')][_0x97a0('0x18')]);return _0x24896e(_0x2541a0[_0x97a0('0x16')][_0x97a0('0x18')]);}else{logger['info'](_0x97a0('0x12'),_0xa9b231,_0x97a0('0x13'));_0x24896e(_0x2541a0[_0x97a0('0x19')][_0x97a0('0x18')]);}})[_0x97a0('0x1a')](function(_0x546ddb){logger[_0x97a0('0x16')](_0x97a0('0x12'),_0xa9b231,_0x546ddb);_0x42438b(_0x546ddb);});});}exports[_0x97a0('0x1b')]=function(_0x3c97c8){var _0x886b7e=this;return new Promise(function(_0x32286a,_0x417cd8){return db[_0x97a0('0x1c')][_0x97a0('0x1d')]({'raw':_0x3c97c8[_0x97a0('0x1e')]?_0x3c97c8[_0x97a0('0x1e')][_0x97a0('0x1f')]===undefined?!![]:![]:!![],'where':_0x3c97c8[_0x97a0('0x1e')]?_0x3c97c8[_0x97a0('0x1e')][_0x97a0('0x20')]||null:null,'attributes':_0x3c97c8['options']?_0x3c97c8[_0x97a0('0x1e')][_0x97a0('0x21')]||null:null,'limit':_0x3c97c8['options']?_0x3c97c8[_0x97a0('0x1e')][_0x97a0('0x22')]||null:null,'include':_0x3c97c8[_0x97a0('0x1e')]?_0x3c97c8[_0x97a0('0x1e')][_0x97a0('0x23')]?_['map'](_0x3c97c8[_0x97a0('0x1e')]['include'],function(_0x40b258){return{'model':db[_0x40b258[_0x97a0('0x24')]],'as':_0x40b258['as'],'attributes':_0x40b258['attributes'],'include':_0x40b258[_0x97a0('0x23')]?_[_0x97a0('0x25')](_0x40b258[_0x97a0('0x23')],function(_0x246b95){return{'model':db[_0x246b95[_0x97a0('0x24')]],'as':_0x246b95['as'],'attributes':_0x246b95['attributes'],'include':_0x246b95[_0x97a0('0x23')]?_[_0x97a0('0x25')](_0x246b95[_0x97a0('0x23')],function(_0x23df0b){return{'model':db[_0x23df0b[_0x97a0('0x24')]],'as':_0x23df0b['as'],'attributes':_0x23df0b[_0x97a0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x97a0('0x10')](function(_0x4a2989){logger[_0x97a0('0x11')](_0x97a0('0x1b'),_0x3c97c8);logger[_0x97a0('0x26')]('GetOpenchannelQueue',_0x3c97c8,JSON['stringify'](_0x4a2989));_0x32286a(_0x4a2989);})[_0x97a0('0x1a')](function(_0x23068a){logger[_0x97a0('0x16')](_0x97a0('0x1b'),_0x23068a['message'],_0x3c97c8);_0x417cd8(_0x886b7e[_0x97a0('0x16')](0x1f4,_0x23068a[_0x97a0('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x400a7b){var _0x4dd16a=this;return new Promise(function(_0x439a93,_0x59275e){return db[_0x97a0('0x1c')][_0x97a0('0x27')]({'raw':_0x400a7b['options']?_0x400a7b[_0x97a0('0x1e')][_0x97a0('0x1f')]===undefined?!![]:![]:!![],'where':_0x400a7b['options']?_0x400a7b[_0x97a0('0x1e')]['where']||null:null,'attributes':_0x400a7b['options']?_0x400a7b[_0x97a0('0x1e')]['attributes']||null:null,'include':_0x400a7b['options']?_0x400a7b['options']['include']?_[_0x97a0('0x25')](_0x400a7b[_0x97a0('0x1e')]['include'],function(_0x5d0038){return{'model':db[_0x5d0038[_0x97a0('0x24')]],'as':_0x5d0038['as'],'attributes':_0x5d0038[_0x97a0('0x21')],'include':_0x5d0038[_0x97a0('0x23')]?_[_0x97a0('0x25')](_0x5d0038[_0x97a0('0x23')],function(_0x4906aa){return{'model':db[_0x4906aa[_0x97a0('0x24')]],'as':_0x4906aa['as'],'attributes':_0x4906aa[_0x97a0('0x21')],'include':_0x4906aa['include']?_['map'](_0x4906aa['include'],function(_0x5d3ac8){return{'model':db[_0x5d3ac8['model']],'as':_0x5d3ac8['as'],'attributes':_0x5d3ac8['attributes']};}):[]};}):[]};}):[]:[]})[_0x97a0('0x10')](function(_0x33f812){logger[_0x97a0('0x11')](_0x97a0('0x28'),_0x400a7b);logger[_0x97a0('0x26')](_0x97a0('0x28'),_0x400a7b,JSON[_0x97a0('0x15')](_0x33f812));_0x439a93(_0x33f812);})[_0x97a0('0x1a')](function(_0x7439cd){logger[_0x97a0('0x16')](_0x97a0('0x28'),_0x7439cd[_0x97a0('0x18')],_0x400a7b);_0x59275e(_0x4dd16a['error'](0x1f4,_0x7439cd['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f801690..6a871c2 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 _0x8b0e=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8b0e,0xe4));var _0xe8b0=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x8b0e[_0x37ded3];return _0x51e49e;};'use strict';var OpenchannelQueueEvents=require(_0xe8b0('0x0'));var events=[_0xe8b0('0x1'),_0xe8b0('0x2'),_0xe8b0('0x3')];function createListener(_0xa2c6ac,_0x3fc385){return function(_0x11103f){_0x3fc385[_0xe8b0('0x4')](_0xa2c6ac,_0x11103f);};}function removeListener(_0x32b943,_0x3740a1){return function(){OpenchannelQueueEvents[_0xe8b0('0x5')](_0x32b943,_0x3740a1);};}exports[_0xe8b0('0x6')]=function(_0x3b7e0e){for(var _0x274135=0x0,_0x18a475=events[_0xe8b0('0x7')];_0x274135<_0x18a475;_0x274135++){var _0x1f1934=events[_0x274135];var _0x4f5130=createListener(_0xe8b0('0x8')+_0x1f1934,_0x3b7e0e);OpenchannelQueueEvents['on'](_0x1f1934,_0x4f5130);}}; \ No newline at end of file +var _0xa864=['length','./openchannelQueue.events','update','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa864,0x14b));var _0x4a86=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xa864[_0x421196];return _0x2738af;};'use strict';var OpenchannelQueueEvents=require(_0x4a86('0x0'));var events=['save','remove',_0x4a86('0x1')];function createListener(_0x1cf2d4,_0x4fe5fb){return function(_0x729cac){_0x4fe5fb['emit'](_0x1cf2d4,_0x729cac);};}function removeListener(_0x23f895,_0x4f64ca){return function(){OpenchannelQueueEvents[_0x4a86('0x2')](_0x23f895,_0x4f64ca);};}exports[_0x4a86('0x3')]=function(_0x457c7c){for(var _0x54251e=0x0,_0x25eab2=events[_0x4a86('0x4')];_0x54251e<_0x25eab2;_0x54251e++){var _0x423f7b=events[_0x54251e];var _0x3afea6=createListener('openchannelQueue:'+_0x423f7b,_0x457c7c);OpenchannelQueueEvents['on'](_0x423f7b,_0x3afea6);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 03b6455..5f2ff7d 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 _0x5377=['create','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post'];(function(_0x1a1943,_0x4fe116){var _0x29bf7d=function(_0xdf831b){while(--_0xdf831b){_0x1a1943['push'](_0x1a1943['shift']());}};_0x29bf7d(++_0x4fe116);}(_0x5377,0xd5));var _0x7537=function(_0x56382b,_0x446555){_0x56382b=_0x56382b-0x0;var _0x2dded7=_0x5377[_0x56382b];return _0x2dded7;};'use strict';var multer=require(_0x7537('0x0'));var util=require(_0x7537('0x1'));var path=require('path');var timeout=require(_0x7537('0x2'));var express=require('express');var router=express[_0x7537('0x3')]();var fs_extra=require(_0x7537('0x4'));var auth=require(_0x7537('0x5'));var interaction=require(_0x7537('0x6'));var config=require('../../config/environment');var controller=require(_0x7537('0x7'));router['get']('/',auth[_0x7537('0x8')](),controller[_0x7537('0x9')]);router[_0x7537('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x7537('0xb')]);router[_0x7537('0xa')](_0x7537('0xc'),auth[_0x7537('0x8')](),controller[_0x7537('0xd')]);router[_0x7537('0xe')]('/',auth['isAuthenticated'](),controller[_0x7537('0xf')]);router['put'](_0x7537('0xc'),auth[_0x7537('0x8')](),controller[_0x7537('0x10')]);router[_0x7537('0x11')](_0x7537('0xc'),auth[_0x7537('0x8')](),controller['destroy']);module[_0x7537('0x12')]=router; \ No newline at end of file +var _0x227d=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x227d,0x1ce));var _0xd227=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x227d[_0x287a47];return _0x3fb726;};'use strict';var multer=require(_0xd227('0x0'));var util=require(_0xd227('0x1'));var path=require(_0xd227('0x2'));var timeout=require(_0xd227('0x3'));var express=require('express');var router=express[_0xd227('0x4')]();var fs_extra=require(_0xd227('0x5'));var auth=require(_0xd227('0x6'));var interaction=require(_0xd227('0x7'));var config=require(_0xd227('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0xd227('0x9')]('/',auth['isAuthenticated'](),controller[_0xd227('0xa')]);router[_0xd227('0x9')](_0xd227('0xb'),auth[_0xd227('0xc')](),controller[_0xd227('0xd')]);router[_0xd227('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd227('0xe')]);router[_0xd227('0xf')]('/',auth[_0xd227('0xc')](),controller[_0xd227('0x10')]);router[_0xd227('0x11')](_0xd227('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xd227('0x13')](_0xd227('0x12'),auth[_0xd227('0xc')](),controller[_0xd227('0x14')]);module[_0xd227('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 707f4e0..fc3c7c6 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 _0xdd50=['STRING','DATE','sequelize','exports'];(function(_0x2f8177,_0x1bb2a9){var _0x249cb4=function(_0x22929f){while(--_0x22929f){_0x2f8177['push'](_0x2f8177['shift']());}};_0x249cb4(++_0x1bb2a9);}(_0xdd50,0x172));var _0x0dd5=function(_0x3cec45,_0x37d817){_0x3cec45=_0x3cec45-0x0;var _0x51d691=_0xdd50[_0x3cec45];return _0x51d691;};'use strict';var moment=require('moment');var Sequelize=require(_0x0dd5('0x0'));module[_0x0dd5('0x1')]={'uniqueid':{'type':Sequelize[_0x0dd5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0dd5('0x2')]},'joinAt':{'type':Sequelize[_0x0dd5('0x3')]},'leaveAt':{'type':Sequelize[_0x0dd5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x98b5=['STRING','DATE','sequelize'];(function(_0x2fbd0e,_0x3460a9){var _0x481c9f=function(_0x4bc402){while(--_0x4bc402){_0x2fbd0e['push'](_0x2fbd0e['shift']());}};_0x481c9f(++_0x3460a9);}(_0x98b5,0x98));var _0x598b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x98b5[_0x4a9fb1];return _0x348672;};'use strict';var moment=require('moment');var Sequelize=require(_0x598b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x598b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x598b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x598b('0x2')]},'acceptAt':{'type':Sequelize[_0x598b('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x598b('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 09daad1..934cb9f 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 _0x1cab=['set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit'];(function(_0xb6e257,_0x445cd7){var _0x33b778=function(_0x28ba38){while(--_0x28ba38){_0xb6e257['push'](_0xb6e257['shift']());}};_0x33b778(++_0x445cd7);}(_0x1cab,0x1ab));var _0xb1ca=function(_0x127f93,_0x1e1587){_0x127f93=_0x127f93-0x0;var _0x168a0a=_0x1cab[_0x127f93];return _0x168a0a;};'use strict';var emlformat=require(_0xb1ca('0x0'));var rimraf=require(_0xb1ca('0x1'));var zipdir=require(_0xb1ca('0x2'));var jsonpatch=require(_0xb1ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb1ca('0x4'));var Mustache=require(_0xb1ca('0x5'));var util=require(_0xb1ca('0x6'));var path=require(_0xb1ca('0x7'));var sox=require(_0xb1ca('0x8'));var csv=require('to-csv');var ejs=require(_0xb1ca('0x9'));var fs=require('fs');var fs_extra=require(_0xb1ca('0xa'));var _=require(_0xb1ca('0xb'));var squel=require(_0xb1ca('0xc'));var crypto=require(_0xb1ca('0xd'));var jsforce=require(_0xb1ca('0xe'));var deskjs=require(_0xb1ca('0xf'));var toCsv=require(_0xb1ca('0x10'));var querystring=require(_0xb1ca('0x11'));var Papa=require(_0xb1ca('0x12'));var Redis=require(_0xb1ca('0x13'));var authService=require(_0xb1ca('0x14'));var qs=require(_0xb1ca('0x15'));var as=require(_0xb1ca('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1ca('0x17'))(_0xb1ca('0x18'));var utils=require(_0xb1ca('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb1ca('0x1a'))['db'];function respondWithStatusCode(_0x5cfa05,_0x3cca53){_0x3cca53=_0x3cca53||0xcc;return function(_0x2be26b){if(_0x2be26b){return _0x5cfa05[_0xb1ca('0x1b')](_0x3cca53);}return _0x5cfa05['status'](_0x3cca53)[_0xb1ca('0x1c')]();};}function respondWithResult(_0x26e902,_0x11f950){_0x11f950=_0x11f950||0xc8;return function(_0xc2793d){if(_0xc2793d){return _0x26e902[_0xb1ca('0x1d')](_0x11f950)[_0xb1ca('0x1e')](_0xc2793d);}};}function respondWithFilteredResult(_0x311849,_0x12e4e9){return function(_0x4a7371){if(_0x4a7371){var _0x3a0b4d=typeof _0x12e4e9[_0xb1ca('0x1f')]===_0xb1ca('0x20')&&typeof _0x12e4e9['limit']==='undefined';var _0x3f5758=_0x4a7371[_0xb1ca('0x21')];var _0x155169=_0x3a0b4d?0x0:_0x12e4e9[_0xb1ca('0x1f')];var _0x442eab=_0x3a0b4d?_0x4a7371[_0xb1ca('0x21')]:_0x12e4e9[_0xb1ca('0x1f')]+_0x12e4e9[_0xb1ca('0x22')];var _0x474194;if(_0x442eab>=_0x3f5758){_0x442eab=_0x3f5758;_0x474194=0xc8;}else{_0x474194=0xce;}_0x311849['status'](_0x474194);return _0x311849[_0xb1ca('0x23')](_0xb1ca('0x24'),_0x155169+'-'+_0x442eab+'/'+_0x3f5758)[_0xb1ca('0x1e')](_0x4a7371);}return null;};}function patchUpdates(_0x12ab19){return function(_0x2b5db4){try{jsonpatch[_0xb1ca('0x25')](_0x2b5db4,_0x12ab19,!![]);}catch(_0x2b7bdd){return BPromise[_0xb1ca('0x26')](_0x2b7bdd);}return _0x2b5db4['save']();};}function saveUpdates(_0x3d230b,_0x34056c){return function(_0x4e3ced){if(_0x4e3ced){return _0x4e3ced[_0xb1ca('0x27')](_0x3d230b)[_0xb1ca('0x28')](function(_0x2d1d92){return _0x2d1d92;});}return null;};}function removeEntity(_0x24801a,_0x50d313){return function(_0x154048){if(_0x154048){return _0x154048[_0xb1ca('0x29')]()[_0xb1ca('0x28')](function(){_0x24801a['status'](0xcc)[_0xb1ca('0x1c')]();});}};}function handleEntityNotFound(_0x535a4b,_0x37711d){return function(_0x296008){if(!_0x296008){_0x535a4b[_0xb1ca('0x1b')](0x194);}return _0x296008;};}function handleError(_0x2319da,_0x563c96){_0x563c96=_0x563c96||0x1f4;return function(_0x5a4046){logger[_0xb1ca('0x2a')](_0x5a4046[_0xb1ca('0x2b')]);if(_0x5a4046[_0xb1ca('0x2c')]){delete _0x5a4046[_0xb1ca('0x2c')];}_0x2319da[_0xb1ca('0x1d')](_0x563c96)[_0xb1ca('0x2d')](_0x5a4046);};}exports[_0xb1ca('0x2e')]=function(_0x53557d,_0x5b93ec){var _0x440732={},_0x21cb72={},_0x49c121={'count':0x0,'rows':[]};var _0x57abaf=_[_0xb1ca('0x2f')](db[_0xb1ca('0x30')]['rawAttributes'],function(_0x40fb7b){return{'name':_0x40fb7b[_0xb1ca('0x31')],'type':_0x40fb7b[_0xb1ca('0x32')][_0xb1ca('0x33')]};});_0x21cb72['model']=_[_0xb1ca('0x2f')](_0x57abaf,_0xb1ca('0x2c'));_0x21cb72['query']=_[_0xb1ca('0x34')](_0x53557d[_0xb1ca('0x35')]);_0x21cb72[_0xb1ca('0x36')]=_[_0xb1ca('0x37')](_0x21cb72['model'],_0x21cb72[_0xb1ca('0x35')]);_0x440732['attributes']=_['intersection'](_0x21cb72[_0xb1ca('0x38')],qs[_0xb1ca('0x39')](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x39')]));_0x440732[_0xb1ca('0x3a')]=_0x440732['attributes'][_0xb1ca('0x3b')]?_0x440732[_0xb1ca('0x3a')]:_0x21cb72[_0xb1ca('0x38')];if(!_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x3c')]('nolimit')){_0x440732[_0xb1ca('0x22')]=qs['limit'](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x22')]);_0x440732[_0xb1ca('0x1f')]=qs['offset'](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x1f')]);}_0x440732[_0xb1ca('0x3d')]=qs[_0xb1ca('0x3e')](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x3e')]);_0x440732[_0xb1ca('0x3f')]=qs[_0xb1ca('0x36')](_[_0xb1ca('0x40')](_0x53557d[_0xb1ca('0x35')],_0x21cb72['filters']),_0x57abaf);if(_0x53557d['query'][_0xb1ca('0x41')]){_0x440732[_0xb1ca('0x3f')]=_[_0xb1ca('0x42')](_0x440732[_0xb1ca('0x3f')],{'$or':_[_0xb1ca('0x2f')](_0x57abaf,function(_0x208d17){if(_0x208d17[_0xb1ca('0x32')]!=='VIRTUAL'){var _0x50dc74={};_0x50dc74[_0x208d17[_0xb1ca('0x2c')]]={'$like':'%'+_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x41')]+'%'};return _0x50dc74;}})});}_0x440732=_['merge']({},_0x440732,_0x53557d['options']);var _0x341ae2={'where':_0x440732[_0xb1ca('0x3f')]};return db[_0xb1ca('0x30')][_0xb1ca('0x21')](_0x341ae2)['then'](function(_0x358b19){_0x49c121[_0xb1ca('0x21')]=_0x358b19;if(_0x53557d['query'][_0xb1ca('0x43')]){_0x440732[_0xb1ca('0x44')]=[{'all':!![]}];}return db[_0xb1ca('0x30')]['findAll'](_0x440732);})[_0xb1ca('0x28')](function(_0x24db4b){_0x49c121[_0xb1ca('0x45')]=_0x24db4b;return _0x49c121;})['then'](respondWithFilteredResult(_0x5b93ec,_0x440732))[_0xb1ca('0x46')](handleError(_0x5b93ec,null));};exports['show']=function(_0x28f60f,_0x30b054){var _0x15b8f0={'raw':!![],'where':{'id':_0x28f60f[_0xb1ca('0x47')]['id']}},_0x3e2bbb={};_0x3e2bbb[_0xb1ca('0x38')]=_[_0xb1ca('0x34')](db['OpenchannelQueueReport'][_0xb1ca('0x48')]);_0x3e2bbb[_0xb1ca('0x35')]=_[_0xb1ca('0x34')](_0x28f60f['query']);_0x3e2bbb['filters']=_['intersection'](_0x3e2bbb[_0xb1ca('0x38')],_0x3e2bbb[_0xb1ca('0x35')]);_0x15b8f0[_0xb1ca('0x3a')]=_[_0xb1ca('0x37')](_0x3e2bbb[_0xb1ca('0x38')],qs[_0xb1ca('0x39')](_0x28f60f['query'][_0xb1ca('0x39')]));_0x15b8f0['attributes']=_0x15b8f0[_0xb1ca('0x3a')][_0xb1ca('0x3b')]?_0x15b8f0[_0xb1ca('0x3a')]:_0x3e2bbb[_0xb1ca('0x38')];if(_0x28f60f[_0xb1ca('0x35')][_0xb1ca('0x43')]){_0x15b8f0['include']=[{'all':!![]}];}_0x15b8f0=_['merge']({},_0x15b8f0,_0x28f60f['options']);return db[_0xb1ca('0x30')][_0xb1ca('0x49')](_0x15b8f0)[_0xb1ca('0x28')](handleEntityNotFound(_0x30b054,null))[_0xb1ca('0x28')](respondWithResult(_0x30b054,null))['catch'](handleError(_0x30b054,null));};exports['create']=function(_0x5a81e8,_0x3a8d5d){return db[_0xb1ca('0x30')][_0xb1ca('0x4a')](_0x5a81e8['body'],{})['then'](respondWithResult(_0x3a8d5d,0xc9))['catch'](handleError(_0x3a8d5d,null));};exports[_0xb1ca('0x27')]=function(_0x2d43d7,_0x29a04a){if(_0x2d43d7[_0xb1ca('0x4b')]['id']){delete _0x2d43d7['body']['id'];}return db[_0xb1ca('0x30')][_0xb1ca('0x49')]({'where':{'id':_0x2d43d7[_0xb1ca('0x47')]['id']}})[_0xb1ca('0x28')](handleEntityNotFound(_0x29a04a,null))[_0xb1ca('0x28')](saveUpdates(_0x2d43d7[_0xb1ca('0x4b')],null))[_0xb1ca('0x28')](respondWithResult(_0x29a04a,null))['catch'](handleError(_0x29a04a,null));};exports[_0xb1ca('0x29')]=function(_0x4c4adc,_0x513dd3){return db[_0xb1ca('0x30')][_0xb1ca('0x49')]({'where':{'id':_0x4c4adc['params']['id']}})[_0xb1ca('0x28')](handleEntityNotFound(_0x513dd3,null))[_0xb1ca('0x28')](removeEntity(_0x513dd3,null))[_0xb1ca('0x46')](handleError(_0x513dd3,null));};exports[_0xb1ca('0x4c')]=function(_0x3f1c92,_0xbe3f91){return db['OpenchannelQueueReport'][_0xb1ca('0x4c')]()['then'](respondWithResult(_0xbe3f91,null))[_0xb1ca('0x46')](handleError(_0xbe3f91,null));}; \ No newline at end of file +var _0x7b67=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','set','save','update','then','destroy','status','end','stack','name','index','OpenchannelQueueReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','params','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x383e98,_0x2a5b10){var _0x27cfb7=function(_0x3dc334){while(--_0x3dc334){_0x383e98['push'](_0x383e98['shift']());}};_0x27cfb7(++_0x2a5b10);}(_0x7b67,0xcc));var _0x77b6=function(_0x248c02,_0x87544a){_0x248c02=_0x248c02-0x0;var _0x257a75=_0x7b67[_0x248c02];return _0x257a75;};'use strict';var emlformat=require(_0x77b6('0x0'));var rimraf=require(_0x77b6('0x1'));var zipdir=require(_0x77b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77b6('0x3'));var moment=require('moment');var BPromise=require(_0x77b6('0x4'));var Mustache=require(_0x77b6('0x5'));var util=require('util');var path=require(_0x77b6('0x6'));var sox=require(_0x77b6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77b6('0x8'));var _=require('lodash');var squel=require(_0x77b6('0x9'));var crypto=require(_0x77b6('0xa'));var jsforce=require(_0x77b6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x77b6('0xc'));var querystring=require(_0x77b6('0xd'));var Papa=require(_0x77b6('0xe'));var Redis=require(_0x77b6('0xf'));var authService=require(_0x77b6('0x10'));var qs=require(_0x77b6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x77b6('0x12'))(_0x77b6('0x13'));var utils=require(_0x77b6('0x14'));var config=require(_0x77b6('0x15'));var licenseUtil=require(_0x77b6('0x16'));var db=require(_0x77b6('0x17'))['db'];function respondWithStatusCode(_0x3cb55a,_0x3a574d){_0x3a574d=_0x3a574d||0xcc;return function(_0x46a33f){if(_0x46a33f){return _0x3cb55a[_0x77b6('0x18')](_0x3a574d);}return _0x3cb55a['status'](_0x3a574d)['end']();};}function respondWithResult(_0x2a95ed,_0x2a4962){_0x2a4962=_0x2a4962||0xc8;return function(_0x3d05a4){if(_0x3d05a4){return _0x2a95ed['status'](_0x2a4962)[_0x77b6('0x19')](_0x3d05a4);}};}function respondWithFilteredResult(_0x3f2c32,_0x347fd1){return function(_0x1c7193){if(_0x1c7193){var _0x95861d=typeof _0x347fd1[_0x77b6('0x1a')]==='undefined'&&typeof _0x347fd1[_0x77b6('0x1b')]===_0x77b6('0x1c');var _0x3b7411=_0x1c7193[_0x77b6('0x1d')];var _0x3f5086=_0x95861d?0x0:_0x347fd1[_0x77b6('0x1a')];var _0x258df5=_0x95861d?_0x1c7193[_0x77b6('0x1d')]:_0x347fd1[_0x77b6('0x1a')]+_0x347fd1[_0x77b6('0x1b')];var _0x4aa4f2;if(_0x258df5>=_0x3b7411){_0x258df5=_0x3b7411;_0x4aa4f2=0xc8;}else{_0x4aa4f2=0xce;}_0x3f2c32['status'](_0x4aa4f2);return _0x3f2c32[_0x77b6('0x1e')]('Content-Range',_0x3f5086+'-'+_0x258df5+'/'+_0x3b7411)[_0x77b6('0x19')](_0x1c7193);}return null;};}function patchUpdates(_0x312346){return function(_0x1fc8ef){try{jsonpatch['apply'](_0x1fc8ef,_0x312346,!![]);}catch(_0x364478){return BPromise['reject'](_0x364478);}return _0x1fc8ef[_0x77b6('0x1f')]();};}function saveUpdates(_0x55d50d,_0x4166e1){return function(_0x4bd7a1){if(_0x4bd7a1){return _0x4bd7a1[_0x77b6('0x20')](_0x55d50d)[_0x77b6('0x21')](function(_0x1cb992){return _0x1cb992;});}return null;};}function removeEntity(_0x1e5282,_0x57bf2b){return function(_0x5cf9e7){if(_0x5cf9e7){return _0x5cf9e7[_0x77b6('0x22')]()[_0x77b6('0x21')](function(){_0x1e5282[_0x77b6('0x23')](0xcc)[_0x77b6('0x24')]();});}};}function handleEntityNotFound(_0x4aab17,_0x23c3d8){return function(_0x2a59a1){if(!_0x2a59a1){_0x4aab17[_0x77b6('0x18')](0x194);}return _0x2a59a1;};}function handleError(_0x457e6d,_0x1cff42){_0x1cff42=_0x1cff42||0x1f4;return function(_0x337f67){logger['error'](_0x337f67[_0x77b6('0x25')]);if(_0x337f67['name']){delete _0x337f67[_0x77b6('0x26')];}_0x457e6d[_0x77b6('0x23')](_0x1cff42)['send'](_0x337f67);};}exports[_0x77b6('0x27')]=function(_0x13ca72,_0x4930e0){var _0x2f2c80={},_0x462c8c={},_0x39863e={'count':0x0,'rows':[]};var _0x4f471d=_['map'](db[_0x77b6('0x28')][_0x77b6('0x29')],function(_0x1b8b1c){return{'name':_0x1b8b1c[_0x77b6('0x2a')],'type':_0x1b8b1c['type'][_0x77b6('0x2b')]};});_0x462c8c['model']=_[_0x77b6('0x2c')](_0x4f471d,_0x77b6('0x26'));_0x462c8c[_0x77b6('0x2d')]=_[_0x77b6('0x2e')](_0x13ca72[_0x77b6('0x2d')]);_0x462c8c[_0x77b6('0x2f')]=_[_0x77b6('0x30')](_0x462c8c['model'],_0x462c8c[_0x77b6('0x2d')]);_0x2f2c80[_0x77b6('0x31')]=_[_0x77b6('0x30')](_0x462c8c[_0x77b6('0x32')],qs[_0x77b6('0x33')](_0x13ca72['query'][_0x77b6('0x33')]));_0x2f2c80[_0x77b6('0x31')]=_0x2f2c80[_0x77b6('0x31')][_0x77b6('0x34')]?_0x2f2c80[_0x77b6('0x31')]:_0x462c8c[_0x77b6('0x32')];if(!_0x13ca72[_0x77b6('0x2d')][_0x77b6('0x35')](_0x77b6('0x36'))){_0x2f2c80[_0x77b6('0x1b')]=qs[_0x77b6('0x1b')](_0x13ca72['query'][_0x77b6('0x1b')]);_0x2f2c80['offset']=qs[_0x77b6('0x1a')](_0x13ca72[_0x77b6('0x2d')][_0x77b6('0x1a')]);}_0x2f2c80[_0x77b6('0x37')]=qs[_0x77b6('0x38')](_0x13ca72['query'][_0x77b6('0x38')]);_0x2f2c80[_0x77b6('0x39')]=qs[_0x77b6('0x2f')](_['pick'](_0x13ca72[_0x77b6('0x2d')],_0x462c8c[_0x77b6('0x2f')]),_0x4f471d);if(_0x13ca72[_0x77b6('0x2d')][_0x77b6('0x3a')]){_0x2f2c80[_0x77b6('0x39')]=_[_0x77b6('0x3b')](_0x2f2c80[_0x77b6('0x39')],{'$or':_['map'](_0x4f471d,function(_0x54163e){if(_0x54163e[_0x77b6('0x3c')]!==_0x77b6('0x3d')){var _0x884636={};_0x884636[_0x54163e[_0x77b6('0x26')]]={'$like':'%'+_0x13ca72[_0x77b6('0x2d')]['filter']+'%'};return _0x884636;}})});}_0x2f2c80=_[_0x77b6('0x3b')]({},_0x2f2c80,_0x13ca72[_0x77b6('0x3e')]);var _0x13f316={'where':_0x2f2c80[_0x77b6('0x39')]};return db[_0x77b6('0x28')]['count'](_0x13f316)[_0x77b6('0x21')](function(_0x4f698b){_0x39863e[_0x77b6('0x1d')]=_0x4f698b;if(_0x13ca72[_0x77b6('0x2d')][_0x77b6('0x3f')]){_0x2f2c80[_0x77b6('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x77b6('0x41')](_0x2f2c80);})[_0x77b6('0x21')](function(_0x285499){_0x39863e['rows']=_0x285499;return _0x39863e;})[_0x77b6('0x21')](respondWithFilteredResult(_0x4930e0,_0x2f2c80))['catch'](handleError(_0x4930e0,null));};exports[_0x77b6('0x42')]=function(_0x305d13,_0x20569c){var _0x50e57c={'raw':!![],'where':{'id':_0x305d13['params']['id']}},_0x519fac={};_0x519fac['model']=_['keys'](db['OpenchannelQueueReport'][_0x77b6('0x29')]);_0x519fac[_0x77b6('0x2d')]=_[_0x77b6('0x2e')](_0x305d13[_0x77b6('0x2d')]);_0x519fac[_0x77b6('0x2f')]=_[_0x77b6('0x30')](_0x519fac[_0x77b6('0x32')],_0x519fac['query']);_0x50e57c[_0x77b6('0x31')]=_[_0x77b6('0x30')](_0x519fac['model'],qs[_0x77b6('0x33')](_0x305d13[_0x77b6('0x2d')]['fields']));_0x50e57c['attributes']=_0x50e57c[_0x77b6('0x31')]['length']?_0x50e57c[_0x77b6('0x31')]:_0x519fac[_0x77b6('0x32')];if(_0x305d13[_0x77b6('0x2d')]['includeAll']){_0x50e57c[_0x77b6('0x40')]=[{'all':!![]}];}_0x50e57c=_[_0x77b6('0x3b')]({},_0x50e57c,_0x305d13[_0x77b6('0x3e')]);return db[_0x77b6('0x28')]['find'](_0x50e57c)['then'](handleEntityNotFound(_0x20569c,null))[_0x77b6('0x21')](respondWithResult(_0x20569c,null))[_0x77b6('0x43')](handleError(_0x20569c,null));};exports[_0x77b6('0x44')]=function(_0x36cca6,_0x59bacb){return db[_0x77b6('0x28')][_0x77b6('0x44')](_0x36cca6[_0x77b6('0x45')],{})['then'](respondWithResult(_0x59bacb,0xc9))[_0x77b6('0x43')](handleError(_0x59bacb,null));};exports[_0x77b6('0x20')]=function(_0x12ffe2,_0x1ab4e8){if(_0x12ffe2[_0x77b6('0x45')]['id']){delete _0x12ffe2['body']['id'];}return db[_0x77b6('0x28')]['find']({'where':{'id':_0x12ffe2[_0x77b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ab4e8,null))['then'](saveUpdates(_0x12ffe2[_0x77b6('0x45')],null))[_0x77b6('0x21')](respondWithResult(_0x1ab4e8,null))[_0x77b6('0x43')](handleError(_0x1ab4e8,null));};exports[_0x77b6('0x22')]=function(_0x214994,_0x43b3aa){return db['OpenchannelQueueReport'][_0x77b6('0x47')]({'where':{'id':_0x214994[_0x77b6('0x46')]['id']}})[_0x77b6('0x21')](handleEntityNotFound(_0x43b3aa,null))[_0x77b6('0x21')](removeEntity(_0x43b3aa,null))['catch'](handleError(_0x43b3aa,null));};exports[_0x77b6('0x48')]=function(_0x50a141,_0x5b3a4f){return db[_0x77b6('0x28')]['describe']()[_0x77b6('0x21')](respondWithResult(_0x5b3a4f,null))[_0x77b6('0x43')](handleError(_0x5b3a4f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f7d9ed4..035b0d5 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x814b,0x1a2));var _0xb814=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x814b[_0x5cc3d4];return _0x17ca31;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x12c2da,_0x40d43d){var _0x548d83=function(_0x343099){while(--_0x343099){_0x12c2da['push'](_0x12c2da['shift']());}};_0x548d83(++_0x40d43d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x5fc3[_0x260f28];return _0x3aefcc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 1339786..2d9301b 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 _0x896e=['message','info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x896e,0x1e9));var _0xe896=function(_0x3cf987,_0x16d86f){_0x3cf987=_0x3cf987-0x0;var _0xffd94=_0x896e[_0x3cf987];return _0xffd94;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')](_0x32f86d[_0xe896('0x1b')],{'raw':_0x32f86d[_0xe896('0x1c')]?_0x32f86d[_0xe896('0x1c')][_0xe896('0x1d')]===undefined?!![]:![]:!![]})[_0xe896('0xe')](function(_0x49547b){logger[_0xe896('0x16')]('CreateOpenchannelQueueReport',_0x32f86d);logger['debug'](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x49547b));_0x5dc89d(_0x49547b);})[_0xe896('0x17')](function(_0xeeec7c){logger['error'](_0xe896('0x18'),_0xeeec7c['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0xeeec7c[_0xe896('0x15')]));});});};exports[_0xe896('0x1e')]=function(_0x1e952a){var _0x2e2c10=this;return new Promise(function(_0x20e295,_0x4d9f03){return db[_0xe896('0x19')]['update'](_0x1e952a[_0xe896('0x1b')],{'raw':_0x1e952a[_0xe896('0x1c')]?_0x1e952a[_0xe896('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e952a[_0xe896('0x1c')]?_0x1e952a[_0xe896('0x1c')][_0xe896('0x1f')]||null:null,'attributes':_0x1e952a[_0xe896('0x1c')]?_0x1e952a[_0xe896('0x1c')][_0xe896('0x20')]||null:null,'limit':_0x1e952a['options']?_0x1e952a[_0xe896('0x1c')][_0xe896('0x21')]||null:null})[_0xe896('0xe')](function(_0xbfb15b){logger[_0xe896('0x16')]('UpdateOpenchannelQueueReport',_0x1e952a);logger['debug']('UpdateOpenchannelQueueReport',_0x1e952a,JSON['stringify'](_0xbfb15b));_0x20e295(_0xbfb15b);})['catch'](function(_0x291290){logger[_0xe896('0x13')](_0xe896('0x1e'),_0x291290[_0xe896('0x15')],_0x1e952a);_0x4d9f03(_0x2e2c10[_0xe896('0x13')](0x1f4,_0x291290[_0xe896('0x15')]));});});}; \ No newline at end of file +var _0xb98e=['client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5ad697,_0x11781a){var _0x4fc533=function(_0x2b5f5c){while(--_0x2b5f5c){_0x5ad697['push'](_0x5ad697['shift']());}};_0x4fc533(++_0x11781a);}(_0xb98e,0x184));var _0xeb98=function(_0x172824,_0x3f3c4a){_0x172824=_0x172824-0x0;var _0x384418=_0xb98e[_0x172824];return _0x384418;};'use strict';var _=require(_0xeb98('0x0'));var util=require(_0xeb98('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb98('0x2'));var fs=require('fs');var Redis=require(_0xeb98('0x3'));var db=require(_0xeb98('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb98('0x5'))(_0xeb98('0x6'));var config=require(_0xeb98('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb98('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a7e79,_0x47c83f,_0x41309a){return new BPromise(function(_0x16a195,_0x3ca112){return client[_0xeb98('0x9')](_0x4a7e79,_0x41309a)[_0xeb98('0xa')](function(_0x2f0e2e){logger[_0xeb98('0xb')](_0xeb98('0xc'),_0x47c83f,'request\x20sent');logger[_0xeb98('0xd')](_0xeb98('0xe'),_0x47c83f,_0xeb98('0xf'),JSON[_0xeb98('0x10')](_0x2f0e2e));if(_0x2f0e2e[_0xeb98('0x11')]){if(_0x2f0e2e[_0xeb98('0x11')][_0xeb98('0x12')]===0x1f4){logger[_0xeb98('0x11')](_0xeb98('0xc'),_0x47c83f,_0x2f0e2e[_0xeb98('0x11')][_0xeb98('0x13')]);return _0x3ca112(_0x2f0e2e['error'][_0xeb98('0x13')]);}logger[_0xeb98('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x47c83f,_0x2f0e2e['error'][_0xeb98('0x13')]);return _0x16a195(_0x2f0e2e[_0xeb98('0x11')][_0xeb98('0x13')]);}else{logger[_0xeb98('0xb')](_0xeb98('0xc'),_0x47c83f,_0xeb98('0xf'));_0x16a195(_0x2f0e2e[_0xeb98('0x14')][_0xeb98('0x13')]);}})[_0xeb98('0x15')](function(_0x2fd9c8){logger[_0xeb98('0x11')](_0xeb98('0xc'),_0x47c83f,_0x2fd9c8);_0x3ca112(_0x2fd9c8);});});}exports[_0xeb98('0x16')]=function(_0x3520a4){var _0x3a86e9=this;return new Promise(function(_0x1caff9,_0x38b7be){return db[_0xeb98('0x17')][_0xeb98('0x18')](_0x3520a4[_0xeb98('0x19')],{'raw':_0x3520a4['options']?_0x3520a4[_0xeb98('0x1a')][_0xeb98('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x56b018){logger[_0xeb98('0xb')](_0xeb98('0x16'),_0x3520a4);logger['debug']('CreateOpenchannelQueueReport',_0x3520a4,JSON[_0xeb98('0x10')](_0x56b018));_0x1caff9(_0x56b018);})['catch'](function(_0x3e7693){logger[_0xeb98('0x11')]('CreateOpenchannelQueueReport',_0x3e7693[_0xeb98('0x13')],_0x3520a4);_0x38b7be(_0x3a86e9[_0xeb98('0x11')](0x1f4,_0x3e7693[_0xeb98('0x13')]));});});};exports[_0xeb98('0x1c')]=function(_0x16274e){var _0x1fa721=this;return new Promise(function(_0x685a8f,_0x31928e){return db[_0xeb98('0x17')][_0xeb98('0x1d')](_0x16274e[_0xeb98('0x19')],{'raw':_0x16274e['options']?_0x16274e[_0xeb98('0x1a')][_0xeb98('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16274e[_0xeb98('0x1a')]?_0x16274e[_0xeb98('0x1a')][_0xeb98('0x1e')]||null:null,'attributes':_0x16274e[_0xeb98('0x1a')]?_0x16274e[_0xeb98('0x1a')][_0xeb98('0x1f')]||null:null,'limit':_0x16274e[_0xeb98('0x1a')]?_0x16274e[_0xeb98('0x1a')][_0xeb98('0x20')]||null:null})[_0xeb98('0xa')](function(_0x54a957){logger[_0xeb98('0xb')](_0xeb98('0x1c'),_0x16274e);logger[_0xeb98('0xd')](_0xeb98('0x1c'),_0x16274e,JSON['stringify'](_0x54a957));_0x685a8f(_0x54a957);})[_0xeb98('0x15')](function(_0x3998f0){logger[_0xeb98('0x11')](_0xeb98('0x1c'),_0x3998f0[_0xeb98('0x13')],_0x16274e);_0x31928e(_0x1fa721[_0xeb98('0x11')](0x1f4,_0x3998f0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 8280fd1..fe489fb 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 _0x7fa7=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x7fa7,0x1d5));var _0x77fa=function(_0x1963b4,_0x2edc44){_0x1963b4=_0x1963b4-0x0;var _0x1e1e33=_0x7fa7[_0x1963b4];return _0x1e1e33;};'use strict';var multer=require(_0x77fa('0x0'));var util=require(_0x77fa('0x1'));var path=require(_0x77fa('0x2'));var timeout=require(_0x77fa('0x3'));var express=require(_0x77fa('0x4'));var router=express['Router']();var fs_extra=require(_0x77fa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x77fa('0x6'));var config=require(_0x77fa('0x7'));var controller=require(_0x77fa('0x8'));router['get']('/',auth[_0x77fa('0x9')](),controller['index']);router[_0x77fa('0xa')](_0x77fa('0xb'),auth[_0x77fa('0x9')](),controller[_0x77fa('0xc')]);router[_0x77fa('0xa')](_0x77fa('0xd'),auth[_0x77fa('0x9')](),controller[_0x77fa('0xe')]);router[_0x77fa('0xf')]('/',auth[_0x77fa('0x9')](),controller[_0x77fa('0x10')]);router[_0x77fa('0x11')](_0x77fa('0xd'),auth['isAuthenticated'](),controller[_0x77fa('0x12')]);router[_0x77fa('0x13')](_0x77fa('0xd'),auth[_0x77fa('0x9')](),controller[_0x77fa('0x14')]);module[_0x77fa('0x15')]=router; \ No newline at end of file +var _0xdb30=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x196192,_0x58189a){var _0x3fdb0f=function(_0x285ee6){while(--_0x285ee6){_0x196192['push'](_0x196192['shift']());}};_0x3fdb0f(++_0x58189a);}(_0xdb30,0xec));var _0x0db3=function(_0x31ef02,_0x517141){_0x31ef02=_0x31ef02-0x0;var _0x309387=_0xdb30[_0x31ef02];return _0x309387;};'use strict';var multer=require(_0x0db3('0x0'));var util=require(_0x0db3('0x1'));var path=require(_0x0db3('0x2'));var timeout=require(_0x0db3('0x3'));var express=require(_0x0db3('0x4'));var router=express[_0x0db3('0x5')]();var fs_extra=require(_0x0db3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0db3('0x7'));var config=require(_0x0db3('0x8'));var controller=require(_0x0db3('0x9'));router[_0x0db3('0xa')]('/',auth[_0x0db3('0xb')](),controller[_0x0db3('0xc')]);router[_0x0db3('0xa')](_0x0db3('0xd'),auth[_0x0db3('0xb')](),controller[_0x0db3('0xe')]);router[_0x0db3('0xa')](_0x0db3('0xf'),auth['isAuthenticated'](),controller[_0x0db3('0x10')]);router[_0x0db3('0x11')]('/',auth[_0x0db3('0xb')](),controller[_0x0db3('0x12')]);router['put'](_0x0db3('0xf'),auth[_0x0db3('0xb')](),controller[_0x0db3('0x13')]);router[_0x0db3('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0db3('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 9a095fd..f5254fa 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x6e7474,_0x4c6139){var _0x1c25b8=function(_0x2d66c7){while(--_0x2d66c7){_0x6e7474['push'](_0x6e7474['shift']());}};_0x1c25b8(++_0x4c6139);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x44b585,_0x120e48){var _0x38dd43=function(_0x2c6be7){while(--_0x2c6be7){_0x44b585['push'](_0x44b585['shift']());}};_0x38dd43(++_0x120e48);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 1e86b7e..2f6c675 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 _0xd9cc=['stack','name','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','Content-Range','reject','update','then','sendStatus'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9cc,0xed));var _0xcd9c=function(_0x4d4833,_0x2c4ff0){_0x4d4833=_0x4d4833-0x0;var _0x2105a3=_0xd9cc[_0x4d4833];return _0x2105a3;};'use strict';var emlformat=require(_0xcd9c('0x0'));var rimraf=require(_0xcd9c('0x1'));var zipdir=require(_0xcd9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9c('0x3'));var moment=require(_0xcd9c('0x4'));var BPromise=require(_0xcd9c('0x5'));var Mustache=require(_0xcd9c('0x6'));var util=require(_0xcd9c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcd9c('0x8'));var ejs=require(_0xcd9c('0x9'));var fs=require('fs');var fs_extra=require(_0xcd9c('0xa'));var _=require(_0xcd9c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd9c('0x8'));var querystring=require(_0xcd9c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd9c('0xd'));var as=require(_0xcd9c('0xe'));var hardwareService=require(_0xcd9c('0xf'));var logger=require(_0xcd9c('0x10'))('api');var utils=require(_0xcd9c('0x11'));var config=require(_0xcd9c('0x12'));var licenseUtil=require(_0xcd9c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4519bb,_0xad31cd){_0xad31cd=_0xad31cd||0xcc;return function(_0x3a2644){if(_0x3a2644){return _0x4519bb['sendStatus'](_0xad31cd);}return _0x4519bb[_0xcd9c('0x14')](_0xad31cd)[_0xcd9c('0x15')]();};}function respondWithResult(_0x426ee0,_0x41103f){_0x41103f=_0x41103f||0xc8;return function(_0x4f1730){if(_0x4f1730){return _0x426ee0[_0xcd9c('0x14')](_0x41103f)[_0xcd9c('0x16')](_0x4f1730);}};}function respondWithFilteredResult(_0x1e803e,_0x4fcc35){return function(_0x27b97f){if(_0x27b97f){var _0x3bc06d=typeof _0x4fcc35[_0xcd9c('0x17')]==='undefined'&&typeof _0x4fcc35['limit']===_0xcd9c('0x18');var _0x4afc15=_0x27b97f[_0xcd9c('0x19')];var _0x587d38=_0x3bc06d?0x0:_0x4fcc35[_0xcd9c('0x17')];var _0xfecc39=_0x3bc06d?_0x27b97f[_0xcd9c('0x19')]:_0x4fcc35[_0xcd9c('0x17')]+_0x4fcc35['limit'];var _0x4faf19;if(_0xfecc39>=_0x4afc15){_0xfecc39=_0x4afc15;_0x4faf19=0xc8;}else{_0x4faf19=0xce;}_0x1e803e[_0xcd9c('0x14')](_0x4faf19);return _0x1e803e['set'](_0xcd9c('0x1a'),_0x587d38+'-'+_0xfecc39+'/'+_0x4afc15)['json'](_0x27b97f);}return null;};}function patchUpdates(_0x59fd03){return function(_0x1c35ed){try{jsonpatch['apply'](_0x1c35ed,_0x59fd03,!![]);}catch(_0x155acb){return BPromise[_0xcd9c('0x1b')](_0x155acb);}return _0x1c35ed['save']();};}function saveUpdates(_0x381964,_0x2aae71){return function(_0x1f10a6){if(_0x1f10a6){return _0x1f10a6[_0xcd9c('0x1c')](_0x381964)['then'](function(_0x2722fb){return _0x2722fb;});}return null;};}function removeEntity(_0x16764f,_0x13333b){return function(_0x32e374){if(_0x32e374){return _0x32e374['destroy']()[_0xcd9c('0x1d')](function(){_0x16764f[_0xcd9c('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90946b,_0x1a1174){return function(_0x3e24a6){if(!_0x3e24a6){_0x90946b[_0xcd9c('0x1e')](0x194);}return _0x3e24a6;};}function handleError(_0x3d235a,_0x2ac438){_0x2ac438=_0x2ac438||0x1f4;return function(_0x2ae0f4){logger['error'](_0x2ae0f4[_0xcd9c('0x1f')]);if(_0x2ae0f4['name']){delete _0x2ae0f4[_0xcd9c('0x20')];}_0x3d235a[_0xcd9c('0x14')](_0x2ac438)['send'](_0x2ae0f4);};}exports['index']=function(_0x7373eb,_0x36b4cb){var _0x18b2f5={},_0x22dadc={},_0x134a01={'count':0x0,'rows':[]};var _0x274e0f=_[_0xcd9c('0x21')](db[_0xcd9c('0x22')][_0xcd9c('0x23')],function(_0x3d1997){return{'name':_0x3d1997[_0xcd9c('0x24')],'type':_0x3d1997['type'][_0xcd9c('0x25')]};});_0x22dadc[_0xcd9c('0x26')]=_[_0xcd9c('0x21')](_0x274e0f,_0xcd9c('0x20'));_0x22dadc[_0xcd9c('0x27')]=_[_0xcd9c('0x28')](_0x7373eb[_0xcd9c('0x27')]);_0x22dadc[_0xcd9c('0x29')]=_[_0xcd9c('0x2a')](_0x22dadc[_0xcd9c('0x26')],_0x22dadc[_0xcd9c('0x27')]);_0x18b2f5[_0xcd9c('0x2b')]=_[_0xcd9c('0x2a')](_0x22dadc[_0xcd9c('0x26')],qs[_0xcd9c('0x2c')](_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x2c')]));_0x18b2f5[_0xcd9c('0x2b')]=_0x18b2f5['attributes']['length']?_0x18b2f5[_0xcd9c('0x2b')]:_0x22dadc[_0xcd9c('0x26')];if(!_0x7373eb['query'][_0xcd9c('0x2d')](_0xcd9c('0x2e'))){_0x18b2f5['limit']=qs[_0xcd9c('0x2f')](_0x7373eb[_0xcd9c('0x27')]['limit']);_0x18b2f5[_0xcd9c('0x17')]=qs[_0xcd9c('0x17')](_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x17')]);}_0x18b2f5['order']=qs['sort'](_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x30')]);_0x18b2f5[_0xcd9c('0x31')]=qs[_0xcd9c('0x29')](_[_0xcd9c('0x32')](_0x7373eb[_0xcd9c('0x27')],_0x22dadc[_0xcd9c('0x29')]),_0x274e0f);if(_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x33')]){_0x18b2f5[_0xcd9c('0x31')]=_[_0xcd9c('0x34')](_0x18b2f5[_0xcd9c('0x31')],{'$or':_[_0xcd9c('0x21')](_0x274e0f,function(_0x34f81a){if(_0x34f81a['type']!==_0xcd9c('0x35')){var _0x1cd63f={};_0x1cd63f[_0x34f81a['name']]={'$like':'%'+_0x7373eb['query'][_0xcd9c('0x33')]+'%'};return _0x1cd63f;}})});}_0x18b2f5=_[_0xcd9c('0x34')]({},_0x18b2f5,_0x7373eb['options']);var _0x7b71af={'where':_0x18b2f5[_0xcd9c('0x31')]};return db['OpenchannelTransferReport']['count'](_0x7b71af)[_0xcd9c('0x1d')](function(_0x32357d){_0x134a01[_0xcd9c('0x19')]=_0x32357d;if(_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x36')]){_0x18b2f5[_0xcd9c('0x37')]=[{'all':!![]}];}return db[_0xcd9c('0x22')][_0xcd9c('0x38')](_0x18b2f5);})[_0xcd9c('0x1d')](function(_0x12008e){_0x134a01[_0xcd9c('0x39')]=_0x12008e;return _0x134a01;})[_0xcd9c('0x1d')](respondWithFilteredResult(_0x36b4cb,_0x18b2f5))[_0xcd9c('0x3a')](handleError(_0x36b4cb,null));};exports[_0xcd9c('0x3b')]=function(_0x37a014,_0x347cb4){var _0x5989d3={'raw':!![],'where':{'id':_0x37a014[_0xcd9c('0x3c')]['id']}},_0x3c60ac={};_0x3c60ac[_0xcd9c('0x26')]=_[_0xcd9c('0x28')](db[_0xcd9c('0x22')][_0xcd9c('0x23')]);_0x3c60ac[_0xcd9c('0x27')]=_[_0xcd9c('0x28')](_0x37a014[_0xcd9c('0x27')]);_0x3c60ac['filters']=_[_0xcd9c('0x2a')](_0x3c60ac['model'],_0x3c60ac['query']);_0x5989d3['attributes']=_[_0xcd9c('0x2a')](_0x3c60ac[_0xcd9c('0x26')],qs[_0xcd9c('0x2c')](_0x37a014['query'][_0xcd9c('0x2c')]));_0x5989d3[_0xcd9c('0x2b')]=_0x5989d3['attributes'][_0xcd9c('0x3d')]?_0x5989d3[_0xcd9c('0x2b')]:_0x3c60ac['model'];if(_0x37a014[_0xcd9c('0x27')][_0xcd9c('0x36')]){_0x5989d3[_0xcd9c('0x37')]=[{'all':!![]}];}_0x5989d3=_['merge']({},_0x5989d3,_0x37a014[_0xcd9c('0x3e')]);return db['OpenchannelTransferReport'][_0xcd9c('0x3f')](_0x5989d3)[_0xcd9c('0x1d')](handleEntityNotFound(_0x347cb4,null))['then'](respondWithResult(_0x347cb4,null))[_0xcd9c('0x3a')](handleError(_0x347cb4,null));};exports[_0xcd9c('0x40')]=function(_0xd59c92,_0xf36fa2){return db[_0xcd9c('0x22')]['create'](_0xd59c92['body'],{})[_0xcd9c('0x1d')](respondWithResult(_0xf36fa2,0xc9))[_0xcd9c('0x3a')](handleError(_0xf36fa2,null));};exports[_0xcd9c('0x1c')]=function(_0x76223b,_0x503bb9){if(_0x76223b['body']['id']){delete _0x76223b['body']['id'];}return db[_0xcd9c('0x22')][_0xcd9c('0x3f')]({'where':{'id':_0x76223b['params']['id']}})[_0xcd9c('0x1d')](handleEntityNotFound(_0x503bb9,null))[_0xcd9c('0x1d')](saveUpdates(_0x76223b[_0xcd9c('0x41')],null))['then'](respondWithResult(_0x503bb9,null))[_0xcd9c('0x3a')](handleError(_0x503bb9,null));};exports['destroy']=function(_0x3bef62,_0xc4afb7){return db[_0xcd9c('0x22')][_0xcd9c('0x3f')]({'where':{'id':_0x3bef62[_0xcd9c('0x3c')]['id']}})[_0xcd9c('0x1d')](handleEntityNotFound(_0xc4afb7,null))[_0xcd9c('0x1d')](removeEntity(_0xc4afb7,null))[_0xcd9c('0x3a')](handleError(_0xc4afb7,null));};exports[_0xcd9c('0x42')]=function(_0x37a0e0,_0x5362e2){return db[_0xcd9c('0x22')][_0xcd9c('0x42')]()[_0xcd9c('0x1d')](respondWithResult(_0x5362e2,null))['catch'](handleError(_0x5362e2,null));}; \ No newline at end of file +var _0xfd27=['filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','map','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xfd27,0x1cf));var _0x7fd2=function(_0x2e47e0,_0x3be91d){_0x2e47e0=_0x2e47e0-0x0;var _0x4d2496=_0xfd27[_0x2e47e0];return _0x4d2496;};'use strict';var emlformat=require(_0x7fd2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7fd2('0x2'));var BPromise=require(_0x7fd2('0x3'));var Mustache=require('mustache');var util=require(_0x7fd2('0x4'));var path=require('path');var sox=require(_0x7fd2('0x5'));var csv=require(_0x7fd2('0x6'));var ejs=require(_0x7fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x7fd2('0x8'));var _=require('lodash');var squel=require(_0x7fd2('0x9'));var crypto=require(_0x7fd2('0xa'));var jsforce=require(_0x7fd2('0xb'));var deskjs=require(_0x7fd2('0xc'));var toCsv=require(_0x7fd2('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7fd2('0xd'));var qs=require(_0x7fd2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fd2('0xf'));var logger=require('../../config/logger')(_0x7fd2('0x10'));var utils=require(_0x7fd2('0x11'));var config=require(_0x7fd2('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fd2('0x13'))['db'];function respondWithStatusCode(_0x2c1b70,_0x4ebc86){_0x4ebc86=_0x4ebc86||0xcc;return function(_0x20da59){if(_0x20da59){return _0x2c1b70[_0x7fd2('0x14')](_0x4ebc86);}return _0x2c1b70[_0x7fd2('0x15')](_0x4ebc86)[_0x7fd2('0x16')]();};}function respondWithResult(_0x3ea427,_0x412db3){_0x412db3=_0x412db3||0xc8;return function(_0x384168){if(_0x384168){return _0x3ea427[_0x7fd2('0x15')](_0x412db3)[_0x7fd2('0x17')](_0x384168);}};}function respondWithFilteredResult(_0xd6dd8b,_0x1233df){return function(_0x3aac25){if(_0x3aac25){var _0x16e60a=typeof _0x1233df[_0x7fd2('0x18')]==='undefined'&&typeof _0x1233df['limit']===_0x7fd2('0x19');var _0x390ddc=_0x3aac25[_0x7fd2('0x1a')];var _0x522d0c=_0x16e60a?0x0:_0x1233df[_0x7fd2('0x18')];var _0x963ef2=_0x16e60a?_0x3aac25[_0x7fd2('0x1a')]:_0x1233df[_0x7fd2('0x18')]+_0x1233df[_0x7fd2('0x1b')];var _0x5a72fe;if(_0x963ef2>=_0x390ddc){_0x963ef2=_0x390ddc;_0x5a72fe=0xc8;}else{_0x5a72fe=0xce;}_0xd6dd8b[_0x7fd2('0x15')](_0x5a72fe);return _0xd6dd8b['set'](_0x7fd2('0x1c'),_0x522d0c+'-'+_0x963ef2+'/'+_0x390ddc)['json'](_0x3aac25);}return null;};}function patchUpdates(_0x269be4){return function(_0x3a4215){try{jsonpatch[_0x7fd2('0x1d')](_0x3a4215,_0x269be4,!![]);}catch(_0x53c636){return BPromise[_0x7fd2('0x1e')](_0x53c636);}return _0x3a4215[_0x7fd2('0x1f')]();};}function saveUpdates(_0x3ecbd2,_0x2e1043){return function(_0x34965c){if(_0x34965c){return _0x34965c['update'](_0x3ecbd2)[_0x7fd2('0x20')](function(_0x516c96){return _0x516c96;});}return null;};}function removeEntity(_0x17290c,_0x5e0eec){return function(_0x299370){if(_0x299370){return _0x299370[_0x7fd2('0x21')]()['then'](function(){_0x17290c[_0x7fd2('0x15')](0xcc)[_0x7fd2('0x16')]();});}};}function handleEntityNotFound(_0x2b3c42,_0x586b15){return function(_0x59983f){if(!_0x59983f){_0x2b3c42[_0x7fd2('0x14')](0x194);}return _0x59983f;};}function handleError(_0x1d376d,_0x1d9c88){_0x1d9c88=_0x1d9c88||0x1f4;return function(_0x65d86f){logger['error'](_0x65d86f[_0x7fd2('0x22')]);if(_0x65d86f[_0x7fd2('0x23')]){delete _0x65d86f[_0x7fd2('0x23')];}_0x1d376d[_0x7fd2('0x15')](_0x1d9c88)[_0x7fd2('0x24')](_0x65d86f);};}exports[_0x7fd2('0x25')]=function(_0x34afdf,_0x4cbc64){var _0x22a366={},_0x5f668f={},_0x3aecfb={'count':0x0,'rows':[]};var _0x319b4a=_['map'](db[_0x7fd2('0x26')][_0x7fd2('0x27')],function(_0x531ed9){return{'name':_0x531ed9[_0x7fd2('0x28')],'type':_0x531ed9[_0x7fd2('0x29')][_0x7fd2('0x2a')]};});_0x5f668f['model']=_[_0x7fd2('0x2b')](_0x319b4a,_0x7fd2('0x23'));_0x5f668f['query']=_[_0x7fd2('0x2c')](_0x34afdf['query']);_0x5f668f['filters']=_[_0x7fd2('0x2d')](_0x5f668f[_0x7fd2('0x2e')],_0x5f668f[_0x7fd2('0x2f')]);_0x22a366[_0x7fd2('0x30')]=_[_0x7fd2('0x2d')](_0x5f668f[_0x7fd2('0x2e')],qs[_0x7fd2('0x31')](_0x34afdf[_0x7fd2('0x2f')]['fields']));_0x22a366[_0x7fd2('0x30')]=_0x22a366['attributes'][_0x7fd2('0x32')]?_0x22a366['attributes']:_0x5f668f['model'];if(!_0x34afdf['query'][_0x7fd2('0x33')](_0x7fd2('0x34'))){_0x22a366[_0x7fd2('0x1b')]=qs[_0x7fd2('0x1b')](_0x34afdf[_0x7fd2('0x2f')]['limit']);_0x22a366[_0x7fd2('0x18')]=qs[_0x7fd2('0x18')](_0x34afdf[_0x7fd2('0x2f')][_0x7fd2('0x18')]);}_0x22a366[_0x7fd2('0x35')]=qs[_0x7fd2('0x36')](_0x34afdf[_0x7fd2('0x2f')][_0x7fd2('0x36')]);_0x22a366['where']=qs[_0x7fd2('0x37')](_[_0x7fd2('0x38')](_0x34afdf['query'],_0x5f668f[_0x7fd2('0x37')]),_0x319b4a);if(_0x34afdf[_0x7fd2('0x2f')][_0x7fd2('0x39')]){_0x22a366['where']=_[_0x7fd2('0x3a')](_0x22a366[_0x7fd2('0x3b')],{'$or':_[_0x7fd2('0x2b')](_0x319b4a,function(_0x324594){if(_0x324594[_0x7fd2('0x29')]!==_0x7fd2('0x3c')){var _0x467813={};_0x467813[_0x324594['name']]={'$like':'%'+_0x34afdf[_0x7fd2('0x2f')][_0x7fd2('0x39')]+'%'};return _0x467813;}})});}_0x22a366=_[_0x7fd2('0x3a')]({},_0x22a366,_0x34afdf['options']);var _0x1885db={'where':_0x22a366[_0x7fd2('0x3b')]};return db[_0x7fd2('0x26')][_0x7fd2('0x1a')](_0x1885db)[_0x7fd2('0x20')](function(_0x472b1f){_0x3aecfb[_0x7fd2('0x1a')]=_0x472b1f;if(_0x34afdf[_0x7fd2('0x2f')][_0x7fd2('0x3d')]){_0x22a366[_0x7fd2('0x3e')]=[{'all':!![]}];}return db[_0x7fd2('0x26')][_0x7fd2('0x3f')](_0x22a366);})['then'](function(_0x4c15cb){_0x3aecfb[_0x7fd2('0x40')]=_0x4c15cb;return _0x3aecfb;})[_0x7fd2('0x20')](respondWithFilteredResult(_0x4cbc64,_0x22a366))[_0x7fd2('0x41')](handleError(_0x4cbc64,null));};exports[_0x7fd2('0x42')]=function(_0x298edf,_0x4b7591){var _0x1169f5={'raw':!![],'where':{'id':_0x298edf[_0x7fd2('0x43')]['id']}},_0x2d5266={};_0x2d5266[_0x7fd2('0x2e')]=_[_0x7fd2('0x2c')](db[_0x7fd2('0x26')]['rawAttributes']);_0x2d5266[_0x7fd2('0x2f')]=_[_0x7fd2('0x2c')](_0x298edf[_0x7fd2('0x2f')]);_0x2d5266[_0x7fd2('0x37')]=_[_0x7fd2('0x2d')](_0x2d5266[_0x7fd2('0x2e')],_0x2d5266[_0x7fd2('0x2f')]);_0x1169f5['attributes']=_['intersection'](_0x2d5266['model'],qs[_0x7fd2('0x31')](_0x298edf[_0x7fd2('0x2f')][_0x7fd2('0x31')]));_0x1169f5['attributes']=_0x1169f5[_0x7fd2('0x30')][_0x7fd2('0x32')]?_0x1169f5[_0x7fd2('0x30')]:_0x2d5266[_0x7fd2('0x2e')];if(_0x298edf[_0x7fd2('0x2f')][_0x7fd2('0x3d')]){_0x1169f5[_0x7fd2('0x3e')]=[{'all':!![]}];}_0x1169f5=_['merge']({},_0x1169f5,_0x298edf[_0x7fd2('0x44')]);return db[_0x7fd2('0x26')][_0x7fd2('0x45')](_0x1169f5)['then'](handleEntityNotFound(_0x4b7591,null))['then'](respondWithResult(_0x4b7591,null))[_0x7fd2('0x41')](handleError(_0x4b7591,null));};exports[_0x7fd2('0x46')]=function(_0x54415f,_0x2856f6){return db[_0x7fd2('0x26')][_0x7fd2('0x46')](_0x54415f[_0x7fd2('0x47')],{})[_0x7fd2('0x20')](respondWithResult(_0x2856f6,0xc9))[_0x7fd2('0x41')](handleError(_0x2856f6,null));};exports[_0x7fd2('0x48')]=function(_0x17031a,_0x29fb9c){if(_0x17031a[_0x7fd2('0x47')]['id']){delete _0x17031a['body']['id'];}return db[_0x7fd2('0x26')][_0x7fd2('0x45')]({'where':{'id':_0x17031a[_0x7fd2('0x43')]['id']}})['then'](handleEntityNotFound(_0x29fb9c,null))[_0x7fd2('0x20')](saveUpdates(_0x17031a[_0x7fd2('0x47')],null))[_0x7fd2('0x20')](respondWithResult(_0x29fb9c,null))[_0x7fd2('0x41')](handleError(_0x29fb9c,null));};exports[_0x7fd2('0x21')]=function(_0x5d11a5,_0x59e631){return db[_0x7fd2('0x26')][_0x7fd2('0x45')]({'where':{'id':_0x5d11a5[_0x7fd2('0x43')]['id']}})[_0x7fd2('0x20')](handleEntityNotFound(_0x59e631,null))[_0x7fd2('0x20')](removeEntity(_0x59e631,null))['catch'](handleError(_0x59e631,null));};exports[_0x7fd2('0x49')]=function(_0x5eddbe,_0x5906b7){return db[_0x7fd2('0x26')][_0x7fd2('0x49')]()['then'](respondWithResult(_0x5906b7,null))['catch'](handleError(_0x5906b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 520000f..27ba001 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 _0x7bf0=['../../config/logger','api','moment','bluebird','path','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash'];(function(_0x1c011c,_0x384710){var _0x277506=function(_0x92ca26){while(--_0x92ca26){_0x1c011c['push'](_0x1c011c['shift']());}};_0x277506(++_0x384710);}(_0x7bf0,0x13e));var _0x07bf=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7bf0[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x07bf('0x0'));var util=require('util');var logger=require(_0x07bf('0x1'))(_0x07bf('0x2'));var moment=require(_0x07bf('0x3'));var BPromise=require(_0x07bf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07bf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x07bf('0x6'));module[_0x07bf('0x7')]=function(_0x73511d,_0x4c6edf){return _0x73511d[_0x07bf('0x8')](_0x07bf('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x07bf('0xa'),'fields':[_0x07bf('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeea8=['bluebird','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xeea8,0x1ad));var _0x8eea=function(_0x15c4dc,_0x262078){_0x15c4dc=_0x15c4dc-0x0;var _0x5c05b6=_0xeea8[_0x15c4dc];return _0x5c05b6;};'use strict';var _=require(_0x8eea('0x0'));var util=require(_0x8eea('0x1'));var logger=require(_0x8eea('0x2'))(_0x8eea('0x3'));var moment=require(_0x8eea('0x4'));var BPromise=require(_0x8eea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eea('0x6'));var rimraf=require('rimraf');var config=require(_0x8eea('0x7'));var attributes=require(_0x8eea('0x8'));module[_0x8eea('0x9')]=function(_0x5927f0,_0x305ff0){return _0x5927f0[_0x8eea('0xa')](_0x8eea('0xb'),attributes,{'tableName':_0x8eea('0xc'),'paranoid':![],'indexes':[{'name':_0x8eea('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index ffb3518..81f7618 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 _0x383d=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x528402,_0xf0680f){var _0x31f98d=function(_0x58328e){while(--_0x58328e){_0x528402['push'](_0x528402['shift']());}};_0x31f98d(++_0xf0680f);}(_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 moment=require(_0xd383('0x0'));var BPromise=require(_0xd383('0x1'));var rs=require(_0xd383('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd383('0x3'))['db'];var utils=require(_0xd383('0x4'));var logger=require(_0xd383('0x5'))(_0xd383('0x6'));var config=require(_0xd383('0x7'));var jayson=require(_0xd383('0x8'));var client=jayson['client'][_0xd383('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ba82,_0x9922e9,_0x470d8d){return new BPromise(function(_0xffa778,_0x5d4e0f){return client['request'](_0x30ba82,_0x470d8d)[_0xd383('0xa')](function(_0xb3ff62){logger['info'](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));logger[_0xd383('0xd')](_0xd383('0xe'),_0x9922e9,_0xd383('0xc'),JSON[_0xd383('0xf')](_0xb3ff62));if(_0xb3ff62['error']){if(_0xb3ff62[_0xd383('0x10')][_0xd383('0x11')]===0x1f4){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0xb3ff62['error'][_0xd383('0x12')]);return _0x5d4e0f(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}logger[_0xd383('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x9922e9,_0xb3ff62[_0xd383('0x10')]['message']);return _0xffa778(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}else{logger[_0xd383('0x13')](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));_0xffa778(_0xb3ff62[_0xd383('0x14')]['message']);}})['catch'](function(_0x3905c1){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0x3905c1);_0x5d4e0f(_0x3905c1);});});} \ No newline at end of file +var _0x8a28=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0xabeaeb,_0x2039e7){var _0x27f367=function(_0x1118a0){while(--_0x1118a0){_0xabeaeb['push'](_0xabeaeb['shift']());}};_0x27f367(++_0x2039e7);}(_0x8a28,0xfd));var _0x88a2=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8a28[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));var BPromise=require(_0x88a2('0x3'));var rs=require(_0x88a2('0x4'));var fs=require('fs');var Redis=require(_0x88a2('0x5'));var db=require(_0x88a2('0x6'))['db'];var utils=require(_0x88a2('0x7'));var logger=require('../../config/logger')(_0x88a2('0x8'));var config=require(_0x88a2('0x9'));var jayson=require(_0x88a2('0xa'));var client=jayson[_0x88a2('0xb')][_0x88a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cb591,_0x1629ea,_0x5406ed){return new BPromise(function(_0x1cdf6b,_0x2a8576){return client[_0x88a2('0xd')](_0x5cb591,_0x5406ed)[_0x88a2('0xe')](function(_0x2db7dd){logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));logger[_0x88a2('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x1629ea,'request\x20sent',JSON[_0x88a2('0x13')](_0x2db7dd));if(_0x2db7dd[_0x88a2('0x14')]){if(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x15')]===0x1f4){logger[_0x88a2('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x2a8576(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);}logger['error'](_0x88a2('0x10'),_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x1cdf6b(_0x2db7dd['error'][_0x88a2('0x16')]);}else{logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));_0x1cdf6b(_0x2db7dd[_0x88a2('0x17')][_0x88a2('0x16')]);}})[_0x88a2('0x18')](function(_0x2f5220){logger[_0x88a2('0x14')](_0x88a2('0x10'),_0x1629ea,_0x2f5220);_0x2a8576(_0x2f5220);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e39fbae..d2ecd86 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 _0x46c2=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x365b05,_0x3c3537){var _0x1b9556=function(_0x755936){while(--_0x755936){_0x365b05['push'](_0x365b05['shift']());}};_0x1b9556(++_0x3c3537);}(_0x46c2,0x180));var _0x246c=function(_0x14d6bb,_0x388b8e){_0x14d6bb=_0x14d6bb-0x0;var _0x191d22=_0x46c2[_0x14d6bb];return _0x191d22;};'use strict';var multer=require(_0x246c('0x0'));var util=require(_0x246c('0x1'));var path=require(_0x246c('0x2'));var timeout=require(_0x246c('0x3'));var express=require(_0x246c('0x4'));var router=express[_0x246c('0x5')]();var fs_extra=require(_0x246c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./pause.controller');router['get']('/',auth[_0x246c('0x7')](),controller[_0x246c('0x8')]);router[_0x246c('0x9')](_0x246c('0xa'),auth['isAuthenticated'](),controller[_0x246c('0xb')]);router[_0x246c('0xc')]('/',auth['isAuthenticated'](),controller[_0x246c('0xd')]);router[_0x246c('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x246c('0xf')]);module[_0x246c('0x10')]=router; \ No newline at end of file +var _0x30da=['path','connect-timeout','express','Router','../../components/auth/service','./pause.controller','isAuthenticated','index','get','/:id','put','update','destroy','multer'];(function(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0x30da,0x14f));var _0xa30d=function(_0x29fda0,_0x2b6ec4){_0x29fda0=_0x29fda0-0x0;var _0xcfa4d6=_0x30da[_0x29fda0];return _0xcfa4d6;};'use strict';var multer=require(_0xa30d('0x0'));var util=require('util');var path=require(_0xa30d('0x1'));var timeout=require(_0xa30d('0x2'));var express=require(_0xa30d('0x3'));var router=express[_0xa30d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa30d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa30d('0x6'));router['get']('/',auth[_0xa30d('0x7')](),controller[_0xa30d('0x8')]);router[_0xa30d('0x9')](_0xa30d('0xa'),auth[_0xa30d('0x7')](),controller['show']);router['post']('/',auth[_0xa30d('0x7')](),controller['create']);router[_0xa30d('0xb')](_0xa30d('0xa'),auth[_0xa30d('0x7')](),controller[_0xa30d('0xc')]);router['delete']('/:id',auth[_0xa30d('0x7')](),controller[_0xa30d('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index c1f0e4d..9f55c30 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 _0x27d3=['sequelize','exports','STRING','name'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x27d3,0x70));var _0x327d=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x27d3[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require(_0x327d('0x0'));module[_0x327d('0x1')]={'name':{'type':Sequelize[_0x327d('0x2')],'unique':_0x327d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x327d('0x2')]}}; \ No newline at end of file +var _0x4ac2=['exports','STRING','sequelize'];(function(_0x415005,_0x595685){var _0x50002f=function(_0x68b2a2){while(--_0x68b2a2){_0x415005['push'](_0x415005['shift']());}};_0x50002f(++_0x595685);}(_0x4ac2,0x12b));var _0x24ac=function(_0x5a7513,_0xa2742f){_0x5a7513=_0x5a7513-0x0;var _0x41af54=_0x4ac2[_0x5a7513];return _0x41af54;};'use strict';var Sequelize=require(_0x24ac('0x0'));module[_0x24ac('0x1')]={'name':{'type':Sequelize[_0x24ac('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x24ac('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index b5251da..48e6009 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 _0x8f0f=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../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','then','destroy','get','Pauses','UserProfileResource','sendStatus','send','index','map','Pause','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show'];(function(_0x49aa10,_0x3ec2f0){var _0x1c659b=function(_0x52ac2f){while(--_0x52ac2f){_0x49aa10['push'](_0x49aa10['shift']());}};_0x1c659b(++_0x3ec2f0);}(_0x8f0f,0x15c));var _0xf8f0=function(_0x43a450,_0x64bfe1){_0x43a450=_0x43a450-0x0;var _0x2e257a=_0x8f0f[_0x43a450];return _0x2e257a;};'use strict';var emlformat=require(_0xf8f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8f0('0x2'));var moment=require(_0xf8f0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf8f0('0x4'));var util=require(_0xf8f0('0x5'));var path=require(_0xf8f0('0x6'));var sox=require(_0xf8f0('0x7'));var csv=require(_0xf8f0('0x8'));var ejs=require(_0xf8f0('0x9'));var fs=require('fs');var fs_extra=require(_0xf8f0('0xa'));var _=require(_0xf8f0('0xb'));var squel=require(_0xf8f0('0xc'));var crypto=require(_0xf8f0('0xd'));var jsforce=require(_0xf8f0('0xe'));var deskjs=require(_0xf8f0('0xf'));var toCsv=require(_0xf8f0('0x8'));var querystring=require(_0xf8f0('0x10'));var Papa=require(_0xf8f0('0x11'));var Redis=require(_0xf8f0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f0('0x13'));var logger=require(_0xf8f0('0x14'))(_0xf8f0('0x15'));var utils=require(_0xf8f0('0x16'));var config=require(_0xf8f0('0x17'));var licenseUtil=require(_0xf8f0('0x18'));var db=require(_0xf8f0('0x19'))['db'];function respondWithStatusCode(_0x40a8a3,_0x3f7a17){_0x3f7a17=_0x3f7a17||0xcc;return function(_0x2c47b2){if(_0x2c47b2){return _0x40a8a3['sendStatus'](_0x3f7a17);}return _0x40a8a3[_0xf8f0('0x1a')](_0x3f7a17)[_0xf8f0('0x1b')]();};}function respondWithResult(_0x3b44d1,_0x37284f){_0x37284f=_0x37284f||0xc8;return function(_0x110717){if(_0x110717){return _0x3b44d1[_0xf8f0('0x1a')](_0x37284f)[_0xf8f0('0x1c')](_0x110717);}};}function respondWithFilteredResult(_0x41af3a,_0xb44199){return function(_0x4636eb){if(_0x4636eb){var _0x48559b=typeof _0xb44199[_0xf8f0('0x1d')]===_0xf8f0('0x1e')&&typeof _0xb44199[_0xf8f0('0x1f')]==='undefined';var _0x2631c9=_0x4636eb[_0xf8f0('0x20')];var _0x4add1d=_0x48559b?0x0:_0xb44199['offset'];var _0x55e91f=_0x48559b?_0x4636eb[_0xf8f0('0x20')]:_0xb44199[_0xf8f0('0x1d')]+_0xb44199['limit'];var _0x5639c1;if(_0x55e91f>=_0x2631c9){_0x55e91f=_0x2631c9;_0x5639c1=0xc8;}else{_0x5639c1=0xce;}_0x41af3a[_0xf8f0('0x1a')](_0x5639c1);return _0x41af3a[_0xf8f0('0x21')](_0xf8f0('0x22'),_0x4add1d+'-'+_0x55e91f+'/'+_0x2631c9)['json'](_0x4636eb);}return null;};}function patchUpdates(_0x4323cf){return function(_0x1dad48){try{jsonpatch[_0xf8f0('0x23')](_0x1dad48,_0x4323cf,!![]);}catch(_0xa1fe18){return BPromise['reject'](_0xa1fe18);}return _0x1dad48[_0xf8f0('0x24')]();};}function saveUpdates(_0x322426,_0x37abc4){return function(_0x4f658e){if(_0x4f658e){return _0x4f658e['update'](_0x322426)[_0xf8f0('0x25')](function(_0x287c75){return _0x287c75;});}return null;};}function removeEntity(_0x17af9c,_0x5275de){return function(_0x44d2ec){if(_0x44d2ec){return _0x44d2ec[_0xf8f0('0x26')]()[_0xf8f0('0x25')](function(){var _0x1f5e17=_0x44d2ec[_0xf8f0('0x27')]({'plain':!![]});var _0x2b6953=_0xf8f0('0x28');return db[_0xf8f0('0x29')][_0xf8f0('0x26')]({'where':{'type':_0x2b6953,'resourceId':_0x1f5e17['id']}})[_0xf8f0('0x25')](function(){return _0x44d2ec;});})[_0xf8f0('0x25')](function(){_0x17af9c['status'](0xcc)[_0xf8f0('0x1b')]();});}};}function handleEntityNotFound(_0x146e12,_0x2887d5){return function(_0x5cc229){if(!_0x5cc229){_0x146e12[_0xf8f0('0x2a')](0x194);}return _0x5cc229;};}function handleError(_0x5d8392,_0x4cddd8){_0x4cddd8=_0x4cddd8||0x1f4;return function(_0xfe77ec){logger['error'](_0xfe77ec['stack']);if(_0xfe77ec['name']){delete _0xfe77ec['name'];}_0x5d8392[_0xf8f0('0x1a')](_0x4cddd8)[_0xf8f0('0x2b')](_0xfe77ec);};}exports[_0xf8f0('0x2c')]=function(_0x15c06c,_0x85d2f4){var _0x3b4bb6={},_0x21feee={},_0x57c63b={'count':0x0,'rows':[]};var _0x485826=_[_0xf8f0('0x2d')](db[_0xf8f0('0x2e')][_0xf8f0('0x2f')],function(_0x118a03){return{'name':_0x118a03[_0xf8f0('0x30')],'type':_0x118a03[_0xf8f0('0x31')]['key']};});_0x21feee[_0xf8f0('0x32')]=_[_0xf8f0('0x2d')](_0x485826,_0xf8f0('0x33'));_0x21feee[_0xf8f0('0x34')]=_[_0xf8f0('0x35')](_0x15c06c[_0xf8f0('0x34')]);_0x21feee[_0xf8f0('0x36')]=_['intersection'](_0x21feee[_0xf8f0('0x32')],_0x21feee['query']);_0x3b4bb6[_0xf8f0('0x37')]=_[_0xf8f0('0x38')](_0x21feee[_0xf8f0('0x32')],qs[_0xf8f0('0x39')](_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x39')]));_0x3b4bb6[_0xf8f0('0x37')]=_0x3b4bb6['attributes'][_0xf8f0('0x3a')]?_0x3b4bb6[_0xf8f0('0x37')]:_0x21feee[_0xf8f0('0x32')];if(!_0x15c06c['query']['hasOwnProperty'](_0xf8f0('0x3b'))){_0x3b4bb6[_0xf8f0('0x1f')]=qs[_0xf8f0('0x1f')](_0x15c06c['query'][_0xf8f0('0x1f')]);_0x3b4bb6[_0xf8f0('0x1d')]=qs[_0xf8f0('0x1d')](_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x1d')]);}_0x3b4bb6[_0xf8f0('0x3c')]=qs['sort'](_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x3d')]);_0x3b4bb6[_0xf8f0('0x3e')]=qs[_0xf8f0('0x36')](_['pick'](_0x15c06c[_0xf8f0('0x34')],_0x21feee[_0xf8f0('0x36')]),_0x485826);if(_0x15c06c[_0xf8f0('0x34')]['filter']){_0x3b4bb6[_0xf8f0('0x3e')]=_[_0xf8f0('0x3f')](_0x3b4bb6['where'],{'$or':_[_0xf8f0('0x2d')](_0x485826,function(_0x18ed3c){if(_0x18ed3c[_0xf8f0('0x31')]!==_0xf8f0('0x40')){var _0x22f0de={};_0x22f0de[_0x18ed3c[_0xf8f0('0x33')]]={'$like':'%'+_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x41')]+'%'};return _0x22f0de;}})});}_0x3b4bb6=_[_0xf8f0('0x3f')]({},_0x3b4bb6,_0x15c06c[_0xf8f0('0x42')]);var _0xca6786={'where':_0x3b4bb6[_0xf8f0('0x3e')]};return db['Pause'][_0xf8f0('0x20')](_0xca6786)[_0xf8f0('0x25')](function(_0x2c9f73){_0x57c63b['count']=_0x2c9f73;if(_0x15c06c['query'][_0xf8f0('0x43')]){_0x3b4bb6[_0xf8f0('0x44')]=[{'all':!![]}];}return db[_0xf8f0('0x2e')][_0xf8f0('0x45')](_0x3b4bb6);})['then'](function(_0x492604){_0x57c63b['rows']=_0x492604;return _0x57c63b;})[_0xf8f0('0x25')](respondWithFilteredResult(_0x85d2f4,_0x3b4bb6))[_0xf8f0('0x46')](handleError(_0x85d2f4,null));};exports[_0xf8f0('0x47')]=function(_0x49d11d,_0x514877){var _0x3b6a05={'raw':!![],'where':{'id':_0x49d11d['params']['id']}},_0x1db624={};_0x1db624[_0xf8f0('0x32')]=_['keys'](db['Pause'][_0xf8f0('0x2f')]);_0x1db624[_0xf8f0('0x34')]=_[_0xf8f0('0x35')](_0x49d11d[_0xf8f0('0x34')]);_0x1db624['filters']=_[_0xf8f0('0x38')](_0x1db624[_0xf8f0('0x32')],_0x1db624[_0xf8f0('0x34')]);_0x3b6a05[_0xf8f0('0x37')]=_[_0xf8f0('0x38')](_0x1db624['model'],qs[_0xf8f0('0x39')](_0x49d11d[_0xf8f0('0x34')]['fields']));_0x3b6a05[_0xf8f0('0x37')]=_0x3b6a05[_0xf8f0('0x37')][_0xf8f0('0x3a')]?_0x3b6a05['attributes']:_0x1db624[_0xf8f0('0x32')];if(_0x49d11d[_0xf8f0('0x34')]['includeAll']){_0x3b6a05[_0xf8f0('0x44')]=[{'all':!![]}];}_0x3b6a05=_[_0xf8f0('0x3f')]({},_0x3b6a05,_0x49d11d[_0xf8f0('0x42')]);return db['Pause']['find'](_0x3b6a05)[_0xf8f0('0x25')](handleEntityNotFound(_0x514877,null))[_0xf8f0('0x25')](respondWithResult(_0x514877,null))[_0xf8f0('0x46')](handleError(_0x514877,null));};exports[_0xf8f0('0x48')]=function(_0x4ba1a2,_0x4f189b){return db[_0xf8f0('0x2e')]['create'](_0x4ba1a2[_0xf8f0('0x49')],{})[_0xf8f0('0x25')](function(_0x4e27a){var _0x4ab2cd=_0x4ba1a2[_0xf8f0('0x4a')][_0xf8f0('0x27')]({'plain':!![]});if(!_0x4ab2cd)throw new Error(_0xf8f0('0x4b'));if(_0x4ab2cd[_0xf8f0('0x4c')]===_0xf8f0('0x4a')){var _0x226879=_0x4e27a[_0xf8f0('0x27')]({'plain':!![]});var _0x41b1c1=_0xf8f0('0x28');return db[_0xf8f0('0x4d')][_0xf8f0('0x4e')]({'where':{'name':_0x41b1c1,'userProfileId':_0x4ab2cd[_0xf8f0('0x4f')]},'raw':!![]})[_0xf8f0('0x25')](function(_0x3056db){if(_0x3056db&&_0x3056db[_0xf8f0('0x50')]===0x0){return db[_0xf8f0('0x29')]['create']({'name':_0x226879[_0xf8f0('0x33')],'resourceId':_0x226879['id'],'type':_0x3056db[_0xf8f0('0x33')],'sectionId':_0x3056db['id']},{})[_0xf8f0('0x25')](function(){return _0x4e27a;});}else{return _0x4e27a;}})[_0xf8f0('0x46')](function(_0x503692){logger['error'](_0xf8f0('0x51'),_0x503692);throw _0x503692;});}return _0x4e27a;})[_0xf8f0('0x25')](respondWithResult(_0x4f189b,0xc9))[_0xf8f0('0x46')](handleError(_0x4f189b,null));};exports[_0xf8f0('0x52')]=function(_0x2b8d59,_0x4c995d){if(_0x2b8d59[_0xf8f0('0x49')]['id']){delete _0x2b8d59[_0xf8f0('0x49')]['id'];}return db['Pause'][_0xf8f0('0x4e')]({'where':{'id':_0x2b8d59['params']['id']}})['then'](handleEntityNotFound(_0x4c995d,null))[_0xf8f0('0x25')](saveUpdates(_0x2b8d59[_0xf8f0('0x49')],null))[_0xf8f0('0x25')](respondWithResult(_0x4c995d,null))['catch'](handleError(_0x4c995d,null));};exports[_0xf8f0('0x26')]=function(_0x35094f,_0x2226a2){return db[_0xf8f0('0x2e')][_0xf8f0('0x4e')]({'where':{'id':_0x35094f[_0xf8f0('0x53')]['id']}})[_0xf8f0('0x25')](handleEntityNotFound(_0x2226a2,null))[_0xf8f0('0x25')](removeEntity(_0x2226a2,null))[_0xf8f0('0x46')](handleError(_0x2226a2,null));}; \ No newline at end of file +var _0x2284=['Pauses','UserProfileResource','destroy','end','sendStatus','error','stack','send','index','map','Pause','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','get'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x2284,0x12d));var _0x4228=function(_0x3296db,_0x4b4164){_0x3296db=_0x3296db-0x0;var _0xeb89ff=_0x2284[_0x3296db];return _0xeb89ff;};'use strict';var emlformat=require(_0x4228('0x0'));var rimraf=require(_0x4228('0x1'));var zipdir=require(_0x4228('0x2'));var jsonpatch=require(_0x4228('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4228('0x4'));var Mustache=require(_0x4228('0x5'));var util=require(_0x4228('0x6'));var path=require('path');var sox=require(_0x4228('0x7'));var csv=require(_0x4228('0x8'));var ejs=require(_0x4228('0x9'));var fs=require('fs');var fs_extra=require(_0x4228('0xa'));var _=require(_0x4228('0xb'));var squel=require(_0x4228('0xc'));var crypto=require(_0x4228('0xd'));var jsforce=require(_0x4228('0xe'));var deskjs=require(_0x4228('0xf'));var toCsv=require(_0x4228('0x8'));var querystring=require(_0x4228('0x10'));var Papa=require(_0x4228('0x11'));var Redis=require(_0x4228('0x12'));var authService=require(_0x4228('0x13'));var qs=require(_0x4228('0x14'));var as=require(_0x4228('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4228('0x16'))(_0x4228('0x17'));var utils=require('../../config/utils');var config=require(_0x4228('0x18'));var licenseUtil=require(_0x4228('0x19'));var db=require(_0x4228('0x1a'))['db'];function respondWithStatusCode(_0x2b3df1,_0x203bd6){_0x203bd6=_0x203bd6||0xcc;return function(_0xb81d6d){if(_0xb81d6d){return _0x2b3df1['sendStatus'](_0x203bd6);}return _0x2b3df1[_0x4228('0x1b')](_0x203bd6)['end']();};}function respondWithResult(_0xce1ed6,_0x3631e2){_0x3631e2=_0x3631e2||0xc8;return function(_0x1aecc1){if(_0x1aecc1){return _0xce1ed6[_0x4228('0x1b')](_0x3631e2)[_0x4228('0x1c')](_0x1aecc1);}};}function respondWithFilteredResult(_0x45e696,_0x4afab6){return function(_0x54abe2){if(_0x54abe2){var _0x369586=typeof _0x4afab6[_0x4228('0x1d')]===_0x4228('0x1e')&&typeof _0x4afab6[_0x4228('0x1f')]==='undefined';var _0x3073c5=_0x54abe2['count'];var _0x2123a8=_0x369586?0x0:_0x4afab6[_0x4228('0x1d')];var _0x156bb7=_0x369586?_0x54abe2['count']:_0x4afab6[_0x4228('0x1d')]+_0x4afab6['limit'];var _0x441cff;if(_0x156bb7>=_0x3073c5){_0x156bb7=_0x3073c5;_0x441cff=0xc8;}else{_0x441cff=0xce;}_0x45e696[_0x4228('0x1b')](_0x441cff);return _0x45e696[_0x4228('0x20')](_0x4228('0x21'),_0x2123a8+'-'+_0x156bb7+'/'+_0x3073c5)[_0x4228('0x1c')](_0x54abe2);}return null;};}function patchUpdates(_0x2dd5f6){return function(_0x5d5c35){try{jsonpatch[_0x4228('0x22')](_0x5d5c35,_0x2dd5f6,!![]);}catch(_0x27f0dd){return BPromise[_0x4228('0x23')](_0x27f0dd);}return _0x5d5c35['save']();};}function saveUpdates(_0xede1e5,_0x42c64a){return function(_0x4631fd){if(_0x4631fd){return _0x4631fd[_0x4228('0x24')](_0xede1e5)[_0x4228('0x25')](function(_0x4b137f){return _0x4b137f;});}return null;};}function removeEntity(_0x7fdb0a,_0x397b1d){return function(_0x344552){if(_0x344552){return _0x344552['destroy']()['then'](function(){var _0x1ec25a=_0x344552[_0x4228('0x26')]({'plain':!![]});var _0xa4915b=_0x4228('0x27');return db[_0x4228('0x28')][_0x4228('0x29')]({'where':{'type':_0xa4915b,'resourceId':_0x1ec25a['id']}})[_0x4228('0x25')](function(){return _0x344552;});})[_0x4228('0x25')](function(){_0x7fdb0a[_0x4228('0x1b')](0xcc)[_0x4228('0x2a')]();});}};}function handleEntityNotFound(_0x3db471,_0x4ecf65){return function(_0x13dfb9){if(!_0x13dfb9){_0x3db471[_0x4228('0x2b')](0x194);}return _0x13dfb9;};}function handleError(_0xceae45,_0xb1ff84){_0xb1ff84=_0xb1ff84||0x1f4;return function(_0x39533a){logger[_0x4228('0x2c')](_0x39533a[_0x4228('0x2d')]);if(_0x39533a['name']){delete _0x39533a['name'];}_0xceae45[_0x4228('0x1b')](_0xb1ff84)[_0x4228('0x2e')](_0x39533a);};}exports[_0x4228('0x2f')]=function(_0x2ffe04,_0x2216d9){var _0x15f803={},_0x5f05e9={},_0x29c2ce={'count':0x0,'rows':[]};var _0x55d2de=_[_0x4228('0x30')](db[_0x4228('0x31')][_0x4228('0x32')],function(_0x16d3fc){return{'name':_0x16d3fc[_0x4228('0x33')],'type':_0x16d3fc['type'][_0x4228('0x34')]};});_0x5f05e9[_0x4228('0x35')]=_[_0x4228('0x30')](_0x55d2de,_0x4228('0x36'));_0x5f05e9['query']=_['keys'](_0x2ffe04[_0x4228('0x37')]);_0x5f05e9[_0x4228('0x38')]=_[_0x4228('0x39')](_0x5f05e9['model'],_0x5f05e9['query']);_0x15f803[_0x4228('0x3a')]=_[_0x4228('0x39')](_0x5f05e9['model'],qs[_0x4228('0x3b')](_0x2ffe04[_0x4228('0x37')][_0x4228('0x3b')]));_0x15f803[_0x4228('0x3a')]=_0x15f803[_0x4228('0x3a')][_0x4228('0x3c')]?_0x15f803[_0x4228('0x3a')]:_0x5f05e9[_0x4228('0x35')];if(!_0x2ffe04[_0x4228('0x37')][_0x4228('0x3d')](_0x4228('0x3e'))){_0x15f803[_0x4228('0x1f')]=qs['limit'](_0x2ffe04[_0x4228('0x37')][_0x4228('0x1f')]);_0x15f803['offset']=qs[_0x4228('0x1d')](_0x2ffe04['query'][_0x4228('0x1d')]);}_0x15f803[_0x4228('0x3f')]=qs[_0x4228('0x40')](_0x2ffe04[_0x4228('0x37')]['sort']);_0x15f803[_0x4228('0x41')]=qs[_0x4228('0x38')](_[_0x4228('0x42')](_0x2ffe04[_0x4228('0x37')],_0x5f05e9[_0x4228('0x38')]),_0x55d2de);if(_0x2ffe04['query'][_0x4228('0x43')]){_0x15f803[_0x4228('0x41')]=_['merge'](_0x15f803[_0x4228('0x41')],{'$or':_[_0x4228('0x30')](_0x55d2de,function(_0x4406d7){if(_0x4406d7['type']!==_0x4228('0x44')){var _0x39251c={};_0x39251c[_0x4406d7[_0x4228('0x36')]]={'$like':'%'+_0x2ffe04['query']['filter']+'%'};return _0x39251c;}})});}_0x15f803=_[_0x4228('0x45')]({},_0x15f803,_0x2ffe04[_0x4228('0x46')]);var _0x5c38ed={'where':_0x15f803['where']};return db[_0x4228('0x31')]['count'](_0x5c38ed)[_0x4228('0x25')](function(_0x1113fe){_0x29c2ce['count']=_0x1113fe;if(_0x2ffe04['query'][_0x4228('0x47')]){_0x15f803[_0x4228('0x48')]=[{'all':!![]}];}return db[_0x4228('0x31')][_0x4228('0x49')](_0x15f803);})[_0x4228('0x25')](function(_0x5d36a8){_0x29c2ce['rows']=_0x5d36a8;return _0x29c2ce;})[_0x4228('0x25')](respondWithFilteredResult(_0x2216d9,_0x15f803))[_0x4228('0x4a')](handleError(_0x2216d9,null));};exports['show']=function(_0x5a1a74,_0x1f1ac3){var _0x45b5a0={'raw':!![],'where':{'id':_0x5a1a74[_0x4228('0x4b')]['id']}},_0x34c513={};_0x34c513[_0x4228('0x35')]=_['keys'](db[_0x4228('0x31')][_0x4228('0x32')]);_0x34c513[_0x4228('0x37')]=_['keys'](_0x5a1a74['query']);_0x34c513[_0x4228('0x38')]=_[_0x4228('0x39')](_0x34c513[_0x4228('0x35')],_0x34c513[_0x4228('0x37')]);_0x45b5a0[_0x4228('0x3a')]=_[_0x4228('0x39')](_0x34c513[_0x4228('0x35')],qs[_0x4228('0x3b')](_0x5a1a74[_0x4228('0x37')][_0x4228('0x3b')]));_0x45b5a0['attributes']=_0x45b5a0[_0x4228('0x3a')][_0x4228('0x3c')]?_0x45b5a0[_0x4228('0x3a')]:_0x34c513[_0x4228('0x35')];if(_0x5a1a74[_0x4228('0x37')][_0x4228('0x47')]){_0x45b5a0[_0x4228('0x48')]=[{'all':!![]}];}_0x45b5a0=_[_0x4228('0x45')]({},_0x45b5a0,_0x5a1a74[_0x4228('0x46')]);return db[_0x4228('0x31')][_0x4228('0x4c')](_0x45b5a0)[_0x4228('0x25')](handleEntityNotFound(_0x1f1ac3,null))[_0x4228('0x25')](respondWithResult(_0x1f1ac3,null))[_0x4228('0x4a')](handleError(_0x1f1ac3,null));};exports['create']=function(_0x195a76,_0x35190c){return db[_0x4228('0x31')][_0x4228('0x4d')](_0x195a76[_0x4228('0x4e')],{})[_0x4228('0x25')](function(_0x551c55){var _0x150e3a=_0x195a76[_0x4228('0x4f')][_0x4228('0x26')]({'plain':!![]});if(!_0x150e3a)throw new Error(_0x4228('0x50'));if(_0x150e3a[_0x4228('0x51')]===_0x4228('0x4f')){var _0x279a70=_0x551c55[_0x4228('0x26')]({'plain':!![]});var _0x1a4ef6=_0x4228('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x1a4ef6,'userProfileId':_0x150e3a[_0x4228('0x52')]},'raw':!![]})[_0x4228('0x25')](function(_0x1371ed){if(_0x1371ed&&_0x1371ed[_0x4228('0x53')]===0x0){return db['UserProfileResource'][_0x4228('0x4d')]({'name':_0x279a70[_0x4228('0x36')],'resourceId':_0x279a70['id'],'type':_0x1371ed['name'],'sectionId':_0x1371ed['id']},{})['then'](function(){return _0x551c55;});}else{return _0x551c55;}})[_0x4228('0x4a')](function(_0x2e8f2b){logger[_0x4228('0x2c')](_0x4228('0x54'),_0x2e8f2b);throw _0x2e8f2b;});}return _0x551c55;})[_0x4228('0x25')](respondWithResult(_0x35190c,0xc9))[_0x4228('0x4a')](handleError(_0x35190c,null));};exports[_0x4228('0x24')]=function(_0x517134,_0x14c4bf){if(_0x517134[_0x4228('0x4e')]['id']){delete _0x517134[_0x4228('0x4e')]['id'];}return db[_0x4228('0x31')][_0x4228('0x4c')]({'where':{'id':_0x517134[_0x4228('0x4b')]['id']}})[_0x4228('0x25')](handleEntityNotFound(_0x14c4bf,null))['then'](saveUpdates(_0x517134[_0x4228('0x4e')],null))[_0x4228('0x25')](respondWithResult(_0x14c4bf,null))['catch'](handleError(_0x14c4bf,null));};exports[_0x4228('0x29')]=function(_0x5ca4c4,_0x1136f1){return db['Pause'][_0x4228('0x4c')]({'where':{'id':_0x5ca4c4[_0x4228('0x4b')]['id']}})[_0x4228('0x25')](handleEntityNotFound(_0x1136f1,null))['then'](removeEntity(_0x1136f1,null))[_0x4228('0x4a')](handleError(_0x1136f1,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index faa5ffd..104e9cb 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5b1df4,_0x32a859){var _0x3f1fe8=function(_0x4c8ca2){while(--_0x4c8ca2){_0x5b1df4['push'](_0x5b1df4['shift']());}};_0x3f1fe8(++_0x32a859);}(_0x1cb9,0x14e));var _0x91cb=function(_0x210913,_0x4694d6){_0x210913=_0x210913-0x0;var _0x580bc2=_0x1cb9[_0x210913];return _0x580bc2;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x7217,0x19e));var _0x7721=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7217[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 06f613d..e900ff8 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x28ecd3,_0x167170){var _0x55e716=function(_0x224322){while(--_0x224322){_0x28ecd3['push'](_0x28ecd3['shift']());}};_0x55e716(++_0x167170);}(_0xb10b,0x12a));var _0xbb10=function(_0x57a430,_0x281e18){_0x57a430=_0x57a430-0x0;var _0x533e30=_0xb10b[_0x57a430];return _0x533e30;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xe2083a,_0x5a1119){var _0x41e16f=function(_0x1f4150){while(--_0x1f4150){_0xe2083a['push'](_0xe2083a['shift']());}};_0x41e16f(++_0x5a1119);}(_0xb10b,0x12a));var _0xbb10=function(_0x3311ae,_0x362cee){_0x3311ae=_0x3311ae-0x0;var _0x107949=_0xb10b[_0x3311ae];return _0x107949;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 1218f43..f84f126 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 _0xbd50=['extname','post','single','upload','webhookPost','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/webhook','webhookGet','show','download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename'];(function(_0xc6e86,_0x2e17d0){var _0x5f0d0c=function(_0x38ca85){while(--_0x38ca85){_0xc6e86['push'](_0xc6e86['shift']());}};_0x5f0d0c(++_0x2e17d0);}(_0xbd50,0x196));var _0x0bd5=function(_0x4dc770,_0x362b51){_0x4dc770=_0x4dc770-0x0;var _0x4ccc4d=_0xbd50[_0x4dc770];return _0x4ccc4d;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),controller[_0x0bd5('0xc')]);router['get']('/:id',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0xa')]('/:id/download',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x210f45,_0x7db86e,_0x4d7d17){_0x4d7d17(null,path[_0x0bd5('0xf')](config[_0x0bd5('0x10')],_0x0bd5('0x11')));},'filename':function(_0x5f49ee,_0x2f7a0c,_0x23982f){_0x2f7a0c[_0x0bd5('0x12')]=_0x2f7a0c[_0x0bd5('0x12')][_0x0bd5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23982f(null,util[_0x0bd5('0x14')](_0x0bd5('0x15'),path[_0x0bd5('0x16')](_0x2f7a0c['originalname'],path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])),Date['now'](),path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])));}})});router[_0x0bd5('0x18')]('/',upload[_0x0bd5('0x19')]('file'),controller[_0x0bd5('0x1a')]);router[_0x0bd5('0x18')](_0x0bd5('0xb'),controller[_0x0bd5('0x1b')]);router[_0x0bd5('0x1c')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1e')]);router[_0x0bd5('0x1f')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1f')]);module[_0x0bd5('0x20')]=router; \ No newline at end of file +var _0x2123=['join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','isAuthenticated','show','/:id/download','diskStorage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2123,0x190));var _0x3212=function(_0x4f1e6d,_0x8924de){_0x4f1e6d=_0x4f1e6d-0x0;var _0xdc791e=_0x2123[_0x4f1e6d];return _0xdc791e;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),controller['webhookGet']);router[_0x3212('0xb')]('/:id',auth[_0x3212('0xe')](),controller[_0x3212('0xf')]);router[_0x3212('0xb')](_0x3212('0x10'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x3212('0x11')]({'destination':function(_0xf166c2,_0x1a3b2f,_0x23f7e3){_0x23f7e3(null,path[_0x3212('0x12')](config[_0x3212('0x13')],_0x3212('0x14')));},'filename':function(_0x359cef,_0x26c1c8,_0x2d5fce){_0x26c1c8[_0x3212('0x15')]=_0x26c1c8[_0x3212('0x15')][_0x3212('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d5fce(null,util[_0x3212('0x17')](_0x3212('0x18'),path[_0x3212('0x19')](_0x26c1c8[_0x3212('0x15')],path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])),Date[_0x3212('0x1b')](),path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])));}})});router['post']('/',upload[_0x3212('0x1c')](_0x3212('0x1d')),controller[_0x3212('0x1e')]);router[_0x3212('0x1f')](_0x3212('0xd'),controller[_0x3212('0x20')]);router[_0x3212('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x3212('0x22')]);router['delete'](_0x3212('0x23'),auth[_0x3212('0xe')](),controller[_0x3212('0x24')]);module[_0x3212('0x25')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index cee17ac..006459d 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 _0xbae1=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xbae1,0x65));var _0x1bae=function(_0x44c883,_0x1f3da4){_0x44c883=_0x44c883-0x0;var _0x337347=_0xbae1[_0x44c883];return _0x337347;};'use strict';var Sequelize=require(_0x1bae('0x0'));module[_0x1bae('0x1')]={'name':{'type':Sequelize[_0x1bae('0x2')]},'type':{'type':Sequelize[_0x1bae('0x3')]('html',_0x1bae('0x4'))},'description':{'type':Sequelize[_0x1bae('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x1bae('0x2')],'comment':_0x1bae('0x6')},'active':{'type':Sequelize[_0x1bae('0x7')],'defaultValue':0x0,'comment':_0x1bae('0x8')},'sidebar':{'type':Sequelize[_0x1bae('0x3')]('adminOnly','agentOnly',_0x1bae('0x9'),_0x1bae('0xa')),'defaultValue':_0x1bae('0x9'),'comment':_0x1bae('0xb')},'icon':{'type':Sequelize[_0x1bae('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x1bae('0x2')]},'scriptName':{'type':Sequelize[_0x1bae('0x2')]},'scriptPath':{'type':Sequelize[_0x1bae('0x2')]}}; \ No newline at end of file +var _0x4a6d=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','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.','ENUM','never','always'];(function(_0x1a1e8a,_0x3e45a2){var _0x5df5c2=function(_0x157700){while(--_0x157700){_0x1a1e8a['push'](_0x1a1e8a['shift']());}};_0x5df5c2(++_0x3e45a2);}(_0x4a6d,0xfd));var _0xd4a6=function(_0x29af3c,_0xb0abcc){_0x29af3c=_0x29af3c-0x0;var _0x47b151=_0x4a6d[_0x29af3c];return _0x47b151;};'use strict';var Sequelize=require(_0xd4a6('0x0'));module['exports']={'name':{'type':Sequelize[_0xd4a6('0x1')]},'type':{'type':Sequelize['ENUM'](_0xd4a6('0x2'),_0xd4a6('0x3'))},'description':{'type':Sequelize[_0xd4a6('0x4')]},'version':{'type':Sequelize[_0xd4a6('0x4')]},'path':{'type':Sequelize[_0xd4a6('0x1')],'comment':_0xd4a6('0x5')},'active':{'type':Sequelize[_0xd4a6('0x6')],'defaultValue':0x0,'comment':_0xd4a6('0x7')},'sidebar':{'type':Sequelize[_0xd4a6('0x8')]('adminOnly','agentOnly','always',_0xd4a6('0x9')),'defaultValue':_0xd4a6('0xa'),'comment':_0xd4a6('0xb')},'icon':{'type':Sequelize[_0xd4a6('0x1')]},'adminUrl':{'type':Sequelize[_0xd4a6('0x1')]},'agentUrl':{'type':Sequelize[_0xd4a6('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xd4a6('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 0404432..0ecaca4 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 _0xc939=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','admin','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','destroy','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','Plugin','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter'];(function(_0x576357,_0x5b65c5){var _0xb2308b=function(_0x122757){while(--_0x122757){_0x576357['push'](_0x576357['shift']());}};_0xb2308b(++_0x5b65c5);}(_0xc939,0x1c8));var _0x9c93=function(_0x767aa3,_0x3b82b1){_0x767aa3=_0x767aa3-0x0;var _0x39bf0f=_0xc939[_0x767aa3];return _0x39bf0f;};'use strict';var emlformat=require(_0x9c93('0x0'));var rimraf=require(_0x9c93('0x1'));var zipdir=require(_0x9c93('0x2'));var jsonpatch=require(_0x9c93('0x3'));var rp=require(_0x9c93('0x4'));var moment=require(_0x9c93('0x5'));var BPromise=require(_0x9c93('0x6'));var Mustache=require(_0x9c93('0x7'));var util=require(_0x9c93('0x8'));var path=require(_0x9c93('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c93('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c93('0xb'));var squel=require(_0x9c93('0xc'));var crypto=require(_0x9c93('0xd'));var jsforce=require(_0x9c93('0xe'));var deskjs=require(_0x9c93('0xf'));var toCsv=require(_0x9c93('0x10'));var querystring=require(_0x9c93('0x11'));var Papa=require('papaparse');var extract=require(_0x9c93('0x12'));var rimraf=require(_0x9c93('0x1'));var archiver=require(_0x9c93('0x13'));var Redis=require(_0x9c93('0x14'));var authService=require(_0x9c93('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9c93('0x16'));var hardwareService=require(_0x9c93('0x17'));var logger=require(_0x9c93('0x18'))('api');var utils=require(_0x9c93('0x19'));var config=require(_0x9c93('0x1a'));var licenseUtil=require(_0x9c93('0x1b'));var db=require(_0x9c93('0x1c'))['db'];config[_0x9c93('0x1d')]=_[_0x9c93('0x1e')](config[_0x9c93('0x1d')],{'host':_0x9c93('0x1f'),'port':0x18eb});var socket=require(_0x9c93('0x20'))(new Redis(config[_0x9c93('0x1d')]));require('./plugin.socket')[_0x9c93('0x21')](socket);function respondWithStatusCode(_0x80a270,_0x18f175){_0x18f175=_0x18f175||0xcc;return function(_0x4141e9){if(_0x4141e9){return _0x80a270['sendStatus'](_0x18f175);}return _0x80a270[_0x9c93('0x22')](_0x18f175)[_0x9c93('0x23')]();};}function respondWithResult(_0x25ea08,_0x12c742){_0x12c742=_0x12c742||0xc8;return function(_0x181404){if(_0x181404){return _0x25ea08[_0x9c93('0x22')](_0x12c742)[_0x9c93('0x24')](_0x181404);}};}function respondWithFilteredResult(_0x2013c9,_0x3ed2bb){return function(_0x198284){if(_0x198284){var _0x3dcde5=typeof _0x3ed2bb[_0x9c93('0x25')]===_0x9c93('0x26')&&typeof _0x3ed2bb['limit']===_0x9c93('0x26');var _0x33a023=_0x198284[_0x9c93('0x27')];var _0x38cbf3=_0x3dcde5?0x0:_0x3ed2bb[_0x9c93('0x25')];var _0x312b20=_0x3dcde5?_0x198284['count']:_0x3ed2bb[_0x9c93('0x25')]+_0x3ed2bb['limit'];var _0x154eac;if(_0x312b20>=_0x33a023){_0x312b20=_0x33a023;_0x154eac=0xc8;}else{_0x154eac=0xce;}_0x2013c9[_0x9c93('0x22')](_0x154eac);return _0x2013c9['set'](_0x9c93('0x28'),_0x38cbf3+'-'+_0x312b20+'/'+_0x33a023)[_0x9c93('0x24')](_0x198284);}return null;};}function patchUpdates(_0x32666d){return function(_0x414a22){try{jsonpatch[_0x9c93('0x29')](_0x414a22,_0x32666d,!![]);}catch(_0x49e5f2){return BPromise['reject'](_0x49e5f2);}return _0x414a22[_0x9c93('0x2a')]();};}function saveUpdates(_0x72f904,_0x41c9c5){return function(_0x3bcf8){if(_0x3bcf8){return _0x3bcf8[_0x9c93('0x2b')](_0x72f904)['then'](function(_0x296d5c){return _0x296d5c;});}return null;};}function removeEntity(_0x5019aa,_0x220407){return function(_0x40308e){if(_0x40308e){return _0x40308e['destroy']()[_0x9c93('0x2c')](function(){var _0x391455=_0x40308e[_0x9c93('0x2d')]({'plain':!![]});var _0x2bbfbc=_0x9c93('0x2e');return db[_0x9c93('0x2f')]['destroy']({'where':{'type':_0x2bbfbc,'resourceId':_0x391455['id']}})[_0x9c93('0x2c')](function(){return _0x40308e;});})[_0x9c93('0x2c')](function(){_0x5019aa['status'](0xcc)[_0x9c93('0x23')]();});}};}function handleEntityNotFound(_0x3172f9,_0xf3cf18){return function(_0x168c7c){if(!_0x168c7c){_0x3172f9[_0x9c93('0x30')](0x194);}return _0x168c7c;};}function handleError(_0x44bc49,_0x78396c){_0x78396c=_0x78396c||0x1f4;return function(_0xabbe52){logger[_0x9c93('0x31')](_0xabbe52[_0x9c93('0x32')]);if(_0xabbe52[_0x9c93('0x33')]){delete _0xabbe52['name'];}_0x44bc49[_0x9c93('0x22')](_0x78396c)[_0x9c93('0x34')](_0xabbe52);};}exports[_0x9c93('0x35')]=function(_0x5b092b,_0x46b892){var _0xc082c8={},_0x2c9b0d={},_0x2954e9={'count':0x0,'rows':[]};var _0x569313=_['map'](db[_0x9c93('0x36')]['rawAttributes'],function(_0x5a32bd){return{'name':_0x5a32bd[_0x9c93('0x37')],'type':_0x5a32bd[_0x9c93('0x38')]['key']};});_0x2c9b0d[_0x9c93('0x39')]=_[_0x9c93('0x3a')](_0x569313,_0x9c93('0x33'));_0x2c9b0d['query']=_[_0x9c93('0x3b')](_0x5b092b[_0x9c93('0x3c')]);_0x2c9b0d[_0x9c93('0x3d')]=_[_0x9c93('0x3e')](_0x2c9b0d[_0x9c93('0x39')],_0x2c9b0d[_0x9c93('0x3c')]);_0xc082c8[_0x9c93('0x3f')]=_[_0x9c93('0x3e')](_0x2c9b0d['model'],qs[_0x9c93('0x40')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x40')]));_0xc082c8[_0x9c93('0x3f')]=_0xc082c8['attributes']['length']?_0xc082c8['attributes']:_0x2c9b0d['model'];if(!_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x41')](_0x9c93('0x42'))){_0xc082c8[_0x9c93('0x43')]=qs[_0x9c93('0x43')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x43')]);_0xc082c8[_0x9c93('0x25')]=qs[_0x9c93('0x25')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x25')]);}_0xc082c8['order']=qs[_0x9c93('0x44')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x44')]);_0xc082c8[_0x9c93('0x45')]=qs['filters'](_[_0x9c93('0x46')](_0x5b092b['query'],_0x2c9b0d[_0x9c93('0x3d')]),_0x569313);if(_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x47')]){_0xc082c8[_0x9c93('0x45')]=_[_0x9c93('0x48')](_0xc082c8[_0x9c93('0x45')],{'$or':_[_0x9c93('0x3a')](_0x569313,function(_0x17b6e6){if(_0x17b6e6[_0x9c93('0x38')]!==_0x9c93('0x49')){var _0x2a5422={};_0x2a5422[_0x17b6e6[_0x9c93('0x33')]]={'$like':'%'+_0x5b092b['query'][_0x9c93('0x47')]+'%'};return _0x2a5422;}})});}_0xc082c8=_['merge']({},_0xc082c8,_0x5b092b['options']);var _0x5141f8={'where':_0xc082c8['where']};return db[_0x9c93('0x36')]['count'](_0x5141f8)['then'](function(_0x502243){_0x2954e9['count']=_0x502243;if(_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x4a')]){_0xc082c8[_0x9c93('0x4b')]=[{'all':!![]}];}return db[_0x9c93('0x36')][_0x9c93('0x4c')](_0xc082c8);})[_0x9c93('0x2c')](function(_0x540d5a){_0x2954e9[_0x9c93('0x4d')]=_0x540d5a;return _0x2954e9;})['then'](respondWithFilteredResult(_0x46b892,_0xc082c8))[_0x9c93('0x4e')](handleError(_0x46b892,null));};exports[_0x9c93('0x4f')]=function(_0x41bf32,_0x155bc5){var _0x5c7167={'raw':!![],'where':{'id':_0x41bf32[_0x9c93('0x50')]['id']}},_0x40142a={};_0x40142a[_0x9c93('0x39')]=_[_0x9c93('0x3b')](db[_0x9c93('0x36')][_0x9c93('0x51')]);_0x40142a[_0x9c93('0x3c')]=_[_0x9c93('0x3b')](_0x41bf32['query']);_0x40142a['filters']=_[_0x9c93('0x3e')](_0x40142a[_0x9c93('0x39')],_0x40142a[_0x9c93('0x3c')]);_0x5c7167[_0x9c93('0x3f')]=_[_0x9c93('0x3e')](_0x40142a[_0x9c93('0x39')],qs['fields'](_0x41bf32[_0x9c93('0x3c')][_0x9c93('0x40')]));_0x5c7167['attributes']=_0x5c7167[_0x9c93('0x3f')][_0x9c93('0x52')]?_0x5c7167[_0x9c93('0x3f')]:_0x40142a[_0x9c93('0x39')];if(_0x41bf32[_0x9c93('0x3c')][_0x9c93('0x4a')]){_0x5c7167[_0x9c93('0x4b')]=[{'all':!![]}];}_0x5c7167=_['merge']({},_0x5c7167,_0x41bf32[_0x9c93('0x53')]);return db[_0x9c93('0x36')][_0x9c93('0x54')](_0x5c7167)['then'](handleEntityNotFound(_0x155bc5,null))[_0x9c93('0x2c')](respondWithResult(_0x155bc5,null))['catch'](handleError(_0x155bc5,null));};exports['download']=function(_0x7c2fe5,_0x41eaa9,_0x304dc4){return db[_0x9c93('0x36')][_0x9c93('0x54')]({'where':{'id':_0x7c2fe5['params']['id']},'attributes':[_0x9c93('0x33'),'path'],'raw':!![]})[_0x9c93('0x2c')](handleEntityNotFound(_0x41eaa9,null))[_0x9c93('0x2c')](function(_0x209c2c){if(_0x209c2c){var _0x432a42=path[_0x9c93('0x55')](config['root'],_0x9c93('0x56'),util[_0x9c93('0x57')](_0x9c93('0x58'),path[_0x9c93('0x59')](_0x209c2c[_0x9c93('0x9')])));var _0x43b1b8=fs[_0x9c93('0x5a')](_0x432a42);var _0x247eeb=archiver(_0x9c93('0x5b'),{'zlib':{'level':0x9}});_0x247eeb['on']('warning',function(_0x2ed4b6){if(_0x2ed4b6['code']===_0x9c93('0x5c')){logger[_0x9c93('0x31')](_0x2ed4b6);}else{throw new db[(_0x9c93('0x5d'))][(_0x9c93('0x5e'))](_0x9c93('0x5f'));}});_0x247eeb['on'](_0x9c93('0x31'),function(_0x186970){throw new db[(_0x9c93('0x5d'))][(_0x9c93('0x5e'))](_0x9c93('0x5f'));});_0x247eeb[_0x9c93('0x60')](_0x43b1b8);_0x247eeb[_0x9c93('0x61')]('**/*',{'cwd':path['join'](config[_0x9c93('0x62')],'server/files/plugins',path[_0x9c93('0x63')](_0x209c2c[_0x9c93('0x9')])),'ignore':[path[_0x9c93('0x55')](path[_0x9c93('0x59')](_0x209c2c[_0x9c93('0x9')]),_0x9c93('0x64')),path['join'](path[_0x9c93('0x59')](_0x209c2c['path']),'attachments/**/*')],'nodir':!![]})[_0x9c93('0x65')]();_0x43b1b8['on'](_0x9c93('0x66'),function(){if(!fs[_0x9c93('0x67')](_0x432a42)){throw new db['Sequelize'][(_0x9c93('0x5e'))](_0x9c93('0x68'));}return _0x41eaa9[_0x9c93('0x69')](_0x432a42,util[_0x9c93('0x57')]('%s.zip',path[_0x9c93('0x59')](_0x209c2c[_0x9c93('0x9')])),function(_0x14915c){if(_0x14915c){throw new db[(_0x9c93('0x5d'))]['Error'](_0x9c93('0x6a'));}fs['unlinkSync'](_0x432a42);logger['info']('Download\x20completed');logger[_0x9c93('0x6b')](_0x9c93('0x6c'));});});}return null;})[_0x9c93('0x4e')](handleError(_0x41eaa9,null));};exports[_0x9c93('0x6d')]=function(_0x2557db,_0x7552f2,_0x1026c9){var _0x1d37b9=path['basename'](_0x2557db['file']['filename'],path['extname'](_0x2557db[_0x9c93('0x6e')][_0x9c93('0x6f')]));var _0x577ed0=path['join'](config[_0x9c93('0x62')],_0x9c93('0x56'),_0x2557db['file'][_0x9c93('0x6f')]);var _0x20d940=path['join'](config[_0x9c93('0x62')],'server/files/plugins',_0x1d37b9);logger[_0x9c93('0x6b')](_0x9c93('0x70'),_0x577ed0);logger[_0x9c93('0x6b')](_0x9c93('0x71'),_0x20d940);try{fs[_0x9c93('0x72')](_0x577ed0,parseInt(_0x9c93('0x73'),0x8));extract(_0x577ed0,{'dir':_0x20d940},function(_0x1d25ab){if(_0x1d25ab){logger[_0x9c93('0x31')](_0x1d25ab);handleError(_0x1d25ab,!![]);};var _0xbdeed3=fs[_0x9c93('0x74')](_0x20d940);if(_0xbdeed3['length']>0x1){removeReferences(_0x577ed0,_0x20d940);logger[_0x9c93('0x31')](_0x9c93('0x75'));return _0x1026c9(new Error(_0x9c93('0x75')));}var _0x5760ed=fs[_0x9c93('0x76')](path[_0x9c93('0x55')](_0x20d940,_0xbdeed3[0x0]));if(_0x5760ed[_0x9c93('0x77')]()){removeReferences(_0x577ed0,_0x20d940);logger['error']('Invalid\x20plugin\x20structure');return _0x1026c9(new Error('Invalid\x20plugin\x20structure'));}if(_0x5760ed[_0x9c93('0x78')]()){var _0x5e72c0=fs[_0x9c93('0x74')](path[_0x9c93('0x55')](_0x20d940,_0xbdeed3[0x0]));if(_0x5e72c0[_0x9c93('0x52')]===0x0){removeReferences(_0x577ed0,_0x20d940);logger[_0x9c93('0x31')](_0x9c93('0x75'));return _0x1026c9(new Error(_0x9c93('0x75')));}var _0x1cd74a=_0x5e72c0[_0x9c93('0x79')](function(_0x18dfe5){return _0x18dfe5==='manifest.json';});if(!_0x1cd74a){return _0x1026c9(new Error(_0x9c93('0x7a')));}var _0x10ad8e=fs['readFileSync'](path[_0x9c93('0x55')](_0x20d940,_0xbdeed3[0x0],'manifest.json'));var _0x2753d0=JSON[_0x9c93('0x7b')](_0x10ad8e);if('undefined'==typeof _0x2753d0[_0x9c93('0x33')]){return _0x1026c9(new Error(_0x9c93('0x7c')));}if('undefined'==typeof _0x2753d0[_0x9c93('0x38')]){return _0x1026c9(new Error(_0x9c93('0x7d')));}if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x7e')]){return _0x1026c9(new Error(_0x9c93('0x7f')));}if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')]){return _0x1026c9(new Error(_0x9c93('0x81')));}if(_0x2753d0[_0x9c93('0x38')]===_0x9c93('0x82')){if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')]['views']){return _0x1026c9(new Error(_0x9c93('0x83')));}if('undefined'==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin']&&_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')][_0x9c93('0x85')]){return _0x1026c9(new Error(_0x9c93('0x86')));}}else if(_0x2753d0[_0x9c93('0x38')]===_0x9c93('0x87')){if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x88')]){return _0x1026c9(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x89')]){return _0x1026c9(new Error(_0x9c93('0x8a')));}}else{return _0x1026c9(new Error(_0x9c93('0x8b')));}var _0x4f2e10=_0x2753d0['name'];var _0x310b31=_0x2753d0[_0x9c93('0x8c')];var _0x862bb=_0x2753d0[_0x9c93('0x38')];var _0x5312db=_0x2753d0[_0x9c93('0x8d')]?_0x2753d0[_0x9c93('0x8d')]:'always';var _0x508130=_0x2753d0[_0x9c93('0x8e')]?_0x2753d0[_0x9c93('0x8e')]:'icon-apps';var _0x2a2e49='';var _0x221582='';var _0x32c022='';var _0x181128='';var _0x5a066e=_0x2753d0[_0x9c93('0x7e')];if(_0x862bb===_0x9c93('0x82')){if(_0x9c93('0x26')!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin']){var _0x561d27=_0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x9c93('0x8f')](_0x561d27)){_0x2a2e49=path['join'](_0x9c93('0x90'),_0x1d37b9,_0xbdeed3[0x0],_0x561d27);}else{_0x2a2e49=_0x561d27;}}else{logger[_0x9c93('0x6b')](_0x9c93('0x91'));}if(_0x9c93('0x26')!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['agent']){var _0x45e979=_0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')][_0x9c93('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x45e979)){_0x221582=path[_0x9c93('0x55')](_0x9c93('0x90'),_0x1d37b9,_0xbdeed3[0x0],_0x45e979);}else{_0x221582=_0x45e979;}}else{logger['info'](_0x9c93('0x92'));}}else if(_0x862bb===_0x9c93('0x87')){_0x32c022=_0x2753d0[_0x9c93('0x80')]['scriptName'];_0x181128=_0x2753d0['parameters'][_0x9c93('0x89')];if(_0x9c93('0x26')!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]){if('undefined'!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin']){var _0x561d27=_0x2753d0[_0x9c93('0x80')]['views'][_0x9c93('0x93')];if(!/^(f|ht)tps?:\/\//i['test'](_0x561d27)){_0x2a2e49=path['join']('plugins',_0x1d37b9,_0xbdeed3[0x0],_0x561d27);}else{_0x2a2e49=_0x561d27;}}if(_0x9c93('0x26')!=typeof _0x2753d0['parameters'][_0x9c93('0x84')][_0x9c93('0x85')]){var _0x45e979=_0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9c93('0x8f')](_0x45e979)){_0x221582=path[_0x9c93('0x55')](_0x9c93('0x90'),_0x1d37b9,_0xbdeed3[0x0],_0x45e979);}else{_0x221582=_0x45e979;}}}}var _0x41c29c={'name':_0x4f2e10,'description':_0x310b31,'path':path[_0x9c93('0x55')](_0x1d37b9,_0xbdeed3[0x0]),'type':_0x862bb,'sidebar':_0x5312db,'icon':_0x508130,'adminUrl':_0x2a2e49,'agentUrl':_0x221582,'scriptName':_0x32c022,'scriptPath':_0x181128,'version':_0x5a066e};removeReferences(_0x577ed0,null);return db[_0x9c93('0x36')][_0x9c93('0x94')](_0x41c29c)['then'](function(_0x5a9fc6){var _0x439af7={'role':_0x2557db[_0x9c93('0x95')][_0x9c93('0x96')],'userProfileId':_0x2557db['body'][_0x9c93('0x97')]};if(!_0x439af7)throw new Error(_0x9c93('0x98'));if(_0x439af7[_0x9c93('0x96')]===_0x9c93('0x99')){var _0x7e2e52=_0x5a9fc6[_0x9c93('0x2d')]({'plain':!![]});return db[_0x9c93('0x9a')][_0x9c93('0x54')]({'where':{'name':_0x9c93('0x2e'),'userProfileId':_0x439af7['userProfileId']},'raw':!![]})[_0x9c93('0x2c')](function(_0x2ec11c){if(_0x2ec11c&&_0x2ec11c[_0x9c93('0x9b')]===0x0){return db['UserProfileResource'][_0x9c93('0x94')]({'name':_0x7e2e52['name'],'resourceId':_0x7e2e52['id'],'type':_0x2ec11c[_0x9c93('0x33')],'sectionId':_0x2ec11c['id']},{})[_0x9c93('0x2c')](function(){return _0x5a9fc6;});}else{return _0x5a9fc6;}})[_0x9c93('0x4e')](function(_0x2de9c1){logger[_0x9c93('0x31')](_0x9c93('0x9c'),_0x2de9c1);throw _0x2de9c1;});}return _0x5a9fc6;})[_0x9c93('0x2c')](respondWithResult(_0x7552f2,null))[_0x9c93('0x4e')](handleError(_0x7552f2,null));}});}catch(_0xd7d9e5){_0x7552f2[_0x9c93('0x22')](0x1f4)[_0x9c93('0x34')](_0xd7d9e5);}};function removeReferences(_0x4ddbf9,_0x45b26e){try{if(_0x4ddbf9){fs['unlinkSync'](_0x4ddbf9);logger['info']('Zip\x20archive\x20removed');}if(_0x45b26e){rimraf(_0x45b26e,function(){});logger[_0x9c93('0x6b')]('Extracted\x20folder\x20removed');}}catch(_0x7d04f1){logger[_0x9c93('0x31')](_0x7d04f1);}}exports['update']=function(_0x2a0279,_0xb2fab3,_0x552742){return db['Plugin'][_0x9c93('0x54')]({'where':{'id':_0x2a0279[_0x9c93('0x50')]['id']}})[_0x9c93('0x2c')](handleEntityNotFound(_0xb2fab3,null))['then'](saveUpdates(_0x2a0279['body'],null))[_0x9c93('0x2c')](respondWithResult(_0xb2fab3,null))[_0x9c93('0x4e')](handleError(_0xb2fab3,null));};exports[_0x9c93('0x9d')]=function(_0x212a0e,_0x500f25,_0x124731){return db[_0x9c93('0x36')]['find']({'where':{'id':_0x212a0e['params']['id']}})[_0x9c93('0x2c')](function(_0x396021){if(_0x396021){return _0x396021[_0x9c93('0x9e')]();}})[_0x9c93('0x2c')](function(_0x5a0ae9){rimraf(path[_0x9c93('0x55')](config['root'],_0x9c93('0x56'),path[_0x9c93('0x63')](_0x5a0ae9[_0x9c93('0x9')])),function(){});return _0x5a0ae9;})[_0x9c93('0x2c')](handleEntityNotFound(_0x500f25,null))['then'](respondWithStatusCode(_0x500f25,null))['catch'](handleError(_0x500f25,null));};exports[_0x9c93('0x9f')]=function(_0x426549,_0x50c8c9,_0xe2a6b4){return BPromise[_0x9c93('0xa0')]()['then'](function(){if(!_0x426549[_0x9c93('0x3c')][_0x9c93('0x9')]){throw new Error(_0x9c93('0xa1'));}if(!_0x426549['query']['port']){throw new Error(_0x9c93('0xa2'));}var _0x3c0ded=_0x426549[_0x9c93('0x3c')][_0x9c93('0xa3')]?_0x426549[_0x9c93('0x3c')][_0x9c93('0xa3')]+':'+_0x426549[_0x9c93('0x3c')][_0x9c93('0xa4')]:_0x9c93('0xa5')+_0x426549[_0x9c93('0x3c')][_0x9c93('0xa4')];var _0x27347a=_0x426549[_0x9c93('0x3c')][_0x9c93('0x24')]?_0x426549[_0x9c93('0x3c')][_0x9c93('0x24')]:!![];var _0x25dd10=_0x426549[_0x9c93('0x3c')][_0x9c93('0xa6')]?_0x426549[_0x9c93('0x3c')][_0x9c93('0xa6')]:null;var _0x59533a={'method':_0x426549[_0x9c93('0xa7')],'uri':util[_0x9c93('0x57')](_0x9c93('0xa8'),_0x3c0ded,_0x426549['query'][_0x9c93('0x9')]),'json':_0x27347a,'resolveWithFullResponse':!![],'encoding':_0x25dd10,'qs':_0x426549[_0x9c93('0x3c')]};if(_0x426549[_0x9c93('0xa9')]){_0x59533a[_0x9c93('0xa9')]=_0x426549[_0x9c93('0xa9')];if(_0x59533a['headers']['content-length']){delete _0x59533a[_0x9c93('0xa9')][_0x9c93('0xaa')];}}if(_0x59533a[_0x9c93('0xa9')][_0x9c93('0xab')]){delete _0x59533a[_0x9c93('0xa9')][_0x9c93('0xab')];}return rp(_0x59533a);})['then'](function(_0x220b99){if(_0x220b99){_0x50c8c9['set'](_0x220b99['headers']);logger['info'](_0x220b99[_0x9c93('0x95')]);if(_[_0x9c93('0xac')](_0x426549[_0x9c93('0x3c')][_0x9c93('0x9')],'download')&&_0x220b99[_0x9c93('0xad')]==0x1f4){return _0x50c8c9[_0x9c93('0x30')](_0x220b99[_0x9c93('0xad')]);}else{return _0x50c8c9[_0x9c93('0x22')](_0x220b99[_0x9c93('0xad')])[_0x9c93('0x34')](_0x220b99[_0x9c93('0x95')]);}}else{return _0x50c8c9[_0x9c93('0x30')](0xc8);}})['catch'](handleError(_0x50c8c9,null));};exports[_0x9c93('0xae')]=function(_0x52f7ec,_0x305722,_0x40d1b4){return BPromise[_0x9c93('0xa0')]()['then'](function(){if(!_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0x9')]){throw new Error(_0x9c93('0xa1'));}if(!_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa4')]){throw new Error(_0x9c93('0xa2'));}var _0x361c6e=_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa3')]?_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa3')]+':'+_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa4')]:_0x9c93('0xa5')+_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa4')];var _0x142eb0=_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0x24')]?_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0x24')]:!![];var _0x56f23d=_0x52f7ec[_0x9c93('0x3c')]['encoding']?_0x52f7ec['query']['encoding']:null;var _0x5877e6={'method':_0x52f7ec['method'],'uri':util[_0x9c93('0x57')](_0x9c93('0xa8'),_0x361c6e,_0x52f7ec[_0x9c93('0x3c')]['path']),'json':_0x142eb0,'resolveWithFullResponse':!![],'encoding':_0x56f23d,'body':_0x52f7ec[_0x9c93('0x95')]};if(_0x52f7ec[_0x9c93('0xa9')]){_0x5877e6[_0x9c93('0xa9')]=_0x52f7ec[_0x9c93('0xa9')];if(_0x5877e6['headers'][_0x9c93('0xaa')]){delete _0x5877e6[_0x9c93('0xa9')][_0x9c93('0xaa')];}}if(_0x5877e6[_0x9c93('0xa9')][_0x9c93('0xab')]){delete _0x5877e6['headers'][_0x9c93('0xab')];}return rp(_0x5877e6);})['then'](function(_0x3e6a2b){if(_0x3e6a2b){_0x305722[_0x9c93('0xaf')](_0x3e6a2b['headers']);logger['info'](_0x3e6a2b['body']);return _0x305722[_0x9c93('0x22')](_0x3e6a2b[_0x9c93('0xad')])[_0x9c93('0x34')](_0x3e6a2b[_0x9c93('0x95')]);}else{return _0x305722[_0x9c93('0x30')](0xc8);}})['catch'](handleError(_0x305722,null));}; \ No newline at end of file +var _0x6abf=['length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','download','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','join','attachments/**/*','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','file','extname','filename','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','admin','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','Warning:\x20admin\x20view\x20not\x20specified','test','plugins','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','eml-format','zip-dir','fast-json-patch','moment','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Plugins','error','stack','name','send','Plugin','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6abf,0x10f));var _0xf6ab=function(_0x463ccc,_0x391f12){_0x463ccc=_0x463ccc-0x0;var _0x413e97=_0x6abf[_0x463ccc];return _0x413e97;};'use strict';var emlformat=require(_0xf6ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6ab('0x1'));var jsonpatch=require(_0xf6ab('0x2'));var rp=require('request-promise');var moment=require(_0xf6ab('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf6ab('0x4'));var sox=require('sox');var csv=require(_0xf6ab('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6ab('0x6'));var _=require(_0xf6ab('0x7'));var squel=require(_0xf6ab('0x8'));var crypto=require(_0xf6ab('0x9'));var jsforce=require(_0xf6ab('0xa'));var deskjs=require(_0xf6ab('0xb'));var toCsv=require(_0xf6ab('0x5'));var querystring=require('querystring');var Papa=require(_0xf6ab('0xc'));var extract=require(_0xf6ab('0xd'));var rimraf=require('rimraf');var archiver=require(_0xf6ab('0xe'));var Redis=require('ioredis');var authService=require(_0xf6ab('0xf'));var qs=require(_0xf6ab('0x10'));var as=require(_0xf6ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6ab('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf6ab('0x13'));var licenseUtil=require(_0xf6ab('0x14'));var db=require(_0xf6ab('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6ab('0x16')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x1db536,_0x231b0f){_0x231b0f=_0x231b0f||0xcc;return function(_0x259de9){if(_0x259de9){return _0x1db536[_0xf6ab('0x17')](_0x231b0f);}return _0x1db536[_0xf6ab('0x18')](_0x231b0f)[_0xf6ab('0x19')]();};}function respondWithResult(_0x2dad8d,_0xe36372){_0xe36372=_0xe36372||0xc8;return function(_0x204b9){if(_0x204b9){return _0x2dad8d[_0xf6ab('0x18')](_0xe36372)[_0xf6ab('0x1a')](_0x204b9);}};}function respondWithFilteredResult(_0x25ef05,_0x2b4c59){return function(_0x56d70e){if(_0x56d70e){var _0xefa5f5=typeof _0x2b4c59[_0xf6ab('0x1b')]===_0xf6ab('0x1c')&&typeof _0x2b4c59['limit']===_0xf6ab('0x1c');var _0x18d79a=_0x56d70e[_0xf6ab('0x1d')];var _0xf027e7=_0xefa5f5?0x0:_0x2b4c59[_0xf6ab('0x1b')];var _0x4dab89=_0xefa5f5?_0x56d70e[_0xf6ab('0x1d')]:_0x2b4c59[_0xf6ab('0x1b')]+_0x2b4c59['limit'];var _0xa197ca;if(_0x4dab89>=_0x18d79a){_0x4dab89=_0x18d79a;_0xa197ca=0xc8;}else{_0xa197ca=0xce;}_0x25ef05[_0xf6ab('0x18')](_0xa197ca);return _0x25ef05[_0xf6ab('0x1e')](_0xf6ab('0x1f'),_0xf027e7+'-'+_0x4dab89+'/'+_0x18d79a)[_0xf6ab('0x1a')](_0x56d70e);}return null;};}function patchUpdates(_0x59f51c){return function(_0x39abef){try{jsonpatch[_0xf6ab('0x20')](_0x39abef,_0x59f51c,!![]);}catch(_0x5af662){return BPromise[_0xf6ab('0x21')](_0x5af662);}return _0x39abef[_0xf6ab('0x22')]();};}function saveUpdates(_0x4dc662,_0xd00d6a){return function(_0x221f8a){if(_0x221f8a){return _0x221f8a['update'](_0x4dc662)[_0xf6ab('0x23')](function(_0x59f1ac){return _0x59f1ac;});}return null;};}function removeEntity(_0x40cbbe,_0x356fe2){return function(_0x1eda3b){if(_0x1eda3b){return _0x1eda3b[_0xf6ab('0x24')]()[_0xf6ab('0x23')](function(){var _0x5df81e=_0x1eda3b[_0xf6ab('0x25')]({'plain':!![]});var _0x23a6f1=_0xf6ab('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x23a6f1,'resourceId':_0x5df81e['id']}})[_0xf6ab('0x23')](function(){return _0x1eda3b;});})[_0xf6ab('0x23')](function(){_0x40cbbe[_0xf6ab('0x18')](0xcc)[_0xf6ab('0x19')]();});}};}function handleEntityNotFound(_0x57b092,_0x446f5a){return function(_0x262766){if(!_0x262766){_0x57b092['sendStatus'](0x194);}return _0x262766;};}function handleError(_0x15c74c,_0x3d2f84){_0x3d2f84=_0x3d2f84||0x1f4;return function(_0x2f3524){logger[_0xf6ab('0x27')](_0x2f3524[_0xf6ab('0x28')]);if(_0x2f3524[_0xf6ab('0x29')]){delete _0x2f3524[_0xf6ab('0x29')];}_0x15c74c['status'](_0x3d2f84)[_0xf6ab('0x2a')](_0x2f3524);};}exports['index']=function(_0x455de3,_0x528a8c){var _0x5f535b={},_0x401315={},_0x3aeb47={'count':0x0,'rows':[]};var _0x51c044=_['map'](db[_0xf6ab('0x2b')][_0xf6ab('0x2c')],function(_0x2a1071){return{'name':_0x2a1071['fieldName'],'type':_0x2a1071[_0xf6ab('0x2d')][_0xf6ab('0x2e')]};});_0x401315[_0xf6ab('0x2f')]=_[_0xf6ab('0x30')](_0x51c044,_0xf6ab('0x29'));_0x401315['query']=_[_0xf6ab('0x31')](_0x455de3['query']);_0x401315[_0xf6ab('0x32')]=_[_0xf6ab('0x33')](_0x401315[_0xf6ab('0x2f')],_0x401315[_0xf6ab('0x34')]);_0x5f535b[_0xf6ab('0x35')]=_[_0xf6ab('0x33')](_0x401315['model'],qs[_0xf6ab('0x36')](_0x455de3[_0xf6ab('0x34')][_0xf6ab('0x36')]));_0x5f535b['attributes']=_0x5f535b[_0xf6ab('0x35')][_0xf6ab('0x37')]?_0x5f535b['attributes']:_0x401315[_0xf6ab('0x2f')];if(!_0x455de3[_0xf6ab('0x34')][_0xf6ab('0x38')](_0xf6ab('0x39'))){_0x5f535b[_0xf6ab('0x3a')]=qs['limit'](_0x455de3[_0xf6ab('0x34')][_0xf6ab('0x3a')]);_0x5f535b[_0xf6ab('0x1b')]=qs[_0xf6ab('0x1b')](_0x455de3[_0xf6ab('0x34')]['offset']);}_0x5f535b[_0xf6ab('0x3b')]=qs[_0xf6ab('0x3c')](_0x455de3[_0xf6ab('0x34')][_0xf6ab('0x3c')]);_0x5f535b[_0xf6ab('0x3d')]=qs[_0xf6ab('0x32')](_[_0xf6ab('0x3e')](_0x455de3[_0xf6ab('0x34')],_0x401315[_0xf6ab('0x32')]),_0x51c044);if(_0x455de3[_0xf6ab('0x34')][_0xf6ab('0x3f')]){_0x5f535b[_0xf6ab('0x3d')]=_['merge'](_0x5f535b[_0xf6ab('0x3d')],{'$or':_[_0xf6ab('0x30')](_0x51c044,function(_0x993a5e){if(_0x993a5e[_0xf6ab('0x2d')]!==_0xf6ab('0x40')){var _0x425dde={};_0x425dde[_0x993a5e[_0xf6ab('0x29')]]={'$like':'%'+_0x455de3[_0xf6ab('0x34')][_0xf6ab('0x3f')]+'%'};return _0x425dde;}})});}_0x5f535b=_[_0xf6ab('0x41')]({},_0x5f535b,_0x455de3[_0xf6ab('0x42')]);var _0x59685f={'where':_0x5f535b[_0xf6ab('0x3d')]};return db[_0xf6ab('0x2b')][_0xf6ab('0x1d')](_0x59685f)[_0xf6ab('0x23')](function(_0x55f717){_0x3aeb47[_0xf6ab('0x1d')]=_0x55f717;if(_0x455de3[_0xf6ab('0x34')]['includeAll']){_0x5f535b[_0xf6ab('0x43')]=[{'all':!![]}];}return db['Plugin'][_0xf6ab('0x44')](_0x5f535b);})[_0xf6ab('0x23')](function(_0x5e2299){_0x3aeb47[_0xf6ab('0x45')]=_0x5e2299;return _0x3aeb47;})[_0xf6ab('0x23')](respondWithFilteredResult(_0x528a8c,_0x5f535b))[_0xf6ab('0x46')](handleError(_0x528a8c,null));};exports['show']=function(_0x266457,_0x9c8c98){var _0x167341={'raw':!![],'where':{'id':_0x266457[_0xf6ab('0x47')]['id']}},_0x5dac4c={};_0x5dac4c[_0xf6ab('0x2f')]=_[_0xf6ab('0x31')](db[_0xf6ab('0x2b')][_0xf6ab('0x2c')]);_0x5dac4c[_0xf6ab('0x34')]=_[_0xf6ab('0x31')](_0x266457[_0xf6ab('0x34')]);_0x5dac4c[_0xf6ab('0x32')]=_[_0xf6ab('0x33')](_0x5dac4c[_0xf6ab('0x2f')],_0x5dac4c[_0xf6ab('0x34')]);_0x167341[_0xf6ab('0x35')]=_[_0xf6ab('0x33')](_0x5dac4c[_0xf6ab('0x2f')],qs[_0xf6ab('0x36')](_0x266457['query'][_0xf6ab('0x36')]));_0x167341[_0xf6ab('0x35')]=_0x167341[_0xf6ab('0x35')]['length']?_0x167341[_0xf6ab('0x35')]:_0x5dac4c[_0xf6ab('0x2f')];if(_0x266457[_0xf6ab('0x34')]['includeAll']){_0x167341[_0xf6ab('0x43')]=[{'all':!![]}];}_0x167341=_[_0xf6ab('0x41')]({},_0x167341,_0x266457[_0xf6ab('0x42')]);return db[_0xf6ab('0x2b')]['find'](_0x167341)[_0xf6ab('0x23')](handleEntityNotFound(_0x9c8c98,null))[_0xf6ab('0x23')](respondWithResult(_0x9c8c98,null))[_0xf6ab('0x46')](handleError(_0x9c8c98,null));};exports[_0xf6ab('0x48')]=function(_0x175125,_0xb53d0d,_0x385375){return db[_0xf6ab('0x2b')][_0xf6ab('0x49')]({'where':{'id':_0x175125[_0xf6ab('0x47')]['id']},'attributes':[_0xf6ab('0x29'),_0xf6ab('0x4')],'raw':!![]})['then'](handleEntityNotFound(_0xb53d0d,null))[_0xf6ab('0x23')](function(_0x18fb4e){if(_0x18fb4e){var _0x9130b=path['join'](config[_0xf6ab('0x4a')],_0xf6ab('0x4b'),util[_0xf6ab('0x4c')](_0xf6ab('0x4d'),path[_0xf6ab('0x4e')](_0x18fb4e[_0xf6ab('0x4')])));var _0x6c6a6b=fs[_0xf6ab('0x4f')](_0x9130b);var _0x2c96f2=archiver(_0xf6ab('0x50'),{'zlib':{'level':0x9}});_0x2c96f2['on'](_0xf6ab('0x51'),function(_0x41eb48){if(_0x41eb48[_0xf6ab('0x52')]==='ENOENT'){logger[_0xf6ab('0x27')](_0x41eb48);}else{throw new db[(_0xf6ab('0x53'))]['Error'](_0xf6ab('0x54'));}});_0x2c96f2['on'](_0xf6ab('0x27'),function(_0x169041){throw new db['Sequelize'][(_0xf6ab('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2c96f2[_0xf6ab('0x56')](_0x6c6a6b);_0x2c96f2[_0xf6ab('0x57')](_0xf6ab('0x58'),{'cwd':path[_0xf6ab('0x59')](config[_0xf6ab('0x4a')],'server/files/plugins',path['dirname'](_0x18fb4e[_0xf6ab('0x4')])),'ignore':[path['join'](path['basename'](_0x18fb4e[_0xf6ab('0x4')]),'node_modules/**/*'),path[_0xf6ab('0x59')](path[_0xf6ab('0x4e')](_0x18fb4e[_0xf6ab('0x4')]),_0xf6ab('0x5a'))],'nodir':!![]})['finalize']();_0x6c6a6b['on'](_0xf6ab('0x5b'),function(){if(!fs[_0xf6ab('0x5c')](_0x9130b)){throw new db[(_0xf6ab('0x53'))][(_0xf6ab('0x55'))]('Plugin\x20not\x20found');}return _0xb53d0d[_0xf6ab('0x48')](_0x9130b,util['format'](_0xf6ab('0x4d'),path[_0xf6ab('0x4e')](_0x18fb4e[_0xf6ab('0x4')])),function(_0x509c3a){if(_0x509c3a){throw new db[(_0xf6ab('0x53'))][(_0xf6ab('0x55'))](_0xf6ab('0x5d'));}fs['unlinkSync'](_0x9130b);logger[_0xf6ab('0x5e')](_0xf6ab('0x5f'));logger[_0xf6ab('0x5e')](_0xf6ab('0x60'));});});}return null;})['catch'](handleError(_0xb53d0d,null));};exports['upload']=function(_0x3551b2,_0x3b2f90,_0x18468f){var _0x1ad67f=path['basename'](_0x3551b2[_0xf6ab('0x61')]['filename'],path[_0xf6ab('0x62')](_0x3551b2[_0xf6ab('0x61')][_0xf6ab('0x63')]));var _0x106283=path[_0xf6ab('0x59')](config[_0xf6ab('0x4a')],_0xf6ab('0x4b'),_0x3551b2[_0xf6ab('0x61')][_0xf6ab('0x63')]);var _0x58d4d2=path[_0xf6ab('0x59')](config[_0xf6ab('0x4a')],_0xf6ab('0x4b'),_0x1ad67f);logger[_0xf6ab('0x5e')]('Plugin\x20upload\x20filepath:\x20%s',_0x106283);logger[_0xf6ab('0x5e')]('Plugin\x20upload\x20destination:\x20%s',_0x58d4d2);try{fs[_0xf6ab('0x64')](_0x106283,parseInt(_0xf6ab('0x65'),0x8));extract(_0x106283,{'dir':_0x58d4d2},function(_0x21bd94){if(_0x21bd94){logger[_0xf6ab('0x27')](_0x21bd94);handleError(_0x21bd94,!![]);};var _0x1bbf70=fs[_0xf6ab('0x66')](_0x58d4d2);if(_0x1bbf70[_0xf6ab('0x37')]>0x1){removeReferences(_0x106283,_0x58d4d2);logger[_0xf6ab('0x27')](_0xf6ab('0x67'));return _0x18468f(new Error(_0xf6ab('0x67')));}var _0x2577b7=fs[_0xf6ab('0x68')](path[_0xf6ab('0x59')](_0x58d4d2,_0x1bbf70[0x0]));if(_0x2577b7[_0xf6ab('0x69')]()){removeReferences(_0x106283,_0x58d4d2);logger[_0xf6ab('0x27')](_0xf6ab('0x67'));return _0x18468f(new Error(_0xf6ab('0x67')));}if(_0x2577b7[_0xf6ab('0x6a')]()){var _0x2a6e62=fs['readdirSync'](path[_0xf6ab('0x59')](_0x58d4d2,_0x1bbf70[0x0]));if(_0x2a6e62[_0xf6ab('0x37')]===0x0){removeReferences(_0x106283,_0x58d4d2);logger[_0xf6ab('0x27')](_0xf6ab('0x67'));return _0x18468f(new Error('Invalid\x20plugin\x20structure'));}var _0x505ad3=_0x2a6e62[_0xf6ab('0x6b')](function(_0x376049){return _0x376049==='manifest.json';});if(!_0x505ad3){return _0x18468f(new Error(_0xf6ab('0x6c')));}var _0x481478=fs[_0xf6ab('0x6d')](path['join'](_0x58d4d2,_0x1bbf70[0x0],_0xf6ab('0x6e')));var _0x2007b8=JSON['parse'](_0x481478);if('undefined'==typeof _0x2007b8[_0xf6ab('0x29')]){return _0x18468f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xf6ab('0x1c')==typeof _0x2007b8[_0xf6ab('0x2d')]){return _0x18468f(new Error(_0xf6ab('0x6f')));}if(_0xf6ab('0x1c')==typeof _0x2007b8[_0xf6ab('0x70')]){return _0x18468f(new Error(_0xf6ab('0x71')));}if(_0xf6ab('0x1c')==typeof _0x2007b8[_0xf6ab('0x72')]){return _0x18468f(new Error(_0xf6ab('0x73')));}if(_0x2007b8['type']===_0xf6ab('0x74')){if(_0xf6ab('0x1c')==typeof _0x2007b8[_0xf6ab('0x72')]['views']){return _0x18468f(new Error(_0xf6ab('0x75')));}if(_0xf6ab('0x1c')==typeof _0x2007b8[_0xf6ab('0x72')]['views'][_0xf6ab('0x76')]&&'undefined'==typeof _0x2007b8['parameters'][_0xf6ab('0x77')][_0xf6ab('0x78')]){return _0x18468f(new Error(_0xf6ab('0x79')));}}else if(_0x2007b8['type']==='script'){if('undefined'==typeof _0x2007b8['parameters']['scriptName']){return _0x18468f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x2007b8[_0xf6ab('0x72')][_0xf6ab('0x7a')]){return _0x18468f(new Error(_0xf6ab('0x7b')));}}else{return _0x18468f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0xd8d28b=_0x2007b8[_0xf6ab('0x29')];var _0x109e3c=_0x2007b8['description'];var _0x24085b=_0x2007b8[_0xf6ab('0x2d')];var _0x3c6059=_0x2007b8[_0xf6ab('0x7c')]?_0x2007b8[_0xf6ab('0x7c')]:_0xf6ab('0x7d');var _0x916c42=_0x2007b8[_0xf6ab('0x7e')]?_0x2007b8[_0xf6ab('0x7e')]:_0xf6ab('0x7f');var _0x43dc2d='';var _0xb7b10b='';var _0x21ea06='';var _0x22853c='';var _0x298e75=_0x2007b8[_0xf6ab('0x70')];if(_0x24085b==='html'){if(_0xf6ab('0x1c')!=typeof _0x2007b8['parameters'][_0xf6ab('0x77')]['admin']){var _0x73265e=_0x2007b8['parameters'][_0xf6ab('0x77')][_0xf6ab('0x76')];if(!/^(f|ht)tps?:\/\//i['test'](_0x73265e)){_0x43dc2d=path[_0xf6ab('0x59')]('plugins',_0x1ad67f,_0x1bbf70[0x0],_0x73265e);}else{_0x43dc2d=_0x73265e;}}else{logger['info'](_0xf6ab('0x80'));}if(_0xf6ab('0x1c')!=typeof _0x2007b8[_0xf6ab('0x72')][_0xf6ab('0x77')][_0xf6ab('0x78')]){var _0x1ffe38=_0x2007b8['parameters'][_0xf6ab('0x77')][_0xf6ab('0x78')];if(!/^(f|ht)tps?:\/\//i[_0xf6ab('0x81')](_0x1ffe38)){_0xb7b10b=path['join'](_0xf6ab('0x82'),_0x1ad67f,_0x1bbf70[0x0],_0x1ffe38);}else{_0xb7b10b=_0x1ffe38;}}else{logger[_0xf6ab('0x5e')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x24085b===_0xf6ab('0x83')){_0x21ea06=_0x2007b8[_0xf6ab('0x72')]['scriptName'];_0x22853c=_0x2007b8['parameters'][_0xf6ab('0x7a')];if(_0xf6ab('0x1c')!=typeof _0x2007b8['parameters']['views']){if(_0xf6ab('0x1c')!=typeof _0x2007b8['parameters']['views'][_0xf6ab('0x76')]){var _0x73265e=_0x2007b8[_0xf6ab('0x72')]['views'][_0xf6ab('0x76')];if(!/^(f|ht)tps?:\/\//i[_0xf6ab('0x81')](_0x73265e)){_0x43dc2d=path[_0xf6ab('0x59')](_0xf6ab('0x82'),_0x1ad67f,_0x1bbf70[0x0],_0x73265e);}else{_0x43dc2d=_0x73265e;}}if(_0xf6ab('0x1c')!=typeof _0x2007b8[_0xf6ab('0x72')][_0xf6ab('0x77')]['agent']){var _0x1ffe38=_0x2007b8[_0xf6ab('0x72')][_0xf6ab('0x77')][_0xf6ab('0x78')];if(!/^(f|ht)tps?:\/\//i[_0xf6ab('0x81')](_0x1ffe38)){_0xb7b10b=path['join'](_0xf6ab('0x82'),_0x1ad67f,_0x1bbf70[0x0],_0x1ffe38);}else{_0xb7b10b=_0x1ffe38;}}}}var _0x1eca0a={'name':_0xd8d28b,'description':_0x109e3c,'path':path[_0xf6ab('0x59')](_0x1ad67f,_0x1bbf70[0x0]),'type':_0x24085b,'sidebar':_0x3c6059,'icon':_0x916c42,'adminUrl':_0x43dc2d,'agentUrl':_0xb7b10b,'scriptName':_0x21ea06,'scriptPath':_0x22853c,'version':_0x298e75};removeReferences(_0x106283,null);return db[_0xf6ab('0x2b')][_0xf6ab('0x84')](_0x1eca0a)[_0xf6ab('0x23')](function(_0xe8e341){var _0x49a01e={'role':_0x3551b2[_0xf6ab('0x85')][_0xf6ab('0x86')],'userProfileId':_0x3551b2[_0xf6ab('0x85')][_0xf6ab('0x87')]};if(!_0x49a01e)throw new Error(_0xf6ab('0x88'));if(_0x49a01e[_0xf6ab('0x86')]===_0xf6ab('0x89')){var _0x92d77d=_0xe8e341[_0xf6ab('0x25')]({'plain':!![]});return db[_0xf6ab('0x8a')][_0xf6ab('0x49')]({'where':{'name':_0xf6ab('0x26'),'userProfileId':_0x49a01e[_0xf6ab('0x87')]},'raw':!![]})['then'](function(_0x3a2a8a){if(_0x3a2a8a&&_0x3a2a8a[_0xf6ab('0x8b')]===0x0){return db[_0xf6ab('0x8c')][_0xf6ab('0x84')]({'name':_0x92d77d['name'],'resourceId':_0x92d77d['id'],'type':_0x3a2a8a[_0xf6ab('0x29')],'sectionId':_0x3a2a8a['id']},{})[_0xf6ab('0x23')](function(){return _0xe8e341;});}else{return _0xe8e341;}})['catch'](function(_0x5e1f5c){logger[_0xf6ab('0x27')](_0xf6ab('0x8d'),_0x5e1f5c);throw _0x5e1f5c;});}return _0xe8e341;})[_0xf6ab('0x23')](respondWithResult(_0x3b2f90,null))[_0xf6ab('0x46')](handleError(_0x3b2f90,null));}});}catch(_0x4f32af){_0x3b2f90[_0xf6ab('0x18')](0x1f4)[_0xf6ab('0x2a')](_0x4f32af);}};function removeReferences(_0x293def,_0x25c81b){try{if(_0x293def){fs[_0xf6ab('0x8e')](_0x293def);logger['info'](_0xf6ab('0x8f'));}if(_0x25c81b){rimraf(_0x25c81b,function(){});logger[_0xf6ab('0x5e')](_0xf6ab('0x90'));}}catch(_0x24088f){logger[_0xf6ab('0x27')](_0x24088f);}}exports[_0xf6ab('0x91')]=function(_0x5b476b,_0x58e1ce,_0x396172){return db['Plugin'][_0xf6ab('0x49')]({'where':{'id':_0x5b476b[_0xf6ab('0x47')]['id']}})[_0xf6ab('0x23')](handleEntityNotFound(_0x58e1ce,null))['then'](saveUpdates(_0x5b476b[_0xf6ab('0x85')],null))['then'](respondWithResult(_0x58e1ce,null))['catch'](handleError(_0x58e1ce,null));};exports[_0xf6ab('0x92')]=function(_0x3e528b,_0x4940e3,_0x16c9c7){return db[_0xf6ab('0x2b')][_0xf6ab('0x49')]({'where':{'id':_0x3e528b[_0xf6ab('0x47')]['id']}})[_0xf6ab('0x23')](function(_0x4ff4b1){if(_0x4ff4b1){return _0x4ff4b1[_0xf6ab('0x24')]();}})[_0xf6ab('0x23')](function(_0x1a3bec){rimraf(path[_0xf6ab('0x59')](config[_0xf6ab('0x4a')],'server/files/plugins',path['dirname'](_0x1a3bec[_0xf6ab('0x4')])),function(){});return _0x1a3bec;})[_0xf6ab('0x23')](handleEntityNotFound(_0x4940e3,null))[_0xf6ab('0x23')](respondWithStatusCode(_0x4940e3,null))[_0xf6ab('0x46')](handleError(_0x4940e3,null));};exports[_0xf6ab('0x93')]=function(_0x3a563c,_0x29e3fb,_0x554a52){return BPromise[_0xf6ab('0x94')]()[_0xf6ab('0x23')](function(){if(!_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x4')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x95')]){throw new Error(_0xf6ab('0x96'));}var _0x210065=_0x3a563c['query'][_0xf6ab('0x97')]?_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x97')]+':'+_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x95')]:'http://localhost:'+_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x95')];var _0x1960b3=_0x3a563c[_0xf6ab('0x34')]['json']?_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x1a')]:!![];var _0x4be075=_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x98')]?_0x3a563c['query']['encoding']:null;var _0x5be9ee={'method':_0x3a563c[_0xf6ab('0x99')],'uri':util['format'](_0xf6ab('0x9a'),_0x210065,_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x4')]),'json':_0x1960b3,'resolveWithFullResponse':!![],'encoding':_0x4be075,'qs':_0x3a563c[_0xf6ab('0x34')]};if(_0x3a563c['headers']){_0x5be9ee[_0xf6ab('0x9b')]=_0x3a563c[_0xf6ab('0x9b')];if(_0x5be9ee[_0xf6ab('0x9b')]['content-length']){delete _0x5be9ee['headers'][_0xf6ab('0x9c')];}}if(_0x5be9ee[_0xf6ab('0x9b')][_0xf6ab('0x9d')]){delete _0x5be9ee[_0xf6ab('0x9b')][_0xf6ab('0x9d')];}return rp(_0x5be9ee);})['then'](function(_0x106947){if(_0x106947){_0x29e3fb['set'](_0x106947[_0xf6ab('0x9b')]);logger[_0xf6ab('0x5e')](_0x106947['body']);if(_[_0xf6ab('0x9e')](_0x3a563c[_0xf6ab('0x34')][_0xf6ab('0x4')],'download')&&_0x106947[_0xf6ab('0x9f')]==0x1f4){return _0x29e3fb[_0xf6ab('0x17')](_0x106947['statusCode']);}else{return _0x29e3fb[_0xf6ab('0x18')](_0x106947['statusCode'])[_0xf6ab('0x2a')](_0x106947[_0xf6ab('0x85')]);}}else{return _0x29e3fb[_0xf6ab('0x17')](0xc8);}})['catch'](handleError(_0x29e3fb,null));};exports[_0xf6ab('0xa0')]=function(_0x1fc22e,_0x475641,_0x41a200){return BPromise[_0xf6ab('0x94')]()['then'](function(){if(!_0x1fc22e[_0xf6ab('0x34')][_0xf6ab('0x4')]){throw new Error(_0xf6ab('0xa1'));}if(!_0x1fc22e['query'][_0xf6ab('0x95')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5e55e2=_0x1fc22e['query'][_0xf6ab('0x97')]?_0x1fc22e[_0xf6ab('0x34')][_0xf6ab('0x97')]+':'+_0x1fc22e['query'][_0xf6ab('0x95')]:_0xf6ab('0xa2')+_0x1fc22e[_0xf6ab('0x34')][_0xf6ab('0x95')];var _0x48ed73=_0x1fc22e['query'][_0xf6ab('0x1a')]?_0x1fc22e[_0xf6ab('0x34')][_0xf6ab('0x1a')]:!![];var _0x47f905=_0x1fc22e[_0xf6ab('0x34')]['encoding']?_0x1fc22e[_0xf6ab('0x34')][_0xf6ab('0x98')]:null;var _0x91fb4f={'method':_0x1fc22e['method'],'uri':util[_0xf6ab('0x4c')](_0xf6ab('0x9a'),_0x5e55e2,_0x1fc22e['query']['path']),'json':_0x48ed73,'resolveWithFullResponse':!![],'encoding':_0x47f905,'body':_0x1fc22e[_0xf6ab('0x85')]};if(_0x1fc22e[_0xf6ab('0x9b')]){_0x91fb4f[_0xf6ab('0x9b')]=_0x1fc22e['headers'];if(_0x91fb4f[_0xf6ab('0x9b')][_0xf6ab('0x9c')]){delete _0x91fb4f[_0xf6ab('0x9b')]['content-length'];}}if(_0x91fb4f[_0xf6ab('0x9b')][_0xf6ab('0x9d')]){delete _0x91fb4f['headers'][_0xf6ab('0x9d')];}return rp(_0x91fb4f);})['then'](function(_0x5c8d2b){if(_0x5c8d2b){_0x475641[_0xf6ab('0x1e')](_0x5c8d2b['headers']);logger[_0xf6ab('0x5e')](_0x5c8d2b[_0xf6ab('0x85')]);return _0x475641[_0xf6ab('0x18')](_0x5c8d2b['statusCode'])[_0xf6ab('0x2a')](_0x5c8d2b[_0xf6ab('0x85')]);}else{return _0x475641[_0xf6ab('0x17')](0xc8);}})[_0xf6ab('0x46')](handleError(_0x475641,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 957392f..9820e04 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 _0xd8fb=['../../mysqldb','Plugin','setMaxListeners','emit','hasOwnProperty','exports','events'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5995c4,_0x5cbd7a){_0x5995c4=_0x5995c4-0x0;var _0x49e580=_0xd8fb[_0x5995c4];return _0x49e580;};'use strict';var EventEmitter=require(_0xbd8f('0x0'));var Plugin=require(_0xbd8f('0x1'))['db'][_0xbd8f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xbd8f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x455a12){return function(_0x43d177,_0x53cccc,_0x400dfb){PluginEvents[_0xbd8f('0x4')](_0x455a12+':'+_0x43d177['id'],_0x43d177);PluginEvents['emit'](_0x455a12,_0x43d177);_0x400dfb(null);};}for(var e in events){if(events[_0xbd8f('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xbd8f('0x6')]=PluginEvents; \ No newline at end of file +var _0xfa45=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xfa45,0x11b));var _0x5fa4=function(_0x5ba323,_0x46a206){_0x5ba323=_0x5ba323-0x0;var _0x4e8817=_0xfa45[_0x5ba323];return _0x4e8817;};'use strict';var EventEmitter=require(_0x5fa4('0x0'));var Plugin=require(_0x5fa4('0x1'))['db'][_0x5fa4('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x5fa4('0x3')](0x0);var events={'afterCreate':_0x5fa4('0x4'),'afterUpdate':_0x5fa4('0x5'),'afterDestroy':_0x5fa4('0x6')};function emitEvent(_0x5d0d52){return function(_0x2b3824,_0x4b7365,_0x27c840){PluginEvents[_0x5fa4('0x7')](_0x5d0d52+':'+_0x2b3824['id'],_0x2b3824);PluginEvents[_0x5fa4('0x7')](_0x5d0d52,_0x2b3824);_0x27c840(null);};}for(var e in events){if(events[_0x5fa4('0x8')](e)){var event=events[e];Plugin[_0x5fa4('0x9')](e,emitEvent(event));}}module[_0x5fa4('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 709b19a..6584433 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 _0x188e=['Plugin','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','define'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x188e,0x156));var _0xe188=function(_0x27b96e,_0x56863a){_0x27b96e=_0x27b96e-0x0;var _0x3bff6b=_0x188e[_0x27b96e];return _0x3bff6b;};'use strict';var _=require(_0xe188('0x0'));var util=require(_0xe188('0x1'));var logger=require(_0xe188('0x2'))(_0xe188('0x3'));var moment=require('moment');var BPromise=require(_0xe188('0x4'));var rp=require(_0xe188('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe188('0x6'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0xc718d3,_0x4a6fda){return _0xc718d3[_0xe188('0x7')](_0xe188('0x8'),attributes,{'tableName':_0xe188('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcab7=['rimraf','exports','define','Plugin','lodash','util','bluebird','request-promise','path'];(function(_0x3957d2,_0x352111){var _0xa1f646=function(_0x1513a1){while(--_0x1513a1){_0x3957d2['push'](_0x3957d2['shift']());}};_0xa1f646(++_0x352111);}(_0xcab7,0x163));var _0x7cab=function(_0x55e059,_0x2df2c5){_0x55e059=_0x55e059-0x0;var _0x1e6bb7=_0xcab7[_0x55e059];return _0x1e6bb7;};'use strict';var _=require(_0x7cab('0x0'));var util=require(_0x7cab('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7cab('0x2'));var rp=require(_0x7cab('0x3'));var fs=require('fs');var path=require(_0x7cab('0x4'));var rimraf=require(_0x7cab('0x5'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x7cab('0x6')]=function(_0x3ce2a2,_0x565583){return _0x3ce2a2[_0x7cab('0x7')](_0x7cab('0x8'),attributes,{'tableName':'plugins','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 25f093e..4c3bc22 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 _0x4f95=['debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','body','options','raw','CreatePlugin','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x551844,_0x415299){var _0x2e7dac=function(_0x5b68a4){while(--_0x5b68a4){_0x551844['push'](_0x551844['shift']());}};_0x2e7dac(++_0x415299);}(_0x4f95,0x160));var _0x54f9=function(_0xa7da4c,_0x2eebf7){_0xa7da4c=_0xa7da4c-0x0;var _0xd24712=_0x4f95[_0xa7da4c];return _0xd24712;};'use strict';var _=require(_0x54f9('0x0'));var util=require(_0x54f9('0x1'));var moment=require('moment');var BPromise=require(_0x54f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54f9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x54f9('0x4'))(_0x54f9('0x5'));var config=require(_0x54f9('0x6'));var jayson=require(_0x54f9('0x7'));var client=jayson[_0x54f9('0x8')][_0x54f9('0x9')]({'port':0x232a});config[_0x54f9('0xa')]=_[_0x54f9('0xb')](config[_0x54f9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x54f9('0xc'))(new Redis(config['redis']));require(_0x54f9('0xd'))[_0x54f9('0xe')](socket);function respondWithRpcPromise(_0x5cf2da,_0x22aa2d,_0x57e77){return new BPromise(function(_0x138103,_0x368448){return client[_0x54f9('0xf')](_0x5cf2da,_0x57e77)[_0x54f9('0x10')](function(_0x4fac3c){logger[_0x54f9('0x11')](_0x54f9('0x12'),_0x22aa2d,_0x54f9('0x13'));logger[_0x54f9('0x14')](_0x54f9('0x15'),_0x22aa2d,_0x54f9('0x13'),JSON['stringify'](_0x4fac3c));if(_0x4fac3c[_0x54f9('0x16')]){if(_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x17')]===0x1f4){logger[_0x54f9('0x16')](_0x54f9('0x12'),_0x22aa2d,_0x4fac3c['error'][_0x54f9('0x18')]);return _0x368448(_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x18')]);}logger[_0x54f9('0x16')]('Plugin,\x20%s,\x20%s',_0x22aa2d,_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x18')]);return _0x138103(_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x18')]);}else{logger[_0x54f9('0x11')](_0x54f9('0x12'),_0x22aa2d,_0x54f9('0x13'));_0x138103(_0x4fac3c[_0x54f9('0x19')][_0x54f9('0x18')]);}})['catch'](function(_0x4af89a){logger[_0x54f9('0x16')]('Plugin,\x20%s,\x20%s',_0x22aa2d,_0x4af89a);_0x368448(_0x4af89a);});});}exports['CreatePlugin']=function(_0x331606){var _0x1ed298=this;return new Promise(function(_0x3c61cc,_0x1a97fd){return db['Plugin']['create'](_0x331606[_0x54f9('0x1a')],{'raw':_0x331606[_0x54f9('0x1b')]?_0x331606[_0x54f9('0x1b')][_0x54f9('0x1c')]===undefined?!![]:![]:!![]})[_0x54f9('0x10')](function(_0xbad964){logger[_0x54f9('0x11')](_0x54f9('0x1d'),_0x331606);logger[_0x54f9('0x14')](_0x54f9('0x1d'),_0x331606,JSON['stringify'](_0xbad964));_0x3c61cc(_0xbad964);})[_0x54f9('0x1e')](function(_0x3aa3af){logger['error'](_0x54f9('0x1d'),_0x3aa3af[_0x54f9('0x18')],_0x331606);_0x1a97fd(_0x1ed298['error'](0x1f4,_0x3aa3af['message']));});});}; \ No newline at end of file +var _0x6988=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','CreatePlugin','Plugin','options','raw','debug','stringify'];(function(_0x2531be,_0x2b35a7){var _0x52a0e5=function(_0x33581c){while(--_0x33581c){_0x2531be['push'](_0x2531be['shift']());}};_0x52a0e5(++_0x2b35a7);}(_0x6988,0x81));var _0x8698=function(_0x92a987,_0x4415b6){_0x92a987=_0x92a987-0x0;var _0x331f4c=_0x6988[_0x92a987];return _0x331f4c;};'use strict';var _=require(_0x8698('0x0'));var util=require(_0x8698('0x1'));var moment=require(_0x8698('0x2'));var BPromise=require(_0x8698('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8698('0x4'))['db'];var utils=require(_0x8698('0x5'));var logger=require(_0x8698('0x6'))(_0x8698('0x7'));var config=require('../../config/environment');var jayson=require(_0x8698('0x8'));var client=jayson['client'][_0x8698('0x9')]({'port':0x232a});config[_0x8698('0xa')]=_[_0x8698('0xb')](config[_0x8698('0xa')],{'host':_0x8698('0xc'),'port':0x18eb});var socket=require(_0x8698('0xd'))(new Redis(config['redis']));require(_0x8698('0xe'))[_0x8698('0xf')](socket);function respondWithRpcPromise(_0x269797,_0x43b6f8,_0x2867e8){return new BPromise(function(_0xd7a45f,_0x4cf6b4){return client[_0x8698('0x10')](_0x269797,_0x2867e8)[_0x8698('0x11')](function(_0x1a2ac5){logger['info'](_0x8698('0x12'),_0x43b6f8,'request\x20sent');logger['debug'](_0x8698('0x13'),_0x43b6f8,'request\x20sent',JSON['stringify'](_0x1a2ac5));if(_0x1a2ac5[_0x8698('0x14')]){if(_0x1a2ac5[_0x8698('0x14')][_0x8698('0x15')]===0x1f4){logger[_0x8698('0x14')](_0x8698('0x12'),_0x43b6f8,_0x1a2ac5['error']['message']);return _0x4cf6b4(_0x1a2ac5['error'][_0x8698('0x16')]);}logger[_0x8698('0x14')]('Plugin,\x20%s,\x20%s',_0x43b6f8,_0x1a2ac5['error'][_0x8698('0x16')]);return _0xd7a45f(_0x1a2ac5[_0x8698('0x14')][_0x8698('0x16')]);}else{logger['info'](_0x8698('0x12'),_0x43b6f8,_0x8698('0x17'));_0xd7a45f(_0x1a2ac5[_0x8698('0x18')]['message']);}})['catch'](function(_0x40a2fb){logger['error'](_0x8698('0x12'),_0x43b6f8,_0x40a2fb);_0x4cf6b4(_0x40a2fb);});});}exports[_0x8698('0x19')]=function(_0x15ea0e){var _0x540091=this;return new Promise(function(_0x6c4fca,_0x20b2c7){return db[_0x8698('0x1a')]['create'](_0x15ea0e['body'],{'raw':_0x15ea0e[_0x8698('0x1b')]?_0x15ea0e[_0x8698('0x1b')][_0x8698('0x1c')]===undefined?!![]:![]:!![]})[_0x8698('0x11')](function(_0x57cdc0){logger['info'](_0x8698('0x19'),_0x15ea0e);logger[_0x8698('0x1d')](_0x8698('0x19'),_0x15ea0e,JSON[_0x8698('0x1e')](_0x57cdc0));_0x6c4fca(_0x57cdc0);})[_0x8698('0x1f')](function(_0x4924e4){logger[_0x8698('0x14')](_0x8698('0x19'),_0x4924e4[_0x8698('0x16')],_0x15ea0e);_0x20b2c7(_0x540091['error'](0x1f4,_0x4924e4[_0x8698('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 7037edb..317d9c1 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 _0xedd7=['remove','update','removeListener','./plugin.events'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xedd7,0x167));var _0x7edd=function(_0x37dfdb,_0x51140f){_0x37dfdb=_0x37dfdb-0x0;var _0x1f1715=_0xedd7[_0x37dfdb];return _0x1f1715;};'use strict';var PluginEvents=require(_0x7edd('0x0'));var events=['save',_0x7edd('0x1'),_0x7edd('0x2')];function createListener(_0x3399cc,_0x3310a7){return function(_0x15d82c){_0x3310a7['emit'](_0x3399cc,_0x15d82c);};}function removeListener(_0x5afd7b,_0x2839ba){return function(){PluginEvents[_0x7edd('0x3')](_0x5afd7b,_0x2839ba);};}exports['register']=function(_0x3f881b){for(var _0x54a6ad=0x0,_0x34f76d=events['length'];_0x54a6ad<_0x34f76d;_0x54a6ad++){var _0x33df0d=events[_0x54a6ad];var _0x46db41=createListener('plugin:'+_0x33df0d,_0x3f881b);PluginEvents['on'](_0x33df0d,_0x46db41);}}; \ No newline at end of file +var _0xb5e1=['update','emit','plugin:','./plugin.events','save','remove'];(function(_0x590f63,_0x3e3e08){var _0x48534d=function(_0x793158){while(--_0x793158){_0x590f63['push'](_0x590f63['shift']());}};_0x48534d(++_0x3e3e08);}(_0xb5e1,0x19b));var _0x1b5e=function(_0x3bee49,_0x420058){_0x3bee49=_0x3bee49-0x0;var _0x30e8d0=_0xb5e1[_0x3bee49];return _0x30e8d0;};'use strict';var PluginEvents=require(_0x1b5e('0x0'));var events=[_0x1b5e('0x1'),_0x1b5e('0x2'),_0x1b5e('0x3')];function createListener(_0x3c4785,_0x5a7a61){return function(_0x1c4bbb){_0x5a7a61[_0x1b5e('0x4')](_0x3c4785,_0x1c4bbb);};}function removeListener(_0x50eba6,_0x438976){return function(){PluginEvents['removeListener'](_0x50eba6,_0x438976);};}exports['register']=function(_0x4f3188){for(var _0x37a296=0x0,_0x511aa2=events['length'];_0x37a296<_0x511aa2;_0x37a296++){var _0x30a80e=events[_0x37a296];var _0x311b08=createListener(_0x1b5e('0x5')+_0x30a80e,_0x4f3188);PluginEvents['on'](_0x30a80e,_0x311b08);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index aa5fdfc..541bcf4 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(_0x26a580,_0x3875a3){var _0x38c3a2=function(_0x1e15cb){while(--_0x1e15cb){_0x26a580['push'](_0x26a580['shift']());}};_0x38c3a2(++_0x3875a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0xc41dd3,_0x1c6816){var _0x3d20bd=function(_0x632b50){while(--_0x632b50){_0xc41dd3['push'](_0xc41dd3['shift']());}};_0x3d20bd(++_0x1c6816);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 3495fa8..7fd02da 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 _0xbec5=['Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','create','body','join','../../files/plugins','script','cwd','dirname','chdir','start','dump','restart','hasOwnProperty','params','destroy'];(function(_0x337571,_0x195458){var _0x57d5fd=function(_0x1cd91a){while(--_0x1cd91a){_0x337571['push'](_0x337571['shift']());}};_0x57d5fd(++_0x195458);}(_0xbec5,0xe5));var _0x5bec=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0xbec5[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0x5bec('0x0'));var pm2=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var path=require(_0x5bec('0x3'));var exec=require(_0x5bec('0x4'))[_0x5bec('0x5')];var BPromise=require(_0x5bec('0x6'));function handleEntityNotFound(_0x4ee982,_0x1f8933){return function(_0x376cdb){if(!_0x376cdb){_0x4ee982[_0x5bec('0x7')](0x194);;}return _0x376cdb;};}function respondWithResult(_0x4aaac6,_0x3ed67a){_0x3ed67a=_0x3ed67a||0xc8;return function(_0x28a427){if(_0x28a427){return _0x4aaac6[_0x5bec('0x8')](_0x3ed67a)[_0x5bec('0x9')](_0x28a427);}return null;};}function handleError(_0x43d96e,_0x302aae){_0x302aae=_0x302aae||0x1f4;return function(_0x6406a1){logger[_0x5bec('0xa')](_0x6406a1['stack']);if(_0x6406a1[_0x5bec('0xb')]){delete _0x6406a1['name'];}_0x43d96e[_0x5bec('0x8')](_0x302aae)[_0x5bec('0xc')](_0x6406a1);};}function execChildProcess(){return new BPromise(function(_0x117162,_0x4a5482){exec(_0x5bec('0xd'),function(_0x18fa47,_0x16226b,_0x57ffc4){logger[_0x5bec('0xe')](_0x16226b);logger[_0x5bec('0xe')](_0x57ffc4);if(_0x18fa47){logger['error'](_0x18fa47);return _0x4a5482(_0x18fa47);}return _0x117162(_0x16226b);});});}exports[_0x5bec('0xf')]=function(_0xaa984d,_0x35393a){return pm2[_0x5bec('0x10')]()[_0x5bec('0x11')](function(_0xcd6d90){if(_0xcd6d90){var _0x24dcd6=_[_0x5bec('0x12')](_0xcd6d90,function(_0x259588){return _0x259588[_0x5bec('0xb')]===_0x5bec('0x13')||_0x259588[_0x5bec('0xb')]===_0x5bec('0x14');});return{'rows':_0x24dcd6,'count':_0x24dcd6['length']};}return null;})['then'](respondWithResult(_0x35393a,null))[_0x5bec('0x15')](handleError(_0x35393a,null));};exports[_0x5bec('0x16')]=function(_0x31ad9c,_0x1771e7){return pm2['describe'](_0x31ad9c['params']['id'])[_0x5bec('0x11')](respondWithResult(_0x1771e7,null))[_0x5bec('0x11')](handleEntityNotFound(_0x1771e7,null))['catch'](handleError(_0x1771e7,null));};exports[_0x5bec('0x17')]=function(_0xa7e223,_0x32a846){if(_0xa7e223[_0x5bec('0x18')]['name']&&_0xa7e223[_0x5bec('0x18')]['script']){var _0x191c0f=path[_0x5bec('0x19')](__dirname,_0x5bec('0x1a'),_0xa7e223[_0x5bec('0x18')][_0x5bec('0x1b')]);var _0x5e154e=process[_0x5bec('0x1c')]();process['chdir'](path[_0x5bec('0x1d')](_0x191c0f));return execChildProcess()[_0x5bec('0x11')](function(_0x5b2636){process[_0x5bec('0x1e')](_0x5e154e);return pm2[_0x5bec('0x1f')]({'name':_0xa7e223['body'][_0x5bec('0xb')],'script':_0x191c0f});})[_0x5bec('0x11')](function(_0x43d460){pm2[_0x5bec('0x20')]();return _0x43d460[0x0];})[_0x5bec('0x11')](respondWithResult(_0x32a846,0xc9))[_0x5bec('0x15')](handleError(_0x32a846,null));}else{return _0x32a846[_0x5bec('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x2961bd,_0x2cdd2f){if(_0x2961bd[_0x5bec('0x18')]['id']){delete _0x2961bd['body']['id'];}var _0x2b3b2c={'online':_0x5bec('0x21'),'stopped':'stop'};if(_0x2b3b2c[_0x5bec('0x22')](_0x2961bd[_0x5bec('0x18')]['status'])){return pm2[_0x2b3b2c[_0x2961bd['body'][_0x5bec('0x8')]]](_0x2961bd[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](respondWithResult(_0x2cdd2f,0xc8))[_0x5bec('0x15')](handleError(_0x2cdd2f,null));}else{return _0x2cdd2f[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':'Unknown\x20status'});}};exports[_0x5bec('0x24')]=function(_0x59b5b6,_0x45863b){if(_0x59b5b6[_0x5bec('0x18')]['id']){delete _0x59b5b6[_0x5bec('0x18')]['id'];}if(_0x59b5b6[_0x5bec('0x23')]['id']){return pm2['delete'](_0x59b5b6[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](function(_0xfc7d41){pm2['dump']();return _0xfc7d41[0x0];})[_0x5bec('0x11')](respondWithResult(_0x45863b,null))['catch'](handleError(_0x45863b,null));}else{return _0x45863b[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':_0x5bec('0x25')});}}; \ No newline at end of file +var _0x9aea=['join','../../files/plugins','start','dump','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','params','create','body','script'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x9aea,0xdd));var _0xa9ae=function(_0x37bbb0,_0x4260ba){_0x37bbb0=_0x37bbb0-0x0;var _0x417e6c=_0x9aea[_0x37bbb0];return _0x417e6c;};'use strict';var _=require(_0xa9ae('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xa9ae('0x1'))('api');var path=require(_0xa9ae('0x2'));var exec=require(_0xa9ae('0x3'))['exec'];var BPromise=require(_0xa9ae('0x4'));function handleEntityNotFound(_0x115593,_0x41fb71){return function(_0x10f91d){if(!_0x10f91d){_0x115593[_0xa9ae('0x5')](0x194);;}return _0x10f91d;};}function respondWithResult(_0x56f942,_0x1aa3b9){_0x1aa3b9=_0x1aa3b9||0xc8;return function(_0x22734b){if(_0x22734b){return _0x56f942[_0xa9ae('0x6')](_0x1aa3b9)['json'](_0x22734b);}return null;};}function handleError(_0x1f2e4b,_0x3917f0){_0x3917f0=_0x3917f0||0x1f4;return function(_0x465bd2){logger[_0xa9ae('0x7')](_0x465bd2[_0xa9ae('0x8')]);if(_0x465bd2[_0xa9ae('0x9')]){delete _0x465bd2[_0xa9ae('0x9')];}_0x1f2e4b[_0xa9ae('0x6')](_0x3917f0)[_0xa9ae('0xa')](_0x465bd2);};}function execChildProcess(){return new BPromise(function(_0x5a8178,_0x3d400c){exec('npm\x20install',function(_0x2addd2,_0x226cf7,_0x112ab5){logger[_0xa9ae('0xb')](_0x226cf7);logger[_0xa9ae('0xb')](_0x112ab5);if(_0x2addd2){logger[_0xa9ae('0x7')](_0x2addd2);return _0x3d400c(_0x2addd2);}return _0x5a8178(_0x226cf7);});});}exports[_0xa9ae('0xc')]=function(_0x2b511a,_0x56de45){return pm2[_0xa9ae('0xd')]()[_0xa9ae('0xe')](function(_0x10882e){if(_0x10882e){var _0x3f7f61=_['reject'](_0x10882e,function(_0x28ce2d){return _0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0xf')||_0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0x10');});return{'rows':_0x3f7f61,'count':_0x3f7f61[_0xa9ae('0x11')]};}return null;})['then'](respondWithResult(_0x56de45,null))[_0xa9ae('0x12')](handleError(_0x56de45,null));};exports[_0xa9ae('0x13')]=function(_0x3e31d9,_0x4ac5a6){return pm2['describe'](_0x3e31d9[_0xa9ae('0x14')]['id'])['then'](respondWithResult(_0x4ac5a6,null))['then'](handleEntityNotFound(_0x4ac5a6,null))[_0xa9ae('0x12')](handleError(_0x4ac5a6,null));};exports[_0xa9ae('0x15')]=function(_0xbfd2ff,_0x42f961){if(_0xbfd2ff['body'][_0xa9ae('0x9')]&&_0xbfd2ff[_0xa9ae('0x16')][_0xa9ae('0x17')]){var _0x688153=path[_0xa9ae('0x18')](__dirname,_0xa9ae('0x19'),_0xbfd2ff[_0xa9ae('0x16')]['script']);var _0xc021cf=process['cwd']();process['chdir'](path['dirname'](_0x688153));return execChildProcess()['then'](function(_0x1afd07){process['chdir'](_0xc021cf);return pm2[_0xa9ae('0x1a')]({'name':_0xbfd2ff['body'][_0xa9ae('0x9')],'script':_0x688153});})[_0xa9ae('0xe')](function(_0x93d637){pm2[_0xa9ae('0x1b')]();return _0x93d637[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x42f961,0xc9))[_0xa9ae('0x12')](handleError(_0x42f961,null));}else{return _0x42f961[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x1c')});}};exports[_0xa9ae('0x1d')]=function(_0x2aac9e,_0xfe9ef1){if(_0x2aac9e[_0xa9ae('0x16')]['id']){delete _0x2aac9e[_0xa9ae('0x16')]['id'];}var _0xb12fa8={'online':'restart','stopped':'stop'};if(_0xb12fa8[_0xa9ae('0x1e')](_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')])){return pm2[_0xb12fa8[_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')]]](_0x2aac9e['params']['id'])['then'](respondWithResult(_0xfe9ef1,0xc8))[_0xa9ae('0x12')](handleError(_0xfe9ef1,null));}else{return _0xfe9ef1[_0xa9ae('0x6')](0x1f4)[_0xa9ae('0xa')]({'message':_0xa9ae('0x1f')});}};exports[_0xa9ae('0x20')]=function(_0x36bc28,_0x5d0c84){if(_0x36bc28['body']['id']){delete _0x36bc28[_0xa9ae('0x16')]['id'];}if(_0x36bc28[_0xa9ae('0x14')]['id']){return pm2[_0xa9ae('0x21')](_0x36bc28[_0xa9ae('0x14')]['id'])[_0xa9ae('0xe')](function(_0x231152){pm2[_0xa9ae('0x1b')]();return _0x231152[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x5d0c84,null))['catch'](handleError(_0x5d0c84,null));}else{return _0x5d0c84[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 00eb306..5f22dc4 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 _0x5a2e=['isAuthenticated','getQueues','exports','express','Router','get','/agents'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0x5a2e,0x96));var _0xe5a2=function(_0x51db59,_0x264d48){_0x51db59=_0x51db59-0x0;var _0x425d02=_0x5a2e[_0x51db59];return _0x425d02;};'use strict';var express=require(_0xe5a2('0x0'));var router=express[_0xe5a2('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0xe5a2('0x2')](_0xe5a2('0x3'),auth[_0xe5a2('0x4')](),controller['getAgents']);router[_0xe5a2('0x2')]('/queues',auth[_0xe5a2('0x4')](),controller[_0xe5a2('0x5')]);module[_0xe5a2('0x6')]=router; \ No newline at end of file +var _0x4012=['exports','express','../../components/auth/service','./realtime.controller','/agents','getAgents','get','/queues','isAuthenticated','getQueues'];(function(_0x2af808,_0x56a864){var _0xda8537=function(_0x1a462c){while(--_0x1a462c){_0x2af808['push'](_0x2af808['shift']());}};_0xda8537(++_0x56a864);}(_0x4012,0x10f));var _0x2401=function(_0x214e69,_0x5a0765){_0x214e69=_0x214e69-0x0;var _0xb4cf4a=_0x4012[_0x214e69];return _0xb4cf4a;};'use strict';var express=require(_0x2401('0x0'));var router=express['Router']();var auth=require(_0x2401('0x1'));var controller=require(_0x2401('0x2'));router['get'](_0x2401('0x3'),auth['isAuthenticated'](),controller[_0x2401('0x4')]);router[_0x2401('0x5')](_0x2401('0x6'),auth[_0x2401('0x7')](),controller[_0x2401('0x8')]);module[_0x2401('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 abf22df..0a9d952 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 _0x24ca=['join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','key','role','online','getOptions','push','sequelize','forEach','Pause','where','merge','user','userProfileId','Agents','agent','UserProfile','getResources','find','filterAgentAttributes','globalStatus','Status','sortAgentsByStatus','fields','split','catch','getQueues','format','Channel\x20parameter\x20%s\x20is\x20invalid','Queue','type','name','outbound','voice','QueueCampaigns','startCase','filter','findAndCountAll','initializeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','Content-Range','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','channel','isValidChannel','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions'];(function(_0x39707b,_0x2caf4d){var _0xd9864b=function(_0xb94f2b){while(--_0xb94f2b){_0x39707b['push'](_0x39707b['shift']());}};_0xd9864b(++_0x2caf4d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x24ca[_0x111e94];return _0x3de107;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var rta=require(_0xa24c('0x1'));var rtq=require(_0xa24c('0x2'));var qs=require(_0xa24c('0x3'));var utils=require('../../config/utils');var db=require(_0xa24c('0x4'))['db'];var APIBadRequestError=require(_0xa24c('0x5'))[_0xa24c('0x6')];var APIHandleError=require(_0xa24c('0x5'))[_0xa24c('0x7')];function respondWithFilteredResult(_0x15a5cd,_0xf0511){return function(_0x3c0aaa){if(_0x3c0aaa){var _0x2dd348=typeof _0xf0511[_0xa24c('0x8')]===_0xa24c('0x9')&&typeof _0xf0511['limit']===_0xa24c('0x9');var _0x3a5727=_0x3c0aaa[_0xa24c('0xa')];var _0x5eac78=_0x2dd348?0x0:_0xf0511[_0xa24c('0x8')];var _0x325c6d=_0x2dd348?_0x3c0aaa[_0xa24c('0xa')]:_0xf0511[_0xa24c('0x8')]+_0xf0511[_0xa24c('0xb')];var _0x43aa5a;if(_0x325c6d>=_0x3a5727){_0x325c6d=_0x3a5727;_0x43aa5a=0xc8;}else{_0x43aa5a=0xce;}_0x15a5cd[_0xa24c('0xc')](_0x43aa5a);return _0x15a5cd[_0xa24c('0xd')](_0xa24c('0xe'),_0x5eac78+'-'+_0x325c6d+'/'+_0x3a5727)['json'](_0x3c0aaa);}return null;};}exports[_0xa24c('0xf')]=function(_0x11090c,_0xcee4fe){var _0x2c2af8={'count':0x0,'rows':[]};var _0x5a9486={};var _0x3ad0bf;var _0x3c23fc=utils[_0xa24c('0x10')]();var _0x2fcd8b;var _0x1cb08e;var _0x2d185c=_0x11090c[_0xa24c('0x11')]['globalQueueFilter'];var _0x47a063=_0x11090c[_0xa24c('0x11')][_0xa24c('0x12')];var _0x49ce53=_0x11090c['query'][_0xa24c('0x13')];var _0x1b29ad=_0x47a063==='pause'||_0x47a063===_0xa24c('0x14')?!![]:![];var _0x5de3e6=[];var _0x558dc7;var _0x2a610a;Promise[_0xa24c('0x15')]()[_0xa24c('0x16')](function(){if(_0x11090c['query'][_0xa24c('0x17')]){if(!utils[_0xa24c('0x18')](_0x11090c[_0xa24c('0x11')]['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x11090c['query'][_0xa24c('0x17')]));}_0x3ad0bf=_0x11090c[_0xa24c('0x11')][_0xa24c('0x17')][_0xa24c('0x19')]();}if(!_0x11090c['query'][_0xa24c('0x1a')]||!_0x11090c['query'][_0xa24c('0x1a')][_0xa24c('0x1b')]('globalStatus')){_0x11090c[_0xa24c('0x11')][_0xa24c('0x1a')]=rta[_0xa24c('0x1c')](_0x11090c[_0xa24c('0x11')][_0xa24c('0x1a')]);return;}var _0x47e0eb=rta[_0xa24c('0x1d')](_0x11090c['query'][_0xa24c('0x1a')]);_0x11090c[_0xa24c('0x11')][_0xa24c('0x1a')]=_0x47e0eb['fields'][_0xa24c('0x1e')](',');_0x558dc7=_0x47e0eb[_0xa24c('0x1f')];})[_0xa24c('0x16')](function(){if(!_0x2d185c){return[];}return rta[_0xa24c('0x20')](_0x2d185c,_0x3ad0bf);})[_0xa24c('0x16')](function(_0x3ad0e6){_0x5de3e6=_0x3ad0e6;return rta[_0xa24c('0x21')]();})['then'](function(_0xa0c48e){_0x1cb08e=_0xa0c48e[_0xa24c('0x22')];if((!_0x47a063||_0x1b29ad)&&!_0x558dc7){return _0x5de3e6;}if(_0x558dc7&&!_0x47a063){return rta[_0xa24c('0x23')](_0x1cb08e,_0x5de3e6,_0x558dc7);}else{return rta[_0xa24c('0x24')](_0x1cb08e,_0x5de3e6,_0x47a063);}})['then'](function(_0x21d2a8){_0x5de3e6=_0x21d2a8;var _0xc96ce7=![];if(_0x5de3e6[_0xa24c('0x25')]===0x0){if(_0x2d185c||_0x47a063){_0xc96ce7=!![];}if(_0x1b29ad){_0xc96ce7=![];}}if(_0xc96ce7){return _0x2c2af8;}var _0x59dbeb=_[_0xa24c('0x26')](db[_0xa24c('0x27')][_0xa24c('0x28')],function(_0x4ae35c){return{'name':_0x4ae35c[_0xa24c('0x29')],'type':_0x4ae35c['type'][_0xa24c('0x2a')]};});_0x11090c[_0xa24c('0x11')][_0xa24c('0x2b')]='agent';_0x11090c[_0xa24c('0x11')][_0xa24c('0x2c')]=!![];_0x5a9486=qs[_0xa24c('0x2d')](_0x59dbeb,_0x11090c);_0x5a9486['raw']=!![];var _0x1c1ed3=[];if(_0x5de3e6['length']>0x0){_0x1c1ed3[_0xa24c('0x2e')]({'id':{'$in':_0x5de3e6}});if(_0x558dc7&&!_0x47a063){_0x2a610a=[db[_0xa24c('0x2f')]['literal']('FIELD(id,'+_0x5de3e6+')')];_0x5a9486[_0xa24c('0x1f')]=_0x2a610a;}}if(_0x1b29ad){_0x3c23fc[_0xa24c('0x30')](function(_0x182e86){var _0x3c7522=!![];if(_0x47a063===_0xa24c('0x14')&&_0x3ad0bf!==_0x182e86){_0x3c7522=![];}_0x1c1ed3[_0xa24c('0x2e')]({[_0x182e86+_0xa24c('0x31')]:_0x3c7522});});if(_0x49ce53){_0x1c1ed3['push']({'pauseType':_0x49ce53});}}else if(_0x47a063){_0x3c23fc[_0xa24c('0x30')](function(_0x3ea442){_0x1c1ed3[_0xa24c('0x2e')]({[_0x3ea442+_0xa24c('0x31')]:![]});});}_0x5a9486[_0xa24c('0x32')]=_[_0xa24c('0x33')](_0x5a9486[_0xa24c('0x32')],{'$and':_0x1c1ed3});if(_0x11090c[_0xa24c('0x34')][_0xa24c('0x2b')]===_0xa24c('0x34')){var _0x4c7a30={'params':{'id':_0x11090c[_0xa24c('0x34')][_0xa24c('0x35')]},'query':{'section':_0xa24c('0x36'),'role':_0xa24c('0x37'),'online':!![],'raw':!![],'ids':_0x5de3e6,'customSorting':_0x2a610a}};if(_0x1b29ad){_0x4c7a30['query']['extraQueryConditions']=_0x1c1ed3;}_0x4c7a30[_0xa24c('0x11')]=Object['assign'](_0x4c7a30[_0xa24c('0x11')],_0x11090c[_0xa24c('0x11')]);delete _0x4c7a30[_0xa24c('0x11')]['id'];return db[_0xa24c('0x38')][_0xa24c('0x39')](_0x4c7a30);}return db['User']['findAndCountAll'](_0x5a9486);})[_0xa24c('0x16')](function(_0xc661c7){_0x2c2af8[_0xa24c('0xa')]=_0xc661c7[_0xa24c('0xa')];_0x2fcd8b=_0xc661c7[_0xa24c('0x22')];return _0x2fcd8b[_0xa24c('0x26')](function(_0x5080d0){var _0x56f392=_[_0xa24c('0x3a')](_0x1cb08e,['id',_0x5080d0['id']]);if(_0x56f392){var _0x1ce83e=rta[_0xa24c('0x3b')](_0x56f392);_[_0xa24c('0x33')](_0x5080d0,_0x1ce83e);}_0x5080d0[_0xa24c('0x3c')]=rta['getAgentStatus'](_0x5080d0);if(_0x5080d0[_0xa24c('0x3c')][_0xa24c('0x1b')]('pause')){_0x3c23fc['forEach'](function(_0xba7407){if(_0x5080d0[_0xba7407+_0xa24c('0x31')]){_0x5080d0[_0xba7407+_0xa24c('0x3d')]='pause';}});}return _0x5080d0;});})['then'](function(_0x21e204){if(!_0x558dc7||_0x2a610a){return _0x21e204;}return rta[_0xa24c('0x3e')](_0x21e204,_0x558dc7);})[_0xa24c('0x16')](function(_0x3ccc37){var _0x3f640e=null;if(_0x11090c[_0xa24c('0x11')][_0xa24c('0x3f')]){var _0x394d19=_0x11090c['query']['fields'][_0xa24c('0x40')](',');_0x3f640e=_0x3ccc37[_0xa24c('0x26')](function(_0x455256){return _['pick'](_0x455256,_0x394d19);});}_0x2c2af8[_0xa24c('0x22')]=_0x3f640e||_0x3ccc37;return _0x2c2af8;})[_0xa24c('0x16')](respondWithFilteredResult(_0xcee4fe,_0x5a9486))[_0xa24c('0x41')](APIHandleError(_0xcee4fe));};exports[_0xa24c('0x42')]=function(_0x442ede,_0x262550){var _0x1e7e97={'count':0x0,'rows':[]};var _0x35ed8a={};var _0x3f52fe;var _0x320582;var _0x4bbf93;Promise[_0xa24c('0x15')]()[_0xa24c('0x16')](function(){if(_0x442ede[_0xa24c('0x11')]['channel']){if(!utils[_0xa24c('0x18')](_0x442ede[_0xa24c('0x11')][_0xa24c('0x17')])){throw new APIBadRequestError(util[_0xa24c('0x43')](_0xa24c('0x44'),_0x442ede[_0xa24c('0x11')][_0xa24c('0x17')]));}_0x3f52fe=_0x442ede[_0xa24c('0x11')][_0xa24c('0x17')][_0xa24c('0x19')]();}var _0x418525=_['startCase'](_0x3f52fe)+_0xa24c('0x45');var _0x96b977=_[_0xa24c('0x26')](db[_0x418525][_0xa24c('0x28')],function(_0x1a1d02){return{'name':_0x1a1d02[_0xa24c('0x29')],'type':_0x1a1d02[_0xa24c('0x46')][_0xa24c('0x2a')]};});if(!_0x442ede[_0xa24c('0x11')]['fields']){var _0x540da8=['id',_0xa24c('0x47')];if(_0x3f52fe==='voice'){_0x540da8[_0xa24c('0x2e')](_0xa24c('0x46'));if(_0x442ede['query'][_0xa24c('0x46')]===_0xa24c('0x48')){_0x540da8[_0xa24c('0x2e')](['dialActive','dialMethod']);}}_0x442ede[_0xa24c('0x11')]['fields']=_0x540da8[_0xa24c('0x1e')](',');}_0x35ed8a=qs[_0xa24c('0x2d')](_0x96b977,_0x442ede);if(_0x442ede[_0xa24c('0x34')][_0xa24c('0x2b')]===_0xa24c('0x34')){var _0x1fa739={'params':{'id':_0x442ede[_0xa24c('0x34')][_0xa24c('0x35')]},'query':{'section':_0x3f52fe===_0xa24c('0x49')&&_0x442ede[_0xa24c('0x11')]['type']===_0xa24c('0x48')?_0xa24c('0x4a'):_[_0xa24c('0x4b')](_0x3f52fe)+'Queues','type':_0x442ede['query']['type'],'nolimit':!![],'sort':_0xa24c('0x47'),'filter':_0x442ede['query'][_0xa24c('0x4c')]}};_0x1fa739[_0xa24c('0x11')]=Object['assign'](_0x1fa739[_0xa24c('0x11')],_0x442ede[_0xa24c('0x11')]);delete _0x1fa739[_0xa24c('0x11')]['id'];return db[_0xa24c('0x38')][_0xa24c('0x39')](_0x1fa739);}return db[_0x418525][_0xa24c('0x4d')](_0x35ed8a);})[_0xa24c('0x16')](function(_0xbeab78){_0x1e7e97['count']=_0xbeab78[_0xa24c('0xa')];_0x320582=_0xbeab78['rows'];return rtq['getRealtimeQueues'](_0x442ede,_0x3f52fe);})['then'](function(_0x5bd2af){_0x4bbf93=_0x5bd2af['rows'];return rtq[_0xa24c('0x4e')](_0x320582,_0x4bbf93,_0x3f52fe,_0x442ede['query'][_0xa24c('0x46')]);})[_0xa24c('0x16')](function(_0x5247f9){_0x1e7e97[_0xa24c('0x22')]=_0x5247f9;return _0x1e7e97;})[_0xa24c('0x16')](respondWithFilteredResult(_0x262550,_0x35ed8a))[_0xa24c('0x41')](APIHandleError(_0x262550));}; \ No newline at end of file +var _0x038b=['UserProfile','findAndCountAll','filterAgentAttributes','getAgentStatus','includes','Status','sortAgentsByStatus','fields','catch','getQueues','isValidChannel','startCase','Queue','voice','outbound','dialActive','dialMethod','getOptions','QueueCampaigns','Queues','name','filter','getResources','initializeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','getChannels','globalQueueFilter','query','globalStatusFilter','pause','*pause','resolve','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','online','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','assign'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x038b,0x114));var _0xb038=function(_0x53434c,_0xd17afa){_0x53434c=_0x53434c-0x0;var _0x434c1c=_0x038b[_0x53434c];return _0x434c1c;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var rta=require(_0xb038('0x1'));var rtq=require(_0xb038('0x2'));var qs=require('../../components/parsers/qs');var utils=require(_0xb038('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xb038('0x4'))[_0xb038('0x5')];var APIHandleError=require('../../errors/api')[_0xb038('0x6')];function respondWithFilteredResult(_0x11da3a,_0x4fe092){return function(_0x54e1e7){if(_0x54e1e7){var _0x2e3e64=typeof _0x4fe092[_0xb038('0x7')]===_0xb038('0x8')&&typeof _0x4fe092['limit']==='undefined';var _0x462e8f=_0x54e1e7[_0xb038('0x9')];var _0x4d85b4=_0x2e3e64?0x0:_0x4fe092['offset'];var _0xe3d046=_0x2e3e64?_0x54e1e7[_0xb038('0x9')]:_0x4fe092['offset']+_0x4fe092[_0xb038('0xa')];var _0x162ae7;if(_0xe3d046>=_0x462e8f){_0xe3d046=_0x462e8f;_0x162ae7=0xc8;}else{_0x162ae7=0xce;}_0x11da3a[_0xb038('0xb')](_0x162ae7);return _0x11da3a[_0xb038('0xc')](_0xb038('0xd'),_0x4d85b4+'-'+_0xe3d046+'/'+_0x462e8f)[_0xb038('0xe')](_0x54e1e7);}return null;};}exports[_0xb038('0xf')]=function(_0x439751,_0x16e4a3){var _0x57acd8={'count':0x0,'rows':[]};var _0x60f332={};var _0x119c81;var _0x1b9686=utils[_0xb038('0x10')]();var _0x3a71a6;var _0x13acc7;var _0x13f893=_0x439751['query'][_0xb038('0x11')];var _0x26e4f2=_0x439751[_0xb038('0x12')][_0xb038('0x13')];var _0xdef213=_0x439751[_0xb038('0x12')]['pauseTypeFilter'];var _0x2a4134=_0x26e4f2===_0xb038('0x14')||_0x26e4f2===_0xb038('0x15')?!![]:![];var _0x3b095a=[];var _0x4aa892;var _0x49b237;Promise[_0xb038('0x16')]()[_0xb038('0x17')](function(){if(_0x439751[_0xb038('0x12')][_0xb038('0x18')]){if(!utils['isValidChannel'](_0x439751[_0xb038('0x12')][_0xb038('0x18')])){throw new APIBadRequestError(util[_0xb038('0x19')](_0xb038('0x1a'),_0x439751[_0xb038('0x12')]['channel']));}_0x119c81=_0x439751[_0xb038('0x12')][_0xb038('0x18')][_0xb038('0x1b')]();}if(!_0x439751[_0xb038('0x12')]['sort']||!_0x439751[_0xb038('0x12')][_0xb038('0x1c')]['includes'](_0xb038('0x1d'))){_0x439751[_0xb038('0x12')]['sort']=rta[_0xb038('0x1e')](_0x439751['query'][_0xb038('0x1c')]);return;}var _0x36eb5b=rta[_0xb038('0x1f')](_0x439751[_0xb038('0x12')][_0xb038('0x1c')]);_0x439751[_0xb038('0x12')][_0xb038('0x1c')]=_0x36eb5b['fields'][_0xb038('0x20')](',');_0x4aa892=_0x36eb5b[_0xb038('0x21')];})[_0xb038('0x17')](function(){if(!_0x13f893){return[];}return rta['getAgentIdsByQueues'](_0x13f893,_0x119c81);})[_0xb038('0x17')](function(_0x3af191){_0x3b095a=_0x3af191;return rta[_0xb038('0x22')]();})['then'](function(_0x41abf4){_0x13acc7=_0x41abf4[_0xb038('0x23')];if((!_0x26e4f2||_0x2a4134)&&!_0x4aa892){return _0x3b095a;}if(_0x4aa892&&!_0x26e4f2){return rta[_0xb038('0x24')](_0x13acc7,_0x3b095a,_0x4aa892);}else{return rta[_0xb038('0x25')](_0x13acc7,_0x3b095a,_0x26e4f2);}})[_0xb038('0x17')](function(_0x551b55){_0x3b095a=_0x551b55;var _0x1783d4=![];if(_0x3b095a[_0xb038('0x26')]===0x0){if(_0x13f893||_0x26e4f2){_0x1783d4=!![];}if(_0x2a4134){_0x1783d4=![];}}if(_0x1783d4){return _0x57acd8;}var _0x3d2719=_[_0xb038('0x27')](db[_0xb038('0x28')][_0xb038('0x29')],function(_0x29a0d7){return{'name':_0x29a0d7[_0xb038('0x2a')],'type':_0x29a0d7[_0xb038('0x2b')][_0xb038('0x2c')]};});_0x439751[_0xb038('0x12')][_0xb038('0x2d')]=_0xb038('0x2e');_0x439751['query'][_0xb038('0x2f')]=!![];_0x60f332=qs['getOptions'](_0x3d2719,_0x439751);_0x60f332[_0xb038('0x30')]=!![];var _0x13bf20=[];if(_0x3b095a[_0xb038('0x26')]>0x0){_0x13bf20[_0xb038('0x31')]({'id':{'$in':_0x3b095a}});if(_0x4aa892&&!_0x26e4f2){_0x49b237=[db[_0xb038('0x32')][_0xb038('0x33')](_0xb038('0x34')+_0x3b095a+')')];_0x60f332[_0xb038('0x21')]=_0x49b237;}}if(_0x2a4134){_0x1b9686[_0xb038('0x35')](function(_0x883647){var _0x4fedda=!![];if(_0x26e4f2===_0xb038('0x15')&&_0x119c81!==_0x883647){_0x4fedda=![];}_0x13bf20[_0xb038('0x31')]({[_0x883647+_0xb038('0x36')]:_0x4fedda});});if(_0xdef213){_0x13bf20['push']({'pauseType':_0xdef213});}}else if(_0x26e4f2){_0x1b9686['forEach'](function(_0x5395dc){_0x13bf20[_0xb038('0x31')]({[_0x5395dc+_0xb038('0x36')]:![]});});}_0x60f332[_0xb038('0x37')]=_[_0xb038('0x38')](_0x60f332[_0xb038('0x37')],{'$and':_0x13bf20});if(_0x439751[_0xb038('0x39')]['role']===_0xb038('0x39')){var _0x378cae={'params':{'id':_0x439751[_0xb038('0x39')][_0xb038('0x3a')]},'query':{'section':'Agents','role':_0xb038('0x2e'),'online':!![],'raw':!![],'ids':_0x3b095a,'customSorting':_0x49b237}};if(_0x2a4134){_0x378cae[_0xb038('0x12')]['extraQueryConditions']=_0x13bf20;}_0x378cae['query']=Object[_0xb038('0x3b')](_0x378cae[_0xb038('0x12')],_0x439751[_0xb038('0x12')]);delete _0x378cae[_0xb038('0x12')]['id'];return db[_0xb038('0x3c')]['getResources'](_0x378cae);}return db[_0xb038('0x28')][_0xb038('0x3d')](_0x60f332);})[_0xb038('0x17')](function(_0x2d1e57){_0x57acd8['count']=_0x2d1e57[_0xb038('0x9')];_0x3a71a6=_0x2d1e57[_0xb038('0x23')];return _0x3a71a6[_0xb038('0x27')](function(_0x573426){var _0x412d71=_['find'](_0x13acc7,['id',_0x573426['id']]);if(_0x412d71){var _0x36f281=rta[_0xb038('0x3e')](_0x412d71);_[_0xb038('0x38')](_0x573426,_0x36f281);}_0x573426['globalStatus']=rta[_0xb038('0x3f')](_0x573426);if(_0x573426[_0xb038('0x1d')][_0xb038('0x40')]('pause')){_0x1b9686[_0xb038('0x35')](function(_0xa5971a){if(_0x573426[_0xa5971a+_0xb038('0x36')]){_0x573426[_0xa5971a+_0xb038('0x41')]='pause';}});}return _0x573426;});})[_0xb038('0x17')](function(_0x274212){if(!_0x4aa892||_0x49b237){return _0x274212;}return rta[_0xb038('0x42')](_0x274212,_0x4aa892);})[_0xb038('0x17')](function(_0x52e1d6){var _0x19dc7b=null;if(_0x439751[_0xb038('0x12')]['fields']){var _0x207fb5=_0x439751[_0xb038('0x12')][_0xb038('0x43')]['split'](',');_0x19dc7b=_0x52e1d6[_0xb038('0x27')](function(_0x317e51){return _['pick'](_0x317e51,_0x207fb5);});}_0x57acd8['rows']=_0x19dc7b||_0x52e1d6;return _0x57acd8;})[_0xb038('0x17')](respondWithFilteredResult(_0x16e4a3,_0x60f332))[_0xb038('0x44')](APIHandleError(_0x16e4a3));};exports[_0xb038('0x45')]=function(_0x17c904,_0x2c9747){var _0x36e48c={'count':0x0,'rows':[]};var _0x630aef={};var _0x2de51d;var _0x516940;var _0x5f0d9d;Promise['resolve']()[_0xb038('0x17')](function(){if(_0x17c904[_0xb038('0x12')]['channel']){if(!utils[_0xb038('0x46')](_0x17c904[_0xb038('0x12')][_0xb038('0x18')])){throw new APIBadRequestError(util['format'](_0xb038('0x1a'),_0x17c904['query']['channel']));}_0x2de51d=_0x17c904[_0xb038('0x12')][_0xb038('0x18')][_0xb038('0x1b')]();}var _0x15100c=_[_0xb038('0x47')](_0x2de51d)+_0xb038('0x48');var _0x2f053a=_[_0xb038('0x27')](db[_0x15100c][_0xb038('0x29')],function(_0x3db14f){return{'name':_0x3db14f['fieldName'],'type':_0x3db14f[_0xb038('0x2b')][_0xb038('0x2c')]};});if(!_0x17c904['query'][_0xb038('0x43')]){var _0x19ab72=['id','name'];if(_0x2de51d===_0xb038('0x49')){_0x19ab72[_0xb038('0x31')](_0xb038('0x2b'));if(_0x17c904[_0xb038('0x12')][_0xb038('0x2b')]===_0xb038('0x4a')){_0x19ab72[_0xb038('0x31')]([_0xb038('0x4b'),_0xb038('0x4c')]);}}_0x17c904['query'][_0xb038('0x43')]=_0x19ab72[_0xb038('0x20')](',');}_0x630aef=qs[_0xb038('0x4d')](_0x2f053a,_0x17c904);if(_0x17c904[_0xb038('0x39')][_0xb038('0x2d')]===_0xb038('0x39')){var _0x591077={'params':{'id':_0x17c904[_0xb038('0x39')][_0xb038('0x3a')]},'query':{'section':_0x2de51d===_0xb038('0x49')&&_0x17c904[_0xb038('0x12')][_0xb038('0x2b')]===_0xb038('0x4a')?_0xb038('0x4e'):_['startCase'](_0x2de51d)+_0xb038('0x4f'),'type':_0x17c904['query'][_0xb038('0x2b')],'nolimit':!![],'sort':_0xb038('0x50'),'filter':_0x17c904[_0xb038('0x12')][_0xb038('0x51')]}};_0x591077[_0xb038('0x12')]=Object['assign'](_0x591077['query'],_0x17c904['query']);delete _0x591077[_0xb038('0x12')]['id'];return db[_0xb038('0x3c')][_0xb038('0x52')](_0x591077);}return db[_0x15100c][_0xb038('0x3d')](_0x630aef);})[_0xb038('0x17')](function(_0xb4eb34){_0x36e48c['count']=_0xb4eb34[_0xb038('0x9')];_0x516940=_0xb4eb34[_0xb038('0x23')];return rtq['getRealtimeQueues'](_0x17c904,_0x2de51d);})['then'](function(_0xf2907b){_0x5f0d9d=_0xf2907b['rows'];return rtq[_0xb038('0x53')](_0x516940,_0x5f0d9d,_0x2de51d,_0x17c904['query'][_0xb038('0x2b')]);})[_0xb038('0x17')](function(_0x301445){_0x36e48c[_0xb038('0x23')]=_0x301445;return _0x36e48c;})['then'](respondWithFilteredResult(_0x2c9747,_0x630aef))[_0xb038('0x44')](APIHandleError(_0x2c9747));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 4270f46..411f2b2 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(_0x667ff8,_0x59e7df){var _0x2ddfc7=function(_0x5a4a46){while(--_0x5a4a46){_0x667ff8['push'](_0x667ff8['shift']());}};_0x2ddfc7(++_0x59e7df);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5d8feb,_0x224dcd){var _0x49b0bd=function(_0x55398f){while(--_0x55398f){_0x5d8feb['push'](_0x5d8feb['shift']());}};_0x49b0bd(++_0x224dcd);}(_0x70e0,0x17b));var _0x070e=function(_0x489ab8,_0x3265d3){_0x489ab8=_0x489ab8-0x0;var _0x46c17a=_0x70e0[_0x489ab8];return _0x46c17a;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2c97476..2cdf699 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 _0x71ad=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0x2b8dd9,_0x29e442){var _0x5687d3=function(_0x458eaa){while(--_0x458eaa){_0x2b8dd9['push'](_0x2b8dd9['shift']());}};_0x5687d3(++_0x29e442);}(_0x71ad,0xee));var _0xd71a=function(_0x43f379,_0xcfe04e){_0x43f379=_0x43f379-0x0;var _0x2aac8f=_0x71ad[_0x43f379];return _0x2aac8f;};'use strict';var Sequelize=require(_0xd71a('0x0'));module[_0xd71a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd71a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xd71a('0x2')]},'starttime':{'type':Sequelize[_0xd71a('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd71a('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd71a('0x2')]}}; \ No newline at end of file +var _0x9206=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0xfe60ee,_0x232a1b){var _0x124c7b=function(_0x2f6054){while(--_0x2f6054){_0xfe60ee['push'](_0xfe60ee['shift']());}};_0x124c7b(++_0x232a1b);}(_0x9206,0x176));var _0x6920=function(_0x542011,_0x266260){_0x542011=_0x542011-0x0;var _0x4bbe39=_0x9206[_0x542011];return _0x4bbe39;};'use strict';var Sequelize=require(_0x6920('0x0'));module[_0x6920('0x1')]={'state':{'type':Sequelize[_0x6920('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6920('0x3')]},'scheduledat':{'type':Sequelize[_0x6920('0x4')]},'uniqueid':{'type':Sequelize[_0x6920('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x6920('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6920('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 26fd0d6..cd3c350 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 _0xab1d=['../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xab1d,0x155));var _0xdab1=function(_0x51e942,_0x113998){_0x51e942=_0x51e942-0x0;var _0x4dc96a=_0xab1d[_0x51e942];return _0x4dc96a;};'use strict';var _=require(_0xdab1('0x0'));var util=require(_0xdab1('0x1'));var logger=require(_0xdab1('0x2'))('api');var moment=require(_0xdab1('0x3'));var BPromise=require(_0xdab1('0x4'));var rp=require(_0xdab1('0x5'));var fs=require('fs');var path=require(_0xdab1('0x6'));var rimraf=require('rimraf');var config=require(_0xdab1('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0xdab1('0x8')]=function(_0x14d919,_0x5ed8dc){return _0x14d919[_0xdab1('0x9')](_0xdab1('0xa'),attributes,{'tableName':_0xdab1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bc5=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x5bc5,0x1bc));var _0x55bc=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x5bc5[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var logger=require(_0x55bc('0x2'))('api');var moment=require(_0x55bc('0x3'));var BPromise=require(_0x55bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55bc('0x5'));var rimraf=require(_0x55bc('0x6'));var config=require(_0x55bc('0x7'));var attributes=require(_0x55bc('0x8'));module[_0x55bc('0x9')]=function(_0x12abe9,_0x279683){return _0x12abe9[_0x55bc('0xa')](_0x55bc('0xb'),attributes,{'tableName':_0x55bc('0xc'),'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 01cc8c0..3f8c206 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 _0x61e3=['code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4cb0a4,_0x2c168d){var _0x52da2a=function(_0xfb0c22){while(--_0xfb0c22){_0x4cb0a4['push'](_0x4cb0a4['shift']());}};_0x52da2a(++_0x2c168d);}(_0x61e3,0xa5));var _0x361e=function(_0x170cd7,_0x57624b){_0x170cd7=_0x170cd7-0x0;var _0x5c82e9=_0x61e3[_0x170cd7];return _0x5c82e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x361e('0x0'));var BPromise=require(_0x361e('0x1'));var rs=require(_0x361e('0x2'));var fs=require('fs');var Redis=require(_0x361e('0x3'));var db=require(_0x361e('0x4'))['db'];var utils=require(_0x361e('0x5'));var logger=require(_0x361e('0x6'))(_0x361e('0x7'));var config=require(_0x361e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x361e('0x9')][_0x361e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x484fcd,_0x3390a0,_0x2d37dd){return new BPromise(function(_0x4d4478,_0x14f9b6){return client['request'](_0x484fcd,_0x2d37dd)['then'](function(_0x4c661f){logger[_0x361e('0xb')](_0x361e('0xc'),_0x3390a0,_0x361e('0xd'));logger[_0x361e('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3390a0,_0x361e('0xd'),JSON[_0x361e('0xf')](_0x4c661f));if(_0x4c661f[_0x361e('0x10')]){if(_0x4c661f[_0x361e('0x10')][_0x361e('0x11')]===0x1f4){logger[_0x361e('0x10')](_0x361e('0xc'),_0x3390a0,_0x4c661f[_0x361e('0x10')]['message']);return _0x14f9b6(_0x4c661f['error'][_0x361e('0x12')]);}logger['error'](_0x361e('0xc'),_0x3390a0,_0x4c661f[_0x361e('0x10')][_0x361e('0x12')]);return _0x4d4478(_0x4c661f['error'][_0x361e('0x12')]);}else{logger['info'](_0x361e('0xc'),_0x3390a0,_0x361e('0xd'));_0x4d4478(_0x4c661f[_0x361e('0x13')][_0x361e('0x12')]);}})[_0x361e('0x14')](function(_0x1a3e7b){logger[_0x361e('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x3390a0,_0x1a3e7b);_0x14f9b6(_0x1a3e7b);});});}exports[_0x361e('0x15')]=function(_0x4fa90a){var _0x10d433=this;return new Promise(function(_0x36b79c,_0x32dc15){return db[_0x361e('0x16')][_0x361e('0x17')](_0x4fa90a['body'],{'raw':_0x4fa90a['options']?_0x4fa90a[_0x361e('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x361e('0x19')](function(_0x5b26a9){logger['info'](_0x361e('0x15'),_0x4fa90a);logger[_0x361e('0xe')](_0x361e('0x15'),_0x4fa90a,JSON['stringify'](_0x5b26a9));_0x36b79c(_0x5b26a9);})[_0x361e('0x14')](function(_0x43dc4e){logger['error']('CreateReportAgentPreview',_0x43dc4e['message'],_0x4fa90a);_0x32dc15(_0x10d433[_0x361e('0x10')](0x1f4,_0x43dc4e[_0x361e('0x12')]));});});}; \ No newline at end of file +var _0x5b9a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','stringify','util','moment','randomstring'];(function(_0x30c549,_0x4647c7){var _0x52bb01=function(_0x4e0586){while(--_0x4e0586){_0x30c549['push'](_0x30c549['shift']());}};_0x52bb01(++_0x4647c7);}(_0x5b9a,0x71));var _0xa5b9=function(_0x1ce519,_0x2397ac){_0x1ce519=_0x1ce519-0x0;var _0x4a86ad=_0x5b9a[_0x1ce519];return _0x4a86ad;};'use strict';var _=require('lodash');var util=require(_0xa5b9('0x0'));var moment=require(_0xa5b9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5b9('0x2'));var fs=require('fs');var Redis=require(_0xa5b9('0x3'));var db=require(_0xa5b9('0x4'))['db'];var utils=require(_0xa5b9('0x5'));var logger=require(_0xa5b9('0x6'))(_0xa5b9('0x7'));var config=require('../../config/environment');var jayson=require(_0xa5b9('0x8'));var client=jayson['client'][_0xa5b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cd2a9,_0x18b4e8,_0xfa9814){return new BPromise(function(_0x249280,_0x4b2acb){return client[_0xa5b9('0xa')](_0x4cd2a9,_0xfa9814)[_0xa5b9('0xb')](function(_0x2a59c9){logger[_0xa5b9('0xc')](_0xa5b9('0xd'),_0x18b4e8,'request\x20sent');logger[_0xa5b9('0xe')](_0xa5b9('0xf'),_0x18b4e8,_0xa5b9('0x10'),JSON['stringify'](_0x2a59c9));if(_0x2a59c9[_0xa5b9('0x11')]){if(_0x2a59c9[_0xa5b9('0x11')][_0xa5b9('0x12')]===0x1f4){logger['error'](_0xa5b9('0xd'),_0x18b4e8,_0x2a59c9[_0xa5b9('0x11')][_0xa5b9('0x13')]);return _0x4b2acb(_0x2a59c9[_0xa5b9('0x11')][_0xa5b9('0x13')]);}logger[_0xa5b9('0x11')](_0xa5b9('0xd'),_0x18b4e8,_0x2a59c9[_0xa5b9('0x11')]['message']);return _0x249280(_0x2a59c9['error'][_0xa5b9('0x13')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x18b4e8,_0xa5b9('0x10'));_0x249280(_0x2a59c9[_0xa5b9('0x14')][_0xa5b9('0x13')]);}})[_0xa5b9('0x15')](function(_0x4d79f4){logger[_0xa5b9('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x18b4e8,_0x4d79f4);_0x4b2acb(_0x4d79f4);});});}exports['CreateReportAgentPreview']=function(_0x5804c5){var _0x3613aa=this;return new Promise(function(_0x8683a5,_0x57c4ef){return db[_0xa5b9('0x16')][_0xa5b9('0x17')](_0x5804c5[_0xa5b9('0x18')],{'raw':_0x5804c5[_0xa5b9('0x19')]?_0x5804c5[_0xa5b9('0x19')][_0xa5b9('0x1a')]===undefined?!![]:![]:!![]})[_0xa5b9('0xb')](function(_0x15691e){logger[_0xa5b9('0xc')](_0xa5b9('0x1b'),_0x5804c5);logger[_0xa5b9('0xe')]('CreateReportAgentPreview',_0x5804c5,JSON[_0xa5b9('0x1c')](_0x15691e));_0x8683a5(_0x15691e);})[_0xa5b9('0x15')](function(_0x615fbd){logger[_0xa5b9('0x11')](_0xa5b9('0x1b'),_0x615fbd['message'],_0x5804c5);_0x57c4ef(_0x3613aa[_0xa5b9('0x11')](0x1f4,_0x615fbd['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index de747f0..f4e2963 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 _0x7325=['/chat/queues/:id/notify','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','agentNotify','exports','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','put','/agents/:id/capacity','/telephones','telephones','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0x7325,0x1ec));var _0x5732=function(_0x3aeebd,_0x372a76){_0x3aeebd=_0x3aeebd-0x0;var _0x546130=_0x7325[_0x3aeebd];return _0x546130;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5732('0x0'));var express=require('express');var router=express[_0x5732('0x1')]();var auth=require(_0x5732('0x2'));var controller=require(_0x5732('0x3'));router[_0x5732('0x4')](_0x5732('0x5'),auth[_0x5732('0x6')](),controller[_0x5732('0x7')]);router[_0x5732('0x4')](_0x5732('0x8'),auth[_0x5732('0x6')](),controller[_0x5732('0x9')]);router[_0x5732('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x5732('0xa')]);router[_0x5732('0x4')]('/voice/queues',auth[_0x5732('0x6')](),controller[_0x5732('0xb')]);router[_0x5732('0x4')](_0x5732('0xc'),auth[_0x5732('0x6')](),controller[_0x5732('0xd')]);router[_0x5732('0x4')](_0x5732('0xe'),auth[_0x5732('0x6')](),controller[_0x5732('0xf')]);router['get'](_0x5732('0x10'),auth[_0x5732('0x6')](),controller[_0x5732('0x11')]);router['get'](_0x5732('0x12'),auth[_0x5732('0x6')](),controller[_0x5732('0x13')]);router[_0x5732('0x4')]('/sms/queues',auth['isAuthenticated'](),controller[_0x5732('0x14')]);router[_0x5732('0x4')](_0x5732('0x15'),auth[_0x5732('0x6')](),controller[_0x5732('0x16')]);router[_0x5732('0x4')]('/fax/queues',auth['isAuthenticated'](),controller[_0x5732('0x17')]);router[_0x5732('0x4')](_0x5732('0x18'),auth[_0x5732('0x6')](),controller[_0x5732('0x19')]);router['get']('/voice/queues/channels',auth[_0x5732('0x6')](),controller[_0x5732('0x1a')]);router[_0x5732('0x4')]('/voice/queues/channels/:uniqueid',auth[_0x5732('0x6')](),controller['voiceQueuesChannel']);router[_0x5732('0x4')](_0x5732('0x1b'),auth['isAuthenticated'](),controller[_0x5732('0x1c')]);router[_0x5732('0x4')](_0x5732('0x1d'),auth[_0x5732('0x6')](),controller[_0x5732('0x1e')]);router[_0x5732('0x4')](_0x5732('0x1f'),auth[_0x5732('0x6')](),controller[_0x5732('0x20')]);router['put'](_0x5732('0x1f'),auth['isAuthenticated'](),controller[_0x5732('0x21')]);router[_0x5732('0x4')](_0x5732('0x22'),auth[_0x5732('0x6')](),controller[_0x5732('0x23')]);router['get'](_0x5732('0x24'),auth[_0x5732('0x6')](),controller['outboundChannels']);router[_0x5732('0x4')](_0x5732('0x25'),auth[_0x5732('0x6')](),controller['agents']);router[_0x5732('0x26')](_0x5732('0x27'),auth['isAuthenticated'](),controller['agentCapacity']);router['get'](_0x5732('0x28'),auth[_0x5732('0x6')](),controller[_0x5732('0x29')]);router[_0x5732('0x4')]('/trunks',auth[_0x5732('0x6')](),controller['trunks']);router['get'](_0x5732('0x2a'),auth[_0x5732('0x6')](),controller[_0x5732('0x2b')]);router[_0x5732('0x4')](_0x5732('0x2c'),auth[_0x5732('0x6')](),controller[_0x5732('0x2d')]);router[_0x5732('0x4')](_0x5732('0x2e'),auth[_0x5732('0x6')](),controller[_0x5732('0x2f')]);router[_0x5732('0x4')](_0x5732('0x30'),auth[_0x5732('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x5732('0x4')](_0x5732('0x31'),auth[_0x5732('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x5732('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x5732('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5732('0x4')](_0x5732('0x32'),auth[_0x5732('0x6')](),controller[_0x5732('0x33')]);router['get'](_0x5732('0x34'),auth[_0x5732('0x6')](),controller[_0x5732('0x35')]);router[_0x5732('0x4')](_0x5732('0x36'),auth['isAuthenticated'](),controller[_0x5732('0x37')]);router[_0x5732('0x38')](_0x5732('0x39'),auth[_0x5732('0x6')](),controller['queueNotify'](_0x5732('0x3a')));router[_0x5732('0x4')](_0x5732('0x3b'),auth['isAuthenticated'](),controller[_0x5732('0x3c')]);router[_0x5732('0x38')](_0x5732('0x3d'),auth[_0x5732('0x6')](),controller[_0x5732('0x3e')](_0x5732('0x3f')));router[_0x5732('0x4')]('/chat/queues/:id',auth[_0x5732('0x6')](),controller[_0x5732('0x40')]);router[_0x5732('0x38')](_0x5732('0x41'),auth[_0x5732('0x6')](),controller[_0x5732('0x3e')](_0x5732('0x42')));router[_0x5732('0x4')]('/fax/queues/:id',auth[_0x5732('0x6')](),controller[_0x5732('0x43')]);router['post'](_0x5732('0x44'),auth[_0x5732('0x6')](),controller['queueNotify'](_0x5732('0x45')));router[_0x5732('0x4')]('/openchannel/queues/:id',auth[_0x5732('0x6')](),controller[_0x5732('0x46')]);router[_0x5732('0x38')](_0x5732('0x47'),auth['isAuthenticated'](),controller['queueNotify'](_0x5732('0x48')));router[_0x5732('0x38')](_0x5732('0x49'),auth[_0x5732('0x6')](),controller[_0x5732('0x3e')](_0x5732('0x4a')));router['get'](_0x5732('0x4b'),auth[_0x5732('0x6')](),controller['showSmsQueues']);router['get'](_0x5732('0x4c'),auth[_0x5732('0x6')](),controller['showWhatsappQueues']);router['post']('/agents/:id/notify',auth[_0x5732('0x6')](),controller[_0x5732('0x4d')]);module[_0x5732('0x4e')]=router; \ No newline at end of file +var _0x1671=['/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','agentCapacity','telephones','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','post','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts'];(function(_0x21388c,_0x1fead9){var _0x4296b8=function(_0x282a2e){while(--_0x282a2e){_0x21388c['push'](_0x21388c['shift']());}};_0x4296b8(++_0x1fead9);}(_0x1671,0xda));var _0x1167=function(_0x54dc39,_0x587cd8){_0x54dc39=_0x54dc39-0x0;var _0xfab5e8=_0x1671[_0x54dc39];return _0xfab5e8;};'use strict';var multer=require(_0x1167('0x0'));var util=require(_0x1167('0x1'));var path=require(_0x1167('0x2'));var express=require(_0x1167('0x3'));var router=express[_0x1167('0x4')]();var auth=require(_0x1167('0x5'));var controller=require(_0x1167('0x6'));router[_0x1167('0x7')](_0x1167('0x8'),auth['isAuthenticated'](),controller[_0x1167('0x9')]);router[_0x1167('0x7')](_0x1167('0xa'),auth[_0x1167('0xb')](),controller[_0x1167('0xc')]);router[_0x1167('0x7')](_0x1167('0xd'),auth['isAuthenticated'](),controller[_0x1167('0xe')]);router[_0x1167('0x7')](_0x1167('0xf'),auth[_0x1167('0xb')](),controller[_0x1167('0x10')]);router['get'](_0x1167('0x11'),auth[_0x1167('0xb')](),controller[_0x1167('0x12')]);router['get']('/mail/queues',auth[_0x1167('0xb')](),controller[_0x1167('0x13')]);router[_0x1167('0x7')](_0x1167('0x14'),auth['isAuthenticated'](),controller[_0x1167('0x15')]);router[_0x1167('0x7')](_0x1167('0x16'),auth[_0x1167('0xb')](),controller[_0x1167('0x17')]);router['get']('/sms/queues',auth['isAuthenticated'](),controller[_0x1167('0x18')]);router[_0x1167('0x7')](_0x1167('0x19'),auth[_0x1167('0xb')](),controller['whatsappQueues']);router[_0x1167('0x7')](_0x1167('0x1a'),auth[_0x1167('0xb')](),controller['faxQueues']);router[_0x1167('0x7')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x1167('0x1b')]);router[_0x1167('0x7')](_0x1167('0x1c'),auth[_0x1167('0xb')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0x1167('0xb')](),controller['voiceQueuesChannel']);router['get'](_0x1167('0x1d'),auth['isAuthenticated'](),controller[_0x1167('0x1e')]);router[_0x1167('0x7')](_0x1167('0x1f'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x1167('0x7')](_0x1167('0x20'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x1167('0x21')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x1167('0x22')]);router[_0x1167('0x7')](_0x1167('0x23'),auth[_0x1167('0xb')](),controller['outbound']);router[_0x1167('0x7')](_0x1167('0x24'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0x1167('0x7')](_0x1167('0x25'),auth['isAuthenticated'](),controller['agents']);router[_0x1167('0x21')]('/agents/:id/capacity',auth[_0x1167('0xb')](),controller[_0x1167('0x26')]);router[_0x1167('0x7')]('/telephones',auth[_0x1167('0xb')](),controller[_0x1167('0x27')]);router[_0x1167('0x7')]('/trunks',auth[_0x1167('0xb')](),controller[_0x1167('0x28')]);router[_0x1167('0x7')](_0x1167('0x29'),auth['isAuthenticated'](),controller['campaigns']);router['get'](_0x1167('0x2a'),auth[_0x1167('0xb')](),controller[_0x1167('0x2b')]);router['get'](_0x1167('0x2c'),auth[_0x1167('0xb')](),controller[_0x1167('0x2d')]);router['get'](_0x1167('0x2e'),auth[_0x1167('0xb')](),controller['mailQueuesWaitingInteractions']);router[_0x1167('0x7')](_0x1167('0x2f'),auth[_0x1167('0xb')](),controller[_0x1167('0x30')]);router[_0x1167('0x7')](_0x1167('0x31'),auth[_0x1167('0xb')](),controller[_0x1167('0x32')]);router[_0x1167('0x7')](_0x1167('0x33'),auth[_0x1167('0xb')](),controller[_0x1167('0x34')]);router[_0x1167('0x7')](_0x1167('0x35'),auth[_0x1167('0xb')](),controller[_0x1167('0x36')]);router['get']('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x1167('0x37')]);router['post'](_0x1167('0x38'),auth[_0x1167('0xb')](),controller[_0x1167('0x39')](_0x1167('0x3a')));router[_0x1167('0x7')](_0x1167('0x3b'),auth[_0x1167('0xb')](),controller['showMailQueues']);router[_0x1167('0x3c')]('/chat/queues/:id/notify',auth[_0x1167('0xb')](),controller[_0x1167('0x39')](_0x1167('0x3d')));router['get'](_0x1167('0x3e'),auth[_0x1167('0xb')](),controller[_0x1167('0x3f')]);router[_0x1167('0x3c')](_0x1167('0x40'),auth[_0x1167('0xb')](),controller[_0x1167('0x39')](_0x1167('0x41')));router[_0x1167('0x7')](_0x1167('0x42'),auth['isAuthenticated'](),controller[_0x1167('0x43')]);router[_0x1167('0x3c')]('/openchannel/queues/:id/notify',auth[_0x1167('0xb')](),controller[_0x1167('0x39')](_0x1167('0x44')));router[_0x1167('0x7')](_0x1167('0x45'),auth[_0x1167('0xb')](),controller['showOpenchannelQueues']);router['post'](_0x1167('0x46'),auth[_0x1167('0xb')](),controller[_0x1167('0x39')]('sms'));router[_0x1167('0x3c')](_0x1167('0x47'),auth[_0x1167('0xb')](),controller[_0x1167('0x39')](_0x1167('0x48')));router[_0x1167('0x7')](_0x1167('0x49'),auth[_0x1167('0xb')](),controller[_0x1167('0x4a')]);router[_0x1167('0x7')](_0x1167('0x4b'),auth[_0x1167('0xb')](),controller[_0x1167('0x4c')]);router['post'](_0x1167('0x4d'),auth['isAuthenticated'](),controller[_0x1167('0x4e')]);module[_0x1167('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 376b777..586ef3b 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 _0x901c=['params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','filter','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','client','http','request','then','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge'];(function(_0x40c043,_0x1d064e){var _0x5c2c8d=function(_0xab4403){while(--_0xab4403){_0x40c043['push'](_0x40c043['shift']());}};_0x5c2c8d(++_0x1d064e);}(_0x901c,0x1d0));var _0xc901=function(_0x23baf2,_0x401058){_0x23baf2=_0x23baf2-0x0;var _0x2e0001=_0x901c[_0x23baf2];return _0x2e0001;};'use strict';var BPromise=require(_0xc901('0x0'));var moment=require(_0xc901('0x1'));var _=require(_0xc901('0x2'));var util=require(_0xc901('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xc901('0x4'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0xc901('0x5')][_0xc901('0x6')]({'port':0x232a});var mailClient=jayson[_0xc901('0x5')][_0xc901('0x6')]({'port':0x232b});var routingClient=jayson[_0xc901('0x5')][_0xc901('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x529e3d,_0x30b86a,_0x4448d0){return new BPromise(function(_0xc9971f,_0xafe756){var _0x3964ff=_0x4448d0?_0x4448d0:amiClient;return _0x3964ff[_0xc901('0x7')](_0x529e3d,_0x30b86a)[_0xc901('0x8')](function(_0x41abac){if(_0x41abac[_0xc901('0x9')]){if(_0x41abac['error']['code']===0x1f4){return _0xafe756(_0x41abac['error']['message']);}return _0xc9971f(_0x41abac[_0xc901('0x9')][_0xc901('0xa')]);}else{_0xc9971f(_0x41abac[_0xc901('0xb')]);}})[_0xc901('0xc')](function(_0x370425){_0xafe756(_0x370425);});});}function respondWithResult(_0x212b87,_0x10ee6a){_0x10ee6a=_0x10ee6a||0xc8;return function(_0x3bf0a8){if(_0x3bf0a8){return _0x212b87[_0xc901('0xd')](_0x10ee6a)[_0xc901('0xe')](_0x3bf0a8);}return _0x212b87[_0xc901('0xf')](0x194);};}function handleError(_0x52d121,_0x1838f0){_0x1838f0=_0x1838f0||0x1f4;return function(_0x41dbc3){logger[_0xc901('0x9')](_0x41dbc3[_0xc901('0x10')]);if(_0x41dbc3[_0xc901('0x11')]){delete _0x41dbc3[_0xc901('0x11')];}_0x52d121[_0xc901('0xd')](_0x1838f0)[_0xc901('0x12')](_0x41dbc3);};}function findById(_0x4292e2){return function(_0x5e739f){if(!_['isNil'](_0x4292e2)&&!_[_0xc901('0x13')](_0x5e739f)&&!_['isNil'](_0x5e739f['rows'])){return _[_0xc901('0x14')](_0x5e739f[_0xc901('0x15')],function(_0x3d54a2){return _0x3d54a2['id']==_0x4292e2;});}return null;};}exports[_0xc901('0x16')]=function(_0x2fdaa8,_0x2c2fda){return respondWithRpcPromise(_0xc901('0x17'),_0x2fdaa8[_0xc901('0x18')])['then'](respondWithResult(_0x2c2fda,null))['catch'](handleError(_0x2c2fda,null));};exports[_0xc901('0x19')]=function(_0xc51afb,_0x3382fa){return respondWithRpcPromise(_0xc901('0x1a'),_[_0xc901('0x1b')](_0xc51afb[_0xc901('0x18')],_0xc51afb[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x3382fa,null))[_0xc901('0xc')](handleError(_0x3382fa,null));};exports['voiceChannelStopMixMonitor']=function(_0x54cc21,_0x2598b1){return respondWithRpcPromise(_0xc901('0x1d'),_[_0xc901('0x1b')](_0x54cc21[_0xc901('0x18')],_0x54cc21[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x2598b1,null))[_0xc901('0xc')](handleError(_0x2598b1,null));};exports[_0xc901('0x1e')]=function(_0x24f193,_0x37cd72){return respondWithRpcPromise('VoiceQueues',_0x24f193[_0xc901('0x18')])[_0xc901('0x8')](respondWithResult(_0x37cd72,null))['catch'](handleError(_0x37cd72,null));};exports['showVoiceQueues']=function(_0x5b2074,_0x42472b){return respondWithRpcPromise(_0xc901('0x1f'),_0x5b2074[_0xc901('0x18')])[_0xc901('0x8')](findById(_0x5b2074['params']['id']))['then'](respondWithResult(_0x42472b,null))[_0xc901('0xc')](handleError(_0x42472b,null));};exports['updateVoiceQueue']=function(_0x3250e2,_0x5944ef){return respondWithRpcPromise(_0xc901('0x20'),_[_0xc901('0x1b')](_0x3250e2['body'],_0x3250e2[_0xc901('0x1c')]))['then'](respondWithResult(_0x5944ef,null))[_0xc901('0xc')](handleError(_0x5944ef,null));};exports[_0xc901('0x21')]=function(_0xae9cc7,_0x426ebf){return respondWithRpcPromise(_0xc901('0x22'),_[_0xc901('0x1b')](_0xae9cc7[_0xc901('0x18')],_0xae9cc7[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x426ebf,null))['catch'](handleError(_0x426ebf,null));};exports[_0xc901('0x23')]=function(_0x564b5e,_0x230010){return respondWithRpcPromise('VoiceQueuesChannels',_0x564b5e[_0xc901('0x18')])['then'](respondWithResult(_0x230010,null))[_0xc901('0xc')](handleError(_0x230010,null));};exports[_0xc901('0x24')]=function(_0x2e2880,_0x5e8313){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xc901('0x1b')](_0x2e2880[_0xc901('0x18')],_0x2e2880['params']))[_0xc901('0x8')](respondWithResult(_0x5e8313,null))[_0xc901('0xc')](handleError(_0x5e8313,null));};exports['voiceQueuesChannelHangup']=function(_0x8e516f,_0x14e08e){return respondWithRpcPromise(_0xc901('0x25'),_[_0xc901('0x1b')](_0x8e516f[_0xc901('0x18')],_0x8e516f[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x14e08e,null))[_0xc901('0xc')](handleError(_0x14e08e,null));};exports[_0xc901('0x26')]=function(_0xeb2b68,_0x1bbf77){return respondWithRpcPromise(_0xc901('0x27'),_['merge'](_0xeb2b68[_0xc901('0x18')],_0xeb2b68[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x1bbf77,null))[_0xc901('0xc')](handleError(_0x1bbf77,null));};exports[_0xc901('0x28')]=function(_0x104dd1,_0x13a178){return respondWithRpcPromise(_0xc901('0x29'),_0x104dd1['query'])[_0xc901('0x8')](respondWithResult(_0x13a178,null))[_0xc901('0xc')](handleError(_0x13a178,null));};exports['outboundChannels']=function(_0x5c5997,_0xa3604e){return respondWithRpcPromise(_0xc901('0x2a'),_0x5c5997[_0xc901('0x18')])[_0xc901('0x8')](respondWithResult(_0xa3604e,null))['catch'](handleError(_0xa3604e,null));};exports['agents']=function(_0x429e64,_0x1a7085){var _0x39203a;return respondWithRpcPromise(_0xc901('0x2b'),_0x429e64['query'])[_0xc901('0x8')](function(_0x36cbcb){_0x39203a=_0x36cbcb;return respondWithRpcPromise(_0xc901('0x2b'),_0x429e64[_0xc901('0x18')],routingClient);})[_0xc901('0x8')](function(_0x3e7100){return _['merge']({},_0x3e7100,_0x39203a);})[_0xc901('0x8')](respondWithResult(_0x1a7085,null))[_0xc901('0xc')](handleError(_0x1a7085,null));};exports[_0xc901('0x2c')]=function(_0x5a811d,_0x122620){if(_0x5a811d[_0xc901('0x2d')]&&_0x5a811d['body'][_0xc901('0x2e')]&&_0x5a811d[_0xc901('0x2f')]&&_0x5a811d['user'][_0xc901('0x11')]){for(var _0x410349 in _0x5a811d[_0xc901('0x2d')][_0xc901('0x2e')]){if(_0x5a811d[_0xc901('0x2d')]['interaction'][_0xc901('0x30')](_0x410349)){db[_0xc901('0x31')]['findAll']({'where':{'channel':_0x410349,'membername':_0x5a811d[_0xc901('0x2f')]['name'],'type':_0xc901('0x32'),'exitAt':null,'uniqueid':_0x5a811d[_0xc901('0x2d')][_0xc901('0x2e')][_0x410349]&&_0x5a811d[_0xc901('0x2d')]['interaction'][_0x410349]['length']?{'$notIn':_0x5a811d['body'][_0xc901('0x2e')][_0x410349]}:{'$ne':null}}})['then'](function(_0x2171a0){var _0x221e7f=moment()[_0xc901('0x33')](_0xc901('0x34'));for(var _0x4c9aa8=0x0,_0xe5fba6=_0x2171a0[_0xc901('0x35')];_0x4c9aa8<_0xe5fba6;_0x4c9aa8+=0x1){_0x2171a0[_0x4c9aa8][_0xc901('0x36')]({'exitAt':_0x221e7f});}});for(var _0x2303e8=0x0;_0x2303e8<_0x5a811d[_0xc901('0x2d')][_0xc901('0x2e')][_0x410349][_0xc901('0x35')];_0x2303e8+=0x1){db[_0xc901('0x31')]['findOrCreate']({'where':{'channel':_0x410349,'membername':_0x5a811d['user']['name'],'type':'INTERACTION','uniqueid':_0x5a811d[_0xc901('0x2d')]['interaction'][_0x410349][_0x2303e8],'exitAt':null},'defaults':{'channel':_0x410349,'membername':_0x5a811d[_0xc901('0x2f')][_0xc901('0x11')],'interface':_['isNil'](_0x5a811d['user'][_0xc901('0x37')])?util[_0xc901('0x33')](_0xc901('0x38'),_0x5a811d[_0xc901('0x2f')][_0xc901('0x11')]):_0x5a811d[_0xc901('0x2f')][_0xc901('0x37')],'type':'INTERACTION','enterAt':moment()[_0xc901('0x33')](_0xc901('0x34')),'role':_0xc901('0x39'),'internal':_0x5a811d[_0xc901('0x2f')][_0xc901('0x3a')],'uniqueid':_0x5a811d[_0xc901('0x2d')]['interaction'][_0x410349][_0x2303e8]}});}}}}return respondWithRpcPromise(_0xc901('0x3b'),{'id':_0x5a811d[_0xc901('0x1c')]['id'],'capacity':_0x5a811d['body'][_0xc901('0x3c')]},routingClient)[_0xc901('0x8')](respondWithResult(_0x122620,null))[_0xc901('0xc')](handleError(_0x122620,null));};exports[_0xc901('0x3d')]=function(_0x2fc20d,_0x959471){return respondWithRpcPromise(_0xc901('0x3e'),_0x2fc20d['query'])[_0xc901('0x8')](respondWithResult(_0x959471,null))[_0xc901('0xc')](handleError(_0x959471,null));};exports[_0xc901('0x3f')]=function(_0x1f7304,_0xc74169){return respondWithRpcPromise(_0xc901('0x40'),_0x1f7304[_0xc901('0x18')])['then'](respondWithResult(_0xc74169,null))[_0xc901('0xc')](handleError(_0xc74169,null));};exports['campaigns']=function(_0x45c70a,_0x256f92){return respondWithRpcPromise('Campaigns',_0x45c70a['query'])[_0xc901('0x8')](respondWithResult(_0x256f92,null))['catch'](handleError(_0x256f92,null));};exports[_0xc901('0x41')]=function(_0x36b318,_0x4289e0){return respondWithRpcPromise(_0xc901('0x42'),_0x36b318[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x4289e0,null))[_0xc901('0xc')](handleError(_0x4289e0,null));};exports[_0xc901('0x43')]=function(_0x222230,_0x4a896d){return respondWithRpcPromise(_0xc901('0x42'),_0x222230[_0xc901('0x18')],routingClient)['then'](findById(_0x222230[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x4a896d,null))[_0xc901('0xc')](handleError(_0x4a896d,null));};exports['mailQueues']=function(_0x460a6b,_0x469cf8){return respondWithRpcPromise(_0xc901('0x44'),_0x460a6b['query'],routingClient)[_0xc901('0x8')](respondWithResult(_0x469cf8,null))['catch'](handleError(_0x469cf8,null));};exports[_0xc901('0x45')]=function(_0x248f16,_0x34b07f){return respondWithRpcPromise(_0xc901('0x44'),_0x248f16[_0xc901('0x18')],routingClient)['then'](findById(_0x248f16['params']['id']))[_0xc901('0x8')](respondWithResult(_0x34b07f,null))['catch'](handleError(_0x34b07f,null));};exports[_0xc901('0x46')]=function(_0x2cdc72,_0x48a421){return respondWithRpcPromise(_0xc901('0x47'),_0x2cdc72[_0xc901('0x18')],mailClient)[_0xc901('0x8')](respondWithResult(_0x48a421,null))[_0xc901('0xc')](handleError(_0x48a421,null));};exports['openchannelQueues']=function(_0x5c5625,_0x1a6292){return respondWithRpcPromise(_0xc901('0x48'),_0x5c5625[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x1a6292,null))[_0xc901('0xc')](handleError(_0x1a6292,null));};exports[_0xc901('0x49')]=function(_0xbc1a1,_0x4bdd2f){return respondWithRpcPromise('OpenchannelQueues',_0xbc1a1['query'],routingClient)[_0xc901('0x8')](findById(_0xbc1a1[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x4bdd2f,null))[_0xc901('0xc')](handleError(_0x4bdd2f,null));};exports[_0xc901('0x4a')]=function(_0xed89ed,_0x5b4a75){return respondWithRpcPromise(_0xc901('0x4b'),_0xed89ed[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x5b4a75,null))[_0xc901('0xc')](handleError(_0x5b4a75,null));};exports['showSmsQueues']=function(_0x26d757,_0x4ef0e8){return respondWithRpcPromise(_0xc901('0x4b'),_0x26d757[_0xc901('0x18')],routingClient)[_0xc901('0x8')](findById(_0x26d757['params']['id']))[_0xc901('0x8')](respondWithResult(_0x4ef0e8,null))[_0xc901('0xc')](handleError(_0x4ef0e8,null));};exports[_0xc901('0x4c')]=function(_0x1e60a1,_0x368963){return respondWithRpcPromise(_0xc901('0x4d'),_0x1e60a1[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x368963,null))[_0xc901('0xc')](handleError(_0x368963,null));};exports[_0xc901('0x4e')]=function(_0x172c3c,_0x321d7d){return respondWithRpcPromise(_0xc901('0x4d'),_0x172c3c[_0xc901('0x18')],routingClient)['then'](findById(_0x172c3c[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x321d7d,null))[_0xc901('0xc')](handleError(_0x321d7d,null));};exports[_0xc901('0x4f')]=function(_0x160984,_0xdb1cb4){return respondWithRpcPromise(_0xc901('0x50'),_0x160984['query'],routingClient)['then'](respondWithResult(_0xdb1cb4,null))['catch'](handleError(_0xdb1cb4,null));};exports['showFaxQueues']=function(_0x478dd2,_0x3abf7e){return respondWithRpcPromise(_0xc901('0x50'),_0x478dd2[_0xc901('0x18')],routingClient)[_0xc901('0x8')](findById(_0x478dd2[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x3abf7e,null))['catch'](handleError(_0x3abf7e,null));};exports[_0xc901('0x51')]=function(_0xef7cfd,_0x4d3295){return respondWithRpcPromise(_0xc901('0x52'),_0xef7cfd['query'])[_0xc901('0x8')](respondWithResult(_0x4d3295,null))['catch'](handleError(_0x4d3295,null));};exports['chatQueuesWaitingInteractions']=function(_0x1b967e,_0x57d9da){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x1b967e['query'],routingClient)['then'](respondWithResult(_0x57d9da,null))[_0xc901('0xc')](handleError(_0x57d9da,null));};exports[_0xc901('0x53')]=function(_0x5b2139,_0x5e43fd){return respondWithRpcPromise(_0xc901('0x54'),_0x5b2139['query'],routingClient)[_0xc901('0x8')](respondWithResult(_0x5e43fd,null))[_0xc901('0xc')](handleError(_0x5e43fd,null));};exports[_0xc901('0x55')]=function(_0x4659ca,_0x59fc3b){return respondWithRpcPromise(_0xc901('0x56'),_0x4659ca[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x59fc3b,null))['catch'](handleError(_0x59fc3b,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x20b9b8,_0x23255b){return respondWithRpcPromise(_0xc901('0x56'),_0x20b9b8['query'],routingClient)[_0xc901('0x8')](function(_0x3f269c){if(_0x20b9b8[_0xc901('0x18')][_0xc901('0x57')]!==undefined){var _0x5bc69f=_(_0x3f269c[_0xc901('0x15')])['filter']([_0x20b9b8[_0xc901('0x18')][_0xc901('0x57')],_0x20b9b8[_0xc901('0x1c')]['id']])[_0xc901('0x58')](_0xc901('0x59'))['uniq']()['value']();return _0x3f269c[_0xc901('0x15')][_0xc901('0x5a')](function(_0x42d73d){return _0x5bc69f['indexOf'](_0x42d73d['queue_id'])>-0x1;});}else{return _0x3f269c['rows'][_0xc901('0x5a')](function(_0x29a374){return _0x29a374['queue_id']===parseInt(_0x20b9b8['params']['id']);});}})[_0xc901('0x8')](respondWithResult(_0x23255b,null))['catch'](handleError(_0x23255b,null));};exports['smsQueuesWaitingInteractions']=function(_0x50f85f,_0xd26e9e){return respondWithRpcPromise(_0xc901('0x5b'),_0x50f85f[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0xd26e9e,null))['catch'](handleError(_0xd26e9e,null));};exports[_0xc901('0x5c')]=function(_0x14c2f1,_0x11f144){return respondWithRpcPromise(_0xc901('0x5d'),_0x14c2f1[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x11f144,null))[_0xc901('0xc')](handleError(_0x11f144,null));};exports[_0xc901('0x5e')]=function(_0x14fbda,_0x117373){return respondWithRpcPromise(_0xc901('0x5f'),_0x14fbda[_0xc901('0x18')],routingClient)['then'](respondWithResult(_0x117373,null))['catch'](handleError(_0x117373,null));};exports[_0xc901('0x60')]=function(_0x13a9da){return function(_0x3ee530,_0xdcdbc6){var _0x23f6c9,_0x3dd62b;var _0x3c7479=_[_0xc901('0x61')](_0x13a9da);var _0x37f901=_0x13a9da===_0xc901('0x62')?_0xc901('0x63'):_0xc901('0x64');return db[_0x3c7479+_0xc901('0x65')][_0xc901('0x66')]({'raw':!![],'where':{'id':_0x3ee530[_0xc901('0x1c')]['id']}})['then'](function(_0x55bffa){if(_[_0xc901('0x13')](_0x55bffa)){throw new Error(_0x3c7479+_0xc901('0x67'));}_0x23f6c9=_0x55bffa;return db[_0x3c7479+_0xc901('0x68')][_0xc901('0x66')]({'where':{'id':_0x3ee530[_0xc901('0x2d')][_0xc901('0x69')]},'include':[{'model':db[_0x3c7479+_0xc901('0x6a')],'as':'Interaction'},{'model':db[_0x3c7479+_0x37f901],'as':_0xc901('0x64')}]});})['then'](function(_0x226bfe){if(_[_0xc901('0x13')](_0x226bfe)){throw new Error(_0x3c7479+_0xc901('0x6b'));}_0x3dd62b=_0x226bfe;return _0x226bfe[_0xc901('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x12b020={'uniqueid':_0x13a9da+'.'+_0x3dd62b['id']+'.'+_0x3dd62b[_0xc901('0x6a')]['id'],'FromUserId':_0x3ee530[_0xc901('0x2f')]['id'],'type':_0xc901('0x6d')};_0x12b020[_0x3c7479+_0xc901('0x6e')]=_0x3dd62b['id'];_0x12b020[_0x3c7479+_0xc901('0x6f')]=_0x3dd62b[_0xc901('0x6a')]['id'];_0x12b020[_0xc901('0x70')+_0x3c7479+_0x37f901+'Id']=_0x3dd62b['Account']['id'];_0x12b020['To'+_0x3c7479+_0xc901('0x71')]=_0x23f6c9['id'];return db[_0x3c7479+_0xc901('0x72')]['create'](_0x12b020);})[_0xc901('0x8')](function(){return respondWithRpcPromise(_0xc901('0x73'),{'channel':_0x13a9da,'interaction':_0x3dd62b[_0xc901('0x6a')],'message':_0x3dd62b,'account':_0x3dd62b[_0xc901('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x23f6c9[_0xc901('0x11')]+','+(_0x3dd62b['Account'][_0xc901('0x74')]||0x12c),'interval':_0xc901('0x75')}]},routingClient);})[_0xc901('0x8')](respondWithResult(_0xdcdbc6,null))[_0xc901('0xc')](handleError(_0xdcdbc6,null));};};exports['agentNotify']=function(_0xb89ce2,_0x37a6b4){var _0x31b654,_0x5863a3;if(_[_0xc901('0x13')](_0xb89ce2[_0xc901('0x2d')][_0xc901('0x76')])){throw new Error(_0xc901('0x77'));}var _0x34717a=_0xb89ce2[_0xc901('0x2d')][_0xc901('0x76')];var _0x29f051=_['capitalize'](_0x34717a);var _0x548d36=_0x34717a==='chat'?_0xc901('0x63'):_0xc901('0x64');return db[_0xc901('0x78')][_0xc901('0x66')]({'raw':!![],'where':{'id':_0xb89ce2[_0xc901('0x1c')]['id'],'role':_0xc901('0x39')}})[_0xc901('0x8')](function(_0x21a5c5){if(_['isNil'](_0x21a5c5)){throw new Error('Agent\x20not\x20found');}_0x31b654=_0x21a5c5;return db[_0x29f051+_0xc901('0x68')][_0xc901('0x66')]({'where':{'id':_0xb89ce2[_0xc901('0x2d')][_0xc901('0x69')]},'include':[{'model':db[_0x29f051+_0xc901('0x6a')],'as':_0xc901('0x6a')},{'model':db[_0x29f051+_0x548d36],'as':_0xc901('0x64')}]});})[_0xc901('0x8')](function(_0x392360){if(_[_0xc901('0x13')](_0x392360)){throw new Error(_0x29f051+_0xc901('0x6b'));}_0x5863a3=_0x392360;return _0x392360[_0xc901('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xc901('0x8')](function(){var _0x3ea553={'uniqueid':_0x34717a+'.'+_0x5863a3['id']+'.'+_0x5863a3[_0xc901('0x6a')]['id'],'FromUserId':_0xb89ce2[_0xc901('0x2f')]['id'],'type':'agent','ToUserId':_0x31b654['id']};_0x3ea553[_0x29f051+_0xc901('0x6e')]=_0x5863a3['id'];_0x3ea553[_0x29f051+_0xc901('0x6f')]=_0x5863a3[_0xc901('0x6a')]['id'];_0x3ea553['From'+_0x29f051+_0x548d36+'Id']=_0x5863a3[_0xc901('0x64')]['id'];return db[_0x29f051+_0xc901('0x72')][_0xc901('0x79')](_0x3ea553);})[_0xc901('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x34717a,'interaction':_0x5863a3[_0xc901('0x6a')],'message':_0x5863a3,'account':_0x5863a3[_0xc901('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x31b654['name']+','+(_0x5863a3['Account'][_0xc901('0x7a')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xc901('0x8')](respondWithResult(_0x37a6b4,null))[_0xc901('0xc')](handleError(_0x37a6b4,null));}; \ No newline at end of file +var _0x3b75=['From','QueueId','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','agent','Agent\x20not\x20found','findOne','messageId','TransferReport','agentTransferTimeout','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','error','code','message','catch','status','json','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','then','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','merge','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','interface','format','SIP/%s','AgentCapacity','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showWhatsappQueues','WhatsappQueues','faxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','value','filter','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId'];(function(_0x1feb65,_0x59d59b){var _0xb2dbb3=function(_0x13c353){while(--_0x13c353){_0x1feb65['push'](_0x1feb65['shift']());}};_0xb2dbb3(++_0x59d59b);}(_0x3b75,0x103));var _0x53b7=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x3b75[_0x3bab09];return _0x164376;};'use strict';var BPromise=require('bluebird');var moment=require(_0x53b7('0x0'));var _=require(_0x53b7('0x1'));var util=require(_0x53b7('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x53b7('0x3'))(_0x53b7('0x4'));var jayson=require(_0x53b7('0x5'));var amiClient=jayson[_0x53b7('0x6')][_0x53b7('0x7')]({'port':0x232a});var mailClient=jayson[_0x53b7('0x6')][_0x53b7('0x7')]({'port':0x232b});var routingClient=jayson[_0x53b7('0x6')][_0x53b7('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x217f69,_0x1c31c5,_0x31530c){return new BPromise(function(_0x43ba59,_0xfedeb){var _0x39b161=_0x31530c?_0x31530c:amiClient;return _0x39b161[_0x53b7('0x8')](_0x217f69,_0x1c31c5)['then'](function(_0x22b0dd){if(_0x22b0dd[_0x53b7('0x9')]){if(_0x22b0dd[_0x53b7('0x9')][_0x53b7('0xa')]===0x1f4){return _0xfedeb(_0x22b0dd[_0x53b7('0x9')][_0x53b7('0xb')]);}return _0x43ba59(_0x22b0dd['error'][_0x53b7('0xb')]);}else{_0x43ba59(_0x22b0dd['result']);}})[_0x53b7('0xc')](function(_0x23af95){_0xfedeb(_0x23af95);});});}function respondWithResult(_0x157f4e,_0x303c10){_0x303c10=_0x303c10||0xc8;return function(_0xc63d03){if(_0xc63d03){return _0x157f4e[_0x53b7('0xd')](_0x303c10)[_0x53b7('0xe')](_0xc63d03);}return _0x157f4e['sendStatus'](0x194);};}function handleError(_0x2f8ee5,_0x47161e){_0x47161e=_0x47161e||0x1f4;return function(_0x94a6a){logger['error'](_0x94a6a['stack']);if(_0x94a6a[_0x53b7('0xf')]){delete _0x94a6a[_0x53b7('0xf')];}_0x2f8ee5[_0x53b7('0xd')](_0x47161e)[_0x53b7('0x10')](_0x94a6a);};}function findById(_0xe32fbc){return function(_0x1c87a6){if(!_[_0x53b7('0x11')](_0xe32fbc)&&!_[_0x53b7('0x11')](_0x1c87a6)&&!_[_0x53b7('0x11')](_0x1c87a6[_0x53b7('0x12')])){return _[_0x53b7('0x13')](_0x1c87a6[_0x53b7('0x12')],function(_0x182809){return _0x182809['id']==_0xe32fbc;});}return null;};}exports[_0x53b7('0x14')]=function(_0x1a5238,_0x248772){return respondWithRpcPromise(_0x53b7('0x15'),_0x1a5238['query'])['then'](respondWithResult(_0x248772,null))[_0x53b7('0xc')](handleError(_0x248772,null));};exports[_0x53b7('0x16')]=function(_0x340897,_0x408ade){return respondWithRpcPromise(_0x53b7('0x17'),_['merge'](_0x340897[_0x53b7('0x18')],_0x340897[_0x53b7('0x19')]))[_0x53b7('0x1a')](respondWithResult(_0x408ade,null))[_0x53b7('0xc')](handleError(_0x408ade,null));};exports[_0x53b7('0x1b')]=function(_0x247253,_0x12753a){return respondWithRpcPromise(_0x53b7('0x1c'),_['merge'](_0x247253[_0x53b7('0x18')],_0x247253[_0x53b7('0x19')]))['then'](respondWithResult(_0x12753a,null))['catch'](handleError(_0x12753a,null));};exports[_0x53b7('0x1d')]=function(_0x3a3b76,_0x30e443){return respondWithRpcPromise(_0x53b7('0x1e'),_0x3a3b76[_0x53b7('0x18')])[_0x53b7('0x1a')](respondWithResult(_0x30e443,null))[_0x53b7('0xc')](handleError(_0x30e443,null));};exports['showVoiceQueues']=function(_0x24a348,_0x24c19b){return respondWithRpcPromise(_0x53b7('0x1e'),_0x24a348[_0x53b7('0x18')])[_0x53b7('0x1a')](findById(_0x24a348['params']['id']))['then'](respondWithResult(_0x24c19b,null))[_0x53b7('0xc')](handleError(_0x24c19b,null));};exports['updateVoiceQueue']=function(_0x2bfbd2,_0x3d3928){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x53b7('0x1f')](_0x2bfbd2[_0x53b7('0x20')],_0x2bfbd2['params']))[_0x53b7('0x1a')](respondWithResult(_0x3d3928,null))['catch'](handleError(_0x3d3928,null));};exports[_0x53b7('0x21')]=function(_0x5bcc2a,_0x4b05c0){return respondWithRpcPromise(_0x53b7('0x22'),_['merge'](_0x5bcc2a[_0x53b7('0x18')],_0x5bcc2a[_0x53b7('0x19')]))[_0x53b7('0x1a')](respondWithResult(_0x4b05c0,null))[_0x53b7('0xc')](handleError(_0x4b05c0,null));};exports[_0x53b7('0x23')]=function(_0x302fd5,_0x1c3a7d){return respondWithRpcPromise(_0x53b7('0x24'),_0x302fd5[_0x53b7('0x18')])['then'](respondWithResult(_0x1c3a7d,null))[_0x53b7('0xc')](handleError(_0x1c3a7d,null));};exports[_0x53b7('0x25')]=function(_0x8b73db,_0x2fd311){return respondWithRpcPromise(_0x53b7('0x26'),_[_0x53b7('0x1f')](_0x8b73db['query'],_0x8b73db[_0x53b7('0x19')]))[_0x53b7('0x1a')](respondWithResult(_0x2fd311,null))[_0x53b7('0xc')](handleError(_0x2fd311,null));};exports['voiceQueuesChannelHangup']=function(_0x4b495c,_0x3f4aee){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x53b7('0x1f')](_0x4b495c[_0x53b7('0x18')],_0x4b495c[_0x53b7('0x19')]))['then'](respondWithResult(_0x3f4aee,null))[_0x53b7('0xc')](handleError(_0x3f4aee,null));};exports['voiceQueuesChannelRedirect']=function(_0x5978b7,_0x2a4b7f){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x53b7('0x1f')](_0x5978b7[_0x53b7('0x18')],_0x5978b7[_0x53b7('0x19')]))[_0x53b7('0x1a')](respondWithResult(_0x2a4b7f,null))[_0x53b7('0xc')](handleError(_0x2a4b7f,null));};exports['outbound']=function(_0x46e96a,_0x22e216){return respondWithRpcPromise(_0x53b7('0x27'),_0x46e96a[_0x53b7('0x18')])[_0x53b7('0x1a')](respondWithResult(_0x22e216,null))[_0x53b7('0xc')](handleError(_0x22e216,null));};exports[_0x53b7('0x28')]=function(_0x456190,_0x34e78d){return respondWithRpcPromise(_0x53b7('0x29'),_0x456190[_0x53b7('0x18')])[_0x53b7('0x1a')](respondWithResult(_0x34e78d,null))['catch'](handleError(_0x34e78d,null));};exports['agents']=function(_0x1c6094,_0x4e9f30){var _0x21c6ae;return respondWithRpcPromise(_0x53b7('0x2a'),_0x1c6094[_0x53b7('0x18')])[_0x53b7('0x1a')](function(_0x5299bd){_0x21c6ae=_0x5299bd;return respondWithRpcPromise('Agents',_0x1c6094['query'],routingClient);})[_0x53b7('0x1a')](function(_0x5390bc){return _[_0x53b7('0x1f')]({},_0x5390bc,_0x21c6ae);})['then'](respondWithResult(_0x4e9f30,null))[_0x53b7('0xc')](handleError(_0x4e9f30,null));};exports[_0x53b7('0x2b')]=function(_0x888c5c,_0x102f9f){if(_0x888c5c[_0x53b7('0x20')]&&_0x888c5c[_0x53b7('0x20')]['interaction']&&_0x888c5c[_0x53b7('0x2c')]&&_0x888c5c['user'][_0x53b7('0xf')]){for(var _0x233910 in _0x888c5c[_0x53b7('0x20')][_0x53b7('0x2d')]){if(_0x888c5c['body'][_0x53b7('0x2d')][_0x53b7('0x2e')](_0x233910)){db[_0x53b7('0x2f')][_0x53b7('0x30')]({'where':{'channel':_0x233910,'membername':_0x888c5c['user'][_0x53b7('0xf')],'type':_0x53b7('0x31'),'exitAt':null,'uniqueid':_0x888c5c[_0x53b7('0x20')][_0x53b7('0x2d')][_0x233910]&&_0x888c5c[_0x53b7('0x20')][_0x53b7('0x2d')][_0x233910]['length']?{'$notIn':_0x888c5c[_0x53b7('0x20')]['interaction'][_0x233910]}:{'$ne':null}}})[_0x53b7('0x1a')](function(_0x120d23){var _0x51a126=moment()['format'](_0x53b7('0x32'));for(var _0xeb6083=0x0,_0x34c476=_0x120d23[_0x53b7('0x33')];_0xeb6083<_0x34c476;_0xeb6083+=0x1){_0x120d23[_0xeb6083][_0x53b7('0x34')]({'exitAt':_0x51a126});}});for(var _0x2bb0ee=0x0;_0x2bb0ee<_0x888c5c['body'][_0x53b7('0x2d')][_0x233910][_0x53b7('0x33')];_0x2bb0ee+=0x1){db[_0x53b7('0x2f')]['findOrCreate']({'where':{'channel':_0x233910,'membername':_0x888c5c[_0x53b7('0x2c')]['name'],'type':_0x53b7('0x31'),'uniqueid':_0x888c5c[_0x53b7('0x20')][_0x53b7('0x2d')][_0x233910][_0x2bb0ee],'exitAt':null},'defaults':{'channel':_0x233910,'membername':_0x888c5c['user']['name'],'interface':_[_0x53b7('0x11')](_0x888c5c[_0x53b7('0x2c')][_0x53b7('0x35')])?util[_0x53b7('0x36')](_0x53b7('0x37'),_0x888c5c[_0x53b7('0x2c')][_0x53b7('0xf')]):_0x888c5c[_0x53b7('0x2c')][_0x53b7('0x35')],'type':_0x53b7('0x31'),'enterAt':moment()[_0x53b7('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x888c5c['user']['internal'],'uniqueid':_0x888c5c['body'][_0x53b7('0x2d')][_0x233910][_0x2bb0ee]}});}}}}return respondWithRpcPromise(_0x53b7('0x38'),{'id':_0x888c5c['params']['id'],'capacity':_0x888c5c[_0x53b7('0x20')]['capacity']},routingClient)['then'](respondWithResult(_0x102f9f,null))[_0x53b7('0xc')](handleError(_0x102f9f,null));};exports['telephones']=function(_0x2db0fa,_0x116dc0){return respondWithRpcPromise(_0x53b7('0x39'),_0x2db0fa[_0x53b7('0x18')])['then'](respondWithResult(_0x116dc0,null))[_0x53b7('0xc')](handleError(_0x116dc0,null));};exports['trunks']=function(_0x1fc399,_0x4ed8d6){return respondWithRpcPromise(_0x53b7('0x3a'),_0x1fc399[_0x53b7('0x18')])[_0x53b7('0x1a')](respondWithResult(_0x4ed8d6,null))[_0x53b7('0xc')](handleError(_0x4ed8d6,null));};exports[_0x53b7('0x3b')]=function(_0x4ce16a,_0x2ac5f3){return respondWithRpcPromise(_0x53b7('0x3c'),_0x4ce16a[_0x53b7('0x18')])[_0x53b7('0x1a')](respondWithResult(_0x2ac5f3,null))[_0x53b7('0xc')](handleError(_0x2ac5f3,null));};exports[_0x53b7('0x3d')]=function(_0x2c032b,_0x2c0b69){return respondWithRpcPromise(_0x53b7('0x3e'),_0x2c032b[_0x53b7('0x18')],routingClient)['then'](respondWithResult(_0x2c0b69,null))[_0x53b7('0xc')](handleError(_0x2c0b69,null));};exports[_0x53b7('0x3f')]=function(_0x21de99,_0x1af049){return respondWithRpcPromise('ChatQueues',_0x21de99[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](findById(_0x21de99[_0x53b7('0x19')]['id']))[_0x53b7('0x1a')](respondWithResult(_0x1af049,null))[_0x53b7('0xc')](handleError(_0x1af049,null));};exports[_0x53b7('0x40')]=function(_0x59e60f,_0x38ec82){return respondWithRpcPromise(_0x53b7('0x41'),_0x59e60f[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x38ec82,null))['catch'](handleError(_0x38ec82,null));};exports[_0x53b7('0x42')]=function(_0x3d6b95,_0x4aa303){return respondWithRpcPromise(_0x53b7('0x41'),_0x3d6b95[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](findById(_0x3d6b95[_0x53b7('0x19')]['id']))[_0x53b7('0x1a')](respondWithResult(_0x4aa303,null))[_0x53b7('0xc')](handleError(_0x4aa303,null));};exports['mailAccounts']=function(_0x55391f,_0x457cb3){return respondWithRpcPromise(_0x53b7('0x43'),_0x55391f[_0x53b7('0x18')],mailClient)[_0x53b7('0x1a')](respondWithResult(_0x457cb3,null))['catch'](handleError(_0x457cb3,null));};exports['openchannelQueues']=function(_0x3edb3a,_0x3d8850){return respondWithRpcPromise(_0x53b7('0x44'),_0x3edb3a[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x3d8850,null))[_0x53b7('0xc')](handleError(_0x3d8850,null));};exports[_0x53b7('0x45')]=function(_0x326cf3,_0x5a8509){return respondWithRpcPromise(_0x53b7('0x44'),_0x326cf3['query'],routingClient)[_0x53b7('0x1a')](findById(_0x326cf3[_0x53b7('0x19')]['id']))[_0x53b7('0x1a')](respondWithResult(_0x5a8509,null))[_0x53b7('0xc')](handleError(_0x5a8509,null));};exports['smsQueues']=function(_0x25be4d,_0x5df6f3){return respondWithRpcPromise(_0x53b7('0x46'),_0x25be4d[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x5df6f3,null))[_0x53b7('0xc')](handleError(_0x5df6f3,null));};exports['showSmsQueues']=function(_0x252820,_0x5a55ad){return respondWithRpcPromise(_0x53b7('0x46'),_0x252820[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](findById(_0x252820['params']['id']))[_0x53b7('0x1a')](respondWithResult(_0x5a55ad,null))[_0x53b7('0xc')](handleError(_0x5a55ad,null));};exports['whatsappQueues']=function(_0x39336c,_0x16b530){return respondWithRpcPromise('WhatsappQueues',_0x39336c['query'],routingClient)['then'](respondWithResult(_0x16b530,null))[_0x53b7('0xc')](handleError(_0x16b530,null));};exports[_0x53b7('0x47')]=function(_0x2dd079,_0x37af00){return respondWithRpcPromise(_0x53b7('0x48'),_0x2dd079[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](findById(_0x2dd079['params']['id']))[_0x53b7('0x1a')](respondWithResult(_0x37af00,null))['catch'](handleError(_0x37af00,null));};exports[_0x53b7('0x49')]=function(_0xf3d061,_0x1c551c){return respondWithRpcPromise('FaxQueues',_0xf3d061[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x1c551c,null))[_0x53b7('0xc')](handleError(_0x1c551c,null));};exports['showFaxQueues']=function(_0x2cc41a,_0x24c212){return respondWithRpcPromise('FaxQueues',_0x2cc41a[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](findById(_0x2cc41a[_0x53b7('0x19')]['id']))[_0x53b7('0x1a')](respondWithResult(_0x24c212,null))[_0x53b7('0xc')](handleError(_0x24c212,null));};exports[_0x53b7('0x4a')]=function(_0x4fefc5,_0xb50202){return respondWithRpcPromise(_0x53b7('0x4b'),_0x4fefc5['query'])['then'](respondWithResult(_0xb50202,null))[_0x53b7('0xc')](handleError(_0xb50202,null));};exports[_0x53b7('0x4c')]=function(_0x495f35,_0x43793e){return respondWithRpcPromise(_0x53b7('0x4d'),_0x495f35['query'],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x43793e,null))[_0x53b7('0xc')](handleError(_0x43793e,null));};exports[_0x53b7('0x4e')]=function(_0x5965c7,_0x58be9d){return respondWithRpcPromise(_0x53b7('0x4f'),_0x5965c7[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x58be9d,null))[_0x53b7('0xc')](handleError(_0x58be9d,null));};exports[_0x53b7('0x50')]=function(_0x503b8d,_0x4fd423){return respondWithRpcPromise(_0x53b7('0x51'),_0x503b8d[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x4fd423,null))[_0x53b7('0xc')](handleError(_0x4fd423,null));};exports[_0x53b7('0x52')]=function(_0x28c929,_0x3cee90){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x28c929[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](function(_0x4c7630){if(_0x28c929[_0x53b7('0x18')]['type']!==undefined){var _0x40d27d=_(_0x4c7630[_0x53b7('0x12')])['filter']([_0x28c929['query'][_0x53b7('0x53')],_0x28c929['params']['id']])['map'](_0x53b7('0x54'))['uniq']()[_0x53b7('0x55')]();return _0x4c7630[_0x53b7('0x12')][_0x53b7('0x56')](function(_0x427f7b){return _0x40d27d[_0x53b7('0x57')](_0x427f7b[_0x53b7('0x54')])>-0x1;});}else{return _0x4c7630[_0x53b7('0x12')]['filter'](function(_0x46fae1){return _0x46fae1[_0x53b7('0x54')]===parseInt(_0x28c929['params']['id']);});}})[_0x53b7('0x1a')](respondWithResult(_0x3cee90,null))[_0x53b7('0xc')](handleError(_0x3cee90,null));};exports[_0x53b7('0x58')]=function(_0x4c6db9,_0x11d281){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x4c6db9['query'],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x11d281,null))[_0x53b7('0xc')](handleError(_0x11d281,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x17b0b3,_0x335cb5){return respondWithRpcPromise(_0x53b7('0x59'),_0x17b0b3[_0x53b7('0x18')],routingClient)[_0x53b7('0x1a')](respondWithResult(_0x335cb5,null))[_0x53b7('0xc')](handleError(_0x335cb5,null));};exports['faxQueuesWaitingInteractions']=function(_0x480651,_0x395ad1){return respondWithRpcPromise(_0x53b7('0x5a'),_0x480651['query'],routingClient)['then'](respondWithResult(_0x395ad1,null))['catch'](handleError(_0x395ad1,null));};exports[_0x53b7('0x5b')]=function(_0x3e4f20){return function(_0x235e59,_0x2eef31){var _0x58ad4a,_0x3dc6ac;var _0x2c6638=_[_0x53b7('0x5c')](_0x3e4f20);var _0x34a537=_0x3e4f20===_0x53b7('0x5d')?'Website':_0x53b7('0x5e');return db[_0x2c6638+_0x53b7('0x5f')]['findOne']({'raw':!![],'where':{'id':_0x235e59[_0x53b7('0x19')]['id']}})['then'](function(_0x4a21a3){if(_[_0x53b7('0x11')](_0x4a21a3)){throw new Error(_0x2c6638+_0x53b7('0x60'));}_0x58ad4a=_0x4a21a3;return db[_0x2c6638+_0x53b7('0x61')]['findOne']({'where':{'id':_0x235e59[_0x53b7('0x20')]['messageId']},'include':[{'model':db[_0x2c6638+_0x53b7('0x62')],'as':_0x53b7('0x62')},{'model':db[_0x2c6638+_0x34a537],'as':_0x53b7('0x5e')}]});})[_0x53b7('0x1a')](function(_0x3643ca){if(_[_0x53b7('0x11')](_0x3643ca)){throw new Error(_0x2c6638+_0x53b7('0x63'));}_0x3dc6ac=_0x3643ca;return _0x3643ca[_0x53b7('0x64')]({'read':0x0,'readAt':null,'UserId':null});})[_0x53b7('0x1a')](function(){var _0x28a303={'uniqueid':_0x3e4f20+'.'+_0x3dc6ac['id']+'.'+_0x3dc6ac['Interaction']['id'],'FromUserId':_0x235e59[_0x53b7('0x2c')]['id'],'type':_0x53b7('0x65')};_0x28a303[_0x2c6638+_0x53b7('0x66')]=_0x3dc6ac['id'];_0x28a303[_0x2c6638+_0x53b7('0x67')]=_0x3dc6ac['Interaction']['id'];_0x28a303[_0x53b7('0x68')+_0x2c6638+_0x34a537+'Id']=_0x3dc6ac[_0x53b7('0x5e')]['id'];_0x28a303['To'+_0x2c6638+_0x53b7('0x69')]=_0x58ad4a['id'];return db[_0x2c6638+'TransferReport'][_0x53b7('0x6a')](_0x28a303);})[_0x53b7('0x1a')](function(){return respondWithRpcPromise(_0x53b7('0x6b'),{'channel':_0x3e4f20,'interaction':_0x3dc6ac['Interaction'],'message':_0x3dc6ac,'account':_0x3dc6ac[_0x53b7('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x53b7('0x65'),'appdata':_0x58ad4a[_0x53b7('0xf')]+','+(_0x3dc6ac[_0x53b7('0x5e')][_0x53b7('0x6c')]||0x12c),'interval':_0x53b7('0x6d')}]},routingClient);})[_0x53b7('0x1a')](respondWithResult(_0x2eef31,null))[_0x53b7('0xc')](handleError(_0x2eef31,null));};};exports[_0x53b7('0x6e')]=function(_0x7d3cc2,_0x820182){var _0x341b94,_0x421bc7;if(_[_0x53b7('0x11')](_0x7d3cc2[_0x53b7('0x20')][_0x53b7('0x6f')])){throw new Error(_0x53b7('0x70'));}var _0x4fbd1d=_0x7d3cc2[_0x53b7('0x20')][_0x53b7('0x6f')];var _0x27dd70=_[_0x53b7('0x5c')](_0x4fbd1d);var _0x2d9d37=_0x4fbd1d===_0x53b7('0x5d')?_0x53b7('0x71'):'Account';return db[_0x53b7('0x72')]['findOne']({'raw':!![],'where':{'id':_0x7d3cc2[_0x53b7('0x19')]['id'],'role':_0x53b7('0x73')}})['then'](function(_0x25dd37){if(_[_0x53b7('0x11')](_0x25dd37)){throw new Error(_0x53b7('0x74'));}_0x341b94=_0x25dd37;return db[_0x27dd70+_0x53b7('0x61')][_0x53b7('0x75')]({'where':{'id':_0x7d3cc2[_0x53b7('0x20')][_0x53b7('0x76')]},'include':[{'model':db[_0x27dd70+_0x53b7('0x62')],'as':'Interaction'},{'model':db[_0x27dd70+_0x2d9d37],'as':_0x53b7('0x5e')}]});})['then'](function(_0x3d69c5){if(_[_0x53b7('0x11')](_0x3d69c5)){throw new Error(_0x27dd70+_0x53b7('0x63'));}_0x421bc7=_0x3d69c5;return _0x3d69c5[_0x53b7('0x64')]({'read':0x0,'readAt':null,'UserId':null});})[_0x53b7('0x1a')](function(){var _0x2b95eb={'uniqueid':_0x4fbd1d+'.'+_0x421bc7['id']+'.'+_0x421bc7[_0x53b7('0x62')]['id'],'FromUserId':_0x7d3cc2[_0x53b7('0x2c')]['id'],'type':_0x53b7('0x73'),'ToUserId':_0x341b94['id']};_0x2b95eb[_0x27dd70+_0x53b7('0x66')]=_0x421bc7['id'];_0x2b95eb[_0x27dd70+_0x53b7('0x67')]=_0x421bc7[_0x53b7('0x62')]['id'];_0x2b95eb['From'+_0x27dd70+_0x2d9d37+'Id']=_0x421bc7[_0x53b7('0x5e')]['id'];return db[_0x27dd70+_0x53b7('0x77')][_0x53b7('0x6a')](_0x2b95eb);})['then'](function(){return respondWithRpcPromise(_0x53b7('0x6b'),{'channel':_0x4fbd1d,'interaction':_0x421bc7['Interaction'],'message':_0x421bc7,'account':_0x421bc7[_0x53b7('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x341b94[_0x53b7('0xf')]+','+(_0x421bc7[_0x53b7('0x5e')][_0x53b7('0x78')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x53b7('0x1a')](respondWithResult(_0x820182,null))[_0x53b7('0xc')](handleError(_0x820182,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index fddb5a8..ba21fc5 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 _0x59c0=['exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/run','run','create','put','update','/:id'];(function(_0xc0134a,_0x3e22b1){var _0x5e1a65=function(_0x3d4c1a){while(--_0x3d4c1a){_0xc0134a['push'](_0xc0134a['shift']());}};_0x5e1a65(++_0x3e22b1);}(_0x59c0,0xc7));var _0x059c=function(_0x475095,_0x1fbad8){_0x475095=_0x475095-0x0;var _0x1edc0e=_0x59c0[_0x475095];return _0x1edc0e;};'use strict';var multer=require(_0x059c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x059c('0x1'));var express=require(_0x059c('0x2'));var router=express['Router']();var fs_extra=require(_0x059c('0x3'));var auth=require(_0x059c('0x4'));var interaction=require(_0x059c('0x5'));var config=require(_0x059c('0x6'));var controller=require('./schedule.controller');router[_0x059c('0x7')]('/',auth[_0x059c('0x8')](),controller[_0x059c('0x9')]);router[_0x059c('0x7')]('/:id',auth[_0x059c('0x8')](),controller[_0x059c('0xa')]);router[_0x059c('0x7')](_0x059c('0xb'),auth[_0x059c('0x8')](),controller[_0x059c('0xc')]);router['post']('/',auth[_0x059c('0x8')](),controller[_0x059c('0xd')]);router[_0x059c('0xe')]('/:id',auth[_0x059c('0x8')](),controller[_0x059c('0xf')]);router['delete'](_0x059c('0x10'),auth[_0x059c('0x8')](),controller['destroy']);module[_0x059c('0x11')]=router; \ No newline at end of file +var _0xb470=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','index','/:id','show','get','/:id/run','post','create','put','delete','destroy','multer'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb470,0x109));var _0x0b47=function(_0x20aadd,_0x48d740){_0x20aadd=_0x20aadd-0x0;var _0x2847c6=_0xb470[_0x20aadd];return _0x2847c6;};'use strict';var multer=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var path=require('path');var timeout=require(_0x0b47('0x2'));var express=require(_0x0b47('0x3'));var router=express['Router']();var fs_extra=require(_0x0b47('0x4'));var auth=require(_0x0b47('0x5'));var interaction=require(_0x0b47('0x6'));var config=require('../../config/environment');var controller=require(_0x0b47('0x7'));router['get']('/',auth[_0x0b47('0x8')](),controller[_0x0b47('0x9')]);router['get'](_0x0b47('0xa'),auth['isAuthenticated'](),controller[_0x0b47('0xb')]);router[_0x0b47('0xc')](_0x0b47('0xd'),auth[_0x0b47('0x8')](),controller['run']);router[_0x0b47('0xe')]('/',auth[_0x0b47('0x8')](),controller[_0x0b47('0xf')]);router[_0x0b47('0x10')]('/:id',auth[_0x0b47('0x8')](),controller['update']);router[_0x0b47('0x11')](_0x0b47('0xa'),auth[_0x0b47('0x8')](),controller[_0x0b47('0x12')]);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 0696b75..5d385c6 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 _0x7509=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','quarters','months','weeks','hours','minutes','days','ENUM','csv','xlsx','custom','default','TEXT','sequelize','exports','STRING'];(function(_0x54bac2,_0x2b09f9){var _0x1ffdf9=function(_0x55eff4){while(--_0x55eff4){_0x54bac2['push'](_0x54bac2['shift']());}};_0x1ffdf9(++_0x2b09f9);}(_0x7509,0x12f));var _0x9750=function(_0x19f564,_0x45fd69){_0x19f564=_0x19f564-0x0;var _0xf5be2a=_0x7509[_0x19f564];return _0xf5be2a;};'use strict';var Sequelize=require(_0x9750('0x0'));module[_0x9750('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9750('0x2')]},'active':{'type':Sequelize[_0x9750('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9750('0x4')},'startAt':{'type':Sequelize[_0x9750('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9750('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x9750('0x6'),_0x9750('0x7'),_0x9750('0x8'),'days',_0x9750('0x9'),_0x9750('0xa')),'allowNull':![],'defaultValue':_0x9750('0xb')},'output':{'type':Sequelize[_0x9750('0xc')](_0x9750('0xd'),'pdf',_0x9750('0xe')),'allowNull':![],'defaultValue':_0x9750('0xd')},'type':{'type':Sequelize[_0x9750('0xc')](_0x9750('0xf'),_0x9750('0x10')),'allowNull':![],'defaultValue':_0x9750('0xf')},'sendMail':{'type':Sequelize[_0x9750('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9750('0x2')]},'cc':{'type':Sequelize[_0x9750('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x9750('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd89e=['csv','pdf','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','days','hours','minutes'];(function(_0x1a50a6,_0x400207){var _0x9cd101=function(_0x4abe53){while(--_0x4abe53){_0x1a50a6['push'](_0x1a50a6['shift']());}};_0x9cd101(++_0x400207);}(_0xd89e,0x1a2));var _0xed89=function(_0x5cb632,_0x595dff){_0x5cb632=_0x5cb632-0x0;var _0x3c8294=_0xd89e[_0x5cb632];return _0x3c8294;};'use strict';var Sequelize=require(_0xed89('0x0'));module[_0xed89('0x1')]={'name':{'type':Sequelize[_0xed89('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xed89('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xed89('0x2')],'allowNull':![],'defaultValue':_0xed89('0x4')},'startAt':{'type':Sequelize[_0xed89('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xed89('0x6')](_0xed89('0x7'),_0xed89('0x8'),_0xed89('0x9'),_0xed89('0xa'),_0xed89('0xb'),_0xed89('0xc'),_0xed89('0xd')),'allowNull':![],'defaultValue':_0xed89('0xb')},'output':{'type':Sequelize[_0xed89('0x6')](_0xed89('0xe'),_0xed89('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0xed89('0xe')},'type':{'type':Sequelize['ENUM'](_0xed89('0x10'),'default'),'allowNull':![],'defaultValue':_0xed89('0x10')},'sendMail':{'type':Sequelize[_0xed89('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xed89('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xed89('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 95cb5dd..f39f815 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 _0xd683=['to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','stack','name','map','Schedule','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2db028,_0x1cc47d){var _0x11b379=function(_0x5787dc){while(--_0x5787dc){_0x2db028['push'](_0x2db028['shift']());}};_0x11b379(++_0x1cc47d);}(_0xd683,0x190));var _0x3d68=function(_0x31fc7a,_0x4fde7d){_0x31fc7a=_0x31fc7a-0x0;var _0x4539b1=_0xd683[_0x31fc7a];return _0x4539b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d68('0x0'));var zipdir=require(_0x3d68('0x1'));var jsonpatch=require(_0x3d68('0x2'));var rp=require(_0x3d68('0x3'));var moment=require(_0x3d68('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d68('0x5'));var util=require(_0x3d68('0x6'));var path=require(_0x3d68('0x7'));var sox=require(_0x3d68('0x8'));var csv=require('to-csv');var ejs=require(_0x3d68('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d68('0xa'));var squel=require(_0x3d68('0xb'));var crypto=require(_0x3d68('0xc'));var jsforce=require(_0x3d68('0xd'));var deskjs=require(_0x3d68('0xe'));var toCsv=require(_0x3d68('0xf'));var querystring=require(_0x3d68('0x10'));var Papa=require(_0x3d68('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d68('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d68('0x13'));var logger=require(_0x3d68('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3d68('0x15'));var licenseUtil=require(_0x3d68('0x16'));var db=require(_0x3d68('0x17'))['db'];function respondWithStatusCode(_0x589d32,_0x4d3c51){_0x4d3c51=_0x4d3c51||0xcc;return function(_0x535e6f){if(_0x535e6f){return _0x589d32[_0x3d68('0x18')](_0x4d3c51);}return _0x589d32[_0x3d68('0x19')](_0x4d3c51)[_0x3d68('0x1a')]();};}function respondWithResult(_0x526917,_0x3252bc){_0x3252bc=_0x3252bc||0xc8;return function(_0x22ae2f){if(_0x22ae2f){return _0x526917[_0x3d68('0x19')](_0x3252bc)['json'](_0x22ae2f);}};}function respondWithFilteredResult(_0x503d92,_0x16e761){return function(_0x8f557a){if(_0x8f557a){var _0x48fd82=typeof _0x16e761['offset']===_0x3d68('0x1b')&&typeof _0x16e761['limit']===_0x3d68('0x1b');var _0x4c8989=_0x8f557a[_0x3d68('0x1c')];var _0x511947=_0x48fd82?0x0:_0x16e761['offset'];var _0x496149=_0x48fd82?_0x8f557a[_0x3d68('0x1c')]:_0x16e761[_0x3d68('0x1d')]+_0x16e761[_0x3d68('0x1e')];var _0x3e8841;if(_0x496149>=_0x4c8989){_0x496149=_0x4c8989;_0x3e8841=0xc8;}else{_0x3e8841=0xce;}_0x503d92[_0x3d68('0x19')](_0x3e8841);return _0x503d92[_0x3d68('0x1f')]('Content-Range',_0x511947+'-'+_0x496149+'/'+_0x4c8989)[_0x3d68('0x20')](_0x8f557a);}return null;};}function patchUpdates(_0x1f53ad){return function(_0x571971){try{jsonpatch[_0x3d68('0x21')](_0x571971,_0x1f53ad,!![]);}catch(_0x450afa){return BPromise[_0x3d68('0x22')](_0x450afa);}return _0x571971[_0x3d68('0x23')]();};}function saveUpdates(_0x1c054e,_0x531cac){return function(_0xe61a8e){if(_0xe61a8e){return _0xe61a8e[_0x3d68('0x24')](_0x1c054e)[_0x3d68('0x25')](function(_0x2fcc33){return _0x2fcc33;});}return null;};}function removeEntity(_0x4f0423,_0x514993){return function(_0x7ca43a){if(_0x7ca43a){return _0x7ca43a[_0x3d68('0x26')]()['then'](function(){var _0x5c5245=_0x7ca43a[_0x3d68('0x27')]({'plain':!![]});var _0x1d4da1=_0x3d68('0x28');return db[_0x3d68('0x29')][_0x3d68('0x26')]({'where':{'type':_0x1d4da1,'resourceId':_0x5c5245['id']}})[_0x3d68('0x25')](function(){return _0x7ca43a;});})['then'](function(){_0x4f0423[_0x3d68('0x19')](0xcc)[_0x3d68('0x1a')]();});}};}function handleEntityNotFound(_0x3ed82a,_0x21e0d3){return function(_0x2382a8){if(!_0x2382a8){_0x3ed82a[_0x3d68('0x18')](0x194);}return _0x2382a8;};}function handleError(_0x319fdc,_0x2be0e9){_0x2be0e9=_0x2be0e9||0x1f4;return function(_0x54888a){logger['error'](_0x54888a[_0x3d68('0x2a')]);if(_0x54888a[_0x3d68('0x2b')]){delete _0x54888a[_0x3d68('0x2b')];}_0x319fdc[_0x3d68('0x19')](_0x2be0e9)['send'](_0x54888a);};}exports['index']=function(_0xe33c8a,_0xbfb887){var _0x444875={},_0x35a888={},_0x44a42d={'count':0x0,'rows':[]};var _0x4bd0a1=_[_0x3d68('0x2c')](db[_0x3d68('0x2d')][_0x3d68('0x2e')],function(_0x20c21f){return{'name':_0x20c21f[_0x3d68('0x2f')],'type':_0x20c21f['type'][_0x3d68('0x30')]};});_0x35a888[_0x3d68('0x31')]=_[_0x3d68('0x2c')](_0x4bd0a1,_0x3d68('0x2b'));_0x35a888[_0x3d68('0x32')]=_['keys'](_0xe33c8a[_0x3d68('0x32')]);_0x35a888[_0x3d68('0x33')]=_[_0x3d68('0x34')](_0x35a888[_0x3d68('0x31')],_0x35a888['query']);_0x444875[_0x3d68('0x35')]=_['intersection'](_0x35a888[_0x3d68('0x31')],qs[_0x3d68('0x36')](_0xe33c8a[_0x3d68('0x32')][_0x3d68('0x36')]));_0x444875[_0x3d68('0x35')]=_0x444875[_0x3d68('0x35')][_0x3d68('0x37')]?_0x444875[_0x3d68('0x35')]:_0x35a888['model'];if(!_0xe33c8a[_0x3d68('0x32')]['hasOwnProperty'](_0x3d68('0x38'))){_0x444875[_0x3d68('0x1e')]=qs[_0x3d68('0x1e')](_0xe33c8a[_0x3d68('0x32')]['limit']);_0x444875['offset']=qs['offset'](_0xe33c8a[_0x3d68('0x32')]['offset']);}_0x444875[_0x3d68('0x39')]=qs[_0x3d68('0x3a')](_0xe33c8a[_0x3d68('0x32')][_0x3d68('0x3a')]);_0x444875['where']=qs[_0x3d68('0x33')](_[_0x3d68('0x3b')](_0xe33c8a['query'],_0x35a888['filters']),_0x4bd0a1);if(_0xe33c8a[_0x3d68('0x32')][_0x3d68('0x3c')]){_0x444875[_0x3d68('0x3d')]=_[_0x3d68('0x3e')](_0x444875['where'],{'$or':_[_0x3d68('0x2c')](_0x4bd0a1,function(_0x54a3a3){if(_0x54a3a3[_0x3d68('0x3f')]!==_0x3d68('0x40')){var _0x1f3474={};_0x1f3474[_0x54a3a3[_0x3d68('0x2b')]]={'$like':'%'+_0xe33c8a[_0x3d68('0x32')]['filter']+'%'};return _0x1f3474;}})});}_0x444875=_[_0x3d68('0x3e')]({},_0x444875,_0xe33c8a[_0x3d68('0x41')]);var _0x2050cf={'where':_0x444875['where']};return db[_0x3d68('0x2d')]['count'](_0x2050cf)[_0x3d68('0x25')](function(_0x1a964a){_0x44a42d['count']=_0x1a964a;if(_0xe33c8a['query'][_0x3d68('0x42')]){_0x444875[_0x3d68('0x43')]=[{'all':!![]}];}return db[_0x3d68('0x2d')]['findAll'](_0x444875);})[_0x3d68('0x25')](function(_0x230853){_0x44a42d[_0x3d68('0x44')]=_0x230853;return _0x44a42d;})[_0x3d68('0x25')](respondWithFilteredResult(_0xbfb887,_0x444875))['catch'](handleError(_0xbfb887,null));};exports[_0x3d68('0x45')]=function(_0x58b802,_0x280025){var _0x206899={'raw':![],'where':{'id':_0x58b802[_0x3d68('0x46')]['id']}},_0x375d9c={};_0x375d9c[_0x3d68('0x31')]=_['keys'](db[_0x3d68('0x2d')]['rawAttributes']);_0x375d9c[_0x3d68('0x32')]=_['keys'](_0x58b802[_0x3d68('0x32')]);_0x375d9c[_0x3d68('0x33')]=_[_0x3d68('0x34')](_0x375d9c['model'],_0x375d9c[_0x3d68('0x32')]);_0x206899[_0x3d68('0x35')]=_[_0x3d68('0x34')](_0x375d9c[_0x3d68('0x31')],qs['fields'](_0x58b802[_0x3d68('0x32')][_0x3d68('0x36')]));_0x206899[_0x3d68('0x35')]=_0x206899[_0x3d68('0x35')][_0x3d68('0x37')]?_0x206899['attributes']:_0x375d9c[_0x3d68('0x31')];if(_0x58b802['query'][_0x3d68('0x42')]){_0x206899['include']=[{'all':!![]}];}_0x206899=_[_0x3d68('0x3e')]({},_0x206899,_0x58b802[_0x3d68('0x41')]);return db[_0x3d68('0x2d')]['find'](_0x206899)[_0x3d68('0x25')](handleEntityNotFound(_0x280025,null))['then'](respondWithResult(_0x280025,null))['catch'](handleError(_0x280025,null));};exports[_0x3d68('0x47')]=function(_0x1d73c4,_0x9bd436){return db[_0x3d68('0x2d')][_0x3d68('0x47')](_0x1d73c4['body'],{})['then'](function(_0x111297){var _0x3e6abd=_0x1d73c4[_0x3d68('0x48')]['get']({'plain':!![]});if(!_0x3e6abd)throw new Error(_0x3d68('0x49'));if(_0x3e6abd[_0x3d68('0x4a')]===_0x3d68('0x48')){var _0x38fb8a=_0x111297[_0x3d68('0x27')]({'plain':!![]});var _0x115d56=_0x3d68('0x28');return db['UserProfileSection'][_0x3d68('0x4b')]({'where':{'name':_0x115d56,'userProfileId':_0x3e6abd[_0x3d68('0x4c')]},'raw':!![]})[_0x3d68('0x25')](function(_0x43eda9){if(_0x43eda9&&_0x43eda9['autoAssociation']===0x0){return db[_0x3d68('0x29')]['create']({'name':_0x38fb8a[_0x3d68('0x2b')],'resourceId':_0x38fb8a['id'],'type':_0x43eda9['name'],'sectionId':_0x43eda9['id']},{})[_0x3d68('0x25')](function(){return _0x111297;});}else{return _0x111297;}})[_0x3d68('0x4d')](function(_0x13b834){logger[_0x3d68('0x4e')](_0x3d68('0x4f'),_0x13b834);throw _0x13b834;});}return _0x111297;})[_0x3d68('0x25')](respondWithResult(_0x9bd436,0xc9))[_0x3d68('0x4d')](handleError(_0x9bd436,null));};exports['update']=function(_0x545503,_0x558657){if(_0x545503['body']['id']){delete _0x545503['body']['id'];}return db[_0x3d68('0x2d')][_0x3d68('0x4b')]({'where':{'id':_0x545503[_0x3d68('0x46')]['id']}})['then'](handleEntityNotFound(_0x558657,null))[_0x3d68('0x25')](saveUpdates(_0x545503[_0x3d68('0x50')],null))[_0x3d68('0x25')](respondWithResult(_0x558657,null))['catch'](handleError(_0x558657,null));};exports[_0x3d68('0x26')]=function(_0x54794f,_0x5af311){return db[_0x3d68('0x2d')][_0x3d68('0x4b')]({'where':{'id':_0x54794f[_0x3d68('0x46')]['id']}})[_0x3d68('0x25')](handleEntityNotFound(_0x5af311,null))[_0x3d68('0x25')](removeEntity(_0x5af311,null))['catch'](handleError(_0x5af311,null));};exports[_0x3d68('0x51')]=function(_0x19636d,_0x34d388,_0x4338b6){var _0xa8f059=require(_0x3d68('0x52'));return db['Schedule'][_0x3d68('0x4b')]({'where':{'id':_0x19636d[_0x3d68('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x34d388,null))[_0x3d68('0x25')](function(){_0xa8f059['run'](_0x19636d[_0x3d68('0x46')]['id']);})['then'](respondWithStatusCode(_0x34d388,null))[_0x3d68('0x4d')](handleError(_0x34d388,null));}; \ No newline at end of file +var _0xb785=['request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','name','send','map','Schedule','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','catch','params','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','rimraf','fast-json-patch'];(function(_0x557ef5,_0x122aa0){var _0x266185=function(_0x1d48dc){while(--_0x1d48dc){_0x557ef5['push'](_0x557ef5['shift']());}};_0x266185(++_0x122aa0);}(_0xb785,0x1dd));var _0x5b78=function(_0x100609,_0x5a0efd){_0x100609=_0x100609-0x0;var _0x2efea3=_0xb785[_0x100609];return _0x2efea3;};'use strict';var emlformat=require(_0x5b78('0x0'));var rimraf=require(_0x5b78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b78('0x2'));var rp=require(_0x5b78('0x3'));var moment=require(_0x5b78('0x4'));var BPromise=require(_0x5b78('0x5'));var Mustache=require(_0x5b78('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5b78('0x7'));var ejs=require(_0x5b78('0x8'));var fs=require('fs');var fs_extra=require(_0x5b78('0x9'));var _=require(_0x5b78('0xa'));var squel=require(_0x5b78('0xb'));var crypto=require(_0x5b78('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b78('0xd'));var Papa=require(_0x5b78('0xe'));var Redis=require(_0x5b78('0xf'));var authService=require(_0x5b78('0x10'));var qs=require(_0x5b78('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b78('0x12'));var logger=require('../../config/logger')(_0x5b78('0x13'));var utils=require(_0x5b78('0x14'));var config=require(_0x5b78('0x15'));var licenseUtil=require(_0x5b78('0x16'));var db=require(_0x5b78('0x17'))['db'];function respondWithStatusCode(_0x107989,_0x59541d){_0x59541d=_0x59541d||0xcc;return function(_0x4ebfae){if(_0x4ebfae){return _0x107989['sendStatus'](_0x59541d);}return _0x107989['status'](_0x59541d)[_0x5b78('0x18')]();};}function respondWithResult(_0x27acca,_0x2d55d8){_0x2d55d8=_0x2d55d8||0xc8;return function(_0x4d526b){if(_0x4d526b){return _0x27acca[_0x5b78('0x19')](_0x2d55d8)[_0x5b78('0x1a')](_0x4d526b);}};}function respondWithFilteredResult(_0x238868,_0x411576){return function(_0x1353c7){if(_0x1353c7){var _0x4d277e=typeof _0x411576[_0x5b78('0x1b')]===_0x5b78('0x1c')&&typeof _0x411576[_0x5b78('0x1d')]===_0x5b78('0x1c');var _0x33a7b0=_0x1353c7[_0x5b78('0x1e')];var _0x52de32=_0x4d277e?0x0:_0x411576[_0x5b78('0x1b')];var _0x2e8817=_0x4d277e?_0x1353c7[_0x5b78('0x1e')]:_0x411576[_0x5b78('0x1b')]+_0x411576['limit'];var _0xac6ef3;if(_0x2e8817>=_0x33a7b0){_0x2e8817=_0x33a7b0;_0xac6ef3=0xc8;}else{_0xac6ef3=0xce;}_0x238868[_0x5b78('0x19')](_0xac6ef3);return _0x238868['set'](_0x5b78('0x1f'),_0x52de32+'-'+_0x2e8817+'/'+_0x33a7b0)['json'](_0x1353c7);}return null;};}function patchUpdates(_0x16ae10){return function(_0x218897){try{jsonpatch[_0x5b78('0x20')](_0x218897,_0x16ae10,!![]);}catch(_0xb0a48c){return BPromise[_0x5b78('0x21')](_0xb0a48c);}return _0x218897[_0x5b78('0x22')]();};}function saveUpdates(_0x3010b1,_0x5dbbf5){return function(_0x32b65b){if(_0x32b65b){return _0x32b65b['update'](_0x3010b1)[_0x5b78('0x23')](function(_0x39ceef){return _0x39ceef;});}return null;};}function removeEntity(_0x591ec5,_0x48549f){return function(_0x3fcf33){if(_0x3fcf33){return _0x3fcf33['destroy']()[_0x5b78('0x23')](function(){var _0x51c220=_0x3fcf33[_0x5b78('0x24')]({'plain':!![]});var _0x2ee61b='Scheduler';return db[_0x5b78('0x25')][_0x5b78('0x26')]({'where':{'type':_0x2ee61b,'resourceId':_0x51c220['id']}})[_0x5b78('0x23')](function(){return _0x3fcf33;});})[_0x5b78('0x23')](function(){_0x591ec5[_0x5b78('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21ab41,_0x4e2ed1){return function(_0x539cd5){if(!_0x539cd5){_0x21ab41['sendStatus'](0x194);}return _0x539cd5;};}function handleError(_0x377888,_0x2a2f83){_0x2a2f83=_0x2a2f83||0x1f4;return function(_0x2daf37){logger[_0x5b78('0x27')](_0x2daf37['stack']);if(_0x2daf37[_0x5b78('0x28')]){delete _0x2daf37[_0x5b78('0x28')];}_0x377888[_0x5b78('0x19')](_0x2a2f83)[_0x5b78('0x29')](_0x2daf37);};}exports['index']=function(_0x4a3695,_0x5b4904){var _0xac42f1={},_0x4d3b40={},_0x3cab4b={'count':0x0,'rows':[]};var _0x741031=_[_0x5b78('0x2a')](db[_0x5b78('0x2b')][_0x5b78('0x2c')],function(_0x35f3f5){return{'name':_0x35f3f5['fieldName'],'type':_0x35f3f5[_0x5b78('0x2d')][_0x5b78('0x2e')]};});_0x4d3b40[_0x5b78('0x2f')]=_[_0x5b78('0x2a')](_0x741031,_0x5b78('0x28'));_0x4d3b40[_0x5b78('0x30')]=_[_0x5b78('0x31')](_0x4a3695[_0x5b78('0x30')]);_0x4d3b40[_0x5b78('0x32')]=_['intersection'](_0x4d3b40[_0x5b78('0x2f')],_0x4d3b40[_0x5b78('0x30')]);_0xac42f1['attributes']=_[_0x5b78('0x33')](_0x4d3b40['model'],qs[_0x5b78('0x34')](_0x4a3695[_0x5b78('0x30')][_0x5b78('0x34')]));_0xac42f1[_0x5b78('0x35')]=_0xac42f1['attributes'][_0x5b78('0x36')]?_0xac42f1[_0x5b78('0x35')]:_0x4d3b40[_0x5b78('0x2f')];if(!_0x4a3695[_0x5b78('0x30')][_0x5b78('0x37')]('nolimit')){_0xac42f1[_0x5b78('0x1d')]=qs['limit'](_0x4a3695[_0x5b78('0x30')][_0x5b78('0x1d')]);_0xac42f1[_0x5b78('0x1b')]=qs[_0x5b78('0x1b')](_0x4a3695['query'][_0x5b78('0x1b')]);}_0xac42f1[_0x5b78('0x38')]=qs[_0x5b78('0x39')](_0x4a3695[_0x5b78('0x30')][_0x5b78('0x39')]);_0xac42f1[_0x5b78('0x3a')]=qs[_0x5b78('0x32')](_['pick'](_0x4a3695[_0x5b78('0x30')],_0x4d3b40[_0x5b78('0x32')]),_0x741031);if(_0x4a3695[_0x5b78('0x30')]['filter']){_0xac42f1[_0x5b78('0x3a')]=_[_0x5b78('0x3b')](_0xac42f1[_0x5b78('0x3a')],{'$or':_[_0x5b78('0x2a')](_0x741031,function(_0x219f0d){if(_0x219f0d['type']!==_0x5b78('0x3c')){var _0x1697fe={};_0x1697fe[_0x219f0d['name']]={'$like':'%'+_0x4a3695['query'][_0x5b78('0x3d')]+'%'};return _0x1697fe;}})});}_0xac42f1=_[_0x5b78('0x3b')]({},_0xac42f1,_0x4a3695['options']);var _0x11f054={'where':_0xac42f1[_0x5b78('0x3a')]};return db[_0x5b78('0x2b')]['count'](_0x11f054)[_0x5b78('0x23')](function(_0x1fff72){_0x3cab4b[_0x5b78('0x1e')]=_0x1fff72;if(_0x4a3695['query'][_0x5b78('0x3e')]){_0xac42f1['include']=[{'all':!![]}];}return db[_0x5b78('0x2b')][_0x5b78('0x3f')](_0xac42f1);})['then'](function(_0xaaa8b2){_0x3cab4b['rows']=_0xaaa8b2;return _0x3cab4b;})[_0x5b78('0x23')](respondWithFilteredResult(_0x5b4904,_0xac42f1))[_0x5b78('0x40')](handleError(_0x5b4904,null));};exports['show']=function(_0x43856f,_0x55ac3e){var _0x5bc983={'raw':![],'where':{'id':_0x43856f[_0x5b78('0x41')]['id']}},_0xcbf0dd={};_0xcbf0dd[_0x5b78('0x2f')]=_[_0x5b78('0x31')](db[_0x5b78('0x2b')][_0x5b78('0x2c')]);_0xcbf0dd[_0x5b78('0x30')]=_[_0x5b78('0x31')](_0x43856f[_0x5b78('0x30')]);_0xcbf0dd['filters']=_[_0x5b78('0x33')](_0xcbf0dd[_0x5b78('0x2f')],_0xcbf0dd['query']);_0x5bc983[_0x5b78('0x35')]=_['intersection'](_0xcbf0dd[_0x5b78('0x2f')],qs[_0x5b78('0x34')](_0x43856f[_0x5b78('0x30')][_0x5b78('0x34')]));_0x5bc983['attributes']=_0x5bc983['attributes'][_0x5b78('0x36')]?_0x5bc983['attributes']:_0xcbf0dd['model'];if(_0x43856f['query'][_0x5b78('0x3e')]){_0x5bc983[_0x5b78('0x42')]=[{'all':!![]}];}_0x5bc983=_[_0x5b78('0x3b')]({},_0x5bc983,_0x43856f[_0x5b78('0x43')]);return db[_0x5b78('0x2b')]['find'](_0x5bc983)[_0x5b78('0x23')](handleEntityNotFound(_0x55ac3e,null))[_0x5b78('0x23')](respondWithResult(_0x55ac3e,null))[_0x5b78('0x40')](handleError(_0x55ac3e,null));};exports[_0x5b78('0x44')]=function(_0x2fc379,_0x382f51){return db[_0x5b78('0x2b')]['create'](_0x2fc379[_0x5b78('0x45')],{})[_0x5b78('0x23')](function(_0x2f2f89){var _0x3023b2=_0x2fc379[_0x5b78('0x46')][_0x5b78('0x24')]({'plain':!![]});if(!_0x3023b2)throw new Error(_0x5b78('0x47'));if(_0x3023b2['role']==='user'){var _0xb5186d=_0x2f2f89[_0x5b78('0x24')]({'plain':!![]});var _0x1088d4='Scheduler';return db[_0x5b78('0x48')][_0x5b78('0x49')]({'where':{'name':_0x1088d4,'userProfileId':_0x3023b2[_0x5b78('0x4a')]},'raw':!![]})[_0x5b78('0x23')](function(_0x57155f){if(_0x57155f&&_0x57155f[_0x5b78('0x4b')]===0x0){return db[_0x5b78('0x25')][_0x5b78('0x44')]({'name':_0xb5186d[_0x5b78('0x28')],'resourceId':_0xb5186d['id'],'type':_0x57155f[_0x5b78('0x28')],'sectionId':_0x57155f['id']},{})['then'](function(){return _0x2f2f89;});}else{return _0x2f2f89;}})['catch'](function(_0x3e8aa0){logger[_0x5b78('0x27')](_0x5b78('0x4c'),_0x3e8aa0);throw _0x3e8aa0;});}return _0x2f2f89;})['then'](respondWithResult(_0x382f51,0xc9))[_0x5b78('0x40')](handleError(_0x382f51,null));};exports[_0x5b78('0x4d')]=function(_0x29e683,_0x34f825){if(_0x29e683[_0x5b78('0x45')]['id']){delete _0x29e683[_0x5b78('0x45')]['id'];}return db['Schedule'][_0x5b78('0x49')]({'where':{'id':_0x29e683['params']['id']}})[_0x5b78('0x23')](handleEntityNotFound(_0x34f825,null))[_0x5b78('0x23')](saveUpdates(_0x29e683[_0x5b78('0x45')],null))[_0x5b78('0x23')](respondWithResult(_0x34f825,null))[_0x5b78('0x40')](handleError(_0x34f825,null));};exports[_0x5b78('0x26')]=function(_0x50b88d,_0x7db155){return db['Schedule'][_0x5b78('0x49')]({'where':{'id':_0x50b88d[_0x5b78('0x41')]['id']}})[_0x5b78('0x23')](handleEntityNotFound(_0x7db155,null))[_0x5b78('0x23')](removeEntity(_0x7db155,null))['catch'](handleError(_0x7db155,null));};exports[_0x5b78('0x4e')]=function(_0x321254,_0x10a136,_0x17c9fb){var _0x333133=require(_0x5b78('0x4f'));return db['Schedule'][_0x5b78('0x49')]({'where':{'id':_0x321254[_0x5b78('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x10a136,null))[_0x5b78('0x23')](function(){_0x333133[_0x5b78('0x4e')](_0x321254[_0x5b78('0x41')]['id']);})[_0x5b78('0x23')](respondWithStatusCode(_0x10a136,null))[_0x5b78('0x40')](handleError(_0x10a136,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3516d04..fb73911 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 _0x0a2d=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x7192f6,_0x2e6a89){var _0x477b1c=function(_0x165855){while(--_0x165855){_0x7192f6['push'](_0x7192f6['shift']());}};_0x477b1c(++_0x2e6a89);}(_0x0a2d,0x131));var _0xd0a2=function(_0x163444,_0xd51d57){_0x163444=_0x163444-0x0;var _0x407b3e=_0x0a2d[_0x163444];return _0x407b3e;};'use strict';var _=require(_0xd0a2('0x0'));var util=require('util');var logger=require(_0xd0a2('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd0a2('0x2'));var rp=require(_0xd0a2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd0a2('0x4'));var attributes=require(_0xd0a2('0x5'));module[_0xd0a2('0x6')]=function(_0x29651b,_0x2698e7){return _0x29651b[_0xd0a2('0x7')](_0xd0a2('0x8'),attributes,{'tableName':_0xd0a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_schedules','util','../../config/logger'];(function(_0x39ae64,_0x4da0f6){var _0x12c93b=function(_0x49c0fa){while(--_0x49c0fa){_0x39ae64['push'](_0x39ae64['shift']());}};_0x12c93b(++_0x4da0f6);}(_0x187c,0x1ed));var _0xc187=function(_0x12e498,_0x1adbfa){_0x12e498=_0x12e498-0x0;var _0x1107d7=_0x187c[_0x12e498];return _0x1107d7;};'use strict';var _=require('lodash');var util=require(_0xc187('0x0'));var logger=require(_0xc187('0x1'))('api');var moment=require(_0xc187('0x2'));var BPromise=require(_0xc187('0x3'));var rp=require(_0xc187('0x4'));var fs=require('fs');var path=require(_0xc187('0x5'));var rimraf=require(_0xc187('0x6'));var config=require(_0xc187('0x7'));var attributes=require('./schedule.attributes');module[_0xc187('0x8')]=function(_0x3fd603,_0x3d60d8){return _0x3fd603[_0xc187('0x9')]('Schedule',attributes,{'tableName':_0xc187('0xa'),'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 76074b9..37692f9 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 _0xdff7=['then','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','Schedule,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x59f5a3,_0x1beca7){var _0x2d1932=function(_0x42841f){while(--_0x42841f){_0x59f5a3['push'](_0x59f5a3['shift']());}};_0x2d1932(++_0x1beca7);}(_0xdff7,0xb9));var _0x7dff=function(_0x3958b1,_0x2954e1){_0x3958b1=_0x3958b1-0x0;var _0xb70fe3=_0xdff7[_0x3958b1];return _0xb70fe3;};'use strict';var _=require('lodash');var util=require(_0x7dff('0x0'));var moment=require('moment');var BPromise=require(_0x7dff('0x1'));var rs=require(_0x7dff('0x2'));var fs=require('fs');var Redis=require(_0x7dff('0x3'));var db=require(_0x7dff('0x4'))['db'];var utils=require(_0x7dff('0x5'));var logger=require(_0x7dff('0x6'))(_0x7dff('0x7'));var config=require(_0x7dff('0x8'));var jayson=require(_0x7dff('0x9'));var client=jayson[_0x7dff('0xa')][_0x7dff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x298a9b,_0x3c64cd,_0x1cf170){return new BPromise(function(_0x40a211,_0x1ad554){return client[_0x7dff('0xc')](_0x298a9b,_0x1cf170)[_0x7dff('0xd')](function(_0x6479ab){logger[_0x7dff('0xe')]('Schedule,\x20%s,\x20%s',_0x3c64cd,_0x7dff('0xf'));logger['debug'](_0x7dff('0x10'),_0x3c64cd,_0x7dff('0xf'),JSON['stringify'](_0x6479ab));if(_0x6479ab[_0x7dff('0x11')]){if(_0x6479ab['error'][_0x7dff('0x12')]===0x1f4){logger[_0x7dff('0x11')](_0x7dff('0x13'),_0x3c64cd,_0x6479ab['error'][_0x7dff('0x14')]);return _0x1ad554(_0x6479ab[_0x7dff('0x11')][_0x7dff('0x14')]);}logger[_0x7dff('0x11')]('Schedule,\x20%s,\x20%s',_0x3c64cd,_0x6479ab[_0x7dff('0x11')][_0x7dff('0x14')]);return _0x40a211(_0x6479ab[_0x7dff('0x11')][_0x7dff('0x14')]);}else{logger[_0x7dff('0xe')]('Schedule,\x20%s,\x20%s',_0x3c64cd,_0x7dff('0xf'));_0x40a211(_0x6479ab[_0x7dff('0x15')]['message']);}})['catch'](function(_0x90b35c){logger[_0x7dff('0x11')](_0x7dff('0x13'),_0x3c64cd,_0x90b35c);_0x1ad554(_0x90b35c);});});} \ No newline at end of file +var _0xcabf=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Schedule,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x110da3,_0x123a86){var _0x57b208=function(_0x200701){while(--_0x200701){_0x110da3['push'](_0x110da3['shift']());}};_0x57b208(++_0x123a86);}(_0xcabf,0x99));var _0xfcab=function(_0x5a4e31,_0x125a92){_0x5a4e31=_0x5a4e31-0x0;var _0x5e63e5=_0xcabf[_0x5a4e31];return _0x5e63e5;};'use strict';var _=require(_0xfcab('0x0'));var util=require(_0xfcab('0x1'));var moment=require(_0xfcab('0x2'));var BPromise=require(_0xfcab('0x3'));var rs=require(_0xfcab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfcab('0x5'));var logger=require(_0xfcab('0x6'))(_0xfcab('0x7'));var config=require('../../config/environment');var jayson=require(_0xfcab('0x8'));var client=jayson[_0xfcab('0x9')][_0xfcab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x651520,_0x14132b,_0x53cc5a){return new BPromise(function(_0x5cab4c,_0x43a714){return client['request'](_0x651520,_0x53cc5a)['then'](function(_0x263fcd){logger[_0xfcab('0xb')](_0xfcab('0xc'),_0x14132b,'request\x20sent');logger[_0xfcab('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x14132b,_0xfcab('0xe'),JSON[_0xfcab('0xf')](_0x263fcd));if(_0x263fcd[_0xfcab('0x10')]){if(_0x263fcd['error'][_0xfcab('0x11')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x14132b,_0x263fcd[_0xfcab('0x10')]['message']);return _0x43a714(_0x263fcd[_0xfcab('0x10')][_0xfcab('0x12')]);}logger[_0xfcab('0x10')](_0xfcab('0xc'),_0x14132b,_0x263fcd[_0xfcab('0x10')][_0xfcab('0x12')]);return _0x5cab4c(_0x263fcd[_0xfcab('0x10')]['message']);}else{logger[_0xfcab('0xb')](_0xfcab('0xc'),_0x14132b,'request\x20sent');_0x5cab4c(_0x263fcd[_0xfcab('0x13')][_0xfcab('0x12')]);}})[_0xfcab('0x14')](function(_0x2fd95e){logger[_0xfcab('0x10')](_0xfcab('0xc'),_0x14132b,_0x2fd95e);_0x43a714(_0x2fd95e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 7fb4948..e873e58 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 _0xc883=['get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller'];(function(_0x4787d2,_0x2114f4){var _0x367d75=function(_0xde4b66){while(--_0xde4b66){_0x4787d2['push'](_0x4787d2['shift']());}};_0x367d75(++_0x2114f4);}(_0xc883,0xcf));var _0x3c88=function(_0x59ddb0,_0x2081c3){_0x59ddb0=_0x59ddb0-0x0;var _0x1dba64=_0xc883[_0x59ddb0];return _0x1dba64;};'use strict';var multer=require(_0x3c88('0x0'));var util=require(_0x3c88('0x1'));var path=require(_0x3c88('0x2'));var timeout=require(_0x3c88('0x3'));var express=require(_0x3c88('0x4'));var router=express[_0x3c88('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3c88('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3c88('0x7'));var controller=require(_0x3c88('0x8'));router[_0x3c88('0x9')]('/',auth[_0x3c88('0xa')](),controller[_0x3c88('0xb')]);router[_0x3c88('0x9')](_0x3c88('0xc'),auth[_0x3c88('0xa')](),controller['describe']);router[_0x3c88('0x9')](_0x3c88('0xd'),auth[_0x3c88('0xa')](),controller[_0x3c88('0xe')]);router[_0x3c88('0x9')](_0x3c88('0xf'),auth[_0x3c88('0xa')](),controller[_0x3c88('0x10')]);router[_0x3c88('0x11')]('/',auth[_0x3c88('0xa')](),controller[_0x3c88('0x12')]);router[_0x3c88('0x13')]('/:id',auth[_0x3c88('0xa')](),controller[_0x3c88('0x14')]);router[_0x3c88('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3c88('0x16')]);module[_0x3c88('0x17')]=router; \ No newline at end of file +var _0xfc54=['index','/describe','describe','/:id','show','/:id/download','post','create','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x5d1f52,_0x570f67){var _0x1ee997=function(_0x59e90f){while(--_0x59e90f){_0x5d1f52['push'](_0x5d1f52['shift']());}};_0x1ee997(++_0x570f67);}(_0xfc54,0x1a9));var _0x4fc5=function(_0x59ed8c,_0x497c0f){_0x59ed8c=_0x59ed8c-0x0;var _0x2ae760=_0xfc54[_0x59ed8c];return _0x2ae760;};'use strict';var multer=require('multer');var util=require(_0x4fc5('0x0'));var path=require(_0x4fc5('0x1'));var timeout=require(_0x4fc5('0x2'));var express=require(_0x4fc5('0x3'));var router=express[_0x4fc5('0x4')]();var fs_extra=require(_0x4fc5('0x5'));var auth=require(_0x4fc5('0x6'));var interaction=require(_0x4fc5('0x7'));var config=require(_0x4fc5('0x8'));var controller=require(_0x4fc5('0x9'));router[_0x4fc5('0xa')]('/',auth[_0x4fc5('0xb')](),controller[_0x4fc5('0xc')]);router[_0x4fc5('0xa')](_0x4fc5('0xd'),auth[_0x4fc5('0xb')](),controller[_0x4fc5('0xe')]);router[_0x4fc5('0xa')](_0x4fc5('0xf'),auth[_0x4fc5('0xb')](),controller[_0x4fc5('0x10')]);router[_0x4fc5('0xa')](_0x4fc5('0x11'),auth['isAuthenticated'](),controller['download']);router[_0x4fc5('0x12')]('/',auth[_0x4fc5('0xb')](),controller[_0x4fc5('0x13')]);router[_0x4fc5('0x14')](_0x4fc5('0xf'),auth[_0x4fc5('0xb')](),controller['update']);router[_0x4fc5('0x15')]('/:id',auth[_0x4fc5('0xb')](),controller['destroy']);module[_0x4fc5('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 5d82d7c..a566ceb 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 _0x7916=['setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','updatedAt','sequelize','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING'];(function(_0x51aea2,_0x3492b0){var _0x269bb9=function(_0x1bc4ef){while(--_0x1bc4ef){_0x51aea2['push'](_0x51aea2['shift']());}};_0x269bb9(++_0x3492b0);}(_0x7916,0x128));var _0x6791=function(_0x378277,_0x3405d1){_0x378277=_0x378277-0x0;var _0x4b0831=_0x7916[_0x378277];return _0x4b0831;};'use strict';var Sequelize=require(_0x6791('0x0'));var moment=require('moment');var path=require(_0x6791('0x1'));var config=require(_0x6791('0x2'));module['exports']={'format':{'type':Sequelize[_0x6791('0x3')],'get':function(){return this[_0x6791('0x4')](_0x6791('0x5'))?path[_0x6791('0x6')](this['getDataValue'](_0x6791('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6791('0x7')]},'value':{'type':Sequelize[_0x6791('0x7')],'set':function(_0x5ad8c0){var _0x8b85ff=_0x5ad8c0['replace'](/\\/g,'/');this[_0x6791('0x8')]('value',_0x8b85ff);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6791('0x9')],'set':function(_0x198a64){this['setDataValue'](_0x6791('0xa'),moment()[_0x6791('0xb')](_0x198a64,'ms'));this[_0x6791('0x8')]('closedAt',moment());this[_0x6791('0x8')](_0x6791('0xc'),_0x198a64);}},'startedAt':{'type':Sequelize[_0x6791('0xd')],'get':function(){return moment(this[_0x6791('0x4')](_0x6791('0xa')))[_0x6791('0xe')](_0x6791('0xf'))[_0x6791('0x10')]();}},'closedAt':{'type':Sequelize[_0x6791('0xd')],'get':function(){return moment(this[_0x6791('0x4')](_0x6791('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0x6791('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6791('0x4')]('createdAt'))[_0x6791('0xe')](_0x6791('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x6791('0xd')],'get':function(){return moment(this['getDataValue'](_0x6791('0x12')))[_0x6791('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x6791('0x10')]();}}}; \ No newline at end of file +var _0xdfdd=['closedAt','duration','DATE','format','toString','createdAt','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','VIRTUAL','value','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0xdfdd,0x104));var _0xddfd=function(_0x4858c0,_0x103964){_0x4858c0=_0x4858c0-0x0;var _0x46974d=_0xdfdd[_0x4858c0];return _0x46974d;};'use strict';var Sequelize=require(_0xddfd('0x0'));var moment=require(_0xddfd('0x1'));var path=require(_0xddfd('0x2'));var config=require(_0xddfd('0x3'));module['exports']={'format':{'type':Sequelize[_0xddfd('0x4')],'get':function(){return this['getDataValue'](_0xddfd('0x5'))?path['extname'](this[_0xddfd('0x6')](_0xddfd('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xddfd('0x7')]},'channel':{'type':Sequelize[_0xddfd('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x25fcbc){var _0x485ede=_0x25fcbc[_0xddfd('0x8')](/\\/g,'/');this[_0xddfd('0x9')](_0xddfd('0x5'),_0x485ede);}},'rating':{'type':Sequelize[_0xddfd('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xddfd('0xa')],'set':function(_0x2a3b1e){this['setDataValue'](_0xddfd('0xb'),moment()[_0xddfd('0xc')](_0x2a3b1e,'ms'));this['setDataValue'](_0xddfd('0xd'),moment());this[_0xddfd('0x9')](_0xddfd('0xe'),_0x2a3b1e);}},'startedAt':{'type':Sequelize[_0xddfd('0xf')],'get':function(){return moment(this[_0xddfd('0x6')]('startedAt'))[_0xddfd('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xddfd('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xddfd('0x6')]('closedAt'))[_0xddfd('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xddfd('0x11')]();}},'createdAt':{'type':Sequelize[_0xddfd('0xf')],'get':function(){return moment(this[_0xddfd('0x6')](_0xddfd('0x12')))[_0xddfd('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xddfd('0x11')]();}},'updatedAt':{'type':Sequelize[_0xddfd('0xf')],'get':function(){return moment(this[_0xddfd('0x6')](_0xddfd('0x13')))[_0xddfd('0x10')](_0xddfd('0x14'))[_0xddfd('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index fbb8379..0c6010b 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 _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x494fa2,_0x84b5d8){var _0xf013c7=function(_0x348859){while(--_0x348859){_0x494fa2['push'](_0x494fa2['shift']());}};_0xf013c7(++_0x84b5d8);}(_0x7217,0x19e));var _0x7721=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x7217[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file +var _0x2bd8=['unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x2dd9e4,_0x3bc85d){var _0x8c9177=function(_0x98afac){while(--_0x98afac){_0x2dd9e4['push'](_0x2dd9e4['shift']());}};_0x8c9177(++_0x3bc85d);}(_0x2bd8,0x130));var _0x82bd=function(_0x2b325a,_0x4c95df){_0x2b325a=_0x2b325a-0x0;var _0x405eb=_0x2bd8[_0x2b325a];return _0x405eb;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 683cb08..c87d8ec 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 _0x8d08=['path','rimraf','exports','define','ScreenRecording','interactionid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8d08,0x66));var _0x88d0=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x8d08[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var logger=require('../../config/logger')(_0x88d0('0x2'));var moment=require(_0x88d0('0x3'));var BPromise=require(_0x88d0('0x4'));var rp=require(_0x88d0('0x5'));var fs=require('fs');var path=require(_0x88d0('0x6'));var rimraf=require(_0x88d0('0x7'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0x88d0('0x8')]=function(_0x1ab646,_0x3b36fd){return _0x1ab646[_0x88d0('0x9')](_0x88d0('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x88d0('0xb'),'fields':[_0x88d0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b23=['bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment'];(function(_0x1f44bb,_0x30bf74){var _0x321b75=function(_0x962c8d){while(--_0x962c8d){_0x1f44bb['push'](_0x1f44bb['shift']());}};_0x321b75(++_0x30bf74);}(_0x7b23,0x1f4));var _0x37b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7b23[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x37b2('0x0'));var util=require(_0x37b2('0x1'));var logger=require('../../config/logger')(_0x37b2('0x2'));var moment=require(_0x37b2('0x3'));var BPromise=require(_0x37b2('0x4'));var rp=require(_0x37b2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37b2('0x6'));var config=require(_0x37b2('0x7'));var attributes=require(_0x37b2('0x8'));module[_0x37b2('0x9')]=function(_0x324d49,_0x3e8dc9){return _0x324d49[_0x37b2('0xa')](_0x37b2('0xb'),attributes,{'tableName':_0x37b2('0xc'),'paranoid':![],'indexes':[{'name':_0x37b2('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index cbca188..74a1487 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 _0x35d9=['message','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x3dd0d9,_0x51a3b2){var _0x261731=function(_0x4398c4){while(--_0x4398c4){_0x3dd0d9['push'](_0x3dd0d9['shift']());}};_0x261731(++_0x51a3b2);}(_0x35d9,0x9a));var _0x935d=function(_0xe03d39,_0x4154a1){_0xe03d39=_0xe03d39-0x0;var _0x359940=_0x35d9[_0xe03d39];return _0x359940;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x935d('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x935d('0x1'))['db'];var utils=require(_0x935d('0x2'));var logger=require(_0x935d('0x3'))(_0x935d('0x4'));var config=require(_0x935d('0x5'));var jayson=require(_0x935d('0x6'));var client=jayson[_0x935d('0x7')][_0x935d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4550d9,_0x96330f,_0x5ac5d7){return new BPromise(function(_0x329e40,_0x3d80a0){return client[_0x935d('0x9')](_0x4550d9,_0x5ac5d7)[_0x935d('0xa')](function(_0x168b1d){logger[_0x935d('0xb')](_0x935d('0xc'),_0x96330f,_0x935d('0xd'));logger[_0x935d('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x96330f,_0x935d('0xd'),JSON['stringify'](_0x168b1d));if(_0x168b1d[_0x935d('0xf')]){if(_0x168b1d[_0x935d('0xf')][_0x935d('0x10')]===0x1f4){logger['error'](_0x935d('0xc'),_0x96330f,_0x168b1d[_0x935d('0xf')][_0x935d('0x11')]);return _0x3d80a0(_0x168b1d['error'][_0x935d('0x11')]);}logger[_0x935d('0xf')](_0x935d('0xc'),_0x96330f,_0x168b1d[_0x935d('0xf')][_0x935d('0x11')]);return _0x329e40(_0x168b1d[_0x935d('0xf')]['message']);}else{logger[_0x935d('0xb')](_0x935d('0xc'),_0x96330f,'request\x20sent');_0x329e40(_0x168b1d['result']['message']);}})[_0x935d('0x12')](function(_0x9b5964){logger[_0x935d('0xf')](_0x935d('0xc'),_0x96330f,_0x9b5964);_0x3d80a0(_0x9b5964);});});} \ No newline at end of file +var _0x0c0b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3ed565,_0x30d9f3){var _0x1788c8=function(_0x14119e){while(--_0x14119e){_0x3ed565['push'](_0x3ed565['shift']());}};_0x1788c8(++_0x30d9f3);}(_0x0c0b,0x11d));var _0xb0c0=function(_0x25b3b8,_0x215b5a){_0x25b3b8=_0x25b3b8-0x0;var _0x1110bf=_0x0c0b[_0x25b3b8];return _0x1110bf;};'use strict';var _=require(_0xb0c0('0x0'));var util=require(_0xb0c0('0x1'));var moment=require(_0xb0c0('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0c0('0x3'));var fs=require('fs');var Redis=require(_0xb0c0('0x4'));var db=require(_0xb0c0('0x5'))['db'];var utils=require(_0xb0c0('0x6'));var logger=require(_0xb0c0('0x7'))(_0xb0c0('0x8'));var config=require(_0xb0c0('0x9'));var jayson=require(_0xb0c0('0xa'));var client=jayson['client'][_0xb0c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cb90,_0x567cac,_0x1f1611){return new BPromise(function(_0x4e74a8,_0x339139){return client['request'](_0x25cb90,_0x1f1611)[_0xb0c0('0xc')](function(_0x396d77){logger[_0xb0c0('0xd')](_0xb0c0('0xe'),_0x567cac,'request\x20sent');logger[_0xb0c0('0xf')](_0xb0c0('0x10'),_0x567cac,_0xb0c0('0x11'),JSON[_0xb0c0('0x12')](_0x396d77));if(_0x396d77['error']){if(_0x396d77[_0xb0c0('0x13')][_0xb0c0('0x14')]===0x1f4){logger[_0xb0c0('0x13')](_0xb0c0('0xe'),_0x567cac,_0x396d77['error'][_0xb0c0('0x15')]);return _0x339139(_0x396d77['error']['message']);}logger[_0xb0c0('0x13')](_0xb0c0('0xe'),_0x567cac,_0x396d77[_0xb0c0('0x13')][_0xb0c0('0x15')]);return _0x4e74a8(_0x396d77[_0xb0c0('0x13')][_0xb0c0('0x15')]);}else{logger[_0xb0c0('0xd')](_0xb0c0('0xe'),_0x567cac,'request\x20sent');_0x4e74a8(_0x396d77[_0xb0c0('0x16')]['message']);}})[_0xb0c0('0x17')](function(_0xdad1b3){logger[_0xb0c0('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x567cac,_0xdad1b3);_0x339139(_0xdad1b3);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6318bb9..32153f2 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 _0x93b9=['getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','diskStorage','logologin','post','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now'];(function(_0x224367,_0x3beb79){var _0x332760=function(_0x5617e4){while(--_0x5617e4){_0x224367['push'](_0x224367['shift']());}};_0x332760(++_0x3beb79);}(_0x93b9,0x7c));var _0x993b=function(_0x2962b4,_0x4b0786){_0x2962b4=_0x2962b4-0x0;var _0x411b7d=_0x93b9[_0x2962b4];return _0x411b7d;};'use strict';var multer=require(_0x993b('0x0'));var util=require('util');var path=require(_0x993b('0x1'));var timeout=require(_0x993b('0x2'));var express=require(_0x993b('0x3'));var router=express[_0x993b('0x4')]();var fs_extra=require(_0x993b('0x5'));var auth=require(_0x993b('0x6'));var interaction=require(_0x993b('0x7'));var config=require(_0x993b('0x8'));var controller=require(_0x993b('0x9'));router['get']('/',auth[_0x993b('0xa')](),controller[_0x993b('0xb')]);router[_0x993b('0xc')](_0x993b('0xd'),controller[_0x993b('0xe')]);router[_0x993b('0xc')](_0x993b('0xf'),controller[_0x993b('0x10')]);router['get'](_0x993b('0x11'),controller['getLogo']);router['get'](_0x993b('0x12'),controller[_0x993b('0x13')]);router[_0x993b('0xc')](_0x993b('0x14'),controller[_0x993b('0x15')]);router[_0x993b('0xc')](_0x993b('0x16'),controller[_0x993b('0x17')]);router[_0x993b('0xc')](_0x993b('0x18'),controller[_0x993b('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x282d77,_0x475bd3,_0x80d667){_0x80d667(null,path[_0x993b('0x1a')](config[_0x993b('0x1b')],_0x993b('0x1c')));},'filename':function(_0x3eb400,_0x59e53e,_0x3dbaf5){_0x3dbaf5(null,util[_0x993b('0x1d')](_0x993b('0x1e'),_0x993b('0x1f'),path[_0x993b('0x20')](_0x59e53e[_0x993b('0x21')])));}})});router['post']('/:id/logo',upload[_0x993b('0x22')](_0x993b('0x23')),controller['addLogo']);var upload=multer({'storage':multer[_0x993b('0x24')]({'destination':function(_0x249816,_0xade74e,_0x4f195b){_0x4f195b(null,path[_0x993b('0x1a')](config[_0x993b('0x1b')],_0x993b('0x1c')));},'filename':function(_0xb65504,_0xb2b87b,_0x77ae6a){_0x77ae6a(null,util['format'](_0x993b('0x1e'),_0x993b('0x25'),path[_0x993b('0x20')](_0xb2b87b[_0x993b('0x21')])));}})});router[_0x993b('0x26')](_0x993b('0x12'),upload['single'](_0x993b('0x23')),controller[_0x993b('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e4d52,_0x179c70,_0x260995){_0x260995(null,path['join'](config[_0x993b('0x1b')],_0x993b('0x1c')));},'filename':function(_0x185251,_0x356121,_0x3829b4){_0x3829b4(null,util[_0x993b('0x1d')](_0x993b('0x1e'),_0x993b('0x28'),path[_0x993b('0x20')](_0x356121['originalname'])));}})});router[_0x993b('0x26')](_0x993b('0x16'),upload[_0x993b('0x22')]('file'),controller[_0x993b('0x29')]);var upload=multer({'storage':multer[_0x993b('0x24')]({'destination':function(_0x54d6cb,_0x541ee7,_0x47f217){_0x47f217(null,path[_0x993b('0x1a')](config[_0x993b('0x1b')],'server/files/images/logos/'));},'filename':function(_0x3e938f,_0x399452,_0x4087f4){_0x4087f4(null,util[_0x993b('0x1d')](_0x993b('0x1e'),_0x993b('0x2a'),path['extname'](_0x399452[_0x993b('0x21')])));}})});router[_0x993b('0x26')](_0x993b('0x18'),upload[_0x993b('0x22')]('file'),controller['addFavicon']);router[_0x993b('0x2b')](_0x993b('0xf'),auth[_0x993b('0xa')](),controller[_0x993b('0x2c')]);module[_0x993b('0x2d')]=router; \ No newline at end of file +var _0xae68=['diskStorage','join','format','logo','extname','originalname','post','/:id/logo','single','addLogo','root','%s%s','logologin','/:id/logo_login','file','addLogoLogin','server/files/images/logos/','preferred','addFavicon','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','/:id','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon'];(function(_0x398074,_0xfe40bc){var _0x24eaa3=function(_0x26dd84){while(--_0x26dd84){_0x398074['push'](_0x398074['shift']());}};_0x24eaa3(++_0xfe40bc);}(_0xae68,0x6d));var _0x8ae6=function(_0x2009cd,_0x549a5d){_0x2009cd=_0x2009cd-0x0;var _0x509e8a=_0xae68[_0x2009cd];return _0x509e8a;};'use strict';var multer=require(_0x8ae6('0x0'));var util=require(_0x8ae6('0x1'));var path=require(_0x8ae6('0x2'));var timeout=require(_0x8ae6('0x3'));var express=require(_0x8ae6('0x4'));var router=express[_0x8ae6('0x5')]();var fs_extra=require(_0x8ae6('0x6'));var auth=require(_0x8ae6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ae6('0x8'));var controller=require(_0x8ae6('0x9'));router[_0x8ae6('0xa')]('/',auth[_0x8ae6('0xb')](),controller['index']);router['get']('/now',controller[_0x8ae6('0xc')]);router['get'](_0x8ae6('0xd'),controller[_0x8ae6('0xe')]);router[_0x8ae6('0xa')]('/:id/logo',controller[_0x8ae6('0xf')]);router[_0x8ae6('0xa')]('/:id/logo_login',controller[_0x8ae6('0x10')]);router[_0x8ae6('0xa')](_0x8ae6('0x11'),controller[_0x8ae6('0x12')]);router[_0x8ae6('0xa')](_0x8ae6('0x13'),controller[_0x8ae6('0x14')]);router[_0x8ae6('0xa')](_0x8ae6('0x15'),controller[_0x8ae6('0x16')]);var upload=multer({'storage':multer[_0x8ae6('0x17')]({'destination':function(_0x13ee43,_0xd48126,_0x5d8fab){_0x5d8fab(null,path[_0x8ae6('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1150d2,_0x320dd8,_0xc6a022){_0xc6a022(null,util[_0x8ae6('0x19')]('%s%s',_0x8ae6('0x1a'),path[_0x8ae6('0x1b')](_0x320dd8[_0x8ae6('0x1c')])));}})});router[_0x8ae6('0x1d')](_0x8ae6('0x1e'),upload[_0x8ae6('0x1f')]('file'),controller[_0x8ae6('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34b603,_0x223093,_0x5a17d5){_0x5a17d5(null,path[_0x8ae6('0x18')](config[_0x8ae6('0x21')],'server/files/images/logos/'));},'filename':function(_0x44b0f5,_0x3e8318,_0x8cd2dd){_0x8cd2dd(null,util[_0x8ae6('0x19')](_0x8ae6('0x22'),_0x8ae6('0x23'),path[_0x8ae6('0x1b')](_0x3e8318[_0x8ae6('0x1c')])));}})});router[_0x8ae6('0x1d')](_0x8ae6('0x24'),upload[_0x8ae6('0x1f')](_0x8ae6('0x25')),controller[_0x8ae6('0x26')]);var upload=multer({'storage':multer[_0x8ae6('0x17')]({'destination':function(_0x47d033,_0x1a25e2,_0x1265a4){_0x1265a4(null,path[_0x8ae6('0x18')](config[_0x8ae6('0x21')],_0x8ae6('0x27')));},'filename':function(_0x31ef80,_0x54ecb9,_0x947c81){_0x947c81(null,util[_0x8ae6('0x19')](_0x8ae6('0x22'),_0x8ae6('0x28'),path[_0x8ae6('0x1b')](_0x54ecb9['originalname'])));}})});router[_0x8ae6('0x1d')](_0x8ae6('0x13'),upload[_0x8ae6('0x1f')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x8ae6('0x17')]({'destination':function(_0x2d61bd,_0xbd6f32,_0x102b38){_0x102b38(null,path[_0x8ae6('0x18')](config[_0x8ae6('0x21')],'server/files/images/logos/'));},'filename':function(_0x29866d,_0x131319,_0x175d1d){_0x175d1d(null,util['format'](_0x8ae6('0x22'),'favicon',path[_0x8ae6('0x1b')](_0x131319[_0x8ae6('0x1c')])));}})});router[_0x8ae6('0x1d')](_0x8ae6('0x15'),upload[_0x8ae6('0x1f')]('file'),controller[_0x8ae6('0x29')]);router[_0x8ae6('0x2a')](_0x8ae6('0xd'),auth[_0x8ae6('0xb')](),controller['update']);module[_0x8ae6('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9ec1e33..1b8583a 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(_0x56d001,_0x1ad780){var _0x27773d=function(_0x153090){while(--_0x153090){_0x56d001['push'](_0x56d001['shift']());}};_0x27773d(++_0x1ad780);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x4a6872,_0x5a3aa4){var _0x24c175=function(_0x4ae6be){while(--_0x4ae6be){_0x4a6872['push'](_0x4a6872['shift']());}};_0x24c175(++_0x5a3aa4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 7912ea6..149eb2b 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 _0x3ffb=['count','limit','set','apply','reject','save','destroy','name','send','index','map','Setting','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','rows','show','params','keys','include','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLicense','default_loginLogo.svg','addPreferred','getPreferred','default_preferred.png','default','addFavicon','getFavicon','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ffb,0x13f));var _0xb3ff=function(_0x40e849,_0x4879bc){_0x40e849=_0x40e849-0x0;var _0x28602d=_0x3ffb[_0x40e849];return _0x28602d;};'use strict';var emlformat=require(_0xb3ff('0x0'));var rimraf=require(_0xb3ff('0x1'));var zipdir=require(_0xb3ff('0x2'));var jsonpatch=require(_0xb3ff('0x3'));var rp=require(_0xb3ff('0x4'));var moment=require('moment');var BPromise=require(_0xb3ff('0x5'));var Mustache=require(_0xb3ff('0x6'));var util=require(_0xb3ff('0x7'));var path=require(_0xb3ff('0x8'));var sox=require(_0xb3ff('0x9'));var csv=require(_0xb3ff('0xa'));var ejs=require(_0xb3ff('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3ff('0xc'));var squel=require(_0xb3ff('0xd'));var crypto=require(_0xb3ff('0xe'));var jsforce=require(_0xb3ff('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3ff('0x10'));var Papa=require(_0xb3ff('0x11'));var Redis=require(_0xb3ff('0x12'));var authService=require(_0xb3ff('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb3ff('0x14'));var hardwareService=require(_0xb3ff('0x15'));var logger=require('../../config/logger')(_0xb3ff('0x16'));var utils=require(_0xb3ff('0x17'));var config=require(_0xb3ff('0x18'));var licenseUtil=require(_0xb3ff('0x19'));var db=require(_0xb3ff('0x1a'))['db'];var jayson=require(_0xb3ff('0x1b'));var client=jayson[_0xb3ff('0x1c')][_0xb3ff('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x57056a,_0x2f548b,_0x2f8f65,_0x2db25a){return new BPromise(function(_0xb7cfa0,_0xb0c045){var _0xad770=_0x2db25a||client;return _0xad770['request'](_0x57056a,_0x2f8f65)[_0xb3ff('0x1e')](function(_0x4d8826){logger[_0xb3ff('0x1f')](_0xb3ff('0x20'),_0x2f548b,'request\x20sent');logger[_0xb3ff('0x21')](_0xb3ff('0x22'),_0x2f548b,_0xb3ff('0x23'),JSON[_0xb3ff('0x24')](_0x4d8826));if(_0x4d8826[_0xb3ff('0x25')]){if(_0x4d8826[_0xb3ff('0x25')][_0xb3ff('0x26')]===0x1f4){logger[_0xb3ff('0x25')]('Setting,\x20%s,\x20%s',_0x2f548b,_0x4d8826[_0xb3ff('0x25')]['message']);return _0xb0c045(_0x4d8826[_0xb3ff('0x25')]['message']);}logger[_0xb3ff('0x25')](_0xb3ff('0x20'),_0x2f548b,_0x4d8826['error'][_0xb3ff('0x27')]);return _0xb7cfa0(_0x4d8826[_0xb3ff('0x25')]['message']);}else{logger[_0xb3ff('0x1f')](_0xb3ff('0x20'),_0x2f548b,_0xb3ff('0x23'));_0xb7cfa0(_0x4d8826['result'][_0xb3ff('0x27')]);}})[_0xb3ff('0x28')](function(_0x4cfd0a){logger['error'](_0xb3ff('0x20'),_0x2f548b,_0x4cfd0a);_0xb0c045(_0x4cfd0a);});});}function respondWithStatusCode(_0x3d7b88,_0x3465be){_0x3465be=_0x3465be||0xcc;return function(_0x3056b9){if(_0x3056b9){return _0x3d7b88[_0xb3ff('0x29')](_0x3465be);}return _0x3d7b88[_0xb3ff('0x2a')](_0x3465be)[_0xb3ff('0x2b')]();};}function respondWithResult(_0x2dba59,_0x3f8017){_0x3f8017=_0x3f8017||0xc8;return function(_0x38f9ef){if(_0x38f9ef){return _0x2dba59[_0xb3ff('0x2a')](_0x3f8017)[_0xb3ff('0x2c')](_0x38f9ef);}};}function respondWithFilteredResult(_0x1d092d,_0x50a318){return function(_0x599f87){if(_0x599f87){var _0x22b4f6=typeof _0x50a318[_0xb3ff('0x2d')]==='undefined'&&typeof _0x50a318['limit']===_0xb3ff('0x2e');var _0x41369e=_0x599f87['count'];var _0x3466f2=_0x22b4f6?0x0:_0x50a318[_0xb3ff('0x2d')];var _0x1fb7ed=_0x22b4f6?_0x599f87[_0xb3ff('0x2f')]:_0x50a318[_0xb3ff('0x2d')]+_0x50a318[_0xb3ff('0x30')];var _0x341c9c;if(_0x1fb7ed>=_0x41369e){_0x1fb7ed=_0x41369e;_0x341c9c=0xc8;}else{_0x341c9c=0xce;}_0x1d092d[_0xb3ff('0x2a')](_0x341c9c);return _0x1d092d[_0xb3ff('0x31')]('Content-Range',_0x3466f2+'-'+_0x1fb7ed+'/'+_0x41369e)[_0xb3ff('0x2c')](_0x599f87);}return null;};}function patchUpdates(_0x2827eb){return function(_0x1f47f9){try{jsonpatch[_0xb3ff('0x32')](_0x1f47f9,_0x2827eb,!![]);}catch(_0x4ace33){return BPromise[_0xb3ff('0x33')](_0x4ace33);}return _0x1f47f9[_0xb3ff('0x34')]();};}function saveUpdates(_0x2c2059,_0x406870){return function(_0x5104d8){if(_0x5104d8){return _0x5104d8['update'](_0x2c2059)['then'](function(_0x2990e3){return _0x2990e3;});}return null;};}function removeEntity(_0x67f1a6,_0x11e7c6){return function(_0x3cefd4){if(_0x3cefd4){return _0x3cefd4[_0xb3ff('0x35')]()[_0xb3ff('0x1e')](function(){_0x67f1a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57adce,_0xcbfa6e){return function(_0x1bb717){if(!_0x1bb717){_0x57adce[_0xb3ff('0x29')](0x194);}return _0x1bb717;};}function handleError(_0x44addf,_0x503a31){_0x503a31=_0x503a31||0x1f4;return function(_0x37352a){logger[_0xb3ff('0x25')](_0x37352a['stack']);if(_0x37352a[_0xb3ff('0x36')]){delete _0x37352a[_0xb3ff('0x36')];}_0x44addf['status'](_0x503a31)[_0xb3ff('0x37')](_0x37352a);};}exports[_0xb3ff('0x38')]=function(_0xa67e66,_0x316ca3){var _0x49b156={},_0x5469ff={},_0xa98669={'count':0x0,'rows':[]};var _0x2f34aa=_[_0xb3ff('0x39')](db[_0xb3ff('0x3a')]['rawAttributes'],function(_0x3d70ab){return{'name':_0x3d70ab[_0xb3ff('0x3b')],'type':_0x3d70ab['type']['key']};});_0x5469ff[_0xb3ff('0x3c')]=_['map'](_0x2f34aa,'name');_0x5469ff[_0xb3ff('0x3d')]=_['keys'](_0xa67e66[_0xb3ff('0x3d')]);_0x5469ff['filters']=_[_0xb3ff('0x3e')](_0x5469ff[_0xb3ff('0x3c')],_0x5469ff[_0xb3ff('0x3d')]);_0x49b156[_0xb3ff('0x3f')]=_[_0xb3ff('0x3e')](_0x5469ff[_0xb3ff('0x3c')],qs['fields'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x40')]));_0x49b156[_0xb3ff('0x3f')]=_0x49b156['attributes'][_0xb3ff('0x41')]?_0x49b156[_0xb3ff('0x3f')]:_0x5469ff['model'];if(!_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x42')](_0xb3ff('0x43'))){_0x49b156[_0xb3ff('0x30')]=qs['limit'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x30')]);_0x49b156[_0xb3ff('0x2d')]=qs[_0xb3ff('0x2d')](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x2d')]);}_0x49b156['order']=qs['sort'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x44')]);_0x49b156[_0xb3ff('0x45')]=qs[_0xb3ff('0x46')](_[_0xb3ff('0x47')](_0xa67e66['query'],_0x5469ff[_0xb3ff('0x46')]),_0x2f34aa);if(_0xa67e66['query']['filter']){_0x49b156[_0xb3ff('0x45')]=_['merge'](_0x49b156[_0xb3ff('0x45')],{'$or':_[_0xb3ff('0x39')](_0x2f34aa,function(_0x28a021){if(_0x28a021['type']!==_0xb3ff('0x48')){var _0xc42e40={};_0xc42e40[_0x28a021[_0xb3ff('0x36')]]={'$like':'%'+_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x49')]+'%'};return _0xc42e40;}})});}_0x49b156=_['merge']({},_0x49b156,_0xa67e66[_0xb3ff('0x4a')]);var _0x4a23d1={'where':_0x49b156[_0xb3ff('0x45')]};return db['Setting'][_0xb3ff('0x2f')](_0x4a23d1)[_0xb3ff('0x1e')](function(_0x57e5e7){_0xa98669[_0xb3ff('0x2f')]=_0x57e5e7;if(_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x4b')]){_0x49b156['include']=[{'all':!![]}];}return db[_0xb3ff('0x3a')]['findAll'](_0x49b156);})[_0xb3ff('0x1e')](function(_0x89fc8a){_0xa98669[_0xb3ff('0x4c')]=_0x89fc8a;return _0xa98669;})[_0xb3ff('0x1e')](respondWithFilteredResult(_0x316ca3,_0x49b156))[_0xb3ff('0x28')](handleError(_0x316ca3,null));};exports[_0xb3ff('0x4d')]=function(_0x3253c4,_0x549b8a){var _0x206fea={'raw':![],'where':{'id':_0x3253c4[_0xb3ff('0x4e')]['id']}},_0x2eba0c={};_0x2eba0c[_0xb3ff('0x3c')]=_['keys'](db['Setting']['rawAttributes']);_0x2eba0c[_0xb3ff('0x3d')]=_[_0xb3ff('0x4f')](_0x3253c4[_0xb3ff('0x3d')]);_0x2eba0c[_0xb3ff('0x46')]=_['intersection'](_0x2eba0c[_0xb3ff('0x3c')],_0x2eba0c[_0xb3ff('0x3d')]);_0x206fea[_0xb3ff('0x3f')]=_[_0xb3ff('0x3e')](_0x2eba0c['model'],qs[_0xb3ff('0x40')](_0x3253c4[_0xb3ff('0x3d')][_0xb3ff('0x40')]));_0x206fea['attributes']=_0x206fea['attributes'][_0xb3ff('0x41')]?_0x206fea['attributes']:_0x2eba0c[_0xb3ff('0x3c')];if(_0x3253c4['query'][_0xb3ff('0x4b')]){_0x206fea[_0xb3ff('0x50')]=[{'all':!![]}];}_0x206fea=_['merge']({},_0x206fea,_0x3253c4[_0xb3ff('0x4a')]);return db[_0xb3ff('0x3a')][_0xb3ff('0x51')](_0x206fea)[_0xb3ff('0x1e')](handleEntityNotFound(_0x549b8a,null))['then'](respondWithResult(_0x549b8a,null))[_0xb3ff('0x28')](handleError(_0x549b8a,null));};exports[_0xb3ff('0x52')]=function(_0x5b2138,_0x5cdffd){if(_0x5b2138[_0xb3ff('0x53')]['id']){delete _0x5b2138['body']['id'];}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x5b2138[_0xb3ff('0x4e')]['id']}})[_0xb3ff('0x1e')](handleEntityNotFound(_0x5cdffd,null))[_0xb3ff('0x1e')](saveUpdates(_0x5b2138[_0xb3ff('0x53')],null))[_0xb3ff('0x1e')](respondWithResult(_0x5cdffd,null))['catch'](handleError(_0x5cdffd,null));};exports[_0xb3ff('0x54')]=function(_0xdcd869,_0x4d5aec,_0x17249b){if(_0xdcd869[_0xb3ff('0x55')]&&_0xdcd869[_0xb3ff('0x55')][_0xb3ff('0x56')]){_0xdcd869[_0xb3ff('0x53')][_0xb3ff('0x57')]=_0xdcd869[_0xb3ff('0x55')][_0xb3ff('0x56')];}return db[_0xb3ff('0x3a')]['find']({'where':{'id':_0xdcd869[_0xb3ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d5aec,null))[_0xb3ff('0x1e')](saveUpdates(_0xdcd869['body'],null))[_0xb3ff('0x1e')](respondWithResult(_0x4d5aec,null))[_0xb3ff('0x28')](handleError(_0x4d5aec,null));};exports[_0xb3ff('0x58')]=function(_0xc32f7,_0x3ca0a5,_0x5bee7f){if(_0xc32f7[_0xb3ff('0x55')]&&_0xc32f7['file'][_0xb3ff('0x56')]){_0xc32f7['body'][_0xb3ff('0x59')]=_0xc32f7['file']['filename'];}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0xc32f7[_0xb3ff('0x4e')]['id']}})[_0xb3ff('0x1e')](handleEntityNotFound(_0x3ca0a5,null))['then'](saveUpdates(_0xc32f7['body'],null))[_0xb3ff('0x1e')](respondWithResult(_0x3ca0a5,null))['catch'](handleError(_0x3ca0a5,null));};var utilLicense=require(_0xb3ff('0x19'));exports[_0xb3ff('0x5a')]=function(_0x2bf307,_0x41d7b0,_0x28c0ac){var _0x417cf8=_0xb3ff('0x5b');var _0x140a76={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x21426d){if(_0x21426d){_0x140a76=_0x21426d;}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x2bf307['params']['id']},'attributes':['logo','loginLogo',_0xb3ff('0x5c'),_0xb3ff('0x5d'),_0xb3ff('0x5e'),_0xb3ff('0x5f'),_0xb3ff('0x60'),_0xb3ff('0x61')],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0x41d7b0,null))['then'](function(_0x236622){if(_0x236622){var _0x1efec8=_0x236622[_0xb3ff('0x57')]&&fs[_0xb3ff('0x62')](path[_0xb3ff('0x63')](config['root'],_0x417cf8,_['toLower'](_0x236622[_0xb3ff('0x57')])))?path['join'](config[_0xb3ff('0x64')],_0x417cf8,_[_0xb3ff('0x65')](_0x236622[_0xb3ff('0x57')])):path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x417cf8,_['toLower'](_0xb3ff('0x66')));var _0x2123e7='default'+_[_0xb3ff('0x67')](_0xb3ff('0x57'));if(_0x236622[_0x2123e7]||!_0x140a76[_0xb3ff('0x68')]){_0x1efec8=path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x417cf8,_[_0xb3ff('0x65')]('default_logo.svg'));}if(!fs['existsSync'](_0x1efec8)){throw new db[(_0xb3ff('0x69'))][(_0xb3ff('0x6a'))](_['upperFirst'](_0xb3ff('0x57'))+_0xb3ff('0x6b'));}return _0x41d7b0[_0xb3ff('0x6c')](_0x1efec8);}})[_0xb3ff('0x28')](handleError(_0x41d7b0,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x5e210e,_0x72b470,_0x4593ce){var _0x82d465=_0xb3ff('0x5b');var _0x135565={'custom':![]};return utilLicense[_0xb3ff('0x6d')]()[_0xb3ff('0x1e')](function(_0x58edc2){if(_0x58edc2){_0x135565=_0x58edc2;}return db[_0xb3ff('0x3a')]['find']({'where':{'id':_0x5e210e[_0xb3ff('0x4e')]['id']},'attributes':['logo',_0xb3ff('0x59'),_0xb3ff('0x5c'),'favicon',_0xb3ff('0x5e'),_0xb3ff('0x5f'),_0xb3ff('0x60'),'defaultFavicon'],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0x72b470,null))[_0xb3ff('0x1e')](function(_0x291892){if(_0x291892){var _0x31f895=_0x291892['loginLogo']&&fs[_0xb3ff('0x62')](path['join'](config[_0xb3ff('0x64')],_0x82d465,_[_0xb3ff('0x65')](_0x291892[_0xb3ff('0x59')])))?path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x82d465,_[_0xb3ff('0x65')](_0x291892['loginLogo'])):path['join'](config[_0xb3ff('0x64')],_0x82d465,_['toLower'](_0xb3ff('0x6e')));var _0x4833aa='default'+_['upperFirst']('loginLogo');if(_0x291892[_0x4833aa]||!_0x135565[_0xb3ff('0x68')]){_0x31f895=path['join'](config[_0xb3ff('0x64')],_0x82d465,_[_0xb3ff('0x65')](_0xb3ff('0x6e')));}if(!fs['existsSync'](_0x31f895)){throw new db['Sequelize'][(_0xb3ff('0x6a'))](_[_0xb3ff('0x67')](_0xb3ff('0x59'))+'\x20not\x20found');}return _0x72b470[_0xb3ff('0x6c')](_0x31f895);}})[_0xb3ff('0x28')](handleError(_0x72b470,null));};exports['gdpr']=function(_0x301a5d,_0x551d4c){return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x301a5d['params']['id']},'attributes':['securePassword']})[_0xb3ff('0x1e')](respondWithResult(_0x551d4c,null))['catch'](handleError(_0x551d4c,null));};exports[_0xb3ff('0x6f')]=function(_0x229598,_0xb3d9b0,_0x439f54){if(_0x229598[_0xb3ff('0x55')]&&_0x229598['file'][_0xb3ff('0x56')]){_0x229598[_0xb3ff('0x53')][_0xb3ff('0x5c')]=_0x229598['file'][_0xb3ff('0x56')];}return db['Setting']['find']({'where':{'id':_0x229598[_0xb3ff('0x4e')]['id']}})[_0xb3ff('0x1e')](handleEntityNotFound(_0xb3d9b0,null))[_0xb3ff('0x1e')](saveUpdates(_0x229598[_0xb3ff('0x53')],null))[_0xb3ff('0x1e')](respondWithResult(_0xb3d9b0,null))['catch'](handleError(_0xb3d9b0,null));};var utilLicense=require('../../config/license/util');exports[_0xb3ff('0x70')]=function(_0x3eb7f4,_0x3d24fe,_0x3753c7){var _0x3c840f=_0xb3ff('0x5b');var _0x26cb0b={'custom':![]};return utilLicense[_0xb3ff('0x6d')]()[_0xb3ff('0x1e')](function(_0x6881da){if(_0x6881da){_0x26cb0b=_0x6881da;}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x3eb7f4[_0xb3ff('0x4e')]['id']},'attributes':[_0xb3ff('0x57'),'loginLogo',_0xb3ff('0x5c'),'favicon',_0xb3ff('0x5e'),_0xb3ff('0x5f'),_0xb3ff('0x60'),'defaultFavicon'],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0x3d24fe,null))[_0xb3ff('0x1e')](function(_0x3cc968){if(_0x3cc968){var _0x5139b4=_0x3cc968[_0xb3ff('0x5c')]&&fs[_0xb3ff('0x62')](path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_[_0xb3ff('0x65')](_0x3cc968[_0xb3ff('0x5c')])))?path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_['toLower'](_0x3cc968[_0xb3ff('0x5c')])):path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_[_0xb3ff('0x65')](_0xb3ff('0x71')));var _0xc2b35c=_0xb3ff('0x72')+_[_0xb3ff('0x67')](_0xb3ff('0x5c'));if(_0x3cc968[_0xc2b35c]||!_0x26cb0b[_0xb3ff('0x68')]||!_0x26cb0b[_0xb3ff('0x5c')]){_0x5139b4=path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_[_0xb3ff('0x65')](_0xb3ff('0x71')));}if(!fs[_0xb3ff('0x62')](_0x5139b4)){throw new db[(_0xb3ff('0x69'))][(_0xb3ff('0x6a'))](_[_0xb3ff('0x67')](_0xb3ff('0x5c'))+_0xb3ff('0x6b'));}return _0x3d24fe['download'](_0x5139b4);}})[_0xb3ff('0x28')](handleError(_0x3d24fe,null));};exports[_0xb3ff('0x73')]=function(_0x867e14,_0x2508e3,_0x10ff94){if(_0x867e14[_0xb3ff('0x55')]&&_0x867e14[_0xb3ff('0x55')][_0xb3ff('0x56')]){_0x867e14[_0xb3ff('0x53')][_0xb3ff('0x5d')]=_0x867e14[_0xb3ff('0x55')][_0xb3ff('0x56')];}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x867e14[_0xb3ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2508e3,null))['then'](saveUpdates(_0x867e14['body'],null))['then'](respondWithResult(_0x2508e3,null))[_0xb3ff('0x28')](handleError(_0x2508e3,null));};var utilLicense=require(_0xb3ff('0x19'));exports[_0xb3ff('0x74')]=function(_0x4b9adb,_0xb7a1be,_0xa34cd5){var _0x266239=_0xb3ff('0x5b');var _0x524395={'custom':![]};return utilLicense[_0xb3ff('0x6d')]()['then'](function(_0x43dbb9){if(_0x43dbb9){_0x524395=_0x43dbb9;}return db[_0xb3ff('0x3a')]['find']({'where':{'id':_0x4b9adb[_0xb3ff('0x4e')]['id']},'attributes':['logo','loginLogo',_0xb3ff('0x5c'),'favicon',_0xb3ff('0x5e'),_0xb3ff('0x5f'),'defaultPreferred',_0xb3ff('0x61')],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0xb7a1be,null))[_0xb3ff('0x1e')](function(_0x27d8e9){if(_0x27d8e9){var _0x2ae3c6=_0x27d8e9[_0xb3ff('0x5d')]&&fs[_0xb3ff('0x62')](path['join'](config[_0xb3ff('0x64')],_0x266239,_[_0xb3ff('0x65')](_0x27d8e9['favicon'])))?path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x266239,_[_0xb3ff('0x65')](_0x27d8e9[_0xb3ff('0x5d')])):path[_0xb3ff('0x63')](config['root'],_0x266239,_[_0xb3ff('0x65')]('default_favicon.ico'));var _0x15abe7='default'+_['upperFirst'](_0xb3ff('0x5d'));if(_0x27d8e9[_0x15abe7]||!_0x524395[_0xb3ff('0x68')]){_0x2ae3c6=path[_0xb3ff('0x63')](config['root'],_0x266239,_[_0xb3ff('0x65')]('default_favicon.ico'));}if(!fs['existsSync'](_0x2ae3c6)){throw new db[(_0xb3ff('0x69'))][(_0xb3ff('0x6a'))](_[_0xb3ff('0x67')](_0xb3ff('0x5d'))+_0xb3ff('0x6b'));}return _0xb7a1be[_0xb3ff('0x6c')](_0x2ae3c6);}})[_0xb3ff('0x28')](handleError(_0xb7a1be,null));};exports[_0xb3ff('0x75')]=function(_0x5cdae2,_0x2f8c2e){var _0x54080d={'offset':moment()['utcOffset']()};_0x54080d[_0xb3ff('0x76')]=moment()[_0xb3ff('0x77')](_0x54080d[_0xb3ff('0x2d')])[_0xb3ff('0x78')](_0xb3ff('0x79'));return _0x2f8c2e['status'](0xc8)[_0xb3ff('0x37')](_0x54080d);}; \ No newline at end of file +var _0x51ba=['fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','end','stack','name','send','index','map','Setting','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','options','catch','update','body','find','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','getLicense','preferred','default','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x51ba,0x169));var _0xa51b=function(_0x7a3275,_0x389205){_0x7a3275=_0x7a3275-0x0;var _0x3e3ff0=_0x51ba[_0x7a3275];return _0x3e3ff0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa51b('0x0'));var zipdir=require(_0xa51b('0x1'));var jsonpatch=require(_0xa51b('0x2'));var rp=require(_0xa51b('0x3'));var moment=require(_0xa51b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa51b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa51b('0x6'));var ejs=require(_0xa51b('0x7'));var fs=require('fs');var fs_extra=require(_0xa51b('0x8'));var _=require(_0xa51b('0x9'));var squel=require('squel');var crypto=require(_0xa51b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa51b('0x6'));var querystring=require(_0xa51b('0xb'));var Papa=require(_0xa51b('0xc'));var Redis=require(_0xa51b('0xd'));var authService=require(_0xa51b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa51b('0xf'));var hardwareService=require(_0xa51b('0x10'));var logger=require('../../config/logger')(_0xa51b('0x11'));var utils=require(_0xa51b('0x12'));var config=require(_0xa51b('0x13'));var licenseUtil=require(_0xa51b('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xa51b('0x15')][_0xa51b('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x4f70c6,_0x3e4451,_0x350a25,_0xe393af){return new BPromise(function(_0x51138c,_0x53551b){var _0x513306=_0xe393af||client;return _0x513306[_0xa51b('0x17')](_0x4f70c6,_0x350a25)[_0xa51b('0x18')](function(_0x1be308){logger['info'](_0xa51b('0x19'),_0x3e4451,_0xa51b('0x1a'));logger[_0xa51b('0x1b')](_0xa51b('0x1c'),_0x3e4451,_0xa51b('0x1a'),JSON[_0xa51b('0x1d')](_0x1be308));if(_0x1be308[_0xa51b('0x1e')]){if(_0x1be308[_0xa51b('0x1e')][_0xa51b('0x1f')]===0x1f4){logger[_0xa51b('0x1e')]('Setting,\x20%s,\x20%s',_0x3e4451,_0x1be308[_0xa51b('0x1e')][_0xa51b('0x20')]);return _0x53551b(_0x1be308['error'][_0xa51b('0x20')]);}logger[_0xa51b('0x1e')]('Setting,\x20%s,\x20%s',_0x3e4451,_0x1be308[_0xa51b('0x1e')]['message']);return _0x51138c(_0x1be308[_0xa51b('0x1e')][_0xa51b('0x20')]);}else{logger[_0xa51b('0x21')](_0xa51b('0x19'),_0x3e4451,_0xa51b('0x1a'));_0x51138c(_0x1be308[_0xa51b('0x22')][_0xa51b('0x20')]);}})['catch'](function(_0x4bdfae){logger[_0xa51b('0x1e')](_0xa51b('0x19'),_0x3e4451,_0x4bdfae);_0x53551b(_0x4bdfae);});});}function respondWithStatusCode(_0x3bf749,_0x2b77c7){_0x2b77c7=_0x2b77c7||0xcc;return function(_0xad35ee){if(_0xad35ee){return _0x3bf749[_0xa51b('0x23')](_0x2b77c7);}return _0x3bf749[_0xa51b('0x24')](_0x2b77c7)['end']();};}function respondWithResult(_0x13f859,_0x5d11e6){_0x5d11e6=_0x5d11e6||0xc8;return function(_0x406427){if(_0x406427){return _0x13f859['status'](_0x5d11e6)['json'](_0x406427);}};}function respondWithFilteredResult(_0x23dbff,_0x105b94){return function(_0x329d56){if(_0x329d56){var _0x4b22b4=typeof _0x105b94[_0xa51b('0x25')]===_0xa51b('0x26')&&typeof _0x105b94[_0xa51b('0x27')]===_0xa51b('0x26');var _0x38e966=_0x329d56[_0xa51b('0x28')];var _0x4d8c71=_0x4b22b4?0x0:_0x105b94[_0xa51b('0x25')];var _0x279407=_0x4b22b4?_0x329d56[_0xa51b('0x28')]:_0x105b94['offset']+_0x105b94[_0xa51b('0x27')];var _0xf4a2bc;if(_0x279407>=_0x38e966){_0x279407=_0x38e966;_0xf4a2bc=0xc8;}else{_0xf4a2bc=0xce;}_0x23dbff[_0xa51b('0x24')](_0xf4a2bc);return _0x23dbff[_0xa51b('0x29')](_0xa51b('0x2a'),_0x4d8c71+'-'+_0x279407+'/'+_0x38e966)[_0xa51b('0x2b')](_0x329d56);}return null;};}function patchUpdates(_0x3fd60b){return function(_0x390c99){try{jsonpatch[_0xa51b('0x2c')](_0x390c99,_0x3fd60b,!![]);}catch(_0x38d0ec){return BPromise[_0xa51b('0x2d')](_0x38d0ec);}return _0x390c99[_0xa51b('0x2e')]();};}function saveUpdates(_0xc9e94d,_0x581420){return function(_0x5b4adf){if(_0x5b4adf){return _0x5b4adf['update'](_0xc9e94d)[_0xa51b('0x18')](function(_0x353502){return _0x353502;});}return null;};}function removeEntity(_0x19dc6e,_0x2a50c6){return function(_0x10198a){if(_0x10198a){return _0x10198a[_0xa51b('0x2f')]()['then'](function(){_0x19dc6e[_0xa51b('0x24')](0xcc)[_0xa51b('0x30')]();});}};}function handleEntityNotFound(_0x4ead93,_0x3c41cd){return function(_0x195184){if(!_0x195184){_0x4ead93[_0xa51b('0x23')](0x194);}return _0x195184;};}function handleError(_0x2bd005,_0x558fc3){_0x558fc3=_0x558fc3||0x1f4;return function(_0x586847){logger[_0xa51b('0x1e')](_0x586847[_0xa51b('0x31')]);if(_0x586847[_0xa51b('0x32')]){delete _0x586847[_0xa51b('0x32')];}_0x2bd005[_0xa51b('0x24')](_0x558fc3)[_0xa51b('0x33')](_0x586847);};}exports[_0xa51b('0x34')]=function(_0x56c957,_0x5b3d5b){var _0x5b52e1={},_0x17cef3={},_0x3aa4d6={'count':0x0,'rows':[]};var _0x40b0d3=_[_0xa51b('0x35')](db[_0xa51b('0x36')][_0xa51b('0x37')],function(_0x5d26f1){return{'name':_0x5d26f1['fieldName'],'type':_0x5d26f1[_0xa51b('0x38')]['key']};});_0x17cef3[_0xa51b('0x39')]=_[_0xa51b('0x35')](_0x40b0d3,_0xa51b('0x32'));_0x17cef3[_0xa51b('0x3a')]=_[_0xa51b('0x3b')](_0x56c957[_0xa51b('0x3a')]);_0x17cef3[_0xa51b('0x3c')]=_[_0xa51b('0x3d')](_0x17cef3['model'],_0x17cef3[_0xa51b('0x3a')]);_0x5b52e1[_0xa51b('0x3e')]=_[_0xa51b('0x3d')](_0x17cef3[_0xa51b('0x39')],qs[_0xa51b('0x3f')](_0x56c957[_0xa51b('0x3a')]['fields']));_0x5b52e1[_0xa51b('0x3e')]=_0x5b52e1[_0xa51b('0x3e')][_0xa51b('0x40')]?_0x5b52e1['attributes']:_0x17cef3['model'];if(!_0x56c957[_0xa51b('0x3a')][_0xa51b('0x41')](_0xa51b('0x42'))){_0x5b52e1[_0xa51b('0x27')]=qs[_0xa51b('0x27')](_0x56c957[_0xa51b('0x3a')][_0xa51b('0x27')]);_0x5b52e1[_0xa51b('0x25')]=qs[_0xa51b('0x25')](_0x56c957[_0xa51b('0x3a')][_0xa51b('0x25')]);}_0x5b52e1['order']=qs[_0xa51b('0x43')](_0x56c957['query']['sort']);_0x5b52e1[_0xa51b('0x44')]=qs[_0xa51b('0x3c')](_[_0xa51b('0x45')](_0x56c957['query'],_0x17cef3['filters']),_0x40b0d3);if(_0x56c957[_0xa51b('0x3a')]['filter']){_0x5b52e1['where']=_['merge'](_0x5b52e1[_0xa51b('0x44')],{'$or':_[_0xa51b('0x35')](_0x40b0d3,function(_0x521417){if(_0x521417[_0xa51b('0x38')]!=='VIRTUAL'){var _0x400f8e={};_0x400f8e[_0x521417[_0xa51b('0x32')]]={'$like':'%'+_0x56c957[_0xa51b('0x3a')][_0xa51b('0x46')]+'%'};return _0x400f8e;}})});}_0x5b52e1=_[_0xa51b('0x47')]({},_0x5b52e1,_0x56c957['options']);var _0x1638d1={'where':_0x5b52e1[_0xa51b('0x44')]};return db['Setting'][_0xa51b('0x28')](_0x1638d1)[_0xa51b('0x18')](function(_0x3b5106){_0x3aa4d6[_0xa51b('0x28')]=_0x3b5106;if(_0x56c957['query'][_0xa51b('0x48')]){_0x5b52e1[_0xa51b('0x49')]=[{'all':!![]}];}return db[_0xa51b('0x36')][_0xa51b('0x4a')](_0x5b52e1);})[_0xa51b('0x18')](function(_0x26af5f){_0x3aa4d6['rows']=_0x26af5f;return _0x3aa4d6;})[_0xa51b('0x18')](respondWithFilteredResult(_0x5b3d5b,_0x5b52e1))['catch'](handleError(_0x5b3d5b,null));};exports[_0xa51b('0x4b')]=function(_0x21f5e8,_0x584bdf){var _0x39b66b={'raw':![],'where':{'id':_0x21f5e8['params']['id']}},_0x48ee1f={};_0x48ee1f[_0xa51b('0x39')]=_[_0xa51b('0x3b')](db[_0xa51b('0x36')]['rawAttributes']);_0x48ee1f[_0xa51b('0x3a')]=_[_0xa51b('0x3b')](_0x21f5e8[_0xa51b('0x3a')]);_0x48ee1f['filters']=_[_0xa51b('0x3d')](_0x48ee1f[_0xa51b('0x39')],_0x48ee1f[_0xa51b('0x3a')]);_0x39b66b[_0xa51b('0x3e')]=_[_0xa51b('0x3d')](_0x48ee1f[_0xa51b('0x39')],qs[_0xa51b('0x3f')](_0x21f5e8['query'][_0xa51b('0x3f')]));_0x39b66b[_0xa51b('0x3e')]=_0x39b66b['attributes'][_0xa51b('0x40')]?_0x39b66b[_0xa51b('0x3e')]:_0x48ee1f[_0xa51b('0x39')];if(_0x21f5e8['query'][_0xa51b('0x48')]){_0x39b66b[_0xa51b('0x49')]=[{'all':!![]}];}_0x39b66b=_[_0xa51b('0x47')]({},_0x39b66b,_0x21f5e8[_0xa51b('0x4c')]);return db['Setting']['find'](_0x39b66b)[_0xa51b('0x18')](handleEntityNotFound(_0x584bdf,null))[_0xa51b('0x18')](respondWithResult(_0x584bdf,null))[_0xa51b('0x4d')](handleError(_0x584bdf,null));};exports[_0xa51b('0x4e')]=function(_0x32b33a,_0x8734c4){if(_0x32b33a[_0xa51b('0x4f')]['id']){delete _0x32b33a['body']['id'];}return db[_0xa51b('0x36')][_0xa51b('0x50')]({'where':{'id':_0x32b33a[_0xa51b('0x51')]['id']}})[_0xa51b('0x18')](handleEntityNotFound(_0x8734c4,null))[_0xa51b('0x18')](saveUpdates(_0x32b33a[_0xa51b('0x4f')],null))['then'](respondWithResult(_0x8734c4,null))[_0xa51b('0x4d')](handleError(_0x8734c4,null));};exports[_0xa51b('0x52')]=function(_0xe67118,_0x487843,_0x358d44){if(_0xe67118['file']&&_0xe67118[_0xa51b('0x53')][_0xa51b('0x54')]){_0xe67118[_0xa51b('0x4f')][_0xa51b('0x55')]=_0xe67118['file'][_0xa51b('0x54')];}return db['Setting'][_0xa51b('0x50')]({'where':{'id':_0xe67118['params']['id']}})[_0xa51b('0x18')](handleEntityNotFound(_0x487843,null))[_0xa51b('0x18')](saveUpdates(_0xe67118[_0xa51b('0x4f')],null))[_0xa51b('0x18')](respondWithResult(_0x487843,null))['catch'](handleError(_0x487843,null));};exports[_0xa51b('0x56')]=function(_0xda7503,_0x1d6392,_0xf9dde){if(_0xda7503[_0xa51b('0x53')]&&_0xda7503[_0xa51b('0x53')][_0xa51b('0x54')]){_0xda7503[_0xa51b('0x4f')][_0xa51b('0x57')]=_0xda7503[_0xa51b('0x53')][_0xa51b('0x54')];}return db[_0xa51b('0x36')]['find']({'where':{'id':_0xda7503[_0xa51b('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d6392,null))[_0xa51b('0x18')](saveUpdates(_0xda7503[_0xa51b('0x4f')],null))[_0xa51b('0x18')](respondWithResult(_0x1d6392,null))[_0xa51b('0x4d')](handleError(_0x1d6392,null));};var utilLicense=require(_0xa51b('0x14'));exports[_0xa51b('0x58')]=function(_0x5ad2ad,_0x346c54,_0x17ca2c){var _0x22e017=_0xa51b('0x59');var _0x773f05={'custom':![]};return utilLicense['getLicense']()[_0xa51b('0x18')](function(_0x4f0eec){if(_0x4f0eec){_0x773f05=_0x4f0eec;}return db['Setting']['find']({'where':{'id':_0x5ad2ad[_0xa51b('0x51')]['id']},'attributes':[_0xa51b('0x55'),_0xa51b('0x57'),'preferred',_0xa51b('0x5a'),_0xa51b('0x5b'),_0xa51b('0x5c'),_0xa51b('0x5d'),_0xa51b('0x5e')],'raw':!![]});})[_0xa51b('0x18')](handleEntityNotFound(_0x346c54,null))[_0xa51b('0x18')](function(_0x5395ae){if(_0x5395ae){var _0x24e66f=_0x5395ae['logo']&&fs[_0xa51b('0x5f')](path['join'](config[_0xa51b('0x60')],_0x22e017,_[_0xa51b('0x61')](_0x5395ae[_0xa51b('0x55')])))?path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x22e017,_[_0xa51b('0x61')](_0x5395ae['logo'])):path['join'](config['root'],_0x22e017,_['toLower'](_0xa51b('0x63')));var _0x261790='default'+_[_0xa51b('0x64')](_0xa51b('0x55'));if(_0x5395ae[_0x261790]||!_0x773f05[_0xa51b('0x65')]){_0x24e66f=path[_0xa51b('0x62')](config['root'],_0x22e017,_[_0xa51b('0x61')](_0xa51b('0x63')));}if(!fs['existsSync'](_0x24e66f)){throw new db[(_0xa51b('0x66'))][(_0xa51b('0x67'))](_[_0xa51b('0x64')](_0xa51b('0x55'))+'\x20not\x20found');}return _0x346c54[_0xa51b('0x68')](_0x24e66f);}})['catch'](handleError(_0x346c54,null));};var utilLicense=require(_0xa51b('0x14'));exports[_0xa51b('0x69')]=function(_0x290126,_0xc6141e,_0x2116ce){var _0x1f51d9=_0xa51b('0x59');var _0x2dace4={'custom':![]};return utilLicense[_0xa51b('0x6a')]()['then'](function(_0x540662){if(_0x540662){_0x2dace4=_0x540662;}return db[_0xa51b('0x36')]['find']({'where':{'id':_0x290126['params']['id']},'attributes':['logo',_0xa51b('0x57'),_0xa51b('0x6b'),_0xa51b('0x5a'),_0xa51b('0x5b'),_0xa51b('0x5c'),_0xa51b('0x5d'),'defaultFavicon'],'raw':!![]});})[_0xa51b('0x18')](handleEntityNotFound(_0xc6141e,null))[_0xa51b('0x18')](function(_0x44d2e1){if(_0x44d2e1){var _0x261a94=_0x44d2e1[_0xa51b('0x57')]&&fs[_0xa51b('0x5f')](path[_0xa51b('0x62')](config['root'],_0x1f51d9,_[_0xa51b('0x61')](_0x44d2e1[_0xa51b('0x57')])))?path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x1f51d9,_[_0xa51b('0x61')](_0x44d2e1['loginLogo'])):path['join'](config[_0xa51b('0x60')],_0x1f51d9,_[_0xa51b('0x61')]('default_loginLogo.svg'));var _0x10129c=_0xa51b('0x6c')+_[_0xa51b('0x64')]('loginLogo');if(_0x44d2e1[_0x10129c]||!_0x2dace4[_0xa51b('0x65')]){_0x261a94=path['join'](config[_0xa51b('0x60')],_0x1f51d9,_['toLower'](_0xa51b('0x6d')));}if(!fs[_0xa51b('0x5f')](_0x261a94)){throw new db[(_0xa51b('0x66'))][(_0xa51b('0x67'))](_[_0xa51b('0x64')](_0xa51b('0x57'))+_0xa51b('0x6e'));}return _0xc6141e[_0xa51b('0x68')](_0x261a94);}})[_0xa51b('0x4d')](handleError(_0xc6141e,null));};exports[_0xa51b('0x6f')]=function(_0x3c5eae,_0x12f1b9){return db[_0xa51b('0x36')][_0xa51b('0x50')]({'where':{'id':_0x3c5eae[_0xa51b('0x51')]['id']},'attributes':[_0xa51b('0x70')]})[_0xa51b('0x18')](respondWithResult(_0x12f1b9,null))[_0xa51b('0x4d')](handleError(_0x12f1b9,null));};exports[_0xa51b('0x71')]=function(_0xfa4bbd,_0x20d2e0,_0x1c92dd){if(_0xfa4bbd['file']&&_0xfa4bbd[_0xa51b('0x53')][_0xa51b('0x54')]){_0xfa4bbd['body'][_0xa51b('0x6b')]=_0xfa4bbd[_0xa51b('0x53')]['filename'];}return db[_0xa51b('0x36')][_0xa51b('0x50')]({'where':{'id':_0xfa4bbd['params']['id']}})['then'](handleEntityNotFound(_0x20d2e0,null))['then'](saveUpdates(_0xfa4bbd[_0xa51b('0x4f')],null))[_0xa51b('0x18')](respondWithResult(_0x20d2e0,null))[_0xa51b('0x4d')](handleError(_0x20d2e0,null));};var utilLicense=require(_0xa51b('0x14'));exports[_0xa51b('0x72')]=function(_0x4f9de7,_0x4f9255,_0x26b2c6){var _0x1da215=_0xa51b('0x59');var _0x536c21={'custom':![]};return utilLicense[_0xa51b('0x6a')]()[_0xa51b('0x18')](function(_0x1ee5dd){if(_0x1ee5dd){_0x536c21=_0x1ee5dd;}return db['Setting'][_0xa51b('0x50')]({'where':{'id':_0x4f9de7['params']['id']},'attributes':[_0xa51b('0x55'),_0xa51b('0x57'),_0xa51b('0x6b'),_0xa51b('0x5a'),_0xa51b('0x5b'),'defaultLoginLogo',_0xa51b('0x5d'),'defaultFavicon'],'raw':!![]});})[_0xa51b('0x18')](handleEntityNotFound(_0x4f9255,null))[_0xa51b('0x18')](function(_0xe6618c){if(_0xe6618c){var _0x379c5d=_0xe6618c['preferred']&&fs[_0xa51b('0x5f')](path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x1da215,_['toLower'](_0xe6618c[_0xa51b('0x6b')])))?path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x1da215,_['toLower'](_0xe6618c[_0xa51b('0x6b')])):path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x1da215,_['toLower'](_0xa51b('0x73')));var _0x6d6e1=_0xa51b('0x6c')+_[_0xa51b('0x64')](_0xa51b('0x6b'));if(_0xe6618c[_0x6d6e1]||!_0x536c21['custom']||!_0x536c21['preferred']){_0x379c5d=path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x1da215,_[_0xa51b('0x61')](_0xa51b('0x73')));}if(!fs['existsSync'](_0x379c5d)){throw new db[(_0xa51b('0x66'))][(_0xa51b('0x67'))](_[_0xa51b('0x64')](_0xa51b('0x6b'))+'\x20not\x20found');}return _0x4f9255[_0xa51b('0x68')](_0x379c5d);}})[_0xa51b('0x4d')](handleError(_0x4f9255,null));};exports[_0xa51b('0x74')]=function(_0x1fa13a,_0x5a1848,_0x2adc7f){if(_0x1fa13a[_0xa51b('0x53')]&&_0x1fa13a['file'][_0xa51b('0x54')]){_0x1fa13a[_0xa51b('0x4f')][_0xa51b('0x5a')]=_0x1fa13a['file'][_0xa51b('0x54')];}return db[_0xa51b('0x36')][_0xa51b('0x50')]({'where':{'id':_0x1fa13a[_0xa51b('0x51')]['id']}})[_0xa51b('0x18')](handleEntityNotFound(_0x5a1848,null))[_0xa51b('0x18')](saveUpdates(_0x1fa13a['body'],null))[_0xa51b('0x18')](respondWithResult(_0x5a1848,null))[_0xa51b('0x4d')](handleError(_0x5a1848,null));};var utilLicense=require(_0xa51b('0x14'));exports[_0xa51b('0x75')]=function(_0x9555aa,_0x52eedc,_0x1a139d){var _0x3af6e6='server/files/images/logos';var _0x4edc7b={'custom':![]};return utilLicense[_0xa51b('0x6a')]()[_0xa51b('0x18')](function(_0x56020e){if(_0x56020e){_0x4edc7b=_0x56020e;}return db[_0xa51b('0x36')][_0xa51b('0x50')]({'where':{'id':_0x9555aa['params']['id']},'attributes':[_0xa51b('0x55'),_0xa51b('0x57'),'preferred','favicon',_0xa51b('0x5b'),_0xa51b('0x5c'),_0xa51b('0x5d'),_0xa51b('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x52eedc,null))[_0xa51b('0x18')](function(_0x48f90e){if(_0x48f90e){var _0x3407a5=_0x48f90e[_0xa51b('0x5a')]&&fs[_0xa51b('0x5f')](path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x3af6e6,_[_0xa51b('0x61')](_0x48f90e['favicon'])))?path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x3af6e6,_[_0xa51b('0x61')](_0x48f90e[_0xa51b('0x5a')])):path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x3af6e6,_['toLower']('default_favicon.ico'));var _0x59730e=_0xa51b('0x6c')+_[_0xa51b('0x64')](_0xa51b('0x5a'));if(_0x48f90e[_0x59730e]||!_0x4edc7b[_0xa51b('0x65')]){_0x3407a5=path[_0xa51b('0x62')](config[_0xa51b('0x60')],_0x3af6e6,_[_0xa51b('0x61')](_0xa51b('0x76')));}if(!fs[_0xa51b('0x5f')](_0x3407a5)){throw new db['Sequelize'][(_0xa51b('0x67'))](_['upperFirst'](_0xa51b('0x5a'))+_0xa51b('0x6e'));}return _0x52eedc['download'](_0x3407a5);}})[_0xa51b('0x4d')](handleError(_0x52eedc,null));};exports[_0xa51b('0x77')]=function(_0x41f315,_0x23faac){var _0x329c98={'offset':moment()['utcOffset']()};_0x329c98[_0xa51b('0x78')]=moment()[_0xa51b('0x79')](_0x329c98['offset'])['format'](_0xa51b('0x7a'));return _0x23faac[_0xa51b('0x24')](0xc8)['send'](_0x329c98);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 3fc4866..dc72d20 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x243c99,_0x1fa5cc){var _0x13efac=function(_0x475b56){while(--_0x475b56){_0x243c99['push'](_0x243c99['shift']());}};_0x13efac(++_0x1fa5cc);}(_0x3e74,0x175));var _0x43e7=function(_0x178a9f,_0x3a7361){_0x178a9f=_0x178a9f-0x0;var _0x4fe443=_0x3e74[_0x178a9f];return _0x4fe443;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x157c81,_0x2c0224){var _0x1bfb12=function(_0x4b5c5b){while(--_0x4b5c5b){_0x157c81['push'](_0x157c81['shift']());}};_0x1bfb12(++_0x2c0224);}(_0x3e74,0x175));var _0x43e7=function(_0x5ac6c,_0x322a30){_0x5ac6c=_0x5ac6c-0x0;var _0x4cb64a=_0x3e74[_0x5ac6c];return _0x4cb64a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 8556527..2cd2db1 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 _0xb153=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment'];(function(_0xa8ae1f,_0x5cd40e){var _0x1dfaac=function(_0x5ef72a){while(--_0x5ef72a){_0xa8ae1f['push'](_0xa8ae1f['shift']());}};_0x1dfaac(++_0x5cd40e);}(_0xb153,0x13d));var _0x3b15=function(_0x425910,_0x50470c){_0x425910=_0x425910-0x0;var _0x1b95c6=_0xb153[_0x425910];return _0x1b95c6;};'use strict';var _=require(_0x3b15('0x0'));var util=require(_0x3b15('0x1'));var moment=require(_0x3b15('0x2'));var BPromise=require(_0x3b15('0x3'));var rs=require(_0x3b15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b15('0x5'))['db'];var utils=require(_0x3b15('0x6'));var logger=require('../../config/logger')(_0x3b15('0x7'));var config=require(_0x3b15('0x8'));var jayson=require(_0x3b15('0x9'));var client=jayson[_0x3b15('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf40b76,_0x428c74,_0x483ce6){return new BPromise(function(_0x3a64a4,_0x1ea93f){return client[_0x3b15('0xb')](_0xf40b76,_0x483ce6)[_0x3b15('0xc')](function(_0x139b20){logger[_0x3b15('0xd')](_0x3b15('0xe'),_0x428c74,_0x3b15('0xf'));logger[_0x3b15('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x428c74,_0x3b15('0xf'),JSON[_0x3b15('0x11')](_0x139b20));if(_0x139b20[_0x3b15('0x12')]){if(_0x139b20['error'][_0x3b15('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x428c74,_0x139b20[_0x3b15('0x12')]['message']);return _0x1ea93f(_0x139b20[_0x3b15('0x12')]['message']);}logger[_0x3b15('0x12')](_0x3b15('0xe'),_0x428c74,_0x139b20[_0x3b15('0x12')][_0x3b15('0x14')]);return _0x3a64a4(_0x139b20[_0x3b15('0x12')]['message']);}else{logger[_0x3b15('0xd')](_0x3b15('0xe'),_0x428c74,'request\x20sent');_0x3a64a4(_0x139b20[_0x3b15('0x15')][_0x3b15('0x14')]);}})['catch'](function(_0x27839a){logger[_0x3b15('0x12')](_0x3b15('0xe'),_0x428c74,_0x27839a);_0x1ea93f(_0x27839a);});});}exports[_0x3b15('0x16')]=function(_0x450e5a){var _0x6fdf05=this;return new Promise(function(_0x15c395,_0x2fee0a){return db[_0x3b15('0x17')][_0x3b15('0x18')]({'raw':_0x450e5a[_0x3b15('0x19')]?_0x450e5a[_0x3b15('0x19')][_0x3b15('0x1a')]===undefined?!![]:![]:!![],'where':_0x450e5a['options']?_0x450e5a['options'][_0x3b15('0x1b')]||null:null,'attributes':_0x450e5a[_0x3b15('0x19')]?_0x450e5a[_0x3b15('0x19')][_0x3b15('0x1c')]||null:null,'include':_0x450e5a[_0x3b15('0x19')]?_0x450e5a['options'][_0x3b15('0x1d')]?_[_0x3b15('0x1e')](_0x450e5a[_0x3b15('0x19')][_0x3b15('0x1d')],function(_0x10e87a){return{'model':db[_0x10e87a[_0x3b15('0x1f')]],'as':_0x10e87a['as'],'attributes':_0x10e87a['attributes'],'include':_0x10e87a['include']?_[_0x3b15('0x1e')](_0x10e87a[_0x3b15('0x1d')],function(_0x616938){return{'model':db[_0x616938[_0x3b15('0x1f')]],'as':_0x616938['as'],'attributes':_0x616938[_0x3b15('0x1c')],'include':_0x616938[_0x3b15('0x1d')]?_[_0x3b15('0x1e')](_0x616938[_0x3b15('0x1d')],function(_0x406ce7){return{'model':db[_0x406ce7[_0x3b15('0x1f')]],'as':_0x406ce7['as'],'attributes':_0x406ce7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed9d3){logger['info'](_0x3b15('0x16'),_0x450e5a);logger['debug'](_0x3b15('0x16'),_0x450e5a,JSON[_0x3b15('0x11')](_0x1ed9d3));_0x15c395(_0x1ed9d3);})['catch'](function(_0x4bcc13){logger[_0x3b15('0x12')](_0x3b15('0x16'),_0x4bcc13[_0x3b15('0x14')],_0x450e5a);_0x2fee0a(_0x6fdf05['error'](0x1f4,_0x4bcc13[_0x3b15('0x14')]));});});}; \ No newline at end of file +var _0xe759=['ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch'];(function(_0x3f40f0,_0xb9f7dd){var _0x4371f6=function(_0x138699){while(--_0x138699){_0x3f40f0['push'](_0x3f40f0['shift']());}};_0x4371f6(++_0xb9f7dd);}(_0xe759,0x1eb));var _0x9e75=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe759[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x9e75('0x0'));var util=require(_0x9e75('0x1'));var moment=require(_0x9e75('0x2'));var BPromise=require(_0x9e75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e75('0x4'));var db=require(_0x9e75('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e75('0x6'))(_0x9e75('0x7'));var config=require(_0x9e75('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e75('0x9')][_0x9e75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x73c0c4,_0x47caaf,_0x45271e){return new BPromise(function(_0x4d687a,_0xc743f0){return client[_0x9e75('0xb')](_0x73c0c4,_0x45271e)[_0x9e75('0xc')](function(_0x124df7){logger[_0x9e75('0xd')](_0x9e75('0xe'),_0x47caaf,'request\x20sent');logger[_0x9e75('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x47caaf,_0x9e75('0x10'),JSON['stringify'](_0x124df7));if(_0x124df7[_0x9e75('0x11')]){if(_0x124df7['error'][_0x9e75('0x12')]===0x1f4){logger['error'](_0x9e75('0xe'),_0x47caaf,_0x124df7[_0x9e75('0x11')][_0x9e75('0x13')]);return _0xc743f0(_0x124df7[_0x9e75('0x11')][_0x9e75('0x13')]);}logger['error'](_0x9e75('0xe'),_0x47caaf,_0x124df7[_0x9e75('0x11')][_0x9e75('0x13')]);return _0x4d687a(_0x124df7[_0x9e75('0x11')][_0x9e75('0x13')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x47caaf,_0x9e75('0x10'));_0x4d687a(_0x124df7['result'][_0x9e75('0x13')]);}})[_0x9e75('0x14')](function(_0x5d4674){logger[_0x9e75('0x11')](_0x9e75('0xe'),_0x47caaf,_0x5d4674);_0xc743f0(_0x5d4674);});});}exports[_0x9e75('0x15')]=function(_0x2838aa){var _0x218508=this;return new Promise(function(_0x200595,_0x111b59){return db[_0x9e75('0x16')][_0x9e75('0x17')]({'raw':_0x2838aa[_0x9e75('0x18')]?_0x2838aa['options'][_0x9e75('0x19')]===undefined?!![]:![]:!![],'where':_0x2838aa[_0x9e75('0x18')]?_0x2838aa[_0x9e75('0x18')][_0x9e75('0x1a')]||null:null,'attributes':_0x2838aa[_0x9e75('0x18')]?_0x2838aa[_0x9e75('0x18')][_0x9e75('0x1b')]||null:null,'include':_0x2838aa[_0x9e75('0x18')]?_0x2838aa[_0x9e75('0x18')][_0x9e75('0x1c')]?_['map'](_0x2838aa[_0x9e75('0x18')][_0x9e75('0x1c')],function(_0x30b15d){return{'model':db[_0x30b15d[_0x9e75('0x1d')]],'as':_0x30b15d['as'],'attributes':_0x30b15d[_0x9e75('0x1b')],'include':_0x30b15d[_0x9e75('0x1c')]?_['map'](_0x30b15d[_0x9e75('0x1c')],function(_0x5a545d){return{'model':db[_0x5a545d[_0x9e75('0x1d')]],'as':_0x5a545d['as'],'attributes':_0x5a545d['attributes'],'include':_0x5a545d['include']?_[_0x9e75('0x1e')](_0x5a545d['include'],function(_0x27e62c){return{'model':db[_0x27e62c[_0x9e75('0x1d')]],'as':_0x27e62c['as'],'attributes':_0x27e62c[_0x9e75('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9e75('0xc')](function(_0x11914d){logger[_0x9e75('0xd')]('ShowSetting',_0x2838aa);logger['debug'](_0x9e75('0x15'),_0x2838aa,JSON[_0x9e75('0x1f')](_0x11914d));_0x200595(_0x11914d);})[_0x9e75('0x14')](function(_0x4a492f){logger[_0x9e75('0x11')](_0x9e75('0x15'),_0x4a492f[_0x9e75('0x13')],_0x2838aa);_0x111b59(_0x218508[_0x9e75('0x11')](0x1f4,_0x4a492f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index ddeb7fc..b3a2a21 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 _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x1b470a,_0x17af22){var _0x4e0446=function(_0x656886){while(--_0x656886){_0x1b470a['push'](_0x1b470a['shift']());}};_0x4e0446(++_0x17af22);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x224c7d,_0x361e07){var _0x533746=function(_0x4206b5){while(--_0x4206b5){_0x224c7d['push'](_0x224c7d['shift']());}};_0x533746(++_0x361e07);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2a955e,_0x2bf1fc){_0x2a955e=_0x2a955e-0x0;var _0xf9770d=_0x8ef6[_0x2a955e];return _0xf9770d;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index a985164..d29259f 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 _0x7167=['STRING','generate','twilio','skebby','clicksend','plivo','clickatell','csc','infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name'];(function(_0x3caae0,_0x59b01e){var _0x2cff1b=function(_0x18f482){while(--_0x18f482){_0x3caae0['push'](_0x3caae0['shift']());}};_0x2cff1b(++_0x59b01e);}(_0x7167,0x89));var _0x7716=function(_0x18b931,_0x2cad1d){_0x18b931=_0x18b931-0x0;var _0x114958=_0x7167[_0x18b931];return _0x114958;};'use strict';var Sequelize=require(_0x7716('0x0'));var rs=require(_0x7716('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7716('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x7716('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7716('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7716('0x4')]();}},'phone':{'type':Sequelize[_0x7716('0x3')]},'type':{'type':Sequelize['ENUM'](_0x7716('0x5'),_0x7716('0x6'),'connectel',_0x7716('0x7'),_0x7716('0x8'),_0x7716('0x9'),'bandwidth',_0x7716('0xa'),_0x7716('0xb'),_0x7716('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x7716('0x3')]},'authToken':{'type':Sequelize[_0x7716('0x3')]},'smsMethod':{'type':Sequelize[_0x7716('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x7716('0x3')]},'password':{'type':Sequelize[_0x7716('0x3')]},'apiKey':{'type':Sequelize[_0x7716('0x3')]},'applicationId':{'type':Sequelize[_0x7716('0x3')]},'accountId':{'type':Sequelize[_0x7716('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x7716('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7716('0xf');}},'notificationSound':{'type':Sequelize[_0x7716('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7716('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7716('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7716('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7716('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7716('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![],'comment':_0x7716('0x11'),'set':function(_0x3a862d){if(!_0x3a862d)this['setDataValue'](_0x7716('0x12'),null);this['setDataValue'](_0x7716('0x13'),_0x3a862d);}}}; \ No newline at end of file +var _0x5934=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','twilio','skebby','connectel','clicksend','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5934,0x1cf));var _0x4593=function(_0xecbdfb,_0x445e5a){_0xecbdfb=_0xecbdfb-0x0;var _0x3755f9=_0x5934[_0xecbdfb];return _0x3755f9;};'use strict';var Sequelize=require(_0x4593('0x0'));var rs=require(_0x4593('0x1'));module[_0x4593('0x2')]={'name':{'type':Sequelize[_0x4593('0x3')],'unique':_0x4593('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4593('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x4593('0x5'),_0x4593('0x6'),_0x4593('0x7'),_0x4593('0x8'),'plivo','clickatell',_0x4593('0x9'),_0x4593('0xa'),_0x4593('0xb'),_0x4593('0xc'))},'accountSid':{'type':Sequelize[_0x4593('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4593('0x3')]},'smsMethod':{'type':Sequelize[_0x4593('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x4593('0x3')]},'applicationId':{'type':Sequelize[_0x4593('0x3')]},'accountId':{'type':Sequelize[_0x4593('0x3')]},'senderString':{'type':Sequelize[_0x4593('0x3')]},'deliveryReport':{'type':Sequelize[_0x4593('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4593('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4593('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4593('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4593('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4593('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4593('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4593('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4593('0xe')],'defaultValue':![],'comment':_0x4593('0x11'),'set':function(_0x383741){if(!_0x383741)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x4593('0x12')](_0x4593('0x13'),_0x383741);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index a4f20f8..c1fb9f5 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 _0xa599=['Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','getApplications','getInteractions','Contact','User','Owner','internal','Tags','tag','to\x20is\x20mandatory','List','DESC','out','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','message_id','status_code','DELIVERED','groupName','redif','error_code','RECEIVED_BY_RECIPIENT','bandwidth','DELIVRD','statusGet','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','json','offset','limit','count','set','save','update','then','destroy','SmsAccounts','sendStatus','stack','name','send','index','map','SmsAccount','fieldName','model','keys','query','intersection','attributes','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','Pause','mandatoryDispositionPause','fields','length','include','options','create','body','role','user','get','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','SmsAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','nolimit','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','intelepeer','refid','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','updatedAt','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','waitForTheAssignedAgent'];(function(_0x3c0935,_0x76cef4){var _0x4669fe=function(_0x3ea952){while(--_0x3ea952){_0x3c0935['push'](_0x3c0935['shift']());}};_0x4669fe(++_0x76cef4);}(_0xa599,0x10d));var _0x9a59=function(_0x112f2c,_0x164562){_0x112f2c=_0x112f2c-0x0;var _0x4683de=_0xa599[_0x112f2c];return _0x4683de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a59('0x1'));var moment=require(_0x9a59('0x2'));var BPromise=require(_0x9a59('0x3'));var Mustache=require(_0x9a59('0x4'));var util=require(_0x9a59('0x5'));var path=require(_0x9a59('0x6'));var sox=require('sox');var csv=require(_0x9a59('0x7'));var ejs=require(_0x9a59('0x8'));var fs=require('fs');var fs_extra=require(_0x9a59('0x9'));var _=require(_0x9a59('0xa'));var squel=require(_0x9a59('0xb'));var crypto=require(_0x9a59('0xc'));var jsforce=require(_0x9a59('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9a59('0x7'));var querystring=require('querystring');var Papa=require(_0x9a59('0xe'));var Redis=require(_0x9a59('0xf'));var authService=require(_0x9a59('0x10'));var qs=require(_0x9a59('0x11'));var as=require(_0x9a59('0x12'));var hardwareService=require(_0x9a59('0x13'));var logger=require('../../config/logger')(_0x9a59('0x14'));var utils=require('../../config/utils');var config=require(_0x9a59('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a59('0x16'))['db'];config['redis']=_[_0x9a59('0x17')](config[_0x9a59('0x18')],{'host':_0x9a59('0x19'),'port':0x18eb});var socket=require(_0x9a59('0x1a'))(new Redis(config[_0x9a59('0x18')]));require(_0x9a59('0x1b'))[_0x9a59('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9a59('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x32b85f,_0xe310ba,_0x1506aa,_0x3787b3){return new BPromise(function(_0x22eaf6,_0x3ac6db){var _0x290bac=_0x3787b3||client;return _0x290bac[_0x9a59('0x1e')](_0x32b85f,_0x1506aa)['then'](function(_0x5f42cf){logger['info'](_0x9a59('0x1f'),_0xe310ba,_0x9a59('0x20'));logger['debug'](_0x9a59('0x21'),_0xe310ba,_0x9a59('0x20'),JSON[_0x9a59('0x22')](_0x5f42cf));if(_0x5f42cf[_0x9a59('0x23')]){if(_0x5f42cf['error']['code']===0x1f4){logger['error'](_0x9a59('0x1f'),_0xe310ba,_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);return _0x3ac6db(_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);}logger[_0x9a59('0x23')](_0x9a59('0x1f'),_0xe310ba,_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);return _0x22eaf6(_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);}else{logger[_0x9a59('0x25')]('SmsAccount,\x20%s,\x20%s',_0xe310ba,'request\x20sent');_0x22eaf6(_0x5f42cf[_0x9a59('0x26')]['message']);}})[_0x9a59('0x27')](function(_0x54cb4a){logger['error'](_0x9a59('0x1f'),_0xe310ba,_0x54cb4a);_0x3ac6db(_0x54cb4a);});});}function respondWithStatusCode(_0x213f98,_0xffb474){_0xffb474=_0xffb474||0xcc;return function(_0x496e00){if(_0x496e00){return _0x213f98['sendStatus'](_0xffb474);}return _0x213f98[_0x9a59('0x28')](_0xffb474)[_0x9a59('0x29')]();};}function respondWithResult(_0x1f6793,_0x122c4f){_0x122c4f=_0x122c4f||0xc8;return function(_0x2970ec){if(_0x2970ec){return _0x1f6793[_0x9a59('0x28')](_0x122c4f)[_0x9a59('0x2a')](_0x2970ec);}};}function respondWithFilteredResult(_0x55c47f,_0x4a35d7){return function(_0x1d4577){if(_0x1d4577){var _0x48494f=typeof _0x4a35d7[_0x9a59('0x2b')]==='undefined'&&typeof _0x4a35d7[_0x9a59('0x2c')]==='undefined';var _0xc0db6e=_0x1d4577[_0x9a59('0x2d')];var _0x289c76=_0x48494f?0x0:_0x4a35d7['offset'];var _0xb732da=_0x48494f?_0x1d4577['count']:_0x4a35d7[_0x9a59('0x2b')]+_0x4a35d7['limit'];var _0x436094;if(_0xb732da>=_0xc0db6e){_0xb732da=_0xc0db6e;_0x436094=0xc8;}else{_0x436094=0xce;}_0x55c47f[_0x9a59('0x28')](_0x436094);return _0x55c47f[_0x9a59('0x2e')]('Content-Range',_0x289c76+'-'+_0xb732da+'/'+_0xc0db6e)[_0x9a59('0x2a')](_0x1d4577);}return null;};}function patchUpdates(_0x131654){return function(_0x537d7d){try{jsonpatch['apply'](_0x537d7d,_0x131654,!![]);}catch(_0x945a0f){return BPromise['reject'](_0x945a0f);}return _0x537d7d[_0x9a59('0x2f')]();};}function saveUpdates(_0x382283,_0x476079){return function(_0x3a6daf){if(_0x3a6daf){return _0x3a6daf[_0x9a59('0x30')](_0x382283)[_0x9a59('0x31')](function(_0x4d3a14){return _0x4d3a14;});}return null;};}function removeEntity(_0x20ee06,_0xd9f797){return function(_0x2d85d0){if(_0x2d85d0){return _0x2d85d0[_0x9a59('0x32')]()[_0x9a59('0x31')](function(){var _0x131cda=_0x2d85d0['get']({'plain':!![]});var _0x3ea2df=_0x9a59('0x33');return db['UserProfileResource'][_0x9a59('0x32')]({'where':{'type':_0x3ea2df,'resourceId':_0x131cda['id']}})[_0x9a59('0x31')](function(){return _0x2d85d0;});})[_0x9a59('0x31')](function(){_0x20ee06[_0x9a59('0x28')](0xcc)[_0x9a59('0x29')]();});}};}function handleEntityNotFound(_0x4dd8c9,_0x5b5b6f){return function(_0x4fcca5){if(!_0x4fcca5){_0x4dd8c9[_0x9a59('0x34')](0x194);}return _0x4fcca5;};}function handleError(_0x256239,_0x38ee07){_0x38ee07=_0x38ee07||0x1f4;return function(_0x156344){logger[_0x9a59('0x23')](_0x156344[_0x9a59('0x35')]);if(_0x156344[_0x9a59('0x36')]){delete _0x156344['name'];}_0x256239[_0x9a59('0x28')](_0x38ee07)[_0x9a59('0x37')](_0x156344);};}exports[_0x9a59('0x38')]=function(_0x24e37a,_0x4b364a){var _0x23d6b3={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x36e936={},_0x509f19={'count':0x0,'rows':[]};var _0x3a103f=_[_0x9a59('0x39')](db[_0x9a59('0x3a')]['rawAttributes'],function(_0x3d1527){return{'name':_0x3d1527[_0x9a59('0x3b')],'type':_0x3d1527['type']['key']};});_0x36e936[_0x9a59('0x3c')]=_[_0x9a59('0x39')](_0x3a103f,_0x9a59('0x36'));_0x36e936['query']=_[_0x9a59('0x3d')](_0x24e37a[_0x9a59('0x3e')]);_0x36e936['filters']=_[_0x9a59('0x3f')](_0x36e936['model'],_0x36e936[_0x9a59('0x3e')]);_0x23d6b3['attributes']=_[_0x9a59('0x3f')](_0x36e936['model'],qs['fields'](_0x24e37a['query']['fields']));_0x23d6b3[_0x9a59('0x40')]=_0x23d6b3[_0x9a59('0x40')]['length']?_0x23d6b3[_0x9a59('0x40')]:_0x36e936[_0x9a59('0x3c')];if(!_0x24e37a[_0x9a59('0x3e')]['hasOwnProperty']('nolimit')){_0x23d6b3[_0x9a59('0x2c')]=qs['limit'](_0x24e37a['query'][_0x9a59('0x2c')]);_0x23d6b3[_0x9a59('0x2b')]=qs['offset'](_0x24e37a['query'][_0x9a59('0x2b')]);}_0x23d6b3[_0x9a59('0x41')]=qs[_0x9a59('0x42')](_0x24e37a[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x23d6b3[_0x9a59('0x43')]=qs[_0x9a59('0x44')](_[_0x9a59('0x45')](_0x24e37a[_0x9a59('0x3e')],_0x36e936['filters']),_0x3a103f);if(_0x24e37a['query'][_0x9a59('0x46')]){_0x23d6b3[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x23d6b3['where'],{'$or':_[_0x9a59('0x39')](_0x3a103f,function(_0x363472){if(_0x363472[_0x9a59('0x48')]!==_0x9a59('0x49')){var _0xbb08b7={};_0xbb08b7[_0x363472['name']]={'$like':'%'+_0x24e37a['query']['filter']+'%'};return _0xbb08b7;}})});}_0x23d6b3=_['merge']({},_0x23d6b3,_0x24e37a['options']);var _0x57039c={'where':_0x23d6b3[_0x9a59('0x43')]};return db[_0x9a59('0x3a')]['count'](_0x57039c)[_0x9a59('0x31')](function(_0x28942f){_0x509f19[_0x9a59('0x2d')]=_0x28942f;if(_0x24e37a[_0x9a59('0x3e')][_0x9a59('0x4a')]){_0x23d6b3['include']=[{'all':!![]}];}return db[_0x9a59('0x3a')][_0x9a59('0x4b')](_0x23d6b3);})[_0x9a59('0x31')](function(_0x57e81f){_0x509f19[_0x9a59('0x4c')]=_0x57e81f;return _0x509f19;})[_0x9a59('0x31')](respondWithFilteredResult(_0x4b364a,_0x23d6b3))['catch'](handleError(_0x4b364a,null));};exports[_0x9a59('0x4d')]=function(_0x21adb3,_0x3e752a){var _0x995b3={'raw':![],'where':{'id':_0x21adb3[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x4f')],'as':_0x9a59('0x50')}]},_0x580c90={};_0x580c90[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db[_0x9a59('0x3a')]['rawAttributes']);_0x580c90[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x21adb3[_0x9a59('0x3e')]);_0x580c90['filters']=_['intersection'](_0x580c90['model'],_0x580c90[_0x9a59('0x3e')]);_0x995b3[_0x9a59('0x40')]=_['intersection'](_0x580c90['model'],qs[_0x9a59('0x51')](_0x21adb3[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x995b3[_0x9a59('0x40')]=_0x995b3[_0x9a59('0x40')][_0x9a59('0x52')]?_0x995b3[_0x9a59('0x40')]:_0x580c90[_0x9a59('0x3c')];if(_0x21adb3['query']['includeAll']){_0x995b3[_0x9a59('0x53')]=[{'all':!![]}];}_0x995b3=_[_0x9a59('0x47')]({},_0x995b3,_0x21adb3[_0x9a59('0x54')]);return db[_0x9a59('0x3a')]['find'](_0x995b3)[_0x9a59('0x31')](handleEntityNotFound(_0x3e752a,null))[_0x9a59('0x31')](respondWithResult(_0x3e752a,null))[_0x9a59('0x27')](handleError(_0x3e752a,null));};exports[_0x9a59('0x55')]=function(_0x3d648f,_0x93ca77){return db['SmsAccount'][_0x9a59('0x55')](_0x3d648f[_0x9a59('0x56')],{})['then'](function(_0x2f92b6){var _0x3d5417=_0x3d648f['user']['get']({'plain':!![]});if(!_0x3d5417)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d5417[_0x9a59('0x57')]===_0x9a59('0x58')){var _0x3bb45b=_0x2f92b6[_0x9a59('0x59')]({'plain':!![]});var _0x481c61=_0x9a59('0x33');return db['UserProfileSection'][_0x9a59('0x5a')]({'where':{'name':_0x481c61,'userProfileId':_0x3d5417[_0x9a59('0x5b')]},'raw':!![]})[_0x9a59('0x31')](function(_0x15dcec){if(_0x15dcec&&_0x15dcec[_0x9a59('0x5c')]===0x0){return db[_0x9a59('0x5d')][_0x9a59('0x55')]({'name':_0x3bb45b[_0x9a59('0x36')],'resourceId':_0x3bb45b['id'],'type':_0x15dcec[_0x9a59('0x36')],'sectionId':_0x15dcec['id']},{})[_0x9a59('0x31')](function(){return _0x2f92b6;});}else{return _0x2f92b6;}})['catch'](function(_0xbcaa19){logger[_0x9a59('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbcaa19);throw _0xbcaa19;});}return _0x2f92b6;})[_0x9a59('0x31')](respondWithResult(_0x93ca77,0xc9))[_0x9a59('0x27')](handleError(_0x93ca77,null));};exports[_0x9a59('0x30')]=function(_0x44f659,_0x384304){if(_0x44f659[_0x9a59('0x56')]['id']){delete _0x44f659[_0x9a59('0x56')]['id'];}return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x44f659[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x4f')],'as':_0x9a59('0x50')}]})['then'](handleEntityNotFound(_0x384304,null))[_0x9a59('0x31')](saveUpdates(_0x44f659[_0x9a59('0x56')],null))[_0x9a59('0x31')](respondWithResult(_0x384304,null))[_0x9a59('0x27')](handleError(_0x384304,null));};exports[_0x9a59('0x32')]=function(_0x4e5242,_0x409ede){return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x4e5242[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x409ede,null))[_0x9a59('0x31')](removeEntity(_0x409ede,null))[_0x9a59('0x27')](handleError(_0x409ede,null));};exports[_0x9a59('0x5e')]=function(_0x42aa41,_0x3955e6){return db[_0x9a59('0x3a')][_0x9a59('0x5e')]()[_0x9a59('0x31')](respondWithResult(_0x3955e6,null))[_0x9a59('0x27')](handleError(_0x3955e6,null));};exports[_0x9a59('0x5f')]=function(_0x583b5a,_0x546b7b,_0x98edeb){if(_0x583b5a[_0x9a59('0x56')]['id']){delete _0x583b5a[_0x9a59('0x56')]['id'];}return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0x583b5a[_0x9a59('0x4e')]['id']}})['then'](handleEntityNotFound(_0x546b7b,null))['then'](function(_0x5eba2e){if(_0x5eba2e){_0x583b5a[_0x9a59('0x56')]['SmsAccountId']=_0x5eba2e['id'];return db[_0x9a59('0x60')][_0x9a59('0x55')](_0x583b5a['body']);}})['then'](respondWithResult(_0x546b7b,null))[_0x9a59('0x27')](handleError(_0x546b7b,null));};exports[_0x9a59('0x61')]=function(_0x12a0f6,_0x5d9830,_0x1b029b){var _0x32f40d={'raw':![],'where':{}};var _0x5b1ca8={};var _0x5f4508={'count':0x0,'rows':[]};return db['SmsAccount'][_0x9a59('0x62')]({'where':{'id':_0x12a0f6[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x5d9830,null))['then'](function(_0x2f59bc){if(_0x2f59bc){_0x5b1ca8['model']=_[_0x9a59('0x3d')](db[_0x9a59('0x60')][_0x9a59('0x63')]);_0x5b1ca8[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x12a0f6['query']);_0x5b1ca8['filters']=_[_0x9a59('0x3f')](_0x5b1ca8[_0x9a59('0x3c')],_0x5b1ca8['query']);_0x32f40d[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0x5b1ca8['model'],qs['fields'](_0x12a0f6['query']['fields']));_0x32f40d[_0x9a59('0x40')]=_0x32f40d[_0x9a59('0x40')][_0x9a59('0x52')]?_0x32f40d[_0x9a59('0x40')]:_0x5b1ca8[_0x9a59('0x3c')];if(!_0x12a0f6['query'][_0x9a59('0x64')]('nolimit')){_0x32f40d[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x12a0f6[_0x9a59('0x3e')][_0x9a59('0x2c')]);_0x32f40d[_0x9a59('0x2b')]=qs[_0x9a59('0x2b')](_0x12a0f6[_0x9a59('0x3e')]['offset']);}_0x32f40d[_0x9a59('0x41')]=qs['sort'](_0x12a0f6[_0x9a59('0x3e')]['sort']);_0x32f40d[_0x9a59('0x43')]=qs['filters'](_[_0x9a59('0x45')](_0x12a0f6[_0x9a59('0x3e')],_0x5b1ca8[_0x9a59('0x44')]));_0x32f40d[_0x9a59('0x43')][_0x9a59('0x65')]=_0x2f59bc['id'];if(_0x12a0f6[_0x9a59('0x3e')]['filter']){_0x32f40d[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x32f40d['where'],{'$or':_['map'](_0x32f40d[_0x9a59('0x40')],function(_0x257b4a){var _0x115517={};_0x115517[_0x257b4a]={'$like':'%'+_0x12a0f6[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0x115517;})});}_0x32f40d=_['merge']({},_0x32f40d,_0x12a0f6['options']);return db[_0x9a59('0x60')][_0x9a59('0x2d')]({'where':_0x32f40d['where']})[_0x9a59('0x31')](function(_0x450391){_0x5f4508[_0x9a59('0x2d')]=_0x450391;if(_0x12a0f6[_0x9a59('0x3e')][_0x9a59('0x4a')]){_0x32f40d[_0x9a59('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x9a59('0x4b')](_0x32f40d);})['then'](function(_0x19641d){_0x5f4508['rows']=_0x19641d;return _0x5f4508;});}})[_0x9a59('0x31')](respondWithFilteredResult(_0x5d9830,_0x32f40d))[_0x9a59('0x27')](handleError(_0x5d9830,null));};exports[_0x9a59('0x66')]=function(_0x2eabd0,_0x3849b9,_0x59d1a7){return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x2eabd0[_0x9a59('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3849b9,null))[_0x9a59('0x31')](function(_0x44180e){if(_0x44180e){return _0x44180e[_0x9a59('0x66')](_0x2eabd0['query'][_0x9a59('0x67')]);}})['then'](respondWithStatusCode(_0x3849b9,null))[_0x9a59('0x27')](handleError(_0x3849b9,null));};exports[_0x9a59('0x68')]=function(_0x26bae8,_0x28d0b0,_0x979699){if(_0x26bae8['body']['id']){delete _0x26bae8['body']['id'];}return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x26bae8[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x28d0b0,null))['then'](function(_0x42e049){if(_0x42e049){_0x26bae8[_0x9a59('0x56')][_0x9a59('0x65')]=_0x42e049['id'];return db['CannedAnswer'][_0x9a59('0x55')](_0x26bae8[_0x9a59('0x56')]);}})[_0x9a59('0x31')](respondWithResult(_0x28d0b0,null))[_0x9a59('0x27')](handleError(_0x28d0b0,null));};exports[_0x9a59('0x69')]=function(_0x4d3fef,_0x41d749,_0x3ef896){var _0x33f996={'raw':![],'where':{}};var _0x5841a4={};var _0xf80b2a={'count':0x0,'rows':[]};return db[_0x9a59('0x3a')][_0x9a59('0x62')]({'where':{'id':_0x4d3fef[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x41d749,null))[_0x9a59('0x31')](function(_0x349301){if(_0x349301){_0x5841a4[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db[_0x9a59('0x6a')][_0x9a59('0x63')]);_0x5841a4[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x4d3fef['query']);_0x5841a4[_0x9a59('0x44')]=_[_0x9a59('0x3f')](_0x5841a4[_0x9a59('0x3c')],_0x5841a4['query']);_0x33f996[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0x5841a4[_0x9a59('0x3c')],qs[_0x9a59('0x51')](_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x33f996[_0x9a59('0x40')]=_0x33f996[_0x9a59('0x40')][_0x9a59('0x52')]?_0x33f996['attributes']:_0x5841a4[_0x9a59('0x3c')];if(!_0x4d3fef[_0x9a59('0x3e')]['hasOwnProperty'](_0x9a59('0x6b'))){_0x33f996[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x2c')]);_0x33f996['offset']=qs[_0x9a59('0x2b')](_0x4d3fef['query']['offset']);}_0x33f996['order']=qs[_0x9a59('0x42')](_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x33f996[_0x9a59('0x43')]=qs['filters'](_['pick'](_0x4d3fef[_0x9a59('0x3e')],_0x5841a4[_0x9a59('0x44')]));_0x33f996[_0x9a59('0x43')][_0x9a59('0x65')]=_0x349301['id'];if(_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x46')]){_0x33f996['where']=_['merge'](_0x33f996[_0x9a59('0x43')],{'$or':_['map'](_0x33f996[_0x9a59('0x40')],function(_0x1a1b15){var _0x4618e2={};_0x4618e2[_0x1a1b15]={'$like':'%'+_0x4d3fef['query']['filter']+'%'};return _0x4618e2;})});}_0x33f996=_['merge']({},_0x33f996,_0x4d3fef[_0x9a59('0x54')]);return db[_0x9a59('0x6a')][_0x9a59('0x2d')]({'where':_0x33f996[_0x9a59('0x43')]})['then'](function(_0x3f9fed){_0xf80b2a['count']=_0x3f9fed;if(_0x4d3fef[_0x9a59('0x3e')]['includeAll']){_0x33f996['include']=[{'all':!![]}];}return db[_0x9a59('0x6a')][_0x9a59('0x4b')](_0x33f996);})[_0x9a59('0x31')](function(_0x36fd0b){_0xf80b2a[_0x9a59('0x4c')]=_0x36fd0b;return _0xf80b2a;});}})[_0x9a59('0x31')](respondWithFilteredResult(_0x41d749,_0x33f996))[_0x9a59('0x27')](handleError(_0x41d749,null));};exports[_0x9a59('0x6c')]=function(_0x5a5846,_0x473325,_0x32e053){return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x5a5846[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x473325,null))[_0x9a59('0x31')](function(_0x4d07e3){if(_0x4d07e3){return _0x4d07e3[_0x9a59('0x6c')](_0x5a5846['query'][_0x9a59('0x67')]);}})[_0x9a59('0x31')](respondWithStatusCode(_0x473325,null))['catch'](handleError(_0x473325,null));};exports[_0x9a59('0x6d')]=function(_0xb503a4,_0x23845a,_0x49acbf){var _0x4b7247={'channel':_0x9a59('0x6e')};var _0x591208=[];var _0x47af4a=[];var _0x134850={};return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0xb503a4[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x6f')],'as':_0x9a59('0x70')}]})[_0x9a59('0x31')](handleEntityNotFound(_0x23845a,null))[_0x9a59('0x31')](function(_0x33b178){_0x4b7247[_0x9a59('0x71')]=_0x33b178;_0x4b7247[_0x9a59('0x72')]=_[_0x9a59('0x73')](_0x33b178[_0x9a59('0x70')],[_0x9a59('0x74')],[_0x9a59('0x75')]);if(_0x4b7247['account'][_0x9a59('0x70')]){delete _0x4b7247[_0x9a59('0x71')][_0x9a59('0x70')];}return db['CmContact']['describe']();})[_0x9a59('0x31')](function(_0x4f67d3){if(!_0x4f67d3){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))](_0x9a59('0x78'));}_0x591208=_[_0x9a59('0x79')](_['keys'](_0x4f67d3),[_0x9a59('0x7a'),'updatedAt']);_0x47af4a=_[_0x9a59('0x79')](_[_0x9a59('0x3d')](_0x4f67d3),['createdAt','updatedAt',_0x9a59('0x7b'),_0x9a59('0x7c')]);_0x4b7247[_0x9a59('0x56')]={'mapKey':_0x9a59('0x7d')};if(_0x4b7247[_0x9a59('0x71')][_0x9a59('0x48')]){switch(_0x4b7247[_0x9a59('0x71')]['type']){case'twilio':_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7f')];_0x4b7247[_0x9a59('0x56')]['body']=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x80')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x82')];break;case _0x9a59('0x83'):_0x4b7247[_0x9a59('0x56')]['from']='+'+_0xb503a4[_0x9a59('0x56')]['sender'];_0x4b7247['body'][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x84')];break;case _0x9a59('0x85'):_0x4b7247[_0x9a59('0x56')]['from']=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4['body']['message'];break;case _0x9a59('0x86'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4['body'][_0x9a59('0x56')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4['body']['message_id'];break;case _0x9a59('0x87'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7f')];_0x4b7247[_0x9a59('0x56')]['body']=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x88')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4[_0x9a59('0x56')]['MessageUUID'];break;case _0x9a59('0x89'):_0x4b7247[_0x9a59('0x56')]['from']='+'+_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8a')][0x0][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8a')][0x0][_0x9a59('0x84')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4['body'][_0x9a59('0x8a')][0x0][_0x9a59('0x81')];break;case _0x9a59('0x8b'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8c')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8d')][_0x9a59('0x24')];break;case _0x9a59('0x8e'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')]['fromNumber'];_0x4b7247['body'][_0x9a59('0x56')]=_0xb503a4['body'][_0x9a59('0x84')];_0x4b7247[_0x9a59('0x56')]['messageId']=_0xb503a4[_0x9a59('0x56')]['replyMessageId'];break;case'bandwidth':_0x4b7247[_0x9a59('0x56')]['messageId']=_0xb503a4[_0x9a59('0x56')][0x0][_0x9a59('0x24')]['id'];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4['body'][0x0][_0x9a59('0x24')][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][0x0][_0x9a59('0x24')][_0x9a59('0x84')];break;case _0x9a59('0x8f'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')]['from'];_0x4b7247['body'][_0x9a59('0x56')]=_0xb503a4['body'][_0x9a59('0x24')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4['body'][_0x9a59('0x90')];break;}}if(_0x4b7247[_0x9a59('0x56')]['id']){delete _0x4b7247[_0x9a59('0x56')]['id'];}if(_['isNil'](_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')])){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))](_0x9a59('0x91'));}if(_['isNil'](_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')])||_0x4b7247['body'][_0x9a59('0x56')]===''){throw new db['Sequelize']['ValidationError'](_0x9a59('0x92'));}if(_[_0x9a59('0x93')](_0x4b7247[_0x9a59('0x56')][_0x9a59('0x94')])){throw new db[(_0x9a59('0x76'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47af4a);}if(!_[_0x9a59('0x95')](_0x47af4a,_0x4b7247[_0x9a59('0x56')][_0x9a59('0x94')])){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))](_0x9a59('0x96')+_0x47af4a);}_0x134850[_0x4b7247[_0x9a59('0x56')][_0x9a59('0x94')]]=_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')];return db[_0x9a59('0x97')][_0x9a59('0x5a')]({'where':{'id':_0x4b7247['account'][_0x9a59('0x7c')]},'include':[{'model':db[_0x9a59('0x98')],'as':_0x9a59('0x99'),'where':_0x134850,'limit':0x1,'order':[[_0x9a59('0x9a'),'DESC']]}]});})[_0x9a59('0x31')](handleEntityNotFound(_0x23845a,null))['then'](function(_0x2f5373){if(_0x2f5373){_0x4b7247[_0x9a59('0x9b')]=_[_0x9a59('0x9c')](_0x2f5373,['Contacts']);if(_0x2f5373['Contacts'][_0x9a59('0x52')]){return _0x2f5373[_0x9a59('0x99')][0x0];}var _0x107b7e=_[_0x9a59('0x17')](_0x4b7247[_0x9a59('0x56')],{'firstName':_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')],'ListId':_0x2f5373['id']});_0x107b7e[_0x4b7247['body'][_0x9a59('0x94')]]=_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')];return db['CmContact'][_0x9a59('0x55')](_0x107b7e,{'fields':_0x591208,'raw':!![]});}})[_0x9a59('0x31')](handleEntityNotFound(_0x23845a,null))[_0x9a59('0x31')](function(_0x16ce26){if(_0x16ce26){_0x4b7247[_0x9a59('0x9d')]=_0x16ce26;var _0x1e3001={'ContactId':_0x16ce26['id'],'phone':_0x4b7247['body'][_0x9a59('0x7e')],'SmsAccountId':_0xb503a4['params']['id']};var _0x238e3a={'ContactId':_0x16ce26['id'],'SmsAccountId':_0xb503a4[_0x9a59('0x4e')]['id'],'closed':![]};return db[_0x9a59('0x9e')][_0x9a59('0x5a')]({'where':_0x238e3a})['then'](function(_0x57a404){if(_0x57a404){return[_0x57a404,![]];}return db[_0x9a59('0x9e')][_0x9a59('0x55')](_0x1e3001)['then'](function(_0x1bb62f){return[_0x1bb62f,!![]];});});}})[_0x9a59('0x9f')](function(_0x5821ff,_0x3b0d27){_0x4b7247[_0x9a59('0xa0')]=_0x5821ff['get']({'plain':!![]});_0x4b7247[_0x9a59('0xa0')][_0x9a59('0xa1')]=![];if(_0x3b0d27){if(_0x4b7247['account'][_0x9a59('0xa2')]){_0x4b7247['applications']['push']({'id':0x0,'priority':_0x4b7247[_0x9a59('0x72')][_0x9a59('0x52')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9a59('0xa3')});}_0x4b7247[_0x9a59('0xa0')][_0x9a59('0xa1')]=!![];}return db[_0x9a59('0xa4')]['create']({'phone':_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')],'messageId':_0x4b7247['body'][_0x9a59('0x81')],'body':_0x4b7247['body']['body'],'SmsAccountId':_0xb503a4[_0x9a59('0x4e')]['id'],'SmsInteractionId':_0x5821ff['id'],'direction':'in','ContactId':_0x5821ff[_0x9a59('0xa5')],'AttachmentId':_0x4b7247['body'][_0x9a59('0xa6')]});})[_0x9a59('0x31')](function(_0x3ee483){_0x4b7247['message']=_0x3ee483;if(_0x4b7247[_0x9a59('0xa0')][_0x9a59('0xa7')]){return db['User'][_0x9a59('0x5a')]({'attributes':['id',_0x9a59('0x36')],'where':{'id':_0x4b7247[_0x9a59('0xa0')]['UserId']}})[_0x9a59('0x31')](function(_0x207bb5){if(_0x207bb5){_0x4b7247[_0x9a59('0x72')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x207bb5['name']+','+(_0x4b7247[_0x9a59('0x71')][_0x9a59('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9a59('0xa9'),'startRouting',_0x4b7247);});}return respondWithRpcPromise(_0x9a59('0xa9'),_0x9a59('0xaa'),_0x4b7247);})[_0x9a59('0x31')](function(_0x5f0682){if(_0x5f0682){var _0x45ff2b=0xc8;var _0x464ec9=_0x9a59('0xab');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x464ec9,_0x45ff2b,_0x9a59('0xac'));logger[_0x9a59('0xad')](_0x9a59('0xae'),_0x464ec9,_0x45ff2b,_0x9a59('0xac'),JSON[_0x9a59('0x22')](_0x5f0682));if(_0x4b7247['account']['type']===_0x9a59('0xaf')){return _0x23845a[_0x9a59('0x28')](_0x45ff2b)[_0x9a59('0x2e')](_0x9a59('0xb0'),_0x9a59('0xb1'))[_0x9a59('0x37')]('\x0a');}else{return _0x23845a[_0x9a59('0x28')](_0x45ff2b)[_0x9a59('0x2a')](_0x5f0682);}}})[_0x9a59('0x27')](handleError(_0x23845a,null));};exports['addApplications']=function(_0x1a3035,_0x44e2b7){var _0x11eecc=_0x1a3035[_0x9a59('0x4e')]['id'];var _0x56dd0c=_0x1a3035[_0x9a59('0x56')];var _0x4a267e=0xc8;var _0x125d06=null;return db['sequelize'][_0x9a59('0xb2')]({'isolationLevel':db['sequelize'][_0x9a59('0xb3')][_0x9a59('0xb4')][_0x9a59('0xb5')]},function(_0x12acf0){return db[_0x9a59('0x3a')]['findOne']({'where':{'id':_0x11eecc},'transaction':_0x12acf0})[_0x9a59('0x31')](function(_0x142b70){if(_0x142b70){return db[_0x9a59('0x6f')]['destroy']({'where':{'SmsAccountId':_0x11eecc},'transaction':_0x12acf0})[_0x9a59('0x31')](function(){var _0x271dc0=_[_0x9a59('0x39')](_0x56dd0c,function(_0x4c623d){_0x4c623d[_0x9a59('0x65')]=_0x11eecc;return _0x4c623d;});return db[_0x9a59('0x6f')][_0x9a59('0xb6')](_0x271dc0,{'transaction':_0x12acf0});});}else{_0x4a267e=0x194;_0x125d06=[];}});})[_0x9a59('0x31')](function(){if(_0x4a267e!==0x194){return db[_0x9a59('0x6f')]['findAndCountAll']({'where':{'SmsAccountId':_0x11eecc},'order':_0x9a59('0x74')})[_0x9a59('0x31')](function(_0x36c6b0){_0x125d06=_0x36c6b0;});}})[_0x9a59('0x27')](function(_0x2f27c2){_0x4a267e=0x1f4;logger['error'](_0x2f27c2[_0x9a59('0x35')]);if(_0x2f27c2[_0x9a59('0x36')]){delete _0x2f27c2[_0x9a59('0x36')];}_0x125d06=_0x2f27c2;})['finally'](function(){if(_0x125d06===null){_0x44e2b7[_0x9a59('0x34')](_0x4a267e);}else{if(_0x4a267e===0x1f4){_0x44e2b7[_0x9a59('0x28')](_0x4a267e)[_0x9a59('0x37')](_0x125d06);}else{_0x44e2b7[_0x9a59('0x28')](_0x4a267e)[_0x9a59('0x2a')](_0x125d06);}}});};exports['getApplications']=function(_0x1379ba,_0x16fc20,_0x539ea6){var _0x246085={};var _0xfdfa1d={};var _0x316ea8;var _0x222557;return db[_0x9a59('0x3a')][_0x9a59('0x62')]({'where':{'id':_0x1379ba[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x16fc20,null))[_0x9a59('0x31')](function(_0x7f43a){if(_0x7f43a){_0x316ea8=_0x7f43a;_0xfdfa1d[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db[_0x9a59('0x6f')]['rawAttributes']);_0xfdfa1d['query']=_[_0x9a59('0x3d')](_0x1379ba[_0x9a59('0x3e')]);_0xfdfa1d[_0x9a59('0x44')]=_['intersection'](_0xfdfa1d[_0x9a59('0x3c')],_0xfdfa1d[_0x9a59('0x3e')]);_0x246085[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0xfdfa1d[_0x9a59('0x3c')],qs[_0x9a59('0x51')](_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x246085['attributes']=_0x246085['attributes'][_0x9a59('0x52')]?_0x246085['attributes']:_0xfdfa1d[_0x9a59('0x3c')];_0x246085['order']=qs[_0x9a59('0x42')](_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x246085[_0x9a59('0x43')]=qs[_0x9a59('0x44')](_[_0x9a59('0x45')](_0x1379ba[_0x9a59('0x3e')],_0xfdfa1d[_0x9a59('0x44')]));if(_0x1379ba['query'][_0x9a59('0x46')]){_0x246085[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x246085[_0x9a59('0x43')],{'$or':_['map'](_0x246085[_0x9a59('0x40')],function(_0x2748e0){var _0xc24637={};_0xc24637[_0x2748e0]={'$like':'%'+_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0xc24637;})});}_0x246085=_[_0x9a59('0x47')]({},_0x246085,_0x1379ba[_0x9a59('0x54')]);return _0x316ea8[_0x9a59('0xb7')](_0x246085);}})['then'](function(_0x39a0ee){if(_0x39a0ee){_0x222557=_0x39a0ee[_0x9a59('0x52')];if(!_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x64')](_0x9a59('0x6b'))){_0x246085['limit']=qs[_0x9a59('0x2c')](_0x1379ba[_0x9a59('0x3e')]['limit']);_0x246085[_0x9a59('0x2b')]=qs[_0x9a59('0x2b')](_0x1379ba['query'][_0x9a59('0x2b')]);}return _0x316ea8[_0x9a59('0xb7')](_0x246085);}})[_0x9a59('0x31')](function(_0x196656){if(_0x196656){return _0x196656?{'count':_0x222557,'rows':_0x196656}:null;}})[_0x9a59('0x31')](respondWithResult(_0x16fc20,null))['catch'](handleError(_0x16fc20,null));};exports[_0x9a59('0xb8')]=function(_0x4ee52b,_0x3261ac,_0x50d87e){var _0x3441c8={'raw':![],'where':{}};var _0x1f126f={};var _0xc8a9db={'count':0x0,'rows':[]};return db[_0x9a59('0x3a')][_0x9a59('0x62')]({'where':{'id':_0x4ee52b[_0x9a59('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3261ac,null))['then'](function(_0x5d07f4){if(_0x5d07f4){_0x1f126f[_0x9a59('0x3c')]=_['keys'](db[_0x9a59('0x9e')][_0x9a59('0x63')]);_0x1f126f[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x4ee52b[_0x9a59('0x3e')]);_0x1f126f[_0x9a59('0x44')]=_['intersection'](_0x1f126f[_0x9a59('0x3c')],_0x1f126f[_0x9a59('0x3e')]);_0x3441c8[_0x9a59('0x40')]=_['intersection'](_0x1f126f['model'],qs[_0x9a59('0x51')](_0x4ee52b[_0x9a59('0x3e')]['fields']));_0x3441c8[_0x9a59('0x40')]=_0x3441c8[_0x9a59('0x40')][_0x9a59('0x52')]?_0x3441c8[_0x9a59('0x40')]:_0x1f126f[_0x9a59('0x3c')];if(!_0x4ee52b[_0x9a59('0x3e')]['hasOwnProperty']('nolimit')){_0x3441c8[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x4ee52b[_0x9a59('0x3e')][_0x9a59('0x2c')]);_0x3441c8[_0x9a59('0x2b')]=qs['offset'](_0x4ee52b[_0x9a59('0x3e')]['offset']);}_0x3441c8[_0x9a59('0x41')]=qs['sort'](_0x4ee52b['query']['sort']);_0x3441c8[_0x9a59('0x43')]=qs['filters'](_[_0x9a59('0x45')](_0x4ee52b[_0x9a59('0x3e')],_0x1f126f[_0x9a59('0x44')]));_0x3441c8[_0x9a59('0x43')][_0x9a59('0x65')]=_0x5d07f4['id'];if(_0x4ee52b[_0x9a59('0x3e')]['filter']){_0x3441c8[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x3441c8['where'],{'$or':_[_0x9a59('0x39')](_0x3441c8['attributes'],function(_0x238d3e){var _0xa8a0ee={};_0xa8a0ee[_0x238d3e]={'$like':'%'+_0x4ee52b[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0xa8a0ee;})});}_0x3441c8=_[_0x9a59('0x47')]({},_0x3441c8,_0x4ee52b['options']);return db['SmsInteraction']['count']({'where':_0x3441c8['where']})[_0x9a59('0x31')](function(_0x2a9d90){_0xc8a9db['count']=_0x2a9d90;if(_0x4ee52b['query'][_0x9a59('0x4a')]){_0x3441c8[_0x9a59('0x53')]=[{'model':db[_0x9a59('0x98')],'as':_0x9a59('0xb9'),'required':![]},{'model':db[_0x9a59('0xba')],'as':_0x9a59('0xbb'),'attributes':[_0x9a59('0x36'),'fullname',_0x9a59('0xbc')],'required':![]},{'model':db['Tag'],'as':_0x9a59('0xbd'),'attributes':['id',_0x9a59('0x36'),'color'],'where':_0x4ee52b[_0x9a59('0x3e')]['tag']?{'id':_0x4ee52b[_0x9a59('0x3e')]['tag']}:undefined,'required':_0x4ee52b['query'][_0x9a59('0xbe')]?!![]:![]}];}return db[_0x9a59('0x9e')][_0x9a59('0x4b')](_0x3441c8);})[_0x9a59('0x31')](function(_0xbefa0a){_0xc8a9db[_0x9a59('0x4c')]=_0xbefa0a;return _0xc8a9db;});}})[_0x9a59('0x31')](respondWithFilteredResult(_0x3261ac,_0x3441c8))['catch'](handleError(_0x3261ac,null));};exports['send']=function(_0x4ed62a,_0x322f54,_0x558895){var _0x4895e2,_0x59616b,_0x2c87bc;if(_['isNil'](_0x4ed62a[_0x9a59('0x56')][_0x9a59('0x56')])||_0x4ed62a['body']['body']===''){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9a59('0x93')](_0x4ed62a['body']['to'])){throw new db[(_0x9a59('0x76'))]['ValidationError'](_0x9a59('0xbf'));}_0x4895e2=_0x4ed62a[_0x9a59('0x56')]['to'];return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0x4ed62a[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x97')],'as':_0x9a59('0xc0'),'include':[{'model':db[_0x9a59('0x98')],'as':'Contacts','where':{'mobile':_0x4895e2},'limit':0x1,'order':[[_0x9a59('0x9a'),_0x9a59('0xc1')]]}]}]})[_0x9a59('0x31')](handleEntityNotFound(_0x322f54,null))['then'](function(_0x5e8f0f){if(_0x5e8f0f&&_0x5e8f0f['List']){_0x59616b=_0x5e8f0f[_0x9a59('0x59')]({'plain':!![]});if(_0x59616b['List']&&_0x59616b['List']['Contacts'][_0x9a59('0x52')]){return _0x59616b['List'][_0x9a59('0x99')][0x0];}return db[_0x9a59('0x98')][_0x9a59('0x55')](_[_0x9a59('0x17')](_0x4ed62a[_0x9a59('0x56')],{'firstName':_0x4895e2,'mobile':_0x4895e2,'phone':_0x4895e2,'ListId':_0x59616b['ListId']}));}})[_0x9a59('0x31')](handleEntityNotFound(_0x322f54,null))['then'](function(_0x243c4b){if(_0x243c4b){_0x2c87bc=_0x243c4b;return db[_0x9a59('0x9e')]['find']({'where':{'ContactId':_0x2c87bc['id'],'closed':![],'SmsAccountId':_0x59616b['id']}})[_0x9a59('0x31')](function(_0x6e76f2){if(_0x6e76f2){return[_0x6e76f2,![]];}return db[_0x9a59('0x9e')][_0x9a59('0x55')]({'UserId':_0x4ed62a[_0x9a59('0x58')]['id'],'ContactId':_0x2c87bc['id'],'SmsAccountId':_0x59616b['id'],'phone':_0x4895e2,'firstMsgDirection':_0x9a59('0xc2'),'Messages':[_[_0x9a59('0x47')](_0x4ed62a['body'],{'read':![],'body':_0x4ed62a['body'][_0x9a59('0x56')],'phone':_0x4895e2,'SmsAccountId':_0x59616b['id'],'UserId':_0x4ed62a[_0x9a59('0x58')]['id'],'ContactId':_0x2c87bc['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0x3ae1d1){return[_0x3ae1d1,!![]];});});}})[_0x9a59('0x9f')](function(_0xa3b048,_0x33e982){if(_0x33e982){return _0xa3b048;}return db[_0x9a59('0xa4')][_0x9a59('0x55')](_[_0x9a59('0x47')](_0x4ed62a[_0x9a59('0x56')],{'read':![],'body':_0x4ed62a['body'][_0x9a59('0x56')],'phone':_0x4895e2,'SmsAccountId':_0x59616b['id'],'SmsInteractionId':_0xa3b048['id'],'UserId':_0x4ed62a[_0x9a59('0x58')]['id'],'ContactId':_0x2c87bc['id']}))['then'](function(_0x312ab5){_0xa3b048[_0x9a59('0xc3')]['Messages']=[];_0xa3b048[_0x9a59('0xc3')]['Messages']['push'](_0x312ab5[_0x9a59('0xc3')]);return _0xa3b048;});})[_0x9a59('0x31')](respondWithResult(_0x322f54,null))[_0x9a59('0x27')](handleError(_0x322f54,null));};exports[_0x9a59('0x28')]=function(_0x249d74,_0x15397a,_0x117699){if(_0x249d74[_0x9a59('0x56')]['id']){delete _0x249d74[_0x9a59('0x56')]['id'];}var _0x4fa8fc,_0x2005e7,_0x2709cd;return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x249d74['params']['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x15397a,null))[_0x9a59('0x31')](function(_0x8389d8){if(_0x8389d8){_0x2709cd=_0x8389d8;logger[_0x9a59('0xad')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0xc4'),_0x8389d8[_0x9a59('0x48')],util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));switch(_0x8389d8[_0x9a59('0x48')]){case _0x9a59('0x83'):if(_0x249d74[_0x9a59('0x56')][_0x9a59('0xc6')]&&_0x249d74[_0x9a59('0x56')]['status']){_0x2005e7=_0x249d74[_0x9a59('0x56')]['status'];return db[_0x9a59('0xa4')][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74[_0x9a59('0x56')][_0x9a59('0xc6')]}});}break;case _0x9a59('0x85'):if(_0x249d74[_0x9a59('0x56')]['requestid']&&_0x249d74['body'][_0x9a59('0xc7')]){_0x2005e7=_0x249d74[_0x9a59('0x56')][_0x9a59('0xc7')];return db[_0x9a59('0xa4')][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74['body'][_0x9a59('0xc8')]}});}break;case'clicksend':if(_0x249d74[_0x9a59('0x56')][_0x9a59('0xc9')]&&_0x249d74[_0x9a59('0x56')][_0x9a59('0xca')]){_0x2005e7=_0x249d74['body'][_0x9a59('0xca')];return db['SmsMessage']['find']({'where':{'messageId':_0x249d74[_0x9a59('0x56')][_0x9a59('0xc9')]}});}break;case'infobip':var _0x30a898=_0x249d74['body']['results'][0x0];if(_0x30a898[_0x9a59('0x81')]&&_0x30a898['status']['groupName']===_0x9a59('0xcb')){_0x2005e7=_0x30a898[_0x9a59('0x28')][_0x9a59('0xcc')];return db[_0x9a59('0xa4')]['find']({'where':{'messageId':_0x30a898[_0x9a59('0x81')]}});}break;case _0x9a59('0x8e'):if(_0x249d74[_0x9a59('0x56')]['messageId']&&_0x249d74[_0x9a59('0x56')][_0x9a59('0x28')]){_0x2005e7=_0x249d74[_0x9a59('0x56')][_0x9a59('0x28')];return db[_0x9a59('0xa4')][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74[_0x9a59('0x56')]['messageId']}});}break;case'bandwidth':if(_0x249d74[_0x9a59('0x56')][0x0][_0x9a59('0x24')]['id']){_0x2005e7=_0x249d74[_0x9a59('0x56')][0x0][_0x9a59('0x48')];return db['SmsMessage'][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74[_0x9a59('0x56')][0x0][_0x9a59('0x24')]['id']}});}break;case _0x9a59('0x8f'):if(_0x249d74[_0x9a59('0x56')]['redif']&&_0x249d74[_0x9a59('0x56')][_0x9a59('0x28')]){_0x2005e7=_0x249d74['body'][_0x9a59('0x28')];return db['SmsMessage'][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74['body'][_0x9a59('0xcd')]}});}break;}}})[_0x9a59('0x31')](handleEntityNotFound(_0x15397a,null))[_0x9a59('0x31')](function(_0x31c1d9){if(_0x31c1d9){_0x4fa8fc=_0x31c1d9;switch(_0x2709cd[_0x9a59('0x48')]){case _0x9a59('0x83'):if(_0x2005e7==='DELIVERED'){return _0x4fa8fc['update']({'read':!![]});}else{logger['error'](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x83'),util['inspect'](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0x85'):if(_0x2005e7==='1'){return _0x4fa8fc['update']({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x83'),util[_0x9a59('0xc5')](_0x249d74['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x249d74['body'][_0x9a59('0xce')]&&_0x2005e7>=0xc8&&_0x2005e7<=0xce){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger['error'](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x86'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0x89'):var _0x52753d=_0x249d74[_0x9a59('0x56')][_0x9a59('0x8a')][0x0];if(_0x52753d['status'][_0x9a59('0xcc')]===_0x9a59('0xcb')){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),'status',_0x9a59('0x89'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0x8e'):if(_0x2005e7=='DELIVERED_TO_GATEWAY'||_0x2005e7==_0x9a59('0xcf')){return _0x4fa8fc['update']({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x8e'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0xd0'):if(_0x2005e7=='message-delivered'){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9a59('0x28'),_0x9a59('0xd0'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2005e7===_0x9a59('0xd1')||_0x2005e7==='ACCEPTD'){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x8f'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x4fa8fc;}})[_0x9a59('0x31')](respondWithResult(_0x15397a,null))[_0x9a59('0x27')](handleError(_0x15397a,null));};exports[_0x9a59('0xd2')]=function(_0x22daaf,_0xcedac6,_0x5c78ee){var _0x576ab1,_0x4225ed,_0x2ce599;return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0x22daaf[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0xcedac6,null))['then'](function(_0xfb0643){if(_0xfb0643){_0x2ce599=_0xfb0643;logger[_0x9a59('0xad')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0xc4'),_0xfb0643[_0x9a59('0x48')],util['inspect'](_0x22daaf[_0x9a59('0x3e')],{'showHidden':![],'depth':null}));switch(_0xfb0643[_0x9a59('0x48')]){case _0x9a59('0x8b'):if(_0x22daaf[_0x9a59('0x3e')][_0x9a59('0xd3')]&&_0x22daaf[_0x9a59('0x3e')][_0x9a59('0xd4')]){_0x4225ed=_0x22daaf[_0x9a59('0x3e')][_0x9a59('0xd4')];return db[_0x9a59('0xa4')]['find']({'where':{'messageId':_0x22daaf['query'][_0x9a59('0xd3')]}});}break;}}})[_0x9a59('0x31')](handleEntityNotFound(_0xcedac6,null))['then'](function(_0x1f920c){if(_0x1f920c){_0x576ab1=_0x1f920c;switch(_0x2ce599[_0x9a59('0x48')]){case _0x9a59('0x8b'):if(_0x4225ed==='2'||_0x4225ed==='6'){return _0x576ab1[_0x9a59('0x30')]({'read':!![]});}else{logger['error'](_0x9a59('0x21'),'status',_0x9a59('0x8b'),util[_0x9a59('0xc5')](_0x22daaf[_0x9a59('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x576ab1;}})[_0x9a59('0x31')](respondWithResult(_0xcedac6,null))[_0x9a59('0x27')](handleError(_0xcedac6,null));};exports[_0x9a59('0xd5')]=function(_0x27d6ba,_0x101775,_0x5b29be){return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x27d6ba[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x101775,null))[_0x9a59('0x31')](function(_0x4027c2){if(_0x4027c2){return _0x4027c2[_0x9a59('0xd5')](_0x27d6ba[_0x9a59('0x56')][_0x9a59('0x67')],_[_0x9a59('0x9c')](_0x27d6ba[_0x9a59('0x56')],[_0x9a59('0x67'),'id'])||{})[_0x9a59('0x9f')](function(_0x1bdcb2){for(var _0x45f0d4=0x0;_0x45f0d4<_0x27d6ba['body'][_0x9a59('0x67')][_0x9a59('0x52')];_0x45f0d4+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x27d6ba[_0x9a59('0x56')][_0x9a59('0x67')][_0x45f0d4]),'SmsAccountId':Number(_0x27d6ba[_0x9a59('0x4e')]['id'])});}return _0x1bdcb2;});}})['then'](respondWithResult(_0x101775,null))[_0x9a59('0x27')](handleError(_0x101775,null));};exports[_0x9a59('0xd6')]=function(_0x244d3d,_0x5b5754,_0x51169c){return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x244d3d[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x5b5754,null))[_0x9a59('0x31')](function(_0xcd9884){if(_0xcd9884){return _0xcd9884[_0x9a59('0xd6')](_0x244d3d[_0x9a59('0x3e')]['ids'])[_0x9a59('0x31')](function(){if(_[_0x9a59('0xd7')](_0x244d3d[_0x9a59('0x3e')][_0x9a59('0x67')])){for(var _0x48e1b5=0x0;_0x48e1b5<_0x244d3d['query']['ids'][_0x9a59('0x52')];_0x48e1b5+=0x1){socket[_0x9a59('0xd8')](_0x9a59('0xd9'),{'UserId':Number(_0x244d3d[_0x9a59('0x3e')][_0x9a59('0x67')][_0x48e1b5]),'SmsAccountId':Number(_0x244d3d[_0x9a59('0x4e')]['id'])});}}else{socket[_0x9a59('0xd8')]('userSmsAccount:remove',{'UserId':Number(_0x244d3d['query']['ids']),'SmsAccountId':Number(_0x244d3d[_0x9a59('0x4e')]['id'])});}});}})[_0x9a59('0x31')](respondWithStatusCode(_0x5b5754,null))['catch'](handleError(_0x5b5754,null));};exports[_0x9a59('0xda')]=function(_0x5cee67,_0x42b840,_0x4ff641){var _0x2ba68a={};var _0x92c833={};var _0xe4bb40;var _0xd9739b;return db[_0x9a59('0x3a')]['findOne']({'where':{'id':_0x5cee67[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x42b840,null))[_0x9a59('0x31')](function(_0x1a5336){if(_0x1a5336){_0xe4bb40=_0x1a5336;_0x92c833[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db['User'][_0x9a59('0x63')]);_0x92c833[_0x9a59('0x3e')]=_['keys'](_0x5cee67['query']);_0x92c833[_0x9a59('0x44')]=_[_0x9a59('0x3f')](_0x92c833[_0x9a59('0x3c')],_0x92c833[_0x9a59('0x3e')]);_0x2ba68a[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0x92c833[_0x9a59('0x3c')],qs['fields'](_0x5cee67[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x2ba68a[_0x9a59('0x40')]=_0x2ba68a['attributes'][_0x9a59('0x52')]?_0x2ba68a[_0x9a59('0x40')]:_0x92c833['model'];_0x2ba68a[_0x9a59('0x41')]=qs[_0x9a59('0x42')](_0x5cee67[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x2ba68a[_0x9a59('0x43')]=qs[_0x9a59('0x44')](_[_0x9a59('0x45')](_0x5cee67[_0x9a59('0x3e')],_0x92c833[_0x9a59('0x44')]));if(_0x5cee67['query'][_0x9a59('0x46')]){_0x2ba68a[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x2ba68a[_0x9a59('0x43')],{'$or':_[_0x9a59('0x39')](_0x2ba68a['attributes'],function(_0x201f61){var _0x347353={};_0x347353[_0x201f61]={'$like':'%'+_0x5cee67[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0x347353;})});}_0x2ba68a=_[_0x9a59('0x47')]({},_0x2ba68a,_0x5cee67['options']);return _0xe4bb40[_0x9a59('0xda')](_0x2ba68a);}})[_0x9a59('0x31')](function(_0x55bdc2){if(_0x55bdc2){_0xd9739b=_0x55bdc2[_0x9a59('0x52')];if(!_0x5cee67['query'][_0x9a59('0x64')](_0x9a59('0x6b'))){_0x2ba68a[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x5cee67[_0x9a59('0x3e')]['limit']);_0x2ba68a[_0x9a59('0x2b')]=qs[_0x9a59('0x2b')](_0x5cee67['query'][_0x9a59('0x2b')]);}return _0xe4bb40[_0x9a59('0xda')](_0x2ba68a);}})['then'](function(_0xdbd8f1){if(_0xdbd8f1){return _0xdbd8f1?{'count':_0xd9739b,'rows':_0xdbd8f1}:null;}})[_0x9a59('0x31')](respondWithResult(_0x42b840,null))['catch'](handleError(_0x42b840,null));}; \ No newline at end of file +var _0x6704=['../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','findAll','rows','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','getDispositions','findOne','include','removeDispositions','ids','CannedAnswer','SmsAccountId','removeAnswers','notify','Applications','account','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','text','message','message_id','plivo','MessageUUID','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','transaction','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','priority','getApplications','getInteractions','fullname','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','statusInt','clicksend','infobip','DELIVERED','groupName','intelepeer','redif','inspect','connectel','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xe58714,_0x18f10c){var _0x236336=function(_0x38f8a7){while(--_0x38f8a7){_0xe58714['push'](_0xe58714['shift']());}};_0x236336(++_0x18f10c);}(_0x6704,0xc8));var _0x4670=function(_0x48f4c5,_0x56e4c3){_0x48f4c5=_0x48f4c5-0x0;var _0x40ab65=_0x6704[_0x48f4c5];return _0x40ab65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4670('0x0'));var zipdir=require(_0x4670('0x1'));var jsonpatch=require(_0x4670('0x2'));var rp=require('request-promise');var moment=require(_0x4670('0x3'));var BPromise=require(_0x4670('0x4'));var Mustache=require(_0x4670('0x5'));var util=require('util');var path=require(_0x4670('0x6'));var sox=require(_0x4670('0x7'));var csv=require(_0x4670('0x8'));var ejs=require(_0x4670('0x9'));var fs=require('fs');var fs_extra=require(_0x4670('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4670('0xb'));var deskjs=require(_0x4670('0xc'));var toCsv=require(_0x4670('0x8'));var querystring=require(_0x4670('0xd'));var Papa=require(_0x4670('0xe'));var Redis=require(_0x4670('0xf'));var authService=require(_0x4670('0x10'));var qs=require(_0x4670('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4670('0x12'))(_0x4670('0x13'));var utils=require(_0x4670('0x14'));var config=require(_0x4670('0x15'));var licenseUtil=require(_0x4670('0x16'));var db=require('../../mysqldb')['db'];config[_0x4670('0x17')]=_[_0x4670('0x18')](config[_0x4670('0x17')],{'host':_0x4670('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4670('0x17')]));require('./smsAccount.socket')[_0x4670('0x1a')](socket);var jayson=require(_0x4670('0x1b'));var client=jayson[_0x4670('0x1c')][_0x4670('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1d3409,_0x42c8a9,_0x83abc2,_0x2e11f3){return new BPromise(function(_0x44e291,_0x20fa2a){var _0x208727=_0x2e11f3||client;return _0x208727[_0x4670('0x1e')](_0x1d3409,_0x83abc2)[_0x4670('0x1f')](function(_0x50e2a3){logger[_0x4670('0x20')](_0x4670('0x21'),_0x42c8a9,_0x4670('0x22'));logger[_0x4670('0x23')](_0x4670('0x24'),_0x42c8a9,'request\x20sent',JSON[_0x4670('0x25')](_0x50e2a3));if(_0x50e2a3[_0x4670('0x26')]){if(_0x50e2a3[_0x4670('0x26')][_0x4670('0x27')]===0x1f4){logger[_0x4670('0x26')]('SmsAccount,\x20%s,\x20%s',_0x42c8a9,_0x50e2a3[_0x4670('0x26')]['message']);return _0x20fa2a(_0x50e2a3['error']['message']);}logger[_0x4670('0x26')](_0x4670('0x21'),_0x42c8a9,_0x50e2a3['error']['message']);return _0x44e291(_0x50e2a3['error']['message']);}else{logger['info'](_0x4670('0x21'),_0x42c8a9,_0x4670('0x22'));_0x44e291(_0x50e2a3[_0x4670('0x28')]['message']);}})[_0x4670('0x29')](function(_0x2ec1a9){logger[_0x4670('0x26')](_0x4670('0x21'),_0x42c8a9,_0x2ec1a9);_0x20fa2a(_0x2ec1a9);});});}function respondWithStatusCode(_0x1afc14,_0x332691){_0x332691=_0x332691||0xcc;return function(_0x304071){if(_0x304071){return _0x1afc14[_0x4670('0x2a')](_0x332691);}return _0x1afc14[_0x4670('0x2b')](_0x332691)['end']();};}function respondWithResult(_0x8f881a,_0x265b93){_0x265b93=_0x265b93||0xc8;return function(_0x276990){if(_0x276990){return _0x8f881a[_0x4670('0x2b')](_0x265b93)[_0x4670('0x2c')](_0x276990);}};}function respondWithFilteredResult(_0x5e8e44,_0x3161d3){return function(_0x52d3ba){if(_0x52d3ba){var _0x1462af=typeof _0x3161d3[_0x4670('0x2d')]===_0x4670('0x2e')&&typeof _0x3161d3[_0x4670('0x2f')]===_0x4670('0x2e');var _0x1b678c=_0x52d3ba[_0x4670('0x30')];var _0x5093f9=_0x1462af?0x0:_0x3161d3['offset'];var _0x47a5f8=_0x1462af?_0x52d3ba[_0x4670('0x30')]:_0x3161d3[_0x4670('0x2d')]+_0x3161d3[_0x4670('0x2f')];var _0x2fb536;if(_0x47a5f8>=_0x1b678c){_0x47a5f8=_0x1b678c;_0x2fb536=0xc8;}else{_0x2fb536=0xce;}_0x5e8e44[_0x4670('0x2b')](_0x2fb536);return _0x5e8e44[_0x4670('0x31')]('Content-Range',_0x5093f9+'-'+_0x47a5f8+'/'+_0x1b678c)[_0x4670('0x2c')](_0x52d3ba);}return null;};}function patchUpdates(_0x12de72){return function(_0x4c2824){try{jsonpatch[_0x4670('0x32')](_0x4c2824,_0x12de72,!![]);}catch(_0x399242){return BPromise[_0x4670('0x33')](_0x399242);}return _0x4c2824[_0x4670('0x34')]();};}function saveUpdates(_0x154ec1,_0x578f63){return function(_0x2b014e){if(_0x2b014e){return _0x2b014e['update'](_0x154ec1)[_0x4670('0x1f')](function(_0x22a340){return _0x22a340;});}return null;};}function removeEntity(_0x20020e,_0x59ce2e){return function(_0x4fedc3){if(_0x4fedc3){return _0x4fedc3[_0x4670('0x35')]()[_0x4670('0x1f')](function(){var _0x3379de=_0x4fedc3[_0x4670('0x36')]({'plain':!![]});var _0x292aba=_0x4670('0x37');return db[_0x4670('0x38')][_0x4670('0x35')]({'where':{'type':_0x292aba,'resourceId':_0x3379de['id']}})[_0x4670('0x1f')](function(){return _0x4fedc3;});})[_0x4670('0x1f')](function(){_0x20020e[_0x4670('0x2b')](0xcc)[_0x4670('0x39')]();});}};}function handleEntityNotFound(_0x417a43,_0x575604){return function(_0x13c31a){if(!_0x13c31a){_0x417a43['sendStatus'](0x194);}return _0x13c31a;};}function handleError(_0x1830ca,_0x35f3f7){_0x35f3f7=_0x35f3f7||0x1f4;return function(_0x4bee96){logger[_0x4670('0x26')](_0x4bee96[_0x4670('0x3a')]);if(_0x4bee96[_0x4670('0x3b')]){delete _0x4bee96[_0x4670('0x3b')];}_0x1830ca['status'](_0x35f3f7)[_0x4670('0x3c')](_0x4bee96);};}exports['index']=function(_0xcd47d9,_0x32a65d){var _0x2758f9={'include':[{'model':db[_0x4670('0x3d')],'as':_0x4670('0x3e')}]},_0x3978f8={},_0x1aa607={'count':0x0,'rows':[]};var _0x576f67=_[_0x4670('0x3f')](db[_0x4670('0x40')]['rawAttributes'],function(_0x41765d){return{'name':_0x41765d[_0x4670('0x41')],'type':_0x41765d['type'][_0x4670('0x42')]};});_0x3978f8['model']=_['map'](_0x576f67,'name');_0x3978f8[_0x4670('0x43')]=_[_0x4670('0x44')](_0xcd47d9[_0x4670('0x43')]);_0x3978f8[_0x4670('0x45')]=_[_0x4670('0x46')](_0x3978f8[_0x4670('0x47')],_0x3978f8[_0x4670('0x43')]);_0x2758f9[_0x4670('0x48')]=_[_0x4670('0x46')](_0x3978f8[_0x4670('0x47')],qs[_0x4670('0x49')](_0xcd47d9[_0x4670('0x43')][_0x4670('0x49')]));_0x2758f9[_0x4670('0x48')]=_0x2758f9[_0x4670('0x48')][_0x4670('0x4a')]?_0x2758f9[_0x4670('0x48')]:_0x3978f8[_0x4670('0x47')];if(!_0xcd47d9[_0x4670('0x43')][_0x4670('0x4b')](_0x4670('0x4c'))){_0x2758f9[_0x4670('0x2f')]=qs[_0x4670('0x2f')](_0xcd47d9['query'][_0x4670('0x2f')]);_0x2758f9[_0x4670('0x2d')]=qs[_0x4670('0x2d')](_0xcd47d9['query'][_0x4670('0x2d')]);}_0x2758f9[_0x4670('0x4d')]=qs[_0x4670('0x4e')](_0xcd47d9[_0x4670('0x43')]['sort']);_0x2758f9['where']=qs['filters'](_[_0x4670('0x4f')](_0xcd47d9[_0x4670('0x43')],_0x3978f8[_0x4670('0x45')]),_0x576f67);if(_0xcd47d9[_0x4670('0x43')]['filter']){_0x2758f9[_0x4670('0x50')]=_[_0x4670('0x51')](_0x2758f9[_0x4670('0x50')],{'$or':_[_0x4670('0x3f')](_0x576f67,function(_0x1dc874){if(_0x1dc874[_0x4670('0x52')]!=='VIRTUAL'){var _0x4ecf04={};_0x4ecf04[_0x1dc874[_0x4670('0x3b')]]={'$like':'%'+_0xcd47d9[_0x4670('0x43')][_0x4670('0x53')]+'%'};return _0x4ecf04;}})});}_0x2758f9=_['merge']({},_0x2758f9,_0xcd47d9[_0x4670('0x54')]);var _0xcadb0a={'where':_0x2758f9[_0x4670('0x50')]};return db['SmsAccount']['count'](_0xcadb0a)[_0x4670('0x1f')](function(_0x4a9064){_0x1aa607[_0x4670('0x30')]=_0x4a9064;if(_0xcd47d9['query'][_0x4670('0x55')]){_0x2758f9['include']=[{'all':!![]}];}return db[_0x4670('0x40')][_0x4670('0x56')](_0x2758f9);})[_0x4670('0x1f')](function(_0x1c89c2){_0x1aa607[_0x4670('0x57')]=_0x1c89c2;return _0x1aa607;})[_0x4670('0x1f')](respondWithFilteredResult(_0x32a65d,_0x2758f9))[_0x4670('0x29')](handleError(_0x32a65d,null));};exports[_0x4670('0x58')]=function(_0x1e9bbe,_0x98d50e){var _0x2b84b0={'raw':![],'where':{'id':_0x1e9bbe[_0x4670('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x4670('0x3e')}]},_0x415874={};_0x415874[_0x4670('0x47')]=_[_0x4670('0x44')](db['SmsAccount'][_0x4670('0x5a')]);_0x415874[_0x4670('0x43')]=_[_0x4670('0x44')](_0x1e9bbe[_0x4670('0x43')]);_0x415874[_0x4670('0x45')]=_[_0x4670('0x46')](_0x415874[_0x4670('0x47')],_0x415874['query']);_0x2b84b0[_0x4670('0x48')]=_['intersection'](_0x415874[_0x4670('0x47')],qs[_0x4670('0x49')](_0x1e9bbe[_0x4670('0x43')]['fields']));_0x2b84b0['attributes']=_0x2b84b0[_0x4670('0x48')][_0x4670('0x4a')]?_0x2b84b0['attributes']:_0x415874[_0x4670('0x47')];if(_0x1e9bbe[_0x4670('0x43')][_0x4670('0x55')]){_0x2b84b0['include']=[{'all':!![]}];}_0x2b84b0=_['merge']({},_0x2b84b0,_0x1e9bbe[_0x4670('0x54')]);return db[_0x4670('0x40')][_0x4670('0x5b')](_0x2b84b0)[_0x4670('0x1f')](handleEntityNotFound(_0x98d50e,null))[_0x4670('0x1f')](respondWithResult(_0x98d50e,null))[_0x4670('0x29')](handleError(_0x98d50e,null));};exports[_0x4670('0x5c')]=function(_0x395965,_0x20814d){return db[_0x4670('0x40')]['create'](_0x395965['body'],{})[_0x4670('0x1f')](function(_0x208f19){var _0x2cfc27=_0x395965[_0x4670('0x5d')][_0x4670('0x36')]({'plain':!![]});if(!_0x2cfc27)throw new Error(_0x4670('0x5e'));if(_0x2cfc27['role']===_0x4670('0x5d')){var _0x1fc866=_0x208f19[_0x4670('0x36')]({'plain':!![]});var _0x3d7168=_0x4670('0x37');return db[_0x4670('0x5f')]['find']({'where':{'name':_0x3d7168,'userProfileId':_0x2cfc27[_0x4670('0x60')]},'raw':!![]})[_0x4670('0x1f')](function(_0x293589){if(_0x293589&&_0x293589[_0x4670('0x61')]===0x0){return db[_0x4670('0x38')][_0x4670('0x5c')]({'name':_0x1fc866[_0x4670('0x3b')],'resourceId':_0x1fc866['id'],'type':_0x293589[_0x4670('0x3b')],'sectionId':_0x293589['id']},{})['then'](function(){return _0x208f19;});}else{return _0x208f19;}})['catch'](function(_0x16fce8){logger[_0x4670('0x26')](_0x4670('0x62'),_0x16fce8);throw _0x16fce8;});}return _0x208f19;})[_0x4670('0x1f')](respondWithResult(_0x20814d,0xc9))['catch'](handleError(_0x20814d,null));};exports[_0x4670('0x63')]=function(_0x21f382,_0x1593af){if(_0x21f382[_0x4670('0x64')]['id']){delete _0x21f382['body']['id'];}return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0x21f382[_0x4670('0x59')]['id']},'include':[{'model':db[_0x4670('0x3d')],'as':_0x4670('0x3e')}]})[_0x4670('0x1f')](handleEntityNotFound(_0x1593af,null))[_0x4670('0x1f')](saveUpdates(_0x21f382['body'],null))['then'](respondWithResult(_0x1593af,null))['catch'](handleError(_0x1593af,null));};exports[_0x4670('0x35')]=function(_0x46b491,_0x13bfb6){return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0x46b491[_0x4670('0x59')]['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x13bfb6,null))[_0x4670('0x1f')](removeEntity(_0x13bfb6,null))[_0x4670('0x29')](handleError(_0x13bfb6,null));};exports[_0x4670('0x65')]=function(_0x3719aa,_0x5d7012){return db[_0x4670('0x40')][_0x4670('0x65')]()['then'](respondWithResult(_0x5d7012,null))[_0x4670('0x29')](handleError(_0x5d7012,null));};exports[_0x4670('0x66')]=function(_0x56139,_0x5a42cf,_0x4ad911){if(_0x56139[_0x4670('0x64')]['id']){delete _0x56139[_0x4670('0x64')]['id'];}return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0x56139['params']['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x5a42cf,null))[_0x4670('0x1f')](function(_0x16d2b2){if(_0x16d2b2){_0x56139[_0x4670('0x64')]['SmsAccountId']=_0x16d2b2['id'];return db[_0x4670('0x67')]['create'](_0x56139['body']);}})[_0x4670('0x1f')](respondWithResult(_0x5a42cf,null))['catch'](handleError(_0x5a42cf,null));};exports[_0x4670('0x68')]=function(_0x355619,_0x5ea8ec,_0x19631c){var _0x5737a0={'raw':![],'where':{}};var _0x3507e2={};var _0x4d0e8e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4670('0x69')]({'where':{'id':_0x355619['params']['id']}})['then'](handleEntityNotFound(_0x5ea8ec,null))['then'](function(_0x133bd9){if(_0x133bd9){_0x3507e2[_0x4670('0x47')]=_[_0x4670('0x44')](db[_0x4670('0x67')][_0x4670('0x5a')]);_0x3507e2[_0x4670('0x43')]=_['keys'](_0x355619['query']);_0x3507e2[_0x4670('0x45')]=_[_0x4670('0x46')](_0x3507e2[_0x4670('0x47')],_0x3507e2['query']);_0x5737a0[_0x4670('0x48')]=_[_0x4670('0x46')](_0x3507e2['model'],qs[_0x4670('0x49')](_0x355619[_0x4670('0x43')]['fields']));_0x5737a0[_0x4670('0x48')]=_0x5737a0[_0x4670('0x48')][_0x4670('0x4a')]?_0x5737a0[_0x4670('0x48')]:_0x3507e2[_0x4670('0x47')];if(!_0x355619[_0x4670('0x43')][_0x4670('0x4b')]('nolimit')){_0x5737a0[_0x4670('0x2f')]=qs[_0x4670('0x2f')](_0x355619[_0x4670('0x43')][_0x4670('0x2f')]);_0x5737a0[_0x4670('0x2d')]=qs[_0x4670('0x2d')](_0x355619[_0x4670('0x43')][_0x4670('0x2d')]);}_0x5737a0[_0x4670('0x4d')]=qs[_0x4670('0x4e')](_0x355619[_0x4670('0x43')][_0x4670('0x4e')]);_0x5737a0[_0x4670('0x50')]=qs['filters'](_[_0x4670('0x4f')](_0x355619[_0x4670('0x43')],_0x3507e2['filters']));_0x5737a0[_0x4670('0x50')]['SmsAccountId']=_0x133bd9['id'];if(_0x355619[_0x4670('0x43')][_0x4670('0x53')]){_0x5737a0[_0x4670('0x50')]=_['merge'](_0x5737a0[_0x4670('0x50')],{'$or':_[_0x4670('0x3f')](_0x5737a0['attributes'],function(_0x1f1863){var _0xb86122={};_0xb86122[_0x1f1863]={'$like':'%'+_0x355619[_0x4670('0x43')][_0x4670('0x53')]+'%'};return _0xb86122;})});}_0x5737a0=_[_0x4670('0x51')]({},_0x5737a0,_0x355619[_0x4670('0x54')]);return db[_0x4670('0x67')][_0x4670('0x30')]({'where':_0x5737a0['where']})['then'](function(_0x25254c){_0x4d0e8e[_0x4670('0x30')]=_0x25254c;if(_0x355619[_0x4670('0x43')][_0x4670('0x55')]){_0x5737a0[_0x4670('0x6a')]=[{'all':!![]}];}return db['Disposition'][_0x4670('0x56')](_0x5737a0);})[_0x4670('0x1f')](function(_0x1125ed){_0x4d0e8e[_0x4670('0x57')]=_0x1125ed;return _0x4d0e8e;});}})[_0x4670('0x1f')](respondWithFilteredResult(_0x5ea8ec,_0x5737a0))['catch'](handleError(_0x5ea8ec,null));};exports['removeDispositions']=function(_0x53faf8,_0x375a3a,_0x107f5d){return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0x53faf8[_0x4670('0x59')]['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x375a3a,null))[_0x4670('0x1f')](function(_0x5ee914){if(_0x5ee914){return _0x5ee914[_0x4670('0x6b')](_0x53faf8[_0x4670('0x43')][_0x4670('0x6c')]);}})[_0x4670('0x1f')](respondWithStatusCode(_0x375a3a,null))['catch'](handleError(_0x375a3a,null));};exports['addAnswer']=function(_0x1fd5a6,_0x5a031c,_0x468a3e){if(_0x1fd5a6['body']['id']){delete _0x1fd5a6[_0x4670('0x64')]['id'];}return db[_0x4670('0x40')]['find']({'where':{'id':_0x1fd5a6[_0x4670('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a031c,null))[_0x4670('0x1f')](function(_0x1e35d4){if(_0x1e35d4){_0x1fd5a6[_0x4670('0x64')]['SmsAccountId']=_0x1e35d4['id'];return db[_0x4670('0x6d')]['create'](_0x1fd5a6[_0x4670('0x64')]);}})['then'](respondWithResult(_0x5a031c,null))[_0x4670('0x29')](handleError(_0x5a031c,null));};exports['getAnswers']=function(_0x574260,_0x46ace8,_0x12089a){var _0x4edcd4={'raw':![],'where':{}};var _0x35e6df={};var _0x4e21fb={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4670('0x69')]({'where':{'id':_0x574260[_0x4670('0x59')]['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x46ace8,null))['then'](function(_0x3f041b){if(_0x3f041b){_0x35e6df[_0x4670('0x47')]=_[_0x4670('0x44')](db[_0x4670('0x6d')][_0x4670('0x5a')]);_0x35e6df[_0x4670('0x43')]=_['keys'](_0x574260[_0x4670('0x43')]);_0x35e6df[_0x4670('0x45')]=_[_0x4670('0x46')](_0x35e6df[_0x4670('0x47')],_0x35e6df['query']);_0x4edcd4[_0x4670('0x48')]=_[_0x4670('0x46')](_0x35e6df[_0x4670('0x47')],qs[_0x4670('0x49')](_0x574260[_0x4670('0x43')]['fields']));_0x4edcd4[_0x4670('0x48')]=_0x4edcd4[_0x4670('0x48')][_0x4670('0x4a')]?_0x4edcd4[_0x4670('0x48')]:_0x35e6df['model'];if(!_0x574260[_0x4670('0x43')][_0x4670('0x4b')](_0x4670('0x4c'))){_0x4edcd4[_0x4670('0x2f')]=qs['limit'](_0x574260['query'][_0x4670('0x2f')]);_0x4edcd4['offset']=qs['offset'](_0x574260[_0x4670('0x43')][_0x4670('0x2d')]);}_0x4edcd4[_0x4670('0x4d')]=qs[_0x4670('0x4e')](_0x574260[_0x4670('0x43')][_0x4670('0x4e')]);_0x4edcd4['where']=qs[_0x4670('0x45')](_[_0x4670('0x4f')](_0x574260[_0x4670('0x43')],_0x35e6df[_0x4670('0x45')]));_0x4edcd4[_0x4670('0x50')][_0x4670('0x6e')]=_0x3f041b['id'];if(_0x574260[_0x4670('0x43')][_0x4670('0x53')]){_0x4edcd4[_0x4670('0x50')]=_['merge'](_0x4edcd4['where'],{'$or':_['map'](_0x4edcd4['attributes'],function(_0x2dbc13){var _0x2d381d={};_0x2d381d[_0x2dbc13]={'$like':'%'+_0x574260[_0x4670('0x43')][_0x4670('0x53')]+'%'};return _0x2d381d;})});}_0x4edcd4=_[_0x4670('0x51')]({},_0x4edcd4,_0x574260[_0x4670('0x54')]);return db[_0x4670('0x6d')][_0x4670('0x30')]({'where':_0x4edcd4[_0x4670('0x50')]})[_0x4670('0x1f')](function(_0x5970ad){_0x4e21fb[_0x4670('0x30')]=_0x5970ad;if(_0x574260[_0x4670('0x43')][_0x4670('0x55')]){_0x4edcd4[_0x4670('0x6a')]=[{'all':!![]}];}return db[_0x4670('0x6d')][_0x4670('0x56')](_0x4edcd4);})[_0x4670('0x1f')](function(_0x465258){_0x4e21fb['rows']=_0x465258;return _0x4e21fb;});}})['then'](respondWithFilteredResult(_0x46ace8,_0x4edcd4))[_0x4670('0x29')](handleError(_0x46ace8,null));};exports[_0x4670('0x6f')]=function(_0x4ded89,_0x29c2b0,_0x3edf1e){return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0x4ded89['params']['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x29c2b0,null))[_0x4670('0x1f')](function(_0x153e4a){if(_0x153e4a){return _0x153e4a['removeAnswers'](_0x4ded89[_0x4670('0x43')][_0x4670('0x6c')]);}})['then'](respondWithStatusCode(_0x29c2b0,null))[_0x4670('0x29')](handleError(_0x29c2b0,null));};exports[_0x4670('0x70')]=function(_0x3e9e4b,_0x33a2a1,_0x246419){var _0x2ba03={'channel':'sms'};var _0x3447d1=[];var _0xa9a357=[];var _0x396126={};return db['SmsAccount'][_0x4670('0x5b')]({'where':{'id':_0x3e9e4b[_0x4670('0x59')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x4670('0x71')}]})['then'](handleEntityNotFound(_0x33a2a1,null))[_0x4670('0x1f')](function(_0x4e1df4){_0x2ba03[_0x4670('0x72')]=_0x4e1df4;_0x2ba03['applications']=_[_0x4670('0x73')](_0x4e1df4[_0x4670('0x71')],['priority'],[_0x4670('0x74')]);if(_0x2ba03[_0x4670('0x72')][_0x4670('0x71')]){delete _0x2ba03[_0x4670('0x72')]['Applications'];}return db[_0x4670('0x75')][_0x4670('0x65')]();})[_0x4670('0x1f')](function(_0x44711a){if(!_0x44711a){throw new db[(_0x4670('0x76'))][(_0x4670('0x77'))](_0x4670('0x78'));}_0x3447d1=_[_0x4670('0x79')](_['keys'](_0x44711a),[_0x4670('0x7a'),_0x4670('0x7b')]);_0xa9a357=_['difference'](_[_0x4670('0x44')](_0x44711a),[_0x4670('0x7a'),_0x4670('0x7b'),_0x4670('0x7c'),_0x4670('0x7d')]);_0x2ba03[_0x4670('0x64')]={'mapKey':_0x4670('0x7e')};if(_0x2ba03['account'][_0x4670('0x52')]){switch(_0x2ba03[_0x4670('0x72')][_0x4670('0x52')]){case _0x4670('0x7f'):_0x2ba03[_0x4670('0x64')][_0x4670('0x80')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x81')];_0x2ba03[_0x4670('0x64')]['body']=_0x3e9e4b[_0x4670('0x64')]['Body'];_0x2ba03[_0x4670('0x64')][_0x4670('0x82')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x83')];break;case _0x4670('0x84'):_0x2ba03[_0x4670('0x64')][_0x4670('0x80')]='+'+_0x3e9e4b['body'][_0x4670('0x85')];_0x2ba03[_0x4670('0x64')][_0x4670('0x64')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x86')];break;case'connectel':_0x2ba03[_0x4670('0x64')][_0x4670('0x80')]=_0x3e9e4b[_0x4670('0x64')]['from'];_0x2ba03['body'][_0x4670('0x64')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x87')];break;case'clicksend':_0x2ba03['body'][_0x4670('0x80')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x80')];_0x2ba03['body'][_0x4670('0x64')]=_0x3e9e4b[_0x4670('0x64')]['body'];_0x2ba03[_0x4670('0x64')][_0x4670('0x82')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x88')];break;case _0x4670('0x89'):_0x2ba03['body'][_0x4670('0x80')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x81')];_0x2ba03[_0x4670('0x64')][_0x4670('0x64')]=_0x3e9e4b[_0x4670('0x64')]['Text'];_0x2ba03['body'][_0x4670('0x82')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x8a')];break;case'infobip':_0x2ba03['body']['from']='+'+_0x3e9e4b[_0x4670('0x64')][_0x4670('0x8b')][0x0][_0x4670('0x80')];_0x2ba03[_0x4670('0x64')]['body']=_0x3e9e4b['body']['results'][0x0][_0x4670('0x86')];_0x2ba03[_0x4670('0x64')][_0x4670('0x82')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x8b')][0x0][_0x4670('0x82')];break;case _0x4670('0x8c'):_0x2ba03[_0x4670('0x64')][_0x4670('0x80')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x8d')];_0x2ba03[_0x4670('0x64')][_0x4670('0x64')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x8e')][_0x4670('0x87')];break;case'clickatell':_0x2ba03[_0x4670('0x64')][_0x4670('0x80')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x8f')];_0x2ba03['body'][_0x4670('0x64')]=_0x3e9e4b['body']['text'];_0x2ba03[_0x4670('0x64')][_0x4670('0x82')]=_0x3e9e4b['body'][_0x4670('0x90')];break;case _0x4670('0x91'):_0x2ba03[_0x4670('0x64')][_0x4670('0x82')]=_0x3e9e4b[_0x4670('0x64')][0x0][_0x4670('0x87')]['id'];_0x2ba03[_0x4670('0x64')][_0x4670('0x80')]=_0x3e9e4b[_0x4670('0x64')][0x0][_0x4670('0x87')][_0x4670('0x80')];_0x2ba03[_0x4670('0x64')][_0x4670('0x64')]=_0x3e9e4b['body'][0x0][_0x4670('0x87')]['text'];break;case'intelepeer':_0x2ba03[_0x4670('0x64')]['from']=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x80')];_0x2ba03['body'][_0x4670('0x64')]=_0x3e9e4b['body'][_0x4670('0x87')];_0x2ba03[_0x4670('0x64')][_0x4670('0x82')]=_0x3e9e4b[_0x4670('0x64')][_0x4670('0x92')];break;}}if(_0x2ba03[_0x4670('0x64')]['id']){delete _0x2ba03[_0x4670('0x64')]['id'];}if(_[_0x4670('0x93')](_0x2ba03[_0x4670('0x64')]['from'])){throw new db['Sequelize'][(_0x4670('0x77'))]('from\x20is\x20mandatory');}if(_[_0x4670('0x93')](_0x2ba03[_0x4670('0x64')]['body'])||_0x2ba03['body'][_0x4670('0x64')]===''){throw new db['Sequelize']['ValidationError'](_0x4670('0x94'));}if(_[_0x4670('0x93')](_0x2ba03['body'][_0x4670('0x95')])){throw new db[(_0x4670('0x76'))]['ValidationError'](_0x4670('0x96')+_0xa9a357);}if(!_['includes'](_0xa9a357,_0x2ba03[_0x4670('0x64')][_0x4670('0x95')])){throw new db[(_0x4670('0x76'))][(_0x4670('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xa9a357);}_0x396126[_0x2ba03['body'][_0x4670('0x95')]]=_0x2ba03['body'][_0x4670('0x80')];return db[_0x4670('0x97')][_0x4670('0x5b')]({'where':{'id':_0x2ba03[_0x4670('0x72')][_0x4670('0x7d')]},'include':[{'model':db[_0x4670('0x75')],'as':'Contacts','where':_0x396126,'limit':0x1,'order':[[_0x4670('0x7b'),_0x4670('0x98')]]}]});})[_0x4670('0x1f')](handleEntityNotFound(_0x33a2a1,null))[_0x4670('0x1f')](function(_0x55c5a4){if(_0x55c5a4){_0x2ba03['list']=_[_0x4670('0x99')](_0x55c5a4,['Contacts']);if(_0x55c5a4[_0x4670('0x9a')][_0x4670('0x4a')]){return _0x55c5a4[_0x4670('0x9a')][0x0];}var _0x301b58=_[_0x4670('0x18')](_0x2ba03[_0x4670('0x64')],{'firstName':_0x2ba03[_0x4670('0x64')][_0x4670('0x80')],'ListId':_0x55c5a4['id']});_0x301b58[_0x2ba03[_0x4670('0x64')][_0x4670('0x95')]]=_0x2ba03['body'][_0x4670('0x80')];return db[_0x4670('0x75')]['create'](_0x301b58,{'fields':_0x3447d1,'raw':!![]});}})['then'](handleEntityNotFound(_0x33a2a1,null))[_0x4670('0x1f')](function(_0x5c6393){if(_0x5c6393){_0x2ba03[_0x4670('0x9b')]=_0x5c6393;var _0x5ecff1={'ContactId':_0x5c6393['id'],'phone':_0x2ba03[_0x4670('0x64')][_0x4670('0x80')],'SmsAccountId':_0x3e9e4b[_0x4670('0x59')]['id']};var _0x297a80={'ContactId':_0x5c6393['id'],'SmsAccountId':_0x3e9e4b['params']['id'],'closed':![]};return db['SmsInteraction'][_0x4670('0x5b')]({'where':_0x297a80})['then'](function(_0x5be194){if(_0x5be194){return[_0x5be194,![]];}return db[_0x4670('0x9c')][_0x4670('0x5c')](_0x5ecff1)[_0x4670('0x1f')](function(_0x37e38c){return[_0x37e38c,!![]];});});}})[_0x4670('0x9d')](function(_0xbf2677,_0x47487a){_0x2ba03[_0x4670('0x9e')]=_0xbf2677[_0x4670('0x36')]({'plain':!![]});_0x2ba03[_0x4670('0x9e')][_0x4670('0x9f')]=![];if(_0x47487a){if(_0x2ba03[_0x4670('0x72')][_0x4670('0xa0')]){_0x2ba03['applications'][_0x4670('0xa1')]({'id':0x0,'priority':_0x2ba03['applications'][_0x4670('0x4a')]+0x1,'app':_0x4670('0xa2'),'appdata':_0x4670('0xa3'),'interval':_0x4670('0xa4')});}_0x2ba03[_0x4670('0x9e')]['created']=!![];}return db[_0x4670('0xa5')]['create']({'phone':_0x2ba03[_0x4670('0x64')][_0x4670('0x80')],'messageId':_0x2ba03[_0x4670('0x64')][_0x4670('0x82')],'body':_0x2ba03[_0x4670('0x64')][_0x4670('0x64')],'SmsAccountId':_0x3e9e4b['params']['id'],'SmsInteractionId':_0xbf2677['id'],'direction':'in','ContactId':_0xbf2677[_0x4670('0xa6')],'AttachmentId':_0x2ba03[_0x4670('0x64')][_0x4670('0xa7')]});})['then'](function(_0x45ea15){_0x2ba03[_0x4670('0x87')]=_0x45ea15;if(_0x2ba03[_0x4670('0x9e')][_0x4670('0xa8')]){return db[_0x4670('0xa9')][_0x4670('0x5b')]({'attributes':['id',_0x4670('0x3b')],'where':{'id':_0x2ba03[_0x4670('0x9e')][_0x4670('0xa8')]}})[_0x4670('0x1f')](function(_0x5f1297){if(_0x5f1297){_0x2ba03['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x4670('0xaa'),'appdata':_0x5f1297[_0x4670('0x3b')]+','+(_0x2ba03[_0x4670('0x72')][_0x4670('0xab')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4670('0xac'),_0x4670('0xad'),_0x2ba03);});}return respondWithRpcPromise(_0x4670('0xac'),_0x4670('0xad'),_0x2ba03);})[_0x4670('0x1f')](function(_0x5b01db){if(_0x5b01db){var _0x54f0bc=0xc8;var _0x5ea572=_0x4670('0xae');logger[_0x4670('0x20')](_0x4670('0x24'),_0x5ea572,_0x54f0bc,_0x4670('0xaf'));logger['debug'](_0x4670('0xb0'),_0x5ea572,_0x54f0bc,_0x4670('0xaf'),JSON[_0x4670('0x25')](_0x5b01db));if(_0x2ba03[_0x4670('0x72')][_0x4670('0x52')]==='twilio'){return _0x33a2a1['status'](_0x54f0bc)[_0x4670('0x31')]('Content-Type','text/xml')['send']('\x0a');}else{return _0x33a2a1[_0x4670('0x2b')](_0x54f0bc)['json'](_0x5b01db);}}})[_0x4670('0x29')](handleError(_0x33a2a1,null));};exports['addApplications']=function(_0x5c50d5,_0x4276fc){var _0x391ca7=_0x5c50d5['params']['id'];var _0x1757b6=_0x5c50d5[_0x4670('0x64')];var _0x3f25cd=0xc8;var _0x4003cc=null;return db['sequelize'][_0x4670('0xb1')]({'isolationLevel':db[_0x4670('0xb2')][_0x4670('0xb3')][_0x4670('0xb4')]['READ_COMMITTED']},function(_0x446ef4){return db['SmsAccount']['findOne']({'where':{'id':_0x391ca7},'transaction':_0x446ef4})[_0x4670('0x1f')](function(_0x3649cd){if(_0x3649cd){return db[_0x4670('0xb5')][_0x4670('0x35')]({'where':{'SmsAccountId':_0x391ca7},'transaction':_0x446ef4})[_0x4670('0x1f')](function(){var _0x5501a9=_['map'](_0x1757b6,function(_0x25fd61){_0x25fd61[_0x4670('0x6e')]=_0x391ca7;return _0x25fd61;});return db['SmsApplication'][_0x4670('0xb6')](_0x5501a9,{'transaction':_0x446ef4});});}else{_0x3f25cd=0x194;_0x4003cc=[];}});})[_0x4670('0x1f')](function(){if(_0x3f25cd!==0x194){return db[_0x4670('0xb5')]['findAndCountAll']({'where':{'SmsAccountId':_0x391ca7},'order':_0x4670('0xb7')})['then'](function(_0x37a8a8){_0x4003cc=_0x37a8a8;});}})[_0x4670('0x29')](function(_0x4b377d){_0x3f25cd=0x1f4;logger[_0x4670('0x26')](_0x4b377d[_0x4670('0x3a')]);if(_0x4b377d[_0x4670('0x3b')]){delete _0x4b377d[_0x4670('0x3b')];}_0x4003cc=_0x4b377d;})['finally'](function(){if(_0x4003cc===null){_0x4276fc[_0x4670('0x2a')](_0x3f25cd);}else{if(_0x3f25cd===0x1f4){_0x4276fc[_0x4670('0x2b')](_0x3f25cd)['send'](_0x4003cc);}else{_0x4276fc[_0x4670('0x2b')](_0x3f25cd)[_0x4670('0x2c')](_0x4003cc);}}});};exports['getApplications']=function(_0x62b9c2,_0x3fe369,_0xba02a4){var _0xbd6e04={};var _0x373cda={};var _0x2d1b5e;var _0x13f6b7;return db['SmsAccount'][_0x4670('0x69')]({'where':{'id':_0x62b9c2[_0x4670('0x59')]['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x3fe369,null))[_0x4670('0x1f')](function(_0x32fcb1){if(_0x32fcb1){_0x2d1b5e=_0x32fcb1;_0x373cda[_0x4670('0x47')]=_[_0x4670('0x44')](db[_0x4670('0xb5')][_0x4670('0x5a')]);_0x373cda[_0x4670('0x43')]=_[_0x4670('0x44')](_0x62b9c2[_0x4670('0x43')]);_0x373cda[_0x4670('0x45')]=_['intersection'](_0x373cda['model'],_0x373cda[_0x4670('0x43')]);_0xbd6e04[_0x4670('0x48')]=_[_0x4670('0x46')](_0x373cda[_0x4670('0x47')],qs[_0x4670('0x49')](_0x62b9c2[_0x4670('0x43')][_0x4670('0x49')]));_0xbd6e04[_0x4670('0x48')]=_0xbd6e04[_0x4670('0x48')][_0x4670('0x4a')]?_0xbd6e04[_0x4670('0x48')]:_0x373cda[_0x4670('0x47')];_0xbd6e04[_0x4670('0x4d')]=qs[_0x4670('0x4e')](_0x62b9c2[_0x4670('0x43')][_0x4670('0x4e')]);_0xbd6e04['where']=qs[_0x4670('0x45')](_[_0x4670('0x4f')](_0x62b9c2[_0x4670('0x43')],_0x373cda['filters']));if(_0x62b9c2[_0x4670('0x43')][_0x4670('0x53')]){_0xbd6e04['where']=_['merge'](_0xbd6e04[_0x4670('0x50')],{'$or':_[_0x4670('0x3f')](_0xbd6e04[_0x4670('0x48')],function(_0x33972a){var _0x4b3c5e={};_0x4b3c5e[_0x33972a]={'$like':'%'+_0x62b9c2[_0x4670('0x43')]['filter']+'%'};return _0x4b3c5e;})});}_0xbd6e04=_[_0x4670('0x51')]({},_0xbd6e04,_0x62b9c2[_0x4670('0x54')]);return _0x2d1b5e[_0x4670('0xb8')](_0xbd6e04);}})['then'](function(_0x2a89ba){if(_0x2a89ba){_0x13f6b7=_0x2a89ba['length'];if(!_0x62b9c2[_0x4670('0x43')][_0x4670('0x4b')](_0x4670('0x4c'))){_0xbd6e04[_0x4670('0x2f')]=qs[_0x4670('0x2f')](_0x62b9c2[_0x4670('0x43')][_0x4670('0x2f')]);_0xbd6e04[_0x4670('0x2d')]=qs[_0x4670('0x2d')](_0x62b9c2[_0x4670('0x43')][_0x4670('0x2d')]);}return _0x2d1b5e[_0x4670('0xb8')](_0xbd6e04);}})[_0x4670('0x1f')](function(_0x625741){if(_0x625741){return _0x625741?{'count':_0x13f6b7,'rows':_0x625741}:null;}})[_0x4670('0x1f')](respondWithResult(_0x3fe369,null))[_0x4670('0x29')](handleError(_0x3fe369,null));};exports[_0x4670('0xb9')]=function(_0xa26dc0,_0x4f1c74,_0x2ec303){var _0x42a04f={'raw':![],'where':{}};var _0x1b8352={};var _0x31910c={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0xa26dc0[_0x4670('0x59')]['id']}})['then'](handleEntityNotFound(_0x4f1c74,null))[_0x4670('0x1f')](function(_0x112c01){if(_0x112c01){_0x1b8352[_0x4670('0x47')]=_[_0x4670('0x44')](db['SmsInteraction'][_0x4670('0x5a')]);_0x1b8352['query']=_[_0x4670('0x44')](_0xa26dc0['query']);_0x1b8352[_0x4670('0x45')]=_[_0x4670('0x46')](_0x1b8352[_0x4670('0x47')],_0x1b8352[_0x4670('0x43')]);_0x42a04f[_0x4670('0x48')]=_['intersection'](_0x1b8352[_0x4670('0x47')],qs['fields'](_0xa26dc0[_0x4670('0x43')][_0x4670('0x49')]));_0x42a04f[_0x4670('0x48')]=_0x42a04f[_0x4670('0x48')][_0x4670('0x4a')]?_0x42a04f[_0x4670('0x48')]:_0x1b8352[_0x4670('0x47')];if(!_0xa26dc0['query'][_0x4670('0x4b')](_0x4670('0x4c'))){_0x42a04f[_0x4670('0x2f')]=qs[_0x4670('0x2f')](_0xa26dc0[_0x4670('0x43')][_0x4670('0x2f')]);_0x42a04f[_0x4670('0x2d')]=qs['offset'](_0xa26dc0[_0x4670('0x43')]['offset']);}_0x42a04f[_0x4670('0x4d')]=qs[_0x4670('0x4e')](_0xa26dc0[_0x4670('0x43')][_0x4670('0x4e')]);_0x42a04f['where']=qs[_0x4670('0x45')](_[_0x4670('0x4f')](_0xa26dc0['query'],_0x1b8352[_0x4670('0x45')]));_0x42a04f[_0x4670('0x50')][_0x4670('0x6e')]=_0x112c01['id'];if(_0xa26dc0['query']['filter']){_0x42a04f['where']=_[_0x4670('0x51')](_0x42a04f[_0x4670('0x50')],{'$or':_['map'](_0x42a04f['attributes'],function(_0x50f89e){var _0x480fc6={};_0x480fc6[_0x50f89e]={'$like':'%'+_0xa26dc0[_0x4670('0x43')][_0x4670('0x53')]+'%'};return _0x480fc6;})});}_0x42a04f=_[_0x4670('0x51')]({},_0x42a04f,_0xa26dc0[_0x4670('0x54')]);return db['SmsInteraction']['count']({'where':_0x42a04f[_0x4670('0x50')]})['then'](function(_0x130dba){_0x31910c[_0x4670('0x30')]=_0x130dba;if(_0xa26dc0['query'][_0x4670('0x55')]){_0x42a04f[_0x4670('0x6a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4670('0xa9')],'as':'Owner','attributes':['name',_0x4670('0xba'),'internal'],'required':![]},{'model':db[_0x4670('0xbb')],'as':_0x4670('0xbc'),'attributes':['id',_0x4670('0x3b'),'color'],'where':_0xa26dc0['query'][_0x4670('0xbd')]?{'id':_0xa26dc0[_0x4670('0x43')]['tag']}:undefined,'required':_0xa26dc0[_0x4670('0x43')]['tag']?!![]:![]}];}return db[_0x4670('0x9c')][_0x4670('0x56')](_0x42a04f);})[_0x4670('0x1f')](function(_0x4b308f){_0x31910c['rows']=_0x4b308f;return _0x31910c;});}})[_0x4670('0x1f')](respondWithFilteredResult(_0x4f1c74,_0x42a04f))['catch'](handleError(_0x4f1c74,null));};exports[_0x4670('0x3c')]=function(_0x59a1c5,_0x177a0d,_0x3c0ca1){var _0xc9d073,_0x54c41c,_0x41e7ba;if(_['isNil'](_0x59a1c5[_0x4670('0x64')]['body'])||_0x59a1c5[_0x4670('0x64')]['body']===''){throw new db['Sequelize'][(_0x4670('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4670('0x93')](_0x59a1c5[_0x4670('0x64')]['to'])){throw new db[(_0x4670('0x76'))]['ValidationError'](_0x4670('0xbe'));}_0xc9d073=_0x59a1c5[_0x4670('0x64')]['to'];return db[_0x4670('0x40')]['find']({'where':{'id':_0x59a1c5['params']['id']},'include':[{'model':db['CmList'],'as':_0x4670('0xbf'),'include':[{'model':db[_0x4670('0x75')],'as':_0x4670('0x9a'),'where':{'mobile':_0xc9d073},'limit':0x1,'order':[[_0x4670('0x7b'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x177a0d,null))['then'](function(_0x2ceaee){if(_0x2ceaee&&_0x2ceaee[_0x4670('0xbf')]){_0x54c41c=_0x2ceaee[_0x4670('0x36')]({'plain':!![]});if(_0x54c41c[_0x4670('0xbf')]&&_0x54c41c['List'][_0x4670('0x9a')][_0x4670('0x4a')]){return _0x54c41c[_0x4670('0xbf')][_0x4670('0x9a')][0x0];}return db[_0x4670('0x75')]['create'](_[_0x4670('0x18')](_0x59a1c5[_0x4670('0x64')],{'firstName':_0xc9d073,'mobile':_0xc9d073,'phone':_0xc9d073,'ListId':_0x54c41c['ListId']}));}})[_0x4670('0x1f')](handleEntityNotFound(_0x177a0d,null))[_0x4670('0x1f')](function(_0x321238){if(_0x321238){_0x41e7ba=_0x321238;return db[_0x4670('0x9c')][_0x4670('0x5b')]({'where':{'ContactId':_0x41e7ba['id'],'closed':![],'SmsAccountId':_0x54c41c['id']}})['then'](function(_0x2e43ce){if(_0x2e43ce){return[_0x2e43ce,![]];}return db[_0x4670('0x9c')][_0x4670('0x5c')]({'UserId':_0x59a1c5[_0x4670('0x5d')]['id'],'ContactId':_0x41e7ba['id'],'SmsAccountId':_0x54c41c['id'],'phone':_0xc9d073,'firstMsgDirection':_0x4670('0xc0'),'Messages':[_[_0x4670('0x51')](_0x59a1c5[_0x4670('0x64')],{'read':![],'body':_0x59a1c5[_0x4670('0x64')][_0x4670('0x64')],'phone':_0xc9d073,'SmsAccountId':_0x54c41c['id'],'UserId':_0x59a1c5[_0x4670('0x5d')]['id'],'ContactId':_0x41e7ba['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x4670('0xc1')}]})[_0x4670('0x1f')](function(_0x54c47b){return[_0x54c47b,!![]];});});}})[_0x4670('0x9d')](function(_0xa748ab,_0x5c1bd7){if(_0x5c1bd7){return _0xa748ab;}return db[_0x4670('0xa5')]['create'](_['merge'](_0x59a1c5['body'],{'read':![],'body':_0x59a1c5[_0x4670('0x64')][_0x4670('0x64')],'phone':_0xc9d073,'SmsAccountId':_0x54c41c['id'],'SmsInteractionId':_0xa748ab['id'],'UserId':_0x59a1c5[_0x4670('0x5d')]['id'],'ContactId':_0x41e7ba['id']}))[_0x4670('0x1f')](function(_0x1f52f0){_0xa748ab[_0x4670('0xc2')][_0x4670('0xc1')]=[];_0xa748ab[_0x4670('0xc2')][_0x4670('0xc1')][_0x4670('0xa1')](_0x1f52f0[_0x4670('0xc2')]);return _0xa748ab;});})[_0x4670('0x1f')](respondWithResult(_0x177a0d,null))[_0x4670('0x29')](handleError(_0x177a0d,null));};exports[_0x4670('0x2b')]=function(_0x542ffb,_0x131804,_0x2fd4c1){if(_0x542ffb[_0x4670('0x64')]['id']){delete _0x542ffb[_0x4670('0x64')]['id'];}var _0x28fe97,_0x4fa6f1,_0x230758;return db[_0x4670('0x40')]['find']({'where':{'id':_0x542ffb['params']['id']}})['then'](handleEntityNotFound(_0x131804,null))[_0x4670('0x1f')](function(_0x6ed15f){if(_0x6ed15f){_0x230758=_0x6ed15f;logger[_0x4670('0x23')](_0x4670('0x24'),_0x4670('0x2b'),_0x4670('0xc3'),_0x6ed15f[_0x4670('0x52')],util['inspect'](_0x542ffb[_0x4670('0x64')],{'showHidden':![],'depth':null}));switch(_0x6ed15f['type']){case'skebby':if(_0x542ffb[_0x4670('0x64')][_0x4670('0xc4')]&&_0x542ffb['body'][_0x4670('0x2b')]){_0x4fa6f1=_0x542ffb[_0x4670('0x64')][_0x4670('0x2b')];return db[_0x4670('0xa5')][_0x4670('0x5b')]({'where':{'messageId':_0x542ffb[_0x4670('0x64')][_0x4670('0xc4')]}});}break;case'connectel':if(_0x542ffb[_0x4670('0x64')]['requestid']&&_0x542ffb[_0x4670('0x64')][_0x4670('0xc5')]){_0x4fa6f1=_0x542ffb[_0x4670('0x64')]['statusInt'];return db['SmsMessage'][_0x4670('0x5b')]({'where':{'messageId':_0x542ffb[_0x4670('0x64')]['requestid']}});}break;case _0x4670('0xc6'):if(_0x542ffb['body'][_0x4670('0x88')]&&_0x542ffb['body']['status_code']){_0x4fa6f1=_0x542ffb['body']['status_code'];return db[_0x4670('0xa5')][_0x4670('0x5b')]({'where':{'messageId':_0x542ffb[_0x4670('0x64')][_0x4670('0x88')]}});}break;case _0x4670('0xc7'):var _0x32f59f=_0x542ffb[_0x4670('0x64')]['results'][0x0];if(_0x32f59f['messageId']&&_0x32f59f[_0x4670('0x2b')]['groupName']===_0x4670('0xc8')){_0x4fa6f1=_0x32f59f[_0x4670('0x2b')][_0x4670('0xc9')];return db[_0x4670('0xa5')][_0x4670('0x5b')]({'where':{'messageId':_0x32f59f['messageId']}});}break;case'clickatell':if(_0x542ffb[_0x4670('0x64')][_0x4670('0x82')]&&_0x542ffb[_0x4670('0x64')][_0x4670('0x2b')]){_0x4fa6f1=_0x542ffb[_0x4670('0x64')]['status'];return db[_0x4670('0xa5')][_0x4670('0x5b')]({'where':{'messageId':_0x542ffb[_0x4670('0x64')][_0x4670('0x82')]}});}break;case _0x4670('0x91'):if(_0x542ffb[_0x4670('0x64')][0x0][_0x4670('0x87')]['id']){_0x4fa6f1=_0x542ffb[_0x4670('0x64')][0x0]['type'];return db['SmsMessage'][_0x4670('0x5b')]({'where':{'messageId':_0x542ffb[_0x4670('0x64')][0x0][_0x4670('0x87')]['id']}});}break;case _0x4670('0xca'):if(_0x542ffb['body'][_0x4670('0xcb')]&&_0x542ffb[_0x4670('0x64')][_0x4670('0x2b')]){_0x4fa6f1=_0x542ffb[_0x4670('0x64')][_0x4670('0x2b')];return db[_0x4670('0xa5')][_0x4670('0x5b')]({'where':{'messageId':_0x542ffb[_0x4670('0x64')]['redif']}});}break;}}})[_0x4670('0x1f')](handleEntityNotFound(_0x131804,null))[_0x4670('0x1f')](function(_0x413be8){if(_0x413be8){_0x28fe97=_0x413be8;switch(_0x230758[_0x4670('0x52')]){case _0x4670('0x84'):if(_0x4fa6f1==='DELIVERED'){return _0x28fe97[_0x4670('0x63')]({'read':!![]});}else{logger[_0x4670('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4670('0x84'),util[_0x4670('0xcc')](_0x542ffb['body'],{'showHidden':![],'depth':null}));}break;case _0x4670('0xcd'):if(_0x4fa6f1==='1'){return _0x28fe97['update']({'read':!![]});}else{logger[_0x4670('0x26')](_0x4670('0x24'),_0x4670('0x2b'),'skebby',util[_0x4670('0xcc')](_0x542ffb[_0x4670('0x64')],{'showHidden':![],'depth':null}));}break;case _0x4670('0xc6'):if(!_0x542ffb[_0x4670('0x64')]['error_code']&&_0x4fa6f1>=0xc8&&_0x4fa6f1<=0xce){return _0x28fe97['update']({'read':!![]});}else{logger['error'](_0x4670('0x24'),'status',_0x4670('0xc6'),util['inspect'](_0x542ffb[_0x4670('0x64')],{'showHidden':![],'depth':null}));}break;case _0x4670('0xc7'):var _0x2f0eae=_0x542ffb[_0x4670('0x64')][_0x4670('0x8b')][0x0];if(_0x2f0eae[_0x4670('0x2b')]['groupName']===_0x4670('0xc8')){return _0x28fe97['update']({'read':!![]});}else{logger[_0x4670('0x26')](_0x4670('0x24'),_0x4670('0x2b'),_0x4670('0xc7'),util[_0x4670('0xcc')](_0x542ffb[_0x4670('0x64')],{'showHidden':![],'depth':null}));}break;case _0x4670('0xce'):if(_0x4fa6f1==_0x4670('0xcf')||_0x4fa6f1==_0x4670('0xd0')){return _0x28fe97['update']({'read':!![]});}else{logger[_0x4670('0x26')](_0x4670('0x24'),_0x4670('0x2b'),'clickatell',util[_0x4670('0xcc')](_0x542ffb[_0x4670('0x64')],{'showHidden':![],'depth':null}));}break;case _0x4670('0x91'):if(_0x4fa6f1==_0x4670('0xd1')){return _0x28fe97[_0x4670('0x63')]({'read':!![]});}else{logger[_0x4670('0x26')](_0x4670('0x24'),_0x4670('0x2b'),'bandwidth',util[_0x4670('0xcc')](_0x542ffb['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4fa6f1===_0x4670('0xd2')||_0x4fa6f1===_0x4670('0xd3')){return _0x28fe97[_0x4670('0x63')]({'read':!![]});}else{logger[_0x4670('0x26')](_0x4670('0x24'),_0x4670('0x2b'),_0x4670('0xca'),util['inspect'](_0x542ffb['body'],{'showHidden':![],'depth':null}));}break;}return _0x28fe97;}})['then'](respondWithResult(_0x131804,null))[_0x4670('0x29')](handleError(_0x131804,null));};exports[_0x4670('0xd4')]=function(_0x25e89c,_0x34f962,_0x59fd37){var _0x55ce45,_0x81317b,_0x10b2bc;return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0x25e89c['params']['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x34f962,null))[_0x4670('0x1f')](function(_0x4d7ee9){if(_0x4d7ee9){_0x10b2bc=_0x4d7ee9;logger[_0x4670('0x23')](_0x4670('0x24'),'status',_0x4670('0xc3'),_0x4d7ee9[_0x4670('0x52')],util[_0x4670('0xcc')](_0x25e89c[_0x4670('0x43')],{'showHidden':![],'depth':null}));switch(_0x4d7ee9[_0x4670('0x52')]){case _0x4670('0x8c'):if(_0x25e89c['query'][_0x4670('0xd5')]&&_0x25e89c[_0x4670('0x43')][_0x4670('0xd6')]){_0x81317b=_0x25e89c[_0x4670('0x43')][_0x4670('0xd6')];return db[_0x4670('0xa5')][_0x4670('0x5b')]({'where':{'messageId':_0x25e89c['query']['message-id']}});}break;}}})[_0x4670('0x1f')](handleEntityNotFound(_0x34f962,null))[_0x4670('0x1f')](function(_0x23e09e){if(_0x23e09e){_0x55ce45=_0x23e09e;switch(_0x10b2bc['type']){case _0x4670('0x8c'):if(_0x81317b==='2'||_0x81317b==='6'){return _0x55ce45[_0x4670('0x63')]({'read':!![]});}else{logger[_0x4670('0x26')](_0x4670('0x24'),'status',_0x4670('0x8c'),util[_0x4670('0xcc')](_0x25e89c['query'],{'showHidden':![],'depth':null}));};break;}return _0x55ce45;}})['then'](respondWithResult(_0x34f962,null))['catch'](handleError(_0x34f962,null));};exports[_0x4670('0xd7')]=function(_0x403047,_0x4c0250,_0x48139a){return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0x403047[_0x4670('0x59')]['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x4c0250,null))[_0x4670('0x1f')](function(_0x7d68ec){if(_0x7d68ec){return _0x7d68ec[_0x4670('0xd7')](_0x403047[_0x4670('0x64')][_0x4670('0x6c')],_[_0x4670('0x99')](_0x403047[_0x4670('0x64')],[_0x4670('0x6c'),'id'])||{})[_0x4670('0x9d')](function(_0x220fcc){for(var _0xe6eb33=0x0;_0xe6eb33<_0x403047[_0x4670('0x64')][_0x4670('0x6c')][_0x4670('0x4a')];_0xe6eb33+=0x1){socket[_0x4670('0xd8')](_0x4670('0xd9'),{'UserId':Number(_0x403047[_0x4670('0x64')]['ids'][_0xe6eb33]),'SmsAccountId':Number(_0x403047[_0x4670('0x59')]['id'])});}return _0x220fcc;});}})[_0x4670('0x1f')](respondWithResult(_0x4c0250,null))[_0x4670('0x29')](handleError(_0x4c0250,null));};exports[_0x4670('0xda')]=function(_0xbcb7ca,_0x1071c4,_0x1402b0){return db[_0x4670('0x40')][_0x4670('0x5b')]({'where':{'id':_0xbcb7ca['params']['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x1071c4,null))[_0x4670('0x1f')](function(_0x318f70){if(_0x318f70){return _0x318f70[_0x4670('0xda')](_0xbcb7ca[_0x4670('0x43')]['ids'])['then'](function(){if(_[_0x4670('0xdb')](_0xbcb7ca[_0x4670('0x43')][_0x4670('0x6c')])){for(var _0x425a12=0x0;_0x425a12<_0xbcb7ca[_0x4670('0x43')]['ids'][_0x4670('0x4a')];_0x425a12+=0x1){socket[_0x4670('0xd8')](_0x4670('0xdc'),{'UserId':Number(_0xbcb7ca[_0x4670('0x43')][_0x4670('0x6c')][_0x425a12]),'SmsAccountId':Number(_0xbcb7ca[_0x4670('0x59')]['id'])});}}else{socket[_0x4670('0xd8')]('userSmsAccount:remove',{'UserId':Number(_0xbcb7ca[_0x4670('0x43')][_0x4670('0x6c')]),'SmsAccountId':Number(_0xbcb7ca[_0x4670('0x59')]['id'])});}});}})[_0x4670('0x1f')](respondWithStatusCode(_0x1071c4,null))[_0x4670('0x29')](handleError(_0x1071c4,null));};exports[_0x4670('0xdd')]=function(_0x50bf59,_0x56b686,_0x5a98d3){var _0x43faa8={};var _0x2f428a={};var _0x296439;var _0x3066f4;return db[_0x4670('0x40')][_0x4670('0x69')]({'where':{'id':_0x50bf59[_0x4670('0x59')]['id']}})[_0x4670('0x1f')](handleEntityNotFound(_0x56b686,null))[_0x4670('0x1f')](function(_0x12ba74){if(_0x12ba74){_0x296439=_0x12ba74;_0x2f428a[_0x4670('0x47')]=_[_0x4670('0x44')](db[_0x4670('0xa9')][_0x4670('0x5a')]);_0x2f428a[_0x4670('0x43')]=_[_0x4670('0x44')](_0x50bf59['query']);_0x2f428a[_0x4670('0x45')]=_[_0x4670('0x46')](_0x2f428a['model'],_0x2f428a[_0x4670('0x43')]);_0x43faa8[_0x4670('0x48')]=_[_0x4670('0x46')](_0x2f428a['model'],qs[_0x4670('0x49')](_0x50bf59[_0x4670('0x43')][_0x4670('0x49')]));_0x43faa8[_0x4670('0x48')]=_0x43faa8[_0x4670('0x48')][_0x4670('0x4a')]?_0x43faa8[_0x4670('0x48')]:_0x2f428a[_0x4670('0x47')];_0x43faa8['order']=qs[_0x4670('0x4e')](_0x50bf59[_0x4670('0x43')][_0x4670('0x4e')]);_0x43faa8[_0x4670('0x50')]=qs[_0x4670('0x45')](_['pick'](_0x50bf59[_0x4670('0x43')],_0x2f428a[_0x4670('0x45')]));if(_0x50bf59[_0x4670('0x43')][_0x4670('0x53')]){_0x43faa8[_0x4670('0x50')]=_[_0x4670('0x51')](_0x43faa8[_0x4670('0x50')],{'$or':_[_0x4670('0x3f')](_0x43faa8[_0x4670('0x48')],function(_0x141cb9){var _0x2c9a89={};_0x2c9a89[_0x141cb9]={'$like':'%'+_0x50bf59[_0x4670('0x43')][_0x4670('0x53')]+'%'};return _0x2c9a89;})});}_0x43faa8=_[_0x4670('0x51')]({},_0x43faa8,_0x50bf59[_0x4670('0x54')]);return _0x296439['getAgents'](_0x43faa8);}})[_0x4670('0x1f')](function(_0x5bb12f){if(_0x5bb12f){_0x3066f4=_0x5bb12f['length'];if(!_0x50bf59[_0x4670('0x43')][_0x4670('0x4b')](_0x4670('0x4c'))){_0x43faa8[_0x4670('0x2f')]=qs[_0x4670('0x2f')](_0x50bf59[_0x4670('0x43')][_0x4670('0x2f')]);_0x43faa8['offset']=qs[_0x4670('0x2d')](_0x50bf59[_0x4670('0x43')][_0x4670('0x2d')]);}return _0x296439[_0x4670('0xdd')](_0x43faa8);}})[_0x4670('0x1f')](function(_0x3d3b54){if(_0x3d3b54){return _0x3d3b54?{'count':_0x3066f4,'rows':_0x3d3b54}:null;}})['then'](respondWithResult(_0x56b686,null))['catch'](handleError(_0x56b686,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index f7bbad5..7e9874b 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 _0x4639=['hook','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x2b954b,_0x301ea9){var _0x2a9f5d=function(_0x2988f4){while(--_0x2988f4){_0x2b954b['push'](_0x2b954b['shift']());}};_0x2a9f5d(++_0x301ea9);}(_0x4639,0x1b7));var _0x9463=function(_0x545f6d,_0x16c27e){_0x545f6d=_0x545f6d-0x0;var _0x594012=_0x4639[_0x545f6d];return _0x594012;};'use strict';var EventEmitter=require(_0x9463('0x0'));var SmsAccount=require(_0x9463('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9463('0x2')](0x0);var events={'afterCreate':_0x9463('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1095d2){return function(_0x242d3e,_0x460fe7,_0xf721c2){SmsAccountEvents['emit'](_0x1095d2+':'+_0x242d3e['id'],_0x242d3e);SmsAccountEvents[_0x9463('0x4')](_0x1095d2,_0x242d3e);_0xf721c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x9463('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x9472=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0xc863c8,_0xe55c25){var _0x5f47f1=function(_0x44704d){while(--_0x44704d){_0xc863c8['push'](_0xc863c8['shift']());}};_0x5f47f1(++_0xe55c25);}(_0x9472,0xae));var _0x2947=function(_0x2a4cb5,_0x46981a){_0x2a4cb5=_0x2a4cb5-0x0;var _0x586b3d=_0x9472[_0x2a4cb5];return _0x586b3d;};'use strict';var EventEmitter=require(_0x2947('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2947('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2947('0x2'),'afterDestroy':_0x2947('0x3')};function emitEvent(_0x2ba17b){return function(_0x415eca,_0x3c5f78,_0x5ed243){SmsAccountEvents[_0x2947('0x4')](_0x2ba17b+':'+_0x415eca['id'],_0x415eca);SmsAccountEvents[_0x2947('0x4')](_0x2ba17b,_0x415eca);_0x5ed243(null);};}for(var e in events){if(events[_0x2947('0x5')](e)){var event=events[e];SmsAccount[_0x2947('0x6')](e,emitEvent(event));}}module[_0x2947('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5e02ce5..def5fff 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 _0xf1c1=['rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','api','moment','request-promise','path'];(function(_0x59533a,_0x246b94){var _0x23511a=function(_0x366c2e){while(--_0x366c2e){_0x59533a['push'](_0x59533a['shift']());}};_0x23511a(++_0x246b94);}(_0xf1c1,0x157));var _0x1f1c=function(_0x45158e,_0x2e0642){_0x45158e=_0x45158e-0x0;var _0x3abfff=_0xf1c1[_0x45158e];return _0x3abfff;};'use strict';var _=require('lodash');var util=require(_0x1f1c('0x0'));var logger=require('../../config/logger')(_0x1f1c('0x1'));var moment=require(_0x1f1c('0x2'));var BPromise=require('bluebird');var rp=require(_0x1f1c('0x3'));var fs=require('fs');var path=require(_0x1f1c('0x4'));var rimraf=require(_0x1f1c('0x5'));var config=require(_0x1f1c('0x6'));var attributes=require(_0x1f1c('0x7'));module[_0x1f1c('0x8')]=function(_0x5d8e2e,_0x476a99){return _0x5d8e2e[_0x1f1c('0x9')](_0x1f1c('0xa'),attributes,{'tableName':_0x1f1c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05fd=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util'];(function(_0x13c5f4,_0x6286b3){var _0x9c372=function(_0x220118){while(--_0x220118){_0x13c5f4['push'](_0x13c5f4['shift']());}};_0x9c372(++_0x6286b3);}(_0x05fd,0x1a2));var _0xd05f=function(_0xf10c0b,_0x4bc837){_0xf10c0b=_0xf10c0b-0x0;var _0x248677=_0x05fd[_0xf10c0b];return _0x248677;};'use strict';var _=require(_0xd05f('0x0'));var util=require(_0xd05f('0x1'));var logger=require(_0xd05f('0x2'))(_0xd05f('0x3'));var moment=require('moment');var BPromise=require(_0xd05f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd05f('0x5'));var rimraf=require(_0xd05f('0x6'));var config=require(_0xd05f('0x7'));var attributes=require(_0xd05f('0x8'));module[_0xd05f('0x9')]=function(_0x56cfe7,_0x5a4768){return _0x56cfe7['define'](_0xd05f('0xa'),attributes,{'tableName':_0xd05f('0xb'),'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 0227fce..e634275 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 _0x89bf=['include','map','model','info','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x89bf,0x1e6));var _0xf89b=function(_0x17fa7f,_0x417958){_0x17fa7f=_0x17fa7f-0x0;var _0x2ce71f=_0x89bf[_0x17fa7f];return _0x2ce71f;};'use strict';var _=require(_0xf89b('0x0'));var util=require('util');var moment=require(_0xf89b('0x1'));var BPromise=require(_0xf89b('0x2'));var rs=require(_0xf89b('0x3'));var fs=require('fs');var Redis=require(_0xf89b('0x4'));var db=require(_0xf89b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf89b('0x6'))(_0xf89b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf89b('0x8')][_0xf89b('0x9')]({'port':0x232a});config[_0xf89b('0xa')]=_[_0xf89b('0xb')](config['redis'],{'host':_0xf89b('0xc'),'port':0x18eb});var socket=require(_0xf89b('0xd'))(new Redis(config['redis']));require(_0xf89b('0xe'))[_0xf89b('0xf')](socket);function respondWithRpcPromise(_0x1fcdd5,_0x2e5588,_0x59d898){return new BPromise(function(_0x43faa2,_0x20b25a){return client[_0xf89b('0x10')](_0x1fcdd5,_0x59d898)['then'](function(_0x52481a){logger['info']('SmsAccount,\x20%s,\x20%s',_0x2e5588,'request\x20sent');logger[_0xf89b('0x11')](_0xf89b('0x12'),_0x2e5588,_0xf89b('0x13'),JSON['stringify'](_0x52481a));if(_0x52481a[_0xf89b('0x14')]){if(_0x52481a['error']['code']===0x1f4){logger[_0xf89b('0x14')](_0xf89b('0x15'),_0x2e5588,_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);return _0x20b25a(_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);}logger['error'](_0xf89b('0x15'),_0x2e5588,_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);return _0x43faa2(_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);}else{logger['info'](_0xf89b('0x15'),_0x2e5588,_0xf89b('0x13'));_0x43faa2(_0x52481a[_0xf89b('0x17')][_0xf89b('0x16')]);}})[_0xf89b('0x18')](function(_0x556841){logger[_0xf89b('0x14')]('SmsAccount,\x20%s,\x20%s',_0x2e5588,_0x556841);_0x20b25a(_0x556841);});});}exports[_0xf89b('0x19')]=function(_0x2fa7e9){var _0xd0c102=this;return new Promise(function(_0x125c72,_0x4ed814){return db[_0xf89b('0x1a')][_0xf89b('0x1b')]({'raw':_0x2fa7e9[_0xf89b('0x1c')]?_0x2fa7e9['options'][_0xf89b('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fa7e9[_0xf89b('0x1c')]?_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x1e')]||null:null,'attributes':_0x2fa7e9['options']?_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x1f')]||null:null,'include':_0x2fa7e9[_0xf89b('0x1c')]?_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x20')]?_[_0xf89b('0x21')](_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x20')],function(_0x2bea6b){return{'model':db[_0x2bea6b[_0xf89b('0x22')]],'as':_0x2bea6b['as'],'attributes':_0x2bea6b[_0xf89b('0x1f')],'include':_0x2bea6b[_0xf89b('0x20')]?_['map'](_0x2bea6b[_0xf89b('0x20')],function(_0x58bafc){return{'model':db[_0x58bafc[_0xf89b('0x22')]],'as':_0x58bafc['as'],'attributes':_0x58bafc[_0xf89b('0x1f')],'include':_0x58bafc[_0xf89b('0x20')]?_[_0xf89b('0x21')](_0x58bafc[_0xf89b('0x20')],function(_0x36dd09){return{'model':db[_0x36dd09[_0xf89b('0x22')]],'as':_0x36dd09['as'],'attributes':_0x36dd09['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e64a6){logger[_0xf89b('0x23')](_0xf89b('0x19'),_0x2fa7e9);logger[_0xf89b('0x11')](_0xf89b('0x19'),_0x2fa7e9,JSON[_0xf89b('0x24')](_0x1e64a6));_0x125c72(_0x1e64a6);})[_0xf89b('0x18')](function(_0x451b9b){logger[_0xf89b('0x14')](_0xf89b('0x19'),_0x451b9b[_0xf89b('0x16')],_0x2fa7e9);_0x4ed814(_0xd0c102[_0xf89b('0x14')](0x1f4,_0x451b9b['message']));});});}; \ No newline at end of file +var _0xa707=['where','attributes','map','model','include','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSmsAccount','find','options'];(function(_0x4855ce,_0x3fbf65){var _0x150377=function(_0x21555b){while(--_0x21555b){_0x4855ce['push'](_0x4855ce['shift']());}};_0x150377(++_0x3fbf65);}(_0xa707,0x125));var _0x7a70=function(_0x2c5b8f,_0x55907c){_0x2c5b8f=_0x2c5b8f-0x0;var _0x1753a2=_0xa707[_0x2c5b8f];return _0x1753a2;};'use strict';var _=require(_0x7a70('0x0'));var util=require(_0x7a70('0x1'));var moment=require(_0x7a70('0x2'));var BPromise=require(_0x7a70('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a70('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a70('0x5'));var logger=require(_0x7a70('0x6'))(_0x7a70('0x7'));var config=require(_0x7a70('0x8'));var jayson=require(_0x7a70('0x9'));var client=jayson[_0x7a70('0xa')]['http']({'port':0x232a});config[_0x7a70('0xb')]=_[_0x7a70('0xc')](config[_0x7a70('0xb')],{'host':_0x7a70('0xd'),'port':0x18eb});var socket=require(_0x7a70('0xe'))(new Redis(config[_0x7a70('0xb')]));require('./smsAccount.socket')[_0x7a70('0xf')](socket);function respondWithRpcPromise(_0x191e75,_0x30cca3,_0x3d97f8){return new BPromise(function(_0x412677,_0x1468f3){return client[_0x7a70('0x10')](_0x191e75,_0x3d97f8)[_0x7a70('0x11')](function(_0x1afa9d){logger[_0x7a70('0x12')](_0x7a70('0x13'),_0x30cca3,_0x7a70('0x14'));logger[_0x7a70('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x30cca3,'request\x20sent',JSON[_0x7a70('0x16')](_0x1afa9d));if(_0x1afa9d[_0x7a70('0x17')]){if(_0x1afa9d[_0x7a70('0x17')][_0x7a70('0x18')]===0x1f4){logger['error'](_0x7a70('0x13'),_0x30cca3,_0x1afa9d[_0x7a70('0x17')][_0x7a70('0x19')]);return _0x1468f3(_0x1afa9d[_0x7a70('0x17')][_0x7a70('0x19')]);}logger[_0x7a70('0x17')](_0x7a70('0x13'),_0x30cca3,_0x1afa9d['error']['message']);return _0x412677(_0x1afa9d[_0x7a70('0x17')]['message']);}else{logger[_0x7a70('0x12')](_0x7a70('0x13'),_0x30cca3,_0x7a70('0x14'));_0x412677(_0x1afa9d[_0x7a70('0x1a')]['message']);}})[_0x7a70('0x1b')](function(_0x27d751){logger[_0x7a70('0x17')](_0x7a70('0x13'),_0x30cca3,_0x27d751);_0x1468f3(_0x27d751);});});}exports[_0x7a70('0x1c')]=function(_0x59c2eb){var _0x545a3e=this;return new Promise(function(_0x3a2df9,_0x2e0851){return db['SmsAccount'][_0x7a70('0x1d')]({'raw':_0x59c2eb[_0x7a70('0x1e')]?_0x59c2eb['options']['raw']===undefined?!![]:![]:!![],'where':_0x59c2eb['options']?_0x59c2eb[_0x7a70('0x1e')][_0x7a70('0x1f')]||null:null,'attributes':_0x59c2eb[_0x7a70('0x1e')]?_0x59c2eb[_0x7a70('0x1e')][_0x7a70('0x20')]||null:null,'include':_0x59c2eb[_0x7a70('0x1e')]?_0x59c2eb['options']['include']?_[_0x7a70('0x21')](_0x59c2eb['options']['include'],function(_0x23f370){return{'model':db[_0x23f370[_0x7a70('0x22')]],'as':_0x23f370['as'],'attributes':_0x23f370[_0x7a70('0x20')],'include':_0x23f370[_0x7a70('0x23')]?_['map'](_0x23f370[_0x7a70('0x23')],function(_0x5c5fd6){return{'model':db[_0x5c5fd6[_0x7a70('0x22')]],'as':_0x5c5fd6['as'],'attributes':_0x5c5fd6[_0x7a70('0x20')],'include':_0x5c5fd6[_0x7a70('0x23')]?_[_0x7a70('0x21')](_0x5c5fd6[_0x7a70('0x23')],function(_0x641169){return{'model':db[_0x641169['model']],'as':_0x641169['as'],'attributes':_0x641169[_0x7a70('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32b141){logger[_0x7a70('0x12')](_0x7a70('0x1c'),_0x59c2eb);logger['debug']('ShowSmsAccount',_0x59c2eb,JSON[_0x7a70('0x16')](_0x32b141));_0x3a2df9(_0x32b141);})['catch'](function(_0x2edffe){logger[_0x7a70('0x17')](_0x7a70('0x1c'),_0x2edffe['message'],_0x59c2eb);_0x2e0851(_0x545a3e['error'](0x1f4,_0x2edffe['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 690f59a..711df62 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 5976f29..0d8e8af 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x43409f,_0x381529){var _0x4e71cc=function(_0x32c876){while(--_0x32c876){_0x43409f['push'](_0x43409f['shift']());}};_0x4e71cc(++_0x381529);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c16c4,_0x1f4fb2){_0x4c16c4=_0x4c16c4-0x0;var _0x2d2ddf=_0xedd9[_0x4c16c4];return _0x2d2ddf;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1a2ef3,_0x21186c){var _0x34f4a4=function(_0x277126){while(--_0x277126){_0x1a2ef3['push'](_0x1a2ef3['shift']());}};_0x34f4a4(++_0x21186c);}(_0x34e8,0x12c));var _0x834e=function(_0x5438ac,_0x91ee4a){_0x5438ac=_0x5438ac-0x0;var _0x31afd3=_0x34e8[_0x5438ac];return _0x31afd3;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 26827a2..3bc6527 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 _0xf36b=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x5c0dd3,_0x121bea){var _0x428248=function(_0x25a209){while(--_0x25a209){_0x5c0dd3['push'](_0x5c0dd3['shift']());}};_0x428248(++_0x121bea);}(_0xf36b,0x122));var _0xbf36=function(_0x2ee185,_0x51c0ab){_0x2ee185=_0x2ee185-0x0;var _0x474975=_0xf36b[_0x2ee185];return _0x474975;};'use strict';var Sequelize=require(_0xbf36('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbf36('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbf36('0x2')],'allowNull':![],'defaultValue':_0xbf36('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbf36('0x2')],'defaultValue':_0xbf36('0x4')}}; \ No newline at end of file +var _0x45a6=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0xcdbcd1,_0x2a36a6){var _0x507741=function(_0x3ab4f2){while(--_0x3ab4f2){_0xcdbcd1['push'](_0xcdbcd1['shift']());}};_0x507741(++_0x2a36a6);}(_0x45a6,0xd2));var _0x645a=function(_0x288fb8,_0x59a723){_0x288fb8=_0x288fb8-0x0;var _0x46bd4b=_0x45a6[_0x288fb8];return _0x46bd4b;};'use strict';var Sequelize=require(_0x645a('0x0'));module[_0x645a('0x1')]={'priority':{'type':Sequelize[_0x645a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x645a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x645a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x645a('0x3')],'defaultValue':_0x645a('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 273040f..a3c3de6 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 _0x988b=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','then','stack','name','send','index','map','SmsApplication','fieldName','key','query','intersection','model','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','type'];(function(_0x4a6df7,_0x5a7cf0){var _0x392744=function(_0x57e6e5){while(--_0x57e6e5){_0x4a6df7['push'](_0x4a6df7['shift']());}};_0x392744(++_0x5a7cf0);}(_0x988b,0x125));var _0xb988=function(_0x38c3c4,_0x22fa29){_0x38c3c4=_0x38c3c4-0x0;var _0x2cf445=_0x988b[_0x38c3c4];return _0x2cf445;};'use strict';var emlformat=require(_0xb988('0x0'));var rimraf=require(_0xb988('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb988('0x2'));var rp=require(_0xb988('0x3'));var moment=require('moment');var BPromise=require(_0xb988('0x4'));var Mustache=require(_0xb988('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb988('0x6'));var csv=require(_0xb988('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb988('0x8'));var _=require(_0xb988('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb988('0xa'));var toCsv=require(_0xb988('0x7'));var querystring=require(_0xb988('0xb'));var Papa=require('papaparse');var Redis=require(_0xb988('0xc'));var authService=require(_0xb988('0xd'));var qs=require(_0xb988('0xe'));var as=require(_0xb988('0xf'));var hardwareService=require(_0xb988('0x10'));var logger=require('../../config/logger')(_0xb988('0x11'));var utils=require(_0xb988('0x12'));var config=require(_0xb988('0x13'));var licenseUtil=require(_0xb988('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56000a,_0x340128){_0x340128=_0x340128||0xcc;return function(_0x210004){if(_0x210004){return _0x56000a[_0xb988('0x15')](_0x340128);}return _0x56000a[_0xb988('0x16')](_0x340128)[_0xb988('0x17')]();};}function respondWithResult(_0x16db25,_0x3e5220){_0x3e5220=_0x3e5220||0xc8;return function(_0x48e687){if(_0x48e687){return _0x16db25['status'](_0x3e5220)['json'](_0x48e687);}};}function respondWithFilteredResult(_0x50c151,_0x33c1eb){return function(_0xcffea9){if(_0xcffea9){var _0x2c8d1c=typeof _0x33c1eb[_0xb988('0x18')]===_0xb988('0x19')&&typeof _0x33c1eb['limit']===_0xb988('0x19');var _0x50f140=_0xcffea9[_0xb988('0x1a')];var _0x5ce6b8=_0x2c8d1c?0x0:_0x33c1eb[_0xb988('0x18')];var _0x3c5c2e=_0x2c8d1c?_0xcffea9[_0xb988('0x1a')]:_0x33c1eb[_0xb988('0x18')]+_0x33c1eb[_0xb988('0x1b')];var _0x4ce92c;if(_0x3c5c2e>=_0x50f140){_0x3c5c2e=_0x50f140;_0x4ce92c=0xc8;}else{_0x4ce92c=0xce;}_0x50c151[_0xb988('0x16')](_0x4ce92c);return _0x50c151[_0xb988('0x1c')](_0xb988('0x1d'),_0x5ce6b8+'-'+_0x3c5c2e+'/'+_0x50f140)[_0xb988('0x1e')](_0xcffea9);}return null;};}function patchUpdates(_0x3d66af){return function(_0x34f7fa){try{jsonpatch['apply'](_0x34f7fa,_0x3d66af,!![]);}catch(_0x5afc5f){return BPromise[_0xb988('0x1f')](_0x5afc5f);}return _0x34f7fa['save']();};}function saveUpdates(_0x56fa1d,_0x12317e){return function(_0x30b053){if(_0x30b053){return _0x30b053[_0xb988('0x20')](_0x56fa1d)['then'](function(_0x2c9684){return _0x2c9684;});}return null;};}function removeEntity(_0x3a4ea7,_0x2481c0){return function(_0x53db49){if(_0x53db49){return _0x53db49[_0xb988('0x21')]()[_0xb988('0x22')](function(){_0x3a4ea7['status'](0xcc)[_0xb988('0x17')]();});}};}function handleEntityNotFound(_0x37bd05,_0x345a28){return function(_0x51cae8){if(!_0x51cae8){_0x37bd05['sendStatus'](0x194);}return _0x51cae8;};}function handleError(_0xc64a65,_0x555205){_0x555205=_0x555205||0x1f4;return function(_0x3a9c2d){logger['error'](_0x3a9c2d[_0xb988('0x23')]);if(_0x3a9c2d[_0xb988('0x24')]){delete _0x3a9c2d[_0xb988('0x24')];}_0xc64a65['status'](_0x555205)[_0xb988('0x25')](_0x3a9c2d);};}exports[_0xb988('0x26')]=function(_0x1eb5d0,_0x109754){var _0x527360={},_0x70f617={},_0x193d50={'count':0x0,'rows':[]};var _0x3fb876=_[_0xb988('0x27')](db[_0xb988('0x28')]['rawAttributes'],function(_0x314fab){return{'name':_0x314fab[_0xb988('0x29')],'type':_0x314fab['type'][_0xb988('0x2a')]};});_0x70f617['model']=_[_0xb988('0x27')](_0x3fb876,'name');_0x70f617[_0xb988('0x2b')]=_['keys'](_0x1eb5d0[_0xb988('0x2b')]);_0x70f617['filters']=_[_0xb988('0x2c')](_0x70f617[_0xb988('0x2d')],_0x70f617[_0xb988('0x2b')]);_0x527360[_0xb988('0x2e')]=_[_0xb988('0x2c')](_0x70f617[_0xb988('0x2d')],qs[_0xb988('0x2f')](_0x1eb5d0[_0xb988('0x2b')]['fields']));_0x527360[_0xb988('0x2e')]=_0x527360[_0xb988('0x2e')][_0xb988('0x30')]?_0x527360[_0xb988('0x2e')]:_0x70f617[_0xb988('0x2d')];if(!_0x1eb5d0[_0xb988('0x2b')]['hasOwnProperty'](_0xb988('0x31'))){_0x527360['limit']=qs[_0xb988('0x1b')](_0x1eb5d0[_0xb988('0x2b')]['limit']);_0x527360['offset']=qs[_0xb988('0x18')](_0x1eb5d0['query'][_0xb988('0x18')]);}_0x527360['order']=qs[_0xb988('0x32')](_0x1eb5d0[_0xb988('0x2b')][_0xb988('0x32')]);_0x527360['where']=qs[_0xb988('0x33')](_[_0xb988('0x34')](_0x1eb5d0[_0xb988('0x2b')],_0x70f617['filters']),_0x3fb876);if(_0x1eb5d0['query'][_0xb988('0x35')]){_0x527360[_0xb988('0x36')]=_[_0xb988('0x37')](_0x527360[_0xb988('0x36')],{'$or':_[_0xb988('0x27')](_0x3fb876,function(_0x5d812b){if(_0x5d812b[_0xb988('0x38')]!==_0xb988('0x39')){var _0x4f35f8={};_0x4f35f8[_0x5d812b[_0xb988('0x24')]]={'$like':'%'+_0x1eb5d0['query'][_0xb988('0x35')]+'%'};return _0x4f35f8;}})});}_0x527360=_['merge']({},_0x527360,_0x1eb5d0[_0xb988('0x3a')]);var _0x45015a={'where':_0x527360[_0xb988('0x36')]};return db[_0xb988('0x28')][_0xb988('0x1a')](_0x45015a)[_0xb988('0x22')](function(_0x2adde1){_0x193d50[_0xb988('0x1a')]=_0x2adde1;if(_0x1eb5d0[_0xb988('0x2b')][_0xb988('0x3b')]){_0x527360[_0xb988('0x3c')]=[{'all':!![]}];}return db['SmsApplication'][_0xb988('0x3d')](_0x527360);})['then'](function(_0x2eadd9){_0x193d50[_0xb988('0x3e')]=_0x2eadd9;return _0x193d50;})[_0xb988('0x22')](respondWithFilteredResult(_0x109754,_0x527360))[_0xb988('0x3f')](handleError(_0x109754,null));};exports['show']=function(_0x28de6b,_0x34c7fb){var _0x413928={'raw':!![],'where':{'id':_0x28de6b[_0xb988('0x40')]['id']}},_0x37c864={};_0x37c864[_0xb988('0x2d')]=_[_0xb988('0x41')](db[_0xb988('0x28')][_0xb988('0x42')]);_0x37c864[_0xb988('0x2b')]=_[_0xb988('0x41')](_0x28de6b['query']);_0x37c864['filters']=_[_0xb988('0x2c')](_0x37c864[_0xb988('0x2d')],_0x37c864[_0xb988('0x2b')]);_0x413928[_0xb988('0x2e')]=_[_0xb988('0x2c')](_0x37c864[_0xb988('0x2d')],qs[_0xb988('0x2f')](_0x28de6b[_0xb988('0x2b')][_0xb988('0x2f')]));_0x413928[_0xb988('0x2e')]=_0x413928[_0xb988('0x2e')][_0xb988('0x30')]?_0x413928[_0xb988('0x2e')]:_0x37c864[_0xb988('0x2d')];if(_0x28de6b[_0xb988('0x2b')][_0xb988('0x3b')]){_0x413928[_0xb988('0x3c')]=[{'all':!![]}];}_0x413928=_[_0xb988('0x37')]({},_0x413928,_0x28de6b['options']);return db[_0xb988('0x28')]['find'](_0x413928)[_0xb988('0x22')](handleEntityNotFound(_0x34c7fb,null))[_0xb988('0x22')](respondWithResult(_0x34c7fb,null))['catch'](handleError(_0x34c7fb,null));};exports[_0xb988('0x43')]=function(_0x3255b6,_0x5a3ceb){return db[_0xb988('0x28')]['create'](_0x3255b6[_0xb988('0x44')],{})[_0xb988('0x22')](respondWithResult(_0x5a3ceb,0xc9))[_0xb988('0x3f')](handleError(_0x5a3ceb,null));};exports['update']=function(_0x1bb61b,_0x42a148){if(_0x1bb61b[_0xb988('0x44')]['id']){delete _0x1bb61b[_0xb988('0x44')]['id'];}return db[_0xb988('0x28')][_0xb988('0x45')]({'where':{'id':_0x1bb61b[_0xb988('0x40')]['id']}})[_0xb988('0x22')](handleEntityNotFound(_0x42a148,null))[_0xb988('0x22')](saveUpdates(_0x1bb61b[_0xb988('0x44')],null))[_0xb988('0x22')](respondWithResult(_0x42a148,null))[_0xb988('0x3f')](handleError(_0x42a148,null));};exports[_0xb988('0x21')]=function(_0x342f84,_0x41c0a3){return db[_0xb988('0x28')]['find']({'where':{'id':_0x342f84['params']['id']}})['then'](handleEntityNotFound(_0x41c0a3,null))[_0xb988('0x22')](removeEntity(_0x41c0a3,null))[_0xb988('0x3f')](handleError(_0x41c0a3,null));}; \ No newline at end of file +var _0x9b7d=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SmsApplication','fieldName','type','key'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x9b7d,0x1de));var _0xd9b7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9b7d[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xd9b7('0x0'));var rimraf=require(_0xd9b7('0x1'));var zipdir=require(_0xd9b7('0x2'));var jsonpatch=require(_0xd9b7('0x3'));var rp=require(_0xd9b7('0x4'));var moment=require(_0xd9b7('0x5'));var BPromise=require(_0xd9b7('0x6'));var Mustache=require('mustache');var util=require(_0xd9b7('0x7'));var path=require(_0xd9b7('0x8'));var sox=require('sox');var csv=require(_0xd9b7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9b7('0xa'));var _=require('lodash');var squel=require(_0xd9b7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9b7('0xc'));var toCsv=require(_0xd9b7('0x9'));var querystring=require('querystring');var Papa=require(_0xd9b7('0xd'));var Redis=require('ioredis');var authService=require(_0xd9b7('0xe'));var qs=require(_0xd9b7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9b7('0x10'));var logger=require(_0xd9b7('0x11'))(_0xd9b7('0x12'));var utils=require('../../config/utils');var config=require(_0xd9b7('0x13'));var licenseUtil=require(_0xd9b7('0x14'));var db=require(_0xd9b7('0x15'))['db'];function respondWithStatusCode(_0x529128,_0x3eeb4f){_0x3eeb4f=_0x3eeb4f||0xcc;return function(_0x3123fb){if(_0x3123fb){return _0x529128['sendStatus'](_0x3eeb4f);}return _0x529128['status'](_0x3eeb4f)[_0xd9b7('0x16')]();};}function respondWithResult(_0x1d8dfd,_0x32f420){_0x32f420=_0x32f420||0xc8;return function(_0x5452a5){if(_0x5452a5){return _0x1d8dfd[_0xd9b7('0x17')](_0x32f420)[_0xd9b7('0x18')](_0x5452a5);}};}function respondWithFilteredResult(_0x1a5103,_0x71f2d8){return function(_0x4c1ae1){if(_0x4c1ae1){var _0x3d59ca=typeof _0x71f2d8[_0xd9b7('0x19')]===_0xd9b7('0x1a')&&typeof _0x71f2d8[_0xd9b7('0x1b')]===_0xd9b7('0x1a');var _0x56c870=_0x4c1ae1[_0xd9b7('0x1c')];var _0x2bc35f=_0x3d59ca?0x0:_0x71f2d8['offset'];var _0x422537=_0x3d59ca?_0x4c1ae1['count']:_0x71f2d8[_0xd9b7('0x19')]+_0x71f2d8[_0xd9b7('0x1b')];var _0x5abea3;if(_0x422537>=_0x56c870){_0x422537=_0x56c870;_0x5abea3=0xc8;}else{_0x5abea3=0xce;}_0x1a5103['status'](_0x5abea3);return _0x1a5103[_0xd9b7('0x1d')](_0xd9b7('0x1e'),_0x2bc35f+'-'+_0x422537+'/'+_0x56c870)[_0xd9b7('0x18')](_0x4c1ae1);}return null;};}function patchUpdates(_0x5a45cd){return function(_0x10a3d6){try{jsonpatch[_0xd9b7('0x1f')](_0x10a3d6,_0x5a45cd,!![]);}catch(_0x383199){return BPromise[_0xd9b7('0x20')](_0x383199);}return _0x10a3d6[_0xd9b7('0x21')]();};}function saveUpdates(_0x5b751b,_0x107dce){return function(_0x3aa579){if(_0x3aa579){return _0x3aa579[_0xd9b7('0x22')](_0x5b751b)[_0xd9b7('0x23')](function(_0x314161){return _0x314161;});}return null;};}function removeEntity(_0x17313d,_0x49dfb4){return function(_0x430a14){if(_0x430a14){return _0x430a14[_0xd9b7('0x24')]()['then'](function(){_0x17313d[_0xd9b7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc2f47e,_0x5b44af){return function(_0xdc4bb9){if(!_0xdc4bb9){_0xc2f47e[_0xd9b7('0x25')](0x194);}return _0xdc4bb9;};}function handleError(_0xd53a3c,_0x300df8){_0x300df8=_0x300df8||0x1f4;return function(_0x26f91c){logger['error'](_0x26f91c[_0xd9b7('0x26')]);if(_0x26f91c[_0xd9b7('0x27')]){delete _0x26f91c[_0xd9b7('0x27')];}_0xd53a3c['status'](_0x300df8)[_0xd9b7('0x28')](_0x26f91c);};}exports[_0xd9b7('0x29')]=function(_0x3af896,_0x4bd93e){var _0x27cca6={},_0x21a430={},_0x502d0d={'count':0x0,'rows':[]};var _0x50a812=_[_0xd9b7('0x2a')](db[_0xd9b7('0x2b')]['rawAttributes'],function(_0x582157){return{'name':_0x582157[_0xd9b7('0x2c')],'type':_0x582157[_0xd9b7('0x2d')][_0xd9b7('0x2e')]};});_0x21a430['model']=_['map'](_0x50a812,_0xd9b7('0x27'));_0x21a430[_0xd9b7('0x2f')]=_[_0xd9b7('0x30')](_0x3af896[_0xd9b7('0x2f')]);_0x21a430[_0xd9b7('0x31')]=_[_0xd9b7('0x32')](_0x21a430[_0xd9b7('0x33')],_0x21a430[_0xd9b7('0x2f')]);_0x27cca6['attributes']=_[_0xd9b7('0x32')](_0x21a430[_0xd9b7('0x33')],qs[_0xd9b7('0x34')](_0x3af896[_0xd9b7('0x2f')][_0xd9b7('0x34')]));_0x27cca6[_0xd9b7('0x35')]=_0x27cca6['attributes'][_0xd9b7('0x36')]?_0x27cca6[_0xd9b7('0x35')]:_0x21a430[_0xd9b7('0x33')];if(!_0x3af896[_0xd9b7('0x2f')][_0xd9b7('0x37')](_0xd9b7('0x38'))){_0x27cca6[_0xd9b7('0x1b')]=qs[_0xd9b7('0x1b')](_0x3af896[_0xd9b7('0x2f')][_0xd9b7('0x1b')]);_0x27cca6[_0xd9b7('0x19')]=qs[_0xd9b7('0x19')](_0x3af896['query'][_0xd9b7('0x19')]);}_0x27cca6[_0xd9b7('0x39')]=qs[_0xd9b7('0x3a')](_0x3af896[_0xd9b7('0x2f')][_0xd9b7('0x3a')]);_0x27cca6['where']=qs[_0xd9b7('0x31')](_[_0xd9b7('0x3b')](_0x3af896[_0xd9b7('0x2f')],_0x21a430[_0xd9b7('0x31')]),_0x50a812);if(_0x3af896[_0xd9b7('0x2f')]['filter']){_0x27cca6[_0xd9b7('0x3c')]=_['merge'](_0x27cca6['where'],{'$or':_[_0xd9b7('0x2a')](_0x50a812,function(_0x5e6866){if(_0x5e6866[_0xd9b7('0x2d')]!==_0xd9b7('0x3d')){var _0x446a30={};_0x446a30[_0x5e6866[_0xd9b7('0x27')]]={'$like':'%'+_0x3af896[_0xd9b7('0x2f')][_0xd9b7('0x3e')]+'%'};return _0x446a30;}})});}_0x27cca6=_[_0xd9b7('0x3f')]({},_0x27cca6,_0x3af896[_0xd9b7('0x40')]);var _0x2a177a={'where':_0x27cca6['where']};return db[_0xd9b7('0x2b')][_0xd9b7('0x1c')](_0x2a177a)[_0xd9b7('0x23')](function(_0x271112){_0x502d0d[_0xd9b7('0x1c')]=_0x271112;if(_0x3af896[_0xd9b7('0x2f')][_0xd9b7('0x41')]){_0x27cca6['include']=[{'all':!![]}];}return db[_0xd9b7('0x2b')][_0xd9b7('0x42')](_0x27cca6);})['then'](function(_0x28c7e0){_0x502d0d[_0xd9b7('0x43')]=_0x28c7e0;return _0x502d0d;})[_0xd9b7('0x23')](respondWithFilteredResult(_0x4bd93e,_0x27cca6))[_0xd9b7('0x44')](handleError(_0x4bd93e,null));};exports[_0xd9b7('0x45')]=function(_0x9eb27a,_0x3d2490){var _0x9b4ec={'raw':!![],'where':{'id':_0x9eb27a['params']['id']}},_0x3dccac={};_0x3dccac['model']=_[_0xd9b7('0x30')](db[_0xd9b7('0x2b')]['rawAttributes']);_0x3dccac['query']=_[_0xd9b7('0x30')](_0x9eb27a[_0xd9b7('0x2f')]);_0x3dccac[_0xd9b7('0x31')]=_['intersection'](_0x3dccac[_0xd9b7('0x33')],_0x3dccac[_0xd9b7('0x2f')]);_0x9b4ec[_0xd9b7('0x35')]=_[_0xd9b7('0x32')](_0x3dccac['model'],qs[_0xd9b7('0x34')](_0x9eb27a[_0xd9b7('0x2f')][_0xd9b7('0x34')]));_0x9b4ec[_0xd9b7('0x35')]=_0x9b4ec[_0xd9b7('0x35')][_0xd9b7('0x36')]?_0x9b4ec[_0xd9b7('0x35')]:_0x3dccac[_0xd9b7('0x33')];if(_0x9eb27a[_0xd9b7('0x2f')]['includeAll']){_0x9b4ec[_0xd9b7('0x46')]=[{'all':!![]}];}_0x9b4ec=_['merge']({},_0x9b4ec,_0x9eb27a[_0xd9b7('0x40')]);return db[_0xd9b7('0x2b')][_0xd9b7('0x47')](_0x9b4ec)['then'](handleEntityNotFound(_0x3d2490,null))['then'](respondWithResult(_0x3d2490,null))['catch'](handleError(_0x3d2490,null));};exports[_0xd9b7('0x48')]=function(_0x18a0c7,_0x2694fd){return db[_0xd9b7('0x2b')][_0xd9b7('0x48')](_0x18a0c7['body'],{})[_0xd9b7('0x23')](respondWithResult(_0x2694fd,0xc9))['catch'](handleError(_0x2694fd,null));};exports['update']=function(_0x54a995,_0xcebd44){if(_0x54a995['body']['id']){delete _0x54a995[_0xd9b7('0x49')]['id'];}return db[_0xd9b7('0x2b')]['find']({'where':{'id':_0x54a995[_0xd9b7('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcebd44,null))['then'](saveUpdates(_0x54a995[_0xd9b7('0x49')],null))[_0xd9b7('0x23')](respondWithResult(_0xcebd44,null))[_0xd9b7('0x44')](handleError(_0xcebd44,null));};exports[_0xd9b7('0x24')]=function(_0x5ddc42,_0x3c27f9){return db[_0xd9b7('0x2b')]['find']({'where':{'id':_0x5ddc42[_0xd9b7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c27f9,null))[_0xd9b7('0x23')](removeEntity(_0x3c27f9,null))[_0xd9b7('0x44')](handleError(_0x3c27f9,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 352f283..59f37c5 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 _0x305f=['SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x305f,0xdb));var _0xf305=function(_0x29f748,_0x237a1e){_0x29f748=_0x29f748-0x0;var _0x4f4591=_0x305f[_0x29f748];return _0x4f4591;};'use strict';var _=require(_0xf305('0x0'));var util=require(_0xf305('0x1'));var logger=require(_0xf305('0x2'))(_0xf305('0x3'));var moment=require(_0xf305('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf305('0x5'));var config=require(_0xf305('0x6'));var attributes=require('./smsApplication.attributes');module[_0xf305('0x7')]=function(_0x2c561f,_0x1e6b00){return _0x2c561f[_0xf305('0x8')](_0xf305('0x9'),attributes,{'tableName':_0xf305('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf305('0xb')});}; \ No newline at end of file +var _0x32df=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x32df,0x1d0));var _0xf32d=function(_0x391900,_0x59d04e){_0x391900=_0x391900-0x0;var _0x2485dd=_0x32df[_0x391900];return _0x2485dd;};'use strict';var _=require('lodash');var util=require(_0xf32d('0x0'));var logger=require(_0xf32d('0x1'))(_0xf32d('0x2'));var moment=require(_0xf32d('0x3'));var BPromise=require(_0xf32d('0x4'));var rp=require(_0xf32d('0x5'));var fs=require('fs');var path=require(_0xf32d('0x6'));var rimraf=require(_0xf32d('0x7'));var config=require(_0xf32d('0x8'));var attributes=require(_0xf32d('0x9'));module[_0xf32d('0xa')]=function(_0x51ce32,_0x248e1d){return _0x51ce32[_0xf32d('0xb')]('SmsApplication',attributes,{'tableName':_0xf32d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf32d('0xd'),'collate':_0xf32d('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 5819e39..9864ad9 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 _0x3024=['rpc','../../config/environment','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3024,0x64));var _0x4302=function(_0x4a5c17,_0x422a49){_0x4a5c17=_0x4a5c17-0x0;var _0x4f65b2=_0x3024[_0x4a5c17];return _0x4f65b2;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var moment=require('moment');var BPromise=require(_0x4302('0x2'));var rs=require(_0x4302('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4302('0x4'));var logger=require('../../config/logger')(_0x4302('0x5'));var config=require(_0x4302('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4302('0x7')][_0x4302('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c3983,_0xced9fc,_0x2aecd7){return new BPromise(function(_0x3c007b,_0x285613){return client[_0x4302('0x9')](_0x4c3983,_0x2aecd7)[_0x4302('0xa')](function(_0x41580c){logger['info'](_0x4302('0xb'),_0xced9fc,_0x4302('0xc'));logger[_0x4302('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xced9fc,_0x4302('0xc'),JSON[_0x4302('0xe')](_0x41580c));if(_0x41580c['error']){if(_0x41580c[_0x4302('0xf')][_0x4302('0x10')]===0x1f4){logger[_0x4302('0xf')]('SmsApplication,\x20%s,\x20%s',_0xced9fc,_0x41580c[_0x4302('0xf')][_0x4302('0x11')]);return _0x285613(_0x41580c['error'][_0x4302('0x11')]);}logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x41580c['error'][_0x4302('0x11')]);return _0x3c007b(_0x41580c[_0x4302('0xf')]['message']);}else{logger[_0x4302('0x12')](_0x4302('0xb'),_0xced9fc,'request\x20sent');_0x3c007b(_0x41580c[_0x4302('0x13')][_0x4302('0x11')]);}})[_0x4302('0x14')](function(_0x32178f){logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x32178f);_0x285613(_0x32178f);});});} \ No newline at end of file +var _0xe98f=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1692d0,_0x1b1339){var _0x564bc1=function(_0x33e7a8){while(--_0x33e7a8){_0x1692d0['push'](_0x1692d0['shift']());}};_0x564bc1(++_0x1b1339);}(_0xe98f,0xde));var _0xfe98=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe98f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xfe98('0x0'));var util=require('util');var moment=require(_0xfe98('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe98('0x2'));var fs=require('fs');var Redis=require(_0xfe98('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe98('0x4'))('rpc');var config=require(_0xfe98('0x5'));var jayson=require(_0xfe98('0x6'));var client=jayson['client'][_0xfe98('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x585363,_0x39bc9f,_0x2721d1){return new BPromise(function(_0x3cbc45,_0x502d20){return client[_0xfe98('0x8')](_0x585363,_0x2721d1)[_0xfe98('0x9')](function(_0x57fc24){logger[_0xfe98('0xa')](_0xfe98('0xb'),_0x39bc9f,_0xfe98('0xc'));logger[_0xfe98('0xd')](_0xfe98('0xe'),_0x39bc9f,_0xfe98('0xc'),JSON['stringify'](_0x57fc24));if(_0x57fc24[_0xfe98('0xf')]){if(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x10')]===0x1f4){logger[_0xfe98('0xf')](_0xfe98('0xb'),_0x39bc9f,_0x57fc24['error'][_0xfe98('0x11')]);return _0x502d20(_0x57fc24[_0xfe98('0xf')]['message']);}logger[_0xfe98('0xf')]('SmsApplication,\x20%s,\x20%s',_0x39bc9f,_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);return _0x3cbc45(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);}else{logger['info'](_0xfe98('0xb'),_0x39bc9f,'request\x20sent');_0x3cbc45(_0x57fc24[_0xfe98('0x12')][_0xfe98('0x11')]);}})[_0xfe98('0x13')](function(_0x476932){logger['error']('SmsApplication,\x20%s,\x20%s',_0x39bc9f,_0x476932);_0x502d20(_0x476932);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f44140d..176b4ba 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(_0x3fc8e8,_0x412f3a){var _0x3d9259=function(_0x5df018){while(--_0x5df018){_0x3fc8e8['push'](_0x3fc8e8['shift']());}};_0x3d9259(++_0x412f3a);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x262323,_0x4a81f1){_0x262323=_0x262323-0x0;var _0xa963c3=_0x4cf8[_0x262323];return _0xa963c3;};'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 _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11a7bb,_0x1d41a3){var _0x403cf0=function(_0x24b622){while(--_0x24b622){_0x11a7bb['push'](_0x11a7bb['shift']());}};_0x403cf0(++_0x1d41a3);}(_0xe605,0x92));var _0x5e60=function(_0x1a355f,_0x229659){_0x1a355f=_0x1a355f-0x0;var _0x270833=_0xe605[_0x1a355f];return _0x270833;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 01e888e..a13d968 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 _0x6c7b=['ENUM','out','BOOLEAN','sequelize','DATE','STRING'];(function(_0x331d75,_0xbbe089){var _0x32619b=function(_0x2255f1){while(--_0x2255f1){_0x331d75['push'](_0x331d75['shift']());}};_0x32619b(++_0xbbe089);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x47bc4b,_0x44f4a0){_0x47bc4b=_0x47bc4b-0x0;var _0x22ca41=_0x6c7b[_0x47bc4b];return _0x22ca41;};'use strict';var Sequelize=require(_0xb6c7('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb6c7('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'note':{'type':Sequelize[_0xb6c7('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb6c7('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in',_0xb6c7('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb6c7('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb6c7('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xea44=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','moment','exports'];(function(_0x358182,_0x3b61ba){var _0x42e27a=function(_0x186bae){while(--_0x186bae){_0x358182['push'](_0x358182['shift']());}};_0x42e27a(++_0x3b61ba);}(_0xea44,0x1a5));var _0x4ea4=function(_0x771d5d,_0x43ef0f){_0x771d5d=_0x771d5d-0x0;var _0x2f1da8=_0xea44[_0x771d5d];return _0x2f1da8;};'use strict';var Sequelize=require(_0x4ea4('0x0'));var moment=require(_0x4ea4('0x1'));module[_0x4ea4('0x2')]={'closed':{'type':Sequelize[_0x4ea4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4ea4('0x4')]},'secondDisposition':{'type':Sequelize[_0x4ea4('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4ea4('0x4')]},'phone':{'type':Sequelize[_0x4ea4('0x4')]},'read1stAt':{'type':Sequelize[_0x4ea4('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x4ea4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4ea4('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x4ea4('0x6')]('in',_0x4ea4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4ea4('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 83ea802..d7f2e53 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 _0x5827=['getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','count','rows','addTags','setTags','Tag','color','emit','smsInteractionTags:save','removeTags','download','toString','join','root','server','tmp','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','read','SmsAccount','Account','Owner','mkdirSync','N.A.','closed','closedAt','out','System','secret','renderFile','views','transcript-','.pdf','Sms','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','undefined','limit','offset','set','Content-Range','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','SmsInteraction','keys','filters','intersection','model','attributes','fields','includeAll','include','merge','options','create','body','find','describe','addMessage','SmsMessage','omit','ids'];(function(_0x2faa3b,_0x49881f){var _0x2258c7=function(_0x2249a2){while(--_0x2249a2){_0x2faa3b['push'](_0x2faa3b['shift']());}};_0x2258c7(++_0x49881f);}(_0x5827,0xb0));var _0x7582=function(_0x5e4a48,_0x1c6958){_0x5e4a48=_0x5e4a48-0x0;var _0x5edeab=_0x5827[_0x5e4a48];return _0x5edeab;};'use strict';var rimraf=require(_0x7582('0x0'));var zipdir=require(_0x7582('0x1'));var moment=require(_0x7582('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var ejs=require(_0x7582('0x3'));var fs=require('fs');var _=require(_0x7582('0x4'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x7582('0x5'));var pdf=require(_0x7582('0x6'));var logger=require('../../config/logger')(_0x7582('0x7'));var config=require('../../config/environment');var db=require(_0x7582('0x8'))['db'];config[_0x7582('0x9')]=_[_0x7582('0xa')](config['redis'],{'host':_0x7582('0xb'),'port':0x18eb});var socket=require(_0x7582('0xc'))(new Redis(config['redis']));require(_0x7582('0xd'))[_0x7582('0xe')](socket);function respondWithStatusCode(_0x504057,_0x41700b){_0x41700b=_0x41700b||0xcc;return function(_0x766fc4){if(_0x766fc4){return _0x504057[_0x7582('0xf')](_0x41700b);}return _0x504057[_0x7582('0x10')](_0x41700b)['end']();};}function respondWithResult(_0x5d8750,_0x31b3b7){_0x31b3b7=_0x31b3b7||0xc8;return function(_0x362064){if(_0x362064){return _0x5d8750[_0x7582('0x10')](_0x31b3b7)[_0x7582('0x11')](_0x362064);}};}function respondWithFilteredResult(_0x141470,_0x29114a){return function(_0x260d1e){if(_0x260d1e){var _0x3b343a=typeof _0x29114a['offset']===_0x7582('0x12')&&typeof _0x29114a[_0x7582('0x13')]===_0x7582('0x12');var _0x59abbd=_0x260d1e['count'];var _0x2f42c5=_0x3b343a?0x0:_0x29114a[_0x7582('0x14')];var _0x161035=_0x3b343a?_0x260d1e['count']:_0x29114a[_0x7582('0x14')]+_0x29114a[_0x7582('0x13')];var _0x567880;if(_0x161035>=_0x59abbd){_0x161035=_0x59abbd;_0x567880=0xc8;}else{_0x567880=0xce;}_0x141470['status'](_0x567880);return _0x141470[_0x7582('0x15')](_0x7582('0x16'),_0x2f42c5+'-'+_0x161035+'/'+_0x59abbd)['json'](_0x260d1e);}return null;};}function saveUpdates(_0xcb26a){return function(_0x42a5ce){if(_0x42a5ce){return _0x42a5ce['update'](_0xcb26a)[_0x7582('0x17')](function(_0x5f1bff){return _0x5f1bff;});}return null;};}function removeEntity(_0x38aed2){return function(_0x4422e5){if(_0x4422e5){return _0x4422e5[_0x7582('0x18')]()[_0x7582('0x17')](function(){_0x38aed2[_0x7582('0x10')](0xcc)[_0x7582('0x19')]();});}};}function handleEntityNotFound(_0x24df35){return function(_0x238f27){if(!_0x238f27){_0x24df35[_0x7582('0xf')](0x194);}return _0x238f27;};}function handleError(_0x34b131,_0x37f9e2){_0x37f9e2=_0x37f9e2||0x1f4;return function(_0x59a0a7){logger[_0x7582('0x1a')](_0x59a0a7['stack']);if(_0x59a0a7[_0x7582('0x1b')]){delete _0x59a0a7[_0x7582('0x1b')];}_0x34b131[_0x7582('0x10')](_0x37f9e2)[_0x7582('0x1c')](_0x59a0a7);};}exports[_0x7582('0x1d')]=function(_0x53df0e,_0x235416){var _0x1741ef={};var _0x1f8de4=_[_0x7582('0x1e')](db['SmsInteraction'][_0x7582('0x1f')],function(_0x32f8ba){return{'name':_0x32f8ba[_0x7582('0x20')],'type':_0x32f8ba[_0x7582('0x21')][_0x7582('0x22')]};});_0x1741ef=qs[_0x7582('0x23')](_0x1f8de4,_0x53df0e);return interaction[_0x7582('0x24')](_0x7582('0x25'),_0x53df0e[_0x7582('0x26')],_0x53df0e[_0x7582('0x27')],_0x1741ef,_0x1f8de4)['then'](respondWithFilteredResult(_0x235416,_0x1741ef))[_0x7582('0x28')](handleError(_0x235416,null));};exports[_0x7582('0x29')]=function(_0x19fef2,_0x16e731){var _0x248cc5={'raw':![],'where':{'id':_0x19fef2[_0x7582('0x2a')]['id']}},_0x54569d={};_0x54569d['model']=_['keys'](db[_0x7582('0x2b')][_0x7582('0x1f')]);_0x54569d[_0x7582('0x26')]=_[_0x7582('0x2c')](_0x19fef2[_0x7582('0x26')]);_0x54569d[_0x7582('0x2d')]=_[_0x7582('0x2e')](_0x54569d[_0x7582('0x2f')],_0x54569d[_0x7582('0x26')]);_0x248cc5[_0x7582('0x30')]=_[_0x7582('0x2e')](_0x54569d['model'],qs['fields'](_0x19fef2['query'][_0x7582('0x31')]));_0x248cc5['attributes']=_0x248cc5[_0x7582('0x30')]['length']?_0x248cc5[_0x7582('0x30')]:_0x54569d[_0x7582('0x2f')];if(_0x19fef2[_0x7582('0x26')][_0x7582('0x32')]){_0x248cc5[_0x7582('0x33')]=[{'all':!![]}];}_0x248cc5=_[_0x7582('0x34')]({},_0x248cc5,_0x19fef2[_0x7582('0x35')]);return db[_0x7582('0x2b')]['find'](_0x248cc5)[_0x7582('0x17')](handleEntityNotFound(_0x16e731,null))['then'](respondWithResult(_0x16e731,null))[_0x7582('0x28')](handleError(_0x16e731,null));};exports[_0x7582('0x36')]=function(_0x457c68,_0xa1029b){return db[_0x7582('0x2b')]['create'](_0x457c68[_0x7582('0x37')],{})['then'](respondWithResult(_0xa1029b,0xc9))['catch'](handleError(_0xa1029b,null));};exports['update']=function(_0x27d50f,_0x3a6e31){if(_0x27d50f['body']['id']){delete _0x27d50f[_0x7582('0x37')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x27d50f[_0x7582('0x2a')]['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x3a6e31,null))[_0x7582('0x17')](saveUpdates(_0x27d50f[_0x7582('0x37')],null))['then'](respondWithResult(_0x3a6e31,null))[_0x7582('0x28')](handleError(_0x3a6e31,null));};exports['destroy']=function(_0x235528,_0x232d4f){return db[_0x7582('0x2b')][_0x7582('0x38')]({'where':{'id':_0x235528[_0x7582('0x2a')]['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x232d4f,null))[_0x7582('0x17')](removeEntity(_0x232d4f,null))[_0x7582('0x28')](handleError(_0x232d4f,null));};exports[_0x7582('0x39')]=function(_0x4fc39a,_0xb8ed35){return db['SmsInteraction'][_0x7582('0x39')]()['then'](respondWithResult(_0xb8ed35,null))[_0x7582('0x28')](handleError(_0xb8ed35,null));};exports[_0x7582('0x3a')]=function(_0x2320f7,_0x4aa240){return db[_0x7582('0x3b')][_0x7582('0x38')]({'where':{'id':_0x2320f7[_0x7582('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4aa240,null))[_0x7582('0x17')](function(_0xd13856){if(_0xd13856){return _0xd13856['addMessage'](_0x2320f7[_0x7582('0x37')]['ids'],_[_0x7582('0x3c')](_0x2320f7[_0x7582('0x37')],[_0x7582('0x3d'),'id'])||{});}})[_0x7582('0x17')](respondWithResult(_0x4aa240,null))[_0x7582('0x28')](handleError(_0x4aa240,null));};exports[_0x7582('0x3e')]=function(_0x5b8c20,_0x77e9dd){var _0x4cfdf9={'raw':![],'where':{}};var _0x1996bb={};var _0x23f866={'count':0x0,'rows':[]};return db[_0x7582('0x2b')][_0x7582('0x3f')]({'where':{'id':_0x5b8c20['params']['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x77e9dd,null))[_0x7582('0x17')](function(_0x2faf43){if(_0x2faf43){_0x1996bb['model']=_['keys'](db[_0x7582('0x3b')][_0x7582('0x1f')]);_0x1996bb['query']=_[_0x7582('0x2c')](_0x5b8c20[_0x7582('0x26')]);_0x1996bb[_0x7582('0x2d')]=_[_0x7582('0x2e')](_0x1996bb['model'],_0x1996bb['query']);_0x4cfdf9[_0x7582('0x30')]=_[_0x7582('0x2e')](_0x1996bb[_0x7582('0x2f')],qs[_0x7582('0x31')](_0x5b8c20[_0x7582('0x26')][_0x7582('0x31')]));_0x4cfdf9[_0x7582('0x30')]=_0x4cfdf9[_0x7582('0x30')][_0x7582('0x40')]?_0x4cfdf9[_0x7582('0x30')]:_0x1996bb['model'];if(!_0x5b8c20[_0x7582('0x26')][_0x7582('0x41')](_0x7582('0x42'))){_0x4cfdf9[_0x7582('0x13')]=qs[_0x7582('0x13')](_0x5b8c20[_0x7582('0x26')][_0x7582('0x13')]);_0x4cfdf9[_0x7582('0x14')]=qs['offset'](_0x5b8c20[_0x7582('0x26')][_0x7582('0x14')]);}_0x4cfdf9['order']=qs['sort'](_0x5b8c20[_0x7582('0x26')][_0x7582('0x43')]);_0x4cfdf9[_0x7582('0x44')]=qs['filters'](_[_0x7582('0x45')](_0x5b8c20['query'],_0x1996bb[_0x7582('0x2d')]));_0x4cfdf9['where'][_0x7582('0x46')]=_0x2faf43['id'];if(_0x5b8c20[_0x7582('0x26')]['filter']){_0x4cfdf9[_0x7582('0x44')]=_[_0x7582('0x34')](_0x4cfdf9[_0x7582('0x44')],{'$or':_[_0x7582('0x1e')](_0x4cfdf9[_0x7582('0x30')],function(_0x5ca1b6){var _0x347730={};_0x347730[_0x5ca1b6]={'$like':'%'+_0x5b8c20['query'][_0x7582('0x47')]+'%'};return _0x347730;})});}if(_0x5b8c20[_0x7582('0x26')][_0x7582('0x48')]){var _0x41adea=_0x5b8c20[_0x7582('0x26')]['$gte']['split'](',');var _0x368f8e={};_0x368f8e[_0x41adea[0x0]]={'$gte':moment(_0x41adea[0x1])[_0x7582('0x49')](_0x7582('0x4a'))};_0x4cfdf9[_0x7582('0x44')]=_[_0x7582('0x34')](_0x4cfdf9[_0x7582('0x44')],_0x368f8e);}_0x4cfdf9=_['merge']({},_0x4cfdf9,_0x5b8c20[_0x7582('0x35')]);return db[_0x7582('0x3b')][_0x7582('0x4b')]({'where':_0x4cfdf9['where']})[_0x7582('0x17')](function(_0x31140b){_0x23f866['count']=_0x31140b;if(_0x5b8c20['query'][_0x7582('0x32')]){_0x4cfdf9[_0x7582('0x33')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x4cfdf9);})[_0x7582('0x17')](function(_0x1bba18){_0x23f866[_0x7582('0x4c')]=_0x1bba18;return _0x23f866;});}})[_0x7582('0x17')](respondWithFilteredResult(_0x77e9dd,_0x4cfdf9))[_0x7582('0x28')](handleError(_0x77e9dd,null));};exports[_0x7582('0x4d')]=function(_0x2f4236,_0x552892){return db[_0x7582('0x2b')]['find']({'where':{'id':_0x2f4236['params']['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x552892,null))[_0x7582('0x17')](function(_0x5e32bc){if(_0x5e32bc){return _0x5e32bc[_0x7582('0x4e')](_0x2f4236[_0x7582('0x37')][_0x7582('0x3d')],_[_0x7582('0x3c')](_0x2f4236[_0x7582('0x37')],['ids','id'])||{})['spread'](function(){return db[_0x7582('0x4f')][_0x7582('0x24')]({'attributes':['id',_0x7582('0x1b'),_0x7582('0x50')],'where':{'id':_0x2f4236[_0x7582('0x37')]['ids']}});})[_0x7582('0x17')](function(_0x51647b){socket[_0x7582('0x51')](_0x7582('0x52'),{'id':Number(_0x2f4236[_0x7582('0x2a')]['id']),'tags':_0x51647b||[]});return{'id':Number(_0x2f4236[_0x7582('0x2a')]['id']),'tags':_0x51647b||[]};});}})[_0x7582('0x17')](respondWithResult(_0x552892,null))[_0x7582('0x28')](handleError(_0x552892,null));};exports[_0x7582('0x53')]=function(_0x22654a,_0x9ceaba){return db[_0x7582('0x2b')]['find']({'where':{'id':_0x22654a['params']['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x9ceaba,null))[_0x7582('0x17')](function(_0x196b57){if(_0x196b57){return _0x196b57['removeTags'](_0x22654a[_0x7582('0x26')]['ids']);}})[_0x7582('0x17')](respondWithStatusCode(_0x9ceaba,null))[_0x7582('0x28')](handleError(_0x9ceaba,null));};exports[_0x7582('0x54')]=function(_0x5dc3f7,_0x590798){var _0x8f34b0=moment()['unix']()[_0x7582('0x55')]();var _0x5bc610=path[_0x7582('0x56')](config[_0x7582('0x57')],_0x7582('0x58'),'files',_0x7582('0x59'));var _0xf9ee12=path['join'](_0x5bc610,_0x8f34b0);var _0x4eec37=util[_0x7582('0x49')]('transcript-%d-%s.zip',_0x5dc3f7[_0x7582('0x2a')]['id'],_0x8f34b0);var _0x3bdb36=path[_0x7582('0x56')](_0x5bc610,_0x4eec37);var _0x261fed=[];_0x261fed[_0x7582('0x5a')]({'model':db['User'],'as':_0x7582('0x5b'),'attributes':['id',_0x7582('0x5c')],'raw':!![]});_0x261fed[_0x7582('0x5a')]({'model':db[_0x7582('0x5d')],'as':_0x7582('0x5e'),'attributes':['id',_0x7582('0x5f'),_0x7582('0x60')],'raw':!![]});var _0x29e94a=[{'model':db['SmsMessage'],'as':_0x7582('0x61'),'attributes':['id',_0x7582('0x37'),_0x7582('0x62'),_0x7582('0x63'),'secret',_0x7582('0x64')],'include':_0x261fed}];_0x29e94a['push']({'model':db[_0x7582('0x65')],'as':_0x7582('0x66'),'attributes':['id','name']});_0x29e94a[_0x7582('0x5a')]({'model':db[_0x7582('0x5b')],'as':_0x7582('0x67'),'attributes':['id',_0x7582('0x5c')]});return db[_0x7582('0x2b')][_0x7582('0x38')]({'where':{'id':_0x5dc3f7[_0x7582('0x2a')]['id']},'include':_0x29e94a})[_0x7582('0x17')](handleEntityNotFound(_0x590798,null))['then'](function(_0xe992a){if(_0xe992a){var _0x4071c6=_0xe992a['get']({'plain':!![]});fs[_0x7582('0x68')](_0xf9ee12);var _0x2c6883={'channel':'Sms','account':_0x4071c6[_0x7582('0x66')][_0x7582('0x1b')],'agent':_0x4071c6['Owner']?_0x4071c6[_0x7582('0x67')]['fullname']:_0x7582('0x69'),'createdAt':moment(_0x4071c6[_0x7582('0x62')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4071c6[_0x7582('0x6a')]?moment(_0x4071c6[_0x7582('0x6b')])[_0x7582('0x49')](_0x7582('0x4a'))[_0x7582('0x55')]():'','disposition':_0x4071c6['disposition'],'messages':_(_0x4071c6[_0x7582('0x61')])['filter']({'secret':![]})[_0x7582('0x1e')](function(_0xf49e00){return{'date':moment(_0xf49e00[_0x7582('0x62')])[_0x7582('0x49')](_0x7582('0x4a'))[_0x7582('0x55')](),'sender':_0xf49e00[_0x7582('0x63')]===_0x7582('0x6c')?_0xf49e00['User']?_0xf49e00['User'][_0x7582('0x5c')]:_0x7582('0x6d'):_0xf49e00['Contact'][_0x7582('0x5f')]+(_0xf49e00[_0x7582('0x5e')]['lastName']?'\x20'+_0xf49e00[_0x7582('0x5e')][_0x7582('0x60')]:''),'body':_0xf49e00['body'],'direction':_0xf49e00[_0x7582('0x63')]===_0x7582('0x6c')?'A':'C','secret':_0xf49e00[_0x7582('0x6e')],'read':_0xf49e00[_0x7582('0x64')]};})['value']()};return ejs[_0x7582('0x6f')](path[_0x7582('0x56')](config[_0x7582('0x57')],_0x7582('0x58'),_0x7582('0x70'),'downloadInteraction.ejs'),{'interaction':_0x2c6883})['then'](function(_0x5c2f90){var _0x207843=path[_0x7582('0x56')](_0xf9ee12,_0x7582('0x71')+_0x4071c6['id']+'-'+_0x8f34b0+_0x7582('0x72'));var _0x168b88={'path':_0x207843,'channel':_0x7582('0x73'),'interactionId':_0x4071c6['id']};return pdf[_0x7582('0x74')](_0x5c2f90,_0x168b88);})[_0x7582('0x17')](function(){return new BPromise(function(_0x3bd235,_0x5e43d9){zipdir(_0xf9ee12,{'saveTo':_0x3bdb36},function(_0x3d500c,_0x1a925a){if(_0x3d500c)return _0x5e43d9(_0x3d500c);return _0x3bd235(_0x1a925a);});})[_0x7582('0x17')](function(){return new BPromise(function(_0x4f2104,_0x52dd56){rimraf(_0xf9ee12,function(_0x492de5){if(_0x492de5)_0x52dd56(_0x492de5);return _0x4f2104();});});})['then'](function(){return _0x590798[_0x7582('0x54')](_0x3bdb36,_0x4eec37,function(_0x1db771){if(_0x1db771){console[_0x7582('0x75')]('err',_0x1db771);}else{fs[_0x7582('0x76')](_0x3bdb36);}});});});}else{return _0x590798[_0x7582('0xf')](0xc8);}})['catch'](handleError(_0x590798,null));}; \ No newline at end of file +var _0xe8a1=['ids','findOne','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','join','root','files','tmp','transcript-%d-%s.zip','User','fullname','push','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','Sms','toString','closed','closedAt','createdAt','out','System','Contact','read','value','renderFile','server','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','rimraf','zip-dir','moment','util','ejs','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','update','destroy','then','error','stack','name','send','index','map','SmsInteraction','fieldName','type','key','findAll','sms','query','user','catch','show','model','keys','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','params','describe','addMessage','SmsMessage','omit'];(function(_0x28ff30,_0x1f8b3c){var _0x5098ce=function(_0x78f9d6){while(--_0x78f9d6){_0x28ff30['push'](_0x28ff30['shift']());}};_0x5098ce(++_0x1f8b3c);}(_0xe8a1,0xad));var _0x1e8a=function(_0x348b08,_0x5d7a46){_0x348b08=_0x348b08-0x0;var _0x484999=_0xe8a1[_0x348b08];return _0x484999;};'use strict';var rimraf=require(_0x1e8a('0x0'));var zipdir=require(_0x1e8a('0x1'));var moment=require(_0x1e8a('0x2'));var BPromise=require('bluebird');var util=require(_0x1e8a('0x3'));var path=require('path');var ejs=require(_0x1e8a('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x1e8a('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x1e8a('0x6'));var logger=require(_0x1e8a('0x7'))(_0x1e8a('0x8'));var config=require(_0x1e8a('0x9'));var db=require(_0x1e8a('0xa'))['db'];config[_0x1e8a('0xb')]=_[_0x1e8a('0xc')](config[_0x1e8a('0xb')],{'host':_0x1e8a('0xd'),'port':0x18eb});var socket=require(_0x1e8a('0xe'))(new Redis(config[_0x1e8a('0xb')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5bd52f,_0x44e3ec){_0x44e3ec=_0x44e3ec||0xcc;return function(_0x56e6e9){if(_0x56e6e9){return _0x5bd52f[_0x1e8a('0xf')](_0x44e3ec);}return _0x5bd52f[_0x1e8a('0x10')](_0x44e3ec)[_0x1e8a('0x11')]();};}function respondWithResult(_0x309cd6,_0x3e853f){_0x3e853f=_0x3e853f||0xc8;return function(_0x56a5c1){if(_0x56a5c1){return _0x309cd6['status'](_0x3e853f)['json'](_0x56a5c1);}};}function respondWithFilteredResult(_0x3ee8ad,_0x2cc75e){return function(_0x51bc6c){if(_0x51bc6c){var _0xfc28e3=typeof _0x2cc75e[_0x1e8a('0x12')]===_0x1e8a('0x13')&&typeof _0x2cc75e[_0x1e8a('0x14')]===_0x1e8a('0x13');var _0x12e7b3=_0x51bc6c[_0x1e8a('0x15')];var _0x539eab=_0xfc28e3?0x0:_0x2cc75e[_0x1e8a('0x12')];var _0x2fbd9a=_0xfc28e3?_0x51bc6c['count']:_0x2cc75e[_0x1e8a('0x12')]+_0x2cc75e[_0x1e8a('0x14')];var _0x49bd16;if(_0x2fbd9a>=_0x12e7b3){_0x2fbd9a=_0x12e7b3;_0x49bd16=0xc8;}else{_0x49bd16=0xce;}_0x3ee8ad[_0x1e8a('0x10')](_0x49bd16);return _0x3ee8ad['set']('Content-Range',_0x539eab+'-'+_0x2fbd9a+'/'+_0x12e7b3)['json'](_0x51bc6c);}return null;};}function saveUpdates(_0x3702f2){return function(_0x1764e8){if(_0x1764e8){return _0x1764e8[_0x1e8a('0x16')](_0x3702f2)['then'](function(_0x1793c9){return _0x1793c9;});}return null;};}function removeEntity(_0x4b6e87){return function(_0x4e195c){if(_0x4e195c){return _0x4e195c[_0x1e8a('0x17')]()[_0x1e8a('0x18')](function(){_0x4b6e87[_0x1e8a('0x10')](0xcc)[_0x1e8a('0x11')]();});}};}function handleEntityNotFound(_0x5814ed){return function(_0x167153){if(!_0x167153){_0x5814ed['sendStatus'](0x194);}return _0x167153;};}function handleError(_0x160521,_0x34f4c3){_0x34f4c3=_0x34f4c3||0x1f4;return function(_0x2be009){logger[_0x1e8a('0x19')](_0x2be009[_0x1e8a('0x1a')]);if(_0x2be009['name']){delete _0x2be009[_0x1e8a('0x1b')];}_0x160521['status'](_0x34f4c3)[_0x1e8a('0x1c')](_0x2be009);};}exports[_0x1e8a('0x1d')]=function(_0x1be613,_0x373a4e){var _0x4d8f29={};var _0x37dd6c=_[_0x1e8a('0x1e')](db[_0x1e8a('0x1f')]['rawAttributes'],function(_0x208947){return{'name':_0x208947[_0x1e8a('0x20')],'type':_0x208947[_0x1e8a('0x21')][_0x1e8a('0x22')]};});_0x4d8f29=qs['getOptions'](_0x37dd6c,_0x1be613);return interaction[_0x1e8a('0x23')](_0x1e8a('0x24'),_0x1be613[_0x1e8a('0x25')],_0x1be613[_0x1e8a('0x26')],_0x4d8f29,_0x37dd6c)[_0x1e8a('0x18')](respondWithFilteredResult(_0x373a4e,_0x4d8f29))[_0x1e8a('0x27')](handleError(_0x373a4e,null));};exports[_0x1e8a('0x28')]=function(_0x49b5b0,_0x433265){var _0x41bfaa={'raw':![],'where':{'id':_0x49b5b0['params']['id']}},_0x522dbe={};_0x522dbe[_0x1e8a('0x29')]=_[_0x1e8a('0x2a')](db[_0x1e8a('0x1f')]['rawAttributes']);_0x522dbe[_0x1e8a('0x25')]=_[_0x1e8a('0x2a')](_0x49b5b0[_0x1e8a('0x25')]);_0x522dbe[_0x1e8a('0x2b')]=_[_0x1e8a('0x2c')](_0x522dbe[_0x1e8a('0x29')],_0x522dbe[_0x1e8a('0x25')]);_0x41bfaa['attributes']=_[_0x1e8a('0x2c')](_0x522dbe[_0x1e8a('0x29')],qs['fields'](_0x49b5b0[_0x1e8a('0x25')][_0x1e8a('0x2d')]));_0x41bfaa[_0x1e8a('0x2e')]=_0x41bfaa[_0x1e8a('0x2e')][_0x1e8a('0x2f')]?_0x41bfaa['attributes']:_0x522dbe['model'];if(_0x49b5b0[_0x1e8a('0x25')][_0x1e8a('0x30')]){_0x41bfaa[_0x1e8a('0x31')]=[{'all':!![]}];}_0x41bfaa=_['merge']({},_0x41bfaa,_0x49b5b0[_0x1e8a('0x32')]);return db['SmsInteraction'][_0x1e8a('0x33')](_0x41bfaa)['then'](handleEntityNotFound(_0x433265,null))[_0x1e8a('0x18')](respondWithResult(_0x433265,null))[_0x1e8a('0x27')](handleError(_0x433265,null));};exports[_0x1e8a('0x34')]=function(_0x53b4dd,_0x53a9b0){return db[_0x1e8a('0x1f')]['create'](_0x53b4dd[_0x1e8a('0x35')],{})['then'](respondWithResult(_0x53a9b0,0xc9))[_0x1e8a('0x27')](handleError(_0x53a9b0,null));};exports[_0x1e8a('0x16')]=function(_0x2bab99,_0x30cb66){if(_0x2bab99[_0x1e8a('0x35')]['id']){delete _0x2bab99[_0x1e8a('0x35')]['id'];}return db[_0x1e8a('0x1f')]['find']({'where':{'id':_0x2bab99['params']['id']}})[_0x1e8a('0x18')](handleEntityNotFound(_0x30cb66,null))['then'](saveUpdates(_0x2bab99[_0x1e8a('0x35')],null))[_0x1e8a('0x18')](respondWithResult(_0x30cb66,null))[_0x1e8a('0x27')](handleError(_0x30cb66,null));};exports[_0x1e8a('0x17')]=function(_0x4ca023,_0x320c37){return db['SmsInteraction'][_0x1e8a('0x33')]({'where':{'id':_0x4ca023[_0x1e8a('0x36')]['id']}})[_0x1e8a('0x18')](handleEntityNotFound(_0x320c37,null))[_0x1e8a('0x18')](removeEntity(_0x320c37,null))[_0x1e8a('0x27')](handleError(_0x320c37,null));};exports[_0x1e8a('0x37')]=function(_0x55e7ef,_0x3234cf){return db[_0x1e8a('0x1f')]['describe']()[_0x1e8a('0x18')](respondWithResult(_0x3234cf,null))['catch'](handleError(_0x3234cf,null));};exports[_0x1e8a('0x38')]=function(_0x131ba0,_0x51ced6){return db[_0x1e8a('0x39')][_0x1e8a('0x33')]({'where':{'id':_0x131ba0[_0x1e8a('0x36')]['id']}})['then'](handleEntityNotFound(_0x51ced6,null))[_0x1e8a('0x18')](function(_0x53bb7c){if(_0x53bb7c){return _0x53bb7c['addMessage'](_0x131ba0[_0x1e8a('0x35')]['ids'],_[_0x1e8a('0x3a')](_0x131ba0[_0x1e8a('0x35')],[_0x1e8a('0x3b'),'id'])||{});}})[_0x1e8a('0x18')](respondWithResult(_0x51ced6,null))[_0x1e8a('0x27')](handleError(_0x51ced6,null));};exports['getMessages']=function(_0x407878,_0x367767){var _0x263735={'raw':![],'where':{}};var _0x3d0bd0={};var _0x250718={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x1e8a('0x3c')]({'where':{'id':_0x407878[_0x1e8a('0x36')]['id']}})['then'](handleEntityNotFound(_0x367767,null))['then'](function(_0x30fae9){if(_0x30fae9){_0x3d0bd0[_0x1e8a('0x29')]=_[_0x1e8a('0x2a')](db[_0x1e8a('0x39')]['rawAttributes']);_0x3d0bd0[_0x1e8a('0x25')]=_[_0x1e8a('0x2a')](_0x407878[_0x1e8a('0x25')]);_0x3d0bd0[_0x1e8a('0x2b')]=_[_0x1e8a('0x2c')](_0x3d0bd0[_0x1e8a('0x29')],_0x3d0bd0[_0x1e8a('0x25')]);_0x263735[_0x1e8a('0x2e')]=_[_0x1e8a('0x2c')](_0x3d0bd0[_0x1e8a('0x29')],qs[_0x1e8a('0x2d')](_0x407878[_0x1e8a('0x25')][_0x1e8a('0x2d')]));_0x263735[_0x1e8a('0x2e')]=_0x263735[_0x1e8a('0x2e')][_0x1e8a('0x2f')]?_0x263735['attributes']:_0x3d0bd0[_0x1e8a('0x29')];if(!_0x407878[_0x1e8a('0x25')][_0x1e8a('0x3d')]('nolimit')){_0x263735[_0x1e8a('0x14')]=qs[_0x1e8a('0x14')](_0x407878[_0x1e8a('0x25')][_0x1e8a('0x14')]);_0x263735[_0x1e8a('0x12')]=qs['offset'](_0x407878[_0x1e8a('0x25')]['offset']);}_0x263735[_0x1e8a('0x3e')]=qs[_0x1e8a('0x3f')](_0x407878[_0x1e8a('0x25')][_0x1e8a('0x3f')]);_0x263735[_0x1e8a('0x40')]=qs[_0x1e8a('0x2b')](_[_0x1e8a('0x41')](_0x407878[_0x1e8a('0x25')],_0x3d0bd0['filters']));_0x263735[_0x1e8a('0x40')][_0x1e8a('0x42')]=_0x30fae9['id'];if(_0x407878['query'][_0x1e8a('0x43')]){_0x263735['where']=_[_0x1e8a('0x44')](_0x263735[_0x1e8a('0x40')],{'$or':_[_0x1e8a('0x1e')](_0x263735['attributes'],function(_0x5ab6c1){var _0x51a3ea={};_0x51a3ea[_0x5ab6c1]={'$like':'%'+_0x407878['query'][_0x1e8a('0x43')]+'%'};return _0x51a3ea;})});}if(_0x407878[_0x1e8a('0x25')][_0x1e8a('0x45')]){var _0x16be81=_0x407878[_0x1e8a('0x25')][_0x1e8a('0x45')]['split'](',');var _0x22a38f={};_0x22a38f[_0x16be81[0x0]]={'$gte':moment(_0x16be81[0x1])[_0x1e8a('0x46')](_0x1e8a('0x47'))};_0x263735['where']=_[_0x1e8a('0x44')](_0x263735[_0x1e8a('0x40')],_0x22a38f);}_0x263735=_[_0x1e8a('0x44')]({},_0x263735,_0x407878[_0x1e8a('0x32')]);return db[_0x1e8a('0x39')][_0x1e8a('0x15')]({'where':_0x263735[_0x1e8a('0x40')]})[_0x1e8a('0x18')](function(_0xf0f123){_0x250718[_0x1e8a('0x15')]=_0xf0f123;if(_0x407878['query'][_0x1e8a('0x30')]){_0x263735[_0x1e8a('0x31')]=[{'all':!![]}];}return db['SmsMessage'][_0x1e8a('0x23')](_0x263735);})[_0x1e8a('0x18')](function(_0x145742){_0x250718[_0x1e8a('0x48')]=_0x145742;return _0x250718;});}})[_0x1e8a('0x18')](respondWithFilteredResult(_0x367767,_0x263735))[_0x1e8a('0x27')](handleError(_0x367767,null));};exports['addTags']=function(_0x45fb7a,_0x46a40d){return db[_0x1e8a('0x1f')][_0x1e8a('0x33')]({'where':{'id':_0x45fb7a[_0x1e8a('0x36')]['id']}})[_0x1e8a('0x18')](handleEntityNotFound(_0x46a40d,null))['then'](function(_0x3155c7){if(_0x3155c7){return _0x3155c7[_0x1e8a('0x49')](_0x45fb7a['body'][_0x1e8a('0x3b')],_[_0x1e8a('0x3a')](_0x45fb7a[_0x1e8a('0x35')],[_0x1e8a('0x3b'),'id'])||{})[_0x1e8a('0x4a')](function(){return db[_0x1e8a('0x4b')][_0x1e8a('0x23')]({'attributes':['id',_0x1e8a('0x1b'),_0x1e8a('0x4c')],'where':{'id':_0x45fb7a[_0x1e8a('0x35')][_0x1e8a('0x3b')]}});})[_0x1e8a('0x18')](function(_0x4045e6){socket[_0x1e8a('0x4d')]('smsInteractionTags:save',{'id':Number(_0x45fb7a['params']['id']),'tags':_0x4045e6||[]});return{'id':Number(_0x45fb7a[_0x1e8a('0x36')]['id']),'tags':_0x4045e6||[]};});}})[_0x1e8a('0x18')](respondWithResult(_0x46a40d,null))[_0x1e8a('0x27')](handleError(_0x46a40d,null));};exports[_0x1e8a('0x4e')]=function(_0x271726,_0xb446d9){return db['SmsInteraction']['find']({'where':{'id':_0x271726[_0x1e8a('0x36')]['id']}})['then'](handleEntityNotFound(_0xb446d9,null))[_0x1e8a('0x18')](function(_0x74bb93){if(_0x74bb93){return _0x74bb93[_0x1e8a('0x4e')](_0x271726['query']['ids']);}})[_0x1e8a('0x18')](respondWithStatusCode(_0xb446d9,null))[_0x1e8a('0x27')](handleError(_0xb446d9,null));};exports[_0x1e8a('0x4f')]=function(_0x1134a3,_0x43d75e){var _0x2f0756=moment()[_0x1e8a('0x50')]()['toString']();var _0x1f9e86=path[_0x1e8a('0x51')](config[_0x1e8a('0x52')],'server',_0x1e8a('0x53'),_0x1e8a('0x54'));var _0x1379d2=path[_0x1e8a('0x51')](_0x1f9e86,_0x2f0756);var _0x3716bc=util[_0x1e8a('0x46')](_0x1e8a('0x55'),_0x1134a3['params']['id'],_0x2f0756);var _0x14764e=path['join'](_0x1f9e86,_0x3716bc);var _0x16bb95=[];_0x16bb95['push']({'model':db[_0x1e8a('0x56')],'as':'User','attributes':['id',_0x1e8a('0x57')],'raw':!![]});_0x16bb95[_0x1e8a('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x1e8a('0x59'),_0x1e8a('0x5a')],'raw':!![]});var _0xa38c43=[{'model':db[_0x1e8a('0x39')],'as':_0x1e8a('0x5b'),'attributes':['id',_0x1e8a('0x35'),'createdAt',_0x1e8a('0x5c'),_0x1e8a('0x5d'),'read'],'include':_0x16bb95}];_0xa38c43['push']({'model':db[_0x1e8a('0x5e')],'as':_0x1e8a('0x5f'),'attributes':['id',_0x1e8a('0x1b')]});_0xa38c43['push']({'model':db[_0x1e8a('0x56')],'as':_0x1e8a('0x60'),'attributes':['id','fullname']});return db[_0x1e8a('0x1f')][_0x1e8a('0x33')]({'where':{'id':_0x1134a3[_0x1e8a('0x36')]['id']},'include':_0xa38c43})['then'](handleEntityNotFound(_0x43d75e,null))[_0x1e8a('0x18')](function(_0x5ac8e4){if(_0x5ac8e4){var _0x11b514=_0x5ac8e4[_0x1e8a('0x61')]({'plain':!![]});fs['mkdirSync'](_0x1379d2);var _0x4d18e2={'channel':_0x1e8a('0x62'),'account':_0x11b514[_0x1e8a('0x5f')]['name'],'agent':_0x11b514[_0x1e8a('0x60')]?_0x11b514[_0x1e8a('0x60')][_0x1e8a('0x57')]:'N.A.','createdAt':moment(_0x11b514['createdAt'])[_0x1e8a('0x46')](_0x1e8a('0x47'))[_0x1e8a('0x63')](),'closedAt':_0x11b514[_0x1e8a('0x64')]?moment(_0x11b514[_0x1e8a('0x65')])[_0x1e8a('0x46')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x11b514['disposition'],'messages':_(_0x11b514['Messages'])[_0x1e8a('0x43')]({'secret':![]})['map'](function(_0x1431cf){return{'date':moment(_0x1431cf[_0x1e8a('0x66')])[_0x1e8a('0x46')](_0x1e8a('0x47'))[_0x1e8a('0x63')](),'sender':_0x1431cf[_0x1e8a('0x5c')]===_0x1e8a('0x67')?_0x1431cf[_0x1e8a('0x56')]?_0x1431cf[_0x1e8a('0x56')]['fullname']:_0x1e8a('0x68'):_0x1431cf[_0x1e8a('0x69')]['firstName']+(_0x1431cf[_0x1e8a('0x69')][_0x1e8a('0x5a')]?'\x20'+_0x1431cf[_0x1e8a('0x69')]['lastName']:''),'body':_0x1431cf['body'],'direction':_0x1431cf[_0x1e8a('0x5c')]==='out'?'A':'C','secret':_0x1431cf[_0x1e8a('0x5d')],'read':_0x1431cf[_0x1e8a('0x6a')]};})[_0x1e8a('0x6b')]()};return ejs[_0x1e8a('0x6c')](path['join'](config[_0x1e8a('0x52')],_0x1e8a('0x6d'),_0x1e8a('0x6e'),_0x1e8a('0x6f')),{'interaction':_0x4d18e2})['then'](function(_0x4a243d){var _0x36fafb=path['join'](_0x1379d2,_0x1e8a('0x70')+_0x11b514['id']+'-'+_0x2f0756+'.pdf');var _0x44d503={'path':_0x36fafb,'channel':_0x1e8a('0x62'),'interactionId':_0x11b514['id']};return pdf[_0x1e8a('0x71')](_0x4a243d,_0x44d503);})[_0x1e8a('0x18')](function(){return new BPromise(function(_0x554ed0,_0xbcd297){zipdir(_0x1379d2,{'saveTo':_0x14764e},function(_0x428ceb,_0x2dc7d4){if(_0x428ceb)return _0xbcd297(_0x428ceb);return _0x554ed0(_0x2dc7d4);});})['then'](function(){return new BPromise(function(_0x2ae0ce,_0x41f2ff){rimraf(_0x1379d2,function(_0x147b9e){if(_0x147b9e)_0x41f2ff(_0x147b9e);return _0x2ae0ce();});});})['then'](function(){return _0x43d75e['download'](_0x14764e,_0x3716bc,function(_0x38ae14){if(_0x38ae14){console[_0x1e8a('0x72')](_0x1e8a('0x73'),_0x38ae14);}else{fs['unlinkSync'](_0x14764e);}});});});}else{return _0x43d75e[_0x1e8a('0xf')](0xc8);}})['catch'](handleError(_0x43d75e,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index e8060fc..6d99c3f 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 _0xf4f4=['findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3762d4,_0x40a34d){_0x3762d4=_0x3762d4-0x0;var _0x424eb1=_0xf4f4[_0x3762d4];return _0x424eb1;};'use strict';var EventEmitter=require(_0x4f4f('0x0'));var SmsInteraction=require(_0x4f4f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4f4f('0x1'))['db'][_0x4f4f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4f4f('0x3')](0x0);var events={'afterCreate':_0x4f4f('0x4'),'afterUpdate':_0x4f4f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a752b){return function(_0x593952,_0x3f274d,_0x132d5c){_0x593952[_0x4f4f('0x6')]({'attributes':['id'],'raw':!![]})[_0x4f4f('0x7')](function(_0x3c4877){_0x593952[_0x4f4f('0x8')](_0x4f4f('0x9'),_0x3c4877[_0x4f4f('0xa')](function(_0x48f6b9){return{'id':_0x48f6b9['id']};}));return SmsMessage[_0x4f4f('0xb')]({'where':{'SmsInteractionId':_0x593952['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4f('0x7')](function(_0x39e36b){_0x593952[_0x4f4f('0x8')](_0x4f4f('0xc'),_0x39e36b[_0x4f4f('0xd')]);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b+':'+_0x593952['id'],_0x593952);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b,_0x593952);_0x132d5c(null);})['catch'](_0x132d5c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4f4f('0xf')](e,emitEvent(event));}}module[_0x4f4f('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x4e2e=['unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x4e77e4,_0x357a3a){var _0x4778c5=function(_0x370516){while(--_0x370516){_0x4e77e4['push'](_0x4e77e4['shift']());}};_0x4778c5(++_0x357a3a);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x425834,_0x1b46ee){_0x425834=_0x425834-0x0;var _0x1f3d51=_0x4e2e[_0x425834];return _0x1f3d51;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xe4e2('0x0'))['db'][_0xe4e2('0x1')];var SmsMessage=require(_0xe4e2('0x0'))['db'][_0xe4e2('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe4e2('0x3')](0x0);var events={'afterCreate':_0xe4e2('0x4'),'afterUpdate':'update','afterDestroy':_0xe4e2('0x5')};function emitEvent(_0x417dd4){return function(_0x2fb128,_0x38c84c,_0x48e83d){_0x2fb128[_0xe4e2('0x6')]({'attributes':['id'],'raw':!![]})[_0xe4e2('0x7')](function(_0x1c4e64){_0x2fb128[_0xe4e2('0x8')](_0xe4e2('0x9'),_0x1c4e64[_0xe4e2('0xa')](function(_0x1e9508){return{'id':_0x1e9508['id']};}));return SmsMessage[_0xe4e2('0xb')]({'where':{'SmsInteractionId':_0x2fb128['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xd81011){_0x2fb128[_0xe4e2('0x8')](_0xe4e2('0xc'),_0xd81011['length']);SmsInteractionEvents[_0xe4e2('0xd')](_0x417dd4+':'+_0x2fb128['id'],_0x2fb128);SmsInteractionEvents[_0xe4e2('0xd')](_0x417dd4,_0x2fb128);_0x48e83d(null);})[_0xe4e2('0xe')](_0x48e83d(null));};}for(var e in events){if(events[_0xe4e2('0xf')](e)){var event=events[e];SmsInteraction[_0xe4e2('0x10')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 90417c0..d8b0aed 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 _0x9ab1=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','closed','closedAt'];(function(_0x10c548,_0x2c92cb){var _0x4a8150=function(_0x2218f0){while(--_0x2218f0){_0x10c548['push'](_0x10c548['shift']());}};_0x4a8150(++_0x2c92cb);}(_0x9ab1,0x1b5));var _0x19ab=function(_0x19b9af,_0x372260){_0x19b9af=_0x19b9af-0x0;var _0x24e338=_0x9ab1[_0x19b9af];return _0x24e338;};'use strict';var _=require(_0x19ab('0x0'));var util=require(_0x19ab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x19ab('0x2'));var BPromise=require(_0x19ab('0x3'));var rp=require(_0x19ab('0x4'));var fs=require('fs');var path=require(_0x19ab('0x5'));var rimraf=require(_0x19ab('0x6'));var config=require(_0x19ab('0x7'));var attributes=require(_0x19ab('0x8'));module['exports']=function(_0x50731c,_0x39fcdb){return _0x50731c[_0x19ab('0x9')](_0x19ab('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2003fe,_0x4c936c,_0x24ed4e){if(_0x2003fe['changed'](_0x19ab('0xb'))){_0x2003fe[_0x19ab('0xc')]=moment()[_0x19ab('0xd')](_0x19ab('0xe'));}_0x24ed4e(null,_0x2003fe);}}});}; \ No newline at end of file +var _0xe7cd=['define','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7cd,0x1c6));var _0xde7c=function(_0x1f9de2,_0x370d7d){_0x1f9de2=_0x1f9de2-0x0;var _0x3d9db3=_0xe7cd[_0x1f9de2];return _0x3d9db3;};'use strict';var _=require(_0xde7c('0x0'));var util=require('util');var logger=require(_0xde7c('0x1'))(_0xde7c('0x2'));var moment=require(_0xde7c('0x3'));var BPromise=require(_0xde7c('0x4'));var rp=require(_0xde7c('0x5'));var fs=require('fs');var path=require(_0xde7c('0x6'));var rimraf=require('rimraf');var config=require(_0xde7c('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x7534d0,_0x193d19){return _0x7534d0[_0xde7c('0x8')]('SmsInteraction',attributes,{'tableName':_0xde7c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf8a405,_0x87ee75,_0x28b9ae){if(_0xf8a405[_0xde7c('0xa')](_0xde7c('0xb'))){_0xf8a405['closedAt']=moment()[_0xde7c('0xc')](_0xde7c('0xd'));}_0x28b9ae(null,_0xf8a405);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index fdd3efe..5f8a5db 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 _0x6193=['where','attributes','limit','then','debug','AddTagsToSmsInteraction','find','addTags','omit','ids','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw'];(function(_0x546012,_0x29b549){var _0x43b7e2=function(_0x152435){while(--_0x152435){_0x546012['push'](_0x546012['shift']());}};_0x43b7e2(++_0x29b549);}(_0x6193,0x107));var _0x3619=function(_0xa91f22,_0x546c7b){_0xa91f22=_0xa91f22-0x0;var _0x4dabec=_0x6193[_0xa91f22];return _0x4dabec;};'use strict';var _=require('lodash');var util=require(_0x3619('0x0'));var moment=require(_0x3619('0x1'));var BPromise=require(_0x3619('0x2'));var rs=require(_0x3619('0x3'));var fs=require('fs');var Redis=require(_0x3619('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3619('0x5'));var logger=require('../../config/logger')(_0x3619('0x6'));var config=require(_0x3619('0x7'));var jayson=require(_0x3619('0x8'));var client=jayson[_0x3619('0x9')][_0x3619('0xa')]({'port':0x232a});config[_0x3619('0xb')]=_[_0x3619('0xc')](config[_0x3619('0xb')],{'host':_0x3619('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3619('0xe'))[_0x3619('0xf')](socket);function respondWithRpcPromise(_0xc3ec66,_0x4873f2,_0x250cfd){return new BPromise(function(_0x12f8e7,_0x1bce42){return client['request'](_0xc3ec66,_0x250cfd)['then'](function(_0x3de1a7){logger[_0x3619('0x10')](_0x3619('0x11'),_0x4873f2,_0x3619('0x12'));logger['debug'](_0x3619('0x13'),_0x4873f2,_0x3619('0x12'),JSON[_0x3619('0x14')](_0x3de1a7));if(_0x3de1a7[_0x3619('0x15')]){if(_0x3de1a7[_0x3619('0x15')]['code']===0x1f4){logger[_0x3619('0x15')](_0x3619('0x11'),_0x4873f2,_0x3de1a7[_0x3619('0x15')]['message']);return _0x1bce42(_0x3de1a7[_0x3619('0x15')]['message']);}logger[_0x3619('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x4873f2,_0x3de1a7[_0x3619('0x15')][_0x3619('0x16')]);return _0x12f8e7(_0x3de1a7[_0x3619('0x15')][_0x3619('0x16')]);}else{logger[_0x3619('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x4873f2,_0x3619('0x12'));_0x12f8e7(_0x3de1a7[_0x3619('0x17')]['message']);}})[_0x3619('0x18')](function(_0x15b004){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x4873f2,_0x15b004);_0x1bce42(_0x15b004);});});}exports[_0x3619('0x19')]=function(_0x15aa31){var _0x27dba0=this;return new Promise(function(_0x506b37,_0x14b0cb){return db[_0x3619('0x1a')][_0x3619('0x1b')](_0x15aa31[_0x3619('0x1c')],{'raw':_0x15aa31[_0x3619('0x1d')]?_0x15aa31['options'][_0x3619('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15aa31['options']?_0x15aa31[_0x3619('0x1d')][_0x3619('0x1f')]||null:null,'attributes':_0x15aa31[_0x3619('0x1d')]?_0x15aa31[_0x3619('0x1d')][_0x3619('0x20')]||null:null,'limit':_0x15aa31[_0x3619('0x1d')]?_0x15aa31[_0x3619('0x1d')][_0x3619('0x21')]||null:null})[_0x3619('0x22')](function(_0x21e332){logger[_0x3619('0x10')]('UpdateSmsInteraction',_0x15aa31);logger[_0x3619('0x23')](_0x3619('0x19'),_0x15aa31,JSON[_0x3619('0x14')](_0x21e332));_0x506b37(_0x21e332);})[_0x3619('0x18')](function(_0x42f4a4){logger[_0x3619('0x15')](_0x3619('0x19'),_0x42f4a4[_0x3619('0x16')],_0x15aa31);_0x14b0cb(_0x27dba0[_0x3619('0x15')](0x1f4,_0x42f4a4[_0x3619('0x16')]));});});};exports[_0x3619('0x24')]=function(_0x41f896){return new Promise(function(_0x5d77e1,_0x38ad88){return db[_0x3619('0x1a')][_0x3619('0x25')]({'where':_0x41f896['options']?_0x41f896['options'][_0x3619('0x1f')]||null:null})[_0x3619('0x22')](function(_0x514f61){if(_0x514f61){return _0x514f61[_0x3619('0x26')](_0x41f896[_0x3619('0x1c')]['ids'],_[_0x3619('0x27')](_0x41f896[_0x3619('0x1c')],[_0x3619('0x28'),'id'])||{});}})['spread'](function(_0x1f842c){logger[_0x3619('0x10')]('AddTags',_0x41f896);logger[_0x3619('0x23')](_0x3619('0x29'),_0x41f896,JSON[_0x3619('0x14')](_0x1f842c));_0x5d77e1(_0x1f842c);})[_0x3619('0x18')](function(_0x28687c){logger[_0x3619('0x15')](_0x3619('0x29'),_0x28687c['message'],_0x41f896);_0x38ad88(_this['error'](0x1f4,_0x28687c[_0x3619('0x16')]));});});}; \ No newline at end of file +var _0x34e9=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToSmsInteraction','find','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x2f9674,_0x2be120){var _0x472ad9=function(_0x4d01f3){while(--_0x4d01f3){_0x2f9674['push'](_0x2f9674['shift']());}};_0x472ad9(++_0x2be120);}(_0x34e9,0x1a4));var _0x934e=function(_0x30e5af,_0x69e0b){_0x30e5af=_0x30e5af-0x0;var _0x25ab0a=_0x34e9[_0x30e5af];return _0x25ab0a;};'use strict';var _=require(_0x934e('0x0'));var util=require(_0x934e('0x1'));var moment=require(_0x934e('0x2'));var BPromise=require('bluebird');var rs=require(_0x934e('0x3'));var fs=require('fs');var Redis=require(_0x934e('0x4'));var db=require(_0x934e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x934e('0x6'));var jayson=require(_0x934e('0x7'));var client=jayson[_0x934e('0x8')][_0x934e('0x9')]({'port':0x232a});config['redis']=_[_0x934e('0xa')](config[_0x934e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x934e('0xc'))(new Redis(config[_0x934e('0xb')]));require(_0x934e('0xd'))[_0x934e('0xe')](socket);function respondWithRpcPromise(_0x29bbe9,_0xe1d0f,_0x499541){return new BPromise(function(_0x270ce7,_0x1fd5c9){return client[_0x934e('0xf')](_0x29bbe9,_0x499541)[_0x934e('0x10')](function(_0x10dcf1){logger[_0x934e('0x11')](_0x934e('0x12'),_0xe1d0f,_0x934e('0x13'));logger[_0x934e('0x14')](_0x934e('0x15'),_0xe1d0f,_0x934e('0x13'),JSON['stringify'](_0x10dcf1));if(_0x10dcf1[_0x934e('0x16')]){if(_0x10dcf1[_0x934e('0x16')][_0x934e('0x17')]===0x1f4){logger['error'](_0x934e('0x12'),_0xe1d0f,_0x10dcf1['error'][_0x934e('0x18')]);return _0x1fd5c9(_0x10dcf1[_0x934e('0x16')][_0x934e('0x18')]);}logger[_0x934e('0x16')](_0x934e('0x12'),_0xe1d0f,_0x10dcf1['error']['message']);return _0x270ce7(_0x10dcf1['error'][_0x934e('0x18')]);}else{logger[_0x934e('0x11')](_0x934e('0x12'),_0xe1d0f,'request\x20sent');_0x270ce7(_0x10dcf1['result'][_0x934e('0x18')]);}})[_0x934e('0x19')](function(_0x598543){logger['error'](_0x934e('0x12'),_0xe1d0f,_0x598543);_0x1fd5c9(_0x598543);});});}exports[_0x934e('0x1a')]=function(_0x2c38f0){var _0x5e6494=this;return new Promise(function(_0x5bd9f3,_0x35b811){return db['SmsInteraction'][_0x934e('0x1b')](_0x2c38f0[_0x934e('0x1c')],{'raw':_0x2c38f0[_0x934e('0x1d')]?_0x2c38f0[_0x934e('0x1d')][_0x934e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c38f0[_0x934e('0x1d')]?_0x2c38f0[_0x934e('0x1d')][_0x934e('0x1f')]||null:null,'attributes':_0x2c38f0[_0x934e('0x1d')]?_0x2c38f0[_0x934e('0x1d')][_0x934e('0x20')]||null:null,'limit':_0x2c38f0[_0x934e('0x1d')]?_0x2c38f0[_0x934e('0x1d')][_0x934e('0x21')]||null:null})['then'](function(_0x3391b1){logger['info'](_0x934e('0x1a'),_0x2c38f0);logger['debug'](_0x934e('0x1a'),_0x2c38f0,JSON[_0x934e('0x22')](_0x3391b1));_0x5bd9f3(_0x3391b1);})[_0x934e('0x19')](function(_0x30eb7c){logger[_0x934e('0x16')](_0x934e('0x1a'),_0x30eb7c[_0x934e('0x18')],_0x2c38f0);_0x35b811(_0x5e6494[_0x934e('0x16')](0x1f4,_0x30eb7c[_0x934e('0x18')]));});});};exports[_0x934e('0x23')]=function(_0x597f3e){return new Promise(function(_0x2509e7,_0x234b18){return db['SmsInteraction'][_0x934e('0x24')]({'where':_0x597f3e[_0x934e('0x1d')]?_0x597f3e[_0x934e('0x1d')][_0x934e('0x1f')]||null:null})['then'](function(_0x52cd31){if(_0x52cd31){return _0x52cd31['addTags'](_0x597f3e[_0x934e('0x1c')][_0x934e('0x25')],_['omit'](_0x597f3e[_0x934e('0x1c')],['ids','id'])||{});}})[_0x934e('0x26')](function(_0x38374d){logger[_0x934e('0x11')](_0x934e('0x27'),_0x597f3e);logger[_0x934e('0x14')](_0x934e('0x27'),_0x597f3e,JSON[_0x934e('0x22')](_0x38374d));_0x2509e7(_0x38374d);})[_0x934e('0x19')](function(_0x3dbb0a){logger[_0x934e('0x16')](_0x934e('0x27'),_0x3dbb0a[_0x934e('0x18')],_0x597f3e);_0x234b18(_this['error'](0x1f4,_0x3dbb0a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index df12390..236e8ae 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 _0x68b4=['remove','emit','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68b4,0x191));var _0x468b=function(_0x52475e,_0x33f505){_0x52475e=_0x52475e-0x0;var _0x49319c=_0x68b4[_0x52475e];return _0x49319c;};'use strict';var SmsInteractionEvents=require(_0x468b('0x0'));var events=['save',_0x468b('0x1'),'update'];function createListener(_0x325ed1,_0x3e6420){return function(_0x344b53){_0x3e6420[_0x468b('0x2')](_0x325ed1,_0x344b53);};}function removeListener(_0x2973b1,_0xbc03d){return function(){SmsInteractionEvents['removeListener'](_0x2973b1,_0xbc03d);};}exports[_0x468b('0x3')]=function(_0x3d1259){for(var _0x3f286d=0x0,_0x24cb42=events[_0x468b('0x4')];_0x3f286d<_0x24cb42;_0x3f286d++){var _0x10cd9c=events[_0x3f286d];var _0x3c5880=createListener(_0x468b('0x5')+_0x10cd9c,_0x3d1259);SmsInteractionEvents['on'](_0x10cd9c,_0x3c5880);}}; \ No newline at end of file +var _0xa70c=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x2fc0a4,_0x34b5a9){var _0x40314f=function(_0xd38b44){while(--_0xd38b44){_0x2fc0a4['push'](_0x2fc0a4['shift']());}};_0x40314f(++_0x34b5a9);}(_0xa70c,0x1eb));var _0xca70=function(_0x505088,_0x23a321){_0x505088=_0x505088-0x0;var _0x3eb2c9=_0xa70c[_0x505088];return _0x3eb2c9;};'use strict';var SmsInteractionEvents=require(_0xca70('0x0'));var events=[_0xca70('0x1'),_0xca70('0x2'),_0xca70('0x3')];function createListener(_0x3ec014,_0xab6032){return function(_0xf60821){_0xab6032[_0xca70('0x4')](_0x3ec014,_0xf60821);};}function removeListener(_0x4ad83c,_0x26a7cc){return function(){SmsInteractionEvents[_0xca70('0x5')](_0x4ad83c,_0x26a7cc);};}exports[_0xca70('0x6')]=function(_0x3817c0){for(var _0x18ff37=0x0,_0xb3c551=events[_0xca70('0x7')];_0x18ff37<_0xb3c551;_0x18ff37++){var _0x15a42c=events[_0x18ff37];var _0x1a4306=createListener(_0xca70('0x8')+_0x15a42c,_0x3817c0);SmsInteractionEvents['on'](_0x15a42c,_0x1a4306);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 48f84d1..832f71b 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 _0xaf4c=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','get','/describe','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','/:id/reject','reject','destroy','exports','util'];(function(_0x4a33f1,_0x3ab06b){var _0xda34fc=function(_0x511801){while(--_0x511801){_0x4a33f1['push'](_0x4a33f1['shift']());}};_0xda34fc(++_0x3ab06b);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x23d804,_0x45aa8f){_0x23d804=_0x23d804-0x0;var _0x3c7139=_0xaf4c[_0x23d804];return _0x3c7139;};'use strict';var multer=require('multer');var util=require(_0xcaf4('0x0'));var path=require(_0xcaf4('0x1'));var timeout=require('connect-timeout');var express=require(_0xcaf4('0x2'));var router=express[_0xcaf4('0x3')]();var fs_extra=require(_0xcaf4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var controller=require(_0xcaf4('0x7'));router['get']('/',auth[_0xcaf4('0x8')](),controller['index']);router[_0xcaf4('0x9')](_0xcaf4('0xa'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0xb')]);router[_0xcaf4('0x9')](_0xcaf4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcaf4('0xd')]('/',auth[_0xcaf4('0x8')](),interaction[_0xcaf4('0xe')](_0xcaf4('0xf'),_0xcaf4('0x10')),controller[_0xcaf4('0x11')]);router[_0xcaf4('0xd')](_0xcaf4('0x12'),controller[_0xcaf4('0x13')]);router['put'](_0xcaf4('0xc'),auth[_0xcaf4('0x8')](),controller['update']);router[_0xcaf4('0x14')](_0xcaf4('0x15'),auth[_0xcaf4('0x8')](),controller['accept']);router[_0xcaf4('0x14')](_0xcaf4('0x16'),auth['isAuthenticated'](),controller[_0xcaf4('0x17')]);router['delete'](_0xcaf4('0xc'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0x18')]);module[_0xcaf4('0x19')]=router; \ No newline at end of file +var _0x4838=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','sms','smsmessage:create','/:id/status','put','/:id/reject','reject','delete','destroy','exports','util','connect-timeout'];(function(_0xb3525e,_0x23cd8b){var _0x1b0cd8=function(_0x37fa56){while(--_0x37fa56){_0xb3525e['push'](_0xb3525e['shift']());}};_0x1b0cd8(++_0x23cd8b);}(_0x4838,0x111));var _0x8483=function(_0x4a5c4b,_0x2176fc){_0x4a5c4b=_0x4a5c4b-0x0;var _0x4b360f=_0x4838[_0x4a5c4b];return _0x4b360f;};'use strict';var multer=require('multer');var util=require(_0x8483('0x0'));var path=require('path');var timeout=require(_0x8483('0x1'));var express=require(_0x8483('0x2'));var router=express[_0x8483('0x3')]();var fs_extra=require(_0x8483('0x4'));var auth=require(_0x8483('0x5'));var interaction=require(_0x8483('0x6'));var config=require(_0x8483('0x7'));var controller=require(_0x8483('0x8'));router[_0x8483('0x9')]('/',auth[_0x8483('0xa')](),controller[_0x8483('0xb')]);router[_0x8483('0x9')](_0x8483('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x8483('0xd'),auth[_0x8483('0xa')](),controller[_0x8483('0xe')]);router[_0x8483('0xf')]('/',auth[_0x8483('0xa')](),interaction['tracked'](_0x8483('0x10'),_0x8483('0x11')),controller['create']);router[_0x8483('0xf')](_0x8483('0x12'),controller['status']);router[_0x8483('0x13')]('/:id',auth[_0x8483('0xa')](),controller['update']);router['put']('/:id/accept',auth[_0x8483('0xa')](),controller['accept']);router[_0x8483('0x13')](_0x8483('0x14'),auth['isAuthenticated'](),controller[_0x8483('0x15')]);router[_0x8483('0x16')](_0x8483('0xd'),auth[_0x8483('0xa')](),controller[_0x8483('0x17')]);module[_0x8483('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a2c9ee9..c1a36ff 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 _0x03dc=['sequelize','exports','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x53a469,_0x21de43){var _0x297a6e=function(_0x1bcaf8){while(--_0x1bcaf8){_0x53a469['push'](_0x53a469['shift']());}};_0x297a6e(++_0x21de43);}(_0x03dc,0x85));var _0xc03d=function(_0x4409bf,_0x305f4c){_0x4409bf=_0x4409bf-0x0;var _0x3b71bb=_0x03dc[_0x4409bf];return _0x3b71bb;};'use strict';var Sequelize=require(_0xc03d('0x0'));module[_0xc03d('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc03d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc03d('0x3')]('in',_0xc03d('0x4')),'defaultValue':_0xc03d('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc03d('0x5')](0xbe)},'phone':{'type':Sequelize[_0xc03d('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xc03d('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc03d('0x5')]},'providerResponse':{'type':Sequelize[_0xc03d('0x6')]}}; \ No newline at end of file +var _0x8ee8=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x48d058,_0x3f03e3){var _0x5bcd12=function(_0x4187ae){while(--_0x4187ae){_0x48d058['push'](_0x48d058['shift']());}};_0x5bcd12(++_0x3f03e3);}(_0x8ee8,0x1dd));var _0x88ee=function(_0x6d76e8,_0x3a5b96){_0x6d76e8=_0x6d76e8-0x0;var _0x10a933=_0x8ee8[_0x6d76e8];return _0x10a933;};'use strict';var Sequelize=require(_0x88ee('0x0'));module['exports']={'body':{'type':Sequelize[_0x88ee('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x88ee('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x88ee('0x3')]('in',_0x88ee('0x4')),'defaultValue':_0x88ee('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x88ee('0x5')]},'readAt':{'type':Sequelize[_0x88ee('0x6')]},'secret':{'type':Sequelize[_0x88ee('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x88ee('0x5')]},'providerResponse':{'type':Sequelize[_0x88ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 43e39e4..4c3808b 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 _0xb03e=['agent','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','merge','find','create','body','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteractionId','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0xb03e,0x1eb));var _0xeb03=function(_0x420ea6,_0x23b3ae){_0x420ea6=_0x420ea6-0x0;var _0x57b470=_0xb03e[_0x420ea6];return _0x57b470;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];config[_0xeb03('0x1b')]=_[_0xeb03('0x1c')](config[_0xeb03('0x1b')],{'host':_0xeb03('0x1d'),'port':0x18eb});var socket=require(_0xeb03('0x1e'))(new Redis(config[_0xeb03('0x1b')]));require('./smsMessage.socket')[_0xeb03('0x1f')](socket);var jayson=require(_0xeb03('0x20'));var client=jayson[_0xeb03('0x21')][_0xeb03('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xeb03('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x36f5d8,_0x3f26ef,_0x478989,_0x7ce874){return new BPromise(function(_0x46dd1b,_0x4095c3){var _0x44716c=_0x7ce874||client;return _0x44716c[_0xeb03('0x23')](_0x36f5d8,_0x478989)[_0xeb03('0x24')](function(_0x167a33){logger[_0xeb03('0x25')](_0xeb03('0x26'),_0x3f26ef,_0xeb03('0x27'));logger[_0xeb03('0x28')](_0xeb03('0x29'),_0x3f26ef,_0xeb03('0x27'),JSON[_0xeb03('0x2a')](_0x167a33));if(_0x167a33['error']){if(_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2c')]===0x1f4){logger[_0xeb03('0x2b')](_0xeb03('0x26'),_0x3f26ef,_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);return _0x4095c3(_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);}logger[_0xeb03('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x3f26ef,_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);return _0x46dd1b(_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);}else{logger[_0xeb03('0x25')]('SmsMessage,\x20%s,\x20%s',_0x3f26ef,_0xeb03('0x27'));_0x46dd1b(_0x167a33[_0xeb03('0x2e')][_0xeb03('0x2d')]);}})[_0xeb03('0x2f')](function(_0x3f276a){logger[_0xeb03('0x2b')](_0xeb03('0x26'),_0x3f26ef,_0x3f276a);_0x4095c3(_0x3f276a);});});}function respondWithStatusCode(_0x3f68f3,_0xbb7ff){_0xbb7ff=_0xbb7ff||0xcc;return function(_0x4984f6){if(_0x4984f6){return _0x3f68f3[_0xeb03('0x30')](_0xbb7ff);}return _0x3f68f3[_0xeb03('0x31')](_0xbb7ff)[_0xeb03('0x32')]();};}function respondWithResult(_0x1ada2e,_0x4cdea6){_0x4cdea6=_0x4cdea6||0xc8;return function(_0x581685){if(_0x581685){return _0x1ada2e[_0xeb03('0x31')](_0x4cdea6)['json'](_0x581685);}};}function respondWithFilteredResult(_0x31a622,_0x8bd544){return function(_0x160a37){if(_0x160a37){var _0x5db8bb=typeof _0x8bd544[_0xeb03('0x33')]==='undefined'&&typeof _0x8bd544['limit']==='undefined';var _0x538d19=_0x160a37[_0xeb03('0x34')];var _0x433ce8=_0x5db8bb?0x0:_0x8bd544['offset'];var _0x528479=_0x5db8bb?_0x160a37['count']:_0x8bd544['offset']+_0x8bd544[_0xeb03('0x35')];var _0x3655c3;if(_0x528479>=_0x538d19){_0x528479=_0x538d19;_0x3655c3=0xc8;}else{_0x3655c3=0xce;}_0x31a622[_0xeb03('0x31')](_0x3655c3);return _0x31a622[_0xeb03('0x36')](_0xeb03('0x37'),_0x433ce8+'-'+_0x528479+'/'+_0x538d19)['json'](_0x160a37);}return null;};}function patchUpdates(_0x13efc6){return function(_0x543a29){try{jsonpatch[_0xeb03('0x38')](_0x543a29,_0x13efc6,!![]);}catch(_0x13a016){return BPromise[_0xeb03('0x39')](_0x13a016);}return _0x543a29[_0xeb03('0x3a')]();};}function saveUpdates(_0x29a584,_0x436df2){return function(_0xdfb18){if(_0xdfb18){return _0xdfb18[_0xeb03('0x3b')](_0x29a584)['then'](function(_0x24256d){return _0x24256d;});}return null;};}function removeEntity(_0x4a68b4,_0x40de0c){return function(_0xe3c81a){if(_0xe3c81a){return _0xe3c81a[_0xeb03('0x3c')]()[_0xeb03('0x24')](function(){_0x4a68b4[_0xeb03('0x31')](0xcc)[_0xeb03('0x32')]();});}};}function handleEntityNotFound(_0x5a3915,_0x155b53){return function(_0x4bfd68){if(!_0x4bfd68){_0x5a3915['sendStatus'](0x194);}return _0x4bfd68;};}function handleError(_0x4c61e4,_0x164530){_0x164530=_0x164530||0x1f4;return function(_0x452868){logger[_0xeb03('0x2b')](_0x452868[_0xeb03('0x3d')]);if(_0x452868[_0xeb03('0x3e')]){delete _0x452868['name'];}_0x4c61e4[_0xeb03('0x31')](_0x164530)[_0xeb03('0x3f')](_0x452868);};}exports[_0xeb03('0x40')]=function(_0x51a4ba,_0x4efbb7){var _0xac05c4={},_0x27e61f={},_0x47118d={'count':0x0,'rows':[]};var _0x5a1ef1=_[_0xeb03('0x41')](db[_0xeb03('0x42')]['rawAttributes'],function(_0x49edb3){return{'name':_0x49edb3[_0xeb03('0x43')],'type':_0x49edb3[_0xeb03('0x44')]['key']};});_0x27e61f[_0xeb03('0x45')]=_[_0xeb03('0x41')](_0x5a1ef1,_0xeb03('0x3e'));_0x27e61f[_0xeb03('0x46')]=_[_0xeb03('0x47')](_0x51a4ba[_0xeb03('0x46')]);_0x27e61f[_0xeb03('0x48')]=_[_0xeb03('0x49')](_0x27e61f[_0xeb03('0x45')],_0x27e61f[_0xeb03('0x46')]);_0xac05c4[_0xeb03('0x4a')]=_[_0xeb03('0x49')](_0x27e61f[_0xeb03('0x45')],qs[_0xeb03('0x4b')](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x4b')]));_0xac05c4[_0xeb03('0x4a')]=_0xac05c4[_0xeb03('0x4a')][_0xeb03('0x4c')]?_0xac05c4[_0xeb03('0x4a')]:_0x27e61f[_0xeb03('0x45')];if(!_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x4d')]('nolimit')){_0xac05c4['limit']=qs[_0xeb03('0x35')](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x35')]);_0xac05c4[_0xeb03('0x33')]=qs[_0xeb03('0x33')](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x33')]);}_0xac05c4[_0xeb03('0x4e')]=qs['sort'](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x4f')]);_0xac05c4[_0xeb03('0x50')]=qs[_0xeb03('0x48')](_[_0xeb03('0x51')](_0x51a4ba['query'],_0x27e61f['filters']),_0x5a1ef1);if(_0x51a4ba[_0xeb03('0x46')]['filter']){_0xac05c4['where']=_['merge'](_0xac05c4[_0xeb03('0x50')],{'$or':_[_0xeb03('0x41')](_0x5a1ef1,function(_0x38423f){if(_0x38423f[_0xeb03('0x44')]!==_0xeb03('0x52')){var _0x2393a0={};_0x2393a0[_0x38423f['name']]={'$like':'%'+_0x51a4ba[_0xeb03('0x46')]['filter']+'%'};return _0x2393a0;}})});}_0xac05c4=_['merge']({},_0xac05c4,_0x51a4ba[_0xeb03('0x53')]);var _0x841262={'where':_0xac05c4[_0xeb03('0x50')]};return db['SmsMessage'][_0xeb03('0x34')](_0x841262)[_0xeb03('0x24')](function(_0x351055){_0x47118d[_0xeb03('0x34')]=_0x351055;if(_0x51a4ba[_0xeb03('0x46')]['includeAll']){_0xac05c4[_0xeb03('0x54')]=[{'all':!![]}];}return db['SmsMessage'][_0xeb03('0x55')](_0xac05c4);})[_0xeb03('0x24')](function(_0x14f1d0){_0x47118d[_0xeb03('0x56')]=_0x14f1d0;return _0x47118d;})[_0xeb03('0x24')](respondWithFilteredResult(_0x4efbb7,_0xac05c4))[_0xeb03('0x2f')](handleError(_0x4efbb7,null));};exports[_0xeb03('0x57')]=function(_0x292319,_0x38c993){var _0x2fe435={'raw':!![],'where':{'id':_0x292319[_0xeb03('0x58')]['id']}},_0x40ea76={};_0x40ea76[_0xeb03('0x45')]=_[_0xeb03('0x47')](db[_0xeb03('0x42')][_0xeb03('0x59')]);_0x40ea76[_0xeb03('0x46')]=_[_0xeb03('0x47')](_0x292319[_0xeb03('0x46')]);_0x40ea76[_0xeb03('0x48')]=_[_0xeb03('0x49')](_0x40ea76[_0xeb03('0x45')],_0x40ea76[_0xeb03('0x46')]);_0x2fe435[_0xeb03('0x4a')]=_['intersection'](_0x40ea76[_0xeb03('0x45')],qs[_0xeb03('0x4b')](_0x292319[_0xeb03('0x46')]['fields']));_0x2fe435[_0xeb03('0x4a')]=_0x2fe435[_0xeb03('0x4a')][_0xeb03('0x4c')]?_0x2fe435[_0xeb03('0x4a')]:_0x40ea76[_0xeb03('0x45')];if(_0x292319[_0xeb03('0x46')][_0xeb03('0x5a')]){_0x2fe435[_0xeb03('0x54')]=[{'all':!![]}];}_0x2fe435=_[_0xeb03('0x5b')]({},_0x2fe435,_0x292319[_0xeb03('0x53')]);return db[_0xeb03('0x42')][_0xeb03('0x5c')](_0x2fe435)[_0xeb03('0x24')](handleEntityNotFound(_0x38c993,null))[_0xeb03('0x24')](respondWithResult(_0x38c993,null))['catch'](handleError(_0x38c993,null));};exports[_0xeb03('0x5d')]=function(_0x32a64c,_0x379cd0){return db[_0xeb03('0x42')][_0xeb03('0x5d')](_0x32a64c[_0xeb03('0x5e')],{})[_0xeb03('0x24')](respondWithResult(_0x379cd0,0xc9))[_0xeb03('0x2f')](handleError(_0x379cd0,null));};exports[_0xeb03('0x3b')]=function(_0x23406a,_0x5baf6f){if(_0x23406a[_0xeb03('0x5e')]['id']){delete _0x23406a[_0xeb03('0x5e')]['id'];}return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0x23406a['params']['id']}})[_0xeb03('0x24')](handleEntityNotFound(_0x5baf6f,null))[_0xeb03('0x24')](saveUpdates(_0x23406a[_0xeb03('0x5e')],null))[_0xeb03('0x24')](respondWithResult(_0x5baf6f,null))[_0xeb03('0x2f')](handleError(_0x5baf6f,null));};exports['destroy']=function(_0x43efc3,_0x10beeb){return db[_0xeb03('0x42')]['find']({'where':{'id':_0x43efc3[_0xeb03('0x58')]['id']}})[_0xeb03('0x24')](handleEntityNotFound(_0x10beeb,null))['then'](removeEntity(_0x10beeb,null))[_0xeb03('0x2f')](handleError(_0x10beeb,null));};exports[_0xeb03('0x5f')]=function(_0x3750f1,_0x5693cf){return db[_0xeb03('0x42')][_0xeb03('0x5f')]()['then'](respondWithResult(_0x5693cf,null))[_0xeb03('0x2f')](handleError(_0x5693cf,null));};var interaction_log=require(_0xeb03('0x15'))(_0xeb03('0x60'));exports[_0xeb03('0x61')]=function(_0x3963a7,_0x38618e,_0x218ea5){var _0x1ac556={'agent':{},'channel':'sms'};if(_0x3963a7[_0xeb03('0x5e')]['id']){delete _0x3963a7['body']['id'];}_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x62')]=!![];_0x3963a7[_0xeb03('0x5e')]['readAt']=moment()[_0xeb03('0x63')](_0xeb03('0x64'));_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x65')]=_0x3963a7['body'][_0xeb03('0x65')]||_0x3963a7[_0xeb03('0x66')]['id'];_0x1ac556['agent']['id']=_0x3963a7['body']['UserId'];return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0x3963a7[_0xeb03('0x58')]['id'],'UserId':null}})[_0xeb03('0x24')](handleEntityNotFound(_0x38618e,null))[_0xeb03('0x24')](saveUpdates(_0x3963a7[_0xeb03('0x5e')],null))[_0xeb03('0x24')](function(_0x240178){if(_0x240178){_0x1ac556[_0xeb03('0x2d')]=_0x240178['get']({'plain':!![]});return db['SmsInteraction'][_0xeb03('0x5c')]({'where':{'id':_0x240178[_0xeb03('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x38618e,null))[_0xeb03('0x24')](function(_0x3e003d){if(_0x3e003d){return _0x3e003d[_0xeb03('0x3b')]({'UserId':_0x3963a7[_0xeb03('0x5e')]['UserId'],'read1stAt':_['isNil'](_0x3e003d[_0xeb03('0x68')])?moment()[_0xeb03('0x63')](_0xeb03('0x64')):undefined});}return null;})[_0xeb03('0x24')](function(_0x34dd41){if(_0x34dd41){_0x1ac556[_0xeb03('0x69')]=_0x34dd41[_0xeb03('0x6a')]({'plain':!![]});interaction_log[_0xeb03('0x25')](_0xeb03('0x6b'),_0x3963a7[_0xeb03('0x66')]['id'],_0x3963a7[_0xeb03('0x66')]['name'],_0x3963a7['user'][_0xeb03('0x6c')],_0x1ac556['interaction']['id'],_0x3963a7[_0xeb03('0x5e')]?JSON['stringify'](_0x3963a7[_0xeb03('0x5e')]):'null');return respondWithRpcPromise(_0xeb03('0x6d'),_0xeb03('0x6e'),_0x1ac556);}return null;})['then'](function(_0x34927f){var _0x5f43a7=_0xeb03('0x6f')+_0x34927f['message'][_0xeb03('0x70')];return db['sequelize']['query'](_0x5f43a7,{'type':db[_0xeb03('0x71')][_0xeb03('0x72')][_0xeb03('0x73')],'raw':!![]})[_0xeb03('0x24')](function(_0x25c171){return _0x25c171;});})[_0xeb03('0x24')](function(_0x39c15d){if(_0x39c15d){_0x1ac556['message'][_0xeb03('0x74')]=_0x39c15d[0x0];if(!_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x65')])return;return db[_0xeb03('0x75')][_0xeb03('0x5c')]({'where':{'id':_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x65')],'role':'agent'},'attributes':['id',_0xeb03('0x3e'),_0xeb03('0x76'),_0xeb03('0x77'),_0xeb03('0x78')],'raw':!![]});}return null;})[_0xeb03('0x24')](function(_0xcd7ab1){if(!_0xcd7ab1)return null;_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x79')]=_0xcd7ab1;return _0x1ac556;})['then'](function(_0x8153c8){if(_0x8153c8){if(_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x7a')]){_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x7b')]=util['format'](_0xeb03('0x7c'),_0x3963a7[_0xeb03('0x66')][_0xeb03('0x3e')]);_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x7d')]=_0x1ac556[_0xeb03('0x7d')];_0x1ac556[_0xeb03('0x2d')]['motionChannel']=_0x1ac556[_0xeb03('0x7d')];_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x7e')]=_0xeb03('0x61');return respondWithRpcPromise(_0xeb03('0x7f'),'EventManager',{'event':_0xeb03('0x80'),'message':_0x1ac556[_0xeb03('0x2d')]},client9002)[_0xeb03('0x24')](function(){return _0x1ac556;});}return _0x1ac556;}return null;})[_0xeb03('0x24')](respondWithResult(_0x38618e,null))[_0xeb03('0x2f')](handleError(_0x38618e,null));};var interaction_log=require(_0xeb03('0x15'))(_0xeb03('0x60'));exports['reject']=function(_0x7668ab,_0xe517f9,_0x2695b0){var _0x433780={'agent':{},'channel':_0xeb03('0x81')};if(_0x7668ab[_0xeb03('0x5e')]['id']){delete _0x7668ab['body']['id'];}_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')]=_0x7668ab[_0xeb03('0x5e')]['UserId']||_0x7668ab[_0xeb03('0x66')]['id'];_0x433780[_0xeb03('0x79')]['id']=_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')];return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0x7668ab[_0xeb03('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe517f9,null))['then'](function(_0x15bd4a){if(_0x15bd4a){_0x433780[_0xeb03('0x2d')]=_0x15bd4a[_0xeb03('0x6a')]({'plain':!![]});return db[_0xeb03('0x82')]['find']({'where':{'id':_0x15bd4a[_0xeb03('0x67')]}});}return null;})[_0xeb03('0x24')](handleEntityNotFound(_0xe517f9,null))['then'](function(_0x45fd83){if(_0x45fd83){_0x433780[_0xeb03('0x69')]=_0x45fd83[_0xeb03('0x6a')]({'plain':!![]});interaction_log[_0xeb03('0x25')](_0xeb03('0x83'),_0x7668ab[_0xeb03('0x66')]['id'],_0x7668ab['user'][_0xeb03('0x3e')],_0x7668ab[_0xeb03('0x66')][_0xeb03('0x6c')],_0x433780[_0xeb03('0x69')]['id'],_0x7668ab[_0xeb03('0x5e')]?JSON[_0xeb03('0x2a')](_0x7668ab[_0xeb03('0x5e')]):_0xeb03('0x84'));return respondWithRpcPromise(_0xeb03('0x85'),_0xeb03('0x86'),_0x433780);}return null;})['then'](function(_0x14c2ac){var _0x4416aa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14c2ac[_0xeb03('0x2d')][_0xeb03('0x70')];return db['sequelize'][_0xeb03('0x46')](_0x4416aa,{'type':db[_0xeb03('0x71')][_0xeb03('0x72')][_0xeb03('0x73')],'raw':!![]})[_0xeb03('0x24')](function(_0x501a3b){return _0x501a3b;});})['then'](function(_0x536277){if(_0x536277){_0x433780[_0xeb03('0x2d')]['contact']=_0x536277[0x0];if(!_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')])return;return db[_0xeb03('0x75')][_0xeb03('0x5c')]({'where':{'id':_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')],'role':_0xeb03('0x79')},'attributes':['id',_0xeb03('0x3e'),_0xeb03('0x76'),_0xeb03('0x77'),_0xeb03('0x78')],'raw':!![]});}return null;})[_0xeb03('0x24')](function(_0x4ec45c){if(!_0x4ec45c)return null;_0x433780['message'][_0xeb03('0x79')]=_0x4ec45c;return _0x433780;})['then'](function(_0x5d5962){if(_0x5d5962){_0x5d5962[_0xeb03('0x2d')][_0xeb03('0x7b')]=util['format']('SIP/%s',_0x7668ab[_0xeb03('0x66')][_0xeb03('0x3e')]);_0x5d5962['message'][_0xeb03('0x7d')]=_0x433780[_0xeb03('0x7d')];_0x5d5962[_0xeb03('0x2d')][_0xeb03('0x87')]=_0x433780[_0xeb03('0x7d')];_0x5d5962['message'][_0xeb03('0x7e')]='reject';respondWithRpcPromise('EventManager',_0xeb03('0x7f'),{'event':_0xeb03('0x88'),'message':_0x5d5962[_0xeb03('0x2d')]},client9002);return _0x433780;}return null;})[_0xeb03('0x24')](respondWithResult(_0xe517f9,null))['catch'](handleError(_0xe517f9,null));};exports['status']=function(_0xf9f2d3,_0x847253,_0x70343f){if(_0xf9f2d3[_0xeb03('0x5e')]['id']){delete _0xf9f2d3[_0xeb03('0x5e')]['id'];}var _0x3dc483;return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0xf9f2d3['params']['id']}})['then'](handleEntityNotFound(_0x847253,null))[_0xeb03('0x24')](function(_0x5741d4){if(_0x5741d4){_0x3dc483=_0x5741d4;return db[_0xeb03('0x89')]['find']({'where':{'id':_0x5741d4[_0xeb03('0x8a')]}});}})[_0xeb03('0x24')](handleEntityNotFound(_0x847253,null))[_0xeb03('0x24')](function(_0x22f291){if(_0x22f291){logger[_0xeb03('0x28')](_0xeb03('0x29'),_0xeb03('0x31'),_0xeb03('0x8b'),_0x22f291['type'],util['inspect'](_0xf9f2d3[_0xeb03('0x5e')],{'showHidden':![],'depth':null}));switch(_0x22f291[_0xeb03('0x44')]){case _0xeb03('0x8c'):if(_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x8d')]&&_0xf9f2d3['body'][_0xeb03('0x8d')]===_0x3dc483[_0xeb03('0x8e')]){return _0x3dc483['update']({'read':!![]});}else{logger[_0xeb03('0x2b')](_0xeb03('0x8f'),_0xeb03('0x31'),_0xeb03('0x8c'),util[_0xeb03('0x90')](_0xf9f2d3[_0xeb03('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xeb03('0x91'):if(_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x92')]&&_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x92')]===_0x3dc483[_0xeb03('0x8e')]&&_[_0xeb03('0x93')]([_0xeb03('0x94'),'delivered'],_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x95')])>=0x0){return _0x3dc483['update']({'read':!![]});}else{logger[_0xeb03('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xeb03('0x31'),'plivio',util[_0xeb03('0x90')](_0xf9f2d3[_0xeb03('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xeb03('0x96'):var _0x1df994=_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x97')][0x0];if(_0x1df994[_0xeb03('0x31')][_0xeb03('0x98')]==='DELIVERED'){return _0x3dc483[_0xeb03('0x3b')]({'read':!![]});}else{logger[_0xeb03('0x2b')](_0xeb03('0x8f'),_0xeb03('0x31'),'infobip',util[_0xeb03('0x90')](_0xf9f2d3['body'],{'showHidden':![],'depth':null}));}break;}return _0x3dc483;}})[_0xeb03('0x24')](respondWithResult(_0x847253,null))[_0xeb03('0x2f')](handleError(_0x847253,null));}; \ No newline at end of file +var _0x0b7f=['crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','options','SmsMessage','include','findAll','rows','show','params','includeAll','find','create','body','destroy','describe','../../config/logger','sms-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','format','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','stringify','null','rejectMessage','QueryTypes','contact','interface','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','DELIVERED','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1e1b3d,_0x1feb8e){var _0x10df4e=function(_0x17389c){while(--_0x17389c){_0x1e1b3d['push'](_0x1e1b3d['shift']());}};_0x10df4e(++_0x1feb8e);}(_0x0b7f,0x115));var _0xf0b7=function(_0x24cfb3,_0x2da737){_0x24cfb3=_0x24cfb3-0x0;var _0x1e2159=_0x0b7f[_0x24cfb3];return _0x1e2159;};'use strict';var emlformat=require(_0xf0b7('0x0'));var rimraf=require(_0xf0b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0b7('0x2'));var rp=require('request-promise');var moment=require(_0xf0b7('0x3'));var BPromise=require(_0xf0b7('0x4'));var Mustache=require(_0xf0b7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf0b7('0x6'));var csv=require(_0xf0b7('0x7'));var ejs=require(_0xf0b7('0x8'));var fs=require('fs');var fs_extra=require(_0xf0b7('0x9'));var _=require(_0xf0b7('0xa'));var squel=require('squel');var crypto=require(_0xf0b7('0xb'));var jsforce=require(_0xf0b7('0xc'));var deskjs=require(_0xf0b7('0xd'));var toCsv=require(_0xf0b7('0x7'));var querystring=require(_0xf0b7('0xe'));var Papa=require('papaparse');var Redis=require(_0xf0b7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0b7('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf0b7('0x11'));var config=require(_0xf0b7('0x12'));var licenseUtil=require(_0xf0b7('0x13'));var db=require(_0xf0b7('0x14'))['db'];config[_0xf0b7('0x15')]=_[_0xf0b7('0x16')](config[_0xf0b7('0x15')],{'host':_0xf0b7('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf0b7('0x18'))[_0xf0b7('0x19')](socket);var jayson=require(_0xf0b7('0x1a'));var client=jayson[_0xf0b7('0x1b')][_0xf0b7('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xf0b7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5c462,_0xfc8661,_0x1ac5d2,_0x5b33fc){return new BPromise(function(_0x303db6,_0x446164){var _0x1e8825=_0x5b33fc||client;return _0x1e8825[_0xf0b7('0x1d')](_0x5c462,_0x1ac5d2)['then'](function(_0x1e5fc9){logger[_0xf0b7('0x1e')](_0xf0b7('0x1f'),_0xfc8661,_0xf0b7('0x20'));logger[_0xf0b7('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc8661,_0xf0b7('0x20'),JSON['stringify'](_0x1e5fc9));if(_0x1e5fc9[_0xf0b7('0x22')]){if(_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x23')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0xfc8661,_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x24')]);return _0x446164(_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x24')]);}logger[_0xf0b7('0x22')](_0xf0b7('0x1f'),_0xfc8661,_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x24')]);return _0x303db6(_0x1e5fc9[_0xf0b7('0x22')]['message']);}else{logger[_0xf0b7('0x1e')](_0xf0b7('0x1f'),_0xfc8661,_0xf0b7('0x20'));_0x303db6(_0x1e5fc9[_0xf0b7('0x25')][_0xf0b7('0x24')]);}})[_0xf0b7('0x26')](function(_0x4724f1){logger[_0xf0b7('0x22')](_0xf0b7('0x1f'),_0xfc8661,_0x4724f1);_0x446164(_0x4724f1);});});}function respondWithStatusCode(_0x2c273e,_0x4c8e0d){_0x4c8e0d=_0x4c8e0d||0xcc;return function(_0xcf4de9){if(_0xcf4de9){return _0x2c273e[_0xf0b7('0x27')](_0x4c8e0d);}return _0x2c273e['status'](_0x4c8e0d)[_0xf0b7('0x28')]();};}function respondWithResult(_0x1b58bb,_0x3709a5){_0x3709a5=_0x3709a5||0xc8;return function(_0x55909c){if(_0x55909c){return _0x1b58bb[_0xf0b7('0x29')](_0x3709a5)[_0xf0b7('0x2a')](_0x55909c);}};}function respondWithFilteredResult(_0x131097,_0x4fda93){return function(_0x1cf15d){if(_0x1cf15d){var _0x2773ce=typeof _0x4fda93[_0xf0b7('0x2b')]===_0xf0b7('0x2c')&&typeof _0x4fda93[_0xf0b7('0x2d')]===_0xf0b7('0x2c');var _0x10643f=_0x1cf15d[_0xf0b7('0x2e')];var _0x3cb0ef=_0x2773ce?0x0:_0x4fda93[_0xf0b7('0x2b')];var _0x559510=_0x2773ce?_0x1cf15d[_0xf0b7('0x2e')]:_0x4fda93[_0xf0b7('0x2b')]+_0x4fda93[_0xf0b7('0x2d')];var _0x4df287;if(_0x559510>=_0x10643f){_0x559510=_0x10643f;_0x4df287=0xc8;}else{_0x4df287=0xce;}_0x131097[_0xf0b7('0x29')](_0x4df287);return _0x131097[_0xf0b7('0x2f')](_0xf0b7('0x30'),_0x3cb0ef+'-'+_0x559510+'/'+_0x10643f)[_0xf0b7('0x2a')](_0x1cf15d);}return null;};}function patchUpdates(_0x10b42c){return function(_0x2c5f82){try{jsonpatch[_0xf0b7('0x31')](_0x2c5f82,_0x10b42c,!![]);}catch(_0x10e670){return BPromise[_0xf0b7('0x32')](_0x10e670);}return _0x2c5f82['save']();};}function saveUpdates(_0x234e54,_0x5a95e2){return function(_0x479e87){if(_0x479e87){return _0x479e87[_0xf0b7('0x33')](_0x234e54)['then'](function(_0xa67a2){return _0xa67a2;});}return null;};}function removeEntity(_0x3bc56f,_0x6e83b){return function(_0x14f9de){if(_0x14f9de){return _0x14f9de['destroy']()[_0xf0b7('0x34')](function(){_0x3bc56f[_0xf0b7('0x29')](0xcc)[_0xf0b7('0x28')]();});}};}function handleEntityNotFound(_0x200085,_0x4f979f){return function(_0x1f9c7a){if(!_0x1f9c7a){_0x200085['sendStatus'](0x194);}return _0x1f9c7a;};}function handleError(_0x5c98ac,_0x47c4a9){_0x47c4a9=_0x47c4a9||0x1f4;return function(_0x53fccc){logger['error'](_0x53fccc[_0xf0b7('0x35')]);if(_0x53fccc[_0xf0b7('0x36')]){delete _0x53fccc[_0xf0b7('0x36')];}_0x5c98ac[_0xf0b7('0x29')](_0x47c4a9)[_0xf0b7('0x37')](_0x53fccc);};}exports[_0xf0b7('0x38')]=function(_0x3b105c,_0x299ebf){var _0x2538b5={},_0x503599={},_0x19894c={'count':0x0,'rows':[]};var _0x586778=_[_0xf0b7('0x39')](db['SmsMessage'][_0xf0b7('0x3a')],function(_0x364b24){return{'name':_0x364b24[_0xf0b7('0x3b')],'type':_0x364b24['type'][_0xf0b7('0x3c')]};});_0x503599[_0xf0b7('0x3d')]=_[_0xf0b7('0x39')](_0x586778,'name');_0x503599[_0xf0b7('0x3e')]=_[_0xf0b7('0x3f')](_0x3b105c[_0xf0b7('0x3e')]);_0x503599[_0xf0b7('0x40')]=_[_0xf0b7('0x41')](_0x503599[_0xf0b7('0x3d')],_0x503599[_0xf0b7('0x3e')]);_0x2538b5[_0xf0b7('0x42')]=_['intersection'](_0x503599[_0xf0b7('0x3d')],qs[_0xf0b7('0x43')](_0x3b105c[_0xf0b7('0x3e')][_0xf0b7('0x43')]));_0x2538b5[_0xf0b7('0x42')]=_0x2538b5[_0xf0b7('0x42')][_0xf0b7('0x44')]?_0x2538b5[_0xf0b7('0x42')]:_0x503599[_0xf0b7('0x3d')];if(!_0x3b105c['query'][_0xf0b7('0x45')](_0xf0b7('0x46'))){_0x2538b5[_0xf0b7('0x2d')]=qs[_0xf0b7('0x2d')](_0x3b105c['query']['limit']);_0x2538b5[_0xf0b7('0x2b')]=qs[_0xf0b7('0x2b')](_0x3b105c[_0xf0b7('0x3e')][_0xf0b7('0x2b')]);}_0x2538b5['order']=qs[_0xf0b7('0x47')](_0x3b105c[_0xf0b7('0x3e')][_0xf0b7('0x47')]);_0x2538b5[_0xf0b7('0x48')]=qs[_0xf0b7('0x40')](_['pick'](_0x3b105c[_0xf0b7('0x3e')],_0x503599[_0xf0b7('0x40')]),_0x586778);if(_0x3b105c['query']['filter']){_0x2538b5[_0xf0b7('0x48')]=_[_0xf0b7('0x49')](_0x2538b5[_0xf0b7('0x48')],{'$or':_[_0xf0b7('0x39')](_0x586778,function(_0x5191f2){if(_0x5191f2[_0xf0b7('0x4a')]!==_0xf0b7('0x4b')){var _0x373c1d={};_0x373c1d[_0x5191f2[_0xf0b7('0x36')]]={'$like':'%'+_0x3b105c[_0xf0b7('0x3e')]['filter']+'%'};return _0x373c1d;}})});}_0x2538b5=_[_0xf0b7('0x49')]({},_0x2538b5,_0x3b105c[_0xf0b7('0x4c')]);var _0x478db2={'where':_0x2538b5[_0xf0b7('0x48')]};return db[_0xf0b7('0x4d')][_0xf0b7('0x2e')](_0x478db2)['then'](function(_0x3324b1){_0x19894c[_0xf0b7('0x2e')]=_0x3324b1;if(_0x3b105c[_0xf0b7('0x3e')]['includeAll']){_0x2538b5[_0xf0b7('0x4e')]=[{'all':!![]}];}return db[_0xf0b7('0x4d')][_0xf0b7('0x4f')](_0x2538b5);})[_0xf0b7('0x34')](function(_0x1f6a48){_0x19894c[_0xf0b7('0x50')]=_0x1f6a48;return _0x19894c;})[_0xf0b7('0x34')](respondWithFilteredResult(_0x299ebf,_0x2538b5))[_0xf0b7('0x26')](handleError(_0x299ebf,null));};exports[_0xf0b7('0x51')]=function(_0x36cd4c,_0x3809a1){var _0x1c8ce5={'raw':!![],'where':{'id':_0x36cd4c[_0xf0b7('0x52')]['id']}},_0x535653={};_0x535653[_0xf0b7('0x3d')]=_[_0xf0b7('0x3f')](db[_0xf0b7('0x4d')]['rawAttributes']);_0x535653['query']=_[_0xf0b7('0x3f')](_0x36cd4c[_0xf0b7('0x3e')]);_0x535653[_0xf0b7('0x40')]=_[_0xf0b7('0x41')](_0x535653[_0xf0b7('0x3d')],_0x535653[_0xf0b7('0x3e')]);_0x1c8ce5[_0xf0b7('0x42')]=_['intersection'](_0x535653['model'],qs[_0xf0b7('0x43')](_0x36cd4c['query']['fields']));_0x1c8ce5[_0xf0b7('0x42')]=_0x1c8ce5[_0xf0b7('0x42')]['length']?_0x1c8ce5[_0xf0b7('0x42')]:_0x535653['model'];if(_0x36cd4c[_0xf0b7('0x3e')][_0xf0b7('0x53')]){_0x1c8ce5[_0xf0b7('0x4e')]=[{'all':!![]}];}_0x1c8ce5=_[_0xf0b7('0x49')]({},_0x1c8ce5,_0x36cd4c[_0xf0b7('0x4c')]);return db[_0xf0b7('0x4d')][_0xf0b7('0x54')](_0x1c8ce5)[_0xf0b7('0x34')](handleEntityNotFound(_0x3809a1,null))[_0xf0b7('0x34')](respondWithResult(_0x3809a1,null))['catch'](handleError(_0x3809a1,null));};exports['create']=function(_0x17ed74,_0x5b0865){return db[_0xf0b7('0x4d')][_0xf0b7('0x55')](_0x17ed74[_0xf0b7('0x56')],{})[_0xf0b7('0x34')](respondWithResult(_0x5b0865,0xc9))[_0xf0b7('0x26')](handleError(_0x5b0865,null));};exports[_0xf0b7('0x33')]=function(_0x379d6f,_0xbc3e53){if(_0x379d6f['body']['id']){delete _0x379d6f[_0xf0b7('0x56')]['id'];}return db[_0xf0b7('0x4d')][_0xf0b7('0x54')]({'where':{'id':_0x379d6f[_0xf0b7('0x52')]['id']}})['then'](handleEntityNotFound(_0xbc3e53,null))['then'](saveUpdates(_0x379d6f[_0xf0b7('0x56')],null))[_0xf0b7('0x34')](respondWithResult(_0xbc3e53,null))[_0xf0b7('0x26')](handleError(_0xbc3e53,null));};exports[_0xf0b7('0x57')]=function(_0x56c286,_0x45b44c){return db[_0xf0b7('0x4d')]['find']({'where':{'id':_0x56c286[_0xf0b7('0x52')]['id']}})['then'](handleEntityNotFound(_0x45b44c,null))[_0xf0b7('0x34')](removeEntity(_0x45b44c,null))[_0xf0b7('0x26')](handleError(_0x45b44c,null));};exports[_0xf0b7('0x58')]=function(_0x42dcf1,_0xf4f7aa){return db[_0xf0b7('0x4d')][_0xf0b7('0x58')]()[_0xf0b7('0x34')](respondWithResult(_0xf4f7aa,null))['catch'](handleError(_0xf4f7aa,null));};var interaction_log=require(_0xf0b7('0x59'))(_0xf0b7('0x5a'));exports['accept']=function(_0x53a3fe,_0x142276,_0x2d40c8){var _0x389387={'agent':{},'channel':'sms'};if(_0x53a3fe[_0xf0b7('0x56')]['id']){delete _0x53a3fe['body']['id'];}_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5b')]=!![];_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5c')]=moment()['format'](_0xf0b7('0x5d'));_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5e')]=_0x53a3fe[_0xf0b7('0x56')]['UserId']||_0x53a3fe[_0xf0b7('0x5f')]['id'];_0x389387[_0xf0b7('0x60')]['id']=_0x53a3fe['body']['UserId'];return db[_0xf0b7('0x4d')][_0xf0b7('0x54')]({'where':{'id':_0x53a3fe[_0xf0b7('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x142276,null))[_0xf0b7('0x34')](saveUpdates(_0x53a3fe[_0xf0b7('0x56')],null))[_0xf0b7('0x34')](function(_0x4ccddd){if(_0x4ccddd){_0x389387[_0xf0b7('0x24')]=_0x4ccddd[_0xf0b7('0x61')]({'plain':!![]});return db['SmsInteraction'][_0xf0b7('0x54')]({'where':{'id':_0x4ccddd[_0xf0b7('0x62')]}});}return null;})[_0xf0b7('0x34')](handleEntityNotFound(_0x142276,null))[_0xf0b7('0x34')](function(_0x5253cf){if(_0x5253cf){return _0x5253cf['update']({'UserId':_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5e')],'read1stAt':_[_0xf0b7('0x63')](_0x5253cf[_0xf0b7('0x64')])?moment()[_0xf0b7('0x65')](_0xf0b7('0x5d')):undefined});}return null;})[_0xf0b7('0x34')](function(_0x2fd37f){if(_0x2fd37f){_0x389387['interaction']=_0x2fd37f['get']({'plain':!![]});interaction_log[_0xf0b7('0x1e')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53a3fe[_0xf0b7('0x5f')]['id'],_0x53a3fe[_0xf0b7('0x5f')][_0xf0b7('0x36')],_0x53a3fe[_0xf0b7('0x5f')][_0xf0b7('0x66')],_0x389387[_0xf0b7('0x67')]['id'],_0x53a3fe[_0xf0b7('0x56')]?JSON['stringify'](_0x53a3fe[_0xf0b7('0x56')]):'null');return respondWithRpcPromise(_0xf0b7('0x68'),_0xf0b7('0x69'),_0x389387);}return null;})['then'](function(_0x54e200){var _0x2573c2=_0xf0b7('0x6a')+_0x54e200['message']['ContactId'];return db[_0xf0b7('0x6b')][_0xf0b7('0x3e')](_0x2573c2,{'type':db[_0xf0b7('0x6c')]['QueryTypes'][_0xf0b7('0x6d')],'raw':!![]})[_0xf0b7('0x34')](function(_0x4fc443){return _0x4fc443;});})[_0xf0b7('0x34')](function(_0x639ce){if(_0x639ce){_0x389387[_0xf0b7('0x24')]['contact']=_0x639ce[0x0];if(!_0x53a3fe['body'][_0xf0b7('0x5e')])return;return db[_0xf0b7('0x6e')]['find']({'where':{'id':_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5e')],'role':_0xf0b7('0x60')},'attributes':['id',_0xf0b7('0x36'),_0xf0b7('0x6f'),_0xf0b7('0x70'),_0xf0b7('0x71')],'raw':!![]});}return null;})['then'](function(_0x38ef01){if(!_0x38ef01)return null;_0x389387[_0xf0b7('0x24')]['agent']=_0x38ef01;return _0x389387;})[_0xf0b7('0x34')](function(_0x2a1e29){if(_0x2a1e29){if(_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x72')]){_0x389387[_0xf0b7('0x24')]['interface']=util[_0xf0b7('0x65')](_0xf0b7('0x73'),_0x53a3fe['user'][_0xf0b7('0x36')]);_0x389387[_0xf0b7('0x24')][_0xf0b7('0x74')]=_0x389387[_0xf0b7('0x74')];_0x389387['message'][_0xf0b7('0x75')]=_0x389387[_0xf0b7('0x74')];_0x389387[_0xf0b7('0x24')][_0xf0b7('0x76')]=_0xf0b7('0x77');return respondWithRpcPromise(_0xf0b7('0x78'),_0xf0b7('0x78'),{'event':'acceptmessage','message':_0x389387[_0xf0b7('0x24')]},client9002)[_0xf0b7('0x34')](function(){return _0x389387;});}return _0x389387;}return null;})[_0xf0b7('0x34')](respondWithResult(_0x142276,null))['catch'](handleError(_0x142276,null));};var interaction_log=require(_0xf0b7('0x59'))(_0xf0b7('0x5a'));exports['reject']=function(_0x1e0ada,_0x345f5d,_0x1e9311){var _0x5e01e2={'agent':{},'channel':'sms'};if(_0x1e0ada[_0xf0b7('0x56')]['id']){delete _0x1e0ada[_0xf0b7('0x56')]['id'];}_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')]=_0x1e0ada[_0xf0b7('0x56')]['UserId']||_0x1e0ada[_0xf0b7('0x5f')]['id'];_0x5e01e2['agent']['id']=_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')];return db[_0xf0b7('0x4d')][_0xf0b7('0x54')]({'where':{'id':_0x1e0ada[_0xf0b7('0x52')]['id'],'UserId':null}})[_0xf0b7('0x34')](handleEntityNotFound(_0x345f5d,null))[_0xf0b7('0x34')](function(_0x46426d){if(_0x46426d){_0x5e01e2[_0xf0b7('0x24')]=_0x46426d[_0xf0b7('0x61')]({'plain':!![]});return db['SmsInteraction'][_0xf0b7('0x54')]({'where':{'id':_0x46426d[_0xf0b7('0x62')]}});}return null;})[_0xf0b7('0x34')](handleEntityNotFound(_0x345f5d,null))[_0xf0b7('0x34')](function(_0x4c2070){if(_0x4c2070){_0x5e01e2[_0xf0b7('0x67')]=_0x4c2070[_0xf0b7('0x61')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1e0ada[_0xf0b7('0x5f')]['id'],_0x1e0ada[_0xf0b7('0x5f')]['name'],_0x1e0ada[_0xf0b7('0x5f')][_0xf0b7('0x66')],_0x5e01e2[_0xf0b7('0x67')]['id'],_0x1e0ada[_0xf0b7('0x56')]?JSON[_0xf0b7('0x79')](_0x1e0ada['body']):_0xf0b7('0x7a'));return respondWithRpcPromise('RejectMessage',_0xf0b7('0x7b'),_0x5e01e2);}return null;})[_0xf0b7('0x34')](function(_0x383d34){var _0x1a4e1d=_0xf0b7('0x6a')+_0x383d34[_0xf0b7('0x24')]['ContactId'];return db[_0xf0b7('0x6b')][_0xf0b7('0x3e')](_0x1a4e1d,{'type':db[_0xf0b7('0x6c')][_0xf0b7('0x7c')][_0xf0b7('0x6d')],'raw':!![]})[_0xf0b7('0x34')](function(_0x71d845){return _0x71d845;});})[_0xf0b7('0x34')](function(_0x2ff659){if(_0x2ff659){_0x5e01e2[_0xf0b7('0x24')][_0xf0b7('0x7d')]=_0x2ff659[0x0];if(!_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')])return;return db[_0xf0b7('0x6e')][_0xf0b7('0x54')]({'where':{'id':_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')],'role':_0xf0b7('0x60')},'attributes':['id',_0xf0b7('0x36'),_0xf0b7('0x6f'),_0xf0b7('0x70'),_0xf0b7('0x71')],'raw':!![]});}return null;})[_0xf0b7('0x34')](function(_0x5dd527){if(!_0x5dd527)return null;_0x5e01e2[_0xf0b7('0x24')][_0xf0b7('0x60')]=_0x5dd527;return _0x5e01e2;})[_0xf0b7('0x34')](function(_0x4af914){if(_0x4af914){_0x4af914['message'][_0xf0b7('0x7e')]=util[_0xf0b7('0x65')](_0xf0b7('0x73'),_0x1e0ada[_0xf0b7('0x5f')]['name']);_0x4af914['message'][_0xf0b7('0x74')]=_0x5e01e2[_0xf0b7('0x74')];_0x4af914['message']['motionChannel']=_0x5e01e2[_0xf0b7('0x74')];_0x4af914['message'][_0xf0b7('0x76')]=_0xf0b7('0x32');respondWithRpcPromise(_0xf0b7('0x78'),_0xf0b7('0x78'),{'event':'rejectmessage','message':_0x4af914[_0xf0b7('0x24')]},client9002);return _0x5e01e2;}return null;})[_0xf0b7('0x34')](respondWithResult(_0x345f5d,null))[_0xf0b7('0x26')](handleError(_0x345f5d,null));};exports[_0xf0b7('0x29')]=function(_0x1b2f13,_0x87f627,_0x43b376){if(_0x1b2f13[_0xf0b7('0x56')]['id']){delete _0x1b2f13['body']['id'];}var _0x3f0170;return db['SmsMessage'][_0xf0b7('0x54')]({'where':{'id':_0x1b2f13[_0xf0b7('0x52')]['id']}})[_0xf0b7('0x34')](handleEntityNotFound(_0x87f627,null))['then'](function(_0x36dfbd){if(_0x36dfbd){_0x3f0170=_0x36dfbd;return db[_0xf0b7('0x7f')][_0xf0b7('0x54')]({'where':{'id':_0x36dfbd[_0xf0b7('0x80')]}});}})[_0xf0b7('0x34')](handleEntityNotFound(_0x87f627,null))[_0xf0b7('0x34')](function(_0xdf9b7b){if(_0xdf9b7b){logger[_0xf0b7('0x21')](_0xf0b7('0x81'),'status',_0xf0b7('0x82'),_0xdf9b7b[_0xf0b7('0x4a')],util['inspect'](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));switch(_0xdf9b7b[_0xf0b7('0x4a')]){case _0xf0b7('0x83'):if(_0x1b2f13[_0xf0b7('0x56')]['MessageSid']&&_0x1b2f13[_0xf0b7('0x56')][_0xf0b7('0x84')]===_0x3f0170[_0xf0b7('0x85')]){return _0x3f0170['update']({'read':!![]});}else{logger[_0xf0b7('0x22')](_0xf0b7('0x86'),_0xf0b7('0x29'),_0xf0b7('0x83'),util[_0xf0b7('0x87')](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));}break;case _0xf0b7('0x88'):if(_0x1b2f13[_0xf0b7('0x56')][_0xf0b7('0x89')]&&_0x1b2f13[_0xf0b7('0x56')]['MessageUUID']===_0x3f0170[_0xf0b7('0x85')]&&_[_0xf0b7('0x8a')]([_0xf0b7('0x8b'),'delivered'],_0x1b2f13[_0xf0b7('0x56')][_0xf0b7('0x8c')])>=0x0){return _0x3f0170[_0xf0b7('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf0b7('0x29'),_0xf0b7('0x8d'),util[_0xf0b7('0x87')](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));}break;case _0xf0b7('0x8e'):var _0x128d2f=_0x1b2f13[_0xf0b7('0x56')]['results'][0x0];if(_0x128d2f[_0xf0b7('0x29')]['groupName']===_0xf0b7('0x8f')){return _0x3f0170['update']({'read':!![]});}else{logger[_0xf0b7('0x22')](_0xf0b7('0x86'),_0xf0b7('0x29'),_0xf0b7('0x8e'),util[_0xf0b7('0x87')](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3f0170;}})[_0xf0b7('0x34')](respondWithResult(_0x87f627,null))[_0xf0b7('0x26')](handleError(_0x87f627,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c64d4ff..f97a968 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 _0x06ac=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x06ac,0xa6));var _0xc06a=function(_0x4d7433,_0x225b4f){_0x4d7433=_0x4d7433-0x0;var _0x23917d=_0x06ac[_0x4d7433];return _0x23917d;};'use strict';var EventEmitter=require(_0xc06a('0x0'));var SmsMessage=require(_0xc06a('0x1'))['db'][_0xc06a('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc06a('0x3')](0x0);var events={'afterCreate':_0xc06a('0x4'),'afterUpdate':'update','afterDestroy':_0xc06a('0x5')};function emitEvent(_0x4766d3){return function(_0x4ba151,_0x54f61b,_0x32cfc8){SmsMessageEvents[_0xc06a('0x6')](_0x4766d3+':'+_0x4ba151['id'],_0x4ba151);SmsMessageEvents[_0xc06a('0x6')](_0x4766d3,_0x4ba151);_0x32cfc8(null);};}for(var e in events){if(events[_0xc06a('0x7')](e)){var event=events[e];SmsMessage[_0xc06a('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x04c3=['hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04c3,0x122));var _0x304c=function(_0x417f87,_0x3be898){_0x417f87=_0x417f87-0x0;var _0x4099ab=_0x04c3[_0x417f87];return _0x4099ab;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x304c('0x0'))['db'][_0x304c('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x304c('0x2')](0x0);var events={'afterCreate':_0x304c('0x3'),'afterUpdate':'update','afterDestroy':_0x304c('0x4')};function emitEvent(_0x480166){return function(_0x400d57,_0x47ae1d,_0x2fff4d){SmsMessageEvents[_0x304c('0x5')](_0x480166+':'+_0x400d57['id'],_0x400d57);SmsMessageEvents[_0x304c('0x5')](_0x480166,_0x400d57);_0x2fff4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x304c('0x6')](e,emitEvent(event));}}module[_0x304c('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 4408d30..ec2fdb9 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 _0xcf10=['uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','exports','sms_messages','messageId','fti_sms_messages','models','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','catch','secret','SmsAccount','find','twilio','accountSid','authToken','messages','create','phone','remote','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','body','smsMethod','sender','login?username=','password','GET','split','POST','user_key','session_key','total_sent','internal_order_id','read','skebby','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','message_id','clickSend','plivo','/api/sms/messages/','authId','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','length','createHash','md5','digest','hex','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages'];(function(_0x1d0a56,_0x37c741){var _0x16d2eb=function(_0x1c3778){while(--_0x1c3778){_0x1d0a56['push'](_0x1d0a56['shift']());}};_0x16d2eb(++_0x37c741);}(_0xcf10,0x1e3));var _0x0cf1=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xcf10[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x0cf1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0cf1('0x1'));var moment=require(_0x0cf1('0x2'));var BPromise=require('bluebird');var rp=require(_0x0cf1('0x3'));var fs=require('fs');var path=require(_0x0cf1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x0cf1('0x5')]=function(_0x244598,_0x998cca){return _0x244598['define']('SmsMessage',attributes,{'tableName':_0x0cf1('0x6'),'paranoid':![],'indexes':[{'name':_0x0cf1('0x7'),'fields':[_0x0cf1('0x7')]},{'name':_0x0cf1('0x8'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44e15e,_0x470306,_0x3d54ee){var _0x31edeb=_0x244598[_0x0cf1('0x9')];var _0x3041e9=_0x44e15e['get']({'plain':!![]});if(_0x3041e9[_0x0cf1('0xa')]['toLowerCase']()==='in'||_0x3041e9[_0x0cf1('0xa')][_0x0cf1('0xb')]()===_0x0cf1('0xc')&&!_0x3041e9['secret']&&!_[_0x0cf1('0xd')](_0x3041e9[_0x0cf1('0xe')])&&!_[_0x0cf1('0xd')](_0x3041e9[_0x0cf1('0xf')])){_0x31edeb[_0x0cf1('0x10')][_0x0cf1('0x11')]({'where':{'id':_0x3041e9[_0x0cf1('0xf')]}})[_0x0cf1('0x12')](function(_0x5667cf){if(_0x5667cf){_0x5667cf[_0x0cf1('0x13')]({'lastMsgAt':_0x3041e9['createdAt'],'lastMsgDirection':_0x3041e9[_0x0cf1('0xa')]['toLowerCase']()});}})[_0x0cf1('0x14')](function(_0x32944c){console['error'](_0x32944c);});}if(_0x3041e9[_0x0cf1('0xa')]===_0x0cf1('0xc')&&!_0x3041e9[_0x0cf1('0x15')]){var _0x1697fa;_0x31edeb[_0x0cf1('0x16')][_0x0cf1('0x17')]({'where':{'id':_0x3041e9['SmsAccountId']},'raw':!![]})[_0x0cf1('0x12')](function(_0x119b1e){_0x1697fa=_0x119b1e;if(_0x1697fa&&_0x1697fa['type']){switch(_0x1697fa['type']){case'twilio':var _0x421927=require(_0x0cf1('0x18'));if(_0x1697fa[_0x0cf1('0x19')]&&_0x1697fa[_0x0cf1('0x1a')]&&_0x1697fa['phone']){var _0x4b7c67=new _0x421927(_0x1697fa[_0x0cf1('0x19')],_0x1697fa['authToken']);_0x4b7c67[_0x0cf1('0x1b')][_0x0cf1('0x1c')]({'body':_0x3041e9['body'],'to':_0x3041e9['phone'],'from':_0x1697fa[_0x0cf1('0x1d')],'statusCallback':_0x1697fa[_0x0cf1('0x1e')]+'/api/sms/messages/'+_0x3041e9['id']+_0x0cf1('0x1f')+_0x1697fa[_0x0cf1('0x20')]})[_0x0cf1('0x12')](function(_0x4be3aa){if(_0x4be3aa[_0x0cf1('0x21')]){return _0x44e15e[_0x0cf1('0x13')]({'messageId':_0x4be3aa[_0x0cf1('0x21')]});}})[_0x0cf1('0x14')](function(_0x3e075c){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x18'),util[_0x0cf1('0x24')](_0x3e075c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x18'),_0x0cf1('0x26'));}break;case'skebby':var _0x2b5ba6=_0x0cf1('0x27');if(_0x1697fa[_0x0cf1('0x28')]&&_0x1697fa['password']){var _0x517688={'recipient':[_0x3041e9[_0x0cf1('0x1d')]],'message':_0x3041e9[_0x0cf1('0x29')],'message_type':_0x1697fa[_0x0cf1('0x2a')]};if(_0x1697fa[_0x0cf1('0x2a')]&&_0x1697fa[_0x0cf1('0x2a')]!=='SI'){_0x517688[_0x0cf1('0x2b')]=_0x1697fa['phone'];}var _0x519d48={'url':_0x2b5ba6+_0x0cf1('0x2c')+_0x1697fa[_0x0cf1('0x28')]+'&password='+_0x1697fa[_0x0cf1('0x2d')],'method':_0x0cf1('0x2e')};rp(_0x519d48)[_0x0cf1('0x12')](function(_0x4c085b){var _0xcab7c8=_0x4c085b[_0x0cf1('0x2f')](';');var _0x20097f={'user_key':_0xcab7c8[0x0],'session_key':_0xcab7c8[0x1]};_0x519d48={'url':_0x2b5ba6+'sms','method':_0x0cf1('0x30'),'headers':{'user_key':_0x20097f[_0x0cf1('0x31')],'Session_key':_0x20097f[_0x0cf1('0x32')]},'json':!![],'body':_0x517688};return rp(_0x519d48);})[_0x0cf1('0x12')](function(_0x300aa1){if(_0x300aa1[_0x0cf1('0x33')]>=0x1){var _0x5dc5b6={'messageId':_0x300aa1[_0x0cf1('0x34')]};if(_0x1697fa[_0x0cf1('0x2a')]!=='GP'||!_0x1697fa['deliveryReport']){_0x5dc5b6[_0x0cf1('0x35')]=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x5dc5b6);}else{return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x36'),util[_0x0cf1('0x24')](_0x300aa1,{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0x2d42da){return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0cf1('0x36'),util[_0x0cf1('0x24')](_0x2d42da,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x36'),_0x0cf1('0x37'));}break;case'connectel':if(_0x1697fa[_0x0cf1('0x1a')]){var _0x279989={'recipient':_0x3041e9['phone'],'message':_0x3041e9[_0x0cf1('0x29')],'sender':_0x1697fa[_0x0cf1('0x38')]||_0x1697fa[_0x0cf1('0x1d')],'authorization':_0x1697fa['authToken']};var _0x470306={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x39'),'body':_0x279989,'json':!![]};rp(_0x470306)[_0x0cf1('0x12')](function(_0x3a335b){var _0x16169a={'messageId':_0x3a335b['requestid']};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x16169a['read']=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x16169a);})['catch'](function(_0x35c7c5){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x3b'),util['inspect'](_0x35c7c5,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x0cf1('0x3c'):if(_0x1697fa['username']&&_0x1697fa['password']){var _0x279989={'messages':[{'source':_0x0cf1('0x3d'),'to':_0x3041e9[_0x0cf1('0x1d')],'body':_0x3041e9[_0x0cf1('0x29')],'from':_0x1697fa[_0x0cf1('0x38')]||_0x1697fa['phone']}]};var _0x57791c=util[_0x0cf1('0x3e')](_0x0cf1('0x3f'),_0x1697fa[_0x0cf1('0x28')],_0x1697fa[_0x0cf1('0x2d')]);var _0x470306={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x40'),'body':_0x279989,'headers':{'Authorization':util[_0x0cf1('0x3e')](_0x0cf1('0x41'),new Buffer(_0x57791c)[_0x0cf1('0x42')]('base64'))},'json':!![]};rp(_0x470306)['then'](function(_0x515107){if(_0x515107[_0x0cf1('0x43')]>=0xc8&&_0x515107['http_code']<=0xce){if(_0x515107[_0x0cf1('0x44')]&&_0x515107[_0x0cf1('0x44')]['queued_count']>0x0){var _0x58110c=_[_0x0cf1('0x45')](_0x515107[_0x0cf1('0x44')][_0x0cf1('0x1b')]);var _0x5e5832={'messageId':_0x58110c[_0x0cf1('0x46')]};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x5e5832[_0x0cf1('0x35')]=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x5e5832);}else{logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0x515107,{'showHidden':![],'depth':null}));}}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x47'),util['inspect'](_0x515107,{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0x2ee2be){logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x47'),util['inspect'](_0x2ee2be,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x47'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0cf1('0x48'):if(_0x1697fa['authId']&&_0x1697fa['authToken']){var _0x279989={'dst':_0x3041e9[_0x0cf1('0x1d')],'text':_0x3041e9[_0x0cf1('0x29')],'src':_0x1697fa[_0x0cf1('0x38')]||_0x1697fa[_0x0cf1('0x1d')],'url':_0x1697fa[_0x0cf1('0x1e')]+_0x0cf1('0x49')+_0x3041e9['id']+_0x0cf1('0x1f')+_0x1697fa['token']};var _0x57791c=util[_0x0cf1('0x3e')](_0x0cf1('0x3f'),_0x1697fa[_0x0cf1('0x4a')],_0x1697fa[_0x0cf1('0x1a')]);var _0x470306={'method':_0x0cf1('0x30'),'uri':util[_0x0cf1('0x3e')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1697fa['authId']),'body':_0x279989,'headers':{'Authorization':util[_0x0cf1('0x3e')](_0x0cf1('0x41'),new Buffer(_0x57791c)[_0x0cf1('0x42')](_0x0cf1('0x4b')))},'json':!![]};rp(_0x470306)[_0x0cf1('0x12')](function(_0x2870f2){var _0x5a75df={'messageId':_0x2870f2['message_uuid'][0x0]};return _0x44e15e[_0x0cf1('0x13')](_0x5a75df);})[_0x0cf1('0x14')](function(_0x4ad372){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x48'),util[_0x0cf1('0x24')](_0x4ad372,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x48'),_0x0cf1('0x4c'));}break;case _0x0cf1('0x4d'):if(_0x1697fa['username']&&_0x1697fa[_0x0cf1('0x2d')]){if(_0x1697fa[_0x0cf1('0x4e')]){var _0x22d543={'method':_0x0cf1('0x30'),'uri':_0x1697fa[_0x0cf1('0x4e')]+'/auth/1/session','body':{'username':_0x1697fa['username'],'password':_0x1697fa[_0x0cf1('0x2d')]},'json':!![]};return rp(_0x22d543)[_0x0cf1('0x12')](function(_0x49329b){var _0x5e8178={'method':'POST','uri':_0x1697fa['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1697fa[_0x0cf1('0x1d')],'destinations':[{'to':_0x3041e9[_0x0cf1('0x1d')]}],'text':_0x3041e9[_0x0cf1('0x29')],'notifyUrl':_0x1697fa[_0x0cf1('0x1e')]+_0x0cf1('0x49')+_0x3041e9['id']+_0x0cf1('0x1f')+_0x1697fa['token'],'notifyContentType':_0x0cf1('0x4f'),'callbackData':_0x1697fa[_0x0cf1('0x1d')]+';'+_0x3041e9[_0x0cf1('0x29')]}]},'headers':{'Authorization':_0x0cf1('0x50')+_0x49329b['token']},'json':!![]};return rp(_0x5e8178)[_0x0cf1('0x12')](function(_0x43d4bb){if(_0x43d4bb[_0x0cf1('0x1b')]){var _0x2ed7c2={'messageId':_0x43d4bb['messages'][0x0]['messageId']};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x2ed7c2['read']=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x2ed7c2);}else{return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util['inspect'](_0x43d4bb,{'showHidden':![],'depth':null}));}});})[_0x0cf1('0x14')](function(_0x343129){return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x4d'),util['inspect'](_0x343129,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x4d'),_0x0cf1('0x51'));}}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x4d'),_0x0cf1('0x37'));}break;case'csc':var _0x2959f5=require(_0x0cf1('0x52'));if(_0x1697fa[_0x0cf1('0x53')]){var _0x5e56a0={};_0x5e56a0[_0x0cf1('0x54')]=_0x1697fa['username'];_0x5e56a0['phone']=_0x3041e9[_0x0cf1('0x1d')];_0x5e56a0[_0x0cf1('0x2b')]=_0x1697fa[_0x0cf1('0x1d')];_0x5e56a0[_0x0cf1('0x55')]=_0x3041e9[_0x0cf1('0x29')];_0x5e56a0[_0x0cf1('0x56')]=+new Date();var _0x3b47ea='';var _0x3bd5fd='';var _0xa905c8=Object['keys'](_0x5e56a0);_0xa905c8['sort']();for(var _0x3442da=0x0;_0x3442da<_0xa905c8[_0x0cf1('0x57')];_0x3442da++){if(_0x3b47ea!=''){_0x3b47ea+='&';}_0x3b47ea+=_0xa905c8[_0x3442da]+'='+encodeURIComponent(_0x5e56a0[_0xa905c8[_0x3442da]]);_0x3bd5fd+=_0x5e56a0[_0xa905c8[_0x3442da]];}_0x3bd5fd+=_0x1697fa[_0x0cf1('0x53')];_0x3bd5fd=_0x2959f5[_0x0cf1('0x58')](_0x0cf1('0x59'))[_0x0cf1('0x13')](_0x3bd5fd)[_0x0cf1('0x5a')](_0x0cf1('0x5b'));if(_0x3b47ea!==''){_0x3b47ea+='&';}_0x3b47ea+='signature='+_0x3bd5fd;var _0x519d48={'method':_0x0cf1('0x2e'),'uri':_0x1697fa[_0x0cf1('0x4e')]+'/external/get/send.php?'+_0x3b47ea,'json':!![]};return rp(_0x519d48)[_0x0cf1('0x12')](function(_0x268526){var _0x5ad6a4=Object['keys'](_0x268526);if(_0x268526[_0x5ad6a4[0x0]][_0x0cf1('0x22')]&&parseInt(_0x268526[_0x5ad6a4[0x0]][_0x0cf1('0x22')])===0x0){var _0x1fcff1={'messageId':_0x268526[_0x5ad6a4[0x0]][_0x0cf1('0x5c')]};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x1fcff1[_0x0cf1('0x35')]=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x1fcff1);}else{return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x5d'),util[_0x0cf1('0x24')](_0x268526[_0x0cf1('0x22')],{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0xd646ef){return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),'csc',util[_0x0cf1('0x24')](_0xd646ef,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x5d'),_0x0cf1('0x5e'));}break;case _0x0cf1('0x5f'):if(_0x1697fa['apiKey']){var _0x5a1d04={'method':'POST','uri':_0x0cf1('0x60'),'headers':{'Authorization':_0x1697fa[_0x0cf1('0x53')]},'body':{'content':_0x3041e9[_0x0cf1('0x29')],'to':[_0x3041e9['phone']],'from':_0x1697fa[_0x0cf1('0x1d')],'binary':![],'clientMessageId':_0x0cf1('0x61'),'charset':_0x0cf1('0x62')},'json':!![]};rp(_0x5a1d04)[_0x0cf1('0x12')](function(_0x22bc96){if(!_0x22bc96[_0x0cf1('0x22')]){var _0x313dee={'messageId':_0x22bc96[_0x0cf1('0x1b')][0x0][_0x0cf1('0x63')]};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x313dee[_0x0cf1('0x35')]=!![];}return _0x44e15e['update'](_0x313dee);}else{return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x5f'),util['inspect'](_0x22bc96['error'],{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0x24d9bb){return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x5f'),util[_0x0cf1('0x24')](_0x24d9bb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x5f'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x1697fa[_0x0cf1('0x28')]&&_0x1697fa[_0x0cf1('0x2d')]){var _0x57791c=util['format']('%s:%s',_0x1697fa[_0x0cf1('0x28')],_0x1697fa[_0x0cf1('0x2d')]);var _0x470306={'method':'POST','uri':_0x0cf1('0x64')+_0x1697fa[_0x0cf1('0x65')]+'/messages','body':{'to':[_0x3041e9['phone']],'text':_0x3041e9['body'],'from':_0x1697fa[_0x0cf1('0x1d')],'applicationId':_0x1697fa[_0x0cf1('0x66')]},'headers':{'Authorization':util[_0x0cf1('0x3e')](_0x0cf1('0x41'),new Buffer(_0x57791c)[_0x0cf1('0x42')](_0x0cf1('0x4b')))},'json':!![]};rp(_0x470306)['then'](function(_0x4a92e0){if(_0x4a92e0['id']){var _0x432504={'messageId':_0x4a92e0['id']};return _0x44e15e[_0x0cf1('0x13')](_0x432504);}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x67'),util[_0x0cf1('0x24')](_0x4a92e0,{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0xbcc7a4){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x67'),util[_0x0cf1('0x24')](_0xbcc7a4,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x67'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x1697fa[_0x0cf1('0x53')]){var _0x29fdd4={};var _0x519d48={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x68'),'headers':{'Authorization':_0x0cf1('0x69')+_0x1697fa[_0x0cf1('0x53')],'Content-Type':_0x0cf1('0x4f')},'body':{'from':_0x1697fa[_0x0cf1('0x1d')],'to':_0x3041e9['phone'],'text':_0x3041e9[_0x0cf1('0x29')]},'json':!![]};return rp(_0x519d48)['then'](function(_0x3e3f93){if(_0x3e3f93[_0x0cf1('0x6a')]==0xca){_0x29fdd4[_0x0cf1('0x6b')]=_0x3e3f93;var _0x4e3b18={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x6c'),'headers':{'Authorization':_0x0cf1('0x69')+_0x1697fa[_0x0cf1('0x53')],'Content-Type':_0x0cf1('0x4f')},'body':{'refid':_0x29fdd4[_0x0cf1('0x6b')][_0x0cf1('0x6d')]},'json':!![]};return rp(_0x4e3b18)[_0x0cf1('0x12')](function(_0x3563ec){_0x29fdd4[_0x0cf1('0x6e')]=_0x3563ec;var _0x533c05={'messageId':_0x29fdd4['message'][_0x0cf1('0x6d')],'read':!![]};return _0x44e15e[_0x0cf1('0x13')](_0x533c05);});}else{return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),'intelepeer',util['inspect'](_0x3e3f93,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2eb344){return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x6f'),util[_0x0cf1('0x24')](_0x2eb344,{'showHidden':![],'depth':null}));});}else{return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),'intelepeer',_0x0cf1('0x70'));}break;}}})[_0x0cf1('0x71')](function(){_0x3d54ee();});}else{_0x3d54ee();}}},'charset':_0x0cf1('0x72'),'collate':_0x0cf1('0x73')});}; \ No newline at end of file +var _0x51f9=['twilio','accountSid','authToken','messages','body','phone','remote','/api/sms/messages/','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','POST','user_key','session_key','internal_order_id','deliveryReport','read','afterCreate','skebby','inspect','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','senderString','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/status?token=','format','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','login','timestamp','keys','sort','length','apiKey','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','accountId','/messages','applicationId','Missing\x20parameters:\x20username,\x20password','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','define','sms_messages','messageId','fti_sms_messages','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','error','SmsAccount','SmsAccountId','type'];(function(_0x476654,_0x484430){var _0x285f54=function(_0x5d5336){while(--_0x5d5336){_0x476654['push'](_0x476654['shift']());}};_0x285f54(++_0x484430);}(_0x51f9,0xd5));var _0x951f=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x51f9[_0x3bf925];return _0x2128a1;};'use strict';var _=require(_0x951f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x951f('0x1'));var moment=require(_0x951f('0x2'));var BPromise=require(_0x951f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x951f('0x4'));var rimraf=require(_0x951f('0x5'));var config=require(_0x951f('0x6'));var attributes=require(_0x951f('0x7'));module['exports']=function(_0x4ecd95,_0x178146){return _0x4ecd95[_0x951f('0x8')]('SmsMessage',attributes,{'tableName':_0x951f('0x9'),'paranoid':![],'indexes':[{'name':_0x951f('0xa'),'fields':[_0x951f('0xa')]},{'name':_0x951f('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x667e22,_0x41a919,_0x51ad68){var _0xa550e2=_0x4ecd95[_0x951f('0xc')];var _0x29c0ab=_0x667e22[_0x951f('0xd')]({'plain':!![]});if(_0x29c0ab['direction'][_0x951f('0xe')]()==='in'||_0x29c0ab[_0x951f('0xf')]['toLowerCase']()===_0x951f('0x10')&&!_0x29c0ab[_0x951f('0x11')]&&!_[_0x951f('0x12')](_0x29c0ab[_0x951f('0x13')])&&!_[_0x951f('0x12')](_0x29c0ab[_0x951f('0x14')])){_0xa550e2['SmsInteraction'][_0x951f('0x15')]({'where':{'id':_0x29c0ab['SmsInteractionId']}})[_0x951f('0x16')](function(_0x6fc42a){if(_0x6fc42a){_0x6fc42a[_0x951f('0x17')]({'lastMsgAt':_0x29c0ab[_0x951f('0x18')],'lastMsgDirection':_0x29c0ab[_0x951f('0xf')][_0x951f('0xe')]()});}})['catch'](function(_0x419aa2){console[_0x951f('0x19')](_0x419aa2);});}if(_0x29c0ab['direction']===_0x951f('0x10')&&!_0x29c0ab[_0x951f('0x11')]){var _0x1fa9e5;_0xa550e2[_0x951f('0x1a')]['find']({'where':{'id':_0x29c0ab[_0x951f('0x1b')]},'raw':!![]})['then'](function(_0x11295f){_0x1fa9e5=_0x11295f;if(_0x1fa9e5&&_0x1fa9e5['type']){switch(_0x1fa9e5[_0x951f('0x1c')]){case'twilio':var _0x565d4a=require(_0x951f('0x1d'));if(_0x1fa9e5[_0x951f('0x1e')]&&_0x1fa9e5[_0x951f('0x1f')]&&_0x1fa9e5['phone']){var _0x5c0f21=new _0x565d4a(_0x1fa9e5[_0x951f('0x1e')],_0x1fa9e5[_0x951f('0x1f')]);_0x5c0f21[_0x951f('0x20')]['create']({'body':_0x29c0ab[_0x951f('0x21')],'to':_0x29c0ab['phone'],'from':_0x1fa9e5[_0x951f('0x22')],'statusCallback':_0x1fa9e5[_0x951f('0x23')]+_0x951f('0x24')+_0x29c0ab['id']+'/status?token='+_0x1fa9e5[_0x951f('0x25')]})['then'](function(_0x2f3713){if(_0x2f3713[_0x951f('0x26')]){return _0x667e22['update']({'messageId':_0x2f3713[_0x951f('0x26')]});}})[_0x951f('0x27')](function(_0xceed8){logger[_0x951f('0x19')](_0x951f('0x28'),'afterCreate','twilio',util['inspect'](_0xceed8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x951f('0x28'),'afterCreate',_0x951f('0x1d'),_0x951f('0x29'));}break;case'skebby':var _0x1614e1=_0x951f('0x2a');if(_0x1fa9e5[_0x951f('0x2b')]&&_0x1fa9e5[_0x951f('0x2c')]){var _0x366d32={'recipient':[_0x29c0ab[_0x951f('0x22')]],'message':_0x29c0ab['body'],'message_type':_0x1fa9e5[_0x951f('0x2d')]};if(_0x1fa9e5[_0x951f('0x2d')]&&_0x1fa9e5[_0x951f('0x2d')]!=='SI'){_0x366d32[_0x951f('0x2e')]=_0x1fa9e5[_0x951f('0x22')];}var _0x361441={'url':_0x1614e1+_0x951f('0x2f')+_0x1fa9e5[_0x951f('0x2b')]+_0x951f('0x30')+_0x1fa9e5[_0x951f('0x2c')],'method':'GET'};rp(_0x361441)[_0x951f('0x16')](function(_0x17bd80){var _0xe714ae=_0x17bd80[_0x951f('0x31')](';');var _0x43873c={'user_key':_0xe714ae[0x0],'session_key':_0xe714ae[0x1]};_0x361441={'url':_0x1614e1+'sms','method':_0x951f('0x32'),'headers':{'user_key':_0x43873c[_0x951f('0x33')],'Session_key':_0x43873c[_0x951f('0x34')]},'json':!![],'body':_0x366d32};return rp(_0x361441);})['then'](function(_0x1a7b48){if(_0x1a7b48['total_sent']>=0x1){var _0x2059f3={'messageId':_0x1a7b48[_0x951f('0x35')]};if(_0x1fa9e5[_0x951f('0x2d')]!=='GP'||!_0x1fa9e5[_0x951f('0x36')]){_0x2059f3[_0x951f('0x37')]=!![];}return _0x667e22[_0x951f('0x17')](_0x2059f3);}else{return logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x39'),util[_0x951f('0x3a')](_0x1a7b48,{'showHidden':![],'depth':null}));}})[_0x951f('0x27')](function(_0x1f6cc7){return logger[_0x951f('0x19')](_0x951f('0x28'),'afterCreate',_0x951f('0x39'),util[_0x951f('0x3a')](_0x1f6cc7,{'showHidden':![],'depth':null}));});}else{logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x951f('0x3b'):if(_0x1fa9e5[_0x951f('0x1f')]){var _0x2c82a5={'recipient':_0x29c0ab[_0x951f('0x22')],'message':_0x29c0ab['body'],'sender':_0x1fa9e5['senderString']||_0x1fa9e5[_0x951f('0x22')],'authorization':_0x1fa9e5[_0x951f('0x1f')]};var _0x41a919={'method':_0x951f('0x32'),'uri':_0x951f('0x3c'),'body':_0x2c82a5,'json':!![]};rp(_0x41a919)[_0x951f('0x16')](function(_0x1eff3f){var _0x51ec02={'messageId':_0x1eff3f[_0x951f('0x3d')]};if(!_0x1fa9e5[_0x951f('0x36')]){_0x51ec02[_0x951f('0x37')]=!![];}return _0x667e22['update'](_0x51ec02);})[_0x951f('0x27')](function(_0x50fb0e){logger['error'](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x3b'),util[_0x951f('0x3a')](_0x50fb0e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x951f('0x38'),_0x951f('0x3b'),'Missing\x20parameters:\x20authToken');}break;case _0x951f('0x3e'):if(_0x1fa9e5[_0x951f('0x2b')]&&_0x1fa9e5['password']){var _0x2c82a5={'messages':[{'source':'xCALLY\x20Motion','to':_0x29c0ab[_0x951f('0x22')],'body':_0x29c0ab['body'],'from':_0x1fa9e5[_0x951f('0x3f')]||_0x1fa9e5[_0x951f('0x22')]}]};var _0x48f341=util['format'](_0x951f('0x40'),_0x1fa9e5[_0x951f('0x2b')],_0x1fa9e5[_0x951f('0x2c')]);var _0x41a919={'method':_0x951f('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2c82a5,'headers':{'Authorization':util['format'](_0x951f('0x41'),new Buffer(_0x48f341)[_0x951f('0x42')](_0x951f('0x43')))},'json':!![]};rp(_0x41a919)[_0x951f('0x16')](function(_0x45bb1a){if(_0x45bb1a['http_code']>=0xc8&&_0x45bb1a[_0x951f('0x44')]<=0xce){if(_0x45bb1a[_0x951f('0x45')]&&_0x45bb1a[_0x951f('0x45')][_0x951f('0x46')]>0x0){var _0x3890d3=_[_0x951f('0x47')](_0x45bb1a[_0x951f('0x45')][_0x951f('0x20')]);var _0x6ee1e0={'messageId':_0x3890d3[_0x951f('0x48')]};if(!_0x1fa9e5[_0x951f('0x36')]){_0x6ee1e0[_0x951f('0x37')]=!![];}return _0x667e22[_0x951f('0x17')](_0x6ee1e0);}else{logger[_0x951f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x951f('0x49'),util[_0x951f('0x3a')](_0x45bb1a,{'showHidden':![],'depth':null}));}}else{logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),'clickSend',util[_0x951f('0x3a')](_0x45bb1a,{'showHidden':![],'depth':null}));}})[_0x951f('0x27')](function(_0x342bdf){logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x49'),util[_0x951f('0x3a')](_0x342bdf,{'showHidden':![],'depth':null}));});}else{logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x49'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x951f('0x4a'):if(_0x1fa9e5[_0x951f('0x4b')]&&_0x1fa9e5[_0x951f('0x1f')]){var _0x2c82a5={'dst':_0x29c0ab['phone'],'text':_0x29c0ab['body'],'src':_0x1fa9e5['senderString']||_0x1fa9e5[_0x951f('0x22')],'url':_0x1fa9e5[_0x951f('0x23')]+_0x951f('0x24')+_0x29c0ab['id']+_0x951f('0x4c')+_0x1fa9e5[_0x951f('0x25')]};var _0x48f341=util['format'](_0x951f('0x40'),_0x1fa9e5[_0x951f('0x4b')],_0x1fa9e5[_0x951f('0x1f')]);var _0x41a919={'method':'POST','uri':util[_0x951f('0x4d')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1fa9e5[_0x951f('0x4b')]),'body':_0x2c82a5,'headers':{'Authorization':util['format'](_0x951f('0x41'),new Buffer(_0x48f341)[_0x951f('0x42')](_0x951f('0x43')))},'json':!![]};rp(_0x41a919)['then'](function(_0x11b00a){var _0x456f51={'messageId':_0x11b00a[_0x951f('0x4e')][0x0]};return _0x667e22['update'](_0x456f51);})[_0x951f('0x27')](function(_0x19ed68){logger[_0x951f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x951f('0x38'),_0x951f('0x4a'),util[_0x951f('0x3a')](_0x19ed68,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x951f('0x28'),'afterCreate',_0x951f('0x4a'),_0x951f('0x4f'));}break;case _0x951f('0x50'):if(_0x1fa9e5[_0x951f('0x2b')]&&_0x1fa9e5[_0x951f('0x2c')]){if(_0x1fa9e5['baseUrl']){var _0x4faada={'method':'POST','uri':_0x1fa9e5[_0x951f('0x51')]+_0x951f('0x52'),'body':{'username':_0x1fa9e5[_0x951f('0x2b')],'password':_0x1fa9e5[_0x951f('0x2c')]},'json':!![]};return rp(_0x4faada)[_0x951f('0x16')](function(_0x1aabb8){var _0x132fac={'method':_0x951f('0x32'),'uri':_0x1fa9e5[_0x951f('0x51')]+_0x951f('0x53'),'body':{'messages':[{'from':_0x1fa9e5[_0x951f('0x22')],'destinations':[{'to':_0x29c0ab[_0x951f('0x22')]}],'text':_0x29c0ab[_0x951f('0x21')],'notifyUrl':_0x1fa9e5[_0x951f('0x23')]+_0x951f('0x24')+_0x29c0ab['id']+_0x951f('0x4c')+_0x1fa9e5[_0x951f('0x25')],'notifyContentType':_0x951f('0x54'),'callbackData':_0x1fa9e5[_0x951f('0x22')]+';'+_0x29c0ab[_0x951f('0x21')]}]},'headers':{'Authorization':_0x951f('0x55')+_0x1aabb8[_0x951f('0x25')]},'json':!![]};return rp(_0x132fac)['then'](function(_0x4e2e3e){if(_0x4e2e3e[_0x951f('0x20')]){var _0x4e8b01={'messageId':_0x4e2e3e[_0x951f('0x20')][0x0]['messageId']};if(!_0x1fa9e5[_0x951f('0x36')]){_0x4e8b01['read']=!![];}return _0x667e22[_0x951f('0x17')](_0x4e8b01);}else{return logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x50'),util[_0x951f('0x3a')](_0x4e2e3e,{'showHidden':![],'depth':null}));}});})[_0x951f('0x27')](function(_0x238443){return logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x50'),util[_0x951f('0x3a')](_0x238443,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x951f('0x28'),'afterCreate',_0x951f('0x50'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x951f('0x19')](_0x951f('0x28'),'afterCreate',_0x951f('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x951f('0x56'):var _0x29a77d=require(_0x951f('0x57'));if(_0x1fa9e5['apiKey']){var _0xef585a={};_0xef585a[_0x951f('0x58')]=_0x1fa9e5['username'];_0xef585a[_0x951f('0x22')]=_0x29c0ab['phone'];_0xef585a[_0x951f('0x2e')]=_0x1fa9e5[_0x951f('0x22')];_0xef585a['text']=_0x29c0ab[_0x951f('0x21')];_0xef585a[_0x951f('0x59')]=+new Date();var _0x4ad678='';var _0x47b690='';var _0x3ceb5e=Object[_0x951f('0x5a')](_0xef585a);_0x3ceb5e[_0x951f('0x5b')]();for(var _0x43862c=0x0;_0x43862c<_0x3ceb5e[_0x951f('0x5c')];_0x43862c++){if(_0x4ad678!=''){_0x4ad678+='&';}_0x4ad678+=_0x3ceb5e[_0x43862c]+'='+encodeURIComponent(_0xef585a[_0x3ceb5e[_0x43862c]]);_0x47b690+=_0xef585a[_0x3ceb5e[_0x43862c]];}_0x47b690+=_0x1fa9e5[_0x951f('0x5d')];_0x47b690=_0x29a77d[_0x951f('0x5e')](_0x951f('0x5f'))[_0x951f('0x17')](_0x47b690)['digest'](_0x951f('0x60'));if(_0x4ad678!==''){_0x4ad678+='&';}_0x4ad678+=_0x951f('0x61')+_0x47b690;var _0x361441={'method':'GET','uri':_0x1fa9e5['baseUrl']+_0x951f('0x62')+_0x4ad678,'json':!![]};return rp(_0x361441)[_0x951f('0x16')](function(_0x6e49c8){var _0x154426=Object[_0x951f('0x5a')](_0x6e49c8);if(_0x6e49c8[_0x154426[0x0]][_0x951f('0x19')]&&parseInt(_0x6e49c8[_0x154426[0x0]][_0x951f('0x19')])===0x0){var _0x1c03c8={'messageId':_0x6e49c8[_0x154426[0x0]][_0x951f('0x63')]};if(!_0x1fa9e5['deliveryReport']){_0x1c03c8[_0x951f('0x37')]=!![];}return _0x667e22['update'](_0x1c03c8);}else{return logger['error'](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x56'),util[_0x951f('0x3a')](_0x6e49c8[_0x951f('0x19')],{'showHidden':![],'depth':null}));}})[_0x951f('0x27')](function(_0x11b8ab){return logger['error'](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x56'),util[_0x951f('0x3a')](_0x11b8ab,{'showHidden':![],'depth':null}));});}else{logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x56'),_0x951f('0x64'));}break;case _0x951f('0x65'):if(_0x1fa9e5[_0x951f('0x5d')]){var _0x3209f8={'method':_0x951f('0x32'),'uri':_0x951f('0x66'),'headers':{'Authorization':_0x1fa9e5[_0x951f('0x5d')]},'body':{'content':_0x29c0ab[_0x951f('0x21')],'to':[_0x29c0ab[_0x951f('0x22')]],'from':_0x1fa9e5['phone'],'binary':![],'clientMessageId':_0x951f('0x67'),'charset':_0x951f('0x68')},'json':!![]};rp(_0x3209f8)[_0x951f('0x16')](function(_0x34039c){if(!_0x34039c[_0x951f('0x19')]){var _0x48f371={'messageId':_0x34039c['messages'][0x0][_0x951f('0x69')]};if(!_0x1fa9e5[_0x951f('0x36')]){_0x48f371[_0x951f('0x37')]=!![];}return _0x667e22[_0x951f('0x17')](_0x48f371);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x951f('0x38'),_0x951f('0x65'),util['inspect'](_0x34039c[_0x951f('0x19')],{'showHidden':![],'depth':null}));}})[_0x951f('0x27')](function(_0x5b393e){return logger['error'](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x65'),util['inspect'](_0x5b393e,{'showHidden':![],'depth':null}));});}else{logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x65'),_0x951f('0x64'));}break;case _0x951f('0x6a'):if(_0x1fa9e5[_0x951f('0x2b')]&&_0x1fa9e5[_0x951f('0x2c')]){var _0x48f341=util[_0x951f('0x4d')](_0x951f('0x40'),_0x1fa9e5[_0x951f('0x2b')],_0x1fa9e5[_0x951f('0x2c')]);var _0x41a919={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1fa9e5[_0x951f('0x6b')]+_0x951f('0x6c'),'body':{'to':[_0x29c0ab[_0x951f('0x22')]],'text':_0x29c0ab[_0x951f('0x21')],'from':_0x1fa9e5[_0x951f('0x22')],'applicationId':_0x1fa9e5[_0x951f('0x6d')]},'headers':{'Authorization':util[_0x951f('0x4d')](_0x951f('0x41'),new Buffer(_0x48f341)[_0x951f('0x42')]('base64'))},'json':!![]};rp(_0x41a919)[_0x951f('0x16')](function(_0x7ab0fc){if(_0x7ab0fc['id']){var _0x1c1f8e={'messageId':_0x7ab0fc['id']};return _0x667e22[_0x951f('0x17')](_0x1c1f8e);}else{logger['error'](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x6a'),util['inspect'](_0x7ab0fc,{'showHidden':![],'depth':null}));}})[_0x951f('0x27')](function(_0x567385){logger['error'](_0x951f('0x28'),'afterCreate','bandwidth',util[_0x951f('0x3a')](_0x567385,{'showHidden':![],'depth':null}));});}else{logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x6a'),_0x951f('0x6e'));}break;case _0x951f('0x6f'):if(_0x1fa9e5[_0x951f('0x5d')]){var _0xca759d={};var _0x361441={'method':_0x951f('0x32'),'uri':_0x951f('0x70'),'headers':{'Authorization':_0x951f('0x71')+_0x1fa9e5[_0x951f('0x5d')],'Content-Type':_0x951f('0x54')},'body':{'from':_0x1fa9e5['phone'],'to':_0x29c0ab[_0x951f('0x22')],'text':_0x29c0ab[_0x951f('0x21')]},'json':!![]};return rp(_0x361441)[_0x951f('0x16')](function(_0x1a0ad3){if(_0x1a0ad3[_0x951f('0x72')]==0xca){_0xca759d['message']=_0x1a0ad3;var _0x176bb9={'method':'POST','uri':_0x951f('0x73'),'headers':{'Authorization':_0x951f('0x71')+_0x1fa9e5['apiKey'],'Content-Type':_0x951f('0x54')},'body':{'refid':_0xca759d[_0x951f('0x74')]['refid']},'json':!![]};return rp(_0x176bb9)[_0x951f('0x16')](function(_0xbb5140){_0xca759d[_0x951f('0x75')]=_0xbb5140;var _0x24cdea={'messageId':_0xca759d[_0x951f('0x74')]['refid'],'read':!![]};return _0x667e22[_0x951f('0x17')](_0x24cdea);});}else{return logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x6f'),util['inspect'](_0x1a0ad3,{'showHidden':![],'depth':null}));}})[_0x951f('0x27')](function(_0x469ffa){return logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x6f'),util[_0x951f('0x3a')](_0x469ffa,{'showHidden':![],'depth':null}));});}else{return logger[_0x951f('0x19')](_0x951f('0x28'),_0x951f('0x38'),_0x951f('0x6f'),'Token\x20not\x20received');}break;}}})[_0x951f('0x76')](function(){_0x51ad68();});}else{_0x51ad68();}}},'charset':_0x951f('0x77'),'collate':_0x951f('0x78')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a4d86a9..fca580c 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 _0x3ad1=['body','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','SmsMessage','create'];(function(_0x449347,_0x3f49ef){var _0x4994a5=function(_0x28fff8){while(--_0x28fff8){_0x449347['push'](_0x449347['shift']());}};_0x4994a5(++_0x3f49ef);}(_0x3ad1,0x10c));var _0x13ad=function(_0x2c5a99,_0x257114){_0x2c5a99=_0x2c5a99-0x0;var _0x59c60b=_0x3ad1[_0x2c5a99];return _0x59c60b;};'use strict';var _=require(_0x13ad('0x0'));var util=require(_0x13ad('0x1'));var moment=require(_0x13ad('0x2'));var BPromise=require(_0x13ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13ad('0x4'))['db'];var utils=require(_0x13ad('0x5'));var logger=require(_0x13ad('0x6'))(_0x13ad('0x7'));var config=require(_0x13ad('0x8'));var jayson=require(_0x13ad('0x9'));var client=jayson[_0x13ad('0xa')][_0x13ad('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x13ad('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x13ad('0xd'))(new Redis(config[_0x13ad('0xc')]));require(_0x13ad('0xe'))[_0x13ad('0xf')](socket);function respondWithRpcPromise(_0x40ac46,_0xe0c158,_0x49e348){return new BPromise(function(_0x24186a,_0xf3f5de){return client[_0x13ad('0x10')](_0x40ac46,_0x49e348)[_0x13ad('0x11')](function(_0x53b826){logger['info'](_0x13ad('0x12'),_0xe0c158,_0x13ad('0x13'));logger['debug'](_0x13ad('0x14'),_0xe0c158,_0x13ad('0x13'),JSON[_0x13ad('0x15')](_0x53b826));if(_0x53b826[_0x13ad('0x16')]){if(_0x53b826['error']['code']===0x1f4){logger['error'](_0x13ad('0x12'),_0xe0c158,_0x53b826[_0x13ad('0x16')][_0x13ad('0x17')]);return _0xf3f5de(_0x53b826[_0x13ad('0x16')]['message']);}logger[_0x13ad('0x16')]('SmsMessage,\x20%s,\x20%s',_0xe0c158,_0x53b826[_0x13ad('0x16')][_0x13ad('0x17')]);return _0x24186a(_0x53b826[_0x13ad('0x16')][_0x13ad('0x17')]);}else{logger[_0x13ad('0x18')]('SmsMessage,\x20%s,\x20%s',_0xe0c158,'request\x20sent');_0x24186a(_0x53b826[_0x13ad('0x19')][_0x13ad('0x17')]);}})[_0x13ad('0x1a')](function(_0x3c8a8c){logger[_0x13ad('0x16')](_0x13ad('0x12'),_0xe0c158,_0x3c8a8c);_0xf3f5de(_0x3c8a8c);});});}exports['CreateSmsMessage']=function(_0x25e65e){var _0x471db6=this;return new Promise(function(_0x50f0d6,_0x15f9cd){return db[_0x13ad('0x1b')][_0x13ad('0x1c')](_0x25e65e[_0x13ad('0x1d')],{'raw':_0x25e65e[_0x13ad('0x1e')]?_0x25e65e[_0x13ad('0x1e')][_0x13ad('0x1f')]===undefined?!![]:![]:!![]})[_0x13ad('0x11')](function(_0x50a48c){logger['info'](_0x13ad('0x20'),_0x25e65e);logger['debug']('CreateSmsMessage',_0x25e65e,JSON[_0x13ad('0x15')](_0x50a48c));_0x50f0d6(_0x50a48c);})[_0x13ad('0x1a')](function(_0x1b984c){logger[_0x13ad('0x16')](_0x13ad('0x20'),_0x1b984c['message'],_0x25e65e);_0x15f9cd(_0x471db6[_0x13ad('0x16')](0x1f4,_0x1b984c[_0x13ad('0x17')]));});});}; \ No newline at end of file +var _0xdf19=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','SmsMessage','create','body','then','info','CreateSmsMessage','debug'];(function(_0x133b68,_0x252c1a){var _0x54c2a1=function(_0x28a9c7){while(--_0x28a9c7){_0x133b68['push'](_0x133b68['shift']());}};_0x54c2a1(++_0x252c1a);}(_0xdf19,0xe7));var _0x9df1=function(_0x5f4abc,_0x1692ac){_0x5f4abc=_0x5f4abc-0x0;var _0x3c29a6=_0xdf19[_0x5f4abc];return _0x3c29a6;};'use strict';var _=require(_0x9df1('0x0'));var util=require('util');var moment=require(_0x9df1('0x1'));var BPromise=require(_0x9df1('0x2'));var rs=require(_0x9df1('0x3'));var fs=require('fs');var Redis=require(_0x9df1('0x4'));var db=require(_0x9df1('0x5'))['db'];var utils=require(_0x9df1('0x6'));var logger=require(_0x9df1('0x7'))('rpc');var config=require(_0x9df1('0x8'));var jayson=require(_0x9df1('0x9'));var client=jayson[_0x9df1('0xa')][_0x9df1('0xb')]({'port':0x232a});config[_0x9df1('0xc')]=_[_0x9df1('0xd')](config['redis'],{'host':_0x9df1('0xe'),'port':0x18eb});var socket=require(_0x9df1('0xf'))(new Redis(config[_0x9df1('0xc')]));require(_0x9df1('0x10'))[_0x9df1('0x11')](socket);function respondWithRpcPromise(_0x4f120c,_0x55e540,_0x52cd9f){return new BPromise(function(_0x1bad3e,_0x3414f8){return client['request'](_0x4f120c,_0x52cd9f)['then'](function(_0x419123){logger['info']('SmsMessage,\x20%s,\x20%s',_0x55e540,'request\x20sent');logger['debug'](_0x9df1('0x12'),_0x55e540,_0x9df1('0x13'),JSON[_0x9df1('0x14')](_0x419123));if(_0x419123['error']){if(_0x419123[_0x9df1('0x15')][_0x9df1('0x16')]===0x1f4){logger['error'](_0x9df1('0x17'),_0x55e540,_0x419123['error'][_0x9df1('0x18')]);return _0x3414f8(_0x419123[_0x9df1('0x15')][_0x9df1('0x18')]);}logger[_0x9df1('0x15')](_0x9df1('0x17'),_0x55e540,_0x419123[_0x9df1('0x15')][_0x9df1('0x18')]);return _0x1bad3e(_0x419123[_0x9df1('0x15')]['message']);}else{logger['info'](_0x9df1('0x17'),_0x55e540,_0x9df1('0x13'));_0x1bad3e(_0x419123['result'][_0x9df1('0x18')]);}})[_0x9df1('0x19')](function(_0x242ba3){logger[_0x9df1('0x15')]('SmsMessage,\x20%s,\x20%s',_0x55e540,_0x242ba3);_0x3414f8(_0x242ba3);});});}exports['CreateSmsMessage']=function(_0x2b590d){var _0x546a26=this;return new Promise(function(_0x5ad0db,_0x4e80fd){return db[_0x9df1('0x1a')][_0x9df1('0x1b')](_0x2b590d[_0x9df1('0x1c')],{'raw':_0x2b590d['options']?_0x2b590d['options']['raw']===undefined?!![]:![]:!![]})[_0x9df1('0x1d')](function(_0x16a21c){logger[_0x9df1('0x1e')](_0x9df1('0x1f'),_0x2b590d);logger[_0x9df1('0x20')](_0x9df1('0x1f'),_0x2b590d,JSON[_0x9df1('0x14')](_0x16a21c));_0x5ad0db(_0x16a21c);})[_0x9df1('0x19')](function(_0x3dfca3){logger[_0x9df1('0x15')]('CreateSmsMessage',_0x3dfca3['message'],_0x2b590d);_0x4e80fd(_0x546a26[_0x9df1('0x15')](0x1f4,_0x3dfca3[_0x9df1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 1054146..053d49c 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 _0x7c63=['register','smsMessage:','./smsMessage.events','remove','removeListener'];(function(_0x348ca1,_0x429707){var _0x466322=function(_0x131ed7){while(--_0x131ed7){_0x348ca1['push'](_0x348ca1['shift']());}};_0x466322(++_0x429707);}(_0x7c63,0x17e));var _0x37c6=function(_0x198a1e,_0x16338c){_0x198a1e=_0x198a1e-0x0;var _0x50ffe2=_0x7c63[_0x198a1e];return _0x50ffe2;};'use strict';var SmsMessageEvents=require(_0x37c6('0x0'));var events=['save',_0x37c6('0x1'),'update'];function createListener(_0x32832e,_0x964414){return function(_0x48d6cc){_0x964414['emit'](_0x32832e,_0x48d6cc);};}function removeListener(_0x320a5b,_0x5370f8){return function(){SmsMessageEvents[_0x37c6('0x2')](_0x320a5b,_0x5370f8);};}exports[_0x37c6('0x3')]=function(_0x5afb8b){for(var _0x4c59db=0x0,_0x1cd0b4=events['length'];_0x4c59db<_0x1cd0b4;_0x4c59db++){var _0x2a456d=events[_0x4c59db];var _0x3077a6=createListener(_0x37c6('0x4')+_0x2a456d,_0x5afb8b);SmsMessageEvents['on'](_0x2a456d,_0x3077a6);}}; \ No newline at end of file +var _0x1063=['remove','removeListener','register','length','./smsMessage.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1063,0x10c));var _0x3106=function(_0x195122,_0x3d0c8e){_0x195122=_0x195122-0x0;var _0x3c62f1=_0x1063[_0x195122];return _0x3c62f1;};'use strict';var SmsMessageEvents=require(_0x3106('0x0'));var events=[_0x3106('0x1'),_0x3106('0x2'),'update'];function createListener(_0x731838,_0x221253){return function(_0x3ba046){_0x221253['emit'](_0x731838,_0x3ba046);};}function removeListener(_0xa36da,_0x3c14c9){return function(){SmsMessageEvents[_0x3106('0x3')](_0xa36da,_0x3c14c9);};}exports[_0x3106('0x4')]=function(_0x36a7f8){for(var _0x1a3a5d=0x0,_0x34f9d3=events[_0x3106('0x5')];_0x1a3a5d<_0x34f9d3;_0x1a3a5d++){var _0x1ea705=events[_0x1a3a5d];var _0x413100=createListener('smsMessage:'+_0x1ea705,_0x36a7f8);SmsMessageEvents['on'](_0x1ea705,_0x413100);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 44d3789..12b877e 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 _0x408c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get','/describe','/:id','show','getMembers','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','/:id/teams','removeTeams','removeAgents','exports','multer'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x408c,0x167));var _0xc408=function(_0xaf2c0d,_0x39086c){_0xaf2c0d=_0xaf2c0d-0x0;var _0x119747=_0x408c[_0xaf2c0d];return _0x119747;};'use strict';var multer=require(_0xc408('0x0'));var util=require('util');var path=require(_0xc408('0x1'));var timeout=require(_0xc408('0x2'));var express=require(_0xc408('0x3'));var router=express[_0xc408('0x4')]();var fs_extra=require(_0xc408('0x5'));var auth=require(_0xc408('0x6'));var interaction=require(_0xc408('0x7'));var config=require('../../config/environment');var controller=require(_0xc408('0x8'));router['get']('/',auth[_0xc408('0x9')](),controller[_0xc408('0xa')]);router[_0xc408('0xb')](_0xc408('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc408('0xb')](_0xc408('0xd'),auth[_0xc408('0x9')](),controller[_0xc408('0xe')]);router[_0xc408('0xb')]('/:id/members',auth[_0xc408('0x9')](),controller[_0xc408('0xf')]);router[_0xc408('0xb')]('/:id/teams',auth[_0xc408('0x9')](),controller['getTeams']);router[_0xc408('0xb')]('/:id/users',auth[_0xc408('0x9')](),controller[_0xc408('0x10')]);router[_0xc408('0x11')]('/',auth[_0xc408('0x9')](),controller[_0xc408('0x12')]);router[_0xc408('0x11')]('/:id/teams',auth[_0xc408('0x9')](),controller[_0xc408('0x13')]);router[_0xc408('0x11')](_0xc408('0x14'),auth[_0xc408('0x9')](),controller[_0xc408('0x15')]);router[_0xc408('0x16')]('/:id',auth[_0xc408('0x9')](),controller[_0xc408('0x17')]);router['delete'](_0xc408('0xd'),auth[_0xc408('0x9')](),controller[_0xc408('0x18')]);router[_0xc408('0x19')](_0xc408('0x1a'),auth['isAuthenticated'](),controller[_0xc408('0x1b')]);router['delete'](_0xc408('0x14'),auth[_0xc408('0x9')](),controller[_0xc408('0x1c')]);module[_0xc408('0x1d')]=router; \ No newline at end of file +var _0xaa9a=['addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa9a,0x1c7));var _0xaaa9=function(_0x2fb374,_0x11b772){_0x2fb374=_0x2fb374-0x0;var _0x4bccc9=_0xaa9a[_0x2fb374];return _0x4bccc9;};'use strict';var multer=require(_0xaaa9('0x0'));var util=require(_0xaaa9('0x1'));var path=require(_0xaaa9('0x2'));var timeout=require('connect-timeout');var express=require(_0xaaa9('0x3'));var router=express['Router']();var fs_extra=require(_0xaaa9('0x4'));var auth=require(_0xaaa9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0xaaa9('0x6')]('/',auth['isAuthenticated'](),controller[_0xaaa9('0x7')]);router[_0xaaa9('0x6')](_0xaaa9('0x8'),auth['isAuthenticated'](),controller[_0xaaa9('0x9')]);router[_0xaaa9('0x6')](_0xaaa9('0xa'),auth[_0xaaa9('0xb')](),controller[_0xaaa9('0xc')]);router[_0xaaa9('0x6')]('/:id/members',auth[_0xaaa9('0xb')](),controller[_0xaaa9('0xd')]);router[_0xaaa9('0x6')](_0xaaa9('0xe'),auth[_0xaaa9('0xb')](),controller[_0xaaa9('0xf')]);router['get'](_0xaaa9('0x10'),auth[_0xaaa9('0xb')](),controller[_0xaaa9('0x11')]);router[_0xaaa9('0x12')]('/',auth[_0xaaa9('0xb')](),controller[_0xaaa9('0x13')]);router[_0xaaa9('0x12')](_0xaaa9('0xe'),auth['isAuthenticated'](),controller[_0xaaa9('0x14')]);router[_0xaaa9('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xaaa9('0x15')]);router[_0xaaa9('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xaaa9('0x17')]);router[_0xaaa9('0x18')](_0xaaa9('0xa'),auth[_0xaaa9('0xb')](),controller[_0xaaa9('0x19')]);router[_0xaaa9('0x18')]('/:id/teams',auth[_0xaaa9('0xb')](),controller['removeTeams']);router['delete'](_0xaaa9('0x10'),auth[_0xaaa9('0xb')](),controller[_0xaaa9('0x1a')]);module[_0xaaa9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index e4cfc2e..01eb2f5 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 _0x1e3a=['exports','name','STRING','INTEGER','rrmemory','beepall'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x1e3a,0xfc));var _0xa1e3=function(_0x169790,_0x48aa33){_0x169790=_0x169790-0x0;var _0x4d0f36=_0x1e3a[_0x169790];return _0x4d0f36;};'use strict';var Sequelize=require('sequelize');module[_0xa1e3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa1e3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa1e3('0x2')]},'timeout':{'type':Sequelize[_0xa1e3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa1e3('0x4'),_0xa1e3('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x1916=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1a039,_0x257de3){var _0x244c26=function(_0x2721c7){while(--_0x2721c7){_0x1a039['push'](_0x1a039['shift']());}};_0x244c26(++_0x257de3);}(_0x1916,0x7a));var _0x6191=function(_0x3bf34e,_0x22d537){_0x3bf34e=_0x3bf34e-0x0;var _0x266120=_0x1916[_0x3bf34e];return _0x266120;};'use strict';var Sequelize=require(_0x6191('0x0'));module['exports']={'name':{'type':Sequelize[_0x6191('0x1')],'unique':_0x6191('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6191('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6191('0x4')](_0x6191('0x5'),_0x6191('0x6'),_0x6191('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 8398483..887928f 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 _0xeb38=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','agent','smsPause','createdAt','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','emit','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','stack','name','send','map','SmsQueue','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x18e2a1,_0x56a737){var _0x1b70e9=function(_0x5b4322){while(--_0x5b4322){_0x18e2a1['push'](_0x18e2a1['shift']());}};_0x1b70e9(++_0x56a737);}(_0xeb38,0x15b));var _0x8eb3=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xeb38[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require(_0x8eb3('0x0'));var rimraf=require(_0x8eb3('0x1'));var zipdir=require(_0x8eb3('0x2'));var jsonpatch=require(_0x8eb3('0x3'));var rp=require(_0x8eb3('0x4'));var moment=require(_0x8eb3('0x5'));var BPromise=require(_0x8eb3('0x6'));var Mustache=require(_0x8eb3('0x7'));var util=require(_0x8eb3('0x8'));var path=require(_0x8eb3('0x9'));var sox=require(_0x8eb3('0xa'));var csv=require(_0x8eb3('0xb'));var ejs=require(_0x8eb3('0xc'));var fs=require('fs');var fs_extra=require(_0x8eb3('0xd'));var _=require(_0x8eb3('0xe'));var squel=require('squel');var crypto=require(_0x8eb3('0xf'));var jsforce=require(_0x8eb3('0x10'));var deskjs=require(_0x8eb3('0x11'));var toCsv=require(_0x8eb3('0xb'));var querystring=require(_0x8eb3('0x12'));var Papa=require(_0x8eb3('0x13'));var Redis=require(_0x8eb3('0x14'));var authService=require(_0x8eb3('0x15'));var qs=require(_0x8eb3('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8eb3('0x17'));var logger=require('../../config/logger')(_0x8eb3('0x18'));var utils=require(_0x8eb3('0x19'));var config=require(_0x8eb3('0x1a'));var licenseUtil=require(_0x8eb3('0x1b'));var db=require(_0x8eb3('0x1c'))['db'];config[_0x8eb3('0x1d')]=_[_0x8eb3('0x1e')](config[_0x8eb3('0x1d')],{'host':_0x8eb3('0x1f'),'port':0x18eb});var socket=require(_0x8eb3('0x20'))(new Redis(config['redis']));require(_0x8eb3('0x21'))[_0x8eb3('0x22')](socket);function respondWithStatusCode(_0x5bf5f7,_0x35e941){_0x35e941=_0x35e941||0xcc;return function(_0x1606fa){if(_0x1606fa){return _0x5bf5f7['sendStatus'](_0x35e941);}return _0x5bf5f7[_0x8eb3('0x23')](_0x35e941)[_0x8eb3('0x24')]();};}function respondWithResult(_0xdb630e,_0x6140de){_0x6140de=_0x6140de||0xc8;return function(_0x2c3f8f){if(_0x2c3f8f){return _0xdb630e[_0x8eb3('0x23')](_0x6140de)['json'](_0x2c3f8f);}};}function respondWithFilteredResult(_0xa3f853,_0x122c3e){return function(_0x5b04af){if(_0x5b04af){var _0x4f2509=typeof _0x122c3e[_0x8eb3('0x25')]==='undefined'&&typeof _0x122c3e[_0x8eb3('0x26')]==='undefined';var _0x1753a2=_0x5b04af[_0x8eb3('0x27')];var _0x217cbc=_0x4f2509?0x0:_0x122c3e[_0x8eb3('0x25')];var _0x5d0645=_0x4f2509?_0x5b04af[_0x8eb3('0x27')]:_0x122c3e[_0x8eb3('0x25')]+_0x122c3e[_0x8eb3('0x26')];var _0x15f8cf;if(_0x5d0645>=_0x1753a2){_0x5d0645=_0x1753a2;_0x15f8cf=0xc8;}else{_0x15f8cf=0xce;}_0xa3f853[_0x8eb3('0x23')](_0x15f8cf);return _0xa3f853[_0x8eb3('0x28')](_0x8eb3('0x29'),_0x217cbc+'-'+_0x5d0645+'/'+_0x1753a2)[_0x8eb3('0x2a')](_0x5b04af);}return null;};}function patchUpdates(_0x31a9d4){return function(_0x27b144){try{jsonpatch[_0x8eb3('0x2b')](_0x27b144,_0x31a9d4,!![]);}catch(_0x1ab62e){return BPromise[_0x8eb3('0x2c')](_0x1ab62e);}return _0x27b144[_0x8eb3('0x2d')]();};}function saveUpdates(_0x1b3273,_0x331be8){return function(_0x3dc830){if(_0x3dc830){return _0x3dc830['update'](_0x1b3273)[_0x8eb3('0x2e')](function(_0x3f6c3f){return _0x3f6c3f;});}return null;};}function removeEntity(_0x132d49,_0x340097){return function(_0xa7cdfe){if(_0xa7cdfe){return _0xa7cdfe[_0x8eb3('0x2f')]()[_0x8eb3('0x2e')](function(){var _0x2a0408=_0xa7cdfe[_0x8eb3('0x30')]({'plain':!![]});var _0x3acd55=_0x8eb3('0x31');return db[_0x8eb3('0x32')][_0x8eb3('0x2f')]({'where':{'type':_0x3acd55,'resourceId':_0x2a0408['id']}})[_0x8eb3('0x2e')](function(){return _0xa7cdfe;});})[_0x8eb3('0x2e')](function(){_0x132d49[_0x8eb3('0x23')](0xcc)[_0x8eb3('0x24')]();});}};}function handleEntityNotFound(_0x178fb6,_0x2d29eb){return function(_0x4f7a72){if(!_0x4f7a72){_0x178fb6[_0x8eb3('0x33')](0x194);}return _0x4f7a72;};}function handleError(_0x26f343,_0x1dffb7){_0x1dffb7=_0x1dffb7||0x1f4;return function(_0x561150){logger['error'](_0x561150[_0x8eb3('0x34')]);if(_0x561150['name']){delete _0x561150[_0x8eb3('0x35')];}_0x26f343[_0x8eb3('0x23')](_0x1dffb7)[_0x8eb3('0x36')](_0x561150);};}exports['index']=function(_0x200228,_0x10bc88){var _0x8e6f83={},_0x318ea3={},_0x110fa7={'count':0x0,'rows':[]};var _0x5551c0=_[_0x8eb3('0x37')](db[_0x8eb3('0x38')][_0x8eb3('0x39')],function(_0x3490b6){return{'name':_0x3490b6['fieldName'],'type':_0x3490b6[_0x8eb3('0x3a')][_0x8eb3('0x3b')]};});_0x318ea3['model']=_[_0x8eb3('0x37')](_0x5551c0,_0x8eb3('0x35'));_0x318ea3[_0x8eb3('0x3c')]=_['keys'](_0x200228[_0x8eb3('0x3c')]);_0x318ea3[_0x8eb3('0x3d')]=_['intersection'](_0x318ea3[_0x8eb3('0x3e')],_0x318ea3[_0x8eb3('0x3c')]);_0x8e6f83[_0x8eb3('0x3f')]=_[_0x8eb3('0x40')](_0x318ea3['model'],qs[_0x8eb3('0x41')](_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x41')]));_0x8e6f83[_0x8eb3('0x3f')]=_0x8e6f83['attributes'][_0x8eb3('0x42')]?_0x8e6f83['attributes']:_0x318ea3[_0x8eb3('0x3e')];if(!_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x43')](_0x8eb3('0x44'))){_0x8e6f83[_0x8eb3('0x26')]=qs[_0x8eb3('0x26')](_0x200228[_0x8eb3('0x3c')]['limit']);_0x8e6f83['offset']=qs['offset'](_0x200228[_0x8eb3('0x3c')]['offset']);}_0x8e6f83['order']=qs[_0x8eb3('0x45')](_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x45')]);_0x8e6f83[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_[_0x8eb3('0x47')](_0x200228[_0x8eb3('0x3c')],_0x318ea3[_0x8eb3('0x3d')]),_0x5551c0);if(_0x200228[_0x8eb3('0x3c')]['filter']){_0x8e6f83[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x8e6f83[_0x8eb3('0x46')],{'$or':_[_0x8eb3('0x37')](_0x5551c0,function(_0x38b977){if(_0x38b977[_0x8eb3('0x3a')]!==_0x8eb3('0x49')){var _0x3dd0f9={};_0x3dd0f9[_0x38b977[_0x8eb3('0x35')]]={'$like':'%'+_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0x3dd0f9;}})});}_0x8e6f83=_[_0x8eb3('0x48')]({},_0x8e6f83,_0x200228[_0x8eb3('0x4b')]);var _0x14ed36={'where':_0x8e6f83[_0x8eb3('0x46')]};return db['SmsQueue'][_0x8eb3('0x27')](_0x14ed36)['then'](function(_0x4a27d3){_0x110fa7[_0x8eb3('0x27')]=_0x4a27d3;if(_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x4c')]){_0x8e6f83[_0x8eb3('0x4d')]=[{'all':!![]}];}return db[_0x8eb3('0x38')][_0x8eb3('0x4e')](_0x8e6f83);})[_0x8eb3('0x2e')](function(_0x57fb87){_0x110fa7[_0x8eb3('0x4f')]=_0x57fb87;return _0x110fa7;})['then'](respondWithFilteredResult(_0x10bc88,_0x8e6f83))[_0x8eb3('0x50')](handleError(_0x10bc88,null));};exports[_0x8eb3('0x51')]=function(_0x483a5d,_0x4bade3){var _0x11e0af={'raw':!![],'where':{'id':_0x483a5d[_0x8eb3('0x52')]['id']}},_0x34a0a6={};_0x34a0a6['model']=_[_0x8eb3('0x53')](db[_0x8eb3('0x38')][_0x8eb3('0x39')]);_0x34a0a6[_0x8eb3('0x3c')]=_[_0x8eb3('0x53')](_0x483a5d[_0x8eb3('0x3c')]);_0x34a0a6[_0x8eb3('0x3d')]=_[_0x8eb3('0x40')](_0x34a0a6[_0x8eb3('0x3e')],_0x34a0a6[_0x8eb3('0x3c')]);_0x11e0af[_0x8eb3('0x3f')]=_[_0x8eb3('0x40')](_0x34a0a6['model'],qs[_0x8eb3('0x41')](_0x483a5d[_0x8eb3('0x3c')]['fields']));_0x11e0af[_0x8eb3('0x3f')]=_0x11e0af[_0x8eb3('0x3f')]['length']?_0x11e0af[_0x8eb3('0x3f')]:_0x34a0a6['model'];if(_0x483a5d[_0x8eb3('0x3c')]['includeAll']){_0x11e0af[_0x8eb3('0x4d')]=[{'all':!![]}];}_0x11e0af=_[_0x8eb3('0x48')]({},_0x11e0af,_0x483a5d[_0x8eb3('0x4b')]);return db[_0x8eb3('0x38')][_0x8eb3('0x54')](_0x11e0af)[_0x8eb3('0x2e')](handleEntityNotFound(_0x4bade3,null))[_0x8eb3('0x2e')](respondWithResult(_0x4bade3,null))['catch'](handleError(_0x4bade3,null));};exports[_0x8eb3('0x55')]=function(_0x268a75,_0x523cb9){return db[_0x8eb3('0x38')][_0x8eb3('0x55')](_0x268a75['body'],{})[_0x8eb3('0x2e')](function(_0x3419f7){var _0x2a8594=_0x268a75[_0x8eb3('0x56')]['get']({'plain':!![]});if(!_0x2a8594)throw new Error(_0x8eb3('0x57'));if(_0x2a8594['role']===_0x8eb3('0x56')){var _0x5db7fe=_0x3419f7[_0x8eb3('0x30')]({'plain':!![]});var _0x401387='SmsQueues';return db[_0x8eb3('0x58')][_0x8eb3('0x54')]({'where':{'name':_0x401387,'userProfileId':_0x2a8594[_0x8eb3('0x59')]},'raw':!![]})['then'](function(_0x1d5a23){if(_0x1d5a23&&_0x1d5a23[_0x8eb3('0x5a')]===0x0){return db[_0x8eb3('0x32')][_0x8eb3('0x55')]({'name':_0x5db7fe['name'],'resourceId':_0x5db7fe['id'],'type':_0x1d5a23[_0x8eb3('0x35')],'sectionId':_0x1d5a23['id']},{})[_0x8eb3('0x2e')](function(){return _0x3419f7;});}else{return _0x3419f7;}})[_0x8eb3('0x50')](function(_0x21056f){logger[_0x8eb3('0x5b')](_0x8eb3('0x5c'),_0x21056f);throw _0x21056f;});}return _0x3419f7;})[_0x8eb3('0x2e')](respondWithResult(_0x523cb9,0xc9))[_0x8eb3('0x50')](handleError(_0x523cb9,null));};exports['update']=function(_0x2fb71f,_0x365caa){if(_0x2fb71f[_0x8eb3('0x5d')]['id']){delete _0x2fb71f[_0x8eb3('0x5d')]['id'];}return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x2fb71f[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x365caa,null))[_0x8eb3('0x2e')](saveUpdates(_0x2fb71f[_0x8eb3('0x5d')],null))[_0x8eb3('0x2e')](respondWithResult(_0x365caa,null))['catch'](handleError(_0x365caa,null));};exports['destroy']=function(_0x1faf59,_0x51d0aa){return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x1faf59[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x51d0aa,null))['then'](removeEntity(_0x51d0aa,null))[_0x8eb3('0x50')](handleError(_0x51d0aa,null));};exports['describe']=function(_0x14b82b,_0x4d7b26){return db[_0x8eb3('0x38')][_0x8eb3('0x5e')]()[_0x8eb3('0x2e')](respondWithResult(_0x4d7b26,null))[_0x8eb3('0x50')](handleError(_0x4d7b26,null));};exports[_0x8eb3('0x5f')]=function(_0x570144,_0x419e3f,_0x166280){var _0x2f7ff6={'raw':!![],'where':{}},_0x26f50f={},_0x197cf6;return db[_0x8eb3('0x38')][_0x8eb3('0x60')]({'where':{'id':_0x570144[_0x8eb3('0x52')]['id']}})['then'](handleEntityNotFound(_0x419e3f,null))[_0x8eb3('0x2e')](function(_0x5b1fd0){if(_0x5b1fd0){_0x197cf6=_0x5b1fd0[_0x8eb3('0x30')]({'plain':!![]});_0x26f50f[_0x8eb3('0x3e')]=_['keys'](db[_0x8eb3('0x61')][_0x8eb3('0x39')]);_0x26f50f[_0x8eb3('0x3c')]=_[_0x8eb3('0x53')](_0x570144[_0x8eb3('0x3c')]);_0x26f50f['filters']=_[_0x8eb3('0x40')](_0x26f50f[_0x8eb3('0x3e')],_0x26f50f[_0x8eb3('0x3c')]);_0x2f7ff6[_0x8eb3('0x3f')]=_[_0x8eb3('0x40')](_0x26f50f[_0x8eb3('0x3e')],qs[_0x8eb3('0x41')](_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x41')]));_0x2f7ff6['attributes']=_0x2f7ff6[_0x8eb3('0x3f')][_0x8eb3('0x42')]?_0x2f7ff6[_0x8eb3('0x3f')]:_0x26f50f[_0x8eb3('0x3e')];if(!_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x43')]('nolimit')){_0x2f7ff6['limit']=qs[_0x8eb3('0x26')](_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x26')]);_0x2f7ff6[_0x8eb3('0x25')]=qs['offset'](_0x570144['query']['offset']);}_0x2f7ff6[_0x8eb3('0x62')]=qs['sort'](_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x45')]);_0x2f7ff6[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_['pick'](_0x570144[_0x8eb3('0x3c')],_0x26f50f[_0x8eb3('0x3d')]));_0x2f7ff6[_0x8eb3('0x46')][_0x8eb3('0x63')]=_0x5b1fd0['id'];if(_0x570144['query'][_0x8eb3('0x4a')]){_0x2f7ff6[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x2f7ff6['where'],{'$or':_[_0x8eb3('0x37')](_0x2f7ff6[_0x8eb3('0x3f')],function(_0x3769f1){var _0x3d4f20={};_0x3d4f20[_0x3769f1]={'$like':'%'+_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0x3d4f20;})});}_0x2f7ff6=_['merge']({},_0x2f7ff6,_0x570144['options']);return db['UserSmsQueue'][_0x8eb3('0x4e')](_0x2f7ff6);}})[_0x8eb3('0x2e')](function(_0x5d5f9e){if(_0x5d5f9e){return db[_0x8eb3('0x64')][_0x8eb3('0x65')]({'where':{'id':_[_0x8eb3('0x37')](_0x5d5f9e,'UserId'),'role':_0x8eb3('0x66')},'attributes':['id',_0x8eb3('0x35'),_0x8eb3('0x67'),'updatedAt',_0x8eb3('0x68')]});}})[_0x8eb3('0x2e')](function(_0xd98432){if(_0xd98432){return{'count':_0xd98432[_0x8eb3('0x27')],'rows':_[_0x8eb3('0x37')](_0xd98432[_0x8eb3('0x4f')],function(_0x475df0){return{'membername':_0x475df0[_0x8eb3('0x35')],'UserId':_0x475df0['id'],'queue_name':_0x197cf6[_0x8eb3('0x35')],'SmsQueueId':_0x197cf6['id'],'interface':util['format'](_0x8eb3('0x69'),_0x8eb3('0x6a'),_0x475df0['name']),'penalty':0x0,'paused':_0x475df0[_0x8eb3('0x67')],'createdAt':_0x475df0[_0x8eb3('0x68')],'updatedAt':_0x475df0[_0x8eb3('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8eb3('0x2e')](respondWithFilteredResult(_0x419e3f,_0x2f7ff6))[_0x8eb3('0x50')](handleError(_0x419e3f,null));};exports['getTeams']=function(_0x1f1be1,_0x38fe9c,_0x12cfc0){var _0x2d19f9={};var _0x44f2bf={};var _0x42cdbb;var _0x1b02e2;return db[_0x8eb3('0x38')][_0x8eb3('0x60')]({'where':{'id':_0x1f1be1[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x38fe9c,null))['then'](function(_0x3071d6){if(_0x3071d6){_0x42cdbb=_0x3071d6;_0x44f2bf[_0x8eb3('0x3e')]=_[_0x8eb3('0x53')](db[_0x8eb3('0x6c')][_0x8eb3('0x39')]);_0x44f2bf[_0x8eb3('0x3c')]=_[_0x8eb3('0x53')](_0x1f1be1['query']);_0x44f2bf[_0x8eb3('0x3d')]=_[_0x8eb3('0x40')](_0x44f2bf[_0x8eb3('0x3e')],_0x44f2bf[_0x8eb3('0x3c')]);_0x2d19f9['attributes']=_['intersection'](_0x44f2bf[_0x8eb3('0x3e')],qs['fields'](_0x1f1be1[_0x8eb3('0x3c')]['fields']));_0x2d19f9['attributes']=_0x2d19f9[_0x8eb3('0x3f')]['length']?_0x2d19f9[_0x8eb3('0x3f')]:_0x44f2bf[_0x8eb3('0x3e')];_0x2d19f9[_0x8eb3('0x62')]=qs[_0x8eb3('0x45')](_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x45')]);_0x2d19f9[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_[_0x8eb3('0x47')](_0x1f1be1[_0x8eb3('0x3c')],_0x44f2bf[_0x8eb3('0x3d')]));if(_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x4a')]){_0x2d19f9[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x2d19f9[_0x8eb3('0x46')],{'$or':_[_0x8eb3('0x37')](_0x2d19f9[_0x8eb3('0x3f')],function(_0x3958af){var _0x480928={};_0x480928[_0x3958af]={'$like':'%'+_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0x480928;})});}_0x2d19f9=_[_0x8eb3('0x48')]({},_0x2d19f9,_0x1f1be1[_0x8eb3('0x4b')]);return _0x42cdbb[_0x8eb3('0x6d')](_0x2d19f9);}})['then'](function(_0x1c7870){if(_0x1c7870){_0x1b02e2=_0x1c7870[_0x8eb3('0x42')];if(!_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x43')](_0x8eb3('0x44'))){_0x2d19f9[_0x8eb3('0x26')]=qs['limit'](_0x1f1be1['query'][_0x8eb3('0x26')]);_0x2d19f9['offset']=qs['offset'](_0x1f1be1['query'][_0x8eb3('0x25')]);}return _0x42cdbb[_0x8eb3('0x6d')](_0x2d19f9);}})[_0x8eb3('0x2e')](function(_0x1205d0){if(_0x1205d0){return _0x1205d0?{'count':_0x1b02e2,'rows':_0x1205d0}:null;}})[_0x8eb3('0x2e')](respondWithResult(_0x38fe9c,null))[_0x8eb3('0x50')](handleError(_0x38fe9c,null));};exports[_0x8eb3('0x6e')]=function(_0x226366,_0x24bac1,_0x123167){var _0x427a2a=_0x226366[_0x8eb3('0x5d')]['ids'];return db[_0x8eb3('0x6c')][_0x8eb3('0x4e')]({'where':{'id':_0x427a2a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8eb3('0x6f'),'attributes':['id',_0x8eb3('0x35'),_0x8eb3('0x70'),_0x8eb3('0x71'),_0x8eb3('0x72')],'raw':!![]}]})[_0x8eb3('0x2e')](function(_0xf3fbc0){if(_0xf3fbc0){var _0x3958fa=_[_0x8eb3('0x73')](_0xf3fbc0,function(_0x41a424){var _0x3a4b84=_0x41a424[_0x8eb3('0x30')]({'plain':!![]});return _0x3a4b84[_0x8eb3('0x6f')];});return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x226366[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](function(_0x213700){return db[_0x8eb3('0x74')][_0x8eb3('0x75')](function(_0x1207b6){return _0x213700[_0x8eb3('0x6e')](_0x427a2a,{'transaction':_0x1207b6})[_0x8eb3('0x2e')](function(){return BPromise[_0x8eb3('0x76')](_0x3958fa,function(_0x452251){return db[_0x8eb3('0x61')][_0x8eb3('0x77')]({'where':{'UserId':_0x452251['id'],'SmsQueueId':_0x226366[_0x8eb3('0x52')]['id']},'transaction':_0x1207b6});});})['then'](function(){_0x3958fa[_0x8eb3('0x78')](function(_0x496ec0){socket['emit'](_0x8eb3('0x79'),{'UserId':_0x496ec0['id'],'SmsQueueId':_0x213700['id']});});});});});}})[_0x8eb3('0x2e')](respondWithStatusCode(_0x24bac1,null))[_0x8eb3('0x50')](handleError(_0x24bac1,null));};exports[_0x8eb3('0x7a')]=function(_0x4a0065,_0x4c3cfe,_0x1b12d6){return db[_0x8eb3('0x6c')][_0x8eb3('0x4e')]({'where':{'id':_0x4a0065['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x8eb3('0x64')],'as':_0x8eb3('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x8eb3('0x2e')](handleEntityNotFound(_0x4c3cfe,null))[_0x8eb3('0x2e')](function(_0x2ebf91){var _0x1a8d0a=_[_0x8eb3('0x37')](_0x2ebf91,'id');var _0xff7144=[];var _0x36f9e8=[];var _0x1e4425=squel['select']();_0x1e4425['field'](_0x8eb3('0x7b'))[_0x8eb3('0x7c')](_0x8eb3('0x7d'),'tq')[_0x8eb3('0x7e')](_0x8eb3('0x7f'),'ut',_0x8eb3('0x80'))[_0x8eb3('0x46')]('SmsQueueId\x20=\x20?',_0x4a0065[_0x8eb3('0x52')]['id']);for(var _0x2f970b=0x0;_0x2f970b<_0x2ebf91['length'];_0x2f970b+=0x1){let _0x5a43d7=_0x2ebf91[_0x2f970b];for(var _0x1bc952=0x0;_0x1bc952<_0x5a43d7['Agents'][_0x8eb3('0x42')];_0x1bc952+=0x1){let _0x36e520=_0x5a43d7[_0x8eb3('0x6f')][_0x1bc952];var _0x11acaa=_0x1e4425[_0x8eb3('0x81')]();_0x11acaa[_0x8eb3('0x46')]('ut.UserId\x20=\x20?',_0x36e520['id']);_0x36f9e8[_0x8eb3('0x82')](db['sequelize']['query'](_0x11acaa[_0x8eb3('0x83')](),{'type':db[_0x8eb3('0x74')][_0x8eb3('0x84')]['SELECT']})[_0x8eb3('0x2e')](function(_0xa90fdd){if(_0xa90fdd[_0x8eb3('0x42')]===0x1){return _0x36e520['id'];}else{var _0x1878ae=_[_0x8eb3('0x85')](_['map'](_0xa90fdd,'TeamId'),function(_0xe8a4ef){return _[_0x8eb3('0x86')](_0x1a8d0a,_0xe8a4ef);});if(_0x1878ae){return _0x36e520['id'];}}}));}}return BPromise[_0x8eb3('0x87')](_0x36f9e8)[_0x8eb3('0x2e')](function(_0x57b948){_0xff7144=_(_0xff7144)[_0x8eb3('0x88')](_0x57b948)[_0x8eb3('0x89')]()[_0x8eb3('0x8a')]();return db['SmsQueue'][_0x8eb3('0x54')]({'where':{'id':_0x4a0065['params']['id']}})[_0x8eb3('0x2e')](function(_0x4aafd7){return db['sequelize'][_0x8eb3('0x75')](function(_0x5d8627){return _0x4aafd7[_0x8eb3('0x7a')](_0x4a0065[_0x8eb3('0x3c')][_0x8eb3('0x8b')],{'transaction':_0x5d8627})[_0x8eb3('0x2e')](function(){if(!_[_0x8eb3('0x8c')](_0xff7144)){return _0x4aafd7[_0x8eb3('0x8d')](_0xff7144,{'transaction':_0x5d8627});}})[_0x8eb3('0x2e')](function(){_0xff7144[_0x8eb3('0x78')](function(_0x58736a){socket[_0x8eb3('0x8e')]('userSmsQueue:remove',{'UserId':_0x58736a,'SmsQueueId':_0x4aafd7['id']});});});});});});})[_0x8eb3('0x2e')](respondWithStatusCode(_0x4c3cfe,null))[_0x8eb3('0x50')](handleError(_0x4c3cfe,null));};exports['addAgents']=function(_0x37089a,_0x16cea9,_0x29d4aa){return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x37089a[_0x8eb3('0x52')]['id']}})['then'](handleEntityNotFound(_0x16cea9,null))[_0x8eb3('0x2e')](function(_0x519f93){if(_0x519f93){return _0x519f93['addAgents'](_0x37089a[_0x8eb3('0x5d')]['ids'],_['omit'](_0x37089a['body'],[_0x8eb3('0x8b'),'id'])||{})['spread'](function(_0x328a12){for(var _0x529797=0x0;_0x529797<_0x37089a[_0x8eb3('0x5d')]['ids']['length'];_0x529797+=0x1){socket[_0x8eb3('0x8e')](_0x8eb3('0x79'),{'UserId':Number(_0x37089a[_0x8eb3('0x5d')][_0x8eb3('0x8b')][_0x529797]),'SmsQueueId':Number(_0x37089a[_0x8eb3('0x52')]['id'])});}return _0x328a12;});}})['then'](respondWithResult(_0x16cea9,null))[_0x8eb3('0x50')](handleError(_0x16cea9,null));};exports[_0x8eb3('0x8d')]=function(_0x33db19,_0x460654,_0x28c1a4){return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x33db19['params']['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x460654,null))[_0x8eb3('0x2e')](function(_0x394e47){if(_0x394e47){return _0x394e47[_0x8eb3('0x8d')](_0x33db19[_0x8eb3('0x3c')][_0x8eb3('0x8b')])[_0x8eb3('0x2e')](function(){if(_[_0x8eb3('0x8f')](_0x33db19[_0x8eb3('0x3c')][_0x8eb3('0x8b')])){for(var _0x1365be=0x0;_0x1365be<_0x33db19[_0x8eb3('0x3c')][_0x8eb3('0x8b')][_0x8eb3('0x42')];_0x1365be+=0x1){socket[_0x8eb3('0x8e')]('userSmsQueue:remove',{'UserId':Number(_0x33db19[_0x8eb3('0x3c')]['ids'][_0x1365be]),'SmsQueueId':Number(_0x33db19['params']['id'])});}}else{socket['emit'](_0x8eb3('0x90'),{'UserId':Number(_0x33db19['query']['ids']),'SmsQueueId':Number(_0x33db19['params']['id'])});}});}})[_0x8eb3('0x2e')](respondWithStatusCode(_0x460654,null))[_0x8eb3('0x50')](handleError(_0x460654,null));};exports[_0x8eb3('0x91')]=function(_0x5e4e63,_0x5f242c,_0x168dba){var _0x232e76={};var _0x414e2f={};var _0x3c36e8;var _0x44a601;return db[_0x8eb3('0x38')][_0x8eb3('0x60')]({'where':{'id':_0x5e4e63[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x5f242c,null))[_0x8eb3('0x2e')](function(_0x5a403e){if(_0x5a403e){_0x3c36e8=_0x5a403e;_0x414e2f[_0x8eb3('0x3e')]=_['keys'](db[_0x8eb3('0x64')][_0x8eb3('0x39')]);_0x414e2f[_0x8eb3('0x3c')]=_['keys'](_0x5e4e63['query']);_0x414e2f[_0x8eb3('0x3d')]=_[_0x8eb3('0x40')](_0x414e2f[_0x8eb3('0x3e')],_0x414e2f[_0x8eb3('0x3c')]);_0x232e76[_0x8eb3('0x3f')]=_['intersection'](_0x414e2f['model'],qs[_0x8eb3('0x41')](_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x41')]));_0x232e76['attributes']=_0x232e76[_0x8eb3('0x3f')][_0x8eb3('0x42')]?_0x232e76[_0x8eb3('0x3f')]:_0x414e2f['model'];_0x232e76[_0x8eb3('0x62')]=qs[_0x8eb3('0x45')](_0x5e4e63[_0x8eb3('0x3c')]['sort']);_0x232e76[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_[_0x8eb3('0x47')](_0x5e4e63[_0x8eb3('0x3c')],_0x414e2f[_0x8eb3('0x3d')]));if(_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x4a')]){_0x232e76[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x232e76[_0x8eb3('0x46')],{'$or':_['map'](_0x232e76['attributes'],function(_0x5e1475){var _0xe65207={};_0xe65207[_0x5e1475]={'$like':'%'+_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0xe65207;})});}_0x232e76=_[_0x8eb3('0x48')]({},_0x232e76,_0x5e4e63[_0x8eb3('0x4b')]);return _0x3c36e8[_0x8eb3('0x91')](_0x232e76);}})[_0x8eb3('0x2e')](function(_0x50e724){if(_0x50e724){_0x44a601=_0x50e724[_0x8eb3('0x42')];if(!_0x5e4e63['query'][_0x8eb3('0x43')]('nolimit')){_0x232e76[_0x8eb3('0x26')]=qs[_0x8eb3('0x26')](_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x26')]);_0x232e76['offset']=qs['offset'](_0x5e4e63['query'][_0x8eb3('0x25')]);}return _0x3c36e8[_0x8eb3('0x91')](_0x232e76);}})[_0x8eb3('0x2e')](function(_0x2e7603){if(_0x2e7603){return _0x2e7603?{'count':_0x44a601,'rows':_0x2e7603}:null;}})[_0x8eb3('0x2e')](respondWithResult(_0x5f242c,null))[_0x8eb3('0x50')](handleError(_0x5f242c,null));}; \ No newline at end of file +var _0x31d8=['socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','get','SmsQueues','stack','name','send','map','SmsQueue','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','catch','show','rawAttributes','options','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','params','describe','UserSmsQueue','pick','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','interface','sequelize','transaction','each','findOrCreate','emit','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeTeams','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x591bce,_0x470405){var _0x471491=function(_0x4cce98){while(--_0x4cce98){_0x591bce['push'](_0x591bce['shift']());}};_0x471491(++_0x470405);}(_0x31d8,0xf7));var _0x831d=function(_0x154fab,_0x1d75ab){_0x154fab=_0x154fab-0x0;var _0x317c0e=_0x31d8[_0x154fab];return _0x317c0e;};'use strict';var emlformat=require(_0x831d('0x0'));var rimraf=require(_0x831d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x831d('0x2'));var rp=require(_0x831d('0x3'));var moment=require(_0x831d('0x4'));var BPromise=require(_0x831d('0x5'));var Mustache=require(_0x831d('0x6'));var util=require(_0x831d('0x7'));var path=require(_0x831d('0x8'));var sox=require(_0x831d('0x9'));var csv=require('to-csv');var ejs=require(_0x831d('0xa'));var fs=require('fs');var fs_extra=require(_0x831d('0xb'));var _=require('lodash');var squel=require(_0x831d('0xc'));var crypto=require(_0x831d('0xd'));var jsforce=require(_0x831d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x831d('0xf'));var querystring=require('querystring');var Papa=require(_0x831d('0x10'));var Redis=require(_0x831d('0x11'));var authService=require(_0x831d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x831d('0x13'));var hardwareService=require(_0x831d('0x14'));var logger=require('../../config/logger')(_0x831d('0x15'));var utils=require(_0x831d('0x16'));var config=require(_0x831d('0x17'));var licenseUtil=require(_0x831d('0x18'));var db=require(_0x831d('0x19'))['db'];config[_0x831d('0x1a')]=_[_0x831d('0x1b')](config[_0x831d('0x1a')],{'host':_0x831d('0x1c'),'port':0x18eb});var socket=require(_0x831d('0x1d'))(new Redis(config[_0x831d('0x1a')]));require(_0x831d('0x1e'))[_0x831d('0x1f')](socket);function respondWithStatusCode(_0x22ada9,_0x3cce02){_0x3cce02=_0x3cce02||0xcc;return function(_0x291f86){if(_0x291f86){return _0x22ada9[_0x831d('0x20')](_0x3cce02);}return _0x22ada9[_0x831d('0x21')](_0x3cce02)[_0x831d('0x22')]();};}function respondWithResult(_0xd756,_0x14b6f7){_0x14b6f7=_0x14b6f7||0xc8;return function(_0x3c5ef0){if(_0x3c5ef0){return _0xd756['status'](_0x14b6f7)[_0x831d('0x23')](_0x3c5ef0);}};}function respondWithFilteredResult(_0x4fd68c,_0x5bae6a){return function(_0x5d5db1){if(_0x5d5db1){var _0x5a824d=typeof _0x5bae6a[_0x831d('0x24')]==='undefined'&&typeof _0x5bae6a[_0x831d('0x25')]===_0x831d('0x26');var _0x42035a=_0x5d5db1[_0x831d('0x27')];var _0x298e7a=_0x5a824d?0x0:_0x5bae6a[_0x831d('0x24')];var _0x226007=_0x5a824d?_0x5d5db1['count']:_0x5bae6a[_0x831d('0x24')]+_0x5bae6a[_0x831d('0x25')];var _0x538bec;if(_0x226007>=_0x42035a){_0x226007=_0x42035a;_0x538bec=0xc8;}else{_0x538bec=0xce;}_0x4fd68c['status'](_0x538bec);return _0x4fd68c[_0x831d('0x28')](_0x831d('0x29'),_0x298e7a+'-'+_0x226007+'/'+_0x42035a)[_0x831d('0x23')](_0x5d5db1);}return null;};}function patchUpdates(_0x4a21d9){return function(_0x4bc6bb){try{jsonpatch[_0x831d('0x2a')](_0x4bc6bb,_0x4a21d9,!![]);}catch(_0x512581){return BPromise['reject'](_0x512581);}return _0x4bc6bb[_0x831d('0x2b')]();};}function saveUpdates(_0x4623cd,_0x469fc9){return function(_0x43cc00){if(_0x43cc00){return _0x43cc00['update'](_0x4623cd)[_0x831d('0x2c')](function(_0xd02192){return _0xd02192;});}return null;};}function removeEntity(_0xf10111,_0x364236){return function(_0x13e852){if(_0x13e852){return _0x13e852[_0x831d('0x2d')]()[_0x831d('0x2c')](function(){var _0x30ea09=_0x13e852[_0x831d('0x2e')]({'plain':!![]});var _0x3fed7d=_0x831d('0x2f');return db['UserProfileResource'][_0x831d('0x2d')]({'where':{'type':_0x3fed7d,'resourceId':_0x30ea09['id']}})[_0x831d('0x2c')](function(){return _0x13e852;});})[_0x831d('0x2c')](function(){_0xf10111[_0x831d('0x21')](0xcc)[_0x831d('0x22')]();});}};}function handleEntityNotFound(_0x517bab,_0x5de8fb){return function(_0x43e72b){if(!_0x43e72b){_0x517bab['sendStatus'](0x194);}return _0x43e72b;};}function handleError(_0x1dc829,_0x52da88){_0x52da88=_0x52da88||0x1f4;return function(_0x26b3f4){logger['error'](_0x26b3f4[_0x831d('0x30')]);if(_0x26b3f4[_0x831d('0x31')]){delete _0x26b3f4[_0x831d('0x31')];}_0x1dc829[_0x831d('0x21')](_0x52da88)[_0x831d('0x32')](_0x26b3f4);};}exports['index']=function(_0x343616,_0x148385){var _0x4b6ba9={},_0x4e6a0a={},_0x254f1f={'count':0x0,'rows':[]};var _0x4a0d66=_[_0x831d('0x33')](db[_0x831d('0x34')]['rawAttributes'],function(_0x2af68d){return{'name':_0x2af68d['fieldName'],'type':_0x2af68d[_0x831d('0x35')]['key']};});_0x4e6a0a[_0x831d('0x36')]=_[_0x831d('0x33')](_0x4a0d66,'name');_0x4e6a0a[_0x831d('0x37')]=_[_0x831d('0x38')](_0x343616['query']);_0x4e6a0a[_0x831d('0x39')]=_[_0x831d('0x3a')](_0x4e6a0a[_0x831d('0x36')],_0x4e6a0a['query']);_0x4b6ba9['attributes']=_[_0x831d('0x3a')](_0x4e6a0a['model'],qs[_0x831d('0x3b')](_0x343616[_0x831d('0x37')][_0x831d('0x3b')]));_0x4b6ba9[_0x831d('0x3c')]=_0x4b6ba9['attributes'][_0x831d('0x3d')]?_0x4b6ba9['attributes']:_0x4e6a0a['model'];if(!_0x343616[_0x831d('0x37')][_0x831d('0x3e')](_0x831d('0x3f'))){_0x4b6ba9[_0x831d('0x25')]=qs[_0x831d('0x25')](_0x343616['query'][_0x831d('0x25')]);_0x4b6ba9[_0x831d('0x24')]=qs['offset'](_0x343616['query']['offset']);}_0x4b6ba9[_0x831d('0x40')]=qs[_0x831d('0x41')](_0x343616[_0x831d('0x37')][_0x831d('0x41')]);_0x4b6ba9[_0x831d('0x42')]=qs[_0x831d('0x39')](_['pick'](_0x343616[_0x831d('0x37')],_0x4e6a0a[_0x831d('0x39')]),_0x4a0d66);if(_0x343616[_0x831d('0x37')]['filter']){_0x4b6ba9[_0x831d('0x42')]=_[_0x831d('0x43')](_0x4b6ba9[_0x831d('0x42')],{'$or':_['map'](_0x4a0d66,function(_0x18d47e){if(_0x18d47e[_0x831d('0x35')]!==_0x831d('0x44')){var _0x377003={};_0x377003[_0x18d47e[_0x831d('0x31')]]={'$like':'%'+_0x343616[_0x831d('0x37')][_0x831d('0x45')]+'%'};return _0x377003;}})});}_0x4b6ba9=_[_0x831d('0x43')]({},_0x4b6ba9,_0x343616['options']);var _0x564f07={'where':_0x4b6ba9[_0x831d('0x42')]};return db[_0x831d('0x34')]['count'](_0x564f07)['then'](function(_0x200726){_0x254f1f['count']=_0x200726;if(_0x343616[_0x831d('0x37')][_0x831d('0x46')]){_0x4b6ba9[_0x831d('0x47')]=[{'all':!![]}];}return db[_0x831d('0x34')]['findAll'](_0x4b6ba9);})[_0x831d('0x2c')](function(_0x279f50){_0x254f1f['rows']=_0x279f50;return _0x254f1f;})[_0x831d('0x2c')](respondWithFilteredResult(_0x148385,_0x4b6ba9))[_0x831d('0x48')](handleError(_0x148385,null));};exports[_0x831d('0x49')]=function(_0x1f9d3f,_0x13a7a4){var _0x566dc6={'raw':!![],'where':{'id':_0x1f9d3f['params']['id']}},_0x281c59={};_0x281c59[_0x831d('0x36')]=_[_0x831d('0x38')](db[_0x831d('0x34')][_0x831d('0x4a')]);_0x281c59[_0x831d('0x37')]=_[_0x831d('0x38')](_0x1f9d3f[_0x831d('0x37')]);_0x281c59[_0x831d('0x39')]=_[_0x831d('0x3a')](_0x281c59[_0x831d('0x36')],_0x281c59[_0x831d('0x37')]);_0x566dc6[_0x831d('0x3c')]=_['intersection'](_0x281c59[_0x831d('0x36')],qs[_0x831d('0x3b')](_0x1f9d3f[_0x831d('0x37')]['fields']));_0x566dc6[_0x831d('0x3c')]=_0x566dc6[_0x831d('0x3c')][_0x831d('0x3d')]?_0x566dc6['attributes']:_0x281c59['model'];if(_0x1f9d3f[_0x831d('0x37')][_0x831d('0x46')]){_0x566dc6[_0x831d('0x47')]=[{'all':!![]}];}_0x566dc6=_['merge']({},_0x566dc6,_0x1f9d3f[_0x831d('0x4b')]);return db[_0x831d('0x34')][_0x831d('0x4c')](_0x566dc6)[_0x831d('0x2c')](handleEntityNotFound(_0x13a7a4,null))['then'](respondWithResult(_0x13a7a4,null))[_0x831d('0x48')](handleError(_0x13a7a4,null));};exports[_0x831d('0x4d')]=function(_0x13c53a,_0x5d8562){return db[_0x831d('0x34')][_0x831d('0x4d')](_0x13c53a[_0x831d('0x4e')],{})[_0x831d('0x2c')](function(_0x45bbf1){var _0x26d960=_0x13c53a[_0x831d('0x4f')][_0x831d('0x2e')]({'plain':!![]});if(!_0x26d960)throw new Error(_0x831d('0x50'));if(_0x26d960[_0x831d('0x51')]==='user'){var _0x57d06b=_0x45bbf1[_0x831d('0x2e')]({'plain':!![]});var _0xf78bdd=_0x831d('0x2f');return db[_0x831d('0x52')][_0x831d('0x4c')]({'where':{'name':_0xf78bdd,'userProfileId':_0x26d960['userProfileId']},'raw':!![]})[_0x831d('0x2c')](function(_0x5e3e9e){if(_0x5e3e9e&&_0x5e3e9e[_0x831d('0x53')]===0x0){return db[_0x831d('0x54')]['create']({'name':_0x57d06b['name'],'resourceId':_0x57d06b['id'],'type':_0x5e3e9e[_0x831d('0x31')],'sectionId':_0x5e3e9e['id']},{})[_0x831d('0x2c')](function(){return _0x45bbf1;});}else{return _0x45bbf1;}})[_0x831d('0x48')](function(_0x54d59f){logger['error'](_0x831d('0x55'),_0x54d59f);throw _0x54d59f;});}return _0x45bbf1;})[_0x831d('0x2c')](respondWithResult(_0x5d8562,0xc9))['catch'](handleError(_0x5d8562,null));};exports['update']=function(_0x428980,_0x4e74c0){if(_0x428980[_0x831d('0x4e')]['id']){delete _0x428980[_0x831d('0x4e')]['id'];}return db[_0x831d('0x34')][_0x831d('0x4c')]({'where':{'id':_0x428980[_0x831d('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e74c0,null))[_0x831d('0x2c')](saveUpdates(_0x428980['body'],null))[_0x831d('0x2c')](respondWithResult(_0x4e74c0,null))[_0x831d('0x48')](handleError(_0x4e74c0,null));};exports['destroy']=function(_0x3fa1e1,_0x17c7db){return db[_0x831d('0x34')][_0x831d('0x4c')]({'where':{'id':_0x3fa1e1['params']['id']}})[_0x831d('0x2c')](handleEntityNotFound(_0x17c7db,null))[_0x831d('0x2c')](removeEntity(_0x17c7db,null))[_0x831d('0x48')](handleError(_0x17c7db,null));};exports[_0x831d('0x57')]=function(_0x210a5f,_0x413dce){return db[_0x831d('0x34')][_0x831d('0x57')]()[_0x831d('0x2c')](respondWithResult(_0x413dce,null))[_0x831d('0x48')](handleError(_0x413dce,null));};exports['getMembers']=function(_0x525359,_0x2f9769,_0x1880ae){var _0x5abd31={'raw':!![],'where':{}},_0x3b8acf={},_0xcb1bbd;return db[_0x831d('0x34')]['findOne']({'where':{'id':_0x525359['params']['id']}})[_0x831d('0x2c')](handleEntityNotFound(_0x2f9769,null))[_0x831d('0x2c')](function(_0xbe9047){if(_0xbe9047){_0xcb1bbd=_0xbe9047[_0x831d('0x2e')]({'plain':!![]});_0x3b8acf[_0x831d('0x36')]=_['keys'](db[_0x831d('0x58')][_0x831d('0x4a')]);_0x3b8acf[_0x831d('0x37')]=_['keys'](_0x525359[_0x831d('0x37')]);_0x3b8acf[_0x831d('0x39')]=_[_0x831d('0x3a')](_0x3b8acf['model'],_0x3b8acf[_0x831d('0x37')]);_0x5abd31[_0x831d('0x3c')]=_[_0x831d('0x3a')](_0x3b8acf[_0x831d('0x36')],qs[_0x831d('0x3b')](_0x525359[_0x831d('0x37')][_0x831d('0x3b')]));_0x5abd31['attributes']=_0x5abd31['attributes'][_0x831d('0x3d')]?_0x5abd31[_0x831d('0x3c')]:_0x3b8acf['model'];if(!_0x525359[_0x831d('0x37')]['hasOwnProperty'](_0x831d('0x3f'))){_0x5abd31[_0x831d('0x25')]=qs[_0x831d('0x25')](_0x525359[_0x831d('0x37')]['limit']);_0x5abd31[_0x831d('0x24')]=qs['offset'](_0x525359[_0x831d('0x37')][_0x831d('0x24')]);}_0x5abd31[_0x831d('0x40')]=qs[_0x831d('0x41')](_0x525359['query'][_0x831d('0x41')]);_0x5abd31['where']=qs[_0x831d('0x39')](_[_0x831d('0x59')](_0x525359[_0x831d('0x37')],_0x3b8acf[_0x831d('0x39')]));_0x5abd31['where']['SmsQueueId']=_0xbe9047['id'];if(_0x525359['query'][_0x831d('0x45')]){_0x5abd31[_0x831d('0x42')]=_[_0x831d('0x43')](_0x5abd31[_0x831d('0x42')],{'$or':_['map'](_0x5abd31[_0x831d('0x3c')],function(_0x4977d1){var _0x5cb1bd={};_0x5cb1bd[_0x4977d1]={'$like':'%'+_0x525359[_0x831d('0x37')][_0x831d('0x45')]+'%'};return _0x5cb1bd;})});}_0x5abd31=_[_0x831d('0x43')]({},_0x5abd31,_0x525359['options']);return db[_0x831d('0x58')][_0x831d('0x5a')](_0x5abd31);}})['then'](function(_0x347da0){if(_0x347da0){return db[_0x831d('0x5b')]['findAndCountAll']({'where':{'id':_[_0x831d('0x33')](_0x347da0,_0x831d('0x5c')),'role':_0x831d('0x5d')},'attributes':['id',_0x831d('0x31'),_0x831d('0x5e'),_0x831d('0x5f'),_0x831d('0x60')]});}})[_0x831d('0x2c')](function(_0x518084){if(_0x518084){return{'count':_0x518084[_0x831d('0x27')],'rows':_[_0x831d('0x33')](_0x518084[_0x831d('0x61')],function(_0xa1bab4){return{'membername':_0xa1bab4[_0x831d('0x31')],'UserId':_0xa1bab4['id'],'queue_name':_0xcb1bbd[_0x831d('0x31')],'SmsQueueId':_0xcb1bbd['id'],'interface':util[_0x831d('0x62')](_0x831d('0x63'),_0x831d('0x64'),_0xa1bab4[_0x831d('0x31')]),'penalty':0x0,'paused':_0xa1bab4[_0x831d('0x5e')],'createdAt':_0xa1bab4['createdAt'],'updatedAt':_0xa1bab4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x831d('0x2c')](respondWithFilteredResult(_0x2f9769,_0x5abd31))[_0x831d('0x48')](handleError(_0x2f9769,null));};exports[_0x831d('0x65')]=function(_0xa21f0e,_0x272f8a,_0xe5d6d9){var _0x10c712={};var _0x57661a={};var _0x38c6e8;var _0x3af153;return db[_0x831d('0x34')]['findOne']({'where':{'id':_0xa21f0e[_0x831d('0x56')]['id']}})[_0x831d('0x2c')](handleEntityNotFound(_0x272f8a,null))[_0x831d('0x2c')](function(_0x240087){if(_0x240087){_0x38c6e8=_0x240087;_0x57661a['model']=_[_0x831d('0x38')](db[_0x831d('0x66')]['rawAttributes']);_0x57661a[_0x831d('0x37')]=_['keys'](_0xa21f0e[_0x831d('0x37')]);_0x57661a[_0x831d('0x39')]=_[_0x831d('0x3a')](_0x57661a[_0x831d('0x36')],_0x57661a[_0x831d('0x37')]);_0x10c712[_0x831d('0x3c')]=_[_0x831d('0x3a')](_0x57661a[_0x831d('0x36')],qs[_0x831d('0x3b')](_0xa21f0e[_0x831d('0x37')]['fields']));_0x10c712['attributes']=_0x10c712[_0x831d('0x3c')][_0x831d('0x3d')]?_0x10c712[_0x831d('0x3c')]:_0x57661a[_0x831d('0x36')];_0x10c712[_0x831d('0x40')]=qs[_0x831d('0x41')](_0xa21f0e['query']['sort']);_0x10c712[_0x831d('0x42')]=qs[_0x831d('0x39')](_['pick'](_0xa21f0e['query'],_0x57661a[_0x831d('0x39')]));if(_0xa21f0e[_0x831d('0x37')][_0x831d('0x45')]){_0x10c712[_0x831d('0x42')]=_[_0x831d('0x43')](_0x10c712[_0x831d('0x42')],{'$or':_[_0x831d('0x33')](_0x10c712[_0x831d('0x3c')],function(_0x32ba72){var _0x39cfc4={};_0x39cfc4[_0x32ba72]={'$like':'%'+_0xa21f0e[_0x831d('0x37')]['filter']+'%'};return _0x39cfc4;})});}_0x10c712=_[_0x831d('0x43')]({},_0x10c712,_0xa21f0e[_0x831d('0x4b')]);return _0x38c6e8[_0x831d('0x65')](_0x10c712);}})['then'](function(_0x368345){if(_0x368345){_0x3af153=_0x368345[_0x831d('0x3d')];if(!_0xa21f0e[_0x831d('0x37')][_0x831d('0x3e')](_0x831d('0x3f'))){_0x10c712['limit']=qs[_0x831d('0x25')](_0xa21f0e[_0x831d('0x37')][_0x831d('0x25')]);_0x10c712[_0x831d('0x24')]=qs['offset'](_0xa21f0e[_0x831d('0x37')]['offset']);}return _0x38c6e8[_0x831d('0x65')](_0x10c712);}})[_0x831d('0x2c')](function(_0x353425){if(_0x353425){return _0x353425?{'count':_0x3af153,'rows':_0x353425}:null;}})[_0x831d('0x2c')](respondWithResult(_0x272f8a,null))[_0x831d('0x48')](handleError(_0x272f8a,null));};exports['addTeams']=function(_0x432a85,_0x294411,_0x5f30ec){var _0x53ac9a=_0x432a85['body'][_0x831d('0x67')];return db[_0x831d('0x66')]['findAll']({'where':{'id':_0x53ac9a},'attributes':['id'],'include':[{'model':db[_0x831d('0x5b')],'as':_0x831d('0x68'),'attributes':['id',_0x831d('0x31'),'online','voicePause',_0x831d('0x69')],'raw':!![]}]})[_0x831d('0x2c')](function(_0x585437){if(_0x585437){var _0x469413=_['flatMap'](_0x585437,function(_0x245e01){var _0x3871e3=_0x245e01[_0x831d('0x2e')]({'plain':!![]});return _0x3871e3[_0x831d('0x68')];});return db[_0x831d('0x34')][_0x831d('0x4c')]({'where':{'id':_0x432a85[_0x831d('0x56')]['id']}})[_0x831d('0x2c')](function(_0x2d0599){return db[_0x831d('0x6a')][_0x831d('0x6b')](function(_0x388d2c){return _0x2d0599['addTeams'](_0x53ac9a,{'transaction':_0x388d2c})['then'](function(){return BPromise[_0x831d('0x6c')](_0x469413,function(_0x406242){return db['UserSmsQueue'][_0x831d('0x6d')]({'where':{'UserId':_0x406242['id'],'SmsQueueId':_0x432a85[_0x831d('0x56')]['id']},'transaction':_0x388d2c});});})[_0x831d('0x2c')](function(){_0x469413['forEach'](function(_0x4b7805){socket[_0x831d('0x6e')]('userSmsQueue:save',{'UserId':_0x4b7805['id'],'SmsQueueId':_0x2d0599['id']});});});});});}})[_0x831d('0x2c')](respondWithStatusCode(_0x294411,null))['catch'](handleError(_0x294411,null));};exports['removeTeams']=function(_0x171887,_0x50f717,_0x2e93c3){return db[_0x831d('0x66')][_0x831d('0x5a')]({'where':{'id':_0x171887[_0x831d('0x37')][_0x831d('0x67')]},'attributes':['id'],'include':[{'model':db[_0x831d('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x831d('0x2c')](handleEntityNotFound(_0x50f717,null))[_0x831d('0x2c')](function(_0x4c2ddd){var _0x362d12=_[_0x831d('0x33')](_0x4c2ddd,'id');var _0x42740b=[];var _0x2ce5bd=[];var _0x195e8a=squel['select']();_0x195e8a['field']('tq.TeamId')[_0x831d('0x6f')](_0x831d('0x70'),'tq')[_0x831d('0x71')](_0x831d('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x831d('0x73'),_0x171887[_0x831d('0x56')]['id']);for(var _0x5cb1fc=0x0;_0x5cb1fc<_0x4c2ddd[_0x831d('0x3d')];_0x5cb1fc+=0x1){let _0x86d60a=_0x4c2ddd[_0x5cb1fc];for(var _0x565a22=0x0;_0x565a22<_0x86d60a[_0x831d('0x68')][_0x831d('0x3d')];_0x565a22+=0x1){let _0x111f1b=_0x86d60a[_0x831d('0x68')][_0x565a22];var _0x3f2769=_0x195e8a['clone']();_0x3f2769['where'](_0x831d('0x74'),_0x111f1b['id']);_0x2ce5bd['push'](db[_0x831d('0x6a')][_0x831d('0x37')](_0x3f2769[_0x831d('0x75')](),{'type':db[_0x831d('0x6a')][_0x831d('0x76')][_0x831d('0x77')]})['then'](function(_0x4e9b94){if(_0x4e9b94[_0x831d('0x3d')]===0x1){return _0x111f1b['id'];}else{var _0x239790=_[_0x831d('0x78')](_[_0x831d('0x33')](_0x4e9b94,'TeamId'),function(_0x208c18){return _[_0x831d('0x79')](_0x362d12,_0x208c18);});if(_0x239790){return _0x111f1b['id'];}}}));}}return BPromise[_0x831d('0x7a')](_0x2ce5bd)[_0x831d('0x2c')](function(_0x20a68b){_0x42740b=_(_0x42740b)[_0x831d('0x7b')](_0x20a68b)[_0x831d('0x7c')]()[_0x831d('0x7d')]();return db[_0x831d('0x34')][_0x831d('0x4c')]({'where':{'id':_0x171887[_0x831d('0x56')]['id']}})[_0x831d('0x2c')](function(_0x5df3ae){return db[_0x831d('0x6a')]['transaction'](function(_0x52a10e){return _0x5df3ae[_0x831d('0x7e')](_0x171887[_0x831d('0x37')][_0x831d('0x67')],{'transaction':_0x52a10e})[_0x831d('0x2c')](function(){if(!_[_0x831d('0x7f')](_0x42740b)){return _0x5df3ae['removeAgents'](_0x42740b,{'transaction':_0x52a10e});}})['then'](function(){_0x42740b[_0x831d('0x80')](function(_0x1198b6){socket[_0x831d('0x6e')](_0x831d('0x81'),{'UserId':_0x1198b6,'SmsQueueId':_0x5df3ae['id']});});});});});});})[_0x831d('0x2c')](respondWithStatusCode(_0x50f717,null))[_0x831d('0x48')](handleError(_0x50f717,null));};exports[_0x831d('0x82')]=function(_0x1b30d5,_0x551efd,_0x489853){return db[_0x831d('0x34')][_0x831d('0x4c')]({'where':{'id':_0x1b30d5[_0x831d('0x56')]['id']}})[_0x831d('0x2c')](handleEntityNotFound(_0x551efd,null))['then'](function(_0x58426e){if(_0x58426e){return _0x58426e['addAgents'](_0x1b30d5['body'][_0x831d('0x67')],_[_0x831d('0x83')](_0x1b30d5[_0x831d('0x4e')],[_0x831d('0x67'),'id'])||{})[_0x831d('0x84')](function(_0x16ede8){for(var _0x1583f9=0x0;_0x1583f9<_0x1b30d5[_0x831d('0x4e')][_0x831d('0x67')]['length'];_0x1583f9+=0x1){socket[_0x831d('0x6e')](_0x831d('0x85'),{'UserId':Number(_0x1b30d5[_0x831d('0x4e')][_0x831d('0x67')][_0x1583f9]),'SmsQueueId':Number(_0x1b30d5['params']['id'])});}return _0x16ede8;});}})[_0x831d('0x2c')](respondWithResult(_0x551efd,null))['catch'](handleError(_0x551efd,null));};exports[_0x831d('0x86')]=function(_0x3f1cb9,_0x5f5cf5,_0x4bd722){return db[_0x831d('0x34')][_0x831d('0x4c')]({'where':{'id':_0x3f1cb9[_0x831d('0x56')]['id']}})[_0x831d('0x2c')](handleEntityNotFound(_0x5f5cf5,null))[_0x831d('0x2c')](function(_0x517b33){if(_0x517b33){return _0x517b33[_0x831d('0x86')](_0x3f1cb9['query'][_0x831d('0x67')])['then'](function(){if(_[_0x831d('0x87')](_0x3f1cb9[_0x831d('0x37')]['ids'])){for(var _0xdbb191=0x0;_0xdbb191<_0x3f1cb9['query']['ids'][_0x831d('0x3d')];_0xdbb191+=0x1){socket[_0x831d('0x6e')](_0x831d('0x81'),{'UserId':Number(_0x3f1cb9[_0x831d('0x37')]['ids'][_0xdbb191]),'SmsQueueId':Number(_0x3f1cb9['params']['id'])});}}else{socket[_0x831d('0x6e')]('userSmsQueue:remove',{'UserId':Number(_0x3f1cb9[_0x831d('0x37')][_0x831d('0x67')]),'SmsQueueId':Number(_0x3f1cb9[_0x831d('0x56')]['id'])});}});}})[_0x831d('0x2c')](respondWithStatusCode(_0x5f5cf5,null))[_0x831d('0x48')](handleError(_0x5f5cf5,null));};exports[_0x831d('0x88')]=function(_0x4158ac,_0x1f8dc4,_0x26d7f5){var _0x1b83b8={};var _0x53c9d9={};var _0x3b9e3c;var _0x3c768a;return db[_0x831d('0x34')][_0x831d('0x89')]({'where':{'id':_0x4158ac['params']['id']}})[_0x831d('0x2c')](handleEntityNotFound(_0x1f8dc4,null))['then'](function(_0x16dd6b){if(_0x16dd6b){_0x3b9e3c=_0x16dd6b;_0x53c9d9['model']=_[_0x831d('0x38')](db[_0x831d('0x5b')][_0x831d('0x4a')]);_0x53c9d9[_0x831d('0x37')]=_[_0x831d('0x38')](_0x4158ac[_0x831d('0x37')]);_0x53c9d9[_0x831d('0x39')]=_[_0x831d('0x3a')](_0x53c9d9['model'],_0x53c9d9['query']);_0x1b83b8[_0x831d('0x3c')]=_[_0x831d('0x3a')](_0x53c9d9['model'],qs[_0x831d('0x3b')](_0x4158ac[_0x831d('0x37')][_0x831d('0x3b')]));_0x1b83b8[_0x831d('0x3c')]=_0x1b83b8[_0x831d('0x3c')][_0x831d('0x3d')]?_0x1b83b8[_0x831d('0x3c')]:_0x53c9d9['model'];_0x1b83b8['order']=qs[_0x831d('0x41')](_0x4158ac['query'][_0x831d('0x41')]);_0x1b83b8[_0x831d('0x42')]=qs[_0x831d('0x39')](_[_0x831d('0x59')](_0x4158ac[_0x831d('0x37')],_0x53c9d9['filters']));if(_0x4158ac[_0x831d('0x37')][_0x831d('0x45')]){_0x1b83b8['where']=_[_0x831d('0x43')](_0x1b83b8['where'],{'$or':_[_0x831d('0x33')](_0x1b83b8[_0x831d('0x3c')],function(_0x6f4379){var _0xf47465={};_0xf47465[_0x6f4379]={'$like':'%'+_0x4158ac[_0x831d('0x37')][_0x831d('0x45')]+'%'};return _0xf47465;})});}_0x1b83b8=_['merge']({},_0x1b83b8,_0x4158ac[_0x831d('0x4b')]);return _0x3b9e3c[_0x831d('0x88')](_0x1b83b8);}})[_0x831d('0x2c')](function(_0x206257){if(_0x206257){_0x3c768a=_0x206257[_0x831d('0x3d')];if(!_0x4158ac[_0x831d('0x37')][_0x831d('0x3e')]('nolimit')){_0x1b83b8[_0x831d('0x25')]=qs[_0x831d('0x25')](_0x4158ac[_0x831d('0x37')][_0x831d('0x25')]);_0x1b83b8[_0x831d('0x24')]=qs[_0x831d('0x24')](_0x4158ac[_0x831d('0x37')][_0x831d('0x24')]);}return _0x3b9e3c['getAgents'](_0x1b83b8);}})[_0x831d('0x2c')](function(_0x14950f){if(_0x14950f){return _0x14950f?{'count':_0x3c768a,'rows':_0x14950f}:null;}})[_0x831d('0x2c')](respondWithResult(_0x1f8dc4,null))[_0x831d('0x48')](handleError(_0x1f8dc4,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index a6272ee..3a6843f 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 _0xd16b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3b109b,_0x803f48){var _0x3744dd=function(_0x585fac){while(--_0x585fac){_0x3b109b['push'](_0x3b109b['shift']());}};_0x3744dd(++_0x803f48);}(_0xd16b,0xf2));var _0xbd16=function(_0x1be055,_0x975a94){_0x1be055=_0x1be055-0x0;var _0x45bde4=_0xd16b[_0x1be055];return _0x45bde4;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xbd16('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbd16('0x1')](0x0);var events={'afterCreate':_0xbd16('0x2'),'afterUpdate':_0xbd16('0x3'),'afterDestroy':_0xbd16('0x4')};function emitEvent(_0x2d5840){return function(_0x15c3ef,_0xbfe20b,_0x45e984){SmsQueueEvents['emit'](_0x2d5840+':'+_0x15c3ef['id'],_0x15c3ef);SmsQueueEvents[_0xbd16('0x5')](_0x2d5840,_0x15c3ef);_0x45e984(null);};}for(var e in events){if(events[_0xbd16('0x6')](e)){var event=events[e];SmsQueue[_0xbd16('0x7')](e,emitEvent(event));}}module[_0xbd16('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xbd61=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','hook'];(function(_0x33edf2,_0x331f98){var _0x3309ec=function(_0x4c318f){while(--_0x4c318f){_0x33edf2['push'](_0x33edf2['shift']());}};_0x3309ec(++_0x331f98);}(_0xbd61,0xf1));var _0x1bd6=function(_0x3f5b85,_0x407230){_0x3f5b85=_0x3f5b85-0x0;var _0x32c806=_0xbd61[_0x3f5b85];return _0x32c806;};'use strict';var EventEmitter=require(_0x1bd6('0x0'));var SmsQueue=require(_0x1bd6('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1bd6('0x2')](0x0);var events={'afterCreate':_0x1bd6('0x3'),'afterUpdate':_0x1bd6('0x4'),'afterDestroy':_0x1bd6('0x5')};function emitEvent(_0x133cca){return function(_0x13412a,_0x4d3568,_0x1b4d32){SmsQueueEvents['emit'](_0x133cca+':'+_0x13412a['id'],_0x13412a);SmsQueueEvents['emit'](_0x133cca,_0x13412a);_0x1b4d32(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x1bd6('0x6')](e,emitEvent(event));}}module[_0x1bd6('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 6a94a92..068c5a8 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 _0x0cc6=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define'];(function(_0x5689c4,_0xb30097){var _0x5c0a94=function(_0x1b3b1f){while(--_0x1b3b1f){_0x5689c4['push'](_0x5689c4['shift']());}};_0x5c0a94(++_0xb30097);}(_0x0cc6,0x13a));var _0x60cc=function(_0x19aaa9,_0x9d0bb6){_0x19aaa9=_0x19aaa9-0x0;var _0x465463=_0x0cc6[_0x19aaa9];return _0x465463;};'use strict';var _=require(_0x60cc('0x0'));var util=require(_0x60cc('0x1'));var logger=require(_0x60cc('0x2'))(_0x60cc('0x3'));var moment=require('moment');var BPromise=require(_0x60cc('0x4'));var rp=require(_0x60cc('0x5'));var fs=require('fs');var path=require(_0x60cc('0x6'));var rimraf=require(_0x60cc('0x7'));var config=require(_0x60cc('0x8'));var attributes=require(_0x60cc('0x9'));module['exports']=function(_0x5c27d9,_0x562efe){return _0x5c27d9[_0x60cc('0xa')](_0x60cc('0xb'),attributes,{'tableName':_0x60cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9012=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api'];(function(_0x22631d,_0x57cf11){var _0xafc6a=function(_0x52e60f){while(--_0x52e60f){_0x22631d['push'](_0x22631d['shift']());}};_0xafc6a(++_0x57cf11);}(_0x9012,0xb3));var _0x2901=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0x9012[_0x589aee];return _0x2f5ed4;};'use strict';var _=require(_0x2901('0x0'));var util=require(_0x2901('0x1'));var logger=require('../../config/logger')(_0x2901('0x2'));var moment=require(_0x2901('0x3'));var BPromise=require(_0x2901('0x4'));var rp=require(_0x2901('0x5'));var fs=require('fs');var path=require(_0x2901('0x6'));var rimraf=require(_0x2901('0x7'));var config=require(_0x2901('0x8'));var attributes=require(_0x2901('0x9'));module[_0x2901('0xa')]=function(_0x1b2e3c,_0x30ac55){return _0x1b2e3c[_0x2901('0xb')](_0x2901('0xc'),attributes,{'tableName':_0x2901('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 2a4d35c..916c4a8 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 _0x0c9f=['request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','map','model','attributes','include','debug','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s'];(function(_0x50edf1,_0x17542b){var _0x3dd5df=function(_0x405287){while(--_0x405287){_0x50edf1['push'](_0x50edf1['shift']());}};_0x3dd5df(++_0x17542b);}(_0x0c9f,0x199));var _0xf0c9=function(_0x12e82a,_0x1c0627){_0x12e82a=_0x12e82a-0x0;var _0x71b393=_0x0c9f[_0x12e82a];return _0x71b393;};'use strict';var _=require(_0xf0c9('0x0'));var util=require(_0xf0c9('0x1'));var moment=require(_0xf0c9('0x2'));var BPromise=require(_0xf0c9('0x3'));var rs=require(_0xf0c9('0x4'));var fs=require('fs');var Redis=require(_0xf0c9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0c9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0c9('0x7'));var jayson=require(_0xf0c9('0x8'));var client=jayson[_0xf0c9('0x9')][_0xf0c9('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf0c9('0xb')],{'host':_0xf0c9('0xc'),'port':0x18eb});var socket=require(_0xf0c9('0xd'))(new Redis(config['redis']));require(_0xf0c9('0xe'))[_0xf0c9('0xf')](socket);function respondWithRpcPromise(_0x477519,_0x3566ff,_0x57d120){return new BPromise(function(_0x3485d2,_0x42b812){return client[_0xf0c9('0x10')](_0x477519,_0x57d120)[_0xf0c9('0x11')](function(_0x30cacb){logger[_0xf0c9('0x12')](_0xf0c9('0x13'),_0x3566ff,_0xf0c9('0x14'));logger['debug'](_0xf0c9('0x15'),_0x3566ff,_0xf0c9('0x14'),JSON[_0xf0c9('0x16')](_0x30cacb));if(_0x30cacb['error']){if(_0x30cacb[_0xf0c9('0x17')]['code']===0x1f4){logger[_0xf0c9('0x17')](_0xf0c9('0x13'),_0x3566ff,_0x30cacb[_0xf0c9('0x17')][_0xf0c9('0x18')]);return _0x42b812(_0x30cacb['error'][_0xf0c9('0x18')]);}logger[_0xf0c9('0x17')](_0xf0c9('0x13'),_0x3566ff,_0x30cacb[_0xf0c9('0x17')]['message']);return _0x3485d2(_0x30cacb['error'][_0xf0c9('0x18')]);}else{logger[_0xf0c9('0x12')](_0xf0c9('0x13'),_0x3566ff,_0xf0c9('0x14'));_0x3485d2(_0x30cacb[_0xf0c9('0x19')]['message']);}})[_0xf0c9('0x1a')](function(_0x3658cb){logger['error'](_0xf0c9('0x13'),_0x3566ff,_0x3658cb);_0x42b812(_0x3658cb);});});}exports[_0xf0c9('0x1b')]=function(_0x2fd85b){var _0x49b77b=this;return new Promise(function(_0x429c97,_0x134b07){return db[_0xf0c9('0x1c')][_0xf0c9('0x1d')]({'raw':_0x2fd85b[_0xf0c9('0x1e')]?_0x2fd85b[_0xf0c9('0x1e')][_0xf0c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x2fd85b['options']?_0x2fd85b[_0xf0c9('0x1e')][_0xf0c9('0x20')]||null:null,'attributes':_0x2fd85b['options']?_0x2fd85b[_0xf0c9('0x1e')]['attributes']||null:null,'limit':_0x2fd85b[_0xf0c9('0x1e')]?_0x2fd85b[_0xf0c9('0x1e')]['limit']||null:null,'include':_0x2fd85b['options']?_0x2fd85b[_0xf0c9('0x1e')]['include']?_[_0xf0c9('0x21')](_0x2fd85b[_0xf0c9('0x1e')]['include'],function(_0x469a86){return{'model':db[_0x469a86[_0xf0c9('0x22')]],'as':_0x469a86['as'],'attributes':_0x469a86[_0xf0c9('0x23')],'include':_0x469a86[_0xf0c9('0x24')]?_['map'](_0x469a86[_0xf0c9('0x24')],function(_0x529711){return{'model':db[_0x529711[_0xf0c9('0x22')]],'as':_0x529711['as'],'attributes':_0x529711['attributes'],'include':_0x529711[_0xf0c9('0x24')]?_[_0xf0c9('0x21')](_0x529711[_0xf0c9('0x24')],function(_0x2ae69c){return{'model':db[_0x2ae69c[_0xf0c9('0x22')]],'as':_0x2ae69c['as'],'attributes':_0x2ae69c['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0c9('0x11')](function(_0x4c5693){logger['info']('GetSmsQueue',_0x2fd85b);logger[_0xf0c9('0x25')]('GetSmsQueue',_0x2fd85b,JSON[_0xf0c9('0x16')](_0x4c5693));_0x429c97(_0x4c5693);})[_0xf0c9('0x1a')](function(_0x373eec){logger['error']('GetSmsQueue',_0x373eec['message'],_0x2fd85b);_0x134b07(_0x49b77b[_0xf0c9('0x17')](0x1f4,_0x373eec[_0xf0c9('0x18')]));});});};exports[_0xf0c9('0x26')]=function(_0x1a59eb){var _0x289924=this;return new Promise(function(_0x356c46,_0x45a238){return db[_0xf0c9('0x1c')]['find']({'raw':_0x1a59eb[_0xf0c9('0x1e')]?_0x1a59eb[_0xf0c9('0x1e')][_0xf0c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a59eb[_0xf0c9('0x1e')]?_0x1a59eb['options'][_0xf0c9('0x20')]||null:null,'attributes':_0x1a59eb['options']?_0x1a59eb[_0xf0c9('0x1e')]['attributes']||null:null,'include':_0x1a59eb['options']?_0x1a59eb['options']['include']?_[_0xf0c9('0x21')](_0x1a59eb['options'][_0xf0c9('0x24')],function(_0x31a58f){return{'model':db[_0x31a58f['model']],'as':_0x31a58f['as'],'attributes':_0x31a58f[_0xf0c9('0x23')],'include':_0x31a58f[_0xf0c9('0x24')]?_['map'](_0x31a58f[_0xf0c9('0x24')],function(_0x182b0a){return{'model':db[_0x182b0a[_0xf0c9('0x22')]],'as':_0x182b0a['as'],'attributes':_0x182b0a[_0xf0c9('0x23')],'include':_0x182b0a[_0xf0c9('0x24')]?_[_0xf0c9('0x21')](_0x182b0a[_0xf0c9('0x24')],function(_0x3f05ff){return{'model':db[_0x3f05ff['model']],'as':_0x3f05ff['as'],'attributes':_0x3f05ff[_0xf0c9('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf0c9('0x11')](function(_0x174f48){logger[_0xf0c9('0x12')](_0xf0c9('0x26'),_0x1a59eb);logger[_0xf0c9('0x25')]('ShowSmsQueue',_0x1a59eb,JSON[_0xf0c9('0x16')](_0x174f48));_0x356c46(_0x174f48);})[_0xf0c9('0x1a')](function(_0x3ec694){logger[_0xf0c9('0x17')](_0xf0c9('0x26'),_0x3ec694[_0xf0c9('0x18')],_0x1a59eb);_0x45a238(_0x289924['error'](0x1f4,_0x3ec694[_0xf0c9('0x18')]));});});}; \ No newline at end of file +var _0xbf54=['./smsQueue.socket','register','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','SmsQueue','findAll','options','raw','where','include','map','attributes','model','GetSmsQueue','ShowSmsQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x1c1872,_0x2372f3){var _0x367dd0=function(_0x49983c){while(--_0x49983c){_0x1c1872['push'](_0x1c1872['shift']());}};_0x367dd0(++_0x2372f3);}(_0xbf54,0x1e9));var _0x4bf5=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xbf54[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x4bf5('0x0'));var util=require(_0x4bf5('0x1'));var moment=require('moment');var BPromise=require(_0x4bf5('0x2'));var rs=require(_0x4bf5('0x3'));var fs=require('fs');var Redis=require(_0x4bf5('0x4'));var db=require(_0x4bf5('0x5'))['db'];var utils=require(_0x4bf5('0x6'));var logger=require(_0x4bf5('0x7'))(_0x4bf5('0x8'));var config=require('../../config/environment');var jayson=require(_0x4bf5('0x9'));var client=jayson[_0x4bf5('0xa')]['http']({'port':0x232a});config[_0x4bf5('0xb')]=_[_0x4bf5('0xc')](config[_0x4bf5('0xb')],{'host':_0x4bf5('0xd'),'port':0x18eb});var socket=require(_0x4bf5('0xe'))(new Redis(config['redis']));require(_0x4bf5('0xf'))[_0x4bf5('0x10')](socket);function respondWithRpcPromise(_0xa1523e,_0x3144d7,_0x34096a){return new BPromise(function(_0x1f8254,_0xbf0b0e){return client[_0x4bf5('0x11')](_0xa1523e,_0x34096a)[_0x4bf5('0x12')](function(_0x6860ce){logger[_0x4bf5('0x13')]('SmsQueue,\x20%s,\x20%s',_0x3144d7,_0x4bf5('0x14'));logger[_0x4bf5('0x15')](_0x4bf5('0x16'),_0x3144d7,_0x4bf5('0x14'),JSON[_0x4bf5('0x17')](_0x6860ce));if(_0x6860ce[_0x4bf5('0x18')]){if(_0x6860ce['error'][_0x4bf5('0x19')]===0x1f4){logger[_0x4bf5('0x18')](_0x4bf5('0x1a'),_0x3144d7,_0x6860ce[_0x4bf5('0x18')][_0x4bf5('0x1b')]);return _0xbf0b0e(_0x6860ce[_0x4bf5('0x18')][_0x4bf5('0x1b')]);}logger[_0x4bf5('0x18')](_0x4bf5('0x1a'),_0x3144d7,_0x6860ce[_0x4bf5('0x18')][_0x4bf5('0x1b')]);return _0x1f8254(_0x6860ce[_0x4bf5('0x18')][_0x4bf5('0x1b')]);}else{logger[_0x4bf5('0x13')](_0x4bf5('0x1a'),_0x3144d7,_0x4bf5('0x14'));_0x1f8254(_0x6860ce[_0x4bf5('0x1c')][_0x4bf5('0x1b')]);}})[_0x4bf5('0x1d')](function(_0x2b26cf){logger[_0x4bf5('0x18')](_0x4bf5('0x1a'),_0x3144d7,_0x2b26cf);_0xbf0b0e(_0x2b26cf);});});}exports['GetSmsQueue']=function(_0x1addb9){var _0x1f2eac=this;return new Promise(function(_0x30c26d,_0x20dc20){return db[_0x4bf5('0x1e')][_0x4bf5('0x1f')]({'raw':_0x1addb9[_0x4bf5('0x20')]?_0x1addb9['options'][_0x4bf5('0x21')]===undefined?!![]:![]:!![],'where':_0x1addb9[_0x4bf5('0x20')]?_0x1addb9[_0x4bf5('0x20')][_0x4bf5('0x22')]||null:null,'attributes':_0x1addb9[_0x4bf5('0x20')]?_0x1addb9[_0x4bf5('0x20')]['attributes']||null:null,'limit':_0x1addb9[_0x4bf5('0x20')]?_0x1addb9['options']['limit']||null:null,'include':_0x1addb9[_0x4bf5('0x20')]?_0x1addb9[_0x4bf5('0x20')][_0x4bf5('0x23')]?_[_0x4bf5('0x24')](_0x1addb9[_0x4bf5('0x20')]['include'],function(_0x30e600){return{'model':db[_0x30e600['model']],'as':_0x30e600['as'],'attributes':_0x30e600['attributes'],'include':_0x30e600[_0x4bf5('0x23')]?_[_0x4bf5('0x24')](_0x30e600[_0x4bf5('0x23')],function(_0x316234){return{'model':db[_0x316234['model']],'as':_0x316234['as'],'attributes':_0x316234[_0x4bf5('0x25')],'include':_0x316234[_0x4bf5('0x23')]?_['map'](_0x316234[_0x4bf5('0x23')],function(_0x2ba6e6){return{'model':db[_0x2ba6e6[_0x4bf5('0x26')]],'as':_0x2ba6e6['as'],'attributes':_0x2ba6e6[_0x4bf5('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4bf5('0x12')](function(_0x2708e3){logger[_0x4bf5('0x13')]('GetSmsQueue',_0x1addb9);logger[_0x4bf5('0x15')](_0x4bf5('0x27'),_0x1addb9,JSON[_0x4bf5('0x17')](_0x2708e3));_0x30c26d(_0x2708e3);})['catch'](function(_0x55bb33){logger[_0x4bf5('0x18')](_0x4bf5('0x27'),_0x55bb33[_0x4bf5('0x1b')],_0x1addb9);_0x20dc20(_0x1f2eac[_0x4bf5('0x18')](0x1f4,_0x55bb33['message']));});});};exports[_0x4bf5('0x28')]=function(_0x4374b1){var _0x3850b4=this;return new Promise(function(_0x17af65,_0x160542){return db[_0x4bf5('0x1e')][_0x4bf5('0x29')]({'raw':_0x4374b1['options']?_0x4374b1[_0x4bf5('0x20')][_0x4bf5('0x21')]===undefined?!![]:![]:!![],'where':_0x4374b1[_0x4bf5('0x20')]?_0x4374b1[_0x4bf5('0x20')][_0x4bf5('0x22')]||null:null,'attributes':_0x4374b1[_0x4bf5('0x20')]?_0x4374b1[_0x4bf5('0x20')]['attributes']||null:null,'include':_0x4374b1[_0x4bf5('0x20')]?_0x4374b1[_0x4bf5('0x20')][_0x4bf5('0x23')]?_['map'](_0x4374b1['options'][_0x4bf5('0x23')],function(_0x4ef7da){return{'model':db[_0x4ef7da['model']],'as':_0x4ef7da['as'],'attributes':_0x4ef7da[_0x4bf5('0x25')],'include':_0x4ef7da[_0x4bf5('0x23')]?_[_0x4bf5('0x24')](_0x4ef7da[_0x4bf5('0x23')],function(_0x272e53){return{'model':db[_0x272e53['model']],'as':_0x272e53['as'],'attributes':_0x272e53[_0x4bf5('0x25')],'include':_0x272e53[_0x4bf5('0x23')]?_[_0x4bf5('0x24')](_0x272e53[_0x4bf5('0x23')],function(_0x4183b9){return{'model':db[_0x4183b9[_0x4bf5('0x26')]],'as':_0x4183b9['as'],'attributes':_0x4183b9[_0x4bf5('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4bf5('0x12')](function(_0x453a11){logger[_0x4bf5('0x13')](_0x4bf5('0x28'),_0x4374b1);logger['debug'](_0x4bf5('0x28'),_0x4374b1,JSON[_0x4bf5('0x17')](_0x453a11));_0x17af65(_0x453a11);})[_0x4bf5('0x1d')](function(_0xab9cbc){logger[_0x4bf5('0x18')](_0x4bf5('0x28'),_0xab9cbc[_0x4bf5('0x1b')],_0x4374b1);_0x160542(_0x3850b4[_0x4bf5('0x18')](0x1f4,_0xab9cbc[_0x4bf5('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d4201ab..0712331 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 _0xb796=['emit','removeListener','length','smsQueue:','./smsQueue.events','save','update'];(function(_0x143d27,_0x2b2f86){var _0x2dd45f=function(_0x6d2345){while(--_0x6d2345){_0x143d27['push'](_0x143d27['shift']());}};_0x2dd45f(++_0x2b2f86);}(_0xb796,0x74));var _0x6b79=function(_0x4777ef,_0x208e7b){_0x4777ef=_0x4777ef-0x0;var _0x3396da=_0xb796[_0x4777ef];return _0x3396da;};'use strict';var SmsQueueEvents=require(_0x6b79('0x0'));var events=[_0x6b79('0x1'),'remove',_0x6b79('0x2')];function createListener(_0x23b899,_0x2aa98e){return function(_0x357ad0){_0x2aa98e[_0x6b79('0x3')](_0x23b899,_0x357ad0);};}function removeListener(_0x14131c,_0x302917){return function(){SmsQueueEvents[_0x6b79('0x4')](_0x14131c,_0x302917);};}exports['register']=function(_0xef8105){for(var _0x227055=0x0,_0x109edc=events[_0x6b79('0x5')];_0x227055<_0x109edc;_0x227055++){var _0xb701c=events[_0x227055];var _0xa34776=createListener(_0x6b79('0x6')+_0xb701c,_0xef8105);SmsQueueEvents['on'](_0xb701c,_0xa34776);}}; \ No newline at end of file +var _0x412f=['register','length','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0x412f,0x1aa));var _0xf412=function(_0x22025d,_0x56e3b0){_0x22025d=_0x22025d-0x0;var _0x38b41c=_0x412f[_0x22025d];return _0x38b41c;};'use strict';var SmsQueueEvents=require(_0xf412('0x0'));var events=[_0xf412('0x1'),_0xf412('0x2'),_0xf412('0x3')];function createListener(_0x46c505,_0x34c687){return function(_0x2c8913){_0x34c687[_0xf412('0x4')](_0x46c505,_0x2c8913);};}function removeListener(_0x3f56a3,_0x598519){return function(){SmsQueueEvents[_0xf412('0x5')](_0x3f56a3,_0x598519);};}exports[_0xf412('0x6')]=function(_0x3a565e){for(var _0x39857d=0x0,_0x8e95d9=events[_0xf412('0x7')];_0x39857d<_0x8e95d9;_0x39857d++){var _0x541370=events[_0x39857d];var _0x3c909e=createListener('smsQueue:'+_0x541370,_0x3a565e);SmsQueueEvents['on'](_0x541370,_0x3c909e);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index a90a1b5..483c5e1 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 _0xed5f=['post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x31f8aa,_0x1d1aa1){var _0x5ef007=function(_0x517d11){while(--_0x517d11){_0x31f8aa['push'](_0x31f8aa['shift']());}};_0x5ef007(++_0x1d1aa1);}(_0xed5f,0x1e6));var _0xfed5=function(_0x258e7c,_0x2581d3){_0x258e7c=_0x258e7c-0x0;var _0x513214=_0xed5f[_0x258e7c];return _0x513214;};'use strict';var multer=require('multer');var util=require(_0xfed5('0x0'));var path=require(_0xfed5('0x1'));var timeout=require(_0xfed5('0x2'));var express=require('express');var router=express[_0xfed5('0x3')]();var fs_extra=require(_0xfed5('0x4'));var auth=require(_0xfed5('0x5'));var interaction=require(_0xfed5('0x6'));var config=require('../../config/environment');var controller=require(_0xfed5('0x7'));router[_0xfed5('0x8')]('/',auth[_0xfed5('0x9')](),controller['index']);router[_0xfed5('0x8')](_0xfed5('0xa'),auth['isAuthenticated'](),controller[_0xfed5('0xb')]);router[_0xfed5('0x8')](_0xfed5('0xc'),auth[_0xfed5('0x9')](),controller[_0xfed5('0xd')]);router[_0xfed5('0xe')]('/',auth[_0xfed5('0x9')](),controller[_0xfed5('0xf')]);router[_0xfed5('0x10')](_0xfed5('0xc'),auth[_0xfed5('0x9')](),controller[_0xfed5('0x11')]);router['delete'](_0xfed5('0xc'),auth[_0xfed5('0x9')](),controller[_0xfed5('0x12')]);module[_0xfed5('0x13')]=router; \ No newline at end of file +var _0xc8e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x3e50f0,_0x486447){var _0x15c1cf=function(_0x189103){while(--_0x189103){_0x3e50f0['push'](_0x3e50f0['shift']());}};_0x15c1cf(++_0x486447);}(_0xc8e9,0x1f4));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9c8e('0x0'));var path=require(_0x9c8e('0x1'));var timeout=require(_0x9c8e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9c8e('0x3'));var auth=require(_0x9c8e('0x4'));var interaction=require(_0x9c8e('0x5'));var config=require(_0x9c8e('0x6'));var controller=require('./smsQueueReport.controller');router[_0x9c8e('0x7')]('/',auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x9')]);router[_0x9c8e('0x7')](_0x9c8e('0xa'),auth[_0x9c8e('0x8')](),controller[_0x9c8e('0xb')]);router[_0x9c8e('0x7')]('/:id',auth[_0x9c8e('0x8')](),controller[_0x9c8e('0xc')]);router[_0x9c8e('0xd')]('/',auth['isAuthenticated'](),controller[_0x9c8e('0xe')]);router[_0x9c8e('0xf')](_0x9c8e('0x10'),auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x11')]);router[_0x9c8e('0x12')]('/:id',auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x13')]);module[_0x9c8e('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b20531b..758bdea 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 _0x1c59=['exports','STRING','DATE','moment','sequelize'];(function(_0x1fbf27,_0x31c0e9){var _0x26002b=function(_0x1cf784){while(--_0x1cf784){_0x1fbf27['push'](_0x1fbf27['shift']());}};_0x26002b(++_0x31c0e9);}(_0x1c59,0x18e));var _0x91c5=function(_0x130934,_0x194b88){_0x130934=_0x130934-0x0;var _0x1dec02=_0x1c59[_0x130934];return _0x1dec02;};'use strict';var moment=require(_0x91c5('0x0'));var Sequelize=require(_0x91c5('0x1'));module[_0x91c5('0x2')]={'uniqueid':{'type':Sequelize[_0x91c5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x91c5('0x3')]},'joinAt':{'type':Sequelize[_0x91c5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x91c5('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xae0f=['sequelize','exports','STRING','DATE'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xae0f,0x1d0));var _0xfae0=function(_0x176c34,_0x15a5ad){_0x176c34=_0x176c34-0x0;var _0x22602a=_0xae0f[_0x176c34];return _0x22602a;};'use strict';var moment=require('moment');var Sequelize=require(_0xfae0('0x0'));module[_0xfae0('0x1')]={'uniqueid':{'type':Sequelize[_0xfae0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfae0('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfae0('0x3')]},'acceptAt':{'type':Sequelize[_0xfae0('0x3')]},'exitAt':{'type':Sequelize[_0xfae0('0x3')]},'reason':{'type':Sequelize[_0xfae0('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 191d81b..e2ad564 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 _0x754d=['squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash'];(function(_0x455fe5,_0x256762){var _0x1f8c1d=function(_0x16f911){while(--_0x16f911){_0x455fe5['push'](_0x455fe5['shift']());}};_0x1f8c1d(++_0x256762);}(_0x754d,0x8d));var _0xd754=function(_0x28571e,_0x99c3c0){_0x28571e=_0x28571e-0x0;var _0xb564a8=_0x754d[_0x28571e];return _0xb564a8;};'use strict';var emlformat=require(_0xd754('0x0'));var rimraf=require(_0xd754('0x1'));var zipdir=require(_0xd754('0x2'));var jsonpatch=require(_0xd754('0x3'));var rp=require(_0xd754('0x4'));var moment=require(_0xd754('0x5'));var BPromise=require(_0xd754('0x6'));var Mustache=require(_0xd754('0x7'));var util=require(_0xd754('0x8'));var path=require(_0xd754('0x9'));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(_0xd754('0xa'));var squel=require(_0xd754('0xb'));var crypto=require(_0xd754('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd754('0xd'));var toCsv=require(_0xd754('0xe'));var querystring=require(_0xd754('0xf'));var Papa=require(_0xd754('0x10'));var Redis=require('ioredis');var authService=require(_0xd754('0x11'));var qs=require(_0xd754('0x12'));var as=require(_0xd754('0x13'));var hardwareService=require(_0xd754('0x14'));var logger=require(_0xd754('0x15'))('api');var utils=require(_0xd754('0x16'));var config=require(_0xd754('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c1b3e,_0x5913aa){_0x5913aa=_0x5913aa||0xcc;return function(_0x2dcdda){if(_0x2dcdda){return _0x2c1b3e[_0xd754('0x18')](_0x5913aa);}return _0x2c1b3e[_0xd754('0x19')](_0x5913aa)[_0xd754('0x1a')]();};}function respondWithResult(_0x2a7008,_0x2d469b){_0x2d469b=_0x2d469b||0xc8;return function(_0x717987){if(_0x717987){return _0x2a7008[_0xd754('0x19')](_0x2d469b)[_0xd754('0x1b')](_0x717987);}};}function respondWithFilteredResult(_0x1922f4,_0x1769cb){return function(_0x480635){if(_0x480635){var _0x3ef227=typeof _0x1769cb[_0xd754('0x1c')]===_0xd754('0x1d')&&typeof _0x1769cb['limit']===_0xd754('0x1d');var _0x37751e=_0x480635['count'];var _0x23c4f8=_0x3ef227?0x0:_0x1769cb[_0xd754('0x1c')];var _0x5f0b3d=_0x3ef227?_0x480635[_0xd754('0x1e')]:_0x1769cb['offset']+_0x1769cb[_0xd754('0x1f')];var _0x2296a6;if(_0x5f0b3d>=_0x37751e){_0x5f0b3d=_0x37751e;_0x2296a6=0xc8;}else{_0x2296a6=0xce;}_0x1922f4[_0xd754('0x19')](_0x2296a6);return _0x1922f4[_0xd754('0x20')](_0xd754('0x21'),_0x23c4f8+'-'+_0x5f0b3d+'/'+_0x37751e)[_0xd754('0x1b')](_0x480635);}return null;};}function patchUpdates(_0x33a017){return function(_0x48084d){try{jsonpatch[_0xd754('0x22')](_0x48084d,_0x33a017,!![]);}catch(_0x22066f){return BPromise[_0xd754('0x23')](_0x22066f);}return _0x48084d[_0xd754('0x24')]();};}function saveUpdates(_0x5c925f,_0xff77f2){return function(_0x40edec){if(_0x40edec){return _0x40edec[_0xd754('0x25')](_0x5c925f)['then'](function(_0x2a70ed){return _0x2a70ed;});}return null;};}function removeEntity(_0x526ced,_0x4d00ce){return function(_0x4a87c1){if(_0x4a87c1){return _0x4a87c1[_0xd754('0x26')]()[_0xd754('0x27')](function(){_0x526ced[_0xd754('0x19')](0xcc)[_0xd754('0x1a')]();});}};}function handleEntityNotFound(_0x1fb44d,_0x31db29){return function(_0x3b77a0){if(!_0x3b77a0){_0x1fb44d[_0xd754('0x18')](0x194);}return _0x3b77a0;};}function handleError(_0x4780ad,_0x2b370d){_0x2b370d=_0x2b370d||0x1f4;return function(_0x374698){logger['error'](_0x374698[_0xd754('0x28')]);if(_0x374698[_0xd754('0x29')]){delete _0x374698[_0xd754('0x29')];}_0x4780ad[_0xd754('0x19')](_0x2b370d)[_0xd754('0x2a')](_0x374698);};}exports[_0xd754('0x2b')]=function(_0xc19751,_0x52c313){var _0xfe3d7d={},_0xa44ef2={},_0x57aee9={'count':0x0,'rows':[]};var _0x4b7b70=_[_0xd754('0x2c')](db[_0xd754('0x2d')][_0xd754('0x2e')],function(_0x34ed58){return{'name':_0x34ed58[_0xd754('0x2f')],'type':_0x34ed58[_0xd754('0x30')][_0xd754('0x31')]};});_0xa44ef2[_0xd754('0x32')]=_[_0xd754('0x2c')](_0x4b7b70,_0xd754('0x29'));_0xa44ef2[_0xd754('0x33')]=_[_0xd754('0x34')](_0xc19751[_0xd754('0x33')]);_0xa44ef2[_0xd754('0x35')]=_[_0xd754('0x36')](_0xa44ef2['model'],_0xa44ef2['query']);_0xfe3d7d[_0xd754('0x37')]=_[_0xd754('0x36')](_0xa44ef2[_0xd754('0x32')],qs[_0xd754('0x38')](_0xc19751['query'][_0xd754('0x38')]));_0xfe3d7d[_0xd754('0x37')]=_0xfe3d7d[_0xd754('0x37')][_0xd754('0x39')]?_0xfe3d7d[_0xd754('0x37')]:_0xa44ef2[_0xd754('0x32')];if(!_0xc19751['query']['hasOwnProperty'](_0xd754('0x3a'))){_0xfe3d7d[_0xd754('0x1f')]=qs[_0xd754('0x1f')](_0xc19751[_0xd754('0x33')]['limit']);_0xfe3d7d[_0xd754('0x1c')]=qs[_0xd754('0x1c')](_0xc19751[_0xd754('0x33')][_0xd754('0x1c')]);}_0xfe3d7d['order']=qs[_0xd754('0x3b')](_0xc19751[_0xd754('0x33')][_0xd754('0x3b')]);_0xfe3d7d['where']=qs['filters'](_['pick'](_0xc19751[_0xd754('0x33')],_0xa44ef2['filters']),_0x4b7b70);if(_0xc19751['query'][_0xd754('0x3c')]){_0xfe3d7d[_0xd754('0x3d')]=_[_0xd754('0x3e')](_0xfe3d7d['where'],{'$or':_[_0xd754('0x2c')](_0x4b7b70,function(_0x4eadb9){if(_0x4eadb9[_0xd754('0x30')]!==_0xd754('0x3f')){var _0x24ada8={};_0x24ada8[_0x4eadb9['name']]={'$like':'%'+_0xc19751[_0xd754('0x33')]['filter']+'%'};return _0x24ada8;}})});}_0xfe3d7d=_['merge']({},_0xfe3d7d,_0xc19751[_0xd754('0x40')]);var _0x186b5d={'where':_0xfe3d7d[_0xd754('0x3d')]};return db[_0xd754('0x2d')][_0xd754('0x1e')](_0x186b5d)[_0xd754('0x27')](function(_0x556149){_0x57aee9['count']=_0x556149;if(_0xc19751[_0xd754('0x33')][_0xd754('0x41')]){_0xfe3d7d[_0xd754('0x42')]=[{'all':!![]}];}return db[_0xd754('0x2d')][_0xd754('0x43')](_0xfe3d7d);})[_0xd754('0x27')](function(_0x1b831d){_0x57aee9[_0xd754('0x44')]=_0x1b831d;return _0x57aee9;})['then'](respondWithFilteredResult(_0x52c313,_0xfe3d7d))[_0xd754('0x45')](handleError(_0x52c313,null));};exports[_0xd754('0x46')]=function(_0x5e1385,_0x126a13){var _0x2dff15={'raw':!![],'where':{'id':_0x5e1385[_0xd754('0x47')]['id']}},_0x2e43ec={};_0x2e43ec[_0xd754('0x32')]=_['keys'](db[_0xd754('0x2d')][_0xd754('0x2e')]);_0x2e43ec['query']=_[_0xd754('0x34')](_0x5e1385[_0xd754('0x33')]);_0x2e43ec['filters']=_['intersection'](_0x2e43ec[_0xd754('0x32')],_0x2e43ec[_0xd754('0x33')]);_0x2dff15[_0xd754('0x37')]=_['intersection'](_0x2e43ec[_0xd754('0x32')],qs[_0xd754('0x38')](_0x5e1385[_0xd754('0x33')][_0xd754('0x38')]));_0x2dff15['attributes']=_0x2dff15[_0xd754('0x37')][_0xd754('0x39')]?_0x2dff15[_0xd754('0x37')]:_0x2e43ec[_0xd754('0x32')];if(_0x5e1385[_0xd754('0x33')]['includeAll']){_0x2dff15[_0xd754('0x42')]=[{'all':!![]}];}_0x2dff15=_['merge']({},_0x2dff15,_0x5e1385[_0xd754('0x40')]);return db['SmsQueueReport'][_0xd754('0x48')](_0x2dff15)[_0xd754('0x27')](handleEntityNotFound(_0x126a13,null))['then'](respondWithResult(_0x126a13,null))[_0xd754('0x45')](handleError(_0x126a13,null));};exports['create']=function(_0x4b6a7e,_0x4d807d){return db[_0xd754('0x2d')][_0xd754('0x49')](_0x4b6a7e[_0xd754('0x4a')],{})[_0xd754('0x27')](respondWithResult(_0x4d807d,0xc9))[_0xd754('0x45')](handleError(_0x4d807d,null));};exports['update']=function(_0x54e7fc,_0x1e23c0){if(_0x54e7fc[_0xd754('0x4a')]['id']){delete _0x54e7fc[_0xd754('0x4a')]['id'];}return db['SmsQueueReport'][_0xd754('0x48')]({'where':{'id':_0x54e7fc['params']['id']}})[_0xd754('0x27')](handleEntityNotFound(_0x1e23c0,null))[_0xd754('0x27')](saveUpdates(_0x54e7fc[_0xd754('0x4a')],null))[_0xd754('0x27')](respondWithResult(_0x1e23c0,null))['catch'](handleError(_0x1e23c0,null));};exports['destroy']=function(_0xc65365,_0x34a8a1){return db[_0xd754('0x2d')]['find']({'where':{'id':_0xc65365[_0xd754('0x47')]['id']}})[_0xd754('0x27')](handleEntityNotFound(_0x34a8a1,null))[_0xd754('0x27')](removeEntity(_0x34a8a1,null))['catch'](handleError(_0x34a8a1,null));};exports['describe']=function(_0x3ab99b,_0x53887d){return db[_0xd754('0x2d')][_0xd754('0x4b')]()[_0xd754('0x27')](respondWithResult(_0x53887d,null))['catch'](handleError(_0x53887d,null));}; \ No newline at end of file +var _0xf357=['status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','SmsQueueReport','rawAttributes','type','key','query','keys','model','attributes','intersection','hasOwnProperty','nolimit','filters','pick','filter','where','merge','includeAll','include','rows','catch','params','fields','length','options','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf357,0x77));var _0x7f35=function(_0x33937e,_0x5b721d){_0x33937e=_0x33937e-0x0;var _0x466790=_0xf357[_0x33937e];return _0x466790;};'use strict';var emlformat=require(_0x7f35('0x0'));var rimraf=require(_0x7f35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7f35('0x2'));var moment=require(_0x7f35('0x3'));var BPromise=require(_0x7f35('0x4'));var Mustache=require(_0x7f35('0x5'));var util=require('util');var path=require(_0x7f35('0x6'));var sox=require(_0x7f35('0x7'));var csv=require(_0x7f35('0x8'));var ejs=require(_0x7f35('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f35('0xa'));var jsforce=require(_0x7f35('0xb'));var deskjs=require(_0x7f35('0xc'));var toCsv=require(_0x7f35('0x8'));var querystring=require(_0x7f35('0xd'));var Papa=require('papaparse');var Redis=require(_0x7f35('0xe'));var authService=require(_0x7f35('0xf'));var qs=require(_0x7f35('0x10'));var as=require(_0x7f35('0x11'));var hardwareService=require(_0x7f35('0x12'));var logger=require(_0x7f35('0x13'))(_0x7f35('0x14'));var utils=require(_0x7f35('0x15'));var config=require(_0x7f35('0x16'));var licenseUtil=require(_0x7f35('0x17'));var db=require(_0x7f35('0x18'))['db'];function respondWithStatusCode(_0x5c3254,_0x48a840){_0x48a840=_0x48a840||0xcc;return function(_0x24af95){if(_0x24af95){return _0x5c3254[_0x7f35('0x19')](_0x48a840);}return _0x5c3254['status'](_0x48a840)[_0x7f35('0x1a')]();};}function respondWithResult(_0x334261,_0x428896){_0x428896=_0x428896||0xc8;return function(_0x55ae81){if(_0x55ae81){return _0x334261[_0x7f35('0x1b')](_0x428896)[_0x7f35('0x1c')](_0x55ae81);}};}function respondWithFilteredResult(_0x48c96d,_0x1769b1){return function(_0x5757d9){if(_0x5757d9){var _0x51230c=typeof _0x1769b1[_0x7f35('0x1d')]==='undefined'&&typeof _0x1769b1[_0x7f35('0x1e')]===_0x7f35('0x1f');var _0x377c61=_0x5757d9[_0x7f35('0x20')];var _0x187d49=_0x51230c?0x0:_0x1769b1[_0x7f35('0x1d')];var _0x410747=_0x51230c?_0x5757d9[_0x7f35('0x20')]:_0x1769b1[_0x7f35('0x1d')]+_0x1769b1[_0x7f35('0x1e')];var _0x322a58;if(_0x410747>=_0x377c61){_0x410747=_0x377c61;_0x322a58=0xc8;}else{_0x322a58=0xce;}_0x48c96d[_0x7f35('0x1b')](_0x322a58);return _0x48c96d[_0x7f35('0x21')](_0x7f35('0x22'),_0x187d49+'-'+_0x410747+'/'+_0x377c61)[_0x7f35('0x1c')](_0x5757d9);}return null;};}function patchUpdates(_0xd95672){return function(_0x43b758){try{jsonpatch[_0x7f35('0x23')](_0x43b758,_0xd95672,!![]);}catch(_0x37c23e){return BPromise[_0x7f35('0x24')](_0x37c23e);}return _0x43b758[_0x7f35('0x25')]();};}function saveUpdates(_0xf97b25,_0x104db1){return function(_0x526e6a){if(_0x526e6a){return _0x526e6a['update'](_0xf97b25)[_0x7f35('0x26')](function(_0x2e05fb){return _0x2e05fb;});}return null;};}function removeEntity(_0x40c565,_0x5d9de3){return function(_0x5187e6){if(_0x5187e6){return _0x5187e6[_0x7f35('0x27')]()[_0x7f35('0x26')](function(){_0x40c565[_0x7f35('0x1b')](0xcc)[_0x7f35('0x1a')]();});}};}function handleEntityNotFound(_0x4ef505,_0x36207e){return function(_0x4886ef){if(!_0x4886ef){_0x4ef505['sendStatus'](0x194);}return _0x4886ef;};}function handleError(_0x1e12fb,_0x4d72eb){_0x4d72eb=_0x4d72eb||0x1f4;return function(_0xe88931){logger[_0x7f35('0x28')](_0xe88931[_0x7f35('0x29')]);if(_0xe88931[_0x7f35('0x2a')]){delete _0xe88931[_0x7f35('0x2a')];}_0x1e12fb[_0x7f35('0x1b')](_0x4d72eb)[_0x7f35('0x2b')](_0xe88931);};}exports['index']=function(_0x3c5561,_0x4d3bf9){var _0x546dec={},_0x2e0aab={},_0x275168={'count':0x0,'rows':[]};var _0x467d9e=_[_0x7f35('0x2c')](db[_0x7f35('0x2d')][_0x7f35('0x2e')],function(_0x4fda45){return{'name':_0x4fda45['fieldName'],'type':_0x4fda45[_0x7f35('0x2f')][_0x7f35('0x30')]};});_0x2e0aab['model']=_[_0x7f35('0x2c')](_0x467d9e,'name');_0x2e0aab[_0x7f35('0x31')]=_[_0x7f35('0x32')](_0x3c5561[_0x7f35('0x31')]);_0x2e0aab['filters']=_['intersection'](_0x2e0aab[_0x7f35('0x33')],_0x2e0aab[_0x7f35('0x31')]);_0x546dec[_0x7f35('0x34')]=_[_0x7f35('0x35')](_0x2e0aab[_0x7f35('0x33')],qs['fields'](_0x3c5561['query']['fields']));_0x546dec[_0x7f35('0x34')]=_0x546dec['attributes']['length']?_0x546dec[_0x7f35('0x34')]:_0x2e0aab[_0x7f35('0x33')];if(!_0x3c5561[_0x7f35('0x31')][_0x7f35('0x36')](_0x7f35('0x37'))){_0x546dec[_0x7f35('0x1e')]=qs[_0x7f35('0x1e')](_0x3c5561['query'][_0x7f35('0x1e')]);_0x546dec['offset']=qs[_0x7f35('0x1d')](_0x3c5561[_0x7f35('0x31')][_0x7f35('0x1d')]);}_0x546dec['order']=qs['sort'](_0x3c5561[_0x7f35('0x31')]['sort']);_0x546dec['where']=qs[_0x7f35('0x38')](_[_0x7f35('0x39')](_0x3c5561[_0x7f35('0x31')],_0x2e0aab[_0x7f35('0x38')]),_0x467d9e);if(_0x3c5561['query'][_0x7f35('0x3a')]){_0x546dec[_0x7f35('0x3b')]=_['merge'](_0x546dec['where'],{'$or':_['map'](_0x467d9e,function(_0x5ac32c){if(_0x5ac32c[_0x7f35('0x2f')]!=='VIRTUAL'){var _0x4a2c9c={};_0x4a2c9c[_0x5ac32c['name']]={'$like':'%'+_0x3c5561[_0x7f35('0x31')]['filter']+'%'};return _0x4a2c9c;}})});}_0x546dec=_[_0x7f35('0x3c')]({},_0x546dec,_0x3c5561['options']);var _0x1f4638={'where':_0x546dec[_0x7f35('0x3b')]};return db[_0x7f35('0x2d')][_0x7f35('0x20')](_0x1f4638)[_0x7f35('0x26')](function(_0x29227f){_0x275168[_0x7f35('0x20')]=_0x29227f;if(_0x3c5561[_0x7f35('0x31')][_0x7f35('0x3d')]){_0x546dec[_0x7f35('0x3e')]=[{'all':!![]}];}return db[_0x7f35('0x2d')]['findAll'](_0x546dec);})[_0x7f35('0x26')](function(_0x101e34){_0x275168[_0x7f35('0x3f')]=_0x101e34;return _0x275168;})[_0x7f35('0x26')](respondWithFilteredResult(_0x4d3bf9,_0x546dec))[_0x7f35('0x40')](handleError(_0x4d3bf9,null));};exports['show']=function(_0x41698c,_0x2054e8){var _0x2fc17f={'raw':!![],'where':{'id':_0x41698c[_0x7f35('0x41')]['id']}},_0x1fcc43={};_0x1fcc43[_0x7f35('0x33')]=_[_0x7f35('0x32')](db['SmsQueueReport']['rawAttributes']);_0x1fcc43['query']=_[_0x7f35('0x32')](_0x41698c[_0x7f35('0x31')]);_0x1fcc43[_0x7f35('0x38')]=_[_0x7f35('0x35')](_0x1fcc43[_0x7f35('0x33')],_0x1fcc43['query']);_0x2fc17f[_0x7f35('0x34')]=_[_0x7f35('0x35')](_0x1fcc43['model'],qs[_0x7f35('0x42')](_0x41698c[_0x7f35('0x31')][_0x7f35('0x42')]));_0x2fc17f['attributes']=_0x2fc17f['attributes'][_0x7f35('0x43')]?_0x2fc17f['attributes']:_0x1fcc43[_0x7f35('0x33')];if(_0x41698c[_0x7f35('0x31')]['includeAll']){_0x2fc17f[_0x7f35('0x3e')]=[{'all':!![]}];}_0x2fc17f=_[_0x7f35('0x3c')]({},_0x2fc17f,_0x41698c[_0x7f35('0x44')]);return db[_0x7f35('0x2d')]['find'](_0x2fc17f)['then'](handleEntityNotFound(_0x2054e8,null))[_0x7f35('0x26')](respondWithResult(_0x2054e8,null))[_0x7f35('0x40')](handleError(_0x2054e8,null));};exports[_0x7f35('0x45')]=function(_0x4caf07,_0x439d43){return db[_0x7f35('0x2d')]['create'](_0x4caf07[_0x7f35('0x46')],{})[_0x7f35('0x26')](respondWithResult(_0x439d43,0xc9))[_0x7f35('0x40')](handleError(_0x439d43,null));};exports['update']=function(_0x3725dc,_0x1beedf){if(_0x3725dc[_0x7f35('0x46')]['id']){delete _0x3725dc['body']['id'];}return db[_0x7f35('0x2d')][_0x7f35('0x47')]({'where':{'id':_0x3725dc[_0x7f35('0x41')]['id']}})[_0x7f35('0x26')](handleEntityNotFound(_0x1beedf,null))[_0x7f35('0x26')](saveUpdates(_0x3725dc[_0x7f35('0x46')],null))[_0x7f35('0x26')](respondWithResult(_0x1beedf,null))['catch'](handleError(_0x1beedf,null));};exports[_0x7f35('0x27')]=function(_0x14973a,_0x366795){return db['SmsQueueReport'][_0x7f35('0x47')]({'where':{'id':_0x14973a[_0x7f35('0x41')]['id']}})[_0x7f35('0x26')](handleEntityNotFound(_0x366795,null))[_0x7f35('0x26')](removeEntity(_0x366795,null))[_0x7f35('0x40')](handleError(_0x366795,null));};exports[_0x7f35('0x48')]=function(_0x598826,_0x540b88){return db['SmsQueueReport'][_0x7f35('0x48')]()[_0x7f35('0x26')](respondWithResult(_0x540b88,null))['catch'](handleError(_0x540b88,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 7788e59..1dcfc50 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 024cd4d..8adda72 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 _0x0567=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','debug','SmsQueueReport','where','attributes','UpdateSmsQueueReport','lodash','moment','bluebird','randomstring'];(function(_0x154784,_0x526d63){var _0xf3eaed=function(_0x53d100){while(--_0x53d100){_0x154784['push'](_0x154784['shift']());}};_0xf3eaed(++_0x526d63);}(_0x0567,0x1dc));var _0x7056=function(_0x4dc1dd,_0x42b7fc){_0x4dc1dd=_0x4dc1dd-0x0;var _0x53d09f=_0x0567[_0x4dc1dd];return _0x53d09f;};'use strict';var _=require(_0x7056('0x0'));var util=require('util');var moment=require(_0x7056('0x1'));var BPromise=require(_0x7056('0x2'));var rs=require(_0x7056('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7056('0x4'))['db'];var utils=require(_0x7056('0x5'));var logger=require(_0x7056('0x6'))('rpc');var config=require(_0x7056('0x7'));var jayson=require(_0x7056('0x8'));var client=jayson['client'][_0x7056('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2824a2,_0x5b0ae7,_0x2f3d4b){return new BPromise(function(_0x3b42ee,_0x37ec0f){return client['request'](_0x2824a2,_0x2f3d4b)[_0x7056('0xa')](function(_0x2f2f20){logger[_0x7056('0xb')](_0x7056('0xc'),_0x5b0ae7,_0x7056('0xd'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5b0ae7,_0x7056('0xd'),JSON[_0x7056('0xe')](_0x2f2f20));if(_0x2f2f20['error']){if(_0x2f2f20[_0x7056('0xf')][_0x7056('0x10')]===0x1f4){logger[_0x7056('0xf')](_0x7056('0xc'),_0x5b0ae7,_0x2f2f20[_0x7056('0xf')][_0x7056('0x11')]);return _0x37ec0f(_0x2f2f20[_0x7056('0xf')][_0x7056('0x11')]);}logger['error'](_0x7056('0xc'),_0x5b0ae7,_0x2f2f20[_0x7056('0xf')]['message']);return _0x3b42ee(_0x2f2f20[_0x7056('0xf')]['message']);}else{logger[_0x7056('0xb')](_0x7056('0xc'),_0x5b0ae7,_0x7056('0xd'));_0x3b42ee(_0x2f2f20[_0x7056('0x12')]['message']);}})[_0x7056('0x13')](function(_0x1b8b42){logger[_0x7056('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x5b0ae7,_0x1b8b42);_0x37ec0f(_0x1b8b42);});});}exports[_0x7056('0x14')]=function(_0x5dbc79){var _0x50ebbc=this;return new Promise(function(_0x4f2e79,_0x575ffc){return db['SmsQueueReport'][_0x7056('0x15')](_0x5dbc79[_0x7056('0x16')],{'raw':_0x5dbc79[_0x7056('0x17')]?_0x5dbc79['options'][_0x7056('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x36c116){logger['info'](_0x7056('0x14'),_0x5dbc79);logger[_0x7056('0x19')](_0x7056('0x14'),_0x5dbc79,JSON[_0x7056('0xe')](_0x36c116));_0x4f2e79(_0x36c116);})[_0x7056('0x13')](function(_0xa11d02){logger['error'](_0x7056('0x14'),_0xa11d02[_0x7056('0x11')],_0x5dbc79);_0x575ffc(_0x50ebbc[_0x7056('0xf')](0x1f4,_0xa11d02['message']));});});};exports['UpdateSmsQueueReport']=function(_0x487493){var _0x4f1f48=this;return new Promise(function(_0x15ebc8,_0x2d152a){return db[_0x7056('0x1a')]['update'](_0x487493[_0x7056('0x16')],{'raw':_0x487493['options']?_0x487493[_0x7056('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x487493[_0x7056('0x17')]?_0x487493[_0x7056('0x17')][_0x7056('0x1b')]||null:null,'attributes':_0x487493[_0x7056('0x17')]?_0x487493['options'][_0x7056('0x1c')]||null:null,'limit':_0x487493[_0x7056('0x17')]?_0x487493[_0x7056('0x17')]['limit']||null:null})[_0x7056('0xa')](function(_0x112717){logger[_0x7056('0xb')](_0x7056('0x1d'),_0x487493);logger['debug'](_0x7056('0x1d'),_0x487493,JSON[_0x7056('0xe')](_0x112717));_0x15ebc8(_0x112717);})[_0x7056('0x13')](function(_0x2e829f){logger[_0x7056('0xf')]('UpdateSmsQueueReport',_0x2e829f[_0x7056('0x11')],_0x487493);_0x2d152a(_0x4f1f48['error'](0x1f4,_0x2e829f[_0x7056('0x11')]));});});}; \ No newline at end of file +var _0x7290=['catch','SmsQueueReport','body','options','raw','then','CreateSmsQueueReport','UpdateSmsQueueReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsQueueReport,\x20%s,\x20%s','result'];(function(_0x4609d3,_0x404573){var _0x4c5bb5=function(_0x46ac18){while(--_0x46ac18){_0x4609d3['push'](_0x4609d3['shift']());}};_0x4c5bb5(++_0x404573);}(_0x7290,0x122));var _0x0729=function(_0x5d76ad,_0x26158d){_0x5d76ad=_0x5d76ad-0x0;var _0x4f7937=_0x7290[_0x5d76ad];return _0x4f7937;};'use strict';var _=require('lodash');var util=require(_0x0729('0x0'));var moment=require(_0x0729('0x1'));var BPromise=require(_0x0729('0x2'));var rs=require(_0x0729('0x3'));var fs=require('fs');var Redis=require(_0x0729('0x4'));var db=require(_0x0729('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0729('0x6'));var config=require(_0x0729('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0729('0x8')][_0x0729('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ef385,_0x5025e4,_0xa6a700){return new BPromise(function(_0x2049d7,_0x614352){return client[_0x0729('0xa')](_0x1ef385,_0xa6a700)['then'](function(_0x41c621){logger[_0x0729('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x5025e4,_0x0729('0xc'));logger[_0x0729('0xd')](_0x0729('0xe'),_0x5025e4,_0x0729('0xc'),JSON[_0x0729('0xf')](_0x41c621));if(_0x41c621[_0x0729('0x10')]){if(_0x41c621[_0x0729('0x10')]['code']===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x5025e4,_0x41c621[_0x0729('0x10')]['message']);return _0x614352(_0x41c621[_0x0729('0x10')]['message']);}logger[_0x0729('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x5025e4,_0x41c621[_0x0729('0x10')]['message']);return _0x2049d7(_0x41c621[_0x0729('0x10')][_0x0729('0x11')]);}else{logger[_0x0729('0xb')](_0x0729('0x12'),_0x5025e4,'request\x20sent');_0x2049d7(_0x41c621[_0x0729('0x13')][_0x0729('0x11')]);}})[_0x0729('0x14')](function(_0x424550){logger['error'](_0x0729('0x12'),_0x5025e4,_0x424550);_0x614352(_0x424550);});});}exports['CreateSmsQueueReport']=function(_0x448bb7){var _0x5da465=this;return new Promise(function(_0x22d864,_0x30894c){return db[_0x0729('0x15')]['create'](_0x448bb7[_0x0729('0x16')],{'raw':_0x448bb7['options']?_0x448bb7[_0x0729('0x17')][_0x0729('0x18')]===undefined?!![]:![]:!![]})[_0x0729('0x19')](function(_0x227b86){logger[_0x0729('0xb')](_0x0729('0x1a'),_0x448bb7);logger[_0x0729('0xd')]('CreateSmsQueueReport',_0x448bb7,JSON[_0x0729('0xf')](_0x227b86));_0x22d864(_0x227b86);})['catch'](function(_0x35d992){logger[_0x0729('0x10')](_0x0729('0x1a'),_0x35d992['message'],_0x448bb7);_0x30894c(_0x5da465[_0x0729('0x10')](0x1f4,_0x35d992[_0x0729('0x11')]));});});};exports[_0x0729('0x1b')]=function(_0x8e56e3){var _0x4ef965=this;return new Promise(function(_0x1e6d9f,_0x43efc0){return db[_0x0729('0x15')]['update'](_0x8e56e3['body'],{'raw':_0x8e56e3[_0x0729('0x17')]?_0x8e56e3[_0x0729('0x17')][_0x0729('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8e56e3[_0x0729('0x17')]?_0x8e56e3['options'][_0x0729('0x1c')]||null:null,'attributes':_0x8e56e3[_0x0729('0x17')]?_0x8e56e3[_0x0729('0x17')][_0x0729('0x1d')]||null:null,'limit':_0x8e56e3[_0x0729('0x17')]?_0x8e56e3[_0x0729('0x17')][_0x0729('0x1e')]||null:null})[_0x0729('0x19')](function(_0xa90b75){logger[_0x0729('0xb')](_0x0729('0x1b'),_0x8e56e3);logger[_0x0729('0xd')](_0x0729('0x1b'),_0x8e56e3,JSON['stringify'](_0xa90b75));_0x1e6d9f(_0xa90b75);})['catch'](function(_0x5d962f){logger[_0x0729('0x10')](_0x0729('0x1b'),_0x5d962f[_0x0729('0x11')],_0x8e56e3);_0x43efc0(_0x4ef965[_0x0729('0x10')](0x1f4,_0x5d962f[_0x0729('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 3ccf735..61a96e0 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 _0x44e8=['show','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0xb7b722,_0xe95ba7){var _0x217177=function(_0x463ab4){while(--_0x463ab4){_0xb7b722['push'](_0xb7b722['shift']());}};_0x217177(++_0xe95ba7);}(_0x44e8,0xd7));var _0x844e=function(_0x21a1e0,_0xee2eed){_0x21a1e0=_0x21a1e0-0x0;var _0x3335f2=_0x44e8[_0x21a1e0];return _0x3335f2;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0xe')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0xf')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0x10')]);router[_0x844e('0x11')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller['destroy']);module[_0x844e('0x12')]=router; \ No newline at end of file +var _0x885a=['describe','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0x885a,0x180));var _0xa885=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x885a[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0x9')](_0xa885('0xd'),auth['isAuthenticated'](),controller[_0xa885('0xe')]);router[_0xa885('0xf')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x12')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller['update']);router[_0xa885('0x13')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller[_0xa885('0x14')]);module[_0xa885('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 81750f7..571b771 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1950d9,_0x57bbc3){var _0x50c131=function(_0x7a1188){while(--_0x7a1188){_0x1950d9['push'](_0x1950d9['shift']());}};_0x50c131(++_0x57bbc3);}(_0x70e0,0x17b));var _0x070e=function(_0x441056,_0xdac0c0){_0x441056=_0x441056-0x0;var _0x4f8730=_0x70e0[_0x441056];return _0x4f8730;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x14bbb3,_0x223cd9){var _0x4e3e07=function(_0x2a489f){while(--_0x2a489f){_0x14bbb3['push'](_0x14bbb3['shift']());}};_0x4e3e07(++_0x223cd9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xf3cd[_0x4154a6];return _0x3b2786;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9e224ba..458e698 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 _0x3508=['offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SmsTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','describe','fast-json-patch','request-promise','moment','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x2142ea,_0x5a8f39){var _0x53e2a9=function(_0xd6a441){while(--_0xd6a441){_0x2142ea['push'](_0x2142ea['shift']());}};_0x53e2a9(++_0x5a8f39);}(_0x3508,0x75));var _0x8350=function(_0x51f950,_0x3ecf51){_0x51f950=_0x51f950-0x0;var _0x3941d9=_0x3508[_0x51f950];return _0x3941d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8350('0x0'));var rp=require(_0x8350('0x1'));var moment=require(_0x8350('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8350('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x8350('0x4'));var ejs=require(_0x8350('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8350('0x6'));var crypto=require('crypto');var jsforce=require(_0x8350('0x7'));var deskjs=require(_0x8350('0x8'));var toCsv=require(_0x8350('0x4'));var querystring=require(_0x8350('0x9'));var Papa=require(_0x8350('0xa'));var Redis=require(_0x8350('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8350('0xc'));var hardwareService=require(_0x8350('0xd'));var logger=require('../../config/logger')(_0x8350('0xe'));var utils=require(_0x8350('0xf'));var config=require(_0x8350('0x10'));var licenseUtil=require(_0x8350('0x11'));var db=require(_0x8350('0x12'))['db'];function respondWithStatusCode(_0x49387c,_0x42326a){_0x42326a=_0x42326a||0xcc;return function(_0x4778b5){if(_0x4778b5){return _0x49387c[_0x8350('0x13')](_0x42326a);}return _0x49387c['status'](_0x42326a)[_0x8350('0x14')]();};}function respondWithResult(_0x237139,_0x1d4a7e){_0x1d4a7e=_0x1d4a7e||0xc8;return function(_0x49ac2a){if(_0x49ac2a){return _0x237139[_0x8350('0x15')](_0x1d4a7e)[_0x8350('0x16')](_0x49ac2a);}};}function respondWithFilteredResult(_0x2fd3d2,_0x81a504){return function(_0x5e56c7){if(_0x5e56c7){var _0x240acd=typeof _0x81a504[_0x8350('0x17')]===_0x8350('0x18')&&typeof _0x81a504['limit']==='undefined';var _0x750c2e=_0x5e56c7['count'];var _0x211ae8=_0x240acd?0x0:_0x81a504[_0x8350('0x17')];var _0x3fcb76=_0x240acd?_0x5e56c7[_0x8350('0x19')]:_0x81a504['offset']+_0x81a504['limit'];var _0x527447;if(_0x3fcb76>=_0x750c2e){_0x3fcb76=_0x750c2e;_0x527447=0xc8;}else{_0x527447=0xce;}_0x2fd3d2[_0x8350('0x15')](_0x527447);return _0x2fd3d2['set'](_0x8350('0x1a'),_0x211ae8+'-'+_0x3fcb76+'/'+_0x750c2e)['json'](_0x5e56c7);}return null;};}function patchUpdates(_0x27e3f1){return function(_0x55fc47){try{jsonpatch[_0x8350('0x1b')](_0x55fc47,_0x27e3f1,!![]);}catch(_0x47a499){return BPromise[_0x8350('0x1c')](_0x47a499);}return _0x55fc47[_0x8350('0x1d')]();};}function saveUpdates(_0x7c3fca,_0x2a3847){return function(_0x445c11){if(_0x445c11){return _0x445c11[_0x8350('0x1e')](_0x7c3fca)[_0x8350('0x1f')](function(_0x510385){return _0x510385;});}return null;};}function removeEntity(_0x197d36,_0x35c17a){return function(_0x134361){if(_0x134361){return _0x134361[_0x8350('0x20')]()['then'](function(){_0x197d36[_0x8350('0x15')](0xcc)[_0x8350('0x14')]();});}};}function handleEntityNotFound(_0x4ba1c7,_0x4434a1){return function(_0x41379b){if(!_0x41379b){_0x4ba1c7[_0x8350('0x13')](0x194);}return _0x41379b;};}function handleError(_0x1f11fc,_0x3cbc6b){_0x3cbc6b=_0x3cbc6b||0x1f4;return function(_0x3487ff){logger[_0x8350('0x21')](_0x3487ff[_0x8350('0x22')]);if(_0x3487ff[_0x8350('0x23')]){delete _0x3487ff[_0x8350('0x23')];}_0x1f11fc[_0x8350('0x15')](_0x3cbc6b)['send'](_0x3487ff);};}exports['index']=function(_0xe6fe77,_0x282c1b){var _0xc9b092={},_0x2c495c={},_0x150148={'count':0x0,'rows':[]};var _0x563cd8=_[_0x8350('0x24')](db[_0x8350('0x25')]['rawAttributes'],function(_0x50c696){return{'name':_0x50c696[_0x8350('0x26')],'type':_0x50c696[_0x8350('0x27')]['key']};});_0x2c495c[_0x8350('0x28')]=_[_0x8350('0x24')](_0x563cd8,_0x8350('0x23'));_0x2c495c[_0x8350('0x29')]=_[_0x8350('0x2a')](_0xe6fe77[_0x8350('0x29')]);_0x2c495c[_0x8350('0x2b')]=_[_0x8350('0x2c')](_0x2c495c['model'],_0x2c495c['query']);_0xc9b092[_0x8350('0x2d')]=_[_0x8350('0x2c')](_0x2c495c[_0x8350('0x28')],qs[_0x8350('0x2e')](_0xe6fe77[_0x8350('0x29')]['fields']));_0xc9b092[_0x8350('0x2d')]=_0xc9b092[_0x8350('0x2d')]['length']?_0xc9b092[_0x8350('0x2d')]:_0x2c495c['model'];if(!_0xe6fe77[_0x8350('0x29')][_0x8350('0x2f')](_0x8350('0x30'))){_0xc9b092[_0x8350('0x31')]=qs['limit'](_0xe6fe77[_0x8350('0x29')]['limit']);_0xc9b092[_0x8350('0x17')]=qs[_0x8350('0x17')](_0xe6fe77['query'][_0x8350('0x17')]);}_0xc9b092[_0x8350('0x32')]=qs[_0x8350('0x33')](_0xe6fe77['query'][_0x8350('0x33')]);_0xc9b092[_0x8350('0x34')]=qs[_0x8350('0x2b')](_[_0x8350('0x35')](_0xe6fe77['query'],_0x2c495c['filters']),_0x563cd8);if(_0xe6fe77[_0x8350('0x29')][_0x8350('0x36')]){_0xc9b092[_0x8350('0x34')]=_[_0x8350('0x37')](_0xc9b092[_0x8350('0x34')],{'$or':_[_0x8350('0x24')](_0x563cd8,function(_0x24d6fa){if(_0x24d6fa['type']!==_0x8350('0x38')){var _0x414080={};_0x414080[_0x24d6fa[_0x8350('0x23')]]={'$like':'%'+_0xe6fe77[_0x8350('0x29')][_0x8350('0x36')]+'%'};return _0x414080;}})});}_0xc9b092=_[_0x8350('0x37')]({},_0xc9b092,_0xe6fe77[_0x8350('0x39')]);var _0x49e15a={'where':_0xc9b092[_0x8350('0x34')]};return db[_0x8350('0x25')]['count'](_0x49e15a)[_0x8350('0x1f')](function(_0x425de5){_0x150148[_0x8350('0x19')]=_0x425de5;if(_0xe6fe77[_0x8350('0x29')]['includeAll']){_0xc9b092['include']=[{'all':!![]}];}return db[_0x8350('0x25')]['findAll'](_0xc9b092);})[_0x8350('0x1f')](function(_0x3aa272){_0x150148[_0x8350('0x3a')]=_0x3aa272;return _0x150148;})[_0x8350('0x1f')](respondWithFilteredResult(_0x282c1b,_0xc9b092))[_0x8350('0x3b')](handleError(_0x282c1b,null));};exports[_0x8350('0x3c')]=function(_0x3f9c89,_0x3a8dd6){var _0x26aef8={'raw':!![],'where':{'id':_0x3f9c89[_0x8350('0x3d')]['id']}},_0x5e94a7={};_0x5e94a7[_0x8350('0x28')]=_['keys'](db[_0x8350('0x25')][_0x8350('0x3e')]);_0x5e94a7[_0x8350('0x29')]=_[_0x8350('0x2a')](_0x3f9c89[_0x8350('0x29')]);_0x5e94a7[_0x8350('0x2b')]=_['intersection'](_0x5e94a7[_0x8350('0x28')],_0x5e94a7[_0x8350('0x29')]);_0x26aef8['attributes']=_[_0x8350('0x2c')](_0x5e94a7['model'],qs[_0x8350('0x2e')](_0x3f9c89[_0x8350('0x29')][_0x8350('0x2e')]));_0x26aef8[_0x8350('0x2d')]=_0x26aef8[_0x8350('0x2d')][_0x8350('0x3f')]?_0x26aef8[_0x8350('0x2d')]:_0x5e94a7[_0x8350('0x28')];if(_0x3f9c89[_0x8350('0x29')][_0x8350('0x40')]){_0x26aef8[_0x8350('0x41')]=[{'all':!![]}];}_0x26aef8=_[_0x8350('0x37')]({},_0x26aef8,_0x3f9c89[_0x8350('0x39')]);return db['SmsTransferReport'][_0x8350('0x42')](_0x26aef8)[_0x8350('0x1f')](handleEntityNotFound(_0x3a8dd6,null))[_0x8350('0x1f')](respondWithResult(_0x3a8dd6,null))[_0x8350('0x3b')](handleError(_0x3a8dd6,null));};exports['create']=function(_0x168ec8,_0x2425d1){return db[_0x8350('0x25')][_0x8350('0x43')](_0x168ec8[_0x8350('0x44')],{})[_0x8350('0x1f')](respondWithResult(_0x2425d1,0xc9))[_0x8350('0x3b')](handleError(_0x2425d1,null));};exports[_0x8350('0x1e')]=function(_0x4bcd83,_0x4d6e5f){if(_0x4bcd83['body']['id']){delete _0x4bcd83[_0x8350('0x44')]['id'];}return db[_0x8350('0x25')][_0x8350('0x42')]({'where':{'id':_0x4bcd83[_0x8350('0x3d')]['id']}})[_0x8350('0x1f')](handleEntityNotFound(_0x4d6e5f,null))[_0x8350('0x1f')](saveUpdates(_0x4bcd83[_0x8350('0x44')],null))[_0x8350('0x1f')](respondWithResult(_0x4d6e5f,null))[_0x8350('0x3b')](handleError(_0x4d6e5f,null));};exports[_0x8350('0x20')]=function(_0x5025eb,_0x5c6564){return db[_0x8350('0x25')][_0x8350('0x42')]({'where':{'id':_0x5025eb[_0x8350('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5c6564,null))[_0x8350('0x1f')](removeEntity(_0x5c6564,null))[_0x8350('0x3b')](handleError(_0x5c6564,null));};exports[_0x8350('0x45')]=function(_0xd0d214,_0x3312ef){return db[_0x8350('0x25')][_0x8350('0x45')]()[_0x8350('0x1f')](respondWithResult(_0x3312ef,null))[_0x8350('0x3b')](handleError(_0x3312ef,null));}; \ No newline at end of file +var _0x7140=['order','sort','where','filters','pick','filter','merge','VIRTUAL','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','SmsTransferReport','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','offset'];(function(_0x178a34,_0x146819){var _0x6c25e8=function(_0x8ec466){while(--_0x8ec466){_0x178a34['push'](_0x178a34['shift']());}};_0x6c25e8(++_0x146819);}(_0x7140,0x14e));var _0x0714=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x7140[_0xb6e2ea];return _0x2a57bb;};'use strict';var emlformat=require(_0x0714('0x0'));var rimraf=require(_0x0714('0x1'));var zipdir=require(_0x0714('0x2'));var jsonpatch=require(_0x0714('0x3'));var rp=require(_0x0714('0x4'));var moment=require(_0x0714('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0714('0x6'));var util=require(_0x0714('0x7'));var path=require(_0x0714('0x8'));var sox=require(_0x0714('0x9'));var csv=require(_0x0714('0xa'));var ejs=require(_0x0714('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0714('0xc'));var squel=require(_0x0714('0xd'));var crypto=require('crypto');var jsforce=require(_0x0714('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0714('0xa'));var querystring=require(_0x0714('0xf'));var Papa=require(_0x0714('0x10'));var Redis=require(_0x0714('0x11'));var authService=require(_0x0714('0x12'));var qs=require(_0x0714('0x13'));var as=require(_0x0714('0x14'));var hardwareService=require(_0x0714('0x15'));var logger=require(_0x0714('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0714('0x17'));var db=require(_0x0714('0x18'))['db'];function respondWithStatusCode(_0x468b9e,_0x10227c){_0x10227c=_0x10227c||0xcc;return function(_0x300e05){if(_0x300e05){return _0x468b9e[_0x0714('0x19')](_0x10227c);}return _0x468b9e[_0x0714('0x1a')](_0x10227c)[_0x0714('0x1b')]();};}function respondWithResult(_0x47f65a,_0x454f78){_0x454f78=_0x454f78||0xc8;return function(_0x3f09df){if(_0x3f09df){return _0x47f65a[_0x0714('0x1a')](_0x454f78)[_0x0714('0x1c')](_0x3f09df);}};}function respondWithFilteredResult(_0x5ca825,_0x3ad3de){return function(_0x40e7a6){if(_0x40e7a6){var _0x29b17a=typeof _0x3ad3de['offset']===_0x0714('0x1d')&&typeof _0x3ad3de['limit']===_0x0714('0x1d');var _0x4675c1=_0x40e7a6[_0x0714('0x1e')];var _0x20a65d=_0x29b17a?0x0:_0x3ad3de['offset'];var _0x27818e=_0x29b17a?_0x40e7a6[_0x0714('0x1e')]:_0x3ad3de['offset']+_0x3ad3de['limit'];var _0x16ae63;if(_0x27818e>=_0x4675c1){_0x27818e=_0x4675c1;_0x16ae63=0xc8;}else{_0x16ae63=0xce;}_0x5ca825[_0x0714('0x1a')](_0x16ae63);return _0x5ca825['set'](_0x0714('0x1f'),_0x20a65d+'-'+_0x27818e+'/'+_0x4675c1)[_0x0714('0x1c')](_0x40e7a6);}return null;};}function patchUpdates(_0x317907){return function(_0xe9d527){try{jsonpatch[_0x0714('0x20')](_0xe9d527,_0x317907,!![]);}catch(_0x5b2e3e){return BPromise[_0x0714('0x21')](_0x5b2e3e);}return _0xe9d527[_0x0714('0x22')]();};}function saveUpdates(_0x418903,_0x4f4f5c){return function(_0x2a27a3){if(_0x2a27a3){return _0x2a27a3[_0x0714('0x23')](_0x418903)['then'](function(_0x161a00){return _0x161a00;});}return null;};}function removeEntity(_0x585605,_0x406286){return function(_0x223392){if(_0x223392){return _0x223392[_0x0714('0x24')]()['then'](function(){_0x585605[_0x0714('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4047f8,_0x5cd953){return function(_0x4e85ae){if(!_0x4e85ae){_0x4047f8['sendStatus'](0x194);}return _0x4e85ae;};}function handleError(_0x2ed6b5,_0x5b2223){_0x5b2223=_0x5b2223||0x1f4;return function(_0x4665d5){logger[_0x0714('0x25')](_0x4665d5['stack']);if(_0x4665d5[_0x0714('0x26')]){delete _0x4665d5['name'];}_0x2ed6b5['status'](_0x5b2223)[_0x0714('0x27')](_0x4665d5);};}exports[_0x0714('0x28')]=function(_0x300a2e,_0x616860){var _0x4c73d6={},_0x521c22={},_0x13af11={'count':0x0,'rows':[]};var _0x154db0=_[_0x0714('0x29')](db[_0x0714('0x2a')]['rawAttributes'],function(_0x881251){return{'name':_0x881251[_0x0714('0x2b')],'type':_0x881251[_0x0714('0x2c')][_0x0714('0x2d')]};});_0x521c22['model']=_[_0x0714('0x29')](_0x154db0,_0x0714('0x26'));_0x521c22[_0x0714('0x2e')]=_[_0x0714('0x2f')](_0x300a2e[_0x0714('0x2e')]);_0x521c22['filters']=_[_0x0714('0x30')](_0x521c22[_0x0714('0x31')],_0x521c22[_0x0714('0x2e')]);_0x4c73d6[_0x0714('0x32')]=_['intersection'](_0x521c22[_0x0714('0x31')],qs[_0x0714('0x33')](_0x300a2e[_0x0714('0x2e')][_0x0714('0x33')]));_0x4c73d6[_0x0714('0x32')]=_0x4c73d6[_0x0714('0x32')]['length']?_0x4c73d6[_0x0714('0x32')]:_0x521c22[_0x0714('0x31')];if(!_0x300a2e[_0x0714('0x2e')][_0x0714('0x34')](_0x0714('0x35'))){_0x4c73d6[_0x0714('0x36')]=qs[_0x0714('0x36')](_0x300a2e[_0x0714('0x2e')][_0x0714('0x36')]);_0x4c73d6[_0x0714('0x37')]=qs[_0x0714('0x37')](_0x300a2e[_0x0714('0x2e')][_0x0714('0x37')]);}_0x4c73d6[_0x0714('0x38')]=qs[_0x0714('0x39')](_0x300a2e['query'][_0x0714('0x39')]);_0x4c73d6[_0x0714('0x3a')]=qs[_0x0714('0x3b')](_[_0x0714('0x3c')](_0x300a2e[_0x0714('0x2e')],_0x521c22[_0x0714('0x3b')]),_0x154db0);if(_0x300a2e[_0x0714('0x2e')][_0x0714('0x3d')]){_0x4c73d6[_0x0714('0x3a')]=_[_0x0714('0x3e')](_0x4c73d6['where'],{'$or':_[_0x0714('0x29')](_0x154db0,function(_0x505b17){if(_0x505b17[_0x0714('0x2c')]!==_0x0714('0x3f')){var _0xe298b9={};_0xe298b9[_0x505b17[_0x0714('0x26')]]={'$like':'%'+_0x300a2e['query'][_0x0714('0x3d')]+'%'};return _0xe298b9;}})});}_0x4c73d6=_[_0x0714('0x3e')]({},_0x4c73d6,_0x300a2e['options']);var _0x2b8e66={'where':_0x4c73d6[_0x0714('0x3a')]};return db[_0x0714('0x2a')][_0x0714('0x1e')](_0x2b8e66)[_0x0714('0x40')](function(_0xb5b9d3){_0x13af11[_0x0714('0x1e')]=_0xb5b9d3;if(_0x300a2e[_0x0714('0x2e')]['includeAll']){_0x4c73d6[_0x0714('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x0714('0x42')](_0x4c73d6);})[_0x0714('0x40')](function(_0x12104e){_0x13af11[_0x0714('0x43')]=_0x12104e;return _0x13af11;})[_0x0714('0x40')](respondWithFilteredResult(_0x616860,_0x4c73d6))[_0x0714('0x44')](handleError(_0x616860,null));};exports[_0x0714('0x45')]=function(_0x11f9e7,_0x18ddff){var _0x5c1188={'raw':!![],'where':{'id':_0x11f9e7[_0x0714('0x46')]['id']}},_0x164e02={};_0x164e02[_0x0714('0x31')]=_[_0x0714('0x2f')](db[_0x0714('0x2a')][_0x0714('0x47')]);_0x164e02[_0x0714('0x2e')]=_[_0x0714('0x2f')](_0x11f9e7[_0x0714('0x2e')]);_0x164e02['filters']=_['intersection'](_0x164e02['model'],_0x164e02[_0x0714('0x2e')]);_0x5c1188[_0x0714('0x32')]=_[_0x0714('0x30')](_0x164e02[_0x0714('0x31')],qs['fields'](_0x11f9e7['query']['fields']));_0x5c1188[_0x0714('0x32')]=_0x5c1188[_0x0714('0x32')]['length']?_0x5c1188[_0x0714('0x32')]:_0x164e02[_0x0714('0x31')];if(_0x11f9e7['query'][_0x0714('0x48')]){_0x5c1188[_0x0714('0x41')]=[{'all':!![]}];}_0x5c1188=_[_0x0714('0x3e')]({},_0x5c1188,_0x11f9e7[_0x0714('0x49')]);return db[_0x0714('0x2a')][_0x0714('0x4a')](_0x5c1188)['then'](handleEntityNotFound(_0x18ddff,null))[_0x0714('0x40')](respondWithResult(_0x18ddff,null))[_0x0714('0x44')](handleError(_0x18ddff,null));};exports['create']=function(_0x47352e,_0x5a1148){return db[_0x0714('0x2a')][_0x0714('0x4b')](_0x47352e[_0x0714('0x4c')],{})[_0x0714('0x40')](respondWithResult(_0x5a1148,0xc9))['catch'](handleError(_0x5a1148,null));};exports[_0x0714('0x23')]=function(_0x4bc1d0,_0x1bf736){if(_0x4bc1d0[_0x0714('0x4c')]['id']){delete _0x4bc1d0[_0x0714('0x4c')]['id'];}return db[_0x0714('0x2a')][_0x0714('0x4a')]({'where':{'id':_0x4bc1d0[_0x0714('0x46')]['id']}})[_0x0714('0x40')](handleEntityNotFound(_0x1bf736,null))[_0x0714('0x40')](saveUpdates(_0x4bc1d0[_0x0714('0x4c')],null))[_0x0714('0x40')](respondWithResult(_0x1bf736,null))[_0x0714('0x44')](handleError(_0x1bf736,null));};exports[_0x0714('0x24')]=function(_0x46b652,_0x8294c){return db[_0x0714('0x2a')][_0x0714('0x4a')]({'where':{'id':_0x46b652[_0x0714('0x46')]['id']}})['then'](handleEntityNotFound(_0x8294c,null))[_0x0714('0x40')](removeEntity(_0x8294c,null))[_0x0714('0x44')](handleError(_0x8294c,null));};exports['describe']=function(_0x319cc4,_0x3d865a){return db[_0x0714('0x2a')][_0x0714('0x4d')]()[_0x0714('0x40')](respondWithResult(_0x3d865a,null))[_0x0714('0x44')](handleError(_0x3d865a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 4ac4a13..af83c17 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 _0x8c77=['exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x1719ce,_0x855181){var _0x2c412c=function(_0x4a21f9){while(--_0x4a21f9){_0x1719ce['push'](_0x1719ce['shift']());}};_0x2c412c(++_0x855181);}(_0x8c77,0x1d6));var _0x78c7=function(_0x2c9099,_0x5bf853){_0x2c9099=_0x2c9099-0x0;var _0x49015b=_0x8c77[_0x2c9099];return _0x49015b;};'use strict';var _=require(_0x78c7('0x0'));var util=require(_0x78c7('0x1'));var logger=require('../../config/logger')(_0x78c7('0x2'));var moment=require(_0x78c7('0x3'));var BPromise=require(_0x78c7('0x4'));var rp=require(_0x78c7('0x5'));var fs=require('fs');var path=require(_0x78c7('0x6'));var rimraf=require(_0x78c7('0x7'));var config=require(_0x78c7('0x8'));var attributes=require(_0x78c7('0x9'));module[_0x78c7('0xa')]=function(_0x575548,_0x42ff20){return _0x575548[_0x78c7('0xb')](_0x78c7('0xc'),attributes,{'tableName':_0x78c7('0xd'),'paranoid':![],'indexes':[{'name':_0x78c7('0xe'),'fields':[_0x78c7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeb1c=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xeb1c,0x185));var _0xceb1=function(_0x4f3283,_0x23d1f7){_0x4f3283=_0x4f3283-0x0;var _0x5aaf73=_0xeb1c[_0x4f3283];return _0x5aaf73;};'use strict';var _=require(_0xceb1('0x0'));var util=require(_0xceb1('0x1'));var logger=require(_0xceb1('0x2'))('api');var moment=require(_0xceb1('0x3'));var BPromise=require('bluebird');var rp=require(_0xceb1('0x4'));var fs=require('fs');var path=require(_0xceb1('0x5'));var rimraf=require(_0xceb1('0x6'));var config=require(_0xceb1('0x7'));var attributes=require(_0xceb1('0x8'));module['exports']=function(_0x19444c,_0x233f05){return _0x19444c[_0xceb1('0x9')](_0xceb1('0xa'),attributes,{'tableName':_0xceb1('0xb'),'paranoid':![],'indexes':[{'name':_0xceb1('0xc'),'fields':[_0xceb1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index bd98f1a..b1431e4 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x1cb9,0x14e));var _0x91cb=function(_0x312989,_0xa36734){_0x312989=_0x312989-0x0;var _0x4f7903=_0x1cb9[_0x312989];return _0x4f7903;};'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')]('SmsTransferReport,\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 +var _0xf006=['code','message','result','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3978e2,_0x654740){var _0x1c833c=function(_0x434dfd){while(--_0x434dfd){_0x3978e2['push'](_0x3978e2['shift']());}};_0x1c833c(++_0x654740);}(_0xf006,0x146));var _0x6f00=function(_0x42255d,_0x7189a){_0x42255d=_0x42255d-0x0;var _0x429b17=_0xf006[_0x42255d];return _0x429b17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f00('0x0'));var BPromise=require(_0x6f00('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f00('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f00('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6f00('0x4'));var jayson=require(_0x6f00('0x5'));var client=jayson[_0x6f00('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c29ff,_0x4f918f,_0x3875fb){return new BPromise(function(_0x3001b1,_0x185728){return client[_0x6f00('0x7')](_0x3c29ff,_0x3875fb)[_0x6f00('0x8')](function(_0x3001c6){logger[_0x6f00('0x9')](_0x6f00('0xa'),_0x4f918f,_0x6f00('0xb'));logger[_0x6f00('0xc')](_0x6f00('0xd'),_0x4f918f,_0x6f00('0xb'),JSON[_0x6f00('0xe')](_0x3001c6));if(_0x3001c6['error']){if(_0x3001c6[_0x6f00('0xf')][_0x6f00('0x10')]===0x1f4){logger[_0x6f00('0xf')](_0x6f00('0xa'),_0x4f918f,_0x3001c6[_0x6f00('0xf')]['message']);return _0x185728(_0x3001c6[_0x6f00('0xf')]['message']);}logger[_0x6f00('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x4f918f,_0x3001c6[_0x6f00('0xf')][_0x6f00('0x11')]);return _0x3001b1(_0x3001c6[_0x6f00('0xf')][_0x6f00('0x11')]);}else{logger[_0x6f00('0x9')](_0x6f00('0xa'),_0x4f918f,_0x6f00('0xb'));_0x3001b1(_0x3001c6[_0x6f00('0x12')][_0x6f00('0x11')]);}})['catch'](function(_0x14b15d){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4f918f,_0x14b15d);_0x185728(_0x14b15d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index a3c2b85..355f357 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 _0x59e6=['put','/:id','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create'];(function(_0x3ee444,_0x86f3d1){var _0x29de3e=function(_0x417b9){while(--_0x417b9){_0x3ee444['push'](_0x3ee444['shift']());}};_0x29de3e(++_0x86f3d1);}(_0x59e6,0x14d));var _0x659e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x59e6[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x659e('0x0'));var path=require(_0x659e('0x1'));var timeout=require(_0x659e('0x2'));var express=require(_0x659e('0x3'));var router=express[_0x659e('0x4')]();var fs_extra=require(_0x659e('0x5'));var auth=require(_0x659e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x659e('0x7'));var controller=require(_0x659e('0x8'));router[_0x659e('0x9')]('/',auth[_0x659e('0xa')](),controller[_0x659e('0xb')]);router['get']('/:id',auth[_0x659e('0xa')](),controller[_0x659e('0xc')]);router[_0x659e('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x659e('0xd')]);var upload=multer({'storage':multer[_0x659e('0xe')]({'destination':function(_0x28c2b4,_0x1b33ba,_0x5ab026){_0x5ab026(null,path[_0x659e('0xf')](config[_0x659e('0x10')],'server/files/sounds/original/'));},'filename':function(_0x453fee,_0x3a5ed1,_0x5a71dc){_0x3a5ed1[_0x659e('0x11')]=_0x3a5ed1[_0x659e('0x11')][_0x659e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a71dc(null,util[_0x659e('0x13')](_0x659e('0x14'),path[_0x659e('0x15')](_0x3a5ed1[_0x659e('0x11')],path[_0x659e('0x16')](_0x3a5ed1[_0x659e('0x11')])),Date[_0x659e('0x17')](),path[_0x659e('0x16')](_0x3a5ed1[_0x659e('0x11')])));}})});router['post']('/',upload[_0x659e('0x18')](_0x659e('0x19')),controller[_0x659e('0x1a')]);router[_0x659e('0x1b')](_0x659e('0x1c'),auth[_0x659e('0xa')](),controller['update']);router[_0x659e('0x1d')](_0x659e('0x1c'),auth[_0x659e('0xa')](),controller[_0x659e('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x266e=['replace','format','basename','extname','now','post','file','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname'];(function(_0x4faa81,_0x54291e){var _0x5a0b20=function(_0x4b59b){while(--_0x4b59b){_0x4faa81['push'](_0x4faa81['shift']());}};_0x5a0b20(++_0x54291e);}(_0x266e,0xac));var _0xe266=function(_0x5f5327,_0x40f4d6){_0x5f5327=_0x5f5327-0x0;var _0x2b244c=_0x266e[_0x5f5327];return _0x2b244c;};'use strict';var multer=require(_0xe266('0x0'));var util=require(_0xe266('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe266('0x2'));var router=express[_0xe266('0x3')]();var fs_extra=require(_0xe266('0x4'));var auth=require(_0xe266('0x5'));var interaction=require(_0xe266('0x6'));var config=require(_0xe266('0x7'));var controller=require(_0xe266('0x8'));router[_0xe266('0x9')]('/',auth[_0xe266('0xa')](),controller[_0xe266('0xb')]);router[_0xe266('0x9')](_0xe266('0xc'),auth['isAuthenticated'](),controller[_0xe266('0xd')]);router[_0xe266('0x9')](_0xe266('0xe'),auth[_0xe266('0xa')](),controller[_0xe266('0xf')]);var upload=multer({'storage':multer[_0xe266('0x10')]({'destination':function(_0x59c942,_0x3f1d30,_0x176617){_0x176617(null,path[_0xe266('0x11')](config['root'],_0xe266('0x12')));},'filename':function(_0x3646d5,_0x24c515,_0x71b8c3){_0x24c515[_0xe266('0x13')]=_0x24c515[_0xe266('0x13')][_0xe266('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x71b8c3(null,util[_0xe266('0x15')]('%s-%s%s',path[_0xe266('0x16')](_0x24c515[_0xe266('0x13')],path[_0xe266('0x17')](_0x24c515[_0xe266('0x13')])),Date[_0xe266('0x18')](),path['extname'](_0x24c515['originalname'])));}})});router[_0xe266('0x19')]('/',upload['single'](_0xe266('0x1a')),controller[_0xe266('0x1b')]);router[_0xe266('0x1c')]('/:id',auth[_0xe266('0xa')](),controller[_0xe266('0x1d')]);router[_0xe266('0x1e')](_0xe266('0xc'),auth[_0xe266('0xa')](),controller[_0xe266('0x1e')]);module[_0xe266('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 35753ed..f0b85de 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 _0x32ef=['STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x3b212d,_0x3f4bc3){var _0x33fca6=function(_0x3e6301){while(--_0x3e6301){_0x3b212d['push'](_0x3b212d['shift']());}};_0x33fca6(++_0x3f4bc3);}(_0x32ef,0x172));var _0xf32e=function(_0x1d031f,_0x45d6cc){_0x1d031f=_0x1d031f-0x0;var _0xcf29fc=_0x32ef[_0x1d031f];return _0xcf29fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf32e('0x0')],'unique':_0xf32e('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf32e('0x0')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xf32e('0x0')]},'original_format':{'type':Sequelize[_0xf32e('0x0')]},'original_duration':{'type':Sequelize[_0xf32e('0x2')]},'original_sampleCount':{'type':Sequelize[_0xf32e('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xf32e('0x3')]},'original_sampleRate':{'type':Sequelize[_0xf32e('0x4')]},'converted_format':{'type':Sequelize[_0xf32e('0x0')]},'converted_duration':{'type':Sequelize[_0xf32e('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xf32e('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xf32e('0x4')]}}; \ No newline at end of file +var _0x737d=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x353e60,_0x1ef3a0){var _0x265da7=function(_0x7553ae){while(--_0x7553ae){_0x353e60['push'](_0x353e60['shift']());}};_0x265da7(++_0x1ef3a0);}(_0x737d,0x8c));var _0xd737=function(_0x50f482,_0x286b89){_0x50f482=_0x50f482-0x0;var _0x12e4cb=_0x737d[_0x50f482];return _0x12e4cb;};'use strict';var Sequelize=require(_0xd737('0x0'));module[_0xd737('0x1')]={'name':{'type':Sequelize[_0xd737('0x2')],'unique':_0xd737('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xd737('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xd737('0x2')]},'original_format':{'type':Sequelize[_0xd737('0x2')]},'original_duration':{'type':Sequelize[_0xd737('0x4')]},'original_sampleCount':{'type':Sequelize[_0xd737('0x5')]},'original_channelCount':{'type':Sequelize[_0xd737('0x6')]},'original_bitRate':{'type':Sequelize[_0xd737('0x5')]},'original_sampleRate':{'type':Sequelize[_0xd737('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xd737('0x5')]},'converted_channelCount':{'type':Sequelize[_0xd737('0x6')]},'converted_bitRate':{'type':Sequelize[_0xd737('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xd737('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index dd686cc..2937c8e 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 _0xaa25=['util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Sound','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','show','params','keys','length','includeAll','find','download','save_name','existsSync','join','root','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','basename','file','originalname','filename','extname','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','src','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','eml-format','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x5d6224,_0x19b5ea){var _0x256667=function(_0x2d813e){while(--_0x2d813e){_0x5d6224['push'](_0x5d6224['shift']());}};_0x256667(++_0x19b5ea);}(_0xaa25,0x7a));var _0x5aa2=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xaa25[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x5aa2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5aa2('0x1'));var jsonpatch=require(_0x5aa2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5aa2('0x3'));var Mustache=require(_0x5aa2('0x4'));var util=require(_0x5aa2('0x5'));var path=require(_0x5aa2('0x6'));var sox=require(_0x5aa2('0x7'));var csv=require(_0x5aa2('0x8'));var ejs=require(_0x5aa2('0x9'));var fs=require('fs');var fs_extra=require(_0x5aa2('0xa'));var _=require('lodash');var squel=require(_0x5aa2('0xb'));var crypto=require('crypto');var jsforce=require(_0x5aa2('0xc'));var deskjs=require(_0x5aa2('0xd'));var toCsv=require(_0x5aa2('0x8'));var querystring=require(_0x5aa2('0xe'));var Papa=require(_0x5aa2('0xf'));var Redis=require(_0x5aa2('0x10'));var authService=require(_0x5aa2('0x11'));var qs=require(_0x5aa2('0x12'));var as=require(_0x5aa2('0x13'));var hardwareService=require(_0x5aa2('0x14'));var logger=require(_0x5aa2('0x15'))(_0x5aa2('0x16'));var utils=require(_0x5aa2('0x17'));var config=require(_0x5aa2('0x18'));var licenseUtil=require(_0x5aa2('0x19'));var db=require(_0x5aa2('0x1a'))['db'];function respondWithStatusCode(_0x3f6819,_0x568fff){_0x568fff=_0x568fff||0xcc;return function(_0x2504d4){if(_0x2504d4){return _0x3f6819[_0x5aa2('0x1b')](_0x568fff);}return _0x3f6819[_0x5aa2('0x1c')](_0x568fff)[_0x5aa2('0x1d')]();};}function respondWithResult(_0x111f7a,_0x47ca93){_0x47ca93=_0x47ca93||0xc8;return function(_0x45d446){if(_0x45d446){return _0x111f7a[_0x5aa2('0x1c')](_0x47ca93)[_0x5aa2('0x1e')](_0x45d446);}};}function respondWithFilteredResult(_0x15957,_0x5314b6){return function(_0xde08cb){if(_0xde08cb){var _0x2d344f=typeof _0x5314b6[_0x5aa2('0x1f')]===_0x5aa2('0x20')&&typeof _0x5314b6[_0x5aa2('0x21')]==='undefined';var _0x25d7d8=_0xde08cb['count'];var _0x2d228a=_0x2d344f?0x0:_0x5314b6[_0x5aa2('0x1f')];var _0x4e3d74=_0x2d344f?_0xde08cb['count']:_0x5314b6['offset']+_0x5314b6['limit'];var _0x2daa10;if(_0x4e3d74>=_0x25d7d8){_0x4e3d74=_0x25d7d8;_0x2daa10=0xc8;}else{_0x2daa10=0xce;}_0x15957[_0x5aa2('0x1c')](_0x2daa10);return _0x15957[_0x5aa2('0x22')](_0x5aa2('0x23'),_0x2d228a+'-'+_0x4e3d74+'/'+_0x25d7d8)[_0x5aa2('0x1e')](_0xde08cb);}return null;};}function patchUpdates(_0x516b26){return function(_0x3ab7c7){try{jsonpatch[_0x5aa2('0x24')](_0x3ab7c7,_0x516b26,!![]);}catch(_0x1fc998){return BPromise[_0x5aa2('0x25')](_0x1fc998);}return _0x3ab7c7[_0x5aa2('0x26')]();};}function saveUpdates(_0x443f14,_0x1b6077){return function(_0x5245cb){if(_0x5245cb){return _0x5245cb[_0x5aa2('0x27')](_0x443f14)[_0x5aa2('0x28')](function(_0x473c5c){return _0x473c5c;});}return null;};}function removeEntity(_0x4da59b,_0x2c44fc){return function(_0x21e8e5){if(_0x21e8e5){return _0x21e8e5[_0x5aa2('0x29')]()['then'](function(){var _0x3c3b72=_0x21e8e5[_0x5aa2('0x2a')]({'plain':!![]});var _0x4bdf63='Sounds';return db['UserProfileResource'][_0x5aa2('0x29')]({'where':{'type':_0x4bdf63,'resourceId':_0x3c3b72['id']}})[_0x5aa2('0x28')](function(){return _0x21e8e5;});})[_0x5aa2('0x28')](function(){_0x4da59b[_0x5aa2('0x1c')](0xcc)[_0x5aa2('0x1d')]();});}};}function handleEntityNotFound(_0x2227d7,_0x4e958a){return function(_0x439975){if(!_0x439975){_0x2227d7[_0x5aa2('0x1b')](0x194);}return _0x439975;};}function handleError(_0x1eb3fa,_0x34205e){_0x34205e=_0x34205e||0x1f4;return function(_0x26da04){logger[_0x5aa2('0x2b')](_0x26da04[_0x5aa2('0x2c')]);if(_0x26da04[_0x5aa2('0x2d')]){delete _0x26da04[_0x5aa2('0x2d')];}_0x1eb3fa[_0x5aa2('0x1c')](_0x34205e)[_0x5aa2('0x2e')](_0x26da04);};}exports[_0x5aa2('0x2f')]=function(_0x3f27d8,_0x2b0d2c){var _0x5a34c3={},_0x5eda9c={},_0xd996f3={'count':0x0,'rows':[]};var _0x2cefbc=_[_0x5aa2('0x30')](db[_0x5aa2('0x31')][_0x5aa2('0x32')],function(_0x5560a9){return{'name':_0x5560a9['fieldName'],'type':_0x5560a9[_0x5aa2('0x33')][_0x5aa2('0x34')]};});_0x5eda9c['model']=_['map'](_0x2cefbc,_0x5aa2('0x2d'));_0x5eda9c[_0x5aa2('0x35')]=_['keys'](_0x3f27d8[_0x5aa2('0x35')]);_0x5eda9c[_0x5aa2('0x36')]=_[_0x5aa2('0x37')](_0x5eda9c[_0x5aa2('0x38')],_0x5eda9c[_0x5aa2('0x35')]);_0x5a34c3['attributes']=_[_0x5aa2('0x37')](_0x5eda9c[_0x5aa2('0x38')],qs['fields'](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x39')]));_0x5a34c3[_0x5aa2('0x3a')]=_0x5a34c3[_0x5aa2('0x3a')]['length']?_0x5a34c3['attributes']:_0x5eda9c[_0x5aa2('0x38')];if(!_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x3b')](_0x5aa2('0x3c'))){_0x5a34c3[_0x5aa2('0x21')]=qs[_0x5aa2('0x21')](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x21')]);_0x5a34c3[_0x5aa2('0x1f')]=qs[_0x5aa2('0x1f')](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x1f')]);}_0x5a34c3[_0x5aa2('0x3d')]=qs[_0x5aa2('0x3e')](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x3e')]);_0x5a34c3[_0x5aa2('0x3f')]=qs[_0x5aa2('0x36')](_[_0x5aa2('0x40')](_0x3f27d8['query'],_0x5eda9c[_0x5aa2('0x36')]),_0x2cefbc);if(_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x41')]){_0x5a34c3[_0x5aa2('0x3f')]=_[_0x5aa2('0x42')](_0x5a34c3['where'],{'$or':_[_0x5aa2('0x30')](_0x2cefbc,function(_0x404d70){if(_0x404d70[_0x5aa2('0x33')]!==_0x5aa2('0x43')){var _0x55687e={};_0x55687e[_0x404d70[_0x5aa2('0x2d')]]={'$like':'%'+_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x41')]+'%'};return _0x55687e;}})});}_0x5a34c3=_[_0x5aa2('0x42')]({},_0x5a34c3,_0x3f27d8[_0x5aa2('0x44')]);var _0xc3b870={'where':_0x5a34c3[_0x5aa2('0x3f')]};return db[_0x5aa2('0x31')][_0x5aa2('0x45')](_0xc3b870)[_0x5aa2('0x28')](function(_0x1e9b1e){_0xd996f3[_0x5aa2('0x45')]=_0x1e9b1e;if(_0x3f27d8[_0x5aa2('0x35')]['includeAll']){_0x5a34c3[_0x5aa2('0x46')]=[{'all':!![]}];}return db[_0x5aa2('0x31')]['findAll'](_0x5a34c3);})[_0x5aa2('0x28')](function(_0x582a9a){_0xd996f3[_0x5aa2('0x47')]=_0x582a9a;return _0xd996f3;})['then'](respondWithFilteredResult(_0x2b0d2c,_0x5a34c3))[_0x5aa2('0x48')](handleError(_0x2b0d2c,null));};exports[_0x5aa2('0x49')]=function(_0x30ff57,_0x51d85e){var _0x3faedb={'raw':!![],'where':{'id':_0x30ff57[_0x5aa2('0x4a')]['id']}},_0x2886f4={};_0x2886f4[_0x5aa2('0x38')]=_[_0x5aa2('0x4b')](db['Sound'][_0x5aa2('0x32')]);_0x2886f4['query']=_[_0x5aa2('0x4b')](_0x30ff57[_0x5aa2('0x35')]);_0x2886f4[_0x5aa2('0x36')]=_['intersection'](_0x2886f4[_0x5aa2('0x38')],_0x2886f4['query']);_0x3faedb[_0x5aa2('0x3a')]=_['intersection'](_0x2886f4[_0x5aa2('0x38')],qs[_0x5aa2('0x39')](_0x30ff57[_0x5aa2('0x35')][_0x5aa2('0x39')]));_0x3faedb[_0x5aa2('0x3a')]=_0x3faedb['attributes'][_0x5aa2('0x4c')]?_0x3faedb[_0x5aa2('0x3a')]:_0x2886f4[_0x5aa2('0x38')];if(_0x30ff57[_0x5aa2('0x35')][_0x5aa2('0x4d')]){_0x3faedb[_0x5aa2('0x46')]=[{'all':!![]}];}_0x3faedb=_[_0x5aa2('0x42')]({},_0x3faedb,_0x30ff57[_0x5aa2('0x44')]);return db[_0x5aa2('0x31')][_0x5aa2('0x4e')](_0x3faedb)[_0x5aa2('0x28')](handleEntityNotFound(_0x51d85e,null))[_0x5aa2('0x28')](respondWithResult(_0x51d85e,null))[_0x5aa2('0x48')](handleError(_0x51d85e,null));};exports[_0x5aa2('0x4f')]=function(_0x3440cf,_0x8e4889,_0x247bd1){return db[_0x5aa2('0x31')][_0x5aa2('0x4e')]({'where':{'id':_0x3440cf[_0x5aa2('0x4a')]['id']},'attributes':['name',_0x5aa2('0x50'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x8e4889,null))[_0x5aa2('0x28')](function(_0x35340a){if(_0x35340a){if(!fs[_0x5aa2('0x51')](path[_0x5aa2('0x52')](config[_0x5aa2('0x53')],'server/files/sounds/converted',_0x35340a[_0x5aa2('0x50')]+'.'+_0x35340a[_0x5aa2('0x54')]))){throw new db[(_0x5aa2('0x55'))][(_0x5aa2('0x56'))](_0x5aa2('0x57'));}return _0x8e4889[_0x5aa2('0x4f')](path[_0x5aa2('0x52')](config['root'],_0x5aa2('0x58'),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),_0x35340a[_0x5aa2('0x50')],_0x35340a[_0x5aa2('0x54')])),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),_0x35340a['name'],_0x35340a[_0x5aa2('0x54')]));}return null;})[_0x5aa2('0x48')](handleError(_0x8e4889,null));};exports['create']=function(_0x3c16c0,_0x2c7adc,_0x5ee75f){var _0x10e63d={'name':path[_0x5aa2('0x5b')](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5d')],path['extname'](_0x3c16c0[_0x5aa2('0x5c')]['originalname'])),'save_name':path['basename'](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5e')],path[_0x5aa2('0x5f')](_0x3c16c0['file'][_0x5aa2('0x5e')])),'original_format':path[_0x5aa2('0x5f')](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5d')])['substring'](0x1),'converted_format':_0x5aa2('0x60')};var _0x59cc95=path[_0x5aa2('0x52')](config['root'],_0x5aa2('0x61'),_0x3c16c0[_0x5aa2('0x5c')]['filename']);var _0x2147f6=path[_0x5aa2('0x52')](config['root'],_0x5aa2('0x58'),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),path[_0x5aa2('0x5b')](_0x3c16c0['file']['filename'],path['extname'](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5e')])),_0x10e63d[_0x5aa2('0x54')]));logger['info'](_0x5aa2('0x62'),_0x59cc95);logger[_0x5aa2('0x63')](_0x5aa2('0x64'),_0x2147f6);try{fs['chmodSync'](_0x59cc95,parseInt(_0x5aa2('0x65'),0x8));var _0xbe353c=sox['transcode'](_0x59cc95,_0x2147f6,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xbe353c['on'](_0x5aa2('0x2b'),function(_0x4692d7){fs[_0x5aa2('0x66')](_0x59cc95);_0x2c7adc[_0x5aa2('0x1c')](0x1f4)['send'](_0x4692d7);});_0xbe353c['on'](_0x5aa2('0x67'),function(_0x566b69){_0x10e63d['original_duration']=isNaN(_0x566b69['duration'])?null:_0x566b69[_0x5aa2('0x68')]*0x3e8;_0x10e63d['original_sampleCount']=isNaN(_0x566b69['sampleCount'])?null:_0x566b69[_0x5aa2('0x69')];_0x10e63d['original_channelCount']=isNaN(_0x566b69[_0x5aa2('0x6a')])?null:_0x566b69[_0x5aa2('0x6a')];_0x10e63d[_0x5aa2('0x6b')]=isNaN(_0x566b69[_0x5aa2('0x6c')])?null:_0x566b69[_0x5aa2('0x6c')];_0x10e63d[_0x5aa2('0x6d')]=isNaN(_0x566b69[_0x5aa2('0x6e')])?null:_0x566b69[_0x5aa2('0x6e')];});_0xbe353c['on'](_0x5aa2('0x6f'),function(_0x1787f1){_0x10e63d[_0x5aa2('0x70')]=isNaN(_0x1787f1['duration'])?null:_0x1787f1[_0x5aa2('0x68')]*0x3e8;_0x10e63d[_0x5aa2('0x71')]=isNaN(_0x1787f1[_0x5aa2('0x69')])?null:_0x1787f1['sampleCount'];_0x10e63d[_0x5aa2('0x72')]=isNaN(_0x1787f1[_0x5aa2('0x6a')])?null:_0x1787f1[_0x5aa2('0x6a')];_0x10e63d[_0x5aa2('0x73')]=isNaN(_0x1787f1[_0x5aa2('0x6c')])?null:_0x1787f1[_0x5aa2('0x6c')];_0x10e63d[_0x5aa2('0x74')]=isNaN(_0x1787f1[_0x5aa2('0x6e')])?null:_0x1787f1[_0x5aa2('0x6e')];});_0xbe353c['on'](_0x5aa2('0x1d'),function(){fs['chmodSync'](_0x2147f6,parseInt(_0x5aa2('0x65'),0x8));return db['Sound'][_0x5aa2('0x75')](_0x10e63d)[_0x5aa2('0x28')](function(_0x3ac33a){var _0x13d582={'role':_0x3c16c0[_0x5aa2('0x76')]['role'],'userProfileId':_0x3c16c0[_0x5aa2('0x76')][_0x5aa2('0x77')]};if(!_0x13d582)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d582['role']===_0x5aa2('0x78')){var _0x3543f0=_0x3ac33a[_0x5aa2('0x2a')]({'plain':!![]});return db[_0x5aa2('0x79')][_0x5aa2('0x4e')]({'where':{'name':'Sounds','userProfileId':_0x13d582[_0x5aa2('0x77')]},'raw':!![]})[_0x5aa2('0x28')](function(_0xab6766){if(_0xab6766&&_0xab6766['autoAssociation']===0x0){return db[_0x5aa2('0x7a')][_0x5aa2('0x75')]({'name':_0x3543f0[_0x5aa2('0x2d')],'resourceId':_0x3543f0['id'],'type':_0xab6766[_0x5aa2('0x2d')],'sectionId':_0xab6766['id']},{})['then'](function(){return _0x3ac33a;});}else{return _0x3ac33a;}})['catch'](function(_0x145157){logger[_0x5aa2('0x2b')](_0x5aa2('0x7b'),_0x145157);throw _0x145157;});}return _0x3ac33a;})['then'](respondWithResult(_0x2c7adc,null))[_0x5aa2('0x48')](handleError(_0x2c7adc,null));});_0xbe353c['start']();}catch(_0x4e3368){_0x2c7adc['status'](0x1f4)[_0x5aa2('0x2e')](_0x4e3368);}};exports[_0x5aa2('0x27')]=function(_0x5d6006,_0x23025a,_0x3057e3){return db[_0x5aa2('0x31')][_0x5aa2('0x4e')]({'where':{'id':_0x5d6006['params']['id']}})[_0x5aa2('0x28')](handleEntityNotFound(_0x23025a,null))[_0x5aa2('0x28')](saveUpdates(_[_0x5aa2('0x40')](_0x5d6006[_0x5aa2('0x76')],['name',_0x5aa2('0x7c')]),null))[_0x5aa2('0x28')](respondWithResult(_0x23025a,null))[_0x5aa2('0x48')](handleError(_0x23025a,null));};exports[_0x5aa2('0x7d')]=function(_0x3d201d,_0xf68432,_0x851332){return db['Sound'][_0x5aa2('0x4e')]({'where':{'id':_0x3d201d[_0x5aa2('0x4a')]['id']}})[_0x5aa2('0x28')](function(_0x3823d6){if(_0x3823d6){return _0x3823d6[_0x5aa2('0x29')]();}})[_0x5aa2('0x28')](function(_0x3d0c34){var _0x1b8123=path['join'](config[_0x5aa2('0x53')],_0x5aa2('0x61'),util['format'](_0x5aa2('0x5a'),_0x3d0c34[_0x5aa2('0x50')],_0x3d0c34[_0x5aa2('0x7e')]));var _0x224843=path[_0x5aa2('0x52')](config[_0x5aa2('0x53')],_0x5aa2('0x58'),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),_0x3d0c34[_0x5aa2('0x50')],_0x3d0c34[_0x5aa2('0x54')]));fs[_0x5aa2('0x66')](_0x1b8123);fs[_0x5aa2('0x66')](_0x224843);return _0x3d0c34;})[_0x5aa2('0x28')](function(_0x5971d2){if(_0x5971d2){return _0xf68432[_0x5aa2('0x1c')](0xcc)[_0x5aa2('0x1d')]();}})[_0x5aa2('0x28')](handleEntityNotFound(_0xf68432,null))[_0x5aa2('0x48')](handleError(_0xf68432,null));}; \ No newline at end of file +var _0xc4b4=['findAll','rows','catch','params','length','find','download','save_name','converted_format','existsSync','join','root','Sequelize','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','originalname','file','basename','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','filter','options','includeAll','include'];(function(_0x5c6289,_0x4a6832){var _0x33fa33=function(_0x247d05){while(--_0x247d05){_0x5c6289['push'](_0x5c6289['shift']());}};_0x33fa33(++_0x4a6832);}(_0xc4b4,0xb6));var _0x4c4b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc4b4[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x4c4b('0x0'));var rimraf=require(_0x4c4b('0x1'));var zipdir=require(_0x4c4b('0x2'));var jsonpatch=require(_0x4c4b('0x3'));var rp=require(_0x4c4b('0x4'));var moment=require(_0x4c4b('0x5'));var BPromise=require(_0x4c4b('0x6'));var Mustache=require('mustache');var util=require(_0x4c4b('0x7'));var path=require(_0x4c4b('0x8'));var sox=require(_0x4c4b('0x9'));var csv=require(_0x4c4b('0xa'));var ejs=require(_0x4c4b('0xb'));var fs=require('fs');var fs_extra=require(_0x4c4b('0xc'));var _=require(_0x4c4b('0xd'));var squel=require(_0x4c4b('0xe'));var crypto=require(_0x4c4b('0xf'));var jsforce=require(_0x4c4b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4c4b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4c4b('0x11'));var authService=require(_0x4c4b('0x12'));var qs=require(_0x4c4b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c4b('0x14'));var utils=require('../../config/utils');var config=require(_0x4c4b('0x15'));var licenseUtil=require(_0x4c4b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x456f62,_0x1051b0){_0x1051b0=_0x1051b0||0xcc;return function(_0x146c14){if(_0x146c14){return _0x456f62[_0x4c4b('0x17')](_0x1051b0);}return _0x456f62[_0x4c4b('0x18')](_0x1051b0)[_0x4c4b('0x19')]();};}function respondWithResult(_0x3acd05,_0x362407){_0x362407=_0x362407||0xc8;return function(_0x46b9a6){if(_0x46b9a6){return _0x3acd05[_0x4c4b('0x18')](_0x362407)[_0x4c4b('0x1a')](_0x46b9a6);}};}function respondWithFilteredResult(_0x3f5f66,_0x29cf7a){return function(_0x427f33){if(_0x427f33){var _0x4bfe98=typeof _0x29cf7a['offset']===_0x4c4b('0x1b')&&typeof _0x29cf7a[_0x4c4b('0x1c')]===_0x4c4b('0x1b');var _0x5f33bf=_0x427f33[_0x4c4b('0x1d')];var _0x1226de=_0x4bfe98?0x0:_0x29cf7a['offset'];var _0x4ec8c8=_0x4bfe98?_0x427f33[_0x4c4b('0x1d')]:_0x29cf7a['offset']+_0x29cf7a[_0x4c4b('0x1c')];var _0x756a34;if(_0x4ec8c8>=_0x5f33bf){_0x4ec8c8=_0x5f33bf;_0x756a34=0xc8;}else{_0x756a34=0xce;}_0x3f5f66[_0x4c4b('0x18')](_0x756a34);return _0x3f5f66[_0x4c4b('0x1e')]('Content-Range',_0x1226de+'-'+_0x4ec8c8+'/'+_0x5f33bf)[_0x4c4b('0x1a')](_0x427f33);}return null;};}function patchUpdates(_0x540472){return function(_0xd749fe){try{jsonpatch[_0x4c4b('0x1f')](_0xd749fe,_0x540472,!![]);}catch(_0x508be5){return BPromise[_0x4c4b('0x20')](_0x508be5);}return _0xd749fe[_0x4c4b('0x21')]();};}function saveUpdates(_0x3dbdfe,_0x396bb5){return function(_0x24f4d9){if(_0x24f4d9){return _0x24f4d9['update'](_0x3dbdfe)[_0x4c4b('0x22')](function(_0x5be70c){return _0x5be70c;});}return null;};}function removeEntity(_0x26a33f,_0x421f89){return function(_0x9e5e95){if(_0x9e5e95){return _0x9e5e95[_0x4c4b('0x23')]()[_0x4c4b('0x22')](function(){var _0x5cbca4=_0x9e5e95[_0x4c4b('0x24')]({'plain':!![]});var _0x5e361c=_0x4c4b('0x25');return db[_0x4c4b('0x26')][_0x4c4b('0x23')]({'where':{'type':_0x5e361c,'resourceId':_0x5cbca4['id']}})['then'](function(){return _0x9e5e95;});})[_0x4c4b('0x22')](function(){_0x26a33f[_0x4c4b('0x18')](0xcc)[_0x4c4b('0x19')]();});}};}function handleEntityNotFound(_0x1c94f6,_0x397566){return function(_0x81a7c3){if(!_0x81a7c3){_0x1c94f6['sendStatus'](0x194);}return _0x81a7c3;};}function handleError(_0x438c48,_0x27ed56){_0x27ed56=_0x27ed56||0x1f4;return function(_0x1065f1){logger['error'](_0x1065f1[_0x4c4b('0x27')]);if(_0x1065f1[_0x4c4b('0x28')]){delete _0x1065f1[_0x4c4b('0x28')];}_0x438c48[_0x4c4b('0x18')](_0x27ed56)[_0x4c4b('0x29')](_0x1065f1);};}exports[_0x4c4b('0x2a')]=function(_0x6d17dd,_0x3f1253){var _0x4288d6={},_0x1c2e0a={},_0x38cf83={'count':0x0,'rows':[]};var _0x53822c=_[_0x4c4b('0x2b')](db[_0x4c4b('0x2c')][_0x4c4b('0x2d')],function(_0xfb9fc2){return{'name':_0xfb9fc2[_0x4c4b('0x2e')],'type':_0xfb9fc2[_0x4c4b('0x2f')][_0x4c4b('0x30')]};});_0x1c2e0a[_0x4c4b('0x31')]=_[_0x4c4b('0x2b')](_0x53822c,_0x4c4b('0x28'));_0x1c2e0a['query']=_[_0x4c4b('0x32')](_0x6d17dd[_0x4c4b('0x33')]);_0x1c2e0a['filters']=_[_0x4c4b('0x34')](_0x1c2e0a[_0x4c4b('0x31')],_0x1c2e0a[_0x4c4b('0x33')]);_0x4288d6[_0x4c4b('0x35')]=_[_0x4c4b('0x34')](_0x1c2e0a[_0x4c4b('0x31')],qs[_0x4c4b('0x36')](_0x6d17dd['query'][_0x4c4b('0x36')]));_0x4288d6[_0x4c4b('0x35')]=_0x4288d6[_0x4c4b('0x35')]['length']?_0x4288d6[_0x4c4b('0x35')]:_0x1c2e0a[_0x4c4b('0x31')];if(!_0x6d17dd[_0x4c4b('0x33')][_0x4c4b('0x37')](_0x4c4b('0x38'))){_0x4288d6[_0x4c4b('0x1c')]=qs[_0x4c4b('0x1c')](_0x6d17dd[_0x4c4b('0x33')][_0x4c4b('0x1c')]);_0x4288d6[_0x4c4b('0x39')]=qs[_0x4c4b('0x39')](_0x6d17dd[_0x4c4b('0x33')][_0x4c4b('0x39')]);}_0x4288d6[_0x4c4b('0x3a')]=qs[_0x4c4b('0x3b')](_0x6d17dd[_0x4c4b('0x33')]['sort']);_0x4288d6[_0x4c4b('0x3c')]=qs['filters'](_[_0x4c4b('0x3d')](_0x6d17dd['query'],_0x1c2e0a[_0x4c4b('0x3e')]),_0x53822c);if(_0x6d17dd[_0x4c4b('0x33')]['filter']){_0x4288d6[_0x4c4b('0x3c')]=_[_0x4c4b('0x3f')](_0x4288d6[_0x4c4b('0x3c')],{'$or':_[_0x4c4b('0x2b')](_0x53822c,function(_0x43ab31){if(_0x43ab31['type']!=='VIRTUAL'){var _0x1248f3={};_0x1248f3[_0x43ab31[_0x4c4b('0x28')]]={'$like':'%'+_0x6d17dd[_0x4c4b('0x33')][_0x4c4b('0x40')]+'%'};return _0x1248f3;}})});}_0x4288d6=_[_0x4c4b('0x3f')]({},_0x4288d6,_0x6d17dd[_0x4c4b('0x41')]);var _0x170c04={'where':_0x4288d6[_0x4c4b('0x3c')]};return db[_0x4c4b('0x2c')][_0x4c4b('0x1d')](_0x170c04)[_0x4c4b('0x22')](function(_0x232508){_0x38cf83['count']=_0x232508;if(_0x6d17dd[_0x4c4b('0x33')][_0x4c4b('0x42')]){_0x4288d6[_0x4c4b('0x43')]=[{'all':!![]}];}return db['Sound'][_0x4c4b('0x44')](_0x4288d6);})[_0x4c4b('0x22')](function(_0x34d785){_0x38cf83[_0x4c4b('0x45')]=_0x34d785;return _0x38cf83;})[_0x4c4b('0x22')](respondWithFilteredResult(_0x3f1253,_0x4288d6))[_0x4c4b('0x46')](handleError(_0x3f1253,null));};exports['show']=function(_0x360459,_0xaa0dc1){var _0x49d964={'raw':!![],'where':{'id':_0x360459[_0x4c4b('0x47')]['id']}},_0x2798fc={};_0x2798fc[_0x4c4b('0x31')]=_[_0x4c4b('0x32')](db[_0x4c4b('0x2c')][_0x4c4b('0x2d')]);_0x2798fc[_0x4c4b('0x33')]=_[_0x4c4b('0x32')](_0x360459[_0x4c4b('0x33')]);_0x2798fc[_0x4c4b('0x3e')]=_['intersection'](_0x2798fc[_0x4c4b('0x31')],_0x2798fc[_0x4c4b('0x33')]);_0x49d964[_0x4c4b('0x35')]=_[_0x4c4b('0x34')](_0x2798fc[_0x4c4b('0x31')],qs[_0x4c4b('0x36')](_0x360459[_0x4c4b('0x33')][_0x4c4b('0x36')]));_0x49d964[_0x4c4b('0x35')]=_0x49d964[_0x4c4b('0x35')][_0x4c4b('0x48')]?_0x49d964[_0x4c4b('0x35')]:_0x2798fc[_0x4c4b('0x31')];if(_0x360459[_0x4c4b('0x33')][_0x4c4b('0x42')]){_0x49d964[_0x4c4b('0x43')]=[{'all':!![]}];}_0x49d964=_[_0x4c4b('0x3f')]({},_0x49d964,_0x360459[_0x4c4b('0x41')]);return db[_0x4c4b('0x2c')][_0x4c4b('0x49')](_0x49d964)['then'](handleEntityNotFound(_0xaa0dc1,null))['then'](respondWithResult(_0xaa0dc1,null))[_0x4c4b('0x46')](handleError(_0xaa0dc1,null));};exports[_0x4c4b('0x4a')]=function(_0x24907f,_0x10951b,_0x33980f){return db[_0x4c4b('0x2c')][_0x4c4b('0x49')]({'where':{'id':_0x24907f[_0x4c4b('0x47')]['id']},'attributes':[_0x4c4b('0x28'),_0x4c4b('0x4b'),_0x4c4b('0x4c')],'raw':!![]})[_0x4c4b('0x22')](handleEntityNotFound(_0x10951b,null))[_0x4c4b('0x22')](function(_0x3778fb){if(_0x3778fb){if(!fs[_0x4c4b('0x4d')](path[_0x4c4b('0x4e')](config[_0x4c4b('0x4f')],'server/files/sounds/converted',_0x3778fb[_0x4c4b('0x4b')]+'.'+_0x3778fb[_0x4c4b('0x4c')]))){throw new db[(_0x4c4b('0x50'))]['ValidationError'](_0x4c4b('0x51'));}return _0x10951b[_0x4c4b('0x4a')](path['join'](config[_0x4c4b('0x4f')],_0x4c4b('0x52'),util[_0x4c4b('0x53')]('%s.%s',_0x3778fb['save_name'],_0x3778fb[_0x4c4b('0x4c')])),util[_0x4c4b('0x53')](_0x4c4b('0x54'),_0x3778fb[_0x4c4b('0x28')],_0x3778fb['converted_format']));}return null;})[_0x4c4b('0x46')](handleError(_0x10951b,null));};exports[_0x4c4b('0x55')]=function(_0x2295d8,_0xc090d8,_0x3370ce){var _0x3b0fa3={'name':path['basename'](_0x2295d8['file'][_0x4c4b('0x56')],path['extname'](_0x2295d8[_0x4c4b('0x57')][_0x4c4b('0x56')])),'save_name':path[_0x4c4b('0x58')](_0x2295d8[_0x4c4b('0x57')][_0x4c4b('0x59')],path[_0x4c4b('0x5a')](_0x2295d8['file'][_0x4c4b('0x59')])),'original_format':path[_0x4c4b('0x5a')](_0x2295d8[_0x4c4b('0x57')][_0x4c4b('0x56')])[_0x4c4b('0x5b')](0x1),'converted_format':_0x4c4b('0x5c')};var _0x1d4134=path['join'](config[_0x4c4b('0x4f')],_0x4c4b('0x5d'),_0x2295d8['file']['filename']);var _0x3d3b7f=path[_0x4c4b('0x4e')](config['root'],_0x4c4b('0x52'),util[_0x4c4b('0x53')]('%s.%s',path[_0x4c4b('0x58')](_0x2295d8[_0x4c4b('0x57')][_0x4c4b('0x59')],path[_0x4c4b('0x5a')](_0x2295d8['file'][_0x4c4b('0x59')])),_0x3b0fa3[_0x4c4b('0x4c')]));logger[_0x4c4b('0x5e')](_0x4c4b('0x5f'),_0x1d4134);logger[_0x4c4b('0x5e')]('Sound\x20upload\x20destination:\x20%s',_0x3d3b7f);try{fs[_0x4c4b('0x60')](_0x1d4134,parseInt(_0x4c4b('0x61'),0x8));var _0x4178f9=sox[_0x4c4b('0x62')](_0x1d4134,_0x3d3b7f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4178f9['on'](_0x4c4b('0x63'),function(_0x140309){fs[_0x4c4b('0x64')](_0x1d4134);_0xc090d8[_0x4c4b('0x18')](0x1f4)[_0x4c4b('0x29')](_0x140309);});_0x4178f9['on'](_0x4c4b('0x65'),function(_0x2aa255){_0x3b0fa3[_0x4c4b('0x66')]=isNaN(_0x2aa255['duration'])?null:_0x2aa255[_0x4c4b('0x67')]*0x3e8;_0x3b0fa3['original_sampleCount']=isNaN(_0x2aa255[_0x4c4b('0x68')])?null:_0x2aa255[_0x4c4b('0x68')];_0x3b0fa3['original_channelCount']=isNaN(_0x2aa255[_0x4c4b('0x69')])?null:_0x2aa255[_0x4c4b('0x69')];_0x3b0fa3[_0x4c4b('0x6a')]=isNaN(_0x2aa255[_0x4c4b('0x6b')])?null:_0x2aa255['bitRate'];_0x3b0fa3[_0x4c4b('0x6c')]=isNaN(_0x2aa255[_0x4c4b('0x6d')])?null:_0x2aa255[_0x4c4b('0x6d')];});_0x4178f9['on'](_0x4c4b('0x6e'),function(_0x4d86f4){_0x3b0fa3[_0x4c4b('0x6f')]=isNaN(_0x4d86f4[_0x4c4b('0x67')])?null:_0x4d86f4[_0x4c4b('0x67')]*0x3e8;_0x3b0fa3['converted_sampleCount']=isNaN(_0x4d86f4['sampleCount'])?null:_0x4d86f4[_0x4c4b('0x68')];_0x3b0fa3[_0x4c4b('0x70')]=isNaN(_0x4d86f4['channelCount'])?null:_0x4d86f4[_0x4c4b('0x69')];_0x3b0fa3[_0x4c4b('0x71')]=isNaN(_0x4d86f4['bitRate'])?null:_0x4d86f4[_0x4c4b('0x6b')];_0x3b0fa3[_0x4c4b('0x72')]=isNaN(_0x4d86f4[_0x4c4b('0x6d')])?null:_0x4d86f4[_0x4c4b('0x6d')];});_0x4178f9['on'](_0x4c4b('0x19'),function(){fs[_0x4c4b('0x60')](_0x3d3b7f,parseInt(_0x4c4b('0x61'),0x8));return db[_0x4c4b('0x2c')][_0x4c4b('0x55')](_0x3b0fa3)[_0x4c4b('0x22')](function(_0x589010){var _0x54144a={'role':_0x2295d8['body'][_0x4c4b('0x73')],'userProfileId':_0x2295d8[_0x4c4b('0x74')]['userProfileId']};if(!_0x54144a)throw new Error(_0x4c4b('0x75'));if(_0x54144a[_0x4c4b('0x73')]===_0x4c4b('0x76')){var _0x91141c=_0x589010[_0x4c4b('0x24')]({'plain':!![]});return db[_0x4c4b('0x77')][_0x4c4b('0x49')]({'where':{'name':'Sounds','userProfileId':_0x54144a[_0x4c4b('0x78')]},'raw':!![]})[_0x4c4b('0x22')](function(_0x1f4955){if(_0x1f4955&&_0x1f4955['autoAssociation']===0x0){return db['UserProfileResource'][_0x4c4b('0x55')]({'name':_0x91141c[_0x4c4b('0x28')],'resourceId':_0x91141c['id'],'type':_0x1f4955['name'],'sectionId':_0x1f4955['id']},{})[_0x4c4b('0x22')](function(){return _0x589010;});}else{return _0x589010;}})[_0x4c4b('0x46')](function(_0x27fbc4){logger[_0x4c4b('0x63')](_0x4c4b('0x79'),_0x27fbc4);throw _0x27fbc4;});}return _0x589010;})[_0x4c4b('0x22')](respondWithResult(_0xc090d8,null))[_0x4c4b('0x46')](handleError(_0xc090d8,null));});_0x4178f9[_0x4c4b('0x7a')]();}catch(_0x213cfb){_0xc090d8[_0x4c4b('0x18')](0x1f4)[_0x4c4b('0x29')](_0x213cfb);}};exports['update']=function(_0x4bff34,_0x4d58f7,_0x46c2b8){return db['Sound'][_0x4c4b('0x49')]({'where':{'id':_0x4bff34[_0x4c4b('0x47')]['id']}})[_0x4c4b('0x22')](handleEntityNotFound(_0x4d58f7,null))['then'](saveUpdates(_[_0x4c4b('0x3d')](_0x4bff34[_0x4c4b('0x74')],[_0x4c4b('0x28'),_0x4c4b('0x7b')]),null))['then'](respondWithResult(_0x4d58f7,null))[_0x4c4b('0x46')](handleError(_0x4d58f7,null));};exports['delete']=function(_0xdf9e73,_0x41fa70,_0x532590){return db[_0x4c4b('0x2c')][_0x4c4b('0x49')]({'where':{'id':_0xdf9e73['params']['id']}})[_0x4c4b('0x22')](function(_0x27d7d7){if(_0x27d7d7){return _0x27d7d7[_0x4c4b('0x23')]();}})[_0x4c4b('0x22')](function(_0x235808){var _0x1cefeb=path[_0x4c4b('0x4e')](config['root'],_0x4c4b('0x5d'),util[_0x4c4b('0x53')](_0x4c4b('0x54'),_0x235808[_0x4c4b('0x4b')],_0x235808[_0x4c4b('0x7c')]));var _0xecbe4a=path['join'](config['root'],_0x4c4b('0x52'),util[_0x4c4b('0x53')](_0x4c4b('0x54'),_0x235808[_0x4c4b('0x4b')],_0x235808[_0x4c4b('0x4c')]));fs[_0x4c4b('0x64')](_0x1cefeb);fs[_0x4c4b('0x64')](_0xecbe4a);return _0x235808;})[_0x4c4b('0x22')](function(_0x56a128){if(_0x56a128){return _0x41fa70[_0x4c4b('0x18')](0xcc)[_0x4c4b('0x19')]();}})['then'](handleEntityNotFound(_0x41fa70,null))[_0x4c4b('0x46')](handleError(_0x41fa70,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 6131a22..efe67e8 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 _0x1ae9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Sound','tools_sounds','lodash','../../config/logger','api'];(function(_0x1a4801,_0x55f4fd){var _0x5654f6=function(_0x3e0a26){while(--_0x3e0a26){_0x1a4801['push'](_0x1a4801['shift']());}};_0x5654f6(++_0x55f4fd);}(_0x1ae9,0x105));var _0x91ae=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x1ae9[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x91ae('0x0'));var util=require('util');var logger=require(_0x91ae('0x1'))(_0x91ae('0x2'));var moment=require(_0x91ae('0x3'));var BPromise=require(_0x91ae('0x4'));var rp=require(_0x91ae('0x5'));var fs=require('fs');var path=require(_0x91ae('0x6'));var rimraf=require(_0x91ae('0x7'));var config=require(_0x91ae('0x8'));var attributes=require('./sound.attributes');module['exports']=function(_0x475420,_0x4d82fc){return _0x475420[_0x91ae('0x9')](_0x91ae('0xa'),attributes,{'tableName':_0x91ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb770=['api','bluebird','request-promise','../../config/environment','define','Sound','tools_sounds','util','../../config/logger'];(function(_0x76fe45,_0x44e73e){var _0x2b820e=function(_0x5971cb){while(--_0x5971cb){_0x76fe45['push'](_0x76fe45['shift']());}};_0x2b820e(++_0x44e73e);}(_0xb770,0x166));var _0x0b77=function(_0x3a11b2,_0xe19490){_0x3a11b2=_0x3a11b2-0x0;var _0x4cc446=_0xb770[_0x3a11b2];return _0x4cc446;};'use strict';var _=require('lodash');var util=require(_0x0b77('0x0'));var logger=require(_0x0b77('0x1'))(_0x0b77('0x2'));var moment=require('moment');var BPromise=require(_0x0b77('0x3'));var rp=require(_0x0b77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0b77('0x5'));var attributes=require('./sound.attributes');module['exports']=function(_0x4b1a02,_0x21aaf4){return _0x4b1a02[_0x0b77('0x6')](_0x0b77('0x7'),attributes,{'tableName':_0x0b77('0x8'),'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 799a9f6..d8e5db7 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 _0x90d1=['client','http','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x90d1,0x17d));var _0x190d=function(_0x31db02,_0x330986){_0x31db02=_0x31db02-0x0;var _0x1b2e55=_0x90d1[_0x31db02];return _0x1b2e55;};'use strict';var _=require(_0x190d('0x0'));var util=require(_0x190d('0x1'));var moment=require(_0x190d('0x2'));var BPromise=require(_0x190d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190d('0x4'));var db=require(_0x190d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x190d('0x6'))(_0x190d('0x7'));var config=require(_0x190d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x190d('0x9')][_0x190d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fddd7,_0x9b6dff,_0x597762){return new BPromise(function(_0x1f867c,_0xd20d17){return client['request'](_0x1fddd7,_0x597762)['then'](function(_0x4a78b4){logger['info'](_0x190d('0xb'),_0x9b6dff,_0x190d('0xc'));logger[_0x190d('0xd')](_0x190d('0xe'),_0x9b6dff,_0x190d('0xc'),JSON[_0x190d('0xf')](_0x4a78b4));if(_0x4a78b4[_0x190d('0x10')]){if(_0x4a78b4[_0x190d('0x10')]['code']===0x1f4){logger['error'](_0x190d('0xb'),_0x9b6dff,_0x4a78b4[_0x190d('0x10')]['message']);return _0xd20d17(_0x4a78b4[_0x190d('0x10')]['message']);}logger[_0x190d('0x10')](_0x190d('0xb'),_0x9b6dff,_0x4a78b4[_0x190d('0x10')][_0x190d('0x11')]);return _0x1f867c(_0x4a78b4[_0x190d('0x10')]['message']);}else{logger['info'](_0x190d('0xb'),_0x9b6dff,_0x190d('0xc'));_0x1f867c(_0x4a78b4[_0x190d('0x12')]['message']);}})[_0x190d('0x13')](function(_0x3c6480){logger['error']('Sound,\x20%s,\x20%s',_0x9b6dff,_0x3c6480);_0xd20d17(_0x3c6480);});});}exports[_0x190d('0x14')]=function(_0x45950e){var _0x741af8=this;return new Promise(function(_0x26e21e,_0x392ba4){return db['Sound'][_0x190d('0x15')]({'raw':_0x45950e[_0x190d('0x16')]?_0x45950e[_0x190d('0x16')][_0x190d('0x17')]===undefined?!![]:![]:!![],'where':_0x45950e[_0x190d('0x16')]?_0x45950e[_0x190d('0x16')][_0x190d('0x18')]||null:null,'attributes':_0x45950e['options']?_0x45950e[_0x190d('0x16')][_0x190d('0x19')]||null:null,'include':_0x45950e[_0x190d('0x16')]?_0x45950e[_0x190d('0x16')][_0x190d('0x1a')]?_[_0x190d('0x1b')](_0x45950e[_0x190d('0x16')][_0x190d('0x1a')],function(_0x14ff92){return{'model':db[_0x14ff92[_0x190d('0x1c')]],'as':_0x14ff92['as'],'attributes':_0x14ff92['attributes'],'include':_0x14ff92[_0x190d('0x1a')]?_[_0x190d('0x1b')](_0x14ff92[_0x190d('0x1a')],function(_0x2933f2){return{'model':db[_0x2933f2[_0x190d('0x1c')]],'as':_0x2933f2['as'],'attributes':_0x2933f2[_0x190d('0x19')],'include':_0x2933f2['include']?_[_0x190d('0x1b')](_0x2933f2[_0x190d('0x1a')],function(_0x682f5b){return{'model':db[_0x682f5b['model']],'as':_0x682f5b['as'],'attributes':_0x682f5b[_0x190d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x116aa1){logger[_0x190d('0x1d')](_0x190d('0x14'),_0x45950e);logger[_0x190d('0xd')](_0x190d('0x14'),_0x45950e,JSON['stringify'](_0x116aa1));_0x26e21e(_0x116aa1);})['catch'](function(_0x43ff82){logger[_0x190d('0x10')](_0x190d('0x14'),_0x43ff82[_0x190d('0x11')],_0x45950e);_0x392ba4(_0x741af8[_0x190d('0x10')](0x1f4,_0x43ff82['message']));});});}; \ No newline at end of file +var _0x6007=['raw','where','attributes','map','include','model','ShowSound','debug','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','result','Sound','find','options'];(function(_0x282101,_0xdb3958){var _0x5b8c2a=function(_0xa53dfe){while(--_0xa53dfe){_0x282101['push'](_0x282101['shift']());}};_0x5b8c2a(++_0xdb3958);}(_0x6007,0x66));var _0x7600=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0x6007[_0x4e0a03];return _0x2478fc;};'use strict';var _=require(_0x7600('0x0'));var util=require(_0x7600('0x1'));var moment=require(_0x7600('0x2'));var BPromise=require(_0x7600('0x3'));var rs=require(_0x7600('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7600('0x5'));var logger=require('../../config/logger')(_0x7600('0x6'));var config=require(_0x7600('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7600('0x8')][_0x7600('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4af4cb,_0x43a120,_0x12aedc){return new BPromise(function(_0x552117,_0x569456){return client[_0x7600('0xa')](_0x4af4cb,_0x12aedc)[_0x7600('0xb')](function(_0x1caf5f){logger[_0x7600('0xc')](_0x7600('0xd'),_0x43a120,_0x7600('0xe'));logger['debug'](_0x7600('0xf'),_0x43a120,'request\x20sent',JSON['stringify'](_0x1caf5f));if(_0x1caf5f[_0x7600('0x10')]){if(_0x1caf5f['error']['code']===0x1f4){logger[_0x7600('0x10')]('Sound,\x20%s,\x20%s',_0x43a120,_0x1caf5f[_0x7600('0x10')][_0x7600('0x11')]);return _0x569456(_0x1caf5f[_0x7600('0x10')]['message']);}logger[_0x7600('0x10')](_0x7600('0xd'),_0x43a120,_0x1caf5f['error'][_0x7600('0x11')]);return _0x552117(_0x1caf5f[_0x7600('0x10')][_0x7600('0x11')]);}else{logger[_0x7600('0xc')](_0x7600('0xd'),_0x43a120,_0x7600('0xe'));_0x552117(_0x1caf5f[_0x7600('0x12')]['message']);}})['catch'](function(_0x3ed9d4){logger[_0x7600('0x10')](_0x7600('0xd'),_0x43a120,_0x3ed9d4);_0x569456(_0x3ed9d4);});});}exports['ShowSound']=function(_0x53dc61){var _0x1d2e8a=this;return new Promise(function(_0x1d723a,_0x381543){return db[_0x7600('0x13')][_0x7600('0x14')]({'raw':_0x53dc61[_0x7600('0x15')]?_0x53dc61[_0x7600('0x15')][_0x7600('0x16')]===undefined?!![]:![]:!![],'where':_0x53dc61['options']?_0x53dc61[_0x7600('0x15')][_0x7600('0x17')]||null:null,'attributes':_0x53dc61[_0x7600('0x15')]?_0x53dc61[_0x7600('0x15')][_0x7600('0x18')]||null:null,'include':_0x53dc61['options']?_0x53dc61[_0x7600('0x15')]['include']?_[_0x7600('0x19')](_0x53dc61[_0x7600('0x15')][_0x7600('0x1a')],function(_0x2dfe9f){return{'model':db[_0x2dfe9f[_0x7600('0x1b')]],'as':_0x2dfe9f['as'],'attributes':_0x2dfe9f[_0x7600('0x18')],'include':_0x2dfe9f['include']?_[_0x7600('0x19')](_0x2dfe9f[_0x7600('0x1a')],function(_0x3fd78d){return{'model':db[_0x3fd78d['model']],'as':_0x3fd78d['as'],'attributes':_0x3fd78d[_0x7600('0x18')],'include':_0x3fd78d[_0x7600('0x1a')]?_[_0x7600('0x19')](_0x3fd78d[_0x7600('0x1a')],function(_0x4fa304){return{'model':db[_0x4fa304[_0x7600('0x1b')]],'as':_0x4fa304['as'],'attributes':_0x4fa304[_0x7600('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7600('0xb')](function(_0x3df22f){logger[_0x7600('0xc')](_0x7600('0x1c'),_0x53dc61);logger[_0x7600('0x1d')](_0x7600('0x1c'),_0x53dc61,JSON[_0x7600('0x1e')](_0x3df22f));_0x1d723a(_0x3df22f);})['catch'](function(_0xf9a692){logger[_0x7600('0x10')](_0x7600('0x1c'),_0xf9a692['message'],_0x53dc61);_0x381543(_0x1d2e8a[_0x7600('0x10')](0x1f4,_0xf9a692[_0x7600('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index c6aa296..6153579 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x2b0690,_0x4f742f){var _0x82be1=function(_0x1e1084){while(--_0x1e1084){_0x2b0690['push'](_0x2b0690['shift']());}};_0x82be1(++_0x4f742f);}(_0xda2d,0x102));var _0xdda2=function(_0x55a12d,_0x258c0f){_0x55a12d=_0x55a12d-0x0;var _0x148fd1=_0xda2d[_0x55a12d];return _0x148fd1;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x47049a,_0x584dfc){var _0x247f2b=function(_0x5783d0){while(--_0x5783d0){_0x47049a['push'](_0x47049a['shift']());}};_0x247f2b(++_0x584dfc);}(_0x14a0,0x8e));var _0x014a=function(_0x4856c7,_0x9c015e){_0x4856c7=_0x4856c7-0x0;var _0x34f2f7=_0x14a0[_0x4856c7];return _0x34f2f7;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 2b18981..3f8be9a 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 _0xfb77=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x4121f4,_0x17312d){var _0x2f369a=function(_0x5ce181){while(--_0x5ce181){_0x4121f4['push'](_0x4121f4['shift']());}};_0x2f369a(++_0x17312d);}(_0xfb77,0x106));var _0x7fb7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xfb77[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7fb7('0x0'));module[_0x7fb7('0x1')]={'uniqueid':{'type':Sequelize[_0x7fb7('0x2')]},'body':{'type':Sequelize[_0x7fb7('0x3')](_0x7fb7('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x7fb7('0x5')]('in','out'),'defaultValue':_0x7fb7('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x065d=['STRING','TEXT','medium','ENUM','sequelize','exports'];(function(_0x3b5964,_0x2f21c4){var _0xbc8296=function(_0x1f0789){while(--_0x1f0789){_0x3b5964['push'](_0x3b5964['shift']());}};_0xbc8296(++_0x2f21c4);}(_0x065d,0xa6));var _0xd065=function(_0x3225e5,_0x2f56e8){_0x3225e5=_0x3225e5-0x0;var _0x39d9d7=_0x065d[_0x3225e5];return _0x39d9d7;};'use strict';var Sequelize=require(_0xd065('0x0'));module[_0xd065('0x1')]={'uniqueid':{'type':Sequelize[_0xd065('0x2')]},'body':{'type':Sequelize[_0xd065('0x3')](_0xd065('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xd065('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xd065('0x2')]},'providerResponse':{'type':Sequelize[_0xd065('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index cbfbea3..67cff0c 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 _0x3da6=['end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','include','rows','params','includeAll','find','catch','create','body','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','sendStatus','status'];(function(_0x5ab192,_0x21a62d){var _0x295f23=function(_0x453997){while(--_0x453997){_0x5ab192['push'](_0x5ab192['shift']());}};_0x295f23(++_0x21a62d);}(_0x3da6,0xc1));var _0x63da=function(_0x391078,_0x411863){_0x391078=_0x391078-0x0;var _0x44895b=_0x3da6[_0x391078];return _0x44895b;};'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'];function respondWithStatusCode(_0x22b0aa,_0x1a228a){_0x1a228a=_0x1a228a||0xcc;return function(_0x30d1bd){if(_0x30d1bd){return _0x22b0aa[_0x63da('0x18')](_0x1a228a);}return _0x22b0aa[_0x63da('0x19')](_0x1a228a)[_0x63da('0x1a')]();};}function respondWithResult(_0x40c5cf,_0x2ad591){_0x2ad591=_0x2ad591||0xc8;return function(_0x37ce36){if(_0x37ce36){return _0x40c5cf[_0x63da('0x19')](_0x2ad591)[_0x63da('0x1b')](_0x37ce36);}};}function respondWithFilteredResult(_0x2173bd,_0x2be621){return function(_0x4e6084){if(_0x4e6084){var _0x48ac11=typeof _0x2be621[_0x63da('0x1c')]==='undefined'&&typeof _0x2be621[_0x63da('0x1d')]===_0x63da('0x1e');var _0x329ef4=_0x4e6084[_0x63da('0x1f')];var _0xaf41cb=_0x48ac11?0x0:_0x2be621['offset'];var _0x8ce2aa=_0x48ac11?_0x4e6084['count']:_0x2be621['offset']+_0x2be621[_0x63da('0x1d')];var _0x4a4cca;if(_0x8ce2aa>=_0x329ef4){_0x8ce2aa=_0x329ef4;_0x4a4cca=0xc8;}else{_0x4a4cca=0xce;}_0x2173bd[_0x63da('0x19')](_0x4a4cca);return _0x2173bd[_0x63da('0x20')](_0x63da('0x21'),_0xaf41cb+'-'+_0x8ce2aa+'/'+_0x329ef4)['json'](_0x4e6084);}return null;};}function patchUpdates(_0xdeeb40){return function(_0x112193){try{jsonpatch['apply'](_0x112193,_0xdeeb40,!![]);}catch(_0x30d5ef){return BPromise[_0x63da('0x22')](_0x30d5ef);}return _0x112193[_0x63da('0x23')]();};}function saveUpdates(_0x24ae30,_0x1e777b){return function(_0x33e5c6){if(_0x33e5c6){return _0x33e5c6[_0x63da('0x24')](_0x24ae30)[_0x63da('0x25')](function(_0x430b35){return _0x430b35;});}return null;};}function removeEntity(_0x524c08,_0x55df4a){return function(_0xef0017){if(_0xef0017){return _0xef0017[_0x63da('0x26')]()[_0x63da('0x25')](function(){_0x524c08[_0x63da('0x19')](0xcc)[_0x63da('0x1a')]();});}};}function handleEntityNotFound(_0x716174,_0x5ebcbb){return function(_0xc44172){if(!_0xc44172){_0x716174[_0x63da('0x18')](0x194);}return _0xc44172;};}function handleError(_0x1a1889,_0x2d8810){_0x2d8810=_0x2d8810||0x1f4;return function(_0x54acd0){logger[_0x63da('0x27')](_0x54acd0[_0x63da('0x28')]);if(_0x54acd0[_0x63da('0x29')]){delete _0x54acd0[_0x63da('0x29')];}_0x1a1889[_0x63da('0x19')](_0x2d8810)[_0x63da('0x2a')](_0x54acd0);};}exports[_0x63da('0x2b')]=function(_0x4b5e64,_0x5a4628){var _0x3c646a={},_0x392617={},_0x3a3d08={'count':0x0,'rows':[]};var _0xdcf3cb=_[_0x63da('0x2c')](db[_0x63da('0x2d')][_0x63da('0x2e')],function(_0x152655){return{'name':_0x152655['fieldName'],'type':_0x152655['type'][_0x63da('0x2f')]};});_0x392617['model']=_[_0x63da('0x2c')](_0xdcf3cb,_0x63da('0x29'));_0x392617[_0x63da('0x30')]=_[_0x63da('0x31')](_0x4b5e64[_0x63da('0x30')]);_0x392617[_0x63da('0x32')]=_[_0x63da('0x33')](_0x392617[_0x63da('0x34')],_0x392617['query']);_0x3c646a['attributes']=_['intersection'](_0x392617[_0x63da('0x34')],qs['fields'](_0x4b5e64['query'][_0x63da('0x35')]));_0x3c646a[_0x63da('0x36')]=_0x3c646a[_0x63da('0x36')][_0x63da('0x37')]?_0x3c646a[_0x63da('0x36')]:_0x392617['model'];if(!_0x4b5e64['query'][_0x63da('0x38')]('nolimit')){_0x3c646a[_0x63da('0x1d')]=qs[_0x63da('0x1d')](_0x4b5e64[_0x63da('0x30')][_0x63da('0x1d')]);_0x3c646a[_0x63da('0x1c')]=qs['offset'](_0x4b5e64['query']['offset']);}_0x3c646a[_0x63da('0x39')]=qs[_0x63da('0x3a')](_0x4b5e64[_0x63da('0x30')][_0x63da('0x3a')]);_0x3c646a['where']=qs['filters'](_[_0x63da('0x3b')](_0x4b5e64[_0x63da('0x30')],_0x392617[_0x63da('0x32')]),_0xdcf3cb);if(_0x4b5e64[_0x63da('0x30')][_0x63da('0x3c')]){_0x3c646a[_0x63da('0x3d')]=_[_0x63da('0x3e')](_0x3c646a['where'],{'$or':_['map'](_0xdcf3cb,function(_0x3af423){if(_0x3af423[_0x63da('0x3f')]!==_0x63da('0x40')){var _0x215d20={};_0x215d20[_0x3af423[_0x63da('0x29')]]={'$like':'%'+_0x4b5e64[_0x63da('0x30')]['filter']+'%'};return _0x215d20;}})});}_0x3c646a=_['merge']({},_0x3c646a,_0x4b5e64['options']);var _0x29c069={'where':_0x3c646a['where']};return db[_0x63da('0x2d')]['count'](_0x29c069)[_0x63da('0x25')](function(_0x19a0cb){_0x3a3d08['count']=_0x19a0cb;if(_0x4b5e64[_0x63da('0x30')]['includeAll']){_0x3c646a[_0x63da('0x41')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x3c646a);})[_0x63da('0x25')](function(_0x5341af){_0x3a3d08[_0x63da('0x42')]=_0x5341af;return _0x3a3d08;})['then'](respondWithFilteredResult(_0x5a4628,_0x3c646a))['catch'](handleError(_0x5a4628,null));};exports['show']=function(_0x31c35c,_0x40d524){var _0x4b6d00={'raw':!![],'where':{'id':_0x31c35c[_0x63da('0x43')]['id']}},_0x5b999c={};_0x5b999c[_0x63da('0x34')]=_[_0x63da('0x31')](db[_0x63da('0x2d')][_0x63da('0x2e')]);_0x5b999c[_0x63da('0x30')]=_[_0x63da('0x31')](_0x31c35c[_0x63da('0x30')]);_0x5b999c[_0x63da('0x32')]=_[_0x63da('0x33')](_0x5b999c[_0x63da('0x34')],_0x5b999c[_0x63da('0x30')]);_0x4b6d00['attributes']=_['intersection'](_0x5b999c['model'],qs[_0x63da('0x35')](_0x31c35c['query'][_0x63da('0x35')]));_0x4b6d00[_0x63da('0x36')]=_0x4b6d00[_0x63da('0x36')][_0x63da('0x37')]?_0x4b6d00[_0x63da('0x36')]:_0x5b999c[_0x63da('0x34')];if(_0x31c35c[_0x63da('0x30')][_0x63da('0x44')]){_0x4b6d00['include']=[{'all':!![]}];}_0x4b6d00=_['merge']({},_0x4b6d00,_0x31c35c['options']);return db[_0x63da('0x2d')][_0x63da('0x45')](_0x4b6d00)[_0x63da('0x25')](handleEntityNotFound(_0x40d524,null))['then'](respondWithResult(_0x40d524,null))[_0x63da('0x46')](handleError(_0x40d524,null));};exports[_0x63da('0x47')]=function(_0xef2ecf,_0x29c9a9){return db[_0x63da('0x2d')][_0x63da('0x47')](_0xef2ecf['body'],{})[_0x63da('0x25')](respondWithResult(_0x29c9a9,0xc9))[_0x63da('0x46')](handleError(_0x29c9a9,null));};exports['update']=function(_0x1be74e,_0x239657){if(_0x1be74e[_0x63da('0x48')]['id']){delete _0x1be74e[_0x63da('0x48')]['id'];}return db[_0x63da('0x2d')][_0x63da('0x45')]({'where':{'id':_0x1be74e['params']['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x239657,null))['then'](saveUpdates(_0x1be74e[_0x63da('0x48')],null))['then'](respondWithResult(_0x239657,null))['catch'](handleError(_0x239657,null));};exports[_0x63da('0x26')]=function(_0x18e42f,_0x5d1dfa){return db[_0x63da('0x2d')]['find']({'where':{'id':_0x18e42f['params']['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x5d1dfa,null))['then'](removeEntity(_0x5d1dfa,null))['catch'](handleError(_0x5d1dfa,null));}; \ No newline at end of file +var _0xae76=['undefined','count','set','Content-Range','apply','reject','save','then','error','name','send','map','SquareMessage','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','update','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit'];(function(_0x2eabcc,_0x2ac89d){var _0x31b802=function(_0x24aa15){while(--_0x24aa15){_0x2eabcc['push'](_0x2eabcc['shift']());}};_0x31b802(++_0x2ac89d);}(_0xae76,0x74));var _0x6ae7=function(_0x2053aa,_0x3df40e){_0x2053aa=_0x2053aa-0x0;var _0x30f5bb=_0xae76[_0x2053aa];return _0x30f5bb;};'use strict';var emlformat=require(_0x6ae7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ae7('0x1'));var jsonpatch=require(_0x6ae7('0x2'));var rp=require('request-promise');var moment=require(_0x6ae7('0x3'));var BPromise=require(_0x6ae7('0x4'));var Mustache=require(_0x6ae7('0x5'));var util=require(_0x6ae7('0x6'));var path=require('path');var sox=require(_0x6ae7('0x7'));var csv=require(_0x6ae7('0x8'));var ejs=require(_0x6ae7('0x9'));var fs=require('fs');var fs_extra=require(_0x6ae7('0xa'));var _=require(_0x6ae7('0xb'));var squel=require('squel');var crypto=require(_0x6ae7('0xc'));var jsforce=require(_0x6ae7('0xd'));var deskjs=require(_0x6ae7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6ae7('0xf'));var authService=require(_0x6ae7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6ae7('0x11'));var hardwareService=require(_0x6ae7('0x12'));var logger=require(_0x6ae7('0x13'))(_0x6ae7('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6ae7('0x15'));var db=require(_0x6ae7('0x16'))['db'];function respondWithStatusCode(_0x541272,_0x1f503c){_0x1f503c=_0x1f503c||0xcc;return function(_0x2f13a6){if(_0x2f13a6){return _0x541272[_0x6ae7('0x17')](_0x1f503c);}return _0x541272[_0x6ae7('0x18')](_0x1f503c)[_0x6ae7('0x19')]();};}function respondWithResult(_0x425cfc,_0x384c33){_0x384c33=_0x384c33||0xc8;return function(_0x2bcd9f){if(_0x2bcd9f){return _0x425cfc[_0x6ae7('0x18')](_0x384c33)['json'](_0x2bcd9f);}};}function respondWithFilteredResult(_0x513725,_0x207d14){return function(_0x194361){if(_0x194361){var _0x565199=typeof _0x207d14[_0x6ae7('0x1a')]==='undefined'&&typeof _0x207d14[_0x6ae7('0x1b')]===_0x6ae7('0x1c');var _0x3e6717=_0x194361[_0x6ae7('0x1d')];var _0x419ed9=_0x565199?0x0:_0x207d14[_0x6ae7('0x1a')];var _0x2aaab2=_0x565199?_0x194361[_0x6ae7('0x1d')]:_0x207d14[_0x6ae7('0x1a')]+_0x207d14['limit'];var _0x2b9e6f;if(_0x2aaab2>=_0x3e6717){_0x2aaab2=_0x3e6717;_0x2b9e6f=0xc8;}else{_0x2b9e6f=0xce;}_0x513725[_0x6ae7('0x18')](_0x2b9e6f);return _0x513725[_0x6ae7('0x1e')](_0x6ae7('0x1f'),_0x419ed9+'-'+_0x2aaab2+'/'+_0x3e6717)['json'](_0x194361);}return null;};}function patchUpdates(_0x215c89){return function(_0x39ad8f){try{jsonpatch[_0x6ae7('0x20')](_0x39ad8f,_0x215c89,!![]);}catch(_0x3eca9f){return BPromise[_0x6ae7('0x21')](_0x3eca9f);}return _0x39ad8f[_0x6ae7('0x22')]();};}function saveUpdates(_0x400b77,_0x4cf99c){return function(_0x420b7d){if(_0x420b7d){return _0x420b7d['update'](_0x400b77)['then'](function(_0x56ef2b){return _0x56ef2b;});}return null;};}function removeEntity(_0x5cc3fc,_0x44ee6b){return function(_0x2caa3c){if(_0x2caa3c){return _0x2caa3c['destroy']()[_0x6ae7('0x23')](function(){_0x5cc3fc['status'](0xcc)[_0x6ae7('0x19')]();});}};}function handleEntityNotFound(_0x5d9952,_0x1219d5){return function(_0x8e2327){if(!_0x8e2327){_0x5d9952[_0x6ae7('0x17')](0x194);}return _0x8e2327;};}function handleError(_0x47db6e,_0x3f5883){_0x3f5883=_0x3f5883||0x1f4;return function(_0x10db0e){logger[_0x6ae7('0x24')](_0x10db0e['stack']);if(_0x10db0e[_0x6ae7('0x25')]){delete _0x10db0e[_0x6ae7('0x25')];}_0x47db6e[_0x6ae7('0x18')](_0x3f5883)[_0x6ae7('0x26')](_0x10db0e);};}exports['index']=function(_0x312345,_0xd21fc2){var _0x41d951={},_0x3a2d12={},_0x70ae2b={'count':0x0,'rows':[]};var _0x2fc513=_[_0x6ae7('0x27')](db[_0x6ae7('0x28')]['rawAttributes'],function(_0x55280e){return{'name':_0x55280e['fieldName'],'type':_0x55280e[_0x6ae7('0x29')][_0x6ae7('0x2a')]};});_0x3a2d12[_0x6ae7('0x2b')]=_[_0x6ae7('0x27')](_0x2fc513,'name');_0x3a2d12[_0x6ae7('0x2c')]=_[_0x6ae7('0x2d')](_0x312345[_0x6ae7('0x2c')]);_0x3a2d12[_0x6ae7('0x2e')]=_['intersection'](_0x3a2d12[_0x6ae7('0x2b')],_0x3a2d12[_0x6ae7('0x2c')]);_0x41d951[_0x6ae7('0x2f')]=_[_0x6ae7('0x30')](_0x3a2d12[_0x6ae7('0x2b')],qs['fields'](_0x312345[_0x6ae7('0x2c')][_0x6ae7('0x31')]));_0x41d951[_0x6ae7('0x2f')]=_0x41d951[_0x6ae7('0x2f')][_0x6ae7('0x32')]?_0x41d951[_0x6ae7('0x2f')]:_0x3a2d12['model'];if(!_0x312345[_0x6ae7('0x2c')][_0x6ae7('0x33')](_0x6ae7('0x34'))){_0x41d951['limit']=qs[_0x6ae7('0x1b')](_0x312345[_0x6ae7('0x2c')]['limit']);_0x41d951[_0x6ae7('0x1a')]=qs[_0x6ae7('0x1a')](_0x312345[_0x6ae7('0x2c')][_0x6ae7('0x1a')]);}_0x41d951[_0x6ae7('0x35')]=qs[_0x6ae7('0x36')](_0x312345[_0x6ae7('0x2c')][_0x6ae7('0x36')]);_0x41d951[_0x6ae7('0x37')]=qs['filters'](_[_0x6ae7('0x38')](_0x312345[_0x6ae7('0x2c')],_0x3a2d12[_0x6ae7('0x2e')]),_0x2fc513);if(_0x312345[_0x6ae7('0x2c')][_0x6ae7('0x39')]){_0x41d951['where']=_[_0x6ae7('0x3a')](_0x41d951[_0x6ae7('0x37')],{'$or':_['map'](_0x2fc513,function(_0x3c77b7){if(_0x3c77b7[_0x6ae7('0x29')]!==_0x6ae7('0x3b')){var _0x1e4b8d={};_0x1e4b8d[_0x3c77b7[_0x6ae7('0x25')]]={'$like':'%'+_0x312345[_0x6ae7('0x2c')][_0x6ae7('0x39')]+'%'};return _0x1e4b8d;}})});}_0x41d951=_[_0x6ae7('0x3a')]({},_0x41d951,_0x312345['options']);var _0x3bc39d={'where':_0x41d951['where']};return db[_0x6ae7('0x28')]['count'](_0x3bc39d)[_0x6ae7('0x23')](function(_0x32719c){_0x70ae2b[_0x6ae7('0x1d')]=_0x32719c;if(_0x312345['query'][_0x6ae7('0x3c')]){_0x41d951[_0x6ae7('0x3d')]=[{'all':!![]}];}return db[_0x6ae7('0x28')][_0x6ae7('0x3e')](_0x41d951);})[_0x6ae7('0x23')](function(_0x438b37){_0x70ae2b['rows']=_0x438b37;return _0x70ae2b;})[_0x6ae7('0x23')](respondWithFilteredResult(_0xd21fc2,_0x41d951))[_0x6ae7('0x3f')](handleError(_0xd21fc2,null));};exports[_0x6ae7('0x40')]=function(_0x1b8e37,_0x32adb4){var _0x33d21f={'raw':!![],'where':{'id':_0x1b8e37[_0x6ae7('0x41')]['id']}},_0x3a8b30={};_0x3a8b30[_0x6ae7('0x2b')]=_[_0x6ae7('0x2d')](db[_0x6ae7('0x28')][_0x6ae7('0x42')]);_0x3a8b30[_0x6ae7('0x2c')]=_[_0x6ae7('0x2d')](_0x1b8e37[_0x6ae7('0x2c')]);_0x3a8b30[_0x6ae7('0x2e')]=_[_0x6ae7('0x30')](_0x3a8b30[_0x6ae7('0x2b')],_0x3a8b30[_0x6ae7('0x2c')]);_0x33d21f[_0x6ae7('0x2f')]=_[_0x6ae7('0x30')](_0x3a8b30[_0x6ae7('0x2b')],qs[_0x6ae7('0x31')](_0x1b8e37['query'][_0x6ae7('0x31')]));_0x33d21f[_0x6ae7('0x2f')]=_0x33d21f[_0x6ae7('0x2f')]['length']?_0x33d21f[_0x6ae7('0x2f')]:_0x3a8b30[_0x6ae7('0x2b')];if(_0x1b8e37[_0x6ae7('0x2c')]['includeAll']){_0x33d21f['include']=[{'all':!![]}];}_0x33d21f=_[_0x6ae7('0x3a')]({},_0x33d21f,_0x1b8e37[_0x6ae7('0x43')]);return db[_0x6ae7('0x28')][_0x6ae7('0x44')](_0x33d21f)[_0x6ae7('0x23')](handleEntityNotFound(_0x32adb4,null))[_0x6ae7('0x23')](respondWithResult(_0x32adb4,null))[_0x6ae7('0x3f')](handleError(_0x32adb4,null));};exports[_0x6ae7('0x45')]=function(_0x14c233,_0x1408e1){return db[_0x6ae7('0x28')][_0x6ae7('0x45')](_0x14c233[_0x6ae7('0x46')],{})['then'](respondWithResult(_0x1408e1,0xc9))[_0x6ae7('0x3f')](handleError(_0x1408e1,null));};exports[_0x6ae7('0x47')]=function(_0x3ca02b,_0x619123){if(_0x3ca02b[_0x6ae7('0x46')]['id']){delete _0x3ca02b['body']['id'];}return db[_0x6ae7('0x28')][_0x6ae7('0x44')]({'where':{'id':_0x3ca02b[_0x6ae7('0x41')]['id']}})[_0x6ae7('0x23')](handleEntityNotFound(_0x619123,null))['then'](saveUpdates(_0x3ca02b['body'],null))[_0x6ae7('0x23')](respondWithResult(_0x619123,null))[_0x6ae7('0x3f')](handleError(_0x619123,null));};exports['destroy']=function(_0x430b07,_0x126bd9){return db[_0x6ae7('0x28')]['find']({'where':{'id':_0x430b07[_0x6ae7('0x41')]['id']}})[_0x6ae7('0x23')](handleEntityNotFound(_0x126bd9,null))[_0x6ae7('0x23')](removeEntity(_0x126bd9,null))[_0x6ae7('0x3f')](handleError(_0x126bd9,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index eda62e8..263794b 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 _0x246b=['api','moment','request-promise','rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash'];(function(_0x4991cb,_0xcfa24f){var _0x861d24=function(_0x51ce09){while(--_0x51ce09){_0x4991cb['push'](_0x4991cb['shift']());}};_0x861d24(++_0xcfa24f);}(_0x246b,0x6d));var _0xb246=function(_0x230246,_0xf93d5e){_0x230246=_0x230246-0x0;var _0x174d3f=_0x246b[_0x230246];return _0x174d3f;};'use strict';var _=require(_0xb246('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb246('0x1'));var moment=require(_0xb246('0x2'));var BPromise=require('bluebird');var rp=require(_0xb246('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb246('0x4'));var config=require('../../config/environment');var attributes=require(_0xb246('0x5'));module[_0xb246('0x6')]=function(_0x448cec,_0x2755d6){return _0x448cec[_0xb246('0x7')](_0xb246('0x8'),attributes,{'tableName':_0xb246('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c08=['moment','request-promise','rimraf','./squareMessage.attributes','exports','define','SquareMessage','util','api'];(function(_0x53788c,_0x45c001){var _0x223c01=function(_0x498358){while(--_0x498358){_0x53788c['push'](_0x53788c['shift']());}};_0x223c01(++_0x45c001);}(_0x5c08,0x115));var _0x85c0=function(_0xb40147,_0x451b88){_0xb40147=_0xb40147-0x0;var _0x10f394=_0x5c08[_0xb40147];return _0x10f394;};'use strict';var _=require('lodash');var util=require(_0x85c0('0x0'));var logger=require('../../config/logger')(_0x85c0('0x1'));var moment=require(_0x85c0('0x2'));var BPromise=require('bluebird');var rp=require(_0x85c0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85c0('0x4'));var config=require('../../config/environment');var attributes=require(_0x85c0('0x5'));module[_0x85c0('0x6')]=function(_0x3fd933,_0x42615c){return _0x3fd933[_0x85c0('0x7')](_0x85c0('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 121bbcc..49d4290 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 _0x8e24=['body','options','raw','then','CreateSquareMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','SquareMessage','create'];(function(_0x1833c3,_0x24d562){var _0x2d0408=function(_0x55ad84){while(--_0x55ad84){_0x1833c3['push'](_0x1833c3['shift']());}};_0x2d0408(++_0x24d562);}(_0x8e24,0x1b8));var _0x48e2=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x8e24[_0x263b0e];return _0x113fee;};'use strict';var _=require('lodash');var util=require(_0x48e2('0x0'));var moment=require(_0x48e2('0x1'));var BPromise=require(_0x48e2('0x2'));var rs=require(_0x48e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48e2('0x4'))['db'];var utils=require(_0x48e2('0x5'));var logger=require(_0x48e2('0x6'))(_0x48e2('0x7'));var config=require(_0x48e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x48e2('0x9')][_0x48e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dece2,_0x3ddfa9,_0x1a48c3){return new BPromise(function(_0x13ec44,_0x3f7c3c){return client['request'](_0x2dece2,_0x1a48c3)['then'](function(_0x9c9838){logger['info']('SquareMessage,\x20%s,\x20%s',_0x3ddfa9,'request\x20sent');logger[_0x48e2('0xb')](_0x48e2('0xc'),_0x3ddfa9,'request\x20sent',JSON[_0x48e2('0xd')](_0x9c9838));if(_0x9c9838[_0x48e2('0xe')]){if(_0x9c9838[_0x48e2('0xe')][_0x48e2('0xf')]===0x1f4){logger[_0x48e2('0xe')](_0x48e2('0x10'),_0x3ddfa9,_0x9c9838[_0x48e2('0xe')][_0x48e2('0x11')]);return _0x3f7c3c(_0x9c9838[_0x48e2('0xe')][_0x48e2('0x11')]);}logger[_0x48e2('0xe')](_0x48e2('0x10'),_0x3ddfa9,_0x9c9838[_0x48e2('0xe')][_0x48e2('0x11')]);return _0x13ec44(_0x9c9838['error'][_0x48e2('0x11')]);}else{logger[_0x48e2('0x12')](_0x48e2('0x10'),_0x3ddfa9,_0x48e2('0x13'));_0x13ec44(_0x9c9838[_0x48e2('0x14')][_0x48e2('0x11')]);}})[_0x48e2('0x15')](function(_0xb6d02d){logger[_0x48e2('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3ddfa9,_0xb6d02d);_0x3f7c3c(_0xb6d02d);});});}exports['CreateSquareMessage']=function(_0x4224c5){var _0x218420=this;return new Promise(function(_0x201054,_0x2bc10b){return db[_0x48e2('0x16')][_0x48e2('0x17')](_0x4224c5[_0x48e2('0x18')],{'raw':_0x4224c5[_0x48e2('0x19')]?_0x4224c5[_0x48e2('0x19')][_0x48e2('0x1a')]===undefined?!![]:![]:!![]})[_0x48e2('0x1b')](function(_0x534372){logger['info'](_0x48e2('0x1c'),_0x4224c5);logger['debug']('CreateSquareMessage',_0x4224c5,JSON[_0x48e2('0xd')](_0x534372));_0x201054(_0x534372);})['catch'](function(_0x4ed94f){logger['error'](_0x48e2('0x1c'),_0x4ed94f[_0x48e2('0x11')],_0x4224c5);_0x2bc10b(_0x218420[_0x48e2('0xe')](0x1f4,_0x4ed94f[_0x48e2('0x11')]));});});}; \ No newline at end of file +var _0x2259=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','result','catch','CreateSquareMessage','SquareMessage','create','options','raw','util','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2259,0xcc));var _0x9225=function(_0x1f887a,_0xd574a2){_0x1f887a=_0x1f887a-0x0;var _0x1369ba=_0x2259[_0x1f887a];return _0x1369ba;};'use strict';var _=require('lodash');var util=require(_0x9225('0x0'));var moment=require('moment');var BPromise=require(_0x9225('0x1'));var rs=require(_0x9225('0x2'));var fs=require('fs');var Redis=require(_0x9225('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9225('0x4'))(_0x9225('0x5'));var config=require(_0x9225('0x6'));var jayson=require(_0x9225('0x7'));var client=jayson[_0x9225('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5368b2,_0x445919,_0x59e7da){return new BPromise(function(_0x51add0,_0x49f6ef){return client['request'](_0x5368b2,_0x59e7da)[_0x9225('0x9')](function(_0x1cee8c){logger['info']('SquareMessage,\x20%s,\x20%s',_0x445919,_0x9225('0xa'));logger[_0x9225('0xb')](_0x9225('0xc'),_0x445919,_0x9225('0xa'),JSON[_0x9225('0xd')](_0x1cee8c));if(_0x1cee8c['error']){if(_0x1cee8c[_0x9225('0xe')][_0x9225('0xf')]===0x1f4){logger[_0x9225('0xe')](_0x9225('0x10'),_0x445919,_0x1cee8c[_0x9225('0xe')][_0x9225('0x11')]);return _0x49f6ef(_0x1cee8c[_0x9225('0xe')][_0x9225('0x11')]);}logger['error'](_0x9225('0x10'),_0x445919,_0x1cee8c[_0x9225('0xe')]['message']);return _0x51add0(_0x1cee8c['error'][_0x9225('0x11')]);}else{logger[_0x9225('0x12')](_0x9225('0x10'),_0x445919,'request\x20sent');_0x51add0(_0x1cee8c[_0x9225('0x13')][_0x9225('0x11')]);}})[_0x9225('0x14')](function(_0x564691){logger[_0x9225('0xe')](_0x9225('0x10'),_0x445919,_0x564691);_0x49f6ef(_0x564691);});});}exports[_0x9225('0x15')]=function(_0x5a32d7){var _0x5b5374=this;return new Promise(function(_0x5e8b20,_0x10775b){return db[_0x9225('0x16')][_0x9225('0x17')](_0x5a32d7['body'],{'raw':_0x5a32d7[_0x9225('0x18')]?_0x5a32d7[_0x9225('0x18')][_0x9225('0x19')]===undefined?!![]:![]:!![]})[_0x9225('0x9')](function(_0x3a6ae){logger[_0x9225('0x12')](_0x9225('0x15'),_0x5a32d7);logger[_0x9225('0xb')](_0x9225('0x15'),_0x5a32d7,JSON[_0x9225('0xd')](_0x3a6ae));_0x5e8b20(_0x3a6ae);})[_0x9225('0x14')](function(_0x2b695c){logger['error'](_0x9225('0x15'),_0x2b695c['message'],_0x5a32d7);_0x10775b(_0x5b5374['error'](0x1f4,_0x2b695c[_0x9225('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 18e03ac..24adedb 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 _0x575e=['isAuthenticated','index','/:id','show','/:id/test','15s','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareOdbc.controller','get'];(function(_0x1cab41,_0x4bfa57){var _0x511deb=function(_0x3d1a43){while(--_0x3d1a43){_0x1cab41['push'](_0x1cab41['shift']());}};_0x511deb(++_0x4bfa57);}(_0x575e,0xbe));var _0xe575=function(_0x3ddb52,_0x7790cf){_0x3ddb52=_0x3ddb52-0x0;var _0x378940=_0x575e[_0x3ddb52];return _0x378940;};'use strict';var multer=require(_0xe575('0x0'));var util=require(_0xe575('0x1'));var path=require(_0xe575('0x2'));var timeout=require(_0xe575('0x3'));var express=require(_0xe575('0x4'));var router=express[_0xe575('0x5')]();var fs_extra=require(_0xe575('0x6'));var auth=require(_0xe575('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe575('0x8'));router[_0xe575('0x9')]('/',auth[_0xe575('0xa')](),controller[_0xe575('0xb')]);router[_0xe575('0x9')](_0xe575('0xc'),auth[_0xe575('0xa')](),controller[_0xe575('0xd')]);router[_0xe575('0x9')](_0xe575('0xe'),auth['isAuthenticated'](),timeout(_0xe575('0xf')),controller['test']);router['post']('/',auth[_0xe575('0xa')](),controller['create']);router[_0xe575('0x10')](_0xe575('0xc'),auth[_0xe575('0xa')](),controller[_0xe575('0x11')]);router[_0xe575('0x12')]('/:id',auth[_0xe575('0xa')](),controller['destroy']);module[_0xe575('0x13')]=router; \ No newline at end of file +var _0x95c3=['./squareOdbc.controller','get','/:id','isAuthenticated','show','/:id/test','test','post','create','update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x36ace3,_0x576ef4){var _0x103317=function(_0x3c7693){while(--_0x3c7693){_0x36ace3['push'](_0x36ace3['shift']());}};_0x103317(++_0x576ef4);}(_0x95c3,0x1ce));var _0x395c=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x95c3[_0x51fe5f];return _0x4abce9;};'use strict';var multer=require('multer');var util=require(_0x395c('0x0'));var path=require('path');var timeout=require(_0x395c('0x1'));var express=require(_0x395c('0x2'));var router=express[_0x395c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x395c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x395c('0x5'));var controller=require(_0x395c('0x6'));router[_0x395c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x395c('0x8'),auth[_0x395c('0x9')](),controller[_0x395c('0xa')]);router['get'](_0x395c('0xb'),auth[_0x395c('0x9')](),timeout('15s'),controller[_0x395c('0xc')]);router[_0x395c('0xd')]('/',auth[_0x395c('0x9')](),controller[_0x395c('0xe')]);router['put'](_0x395c('0x8'),auth[_0x395c('0x9')](),controller[_0x395c('0xf')]);router['delete'](_0x395c('0x8'),auth['isAuthenticated'](),controller[_0x395c('0x10')]);module[_0x395c('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 7ff1975..6353831 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 _0x9243=['STRING','name','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9243,0xee));var _0x3924=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x9243[_0x459423];return _0x42ed14;};'use strict';var Sequelize=require(_0x3924('0x0'));module[_0x3924('0x1')]={'name':{'type':Sequelize[_0x3924('0x2')],'unique':_0x3924('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x3924('0x2')]},'description':{'type':Sequelize[_0x3924('0x2')]}}; \ No newline at end of file +var _0x7d82=['sequelize','exports','STRING','name'];(function(_0x2939dc,_0x39d355){var _0x49336e=function(_0x34c3da){while(--_0x34c3da){_0x2939dc['push'](_0x2939dc['shift']());}};_0x49336e(++_0x39d355);}(_0x7d82,0xf4));var _0x27d8=function(_0x139862,_0x543f75){_0x139862=_0x139862-0x0;var _0xc88202=_0x7d82[_0x139862];return _0xc88202;};'use strict';var Sequelize=require(_0x27d8('0x0'));module[_0x27d8('0x1')]={'name':{'type':Sequelize[_0x27d8('0x2')],'unique':_0x27d8('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x27d8('0x2')]},'description':{'type':Sequelize[_0x27d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 82dcce5..81329c0 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 _0x44df=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','end','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44df,0x137));var _0xf44d=function(_0x282ef5,_0x307335){_0x282ef5=_0x282ef5-0x0;var _0x50755=_0x44df[_0x282ef5];return _0x50755;};'use strict';var emlformat=require(_0xf44d('0x0'));var rimraf=require(_0xf44d('0x1'));var zipdir=require(_0xf44d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf44d('0x3'));var moment=require('moment');var BPromise=require(_0xf44d('0x4'));var Mustache=require(_0xf44d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf44d('0x6'));var csv=require(_0xf44d('0x7'));var ejs=require(_0xf44d('0x8'));var fs=require('fs');var fs_extra=require(_0xf44d('0x9'));var _=require(_0xf44d('0xa'));var squel=require(_0xf44d('0xb'));var crypto=require(_0xf44d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf44d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf44d('0xe'));var Papa=require(_0xf44d('0xf'));var Redis=require(_0xf44d('0x10'));var authService=require(_0xf44d('0x11'));var qs=require(_0xf44d('0x12'));var as=require(_0xf44d('0x13'));var hardwareService=require(_0xf44d('0x14'));var logger=require(_0xf44d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf44d('0x16'));var licenseUtil=require(_0xf44d('0x17'));var db=require(_0xf44d('0x18'))['db'];function respondWithStatusCode(_0x5249b2,_0x4bcb53){_0x4bcb53=_0x4bcb53||0xcc;return function(_0x319f89){if(_0x319f89){return _0x5249b2[_0xf44d('0x19')](_0x4bcb53);}return _0x5249b2[_0xf44d('0x1a')](_0x4bcb53)['end']();};}function respondWithResult(_0x323319,_0x6b25f0){_0x6b25f0=_0x6b25f0||0xc8;return function(_0x15b8ab){if(_0x15b8ab){return _0x323319[_0xf44d('0x1a')](_0x6b25f0)[_0xf44d('0x1b')](_0x15b8ab);}};}function respondWithFilteredResult(_0xc39ad1,_0x43d206){return function(_0x35cf01){if(_0x35cf01){var _0x856084=typeof _0x43d206['offset']===_0xf44d('0x1c')&&typeof _0x43d206[_0xf44d('0x1d')]===_0xf44d('0x1c');var _0x294644=_0x35cf01[_0xf44d('0x1e')];var _0x21f288=_0x856084?0x0:_0x43d206['offset'];var _0x2e1a8e=_0x856084?_0x35cf01['count']:_0x43d206['offset']+_0x43d206[_0xf44d('0x1d')];var _0x37d8ac;if(_0x2e1a8e>=_0x294644){_0x2e1a8e=_0x294644;_0x37d8ac=0xc8;}else{_0x37d8ac=0xce;}_0xc39ad1['status'](_0x37d8ac);return _0xc39ad1[_0xf44d('0x1f')](_0xf44d('0x20'),_0x21f288+'-'+_0x2e1a8e+'/'+_0x294644)[_0xf44d('0x1b')](_0x35cf01);}return null;};}function patchUpdates(_0x3631fb){return function(_0x26e3dc){try{jsonpatch[_0xf44d('0x21')](_0x26e3dc,_0x3631fb,!![]);}catch(_0x177d78){return BPromise[_0xf44d('0x22')](_0x177d78);}return _0x26e3dc[_0xf44d('0x23')]();};}function saveUpdates(_0x66f222,_0x23729b){return function(_0x9b1054){if(_0x9b1054){return _0x9b1054[_0xf44d('0x24')](_0x66f222)[_0xf44d('0x25')](function(_0x4d6886){return _0x4d6886;});}return null;};}function removeEntity(_0x30508f,_0x4abab7){return function(_0x1e6062){if(_0x1e6062){return _0x1e6062['destroy']()[_0xf44d('0x25')](function(){var _0x146094=_0x1e6062[_0xf44d('0x26')]({'plain':!![]});var _0x66612d=_0xf44d('0x27');return db[_0xf44d('0x28')][_0xf44d('0x29')]({'where':{'type':_0x66612d,'resourceId':_0x146094['id']}})[_0xf44d('0x25')](function(){return _0x1e6062;});})['then'](function(){_0x30508f[_0xf44d('0x1a')](0xcc)[_0xf44d('0x2a')]();});}};}function handleEntityNotFound(_0x55dabf,_0x42cbbd){return function(_0x2e7df0){if(!_0x2e7df0){_0x55dabf[_0xf44d('0x19')](0x194);}return _0x2e7df0;};}function handleError(_0x3897b6,_0x25f94e){_0x25f94e=_0x25f94e||0x1f4;return function(_0x5f4b77){logger['error'](_0x5f4b77[_0xf44d('0x2b')]);if(_0x5f4b77[_0xf44d('0x2c')]){delete _0x5f4b77[_0xf44d('0x2c')];}_0x3897b6[_0xf44d('0x1a')](_0x25f94e)[_0xf44d('0x2d')](_0x5f4b77);};}exports[_0xf44d('0x2e')]=function(_0x29461,_0x1c0336){var _0x249acc={},_0x2db625={},_0x1400ec={'count':0x0,'rows':[]};var _0x1f8d93=_[_0xf44d('0x2f')](db[_0xf44d('0x30')][_0xf44d('0x31')],function(_0x126879){return{'name':_0x126879['fieldName'],'type':_0x126879[_0xf44d('0x32')][_0xf44d('0x33')]};});_0x2db625[_0xf44d('0x34')]=_['map'](_0x1f8d93,_0xf44d('0x2c'));_0x2db625[_0xf44d('0x35')]=_[_0xf44d('0x36')](_0x29461[_0xf44d('0x35')]);_0x2db625[_0xf44d('0x37')]=_[_0xf44d('0x38')](_0x2db625[_0xf44d('0x34')],_0x2db625[_0xf44d('0x35')]);_0x249acc[_0xf44d('0x39')]=_[_0xf44d('0x38')](_0x2db625[_0xf44d('0x34')],qs[_0xf44d('0x3a')](_0x29461['query'][_0xf44d('0x3a')]));_0x249acc['attributes']=_0x249acc[_0xf44d('0x39')][_0xf44d('0x3b')]?_0x249acc['attributes']:_0x2db625[_0xf44d('0x34')];if(!_0x29461[_0xf44d('0x35')][_0xf44d('0x3c')](_0xf44d('0x3d'))){_0x249acc[_0xf44d('0x1d')]=qs[_0xf44d('0x1d')](_0x29461[_0xf44d('0x35')][_0xf44d('0x1d')]);_0x249acc[_0xf44d('0x3e')]=qs[_0xf44d('0x3e')](_0x29461['query']['offset']);}_0x249acc['order']=qs['sort'](_0x29461['query']['sort']);_0x249acc[_0xf44d('0x3f')]=qs[_0xf44d('0x37')](_[_0xf44d('0x40')](_0x29461[_0xf44d('0x35')],_0x2db625[_0xf44d('0x37')]),_0x1f8d93);if(_0x29461[_0xf44d('0x35')][_0xf44d('0x41')]){_0x249acc[_0xf44d('0x3f')]=_[_0xf44d('0x42')](_0x249acc['where'],{'$or':_[_0xf44d('0x2f')](_0x1f8d93,function(_0x621e41){if(_0x621e41['type']!=='VIRTUAL'){var _0x10197d={};_0x10197d[_0x621e41['name']]={'$like':'%'+_0x29461[_0xf44d('0x35')][_0xf44d('0x41')]+'%'};return _0x10197d;}})});}_0x249acc=_[_0xf44d('0x42')]({},_0x249acc,_0x29461[_0xf44d('0x43')]);var _0x110b97={'where':_0x249acc[_0xf44d('0x3f')]};return db[_0xf44d('0x30')][_0xf44d('0x1e')](_0x110b97)[_0xf44d('0x25')](function(_0x3b16ce){_0x1400ec[_0xf44d('0x1e')]=_0x3b16ce;if(_0x29461[_0xf44d('0x35')][_0xf44d('0x44')]){_0x249acc['include']=[{'all':!![]}];}return db[_0xf44d('0x30')][_0xf44d('0x45')](_0x249acc);})[_0xf44d('0x25')](function(_0x4f84d2){_0x1400ec[_0xf44d('0x46')]=_0x4f84d2;return _0x1400ec;})[_0xf44d('0x25')](respondWithFilteredResult(_0x1c0336,_0x249acc))[_0xf44d('0x47')](handleError(_0x1c0336,null));};exports[_0xf44d('0x48')]=function(_0xfc1468,_0x5cd6ac){var _0x1440f2={'raw':!![],'where':{'id':_0xfc1468['params']['id']}},_0x5cee31={};_0x5cee31[_0xf44d('0x34')]=_[_0xf44d('0x36')](db[_0xf44d('0x30')][_0xf44d('0x31')]);_0x5cee31['query']=_[_0xf44d('0x36')](_0xfc1468['query']);_0x5cee31[_0xf44d('0x37')]=_[_0xf44d('0x38')](_0x5cee31[_0xf44d('0x34')],_0x5cee31[_0xf44d('0x35')]);_0x1440f2[_0xf44d('0x39')]=_[_0xf44d('0x38')](_0x5cee31['model'],qs['fields'](_0xfc1468[_0xf44d('0x35')]['fields']));_0x1440f2[_0xf44d('0x39')]=_0x1440f2[_0xf44d('0x39')][_0xf44d('0x3b')]?_0x1440f2[_0xf44d('0x39')]:_0x5cee31[_0xf44d('0x34')];if(_0xfc1468[_0xf44d('0x35')][_0xf44d('0x44')]){_0x1440f2[_0xf44d('0x49')]=[{'all':!![]}];}_0x1440f2=_[_0xf44d('0x42')]({},_0x1440f2,_0xfc1468[_0xf44d('0x43')]);return db['SquareOdbc']['find'](_0x1440f2)[_0xf44d('0x25')](handleEntityNotFound(_0x5cd6ac,null))[_0xf44d('0x25')](respondWithResult(_0x5cd6ac,null))['catch'](handleError(_0x5cd6ac,null));};exports[_0xf44d('0x4a')]=function(_0x39bb1b,_0x3bfefb){return db[_0xf44d('0x30')][_0xf44d('0x4a')](_0x39bb1b['body'],{})[_0xf44d('0x25')](function(_0x2eaecb){var _0x4ea7bf=_0x39bb1b[_0xf44d('0x4b')]['get']({'plain':!![]});if(!_0x4ea7bf)throw new Error(_0xf44d('0x4c'));if(_0x4ea7bf[_0xf44d('0x4d')]===_0xf44d('0x4b')){var _0x44aec8=_0x2eaecb['get']({'plain':!![]});var _0x107723=_0xf44d('0x27');return db[_0xf44d('0x4e')][_0xf44d('0x4f')]({'where':{'name':_0x107723,'userProfileId':_0x4ea7bf[_0xf44d('0x50')]},'raw':!![]})[_0xf44d('0x25')](function(_0xdb48fd){if(_0xdb48fd&&_0xdb48fd[_0xf44d('0x51')]===0x0){return db[_0xf44d('0x28')][_0xf44d('0x4a')]({'name':_0x44aec8[_0xf44d('0x2c')],'resourceId':_0x44aec8['id'],'type':_0xdb48fd[_0xf44d('0x2c')],'sectionId':_0xdb48fd['id']},{})[_0xf44d('0x25')](function(){return _0x2eaecb;});}else{return _0x2eaecb;}})[_0xf44d('0x47')](function(_0x2e0890){logger[_0xf44d('0x52')](_0xf44d('0x53'),_0x2e0890);throw _0x2e0890;});}return _0x2eaecb;})['then'](respondWithResult(_0x3bfefb,0xc9))['catch'](handleError(_0x3bfefb,null));};exports[_0xf44d('0x24')]=function(_0x55aace,_0xd97a1a){if(_0x55aace[_0xf44d('0x54')]['id']){delete _0x55aace['body']['id'];}return db[_0xf44d('0x30')][_0xf44d('0x4f')]({'where':{'id':_0x55aace[_0xf44d('0x55')]['id']}})[_0xf44d('0x25')](handleEntityNotFound(_0xd97a1a,null))[_0xf44d('0x25')](saveUpdates(_0x55aace[_0xf44d('0x54')],null))[_0xf44d('0x25')](respondWithResult(_0xd97a1a,null))[_0xf44d('0x47')](handleError(_0xd97a1a,null));};exports[_0xf44d('0x29')]=function(_0x159abc,_0x55aedf){return db['SquareOdbc'][_0xf44d('0x4f')]({'where':{'id':_0x159abc[_0xf44d('0x55')]['id']}})['then'](handleEntityNotFound(_0x55aedf,null))[_0xf44d('0x25')](removeEntity(_0x55aedf,null))[_0xf44d('0x47')](handleError(_0x55aedf,null));};exports[_0xf44d('0x56')]=function(_0x2d7d80,_0x459603,_0x50c6d3){var _0x12d7ad;return db['SquareOdbc'][_0xf44d('0x4f')]({'where':{'id':_0x2d7d80[_0xf44d('0x55')]['id']},'attributes':['id',_0xf44d('0x57')]})['then'](handleEntityNotFound(_0x459603,null))[_0xf44d('0x25')](function(_0x285f48){if(_0x285f48){var _0x54cd42=require(_0xf44d('0x58'))();_0x54cd42[_0xf44d('0x59')](_0x285f48['dsn']);_0x54cd42[_0xf44d('0x5a')]();return _0x285f48;}})[_0xf44d('0x25')](respondWithResult(_0x459603,null))['catch'](handleError(_0x459603,null));}; \ No newline at end of file +var _0x9545=['model','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','ODBC','UserProfileResource','name','send','index','SquareOdbc','fieldName','type','key','query','keys','filters','intersection'];(function(_0x563d30,_0x5b2e47){var _0x3f7ddd=function(_0xe33803){while(--_0xe33803){_0x563d30['push'](_0x563d30['shift']());}};_0x3f7ddd(++_0x5b2e47);}(_0x9545,0x78));var _0x5954=function(_0x4a2fde,_0x190c2f){_0x4a2fde=_0x4a2fde-0x0;var _0x52ab47=_0x9545[_0x4a2fde];return _0x52ab47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5954('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5954('0x1'));var rp=require(_0x5954('0x2'));var moment=require(_0x5954('0x3'));var BPromise=require(_0x5954('0x4'));var Mustache=require('mustache');var util=require(_0x5954('0x5'));var path=require('path');var sox=require(_0x5954('0x6'));var csv=require(_0x5954('0x7'));var ejs=require(_0x5954('0x8'));var fs=require('fs');var fs_extra=require(_0x5954('0x9'));var _=require('lodash');var squel=require(_0x5954('0xa'));var crypto=require(_0x5954('0xb'));var jsforce=require(_0x5954('0xc'));var deskjs=require(_0x5954('0xd'));var toCsv=require(_0x5954('0x7'));var querystring=require(_0x5954('0xe'));var Papa=require(_0x5954('0xf'));var Redis=require('ioredis');var authService=require(_0x5954('0x10'));var qs=require(_0x5954('0x11'));var as=require(_0x5954('0x12'));var hardwareService=require(_0x5954('0x13'));var logger=require(_0x5954('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5954('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5954('0x16'))['db'];function respondWithStatusCode(_0x3af8f7,_0x6b3f54){_0x6b3f54=_0x6b3f54||0xcc;return function(_0x3cba60){if(_0x3cba60){return _0x3af8f7[_0x5954('0x17')](_0x6b3f54);}return _0x3af8f7['status'](_0x6b3f54)['end']();};}function respondWithResult(_0xbfe7da,_0x1b1f0d){_0x1b1f0d=_0x1b1f0d||0xc8;return function(_0x1dd46a){if(_0x1dd46a){return _0xbfe7da[_0x5954('0x18')](_0x1b1f0d)['json'](_0x1dd46a);}};}function respondWithFilteredResult(_0x11b11f,_0x59dbd8){return function(_0x488808){if(_0x488808){var _0x9312ab=typeof _0x59dbd8[_0x5954('0x19')]===_0x5954('0x1a')&&typeof _0x59dbd8[_0x5954('0x1b')]===_0x5954('0x1a');var _0xe6ea24=_0x488808['count'];var _0x9bafc=_0x9312ab?0x0:_0x59dbd8[_0x5954('0x19')];var _0x1c0b6c=_0x9312ab?_0x488808['count']:_0x59dbd8[_0x5954('0x19')]+_0x59dbd8[_0x5954('0x1b')];var _0x5f30f2;if(_0x1c0b6c>=_0xe6ea24){_0x1c0b6c=_0xe6ea24;_0x5f30f2=0xc8;}else{_0x5f30f2=0xce;}_0x11b11f[_0x5954('0x18')](_0x5f30f2);return _0x11b11f[_0x5954('0x1c')](_0x5954('0x1d'),_0x9bafc+'-'+_0x1c0b6c+'/'+_0xe6ea24)[_0x5954('0x1e')](_0x488808);}return null;};}function patchUpdates(_0x3a4c1e){return function(_0x57c624){try{jsonpatch[_0x5954('0x1f')](_0x57c624,_0x3a4c1e,!![]);}catch(_0x3fadfc){return BPromise[_0x5954('0x20')](_0x3fadfc);}return _0x57c624['save']();};}function saveUpdates(_0x253b29,_0x4e957b){return function(_0x498b31){if(_0x498b31){return _0x498b31[_0x5954('0x21')](_0x253b29)[_0x5954('0x22')](function(_0x48d8b0){return _0x48d8b0;});}return null;};}function removeEntity(_0x285791,_0x35afce){return function(_0x2c5d22){if(_0x2c5d22){return _0x2c5d22[_0x5954('0x23')]()[_0x5954('0x22')](function(){var _0x4e27c1=_0x2c5d22[_0x5954('0x24')]({'plain':!![]});var _0xd85b6a=_0x5954('0x25');return db[_0x5954('0x26')]['destroy']({'where':{'type':_0xd85b6a,'resourceId':_0x4e27c1['id']}})[_0x5954('0x22')](function(){return _0x2c5d22;});})[_0x5954('0x22')](function(){_0x285791[_0x5954('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32d357,_0x16a87d){return function(_0x292c9f){if(!_0x292c9f){_0x32d357[_0x5954('0x17')](0x194);}return _0x292c9f;};}function handleError(_0x4730b0,_0x52f281){_0x52f281=_0x52f281||0x1f4;return function(_0x121ad3){logger['error'](_0x121ad3['stack']);if(_0x121ad3['name']){delete _0x121ad3[_0x5954('0x27')];}_0x4730b0[_0x5954('0x18')](_0x52f281)[_0x5954('0x28')](_0x121ad3);};}exports[_0x5954('0x29')]=function(_0x2cd875,_0x259b9d){var _0x236435={},_0x68a90e={},_0xec59b2={'count':0x0,'rows':[]};var _0x1b9427=_['map'](db[_0x5954('0x2a')]['rawAttributes'],function(_0x3cc788){return{'name':_0x3cc788[_0x5954('0x2b')],'type':_0x3cc788[_0x5954('0x2c')][_0x5954('0x2d')]};});_0x68a90e['model']=_['map'](_0x1b9427,'name');_0x68a90e[_0x5954('0x2e')]=_[_0x5954('0x2f')](_0x2cd875[_0x5954('0x2e')]);_0x68a90e[_0x5954('0x30')]=_[_0x5954('0x31')](_0x68a90e[_0x5954('0x32')],_0x68a90e[_0x5954('0x2e')]);_0x236435[_0x5954('0x33')]=_[_0x5954('0x31')](_0x68a90e[_0x5954('0x32')],qs[_0x5954('0x34')](_0x2cd875[_0x5954('0x2e')][_0x5954('0x34')]));_0x236435[_0x5954('0x33')]=_0x236435[_0x5954('0x33')][_0x5954('0x35')]?_0x236435[_0x5954('0x33')]:_0x68a90e[_0x5954('0x32')];if(!_0x2cd875[_0x5954('0x2e')]['hasOwnProperty'](_0x5954('0x36'))){_0x236435['limit']=qs['limit'](_0x2cd875['query']['limit']);_0x236435[_0x5954('0x19')]=qs[_0x5954('0x19')](_0x2cd875['query'][_0x5954('0x19')]);}_0x236435[_0x5954('0x37')]=qs['sort'](_0x2cd875['query'][_0x5954('0x38')]);_0x236435[_0x5954('0x39')]=qs[_0x5954('0x30')](_['pick'](_0x2cd875[_0x5954('0x2e')],_0x68a90e[_0x5954('0x30')]),_0x1b9427);if(_0x2cd875[_0x5954('0x2e')][_0x5954('0x3a')]){_0x236435['where']=_[_0x5954('0x3b')](_0x236435[_0x5954('0x39')],{'$or':_[_0x5954('0x3c')](_0x1b9427,function(_0x214d6d){if(_0x214d6d[_0x5954('0x2c')]!=='VIRTUAL'){var _0x55fc3e={};_0x55fc3e[_0x214d6d['name']]={'$like':'%'+_0x2cd875['query']['filter']+'%'};return _0x55fc3e;}})});}_0x236435=_[_0x5954('0x3b')]({},_0x236435,_0x2cd875[_0x5954('0x3d')]);var _0x3a3958={'where':_0x236435[_0x5954('0x39')]};return db[_0x5954('0x2a')]['count'](_0x3a3958)[_0x5954('0x22')](function(_0x2b5ed6){_0xec59b2[_0x5954('0x3e')]=_0x2b5ed6;if(_0x2cd875[_0x5954('0x2e')][_0x5954('0x3f')]){_0x236435[_0x5954('0x40')]=[{'all':!![]}];}return db[_0x5954('0x2a')][_0x5954('0x41')](_0x236435);})[_0x5954('0x22')](function(_0xb83ffd){_0xec59b2[_0x5954('0x42')]=_0xb83ffd;return _0xec59b2;})[_0x5954('0x22')](respondWithFilteredResult(_0x259b9d,_0x236435))[_0x5954('0x43')](handleError(_0x259b9d,null));};exports['show']=function(_0x34fac4,_0x4d9974){var _0x2deb53={'raw':!![],'where':{'id':_0x34fac4[_0x5954('0x44')]['id']}},_0x20ae85={};_0x20ae85[_0x5954('0x32')]=_['keys'](db[_0x5954('0x2a')][_0x5954('0x45')]);_0x20ae85[_0x5954('0x2e')]=_[_0x5954('0x2f')](_0x34fac4[_0x5954('0x2e')]);_0x20ae85[_0x5954('0x30')]=_[_0x5954('0x31')](_0x20ae85[_0x5954('0x32')],_0x20ae85[_0x5954('0x2e')]);_0x2deb53[_0x5954('0x33')]=_[_0x5954('0x31')](_0x20ae85[_0x5954('0x32')],qs['fields'](_0x34fac4[_0x5954('0x2e')][_0x5954('0x34')]));_0x2deb53[_0x5954('0x33')]=_0x2deb53['attributes'][_0x5954('0x35')]?_0x2deb53[_0x5954('0x33')]:_0x20ae85['model'];if(_0x34fac4[_0x5954('0x2e')][_0x5954('0x3f')]){_0x2deb53['include']=[{'all':!![]}];}_0x2deb53=_[_0x5954('0x3b')]({},_0x2deb53,_0x34fac4['options']);return db[_0x5954('0x2a')][_0x5954('0x46')](_0x2deb53)['then'](handleEntityNotFound(_0x4d9974,null))['then'](respondWithResult(_0x4d9974,null))[_0x5954('0x43')](handleError(_0x4d9974,null));};exports['create']=function(_0x6cca5,_0x295a64){return db[_0x5954('0x2a')][_0x5954('0x47')](_0x6cca5[_0x5954('0x48')],{})['then'](function(_0x25aa0b){var _0x433558=_0x6cca5['user']['get']({'plain':!![]});if(!_0x433558)throw new Error(_0x5954('0x49'));if(_0x433558['role']===_0x5954('0x4a')){var _0x1f8df0=_0x25aa0b[_0x5954('0x24')]({'plain':!![]});var _0x42bcc2='ODBC';return db[_0x5954('0x4b')][_0x5954('0x46')]({'where':{'name':_0x42bcc2,'userProfileId':_0x433558[_0x5954('0x4c')]},'raw':!![]})[_0x5954('0x22')](function(_0x2af776){if(_0x2af776&&_0x2af776[_0x5954('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f8df0[_0x5954('0x27')],'resourceId':_0x1f8df0['id'],'type':_0x2af776[_0x5954('0x27')],'sectionId':_0x2af776['id']},{})[_0x5954('0x22')](function(){return _0x25aa0b;});}else{return _0x25aa0b;}})['catch'](function(_0x3e1632){logger[_0x5954('0x4e')](_0x5954('0x4f'),_0x3e1632);throw _0x3e1632;});}return _0x25aa0b;})[_0x5954('0x22')](respondWithResult(_0x295a64,0xc9))['catch'](handleError(_0x295a64,null));};exports[_0x5954('0x21')]=function(_0x198c78,_0x1fb992){if(_0x198c78['body']['id']){delete _0x198c78['body']['id'];}return db[_0x5954('0x2a')][_0x5954('0x46')]({'where':{'id':_0x198c78[_0x5954('0x44')]['id']}})[_0x5954('0x22')](handleEntityNotFound(_0x1fb992,null))[_0x5954('0x22')](saveUpdates(_0x198c78[_0x5954('0x48')],null))[_0x5954('0x22')](respondWithResult(_0x1fb992,null))[_0x5954('0x43')](handleError(_0x1fb992,null));};exports[_0x5954('0x23')]=function(_0x15f9c4,_0x3cfb25){return db[_0x5954('0x2a')][_0x5954('0x46')]({'where':{'id':_0x15f9c4[_0x5954('0x44')]['id']}})[_0x5954('0x22')](handleEntityNotFound(_0x3cfb25,null))[_0x5954('0x22')](removeEntity(_0x3cfb25,null))['catch'](handleError(_0x3cfb25,null));};exports[_0x5954('0x50')]=function(_0x2a75dc,_0x335a3,_0x3fcb02){var _0x1ccded;return db['SquareOdbc']['find']({'where':{'id':_0x2a75dc[_0x5954('0x44')]['id']},'attributes':['id',_0x5954('0x51')]})[_0x5954('0x22')](handleEntityNotFound(_0x335a3,null))[_0x5954('0x22')](function(_0x1fb106){if(_0x1fb106){var _0x4d2c24=require(_0x5954('0x52'))();_0x4d2c24[_0x5954('0x53')](_0x1fb106[_0x5954('0x51')]);_0x4d2c24[_0x5954('0x54')]();return _0x1fb106;}})[_0x5954('0x22')](respondWithResult(_0x335a3,null))['catch'](handleError(_0x335a3,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index caeadc2..b045d53 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 _0x30f2=['moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','exports','define','square_odbc','util','../../config/logger','api'];(function(_0x3d1684,_0x103504){var _0x20dbaa=function(_0xc5a5f){while(--_0xc5a5f){_0x3d1684['push'](_0x3d1684['shift']());}};_0x20dbaa(++_0x103504);}(_0x30f2,0xd5));var _0x230f=function(_0x474e38,_0x2530bd){_0x474e38=_0x474e38-0x0;var _0x206789=_0x30f2[_0x474e38];return _0x206789;};'use strict';var _=require('lodash');var util=require(_0x230f('0x0'));var logger=require(_0x230f('0x1'))(_0x230f('0x2'));var moment=require(_0x230f('0x3'));var BPromise=require(_0x230f('0x4'));var rp=require(_0x230f('0x5'));var fs=require('fs');var path=require(_0x230f('0x6'));var rimraf=require(_0x230f('0x7'));var config=require('../../config/environment');var attributes=require(_0x230f('0x8'));module[_0x230f('0x9')]=function(_0x4cab28,_0x44ce75){return _0x4cab28[_0x230f('0xa')]('SquareOdbc',attributes,{'tableName':_0x230f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d4f=['request-promise','path','rimraf','../../config/environment','exports','define','SquareOdbc','../../config/logger'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0x5d4f,0x13f));var _0xf5d4=function(_0x533144,_0x3d6ef2){_0x533144=_0x533144-0x0;var _0x5f0a61=_0x5d4f[_0x533144];return _0x5f0a61;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5d4('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5d4('0x1'));var fs=require('fs');var path=require(_0xf5d4('0x2'));var rimraf=require(_0xf5d4('0x3'));var config=require(_0xf5d4('0x4'));var attributes=require('./squareOdbc.attributes');module[_0xf5d4('0x5')]=function(_0x259a79,_0x5d6a08){return _0x259a79[_0xf5d4('0x6')](_0xf5d4('0x7'),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 7a172db..24aadb9 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 _0x70db=['request\x20sent','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SquareOdbc,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x70db,0x8a));var _0xb70d=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x70db[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb70d('0x0'));var util=require(_0xb70d('0x1'));var moment=require(_0xb70d('0x2'));var BPromise=require(_0xb70d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb70d('0x4'))['db'];var utils=require(_0xb70d('0x5'));var logger=require(_0xb70d('0x6'))(_0xb70d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb70d('0x8'));var client=jayson['client'][_0xb70d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x163a3c,_0x4ba26a,_0x1373a6){return new BPromise(function(_0x2b2b1c,_0x45de9a){return client['request'](_0x163a3c,_0x1373a6)[_0xb70d('0xa')](function(_0x2a52cf){logger[_0xb70d('0xb')](_0xb70d('0xc'),_0x4ba26a,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4ba26a,'request\x20sent',JSON[_0xb70d('0xd')](_0x2a52cf));if(_0x2a52cf[_0xb70d('0xe')]){if(_0x2a52cf[_0xb70d('0xe')][_0xb70d('0xf')]===0x1f4){logger[_0xb70d('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x4ba26a,_0x2a52cf[_0xb70d('0xe')][_0xb70d('0x10')]);return _0x45de9a(_0x2a52cf[_0xb70d('0xe')]['message']);}logger[_0xb70d('0xe')](_0xb70d('0xc'),_0x4ba26a,_0x2a52cf[_0xb70d('0xe')][_0xb70d('0x10')]);return _0x2b2b1c(_0x2a52cf[_0xb70d('0xe')][_0xb70d('0x10')]);}else{logger[_0xb70d('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x4ba26a,_0xb70d('0x11'));_0x2b2b1c(_0x2a52cf[_0xb70d('0x12')][_0xb70d('0x10')]);}})[_0xb70d('0x13')](function(_0x2c0691){logger[_0xb70d('0xe')](_0xb70d('0xc'),_0x4ba26a,_0x2c0691);_0x45de9a(_0x2c0691);});});}exports[_0xb70d('0x14')]=function(_0x102ae7){var _0x419609=this;return new Promise(function(_0x458767,_0x58386c){return db[_0xb70d('0x15')][_0xb70d('0x16')]({'raw':_0x102ae7[_0xb70d('0x17')]?_0x102ae7['options'][_0xb70d('0x18')]===undefined?!![]:![]:!![],'where':_0x102ae7[_0xb70d('0x17')]?_0x102ae7[_0xb70d('0x17')][_0xb70d('0x19')]||null:null,'attributes':_0x102ae7[_0xb70d('0x17')]?_0x102ae7[_0xb70d('0x17')][_0xb70d('0x1a')]||null:null,'include':_0x102ae7['options']?_0x102ae7[_0xb70d('0x17')][_0xb70d('0x1b')]?_[_0xb70d('0x1c')](_0x102ae7[_0xb70d('0x17')][_0xb70d('0x1b')],function(_0x2c2690){return{'model':db[_0x2c2690[_0xb70d('0x1d')]],'as':_0x2c2690['as'],'attributes':_0x2c2690[_0xb70d('0x1a')],'include':_0x2c2690[_0xb70d('0x1b')]?_[_0xb70d('0x1c')](_0x2c2690[_0xb70d('0x1b')],function(_0x55b9f1){return{'model':db[_0x55b9f1[_0xb70d('0x1d')]],'as':_0x55b9f1['as'],'attributes':_0x55b9f1[_0xb70d('0x1a')],'include':_0x55b9f1[_0xb70d('0x1b')]?_[_0xb70d('0x1c')](_0x55b9f1[_0xb70d('0x1b')],function(_0x41a5ab){return{'model':db[_0x41a5ab[_0xb70d('0x1d')]],'as':_0x41a5ab['as'],'attributes':_0x41a5ab[_0xb70d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb70d('0xa')](function(_0x27a205){logger[_0xb70d('0xb')](_0xb70d('0x14'),_0x102ae7);logger[_0xb70d('0x1e')](_0xb70d('0x14'),_0x102ae7,JSON[_0xb70d('0xd')](_0x27a205));_0x458767(_0x27a205);})['catch'](function(_0x424cf7){logger[_0xb70d('0xe')](_0xb70d('0x14'),_0x424cf7[_0xb70d('0x10')],_0x102ae7);_0x58386c(_0x419609[_0xb70d('0xe')](0x1f4,_0x424cf7['message']));});});}; \ No newline at end of file +var _0xc543=['info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSquareOdbc','find','raw','options','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x36b81a,_0x4a5b46){var _0xa3d561=function(_0x3fe810){while(--_0x3fe810){_0x36b81a['push'](_0x36b81a['shift']());}};_0xa3d561(++_0x4a5b46);}(_0xc543,0xbc));var _0x3c54=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0xc543[_0x2e4a0f];return _0x25a3cd;};'use strict';var _=require(_0x3c54('0x0'));var util=require(_0x3c54('0x1'));var moment=require(_0x3c54('0x2'));var BPromise=require(_0x3c54('0x3'));var rs=require(_0x3c54('0x4'));var fs=require('fs');var Redis=require(_0x3c54('0x5'));var db=require(_0x3c54('0x6'))['db'];var utils=require(_0x3c54('0x7'));var logger=require(_0x3c54('0x8'))(_0x3c54('0x9'));var config=require(_0x3c54('0xa'));var jayson=require(_0x3c54('0xb'));var client=jayson[_0x3c54('0xc')][_0x3c54('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x61894b,_0x1890b3,_0x2b2c31){return new BPromise(function(_0x5bf628,_0x5a70b5){return client[_0x3c54('0xe')](_0x61894b,_0x2b2c31)[_0x3c54('0xf')](function(_0x473976){logger[_0x3c54('0x10')](_0x3c54('0x11'),_0x1890b3,_0x3c54('0x12'));logger[_0x3c54('0x13')](_0x3c54('0x14'),_0x1890b3,'request\x20sent',JSON[_0x3c54('0x15')](_0x473976));if(_0x473976[_0x3c54('0x16')]){if(_0x473976[_0x3c54('0x16')][_0x3c54('0x17')]===0x1f4){logger[_0x3c54('0x16')](_0x3c54('0x11'),_0x1890b3,_0x473976[_0x3c54('0x16')][_0x3c54('0x18')]);return _0x5a70b5(_0x473976[_0x3c54('0x16')][_0x3c54('0x18')]);}logger[_0x3c54('0x16')]('SquareOdbc,\x20%s,\x20%s',_0x1890b3,_0x473976[_0x3c54('0x16')][_0x3c54('0x18')]);return _0x5bf628(_0x473976[_0x3c54('0x16')][_0x3c54('0x18')]);}else{logger[_0x3c54('0x10')](_0x3c54('0x11'),_0x1890b3,_0x3c54('0x12'));_0x5bf628(_0x473976['result'][_0x3c54('0x18')]);}})['catch'](function(_0x525991){logger[_0x3c54('0x16')](_0x3c54('0x11'),_0x1890b3,_0x525991);_0x5a70b5(_0x525991);});});}exports[_0x3c54('0x19')]=function(_0x31a43a){var _0x429e0a=this;return new Promise(function(_0x14df70,_0x5bf98f){return db['SquareOdbc'][_0x3c54('0x1a')]({'raw':_0x31a43a['options']?_0x31a43a['options'][_0x3c54('0x1b')]===undefined?!![]:![]:!![],'where':_0x31a43a['options']?_0x31a43a[_0x3c54('0x1c')]['where']||null:null,'attributes':_0x31a43a['options']?_0x31a43a[_0x3c54('0x1c')][_0x3c54('0x1d')]||null:null,'include':_0x31a43a[_0x3c54('0x1c')]?_0x31a43a[_0x3c54('0x1c')][_0x3c54('0x1e')]?_[_0x3c54('0x1f')](_0x31a43a[_0x3c54('0x1c')]['include'],function(_0x3594d4){return{'model':db[_0x3594d4[_0x3c54('0x20')]],'as':_0x3594d4['as'],'attributes':_0x3594d4[_0x3c54('0x1d')],'include':_0x3594d4[_0x3c54('0x1e')]?_[_0x3c54('0x1f')](_0x3594d4[_0x3c54('0x1e')],function(_0x178b08){return{'model':db[_0x178b08[_0x3c54('0x20')]],'as':_0x178b08['as'],'attributes':_0x178b08['attributes'],'include':_0x178b08['include']?_[_0x3c54('0x1f')](_0x178b08[_0x3c54('0x1e')],function(_0x2152d1){return{'model':db[_0x2152d1[_0x3c54('0x20')]],'as':_0x2152d1['as'],'attributes':_0x2152d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c54('0xf')](function(_0x263920){logger[_0x3c54('0x10')](_0x3c54('0x19'),_0x31a43a);logger['debug'](_0x3c54('0x19'),_0x31a43a,JSON['stringify'](_0x263920));_0x14df70(_0x263920);})[_0x3c54('0x21')](function(_0x578795){logger['error'](_0x3c54('0x19'),_0x578795[_0x3c54('0x18')],_0x31a43a);_0x5bf98f(_0x429e0a[_0x3c54('0x16')](0x1f4,_0x578795[_0x3c54('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index cc80eca..9f36495 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 _0x5d20=['destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','put','update','delete'];(function(_0x1e9ae1,_0x10dc5d){var _0xc6bc15=function(_0x1a6a7d){while(--_0x1a6a7d){_0x1e9ae1['push'](_0x1e9ae1['shift']());}};_0xc6bc15(++_0x10dc5d);}(_0x5d20,0xb6));var _0x05d2=function(_0x238fc1,_0x5257c0){_0x238fc1=_0x238fc1-0x0;var _0x5e8351=_0x5d20[_0x238fc1];return _0x5e8351;};'use strict';var multer=require(_0x05d2('0x0'));var util=require(_0x05d2('0x1'));var path=require(_0x05d2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x05d2('0x3'));var auth=require(_0x05d2('0x4'));var interaction=require(_0x05d2('0x5'));var config=require(_0x05d2('0x6'));var controller=require(_0x05d2('0x7'));router[_0x05d2('0x8')]('/',auth[_0x05d2('0x9')](),controller[_0x05d2('0xa')]);router['get'](_0x05d2('0xb'),auth[_0x05d2('0x9')](),controller[_0x05d2('0xc')]);router['post']('/',auth[_0x05d2('0x9')](),controller['create']);router[_0x05d2('0xd')](_0x05d2('0xb'),auth[_0x05d2('0x9')](),controller[_0x05d2('0xe')]);router[_0x05d2('0xf')](_0x05d2('0xb'),auth[_0x05d2('0x9')](),controller[_0x05d2('0x10')]);module[_0x05d2('0x11')]=router; \ No newline at end of file +var _0x63b6=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post','create','put'];(function(_0x1bd124,_0x26d7c7){var _0x750913=function(_0x31f276){while(--_0x31f276){_0x1bd124['push'](_0x1bd124['shift']());}};_0x750913(++_0x26d7c7);}(_0x63b6,0x190));var _0x663b=function(_0x36be68,_0xf85191){_0x36be68=_0x36be68-0x0;var _0xbfe50c=_0x63b6[_0x36be68];return _0xbfe50c;};'use strict';var multer=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var path=require(_0x663b('0x2'));var timeout=require(_0x663b('0x3'));var express=require(_0x663b('0x4'));var router=express[_0x663b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x663b('0x6'));var config=require(_0x663b('0x7'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x663b('0x8')](),controller['index']);router[_0x663b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x663b('0xa')]);router[_0x663b('0xb')]('/',auth[_0x663b('0x8')](),controller[_0x663b('0xc')]);router[_0x663b('0xd')](_0x663b('0xe'),auth[_0x663b('0x8')](),controller[_0x663b('0xf')]);router[_0x663b('0x10')]('/:id',auth[_0x663b('0x8')](),controller['destroy']);module[_0x663b('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3a40477..ea91ff5 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 _0x9918=['sequelize','exports','name','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x40f31d,_0x166318){var _0x10d4e4=function(_0x427148){while(--_0x427148){_0x40f31d['push'](_0x40f31d['shift']());}};_0x10d4e4(++_0x166318);}(_0x9918,0x186));var _0x8991=function(_0x127d68,_0x44b77b){_0x127d68=_0x127d68-0x0;var _0xa5a78b=_0x9918[_0x127d68];return _0xa5a78b;};'use strict';var Sequelize=require(_0x8991('0x0'));module[_0x8991('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8991('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8991('0x3')]},'notes':{'type':Sequelize[_0x8991('0x4')]},'preproduction':{'type':Sequelize[_0x8991('0x5')](_0x8991('0x6')),'get':function(){if(this[_0x8991('0x7')](_0x8991('0x8'))){return this[_0x8991('0x7')](_0x8991('0x8'))[_0x8991('0x9')](_0x8991('0xa'));}}},'production':{'type':Sequelize[_0x8991('0x5')](_0x8991('0x6')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0x8991('0xb'))[_0x8991('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8991('0xc')]},'publishedAt':{'type':Sequelize[_0x8991('0xc')]}}; \ No newline at end of file +var _0xfcb9=['STRING','name','TEXT','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports'];(function(_0x929beb,_0x1abef9){var _0x255092=function(_0xc5a7c){while(--_0xc5a7c){_0x929beb['push'](_0x929beb['shift']());}};_0x255092(++_0x1abef9);}(_0xfcb9,0x14e));var _0x9fcb=function(_0x4a7391,_0x43ea5){_0x4a7391=_0x4a7391-0x0;var _0x194e48=_0xfcb9[_0x4a7391];return _0x194e48;};'use strict';var Sequelize=require(_0x9fcb('0x0'));module[_0x9fcb('0x1')]={'name':{'type':Sequelize[_0x9fcb('0x2')],'unique':_0x9fcb('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9fcb('0x2')]},'notes':{'type':Sequelize[_0x9fcb('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x9fcb('0x5')),'get':function(){if(this[_0x9fcb('0x6')](_0x9fcb('0x7'))){return this[_0x9fcb('0x6')](_0x9fcb('0x7'))[_0x9fcb('0x8')](_0x9fcb('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x9fcb('0x5')),'get':function(){if(this['getDataValue']('production')){return this[_0x9fcb('0x6')](_0x9fcb('0xa'))[_0x9fcb('0x8')]('utf8');}}},'savedAt':{'type':Sequelize[_0x9fcb('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c430bb2..44a0dcb 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 _0x37fa=['stack','name','send','SquareProject','fieldName','type','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','attributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','json','undefined','limit','count','offset','status','set','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','error'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x37fa,0x1bf));var _0xa37f=function(_0x29af39,_0x343c56){_0x29af39=_0x29af39-0x0;var _0x3ab715=_0x37fa[_0x29af39];return _0x3ab715;};'use strict';var _=require(_0xa37f('0x0'));var Redis=require(_0xa37f('0x1'));var qs=require(_0xa37f('0x2'));var logger=require(_0xa37f('0x3'))(_0xa37f('0x4'));var config=require(_0xa37f('0x5'));var db=require(_0xa37f('0x6'))['db'];config[_0xa37f('0x7')]=_['defaults'](config[_0xa37f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa37f('0x8'))(new Redis(config[_0xa37f('0x7')]));require(_0xa37f('0x9'))[_0xa37f('0xa')](socket);function respondWithResult(_0x1c6d70,_0x51ddc8){_0x51ddc8=_0x51ddc8||0xc8;return function(_0x1280ca){if(_0x1280ca){return _0x1c6d70['status'](_0x51ddc8)[_0xa37f('0xb')](_0x1280ca);}};}function respondWithFilteredResult(_0x1659fd,_0x1b7e80){return function(_0x170bcc){if(_0x170bcc){var _0x246ec5=typeof _0x1b7e80['offset']===_0xa37f('0xc')&&typeof _0x1b7e80[_0xa37f('0xd')]===_0xa37f('0xc');var _0x1a85a9=_0x170bcc[_0xa37f('0xe')];var _0x8f728e=_0x246ec5?0x0:_0x1b7e80[_0xa37f('0xf')];var _0x17b3d3=_0x246ec5?_0x170bcc[_0xa37f('0xe')]:_0x1b7e80[_0xa37f('0xf')]+_0x1b7e80[_0xa37f('0xd')];var _0x2367d3;if(_0x17b3d3>=_0x1a85a9){_0x17b3d3=_0x1a85a9;_0x2367d3=0xc8;}else{_0x2367d3=0xce;}_0x1659fd[_0xa37f('0x10')](_0x2367d3);return _0x1659fd[_0xa37f('0x11')]('Content-Range',_0x8f728e+'-'+_0x17b3d3+'/'+_0x1a85a9)[_0xa37f('0xb')](_0x170bcc);}return null;};}function saveUpdates(_0x4842b7){return function(_0x4ee593){if(_0x4ee593){return _0x4ee593[_0xa37f('0x12')](_0x4842b7)[_0xa37f('0x13')](function(_0x90a6cb){return _0x90a6cb;});}return null;};}function removeEntity(_0x23a9c4){return function(_0x404689){if(_0x404689){return _0x404689[_0xa37f('0x14')]()[_0xa37f('0x13')](function(){var _0x43b962=_0x404689[_0xa37f('0x15')]({'plain':!![]});var _0x191894=_0xa37f('0x16');return db[_0xa37f('0x17')]['destroy']({'where':{'type':_0x191894,'resourceId':_0x43b962['id']}})[_0xa37f('0x13')](function(){return _0x404689;});})[_0xa37f('0x13')](function(){var _0x50fcf9=new Redis(config[_0xa37f('0x7')]);_0x50fcf9[_0xa37f('0x18')](_0xa37f('0x19'),JSON[_0xa37f('0x1a')]({'id':_0x404689['id'],'deleted':!![]}));})[_0xa37f('0x13')](function(){_0x23a9c4[_0xa37f('0x10')](0xcc)[_0xa37f('0x1b')]();});}};}function handleEntityNotFound(_0x956707){return function(_0x45bf21){if(!_0x45bf21){_0x956707['sendStatus'](0x194);}return _0x45bf21;};}function handleError(_0x56b1b1,_0x3a1cb4){_0x3a1cb4=_0x3a1cb4||0x1f4;return function(_0x429966){logger[_0xa37f('0x1c')](_0x429966[_0xa37f('0x1d')]);if(_0x429966[_0xa37f('0x1e')]){delete _0x429966[_0xa37f('0x1e')];}_0x56b1b1['status'](_0x3a1cb4)[_0xa37f('0x1f')](_0x429966);};}exports['index']=function(_0x4f8f93,_0x1f4c15){var _0x23f561={},_0x2cdd56={},_0x529211={'count':0x0,'rows':[]};var _0x344a54=_['map'](db[_0xa37f('0x20')]['rawAttributes'],function(_0x1fdfc5){return{'name':_0x1fdfc5[_0xa37f('0x21')],'type':_0x1fdfc5[_0xa37f('0x22')]['key']};});_0x2cdd56[_0xa37f('0x23')]=_[_0xa37f('0x24')](_0x344a54,_0xa37f('0x1e'));_0x2cdd56[_0xa37f('0x25')]=_[_0xa37f('0x26')](_0x4f8f93[_0xa37f('0x25')]);_0x2cdd56[_0xa37f('0x27')]=_['intersection'](_0x2cdd56[_0xa37f('0x23')],_0x2cdd56[_0xa37f('0x25')]);_0x23f561['attributes']=_[_0xa37f('0x28')](_0x2cdd56[_0xa37f('0x23')],qs[_0xa37f('0x29')](_0x4f8f93['query'][_0xa37f('0x29')]));_0x23f561['attributes']=_0x23f561['attributes'][_0xa37f('0x2a')]?_0x23f561['attributes']:_0x2cdd56[_0xa37f('0x23')];if(!_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x2b')]('nolimit')){_0x23f561[_0xa37f('0xd')]=qs[_0xa37f('0xd')](_0x4f8f93[_0xa37f('0x25')][_0xa37f('0xd')]);_0x23f561['offset']=qs[_0xa37f('0xf')](_0x4f8f93[_0xa37f('0x25')][_0xa37f('0xf')]);}_0x23f561[_0xa37f('0x2c')]=qs[_0xa37f('0x2d')](_0x4f8f93[_0xa37f('0x25')]['sort']);_0x23f561[_0xa37f('0x2e')]=qs[_0xa37f('0x27')](_['pick'](_0x4f8f93[_0xa37f('0x25')],_0x2cdd56[_0xa37f('0x27')]),_0x344a54);if(_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x2f')]){_0x23f561[_0xa37f('0x2e')]=_[_0xa37f('0x30')](_0x23f561[_0xa37f('0x2e')],{'$or':_[_0xa37f('0x24')](_0x344a54,function(_0x4d533d){if(_0x4d533d['type']!=='VIRTUAL'){var _0x35a74f={};_0x35a74f[_0x4d533d[_0xa37f('0x1e')]]={'$like':'%'+_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x2f')]+'%'};return _0x35a74f;}})});}_0x23f561=_[_0xa37f('0x30')]({},_0x23f561,_0x4f8f93['options']);var _0x3a5935={'where':_0x23f561[_0xa37f('0x2e')]};return db['SquareProject'][_0xa37f('0xe')](_0x3a5935)[_0xa37f('0x13')](function(_0x5d69df){_0x529211['count']=_0x5d69df;if(_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x31')]){_0x23f561[_0xa37f('0x32')]=[{'all':!![]}];}return db[_0xa37f('0x20')][_0xa37f('0x33')](_0x23f561);})[_0xa37f('0x13')](function(_0x32b669){_0x529211[_0xa37f('0x34')]=_0x32b669;return _0x529211;})[_0xa37f('0x13')](respondWithFilteredResult(_0x1f4c15,_0x23f561))[_0xa37f('0x35')](handleError(_0x1f4c15,null));};exports['show']=function(_0x446608,_0x4488c9){var _0x1c35da={'raw':![],'where':{'id':_0x446608[_0xa37f('0x36')]['id']}},_0x4c87ea={};_0x4c87ea[_0xa37f('0x23')]=_[_0xa37f('0x26')](db[_0xa37f('0x20')]['rawAttributes']);_0x4c87ea[_0xa37f('0x25')]=_['keys'](_0x446608[_0xa37f('0x25')]);_0x4c87ea[_0xa37f('0x27')]=_[_0xa37f('0x28')](_0x4c87ea['model'],_0x4c87ea[_0xa37f('0x25')]);_0x1c35da[_0xa37f('0x37')]=_[_0xa37f('0x28')](_0x4c87ea['model'],qs[_0xa37f('0x29')](_0x446608[_0xa37f('0x25')]['fields']));_0x1c35da[_0xa37f('0x37')]=_0x1c35da['attributes']['length']?_0x1c35da[_0xa37f('0x37')]:_0x4c87ea[_0xa37f('0x23')];if(_0x446608['query'][_0xa37f('0x31')]){_0x1c35da[_0xa37f('0x32')]=[{'all':!![]}];}_0x1c35da=_[_0xa37f('0x30')]({},_0x1c35da,_0x446608[_0xa37f('0x38')]);return db[_0xa37f('0x20')][_0xa37f('0x39')](_0x1c35da)[_0xa37f('0x13')](handleEntityNotFound(_0x4488c9,null))[_0xa37f('0x13')](respondWithResult(_0x4488c9,null))[_0xa37f('0x35')](handleError(_0x4488c9,null));};exports[_0xa37f('0x3a')]=function(_0x5cfaee,_0x55401b){return db['SquareProject'][_0xa37f('0x3a')](_0x5cfaee[_0xa37f('0x3b')],{})[_0xa37f('0x13')](function(_0x152174){var _0x597164=_0x5cfaee[_0xa37f('0x3c')]['get']({'plain':!![]});if(!_0x597164)throw new Error(_0xa37f('0x3d'));if(_0x597164[_0xa37f('0x3e')]===_0xa37f('0x3c')){var _0x44fcb3=_0x152174['get']({'plain':!![]});var _0x665423='SquareProjects';return db[_0xa37f('0x3f')][_0xa37f('0x39')]({'where':{'name':_0x665423,'userProfileId':_0x597164[_0xa37f('0x40')]},'raw':!![]})[_0xa37f('0x13')](function(_0x247e8f){if(_0x247e8f&&_0x247e8f[_0xa37f('0x41')]===0x0){return db[_0xa37f('0x17')]['create']({'name':_0x44fcb3[_0xa37f('0x1e')],'resourceId':_0x44fcb3['id'],'type':_0x247e8f['name'],'sectionId':_0x247e8f['id']},{})['then'](function(){return _0x152174;});}else{return _0x152174;}})['catch'](function(_0x5ab7c2){logger[_0xa37f('0x1c')](_0xa37f('0x42'),_0x5ab7c2);throw _0x5ab7c2;});}return _0x152174;})[_0xa37f('0x13')](respondWithResult(_0x55401b,0xc9))[_0xa37f('0x35')](handleError(_0x55401b,null));};exports[_0xa37f('0x12')]=function(_0x35dbef,_0x1f9ac2){if(_0x35dbef[_0xa37f('0x3b')]['id']){delete _0x35dbef[_0xa37f('0x3b')]['id'];}return db[_0xa37f('0x20')][_0xa37f('0x39')]({'where':{'id':_0x35dbef[_0xa37f('0x36')]['id']}})[_0xa37f('0x13')](handleEntityNotFound(_0x1f9ac2,null))[_0xa37f('0x13')](saveUpdates(_0x35dbef[_0xa37f('0x3b')],null))['then'](function(_0x63fd5d){if(!_0x63fd5d)return;var _0x49af26=_0x63fd5d[_0xa37f('0x15')]({'plain':!![]});return _0x49af26;})[_0xa37f('0x13')](function(_0x23a4db){var _0x39658b=new Redis(config[_0xa37f('0x7')]);_0x39658b[_0xa37f('0x18')](_0xa37f('0x19'),JSON['stringify'](_['pick'](_0x23a4db,['id','name',_0xa37f('0x43')])));return _0x23a4db;})[_0xa37f('0x13')](respondWithResult(_0x1f9ac2,null))['catch'](handleError(_0x1f9ac2,null));};exports[_0xa37f('0x14')]=function(_0x5088b6,_0x4e675d){return db[_0xa37f('0x20')][_0xa37f('0x39')]({'where':{'id':_0x5088b6[_0xa37f('0x36')]['id']}})[_0xa37f('0x13')](handleEntityNotFound(_0x4e675d,null))[_0xa37f('0x13')](removeEntity(_0x4e675d,null))[_0xa37f('0x35')](handleError(_0x4e675d,null));}; \ No newline at end of file +var _0xa399=['agi','stringify','end','sendStatus','error','name','send','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','type','filter','merge','options','SquareProject','includeAll','findAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','publish','lodash','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','count','Content-Range','json','update','destroy','then','get','SquareProjects'];(function(_0x56ed0f,_0x22b777){var _0x8b3a69=function(_0x3a675a){while(--_0x3a675a){_0x56ed0f['push'](_0x56ed0f['shift']());}};_0x8b3a69(++_0x22b777);}(_0xa399,0xfa));var _0x9a39=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa399[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x9a39('0x0'));var Redis=require(_0x9a39('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x9a39('0x2'))('api');var config=require(_0x9a39('0x3'));var db=require('../../mysqldb')['db'];config[_0x9a39('0x4')]=_[_0x9a39('0x5')](config['redis'],{'host':_0x9a39('0x6'),'port':0x18eb});var socket=require(_0x9a39('0x7'))(new Redis(config[_0x9a39('0x4')]));require(_0x9a39('0x8'))[_0x9a39('0x9')](socket);function respondWithResult(_0x454bd2,_0x2f63ac){_0x2f63ac=_0x2f63ac||0xc8;return function(_0x41aa86){if(_0x41aa86){return _0x454bd2[_0x9a39('0xa')](_0x2f63ac)['json'](_0x41aa86);}};}function respondWithFilteredResult(_0x4968c1,_0x16c7e0){return function(_0xe7049c){if(_0xe7049c){var _0x43e676=typeof _0x16c7e0[_0x9a39('0xb')]===_0x9a39('0xc')&&typeof _0x16c7e0[_0x9a39('0xd')]===_0x9a39('0xc');var _0x348095=_0xe7049c[_0x9a39('0xe')];var _0x1333fa=_0x43e676?0x0:_0x16c7e0['offset'];var _0x1b47c3=_0x43e676?_0xe7049c[_0x9a39('0xe')]:_0x16c7e0[_0x9a39('0xb')]+_0x16c7e0[_0x9a39('0xd')];var _0x2a7ce4;if(_0x1b47c3>=_0x348095){_0x1b47c3=_0x348095;_0x2a7ce4=0xc8;}else{_0x2a7ce4=0xce;}_0x4968c1[_0x9a39('0xa')](_0x2a7ce4);return _0x4968c1['set'](_0x9a39('0xf'),_0x1333fa+'-'+_0x1b47c3+'/'+_0x348095)[_0x9a39('0x10')](_0xe7049c);}return null;};}function saveUpdates(_0xffaa0e){return function(_0x1196fb){if(_0x1196fb){return _0x1196fb[_0x9a39('0x11')](_0xffaa0e)['then'](function(_0xdd61ec){return _0xdd61ec;});}return null;};}function removeEntity(_0x54a8d1){return function(_0x547319){if(_0x547319){return _0x547319[_0x9a39('0x12')]()[_0x9a39('0x13')](function(){var _0x18f4ad=_0x547319[_0x9a39('0x14')]({'plain':!![]});var _0x37f94b=_0x9a39('0x15');return db['UserProfileResource'][_0x9a39('0x12')]({'where':{'type':_0x37f94b,'resourceId':_0x18f4ad['id']}})[_0x9a39('0x13')](function(){return _0x547319;});})[_0x9a39('0x13')](function(){var _0x50c15b=new Redis(config[_0x9a39('0x4')]);_0x50c15b['publish'](_0x9a39('0x16'),JSON[_0x9a39('0x17')]({'id':_0x547319['id'],'deleted':!![]}));})['then'](function(){_0x54a8d1[_0x9a39('0xa')](0xcc)[_0x9a39('0x18')]();});}};}function handleEntityNotFound(_0x419ae7){return function(_0xbb2d24){if(!_0xbb2d24){_0x419ae7[_0x9a39('0x19')](0x194);}return _0xbb2d24;};}function handleError(_0x1e6738,_0x214c90){_0x214c90=_0x214c90||0x1f4;return function(_0x532f9d){logger[_0x9a39('0x1a')](_0x532f9d['stack']);if(_0x532f9d[_0x9a39('0x1b')]){delete _0x532f9d[_0x9a39('0x1b')];}_0x1e6738[_0x9a39('0xa')](_0x214c90)[_0x9a39('0x1c')](_0x532f9d);};}exports['index']=function(_0x48a928,_0x4bf665){var _0x2b8622={},_0x16f878={},_0x473aa2={'count':0x0,'rows':[]};var _0x10e2d8=_[_0x9a39('0x1d')](db['SquareProject'][_0x9a39('0x1e')],function(_0x327ace){return{'name':_0x327ace[_0x9a39('0x1f')],'type':_0x327ace['type'][_0x9a39('0x20')]};});_0x16f878[_0x9a39('0x21')]=_[_0x9a39('0x1d')](_0x10e2d8,'name');_0x16f878[_0x9a39('0x22')]=_['keys'](_0x48a928[_0x9a39('0x22')]);_0x16f878['filters']=_[_0x9a39('0x23')](_0x16f878[_0x9a39('0x21')],_0x16f878[_0x9a39('0x22')]);_0x2b8622[_0x9a39('0x24')]=_[_0x9a39('0x23')](_0x16f878[_0x9a39('0x21')],qs[_0x9a39('0x25')](_0x48a928['query'][_0x9a39('0x25')]));_0x2b8622[_0x9a39('0x24')]=_0x2b8622['attributes'][_0x9a39('0x26')]?_0x2b8622[_0x9a39('0x24')]:_0x16f878[_0x9a39('0x21')];if(!_0x48a928[_0x9a39('0x22')]['hasOwnProperty'](_0x9a39('0x27'))){_0x2b8622[_0x9a39('0xd')]=qs[_0x9a39('0xd')](_0x48a928[_0x9a39('0x22')][_0x9a39('0xd')]);_0x2b8622[_0x9a39('0xb')]=qs[_0x9a39('0xb')](_0x48a928[_0x9a39('0x22')][_0x9a39('0xb')]);}_0x2b8622[_0x9a39('0x28')]=qs[_0x9a39('0x29')](_0x48a928[_0x9a39('0x22')][_0x9a39('0x29')]);_0x2b8622['where']=qs[_0x9a39('0x2a')](_[_0x9a39('0x2b')](_0x48a928[_0x9a39('0x22')],_0x16f878['filters']),_0x10e2d8);if(_0x48a928[_0x9a39('0x22')]['filter']){_0x2b8622[_0x9a39('0x2c')]=_['merge'](_0x2b8622[_0x9a39('0x2c')],{'$or':_[_0x9a39('0x1d')](_0x10e2d8,function(_0x314bcc){if(_0x314bcc[_0x9a39('0x2d')]!=='VIRTUAL'){var _0x3d7703={};_0x3d7703[_0x314bcc[_0x9a39('0x1b')]]={'$like':'%'+_0x48a928[_0x9a39('0x22')][_0x9a39('0x2e')]+'%'};return _0x3d7703;}})});}_0x2b8622=_[_0x9a39('0x2f')]({},_0x2b8622,_0x48a928[_0x9a39('0x30')]);var _0x1d18a4={'where':_0x2b8622[_0x9a39('0x2c')]};return db[_0x9a39('0x31')][_0x9a39('0xe')](_0x1d18a4)[_0x9a39('0x13')](function(_0x463e78){_0x473aa2['count']=_0x463e78;if(_0x48a928['query'][_0x9a39('0x32')]){_0x2b8622['include']=[{'all':!![]}];}return db[_0x9a39('0x31')][_0x9a39('0x33')](_0x2b8622);})[_0x9a39('0x13')](function(_0x40898c){_0x473aa2[_0x9a39('0x34')]=_0x40898c;return _0x473aa2;})[_0x9a39('0x13')](respondWithFilteredResult(_0x4bf665,_0x2b8622))[_0x9a39('0x35')](handleError(_0x4bf665,null));};exports[_0x9a39('0x36')]=function(_0x18cc3e,_0x293fd9){var _0x26765e={'raw':![],'where':{'id':_0x18cc3e['params']['id']}},_0x5e8b33={};_0x5e8b33[_0x9a39('0x21')]=_['keys'](db[_0x9a39('0x31')][_0x9a39('0x1e')]);_0x5e8b33[_0x9a39('0x22')]=_['keys'](_0x18cc3e['query']);_0x5e8b33[_0x9a39('0x2a')]=_['intersection'](_0x5e8b33[_0x9a39('0x21')],_0x5e8b33[_0x9a39('0x22')]);_0x26765e[_0x9a39('0x24')]=_[_0x9a39('0x23')](_0x5e8b33[_0x9a39('0x21')],qs[_0x9a39('0x25')](_0x18cc3e['query']['fields']));_0x26765e[_0x9a39('0x24')]=_0x26765e[_0x9a39('0x24')][_0x9a39('0x26')]?_0x26765e[_0x9a39('0x24')]:_0x5e8b33[_0x9a39('0x21')];if(_0x18cc3e[_0x9a39('0x22')][_0x9a39('0x32')]){_0x26765e[_0x9a39('0x37')]=[{'all':!![]}];}_0x26765e=_[_0x9a39('0x2f')]({},_0x26765e,_0x18cc3e[_0x9a39('0x30')]);return db[_0x9a39('0x31')]['find'](_0x26765e)[_0x9a39('0x13')](handleEntityNotFound(_0x293fd9,null))['then'](respondWithResult(_0x293fd9,null))[_0x9a39('0x35')](handleError(_0x293fd9,null));};exports[_0x9a39('0x38')]=function(_0x1b5601,_0x37a66c){return db['SquareProject'][_0x9a39('0x38')](_0x1b5601[_0x9a39('0x39')],{})[_0x9a39('0x13')](function(_0x24abe4){var _0x296c9b=_0x1b5601[_0x9a39('0x3a')][_0x9a39('0x14')]({'plain':!![]});if(!_0x296c9b)throw new Error(_0x9a39('0x3b'));if(_0x296c9b[_0x9a39('0x3c')]===_0x9a39('0x3a')){var _0x7b3bbe=_0x24abe4[_0x9a39('0x14')]({'plain':!![]});var _0x16cbd0=_0x9a39('0x15');return db[_0x9a39('0x3d')][_0x9a39('0x3e')]({'where':{'name':_0x16cbd0,'userProfileId':_0x296c9b[_0x9a39('0x3f')]},'raw':!![]})[_0x9a39('0x13')](function(_0x4ed8cd){if(_0x4ed8cd&&_0x4ed8cd['autoAssociation']===0x0){return db[_0x9a39('0x40')][_0x9a39('0x38')]({'name':_0x7b3bbe['name'],'resourceId':_0x7b3bbe['id'],'type':_0x4ed8cd[_0x9a39('0x1b')],'sectionId':_0x4ed8cd['id']},{})['then'](function(){return _0x24abe4;});}else{return _0x24abe4;}})['catch'](function(_0x4aee17){logger['error'](_0x9a39('0x41'),_0x4aee17);throw _0x4aee17;});}return _0x24abe4;})[_0x9a39('0x13')](respondWithResult(_0x37a66c,0xc9))[_0x9a39('0x35')](handleError(_0x37a66c,null));};exports[_0x9a39('0x11')]=function(_0x3d6b3f,_0x150e2f){if(_0x3d6b3f['body']['id']){delete _0x3d6b3f[_0x9a39('0x39')]['id'];}return db['SquareProject'][_0x9a39('0x3e')]({'where':{'id':_0x3d6b3f[_0x9a39('0x42')]['id']}})[_0x9a39('0x13')](handleEntityNotFound(_0x150e2f,null))[_0x9a39('0x13')](saveUpdates(_0x3d6b3f['body'],null))[_0x9a39('0x13')](function(_0x40921a){if(!_0x40921a)return;var _0x3d7942=_0x40921a['get']({'plain':!![]});return _0x3d7942;})['then'](function(_0x32e44e){var _0x5c2955=new Redis(config[_0x9a39('0x4')]);_0x5c2955[_0x9a39('0x43')]('agi',JSON[_0x9a39('0x17')](_[_0x9a39('0x2b')](_0x32e44e,['id',_0x9a39('0x1b'),'production'])));return _0x32e44e;})[_0x9a39('0x13')](respondWithResult(_0x150e2f,null))[_0x9a39('0x35')](handleError(_0x150e2f,null));};exports[_0x9a39('0x12')]=function(_0x6a8d43,_0x3f6bc7){return db[_0x9a39('0x31')][_0x9a39('0x3e')]({'where':{'id':_0x6a8d43[_0x9a39('0x42')]['id']}})[_0x9a39('0x13')](handleEntityNotFound(_0x3f6bc7,null))['then'](removeEntity(_0x3f6bc7,null))[_0x9a39('0x35')](handleError(_0x3f6bc7,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 6bda466..d4a5098 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 _0x314e=['../../mysqldb','SquareProject','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x42a085,_0x30817a){var _0x256817=function(_0x1cbed1){while(--_0x1cbed1){_0x42a085['push'](_0x42a085['shift']());}};_0x256817(++_0x30817a);}(_0x314e,0xe9));var _0xe314=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x314e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe314('0x0'));var SquareProject=require(_0xe314('0x1'))['db'][_0xe314('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe314('0x3')](0x0);var events={'afterCreate':_0xe314('0x4'),'afterUpdate':_0xe314('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4078c3){return function(_0x5ea467,_0x126f04,_0x2ec853){SquareProjectEvents['emit'](_0x4078c3+':'+_0x5ea467['id'],_0x5ea467);SquareProjectEvents[_0xe314('0x6')](_0x4078c3,_0x5ea467);_0x2ec853(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xe314('0x7')](e,emitEvent(event));}}module[_0xe314('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x98fa=['hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0x143ff0,_0x1973c7){var _0x3bb6c5=function(_0x4c70f0){while(--_0x4c70f0){_0x143ff0['push'](_0x143ff0['shift']());}};_0x3bb6c5(++_0x1973c7);}(_0x98fa,0x1a5));var _0xa98f=function(_0x34d437,_0x4c32f3){_0x34d437=_0x34d437-0x0;var _0x3c2e3e=_0x98fa[_0x34d437];return _0x3c2e3e;};'use strict';var EventEmitter=require(_0xa98f('0x0'));var SquareProject=require(_0xa98f('0x1'))['db'][_0xa98f('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa98f('0x3')](0x0);var events={'afterCreate':_0xa98f('0x4'),'afterUpdate':_0xa98f('0x5'),'afterDestroy':_0xa98f('0x6')};function emitEvent(_0x42c7dc){return function(_0xba8f56,_0x24498f,_0x2c82c5){SquareProjectEvents[_0xa98f('0x7')](_0x42c7dc+':'+_0xba8f56['id'],_0xba8f56);SquareProjectEvents[_0xa98f('0x7')](_0x42c7dc,_0xba8f56);_0x2c82c5(null);};}for(var e in events){if(events[_0xa98f('0x8')](e)){var event=events[e];SquareProject[_0xa98f('0x9')](e,emitEvent(event));}}module[_0xa98f('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c7f08b1..f79f1e8 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 _0x37a6=['../../config/environment','exports','define','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x27fdcc,_0x421cb5){var _0x17c2de=function(_0x2fa372){while(--_0x2fa372){_0x27fdcc['push'](_0x27fdcc['shift']());}};_0x17c2de(++_0x421cb5);}(_0x37a6,0xae));var _0x637a=function(_0xd4b570,_0x57c71c){_0xd4b570=_0xd4b570-0x0;var _0x44d795=_0x37a6[_0xd4b570];return _0x44d795;};'use strict';var _=require(_0x637a('0x0'));var util=require('util');var logger=require(_0x637a('0x1'))(_0x637a('0x2'));var moment=require('moment');var BPromise=require(_0x637a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x637a('0x4'));var rimraf=require(_0x637a('0x5'));var config=require(_0x637a('0x6'));var attributes=require('./squareProject.attributes');module[_0x637a('0x7')]=function(_0x22c4d3,_0x43bd6d){return _0x22c4d3[_0x637a('0x8')]('SquareProject',attributes,{'tableName':_0x637a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b7e92,_0x5c5b0a,_0x42cfaa){if(_0x4b7e92[_0x637a('0xa')](_0x637a('0xb'))){_0x4b7e92[_0x637a('0xc')]=moment()['format'](_0x637a('0xd'));}if(_0x4b7e92[_0x637a('0xa')]('production')){_0x4b7e92[_0x637a('0xe')]=moment()['format'](_0x637a('0xd'));}_0x42cfaa(null,_0x4b7e92);}}});}; \ No newline at end of file +var _0xc145=['SquareProject','square_projects','preproduction','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x5b2b28,_0xfcf44e){var _0x52e491=function(_0xb9faee){while(--_0xb9faee){_0x5b2b28['push'](_0x5b2b28['shift']());}};_0x52e491(++_0xfcf44e);}(_0xc145,0xb3));var _0x5c14=function(_0x54d6a6,_0x28301b){_0x54d6a6=_0x54d6a6-0x0;var _0x40aef0=_0xc145[_0x54d6a6];return _0x40aef0;};'use strict';var _=require(_0x5c14('0x0'));var util=require(_0x5c14('0x1'));var logger=require(_0x5c14('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5c14('0x3'));var rp=require(_0x5c14('0x4'));var fs=require('fs');var path=require(_0x5c14('0x5'));var rimraf=require(_0x5c14('0x6'));var config=require(_0x5c14('0x7'));var attributes=require(_0x5c14('0x8'));module[_0x5c14('0x9')]=function(_0x5ed4aa,_0x2397ec){return _0x5ed4aa[_0x5c14('0xa')](_0x5c14('0xb'),attributes,{'tableName':_0x5c14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42cafa,_0x1237ea,_0x3af749){if(_0x42cafa['changed'](_0x5c14('0xd'))){_0x42cafa['savedAt']=moment()['format'](_0x5c14('0xe'));}if(_0x42cafa[_0x5c14('0xf')](_0x5c14('0x10'))){_0x42cafa[_0x5c14('0x11')]=moment()[_0x5c14('0x12')](_0x5c14('0xe'));}_0x3af749(null,_0x42cafa);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index c6df2a5..0e84c5f 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 _0x0f7a=['GetSquareProjects','SquareProject','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','catch','error','message','ShowSquareProject','stringify','lodash','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0f7a,0x87));var _0xa0f7=function(_0x292360,_0x212e1c){_0x292360=_0x292360-0x0;var _0x4658d1=_0x0f7a[_0x292360];return _0x4658d1;};'use strict';var _=require(_0xa0f7('0x0'));var Redis=require('ioredis');var db=require(_0xa0f7('0x1'))['db'];var logger=require(_0xa0f7('0x2'))('rpc');var config=require(_0xa0f7('0x3'));config[_0xa0f7('0x4')]=_[_0xa0f7('0x5')](config[_0xa0f7('0x4')],{'host':_0xa0f7('0x6'),'port':0x18eb});var socket=require(_0xa0f7('0x7'))(new Redis(config[_0xa0f7('0x4')]));require(_0xa0f7('0x8'))[_0xa0f7('0x9')](socket);exports[_0xa0f7('0xa')]=function(_0x3e364){var _0x517859=this;return new Promise(function(_0x2e4eb6,_0x2dc008){return db[_0xa0f7('0xb')][_0xa0f7('0xc')]({'raw':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0xe')]===undefined?!![]:![]:!![],'where':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0xf')]||null:null,'attributes':_0x3e364['options']?_0x3e364[_0xa0f7('0xd')]['attributes']||null:null,'limit':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0x10')]||null:null,'include':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x3e364[_0xa0f7('0xd')][_0xa0f7('0x11')],function(_0x4a168f){return{'model':db[_0x4a168f[_0xa0f7('0x13')]],'as':_0x4a168f['as'],'attributes':_0x4a168f[_0xa0f7('0x14')],'include':_0x4a168f[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x4a168f[_0xa0f7('0x11')],function(_0xb5d3dd){return{'model':db[_0xb5d3dd['model']],'as':_0xb5d3dd['as'],'attributes':_0xb5d3dd['attributes'],'include':_0xb5d3dd[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0xb5d3dd[_0xa0f7('0x11')],function(_0x116fbe){return{'model':db[_0x116fbe[_0xa0f7('0x13')]],'as':_0x116fbe['as'],'attributes':_0x116fbe['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0f7('0x15')](function(_0x59c3d6){logger[_0xa0f7('0x16')](_0xa0f7('0xa'),_0x3e364);logger[_0xa0f7('0x17')]('GetSquareProjects',_0x3e364,JSON['stringify'](_0x59c3d6));_0x2e4eb6(_0x59c3d6);})[_0xa0f7('0x18')](function(_0x4fce1e){logger[_0xa0f7('0x19')]('GetSquareProjects',_0x4fce1e['message'],_0x3e364);_0x2dc008(_0x517859[_0xa0f7('0x19')](0x1f4,_0x4fce1e[_0xa0f7('0x1a')]));});});};exports[_0xa0f7('0x1b')]=function(_0x12f66d){var _0x8a913=this;return new Promise(function(_0x1ea73c,_0x59ae2a){return db[_0xa0f7('0xb')]['find']({'raw':_0x12f66d[_0xa0f7('0xd')]?_0x12f66d['options'][_0xa0f7('0xe')]===undefined?!![]:![]:!![],'where':_0x12f66d[_0xa0f7('0xd')]?_0x12f66d[_0xa0f7('0xd')][_0xa0f7('0xf')]||null:null,'attributes':_0x12f66d['options']?_0x12f66d[_0xa0f7('0xd')][_0xa0f7('0x14')]||null:null,'include':_0x12f66d[_0xa0f7('0xd')]?_0x12f66d['options']['include']?_['map'](_0x12f66d['options'][_0xa0f7('0x11')],function(_0x21e924){return{'model':db[_0x21e924['model']],'as':_0x21e924['as'],'attributes':_0x21e924[_0xa0f7('0x14')],'include':_0x21e924[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x21e924['include'],function(_0x1fd955){return{'model':db[_0x1fd955['model']],'as':_0x1fd955['as'],'attributes':_0x1fd955[_0xa0f7('0x14')],'include':_0x1fd955[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x1fd955['include'],function(_0x3ddcde){return{'model':db[_0x3ddcde[_0xa0f7('0x13')]],'as':_0x3ddcde['as'],'attributes':_0x3ddcde[_0xa0f7('0x14')]};}):[]};}):[]};}):[]:[]})[_0xa0f7('0x15')](function(_0x511f13){logger[_0xa0f7('0x16')](_0xa0f7('0x1b'),_0x12f66d);logger['debug']('ShowSquareProject',_0x12f66d,JSON[_0xa0f7('0x1c')](_0x511f13));_0x1ea73c(_0x511f13);})['catch'](function(_0x130990){logger[_0xa0f7('0x19')](_0xa0f7('0x1b'),_0x130990[_0xa0f7('0x1a')],_0x12f66d);_0x59ae2a(_0x8a913[_0xa0f7('0x19')](0x1f4,_0x130990[_0xa0f7('0x1a')]));});});}; \ No newline at end of file +var _0x90e6=['raw','info','debug','stringify','lodash','ioredis','rpc','../../config/environment','redis','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','where','limit','include','map','attributes','model','catch','message','error','ShowSquareProject','find'];(function(_0x22f6de,_0x1306b8){var _0x870a50=function(_0xfbe467){while(--_0xfbe467){_0x22f6de['push'](_0x22f6de['shift']());}};_0x870a50(++_0x1306b8);}(_0x90e6,0x13c));var _0x690e=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0x90e6[_0x58999b];return _0x5efc3a;};'use strict';var _=require(_0x690e('0x0'));var Redis=require(_0x690e('0x1'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x690e('0x2'));var config=require(_0x690e('0x3'));config[_0x690e('0x4')]=_['defaults'](config[_0x690e('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x690e('0x5'))(new Redis(config[_0x690e('0x4')]));require(_0x690e('0x6'))['register'](socket);exports[_0x690e('0x7')]=function(_0xde1adb){var _0x1fbe12=this;return new Promise(function(_0x459116,_0x1ff697){return db[_0x690e('0x8')][_0x690e('0x9')]({'raw':_0xde1adb[_0x690e('0xa')]?_0xde1adb['options']['raw']===undefined?!![]:![]:!![],'where':_0xde1adb[_0x690e('0xa')]?_0xde1adb[_0x690e('0xa')][_0x690e('0xb')]||null:null,'attributes':_0xde1adb[_0x690e('0xa')]?_0xde1adb[_0x690e('0xa')]['attributes']||null:null,'limit':_0xde1adb['options']?_0xde1adb[_0x690e('0xa')][_0x690e('0xc')]||null:null,'include':_0xde1adb['options']?_0xde1adb[_0x690e('0xa')][_0x690e('0xd')]?_[_0x690e('0xe')](_0xde1adb['options'][_0x690e('0xd')],function(_0x2baeae){return{'model':db[_0x2baeae['model']],'as':_0x2baeae['as'],'attributes':_0x2baeae[_0x690e('0xf')],'include':_0x2baeae['include']?_[_0x690e('0xe')](_0x2baeae[_0x690e('0xd')],function(_0xee9755){return{'model':db[_0xee9755[_0x690e('0x10')]],'as':_0xee9755['as'],'attributes':_0xee9755[_0x690e('0xf')],'include':_0xee9755[_0x690e('0xd')]?_[_0x690e('0xe')](_0xee9755[_0x690e('0xd')],function(_0x22c6ed){return{'model':db[_0x22c6ed[_0x690e('0x10')]],'as':_0x22c6ed['as'],'attributes':_0x22c6ed[_0x690e('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a6d09){logger['info'](_0x690e('0x7'),_0xde1adb);logger['debug']('GetSquareProjects',_0xde1adb,JSON['stringify'](_0x4a6d09));_0x459116(_0x4a6d09);})[_0x690e('0x11')](function(_0x27539c){logger['error'](_0x690e('0x7'),_0x27539c[_0x690e('0x12')],_0xde1adb);_0x1ff697(_0x1fbe12[_0x690e('0x13')](0x1f4,_0x27539c['message']));});});};exports[_0x690e('0x14')]=function(_0x9a7532){var _0x57d774=this;return new Promise(function(_0xa33f5,_0xfc39c7){return db['SquareProject'][_0x690e('0x15')]({'raw':_0x9a7532[_0x690e('0xa')]?_0x9a7532[_0x690e('0xa')][_0x690e('0x16')]===undefined?!![]:![]:!![],'where':_0x9a7532[_0x690e('0xa')]?_0x9a7532[_0x690e('0xa')][_0x690e('0xb')]||null:null,'attributes':_0x9a7532[_0x690e('0xa')]?_0x9a7532[_0x690e('0xa')][_0x690e('0xf')]||null:null,'include':_0x9a7532[_0x690e('0xa')]?_0x9a7532['options'][_0x690e('0xd')]?_[_0x690e('0xe')](_0x9a7532[_0x690e('0xa')]['include'],function(_0x3a6b8c){return{'model':db[_0x3a6b8c[_0x690e('0x10')]],'as':_0x3a6b8c['as'],'attributes':_0x3a6b8c['attributes'],'include':_0x3a6b8c[_0x690e('0xd')]?_[_0x690e('0xe')](_0x3a6b8c['include'],function(_0x21ddee){return{'model':db[_0x21ddee['model']],'as':_0x21ddee['as'],'attributes':_0x21ddee[_0x690e('0xf')],'include':_0x21ddee[_0x690e('0xd')]?_[_0x690e('0xe')](_0x21ddee[_0x690e('0xd')],function(_0x57438b){return{'model':db[_0x57438b[_0x690e('0x10')]],'as':_0x57438b['as'],'attributes':_0x57438b[_0x690e('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x337be9){logger[_0x690e('0x17')](_0x690e('0x14'),_0x9a7532);logger[_0x690e('0x18')]('ShowSquareProject',_0x9a7532,JSON[_0x690e('0x19')](_0x337be9));_0xa33f5(_0x337be9);})['catch'](function(_0x495043){logger[_0x690e('0x13')](_0x690e('0x14'),_0x495043[_0x690e('0x12')],_0x9a7532);_0xfc39c7(_0x57d774[_0x690e('0x13')](0x1f4,_0x495043['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index de6ed04..2aa33be 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 _0xa72f=['length','squareProject:','./squareProject.events','save','remove','update','removeListener','register'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xa72f,0x132));var _0xfa72=function(_0x2f36d2,_0x24285c){_0x2f36d2=_0x2f36d2-0x0;var _0x147f7f=_0xa72f[_0x2f36d2];return _0x147f7f;};'use strict';var SquareProjectEvents=require(_0xfa72('0x0'));var events=[_0xfa72('0x1'),_0xfa72('0x2'),_0xfa72('0x3')];function createListener(_0x489bef,_0x7c4703){return function(_0x55984a){_0x7c4703['emit'](_0x489bef,_0x55984a);};}function removeListener(_0x2a5909,_0xfd509e){return function(){SquareProjectEvents[_0xfa72('0x4')](_0x2a5909,_0xfd509e);};}exports[_0xfa72('0x5')]=function(_0x9efc66){for(var _0x2356a5=0x0,_0x312b35=events[_0xfa72('0x6')];_0x2356a5<_0x312b35;_0x2356a5++){var _0x574918=events[_0x2356a5];var _0x197fb9=createListener(_0xfa72('0x7')+_0x574918,_0x9efc66);SquareProjectEvents['on'](_0x574918,_0x197fb9);}}; \ No newline at end of file +var _0x638e=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0x638e,0x15d));var _0xe638=function(_0x4f270c,_0x469a4d){_0x4f270c=_0x4f270c-0x0;var _0x1be88e=_0x638e[_0x4f270c];return _0x1be88e;};'use strict';var SquareProjectEvents=require(_0xe638('0x0'));var events=[_0xe638('0x1'),_0xe638('0x2'),'update'];function createListener(_0x59d968,_0x4ec95f){return function(_0x4543ef){_0x4ec95f[_0xe638('0x3')](_0x59d968,_0x4543ef);};}function removeListener(_0x3e82b4,_0x4a20f8){return function(){SquareProjectEvents[_0xe638('0x4')](_0x3e82b4,_0x4a20f8);};}exports[_0xe638('0x5')]=function(_0x5212a2){for(var _0x41fba9=0x0,_0x11ce05=events[_0xe638('0x6')];_0x41fba9<_0x11ce05;_0x41fba9++){var _0x70586f=events[_0x41fba9];var _0x297416=createListener(_0xe638('0x7')+_0x70586f,_0x5212a2);SquareProjectEvents['on'](_0x70586f,_0x297416);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b98e8af..ad07e52 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x22491e,_0x2cd0bf){var _0x6a93f8=function(_0xdca25e){while(--_0xdca25e){_0x22491e['push'](_0x22491e['shift']());}};_0x6a93f8(++_0x2cd0bf);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x5fc3[_0x3b0912];return _0xa8f339;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x51f2a1,_0x1fc805){var _0x2cfa57=function(_0x4073ff){while(--_0x4073ff){_0x51f2a1['push'](_0x51f2a1['shift']());}};_0x2cfa57(++_0x1fc805);}(_0x814b,0x1a2));var _0xb814=function(_0x208bc9,_0x4f36f6){_0x208bc9=_0x208bc9-0x0;var _0x2675a8=_0x814b[_0x208bc9];return _0x2675a8;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 305a9a7..0306d33 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 _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xabce,0x103));var _0xeabc=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xabce[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'uniqueid':{'type':Sequelize[_0xeabc('0x2')]},'callerid':{'type':Sequelize[_0xeabc('0x2')]},'calleridname':{'type':Sequelize[_0xeabc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xeabc('0x2')]},'accountcode':{'type':Sequelize[_0xeabc('0x2')]},'dnid':{'type':Sequelize[_0xeabc('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xeabc('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xeabc('0x3')],'get':function(){var _0x52ede8='';var _0x3bdc29=this[_0xeabc('0x4')](_0xeabc('0x5'));if(_0x3bdc29){_0x52ede8=_0x3bdc29['substring'](_0x3bdc29[_0xeabc('0x6')]('.'));}return _0x52ede8;}}}; \ No newline at end of file +var _0x3e74=['getDataValue','savePath','substring','sequelize','STRING'];(function(_0x19abc8,_0x4dc48f){var _0x2a5006=function(_0x2be2a7){while(--_0x2be2a7){_0x19abc8['push'](_0x19abc8['shift']());}};_0x2a5006(++_0x4dc48f);}(_0x3e74,0x175));var _0x43e7=function(_0x5e7755,_0x4e76dd){_0x5e7755=_0x5e7755-0x0;var _0x195a12=_0x3e74[_0x5e7755];return _0x195a12;};'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 476fccb..0936946 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 _0x5a3c=['undefined','limit','count','offset','status','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','body','find','download','../../components/encryptor','uniqueid','savePath','filename','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','json'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x5a3c,0x164));var _0xc5a3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5a3c[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0xc5a3('0x0'));var rimraf=require(_0xc5a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5a3('0x2'));var rp=require(_0xc5a3('0x3'));var moment=require('moment');var BPromise=require(_0xc5a3('0x4'));var Mustache=require(_0xc5a3('0x5'));var util=require(_0xc5a3('0x6'));var path=require(_0xc5a3('0x7'));var sox=require(_0xc5a3('0x8'));var csv=require(_0xc5a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5a3('0xa'));var _=require(_0xc5a3('0xb'));var squel=require(_0xc5a3('0xc'));var crypto=require(_0xc5a3('0xd'));var jsforce=require(_0xc5a3('0xe'));var deskjs=require(_0xc5a3('0xf'));var toCsv=require(_0xc5a3('0x9'));var querystring=require(_0xc5a3('0x10'));var Papa=require(_0xc5a3('0x11'));var Redis=require(_0xc5a3('0x12'));var authService=require(_0xc5a3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc5a3('0x14'));var hardwareService=require(_0xc5a3('0x15'));var logger=require(_0xc5a3('0x16'))(_0xc5a3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc5a3('0x18'))['db'];function respondWithStatusCode(_0x4fc493,_0xcfd222){_0xcfd222=_0xcfd222||0xcc;return function(_0x163b7e){if(_0x163b7e){return _0x4fc493[_0xc5a3('0x19')](_0xcfd222);}return _0x4fc493['status'](_0xcfd222)[_0xc5a3('0x1a')]();};}function respondWithResult(_0x269639,_0x4c230a){_0x4c230a=_0x4c230a||0xc8;return function(_0x977e4e){if(_0x977e4e){return _0x269639['status'](_0x4c230a)[_0xc5a3('0x1b')](_0x977e4e);}};}function respondWithFilteredResult(_0x19287d,_0x14059c){return function(_0x45fdaf){if(_0x45fdaf){var _0x3a77f4=typeof _0x14059c['offset']===_0xc5a3('0x1c')&&typeof _0x14059c[_0xc5a3('0x1d')]==='undefined';var _0x2534ab=_0x45fdaf[_0xc5a3('0x1e')];var _0x1cab25=_0x3a77f4?0x0:_0x14059c[_0xc5a3('0x1f')];var _0x1751b2=_0x3a77f4?_0x45fdaf[_0xc5a3('0x1e')]:_0x14059c[_0xc5a3('0x1f')]+_0x14059c[_0xc5a3('0x1d')];var _0x1bec0f;if(_0x1751b2>=_0x2534ab){_0x1751b2=_0x2534ab;_0x1bec0f=0xc8;}else{_0x1bec0f=0xce;}_0x19287d[_0xc5a3('0x20')](_0x1bec0f);return _0x19287d[_0xc5a3('0x21')](_0xc5a3('0x22'),_0x1cab25+'-'+_0x1751b2+'/'+_0x2534ab)['json'](_0x45fdaf);}return null;};}function patchUpdates(_0x36c1a9){return function(_0x534ebe){try{jsonpatch[_0xc5a3('0x23')](_0x534ebe,_0x36c1a9,!![]);}catch(_0x25cfdd){return BPromise[_0xc5a3('0x24')](_0x25cfdd);}return _0x534ebe['save']();};}function saveUpdates(_0x10b17c,_0x21cf10){return function(_0x44cda0){if(_0x44cda0){return _0x44cda0[_0xc5a3('0x25')](_0x10b17c)[_0xc5a3('0x26')](function(_0x108e46){return _0x108e46;});}return null;};}function removeEntity(_0x1d3b28,_0x19e6e2){return function(_0x491c37){if(_0x491c37){return _0x491c37['destroy']()[_0xc5a3('0x26')](function(){_0x1d3b28[_0xc5a3('0x20')](0xcc)[_0xc5a3('0x1a')]();});}};}function handleEntityNotFound(_0x3ac6f2,_0xe7cc17){return function(_0x184ee0){if(!_0x184ee0){_0x3ac6f2[_0xc5a3('0x19')](0x194);}return _0x184ee0;};}function handleError(_0x36c9bd,_0x2e6101){_0x2e6101=_0x2e6101||0x1f4;return function(_0x1d658d){logger[_0xc5a3('0x27')](_0x1d658d[_0xc5a3('0x28')]);if(_0x1d658d[_0xc5a3('0x29')]){delete _0x1d658d['name'];}_0x36c9bd[_0xc5a3('0x20')](_0x2e6101)[_0xc5a3('0x2a')](_0x1d658d);};}exports['index']=function(_0x244e3c,_0x17bd15){var _0x44679b={},_0x5eab5b={},_0x49edd7={'count':0x0,'rows':[]};var _0x2282d4=_[_0xc5a3('0x2b')](db[_0xc5a3('0x2c')][_0xc5a3('0x2d')],function(_0x1aeaad){return{'name':_0x1aeaad[_0xc5a3('0x2e')],'type':_0x1aeaad[_0xc5a3('0x2f')]['key']};});_0x5eab5b['model']=_[_0xc5a3('0x2b')](_0x2282d4,_0xc5a3('0x29'));_0x5eab5b[_0xc5a3('0x30')]=_[_0xc5a3('0x31')](_0x244e3c[_0xc5a3('0x30')]);_0x5eab5b[_0xc5a3('0x32')]=_[_0xc5a3('0x33')](_0x5eab5b['model'],_0x5eab5b[_0xc5a3('0x30')]);_0x44679b[_0xc5a3('0x34')]=_[_0xc5a3('0x33')](_0x5eab5b[_0xc5a3('0x35')],qs['fields'](_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x36')]));_0x44679b['attributes']=_0x44679b['attributes'][_0xc5a3('0x37')]?_0x44679b[_0xc5a3('0x34')]:_0x5eab5b['model'];if(!_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x38')]('nolimit')){_0x44679b[_0xc5a3('0x1d')]=qs[_0xc5a3('0x1d')](_0x244e3c['query']['limit']);_0x44679b[_0xc5a3('0x1f')]=qs[_0xc5a3('0x1f')](_0x244e3c[_0xc5a3('0x30')]['offset']);}_0x44679b[_0xc5a3('0x39')]=qs['sort'](_0x244e3c['query'][_0xc5a3('0x3a')]);_0x44679b[_0xc5a3('0x3b')]=qs[_0xc5a3('0x32')](_[_0xc5a3('0x3c')](_0x244e3c[_0xc5a3('0x30')],_0x5eab5b[_0xc5a3('0x32')]),_0x2282d4);if(_0x244e3c[_0xc5a3('0x30')]['filter']){_0x44679b[_0xc5a3('0x3b')]=_[_0xc5a3('0x3d')](_0x44679b[_0xc5a3('0x3b')],{'$or':_[_0xc5a3('0x2b')](_0x2282d4,function(_0x2f392a){if(_0x2f392a[_0xc5a3('0x2f')]!==_0xc5a3('0x3e')){var _0x150207={};_0x150207[_0x2f392a['name']]={'$like':'%'+_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x3f')]+'%'};return _0x150207;}})});}_0x44679b=_[_0xc5a3('0x3d')]({},_0x44679b,_0x244e3c[_0xc5a3('0x40')]);var _0x3f1693={'where':_0x44679b[_0xc5a3('0x3b')]};return db['SquareRecording'][_0xc5a3('0x1e')](_0x3f1693)['then'](function(_0x494629){_0x49edd7[_0xc5a3('0x1e')]=_0x494629;if(_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x41')]){_0x44679b[_0xc5a3('0x42')]=[{'all':!![]}];}return db[_0xc5a3('0x2c')][_0xc5a3('0x43')](_0x44679b);})[_0xc5a3('0x26')](function(_0x25b28c){_0x49edd7['rows']=_0x25b28c;return _0x49edd7;})[_0xc5a3('0x26')](respondWithFilteredResult(_0x17bd15,_0x44679b))[_0xc5a3('0x44')](handleError(_0x17bd15,null));};exports[_0xc5a3('0x45')]=function(_0x41fa8d,_0x2d835d){var _0x5be2a3={'raw':!![],'where':{'id':_0x41fa8d[_0xc5a3('0x46')]['id']}},_0x1f71d6={};_0x1f71d6[_0xc5a3('0x35')]=_[_0xc5a3('0x31')](db[_0xc5a3('0x2c')][_0xc5a3('0x2d')]);_0x1f71d6['query']=_[_0xc5a3('0x31')](_0x41fa8d['query']);_0x1f71d6[_0xc5a3('0x32')]=_[_0xc5a3('0x33')](_0x1f71d6[_0xc5a3('0x35')],_0x1f71d6['query']);_0x5be2a3[_0xc5a3('0x34')]=_[_0xc5a3('0x33')](_0x1f71d6['model'],qs[_0xc5a3('0x36')](_0x41fa8d[_0xc5a3('0x30')]['fields']));_0x5be2a3[_0xc5a3('0x34')]=_0x5be2a3[_0xc5a3('0x34')][_0xc5a3('0x37')]?_0x5be2a3[_0xc5a3('0x34')]:_0x1f71d6['model'];if(_0x41fa8d['query'][_0xc5a3('0x41')]){_0x5be2a3[_0xc5a3('0x42')]=[{'all':!![]}];}_0x5be2a3=_[_0xc5a3('0x3d')]({},_0x5be2a3,_0x41fa8d[_0xc5a3('0x40')]);return db[_0xc5a3('0x2c')]['find'](_0x5be2a3)[_0xc5a3('0x26')](handleEntityNotFound(_0x2d835d,null))[_0xc5a3('0x26')](respondWithResult(_0x2d835d,null))['catch'](handleError(_0x2d835d,null));};exports['create']=function(_0x6c933e,_0x4e1a3c){return db[_0xc5a3('0x2c')]['create'](_0x6c933e[_0xc5a3('0x47')],{})[_0xc5a3('0x26')](respondWithResult(_0x4e1a3c,0xc9))[_0xc5a3('0x44')](handleError(_0x4e1a3c,null));};exports[_0xc5a3('0x25')]=function(_0x57385b,_0x1e57ba){if(_0x57385b[_0xc5a3('0x47')]['id']){delete _0x57385b[_0xc5a3('0x47')]['id'];}return db[_0xc5a3('0x2c')][_0xc5a3('0x48')]({'where':{'id':_0x57385b[_0xc5a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e57ba,null))[_0xc5a3('0x26')](saveUpdates(_0x57385b['body'],null))[_0xc5a3('0x26')](respondWithResult(_0x1e57ba,null))[_0xc5a3('0x44')](handleError(_0x1e57ba,null));};exports[_0xc5a3('0x49')]=function(_0x3ec570,_0x5b5d33,_0x31585b){var _0x2c68a5=require(_0xc5a3('0x4a'));var _0x1672dd=![];var _0x273ada={};if(_0x3ec570[_0xc5a3('0x30')][_0xc5a3('0x2f')]&&_0x3ec570[_0xc5a3('0x30')][_0xc5a3('0x2f')]===_0xc5a3('0x4b')){_0x273ada['uniqueid']=_0x3ec570[_0xc5a3('0x46')]['id'];}else{_0x273ada['id']=_0x3ec570['params']['id'];}return db[_0xc5a3('0x2c')][_0xc5a3('0x48')]({'where':_0x273ada,'attributes':['id',_0xc5a3('0x4c'),_0xc5a3('0x4d')],'raw':!![]})[_0xc5a3('0x26')](handleEntityNotFound(_0x5b5d33,null))['then'](function(_0x49f2f1){if(_0x49f2f1){var _0x13a007=_0x49f2f1[_0xc5a3('0x4c')];var _0x3c1b6a=util['format']('%s.cypher',_0x13a007);if(fs[_0xc5a3('0x4e')](_0x3c1b6a)){_0x1672dd=!![];return _0x2c68a5[_0xc5a3('0x4f')](_0x3c1b6a,_0x13a007,config[_0xc5a3('0x50')][_0xc5a3('0x51')])[_0xc5a3('0x26')](function(){return _0x49f2f1;});}return _0x49f2f1;}})[_0xc5a3('0x26')](function(_0x30b54d){if(_0x30b54d){var _0x40fd31=_0x30b54d['savePath'];if(!fs[_0xc5a3('0x4e')](_0x40fd31)){throw new db[(_0xc5a3('0x52'))][(_0xc5a3('0x53'))](_0xc5a3('0x54'));}if(_0x30b54d[_0xc5a3('0x4d')]){return _0x5b5d33[_0xc5a3('0x49')](_0x40fd31,_0x30b54d['filename']+path['extname'](_0x40fd31),function(){if(_0x1672dd){fs[_0xc5a3('0x55')](_0x40fd31);}});}else{return _0x5b5d33[_0xc5a3('0x49')](_0x40fd31,function(_0x2e24ea){if(_0x1672dd){fs[_0xc5a3('0x55')](_0x40fd31);}});}}})[_0xc5a3('0x44')](function(_0x19ad4c){if(_0x19ad4c[_0xc5a3('0x56')]===_0xc5a3('0x54')){_0x5b5d33[_0xc5a3('0x20')](0x194)[_0xc5a3('0x2a')]('Not\x20found');}else{return handleError(_0x5b5d33,null);}});};exports[_0xc5a3('0x57')]=function(_0x551570,_0x351212){return db[_0xc5a3('0x2c')][_0xc5a3('0x48')]({'where':{'id':_0x551570[_0xc5a3('0x46')]['id']}})['then'](function(_0xd47a04){if(_[_0xc5a3('0x58')](_0xd47a04)){throw new ReferenceError(_0xc5a3('0x59'));}return _0xd47a04;})[_0xc5a3('0x26')](function(_0x522061){var _0x23cf0e=_0x522061[_0xc5a3('0x4c')];logger[_0xc5a3('0x5a')](_0xc5a3('0x5b'),_0x23cf0e);if(!_[_0xc5a3('0x58')](_0x522061[_0xc5a3('0x4c')])&&fs[_0xc5a3('0x4e')](_0x23cf0e)){logger[_0xc5a3('0x5a')](_0xc5a3('0x5c')+_0x23cf0e+_0xc5a3('0x5d'));fs[_0xc5a3('0x5e')](_0x23cf0e);}_0x23cf0e=_0x23cf0e+_0xc5a3('0x5f');if(!_[_0xc5a3('0x58')](_0x522061[_0xc5a3('0x4c')])&&fs[_0xc5a3('0x4e')](_0x23cf0e)){logger['info'](_0xc5a3('0x5c')+_0x23cf0e+_0xc5a3('0x5d'));fs['unlinkSync'](_0x23cf0e);}return _0x522061;})[_0xc5a3('0x26')](function(_0x4dfe6d){if(!_0x4dfe6d)throw new InternalError();return _0x4dfe6d[_0xc5a3('0x57')]();})[_0xc5a3('0x26')](function(){_0x351212['status'](0xcc)[_0xc5a3('0x1a')]();})[_0xc5a3('0x44')](handleError(_0x351212,null));}; \ No newline at end of file +var _0xf6ab=['where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','lodash','squel','crypto','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','index','SquareRecording','rawAttributes','fieldName','key','model','map','name','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort'];(function(_0x157ecc,_0x359b87){var _0x1b42a0=function(_0x267cf9){while(--_0x267cf9){_0x157ecc['push'](_0x157ecc['shift']());}};_0x1b42a0(++_0x359b87);}(_0xf6ab,0x1b4));var _0xbf6a=function(_0x2c9c01,_0x34ee5d){_0x2c9c01=_0x2c9c01-0x0;var _0xedea92=_0xf6ab[_0x2c9c01];return _0xedea92;};'use strict';var emlformat=require(_0xbf6a('0x0'));var rimraf=require(_0xbf6a('0x1'));var zipdir=require(_0xbf6a('0x2'));var jsonpatch=require(_0xbf6a('0x3'));var rp=require(_0xbf6a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf6a('0x5'));var util=require('util');var path=require(_0xbf6a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbf6a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf6a('0x8'));var squel=require(_0xbf6a('0x9'));var crypto=require(_0xbf6a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbf6a('0xb'));var toCsv=require(_0xbf6a('0xc'));var querystring=require(_0xbf6a('0xd'));var Papa=require(_0xbf6a('0xe'));var Redis=require(_0xbf6a('0xf'));var authService=require(_0xbf6a('0x10'));var qs=require(_0xbf6a('0x11'));var as=require(_0xbf6a('0x12'));var hardwareService=require(_0xbf6a('0x13'));var logger=require(_0xbf6a('0x14'))(_0xbf6a('0x15'));var utils=require(_0xbf6a('0x16'));var config=require(_0xbf6a('0x17'));var licenseUtil=require(_0xbf6a('0x18'));var db=require(_0xbf6a('0x19'))['db'];function respondWithStatusCode(_0x25f8aa,_0x1ac73d){_0x1ac73d=_0x1ac73d||0xcc;return function(_0x54835c){if(_0x54835c){return _0x25f8aa[_0xbf6a('0x1a')](_0x1ac73d);}return _0x25f8aa['status'](_0x1ac73d)[_0xbf6a('0x1b')]();};}function respondWithResult(_0x312259,_0x1b616c){_0x1b616c=_0x1b616c||0xc8;return function(_0x4a2fb3){if(_0x4a2fb3){return _0x312259[_0xbf6a('0x1c')](_0x1b616c)[_0xbf6a('0x1d')](_0x4a2fb3);}};}function respondWithFilteredResult(_0x1caeea,_0x47df0e){return function(_0x430b09){if(_0x430b09){var _0x5b937c=typeof _0x47df0e[_0xbf6a('0x1e')]===_0xbf6a('0x1f')&&typeof _0x47df0e[_0xbf6a('0x20')]===_0xbf6a('0x1f');var _0x12d1f4=_0x430b09[_0xbf6a('0x21')];var _0x33ec0f=_0x5b937c?0x0:_0x47df0e[_0xbf6a('0x1e')];var _0x58091b=_0x5b937c?_0x430b09['count']:_0x47df0e[_0xbf6a('0x1e')]+_0x47df0e[_0xbf6a('0x20')];var _0x519747;if(_0x58091b>=_0x12d1f4){_0x58091b=_0x12d1f4;_0x519747=0xc8;}else{_0x519747=0xce;}_0x1caeea[_0xbf6a('0x1c')](_0x519747);return _0x1caeea[_0xbf6a('0x22')](_0xbf6a('0x23'),_0x33ec0f+'-'+_0x58091b+'/'+_0x12d1f4)[_0xbf6a('0x1d')](_0x430b09);}return null;};}function patchUpdates(_0x1d86d4){return function(_0x1e13f3){try{jsonpatch[_0xbf6a('0x24')](_0x1e13f3,_0x1d86d4,!![]);}catch(_0x32c864){return BPromise[_0xbf6a('0x25')](_0x32c864);}return _0x1e13f3[_0xbf6a('0x26')]();};}function saveUpdates(_0x43ba57,_0x3dd7ca){return function(_0x2b5e7d){if(_0x2b5e7d){return _0x2b5e7d[_0xbf6a('0x27')](_0x43ba57)[_0xbf6a('0x28')](function(_0x50d84e){return _0x50d84e;});}return null;};}function removeEntity(_0x23aa07,_0x32364f){return function(_0x17b5fd){if(_0x17b5fd){return _0x17b5fd[_0xbf6a('0x29')]()[_0xbf6a('0x28')](function(){_0x23aa07[_0xbf6a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f930f,_0x53e483){return function(_0x39aed5){if(!_0x39aed5){_0x1f930f[_0xbf6a('0x1a')](0x194);}return _0x39aed5;};}function handleError(_0x460de2,_0x576da7){_0x576da7=_0x576da7||0x1f4;return function(_0x4f20c3){logger[_0xbf6a('0x2a')](_0x4f20c3['stack']);if(_0x4f20c3['name']){delete _0x4f20c3['name'];}_0x460de2[_0xbf6a('0x1c')](_0x576da7)['send'](_0x4f20c3);};}exports[_0xbf6a('0x2b')]=function(_0x3d75d1,_0x348e98){var _0x231b6c={},_0x30092d={},_0x182dbd={'count':0x0,'rows':[]};var _0x5cd8ed=_['map'](db[_0xbf6a('0x2c')][_0xbf6a('0x2d')],function(_0x618dc3){return{'name':_0x618dc3[_0xbf6a('0x2e')],'type':_0x618dc3['type'][_0xbf6a('0x2f')]};});_0x30092d[_0xbf6a('0x30')]=_[_0xbf6a('0x31')](_0x5cd8ed,_0xbf6a('0x32'));_0x30092d['query']=_[_0xbf6a('0x33')](_0x3d75d1[_0xbf6a('0x34')]);_0x30092d['filters']=_[_0xbf6a('0x35')](_0x30092d[_0xbf6a('0x30')],_0x30092d[_0xbf6a('0x34')]);_0x231b6c['attributes']=_[_0xbf6a('0x35')](_0x30092d[_0xbf6a('0x30')],qs[_0xbf6a('0x36')](_0x3d75d1[_0xbf6a('0x34')][_0xbf6a('0x36')]));_0x231b6c[_0xbf6a('0x37')]=_0x231b6c[_0xbf6a('0x37')]['length']?_0x231b6c[_0xbf6a('0x37')]:_0x30092d[_0xbf6a('0x30')];if(!_0x3d75d1[_0xbf6a('0x34')][_0xbf6a('0x38')](_0xbf6a('0x39'))){_0x231b6c[_0xbf6a('0x20')]=qs[_0xbf6a('0x20')](_0x3d75d1[_0xbf6a('0x34')][_0xbf6a('0x20')]);_0x231b6c[_0xbf6a('0x1e')]=qs[_0xbf6a('0x1e')](_0x3d75d1['query'][_0xbf6a('0x1e')]);}_0x231b6c['order']=qs['sort'](_0x3d75d1[_0xbf6a('0x34')][_0xbf6a('0x3a')]);_0x231b6c[_0xbf6a('0x3b')]=qs[_0xbf6a('0x3c')](_[_0xbf6a('0x3d')](_0x3d75d1[_0xbf6a('0x34')],_0x30092d[_0xbf6a('0x3c')]),_0x5cd8ed);if(_0x3d75d1[_0xbf6a('0x34')][_0xbf6a('0x3e')]){_0x231b6c[_0xbf6a('0x3b')]=_[_0xbf6a('0x3f')](_0x231b6c[_0xbf6a('0x3b')],{'$or':_[_0xbf6a('0x31')](_0x5cd8ed,function(_0x53e52a){if(_0x53e52a[_0xbf6a('0x40')]!=='VIRTUAL'){var _0x502bde={};_0x502bde[_0x53e52a[_0xbf6a('0x32')]]={'$like':'%'+_0x3d75d1[_0xbf6a('0x34')]['filter']+'%'};return _0x502bde;}})});}_0x231b6c=_[_0xbf6a('0x3f')]({},_0x231b6c,_0x3d75d1[_0xbf6a('0x41')]);var _0x4c01e8={'where':_0x231b6c['where']};return db[_0xbf6a('0x2c')][_0xbf6a('0x21')](_0x4c01e8)[_0xbf6a('0x28')](function(_0x2d2028){_0x182dbd[_0xbf6a('0x21')]=_0x2d2028;if(_0x3d75d1[_0xbf6a('0x34')][_0xbf6a('0x42')]){_0x231b6c[_0xbf6a('0x43')]=[{'all':!![]}];}return db['SquareRecording'][_0xbf6a('0x44')](_0x231b6c);})[_0xbf6a('0x28')](function(_0x1ae8e0){_0x182dbd[_0xbf6a('0x45')]=_0x1ae8e0;return _0x182dbd;})[_0xbf6a('0x28')](respondWithFilteredResult(_0x348e98,_0x231b6c))[_0xbf6a('0x46')](handleError(_0x348e98,null));};exports[_0xbf6a('0x47')]=function(_0x442257,_0x1698a1){var _0x223ecb={'raw':!![],'where':{'id':_0x442257[_0xbf6a('0x48')]['id']}},_0x234d38={};_0x234d38[_0xbf6a('0x30')]=_[_0xbf6a('0x33')](db['SquareRecording']['rawAttributes']);_0x234d38[_0xbf6a('0x34')]=_[_0xbf6a('0x33')](_0x442257[_0xbf6a('0x34')]);_0x234d38[_0xbf6a('0x3c')]=_['intersection'](_0x234d38[_0xbf6a('0x30')],_0x234d38[_0xbf6a('0x34')]);_0x223ecb[_0xbf6a('0x37')]=_[_0xbf6a('0x35')](_0x234d38[_0xbf6a('0x30')],qs['fields'](_0x442257[_0xbf6a('0x34')][_0xbf6a('0x36')]));_0x223ecb['attributes']=_0x223ecb[_0xbf6a('0x37')]['length']?_0x223ecb[_0xbf6a('0x37')]:_0x234d38['model'];if(_0x442257['query'][_0xbf6a('0x42')]){_0x223ecb[_0xbf6a('0x43')]=[{'all':!![]}];}_0x223ecb=_[_0xbf6a('0x3f')]({},_0x223ecb,_0x442257[_0xbf6a('0x41')]);return db[_0xbf6a('0x2c')][_0xbf6a('0x49')](_0x223ecb)['then'](handleEntityNotFound(_0x1698a1,null))[_0xbf6a('0x28')](respondWithResult(_0x1698a1,null))[_0xbf6a('0x46')](handleError(_0x1698a1,null));};exports[_0xbf6a('0x4a')]=function(_0x3c99e4,_0x54dc37){return db[_0xbf6a('0x2c')][_0xbf6a('0x4a')](_0x3c99e4[_0xbf6a('0x4b')],{})[_0xbf6a('0x28')](respondWithResult(_0x54dc37,0xc9))[_0xbf6a('0x46')](handleError(_0x54dc37,null));};exports[_0xbf6a('0x27')]=function(_0x3e0f39,_0x553f0e){if(_0x3e0f39[_0xbf6a('0x4b')]['id']){delete _0x3e0f39[_0xbf6a('0x4b')]['id'];}return db[_0xbf6a('0x2c')][_0xbf6a('0x49')]({'where':{'id':_0x3e0f39[_0xbf6a('0x48')]['id']}})[_0xbf6a('0x28')](handleEntityNotFound(_0x553f0e,null))[_0xbf6a('0x28')](saveUpdates(_0x3e0f39[_0xbf6a('0x4b')],null))['then'](respondWithResult(_0x553f0e,null))[_0xbf6a('0x46')](handleError(_0x553f0e,null));};exports[_0xbf6a('0x4c')]=function(_0x200ab9,_0x1f75d7,_0x2e8c15){var _0x5c1ead=require(_0xbf6a('0x4d'));var _0x358921=![];var _0x34bf85={};if(_0x200ab9[_0xbf6a('0x34')][_0xbf6a('0x40')]&&_0x200ab9[_0xbf6a('0x34')]['type']===_0xbf6a('0x4e')){_0x34bf85[_0xbf6a('0x4e')]=_0x200ab9[_0xbf6a('0x48')]['id'];}else{_0x34bf85['id']=_0x200ab9['params']['id'];}return db[_0xbf6a('0x2c')][_0xbf6a('0x49')]({'where':_0x34bf85,'attributes':['id',_0xbf6a('0x4f'),_0xbf6a('0x50')],'raw':!![]})[_0xbf6a('0x28')](handleEntityNotFound(_0x1f75d7,null))[_0xbf6a('0x28')](function(_0x5f3cf2){if(_0x5f3cf2){var _0x1afac7=_0x5f3cf2[_0xbf6a('0x4f')];var _0x3542c9=util[_0xbf6a('0x51')]('%s.cypher',_0x1afac7);if(fs[_0xbf6a('0x52')](_0x3542c9)){_0x358921=!![];return _0x5c1ead['decryptFile'](_0x3542c9,_0x1afac7,config['secrets'][_0xbf6a('0x53')])[_0xbf6a('0x28')](function(){return _0x5f3cf2;});}return _0x5f3cf2;}})[_0xbf6a('0x28')](function(_0x4b2e8f){if(_0x4b2e8f){var _0x454172=_0x4b2e8f[_0xbf6a('0x4f')];if(!fs[_0xbf6a('0x52')](_0x454172)){throw new db[(_0xbf6a('0x54'))][(_0xbf6a('0x55'))](_0xbf6a('0x56'));}if(_0x4b2e8f[_0xbf6a('0x50')]){return _0x1f75d7[_0xbf6a('0x4c')](_0x454172,_0x4b2e8f[_0xbf6a('0x50')]+path[_0xbf6a('0x57')](_0x454172),function(){if(_0x358921){fs[_0xbf6a('0x58')](_0x454172);}});}else{return _0x1f75d7[_0xbf6a('0x4c')](_0x454172,function(_0x22935a){if(_0x358921){fs[_0xbf6a('0x58')](_0x454172);}});}}})['catch'](function(_0x60e1b4){if(_0x60e1b4[_0xbf6a('0x59')]===_0xbf6a('0x56')){_0x1f75d7['status'](0x194)[_0xbf6a('0x5a')](_0xbf6a('0x5b'));}else{return handleError(_0x1f75d7,null);}});};exports[_0xbf6a('0x29')]=function(_0x1c60da,_0x46c39b){return db[_0xbf6a('0x2c')][_0xbf6a('0x49')]({'where':{'id':_0x1c60da[_0xbf6a('0x48')]['id']}})[_0xbf6a('0x28')](function(_0x35de0c){if(_[_0xbf6a('0x5c')](_0x35de0c)){throw new ReferenceError(_0xbf6a('0x5d'));}return _0x35de0c;})[_0xbf6a('0x28')](function(_0x134fec){var _0x106f52=_0x134fec[_0xbf6a('0x4f')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x106f52);if(!_[_0xbf6a('0x5c')](_0x134fec[_0xbf6a('0x4f')])&&fs[_0xbf6a('0x52')](_0x106f52)){logger[_0xbf6a('0x5e')](_0xbf6a('0x5f')+_0x106f52+_0xbf6a('0x60'));fs['unlinkSync'](_0x106f52);}_0x106f52=_0x106f52+_0xbf6a('0x61');if(!_[_0xbf6a('0x5c')](_0x134fec['savePath'])&&fs['existsSync'](_0x106f52)){logger[_0xbf6a('0x5e')](_0xbf6a('0x5f')+_0x106f52+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbf6a('0x62')](_0x106f52);}return _0x134fec;})[_0xbf6a('0x28')](function(_0x338d71){if(!_0x338d71)throw new InternalError();return _0x338d71[_0xbf6a('0x29')]();})[_0xbf6a('0x28')](function(){_0x46c39b['status'](0xcc)[_0xbf6a('0x1b')]();})[_0xbf6a('0x46')](handleError(_0x46c39b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index dd227d6..eadb45e 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 _0xa7db=['./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7db,0xbf));var _0xba7d=function(_0x2b8dd3,_0x25ccbc){_0x2b8dd3=_0x2b8dd3-0x0;var _0x200b5a=_0xa7db[_0x2b8dd3];return _0x200b5a;};'use strict';var _=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var logger=require(_0xba7d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba7d('0x3'));var fs=require('fs');var path=require(_0xba7d('0x4'));var rimraf=require(_0xba7d('0x5'));var config=require(_0xba7d('0x6'));var attributes=require(_0xba7d('0x7'));module['exports']=function(_0x2f6d8d,_0x257384){return _0x2f6d8d[_0xba7d('0x8')](_0xba7d('0x9'),attributes,{'tableName':_0xba7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9c3=['path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','../../config/logger','moment','bluebird','request-promise'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0xc9c3,0x96));var _0x3c9c=function(_0x1a3bb6,_0x4f1108){_0x1a3bb6=_0x1a3bb6-0x0;var _0x141290=_0xc9c3[_0x1a3bb6];return _0x141290;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c9c('0x0'))('api');var moment=require(_0x3c9c('0x1'));var BPromise=require(_0x3c9c('0x2'));var rp=require(_0x3c9c('0x3'));var fs=require('fs');var path=require(_0x3c9c('0x4'));var rimraf=require(_0x3c9c('0x5'));var config=require(_0x3c9c('0x6'));var attributes=require(_0x3c9c('0x7'));module['exports']=function(_0x48b219,_0x5c86bd){return _0x48b219[_0x3c9c('0x8')](_0x3c9c('0x9'),attributes,{'tableName':_0x3c9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 13a74b5..a92e61f 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 _0x1e94=['body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','create'];(function(_0x36da03,_0x592e0f){var _0x40855a=function(_0x383e1f){while(--_0x383e1f){_0x36da03['push'](_0x36da03['shift']());}};_0x40855a(++_0x592e0f);}(_0x1e94,0x1c3));var _0x41e9=function(_0x4b477a,_0x3e3f1e){_0x4b477a=_0x4b477a-0x0;var _0x291072=_0x1e94[_0x4b477a];return _0x291072;};'use strict';var _=require(_0x41e9('0x0'));var util=require(_0x41e9('0x1'));var moment=require(_0x41e9('0x2'));var BPromise=require(_0x41e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41e9('0x4'));var db=require(_0x41e9('0x5'))['db'];var utils=require(_0x41e9('0x6'));var logger=require(_0x41e9('0x7'))('rpc');var config=require(_0x41e9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x41e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e938d,_0x1c8e11,_0x3c13d4){return new BPromise(function(_0x2dfd83,_0x50f399){return client[_0x41e9('0xa')](_0x1e938d,_0x3c13d4)[_0x41e9('0xb')](function(_0x512e3){logger[_0x41e9('0xc')](_0x41e9('0xd'),_0x1c8e11,_0x41e9('0xe'));logger[_0x41e9('0xf')](_0x41e9('0x10'),_0x1c8e11,'request\x20sent',JSON[_0x41e9('0x11')](_0x512e3));if(_0x512e3[_0x41e9('0x12')]){if(_0x512e3[_0x41e9('0x12')][_0x41e9('0x13')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x1c8e11,_0x512e3[_0x41e9('0x12')][_0x41e9('0x14')]);return _0x50f399(_0x512e3[_0x41e9('0x12')][_0x41e9('0x14')]);}logger[_0x41e9('0x12')](_0x41e9('0xd'),_0x1c8e11,_0x512e3[_0x41e9('0x12')]['message']);return _0x2dfd83(_0x512e3[_0x41e9('0x12')]['message']);}else{logger[_0x41e9('0xc')]('SquareRecording,\x20%s,\x20%s',_0x1c8e11,'request\x20sent');_0x2dfd83(_0x512e3[_0x41e9('0x15')][_0x41e9('0x14')]);}})[_0x41e9('0x16')](function(_0x3b3417){logger[_0x41e9('0x12')]('SquareRecording,\x20%s,\x20%s',_0x1c8e11,_0x3b3417);_0x50f399(_0x3b3417);});});}exports[_0x41e9('0x17')]=function(_0xd7fb5b){var _0x2b132b=this;return new Promise(function(_0x4d7080,_0x580bb9){return db['SquareRecording'][_0x41e9('0x18')](_0xd7fb5b[_0x41e9('0x19')],{'raw':_0xd7fb5b[_0x41e9('0x1a')]?_0xd7fb5b['options'][_0x41e9('0x1b')]===undefined?!![]:![]:!![]})[_0x41e9('0xb')](function(_0x3e0453){logger[_0x41e9('0xc')](_0x41e9('0x17'),_0xd7fb5b);logger['debug']('CreateSquareRecording',_0xd7fb5b,JSON[_0x41e9('0x11')](_0x3e0453));_0x4d7080(_0x3e0453);})[_0x41e9('0x16')](function(_0x33aae5){logger[_0x41e9('0x12')](_0x41e9('0x17'),_0x33aae5[_0x41e9('0x14')],_0xd7fb5b);_0x580bb9(_0x2b132b[_0x41e9('0x12')](0x1f4,_0x33aae5['message']));});});}; \ No newline at end of file +var _0x14a2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareRecording','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x46fcf2,_0x423e90){var _0x454b4b=function(_0x10b7c4){while(--_0x10b7c4){_0x46fcf2['push'](_0x46fcf2['shift']());}};_0x454b4b(++_0x423e90);}(_0x14a2,0x123));var _0x214a=function(_0x445605,_0x5db5d8){_0x445605=_0x445605-0x0;var _0x4704e3=_0x14a2[_0x445605];return _0x4704e3;};'use strict';var _=require('lodash');var util=require(_0x214a('0x0'));var moment=require(_0x214a('0x1'));var BPromise=require('bluebird');var rs=require(_0x214a('0x2'));var fs=require('fs');var Redis=require(_0x214a('0x3'));var db=require(_0x214a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x214a('0x5'))(_0x214a('0x6'));var config=require(_0x214a('0x7'));var jayson=require(_0x214a('0x8'));var client=jayson[_0x214a('0x9')][_0x214a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fef3d,_0x12488c,_0x24c1f6){return new BPromise(function(_0x4975e0,_0x51c549){return client[_0x214a('0xb')](_0x2fef3d,_0x24c1f6)[_0x214a('0xc')](function(_0x1f6d0d){logger[_0x214a('0xd')](_0x214a('0xe'),_0x12488c,_0x214a('0xf'));logger[_0x214a('0x10')](_0x214a('0x11'),_0x12488c,_0x214a('0xf'),JSON[_0x214a('0x12')](_0x1f6d0d));if(_0x1f6d0d[_0x214a('0x13')]){if(_0x1f6d0d['error']['code']===0x1f4){logger[_0x214a('0x13')]('SquareRecording,\x20%s,\x20%s',_0x12488c,_0x1f6d0d['error'][_0x214a('0x14')]);return _0x51c549(_0x1f6d0d[_0x214a('0x13')][_0x214a('0x14')]);}logger['error'](_0x214a('0xe'),_0x12488c,_0x1f6d0d['error'][_0x214a('0x14')]);return _0x4975e0(_0x1f6d0d['error']['message']);}else{logger['info'](_0x214a('0xe'),_0x12488c,_0x214a('0xf'));_0x4975e0(_0x1f6d0d[_0x214a('0x15')][_0x214a('0x14')]);}})[_0x214a('0x16')](function(_0x432456){logger['error'](_0x214a('0xe'),_0x12488c,_0x432456);_0x51c549(_0x432456);});});}exports[_0x214a('0x17')]=function(_0x467580){var _0x4c3a22=this;return new Promise(function(_0x46b466,_0x170a70){return db['SquareRecording']['create'](_0x467580[_0x214a('0x18')],{'raw':_0x467580[_0x214a('0x19')]?_0x467580[_0x214a('0x19')][_0x214a('0x1a')]===undefined?!![]:![]:!![]})[_0x214a('0xc')](function(_0x558b08){logger['info'](_0x214a('0x17'),_0x467580);logger[_0x214a('0x10')](_0x214a('0x17'),_0x467580,JSON[_0x214a('0x12')](_0x558b08));_0x46b466(_0x558b08);})[_0x214a('0x16')](function(_0x403253){logger[_0x214a('0x13')](_0x214a('0x17'),_0x403253[_0x214a('0x14')],_0x467580);_0x170a70(_0x4c3a22[_0x214a('0x13')](0x1f4,_0x403253[_0x214a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 30ae090..bf7320d 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _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(_0x3395b2,_0x57d175){var _0x436b2e=function(_0x1e768a){while(--_0x1e768a){_0x3395b2['push'](_0x3395b2['shift']());}};_0x436b2e(++_0x57d175);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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 bdd1494..7a4260d 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 _0x462c=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0xd03256,_0x53527d){var _0x335958=function(_0x959fe4){while(--_0x959fe4){_0xd03256['push'](_0xd03256['shift']());}};_0x335958(++_0x53527d);}(_0x462c,0xf6));var _0xc462=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x462c[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xc462('0x0'));module[_0xc462('0x1')]={'network':{'type':Sequelize[_0xc462('0x2')]},'network_script':{'type':Sequelize[_0xc462('0x2')]},'request':{'type':Sequelize[_0xc462('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc462('0x2')]},'uniqueid':{'type':Sequelize[_0xc462('0x2')]},'version':{'type':Sequelize[_0xc462('0x2')]},'callerid':{'type':Sequelize[_0xc462('0x2')]},'calleridname':{'type':Sequelize[_0xc462('0x2')]},'callingpres':{'type':Sequelize[_0xc462('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xc462('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xc462('0x2')]},'priority':{'type':Sequelize[_0xc462('0x2')]},'enhanced':{'type':Sequelize[_0xc462('0x2')]},'accountcode':{'type':Sequelize[_0xc462('0x2')]},'threadid':{'type':Sequelize[_0xc462('0x2')]},'project_name':{'type':Sequelize[_0xc462('0x2')]},'joinAt':{'type':Sequelize[_0xc462('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xc462('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf1f5=['BOOLEAN','exports','STRING','DATE'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0xf1f5,0x1e1));var _0x5f1f=function(_0x4e4315,_0x5d7615){_0x4e4315=_0x4e4315-0x0;var _0x31f97a=_0xf1f5[_0x4e4315];return _0x31f97a;};'use strict';var Sequelize=require('sequelize');module[_0x5f1f('0x0')]={'network':{'type':Sequelize[_0x5f1f('0x1')]},'network_script':{'type':Sequelize[_0x5f1f('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5f1f('0x1')]},'language':{'type':Sequelize[_0x5f1f('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5f1f('0x1')]},'version':{'type':Sequelize[_0x5f1f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5f1f('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x5f1f('0x1')]},'callington':{'type':Sequelize[_0x5f1f('0x1')]},'callingtns':{'type':Sequelize[_0x5f1f('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5f1f('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5f1f('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x5f1f('0x1')]},'project_name':{'type':Sequelize[_0x5f1f('0x1')]},'joinAt':{'type':Sequelize[_0x5f1f('0x2')]},'leaveAt':{'type':Sequelize[_0x5f1f('0x2')]},'bot':{'type':Sequelize[_0x5f1f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index c5c178d..3cb0a7d 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 _0x0964=['index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SquareReport','findAll','rows','show','params','include','merge','find','catch','create','body','update','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','error','name','send'];(function(_0xe5f98c,_0x3a6ed9){var _0xbb6f62=function(_0x26090){while(--_0x26090){_0xe5f98c['push'](_0xe5f98c['shift']());}};_0xbb6f62(++_0x3a6ed9);}(_0x0964,0x1d9));var _0x4096=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0964[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x4096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4096('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4096('0x2'));var BPromise=require(_0x4096('0x3'));var Mustache=require(_0x4096('0x4'));var util=require(_0x4096('0x5'));var path=require(_0x4096('0x6'));var sox=require('sox');var csv=require(_0x4096('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4096('0x8'));var _=require('lodash');var squel=require(_0x4096('0x9'));var crypto=require(_0x4096('0xa'));var jsforce=require(_0x4096('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4096('0x7'));var querystring=require(_0x4096('0xc'));var Papa=require('papaparse');var Redis=require(_0x4096('0xd'));var authService=require(_0x4096('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4096('0xf'))(_0x4096('0x10'));var utils=require(_0x4096('0x11'));var config=require(_0x4096('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4096('0x13'))['db'];function respondWithStatusCode(_0x54f029,_0x30afaf){_0x30afaf=_0x30afaf||0xcc;return function(_0x4eeab2){if(_0x4eeab2){return _0x54f029[_0x4096('0x14')](_0x30afaf);}return _0x54f029[_0x4096('0x15')](_0x30afaf)['end']();};}function respondWithResult(_0x30577,_0x2e7018){_0x2e7018=_0x2e7018||0xc8;return function(_0x1f6e71){if(_0x1f6e71){return _0x30577['status'](_0x2e7018)[_0x4096('0x16')](_0x1f6e71);}};}function respondWithFilteredResult(_0x444655,_0x5c94b7){return function(_0xa6f351){if(_0xa6f351){var _0x186533=typeof _0x5c94b7[_0x4096('0x17')]==='undefined'&&typeof _0x5c94b7[_0x4096('0x18')]===_0x4096('0x19');var _0x5f81ae=_0xa6f351['count'];var _0x36990d=_0x186533?0x0:_0x5c94b7[_0x4096('0x17')];var _0x338672=_0x186533?_0xa6f351[_0x4096('0x1a')]:_0x5c94b7['offset']+_0x5c94b7['limit'];var _0x38c3b5;if(_0x338672>=_0x5f81ae){_0x338672=_0x5f81ae;_0x38c3b5=0xc8;}else{_0x38c3b5=0xce;}_0x444655[_0x4096('0x15')](_0x38c3b5);return _0x444655[_0x4096('0x1b')](_0x4096('0x1c'),_0x36990d+'-'+_0x338672+'/'+_0x5f81ae)[_0x4096('0x16')](_0xa6f351);}return null;};}function patchUpdates(_0x53fa89){return function(_0x4c24c7){try{jsonpatch[_0x4096('0x1d')](_0x4c24c7,_0x53fa89,!![]);}catch(_0x4e787b){return BPromise[_0x4096('0x1e')](_0x4e787b);}return _0x4c24c7[_0x4096('0x1f')]();};}function saveUpdates(_0x33c4eb,_0x1809e1){return function(_0x5b5145){if(_0x5b5145){return _0x5b5145['update'](_0x33c4eb)['then'](function(_0x13ae58){return _0x13ae58;});}return null;};}function removeEntity(_0x273680,_0x1f9e0b){return function(_0x50acd4){if(_0x50acd4){return _0x50acd4[_0x4096('0x20')]()[_0x4096('0x21')](function(){_0x273680['status'](0xcc)[_0x4096('0x22')]();});}};}function handleEntityNotFound(_0x29123d,_0x29d868){return function(_0x14b7ed){if(!_0x14b7ed){_0x29123d['sendStatus'](0x194);}return _0x14b7ed;};}function handleError(_0x52b4a0,_0x19e057){_0x19e057=_0x19e057||0x1f4;return function(_0x2cbe74){logger[_0x4096('0x23')](_0x2cbe74['stack']);if(_0x2cbe74[_0x4096('0x24')]){delete _0x2cbe74[_0x4096('0x24')];}_0x52b4a0[_0x4096('0x15')](_0x19e057)[_0x4096('0x25')](_0x2cbe74);};}exports[_0x4096('0x26')]=function(_0x594d50,_0x5f48e0){var _0x493691={},_0x361016={},_0x43dcee={'count':0x0,'rows':[]};var _0x1cc7ea=_[_0x4096('0x27')](db['SquareReport'][_0x4096('0x28')],function(_0x2f06cd){return{'name':_0x2f06cd['fieldName'],'type':_0x2f06cd[_0x4096('0x29')][_0x4096('0x2a')]};});_0x361016['model']=_[_0x4096('0x27')](_0x1cc7ea,_0x4096('0x24'));_0x361016[_0x4096('0x2b')]=_[_0x4096('0x2c')](_0x594d50[_0x4096('0x2b')]);_0x361016[_0x4096('0x2d')]=_[_0x4096('0x2e')](_0x361016[_0x4096('0x2f')],_0x361016[_0x4096('0x2b')]);_0x493691[_0x4096('0x30')]=_[_0x4096('0x2e')](_0x361016[_0x4096('0x2f')],qs[_0x4096('0x31')](_0x594d50[_0x4096('0x2b')]['fields']));_0x493691[_0x4096('0x30')]=_0x493691['attributes'][_0x4096('0x32')]?_0x493691[_0x4096('0x30')]:_0x361016[_0x4096('0x2f')];if(!_0x594d50['query'][_0x4096('0x33')](_0x4096('0x34'))){_0x493691[_0x4096('0x18')]=qs[_0x4096('0x18')](_0x594d50[_0x4096('0x2b')][_0x4096('0x18')]);_0x493691['offset']=qs[_0x4096('0x17')](_0x594d50[_0x4096('0x2b')][_0x4096('0x17')]);}_0x493691[_0x4096('0x35')]=qs[_0x4096('0x36')](_0x594d50[_0x4096('0x2b')][_0x4096('0x36')]);_0x493691[_0x4096('0x37')]=qs[_0x4096('0x2d')](_[_0x4096('0x38')](_0x594d50['query'],_0x361016[_0x4096('0x2d')]),_0x1cc7ea);if(_0x594d50['query'][_0x4096('0x39')]){_0x493691[_0x4096('0x37')]=_['merge'](_0x493691[_0x4096('0x37')],{'$or':_[_0x4096('0x27')](_0x1cc7ea,function(_0x417492){if(_0x417492[_0x4096('0x29')]!==_0x4096('0x3a')){var _0x25c9fa={};_0x25c9fa[_0x417492[_0x4096('0x24')]]={'$like':'%'+_0x594d50['query'][_0x4096('0x39')]+'%'};return _0x25c9fa;}})});}_0x493691=_['merge']({},_0x493691,_0x594d50[_0x4096('0x3b')]);var _0x4d4677={'where':_0x493691[_0x4096('0x37')]};return db[_0x4096('0x3c')]['count'](_0x4d4677)[_0x4096('0x21')](function(_0x11814e){_0x43dcee['count']=_0x11814e;if(_0x594d50['query']['includeAll']){_0x493691['include']=[{'all':!![]}];}return db[_0x4096('0x3c')][_0x4096('0x3d')](_0x493691);})[_0x4096('0x21')](function(_0x2544ad){_0x43dcee[_0x4096('0x3e')]=_0x2544ad;return _0x43dcee;})['then'](respondWithFilteredResult(_0x5f48e0,_0x493691))['catch'](handleError(_0x5f48e0,null));};exports[_0x4096('0x3f')]=function(_0x15776a,_0x3f504b){var _0x72f466={'raw':!![],'where':{'id':_0x15776a[_0x4096('0x40')]['id']}},_0x199aea={};_0x199aea[_0x4096('0x2f')]=_['keys'](db[_0x4096('0x3c')][_0x4096('0x28')]);_0x199aea[_0x4096('0x2b')]=_[_0x4096('0x2c')](_0x15776a[_0x4096('0x2b')]);_0x199aea[_0x4096('0x2d')]=_[_0x4096('0x2e')](_0x199aea[_0x4096('0x2f')],_0x199aea[_0x4096('0x2b')]);_0x72f466[_0x4096('0x30')]=_[_0x4096('0x2e')](_0x199aea['model'],qs['fields'](_0x15776a[_0x4096('0x2b')]['fields']));_0x72f466[_0x4096('0x30')]=_0x72f466[_0x4096('0x30')]['length']?_0x72f466[_0x4096('0x30')]:_0x199aea[_0x4096('0x2f')];if(_0x15776a['query']['includeAll']){_0x72f466[_0x4096('0x41')]=[{'all':!![]}];}_0x72f466=_[_0x4096('0x42')]({},_0x72f466,_0x15776a['options']);return db[_0x4096('0x3c')][_0x4096('0x43')](_0x72f466)[_0x4096('0x21')](handleEntityNotFound(_0x3f504b,null))[_0x4096('0x21')](respondWithResult(_0x3f504b,null))[_0x4096('0x44')](handleError(_0x3f504b,null));};exports[_0x4096('0x45')]=function(_0x2ca4c1,_0x74b475){return db['SquareReport']['create'](_0x2ca4c1[_0x4096('0x46')],{})[_0x4096('0x21')](respondWithResult(_0x74b475,0xc9))[_0x4096('0x44')](handleError(_0x74b475,null));};exports[_0x4096('0x47')]=function(_0x65ad82,_0x113720){if(_0x65ad82[_0x4096('0x46')]['id']){delete _0x65ad82[_0x4096('0x46')]['id'];}return db[_0x4096('0x3c')][_0x4096('0x43')]({'where':{'id':_0x65ad82[_0x4096('0x40')]['id']}})[_0x4096('0x21')](handleEntityNotFound(_0x113720,null))[_0x4096('0x21')](saveUpdates(_0x65ad82[_0x4096('0x46')],null))[_0x4096('0x21')](respondWithResult(_0x113720,null))[_0x4096('0x44')](handleError(_0x113720,null));};exports['destroy']=function(_0x38cbb4,_0x18e21c){return db[_0x4096('0x3c')][_0x4096('0x43')]({'where':{'id':_0x38cbb4[_0x4096('0x40')]['id']}})['then'](handleEntityNotFound(_0x18e21c,null))[_0x4096('0x21')](removeEntity(_0x18e21c,null))[_0x4096('0x44')](handleError(_0x18e21c,null));};exports[_0x4096('0x48')]=function(_0x36dccc,_0x110b9f){return db[_0x4096('0x3c')]['describe']()['then'](respondWithResult(_0x110b9f,null))[_0x4096('0x44')](handleError(_0x110b9f,null));}; \ No newline at end of file +var _0xafcc=['describe','eml-format','zip-dir','fast-json-patch','moment','util','path','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','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SquareReport','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','update'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0xafcc,0x182));var _0xcafc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafcc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcafc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcafc('0x1'));var jsonpatch=require(_0xcafc('0x2'));var rp=require('request-promise');var moment=require(_0xcafc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcafc('0x4'));var path=require(_0xcafc('0x5'));var sox=require(_0xcafc('0x6'));var csv=require(_0xcafc('0x7'));var ejs=require(_0xcafc('0x8'));var fs=require('fs');var fs_extra=require(_0xcafc('0x9'));var _=require(_0xcafc('0xa'));var squel=require('squel');var crypto=require(_0xcafc('0xb'));var jsforce=require(_0xcafc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcafc('0xd'));var Papa=require(_0xcafc('0xe'));var Redis=require(_0xcafc('0xf'));var authService=require(_0xcafc('0x10'));var qs=require(_0xcafc('0x11'));var as=require(_0xcafc('0x12'));var hardwareService=require(_0xcafc('0x13'));var logger=require(_0xcafc('0x14'))(_0xcafc('0x15'));var utils=require(_0xcafc('0x16'));var config=require(_0xcafc('0x17'));var licenseUtil=require(_0xcafc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3efc0b,_0x5dc975){_0x5dc975=_0x5dc975||0xcc;return function(_0x44629a){if(_0x44629a){return _0x3efc0b[_0xcafc('0x19')](_0x5dc975);}return _0x3efc0b['status'](_0x5dc975)[_0xcafc('0x1a')]();};}function respondWithResult(_0x5b4efe,_0x3ed651){_0x3ed651=_0x3ed651||0xc8;return function(_0x156fb3){if(_0x156fb3){return _0x5b4efe['status'](_0x3ed651)[_0xcafc('0x1b')](_0x156fb3);}};}function respondWithFilteredResult(_0x11290f,_0x4bc7ba){return function(_0x36c0c6){if(_0x36c0c6){var _0x4c7382=typeof _0x4bc7ba[_0xcafc('0x1c')]===_0xcafc('0x1d')&&typeof _0x4bc7ba[_0xcafc('0x1e')]===_0xcafc('0x1d');var _0x240ee7=_0x36c0c6[_0xcafc('0x1f')];var _0x2595ed=_0x4c7382?0x0:_0x4bc7ba['offset'];var _0x63cac6=_0x4c7382?_0x36c0c6[_0xcafc('0x1f')]:_0x4bc7ba[_0xcafc('0x1c')]+_0x4bc7ba[_0xcafc('0x1e')];var _0x3414ad;if(_0x63cac6>=_0x240ee7){_0x63cac6=_0x240ee7;_0x3414ad=0xc8;}else{_0x3414ad=0xce;}_0x11290f[_0xcafc('0x20')](_0x3414ad);return _0x11290f[_0xcafc('0x21')](_0xcafc('0x22'),_0x2595ed+'-'+_0x63cac6+'/'+_0x240ee7)[_0xcafc('0x1b')](_0x36c0c6);}return null;};}function patchUpdates(_0x54dbc3){return function(_0x334e6a){try{jsonpatch[_0xcafc('0x23')](_0x334e6a,_0x54dbc3,!![]);}catch(_0x3cb409){return BPromise[_0xcafc('0x24')](_0x3cb409);}return _0x334e6a[_0xcafc('0x25')]();};}function saveUpdates(_0x3e760e,_0x327b82){return function(_0x412c47){if(_0x412c47){return _0x412c47['update'](_0x3e760e)[_0xcafc('0x26')](function(_0x12e623){return _0x12e623;});}return null;};}function removeEntity(_0x477b4f,_0x5a100c){return function(_0x8c741f){if(_0x8c741f){return _0x8c741f[_0xcafc('0x27')]()[_0xcafc('0x26')](function(){_0x477b4f[_0xcafc('0x20')](0xcc)[_0xcafc('0x1a')]();});}};}function handleEntityNotFound(_0x58441c,_0x29efa8){return function(_0x21f281){if(!_0x21f281){_0x58441c[_0xcafc('0x19')](0x194);}return _0x21f281;};}function handleError(_0xb5e0d4,_0x3e9427){_0x3e9427=_0x3e9427||0x1f4;return function(_0x22ad84){logger[_0xcafc('0x28')](_0x22ad84[_0xcafc('0x29')]);if(_0x22ad84[_0xcafc('0x2a')]){delete _0x22ad84['name'];}_0xb5e0d4[_0xcafc('0x20')](_0x3e9427)[_0xcafc('0x2b')](_0x22ad84);};}exports[_0xcafc('0x2c')]=function(_0x4a9a19,_0x525ea6){var _0x1d4037={},_0x231382={},_0x59c1f0={'count':0x0,'rows':[]};var _0x40951e=_['map'](db[_0xcafc('0x2d')]['rawAttributes'],function(_0x2157f7){return{'name':_0x2157f7[_0xcafc('0x2e')],'type':_0x2157f7[_0xcafc('0x2f')][_0xcafc('0x30')]};});_0x231382[_0xcafc('0x31')]=_[_0xcafc('0x32')](_0x40951e,'name');_0x231382['query']=_[_0xcafc('0x33')](_0x4a9a19['query']);_0x231382['filters']=_[_0xcafc('0x34')](_0x231382[_0xcafc('0x31')],_0x231382[_0xcafc('0x35')]);_0x1d4037[_0xcafc('0x36')]=_[_0xcafc('0x34')](_0x231382[_0xcafc('0x31')],qs[_0xcafc('0x37')](_0x4a9a19[_0xcafc('0x35')][_0xcafc('0x37')]));_0x1d4037[_0xcafc('0x36')]=_0x1d4037['attributes']['length']?_0x1d4037[_0xcafc('0x36')]:_0x231382[_0xcafc('0x31')];if(!_0x4a9a19[_0xcafc('0x35')][_0xcafc('0x38')]('nolimit')){_0x1d4037[_0xcafc('0x1e')]=qs[_0xcafc('0x1e')](_0x4a9a19[_0xcafc('0x35')][_0xcafc('0x1e')]);_0x1d4037[_0xcafc('0x1c')]=qs['offset'](_0x4a9a19['query'][_0xcafc('0x1c')]);}_0x1d4037[_0xcafc('0x39')]=qs[_0xcafc('0x3a')](_0x4a9a19['query']['sort']);_0x1d4037[_0xcafc('0x3b')]=qs['filters'](_['pick'](_0x4a9a19[_0xcafc('0x35')],_0x231382[_0xcafc('0x3c')]),_0x40951e);if(_0x4a9a19[_0xcafc('0x35')][_0xcafc('0x3d')]){_0x1d4037[_0xcafc('0x3b')]=_['merge'](_0x1d4037['where'],{'$or':_[_0xcafc('0x32')](_0x40951e,function(_0x2282d2){if(_0x2282d2[_0xcafc('0x2f')]!=='VIRTUAL'){var _0x33b8ca={};_0x33b8ca[_0x2282d2[_0xcafc('0x2a')]]={'$like':'%'+_0x4a9a19['query'][_0xcafc('0x3d')]+'%'};return _0x33b8ca;}})});}_0x1d4037=_['merge']({},_0x1d4037,_0x4a9a19[_0xcafc('0x3e')]);var _0x2e71dd={'where':_0x1d4037[_0xcafc('0x3b')]};return db['SquareReport'][_0xcafc('0x1f')](_0x2e71dd)[_0xcafc('0x26')](function(_0x376954){_0x59c1f0[_0xcafc('0x1f')]=_0x376954;if(_0x4a9a19['query'][_0xcafc('0x3f')]){_0x1d4037[_0xcafc('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0xcafc('0x41')](_0x1d4037);})[_0xcafc('0x26')](function(_0x54cb21){_0x59c1f0[_0xcafc('0x42')]=_0x54cb21;return _0x59c1f0;})['then'](respondWithFilteredResult(_0x525ea6,_0x1d4037))[_0xcafc('0x43')](handleError(_0x525ea6,null));};exports[_0xcafc('0x44')]=function(_0x3d66d9,_0x598ff9){var _0x207bf8={'raw':!![],'where':{'id':_0x3d66d9[_0xcafc('0x45')]['id']}},_0x249b0a={};_0x249b0a['model']=_[_0xcafc('0x33')](db['SquareReport'][_0xcafc('0x46')]);_0x249b0a[_0xcafc('0x35')]=_[_0xcafc('0x33')](_0x3d66d9['query']);_0x249b0a[_0xcafc('0x3c')]=_[_0xcafc('0x34')](_0x249b0a[_0xcafc('0x31')],_0x249b0a[_0xcafc('0x35')]);_0x207bf8[_0xcafc('0x36')]=_[_0xcafc('0x34')](_0x249b0a[_0xcafc('0x31')],qs[_0xcafc('0x37')](_0x3d66d9[_0xcafc('0x35')][_0xcafc('0x37')]));_0x207bf8[_0xcafc('0x36')]=_0x207bf8[_0xcafc('0x36')]['length']?_0x207bf8[_0xcafc('0x36')]:_0x249b0a['model'];if(_0x3d66d9[_0xcafc('0x35')][_0xcafc('0x3f')]){_0x207bf8[_0xcafc('0x40')]=[{'all':!![]}];}_0x207bf8=_[_0xcafc('0x47')]({},_0x207bf8,_0x3d66d9[_0xcafc('0x3e')]);return db[_0xcafc('0x2d')][_0xcafc('0x48')](_0x207bf8)[_0xcafc('0x26')](handleEntityNotFound(_0x598ff9,null))[_0xcafc('0x26')](respondWithResult(_0x598ff9,null))[_0xcafc('0x43')](handleError(_0x598ff9,null));};exports[_0xcafc('0x49')]=function(_0x1ed7a2,_0x361599){return db[_0xcafc('0x2d')]['create'](_0x1ed7a2[_0xcafc('0x4a')],{})[_0xcafc('0x26')](respondWithResult(_0x361599,0xc9))['catch'](handleError(_0x361599,null));};exports[_0xcafc('0x4b')]=function(_0x132bac,_0x3010f8){if(_0x132bac[_0xcafc('0x4a')]['id']){delete _0x132bac['body']['id'];}return db[_0xcafc('0x2d')][_0xcafc('0x48')]({'where':{'id':_0x132bac[_0xcafc('0x45')]['id']}})[_0xcafc('0x26')](handleEntityNotFound(_0x3010f8,null))[_0xcafc('0x26')](saveUpdates(_0x132bac[_0xcafc('0x4a')],null))[_0xcafc('0x26')](respondWithResult(_0x3010f8,null))[_0xcafc('0x43')](handleError(_0x3010f8,null));};exports[_0xcafc('0x27')]=function(_0x104ee4,_0x4cbccb){return db[_0xcafc('0x2d')]['find']({'where':{'id':_0x104ee4['params']['id']}})[_0xcafc('0x26')](handleEntityNotFound(_0x4cbccb,null))[_0xcafc('0x26')](removeEntity(_0x4cbccb,null))[_0xcafc('0x43')](handleError(_0x4cbccb,null));};exports[_0xcafc('0x4c')]=function(_0x1b3f96,_0x1a0274){return db['SquareReport']['describe']()[_0xcafc('0x26')](respondWithResult(_0x1a0274,null))[_0xcafc('0x43')](handleError(_0x1a0274,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ff61034..ed5cc3f 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 _0xf6ee=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x502662,_0x2a759d){var _0x413217=function(_0x1b9542){while(--_0x1b9542){_0x502662['push'](_0x502662['shift']());}};_0x413217(++_0x2a759d);}(_0xf6ee,0x1c9));var _0xef6e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf6ee[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xef6e('0x0'));var util=require('util');var logger=require(_0xef6e('0x1'))(_0xef6e('0x2'));var moment=require('moment');var BPromise=require(_0xef6e('0x3'));var rp=require(_0xef6e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef6e('0x5'));var config=require(_0xef6e('0x6'));var attributes=require(_0xef6e('0x7'));module[_0xef6e('0x8')]=function(_0x3d8a01,_0x312f1a){return _0x3d8a01[_0xef6e('0x9')](_0xef6e('0xa'),attributes,{'tableName':_0xef6e('0xb'),'paranoid':![],'indexes':[{'name':_0xef6e('0xc'),'fields':[_0xef6e('0xd'),_0xef6e('0xe')]},{'name':'leaveAt','fields':[_0xef6e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x35f6=['request-promise','path','rimraf','../../config/environment','exports','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x35f6,0x1ad));var _0x635f=function(_0x45a261,_0x4a1eef){_0x45a261=_0x45a261-0x0;var _0x547e25=_0x35f6[_0x45a261];return _0x547e25;};'use strict';var _=require(_0x635f('0x0'));var util=require(_0x635f('0x1'));var logger=require(_0x635f('0x2'))(_0x635f('0x3'));var moment=require(_0x635f('0x4'));var BPromise=require('bluebird');var rp=require(_0x635f('0x5'));var fs=require('fs');var path=require(_0x635f('0x6'));var rimraf=require(_0x635f('0x7'));var config=require(_0x635f('0x8'));var attributes=require('./squareReport.attributes');module[_0x635f('0x9')]=function(_0x57b753,_0x35ce7c){return _0x57b753['define']('SquareReport',attributes,{'tableName':_0x635f('0xa'),'paranoid':![],'indexes':[{'name':_0x635f('0xb'),'fields':[_0x635f('0xc'),'project_name']},{'name':_0x635f('0xd'),'fields':[_0x635f('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 ce30243..ee806cb 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 _0x53e0=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','body','options','then','debug','UpdateSquareReport','update','raw','where','limit','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent'];(function(_0x3ae38d,_0x2357de){var _0x4e7d5e=function(_0xd99aee){while(--_0xd99aee){_0x3ae38d['push'](_0x3ae38d['shift']());}};_0x4e7d5e(++_0x2357de);}(_0x53e0,0x8f));var _0x053e=function(_0x173dd9,_0x4ecf44){_0x173dd9=_0x173dd9-0x0;var _0x5a0d5a=_0x53e0[_0x173dd9];return _0x5a0d5a;};'use strict';var _=require(_0x053e('0x0'));var util=require('util');var moment=require(_0x053e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x053e('0x2'))['db'];var utils=require(_0x053e('0x3'));var logger=require(_0x053e('0x4'))(_0x053e('0x5'));var config=require(_0x053e('0x6'));var jayson=require(_0x053e('0x7'));var client=jayson[_0x053e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461d41,_0x3f174e,_0x1cc7d1){return new BPromise(function(_0x20c317,_0xcde946){return client[_0x053e('0x9')](_0x461d41,_0x1cc7d1)['then'](function(_0x235355){logger[_0x053e('0xa')]('SquareReport,\x20%s,\x20%s',_0x3f174e,_0x053e('0xb'));logger['debug'](_0x053e('0xc'),_0x3f174e,_0x053e('0xb'),JSON[_0x053e('0xd')](_0x235355));if(_0x235355[_0x053e('0xe')]){if(_0x235355[_0x053e('0xe')][_0x053e('0xf')]===0x1f4){logger[_0x053e('0xe')](_0x053e('0x10'),_0x3f174e,_0x235355['error'][_0x053e('0x11')]);return _0xcde946(_0x235355[_0x053e('0xe')][_0x053e('0x11')]);}logger[_0x053e('0xe')](_0x053e('0x10'),_0x3f174e,_0x235355[_0x053e('0xe')]['message']);return _0x20c317(_0x235355[_0x053e('0xe')][_0x053e('0x11')]);}else{logger['info'](_0x053e('0x10'),_0x3f174e,_0x053e('0xb'));_0x20c317(_0x235355[_0x053e('0x12')][_0x053e('0x11')]);}})[_0x053e('0x13')](function(_0x50a56c){logger[_0x053e('0xe')]('SquareReport,\x20%s,\x20%s',_0x3f174e,_0x50a56c);_0xcde946(_0x50a56c);});});}exports[_0x053e('0x14')]=function(_0x5587d4){var _0x583eba=this;return new Promise(function(_0x267c00,_0x5e3e84){return db[_0x053e('0x15')]['create'](_0x5587d4[_0x053e('0x16')],{'raw':_0x5587d4['options']?_0x5587d4[_0x053e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x053e('0x18')](function(_0x4e0bea){logger[_0x053e('0xa')]('CreateSquareReport',_0x5587d4);logger[_0x053e('0x19')](_0x053e('0x14'),_0x5587d4,JSON[_0x053e('0xd')](_0x4e0bea));_0x267c00(_0x4e0bea);})[_0x053e('0x13')](function(_0x40c819){logger['error'](_0x053e('0x14'),_0x40c819[_0x053e('0x11')],_0x5587d4);_0x5e3e84(_0x583eba[_0x053e('0xe')](0x1f4,_0x40c819[_0x053e('0x11')]));});});};exports[_0x053e('0x1a')]=function(_0x3f07ff){var _0x1c1849=this;return new Promise(function(_0x22720e,_0x3f75c2){return db['SquareReport'][_0x053e('0x1b')](_0x3f07ff[_0x053e('0x16')],{'raw':_0x3f07ff[_0x053e('0x17')]?_0x3f07ff[_0x053e('0x17')][_0x053e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f07ff[_0x053e('0x17')]?_0x3f07ff[_0x053e('0x17')][_0x053e('0x1d')]||null:null,'attributes':_0x3f07ff['options']?_0x3f07ff[_0x053e('0x17')]['attributes']||null:null,'limit':_0x3f07ff[_0x053e('0x17')]?_0x3f07ff['options'][_0x053e('0x1e')]||null:null})[_0x053e('0x18')](function(_0x4d517f){logger['info'](_0x053e('0x1a'),_0x3f07ff);logger[_0x053e('0x19')](_0x053e('0x1a'),_0x3f07ff,JSON[_0x053e('0xd')](_0x4d517f));_0x22720e(_0x4d517f);})[_0x053e('0x13')](function(_0x1f9cbe){logger[_0x053e('0xe')](_0x053e('0x1a'),_0x1f9cbe[_0x053e('0x11')],_0x3f07ff);_0x3f75c2(_0x1c1849[_0x053e('0xe')](0x1f4,_0x1f9cbe['message']));});});}; \ No newline at end of file +var _0x575d=['client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x575d,0x1ee));var _0xd575=function(_0xb9a1,_0x407d8c){_0xb9a1=_0xb9a1-0x0;var _0x5d9766=_0x575d[_0xb9a1];return _0x5d9766;};'use strict';var _=require(_0xd575('0x0'));var util=require(_0xd575('0x1'));var moment=require(_0xd575('0x2'));var BPromise=require(_0xd575('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd575('0x4'))['db'];var utils=require(_0xd575('0x5'));var logger=require(_0xd575('0x6'))(_0xd575('0x7'));var config=require(_0xd575('0x8'));var jayson=require(_0xd575('0x9'));var client=jayson[_0xd575('0xa')][_0xd575('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4952eb,_0x2617c4,_0x2c04ec){return new BPromise(function(_0x6dcbc8,_0x5c09d9){return client[_0xd575('0xc')](_0x4952eb,_0x2c04ec)[_0xd575('0xd')](function(_0x1a1b9a){logger[_0xd575('0xe')](_0xd575('0xf'),_0x2617c4,'request\x20sent');logger[_0xd575('0x10')](_0xd575('0x11'),_0x2617c4,_0xd575('0x12'),JSON[_0xd575('0x13')](_0x1a1b9a));if(_0x1a1b9a[_0xd575('0x14')]){if(_0x1a1b9a['error'][_0xd575('0x15')]===0x1f4){logger[_0xd575('0x14')](_0xd575('0xf'),_0x2617c4,_0x1a1b9a['error']['message']);return _0x5c09d9(_0x1a1b9a[_0xd575('0x14')][_0xd575('0x16')]);}logger[_0xd575('0x14')]('SquareReport,\x20%s,\x20%s',_0x2617c4,_0x1a1b9a[_0xd575('0x14')][_0xd575('0x16')]);return _0x6dcbc8(_0x1a1b9a[_0xd575('0x14')][_0xd575('0x16')]);}else{logger[_0xd575('0xe')]('SquareReport,\x20%s,\x20%s',_0x2617c4,_0xd575('0x12'));_0x6dcbc8(_0x1a1b9a[_0xd575('0x17')][_0xd575('0x16')]);}})[_0xd575('0x18')](function(_0x31b723){logger[_0xd575('0x14')](_0xd575('0xf'),_0x2617c4,_0x31b723);_0x5c09d9(_0x31b723);});});}exports[_0xd575('0x19')]=function(_0xbd7f56){var _0x52f3ee=this;return new Promise(function(_0x428825,_0x3a054c){return db[_0xd575('0x1a')][_0xd575('0x1b')](_0xbd7f56[_0xd575('0x1c')],{'raw':_0xbd7f56[_0xd575('0x1d')]?_0xbd7f56['options'][_0xd575('0x1e')]===undefined?!![]:![]:!![]})[_0xd575('0xd')](function(_0x84e9f7){logger['info'](_0xd575('0x19'),_0xbd7f56);logger[_0xd575('0x10')]('CreateSquareReport',_0xbd7f56,JSON[_0xd575('0x13')](_0x84e9f7));_0x428825(_0x84e9f7);})[_0xd575('0x18')](function(_0x131fcf){logger[_0xd575('0x14')](_0xd575('0x19'),_0x131fcf[_0xd575('0x16')],_0xbd7f56);_0x3a054c(_0x52f3ee['error'](0x1f4,_0x131fcf[_0xd575('0x16')]));});});};exports[_0xd575('0x1f')]=function(_0x538479){var _0x2b75bb=this;return new Promise(function(_0x3c8104,_0x2cb4a7){return db[_0xd575('0x1a')][_0xd575('0x20')](_0x538479[_0xd575('0x1c')],{'raw':_0x538479['options']?_0x538479[_0xd575('0x1d')][_0xd575('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x538479['options']?_0x538479[_0xd575('0x1d')][_0xd575('0x21')]||null:null,'attributes':_0x538479[_0xd575('0x1d')]?_0x538479[_0xd575('0x1d')][_0xd575('0x22')]||null:null,'limit':_0x538479[_0xd575('0x1d')]?_0x538479[_0xd575('0x1d')][_0xd575('0x23')]||null:null})['then'](function(_0x1584e1){logger[_0xd575('0xe')](_0xd575('0x1f'),_0x538479);logger['debug'](_0xd575('0x1f'),_0x538479,JSON['stringify'](_0x1584e1));_0x3c8104(_0x1584e1);})[_0xd575('0x18')](function(_0x2f724e){logger[_0xd575('0x14')](_0xd575('0x1f'),_0x2f724e[_0xd575('0x16')],_0x538479);_0x2cb4a7(_0x2b75bb[_0xd575('0x14')](0x1f4,_0x2f724e[_0xd575('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 52d44e4..820312f 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 _0x091e=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','express'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0x091e,0x189));var _0xe091=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x091e[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0xe091('0x0'));var util=require(_0xe091('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe091('0x2'));var router=express[_0xe091('0x3')]();var fs_extra=require(_0xe091('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe091('0x5'));var config=require(_0xe091('0x6'));var controller=require('./squareReportDetail.controller');router[_0xe091('0x7')]('/',auth[_0xe091('0x8')](),controller['index']);router[_0xe091('0x7')](_0xe091('0x9'),auth[_0xe091('0x8')](),controller[_0xe091('0xa')]);router[_0xe091('0x7')](_0xe091('0xb'),auth[_0xe091('0x8')](),controller[_0xe091('0xc')]);router[_0xe091('0xd')]('/',auth[_0xe091('0x8')](),controller[_0xe091('0xe')]);router[_0xe091('0xf')](_0xe091('0xb'),auth[_0xe091('0x8')](),controller['update']);router[_0xe091('0x10')](_0xe091('0xb'),auth[_0xe091('0x8')](),controller['destroy']);module[_0xe091('0x11')]=router; \ No newline at end of file +var _0xe644=['describe','/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','/describe'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xe644,0x138));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4e64('0x0'));var util=require('util');var path=require(_0x4e64('0x1'));var timeout=require(_0x4e64('0x2'));var express=require(_0x4e64('0x3'));var router=express['Router']();var fs_extra=require(_0x4e64('0x4'));var auth=require(_0x4e64('0x5'));var interaction=require(_0x4e64('0x6'));var config=require('../../config/environment');var controller=require(_0x4e64('0x7'));router[_0x4e64('0x8')]('/',auth[_0x4e64('0x9')](),controller['index']);router[_0x4e64('0x8')](_0x4e64('0xa'),auth[_0x4e64('0x9')](),controller[_0x4e64('0xb')]);router[_0x4e64('0x8')](_0x4e64('0xc'),auth[_0x4e64('0x9')](),controller[_0x4e64('0xd')]);router[_0x4e64('0xe')]('/',auth[_0x4e64('0x9')](),controller['create']);router[_0x4e64('0xf')]('/:id',auth[_0x4e64('0x9')](),controller['update']);router[_0x4e64('0x10')](_0x4e64('0xc'),auth['isAuthenticated'](),controller[_0x4e64('0x11')]);module[_0x4e64('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index da9a24e..2c61e64 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 _0x77a9=['STRING','TEXT','sequelize','exports'];(function(_0x3bd5f1,_0x3db05d){var _0x88a393=function(_0x2a02de){while(--_0x2a02de){_0x3bd5f1['push'](_0x3bd5f1['shift']());}};_0x88a393(++_0x3db05d);}(_0x77a9,0x182));var _0x977a=function(_0x1371ed,_0x5bff22){_0x1371ed=_0x1371ed-0x0;var _0x1065ef=_0x77a9[_0x1371ed];return _0x1065ef;};'use strict';var Sequelize=require(_0x977a('0x0'));module[_0x977a('0x1')]={'uniqueid':{'type':Sequelize[_0x977a('0x2')]},'node':{'type':Sequelize[_0x977a('0x2')]},'application':{'type':Sequelize[_0x977a('0x2')]},'data':{'type':Sequelize[_0x977a('0x3')]},'project_name':{'type':Sequelize[_0x977a('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfd87=['exports','STRING','TEXT','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfd87,0x8b));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7fd8('0x0'));module[_0x7fd8('0x1')]={'uniqueid':{'type':Sequelize[_0x7fd8('0x2')]},'node':{'type':Sequelize[_0x7fd8('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x7fd8('0x3')]},'project_name':{'type':Sequelize[_0x7fd8('0x2')]},'callerid':{'type':Sequelize[_0x7fd8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 91cb7a0..7b39cb2 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 _0xdcfa=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','sort','where','filters'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xdcfa,0x182));var _0xadcf=function(_0x3a951e,_0x35eade){_0x3a951e=_0x3a951e-0x0;var _0x142e63=_0xdcfa[_0x3a951e];return _0x142e63;};'use strict';var emlformat=require(_0xadcf('0x0'));var rimraf=require(_0xadcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xadcf('0x2'));var rp=require(_0xadcf('0x3'));var moment=require(_0xadcf('0x4'));var BPromise=require(_0xadcf('0x5'));var Mustache=require(_0xadcf('0x6'));var util=require('util');var path=require('path');var sox=require(_0xadcf('0x7'));var csv=require(_0xadcf('0x8'));var ejs=require(_0xadcf('0x9'));var fs=require('fs');var fs_extra=require(_0xadcf('0xa'));var _=require(_0xadcf('0xb'));var squel=require('squel');var crypto=require(_0xadcf('0xc'));var jsforce=require(_0xadcf('0xd'));var deskjs=require(_0xadcf('0xe'));var toCsv=require(_0xadcf('0x8'));var querystring=require(_0xadcf('0xf'));var Papa=require('papaparse');var Redis=require(_0xadcf('0x10'));var authService=require(_0xadcf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xadcf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadcf('0x13'))(_0xadcf('0x14'));var utils=require(_0xadcf('0x15'));var config=require(_0xadcf('0x16'));var licenseUtil=require(_0xadcf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cfb01,_0x5cfc06){_0x5cfc06=_0x5cfc06||0xcc;return function(_0x566c9a){if(_0x566c9a){return _0x1cfb01[_0xadcf('0x18')](_0x5cfc06);}return _0x1cfb01['status'](_0x5cfc06)[_0xadcf('0x19')]();};}function respondWithResult(_0x576edd,_0x5c04be){_0x5c04be=_0x5c04be||0xc8;return function(_0x441d74){if(_0x441d74){return _0x576edd[_0xadcf('0x1a')](_0x5c04be)[_0xadcf('0x1b')](_0x441d74);}};}function respondWithFilteredResult(_0x142acb,_0x4c6677){return function(_0x59f7fd){if(_0x59f7fd){var _0x2aefb0=typeof _0x4c6677[_0xadcf('0x1c')]==='undefined'&&typeof _0x4c6677[_0xadcf('0x1d')]===_0xadcf('0x1e');var _0x45a1e2=_0x59f7fd[_0xadcf('0x1f')];var _0x298f42=_0x2aefb0?0x0:_0x4c6677['offset'];var _0x104750=_0x2aefb0?_0x59f7fd[_0xadcf('0x1f')]:_0x4c6677[_0xadcf('0x1c')]+_0x4c6677[_0xadcf('0x1d')];var _0x174c3f;if(_0x104750>=_0x45a1e2){_0x104750=_0x45a1e2;_0x174c3f=0xc8;}else{_0x174c3f=0xce;}_0x142acb['status'](_0x174c3f);return _0x142acb[_0xadcf('0x20')](_0xadcf('0x21'),_0x298f42+'-'+_0x104750+'/'+_0x45a1e2)[_0xadcf('0x1b')](_0x59f7fd);}return null;};}function patchUpdates(_0x3b3a5f){return function(_0x1be41b){try{jsonpatch[_0xadcf('0x22')](_0x1be41b,_0x3b3a5f,!![]);}catch(_0x1f25a3){return BPromise['reject'](_0x1f25a3);}return _0x1be41b[_0xadcf('0x23')]();};}function saveUpdates(_0x2def15,_0x5bff8b){return function(_0x3225c1){if(_0x3225c1){return _0x3225c1[_0xadcf('0x24')](_0x2def15)['then'](function(_0x2a44bb){return _0x2a44bb;});}return null;};}function removeEntity(_0x593af4,_0x1b1b59){return function(_0x2c9fc0){if(_0x2c9fc0){return _0x2c9fc0[_0xadcf('0x25')]()[_0xadcf('0x26')](function(){_0x593af4[_0xadcf('0x1a')](0xcc)[_0xadcf('0x19')]();});}};}function handleEntityNotFound(_0x26c6e4,_0x47efe6){return function(_0x5b2bbc){if(!_0x5b2bbc){_0x26c6e4['sendStatus'](0x194);}return _0x5b2bbc;};}function handleError(_0x519feb,_0x4d4e42){_0x4d4e42=_0x4d4e42||0x1f4;return function(_0x416e5a){logger['error'](_0x416e5a[_0xadcf('0x27')]);if(_0x416e5a['name']){delete _0x416e5a[_0xadcf('0x28')];}_0x519feb[_0xadcf('0x1a')](_0x4d4e42)[_0xadcf('0x29')](_0x416e5a);};}exports[_0xadcf('0x2a')]=function(_0xc7e240,_0x30bb5e){var _0x2a48d9={},_0x4c49f0={},_0x18e9e6={'count':0x0,'rows':[]};var _0x453c6a=_[_0xadcf('0x2b')](db[_0xadcf('0x2c')][_0xadcf('0x2d')],function(_0x4c3cd3){return{'name':_0x4c3cd3['fieldName'],'type':_0x4c3cd3[_0xadcf('0x2e')][_0xadcf('0x2f')]};});_0x4c49f0['model']=_[_0xadcf('0x2b')](_0x453c6a,_0xadcf('0x28'));_0x4c49f0[_0xadcf('0x30')]=_[_0xadcf('0x31')](_0xc7e240[_0xadcf('0x30')]);_0x4c49f0['filters']=_['intersection'](_0x4c49f0[_0xadcf('0x32')],_0x4c49f0['query']);_0x2a48d9[_0xadcf('0x33')]=_[_0xadcf('0x34')](_0x4c49f0[_0xadcf('0x32')],qs['fields'](_0xc7e240[_0xadcf('0x30')][_0xadcf('0x35')]));_0x2a48d9[_0xadcf('0x33')]=_0x2a48d9[_0xadcf('0x33')]['length']?_0x2a48d9[_0xadcf('0x33')]:_0x4c49f0[_0xadcf('0x32')];if(!_0xc7e240[_0xadcf('0x30')][_0xadcf('0x36')]('nolimit')){_0x2a48d9[_0xadcf('0x1d')]=qs[_0xadcf('0x1d')](_0xc7e240[_0xadcf('0x30')][_0xadcf('0x1d')]);_0x2a48d9[_0xadcf('0x1c')]=qs[_0xadcf('0x1c')](_0xc7e240[_0xadcf('0x30')][_0xadcf('0x1c')]);}_0x2a48d9['order']=qs[_0xadcf('0x37')](_0xc7e240[_0xadcf('0x30')]['sort']);_0x2a48d9[_0xadcf('0x38')]=qs[_0xadcf('0x39')](_['pick'](_0xc7e240[_0xadcf('0x30')],_0x4c49f0['filters']),_0x453c6a);if(_0xc7e240[_0xadcf('0x30')][_0xadcf('0x3a')]){_0x2a48d9[_0xadcf('0x38')]=_[_0xadcf('0x3b')](_0x2a48d9[_0xadcf('0x38')],{'$or':_[_0xadcf('0x2b')](_0x453c6a,function(_0x281cdd){if(_0x281cdd['type']!==_0xadcf('0x3c')){var _0x44dda2={};_0x44dda2[_0x281cdd['name']]={'$like':'%'+_0xc7e240[_0xadcf('0x30')][_0xadcf('0x3a')]+'%'};return _0x44dda2;}})});}_0x2a48d9=_[_0xadcf('0x3b')]({},_0x2a48d9,_0xc7e240[_0xadcf('0x3d')]);var _0x312115={'where':_0x2a48d9[_0xadcf('0x38')]};return db[_0xadcf('0x2c')][_0xadcf('0x1f')](_0x312115)['then'](function(_0x49f715){_0x18e9e6[_0xadcf('0x1f')]=_0x49f715;if(_0xc7e240[_0xadcf('0x30')][_0xadcf('0x3e')]){_0x2a48d9[_0xadcf('0x3f')]=[{'all':!![]}];}return db[_0xadcf('0x2c')][_0xadcf('0x40')](_0x2a48d9);})['then'](function(_0xa44c76){_0x18e9e6[_0xadcf('0x41')]=_0xa44c76;return _0x18e9e6;})[_0xadcf('0x26')](respondWithFilteredResult(_0x30bb5e,_0x2a48d9))[_0xadcf('0x42')](handleError(_0x30bb5e,null));};exports[_0xadcf('0x43')]=function(_0x3e1453,_0x2279fc){var _0x22bdb4={'raw':!![],'where':{'id':_0x3e1453[_0xadcf('0x44')]['id']}},_0x40d152={};_0x40d152[_0xadcf('0x32')]=_['keys'](db[_0xadcf('0x2c')][_0xadcf('0x2d')]);_0x40d152[_0xadcf('0x30')]=_[_0xadcf('0x31')](_0x3e1453[_0xadcf('0x30')]);_0x40d152['filters']=_[_0xadcf('0x34')](_0x40d152['model'],_0x40d152['query']);_0x22bdb4[_0xadcf('0x33')]=_[_0xadcf('0x34')](_0x40d152[_0xadcf('0x32')],qs[_0xadcf('0x35')](_0x3e1453[_0xadcf('0x30')][_0xadcf('0x35')]));_0x22bdb4[_0xadcf('0x33')]=_0x22bdb4[_0xadcf('0x33')][_0xadcf('0x45')]?_0x22bdb4[_0xadcf('0x33')]:_0x40d152[_0xadcf('0x32')];if(_0x3e1453[_0xadcf('0x30')][_0xadcf('0x3e')]){_0x22bdb4['include']=[{'all':!![]}];}_0x22bdb4=_[_0xadcf('0x3b')]({},_0x22bdb4,_0x3e1453[_0xadcf('0x3d')]);return db[_0xadcf('0x2c')][_0xadcf('0x46')](_0x22bdb4)[_0xadcf('0x26')](handleEntityNotFound(_0x2279fc,null))['then'](respondWithResult(_0x2279fc,null))[_0xadcf('0x42')](handleError(_0x2279fc,null));};exports[_0xadcf('0x47')]=function(_0x12b3ba,_0x379c94){return db[_0xadcf('0x2c')][_0xadcf('0x47')](_0x12b3ba[_0xadcf('0x48')],{})[_0xadcf('0x26')](respondWithResult(_0x379c94,0xc9))[_0xadcf('0x42')](handleError(_0x379c94,null));};exports['update']=function(_0xd935b,_0x21f366){if(_0xd935b[_0xadcf('0x48')]['id']){delete _0xd935b[_0xadcf('0x48')]['id'];}return db[_0xadcf('0x2c')][_0xadcf('0x46')]({'where':{'id':_0xd935b[_0xadcf('0x44')]['id']}})[_0xadcf('0x26')](handleEntityNotFound(_0x21f366,null))[_0xadcf('0x26')](saveUpdates(_0xd935b[_0xadcf('0x48')],null))[_0xadcf('0x26')](respondWithResult(_0x21f366,null))[_0xadcf('0x42')](handleError(_0x21f366,null));};exports[_0xadcf('0x25')]=function(_0xaa1be9,_0x12546e){return db[_0xadcf('0x2c')][_0xadcf('0x46')]({'where':{'id':_0xaa1be9[_0xadcf('0x44')]['id']}})[_0xadcf('0x26')](handleEntityNotFound(_0x12546e,null))['then'](removeEntity(_0x12546e,null))[_0xadcf('0x42')](handleError(_0x12546e,null));};exports[_0xadcf('0x49')]=function(_0x15219c,_0x226eb7){return db[_0xadcf('0x2c')][_0xadcf('0x49')]()[_0xadcf('0x26')](respondWithResult(_0x226eb7,null))[_0xadcf('0x42')](handleError(_0x226eb7,null));}; \ No newline at end of file +var _0xf069=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','SquareDetailsReport','findAll','rows','show','params','keys','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf069,0x178));var _0x9f06=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf069[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x9f06('0x0'));var rimraf=require(_0x9f06('0x1'));var zipdir=require(_0x9f06('0x2'));var jsonpatch=require(_0x9f06('0x3'));var rp=require('request-promise');var moment=require(_0x9f06('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9f06('0x5'));var util=require(_0x9f06('0x6'));var path=require(_0x9f06('0x7'));var sox=require(_0x9f06('0x8'));var csv=require(_0x9f06('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f06('0xa'));var _=require(_0x9f06('0xb'));var squel=require(_0x9f06('0xc'));var crypto=require(_0x9f06('0xd'));var jsforce=require(_0x9f06('0xe'));var deskjs=require(_0x9f06('0xf'));var toCsv=require(_0x9f06('0x9'));var querystring=require(_0x9f06('0x10'));var Papa=require(_0x9f06('0x11'));var Redis=require('ioredis');var authService=require(_0x9f06('0x12'));var qs=require(_0x9f06('0x13'));var as=require(_0x9f06('0x14'));var hardwareService=require(_0x9f06('0x15'));var logger=require(_0x9f06('0x16'))(_0x9f06('0x17'));var utils=require(_0x9f06('0x18'));var config=require(_0x9f06('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f06('0x1a'))['db'];function respondWithStatusCode(_0x451512,_0x1a8a70){_0x1a8a70=_0x1a8a70||0xcc;return function(_0x2ca45b){if(_0x2ca45b){return _0x451512[_0x9f06('0x1b')](_0x1a8a70);}return _0x451512['status'](_0x1a8a70)[_0x9f06('0x1c')]();};}function respondWithResult(_0x567575,_0x2b7e19){_0x2b7e19=_0x2b7e19||0xc8;return function(_0x423b88){if(_0x423b88){return _0x567575[_0x9f06('0x1d')](_0x2b7e19)[_0x9f06('0x1e')](_0x423b88);}};}function respondWithFilteredResult(_0xe1f623,_0x2c4c3b){return function(_0x50c5d9){if(_0x50c5d9){var _0x445ac3=typeof _0x2c4c3b[_0x9f06('0x1f')]==='undefined'&&typeof _0x2c4c3b['limit']===_0x9f06('0x20');var _0x3db5f1=_0x50c5d9[_0x9f06('0x21')];var _0x75c48b=_0x445ac3?0x0:_0x2c4c3b['offset'];var _0x50df79=_0x445ac3?_0x50c5d9['count']:_0x2c4c3b['offset']+_0x2c4c3b[_0x9f06('0x22')];var _0x59f1f7;if(_0x50df79>=_0x3db5f1){_0x50df79=_0x3db5f1;_0x59f1f7=0xc8;}else{_0x59f1f7=0xce;}_0xe1f623[_0x9f06('0x1d')](_0x59f1f7);return _0xe1f623[_0x9f06('0x23')]('Content-Range',_0x75c48b+'-'+_0x50df79+'/'+_0x3db5f1)['json'](_0x50c5d9);}return null;};}function patchUpdates(_0xdff87c){return function(_0x22db95){try{jsonpatch['apply'](_0x22db95,_0xdff87c,!![]);}catch(_0x2388d1){return BPromise[_0x9f06('0x24')](_0x2388d1);}return _0x22db95['save']();};}function saveUpdates(_0x3c2808,_0x529cb0){return function(_0x1c5934){if(_0x1c5934){return _0x1c5934[_0x9f06('0x25')](_0x3c2808)[_0x9f06('0x26')](function(_0x3e7c31){return _0x3e7c31;});}return null;};}function removeEntity(_0x4e0e09,_0x509ab7){return function(_0x39db74){if(_0x39db74){return _0x39db74['destroy']()[_0x9f06('0x26')](function(){_0x4e0e09[_0x9f06('0x1d')](0xcc)[_0x9f06('0x1c')]();});}};}function handleEntityNotFound(_0x40112e,_0x5d7984){return function(_0x3e728f){if(!_0x3e728f){_0x40112e['sendStatus'](0x194);}return _0x3e728f;};}function handleError(_0xa51ebf,_0x5ae41f){_0x5ae41f=_0x5ae41f||0x1f4;return function(_0x392ded){logger[_0x9f06('0x27')](_0x392ded[_0x9f06('0x28')]);if(_0x392ded[_0x9f06('0x29')]){delete _0x392ded[_0x9f06('0x29')];}_0xa51ebf[_0x9f06('0x1d')](_0x5ae41f)[_0x9f06('0x2a')](_0x392ded);};}exports['index']=function(_0x48fa93,_0xd8a714){var _0x2af3d2={},_0x5865a3={},_0x5d1413={'count':0x0,'rows':[]};var _0x3be0ae=_[_0x9f06('0x2b')](db['SquareDetailsReport'][_0x9f06('0x2c')],function(_0x2fede8){return{'name':_0x2fede8[_0x9f06('0x2d')],'type':_0x2fede8[_0x9f06('0x2e')]['key']};});_0x5865a3[_0x9f06('0x2f')]=_['map'](_0x3be0ae,_0x9f06('0x29'));_0x5865a3[_0x9f06('0x30')]=_['keys'](_0x48fa93[_0x9f06('0x30')]);_0x5865a3[_0x9f06('0x31')]=_[_0x9f06('0x32')](_0x5865a3[_0x9f06('0x2f')],_0x5865a3[_0x9f06('0x30')]);_0x2af3d2[_0x9f06('0x33')]=_['intersection'](_0x5865a3[_0x9f06('0x2f')],qs['fields'](_0x48fa93[_0x9f06('0x30')][_0x9f06('0x34')]));_0x2af3d2[_0x9f06('0x33')]=_0x2af3d2[_0x9f06('0x33')][_0x9f06('0x35')]?_0x2af3d2[_0x9f06('0x33')]:_0x5865a3[_0x9f06('0x2f')];if(!_0x48fa93[_0x9f06('0x30')]['hasOwnProperty'](_0x9f06('0x36'))){_0x2af3d2[_0x9f06('0x22')]=qs[_0x9f06('0x22')](_0x48fa93[_0x9f06('0x30')][_0x9f06('0x22')]);_0x2af3d2[_0x9f06('0x1f')]=qs[_0x9f06('0x1f')](_0x48fa93[_0x9f06('0x30')][_0x9f06('0x1f')]);}_0x2af3d2[_0x9f06('0x37')]=qs[_0x9f06('0x38')](_0x48fa93[_0x9f06('0x30')][_0x9f06('0x38')]);_0x2af3d2[_0x9f06('0x39')]=qs[_0x9f06('0x31')](_['pick'](_0x48fa93[_0x9f06('0x30')],_0x5865a3[_0x9f06('0x31')]),_0x3be0ae);if(_0x48fa93[_0x9f06('0x30')][_0x9f06('0x3a')]){_0x2af3d2[_0x9f06('0x39')]=_[_0x9f06('0x3b')](_0x2af3d2[_0x9f06('0x39')],{'$or':_['map'](_0x3be0ae,function(_0x40360b){if(_0x40360b[_0x9f06('0x2e')]!==_0x9f06('0x3c')){var _0x5f10b2={};_0x5f10b2[_0x40360b[_0x9f06('0x29')]]={'$like':'%'+_0x48fa93[_0x9f06('0x30')]['filter']+'%'};return _0x5f10b2;}})});}_0x2af3d2=_[_0x9f06('0x3b')]({},_0x2af3d2,_0x48fa93[_0x9f06('0x3d')]);var _0x3f53a8={'where':_0x2af3d2[_0x9f06('0x39')]};return db['SquareDetailsReport'][_0x9f06('0x21')](_0x3f53a8)[_0x9f06('0x26')](function(_0x4258d1){_0x5d1413[_0x9f06('0x21')]=_0x4258d1;if(_0x48fa93['query'][_0x9f06('0x3e')]){_0x2af3d2[_0x9f06('0x3f')]=[{'all':!![]}];}return db[_0x9f06('0x40')][_0x9f06('0x41')](_0x2af3d2);})['then'](function(_0x310c9b){_0x5d1413[_0x9f06('0x42')]=_0x310c9b;return _0x5d1413;})[_0x9f06('0x26')](respondWithFilteredResult(_0xd8a714,_0x2af3d2))['catch'](handleError(_0xd8a714,null));};exports[_0x9f06('0x43')]=function(_0x127c7f,_0x1cd3b6){var _0x55313a={'raw':!![],'where':{'id':_0x127c7f[_0x9f06('0x44')]['id']}},_0x542627={};_0x542627[_0x9f06('0x2f')]=_[_0x9f06('0x45')](db[_0x9f06('0x40')]['rawAttributes']);_0x542627['query']=_['keys'](_0x127c7f[_0x9f06('0x30')]);_0x542627['filters']=_[_0x9f06('0x32')](_0x542627[_0x9f06('0x2f')],_0x542627[_0x9f06('0x30')]);_0x55313a['attributes']=_[_0x9f06('0x32')](_0x542627['model'],qs[_0x9f06('0x34')](_0x127c7f[_0x9f06('0x30')][_0x9f06('0x34')]));_0x55313a[_0x9f06('0x33')]=_0x55313a[_0x9f06('0x33')][_0x9f06('0x35')]?_0x55313a['attributes']:_0x542627[_0x9f06('0x2f')];if(_0x127c7f['query'][_0x9f06('0x3e')]){_0x55313a[_0x9f06('0x3f')]=[{'all':!![]}];}_0x55313a=_[_0x9f06('0x3b')]({},_0x55313a,_0x127c7f['options']);return db[_0x9f06('0x40')][_0x9f06('0x46')](_0x55313a)[_0x9f06('0x26')](handleEntityNotFound(_0x1cd3b6,null))[_0x9f06('0x26')](respondWithResult(_0x1cd3b6,null))['catch'](handleError(_0x1cd3b6,null));};exports[_0x9f06('0x47')]=function(_0x5b9c0b,_0xb76c73){return db['SquareDetailsReport'][_0x9f06('0x47')](_0x5b9c0b[_0x9f06('0x48')],{})[_0x9f06('0x26')](respondWithResult(_0xb76c73,0xc9))['catch'](handleError(_0xb76c73,null));};exports[_0x9f06('0x25')]=function(_0x341f9c,_0x19d365){if(_0x341f9c['body']['id']){delete _0x341f9c[_0x9f06('0x48')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x341f9c[_0x9f06('0x44')]['id']}})[_0x9f06('0x26')](handleEntityNotFound(_0x19d365,null))[_0x9f06('0x26')](saveUpdates(_0x341f9c[_0x9f06('0x48')],null))['then'](respondWithResult(_0x19d365,null))[_0x9f06('0x49')](handleError(_0x19d365,null));};exports[_0x9f06('0x4a')]=function(_0x596f23,_0x2a52de){return db[_0x9f06('0x40')][_0x9f06('0x46')]({'where':{'id':_0x596f23[_0x9f06('0x44')]['id']}})[_0x9f06('0x26')](handleEntityNotFound(_0x2a52de,null))[_0x9f06('0x26')](removeEntity(_0x2a52de,null))[_0x9f06('0x49')](handleError(_0x2a52de,null));};exports[_0x9f06('0x4b')]=function(_0x159fbc,_0x4c2fcc){return db[_0x9f06('0x40')]['describe']()[_0x9f06('0x26')](respondWithResult(_0x4c2fcc,null))['catch'](handleError(_0x4c2fcc,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 165fefb..46938c0 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 _0x814f=['util','api','moment','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x130696,_0x2b15b9){var _0x2143d9=function(_0x2bf115){while(--_0x2bf115){_0x130696['push'](_0x130696['shift']());}};_0x2143d9(++_0x2b15b9);}(_0x814f,0xcb));var _0xf814=function(_0x2ef8c4,_0x250f29){_0x2ef8c4=_0x2ef8c4-0x0;var _0x4dfe2c=_0x814f[_0x2ef8c4];return _0x4dfe2c;};'use strict';var _=require(_0xf814('0x0'));var util=require(_0xf814('0x1'));var logger=require('../../config/logger')(_0xf814('0x2'));var moment=require(_0xf814('0x3'));var BPromise=require('bluebird');var rp=require(_0xf814('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf814('0x5'));var config=require(_0xf814('0x6'));var attributes=require(_0xf814('0x7'));module[_0xf814('0x8')]=function(_0x477f4e,_0x5aff8f){return _0x477f4e[_0xf814('0x9')](_0xf814('0xa'),attributes,{'tableName':_0xf814('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6272=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6272,0x1d8));var _0x2627=function(_0x588706,_0xcb8fd3){_0x588706=_0x588706-0x0;var _0x214ba7=_0x6272[_0x588706];return _0x214ba7;};'use strict';var _=require(_0x2627('0x0'));var util=require(_0x2627('0x1'));var logger=require(_0x2627('0x2'))(_0x2627('0x3'));var moment=require(_0x2627('0x4'));var BPromise=require(_0x2627('0x5'));var rp=require(_0x2627('0x6'));var fs=require('fs');var path=require(_0x2627('0x7'));var rimraf=require(_0x2627('0x8'));var config=require(_0x2627('0x9'));var attributes=require(_0x2627('0xa'));module[_0x2627('0xb')]=function(_0x1aa888,_0x432dd3){return _0x1aa888[_0x2627('0xc')](_0x2627('0xd'),attributes,{'tableName':_0x2627('0xe'),'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 9b41fc0..7828953 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 _0xd7d1=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw'];(function(_0xa1cc71,_0x5841c1){var _0x19b112=function(_0x5ccfe4){while(--_0x5ccfe4){_0xa1cc71['push'](_0xa1cc71['shift']());}};_0x19b112(++_0x5841c1);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x3c91d8,_0x21df3d){_0x3c91d8=_0x3c91d8-0x0;var _0x195357=_0xd7d1[_0x3c91d8];return _0x195357;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['SquareDetailsReport'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![]})[_0x1d7d('0xe')](function(_0x54d401){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x1e')]('CreateSquareDetailsReport',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x54d401));_0x191024(_0x54d401);})[_0x1d7d('0x18')](function(_0x4a1cdc){logger['error'](_0x1d7d('0x19'),_0x4a1cdc[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x4a1cdc['message']));});});}; \ No newline at end of file +var _0x351d=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','then'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x351d,0x90));var _0xd351=function(_0x3cc7fe,_0x11ed48){_0x3cc7fe=_0x3cc7fe-0x0;var _0x27dd54=_0x351d[_0x3cc7fe];return _0x27dd54;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});}exports[_0xd351('0x13')]=function(_0x4e0164){var _0x4c6693=this;return new Promise(function(_0x1e1a3c,_0x2bfc53){return db[_0xd351('0x14')][_0xd351('0x15')](_0x4e0164['body'],{'raw':_0x4e0164[_0xd351('0x16')]?_0x4e0164['options']['raw']===undefined?!![]:![]:!![]})[_0xd351('0x17')](function(_0x4a427b){logger[_0xd351('0xb')](_0xd351('0x13'),_0x4e0164);logger[_0xd351('0xd')](_0xd351('0x13'),_0x4e0164,JSON[_0xd351('0xe')](_0x4a427b));_0x1e1a3c(_0x4a427b);})['catch'](function(_0x18625b){logger[_0xd351('0xf')](_0xd351('0x13'),_0x18625b['message'],_0x4e0164);_0x2bfc53(_0x4c6693[_0xd351('0xf')](0x1f4,_0x18625b[_0xd351('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 443e4d5..23dc004 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 _0x798a=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','../../components/auth/service'];(function(_0x1a513c,_0x5acd41){var _0x1ce495=function(_0x6bec46){while(--_0x6bec46){_0x1a513c['push'](_0x1a513c['shift']());}};_0x1ce495(++_0x5acd41);}(_0x798a,0x92));var _0xa798=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x798a[_0x263a74];return _0x2aa86c;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa798('0x0'));var controller=require(_0xa798('0x1'));router[_0xa798('0x2')]('/',auth[_0xa798('0x3')](),controller[_0xa798('0x4')]);router[_0xa798('0x2')](_0xa798('0x5'),auth[_0xa798('0x3')](),controller['killProcess']);module[_0xa798('0x6')]=router; \ No newline at end of file +var _0xeb82=['get','isAuthenticated','express','../../components/auth/service','./system.controller'];(function(_0xd0f68,_0x5aa9c9){var _0x4b272d=function(_0x2f48a7){while(--_0x2f48a7){_0xd0f68['push'](_0xd0f68['shift']());}};_0x4b272d(++_0x5aa9c9);}(_0xeb82,0x1e2));var _0x2eb8=function(_0x52491f,_0x7b19d4){_0x52491f=_0x52491f-0x0;var _0x1c67da=_0xeb82[_0x52491f];return _0x1c67da;};'use strict';var express=require(_0x2eb8('0x0'));var router=express['Router']();var auth=require(_0x2eb8('0x1'));var controller=require(_0x2eb8('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2eb8('0x3')]('/process/:pid/kill',auth[_0x2eb8('0x4')](),controller['killProcess']);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 8e8af4d..2ae775a 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 _0xa551=['child_process','exec','../../config/logger','util','bluebird','inspect','name','send','index','getAllData','then','status','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0xc6b1f2,_0x5ed974){var _0x3c3a6a=function(_0x546697){while(--_0x546697){_0xc6b1f2['push'](_0xc6b1f2['shift']());}};_0x3c3a6a(++_0x5ed974);}(_0xa551,0x133));var _0x1a55=function(_0x1fd13e,_0x346670){_0x1fd13e=_0x1fd13e-0x0;var _0x26f2bc=_0xa551[_0x1fd13e];return _0x26f2bc;};'use strict';var info=require(_0x1a55('0x0'));var exec=require(_0x1a55('0x1'))[_0x1a55('0x2')];var logger=require(_0x1a55('0x3'))('api');var util=require(_0x1a55('0x4'));var BPromise=require(_0x1a55('0x5'));var _=require('lodash');function handleError(_0x48fe99,_0x11d8c9,_0x410dcd){_0x11d8c9=_0x11d8c9||0x1f4;return function(_0x2bff53){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x410dcd,_0x11d8c9,util[_0x1a55('0x6')](_0x2bff53,{'showHidden':![],'depth':null}));delete _0x2bff53[_0x1a55('0x7')];_0x48fe99['status'](_0x11d8c9)[_0x1a55('0x8')](_0x2bff53);};}exports[_0x1a55('0x9')]=function(_0x2a1571,_0x1c3b12){return info[_0x1a55('0xa')]()[_0x1a55('0xb')](function(_0x4c01e2){return _0x1c3b12[_0x1a55('0xc')](0xc8)[_0x1a55('0xd')](_0x4c01e2);})[_0x1a55('0xe')](function(_0x2c17bb){return _0x1c3b12['status'](0x1f4)[_0x1a55('0xd')](_0x2c17bb);});};exports[_0x1a55('0xf')]=function(_0x548a3f,_0x532501){var _0x180852=[_0x1a55('0x10')];return new BPromise(function(_0x393235,_0x2684a4){return exec(util[_0x1a55('0x11')](_0x1a55('0x12'),_0x548a3f[_0x1a55('0x13')]['pid']),function(_0x3ef1a3,_0x5f0a91,_0x410913){if(_0x3ef1a3){return _0x2684a4(_0x3ef1a3);}return _0x393235(_0x5f0a91);});})['then'](function(_0x24012b){var _0x26040a=![];var _0x38597c=_0x24012b[_0x1a55('0x14')](/\n/);for(var _0x21fe10=0x0,_0x315fe1=_0x180852[_0x1a55('0x15')];_0x21fe10<_0x315fe1,_0x26040a===![];_0x21fe10+=0x1){if(_0x24012b[_0x1a55('0x16')](_0x180852[_0x21fe10])>=0x0){_0x26040a=!![];}}if(!_0x26040a){throw new Error(util[_0x1a55('0x11')](_0x1a55('0x17'),_0x548a3f[_0x1a55('0x13')][_0x1a55('0x18')]));}process[_0x1a55('0x19')](_0x548a3f['params'][_0x1a55('0x18')],_0x1a55('0x1a'));return _0x532501[_0x1a55('0xc')](0xc8)[_0x1a55('0xd')]({'message':util['format'](_0x1a55('0x1b'),_0x548a3f[_0x1a55('0x13')][_0x1a55('0x18')])});})[_0x1a55('0xe')](handleError(_0x532501,null,_0x1a55('0xf')));}; \ No newline at end of file +var _0xd0bb=['indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','systeminformation','exec','../../config/logger','util','bluebird','error','name','status','send','index','json','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','length'];(function(_0x5d406c,_0x5c0adb){var _0x280599=function(_0x338624){while(--_0x338624){_0x5d406c['push'](_0x5d406c['shift']());}};_0x280599(++_0x5c0adb);}(_0xd0bb,0x68));var _0xbd0b=function(_0x5ab951,_0x2513ca){_0x5ab951=_0x5ab951-0x0;var _0x1e4abd=_0xd0bb[_0x5ab951];return _0x1e4abd;};'use strict';var info=require(_0xbd0b('0x0'));var exec=require('child_process')[_0xbd0b('0x1')];var logger=require(_0xbd0b('0x2'))('api');var util=require(_0xbd0b('0x3'));var BPromise=require(_0xbd0b('0x4'));var _=require('lodash');function handleError(_0x3c36cb,_0x34327b,_0x1f2bbf){_0x34327b=_0x34327b||0x1f4;return function(_0x4402d4){logger[_0xbd0b('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1f2bbf,_0x34327b,util['inspect'](_0x4402d4,{'showHidden':![],'depth':null}));delete _0x4402d4[_0xbd0b('0x6')];_0x3c36cb[_0xbd0b('0x7')](_0x34327b)[_0xbd0b('0x8')](_0x4402d4);};}exports[_0xbd0b('0x9')]=function(_0x240818,_0x4cd35a){return info['getAllData']()['then'](function(_0x4fd6fd){return _0x4cd35a[_0xbd0b('0x7')](0xc8)[_0xbd0b('0xa')](_0x4fd6fd);})['catch'](function(_0x4e1cdd){return _0x4cd35a[_0xbd0b('0x7')](0x1f4)['json'](_0x4e1cdd);});};exports['killProcess']=function(_0x45e02f,_0x1f47ae){var _0x43f9a0=[_0xbd0b('0xb')];return new BPromise(function(_0x394d53,_0x5edda5){return exec(util['format'](_0xbd0b('0xc'),_0x45e02f[_0xbd0b('0xd')]['pid']),function(_0x2a3a27,_0x2eb8b4,_0x400728){if(_0x2a3a27){return _0x5edda5(_0x2a3a27);}return _0x394d53(_0x2eb8b4);});})[_0xbd0b('0xe')](function(_0x43926d){var _0x561b11=![];var _0x3957a7=_0x43926d['split'](/\n/);for(var _0x44d6f0=0x0,_0x418c8c=_0x43f9a0[_0xbd0b('0xf')];_0x44d6f0<_0x418c8c,_0x561b11===![];_0x44d6f0+=0x1){if(_0x43926d[_0xbd0b('0x10')](_0x43f9a0[_0x44d6f0])>=0x0){_0x561b11=!![];}}if(!_0x561b11){throw new Error(util['format'](_0xbd0b('0x11'),_0x45e02f['params'][_0xbd0b('0x12')]));}process['kill'](_0x45e02f[_0xbd0b('0xd')][_0xbd0b('0x12')],_0xbd0b('0x13'));return _0x1f47ae[_0xbd0b('0x7')](0xc8)['json']({'message':util[_0xbd0b('0x14')](_0xbd0b('0x15'),_0x45e02f[_0xbd0b('0xd')][_0xbd0b('0x12')])});})[_0xbd0b('0x16')](handleError(_0x1f47ae,null,_0xbd0b('0x17')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d5dbd0b..2a873da 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 _0x1678=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x4805c7,_0x158dee){var _0xd2a127=function(_0x47b5af){while(--_0x47b5af){_0x4805c7['push'](_0x4805c7['shift']());}};_0xd2a127(++_0x158dee);}(_0x1678,0x17b));var _0x8167=function(_0x2f9ca3,_0x1cf071){_0x2f9ca3=_0x2f9ca3-0x0;var _0x38f970=_0x1678[_0x2f9ca3];return _0x38f970;};'use strict';var multer=require(_0x8167('0x0'));var util=require(_0x8167('0x1'));var path=require(_0x8167('0x2'));var timeout=require(_0x8167('0x3'));var express=require(_0x8167('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8167('0x5'));var interaction=require(_0x8167('0x6'));var config=require(_0x8167('0x7'));var controller=require(_0x8167('0x8'));router[_0x8167('0x9')]('/',auth[_0x8167('0xa')](),controller[_0x8167('0xb')]);router['get'](_0x8167('0xc'),auth[_0x8167('0xa')](),controller[_0x8167('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8167('0xe')]);router[_0x8167('0xf')]('/:id',auth[_0x8167('0xa')](),controller[_0x8167('0x10')]);router[_0x8167('0x11')](_0x8167('0xc'),auth[_0x8167('0xa')](),controller[_0x8167('0x12')]);module[_0x8167('0x13')]=router; \ No newline at end of file +var _0xe56e=['post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show'];(function(_0x2241d7,_0x4435e0){var _0x548e11=function(_0x4b6ef5){while(--_0x4b6ef5){_0x2241d7['push'](_0x2241d7['shift']());}};_0x548e11(++_0x4435e0);}(_0xe56e,0xd8));var _0xee56=function(_0x37b653,_0x1d2082){_0x37b653=_0x37b653-0x0;var _0x172e4d=_0xe56e[_0x37b653];return _0x172e4d;};'use strict';var multer=require(_0xee56('0x0'));var util=require('util');var path=require(_0xee56('0x1'));var timeout=require('connect-timeout');var express=require(_0xee56('0x2'));var router=express[_0xee56('0x3')]();var fs_extra=require(_0xee56('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee56('0x5'));var config=require(_0xee56('0x6'));var controller=require(_0xee56('0x7'));router[_0xee56('0x8')]('/',auth[_0xee56('0x9')](),controller['index']);router[_0xee56('0x8')](_0xee56('0xa'),auth[_0xee56('0x9')](),controller[_0xee56('0xb')]);router[_0xee56('0xc')]('/',auth[_0xee56('0x9')](),controller[_0xee56('0xd')]);router[_0xee56('0xe')](_0xee56('0xa'),auth[_0xee56('0x9')](),controller[_0xee56('0xf')]);router[_0xee56('0x10')]('/:id',auth[_0xee56('0x9')](),controller[_0xee56('0x11')]);module[_0xee56('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 1c54284..4b20510 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 _0x422f=['name','STRING','exports'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x422f,0x1c7));var _0xf422=function(_0x291b38,_0x335ae){_0x291b38=_0x291b38-0x0;var _0x4d3001=_0x422f[_0x291b38];return _0x4d3001;};'use strict';var Sequelize=require('sequelize');module[_0xf422('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf422('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf422('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xf422('0x2')]}}; \ No newline at end of file +var _0xad13=['#0091EA','sequelize','STRING','name'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xad13,0x79));var _0x3ad1=function(_0x527f99,_0x4d6496){_0x527f99=_0x527f99-0x0;var _0x420cd5=_0xad13[_0x527f99];return _0x420cd5;};'use strict';var Sequelize=require(_0x3ad1('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ad1('0x1')],'unique':_0x3ad1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3ad1('0x1')],'defaultValue':_0x3ad1('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4056d51..43a7442 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 _0xde64=['limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Tags','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','Tag','catch','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xde64,0x17c));var _0x4de6=function(_0x53eb1f,_0x3f3e91){_0x53eb1f=_0x53eb1f-0x0;var _0x505efe=_0xde64[_0x53eb1f];return _0x505efe;};'use strict';var emlformat=require(_0x4de6('0x0'));var rimraf=require(_0x4de6('0x1'));var zipdir=require(_0x4de6('0x2'));var jsonpatch=require(_0x4de6('0x3'));var rp=require(_0x4de6('0x4'));var moment=require(_0x4de6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4de6('0x6'));var util=require(_0x4de6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4de6('0x8'));var ejs=require(_0x4de6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4de6('0xa'));var crypto=require(_0x4de6('0xb'));var jsforce=require(_0x4de6('0xc'));var deskjs=require(_0x4de6('0xd'));var toCsv=require(_0x4de6('0x8'));var querystring=require(_0x4de6('0xe'));var Papa=require('papaparse');var Redis=require(_0x4de6('0xf'));var authService=require(_0x4de6('0x10'));var qs=require(_0x4de6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4de6('0x12'));var logger=require(_0x4de6('0x13'))(_0x4de6('0x14'));var utils=require(_0x4de6('0x15'));var config=require(_0x4de6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4de6('0x17'))['db'];function respondWithStatusCode(_0x3baa31,_0xb8e256){_0xb8e256=_0xb8e256||0xcc;return function(_0x509002){if(_0x509002){return _0x3baa31[_0x4de6('0x18')](_0xb8e256);}return _0x3baa31[_0x4de6('0x19')](_0xb8e256)[_0x4de6('0x1a')]();};}function respondWithResult(_0x2bd121,_0x58b0c1){_0x58b0c1=_0x58b0c1||0xc8;return function(_0x1ccfee){if(_0x1ccfee){return _0x2bd121[_0x4de6('0x19')](_0x58b0c1)[_0x4de6('0x1b')](_0x1ccfee);}};}function respondWithFilteredResult(_0x4dd3b5,_0x33fd67){return function(_0x54e2f2){if(_0x54e2f2){var _0x4cbb5c=typeof _0x33fd67[_0x4de6('0x1c')]===_0x4de6('0x1d')&&typeof _0x33fd67[_0x4de6('0x1e')]===_0x4de6('0x1d');var _0x37975a=_0x54e2f2[_0x4de6('0x1f')];var _0x324202=_0x4cbb5c?0x0:_0x33fd67['offset'];var _0x420f7c=_0x4cbb5c?_0x54e2f2[_0x4de6('0x1f')]:_0x33fd67[_0x4de6('0x1c')]+_0x33fd67[_0x4de6('0x1e')];var _0x167c7c;if(_0x420f7c>=_0x37975a){_0x420f7c=_0x37975a;_0x167c7c=0xc8;}else{_0x167c7c=0xce;}_0x4dd3b5[_0x4de6('0x19')](_0x167c7c);return _0x4dd3b5[_0x4de6('0x20')](_0x4de6('0x21'),_0x324202+'-'+_0x420f7c+'/'+_0x37975a)[_0x4de6('0x1b')](_0x54e2f2);}return null;};}function patchUpdates(_0x15c923){return function(_0x4c4d13){try{jsonpatch[_0x4de6('0x22')](_0x4c4d13,_0x15c923,!![]);}catch(_0x51ad13){return BPromise[_0x4de6('0x23')](_0x51ad13);}return _0x4c4d13[_0x4de6('0x24')]();};}function saveUpdates(_0x43771b,_0x5de99f){return function(_0xe1b69d){if(_0xe1b69d){return _0xe1b69d['update'](_0x43771b)[_0x4de6('0x25')](function(_0x385cae){return _0x385cae;});}return null;};}function removeEntity(_0x1a64e9,_0x5ddbab){return function(_0x478d83){if(_0x478d83){return _0x478d83[_0x4de6('0x26')]()[_0x4de6('0x25')](function(){var _0x3be904=_0x478d83[_0x4de6('0x27')]({'plain':!![]});var _0x25a76b=_0x4de6('0x28');return db['UserProfileResource'][_0x4de6('0x26')]({'where':{'type':_0x25a76b,'resourceId':_0x3be904['id']}})[_0x4de6('0x25')](function(){return _0x478d83;});})[_0x4de6('0x25')](function(){_0x1a64e9[_0x4de6('0x19')](0xcc)[_0x4de6('0x1a')]();});}};}function handleEntityNotFound(_0x281060,_0xa2b88c){return function(_0x7bc61e){if(!_0x7bc61e){_0x281060[_0x4de6('0x18')](0x194);}return _0x7bc61e;};}function handleError(_0x4f168b,_0x2065b4){_0x2065b4=_0x2065b4||0x1f4;return function(_0x2a5592){logger[_0x4de6('0x29')](_0x2a5592[_0x4de6('0x2a')]);if(_0x2a5592[_0x4de6('0x2b')]){delete _0x2a5592['name'];}_0x4f168b[_0x4de6('0x19')](_0x2065b4)['send'](_0x2a5592);};}exports[_0x4de6('0x2c')]=function(_0x2bfc77,_0x1df7c0){var _0x1b5607={},_0x592799={},_0x5593e8={'count':0x0,'rows':[]};var _0x530e04=_['map'](db['Tag'][_0x4de6('0x2d')],function(_0x1da3b1){return{'name':_0x1da3b1[_0x4de6('0x2e')],'type':_0x1da3b1[_0x4de6('0x2f')][_0x4de6('0x30')]};});_0x592799[_0x4de6('0x31')]=_[_0x4de6('0x32')](_0x530e04,_0x4de6('0x2b'));_0x592799[_0x4de6('0x33')]=_[_0x4de6('0x34')](_0x2bfc77[_0x4de6('0x33')]);_0x592799[_0x4de6('0x35')]=_[_0x4de6('0x36')](_0x592799[_0x4de6('0x31')],_0x592799[_0x4de6('0x33')]);_0x1b5607[_0x4de6('0x37')]=_[_0x4de6('0x36')](_0x592799[_0x4de6('0x31')],qs[_0x4de6('0x38')](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x38')]));_0x1b5607[_0x4de6('0x37')]=_0x1b5607[_0x4de6('0x37')][_0x4de6('0x39')]?_0x1b5607[_0x4de6('0x37')]:_0x592799[_0x4de6('0x31')];if(!_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3a')](_0x4de6('0x3b'))){_0x1b5607['limit']=qs[_0x4de6('0x1e')](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x1e')]);_0x1b5607[_0x4de6('0x1c')]=qs['offset'](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x1c')]);}_0x1b5607[_0x4de6('0x3c')]=qs[_0x4de6('0x3d')](_0x2bfc77['query'][_0x4de6('0x3d')]);_0x1b5607['where']=qs[_0x4de6('0x35')](_[_0x4de6('0x3e')](_0x2bfc77[_0x4de6('0x33')],_0x592799[_0x4de6('0x35')]),_0x530e04);if(_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3f')]){_0x1b5607[_0x4de6('0x40')]=_[_0x4de6('0x41')](_0x1b5607[_0x4de6('0x40')],{'$or':_[_0x4de6('0x32')](_0x530e04,function(_0x85581b){if(_0x85581b[_0x4de6('0x2f')]!=='VIRTUAL'){var _0x57a6ca={};_0x57a6ca[_0x85581b[_0x4de6('0x2b')]]={'$like':'%'+_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3f')]+'%'};return _0x57a6ca;}})});}_0x1b5607=_[_0x4de6('0x41')]({},_0x1b5607,_0x2bfc77['options']);var _0x5d07aa={'where':_0x1b5607[_0x4de6('0x40')]};return db['Tag'][_0x4de6('0x1f')](_0x5d07aa)['then'](function(_0x3696c8){_0x5593e8['count']=_0x3696c8;if(_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x42')]){_0x1b5607[_0x4de6('0x43')]=[{'all':!![]}];}return db[_0x4de6('0x44')]['findAll'](_0x1b5607);})[_0x4de6('0x25')](function(_0x4049ed){_0x5593e8['rows']=_0x4049ed;return _0x5593e8;})['then'](respondWithFilteredResult(_0x1df7c0,_0x1b5607))[_0x4de6('0x45')](handleError(_0x1df7c0,null));};exports['show']=function(_0x118eb3,_0x3260bc){var _0x3f0f08={'raw':!![],'where':{'id':_0x118eb3[_0x4de6('0x46')]['id']}},_0x349688={};_0x349688[_0x4de6('0x31')]=_[_0x4de6('0x34')](db[_0x4de6('0x44')][_0x4de6('0x2d')]);_0x349688[_0x4de6('0x33')]=_[_0x4de6('0x34')](_0x118eb3[_0x4de6('0x33')]);_0x349688['filters']=_['intersection'](_0x349688['model'],_0x349688[_0x4de6('0x33')]);_0x3f0f08[_0x4de6('0x37')]=_['intersection'](_0x349688['model'],qs[_0x4de6('0x38')](_0x118eb3['query'][_0x4de6('0x38')]));_0x3f0f08[_0x4de6('0x37')]=_0x3f0f08['attributes'][_0x4de6('0x39')]?_0x3f0f08[_0x4de6('0x37')]:_0x349688[_0x4de6('0x31')];if(_0x118eb3[_0x4de6('0x33')][_0x4de6('0x42')]){_0x3f0f08['include']=[{'all':!![]}];}_0x3f0f08=_[_0x4de6('0x41')]({},_0x3f0f08,_0x118eb3[_0x4de6('0x47')]);return db[_0x4de6('0x44')][_0x4de6('0x48')](_0x3f0f08)[_0x4de6('0x25')](handleEntityNotFound(_0x3260bc,null))[_0x4de6('0x25')](respondWithResult(_0x3260bc,null))[_0x4de6('0x45')](handleError(_0x3260bc,null));};exports[_0x4de6('0x49')]=function(_0x698dcb,_0x3126f1){return db[_0x4de6('0x44')][_0x4de6('0x49')](_0x698dcb[_0x4de6('0x4a')],{})[_0x4de6('0x25')](function(_0x354558){var _0x12ce25=_0x698dcb[_0x4de6('0x4b')]['get']({'plain':!![]});if(!_0x12ce25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ce25[_0x4de6('0x4c')]===_0x4de6('0x4b')){var _0x524807=_0x354558[_0x4de6('0x27')]({'plain':!![]});var _0x191f93=_0x4de6('0x28');return db[_0x4de6('0x4d')][_0x4de6('0x48')]({'where':{'name':_0x191f93,'userProfileId':_0x12ce25[_0x4de6('0x4e')]},'raw':!![]})[_0x4de6('0x25')](function(_0x502e4d){if(_0x502e4d&&_0x502e4d[_0x4de6('0x4f')]===0x0){return db['UserProfileResource'][_0x4de6('0x49')]({'name':_0x524807[_0x4de6('0x2b')],'resourceId':_0x524807['id'],'type':_0x502e4d[_0x4de6('0x2b')],'sectionId':_0x502e4d['id']},{})[_0x4de6('0x25')](function(){return _0x354558;});}else{return _0x354558;}})[_0x4de6('0x45')](function(_0xac3eb5){logger[_0x4de6('0x29')](_0x4de6('0x50'),_0xac3eb5);throw _0xac3eb5;});}return _0x354558;})['then'](respondWithResult(_0x3126f1,0xc9))['catch'](handleError(_0x3126f1,null));};exports[_0x4de6('0x51')]=function(_0x198054,_0x61bc5d){if(_0x198054[_0x4de6('0x4a')]['id']){delete _0x198054['body']['id'];}return db[_0x4de6('0x44')][_0x4de6('0x48')]({'where':{'id':_0x198054[_0x4de6('0x46')]['id']}})['then'](handleEntityNotFound(_0x61bc5d,null))[_0x4de6('0x25')](saveUpdates(_0x198054['body'],null))[_0x4de6('0x25')](respondWithResult(_0x61bc5d,null))[_0x4de6('0x45')](handleError(_0x61bc5d,null));};exports['destroy']=function(_0x19f34a,_0x1b71cf){return db['Tag'][_0x4de6('0x48')]({'where':{'id':_0x19f34a[_0x4de6('0x46')]['id']}})[_0x4de6('0x25')](handleEntityNotFound(_0x1b71cf,null))[_0x4de6('0x25')](removeEntity(_0x1b71cf,null))[_0x4de6('0x45')](handleError(_0x1b71cf,null));}; \ No newline at end of file +var _0x495e=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Tags','UserProfileResource','sendStatus','error','stack','name','send','index','Tag','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','find','catch','create','user','UserProfileSection'];(function(_0x355494,_0x592917){var _0x59d215=function(_0x1c59f7){while(--_0x1c59f7){_0x355494['push'](_0x355494['shift']());}};_0x59d215(++_0x592917);}(_0x495e,0xfb));var _0xe495=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x495e[_0x1e2321];return _0x1d346d;};'use strict';var emlformat=require(_0xe495('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe495('0x1'));var rp=require(_0xe495('0x2'));var moment=require(_0xe495('0x3'));var BPromise=require(_0xe495('0x4'));var Mustache=require('mustache');var util=require(_0xe495('0x5'));var path=require(_0xe495('0x6'));var sox=require(_0xe495('0x7'));var csv=require(_0xe495('0x8'));var ejs=require(_0xe495('0x9'));var fs=require('fs');var fs_extra=require(_0xe495('0xa'));var _=require(_0xe495('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe495('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe495('0xd'));var Papa=require(_0xe495('0xe'));var Redis=require(_0xe495('0xf'));var authService=require(_0xe495('0x10'));var qs=require(_0xe495('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe495('0x12'));var logger=require(_0xe495('0x13'))(_0xe495('0x14'));var utils=require('../../config/utils');var config=require(_0xe495('0x15'));var licenseUtil=require(_0xe495('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c2d4,_0x1d73a5){_0x1d73a5=_0x1d73a5||0xcc;return function(_0x13aedb){if(_0x13aedb){return _0x51c2d4['sendStatus'](_0x1d73a5);}return _0x51c2d4[_0xe495('0x17')](_0x1d73a5)[_0xe495('0x18')]();};}function respondWithResult(_0xab9c10,_0x14744d){_0x14744d=_0x14744d||0xc8;return function(_0x2b5e19){if(_0x2b5e19){return _0xab9c10['status'](_0x14744d)[_0xe495('0x19')](_0x2b5e19);}};}function respondWithFilteredResult(_0x103c25,_0x19d096){return function(_0x1c2d78){if(_0x1c2d78){var _0x1ea256=typeof _0x19d096['offset']==='undefined'&&typeof _0x19d096['limit']===_0xe495('0x1a');var _0x142978=_0x1c2d78[_0xe495('0x1b')];var _0x577fb7=_0x1ea256?0x0:_0x19d096[_0xe495('0x1c')];var _0x302ca0=_0x1ea256?_0x1c2d78[_0xe495('0x1b')]:_0x19d096[_0xe495('0x1c')]+_0x19d096[_0xe495('0x1d')];var _0x525953;if(_0x302ca0>=_0x142978){_0x302ca0=_0x142978;_0x525953=0xc8;}else{_0x525953=0xce;}_0x103c25['status'](_0x525953);return _0x103c25[_0xe495('0x1e')](_0xe495('0x1f'),_0x577fb7+'-'+_0x302ca0+'/'+_0x142978)[_0xe495('0x19')](_0x1c2d78);}return null;};}function patchUpdates(_0x169bd2){return function(_0x5d5d35){try{jsonpatch[_0xe495('0x20')](_0x5d5d35,_0x169bd2,!![]);}catch(_0x46ec15){return BPromise[_0xe495('0x21')](_0x46ec15);}return _0x5d5d35['save']();};}function saveUpdates(_0xa0c9bc,_0x17d13f){return function(_0x475a7e){if(_0x475a7e){return _0x475a7e[_0xe495('0x22')](_0xa0c9bc)[_0xe495('0x23')](function(_0x4840fa){return _0x4840fa;});}return null;};}function removeEntity(_0x33f19,_0x4d836b){return function(_0x181ead){if(_0x181ead){return _0x181ead[_0xe495('0x24')]()[_0xe495('0x23')](function(){var _0x5d095f=_0x181ead[_0xe495('0x25')]({'plain':!![]});var _0x2a6fd6=_0xe495('0x26');return db[_0xe495('0x27')][_0xe495('0x24')]({'where':{'type':_0x2a6fd6,'resourceId':_0x5d095f['id']}})[_0xe495('0x23')](function(){return _0x181ead;});})[_0xe495('0x23')](function(){_0x33f19['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2506f7,_0x5db642){return function(_0x1651d4){if(!_0x1651d4){_0x2506f7[_0xe495('0x28')](0x194);}return _0x1651d4;};}function handleError(_0x598108,_0x4e3a4d){_0x4e3a4d=_0x4e3a4d||0x1f4;return function(_0xd6585c){logger[_0xe495('0x29')](_0xd6585c[_0xe495('0x2a')]);if(_0xd6585c[_0xe495('0x2b')]){delete _0xd6585c[_0xe495('0x2b')];}_0x598108[_0xe495('0x17')](_0x4e3a4d)[_0xe495('0x2c')](_0xd6585c);};}exports[_0xe495('0x2d')]=function(_0x535d23,_0x4bae72){var _0x37b75={},_0x3a82ff={},_0x389177={'count':0x0,'rows':[]};var _0x40d3a3=_['map'](db[_0xe495('0x2e')][_0xe495('0x2f')],function(_0x227019){return{'name':_0x227019[_0xe495('0x30')],'type':_0x227019[_0xe495('0x31')][_0xe495('0x32')]};});_0x3a82ff[_0xe495('0x33')]=_[_0xe495('0x34')](_0x40d3a3,_0xe495('0x2b'));_0x3a82ff[_0xe495('0x35')]=_[_0xe495('0x36')](_0x535d23[_0xe495('0x35')]);_0x3a82ff[_0xe495('0x37')]=_[_0xe495('0x38')](_0x3a82ff[_0xe495('0x33')],_0x3a82ff['query']);_0x37b75[_0xe495('0x39')]=_[_0xe495('0x38')](_0x3a82ff['model'],qs[_0xe495('0x3a')](_0x535d23[_0xe495('0x35')]['fields']));_0x37b75['attributes']=_0x37b75[_0xe495('0x39')][_0xe495('0x3b')]?_0x37b75[_0xe495('0x39')]:_0x3a82ff[_0xe495('0x33')];if(!_0x535d23['query'][_0xe495('0x3c')](_0xe495('0x3d'))){_0x37b75[_0xe495('0x1d')]=qs['limit'](_0x535d23['query'][_0xe495('0x1d')]);_0x37b75['offset']=qs[_0xe495('0x1c')](_0x535d23[_0xe495('0x35')]['offset']);}_0x37b75['order']=qs[_0xe495('0x3e')](_0x535d23[_0xe495('0x35')][_0xe495('0x3e')]);_0x37b75[_0xe495('0x3f')]=qs[_0xe495('0x37')](_[_0xe495('0x40')](_0x535d23[_0xe495('0x35')],_0x3a82ff[_0xe495('0x37')]),_0x40d3a3);if(_0x535d23[_0xe495('0x35')][_0xe495('0x41')]){_0x37b75[_0xe495('0x3f')]=_[_0xe495('0x42')](_0x37b75['where'],{'$or':_[_0xe495('0x34')](_0x40d3a3,function(_0x1f80af){if(_0x1f80af[_0xe495('0x31')]!==_0xe495('0x43')){var _0x58df09={};_0x58df09[_0x1f80af[_0xe495('0x2b')]]={'$like':'%'+_0x535d23[_0xe495('0x35')]['filter']+'%'};return _0x58df09;}})});}_0x37b75=_['merge']({},_0x37b75,_0x535d23['options']);var _0x3abbda={'where':_0x37b75[_0xe495('0x3f')]};return db[_0xe495('0x2e')][_0xe495('0x1b')](_0x3abbda)[_0xe495('0x23')](function(_0x2670f2){_0x389177['count']=_0x2670f2;if(_0x535d23[_0xe495('0x35')][_0xe495('0x44')]){_0x37b75[_0xe495('0x45')]=[{'all':!![]}];}return db[_0xe495('0x2e')][_0xe495('0x46')](_0x37b75);})[_0xe495('0x23')](function(_0x39ddda){_0x389177[_0xe495('0x47')]=_0x39ddda;return _0x389177;})[_0xe495('0x23')](respondWithFilteredResult(_0x4bae72,_0x37b75))['catch'](handleError(_0x4bae72,null));};exports['show']=function(_0x2aa12f,_0x54ccb0){var _0x372b07={'raw':!![],'where':{'id':_0x2aa12f['params']['id']}},_0x379636={};_0x379636[_0xe495('0x33')]=_['keys'](db['Tag'][_0xe495('0x2f')]);_0x379636['query']=_[_0xe495('0x36')](_0x2aa12f['query']);_0x379636[_0xe495('0x37')]=_[_0xe495('0x38')](_0x379636[_0xe495('0x33')],_0x379636[_0xe495('0x35')]);_0x372b07[_0xe495('0x39')]=_[_0xe495('0x38')](_0x379636[_0xe495('0x33')],qs[_0xe495('0x3a')](_0x2aa12f[_0xe495('0x35')][_0xe495('0x3a')]));_0x372b07['attributes']=_0x372b07[_0xe495('0x39')]['length']?_0x372b07[_0xe495('0x39')]:_0x379636[_0xe495('0x33')];if(_0x2aa12f[_0xe495('0x35')][_0xe495('0x44')]){_0x372b07['include']=[{'all':!![]}];}_0x372b07=_['merge']({},_0x372b07,_0x2aa12f['options']);return db[_0xe495('0x2e')][_0xe495('0x48')](_0x372b07)['then'](handleEntityNotFound(_0x54ccb0,null))[_0xe495('0x23')](respondWithResult(_0x54ccb0,null))[_0xe495('0x49')](handleError(_0x54ccb0,null));};exports[_0xe495('0x4a')]=function(_0x103953,_0x13fa96){return db[_0xe495('0x2e')][_0xe495('0x4a')](_0x103953['body'],{})[_0xe495('0x23')](function(_0xdb9721){var _0x455d94=_0x103953[_0xe495('0x4b')][_0xe495('0x25')]({'plain':!![]});if(!_0x455d94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x455d94['role']===_0xe495('0x4b')){var _0x19d7b7=_0xdb9721[_0xe495('0x25')]({'plain':!![]});var _0x53cd3f='Tags';return db[_0xe495('0x4c')]['find']({'where':{'name':_0x53cd3f,'userProfileId':_0x455d94[_0xe495('0x4d')]},'raw':!![]})[_0xe495('0x23')](function(_0x5e5406){if(_0x5e5406&&_0x5e5406[_0xe495('0x4e')]===0x0){return db[_0xe495('0x27')][_0xe495('0x4a')]({'name':_0x19d7b7[_0xe495('0x2b')],'resourceId':_0x19d7b7['id'],'type':_0x5e5406[_0xe495('0x2b')],'sectionId':_0x5e5406['id']},{})[_0xe495('0x23')](function(){return _0xdb9721;});}else{return _0xdb9721;}})[_0xe495('0x49')](function(_0x2dd789){logger[_0xe495('0x29')](_0xe495('0x4f'),_0x2dd789);throw _0x2dd789;});}return _0xdb9721;})[_0xe495('0x23')](respondWithResult(_0x13fa96,0xc9))[_0xe495('0x49')](handleError(_0x13fa96,null));};exports['update']=function(_0x444bb1,_0x34d756){if(_0x444bb1[_0xe495('0x50')]['id']){delete _0x444bb1[_0xe495('0x50')]['id'];}return db[_0xe495('0x2e')][_0xe495('0x48')]({'where':{'id':_0x444bb1[_0xe495('0x51')]['id']}})[_0xe495('0x23')](handleEntityNotFound(_0x34d756,null))[_0xe495('0x23')](saveUpdates(_0x444bb1[_0xe495('0x50')],null))['then'](respondWithResult(_0x34d756,null))['catch'](handleError(_0x34d756,null));};exports[_0xe495('0x24')]=function(_0x102531,_0x4b5747){return db[_0xe495('0x2e')][_0xe495('0x48')]({'where':{'id':_0x102531[_0xe495('0x51')]['id']}})[_0xe495('0x23')](handleEntityNotFound(_0x4b5747,null))['then'](removeEntity(_0x4b5747,null))[_0xe495('0x49')](handleError(_0x4b5747,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 8769da3..502cd52 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 _0x77ce=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./tag.attributes','exports','define'];(function(_0x501d2a,_0x5afe46){var _0x48bda4=function(_0x268a1e){while(--_0x268a1e){_0x501d2a['push'](_0x501d2a['shift']());}};_0x48bda4(++_0x5afe46);}(_0x77ce,0x1b8));var _0xe77c=function(_0x34a718,_0x43b4d2){_0x34a718=_0x34a718-0x0;var _0xa214e5=_0x77ce[_0x34a718];return _0xa214e5;};'use strict';var _=require(_0xe77c('0x0'));var util=require(_0xe77c('0x1'));var logger=require(_0xe77c('0x2'))(_0xe77c('0x3'));var moment=require(_0xe77c('0x4'));var BPromise=require(_0xe77c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe77c('0x6'));var rimraf=require(_0xe77c('0x7'));var config=require('../../config/environment');var attributes=require(_0xe77c('0x8'));module[_0xe77c('0x9')]=function(_0x39596f,_0x25a09d){return _0x39596f[_0xe77c('0xa')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb93f=['./tag.attributes','exports','Tag','tools_tags','lodash','util','bluebird','request-promise','path'];(function(_0x2f34fb,_0x3cd22f){var _0xf11812=function(_0x5ea1a5){while(--_0x5ea1a5){_0x2f34fb['push'](_0x2f34fb['shift']());}};_0xf11812(++_0x3cd22f);}(_0xb93f,0x67));var _0xfb93=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0xb93f[_0x233cb1];return _0x29ee7e;};'use strict';var _=require(_0xfb93('0x0'));var util=require(_0xfb93('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfb93('0x2'));var rp=require(_0xfb93('0x3'));var fs=require('fs');var path=require(_0xfb93('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb93('0x5'));module[_0xfb93('0x6')]=function(_0x5772cd,_0x6c651){return _0x5772cd['define'](_0xfb93('0x7'),attributes,{'tableName':_0xfb93('0x8'),'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 3cb8b0d..c8a7214 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 _0x0624=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c15d8,_0x325671){var _0x2c77ea=function(_0x83e440){while(--_0x83e440){_0x1c15d8['push'](_0x1c15d8['shift']());}};_0x2c77ea(++_0x325671);}(_0x0624,0x132));var _0x4062=function(_0x314bf8,_0x2277c8){_0x314bf8=_0x314bf8-0x0;var _0x146d10=_0x0624[_0x314bf8];return _0x146d10;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4062('0x0'));var fs=require('fs');var Redis=require(_0x4062('0x1'));var db=require(_0x4062('0x2'))['db'];var utils=require(_0x4062('0x3'));var logger=require(_0x4062('0x4'))(_0x4062('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4062('0x6')][_0x4062('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f4928,_0xdff88c,_0x27794b){return new BPromise(function(_0x5d19e8,_0x75ce4e){return client['request'](_0x2f4928,_0x27794b)[_0x4062('0x8')](function(_0x35663b){logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,_0x4062('0xb'));logger[_0x4062('0xc')](_0x4062('0xd'),_0xdff88c,'request\x20sent',JSON[_0x4062('0xe')](_0x35663b));if(_0x35663b['error']){if(_0x35663b[_0x4062('0xf')][_0x4062('0x10')]===0x1f4){logger[_0x4062('0xf')](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')]['message']);return _0x75ce4e(_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);}logger['error'](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);return _0x5d19e8(_0x35663b['error']['message']);}else{logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,'request\x20sent');_0x5d19e8(_0x35663b['result']['message']);}})['catch'](function(_0x437432){logger['error'](_0x4062('0xa'),_0xdff88c,_0x437432);_0x75ce4e(_0x437432);});});} \ No newline at end of file +var _0x22fb=['Tag,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x16d99f,_0xe70c03){var _0x448055=function(_0x5d874d){while(--_0x5d874d){_0x16d99f['push'](_0x16d99f['shift']());}};_0x448055(++_0xe70c03);}(_0x22fb,0x192));var _0xb22f=function(_0x13a775,_0x3601d2){_0x13a775=_0x13a775-0x0;var _0x1ea126=_0x22fb[_0x13a775];return _0x1ea126;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('Tag,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e8fe468..2a5b094 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 7f8dec6..b3a2d31 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 _0xb10b=['name','sequelize','STRING'];(function(_0x2349fd,_0x1660fb){var _0x6c8162=function(_0xe0702){while(--_0xe0702){_0x2349fd['push'](_0x2349fd['shift']());}};_0x6c8162(++_0x1660fb);}(_0xb10b,0x12a));var _0xbb10=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0xb10b[_0x1269c6];return _0x4868c7;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x59a487,_0x4e62e1){var _0x1e187d=function(_0x457aa1){while(--_0x457aa1){_0x59a487['push'](_0x59a487['shift']());}};_0x1e187d(++_0x4e62e1);}(_0xb10b,0x12a));var _0xbb10=function(_0x44fb02,_0x16bdbc){_0x44fb02=_0x44fb02-0x0;var _0x4d3aaa=_0xb10b[_0x44fb02];return _0x4d3aaa;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index adad513..ed7c645 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 _0x0c18=['key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','type','VIRTUAL','merge','options','then','includeAll','include','rows','catch','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','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','UserId','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel','ValidationError','pick','capitalize','toLowerCase','Queues','addQueues','Unknown\x20channel','add','removeQueues','remove','addAgents','ids','Chat','Mail','Fax','Whatsapp','Voice','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','findAll','online','upsert','isNil','interface','format','SIP/%s','all','spread','removeAgents','isArray','Sms','Openchannel','Queue:remove','UserVoiceQueueRt','getAgents','filter','hasOwnProperty','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','./team.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','error','name','send','index','map','Team','rawAttributes','fieldName'];(function(_0x51f4fc,_0x1fe3ef){var _0x4d96fc=function(_0xddc9){while(--_0xddc9){_0x51f4fc['push'](_0x51f4fc['shift']());}};_0x4d96fc(++_0x1fe3ef);}(_0x0c18,0x101));var _0x80c1=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x0c18[_0x44b3bd];return _0x1efc4a;};'use strict';var emlformat=require(_0x80c1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x80c1('0x1'));var moment=require(_0x80c1('0x2'));var BPromise=require(_0x80c1('0x3'));var Mustache=require('mustache');var util=require(_0x80c1('0x4'));var path=require(_0x80c1('0x5'));var sox=require(_0x80c1('0x6'));var csv=require(_0x80c1('0x7'));var ejs=require(_0x80c1('0x8'));var fs=require('fs');var fs_extra=require(_0x80c1('0x9'));var _=require(_0x80c1('0xa'));var squel=require(_0x80c1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x80c1('0xc'));var toCsv=require(_0x80c1('0x7'));var querystring=require('querystring');var Papa=require(_0x80c1('0xd'));var Redis=require(_0x80c1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x80c1('0xf'));var hardwareService=require(_0x80c1('0x10'));var logger=require(_0x80c1('0x11'))(_0x80c1('0x12'));var utils=require(_0x80c1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x80c1('0x14'));var db=require('../../mysqldb')['db'];config[_0x80c1('0x15')]=_[_0x80c1('0x16')](config[_0x80c1('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80c1('0x15')]));require(_0x80c1('0x17'))[_0x80c1('0x18')](socket);function respondWithStatusCode(_0x23c8ce,_0x3dcde7){_0x3dcde7=_0x3dcde7||0xcc;return function(_0x3f6635){if(_0x3f6635){return _0x23c8ce[_0x80c1('0x19')](_0x3dcde7);}return _0x23c8ce['status'](_0x3dcde7)['end']();};}function respondWithResult(_0x2ea2af,_0xce2364){_0xce2364=_0xce2364||0xc8;return function(_0x9e4497){if(_0x9e4497){return _0x2ea2af[_0x80c1('0x1a')](_0xce2364)[_0x80c1('0x1b')](_0x9e4497);}};}function respondWithFilteredResult(_0x5a1173,_0x2ad9fe){return function(_0x2cc1b1){if(_0x2cc1b1){var _0x39fe91=typeof _0x2ad9fe[_0x80c1('0x1c')]===_0x80c1('0x1d')&&typeof _0x2ad9fe['limit']===_0x80c1('0x1d');var _0x2c9a7b=_0x2cc1b1[_0x80c1('0x1e')];var _0x1f7ac7=_0x39fe91?0x0:_0x2ad9fe[_0x80c1('0x1c')];var _0x236d3c=_0x39fe91?_0x2cc1b1['count']:_0x2ad9fe[_0x80c1('0x1c')]+_0x2ad9fe[_0x80c1('0x1f')];var _0x545119;if(_0x236d3c>=_0x2c9a7b){_0x236d3c=_0x2c9a7b;_0x545119=0xc8;}else{_0x545119=0xce;}_0x5a1173[_0x80c1('0x1a')](_0x545119);return _0x5a1173[_0x80c1('0x20')]('Content-Range',_0x1f7ac7+'-'+_0x236d3c+'/'+_0x2c9a7b)[_0x80c1('0x1b')](_0x2cc1b1);}return null;};}function patchUpdates(_0x13960d){return function(_0x231c9){try{jsonpatch['apply'](_0x231c9,_0x13960d,!![]);}catch(_0x3c2d82){return BPromise[_0x80c1('0x21')](_0x3c2d82);}return _0x231c9[_0x80c1('0x22')]();};}function saveUpdates(_0x6a32bc,_0x49a9e2){return function(_0x390773){if(_0x390773){return _0x390773['update'](_0x6a32bc)['then'](function(_0x5b80cf){return _0x5b80cf;});}return null;};}function handleEntityNotFound(_0x381284,_0x3b5fe4){return function(_0x3a3155){if(!_0x3a3155){_0x381284['sendStatus'](0x194);}return _0x3a3155;};}function handleError(_0xce50e,_0x713bd0){_0x713bd0=_0x713bd0||0x1f4;return function(_0x4c8ac4){logger[_0x80c1('0x23')](_0x4c8ac4['stack']);if(_0x4c8ac4[_0x80c1('0x24')]){delete _0x4c8ac4[_0x80c1('0x24')];}_0xce50e[_0x80c1('0x1a')](_0x713bd0)[_0x80c1('0x25')](_0x4c8ac4);};}exports[_0x80c1('0x26')]=function(_0x2c1775,_0x598d3b){var _0x506422={},_0x124765={},_0x4f6ce9={'count':0x0,'rows':[]};var _0x9a38d2=_[_0x80c1('0x27')](db[_0x80c1('0x28')][_0x80c1('0x29')],function(_0x31bb4d){return{'name':_0x31bb4d[_0x80c1('0x2a')],'type':_0x31bb4d['type'][_0x80c1('0x2b')]};});_0x124765[_0x80c1('0x2c')]=_[_0x80c1('0x27')](_0x9a38d2,_0x80c1('0x24'));_0x124765[_0x80c1('0x2d')]=_[_0x80c1('0x2e')](_0x2c1775[_0x80c1('0x2d')]);_0x124765['filters']=_[_0x80c1('0x2f')](_0x124765['model'],_0x124765[_0x80c1('0x2d')]);_0x506422[_0x80c1('0x30')]=_[_0x80c1('0x2f')](_0x124765[_0x80c1('0x2c')],qs[_0x80c1('0x31')](_0x2c1775[_0x80c1('0x2d')][_0x80c1('0x31')]));_0x506422[_0x80c1('0x30')]=_0x506422[_0x80c1('0x30')][_0x80c1('0x32')]?_0x506422[_0x80c1('0x30')]:_0x124765[_0x80c1('0x2c')];if(!_0x2c1775[_0x80c1('0x2d')]['hasOwnProperty'](_0x80c1('0x33'))){_0x506422[_0x80c1('0x1f')]=qs[_0x80c1('0x1f')](_0x2c1775[_0x80c1('0x2d')]['limit']);_0x506422[_0x80c1('0x1c')]=qs['offset'](_0x2c1775[_0x80c1('0x2d')]['offset']);}_0x506422[_0x80c1('0x34')]=qs[_0x80c1('0x35')](_0x2c1775['query'][_0x80c1('0x35')]);_0x506422[_0x80c1('0x36')]=qs['filters'](_['pick'](_0x2c1775[_0x80c1('0x2d')],_0x124765[_0x80c1('0x37')]),_0x9a38d2);if(_0x2c1775[_0x80c1('0x2d')]['filter']){_0x506422[_0x80c1('0x36')]=_['merge'](_0x506422[_0x80c1('0x36')],{'$or':_[_0x80c1('0x27')](_0x9a38d2,function(_0x24429c){if(_0x24429c[_0x80c1('0x38')]!==_0x80c1('0x39')){var _0x29e146={};_0x29e146[_0x24429c[_0x80c1('0x24')]]={'$like':'%'+_0x2c1775[_0x80c1('0x2d')]['filter']+'%'};return _0x29e146;}})});}_0x506422=_[_0x80c1('0x3a')]({},_0x506422,_0x2c1775[_0x80c1('0x3b')]);var _0x59d06f={'where':_0x506422[_0x80c1('0x36')]};return db['Team'][_0x80c1('0x1e')](_0x59d06f)[_0x80c1('0x3c')](function(_0x7affee){_0x4f6ce9['count']=_0x7affee;if(_0x2c1775[_0x80c1('0x2d')][_0x80c1('0x3d')]){_0x506422[_0x80c1('0x3e')]=[{'all':!![]}];}return db['Team']['findAll'](_0x506422);})[_0x80c1('0x3c')](function(_0x5a92c9){_0x4f6ce9[_0x80c1('0x3f')]=_0x5a92c9;return _0x4f6ce9;})[_0x80c1('0x3c')](respondWithFilteredResult(_0x598d3b,_0x506422))[_0x80c1('0x40')](handleError(_0x598d3b,null));};exports['show']=function(_0x11d524,_0x2b12ed){var _0x2f197b={'raw':![],'where':{'id':_0x11d524[_0x80c1('0x41')]['id']}},_0x5e800b={};_0x5e800b[_0x80c1('0x2c')]=_[_0x80c1('0x2e')](db[_0x80c1('0x28')]['rawAttributes']);_0x5e800b['query']=_[_0x80c1('0x2e')](_0x11d524['query']);_0x5e800b[_0x80c1('0x37')]=_[_0x80c1('0x2f')](_0x5e800b['model'],_0x5e800b[_0x80c1('0x2d')]);_0x2f197b['attributes']=_[_0x80c1('0x2f')](_0x5e800b['model'],qs[_0x80c1('0x31')](_0x11d524['query'][_0x80c1('0x31')]));_0x2f197b[_0x80c1('0x30')]=_0x2f197b[_0x80c1('0x30')][_0x80c1('0x32')]?_0x2f197b[_0x80c1('0x30')]:_0x5e800b[_0x80c1('0x2c')];if(_0x11d524[_0x80c1('0x2d')][_0x80c1('0x3d')]){_0x2f197b[_0x80c1('0x3e')]=[{'all':!![]}];}_0x2f197b=_['merge']({},_0x2f197b,_0x11d524['options']);return db[_0x80c1('0x28')][_0x80c1('0x42')](_0x2f197b)[_0x80c1('0x3c')](handleEntityNotFound(_0x2b12ed,null))[_0x80c1('0x3c')](respondWithResult(_0x2b12ed,null))['catch'](handleError(_0x2b12ed,null));};exports[_0x80c1('0x43')]=function(_0x17c48a,_0x94a4f1){return db[_0x80c1('0x28')][_0x80c1('0x43')](_0x17c48a[_0x80c1('0x44')],{})[_0x80c1('0x3c')](function(_0x27a935){var _0x4c4447=_0x17c48a['user'][_0x80c1('0x45')]({'plain':!![]});if(!_0x4c4447)throw new Error(_0x80c1('0x46'));if(_0x4c4447[_0x80c1('0x47')]===_0x80c1('0x48')){var _0x2a2602=_0x27a935[_0x80c1('0x45')]({'plain':!![]});var _0xd12c8f=_0x80c1('0x49');return db[_0x80c1('0x4a')][_0x80c1('0x42')]({'where':{'name':_0xd12c8f,'userProfileId':_0x4c4447[_0x80c1('0x4b')]},'raw':!![]})['then'](function(_0x44ac67){if(_0x44ac67&&_0x44ac67[_0x80c1('0x4c')]===0x0){return db[_0x80c1('0x4d')][_0x80c1('0x43')]({'name':_0x2a2602[_0x80c1('0x24')],'resourceId':_0x2a2602['id'],'type':_0x44ac67[_0x80c1('0x24')],'sectionId':_0x44ac67['id']},{})[_0x80c1('0x3c')](function(){return _0x27a935;});}else{return _0x27a935;}})['catch'](function(_0x4e0ed9){logger[_0x80c1('0x23')](_0x80c1('0x4e'),_0x4e0ed9);throw _0x4e0ed9;});}return _0x27a935;})[_0x80c1('0x3c')](respondWithResult(_0x94a4f1,0xc9))[_0x80c1('0x40')](handleError(_0x94a4f1,null));};exports[_0x80c1('0x4f')]=function(_0x3cddbc,_0x1c786b){if(_0x3cddbc['body']['id']){delete _0x3cddbc[_0x80c1('0x44')]['id'];}return db[_0x80c1('0x28')][_0x80c1('0x42')]({'where':{'id':_0x3cddbc[_0x80c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c786b,null))['then'](saveUpdates(_0x3cddbc[_0x80c1('0x44')],null))['then'](respondWithResult(_0x1c786b,null))[_0x80c1('0x40')](handleError(_0x1c786b,null));};exports['destroy']=function(_0x52c89d,_0x3fa4a4){var _0x2f0e96=_0x52c89d[_0x80c1('0x41')]['id'];var _0x326e4d=[];return db[_0x80c1('0x50')][_0x80c1('0x51')](function(_0x1635b5){var _0x39f1d0=_0x80c1('0x52')+_0x2f0e96;return db[_0x80c1('0x50')][_0x80c1('0x2d')](_0x39f1d0,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5})['then'](function(_0x45c7d0){_0x326e4d=_[_0x80c1('0x27')](_0x45c7d0,function(_0x302143){return Number(_0x302143[_0x80c1('0x56')]);});})[_0x80c1('0x3c')](function(){var _0x3cadb1='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2f0e96;return db[_0x80c1('0x50')][_0x80c1('0x2d')](_0x3cadb1,{'type':db['Sequelize'][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x29031e){var _0x28e75c=_[_0x80c1('0x27')](_0x29031e,function(_0x308736){return Number(_0x308736[_0x80c1('0x57')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x326e4d},'VoiceQueueId':{'$in':_0x28e75c}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){var _0x2e6291=_0x80c1('0x58')+_0x2f0e96;return db[_0x80c1('0x50')][_0x80c1('0x2d')](_0x2e6291,{'type':db[_0x80c1('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0xfc1c75){var _0x5bfe9d=_[_0x80c1('0x27')](_0xfc1c75,function(_0x6ac2c9){return Number(_0x6ac2c9['MailQueueId']);});return db['UserMailQueue'][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'MailQueueId':{'$in':_0x5bfe9d}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){var _0x535630=_0x80c1('0x5a')+_0x2f0e96;return db[_0x80c1('0x50')]['query'](_0x535630,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x4a68bd){var _0x8a65d6=_[_0x80c1('0x27')](_0x4a68bd,function(_0x1ecfec){return Number(_0x1ecfec[_0x80c1('0x5b')]);});return db[_0x80c1('0x5c')][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'SmsQueueId':{'$in':_0x8a65d6}},'transaction':_0x1635b5});})['then'](function(){var _0x11be22='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x11be22,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x3742c8){var _0x3c7336=_[_0x80c1('0x27')](_0x3742c8,function(_0x8f21d0){return Number(_0x8f21d0['ChatQueueId']);});return db['UserChatQueue'][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'ChatQueueId':{'$in':_0x3c7336}},'transaction':_0x1635b5});})['then'](function(){var _0x13aba3=_0x80c1('0x5d')+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x13aba3,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x48e3a0){var _0x1dbf6e=_[_0x80c1('0x27')](_0x48e3a0,function(_0x513adc){return Number(_0x513adc[_0x80c1('0x5e')]);});return db[_0x80c1('0x5f')][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'FaxQueueId':{'$in':_0x1dbf6e}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){var _0x3544dd=_0x80c1('0x60')+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x3544dd,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x52ccfe){var _0x384ac0=_[_0x80c1('0x27')](_0x52ccfe,function(_0x1becad){return Number(_0x1becad['OpenchannelQueueId']);});return db[_0x80c1('0x61')]['destroy']({'where':{'UserId':{'$in':_0x326e4d},'OpenchannelQueueId':{'$in':_0x384ac0}},'transaction':_0x1635b5});})['then'](function(){var _0x22ab30=_0x80c1('0x62')+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x22ab30,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')]['SELECT'],'raw':!![],'transaction':_0x1635b5});})['then'](function(_0x459141){var _0x31ec21=_[_0x80c1('0x27')](_0x459141,function(_0x2b5760){return Number(_0x2b5760[_0x80c1('0x63')]);});return db['UserWhatsappQueue'][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'WhatsappQueueId':{'$in':_0x31ec21}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x64')][_0x80c1('0x42')]({'where':{'TeamId':_0x2f0e96}});})[_0x80c1('0x3c')](function(_0x197f2b){if(_0x197f2b===null){return;}return db[_0x80c1('0x65')][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'VoicePrefixId':_0x197f2b[_0x80c1('0x66')]},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x28')][_0x80c1('0x59')]({'where':{'id':_0x2f0e96},'cascade':!![],'transaction':_0x1635b5});})['then'](function(_0x26a15a){if(_0x26a15a===0x0){_0x3fa4a4['sendStatus'](0x194);}else{return db[_0x80c1('0x4d')][_0x80c1('0x59')]({'where':{'type':'Teams','resourceId':_0x2f0e96},'cascade':!![],'transaction':_0x1635b5})[_0x80c1('0x3c')](function(){_0x3fa4a4[_0x80c1('0x1a')](0xcc)[_0x80c1('0x67')]();});}})[_0x80c1('0x40')](function(_0x87ac59){_0x3fa4a4[_0x80c1('0x1a')](0x1f4)[_0x80c1('0x25')](_0x87ac59);});});};exports[_0x80c1('0x68')]=function(_0x43a07d,_0x2ac090,_0x2e5c46){return db[_0x80c1('0x28')][_0x80c1('0x69')]({'where':{'id':_0x43a07d[_0x80c1('0x41')]['id']}})[_0x80c1('0x3c')](handleEntityNotFound(_0x2ac090,null))[_0x80c1('0x3c')](function(_0x4fe0af){if(!_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x6a')]||!utils[_0x80c1('0x6b')](_0x43a07d[_0x80c1('0x2d')]['channel'])){throw new db[(_0x80c1('0x53'))][(_0x80c1('0x6c'))]('Unknown\x20channel');}var _0x2fa349={};var _0x171850={};_0x171850[_0x80c1('0x2c')]=_[_0x80c1('0x2e')](db[_['capitalize'](_0x43a07d[_0x80c1('0x2d')]['channel']['toLowerCase']())+'Queue'][_0x80c1('0x29')]);_0x171850[_0x80c1('0x2d')]=_[_0x80c1('0x2e')](_0x43a07d[_0x80c1('0x2d')]);_0x171850[_0x80c1('0x37')]=_['intersection'](_0x171850[_0x80c1('0x2c')],_0x171850[_0x80c1('0x2d')]);_0x2fa349['attributes']=_['intersection'](_0x171850[_0x80c1('0x2c')],qs['fields'](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x31')]));_0x2fa349[_0x80c1('0x30')]=_0x2fa349['attributes']['length']?_0x2fa349[_0x80c1('0x30')]:_0x171850['model'];_0x2fa349[_0x80c1('0x1f')]=qs[_0x80c1('0x1f')](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x1f')]);_0x2fa349[_0x80c1('0x1c')]=qs[_0x80c1('0x1c')](_0x43a07d['query']['offset']);_0x2fa349[_0x80c1('0x34')]=qs['sort'](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x35')]);_0x2fa349['where']=qs[_0x80c1('0x37')](_[_0x80c1('0x6d')](_0x43a07d[_0x80c1('0x2d')],_0x171850[_0x80c1('0x37')]));_0x2fa349=_[_0x80c1('0x3a')]({},_0x2fa349,_0x43a07d['options']);return _0x4fe0af[_0x80c1('0x45')+_[_0x80c1('0x6e')](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x6a')][_0x80c1('0x6f')]())+_0x80c1('0x70')](_0x2fa349);})[_0x80c1('0x3c')](respondWithResult(_0x2ac090,null))[_0x80c1('0x40')](handleError(_0x2ac090,null));};exports[_0x80c1('0x71')]=function(_0x393737,_0x182b60,_0x6d241){return db[_0x80c1('0x28')][_0x80c1('0x69')]({'where':{'id':_0x393737['params']['id']}})['then'](function(_0x2d74b8){if(_0x2d74b8){if(!_0x393737[_0x80c1('0x44')][_0x80c1('0x6a')]||!utils['isValidChannel'](_0x393737[_0x80c1('0x44')][_0x80c1('0x6a')])){throw new db[(_0x80c1('0x53'))][(_0x80c1('0x6c'))](_0x80c1('0x72'));}return _0x2d74b8[_0x80c1('0x73')+_['capitalize'](_0x393737[_0x80c1('0x44')]['channel'][_0x80c1('0x6f')]())+'Queues'](_0x393737[_0x80c1('0x44')]['ids']);}return null;})[_0x80c1('0x3c')](handleEntityNotFound(_0x182b60,null))[_0x80c1('0x3c')](respondWithStatusCode(_0x182b60,null))[_0x80c1('0x40')](handleError(_0x182b60,null));};exports[_0x80c1('0x74')]=function(_0x42678b,_0x26115f,_0x41d974){return db[_0x80c1('0x28')][_0x80c1('0x69')]({'where':{'id':_0x42678b[_0x80c1('0x41')]['id']}})['then'](function(_0x305dfa){if(_0x305dfa){if(!_0x42678b[_0x80c1('0x2d')]['channel']||!utils[_0x80c1('0x6b')](_0x42678b['query'][_0x80c1('0x6a')])){throw new db[(_0x80c1('0x53'))][(_0x80c1('0x6c'))]('Unknown\x20channel');}return _0x305dfa[_0x80c1('0x75')+_[_0x80c1('0x6e')](_0x42678b[_0x80c1('0x2d')][_0x80c1('0x6a')][_0x80c1('0x6f')]())+'Queues'](_0x42678b[_0x80c1('0x2d')]['ids']);}return null;})[_0x80c1('0x3c')](handleEntityNotFound(_0x26115f,null))[_0x80c1('0x3c')](respondWithStatusCode(_0x26115f,null))[_0x80c1('0x40')](handleError(_0x26115f,null));};exports[_0x80c1('0x76')]=function(_0x1bfbdf,_0x4ebe72){var _0x11b8fe=_['isArray'](_0x1bfbdf['body']['ids'])?_0x1bfbdf[_0x80c1('0x44')][_0x80c1('0x77')]:[_0x1bfbdf[_0x80c1('0x44')][_0x80c1('0x77')]];var _0x48c19c=_0x1bfbdf['params']['id'];return db[_0x80c1('0x28')][_0x80c1('0x42')]({'where':{'id':_0x48c19c}})[_0x80c1('0x3c')](handleEntityNotFound(_0x4ebe72,null))[_0x80c1('0x3c')](function(_0x510d37){if(_0x510d37){var _0x45c7e9=['Voice',_0x80c1('0x78'),_0x80c1('0x79'),'Sms',_0x80c1('0x7a'),'Openchannel',_0x80c1('0x7b')];return db[_0x80c1('0x50')]['transaction'](function(_0x2b181f){var _0x3eb09a=_[_0x80c1('0x27')](_0x45c7e9,function(_0x8c5f2e){var _0x264f3b={'attributes':['id',_0x80c1('0x24')]};if(_0x8c5f2e===_0x80c1('0x7c')){_0x264f3b['through']={'attributes':[_0x80c1('0x7d')]};}return _0x510d37[_0x80c1('0x45')+_0x8c5f2e+_0x80c1('0x70')](_0x264f3b)['then'](function(_0x1bc033){var _0x7e07e2=_['map'](_0x1bc033,function(_0x3c553c){var _0x9e102e=_[_0x80c1('0x27')](_0x11b8fe,function(_0x5be50a){var _0x115c86={'where':{'UserId':_0x5be50a,[_0x8c5f2e+_0x80c1('0x7e')]:_0x3c553c['id']},'transaction':_0x2b181f};if(_0x8c5f2e===_0x80c1('0x7c')){_0x115c86[_0x80c1('0x16')]={'penalty':_0x3c553c[_0x80c1('0x7f')]['penalty']};}return db[_0x80c1('0x80')+_0x8c5f2e+_0x80c1('0x81')][_0x80c1('0x82')](_0x115c86)['then'](function(){socket[_0x80c1('0x83')](_0x80c1('0x48')+_0x8c5f2e+'Queue:save',{'UserId':_0x5be50a,[_0x8c5f2e+_0x80c1('0x7e')]:_0x3c553c['id']});if(_0x8c5f2e!=='Voice'){return;}return db[_0x80c1('0x80')][_0x80c1('0x84')]({'where':{'id':_0x11b8fe,'online':0x1},'attributes':['id',_0x80c1('0x24'),_0x80c1('0x85'),'voicePause','interface'],'raw':!![]})[_0x80c1('0x3c')](function(_0x56dd11){var _0x1dabf4=_[_0x80c1('0x27')](_0x56dd11,function(_0x5283ed){return db['UserVoiceQueueRt'][_0x80c1('0x86')]({'membername':_0x5283ed['name'],'UserId':_0x5283ed['id'],'queue_name':_0x3c553c[_0x80c1('0x24')],'VoiceQueueId':_0x3c553c['id'],'interface':_[_0x80c1('0x87')](_0x5283ed[_0x80c1('0x88')])?util[_0x80c1('0x89')](_0x80c1('0x8a'),_0x5283ed[_0x80c1('0x24')]):_0x5283ed[_0x80c1('0x88')],'paused':_0x5283ed['voicePause']||![],'penalty':_0x3c553c['TeamVoiceQueue'][_0x80c1('0x7d')]},{'transaction':_0x2b181f});});return Promise['all'](_0x1dabf4);});});});return Promise[_0x80c1('0x8b')](_0x9e102e);});return Promise[_0x80c1('0x8b')](_0x7e07e2);})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x64')][_0x80c1('0x69')]({'where':{'teamId':_0x48c19c}})[_0x80c1('0x3c')](function(_0x826316){if(_0x826316){var _0x5045be=_[_0x80c1('0x27')](_0x11b8fe,function(_0x2e4347){db[_0x80c1('0x65')][_0x80c1('0x86')]({'UserId':_0x2e4347,'VoicePrefixId':_0x826316[_0x80c1('0x66')]});});return Promise[_0x80c1('0x8b')](_0x5045be);}});});});return Promise[_0x80c1('0x8b')](_0x3eb09a)[_0x80c1('0x3c')](function(){return _0x510d37[_0x80c1('0x76')](_0x11b8fe,{'transaction':_0x2b181f})[_0x80c1('0x8c')](function(_0x37188c){return _0x37188c;});});});}})[_0x80c1('0x3c')](respondWithResult(_0x4ebe72,null))[_0x80c1('0x40')](handleError(_0x4ebe72,null));};exports[_0x80c1('0x8d')]=function(_0x1e2393,_0x239644){var _0xfee74=_[_0x80c1('0x8e')](_0x1e2393[_0x80c1('0x2d')][_0x80c1('0x77')])?_0x1e2393[_0x80c1('0x2d')][_0x80c1('0x77')]:[_0x1e2393[_0x80c1('0x2d')]['ids']];var _0x4d9cc9=_0x1e2393[_0x80c1('0x41')]['id'];return db['Team'][_0x80c1('0x42')]({'where':{'id':_0x4d9cc9}})[_0x80c1('0x3c')](handleEntityNotFound(_0x239644,null))[_0x80c1('0x3c')](function(_0x4a9b97){if(_0x4a9b97){var _0x308577=[_0x80c1('0x7c'),_0x80c1('0x78'),_0x80c1('0x79'),_0x80c1('0x8f'),_0x80c1('0x7a'),_0x80c1('0x90'),_0x80c1('0x7b')];return db[_0x80c1('0x50')][_0x80c1('0x51')](function(_0x274f47){var _0x1033f4=_[_0x80c1('0x27')](_0x308577,function(_0x401d18){var _0x571c31={'attributes':['id','name']};return _0x4a9b97[_0x80c1('0x45')+_0x401d18+_0x80c1('0x70')](_0x571c31)[_0x80c1('0x3c')](function(_0x368f27){var _0x8d9fb4=_['map'](_0x368f27,function(_0x1daa18){return _0x1daa18[_0x80c1('0x8d')](_0xfee74,{'transaction':_0x274f47})[_0x80c1('0x3c')](function(){var _0x28f4a0=_[_0x80c1('0x27')](_0xfee74,function(_0x20f23c){socket[_0x80c1('0x83')]('user'+_0x401d18+_0x80c1('0x91'),{'UserId':Number(_0x20f23c),[_0x401d18+_0x80c1('0x7e')]:_0x1daa18['id']});if(_0x401d18!==_0x80c1('0x7c')){return;}return db[_0x80c1('0x92')][_0x80c1('0x59')]({'where':{'VoiceQueueId':_0x1daa18['id'],'UserId':_0x20f23c},'transaction':_0x274f47});});return Promise['all'](_0x28f4a0);});});return Promise[_0x80c1('0x8b')](_0x8d9fb4);});});return Promise[_0x80c1('0x8b')](_0x1033f4)['then'](function(){return _0x4a9b97['removeAgents'](_0xfee74,{'transaction':_0x274f47});})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x64')][_0x80c1('0x69')]({'where':{'teamId':_0x4d9cc9}})[_0x80c1('0x3c')](function(_0x1c29c3){if(_0x1c29c3){var _0x4e8d0a=_[_0x80c1('0x27')](_0xfee74,function(_0x19fe4b){db['UserVoicePrefix'][_0x80c1('0x59')]({'where':{'UserId':_0x19fe4b,'VoicePrefixId':_0x1c29c3[_0x80c1('0x66')]}});});return Promise[_0x80c1('0x8b')](_0x4e8d0a);}});});});}})[_0x80c1('0x3c')](respondWithStatusCode(_0x239644,null))[_0x80c1('0x40')](handleError(_0x239644,null));};exports[_0x80c1('0x93')]=function(_0x2a4e68,_0x10cf43,_0x534f81){var _0x23c4a5={};var _0x26af9c={};var _0x2fdfa7;var _0x913051;return db[_0x80c1('0x28')]['findOne']({'where':{'id':_0x2a4e68[_0x80c1('0x41')]['id']}})[_0x80c1('0x3c')](handleEntityNotFound(_0x10cf43,null))[_0x80c1('0x3c')](function(_0x2a37ec){if(_0x2a37ec){_0x2fdfa7=_0x2a37ec;_0x26af9c[_0x80c1('0x2c')]=_[_0x80c1('0x2e')](db[_0x80c1('0x80')][_0x80c1('0x29')]);_0x26af9c[_0x80c1('0x2d')]=_['keys'](_0x2a4e68['query']);_0x26af9c[_0x80c1('0x37')]=_[_0x80c1('0x2f')](_0x26af9c['model'],_0x26af9c['query']);_0x23c4a5[_0x80c1('0x30')]=_[_0x80c1('0x2f')](_0x26af9c[_0x80c1('0x2c')],qs['fields'](_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x31')]));_0x23c4a5[_0x80c1('0x30')]=_0x23c4a5[_0x80c1('0x30')]['length']?_0x23c4a5[_0x80c1('0x30')]:_0x26af9c[_0x80c1('0x2c')];_0x23c4a5[_0x80c1('0x34')]=qs[_0x80c1('0x35')](_0x2a4e68['query'][_0x80c1('0x35')]);_0x23c4a5[_0x80c1('0x36')]=qs['filters'](_[_0x80c1('0x6d')](_0x2a4e68['query'],_0x26af9c[_0x80c1('0x37')]));if(_0x2a4e68['query'][_0x80c1('0x94')]){_0x23c4a5[_0x80c1('0x36')]=_['merge'](_0x23c4a5[_0x80c1('0x36')],{'$or':_[_0x80c1('0x27')](_0x23c4a5['attributes'],function(_0x5ecf6e){var _0x413cfe={};_0x413cfe[_0x5ecf6e]={'$like':'%'+_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x94')]+'%'};return _0x413cfe;})});}_0x23c4a5=_[_0x80c1('0x3a')]({},_0x23c4a5,_0x2a4e68['options']);return _0x2fdfa7[_0x80c1('0x93')](_0x23c4a5);}})[_0x80c1('0x3c')](function(_0x4b0a1e){if(_0x4b0a1e){_0x913051=_0x4b0a1e[_0x80c1('0x32')];if(!_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x95')](_0x80c1('0x33'))){_0x23c4a5[_0x80c1('0x1f')]=qs[_0x80c1('0x1f')](_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x1f')]);_0x23c4a5['offset']=qs[_0x80c1('0x1c')](_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x1c')]);}return _0x2fdfa7[_0x80c1('0x93')](_0x23c4a5);}})[_0x80c1('0x3c')](function(_0x4ba06f){if(_0x4ba06f){return _0x4ba06f?{'count':_0x913051,'rows':_0x4ba06f}:null;}})[_0x80c1('0x3c')](respondWithResult(_0x10cf43,null))[_0x80c1('0x40')](handleError(_0x10cf43,null));}; \ No newline at end of file +var _0x0d60=['lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','find','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','MailQueueId','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','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','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','Whatsapp','removeAgents','getAgents','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x538608,_0x576b74){var _0x4d6339=function(_0x10facb){while(--_0x10facb){_0x538608['push'](_0x538608['shift']());}};_0x4d6339(++_0x576b74);}(_0x0d60,0x1d4));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x00d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x00d6('0x1'));var jsonpatch=require(_0x00d6('0x2'));var rp=require(_0x00d6('0x3'));var moment=require(_0x00d6('0x4'));var BPromise=require(_0x00d6('0x5'));var Mustache=require(_0x00d6('0x6'));var util=require(_0x00d6('0x7'));var path=require(_0x00d6('0x8'));var sox=require(_0x00d6('0x9'));var csv=require('to-csv');var ejs=require(_0x00d6('0xa'));var fs=require('fs');var fs_extra=require(_0x00d6('0xb'));var _=require(_0x00d6('0xc'));var squel=require(_0x00d6('0xd'));var crypto=require(_0x00d6('0xe'));var jsforce=require(_0x00d6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x00d6('0x10'));var querystring=require(_0x00d6('0x11'));var Papa=require(_0x00d6('0x12'));var Redis=require(_0x00d6('0x13'));var authService=require(_0x00d6('0x14'));var qs=require(_0x00d6('0x15'));var as=require(_0x00d6('0x16'));var hardwareService=require(_0x00d6('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x00d6('0x18'));var db=require(_0x00d6('0x19'))['db'];config[_0x00d6('0x1a')]=_[_0x00d6('0x1b')](config[_0x00d6('0x1a')],{'host':_0x00d6('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x00d6('0x1d'))[_0x00d6('0x1e')](socket);function respondWithStatusCode(_0x283176,_0x1b7a8f){_0x1b7a8f=_0x1b7a8f||0xcc;return function(_0x323da6){if(_0x323da6){return _0x283176[_0x00d6('0x1f')](_0x1b7a8f);}return _0x283176[_0x00d6('0x20')](_0x1b7a8f)['end']();};}function respondWithResult(_0x384979,_0x3d0247){_0x3d0247=_0x3d0247||0xc8;return function(_0x539950){if(_0x539950){return _0x384979[_0x00d6('0x20')](_0x3d0247)['json'](_0x539950);}};}function respondWithFilteredResult(_0x4efbd4,_0x201fcb){return function(_0x3cf5a8){if(_0x3cf5a8){var _0x1ab225=typeof _0x201fcb[_0x00d6('0x21')]===_0x00d6('0x22')&&typeof _0x201fcb[_0x00d6('0x23')]===_0x00d6('0x22');var _0x5e51a6=_0x3cf5a8[_0x00d6('0x24')];var _0x3823c7=_0x1ab225?0x0:_0x201fcb[_0x00d6('0x21')];var _0x103b88=_0x1ab225?_0x3cf5a8['count']:_0x201fcb[_0x00d6('0x21')]+_0x201fcb[_0x00d6('0x23')];var _0x462e08;if(_0x103b88>=_0x5e51a6){_0x103b88=_0x5e51a6;_0x462e08=0xc8;}else{_0x462e08=0xce;}_0x4efbd4[_0x00d6('0x20')](_0x462e08);return _0x4efbd4[_0x00d6('0x25')](_0x00d6('0x26'),_0x3823c7+'-'+_0x103b88+'/'+_0x5e51a6)[_0x00d6('0x27')](_0x3cf5a8);}return null;};}function patchUpdates(_0x24ef52){return function(_0x554584){try{jsonpatch['apply'](_0x554584,_0x24ef52,!![]);}catch(_0x1802da){return BPromise[_0x00d6('0x28')](_0x1802da);}return _0x554584[_0x00d6('0x29')]();};}function saveUpdates(_0x3c0a93,_0xda859){return function(_0x5574b7){if(_0x5574b7){return _0x5574b7[_0x00d6('0x2a')](_0x3c0a93)[_0x00d6('0x2b')](function(_0x23fdf5){return _0x23fdf5;});}return null;};}function handleEntityNotFound(_0x13a1f6,_0x406f17){return function(_0x1cc8e6){if(!_0x1cc8e6){_0x13a1f6['sendStatus'](0x194);}return _0x1cc8e6;};}function handleError(_0x42b01e,_0x1c89d1){_0x1c89d1=_0x1c89d1||0x1f4;return function(_0x2b1c06){logger[_0x00d6('0x2c')](_0x2b1c06[_0x00d6('0x2d')]);if(_0x2b1c06[_0x00d6('0x2e')]){delete _0x2b1c06['name'];}_0x42b01e['status'](_0x1c89d1)[_0x00d6('0x2f')](_0x2b1c06);};}exports[_0x00d6('0x30')]=function(_0x104243,_0x584245){var _0xfd5c5a={},_0x1090ae={},_0x959048={'count':0x0,'rows':[]};var _0x1d0b32=_[_0x00d6('0x31')](db[_0x00d6('0x32')][_0x00d6('0x33')],function(_0x53545b){return{'name':_0x53545b[_0x00d6('0x34')],'type':_0x53545b[_0x00d6('0x35')][_0x00d6('0x36')]};});_0x1090ae[_0x00d6('0x37')]=_[_0x00d6('0x31')](_0x1d0b32,_0x00d6('0x2e'));_0x1090ae['query']=_[_0x00d6('0x38')](_0x104243[_0x00d6('0x39')]);_0x1090ae[_0x00d6('0x3a')]=_[_0x00d6('0x3b')](_0x1090ae[_0x00d6('0x37')],_0x1090ae['query']);_0xfd5c5a[_0x00d6('0x3c')]=_[_0x00d6('0x3b')](_0x1090ae[_0x00d6('0x37')],qs['fields'](_0x104243[_0x00d6('0x39')]['fields']));_0xfd5c5a[_0x00d6('0x3c')]=_0xfd5c5a[_0x00d6('0x3c')][_0x00d6('0x3d')]?_0xfd5c5a[_0x00d6('0x3c')]:_0x1090ae[_0x00d6('0x37')];if(!_0x104243[_0x00d6('0x39')]['hasOwnProperty'](_0x00d6('0x3e'))){_0xfd5c5a[_0x00d6('0x23')]=qs['limit'](_0x104243[_0x00d6('0x39')]['limit']);_0xfd5c5a[_0x00d6('0x21')]=qs[_0x00d6('0x21')](_0x104243[_0x00d6('0x39')][_0x00d6('0x21')]);}_0xfd5c5a[_0x00d6('0x3f')]=qs[_0x00d6('0x40')](_0x104243[_0x00d6('0x39')]['sort']);_0xfd5c5a[_0x00d6('0x41')]=qs[_0x00d6('0x3a')](_['pick'](_0x104243[_0x00d6('0x39')],_0x1090ae[_0x00d6('0x3a')]),_0x1d0b32);if(_0x104243[_0x00d6('0x39')][_0x00d6('0x42')]){_0xfd5c5a['where']=_[_0x00d6('0x43')](_0xfd5c5a[_0x00d6('0x41')],{'$or':_[_0x00d6('0x31')](_0x1d0b32,function(_0x351cc7){if(_0x351cc7[_0x00d6('0x35')]!==_0x00d6('0x44')){var _0x289e0b={};_0x289e0b[_0x351cc7[_0x00d6('0x2e')]]={'$like':'%'+_0x104243[_0x00d6('0x39')][_0x00d6('0x42')]+'%'};return _0x289e0b;}})});}_0xfd5c5a=_[_0x00d6('0x43')]({},_0xfd5c5a,_0x104243[_0x00d6('0x45')]);var _0x22f436={'where':_0xfd5c5a['where']};return db[_0x00d6('0x32')][_0x00d6('0x24')](_0x22f436)[_0x00d6('0x2b')](function(_0x55274d){_0x959048['count']=_0x55274d;if(_0x104243['query'][_0x00d6('0x46')]){_0xfd5c5a[_0x00d6('0x47')]=[{'all':!![]}];}return db[_0x00d6('0x32')][_0x00d6('0x48')](_0xfd5c5a);})[_0x00d6('0x2b')](function(_0x371341){_0x959048[_0x00d6('0x49')]=_0x371341;return _0x959048;})['then'](respondWithFilteredResult(_0x584245,_0xfd5c5a))[_0x00d6('0x4a')](handleError(_0x584245,null));};exports[_0x00d6('0x4b')]=function(_0x5447d4,_0x2c1d7c){var _0x16c82b={'raw':![],'where':{'id':_0x5447d4[_0x00d6('0x4c')]['id']}},_0x4fa6f5={};_0x4fa6f5['model']=_['keys'](db[_0x00d6('0x32')][_0x00d6('0x33')]);_0x4fa6f5[_0x00d6('0x39')]=_[_0x00d6('0x38')](_0x5447d4[_0x00d6('0x39')]);_0x4fa6f5[_0x00d6('0x3a')]=_[_0x00d6('0x3b')](_0x4fa6f5[_0x00d6('0x37')],_0x4fa6f5[_0x00d6('0x39')]);_0x16c82b[_0x00d6('0x3c')]=_[_0x00d6('0x3b')](_0x4fa6f5[_0x00d6('0x37')],qs[_0x00d6('0x4d')](_0x5447d4[_0x00d6('0x39')]['fields']));_0x16c82b[_0x00d6('0x3c')]=_0x16c82b[_0x00d6('0x3c')][_0x00d6('0x3d')]?_0x16c82b['attributes']:_0x4fa6f5[_0x00d6('0x37')];if(_0x5447d4['query'][_0x00d6('0x46')]){_0x16c82b[_0x00d6('0x47')]=[{'all':!![]}];}_0x16c82b=_[_0x00d6('0x43')]({},_0x16c82b,_0x5447d4[_0x00d6('0x45')]);return db[_0x00d6('0x32')]['find'](_0x16c82b)[_0x00d6('0x2b')](handleEntityNotFound(_0x2c1d7c,null))[_0x00d6('0x2b')](respondWithResult(_0x2c1d7c,null))[_0x00d6('0x4a')](handleError(_0x2c1d7c,null));};exports[_0x00d6('0x4e')]=function(_0x5058f0,_0x231e39){return db[_0x00d6('0x32')][_0x00d6('0x4e')](_0x5058f0[_0x00d6('0x4f')],{})[_0x00d6('0x2b')](function(_0x312684){var _0xd629cc=_0x5058f0['user'][_0x00d6('0x50')]({'plain':!![]});if(!_0xd629cc)throw new Error(_0x00d6('0x51'));if(_0xd629cc[_0x00d6('0x52')]===_0x00d6('0x53')){var _0x4fa957=_0x312684[_0x00d6('0x50')]({'plain':!![]});var _0xc07862=_0x00d6('0x54');return db[_0x00d6('0x55')]['find']({'where':{'name':_0xc07862,'userProfileId':_0xd629cc[_0x00d6('0x56')]},'raw':!![]})[_0x00d6('0x2b')](function(_0x1a4f4a){if(_0x1a4f4a&&_0x1a4f4a[_0x00d6('0x57')]===0x0){return db[_0x00d6('0x58')]['create']({'name':_0x4fa957[_0x00d6('0x2e')],'resourceId':_0x4fa957['id'],'type':_0x1a4f4a['name'],'sectionId':_0x1a4f4a['id']},{})['then'](function(){return _0x312684;});}else{return _0x312684;}})[_0x00d6('0x4a')](function(_0x31db1b){logger[_0x00d6('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31db1b);throw _0x31db1b;});}return _0x312684;})['then'](respondWithResult(_0x231e39,0xc9))[_0x00d6('0x4a')](handleError(_0x231e39,null));};exports[_0x00d6('0x2a')]=function(_0x5a99be,_0x2742cf){if(_0x5a99be[_0x00d6('0x4f')]['id']){delete _0x5a99be[_0x00d6('0x4f')]['id'];}return db[_0x00d6('0x32')][_0x00d6('0x59')]({'where':{'id':_0x5a99be[_0x00d6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2742cf,null))[_0x00d6('0x2b')](saveUpdates(_0x5a99be['body'],null))['then'](respondWithResult(_0x2742cf,null))[_0x00d6('0x4a')](handleError(_0x2742cf,null));};exports['destroy']=function(_0x35a901,_0x304acc){var _0x13bf49=_0x35a901['params']['id'];var _0x178be8=[];return db[_0x00d6('0x5a')][_0x00d6('0x5b')](function(_0x38913c){var _0x36b56c=_0x00d6('0x5c')+_0x13bf49;return db[_0x00d6('0x5a')][_0x00d6('0x39')](_0x36b56c,{'type':db[_0x00d6('0x5d')][_0x00d6('0x5e')][_0x00d6('0x5f')],'raw':!![],'transaction':_0x38913c})['then'](function(_0x439b44){_0x178be8=_[_0x00d6('0x31')](_0x439b44,function(_0x3dc110){return Number(_0x3dc110[_0x00d6('0x60')]);});})['then'](function(){var _0x3b6f3e='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13bf49;return db['sequelize'][_0x00d6('0x39')](_0x3b6f3e,{'type':db[_0x00d6('0x5d')]['QueryTypes'][_0x00d6('0x5f')],'raw':!![],'transaction':_0x38913c});})[_0x00d6('0x2b')](function(_0xe5247f){var _0x532098=_[_0x00d6('0x31')](_0xe5247f,function(_0x39c0ba){return Number(_0x39c0ba['VoiceQueueId']);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x178be8},'VoiceQueueId':{'$in':_0x532098}},'transaction':_0x38913c});})['then'](function(){var _0x2ce1ed='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13bf49;return db[_0x00d6('0x5a')]['query'](_0x2ce1ed,{'type':db[_0x00d6('0x5d')][_0x00d6('0x5e')][_0x00d6('0x5f')],'raw':!![],'transaction':_0x38913c});})[_0x00d6('0x2b')](function(_0x187a1b){var _0x4e6f6c=_['map'](_0x187a1b,function(_0x38a900){return Number(_0x38a900[_0x00d6('0x61')]);});return db[_0x00d6('0x62')][_0x00d6('0x63')]({'where':{'UserId':{'$in':_0x178be8},'MailQueueId':{'$in':_0x4e6f6c}},'transaction':_0x38913c});})[_0x00d6('0x2b')](function(){var _0x4df09c=_0x00d6('0x64')+_0x13bf49;return db[_0x00d6('0x5a')][_0x00d6('0x39')](_0x4df09c,{'type':db[_0x00d6('0x5d')]['QueryTypes'][_0x00d6('0x5f')],'raw':!![],'transaction':_0x38913c});})['then'](function(_0xf03fba){var _0x411041=_[_0x00d6('0x31')](_0xf03fba,function(_0x3dea84){return Number(_0x3dea84[_0x00d6('0x65')]);});return db['UserSmsQueue'][_0x00d6('0x63')]({'where':{'UserId':{'$in':_0x178be8},'SmsQueueId':{'$in':_0x411041}},'transaction':_0x38913c});})[_0x00d6('0x2b')](function(){var _0x51e4e7=_0x00d6('0x66')+_0x13bf49;return db[_0x00d6('0x5a')][_0x00d6('0x39')](_0x51e4e7,{'type':db[_0x00d6('0x5d')][_0x00d6('0x5e')]['SELECT'],'raw':!![],'transaction':_0x38913c});})[_0x00d6('0x2b')](function(_0x5a1597){var _0x1c5c1f=_[_0x00d6('0x31')](_0x5a1597,function(_0x2a60a5){return Number(_0x2a60a5[_0x00d6('0x67')]);});return db[_0x00d6('0x68')][_0x00d6('0x63')]({'where':{'UserId':{'$in':_0x178be8},'ChatQueueId':{'$in':_0x1c5c1f}},'transaction':_0x38913c});})[_0x00d6('0x2b')](function(){var _0x211155=_0x00d6('0x69')+_0x13bf49;return db['sequelize'][_0x00d6('0x39')](_0x211155,{'type':db[_0x00d6('0x5d')][_0x00d6('0x5e')]['SELECT'],'raw':!![],'transaction':_0x38913c});})[_0x00d6('0x2b')](function(_0x1d3f1e){var _0xc0ffa5=_[_0x00d6('0x31')](_0x1d3f1e,function(_0x26d514){return Number(_0x26d514[_0x00d6('0x6a')]);});return db[_0x00d6('0x6b')][_0x00d6('0x63')]({'where':{'UserId':{'$in':_0x178be8},'FaxQueueId':{'$in':_0xc0ffa5}},'transaction':_0x38913c});})['then'](function(){var _0x30deb5=_0x00d6('0x6c')+_0x13bf49;return db[_0x00d6('0x5a')][_0x00d6('0x39')](_0x30deb5,{'type':db[_0x00d6('0x5d')][_0x00d6('0x5e')]['SELECT'],'raw':!![],'transaction':_0x38913c});})[_0x00d6('0x2b')](function(_0x20f182){var _0xd33539=_[_0x00d6('0x31')](_0x20f182,function(_0x14cec5){return Number(_0x14cec5[_0x00d6('0x6d')]);});return db[_0x00d6('0x6e')][_0x00d6('0x63')]({'where':{'UserId':{'$in':_0x178be8},'OpenchannelQueueId':{'$in':_0xd33539}},'transaction':_0x38913c});})[_0x00d6('0x2b')](function(){var _0x38fc55=_0x00d6('0x6f')+_0x13bf49;return db['sequelize'][_0x00d6('0x39')](_0x38fc55,{'type':db[_0x00d6('0x5d')]['QueryTypes'][_0x00d6('0x5f')],'raw':!![],'transaction':_0x38913c});})[_0x00d6('0x2b')](function(_0x145e3c){var _0x469283=_[_0x00d6('0x31')](_0x145e3c,function(_0x2ea2ec){return Number(_0x2ea2ec[_0x00d6('0x70')]);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x178be8},'WhatsappQueueId':{'$in':_0x469283}},'transaction':_0x38913c});})[_0x00d6('0x2b')](function(){return db[_0x00d6('0x71')][_0x00d6('0x59')]({'where':{'TeamId':_0x13bf49}});})[_0x00d6('0x2b')](function(_0xfe56a){if(_0xfe56a===null){return;}return db[_0x00d6('0x72')][_0x00d6('0x63')]({'where':{'UserId':{'$in':_0x178be8},'VoicePrefixId':_0xfe56a[_0x00d6('0x73')]},'transaction':_0x38913c});})[_0x00d6('0x2b')](function(){return db['Team'][_0x00d6('0x63')]({'where':{'id':_0x13bf49},'cascade':!![],'transaction':_0x38913c});})[_0x00d6('0x2b')](function(_0x855eca){if(_0x855eca===0x0){_0x304acc[_0x00d6('0x1f')](0x194);}else{return db[_0x00d6('0x58')][_0x00d6('0x63')]({'where':{'type':'Teams','resourceId':_0x13bf49},'cascade':!![],'transaction':_0x38913c})[_0x00d6('0x2b')](function(){_0x304acc[_0x00d6('0x20')](0xcc)['end']();});}})[_0x00d6('0x4a')](function(_0x49b15e){_0x304acc['status'](0x1f4)['send'](_0x49b15e);});});};exports[_0x00d6('0x74')]=function(_0xa477df,_0x228e3c,_0x36a2a6){return db['Team'][_0x00d6('0x75')]({'where':{'id':_0xa477df[_0x00d6('0x4c')]['id']}})[_0x00d6('0x2b')](handleEntityNotFound(_0x228e3c,null))[_0x00d6('0x2b')](function(_0x329f72){if(!_0xa477df[_0x00d6('0x39')][_0x00d6('0x76')]||!utils[_0x00d6('0x77')](_0xa477df[_0x00d6('0x39')]['channel'])){throw new db[(_0x00d6('0x5d'))][(_0x00d6('0x78'))](_0x00d6('0x79'));}var _0x233ef0={};var _0x3790eb={};_0x3790eb[_0x00d6('0x37')]=_[_0x00d6('0x38')](db[_[_0x00d6('0x7a')](_0xa477df['query'][_0x00d6('0x76')][_0x00d6('0x7b')]())+_0x00d6('0x7c')][_0x00d6('0x33')]);_0x3790eb[_0x00d6('0x39')]=_['keys'](_0xa477df[_0x00d6('0x39')]);_0x3790eb[_0x00d6('0x3a')]=_[_0x00d6('0x3b')](_0x3790eb[_0x00d6('0x37')],_0x3790eb['query']);_0x233ef0[_0x00d6('0x3c')]=_['intersection'](_0x3790eb['model'],qs[_0x00d6('0x4d')](_0xa477df[_0x00d6('0x39')][_0x00d6('0x4d')]));_0x233ef0[_0x00d6('0x3c')]=_0x233ef0[_0x00d6('0x3c')]['length']?_0x233ef0['attributes']:_0x3790eb[_0x00d6('0x37')];_0x233ef0[_0x00d6('0x23')]=qs['limit'](_0xa477df['query']['limit']);_0x233ef0[_0x00d6('0x21')]=qs['offset'](_0xa477df[_0x00d6('0x39')][_0x00d6('0x21')]);_0x233ef0['order']=qs['sort'](_0xa477df[_0x00d6('0x39')]['sort']);_0x233ef0[_0x00d6('0x41')]=qs[_0x00d6('0x3a')](_[_0x00d6('0x7d')](_0xa477df['query'],_0x3790eb[_0x00d6('0x3a')]));_0x233ef0=_['merge']({},_0x233ef0,_0xa477df[_0x00d6('0x45')]);return _0x329f72['get'+_[_0x00d6('0x7a')](_0xa477df['query'][_0x00d6('0x76')][_0x00d6('0x7b')]())+_0x00d6('0x7e')](_0x233ef0);})[_0x00d6('0x2b')](respondWithResult(_0x228e3c,null))[_0x00d6('0x4a')](handleError(_0x228e3c,null));};exports[_0x00d6('0x7f')]=function(_0x2fd0e4,_0x1ca8b5,_0x5f1a53){return db[_0x00d6('0x32')][_0x00d6('0x75')]({'where':{'id':_0x2fd0e4[_0x00d6('0x4c')]['id']}})[_0x00d6('0x2b')](function(_0x19c725){if(_0x19c725){if(!_0x2fd0e4[_0x00d6('0x4f')][_0x00d6('0x76')]||!utils[_0x00d6('0x77')](_0x2fd0e4[_0x00d6('0x4f')][_0x00d6('0x76')])){throw new db[(_0x00d6('0x5d'))][(_0x00d6('0x78'))]('Unknown\x20channel');}return _0x19c725['add'+_[_0x00d6('0x7a')](_0x2fd0e4[_0x00d6('0x4f')][_0x00d6('0x76')]['toLowerCase']())+_0x00d6('0x7e')](_0x2fd0e4[_0x00d6('0x4f')][_0x00d6('0x80')]);}return null;})['then'](handleEntityNotFound(_0x1ca8b5,null))['then'](respondWithStatusCode(_0x1ca8b5,null))['catch'](handleError(_0x1ca8b5,null));};exports[_0x00d6('0x81')]=function(_0x278fbf,_0x32000c,_0x5c6b5c){return db[_0x00d6('0x32')][_0x00d6('0x75')]({'where':{'id':_0x278fbf[_0x00d6('0x4c')]['id']}})['then'](function(_0x4df545){if(_0x4df545){if(!_0x278fbf[_0x00d6('0x39')][_0x00d6('0x76')]||!utils[_0x00d6('0x77')](_0x278fbf[_0x00d6('0x39')][_0x00d6('0x76')])){throw new db[(_0x00d6('0x5d'))][(_0x00d6('0x78'))](_0x00d6('0x79'));}return _0x4df545[_0x00d6('0x82')+_[_0x00d6('0x7a')](_0x278fbf['query']['channel'][_0x00d6('0x7b')]())+_0x00d6('0x7e')](_0x278fbf['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x32000c,null))[_0x00d6('0x2b')](respondWithStatusCode(_0x32000c,null))[_0x00d6('0x4a')](handleError(_0x32000c,null));};exports[_0x00d6('0x83')]=function(_0x3ff7f5,_0x4cc169){var _0x874af6=_[_0x00d6('0x84')](_0x3ff7f5['body'][_0x00d6('0x80')])?_0x3ff7f5['body'][_0x00d6('0x80')]:[_0x3ff7f5['body'][_0x00d6('0x80')]];var _0xd10858=_0x3ff7f5[_0x00d6('0x4c')]['id'];return db[_0x00d6('0x32')]['find']({'where':{'id':_0xd10858}})[_0x00d6('0x2b')](handleEntityNotFound(_0x4cc169,null))[_0x00d6('0x2b')](function(_0x40506c){if(_0x40506c){var _0xf336c9=[_0x00d6('0x85'),_0x00d6('0x86'),_0x00d6('0x87'),_0x00d6('0x88'),_0x00d6('0x89'),_0x00d6('0x8a'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x36fdc8){var _0x59ebe9=_[_0x00d6('0x31')](_0xf336c9,function(_0x3df9a8){var _0x34a088={'attributes':['id','name']};if(_0x3df9a8===_0x00d6('0x85')){_0x34a088[_0x00d6('0x8b')]={'attributes':[_0x00d6('0x8c')]};}return _0x40506c[_0x00d6('0x50')+_0x3df9a8+'Queues'](_0x34a088)['then'](function(_0x5bdd88){var _0x10ab64=_[_0x00d6('0x31')](_0x5bdd88,function(_0x15e322){var _0x144a73=_[_0x00d6('0x31')](_0x874af6,function(_0x141127){var _0x1accf9={'where':{'UserId':_0x141127,[_0x3df9a8+_0x00d6('0x8d')]:_0x15e322['id']},'transaction':_0x36fdc8};if(_0x3df9a8===_0x00d6('0x85')){_0x1accf9[_0x00d6('0x1b')]={'penalty':_0x15e322[_0x00d6('0x8e')][_0x00d6('0x8c')]};}return db[_0x00d6('0x8f')+_0x3df9a8+_0x00d6('0x7c')][_0x00d6('0x90')](_0x1accf9)[_0x00d6('0x2b')](function(){socket[_0x00d6('0x91')](_0x00d6('0x53')+_0x3df9a8+_0x00d6('0x92'),{'UserId':_0x141127,[_0x3df9a8+'QueueId']:_0x15e322['id']});if(_0x3df9a8!==_0x00d6('0x85')){return;}return db['User'][_0x00d6('0x48')]({'where':{'id':_0x874af6,'online':0x1},'attributes':['id',_0x00d6('0x2e'),'online',_0x00d6('0x93'),_0x00d6('0x94')],'raw':!![]})[_0x00d6('0x2b')](function(_0x58c07c){var _0x3fb5c1=_['map'](_0x58c07c,function(_0x32078){return db[_0x00d6('0x95')][_0x00d6('0x96')]({'membername':_0x32078[_0x00d6('0x2e')],'UserId':_0x32078['id'],'queue_name':_0x15e322[_0x00d6('0x2e')],'VoiceQueueId':_0x15e322['id'],'interface':_[_0x00d6('0x97')](_0x32078['interface'])?util[_0x00d6('0x98')](_0x00d6('0x99'),_0x32078[_0x00d6('0x2e')]):_0x32078[_0x00d6('0x94')],'paused':_0x32078[_0x00d6('0x93')]||![],'penalty':_0x15e322['TeamVoiceQueue'][_0x00d6('0x8c')]},{'transaction':_0x36fdc8});});return Promise[_0x00d6('0x9a')](_0x3fb5c1);});});});return Promise[_0x00d6('0x9a')](_0x144a73);});return Promise[_0x00d6('0x9a')](_0x10ab64);})[_0x00d6('0x2b')](function(){return db[_0x00d6('0x71')]['findOne']({'where':{'teamId':_0xd10858}})[_0x00d6('0x2b')](function(_0x198d1e){if(_0x198d1e){var _0x5a712a=_[_0x00d6('0x31')](_0x874af6,function(_0x344760){db[_0x00d6('0x72')][_0x00d6('0x96')]({'UserId':_0x344760,'VoicePrefixId':_0x198d1e['VoicePrefixId']});});return Promise[_0x00d6('0x9a')](_0x5a712a);}});});});return Promise['all'](_0x59ebe9)[_0x00d6('0x2b')](function(){return _0x40506c[_0x00d6('0x83')](_0x874af6,{'transaction':_0x36fdc8})[_0x00d6('0x9b')](function(_0x10e4ec){return _0x10e4ec;});});});}})[_0x00d6('0x2b')](respondWithResult(_0x4cc169,null))[_0x00d6('0x4a')](handleError(_0x4cc169,null));};exports['removeAgents']=function(_0x553b30,_0x287368){var _0x564b30=_[_0x00d6('0x84')](_0x553b30[_0x00d6('0x39')][_0x00d6('0x80')])?_0x553b30['query']['ids']:[_0x553b30[_0x00d6('0x39')][_0x00d6('0x80')]];var _0x5df3aa=_0x553b30[_0x00d6('0x4c')]['id'];return db[_0x00d6('0x32')][_0x00d6('0x59')]({'where':{'id':_0x5df3aa}})[_0x00d6('0x2b')](handleEntityNotFound(_0x287368,null))[_0x00d6('0x2b')](function(_0x1c3876){if(_0x1c3876){var _0x246412=['Voice','Chat',_0x00d6('0x87'),_0x00d6('0x88'),_0x00d6('0x89'),'Openchannel',_0x00d6('0x9c')];return db[_0x00d6('0x5a')][_0x00d6('0x5b')](function(_0x5947a8){var _0x241f01=_[_0x00d6('0x31')](_0x246412,function(_0x189e7b){var _0x4b0256={'attributes':['id',_0x00d6('0x2e')]};return _0x1c3876['get'+_0x189e7b+_0x00d6('0x7e')](_0x4b0256)[_0x00d6('0x2b')](function(_0xb9a8f0){var _0x3f1052=_['map'](_0xb9a8f0,function(_0x2f587b){return _0x2f587b[_0x00d6('0x9d')](_0x564b30,{'transaction':_0x5947a8})[_0x00d6('0x2b')](function(){var _0x38366f=_[_0x00d6('0x31')](_0x564b30,function(_0x17e999){socket['emit'](_0x00d6('0x53')+_0x189e7b+'Queue:remove',{'UserId':Number(_0x17e999),[_0x189e7b+_0x00d6('0x8d')]:_0x2f587b['id']});if(_0x189e7b!==_0x00d6('0x85')){return;}return db['UserVoiceQueueRt'][_0x00d6('0x63')]({'where':{'VoiceQueueId':_0x2f587b['id'],'UserId':_0x17e999},'transaction':_0x5947a8});});return Promise['all'](_0x38366f);});});return Promise['all'](_0x3f1052);});});return Promise['all'](_0x241f01)['then'](function(){return _0x1c3876['removeAgents'](_0x564b30,{'transaction':_0x5947a8});})['then'](function(){return db['TeamVoicePrefix'][_0x00d6('0x75')]({'where':{'teamId':_0x5df3aa}})[_0x00d6('0x2b')](function(_0x21e8a2){if(_0x21e8a2){var _0x4fef6f=_[_0x00d6('0x31')](_0x564b30,function(_0x43c5fb){db[_0x00d6('0x72')]['destroy']({'where':{'UserId':_0x43c5fb,'VoicePrefixId':_0x21e8a2['VoicePrefixId']}});});return Promise[_0x00d6('0x9a')](_0x4fef6f);}});});});}})[_0x00d6('0x2b')](respondWithStatusCode(_0x287368,null))[_0x00d6('0x4a')](handleError(_0x287368,null));};exports[_0x00d6('0x9e')]=function(_0x2617a7,_0x4d7b51,_0x2280b0){var _0x1c6c9f={};var _0x2bc75a={};var _0x50d274;var _0x1a2023;return db[_0x00d6('0x32')][_0x00d6('0x75')]({'where':{'id':_0x2617a7[_0x00d6('0x4c')]['id']}})[_0x00d6('0x2b')](handleEntityNotFound(_0x4d7b51,null))[_0x00d6('0x2b')](function(_0x327226){if(_0x327226){_0x50d274=_0x327226;_0x2bc75a[_0x00d6('0x37')]=_['keys'](db[_0x00d6('0x8f')][_0x00d6('0x33')]);_0x2bc75a[_0x00d6('0x39')]=_[_0x00d6('0x38')](_0x2617a7['query']);_0x2bc75a[_0x00d6('0x3a')]=_[_0x00d6('0x3b')](_0x2bc75a[_0x00d6('0x37')],_0x2bc75a[_0x00d6('0x39')]);_0x1c6c9f['attributes']=_[_0x00d6('0x3b')](_0x2bc75a[_0x00d6('0x37')],qs['fields'](_0x2617a7['query']['fields']));_0x1c6c9f['attributes']=_0x1c6c9f[_0x00d6('0x3c')][_0x00d6('0x3d')]?_0x1c6c9f[_0x00d6('0x3c')]:_0x2bc75a['model'];_0x1c6c9f[_0x00d6('0x3f')]=qs[_0x00d6('0x40')](_0x2617a7[_0x00d6('0x39')][_0x00d6('0x40')]);_0x1c6c9f[_0x00d6('0x41')]=qs[_0x00d6('0x3a')](_[_0x00d6('0x7d')](_0x2617a7[_0x00d6('0x39')],_0x2bc75a['filters']));if(_0x2617a7[_0x00d6('0x39')][_0x00d6('0x42')]){_0x1c6c9f[_0x00d6('0x41')]=_[_0x00d6('0x43')](_0x1c6c9f['where'],{'$or':_[_0x00d6('0x31')](_0x1c6c9f[_0x00d6('0x3c')],function(_0x23c1b3){var _0x47c280={};_0x47c280[_0x23c1b3]={'$like':'%'+_0x2617a7[_0x00d6('0x39')][_0x00d6('0x42')]+'%'};return _0x47c280;})});}_0x1c6c9f=_[_0x00d6('0x43')]({},_0x1c6c9f,_0x2617a7['options']);return _0x50d274['getAgents'](_0x1c6c9f);}})[_0x00d6('0x2b')](function(_0x4acc75){if(_0x4acc75){_0x1a2023=_0x4acc75[_0x00d6('0x3d')];if(!_0x2617a7[_0x00d6('0x39')][_0x00d6('0x9f')](_0x00d6('0x3e'))){_0x1c6c9f[_0x00d6('0x23')]=qs[_0x00d6('0x23')](_0x2617a7['query'][_0x00d6('0x23')]);_0x1c6c9f[_0x00d6('0x21')]=qs[_0x00d6('0x21')](_0x2617a7[_0x00d6('0x39')][_0x00d6('0x21')]);}return _0x50d274[_0x00d6('0x9e')](_0x1c6c9f);}})[_0x00d6('0x2b')](function(_0x14bd1a){if(_0x14bd1a){return _0x14bd1a?{'count':_0x1a2023,'rows':_0x14bd1a}:null;}})[_0x00d6('0x2b')](respondWithResult(_0x4d7b51,null))[_0x00d6('0x4a')](handleError(_0x4d7b51,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index ddc1751..b9bb59a 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 _0x8220=['events','../../mysqldb','Team','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x29d2d2,_0x3344){var _0x3f6476=function(_0x29c2a2){while(--_0x29c2a2){_0x29d2d2['push'](_0x29d2d2['shift']());}};_0x3f6476(++_0x3344);}(_0x8220,0x120));var _0x0822=function(_0xd4d4aa,_0x5db1f0){_0xd4d4aa=_0xd4d4aa-0x0;var _0x3f2237=_0x8220[_0xd4d4aa];return _0x3f2237;};'use strict';var EventEmitter=require(_0x0822('0x0'));var Team=require(_0x0822('0x1'))['db'][_0x0822('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0822('0x3'),'afterUpdate':'update','afterDestroy':_0x0822('0x4')};function emitEvent(_0x4fd015){return function(_0x1bf0d5,_0x445bc9,_0x27f2f8){TeamEvents[_0x0822('0x5')](_0x4fd015+':'+_0x1bf0d5['id'],_0x1bf0d5);TeamEvents[_0x0822('0x5')](_0x4fd015,_0x1bf0d5);_0x27f2f8(null);};}for(var e in events){if(events[_0x0822('0x6')](e)){var event=events[e];Team[_0x0822('0x7')](e,emitEvent(event));}}module[_0x0822('0x8')]=TeamEvents; \ No newline at end of file +var _0x6086=['Team','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x567aa6,_0x1e6c4a){var _0x44a325=function(_0x30ff4e){while(--_0x30ff4e){_0x567aa6['push'](_0x567aa6['shift']());}};_0x44a325(++_0x1e6c4a);}(_0x6086,0x69));var _0x6608=function(_0x28625b,_0x3e6da1){_0x28625b=_0x28625b-0x0;var _0x2bbfba=_0x6086[_0x28625b];return _0x2bbfba;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x6608('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0x6608('0x1')](0x0);var events={'afterCreate':_0x6608('0x2'),'afterUpdate':'update','afterDestroy':_0x6608('0x3')};function emitEvent(_0x17bac6){return function(_0x25028d,_0x214ca1,_0x172f36){TeamEvents[_0x6608('0x4')](_0x17bac6+':'+_0x25028d['id'],_0x25028d);TeamEvents[_0x6608('0x4')](_0x17bac6,_0x25028d);_0x172f36(null);};}for(var e in events){if(events[_0x6608('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x6608('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 9e85b31..5bbee5d 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 _0x5e6d=['then','channel','catch','exports','define','Team','Chat','Fax','Openchannel','Sms','Whatsapp','resolve','map','lodash','./team.attributes','get','Queues'];(function(_0x4c1928,_0x521def){var _0x31d660=function(_0x4d1ce3){while(--_0x4d1ce3){_0x4c1928['push'](_0x4c1928['shift']());}};_0x31d660(++_0x521def);}(_0x5e6d,0xc8));var _0xd5e6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5e6d[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xd5e6('0x0'));var attributes=require(_0xd5e6('0x1'));function getQueuesByChannel(_0x59cf05,_0x4fd549){var _0x192c45=_0xd5e6('0x2')+_0x4fd549+_0xd5e6('0x3');return _0x59cf05[_0x192c45]()[_0xd5e6('0x4')](function(_0x44db65){return _['map'](_0x44db65,function(_0xf26b7b){_0xf26b7b['setDataValue'](_0xd5e6('0x5'),_0x4fd549);return _0xf26b7b;});})[_0xd5e6('0x6')](function(_0x60319f){throw _0x60319f;});}module[_0xd5e6('0x7')]=function(_0x4a0be2){return _0x4a0be2[_0xd5e6('0x8')](_0xd5e6('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4d0eaa=this;var _0x15923c=[_0xd5e6('0xa'),_0xd5e6('0xb'),'Mail',_0xd5e6('0xc'),_0xd5e6('0xd'),'Voice',_0xd5e6('0xe')];return Promise[_0xd5e6('0xf')]()[_0xd5e6('0x4')](function(){var _0x5a7f4d=_[_0xd5e6('0x10')](_0x15923c,function(_0x151290){return getQueuesByChannel(_0x4d0eaa,_0x151290);});return Promise['all'](_0x5a7f4d);})[_0xd5e6('0x6')](function(_0x504020){throw _0x504020;});}}});}; \ No newline at end of file +var _0xffb8=['get','Queues','then','map','setDataValue','channel','define','teams','Fax','Mail','Openchannel','Sms','Voice','resolve','./team.attributes'];(function(_0x469d22,_0x1e635b){var _0x391cb9=function(_0x370af0){while(--_0x370af0){_0x469d22['push'](_0x469d22['shift']());}};_0x391cb9(++_0x1e635b);}(_0xffb8,0x1df));var _0x8ffb=function(_0x5df963,_0x52ae36){_0x5df963=_0x5df963-0x0;var _0x190ea1=_0xffb8[_0x5df963];return _0x190ea1;};'use strict';var _=require('lodash');var attributes=require(_0x8ffb('0x0'));function getQueuesByChannel(_0x24fb43,_0x25ffc9){var _0x2d9a97=_0x8ffb('0x1')+_0x25ffc9+_0x8ffb('0x2');return _0x24fb43[_0x2d9a97]()[_0x8ffb('0x3')](function(_0x161dbb){return _[_0x8ffb('0x4')](_0x161dbb,function(_0x14ec8c){_0x14ec8c[_0x8ffb('0x5')](_0x8ffb('0x6'),_0x25ffc9);return _0x14ec8c;});})['catch'](function(_0x172971){throw _0x172971;});}module['exports']=function(_0x1a932d){return _0x1a932d[_0x8ffb('0x7')]('Team',attributes,{'tableName':_0x8ffb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x36b907=this;var _0x209b7d=['Chat',_0x8ffb('0x9'),_0x8ffb('0xa'),_0x8ffb('0xb'),_0x8ffb('0xc'),_0x8ffb('0xd'),'Whatsapp'];return Promise[_0x8ffb('0xe')]()['then'](function(){var _0x327f39=_[_0x8ffb('0x4')](_0x209b7d,function(_0x3e792c){return getQueuesByChannel(_0x36b907,_0x3e792c);});return Promise['all'](_0x327f39);})['catch'](function(_0x5431ce){throw _0x5431ce;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9eeab45..c898a33 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 _0xf3b2=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x2aeff4,_0x3686a8){var _0x25d78=function(_0x15a242){while(--_0x15a242){_0x2aeff4['push'](_0x2aeff4['shift']());}};_0x25d78(++_0x3686a8);}(_0xf3b2,0x1d2));var _0x2f3b=function(_0x56e063,_0x453233){_0x56e063=_0x56e063-0x0;var _0x766fcf=_0xf3b2[_0x56e063];return _0x766fcf;};'use strict';var _=require('lodash');var util=require(_0x2f3b('0x0'));var moment=require(_0x2f3b('0x1'));var BPromise=require(_0x2f3b('0x2'));var rs=require(_0x2f3b('0x3'));var fs=require('fs');var Redis=require(_0x2f3b('0x4'));var db=require(_0x2f3b('0x5'))['db'];var utils=require(_0x2f3b('0x6'));var logger=require(_0x2f3b('0x7'))(_0x2f3b('0x8'));var config=require(_0x2f3b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f3b('0xa')][_0x2f3b('0xb')]({'port':0x232a});config['redis']=_[_0x2f3b('0xc')](config[_0x2f3b('0xd')],{'host':_0x2f3b('0xe'),'port':0x18eb});var socket=require(_0x2f3b('0xf'))(new Redis(config[_0x2f3b('0xd')]));require(_0x2f3b('0x10'))[_0x2f3b('0x11')](socket);function respondWithRpcPromise(_0x19bc86,_0x414286,_0xab09b){return new BPromise(function(_0x39dfca,_0x34ce83){return client[_0x2f3b('0x12')](_0x19bc86,_0xab09b)[_0x2f3b('0x13')](function(_0x367982){logger['info'](_0x2f3b('0x14'),_0x414286,_0x2f3b('0x15'));logger[_0x2f3b('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x414286,_0x2f3b('0x15'),JSON['stringify'](_0x367982));if(_0x367982['error']){if(_0x367982[_0x2f3b('0x17')][_0x2f3b('0x18')]===0x1f4){logger['error'](_0x2f3b('0x14'),_0x414286,_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);return _0x34ce83(_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);}logger['error'](_0x2f3b('0x14'),_0x414286,_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);return _0x39dfca(_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);}else{logger[_0x2f3b('0x1a')]('Team,\x20%s,\x20%s',_0x414286,'request\x20sent');_0x39dfca(_0x367982[_0x2f3b('0x1b')][_0x2f3b('0x19')]);}})[_0x2f3b('0x1c')](function(_0x5ee823){logger[_0x2f3b('0x17')](_0x2f3b('0x14'),_0x414286,_0x5ee823);_0x34ce83(_0x5ee823);});});} \ No newline at end of file +var _0xf2c6=['rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3cdfb9,_0x4587cd){var _0x395f81=function(_0x4bd55e){while(--_0x4bd55e){_0x3cdfb9['push'](_0x3cdfb9['shift']());}};_0x395f81(++_0x4587cd);}(_0xf2c6,0x1e6));var _0x6f2c=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xf2c6[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f2c('0x0'));var BPromise=require(_0x6f2c('0x1'));var rs=require(_0x6f2c('0x2'));var fs=require('fs');var Redis=require(_0x6f2c('0x3'));var db=require(_0x6f2c('0x4'))['db'];var utils=require(_0x6f2c('0x5'));var logger=require(_0x6f2c('0x6'))(_0x6f2c('0x7'));var config=require(_0x6f2c('0x8'));var jayson=require(_0x6f2c('0x9'));var client=jayson['client'][_0x6f2c('0xa')]({'port':0x232a});config['redis']=_[_0x6f2c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6f2c('0xc'))(new Redis(config[_0x6f2c('0xd')]));require(_0x6f2c('0xe'))[_0x6f2c('0xf')](socket);function respondWithRpcPromise(_0x4d943e,_0x54ad36,_0x6b5092){return new BPromise(function(_0x15e2cf,_0x31a281){return client[_0x6f2c('0x10')](_0x4d943e,_0x6b5092)[_0x6f2c('0x11')](function(_0x203a51){logger[_0x6f2c('0x12')](_0x6f2c('0x13'),_0x54ad36,'request\x20sent');logger[_0x6f2c('0x14')](_0x6f2c('0x15'),_0x54ad36,_0x6f2c('0x16'),JSON[_0x6f2c('0x17')](_0x203a51));if(_0x203a51['error']){if(_0x203a51[_0x6f2c('0x18')][_0x6f2c('0x19')]===0x1f4){logger[_0x6f2c('0x18')](_0x6f2c('0x13'),_0x54ad36,_0x203a51[_0x6f2c('0x18')][_0x6f2c('0x1a')]);return _0x31a281(_0x203a51[_0x6f2c('0x18')]['message']);}logger['error']('Team,\x20%s,\x20%s',_0x54ad36,_0x203a51['error'][_0x6f2c('0x1a')]);return _0x15e2cf(_0x203a51[_0x6f2c('0x18')][_0x6f2c('0x1a')]);}else{logger[_0x6f2c('0x12')](_0x6f2c('0x13'),_0x54ad36,_0x6f2c('0x16'));_0x15e2cf(_0x203a51[_0x6f2c('0x1b')][_0x6f2c('0x1a')]);}})[_0x6f2c('0x1c')](function(_0x52f234){logger[_0x6f2c('0x18')](_0x6f2c('0x13'),_0x54ad36,_0x52f234);_0x31a281(_0x52f234);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2422284..bd8c2bf 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 _0x282b=['emit','removeListener','register','team:','./team.events','save','remove','update'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x282b,0xec));var _0xb282=function(_0x46c60f,_0x56f5f0){_0x46c60f=_0x46c60f-0x0;var _0x35d447=_0x282b[_0x46c60f];return _0x35d447;};'use strict';var TeamEvents=require(_0xb282('0x0'));var events=[_0xb282('0x1'),_0xb282('0x2'),_0xb282('0x3')];function createListener(_0x527989,_0x55ae9d){return function(_0x5d78d5){_0x55ae9d[_0xb282('0x4')](_0x527989,_0x5d78d5);};}function removeListener(_0x5cadd7,_0x3fbbaf){return function(){TeamEvents[_0xb282('0x5')](_0x5cadd7,_0x3fbbaf);};}exports[_0xb282('0x6')]=function(_0x1dd19b){for(var _0x3cad41=0x0,_0x33635f=events['length'];_0x3cad41<_0x33635f;_0x3cad41++){var _0x4a0d28=events[_0x3cad41];var _0x17fba1=createListener(_0xb282('0x7')+_0x4a0d28,_0x1dd19b);TeamEvents['on'](_0x4a0d28,_0x17fba1);}}; \ No newline at end of file +var _0xc12e=['update','emit','removeListener','register','./team.events','save','remove'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0xc12e,0x13f));var _0xec12=function(_0xafc54d,_0x4193c4){_0xafc54d=_0xafc54d-0x0;var _0x3a6347=_0xc12e[_0xafc54d];return _0x3a6347;};'use strict';var TeamEvents=require(_0xec12('0x0'));var events=[_0xec12('0x1'),_0xec12('0x2'),_0xec12('0x3')];function createListener(_0x563bd4,_0x266821){return function(_0x1a54c4){_0x266821[_0xec12('0x4')](_0x563bd4,_0x1a54c4);};}function removeListener(_0x197b01,_0x22a2d2){return function(){TeamEvents[_0xec12('0x5')](_0x197b01,_0x22a2d2);};}exports[_0xec12('0x6')]=function(_0x2602f1){for(var _0x4909f8=0x0,_0x480b4c=events['length'];_0x4909f8<_0x480b4c;_0x4909f8++){var _0x29a73e=events[_0x4909f8];var _0x4b88aa=createListener('team:'+_0x29a73e,_0x2602f1);TeamEvents['on'](_0x29a73e,_0x4b88aa);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 22acf5f..d6f7512 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 _0x8db0=['exports','INTEGER','sequelize'];(function(_0x40762c,_0x5ec18f){var _0x39fcd2=function(_0x8d40cc){while(--_0x8d40cc){_0x40762c['push'](_0x40762c['shift']());}};_0x39fcd2(++_0x5ec18f);}(_0x8db0,0x65));var _0x08db=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x8db0[_0x42bc91];return _0x3f5507;};'use strict';var Sequelize=require(_0x08db('0x0'));module[_0x08db('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x08db('0x2')]}}; \ No newline at end of file +var _0x3b59=['sequelize','exports','INTEGER'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3b59,0x9c));var _0x93b5=function(_0x4cba86,_0x51a278){_0x4cba86=_0x4cba86-0x0;var _0x268f75=_0x3b59[_0x4cba86];return _0x268f75;};'use strict';var Sequelize=require(_0x93b5('0x0'));module[_0x93b5('0x1')]={'TeamId':{'type':Sequelize[_0x93b5('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x93b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 624cf38..eb05c6d 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 _0x74f4=['../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','moment','request-promise','rimraf'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x74f4,0xaa));var _0x474f=function(_0x418fa3,_0x464468){_0x418fa3=_0x418fa3-0x0;var _0x845083=_0x74f4[_0x418fa3];return _0x845083;};'use strict';var _=require(_0x474f('0x0'));var util=require(_0x474f('0x1'));var logger=require('../../config/logger')(_0x474f('0x2'));var moment=require(_0x474f('0x3'));var BPromise=require('bluebird');var rp=require(_0x474f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x474f('0x5'));var config=require(_0x474f('0x6'));var attributes=require(_0x474f('0x7'));module['exports']=function(_0x5b6d20,_0x119d22){return _0x5b6d20[_0x474f('0x8')](_0x474f('0x9'),attributes,{'tableName':_0x474f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ae2=['define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x12cd3e,_0x40a28b){_0x12cd3e=_0x12cd3e-0x0;var _0x3bd8f8=_0x6ae2[_0x12cd3e];return _0x3bd8f8;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var logger=require(_0x26ae('0x2'))(_0x26ae('0x3'));var moment=require(_0x26ae('0x4'));var BPromise=require(_0x26ae('0x5'));var rp=require(_0x26ae('0x6'));var fs=require('fs');var path=require(_0x26ae('0x7'));var rimraf=require(_0x26ae('0x8'));var config=require('../../config/environment');var attributes=require(_0x26ae('0x9'));module[_0x26ae('0xa')]=function(_0x595da8,_0x5609b0){return _0x595da8[_0x26ae('0xb')](_0x26ae('0xc'),attributes,{'tableName':_0x26ae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 63db237..bff78c5 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x51e153,_0x9b2da6){var _0x31c711=function(_0x42cc48){while(--_0x42cc48){_0x51e153['push'](_0x51e153['shift']());}};_0x31c711(++_0x9b2da6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x10d2cd,_0x48316f){var _0x59594f=function(_0xa9764){while(--_0xa9764){_0x10d2cd['push'](_0x10d2cd['shift']());}};_0x59594f(++_0x48316f);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 033e978..64193ff 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 _0x48db=['INTEGER','sequelize','exports'];(function(_0x379e2c,_0x26bcc3){var _0x3ded97=function(_0x38180c){while(--_0x38180c){_0x379e2c['push'](_0x379e2c['shift']());}};_0x3ded97(++_0x26bcc3);}(_0x48db,0x16c));var _0xb48d=function(_0x38ac8d,_0x49ef60){_0x38ac8d=_0x38ac8d-0x0;var _0x28169d=_0x48db[_0x38ac8d];return _0x28169d;};'use strict';var Sequelize=require(_0xb48d('0x0'));module[_0xb48d('0x1')]={'penalty':{'type':Sequelize[_0xb48d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2b92=['exports','sequelize'];(function(_0x27f4b2,_0x3d742f){var _0x25c57e=function(_0x233d19){while(--_0x233d19){_0x27f4b2['push'](_0x27f4b2['shift']());}};_0x25c57e(++_0x3d742f);}(_0x2b92,0x9b));var _0x22b9=function(_0x1755be,_0x2efafc){_0x1755be=_0x1755be-0x0;var _0x5417f7=_0x2b92[_0x1755be];return _0x5417f7;};'use strict';var Sequelize=require(_0x22b9('0x0'));module[_0x22b9('0x1')]={'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 62a9b14..e5d3e43 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 _0x33a4=['util','api','moment','bluebird','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0x13b76d,_0x352902){var _0x3f6ecf=function(_0x55cbfa){while(--_0x55cbfa){_0x13b76d['push'](_0x13b76d['shift']());}};_0x3f6ecf(++_0x352902);}(_0x33a4,0x88));var _0x433a=function(_0x198ff1,_0x543034){_0x198ff1=_0x198ff1-0x0;var _0x43747a=_0x33a4[_0x198ff1];return _0x43747a;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var logger=require('../../config/logger')(_0x433a('0x1'));var moment=require(_0x433a('0x2'));var BPromise=require(_0x433a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x433a('0x4'));var attributes=require(_0x433a('0x5'));module[_0x433a('0x6')]=function(_0x60b6b3,_0x1b6f5a){return _0x60b6b3['define'](_0x433a('0x7'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2cb=['util','api','bluebird','path','rimraf','exports','define','team_has_voice_queues'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xf2cb,0x130));var _0xbf2c=function(_0xda5c73,_0x4f1acf){_0xda5c73=_0xda5c73-0x0;var _0x8580d6=_0xf2cb[_0xda5c73];return _0x8580d6;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var logger=require('../../config/logger')(_0xbf2c('0x1'));var moment=require('moment');var BPromise=require(_0xbf2c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf2c('0x3'));var rimraf=require(_0xbf2c('0x4'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0xbf2c('0x5')]=function(_0x46d282,_0x1fc371){return _0x46d282[_0xbf2c('0x6')]('TeamVoiceQueue',attributes,{'tableName':_0xbf2c('0x7'),'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 f72ca91..4d136d8 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 _0xb1fc=['../../config/environment','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xb1fc,0x78));var _0xcb1f=function(_0x5b2bbd,_0x9d5a11){_0x5b2bbd=_0x5b2bbd-0x0;var _0x2b2c67=_0xb1fc[_0x5b2bbd];return _0x2b2c67;};'use strict';var _=require(_0xcb1f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb1f('0x1'));var fs=require('fs');var Redis=require(_0xcb1f('0x2'));var db=require(_0xcb1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb1f('0x4'))(_0xcb1f('0x5'));var config=require(_0xcb1f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb1f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c386c,_0x544bce,_0x2e489d){return new BPromise(function(_0x58a748,_0x225cb7){return client[_0xcb1f('0x8')](_0x2c386c,_0x2e489d)['then'](function(_0x3cc88a){logger[_0xcb1f('0x9')](_0xcb1f('0xa'),_0x544bce,'request\x20sent');logger['debug'](_0xcb1f('0xb'),_0x544bce,'request\x20sent',JSON[_0xcb1f('0xc')](_0x3cc88a));if(_0x3cc88a[_0xcb1f('0xd')]){if(_0x3cc88a[_0xcb1f('0xd')]['code']===0x1f4){logger[_0xcb1f('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x544bce,_0x3cc88a[_0xcb1f('0xd')][_0xcb1f('0xe')]);return _0x225cb7(_0x3cc88a['error'][_0xcb1f('0xe')]);}logger[_0xcb1f('0xd')](_0xcb1f('0xa'),_0x544bce,_0x3cc88a[_0xcb1f('0xd')][_0xcb1f('0xe')]);return _0x58a748(_0x3cc88a[_0xcb1f('0xd')][_0xcb1f('0xe')]);}else{logger[_0xcb1f('0x9')](_0xcb1f('0xa'),_0x544bce,_0xcb1f('0xf'));_0x58a748(_0x3cc88a[_0xcb1f('0x10')]['message']);}})[_0xcb1f('0x11')](function(_0x16dfdd){logger[_0xcb1f('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x544bce,_0x16dfdd);_0x225cb7(_0x16dfdd);});});} \ No newline at end of file +var _0x4be8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0x4be8,0x17f));var _0x84be=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4be8[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x84be('0x0'));var util=require(_0x84be('0x1'));var moment=require(_0x84be('0x2'));var BPromise=require(_0x84be('0x3'));var rs=require(_0x84be('0x4'));var fs=require('fs');var Redis=require(_0x84be('0x5'));var db=require(_0x84be('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84be('0x7'));var config=require(_0x84be('0x8'));var jayson=require(_0x84be('0x9'));var client=jayson[_0x84be('0xa')][_0x84be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13629a,_0x47fcfd,_0x17f6d3){return new BPromise(function(_0x3c55ea,_0x5e0a70){return client[_0x84be('0xc')](_0x13629a,_0x17f6d3)[_0x84be('0xd')](function(_0x4c7615){logger[_0x84be('0xe')](_0x84be('0xf'),_0x47fcfd,_0x84be('0x10'));logger[_0x84be('0x11')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x47fcfd,_0x84be('0x10'),JSON[_0x84be('0x12')](_0x4c7615));if(_0x4c7615[_0x84be('0x13')]){if(_0x4c7615['error'][_0x84be('0x14')]===0x1f4){logger['error'](_0x84be('0xf'),_0x47fcfd,_0x4c7615[_0x84be('0x13')][_0x84be('0x15')]);return _0x5e0a70(_0x4c7615[_0x84be('0x13')]['message']);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x47fcfd,_0x4c7615[_0x84be('0x13')][_0x84be('0x15')]);return _0x3c55ea(_0x4c7615[_0x84be('0x13')][_0x84be('0x15')]);}else{logger['info'](_0x84be('0xf'),_0x47fcfd,_0x84be('0x10'));_0x3c55ea(_0x4c7615[_0x84be('0x16')][_0x84be('0x15')]);}})[_0x84be('0x17')](function(_0x3ef933){logger[_0x84be('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x47fcfd,_0x3ef933);_0x5e0a70(_0x3ef933);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 2dde573..18496b0 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 _0x7cdc=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','destroy','exports'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x7cdc,0x190));var _0xc7cd=function(_0x3b704d,_0x1ce7f9){_0x3b704d=_0x3b704d-0x0;var _0x4a02ac=_0x7cdc[_0x3b704d];return _0x4a02ac;};'use strict';var multer=require('multer');var util=require(_0xc7cd('0x0'));var path=require(_0xc7cd('0x1'));var timeout=require('connect-timeout');var express=require(_0xc7cd('0x2'));var router=express[_0xc7cd('0x3')]();var fs_extra=require(_0xc7cd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc7cd('0x5'));var config=require(_0xc7cd('0x6'));var controller=require('./template.controller');router[_0xc7cd('0x7')]('/',auth[_0xc7cd('0x8')](),controller[_0xc7cd('0x9')]);router[_0xc7cd('0x7')](_0xc7cd('0xa'),auth[_0xc7cd('0x8')](),controller[_0xc7cd('0xb')]);router['post']('/',auth[_0xc7cd('0x8')](),controller['create']);router[_0xc7cd('0xc')](_0xc7cd('0xa'),auth[_0xc7cd('0x8')](),controller[_0xc7cd('0xd')]);router['delete'](_0xc7cd('0xa'),auth[_0xc7cd('0x8')](),controller[_0xc7cd('0xe')]);module[_0xc7cd('0xf')]=router; \ No newline at end of file +var _0xd232=['express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout'];(function(_0x35e6e4,_0x17e014){var _0x15a011=function(_0x74fee5){while(--_0x74fee5){_0x35e6e4['push'](_0x35e6e4['shift']());}};_0x15a011(++_0x17e014);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2d23('0x0'));var util=require('util');var path=require(_0x2d23('0x1'));var timeout=require(_0x2d23('0x2'));var express=require(_0x2d23('0x3'));var router=express[_0x2d23('0x4')]();var fs_extra=require(_0x2d23('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2d23('0x6'));var controller=require('./template.controller');router['get']('/',auth[_0x2d23('0x7')](),controller[_0x2d23('0x8')]);router[_0x2d23('0x9')]('/:id',auth[_0x2d23('0x7')](),controller['show']);router[_0x2d23('0xa')]('/',auth[_0x2d23('0x7')](),controller[_0x2d23('0xb')]);router[_0x2d23('0xc')](_0x2d23('0xd'),auth[_0x2d23('0x7')](),controller[_0x2d23('0xe')]);router['delete'](_0x2d23('0xd'),auth[_0x2d23('0x7')](),controller[_0x2d23('0xf')]);module[_0x2d23('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 29081cb..5221563 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 _0xf63e=['STRING','TEXT'];(function(_0x1330eb,_0x476ed1){var _0x15ebc2=function(_0x40b54f){while(--_0x40b54f){_0x1330eb['push'](_0x1330eb['shift']());}};_0x15ebc2(++_0x476ed1);}(_0xf63e,0x78));var _0xef63=function(_0x25b01d,_0x3b7cea){_0x25b01d=_0x25b01d-0x0;var _0x10e87a=_0xf63e[_0x25b01d];return _0x10e87a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xef63('0x0')]},'description':{'type':Sequelize[_0xef63('0x0')]},'html':{'type':Sequelize[_0xef63('0x1')]}}; \ No newline at end of file +var _0xa6c5=['exports','STRING','TEXT'];(function(_0x9d0f60,_0x3ef559){var _0xdef99d=function(_0x428ed3){while(--_0x428ed3){_0x9d0f60['push'](_0x9d0f60['shift']());}};_0xdef99d(++_0x3ef559);}(_0xa6c5,0x1b3));var _0x5a6c=function(_0x459555,_0x8a9743){_0x459555=_0x459555-0x0;var _0x2b10db=_0xa6c5[_0x459555];return _0x2b10db;};'use strict';var Sequelize=require('sequelize');module[_0x5a6c('0x0')]={'name':{'type':Sequelize[_0x5a6c('0x1')]},'description':{'type':Sequelize[_0x5a6c('0x1')]},'html':{'type':Sequelize[_0x5a6c('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b12dbe3..054930d 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 _0xe88f=['update','destroy','then','Templates','UserProfileResource','end','name','index','map','Template','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','include','findAll','rows','show','params','keys','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save'];(function(_0x261798,_0x199810){var _0x2604d8=function(_0x1ee9fa){while(--_0x1ee9fa){_0x261798['push'](_0x261798['shift']());}};_0x2604d8(++_0x199810);}(_0xe88f,0x17a));var _0xfe88=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0xe88f[_0x329664];return _0x4e346e;};'use strict';var emlformat=require(_0xfe88('0x0'));var rimraf=require(_0xfe88('0x1'));var zipdir=require(_0xfe88('0x2'));var jsonpatch=require(_0xfe88('0x3'));var rp=require(_0xfe88('0x4'));var moment=require(_0xfe88('0x5'));var BPromise=require(_0xfe88('0x6'));var Mustache=require(_0xfe88('0x7'));var util=require(_0xfe88('0x8'));var path=require(_0xfe88('0x9'));var sox=require('sox');var csv=require(_0xfe88('0xa'));var ejs=require(_0xfe88('0xb'));var fs=require('fs');var fs_extra=require(_0xfe88('0xc'));var _=require(_0xfe88('0xd'));var squel=require(_0xfe88('0xe'));var crypto=require(_0xfe88('0xf'));var jsforce=require(_0xfe88('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfe88('0xa'));var querystring=require('querystring');var Papa=require(_0xfe88('0x11'));var Redis=require(_0xfe88('0x12'));var authService=require(_0xfe88('0x13'));var qs=require(_0xfe88('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe88('0x15'));var logger=require('../../config/logger')(_0xfe88('0x16'));var utils=require(_0xfe88('0x17'));var config=require(_0xfe88('0x18'));var licenseUtil=require(_0xfe88('0x19'));var db=require(_0xfe88('0x1a'))['db'];function respondWithStatusCode(_0x5b44fa,_0x5d7f8d){_0x5d7f8d=_0x5d7f8d||0xcc;return function(_0x56ee7b){if(_0x56ee7b){return _0x5b44fa[_0xfe88('0x1b')](_0x5d7f8d);}return _0x5b44fa[_0xfe88('0x1c')](_0x5d7f8d)['end']();};}function respondWithResult(_0x43dfb7,_0x1f633b){_0x1f633b=_0x1f633b||0xc8;return function(_0x29b714){if(_0x29b714){return _0x43dfb7[_0xfe88('0x1c')](_0x1f633b)[_0xfe88('0x1d')](_0x29b714);}};}function respondWithFilteredResult(_0x4fc1aa,_0x229673){return function(_0x1335ce){if(_0x1335ce){var _0x16aced=typeof _0x229673[_0xfe88('0x1e')]==='undefined'&&typeof _0x229673['limit']===_0xfe88('0x1f');var _0x3044b5=_0x1335ce[_0xfe88('0x20')];var _0x2c8ad9=_0x16aced?0x0:_0x229673[_0xfe88('0x1e')];var _0x1ed30a=_0x16aced?_0x1335ce[_0xfe88('0x20')]:_0x229673[_0xfe88('0x1e')]+_0x229673['limit'];var _0x348f00;if(_0x1ed30a>=_0x3044b5){_0x1ed30a=_0x3044b5;_0x348f00=0xc8;}else{_0x348f00=0xce;}_0x4fc1aa[_0xfe88('0x1c')](_0x348f00);return _0x4fc1aa['set'](_0xfe88('0x21'),_0x2c8ad9+'-'+_0x1ed30a+'/'+_0x3044b5)[_0xfe88('0x1d')](_0x1335ce);}return null;};}function patchUpdates(_0x51e74d){return function(_0x354840){try{jsonpatch[_0xfe88('0x22')](_0x354840,_0x51e74d,!![]);}catch(_0x298df4){return BPromise[_0xfe88('0x23')](_0x298df4);}return _0x354840[_0xfe88('0x24')]();};}function saveUpdates(_0x3e0582,_0x100ade){return function(_0x596842){if(_0x596842){return _0x596842[_0xfe88('0x25')](_0x3e0582)['then'](function(_0x38dee0){return _0x38dee0;});}return null;};}function removeEntity(_0x453fac,_0x5e0499){return function(_0x6cdf2f){if(_0x6cdf2f){return _0x6cdf2f[_0xfe88('0x26')]()[_0xfe88('0x27')](function(){var _0x6875a0=_0x6cdf2f['get']({'plain':!![]});var _0x46c2af=_0xfe88('0x28');return db[_0xfe88('0x29')][_0xfe88('0x26')]({'where':{'type':_0x46c2af,'resourceId':_0x6875a0['id']}})['then'](function(){return _0x6cdf2f;});})[_0xfe88('0x27')](function(){_0x453fac[_0xfe88('0x1c')](0xcc)[_0xfe88('0x2a')]();});}};}function handleEntityNotFound(_0x2d2dd9,_0x3d38fa){return function(_0x1c96a8){if(!_0x1c96a8){_0x2d2dd9[_0xfe88('0x1b')](0x194);}return _0x1c96a8;};}function handleError(_0x4acce,_0x1bb61a){_0x1bb61a=_0x1bb61a||0x1f4;return function(_0x127004){logger['error'](_0x127004['stack']);if(_0x127004[_0xfe88('0x2b')]){delete _0x127004[_0xfe88('0x2b')];}_0x4acce['status'](_0x1bb61a)['send'](_0x127004);};}exports[_0xfe88('0x2c')]=function(_0x56fd8,_0x3d4d00){var _0x5b83bb={},_0x4ee8ee={},_0x18d685={'count':0x0,'rows':[]};var _0x21edac=_[_0xfe88('0x2d')](db[_0xfe88('0x2e')][_0xfe88('0x2f')],function(_0x19d52){return{'name':_0x19d52[_0xfe88('0x30')],'type':_0x19d52['type'][_0xfe88('0x31')]};});_0x4ee8ee['model']=_[_0xfe88('0x2d')](_0x21edac,_0xfe88('0x2b'));_0x4ee8ee[_0xfe88('0x32')]=_['keys'](_0x56fd8[_0xfe88('0x32')]);_0x4ee8ee[_0xfe88('0x33')]=_[_0xfe88('0x34')](_0x4ee8ee[_0xfe88('0x35')],_0x4ee8ee['query']);_0x5b83bb[_0xfe88('0x36')]=_[_0xfe88('0x34')](_0x4ee8ee[_0xfe88('0x35')],qs[_0xfe88('0x37')](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x37')]));_0x5b83bb[_0xfe88('0x36')]=_0x5b83bb['attributes'][_0xfe88('0x38')]?_0x5b83bb[_0xfe88('0x36')]:_0x4ee8ee[_0xfe88('0x35')];if(!_0x56fd8[_0xfe88('0x32')][_0xfe88('0x39')]('nolimit')){_0x5b83bb['limit']=qs['limit'](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3a')]);_0x5b83bb['offset']=qs[_0xfe88('0x1e')](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x1e')]);}_0x5b83bb[_0xfe88('0x3b')]=qs['sort'](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3c')]);_0x5b83bb[_0xfe88('0x3d')]=qs[_0xfe88('0x33')](_[_0xfe88('0x3e')](_0x56fd8[_0xfe88('0x32')],_0x4ee8ee['filters']),_0x21edac);if(_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3f')]){_0x5b83bb[_0xfe88('0x3d')]=_[_0xfe88('0x40')](_0x5b83bb['where'],{'$or':_[_0xfe88('0x2d')](_0x21edac,function(_0x5c21c6){if(_0x5c21c6[_0xfe88('0x41')]!=='VIRTUAL'){var _0x5e745b={};_0x5e745b[_0x5c21c6[_0xfe88('0x2b')]]={'$like':'%'+_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3f')]+'%'};return _0x5e745b;}})});}_0x5b83bb=_['merge']({},_0x5b83bb,_0x56fd8['options']);var _0x5452a9={'where':_0x5b83bb[_0xfe88('0x3d')]};return db['Template']['count'](_0x5452a9)[_0xfe88('0x27')](function(_0x5dacfa){_0x18d685['count']=_0x5dacfa;if(_0x56fd8[_0xfe88('0x32')]['includeAll']){_0x5b83bb[_0xfe88('0x42')]=[{'all':!![]}];}return db[_0xfe88('0x2e')][_0xfe88('0x43')](_0x5b83bb);})['then'](function(_0x49a68a){_0x18d685[_0xfe88('0x44')]=_0x49a68a;return _0x18d685;})[_0xfe88('0x27')](respondWithFilteredResult(_0x3d4d00,_0x5b83bb))['catch'](handleError(_0x3d4d00,null));};exports[_0xfe88('0x45')]=function(_0x4ce470,_0x528fe9){var _0x2a5614={'raw':!![],'where':{'id':_0x4ce470[_0xfe88('0x46')]['id']}},_0x13dfa5={};_0x13dfa5[_0xfe88('0x35')]=_['keys'](db['Template']['rawAttributes']);_0x13dfa5[_0xfe88('0x32')]=_[_0xfe88('0x47')](_0x4ce470[_0xfe88('0x32')]);_0x13dfa5['filters']=_['intersection'](_0x13dfa5[_0xfe88('0x35')],_0x13dfa5[_0xfe88('0x32')]);_0x2a5614[_0xfe88('0x36')]=_[_0xfe88('0x34')](_0x13dfa5[_0xfe88('0x35')],qs[_0xfe88('0x37')](_0x4ce470[_0xfe88('0x32')][_0xfe88('0x37')]));_0x2a5614[_0xfe88('0x36')]=_0x2a5614['attributes'][_0xfe88('0x38')]?_0x2a5614['attributes']:_0x13dfa5[_0xfe88('0x35')];if(_0x4ce470[_0xfe88('0x32')]['includeAll']){_0x2a5614[_0xfe88('0x42')]=[{'all':!![]}];}_0x2a5614=_[_0xfe88('0x40')]({},_0x2a5614,_0x4ce470[_0xfe88('0x48')]);return db[_0xfe88('0x2e')][_0xfe88('0x49')](_0x2a5614)[_0xfe88('0x27')](handleEntityNotFound(_0x528fe9,null))[_0xfe88('0x27')](respondWithResult(_0x528fe9,null))[_0xfe88('0x4a')](handleError(_0x528fe9,null));};exports[_0xfe88('0x4b')]=function(_0xb0565e,_0x20bc11){return db['Template'][_0xfe88('0x4b')](_0xb0565e[_0xfe88('0x4c')],{})[_0xfe88('0x27')](function(_0x2a32cd){var _0x800f34=_0xb0565e['user']['get']({'plain':!![]});if(!_0x800f34)throw new Error(_0xfe88('0x4d'));if(_0x800f34['role']==='user'){var _0x5a2beb=_0x2a32cd[_0xfe88('0x4e')]({'plain':!![]});var _0x3e179d=_0xfe88('0x28');return db['UserProfileSection'][_0xfe88('0x49')]({'where':{'name':_0x3e179d,'userProfileId':_0x800f34[_0xfe88('0x4f')]},'raw':!![]})[_0xfe88('0x27')](function(_0x1aabb3){if(_0x1aabb3&&_0x1aabb3[_0xfe88('0x50')]===0x0){return db['UserProfileResource'][_0xfe88('0x4b')]({'name':_0x5a2beb[_0xfe88('0x2b')],'resourceId':_0x5a2beb['id'],'type':_0x1aabb3[_0xfe88('0x2b')],'sectionId':_0x1aabb3['id']},{})[_0xfe88('0x27')](function(){return _0x2a32cd;});}else{return _0x2a32cd;}})['catch'](function(_0x5b833b){logger[_0xfe88('0x51')](_0xfe88('0x52'),_0x5b833b);throw _0x5b833b;});}return _0x2a32cd;})[_0xfe88('0x27')](respondWithResult(_0x20bc11,0xc9))[_0xfe88('0x4a')](handleError(_0x20bc11,null));};exports[_0xfe88('0x25')]=function(_0x36eadf,_0x4cae27){if(_0x36eadf['body']['id']){delete _0x36eadf[_0xfe88('0x4c')]['id'];}return db[_0xfe88('0x2e')]['find']({'where':{'id':_0x36eadf['params']['id']}})[_0xfe88('0x27')](handleEntityNotFound(_0x4cae27,null))[_0xfe88('0x27')](saveUpdates(_0x36eadf['body'],null))[_0xfe88('0x27')](respondWithResult(_0x4cae27,null))[_0xfe88('0x4a')](handleError(_0x4cae27,null));};exports['destroy']=function(_0x4b17cd,_0x470cf1){return db[_0xfe88('0x2e')][_0xfe88('0x49')]({'where':{'id':_0x4b17cd[_0xfe88('0x46')]['id']}})['then'](handleEntityNotFound(_0x470cf1,null))[_0xfe88('0x27')](removeEntity(_0x470cf1,null))[_0xfe88('0x4a')](handleError(_0x470cf1,null));}; \ No newline at end of file +var _0xc6ce=['find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','then','destroy','Templates','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Template','includeAll','findAll','show','params','include'];(function(_0x507021,_0x3142e2){var _0x2a2c00=function(_0x55b424){while(--_0x55b424){_0x507021['push'](_0x507021['shift']());}};_0x2a2c00(++_0x3142e2);}(_0xc6ce,0x1a2));var _0xec6c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc6ce[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xec6c('0x0'));var rimraf=require(_0xec6c('0x1'));var zipdir=require(_0xec6c('0x2'));var jsonpatch=require(_0xec6c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xec6c('0x4'));var Mustache=require(_0xec6c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xec6c('0x6'));var csv=require(_0xec6c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec6c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec6c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xec6c('0xa'));var toCsv=require(_0xec6c('0x7'));var querystring=require(_0xec6c('0xb'));var Papa=require(_0xec6c('0xc'));var Redis=require(_0xec6c('0xd'));var authService=require(_0xec6c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xec6c('0xf'));var hardwareService=require(_0xec6c('0x10'));var logger=require(_0xec6c('0x11'))(_0xec6c('0x12'));var utils=require(_0xec6c('0x13'));var config=require(_0xec6c('0x14'));var licenseUtil=require(_0xec6c('0x15'));var db=require(_0xec6c('0x16'))['db'];function respondWithStatusCode(_0x40d32c,_0x58fbad){_0x58fbad=_0x58fbad||0xcc;return function(_0x28e5ef){if(_0x28e5ef){return _0x40d32c[_0xec6c('0x17')](_0x58fbad);}return _0x40d32c[_0xec6c('0x18')](_0x58fbad)['end']();};}function respondWithResult(_0x50431f,_0x15f919){_0x15f919=_0x15f919||0xc8;return function(_0x4a453e){if(_0x4a453e){return _0x50431f[_0xec6c('0x18')](_0x15f919)[_0xec6c('0x19')](_0x4a453e);}};}function respondWithFilteredResult(_0xa960e8,_0x517e7c){return function(_0x2301f1){if(_0x2301f1){var _0x1ea58c=typeof _0x517e7c['offset']===_0xec6c('0x1a')&&typeof _0x517e7c[_0xec6c('0x1b')]===_0xec6c('0x1a');var _0x2f00a2=_0x2301f1[_0xec6c('0x1c')];var _0x1a1776=_0x1ea58c?0x0:_0x517e7c[_0xec6c('0x1d')];var _0x4d1fb4=_0x1ea58c?_0x2301f1[_0xec6c('0x1c')]:_0x517e7c['offset']+_0x517e7c[_0xec6c('0x1b')];var _0x2ff01e;if(_0x4d1fb4>=_0x2f00a2){_0x4d1fb4=_0x2f00a2;_0x2ff01e=0xc8;}else{_0x2ff01e=0xce;}_0xa960e8['status'](_0x2ff01e);return _0xa960e8[_0xec6c('0x1e')](_0xec6c('0x1f'),_0x1a1776+'-'+_0x4d1fb4+'/'+_0x2f00a2)[_0xec6c('0x19')](_0x2301f1);}return null;};}function patchUpdates(_0x4abe72){return function(_0x21fc44){try{jsonpatch['apply'](_0x21fc44,_0x4abe72,!![]);}catch(_0x489dc5){return BPromise['reject'](_0x489dc5);}return _0x21fc44['save']();};}function saveUpdates(_0xc5fe47,_0x282783){return function(_0x5258d4){if(_0x5258d4){return _0x5258d4['update'](_0xc5fe47)[_0xec6c('0x20')](function(_0x33c38a){return _0x33c38a;});}return null;};}function removeEntity(_0x32f0b7,_0x4fa832){return function(_0x1b8518){if(_0x1b8518){return _0x1b8518[_0xec6c('0x21')]()[_0xec6c('0x20')](function(){var _0x268fa7=_0x1b8518['get']({'plain':!![]});var _0x8a9df9=_0xec6c('0x22');return db[_0xec6c('0x23')][_0xec6c('0x21')]({'where':{'type':_0x8a9df9,'resourceId':_0x268fa7['id']}})[_0xec6c('0x20')](function(){return _0x1b8518;});})[_0xec6c('0x20')](function(){_0x32f0b7[_0xec6c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c0077,_0x10cf6f){return function(_0xc11c95){if(!_0xc11c95){_0x3c0077[_0xec6c('0x17')](0x194);}return _0xc11c95;};}function handleError(_0x94a856,_0x3a0d66){_0x3a0d66=_0x3a0d66||0x1f4;return function(_0x1e4122){logger[_0xec6c('0x24')](_0x1e4122[_0xec6c('0x25')]);if(_0x1e4122[_0xec6c('0x26')]){delete _0x1e4122[_0xec6c('0x26')];}_0x94a856[_0xec6c('0x18')](_0x3a0d66)[_0xec6c('0x27')](_0x1e4122);};}exports[_0xec6c('0x28')]=function(_0x21e283,_0x5448f1){var _0x9c57ea={},_0x25d108={},_0x53ad89={'count':0x0,'rows':[]};var _0x115d34=_[_0xec6c('0x29')](db['Template'][_0xec6c('0x2a')],function(_0x58da67){return{'name':_0x58da67[_0xec6c('0x2b')],'type':_0x58da67['type']['key']};});_0x25d108['model']=_[_0xec6c('0x29')](_0x115d34,_0xec6c('0x26'));_0x25d108[_0xec6c('0x2c')]=_[_0xec6c('0x2d')](_0x21e283[_0xec6c('0x2c')]);_0x25d108[_0xec6c('0x2e')]=_[_0xec6c('0x2f')](_0x25d108[_0xec6c('0x30')],_0x25d108[_0xec6c('0x2c')]);_0x9c57ea['attributes']=_[_0xec6c('0x2f')](_0x25d108[_0xec6c('0x30')],qs['fields'](_0x21e283[_0xec6c('0x2c')][_0xec6c('0x31')]));_0x9c57ea[_0xec6c('0x32')]=_0x9c57ea[_0xec6c('0x32')][_0xec6c('0x33')]?_0x9c57ea['attributes']:_0x25d108['model'];if(!_0x21e283[_0xec6c('0x2c')][_0xec6c('0x34')](_0xec6c('0x35'))){_0x9c57ea[_0xec6c('0x1b')]=qs[_0xec6c('0x1b')](_0x21e283[_0xec6c('0x2c')][_0xec6c('0x1b')]);_0x9c57ea[_0xec6c('0x1d')]=qs['offset'](_0x21e283[_0xec6c('0x2c')]['offset']);}_0x9c57ea[_0xec6c('0x36')]=qs[_0xec6c('0x37')](_0x21e283['query'][_0xec6c('0x37')]);_0x9c57ea[_0xec6c('0x38')]=qs[_0xec6c('0x2e')](_[_0xec6c('0x39')](_0x21e283['query'],_0x25d108[_0xec6c('0x2e')]),_0x115d34);if(_0x21e283[_0xec6c('0x2c')][_0xec6c('0x3a')]){_0x9c57ea[_0xec6c('0x38')]=_[_0xec6c('0x3b')](_0x9c57ea['where'],{'$or':_[_0xec6c('0x29')](_0x115d34,function(_0x50af5b){if(_0x50af5b['type']!==_0xec6c('0x3c')){var _0x5994e5={};_0x5994e5[_0x50af5b[_0xec6c('0x26')]]={'$like':'%'+_0x21e283[_0xec6c('0x2c')]['filter']+'%'};return _0x5994e5;}})});}_0x9c57ea=_[_0xec6c('0x3b')]({},_0x9c57ea,_0x21e283[_0xec6c('0x3d')]);var _0x521430={'where':_0x9c57ea[_0xec6c('0x38')]};return db[_0xec6c('0x3e')][_0xec6c('0x1c')](_0x521430)[_0xec6c('0x20')](function(_0x2c49a0){_0x53ad89[_0xec6c('0x1c')]=_0x2c49a0;if(_0x21e283[_0xec6c('0x2c')][_0xec6c('0x3f')]){_0x9c57ea['include']=[{'all':!![]}];}return db[_0xec6c('0x3e')][_0xec6c('0x40')](_0x9c57ea);})[_0xec6c('0x20')](function(_0x21334a){_0x53ad89['rows']=_0x21334a;return _0x53ad89;})[_0xec6c('0x20')](respondWithFilteredResult(_0x5448f1,_0x9c57ea))['catch'](handleError(_0x5448f1,null));};exports[_0xec6c('0x41')]=function(_0x4c6071,_0x3e572c){var _0x103084={'raw':!![],'where':{'id':_0x4c6071[_0xec6c('0x42')]['id']}},_0x7aba1f={};_0x7aba1f[_0xec6c('0x30')]=_[_0xec6c('0x2d')](db[_0xec6c('0x3e')][_0xec6c('0x2a')]);_0x7aba1f[_0xec6c('0x2c')]=_[_0xec6c('0x2d')](_0x4c6071['query']);_0x7aba1f[_0xec6c('0x2e')]=_[_0xec6c('0x2f')](_0x7aba1f[_0xec6c('0x30')],_0x7aba1f[_0xec6c('0x2c')]);_0x103084[_0xec6c('0x32')]=_[_0xec6c('0x2f')](_0x7aba1f[_0xec6c('0x30')],qs[_0xec6c('0x31')](_0x4c6071[_0xec6c('0x2c')][_0xec6c('0x31')]));_0x103084['attributes']=_0x103084[_0xec6c('0x32')][_0xec6c('0x33')]?_0x103084['attributes']:_0x7aba1f[_0xec6c('0x30')];if(_0x4c6071[_0xec6c('0x2c')][_0xec6c('0x3f')]){_0x103084[_0xec6c('0x43')]=[{'all':!![]}];}_0x103084=_[_0xec6c('0x3b')]({},_0x103084,_0x4c6071[_0xec6c('0x3d')]);return db[_0xec6c('0x3e')][_0xec6c('0x44')](_0x103084)['then'](handleEntityNotFound(_0x3e572c,null))[_0xec6c('0x20')](respondWithResult(_0x3e572c,null))[_0xec6c('0x45')](handleError(_0x3e572c,null));};exports[_0xec6c('0x46')]=function(_0x32eb7c,_0x3e9119){return db[_0xec6c('0x3e')][_0xec6c('0x46')](_0x32eb7c[_0xec6c('0x47')],{})['then'](function(_0x290dd3){var _0xd06750=_0x32eb7c['user'][_0xec6c('0x48')]({'plain':!![]});if(!_0xd06750)throw new Error(_0xec6c('0x49'));if(_0xd06750[_0xec6c('0x4a')]===_0xec6c('0x4b')){var _0x492d2c=_0x290dd3[_0xec6c('0x48')]({'plain':!![]});var _0x1338d2=_0xec6c('0x22');return db[_0xec6c('0x4c')][_0xec6c('0x44')]({'where':{'name':_0x1338d2,'userProfileId':_0xd06750[_0xec6c('0x4d')]},'raw':!![]})['then'](function(_0xca778b){if(_0xca778b&&_0xca778b[_0xec6c('0x4e')]===0x0){return db[_0xec6c('0x23')][_0xec6c('0x46')]({'name':_0x492d2c[_0xec6c('0x26')],'resourceId':_0x492d2c['id'],'type':_0xca778b['name'],'sectionId':_0xca778b['id']},{})['then'](function(){return _0x290dd3;});}else{return _0x290dd3;}})[_0xec6c('0x45')](function(_0xc20df2){logger[_0xec6c('0x24')](_0xec6c('0x4f'),_0xc20df2);throw _0xc20df2;});}return _0x290dd3;})['then'](respondWithResult(_0x3e9119,0xc9))[_0xec6c('0x45')](handleError(_0x3e9119,null));};exports[_0xec6c('0x50')]=function(_0x39fb6b,_0x355a7c){if(_0x39fb6b[_0xec6c('0x47')]['id']){delete _0x39fb6b[_0xec6c('0x47')]['id'];}return db[_0xec6c('0x3e')][_0xec6c('0x44')]({'where':{'id':_0x39fb6b['params']['id']}})[_0xec6c('0x20')](handleEntityNotFound(_0x355a7c,null))[_0xec6c('0x20')](saveUpdates(_0x39fb6b[_0xec6c('0x47')],null))[_0xec6c('0x20')](respondWithResult(_0x355a7c,null))['catch'](handleError(_0x355a7c,null));};exports['destroy']=function(_0x529344,_0x35718d){return db[_0xec6c('0x3e')][_0xec6c('0x44')]({'where':{'id':_0x529344[_0xec6c('0x42')]['id']}})[_0xec6c('0x20')](handleEntityNotFound(_0x35718d,null))[_0xec6c('0x20')](removeEntity(_0x35718d,null))[_0xec6c('0x45')](handleError(_0x35718d,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c998809..96901c1 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 _0xd049=['Template','tools_templates','lodash','util','bluebird','request-promise','rimraf','./template.attributes','exports','define'];(function(_0x347489,_0x52e2c5){var _0x24fb5a=function(_0x5b650a){while(--_0x5b650a){_0x347489['push'](_0x347489['shift']());}};_0x24fb5a(++_0x52e2c5);}(_0xd049,0xde));var _0x9d04=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd049[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x9d04('0x0'));var util=require(_0x9d04('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9d04('0x2'));var rp=require(_0x9d04('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d04('0x4'));var config=require('../../config/environment');var attributes=require(_0x9d04('0x5'));module[_0x9d04('0x6')]=function(_0xa0929d,_0x377073){return _0xa0929d[_0x9d04('0x7')](_0x9d04('0x8'),attributes,{'tableName':_0x9d04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3701=['../../config/logger','api','moment','request-promise','rimraf','exports','tools_templates','lodash','util'];(function(_0x4b21ee,_0x1778d5){var _0x7009dc=function(_0x443e30){while(--_0x443e30){_0x4b21ee['push'](_0x4b21ee['shift']());}};_0x7009dc(++_0x1778d5);}(_0x3701,0x15d));var _0x1370=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3701[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1370('0x0'));var util=require(_0x1370('0x1'));var logger=require(_0x1370('0x2'))(_0x1370('0x3'));var moment=require(_0x1370('0x4'));var BPromise=require('bluebird');var rp=require(_0x1370('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1370('0x6'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x1370('0x7')]=function(_0x4d5e82,_0x4c71cf){return _0x4d5e82['define']('Template',attributes,{'tableName':_0x1370('0x8'),'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 3d294c2..9da30e6 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 _0x65e5=['where','limit','include','model','map','attributes','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','message','result','catch','Template','options','raw'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x65e5,0x1b9));var _0x565e=function(_0x233500,_0x543ec9){_0x233500=_0x233500-0x0;var _0x35a784=_0x65e5[_0x233500];return _0x35a784;};'use strict';var _=require(_0x565e('0x0'));var util=require(_0x565e('0x1'));var moment=require(_0x565e('0x2'));var BPromise=require(_0x565e('0x3'));var rs=require(_0x565e('0x4'));var fs=require('fs');var Redis=require(_0x565e('0x5'));var db=require(_0x565e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x565e('0x7'));var config=require(_0x565e('0x8'));var jayson=require(_0x565e('0x9'));var client=jayson['client'][_0x565e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1253d3,_0x5fdd9c,_0x55ed43){return new BPromise(function(_0x28e8c0,_0x3ab83a){return client[_0x565e('0xb')](_0x1253d3,_0x55ed43)[_0x565e('0xc')](function(_0x406a82){logger[_0x565e('0xd')]('Template,\x20%s,\x20%s',_0x5fdd9c,'request\x20sent');logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x5fdd9c,_0x565e('0xe'),JSON[_0x565e('0xf')](_0x406a82));if(_0x406a82[_0x565e('0x10')]){if(_0x406a82[_0x565e('0x10')][_0x565e('0x11')]===0x1f4){logger[_0x565e('0x10')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);return _0x3ab83a(_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);}logger[_0x565e('0x10')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);return _0x28e8c0(_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);}else{logger[_0x565e('0xd')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x565e('0xe'));_0x28e8c0(_0x406a82[_0x565e('0x13')][_0x565e('0x12')]);}})[_0x565e('0x14')](function(_0x4d5d70){logger[_0x565e('0x10')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x4d5d70);_0x3ab83a(_0x4d5d70);});});}exports['GetTemplate']=function(_0x309e8c){var _0x3a5b98=this;return new Promise(function(_0x2ac970,_0x35cbc4){return db[_0x565e('0x15')]['findAll']({'raw':_0x309e8c[_0x565e('0x16')]?_0x309e8c[_0x565e('0x16')][_0x565e('0x17')]===undefined?!![]:![]:!![],'where':_0x309e8c['options']?_0x309e8c[_0x565e('0x16')][_0x565e('0x18')]||null:null,'attributes':_0x309e8c[_0x565e('0x16')]?_0x309e8c[_0x565e('0x16')]['attributes']||null:null,'limit':_0x309e8c[_0x565e('0x16')]?_0x309e8c['options'][_0x565e('0x19')]||null:null,'include':_0x309e8c['options']?_0x309e8c[_0x565e('0x16')]['include']?_['map'](_0x309e8c['options'][_0x565e('0x1a')],function(_0x450eed){return{'model':db[_0x450eed[_0x565e('0x1b')]],'as':_0x450eed['as'],'attributes':_0x450eed['attributes'],'include':_0x450eed[_0x565e('0x1a')]?_[_0x565e('0x1c')](_0x450eed[_0x565e('0x1a')],function(_0x36b305){return{'model':db[_0x36b305['model']],'as':_0x36b305['as'],'attributes':_0x36b305[_0x565e('0x1d')],'include':_0x36b305['include']?_[_0x565e('0x1c')](_0x36b305['include'],function(_0x480561){return{'model':db[_0x480561[_0x565e('0x1b')]],'as':_0x480561['as'],'attributes':_0x480561[_0x565e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x565e('0xc')](function(_0x5b82bc){logger[_0x565e('0xd')](_0x565e('0x1e'),_0x309e8c);logger['debug'](_0x565e('0x1e'),_0x309e8c,JSON['stringify'](_0x5b82bc));_0x2ac970(_0x5b82bc);})['catch'](function(_0x4d8aea){logger[_0x565e('0x10')]('GetTemplate',_0x4d8aea[_0x565e('0x12')],_0x309e8c);_0x35cbc4(_0x3a5b98[_0x565e('0x10')](0x1f4,_0x4d8aea[_0x565e('0x12')]));});});}; \ No newline at end of file +var _0x1a39=['../../config/environment','jayson/promise','http','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetTemplate','Template','findAll','options','attributes','map','model','include','info','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2676c1,_0x1aa9dd){var _0x3f763f=function(_0x30f8e7){while(--_0x30f8e7){_0x2676c1['push'](_0x2676c1['shift']());}};_0x3f763f(++_0x1aa9dd);}(_0x1a39,0x106));var _0x91a3=function(_0x278dd1,_0x16c228){_0x278dd1=_0x278dd1-0x0;var _0x2a2e9e=_0x1a39[_0x278dd1];return _0x2a2e9e;};'use strict';var _=require(_0x91a3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x91a3('0x1'));var rs=require(_0x91a3('0x2'));var fs=require('fs');var Redis=require(_0x91a3('0x3'));var db=require(_0x91a3('0x4'))['db'];var utils=require(_0x91a3('0x5'));var logger=require(_0x91a3('0x6'))(_0x91a3('0x7'));var config=require(_0x91a3('0x8'));var jayson=require(_0x91a3('0x9'));var client=jayson['client'][_0x91a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26c50d,_0x2cc14d,_0x2ed20c){return new BPromise(function(_0x3b3b81,_0x5224ff){return client['request'](_0x26c50d,_0x2ed20c)[_0x91a3('0xb')](function(_0xa59462){logger['info'](_0x91a3('0xc'),_0x2cc14d,'request\x20sent');logger[_0x91a3('0xd')](_0x91a3('0xe'),_0x2cc14d,'request\x20sent',JSON[_0x91a3('0xf')](_0xa59462));if(_0xa59462[_0x91a3('0x10')]){if(_0xa59462[_0x91a3('0x10')]['code']===0x1f4){logger[_0x91a3('0x10')](_0x91a3('0xc'),_0x2cc14d,_0xa59462[_0x91a3('0x10')][_0x91a3('0x11')]);return _0x5224ff(_0xa59462[_0x91a3('0x10')][_0x91a3('0x11')]);}logger[_0x91a3('0x10')](_0x91a3('0xc'),_0x2cc14d,_0xa59462['error']['message']);return _0x3b3b81(_0xa59462[_0x91a3('0x10')][_0x91a3('0x11')]);}else{logger['info'](_0x91a3('0xc'),_0x2cc14d,_0x91a3('0x12'));_0x3b3b81(_0xa59462[_0x91a3('0x13')]['message']);}})[_0x91a3('0x14')](function(_0x5d9384){logger[_0x91a3('0x10')](_0x91a3('0xc'),_0x2cc14d,_0x5d9384);_0x5224ff(_0x5d9384);});});}exports[_0x91a3('0x15')]=function(_0x325e60){var _0x4c928b=this;return new Promise(function(_0x435667,_0xcbaaaf){return db[_0x91a3('0x16')][_0x91a3('0x17')]({'raw':_0x325e60[_0x91a3('0x18')]?_0x325e60[_0x91a3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x325e60[_0x91a3('0x18')]?_0x325e60[_0x91a3('0x18')]['where']||null:null,'attributes':_0x325e60[_0x91a3('0x18')]?_0x325e60['options'][_0x91a3('0x19')]||null:null,'limit':_0x325e60[_0x91a3('0x18')]?_0x325e60[_0x91a3('0x18')]['limit']||null:null,'include':_0x325e60[_0x91a3('0x18')]?_0x325e60[_0x91a3('0x18')]['include']?_[_0x91a3('0x1a')](_0x325e60[_0x91a3('0x18')]['include'],function(_0x13c214){return{'model':db[_0x13c214[_0x91a3('0x1b')]],'as':_0x13c214['as'],'attributes':_0x13c214[_0x91a3('0x19')],'include':_0x13c214[_0x91a3('0x1c')]?_['map'](_0x13c214[_0x91a3('0x1c')],function(_0x6b99ed){return{'model':db[_0x6b99ed[_0x91a3('0x1b')]],'as':_0x6b99ed['as'],'attributes':_0x6b99ed[_0x91a3('0x19')],'include':_0x6b99ed[_0x91a3('0x1c')]?_[_0x91a3('0x1a')](_0x6b99ed['include'],function(_0x3c6860){return{'model':db[_0x3c6860['model']],'as':_0x3c6860['as'],'attributes':_0x3c6860[_0x91a3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x91a3('0xb')](function(_0x201135){logger[_0x91a3('0x1d')](_0x91a3('0x15'),_0x325e60);logger[_0x91a3('0xd')](_0x91a3('0x15'),_0x325e60,JSON['stringify'](_0x201135));_0x435667(_0x201135);})['catch'](function(_0x46f59a){logger[_0x91a3('0x10')]('GetTemplate',_0x46f59a[_0x91a3('0x11')],_0x325e60);_0xcbaaaf(_0x4c928b[_0x91a3('0x10')](0x1f4,_0x46f59a[_0x91a3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7469649..40b0684 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 _0xf3ad=['/:id/actions','getActions','post','addAnyCondition','addAction','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf3ad,0xb6));var _0xdf3a=function(_0x1ca585,_0x1000cb){_0x1ca585=_0x1ca585-0x0;var _0x16d0e4=_0xf3ad[_0x1ca585];return _0x16d0e4;};'use strict';var multer=require('multer');var util=require(_0xdf3a('0x0'));var path=require(_0xdf3a('0x1'));var timeout=require(_0xdf3a('0x2'));var express=require('express');var router=express[_0xdf3a('0x3')]();var fs_extra=require(_0xdf3a('0x4'));var auth=require(_0xdf3a('0x5'));var interaction=require(_0xdf3a('0x6'));var config=require(_0xdf3a('0x7'));var controller=require(_0xdf3a('0x8'));router[_0xdf3a('0x9')]('/',auth[_0xdf3a('0xa')](),controller[_0xdf3a('0xb')]);router[_0xdf3a('0x9')](_0xdf3a('0xc'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0xd')]);router[_0xdf3a('0x9')](_0xdf3a('0xe'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0xf')]);router[_0xdf3a('0x9')](_0xdf3a('0x10'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x11')]);router[_0xdf3a('0x9')](_0xdf3a('0x12'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x13')]);router['post']('/',auth[_0xdf3a('0xa')](),controller['create']);router[_0xdf3a('0x14')](_0xdf3a('0xe'),auth[_0xdf3a('0xa')](),controller['addAllCondition']);router[_0xdf3a('0x14')](_0xdf3a('0x10'),auth['isAuthenticated'](),controller[_0xdf3a('0x15')]);router['post'](_0xdf3a('0x12'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x16')]);router['put']('/:id',auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x17')]);router['delete'](_0xdf3a('0xc'),auth[_0xdf3a('0xa')](),controller['destroy']);module[_0xdf3a('0x18')]=router; \ No newline at end of file +var _0x5973=['/:id/any_conditions','getAnyConditions','getActions','post','/:id/actions','update','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./trigger.controller','get','index','isAuthenticated','show','/:id/all_conditions','getAllConditions'];(function(_0x3243d3,_0x55af87){var _0x51fe7a=function(_0x36aac7){while(--_0x36aac7){_0x3243d3['push'](_0x3243d3['shift']());}};_0x51fe7a(++_0x55af87);}(_0x5973,0xb9));var _0x3597=function(_0x127d68,_0x44b77b){_0x127d68=_0x127d68-0x0;var _0xa5a78b=_0x5973[_0x127d68];return _0xa5a78b;};'use strict';var multer=require(_0x3597('0x0'));var util=require(_0x3597('0x1'));var path=require('path');var timeout=require(_0x3597('0x2'));var express=require(_0x3597('0x3'));var router=express['Router']();var fs_extra=require(_0x3597('0x4'));var auth=require(_0x3597('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3597('0x6'));router[_0x3597('0x7')]('/',auth['isAuthenticated'](),controller[_0x3597('0x8')]);router[_0x3597('0x7')]('/:id',auth[_0x3597('0x9')](),controller[_0x3597('0xa')]);router['get'](_0x3597('0xb'),auth[_0x3597('0x9')](),controller[_0x3597('0xc')]);router['get'](_0x3597('0xd'),auth['isAuthenticated'](),controller[_0x3597('0xe')]);router[_0x3597('0x7')]('/:id/actions',auth[_0x3597('0x9')](),controller[_0x3597('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3597('0xb'),auth[_0x3597('0x9')](),controller['addAllCondition']);router[_0x3597('0x10')]('/:id/any_conditions',auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x3597('0x10')](_0x3597('0x11'),auth[_0x3597('0x9')](),controller['addAction']);router['put']('/:id',auth[_0x3597('0x9')](),controller[_0x3597('0x12')]);router['delete'](_0x3597('0x13'),auth[_0x3597('0x9')](),controller[_0x3597('0x14')]);module[_0x3597('0x15')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index a353777..1f33c51 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 _0x7d35=['STRING','exports'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0x7d35,0xad));var _0x57d3=function(_0x37d870,_0x43470b){_0x37d870=_0x37d870-0x0;var _0x4b2c5f=_0x7d35[_0x37d870];return _0x4b2c5f;};'use strict';var Sequelize=require('sequelize');module[_0x57d3('0x0')]={'name':{'type':Sequelize[_0x57d3('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x57d3('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbe49=['sequelize','exports','STRING','BOOLEAN'];(function(_0x9cdf02,_0xd4e73e){var _0x5300a1=function(_0x500b63){while(--_0x500b63){_0x9cdf02['push'](_0x9cdf02['shift']());}};_0x5300a1(++_0xd4e73e);}(_0xbe49,0xa4));var _0x9be4=function(_0x5c6665,_0x1f0860){_0x5c6665=_0x5c6665-0x0;var _0x402702=_0xbe49[_0x5c6665];return _0x402702;};'use strict';var Sequelize=require(_0x9be4('0x0'));module[_0x9be4('0x1')]={'name':{'type':Sequelize[_0x9be4('0x2')]},'channel':{'type':Sequelize[_0x9be4('0x2')]},'description':{'type':Sequelize[_0x9be4('0x2')]},'status':{'type':Sequelize[_0x9be4('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 753d80b..56d900f 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 _0xe965=['eml-format','rimraf','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','Trigger','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','pick','filter','merge','options','where','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','map','hasOwnProperty','addAction','TriggerId','Action','getActions'];(function(_0x39b82d,_0x48efa9){var _0xcb204d=function(_0x3ce1cd){while(--_0x3ce1cd){_0x39b82d['push'](_0x39b82d['shift']());}};_0xcb204d(++_0x48efa9);}(_0xe965,0x170));var _0x5e96=function(_0x3d3cdc,_0x507968){_0x3d3cdc=_0x3d3cdc-0x0;var _0x1d1bb5=_0xe965[_0x3d3cdc];return _0x1d1bb5;};'use strict';var emlformat=require(_0x5e96('0x0'));var rimraf=require(_0x5e96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5e96('0x2'));var BPromise=require(_0x5e96('0x3'));var Mustache=require(_0x5e96('0x4'));var util=require(_0x5e96('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5e96('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e96('0x7'));var crypto=require(_0x5e96('0x8'));var jsforce=require(_0x5e96('0x9'));var deskjs=require(_0x5e96('0xa'));var toCsv=require(_0x5e96('0xb'));var querystring=require(_0x5e96('0xc'));var Papa=require(_0x5e96('0xd'));var Redis=require(_0x5e96('0xe'));var authService=require(_0x5e96('0xf'));var qs=require(_0x5e96('0x10'));var as=require(_0x5e96('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5e96('0x12'));var utils=require(_0x5e96('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5e96('0x14'));var db=require(_0x5e96('0x15'))['db'];function respondWithStatusCode(_0x125307,_0x2046af){_0x2046af=_0x2046af||0xcc;return function(_0x2f3c2a){if(_0x2f3c2a){return _0x125307['sendStatus'](_0x2046af);}return _0x125307[_0x5e96('0x16')](_0x2046af)[_0x5e96('0x17')]();};}function respondWithResult(_0x2b3ff1,_0x39036f){_0x39036f=_0x39036f||0xc8;return function(_0x255cb7){if(_0x255cb7){return _0x2b3ff1[_0x5e96('0x16')](_0x39036f)[_0x5e96('0x18')](_0x255cb7);}};}function respondWithFilteredResult(_0x3926f8,_0x2b85ae){return function(_0x19d78a){if(_0x19d78a){var _0x297902=typeof _0x2b85ae[_0x5e96('0x19')]===_0x5e96('0x1a')&&typeof _0x2b85ae[_0x5e96('0x1b')]===_0x5e96('0x1a');var _0x41ac34=_0x19d78a[_0x5e96('0x1c')];var _0x3ebaa3=_0x297902?0x0:_0x2b85ae['offset'];var _0x153323=_0x297902?_0x19d78a[_0x5e96('0x1c')]:_0x2b85ae[_0x5e96('0x19')]+_0x2b85ae[_0x5e96('0x1b')];var _0x10dda5;if(_0x153323>=_0x41ac34){_0x153323=_0x41ac34;_0x10dda5=0xc8;}else{_0x10dda5=0xce;}_0x3926f8[_0x5e96('0x16')](_0x10dda5);return _0x3926f8[_0x5e96('0x1d')]('Content-Range',_0x3ebaa3+'-'+_0x153323+'/'+_0x41ac34)[_0x5e96('0x18')](_0x19d78a);}return null;};}function patchUpdates(_0x3f4d23){return function(_0x320237){try{jsonpatch[_0x5e96('0x1e')](_0x320237,_0x3f4d23,!![]);}catch(_0x3d1a5b){return BPromise[_0x5e96('0x1f')](_0x3d1a5b);}return _0x320237[_0x5e96('0x20')]();};}function saveUpdates(_0x31c683,_0xcff78c){return function(_0x5e6d10){if(_0x5e6d10){return _0x5e6d10[_0x5e96('0x21')](_0x31c683)[_0x5e96('0x22')](function(_0x7753f0){return _0x7753f0;});}return null;};}function removeEntity(_0x14d676,_0x13fff7){return function(_0x43cd96){if(_0x43cd96){return _0x43cd96[_0x5e96('0x23')]()[_0x5e96('0x22')](function(){var _0x8628eb=_0x43cd96[_0x5e96('0x24')]({'plain':!![]});var _0x5b7f5f='Triggers';return db[_0x5e96('0x25')]['destroy']({'where':{'type':_0x5b7f5f,'resourceId':_0x8628eb['id']}})[_0x5e96('0x22')](function(){return _0x43cd96;});})[_0x5e96('0x22')](function(){_0x14d676[_0x5e96('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e73a6,_0x37918a){return function(_0x56e94e){if(!_0x56e94e){_0x3e73a6[_0x5e96('0x26')](0x194);}return _0x56e94e;};}function handleError(_0x31f7c2,_0x3ca3ee){_0x3ca3ee=_0x3ca3ee||0x1f4;return function(_0x355971){logger[_0x5e96('0x27')](_0x355971[_0x5e96('0x28')]);if(_0x355971['name']){delete _0x355971[_0x5e96('0x29')];}_0x31f7c2[_0x5e96('0x16')](_0x3ca3ee)[_0x5e96('0x2a')](_0x355971);};}exports[_0x5e96('0x2b')]=function(_0xc5d2c5,_0x53b7cb){var _0x1ab17d={},_0xb645da={},_0x5f1900={'count':0x0,'rows':[]};var _0x15fbab=_['map'](db[_0x5e96('0x2c')][_0x5e96('0x2d')],function(_0x1b237c){return{'name':_0x1b237c['fieldName'],'type':_0x1b237c[_0x5e96('0x2e')][_0x5e96('0x2f')]};});_0xb645da['model']=_['map'](_0x15fbab,_0x5e96('0x29'));_0xb645da[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0xc5d2c5[_0x5e96('0x30')]);_0xb645da[_0x5e96('0x32')]=_['intersection'](_0xb645da['model'],_0xb645da[_0x5e96('0x30')]);_0x1ab17d[_0x5e96('0x33')]=_[_0x5e96('0x34')](_0xb645da[_0x5e96('0x35')],qs[_0x5e96('0x36')](_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x36')]));_0x1ab17d['attributes']=_0x1ab17d[_0x5e96('0x33')][_0x5e96('0x37')]?_0x1ab17d['attributes']:_0xb645da[_0x5e96('0x35')];if(!_0xc5d2c5[_0x5e96('0x30')]['hasOwnProperty'](_0x5e96('0x38'))){_0x1ab17d[_0x5e96('0x1b')]=qs[_0x5e96('0x1b')](_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x1b')]);_0x1ab17d['offset']=qs[_0x5e96('0x19')](_0xc5d2c5[_0x5e96('0x30')]['offset']);}_0x1ab17d[_0x5e96('0x39')]=qs[_0x5e96('0x3a')](_0xc5d2c5['query'][_0x5e96('0x3a')]);_0x1ab17d['where']=qs[_0x5e96('0x32')](_[_0x5e96('0x3b')](_0xc5d2c5[_0x5e96('0x30')],_0xb645da[_0x5e96('0x32')]),_0x15fbab);if(_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x3c')]){_0x1ab17d['where']=_['merge'](_0x1ab17d['where'],{'$or':_['map'](_0x15fbab,function(_0x8390f2){if(_0x8390f2[_0x5e96('0x2e')]!=='VIRTUAL'){var _0x30dea9={};_0x30dea9[_0x8390f2[_0x5e96('0x29')]]={'$like':'%'+_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x30dea9;}})});}_0x1ab17d=_[_0x5e96('0x3d')]({},_0x1ab17d,_0xc5d2c5[_0x5e96('0x3e')]);var _0x3f6e19={'where':_0x1ab17d[_0x5e96('0x3f')]};return db['Trigger'][_0x5e96('0x1c')](_0x3f6e19)[_0x5e96('0x22')](function(_0x1da97e){_0x5f1900[_0x5e96('0x1c')]=_0x1da97e;if(_0xc5d2c5[_0x5e96('0x30')]['includeAll']){_0x1ab17d[_0x5e96('0x40')]=[{'all':!![]}];}return db[_0x5e96('0x2c')][_0x5e96('0x41')](_0x1ab17d);})[_0x5e96('0x22')](function(_0x12447d){_0x5f1900[_0x5e96('0x42')]=_0x12447d;return _0x5f1900;})[_0x5e96('0x22')](respondWithFilteredResult(_0x53b7cb,_0x1ab17d))[_0x5e96('0x43')](handleError(_0x53b7cb,null));};exports[_0x5e96('0x44')]=function(_0x2ed0ba,_0x3dfad3){var _0x8d9bcb={'raw':![],'where':{'id':_0x2ed0ba[_0x5e96('0x45')]['id']}},_0x3a74b0={};_0x3a74b0[_0x5e96('0x35')]=_[_0x5e96('0x31')](db[_0x5e96('0x2c')][_0x5e96('0x2d')]);_0x3a74b0[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0x2ed0ba[_0x5e96('0x30')]);_0x3a74b0['filters']=_[_0x5e96('0x34')](_0x3a74b0[_0x5e96('0x35')],_0x3a74b0[_0x5e96('0x30')]);_0x8d9bcb[_0x5e96('0x33')]=_['intersection'](_0x3a74b0['model'],qs[_0x5e96('0x36')](_0x2ed0ba[_0x5e96('0x30')][_0x5e96('0x36')]));_0x8d9bcb[_0x5e96('0x33')]=_0x8d9bcb[_0x5e96('0x33')]['length']?_0x8d9bcb[_0x5e96('0x33')]:_0x3a74b0[_0x5e96('0x35')];if(_0x2ed0ba[_0x5e96('0x30')][_0x5e96('0x46')]){_0x8d9bcb[_0x5e96('0x40')]=[{'all':!![]}];}_0x8d9bcb=_['merge']({},_0x8d9bcb,_0x2ed0ba['options']);return db[_0x5e96('0x2c')][_0x5e96('0x47')](_0x8d9bcb)[_0x5e96('0x22')](handleEntityNotFound(_0x3dfad3,null))[_0x5e96('0x22')](respondWithResult(_0x3dfad3,null))[_0x5e96('0x43')](handleError(_0x3dfad3,null));};exports[_0x5e96('0x48')]=function(_0x2be2a3,_0x126cdd){return db['Trigger'][_0x5e96('0x48')](_0x2be2a3[_0x5e96('0x49')],{})[_0x5e96('0x22')](function(_0x349556){var _0x41435c=_0x2be2a3['user'][_0x5e96('0x24')]({'plain':!![]});if(!_0x41435c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41435c[_0x5e96('0x4a')]===_0x5e96('0x4b')){var _0x6b6380=_0x349556[_0x5e96('0x24')]({'plain':!![]});var _0x11c17d='Triggers';return db['UserProfileSection'][_0x5e96('0x47')]({'where':{'name':_0x11c17d,'userProfileId':_0x41435c['userProfileId']},'raw':!![]})[_0x5e96('0x22')](function(_0x2debdf){if(_0x2debdf&&_0x2debdf[_0x5e96('0x4c')]===0x0){return db[_0x5e96('0x25')]['create']({'name':_0x6b6380[_0x5e96('0x29')],'resourceId':_0x6b6380['id'],'type':_0x2debdf['name'],'sectionId':_0x2debdf['id']},{})['then'](function(){return _0x349556;});}else{return _0x349556;}})[_0x5e96('0x43')](function(_0x5cfc33){logger[_0x5e96('0x27')](_0x5e96('0x4d'),_0x5cfc33);throw _0x5cfc33;});}return _0x349556;})[_0x5e96('0x22')](respondWithResult(_0x126cdd,0xc9))[_0x5e96('0x43')](handleError(_0x126cdd,null));};exports['update']=function(_0x86f42c,_0x4198be){if(_0x86f42c['body']['id']){delete _0x86f42c['body']['id'];}return db[_0x5e96('0x2c')]['find']({'where':{'id':_0x86f42c[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x4198be,null))[_0x5e96('0x22')](saveUpdates(_0x86f42c['body'],null))[_0x5e96('0x22')](respondWithResult(_0x4198be,null))[_0x5e96('0x43')](handleError(_0x4198be,null));};exports[_0x5e96('0x23')]=function(_0x2a9b3a,_0x55a510){return db[_0x5e96('0x2c')][_0x5e96('0x47')]({'where':{'id':_0x2a9b3a[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x55a510,null))[_0x5e96('0x22')](removeEntity(_0x55a510,null))['catch'](handleError(_0x55a510,null));};exports[_0x5e96('0x4e')]=function(_0xb9c7d6,_0x2f11d1,_0x441d78){if(_0xb9c7d6[_0x5e96('0x49')]['id']){delete _0xb9c7d6[_0x5e96('0x49')]['id'];}return db[_0x5e96('0x2c')][_0x5e96('0x47')]({'where':{'id':_0xb9c7d6['params']['id']}})['then'](handleEntityNotFound(_0x2f11d1,null))[_0x5e96('0x22')](function(_0x99e7b9){if(_0x99e7b9){_0xb9c7d6[_0x5e96('0x49')][_0x5e96('0x4f')]=_0x99e7b9['id'];return db[_0x5e96('0x50')]['create'](_0xb9c7d6[_0x5e96('0x49')]);}})[_0x5e96('0x22')](respondWithResult(_0x2f11d1,null))[_0x5e96('0x43')](handleError(_0x2f11d1,null));};exports[_0x5e96('0x51')]=function(_0x1b744a,_0x4306d6,_0x17a217){if(_0x1b744a[_0x5e96('0x49')]['id']){delete _0x1b744a['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x1b744a[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x4306d6,null))[_0x5e96('0x22')](function(_0x44f009){if(_0x44f009){_0x1b744a[_0x5e96('0x49')][_0x5e96('0x52')]=_0x44f009['id'];return db[_0x5e96('0x50')][_0x5e96('0x48')](_0x1b744a[_0x5e96('0x49')]);}})['then'](respondWithResult(_0x4306d6,null))[_0x5e96('0x43')](handleError(_0x4306d6,null));};exports[_0x5e96('0x53')]=function(_0x4a23de,_0x5f1300,_0x35f274){var _0x44d821={};var _0x524268={};var _0x2ee9f3;var _0x16f7cb;return db['Trigger'][_0x5e96('0x54')]({'where':{'id':_0x4a23de[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x5f1300,null))[_0x5e96('0x22')](function(_0x1cdff8){if(_0x1cdff8){_0x2ee9f3=_0x1cdff8;_0x524268['model']=_['keys'](db[_0x5e96('0x50')]['rawAttributes']);_0x524268[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0x4a23de['query']);_0x524268[_0x5e96('0x32')]=_[_0x5e96('0x34')](_0x524268['model'],_0x524268['query']);_0x44d821[_0x5e96('0x33')]=_[_0x5e96('0x34')](_0x524268[_0x5e96('0x35')],qs[_0x5e96('0x36')](_0x4a23de[_0x5e96('0x30')][_0x5e96('0x36')]));_0x44d821[_0x5e96('0x33')]=_0x44d821[_0x5e96('0x33')][_0x5e96('0x37')]?_0x44d821['attributes']:_0x524268['model'];_0x44d821[_0x5e96('0x39')]=qs['sort'](_0x4a23de[_0x5e96('0x30')][_0x5e96('0x3a')]);_0x44d821['where']=qs[_0x5e96('0x32')](_['pick'](_0x4a23de['query'],_0x524268[_0x5e96('0x32')]));if(_0x4a23de[_0x5e96('0x30')][_0x5e96('0x3c')]){_0x44d821[_0x5e96('0x3f')]=_[_0x5e96('0x3d')](_0x44d821[_0x5e96('0x3f')],{'$or':_['map'](_0x44d821[_0x5e96('0x33')],function(_0x3dea3d){var _0x290de1={};_0x290de1[_0x3dea3d]={'$like':'%'+_0x4a23de[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x290de1;})});}_0x44d821=_['merge']({},_0x44d821,_0x4a23de[_0x5e96('0x3e')]);return _0x2ee9f3[_0x5e96('0x53')](_0x44d821);}})['then'](function(_0x5d09de){if(_0x5d09de){_0x16f7cb=_0x5d09de['length'];if(!_0x4a23de[_0x5e96('0x30')]['hasOwnProperty'](_0x5e96('0x38'))){_0x44d821['limit']=qs[_0x5e96('0x1b')](_0x4a23de[_0x5e96('0x30')]['limit']);_0x44d821[_0x5e96('0x19')]=qs['offset'](_0x4a23de[_0x5e96('0x30')][_0x5e96('0x19')]);}return _0x2ee9f3['getAllConditions'](_0x44d821);}})[_0x5e96('0x22')](function(_0x347249){if(_0x347249){return _0x347249?{'count':_0x16f7cb,'rows':_0x347249}:null;}})[_0x5e96('0x22')](respondWithResult(_0x5f1300,null))['catch'](handleError(_0x5f1300,null));};exports[_0x5e96('0x55')]=function(_0x2c0a16,_0x53c54a,_0x229fc0){var _0x8dc6fd={};var _0x345fdb={};var _0xfe943f;var _0x8c3318;return db[_0x5e96('0x2c')]['findOne']({'where':{'id':_0x2c0a16[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x53c54a,null))[_0x5e96('0x22')](function(_0x1c7163){if(_0x1c7163){_0xfe943f=_0x1c7163;_0x345fdb[_0x5e96('0x35')]=_[_0x5e96('0x31')](db[_0x5e96('0x50')][_0x5e96('0x2d')]);_0x345fdb[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0x2c0a16[_0x5e96('0x30')]);_0x345fdb[_0x5e96('0x32')]=_[_0x5e96('0x34')](_0x345fdb[_0x5e96('0x35')],_0x345fdb[_0x5e96('0x30')]);_0x8dc6fd[_0x5e96('0x33')]=_[_0x5e96('0x34')](_0x345fdb[_0x5e96('0x35')],qs['fields'](_0x2c0a16[_0x5e96('0x30')]['fields']));_0x8dc6fd[_0x5e96('0x33')]=_0x8dc6fd[_0x5e96('0x33')][_0x5e96('0x37')]?_0x8dc6fd[_0x5e96('0x33')]:_0x345fdb[_0x5e96('0x35')];_0x8dc6fd[_0x5e96('0x39')]=qs['sort'](_0x2c0a16[_0x5e96('0x30')][_0x5e96('0x3a')]);_0x8dc6fd[_0x5e96('0x3f')]=qs[_0x5e96('0x32')](_['pick'](_0x2c0a16[_0x5e96('0x30')],_0x345fdb[_0x5e96('0x32')]));if(_0x2c0a16[_0x5e96('0x30')]['filter']){_0x8dc6fd[_0x5e96('0x3f')]=_['merge'](_0x8dc6fd[_0x5e96('0x3f')],{'$or':_[_0x5e96('0x56')](_0x8dc6fd[_0x5e96('0x33')],function(_0x9b2709){var _0x2b1eb8={};_0x2b1eb8[_0x9b2709]={'$like':'%'+_0x2c0a16[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x2b1eb8;})});}_0x8dc6fd=_[_0x5e96('0x3d')]({},_0x8dc6fd,_0x2c0a16['options']);return _0xfe943f[_0x5e96('0x55')](_0x8dc6fd);}})[_0x5e96('0x22')](function(_0xd32155){if(_0xd32155){_0x8c3318=_0xd32155['length'];if(!_0x2c0a16['query'][_0x5e96('0x57')](_0x5e96('0x38'))){_0x8dc6fd['limit']=qs['limit'](_0x2c0a16[_0x5e96('0x30')][_0x5e96('0x1b')]);_0x8dc6fd[_0x5e96('0x19')]=qs[_0x5e96('0x19')](_0x2c0a16[_0x5e96('0x30')]['offset']);}return _0xfe943f[_0x5e96('0x55')](_0x8dc6fd);}})[_0x5e96('0x22')](function(_0x8a6a9c){if(_0x8a6a9c){return _0x8a6a9c?{'count':_0x8c3318,'rows':_0x8a6a9c}:null;}})[_0x5e96('0x22')](respondWithResult(_0x53c54a,null))['catch'](handleError(_0x53c54a,null));};exports[_0x5e96('0x58')]=function(_0x52df95,_0x2f3962,_0x5efa8f){if(_0x52df95[_0x5e96('0x49')]['id']){delete _0x52df95[_0x5e96('0x49')]['id'];}return db[_0x5e96('0x2c')]['find']({'where':{'id':_0x52df95[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x2f3962,null))[_0x5e96('0x22')](function(_0x4a1717){if(_0x4a1717){_0x52df95[_0x5e96('0x49')][_0x5e96('0x59')]=_0x4a1717['id'];return db[_0x5e96('0x5a')][_0x5e96('0x48')](_0x52df95[_0x5e96('0x49')]);}})[_0x5e96('0x22')](respondWithResult(_0x2f3962,null))[_0x5e96('0x43')](handleError(_0x2f3962,null));};exports[_0x5e96('0x5b')]=function(_0x240462,_0x966868,_0x21c64f){var _0x19e40c={};var _0x3f3b6a={};var _0x2c085f;var _0x24be1d;return db[_0x5e96('0x2c')]['findOne']({'where':{'id':_0x240462['params']['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x966868,null))['then'](function(_0xf1a4e5){if(_0xf1a4e5){_0x2c085f=_0xf1a4e5;_0x3f3b6a[_0x5e96('0x35')]=_[_0x5e96('0x31')](db['Action'][_0x5e96('0x2d')]);_0x3f3b6a[_0x5e96('0x30')]=_['keys'](_0x240462[_0x5e96('0x30')]);_0x3f3b6a[_0x5e96('0x32')]=_['intersection'](_0x3f3b6a[_0x5e96('0x35')],_0x3f3b6a[_0x5e96('0x30')]);_0x19e40c['attributes']=_[_0x5e96('0x34')](_0x3f3b6a['model'],qs[_0x5e96('0x36')](_0x240462['query'][_0x5e96('0x36')]));_0x19e40c[_0x5e96('0x33')]=_0x19e40c['attributes'][_0x5e96('0x37')]?_0x19e40c[_0x5e96('0x33')]:_0x3f3b6a['model'];_0x19e40c[_0x5e96('0x39')]=qs[_0x5e96('0x3a')](_0x240462['query'][_0x5e96('0x3a')]);_0x19e40c[_0x5e96('0x3f')]=qs[_0x5e96('0x32')](_[_0x5e96('0x3b')](_0x240462[_0x5e96('0x30')],_0x3f3b6a['filters']));if(_0x240462['query']['filter']){_0x19e40c[_0x5e96('0x3f')]=_[_0x5e96('0x3d')](_0x19e40c[_0x5e96('0x3f')],{'$or':_[_0x5e96('0x56')](_0x19e40c[_0x5e96('0x33')],function(_0x4f598b){var _0x236db2={};_0x236db2[_0x4f598b]={'$like':'%'+_0x240462[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x236db2;})});}_0x19e40c=_[_0x5e96('0x3d')]({},_0x19e40c,_0x240462['options']);return _0x2c085f['getActions'](_0x19e40c);}})[_0x5e96('0x22')](function(_0xb2275e){if(_0xb2275e){_0x24be1d=_0xb2275e[_0x5e96('0x37')];if(!_0x240462[_0x5e96('0x30')][_0x5e96('0x57')](_0x5e96('0x38'))){_0x19e40c[_0x5e96('0x1b')]=qs['limit'](_0x240462[_0x5e96('0x30')][_0x5e96('0x1b')]);_0x19e40c[_0x5e96('0x19')]=qs['offset'](_0x240462['query'][_0x5e96('0x19')]);}return _0x2c085f[_0x5e96('0x5b')](_0x19e40c);}})[_0x5e96('0x22')](function(_0x211430){if(_0x211430){return _0x211430?{'count':_0x24be1d,'rows':_0x211430}:null;}})[_0x5e96('0x22')](respondWithResult(_0x966868,null))[_0x5e96('0x43')](handleError(_0x966868,null));}; \ No newline at end of file +var _0x1bb7=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','Triggers','UserProfileResource','end','sendStatus','error','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','pick','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x5a79da,_0x3202b4){var _0x2dd691=function(_0x389ac1){while(--_0x389ac1){_0x5a79da['push'](_0x5a79da['shift']());}};_0x2dd691(++_0x3202b4);}(_0x1bb7,0xb0));var _0x71bb=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1bb7[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0x71bb('0x0'));var rimraf=require(_0x71bb('0x1'));var zipdir=require(_0x71bb('0x2'));var jsonpatch=require(_0x71bb('0x3'));var rp=require(_0x71bb('0x4'));var moment=require('moment');var BPromise=require(_0x71bb('0x5'));var Mustache=require(_0x71bb('0x6'));var util=require(_0x71bb('0x7'));var path=require(_0x71bb('0x8'));var sox=require(_0x71bb('0x9'));var csv=require(_0x71bb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71bb('0xb'));var _=require(_0x71bb('0xc'));var squel=require(_0x71bb('0xd'));var crypto=require(_0x71bb('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x71bb('0xa'));var querystring=require(_0x71bb('0xf'));var Papa=require(_0x71bb('0x10'));var Redis=require(_0x71bb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x71bb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x71bb('0x13'))(_0x71bb('0x14'));var utils=require(_0x71bb('0x15'));var config=require(_0x71bb('0x16'));var licenseUtil=require(_0x71bb('0x17'));var db=require(_0x71bb('0x18'))['db'];function respondWithStatusCode(_0x2fa715,_0x578e2c){_0x578e2c=_0x578e2c||0xcc;return function(_0x2b18d4){if(_0x2b18d4){return _0x2fa715['sendStatus'](_0x578e2c);}return _0x2fa715[_0x71bb('0x19')](_0x578e2c)['end']();};}function respondWithResult(_0x1b3028,_0x564337){_0x564337=_0x564337||0xc8;return function(_0xc033dc){if(_0xc033dc){return _0x1b3028['status'](_0x564337)[_0x71bb('0x1a')](_0xc033dc);}};}function respondWithFilteredResult(_0x354ee4,_0x5e95ab){return function(_0x1c5287){if(_0x1c5287){var _0x5380b6=typeof _0x5e95ab[_0x71bb('0x1b')]===_0x71bb('0x1c')&&typeof _0x5e95ab[_0x71bb('0x1d')]===_0x71bb('0x1c');var _0x301126=_0x1c5287[_0x71bb('0x1e')];var _0x20aad5=_0x5380b6?0x0:_0x5e95ab[_0x71bb('0x1b')];var _0x4d88fc=_0x5380b6?_0x1c5287[_0x71bb('0x1e')]:_0x5e95ab[_0x71bb('0x1b')]+_0x5e95ab[_0x71bb('0x1d')];var _0x5ae2c7;if(_0x4d88fc>=_0x301126){_0x4d88fc=_0x301126;_0x5ae2c7=0xc8;}else{_0x5ae2c7=0xce;}_0x354ee4[_0x71bb('0x19')](_0x5ae2c7);return _0x354ee4[_0x71bb('0x1f')](_0x71bb('0x20'),_0x20aad5+'-'+_0x4d88fc+'/'+_0x301126)[_0x71bb('0x1a')](_0x1c5287);}return null;};}function patchUpdates(_0x12164e){return function(_0x3b227c){try{jsonpatch[_0x71bb('0x21')](_0x3b227c,_0x12164e,!![]);}catch(_0x4998d1){return BPromise[_0x71bb('0x22')](_0x4998d1);}return _0x3b227c[_0x71bb('0x23')]();};}function saveUpdates(_0x5b9278,_0x528abd){return function(_0x4ecbfc){if(_0x4ecbfc){return _0x4ecbfc['update'](_0x5b9278)[_0x71bb('0x24')](function(_0x504145){return _0x504145;});}return null;};}function removeEntity(_0x445390,_0x35b3ff){return function(_0x258e7f){if(_0x258e7f){return _0x258e7f[_0x71bb('0x25')]()[_0x71bb('0x24')](function(){var _0x54025b=_0x258e7f['get']({'plain':!![]});var _0x28821d=_0x71bb('0x26');return db[_0x71bb('0x27')][_0x71bb('0x25')]({'where':{'type':_0x28821d,'resourceId':_0x54025b['id']}})[_0x71bb('0x24')](function(){return _0x258e7f;});})[_0x71bb('0x24')](function(){_0x445390['status'](0xcc)[_0x71bb('0x28')]();});}};}function handleEntityNotFound(_0x4a0cbe,_0x4e96d0){return function(_0x5a9b60){if(!_0x5a9b60){_0x4a0cbe[_0x71bb('0x29')](0x194);}return _0x5a9b60;};}function handleError(_0x70f436,_0x476b7a){_0x476b7a=_0x476b7a||0x1f4;return function(_0x416dfb){logger[_0x71bb('0x2a')](_0x416dfb['stack']);if(_0x416dfb[_0x71bb('0x2b')]){delete _0x416dfb[_0x71bb('0x2b')];}_0x70f436['status'](_0x476b7a)[_0x71bb('0x2c')](_0x416dfb);};}exports[_0x71bb('0x2d')]=function(_0x498ee1,_0x544730){var _0x3584af={},_0x1ac0d7={},_0x467489={'count':0x0,'rows':[]};var _0x27d33b=_[_0x71bb('0x2e')](db[_0x71bb('0x2f')][_0x71bb('0x30')],function(_0x16bb37){return{'name':_0x16bb37[_0x71bb('0x31')],'type':_0x16bb37[_0x71bb('0x32')][_0x71bb('0x33')]};});_0x1ac0d7[_0x71bb('0x34')]=_[_0x71bb('0x2e')](_0x27d33b,_0x71bb('0x2b'));_0x1ac0d7['query']=_[_0x71bb('0x35')](_0x498ee1[_0x71bb('0x36')]);_0x1ac0d7[_0x71bb('0x37')]=_[_0x71bb('0x38')](_0x1ac0d7[_0x71bb('0x34')],_0x1ac0d7[_0x71bb('0x36')]);_0x3584af['attributes']=_[_0x71bb('0x38')](_0x1ac0d7[_0x71bb('0x34')],qs[_0x71bb('0x39')](_0x498ee1[_0x71bb('0x36')][_0x71bb('0x39')]));_0x3584af['attributes']=_0x3584af[_0x71bb('0x3a')][_0x71bb('0x3b')]?_0x3584af[_0x71bb('0x3a')]:_0x1ac0d7['model'];if(!_0x498ee1[_0x71bb('0x36')][_0x71bb('0x3c')](_0x71bb('0x3d'))){_0x3584af['limit']=qs[_0x71bb('0x1d')](_0x498ee1[_0x71bb('0x36')][_0x71bb('0x1d')]);_0x3584af[_0x71bb('0x1b')]=qs[_0x71bb('0x1b')](_0x498ee1[_0x71bb('0x36')][_0x71bb('0x1b')]);}_0x3584af[_0x71bb('0x3e')]=qs[_0x71bb('0x3f')](_0x498ee1[_0x71bb('0x36')][_0x71bb('0x3f')]);_0x3584af[_0x71bb('0x40')]=qs['filters'](_['pick'](_0x498ee1[_0x71bb('0x36')],_0x1ac0d7[_0x71bb('0x37')]),_0x27d33b);if(_0x498ee1[_0x71bb('0x36')]['filter']){_0x3584af['where']=_[_0x71bb('0x41')](_0x3584af['where'],{'$or':_['map'](_0x27d33b,function(_0x5b2f8c){if(_0x5b2f8c[_0x71bb('0x32')]!==_0x71bb('0x42')){var _0x596123={};_0x596123[_0x5b2f8c['name']]={'$like':'%'+_0x498ee1['query'][_0x71bb('0x43')]+'%'};return _0x596123;}})});}_0x3584af=_[_0x71bb('0x41')]({},_0x3584af,_0x498ee1[_0x71bb('0x44')]);var _0x4f87ae={'where':_0x3584af[_0x71bb('0x40')]};return db['Trigger'][_0x71bb('0x1e')](_0x4f87ae)[_0x71bb('0x24')](function(_0x8cecf2){_0x467489[_0x71bb('0x1e')]=_0x8cecf2;if(_0x498ee1['query']['includeAll']){_0x3584af[_0x71bb('0x45')]=[{'all':!![]}];}return db[_0x71bb('0x2f')][_0x71bb('0x46')](_0x3584af);})[_0x71bb('0x24')](function(_0x43bf1f){_0x467489[_0x71bb('0x47')]=_0x43bf1f;return _0x467489;})[_0x71bb('0x24')](respondWithFilteredResult(_0x544730,_0x3584af))[_0x71bb('0x48')](handleError(_0x544730,null));};exports['show']=function(_0x58f417,_0x487099){var _0x12a481={'raw':![],'where':{'id':_0x58f417[_0x71bb('0x49')]['id']}},_0x2a0c77={};_0x2a0c77[_0x71bb('0x34')]=_[_0x71bb('0x35')](db[_0x71bb('0x2f')][_0x71bb('0x30')]);_0x2a0c77[_0x71bb('0x36')]=_['keys'](_0x58f417[_0x71bb('0x36')]);_0x2a0c77['filters']=_['intersection'](_0x2a0c77['model'],_0x2a0c77[_0x71bb('0x36')]);_0x12a481[_0x71bb('0x3a')]=_[_0x71bb('0x38')](_0x2a0c77['model'],qs[_0x71bb('0x39')](_0x58f417['query'][_0x71bb('0x39')]));_0x12a481[_0x71bb('0x3a')]=_0x12a481[_0x71bb('0x3a')][_0x71bb('0x3b')]?_0x12a481[_0x71bb('0x3a')]:_0x2a0c77[_0x71bb('0x34')];if(_0x58f417['query'][_0x71bb('0x4a')]){_0x12a481[_0x71bb('0x45')]=[{'all':!![]}];}_0x12a481=_['merge']({},_0x12a481,_0x58f417[_0x71bb('0x44')]);return db[_0x71bb('0x2f')][_0x71bb('0x4b')](_0x12a481)[_0x71bb('0x24')](handleEntityNotFound(_0x487099,null))['then'](respondWithResult(_0x487099,null))[_0x71bb('0x48')](handleError(_0x487099,null));};exports[_0x71bb('0x4c')]=function(_0x2c6abf,_0x4a9d3b){return db['Trigger'][_0x71bb('0x4c')](_0x2c6abf[_0x71bb('0x4d')],{})[_0x71bb('0x24')](function(_0x71ff2a){var _0x16f880=_0x2c6abf['user'][_0x71bb('0x4e')]({'plain':!![]});if(!_0x16f880)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16f880[_0x71bb('0x4f')]===_0x71bb('0x50')){var _0x17e814=_0x71ff2a[_0x71bb('0x4e')]({'plain':!![]});var _0x500cca='Triggers';return db[_0x71bb('0x51')][_0x71bb('0x4b')]({'where':{'name':_0x500cca,'userProfileId':_0x16f880[_0x71bb('0x52')]},'raw':!![]})[_0x71bb('0x24')](function(_0x1e2e12){if(_0x1e2e12&&_0x1e2e12[_0x71bb('0x53')]===0x0){return db[_0x71bb('0x27')][_0x71bb('0x4c')]({'name':_0x17e814[_0x71bb('0x2b')],'resourceId':_0x17e814['id'],'type':_0x1e2e12['name'],'sectionId':_0x1e2e12['id']},{})[_0x71bb('0x24')](function(){return _0x71ff2a;});}else{return _0x71ff2a;}})[_0x71bb('0x48')](function(_0x41fe56){logger['error'](_0x71bb('0x54'),_0x41fe56);throw _0x41fe56;});}return _0x71ff2a;})[_0x71bb('0x24')](respondWithResult(_0x4a9d3b,0xc9))[_0x71bb('0x48')](handleError(_0x4a9d3b,null));};exports[_0x71bb('0x55')]=function(_0x2c4f9d,_0xcdf1f5){if(_0x2c4f9d[_0x71bb('0x4d')]['id']){delete _0x2c4f9d[_0x71bb('0x4d')]['id'];}return db[_0x71bb('0x2f')][_0x71bb('0x4b')]({'where':{'id':_0x2c4f9d['params']['id']}})[_0x71bb('0x24')](handleEntityNotFound(_0xcdf1f5,null))['then'](saveUpdates(_0x2c4f9d[_0x71bb('0x4d')],null))['then'](respondWithResult(_0xcdf1f5,null))[_0x71bb('0x48')](handleError(_0xcdf1f5,null));};exports[_0x71bb('0x25')]=function(_0x311625,_0x4df106){return db[_0x71bb('0x2f')][_0x71bb('0x4b')]({'where':{'id':_0x311625['params']['id']}})[_0x71bb('0x24')](handleEntityNotFound(_0x4df106,null))['then'](removeEntity(_0x4df106,null))[_0x71bb('0x48')](handleError(_0x4df106,null));};exports[_0x71bb('0x56')]=function(_0x7fed9b,_0x19c29b,_0x143707){if(_0x7fed9b['body']['id']){delete _0x7fed9b[_0x71bb('0x4d')]['id'];}return db[_0x71bb('0x2f')]['find']({'where':{'id':_0x7fed9b[_0x71bb('0x49')]['id']}})['then'](handleEntityNotFound(_0x19c29b,null))[_0x71bb('0x24')](function(_0x29485c){if(_0x29485c){_0x7fed9b['body'][_0x71bb('0x57')]=_0x29485c['id'];return db[_0x71bb('0x58')]['create'](_0x7fed9b[_0x71bb('0x4d')]);}})[_0x71bb('0x24')](respondWithResult(_0x19c29b,null))['catch'](handleError(_0x19c29b,null));};exports[_0x71bb('0x59')]=function(_0x35b406,_0x5c24c9,_0x46be00){if(_0x35b406['body']['id']){delete _0x35b406[_0x71bb('0x4d')]['id'];}return db[_0x71bb('0x2f')]['find']({'where':{'id':_0x35b406[_0x71bb('0x49')]['id']}})[_0x71bb('0x24')](handleEntityNotFound(_0x5c24c9,null))[_0x71bb('0x24')](function(_0x3ea17b){if(_0x3ea17b){_0x35b406['body']['TriggerAnyId']=_0x3ea17b['id'];return db[_0x71bb('0x58')][_0x71bb('0x4c')](_0x35b406[_0x71bb('0x4d')]);}})[_0x71bb('0x24')](respondWithResult(_0x5c24c9,null))[_0x71bb('0x48')](handleError(_0x5c24c9,null));};exports[_0x71bb('0x5a')]=function(_0x479b29,_0x4f230f,_0x1760f2){var _0x2b355f={};var _0xa76d57={};var _0x4c51d4;var _0xe0556e;return db[_0x71bb('0x2f')]['findOne']({'where':{'id':_0x479b29['params']['id']}})[_0x71bb('0x24')](handleEntityNotFound(_0x4f230f,null))[_0x71bb('0x24')](function(_0x49a6a0){if(_0x49a6a0){_0x4c51d4=_0x49a6a0;_0xa76d57[_0x71bb('0x34')]=_[_0x71bb('0x35')](db[_0x71bb('0x58')][_0x71bb('0x30')]);_0xa76d57[_0x71bb('0x36')]=_[_0x71bb('0x35')](_0x479b29[_0x71bb('0x36')]);_0xa76d57['filters']=_[_0x71bb('0x38')](_0xa76d57[_0x71bb('0x34')],_0xa76d57[_0x71bb('0x36')]);_0x2b355f[_0x71bb('0x3a')]=_[_0x71bb('0x38')](_0xa76d57[_0x71bb('0x34')],qs[_0x71bb('0x39')](_0x479b29[_0x71bb('0x36')][_0x71bb('0x39')]));_0x2b355f[_0x71bb('0x3a')]=_0x2b355f['attributes']['length']?_0x2b355f['attributes']:_0xa76d57[_0x71bb('0x34')];_0x2b355f[_0x71bb('0x3e')]=qs[_0x71bb('0x3f')](_0x479b29[_0x71bb('0x36')]['sort']);_0x2b355f[_0x71bb('0x40')]=qs[_0x71bb('0x37')](_[_0x71bb('0x5b')](_0x479b29['query'],_0xa76d57['filters']));if(_0x479b29['query'][_0x71bb('0x43')]){_0x2b355f[_0x71bb('0x40')]=_['merge'](_0x2b355f[_0x71bb('0x40')],{'$or':_[_0x71bb('0x2e')](_0x2b355f[_0x71bb('0x3a')],function(_0x1ccadb){var _0x210e71={};_0x210e71[_0x1ccadb]={'$like':'%'+_0x479b29[_0x71bb('0x36')][_0x71bb('0x43')]+'%'};return _0x210e71;})});}_0x2b355f=_[_0x71bb('0x41')]({},_0x2b355f,_0x479b29[_0x71bb('0x44')]);return _0x4c51d4[_0x71bb('0x5a')](_0x2b355f);}})[_0x71bb('0x24')](function(_0xb13ca0){if(_0xb13ca0){_0xe0556e=_0xb13ca0[_0x71bb('0x3b')];if(!_0x479b29['query']['hasOwnProperty'](_0x71bb('0x3d'))){_0x2b355f[_0x71bb('0x1d')]=qs[_0x71bb('0x1d')](_0x479b29[_0x71bb('0x36')][_0x71bb('0x1d')]);_0x2b355f[_0x71bb('0x1b')]=qs['offset'](_0x479b29[_0x71bb('0x36')]['offset']);}return _0x4c51d4[_0x71bb('0x5a')](_0x2b355f);}})[_0x71bb('0x24')](function(_0x233aae){if(_0x233aae){return _0x233aae?{'count':_0xe0556e,'rows':_0x233aae}:null;}})[_0x71bb('0x24')](respondWithResult(_0x4f230f,null))[_0x71bb('0x48')](handleError(_0x4f230f,null));};exports[_0x71bb('0x5c')]=function(_0xbc457c,_0x590816,_0x149c2a){var _0x336be0={};var _0x7c0e5c={};var _0x9fd870;var _0xf43937;return db['Trigger'][_0x71bb('0x5d')]({'where':{'id':_0xbc457c[_0x71bb('0x49')]['id']}})[_0x71bb('0x24')](handleEntityNotFound(_0x590816,null))['then'](function(_0x1eb8d3){if(_0x1eb8d3){_0x9fd870=_0x1eb8d3;_0x7c0e5c['model']=_['keys'](db[_0x71bb('0x58')]['rawAttributes']);_0x7c0e5c['query']=_['keys'](_0xbc457c[_0x71bb('0x36')]);_0x7c0e5c[_0x71bb('0x37')]=_['intersection'](_0x7c0e5c[_0x71bb('0x34')],_0x7c0e5c[_0x71bb('0x36')]);_0x336be0[_0x71bb('0x3a')]=_[_0x71bb('0x38')](_0x7c0e5c[_0x71bb('0x34')],qs[_0x71bb('0x39')](_0xbc457c[_0x71bb('0x36')][_0x71bb('0x39')]));_0x336be0['attributes']=_0x336be0['attributes']['length']?_0x336be0[_0x71bb('0x3a')]:_0x7c0e5c[_0x71bb('0x34')];_0x336be0[_0x71bb('0x3e')]=qs['sort'](_0xbc457c['query'][_0x71bb('0x3f')]);_0x336be0['where']=qs[_0x71bb('0x37')](_[_0x71bb('0x5b')](_0xbc457c[_0x71bb('0x36')],_0x7c0e5c[_0x71bb('0x37')]));if(_0xbc457c[_0x71bb('0x36')][_0x71bb('0x43')]){_0x336be0[_0x71bb('0x40')]=_[_0x71bb('0x41')](_0x336be0[_0x71bb('0x40')],{'$or':_[_0x71bb('0x2e')](_0x336be0['attributes'],function(_0xd0c11b){var _0x5da3c0={};_0x5da3c0[_0xd0c11b]={'$like':'%'+_0xbc457c[_0x71bb('0x36')][_0x71bb('0x43')]+'%'};return _0x5da3c0;})});}_0x336be0=_[_0x71bb('0x41')]({},_0x336be0,_0xbc457c[_0x71bb('0x44')]);return _0x9fd870['getAnyConditions'](_0x336be0);}})[_0x71bb('0x24')](function(_0x4da561){if(_0x4da561){_0xf43937=_0x4da561[_0x71bb('0x3b')];if(!_0xbc457c[_0x71bb('0x36')][_0x71bb('0x3c')]('nolimit')){_0x336be0[_0x71bb('0x1d')]=qs[_0x71bb('0x1d')](_0xbc457c[_0x71bb('0x36')][_0x71bb('0x1d')]);_0x336be0[_0x71bb('0x1b')]=qs[_0x71bb('0x1b')](_0xbc457c[_0x71bb('0x36')]['offset']);}return _0x9fd870[_0x71bb('0x5c')](_0x336be0);}})['then'](function(_0x324364){if(_0x324364){return _0x324364?{'count':_0xf43937,'rows':_0x324364}:null;}})[_0x71bb('0x24')](respondWithResult(_0x590816,null))[_0x71bb('0x48')](handleError(_0x590816,null));};exports[_0x71bb('0x5e')]=function(_0x45a969,_0x1d10aa,_0x204ea5){if(_0x45a969[_0x71bb('0x4d')]['id']){delete _0x45a969[_0x71bb('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x45a969['params']['id']}})[_0x71bb('0x24')](handleEntityNotFound(_0x1d10aa,null))[_0x71bb('0x24')](function(_0x546fde){if(_0x546fde){_0x45a969[_0x71bb('0x4d')][_0x71bb('0x5f')]=_0x546fde['id'];return db[_0x71bb('0x60')][_0x71bb('0x4c')](_0x45a969[_0x71bb('0x4d')]);}})['then'](respondWithResult(_0x1d10aa,null))[_0x71bb('0x48')](handleError(_0x1d10aa,null));};exports['getActions']=function(_0x5d462e,_0x351f84,_0x3df222){var _0xd5fe47={};var _0xb3b7a6={};var _0x91096c;var _0x5579c7;return db[_0x71bb('0x2f')][_0x71bb('0x5d')]({'where':{'id':_0x5d462e['params']['id']}})[_0x71bb('0x24')](handleEntityNotFound(_0x351f84,null))[_0x71bb('0x24')](function(_0x539758){if(_0x539758){_0x91096c=_0x539758;_0xb3b7a6[_0x71bb('0x34')]=_[_0x71bb('0x35')](db[_0x71bb('0x60')][_0x71bb('0x30')]);_0xb3b7a6[_0x71bb('0x36')]=_['keys'](_0x5d462e['query']);_0xb3b7a6[_0x71bb('0x37')]=_['intersection'](_0xb3b7a6[_0x71bb('0x34')],_0xb3b7a6[_0x71bb('0x36')]);_0xd5fe47[_0x71bb('0x3a')]=_[_0x71bb('0x38')](_0xb3b7a6[_0x71bb('0x34')],qs[_0x71bb('0x39')](_0x5d462e[_0x71bb('0x36')]['fields']));_0xd5fe47[_0x71bb('0x3a')]=_0xd5fe47[_0x71bb('0x3a')]['length']?_0xd5fe47[_0x71bb('0x3a')]:_0xb3b7a6[_0x71bb('0x34')];_0xd5fe47[_0x71bb('0x3e')]=qs[_0x71bb('0x3f')](_0x5d462e[_0x71bb('0x36')][_0x71bb('0x3f')]);_0xd5fe47['where']=qs[_0x71bb('0x37')](_[_0x71bb('0x5b')](_0x5d462e[_0x71bb('0x36')],_0xb3b7a6['filters']));if(_0x5d462e[_0x71bb('0x36')][_0x71bb('0x43')]){_0xd5fe47[_0x71bb('0x40')]=_[_0x71bb('0x41')](_0xd5fe47['where'],{'$or':_[_0x71bb('0x2e')](_0xd5fe47['attributes'],function(_0x1c94e9){var _0x221d37={};_0x221d37[_0x1c94e9]={'$like':'%'+_0x5d462e[_0x71bb('0x36')][_0x71bb('0x43')]+'%'};return _0x221d37;})});}_0xd5fe47=_['merge']({},_0xd5fe47,_0x5d462e['options']);return _0x91096c[_0x71bb('0x61')](_0xd5fe47);}})[_0x71bb('0x24')](function(_0x2fbd07){if(_0x2fbd07){_0x5579c7=_0x2fbd07[_0x71bb('0x3b')];if(!_0x5d462e[_0x71bb('0x36')]['hasOwnProperty']('nolimit')){_0xd5fe47['limit']=qs[_0x71bb('0x1d')](_0x5d462e[_0x71bb('0x36')][_0x71bb('0x1d')]);_0xd5fe47['offset']=qs[_0x71bb('0x1b')](_0x5d462e[_0x71bb('0x36')][_0x71bb('0x1b')]);}return _0x91096c[_0x71bb('0x61')](_0xd5fe47);}})['then'](function(_0x26b634){if(_0x26b634){return _0x26b634?{'count':_0x5579c7,'rows':_0x26b634}:null;}})[_0x71bb('0x24')](respondWithResult(_0x351f84,null))[_0x71bb('0x48')](handleError(_0x351f84,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 2250c8d..c4239a4 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 _0xd82a=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1c5da6,_0x140669){var _0x2ae01a=function(_0x243b04){while(--_0x243b04){_0x1c5da6['push'](_0x1c5da6['shift']());}};_0x2ae01a(++_0x140669);}(_0xd82a,0xbd));var _0xad82=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xd82a[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var logger=require(_0xad82('0x2'))(_0xad82('0x3'));var moment=require('moment');var BPromise=require(_0xad82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad82('0x5'));var rimraf=require(_0xad82('0x6'));var config=require(_0xad82('0x7'));var attributes=require(_0xad82('0x8'));module[_0xad82('0x9')]=function(_0x19e277,_0x343d52){return _0x19e277[_0xad82('0xa')](_0xad82('0xb'),attributes,{'tableName':_0xad82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x330c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x330c,0x186));var _0xc330=function(_0x527750,_0x3d5910){_0x527750=_0x527750-0x0;var _0x5cb0a1=_0x330c[_0x527750];return _0x5cb0a1;};'use strict';var _=require(_0xc330('0x0'));var util=require(_0xc330('0x1'));var logger=require(_0xc330('0x2'))(_0xc330('0x3'));var moment=require('moment');var BPromise=require(_0xc330('0x4'));var rp=require(_0xc330('0x5'));var fs=require('fs');var path=require(_0xc330('0x6'));var rimraf=require(_0xc330('0x7'));var config=require(_0xc330('0x8'));var attributes=require(_0xc330('0x9'));module['exports']=function(_0x4f49fb,_0x53d0ca){return _0x4f49fb[_0xc330('0xa')](_0xc330('0xb'),attributes,{'tableName':_0xc330('0xc'),'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 711c1d7..bd1060f 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 _0xf737=['debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x2d2844,_0x363974){var _0x142331=function(_0x3e4635){while(--_0x3e4635){_0x2d2844['push'](_0x2d2844['shift']());}};_0x142331(++_0x363974);}(_0xf737,0x7e));var _0x7f73=function(_0x5061ff,_0x314c19){_0x5061ff=_0x5061ff-0x0;var _0x35ba91=_0xf737[_0x5061ff];return _0x35ba91;};'use strict';var _=require(_0x7f73('0x0'));var util=require(_0x7f73('0x1'));var moment=require(_0x7f73('0x2'));var BPromise=require(_0x7f73('0x3'));var rs=require(_0x7f73('0x4'));var fs=require('fs');var Redis=require(_0x7f73('0x5'));var db=require(_0x7f73('0x6'))['db'];var utils=require(_0x7f73('0x7'));var logger=require('../../config/logger')(_0x7f73('0x8'));var config=require('../../config/environment');var jayson=require(_0x7f73('0x9'));var client=jayson[_0x7f73('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335612,_0x4a1198,_0x2a29ae){return new BPromise(function(_0x4f30c1,_0x120230){return client['request'](_0x335612,_0x2a29ae)[_0x7f73('0xb')](function(_0x4585e0){logger['info'](_0x7f73('0xc'),_0x4a1198,_0x7f73('0xd'));logger[_0x7f73('0xe')](_0x7f73('0xf'),_0x4a1198,_0x7f73('0xd'),JSON[_0x7f73('0x10')](_0x4585e0));if(_0x4585e0[_0x7f73('0x11')]){if(_0x4585e0['error'][_0x7f73('0x12')]===0x1f4){logger[_0x7f73('0x11')](_0x7f73('0xc'),_0x4a1198,_0x4585e0['error'][_0x7f73('0x13')]);return _0x120230(_0x4585e0['error'][_0x7f73('0x13')]);}logger[_0x7f73('0x11')](_0x7f73('0xc'),_0x4a1198,_0x4585e0[_0x7f73('0x11')][_0x7f73('0x13')]);return _0x4f30c1(_0x4585e0[_0x7f73('0x11')]['message']);}else{logger[_0x7f73('0x14')](_0x7f73('0xc'),_0x4a1198,_0x7f73('0xd'));_0x4f30c1(_0x4585e0[_0x7f73('0x15')][_0x7f73('0x13')]);}})[_0x7f73('0x16')](function(_0x1c2791){logger[_0x7f73('0x11')]('Trigger,\x20%s,\x20%s',_0x4a1198,_0x1c2791);_0x120230(_0x1c2791);});});}exports[_0x7f73('0x17')]=function(_0x4d5627){var _0x2dfa84=this;return new Promise(function(_0x439dc5,_0x32f9d6){return db['Trigger'][_0x7f73('0x18')]({'raw':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1b')]||null:null,'attributes':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1c')]||null:null,'limit':_0x4d5627['options']?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1d')]||null:null,'include':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1e')],function(_0x119d13){return{'model':db[_0x119d13[_0x7f73('0x20')]],'as':_0x119d13['as'],'attributes':_0x119d13[_0x7f73('0x1c')],'include':_0x119d13[_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x119d13[_0x7f73('0x1e')],function(_0x597fba){return{'model':db[_0x597fba['model']],'as':_0x597fba['as'],'attributes':_0x597fba[_0x7f73('0x1c')],'include':_0x597fba[_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x597fba[_0x7f73('0x1e')],function(_0x5c92d4){return{'model':db[_0x5c92d4[_0x7f73('0x20')]],'as':_0x5c92d4['as'],'attributes':_0x5c92d4[_0x7f73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7f73('0xb')](function(_0x122b4f){logger[_0x7f73('0x14')]('GetTrigger',_0x4d5627);logger[_0x7f73('0xe')](_0x7f73('0x17'),_0x4d5627,JSON[_0x7f73('0x10')](_0x122b4f));_0x439dc5(_0x122b4f);})[_0x7f73('0x16')](function(_0x4e60ed){logger[_0x7f73('0x11')]('GetTrigger',_0x4e60ed[_0x7f73('0x13')],_0x4d5627);_0x32f9d6(_0x2dfa84[_0x7f73('0x11')](0x1f4,_0x4e60ed[_0x7f73('0x13')]));});});};exports[_0x7f73('0x21')]=function(_0x20cbe9){var _0x1c8fd5=this;return new Promise(function(_0x17ed7f,_0x34daf4){return db['Trigger'][_0x7f73('0x22')]({'raw':_0x20cbe9['options']?_0x20cbe9[_0x7f73('0x19')][_0x7f73('0x1a')]===undefined?!![]:![]:!![],'where':_0x20cbe9[_0x7f73('0x19')]?_0x20cbe9[_0x7f73('0x19')][_0x7f73('0x1b')]||null:null,'attributes':_0x20cbe9[_0x7f73('0x19')]?_0x20cbe9[_0x7f73('0x19')]['attributes']||null:null,'include':_0x20cbe9[_0x7f73('0x19')]?_0x20cbe9['options'][_0x7f73('0x1e')]?_['map'](_0x20cbe9[_0x7f73('0x19')][_0x7f73('0x1e')],function(_0x5807f6){return{'model':db[_0x5807f6[_0x7f73('0x20')]],'as':_0x5807f6['as'],'attributes':_0x5807f6[_0x7f73('0x1c')],'include':_0x5807f6[_0x7f73('0x1e')]?_['map'](_0x5807f6['include'],function(_0x564455){return{'model':db[_0x564455[_0x7f73('0x20')]],'as':_0x564455['as'],'attributes':_0x564455[_0x7f73('0x1c')],'include':_0x564455[_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x564455[_0x7f73('0x1e')],function(_0x322f3c){return{'model':db[_0x322f3c['model']],'as':_0x322f3c['as'],'attributes':_0x322f3c[_0x7f73('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a9f10){logger['info'](_0x7f73('0x21'),_0x20cbe9);logger['debug'](_0x7f73('0x21'),_0x20cbe9,JSON[_0x7f73('0x10')](_0x3a9f10));_0x17ed7f(_0x3a9f10);})['catch'](function(_0x3bf29c){logger[_0x7f73('0x11')](_0x7f73('0x21'),_0x3bf29c['message'],_0x20cbe9);_0x34daf4(_0x1c8fd5[_0x7f73('0x11')](0x1f4,_0x3bf29c[_0x7f73('0x13')]));});});}; \ No newline at end of file +var _0x8589=['then','find','where','ShowTrigger','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','attributes','map','model','include'];(function(_0x1c9cc1,_0x801358){var _0x536ef3=function(_0x272e32){while(--_0x272e32){_0x1c9cc1['push'](_0x1c9cc1['shift']());}};_0x536ef3(++_0x801358);}(_0x8589,0x136));var _0x9858=function(_0x35ac1a,_0x3533af){_0x35ac1a=_0x35ac1a-0x0;var _0x2117e2=_0x8589[_0x35ac1a];return _0x2117e2;};'use strict';var _=require(_0x9858('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9858('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9858('0x3'));var logger=require(_0x9858('0x4'))(_0x9858('0x5'));var config=require(_0x9858('0x6'));var jayson=require(_0x9858('0x7'));var client=jayson['client'][_0x9858('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb82ab7,_0x270e70,_0x6cc0ff){return new BPromise(function(_0x232b56,_0x4bd2f6){return client[_0x9858('0x9')](_0xb82ab7,_0x6cc0ff)['then'](function(_0x1de886){logger[_0x9858('0xa')]('Trigger,\x20%s,\x20%s',_0x270e70,_0x9858('0xb'));logger[_0x9858('0xc')](_0x9858('0xd'),_0x270e70,_0x9858('0xb'),JSON[_0x9858('0xe')](_0x1de886));if(_0x1de886[_0x9858('0xf')]){if(_0x1de886[_0x9858('0xf')][_0x9858('0x10')]===0x1f4){logger['error'](_0x9858('0x11'),_0x270e70,_0x1de886[_0x9858('0xf')][_0x9858('0x12')]);return _0x4bd2f6(_0x1de886['error']['message']);}logger[_0x9858('0xf')]('Trigger,\x20%s,\x20%s',_0x270e70,_0x1de886[_0x9858('0xf')][_0x9858('0x12')]);return _0x232b56(_0x1de886[_0x9858('0xf')][_0x9858('0x12')]);}else{logger[_0x9858('0xa')](_0x9858('0x11'),_0x270e70,_0x9858('0xb'));_0x232b56(_0x1de886[_0x9858('0x13')]['message']);}})[_0x9858('0x14')](function(_0x27d6c8){logger[_0x9858('0xf')](_0x9858('0x11'),_0x270e70,_0x27d6c8);_0x4bd2f6(_0x27d6c8);});});}exports[_0x9858('0x15')]=function(_0x1bd03c){var _0x57cab2=this;return new Promise(function(_0x56ac8d,_0x5b6983){return db[_0x9858('0x16')][_0x9858('0x17')]({'raw':_0x1bd03c[_0x9858('0x18')]?_0x1bd03c[_0x9858('0x18')][_0x9858('0x19')]===undefined?!![]:![]:!![],'where':_0x1bd03c[_0x9858('0x18')]?_0x1bd03c['options']['where']||null:null,'attributes':_0x1bd03c['options']?_0x1bd03c['options'][_0x9858('0x1a')]||null:null,'limit':_0x1bd03c[_0x9858('0x18')]?_0x1bd03c[_0x9858('0x18')]['limit']||null:null,'include':_0x1bd03c[_0x9858('0x18')]?_0x1bd03c['options']['include']?_[_0x9858('0x1b')](_0x1bd03c[_0x9858('0x18')]['include'],function(_0x124c37){return{'model':db[_0x124c37[_0x9858('0x1c')]],'as':_0x124c37['as'],'attributes':_0x124c37[_0x9858('0x1a')],'include':_0x124c37[_0x9858('0x1d')]?_[_0x9858('0x1b')](_0x124c37['include'],function(_0x4ef274){return{'model':db[_0x4ef274[_0x9858('0x1c')]],'as':_0x4ef274['as'],'attributes':_0x4ef274['attributes'],'include':_0x4ef274[_0x9858('0x1d')]?_['map'](_0x4ef274[_0x9858('0x1d')],function(_0xf0db48){return{'model':db[_0xf0db48[_0x9858('0x1c')]],'as':_0xf0db48['as'],'attributes':_0xf0db48['attributes']};}):[]};}):[]};}):[]:[]})[_0x9858('0x1e')](function(_0xa59dbf){logger['info'](_0x9858('0x15'),_0x1bd03c);logger[_0x9858('0xc')]('GetTrigger',_0x1bd03c,JSON[_0x9858('0xe')](_0xa59dbf));_0x56ac8d(_0xa59dbf);})['catch'](function(_0x2ed53a){logger['error'](_0x9858('0x15'),_0x2ed53a[_0x9858('0x12')],_0x1bd03c);_0x5b6983(_0x57cab2[_0x9858('0xf')](0x1f4,_0x2ed53a['message']));});});};exports['ShowTrigger']=function(_0xc251f){var _0x54f97a=this;return new Promise(function(_0x166cc9,_0x40212d){return db[_0x9858('0x16')][_0x9858('0x1f')]({'raw':_0xc251f['options']?_0xc251f[_0x9858('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xc251f['options']?_0xc251f[_0x9858('0x18')][_0x9858('0x20')]||null:null,'attributes':_0xc251f[_0x9858('0x18')]?_0xc251f[_0x9858('0x18')][_0x9858('0x1a')]||null:null,'include':_0xc251f[_0x9858('0x18')]?_0xc251f[_0x9858('0x18')]['include']?_[_0x9858('0x1b')](_0xc251f['options'][_0x9858('0x1d')],function(_0x2e9311){return{'model':db[_0x2e9311[_0x9858('0x1c')]],'as':_0x2e9311['as'],'attributes':_0x2e9311[_0x9858('0x1a')],'include':_0x2e9311[_0x9858('0x1d')]?_[_0x9858('0x1b')](_0x2e9311['include'],function(_0x447498){return{'model':db[_0x447498['model']],'as':_0x447498['as'],'attributes':_0x447498[_0x9858('0x1a')],'include':_0x447498[_0x9858('0x1d')]?_['map'](_0x447498[_0x9858('0x1d')],function(_0x161bc1){return{'model':db[_0x161bc1[_0x9858('0x1c')]],'as':_0x161bc1['as'],'attributes':_0x161bc1[_0x9858('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9858('0x1e')](function(_0x4162b7){logger[_0x9858('0xa')](_0x9858('0x21'),_0xc251f);logger[_0x9858('0xc')](_0x9858('0x21'),_0xc251f,JSON[_0x9858('0xe')](_0x4162b7));_0x166cc9(_0x4162b7);})['catch'](function(_0x2aca8f){logger[_0x9858('0xf')](_0x9858('0x21'),_0x2aca8f[_0x9858('0x12')],_0xc251f);_0x40212d(_0x54f97a[_0x9858('0xf')](0x1f4,_0x2aca8f[_0x9858('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 7921c04..c4a2402 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 _0x9a8c=['put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','index','/:id','isAuthenticated','show','/:id/clone','clone','post','create'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x9a8c,0xd4));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc9a8('0x0'));var util=require(_0xc9a8('0x1'));var path=require(_0xc9a8('0x2'));var timeout=require(_0xc9a8('0x3'));var express=require(_0xc9a8('0x4'));var router=express[_0xc9a8('0x5')]();var fs_extra=require(_0xc9a8('0x6'));var auth=require(_0xc9a8('0x7'));var interaction=require(_0xc9a8('0x8'));var config=require('../../config/environment');var controller=require(_0xc9a8('0x9'));router[_0xc9a8('0xa')]('/',auth['isAuthenticated'](),controller[_0xc9a8('0xb')]);router[_0xc9a8('0xa')](_0xc9a8('0xc'),auth[_0xc9a8('0xd')](),controller[_0xc9a8('0xe')]);router['post'](_0xc9a8('0xf'),auth[_0xc9a8('0xd')](),controller[_0xc9a8('0x10')]);router[_0xc9a8('0x11')]('/',auth[_0xc9a8('0xd')](),controller[_0xc9a8('0x12')]);router[_0xc9a8('0x13')](_0xc9a8('0xc'),auth[_0xc9a8('0xd')](),controller['update']);router['delete'](_0xc9a8('0xc'),auth[_0xc9a8('0xd')](),controller['destroy']);module[_0xc9a8('0x14')]=router; \ No newline at end of file +var _0x03fc=['util','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','/:id/clone','clone','update','/:id','destroy','exports','multer'];(function(_0x21c955,_0x5ce475){var _0x340d8d=function(_0x2d298b){while(--_0x2d298b){_0x21c955['push'](_0x21c955['shift']());}};_0x340d8d(++_0x5ce475);}(_0x03fc,0xa9));var _0xc03f=function(_0x19c37a,_0x26827a){_0x19c37a=_0x19c37a-0x0;var _0x38fae9=_0x03fc[_0x19c37a];return _0x38fae9;};'use strict';var multer=require(_0xc03f('0x0'));var util=require(_0xc03f('0x1'));var path=require(_0xc03f('0x2'));var timeout=require(_0xc03f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc03f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc03f('0x5'));var controller=require('./trunk.controller');router[_0xc03f('0x6')]('/',auth[_0xc03f('0x7')](),controller[_0xc03f('0x8')]);router[_0xc03f('0x6')]('/:id',auth[_0xc03f('0x7')](),controller[_0xc03f('0x9')]);router[_0xc03f('0xa')](_0xc03f('0xb'),auth['isAuthenticated'](),controller[_0xc03f('0xc')]);router['post']('/',auth[_0xc03f('0x7')](),controller['create']);router['put']('/:id',auth[_0xc03f('0x7')](),controller[_0xc03f('0xd')]);router['delete'](_0xc03f('0xe'),auth[_0xc03f('0x7')](),controller[_0xc03f('0xf')]);module[_0xc03f('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 943b0e4..c6cbc80 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 _0x5429=['update','outgoing','yes','force_rport,comedia','join','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','dynamic','nonat','update,nonat','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5429,0x88));var _0x9542=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x5429[_0x1793de];return _0x4f0309;};'use strict';var Sequelize=require('sequelize');module[_0x9542('0x0')]={'name':{'type':Sequelize[_0x9542('0x1')],'allowNull':![],'unique':_0x9542('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x4'),'user',_0x9542('0x5')),'allowNull':![],'defaultValue':_0x9542('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9542('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x9542('0x7'),_0x9542('0x8'),_0x9542('0x9'),_0x9542('0xa'),_0x9542('0xb'),_0x9542('0xc'),_0x9542('0xd'),_0x9542('0xe'))},'deny':{'type':Sequelize[_0x9542('0x1')]},'permit':{'type':Sequelize[_0x9542('0x1')]},'secret':{'type':Sequelize[_0x9542('0x1')]},'md5secret':{'type':Sequelize[_0x9542('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0xf'),'set':function(_0x5149be){this[_0x9542('0x10')](_0x9542('0x11'),_0x5149be?_0x5149be['join'](','):null);},'get':function(){return this[_0x9542('0x12')](_0x9542('0x11'))?this['getDataValue'](_0x9542('0x11'))[_0x9542('0x13')](','):null;},'comment':_0x9542('0x14')},'dtmfmode':{'type':Sequelize[_0x9542('0x3')]('rfc2833',_0x9542('0x15'),_0x9542('0x16'),_0x9542('0x17'),_0x9542('0x18')),'defaultValue':_0x9542('0x19')},'directmedia':{'type':Sequelize[_0x9542('0x3')]('yes','no','nonat',_0x9542('0x1a'),_0x9542('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9542('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x1d'),'set':function(_0x4d52f6){this[_0x9542('0x10')]('nat',_0x4d52f6?_0x4d52f6[_0x9542('0x1e')](','):null);},'get':function(){return this['getDataValue'](_0x9542('0x1f'))?this[_0x9542('0x12')](_0x9542('0x1f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x9542('0x1')]},'namedcallgroup':{'type':Sequelize[_0x9542('0x1')]},'pickupgroup':{'type':Sequelize[_0x9542('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x9542('0x1')]},'language':{'type':Sequelize[_0x9542('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9542('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x20')},'allow':{'type':Sequelize[_0x9542('0x1')],'allowNull':![],'defaultValue':_0x9542('0x21'),'set':function(_0x46e6f7){this[_0x9542('0x10')]('allow',_0x46e6f7?_0x46e6f7[_0x9542('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9542('0x12')]('allow')?this[_0x9542('0x12')](_0x9542('0x22'))['split'](';'):null;},'comment':_0x9542('0x23')},'autoframing':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'insecure':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x24'),'set':function(_0x33c853){this['setDataValue'](_0x9542('0x25'),_0x33c853?_0x33c853[_0x9542('0x1e')](','):null);},'get':function(){return this[_0x9542('0x12')](_0x9542('0x25'))?this[_0x9542('0x12')](_0x9542('0x25'))[_0x9542('0x13')](','):null;},'comment':_0x9542('0x26')},'trustrpid':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no',_0x9542('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'useclientcode':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x9542('0x28')](0xb)},'setvar':{'type':Sequelize[_0x9542('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9542('0x1')]},'callcounter':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x9542('0x28')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'allowtransfer':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0x9542('0x1')]},'template':{'type':Sequelize[_0x9542('0x1')]},'videosupport':{'type':Sequelize[_0x9542('0x3')]('yes','no',_0x9542('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9542('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'mailbox':{'type':Sequelize[_0x9542('0x1')]},'session_timers':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x2a'),_0x9542('0x2b'),_0x9542('0x2c'))},'session_expires':{'type':Sequelize[_0x9542('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x9542('0x28')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x9542('0x2d'),'uas'),'defaultValue':_0x9542('0x2e')},'t38pt_usertpsource':{'type':Sequelize[_0x9542('0x1')]},'regexten':{'type':Sequelize[_0x9542('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x9542('0x1')]},'port':{'type':Sequelize[_0x9542('0x28')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9542('0x1c')},'keepalive':{'type':Sequelize[_0x9542('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x9542('0x1')]},'rtptimeout':{'type':Sequelize[_0x9542('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9542('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9542('0x1')]},'callbackextension':{'type':Sequelize[_0x9542('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x9542('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9542('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x9542('0x1')]},'contactdeny':{'type':Sequelize[_0x9542('0x1')]},'contactacl':{'type':Sequelize[_0x9542('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9542('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x9542('0x28')](0xb)},'encryption':{'type':Sequelize[_0x9542('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'icesupport':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no',_0x9542('0x2f'),_0x9542('0x30'))},'dtlsrekey':{'type':Sequelize[_0x9542('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9542('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x9542('0x1')]},'dtlscapath':{'type':Sequelize[_0x9542('0x1')]},'dtlssetup':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x31'),'passive',_0x9542('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9542('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9542('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9542('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x9542('0x1')]},'mohsuggest':{'type':Sequelize[_0x9542('0x1')]},'parkinglot':{'type':Sequelize[_0x9542('0x1')]},'description':{'type':Sequelize[_0x9542('0x1')]},'host':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x33')},'canreinvite':{'type':Sequelize[_0x9542('0x3')]('yes','no',_0x9542('0x34'),_0x9542('0x1a'),_0x9542('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x9542('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xe8e5=['insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','dynamic','nonat','update,nonat','sequelize','exports','STRING','name','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','info','inband','auto','rfc2833','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'];(function(_0x37987d,_0x3edc27){var _0x283598=function(_0xe73459){while(--_0xe73459){_0x37987d['push'](_0x37987d['shift']());}};_0x283598(++_0x3edc27);}(_0xe8e5,0x72));var _0x5e8e=function(_0x4ff99e,_0xd5074d){_0x4ff99e=_0x4ff99e-0x0;var _0x555e38=_0xe8e5[_0x4ff99e];return _0x555e38;};'use strict';var Sequelize=require(_0x5e8e('0x0'));module[_0x5e8e('0x1')]={'name':{'type':Sequelize[_0x5e8e('0x2')],'allowNull':![],'unique':_0x5e8e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x5e8e('0x4'),_0x5e8e('0x5'),_0x5e8e('0x6')),'allowNull':![],'defaultValue':_0x5e8e('0x4')},'context':{'type':Sequelize[_0x5e8e('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x5e8e('0x7'),'ALLOWED_PASSED_SCREEN',_0x5e8e('0x8'),_0x5e8e('0x9'),_0x5e8e('0xa'),'PROHIB_PASSED_SCREEN',_0x5e8e('0xb'),_0x5e8e('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x5e8e('0x2')]},'secret':{'type':Sequelize[_0x5e8e('0x2')]},'md5secret':{'type':Sequelize[_0x5e8e('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x5e8e('0x2')],'defaultValue':_0x5e8e('0xd'),'set':function(_0x5723bb){this[_0x5e8e('0xe')]('transport',_0x5723bb?_0x5723bb['join'](','):null);},'get':function(){return this[_0x5e8e('0xf')]('transport')?this[_0x5e8e('0xf')](_0x5e8e('0x10'))[_0x5e8e('0x11')](','):null;},'comment':_0x5e8e('0x12')},'dtmfmode':{'type':Sequelize[_0x5e8e('0x13')]('rfc2833',_0x5e8e('0x14'),'shortinfo',_0x5e8e('0x15'),_0x5e8e('0x16')),'defaultValue':_0x5e8e('0x17')},'directmedia':{'type':Sequelize[_0x5e8e('0x13')]('yes','no','nonat',_0x5e8e('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x5e8e('0x2')]},'nat':{'type':Sequelize[_0x5e8e('0x2')],'defaultValue':_0x5e8e('0x1a'),'set':function(_0x4fa9d7){this[_0x5e8e('0xe')]('nat',_0x4fa9d7?_0x4fa9d7['join'](','):null);},'get':function(){return this[_0x5e8e('0xf')](_0x5e8e('0x1b'))?this['getDataValue'](_0x5e8e('0x1b'))[_0x5e8e('0x11')](','):null;},'comment':_0x5e8e('0x1c')},'callgroup':{'type':Sequelize[_0x5e8e('0x2')]},'namedcallgroup':{'type':Sequelize[_0x5e8e('0x2')]},'pickupgroup':{'type':Sequelize[_0x5e8e('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5e8e('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5e8e('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x5e8e('0x2')],'allowNull':![],'defaultValue':_0x5e8e('0x1d'),'set':function(_0x1ea63e){this[_0x5e8e('0xe')](_0x5e8e('0x1e'),_0x1ea63e?_0x1ea63e[_0x5e8e('0x1f')](';'):_0x5e8e('0x1d'));},'get':function(){return this[_0x5e8e('0xf')]('allow')?this[_0x5e8e('0xf')](_0x5e8e('0x1e'))[_0x5e8e('0x11')](';'):null;},'comment':_0x5e8e('0x20')},'autoframing':{'type':Sequelize['ENUM'](_0x5e8e('0x19'),'no')},'insecure':{'type':Sequelize[_0x5e8e('0x2')],'defaultValue':'port,invite','set':function(_0x38998b){this[_0x5e8e('0xe')](_0x5e8e('0x21'),_0x38998b?_0x38998b['join'](','):null);},'get':function(){return this[_0x5e8e('0xf')](_0x5e8e('0x21'))?this[_0x5e8e('0xf')](_0x5e8e('0x21'))[_0x5e8e('0x11')](','):null;},'comment':_0x5e8e('0x22')},'trustrpid':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no',_0x5e8e('0x23'))},'promiscredir':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'accountcode':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'setvar':{'type':Sequelize[_0x5e8e('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x5e8e('0x2')]},'callcounter':{'type':Sequelize[_0x5e8e('0x13')]('yes','no'),'defaultValue':_0x5e8e('0x19')},'busylevel':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x5e8e('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no',_0x5e8e('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5e8e('0x13')]('yes','no')},'mailbox':{'type':Sequelize[_0x5e8e('0x2')]},'session_timers':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x26'),_0x5e8e('0x27'),_0x5e8e('0x28'))},'session_expires':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x5e8e('0x29'),_0x5e8e('0x2a')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x5e8e('0x2')]},'regexten':{'type':Sequelize[_0x5e8e('0x2')]},'fromdomain':{'type':Sequelize[_0x5e8e('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x5e8e('0x24')](0x5)},'qualify':{'type':Sequelize[_0x5e8e('0x13')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x5e8e('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x5e8e('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x5e8e('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x5e8e('0x2')]},'use_q850_reason':{'type':Sequelize[_0x5e8e('0x2')]},'maxforwards':{'type':Sequelize[_0x5e8e('0x24')](0xb)},'encryption':{'type':Sequelize[_0x5e8e('0x13')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x5e8e('0x19'),'no')},'icesupport':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no',_0x5e8e('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x5e8e('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x5e8e('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x5e8e('0x2')]},'dtlscapath':{'type':Sequelize[_0x5e8e('0x2')]},'dtlssetup':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x2c'),_0x5e8e('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5e8e('0x2')]},'usereqphone':{'type':Sequelize[_0x5e8e('0x13')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5e8e('0x2')]},'recordofffeature':{'type':Sequelize[_0x5e8e('0x2')]},'call_limit':{'type':Sequelize[_0x5e8e('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x5e8e('0x13')]('yes','no')},'vmexten':{'type':Sequelize[_0x5e8e('0x2')]},'mohinterpret':{'type':Sequelize[_0x5e8e('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x5e8e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5e8e('0x2')],'defaultValue':_0x5e8e('0x2e')},'canreinvite':{'type':Sequelize[_0x5e8e('0x13')](_0x5e8e('0x19'),'no',_0x5e8e('0x2f'),_0x5e8e('0x18'),_0x5e8e('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index e0b2172..7ca745f 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 _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x169790,_0x48aa33){var _0x4d0f36=function(_0x2a848d){while(--_0x2a848d){_0x169790['push'](_0x169790['shift']());}};_0x4d0f36(++_0x48aa33);}(_0x84ab,0x12f));var _0xb84a=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x84ab[_0x1e4150];return _0x1ce3ee;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file +var _0x9bde=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0x54f695,_0x17e578){var _0x5d8f73=function(_0x19fdb2){while(--_0x19fdb2){_0x54f695['push'](_0x54f695['shift']());}};_0x5d8f73(++_0x17e578);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4fc2c5,_0xc35235){_0x4fc2c5=_0x4fc2c5-0x0;var _0x591f84=_0x9bde[_0x4fc2c5];return _0x591f84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 51d5c8c..22b6867 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 _0x0442=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','Trunk','util','../../config/logger'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x0442,0x6a));var _0x2044=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x0442[_0x54bac5];return _0xc15971;};'use strict';var _=require('lodash');var util=require(_0x2044('0x0'));var logger=require(_0x2044('0x1'))('api');var moment=require(_0x2044('0x2'));var BPromise=require(_0x2044('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2044('0x4'));var rimraf=require(_0x2044('0x5'));var config=require(_0x2044('0x6'));var attributes=require(_0x2044('0x7'));module['exports']=function(_0x58dcb8,_0x33e918){return _0x58dcb8['define'](_0x2044('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6c5=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0xf1402a,_0x187f5c){var _0x4f7ead=function(_0x57dfd9){while(--_0x57dfd9){_0xf1402a['push'](_0xf1402a['shift']());}};_0x4f7ead(++_0x187f5c);}(_0xf6c5,0xfa));var _0x5f6c=function(_0x4fedd4,_0x1dbf05){_0x4fedd4=_0x4fedd4-0x0;var _0x5dce0d=_0xf6c5[_0x4fedd4];return _0x5dce0d;};'use strict';var _=require(_0x5f6c('0x0'));var util=require(_0x5f6c('0x1'));var logger=require(_0x5f6c('0x2'))(_0x5f6c('0x3'));var moment=require(_0x5f6c('0x4'));var BPromise=require(_0x5f6c('0x5'));var rp=require(_0x5f6c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f6c('0x7'));var config=require(_0x5f6c('0x8'));var attributes=require(_0x5f6c('0x9'));module[_0x5f6c('0xa')]=function(_0x59a38a,_0xc4fd35){return _0x59a38a[_0x5f6c('0xb')](_0x5f6c('0xc'),attributes,{'tableName':_0x5f6c('0xd'),'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 dcb85aa..4f83c3c 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 _0xa38a=['http','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','findAll','options','attributes','limit','map','include','model','GetTrunk','stringify','ShowTrunk','Trunk','find','raw','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b632d,_0x1d4a51){var _0x57ffdd=function(_0x56fcaa){while(--_0x56fcaa){_0x2b632d['push'](_0x2b632d['shift']());}};_0x57ffdd(++_0x1d4a51);}(_0xa38a,0x142));var _0xaa38=function(_0x47507e,_0x9a8323){_0x47507e=_0x47507e-0x0;var _0x5c66eb=_0xa38a[_0x47507e];return _0x5c66eb;};'use strict';var _=require(_0xaa38('0x0'));var util=require(_0xaa38('0x1'));var moment=require(_0xaa38('0x2'));var BPromise=require(_0xaa38('0x3'));var rs=require(_0xaa38('0x4'));var fs=require('fs');var Redis=require(_0xaa38('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa38('0x6'));var logger=require(_0xaa38('0x7'))(_0xaa38('0x8'));var config=require(_0xaa38('0x9'));var jayson=require(_0xaa38('0xa'));var client=jayson['client'][_0xaa38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a6ed8,_0x3d1a1a,_0x2433f2){return new BPromise(function(_0x987ce,_0x401b27){return client['request'](_0x2a6ed8,_0x2433f2)['then'](function(_0x4501d4){logger[_0xaa38('0xc')](_0xaa38('0xd'),_0x3d1a1a,'request\x20sent');logger[_0xaa38('0xe')](_0xaa38('0xf'),_0x3d1a1a,_0xaa38('0x10'),JSON['stringify'](_0x4501d4));if(_0x4501d4[_0xaa38('0x11')]){if(_0x4501d4[_0xaa38('0x11')][_0xaa38('0x12')]===0x1f4){logger[_0xaa38('0x11')](_0xaa38('0xd'),_0x3d1a1a,_0x4501d4[_0xaa38('0x11')]['message']);return _0x401b27(_0x4501d4[_0xaa38('0x11')]['message']);}logger[_0xaa38('0x11')](_0xaa38('0xd'),_0x3d1a1a,_0x4501d4[_0xaa38('0x11')][_0xaa38('0x13')]);return _0x987ce(_0x4501d4[_0xaa38('0x11')][_0xaa38('0x13')]);}else{logger['info'](_0xaa38('0xd'),_0x3d1a1a,_0xaa38('0x10'));_0x987ce(_0x4501d4[_0xaa38('0x14')][_0xaa38('0x13')]);}})[_0xaa38('0x15')](function(_0x4e5fb3){logger[_0xaa38('0x11')](_0xaa38('0xd'),_0x3d1a1a,_0x4e5fb3);_0x401b27(_0x4e5fb3);});});}exports['GetTrunk']=function(_0x4babe2){var _0x57bd33=this;return new Promise(function(_0x1f0eed,_0x848226){return db['Trunk'][_0xaa38('0x16')]({'raw':_0x4babe2[_0xaa38('0x17')]?_0x4babe2['options']['raw']===undefined?!![]:![]:!![],'where':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')]['where']||null:null,'attributes':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')][_0xaa38('0x18')]||null:null,'limit':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')][_0xaa38('0x19')]||null:null,'include':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')]['include']?_[_0xaa38('0x1a')](_0x4babe2[_0xaa38('0x17')][_0xaa38('0x1b')],function(_0x361762){return{'model':db[_0x361762[_0xaa38('0x1c')]],'as':_0x361762['as'],'attributes':_0x361762[_0xaa38('0x18')],'include':_0x361762[_0xaa38('0x1b')]?_['map'](_0x361762[_0xaa38('0x1b')],function(_0x47b4ad){return{'model':db[_0x47b4ad[_0xaa38('0x1c')]],'as':_0x47b4ad['as'],'attributes':_0x47b4ad[_0xaa38('0x18')],'include':_0x47b4ad[_0xaa38('0x1b')]?_[_0xaa38('0x1a')](_0x47b4ad['include'],function(_0x548711){return{'model':db[_0x548711[_0xaa38('0x1c')]],'as':_0x548711['as'],'attributes':_0x548711[_0xaa38('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38c999){logger[_0xaa38('0xc')](_0xaa38('0x1d'),_0x4babe2);logger[_0xaa38('0xe')](_0xaa38('0x1d'),_0x4babe2,JSON[_0xaa38('0x1e')](_0x38c999));_0x1f0eed(_0x38c999);})[_0xaa38('0x15')](function(_0x8f3200){logger[_0xaa38('0x11')](_0xaa38('0x1d'),_0x8f3200[_0xaa38('0x13')],_0x4babe2);_0x848226(_0x57bd33[_0xaa38('0x11')](0x1f4,_0x8f3200[_0xaa38('0x13')]));});});};exports[_0xaa38('0x1f')]=function(_0x2fc42c){var _0x20deee=this;return new Promise(function(_0x3fd0fc,_0x49546f){return db[_0xaa38('0x20')][_0xaa38('0x21')]({'raw':_0x2fc42c[_0xaa38('0x17')]?_0x2fc42c[_0xaa38('0x17')][_0xaa38('0x22')]===undefined?!![]:![]:!![],'where':_0x2fc42c[_0xaa38('0x17')]?_0x2fc42c['options'][_0xaa38('0x23')]||null:null,'attributes':_0x2fc42c['options']?_0x2fc42c['options'][_0xaa38('0x18')]||null:null,'include':_0x2fc42c[_0xaa38('0x17')]?_0x2fc42c[_0xaa38('0x17')]['include']?_[_0xaa38('0x1a')](_0x2fc42c['options']['include'],function(_0x2b4a4){return{'model':db[_0x2b4a4[_0xaa38('0x1c')]],'as':_0x2b4a4['as'],'attributes':_0x2b4a4[_0xaa38('0x18')],'include':_0x2b4a4['include']?_[_0xaa38('0x1a')](_0x2b4a4['include'],function(_0x33ae3f){return{'model':db[_0x33ae3f[_0xaa38('0x1c')]],'as':_0x33ae3f['as'],'attributes':_0x33ae3f[_0xaa38('0x18')],'include':_0x33ae3f['include']?_[_0xaa38('0x1a')](_0x33ae3f['include'],function(_0x2e60c1){return{'model':db[_0x2e60c1[_0xaa38('0x1c')]],'as':_0x2e60c1['as'],'attributes':_0x2e60c1[_0xaa38('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaa38('0x24')](function(_0x4e3e32){logger[_0xaa38('0xc')](_0xaa38('0x1f'),_0x2fc42c);logger['debug'](_0xaa38('0x1f'),_0x2fc42c,JSON[_0xaa38('0x1e')](_0x4e3e32));_0x3fd0fc(_0x4e3e32);})[_0xaa38('0x15')](function(_0x338e7c){logger[_0xaa38('0x11')](_0xaa38('0x1f'),_0x338e7c[_0xaa38('0x13')],_0x2fc42c);_0x49546f(_0x20deee[_0xaa38('0x11')](0x1f4,_0x338e7c[_0xaa38('0x13')]));});});}; \ No newline at end of file +var _0xa9d6=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','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','findAll','options','raw','where','include','map','model','attributes','GetTrunk','catch','ShowTrunk','Trunk','find'];(function(_0x443628,_0x4006da){var _0x54f580=function(_0x51e3c5){while(--_0x51e3c5){_0x443628['push'](_0x443628['shift']());}};_0x54f580(++_0x4006da);}(_0xa9d6,0x128));var _0x6a9d=function(_0x4656a8,_0x20ed69){_0x4656a8=_0x4656a8-0x0;var _0x69357e=_0xa9d6[_0x4656a8];return _0x69357e;};'use strict';var _=require(_0x6a9d('0x0'));var util=require('util');var moment=require(_0x6a9d('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a9d('0x2'));var fs=require('fs');var Redis=require(_0x6a9d('0x3'));var db=require(_0x6a9d('0x4'))['db'];var utils=require(_0x6a9d('0x5'));var logger=require(_0x6a9d('0x6'))(_0x6a9d('0x7'));var config=require(_0x6a9d('0x8'));var jayson=require(_0x6a9d('0x9'));var client=jayson[_0x6a9d('0xa')][_0x6a9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f33d1,_0x258093,_0x400c58){return new BPromise(function(_0x4145e7,_0x5926e8){return client[_0x6a9d('0xc')](_0x5f33d1,_0x400c58)[_0x6a9d('0xd')](function(_0x1e8b99){logger[_0x6a9d('0xe')](_0x6a9d('0xf'),_0x258093,_0x6a9d('0x10'));logger[_0x6a9d('0x11')](_0x6a9d('0x12'),_0x258093,_0x6a9d('0x10'),JSON[_0x6a9d('0x13')](_0x1e8b99));if(_0x1e8b99['error']){if(_0x1e8b99[_0x6a9d('0x14')][_0x6a9d('0x15')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x258093,_0x1e8b99[_0x6a9d('0x14')][_0x6a9d('0x16')]);return _0x5926e8(_0x1e8b99[_0x6a9d('0x14')][_0x6a9d('0x16')]);}logger[_0x6a9d('0x14')](_0x6a9d('0xf'),_0x258093,_0x1e8b99[_0x6a9d('0x14')][_0x6a9d('0x16')]);return _0x4145e7(_0x1e8b99[_0x6a9d('0x14')][_0x6a9d('0x16')]);}else{logger[_0x6a9d('0xe')](_0x6a9d('0xf'),_0x258093,'request\x20sent');_0x4145e7(_0x1e8b99[_0x6a9d('0x17')][_0x6a9d('0x16')]);}})['catch'](function(_0x4f8b43){logger[_0x6a9d('0x14')]('Trunk,\x20%s,\x20%s',_0x258093,_0x4f8b43);_0x5926e8(_0x4f8b43);});});}exports['GetTrunk']=function(_0x4d64fc){var _0x5af1d4=this;return new Promise(function(_0xce8692,_0x24ce8b){return db['Trunk'][_0x6a9d('0x18')]({'raw':_0x4d64fc[_0x6a9d('0x19')]?_0x4d64fc[_0x6a9d('0x19')][_0x6a9d('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d64fc[_0x6a9d('0x19')]?_0x4d64fc[_0x6a9d('0x19')][_0x6a9d('0x1b')]||null:null,'attributes':_0x4d64fc[_0x6a9d('0x19')]?_0x4d64fc[_0x6a9d('0x19')]['attributes']||null:null,'limit':_0x4d64fc['options']?_0x4d64fc[_0x6a9d('0x19')]['limit']||null:null,'include':_0x4d64fc['options']?_0x4d64fc[_0x6a9d('0x19')][_0x6a9d('0x1c')]?_[_0x6a9d('0x1d')](_0x4d64fc[_0x6a9d('0x19')][_0x6a9d('0x1c')],function(_0x2f5a87){return{'model':db[_0x2f5a87[_0x6a9d('0x1e')]],'as':_0x2f5a87['as'],'attributes':_0x2f5a87['attributes'],'include':_0x2f5a87['include']?_['map'](_0x2f5a87[_0x6a9d('0x1c')],function(_0x13c14a){return{'model':db[_0x13c14a[_0x6a9d('0x1e')]],'as':_0x13c14a['as'],'attributes':_0x13c14a['attributes'],'include':_0x13c14a[_0x6a9d('0x1c')]?_[_0x6a9d('0x1d')](_0x13c14a[_0x6a9d('0x1c')],function(_0x182ada){return{'model':db[_0x182ada['model']],'as':_0x182ada['as'],'attributes':_0x182ada[_0x6a9d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6a9d('0xd')](function(_0x36b3d6){logger[_0x6a9d('0xe')](_0x6a9d('0x20'),_0x4d64fc);logger['debug'](_0x6a9d('0x20'),_0x4d64fc,JSON[_0x6a9d('0x13')](_0x36b3d6));_0xce8692(_0x36b3d6);})[_0x6a9d('0x21')](function(_0x1d9fd9){logger[_0x6a9d('0x14')](_0x6a9d('0x20'),_0x1d9fd9[_0x6a9d('0x16')],_0x4d64fc);_0x24ce8b(_0x5af1d4['error'](0x1f4,_0x1d9fd9[_0x6a9d('0x16')]));});});};exports[_0x6a9d('0x22')]=function(_0x4bd73d){var _0x3c48ac=this;return new Promise(function(_0x4e2a4e,_0x2d2db1){return db[_0x6a9d('0x23')][_0x6a9d('0x24')]({'raw':_0x4bd73d[_0x6a9d('0x19')]?_0x4bd73d[_0x6a9d('0x19')][_0x6a9d('0x1a')]===undefined?!![]:![]:!![],'where':_0x4bd73d[_0x6a9d('0x19')]?_0x4bd73d[_0x6a9d('0x19')][_0x6a9d('0x1b')]||null:null,'attributes':_0x4bd73d[_0x6a9d('0x19')]?_0x4bd73d[_0x6a9d('0x19')][_0x6a9d('0x1f')]||null:null,'include':_0x4bd73d[_0x6a9d('0x19')]?_0x4bd73d[_0x6a9d('0x19')][_0x6a9d('0x1c')]?_[_0x6a9d('0x1d')](_0x4bd73d[_0x6a9d('0x19')][_0x6a9d('0x1c')],function(_0x19b1b2){return{'model':db[_0x19b1b2[_0x6a9d('0x1e')]],'as':_0x19b1b2['as'],'attributes':_0x19b1b2[_0x6a9d('0x1f')],'include':_0x19b1b2['include']?_[_0x6a9d('0x1d')](_0x19b1b2[_0x6a9d('0x1c')],function(_0x8a0b41){return{'model':db[_0x8a0b41['model']],'as':_0x8a0b41['as'],'attributes':_0x8a0b41[_0x6a9d('0x1f')],'include':_0x8a0b41[_0x6a9d('0x1c')]?_[_0x6a9d('0x1d')](_0x8a0b41[_0x6a9d('0x1c')],function(_0x5ea785){return{'model':db[_0x5ea785[_0x6a9d('0x1e')]],'as':_0x5ea785['as'],'attributes':_0x5ea785['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a9d('0xd')](function(_0xd3d128){logger[_0x6a9d('0xe')](_0x6a9d('0x22'),_0x4bd73d);logger[_0x6a9d('0x11')](_0x6a9d('0x22'),_0x4bd73d,JSON[_0x6a9d('0x13')](_0xd3d128));_0x4e2a4e(_0xd3d128);})[_0x6a9d('0x21')](function(_0x2f2d7c){logger['error'](_0x6a9d('0x22'),_0x2f2d7c['message'],_0x4bd73d);_0x2d2db1(_0x3c48ac[_0x6a9d('0x14')](0x1f4,_0x2f2d7c[_0x6a9d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 597f706..3a1581d 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 _0x3be7=['./user-setting.controller','put','/:id','isAuthenticated','update','exports'];(function(_0x1ffd0f,_0x4d3c33){var _0x17cbeb=function(_0xbf1daa){while(--_0xbf1daa){_0x1ffd0f['push'](_0x1ffd0f['shift']());}};_0x17cbeb(++_0x4d3c33);}(_0x3be7,0xde));var _0x73be=function(_0x450d94,_0x4706fc){_0x450d94=_0x450d94-0x0;var _0x488ede=_0x3be7[_0x450d94];return _0x488ede;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x73be('0x0'));router[_0x73be('0x1')](_0x73be('0x2'),auth[_0x73be('0x3')](),controller[_0x73be('0x4')]);module[_0x73be('0x5')]=router; \ No newline at end of file +var _0x4dce=['express','Router','./user-setting.controller','put','/:id','isAuthenticated','update','exports'];(function(_0x1d496f,_0x2656c5){var _0x1dc8d9=function(_0x554e6b){while(--_0x554e6b){_0x1d496f['push'](_0x1d496f['shift']());}};_0x1dc8d9(++_0x2656c5);}(_0x4dce,0xf0));var _0xe4dc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4dce[_0x5608a3];return _0x1ed50a;};'use strict';var express=require(_0xe4dc('0x0'));var router=express[_0xe4dc('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe4dc('0x2'));router[_0xe4dc('0x3')](_0xe4dc('0x4'),auth[_0xe4dc('0x5')](),controller[_0xe4dc('0x6')]);module[_0xe4dc('0x7')]=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 1d835a7..f1edb73 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 _0x1f84=['error','warning','info','debug','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x1f84,0x1c1));var _0x41f8=function(_0x5de58a,_0x23d58e){_0x5de58a=_0x5de58a-0x0;var _0x589a6d=_0x1f84[_0x5de58a];return _0x589a6d;};'use strict';var Sequelize=require(_0x41f8('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x41f8('0x1'),_0x41f8('0x2'),_0x41f8('0x3'),_0x41f8('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x41f8('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x41f8('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x41f8('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x41f8('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x41f8('0x8')],'unique':_0x41f8('0x9')}}; \ No newline at end of file +var _0x862e=['BOOLEAN','TEXT','DATE','INTEGER','sequelize','error','info','debug','ENUM'];(function(_0x16ffe2,_0x2f73ed){var _0x4193e5=function(_0x5f0de3){while(--_0x5f0de3){_0x16ffe2['push'](_0x16ffe2['shift']());}};_0x4193e5(++_0x2f73ed);}(_0x862e,0x124));var _0xe862=function(_0x4f8acf,_0x4c723d){_0x4f8acf=_0x4f8acf-0x0;var _0x26b570=_0x862e[_0x4f8acf];return _0x26b570;};'use strict';var Sequelize=require(_0xe862('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xe862('0x1'),'warning',_0xe862('0x2'),_0xe862('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xe862('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xe862('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xe862('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xe862('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xe862('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xe862('0x8')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 59c8383..d02e9ee 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 _0x5bbd=['sendStatus','error','stack','name','send','role','admin','Unauthorized','UserSetting','find','body','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','defaults','status','json','update','then'];(function(_0x200b0e,_0xe7e308){var _0x4fa52c=function(_0x1255da){while(--_0x1255da){_0x200b0e['push'](_0x200b0e['shift']());}};_0x4fa52c(++_0xe7e308);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5bb('0x0'));var Redis=require(_0xd5bb('0x1'));var logger=require(_0xd5bb('0x2'))(_0xd5bb('0x3'));var config=require(_0xd5bb('0x4'));var db=require(_0xd5bb('0x5'))['db'];var socket=require(_0xd5bb('0x6'))(new Redis(config['redis']));require('./user-setting.socket')['register'](socket);config[_0xd5bb('0x7')]=_[_0xd5bb('0x8')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x292873,_0x5093d3){_0x5093d3=_0x5093d3||0xc8;return function(_0x3878ba){if(_0x3878ba){return _0x292873[_0xd5bb('0x9')](_0x5093d3)[_0xd5bb('0xa')](_0x3878ba);}};}function saveUpdates(_0x495934){return function(_0x5187bd){if(_0x5187bd){return _0x5187bd[_0xd5bb('0xb')](_0x495934)[_0xd5bb('0xc')](function(_0xca93ab){return _0xca93ab;});}return null;};}function handleEntityNotFound(_0x4b76af){return function(_0x24349b){if(!_0x24349b){_0x4b76af[_0xd5bb('0xd')](0x194);}return _0x24349b;};}function handleError(_0x408ef2,_0x55a320){_0x55a320=_0x55a320||0x1f4;return function(_0x51705b){logger[_0xd5bb('0xe')](_0x51705b[_0xd5bb('0xf')]);if(_0x51705b['name']){delete _0x51705b[_0xd5bb('0x10')];}_0x408ef2['status'](_0x55a320)[_0xd5bb('0x11')](_0x51705b);};}exports['update']=function(_0x16cc5c,_0x67920e){if(_0x16cc5c['user'][_0xd5bb('0x12')]!==_0xd5bb('0x13'))throw new Error(_0xd5bb('0x14'));if(isNaN(Number(_0x16cc5c['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xd5bb('0x15')][_0xd5bb('0x16')]({'where':{'id':_0x16cc5c['params']['id']}})[_0xd5bb('0xc')](handleEntityNotFound(_0x67920e,null))[_0xd5bb('0xc')](saveUpdates(_0x16cc5c[_0xd5bb('0x17')],null))[_0xd5bb('0xc')](respondWithResult(_0x67920e,null))['catch'](handleError(_0x67920e,null));}; \ No newline at end of file +var _0x50b9=['user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','lodash','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','update','then','sendStatus','stack','status','send'];(function(_0xfed320,_0x519161){var _0x59f578=function(_0x41b7c8){while(--_0x41b7c8){_0xfed320['push'](_0xfed320['shift']());}};_0x59f578(++_0x519161);}(_0x50b9,0x171));var _0x950b=function(_0x35cc99,_0x5bb972){_0x35cc99=_0x35cc99-0x0;var _0x14373c=_0x50b9[_0x35cc99];return _0x14373c;};'use strict';var _=require(_0x950b('0x0'));var Redis=require('ioredis');var logger=require(_0x950b('0x1'))('api');var config=require(_0x950b('0x2'));var db=require(_0x950b('0x3'))['db'];var socket=require(_0x950b('0x4'))(new Redis(config[_0x950b('0x5')]));require(_0x950b('0x6'))[_0x950b('0x7')](socket);config[_0x950b('0x5')]=_[_0x950b('0x8')](config[_0x950b('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x26ff96,_0x34133e){_0x34133e=_0x34133e||0xc8;return function(_0x9258eb){if(_0x9258eb){return _0x26ff96['status'](_0x34133e)['json'](_0x9258eb);}};}function saveUpdates(_0x497ba7){return function(_0xd61042){if(_0xd61042){return _0xd61042[_0x950b('0x9')](_0x497ba7)[_0x950b('0xa')](function(_0x4259e2){return _0x4259e2;});}return null;};}function handleEntityNotFound(_0x3ffb3d){return function(_0xe21279){if(!_0xe21279){_0x3ffb3d[_0x950b('0xb')](0x194);}return _0xe21279;};}function handleError(_0x585c89,_0x4651ff){_0x4651ff=_0x4651ff||0x1f4;return function(_0x43b03a){logger['error'](_0x43b03a[_0x950b('0xc')]);if(_0x43b03a['name']){delete _0x43b03a['name'];}_0x585c89[_0x950b('0xd')](_0x4651ff)[_0x950b('0xe')](_0x43b03a);};}exports[_0x950b('0x9')]=function(_0x2c3a91,_0x911121){if(_0x2c3a91[_0x950b('0xf')][_0x950b('0x10')]!==_0x950b('0x11'))throw new Error(_0x950b('0x12'));if(isNaN(Number(_0x2c3a91[_0x950b('0x13')]['id'])))throw new Error(_0x950b('0x14'));return db[_0x950b('0x15')][_0x950b('0x16')]({'where':{'id':_0x2c3a91[_0x950b('0x13')]['id']}})[_0x950b('0xa')](handleEntityNotFound(_0x911121,null))[_0x950b('0xa')](saveUpdates(_0x2c3a91[_0x950b('0x17')],null))[_0x950b('0xa')](respondWithResult(_0x911121,null))['catch'](handleError(_0x911121,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 aac65c2..26d392a 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 _0xf01f=['save','update','remove','emit','hook','exports','UserSetting','setMaxListeners'];(function(_0x3edce4,_0x3c085c){var _0x911b58=function(_0xe39d1a){while(--_0xe39d1a){_0x3edce4['push'](_0x3edce4['shift']());}};_0x911b58(++_0x3c085c);}(_0xf01f,0x1de));var _0xff01=function(_0x2cee69,_0x3add59){_0x2cee69=_0x2cee69-0x0;var _0x370809=_0xf01f[_0x2cee69];return _0x370809;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0xff01('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xff01('0x1')](0x0);var events={'afterCreate':_0xff01('0x2'),'afterUpdate':_0xff01('0x3'),'afterDestroy':_0xff01('0x4')};function emitEvent(_0x298af8){return function(_0x11d756,_0x4eb25a,_0x2b65c3){UserSettingEvents['emit'](_0x298af8+':'+_0x11d756['id'],_0x11d756);UserSettingEvents[_0xff01('0x5')](_0x298af8,_0x11d756);_0x2b65c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xff01('0x6')](e,emitEvent(event));}}module[_0xff01('0x7')]=UserSettingEvents; \ No newline at end of file +var _0x8f3f=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x3e8479,_0x5d70b1){var _0x137d54=function(_0x151903){while(--_0x151903){_0x3e8479['push'](_0x3e8479['shift']());}};_0x137d54(++_0x5d70b1);}(_0x8f3f,0x86));var _0xf8f3=function(_0x55c3e0,_0x57d3b3){_0x55c3e0=_0x55c3e0-0x0;var _0xa6788=_0x8f3f[_0x55c3e0];return _0xa6788;};'use strict';var EventEmitter=require(_0xf8f3('0x0'));var UserSetting=require(_0xf8f3('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xf8f3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf8f3('0x3'),'afterDestroy':_0xf8f3('0x4')};function emitEvent(_0x4a3136){return function(_0x18175a,_0x13c3b1,_0x1e79ea){UserSettingEvents[_0xf8f3('0x5')](_0x4a3136+':'+_0x18175a['id'],_0x18175a);UserSettingEvents[_0xf8f3('0x5')](_0x4a3136,_0x18175a);_0x1e79ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xf8f3('0x6')]=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 41c6d1f..14461b0 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 _0xffaa=['exports','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x476a8c,_0x569ad3){var _0x5af6eb=function(_0x417695){while(--_0x417695){_0x476a8c['push'](_0x476a8c['shift']());}};_0x5af6eb(++_0x569ad3);}(_0xffaa,0x130));var _0xaffa=function(_0x1dc61f,_0x1410d4){_0x1dc61f=_0x1dc61f-0x0;var _0x26198b=_0xffaa[_0x1dc61f];return _0x26198b;};'use strict';var attributes=require(_0xaffa('0x0'));module[_0xaffa('0x1')]=function(_0x2c0e94){return _0x2c0e94['define']('UserSetting',attributes,{'tableName':_0xaffa('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2433d9){if(!_0x2433d9[_0xaffa('0x3')])_0x2433d9[_0xaffa('0x4')]=null;else if(_0x2433d9[_0xaffa('0x4')]===null)_0x2433d9[_0xaffa('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x559a=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x19998f,_0x45b640){var _0x1c3781=function(_0x271d87){while(--_0x271d87){_0x19998f['push'](_0x19998f['shift']());}};_0x1c3781(++_0x45b640);}(_0x559a,0xb3));var _0xa559=function(_0x425ed7,_0x22890f){_0x425ed7=_0x425ed7-0x0;var _0x3bdf21=_0x559a[_0x425ed7];return _0x3bdf21;};'use strict';var attributes=require(_0xa559('0x0'));module[_0xa559('0x1')]=function(_0x4c626e){return _0x4c626e[_0xa559('0x2')](_0xa559('0x3'),attributes,{'tableName':_0xa559('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21cc3a){if(!_0x21cc3a[_0xa559('0x5')])_0x21cc3a[_0xa559('0x6')]=null;else if(_0x21cc3a['clientSideLoggingEnabledSince']===null)_0x21cc3a['clientSideLoggingEnabledSince']=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 b6a9346..6de1925 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 _0xc926=['length','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x57be54,_0x5d087b){var _0x5f5893=function(_0x2342ba){while(--_0x2342ba){_0x57be54['push'](_0x57be54['shift']());}};_0x5f5893(++_0x5d087b);}(_0xc926,0x6f));var _0x6c92=function(_0x3d4b21,_0x4e708b){_0x3d4b21=_0x3d4b21-0x0;var _0x33ebf3=_0xc926[_0x3d4b21];return _0x33ebf3;};'use strict';var UserSettingEvents=require(_0x6c92('0x0'));var events=[_0x6c92('0x1'),_0x6c92('0x2'),_0x6c92('0x3')];function createListener(_0x46d19a,_0x196074){return function(_0x51932){_0x196074[_0x6c92('0x4')](_0x46d19a,_0x51932);if(_0x46d19a===_0x6c92('0x5')){_0x196074[_0x6c92('0x4')](_0x6c92('0x6')+_0x51932[_0x6c92('0x7')],_0x51932);}};}exports[_0x6c92('0x8')]=function(_0x2ff4c7){for(var _0x5ae8bf=0x0,_0x593844=events[_0x6c92('0x9')];_0x5ae8bf<_0x593844;_0x5ae8bf++){var _0x7f7d2=events[_0x5ae8bf];var _0x1e8581=createListener('user-setting:'+_0x7f7d2,_0x2ff4c7);UserSettingEvents['on'](_0x7f7d2,_0x1e8581);}}; \ No newline at end of file +var _0x2e6f=['user-setting:update','user-setting:update:user-','register','length','user-setting:','./user-setting.events','save','remove','update'];(function(_0x5aa023,_0x1cf1d2){var _0x31ceb5=function(_0x40f643){while(--_0x40f643){_0x5aa023['push'](_0x5aa023['shift']());}};_0x31ceb5(++_0x1cf1d2);}(_0x2e6f,0x1d0));var _0xf2e6=function(_0x44ab92,_0x702caa){_0x44ab92=_0x44ab92-0x0;var _0x2982e2=_0x2e6f[_0x44ab92];return _0x2982e2;};'use strict';var UserSettingEvents=require(_0xf2e6('0x0'));var events=[_0xf2e6('0x1'),_0xf2e6('0x2'),_0xf2e6('0x3')];function createListener(_0x5bd285,_0x42af40){return function(_0xe0b642){_0x42af40['emit'](_0x5bd285,_0xe0b642);if(_0x5bd285===_0xf2e6('0x4')){_0x42af40['emit'](_0xf2e6('0x5')+_0xe0b642['UserId'],_0xe0b642);}};}exports[_0xf2e6('0x6')]=function(_0x19fc30){for(var _0x2925b3=0x0,_0x1dd350=events[_0xf2e6('0x7')];_0x2925b3<_0x1dd350;_0x2925b3++){var _0x2968c4=events[_0x2925b3];var _0x427e5f=createListener(_0xf2e6('0x8')+_0x2968c4,_0x19fc30);UserSettingEvents['on'](_0x2968c4,_0x427e5f);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index d8ccd59..5b734d5 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 _0xeea4=['join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','update','put','/:id/password','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','index','get','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getApiKey','addContacts','post','create','/create_many','bulkCreate','addQueues','diskStorage'];(function(_0x1f3246,_0xf1764a){var _0x5487a0=function(_0xcd419a){while(--_0xcd419a){_0x1f3246['push'](_0x1f3246['shift']());}};_0x5487a0(++_0xf1764a);}(_0xeea4,0x19e));var _0x4eea=function(_0x3b8dd8,_0x894728){_0x3b8dd8=_0x3b8dd8-0x0;var _0x4112cd=_0xeea4[_0x3b8dd8];return _0x4112cd;};'use strict';var multer=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var path=require(_0x4eea('0x2'));var timeout=require(_0x4eea('0x3'));var express=require(_0x4eea('0x4'));var router=express[_0x4eea('0x5')]();var fs_extra=require(_0x4eea('0x6'));var auth=require(_0x4eea('0x7'));var interaction=require(_0x4eea('0x8'));var config=require('../../config/environment');var controller=require(_0x4eea('0x9'));router['get']('/',auth[_0x4eea('0xa')](),controller[_0x4eea('0xb')]);router[_0x4eea('0xc')]('/describe',auth[_0x4eea('0xa')](),controller[_0x4eea('0xd')]);router['get'](_0x4eea('0xe'),auth[_0x4eea('0xa')](),controller[_0x4eea('0xf')]);router[_0x4eea('0xc')]('/presence',auth[_0x4eea('0xa')](),controller[_0x4eea('0x10')]);router[_0x4eea('0xc')](_0x4eea('0x11'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x12')]);router[_0x4eea('0xc')](_0x4eea('0x13'),controller[_0x4eea('0x14')]);router[_0x4eea('0xc')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x4eea('0x15')]);router[_0x4eea('0xc')](_0x4eea('0x16'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x17')]);router[_0x4eea('0xc')](_0x4eea('0x18'),auth[_0x4eea('0xa')](),controller['getQueues']);router[_0x4eea('0xc')](_0x4eea('0x19'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x1a')]);router['get'](_0x4eea('0x1b'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x1c')]);router[_0x4eea('0xc')](_0x4eea('0x1d'),auth['isAuthenticated'](),controller[_0x4eea('0x1e')]);router[_0x4eea('0xc')]('/:id/screen_recordings',auth[_0x4eea('0xa')](),controller[_0x4eea('0x1f')]);router[_0x4eea('0xc')](_0x4eea('0x20'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x21')]);router['get'](_0x4eea('0x22'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x23')]);router[_0x4eea('0xc')](_0x4eea('0x24'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x4eea('0xc')]('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x4eea('0xc')](_0x4eea('0x25'),auth['isAuthenticated'](),controller[_0x4eea('0x26')]);router['get'](_0x4eea('0x27'),auth['isAuthenticated'](),controller[_0x4eea('0x28')]);router['get'](_0x4eea('0x29'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x2a')]);router[_0x4eea('0xc')](_0x4eea('0x2b'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x2c')]);router[_0x4eea('0xc')](_0x4eea('0x2d'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x2e')]);router['get']('/:id/prefixes',auth[_0x4eea('0xa')](),controller[_0x4eea('0x2f')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x4eea('0x30')]);router['get'](_0x4eea('0x31'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x32')]);router['get'](_0x4eea('0x33'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x34')]);router['get'](_0x4eea('0x35'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x36')]);router['get']('/:id/chat_websites',auth[_0x4eea('0xa')](),controller[_0x4eea('0x37')]);router['get'](_0x4eea('0x38'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x39')]);router[_0x4eea('0xc')]('/:id/scheduled_calls',auth[_0x4eea('0xa')](),controller['getScheduledCalls']);router[_0x4eea('0xc')]('/:id/api_key',auth[_0x4eea('0xa')](),controller[_0x4eea('0x3a')]);router['post'](_0x4eea('0x16'),auth['isAuthenticated'](),controller[_0x4eea('0x3b')]);router[_0x4eea('0x3c')]('/',auth['isAuthenticated'](),controller[_0x4eea('0x3d')]);router[_0x4eea('0x3c')](_0x4eea('0x3e'),auth['isAuthenticated'](),controller[_0x4eea('0x3f')]);router['post']('/:id/queues',auth[_0x4eea('0xa')](),controller[_0x4eea('0x40')]);var upload=multer({'storage':multer[_0x4eea('0x41')]({'destination':function(_0x4c8dd2,_0x57e9b6,_0x1c66c0){_0x1c66c0(null,path[_0x4eea('0x42')](config[_0x4eea('0x43')],_0x4eea('0x44')));},'filename':function(_0x414552,_0x484d1f,_0x1c877b){_0x1c877b(null,util[_0x4eea('0x45')](_0x4eea('0x46'),Date[_0x4eea('0x47')](),_0x484d1f[_0x4eea('0x48')]));}})});router[_0x4eea('0x3c')](_0x4eea('0x13'),upload[_0x4eea('0x49')](_0x4eea('0x4a')),controller[_0x4eea('0x4b')]);router['post'](_0x4eea('0x4c'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x4d')]);router[_0x4eea('0x3c')]('/:id/logout',auth['isAuthenticated'](),controller[_0x4eea('0x4e')]);router['post'](_0x4eea('0x4f'),auth['isAuthenticated'](),controller[_0x4eea('0x50')]);router[_0x4eea('0x3c')](_0x4eea('0x51'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x52')]);router[_0x4eea('0x3c')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4eea('0x53')]);router[_0x4eea('0x3c')](_0x4eea('0x54'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x55')]);router[_0x4eea('0x3c')](_0x4eea('0x56'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x57')]);router[_0x4eea('0x3c')](_0x4eea('0x58'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x59')]);router['post'](_0x4eea('0x5a'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x5b')]);router[_0x4eea('0x3c')](_0x4eea('0x5c'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x5d')]);router[_0x4eea('0x3c')](_0x4eea('0x5e'),auth[_0x4eea('0xa')](),controller['addWhatsappInteractions']);router['post'](_0x4eea('0x5f'),auth[_0x4eea('0xa')](),controller['addFaxAccounts']);router[_0x4eea('0x3c')](_0x4eea('0x31'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x60')]);router['post'](_0x4eea('0x33'),auth[_0x4eea('0xa')](),controller['addOpenchannelAccounts']);router['post'](_0x4eea('0x35'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x61')]);router['post']('/:id/chat_websites',auth[_0x4eea('0xa')](),controller[_0x4eea('0x62')]);router[_0x4eea('0x3c')]('/:id/whatsapp_accounts',auth[_0x4eea('0xa')](),controller[_0x4eea('0x63')]);router[_0x4eea('0x3c')]('/:id/api_key',auth[_0x4eea('0xa')](),controller[_0x4eea('0x64')]);router['put'](_0x4eea('0x11'),auth['isAuthenticated'](),controller[_0x4eea('0x65')]);router[_0x4eea('0x66')](_0x4eea('0x67'),auth[_0x4eea('0xa')](),controller['changePassword']);router[_0x4eea('0x68')](_0x4eea('0x18'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x69')]);router[_0x4eea('0x68')](_0x4eea('0x29'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x4eea('0x11'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6a')]);router[_0x4eea('0x68')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x4eea('0x6b')]);router[_0x4eea('0x68')](_0x4eea('0x56'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6c')]);router[_0x4eea('0x68')](_0x4eea('0x58'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6d')]);router[_0x4eea('0x68')](_0x4eea('0x5a'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6e')]);router[_0x4eea('0x68')](_0x4eea('0x5c'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6f')]);router[_0x4eea('0x68')]('/:id/whatsapp_interactions',auth[_0x4eea('0xa')](),controller[_0x4eea('0x70')]);router['delete'](_0x4eea('0x5f'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x71')]);router[_0x4eea('0x68')](_0x4eea('0x31'),auth[_0x4eea('0xa')](),controller['removeMailAccounts']);router[_0x4eea('0x68')](_0x4eea('0x33'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x72')]);router[_0x4eea('0x68')](_0x4eea('0x35'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x73')]);router[_0x4eea('0x68')](_0x4eea('0x74'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x75')]);router[_0x4eea('0x68')](_0x4eea('0x38'),auth[_0x4eea('0xa')](),controller['removeWhatsappAccounts']);router[_0x4eea('0x68')]('/:id/api_key',auth[_0x4eea('0xa')](),controller[_0x4eea('0x76')]);module[_0x4eea('0x77')]=router; \ No newline at end of file +var _0x8369=['/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','post','create','/create_many','addQueues','diskStorage','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./user.controller','get','index','isAuthenticated','describe','/whoami','whoami','/presence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts'];(function(_0x5a1fa7,_0x157b60){var _0x1ae7b8=function(_0x1417dd){while(--_0x1417dd){_0x5a1fa7['push'](_0x5a1fa7['shift']());}};_0x1ae7b8(++_0x157b60);}(_0x8369,0x10b));var _0x9836=function(_0x40c03e,_0x18e336){_0x40c03e=_0x40c03e-0x0;var _0x1ef7f4=_0x8369[_0x40c03e];return _0x1ef7f4;};'use strict';var multer=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var path=require(_0x9836('0x2'));var timeout=require(_0x9836('0x3'));var express=require(_0x9836('0x4'));var router=express[_0x9836('0x5')]();var fs_extra=require(_0x9836('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9836('0x7'));var config=require('../../config/environment');var controller=require(_0x9836('0x8'));router[_0x9836('0x9')]('/',auth['isAuthenticated'](),controller[_0x9836('0xa')]);router[_0x9836('0x9')]('/describe',auth[_0x9836('0xb')](),controller[_0x9836('0xc')]);router[_0x9836('0x9')](_0x9836('0xd'),auth['isAuthenticated'](),controller[_0x9836('0xe')]);router[_0x9836('0x9')](_0x9836('0xf'),auth[_0x9836('0xb')](),controller['getPresence']);router[_0x9836('0x9')](_0x9836('0x10'),auth[_0x9836('0xb')](),controller[_0x9836('0x11')]);router[_0x9836('0x9')]('/:id/avatar',controller[_0x9836('0x12')]);router[_0x9836('0x9')](_0x9836('0x13'),auth[_0x9836('0xb')](),controller[_0x9836('0x14')]);router[_0x9836('0x9')](_0x9836('0x15'),auth[_0x9836('0xb')](),controller['getContacts']);router[_0x9836('0x9')](_0x9836('0x16'),auth[_0x9836('0xb')](),controller['getQueues']);router[_0x9836('0x9')]('/:id/queues_rt',auth[_0x9836('0xb')](),controller['getVoiceQueuesRt']);router[_0x9836('0x9')](_0x9836('0x17'),auth[_0x9836('0xb')](),controller[_0x9836('0x18')]);router[_0x9836('0x9')](_0x9836('0x19'),auth['isAuthenticated'](),controller[_0x9836('0x1a')]);router[_0x9836('0x9')]('/:id/screen_recordings',auth[_0x9836('0xb')](),controller[_0x9836('0x1b')]);router[_0x9836('0x9')]('/:id/chat/interactions',auth[_0x9836('0xb')](),controller['getChatInteractions']);router[_0x9836('0x9')](_0x9836('0x1c'),auth[_0x9836('0xb')](),controller[_0x9836('0x1d')]);router[_0x9836('0x9')]('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x9836('0x9')](_0x9836('0x1e'),auth[_0x9836('0xb')](),controller['getSmsInteractions']);router[_0x9836('0x9')](_0x9836('0x1f'),auth[_0x9836('0xb')](),controller[_0x9836('0x20')]);router['get'](_0x9836('0x21'),auth[_0x9836('0xb')](),controller[_0x9836('0x22')]);router[_0x9836('0x9')](_0x9836('0x23'),auth['isAuthenticated'](),controller[_0x9836('0x24')]);router[_0x9836('0x9')]('/:id/lists',auth[_0x9836('0xb')](),controller['getLists']);router[_0x9836('0x9')]('/:id/agents',auth['isAuthenticated'](),controller['getAgents']);router[_0x9836('0x9')](_0x9836('0x25'),auth[_0x9836('0xb')](),controller[_0x9836('0x26')]);router[_0x9836('0x9')](_0x9836('0x27'),auth[_0x9836('0xb')](),controller['getFaxAccounts']);router[_0x9836('0x9')](_0x9836('0x28'),auth[_0x9836('0xb')](),controller[_0x9836('0x29')]);router[_0x9836('0x9')](_0x9836('0x2a'),auth[_0x9836('0xb')](),controller[_0x9836('0x2b')]);router[_0x9836('0x9')]('/:id/sms_accounts',auth[_0x9836('0xb')](),controller[_0x9836('0x2c')]);router[_0x9836('0x9')](_0x9836('0x2d'),auth[_0x9836('0xb')](),controller[_0x9836('0x2e')]);router[_0x9836('0x9')](_0x9836('0x2f'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x9836('0x9')](_0x9836('0x30'),auth[_0x9836('0xb')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0x9836('0xb')](),controller['getApiKey']);router[_0x9836('0x31')](_0x9836('0x15'),auth['isAuthenticated'](),controller['addContacts']);router[_0x9836('0x31')]('/',auth[_0x9836('0xb')](),controller[_0x9836('0x32')]);router[_0x9836('0x31')](_0x9836('0x33'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x9836('0x31')](_0x9836('0x16'),auth[_0x9836('0xb')](),controller[_0x9836('0x34')]);var upload=multer({'storage':multer[_0x9836('0x35')]({'destination':function(_0x32f95e,_0x55e642,_0x2af4a0){_0x2af4a0(null,path['join'](config[_0x9836('0x36')],_0x9836('0x37')));},'filename':function(_0x2674fd,_0x365d14,_0x1ec857){_0x1ec857(null,util[_0x9836('0x38')](_0x9836('0x39'),Date['now'](),_0x365d14[_0x9836('0x3a')]));}})});router[_0x9836('0x31')](_0x9836('0x3b'),upload['single']('file'),controller['addAvatar']);router[_0x9836('0x31')]('/:id/login',auth['isAuthenticated'](),controller[_0x9836('0x3c')]);router[_0x9836('0x31')](_0x9836('0x3d'),auth[_0x9836('0xb')](),controller[_0x9836('0x3e')]);router[_0x9836('0x31')](_0x9836('0x3f'),auth['isAuthenticated'](),controller[_0x9836('0x40')]);router[_0x9836('0x31')](_0x9836('0x41'),auth[_0x9836('0xb')](),controller[_0x9836('0x42')]);router['post'](_0x9836('0x23'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x9836('0x43'),auth[_0x9836('0xb')](),controller[_0x9836('0x44')]);router[_0x9836('0x31')](_0x9836('0x45'),auth[_0x9836('0xb')](),controller['addMailInteractions']);router[_0x9836('0x31')](_0x9836('0x46'),auth[_0x9836('0xb')](),controller[_0x9836('0x47')]);router[_0x9836('0x31')](_0x9836('0x48'),auth[_0x9836('0xb')](),controller[_0x9836('0x49')]);router[_0x9836('0x31')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x9836('0x4a')]);router[_0x9836('0x31')]('/:id/whatsapp_interactions',auth[_0x9836('0xb')](),controller[_0x9836('0x4b')]);router[_0x9836('0x31')](_0x9836('0x27'),auth[_0x9836('0xb')](),controller[_0x9836('0x4c')]);router['post'](_0x9836('0x28'),auth['isAuthenticated'](),controller[_0x9836('0x4d')]);router['post']('/:id/openchannel_accounts',auth[_0x9836('0xb')](),controller['addOpenchannelAccounts']);router[_0x9836('0x31')](_0x9836('0x4e'),auth[_0x9836('0xb')](),controller[_0x9836('0x4f')]);router[_0x9836('0x31')](_0x9836('0x2d'),auth[_0x9836('0xb')](),controller[_0x9836('0x50')]);router[_0x9836('0x31')](_0x9836('0x2f'),auth[_0x9836('0xb')](),controller[_0x9836('0x51')]);router['post'](_0x9836('0x52'),auth[_0x9836('0xb')](),controller[_0x9836('0x53')]);router[_0x9836('0x54')](_0x9836('0x10'),auth['isAuthenticated'](),controller[_0x9836('0x55')]);router['put'](_0x9836('0x56'),auth[_0x9836('0xb')](),controller[_0x9836('0x57')]);router[_0x9836('0x58')]('/:id/queues',auth[_0x9836('0xb')](),controller[_0x9836('0x59')]);router[_0x9836('0x58')](_0x9836('0x23'),auth[_0x9836('0xb')](),controller['removeTeams']);router[_0x9836('0x58')]('/:id',auth[_0x9836('0xb')](),controller[_0x9836('0x5a')]);router[_0x9836('0x58')](_0x9836('0x43'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x9836('0x58')](_0x9836('0x45'),auth[_0x9836('0xb')](),controller['removeMailInteractions']);router[_0x9836('0x58')](_0x9836('0x46'),auth[_0x9836('0xb')](),controller[_0x9836('0x5b')]);router[_0x9836('0x58')](_0x9836('0x48'),auth['isAuthenticated'](),controller[_0x9836('0x5c')]);router[_0x9836('0x58')](_0x9836('0x5d'),auth[_0x9836('0xb')](),controller[_0x9836('0x5e')]);router[_0x9836('0x58')]('/:id/whatsapp_interactions',auth[_0x9836('0xb')](),controller[_0x9836('0x5f')]);router['delete'](_0x9836('0x27'),auth[_0x9836('0xb')](),controller[_0x9836('0x60')]);router['delete'](_0x9836('0x28'),auth[_0x9836('0xb')](),controller[_0x9836('0x61')]);router['delete'](_0x9836('0x2a'),auth[_0x9836('0xb')](),controller[_0x9836('0x62')]);router['delete'](_0x9836('0x4e'),auth[_0x9836('0xb')](),controller[_0x9836('0x63')]);router['delete']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x9836('0x64')]);router['delete'](_0x9836('0x2f'),auth['isAuthenticated'](),controller[_0x9836('0x65')]);router[_0x9836('0x58')]('/:id/api_key',auth[_0x9836('0xb')](),controller['removeApiKey']);module[_0x9836('0x66')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index df560fc..2790474 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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x4ea06e,_0x2db222){var _0x3f340d=function(_0x183e24){while(--_0x183e24){_0x4ea06e['push'](_0x4ea06e['shift']());}};_0x3f340d(++_0x2db222);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0xcb91[_0x27ddf5];return _0x26e74a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x38ee9e,_0x199a70){var _0x122919=function(_0x2630d2){while(--_0x2630d2){_0x38ee9e['push'](_0x38ee9e['shift']());}};_0x122919(++_0x199a70);}(_0x70e0,0x17b));var _0x070e=function(_0x25afa6,_0x2bf304){_0x25afa6=_0x25afa6-0x0;var _0x4fc555=_0x70e0[_0x25afa6];return _0x4fc555;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index c47b956..4190b36 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 _0x4391=['user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','removeFaxInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gte','$lte','$ne','$eq','$not','$notBetween','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','phone','getApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','teams','queues','inbound','getAgents','flatten','toString','asc','desc','substring','orderBy','result','http','offline','unavailable','ringing','voiceStatus','busy','charAt','toUpperCase','slice','SELECT','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/contacts','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','handleError','socket.io-emitter','./user.socket','redis','defaults','client','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','sendStatus','status','offset','undefined','count','set','json','update','role','emit','get','admin','Agents','agent','Telephones','telephone','filter','ignore','value','find','name','UserProfileResource','destroy','end','stack','User','rawAttributes','map','fieldName','type','key','password','salt','previousPasswords','md5Secret','includes','index','getOptions','where','query','includeAll','userSetting','true','include','UserSetting','attributes','push','rows','openTabs','length','chat','dataValues','sms','fax','mail','all','catch','show','merge','options','whatsapp','body','params','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','mailbox','VoiceMail','fullname','email','permissions','102','103','113','105','107','108','109','100','111','114','115','create','Unauthorized','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','autoAssociation','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','UserProfileSection','findAll','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','Queues','penalty','spread','capitalize','toLowerCase','QueueId','Queue:save','voice','VoiceQueue','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','openchannel','ChatOpenTabs','createdAt','FaxOpenTabs','OpenchannelOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','Tags','color','getQueues','model','keys','Queue','filters','intersection','fields','order','sort','pick','Unknown\x20role','limit','getVoiceQueuesRt','nolimit','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','intrf','user:%s','user:forcelogout','headers','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','Team','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','UserVoicePrefix','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','TeamVoicePrefix','VoicePrefixId','getLists','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions'];(function(_0x4aba64,_0x22b3c5){var _0x428da6=function(_0x1a5379){while(--_0x1a5379){_0x4aba64['push'](_0x4aba64['shift']());}};_0x428da6(++_0x22b3c5);}(_0x4391,0x1f0));var _0x1439=function(_0x1497f0,_0x42f133){_0x1497f0=_0x1497f0-0x0;var _0x1d6c10=_0x4391[_0x1497f0];return _0x1d6c10;};'use strict';var moment=require(_0x1439('0x0'));var util=require('util');var path=require(_0x1439('0x1'));var fs=require('fs');var _=require(_0x1439('0x2'));var squel=require(_0x1439('0x3'));var jayson=require(_0x1439('0x4'));var Redis=require('ioredis');var authService=require(_0x1439('0x5'));var contacts=require(_0x1439('0x6'));var qs=require(_0x1439('0x7'));var logger=require('../../config/logger')(_0x1439('0x8'));var utils=require(_0x1439('0x9'));var config=require(_0x1439('0xa'));var licenseUtil=require(_0x1439('0xb'));var APIBadRequestError=require(_0x1439('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0x1439('0xc'))['APINotFoundError'];var APIHandleError=require(_0x1439('0xc'))[_0x1439('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0x1439('0xe'))(new Redis(config['redis']));require(_0x1439('0xf'))['register'](socket);config[_0x1439('0x10')]=_[_0x1439('0x11')](config[_0x1439('0x10')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0x1439('0x12')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x10bed9,_0x31d24d,_0x1693d7,_0xa20b56){return new Promise(function(_0xf92def,_0x98f370){var _0x3412b2=_0xa20b56||amiClient;return _0x3412b2[_0x1439('0x13')](_0x10bed9,_0x1693d7)[_0x1439('0x14')](function(_0x3df556){logger[_0x1439('0x15')]('User,\x20%s,\x20%s',_0x31d24d,_0x1439('0x16'));logger[_0x1439('0x17')](_0x1439('0x18'),_0x31d24d,'request\x20sent',JSON['stringify'](_0x3df556));if(_0x3df556[_0x1439('0x19')]){if(_0x3df556[_0x1439('0x19')][_0x1439('0x1a')]===0x1f4){logger['error'](_0x1439('0x1b'),_0x31d24d,_0x3df556['error'][_0x1439('0x1c')]);return _0x98f370(_0x3df556[_0x1439('0x19')][_0x1439('0x1c')]);}logger[_0x1439('0x19')]('User,\x20%s,\x20%s',_0x31d24d,_0x3df556[_0x1439('0x19')][_0x1439('0x1c')]);return _0xf92def(_0x3df556[_0x1439('0x19')][_0x1439('0x1c')]);}else{logger[_0x1439('0x15')]('User,\x20%s,\x20%s',_0x31d24d,_0x1439('0x16'));_0xf92def(_0x3df556['result'][_0x1439('0x1c')]);}})['catch'](function(_0x4859d4){logger[_0x1439('0x19')](_0x1439('0x1b'),_0x31d24d,_0x4859d4);_0x98f370(_0x4859d4);});});}function respondWithStatusCode(_0x59e786,_0x387fcf){_0x387fcf=_0x387fcf||0xcc;return function(_0x5e477f){if(_0x5e477f){return _0x59e786[_0x1439('0x1d')](_0x387fcf);}return _0x59e786[_0x1439('0x1e')](_0x387fcf)['end']();};}function respondWithResult(_0x573d8c,_0x24f6f1){_0x24f6f1=_0x24f6f1||0xc8;return function(_0x2c7319){if(_0x2c7319){return _0x573d8c[_0x1439('0x1e')](_0x24f6f1)['json'](_0x2c7319);}};}function respondWithFilteredResult(_0x3a4217,_0x412694){return function(_0x3eb2fa){if(_0x3eb2fa){var _0x59cd0a=typeof _0x412694[_0x1439('0x1f')]==='undefined'&&typeof _0x412694['limit']===_0x1439('0x20');var _0x48721c=_0x3eb2fa[_0x1439('0x21')];var _0x540f06=_0x59cd0a?0x0:_0x412694[_0x1439('0x1f')];var _0x59cebf=_0x59cd0a?_0x3eb2fa[_0x1439('0x21')]:_0x412694[_0x1439('0x1f')]+_0x412694['limit'];var _0x3e988d;if(_0x59cebf>=_0x48721c){_0x59cebf=_0x48721c;_0x3e988d=0xc8;}else{_0x3e988d=0xce;}_0x3a4217[_0x1439('0x1e')](_0x3e988d);return _0x3a4217[_0x1439('0x22')]('Content-Range',_0x540f06+'-'+_0x59cebf+'/'+_0x48721c)[_0x1439('0x23')](_0x3eb2fa);}return null;};}function saveUpdates(_0x49d389){return function(_0x2d29d4){if(_0x2d29d4){return _0x2d29d4[_0x1439('0x24')](_0x49d389)[_0x1439('0x14')](function(_0x58f1ea){if(_0x58f1ea[_0x1439('0x25')]==='agent'){socket[_0x1439('0x26')]('userNotification:recalc:'+_0x58f1ea['id'],_0x58f1ea);}return _0x58f1ea;});}return null;};}function removeEntity(_0x595bc0){return function(_0x286fca){if(_0x286fca){return _0x286fca['destroy']()[_0x1439('0x14')](function(){var _0x4f0575=_0x286fca[_0x1439('0x27')]({'plain':!![]});if(_0x4f0575['role']===_0x1439('0x28'))return;var _0x22bece=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x1439('0x29'),'value':_0x1439('0x2a'),'ignore':![]},{'name':_0x1439('0x2b'),'value':_0x1439('0x2c'),'ignore':![]}];var _0x4751a2=_(_0x22bece)[_0x1439('0x2d')](_0x1439('0x2e'))['map'](_0x1439('0x2f'))[_0x1439('0x2f')]();if(_['includes'](_0x4751a2,_0x4f0575[_0x1439('0x25')])){return;}var _0x325d9=_[_0x1439('0x30')](_0x22bece,['value',_0x4f0575[_0x1439('0x25')]])[_0x1439('0x31')];return db[_0x1439('0x32')][_0x1439('0x33')]({'where':{'type':_0x325d9,'resourceId':_0x4f0575['id']}})['then'](function(){return _0x286fca;});})['then'](function(){_0x595bc0[_0x1439('0x1e')](0xcc)[_0x1439('0x34')]();});}};}function handleEntityNotFound(_0x2cbdb2){return function(_0x27f06f){if(!_0x27f06f){_0x2cbdb2[_0x1439('0x1d')](0x194);}return _0x27f06f;};}function handleError(_0x30e2c1,_0x3860c6){_0x3860c6=_0x3860c6||0x1f4;return function(_0x13a2bb){logger['error'](_0x13a2bb[_0x1439('0x35')]);if(_0x13a2bb[_0x1439('0x31')]){delete _0x13a2bb[_0x1439('0x31')];}_0x30e2c1[_0x1439('0x1e')](_0x3860c6)['send'](_0x13a2bb);};}function getUserAttributes(){return _(db[_0x1439('0x36')][_0x1439('0x37')])[_0x1439('0x38')](function(_0x19de36){return{'name':_0x19de36[_0x1439('0x39')],'type':_0x19de36[_0x1439('0x3a')][_0x1439('0x3b')]};})[_0x1439('0x2d')](function(_0x3402b3){return![_0x1439('0x3c'),_0x1439('0x3d'),_0x1439('0x3e'),'resetPasswordToken','resetPasswordExpires','passwordResetAt',_0x1439('0x3f')][_0x1439('0x40')](_0x3402b3[_0x1439('0x31')]);})['value']();}exports[_0x1439('0x41')]=function(_0x9ac9a9,_0x2d3cdd){var _0x243013={},_0x31ecaf={'count':0x0,'rows':[]};var _0x9a63fe=getUserAttributes();_0x243013=qs[_0x1439('0x42')](_0x9a63fe,_0x9ac9a9);var _0x4fc931={'where':_0x243013[_0x1439('0x43')]};return db[_0x1439('0x36')][_0x1439('0x21')](_0x4fc931)[_0x1439('0x14')](function(_0x4f70f6){_0x31ecaf[_0x1439('0x21')]=_0x4f70f6;if(_0x9ac9a9[_0x1439('0x44')][_0x1439('0x45')]){_0x243013['include']=[{'all':!![]}];}if(_0x9ac9a9[_0x1439('0x44')][_0x1439('0x46')]===_0x1439('0x47')){_0x243013[_0x1439('0x48')]=[{'model':db[_0x1439('0x49')],'as':_0x1439('0x46')}];}if(!_[_0x1439('0x40')](_0x243013[_0x1439('0x4a')],'id')){_0x243013[_0x1439('0x4a')][_0x1439('0x4b')]('id');}return db[_0x1439('0x36')]['findAll'](_0x243013);})['then'](function(_0x573631){_0x31ecaf[_0x1439('0x4c')]=_0x573631;if(_0x9ac9a9['query'][_0x1439('0x4d')]===_0x1439('0x47')){var _0x534256=[];for(var _0x27d3a2=0x0;_0x27d3a2<_0x31ecaf[_0x1439('0x4c')][_0x1439('0x4e')];_0x27d3a2++){_0x534256['push'](get_open_tabs(_0x1439('0x4f'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));_0x534256[_0x1439('0x4b')](get_open_tabs(_0x1439('0x51'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2]['dataValues']));_0x534256[_0x1439('0x4b')](get_open_tabs(_0x1439('0x52'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));_0x534256['push'](get_open_tabs(_0x1439('0x53'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));_0x534256[_0x1439('0x4b')](get_open_tabs('openchannel',_0x31ecaf[_0x1439('0x4c')][_0x27d3a2]['dataValues']));_0x534256[_0x1439('0x4b')](get_open_tabs('whatsapp',_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));}return Promise[_0x1439('0x54')](_0x534256)[_0x1439('0x14')](function(){return _0x31ecaf;});}else{return _0x31ecaf;}})[_0x1439('0x14')](respondWithFilteredResult(_0x2d3cdd,_0x243013))[_0x1439('0x55')](handleError(_0x2d3cdd,null));};exports[_0x1439('0x56')]=function(_0x3e2cb8,_0x5825e1){var _0x5bf800=getUserAttributes();var _0x488a5e=qs[_0x1439('0x42')](_0x5bf800,_0x3e2cb8);if(_0x3e2cb8[_0x1439('0x44')][_0x1439('0x45')]){_0x488a5e['include']=[{'all':!![]}];}if(_0x3e2cb8['query'][_0x1439('0x46')]===_0x1439('0x47')){_0x488a5e['include']=[{'model':db[_0x1439('0x49')],'as':_0x1439('0x46')}];}_0x488a5e=_[_0x1439('0x57')]({},_0x488a5e,_0x3e2cb8[_0x1439('0x58')]);if(!_[_0x1439('0x40')](_0x488a5e['attributes'],'id')){_0x488a5e[_0x1439('0x4a')][_0x1439('0x4b')]('id');}return db[_0x1439('0x36')][_0x1439('0x30')](_0x488a5e)[_0x1439('0x14')](handleEntityNotFound(_0x5825e1,null))[_0x1439('0x14')](function(_0x1d766c){var _0x10cdce=[];values=_0x1d766c;if(_0x3e2cb8[_0x1439('0x44')][_0x1439('0x4d')]==='true'){_0x10cdce['push'](get_open_tabs('chat',_0x1d766c[_0x1439('0x50')]));_0x10cdce['push'](get_open_tabs(_0x1439('0x51'),_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs('openchannel',_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs(_0x1439('0x59'),_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs(_0x1439('0x52'),_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs('mail',_0x1d766c['dataValues']));return Promise[_0x1439('0x54')](_0x10cdce);}else{return values;}})[_0x1439('0x14')](function(){return values;})[_0x1439('0x14')](respondWithResult(_0x5825e1,null))[_0x1439('0x55')](handleError(_0x5825e1,null));};exports['update']=function(_0x302054,_0x35cf37){if(_0x302054['body']['id']){delete _0x302054[_0x1439('0x5a')]['id'];}delete _0x302054[_0x1439('0x5a')][_0x1439('0x25')];return db['User'][_0x1439('0x30')]({'where':{'id':_0x302054[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x35cf37,null))[_0x1439('0x14')](saveUpdates(_0x302054[_0x1439('0x5a')],null))['then'](respondWithResult(_0x35cf37,null))[_0x1439('0x55')](handleError(_0x35cf37,null));};exports[_0x1439('0x5c')]=function(_0x2b0f40,_0x4d5fb0){return db[_0x1439('0x36')][_0x1439('0x5c')]()[_0x1439('0x14')](respondWithResult(_0x4d5fb0,null))[_0x1439('0x55')](handleError(_0x4d5fb0,null));};exports[_0x1439('0x5d')]=function(_0x31ce9c,_0x5c9340){return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x31ce9c['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x5c9340,null))[_0x1439('0x14')](function(_0x233c87){if(_0x233c87){return _0x233c87[_0x1439('0x5d')](_0x31ce9c[_0x1439('0x5a')][_0x1439('0x5e')],_[_0x1439('0x5f')](_0x31ce9c[_0x1439('0x5a')],[_0x1439('0x5e'),'id'])||{});}})[_0x1439('0x14')](respondWithResult(_0x5c9340,null))[_0x1439('0x55')](handleError(_0x5c9340,null));};function validateUser(_0x431ae3){return new Promise(function(_0x50061f,_0x53339d){if(_0x431ae3[_0x1439('0x60')])return _0x50061f(_0x431ae3);return db[_0x1439('0x61')][_0x1439('0x62')](0x1)[_0x1439('0x14')](function(_0x593f6f){if(_0x593f6f[_0x1439('0x63')])authService[_0x1439('0x64')](_0x431ae3['password']);db['User'][_0x1439('0x65')](_0x1439('0x60'))['then'](function(_0x3a522b){if(_[_0x1439('0x66')](_0x3a522b)){_0x431ae3['internal']=_0x593f6f['min_internal']||0x1;return;}if(_[_0x1439('0x66')](_0x593f6f[_0x1439('0x67')])||_0x593f6f[_0x1439('0x67')]===_0x3a522b){_0x431ae3['internal']=_0x3a522b+0x1;return;}if(_0x593f6f[_0x1439('0x67')]>_0x3a522b){_0x431ae3['internal']=_0x593f6f[_0x1439('0x67')];return;}return db[_0x1439('0x68')][_0x1439('0x44')](_0x1439('0x69'),{'type':db[_0x1439('0x68')][_0x1439('0x6a')]['SELECT']})[_0x1439('0x14')](function(_0x23e571){if(_0x23e571&&_0x23e571['length']){for(var _0x5d88ea=0x0,_0x2be12f=_0x23e571[_0x1439('0x4e')];_0x5d88ea<_0x2be12f&&_[_0x1439('0x66')](_0x431ae3['internal']);_0x5d88ea++){if(_0x593f6f['min_internal']<=_0x23e571[_0x5d88ea][_0x1439('0x6b')]){_0x431ae3[_0x1439('0x60')]=_0x23e571[_0x5d88ea]['from'];}else if(_0x593f6f[_0x1439('0x67')]>_0x23e571[_0x5d88ea][_0x1439('0x6b')]&&_0x593f6f['min_internal']<=_0x23e571[_0x5d88ea]['to']){_0x431ae3[_0x1439('0x60')]=_0x593f6f[_0x1439('0x67')];}}}if(_['isNil'](_0x431ae3['internal'])){_0x431ae3['internal']=_0x3a522b+0x1;}return _0x50061f(_0x431ae3);});});})[_0x1439('0x55')](function(_0xe78277){_0x53339d(_0xe78277);});});}function updateUser(_0x3ae9f2){return new Promise(function(_0x351726,_0x2ce298){try{if(_0x3ae9f2['voicemail']){_0x3ae9f2[_0x1439('0x6c')]=_0x3ae9f2[_0x1439('0x60')];_0x3ae9f2[_0x1439('0x6d')]={'mailbox':_0x3ae9f2[_0x1439('0x60')],'password':_0x3ae9f2['password'],'fullname':_0x3ae9f2[_0x1439('0x6e')],'email':_0x3ae9f2[_0x1439('0x6f')]};}if(_0x3ae9f2[_0x1439('0x25')]===_0x1439('0x2a')){if(!_0x3ae9f2['permissions'])_0x3ae9f2[_0x1439('0x70')]=['101',_0x1439('0x71'),_0x1439('0x72'),_0x1439('0x73'),'110','104',_0x1439('0x74'),'106',_0x1439('0x75'),_0x1439('0x76'),_0x1439('0x77'),_0x1439('0x78'),_0x1439('0x79'),_0x1439('0x7a'),_0x1439('0x7b')];}_0x351726(_0x3ae9f2);}catch(_0x212f6c){_0x2ce298(_0x212f6c);}});}exports[_0x1439('0x7c')]=function(_0x2fed20,_0x584db4){if(_0x2fed20['user'][_0x1439('0x25')]===_0x1439('0x2a'))throw new Error(_0x1439('0x7d'));if(_0x2fed20[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x7e')&&_0x2fed20['user'][_0x1439('0x25')]!==_0x1439('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x2fed20[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x28')&&_0x2fed20[_0x1439('0x7e')][_0x1439('0x25')]!=='admin'){throw new Error(_0x1439('0x7f'));}return licenseUtil['checkUserLimits']([_0x2fed20[_0x1439('0x5a')]])[_0x1439('0x14')](function(){return validateUser(_0x2fed20[_0x1439('0x5a')]);})[_0x1439('0x14')](function(_0x1de2db){return updateUser(_0x1de2db)[_0x1439('0x14')](function(_0x314882){if(_0x314882[_0x1439('0x25')]===_0x1439('0x28')){_0x314882[_0x1439('0x80')]=_0x2fed20[_0x1439('0x7e')][_0x1439('0x80')];delete _0x314882[_0x1439('0x81')];}return _0x314882;});})[_0x1439('0x14')](function(_0x4631f8){return db[_0x1439('0x36')][_0x1439('0x7c')](_0x4631f8,{'include':[{'model':db[_0x1439('0x6d')],'as':_0x1439('0x6d')}]});})[_0x1439('0x14')](function(_0x41efe5){if(_0x2fed20[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x7e'))return _0x41efe5;if(_0x2fed20[_0x1439('0x7e')]['role']!==_0x1439('0x7e'))return _0x41efe5;return db['UserProfileSection']['find']({'where':{'name':_0x41efe5[_0x1439('0x25')]===_0x1439('0x2a')?'Agents':_0x1439('0x2b'),'userProfileId':_0x2fed20[_0x1439('0x7e')][_0x1439('0x81')]},'raw':!![]})[_0x1439('0x14')](function(_0x1cc431){if(!_0x1cc431||_0x1cc431[_0x1439('0x82')]!=0x0)return _0x41efe5;return db['UserProfileResource'][_0x1439('0x7c')]({'name':_0x41efe5[_0x1439('0x31')],'resourceId':_0x41efe5['id'],'type':_0x1cc431[_0x1439('0x31')],'sectionId':_0x1cc431['id']},{})[_0x1439('0x14')](function(){return _0x41efe5;});})['catch'](function(_0x1602a7){logger[_0x1439('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1602a7);throw _0x1602a7;});})[_0x1439('0x14')](respondWithResult(_0x584db4,0xc9))[_0x1439('0x55')](handleError(_0x584db4,null));};exports[_0x1439('0x83')]=function(_0x273cd4,_0xef9456){var _0x5a3d73=_0x273cd4['body'];var _0x43d690=[];if(_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]===_0x1439('0x2a'))throw new Error('Unauthorized');if(_['some'](_0x5a3d73,[_0x1439('0x25'),_0x1439('0x7e')])&&_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]!==_0x1439('0x28')){throw new Error(_0x1439('0x84'));}if(_[_0x1439('0x85')](_0x5a3d73,[_0x1439('0x25'),_0x1439('0x28')])&&_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]!=='admin'){throw new Error(_0x1439('0x86'));}return licenseUtil[_0x1439('0x87')](_0x5a3d73)[_0x1439('0x14')](function(){return validateUser(_0x5a3d73[0x0]);})[_0x1439('0x14')](function(){for(var _0x1e4dc4=0x1;_0x1e4dc4<_0x5a3d73[_0x1439('0x4e')];_0x1e4dc4++){var _0x2e066a=_0x5a3d73[_0x1e4dc4-0x1][_0x1439('0x60')];if(!_0x5a3d73[_0x1e4dc4]['internal'])_0x5a3d73[_0x1e4dc4][_0x1439('0x60')]=_0x2e066a+0x1;_0x43d690['push'](validateUser(_0x5a3d73[_0x1e4dc4]));}return Promise['all'](_0x43d690);})['then'](function(){_0x43d690=[];for(var _0x4f1069=0x0;_0x4f1069<_0x5a3d73[_0x1439('0x4e')];_0x4f1069++){_0x43d690['push'](updateUser(_0x5a3d73[_0x4f1069]));}return Promise[_0x1439('0x54')](_0x43d690);})['then'](function(){_0x43d690=_0x5a3d73['map'](function(_0x568416){return db[_0x1439('0x36')][_0x1439('0x7c')](_0x568416,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x1439('0x14')](function(_0x2b8611){_0x568416['id']=_0x2b8611['id'];return _0x568416;});});return Promise[_0x1439('0x54')](_0x43d690);})[_0x1439('0x14')](function(_0x45c662){if(_0x273cd4[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x7e'))return _0x45c662;if(_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]!==_0x1439('0x7e'))return _0x45c662;var _0x6ce3c5=_['some'](_0x45c662,function(_0x2e0db3){return _0x2e0db3[_0x1439('0x25')]===_0x1439('0x2a')||_0x2e0db3[_0x1439('0x25')]===_0x1439('0x2c');});if(!_0x6ce3c5)return _0x45c662;return db[_0x1439('0x88')][_0x1439('0x89')]({'where':{'name':{'$or':[_0x1439('0x29'),_0x1439('0x2b')]},'userProfileId':_0x273cd4[_0x1439('0x7e')][_0x1439('0x81')]},'raw':!![]})['then'](function(_0x34b9ee){if(_[_0x1439('0x8a')](_0x34b9ee)||!_[_0x1439('0x85')](_0x34b9ee,[_0x1439('0x82'),0x0]))return _0x45c662;_0x43d690=[];var _0x4d139f=_(_0x34b9ee)[_0x1439('0x38')](function(_0x239869){if(_0x239869['autoAssociation']===0x1)return;return _0x239869[_0x1439('0x31')]===_0x1439('0x29')?_0x1439('0x2a'):'telephone';})[_0x1439('0x8b')]()['value']();for(var _0x4960f1=0x0;_0x4960f1<_0x45c662[_0x1439('0x4e')];_0x4960f1++){if(!_[_0x1439('0x40')](_0x4d139f,_0x45c662[_0x4960f1][_0x1439('0x25')]))return;var _0x17883e=_0x45c662[_0x4960f1]['role']===_0x1439('0x2a')?_0x1439('0x29'):'Telephones';_0x43d690[_0x1439('0x4b')](db['UserProfileResource'][_0x1439('0x7c')]({'name':_0x45c662[_0x4960f1]['name'],'resourceId':_0x45c662[_0x4960f1]['id'],'type':_0x17883e,'sectionId':_[_0x1439('0x30')](_0x34b9ee,['name',_0x17883e])['id']},{}));}return Promise[_0x1439('0x54')](_0x43d690);});})[_0x1439('0x14')](respondWithResult(_0xef9456,0xc9))['catch'](handleError(_0xef9456,null));};exports[_0x1439('0x8c')]=function(_0xe6c2a9,_0x375dda){if(_0xe6c2a9['body']['id']){delete _0xe6c2a9[_0x1439('0x5a')]['id'];}return db['User']['find']({'where':{'id':_0xe6c2a9['params']['id']}})[_0x1439('0x14')](function(_0x77774){if(!_0x77774)return null;if(_0x77774['id']===_0xe6c2a9[_0x1439('0x7e')]['id']){if(!_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x8d')]||!_0xe6c2a9[_0x1439('0x5a')]['newPassword']){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x90'));}if(!_0x77774[_0x1439('0x91')](_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x8d')])){throw new db['Sequelize'][(_0x1439('0x8f'))](_0x1439('0x92'));}if(_0xe6c2a9[_0x1439('0x5a')]['oldPassword']===_0xe6c2a9['body'][_0x1439('0x93')]){throw new db['Sequelize'][(_0x1439('0x8f'))](_0x1439('0x94'));}}else if(_0xe6c2a9[_0x1439('0x7e')][_0x1439('0x25')]===_0x1439('0x28')){if(!_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x93')]){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x95'));}}else if(_0xe6c2a9['user']['role']===_0x1439('0x7e')){if(!_0xe6c2a9['body']['newPassword']){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x95'));}if(_0x77774['role']!==_0x1439('0x2a')){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x7d'));}}else{throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x7d'));}return _0x77774;})[_0x1439('0x14')](handleEntityNotFound(_0x375dda,null))[_0x1439('0x14')](function(_0xdfe961){return db[_0x1439('0x61')][_0x1439('0x96')]({'attributes':['id','securePassword',_0x1439('0x97'),_0x1439('0x98')]})['then'](function(_0xf607d1){if(_0xf607d1['securePassword'])authService[_0x1439('0x64')](_0xe6c2a9['body'][_0x1439('0x93')]);if(!_0xf607d1['enforcePasswordHistory']||!_0xdfe961[_0x1439('0x3e')])return _0xdfe961;authService['validatePasswordHistory'](_0xe6c2a9['body'][_0x1439('0x93')],_0xdfe961['previousPasswords'],_0xf607d1[_0x1439('0x98')]);return _0xdfe961;})['then'](saveUpdates({'password':_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x93')],'passwordResetAt':_0xe6c2a9['user']['id']==_0xe6c2a9[_0x1439('0x5b')]['id']?moment():null,'previousPasswords':authService[_0x1439('0x99')](_0xe6c2a9[_0x1439('0x5a')]['newPassword'],_0xdfe961['previousPasswords'])},null));})[_0x1439('0x14')](respondWithResult(_0x375dda,null))[_0x1439('0x55')](handleError(_0x375dda,null));};exports[_0x1439('0x9a')]=function(_0x139508,_0x596df){var _0x253866=_0x139508[_0x1439('0x5a')][_0x1439('0x9b')];return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x139508['params']['id']},'attributes':['id',_0x1439('0x31'),_0x1439('0x25'),_0x1439('0x9c'),_0x1439('0x9d'),_0x1439('0x9e'),_0x1439('0x9f')]})[_0x1439('0x14')](handleEntityNotFound(_0x596df,null))[_0x1439('0x14')](function(_0x212526){if(_0x212526){if(!utils[_0x1439('0xa0')](_0x253866)){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xa1'));}return _0x212526['add'+_['capitalize'](_0x253866['toLowerCase']())+_0x1439('0xa2')](_0x139508['body']['ids'],{'penalty':_0x139508['body'][_0x1439('0xa3')]||0x0})[_0x1439('0xa4')](function(_0x5d4a6d){for(var _0x191343=0x0;_0x191343<_0x139508['body'][_0x1439('0x5e')][_0x1439('0x4e')];_0x191343+=0x1){var _0x23d4cc={'UserId':Number(_0x139508['params']['id'])};_0x23d4cc[_[_0x1439('0xa5')](_0x253866[_0x1439('0xa6')]())+_0x1439('0xa7')]=Number(_0x139508['body'][_0x1439('0x5e')][_0x191343]);socket['emit'](_0x1439('0x7e')+_[_0x1439('0xa5')](_0x253866['toLowerCase']())+_0x1439('0xa8'),_0x23d4cc);}return _0x5d4a6d;})[_0x1439('0x14')](function(){if(_0x253866===_0x1439('0xa9')){return db[_0x1439('0xaa')][_0x1439('0x89')]({'where':{'id':_0x139508['body'][_0x1439('0x5e')]||[]},'raw':!![],'attributes':['id',_0x1439('0x31')]});}})['then'](function(_0x2f24f2){var _0x387f3a=_0x212526[_0x1439('0x27')]({'plain':!![]});var _0x476a95=[];if(_0x253866===_0x1439('0xa9')&&_0x387f3a[_0x1439('0x25')]===_0x1439('0x2a')&&_0x387f3a[_0x1439('0x9c')]){for(let _0x4d8424=0x0;_0x4d8424<_0x2f24f2[_0x1439('0x4e')];_0x4d8424+=0x1){_0x476a95[_0x1439('0x4b')]({'membername':_0x387f3a[_0x1439('0x31')],'UserId':_0x387f3a['id'],'queue_name':_0x2f24f2[_0x4d8424][_0x1439('0x31')],'VoiceQueueId':_0x2f24f2[_0x4d8424]['id'],'interface':_[_0x1439('0x66')](_0x387f3a['interface'])?util[_0x1439('0xab')](_0x1439('0xac'),_0x387f3a[_0x1439('0x31')]):_0x387f3a[_0x1439('0x9f')],'paused':_0x387f3a[_0x1439('0x9e')]||![],'penalty':_0x139508['body'][_0x1439('0xa3')]||0x0});}return Promise[_0x1439('0x54')](_0x476a95['map'](function(_0x1ec064){return db[_0x1439('0xad')][_0x1439('0xae')](_0x1ec064);}));}return _0x212526;});}})[_0x1439('0x14')](respondWithStatusCode(_0x596df,null))[_0x1439('0x55')](handleError(_0x596df,null));};exports[_0x1439('0xaf')]=function(_0xce1775,_0x16e904){var _0x176032,_0x51e72a;return db['User'][_0x1439('0x30')]({'where':{'id':_0xce1775[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0x31'),'role']})[_0x1439('0x14')](handleEntityNotFound(_0x16e904,null))[_0x1439('0x14')](function(_0x5230f6){if(_0x5230f6){_0x176032=_0x5230f6;if(!_0xce1775['query'][_0x1439('0x9b')]||!utils[_0x1439('0xa0')](_0xce1775[_0x1439('0x44')]['channel'])){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xa1'));}return _0x5230f6[_0x1439('0xb0')+_[_0x1439('0xa5')](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')][_0x1439('0xa6')]())+_0x1439('0xa2')](_0xce1775[_0x1439('0x44')][_0x1439('0x5e')]);}})[_0x1439('0x14')](function(_0xf58459){if(_['isArray'](_0xce1775[_0x1439('0x44')][_0x1439('0x5e')])){for(var _0x2f2909=0x0;_0x2f2909<_0xce1775[_0x1439('0x44')][_0x1439('0x5e')]['length'];_0x2f2909+=0x1){_0x51e72a={'UserId':Number(_0xce1775[_0x1439('0x5b')]['id'])};_0x51e72a[_['capitalize'](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')][_0x1439('0xa6')]())+_0x1439('0xa7')]=Number(_0xce1775[_0x1439('0x44')][_0x1439('0x5e')][_0x2f2909]);socket[_0x1439('0x26')](_0x1439('0x7e')+_[_0x1439('0xa5')](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')][_0x1439('0xa6')]())+_0x1439('0xb1'),_0x51e72a);}}else{_0x51e72a={'UserId':Number(_0xce1775['params']['id'])};_0x51e72a[_[_0x1439('0xa5')](_0xce1775[_0x1439('0x44')]['channel'][_0x1439('0xa6')]())+_0x1439('0xa7')]=Number(_0xce1775[_0x1439('0x44')][_0x1439('0x5e')]);socket[_0x1439('0x26')](_0x1439('0x7e')+_['capitalize'](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')]['toLowerCase']())+_0x1439('0xb1'),_0x51e72a);}return _0xf58459;})[_0x1439('0x14')](function(){if(_0xce1775['query']['channel']==='voice'){return db[_0x1439('0xad')][_0x1439('0x33')]({'where':{'UserId':_0xce1775['params']['id'],'VoiceQueueId':_0xce1775['query'][_0x1439('0x5e')]},'individualHooks':!![]})[_0x1439('0x14')](function(){return _0x176032;});}return _0x176032;})[_0x1439('0x14')](respondWithStatusCode(_0x16e904,null))[_0x1439('0x55')](handleError(_0x16e904,null));};exports[_0x1439('0xb2')]=function(_0xcd2f8,_0x20a036){_0xcd2f8[_0x1439('0x5a')][_0x1439('0xb3')]=_0xcd2f8[_0x1439('0xb4')][_0x1439('0xb5')];return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0xcd2f8[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x20a036,null))[_0x1439('0x14')](saveUpdates(_0xcd2f8['body'],null))[_0x1439('0x14')](respondWithResult(_0x20a036,null))[_0x1439('0x55')](handleError(_0x20a036,null));};exports[_0x1439('0xb6')]=function(_0x2b0ef9,_0xbcbc9f){var _0x7dc8af=path[_0x1439('0xb7')](config[_0x1439('0xb8')],_0x1439('0xb9'));return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x2b0ef9[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0xb3')],'raw':!![]})[_0x1439('0x14')](handleEntityNotFound(_0xbcbc9f,null))[_0x1439('0x14')](function(_0x22eac8){if(_0x22eac8){if(_[_0x1439('0x66')](_0x22eac8[_0x1439('0xb3')])){return _0xbcbc9f[_0x1439('0xba')](_0x7dc8af);}else{if(!fs['existsSync'](path[_0x1439('0xb7')](config[_0x1439('0xb8')],_0x1439('0xbb'),_0x22eac8[_0x1439('0xb3')]))){return _0xbcbc9f[_0x1439('0xba')](_0x7dc8af);}return _0xbcbc9f[_0x1439('0xba')](path[_0x1439('0xb7')](config[_0x1439('0xb8')],_0x1439('0xbb'),_0x22eac8[_0x1439('0xb3')]));}}})[_0x1439('0x55')](handleError(_0xbcbc9f,null));};exports[_0x1439('0xbc')]=function(_0x377637,_0x130bc3){return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x377637[_0x1439('0x5b')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x130bc3,null))[_0x1439('0x14')](function(_0x22b0c5){var _0x1c0923=[];values=_0x22b0c5[_0x1439('0x50')];_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x4f'),_0x22b0c5['dataValues']));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x51'),_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0xbd'),_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs('whatsapp',_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x52'),_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x53'),_0x22b0c5[_0x1439('0x50')]));return Promise[_0x1439('0x54')](_0x1c0923);})[_0x1439('0x14')](function(_0xbd60d9){if(_0xbd60d9){var _0x43e930=_['map'](values[_0x1439('0xbe')],function(_0x215b99){return{'channel':'CHAT','id':_0x215b99['id'],'createdAt':_0x215b99[_0x1439('0xbf')]};});var _0x48cc67=_['map'](values[_0x1439('0xc0')],function(_0x2c3a7c){return{'channel':'FAX','id':_0x2c3a7c['id'],'createdAt':_0x2c3a7c[_0x1439('0xbf')]};});var _0x5d4e49=_['map'](values[_0x1439('0xc1')],function(_0x22ab51){return{'channel':'OPENCHANNEL','id':_0x22ab51['id'],'createdAt':_0x22ab51[_0x1439('0xbf')]};});var _0x3f8bea=_[_0x1439('0x38')](values['MailOpenTabs'],function(_0x33de10){return{'channel':'MAIL','id':_0x33de10['id'],'createdAt':_0x33de10['createdAt']};});var _0x15081d=_[_0x1439('0x38')](values[_0x1439('0xc2')],function(_0x26ed87){return{'channel':_0x1439('0xc3'),'id':_0x26ed87['id'],'createdAt':_0x26ed87['createdAt']};});var _0xb1952c=_['map'](values[_0x1439('0xc4')],function(_0x419ba8){return{'channel':_0x1439('0xc5'),'id':_0x419ba8['id'],'createdAt':_0x419ba8['createdAt']};});var _0x2270ed=_[_0x1439('0xc6')](_0x43e930,_0x48cc67,_0x5d4e49,_0x3f8bea,_0x15081d,_0xb1952c);var _0x18271d={'count':_0x2270ed['length'],'rows':_0x2270ed};return _0x18271d;}else return null;})[_0x1439('0x14')](respondWithResult(_0x130bc3,null))['catch'](handleError(_0x130bc3,null));};exports[_0x1439('0xc7')]=function(_0x5715b2,_0x55a794){var _0x29a838={};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5715b2[_0x1439('0x5b')]['id']}})['then'](function(_0xd57792){if(!_0xd57792){throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x5715b2[_0x1439('0x5b')]['id']));}return contacts[_0x1439('0x5c')]();})['then'](function(_0x1128dd){_0x5715b2[_0x1439('0x44')][_0x1439('0x36')]=_0x5715b2[_0x1439('0x5b')]['id'];_0x29a838=qs[_0x1439('0x42')](_0x1128dd,_0x5715b2);if(_0x5715b2[_0x1439('0x44')][_0x1439('0xc9')]('includeAll')){_0x29a838['include']=[{'model':db[_0x1439('0xca')],'as':_0x1439('0xcb'),'required':![]},{'model':db[_0x1439('0xcc')],'as':_0x1439('0xcd'),'attributes':['id',_0x1439('0x31'),_0x1439('0xce')],'where':_0x5715b2[_0x1439('0x44')]['tag']?{'id':_0x5715b2[_0x1439('0x44')]['tag']}:undefined,'required':_0x5715b2[_0x1439('0x44')]['tag']?!![]:![]}];}return contacts[_0x1439('0x89')](_0x5715b2[_0x1439('0x44')],_0x5715b2[_0x1439('0x7e')],_0x29a838,_0x1128dd);})[_0x1439('0x14')](respondWithFilteredResult(_0x55a794,_0x29a838))['catch'](APIHandleError(_0x55a794));};exports[_0x1439('0xcf')]=function(_0x30a784,_0xbbceb9){var _0x500370;var _0x577acb={};var _0x569034;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x30a784[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0x31'),_0x1439('0x25')]})[_0x1439('0x14')](handleEntityNotFound(_0xbbceb9,null))['then'](function(_0x499a08){if(!utils[_0x1439('0xa0')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xa1'));}_0x500370=_0x499a08;var _0x4332dc={};_0x4332dc[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_[_0x1439('0xa5')](_0x30a784['query']['channel'])+_0x1439('0xd2')][_0x1439('0x37')]);_0x4332dc['query']=_[_0x1439('0xd1')](_0x30a784[_0x1439('0x44')]);_0x4332dc[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x4332dc[_0x1439('0xd0')],_0x4332dc[_0x1439('0x44')]);_0x577acb[_0x1439('0x4a')]=_['intersection'](_0x4332dc[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x30a784[_0x1439('0x44')]['fields']));_0x577acb['attributes']=_0x577acb[_0x1439('0x4a')]['length']?_0x577acb[_0x1439('0x4a')]:_0x4332dc[_0x1439('0xd0')];_0x577acb[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x30a784[_0x1439('0x44')][_0x1439('0xd7')]);_0x577acb[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x30a784[_0x1439('0x44')],_0x4332dc[_0x1439('0xd3')]));if(_0x30a784['query']['filter']){_0x577acb[_0x1439('0x43')]=_['merge'](_0x577acb['where'],{'$or':_[_0x1439('0x38')](_0x577acb[_0x1439('0x4a')],function(_0x119dc3){var _0x1c971b={};_0x1c971b[_0x119dc3]={'$like':'%'+_0x30a784['query'][_0x1439('0x2d')]+'%'};return _0x1c971b;})});}_0x577acb=_[_0x1439('0x57')]({},_0x577acb,_0x30a784[_0x1439('0x58')]);switch(_0x500370[_0x1439('0x25')]){case'admin':return db[_[_0x1439('0xa5')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+_0x1439('0xd2')][_0x1439('0x89')](_0x577acb);case _0x1439('0x7e'):case _0x1439('0x2a'):return _0x500370[_0x1439('0x27')+_['capitalize'](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+_0x1439('0xa2')](_0x577acb);default:throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xd9'));}})[_0x1439('0x14')](function(_0x149f61){_0x569034=_0x149f61[_0x1439('0x4e')];if(!_0x30a784[_0x1439('0x44')][_0x1439('0xc9')]('nolimit')){_0x577acb[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x30a784[_0x1439('0x44')][_0x1439('0xda')]);_0x577acb[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x30a784[_0x1439('0x44')][_0x1439('0x1f')]);}switch(_0x500370[_0x1439('0x25')]){case _0x1439('0x28'):return db[_[_0x1439('0xa5')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+'Queue'][_0x1439('0x89')](_0x577acb);case'user':case _0x1439('0x2a'):return _0x500370[_0x1439('0x27')+_[_0x1439('0xa5')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+_0x1439('0xa2')](_0x577acb);}})[_0x1439('0x14')](function(_0x2323e0){return{'count':_0x569034,'rows':_0x2323e0};})[_0x1439('0x14')](respondWithResult(_0xbbceb9,null))[_0x1439('0x55')](handleError(_0xbbceb9,null));};exports['getVoiceQueuesRt']=function(_0x54d0bb,_0x4a6fcc){var _0x144d63={};var _0x6dd316={};var _0x16f50d;var _0x273954;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x54d0bb['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x4a6fcc,null))[_0x1439('0x14')](function(_0x5ba89e){if(_0x5ba89e){_0x16f50d=_0x5ba89e;_0x6dd316[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xad')][_0x1439('0x37')]);_0x6dd316[_0x1439('0x44')]=_['keys'](_0x54d0bb[_0x1439('0x44')]);_0x6dd316[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x6dd316[_0x1439('0xd0')],_0x6dd316[_0x1439('0x44')]);_0x144d63[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x6dd316[_0x1439('0xd0')],qs['fields'](_0x54d0bb[_0x1439('0x44')][_0x1439('0xd5')]));_0x144d63['attributes']=_0x144d63[_0x1439('0x4a')]['length']?_0x144d63[_0x1439('0x4a')]:_0x6dd316[_0x1439('0xd0')];_0x144d63[_0x1439('0xd6')]=qs['sort'](_0x54d0bb['query'][_0x1439('0xd7')]);_0x144d63[_0x1439('0x43')]=qs['filters'](_[_0x1439('0xd8')](_0x54d0bb['query'],_0x6dd316[_0x1439('0xd3')]));if(_0x54d0bb[_0x1439('0x44')]['filter']){_0x144d63['where']=_[_0x1439('0x57')](_0x144d63['where'],{'$or':_[_0x1439('0x38')](_0x144d63[_0x1439('0x4a')],function(_0x4a1a0c){var _0x450bc2={};_0x450bc2[_0x4a1a0c]={'$like':'%'+_0x54d0bb[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x450bc2;})});}_0x144d63=_[_0x1439('0x57')]({},_0x144d63,_0x54d0bb[_0x1439('0x58')]);return _0x16f50d[_0x1439('0xdb')](_0x144d63);}})[_0x1439('0x14')](function(_0xa28e52){if(_0xa28e52){_0x273954=_0xa28e52[_0x1439('0x4e')];if(!_0x54d0bb['query'][_0x1439('0xc9')](_0x1439('0xdc'))){_0x144d63[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x54d0bb[_0x1439('0x44')][_0x1439('0xda')]);_0x144d63[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x54d0bb[_0x1439('0x44')]['offset']);}return _0x16f50d[_0x1439('0xdb')](_0x144d63);}})[_0x1439('0x14')](function(_0x14f5b4){if(_0x14f5b4){return _0x14f5b4?{'count':_0x273954,'rows':_0x14f5b4}:null;}})[_0x1439('0x14')](respondWithResult(_0x4a6fcc,null))[_0x1439('0x55')](handleError(_0x4a6fcc,null));};exports[_0x1439('0xdd')]=function(_0x445710,_0x4c5b90){var _0xbcacbc={};var _0x29d738={};var _0x1f91ca;var _0x4f6e2b;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x445710[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x4c5b90,null))[_0x1439('0x14')](function(_0x375244){if(_0x375244){_0x1f91ca=_0x375244;_0x29d738[_0x1439('0xd0')]=_['keys'](db['ChatGroup'][_0x1439('0x37')]);_0x29d738['query']=_[_0x1439('0xd1')](_0x445710[_0x1439('0x44')]);_0x29d738['filters']=_['intersection'](_0x29d738[_0x1439('0xd0')],_0x29d738[_0x1439('0x44')]);_0xbcacbc['attributes']=_[_0x1439('0xd4')](_0x29d738[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x445710[_0x1439('0x44')]['fields']));_0xbcacbc[_0x1439('0x4a')]=_0xbcacbc[_0x1439('0x4a')][_0x1439('0x4e')]?_0xbcacbc[_0x1439('0x4a')]:_0x29d738[_0x1439('0xd0')];_0xbcacbc['order']=qs[_0x1439('0xd7')](_0x445710[_0x1439('0x44')][_0x1439('0xd7')]);_0xbcacbc[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x445710['query'],_0x29d738['filters']));if(_0x445710[_0x1439('0x44')]['filter']){_0xbcacbc['where']=_[_0x1439('0x57')](_0xbcacbc[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0xbcacbc[_0x1439('0x4a')],function(_0xb73283){var _0x3c8178={};_0x3c8178[_0xb73283]={'$like':'%'+_0x445710[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x3c8178;})});}_0xbcacbc=_[_0x1439('0x57')]({},_0xbcacbc,_0x445710[_0x1439('0x58')]);return _0x1f91ca[_0x1439('0xdd')](_0xbcacbc);}})[_0x1439('0x14')](function(_0x5a81cb){if(_0x5a81cb){_0x4f6e2b=_0x5a81cb[_0x1439('0x4e')];if(!_0x445710[_0x1439('0x44')]['hasOwnProperty']('nolimit')){_0xbcacbc[_0x1439('0xda')]=qs['limit'](_0x445710['query']['limit']);_0xbcacbc[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x445710[_0x1439('0x44')][_0x1439('0x1f')]);}return _0x1f91ca['getGroups'](_0xbcacbc);}})[_0x1439('0x14')](function(_0x4058d2){if(_0x4058d2){return _0x4058d2?{'count':_0x4f6e2b,'rows':_0x4058d2}:null;}})[_0x1439('0x14')](respondWithResult(_0x4c5b90,null))[_0x1439('0x55')](handleError(_0x4c5b90,null));};exports[_0x1439('0xde')]=function(_0x51f1e1,_0x44f8dc){var _0x5c8c0f={'raw':!![],'where':{}};var _0x26c5a6={};var _0x3e1b76={'count':0x0,'rows':[]};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x51f1e1[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x44f8dc,null))[_0x1439('0x14')](function(_0x5ecc8f){if(_0x5ecc8f){_0x26c5a6['model']=_[_0x1439('0xd1')](db[_0x1439('0xdf')][_0x1439('0x37')]);_0x26c5a6['query']=_[_0x1439('0xd1')](_0x51f1e1['query']);_0x26c5a6[_0x1439('0xd3')]=_['intersection'](_0x26c5a6['model'],_0x26c5a6[_0x1439('0x44')]);_0x5c8c0f[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x26c5a6[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x51f1e1[_0x1439('0x44')][_0x1439('0xd5')]));_0x5c8c0f[_0x1439('0x4a')]=_0x5c8c0f[_0x1439('0x4a')][_0x1439('0x4e')]?_0x5c8c0f[_0x1439('0x4a')]:_0x26c5a6[_0x1439('0xd0')];if(!_0x51f1e1[_0x1439('0x44')][_0x1439('0xc9')](_0x1439('0xdc'))){_0x5c8c0f[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x51f1e1[_0x1439('0x44')][_0x1439('0xda')]);_0x5c8c0f['offset']=qs['offset'](_0x51f1e1[_0x1439('0x44')]['offset']);}_0x5c8c0f[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x51f1e1['query'][_0x1439('0xd7')]);_0x5c8c0f[_0x1439('0x43')]=qs['filters'](_['pick'](_0x51f1e1['query'],_0x26c5a6['filters']));_0x5c8c0f['where'][_0x1439('0xe0')]=_0x5ecc8f['id'];if(_0x51f1e1[_0x1439('0x44')][_0x1439('0x2d')]){_0x5c8c0f['where']=_[_0x1439('0x57')](_0x5c8c0f['where'],{'$or':_[_0x1439('0x38')](_0x5c8c0f[_0x1439('0x4a')],function(_0x15b355){var _0x35d6a4={};_0x35d6a4[_0x15b355]={'$like':'%'+_0x51f1e1[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x35d6a4;})});}_0x5c8c0f=_['merge']({},_0x5c8c0f,_0x51f1e1['options']);return db[_0x1439('0xdf')][_0x1439('0x21')]({'where':_0x5c8c0f[_0x1439('0x43')]})[_0x1439('0x14')](function(_0xb27926){_0x3e1b76[_0x1439('0x21')]=_0xb27926;if(_0x51f1e1['query'][_0x1439('0x45')]){_0x5c8c0f['include']=[{'all':!![]}];}return db[_0x1439('0xdf')]['findAll'](_0x5c8c0f);})[_0x1439('0x14')](function(_0x1081ad){_0x3e1b76[_0x1439('0x4c')]=_0x1081ad;return _0x3e1b76;});}})['then'](respondWithFilteredResult(_0x44f8dc,_0x5c8c0f))[_0x1439('0x55')](handleError(_0x44f8dc,null));};exports[_0x1439('0xe1')]=function(_0x182125,_0x2204e0){var _0x1a4fb1={'raw':!![],'where':{}};var _0x535ccf={};var _0x5066fb={'count':0x0,'rows':[]};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x182125['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x2204e0,null))['then'](function(_0x2ccb90){if(_0x2ccb90){_0x535ccf[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xe2')][_0x1439('0x37')]);_0x535ccf['query']=_[_0x1439('0xd1')](_0x182125[_0x1439('0x44')]);_0x535ccf[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x535ccf['model'],_0x535ccf[_0x1439('0x44')]);_0x1a4fb1[_0x1439('0x4a')]=_['intersection'](_0x535ccf['model'],qs[_0x1439('0xd5')](_0x182125[_0x1439('0x44')][_0x1439('0xd5')]));_0x1a4fb1[_0x1439('0x4a')]=_0x1a4fb1[_0x1439('0x4a')][_0x1439('0x4e')]?_0x1a4fb1[_0x1439('0x4a')]:_0x535ccf[_0x1439('0xd0')];if(!_0x182125['query'][_0x1439('0xc9')](_0x1439('0xdc'))){_0x1a4fb1[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x182125[_0x1439('0x44')][_0x1439('0xda')]);_0x1a4fb1[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x182125['query'][_0x1439('0x1f')]);}_0x1a4fb1[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x182125[_0x1439('0x44')][_0x1439('0xd7')]);_0x1a4fb1['where']=qs[_0x1439('0xd3')](_['pick'](_0x182125[_0x1439('0x44')],_0x535ccf['filters']));_0x1a4fb1[_0x1439('0x43')][_0x1439('0xe0')]=_0x2ccb90['id'];if(_0x182125[_0x1439('0x44')][_0x1439('0x2d')]){_0x1a4fb1[_0x1439('0x43')]=_[_0x1439('0x57')](_0x1a4fb1[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x1a4fb1[_0x1439('0x4a')],function(_0x1965cf){var _0x28cbec={};_0x28cbec[_0x1965cf]={'$like':'%'+_0x182125[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x28cbec;})});}_0x1a4fb1=_[_0x1439('0x57')]({},_0x1a4fb1,_0x182125[_0x1439('0x58')]);return db[_0x1439('0xe2')][_0x1439('0x21')]({'where':_0x1a4fb1['where']})[_0x1439('0x14')](function(_0xe74e7f){_0x5066fb[_0x1439('0x21')]=_0xe74e7f;if(_0x182125[_0x1439('0x44')][_0x1439('0x45')]){_0x1a4fb1[_0x1439('0x48')]=[{'all':!![]}];}return db[_0x1439('0xe2')][_0x1439('0x89')](_0x1a4fb1);})[_0x1439('0x14')](function(_0x3bfc0e){_0x5066fb[_0x1439('0x4c')]=_0x3bfc0e;return _0x5066fb;});}})[_0x1439('0x14')](respondWithFilteredResult(_0x2204e0,_0x1a4fb1))[_0x1439('0x55')](handleError(_0x2204e0,null));};exports[_0x1439('0xe3')]=function(_0x7299d0,_0x2697fd){var _0xd60544={};var _0x3bc17e={};var _0x214433;var _0x1e66c8;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x7299d0[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2697fd,null))[_0x1439('0x14')](function(_0x307f15){if(_0x307f15){_0x214433=_0x307f15;_0x3bc17e[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xe4')]['rawAttributes']);_0x3bc17e['query']=_[_0x1439('0xd1')](_0x7299d0[_0x1439('0x44')]);_0x3bc17e[_0x1439('0xd3')]=_['intersection'](_0x3bc17e[_0x1439('0xd0')],_0x3bc17e[_0x1439('0x44')]);_0xd60544[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x3bc17e['model'],qs['fields'](_0x7299d0[_0x1439('0x44')][_0x1439('0xd5')]));_0xd60544['attributes']=_0xd60544[_0x1439('0x4a')][_0x1439('0x4e')]?_0xd60544[_0x1439('0x4a')]:_0x3bc17e['model'];_0xd60544[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x7299d0[_0x1439('0x44')][_0x1439('0xd7')]);_0xd60544[_0x1439('0x43')]=qs['filters'](_[_0x1439('0xd8')](_0x7299d0[_0x1439('0x44')],_0x3bc17e[_0x1439('0xd3')]));if(_0x7299d0[_0x1439('0x44')][_0x1439('0x2d')]){_0xd60544['where']=_['merge'](_0xd60544['where'],{'$or':_['map'](_0xd60544[_0x1439('0x4a')],function(_0xddc18a){var _0x58db55={};_0x58db55[_0xddc18a]={'$like':'%'+_0x7299d0[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x58db55;})});}_0xd60544=_[_0x1439('0x57')]({},_0xd60544,_0x7299d0[_0x1439('0x58')]);return _0x214433[_0x1439('0xe3')](_0xd60544);}})[_0x1439('0x14')](function(_0x6a3b35){if(_0x6a3b35){_0x1e66c8=_0x6a3b35[_0x1439('0x4e')];if(!_0x7299d0[_0x1439('0x44')][_0x1439('0xc9')](_0x1439('0xdc'))){_0xd60544[_0x1439('0xda')]=qs['limit'](_0x7299d0['query']['limit']);_0xd60544[_0x1439('0x1f')]=qs['offset'](_0x7299d0[_0x1439('0x44')][_0x1439('0x1f')]);}return _0x214433[_0x1439('0xe3')](_0xd60544);}})[_0x1439('0x14')](function(_0x245cd5){if(_0x245cd5){return _0x245cd5?{'count':_0x1e66c8,'rows':_0x245cd5}:null;}})[_0x1439('0x14')](respondWithResult(_0x2697fd,null))['catch'](handleError(_0x2697fd,null));};exports['getOpenchannelInteractions']=function(_0x347991,_0x16b87e){var _0x4a2a97={};var _0x550db5={};var _0x3922cc;var _0x16cfb7;return db[_0x1439('0x36')]['findOne']({'where':{'id':_0x347991[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x16b87e,null))[_0x1439('0x14')](function(_0x25c583){if(_0x25c583){_0x3922cc=_0x25c583;_0x550db5['model']=_[_0x1439('0xd1')](db[_0x1439('0xe5')][_0x1439('0x37')]);_0x550db5[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x347991['query']);_0x550db5[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x550db5[_0x1439('0xd0')],_0x550db5[_0x1439('0x44')]);_0x4a2a97[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x550db5[_0x1439('0xd0')],qs['fields'](_0x347991['query'][_0x1439('0xd5')]));_0x4a2a97['attributes']=_0x4a2a97['attributes']['length']?_0x4a2a97[_0x1439('0x4a')]:_0x550db5[_0x1439('0xd0')];_0x4a2a97[_0x1439('0xd6')]=qs['sort'](_0x347991[_0x1439('0x44')]['sort']);_0x4a2a97[_0x1439('0x43')]=qs[_0x1439('0xd3')](_['pick'](_0x347991[_0x1439('0x44')],_0x550db5[_0x1439('0xd3')]));if(_0x347991[_0x1439('0x44')][_0x1439('0x2d')]){_0x4a2a97[_0x1439('0x43')]=_[_0x1439('0x57')](_0x4a2a97['where'],{'$or':_[_0x1439('0x38')](_0x4a2a97[_0x1439('0x4a')],function(_0x2367c9){var _0x214f0d={};_0x214f0d[_0x2367c9]={'$like':'%'+_0x347991[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x214f0d;})});}_0x4a2a97=_[_0x1439('0x57')]({},_0x4a2a97,_0x347991[_0x1439('0x58')]);return _0x3922cc['getOpenchannelInteractions'](_0x4a2a97);}})[_0x1439('0x14')](function(_0xa707f1){if(_0xa707f1){_0x16cfb7=_0xa707f1[_0x1439('0x4e')];if(!_0x347991[_0x1439('0x44')][_0x1439('0xc9')]('nolimit')){_0x4a2a97[_0x1439('0xda')]=qs['limit'](_0x347991[_0x1439('0x44')]['limit']);_0x4a2a97[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x347991['query']['offset']);}return _0x3922cc[_0x1439('0xe6')](_0x4a2a97);}})['then'](function(_0x4b6362){if(_0x4b6362){return _0x4b6362?{'count':_0x16cfb7,'rows':_0x4b6362}:null;}})['then'](respondWithResult(_0x16b87e,null))[_0x1439('0x55')](handleError(_0x16b87e,null));};exports[_0x1439('0xe7')]=function(_0x1915de,_0x204f39){var _0xc3851b={'raw':!![],'where':{}};var _0x4f8e91={};var _0x3ffc92={'count':0x0,'rows':[]};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x1915de[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x204f39,null))[_0x1439('0x14')](function(_0x8d0a76){if(_0x8d0a76){_0x4f8e91[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xe8')]['rawAttributes']);_0x4f8e91[_0x1439('0x44')]=_['keys'](_0x1915de[_0x1439('0x44')]);_0x4f8e91[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x4f8e91[_0x1439('0xd0')],_0x4f8e91[_0x1439('0x44')]);_0xc3851b[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x4f8e91['model'],qs[_0x1439('0xd5')](_0x1915de[_0x1439('0x44')][_0x1439('0xd5')]));_0xc3851b[_0x1439('0x4a')]=_0xc3851b[_0x1439('0x4a')][_0x1439('0x4e')]?_0xc3851b[_0x1439('0x4a')]:_0x4f8e91[_0x1439('0xd0')];if(!_0x1915de['query']['hasOwnProperty']('nolimit')){_0xc3851b[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x1915de['query'][_0x1439('0xda')]);_0xc3851b[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x1915de[_0x1439('0x44')][_0x1439('0x1f')]);}_0xc3851b[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x1915de[_0x1439('0x44')][_0x1439('0xd7')]);_0xc3851b[_0x1439('0x43')]=qs['filters'](_[_0x1439('0xd8')](_0x1915de[_0x1439('0x44')],_0x4f8e91['filters']));_0xc3851b[_0x1439('0x43')]['UserId']=_0x8d0a76['id'];if(_0x1915de['query'][_0x1439('0x2d')]){_0xc3851b['where']=_[_0x1439('0x57')](_0xc3851b[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0xc3851b[_0x1439('0x4a')],function(_0x42bdf5){var _0x499dd1={};_0x499dd1[_0x42bdf5]={'$like':'%'+_0x1915de[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x499dd1;})});}_0xc3851b=_[_0x1439('0x57')]({},_0xc3851b,_0x1915de[_0x1439('0x58')]);return db[_0x1439('0xe8')]['count']({'where':_0xc3851b['where']})['then'](function(_0x4e053d){_0x3ffc92[_0x1439('0x21')]=_0x4e053d;if(_0x1915de[_0x1439('0x44')][_0x1439('0x45')]){_0xc3851b[_0x1439('0x48')]=[{'all':!![]}];}return db['MailInteraction'][_0x1439('0x89')](_0xc3851b);})['then'](function(_0x23e97a){_0x3ffc92[_0x1439('0x4c')]=_0x23e97a;return _0x3ffc92;});}})[_0x1439('0x14')](respondWithFilteredResult(_0x204f39,_0xc3851b))[_0x1439('0x55')](handleError(_0x204f39,null));};exports[_0x1439('0xe9')]=function(_0x4e90ee,_0x1742e0){var _0x3bf2ec={};var _0x234d9c={};var _0x1e7f62;var _0x1d98b1;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x4e90ee[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1742e0,null))['then'](function(_0x511eb2){if(_0x511eb2){_0x1e7f62=_0x511eb2;_0x234d9c[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xea')][_0x1439('0x37')]);_0x234d9c[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x4e90ee[_0x1439('0x44')]);_0x234d9c[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x234d9c[_0x1439('0xd0')],_0x234d9c[_0x1439('0x44')]);_0x3bf2ec[_0x1439('0x4a')]=_['intersection'](_0x234d9c[_0x1439('0xd0')],qs['fields'](_0x4e90ee[_0x1439('0x44')][_0x1439('0xd5')]));_0x3bf2ec['attributes']=_0x3bf2ec[_0x1439('0x4a')][_0x1439('0x4e')]?_0x3bf2ec[_0x1439('0x4a')]:_0x234d9c[_0x1439('0xd0')];_0x3bf2ec[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x4e90ee[_0x1439('0x44')][_0x1439('0xd7')]);_0x3bf2ec[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x4e90ee[_0x1439('0x44')],_0x234d9c[_0x1439('0xd3')]));if(_0x4e90ee['query'][_0x1439('0x2d')]){_0x3bf2ec['where']=_[_0x1439('0x57')](_0x3bf2ec[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x3bf2ec[_0x1439('0x4a')],function(_0x189b33){var _0x509455={};_0x509455[_0x189b33]={'$like':'%'+_0x4e90ee['query'][_0x1439('0x2d')]+'%'};return _0x509455;})});}_0x3bf2ec=_[_0x1439('0x57')]({},_0x3bf2ec,_0x4e90ee[_0x1439('0x58')]);return _0x1e7f62[_0x1439('0xe9')](_0x3bf2ec);}})['then'](function(_0x399eaa){if(_0x399eaa){_0x1d98b1=_0x399eaa[_0x1439('0x4e')];if(!_0x4e90ee[_0x1439('0x44')]['hasOwnProperty'](_0x1439('0xdc'))){_0x3bf2ec[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x4e90ee['query'][_0x1439('0xda')]);_0x3bf2ec[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x4e90ee[_0x1439('0x44')][_0x1439('0x1f')]);}return _0x1e7f62[_0x1439('0xe9')](_0x3bf2ec);}})['then'](function(_0x258164){if(_0x258164){return _0x258164?{'count':_0x1d98b1,'rows':_0x258164}:null;}})[_0x1439('0x14')](respondWithResult(_0x1742e0,null))[_0x1439('0x55')](handleError(_0x1742e0,null));};exports[_0x1439('0xeb')]=function(_0x189820,_0x5cfce8){var _0x1869d7={};var _0x1b59ce={};var _0x59c2b6;var _0x191017;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x189820[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x5cfce8,null))['then'](function(_0x4e3809){if(_0x4e3809){_0x59c2b6=_0x4e3809;_0x1b59ce[_0x1439('0xd0')]=_['keys'](db['FaxInteraction'][_0x1439('0x37')]);_0x1b59ce[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x189820['query']);_0x1b59ce['filters']=_['intersection'](_0x1b59ce[_0x1439('0xd0')],_0x1b59ce['query']);_0x1869d7[_0x1439('0x4a')]=_['intersection'](_0x1b59ce[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x189820['query'][_0x1439('0xd5')]));_0x1869d7[_0x1439('0x4a')]=_0x1869d7['attributes'][_0x1439('0x4e')]?_0x1869d7[_0x1439('0x4a')]:_0x1b59ce[_0x1439('0xd0')];_0x1869d7[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x189820[_0x1439('0x44')][_0x1439('0xd7')]);_0x1869d7[_0x1439('0x43')]=qs[_0x1439('0xd3')](_['pick'](_0x189820[_0x1439('0x44')],_0x1b59ce['filters']));if(_0x189820[_0x1439('0x44')][_0x1439('0x2d')]){_0x1869d7[_0x1439('0x43')]=_[_0x1439('0x57')](_0x1869d7[_0x1439('0x43')],{'$or':_['map'](_0x1869d7[_0x1439('0x4a')],function(_0x53953d){var _0x210922={};_0x210922[_0x53953d]={'$like':'%'+_0x189820[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x210922;})});}_0x1869d7=_[_0x1439('0x57')]({},_0x1869d7,_0x189820['options']);return _0x59c2b6['getFaxInteractions'](_0x1869d7);}})[_0x1439('0x14')](function(_0x3f43fd){if(_0x3f43fd){_0x191017=_0x3f43fd[_0x1439('0x4e')];if(!_0x189820['query'][_0x1439('0xc9')](_0x1439('0xdc'))){_0x1869d7[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x189820[_0x1439('0x44')][_0x1439('0xda')]);_0x1869d7[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x189820['query']['offset']);}return _0x59c2b6[_0x1439('0xeb')](_0x1869d7);}})[_0x1439('0x14')](function(_0x4c8a08){if(_0x4c8a08){return _0x4c8a08?{'count':_0x191017,'rows':_0x4c8a08}:null;}})[_0x1439('0x14')](respondWithResult(_0x5cfce8,null))[_0x1439('0x55')](handleError(_0x5cfce8,null));};exports[_0x1439('0xec')]=function(_0x5d566e,_0x15c12a){var _0x1b0c23={};var _0x1cb93c={};var _0x44f816;var _0x1f9f88;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5d566e['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x15c12a,null))[_0x1439('0x14')](function(_0x331522){if(_0x331522){_0x44f816=_0x331522;_0x1cb93c[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xed')][_0x1439('0x37')]);_0x1cb93c['query']=_[_0x1439('0xd1')](_0x5d566e['query']);_0x1cb93c['filters']=_[_0x1439('0xd4')](_0x1cb93c[_0x1439('0xd0')],_0x1cb93c[_0x1439('0x44')]);_0x1b0c23[_0x1439('0x4a')]=_['intersection'](_0x1cb93c[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x5d566e[_0x1439('0x44')][_0x1439('0xd5')]));_0x1b0c23[_0x1439('0x4a')]=_0x1b0c23[_0x1439('0x4a')][_0x1439('0x4e')]?_0x1b0c23[_0x1439('0x4a')]:_0x1cb93c[_0x1439('0xd0')];_0x1b0c23[_0x1439('0xd6')]=qs['sort'](_0x5d566e[_0x1439('0x44')][_0x1439('0xd7')]);_0x1b0c23['where']=qs['filters'](_['pick'](_0x5d566e[_0x1439('0x44')],_0x1cb93c['filters']));if(_0x5d566e[_0x1439('0x44')][_0x1439('0x2d')]){_0x1b0c23[_0x1439('0x43')]=_[_0x1439('0x57')](_0x1b0c23[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x1b0c23[_0x1439('0x4a')],function(_0x5dd44d){var _0x5a6dd7={};_0x5a6dd7[_0x5dd44d]={'$like':'%'+_0x5d566e[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x5a6dd7;})});}_0x1b0c23=_[_0x1439('0x57')]({},_0x1b0c23,_0x5d566e['options']);return _0x44f816[_0x1439('0xec')](_0x1b0c23);}})['then'](function(_0x521e9d){if(_0x521e9d){_0x1f9f88=_0x521e9d[_0x1439('0x4e')];if(!_0x5d566e['query']['hasOwnProperty'](_0x1439('0xdc'))){_0x1b0c23['limit']=qs['limit'](_0x5d566e['query']['limit']);_0x1b0c23['offset']=qs[_0x1439('0x1f')](_0x5d566e[_0x1439('0x44')]['offset']);}return _0x44f816[_0x1439('0xec')](_0x1b0c23);}})[_0x1439('0x14')](function(_0x4f0d87){if(_0x4f0d87){return _0x4f0d87?{'count':_0x1f9f88,'rows':_0x4f0d87}:null;}})[_0x1439('0x14')](respondWithResult(_0x15c12a,null))[_0x1439('0x55')](handleError(_0x15c12a,null));};exports[_0x1439('0xee')]=function(_0x42af9d,_0xadef3f,_0x531c54){var _0x50e862;var _0x189675;var _0x5648fa;var _0x5e71ba=!_[_0x1439('0x66')](_0x42af9d['params']['id'])?_0x42af9d[_0x1439('0x5b')]['id']:!_[_0x1439('0x66')](_0x42af9d[_0x1439('0x7e')]['id'])?_0x42af9d['user']['id']:null;return db[_0x1439('0x36')]['find']({'where':{'id':_0x5e71ba,'role':{'$or':[_0x1439('0x28'),_0x1439('0x7e'),_0x1439('0x2a')]}},'attributes':['id',_0x1439('0x31'),'phone',_0x1439('0xef'),_0x1439('0x25'),_0x1439('0x60'),_0x1439('0x9d')]})[_0x1439('0x14')](function(_0x2f8673){if(_0x2f8673){if(_0x2f8673[_0x1439('0x25')]===_0x1439('0x2a')){_0x50e862=_0x2f8673;if(_0x42af9d[_0x1439('0x5a')]['interface']){_0x5648fa=util['format']('LOCAL/%s@from-sip/n',_0x50e862[_0x42af9d[_0x1439('0x5a')][_0x1439('0x9f')]]);}else if(_0x42af9d['body'][_0x1439('0xf0')]){_0x5648fa=util[_0x1439('0xab')]('SIP/%s',_0x42af9d[_0x1439('0x5a')][_0x1439('0xf0')]);}else{_0x5648fa=util[_0x1439('0xab')](_0x1439('0xac'),_0x50e862[_0x1439('0x31')]);}socket['to'](util[_0x1439('0xab')](_0x1439('0xf1'),_0x50e862[_0x1439('0x31')]))[_0x1439('0x26')](_0x1439('0xf2'),{'user':{'id':_0x50e862['id'],'name':_0x50e862[_0x1439('0x31')]},'ip':_0x42af9d[_0x1439('0xf3')]['x-forwarded-for']||_0x42af9d['connection'][_0x1439('0xf4')]||_0x42af9d['socket'][_0x1439('0xf4')]||_0x42af9d[_0x1439('0xf5')]['socket'][_0x1439('0xf4')]});return db['UserVoiceQueueRt'][_0x1439('0x33')]({'where':{'membername':_0x50e862[_0x1439('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xf6'));}})[_0x1439('0x14')](function(){if(_0x50e862){return _0x50e862[_0x1439('0xf7')]({'raw':!![]});}})[_0x1439('0x14')](function(_0x238254){if(_0x50e862){if(_0x238254){_0x189675=_0x238254;if(_0x189675['length']){var _0x473a2a=_0x189675['map'](function(_0x5d3481){var _0x372f40={'membername':_0x50e862[_0x1439('0x31')],'UserId':_0x50e862['id'],'queue_name':_0x5d3481[_0x1439('0x31')],'VoiceQueueId':_0x5d3481['id'],'interface':_0x5648fa,'paused':_0x50e862[_0x1439('0x9d')]||![],'penalty':_0x5d3481[_0x1439('0xf8')]||0x0};return db[_0x1439('0xad')][_0x1439('0xae')](_0x372f40);});return Promise[_0x1439('0x54')](_0x473a2a);}}}})[_0x1439('0x14')](function(){if(_0x50e862){return db[_0x1439('0xf9')][_0x1439('0x89')]({'where':{'membername':_0x50e862[_0x1439('0x31')],'exitAt':null}});}})[_0x1439('0x14')](function(_0x48d3de){if(_0x50e862){var _0xd14e0e=[];_0x48d3de[_0x1439('0xfa')](function(_0x559356){_0xd14e0e[_0x1439('0x4b')](_0x559356[_0x1439('0x24')]({'exitAt':moment()[_0x1439('0xab')](_0x1439('0xfb'))}));});return Promise[_0x1439('0x54')](_0xd14e0e);}})[_0x1439('0x14')](function(){if(_0x50e862){var _0x5bfc1a=[];var _0x3cfffa=[];var _0x1ac407=utils[_0x1439('0xfc')]();var _0x200106={'membername':_0x50e862['name'],'interface':_0x5648fa,'enterAt':moment()[_0x1439('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x50e862[_0x1439('0x25')],'internal':_0x50e862[_0x1439('0x60')]};_0x1ac407[_0x1439('0xfa')](function(_0x478d01){_0x5bfc1a['push'](_[_0x1439('0x57')]({'channel':_0x478d01,'type':_0x1439('0xfd'),'data1':_0x42af9d['body'][_0x1439('0xfe')],'data2':_0x5648fa},_0x200106));if(_0x50e862['loginInPause']){_0x3cfffa[_0x1439('0x4b')](_[_0x1439('0x57')]({'channel':_0x478d01,'type':_0x1439('0xff'),'data1':'LOGININPAUSE'},_0x200106));}});return db['MemberReport'][_0x1439('0x83')](_0x5bfc1a[_0x1439('0xc6')](_0x3cfffa),{'individualHooks':!![]});}})[_0x1439('0x14')](function(){if(_0x50e862){return _0x50e862['update']({'online':!![],'lastLoginAt':moment()[_0x1439('0xab')](_0x1439('0xfb')),'voicePause':_0x50e862[_0x1439('0x9d')]||![],'mailPause':_0x50e862['loginInPause']||![],'chatPause':_0x50e862[_0x1439('0x9d')]||![],'faxPause':_0x50e862['loginInPause']||![],'smsPause':_0x50e862[_0x1439('0x9d')]||![],'openchannelPause':_0x50e862[_0x1439('0x9d')]||![],'whatsappPause':_0x50e862[_0x1439('0x9d')]||![],'pauseType':_0x50e862['loginInPause']?'LOGININPAUSE':null,'interface':_0x5648fa,'lastPauseAt':moment()[_0x1439('0xab')](_0x1439('0xfb'))});}})[_0x1439('0x14')](function(_0x8db1c3){if(_0x42af9d[_0x1439('0x100')]){return _0x531c54();}else{return Promise[_0x1439('0x101')](_0x8db1c3)[_0x1439('0x14')](respondWithResult(_0xadef3f,null));}})[_0x1439('0x55')](handleError(_0xadef3f,null));};exports[_0x1439('0x102')]=function(_0x3168af,_0x34ff95){var _0x2f36d2;return db[_0x1439('0x36')]['find']({'where':{'id':_0x3168af[_0x1439('0x5b')]['id'],'role':'agent'},'attributes':['id',_0x1439('0x31'),_0x1439('0x25')]})[_0x1439('0x14')](handleEntityNotFound(_0x34ff95,null))['then'](function(_0x56b87f){if(_0x56b87f){_0x2f36d2=_0x56b87f;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x2f36d2[_0x1439('0x31')]},'individualHooks':!![]});}})['then'](function(){return db[_0x1439('0xf9')][_0x1439('0x89')]({'where':{'membername':_0x2f36d2[_0x1439('0x31')],'exitAt':null}});})[_0x1439('0x14')](function(_0x570cb3){var _0x4a251b=[];_0x570cb3['forEach'](function(_0x421e4e){_0x4a251b['push'](_0x421e4e[_0x1439('0x24')]({'exitAt':moment()['format'](_0x1439('0xfb'))}));});return Promise[_0x1439('0x54')](_0x4a251b);})[_0x1439('0x14')](function(){return _0x2f36d2[_0x1439('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x1439('0x14')](respondWithResult(_0x34ff95,null))['catch'](handleError(_0x34ff95,null));};exports[_0x1439('0x103')]=function(_0x1e9ac0,_0x4c54f4){var _0x1fad6b;return db[_0x1439('0xad')][_0x1439('0x24')]({'paused':0x1},{'where':{'UserId':_0x1e9ac0['params']['id']},'individualHooks':!![]})[_0x1439('0x14')](function(){return db['User'][_0x1439('0x30')]({'where':{'id':_0x1e9ac0[_0x1439('0x5b')]['id'],'role':'agent'},'attributes':['id','name','role',_0x1439('0x60'),_0x1439('0x9f'),_0x1439('0x9c')]});})[_0x1439('0x14')](handleEntityNotFound(_0x4c54f4,null))['then'](function(_0x51dfb5){if(_0x51dfb5){_0x1fad6b=_0x51dfb5;return respondWithRpcPromise(_0x1439('0x104'),_0x1439('0x103'),{'id':_0x1fad6b['id'],'name':_0x1fad6b[_0x1439('0x31')],'pause':!![]});}})[_0x1439('0x14')](function(){if(_0x1fad6b){return db[_0x1439('0xf9')]['findAll']({'where':{'membername':_0x1fad6b[_0x1439('0x31')],'type':_0x1439('0xff'),'exitAt':null}});}})[_0x1439('0x14')](function(_0x529f63){if(_0x529f63[_0x1439('0x4e')]){var _0x3ad4de=moment()[_0x1439('0xab')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x214b64=0x0,_0x5908fe=_0x529f63['length'];_0x214b64<_0x5908fe;_0x214b64++){_0x529f63[_0x214b64][_0x1439('0x105')]({'exitAt':_0x3ad4de});}}})[_0x1439('0x14')](function(){var _0x5c1ab3=[];var _0x10a71c=utils['getChannels']();_0x10a71c[_0x1439('0xfa')](function(_0x461381){_0x5c1ab3[_0x1439('0x4b')]({'channel':_0x461381,'membername':_0x1fad6b['name'],'interface':_[_0x1439('0x66')](_0x1fad6b[_0x1439('0x9f')])?util['format']('SIP/%s',_0x1fad6b['name']):_0x1fad6b[_0x1439('0x9f')],'type':'PAUSE','enterAt':moment()[_0x1439('0xab')](_0x1439('0xfb')),'data1':_0x1e9ac0[_0x1439('0x5a')][_0x1439('0x3a')]||_0x1439('0x106'),'role':_0x1fad6b['role'],'internal':_0x1fad6b[_0x1439('0x60')]});});return db[_0x1439('0xf9')]['bulkCreate'](_0x5c1ab3,{'individualHooks':!![]});})[_0x1439('0x14')](function(){return _0x1fad6b[_0x1439('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1e9ac0['body'][_0x1439('0x3a')]||_0x1439('0x106'),'lastPauseAt':moment()['format'](_0x1439('0xfb'))});})['then'](respondWithResult(_0x4c54f4,null))['catch'](handleError(_0x4c54f4,null));};exports[_0x1439('0x107')]=function(_0x4aa5d6,_0x553fc1){if(_0x4aa5d6[_0x1439('0x5a')]['channel']&&!utils[_0x1439('0xa0')](_0x4aa5d6[_0x1439('0x5a')]['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x4aa5d6[_0x1439('0x5a')][_0x1439('0x9b')]));}return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x4aa5d6[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0x31'),_0x1439('0x25'),_0x1439('0x60'),_0x1439('0x9f'),_0x1439('0x9c'),_0x1439('0x9e'),_0x1439('0x108'),_0x1439('0x109'),'faxPause',_0x1439('0x10a'),'smsPause',_0x1439('0x10b'),_0x1439('0x10c'),_0x1439('0x10d')]})[_0x1439('0x14')](function(_0x5689bf){if(!_0x5689bf){throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x4aa5d6['params']['id']));}return _0x5689bf['unpause'](_0x4aa5d6[_0x1439('0x5a')][_0x1439('0x9b')]);})['then'](respondWithResult(_0x553fc1,null))[_0x1439('0x55')](APIHandleError(_0x553fc1));};exports[_0x1439('0x10e')]=function(_0x191254,_0x36da78){var _0x1d81cf={};var _0x4e741d={};var _0x100678;var _0x4c31f6;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x191254[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x36da78,null))['then'](function(_0x51ccee){if(_0x51ccee){_0x100678=_0x51ccee;_0x4e741d[_0x1439('0xd0')]=_[_0x1439('0xd1')](db['Team'][_0x1439('0x37')]);_0x4e741d[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x191254[_0x1439('0x44')]);_0x4e741d['filters']=_['intersection'](_0x4e741d[_0x1439('0xd0')],_0x4e741d[_0x1439('0x44')]);_0x1d81cf[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x4e741d[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x191254['query'][_0x1439('0xd5')]));_0x1d81cf[_0x1439('0x4a')]=_0x1d81cf[_0x1439('0x4a')][_0x1439('0x4e')]?_0x1d81cf[_0x1439('0x4a')]:_0x4e741d[_0x1439('0xd0')];_0x1d81cf[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x191254[_0x1439('0x44')][_0x1439('0xd7')]);_0x1d81cf[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x191254[_0x1439('0x44')],_0x4e741d[_0x1439('0xd3')]));if(_0x191254['query']['filter']){_0x1d81cf['where']=_['merge'](_0x1d81cf[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x1d81cf['attributes'],function(_0x54a8c9){var _0x569442={};_0x569442[_0x54a8c9]={'$like':'%'+_0x191254[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x569442;})});}_0x1d81cf=_[_0x1439('0x57')]({},_0x1d81cf,_0x191254['options']);return _0x100678[_0x1439('0x10e')](_0x1d81cf);}})['then'](function(_0x135fae){if(_0x135fae){_0x4c31f6=_0x135fae[_0x1439('0x4e')];if(!_0x191254[_0x1439('0x44')]['hasOwnProperty'](_0x1439('0xdc'))){_0x1d81cf[_0x1439('0xda')]=qs['limit'](_0x191254['query'][_0x1439('0xda')]);_0x1d81cf[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x191254['query'][_0x1439('0x1f')]);}return _0x100678[_0x1439('0x10e')](_0x1d81cf);}})['then'](function(_0x8087a3){if(_0x8087a3){return _0x8087a3?{'count':_0x4c31f6,'rows':_0x8087a3}:null;}})['then'](respondWithResult(_0x36da78,null))[_0x1439('0x55')](handleError(_0x36da78,null));};exports[_0x1439('0x10f')]=function(_0x426aa8,_0x28bd3e){var _0x5e731f=_0x426aa8[_0x1439('0x5b')]['id'];var _0x46e813=_0x426aa8[_0x1439('0x5a')]?_0x426aa8[_0x1439('0x5a')][_0x1439('0x5e')]:null;var _0x3f4826=[];return Promise[_0x1439('0x101')]()[_0x1439('0x14')](function(){if(!_0x46e813)throw new APIBadRequestError(_0x1439('0x110'));})[_0x1439('0x14')](function(){return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5e731f}});})[_0x1439('0x14')](function(_0x4a471d){if(!_0x4a471d)throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x426aa8[_0x1439('0x5b')]['id']));return db[_0x1439('0x68')]['transaction'](function(_0x15ffbd){return _0x4a471d[_0x1439('0x10f')](_0x46e813,{'transaction':_0x15ffbd})[_0x1439('0x14')](function(){return db[_0x1439('0x111')][_0x1439('0x89')]({'where':{'id':{'$in':_0x46e813}}});})[_0x1439('0x14')](function(_0x45dd1a){var _0x2a43f4=_[_0x1439('0x38')](_0x45dd1a,function(_0xe95d02){return _0xe95d02[_0x1439('0x112')]();});return Promise[_0x1439('0x54')](_0x2a43f4);})[_0x1439('0x14')](function(_0x3fdd47){_0x3f4826=_[_0x1439('0x113')](_0x3fdd47);var _0x272779=_[_0x1439('0x38')](_0x3f4826,function(_0x66cc08){return _0x66cc08[_0x1439('0x114')](_0x4a471d['id'],{'transaction':_0x15ffbd});});return Promise[_0x1439('0x54')](_0x272779);})[_0x1439('0x14')](function(){if(!_0x4a471d[_0x1439('0x9c')])return;var _0x4b9686=_[_0x1439('0x2d')](_0x3f4826,function(_0x12a8d0){return _0x12a8d0[_0x1439('0x115')](_0x1439('0x9b'))===_0x1439('0x116');});var _0x59c6ce=_[_0x1439('0x38')](_0x4b9686,function(_0x295a05){return db[_0x1439('0xad')][_0x1439('0xae')]({'membername':_0x4a471d[_0x1439('0x31')],'UserId':_0x4a471d['id'],'queue_name':_0x295a05[_0x1439('0x31')],'VoiceQueueId':_0x295a05['id'],'interface':_['isNil'](_0x4a471d[_0x1439('0x9f')])?util[_0x1439('0xab')](_0x1439('0xac'),_0x4a471d[_0x1439('0x31')]):_0x4a471d[_0x1439('0x9f')],'paused':_0x4a471d[_0x1439('0x9e')]||![],'penalty':_0x4a471d['penalty']},{'transaction':_0x15ffbd});});return Promise[_0x1439('0x54')](_0x59c6ce);})['then'](function(){return db['TeamVoicePrefix'][_0x1439('0x89')]({'where':{'teamId':{'$in':_0x46e813}}});})['then'](function(_0x17343c){var _0x3f84d8=_[_0x1439('0x38')](_0x17343c,function(_0x5ea1fe){return db[_0x1439('0x117')][_0x1439('0x7c')]({'UserId':_0x4a471d['id'],'VoicePrefixId':_0x5ea1fe['VoicePrefixId']},{'transaction':_0x15ffbd});});return Promise[_0x1439('0x54')](_0x3f84d8);});});})[_0x1439('0x14')](function(){for(var _0x2ef703=0x0;_0x2ef703<_0x3f4826[_0x1439('0x4e')];_0x2ef703++){var _0x56d3b5=_0x3f4826[_0x2ef703][_0x1439('0x115')](_0x1439('0x9b'));var _0x435dcd=_0x56d3b5+_0x1439('0xa7');socket['emit']('user'+_0x56d3b5+_0x1439('0xa8'),{'UserId':_0x5e731f,['queueField']:_0x3f4826[_0x2ef703]['id']});}})[_0x1439('0x14')](respondWithStatusCode(_0x28bd3e,null))[_0x1439('0x55')](APIHandleError(_0x28bd3e));};exports[_0x1439('0x118')]=function(_0x3b84e1,_0x5945e6){var _0x5d94ed=_0x3b84e1[_0x1439('0x5b')]['id'];var _0x17f78f=null;if(_0x3b84e1[_0x1439('0x44')][_0x1439('0x5e')]){_0x17f78f=_[_0x1439('0x119')](_0x3b84e1['query']['ids'])?_0x3b84e1['query'][_0x1439('0x5e')]:[_0x3b84e1['query']['ids']];}var _0x297e27=[];return Promise[_0x1439('0x101')]()[_0x1439('0x14')](function(){if(!_0x17f78f)throw new APIBadRequestError(_0x1439('0x11a'));})[_0x1439('0x14')](function(){return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5d94ed}});})[_0x1439('0x14')](function(_0x4bbac8){if(!_0x4bbac8)throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x3b84e1['params']['id']));return db[_0x1439('0x68')]['transaction'](function(_0x23bf59){return _0x4bbac8[_0x1439('0x118')](_0x17f78f,{'transaction':_0x23bf59})['then'](function(){return db[_0x1439('0x111')]['findAll']({'where':{'id':{'$in':_0x17f78f}}});})[_0x1439('0x14')](function(_0x53cb79){var _0x140fc2=_['map'](_0x53cb79,function(_0x1e7479){return _0x1e7479['getAssociatedQueues']();});return Promise[_0x1439('0x54')](_0x140fc2);})[_0x1439('0x14')](function(_0x108807){_0x297e27=_[_0x1439('0x113')](_0x108807);var _0x5d24d4=_[_0x1439('0x38')](_0x297e27,function(_0x4bf26f){return _0x4bf26f['removeAgent'](_0x4bbac8['id'],{'transaction':_0x23bf59});});return Promise['all'](_0x5d24d4);})['then'](function(){if(!_0x4bbac8[_0x1439('0x9c')])return;var _0x342355=_[_0x1439('0x2d')](_0x297e27,function(_0x47fd93){return _0x47fd93['getDataValue'](_0x1439('0x9b'))===_0x1439('0x116');});var _0x3ef01a=_[_0x1439('0x38')](_0x342355,function(_0xb10d35){return db[_0x1439('0xad')][_0x1439('0x33')]({'where':{'VoiceQueueId':_0xb10d35['id'],'UserId':_0x4bbac8['id']},'transaction':_0x23bf59});});return Promise['all'](_0x3ef01a);})[_0x1439('0x14')](function(){return db[_0x1439('0x11b')][_0x1439('0x89')]({'where':{'teamId':{'$in':_0x17f78f}}});})[_0x1439('0x14')](function(_0x513aae){var _0x377352=_[_0x1439('0x38')](_0x513aae,function(_0x321f23){return db[_0x1439('0x117')][_0x1439('0x33')]({'where':{'UserId':_0x4bbac8['id'],'VoicePrefixId':_0x321f23[_0x1439('0x11c')]}},{'transaction':_0x23bf59});});return Promise['all'](_0x377352);});});})[_0x1439('0x14')](function(){for(var _0x5f0a0d=0x0;_0x5f0a0d<_0x297e27[_0x1439('0x4e')];_0x5f0a0d++){var _0x41cbc2=_0x297e27[_0x5f0a0d][_0x1439('0x115')]('channel');var _0x366836=_0x41cbc2+_0x1439('0xa7');socket[_0x1439('0x26')](_0x1439('0x7e')+_0x41cbc2+_0x1439('0xb1'),{'UserId':_0x5d94ed,['queueField']:_0x297e27[_0x5f0a0d]['id']});}})['then'](respondWithStatusCode(_0x5945e6,null))[_0x1439('0x55')](APIHandleError(_0x5945e6));};exports['getLists']=function(_0x47d87f,_0x5d0748){var _0x4c82a1={};var _0x5d3994={};var _0x4438ad;var _0x3c6c89;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x47d87f[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5d0748,null))[_0x1439('0x14')](function(_0xee1e66){if(_0xee1e66){_0x4438ad=_0xee1e66;_0x5d3994[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xca')][_0x1439('0x37')]);_0x5d3994[_0x1439('0x44')]=_['keys'](_0x47d87f[_0x1439('0x44')]);_0x5d3994[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x5d3994[_0x1439('0xd0')],_0x5d3994[_0x1439('0x44')]);_0x4c82a1[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x5d3994[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x47d87f[_0x1439('0x44')][_0x1439('0xd5')]));_0x4c82a1[_0x1439('0x4a')]=_0x4c82a1[_0x1439('0x4a')][_0x1439('0x4e')]?_0x4c82a1['attributes']:_0x5d3994[_0x1439('0xd0')];_0x4c82a1[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x47d87f[_0x1439('0x44')][_0x1439('0xd7')]);_0x4c82a1[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x47d87f[_0x1439('0x44')],_0x5d3994['filters']));if(_0x47d87f['query'][_0x1439('0x2d')]){_0x4c82a1[_0x1439('0x43')]=_[_0x1439('0x57')](_0x4c82a1[_0x1439('0x43')],{'$or':_['map'](_0x4c82a1[_0x1439('0x4a')],function(_0x3163bb){var _0x5d92ac={};_0x5d92ac[_0x3163bb]={'$like':'%'+_0x47d87f[_0x1439('0x44')]['filter']+'%'};return _0x5d92ac;})});}_0x4c82a1=_[_0x1439('0x57')]({},_0x4c82a1,_0x47d87f['options']);return _0x4438ad[_0x1439('0x11d')](_0x4c82a1);}})[_0x1439('0x14')](function(_0x4e3ef9){if(_0x4e3ef9){_0x3c6c89=_0x4e3ef9[_0x1439('0x4e')];if(!_0x47d87f[_0x1439('0x44')][_0x1439('0xc9')](_0x1439('0xdc'))){_0x4c82a1[_0x1439('0xda')]=qs['limit'](_0x47d87f['query'][_0x1439('0xda')]);_0x4c82a1[_0x1439('0x1f')]=qs['offset'](_0x47d87f[_0x1439('0x44')]['offset']);}return _0x4438ad[_0x1439('0x11d')](_0x4c82a1);}})[_0x1439('0x14')](function(_0x88bf55){if(_0x88bf55){return _0x88bf55?{'count':_0x3c6c89,'rows':_0x88bf55}:null;}})['then'](respondWithResult(_0x5d0748,null))[_0x1439('0x55')](handleError(_0x5d0748,null));};exports['getAgents']=function(_0x5e828c,_0x55bb11){var _0x163b33={};var _0x2917ea={};var _0x43e108;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5e828c[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x55bb11,null))[_0x1439('0x14')](function(_0x143292){if(_0x143292){_0x43e108=_0x143292;_0x2917ea[_0x1439('0xd0')]=_['keys'](db[_0x1439('0x36')][_0x1439('0x37')]);_0x2917ea[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x5e828c['query']);_0x2917ea[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x2917ea[_0x1439('0xd0')],_0x2917ea['query']);_0x163b33[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x2917ea[_0x1439('0xd0')],qs['fields'](_0x5e828c[_0x1439('0x44')][_0x1439('0xd5')]));_0x163b33[_0x1439('0x4a')]=_0x163b33[_0x1439('0x4a')][_0x1439('0x4e')]?_0x163b33[_0x1439('0x4a')]:_0x2917ea[_0x1439('0xd0')];_0x163b33[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x5e828c[_0x1439('0x44')][_0x1439('0xd7')]);_0x163b33['where']=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x5e828c[_0x1439('0x44')],_0x2917ea[_0x1439('0xd3')]));if(_0x5e828c[_0x1439('0x44')][_0x1439('0x2d')]){_0x163b33[_0x1439('0x43')]=_[_0x1439('0x57')](_0x163b33['where'],{'$or':_[_0x1439('0x38')](_0x163b33[_0x1439('0x4a')],function(_0x377e95){var _0x924fbb={};_0x924fbb[_0x377e95]={'$like':'%'+_0x5e828c['query']['filter']+'%'};return _0x924fbb;})});}_0x163b33['model']=db[_0x1439('0x36')];_0x163b33['as']=_0x1439('0x29');_0x163b33=_['merge']({},_0x163b33,_0x5e828c[_0x1439('0x58')]);return _0x43e108[_0x1439('0xf7')]({'include':[_0x163b33]});}})['then'](function(_0x426496){if(_0x426496){var _0x905f7f={},_0x93ba20=[];for(var _0x30e407=0x0;_0x30e407<_0x426496['length'];_0x30e407+=0x1){for(var _0x3aff28=0x0,_0x23e378;_0x3aff28<_0x426496[_0x30e407][_0x1439('0x29')][_0x1439('0x4e')];_0x3aff28+=0x1){_0x23e378=_0x426496[_0x30e407][_0x1439('0x29')][_0x3aff28][_0x1439('0x27')]({'plain':!![]});_0x905f7f[_0x23e378['id']]=_0x23e378;}}_0x905f7f=_[_0x1439('0x11e')](_0x905f7f);for(var _0x4e413a=qs['offset'](_0x5e828c[_0x1439('0x44')]['offset']);_0x4e413a<_0x905f7f[_0x1439('0x4e')]&&_0x93ba20[_0x1439('0x4e')]=_0x4d06e6){_0x431721=_0x4d06e6;_0x27e2c5=0xc8;}else{_0x27e2c5=0xce;}_0x5f24fe[_0xae46('0x22')](_0x27e2c5);return _0x5f24fe[_0xae46('0x27')](_0xae46('0x28'),_0x4e257a+'-'+_0x431721+'/'+_0x4d06e6)[_0xae46('0x29')](_0x37a0d2);}return null;};}function saveUpdates(_0x446d0a){return function(_0x36ec2d){if(_0x36ec2d){return _0x36ec2d[_0xae46('0x2a')](_0x446d0a)['then'](function(_0x5eb0b8){if(_0x5eb0b8[_0xae46('0x2b')]===_0xae46('0x2c')){socket[_0xae46('0x2d')](_0xae46('0x2e')+_0x5eb0b8['id'],_0x5eb0b8);}return _0x5eb0b8;});}return null;};}function removeEntity(_0x468612){return function(_0x1af9dc){if(_0x1af9dc){return _0x1af9dc[_0xae46('0x2f')]()[_0xae46('0x16')](function(){var _0x17b5e9=_0x1af9dc['get']({'plain':!![]});if(_0x17b5e9[_0xae46('0x2b')]==='admin')return;var _0xe3c58=[{'name':_0xae46('0x30'),'value':'user','ignore':!![]},{'name':_0xae46('0x31'),'value':'agent','ignore':![]},{'name':_0xae46('0x32'),'value':_0xae46('0x33'),'ignore':![]}];var _0x21c6c5=_(_0xe3c58)[_0xae46('0x34')](_0xae46('0x35'))[_0xae46('0x36')](_0xae46('0x37'))[_0xae46('0x37')]();if(_[_0xae46('0x38')](_0x21c6c5,_0x17b5e9[_0xae46('0x2b')])){return;}var _0x12bd87=_['find'](_0xe3c58,['value',_0x17b5e9[_0xae46('0x2b')]])[_0xae46('0x39')];return db[_0xae46('0x3a')][_0xae46('0x2f')]({'where':{'type':_0x12bd87,'resourceId':_0x17b5e9['id']}})[_0xae46('0x16')](function(){return _0x1af9dc;});})[_0xae46('0x16')](function(){_0x468612[_0xae46('0x22')](0xcc)[_0xae46('0x3b')]();});}};}function handleEntityNotFound(_0x3d374e){return function(_0x260e9b){if(!_0x260e9b){_0x3d374e[_0xae46('0x21')](0x194);}return _0x260e9b;};}function handleError(_0x1d4085,_0x372e36){_0x372e36=_0x372e36||0x1f4;return function(_0x2b5e22){logger[_0xae46('0x1b')](_0x2b5e22['stack']);if(_0x2b5e22[_0xae46('0x39')]){delete _0x2b5e22['name'];}_0x1d4085[_0xae46('0x22')](_0x372e36)[_0xae46('0x3c')](_0x2b5e22);};}function getUserAttributes(){return _(db[_0xae46('0x3d')][_0xae46('0x3e')])[_0xae46('0x36')](function(_0x2f9b77){return{'name':_0x2f9b77[_0xae46('0x3f')],'type':_0x2f9b77[_0xae46('0x40')][_0xae46('0x41')]};})['filter'](function(_0x31845f){return![_0xae46('0x42'),'salt',_0xae46('0x43'),'resetPasswordToken',_0xae46('0x44'),_0xae46('0x45'),_0xae46('0x46')]['includes'](_0x31845f['name']);})['value']();}exports[_0xae46('0x47')]=function(_0xaaff78,_0x2f5c83){var _0x31fe88={},_0x4119e6={'count':0x0,'rows':[]};var _0x125973=getUserAttributes();_0x31fe88=qs['getOptions'](_0x125973,_0xaaff78);var _0x342318={'where':_0x31fe88['where']};return db['User'][_0xae46('0x26')](_0x342318)[_0xae46('0x16')](function(_0xe37d7c){_0x4119e6['count']=_0xe37d7c;if(_0xaaff78['query']['includeAll']){_0x31fe88[_0xae46('0x48')]=[{'all':!![]}];}if(_0xaaff78[_0xae46('0x49')]['userSetting']===_0xae46('0x4a')){_0x31fe88[_0xae46('0x48')]=[{'model':db[_0xae46('0x4b')],'as':_0xae46('0x4c')}];}if(!_[_0xae46('0x38')](_0x31fe88['attributes'],'id')){_0x31fe88[_0xae46('0x4d')]['push']('id');}return db['User'][_0xae46('0x4e')](_0x31fe88);})['then'](function(_0x3d4601){_0x4119e6[_0xae46('0x4f')]=_0x3d4601;if(_0xaaff78[_0xae46('0x49')]['openTabs']===_0xae46('0x4a')){var _0x56e830=[];for(var _0xfc3faa=0x0;_0xfc3faa<_0x4119e6[_0xae46('0x4f')]['length'];_0xfc3faa++){_0x56e830[_0xae46('0x50')](get_open_tabs(_0xae46('0x51'),_0x4119e6[_0xae46('0x4f')][_0xfc3faa][_0xae46('0x52')]));_0x56e830[_0xae46('0x50')](get_open_tabs(_0xae46('0x53'),_0x4119e6['rows'][_0xfc3faa][_0xae46('0x52')]));_0x56e830['push'](get_open_tabs(_0xae46('0x54'),_0x4119e6['rows'][_0xfc3faa][_0xae46('0x52')]));_0x56e830[_0xae46('0x50')](get_open_tabs('mail',_0x4119e6[_0xae46('0x4f')][_0xfc3faa][_0xae46('0x52')]));_0x56e830[_0xae46('0x50')](get_open_tabs(_0xae46('0x55'),_0x4119e6[_0xae46('0x4f')][_0xfc3faa][_0xae46('0x52')]));_0x56e830['push'](get_open_tabs(_0xae46('0x56'),_0x4119e6['rows'][_0xfc3faa][_0xae46('0x52')]));}return Promise['all'](_0x56e830)['then'](function(){return _0x4119e6;});}else{return _0x4119e6;}})[_0xae46('0x16')](respondWithFilteredResult(_0x2f5c83,_0x31fe88))[_0xae46('0x20')](handleError(_0x2f5c83,null));};exports['show']=function(_0x190ad6,_0x1d7f44){var _0xf4a851=getUserAttributes();_0x190ad6[_0xae46('0x49')]['id']=_0x190ad6[_0xae46('0x57')]['id'];var _0x30cc18=qs[_0xae46('0x58')](_0xf4a851,_0x190ad6);if(_0x190ad6['query'][_0xae46('0x59')]){_0x30cc18['include']=[{'all':!![]}];}if(_0x190ad6[_0xae46('0x49')][_0xae46('0x4c')]===_0xae46('0x4a')){_0x30cc18[_0xae46('0x48')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x30cc18=_[_0xae46('0x5a')]({},_0x30cc18,_0x190ad6[_0xae46('0x5b')]);if(!_[_0xae46('0x38')](_0x30cc18[_0xae46('0x4d')],'id')){_0x30cc18[_0xae46('0x4d')]['push']('id');}return db[_0xae46('0x3d')][_0xae46('0x5c')](_0x30cc18)['then'](handleEntityNotFound(_0x1d7f44,null))[_0xae46('0x16')](function(_0x376f74){var _0x39c9c6=[];values=_0x376f74;if(_0x190ad6['query'][_0xae46('0x5d')]==='true'){_0x39c9c6[_0xae46('0x50')](get_open_tabs('chat',_0x376f74['dataValues']));_0x39c9c6['push'](get_open_tabs(_0xae46('0x53'),_0x376f74[_0xae46('0x52')]));_0x39c9c6[_0xae46('0x50')](get_open_tabs(_0xae46('0x55'),_0x376f74[_0xae46('0x52')]));_0x39c9c6['push'](get_open_tabs('whatsapp',_0x376f74[_0xae46('0x52')]));_0x39c9c6[_0xae46('0x50')](get_open_tabs('fax',_0x376f74['dataValues']));_0x39c9c6[_0xae46('0x50')](get_open_tabs(_0xae46('0x5e'),_0x376f74[_0xae46('0x52')]));return Promise['all'](_0x39c9c6);}else{return values;}})['then'](function(){return values;})[_0xae46('0x16')](respondWithResult(_0x1d7f44,null))['catch'](handleError(_0x1d7f44,null));};exports[_0xae46('0x2a')]=function(_0x33c23d,_0x25f666){if(_0x33c23d[_0xae46('0x5f')]['id']){delete _0x33c23d[_0xae46('0x5f')]['id'];}delete _0x33c23d[_0xae46('0x5f')][_0xae46('0x2b')];return db[_0xae46('0x3d')][_0xae46('0x5c')]({'where':{'id':_0x33c23d[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x25f666,null))[_0xae46('0x16')](saveUpdates(_0x33c23d[_0xae46('0x5f')],null))[_0xae46('0x16')](respondWithResult(_0x25f666,null))[_0xae46('0x20')](handleError(_0x25f666,null));};exports[_0xae46('0x60')]=function(_0x4a91f4,_0x22943b){return db[_0xae46('0x3d')][_0xae46('0x60')]()['then'](respondWithResult(_0x22943b,null))[_0xae46('0x20')](handleError(_0x22943b,null));};exports['addContacts']=function(_0x58cbd6,_0x571d28){return db[_0xae46('0x3d')][_0xae46('0x5c')]({'where':{'id':_0x58cbd6[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x571d28,null))[_0xae46('0x16')](function(_0x33aac2){if(_0x33aac2){return _0x33aac2[_0xae46('0x61')](_0x58cbd6[_0xae46('0x5f')]['ids'],_[_0xae46('0x62')](_0x58cbd6['body'],[_0xae46('0x63'),'id'])||{});}})[_0xae46('0x16')](respondWithResult(_0x571d28,null))[_0xae46('0x20')](handleError(_0x571d28,null));};function validateUser(_0x1d3cd4){return new Promise(function(_0x1b0622,_0x56e46e){if(_0x1d3cd4[_0xae46('0x64')])return _0x1b0622(_0x1d3cd4);return db[_0xae46('0x65')][_0xae46('0x66')](0x1)[_0xae46('0x16')](function(_0x3ea04c){if(_0x3ea04c[_0xae46('0x67')])authService[_0xae46('0x68')](_0x1d3cd4[_0xae46('0x42')]);db['User'][_0xae46('0x69')](_0xae46('0x64'))[_0xae46('0x16')](function(_0x3168fb){if(_[_0xae46('0x6a')](_0x3168fb)){_0x1d3cd4[_0xae46('0x64')]=_0x3ea04c[_0xae46('0x6b')]||0x1;return;}if(_[_0xae46('0x6a')](_0x3ea04c[_0xae46('0x6b')])||_0x3ea04c[_0xae46('0x6b')]===_0x3168fb){_0x1d3cd4[_0xae46('0x64')]=_0x3168fb+0x1;return;}if(_0x3ea04c[_0xae46('0x6b')]>_0x3168fb){_0x1d3cd4[_0xae46('0x64')]=_0x3ea04c[_0xae46('0x6b')];return;}return db[_0xae46('0x6c')][_0xae46('0x49')]('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[_0xae46('0x6c')][_0xae46('0x6d')]['SELECT']})[_0xae46('0x16')](function(_0x4a03ed){if(_0x4a03ed&&_0x4a03ed[_0xae46('0x6e')]){for(var _0x89e653=0x0,_0x232d2b=_0x4a03ed['length'];_0x89e653<_0x232d2b&&_[_0xae46('0x6a')](_0x1d3cd4[_0xae46('0x64')]);_0x89e653++){if(_0x3ea04c[_0xae46('0x6b')]<=_0x4a03ed[_0x89e653][_0xae46('0x6f')]){_0x1d3cd4['internal']=_0x4a03ed[_0x89e653]['from'];}else if(_0x3ea04c[_0xae46('0x6b')]>_0x4a03ed[_0x89e653][_0xae46('0x6f')]&&_0x3ea04c[_0xae46('0x6b')]<=_0x4a03ed[_0x89e653]['to']){_0x1d3cd4[_0xae46('0x64')]=_0x3ea04c[_0xae46('0x6b')];}}}if(_['isNil'](_0x1d3cd4[_0xae46('0x64')])){_0x1d3cd4[_0xae46('0x64')]=_0x3168fb+0x1;}return _0x1b0622(_0x1d3cd4);});});})['catch'](function(_0x822a5b){_0x56e46e(_0x822a5b);});});}function updateUser(_0x106e0d){return new Promise(function(_0x4ec647,_0xdfdb1e){try{if(_0x106e0d[_0xae46('0x70')]){_0x106e0d[_0xae46('0x71')]=_0x106e0d[_0xae46('0x64')];_0x106e0d[_0xae46('0x72')]={'mailbox':_0x106e0d['internal'],'password':_0x106e0d[_0xae46('0x42')],'fullname':_0x106e0d['fullname'],'email':_0x106e0d['email']};}if(_0x106e0d[_0xae46('0x2b')]==='agent'){if(!_0x106e0d[_0xae46('0x73')])_0x106e0d['permissions']=[_0xae46('0x74'),_0xae46('0x75'),'103',_0xae46('0x76'),_0xae46('0x77'),_0xae46('0x78'),_0xae46('0x79'),_0xae46('0x7a'),_0xae46('0x7b'),'108','109','100',_0xae46('0x7c'),'114','115'];}_0x4ec647(_0x106e0d);}catch(_0x5404ca){_0xdfdb1e(_0x5404ca);}});}exports['create']=function(_0x4146b6,_0x46f4b0){if(_0x4146b6[_0xae46('0x7d')]['role']==='agent')throw new Error('Unauthorized');if(_0x4146b6[_0xae46('0x5f')]['role']===_0xae46('0x7d')&&_0x4146b6[_0xae46('0x7d')][_0xae46('0x2b')]!==_0xae46('0x7e')){throw new Error(_0xae46('0x7f'));}if(_0x4146b6[_0xae46('0x5f')]['role']===_0xae46('0x7e')&&_0x4146b6[_0xae46('0x7d')][_0xae46('0x2b')]!==_0xae46('0x7e')){throw new Error(_0xae46('0x80'));}return licenseUtil['checkUserLimits']([_0x4146b6[_0xae46('0x5f')]])['then'](function(){return validateUser(_0x4146b6[_0xae46('0x5f')]);})[_0xae46('0x16')](function(_0x2df681){return updateUser(_0x2df681)['then'](function(_0x5064b2){if(_0x5064b2['role']===_0xae46('0x7e')){_0x5064b2[_0xae46('0x81')]=_0x4146b6[_0xae46('0x7d')][_0xae46('0x81')];delete _0x5064b2['userProfileId'];}return _0x5064b2;});})[_0xae46('0x16')](function(_0x5953a2){return db[_0xae46('0x3d')][_0xae46('0x82')](_0x5953a2,{'include':[{'model':db['VoiceMail'],'as':_0xae46('0x72')}]});})[_0xae46('0x16')](function(_0x542669){if(_0x4146b6['body'][_0xae46('0x2b')]===_0xae46('0x7d'))return _0x542669;if(_0x4146b6[_0xae46('0x7d')][_0xae46('0x2b')]!==_0xae46('0x7d'))return _0x542669;return db[_0xae46('0x83')]['find']({'where':{'name':_0x542669[_0xae46('0x2b')]===_0xae46('0x2c')?'Agents':_0xae46('0x32'),'userProfileId':_0x4146b6[_0xae46('0x7d')][_0xae46('0x84')]},'raw':!![]})['then'](function(_0x4532d2){if(!_0x4532d2||_0x4532d2[_0xae46('0x85')]!=0x0)return _0x542669;return db['UserProfileResource'][_0xae46('0x82')]({'name':_0x542669['name'],'resourceId':_0x542669['id'],'type':_0x4532d2['name'],'sectionId':_0x4532d2['id']},{})[_0xae46('0x16')](function(){return _0x542669;});})[_0xae46('0x20')](function(_0x27a4c7){logger['error'](_0xae46('0x86'),_0x27a4c7);throw _0x27a4c7;});})[_0xae46('0x16')](respondWithResult(_0x46f4b0,0xc9))[_0xae46('0x20')](handleError(_0x46f4b0,null));};exports[_0xae46('0x87')]=function(_0x231354,_0x19ba0e){var _0x5dabea=_0x231354[_0xae46('0x5f')];var _0x852753=[];if(_0x231354['user'][_0xae46('0x2b')]==='agent')throw new Error('Unauthorized');if(_[_0xae46('0x88')](_0x5dabea,['role',_0xae46('0x7d')])&&_0x231354[_0xae46('0x7d')]['role']!==_0xae46('0x7e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xae46('0x88')](_0x5dabea,[_0xae46('0x2b'),_0xae46('0x7e')])&&_0x231354[_0xae46('0x7d')][_0xae46('0x2b')]!==_0xae46('0x7e')){throw new Error(_0xae46('0x89'));}return licenseUtil['checkUserLimits'](_0x5dabea)[_0xae46('0x16')](function(){return validateUser(_0x5dabea[0x0]);})[_0xae46('0x16')](function(){for(var _0x22dd2a=0x1;_0x22dd2a<_0x5dabea[_0xae46('0x6e')];_0x22dd2a++){var _0x5d120b=_0x5dabea[_0x22dd2a-0x1][_0xae46('0x64')];if(!_0x5dabea[_0x22dd2a]['internal'])_0x5dabea[_0x22dd2a]['internal']=_0x5d120b+0x1;_0x852753[_0xae46('0x50')](validateUser(_0x5dabea[_0x22dd2a]));}return Promise[_0xae46('0x8a')](_0x852753);})[_0xae46('0x16')](function(){_0x852753=[];for(var _0x1a0147=0x0;_0x1a0147<_0x5dabea[_0xae46('0x6e')];_0x1a0147++){_0x852753[_0xae46('0x50')](updateUser(_0x5dabea[_0x1a0147]));}return Promise[_0xae46('0x8a')](_0x852753);})[_0xae46('0x16')](function(){_0x852753=_0x5dabea[_0xae46('0x36')](function(_0x7a2b8d){return db[_0xae46('0x3d')][_0xae46('0x82')](_0x7a2b8d,{'include':[{'model':db[_0xae46('0x72')],'as':'VoiceMail'}]})[_0xae46('0x16')](function(_0x5c7f82){_0x7a2b8d['id']=_0x5c7f82['id'];return _0x7a2b8d;});});return Promise['all'](_0x852753);})[_0xae46('0x16')](function(_0x166c44){if(_0x231354[_0xae46('0x5f')][_0xae46('0x2b')]===_0xae46('0x7d'))return _0x166c44;if(_0x231354[_0xae46('0x7d')]['role']!=='user')return _0x166c44;var _0x1c0eee=_[_0xae46('0x88')](_0x166c44,function(_0x4bfa44){return _0x4bfa44['role']==='agent'||_0x4bfa44[_0xae46('0x2b')]===_0xae46('0x33');});if(!_0x1c0eee)return _0x166c44;return db['UserProfileSection'][_0xae46('0x4e')]({'where':{'name':{'$or':[_0xae46('0x31'),_0xae46('0x32')]},'userProfileId':_0x231354[_0xae46('0x7d')][_0xae46('0x84')]},'raw':!![]})[_0xae46('0x16')](function(_0x5ebecd){if(_['isEmpty'](_0x5ebecd)||!_[_0xae46('0x88')](_0x5ebecd,[_0xae46('0x85'),0x0]))return _0x166c44;_0x852753=[];var _0x69f4bf=_(_0x5ebecd)[_0xae46('0x36')](function(_0x2d258e){if(_0x2d258e[_0xae46('0x85')]===0x1)return;return _0x2d258e['name']===_0xae46('0x31')?_0xae46('0x2c'):_0xae46('0x33');})['compact']()['value']();for(var _0xabdfff=0x0;_0xabdfff<_0x166c44[_0xae46('0x6e')];_0xabdfff++){if(!_[_0xae46('0x38')](_0x69f4bf,_0x166c44[_0xabdfff][_0xae46('0x2b')]))return;var _0x1c9f84=_0x166c44[_0xabdfff][_0xae46('0x2b')]===_0xae46('0x2c')?_0xae46('0x31'):_0xae46('0x32');_0x852753[_0xae46('0x50')](db[_0xae46('0x3a')][_0xae46('0x82')]({'name':_0x166c44[_0xabdfff]['name'],'resourceId':_0x166c44[_0xabdfff]['id'],'type':_0x1c9f84,'sectionId':_[_0xae46('0x5c')](_0x5ebecd,[_0xae46('0x39'),_0x1c9f84])['id']},{}));}return Promise['all'](_0x852753);});})[_0xae46('0x16')](respondWithResult(_0x19ba0e,0xc9))[_0xae46('0x20')](handleError(_0x19ba0e,null));};exports['changePassword']=function(_0x37b107,_0x234744){if(_0x37b107['body']['id']){delete _0x37b107[_0xae46('0x5f')]['id'];}return db[_0xae46('0x3d')]['find']({'where':{'id':_0x37b107[_0xae46('0x57')]['id']}})['then'](function(_0x535df6){if(!_0x535df6)return null;if(_0x535df6['id']===_0x37b107[_0xae46('0x7d')]['id']){if(!_0x37b107['body'][_0xae46('0x8b')]||!_0x37b107[_0xae46('0x5f')][_0xae46('0x8c')]){throw new db[(_0xae46('0x8d'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x535df6[_0xae46('0x8e')](_0x37b107[_0xae46('0x5f')][_0xae46('0x8b')])){throw new db[(_0xae46('0x8d'))][(_0xae46('0x8f'))](_0xae46('0x90'));}if(_0x37b107[_0xae46('0x5f')][_0xae46('0x8b')]===_0x37b107[_0xae46('0x5f')]['newPassword']){throw new db[(_0xae46('0x8d'))][(_0xae46('0x8f'))](_0xae46('0x91'));}}else if(_0x37b107[_0xae46('0x7d')][_0xae46('0x2b')]===_0xae46('0x7e')){if(!_0x37b107[_0xae46('0x5f')]['newPassword']){throw new db[(_0xae46('0x8d'))]['ValidationError'](_0xae46('0x92'));}}else if(_0x37b107[_0xae46('0x7d')][_0xae46('0x2b')]==='user'){if(!_0x37b107[_0xae46('0x5f')][_0xae46('0x8c')]){throw new db[(_0xae46('0x8d'))][(_0xae46('0x8f'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x535df6[_0xae46('0x2b')]!=='agent'){throw new db[(_0xae46('0x8d'))][(_0xae46('0x8f'))](_0xae46('0x93'));}}else{throw new db[(_0xae46('0x8d'))][(_0xae46('0x8f'))](_0xae46('0x93'));}return _0x535df6;})['then'](handleEntityNotFound(_0x234744,null))[_0xae46('0x16')](function(_0x33ab2f){return db[_0xae46('0x65')][_0xae46('0x94')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0xae46('0x16')](function(_0x35d2f8){if(_0x35d2f8['securePassword'])authService[_0xae46('0x68')](_0x37b107[_0xae46('0x5f')]['newPassword']);if(!_0x35d2f8['enforcePasswordHistory']||!_0x33ab2f[_0xae46('0x43')])return _0x33ab2f;authService[_0xae46('0x95')](_0x37b107['body'][_0xae46('0x8c')],_0x33ab2f['previousPasswords'],_0x35d2f8[_0xae46('0x96')]);return _0x33ab2f;})['then'](saveUpdates({'password':_0x37b107[_0xae46('0x5f')]['newPassword'],'passwordResetAt':_0x37b107[_0xae46('0x7d')]['id']==_0x37b107['params']['id']?moment():null,'previousPasswords':authService[_0xae46('0x97')](_0x37b107['body']['newPassword'],_0x33ab2f['previousPasswords'])},null));})[_0xae46('0x16')](respondWithResult(_0x234744,null))[_0xae46('0x20')](handleError(_0x234744,null));};exports[_0xae46('0x98')]=function(_0x729ab5,_0x22c29b){var _0x1b7c9d=_0x729ab5[_0xae46('0x5f')]['channel'];return db[_0xae46('0x3d')][_0xae46('0x5c')]({'where':{'id':_0x729ab5[_0xae46('0x57')]['id']},'attributes':['id',_0xae46('0x39'),'role',_0xae46('0x99'),_0xae46('0x9a'),'voicePause',_0xae46('0x9b')]})[_0xae46('0x16')](handleEntityNotFound(_0x22c29b,null))[_0xae46('0x16')](function(_0x48dac8){if(_0x48dac8){if(!utils[_0xae46('0x9c')](_0x1b7c9d)){throw new db['Sequelize'][(_0xae46('0x8f'))]('Unknown\x20channel');}return _0x48dac8['add'+_[_0xae46('0x9d')](_0x1b7c9d[_0xae46('0x9e')]())+_0xae46('0x9f')](_0x729ab5['body']['ids'],{'penalty':_0x729ab5[_0xae46('0x5f')][_0xae46('0xa0')]||0x0})[_0xae46('0xa1')](function(_0x276aa5){for(var _0x590a7f=0x0;_0x590a7f<_0x729ab5[_0xae46('0x5f')][_0xae46('0x63')][_0xae46('0x6e')];_0x590a7f+=0x1){var _0x101be5={'UserId':Number(_0x729ab5['params']['id'])};_0x101be5[_[_0xae46('0x9d')](_0x1b7c9d[_0xae46('0x9e')]())+_0xae46('0xa2')]=Number(_0x729ab5['body'][_0xae46('0x63')][_0x590a7f]);socket[_0xae46('0x2d')](_0xae46('0x7d')+_['capitalize'](_0x1b7c9d[_0xae46('0x9e')]())+_0xae46('0xa3'),_0x101be5);}return _0x276aa5;})[_0xae46('0x16')](function(){if(_0x1b7c9d===_0xae46('0xa4')){return db[_0xae46('0xa5')][_0xae46('0x4e')]({'where':{'id':_0x729ab5[_0xae46('0x5f')][_0xae46('0x63')]||[]},'raw':!![],'attributes':['id',_0xae46('0x39')]});}})['then'](function(_0x51c5a5){var _0x25a633=_0x48dac8[_0xae46('0xa6')]({'plain':!![]});var _0x2f0246=[];if(_0x1b7c9d===_0xae46('0xa4')&&_0x25a633[_0xae46('0x2b')]===_0xae46('0x2c')&&_0x25a633[_0xae46('0x99')]){for(let _0x18ecf0=0x0;_0x18ecf0<_0x51c5a5['length'];_0x18ecf0+=0x1){_0x2f0246[_0xae46('0x50')]({'membername':_0x25a633[_0xae46('0x39')],'UserId':_0x25a633['id'],'queue_name':_0x51c5a5[_0x18ecf0][_0xae46('0x39')],'VoiceQueueId':_0x51c5a5[_0x18ecf0]['id'],'interface':_[_0xae46('0x6a')](_0x25a633[_0xae46('0x9b')])?util[_0xae46('0xa7')](_0xae46('0xa8'),_0x25a633['name']):_0x25a633['interface'],'paused':_0x25a633[_0xae46('0xa9')]||![],'penalty':_0x729ab5[_0xae46('0x5f')][_0xae46('0xa0')]||0x0});}return Promise[_0xae46('0x8a')](_0x2f0246[_0xae46('0x36')](function(_0x233699){return db[_0xae46('0xaa')][_0xae46('0xab')](_0x233699);}));}return _0x48dac8;});}})[_0xae46('0x16')](respondWithStatusCode(_0x22c29b,null))['catch'](handleError(_0x22c29b,null));};exports[_0xae46('0xac')]=function(_0x5bae64,_0x32801a){var _0x45ac1a,_0xf109cc;return db[_0xae46('0x3d')]['find']({'where':{'id':_0x5bae64[_0xae46('0x57')]['id']},'attributes':['id',_0xae46('0x39'),'role']})['then'](handleEntityNotFound(_0x32801a,null))[_0xae46('0x16')](function(_0x2e02f5){if(_0x2e02f5){_0x45ac1a=_0x2e02f5;if(!_0x5bae64['query']['channel']||!utils[_0xae46('0x9c')](_0x5bae64[_0xae46('0x49')][_0xae46('0xad')])){throw new db[(_0xae46('0x8d'))][(_0xae46('0x8f'))](_0xae46('0xae'));}return _0x2e02f5[_0xae46('0xaf')+_[_0xae46('0x9d')](_0x5bae64[_0xae46('0x49')][_0xae46('0xad')]['toLowerCase']())+_0xae46('0x9f')](_0x5bae64[_0xae46('0x49')][_0xae46('0x63')]);}})[_0xae46('0x16')](function(_0x4106f8){if(_[_0xae46('0xb0')](_0x5bae64[_0xae46('0x49')]['ids'])){for(var _0x1163b5=0x0;_0x1163b5<_0x5bae64[_0xae46('0x49')][_0xae46('0x63')]['length'];_0x1163b5+=0x1){_0xf109cc={'UserId':Number(_0x5bae64['params']['id'])};_0xf109cc[_[_0xae46('0x9d')](_0x5bae64[_0xae46('0x49')][_0xae46('0xad')][_0xae46('0x9e')]())+_0xae46('0xa2')]=Number(_0x5bae64[_0xae46('0x49')][_0xae46('0x63')][_0x1163b5]);socket['emit']('user'+_[_0xae46('0x9d')](_0x5bae64[_0xae46('0x49')][_0xae46('0xad')][_0xae46('0x9e')]())+'Queue:remove',_0xf109cc);}}else{_0xf109cc={'UserId':Number(_0x5bae64[_0xae46('0x57')]['id'])};_0xf109cc[_[_0xae46('0x9d')](_0x5bae64[_0xae46('0x49')][_0xae46('0xad')][_0xae46('0x9e')]())+'QueueId']=Number(_0x5bae64[_0xae46('0x49')][_0xae46('0x63')]);socket[_0xae46('0x2d')](_0xae46('0x7d')+_[_0xae46('0x9d')](_0x5bae64[_0xae46('0x49')]['channel'][_0xae46('0x9e')]())+'Queue:remove',_0xf109cc);}return _0x4106f8;})[_0xae46('0x16')](function(){if(_0x5bae64[_0xae46('0x49')][_0xae46('0xad')]===_0xae46('0xa4')){return db[_0xae46('0xaa')][_0xae46('0x2f')]({'where':{'UserId':_0x5bae64[_0xae46('0x57')]['id'],'VoiceQueueId':_0x5bae64[_0xae46('0x49')]['ids']},'individualHooks':!![]})[_0xae46('0x16')](function(){return _0x45ac1a;});}return _0x45ac1a;})[_0xae46('0x16')](respondWithStatusCode(_0x32801a,null))[_0xae46('0x20')](handleError(_0x32801a,null));};exports['addAvatar']=function(_0x25375c,_0x562870){_0x25375c['body']['userpic']=_0x25375c['file']['filename'];return db[_0xae46('0x3d')][_0xae46('0x5c')]({'where':{'id':_0x25375c[_0xae46('0x57')]['id']}})['then'](handleEntityNotFound(_0x562870,null))[_0xae46('0x16')](saveUpdates(_0x25375c[_0xae46('0x5f')],null))['then'](respondWithResult(_0x562870,null))[_0xae46('0x20')](handleError(_0x562870,null));};exports['getAvatar']=function(_0x4d8c37,_0x35816f){var _0x40aa5f=path[_0xae46('0xb1')](config[_0xae46('0xb2')],_0xae46('0xb3'));return db['User']['find']({'where':{'id':_0x4d8c37[_0xae46('0x57')]['id']},'attributes':['id',_0xae46('0xb4')],'raw':!![]})[_0xae46('0x16')](handleEntityNotFound(_0x35816f,null))[_0xae46('0x16')](function(_0x1df644){if(_0x1df644){if(_[_0xae46('0x6a')](_0x1df644[_0xae46('0xb4')])){return _0x35816f[_0xae46('0xb5')](_0x40aa5f);}else{if(!fs['existsSync'](path[_0xae46('0xb1')](config['root'],_0xae46('0xb6'),_0x1df644['userpic']))){return _0x35816f[_0xae46('0xb5')](_0x40aa5f);}return _0x35816f[_0xae46('0xb5')](path[_0xae46('0xb1')](config[_0xae46('0xb2')],'server/files/images/',_0x1df644[_0xae46('0xb4')]));}}})[_0xae46('0x20')](handleError(_0x35816f,null));};exports[_0xae46('0xb7')]=function(_0x5375b5,_0xc45b66){return db[_0xae46('0x3d')][_0xae46('0x5c')]({'where':{'id':_0x5375b5[_0xae46('0x57')]['id']},'attributes':['id']})[_0xae46('0x16')](handleEntityNotFound(_0xc45b66,null))['then'](function(_0x30b62f){var _0x58ac18=[];values=_0x30b62f[_0xae46('0x52')];_0x58ac18[_0xae46('0x50')](get_open_tabs(_0xae46('0x51'),_0x30b62f['dataValues']));_0x58ac18[_0xae46('0x50')](get_open_tabs(_0xae46('0x53'),_0x30b62f[_0xae46('0x52')]));_0x58ac18[_0xae46('0x50')](get_open_tabs(_0xae46('0x55'),_0x30b62f[_0xae46('0x52')]));_0x58ac18[_0xae46('0x50')](get_open_tabs(_0xae46('0x56'),_0x30b62f[_0xae46('0x52')]));_0x58ac18[_0xae46('0x50')](get_open_tabs('fax',_0x30b62f[_0xae46('0x52')]));_0x58ac18['push'](get_open_tabs('mail',_0x30b62f[_0xae46('0x52')]));return Promise[_0xae46('0x8a')](_0x58ac18);})['then'](function(_0x56b7a5){if(_0x56b7a5){var _0x39bf8d=_[_0xae46('0x36')](values[_0xae46('0xb8')],function(_0x2e06d4){return{'channel':_0xae46('0xb9'),'id':_0x2e06d4['id'],'createdAt':_0x2e06d4['createdAt']};});var _0xfe926c=_[_0xae46('0x36')](values['FaxOpenTabs'],function(_0x1d49ac){return{'channel':_0xae46('0xba'),'id':_0x1d49ac['id'],'createdAt':_0x1d49ac[_0xae46('0xbb')]};});var _0xe5989a=_['map'](values[_0xae46('0xbc')],function(_0x649e5b){return{'channel':_0xae46('0xbd'),'id':_0x649e5b['id'],'createdAt':_0x649e5b[_0xae46('0xbb')]};});var _0x3e4bbc=_[_0xae46('0x36')](values[_0xae46('0xbe')],function(_0xce7e73){return{'channel':_0xae46('0xbf'),'id':_0xce7e73['id'],'createdAt':_0xce7e73[_0xae46('0xbb')]};});var _0x34f246=_[_0xae46('0x36')](values[_0xae46('0xc0')],function(_0x570c51){return{'channel':_0xae46('0xc1'),'id':_0x570c51['id'],'createdAt':_0x570c51[_0xae46('0xbb')]};});var _0x3527c4=_['map'](values[_0xae46('0xc2')],function(_0x361b52){return{'channel':_0xae46('0xc3'),'id':_0x361b52['id'],'createdAt':_0x361b52[_0xae46('0xbb')]};});var _0x58d85f=_[_0xae46('0xc4')](_0x39bf8d,_0xfe926c,_0xe5989a,_0x3e4bbc,_0x34f246,_0x3527c4);var _0x1b44a8={'count':_0x58d85f['length'],'rows':_0x58d85f};return _0x1b44a8;}else return null;})[_0xae46('0x16')](respondWithResult(_0xc45b66,null))[_0xae46('0x20')](handleError(_0xc45b66,null));};exports[_0xae46('0xc5')]=function(_0x554ad0,_0x5475b0){var _0x466d47={};return db['User'][_0xae46('0x94')]({'where':{'id':_0x554ad0[_0xae46('0x57')]['id']}})[_0xae46('0x16')](function(_0x14bf12){if(!_0x14bf12){throw new APINotFoundError(util[_0xae46('0xa7')](_0xae46('0xc6'),_0x554ad0['params']['id']));}return contacts[_0xae46('0x60')]();})[_0xae46('0x16')](function(_0x53dfef){_0x554ad0['query']['User']=_0x554ad0['params']['id'];_0x466d47=qs[_0xae46('0x58')](_0x53dfef,_0x554ad0);if(_0x554ad0[_0xae46('0x49')][_0xae46('0xc7')](_0xae46('0x59'))){_0x466d47[_0xae46('0x48')]=[{'model':db['CmList'],'as':_0xae46('0xc8'),'required':![]},{'model':db[_0xae46('0xc9')],'as':_0xae46('0xca'),'attributes':['id',_0xae46('0x39'),_0xae46('0xcb')],'where':_0x554ad0['query'][_0xae46('0xcc')]?{'id':_0x554ad0['query'][_0xae46('0xcc')]}:undefined,'required':_0x554ad0[_0xae46('0x49')]['tag']?!![]:![]}];}return contacts[_0xae46('0x4e')](_0x554ad0[_0xae46('0x49')],_0x554ad0[_0xae46('0x7d')],_0x466d47,_0x53dfef);})[_0xae46('0x16')](respondWithFilteredResult(_0x5475b0,_0x466d47))[_0xae46('0x20')](APIHandleError(_0x5475b0));};exports[_0xae46('0xcd')]=function(_0x31c20b,_0x41abfd){var _0x1e51a7;var _0xa076b9={};var _0x49cd45;return db['User'][_0xae46('0x94')]({'where':{'id':_0x31c20b[_0xae46('0x57')]['id']},'attributes':['id',_0xae46('0x39'),'role']})[_0xae46('0x16')](handleEntityNotFound(_0x41abfd,null))[_0xae46('0x16')](function(_0x4e6ad7){if(!utils[_0xae46('0x9c')](_0x31c20b[_0xae46('0x49')]['channel'])){throw new db[(_0xae46('0x8d'))]['ValidationError'](_0xae46('0xae'));}_0x1e51a7=_0x4e6ad7;var _0x12331e={};_0x12331e['model']=_[_0xae46('0xce')](db[_[_0xae46('0x9d')](_0x31c20b['query'][_0xae46('0xad')])+_0xae46('0xcf')][_0xae46('0x3e')]);_0x12331e[_0xae46('0x49')]=_[_0xae46('0xce')](_0x31c20b[_0xae46('0x49')]);_0x12331e[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x12331e[_0xae46('0xd2')],_0x12331e[_0xae46('0x49')]);_0xa076b9['attributes']=_['intersection'](_0x12331e[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0x31c20b[_0xae46('0x49')][_0xae46('0xd3')]));_0xa076b9[_0xae46('0x4d')]=_0xa076b9[_0xae46('0x4d')][_0xae46('0x6e')]?_0xa076b9[_0xae46('0x4d')]:_0x12331e[_0xae46('0xd2')];_0xa076b9[_0xae46('0xd4')]=qs[_0xae46('0xd5')](_0x31c20b[_0xae46('0x49')][_0xae46('0xd5')]);_0xa076b9[_0xae46('0xd6')]=qs['filters'](_[_0xae46('0xd7')](_0x31c20b[_0xae46('0x49')],_0x12331e[_0xae46('0xd0')]));if(_0x31c20b['query'][_0xae46('0x34')]){_0xa076b9['where']=_[_0xae46('0x5a')](_0xa076b9[_0xae46('0xd6')],{'$or':_['map'](_0xa076b9['attributes'],function(_0x166396){var _0x20798d={};_0x20798d[_0x166396]={'$like':'%'+_0x31c20b[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x20798d;})});}_0xa076b9=_[_0xae46('0x5a')]({},_0xa076b9,_0x31c20b['options']);switch(_0x1e51a7[_0xae46('0x2b')]){case _0xae46('0x7e'):return db[_[_0xae46('0x9d')](_0x31c20b[_0xae46('0x49')][_0xae46('0xad')])+'Queue'][_0xae46('0x4e')](_0xa076b9);case'user':case _0xae46('0x2c'):return _0x1e51a7[_0xae46('0xa6')+_[_0xae46('0x9d')](_0x31c20b[_0xae46('0x49')][_0xae46('0xad')])+_0xae46('0x9f')](_0xa076b9);default:throw new db['Sequelize'][(_0xae46('0x8f'))](_0xae46('0xd8'));}})[_0xae46('0x16')](function(_0x1dccfd){_0x49cd45=_0x1dccfd[_0xae46('0x6e')];if(!_0x31c20b[_0xae46('0x49')][_0xae46('0xc7')](_0xae46('0xd9'))){_0xa076b9[_0xae46('0x25')]=qs['limit'](_0x31c20b[_0xae46('0x49')][_0xae46('0x25')]);_0xa076b9['offset']=qs[_0xae46('0x23')](_0x31c20b['query'][_0xae46('0x23')]);}switch(_0x1e51a7['role']){case _0xae46('0x7e'):return db[_[_0xae46('0x9d')](_0x31c20b['query'][_0xae46('0xad')])+_0xae46('0xcf')][_0xae46('0x4e')](_0xa076b9);case _0xae46('0x7d'):case _0xae46('0x2c'):return _0x1e51a7['get'+_[_0xae46('0x9d')](_0x31c20b['query'][_0xae46('0xad')])+_0xae46('0x9f')](_0xa076b9);}})[_0xae46('0x16')](function(_0x7e935e){return{'count':_0x49cd45,'rows':_0x7e935e};})[_0xae46('0x16')](respondWithResult(_0x41abfd,null))[_0xae46('0x20')](handleError(_0x41abfd,null));};exports[_0xae46('0xda')]=function(_0x544e33,_0x5663e4){var _0x5b4261={};var _0x4c444a={};var _0x55f18a;var _0x4e76a6;return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x544e33[_0xae46('0x57')]['id']}})['then'](handleEntityNotFound(_0x5663e4,null))['then'](function(_0x3965c7){if(_0x3965c7){_0x55f18a=_0x3965c7;_0x4c444a['model']=_[_0xae46('0xce')](db[_0xae46('0xaa')][_0xae46('0x3e')]);_0x4c444a[_0xae46('0x49')]=_[_0xae46('0xce')](_0x544e33['query']);_0x4c444a[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x4c444a[_0xae46('0xd2')],_0x4c444a[_0xae46('0x49')]);_0x5b4261['attributes']=_[_0xae46('0xd1')](_0x4c444a['model'],qs[_0xae46('0xd3')](_0x544e33[_0xae46('0x49')]['fields']));_0x5b4261['attributes']=_0x5b4261[_0xae46('0x4d')][_0xae46('0x6e')]?_0x5b4261[_0xae46('0x4d')]:_0x4c444a[_0xae46('0xd2')];_0x5b4261['order']=qs[_0xae46('0xd5')](_0x544e33['query'][_0xae46('0xd5')]);_0x5b4261[_0xae46('0xd6')]=qs['filters'](_[_0xae46('0xd7')](_0x544e33[_0xae46('0x49')],_0x4c444a[_0xae46('0xd0')]));if(_0x544e33[_0xae46('0x49')][_0xae46('0x34')]){_0x5b4261[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x5b4261[_0xae46('0xd6')],{'$or':_[_0xae46('0x36')](_0x5b4261[_0xae46('0x4d')],function(_0x4578f8){var _0x57f5fb={};_0x57f5fb[_0x4578f8]={'$like':'%'+_0x544e33[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x57f5fb;})});}_0x5b4261=_['merge']({},_0x5b4261,_0x544e33[_0xae46('0x5b')]);return _0x55f18a['getVoiceQueuesRt'](_0x5b4261);}})[_0xae46('0x16')](function(_0x53e428){if(_0x53e428){_0x4e76a6=_0x53e428[_0xae46('0x6e')];if(!_0x544e33[_0xae46('0x49')][_0xae46('0xc7')]('nolimit')){_0x5b4261[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x544e33['query'][_0xae46('0x25')]);_0x5b4261[_0xae46('0x23')]=qs['offset'](_0x544e33[_0xae46('0x49')][_0xae46('0x23')]);}return _0x55f18a[_0xae46('0xda')](_0x5b4261);}})[_0xae46('0x16')](function(_0x58a0d1){if(_0x58a0d1){return _0x58a0d1?{'count':_0x4e76a6,'rows':_0x58a0d1}:null;}})[_0xae46('0x16')](respondWithResult(_0x5663e4,null))[_0xae46('0x20')](handleError(_0x5663e4,null));};exports['getGroups']=function(_0x3f63de,_0x34c63b){var _0x48db6b={};var _0x32df98={};var _0x55efab;var _0x11aaa7;return db[_0xae46('0x3d')]['findOne']({'where':{'id':_0x3f63de['params']['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x34c63b,null))[_0xae46('0x16')](function(_0x181a01){if(_0x181a01){_0x55efab=_0x181a01;_0x32df98[_0xae46('0xd2')]=_[_0xae46('0xce')](db[_0xae46('0xdb')][_0xae46('0x3e')]);_0x32df98[_0xae46('0x49')]=_[_0xae46('0xce')](_0x3f63de[_0xae46('0x49')]);_0x32df98['filters']=_['intersection'](_0x32df98[_0xae46('0xd2')],_0x32df98[_0xae46('0x49')]);_0x48db6b[_0xae46('0x4d')]=_['intersection'](_0x32df98[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0x3f63de[_0xae46('0x49')][_0xae46('0xd3')]));_0x48db6b[_0xae46('0x4d')]=_0x48db6b[_0xae46('0x4d')]['length']?_0x48db6b['attributes']:_0x32df98['model'];_0x48db6b['order']=qs[_0xae46('0xd5')](_0x3f63de[_0xae46('0x49')]['sort']);_0x48db6b[_0xae46('0xd6')]=qs[_0xae46('0xd0')](_['pick'](_0x3f63de[_0xae46('0x49')],_0x32df98[_0xae46('0xd0')]));if(_0x3f63de[_0xae46('0x49')][_0xae46('0x34')]){_0x48db6b[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x48db6b[_0xae46('0xd6')],{'$or':_['map'](_0x48db6b[_0xae46('0x4d')],function(_0x23217c){var _0x351098={};_0x351098[_0x23217c]={'$like':'%'+_0x3f63de[_0xae46('0x49')]['filter']+'%'};return _0x351098;})});}_0x48db6b=_['merge']({},_0x48db6b,_0x3f63de[_0xae46('0x5b')]);return _0x55efab[_0xae46('0xdc')](_0x48db6b);}})[_0xae46('0x16')](function(_0x431149){if(_0x431149){_0x11aaa7=_0x431149[_0xae46('0x6e')];if(!_0x3f63de[_0xae46('0x49')][_0xae46('0xc7')]('nolimit')){_0x48db6b[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x3f63de['query'][_0xae46('0x25')]);_0x48db6b[_0xae46('0x23')]=qs[_0xae46('0x23')](_0x3f63de[_0xae46('0x49')][_0xae46('0x23')]);}return _0x55efab[_0xae46('0xdc')](_0x48db6b);}})[_0xae46('0x16')](function(_0x4b691b){if(_0x4b691b){return _0x4b691b?{'count':_0x11aaa7,'rows':_0x4b691b}:null;}})[_0xae46('0x16')](respondWithResult(_0x34c63b,null))[_0xae46('0x20')](handleError(_0x34c63b,null));};exports[_0xae46('0xdd')]=function(_0x314003,_0x49e697){var _0x1e7569={'raw':!![],'where':{}};var _0x4f00b3={};var _0x372f8b={'count':0x0,'rows':[]};return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x314003[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x49e697,null))[_0xae46('0x16')](function(_0x154225){if(_0x154225){_0x4f00b3['model']=_[_0xae46('0xce')](db[_0xae46('0xde')][_0xae46('0x3e')]);_0x4f00b3[_0xae46('0x49')]=_['keys'](_0x314003[_0xae46('0x49')]);_0x4f00b3[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x4f00b3[_0xae46('0xd2')],_0x4f00b3['query']);_0x1e7569['attributes']=_[_0xae46('0xd1')](_0x4f00b3['model'],qs[_0xae46('0xd3')](_0x314003['query'][_0xae46('0xd3')]));_0x1e7569[_0xae46('0x4d')]=_0x1e7569[_0xae46('0x4d')][_0xae46('0x6e')]?_0x1e7569[_0xae46('0x4d')]:_0x4f00b3[_0xae46('0xd2')];if(!_0x314003['query'][_0xae46('0xc7')]('nolimit')){_0x1e7569[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x314003[_0xae46('0x49')][_0xae46('0x25')]);_0x1e7569['offset']=qs[_0xae46('0x23')](_0x314003[_0xae46('0x49')][_0xae46('0x23')]);}_0x1e7569['order']=qs['sort'](_0x314003['query'][_0xae46('0xd5')]);_0x1e7569['where']=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x314003['query'],_0x4f00b3[_0xae46('0xd0')]));_0x1e7569[_0xae46('0xd6')][_0xae46('0xdf')]=_0x154225['id'];if(_0x314003[_0xae46('0x49')]['filter']){_0x1e7569[_0xae46('0xd6')]=_['merge'](_0x1e7569[_0xae46('0xd6')],{'$or':_['map'](_0x1e7569['attributes'],function(_0x439dcf){var _0x2ab44f={};_0x2ab44f[_0x439dcf]={'$like':'%'+_0x314003[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x2ab44f;})});}_0x1e7569=_[_0xae46('0x5a')]({},_0x1e7569,_0x314003[_0xae46('0x5b')]);return db[_0xae46('0xde')][_0xae46('0x26')]({'where':_0x1e7569['where']})[_0xae46('0x16')](function(_0x147bdd){_0x372f8b['count']=_0x147bdd;if(_0x314003[_0xae46('0x49')][_0xae46('0x59')]){_0x1e7569['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xae46('0x4e')](_0x1e7569);})[_0xae46('0x16')](function(_0x4132bd){_0x372f8b[_0xae46('0x4f')]=_0x4132bd;return _0x372f8b;});}})[_0xae46('0x16')](respondWithFilteredResult(_0x49e697,_0x1e7569))[_0xae46('0x20')](handleError(_0x49e697,null));};exports['getScreenRecordings']=function(_0x30ee96,_0x59519f){var _0x57ed84={'raw':!![],'where':{}};var _0x1f8a67={};var _0x37585c={'count':0x0,'rows':[]};return db['User'][_0xae46('0x94')]({'where':{'id':_0x30ee96[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x59519f,null))[_0xae46('0x16')](function(_0x2e496e){if(_0x2e496e){_0x1f8a67[_0xae46('0xd2')]=_[_0xae46('0xce')](db[_0xae46('0xe0')][_0xae46('0x3e')]);_0x1f8a67[_0xae46('0x49')]=_['keys'](_0x30ee96[_0xae46('0x49')]);_0x1f8a67[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x1f8a67['model'],_0x1f8a67[_0xae46('0x49')]);_0x57ed84[_0xae46('0x4d')]=_[_0xae46('0xd1')](_0x1f8a67[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0x30ee96[_0xae46('0x49')][_0xae46('0xd3')]));_0x57ed84['attributes']=_0x57ed84['attributes'][_0xae46('0x6e')]?_0x57ed84[_0xae46('0x4d')]:_0x1f8a67[_0xae46('0xd2')];if(!_0x30ee96['query'][_0xae46('0xc7')]('nolimit')){_0x57ed84[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x30ee96[_0xae46('0x49')]['limit']);_0x57ed84[_0xae46('0x23')]=qs[_0xae46('0x23')](_0x30ee96[_0xae46('0x49')]['offset']);}_0x57ed84['order']=qs[_0xae46('0xd5')](_0x30ee96['query'][_0xae46('0xd5')]);_0x57ed84[_0xae46('0xd6')]=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x30ee96[_0xae46('0x49')],_0x1f8a67[_0xae46('0xd0')]));_0x57ed84[_0xae46('0xd6')]['UserId']=_0x2e496e['id'];if(_0x30ee96[_0xae46('0x49')]['filter']){_0x57ed84[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x57ed84[_0xae46('0xd6')],{'$or':_[_0xae46('0x36')](_0x57ed84[_0xae46('0x4d')],function(_0x205df4){var _0x47bde2={};_0x47bde2[_0x205df4]={'$like':'%'+_0x30ee96[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x47bde2;})});}_0x57ed84=_[_0xae46('0x5a')]({},_0x57ed84,_0x30ee96[_0xae46('0x5b')]);return db[_0xae46('0xe0')][_0xae46('0x26')]({'where':_0x57ed84[_0xae46('0xd6')]})[_0xae46('0x16')](function(_0x721443){_0x37585c[_0xae46('0x26')]=_0x721443;if(_0x30ee96[_0xae46('0x49')][_0xae46('0x59')]){_0x57ed84[_0xae46('0x48')]=[{'all':!![]}];}return db[_0xae46('0xe0')][_0xae46('0x4e')](_0x57ed84);})[_0xae46('0x16')](function(_0x2f76dc){_0x37585c[_0xae46('0x4f')]=_0x2f76dc;return _0x37585c;});}})[_0xae46('0x16')](respondWithFilteredResult(_0x59519f,_0x57ed84))[_0xae46('0x20')](handleError(_0x59519f,null));};exports['getChatInteractions']=function(_0x69d5c1,_0x3698e8){var _0x3e75b6={};var _0x192f49={};var _0x248899;var _0x46725e;return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x69d5c1[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x3698e8,null))[_0xae46('0x16')](function(_0x10e68b){if(_0x10e68b){_0x248899=_0x10e68b;_0x192f49[_0xae46('0xd2')]=_[_0xae46('0xce')](db['ChatInteraction'][_0xae46('0x3e')]);_0x192f49[_0xae46('0x49')]=_[_0xae46('0xce')](_0x69d5c1[_0xae46('0x49')]);_0x192f49[_0xae46('0xd0')]=_['intersection'](_0x192f49[_0xae46('0xd2')],_0x192f49[_0xae46('0x49')]);_0x3e75b6['attributes']=_[_0xae46('0xd1')](_0x192f49[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0x69d5c1[_0xae46('0x49')]['fields']));_0x3e75b6['attributes']=_0x3e75b6['attributes'][_0xae46('0x6e')]?_0x3e75b6[_0xae46('0x4d')]:_0x192f49['model'];_0x3e75b6[_0xae46('0xd4')]=qs[_0xae46('0xd5')](_0x69d5c1['query'][_0xae46('0xd5')]);_0x3e75b6[_0xae46('0xd6')]=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x69d5c1['query'],_0x192f49[_0xae46('0xd0')]));if(_0x69d5c1['query'][_0xae46('0x34')]){_0x3e75b6[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x3e75b6[_0xae46('0xd6')],{'$or':_[_0xae46('0x36')](_0x3e75b6['attributes'],function(_0x471146){var _0x102b7b={};_0x102b7b[_0x471146]={'$like':'%'+_0x69d5c1[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x102b7b;})});}_0x3e75b6=_[_0xae46('0x5a')]({},_0x3e75b6,_0x69d5c1[_0xae46('0x5b')]);return _0x248899[_0xae46('0xe1')](_0x3e75b6);}})[_0xae46('0x16')](function(_0x1127a2){if(_0x1127a2){_0x46725e=_0x1127a2[_0xae46('0x6e')];if(!_0x69d5c1['query']['hasOwnProperty'](_0xae46('0xd9'))){_0x3e75b6[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x69d5c1['query'][_0xae46('0x25')]);_0x3e75b6[_0xae46('0x23')]=qs['offset'](_0x69d5c1[_0xae46('0x49')][_0xae46('0x23')]);}return _0x248899[_0xae46('0xe1')](_0x3e75b6);}})[_0xae46('0x16')](function(_0x10852a){if(_0x10852a){return _0x10852a?{'count':_0x46725e,'rows':_0x10852a}:null;}})['then'](respondWithResult(_0x3698e8,null))['catch'](handleError(_0x3698e8,null));};exports['getOpenchannelInteractions']=function(_0x53e348,_0x2bc8e2){var _0x5705a2={};var _0x5150d9={};var _0xe45481;var _0x5c69b3;return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x53e348[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x2bc8e2,null))[_0xae46('0x16')](function(_0x3baacb){if(_0x3baacb){_0xe45481=_0x3baacb;_0x5150d9[_0xae46('0xd2')]=_[_0xae46('0xce')](db['OpenchannelInteraction'][_0xae46('0x3e')]);_0x5150d9[_0xae46('0x49')]=_[_0xae46('0xce')](_0x53e348[_0xae46('0x49')]);_0x5150d9[_0xae46('0xd0')]=_['intersection'](_0x5150d9['model'],_0x5150d9['query']);_0x5705a2[_0xae46('0x4d')]=_[_0xae46('0xd1')](_0x5150d9['model'],qs['fields'](_0x53e348[_0xae46('0x49')][_0xae46('0xd3')]));_0x5705a2[_0xae46('0x4d')]=_0x5705a2[_0xae46('0x4d')]['length']?_0x5705a2[_0xae46('0x4d')]:_0x5150d9[_0xae46('0xd2')];_0x5705a2[_0xae46('0xd4')]=qs['sort'](_0x53e348[_0xae46('0x49')][_0xae46('0xd5')]);_0x5705a2['where']=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x53e348[_0xae46('0x49')],_0x5150d9[_0xae46('0xd0')]));if(_0x53e348[_0xae46('0x49')]['filter']){_0x5705a2[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x5705a2[_0xae46('0xd6')],{'$or':_[_0xae46('0x36')](_0x5705a2[_0xae46('0x4d')],function(_0x5e310b){var _0x38ddf5={};_0x38ddf5[_0x5e310b]={'$like':'%'+_0x53e348[_0xae46('0x49')]['filter']+'%'};return _0x38ddf5;})});}_0x5705a2=_[_0xae46('0x5a')]({},_0x5705a2,_0x53e348[_0xae46('0x5b')]);return _0xe45481['getOpenchannelInteractions'](_0x5705a2);}})[_0xae46('0x16')](function(_0x170df1){if(_0x170df1){_0x5c69b3=_0x170df1[_0xae46('0x6e')];if(!_0x53e348[_0xae46('0x49')]['hasOwnProperty'](_0xae46('0xd9'))){_0x5705a2[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x53e348[_0xae46('0x49')][_0xae46('0x25')]);_0x5705a2['offset']=qs['offset'](_0x53e348['query']['offset']);}return _0xe45481[_0xae46('0xe2')](_0x5705a2);}})[_0xae46('0x16')](function(_0x3ccc4b){if(_0x3ccc4b){return _0x3ccc4b?{'count':_0x5c69b3,'rows':_0x3ccc4b}:null;}})[_0xae46('0x16')](respondWithResult(_0x2bc8e2,null))[_0xae46('0x20')](handleError(_0x2bc8e2,null));};exports[_0xae46('0xe3')]=function(_0x341879,_0x281d31){var _0x121920={'raw':!![],'where':{}};var _0x38e572={};var _0x872df5={'count':0x0,'rows':[]};return db[_0xae46('0x3d')]['findOne']({'where':{'id':_0x341879[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x281d31,null))['then'](function(_0x54dd79){if(_0x54dd79){_0x38e572['model']=_[_0xae46('0xce')](db[_0xae46('0xe4')][_0xae46('0x3e')]);_0x38e572['query']=_[_0xae46('0xce')](_0x341879['query']);_0x38e572[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x38e572[_0xae46('0xd2')],_0x38e572[_0xae46('0x49')]);_0x121920['attributes']=_[_0xae46('0xd1')](_0x38e572[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0x341879['query']['fields']));_0x121920[_0xae46('0x4d')]=_0x121920[_0xae46('0x4d')][_0xae46('0x6e')]?_0x121920['attributes']:_0x38e572[_0xae46('0xd2')];if(!_0x341879['query']['hasOwnProperty'](_0xae46('0xd9'))){_0x121920['limit']=qs[_0xae46('0x25')](_0x341879[_0xae46('0x49')][_0xae46('0x25')]);_0x121920[_0xae46('0x23')]=qs[_0xae46('0x23')](_0x341879[_0xae46('0x49')][_0xae46('0x23')]);}_0x121920[_0xae46('0xd4')]=qs[_0xae46('0xd5')](_0x341879[_0xae46('0x49')][_0xae46('0xd5')]);_0x121920[_0xae46('0xd6')]=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x341879[_0xae46('0x49')],_0x38e572[_0xae46('0xd0')]));_0x121920[_0xae46('0xd6')]['UserId']=_0x54dd79['id'];if(_0x341879['query'][_0xae46('0x34')]){_0x121920[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x121920[_0xae46('0xd6')],{'$or':_['map'](_0x121920[_0xae46('0x4d')],function(_0xa820f3){var _0x22c659={};_0x22c659[_0xa820f3]={'$like':'%'+_0x341879[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x22c659;})});}_0x121920=_[_0xae46('0x5a')]({},_0x121920,_0x341879[_0xae46('0x5b')]);return db[_0xae46('0xe4')]['count']({'where':_0x121920[_0xae46('0xd6')]})[_0xae46('0x16')](function(_0x187319){_0x872df5[_0xae46('0x26')]=_0x187319;if(_0x341879[_0xae46('0x49')][_0xae46('0x59')]){_0x121920[_0xae46('0x48')]=[{'all':!![]}];}return db[_0xae46('0xe4')]['findAll'](_0x121920);})['then'](function(_0xeb1dfe){_0x872df5[_0xae46('0x4f')]=_0xeb1dfe;return _0x872df5;});}})[_0xae46('0x16')](respondWithFilteredResult(_0x281d31,_0x121920))[_0xae46('0x20')](handleError(_0x281d31,null));};exports[_0xae46('0xe5')]=function(_0x2e2198,_0x2551ab){var _0x6ae9c3={};var _0x29cb25={};var _0x4b20d8;var _0x315396;return db[_0xae46('0x3d')]['findOne']({'where':{'id':_0x2e2198[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x2551ab,null))[_0xae46('0x16')](function(_0x3f29b7){if(_0x3f29b7){_0x4b20d8=_0x3f29b7;_0x29cb25[_0xae46('0xd2')]=_[_0xae46('0xce')](db[_0xae46('0xe6')]['rawAttributes']);_0x29cb25[_0xae46('0x49')]=_[_0xae46('0xce')](_0x2e2198['query']);_0x29cb25[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x29cb25[_0xae46('0xd2')],_0x29cb25[_0xae46('0x49')]);_0x6ae9c3['attributes']=_[_0xae46('0xd1')](_0x29cb25[_0xae46('0xd2')],qs['fields'](_0x2e2198['query'][_0xae46('0xd3')]));_0x6ae9c3['attributes']=_0x6ae9c3[_0xae46('0x4d')]['length']?_0x6ae9c3[_0xae46('0x4d')]:_0x29cb25[_0xae46('0xd2')];_0x6ae9c3[_0xae46('0xd4')]=qs[_0xae46('0xd5')](_0x2e2198[_0xae46('0x49')][_0xae46('0xd5')]);_0x6ae9c3[_0xae46('0xd6')]=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x2e2198[_0xae46('0x49')],_0x29cb25[_0xae46('0xd0')]));if(_0x2e2198[_0xae46('0x49')][_0xae46('0x34')]){_0x6ae9c3['where']=_[_0xae46('0x5a')](_0x6ae9c3[_0xae46('0xd6')],{'$or':_['map'](_0x6ae9c3['attributes'],function(_0x22cc62){var _0x314000={};_0x314000[_0x22cc62]={'$like':'%'+_0x2e2198[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x314000;})});}_0x6ae9c3=_[_0xae46('0x5a')]({},_0x6ae9c3,_0x2e2198[_0xae46('0x5b')]);return _0x4b20d8[_0xae46('0xe5')](_0x6ae9c3);}})[_0xae46('0x16')](function(_0x5c3cd8){if(_0x5c3cd8){_0x315396=_0x5c3cd8['length'];if(!_0x2e2198[_0xae46('0x49')][_0xae46('0xc7')](_0xae46('0xd9'))){_0x6ae9c3[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x2e2198[_0xae46('0x49')][_0xae46('0x25')]);_0x6ae9c3[_0xae46('0x23')]=qs[_0xae46('0x23')](_0x2e2198[_0xae46('0x49')]['offset']);}return _0x4b20d8[_0xae46('0xe5')](_0x6ae9c3);}})[_0xae46('0x16')](function(_0x215371){if(_0x215371){return _0x215371?{'count':_0x315396,'rows':_0x215371}:null;}})['then'](respondWithResult(_0x2551ab,null))[_0xae46('0x20')](handleError(_0x2551ab,null));};exports[_0xae46('0xe7')]=function(_0x365469,_0x68041f){var _0x20b4d6={};var _0x56a63c={};var _0x326724;var _0x1ff7f9;return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x365469['params']['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x68041f,null))['then'](function(_0x44c23f){if(_0x44c23f){_0x326724=_0x44c23f;_0x56a63c[_0xae46('0xd2')]=_[_0xae46('0xce')](db['FaxInteraction'][_0xae46('0x3e')]);_0x56a63c['query']=_[_0xae46('0xce')](_0x365469[_0xae46('0x49')]);_0x56a63c[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x56a63c[_0xae46('0xd2')],_0x56a63c['query']);_0x20b4d6[_0xae46('0x4d')]=_['intersection'](_0x56a63c[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0x365469['query'][_0xae46('0xd3')]));_0x20b4d6[_0xae46('0x4d')]=_0x20b4d6[_0xae46('0x4d')]['length']?_0x20b4d6[_0xae46('0x4d')]:_0x56a63c['model'];_0x20b4d6[_0xae46('0xd4')]=qs[_0xae46('0xd5')](_0x365469['query'][_0xae46('0xd5')]);_0x20b4d6['where']=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x365469['query'],_0x56a63c[_0xae46('0xd0')]));if(_0x365469[_0xae46('0x49')][_0xae46('0x34')]){_0x20b4d6[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x20b4d6[_0xae46('0xd6')],{'$or':_[_0xae46('0x36')](_0x20b4d6['attributes'],function(_0x2c964b){var _0x1940b7={};_0x1940b7[_0x2c964b]={'$like':'%'+_0x365469[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x1940b7;})});}_0x20b4d6=_['merge']({},_0x20b4d6,_0x365469['options']);return _0x326724[_0xae46('0xe7')](_0x20b4d6);}})[_0xae46('0x16')](function(_0x3d4c07){if(_0x3d4c07){_0x1ff7f9=_0x3d4c07[_0xae46('0x6e')];if(!_0x365469[_0xae46('0x49')][_0xae46('0xc7')]('nolimit')){_0x20b4d6[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x365469[_0xae46('0x49')][_0xae46('0x25')]);_0x20b4d6[_0xae46('0x23')]=qs[_0xae46('0x23')](_0x365469[_0xae46('0x49')]['offset']);}return _0x326724['getFaxInteractions'](_0x20b4d6);}})[_0xae46('0x16')](function(_0x264c26){if(_0x264c26){return _0x264c26?{'count':_0x1ff7f9,'rows':_0x264c26}:null;}})[_0xae46('0x16')](respondWithResult(_0x68041f,null))[_0xae46('0x20')](handleError(_0x68041f,null));};exports[_0xae46('0xe8')]=function(_0x1349fb,_0x8bdd82){var _0x3bac9d={};var _0x8776fc={};var _0x84ea4c;var _0x1bbda0;return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x1349fb[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x8bdd82,null))[_0xae46('0x16')](function(_0x16f558){if(_0x16f558){_0x84ea4c=_0x16f558;_0x8776fc[_0xae46('0xd2')]=_[_0xae46('0xce')](db[_0xae46('0xe9')][_0xae46('0x3e')]);_0x8776fc[_0xae46('0x49')]=_[_0xae46('0xce')](_0x1349fb[_0xae46('0x49')]);_0x8776fc[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x8776fc[_0xae46('0xd2')],_0x8776fc[_0xae46('0x49')]);_0x3bac9d[_0xae46('0x4d')]=_['intersection'](_0x8776fc[_0xae46('0xd2')],qs['fields'](_0x1349fb[_0xae46('0x49')]['fields']));_0x3bac9d['attributes']=_0x3bac9d[_0xae46('0x4d')][_0xae46('0x6e')]?_0x3bac9d['attributes']:_0x8776fc[_0xae46('0xd2')];_0x3bac9d['order']=qs[_0xae46('0xd5')](_0x1349fb[_0xae46('0x49')][_0xae46('0xd5')]);_0x3bac9d[_0xae46('0xd6')]=qs['filters'](_[_0xae46('0xd7')](_0x1349fb[_0xae46('0x49')],_0x8776fc[_0xae46('0xd0')]));if(_0x1349fb[_0xae46('0x49')][_0xae46('0x34')]){_0x3bac9d[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x3bac9d['where'],{'$or':_[_0xae46('0x36')](_0x3bac9d['attributes'],function(_0x3a2003){var _0x770b88={};_0x770b88[_0x3a2003]={'$like':'%'+_0x1349fb[_0xae46('0x49')]['filter']+'%'};return _0x770b88;})});}_0x3bac9d=_[_0xae46('0x5a')]({},_0x3bac9d,_0x1349fb[_0xae46('0x5b')]);return _0x84ea4c[_0xae46('0xe8')](_0x3bac9d);}})[_0xae46('0x16')](function(_0xd1b55d){if(_0xd1b55d){_0x1bbda0=_0xd1b55d[_0xae46('0x6e')];if(!_0x1349fb['query']['hasOwnProperty'](_0xae46('0xd9'))){_0x3bac9d[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x1349fb['query'][_0xae46('0x25')]);_0x3bac9d['offset']=qs[_0xae46('0x23')](_0x1349fb['query'][_0xae46('0x23')]);}return _0x84ea4c[_0xae46('0xe8')](_0x3bac9d);}})['then'](function(_0x4903a7){if(_0x4903a7){return _0x4903a7?{'count':_0x1bbda0,'rows':_0x4903a7}:null;}})[_0xae46('0x16')](respondWithResult(_0x8bdd82,null))['catch'](handleError(_0x8bdd82,null));};exports[_0xae46('0xea')]=function(_0x1becce,_0x141ab6,_0x29bf34){var _0x24d86e;var _0x50480c;var _0xc43102;var _0x236a93=!_[_0xae46('0x6a')](_0x1becce[_0xae46('0x57')]['id'])?_0x1becce[_0xae46('0x57')]['id']:!_['isNil'](_0x1becce[_0xae46('0x7d')]['id'])?_0x1becce[_0xae46('0x7d')]['id']:null;return db['User'][_0xae46('0x5c')]({'where':{'id':_0x236a93,'role':{'$or':['admin',_0xae46('0x7d'),_0xae46('0x2c')]}},'attributes':['id',_0xae46('0x39'),'phone',_0xae46('0xeb'),_0xae46('0x2b'),_0xae46('0x64'),_0xae46('0x9a')]})[_0xae46('0x16')](function(_0x55bb2d){if(_0x55bb2d){if(_0x55bb2d[_0xae46('0x2b')]==='agent'){_0x24d86e=_0x55bb2d;if(_0x1becce[_0xae46('0x5f')]['interface']){_0xc43102=util[_0xae46('0xa7')](_0xae46('0xec'),_0x24d86e[_0x1becce[_0xae46('0x5f')][_0xae46('0x9b')]]);}else if(_0x1becce[_0xae46('0x5f')][_0xae46('0xed')]){_0xc43102=util['format'](_0xae46('0xa8'),_0x1becce['body'][_0xae46('0xed')]);}else{_0xc43102=util['format'](_0xae46('0xa8'),_0x24d86e[_0xae46('0x39')]);}socket['to'](util[_0xae46('0xa7')](_0xae46('0xee'),_0x24d86e[_0xae46('0x39')]))[_0xae46('0x2d')]('user:forcelogout',{'user':{'id':_0x24d86e['id'],'name':_0x24d86e[_0xae46('0x39')]},'ip':_0x1becce[_0xae46('0xef')][_0xae46('0xf0')]||_0x1becce['connection'][_0xae46('0xf1')]||_0x1becce[_0xae46('0xf2')][_0xae46('0xf1')]||_0x1becce[_0xae46('0xf3')][_0xae46('0xf2')][_0xae46('0xf1')]});return db[_0xae46('0xaa')][_0xae46('0x2f')]({'where':{'membername':_0x24d86e['name']},'individualHooks':!![]});}}else{throw new db[(_0xae46('0x8d'))][(_0xae46('0x8f'))](_0xae46('0xf4'));}})[_0xae46('0x16')](function(){if(_0x24d86e){return _0x24d86e[_0xae46('0xf5')]({'raw':!![]});}})[_0xae46('0x16')](function(_0x53d796){if(_0x24d86e){if(_0x53d796){_0x50480c=_0x53d796;if(_0x50480c[_0xae46('0x6e')]){var _0x190dc1=_0x50480c[_0xae46('0x36')](function(_0x35d589){var _0x422041={'membername':_0x24d86e[_0xae46('0x39')],'UserId':_0x24d86e['id'],'queue_name':_0x35d589[_0xae46('0x39')],'VoiceQueueId':_0x35d589['id'],'interface':_0xc43102,'paused':_0x24d86e[_0xae46('0x9a')]||![],'penalty':_0x35d589[_0xae46('0xf6')]||0x0};return db[_0xae46('0xaa')][_0xae46('0xab')](_0x422041);});return Promise[_0xae46('0x8a')](_0x190dc1);}}}})['then'](function(){if(_0x24d86e){return db[_0xae46('0xf7')]['findAll']({'where':{'membername':_0x24d86e[_0xae46('0x39')],'exitAt':null}});}})[_0xae46('0x16')](function(_0x4d23ae){if(_0x24d86e){var _0x3a04db=[];_0x4d23ae['forEach'](function(_0x203cd6){_0x3a04db['push'](_0x203cd6[_0xae46('0x2a')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x3a04db);}})[_0xae46('0x16')](function(){if(_0x24d86e){var _0x7a08f0=[];var _0x546290=[];var _0x31cce5=utils['getChannels']();var _0x59dc35={'membername':_0x24d86e[_0xae46('0x39')],'interface':_0xc43102,'enterAt':moment()['format'](_0xae46('0xf8')),'role':_0x24d86e[_0xae46('0x2b')],'internal':_0x24d86e[_0xae46('0x64')]};_0x31cce5['forEach'](function(_0x43ecff){_0x7a08f0[_0xae46('0x50')](_[_0xae46('0x5a')]({'channel':_0x43ecff,'type':_0xae46('0xf9'),'data1':_0x1becce['body']['device'],'data2':_0xc43102},_0x59dc35));if(_0x24d86e[_0xae46('0x9a')]){_0x546290[_0xae46('0x50')](_['merge']({'channel':_0x43ecff,'type':_0xae46('0xfa'),'data1':'LOGININPAUSE'},_0x59dc35));}});return db[_0xae46('0xf7')]['bulkCreate'](_0x7a08f0[_0xae46('0xc4')](_0x546290),{'individualHooks':!![]});}})[_0xae46('0x16')](function(){if(_0x24d86e){return _0x24d86e[_0xae46('0x2a')]({'online':!![],'lastLoginAt':moment()[_0xae46('0xa7')](_0xae46('0xf8')),'voicePause':_0x24d86e['loginInPause']||![],'mailPause':_0x24d86e[_0xae46('0x9a')]||![],'chatPause':_0x24d86e[_0xae46('0x9a')]||![],'faxPause':_0x24d86e[_0xae46('0x9a')]||![],'smsPause':_0x24d86e[_0xae46('0x9a')]||![],'openchannelPause':_0x24d86e[_0xae46('0x9a')]||![],'whatsappPause':_0x24d86e[_0xae46('0x9a')]||![],'pauseType':_0x24d86e[_0xae46('0x9a')]?_0xae46('0xfb'):null,'interface':_0xc43102,'lastPauseAt':moment()[_0xae46('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xae46('0x16')](function(_0x35ad56){if(_0x1becce[_0xae46('0xfc')]){return _0x29bf34();}else{return Promise[_0xae46('0xfd')](_0x35ad56)[_0xae46('0x16')](respondWithResult(_0x141ab6,null));}})[_0xae46('0x20')](handleError(_0x141ab6,null));};exports[_0xae46('0xfe')]=function(_0x47c080,_0x2cd3b2){var _0xad8df1;return db['User'][_0xae46('0x5c')]({'where':{'id':_0x47c080[_0xae46('0x57')]['id'],'role':_0xae46('0x2c')},'attributes':['id',_0xae46('0x39'),_0xae46('0x2b')]})[_0xae46('0x16')](handleEntityNotFound(_0x2cd3b2,null))[_0xae46('0x16')](function(_0x48856b){if(_0x48856b){_0xad8df1=_0x48856b;return db[_0xae46('0xaa')][_0xae46('0x2f')]({'where':{'membername':_0xad8df1[_0xae46('0x39')]},'individualHooks':!![]});}})[_0xae46('0x16')](function(){return db[_0xae46('0xf7')][_0xae46('0x4e')]({'where':{'membername':_0xad8df1['name'],'exitAt':null}});})[_0xae46('0x16')](function(_0x5023c0){var _0x3057e7=[];_0x5023c0['forEach'](function(_0x1aa0ea){_0x3057e7['push'](_0x1aa0ea['update']({'exitAt':moment()[_0xae46('0xa7')](_0xae46('0xf8'))}));});return Promise[_0xae46('0x8a')](_0x3057e7);})[_0xae46('0x16')](function(){return _0xad8df1['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xae46('0x16')](respondWithResult(_0x2cd3b2,null))[_0xae46('0x20')](handleError(_0x2cd3b2,null));};exports['pause']=function(_0x303c65,_0xfe706a){var _0x5e2777;return db['UserVoiceQueueRt'][_0xae46('0x2a')]({'paused':0x1},{'where':{'UserId':_0x303c65['params']['id']},'individualHooks':!![]})[_0xae46('0x16')](function(){return db[_0xae46('0x3d')][_0xae46('0x5c')]({'where':{'id':_0x303c65[_0xae46('0x57')]['id'],'role':_0xae46('0x2c')},'attributes':['id',_0xae46('0x39'),_0xae46('0x2b'),'internal',_0xae46('0x9b'),_0xae46('0x99')]});})[_0xae46('0x16')](handleEntityNotFound(_0xfe706a,null))['then'](function(_0x551973){if(_0x551973){_0x5e2777=_0x551973;return respondWithRpcPromise(_0xae46('0xff'),_0xae46('0x100'),{'id':_0x5e2777['id'],'name':_0x5e2777[_0xae46('0x39')],'pause':!![]});}})[_0xae46('0x16')](function(){if(_0x5e2777){return db[_0xae46('0xf7')]['findAll']({'where':{'membername':_0x5e2777[_0xae46('0x39')],'type':_0xae46('0xfa'),'exitAt':null}});}})[_0xae46('0x16')](function(_0x5ef305){if(_0x5ef305[_0xae46('0x6e')]){var _0x4ee49c=moment()[_0xae46('0xa7')](_0xae46('0xf8'));for(var _0x3c929d=0x0,_0x4a247d=_0x5ef305[_0xae46('0x6e')];_0x3c929d<_0x4a247d;_0x3c929d++){_0x5ef305[_0x3c929d]['updateAttributes']({'exitAt':_0x4ee49c});}}})[_0xae46('0x16')](function(){var _0x52ea8f=[];var _0xa80d48=utils[_0xae46('0x101')]();_0xa80d48[_0xae46('0x102')](function(_0x461f03){_0x52ea8f[_0xae46('0x50')]({'channel':_0x461f03,'membername':_0x5e2777['name'],'interface':_[_0xae46('0x6a')](_0x5e2777[_0xae46('0x9b')])?util[_0xae46('0xa7')](_0xae46('0xa8'),_0x5e2777[_0xae46('0x39')]):_0x5e2777[_0xae46('0x9b')],'type':_0xae46('0xfa'),'enterAt':moment()[_0xae46('0xa7')](_0xae46('0xf8')),'data1':_0x303c65['body'][_0xae46('0x40')]||_0xae46('0x103'),'role':_0x5e2777[_0xae46('0x2b')],'internal':_0x5e2777[_0xae46('0x64')]});});return db['MemberReport'][_0xae46('0x87')](_0x52ea8f,{'individualHooks':!![]});})[_0xae46('0x16')](function(){return _0x5e2777[_0xae46('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x303c65[_0xae46('0x5f')][_0xae46('0x40')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xae46('0xa7')](_0xae46('0xf8'))});})[_0xae46('0x16')](respondWithResult(_0xfe706a,null))[_0xae46('0x20')](handleError(_0xfe706a,null));};exports[_0xae46('0x104')]=function(_0x127871,_0x5f770b){if(_0x127871[_0xae46('0x5f')][_0xae46('0xad')]&&!utils[_0xae46('0x9c')](_0x127871[_0xae46('0x5f')][_0xae46('0xad')])){throw new APIBadRequestError(util['format'](_0xae46('0x105'),_0x127871[_0xae46('0x5f')]['channel']));}return db[_0xae46('0x3d')][_0xae46('0x5c')]({'where':{'id':_0x127871[_0xae46('0x57')]['id']},'attributes':['id',_0xae46('0x39'),'role',_0xae46('0x64'),_0xae46('0x9b'),_0xae46('0x99'),_0xae46('0xa9'),_0xae46('0x106'),'chatPause','faxPause',_0xae46('0x107'),'smsPause','whatsappPause',_0xae46('0x108'),_0xae46('0x109')]})[_0xae46('0x16')](function(_0x266df9){if(!_0x266df9){throw new APINotFoundError(util[_0xae46('0xa7')](_0xae46('0xc6'),_0x127871[_0xae46('0x57')]['id']));}return _0x266df9['unpause'](_0x127871[_0xae46('0x5f')][_0xae46('0xad')]);})[_0xae46('0x16')](respondWithResult(_0x5f770b,null))[_0xae46('0x20')](APIHandleError(_0x5f770b));};exports[_0xae46('0x10a')]=function(_0x1d66be,_0xc75bac){var _0x504cb2={};var _0xcd2363={};var _0x549b12;var _0x2fbf0f;return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x1d66be[_0xae46('0x57')]['id']}})['then'](handleEntityNotFound(_0xc75bac,null))[_0xae46('0x16')](function(_0x330378){if(_0x330378){_0x549b12=_0x330378;_0xcd2363[_0xae46('0xd2')]=_[_0xae46('0xce')](db[_0xae46('0x10b')][_0xae46('0x3e')]);_0xcd2363['query']=_[_0xae46('0xce')](_0x1d66be[_0xae46('0x49')]);_0xcd2363['filters']=_[_0xae46('0xd1')](_0xcd2363[_0xae46('0xd2')],_0xcd2363['query']);_0x504cb2[_0xae46('0x4d')]=_[_0xae46('0xd1')](_0xcd2363['model'],qs['fields'](_0x1d66be[_0xae46('0x49')][_0xae46('0xd3')]));_0x504cb2[_0xae46('0x4d')]=_0x504cb2[_0xae46('0x4d')][_0xae46('0x6e')]?_0x504cb2['attributes']:_0xcd2363['model'];_0x504cb2[_0xae46('0xd4')]=qs[_0xae46('0xd5')](_0x1d66be[_0xae46('0x49')][_0xae46('0xd5')]);_0x504cb2[_0xae46('0xd6')]=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x1d66be[_0xae46('0x49')],_0xcd2363['filters']));if(_0x1d66be['query'][_0xae46('0x34')]){_0x504cb2['where']=_[_0xae46('0x5a')](_0x504cb2['where'],{'$or':_['map'](_0x504cb2[_0xae46('0x4d')],function(_0x26b8a5){var _0x47c820={};_0x47c820[_0x26b8a5]={'$like':'%'+_0x1d66be['query'][_0xae46('0x34')]+'%'};return _0x47c820;})});}_0x504cb2=_[_0xae46('0x5a')]({},_0x504cb2,_0x1d66be[_0xae46('0x5b')]);return _0x549b12[_0xae46('0x10a')](_0x504cb2);}})[_0xae46('0x16')](function(_0x3133d4){if(_0x3133d4){_0x2fbf0f=_0x3133d4[_0xae46('0x6e')];if(!_0x1d66be[_0xae46('0x49')][_0xae46('0xc7')](_0xae46('0xd9'))){_0x504cb2[_0xae46('0x25')]=qs[_0xae46('0x25')](_0x1d66be[_0xae46('0x49')][_0xae46('0x25')]);_0x504cb2[_0xae46('0x23')]=qs[_0xae46('0x23')](_0x1d66be[_0xae46('0x49')][_0xae46('0x23')]);}return _0x549b12[_0xae46('0x10a')](_0x504cb2);}})[_0xae46('0x16')](function(_0x2964ad){if(_0x2964ad){return _0x2964ad?{'count':_0x2fbf0f,'rows':_0x2964ad}:null;}})[_0xae46('0x16')](respondWithResult(_0xc75bac,null))[_0xae46('0x20')](handleError(_0xc75bac,null));};exports[_0xae46('0x10c')]=function(_0x34740d,_0x510122){var _0x294e6d=_0x34740d[_0xae46('0x57')]['id'];var _0x16b576=_0x34740d['body']?_0x34740d[_0xae46('0x5f')][_0xae46('0x63')]:null;var _0x186b0e=[];return Promise[_0xae46('0xfd')]()[_0xae46('0x16')](function(){if(!_0x16b576)throw new APIBadRequestError(_0xae46('0x10d'));})['then'](function(){return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0x294e6d}});})['then'](function(_0x52342e){if(!_0x52342e)throw new APINotFoundError(util['format'](_0xae46('0xc6'),_0x34740d[_0xae46('0x57')]['id']));return db['sequelize'][_0xae46('0x10e')](function(_0x544fba){return _0x52342e[_0xae46('0x10c')](_0x16b576,{'transaction':_0x544fba})[_0xae46('0x16')](function(){return db[_0xae46('0x10b')][_0xae46('0x4e')]({'where':{'id':{'$in':_0x16b576}}});})['then'](function(_0x2463a2){var _0x443118=_[_0xae46('0x36')](_0x2463a2,function(_0x54b20e){return _0x54b20e[_0xae46('0x10f')]();});return Promise['all'](_0x443118);})[_0xae46('0x16')](function(_0x3380d0){_0x186b0e=_[_0xae46('0x110')](_0x3380d0);var _0x2df986=_[_0xae46('0x36')](_0x186b0e,function(_0x4f7bfe){return _0x4f7bfe[_0xae46('0x111')](_0x52342e['id'],{'transaction':_0x544fba});});return Promise[_0xae46('0x8a')](_0x2df986);})[_0xae46('0x16')](function(){if(!_0x52342e['online'])return;var _0x5e8f99=_['filter'](_0x186b0e,function(_0x5e1e55){return _0x5e1e55[_0xae46('0x112')](_0xae46('0xad'))===_0xae46('0x113');});var _0x2e9811=_[_0xae46('0x36')](_0x5e8f99,function(_0x28e998){return db[_0xae46('0xaa')][_0xae46('0xab')]({'membername':_0x52342e[_0xae46('0x39')],'UserId':_0x52342e['id'],'queue_name':_0x28e998['name'],'VoiceQueueId':_0x28e998['id'],'interface':_[_0xae46('0x6a')](_0x52342e[_0xae46('0x9b')])?util[_0xae46('0xa7')]('SIP/%s',_0x52342e[_0xae46('0x39')]):_0x52342e[_0xae46('0x9b')],'paused':_0x52342e[_0xae46('0xa9')]||![],'penalty':_0x52342e['penalty']},{'transaction':_0x544fba});});return Promise[_0xae46('0x8a')](_0x2e9811);})[_0xae46('0x16')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x16b576}}});})[_0xae46('0x16')](function(_0x21686f){var _0x90f032=_['map'](_0x21686f,function(_0x7bbf01){return db['UserVoicePrefix'][_0xae46('0x82')]({'UserId':_0x52342e['id'],'VoicePrefixId':_0x7bbf01[_0xae46('0x114')]},{'transaction':_0x544fba});});return Promise['all'](_0x90f032);});});})[_0xae46('0x16')](function(){for(var _0x225202=0x0;_0x225202<_0x186b0e[_0xae46('0x6e')];_0x225202++){var _0x2cddb9=_0x186b0e[_0x225202]['getDataValue'](_0xae46('0xad'));var _0x27d6fc=_0x2cddb9+_0xae46('0xa2');socket[_0xae46('0x2d')](_0xae46('0x7d')+_0x2cddb9+_0xae46('0xa3'),{'UserId':_0x294e6d,['queueField']:_0x186b0e[_0x225202]['id']});}})[_0xae46('0x16')](respondWithStatusCode(_0x510122,null))['catch'](APIHandleError(_0x510122));};exports[_0xae46('0x115')]=function(_0x3caa1f,_0x1cc29f){var _0x34aa70=_0x3caa1f[_0xae46('0x57')]['id'];var _0x44f20a=null;if(_0x3caa1f['query'][_0xae46('0x63')]){_0x44f20a=_[_0xae46('0xb0')](_0x3caa1f[_0xae46('0x49')][_0xae46('0x63')])?_0x3caa1f[_0xae46('0x49')][_0xae46('0x63')]:[_0x3caa1f[_0xae46('0x49')][_0xae46('0x63')]];}var _0x3b8e3f=[];return Promise[_0xae46('0xfd')]()[_0xae46('0x16')](function(){if(!_0x44f20a)throw new APIBadRequestError(_0xae46('0x116'));})[_0xae46('0x16')](function(){return db[_0xae46('0x3d')]['findOne']({'where':{'id':_0x34aa70}});})[_0xae46('0x16')](function(_0x8985d2){if(!_0x8985d2)throw new APINotFoundError(util[_0xae46('0xa7')](_0xae46('0xc6'),_0x3caa1f[_0xae46('0x57')]['id']));return db[_0xae46('0x6c')][_0xae46('0x10e')](function(_0x59073a){return _0x8985d2[_0xae46('0x115')](_0x44f20a,{'transaction':_0x59073a})[_0xae46('0x16')](function(){return db[_0xae46('0x10b')]['findAll']({'where':{'id':{'$in':_0x44f20a}}});})[_0xae46('0x16')](function(_0xba35ad){var _0x1348cf=_[_0xae46('0x36')](_0xba35ad,function(_0x5e81f5){return _0x5e81f5[_0xae46('0x10f')]();});return Promise['all'](_0x1348cf);})[_0xae46('0x16')](function(_0x5f2c38){_0x3b8e3f=_[_0xae46('0x110')](_0x5f2c38);var _0x8e305a=_[_0xae46('0x36')](_0x3b8e3f,function(_0x229a4d){return _0x229a4d[_0xae46('0x117')](_0x8985d2['id'],{'transaction':_0x59073a});});return Promise[_0xae46('0x8a')](_0x8e305a);})['then'](function(){if(!_0x8985d2[_0xae46('0x99')])return;var _0x565fd9=_[_0xae46('0x34')](_0x3b8e3f,function(_0x5df3c0){return _0x5df3c0[_0xae46('0x112')](_0xae46('0xad'))===_0xae46('0x113');});var _0x3a9fa3=_[_0xae46('0x36')](_0x565fd9,function(_0x2dfc01){return db[_0xae46('0xaa')][_0xae46('0x2f')]({'where':{'VoiceQueueId':_0x2dfc01['id'],'UserId':_0x8985d2['id']},'transaction':_0x59073a});});return Promise['all'](_0x3a9fa3);})[_0xae46('0x16')](function(){return db[_0xae46('0x118')][_0xae46('0x4e')]({'where':{'teamId':{'$in':_0x44f20a}}});})[_0xae46('0x16')](function(_0x19af41){var _0x25d4b1=_[_0xae46('0x36')](_0x19af41,function(_0x3cdc37){return db['UserVoicePrefix'][_0xae46('0x2f')]({'where':{'UserId':_0x8985d2['id'],'VoicePrefixId':_0x3cdc37[_0xae46('0x114')]}},{'transaction':_0x59073a});});return Promise[_0xae46('0x8a')](_0x25d4b1);});});})[_0xae46('0x16')](function(){for(var _0x4f15c6=0x0;_0x4f15c6<_0x3b8e3f['length'];_0x4f15c6++){var _0x53b8d3=_0x3b8e3f[_0x4f15c6][_0xae46('0x112')]('channel');var _0x173300=_0x53b8d3+_0xae46('0xa2');socket[_0xae46('0x2d')](_0xae46('0x7d')+_0x53b8d3+_0xae46('0x119'),{'UserId':_0x34aa70,['queueField']:_0x3b8e3f[_0x4f15c6]['id']});}})[_0xae46('0x16')](respondWithStatusCode(_0x1cc29f,null))[_0xae46('0x20')](APIHandleError(_0x1cc29f));};exports['getLists']=function(_0xc8b5fe,_0x23c392){var _0x4d619b={};var _0x40a4a9={};var _0xf24f87;var _0x1f226b;return db[_0xae46('0x3d')][_0xae46('0x94')]({'where':{'id':_0xc8b5fe[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x23c392,null))['then'](function(_0x5f2345){if(_0x5f2345){_0xf24f87=_0x5f2345;_0x40a4a9[_0xae46('0xd2')]=_['keys'](db[_0xae46('0x11a')][_0xae46('0x3e')]);_0x40a4a9['query']=_['keys'](_0xc8b5fe[_0xae46('0x49')]);_0x40a4a9[_0xae46('0xd0')]=_[_0xae46('0xd1')](_0x40a4a9[_0xae46('0xd2')],_0x40a4a9['query']);_0x4d619b[_0xae46('0x4d')]=_['intersection'](_0x40a4a9[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0xc8b5fe['query'][_0xae46('0xd3')]));_0x4d619b[_0xae46('0x4d')]=_0x4d619b[_0xae46('0x4d')][_0xae46('0x6e')]?_0x4d619b['attributes']:_0x40a4a9['model'];_0x4d619b[_0xae46('0xd4')]=qs[_0xae46('0xd5')](_0xc8b5fe[_0xae46('0x49')][_0xae46('0xd5')]);_0x4d619b['where']=qs['filters'](_[_0xae46('0xd7')](_0xc8b5fe[_0xae46('0x49')],_0x40a4a9[_0xae46('0xd0')]));if(_0xc8b5fe[_0xae46('0x49')][_0xae46('0x34')]){_0x4d619b[_0xae46('0xd6')]=_[_0xae46('0x5a')](_0x4d619b[_0xae46('0xd6')],{'$or':_[_0xae46('0x36')](_0x4d619b[_0xae46('0x4d')],function(_0xe23460){var _0x1b261f={};_0x1b261f[_0xe23460]={'$like':'%'+_0xc8b5fe[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x1b261f;})});}_0x4d619b=_[_0xae46('0x5a')]({},_0x4d619b,_0xc8b5fe[_0xae46('0x5b')]);return _0xf24f87[_0xae46('0x11b')](_0x4d619b);}})['then'](function(_0x54faf1){if(_0x54faf1){_0x1f226b=_0x54faf1[_0xae46('0x6e')];if(!_0xc8b5fe[_0xae46('0x49')][_0xae46('0xc7')](_0xae46('0xd9'))){_0x4d619b[_0xae46('0x25')]=qs['limit'](_0xc8b5fe[_0xae46('0x49')][_0xae46('0x25')]);_0x4d619b['offset']=qs[_0xae46('0x23')](_0xc8b5fe[_0xae46('0x49')][_0xae46('0x23')]);}return _0xf24f87[_0xae46('0x11b')](_0x4d619b);}})[_0xae46('0x16')](function(_0x26426a){if(_0x26426a){return _0x26426a?{'count':_0x1f226b,'rows':_0x26426a}:null;}})[_0xae46('0x16')](respondWithResult(_0x23c392,null))['catch'](handleError(_0x23c392,null));};exports['getAgents']=function(_0x26f1a9,_0x3edd81){var _0x5385bc={};var _0x24e766={};var _0x1a4896;return db['User'][_0xae46('0x94')]({'where':{'id':_0x26f1a9[_0xae46('0x57')]['id']}})[_0xae46('0x16')](handleEntityNotFound(_0x3edd81,null))['then'](function(_0x4b08cd){if(_0x4b08cd){_0x1a4896=_0x4b08cd;_0x24e766['model']=_[_0xae46('0xce')](db['User'][_0xae46('0x3e')]);_0x24e766[_0xae46('0x49')]=_[_0xae46('0xce')](_0x26f1a9[_0xae46('0x49')]);_0x24e766['filters']=_[_0xae46('0xd1')](_0x24e766[_0xae46('0xd2')],_0x24e766[_0xae46('0x49')]);_0x5385bc[_0xae46('0x4d')]=_[_0xae46('0xd1')](_0x24e766[_0xae46('0xd2')],qs[_0xae46('0xd3')](_0x26f1a9['query'][_0xae46('0xd3')]));_0x5385bc[_0xae46('0x4d')]=_0x5385bc['attributes'][_0xae46('0x6e')]?_0x5385bc[_0xae46('0x4d')]:_0x24e766[_0xae46('0xd2')];_0x5385bc['order']=qs[_0xae46('0xd5')](_0x26f1a9[_0xae46('0x49')][_0xae46('0xd5')]);_0x5385bc[_0xae46('0xd6')]=qs[_0xae46('0xd0')](_[_0xae46('0xd7')](_0x26f1a9[_0xae46('0x49')],_0x24e766[_0xae46('0xd0')]));if(_0x26f1a9[_0xae46('0x49')][_0xae46('0x34')]){_0x5385bc[_0xae46('0xd6')]=_['merge'](_0x5385bc[_0xae46('0xd6')],{'$or':_[_0xae46('0x36')](_0x5385bc[_0xae46('0x4d')],function(_0x48c0da){var _0x8715b3={};_0x8715b3[_0x48c0da]={'$like':'%'+_0x26f1a9[_0xae46('0x49')][_0xae46('0x34')]+'%'};return _0x8715b3;})});}_0x5385bc['model']=db[_0xae46('0x3d')];_0x5385bc['as']=_0xae46('0x31');_0x5385bc=_[_0xae46('0x5a')]({},_0x5385bc,_0x26f1a9['options']);return _0x1a4896[_0xae46('0xf5')]({'include':[_0x5385bc]});}})['then'](function(_0x338887){if(_0x338887){var _0x1a78bf={},_0x45fa0e=[];for(var _0x480a94=0x0;_0x480a94<_0x338887['length'];_0x480a94+=0x1){for(var _0x33d182=0x0,_0x1320a3;_0x33d182<_0x338887[_0x480a94][_0xae46('0x31')][_0xae46('0x6e')];_0x33d182+=0x1){_0x1320a3=_0x338887[_0x480a94][_0xae46('0x31')][_0x33d182][_0xae46('0xa6')]({'plain':!![]});_0x1a78bf[_0x1320a3['id']]=_0x1320a3;}}_0x1a78bf=_[_0xae46('0x11c')](_0x1a78bf);for(var _0x46ec8c=qs[_0xae46('0x23')](_0x26f1a9[_0xae46('0x49')]['offset']);_0x46ec8c<_0x1a78bf['length']&&_0x45fa0e[_0xae46('0x6e')]=_0x471b75[_0x9840('0x47')]){throw new Error(_0x9840('0x48'));}})[_0x9840('0x1a')](function(){if(_0x17f9d2){return db[_0x9840('0x25')][_0x9840('0x3e')]({'where':{'membername':_0x17f9d2[_0x9840('0x1e')]},'individualHooks':!![]});}})['then'](function(){if(_0x17f9d2){return _0x17f9d2[_0x9840('0x49')]({'raw':!![]});}})['then'](function(_0x3f020f){if(_0x17f9d2){if(_0x3f020f){var _0x17616c=[];_0x10ef49=_0x3f020f;if(_0x10ef49[_0x9840('0x2a')]){for(var _0x4863ba=0x0;_0x4863ba<_0x10ef49[_0x9840('0x2a')];_0x4863ba++){_0x17616c['push'](db['UserVoiceQueueRt'][_0x9840('0x4a')]({'membername':_0x17f9d2[_0x9840('0x1e')],'UserId':_0x17f9d2['id'],'queue_name':_0x10ef49[_0x4863ba]['name'],'VoiceQueueId':_0x10ef49[_0x4863ba]['id'],'interface':_0x18c285,'paused':_0x17f9d2[_0x9840('0x42')]||![],'penalty':_0x10ef49[_0x4863ba][_0x9840('0x4b')]||0x0}));}return BPromise[_0x9840('0x40')](_0x17616c);}}}})[_0x9840('0x1a')](function(){if(_0x17f9d2){return db[_0x9840('0x27')]['findAll']({'where':{'membername':_0x17f9d2['name'],'exitAt':null}});}})[_0x9840('0x1a')](function(_0x614c78){if(_0x17f9d2){if(_0x614c78&&_0x614c78['length']){var _0x449667=[];_0x614c78[_0x9840('0x3f')](function(_0x5aa9bf){_0x449667['push'](_0x5aa9bf['update']({'exitAt':moment()[_0x9840('0x22')](_0x9840('0x29'))}));});return BPromise[_0x9840('0x40')](_0x449667);}}})[_0x9840('0x1a')](function(){if(_0x17f9d2){var _0x1afecf=[];var _0x1148f1=[];var _0x5ec8a3=utils[_0x9840('0x4c')]();var _0x36fef7={'membername':_0x17f9d2['name'],'interface':_0x18c285,'enterAt':moment()[_0x9840('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x17f9d2['role'],'internal':_0x17f9d2[_0x9840('0x20')]};_0x5ec8a3[_0x9840('0x3f')](function(_0x5c6f59){_0x1afecf['push'](_[_0x9840('0x4d')]({'channel':_0x5c6f59,'type':_0x9840('0x4e'),'data1':_0x9840('0x4f'),'data2':_0x18c285},_0x36fef7));if(_0x17f9d2['loginInPause']){_0x1148f1[_0x9840('0x50')](_['merge']({'channel':_0x5c6f59,'type':_0x9840('0x51'),'data1':'LOGININPAUSE'},_0x36fef7));}});return db[_0x9840('0x27')][_0x9840('0x30')](_0x1afecf['concat'](_0x1148f1),{'individualHooks':!![]});}})[_0x9840('0x1a')](function(){if(_0x17f9d2){return _0x17f9d2['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x17f9d2[_0x9840('0x42')]||![],'mailPause':_0x17f9d2['loginInPause']||![],'chatPause':_0x17f9d2[_0x9840('0x42')]||![],'faxPause':_0x17f9d2['loginInPause']||![],'smsPause':_0x17f9d2[_0x9840('0x42')]||![],'openchannelPause':_0x17f9d2[_0x9840('0x42')]||![],'pauseType':_0x17f9d2['loginInPause']?_0x9840('0x52'):null,'lastPauseAt':moment()[_0x9840('0x22')](_0x9840('0x29')),'interface':_0x18c285});}})['then'](function(_0x3b1a9e){_0x55ab13(_0x3b1a9e);})[_0x9840('0x16')](function(_0x43be9f){_0x4ae00b(_0x214f9c[_0x9840('0x17')](0x1f4,_0x43be9f[_0x9840('0x18')]));});});}; \ No newline at end of file +var _0xb476=['bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','resolve','isValidChannel','channel','findOne','online','voicePause','chatPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','system','destroy','push','all','mobile','loginInPause','agent','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','PAUSE','LOGININPAUSE','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','socket.io-emitter','./user.socket','register','User','findAll','options','where','include','map','model','attributes','then','info','GetUser','debug','stringify','error','message','find','raw','ShowUser','catch','PauseUser','role','internal','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','name','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','isNil','interface','SIP/%s','body','type','uniqueid'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xb476,0x71));var _0x6b47=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0xb476[_0x1d5400];return _0x21d9fe;};'use strict';var _=require(_0x6b47('0x0'));var util=require('util');var moment=require(_0x6b47('0x1'));var BPromise=require('bluebird');var Redis=require(_0x6b47('0x2'));var db=require(_0x6b47('0x3'))['db'];var utils=require(_0x6b47('0x4'));var logger=require('../../config/logger')(_0x6b47('0x5'));var config=require('../../config/environment');config[_0x6b47('0x6')]=_[_0x6b47('0x7')](config[_0x6b47('0x6')],{'host':_0x6b47('0x8'),'port':0x18eb});var socket=require(_0x6b47('0x9'))(new Redis(config['redis']));require(_0x6b47('0xa'))[_0x6b47('0xb')](socket);exports['GetUser']=function(_0x488469){var _0x14d333=this;return new Promise(function(_0x250df0,_0x32529d){return db[_0x6b47('0xc')][_0x6b47('0xd')]({'raw':_0x488469[_0x6b47('0xe')]?_0x488469['options']['raw']===undefined?!![]:![]:!![],'where':_0x488469[_0x6b47('0xe')]?_0x488469['options'][_0x6b47('0xf')]||null:null,'attributes':_0x488469[_0x6b47('0xe')]?_0x488469[_0x6b47('0xe')]['attributes']||null:null,'limit':_0x488469[_0x6b47('0xe')]?_0x488469[_0x6b47('0xe')]['limit']||null:null,'include':_0x488469['options']?_0x488469[_0x6b47('0xe')][_0x6b47('0x10')]?_[_0x6b47('0x11')](_0x488469[_0x6b47('0xe')][_0x6b47('0x10')],function(_0x4d98ca){return{'model':db[_0x4d98ca[_0x6b47('0x12')]],'as':_0x4d98ca['as'],'attributes':_0x4d98ca['attributes'],'include':_0x4d98ca[_0x6b47('0x10')]?_[_0x6b47('0x11')](_0x4d98ca[_0x6b47('0x10')],function(_0x35ec58){return{'model':db[_0x35ec58[_0x6b47('0x12')]],'as':_0x35ec58['as'],'attributes':_0x35ec58[_0x6b47('0x13')],'include':_0x35ec58[_0x6b47('0x10')]?_['map'](_0x35ec58[_0x6b47('0x10')],function(_0x5f6c39){return{'model':db[_0x5f6c39[_0x6b47('0x12')]],'as':_0x5f6c39['as'],'attributes':_0x5f6c39['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b47('0x14')](function(_0x739196){logger[_0x6b47('0x15')](_0x6b47('0x16'),_0x488469);logger[_0x6b47('0x17')](_0x6b47('0x16'),_0x488469,JSON[_0x6b47('0x18')](_0x739196));_0x250df0(_0x739196);})['catch'](function(_0x3699d5){logger['error'](_0x6b47('0x16'),_0x3699d5['message'],_0x488469);_0x32529d(_0x14d333[_0x6b47('0x19')](0x1f4,_0x3699d5[_0x6b47('0x1a')]));});});};exports['ShowUser']=function(_0x5be1d3){var _0x5d58d9=this;return new Promise(function(_0x853377,_0x396c07){return db['User'][_0x6b47('0x1b')]({'raw':_0x5be1d3['options']?_0x5be1d3[_0x6b47('0xe')][_0x6b47('0x1c')]===undefined?!![]:![]:!![],'where':_0x5be1d3[_0x6b47('0xe')]?_0x5be1d3[_0x6b47('0xe')][_0x6b47('0xf')]||null:null,'attributes':_0x5be1d3[_0x6b47('0xe')]?_0x5be1d3[_0x6b47('0xe')]['attributes']||null:null,'include':_0x5be1d3[_0x6b47('0xe')]?_0x5be1d3[_0x6b47('0xe')][_0x6b47('0x10')]?_[_0x6b47('0x11')](_0x5be1d3[_0x6b47('0xe')]['include'],function(_0x2e0d36){return{'model':db[_0x2e0d36[_0x6b47('0x12')]],'as':_0x2e0d36['as'],'attributes':_0x2e0d36['attributes'],'include':_0x2e0d36['include']?_['map'](_0x2e0d36[_0x6b47('0x10')],function(_0x15a641){return{'model':db[_0x15a641[_0x6b47('0x12')]],'as':_0x15a641['as'],'attributes':_0x15a641[_0x6b47('0x13')],'include':_0x15a641[_0x6b47('0x10')]?_[_0x6b47('0x11')](_0x15a641[_0x6b47('0x10')],function(_0x27be6d){return{'model':db[_0x27be6d[_0x6b47('0x12')]],'as':_0x27be6d['as'],'attributes':_0x27be6d[_0x6b47('0x13')]};}):[]};}):[]};}):[]:[]})[_0x6b47('0x14')](function(_0x4282ca){logger[_0x6b47('0x15')](_0x6b47('0x1d'),_0x5be1d3);logger[_0x6b47('0x17')]('ShowUser',_0x5be1d3,JSON['stringify'](_0x4282ca));_0x853377(_0x4282ca);})[_0x6b47('0x1e')](function(_0x5a2c49){logger[_0x6b47('0x19')](_0x6b47('0x1d'),_0x5a2c49[_0x6b47('0x1a')],_0x5be1d3);_0x396c07(_0x5d58d9['error'](0x1f4,_0x5a2c49['message']));});});};exports[_0x6b47('0x1f')]=function(_0x2170b6){var _0x29a1e8;return db[_0x6b47('0xc')][_0x6b47('0x1b')]({'where':_0x2170b6['options'][_0x6b47('0xf')]||{},'attributes':['id','name',_0x6b47('0x20'),_0x6b47('0x21'),'interface']})[_0x6b47('0x14')](function(_0x3305ac){if(!_0x3305ac){throw new Error(util[_0x6b47('0x22')](_0x6b47('0x23'),_0x2170b6[_0x6b47('0x24')]['id']));}_0x29a1e8=_0x3305ac;return db[_0x6b47('0x25')][_0x6b47('0x26')]({'paused':0x1},{'where':{'UserId':_0x29a1e8['id']},'individualHooks':!![]});})[_0x6b47('0x14')](function(){return db[_0x6b47('0x27')][_0x6b47('0xd')]({'where':{'membername':_0x29a1e8[_0x6b47('0x28')],'type':'PAUSE','exitAt':null}});})[_0x6b47('0x14')](function(_0x5f52e2){if(_0x5f52e2&&_0x5f52e2[_0x6b47('0x29')]){var _0x40cb48=moment()[_0x6b47('0x22')](_0x6b47('0x2a'));for(var _0x2050f3=0x0,_0x18f779=_0x5f52e2[_0x6b47('0x29')];_0x2050f3<_0x18f779;_0x2050f3++){_0x5f52e2[_0x2050f3][_0x6b47('0x2b')]({'exitAt':_0x40cb48});}}})[_0x6b47('0x14')](function(){var _0x3cf5a9=[];var _0x462942=utils['getChannels']();_0x462942[_0x6b47('0x2c')](function(_0x4ef911){_0x3cf5a9['push']({'channel':_0x4ef911,'membername':_0x29a1e8['name'],'interface':_[_0x6b47('0x2d')](_0x29a1e8[_0x6b47('0x2e')])?util['format'](_0x6b47('0x2f'),_0x29a1e8['name']):_0x29a1e8['interface'],'type':'PAUSE','enterAt':moment()[_0x6b47('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2170b6[_0x6b47('0x30')][_0x6b47('0x31')]||'DEFAULT\x20PAUSE','role':_0x29a1e8[_0x6b47('0x20')],'internal':_0x29a1e8['internal'],'uniqueid':_0x2170b6['body'][_0x6b47('0x32')]||null});});return db[_0x6b47('0x27')][_0x6b47('0x33')](_0x3cf5a9,{'individualHooks':!![]});})[_0x6b47('0x14')](function(){return _0x29a1e8[_0x6b47('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2170b6[_0x6b47('0x30')]['type']||_0x6b47('0x34'),'lastPauseAt':moment()[_0x6b47('0x22')](_0x6b47('0x2a'))});})['catch'](function(_0x3d6270){throw _0x3d6270;});};exports[_0x6b47('0x35')]=function(_0xace1cb){return Promise[_0x6b47('0x36')]()['then'](function(){if(_0xace1cb[_0x6b47('0x30')]['channel']&&!utils[_0x6b47('0x37')](_0xace1cb[_0x6b47('0x30')][_0x6b47('0x38')])){throw new Error(util[_0x6b47('0x22')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xace1cb['body'][_0x6b47('0x38')]));}return db[_0x6b47('0xc')][_0x6b47('0x39')]({'where':_0xace1cb[_0x6b47('0xe')][_0x6b47('0xf')]||{},'attributes':['id',_0x6b47('0x28'),_0x6b47('0x20'),_0x6b47('0x21'),'interface',_0x6b47('0x3a'),_0x6b47('0x3b'),'mailPause',_0x6b47('0x3c'),'faxPause','openchannelPause',_0x6b47('0x3d'),_0x6b47('0x3e'),_0x6b47('0x3f'),_0x6b47('0x40')]});})[_0x6b47('0x14')](function(_0x1fb3cb){if(!_0x1fb3cb){throw new Error(util['format'](_0x6b47('0x23'),_0xace1cb[_0x6b47('0x24')]['id']));}return _0x1fb3cb[_0x6b47('0x41')](_0xace1cb[_0x6b47('0x30')][_0x6b47('0x38')],_0x6b47('0x42'));})[_0x6b47('0x1e')](function(_0x5a62ac){throw _0x5a62ac;});};exports['LogoutUser']=function(_0x4c8902){var _0x504821=this;return new Promise(function(_0x5a7543,_0x1adfd9){var _0x45315c;return db['User'][_0x6b47('0x39')]({'where':_0x4c8902[_0x6b47('0xe')]['where']||{},'attributes':['id','name']})[_0x6b47('0x14')](function(_0x1038ee){if(_0x1038ee){_0x45315c=_0x1038ee;return db['UserVoiceQueueRt'][_0x6b47('0x43')]({'where':{'membername':_0x45315c['name']},'individualHooks':!![]});}})['then'](function(){if(_0x45315c){return db[_0x6b47('0x27')][_0x6b47('0xd')]({'where':{'membername':_0x45315c[_0x6b47('0x28')],'exitAt':null}});}})['then'](function(_0x30c277){if(_0x45315c){if(_0x30c277&&_0x30c277[_0x6b47('0x29')]){var _0x3da4b1=[];_0x30c277[_0x6b47('0x2c')](function(_0x512519){_0x3da4b1[_0x6b47('0x44')](_0x512519[_0x6b47('0x26')]({'exitAt':moment()[_0x6b47('0x22')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6b47('0x45')](_0x3da4b1);}}})[_0x6b47('0x14')](function(){if(_0x45315c){return _0x45315c[_0x6b47('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6b47('0x14')](function(_0x548eb3){_0x5a7543(_0x548eb3);})[_0x6b47('0x1e')](function(_0x463cc1){_0x1adfd9(_0x504821[_0x6b47('0x19')](0x1f4,_0x463cc1[_0x6b47('0x1a')]));});});};exports['LoginUser']=function(_0x577b01){var _0xe8d163=this;return new Promise(function(_0xd70b8e,_0x4f57e8){var _0x452a20;var _0x26b549;var _0x36dada;var _0x3014b2;return db[_0x6b47('0xc')][_0x6b47('0x39')]({'where':_0x577b01[_0x6b47('0xe')][_0x6b47('0xf')]||{},'attributes':['id','name',_0x6b47('0x20'),_0x6b47('0x46'),'phone',_0x6b47('0x21'),_0x6b47('0x47'),_0x6b47('0x2e')]})[_0x6b47('0x14')](function(_0x192379){if(_0x192379){_0x452a20=_0x192379;_0x3014b2=_0x577b01[_0x6b47('0x30')][_0x6b47('0x2e')]?_0x577b01[_0x6b47('0x30')]['interface']:util[_0x6b47('0x22')](_0x6b47('0x2f'),_0x452a20[_0x6b47('0x28')]);return db['User']['count']({'where':{'role':_0x6b47('0x48'),'online':!![],'id':{'$ne':_0x452a20['id']}}});}})[_0x6b47('0x14')](function(_0x277077){if(_0x277077){_0x36dada=_0x277077;return require('../../config/license/util')[_0x6b47('0x49')]();}})[_0x6b47('0x14')](function(_0x5972f3){if(_0x5972f3&&_0x5972f3['agents']&&_0x36dada>=_0x5972f3['agents']){throw new Error(_0x6b47('0x4a'));}})[_0x6b47('0x14')](function(){if(_0x452a20){return db[_0x6b47('0x25')][_0x6b47('0x43')]({'where':{'membername':_0x452a20['name']},'individualHooks':!![]});}})[_0x6b47('0x14')](function(){if(_0x452a20){return _0x452a20[_0x6b47('0x4b')]({'raw':!![]});}})[_0x6b47('0x14')](function(_0x129fde){if(_0x452a20){if(_0x129fde){var _0x2f64e0=[];_0x26b549=_0x129fde;if(_0x26b549[_0x6b47('0x29')]){for(var _0x180738=0x0;_0x180738<_0x26b549[_0x6b47('0x29')];_0x180738++){_0x2f64e0[_0x6b47('0x44')](db[_0x6b47('0x25')][_0x6b47('0x4c')]({'membername':_0x452a20['name'],'UserId':_0x452a20['id'],'queue_name':_0x26b549[_0x180738][_0x6b47('0x28')],'VoiceQueueId':_0x26b549[_0x180738]['id'],'interface':_0x3014b2,'paused':_0x452a20[_0x6b47('0x47')]||![],'penalty':_0x26b549[_0x180738][_0x6b47('0x4d')]||0x0}));}return BPromise[_0x6b47('0x45')](_0x2f64e0);}}}})[_0x6b47('0x14')](function(){if(_0x452a20){return db[_0x6b47('0x27')][_0x6b47('0xd')]({'where':{'membername':_0x452a20[_0x6b47('0x28')],'exitAt':null}});}})['then'](function(_0x37b822){if(_0x452a20){if(_0x37b822&&_0x37b822[_0x6b47('0x29')]){var _0x54aae6=[];_0x37b822[_0x6b47('0x2c')](function(_0x40c59d){_0x54aae6[_0x6b47('0x44')](_0x40c59d['update']({'exitAt':moment()[_0x6b47('0x22')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6b47('0x45')](_0x54aae6);}}})['then'](function(){if(_0x452a20){var _0x47ee21=[];var _0x55939c=[];var _0xe16184=utils['getChannels']();var _0x548e1e={'membername':_0x452a20[_0x6b47('0x28')],'interface':_0x3014b2,'enterAt':moment()[_0x6b47('0x22')](_0x6b47('0x2a')),'role':_0x452a20['role'],'internal':_0x452a20[_0x6b47('0x21')]};_0xe16184[_0x6b47('0x2c')](function(_0x40993b){_0x47ee21[_0x6b47('0x44')](_[_0x6b47('0x4e')]({'channel':_0x40993b,'type':_0x6b47('0x4f'),'data1':'callysquare','data2':_0x3014b2},_0x548e1e));if(_0x452a20[_0x6b47('0x47')]){_0x55939c['push'](_['merge']({'channel':_0x40993b,'type':_0x6b47('0x50'),'data1':_0x6b47('0x51')},_0x548e1e));}});return db[_0x6b47('0x27')][_0x6b47('0x33')](_0x47ee21['concat'](_0x55939c),{'individualHooks':!![]});}})['then'](function(){if(_0x452a20){return _0x452a20[_0x6b47('0x26')]({'online':!![],'lastLoginAt':moment()[_0x6b47('0x22')](_0x6b47('0x2a')),'voicePause':_0x452a20[_0x6b47('0x47')]||![],'mailPause':_0x452a20[_0x6b47('0x47')]||![],'chatPause':_0x452a20['loginInPause']||![],'faxPause':_0x452a20[_0x6b47('0x47')]||![],'smsPause':_0x452a20[_0x6b47('0x47')]||![],'openchannelPause':_0x452a20[_0x6b47('0x47')]||![],'pauseType':_0x452a20[_0x6b47('0x47')]?_0x6b47('0x51'):null,'lastPauseAt':moment()[_0x6b47('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3014b2});}})[_0x6b47('0x14')](function(_0x1f8965){_0xd70b8e(_0x1f8965);})[_0x6b47('0x1e')](function(_0x2417fb){_0x4f57e8(_0xe8d163[_0x6b47('0x19')](0x1f4,_0x2417fb['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 002110a..c2d8546 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 _0xf803=['./user.events','save','remove','update','emit','register','user:'];(function(_0x2c7975,_0x66dbbb){var _0x78299e=function(_0x7314f8){while(--_0x7314f8){_0x2c7975['push'](_0x2c7975['shift']());}};_0x78299e(++_0x66dbbb);}(_0xf803,0xee));var _0x3f80=function(_0x54c438,_0x325e1e){_0x54c438=_0x54c438-0x0;var _0x3b367d=_0xf803[_0x54c438];return _0x3b367d;};'use strict';var UserEvents=require(_0x3f80('0x0'));var events=[_0x3f80('0x1'),_0x3f80('0x2'),_0x3f80('0x3')];function createListener(_0xb62be0,_0xe53c6f){return function(_0xdc2c8d){_0xe53c6f[_0x3f80('0x4')](_0xb62be0,_0xdc2c8d);};}function removeListener(_0x1914aa,_0x4d264c){return function(){UserEvents['removeListener'](_0x1914aa,_0x4d264c);};}exports[_0x3f80('0x5')]=function(_0x1c360a){for(var _0x201f80=0x0,_0x4493ca=events['length'];_0x201f80<_0x4493ca;_0x201f80++){var _0xe0397b=events[_0x201f80];var _0x7a2dcf=createListener(_0x3f80('0x6')+_0xe0397b,_0x1c360a);UserEvents['on'](_0xe0397b,_0x7a2dcf);}}; \ No newline at end of file +var _0x57ad=['update','emit','removeListener','user:','save','remove'];(function(_0xa8d7ef,_0x4b8b3d){var _0x239d5e=function(_0x15150d){while(--_0x15150d){_0xa8d7ef['push'](_0xa8d7ef['shift']());}};_0x239d5e(++_0x4b8b3d);}(_0x57ad,0x154));var _0xd57a=function(_0x38cf3d,_0x2b8f37){_0x38cf3d=_0x38cf3d-0x0;var _0x4b97f0=_0x57ad[_0x38cf3d];return _0x4b97f0;};'use strict';var UserEvents=require('./user.events');var events=[_0xd57a('0x0'),_0xd57a('0x1'),_0xd57a('0x2')];function createListener(_0x23ad86,_0x3efaae){return function(_0x4720eb){_0x3efaae[_0xd57a('0x3')](_0x23ad86,_0x4720eb);};}function removeListener(_0x388063,_0x466caf){return function(){UserEvents[_0xd57a('0x4')](_0x388063,_0x466caf);};}exports['register']=function(_0x289a42){for(var _0x4a3c56=0x0,_0x2d405e=events['length'];_0x4a3c56<_0x2d405e;_0x4a3c56++){var _0x4777cd=events[_0x4a3c56];var _0x345839=createListener(_0xd57a('0x5')+_0x4777cd,_0x289a42);UserEvents['on'](_0x4777cd,_0x345839);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 54a5e79..9504aa7 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5ea326,_0x3d52fa){var _0x48cf87=function(_0xb15ba1){while(--_0xb15ba1){_0x5ea326['push'](_0x5ea326['shift']());}};_0x48cf87(++_0x3d52fa);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x568aff,_0x160dad){var _0x140c14=function(_0x29aa1e){while(--_0x29aa1e){_0x568aff['push'](_0x568aff['shift']());}};_0x140c14(++_0x160dad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index d239d33..1670938 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 _0xfe9b=['INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe9b,0x1d9));var _0xbfe9=function(_0xe8e98,_0x3a32d9){_0xe8e98=_0xe8e98-0x0;var _0x2d16c4=_0xfe9b[_0xe8e98];return _0x2d16c4;};'use strict';var Sequelize=require(_0xbfe9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbfe9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x14d8=['exports','sequelize'];(function(_0x3d0caf,_0x284938){var _0x1737e7=function(_0x5826dc){while(--_0x5826dc){_0x3d0caf['push'](_0x3d0caf['shift']());}};_0x1737e7(++_0x284938);}(_0x14d8,0x19d));var _0x814d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x14d8[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x814d('0x0'));module[_0x814d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 0b660b8..1319d64 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 _0x69bd=['moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x69bd,0x14f));var _0xd69b=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x69bd[_0x45bf86];return _0x1f02b7;};'use strict';var _=require('lodash');var util=require(_0xd69b('0x0'));var logger=require(_0xd69b('0x1'))(_0xd69b('0x2'));var moment=require(_0xd69b('0x3'));var BPromise=require(_0xd69b('0x4'));var rp=require(_0xd69b('0x5'));var fs=require('fs');var path=require(_0xd69b('0x6'));var rimraf=require('rimraf');var config=require(_0xd69b('0x7'));var attributes=require(_0xd69b('0x8'));module[_0xd69b('0x9')]=function(_0x2fe594,_0x2a290d){return _0x2fe594[_0xd69b('0xa')](_0xd69b('0xb'),attributes,{'tableName':_0xd69b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57d9=['define','user_has_chat_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0xdad7ca,_0x569b69){var _0x401068=function(_0x332e36){while(--_0x332e36){_0xdad7ca['push'](_0xdad7ca['shift']());}};_0x401068(++_0x569b69);}(_0x57d9,0x115));var _0x957d=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0x57d9[_0x2d0d9f];return _0x30243d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x957d('0x0'))(_0x957d('0x1'));var moment=require(_0x957d('0x2'));var BPromise=require(_0x957d('0x3'));var rp=require(_0x957d('0x4'));var fs=require('fs');var path=require(_0x957d('0x5'));var rimraf=require(_0x957d('0x6'));var config=require(_0x957d('0x7'));var attributes=require(_0x957d('0x8'));module['exports']=function(_0x1eb8e1,_0x9ef6cf){return _0x1eb8e1[_0x957d('0x9')]('UserChatQueue',attributes,{'tableName':_0x957d('0xa'),'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 e05e3bc..d2604aa 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 _0xef37=['lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef37,0xdc));var _0x7ef3=function(_0x2d1d2c,_0x5b31ea){_0x2d1d2c=_0x2d1d2c-0x0;var _0x46f015=_0xef37[_0x2d1d2c];return _0x46f015;};'use strict';var _=require(_0x7ef3('0x0'));var util=require(_0x7ef3('0x1'));var moment=require(_0x7ef3('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ef3('0x3'));var fs=require('fs');var Redis=require(_0x7ef3('0x4'));var db=require(_0x7ef3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7ef3('0x6'));var config=require(_0x7ef3('0x7'));var jayson=require(_0x7ef3('0x8'));var client=jayson[_0x7ef3('0x9')][_0x7ef3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc2823d,_0x1740ae,_0x3f37cf){return new BPromise(function(_0x4ace7b,_0x4f2444){return client[_0x7ef3('0xb')](_0xc2823d,_0x3f37cf)[_0x7ef3('0xc')](function(_0x4145b6){logger[_0x7ef3('0xd')](_0x7ef3('0xe'),_0x1740ae,'request\x20sent');logger[_0x7ef3('0xf')](_0x7ef3('0x10'),_0x1740ae,_0x7ef3('0x11'),JSON[_0x7ef3('0x12')](_0x4145b6));if(_0x4145b6['error']){if(_0x4145b6[_0x7ef3('0x13')]['code']===0x1f4){logger[_0x7ef3('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x1740ae,_0x4145b6['error']['message']);return _0x4f2444(_0x4145b6[_0x7ef3('0x13')][_0x7ef3('0x14')]);}logger[_0x7ef3('0x13')](_0x7ef3('0xe'),_0x1740ae,_0x4145b6[_0x7ef3('0x13')]['message']);return _0x4ace7b(_0x4145b6[_0x7ef3('0x13')][_0x7ef3('0x14')]);}else{logger[_0x7ef3('0xd')](_0x7ef3('0xe'),_0x1740ae,_0x7ef3('0x11'));_0x4ace7b(_0x4145b6[_0x7ef3('0x15')]['message']);}})['catch'](function(_0x34e86b){logger['error'](_0x7ef3('0xe'),_0x1740ae,_0x34e86b);_0x4f2444(_0x34e86b);});});} \ No newline at end of file +var _0x8c22=['rpc','../../config/environment','jayson/promise','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x8c22,0x151));var _0x28c2=function(_0x5c6a78,_0x5c0503){_0x5c6a78=_0x5c6a78-0x0;var _0x236c5e=_0x8c22[_0x5c6a78];return _0x236c5e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x28c2('0x0'));var BPromise=require('bluebird');var rs=require(_0x28c2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28c2('0x2'))['db'];var utils=require(_0x28c2('0x3'));var logger=require(_0x28c2('0x4'))(_0x28c2('0x5'));var config=require(_0x28c2('0x6'));var jayson=require(_0x28c2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dcc2e,_0x20cbfd,_0x91eebb){return new BPromise(function(_0x48858b,_0xc8b064){return client['request'](_0x1dcc2e,_0x91eebb)[_0x28c2('0x8')](function(_0x28de2b){logger['info'](_0x28c2('0x9'),_0x20cbfd,_0x28c2('0xa'));logger[_0x28c2('0xb')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x20cbfd,'request\x20sent',JSON[_0x28c2('0xc')](_0x28de2b));if(_0x28de2b['error']){if(_0x28de2b[_0x28c2('0xd')][_0x28c2('0xe')]===0x1f4){logger['error'](_0x28c2('0x9'),_0x20cbfd,_0x28de2b['error'][_0x28c2('0xf')]);return _0xc8b064(_0x28de2b[_0x28c2('0xd')]['message']);}logger[_0x28c2('0xd')](_0x28c2('0x9'),_0x20cbfd,_0x28de2b[_0x28c2('0xd')][_0x28c2('0xf')]);return _0x48858b(_0x28de2b[_0x28c2('0xd')][_0x28c2('0xf')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x20cbfd,_0x28c2('0xa'));_0x48858b(_0x28de2b[_0x28c2('0x10')][_0x28c2('0xf')]);}})[_0x28c2('0x11')](function(_0xf9a648){logger[_0x28c2('0xd')](_0x28c2('0x9'),_0x20cbfd,_0xf9a648);_0xc8b064(_0xf9a648);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index a79191b..58befa4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5b21c5,_0x3cc561){var _0x1bcceb=function(_0x2b451b){while(--_0x2b451b){_0x5b21c5['push'](_0x5b21c5['shift']());}};_0x1bcceb(++_0x3cc561);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xcb91[_0x199c03];return _0x11a7d4;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1ca355,_0x1c0e50){var _0x246507=function(_0x9c6a20){while(--_0x9c6a20){_0x1ca355['push'](_0x1ca355['shift']());}};_0x246507(++_0x1c0e50);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0xcb91[_0x39caaa];return _0x9b9c7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 5610d12..ba82de1 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 _0xaf8c=['sequelize','exports','INTEGER'];(function(_0x7d005a,_0x2c0600){var _0xf97fff=function(_0x109b28){while(--_0x109b28){_0x7d005a['push'](_0x7d005a['shift']());}};_0xf97fff(++_0x2c0600);}(_0xaf8c,0x189));var _0xcaf8=function(_0x41dc37,_0x3876cf){_0x41dc37=_0x41dc37-0x0;var _0x343bb1=_0xaf8c[_0x41dc37];return _0x343bb1;};'use strict';var Sequelize=require(_0xcaf8('0x0'));module[_0xcaf8('0x1')]={'penalty':{'type':Sequelize[_0xcaf8('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcaf8('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb0e9=['sequelize','INTEGER'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xb0e9,0x8c));var _0x9b0e=function(_0x4c73a0,_0x322a3c){_0x4c73a0=_0x4c73a0-0x0;var _0xd7506b=_0xb0e9[_0x4c73a0];return _0xd7506b;};'use strict';var Sequelize=require(_0x9b0e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9b0e('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 92359eb..d3a86bc 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 _0x5f84=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4d5762,_0x367d7b){var _0x453cde=function(_0x414309){while(--_0x414309){_0x4d5762['push'](_0x4d5762['shift']());}};_0x453cde(++_0x367d7b);}(_0x5f84,0x16d));var _0x45f8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5f84[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x45f8('0x0'));var util=require('util');var logger=require(_0x45f8('0x1'))('api');var moment=require(_0x45f8('0x2'));var BPromise=require(_0x45f8('0x3'));var rp=require(_0x45f8('0x4'));var fs=require('fs');var path=require(_0x45f8('0x5'));var rimraf=require('rimraf');var config=require(_0x45f8('0x6'));var attributes=require(_0x45f8('0x7'));module[_0x45f8('0x8')]=function(_0x2c3802,_0xceda18){return _0x2c3802[_0x45f8('0x9')](_0x45f8('0xa'),attributes,{'tableName':_0x45f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e86=['define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x240e92,_0x404100){var _0x4c16dd=function(_0x43dcb2){while(--_0x43dcb2){_0x240e92['push'](_0x240e92['shift']());}};_0x4c16dd(++_0x404100);}(_0x4e86,0x107));var _0x64e8=function(_0x3ac027,_0x122bd2){_0x3ac027=_0x3ac027-0x0;var _0x3e98e9=_0x4e86[_0x3ac027];return _0x3e98e9;};'use strict';var _=require('lodash');var util=require(_0x64e8('0x0'));var logger=require(_0x64e8('0x1'))(_0x64e8('0x2'));var moment=require(_0x64e8('0x3'));var BPromise=require(_0x64e8('0x4'));var rp=require(_0x64e8('0x5'));var fs=require('fs');var path=require(_0x64e8('0x6'));var rimraf=require(_0x64e8('0x7'));var config=require(_0x64e8('0x8'));var attributes=require(_0x64e8('0x9'));module['exports']=function(_0x4c06ce,_0x5cb747){return _0x4c06ce[_0x64e8('0xa')](_0x64e8('0xb'),attributes,{'tableName':_0x64e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 9beeffe..b90d2c9 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 _0x4a53=['code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2751e8,_0x439ced){var _0x416d4c=function(_0x566223){while(--_0x566223){_0x2751e8['push'](_0x2751e8['shift']());}};_0x416d4c(++_0x439ced);}(_0x4a53,0x1d2));var _0x34a5=function(_0x25fc91,_0x1bc6f5){_0x25fc91=_0x25fc91-0x0;var _0x41eca1=_0x4a53[_0x25fc91];return _0x41eca1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x34a5('0x0'));var BPromise=require(_0x34a5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34a5('0x2'))['db'];var utils=require(_0x34a5('0x3'));var logger=require(_0x34a5('0x4'))(_0x34a5('0x5'));var config=require(_0x34a5('0x6'));var jayson=require(_0x34a5('0x7'));var client=jayson[_0x34a5('0x8')][_0x34a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15ee3b,_0x37f9a1,_0x1f3b51){return new BPromise(function(_0x33d91e,_0x4deb7b){return client['request'](_0x15ee3b,_0x1f3b51)[_0x34a5('0xa')](function(_0x21029a){logger[_0x34a5('0xb')](_0x34a5('0xc'),_0x37f9a1,_0x34a5('0xd'));logger['debug'](_0x34a5('0xe'),_0x37f9a1,_0x34a5('0xd'),JSON[_0x34a5('0xf')](_0x21029a));if(_0x21029a[_0x34a5('0x10')]){if(_0x21029a[_0x34a5('0x10')][_0x34a5('0x11')]===0x1f4){logger[_0x34a5('0x10')](_0x34a5('0xc'),_0x37f9a1,_0x21029a[_0x34a5('0x10')]['message']);return _0x4deb7b(_0x21029a[_0x34a5('0x10')][_0x34a5('0x12')]);}logger['error'](_0x34a5('0xc'),_0x37f9a1,_0x21029a['error'][_0x34a5('0x12')]);return _0x33d91e(_0x21029a[_0x34a5('0x10')][_0x34a5('0x12')]);}else{logger['info'](_0x34a5('0xc'),_0x37f9a1,_0x34a5('0xd'));_0x33d91e(_0x21029a[_0x34a5('0x13')]['message']);}})[_0x34a5('0x14')](function(_0x3815aa){logger['error'](_0x34a5('0xc'),_0x37f9a1,_0x3815aa);_0x4deb7b(_0x3815aa);});});} \ No newline at end of file +var _0xbb4b=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0xbb4b,0xa2));var _0xbbb4=function(_0x4e7e14,_0x9224e6){_0x4e7e14=_0x4e7e14-0x0;var _0xf418b2=_0xbb4b[_0x4e7e14];return _0xf418b2;};'use strict';var _=require(_0xbbb4('0x0'));var util=require(_0xbbb4('0x1'));var moment=require(_0xbbb4('0x2'));var BPromise=require(_0xbbb4('0x3'));var rs=require(_0xbbb4('0x4'));var fs=require('fs');var Redis=require(_0xbbb4('0x5'));var db=require(_0xbbb4('0x6'))['db'];var utils=require(_0xbbb4('0x7'));var logger=require(_0xbbb4('0x8'))(_0xbbb4('0x9'));var config=require('../../config/environment');var jayson=require(_0xbbb4('0xa'));var client=jayson['client'][_0xbbb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x318e2c,_0x12b716,_0x237070){return new BPromise(function(_0x123ef3,_0xfa911c){return client[_0xbbb4('0xc')](_0x318e2c,_0x237070)[_0xbbb4('0xd')](function(_0x40dba2){logger[_0xbbb4('0xe')](_0xbbb4('0xf'),_0x12b716,_0xbbb4('0x10'));logger[_0xbbb4('0x11')](_0xbbb4('0x12'),_0x12b716,_0xbbb4('0x10'),JSON[_0xbbb4('0x13')](_0x40dba2));if(_0x40dba2[_0xbbb4('0x14')]){if(_0x40dba2['error']['code']===0x1f4){logger[_0xbbb4('0x14')](_0xbbb4('0xf'),_0x12b716,_0x40dba2[_0xbbb4('0x14')][_0xbbb4('0x15')]);return _0xfa911c(_0x40dba2[_0xbbb4('0x14')][_0xbbb4('0x15')]);}logger['error'](_0xbbb4('0xf'),_0x12b716,_0x40dba2[_0xbbb4('0x14')][_0xbbb4('0x15')]);return _0x123ef3(_0x40dba2[_0xbbb4('0x14')]['message']);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x12b716,'request\x20sent');_0x123ef3(_0x40dba2[_0xbbb4('0x16')][_0xbbb4('0x15')]);}})['catch'](function(_0x3c3228){logger[_0xbbb4('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x12b716,_0x3c3228);_0xfa911c(_0x3c3228);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index de8ca97..012082f 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2b1aad,_0x4ec6cc){var _0x16fed7=function(_0x537fb7){while(--_0x537fb7){_0x2b1aad['push'](_0x2b1aad['shift']());}};_0x16fed7(++_0x4ec6cc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x234341,_0x1f0568){var _0x2fd6e9=function(_0x1fd8dd){while(--_0x1fd8dd){_0x234341['push'](_0x234341['shift']());}};_0x2fd6e9(++_0x1f0568);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 22278f1..92503b5 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 _0x1aa4=['sequelize','exports','INTEGER'];(function(_0x83ac11,_0x46c46c){var _0x41c32a=function(_0x2141c6){while(--_0x2141c6){_0x83ac11['push'](_0x83ac11['shift']());}};_0x41c32a(++_0x46c46c);}(_0x1aa4,0x171));var _0x41aa=function(_0x3a7ace,_0x5976bb){_0x3a7ace=_0x3a7ace-0x0;var _0x296304=_0x1aa4[_0x3a7ace];return _0x296304;};'use strict';var Sequelize=require(_0x41aa('0x0'));module[_0x41aa('0x1')]={'penalty':{'type':Sequelize[_0x41aa('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x74e2=['sequelize','exports','INTEGER'];(function(_0x14755a,_0x408654){var _0x219793=function(_0x573024){while(--_0x573024){_0x14755a['push'](_0x14755a['shift']());}};_0x219793(++_0x408654);}(_0x74e2,0x1d4));var _0x274e=function(_0x62f01c,_0x4e93a2){_0x62f01c=_0x62f01c-0x0;var _0x19910e=_0x74e2[_0x62f01c];return _0x19910e;};'use strict';var Sequelize=require(_0x274e('0x0'));module[_0x274e('0x1')]={'penalty':{'type':Sequelize[_0x274e('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 45a7e0a..deb15f7 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 _0x73e8=['rimraf','./userMailQueue.attributes','define','UserMailQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x45c8c3,_0x54d7cf){var _0x40014f=function(_0x541ee2){while(--_0x541ee2){_0x45c8c3['push'](_0x45c8c3['shift']());}};_0x40014f(++_0x54d7cf);}(_0x73e8,0xca));var _0x873e=function(_0x268041,_0x5335a5){_0x268041=_0x268041-0x0;var _0x140f6e=_0x73e8[_0x268041];return _0x140f6e;};'use strict';var _=require(_0x873e('0x0'));var util=require(_0x873e('0x1'));var logger=require(_0x873e('0x2'))('api');var moment=require(_0x873e('0x3'));var BPromise=require(_0x873e('0x4'));var rp=require(_0x873e('0x5'));var fs=require('fs');var path=require(_0x873e('0x6'));var rimraf=require(_0x873e('0x7'));var config=require('../../config/environment');var attributes=require(_0x873e('0x8'));module['exports']=function(_0x563165,_0x33d9ec){return _0x563165[_0x873e('0x9')](_0x873e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc483=['moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','api'];(function(_0x510461,_0x42f9af){var _0x701009=function(_0x30407c){while(--_0x30407c){_0x510461['push'](_0x510461['shift']());}};_0x701009(++_0x42f9af);}(_0xc483,0x6d));var _0x3c48=function(_0x35bccd,_0x513a55){_0x35bccd=_0x35bccd-0x0;var _0x2fcb10=_0xc483[_0x35bccd];return _0x2fcb10;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3c48('0x0'));var moment=require(_0x3c48('0x1'));var BPromise=require(_0x3c48('0x2'));var rp=require(_0x3c48('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c48('0x4'));var config=require(_0x3c48('0x5'));var attributes=require(_0x3c48('0x6'));module[_0x3c48('0x7')]=function(_0x6a3b3d,_0x298475){return _0x6a3b3d[_0x3c48('0x8')](_0x3c48('0x9'),attributes,{'tableName':_0x3c48('0xa'),'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 7ccb52b..eb6bbff 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x118f51,_0x1772f5){var _0x1a05f2=function(_0x10f96f){while(--_0x10f96f){_0x118f51['push'](_0x118f51['shift']());}};_0x1a05f2(++_0x1772f5);}(_0xa41a,0x6b));var _0xaa41=function(_0x67c0ea,_0x240b31){_0x67c0ea=_0x67c0ea-0x0;var _0x3c7d95=_0xa41a[_0x67c0ea];return _0x3c7d95;};'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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13177b,_0x254be3){var _0x201f86=function(_0x408f3c){while(--_0x408f3c){_0x13177b['push'](_0x13177b['shift']());}};_0x201f86(++_0x254be3);}(_0xa41a,0x6b));var _0xaa41=function(_0x137c9f,_0x2d8d78){_0x137c9f=_0x137c9f-0x0;var _0x424200=_0xa41a[_0x137c9f];return _0x424200;};'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 diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 08e7782..6c4858a 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 _0xa0a6=['../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5d4e4c,_0x27eea1){var _0x206994=function(_0x170a8b){while(--_0x170a8b){_0x5d4e4c['push'](_0x5d4e4c['shift']());}};_0x206994(++_0x27eea1);}(_0xa0a6,0xba));var _0x6a0a=function(_0x2f94e2,_0x3b1a95){_0x2f94e2=_0x2f94e2-0x0;var _0x5e3242=_0xa0a6[_0x2f94e2];return _0x5e3242;};'use strict';var multer=require(_0x6a0a('0x0'));var util=require(_0x6a0a('0x1'));var path=require('path');var timeout=require(_0x6a0a('0x2'));var express=require(_0x6a0a('0x3'));var router=express[_0x6a0a('0x4')]();var fs_extra=require(_0x6a0a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a0a('0x6'));var config=require('../../config/environment');var controller=require(_0x6a0a('0x7'));router[_0x6a0a('0x8')]('/',auth[_0x6a0a('0x9')](),controller[_0x6a0a('0xa')]);module[_0x6a0a('0xb')]=router; \ No newline at end of file +var _0x2168=['../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x399849,_0x3b630d){var _0xfbb04=function(_0x4fea04){while(--_0x4fea04){_0x399849['push'](_0x399849['shift']());}};_0xfbb04(++_0x3b630d);}(_0x2168,0x1c1));var _0x8216=function(_0x310df9,_0x41756f){_0x310df9=_0x310df9-0x0;var _0x5f556d=_0x2168[_0x310df9];return _0x5f556d;};'use strict';var multer=require(_0x8216('0x0'));var util=require('util');var path=require(_0x8216('0x1'));var timeout=require(_0x8216('0x2'));var express=require(_0x8216('0x3'));var router=express['Router']();var fs_extra=require(_0x8216('0x4'));var auth=require(_0x8216('0x5'));var interaction=require(_0x8216('0x6'));var config=require(_0x8216('0x7'));var controller=require(_0x8216('0x8'));router[_0x8216('0x9')]('/',auth[_0x8216('0xa')](),controller['sendUserNotification']);module[_0x8216('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 7e3ca04..db32f6e 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 _0x10a2=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x36f69a,_0x3c5559){var _0x4e1891=function(_0x49c127){while(--_0x49c127){_0x36f69a['push'](_0x36f69a['shift']());}};_0x4e1891(++_0x3c5559);}(_0x10a2,0x14a));var _0x210a=function(_0x363d60,_0x2f19c3){_0x363d60=_0x363d60-0x0;var _0x3635ab=_0x10a2[_0x363d60];return _0x3635ab;};'use strict';var Sequelize=require(_0x210a('0x0'));module[_0x210a('0x1')]={'body':{'type':Sequelize[_0x210a('0x2')]},'senderName':{'type':Sequelize[_0x210a('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x210a('0x3')]},'beep':{'type':Sequelize[_0x210a('0x4')]}}; \ No newline at end of file +var _0x4dee=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x4dee,0x172));var _0xe4de=function(_0x129150,_0x98040){_0x129150=_0x129150-0x0;var _0x10e691=_0x4dee[_0x129150];return _0x10e691;};'use strict';var Sequelize=require(_0xe4de('0x0'));module[_0xe4de('0x1')]={'body':{'type':Sequelize[_0xe4de('0x2')]},'senderName':{'type':Sequelize[_0xe4de('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xe4de('0x3')]},'beep':{'type':Sequelize[_0xe4de('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 56f39d4..a3ddc5e 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 _0xb2ce=['../../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','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','error','stack','name','send','hasOwnProperty','body','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sequelize','transaction','UserNotification','create','forEach','recipient','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','catch','startCase','model','User','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1198ab,_0x2820a5){var _0x211f57=function(_0x18f2df){while(--_0x18f2df){_0x1198ab['push'](_0x1198ab['shift']());}};_0x211f57(++_0x2820a5);}(_0xb2ce,0x125));var _0xeb2c=function(_0xe06a2c,_0x1293bf){_0xe06a2c=_0xe06a2c-0x0;var _0x591b0a=_0xb2ce[_0xe06a2c];return _0x591b0a;};'use strict';var emlformat=require(_0xeb2c('0x0'));var rimraf=require(_0xeb2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeb2c('0x2'));var moment=require(_0xeb2c('0x3'));var BPromise=require(_0xeb2c('0x4'));var Mustache=require(_0xeb2c('0x5'));var util=require(_0xeb2c('0x6'));var path=require(_0xeb2c('0x7'));var sox=require(_0xeb2c('0x8'));var csv=require(_0xeb2c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb2c('0xa'));var _=require(_0xeb2c('0xb'));var squel=require(_0xeb2c('0xc'));var crypto=require(_0xeb2c('0xd'));var jsforce=require(_0xeb2c('0xe'));var deskjs=require(_0xeb2c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb2c('0x10'));var Papa=require(_0xeb2c('0x11'));var Redis=require(_0xeb2c('0x12'));var authService=require(_0xeb2c('0x13'));var qs=require(_0xeb2c('0x14'));var as=require(_0xeb2c('0x15'));var hardwareService=require(_0xeb2c('0x16'));var logger=require(_0xeb2c('0x17'))(_0xeb2c('0x18'));var utils=require(_0xeb2c('0x19'));var config=require(_0xeb2c('0x1a'));var licenseUtil=require(_0xeb2c('0x1b'));var db=require(_0xeb2c('0x1c'))['db'];config[_0xeb2c('0x1d')]=_[_0xeb2c('0x1e')](config['redis'],{'host':_0xeb2c('0x1f'),'port':0x18eb});var socket=require(_0xeb2c('0x20'))(new Redis(config[_0xeb2c('0x1d')]));require(_0xeb2c('0x21'))[_0xeb2c('0x22')](socket);function respondWithStatusCode(_0x494cec,_0x359dbf){_0x359dbf=_0x359dbf||0xcc;return function(_0x376b32){if(_0x376b32){return _0x494cec[_0xeb2c('0x23')](_0x359dbf);}return _0x494cec[_0xeb2c('0x24')](_0x359dbf)[_0xeb2c('0x25')]();};}function respondWithResult(_0x2faa13,_0x1d39fa){_0x1d39fa=_0x1d39fa||0xc8;return function(_0x298bad){if(_0x298bad){return _0x2faa13[_0xeb2c('0x24')](_0x1d39fa)[_0xeb2c('0x26')](_0x298bad);}};}function respondWithFilteredResult(_0x178bee,_0x464834){return function(_0x1f14f5){if(_0x1f14f5){var _0x3fdc74=typeof _0x464834['offset']===_0xeb2c('0x27')&&typeof _0x464834[_0xeb2c('0x28')]===_0xeb2c('0x27');var _0x58d7d6=_0x1f14f5['count'];var _0xad3578=_0x3fdc74?0x0:_0x464834[_0xeb2c('0x29')];var _0x338fed=_0x3fdc74?_0x1f14f5[_0xeb2c('0x2a')]:_0x464834[_0xeb2c('0x29')]+_0x464834['limit'];var _0x37fb3a;if(_0x338fed>=_0x58d7d6){_0x338fed=_0x58d7d6;_0x37fb3a=0xc8;}else{_0x37fb3a=0xce;}_0x178bee['status'](_0x37fb3a);return _0x178bee['set'](_0xeb2c('0x2b'),_0xad3578+'-'+_0x338fed+'/'+_0x58d7d6)[_0xeb2c('0x26')](_0x1f14f5);}return null;};}function patchUpdates(_0x378b05){return function(_0x396d35){try{jsonpatch[_0xeb2c('0x2c')](_0x396d35,_0x378b05,!![]);}catch(_0x51bcab){return BPromise['reject'](_0x51bcab);}return _0x396d35['save']();};}function saveUpdates(_0x225ef5,_0x177ac6){return function(_0x406815){if(_0x406815){return _0x406815[_0xeb2c('0x2d')](_0x225ef5)[_0xeb2c('0x2e')](function(_0x2794af){return _0x2794af;});}return null;};}function removeEntity(_0x395e24,_0x13cea8){return function(_0x25f02f){if(_0x25f02f){return _0x25f02f[_0xeb2c('0x2f')]()[_0xeb2c('0x2e')](function(){_0x395e24[_0xeb2c('0x24')](0xcc)[_0xeb2c('0x25')]();});}};}function handleEntityNotFound(_0x28b11d,_0x3a60c4){return function(_0x482641){if(!_0x482641){_0x28b11d[_0xeb2c('0x23')](0x194);}return _0x482641;};}function handleError(_0x161d6e,_0xad3ef1){_0xad3ef1=_0xad3ef1||0x1f4;return function(_0x145395){logger[_0xeb2c('0x30')](_0x145395[_0xeb2c('0x31')]);if(_0x145395[_0xeb2c('0x32')]){delete _0x145395[_0xeb2c('0x32')];}_0x161d6e[_0xeb2c('0x24')](_0xad3ef1)[_0xeb2c('0x33')](_0x145395);};}exports['sendUserNotification']=function(_0x4ec2bf,_0x56ce0a,_0x427e55){if(!_0x4ec2bf['body'][_0xeb2c('0x34')]('text')&&!_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')]('TemplateId')){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))](_0xeb2c('0x38'));}else{if(_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')](_0xeb2c('0x39'))&&!_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')]('view')){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))](_0xeb2c('0x3a'));}if(!_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')](_0xeb2c('0x3b'))){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4c2c51=JSON[_0xeb2c('0x3c')](_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x3b')]);}catch(_0x2a1636){logger[_0xeb2c('0x30')](_0x2a1636);throw new db[(_0xeb2c('0x36'))]['ValidationError'](_0xeb2c('0x3d'));}var _0x448543=[_0xeb2c('0x3e'),_0xeb2c('0x3f'),_0xeb2c('0x40'),'openchannelqueue',_0xeb2c('0x41'),_0xeb2c('0x42'),_0xeb2c('0x43'),_0xeb2c('0x44'),_0xeb2c('0x45')];if(_[_0xeb2c('0x46')](_0x4c2c51,function(_0x18a90f){return!_['includes'](_0x448543,_0x18a90f['model'][_0xeb2c('0x47')]());})){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))](_0xeb2c('0x48'));}}}var _0x38c43e={};_0x38c43e[_0xeb2c('0x49')]=_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')](_0xeb2c('0x49'))?_0x4ec2bf['body'][_0xeb2c('0x49')]:_0x4ec2bf[_0xeb2c('0x45')][_0xeb2c('0x4a')];_0x38c43e['recipientsDescription']=_[_0xeb2c('0x4b')](_0x4ec2bf['body'][_0xeb2c('0x4c')])?null:_0x4ec2bf[_0xeb2c('0x35')]['recipientsDescription'];_0x38c43e['beep']=_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x4d')]||![];_0x38c43e['SenderId']=_0x4ec2bf['user']['id'];return getContent(_0x4ec2bf[_0xeb2c('0x35')])[_0xeb2c('0x2e')](function(_0xd41e77){_0x38c43e['body']=_0xd41e77;return getRecipients(_0x4c2c51);})[_0xeb2c('0x2e')](function(_0xdadeb4){_0x38c43e[_0xeb2c('0x4e')]=_['sortBy'](_0xdadeb4)['join'](',');return db[_0xeb2c('0x4f')][_0xeb2c('0x50')](function(_0x343aee){return db[_0xeb2c('0x51')][_0xeb2c('0x52')](_0x38c43e,{'raw':!![],'transaction':_0x343aee})[_0xeb2c('0x2e')](function(_0x8adbf2){var _0x1d365e={'sender':_0x38c43e[_0xeb2c('0x49')],'description':_0x38c43e[_0xeb2c('0x4c')],'content':_0x38c43e[_0xeb2c('0x35')],'beep':_0x38c43e[_0xeb2c('0x4d')]};_0xdadeb4[_0xeb2c('0x53')](function(_0x1ceaad){_0x1d365e[_0xeb2c('0x54')]=_0x1ceaad;socket['emit']('userNotification:send',_0x1d365e);});return _0x8adbf2;});});})[_0xeb2c('0x2e')](respondWithResult(_0x56ce0a,0xc9))['catch'](handleError(_0x56ce0a,null));};function getContent(_0x5afe92){return new BPromise(function(_0x389237,_0x291d1c){if(_0x5afe92[_0xeb2c('0x55')]){_0x389237(_0x5afe92[_0xeb2c('0x55')]);return;}return db[_0xeb2c('0x56')]['findOne']({'attributes':[_0xeb2c('0x57')],'where':{'id':_0x5afe92['TemplateId']},'raw':!![]})['then'](function(_0x3bf8e8){if(!_0x3bf8e8)throw new db['Sequelize']['ValidationError'](_0xeb2c('0x58'));var _0x2f8cea=Mustache[_0xeb2c('0x59')](_0x3bf8e8[_0xeb2c('0x57')],_0x5afe92[_0xeb2c('0x5a')]);_0x389237(_0x2f8cea);})[_0xeb2c('0x5b')](function(_0x4b508e){_0x291d1c(_0x4b508e);});});}function getRecipients(_0x228dd1){return new BPromise(function(_0x9d794d,_0x417fb0){var _0x2b4ea5=[];var _0x472c29=[];_0x228dd1[_0xeb2c('0x53')](function(_0x51c182){var _0x53671d=_[_0xeb2c('0x5c')](_0x51c182[_0xeb2c('0x5d')][_0xeb2c('0x47')]());if(_0x53671d===_0xeb2c('0x5e')){_0x2b4ea5=_['union'](_0x2b4ea5,_0x51c182[_0xeb2c('0x5f')]);}else{if(_['includes'](_0x53671d,_0xeb2c('0x60')))_0x53671d=_0x53671d[_0xeb2c('0x61')](_0xeb2c('0x60'),_0xeb2c('0x62'));_0x51c182[_0xeb2c('0x5f')]['forEach'](function(_0x11ef6a){_0x472c29[_0xeb2c('0x63')](getAgents(_0x53671d,_0x11ef6a));});}});return BPromise[_0xeb2c('0x64')](_0x472c29)['then'](function(_0x17ac3f){_0x2b4ea5=_['union'](_0x2b4ea5,_[_0xeb2c('0x65')](_0x17ac3f));_0x9d794d(_0x2b4ea5);})['catch'](function(_0x168f03){_0x417fb0(_0x168f03);});});}function getAgents(_0x2e828e,_0xc2898d){return new BPromise(function(_0x3335b2,_0x55265c){return db[_0x2e828e]['findOne']({'where':{'id':_0xc2898d}})['then'](function(_0x1ef37e){return _0x1ef37e[_0xeb2c('0x66')]({'attributes':['id'],'raw':!![]})[_0xeb2c('0x2e')](function(_0x3f371a){var _0x548da2=_[_0xeb2c('0x67')](_0x3f371a,'id');_0x3335b2(_0x548da2);});})[_0xeb2c('0x5b')](function(_0x7d5f2d){_0x55265c(_0x7d5f2d);});});} \ No newline at end of file +var _0x8747=['recipient','emit','findOne','html','render','catch','toLowerCase','User','union','ids','replace','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','status','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach'];(function(_0x58f051,_0x4bb821){var _0x750142=function(_0x34c19f){while(--_0x34c19f){_0x58f051['push'](_0x58f051['shift']());}};_0x750142(++_0x4bb821);}(_0x8747,0x141));var _0x7874=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x8747[_0x57d13b];return _0x467696;};'use strict';var emlformat=require(_0x7874('0x0'));var rimraf=require(_0x7874('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7874('0x2'));var rp=require('request-promise');var moment=require(_0x7874('0x3'));var BPromise=require(_0x7874('0x4'));var Mustache=require(_0x7874('0x5'));var util=require('util');var path=require(_0x7874('0x6'));var sox=require('sox');var csv=require(_0x7874('0x7'));var ejs=require(_0x7874('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7874('0x9'));var squel=require(_0x7874('0xa'));var crypto=require(_0x7874('0xb'));var jsforce=require(_0x7874('0xc'));var deskjs=require(_0x7874('0xd'));var toCsv=require(_0x7874('0x7'));var querystring=require(_0x7874('0xe'));var Papa=require(_0x7874('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7874('0x10'));var as=require(_0x7874('0x11'));var hardwareService=require(_0x7874('0x12'));var logger=require(_0x7874('0x13'))(_0x7874('0x14'));var utils=require(_0x7874('0x15'));var config=require(_0x7874('0x16'));var licenseUtil=require(_0x7874('0x17'));var db=require('../../mysqldb')['db'];config[_0x7874('0x18')]=_[_0x7874('0x19')](config[_0x7874('0x18')],{'host':_0x7874('0x1a'),'port':0x18eb});var socket=require(_0x7874('0x1b'))(new Redis(config[_0x7874('0x18')]));require(_0x7874('0x1c'))[_0x7874('0x1d')](socket);function respondWithStatusCode(_0x2f8bca,_0x1798ec){_0x1798ec=_0x1798ec||0xcc;return function(_0x22e954){if(_0x22e954){return _0x2f8bca['sendStatus'](_0x1798ec);}return _0x2f8bca['status'](_0x1798ec)[_0x7874('0x1e')]();};}function respondWithResult(_0x52d9af,_0x398796){_0x398796=_0x398796||0xc8;return function(_0x6bbf08){if(_0x6bbf08){return _0x52d9af['status'](_0x398796)[_0x7874('0x1f')](_0x6bbf08);}};}function respondWithFilteredResult(_0x308adc,_0x48e4ce){return function(_0x4886f4){if(_0x4886f4){var _0x1e57c9=typeof _0x48e4ce[_0x7874('0x20')]===_0x7874('0x21')&&typeof _0x48e4ce[_0x7874('0x22')]==='undefined';var _0x414b17=_0x4886f4[_0x7874('0x23')];var _0x201c2=_0x1e57c9?0x0:_0x48e4ce[_0x7874('0x20')];var _0x50c4aa=_0x1e57c9?_0x4886f4[_0x7874('0x23')]:_0x48e4ce[_0x7874('0x20')]+_0x48e4ce[_0x7874('0x22')];var _0x427f73;if(_0x50c4aa>=_0x414b17){_0x50c4aa=_0x414b17;_0x427f73=0xc8;}else{_0x427f73=0xce;}_0x308adc['status'](_0x427f73);return _0x308adc['set'](_0x7874('0x24'),_0x201c2+'-'+_0x50c4aa+'/'+_0x414b17)[_0x7874('0x1f')](_0x4886f4);}return null;};}function patchUpdates(_0x52af1a){return function(_0x3870a2){try{jsonpatch['apply'](_0x3870a2,_0x52af1a,!![]);}catch(_0x1d5595){return BPromise[_0x7874('0x25')](_0x1d5595);}return _0x3870a2[_0x7874('0x26')]();};}function saveUpdates(_0x534f75,_0x370422){return function(_0x1f4af8){if(_0x1f4af8){return _0x1f4af8[_0x7874('0x27')](_0x534f75)[_0x7874('0x28')](function(_0x2bbf11){return _0x2bbf11;});}return null;};}function removeEntity(_0x5b98fc,_0x43dcb7){return function(_0x4f07fc){if(_0x4f07fc){return _0x4f07fc[_0x7874('0x29')]()[_0x7874('0x28')](function(){_0x5b98fc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x330d2d,_0x34e99c){return function(_0x247106){if(!_0x247106){_0x330d2d[_0x7874('0x2a')](0x194);}return _0x247106;};}function handleError(_0x1877db,_0x19aefc){_0x19aefc=_0x19aefc||0x1f4;return function(_0x2175ad){logger[_0x7874('0x2b')](_0x2175ad['stack']);if(_0x2175ad['name']){delete _0x2175ad['name'];}_0x1877db[_0x7874('0x2c')](_0x19aefc)[_0x7874('0x2d')](_0x2175ad);};}exports[_0x7874('0x2e')]=function(_0x5029ac,_0x2d9004,_0x5762d9){if(!_0x5029ac[_0x7874('0x2f')][_0x7874('0x30')](_0x7874('0x31'))&&!_0x5029ac[_0x7874('0x2f')][_0x7874('0x30')]('TemplateId')){throw new db[(_0x7874('0x32'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x5029ac[_0x7874('0x2f')]['hasOwnProperty'](_0x7874('0x33'))&&!_0x5029ac[_0x7874('0x2f')]['hasOwnProperty'](_0x7874('0x34'))){throw new db[(_0x7874('0x32'))]['ValidationError'](_0x7874('0x35'));}if(!_0x5029ac['body'][_0x7874('0x30')](_0x7874('0x36'))){throw new db[(_0x7874('0x32'))][(_0x7874('0x37'))](_0x7874('0x38'));}else{try{var _0x54e8dc=JSON[_0x7874('0x39')](_0x5029ac[_0x7874('0x2f')][_0x7874('0x36')]);}catch(_0x1ce25e){logger['error'](_0x1ce25e);throw new db[(_0x7874('0x32'))][(_0x7874('0x37'))](_0x7874('0x3a'));}var _0x40bdae=[_0x7874('0x3b'),'faxqueue',_0x7874('0x3c'),_0x7874('0x3d'),_0x7874('0x3e'),_0x7874('0x3f'),_0x7874('0x40'),'team',_0x7874('0x41')];if(_[_0x7874('0x42')](_0x54e8dc,function(_0x5161cb){return!_[_0x7874('0x43')](_0x40bdae,_0x5161cb[_0x7874('0x44')]['toLowerCase']());})){throw new db['Sequelize']['ValidationError'](_0x7874('0x45'));}}}var _0x5db4c6={};_0x5db4c6[_0x7874('0x46')]=_0x5029ac[_0x7874('0x2f')]['hasOwnProperty'](_0x7874('0x46'))?_0x5029ac['body'][_0x7874('0x46')]:_0x5029ac[_0x7874('0x41')][_0x7874('0x47')];_0x5db4c6[_0x7874('0x48')]=_[_0x7874('0x49')](_0x5029ac[_0x7874('0x2f')][_0x7874('0x48')])?null:_0x5029ac['body'][_0x7874('0x48')];_0x5db4c6[_0x7874('0x4a')]=_0x5029ac[_0x7874('0x2f')]['beep']||![];_0x5db4c6[_0x7874('0x4b')]=_0x5029ac[_0x7874('0x41')]['id'];return getContent(_0x5029ac['body'])['then'](function(_0x1c53cb){_0x5db4c6['body']=_0x1c53cb;return getRecipients(_0x54e8dc);})[_0x7874('0x28')](function(_0x4a7e6b){_0x5db4c6[_0x7874('0x4c')]=_[_0x7874('0x4d')](_0x4a7e6b)[_0x7874('0x4e')](',');return db[_0x7874('0x4f')][_0x7874('0x50')](function(_0x19a810){return db[_0x7874('0x51')]['create'](_0x5db4c6,{'raw':!![],'transaction':_0x19a810})[_0x7874('0x28')](function(_0x4972b8){var _0x27307e={'sender':_0x5db4c6['senderName'],'description':_0x5db4c6[_0x7874('0x48')],'content':_0x5db4c6[_0x7874('0x2f')],'beep':_0x5db4c6[_0x7874('0x4a')]};_0x4a7e6b[_0x7874('0x52')](function(_0x402c4f){_0x27307e[_0x7874('0x53')]=_0x402c4f;socket[_0x7874('0x54')]('userNotification:send',_0x27307e);});return _0x4972b8;});});})['then'](respondWithResult(_0x2d9004,0xc9))['catch'](handleError(_0x2d9004,null));};function getContent(_0x55eb21){return new BPromise(function(_0x129224,_0x4876b8){if(_0x55eb21['text']){_0x129224(_0x55eb21[_0x7874('0x31')]);return;}return db['Template'][_0x7874('0x55')]({'attributes':[_0x7874('0x56')],'where':{'id':_0x55eb21[_0x7874('0x33')]},'raw':!![]})[_0x7874('0x28')](function(_0x535f09){if(!_0x535f09)throw new db[(_0x7874('0x32'))][(_0x7874('0x37'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x462182=Mustache[_0x7874('0x57')](_0x535f09[_0x7874('0x56')],_0x55eb21[_0x7874('0x34')]);_0x129224(_0x462182);})[_0x7874('0x58')](function(_0x386704){_0x4876b8(_0x386704);});});}function getRecipients(_0x5ea300){return new BPromise(function(_0x50ac76,_0x5f2c0f){var _0x569eb5=[];var _0xc30317=[];_0x5ea300[_0x7874('0x52')](function(_0x547379){var _0x23187e=_['startCase'](_0x547379[_0x7874('0x44')][_0x7874('0x59')]());if(_0x23187e===_0x7874('0x5a')){_0x569eb5=_[_0x7874('0x5b')](_0x569eb5,_0x547379[_0x7874('0x5c')]);}else{if(_[_0x7874('0x43')](_0x23187e,'queue'))_0x23187e=_0x23187e[_0x7874('0x5d')](_0x7874('0x5e'),_0x7874('0x5f'));_0x547379[_0x7874('0x5c')][_0x7874('0x52')](function(_0x33767b){_0xc30317[_0x7874('0x60')](getAgents(_0x23187e,_0x33767b));});}});return BPromise[_0x7874('0x61')](_0xc30317)[_0x7874('0x28')](function(_0x373f8c){_0x569eb5=_[_0x7874('0x5b')](_0x569eb5,_[_0x7874('0x62')](_0x373f8c));_0x50ac76(_0x569eb5);})['catch'](function(_0x4fcf30){_0x5f2c0f(_0x4fcf30);});});}function getAgents(_0x311770,_0x2cb912){return new BPromise(function(_0x524075,_0x32ef2a){return db[_0x311770][_0x7874('0x55')]({'where':{'id':_0x2cb912}})['then'](function(_0x307855){return _0x307855[_0x7874('0x63')]({'attributes':['id'],'raw':!![]})['then'](function(_0x263e31){var _0x562cd2=_[_0x7874('0x64')](_0x263e31,'id');_0x524075(_0x562cd2);});})['catch'](function(_0x132080){_0x32ef2a(_0x132080);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index bb452c9..b52b551 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 _0xb0dd=['hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove'];(function(_0x59c4a1,_0x2c941d){var _0x3da53d=function(_0x414d45){while(--_0x414d45){_0x59c4a1['push'](_0x59c4a1['shift']());}};_0x3da53d(++_0x2c941d);}(_0xb0dd,0x189));var _0xdb0d=function(_0x4ebf46,_0x417e3c){_0x4ebf46=_0x4ebf46-0x0;var _0x4f4813=_0xb0dd[_0x4ebf46];return _0x4f4813;};'use strict';var EventEmitter=require(_0xdb0d('0x0'));var UserNotification=require(_0xdb0d('0x1'))['db'][_0xdb0d('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdb0d('0x3')](0x0);var events={'afterCreate':_0xdb0d('0x4'),'afterUpdate':_0xdb0d('0x5'),'afterDestroy':_0xdb0d('0x6')};function emitEvent(_0x473da9){return function(_0x4ef2a3,_0x4b8dea,_0x55a132){UserNotificationEvents['emit'](_0x473da9+':'+_0x4ef2a3['id'],_0x4ef2a3);UserNotificationEvents['emit'](_0x473da9,_0x4ef2a3);_0x55a132(null);};}for(var e in events){if(events[_0xdb0d('0x7')](e)){var event=events[e];UserNotification[_0xdb0d('0x8')](e,emitEvent(event));}}module[_0xdb0d('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x9ace=['remove','emit','hasOwnProperty','save'];(function(_0x4812c9,_0x154b76){var _0x4de61f=function(_0x42cd33){while(--_0x42cd33){_0x4812c9['push'](_0x4812c9['shift']());}};_0x4de61f(++_0x154b76);}(_0x9ace,0x1d7));var _0xe9ac=function(_0x290038,_0x1896e2){_0x290038=_0x290038-0x0;var _0x556bf9=_0x9ace[_0x290038];return _0x556bf9;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe9ac('0x0'),'afterUpdate':'update','afterDestroy':_0xe9ac('0x1')};function emitEvent(_0x45ad3b){return function(_0x36f4d4,_0x1531a5,_0x416c72){UserNotificationEvents['emit'](_0x45ad3b+':'+_0x36f4d4['id'],_0x36f4d4);UserNotificationEvents[_0xe9ac('0x2')](_0x45ad3b,_0x36f4d4);_0x416c72(null);};}for(var e in events){if(events[_0xe9ac('0x3')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 58698ff..1f98761 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 _0xa66d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1241b8,_0x2dbf50){var _0x4faa5c=function(_0x5bf25c){while(--_0x5bf25c){_0x1241b8['push'](_0x1241b8['shift']());}};_0x4faa5c(++_0x2dbf50);}(_0xa66d,0xee));var _0xda66=function(_0x5ae655,_0x32a667){_0x5ae655=_0x5ae655-0x0;var _0x2a00cf=_0xa66d[_0x5ae655];return _0x2a00cf;};'use strict';var _=require(_0xda66('0x0'));var util=require(_0xda66('0x1'));var logger=require(_0xda66('0x2'))(_0xda66('0x3'));var moment=require(_0xda66('0x4'));var BPromise=require(_0xda66('0x5'));var rp=require(_0xda66('0x6'));var fs=require('fs');var path=require(_0xda66('0x7'));var rimraf=require(_0xda66('0x8'));var config=require(_0xda66('0x9'));var attributes=require(_0xda66('0xa'));module[_0xda66('0xb')]=function(_0x2c7696,_0x1e55b1){return _0x2c7696[_0xda66('0xc')](_0xda66('0xd'),attributes,{'tableName':_0xda66('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda66('0xf'),'collate':_0xda66('0x10')});}; \ No newline at end of file +var _0x3166=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci'];(function(_0xe1f1e6,_0x320e9e){var _0x27891f=function(_0x1895ac){while(--_0x1895ac){_0xe1f1e6['push'](_0xe1f1e6['shift']());}};_0x27891f(++_0x320e9e);}(_0x3166,0x8f));var _0x6316=function(_0x3d8bbf,_0x5809a4){_0x3d8bbf=_0x3d8bbf-0x0;var _0x1dabdd=_0x3166[_0x3d8bbf];return _0x1dabdd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6316('0x0'))(_0x6316('0x1'));var moment=require(_0x6316('0x2'));var BPromise=require(_0x6316('0x3'));var rp=require(_0x6316('0x4'));var fs=require('fs');var path=require(_0x6316('0x5'));var rimraf=require('rimraf');var config=require(_0x6316('0x6'));var attributes=require(_0x6316('0x7'));module[_0x6316('0x8')]=function(_0x454ee6,_0x591aba){return _0x454ee6[_0x6316('0x9')](_0x6316('0xa'),attributes,{'tableName':_0x6316('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6316('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 6d27eb4..f8f8097 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 _0x2395=['redis','defaults','socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1977c2,_0x19446a){var _0x1f591c=function(_0x33d69d){while(--_0x33d69d){_0x1977c2['push'](_0x1977c2['shift']());}};_0x1f591c(++_0x19446a);}(_0x2395,0x13b));var _0x5239=function(_0x59dc96,_0x4c04dd){_0x59dc96=_0x59dc96-0x0;var _0x1e9892=_0x2395[_0x59dc96];return _0x1e9892;};'use strict';var _=require('lodash');var util=require(_0x5239('0x0'));var moment=require('moment');var BPromise=require(_0x5239('0x1'));var rs=require(_0x5239('0x2'));var fs=require('fs');var Redis=require(_0x5239('0x3'));var db=require(_0x5239('0x4'))['db'];var utils=require(_0x5239('0x5'));var logger=require(_0x5239('0x6'))(_0x5239('0x7'));var config=require('../../config/environment');var jayson=require(_0x5239('0x8'));var client=jayson[_0x5239('0x9')]['http']({'port':0x232a});config[_0x5239('0xa')]=_[_0x5239('0xb')](config[_0x5239('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5239('0xc'))(new Redis(config[_0x5239('0xa')]));require(_0x5239('0xd'))[_0x5239('0xe')](socket);function respondWithRpcPromise(_0x198c03,_0x36cc6f,_0x5ae438){return new BPromise(function(_0x4a7a90,_0x39accf){return client['request'](_0x198c03,_0x5ae438)[_0x5239('0xf')](function(_0x35c046){logger['info'](_0x5239('0x10'),_0x36cc6f,_0x5239('0x11'));logger[_0x5239('0x12')](_0x5239('0x13'),_0x36cc6f,_0x5239('0x11'),JSON['stringify'](_0x35c046));if(_0x35c046[_0x5239('0x14')]){if(_0x35c046[_0x5239('0x14')]['code']===0x1f4){logger[_0x5239('0x14')](_0x5239('0x10'),_0x36cc6f,_0x35c046[_0x5239('0x14')]['message']);return _0x39accf(_0x35c046['error'][_0x5239('0x15')]);}logger[_0x5239('0x14')](_0x5239('0x10'),_0x36cc6f,_0x35c046['error']['message']);return _0x4a7a90(_0x35c046['error']['message']);}else{logger[_0x5239('0x16')](_0x5239('0x10'),_0x36cc6f,'request\x20sent');_0x4a7a90(_0x35c046[_0x5239('0x17')]['message']);}})[_0x5239('0x18')](function(_0x4e8f54){logger[_0x5239('0x14')]('UserNotification,\x20%s,\x20%s',_0x36cc6f,_0x4e8f54);_0x39accf(_0x4e8f54);});});} \ No newline at end of file +var _0x60be=['rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x33f2eb,_0x4d0b8c){var _0x17c968=function(_0x473f29){while(--_0x473f29){_0x33f2eb['push'](_0x33f2eb['shift']());}};_0x17c968(++_0x4d0b8c);}(_0x60be,0xb8));var _0xe60b=function(_0x565fa4,_0x5a8cd8){_0x565fa4=_0x565fa4-0x0;var _0x4c5fdd=_0x60be[_0x565fa4];return _0x4c5fdd;};'use strict';var _=require(_0xe60b('0x0'));var util=require('util');var moment=require(_0xe60b('0x1'));var BPromise=require(_0xe60b('0x2'));var rs=require(_0xe60b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe60b('0x4'));var logger=require('../../config/logger')(_0xe60b('0x5'));var config=require(_0xe60b('0x6'));var jayson=require(_0xe60b('0x7'));var client=jayson[_0xe60b('0x8')][_0xe60b('0x9')]({'port':0x232a});config['redis']=_[_0xe60b('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe60b('0xb'))(new Redis(config[_0xe60b('0xc')]));require(_0xe60b('0xd'))[_0xe60b('0xe')](socket);function respondWithRpcPromise(_0x3c9656,_0x2d9771,_0x20e5f5){return new BPromise(function(_0x378022,_0x516754){return client[_0xe60b('0xf')](_0x3c9656,_0x20e5f5)['then'](function(_0x5a9265){logger[_0xe60b('0x10')](_0xe60b('0x11'),_0x2d9771,_0xe60b('0x12'));logger[_0xe60b('0x13')](_0xe60b('0x14'),_0x2d9771,_0xe60b('0x12'),JSON[_0xe60b('0x15')](_0x5a9265));if(_0x5a9265[_0xe60b('0x16')]){if(_0x5a9265[_0xe60b('0x16')][_0xe60b('0x17')]===0x1f4){logger[_0xe60b('0x16')](_0xe60b('0x11'),_0x2d9771,_0x5a9265['error'][_0xe60b('0x18')]);return _0x516754(_0x5a9265['error']['message']);}logger['error'](_0xe60b('0x11'),_0x2d9771,_0x5a9265[_0xe60b('0x16')][_0xe60b('0x18')]);return _0x378022(_0x5a9265[_0xe60b('0x16')]['message']);}else{logger[_0xe60b('0x10')](_0xe60b('0x11'),_0x2d9771,_0xe60b('0x12'));_0x378022(_0x5a9265[_0xe60b('0x19')][_0xe60b('0x18')]);}})[_0xe60b('0x1a')](function(_0x2f3a67){logger[_0xe60b('0x16')]('UserNotification,\x20%s,\x20%s',_0x2d9771,_0x2f3a67);_0x516754(_0x2f3a67);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 714a1d0..130123b 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 _0x9483=['./userNotification.events','emit','register'];(function(_0xcc7a99,_0x269fcf){var _0x4d79fe=function(_0x18461b){while(--_0x18461b){_0xcc7a99['push'](_0xcc7a99['shift']());}};_0x4d79fe(++_0x269fcf);}(_0x9483,0x102));var _0x3948=function(_0x5e362a,_0x4f6323){_0x5e362a=_0x5e362a-0x0;var _0x25014b=_0x9483[_0x5e362a];return _0x25014b;};'use strict';var UserNotificationEvents=require(_0x3948('0x0'));var events=['save','remove','update'];function createListener(_0x56cd50,_0x27c0c8){return function(_0x1bcaba){_0x27c0c8[_0x3948('0x1')](_0x56cd50,_0x1bcaba);};}function removeListener(_0x156818,_0xebcc39){return function(){UserNotificationEvents['removeListener'](_0x156818,_0xebcc39);};}exports[_0x3948('0x2')]=function(_0x20eeb1){for(var _0x7134fb=0x0,_0x267dc2=events['length'];_0x7134fb<_0x267dc2;_0x7134fb++){var _0x4c93c7=events[_0x7134fb];var _0x353054=createListener('userNotification:'+_0x4c93c7,_0x20eeb1);UserNotificationEvents['on'](_0x4c93c7,_0x353054);}}; \ No newline at end of file +var _0x32f8=['update','emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x1b8b81,_0xb30fc5){var _0x4a84ca=function(_0xb5b0d2){while(--_0xb5b0d2){_0x1b8b81['push'](_0x1b8b81['shift']());}};_0x4a84ca(++_0xb30fc5);}(_0x32f8,0x102));var _0x832f=function(_0x4264e2,_0x400979){_0x4264e2=_0x4264e2-0x0;var _0x843872=_0x32f8[_0x4264e2];return _0x843872;};'use strict';var UserNotificationEvents=require(_0x832f('0x0'));var events=[_0x832f('0x1'),_0x832f('0x2'),_0x832f('0x3')];function createListener(_0x1dc7d2,_0xc1081d){return function(_0x5a37c5){_0xc1081d[_0x832f('0x4')](_0x1dc7d2,_0x5a37c5);};}function removeListener(_0x2422c1,_0x303880){return function(){UserNotificationEvents[_0x832f('0x5')](_0x2422c1,_0x303880);};}exports[_0x832f('0x6')]=function(_0x53b770){for(var _0x2f0179=0x0,_0x48b544=events[_0x832f('0x7')];_0x2f0179<_0x48b544;_0x2f0179++){var _0x39e787=events[_0x2f0179];var _0x3b004b=createListener(_0x832f('0x8')+_0x39e787,_0x53b770);UserNotificationEvents['on'](_0x39e787,_0x3b004b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 9b91513..49ee657 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(_0xff6bbd,_0x34e0b6){var _0x2a2697=function(_0x2d5d9c){while(--_0x2d5d9c){_0xff6bbd['push'](_0xff6bbd['shift']());}};_0x2a2697(++_0x34e0b6);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x247a7e,_0x3db113){var _0x5a8c1b=function(_0x3489a1){while(--_0x3489a1){_0x247a7e['push'](_0x247a7e['shift']());}};_0x5a8c1b(++_0x3db113);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f7c8c,_0x5c26a6){_0x3f7c8c=_0x3f7c8c-0x0;var _0x48e4d2=_0xedd9[_0x3f7c8c];return _0x48e4d2;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 20c7052..5a7a6b6 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 _0x0a9f=['exports','sequelize'];(function(_0x4bf5cd,_0xddf2f2){var _0x2f9e5a=function(_0x32acef){while(--_0x32acef){_0x4bf5cd['push'](_0x4bf5cd['shift']());}};_0x2f9e5a(++_0xddf2f2);}(_0x0a9f,0x19d));var _0xf0a9=function(_0x167b19,_0x56081a){_0x167b19=_0x167b19-0x0;var _0x1fcca2=_0x0a9f[_0x167b19];return _0x1fcca2;};'use strict';var Sequelize=require(_0xf0a9('0x0'));module[_0xf0a9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0076=['INTEGER','sequelize','exports'];(function(_0x38c202,_0x299906){var _0xb66482=function(_0x55374d){while(--_0x55374d){_0x38c202['push'](_0x38c202['shift']());}};_0xb66482(++_0x299906);}(_0x0076,0x1b4));var _0x6007=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0076[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x6007('0x0'));module[_0x6007('0x1')]={'penalty':{'type':Sequelize[_0x6007('0x2')],'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 d6d9274..2a97082 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 _0xe9cd=['exports','UserOpenchannelQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x52b830,_0x2cc183){var _0x40eef6=function(_0x11a0ce){while(--_0x11a0ce){_0x52b830['push'](_0x52b830['shift']());}};_0x40eef6(++_0x2cc183);}(_0xe9cd,0x15e));var _0xde9c=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xe9cd[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xde9c('0x0'));var logger=require(_0xde9c('0x1'))(_0xde9c('0x2'));var moment=require(_0xde9c('0x3'));var BPromise=require(_0xde9c('0x4'));var rp=require(_0xde9c('0x5'));var fs=require('fs');var path=require(_0xde9c('0x6'));var rimraf=require(_0xde9c('0x7'));var config=require(_0xde9c('0x8'));var attributes=require(_0xde9c('0x9'));module[_0xde9c('0xa')]=function(_0x2a8df4,_0x211108){return _0x2a8df4['define'](_0xde9c('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x556b=['bluebird','path','rimraf','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger'];(function(_0x24e666,_0x1aee65){var _0x47fcf4=function(_0x214acb){while(--_0x214acb){_0x24e666['push'](_0x24e666['shift']());}};_0x47fcf4(++_0x1aee65);}(_0x556b,0x1c0));var _0xb556=function(_0x275efa,_0xbdbd8a){_0x275efa=_0x275efa-0x0;var _0x91bf65=_0x556b[_0x275efa];return _0x91bf65;};'use strict';var _=require(_0xb556('0x0'));var util=require('util');var logger=require(_0xb556('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb556('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb556('0x3'));var rimraf=require(_0xb556('0x4'));var config=require('../../config/environment');var attributes=require(_0xb556('0x5'));module['exports']=function(_0x5f26a6,_0x18313e){return _0x5f26a6[_0xb556('0x6')](_0xb556('0x7'),attributes,{'tableName':_0xb556('0x8'),'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 f7e70fa..0bcd8b4 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 _0x0c22=['jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x0c22,0x13c));var _0x20c2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0c22[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x20c2('0x0'));var moment=require(_0x20c2('0x1'));var BPromise=require(_0x20c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x20c2('0x4'))(_0x20c2('0x5'));var config=require(_0x20c2('0x6'));var jayson=require(_0x20c2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb73bfd,_0x18b995,_0xe499d0){return new BPromise(function(_0x530b15,_0x212369){return client[_0x20c2('0x8')](_0xb73bfd,_0xe499d0)[_0x20c2('0x9')](function(_0x2fdc21){logger[_0x20c2('0xa')](_0x20c2('0xb'),_0x18b995,'request\x20sent');logger['debug'](_0x20c2('0xc'),_0x18b995,_0x20c2('0xd'),JSON[_0x20c2('0xe')](_0x2fdc21));if(_0x2fdc21[_0x20c2('0xf')]){if(_0x2fdc21['error'][_0x20c2('0x10')]===0x1f4){logger['error'](_0x20c2('0xb'),_0x18b995,_0x2fdc21['error'][_0x20c2('0x11')]);return _0x212369(_0x2fdc21[_0x20c2('0xf')]['message']);}logger[_0x20c2('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x18b995,_0x2fdc21['error'][_0x20c2('0x11')]);return _0x530b15(_0x2fdc21[_0x20c2('0xf')]['message']);}else{logger['info'](_0x20c2('0xb'),_0x18b995,_0x20c2('0xd'));_0x530b15(_0x2fdc21['result'][_0x20c2('0x11')]);}})[_0x20c2('0x12')](function(_0x2e0cb7){logger[_0x20c2('0xf')](_0x20c2('0xb'),_0x18b995,_0x2e0cb7);_0x212369(_0x2e0cb7);});});} \ No newline at end of file +var _0x5e63=['jayson/promise','client','http','request','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x236d47,_0x520317){var _0x3a2bc3=function(_0x3dee15){while(--_0x3dee15){_0x236d47['push'](_0x236d47['shift']());}};_0x3a2bc3(++_0x520317);}(_0x5e63,0xb4));var _0x35e6=function(_0xf9664c,_0x23180f){_0xf9664c=_0xf9664c-0x0;var _0x400cfb=_0x5e63[_0xf9664c];return _0x400cfb;};'use strict';var _=require(_0x35e6('0x0'));var util=require(_0x35e6('0x1'));var moment=require(_0x35e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x35e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35e6('0x4'))['db'];var utils=require(_0x35e6('0x5'));var logger=require(_0x35e6('0x6'))(_0x35e6('0x7'));var config=require(_0x35e6('0x8'));var jayson=require(_0x35e6('0x9'));var client=jayson[_0x35e6('0xa')][_0x35e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x513285,_0x2eb859,_0x398fb2){return new BPromise(function(_0x4bc395,_0x523c2a){return client[_0x35e6('0xc')](_0x513285,_0x398fb2)['then'](function(_0xf0cd43){logger['info'](_0x35e6('0xd'),_0x2eb859,'request\x20sent');logger[_0x35e6('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2eb859,_0x35e6('0xf'),JSON['stringify'](_0xf0cd43));if(_0xf0cd43[_0x35e6('0x10')]){if(_0xf0cd43['error']['code']===0x1f4){logger[_0x35e6('0x10')](_0x35e6('0xd'),_0x2eb859,_0xf0cd43[_0x35e6('0x10')][_0x35e6('0x11')]);return _0x523c2a(_0xf0cd43[_0x35e6('0x10')][_0x35e6('0x11')]);}logger['error'](_0x35e6('0xd'),_0x2eb859,_0xf0cd43['error'][_0x35e6('0x11')]);return _0x4bc395(_0xf0cd43[_0x35e6('0x10')][_0x35e6('0x11')]);}else{logger[_0x35e6('0x12')](_0x35e6('0xd'),_0x2eb859,_0x35e6('0xf'));_0x4bc395(_0xf0cd43[_0x35e6('0x13')]['message']);}})[_0x35e6('0x14')](function(_0xea9e94){logger[_0x35e6('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2eb859,_0xea9e94);_0x523c2a(_0xea9e94);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c33b820..d20126e 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 _0x02c8=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/sections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports'];(function(_0x56b370,_0x5c1c44){var _0x10c934=function(_0x3d066d){while(--_0x3d066d){_0x56b370['push'](_0x56b370['shift']());}};_0x10c934(++_0x5c1c44);}(_0x02c8,0x180));var _0x802c=function(_0x2d1e92,_0x215d46){_0x2d1e92=_0x2d1e92-0x0;var _0x106351=_0x02c8[_0x2d1e92];return _0x106351;};'use strict';var multer=require(_0x802c('0x0'));var util=require(_0x802c('0x1'));var path=require(_0x802c('0x2'));var timeout=require(_0x802c('0x3'));var express=require('express');var router=express[_0x802c('0x4')]();var fs_extra=require(_0x802c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x802c('0x6'));var config=require(_0x802c('0x7'));var controller=require(_0x802c('0x8'));router[_0x802c('0x9')]('/',auth['isAuthenticated'](),controller[_0x802c('0xa')]);router[_0x802c('0x9')](_0x802c('0xb'),auth[_0x802c('0xc')](),controller[_0x802c('0xd')]);router[_0x802c('0x9')](_0x802c('0xe'),auth['isAuthenticated'](),controller[_0x802c('0xf')]);router[_0x802c('0x9')](_0x802c('0x10'),auth[_0x802c('0xc')](),controller['getSections']);router['get'](_0x802c('0x11'),auth[_0x802c('0xc')](),controller[_0x802c('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x802c('0x13')]);router[_0x802c('0x14')](_0x802c('0x15'),auth[_0x802c('0xc')](),controller[_0x802c('0x16')]);router[_0x802c('0x14')](_0x802c('0x10'),auth[_0x802c('0xc')](),controller[_0x802c('0x17')]);router[_0x802c('0x14')](_0x802c('0x11'),auth['isAuthenticated'](),controller[_0x802c('0x18')]);router[_0x802c('0x19')]('/:id',auth[_0x802c('0xc')](),controller[_0x802c('0x1a')]);router[_0x802c('0x1b')]('/:id',auth[_0x802c('0xc')](),controller[_0x802c('0x1c')]);router[_0x802c('0x1b')]('/:id/sections',auth[_0x802c('0xc')](),controller[_0x802c('0x1d')]);router[_0x802c('0x1b')]('/:id/resources',auth[_0x802c('0xc')](),controller[_0x802c('0x1e')]);module[_0x802c('0x1f')]=router; \ No newline at end of file +var _0x0307=['put','update','destroy','delete','removeSections','removeResources','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','/:id','getSections','/:id/resources','getResources','post','/:id/clone','clone','/:id/sections','addSections','addResources'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0307,0xb5));var _0x7030=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x0307[_0x38b14f];return _0x22a324;};'use strict';var multer=require(_0x7030('0x0'));var util=require(_0x7030('0x1'));var path=require('path');var timeout=require(_0x7030('0x2'));var express=require('express');var router=express[_0x7030('0x3')]();var fs_extra=require(_0x7030('0x4'));var auth=require(_0x7030('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7030('0x6'));var controller=require(_0x7030('0x7'));router[_0x7030('0x8')]('/',auth[_0x7030('0x9')](),controller[_0x7030('0xa')]);router['get']('/describe',auth[_0x7030('0x9')](),controller[_0x7030('0xb')]);router[_0x7030('0x8')](_0x7030('0xc'),auth[_0x7030('0x9')](),controller['show']);router[_0x7030('0x8')]('/:id/sections',auth[_0x7030('0x9')](),controller[_0x7030('0xd')]);router[_0x7030('0x8')](_0x7030('0xe'),auth['isAuthenticated'](),controller[_0x7030('0xf')]);router[_0x7030('0x10')]('/',auth[_0x7030('0x9')](),controller['create']);router['post'](_0x7030('0x11'),auth[_0x7030('0x9')](),controller[_0x7030('0x12')]);router[_0x7030('0x10')](_0x7030('0x13'),auth[_0x7030('0x9')](),controller[_0x7030('0x14')]);router[_0x7030('0x10')](_0x7030('0xe'),auth['isAuthenticated'](),controller[_0x7030('0x15')]);router[_0x7030('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7030('0x17')]);router['delete'](_0x7030('0xc'),auth[_0x7030('0x9')](),controller[_0x7030('0x18')]);router[_0x7030('0x19')](_0x7030('0x13'),auth[_0x7030('0x9')](),controller[_0x7030('0x1a')]);router[_0x7030('0x19')](_0x7030('0xe'),auth['isAuthenticated'](),controller[_0x7030('0x1b')]);module[_0x7030('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 41f6b5e..6d9ead1 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 _0x29b4=['crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','getDataValue'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x29b4,0x147));var _0x429b=function(_0x249ba3,_0xb66eda){_0x249ba3=_0x249ba3-0x0;var _0x4d48df=_0x29b4[_0x249ba3];return _0x4d48df;};'use strict';var Sequelize=require(_0x429b('0x0'));module[_0x429b('0x1')]={'name':{'type':Sequelize[_0x429b('0x2')],'allowNull':![],'unique':_0x429b('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xbc7f18){this[_0x429b('0x4')]('crudPermissions',_0xbc7f18?_0xbc7f18['join'](''):[]);},'get':function(){return this[_0x429b('0x5')]('crudPermissions')?this[_0x429b('0x5')](_0x429b('0x6'))[_0x429b('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x429b('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6eff=['getDataValue','crudPermissions','split','BOOLEAN','sequelize','STRING','name','setDataValue','join'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x6eff,0xaf));var _0xf6ef=function(_0x5a852b,_0x1694c2){_0x5a852b=_0x5a852b-0x0;var _0xd74d84=_0x6eff[_0x5a852b];return _0xd74d84;};'use strict';var Sequelize=require(_0xf6ef('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6ef('0x1')],'allowNull':![],'unique':_0xf6ef('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1179e4){this[_0xf6ef('0x3')]('crudPermissions',_0x1179e4?_0x1179e4[_0xf6ef('0x4')](''):[]);},'get':function(){return this[_0xf6ef('0x5')]('crudPermissions')?this[_0xf6ef('0x5')](_0xf6ef('0x6'))[_0xf6ef('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf6ef('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf6ef('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf6ef('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf6ef('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf6ef('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf6ef('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf6ef('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf6ef('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 6bc7396..77fc340 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 _0x6aea=['nolimit','offset','order','sort','where','pick','filter','VIRTUAL','UserProfile','includeAll','findAll','rows','catch','show','keys','length','merge','options','create','clone','params','include','find','get','omit','createdAt','updatedAt','body','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','transaction','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','sequelize','bulkCreate','removeResources','getResources','section','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aea,0xaa));var _0xa6ae=function(_0x49ba10,_0x103217){_0x49ba10=_0x49ba10-0x0;var _0x2a6f19=_0x6aea[_0x49ba10];return _0x2a6f19;};'use strict';var emlformat=require(_0xa6ae('0x0'));var rimraf=require(_0xa6ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6ae('0x2'));var rp=require(_0xa6ae('0x3'));var moment=require(_0xa6ae('0x4'));var BPromise=require(_0xa6ae('0x5'));var Mustache=require(_0xa6ae('0x6'));var util=require('util');var path=require(_0xa6ae('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6ae('0x8'));var fs=require('fs');var fs_extra=require(_0xa6ae('0x9'));var _=require(_0xa6ae('0xa'));var squel=require(_0xa6ae('0xb'));var crypto=require(_0xa6ae('0xc'));var jsforce=require(_0xa6ae('0xd'));var deskjs=require(_0xa6ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa6ae('0xf'));var Papa=require(_0xa6ae('0x10'));var Redis=require(_0xa6ae('0x11'));var authService=require(_0xa6ae('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa6ae('0x13'));var hardwareService=require(_0xa6ae('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa6ae('0x15'));var config=require(_0xa6ae('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6ae('0x17'))['db'];config[_0xa6ae('0x18')]=_[_0xa6ae('0x19')](config[_0xa6ae('0x18')],{'host':_0xa6ae('0x1a'),'port':0x18eb});var socket=require(_0xa6ae('0x1b'))(new Redis(config[_0xa6ae('0x18')]));require('./userProfile.socket')[_0xa6ae('0x1c')](socket);function respondWithStatusCode(_0x4049cf,_0xbf26b2){_0xbf26b2=_0xbf26b2||0xcc;return function(_0x2eb422){if(_0x2eb422){return _0x4049cf['sendStatus'](_0xbf26b2);}return _0x4049cf[_0xa6ae('0x1d')](_0xbf26b2)[_0xa6ae('0x1e')]();};}function respondWithResult(_0x501f85,_0x38aa01){_0x38aa01=_0x38aa01||0xc8;return function(_0x38339c){if(_0x38339c){return _0x501f85[_0xa6ae('0x1d')](_0x38aa01)[_0xa6ae('0x1f')](_0x38339c);}};}function respondWithFilteredResult(_0x458df5,_0x5907a2){return function(_0x231b6d){if(_0x231b6d){var _0x2348c=typeof _0x5907a2['offset']===_0xa6ae('0x20')&&typeof _0x5907a2[_0xa6ae('0x21')]===_0xa6ae('0x20');var _0x39c386=_0x231b6d[_0xa6ae('0x22')];var _0x58170d=_0x2348c?0x0:_0x5907a2['offset'];var _0x5354c7=_0x2348c?_0x231b6d[_0xa6ae('0x22')]:_0x5907a2['offset']+_0x5907a2[_0xa6ae('0x21')];var _0x3eb509;if(_0x5354c7>=_0x39c386){_0x5354c7=_0x39c386;_0x3eb509=0xc8;}else{_0x3eb509=0xce;}_0x458df5[_0xa6ae('0x1d')](_0x3eb509);return _0x458df5['set'](_0xa6ae('0x23'),_0x58170d+'-'+_0x5354c7+'/'+_0x39c386)[_0xa6ae('0x1f')](_0x231b6d);}return null;};}function patchUpdates(_0x1a5b56){return function(_0x181e37){try{jsonpatch[_0xa6ae('0x24')](_0x181e37,_0x1a5b56,!![]);}catch(_0xc85665){return BPromise[_0xa6ae('0x25')](_0xc85665);}return _0x181e37[_0xa6ae('0x26')]();};}function saveUpdates(_0x1faf2f,_0x153a20){return function(_0xc5a72f){if(_0xc5a72f){return _0xc5a72f[_0xa6ae('0x27')](_0x1faf2f)['then'](function(_0x5e5efd){return _0x5e5efd;});}return null;};}function removeEntity(_0x34d329,_0x4fe97a){return function(_0x108262){if(_0x108262){return _0x108262[_0xa6ae('0x28')]()[_0xa6ae('0x29')](function(){_0x34d329[_0xa6ae('0x1d')](0xcc)[_0xa6ae('0x1e')]();});}};}function handleEntityNotFound(_0x504f1d,_0x230eba){return function(_0x1d9190){if(!_0x1d9190){_0x504f1d[_0xa6ae('0x2a')](0x194);}return _0x1d9190;};}function handleError(_0x4c375e,_0x25077a){_0x25077a=_0x25077a||0x1f4;return function(_0x204908){logger['error'](_0x204908[_0xa6ae('0x2b')]);if(_0x204908[_0xa6ae('0x2c')]){delete _0x204908['name'];}_0x4c375e[_0xa6ae('0x1d')](_0x25077a)[_0xa6ae('0x2d')](_0x204908);};}exports['index']=function(_0x574643,_0x2b5e6f){var _0x1e13d0={},_0x5c9691={},_0x1b81eb={'count':0x0,'rows':[]};var _0x219104=_[_0xa6ae('0x2e')](db['UserProfile'][_0xa6ae('0x2f')],function(_0x3279b4){return{'name':_0x3279b4[_0xa6ae('0x30')],'type':_0x3279b4[_0xa6ae('0x31')][_0xa6ae('0x32')]};});_0x5c9691[_0xa6ae('0x33')]=_[_0xa6ae('0x2e')](_0x219104,_0xa6ae('0x2c'));_0x5c9691[_0xa6ae('0x34')]=_['keys'](_0x574643[_0xa6ae('0x34')]);_0x5c9691[_0xa6ae('0x35')]=_[_0xa6ae('0x36')](_0x5c9691[_0xa6ae('0x33')],_0x5c9691['query']);_0x1e13d0['attributes']=_['intersection'](_0x5c9691[_0xa6ae('0x33')],qs['fields'](_0x574643[_0xa6ae('0x34')][_0xa6ae('0x37')]));_0x1e13d0[_0xa6ae('0x38')]=_0x1e13d0[_0xa6ae('0x38')]['length']?_0x1e13d0['attributes']:_0x5c9691[_0xa6ae('0x33')];if(!_0x574643[_0xa6ae('0x34')][_0xa6ae('0x39')](_0xa6ae('0x3a'))){_0x1e13d0[_0xa6ae('0x21')]=qs['limit'](_0x574643[_0xa6ae('0x34')]['limit']);_0x1e13d0[_0xa6ae('0x3b')]=qs[_0xa6ae('0x3b')](_0x574643['query'][_0xa6ae('0x3b')]);}_0x1e13d0[_0xa6ae('0x3c')]=qs[_0xa6ae('0x3d')](_0x574643[_0xa6ae('0x34')][_0xa6ae('0x3d')]);_0x1e13d0[_0xa6ae('0x3e')]=qs['filters'](_[_0xa6ae('0x3f')](_0x574643['query'],_0x5c9691[_0xa6ae('0x35')]),_0x219104);if(_0x574643[_0xa6ae('0x34')][_0xa6ae('0x40')]){_0x1e13d0[_0xa6ae('0x3e')]=_['merge'](_0x1e13d0[_0xa6ae('0x3e')],{'$or':_[_0xa6ae('0x2e')](_0x219104,function(_0x2b58e4){if(_0x2b58e4['type']!==_0xa6ae('0x41')){var _0x595cfb={};_0x595cfb[_0x2b58e4[_0xa6ae('0x2c')]]={'$like':'%'+_0x574643[_0xa6ae('0x34')][_0xa6ae('0x40')]+'%'};return _0x595cfb;}})});}_0x1e13d0=_['merge']({},_0x1e13d0,_0x574643['options']);var _0x8591c6={'where':_0x1e13d0[_0xa6ae('0x3e')]};return db[_0xa6ae('0x42')][_0xa6ae('0x22')](_0x8591c6)[_0xa6ae('0x29')](function(_0x5c0b2b){_0x1b81eb[_0xa6ae('0x22')]=_0x5c0b2b;if(_0x574643['query'][_0xa6ae('0x43')]){_0x1e13d0['include']=[{'all':!![]}];}return db[_0xa6ae('0x42')][_0xa6ae('0x44')](_0x1e13d0);})[_0xa6ae('0x29')](function(_0x2b2dc4){_0x1b81eb[_0xa6ae('0x45')]=_0x2b2dc4;return _0x1b81eb;})[_0xa6ae('0x29')](respondWithFilteredResult(_0x2b5e6f,_0x1e13d0))[_0xa6ae('0x46')](handleError(_0x2b5e6f,null));};exports[_0xa6ae('0x47')]=function(_0x46ed1b,_0x3122e1){var _0x281a2b={'raw':![],'where':{'id':_0x46ed1b['params']['id']}},_0x483a31={};_0x483a31[_0xa6ae('0x33')]=_[_0xa6ae('0x48')](db['UserProfile'][_0xa6ae('0x2f')]);_0x483a31[_0xa6ae('0x34')]=_['keys'](_0x46ed1b['query']);_0x483a31[_0xa6ae('0x35')]=_[_0xa6ae('0x36')](_0x483a31[_0xa6ae('0x33')],_0x483a31[_0xa6ae('0x34')]);_0x281a2b['attributes']=_[_0xa6ae('0x36')](_0x483a31[_0xa6ae('0x33')],qs[_0xa6ae('0x37')](_0x46ed1b[_0xa6ae('0x34')][_0xa6ae('0x37')]));_0x281a2b['attributes']=_0x281a2b[_0xa6ae('0x38')][_0xa6ae('0x49')]?_0x281a2b[_0xa6ae('0x38')]:_0x483a31[_0xa6ae('0x33')];if(_0x46ed1b[_0xa6ae('0x34')][_0xa6ae('0x43')]){_0x281a2b['include']=[{'all':!![]}];}_0x281a2b=_[_0xa6ae('0x4a')]({},_0x281a2b,_0x46ed1b[_0xa6ae('0x4b')]);return db['UserProfile']['find'](_0x281a2b)[_0xa6ae('0x29')](handleEntityNotFound(_0x3122e1,null))['then'](respondWithResult(_0x3122e1,null))[_0xa6ae('0x46')](handleError(_0x3122e1,null));};exports[_0xa6ae('0x4c')]=function(_0x160c0f,_0xce17f8){return db[_0xa6ae('0x42')][_0xa6ae('0x4c')](_0x160c0f['body'],{})[_0xa6ae('0x29')](respondWithResult(_0xce17f8,0xc9))[_0xa6ae('0x46')](handleError(_0xce17f8,null));};exports[_0xa6ae('0x4d')]=function(_0x25949c,_0x5df4cf){var _0x48893d={'where':{'id':_0x25949c[_0xa6ae('0x4e')]['id']}},_0x4160e1={};_0x4160e1[_0xa6ae('0x33')]=_['keys'](db[_0xa6ae('0x42')][_0xa6ae('0x2f')]);_0x48893d[_0xa6ae('0x38')]=_[_0xa6ae('0x36')](_0x4160e1[_0xa6ae('0x33')],qs['fields'](_0x25949c[_0xa6ae('0x34')][_0xa6ae('0x37')]));_0x48893d[_0xa6ae('0x38')]=_0x48893d['attributes'][_0xa6ae('0x49')]?_0x48893d[_0xa6ae('0x38')]:_0x4160e1[_0xa6ae('0x33')];if(_0x25949c['query'][_0xa6ae('0x43')]){_0x48893d[_0xa6ae('0x4f')]=[{'all':!![]}];}_0x48893d=_[_0xa6ae('0x4a')]({},_0x48893d,_0x25949c[_0xa6ae('0x4b')]);return db[_0xa6ae('0x42')][_0xa6ae('0x50')](_0x48893d)[_0xa6ae('0x29')](handleEntityNotFound(_0x5df4cf,null))[_0xa6ae('0x29')](function(_0x5b47b3){if(_0x5b47b3){var _0x401e32=_0x5b47b3[_0xa6ae('0x51')]({'plain':!![]});_0x401e32=qs[_0xa6ae('0x52')](_0x401e32,['id',_0xa6ae('0x53'),_0xa6ae('0x54'),'crudPermissions']);_0x25949c[_0xa6ae('0x55')]=_[_0xa6ae('0x52')](_0x25949c[_0xa6ae('0x55')],['id','createdAt',_0xa6ae('0x54')]);return db['sequelize']['transaction'](function(_0x152e83){return db['UserProfile'][_0xa6ae('0x4c')](_[_0xa6ae('0x4a')](_0x401e32,_0x25949c[_0xa6ae('0x55')]),{'include':_0x25949c[_0xa6ae('0x34')][_0xa6ae('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x152e83})[_0xa6ae('0x29')](function(_0x25dde3){var _0x542959=_0x25dde3[_0xa6ae('0x51')]({'plain':!![]});return db[_0xa6ae('0x56')][_0xa6ae('0x44')]({'where':{'userProfileId':_0x25949c[_0xa6ae('0x4e')]['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0x13ffa1){if(_0x13ffa1){return BPromise[_0xa6ae('0x57')](_0x13ffa1,function(_0x183f08){return new BPromise(function(_0x3d4486,_0x148225){if(_0x183f08[_0xa6ae('0x58')]===null||_0x183f08['autoAssociation']===0x1)_0x3d4486(null);return db[_0xa6ae('0x59')][_0xa6ae('0x44')]({'where':{'sectionId':_0x183f08['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0xb24604){var _0x47f3cc=_['map'](_0xb24604,function(_0x393071){return qs[_0xa6ae('0x52')](_0x393071,['id','createdAt',_0xa6ae('0x54'),'sectionId']);});_0x3d4486(_0x47f3cc);})[_0xa6ae('0x46')](function(_0x3bf57d){_0x148225(_0x3bf57d);});})[_0xa6ae('0x29')](function(_0x40d595){var _0x13ec87=qs[_0xa6ae('0x52')](_0x183f08,['id',_0xa6ae('0x53'),_0xa6ae('0x54')]);_0x13ec87[_0xa6ae('0x5a')]=_0x542959['id'];if(_0x40d595)_0x13ec87[_0xa6ae('0x5b')]=_0x40d595;return _0x13ec87;})[_0xa6ae('0x29')](function(_0x2d9197){return db['UserProfileSection'][_0xa6ae('0x4c')](_0x2d9197,{'include':[{'model':db['UserProfileResource'],'as':_0xa6ae('0x5b')}],'raw':!![],'transaction':_0x152e83});});})[_0xa6ae('0x29')](function(){return _0x542959;});}});});});}})['then'](respondWithResult(_0x5df4cf,0xc9))['catch'](handleError(_0x5df4cf,null));};exports[_0xa6ae('0x27')]=function(_0x5a4d8a,_0x1b2bbd){if(_0x5a4d8a[_0xa6ae('0x55')]['id']){delete _0x5a4d8a[_0xa6ae('0x55')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x5a4d8a['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x1b2bbd,null))[_0xa6ae('0x29')](saveUpdates(_0x5a4d8a[_0xa6ae('0x55')],null))[_0xa6ae('0x29')](respondWithResult(_0x1b2bbd,null))['catch'](handleError(_0x1b2bbd,null));};exports[_0xa6ae('0x28')]=function(_0x21d801,_0x49a6c0){return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x21d801['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x49a6c0,null))[_0xa6ae('0x29')](removeEntity(_0x49a6c0,null))[_0xa6ae('0x46')](handleError(_0x49a6c0,null));};exports[_0xa6ae('0x5c')]=function(_0x11d404,_0x41d271){return db[_0xa6ae('0x42')][_0xa6ae('0x5c')]()['then'](respondWithResult(_0x41d271,null))[_0xa6ae('0x46')](handleError(_0x41d271,null));};exports['addSections']=function(_0x3a32da,_0xdec625){var _0x56d2ac=_0x3a32da[_0xa6ae('0x55')];return db['UserProfile'][_0xa6ae('0x50')]({'where':{'id':_0x3a32da[_0xa6ae('0x4e')]['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0xdec625,null))[_0xa6ae('0x29')](function(_0x530f60){if(_0x530f60){return db['sequelize'][_0xa6ae('0x5d')](function(_0x1e97bf){return db[_0xa6ae('0x56')][_0xa6ae('0x28')]({'where':{'userProfileId':_0x3a32da[_0xa6ae('0x4e')]['id'],'sectionId':_[_0xa6ae('0x2e')](_0x56d2ac,function(_0x2c1872){return _0x2c1872[_0xa6ae('0x5e')];})},'transaction':_0x1e97bf})['then'](function(){var _0x1cd239=_[_0xa6ae('0x2e')](_0x56d2ac,function(_0xc91889){_0xc91889['userProfileId']=_0x3a32da[_0xa6ae('0x4e')]['id'];return _0xc91889;});var _0x40dadb=[];return BPromise[_0xa6ae('0x57')](_0x1cd239,function(_0x2c7285){return db[_0xa6ae('0x56')][_0xa6ae('0x4c')](_0x2c7285,{'include':[{'model':db[_0xa6ae('0x59')],'as':_0xa6ae('0x5b')}],'raw':!![],'transaction':_0x1e97bf})[_0xa6ae('0x29')](function(_0x792cbc){_0x40dadb[_0xa6ae('0x5f')](_0x792cbc['get']({'plain':!![]}));});})[_0xa6ae('0x29')](function(){return _0x40dadb;});});});}})['then'](function(_0x27af2b){return _0x27af2b;})['then'](respondWithResult(_0xdec625,null))[_0xa6ae('0x46')](handleError(_0xdec625,null));};exports[_0xa6ae('0x60')]=function(_0x37db93,_0x1a0f51){var _0x414156;return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x37db93[_0xa6ae('0x4e')]['id']},'attributes':['id',_0xa6ae('0x2c')]})[_0xa6ae('0x29')](handleEntityNotFound(_0x1a0f51,null))[_0xa6ae('0x29')](function(_0x353c8e){if(_0x353c8e){_0x414156=_0x353c8e;return db[_0xa6ae('0x56')][_0xa6ae('0x28')]({'where':{'userProfileId':_0x37db93[_0xa6ae('0x4e')]['id'],'sectionId':_0x37db93[_0xa6ae('0x34')][_0xa6ae('0x61')]}});}})['then'](function(){return _0x414156;})[_0xa6ae('0x29')](respondWithStatusCode(_0x1a0f51,null))['catch'](handleError(_0x1a0f51,null));};exports[_0xa6ae('0x62')]=function(_0x2d507a,_0x43d0e4){var _0x4858f2=[];var _0x5418a8=[];return db[_0xa6ae('0x56')][_0xa6ae('0x44')]({'where':{'userProfileId':_0x2d507a[_0xa6ae('0x4e')]['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0xd0994e){_0x4858f2=_[_0xa6ae('0x40')](_0xd0994e,function(_0x18bb3f){return _0x18bb3f[_0xa6ae('0x63')]===0x1||_[_0xa6ae('0x64')]([0x3eb,0x709],_0x18bb3f['sectionId']);});if(!_[_0xa6ae('0x65')](_0x4858f2)){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0x187b4f){return _0x187b4f[_0xa6ae('0x5e')];});}else{return;}})[_0xa6ae('0x29')](function(_0x4111f6){if(_0x4111f6)_0x5418a8=_0x4111f6;if(_[_0xa6ae('0x64')](_0x5418a8,0x64)){var _0x1f17d7=_['find'](_0x4858f2,{'sectionId':0x64});return hasDefaultDashboard(_0x1f17d7)[_0xa6ae('0x29')](function(_0x49a0ea){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0x55819b){if(_0x55819b[_0xa6ae('0x5e')]===0x64){_0x55819b[_0xa6ae('0x66')]=_0x49a0ea;}return _0x55819b;});});}else{return;}})[_0xa6ae('0x29')](function(_0x5d9692){if(_0x5d9692)_0x4858f2=_0x5d9692;if(_[_0xa6ae('0x64')](_0x5418a8,0x3eb)){var _0x387a54=_[_0xa6ae('0x50')](_0x4858f2,{'sectionId':0x3eb});return getCustomDashboards(_0x387a54)['then'](function(_0x553aae){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0x4b8612){if(_0x387a54['enabled']){if(_0x4b8612[_0xa6ae('0x5e')]===0x3eb){_0x4b8612[_0xa6ae('0x66')]=_0x553aae;}}else{if(_0x4b8612[_0xa6ae('0x5e')]===0x64){if(!_0x4b8612[_0xa6ae('0x66')]){_0x4b8612[_0xa6ae('0x66')]=[];}_0x4b8612[_0xa6ae('0x66')]=_0x4b8612[_0xa6ae('0x66')][_0xa6ae('0x67')](_0x553aae);}}return _0x4b8612;});});}else{return;}})['then'](function(_0x4c27ec){if(_0x4c27ec)_0x4858f2=_0x4c27ec;if(_['includes'](_0x5418a8,0x709)){var _0x329f72=_[_0xa6ae('0x50')](_0x4858f2,{'sectionId':0x709});return getPlugins(_0x329f72)['then'](function(_0x4889be){if(_0x329f72['enabled']){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0xc249c8){if(_0xc249c8[_0xa6ae('0x5e')]===0x709){_0xc249c8['subsections']=_0x4889be;}return _0xc249c8;});}else{var _0x25320f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4889be};var _0x150a8d=_[_0xa6ae('0x2e')](_0x4858f2);_0x150a8d['push'](_0x25320f);return _0x150a8d;}});}else{return;}})[_0xa6ae('0x29')](function(_0x31c239){if(_0x31c239)_0x4858f2=_0x31c239;return _[_0xa6ae('0x40')](_0x4858f2,[_0xa6ae('0x63'),0x1]);})[_0xa6ae('0x29')](respondWithResult(_0x43d0e4,null))[_0xa6ae('0x46')](handleError(_0x43d0e4,null));};function hasDefaultDashboard(_0x973d68){var _0x136ba1=[0x65];return new BPromise(function(_0x4fd130,_0x521d39){try{if(_0x973d68[_0xa6ae('0x58')]){_0x4fd130(_0x136ba1);}else{return db['UserProfileResource'][_0xa6ae('0x68')]({'where':{'sectionId':_0x973d68['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0xda09b){_0xda09b?_0x4fd130(_0x136ba1):_0x4fd130();});}}catch(_0x57e1f8){_0x521d39(_0x57e1f8);}});}function getCustomDashboards(_0x3579f0){var _0x15786f=[];return new BPromise(function(_0x200a9b,_0x4bf1c9){try{if(_0x3579f0['autoAssociation']){return db[_0xa6ae('0x69')]['findAll']({'raw':!![]})['then'](function(_0x805359){_0x805359['forEach'](function(_0x33295b){_0x15786f['push'](_0x33295b['id']+0x1869f);});_0x200a9b(_0x15786f);});}else{return db[_0xa6ae('0x59')][_0xa6ae('0x44')]({'where':{'sectionId':_0x3579f0['id']},'raw':!![]})['then'](function(_0x554e1d){_0x554e1d[_0xa6ae('0x6a')](function(_0x1b02fa){_0x15786f[_0xa6ae('0x5f')](_0x1b02fa[_0xa6ae('0x6b')]+0x1869f);});_0x200a9b(_0x15786f);});}}catch(_0x493e5e){_0x4bf1c9(_0x493e5e);}});}function getPlugins(_0x206917){var _0x1c8262=[];return new BPromise(function(_0x478846,_0x2eddfd){try{if(_0x206917[_0xa6ae('0x58')]){return db[_0xa6ae('0x6c')]['findAll']({'raw':!![]})[_0xa6ae('0x29')](function(_0x1e573e){_0x1e573e[_0xa6ae('0x6a')](function(_0x20ca59){_0x1c8262[_0xa6ae('0x5f')](_0x20ca59['id']+0x15b38);});_0x478846(_0x1c8262);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x206917['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0x1416d2){_0x1416d2[_0xa6ae('0x6a')](function(_0x5a90f4){_0x1c8262[_0xa6ae('0x5f')](_0x5a90f4[_0xa6ae('0x6b')]+0x15b38);});_0x478846(_0x1c8262);});}}catch(_0x11d303){_0x2eddfd(_0x11d303);}});}exports['addResources']=function(_0x5cbbcc,_0x1ed29f){return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x5cbbcc['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x1ed29f,null))[_0xa6ae('0x29')](function(_0x18288d){if(_0x18288d){return db[_0xa6ae('0x6d')]['transaction'](function(_0x3f4d4d){return db[_0xa6ae('0x56')][_0xa6ae('0x44')]({'where':{'userProfileId':_0x5cbbcc[_0xa6ae('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0xa6ae('0x29')](function(_0x28577a){if(_0x28577a){return db[_0xa6ae('0x56')][_0xa6ae('0x28')]({'where':{'userProfileId':_0x5cbbcc['params']['id'],'id':_[_0xa6ae('0x2e')](_0x28577a,function(_0xad4a52){return _0xad4a52['id'];})},'transaction':_0x3f4d4d});}})[_0xa6ae('0x29')](function(_0x21bbb6){var _0x1d569e=_[_0xa6ae('0x2e')](_0x5cbbcc['body'],function(_0x365144){_0x365144[_0xa6ae('0x5a')]=_0x5cbbcc[_0xa6ae('0x4e')]['id'];return _0x365144;});return db['UserProfileSection'][_0xa6ae('0x6e')](_0x1d569e,{'raw':!![],'transaction':_0x3f4d4d});})[_0xa6ae('0x29')](function(_0xc03ab2){var _0x11e319=_[_0xa6ae('0x40')](_[_0xa6ae('0x2e')](_0xc03ab2,function(_0x225bf4){return _0x225bf4['get']({'plain':!![]});}),{'includeAll':![]});if(_0x11e319){return db['UserProfileSection'][_0xa6ae('0x44')]({'where':{'userProfileId':_0x5cbbcc[_0xa6ae('0x4e')]['id'],'sectionId':_[_0xa6ae('0x2e')](_0x11e319,function(_0x22e36f){return _0x22e36f[_0xa6ae('0x5e')];})},'attributes':['id',_0xa6ae('0x5e')],'raw':!![]})[_0xa6ae('0x29')](function(_0x276dca){var _0x15e577=_['map'](_0x5cbbcc[_0xa6ae('0x55')],function(_0xca2c70){_0xca2c70[_0xa6ae('0x5a')]=_0x5cbbcc['params']['id'];return _0xca2c70;});return db['UserProfileResource'][_0xa6ae('0x6e')](_0x15e577,{'raw':!![],'transaction':_0x3f4d4d});});}})['catch'](handleError(_0x1ed29f,null));});}})['then'](function(_0x3b045b){var _0x17cd60=_[_0xa6ae('0x2e')](_0x3b045b,function(_0x1858a9){return _0x1858a9[_0xa6ae('0x51')]({'plain':!![]});});})['then'](respondWithResult(_0x1ed29f,null))[_0xa6ae('0x46')](handleError(_0x1ed29f,null));};exports[_0xa6ae('0x6f')]=function(_0x4b628d,_0xd2bc75,_0x218c3e){return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x4b628d[_0xa6ae('0x4e')]['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0xd2bc75,null))['then'](function(_0x3339de){if(_0x3339de){return _0x3339de[_0xa6ae('0x6f')](_0x4b628d['query'][_0xa6ae('0x61')]);}})[_0xa6ae('0x29')](respondWithStatusCode(_0xd2bc75,null))[_0xa6ae('0x46')](handleError(_0xd2bc75,null));};exports[_0xa6ae('0x70')]=function(_0x4d2dea,_0x1f77a2){var _0x28317d={};if(!_0x4d2dea[_0xa6ae('0x34')][_0xa6ae('0x71')])throw new Error('Missing\x20section\x20parameter');if(!_0x4d2dea[_0xa6ae('0x34')]['hasOwnProperty'](_0xa6ae('0x3a'))){_0x28317d['limit']=qs[_0xa6ae('0x21')](_0x4d2dea[_0xa6ae('0x34')][_0xa6ae('0x21')]);_0x28317d['offset']=qs[_0xa6ae('0x3b')](_0x4d2dea['query'][_0xa6ae('0x3b')]);}return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x4d2dea[_0xa6ae('0x4e')]['id']}})[_0xa6ae('0x29')](function(_0x7f8369){if(!_0x7f8369)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x4d2dea['params']['id']);return db[_0xa6ae('0x42')][_0xa6ae('0x70')](_0x4d2dea);})[_0xa6ae('0x29')](respondWithFilteredResult(_0x1f77a2,_0x28317d))[_0xa6ae('0x46')](handleError(_0x1f77a2,null));}; \ No newline at end of file +var _0xe280=['save','update','then','destroy','error','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','clone','get','omit','updatedAt','body','createdAt','transaction','UserProfileSection','params','autoAssociation','UserProfileResource','sectionId','Resources','describe','addSections','sequelize','each','push','removeSections','ids','enabled','includes','isEmpty','subsections','forEach','resourceId','addResources','userProfileId','bulkCreate','removeResources','getResources','section','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','apply'];(function(_0x1c626e,_0x1374f2){var _0x6292c1=function(_0x45c2fe){while(--_0x45c2fe){_0x1c626e['push'](_0x1c626e['shift']());}};_0x6292c1(++_0x1374f2);}(_0xe280,0xb7));var _0x0e28=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe280[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x0e28('0x0'));var rimraf=require(_0x0e28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e28('0x2'));var rp=require(_0x0e28('0x3'));var moment=require('moment');var BPromise=require(_0x0e28('0x4'));var Mustache=require(_0x0e28('0x5'));var util=require('util');var path=require(_0x0e28('0x6'));var sox=require(_0x0e28('0x7'));var csv=require(_0x0e28('0x8'));var ejs=require(_0x0e28('0x9'));var fs=require('fs');var fs_extra=require(_0x0e28('0xa'));var _=require('lodash');var squel=require(_0x0e28('0xb'));var crypto=require(_0x0e28('0xc'));var jsforce=require(_0x0e28('0xd'));var deskjs=require(_0x0e28('0xe'));var toCsv=require(_0x0e28('0x8'));var querystring=require(_0x0e28('0xf'));var Papa=require(_0x0e28('0x10'));var Redis=require(_0x0e28('0x11'));var authService=require(_0x0e28('0x12'));var qs=require(_0x0e28('0x13'));var as=require(_0x0e28('0x14'));var hardwareService=require(_0x0e28('0x15'));var logger=require('../../config/logger')(_0x0e28('0x16'));var utils=require(_0x0e28('0x17'));var config=require(_0x0e28('0x18'));var licenseUtil=require(_0x0e28('0x19'));var db=require(_0x0e28('0x1a'))['db'];config[_0x0e28('0x1b')]=_[_0x0e28('0x1c')](config[_0x0e28('0x1b')],{'host':_0x0e28('0x1d'),'port':0x18eb});var socket=require(_0x0e28('0x1e'))(new Redis(config[_0x0e28('0x1b')]));require(_0x0e28('0x1f'))[_0x0e28('0x20')](socket);function respondWithStatusCode(_0x1fe0d4,_0xbd839a){_0xbd839a=_0xbd839a||0xcc;return function(_0x3cd0ba){if(_0x3cd0ba){return _0x1fe0d4[_0x0e28('0x21')](_0xbd839a);}return _0x1fe0d4['status'](_0xbd839a)[_0x0e28('0x22')]();};}function respondWithResult(_0x4c867e,_0x56e11d){_0x56e11d=_0x56e11d||0xc8;return function(_0x2e3803){if(_0x2e3803){return _0x4c867e[_0x0e28('0x23')](_0x56e11d)[_0x0e28('0x24')](_0x2e3803);}};}function respondWithFilteredResult(_0x103021,_0x39478c){return function(_0x33c9ff){if(_0x33c9ff){var _0x4256a4=typeof _0x39478c[_0x0e28('0x25')]==='undefined'&&typeof _0x39478c[_0x0e28('0x26')]===_0x0e28('0x27');var _0x12de13=_0x33c9ff[_0x0e28('0x28')];var _0x25544c=_0x4256a4?0x0:_0x39478c[_0x0e28('0x25')];var _0x2b12e9=_0x4256a4?_0x33c9ff[_0x0e28('0x28')]:_0x39478c[_0x0e28('0x25')]+_0x39478c[_0x0e28('0x26')];var _0x3a3360;if(_0x2b12e9>=_0x12de13){_0x2b12e9=_0x12de13;_0x3a3360=0xc8;}else{_0x3a3360=0xce;}_0x103021[_0x0e28('0x23')](_0x3a3360);return _0x103021[_0x0e28('0x29')]('Content-Range',_0x25544c+'-'+_0x2b12e9+'/'+_0x12de13)[_0x0e28('0x24')](_0x33c9ff);}return null;};}function patchUpdates(_0x57046f){return function(_0x46df3d){try{jsonpatch[_0x0e28('0x2a')](_0x46df3d,_0x57046f,!![]);}catch(_0x1e6d06){return BPromise['reject'](_0x1e6d06);}return _0x46df3d[_0x0e28('0x2b')]();};}function saveUpdates(_0x56b280,_0x31c655){return function(_0x4fee1a){if(_0x4fee1a){return _0x4fee1a[_0x0e28('0x2c')](_0x56b280)[_0x0e28('0x2d')](function(_0x3c25b4){return _0x3c25b4;});}return null;};}function removeEntity(_0x1c6471,_0x39bc0f){return function(_0x259f0e){if(_0x259f0e){return _0x259f0e[_0x0e28('0x2e')]()[_0x0e28('0x2d')](function(){_0x1c6471[_0x0e28('0x23')](0xcc)[_0x0e28('0x22')]();});}};}function handleEntityNotFound(_0x1b12a4,_0x466776){return function(_0xb284cd){if(!_0xb284cd){_0x1b12a4[_0x0e28('0x21')](0x194);}return _0xb284cd;};}function handleError(_0xf10998,_0x4a6929){_0x4a6929=_0x4a6929||0x1f4;return function(_0x3d0328){logger[_0x0e28('0x2f')](_0x3d0328['stack']);if(_0x3d0328[_0x0e28('0x30')]){delete _0x3d0328[_0x0e28('0x30')];}_0xf10998['status'](_0x4a6929)[_0x0e28('0x31')](_0x3d0328);};}exports[_0x0e28('0x32')]=function(_0x13f2be,_0x351a61){var _0x1713a4={},_0x2fda98={},_0x4ac0c4={'count':0x0,'rows':[]};var _0x271d6f=_[_0x0e28('0x33')](db[_0x0e28('0x34')][_0x0e28('0x35')],function(_0x1be3d5){return{'name':_0x1be3d5[_0x0e28('0x36')],'type':_0x1be3d5[_0x0e28('0x37')][_0x0e28('0x38')]};});_0x2fda98[_0x0e28('0x39')]=_[_0x0e28('0x33')](_0x271d6f,_0x0e28('0x30'));_0x2fda98[_0x0e28('0x3a')]=_[_0x0e28('0x3b')](_0x13f2be[_0x0e28('0x3a')]);_0x2fda98[_0x0e28('0x3c')]=_[_0x0e28('0x3d')](_0x2fda98[_0x0e28('0x39')],_0x2fda98['query']);_0x1713a4['attributes']=_[_0x0e28('0x3d')](_0x2fda98[_0x0e28('0x39')],qs[_0x0e28('0x3e')](_0x13f2be[_0x0e28('0x3a')][_0x0e28('0x3e')]));_0x1713a4[_0x0e28('0x3f')]=_0x1713a4[_0x0e28('0x3f')][_0x0e28('0x40')]?_0x1713a4['attributes']:_0x2fda98[_0x0e28('0x39')];if(!_0x13f2be['query']['hasOwnProperty'](_0x0e28('0x41'))){_0x1713a4[_0x0e28('0x26')]=qs['limit'](_0x13f2be[_0x0e28('0x3a')][_0x0e28('0x26')]);_0x1713a4[_0x0e28('0x25')]=qs[_0x0e28('0x25')](_0x13f2be[_0x0e28('0x3a')]['offset']);}_0x1713a4['order']=qs[_0x0e28('0x42')](_0x13f2be[_0x0e28('0x3a')][_0x0e28('0x42')]);_0x1713a4['where']=qs['filters'](_['pick'](_0x13f2be['query'],_0x2fda98[_0x0e28('0x3c')]),_0x271d6f);if(_0x13f2be[_0x0e28('0x3a')][_0x0e28('0x43')]){_0x1713a4[_0x0e28('0x44')]=_[_0x0e28('0x45')](_0x1713a4[_0x0e28('0x44')],{'$or':_['map'](_0x271d6f,function(_0x5dcbd7){if(_0x5dcbd7[_0x0e28('0x37')]!==_0x0e28('0x46')){var _0x3b299a={};_0x3b299a[_0x5dcbd7[_0x0e28('0x30')]]={'$like':'%'+_0x13f2be[_0x0e28('0x3a')][_0x0e28('0x43')]+'%'};return _0x3b299a;}})});}_0x1713a4=_[_0x0e28('0x45')]({},_0x1713a4,_0x13f2be[_0x0e28('0x47')]);var _0x1b8091={'where':_0x1713a4['where']};return db['UserProfile']['count'](_0x1b8091)[_0x0e28('0x2d')](function(_0x3dd348){_0x4ac0c4['count']=_0x3dd348;if(_0x13f2be['query'][_0x0e28('0x48')]){_0x1713a4[_0x0e28('0x49')]=[{'all':!![]}];}return db[_0x0e28('0x34')][_0x0e28('0x4a')](_0x1713a4);})['then'](function(_0x102031){_0x4ac0c4['rows']=_0x102031;return _0x4ac0c4;})[_0x0e28('0x2d')](respondWithFilteredResult(_0x351a61,_0x1713a4))[_0x0e28('0x4b')](handleError(_0x351a61,null));};exports[_0x0e28('0x4c')]=function(_0x5e2f20,_0x4c63d4){var _0x415e64={'raw':![],'where':{'id':_0x5e2f20['params']['id']}},_0x1df4e6={};_0x1df4e6['model']=_[_0x0e28('0x3b')](db[_0x0e28('0x34')][_0x0e28('0x35')]);_0x1df4e6[_0x0e28('0x3a')]=_[_0x0e28('0x3b')](_0x5e2f20['query']);_0x1df4e6['filters']=_[_0x0e28('0x3d')](_0x1df4e6[_0x0e28('0x39')],_0x1df4e6[_0x0e28('0x3a')]);_0x415e64[_0x0e28('0x3f')]=_[_0x0e28('0x3d')](_0x1df4e6[_0x0e28('0x39')],qs[_0x0e28('0x3e')](_0x5e2f20[_0x0e28('0x3a')][_0x0e28('0x3e')]));_0x415e64[_0x0e28('0x3f')]=_0x415e64[_0x0e28('0x3f')][_0x0e28('0x40')]?_0x415e64[_0x0e28('0x3f')]:_0x1df4e6[_0x0e28('0x39')];if(_0x5e2f20[_0x0e28('0x3a')][_0x0e28('0x48')]){_0x415e64['include']=[{'all':!![]}];}_0x415e64=_[_0x0e28('0x45')]({},_0x415e64,_0x5e2f20[_0x0e28('0x47')]);return db[_0x0e28('0x34')][_0x0e28('0x4d')](_0x415e64)['then'](handleEntityNotFound(_0x4c63d4,null))[_0x0e28('0x2d')](respondWithResult(_0x4c63d4,null))[_0x0e28('0x4b')](handleError(_0x4c63d4,null));};exports[_0x0e28('0x4e')]=function(_0x11984d,_0x38af57){return db['UserProfile'][_0x0e28('0x4e')](_0x11984d['body'],{})[_0x0e28('0x2d')](respondWithResult(_0x38af57,0xc9))['catch'](handleError(_0x38af57,null));};exports[_0x0e28('0x4f')]=function(_0x2b6481,_0x3fcdf0){var _0x2928a7={'where':{'id':_0x2b6481['params']['id']}},_0x500b38={};_0x500b38[_0x0e28('0x39')]=_['keys'](db['UserProfile'][_0x0e28('0x35')]);_0x2928a7[_0x0e28('0x3f')]=_['intersection'](_0x500b38[_0x0e28('0x39')],qs['fields'](_0x2b6481[_0x0e28('0x3a')][_0x0e28('0x3e')]));_0x2928a7[_0x0e28('0x3f')]=_0x2928a7[_0x0e28('0x3f')]['length']?_0x2928a7[_0x0e28('0x3f')]:_0x500b38[_0x0e28('0x39')];if(_0x2b6481[_0x0e28('0x3a')][_0x0e28('0x48')]){_0x2928a7[_0x0e28('0x49')]=[{'all':!![]}];}_0x2928a7=_[_0x0e28('0x45')]({},_0x2928a7,_0x2b6481[_0x0e28('0x47')]);return db[_0x0e28('0x34')][_0x0e28('0x4d')](_0x2928a7)['then'](handleEntityNotFound(_0x3fcdf0,null))[_0x0e28('0x2d')](function(_0x571dc7){if(_0x571dc7){var _0x2a3846=_0x571dc7[_0x0e28('0x50')]({'plain':!![]});_0x2a3846=qs[_0x0e28('0x51')](_0x2a3846,['id','createdAt',_0x0e28('0x52'),'crudPermissions']);_0x2b6481['body']=_[_0x0e28('0x51')](_0x2b6481[_0x0e28('0x53')],['id',_0x0e28('0x54'),_0x0e28('0x52')]);return db['sequelize'][_0x0e28('0x55')](function(_0x959dc2){return db[_0x0e28('0x34')]['create'](_[_0x0e28('0x45')](_0x2a3846,_0x2b6481['body']),{'include':_0x2b6481[_0x0e28('0x3a')][_0x0e28('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x959dc2})[_0x0e28('0x2d')](function(_0x2b86a7){var _0x5b68d1=_0x2b86a7[_0x0e28('0x50')]({'plain':!![]});return db[_0x0e28('0x56')][_0x0e28('0x4a')]({'where':{'userProfileId':_0x2b6481[_0x0e28('0x57')]['id']},'raw':!![]})[_0x0e28('0x2d')](function(_0x144ecb){if(_0x144ecb){return BPromise['each'](_0x144ecb,function(_0x3c424f){return new BPromise(function(_0x456741,_0x1a1966){if(_0x3c424f[_0x0e28('0x58')]===null||_0x3c424f[_0x0e28('0x58')]===0x1)_0x456741(null);return db[_0x0e28('0x59')]['findAll']({'where':{'sectionId':_0x3c424f['id']},'raw':!![]})[_0x0e28('0x2d')](function(_0x1ffc2c){var _0x4c9898=_[_0x0e28('0x33')](_0x1ffc2c,function(_0x5a0f75){return qs[_0x0e28('0x51')](_0x5a0f75,['id',_0x0e28('0x54'),_0x0e28('0x52'),_0x0e28('0x5a')]);});_0x456741(_0x4c9898);})[_0x0e28('0x4b')](function(_0x4ab828){_0x1a1966(_0x4ab828);});})[_0x0e28('0x2d')](function(_0x36cf49){var _0x32aa2d=qs[_0x0e28('0x51')](_0x3c424f,['id',_0x0e28('0x54'),'updatedAt']);_0x32aa2d['userProfileId']=_0x5b68d1['id'];if(_0x36cf49)_0x32aa2d[_0x0e28('0x5b')]=_0x36cf49;return _0x32aa2d;})[_0x0e28('0x2d')](function(_0x5f1ee1){return db[_0x0e28('0x56')][_0x0e28('0x4e')](_0x5f1ee1,{'include':[{'model':db[_0x0e28('0x59')],'as':_0x0e28('0x5b')}],'raw':!![],'transaction':_0x959dc2});});})['then'](function(){return _0x5b68d1;});}});});});}})[_0x0e28('0x2d')](respondWithResult(_0x3fcdf0,0xc9))[_0x0e28('0x4b')](handleError(_0x3fcdf0,null));};exports[_0x0e28('0x2c')]=function(_0x3a4f89,_0x29eb9c){if(_0x3a4f89['body']['id']){delete _0x3a4f89[_0x0e28('0x53')]['id'];}return db['UserProfile'][_0x0e28('0x4d')]({'where':{'id':_0x3a4f89[_0x0e28('0x57')]['id']}})[_0x0e28('0x2d')](handleEntityNotFound(_0x29eb9c,null))[_0x0e28('0x2d')](saveUpdates(_0x3a4f89['body'],null))[_0x0e28('0x2d')](respondWithResult(_0x29eb9c,null))[_0x0e28('0x4b')](handleError(_0x29eb9c,null));};exports[_0x0e28('0x2e')]=function(_0x90524b,_0x9b6ea2){return db[_0x0e28('0x34')][_0x0e28('0x4d')]({'where':{'id':_0x90524b[_0x0e28('0x57')]['id']}})['then'](handleEntityNotFound(_0x9b6ea2,null))[_0x0e28('0x2d')](removeEntity(_0x9b6ea2,null))[_0x0e28('0x4b')](handleError(_0x9b6ea2,null));};exports[_0x0e28('0x5c')]=function(_0x59ca8f,_0xe274e7){return db[_0x0e28('0x34')][_0x0e28('0x5c')]()['then'](respondWithResult(_0xe274e7,null))['catch'](handleError(_0xe274e7,null));};exports[_0x0e28('0x5d')]=function(_0xa8d9a2,_0x559bb6){var _0x495d47=_0xa8d9a2[_0x0e28('0x53')];return db[_0x0e28('0x34')][_0x0e28('0x4d')]({'where':{'id':_0xa8d9a2[_0x0e28('0x57')]['id']}})[_0x0e28('0x2d')](handleEntityNotFound(_0x559bb6,null))[_0x0e28('0x2d')](function(_0x2d8417){if(_0x2d8417){return db[_0x0e28('0x5e')][_0x0e28('0x55')](function(_0xb49228){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0xa8d9a2[_0x0e28('0x57')]['id'],'sectionId':_[_0x0e28('0x33')](_0x495d47,function(_0x2e0710){return _0x2e0710[_0x0e28('0x5a')];})},'transaction':_0xb49228})[_0x0e28('0x2d')](function(){var _0x45ae01=_[_0x0e28('0x33')](_0x495d47,function(_0x594ea5){_0x594ea5['userProfileId']=_0xa8d9a2['params']['id'];return _0x594ea5;});var _0x45cfc3=[];return BPromise[_0x0e28('0x5f')](_0x45ae01,function(_0x3ed6e8){return db[_0x0e28('0x56')][_0x0e28('0x4e')](_0x3ed6e8,{'include':[{'model':db[_0x0e28('0x59')],'as':_0x0e28('0x5b')}],'raw':!![],'transaction':_0xb49228})['then'](function(_0x46d1ba){_0x45cfc3[_0x0e28('0x60')](_0x46d1ba[_0x0e28('0x50')]({'plain':!![]}));});})[_0x0e28('0x2d')](function(){return _0x45cfc3;});});});}})['then'](function(_0x1ea09f){return _0x1ea09f;})[_0x0e28('0x2d')](respondWithResult(_0x559bb6,null))['catch'](handleError(_0x559bb6,null));};exports[_0x0e28('0x61')]=function(_0x315da9,_0x38aa7d){var _0xd239df;return db[_0x0e28('0x34')]['find']({'where':{'id':_0x315da9[_0x0e28('0x57')]['id']},'attributes':['id',_0x0e28('0x30')]})[_0x0e28('0x2d')](handleEntityNotFound(_0x38aa7d,null))[_0x0e28('0x2d')](function(_0x39f9fb){if(_0x39f9fb){_0xd239df=_0x39f9fb;return db[_0x0e28('0x56')][_0x0e28('0x2e')]({'where':{'userProfileId':_0x315da9[_0x0e28('0x57')]['id'],'sectionId':_0x315da9['query'][_0x0e28('0x62')]}});}})['then'](function(){return _0xd239df;})[_0x0e28('0x2d')](respondWithStatusCode(_0x38aa7d,null))[_0x0e28('0x4b')](handleError(_0x38aa7d,null));};exports['getSections']=function(_0x2ba255,_0x132407){var _0x15bd1d=[];var _0x27f6c8=[];return db[_0x0e28('0x56')][_0x0e28('0x4a')]({'where':{'userProfileId':_0x2ba255['params']['id']},'raw':!![]})[_0x0e28('0x2d')](function(_0x1734e4){_0x15bd1d=_[_0x0e28('0x43')](_0x1734e4,function(_0x580cf8){return _0x580cf8[_0x0e28('0x63')]===0x1||_[_0x0e28('0x64')]([0x3eb,0x709],_0x580cf8['sectionId']);});if(!_[_0x0e28('0x65')](_0x15bd1d)){return _[_0x0e28('0x33')](_0x15bd1d,function(_0x33cd5a){return _0x33cd5a['sectionId'];});}else{return;}})[_0x0e28('0x2d')](function(_0x162b0c){if(_0x162b0c)_0x27f6c8=_0x162b0c;if(_[_0x0e28('0x64')](_0x27f6c8,0x64)){var _0x5b9cdc=_[_0x0e28('0x4d')](_0x15bd1d,{'sectionId':0x64});return hasDefaultDashboard(_0x5b9cdc)[_0x0e28('0x2d')](function(_0xd0363a){return _[_0x0e28('0x33')](_0x15bd1d,function(_0x5f2553){if(_0x5f2553[_0x0e28('0x5a')]===0x64){_0x5f2553[_0x0e28('0x66')]=_0xd0363a;}return _0x5f2553;});});}else{return;}})[_0x0e28('0x2d')](function(_0x2cb910){if(_0x2cb910)_0x15bd1d=_0x2cb910;if(_[_0x0e28('0x64')](_0x27f6c8,0x3eb)){var _0x31ef2a=_[_0x0e28('0x4d')](_0x15bd1d,{'sectionId':0x3eb});return getCustomDashboards(_0x31ef2a)[_0x0e28('0x2d')](function(_0x39e8c7){return _[_0x0e28('0x33')](_0x15bd1d,function(_0x124344){if(_0x31ef2a[_0x0e28('0x63')]){if(_0x124344['sectionId']===0x3eb){_0x124344[_0x0e28('0x66')]=_0x39e8c7;}}else{if(_0x124344[_0x0e28('0x5a')]===0x64){if(!_0x124344[_0x0e28('0x66')]){_0x124344[_0x0e28('0x66')]=[];}_0x124344['subsections']=_0x124344['subsections']['concat'](_0x39e8c7);}}return _0x124344;});});}else{return;}})[_0x0e28('0x2d')](function(_0x1ac404){if(_0x1ac404)_0x15bd1d=_0x1ac404;if(_[_0x0e28('0x64')](_0x27f6c8,0x709)){var _0x14faee=_[_0x0e28('0x4d')](_0x15bd1d,{'sectionId':0x709});return getPlugins(_0x14faee)[_0x0e28('0x2d')](function(_0x262db7){if(_0x14faee[_0x0e28('0x63')]){return _[_0x0e28('0x33')](_0x15bd1d,function(_0x2ed304){if(_0x2ed304[_0x0e28('0x5a')]===0x709){_0x2ed304[_0x0e28('0x66')]=_0x262db7;}return _0x2ed304;});}else{var _0x4b39c6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x262db7};var _0x3d99a9=_[_0x0e28('0x33')](_0x15bd1d);_0x3d99a9[_0x0e28('0x60')](_0x4b39c6);return _0x3d99a9;}});}else{return;}})[_0x0e28('0x2d')](function(_0x2eb355){if(_0x2eb355)_0x15bd1d=_0x2eb355;return _[_0x0e28('0x43')](_0x15bd1d,['enabled',0x1]);})['then'](respondWithResult(_0x132407,null))[_0x0e28('0x4b')](handleError(_0x132407,null));};function hasDefaultDashboard(_0xc92aa4){var _0x2f37af=[0x65];return new BPromise(function(_0x4c936e,_0x21274f){try{if(_0xc92aa4[_0x0e28('0x58')]){_0x4c936e(_0x2f37af);}else{return db[_0x0e28('0x59')]['findOne']({'where':{'sectionId':_0xc92aa4['id']},'raw':!![]})['then'](function(_0xa36a26){_0xa36a26?_0x4c936e(_0x2f37af):_0x4c936e();});}}catch(_0x113ca3){_0x21274f(_0x113ca3);}});}function getCustomDashboards(_0x2a1f3e){var _0xe5fcca=[];return new BPromise(function(_0x19daa1,_0x4b9173){try{if(_0x2a1f3e[_0x0e28('0x58')]){return db['Dashboard'][_0x0e28('0x4a')]({'raw':!![]})[_0x0e28('0x2d')](function(_0x4260ee){_0x4260ee['forEach'](function(_0x1cde76){_0xe5fcca[_0x0e28('0x60')](_0x1cde76['id']+0x1869f);});_0x19daa1(_0xe5fcca);});}else{return db[_0x0e28('0x59')][_0x0e28('0x4a')]({'where':{'sectionId':_0x2a1f3e['id']},'raw':!![]})[_0x0e28('0x2d')](function(_0x21e5a9){_0x21e5a9[_0x0e28('0x67')](function(_0xd9d778){_0xe5fcca['push'](_0xd9d778[_0x0e28('0x68')]+0x1869f);});_0x19daa1(_0xe5fcca);});}}catch(_0x48d746){_0x4b9173(_0x48d746);}});}function getPlugins(_0x4c4463){var _0x591c54=[];return new BPromise(function(_0x52684d,_0x6f233d){try{if(_0x4c4463[_0x0e28('0x58')]){return db['Plugin']['findAll']({'raw':!![]})['then'](function(_0x332509){_0x332509[_0x0e28('0x67')](function(_0x207dff){_0x591c54['push'](_0x207dff['id']+0x15b38);});_0x52684d(_0x591c54);});}else{return db[_0x0e28('0x59')][_0x0e28('0x4a')]({'where':{'sectionId':_0x4c4463['id']},'raw':!![]})['then'](function(_0x2e7042){_0x2e7042[_0x0e28('0x67')](function(_0x490eba){_0x591c54['push'](_0x490eba[_0x0e28('0x68')]+0x15b38);});_0x52684d(_0x591c54);});}}catch(_0x9672ed){_0x6f233d(_0x9672ed);}});}exports[_0x0e28('0x69')]=function(_0x2de90f,_0x3b017d){return db['UserProfile'][_0x0e28('0x4d')]({'where':{'id':_0x2de90f['params']['id']}})[_0x0e28('0x2d')](handleEntityNotFound(_0x3b017d,null))[_0x0e28('0x2d')](function(_0x110e7c){if(_0x110e7c){return db['sequelize'][_0x0e28('0x55')](function(_0x57c04b){return db[_0x0e28('0x56')][_0x0e28('0x4a')]({'where':{'userProfileId':_0x2de90f[_0x0e28('0x57')]['id']},'attributes':['id'],'raw':!![]})[_0x0e28('0x2d')](function(_0x56b828){if(_0x56b828){return db[_0x0e28('0x56')][_0x0e28('0x2e')]({'where':{'userProfileId':_0x2de90f[_0x0e28('0x57')]['id'],'id':_[_0x0e28('0x33')](_0x56b828,function(_0x472ced){return _0x472ced['id'];})},'transaction':_0x57c04b});}})[_0x0e28('0x2d')](function(_0xe371b6){var _0x4ffaa7=_[_0x0e28('0x33')](_0x2de90f[_0x0e28('0x53')],function(_0x439e17){_0x439e17[_0x0e28('0x6a')]=_0x2de90f[_0x0e28('0x57')]['id'];return _0x439e17;});return db[_0x0e28('0x56')]['bulkCreate'](_0x4ffaa7,{'raw':!![],'transaction':_0x57c04b});})[_0x0e28('0x2d')](function(_0x34a1be){var _0x12f1fe=_['filter'](_[_0x0e28('0x33')](_0x34a1be,function(_0x196d4f){return _0x196d4f[_0x0e28('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x12f1fe){return db[_0x0e28('0x56')][_0x0e28('0x4a')]({'where':{'userProfileId':_0x2de90f[_0x0e28('0x57')]['id'],'sectionId':_['map'](_0x12f1fe,function(_0x19f91c){return _0x19f91c['sectionId'];})},'attributes':['id',_0x0e28('0x5a')],'raw':!![]})[_0x0e28('0x2d')](function(_0xd94dd4){var _0x292d9f=_[_0x0e28('0x33')](_0x2de90f[_0x0e28('0x53')],function(_0x1ee51a){_0x1ee51a[_0x0e28('0x6a')]=_0x2de90f[_0x0e28('0x57')]['id'];return _0x1ee51a;});return db[_0x0e28('0x59')][_0x0e28('0x6b')](_0x292d9f,{'raw':!![],'transaction':_0x57c04b});});}})[_0x0e28('0x4b')](handleError(_0x3b017d,null));});}})[_0x0e28('0x2d')](function(_0x19deeb){var _0x25f3c6=_['map'](_0x19deeb,function(_0x2dbe57){return _0x2dbe57[_0x0e28('0x50')]({'plain':!![]});});})[_0x0e28('0x2d')](respondWithResult(_0x3b017d,null))['catch'](handleError(_0x3b017d,null));};exports[_0x0e28('0x6c')]=function(_0x14b2a3,_0x2534f1,_0x8d23e4){return db[_0x0e28('0x34')]['find']({'where':{'id':_0x14b2a3['params']['id']}})[_0x0e28('0x2d')](handleEntityNotFound(_0x2534f1,null))[_0x0e28('0x2d')](function(_0x596943){if(_0x596943){return _0x596943[_0x0e28('0x6c')](_0x14b2a3[_0x0e28('0x3a')]['ids']);}})[_0x0e28('0x2d')](respondWithStatusCode(_0x2534f1,null))[_0x0e28('0x4b')](handleError(_0x2534f1,null));};exports[_0x0e28('0x6d')]=function(_0x5bfff7,_0x5ba972){var _0x3e5a07={};if(!_0x5bfff7[_0x0e28('0x3a')][_0x0e28('0x6e')])throw new Error('Missing\x20section\x20parameter');if(!_0x5bfff7['query'][_0x0e28('0x6f')]('nolimit')){_0x3e5a07[_0x0e28('0x26')]=qs[_0x0e28('0x26')](_0x5bfff7['query'][_0x0e28('0x26')]);_0x3e5a07[_0x0e28('0x25')]=qs[_0x0e28('0x25')](_0x5bfff7['query'][_0x0e28('0x25')]);}return db[_0x0e28('0x34')]['find']({'where':{'id':_0x5bfff7[_0x0e28('0x57')]['id']}})[_0x0e28('0x2d')](function(_0x68e58b){if(!_0x68e58b)throw new Error(_0x0e28('0x70')+_0x5bfff7[_0x0e28('0x57')]['id']);return db[_0x0e28('0x34')][_0x0e28('0x6d')](_0x5bfff7);})['then'](respondWithFilteredResult(_0x5ba972,_0x3e5a07))[_0x0e28('0x4b')](handleError(_0x5ba972,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 0334d17..667293e 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 _0xf981=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xf981,0xe6));var _0x1f98=function(_0x1f0cdc,_0x21df8d){_0x1f0cdc=_0x1f0cdc-0x0;var _0x1de2fd=_0xf981[_0x1f0cdc];return _0x1de2fd;};'use strict';var EventEmitter=require(_0x1f98('0x0'));var UserProfile=require(_0x1f98('0x1'))['db'][_0x1f98('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1f98('0x3')](0x0);var events={'afterCreate':_0x1f98('0x4'),'afterUpdate':_0x1f98('0x5'),'afterDestroy':_0x1f98('0x6')};function emitEvent(_0xd68165){return function(_0x562a81,_0x14da55,_0x15c6fa){UserProfileEvents[_0x1f98('0x7')](_0xd68165+':'+_0x562a81['id'],_0x562a81);UserProfileEvents[_0x1f98('0x7')](_0xd68165,_0x562a81);_0x15c6fa(null);};}for(var e in events){if(events[_0x1f98('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x1b65=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x699cc2,_0x300546){var _0x21f20f=function(_0x4f593d){while(--_0x4f593d){_0x699cc2['push'](_0x699cc2['shift']());}};_0x21f20f(++_0x300546);}(_0x1b65,0x1b4));var _0x51b6=function(_0x537881,_0x3555b0){_0x537881=_0x537881-0x0;var _0x19ef90=_0x1b65[_0x537881];return _0x19ef90;};'use strict';var EventEmitter=require(_0x51b6('0x0'));var UserProfile=require(_0x51b6('0x1'))['db'][_0x51b6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x51b6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x51b6('0x4'),'afterDestroy':_0x51b6('0x5')};function emitEvent(_0x3c6f36){return function(_0x2d5762,_0x1a1c26,_0x1ba2e9){UserProfileEvents[_0x51b6('0x6')](_0x3c6f36+':'+_0x2d5762['id'],_0x2d5762);UserProfileEvents['emit'](_0x3c6f36,_0x2d5762);_0x1ba2e9(null);};}for(var e in events){if(events[_0x51b6('0x7')](e)){var event=events[e];UserProfile[_0x51b6('0x8')](e,emitEvent(event));}}module[_0x51b6('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 6b333b3..d76c70b 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 _0x2f58=['Team','voicequeues','queuecampaigns','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','scheduler','Schedule','Sound','tags','Tag','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','Reports','metrics','AnalyticMetric','charAt','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','section','mergeResources','isEmpty','length','UserProfileSection','find','ignore','union','push','autoAssociation','all','rawAttributes','keys','intersection','attributes','fields','limit','offset','sort','where','filters','key','VIRTUAL','foreignKey','merge','options','includeAll','reportType','default','reportId','DefaultReports','custom','count','rows','ids','customSorting','order','extraQueryConditions','include','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','map','catch','model','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatWebsite','faxqueues','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','type','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelAccount','SmsAccount','WhatsappQueue','WhatsappAccount','teams'];(function(_0x56c1e5,_0x1d766d){var _0x3e3233=function(_0x4710fe){while(--_0x4710fe){_0x56c1e5['push'](_0x56c1e5['shift']());}};_0x3e3233(++_0x1d766d);}(_0x2f58,0x6c));var _0x82f5=function(_0x469d75,_0x4040d9){_0x469d75=_0x469d75-0x0;var _0x2c8a3c=_0x2f58[_0x469d75];return _0x2c8a3c;};'use strict';var _=require(_0x82f5('0x0'));var attributes=require(_0x82f5('0x1'));var qs=require(_0x82f5('0x2'));var squel=require(_0x82f5('0x3'));module['exports']=function(_0xdfd2d1){var _0x248336=_0xdfd2d1[_0x82f5('0x4')];function _0x5a3936(_0x425b02,_0x5cc991){return new Promise(function(_0x3ddfd1,_0x5d7611){if(!_0x5cc991)return _0x3ddfd1(null);var _0x325bc2=_0x5cc991[_0x82f5('0x5')]?{[_0x5cc991[_0x82f5('0x5')][_0x82f5('0x6')]]:_0x5cc991[_0x82f5('0x5')][_0x82f5('0x7')]}:undefined;return _0x248336[_0x425b02][_0x82f5('0x8')]({'where':_0x325bc2,'raw':!![]})[_0x82f5('0x9')](function(_0x2f81d0){_0x5cc991[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x2f81d0,'id');_0x3ddfd1(_0x5cc991);})[_0x82f5('0xc')](function(_0x332fb2){_0x5d7611(_0x332fb2);});});}function _0x2cbefb(_0x1f60d9,_0x4d1794){return new Promise(function(_0x4919f0,_0x22514e){var _0x921ba5=_0x1f60d9['filter']?{[_0x1f60d9['filter'][_0x82f5('0x6')]]:_0x1f60d9[_0x82f5('0x5')]['value']}:undefined;return _0x248336[_0x1f60d9[_0x82f5('0xd')]][_0x82f5('0x8')]({'where':_0x921ba5,'raw':!![]})[_0x82f5('0x9')](function(_0x2b2b5e){_0x4d1794[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x2b2b5e,function(_0x5ce23f){return _0x5ce23f['name'];});_0x4919f0(_0x4d1794);})[_0x82f5('0xc')](function(_0xb07fe5){_0x22514e(_0xb07fe5);});});}function _0x182c3b(_0x42f3da,_0x25603f,_0x11e6c2){if(!_0x25603f)return Promise[_0x82f5('0xe')](null);return new Promise(function(_0x886c0a,_0x34edba){return _0x248336[_0x82f5('0xf')][_0x82f5('0x8')]({'where':{'sectionId':_0x25603f['id']},'raw':!![]})[_0x82f5('0x9')](function(_0x206c10){if(_0x42f3da[_0x82f5('0x6')]&&_0x42f3da[_0x82f5('0x6')]!=='id'){_0x25603f['associatedResources']=_[_0x82f5('0xb')](_0x206c10,function(_0x267bb2){return _0x267bb2[_0x42f3da['field']];});}else{if(_0x11e6c2===_0x82f5('0x10')){_0x25603f[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x206c10,function(_0x308300){return{'id':_0x308300[_0x82f5('0x11')],'type':_0x308300['type']};});}else{_0x25603f[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x206c10,function(_0x73c9d8){return _0x73c9d8[_0x82f5('0x11')];});}}_0x886c0a(_0x25603f);})[_0x82f5('0xc')](function(_0x1945fa){_0x34edba(_0x1945fa);});});}function _0x3bcc91(_0x41ca7b,_0x3f00a){var _0x904649={'parentSections':[]};switch(_0x41ca7b[_0x82f5('0x12')]()){case _0x82f5('0x13'):_0x904649[_0x82f5('0x14')]='SquareProject';break;case'odbc':_0x904649['childModel']=_0x82f5('0x15');break;case _0x82f5('0x16'):_0x904649['childModel']=_0x82f5('0x17');_0x904649['parentSections']=[{'name':_0x82f5('0x18'),'field':'name','foreignKey':_0x82f5('0x19')}];break;case'projects':_0x904649['childModel']=_0x82f5('0x1a');break;case _0x82f5('0x1b'):_0x904649['childModel']=_0x82f5('0x1c');_0x904649[_0x82f5('0x1d')]=[{'name':_0x82f5('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x82f5('0x1f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x20');break;case _0x82f5('0x21'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x22');break;case _0x82f5('0x23'):_0x904649[_0x82f5('0x14')]='CmCustomField';break;case _0x82f5('0x24'):_0x904649[_0x82f5('0x14')]='ChatQueue';break;case'chatwebsites':_0x904649[_0x82f5('0x14')]=_0x82f5('0x25');break;case _0x82f5('0x26'):_0x904649[_0x82f5('0x14')]='FaxQueue';break;case _0x82f5('0x27'):_0x904649[_0x82f5('0x14')]='FaxAccount';break;case _0x82f5('0x28'):case _0x82f5('0x29'):case _0x82f5('0x2a'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x2b');break;case _0x82f5('0x2c'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x2d');break;case _0x82f5('0x2e'):_0x904649['childModel']=_0x82f5('0x2f');break;case'voicerecordings':_0x904649['childModel']=_0x82f5('0x30');_0x904649[_0x82f5('0x1d')]=[{'name':_0x82f5('0x31'),'field':_0x82f5('0x32'),'foreignKey':_0x82f5('0x33'),'model':_0x82f5('0x34'),'filter':{'field':_0x82f5('0x35'),'value':[_0x82f5('0x36')]}},{'name':_0x82f5('0x37'),'field':_0x82f5('0x32'),'foreignKey':'membername','model':_0x82f5('0x34'),'filter':{'field':_0x82f5('0x35'),'value':[_0x82f5('0x38')]}},{'name':_0x82f5('0x39'),'field':_0x82f5('0x32'),'foreignKey':'queue','model':_0x82f5('0x3a'),'filter':{'field':'type','value':[_0x82f5('0x3b')]}},{'name':_0x82f5('0x3c'),'field':_0x82f5('0x32'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x82f5('0x3d'),'value':[_0x82f5('0x3e')]}}];break;case _0x82f5('0x3f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x40');break;case _0x82f5('0x41'):_0x904649['childModel']=_0x82f5('0x42');break;case _0x82f5('0x43'):_0x904649['childModel']=_0x82f5('0x44');break;case _0x82f5('0x45'):_0x904649['childModel']=_0x82f5('0x46');break;case _0x82f5('0x47'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x48');break;case _0x82f5('0x49'):_0x904649['childModel']=_0x82f5('0x4a');break;case'mailsubstatuses':_0x904649[_0x82f5('0x14')]=_0x82f5('0x4b');break;case _0x82f5('0x4c'):_0x904649[_0x82f5('0x14')]='OpenchannelQueue';break;case'openchannelaccounts':_0x904649['childModel']=_0x82f5('0x4d');break;case'smsqueues':_0x904649['childModel']='SmsQueue';break;case'smsaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x4e');break;case'whatsappqueues':_0x904649['childModel']=_0x82f5('0x4f');break;case'whatsappaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x50');break;case _0x82f5('0x51'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x52');break;case _0x82f5('0x53'):case _0x82f5('0x54'):_0x904649['childModel']=_0x82f5('0x3a');if(_0x3f00a){_0x904649[_0x82f5('0x1d')]=[{'name':'VoiceQueues'},{'name':_0x82f5('0x3c')}];}break;case'users':case _0x82f5('0x55'):case _0x82f5('0x56'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x34');if(_0x3f00a){_0x904649['parentSections']=[{'name':_0x82f5('0x57'),'filter':{'field':'role','value':[_0x82f5('0x58'),_0x82f5('0x59')]},'ignore':!![]},{'name':'Agents'},{'name':_0x82f5('0x37')}];}break;case _0x82f5('0x5a'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x5b');break;case'salesforceaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x5c');break;case _0x82f5('0x5d'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x5e');break;case _0x82f5('0x5f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x60');break;case'deskaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x61');break;case _0x82f5('0x62'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x63');break;case _0x82f5('0x64'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x34');break;case'cannedanswers':_0x904649[_0x82f5('0x14')]=_0x82f5('0x65');break;case _0x82f5('0x66'):_0x904649['childModel']=_0x82f5('0x67');break;case _0x82f5('0x68'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x69');break;case _0x82f5('0x6a'):_0x904649[_0x82f5('0x14')]='Interval';break;case _0x82f5('0x6b'):_0x904649[_0x82f5('0x14')]='Pause';break;case _0x82f5('0x6c'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x6d');break;case'sounds':_0x904649[_0x82f5('0x14')]=_0x82f5('0x6e');break;case _0x82f5('0x6f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x70');break;case'templates':_0x904649['childModel']='Template';break;case _0x82f5('0x71'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x72');break;case _0x82f5('0x73'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x74');break;case _0x82f5('0x75'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x76');break;case'plugins':_0x904649[_0x82f5('0x14')]=_0x82f5('0x77');break;case'extractedreports':_0x904649[_0x82f5('0x14')]=_0x82f5('0x10');_0x904649[_0x82f5('0x1d')]=[{'name':_0x82f5('0x78'),'field':'id','foreignKey':'reportId'}];break;case _0x82f5('0x79'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x7a');break;}return _0x904649;}function _0x4d97f4(_0x1d7f35,_0x3db06a){var _0x49fb28=_0x1d7f35[_0x82f5('0x7b')](0x0)['toUpperCase']()+_0x1d7f35[_0x82f5('0x7c')](0x1);var _0x4a17a6={'type':_0x248336[_0x82f5('0x7d')]['QueryTypes'][_0x82f5('0x7e')],'raw':!![]};return new Promise(function(_0x52ae1f,_0x2e8e82){var _0x15175e=squel[_0x82f5('0x7f')]()[_0x82f5('0x6')](_0x82f5('0x80')+_0x49fb28+_0x82f5('0x81'),'id')['field'](_0x82f5('0x82'))[_0x82f5('0x83')](_0x82f5('0x84')+_0x1d7f35+'_interactions','ui')['where'](_0x82f5('0x85'),_0x3db06a['id']);return _0x248336[_0x82f5('0x86')][_0x82f5('0x87')](_0x15175e[_0x82f5('0x88')](),_0x4a17a6)['then'](function(_0x3a5be9){_0x3db06a[_0x49fb28+_0x82f5('0x89')]=_0x3a5be9;_0x52ae1f(_0x3a5be9);})['catch'](function(_0x537b68){_0x2e8e82(_0x537b68);});});}return _0xdfd2d1[_0x82f5('0x8a')]('UserProfile',attributes,{'tableName':_0x82f5('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2c52ea){var _0x2e2423={'raw':_0x2c52ea[_0x82f5('0x87')]['raw'],'where':{}};var _0x24c9df={};var _0x238eb6={'count':0x0,'rows':[]};var _0x470d44=_0x2c52ea['query'][_0x82f5('0x8c')];var _0xad3269=_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x8d')]||![];var _0x578083=_0x3bcc91(_0x470d44,_0xad3269);if(!_0x578083[_0x82f5('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x470d44+'\x27');var _0xe42a0e=[{'name':_0x470d44}];if(!_[_0x82f5('0x8e')](_0x578083[_0x82f5('0x1d')]))_0xe42a0e=_0x578083[_0x82f5('0x1d')];var _0x10295c=[];for(var _0x45e080=0x0;_0x45e080<_0xe42a0e[_0x82f5('0x8f')];_0x45e080++){_0x10295c['push'](_0x248336[_0x82f5('0x90')][_0x82f5('0x91')]({'where':{'userProfileId':_0x2c52ea['params']['id'],'name':_0xe42a0e[_0x45e080][_0x82f5('0x32')]},'raw':!![]}));}return Promise['all'](_0x10295c)[_0x82f5('0x9')](function(_0x52229c){var _0x26480a=_[_0x82f5('0x5')](_0x52229c,function(_0x22a843){return _0x22a843?_0x22a843:undefined;});var _0x26ee95=_[_0x82f5('0x5')](_0xe42a0e,[_0x82f5('0x92'),!![]]);var _0x51ce0e=_[_0x82f5('0x8e')](_0x26480a)&&_[_0x82f5('0x8e')](_0x26ee95)?null:_[_0x82f5('0x93')](_0x26ee95,_0x26480a);if(!_0x51ce0e)return null;var _0x2e6cf4=[];for(var _0x47cec9=0x0;_0x47cec9<_0x51ce0e['length'];_0x47cec9++){var _0x547477=_[_0x82f5('0x91')](_0xe42a0e,function(_0x3ab43f){return _0x51ce0e[_0x47cec9]?_0x3ab43f[_0x82f5('0x32')]===_0x51ce0e[_0x47cec9][_0x82f5('0x32')]:null;});if(_0x547477){if(_0x51ce0e[_0x47cec9][_0x82f5('0x92')]){_0x2e6cf4[_0x82f5('0x94')](_0x5a3936(_0x578083[_0x82f5('0x14')],_0x51ce0e[_0x47cec9]));}else{if(!_0x51ce0e[_0x47cec9][_0x82f5('0x95')]){_0x2e6cf4[_0x82f5('0x94')](_0x182c3b(_0x547477,_0x51ce0e[_0x47cec9],_0x578083[_0x82f5('0x14')]));}else{if(_0x547477[_0x82f5('0xd')]){_0x2e6cf4['push'](_0x2cbefb(_0x547477,_0x51ce0e[_0x47cec9]));}}}}}return Promise[_0x82f5('0x96')](_0x2e6cf4);})[_0x82f5('0x9')](function(_0x41ca9a){var _0x2e3f64=_0x41ca9a;var _0x3ac301=null;if(_0x2e3f64){_0x3ac301=_0x2e3f64[_0x82f5('0x8f')]===0x1?_0x2e3f64[0x0]:null;}if(!_0x3ac301&&!_0x2e3f64)return _0x238eb6;var _0x5a0cf5=_0x248336[_0x578083['childModel']][_0x82f5('0x97')];_0x24c9df[_0x82f5('0xd')]=_[_0x82f5('0x98')](_0x5a0cf5);_0x24c9df[_0x82f5('0x87')]=_[_0x82f5('0x98')](_0x2c52ea[_0x82f5('0x87')]);_0x24c9df['filters']=_[_0x82f5('0x99')](_0x24c9df[_0x82f5('0xd')],_0x24c9df[_0x82f5('0x87')]);_0x2e2423[_0x82f5('0x9a')]=_[_0x82f5('0x99')](_0x24c9df[_0x82f5('0xd')],qs[_0x82f5('0x9b')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x9b')]));_0x2e2423['attributes']=_0x2e2423[_0x82f5('0x9a')][_0x82f5('0x8f')]?_0x2e2423[_0x82f5('0x9a')]:_0x24c9df['model'];if(!_0x2c52ea[_0x82f5('0x87')]['hasOwnProperty']('nolimit')){_0x2e2423[_0x82f5('0x9c')]=qs[_0x82f5('0x9c')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x9c')]);_0x2e2423[_0x82f5('0x9d')]=qs[_0x82f5('0x9d')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x9d')]);}_0x2e2423['order']=qs[_0x82f5('0x9e')](_0x2c52ea['query'][_0x82f5('0x9e')]);_0x2e2423[_0x82f5('0x9f')]=qs['filters'](_['pick'](_0x2c52ea['query'],_0x24c9df[_0x82f5('0xa0')]));if(_0x2c52ea['query'][_0x82f5('0x5')]){_0x2e2423[_0x82f5('0x9f')]=_['merge'](_0x2e2423['where'],{'$or':_[_0x82f5('0xb')](_0x5a0cf5,function(_0x401aa0){if(_0x401aa0[_0x82f5('0x3d')][_0x82f5('0xa1')]!==_0x82f5('0xa2')){var _0xc59a34={};_0xc59a34[_0x401aa0[_0x82f5('0x6')]]={'$like':'%'+_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x5')]+'%'};return _0xc59a34;}})});}var _0x8af871=[];var _0xc2deef=null;var _0x13eda4={};if(_0x3ac301){_0xc2deef=_[_0x82f5('0x91')](_0xe42a0e,[_0x82f5('0x32'),_0x3ac301['name']]);if(_0xc2deef[_0x82f5('0x6')]){_0x13eda4={};if(_0x578083[_0x82f5('0x14')]===_0x82f5('0x10')){_0x13eda4[_0xc2deef['foreignKey']]=_[_0x82f5('0xb')](_0x3ac301[_0x82f5('0xa')],'id');}else{_0x13eda4[_0xc2deef[_0x82f5('0xa3')]]=_0x3ac301[_0x82f5('0xa')];}_0x8af871[_0x82f5('0x94')](_0x13eda4);}else{_0x2e2423[_0x82f5('0x9f')]['id']=_0x3ac301[_0x82f5('0xa')];}}else{for(var _0x5e595b=0x0;_0x5e595b<_0x2e3f64[_0x82f5('0x8f')];_0x5e595b++){_0xc2deef=_[_0x82f5('0x91')](_0xe42a0e,['name',_0x2e3f64[_0x5e595b][_0x82f5('0x32')]]);if(_0xc2deef[_0x82f5('0x6')]){_0x13eda4={};_0x13eda4[_0xc2deef[_0x82f5('0xa3')]]=_0x2e3f64[_0x5e595b][_0x82f5('0xa')];_0x8af871[_0x82f5('0x94')](_0x13eda4);}else{if(!_0x2e2423[_0x82f5('0x9f')]['id'])_0x2e2423[_0x82f5('0x9f')]['id']=[];_0x2e3f64[_0x5e595b][_0x82f5('0xa')]['forEach'](function(_0x4dab28){_0x2e2423[_0x82f5('0x9f')]['id'][_0x82f5('0x94')](_0x4dab28);});}}}if(!_[_0x82f5('0x8e')](_0x8af871)){_0x2e2423[_0x82f5('0x9f')]=_[_0x82f5('0xa4')](_0x2e2423[_0x82f5('0x9f')],{'$and':{'$or':_0x8af871}});}_0x2e2423=_['merge']({},_0x2e2423,_0x2c52ea[_0x82f5('0xa5')]);if(_0x3ac301&&!_0x3ac301[_0x82f5('0x95')]&&_0x578083[_0x82f5('0x14')]===_0x82f5('0x10')){if(_0x2c52ea['query'][_0x82f5('0xa6')]){_0x2e2423['include']=[{'all':!![]}];}return _0x248336[_0x578083[_0x82f5('0x14')]]['findAll'](_0x2e2423)[_0x82f5('0x9')](function(_0x544a9c){var _0x53a79e=[];_0x544a9c['forEach'](function(_0x16e811){var _0x5124db;switch(_0x16e811[_0x82f5('0xa7')]){case _0x82f5('0xa8'):_0x5124db=_[_0x82f5('0x91')](_0x3ac301[_0x82f5('0xa')],function(_0x1001e8){return _0x1001e8['id']===_0x16e811[_0x82f5('0xa9')]&&_0x1001e8[_0x82f5('0x3d')]===_0x82f5('0xaa');});break;case _0x82f5('0xab'):_0x5124db=_[_0x82f5('0x91')](_0x3ac301['associatedResources'],function(_0x247236){return _0x247236['id']===_0x16e811[_0x82f5('0xa9')]&&_0x247236[_0x82f5('0x3d')]==='CustomReports';});break;}if(_0x5124db)_0x53a79e[_0x82f5('0x94')](_0x16e811);});_0x238eb6[_0x82f5('0xac')]=_0x53a79e[_0x82f5('0x8f')];_0x238eb6[_0x82f5('0xad')]=_0x53a79e;return _0x238eb6;});}else{if(!_[_0x82f5('0x8e')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xae')])){_0x2e2423[_0x82f5('0x9f')]['id']=_0x2e2423[_0x82f5('0x9f')]['id']?_[_0x82f5('0x99')](_0x2e2423[_0x82f5('0x9f')]['id'],_0x2c52ea[_0x82f5('0x87')]['ids']):_0x2c52ea[_0x82f5('0x87')]['ids'];if(_0x2c52ea['query'][_0x82f5('0xaf')]){_0x2e2423[_0x82f5('0xb0')]=_0x2c52ea[_0x82f5('0x87')]['customSorting'];}}if(_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb1')]){_0x2e2423[_0x82f5('0x9f')]=_['merge'](_0x2e2423['where'],{'$and':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb1')]});}return _0x248336[_0x578083[_0x82f5('0x14')]][_0x82f5('0xac')]({'where':_0x2e2423[_0x82f5('0x9f')]})[_0x82f5('0x9')](function(_0x644f6d){_0x238eb6['count']=_0x644f6d;if(_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xa6')]){if(_0x578083[_0x82f5('0x14')]==='CmContact'){_0x2e2423[_0x82f5('0xb2')]=[{'model':_0x248336[_0x82f5('0x70')],'as':_0x82f5('0xb3'),'attributes':['id',_0x82f5('0x32'),_0x82f5('0xb4')],'required':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb5')]?!![]:![]},{'model':_0x248336[_0x82f5('0x70')],'as':_0x82f5('0xb6'),'attributes':['id',_0x82f5('0x32'),'color'],'through':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb5')]?{'attributes':[],'where':{'TagId':_0x2c52ea['query'][_0x82f5('0xb5')]||undefined}}:{},'required':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb5')]?!![]:![]}];}else{_0x2e2423[_0x82f5('0xb2')]=[{'all':!![]}];}}return _0x248336[_0x578083['childModel']][_0x82f5('0x8')](_0x2e2423);})[_0x82f5('0x9')](function(_0x59b7cb){_0x238eb6[_0x82f5('0xad')]=_0x59b7cb;if(_0x470d44==='Agents'&&_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb7')]===_0x82f5('0xb8')){var _0x2798ae=[];for(var _0x4111de=0x0;_0x4111de<_0x238eb6['rows'][_0x82f5('0x8f')];_0x4111de++){_0x2798ae[_0x82f5('0x94')](_0x4d97f4(_0x82f5('0xb9'),_0x238eb6['rows'][_0x4111de][_0x82f5('0xba')]));_0x2798ae['push'](_0x4d97f4(_0x82f5('0xbb'),_0x238eb6['rows'][_0x4111de][_0x82f5('0xba')]));_0x2798ae['push'](_0x4d97f4(_0x82f5('0xbc'),_0x238eb6[_0x82f5('0xad')][_0x4111de][_0x82f5('0xba')]));_0x2798ae[_0x82f5('0x94')](_0x4d97f4('mail',_0x238eb6[_0x82f5('0xad')][_0x4111de][_0x82f5('0xba')]));_0x2798ae[_0x82f5('0x94')](_0x4d97f4(_0x82f5('0xbd'),_0x238eb6[_0x82f5('0xad')][_0x4111de][_0x82f5('0xba')]));_0x2798ae[_0x82f5('0x94')](_0x4d97f4('whatsapp',_0x238eb6['rows'][_0x4111de][_0x82f5('0xba')]));}return Promise[_0x82f5('0x96')](_0x2798ae)[_0x82f5('0x9')](function(){return _0x238eb6;});}return _0x238eb6;});}});}}});}; \ No newline at end of file +var _0x9841=['dataValues','sms','fax','mail','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','then','associatedResources','map','catch','model','findAll','resolve','UserProfileResource','field','AnalyticExtractedReport','resourceId','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareProjects','name','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','VoiceRecording','Agents','membername','role','agent','User','telephone','VoiceQueues','type','inbound','queue','VoiceQueue','outbound','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','parentSections','QueueCampaigns','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','sounds','Sound','Tag','Template','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','toString','UserProfile','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','ignore','autoAssociation','keys','filters','intersection','fields','attributes','nolimit','limit','offset','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','default','DefaultReports','CustomReports','count','ids','customSorting','order','extraQueryConditions','include','Tags','color','tag','rows','openTabs','true','chat'];(function(_0x4dae00,_0x15b194){var _0x16bf42=function(_0x5f2a9a){while(--_0x5f2a9a){_0x4dae00['push'](_0x4dae00['shift']());}};_0x16bf42(++_0x15b194);}(_0x9841,0x174));var _0x1984=function(_0x5c1c15,_0x5ea26c){_0x5c1c15=_0x5c1c15-0x0;var _0x36effd=_0x9841[_0x5c1c15];return _0x36effd;};'use strict';var _=require(_0x1984('0x0'));var attributes=require(_0x1984('0x1'));var qs=require(_0x1984('0x2'));var squel=require(_0x1984('0x3'));module['exports']=function(_0x10698e){var _0x333760=_0x10698e[_0x1984('0x4')];function _0x1d766f(_0x53844d,_0xf29f14){return new Promise(function(_0x33e984,_0x503269){if(!_0xf29f14)return _0x33e984(null);var _0x112039=_0xf29f14['filter']?{[_0xf29f14['filter']['field']]:_0xf29f14[_0x1984('0x5')][_0x1984('0x6')]}:undefined;return _0x333760[_0x53844d]['findAll']({'where':_0x112039,'raw':!![]})[_0x1984('0x7')](function(_0x5c6396){_0xf29f14[_0x1984('0x8')]=_[_0x1984('0x9')](_0x5c6396,'id');_0x33e984(_0xf29f14);})[_0x1984('0xa')](function(_0x48fd8c){_0x503269(_0x48fd8c);});});}function _0x116f1c(_0x5c0f49,_0x12ddd1){return new Promise(function(_0x3b91d6,_0x580c5d){var _0x537b23=_0x5c0f49['filter']?{[_0x5c0f49['filter']['field']]:_0x5c0f49['filter'][_0x1984('0x6')]}:undefined;return _0x333760[_0x5c0f49[_0x1984('0xb')]][_0x1984('0xc')]({'where':_0x537b23,'raw':!![]})[_0x1984('0x7')](function(_0x3526b0){_0x12ddd1[_0x1984('0x8')]=_[_0x1984('0x9')](_0x3526b0,function(_0xdbbd57){return _0xdbbd57['name'];});_0x3b91d6(_0x12ddd1);})['catch'](function(_0x3972b0){_0x580c5d(_0x3972b0);});});}function _0x337514(_0x290834,_0x31a619,_0x72d7cb){if(!_0x31a619)return Promise[_0x1984('0xd')](null);return new Promise(function(_0x1b0281,_0x5ee8a8){return _0x333760[_0x1984('0xe')][_0x1984('0xc')]({'where':{'sectionId':_0x31a619['id']},'raw':!![]})[_0x1984('0x7')](function(_0x358470){if(_0x290834[_0x1984('0xf')]&&_0x290834[_0x1984('0xf')]!=='id'){_0x31a619[_0x1984('0x8')]=_[_0x1984('0x9')](_0x358470,function(_0x21411e){return _0x21411e[_0x290834['field']];});}else{if(_0x72d7cb===_0x1984('0x10')){_0x31a619[_0x1984('0x8')]=_[_0x1984('0x9')](_0x358470,function(_0x521b6f){return{'id':_0x521b6f['resourceId'],'type':_0x521b6f['type']};});}else{_0x31a619[_0x1984('0x8')]=_[_0x1984('0x9')](_0x358470,function(_0x4cb5c8){return _0x4cb5c8[_0x1984('0x11')];});}}_0x1b0281(_0x31a619);})[_0x1984('0xa')](function(_0x1ce7e0){_0x5ee8a8(_0x1ce7e0);});});}function _0x524e63(_0x46e2c6,_0x1ec484){var _0x4d2caf={'parentSections':[]};switch(_0x46e2c6[_0x1984('0x12')]()){case'squareprojects':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x14');break;case _0x1984('0x15'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x16');break;case _0x1984('0x17'):_0x4d2caf[_0x1984('0x13')]='SquareRecording';_0x4d2caf['parentSections']=[{'name':_0x1984('0x18'),'field':_0x1984('0x19'),'foreignKey':_0x1984('0x1a')}];break;case'projects':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x1b');break;case _0x1984('0x1c'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x1d');_0x4d2caf['parentSections']=[{'name':_0x1984('0x1e'),'field':'id','foreignKey':_0x1984('0x1f')}];break;case'lists':_0x4d2caf[_0x1984('0x13')]='CmList';break;case _0x1984('0x20'):_0x4d2caf['childModel']=_0x1984('0x21');break;case'globalcustomfields':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x22');break;case _0x1984('0x23'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x24');break;case _0x1984('0x25'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x26');break;case _0x1984('0x27'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x28');break;case'faxaccounts':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x29');break;case _0x1984('0x2a'):case _0x1984('0x2b'):case _0x1984('0x2c'):_0x4d2caf[_0x1984('0x13')]='VoiceExtension';break;case _0x1984('0x2d'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x2e');break;case'voicemails':_0x4d2caf[_0x1984('0x13')]='VoiceMail';break;case'voicerecordings':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x2f');_0x4d2caf['parentSections']=[{'name':_0x1984('0x30'),'field':_0x1984('0x19'),'foreignKey':_0x1984('0x31'),'model':'User','filter':{'field':_0x1984('0x32'),'value':[_0x1984('0x33')]}},{'name':'Telephones','field':_0x1984('0x19'),'foreignKey':_0x1984('0x31'),'model':_0x1984('0x34'),'filter':{'field':_0x1984('0x32'),'value':[_0x1984('0x35')]}},{'name':_0x1984('0x36'),'field':_0x1984('0x19'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x1984('0x37'),'value':[_0x1984('0x38')]}},{'name':'QueueCampaigns','field':_0x1984('0x19'),'foreignKey':_0x1984('0x39'),'model':_0x1984('0x3a'),'filter':{'field':_0x1984('0x37'),'value':[_0x1984('0x3b')]}}];break;case'musiconholds':_0x4d2caf[_0x1984('0x13')]='VoiceMusicOnHold';break;case _0x1984('0x3c'):_0x4d2caf['childModel']=_0x1984('0x3d');break;case'voiceprefixes':_0x4d2caf['childModel']='VoicePrefix';break;case _0x1984('0x3e'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x3f');break;case _0x1984('0x40'):_0x4d2caf[_0x1984('0x13')]='MailQueue';break;case'mailaccounts':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x41');break;case'mailsubstatuses':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x42');break;case _0x1984('0x43'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x44');break;case _0x1984('0x45'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x46');break;case'smsqueues':_0x4d2caf['childModel']='SmsQueue';break;case _0x1984('0x47'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x48');break;case'whatsappqueues':_0x4d2caf['childModel']='WhatsappQueue';break;case _0x1984('0x49'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x4a');break;case _0x1984('0x4b'):_0x4d2caf['childModel']=_0x1984('0x4c');break;case _0x1984('0x4d'):case _0x1984('0x4e'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x3a');if(_0x1ec484){_0x4d2caf[_0x1984('0x4f')]=[{'name':'VoiceQueues'},{'name':_0x1984('0x50')}];}break;case'users':case'agents':case _0x1984('0x51'):_0x4d2caf[_0x1984('0x13')]='User';if(_0x1ec484){_0x4d2caf[_0x1984('0x4f')]=[{'name':_0x1984('0x52'),'filter':{'field':_0x1984('0x32'),'value':[_0x1984('0x53'),_0x1984('0x54')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x1984('0x55'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x56');break;case _0x1984('0x57'):_0x4d2caf[_0x1984('0x13')]='SalesforceAccount';break;case _0x1984('0x58'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x59');break;case _0x1984('0x5a'):_0x4d2caf['childModel']=_0x1984('0x5b');break;case'deskaccounts':_0x4d2caf['childModel']=_0x1984('0x5c');break;case _0x1984('0x5d'):_0x4d2caf['childModel']=_0x1984('0x5e');break;case _0x1984('0x5f'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x34');break;case'cannedanswers':_0x4d2caf['childModel']=_0x1984('0x60');break;case _0x1984('0x61'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x62');break;case _0x1984('0x63'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x64');break;case _0x1984('0x65'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x66');break;case'pauses':_0x4d2caf[_0x1984('0x13')]=_0x1984('0x67');break;case'scheduler':_0x4d2caf[_0x1984('0x13')]='Schedule';break;case _0x1984('0x68'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x69');break;case'tags':_0x4d2caf['childModel']=_0x1984('0x6a');break;case'templates':_0x4d2caf['childModel']=_0x1984('0x6b');break;case _0x1984('0x6c'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x6d');break;case _0x1984('0x6e'):_0x4d2caf['childModel']=_0x1984('0x6f');break;case _0x1984('0x70'):_0x4d2caf[_0x1984('0x13')]='Variable';break;case _0x1984('0x71'):_0x4d2caf[_0x1984('0x13')]=_0x1984('0x72');break;case _0x1984('0x73'):_0x4d2caf['childModel']=_0x1984('0x10');_0x4d2caf[_0x1984('0x4f')]=[{'name':_0x1984('0x74'),'field':'id','foreignKey':_0x1984('0x75')}];break;case _0x1984('0x76'):_0x4d2caf['childModel']=_0x1984('0x77');break;}return _0x4d2caf;}function _0x4721ee(_0x340630,_0x4e6802){var _0x26f50b=_0x340630[_0x1984('0x78')](0x0)['toUpperCase']()+_0x340630[_0x1984('0x79')](0x1);var _0x30deef={'type':_0x333760[_0x1984('0x7a')][_0x1984('0x7b')][_0x1984('0x7c')],'raw':!![]};return new Promise(function(_0x5d73aa,_0x42b060){var _0x3f3723=squel[_0x1984('0x7d')]()[_0x1984('0xf')](_0x1984('0x7e')+_0x26f50b+_0x1984('0x7f'),'id')['field'](_0x1984('0x80'))['from'](_0x1984('0x81')+_0x340630+'_interactions','ui')[_0x1984('0x82')](_0x1984('0x83'),_0x4e6802['id']);return _0x333760['sequelize']['query'](_0x3f3723[_0x1984('0x84')](),_0x30deef)[_0x1984('0x7')](function(_0x4b0c0c){_0x4e6802[_0x26f50b+'OpenTabs']=_0x4b0c0c;_0x5d73aa(_0x4b0c0c);})[_0x1984('0xa')](function(_0x584ec9){_0x42b060(_0x584ec9);});});}return _0x10698e['define'](_0x1984('0x85'),attributes,{'tableName':_0x1984('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x911ab){var _0x490684={'raw':_0x911ab[_0x1984('0x87')][_0x1984('0x88')],'where':{}};var _0x5199ca={};var _0x559718={'count':0x0,'rows':[]};var _0x15df9b=_0x911ab[_0x1984('0x87')][_0x1984('0x89')];var _0x37f1f9=_0x911ab[_0x1984('0x87')][_0x1984('0x8a')]||![];var _0x2f3854=_0x524e63(_0x15df9b,_0x37f1f9);if(!_0x2f3854['childModel'])throw new Error(_0x1984('0x8b')+_0x15df9b+'\x27');var _0x59be28=[{'name':_0x15df9b}];if(!_[_0x1984('0x8c')](_0x2f3854['parentSections']))_0x59be28=_0x2f3854[_0x1984('0x4f')];var _0x591f70=[];for(var _0x2fbe0e=0x0;_0x2fbe0e<_0x59be28[_0x1984('0x8d')];_0x2fbe0e++){_0x591f70[_0x1984('0x8e')](_0x333760['UserProfileSection'][_0x1984('0x8f')]({'where':{'userProfileId':_0x911ab[_0x1984('0x90')]['id'],'name':_0x59be28[_0x2fbe0e][_0x1984('0x19')]},'raw':!![]}));}return Promise[_0x1984('0x91')](_0x591f70)[_0x1984('0x7')](function(_0x340c90){var _0x2cf12a=_[_0x1984('0x5')](_0x340c90,function(_0x1a091f){return _0x1a091f?_0x1a091f:undefined;});var _0xacc553=_[_0x1984('0x5')](_0x59be28,[_0x1984('0x92'),!![]]);var _0xd71082=_[_0x1984('0x8c')](_0x2cf12a)&&_[_0x1984('0x8c')](_0xacc553)?null:_['union'](_0xacc553,_0x2cf12a);if(!_0xd71082)return null;var _0x517da0=[];for(var _0x1f0dc4=0x0;_0x1f0dc4<_0xd71082['length'];_0x1f0dc4++){var _0x4401cc=_['find'](_0x59be28,function(_0x3c4b64){return _0xd71082[_0x1f0dc4]?_0x3c4b64[_0x1984('0x19')]===_0xd71082[_0x1f0dc4][_0x1984('0x19')]:null;});if(_0x4401cc){if(_0xd71082[_0x1f0dc4]['ignore']){_0x517da0[_0x1984('0x8e')](_0x1d766f(_0x2f3854[_0x1984('0x13')],_0xd71082[_0x1f0dc4]));}else{if(!_0xd71082[_0x1f0dc4][_0x1984('0x93')]){_0x517da0[_0x1984('0x8e')](_0x337514(_0x4401cc,_0xd71082[_0x1f0dc4],_0x2f3854[_0x1984('0x13')]));}else{if(_0x4401cc[_0x1984('0xb')]){_0x517da0['push'](_0x116f1c(_0x4401cc,_0xd71082[_0x1f0dc4]));}}}}}return Promise[_0x1984('0x91')](_0x517da0);})[_0x1984('0x7')](function(_0x4cf3d8){var _0x4089c3=_0x4cf3d8;var _0x4df9e7=null;if(_0x4089c3){_0x4df9e7=_0x4089c3[_0x1984('0x8d')]===0x1?_0x4089c3[0x0]:null;}if(!_0x4df9e7&&!_0x4089c3)return _0x559718;var _0x40159a=_0x333760[_0x2f3854[_0x1984('0x13')]]['rawAttributes'];_0x5199ca[_0x1984('0xb')]=_[_0x1984('0x94')](_0x40159a);_0x5199ca['query']=_['keys'](_0x911ab[_0x1984('0x87')]);_0x5199ca[_0x1984('0x95')]=_[_0x1984('0x96')](_0x5199ca['model'],_0x5199ca[_0x1984('0x87')]);_0x490684['attributes']=_[_0x1984('0x96')](_0x5199ca[_0x1984('0xb')],qs[_0x1984('0x97')](_0x911ab[_0x1984('0x87')][_0x1984('0x97')]));_0x490684[_0x1984('0x98')]=_0x490684[_0x1984('0x98')][_0x1984('0x8d')]?_0x490684['attributes']:_0x5199ca[_0x1984('0xb')];if(!_0x911ab['query']['hasOwnProperty'](_0x1984('0x99'))){_0x490684[_0x1984('0x9a')]=qs[_0x1984('0x9a')](_0x911ab[_0x1984('0x87')]['limit']);_0x490684[_0x1984('0x9b')]=qs[_0x1984('0x9b')](_0x911ab['query'][_0x1984('0x9b')]);}_0x490684['order']=qs[_0x1984('0x9c')](_0x911ab['query']['sort']);_0x490684[_0x1984('0x82')]=qs[_0x1984('0x95')](_[_0x1984('0x9d')](_0x911ab['query'],_0x5199ca['filters']));if(_0x911ab[_0x1984('0x87')]['filter']){_0x490684[_0x1984('0x82')]=_['merge'](_0x490684[_0x1984('0x82')],{'$or':_[_0x1984('0x9')](_0x40159a,function(_0x4ed77b){if(_0x4ed77b[_0x1984('0x37')][_0x1984('0x9e')]!==_0x1984('0x9f')){var _0x4e87fe={};_0x4e87fe[_0x4ed77b[_0x1984('0xf')]]={'$like':'%'+_0x911ab[_0x1984('0x87')][_0x1984('0x5')]+'%'};return _0x4e87fe;}})});}var _0x13ecdf=[];var _0x4e820c=null;var _0x1a8552={};if(_0x4df9e7){_0x4e820c=_[_0x1984('0x8f')](_0x59be28,['name',_0x4df9e7[_0x1984('0x19')]]);if(_0x4e820c['field']){_0x1a8552={};if(_0x2f3854['childModel']===_0x1984('0x10')){_0x1a8552[_0x4e820c[_0x1984('0xa0')]]=_['map'](_0x4df9e7[_0x1984('0x8')],'id');}else{_0x1a8552[_0x4e820c[_0x1984('0xa0')]]=_0x4df9e7['associatedResources'];}_0x13ecdf[_0x1984('0x8e')](_0x1a8552);}else{_0x490684[_0x1984('0x82')]['id']=_0x4df9e7[_0x1984('0x8')];}}else{for(var _0x88bea4=0x0;_0x88bea4<_0x4089c3[_0x1984('0x8d')];_0x88bea4++){_0x4e820c=_[_0x1984('0x8f')](_0x59be28,[_0x1984('0x19'),_0x4089c3[_0x88bea4]['name']]);if(_0x4e820c['field']){_0x1a8552={};_0x1a8552[_0x4e820c[_0x1984('0xa0')]]=_0x4089c3[_0x88bea4][_0x1984('0x8')];_0x13ecdf['push'](_0x1a8552);}else{if(!_0x490684[_0x1984('0x82')]['id'])_0x490684['where']['id']=[];_0x4089c3[_0x88bea4]['associatedResources'][_0x1984('0xa1')](function(_0x508852){_0x490684[_0x1984('0x82')]['id'][_0x1984('0x8e')](_0x508852);});}}}if(!_[_0x1984('0x8c')](_0x13ecdf)){_0x490684[_0x1984('0x82')]=_[_0x1984('0xa2')](_0x490684[_0x1984('0x82')],{'$and':{'$or':_0x13ecdf}});}_0x490684=_[_0x1984('0xa2')]({},_0x490684,_0x911ab[_0x1984('0xa3')]);if(_0x4df9e7&&!_0x4df9e7['autoAssociation']&&_0x2f3854[_0x1984('0x13')]===_0x1984('0x10')){if(_0x911ab[_0x1984('0x87')]['includeAll']){_0x490684['include']=[{'all':!![]}];}return _0x333760[_0x2f3854['childModel']][_0x1984('0xc')](_0x490684)[_0x1984('0x7')](function(_0x4e1aef){var _0x31d871=[];_0x4e1aef[_0x1984('0xa1')](function(_0x44dbd2){var _0x3fa3f0;switch(_0x44dbd2['reportType']){case _0x1984('0xa4'):_0x3fa3f0=_[_0x1984('0x8f')](_0x4df9e7[_0x1984('0x8')],function(_0x2b3072){return _0x2b3072['id']===_0x44dbd2[_0x1984('0x75')]&&_0x2b3072[_0x1984('0x37')]===_0x1984('0xa5');});break;case'custom':_0x3fa3f0=_[_0x1984('0x8f')](_0x4df9e7[_0x1984('0x8')],function(_0x5471d8){return _0x5471d8['id']===_0x44dbd2['reportId']&&_0x5471d8['type']===_0x1984('0xa6');});break;}if(_0x3fa3f0)_0x31d871[_0x1984('0x8e')](_0x44dbd2);});_0x559718[_0x1984('0xa7')]=_0x31d871[_0x1984('0x8d')];_0x559718['rows']=_0x31d871;return _0x559718;});}else{if(!_[_0x1984('0x8c')](_0x911ab[_0x1984('0x87')]['ids'])){_0x490684['where']['id']=_0x490684[_0x1984('0x82')]['id']?_[_0x1984('0x96')](_0x490684[_0x1984('0x82')]['id'],_0x911ab[_0x1984('0x87')][_0x1984('0xa8')]):_0x911ab[_0x1984('0x87')][_0x1984('0xa8')];if(_0x911ab[_0x1984('0x87')][_0x1984('0xa9')]){_0x490684[_0x1984('0xaa')]=_0x911ab[_0x1984('0x87')][_0x1984('0xa9')];}}if(_0x911ab[_0x1984('0x87')][_0x1984('0xab')]){_0x490684[_0x1984('0x82')]=_[_0x1984('0xa2')](_0x490684[_0x1984('0x82')],{'$and':_0x911ab[_0x1984('0x87')]['extraQueryConditions']});}return _0x333760[_0x2f3854[_0x1984('0x13')]][_0x1984('0xa7')]({'where':_0x490684[_0x1984('0x82')]})['then'](function(_0x1c32f2){_0x559718[_0x1984('0xa7')]=_0x1c32f2;if(_0x911ab['query']['includeAll']){if(_0x2f3854[_0x1984('0x13')]===_0x1984('0x1d')){_0x490684[_0x1984('0xac')]=[{'model':_0x333760[_0x1984('0x6a')],'as':_0x1984('0xad'),'attributes':['id',_0x1984('0x19'),_0x1984('0xae')],'required':_0x911ab[_0x1984('0x87')][_0x1984('0xaf')]?!![]:![]},{'model':_0x333760[_0x1984('0x6a')],'as':'ThroughTags','attributes':['id',_0x1984('0x19'),'color'],'through':_0x911ab['query'][_0x1984('0xaf')]?{'attributes':[],'where':{'TagId':_0x911ab[_0x1984('0x87')][_0x1984('0xaf')]||undefined}}:{},'required':_0x911ab[_0x1984('0x87')][_0x1984('0xaf')]?!![]:![]}];}else{_0x490684['include']=[{'all':!![]}];}}return _0x333760[_0x2f3854[_0x1984('0x13')]][_0x1984('0xc')](_0x490684);})[_0x1984('0x7')](function(_0x1a0001){_0x559718[_0x1984('0xb0')]=_0x1a0001;if(_0x15df9b===_0x1984('0x30')&&_0x911ab[_0x1984('0x87')][_0x1984('0xb1')]===_0x1984('0xb2')){var _0x33ab00=[];for(var _0x5ad207=0x0;_0x5ad207<_0x559718[_0x1984('0xb0')]['length'];_0x5ad207++){_0x33ab00['push'](_0x4721ee(_0x1984('0xb3'),_0x559718[_0x1984('0xb0')][_0x5ad207][_0x1984('0xb4')]));_0x33ab00[_0x1984('0x8e')](_0x4721ee(_0x1984('0xb5'),_0x559718[_0x1984('0xb0')][_0x5ad207][_0x1984('0xb4')]));_0x33ab00['push'](_0x4721ee(_0x1984('0xb6'),_0x559718[_0x1984('0xb0')][_0x5ad207][_0x1984('0xb4')]));_0x33ab00[_0x1984('0x8e')](_0x4721ee(_0x1984('0xb7'),_0x559718[_0x1984('0xb0')][_0x5ad207][_0x1984('0xb4')]));_0x33ab00[_0x1984('0x8e')](_0x4721ee('openchannel',_0x559718['rows'][_0x5ad207][_0x1984('0xb4')]));_0x33ab00[_0x1984('0x8e')](_0x4721ee('whatsapp',_0x559718[_0x1984('0xb0')][_0x5ad207][_0x1984('0xb4')]));}return Promise[_0x1984('0x91')](_0x33ab00)[_0x1984('0x7')](function(){return _0x559718;});}return _0x559718;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 285b189..b5e40f4 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 _0xe978=['error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe978,0x70));var _0x8e97=function(_0x384816,_0x535e97){_0x384816=_0x384816-0x0;var _0x30976a=_0xe978[_0x384816];return _0x30976a;};'use strict';var _=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var moment=require(_0x8e97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e97('0x3'));var db=require(_0x8e97('0x4'))['db'];var utils=require(_0x8e97('0x5'));var logger=require(_0x8e97('0x6'))(_0x8e97('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e97('0x8'));var client=jayson[_0x8e97('0x9')][_0x8e97('0xa')]({'port':0x232a});config[_0x8e97('0xb')]=_[_0x8e97('0xc')](config['redis'],{'host':_0x8e97('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e97('0xb')]));require(_0x8e97('0xe'))[_0x8e97('0xf')](socket);function respondWithRpcPromise(_0x515bc2,_0x3149de,_0x1d2aa1){return new BPromise(function(_0x4406ad,_0x37b212){return client[_0x8e97('0x10')](_0x515bc2,_0x1d2aa1)[_0x8e97('0x11')](function(_0xa97614){logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));logger[_0x8e97('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3149de,_0x8e97('0x14'),JSON[_0x8e97('0x16')](_0xa97614));if(_0xa97614[_0x8e97('0x17')]){if(_0xa97614[_0x8e97('0x17')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x3149de,_0xa97614['error']['message']);return _0x37b212(_0xa97614['error'][_0x8e97('0x18')]);}logger['error'](_0x8e97('0x13'),_0x3149de,_0xa97614[_0x8e97('0x17')]['message']);return _0x4406ad(_0xa97614['error'][_0x8e97('0x18')]);}else{logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));_0x4406ad(_0xa97614[_0x8e97('0x19')][_0x8e97('0x18')]);}})[_0x8e97('0x1a')](function(_0x2a0800){logger[_0x8e97('0x17')]('UserProfile,\x20%s,\x20%s',_0x3149de,_0x2a0800);_0x37b212(_0x2a0800);});});} \ No newline at end of file +var _0xb491=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','UserProfile,\x20%s,\x20%s'];(function(_0x2f8c05,_0x551e3d){var _0x14cfde=function(_0x282d66){while(--_0x282d66){_0x2f8c05['push'](_0x2f8c05['shift']());}};_0x14cfde(++_0x551e3d);}(_0xb491,0x18c));var _0x1b49=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0xb491[_0x4e170e];return _0x338291;};'use strict';var _=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var moment=require(_0x1b49('0x2'));var BPromise=require(_0x1b49('0x3'));var rs=require(_0x1b49('0x4'));var fs=require('fs');var Redis=require(_0x1b49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b49('0x6'));var logger=require(_0x1b49('0x7'))('rpc');var config=require(_0x1b49('0x8'));var jayson=require(_0x1b49('0x9'));var client=jayson[_0x1b49('0xa')]['http']({'port':0x232a});config[_0x1b49('0xb')]=_['defaults'](config[_0x1b49('0xb')],{'host':_0x1b49('0xc'),'port':0x18eb});var socket=require(_0x1b49('0xd'))(new Redis(config[_0x1b49('0xb')]));require(_0x1b49('0xe'))[_0x1b49('0xf')](socket);function respondWithRpcPromise(_0x36e294,_0x3dc13d,_0x2768e1){return new BPromise(function(_0x1174c3,_0x2ca75f){return client[_0x1b49('0x10')](_0x36e294,_0x2768e1)[_0x1b49('0x11')](function(_0x13ba5c){logger['info']('UserProfile,\x20%s,\x20%s',_0x3dc13d,_0x1b49('0x12'));logger[_0x1b49('0x13')](_0x1b49('0x14'),_0x3dc13d,_0x1b49('0x12'),JSON[_0x1b49('0x15')](_0x13ba5c));if(_0x13ba5c['error']){if(_0x13ba5c[_0x1b49('0x16')]['code']===0x1f4){logger[_0x1b49('0x16')](_0x1b49('0x17'),_0x3dc13d,_0x13ba5c[_0x1b49('0x16')][_0x1b49('0x18')]);return _0x2ca75f(_0x13ba5c['error'][_0x1b49('0x18')]);}logger[_0x1b49('0x16')](_0x1b49('0x17'),_0x3dc13d,_0x13ba5c[_0x1b49('0x16')][_0x1b49('0x18')]);return _0x1174c3(_0x13ba5c[_0x1b49('0x16')][_0x1b49('0x18')]);}else{logger[_0x1b49('0x19')]('UserProfile,\x20%s,\x20%s',_0x3dc13d,_0x1b49('0x12'));_0x1174c3(_0x13ba5c[_0x1b49('0x1a')]['message']);}})[_0x1b49('0x1b')](function(_0x20c51f){logger[_0x1b49('0x16')](_0x1b49('0x17'),_0x3dc13d,_0x20c51f);_0x2ca75f(_0x20c51f);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index e2bb233..bcc13c0 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 _0x16ae=['save','remove','update','emit','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16ae,0xfb));var _0xe16a=function(_0x3d067c,_0x423ef1){_0x3d067c=_0x3d067c-0x0;var _0x4d8350=_0x16ae[_0x3d067c];return _0x4d8350;};'use strict';var UserProfileEvents=require(_0xe16a('0x0'));var events=[_0xe16a('0x1'),_0xe16a('0x2'),_0xe16a('0x3')];function createListener(_0x5aeeba,_0x3ab8ea){return function(_0x14786f){_0x3ab8ea[_0xe16a('0x4')](_0x5aeeba,_0x14786f);};}function removeListener(_0x329e5f,_0xe51edb){return function(){UserProfileEvents[_0xe16a('0x5')](_0x329e5f,_0xe51edb);};}exports[_0xe16a('0x6')]=function(_0x690422){for(var _0x339dec=0x0,_0x927071=events[_0xe16a('0x7')];_0x339dec<_0x927071;_0x339dec++){var _0x301e92=events[_0x339dec];var _0x263d31=createListener(_0xe16a('0x8')+_0x301e92,_0x690422);UserProfileEvents['on'](_0x301e92,_0x263d31);}}; \ No newline at end of file +var _0xdc2e=['userProfile:','./userProfile.events','save','update','emit'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xdc2e,0x155));var _0xedc2=function(_0x3cd774,_0x1c01b1){_0x3cd774=_0x3cd774-0x0;var _0x1f4922=_0xdc2e[_0x3cd774];return _0x1f4922;};'use strict';var UserProfileEvents=require(_0xedc2('0x0'));var events=[_0xedc2('0x1'),'remove',_0xedc2('0x2')];function createListener(_0x1ddd18,_0x570036){return function(_0x35e812){_0x570036[_0xedc2('0x3')](_0x1ddd18,_0x35e812);};}function removeListener(_0x3e1f76,_0x42a8ff){return function(){UserProfileEvents['removeListener'](_0x3e1f76,_0x42a8ff);};}exports['register']=function(_0x45e698){for(var _0x234979=0x0,_0x12989c=events['length'];_0x234979<_0x12989c;_0x234979++){var _0x1761b2=events[_0x234979];var _0x10346d=createListener(_0xedc2('0x4')+_0x1761b2,_0x45e698);UserProfileEvents['on'](_0x1761b2,_0x10346d);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 27efed8..9a76e23 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 _0xd585=['Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd585,0x8f));var _0x5d58=function(_0x2e941b,_0x45be74){_0x2e941b=_0x2e941b-0x0;var _0x3b3320=_0xd585[_0x2e941b];return _0x3b3320;};'use strict';var multer=require(_0x5d58('0x0'));var util=require('util');var path=require(_0x5d58('0x1'));var timeout=require(_0x5d58('0x2'));var express=require(_0x5d58('0x3'));var router=express[_0x5d58('0x4')]();var fs_extra=require(_0x5d58('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5d58('0x6'));var config=require(_0x5d58('0x7'));var controller=require(_0x5d58('0x8'));router[_0x5d58('0x9')]('/',auth['isAuthenticated'](),controller[_0x5d58('0xa')]);router[_0x5d58('0x9')](_0x5d58('0xb'),auth[_0x5d58('0xc')](),controller[_0x5d58('0xd')]);router['get'](_0x5d58('0xe'),auth[_0x5d58('0xc')](),controller[_0x5d58('0xf')]);router[_0x5d58('0x10')]('/',auth[_0x5d58('0xc')](),controller[_0x5d58('0x11')]);router['put'](_0x5d58('0xe'),auth[_0x5d58('0xc')](),controller[_0x5d58('0x12')]);router[_0x5d58('0x13')](_0x5d58('0xe'),auth[_0x5d58('0xc')](),controller[_0x5d58('0x14')]);module['exports']=router; \ No newline at end of file +var _0x81ed=['fs-extra','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated','describe','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x231f08,_0x1138db){var _0x25e2b1=function(_0x4e590b){while(--_0x4e590b){_0x231f08['push'](_0x231f08['shift']());}};_0x25e2b1(++_0x1138db);}(_0x81ed,0xc8));var _0xd81e=function(_0x45235c,_0x49494c){_0x45235c=_0x45235c-0x0;var _0x4395e0=_0x81ed[_0x45235c];return _0x4395e0;};'use strict';var multer=require(_0xd81e('0x0'));var util=require(_0xd81e('0x1'));var path=require(_0xd81e('0x2'));var timeout=require(_0xd81e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd81e('0x4'));var auth=require(_0xd81e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd81e('0x6'));var controller=require('./userProfileResource.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd81e('0x7')]);router['get'](_0xd81e('0x8'),auth[_0xd81e('0x9')](),controller[_0xd81e('0xa')]);router['get'](_0xd81e('0xb'),auth[_0xd81e('0x9')](),controller['show']);router[_0xd81e('0xc')]('/',auth[_0xd81e('0x9')](),controller[_0xd81e('0xd')]);router['put'](_0xd81e('0xb'),auth['isAuthenticated'](),controller[_0xd81e('0xe')]);router[_0xd81e('0xf')]('/:id',auth[_0xd81e('0x9')](),controller[_0xd81e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 1a9ec32..4f2321d 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 _0x3054=['STRING','INTEGER','sequelize','exports'];(function(_0x14984a,_0x4bec35){var _0x4122d5=function(_0x1a4e77){while(--_0x1a4e77){_0x14984a['push'](_0x14984a['shift']());}};_0x4122d5(++_0x4bec35);}(_0x3054,0xe6));var _0x4305=function(_0x308412,_0x11bdf8){_0x308412=_0x308412-0x0;var _0x1c54c6=_0x3054[_0x308412];return _0x1c54c6;};'use strict';var Sequelize=require(_0x4305('0x0'));module[_0x4305('0x1')]={'name':{'type':Sequelize[_0x4305('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4305('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x0d55=['exports','STRING','INTEGER','sequelize'];(function(_0x5034b1,_0x26f133){var _0x4d71b3=function(_0xce0ca1){while(--_0xce0ca1){_0x5034b1['push'](_0x5034b1['shift']());}};_0x4d71b3(++_0x26f133);}(_0x0d55,0x137));var _0x50d5=function(_0x381ddb,_0x414363){_0x381ddb=_0x381ddb-0x0;var _0x3d4ad3=_0x0d55[_0x381ddb];return _0x3d4ad3;};'use strict';var Sequelize=require(_0x50d5('0x0'));module[_0x50d5('0x1')]={'name':{'type':Sequelize[_0x50d5('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x50d5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x50d5('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 6b8a676..526f52a 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 _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','UserProfileResource','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x1f3850,_0x1792a2){var _0x53f2b9=function(_0x1c4bf3){while(--_0x1c4bf3){_0x1f3850['push'](_0x1f3850['shift']());}};_0x53f2b9(++_0x1792a2);}(_0x7096,0x10c));var _0x6709=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7096[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['UserProfileResource'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['UserProfileResource'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['UserProfileResource'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['UserProfileResource']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['UserProfileResource'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['UserProfileResource'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file +var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','UserProfileResource','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','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x412686,_0x3fde24){var _0x18619e=function(_0x862bd1){while(--_0x862bd1){_0x412686['push'](_0x412686['shift']());}};_0x18619e(++_0x3fde24);}(_0x430c,0x1a1));var _0xc430=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x430c[_0x216799];return _0x3661c3;};'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));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6bce549..3efb806 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 _0xe453=['lodash','util','../../config/logger','api','moment','request-promise','path','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId'];(function(_0x4e0625,_0x1109f3){var _0x3778ec=function(_0x3b8382){while(--_0x3b8382){_0x4e0625['push'](_0x4e0625['shift']());}};_0x3778ec(++_0x1109f3);}(_0xe453,0x75));var _0x3e45=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe453[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3e45('0x0'));var util=require(_0x3e45('0x1'));var logger=require(_0x3e45('0x2'))(_0x3e45('0x3'));var moment=require(_0x3e45('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e45('0x5'));var fs=require('fs');var path=require(_0x3e45('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e45('0x7'));module[_0x3e45('0x8')]=function(_0x36d6c2,_0x4fe086){return _0x36d6c2[_0x3e45('0x9')](_0x3e45('0xa'),attributes,{'tableName':_0x3e45('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x3e45('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa28=['path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2db9e4,_0x67030e){var _0x2eca40=function(_0x6ef5bd){while(--_0x6ef5bd){_0x2db9e4['push'](_0x2db9e4['shift']());}};_0x2eca40(++_0x67030e);}(_0xaa28,0xda));var _0x8aa2=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0xaa28[_0x622035];return _0x326cf2;};'use strict';var _=require('lodash');var util=require(_0x8aa2('0x0'));var logger=require(_0x8aa2('0x1'))(_0x8aa2('0x2'));var moment=require(_0x8aa2('0x3'));var BPromise=require(_0x8aa2('0x4'));var rp=require(_0x8aa2('0x5'));var fs=require('fs');var path=require(_0x8aa2('0x6'));var rimraf=require(_0x8aa2('0x7'));var config=require(_0x8aa2('0x8'));var attributes=require(_0x8aa2('0x9'));module[_0x8aa2('0xa')]=function(_0x1e6397,_0x1f020a){return _0x1e6397[_0x8aa2('0xb')](_0x8aa2('0xc'),attributes,{'tableName':_0x8aa2('0xd'),'paranoid':![],'indexes':[{'name':_0x8aa2('0xe'),'fields':[_0x8aa2('0xf'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 3dc436c..9446d5c 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 _0x8217=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4454b2,_0x3f408b){var _0x50b8f1=function(_0x5bdbe8){while(--_0x5bdbe8){_0x4454b2['push'](_0x4454b2['shift']());}};_0x50b8f1(++_0x3f408b);}(_0x8217,0x134));var _0x7821=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x8217[_0x55d58f];return _0x1ad6e6;};'use strict';var _=require(_0x7821('0x0'));var util=require(_0x7821('0x1'));var moment=require(_0x7821('0x2'));var BPromise=require(_0x7821('0x3'));var rs=require(_0x7821('0x4'));var fs=require('fs');var Redis=require(_0x7821('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7821('0x6'))('rpc');var config=require(_0x7821('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7821('0x8')][_0x7821('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41b445,_0x39455a,_0xeb8e05){return new BPromise(function(_0x6944cc,_0x2b0e06){return client[_0x7821('0xa')](_0x41b445,_0xeb8e05)[_0x7821('0xb')](function(_0x13a3b9){logger[_0x7821('0xc')](_0x7821('0xd'),_0x39455a,_0x7821('0xe'));logger[_0x7821('0xf')](_0x7821('0x10'),_0x39455a,_0x7821('0xe'),JSON['stringify'](_0x13a3b9));if(_0x13a3b9[_0x7821('0x11')]){if(_0x13a3b9[_0x7821('0x11')][_0x7821('0x12')]===0x1f4){logger[_0x7821('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x39455a,_0x13a3b9[_0x7821('0x11')][_0x7821('0x13')]);return _0x2b0e06(_0x13a3b9[_0x7821('0x11')]['message']);}logger[_0x7821('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x39455a,_0x13a3b9[_0x7821('0x11')]['message']);return _0x6944cc(_0x13a3b9[_0x7821('0x11')][_0x7821('0x13')]);}else{logger['info'](_0x7821('0xd'),_0x39455a,_0x7821('0xe'));_0x6944cc(_0x13a3b9[_0x7821('0x14')][_0x7821('0x13')]);}})[_0x7821('0x15')](function(_0x218786){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x39455a,_0x218786);_0x2b0e06(_0x218786);});});} \ No newline at end of file +var _0xddb8=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x598cc1,_0x1a3cab){var _0x17d2d0=function(_0x3311db){while(--_0x3311db){_0x598cc1['push'](_0x598cc1['shift']());}};_0x17d2d0(++_0x1a3cab);}(_0xddb8,0x102));var _0x8ddb=function(_0x4c3e92,_0x3fccdb){_0x4c3e92=_0x4c3e92-0x0;var _0x4d8cb5=_0xddb8[_0x4c3e92];return _0x4d8cb5;};'use strict';var _=require(_0x8ddb('0x0'));var util=require(_0x8ddb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ddb('0x2'));var fs=require('fs');var Redis=require(_0x8ddb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ddb('0x4'));var logger=require(_0x8ddb('0x5'))(_0x8ddb('0x6'));var config=require(_0x8ddb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8ddb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f1d04,_0x25436b,_0x5b6a8c){return new BPromise(function(_0x32d7eb,_0x45f424){return client[_0x8ddb('0x9')](_0x5f1d04,_0x5b6a8c)[_0x8ddb('0xa')](function(_0x34b86b){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x25436b,_0x8ddb('0xb'));logger['debug'](_0x8ddb('0xc'),_0x25436b,_0x8ddb('0xb'),JSON[_0x8ddb('0xd')](_0x34b86b));if(_0x34b86b[_0x8ddb('0xe')]){if(_0x34b86b[_0x8ddb('0xe')]['code']===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x25436b,_0x34b86b[_0x8ddb('0xe')][_0x8ddb('0xf')]);return _0x45f424(_0x34b86b[_0x8ddb('0xe')]['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x25436b,_0x34b86b['error']['message']);return _0x32d7eb(_0x34b86b[_0x8ddb('0xe')]['message']);}else{logger[_0x8ddb('0x10')](_0x8ddb('0x11'),_0x25436b,_0x8ddb('0xb'));_0x32d7eb(_0x34b86b[_0x8ddb('0x12')][_0x8ddb('0xf')]);}})[_0x8ddb('0x13')](function(_0x108939){logger[_0x8ddb('0xe')](_0x8ddb('0x11'),_0x25436b,_0x108939);_0x45f424(_0x108939);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 14e9272..5f8bac3 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 _0x1e61=['../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5383af,_0xb2349){var _0x42d304=function(_0x11c1ae){while(--_0x11c1ae){_0x5383af['push'](_0x5383af['shift']());}};_0x42d304(++_0xb2349);}(_0x1e61,0x150));var _0x11e6=function(_0x4aaa7f,_0x44aeb6){_0x4aaa7f=_0x4aaa7f-0x0;var _0x11617c=_0x1e61[_0x4aaa7f];return _0x11617c;};'use strict';var multer=require(_0x11e6('0x0'));var util=require(_0x11e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11e6('0x2'));var router=express[_0x11e6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x11e6('0x4'));var interaction=require(_0x11e6('0x5'));var config=require(_0x11e6('0x6'));var controller=require('./userProfileSection.controller');router[_0x11e6('0x7')]('/',auth['isAuthenticated'](),controller[_0x11e6('0x8')]);router['get'](_0x11e6('0x9'),auth[_0x11e6('0xa')](),controller['describe']);router['get'](_0x11e6('0xb'),auth[_0x11e6('0xa')](),controller[_0x11e6('0xc')]);router[_0x11e6('0xd')]('/',auth[_0x11e6('0xa')](),controller[_0x11e6('0xe')]);router[_0x11e6('0xf')]('/:id',auth[_0x11e6('0xa')](),controller[_0x11e6('0x10')]);router[_0x11e6('0x11')]('/:id',auth[_0x11e6('0xa')](),controller[_0x11e6('0x12')]);module['exports']=router; \ No newline at end of file +var _0x74e6=['destroy','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x1a8907,_0x424c44){var _0x459af3=function(_0x21700a){while(--_0x21700a){_0x1a8907['push'](_0x1a8907['shift']());}};_0x459af3(++_0x424c44);}(_0x74e6,0x87));var _0x674e=function(_0x344ef3,_0x40b640){_0x344ef3=_0x344ef3-0x0;var _0x7b1944=_0x74e6[_0x344ef3];return _0x7b1944;};'use strict';var multer=require('multer');var util=require(_0x674e('0x0'));var path=require('path');var timeout=require(_0x674e('0x1'));var express=require('express');var router=express[_0x674e('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x674e('0x3'));var config=require(_0x674e('0x4'));var controller=require(_0x674e('0x5'));router[_0x674e('0x6')]('/',auth[_0x674e('0x7')](),controller[_0x674e('0x8')]);router[_0x674e('0x6')](_0x674e('0x9'),auth[_0x674e('0x7')](),controller[_0x674e('0xa')]);router[_0x674e('0x6')](_0x674e('0xb'),auth[_0x674e('0x7')](),controller['show']);router[_0x674e('0xc')]('/',auth[_0x674e('0x7')](),controller[_0x674e('0xd')]);router[_0x674e('0xe')](_0x674e('0xb'),auth[_0x674e('0x7')](),controller[_0x674e('0xf')]);router[_0x674e('0x10')](_0x674e('0xb'),auth[_0x674e('0x7')](),controller[_0x674e('0x11')]);module[_0x674e('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 4161e54..3608918 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 _0x056b=['getDataValue','split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x226a3f,_0x4b8900){var _0x16cb5d=function(_0x58a83c){while(--_0x58a83c){_0x226a3f['push'](_0x226a3f['shift']());}};_0x16cb5d(++_0x4b8900);}(_0x056b,0xb6));var _0xb056=function(_0x4bc9da,_0x42dace){_0x4bc9da=_0x4bc9da-0x0;var _0x14573c=_0x056b[_0x4bc9da];return _0x14573c;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb056('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb056('0x1')],'set':function(_0x4157e0){this[_0xb056('0x4')](_0xb056('0x5'),_0x4157e0?_0x4157e0[_0xb056('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xb056('0x5'))?this[_0xb056('0x7')](_0xb056('0x5'))[_0xb056('0x8')](''):[];}}}; \ No newline at end of file +var _0xb58b=['exports','STRING','BOOLEAN','crudPermissions','join','getDataValue','split'];(function(_0x2baf40,_0x5ebef2){var _0x2bb2cb=function(_0x1a3fc1){while(--_0x1a3fc1){_0x2baf40['push'](_0x2baf40['shift']());}};_0x2bb2cb(++_0x5ebef2);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3a9a9f,_0x390ce7){_0x3a9a9f=_0x3a9a9f-0x0;var _0x5b5597=_0xb58b[_0x3a9a9f];return _0x5b5597;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'name':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x226363){this['setDataValue'](_0xbb58('0x3'),_0x226363?_0x226363[_0xbb58('0x4')](''):[]);},'get':function(){return this[_0xbb58('0x5')]('crudPermissions')?this[_0xbb58('0x5')](_0xbb58('0x3'))[_0xbb58('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 5b6851a..24c6cc2 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 _0x5d20=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','end','sendStatus','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length'];(function(_0x484630,_0x439a47){var _0x4c35ce=function(_0x5b9a68){while(--_0x5b9a68){_0x484630['push'](_0x484630['shift']());}};_0x4c35ce(++_0x439a47);}(_0x5d20,0xfa));var _0x05d2=function(_0x52a31e,_0x303640){_0x52a31e=_0x52a31e-0x0;var _0x524743=_0x5d20[_0x52a31e];return _0x524743;};'use strict';var emlformat=require(_0x05d2('0x0'));var rimraf=require(_0x05d2('0x1'));var zipdir=require(_0x05d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05d2('0x3'));var moment=require(_0x05d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x05d2('0x5'));var util=require(_0x05d2('0x6'));var path=require(_0x05d2('0x7'));var sox=require(_0x05d2('0x8'));var csv=require(_0x05d2('0x9'));var ejs=require(_0x05d2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05d2('0xb'));var squel=require(_0x05d2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x05d2('0xd'));var toCsv=require(_0x05d2('0x9'));var querystring=require(_0x05d2('0xe'));var Papa=require('papaparse');var Redis=require(_0x05d2('0xf'));var authService=require(_0x05d2('0x10'));var qs=require(_0x05d2('0x11'));var as=require(_0x05d2('0x12'));var hardwareService=require(_0x05d2('0x13'));var logger=require(_0x05d2('0x14'))(_0x05d2('0x15'));var utils=require(_0x05d2('0x16'));var config=require(_0x05d2('0x17'));var licenseUtil=require(_0x05d2('0x18'));var db=require(_0x05d2('0x19'))['db'];function respondWithStatusCode(_0x5a982c,_0xd2f461){_0xd2f461=_0xd2f461||0xcc;return function(_0x1fca11){if(_0x1fca11){return _0x5a982c['sendStatus'](_0xd2f461);}return _0x5a982c[_0x05d2('0x1a')](_0xd2f461)['end']();};}function respondWithResult(_0x2bb417,_0x4a004b){_0x4a004b=_0x4a004b||0xc8;return function(_0x21ce14){if(_0x21ce14){return _0x2bb417[_0x05d2('0x1a')](_0x4a004b)[_0x05d2('0x1b')](_0x21ce14);}};}function respondWithFilteredResult(_0x181393,_0x5ea4d1){return function(_0x2cc139){if(_0x2cc139){var _0x12289d=typeof _0x5ea4d1[_0x05d2('0x1c')]===_0x05d2('0x1d')&&typeof _0x5ea4d1['limit']===_0x05d2('0x1d');var _0x18f158=_0x2cc139[_0x05d2('0x1e')];var _0x23e72e=_0x12289d?0x0:_0x5ea4d1['offset'];var _0x2f84c0=_0x12289d?_0x2cc139[_0x05d2('0x1e')]:_0x5ea4d1[_0x05d2('0x1c')]+_0x5ea4d1[_0x05d2('0x1f')];var _0x50bb71;if(_0x2f84c0>=_0x18f158){_0x2f84c0=_0x18f158;_0x50bb71=0xc8;}else{_0x50bb71=0xce;}_0x181393[_0x05d2('0x1a')](_0x50bb71);return _0x181393['set'](_0x05d2('0x20'),_0x23e72e+'-'+_0x2f84c0+'/'+_0x18f158)[_0x05d2('0x1b')](_0x2cc139);}return null;};}function patchUpdates(_0x104215){return function(_0x3a8ea9){try{jsonpatch[_0x05d2('0x21')](_0x3a8ea9,_0x104215,!![]);}catch(_0x1343bb){return BPromise[_0x05d2('0x22')](_0x1343bb);}return _0x3a8ea9['save']();};}function saveUpdates(_0x141f0b,_0xc950b6){return function(_0x3b4715){if(_0x3b4715){return _0x3b4715[_0x05d2('0x23')](_0x141f0b)[_0x05d2('0x24')](function(_0x187918){return _0x187918;});}return null;};}function removeEntity(_0x290cbd,_0x166431){return function(_0xc4ffb5){if(_0xc4ffb5){return _0xc4ffb5['destroy']()[_0x05d2('0x24')](function(){_0x290cbd[_0x05d2('0x1a')](0xcc)[_0x05d2('0x25')]();});}};}function handleEntityNotFound(_0xc7648b,_0xfa28f9){return function(_0x20722d){if(!_0x20722d){_0xc7648b[_0x05d2('0x26')](0x194);}return _0x20722d;};}function handleError(_0x3f3927,_0x3cf1e7){_0x3cf1e7=_0x3cf1e7||0x1f4;return function(_0x850507){logger['error'](_0x850507[_0x05d2('0x27')]);if(_0x850507[_0x05d2('0x28')]){delete _0x850507[_0x05d2('0x28')];}_0x3f3927[_0x05d2('0x1a')](_0x3cf1e7)[_0x05d2('0x29')](_0x850507);};}exports[_0x05d2('0x2a')]=function(_0x228780,_0x1839f7){var _0x278da2={},_0x220f91={},_0x37dfbd={'count':0x0,'rows':[]};var _0x519378=_[_0x05d2('0x2b')](db[_0x05d2('0x2c')][_0x05d2('0x2d')],function(_0x82957c){return{'name':_0x82957c[_0x05d2('0x2e')],'type':_0x82957c['type']['key']};});_0x220f91['model']=_[_0x05d2('0x2b')](_0x519378,_0x05d2('0x28'));_0x220f91[_0x05d2('0x2f')]=_['keys'](_0x228780[_0x05d2('0x2f')]);_0x220f91[_0x05d2('0x30')]=_[_0x05d2('0x31')](_0x220f91[_0x05d2('0x32')],_0x220f91[_0x05d2('0x2f')]);_0x278da2[_0x05d2('0x33')]=_[_0x05d2('0x31')](_0x220f91[_0x05d2('0x32')],qs[_0x05d2('0x34')](_0x228780[_0x05d2('0x2f')][_0x05d2('0x34')]));_0x278da2[_0x05d2('0x33')]=_0x278da2[_0x05d2('0x33')][_0x05d2('0x35')]?_0x278da2[_0x05d2('0x33')]:_0x220f91[_0x05d2('0x32')];if(!_0x228780[_0x05d2('0x2f')]['hasOwnProperty'](_0x05d2('0x36'))){_0x278da2[_0x05d2('0x1f')]=qs[_0x05d2('0x1f')](_0x228780['query'][_0x05d2('0x1f')]);_0x278da2[_0x05d2('0x1c')]=qs[_0x05d2('0x1c')](_0x228780['query']['offset']);}_0x278da2[_0x05d2('0x37')]=qs[_0x05d2('0x38')](_0x228780[_0x05d2('0x2f')]['sort']);_0x278da2['where']=qs[_0x05d2('0x30')](_[_0x05d2('0x39')](_0x228780[_0x05d2('0x2f')],_0x220f91[_0x05d2('0x30')]),_0x519378);if(_0x228780[_0x05d2('0x2f')][_0x05d2('0x3a')]){_0x278da2[_0x05d2('0x3b')]=_[_0x05d2('0x3c')](_0x278da2['where'],{'$or':_[_0x05d2('0x2b')](_0x519378,function(_0x2d3d75){if(_0x2d3d75['type']!==_0x05d2('0x3d')){var _0x32e063={};_0x32e063[_0x2d3d75[_0x05d2('0x28')]]={'$like':'%'+_0x228780[_0x05d2('0x2f')][_0x05d2('0x3a')]+'%'};return _0x32e063;}})});}_0x278da2=_[_0x05d2('0x3c')]({},_0x278da2,_0x228780[_0x05d2('0x3e')]);var _0x4ba621={'where':_0x278da2[_0x05d2('0x3b')]};return db[_0x05d2('0x2c')][_0x05d2('0x1e')](_0x4ba621)[_0x05d2('0x24')](function(_0x440290){_0x37dfbd[_0x05d2('0x1e')]=_0x440290;if(_0x228780[_0x05d2('0x2f')]['includeAll']){_0x278da2[_0x05d2('0x3f')]=[{'all':!![]}];}return db['UserProfileSection'][_0x05d2('0x40')](_0x278da2);})[_0x05d2('0x24')](function(_0x57220d){_0x37dfbd[_0x05d2('0x41')]=_0x57220d;return _0x37dfbd;})['then'](respondWithFilteredResult(_0x1839f7,_0x278da2))[_0x05d2('0x42')](handleError(_0x1839f7,null));};exports[_0x05d2('0x43')]=function(_0x7b1221,_0x183c5b){var _0x3fb2ee={'raw':![],'where':{'id':_0x7b1221[_0x05d2('0x44')]['id']}},_0x597e71={};_0x597e71['model']=_[_0x05d2('0x45')](db[_0x05d2('0x2c')][_0x05d2('0x2d')]);_0x597e71[_0x05d2('0x2f')]=_[_0x05d2('0x45')](_0x7b1221[_0x05d2('0x2f')]);_0x597e71[_0x05d2('0x30')]=_[_0x05d2('0x31')](_0x597e71[_0x05d2('0x32')],_0x597e71[_0x05d2('0x2f')]);_0x3fb2ee[_0x05d2('0x33')]=_[_0x05d2('0x31')](_0x597e71[_0x05d2('0x32')],qs[_0x05d2('0x34')](_0x7b1221[_0x05d2('0x2f')][_0x05d2('0x34')]));_0x3fb2ee[_0x05d2('0x33')]=_0x3fb2ee['attributes'][_0x05d2('0x35')]?_0x3fb2ee[_0x05d2('0x33')]:_0x597e71['model'];if(_0x7b1221[_0x05d2('0x2f')][_0x05d2('0x46')]){_0x3fb2ee[_0x05d2('0x3f')]=[{'all':!![]}];}_0x3fb2ee=_[_0x05d2('0x3c')]({},_0x3fb2ee,_0x7b1221['options']);return db[_0x05d2('0x2c')][_0x05d2('0x47')](_0x3fb2ee)['then'](handleEntityNotFound(_0x183c5b,null))[_0x05d2('0x24')](respondWithResult(_0x183c5b,null))[_0x05d2('0x42')](handleError(_0x183c5b,null));};exports[_0x05d2('0x48')]=function(_0x23b23d,_0x5d3f9f){return db['UserProfileSection'][_0x05d2('0x48')](_0x23b23d['body'],{})[_0x05d2('0x24')](respondWithResult(_0x5d3f9f,0xc9))['catch'](handleError(_0x5d3f9f,null));};exports['update']=function(_0x35e0ef,_0x407500){if(_0x35e0ef[_0x05d2('0x49')]['id']){delete _0x35e0ef[_0x05d2('0x49')]['id'];}return db[_0x05d2('0x2c')][_0x05d2('0x47')]({'where':{'id':_0x35e0ef['params']['id']}})[_0x05d2('0x24')](handleEntityNotFound(_0x407500,null))['then'](saveUpdates(_0x35e0ef['body'],null))[_0x05d2('0x24')](respondWithResult(_0x407500,null))[_0x05d2('0x42')](handleError(_0x407500,null));};exports[_0x05d2('0x4a')]=function(_0x348b4e,_0x3fb72c){return db[_0x05d2('0x2c')][_0x05d2('0x47')]({'where':{'id':_0x348b4e['params']['id']}})[_0x05d2('0x24')](handleEntityNotFound(_0x3fb72c,null))[_0x05d2('0x24')](removeEntity(_0x3fb72c,null))[_0x05d2('0x42')](handleError(_0x3fb72c,null));};exports['describe']=function(_0x5007be,_0xc27675){return db[_0x05d2('0x2c')][_0x05d2('0x4b')]()[_0x05d2('0x24')](respondWithResult(_0xc27675,null))[_0x05d2('0x42')](handleError(_0xc27675,null));}; \ No newline at end of file +var _0xe832=['rows','catch','params','rawAttributes','length','includeAll','options','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','squel','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','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','end','stack','send','index','map','UserProfileSection','fieldName','type','key','name','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe832,0x1eb));var _0x2e83=function(_0xde1a6e,_0x4b416){_0xde1a6e=_0xde1a6e-0x0;var _0x107e1a=_0xe832[_0xde1a6e];return _0x107e1a;};'use strict';var emlformat=require(_0x2e83('0x0'));var rimraf=require(_0x2e83('0x1'));var zipdir=require(_0x2e83('0x2'));var jsonpatch=require(_0x2e83('0x3'));var rp=require(_0x2e83('0x4'));var moment=require(_0x2e83('0x5'));var BPromise=require(_0x2e83('0x6'));var Mustache=require(_0x2e83('0x7'));var util=require(_0x2e83('0x8'));var path=require(_0x2e83('0x9'));var sox=require(_0x2e83('0xa'));var csv=require(_0x2e83('0xb'));var ejs=require(_0x2e83('0xc'));var fs=require('fs');var fs_extra=require(_0x2e83('0xd'));var _=require(_0x2e83('0xe'));var squel=require(_0x2e83('0xf'));var crypto=require('crypto');var jsforce=require(_0x2e83('0x10'));var deskjs=require(_0x2e83('0x11'));var toCsv=require(_0x2e83('0xb'));var querystring=require(_0x2e83('0x12'));var Papa=require(_0x2e83('0x13'));var Redis=require(_0x2e83('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2e83('0x15'));var as=require(_0x2e83('0x16'));var hardwareService=require(_0x2e83('0x17'));var logger=require(_0x2e83('0x18'))('api');var utils=require(_0x2e83('0x19'));var config=require(_0x2e83('0x1a'));var licenseUtil=require(_0x2e83('0x1b'));var db=require(_0x2e83('0x1c'))['db'];function respondWithStatusCode(_0xcf619,_0x32fa6f){_0x32fa6f=_0x32fa6f||0xcc;return function(_0x357cb3){if(_0x357cb3){return _0xcf619[_0x2e83('0x1d')](_0x32fa6f);}return _0xcf619[_0x2e83('0x1e')](_0x32fa6f)['end']();};}function respondWithResult(_0x8e4c8e,_0x3b74e9){_0x3b74e9=_0x3b74e9||0xc8;return function(_0x1a1960){if(_0x1a1960){return _0x8e4c8e['status'](_0x3b74e9)['json'](_0x1a1960);}};}function respondWithFilteredResult(_0x1d15f5,_0xf30fc4){return function(_0xfb4228){if(_0xfb4228){var _0x1e30f4=typeof _0xf30fc4[_0x2e83('0x1f')]===_0x2e83('0x20')&&typeof _0xf30fc4['limit']==='undefined';var _0x1ac074=_0xfb4228['count'];var _0x33a60f=_0x1e30f4?0x0:_0xf30fc4[_0x2e83('0x1f')];var _0x3edf71=_0x1e30f4?_0xfb4228[_0x2e83('0x21')]:_0xf30fc4[_0x2e83('0x1f')]+_0xf30fc4[_0x2e83('0x22')];var _0x4124c5;if(_0x3edf71>=_0x1ac074){_0x3edf71=_0x1ac074;_0x4124c5=0xc8;}else{_0x4124c5=0xce;}_0x1d15f5[_0x2e83('0x1e')](_0x4124c5);return _0x1d15f5[_0x2e83('0x23')](_0x2e83('0x24'),_0x33a60f+'-'+_0x3edf71+'/'+_0x1ac074)[_0x2e83('0x25')](_0xfb4228);}return null;};}function patchUpdates(_0x52b7e1){return function(_0x1870b0){try{jsonpatch[_0x2e83('0x26')](_0x1870b0,_0x52b7e1,!![]);}catch(_0x284eff){return BPromise['reject'](_0x284eff);}return _0x1870b0[_0x2e83('0x27')]();};}function saveUpdates(_0x2ee45b,_0x514bd7){return function(_0x3b2886){if(_0x3b2886){return _0x3b2886['update'](_0x2ee45b)[_0x2e83('0x28')](function(_0x2ef454){return _0x2ef454;});}return null;};}function removeEntity(_0x89dfc5,_0x43c633){return function(_0xa14894){if(_0xa14894){return _0xa14894[_0x2e83('0x29')]()[_0x2e83('0x28')](function(){_0x89dfc5[_0x2e83('0x1e')](0xcc)[_0x2e83('0x2a')]();});}};}function handleEntityNotFound(_0x31ab95,_0x294859){return function(_0x454bb2){if(!_0x454bb2){_0x31ab95['sendStatus'](0x194);}return _0x454bb2;};}function handleError(_0x125f67,_0x7d16b2){_0x7d16b2=_0x7d16b2||0x1f4;return function(_0x130ab6){logger['error'](_0x130ab6[_0x2e83('0x2b')]);if(_0x130ab6['name']){delete _0x130ab6['name'];}_0x125f67[_0x2e83('0x1e')](_0x7d16b2)[_0x2e83('0x2c')](_0x130ab6);};}exports[_0x2e83('0x2d')]=function(_0x5abadd,_0x2cc633){var _0x2bf140={},_0x3bcea8={},_0x17cc50={'count':0x0,'rows':[]};var _0x161a58=_[_0x2e83('0x2e')](db[_0x2e83('0x2f')]['rawAttributes'],function(_0x157eac){return{'name':_0x157eac[_0x2e83('0x30')],'type':_0x157eac[_0x2e83('0x31')][_0x2e83('0x32')]};});_0x3bcea8['model']=_['map'](_0x161a58,_0x2e83('0x33'));_0x3bcea8[_0x2e83('0x34')]=_[_0x2e83('0x35')](_0x5abadd['query']);_0x3bcea8[_0x2e83('0x36')]=_['intersection'](_0x3bcea8[_0x2e83('0x37')],_0x3bcea8['query']);_0x2bf140['attributes']=_[_0x2e83('0x38')](_0x3bcea8[_0x2e83('0x37')],qs[_0x2e83('0x39')](_0x5abadd[_0x2e83('0x34')][_0x2e83('0x39')]));_0x2bf140[_0x2e83('0x3a')]=_0x2bf140[_0x2e83('0x3a')]['length']?_0x2bf140[_0x2e83('0x3a')]:_0x3bcea8['model'];if(!_0x5abadd[_0x2e83('0x34')][_0x2e83('0x3b')](_0x2e83('0x3c'))){_0x2bf140[_0x2e83('0x22')]=qs[_0x2e83('0x22')](_0x5abadd[_0x2e83('0x34')][_0x2e83('0x22')]);_0x2bf140[_0x2e83('0x1f')]=qs[_0x2e83('0x1f')](_0x5abadd[_0x2e83('0x34')]['offset']);}_0x2bf140[_0x2e83('0x3d')]=qs[_0x2e83('0x3e')](_0x5abadd[_0x2e83('0x34')][_0x2e83('0x3e')]);_0x2bf140[_0x2e83('0x3f')]=qs[_0x2e83('0x36')](_[_0x2e83('0x40')](_0x5abadd[_0x2e83('0x34')],_0x3bcea8[_0x2e83('0x36')]),_0x161a58);if(_0x5abadd['query']['filter']){_0x2bf140[_0x2e83('0x3f')]=_[_0x2e83('0x41')](_0x2bf140[_0x2e83('0x3f')],{'$or':_[_0x2e83('0x2e')](_0x161a58,function(_0x308866){if(_0x308866[_0x2e83('0x31')]!=='VIRTUAL'){var _0x32e906={};_0x32e906[_0x308866[_0x2e83('0x33')]]={'$like':'%'+_0x5abadd[_0x2e83('0x34')][_0x2e83('0x42')]+'%'};return _0x32e906;}})});}_0x2bf140=_[_0x2e83('0x41')]({},_0x2bf140,_0x5abadd['options']);var _0x200fb4={'where':_0x2bf140[_0x2e83('0x3f')]};return db[_0x2e83('0x2f')]['count'](_0x200fb4)[_0x2e83('0x28')](function(_0x378033){_0x17cc50['count']=_0x378033;if(_0x5abadd[_0x2e83('0x34')]['includeAll']){_0x2bf140[_0x2e83('0x43')]=[{'all':!![]}];}return db['UserProfileSection'][_0x2e83('0x44')](_0x2bf140);})[_0x2e83('0x28')](function(_0x4260ce){_0x17cc50[_0x2e83('0x45')]=_0x4260ce;return _0x17cc50;})['then'](respondWithFilteredResult(_0x2cc633,_0x2bf140))[_0x2e83('0x46')](handleError(_0x2cc633,null));};exports['show']=function(_0x2c331f,_0x4b8801){var _0x575196={'raw':![],'where':{'id':_0x2c331f[_0x2e83('0x47')]['id']}},_0x5951f6={};_0x5951f6[_0x2e83('0x37')]=_[_0x2e83('0x35')](db[_0x2e83('0x2f')][_0x2e83('0x48')]);_0x5951f6[_0x2e83('0x34')]=_[_0x2e83('0x35')](_0x2c331f['query']);_0x5951f6[_0x2e83('0x36')]=_[_0x2e83('0x38')](_0x5951f6[_0x2e83('0x37')],_0x5951f6['query']);_0x575196[_0x2e83('0x3a')]=_['intersection'](_0x5951f6[_0x2e83('0x37')],qs[_0x2e83('0x39')](_0x2c331f['query'][_0x2e83('0x39')]));_0x575196[_0x2e83('0x3a')]=_0x575196['attributes'][_0x2e83('0x49')]?_0x575196[_0x2e83('0x3a')]:_0x5951f6[_0x2e83('0x37')];if(_0x2c331f['query'][_0x2e83('0x4a')]){_0x575196[_0x2e83('0x43')]=[{'all':!![]}];}_0x575196=_['merge']({},_0x575196,_0x2c331f[_0x2e83('0x4b')]);return db[_0x2e83('0x2f')][_0x2e83('0x4c')](_0x575196)[_0x2e83('0x28')](handleEntityNotFound(_0x4b8801,null))[_0x2e83('0x28')](respondWithResult(_0x4b8801,null))['catch'](handleError(_0x4b8801,null));};exports[_0x2e83('0x4d')]=function(_0x55516c,_0x2807ce){return db[_0x2e83('0x2f')]['create'](_0x55516c[_0x2e83('0x4e')],{})['then'](respondWithResult(_0x2807ce,0xc9))['catch'](handleError(_0x2807ce,null));};exports['update']=function(_0xcb651a,_0x30db68){if(_0xcb651a[_0x2e83('0x4e')]['id']){delete _0xcb651a[_0x2e83('0x4e')]['id'];}return db[_0x2e83('0x2f')][_0x2e83('0x4c')]({'where':{'id':_0xcb651a['params']['id']}})['then'](handleEntityNotFound(_0x30db68,null))[_0x2e83('0x28')](saveUpdates(_0xcb651a['body'],null))[_0x2e83('0x28')](respondWithResult(_0x30db68,null))[_0x2e83('0x46')](handleError(_0x30db68,null));};exports[_0x2e83('0x29')]=function(_0x55709c,_0x2e2d7a){return db[_0x2e83('0x2f')][_0x2e83('0x4c')]({'where':{'id':_0x55709c['params']['id']}})[_0x2e83('0x28')](handleEntityNotFound(_0x2e2d7a,null))['then'](removeEntity(_0x2e2d7a,null))[_0x2e83('0x46')](handleError(_0x2e2d7a,null));};exports['describe']=function(_0x1f5888,_0x4664ce){return db[_0x2e83('0x2f')][_0x2e83('0x4f')]()['then'](respondWithResult(_0x4664ce,null))[_0x2e83('0x46')](handleError(_0x4664ce,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d385975..a398ebf 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 _0x3ba7=['moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3ba7,0x16c));var _0x73ba=function(_0xe06841,_0x5a1a51){_0xe06841=_0xe06841-0x0;var _0x19d3bb=_0x3ba7[_0xe06841];return _0x19d3bb;};'use strict';var _=require(_0x73ba('0x0'));var util=require(_0x73ba('0x1'));var logger=require(_0x73ba('0x2'))(_0x73ba('0x3'));var moment=require(_0x73ba('0x4'));var BPromise=require(_0x73ba('0x5'));var rp=require(_0x73ba('0x6'));var fs=require('fs');var path=require(_0x73ba('0x7'));var rimraf=require(_0x73ba('0x8'));var config=require('../../config/environment');var attributes=require(_0x73ba('0x9'));module[_0x73ba('0xa')]=function(_0x2014fb,_0x15b550){return _0x2014fb[_0x73ba('0xb')](_0x73ba('0xc'),attributes,{'tableName':_0x73ba('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x73ba('0xe'),_0x73ba('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf9a=['sectionId','userProfileId','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x2a31b9,_0x4a634d){var _0x5cda05=function(_0x5d0c0c){while(--_0x5d0c0c){_0x2a31b9['push'](_0x2a31b9['shift']());}};_0x5cda05(++_0x4a634d);}(_0xcf9a,0x122));var _0xacf9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcf9a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xacf9('0x0'));var util=require('util');var logger=require(_0xacf9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xacf9('0x2'));var rp=require(_0xacf9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacf9('0x4'));var config=require(_0xacf9('0x5'));var attributes=require(_0xacf9('0x6'));module[_0xacf9('0x7')]=function(_0x13d338,_0x51436a){return _0x13d338['define'](_0xacf9('0x8'),attributes,{'tableName':_0xacf9('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xacf9('0xa'),_0xacf9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 06473da..3f3e233 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 _0x3436=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x3436,0x192));var _0x6343=function(_0x43248e,_0x562773){_0x43248e=_0x43248e-0x0;var _0x2c042d=_0x3436[_0x43248e];return _0x2c042d;};'use strict';var _=require(_0x6343('0x0'));var util=require(_0x6343('0x1'));var moment=require('moment');var BPromise=require(_0x6343('0x2'));var rs=require(_0x6343('0x3'));var fs=require('fs');var Redis=require(_0x6343('0x4'));var db=require(_0x6343('0x5'))['db'];var utils=require(_0x6343('0x6'));var logger=require(_0x6343('0x7'))(_0x6343('0x8'));var config=require('../../config/environment');var jayson=require(_0x6343('0x9'));var client=jayson[_0x6343('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492c2d,_0x505d7e,_0x4d42e0){return new BPromise(function(_0x2bd211,_0x575309){return client['request'](_0x492c2d,_0x4d42e0)[_0x6343('0xb')](function(_0x198421){logger['info'](_0x6343('0xc'),_0x505d7e,_0x6343('0xd'));logger['debug'](_0x6343('0xe'),_0x505d7e,'request\x20sent',JSON[_0x6343('0xf')](_0x198421));if(_0x198421[_0x6343('0x10')]){if(_0x198421[_0x6343('0x10')]['code']===0x1f4){logger['error'](_0x6343('0xc'),_0x505d7e,_0x198421[_0x6343('0x10')]['message']);return _0x575309(_0x198421[_0x6343('0x10')]['message']);}logger[_0x6343('0x10')](_0x6343('0xc'),_0x505d7e,_0x198421[_0x6343('0x10')][_0x6343('0x11')]);return _0x2bd211(_0x198421[_0x6343('0x10')][_0x6343('0x11')]);}else{logger[_0x6343('0x12')](_0x6343('0xc'),_0x505d7e,'request\x20sent');_0x2bd211(_0x198421[_0x6343('0x13')][_0x6343('0x11')]);}})[_0x6343('0x14')](function(_0x3999ad){logger[_0x6343('0x10')](_0x6343('0xc'),_0x505d7e,_0x3999ad);_0x575309(_0x3999ad);});});} \ No newline at end of file +var _0xe345=['http','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','UserProfileSection,\x20%s,\x20%s','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x5f4d4f,_0x1454f8){var _0x1b93bd=function(_0x407014){while(--_0x407014){_0x5f4d4f['push'](_0x5f4d4f['shift']());}};_0x1b93bd(++_0x1454f8);}(_0xe345,0x99));var _0x5e34=function(_0xee2e7a,_0x58354d){_0xee2e7a=_0xee2e7a-0x0;var _0x319dd3=_0xe345[_0xee2e7a];return _0x319dd3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5e34('0x0'));var BPromise=require('bluebird');var rs=require(_0x5e34('0x1'));var fs=require('fs');var Redis=require(_0x5e34('0x2'));var db=require(_0x5e34('0x3'))['db'];var utils=require(_0x5e34('0x4'));var logger=require('../../config/logger')(_0x5e34('0x5'));var config=require('../../config/environment');var jayson=require(_0x5e34('0x6'));var client=jayson['client'][_0x5e34('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7f4fcc,_0x1a7ca1,_0x1dc37f){return new BPromise(function(_0x786ddd,_0x1424d1){return client['request'](_0x7f4fcc,_0x1dc37f)['then'](function(_0x4b2a45){logger[_0x5e34('0x8')]('UserProfileSection,\x20%s,\x20%s',_0x1a7ca1,_0x5e34('0x9'));logger['debug'](_0x5e34('0xa'),_0x1a7ca1,_0x5e34('0x9'),JSON['stringify'](_0x4b2a45));if(_0x4b2a45[_0x5e34('0xb')]){if(_0x4b2a45[_0x5e34('0xb')][_0x5e34('0xc')]===0x1f4){logger['error'](_0x5e34('0xd'),_0x1a7ca1,_0x4b2a45[_0x5e34('0xb')][_0x5e34('0xe')]);return _0x1424d1(_0x4b2a45[_0x5e34('0xb')]['message']);}logger['error'](_0x5e34('0xd'),_0x1a7ca1,_0x4b2a45[_0x5e34('0xb')][_0x5e34('0xe')]);return _0x786ddd(_0x4b2a45['error'][_0x5e34('0xe')]);}else{logger[_0x5e34('0x8')](_0x5e34('0xd'),_0x1a7ca1,_0x5e34('0x9'));_0x786ddd(_0x4b2a45[_0x5e34('0xf')][_0x5e34('0xe')]);}})['catch'](function(_0x1c78c2){logger[_0x5e34('0xb')](_0x5e34('0xd'),_0x1a7ca1,_0x1c78c2);_0x1424d1(_0x1c78c2);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index ea745e2..d8e5871 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(_0xf441b6,_0x484362){var _0x4ab58f=function(_0x3a3bb0){while(--_0x3a3bb0){_0xf441b6['push'](_0xf441b6['shift']());}};_0x4ab58f(++_0x484362);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4f4de2,_0x257b5d){var _0x1cbf3a=function(_0x68163){while(--_0x68163){_0x4f4de2['push'](_0x4f4de2['shift']());}};_0x1cbf3a(++_0x257b5d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index da2de2f..78e292a 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 _0x4b36=['exports','sequelize'];(function(_0x300383,_0x4c1fb3){var _0x3c95e8=function(_0x2a76eb){while(--_0x2a76eb){_0x300383['push'](_0x300383['shift']());}};_0x3c95e8(++_0x4c1fb3);}(_0x4b36,0x14f));var _0x64b3=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x4b36[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x64b3('0x0'));module[_0x64b3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8a62=['sequelize','exports'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x8a62,0x130));var _0x28a6=function(_0x20ba46,_0x31c4aa){_0x20ba46=_0x20ba46-0x0;var _0x1e8801=_0x8a62[_0x20ba46];return _0x1e8801;};'use strict';var Sequelize=require(_0x28a6('0x0'));module[_0x28a6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 8efa82b..749611b 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 _0x5fdc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x303c8c,_0x503d95){var _0x298a23=function(_0x15c856){while(--_0x15c856){_0x303c8c['push'](_0x303c8c['shift']());}};_0x298a23(++_0x503d95);}(_0x5fdc,0x127));var _0xc5fd=function(_0x5e0f09,_0x4459c9){_0x5e0f09=_0x5e0f09-0x0;var _0x2e471a=_0x5fdc[_0x5e0f09];return _0x2e471a;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var logger=require(_0xc5fd('0x2'))(_0xc5fd('0x3'));var moment=require(_0xc5fd('0x4'));var BPromise=require(_0xc5fd('0x5'));var rp=require(_0xc5fd('0x6'));var fs=require('fs');var path=require(_0xc5fd('0x7'));var rimraf=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var attributes=require(_0xc5fd('0xa'));module[_0xc5fd('0xb')]=function(_0x44722b,_0x216902){return _0x44722b[_0xc5fd('0xc')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a55=['define','UserSmsQueue','user_has_sms_queues','lodash','moment','path','../../config/environment','exports'];(function(_0x550e96,_0x4e6ec4){var _0x2f1d44=function(_0x1a805f){while(--_0x1a805f){_0x550e96['push'](_0x550e96['shift']());}};_0x2f1d44(++_0x4e6ec4);}(_0x6a55,0xdb));var _0x56a5=function(_0x1f69bc,_0xaffd71){_0x1f69bc=_0x1f69bc-0x0;var _0x1ac3c5=_0x6a55[_0x1f69bc];return _0x1ac3c5;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x56a5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56a5('0x2'));var rimraf=require('rimraf');var config=require(_0x56a5('0x3'));var attributes=require('./userSmsQueue.attributes');module[_0x56a5('0x4')]=function(_0x380b1b,_0x42d164){return _0x380b1b[_0x56a5('0x5')](_0x56a5('0x6'),attributes,{'tableName':_0x56a5('0x7'),'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 eb59800..5eb5c60 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 _0x1b2f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x1b2f,0x88));var _0xf1b2=function(_0x285ca7,_0x552758){_0x285ca7=_0x285ca7-0x0;var _0x1a9197=_0x1b2f[_0x285ca7];return _0x1a9197;};'use strict';var _=require(_0xf1b2('0x0'));var util=require(_0xf1b2('0x1'));var moment=require(_0xf1b2('0x2'));var BPromise=require(_0xf1b2('0x3'));var rs=require(_0xf1b2('0x4'));var fs=require('fs');var Redis=require(_0xf1b2('0x5'));var db=require(_0xf1b2('0x6'))['db'];var utils=require(_0xf1b2('0x7'));var logger=require(_0xf1b2('0x8'))(_0xf1b2('0x9'));var config=require(_0xf1b2('0xa'));var jayson=require(_0xf1b2('0xb'));var client=jayson[_0xf1b2('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33b604,_0x36fabf,_0x317f2b){return new BPromise(function(_0x5df76a,_0x37fb34){return client[_0xf1b2('0xd')](_0x33b604,_0x317f2b)['then'](function(_0x2b724d){logger['info'](_0xf1b2('0xe'),_0x36fabf,_0xf1b2('0xf'));logger[_0xf1b2('0x10')](_0xf1b2('0x11'),_0x36fabf,_0xf1b2('0xf'),JSON[_0xf1b2('0x12')](_0x2b724d));if(_0x2b724d[_0xf1b2('0x13')]){if(_0x2b724d[_0xf1b2('0x13')]['code']===0x1f4){logger['error'](_0xf1b2('0xe'),_0x36fabf,_0x2b724d['error']['message']);return _0x37fb34(_0x2b724d[_0xf1b2('0x13')][_0xf1b2('0x14')]);}logger[_0xf1b2('0x13')](_0xf1b2('0xe'),_0x36fabf,_0x2b724d[_0xf1b2('0x13')][_0xf1b2('0x14')]);return _0x5df76a(_0x2b724d['error'][_0xf1b2('0x14')]);}else{logger[_0xf1b2('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0x36fabf,_0xf1b2('0xf'));_0x5df76a(_0x2b724d[_0xf1b2('0x16')][_0xf1b2('0x14')]);}})[_0xf1b2('0x17')](function(_0x252760){logger[_0xf1b2('0x13')](_0xf1b2('0xe'),_0x36fabf,_0x252760);_0x37fb34(_0x252760);});});} \ No newline at end of file +var _0xb83d=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','request','then','info'];(function(_0x7abcd6,_0x36548c){var _0x329aea=function(_0x55b0a3){while(--_0x55b0a3){_0x7abcd6['push'](_0x7abcd6['shift']());}};_0x329aea(++_0x36548c);}(_0xb83d,0x116));var _0xdb83=function(_0x22bfbf,_0x101182){_0x22bfbf=_0x22bfbf-0x0;var _0x39b690=_0xb83d[_0x22bfbf];return _0x39b690;};'use strict';var _=require(_0xdb83('0x0'));var util=require(_0xdb83('0x1'));var moment=require(_0xdb83('0x2'));var BPromise=require(_0xdb83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb83('0x4'));var db=require(_0xdb83('0x5'))['db'];var utils=require(_0xdb83('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8ec9cb,_0x2b6a26,_0x174897){return new BPromise(function(_0x27ac87,_0x334cdf){return client[_0xdb83('0x7')](_0x8ec9cb,_0x174897)[_0xdb83('0x8')](function(_0x24a80f){logger[_0xdb83('0x9')](_0xdb83('0xa'),_0x2b6a26,_0xdb83('0xb'));logger[_0xdb83('0xc')](_0xdb83('0xd'),_0x2b6a26,'request\x20sent',JSON[_0xdb83('0xe')](_0x24a80f));if(_0x24a80f[_0xdb83('0xf')]){if(_0x24a80f[_0xdb83('0xf')]['code']===0x1f4){logger[_0xdb83('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x2b6a26,_0x24a80f['error']['message']);return _0x334cdf(_0x24a80f[_0xdb83('0xf')][_0xdb83('0x10')]);}logger[_0xdb83('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x2b6a26,_0x24a80f[_0xdb83('0xf')][_0xdb83('0x10')]);return _0x27ac87(_0x24a80f['error'][_0xdb83('0x10')]);}else{logger[_0xdb83('0x9')]('UserSmsQueue,\x20%s,\x20%s',_0x2b6a26,_0xdb83('0xb'));_0x27ac87(_0x24a80f['result'][_0xdb83('0x10')]);}})[_0xdb83('0x11')](function(_0xf7954b){logger[_0xdb83('0xf')](_0xdb83('0xa'),_0x2b6a26,_0xf7954b);_0x334cdf(_0xf7954b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 764b05f..2cbcc40 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 _0xef12=['INTEGER','sequelize','exports'];(function(_0xdb4955,_0x145b00){var _0x39daf9=function(_0x183327){while(--_0x183327){_0xdb4955['push'](_0xdb4955['shift']());}};_0x39daf9(++_0x145b00);}(_0xef12,0xe8));var _0x2ef1=function(_0x99f296,_0xd901b6){_0x99f296=_0x99f296-0x0;var _0x237bf0=_0xef12[_0x99f296];return _0x237bf0;};'use strict';var Sequelize=require(_0x2ef1('0x0'));module[_0x2ef1('0x1')]={'UserId':{'type':Sequelize[_0x2ef1('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2ef1('0x2')]}}; \ No newline at end of file +var _0x6eef=['sequelize','INTEGER'];(function(_0x19da68,_0x5e9f6f){var _0x44da35=function(_0x4d61f6){while(--_0x4d61f6){_0x19da68['push'](_0x19da68['shift']());}};_0x44da35(++_0x5e9f6f);}(_0x6eef,0x1f2));var _0xf6ee=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x6eef[_0xf73c09];return _0xa8923c;};'use strict';var Sequelize=require(_0xf6ee('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xf6ee('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xf6ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c7da336..a91a14f 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(_0xdc5897,_0x19b34d){var _0x3a859d=function(_0x344bd9){while(--_0x344bd9){_0xdc5897['push'](_0xdc5897['shift']());}};_0x3a859d(++_0x19b34d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x5db783,_0x2ae15b){var _0xfa92d3=function(_0x5b8be6){while(--_0x5b8be6){_0x5db783['push'](_0x5db783['shift']());}};_0xfa92d3(++_0x2ae15b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 2b660f9..1d7bce6 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x426c27,_0x3f295f){var _0x496a1f=function(_0x20d4a9){while(--_0x20d4a9){_0x426c27['push'](_0x426c27['shift']());}};_0x496a1f(++_0x3f295f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0xcb91[_0x1afabf];return _0x497ff1;};'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(_0xe5b1ef,_0x28b5a6){var _0x313277=function(_0x17327c){while(--_0x17327c){_0xe5b1ef['push'](_0xe5b1ef['shift']());}};_0x313277(++_0x28b5a6);}(_0xe706,0xa3));var _0x6e70=function(_0x20713e,_0x44f710){_0x20713e=_0x20713e-0x0;var _0x7d998b=_0xe706[_0x20713e];return _0x7d998b;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 263d74a..09de85f 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 _0x1b9c=['exports','sequelize'];(function(_0x450e47,_0x2b0ba4){var _0x342bc5=function(_0x3708d5){while(--_0x3708d5){_0x450e47['push'](_0x450e47['shift']());}};_0x342bc5(++_0x2b0ba4);}(_0x1b9c,0x1ad));var _0xc1b9=function(_0x3fe87c,_0x437400){_0x3fe87c=_0x3fe87c-0x0;var _0xd9bc3e=_0x1b9c[_0x3fe87c];return _0xd9bc3e;};'use strict';var Sequelize=require(_0xc1b9('0x0'));module[_0xc1b9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a9e=['sequelize','exports','INTEGER'];(function(_0x4789cd,_0x1d18d6){var _0x39f810=function(_0x2bee8b){while(--_0x2bee8b){_0x4789cd['push'](_0x4789cd['shift']());}};_0x39f810(++_0x1d18d6);}(_0x0a9e,0x1c5));var _0xe0a9=function(_0x5f22c3,_0x14249e){_0x5f22c3=_0x5f22c3-0x0;var _0x33d928=_0x0a9e[_0x5f22c3];return _0x33d928;};'use strict';var Sequelize=require(_0xe0a9('0x0'));module[_0xe0a9('0x1')]={'penalty':{'type':Sequelize[_0xe0a9('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 3188ce6..48b1eae 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 _0x861d=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues'];(function(_0x2622c2,_0x53a1af){var _0x3325f9=function(_0x10bb23){while(--_0x10bb23){_0x2622c2['push'](_0x2622c2['shift']());}};_0x3325f9(++_0x53a1af);}(_0x861d,0x150));var _0xd861=function(_0x565dfa,_0x5ca74b){_0x565dfa=_0x565dfa-0x0;var _0x3d8102=_0x861d[_0x565dfa];return _0x3d8102;};'use strict';var _=require(_0xd861('0x0'));var util=require(_0xd861('0x1'));var logger=require(_0xd861('0x2'))(_0xd861('0x3'));var moment=require(_0xd861('0x4'));var BPromise=require('bluebird');var rp=require(_0xd861('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd861('0x6'));var config=require(_0xd861('0x7'));var attributes=require(_0xd861('0x8'));module[_0xd861('0x9')]=function(_0x22879f,_0x3b4870){return _0x22879f[_0xd861('0xa')]('UserVoiceQueue',attributes,{'tableName':_0xd861('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a08=['bluebird','request-promise','path','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x333030,_0x46e246){var _0x2638a4=function(_0x5c510f){while(--_0x5c510f){_0x333030['push'](_0x333030['shift']());}};_0x2638a4(++_0x46e246);}(_0x1a08,0x11b));var _0x81a0=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x1a08[_0x26da89];return _0xc95b7b;};'use strict';var _=require(_0x81a0('0x0'));var util=require(_0x81a0('0x1'));var logger=require(_0x81a0('0x2'))(_0x81a0('0x3'));var moment=require(_0x81a0('0x4'));var BPromise=require(_0x81a0('0x5'));var rp=require(_0x81a0('0x6'));var fs=require('fs');var path=require(_0x81a0('0x7'));var rimraf=require('rimraf');var config=require(_0x81a0('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x81a0('0x9')]=function(_0x244d09,_0x4c52a0){return _0x244d09['define'](_0x81a0('0xa'),attributes,{'tableName':_0x81a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 0eb19bd..ea55b85 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 _0xccb2=['rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x109340,_0x376092){var _0x461a3a=function(_0x1c6d05){while(--_0x1c6d05){_0x109340['push'](_0x109340['shift']());}};_0x461a3a(++_0x376092);}(_0xccb2,0xa2));var _0x2ccb=function(_0x547599,_0x279866){_0x547599=_0x547599-0x0;var _0x3506bc=_0xccb2[_0x547599];return _0x3506bc;};'use strict';var _=require(_0x2ccb('0x0'));var util=require('util');var moment=require(_0x2ccb('0x1'));var BPromise=require(_0x2ccb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ccb('0x3'))['db'];var utils=require(_0x2ccb('0x4'));var logger=require(_0x2ccb('0x5'))(_0x2ccb('0x6'));var config=require(_0x2ccb('0x7'));var jayson=require(_0x2ccb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9e21,_0xcd6acb,_0x5eab88){return new BPromise(function(_0x1d74b8,_0x366072){return client[_0x2ccb('0x9')](_0x1c9e21,_0x5eab88)['then'](function(_0x3e2759){logger[_0x2ccb('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0xcd6acb,_0x2ccb('0xb'));logger[_0x2ccb('0xc')](_0x2ccb('0xd'),_0xcd6acb,'request\x20sent',JSON[_0x2ccb('0xe')](_0x3e2759));if(_0x3e2759[_0x2ccb('0xf')]){if(_0x3e2759['error'][_0x2ccb('0x10')]===0x1f4){logger[_0x2ccb('0xf')](_0x2ccb('0x11'),_0xcd6acb,_0x3e2759[_0x2ccb('0xf')]['message']);return _0x366072(_0x3e2759[_0x2ccb('0xf')][_0x2ccb('0x12')]);}logger[_0x2ccb('0xf')](_0x2ccb('0x11'),_0xcd6acb,_0x3e2759[_0x2ccb('0xf')][_0x2ccb('0x12')]);return _0x1d74b8(_0x3e2759['error'][_0x2ccb('0x12')]);}else{logger[_0x2ccb('0xa')](_0x2ccb('0x11'),_0xcd6acb,_0x2ccb('0xb'));_0x1d74b8(_0x3e2759[_0x2ccb('0x13')][_0x2ccb('0x12')]);}})[_0x2ccb('0x14')](function(_0xbb85d6){logger[_0x2ccb('0xf')](_0x2ccb('0x11'),_0xcd6acb,_0xbb85d6);_0x366072(_0xbb85d6);});});} \ No newline at end of file +var _0x6f40=['request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3945d9,_0x111c71){var _0xd4e494=function(_0x3f6369){while(--_0x3f6369){_0x3945d9['push'](_0x3945d9['shift']());}};_0xd4e494(++_0x111c71);}(_0x6f40,0x1c0));var _0x06f4=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0x6f40[_0x5ba549];return _0x36e3a1;};'use strict';var _=require('lodash');var util=require(_0x06f4('0x0'));var moment=require(_0x06f4('0x1'));var BPromise=require(_0x06f4('0x2'));var rs=require(_0x06f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x06f4('0x5'))(_0x06f4('0x6'));var config=require('../../config/environment');var jayson=require(_0x06f4('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x375368,_0x519a8b,_0x319817){return new BPromise(function(_0x154c55,_0x26c108){return client[_0x06f4('0x8')](_0x375368,_0x319817)[_0x06f4('0x9')](function(_0x3ada7f){logger['info'](_0x06f4('0xa'),_0x519a8b,_0x06f4('0xb'));logger[_0x06f4('0xc')](_0x06f4('0xd'),_0x519a8b,_0x06f4('0xb'),JSON[_0x06f4('0xe')](_0x3ada7f));if(_0x3ada7f[_0x06f4('0xf')]){if(_0x3ada7f[_0x06f4('0xf')]['code']===0x1f4){logger[_0x06f4('0xf')](_0x06f4('0xa'),_0x519a8b,_0x3ada7f[_0x06f4('0xf')][_0x06f4('0x10')]);return _0x26c108(_0x3ada7f[_0x06f4('0xf')]['message']);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x519a8b,_0x3ada7f[_0x06f4('0xf')][_0x06f4('0x10')]);return _0x154c55(_0x3ada7f[_0x06f4('0xf')][_0x06f4('0x10')]);}else{logger[_0x06f4('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x519a8b,_0x06f4('0xb'));_0x154c55(_0x3ada7f['result'][_0x06f4('0x10')]);}})[_0x06f4('0x12')](function(_0xb015f4){logger[_0x06f4('0xf')](_0x06f4('0xa'),_0x519a8b,_0xb015f4);_0x26c108(_0xb015f4);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index d3fb27c..c94d6b0 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(_0x3726a1,_0xa80e67){var _0x592991=function(_0x10afce){while(--_0x10afce){_0x3726a1['push'](_0x3726a1['shift']());}};_0x592991(++_0xa80e67);}(_0xe706,0xa3));var _0x6e70=function(_0x4d30c0,_0x3a0ae7){_0x4d30c0=_0x4d30c0-0x0;var _0x5b0c2e=_0xe706[_0x4d30c0];return _0x5b0c2e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x393438,_0x4883a6){var _0x2a0986=function(_0x15a93b){while(--_0x15a93b){_0x393438['push'](_0x393438['shift']());}};_0x2a0986(++_0x4883a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index f42a9a2..b8fd9b8 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 _0x204b=['STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER'];(function(_0x230bb8,_0xa1718){var _0x16cb9a=function(_0x2848fe){while(--_0x2848fe){_0x230bb8['push'](_0x230bb8['shift']());}};_0x16cb9a(++_0xa1718);}(_0x204b,0x6f));var _0xb204=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x204b[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0xb204('0x0'));module[_0xb204('0x1')]={'uniqueid':{'type':Sequelize[_0xb204('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xb204('0x3')],'allowNull':![],'comment':_0xb204('0x4')},'UserId':{'type':Sequelize[_0xb204('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb204('0x3')],'allowNull':![],'unique':_0xb204('0x5'),'comment':_0xb204('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb204('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb204('0x5'),'comment':_0xb204('0x4')},'penalty':{'type':Sequelize[_0xb204('0x2')](0xb),'defaultValue':0x0,'comment':_0xb204('0x4')},'paused':{'type':Sequelize[_0xb204('0x2')](0xb),'defaultValue':0x0,'comment':_0xb204('0x4')}}; \ No newline at end of file +var _0xfcbd=['INTEGER','queue_interface','sequelize','Required\x20by\x20Asterisk','STRING'];(function(_0x465534,_0x69e825){var _0x305d32=function(_0x382595){while(--_0x382595){_0x465534['push'](_0x465534['shift']());}};_0x305d32(++_0x69e825);}(_0xfcbd,0x160));var _0xdfcb=function(_0x106999,_0x32e943){_0x106999=_0x106999-0x0;var _0x2f8661=_0xfcbd[_0x106999];return _0x2f8661;};'use strict';var Sequelize=require(_0xdfcb('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xdfcb('0x1')},'membername':{'type':Sequelize[_0xdfcb('0x2')],'allowNull':![],'comment':_0xdfcb('0x1')},'UserId':{'type':Sequelize[_0xdfcb('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdfcb('0x2')],'allowNull':![],'unique':_0xdfcb('0x4'),'comment':_0xdfcb('0x1')},'VoiceQueueId':{'type':Sequelize[_0xdfcb('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xdfcb('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xdfcb('0x3')](0xb),'defaultValue':0x0,'comment':_0xdfcb('0x1')},'paused':{'type':Sequelize[_0xdfcb('0x3')](0xb),'defaultValue':0x0,'comment':_0xdfcb('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 2ab4f03..3fbe3f9 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 _0x0ebe=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x33ff0c,_0x448c2a){var _0x44bdc2=function(_0x4f8652){while(--_0x4f8652){_0x33ff0c['push'](_0x33ff0c['shift']());}};_0x44bdc2(++_0x448c2a);}(_0x0ebe,0x157));var _0xe0eb=function(_0x308557,_0x31eeec){_0x308557=_0x308557-0x0;var _0x3fd626=_0x0ebe[_0x308557];return _0x3fd626;};'use strict';var EventEmitter=require(_0xe0eb('0x0'));var UserVoiceQueueRt=require(_0xe0eb('0x1'))['db'][_0xe0eb('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe0eb('0x3')](0x0);var events={'afterCreate':_0xe0eb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2626c1){return function(_0xc4004f,_0x59bd16,_0x34953f){UserVoiceQueueRtEvents[_0xe0eb('0x5')](_0x2626c1+':'+_0xc4004f['id'],_0xc4004f);UserVoiceQueueRtEvents[_0xe0eb('0x5')](_0x2626c1,_0xc4004f);_0x34953f(null);};}for(var e in events){if(events[_0xe0eb('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xe0eb('0x7')](e,emitEvent(event));}}module[_0xe0eb('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x79ed=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x12d5bc,_0x359f4c){var _0xeed31d=function(_0x3e9f21){while(--_0x3e9f21){_0x12d5bc['push'](_0x12d5bc['shift']());}};_0xeed31d(++_0x359f4c);}(_0x79ed,0x99));var _0xd79e=function(_0x4c9814,_0x2d0a17){_0x4c9814=_0x4c9814-0x0;var _0x2d40e4=_0x79ed[_0x4c9814];return _0x2d40e4;};'use strict';var EventEmitter=require(_0xd79e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd79e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd79e('0x2'),'afterDestroy':_0xd79e('0x3')};function emitEvent(_0x4933dc){return function(_0xca3504,_0x2e804c,_0x29f9f9){UserVoiceQueueRtEvents[_0xd79e('0x4')](_0x4933dc+':'+_0xca3504['id'],_0xca3504);UserVoiceQueueRtEvents[_0xd79e('0x4')](_0x4933dc,_0xca3504);_0x29f9f9(null);};}for(var e in events){if(events[_0xd79e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xd79e('0x6')](e,emitEvent(event));}}module[_0xd79e('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 916f84b..fd131f6 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 _0x50e7=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird'];(function(_0x11a534,_0x1d9019){var _0x4f0ed8=function(_0x1a07f5){while(--_0x1a07f5){_0x11a534['push'](_0x11a534['shift']());}};_0x4f0ed8(++_0x1d9019);}(_0x50e7,0x8a));var _0x750e=function(_0x6fc5c8,_0x3cf855){_0x6fc5c8=_0x6fc5c8-0x0;var _0x51303a=_0x50e7[_0x6fc5c8];return _0x51303a;};'use strict';var _=require(_0x750e('0x0'));var util=require(_0x750e('0x1'));var logger=require(_0x750e('0x2'))('api');var moment=require(_0x750e('0x3'));var BPromise=require(_0x750e('0x4'));var rp=require(_0x750e('0x5'));var fs=require('fs');var path=require(_0x750e('0x6'));var rimraf=require(_0x750e('0x7'));var config=require(_0x750e('0x8'));var attributes=require(_0x750e('0x9'));module['exports']=function(_0x349559,_0x48fc36){return _0x349559[_0x750e('0xa')](_0x750e('0xb'),attributes,{'tableName':_0x750e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4de0=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','user_has_voice_queues_rt','../../config/logger','request-promise'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0x4de0,0x10f));var _0x04de=function(_0x44007e,_0x416b44){_0x44007e=_0x44007e-0x0;var _0x3d2d83=_0x4de0[_0x44007e];return _0x3d2d83;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04de('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x04de('0x1'));var fs=require('fs');var path=require(_0x04de('0x2'));var rimraf=require(_0x04de('0x3'));var config=require(_0x04de('0x4'));var attributes=require(_0x04de('0x5'));module['exports']=function(_0x284fe5,_0x39e98c){return _0x284fe5['define']('UserVoiceQueueRt',attributes,{'tableName':_0x04de('0x6'),'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 774f596..d744668 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 _0xfcc2=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','util','bluebird','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x1d36d1,_0x41d0ab){var _0x10d430=function(_0x4db227){while(--_0x4db227){_0x1d36d1['push'](_0x1d36d1['shift']());}};_0x10d430(++_0x41d0ab);}(_0xfcc2,0x131));var _0x2fcc=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0xfcc2[_0x3beea0];return _0x314eb1;};'use strict';var _=require('lodash');var util=require(_0x2fcc('0x0'));var moment=require('moment');var BPromise=require(_0x2fcc('0x1'));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(_0x2fcc('0x2'))('rpc');var config=require(_0x2fcc('0x3'));var jayson=require(_0x2fcc('0x4'));var client=jayson[_0x2fcc('0x5')]['http']({'port':0x232a});config[_0x2fcc('0x6')]=_['defaults'](config['redis'],{'host':_0x2fcc('0x7'),'port':0x18eb});var socket=require(_0x2fcc('0x8'))(new Redis(config['redis']));require(_0x2fcc('0x9'))[_0x2fcc('0xa')](socket);function respondWithRpcPromise(_0x4fdf79,_0x41adb1,_0x227216){return new BPromise(function(_0x36a617,_0x43494e){return client[_0x2fcc('0xb')](_0x4fdf79,_0x227216)[_0x2fcc('0xc')](function(_0x3050cb){logger[_0x2fcc('0xd')](_0x2fcc('0xe'),_0x41adb1,_0x2fcc('0xf'));logger[_0x2fcc('0x10')](_0x2fcc('0x11'),_0x41adb1,_0x2fcc('0xf'),JSON[_0x2fcc('0x12')](_0x3050cb));if(_0x3050cb[_0x2fcc('0x13')]){if(_0x3050cb[_0x2fcc('0x13')][_0x2fcc('0x14')]===0x1f4){logger[_0x2fcc('0x13')](_0x2fcc('0xe'),_0x41adb1,_0x3050cb[_0x2fcc('0x13')][_0x2fcc('0x15')]);return _0x43494e(_0x3050cb[_0x2fcc('0x13')][_0x2fcc('0x15')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x41adb1,_0x3050cb['error'][_0x2fcc('0x15')]);return _0x36a617(_0x3050cb['error']['message']);}else{logger[_0x2fcc('0xd')](_0x2fcc('0xe'),_0x41adb1,_0x2fcc('0xf'));_0x36a617(_0x3050cb[_0x2fcc('0x16')][_0x2fcc('0x15')]);}})[_0x2fcc('0x17')](function(_0x2c1034){logger[_0x2fcc('0x13')](_0x2fcc('0xe'),_0x41adb1,_0x2c1034);_0x43494e(_0x2c1034);});});}exports['GetVoiceQueueRtPauses']=function(_0x3bf61c){var _0x403dcd=this;return new Promise(function(_0x426175,_0x215392){return db['UserVoiceQueueRt'][_0x2fcc('0x18')]({'raw':_0x3bf61c['options']?_0x3bf61c[_0x2fcc('0x19')][_0x2fcc('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bf61c[_0x2fcc('0x19')]?_0x3bf61c['options']['where']||null:null,'attributes':[[db[_0x2fcc('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x2fcc('0x1c')](_0x2fcc('0x1d')))),_0x2fcc('0x1e')]]})[_0x2fcc('0xc')](function(_0x4a91aa){logger[_0x2fcc('0xd')](_0x2fcc('0x1f'),_0x3bf61c);logger[_0x2fcc('0x10')](_0x2fcc('0x1f'),_0x3bf61c,JSON['stringify'](_0x4a91aa));_0x426175(_0x4a91aa);})[_0x2fcc('0x17')](function(_0x25685d){logger[_0x2fcc('0x13')]('GetVoiceQueueRtPauses',_0x25685d['message'],_0x3bf61c);_0x215392(_0x403dcd['error'](0x1f4,_0x25685d[_0x2fcc('0x15')]));});});}; \ No newline at end of file +var _0xe55b=['UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug'];(function(_0x484a3e,_0x4c0eda){var _0x29a66a=function(_0x5310c3){while(--_0x5310c3){_0x484a3e['push'](_0x484a3e['shift']());}};_0x29a66a(++_0x4c0eda);}(_0xe55b,0x1b4));var _0xbe55=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0xe55b[_0x47e7dd];return _0x38501f;};'use strict';var _=require(_0xbe55('0x0'));var util=require('util');var moment=require(_0xbe55('0x1'));var BPromise=require(_0xbe55('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe55('0x3'))['db'];var utils=require(_0xbe55('0x4'));var logger=require(_0xbe55('0x5'))(_0xbe55('0x6'));var config=require(_0xbe55('0x7'));var jayson=require(_0xbe55('0x8'));var client=jayson['client'][_0xbe55('0x9')]({'port':0x232a});config[_0xbe55('0xa')]=_[_0xbe55('0xb')](config[_0xbe55('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe55('0xc'))(new Redis(config['redis']));require(_0xbe55('0xd'))[_0xbe55('0xe')](socket);function respondWithRpcPromise(_0x2e716c,_0x37caea,_0x250110){return new BPromise(function(_0xac0d2b,_0x37ab39){return client[_0xbe55('0xf')](_0x2e716c,_0x250110)[_0xbe55('0x10')](function(_0x8597eb){logger[_0xbe55('0x11')](_0xbe55('0x12'),_0x37caea,'request\x20sent');logger[_0xbe55('0x13')](_0xbe55('0x14'),_0x37caea,_0xbe55('0x15'),JSON[_0xbe55('0x16')](_0x8597eb));if(_0x8597eb[_0xbe55('0x17')]){if(_0x8597eb[_0xbe55('0x17')][_0xbe55('0x18')]===0x1f4){logger['error'](_0xbe55('0x12'),_0x37caea,_0x8597eb[_0xbe55('0x17')][_0xbe55('0x19')]);return _0x37ab39(_0x8597eb[_0xbe55('0x17')][_0xbe55('0x19')]);}logger[_0xbe55('0x17')](_0xbe55('0x12'),_0x37caea,_0x8597eb['error']['message']);return _0xac0d2b(_0x8597eb[_0xbe55('0x17')]['message']);}else{logger['info'](_0xbe55('0x12'),_0x37caea,'request\x20sent');_0xac0d2b(_0x8597eb[_0xbe55('0x1a')][_0xbe55('0x19')]);}})[_0xbe55('0x1b')](function(_0x4140d5){logger[_0xbe55('0x17')](_0xbe55('0x12'),_0x37caea,_0x4140d5);_0x37ab39(_0x4140d5);});});}exports[_0xbe55('0x1c')]=function(_0x370fe8){var _0x529be0=this;return new Promise(function(_0x439b24,_0x27ba34){return db[_0xbe55('0x1d')][_0xbe55('0x1e')]({'raw':_0x370fe8[_0xbe55('0x1f')]?_0x370fe8[_0xbe55('0x1f')][_0xbe55('0x20')]===undefined?!![]:![]:!![],'where':_0x370fe8[_0xbe55('0x1f')]?_0x370fe8[_0xbe55('0x1f')]['where']||null:null,'attributes':[[db[_0xbe55('0x21')]['fn'](_0xbe55('0x22'),db[_0xbe55('0x21')]['fn']('IF',db[_0xbe55('0x21')][_0xbe55('0x23')](_0xbe55('0x24')))),_0xbe55('0x25')]]})[_0xbe55('0x10')](function(_0x2d3e6c){logger[_0xbe55('0x11')](_0xbe55('0x1c'),_0x370fe8);logger[_0xbe55('0x13')](_0xbe55('0x1c'),_0x370fe8,JSON['stringify'](_0x2d3e6c));_0x439b24(_0x2d3e6c);})[_0xbe55('0x1b')](function(_0x47f9b3){logger[_0xbe55('0x17')]('GetVoiceQueueRtPauses',_0x47f9b3[_0xbe55('0x19')],_0x370fe8);_0x27ba34(_0x529be0[_0xbe55('0x17')](0x1f4,_0x47f9b3[_0xbe55('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8451a75..39b5454 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 _0xe548=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x11fc47,_0x370085){var _0x55b4dc=function(_0x5cfa1f){while(--_0x5cfa1f){_0x11fc47['push'](_0x11fc47['shift']());}};_0x55b4dc(++_0x370085);}(_0xe548,0x184));var _0x8e54=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xe548[_0x47e549];return _0x251374;};'use strict';var UserVoiceQueueRtEvents=require(_0x8e54('0x0'));var events=[_0x8e54('0x1'),_0x8e54('0x2'),_0x8e54('0x3')];function createListener(_0x8824f6,_0x48a491){return function(_0x5d61b0){_0x48a491['emit'](_0x8824f6,_0x5d61b0);};}function removeListener(_0x4aa36a,_0x4b69ef){return function(){UserVoiceQueueRtEvents[_0x8e54('0x4')](_0x4aa36a,_0x4b69ef);};}exports['register']=function(_0x288be8){for(var _0x47a58d=0x0,_0xc6281c=events[_0x8e54('0x5')];_0x47a58d<_0xc6281c;_0x47a58d++){var _0x148c1f=events[_0x47a58d];var _0x3d6444=createListener(_0x8e54('0x6')+_0x148c1f,_0x288be8);UserVoiceQueueRtEvents['on'](_0x148c1f,_0x3d6444);}}; \ No newline at end of file +var _0xce22=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x56e799,_0x3da71e){var _0x867e83=function(_0x4b4fc4){while(--_0x4b4fc4){_0x56e799['push'](_0x56e799['shift']());}};_0x867e83(++_0x3da71e);}(_0xce22,0xea));var _0x2ce2=function(_0x22dcde,_0x59d94f){_0x22dcde=_0x22dcde-0x0;var _0x74bb55=_0xce22[_0x22dcde];return _0x74bb55;};'use strict';var UserVoiceQueueRtEvents=require(_0x2ce2('0x0'));var events=[_0x2ce2('0x1'),_0x2ce2('0x2'),_0x2ce2('0x3')];function createListener(_0x3a106f,_0x47de4a){return function(_0xd7b953){_0x47de4a['emit'](_0x3a106f,_0xd7b953);};}function removeListener(_0x26b273,_0x1801be){return function(){UserVoiceQueueRtEvents[_0x2ce2('0x4')](_0x26b273,_0x1801be);};}exports[_0x2ce2('0x5')]=function(_0x25110e){for(var _0x29f060=0x0,_0x6515b5=events['length'];_0x29f060<_0x6515b5;_0x29f060++){var _0x225737=events[_0x29f060];var _0x111f56=createListener(_0x2ce2('0x6')+_0x225737,_0x25110e);UserVoiceQueueRtEvents['on'](_0x225737,_0x111f56);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index ea35ec2..98a9640 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ff356,_0x3d6276){var _0x5cbcc7=function(_0x5a3e0d){while(--_0x5a3e0d){_0x3ff356['push'](_0x3ff356['shift']());}};_0x5cbcc7(++_0x3d6276);}(_0xe706,0xa3));var _0x6e70=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xe706[_0x37cc52];return _0x2b4a90;};'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(_0x34b2e5,_0x5ef6a8){var _0x3a9a87=function(_0x161f79){while(--_0x161f79){_0x34b2e5['push'](_0x34b2e5['shift']());}};_0x3a9a87(++_0x5ef6a8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 35695df..fce4622 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 _0x79a8=['sequelize','INTEGER'];(function(_0x15238c,_0x10558a){var _0x1daacf=function(_0x176013){while(--_0x176013){_0x15238c['push'](_0x15238c['shift']());}};_0x1daacf(++_0x10558a);}(_0x79a8,0x1d0));var _0x879a=function(_0x1cb783,_0x197145){_0x1cb783=_0x1cb783-0x0;var _0x4fae14=_0x79a8[_0x1cb783];return _0x4fae14;};'use strict';var Sequelize=require(_0x879a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x879a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc701=['INTEGER','sequelize','exports'];(function(_0x1225fb,_0x1bba6d){var _0x5bcb51=function(_0x440684){while(--_0x440684){_0x1225fb['push'](_0x1225fb['shift']());}};_0x5bcb51(++_0x1bba6d);}(_0xc701,0x82));var _0x1c70=function(_0x4eb42a,_0x2a3195){_0x4eb42a=_0x4eb42a-0x0;var _0x3c6492=_0xc701[_0x4eb42a];return _0x3c6492;};'use strict';var Sequelize=require(_0x1c70('0x0'));module[_0x1c70('0x1')]={'penalty':{'type':Sequelize[_0x1c70('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 aa57d91..fc08b48 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 _0xe6b8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xe6b8,0x1d2));var _0x8e6b=function(_0xe823f,_0x339dd5){_0xe823f=_0xe823f-0x0;var _0x192e57=_0xe6b8[_0xe823f];return _0x192e57;};'use strict';var _=require('lodash');var util=require(_0x8e6b('0x0'));var logger=require(_0x8e6b('0x1'))(_0x8e6b('0x2'));var moment=require(_0x8e6b('0x3'));var BPromise=require(_0x8e6b('0x4'));var rp=require(_0x8e6b('0x5'));var fs=require('fs');var path=require(_0x8e6b('0x6'));var rimraf=require(_0x8e6b('0x7'));var config=require(_0x8e6b('0x8'));var attributes=require(_0x8e6b('0x9'));module['exports']=function(_0x50da5c,_0x468585){return _0x50da5c[_0x8e6b('0xa')](_0x8e6b('0xb'),attributes,{'tableName':_0x8e6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5ec=['path','../../config/environment','./userWhatsappQueue.attributes','user_has_whatsapp_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0xe5ec,0x67));var _0xce5e=function(_0x4b2993,_0xd46430){_0x4b2993=_0x4b2993-0x0;var _0x480074=_0xe5ec[_0x4b2993];return _0x480074;};'use strict';var _=require('lodash');var util=require(_0xce5e('0x0'));var logger=require(_0xce5e('0x1'))(_0xce5e('0x2'));var moment=require(_0xce5e('0x3'));var BPromise=require(_0xce5e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce5e('0x5'));var rimraf=require('rimraf');var config=require(_0xce5e('0x6'));var attributes=require(_0xce5e('0x7'));module['exports']=function(_0x36edd0,_0xadb003){return _0x36edd0['define']('UserWhatsappQueue',attributes,{'tableName':_0xce5e('0x8'),'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 b8b7aa8..42b92df 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 _0x5fc1=['code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x49ca8f,_0xa20902){var _0x3dc6f5=function(_0x3ef96e){while(--_0x3ef96e){_0x49ca8f['push'](_0x49ca8f['shift']());}};_0x3dc6f5(++_0xa20902);}(_0x5fc1,0x17e));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x15fc('0x0'));var util=require('util');var moment=require(_0x15fc('0x1'));var BPromise=require(_0x15fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15fc('0x3'))['db'];var utils=require(_0x15fc('0x4'));var logger=require(_0x15fc('0x5'))(_0x15fc('0x6'));var config=require(_0x15fc('0x7'));var jayson=require(_0x15fc('0x8'));var client=jayson['client'][_0x15fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x526028,_0x4ae268,_0x7c9879){return new BPromise(function(_0x1fb388,_0x1112f0){return client['request'](_0x526028,_0x7c9879)[_0x15fc('0xa')](function(_0x5f972a){logger[_0x15fc('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ae268,_0x15fc('0xc'));logger[_0x15fc('0xd')](_0x15fc('0xe'),_0x4ae268,_0x15fc('0xc'),JSON[_0x15fc('0xf')](_0x5f972a));if(_0x5f972a[_0x15fc('0x10')]){if(_0x5f972a['error'][_0x15fc('0x11')]===0x1f4){logger[_0x15fc('0x10')](_0x15fc('0x12'),_0x4ae268,_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);return _0x1112f0(_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);}logger[_0x15fc('0x10')](_0x15fc('0x12'),_0x4ae268,_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);return _0x1fb388(_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);}else{logger['info'](_0x15fc('0x12'),_0x4ae268,_0x15fc('0xc'));_0x1fb388(_0x5f972a['result'][_0x15fc('0x13')]);}})[_0x15fc('0x14')](function(_0x11fedc){logger[_0x15fc('0x10')](_0x15fc('0x12'),_0x4ae268,_0x11fedc);_0x1112f0(_0x11fedc);});});} \ No newline at end of file +var _0xaa8f=['request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x1c7f01,_0x16c2c4){var _0x6028ea=function(_0x3201b0){while(--_0x3201b0){_0x1c7f01['push'](_0x1c7f01['shift']());}};_0x6028ea(++_0x16c2c4);}(_0xaa8f,0x1bf));var _0xfaa8=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xaa8f[_0x168127];return _0x4c99ad;};'use strict';var _=require('lodash');var util=require(_0xfaa8('0x0'));var moment=require(_0xfaa8('0x1'));var BPromise=require('bluebird');var rs=require(_0xfaa8('0x2'));var fs=require('fs');var Redis=require(_0xfaa8('0x3'));var db=require(_0xfaa8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaa8('0x5'))('rpc');var config=require(_0xfaa8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfaa8('0x7')][_0xfaa8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x357d8e,_0x3ca04b,_0xd26800){return new BPromise(function(_0x293343,_0x34e8c0){return client[_0xfaa8('0x9')](_0x357d8e,_0xd26800)['then'](function(_0x4dc052){logger[_0xfaa8('0xa')](_0xfaa8('0xb'),_0x3ca04b,_0xfaa8('0xc'));logger[_0xfaa8('0xd')](_0xfaa8('0xe'),_0x3ca04b,_0xfaa8('0xc'),JSON[_0xfaa8('0xf')](_0x4dc052));if(_0x4dc052['error']){if(_0x4dc052[_0xfaa8('0x10')][_0xfaa8('0x11')]===0x1f4){logger[_0xfaa8('0x10')](_0xfaa8('0xb'),_0x3ca04b,_0x4dc052['error'][_0xfaa8('0x12')]);return _0x34e8c0(_0x4dc052['error']['message']);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x3ca04b,_0x4dc052[_0xfaa8('0x10')]['message']);return _0x293343(_0x4dc052[_0xfaa8('0x10')][_0xfaa8('0x12')]);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x3ca04b,_0xfaa8('0xc'));_0x293343(_0x4dc052['result'][_0xfaa8('0x12')]);}})['catch'](function(_0x2aae97){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x3ca04b,_0x2aae97);_0x34e8c0(_0x2aae97);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 60b34be..c73aebd 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 _0x9ffd=['isAuthenticated','get','/:id','show','post','create','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x462582,_0x279982){var _0x176aac=function(_0xc93667){while(--_0xc93667){_0x462582['push'](_0x462582['shift']());}};_0x176aac(++_0x279982);}(_0x9ffd,0x1d7));var _0xd9ff=function(_0x3ac567,_0x11009f){_0x3ac567=_0x3ac567-0x0;var _0x36e6f1=_0x9ffd[_0x3ac567];return _0x36e6f1;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require(_0xd9ff('0x3'));var express=require('express');var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var controller=require('./variable.controller');router['get']('/',auth[_0xd9ff('0x9')](),controller['index']);router[_0xd9ff('0xa')](_0xd9ff('0xb'),auth['isAuthenticated'](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0xd')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xe')]);router['put'](_0xd9ff('0xb'),auth[_0xd9ff('0x9')](),controller['update']);router[_0xd9ff('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc2cc=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','post','put','/:id','update','delete','destroy'];(function(_0x1b861a,_0x3506c1){var _0x4e58db=function(_0x3ecc42){while(--_0x3ecc42){_0x1b861a['push'](_0x1b861a['shift']());}};_0x4e58db(++_0x3506c1);}(_0xc2cc,0x70));var _0xcc2c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc2cc[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0xcc2c('0x0'));var path=require(_0xcc2c('0x1'));var timeout=require(_0xcc2c('0x2'));var express=require('express');var router=express[_0xcc2c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcc2c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcc2c('0x5'));var controller=require('./variable.controller');router[_0xcc2c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcc2c('0x6')]('/:id',auth[_0xcc2c('0x7')](),controller['show']);router[_0xcc2c('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcc2c('0x9')](_0xcc2c('0xa'),auth[_0xcc2c('0x7')](),controller[_0xcc2c('0xb')]);router[_0xcc2c('0xc')](_0xcc2c('0xa'),auth[_0xcc2c('0x7')](),controller[_0xcc2c('0xd')]);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 93f5a3f..c067114 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 _0x59ad=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59ad,0xee));var _0xd59a=function(_0x5cc0ab,_0x1e3097){_0x5cc0ab=_0x5cc0ab-0x0;var _0x5de250=_0x59ad[_0x5cc0ab];return _0x5de250;};'use strict';var Sequelize=require(_0xd59a('0x0'));module[_0xd59a('0x1')]={'name':{'type':Sequelize[_0xd59a('0x2')],'unique':_0xd59a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd59a('0x2')]}}; \ No newline at end of file +var _0x4c35=['exports','name'];(function(_0x5cf224,_0x522188){var _0x3d09c0=function(_0x22a5fe){while(--_0x22a5fe){_0x5cf224['push'](_0x5cf224['shift']());}};_0x3d09c0(++_0x522188);}(_0x4c35,0xd4));var _0x54c3=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x4c35[_0x737a1f];return _0x16eba1;};'use strict';var Sequelize=require('sequelize');module[_0x54c3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x54c3('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 1b735c9..d4b2eb6 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 _0xa7c4=['include','findAll','rows','params','model','rawAttributes','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','sendStatus','stack','name','send','map','Variable','type','key','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa7c4,0x1e5));var _0x4a7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7c4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a7c('0x0'));var zipdir=require(_0x4a7c('0x1'));var jsonpatch=require(_0x4a7c('0x2'));var rp=require(_0x4a7c('0x3'));var moment=require(_0x4a7c('0x4'));var BPromise=require(_0x4a7c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a7c('0x6'));var sox=require('sox');var csv=require(_0x4a7c('0x7'));var ejs=require(_0x4a7c('0x8'));var fs=require('fs');var fs_extra=require(_0x4a7c('0x9'));var _=require(_0x4a7c('0xa'));var squel=require(_0x4a7c('0xb'));var crypto=require(_0x4a7c('0xc'));var jsforce=require(_0x4a7c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a7c('0xe'));var Redis=require(_0x4a7c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4a7c('0x10'));var as=require(_0x4a7c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4a7c('0x12'));var config=require(_0x4a7c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf46d1c,_0x4f9a0d){_0x4f9a0d=_0x4f9a0d||0xcc;return function(_0x43c57c){if(_0x43c57c){return _0xf46d1c['sendStatus'](_0x4f9a0d);}return _0xf46d1c['status'](_0x4f9a0d)['end']();};}function respondWithResult(_0x59a430,_0x43123e){_0x43123e=_0x43123e||0xc8;return function(_0x58df2b){if(_0x58df2b){return _0x59a430[_0x4a7c('0x14')](_0x43123e)['json'](_0x58df2b);}};}function respondWithFilteredResult(_0x5508a2,_0xe8d58e){return function(_0xb0ce50){if(_0xb0ce50){var _0x23b16d=typeof _0xe8d58e[_0x4a7c('0x15')]===_0x4a7c('0x16')&&typeof _0xe8d58e[_0x4a7c('0x17')]==='undefined';var _0x1b06f7=_0xb0ce50[_0x4a7c('0x18')];var _0x22aa77=_0x23b16d?0x0:_0xe8d58e[_0x4a7c('0x15')];var _0x4168fb=_0x23b16d?_0xb0ce50[_0x4a7c('0x18')]:_0xe8d58e[_0x4a7c('0x15')]+_0xe8d58e[_0x4a7c('0x17')];var _0x1aefbe;if(_0x4168fb>=_0x1b06f7){_0x4168fb=_0x1b06f7;_0x1aefbe=0xc8;}else{_0x1aefbe=0xce;}_0x5508a2['status'](_0x1aefbe);return _0x5508a2[_0x4a7c('0x19')](_0x4a7c('0x1a'),_0x22aa77+'-'+_0x4168fb+'/'+_0x1b06f7)[_0x4a7c('0x1b')](_0xb0ce50);}return null;};}function patchUpdates(_0x223fb2){return function(_0x53457e){try{jsonpatch[_0x4a7c('0x1c')](_0x53457e,_0x223fb2,!![]);}catch(_0x33e377){return BPromise[_0x4a7c('0x1d')](_0x33e377);}return _0x53457e[_0x4a7c('0x1e')]();};}function saveUpdates(_0x3f6ee0,_0x4b2c57){return function(_0x362419){if(_0x362419){return _0x362419[_0x4a7c('0x1f')](_0x3f6ee0)[_0x4a7c('0x20')](function(_0x5c949b){return _0x5c949b;});}return null;};}function removeEntity(_0xb80e96,_0x3a4736){return function(_0x3acb38){if(_0x3acb38){return _0x3acb38[_0x4a7c('0x21')]()['then'](function(){var _0x183fbc=_0x3acb38[_0x4a7c('0x22')]({'plain':!![]});var _0x4b019a=_0x4a7c('0x23');return db[_0x4a7c('0x24')][_0x4a7c('0x21')]({'where':{'type':_0x4b019a,'resourceId':_0x183fbc['id']}})[_0x4a7c('0x20')](function(){return _0x3acb38;});})[_0x4a7c('0x20')](function(){_0xb80e96[_0x4a7c('0x14')](0xcc)[_0x4a7c('0x25')]();});}};}function handleEntityNotFound(_0x5c454d,_0x161bc7){return function(_0x55d2aa){if(!_0x55d2aa){_0x5c454d[_0x4a7c('0x26')](0x194);}return _0x55d2aa;};}function handleError(_0x3f32f4,_0x66eb2c){_0x66eb2c=_0x66eb2c||0x1f4;return function(_0x5be8f9){logger['error'](_0x5be8f9[_0x4a7c('0x27')]);if(_0x5be8f9[_0x4a7c('0x28')]){delete _0x5be8f9[_0x4a7c('0x28')];}_0x3f32f4[_0x4a7c('0x14')](_0x66eb2c)[_0x4a7c('0x29')](_0x5be8f9);};}exports['index']=function(_0x9f4643,_0x5f1ad9){var _0x3c7332={},_0x1d9b00={},_0x2869d5={'count':0x0,'rows':[]};var _0x22fa19=_[_0x4a7c('0x2a')](db[_0x4a7c('0x2b')]['rawAttributes'],function(_0x4df761){return{'name':_0x4df761['fieldName'],'type':_0x4df761[_0x4a7c('0x2c')][_0x4a7c('0x2d')]};});_0x1d9b00['model']=_[_0x4a7c('0x2a')](_0x22fa19,'name');_0x1d9b00[_0x4a7c('0x2e')]=_[_0x4a7c('0x2f')](_0x9f4643[_0x4a7c('0x2e')]);_0x1d9b00['filters']=_[_0x4a7c('0x30')](_0x1d9b00['model'],_0x1d9b00[_0x4a7c('0x2e')]);_0x3c7332[_0x4a7c('0x31')]=_[_0x4a7c('0x30')](_0x1d9b00['model'],qs[_0x4a7c('0x32')](_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x32')]));_0x3c7332[_0x4a7c('0x31')]=_0x3c7332[_0x4a7c('0x31')]['length']?_0x3c7332[_0x4a7c('0x31')]:_0x1d9b00['model'];if(!_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x33')]('nolimit')){_0x3c7332[_0x4a7c('0x17')]=qs[_0x4a7c('0x17')](_0x9f4643['query']['limit']);_0x3c7332[_0x4a7c('0x15')]=qs[_0x4a7c('0x15')](_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x15')]);}_0x3c7332[_0x4a7c('0x34')]=qs[_0x4a7c('0x35')](_0x9f4643[_0x4a7c('0x2e')]['sort']);_0x3c7332['where']=qs[_0x4a7c('0x36')](_[_0x4a7c('0x37')](_0x9f4643[_0x4a7c('0x2e')],_0x1d9b00[_0x4a7c('0x36')]),_0x22fa19);if(_0x9f4643[_0x4a7c('0x2e')]['filter']){_0x3c7332[_0x4a7c('0x38')]=_[_0x4a7c('0x39')](_0x3c7332[_0x4a7c('0x38')],{'$or':_[_0x4a7c('0x2a')](_0x22fa19,function(_0x3ba984){if(_0x3ba984[_0x4a7c('0x2c')]!==_0x4a7c('0x3a')){var _0x20ca22={};_0x20ca22[_0x3ba984[_0x4a7c('0x28')]]={'$like':'%'+_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x3b')]+'%'};return _0x20ca22;}})});}_0x3c7332=_[_0x4a7c('0x39')]({},_0x3c7332,_0x9f4643[_0x4a7c('0x3c')]);var _0xa43b80={'where':_0x3c7332[_0x4a7c('0x38')]};return db[_0x4a7c('0x2b')]['count'](_0xa43b80)[_0x4a7c('0x20')](function(_0x1a8f67){_0x2869d5[_0x4a7c('0x18')]=_0x1a8f67;if(_0x9f4643[_0x4a7c('0x2e')]['includeAll']){_0x3c7332[_0x4a7c('0x3d')]=[{'all':!![]}];}return db[_0x4a7c('0x2b')][_0x4a7c('0x3e')](_0x3c7332);})[_0x4a7c('0x20')](function(_0x25cd3d){_0x2869d5[_0x4a7c('0x3f')]=_0x25cd3d;return _0x2869d5;})[_0x4a7c('0x20')](respondWithFilteredResult(_0x5f1ad9,_0x3c7332))['catch'](handleError(_0x5f1ad9,null));};exports['show']=function(_0x2a6e15,_0x425450){var _0x300ce6={'raw':!![],'where':{'id':_0x2a6e15[_0x4a7c('0x40')]['id']}},_0x15a7b3={};_0x15a7b3[_0x4a7c('0x41')]=_[_0x4a7c('0x2f')](db[_0x4a7c('0x2b')][_0x4a7c('0x42')]);_0x15a7b3[_0x4a7c('0x2e')]=_[_0x4a7c('0x2f')](_0x2a6e15[_0x4a7c('0x2e')]);_0x15a7b3['filters']=_[_0x4a7c('0x30')](_0x15a7b3['model'],_0x15a7b3[_0x4a7c('0x2e')]);_0x300ce6[_0x4a7c('0x31')]=_[_0x4a7c('0x30')](_0x15a7b3[_0x4a7c('0x41')],qs[_0x4a7c('0x32')](_0x2a6e15['query']['fields']));_0x300ce6[_0x4a7c('0x31')]=_0x300ce6[_0x4a7c('0x31')][_0x4a7c('0x43')]?_0x300ce6[_0x4a7c('0x31')]:_0x15a7b3[_0x4a7c('0x41')];if(_0x2a6e15[_0x4a7c('0x2e')][_0x4a7c('0x44')]){_0x300ce6[_0x4a7c('0x3d')]=[{'all':!![]}];}_0x300ce6=_[_0x4a7c('0x39')]({},_0x300ce6,_0x2a6e15['options']);return db['Variable'][_0x4a7c('0x45')](_0x300ce6)['then'](handleEntityNotFound(_0x425450,null))['then'](respondWithResult(_0x425450,null))[_0x4a7c('0x46')](handleError(_0x425450,null));};exports[_0x4a7c('0x47')]=function(_0x11fda9,_0x2c4949){return db[_0x4a7c('0x2b')][_0x4a7c('0x47')](_0x11fda9[_0x4a7c('0x48')],{})[_0x4a7c('0x20')](function(_0x43f36a){var _0x3f6ea8=_0x11fda9['user']['get']({'plain':!![]});if(!_0x3f6ea8)throw new Error(_0x4a7c('0x49'));if(_0x3f6ea8[_0x4a7c('0x4a')]===_0x4a7c('0x4b')){var _0x443e02=_0x43f36a['get']({'plain':!![]});var _0x1a482f=_0x4a7c('0x23');return db['UserProfileSection'][_0x4a7c('0x45')]({'where':{'name':_0x1a482f,'userProfileId':_0x3f6ea8[_0x4a7c('0x4c')]},'raw':!![]})[_0x4a7c('0x20')](function(_0x2aafea){if(_0x2aafea&&_0x2aafea['autoAssociation']===0x0){return db[_0x4a7c('0x24')][_0x4a7c('0x47')]({'name':_0x443e02[_0x4a7c('0x28')],'resourceId':_0x443e02['id'],'type':_0x2aafea[_0x4a7c('0x28')],'sectionId':_0x2aafea['id']},{})[_0x4a7c('0x20')](function(){return _0x43f36a;});}else{return _0x43f36a;}})['catch'](function(_0x2b926c){logger['error'](_0x4a7c('0x4d'),_0x2b926c);throw _0x2b926c;});}return _0x43f36a;})[_0x4a7c('0x20')](respondWithResult(_0x2c4949,0xc9))['catch'](handleError(_0x2c4949,null));};exports[_0x4a7c('0x1f')]=function(_0x4825ed,_0x39d321){if(_0x4825ed[_0x4a7c('0x48')]['id']){delete _0x4825ed[_0x4a7c('0x48')]['id'];}return db[_0x4a7c('0x2b')][_0x4a7c('0x45')]({'where':{'id':_0x4825ed[_0x4a7c('0x40')]['id']}})['then'](handleEntityNotFound(_0x39d321,null))[_0x4a7c('0x20')](saveUpdates(_0x4825ed['body'],null))[_0x4a7c('0x20')](respondWithResult(_0x39d321,null))[_0x4a7c('0x46')](handleError(_0x39d321,null));};exports[_0x4a7c('0x21')]=function(_0x456c76,_0x25c17a){return db['Variable'][_0x4a7c('0x45')]({'where':{'id':_0x456c76[_0x4a7c('0x40')]['id']}})['then'](handleEntityNotFound(_0x25c17a,null))[_0x4a7c('0x20')](removeEntity(_0x25c17a,null))[_0x4a7c('0x46')](handleError(_0x25c17a,null));}; \ No newline at end of file +var _0xd8dc=['offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Variable','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','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','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count'];(function(_0x6ce5c3,_0x4c01d8){var _0x4e009e=function(_0x271a50){while(--_0x271a50){_0x6ce5c3['push'](_0x6ce5c3['shift']());}};_0x4e009e(++_0x4c01d8);}(_0xd8dc,0x1c7));var _0xcd8d=function(_0x3e8c34,_0x549d3c){_0x3e8c34=_0x3e8c34-0x0;var _0x14969e=_0xd8dc[_0x3e8c34];return _0x14969e;};'use strict';var emlformat=require(_0xcd8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd8d('0x1'));var jsonpatch=require(_0xcd8d('0x2'));var rp=require(_0xcd8d('0x3'));var moment=require(_0xcd8d('0x4'));var BPromise=require(_0xcd8d('0x5'));var Mustache=require(_0xcd8d('0x6'));var util=require(_0xcd8d('0x7'));var path=require(_0xcd8d('0x8'));var sox=require(_0xcd8d('0x9'));var csv=require(_0xcd8d('0xa'));var ejs=require(_0xcd8d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd8d('0xc'));var squel=require('squel');var crypto=require(_0xcd8d('0xd'));var jsforce=require(_0xcd8d('0xe'));var deskjs=require(_0xcd8d('0xf'));var toCsv=require(_0xcd8d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcd8d('0x10'));var qs=require(_0xcd8d('0x11'));var as=require(_0xcd8d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd8d('0x13'))(_0xcd8d('0x14'));var utils=require(_0xcd8d('0x15'));var config=require(_0xcd8d('0x16'));var licenseUtil=require(_0xcd8d('0x17'));var db=require(_0xcd8d('0x18'))['db'];function respondWithStatusCode(_0xebe22a,_0x4112fd){_0x4112fd=_0x4112fd||0xcc;return function(_0x27641e){if(_0x27641e){return _0xebe22a[_0xcd8d('0x19')](_0x4112fd);}return _0xebe22a[_0xcd8d('0x1a')](_0x4112fd)[_0xcd8d('0x1b')]();};}function respondWithResult(_0x1cb4de,_0x426525){_0x426525=_0x426525||0xc8;return function(_0x46fff4){if(_0x46fff4){return _0x1cb4de[_0xcd8d('0x1a')](_0x426525)[_0xcd8d('0x1c')](_0x46fff4);}};}function respondWithFilteredResult(_0x3ba57f,_0x20479d){return function(_0xa48a4e){if(_0xa48a4e){var _0x372689=typeof _0x20479d['offset']===_0xcd8d('0x1d')&&typeof _0x20479d['limit']===_0xcd8d('0x1d');var _0xa53374=_0xa48a4e[_0xcd8d('0x1e')];var _0x49bf97=_0x372689?0x0:_0x20479d[_0xcd8d('0x1f')];var _0x1aaa32=_0x372689?_0xa48a4e[_0xcd8d('0x1e')]:_0x20479d[_0xcd8d('0x1f')]+_0x20479d['limit'];var _0x3f8921;if(_0x1aaa32>=_0xa53374){_0x1aaa32=_0xa53374;_0x3f8921=0xc8;}else{_0x3f8921=0xce;}_0x3ba57f[_0xcd8d('0x1a')](_0x3f8921);return _0x3ba57f[_0xcd8d('0x20')](_0xcd8d('0x21'),_0x49bf97+'-'+_0x1aaa32+'/'+_0xa53374)[_0xcd8d('0x1c')](_0xa48a4e);}return null;};}function patchUpdates(_0xecc5a2){return function(_0x447022){try{jsonpatch[_0xcd8d('0x22')](_0x447022,_0xecc5a2,!![]);}catch(_0x49d5ac){return BPromise[_0xcd8d('0x23')](_0x49d5ac);}return _0x447022['save']();};}function saveUpdates(_0x3bd02e,_0x4673a5){return function(_0x33fbcf){if(_0x33fbcf){return _0x33fbcf[_0xcd8d('0x24')](_0x3bd02e)[_0xcd8d('0x25')](function(_0x794c11){return _0x794c11;});}return null;};}function removeEntity(_0x148a75,_0x52a34c){return function(_0x2fdb3b){if(_0x2fdb3b){return _0x2fdb3b[_0xcd8d('0x26')]()[_0xcd8d('0x25')](function(){var _0xd152dd=_0x2fdb3b[_0xcd8d('0x27')]({'plain':!![]});var _0x1bae19='Variables';return db[_0xcd8d('0x28')][_0xcd8d('0x26')]({'where':{'type':_0x1bae19,'resourceId':_0xd152dd['id']}})['then'](function(){return _0x2fdb3b;});})['then'](function(){_0x148a75[_0xcd8d('0x1a')](0xcc)[_0xcd8d('0x1b')]();});}};}function handleEntityNotFound(_0x426008,_0x14d7d4){return function(_0x21131d){if(!_0x21131d){_0x426008[_0xcd8d('0x19')](0x194);}return _0x21131d;};}function handleError(_0x3611a3,_0x73189){_0x73189=_0x73189||0x1f4;return function(_0x28ed6a){logger[_0xcd8d('0x29')](_0x28ed6a[_0xcd8d('0x2a')]);if(_0x28ed6a[_0xcd8d('0x2b')]){delete _0x28ed6a[_0xcd8d('0x2b')];}_0x3611a3[_0xcd8d('0x1a')](_0x73189)[_0xcd8d('0x2c')](_0x28ed6a);};}exports['index']=function(_0x413f2d,_0x422598){var _0x5eaabc={},_0x5ac013={},_0x1fd4b7={'count':0x0,'rows':[]};var _0x4e3046=_[_0xcd8d('0x2d')](db[_0xcd8d('0x2e')]['rawAttributes'],function(_0x3d8156){return{'name':_0x3d8156[_0xcd8d('0x2f')],'type':_0x3d8156['type'][_0xcd8d('0x30')]};});_0x5ac013['model']=_['map'](_0x4e3046,_0xcd8d('0x2b'));_0x5ac013[_0xcd8d('0x31')]=_[_0xcd8d('0x32')](_0x413f2d[_0xcd8d('0x31')]);_0x5ac013[_0xcd8d('0x33')]=_['intersection'](_0x5ac013[_0xcd8d('0x34')],_0x5ac013['query']);_0x5eaabc[_0xcd8d('0x35')]=_[_0xcd8d('0x36')](_0x5ac013[_0xcd8d('0x34')],qs[_0xcd8d('0x37')](_0x413f2d[_0xcd8d('0x31')][_0xcd8d('0x37')]));_0x5eaabc['attributes']=_0x5eaabc[_0xcd8d('0x35')][_0xcd8d('0x38')]?_0x5eaabc[_0xcd8d('0x35')]:_0x5ac013[_0xcd8d('0x34')];if(!_0x413f2d[_0xcd8d('0x31')][_0xcd8d('0x39')]('nolimit')){_0x5eaabc[_0xcd8d('0x3a')]=qs[_0xcd8d('0x3a')](_0x413f2d[_0xcd8d('0x31')][_0xcd8d('0x3a')]);_0x5eaabc[_0xcd8d('0x1f')]=qs[_0xcd8d('0x1f')](_0x413f2d[_0xcd8d('0x31')][_0xcd8d('0x1f')]);}_0x5eaabc[_0xcd8d('0x3b')]=qs[_0xcd8d('0x3c')](_0x413f2d['query'][_0xcd8d('0x3c')]);_0x5eaabc[_0xcd8d('0x3d')]=qs[_0xcd8d('0x33')](_[_0xcd8d('0x3e')](_0x413f2d[_0xcd8d('0x31')],_0x5ac013[_0xcd8d('0x33')]),_0x4e3046);if(_0x413f2d['query'][_0xcd8d('0x3f')]){_0x5eaabc[_0xcd8d('0x3d')]=_[_0xcd8d('0x40')](_0x5eaabc[_0xcd8d('0x3d')],{'$or':_[_0xcd8d('0x2d')](_0x4e3046,function(_0x480edb){if(_0x480edb[_0xcd8d('0x41')]!=='VIRTUAL'){var _0x2a32e5={};_0x2a32e5[_0x480edb[_0xcd8d('0x2b')]]={'$like':'%'+_0x413f2d[_0xcd8d('0x31')][_0xcd8d('0x3f')]+'%'};return _0x2a32e5;}})});}_0x5eaabc=_['merge']({},_0x5eaabc,_0x413f2d['options']);var _0x1ab8e0={'where':_0x5eaabc[_0xcd8d('0x3d')]};return db[_0xcd8d('0x2e')][_0xcd8d('0x1e')](_0x1ab8e0)[_0xcd8d('0x25')](function(_0x126be8){_0x1fd4b7['count']=_0x126be8;if(_0x413f2d[_0xcd8d('0x31')][_0xcd8d('0x42')]){_0x5eaabc['include']=[{'all':!![]}];}return db[_0xcd8d('0x2e')][_0xcd8d('0x43')](_0x5eaabc);})[_0xcd8d('0x25')](function(_0x5e191d){_0x1fd4b7[_0xcd8d('0x44')]=_0x5e191d;return _0x1fd4b7;})[_0xcd8d('0x25')](respondWithFilteredResult(_0x422598,_0x5eaabc))['catch'](handleError(_0x422598,null));};exports[_0xcd8d('0x45')]=function(_0x34d08b,_0x52eae4){var _0x258d1e={'raw':!![],'where':{'id':_0x34d08b[_0xcd8d('0x46')]['id']}},_0x5999ac={};_0x5999ac['model']=_[_0xcd8d('0x32')](db[_0xcd8d('0x2e')]['rawAttributes']);_0x5999ac[_0xcd8d('0x31')]=_['keys'](_0x34d08b['query']);_0x5999ac[_0xcd8d('0x33')]=_['intersection'](_0x5999ac[_0xcd8d('0x34')],_0x5999ac[_0xcd8d('0x31')]);_0x258d1e[_0xcd8d('0x35')]=_[_0xcd8d('0x36')](_0x5999ac[_0xcd8d('0x34')],qs[_0xcd8d('0x37')](_0x34d08b[_0xcd8d('0x31')][_0xcd8d('0x37')]));_0x258d1e[_0xcd8d('0x35')]=_0x258d1e[_0xcd8d('0x35')][_0xcd8d('0x38')]?_0x258d1e[_0xcd8d('0x35')]:_0x5999ac[_0xcd8d('0x34')];if(_0x34d08b['query'][_0xcd8d('0x42')]){_0x258d1e[_0xcd8d('0x47')]=[{'all':!![]}];}_0x258d1e=_[_0xcd8d('0x40')]({},_0x258d1e,_0x34d08b[_0xcd8d('0x48')]);return db[_0xcd8d('0x2e')][_0xcd8d('0x49')](_0x258d1e)[_0xcd8d('0x25')](handleEntityNotFound(_0x52eae4,null))[_0xcd8d('0x25')](respondWithResult(_0x52eae4,null))[_0xcd8d('0x4a')](handleError(_0x52eae4,null));};exports[_0xcd8d('0x4b')]=function(_0x2faaec,_0x4f88fe){return db[_0xcd8d('0x2e')][_0xcd8d('0x4b')](_0x2faaec[_0xcd8d('0x4c')],{})[_0xcd8d('0x25')](function(_0x4192c7){var _0x2f9490=_0x2faaec['user'][_0xcd8d('0x27')]({'plain':!![]});if(!_0x2f9490)throw new Error(_0xcd8d('0x4d'));if(_0x2f9490['role']==='user'){var _0x35a796=_0x4192c7[_0xcd8d('0x27')]({'plain':!![]});var _0x47d87f='Variables';return db[_0xcd8d('0x4e')][_0xcd8d('0x49')]({'where':{'name':_0x47d87f,'userProfileId':_0x2f9490[_0xcd8d('0x4f')]},'raw':!![]})[_0xcd8d('0x25')](function(_0x2c965a){if(_0x2c965a&&_0x2c965a['autoAssociation']===0x0){return db[_0xcd8d('0x28')]['create']({'name':_0x35a796['name'],'resourceId':_0x35a796['id'],'type':_0x2c965a[_0xcd8d('0x2b')],'sectionId':_0x2c965a['id']},{})[_0xcd8d('0x25')](function(){return _0x4192c7;});}else{return _0x4192c7;}})['catch'](function(_0x292f52){logger[_0xcd8d('0x29')](_0xcd8d('0x50'),_0x292f52);throw _0x292f52;});}return _0x4192c7;})[_0xcd8d('0x25')](respondWithResult(_0x4f88fe,0xc9))['catch'](handleError(_0x4f88fe,null));};exports[_0xcd8d('0x24')]=function(_0x3f1e99,_0x9affd7){if(_0x3f1e99['body']['id']){delete _0x3f1e99['body']['id'];}return db[_0xcd8d('0x2e')][_0xcd8d('0x49')]({'where':{'id':_0x3f1e99[_0xcd8d('0x46')]['id']}})[_0xcd8d('0x25')](handleEntityNotFound(_0x9affd7,null))[_0xcd8d('0x25')](saveUpdates(_0x3f1e99[_0xcd8d('0x4c')],null))[_0xcd8d('0x25')](respondWithResult(_0x9affd7,null))[_0xcd8d('0x4a')](handleError(_0x9affd7,null));};exports['destroy']=function(_0x3c8c39,_0x25ebfd){return db[_0xcd8d('0x2e')][_0xcd8d('0x49')]({'where':{'id':_0x3c8c39[_0xcd8d('0x46')]['id']}})[_0xcd8d('0x25')](handleEntityNotFound(_0x25ebfd,null))[_0xcd8d('0x25')](removeEntity(_0x25ebfd,null))[_0xcd8d('0x4a')](handleError(_0x25ebfd,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 68bfdc1..f7df304 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 _0x0e5c=['Variable','tools_variables','util','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x69d91e,_0x12fec6){var _0x381436=function(_0x9a01a0){while(--_0x9a01a0){_0x69d91e['push'](_0x69d91e['shift']());}};_0x381436(++_0x12fec6);}(_0x0e5c,0x1b0));var _0xc0e5=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x0e5c[_0x93942f];return _0x23fcd8;};'use strict';var _=require('lodash');var util=require(_0xc0e5('0x0'));var logger=require('../../config/logger')(_0xc0e5('0x1'));var moment=require(_0xc0e5('0x2'));var BPromise=require(_0xc0e5('0x3'));var rp=require(_0xc0e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0e5('0x5'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xc0e5('0x6')]=function(_0x250270,_0x322e90){return _0x250270[_0xc0e5('0x7')](_0xc0e5('0x8'),attributes,{'tableName':_0xc0e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4182=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Variable','tools_variables'];(function(_0x111c17,_0x275184){var _0x5ff50a=function(_0x4ebc34){while(--_0x4ebc34){_0x111c17['push'](_0x111c17['shift']());}};_0x5ff50a(++_0x275184);}(_0x4182,0x108));var _0x2418=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x4182[_0x547e20];return _0x359171;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2418('0x0'))(_0x2418('0x1'));var moment=require(_0x2418('0x2'));var BPromise=require(_0x2418('0x3'));var rp=require(_0x2418('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2418('0x5'));var config=require(_0x2418('0x6'));var attributes=require('./variable.attributes');module[_0x2418('0x7')]=function(_0x35369c,_0x17b3be){return _0x35369c[_0x2418('0x8')](_0x2418('0x9'),attributes,{'tableName':_0x2418('0xa'),'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 8995a63..5485070 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 _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(_0x4639ac,_0x313164){var _0xacd216=function(_0x390bb1){while(--_0x390bb1){_0x4639ac['push'](_0x4639ac['shift']());}};_0xacd216(++_0x313164);}(_0x6aa7,0x178));var _0x76aa=function(_0x4d2305,_0x2703d9){_0x4d2305=_0x4d2305-0x0;var _0x51d476=_0x6aa7[_0x4d2305];return _0x51d476;};'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 +var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x17c6dc,_0x5fab2c){var _0x3adfb2=function(_0x3390f0){while(--_0x3390f0){_0x17c6dc['push'](_0x17c6dc['shift']());}};_0x3adfb2(++_0x5fab2c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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']('Variable,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 4c94538..5f27d12 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 _0xb0ac=['migrations','exports','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','pull','restart','/migrations'];(function(_0x10e74e,_0x1603ae){var _0x2198c1=function(_0x4b627c){while(--_0x4b627c){_0x10e74e['push'](_0x10e74e['shift']());}};_0x2198c1(++_0x1603ae);}(_0xb0ac,0x1f1));var _0xcb0a=function(_0x7c728f,_0x284a44){_0x7c728f=_0x7c728f-0x0;var _0x219875=_0xb0ac[_0x7c728f];return _0x219875;};'use strict';var express=require('express');var router=express[_0xcb0a('0x0')]();var auth=require(_0xcb0a('0x1'));var controller=require(_0xcb0a('0x2'));router[_0xcb0a('0x3')]('/',controller[_0xcb0a('0x4')]);router[_0xcb0a('0x3')]('/fetch',auth[_0xcb0a('0x5')](),auth[_0xcb0a('0x6')](),controller[_0xcb0a('0x7')]);router['get'](_0xcb0a('0x8'),auth[_0xcb0a('0x5')](),auth[_0xcb0a('0x6')](),controller[_0xcb0a('0x9')]);router[_0xcb0a('0x3')]('/pull',auth[_0xcb0a('0x5')](),auth[_0xcb0a('0x6')](),controller[_0xcb0a('0xa')]);router[_0xcb0a('0x3')]('/restart',auth[_0xcb0a('0x5')](),controller[_0xcb0a('0xb')]);router['get'](_0xcb0a('0xc'),controller[_0xcb0a('0xd')]);module[_0xcb0a('0xe')]=router; \ No newline at end of file +var _0xb45d=['/pull','/restart','restart','/migrations','exports','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','reset'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xb45d,0x171));var _0xdb45=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0xb45d[_0xea343d];return _0x2c6e9c;};'use strict';var express=require('express');var router=express[_0xdb45('0x0')]();var auth=require(_0xdb45('0x1'));var controller=require(_0xdb45('0x2'));router[_0xdb45('0x3')]('/',controller['index']);router[_0xdb45('0x3')](_0xdb45('0x4'),auth[_0xdb45('0x5')](),auth[_0xdb45('0x6')](),controller[_0xdb45('0x7')]);router['get']('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xdb45('0x8')]);router['get'](_0xdb45('0x9'),auth[_0xdb45('0x5')](),auth[_0xdb45('0x6')](),controller['pull']);router[_0xdb45('0x3')](_0xdb45('0xa'),auth[_0xdb45('0x5')](),controller[_0xdb45('0xb')]);router[_0xdb45('0x3')](_0xdb45('0xc'),controller['migrations']);module[_0xdb45('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 123a112..518de52 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 _0xe1aa=['npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','catch','readdirSync','server','migrations','replace','.js','exports','length','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','umzug','path','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','query','latest','fetch','tags','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe1aa,0x1d4));var _0xae1a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe1aa[_0x6131cd];return _0x47e916;};'use strict';var Umzug=require(_0xae1a('0x0'));var path=require(_0xae1a('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0xae1a('0x2'));var compareVersions=require(_0xae1a('0x3'));var exec=require(_0xae1a('0x4'))[_0xae1a('0x5')];var db=require(_0xae1a('0x6'))['db'];var config=require(_0xae1a('0x7'));var pm2=require(_0xae1a('0x8'));var logger=require(_0xae1a('0x9'))(_0xae1a('0xa'));var git=require(_0xae1a('0xb'))(config[_0xae1a('0xc')]);exports['index']=function(_0x4fc315,_0x20ac45){var _0x12a735={'current':module['exports'][_0xae1a('0x2')],'phonebar':0x2};if(_0x4fc315['query']&&_0x4fc315[_0xae1a('0xd')][_0xae1a('0xe')]){return git[_0xae1a('0xf')]()[_0xae1a('0x10')](function(_0x235cda,_0x58ed79){_0x12a735[_0xae1a('0xe')]=(_0x235cda?module['exports'][_0xae1a('0x2')]:_0x58ed79[_0xae1a('0xe')])||'2.0.0';return _0x20ac45[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')](_0x12a735);});}else{return _0x20ac45[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')](_0x12a735);}};exports['fetch']=function(_0x106588,_0x4d41df){return git[_0xae1a('0xf')](['origin',_0xae1a('0x13')],function(_0xbba5a2){if(_0xbba5a2){logger[_0xae1a('0x14')](_0xbba5a2);return _0x4d41df['status'](0x1f4)[_0xae1a('0x12')](_0xbba5a2);}logger[_0xae1a('0x15')](_0xae1a('0x16'));return _0x4d41df[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')]({'output':_0xae1a('0x17')});});};exports['reset']=function(_0x42851c,_0x28dae4){return git[_0xae1a('0x18')](['--hard',_0xae1a('0x19')],function(_0x3e7a28){if(_0x3e7a28){logger[_0xae1a('0x14')](_0x3e7a28);return _0x28dae4['status'](0x1f4)[_0xae1a('0x12')](_0x3e7a28);}logger[_0xae1a('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x28dae4['status'](0xc8)[_0xae1a('0x12')]({'output':_0xae1a('0x1a')});});};exports['pull']=function(_0x9e7384,_0x345a31){exec(_0xae1a('0x1b'),function(_0x259cb5,_0xeb5454,_0x37bb55){logger[_0xae1a('0x15')](_0xeb5454);logger[_0xae1a('0x15')](_0x37bb55);if(_0x259cb5){logger['error'](_0x259cb5);return _0x345a31[_0xae1a('0x11')](0x1f4)['json'](_0x259cb5);}return _0x345a31[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')]({'output':_0xeb5454});});};exports[_0xae1a('0x1c')]=function(_0x55d6f1,_0x6a7ce3){return pm2['restart']('motion2')['then'](function(_0x366594){logger[_0xae1a('0x15')](_0xae1a('0x1d'),_0x366594);return _0x6a7ce3[_0xae1a('0x11')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xae1a('0x1e')](function(_0xd8c189){logger[_0xae1a('0x14')](_0xd8c189);return _0x6a7ce3['status'](0x1f4)[_0xae1a('0x12')](_0xd8c189);});};exports['migrations']=function(_0x9d24c1,_0x14b57a){var _0x4dd15f=fs[_0xae1a('0x1f')](path['join'](config['root'],_0xae1a('0x20'),_0xae1a('0x21')));var _0x599e33=[];for(var _0x389f98=0x0;_0x389f98<_0x4dd15f['length'];_0x389f98++){var _0x3c9d5d=_0x4dd15f[_0x389f98][_0xae1a('0x22')](_0xae1a('0x23'),'');if(compareVersions(module[_0xae1a('0x24')]['version'],_0x3c9d5d)===-0x1){_0x599e33['push'](_0x3c9d5d);}}if(_0x599e33[_0xae1a('0x25')]){var _0x1d3b9d=_0x599e33[_0xae1a('0x26')](compareVersions);var _0x32dc99=new Umzug({'storage':_0xae1a('0x27'),'storageOptions':{'model':db[_0xae1a('0x28')],'modelName':'Migration','columnName':_0xae1a('0x2')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0xae1a('0x27')]['constructor'],function(){throw new Error(_0xae1a('0x29'));}],'path':path[_0xae1a('0x2a')](config[_0xae1a('0xc')],_0xae1a('0x20'),_0xae1a('0x21')),'pattern':/\.js$/}});_0x32dc99['up']({'migrations':_[_0xae1a('0x2b')](_0x1d3b9d,function(_0x1d67c4){return _0x1d67c4+_0xae1a('0x23');})})['then'](function(){return _0x14b57a[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xae1a('0x2')]+_0xae1a('0x2c')+_['last'](_0x1d3b9d),'migrations':_[_0xae1a('0x2a')](_0x1d3b9d)});})[_0xae1a('0x1e')](function(_0x5adc54){if(_0x5adc54 instanceof db[_0xae1a('0x27')]['UniqueConstraintError']){return _0x14b57a['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x14b57a[_0xae1a('0x11')](0x1f4)[_0xae1a('0x12')](_0x5adc54);}});}else{return _0x14b57a[_0xae1a('0x11')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x2ecd=['UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/pm2','simple-git','root','query','latest','fetch','tags','exports','json','status','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','replace','.js','push','length','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2ecd,0x16e));var _0xd2ec=function(_0x38e923,_0x3fd847){_0x38e923=_0x38e923-0x0;var _0x5dc480=_0x2ecd[_0x38e923];return _0x5dc480;};'use strict';var Umzug=require(_0xd2ec('0x0'));var path=require(_0xd2ec('0x1'));var fs=require('fs');var _=require(_0xd2ec('0x2'));var pkginfo=require(_0xd2ec('0x3'))(module,_0xd2ec('0x4'));var compareVersions=require(_0xd2ec('0x5'));var exec=require(_0xd2ec('0x6'))[_0xd2ec('0x7')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0xd2ec('0x8'));var logger=require('../../config/logger')('update');var git=require(_0xd2ec('0x9'))(config[_0xd2ec('0xa')]);exports['index']=function(_0x2050df,_0x57f06f){var _0x46bc70={'current':module['exports'][_0xd2ec('0x4')],'phonebar':0x2};if(_0x2050df[_0xd2ec('0xb')]&&_0x2050df['query'][_0xd2ec('0xc')]){return git[_0xd2ec('0xd')]()[_0xd2ec('0xe')](function(_0x3ec821,_0x490666){_0x46bc70[_0xd2ec('0xc')]=(_0x3ec821?module[_0xd2ec('0xf')][_0xd2ec('0x4')]:_0x490666[_0xd2ec('0xc')])||'2.0.0';return _0x57f06f['status'](0xc8)[_0xd2ec('0x10')](_0x46bc70);});}else{return _0x57f06f[_0xd2ec('0x11')](0xc8)['json'](_0x46bc70);}};exports[_0xd2ec('0xd')]=function(_0x72e322,_0x29232b){return git[_0xd2ec('0xd')](['origin',_0xd2ec('0x12')],function(_0x5e7837){if(_0x5e7837){logger[_0xd2ec('0x13')](_0x5e7837);return _0x29232b['status'](0x1f4)[_0xd2ec('0x10')](_0x5e7837);}logger['info'](_0xd2ec('0x14'));return _0x29232b[_0xd2ec('0x11')](0xc8)[_0xd2ec('0x10')]({'output':_0xd2ec('0x15')});});};exports[_0xd2ec('0x16')]=function(_0x238a90,_0x2c3b86){return git['reset'](['--hard',_0xd2ec('0x17')],function(_0x38a6f0){if(_0x38a6f0){logger[_0xd2ec('0x13')](_0x38a6f0);return _0x2c3b86[_0xd2ec('0x11')](0x1f4)[_0xd2ec('0x10')](_0x38a6f0);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2c3b86[_0xd2ec('0x11')](0xc8)['json']({'output':_0xd2ec('0x18')});});};exports[_0xd2ec('0x19')]=function(_0x48f310,_0x3fd7ee){exec(_0xd2ec('0x1a'),function(_0x532875,_0x5c518f,_0xd3a296){logger[_0xd2ec('0x1b')](_0x5c518f);logger[_0xd2ec('0x1b')](_0xd3a296);if(_0x532875){logger[_0xd2ec('0x13')](_0x532875);return _0x3fd7ee[_0xd2ec('0x11')](0x1f4)[_0xd2ec('0x10')](_0x532875);}return _0x3fd7ee['status'](0xc8)['json']({'output':_0x5c518f});});};exports[_0xd2ec('0x1c')]=function(_0x59205b,_0x2360c8){return pm2[_0xd2ec('0x1c')](_0xd2ec('0x1d'))['then'](function(_0x38798b){logger[_0xd2ec('0x1b')](_0xd2ec('0x1e'),_0x38798b);return _0x2360c8[_0xd2ec('0x11')](0xc8)[_0xd2ec('0x10')]({'output':_0xd2ec('0x1f')});})[_0xd2ec('0x20')](function(_0x10e2c9){logger[_0xd2ec('0x13')](_0x10e2c9);return _0x2360c8[_0xd2ec('0x11')](0x1f4)[_0xd2ec('0x10')](_0x10e2c9);});};exports[_0xd2ec('0x21')]=function(_0x470f81,_0x3abc8c){var _0x190b67=fs['readdirSync'](path[_0xd2ec('0x22')](config[_0xd2ec('0xa')],_0xd2ec('0x23'),'migrations'));var _0x1c9806=[];for(var _0xe54b50=0x0;_0xe54b50<_0x190b67['length'];_0xe54b50++){var _0x24c268=_0x190b67[_0xe54b50][_0xd2ec('0x24')](_0xd2ec('0x25'),'');if(compareVersions(module['exports'][_0xd2ec('0x4')],_0x24c268)===-0x1){_0x1c9806[_0xd2ec('0x26')](_0x24c268);}}if(_0x1c9806[_0xd2ec('0x27')]){var _0x12164b=_0x1c9806[_0xd2ec('0x28')](compareVersions);var _0x33933f=new Umzug({'storage':_0xd2ec('0x29'),'storageOptions':{'model':db[_0xd2ec('0x2a')],'modelName':_0xd2ec('0x2a'),'columnName':_0xd2ec('0x4')},'migrations':{'params':[db[_0xd2ec('0x29')]['getQueryInterface'](),db[_0xd2ec('0x29')][_0xd2ec('0x2b')],function(){throw new Error(_0xd2ec('0x2c'));}],'path':path['join'](config[_0xd2ec('0xa')],_0xd2ec('0x23'),'migrations'),'pattern':/\.js$/}});_0x33933f['up']({'migrations':_[_0xd2ec('0x2d')](_0x12164b,function(_0x11b919){return _0x11b919+_0xd2ec('0x25');})})[_0xd2ec('0x2e')](function(){return _0x3abc8c['status'](0xc8)[_0xd2ec('0x10')]({'output':_0xd2ec('0x2f')+module[_0xd2ec('0xf')][_0xd2ec('0x4')]+_0xd2ec('0x30')+_[_0xd2ec('0x31')](_0x12164b),'migrations':_['join'](_0x12164b)});})[_0xd2ec('0x20')](function(_0x4415cb){if(_0x4415cb instanceof db[_0xd2ec('0x29')][_0xd2ec('0x32')]){return _0x3abc8c[_0xd2ec('0x11')](0xc8)[_0xd2ec('0x10')]({'output':_0xd2ec('0x33')});}else{return _0x3abc8c[_0xd2ec('0x11')](0x1f4)[_0xd2ec('0x10')](_0x4415cb);}});}else{return _0x3abc8c[_0xd2ec('0x11')](0xc8)[_0xd2ec('0x10')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 6ad2a42..ee22705 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 _0x02ef=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0xa7a587,_0x1103e1){var _0x74b664=function(_0x476035){while(--_0x476035){_0xa7a587['push'](_0xa7a587['shift']());}};_0x74b664(++_0x1103e1);}(_0x02ef,0x11c));var _0xf02e=function(_0x5b51d2,_0xd3846c){_0x5b51d2=_0x5b51d2-0x0;var _0x1ecc32=_0x02ef[_0x5b51d2];return _0x1ecc32;};'use strict';var multer=require(_0xf02e('0x0'));var util=require(_0xf02e('0x1'));var path=require('path');var timeout=require(_0xf02e('0x2'));var express=require('express');var router=express[_0xf02e('0x3')]();var fs_extra=require(_0xf02e('0x4'));var auth=require(_0xf02e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xf02e('0x6')]('/',auth[_0xf02e('0x7')](),controller[_0xf02e('0x8')]);router[_0xf02e('0x6')](_0xf02e('0x9'),auth[_0xf02e('0x7')](),controller['describe']);router['get']('/:id',auth[_0xf02e('0x7')](),controller[_0xf02e('0xa')]);router[_0xf02e('0xb')]('/',auth[_0xf02e('0x7')](),controller[_0xf02e('0xc')]);router[_0xf02e('0xd')](_0xf02e('0xe'),auth[_0xf02e('0x7')](),controller[_0xf02e('0xf')]);router[_0xf02e('0x10')](_0xf02e('0xe'),auth[_0xf02e('0x7')](),controller[_0xf02e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8d34=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','delete','multer'];(function(_0x4e0661,_0x3bed13){var _0x1af854=function(_0x5321d5){while(--_0x5321d5){_0x4e0661['push'](_0x4e0661['shift']());}};_0x1af854(++_0x3bed13);}(_0x8d34,0x153));var _0x48d3=function(_0x5012d5,_0xfa431){_0x5012d5=_0x5012d5-0x0;var _0x3c9dad=_0x8d34[_0x5012d5];return _0x3c9dad;};'use strict';var multer=require(_0x48d3('0x0'));var util=require(_0x48d3('0x1'));var path=require(_0x48d3('0x2'));var timeout=require(_0x48d3('0x3'));var express=require(_0x48d3('0x4'));var router=express[_0x48d3('0x5')]();var fs_extra=require(_0x48d3('0x6'));var auth=require(_0x48d3('0x7'));var interaction=require(_0x48d3('0x8'));var config=require(_0x48d3('0x9'));var controller=require(_0x48d3('0xa'));router[_0x48d3('0xb')]('/',auth[_0x48d3('0xc')](),controller[_0x48d3('0xd')]);router[_0x48d3('0xb')](_0x48d3('0xe'),auth[_0x48d3('0xc')](),controller[_0x48d3('0xf')]);router[_0x48d3('0xb')](_0x48d3('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x48d3('0x11')]('/',auth[_0x48d3('0xc')](),controller[_0x48d3('0x12')]);router['put'](_0x48d3('0x10'),auth[_0x48d3('0xc')](),controller['update']);router[_0x48d3('0x13')](_0x48d3('0x10'),auth[_0x48d3('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index cde3907..442f8b2 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 _0xe9e8=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3b0825,_0xfa127c){var _0x4888b6=function(_0xbc9afc){while(--_0xbc9afc){_0x3b0825['push'](_0x3b0825['shift']());}};_0x4888b6(++_0xfa127c);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x5f0765,_0x2e723e){_0x5f0765=_0x5f0765-0x0;var _0x191335=_0xe9e8[_0x5f0765];return _0x191335;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'type':{'type':Sequelize[_0x8e9e('0x2')]},'uniqueid':{'type':Sequelize[_0x8e9e('0x2')]},'calleridnum':{'type':Sequelize[_0x8e9e('0x2')]},'calleridname':{'type':Sequelize[_0x8e9e('0x2')]},'queue':{'type':Sequelize[_0x8e9e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8e9e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8e9e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8e9e('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8e9e('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8e9e('0x3')]},'holdtime':{'type':Sequelize[_0x8e9e('0x4')]},'agentcomplete':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8e9e('0x4')]},'agentacw':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8e9e('0x2')]},'lastevent':{'type':Sequelize[_0x8e9e('0x2')]},'channel':{'type':Sequelize[_0x8e9e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8e9e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8e9e('0x2')]},'connectedlinename':{'type':Sequelize[_0x8e9e('0x2')]},'language':{'type':Sequelize[_0x8e9e('0x2')]},'accountcode':{'type':Sequelize[_0x8e9e('0x2')]},'context':{'type':Sequelize[_0x8e9e('0x2')]},'exten':{'type':Sequelize[_0x8e9e('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x8e9e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8e9e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8e9e('0x2')]},'destcalleridname':{'type':Sequelize[_0x8e9e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8e9e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8e9e('0x2')]},'destlanguage':{'type':Sequelize[_0x8e9e('0x2')]},'destaccountcode':{'type':Sequelize[_0x8e9e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x8e9e('0x2')]},'destuniqueid':{'type':Sequelize[_0x8e9e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x8e9e('0x2')]},'transfer':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8e9e('0x2')],'comment':_0x8e9e('0x6')},'transferexten':{'type':Sequelize[_0x8e9e('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1619=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE'];(function(_0xedf622,_0x5a854d){var _0x245b71=function(_0x2058a2){while(--_0x2058a2){_0xedf622['push'](_0xedf622['shift']());}};_0x245b71(++_0x5a854d);}(_0x1619,0x189));var _0x9161=function(_0x296970,_0x4f1121){_0x296970=_0x296970-0x0;var _0x30af0=_0x1619[_0x296970];return _0x30af0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9161('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9161('0x0')]},'calleridname':{'type':Sequelize[_0x9161('0x0')]},'queue':{'type':Sequelize[_0x9161('0x0')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9161('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9161('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x9161('0x1')]},'holdtime':{'type':Sequelize[_0x9161('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9161('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9161('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x9161('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9161('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9161('0x0')]},'channelstate':{'type':Sequelize[_0x9161('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9161('0x0')]},'connectedlinenum':{'type':Sequelize[_0x9161('0x0')]},'connectedlinename':{'type':Sequelize[_0x9161('0x0')]},'language':{'type':Sequelize[_0x9161('0x0')]},'accountcode':{'type':Sequelize[_0x9161('0x0')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x9161('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9161('0x0')]},'destcalleridname':{'type':Sequelize[_0x9161('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x9161('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x9161('0x0')]},'destlanguage':{'type':Sequelize[_0x9161('0x0')]},'destaccountcode':{'type':Sequelize[_0x9161('0x0')]},'destcontext':{'type':Sequelize[_0x9161('0x0')]},'destexten':{'type':Sequelize[_0x9161('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x9161('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9161('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x9161('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9161('0x0')],'comment':_0x9161('0x4')},'transferexten':{'type':Sequelize[_0x9161('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x9161('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 6d4124a..294baff 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(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 e157cf6..d130bf8 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 _0x47c7=['api','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0x47c7,0x1ab));var _0x747c=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x47c7[_0x1bc013];return _0x55df36;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var moment=require('moment');var BPromise=require(_0x747c('0x3'));var rp=require(_0x747c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x747c('0x5'));var config=require(_0x747c('0x6'));var attributes=require(_0x747c('0x7'));module[_0x747c('0x8')]=function(_0x5e991e,_0xa1148a){return _0x5e991e['define'](_0x747c('0x9'),attributes,{'tableName':_0x747c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x747c('0xb'),_0x747c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0a1=['../../config/logger','api','moment','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x9d282a,_0x151fad){_0x9d282a=_0x9d282a-0x0;var _0x20054a=_0xa0a1[_0x9d282a];return _0x20054a;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var logger=require(_0x1a0a('0x1'))(_0x1a0a('0x2'));var moment=require(_0x1a0a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a0a('0x4'));var rimraf=require(_0x1a0a('0x5'));var config=require('../../config/environment');var attributes=require(_0x1a0a('0x6'));module[_0x1a0a('0x7')]=function(_0x4b5573,_0x2d4b04){return _0x4b5573[_0x1a0a('0x8')](_0x1a0a('0x9'),attributes,{'tableName':_0x1a0a('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1a0a('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 6040dd2..72165b4 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 _0xd341=['where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','catch','update'];(function(_0x481e97,_0x248bea){var _0x181f42=function(_0x5b4d83){while(--_0x5b4d83){_0x481e97['push'](_0x481e97['shift']());}};_0x181f42(++_0x248bea);}(_0xd341,0x13f));var _0x1d34=function(_0x268987,_0x3d4499){_0x268987=_0x268987-0x0;var _0x2d7b99=_0xd341[_0x268987];return _0x2d7b99;};'use strict';var _=require(_0x1d34('0x0'));var util=require(_0x1d34('0x1'));var moment=require(_0x1d34('0x2'));var BPromise=require(_0x1d34('0x3'));var rs=require(_0x1d34('0x4'));var fs=require('fs');var Redis=require(_0x1d34('0x5'));var db=require(_0x1d34('0x6'))['db'];var utils=require(_0x1d34('0x7'));var logger=require(_0x1d34('0x8'))(_0x1d34('0x9'));var config=require(_0x1d34('0xa'));var jayson=require(_0x1d34('0xb'));var client=jayson['client'][_0x1d34('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x456aad,_0x3af851,_0x3da43d){return new BPromise(function(_0xbbe970,_0x3fbffd){return client[_0x1d34('0xd')](_0x456aad,_0x3da43d)[_0x1d34('0xe')](function(_0x4224b3){logger['info'](_0x1d34('0xf'),_0x3af851,'request\x20sent');logger[_0x1d34('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x3af851,_0x1d34('0x11'),JSON[_0x1d34('0x12')](_0x4224b3));if(_0x4224b3[_0x1d34('0x13')]){if(_0x4224b3[_0x1d34('0x13')][_0x1d34('0x14')]===0x1f4){logger[_0x1d34('0x13')](_0x1d34('0xf'),_0x3af851,_0x4224b3[_0x1d34('0x13')]['message']);return _0x3fbffd(_0x4224b3[_0x1d34('0x13')][_0x1d34('0x15')]);}logger[_0x1d34('0x13')](_0x1d34('0xf'),_0x3af851,_0x4224b3['error'][_0x1d34('0x15')]);return _0xbbe970(_0x4224b3['error'][_0x1d34('0x15')]);}else{logger[_0x1d34('0x16')](_0x1d34('0xf'),_0x3af851,_0x1d34('0x11'));_0xbbe970(_0x4224b3[_0x1d34('0x17')]['message']);}})['catch'](function(_0x56ae0e){logger[_0x1d34('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x3af851,_0x56ae0e);_0x3fbffd(_0x56ae0e);});});}exports[_0x1d34('0x18')]=function(_0x344c52){var _0x408598=this;return new Promise(function(_0x514945,_0xfe4cb7){return db[_0x1d34('0x19')][_0x1d34('0x1a')](_0x344c52['body'],{'raw':_0x344c52[_0x1d34('0x1b')]?_0x344c52['options'][_0x1d34('0x1c')]===undefined?!![]:![]:!![]})[_0x1d34('0xe')](function(_0x291ba8){logger['info'](_0x1d34('0x18'),_0x344c52);logger['debug'](_0x1d34('0x18'),_0x344c52,JSON[_0x1d34('0x12')](_0x291ba8));_0x514945(_0x291ba8);})[_0x1d34('0x1d')](function(_0x13442d){logger[_0x1d34('0x13')](_0x1d34('0x18'),_0x13442d[_0x1d34('0x15')],_0x344c52);_0xfe4cb7(_0x408598[_0x1d34('0x13')](0x1f4,_0x13442d[_0x1d34('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2adf85){var _0x34f5d8=this;return new Promise(function(_0xc587ff,_0x397edc){return db['VoiceAgentReport'][_0x1d34('0x1e')](_0x2adf85['body'],{'raw':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x1f')]||null:null,'attributes':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x20')]||null:null,'limit':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x21')]||null:null})['then'](function(_0x45a3d7){logger[_0x1d34('0x16')]('UpdateVoiceAgentReport',_0x2adf85);logger['debug'](_0x1d34('0x22'),_0x2adf85,JSON[_0x1d34('0x12')](_0x45a3d7));_0xc587ff(_0x45a3d7);})[_0x1d34('0x1d')](function(_0x177fc4){logger['error'](_0x1d34('0x22'),_0x177fc4[_0x1d34('0x15')],_0x2adf85);_0x397edc(_0x34f5d8[_0x1d34('0x13')](0x1f4,_0x177fc4[_0x1d34('0x15')]));});});}; \ No newline at end of file +var _0x1b6f=['create','options','raw','then','debug','stringify','UpdateVoiceAgentReport','update','body','where','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x563af1,_0x37924c){var _0x58fccb=function(_0x509595){while(--_0x509595){_0x563af1['push'](_0x563af1['shift']());}};_0x58fccb(++_0x37924c);}(_0x1b6f,0x173));var _0xf1b6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x1b6f[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xf1b6('0x0'));var util=require(_0xf1b6('0x1'));var moment=require('moment');var BPromise=require(_0xf1b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1b6('0x3'));var db=require(_0xf1b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1b6('0x5'))(_0xf1b6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf1b6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x231ecf,_0x4885f0,_0x32ef69){return new BPromise(function(_0x37f5e3,_0x2fd64f){return client[_0xf1b6('0x8')](_0x231ecf,_0x32ef69)['then'](function(_0x165ad5){logger['info'](_0xf1b6('0x9'),_0x4885f0,_0xf1b6('0xa'));logger['debug'](_0xf1b6('0xb'),_0x4885f0,'request\x20sent',JSON['stringify'](_0x165ad5));if(_0x165ad5[_0xf1b6('0xc')]){if(_0x165ad5[_0xf1b6('0xc')][_0xf1b6('0xd')]===0x1f4){logger[_0xf1b6('0xc')](_0xf1b6('0x9'),_0x4885f0,_0x165ad5[_0xf1b6('0xc')][_0xf1b6('0xe')]);return _0x2fd64f(_0x165ad5[_0xf1b6('0xc')][_0xf1b6('0xe')]);}logger[_0xf1b6('0xc')](_0xf1b6('0x9'),_0x4885f0,_0x165ad5[_0xf1b6('0xc')][_0xf1b6('0xe')]);return _0x37f5e3(_0x165ad5[_0xf1b6('0xc')]['message']);}else{logger[_0xf1b6('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x4885f0,'request\x20sent');_0x37f5e3(_0x165ad5['result'][_0xf1b6('0xe')]);}})[_0xf1b6('0x10')](function(_0x4ebd48){logger[_0xf1b6('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x4885f0,_0x4ebd48);_0x2fd64f(_0x4ebd48);});});}exports[_0xf1b6('0x11')]=function(_0xa5c5d8){var _0xf1c93a=this;return new Promise(function(_0x3be434,_0x5cf3bb){return db[_0xf1b6('0x12')][_0xf1b6('0x13')](_0xa5c5d8['body'],{'raw':_0xa5c5d8['options']?_0xa5c5d8[_0xf1b6('0x14')][_0xf1b6('0x15')]===undefined?!![]:![]:!![]})[_0xf1b6('0x16')](function(_0xb4ee94){logger['info'](_0xf1b6('0x11'),_0xa5c5d8);logger[_0xf1b6('0x17')](_0xf1b6('0x11'),_0xa5c5d8,JSON[_0xf1b6('0x18')](_0xb4ee94));_0x3be434(_0xb4ee94);})[_0xf1b6('0x10')](function(_0x6b8da1){logger[_0xf1b6('0xc')](_0xf1b6('0x11'),_0x6b8da1[_0xf1b6('0xe')],_0xa5c5d8);_0x5cf3bb(_0xf1c93a[_0xf1b6('0xc')](0x1f4,_0x6b8da1[_0xf1b6('0xe')]));});});};exports[_0xf1b6('0x19')]=function(_0x330b3b){var _0x512a1c=this;return new Promise(function(_0xb62e8d,_0x21586e){return db[_0xf1b6('0x12')][_0xf1b6('0x1a')](_0x330b3b[_0xf1b6('0x1b')],{'raw':_0x330b3b[_0xf1b6('0x14')]?_0x330b3b['options'][_0xf1b6('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x330b3b[_0xf1b6('0x14')]?_0x330b3b[_0xf1b6('0x14')][_0xf1b6('0x1c')]||null:null,'attributes':_0x330b3b[_0xf1b6('0x14')]?_0x330b3b[_0xf1b6('0x14')]['attributes']||null:null,'limit':_0x330b3b['options']?_0x330b3b[_0xf1b6('0x14')][_0xf1b6('0x1d')]||null:null})[_0xf1b6('0x16')](function(_0x5d1fde){logger[_0xf1b6('0xf')]('UpdateVoiceAgentReport',_0x330b3b);logger[_0xf1b6('0x17')](_0xf1b6('0x19'),_0x330b3b,JSON[_0xf1b6('0x18')](_0x5d1fde));_0xb62e8d(_0x5d1fde);})[_0xf1b6('0x10')](function(_0x784047){logger[_0xf1b6('0xc')](_0xf1b6('0x19'),_0x784047[_0xf1b6('0xe')],_0x330b3b);_0x21586e(_0x512a1c[_0xf1b6('0xc')](0x1f4,_0x784047[_0xf1b6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0f72e34..c41b73e 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 _0x9a19=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x547971,_0x5ebb81){var _0xc4587e=function(_0x70eb46){while(--_0x70eb46){_0x547971['push'](_0x547971['shift']());}};_0xc4587e(++_0x5ebb81);}(_0x9a19,0x114));var _0x99a1=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0x9a19[_0x4cce65];return _0x4d1b45;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x99a1('0xa')](_0x99a1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x99a1('0xe')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x10')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0x11')]);router[_0x99a1('0x12')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x13')]);module[_0x99a1('0x14')]=router; \ No newline at end of file +var _0xd13e=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x30597e,_0x3d3e66){var _0x17b1cf=function(_0xa3d995){while(--_0xa3d995){_0x30597e['push'](_0x30597e['shift']());}};_0x17b1cf(++_0x3d3e66);}(_0xd13e,0x193));var _0xed13=function(_0x2f6b47,_0x2f07f5){_0x2f6b47=_0x2f6b47-0x0;var _0xc86acc=_0xd13e[_0x2f6b47];return _0xc86acc;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),auth[_0xed13('0xa')](),controller[_0xed13('0xb')]);router[_0xed13('0x8')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0xd')]);router[_0xed13('0xe')]('/',auth['isAuthenticated'](),controller[_0xed13('0xf')]);router[_0xed13('0x10')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x11')]);router['delete'](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x12')]);module[_0xed13('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 36214a8..aa28b78 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 _0xc5dc=['outbound','outbound-fax','TEXT','DATE','INTEGER','STRING','internal'];(function(_0x1e50da,_0x2c91ef){var _0x22d8ed=function(_0x273755){while(--_0x273755){_0x1e50da['push'](_0x1e50da['shift']());}};_0x22d8ed(++_0x2c91ef);}(_0xc5dc,0xc2));var _0xcc5d=function(_0x4f9c62,_0x108d62){_0x4f9c62=_0x4f9c62-0x0;var _0x5b04c3=_0xc5dc[_0x4f9c62];return _0x5b04c3;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcc5d('0x0')]},'type':{'type':Sequelize['ENUM']('inbound',_0xcc5d('0x1'),_0xcc5d('0x2'),'inbound-fax',_0xcc5d('0x3'),'dialer')},'tag':{'type':Sequelize[_0xcc5d('0x0')]},'accountcode':{'type':Sequelize[_0xcc5d('0x0')]},'source':{'type':Sequelize[_0xcc5d('0x0')]},'destination':{'type':Sequelize[_0xcc5d('0x0')]},'destinationcontext':{'type':Sequelize[_0xcc5d('0x0')]},'callerid':{'type':Sequelize[_0xcc5d('0x0')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xcc5d('0x0')]},'lastdata':{'type':Sequelize[_0xcc5d('0x4')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xcc5d('0x5')]},'endtime':{'type':Sequelize[_0xcc5d('0x5')]},'duration':{'type':Sequelize[_0xcc5d('0x6')]},'billableseconds':{'type':Sequelize[_0xcc5d('0x6')]},'mohtime':{'type':Sequelize[_0xcc5d('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xcc5d('0x0')]},'userfield':{'type':Sequelize[_0xcc5d('0x0')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xcc5d('0x0')]},'userThirdDisposition':{'type':Sequelize[_0xcc5d('0x0')]},'note':{'type':Sequelize[_0xcc5d('0x0')]},'prefix':{'type':Sequelize[_0xcc5d('0x0')]},'routeid':{'type':Sequelize[_0xcc5d('0x6')]},'sipcallid':{'type':Sequelize[_0xcc5d('0x0')]}}; \ No newline at end of file +var _0xe785=['exports','ENUM','inbound','internal','outbound','dialer','STRING','TEXT','DATE','INTEGER','sequelize'];(function(_0x5786d4,_0x3d8ff7){var _0x192719=function(_0x381efe){while(--_0x381efe){_0x5786d4['push'](_0x5786d4['shift']());}};_0x192719(++_0x3d8ff7);}(_0xe785,0x128));var _0x5e78=function(_0x5c99d5,_0x41a4ac){_0x5c99d5=_0x5c99d5-0x0;var _0x1e6020=_0xe785[_0x5c99d5];return _0x1e6020;};'use strict';var Sequelize=require(_0x5e78('0x0'));module[_0x5e78('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5e78('0x2')](_0x5e78('0x3'),_0x5e78('0x4'),_0x5e78('0x5'),'inbound-fax','outbound-fax',_0x5e78('0x6'))},'tag':{'type':Sequelize[_0x5e78('0x7')]},'accountcode':{'type':Sequelize[_0x5e78('0x7')]},'source':{'type':Sequelize[_0x5e78('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5e78('0x7')]},'channel':{'type':Sequelize[_0x5e78('0x7')]},'destinationchannel':{'type':Sequelize[_0x5e78('0x7')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5e78('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x5e78('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5e78('0x9')]},'duration':{'type':Sequelize[_0x5e78('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5e78('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5e78('0x7')]},'amaflags':{'type':Sequelize[_0x5e78('0x7')]},'userfield':{'type':Sequelize[_0x5e78('0x7')]},'userDisposition':{'type':Sequelize[_0x5e78('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x5e78('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x5e78('0x7')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5e78('0x7')]},'routeid':{'type':Sequelize[_0x5e78('0xa')]},'sipcallid':{'type':Sequelize[_0x5e78('0x7')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 6172589..4273ae5 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 6561d08..966bc5c 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 _0xb7ee=['exports','define','VoiceCallReport','report_call','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x2049bd,_0xd5e939){var _0x407aaf=function(_0x132602){while(--_0x132602){_0x2049bd['push'](_0x2049bd['shift']());}};_0x407aaf(++_0xd5e939);}(_0xb7ee,0xba));var _0xeb7e=function(_0x5aae0c,_0x1568e2){_0x5aae0c=_0x5aae0c-0x0;var _0x268b6d=_0xb7ee[_0x5aae0c];return _0x268b6d;};'use strict';var _=require(_0xeb7e('0x0'));var util=require(_0xeb7e('0x1'));var logger=require(_0xeb7e('0x2'))('api');var moment=require(_0xeb7e('0x3'));var BPromise=require(_0xeb7e('0x4'));var rp=require(_0xeb7e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb7e('0x6'));var config=require(_0xeb7e('0x7'));var attributes=require(_0xeb7e('0x8'));module[_0xeb7e('0x9')]=function(_0x4731aa,_0x3ba801){return _0x4731aa[_0xeb7e('0xa')](_0xeb7e('0xb'),attributes,{'tableName':_0xeb7e('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e47=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x112173,_0x58333e){var _0x400f0a=function(_0x24d6b1){while(--_0x24d6b1){_0x112173['push'](_0x112173['shift']());}};_0x400f0a(++_0x58333e);}(_0x6e47,0x169));var _0x76e4=function(_0xe349ba,_0x5beb60){_0xe349ba=_0xe349ba-0x0;var _0x4a58b2=_0x6e47[_0xe349ba];return _0x4a58b2;};'use strict';var _=require(_0x76e4('0x0'));var util=require(_0x76e4('0x1'));var logger=require(_0x76e4('0x2'))(_0x76e4('0x3'));var moment=require(_0x76e4('0x4'));var BPromise=require(_0x76e4('0x5'));var rp=require(_0x76e4('0x6'));var fs=require('fs');var path=require(_0x76e4('0x7'));var rimraf=require(_0x76e4('0x8'));var config=require(_0x76e4('0x9'));var attributes=require(_0x76e4('0xa'));module[_0x76e4('0xb')]=function(_0x31795a,_0xe533d8){return _0x31795a['define']('VoiceCallReport',attributes,{'tableName':_0x76e4('0xc'),'paranoid':![],'indexes':[{'fields':[_0x76e4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index ca79ebc..ef4b5d0 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 _0xbedf=['limit','include','model','attributes','then','CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','update','body','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xbedf,0x11b));var _0xfbed=function(_0x11eb1f,_0x826f0b){_0x11eb1f=_0x11eb1f-0x0;var _0x2121e9=_0xbedf[_0x11eb1f];return _0x2121e9;};'use strict';var _=require(_0xfbed('0x0'));var util=require(_0xfbed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbed('0x2'))['db'];var utils=require(_0xfbed('0x3'));var logger=require(_0xfbed('0x4'))(_0xfbed('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfbed('0x6')][_0xfbed('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a6bdb,_0x146330,_0x566c50){return new BPromise(function(_0x3c2190,_0x372c09){return client['request'](_0x1a6bdb,_0x566c50)['then'](function(_0x1e7062){logger[_0xfbed('0x8')](_0xfbed('0x9'),_0x146330,'request\x20sent');logger[_0xfbed('0xa')](_0xfbed('0xb'),_0x146330,_0xfbed('0xc'),JSON[_0xfbed('0xd')](_0x1e7062));if(_0x1e7062[_0xfbed('0xe')]){if(_0x1e7062['error']['code']===0x1f4){logger[_0xfbed('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x146330,_0x1e7062[_0xfbed('0xe')][_0xfbed('0xf')]);return _0x372c09(_0x1e7062['error'][_0xfbed('0xf')]);}logger[_0xfbed('0xe')](_0xfbed('0x9'),_0x146330,_0x1e7062['error']['message']);return _0x3c2190(_0x1e7062[_0xfbed('0xe')]['message']);}else{logger['info'](_0xfbed('0x9'),_0x146330,_0xfbed('0xc'));_0x3c2190(_0x1e7062[_0xfbed('0x10')][_0xfbed('0xf')]);}})[_0xfbed('0x11')](function(_0x5a2381){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x146330,_0x5a2381);_0x372c09(_0x5a2381);});});}exports[_0xfbed('0x12')]=function(_0x312bec){var _0x41cc01=this;return new Promise(function(_0x5c417b,_0x10b1ac){return db[_0xfbed('0x13')][_0xfbed('0x14')]({'raw':_0x312bec['options']?_0x312bec[_0xfbed('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x312bec['options']?_0x312bec[_0xfbed('0x15')][_0xfbed('0x16')]||null:null,'attributes':_0x312bec['options']?_0x312bec['options']['attributes']||null:null,'limit':_0x312bec['options']?_0x312bec[_0xfbed('0x15')][_0xfbed('0x17')]||null:null,'include':_0x312bec[_0xfbed('0x15')]?_0x312bec[_0xfbed('0x15')][_0xfbed('0x18')]?_['map'](_0x312bec[_0xfbed('0x15')][_0xfbed('0x18')],function(_0x52ac10){return{'model':db[_0x52ac10[_0xfbed('0x19')]],'as':_0x52ac10['as'],'attributes':_0x52ac10[_0xfbed('0x1a')],'include':_0x52ac10['include']?_['map'](_0x52ac10[_0xfbed('0x18')],function(_0x2e895c){return{'model':db[_0x2e895c['model']],'as':_0x2e895c['as'],'attributes':_0x2e895c['attributes'],'include':_0x2e895c[_0xfbed('0x18')]?_['map'](_0x2e895c[_0xfbed('0x18')],function(_0x108368){return{'model':db[_0x108368['model']],'as':_0x108368['as'],'attributes':_0x108368[_0xfbed('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfbed('0x1b')](function(_0x450551){logger[_0xfbed('0x8')]('GetVoiceCallReport',_0x312bec);logger[_0xfbed('0xa')](_0xfbed('0x12'),_0x312bec,JSON['stringify'](_0x450551));_0x5c417b(_0x450551);})[_0xfbed('0x11')](function(_0x2bdccd){logger[_0xfbed('0xe')](_0xfbed('0x12'),_0x2bdccd['message'],_0x312bec);_0x10b1ac(_0x41cc01[_0xfbed('0xe')](0x1f4,_0x2bdccd['message']));});});};exports[_0xfbed('0x1c')]=function(_0x586b67){var _0xbb0802=this;return new Promise(function(_0x428734,_0x3f87e9){return db[_0xfbed('0x13')][_0xfbed('0x1d')](_0x586b67['body'],{'raw':_0x586b67['options']?_0x586b67[_0xfbed('0x15')][_0xfbed('0x1e')]===undefined?!![]:![]:!![]})[_0xfbed('0x1b')](function(_0x3bdbbd){logger[_0xfbed('0x8')](_0xfbed('0x1c'),_0x586b67);logger['debug']('CreateVoiceCallReport',_0x586b67,JSON[_0xfbed('0xd')](_0x3bdbbd));_0x428734(_0x3bdbbd);})[_0xfbed('0x11')](function(_0x3551ba){logger[_0xfbed('0xe')](_0xfbed('0x1c'),_0x3551ba[_0xfbed('0xf')],_0x586b67);_0x3f87e9(_0xbb0802['error'](0x1f4,_0x3551ba[_0xfbed('0xf')]));});});};exports[_0xfbed('0x1f')]=function(_0x4b8eb7){var _0x574326=this;return new Promise(function(_0x273e29,_0x3e2420){return db[_0xfbed('0x13')][_0xfbed('0x20')](_0x4b8eb7[_0xfbed('0x21')],{'raw':_0x4b8eb7['options']?_0x4b8eb7['options'][_0xfbed('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b8eb7[_0xfbed('0x15')]?_0x4b8eb7[_0xfbed('0x15')][_0xfbed('0x16')]||null:null,'attributes':_0x4b8eb7[_0xfbed('0x15')]?_0x4b8eb7['options'][_0xfbed('0x1a')]||null:null,'limit':_0x4b8eb7['options']?_0x4b8eb7[_0xfbed('0x15')][_0xfbed('0x17')]||null:null})[_0xfbed('0x1b')](function(_0x696277){logger[_0xfbed('0x8')](_0xfbed('0x1f'),_0x4b8eb7);logger[_0xfbed('0xa')](_0xfbed('0x1f'),_0x4b8eb7,JSON['stringify'](_0x696277));_0x273e29(_0x696277);})[_0xfbed('0x11')](function(_0x38a59b){logger[_0xfbed('0xe')](_0xfbed('0x1f'),_0x38a59b[_0xfbed('0xf')],_0x4b8eb7);_0x3e2420(_0x574326[_0xfbed('0xe')](0x1f4,_0x38a59b[_0xfbed('0xf')]));});});}; \ No newline at end of file +var _0xef3d=['update','UpdateVoiceCallReport','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','body'];(function(_0x5714e0,_0xbf4ccd){var _0x348053=function(_0x32e904){while(--_0x32e904){_0x5714e0['push'](_0x5714e0['shift']());}};_0x348053(++_0xbf4ccd);}(_0xef3d,0x1f0));var _0xdef3=function(_0x53bfa8,_0x58fa71){_0x53bfa8=_0x53bfa8-0x0;var _0x1f4e56=_0xef3d[_0x53bfa8];return _0x1f4e56;};'use strict';var _=require(_0xdef3('0x0'));var util=require(_0xdef3('0x1'));var moment=require('moment');var BPromise=require(_0xdef3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdef3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdef3('0x4'));var logger=require(_0xdef3('0x5'))(_0xdef3('0x6'));var config=require(_0xdef3('0x7'));var jayson=require(_0xdef3('0x8'));var client=jayson[_0xdef3('0x9')][_0xdef3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44c1d8,_0x15461c,_0x53375e){return new BPromise(function(_0x1c8380,_0x334734){return client[_0xdef3('0xb')](_0x44c1d8,_0x53375e)[_0xdef3('0xc')](function(_0x21fcba){logger[_0xdef3('0xd')](_0xdef3('0xe'),_0x15461c,'request\x20sent');logger[_0xdef3('0xf')](_0xdef3('0x10'),_0x15461c,_0xdef3('0x11'),JSON[_0xdef3('0x12')](_0x21fcba));if(_0x21fcba['error']){if(_0x21fcba[_0xdef3('0x13')]['code']===0x1f4){logger[_0xdef3('0x13')](_0xdef3('0xe'),_0x15461c,_0x21fcba[_0xdef3('0x13')][_0xdef3('0x14')]);return _0x334734(_0x21fcba[_0xdef3('0x13')][_0xdef3('0x14')]);}logger['error'](_0xdef3('0xe'),_0x15461c,_0x21fcba[_0xdef3('0x13')][_0xdef3('0x14')]);return _0x1c8380(_0x21fcba[_0xdef3('0x13')][_0xdef3('0x14')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x15461c,_0xdef3('0x11'));_0x1c8380(_0x21fcba[_0xdef3('0x15')][_0xdef3('0x14')]);}})[_0xdef3('0x16')](function(_0x378853){logger[_0xdef3('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x15461c,_0x378853);_0x334734(_0x378853);});});}exports[_0xdef3('0x17')]=function(_0x5367f2){var _0x45719c=this;return new Promise(function(_0x9fb9b3,_0x49d4c1){return db[_0xdef3('0x18')]['findAll']({'raw':_0x5367f2[_0xdef3('0x19')]?_0x5367f2['options'][_0xdef3('0x1a')]===undefined?!![]:![]:!![],'where':_0x5367f2[_0xdef3('0x19')]?_0x5367f2[_0xdef3('0x19')][_0xdef3('0x1b')]||null:null,'attributes':_0x5367f2[_0xdef3('0x19')]?_0x5367f2['options']['attributes']||null:null,'limit':_0x5367f2['options']?_0x5367f2[_0xdef3('0x19')][_0xdef3('0x1c')]||null:null,'include':_0x5367f2[_0xdef3('0x19')]?_0x5367f2[_0xdef3('0x19')][_0xdef3('0x1d')]?_[_0xdef3('0x1e')](_0x5367f2[_0xdef3('0x19')]['include'],function(_0x1233d5){return{'model':db[_0x1233d5[_0xdef3('0x1f')]],'as':_0x1233d5['as'],'attributes':_0x1233d5[_0xdef3('0x20')],'include':_0x1233d5[_0xdef3('0x1d')]?_['map'](_0x1233d5[_0xdef3('0x1d')],function(_0x1f68b4){return{'model':db[_0x1f68b4[_0xdef3('0x1f')]],'as':_0x1f68b4['as'],'attributes':_0x1f68b4[_0xdef3('0x20')],'include':_0x1f68b4[_0xdef3('0x1d')]?_['map'](_0x1f68b4['include'],function(_0x9b25cd){return{'model':db[_0x9b25cd[_0xdef3('0x1f')]],'as':_0x9b25cd['as'],'attributes':_0x9b25cd[_0xdef3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdef3('0xc')](function(_0x4e7e50){logger[_0xdef3('0xd')](_0xdef3('0x17'),_0x5367f2);logger[_0xdef3('0xf')](_0xdef3('0x17'),_0x5367f2,JSON[_0xdef3('0x12')](_0x4e7e50));_0x9fb9b3(_0x4e7e50);})[_0xdef3('0x16')](function(_0x4e9d38){logger[_0xdef3('0x13')]('GetVoiceCallReport',_0x4e9d38[_0xdef3('0x14')],_0x5367f2);_0x49d4c1(_0x45719c[_0xdef3('0x13')](0x1f4,_0x4e9d38[_0xdef3('0x14')]));});});};exports[_0xdef3('0x21')]=function(_0x5c0e5c){var _0x425a9e=this;return new Promise(function(_0x1f12ae,_0x3da4e3){return db[_0xdef3('0x18')][_0xdef3('0x22')](_0x5c0e5c[_0xdef3('0x23')],{'raw':_0x5c0e5c[_0xdef3('0x19')]?_0x5c0e5c[_0xdef3('0x19')][_0xdef3('0x1a')]===undefined?!![]:![]:!![]})[_0xdef3('0xc')](function(_0x1f8d5c){logger['info'](_0xdef3('0x21'),_0x5c0e5c);logger['debug'](_0xdef3('0x21'),_0x5c0e5c,JSON['stringify'](_0x1f8d5c));_0x1f12ae(_0x1f8d5c);})['catch'](function(_0x23d593){logger[_0xdef3('0x13')](_0xdef3('0x21'),_0x23d593[_0xdef3('0x14')],_0x5c0e5c);_0x3da4e3(_0x425a9e[_0xdef3('0x13')](0x1f4,_0x23d593['message']));});});};exports['UpdateVoiceCallReport']=function(_0x100c12){var _0x21d675=this;return new Promise(function(_0x3c7f50,_0x1ae915){return db['VoiceCallReport'][_0xdef3('0x24')](_0x100c12[_0xdef3('0x23')],{'raw':_0x100c12[_0xdef3('0x19')]?_0x100c12[_0xdef3('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x100c12[_0xdef3('0x19')]?_0x100c12[_0xdef3('0x19')][_0xdef3('0x1b')]||null:null,'attributes':_0x100c12[_0xdef3('0x19')]?_0x100c12[_0xdef3('0x19')][_0xdef3('0x20')]||null:null,'limit':_0x100c12[_0xdef3('0x19')]?_0x100c12['options']['limit']||null:null})[_0xdef3('0xc')](function(_0x1943e9){logger[_0xdef3('0xd')]('UpdateVoiceCallReport',_0x100c12);logger[_0xdef3('0xf')](_0xdef3('0x25'),_0x100c12,JSON[_0xdef3('0x12')](_0x1943e9));_0x3c7f50(_0x1943e9);})[_0xdef3('0x16')](function(_0x3f66ca){logger[_0xdef3('0x13')](_0xdef3('0x25'),_0x3f66ca['message'],_0x100c12);_0x1ae915(_0x21d675[_0xdef3('0x13')](0x1f4,_0x3f66ca['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3dc158e..8ebfe19 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 _0x0c0c=['../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x0c0c,0x19b));var _0xc0c0=function(_0x3d736e,_0x379572){_0x3d736e=_0x3d736e-0x0;var _0x404263=_0x0c0c[_0x3d736e];return _0x404263;};'use strict';var multer=require(_0xc0c0('0x0'));var util=require(_0xc0c0('0x1'));var path=require(_0xc0c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0c0('0x3'));var router=express[_0xc0c0('0x4')]();var fs_extra=require(_0xc0c0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc0c0('0x6'));var config=require(_0xc0c0('0x7'));var controller=require(_0xc0c0('0x8'));router[_0xc0c0('0x9')]('/',auth['isAuthenticated'](),controller[_0xc0c0('0xa')]);router[_0xc0c0('0x9')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller['show']);router[_0xc0c0('0xd')]('/',auth[_0xc0c0('0xc')](),controller[_0xc0c0('0xe')]);router[_0xc0c0('0xf')](_0xc0c0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc0c0('0x10')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller[_0xc0c0('0x11')]);module[_0xc0c0('0x12')]=router; \ No newline at end of file +var _0xc2d4=['index','/:id','isAuthenticated','show','post','create','update','delete','destroy','multer','util','path','Router','fs-extra','./voiceChanSpy.controller','get'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xc2d4,0xa9));var _0x4c2d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2d4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4c2d('0x0'));var util=require(_0x4c2d('0x1'));var path=require(_0x4c2d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c2d('0x3')]();var fs_extra=require(_0x4c2d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4c2d('0x5'));router[_0x4c2d('0x6')]('/',auth['isAuthenticated'](),controller[_0x4c2d('0x7')]);router[_0x4c2d('0x6')](_0x4c2d('0x8'),auth[_0x4c2d('0x9')](),controller[_0x4c2d('0xa')]);router[_0x4c2d('0xb')]('/',auth[_0x4c2d('0x9')](),controller[_0x4c2d('0xc')]);router['put'](_0x4c2d('0x8'),auth[_0x4c2d('0x9')](),controller[_0x4c2d('0xd')]);router[_0x4c2d('0xe')](_0x4c2d('0x8'),auth[_0x4c2d('0x9')](),controller[_0x4c2d('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index a5c398a..b3b7373 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 _0x96aa=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x210c74,_0x4e2446){var _0x2c6ffd=function(_0x434243){while(--_0x434243){_0x210c74['push'](_0x210c74['shift']());}};_0x2c6ffd(++_0x4e2446);}(_0x96aa,0x175));var _0xa96a=function(_0x4cc894,_0x2671f5){_0x4cc894=_0x4cc894-0x0;var _0x24f93e=_0x96aa[_0x4cc894];return _0x24f93e;};'use strict';var Sequelize=require(_0xa96a('0x0'));module[_0xa96a('0x1')]={'name':{'type':Sequelize[_0xa96a('0x2')]},'prefix':{'type':Sequelize[_0xa96a('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x206825){this[_0xa96a('0x3')](_0xa96a('0x4'),_0x206825?_0x206825['join'](''):[]);},'get':function(){return this[_0xa96a('0x5')](_0xa96a('0x4'))?this[_0xa96a('0x5')]('options')[_0xa96a('0x6')](''):[];}},'auth':{'type':Sequelize[_0xa96a('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xa96a('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa96a('0x2')]},'description':{'type':Sequelize[_0xa96a('0x2')]}}; \ No newline at end of file +var _0x7ab2=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x525c39,_0xfe0880){var _0x25e620=function(_0x98041a){while(--_0x98041a){_0x525c39['push'](_0x525c39['shift']());}};_0x25e620(++_0xfe0880);}(_0x7ab2,0xa4));var _0x27ab=function(_0x41b1f4,_0x46ff86){_0x41b1f4=_0x41b1f4-0x0;var _0x5a30ff=_0x7ab2[_0x41b1f4];return _0x5a30ff;};'use strict';var Sequelize=require(_0x27ab('0x0'));module[_0x27ab('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x27ab('0x2')],'unique':_0x27ab('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x27ab('0x2')],'set':function(_0x4eba6c){this[_0x27ab('0x4')](_0x27ab('0x5'),_0x4eba6c?_0x4eba6c[_0x27ab('0x6')](''):[]);},'get':function(){return this[_0x27ab('0x7')]('options')?this['getDataValue'](_0x27ab('0x5'))[_0x27ab('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x27ab('0x2')]},'record':{'type':Sequelize[_0x27ab('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x27ab('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index bc02125..ddee4c0 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 _0x82b0=['stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','sendStatus'];(function(_0x5149c7,_0xfd2f67){var _0x5010b0=function(_0x408cb0){while(--_0x408cb0){_0x5149c7['push'](_0x5149c7['shift']());}};_0x5010b0(++_0xfd2f67);}(_0x82b0,0x81));var _0x082b=function(_0x367995,_0x129ae2){_0x367995=_0x367995-0x0;var _0x22daa8=_0x82b0[_0x367995];return _0x22daa8;};'use strict';var emlformat=require(_0x082b('0x0'));var rimraf=require(_0x082b('0x1'));var zipdir=require(_0x082b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x082b('0x3'));var moment=require(_0x082b('0x4'));var BPromise=require(_0x082b('0x5'));var Mustache=require(_0x082b('0x6'));var util=require('util');var path=require(_0x082b('0x7'));var sox=require(_0x082b('0x8'));var csv=require(_0x082b('0x9'));var ejs=require(_0x082b('0xa'));var fs=require('fs');var fs_extra=require(_0x082b('0xb'));var _=require('lodash');var squel=require(_0x082b('0xc'));var crypto=require(_0x082b('0xd'));var jsforce=require(_0x082b('0xe'));var deskjs=require(_0x082b('0xf'));var toCsv=require(_0x082b('0x9'));var querystring=require(_0x082b('0x10'));var Papa=require(_0x082b('0x11'));var Redis=require(_0x082b('0x12'));var authService=require(_0x082b('0x13'));var qs=require(_0x082b('0x14'));var as=require(_0x082b('0x15'));var hardwareService=require(_0x082b('0x16'));var logger=require(_0x082b('0x17'))(_0x082b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x082b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bffb,_0x1c1f9d){_0x1c1f9d=_0x1c1f9d||0xcc;return function(_0x324251){if(_0x324251){return _0x54bffb['sendStatus'](_0x1c1f9d);}return _0x54bffb[_0x082b('0x1a')](_0x1c1f9d)[_0x082b('0x1b')]();};}function respondWithResult(_0x27bc44,_0x1f0c32){_0x1f0c32=_0x1f0c32||0xc8;return function(_0x40e206){if(_0x40e206){return _0x27bc44['status'](_0x1f0c32)[_0x082b('0x1c')](_0x40e206);}};}function respondWithFilteredResult(_0x1dc46e,_0x49db08){return function(_0x2c4f86){if(_0x2c4f86){var _0x588d8a=typeof _0x49db08[_0x082b('0x1d')]===_0x082b('0x1e')&&typeof _0x49db08['limit']===_0x082b('0x1e');var _0x4785fb=_0x2c4f86[_0x082b('0x1f')];var _0x3aa0ed=_0x588d8a?0x0:_0x49db08['offset'];var _0x2772e9=_0x588d8a?_0x2c4f86[_0x082b('0x1f')]:_0x49db08[_0x082b('0x1d')]+_0x49db08[_0x082b('0x20')];var _0x1e8fa5;if(_0x2772e9>=_0x4785fb){_0x2772e9=_0x4785fb;_0x1e8fa5=0xc8;}else{_0x1e8fa5=0xce;}_0x1dc46e[_0x082b('0x1a')](_0x1e8fa5);return _0x1dc46e[_0x082b('0x21')](_0x082b('0x22'),_0x3aa0ed+'-'+_0x2772e9+'/'+_0x4785fb)['json'](_0x2c4f86);}return null;};}function patchUpdates(_0x9faf2){return function(_0x2fffc3){try{jsonpatch[_0x082b('0x23')](_0x2fffc3,_0x9faf2,!![]);}catch(_0x5aab0a){return BPromise[_0x082b('0x24')](_0x5aab0a);}return _0x2fffc3[_0x082b('0x25')]();};}function saveUpdates(_0x42c0ab,_0x56fbd2){return function(_0x47c0d9){if(_0x47c0d9){return _0x47c0d9[_0x082b('0x26')](_0x42c0ab)['then'](function(_0x5cb670){return _0x5cb670;});}return null;};}function removeEntity(_0x3ae657,_0xaa7eb){return function(_0x271340){if(_0x271340){return _0x271340[_0x082b('0x27')]()[_0x082b('0x28')](function(){var _0x4ed723=_0x271340[_0x082b('0x29')]({'plain':!![]});var _0x1254fd=_0x082b('0x2a');return db[_0x082b('0x2b')][_0x082b('0x27')]({'where':{'type':_0x1254fd,'resourceId':_0x4ed723['id']}})[_0x082b('0x28')](function(){return _0x271340;});})[_0x082b('0x28')](function(){_0x3ae657['status'](0xcc)[_0x082b('0x1b')]();});}};}function handleEntityNotFound(_0x5ee68e,_0x2155d4){return function(_0x4d102b){if(!_0x4d102b){_0x5ee68e[_0x082b('0x2c')](0x194);}return _0x4d102b;};}function handleError(_0x15c093,_0x545fd6){_0x545fd6=_0x545fd6||0x1f4;return function(_0x2279d7){logger['error'](_0x2279d7[_0x082b('0x2d')]);if(_0x2279d7['name']){delete _0x2279d7[_0x082b('0x2e')];}_0x15c093[_0x082b('0x1a')](_0x545fd6)[_0x082b('0x2f')](_0x2279d7);};}exports[_0x082b('0x30')]=function(_0x2f4e63,_0x219baa){var _0x3194d5={},_0x2c9197={},_0xab3a99={'count':0x0,'rows':[]};var _0x40ee66=_[_0x082b('0x31')](db[_0x082b('0x32')]['rawAttributes'],function(_0x2ed47f){return{'name':_0x2ed47f[_0x082b('0x33')],'type':_0x2ed47f[_0x082b('0x34')][_0x082b('0x35')]};});_0x2c9197[_0x082b('0x36')]=_['map'](_0x40ee66,'name');_0x2c9197[_0x082b('0x37')]=_[_0x082b('0x38')](_0x2f4e63['query']);_0x2c9197[_0x082b('0x39')]=_[_0x082b('0x3a')](_0x2c9197['model'],_0x2c9197[_0x082b('0x37')]);_0x3194d5['attributes']=_[_0x082b('0x3a')](_0x2c9197[_0x082b('0x36')],qs['fields'](_0x2f4e63[_0x082b('0x37')][_0x082b('0x3b')]));_0x3194d5[_0x082b('0x3c')]=_0x3194d5[_0x082b('0x3c')][_0x082b('0x3d')]?_0x3194d5['attributes']:_0x2c9197[_0x082b('0x36')];if(!_0x2f4e63['query'][_0x082b('0x3e')](_0x082b('0x3f'))){_0x3194d5[_0x082b('0x20')]=qs[_0x082b('0x20')](_0x2f4e63[_0x082b('0x37')][_0x082b('0x20')]);_0x3194d5[_0x082b('0x1d')]=qs[_0x082b('0x1d')](_0x2f4e63['query'][_0x082b('0x1d')]);}_0x3194d5[_0x082b('0x40')]=qs['sort'](_0x2f4e63[_0x082b('0x37')][_0x082b('0x41')]);_0x3194d5[_0x082b('0x42')]=qs[_0x082b('0x39')](_[_0x082b('0x43')](_0x2f4e63[_0x082b('0x37')],_0x2c9197[_0x082b('0x39')]),_0x40ee66);if(_0x2f4e63[_0x082b('0x37')]['filter']){_0x3194d5[_0x082b('0x42')]=_[_0x082b('0x44')](_0x3194d5[_0x082b('0x42')],{'$or':_[_0x082b('0x31')](_0x40ee66,function(_0x494e9e){if(_0x494e9e[_0x082b('0x34')]!==_0x082b('0x45')){var _0x2fb0a3={};_0x2fb0a3[_0x494e9e[_0x082b('0x2e')]]={'$like':'%'+_0x2f4e63[_0x082b('0x37')]['filter']+'%'};return _0x2fb0a3;}})});}_0x3194d5=_[_0x082b('0x44')]({},_0x3194d5,_0x2f4e63[_0x082b('0x46')]);var _0x4d8235={'where':_0x3194d5[_0x082b('0x42')]};return db[_0x082b('0x32')]['count'](_0x4d8235)[_0x082b('0x28')](function(_0xfb034d){_0xab3a99[_0x082b('0x1f')]=_0xfb034d;if(_0x2f4e63[_0x082b('0x37')][_0x082b('0x47')]){_0x3194d5[_0x082b('0x48')]=[{'all':!![]}];}return db[_0x082b('0x32')][_0x082b('0x49')](_0x3194d5);})[_0x082b('0x28')](function(_0x5ed239){_0xab3a99[_0x082b('0x4a')]=_0x5ed239;return _0xab3a99;})[_0x082b('0x28')](respondWithFilteredResult(_0x219baa,_0x3194d5))[_0x082b('0x4b')](handleError(_0x219baa,null));};exports[_0x082b('0x4c')]=function(_0x530cb4,_0x34a3e4){var _0x19cca1={'raw':![],'where':{'id':_0x530cb4['params']['id']}},_0xfa87a8={};_0xfa87a8[_0x082b('0x36')]=_[_0x082b('0x38')](db[_0x082b('0x32')][_0x082b('0x4d')]);_0xfa87a8[_0x082b('0x37')]=_[_0x082b('0x38')](_0x530cb4['query']);_0xfa87a8[_0x082b('0x39')]=_[_0x082b('0x3a')](_0xfa87a8[_0x082b('0x36')],_0xfa87a8[_0x082b('0x37')]);_0x19cca1[_0x082b('0x3c')]=_[_0x082b('0x3a')](_0xfa87a8[_0x082b('0x36')],qs[_0x082b('0x3b')](_0x530cb4['query'][_0x082b('0x3b')]));_0x19cca1[_0x082b('0x3c')]=_0x19cca1[_0x082b('0x3c')]['length']?_0x19cca1[_0x082b('0x3c')]:_0xfa87a8[_0x082b('0x36')];if(_0x530cb4['query'][_0x082b('0x47')]){_0x19cca1['include']=[{'all':!![]}];}_0x19cca1=_[_0x082b('0x44')]({},_0x19cca1,_0x530cb4[_0x082b('0x46')]);return db[_0x082b('0x32')]['find'](_0x19cca1)[_0x082b('0x28')](handleEntityNotFound(_0x34a3e4,null))['then'](respondWithResult(_0x34a3e4,null))[_0x082b('0x4b')](handleError(_0x34a3e4,null));};exports['create']=function(_0x3d043c,_0x518f6b){return db[_0x082b('0x32')][_0x082b('0x4e')](_0x3d043c[_0x082b('0x4f')],{})[_0x082b('0x28')](function(_0x299d76){var _0x14a1ed=_0x3d043c[_0x082b('0x50')]['get']({'plain':!![]});if(!_0x14a1ed)throw new Error(_0x082b('0x51'));if(_0x14a1ed[_0x082b('0x52')]===_0x082b('0x50')){var _0x57ed0a=_0x299d76[_0x082b('0x29')]({'plain':!![]});var _0x41d21c=_0x082b('0x2a');return db[_0x082b('0x53')][_0x082b('0x54')]({'where':{'name':_0x41d21c,'userProfileId':_0x14a1ed[_0x082b('0x55')]},'raw':!![]})[_0x082b('0x28')](function(_0x5c6055){if(_0x5c6055&&_0x5c6055['autoAssociation']===0x0){return db[_0x082b('0x2b')]['create']({'name':_0x57ed0a[_0x082b('0x2e')],'resourceId':_0x57ed0a['id'],'type':_0x5c6055[_0x082b('0x2e')],'sectionId':_0x5c6055['id']},{})[_0x082b('0x28')](function(){return _0x299d76;});}else{return _0x299d76;}})['catch'](function(_0x4a48f8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a48f8);throw _0x4a48f8;});}return _0x299d76;})[_0x082b('0x28')](respondWithResult(_0x518f6b,0xc9))[_0x082b('0x4b')](handleError(_0x518f6b,null));};exports['update']=function(_0x397f3d,_0x35ffad){if(_0x397f3d[_0x082b('0x4f')]['id']){delete _0x397f3d[_0x082b('0x4f')]['id'];}return db['VoiceChanSpy'][_0x082b('0x54')]({'where':{'id':_0x397f3d[_0x082b('0x56')]['id']}})[_0x082b('0x28')](handleEntityNotFound(_0x35ffad,null))[_0x082b('0x28')](saveUpdates(_0x397f3d[_0x082b('0x4f')],null))['then'](respondWithResult(_0x35ffad,null))[_0x082b('0x4b')](handleError(_0x35ffad,null));};exports[_0x082b('0x27')]=function(_0x4a5896,_0x22964b){return db[_0x082b('0x32')]['find']({'where':{'id':_0x4a5896[_0x082b('0x56')]['id']}})['then'](handleEntityNotFound(_0x22964b,null))[_0x082b('0x28')](removeEntity(_0x22964b,null))[_0x082b('0x4b')](handleError(_0x22964b,null));}; \ No newline at end of file +var _0x758e=['stack','name','index','VoiceChanSpy','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','body','destroy','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','get','ChanSpies','UserProfileResource','error'];(function(_0x4f43ad,_0x852179){var _0x395e73=function(_0x1dd3d7){while(--_0x1dd3d7){_0x4f43ad['push'](_0x4f43ad['shift']());}};_0x395e73(++_0x852179);}(_0x758e,0x1af));var _0xe758=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x758e[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xe758('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe758('0x1'));var rp=require(_0xe758('0x2'));var moment=require(_0xe758('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe758('0x4'));var path=require(_0xe758('0x5'));var sox=require(_0xe758('0x6'));var csv=require(_0xe758('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe758('0x8'));var _=require(_0xe758('0x9'));var squel=require(_0xe758('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe758('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe758('0xc'));var qs=require(_0xe758('0xd'));var as=require(_0xe758('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe758('0xf'))('api');var utils=require(_0xe758('0x10'));var config=require(_0xe758('0x11'));var licenseUtil=require(_0xe758('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a29aa,_0x4bb0d8){_0x4bb0d8=_0x4bb0d8||0xcc;return function(_0x2571c1){if(_0x2571c1){return _0x1a29aa[_0xe758('0x13')](_0x4bb0d8);}return _0x1a29aa[_0xe758('0x14')](_0x4bb0d8)[_0xe758('0x15')]();};}function respondWithResult(_0x26dfcd,_0x27517f){_0x27517f=_0x27517f||0xc8;return function(_0xea5ea3){if(_0xea5ea3){return _0x26dfcd[_0xe758('0x14')](_0x27517f)[_0xe758('0x16')](_0xea5ea3);}};}function respondWithFilteredResult(_0x509431,_0x3c617a){return function(_0x551700){if(_0x551700){var _0x544b3a=typeof _0x3c617a[_0xe758('0x17')]===_0xe758('0x18')&&typeof _0x3c617a['limit']==='undefined';var _0x7ed4e9=_0x551700[_0xe758('0x19')];var _0x38c30c=_0x544b3a?0x0:_0x3c617a[_0xe758('0x17')];var _0x3fe7e8=_0x544b3a?_0x551700[_0xe758('0x19')]:_0x3c617a['offset']+_0x3c617a['limit'];var _0x44a6db;if(_0x3fe7e8>=_0x7ed4e9){_0x3fe7e8=_0x7ed4e9;_0x44a6db=0xc8;}else{_0x44a6db=0xce;}_0x509431[_0xe758('0x14')](_0x44a6db);return _0x509431[_0xe758('0x1a')](_0xe758('0x1b'),_0x38c30c+'-'+_0x3fe7e8+'/'+_0x7ed4e9)[_0xe758('0x16')](_0x551700);}return null;};}function patchUpdates(_0x4d35d3){return function(_0x4eeb82){try{jsonpatch[_0xe758('0x1c')](_0x4eeb82,_0x4d35d3,!![]);}catch(_0xc7afba){return BPromise[_0xe758('0x1d')](_0xc7afba);}return _0x4eeb82[_0xe758('0x1e')]();};}function saveUpdates(_0x523448,_0x3c441d){return function(_0x39fbb2){if(_0x39fbb2){return _0x39fbb2[_0xe758('0x1f')](_0x523448)[_0xe758('0x20')](function(_0x2ee309){return _0x2ee309;});}return null;};}function removeEntity(_0x992bb5,_0x108bfe){return function(_0x4b147b){if(_0x4b147b){return _0x4b147b['destroy']()['then'](function(){var _0x4e3828=_0x4b147b[_0xe758('0x21')]({'plain':!![]});var _0x145beb=_0xe758('0x22');return db[_0xe758('0x23')]['destroy']({'where':{'type':_0x145beb,'resourceId':_0x4e3828['id']}})[_0xe758('0x20')](function(){return _0x4b147b;});})['then'](function(){_0x992bb5[_0xe758('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5befbe,_0x34c40f){return function(_0x177db1){if(!_0x177db1){_0x5befbe[_0xe758('0x13')](0x194);}return _0x177db1;};}function handleError(_0xfe2be2,_0x5d557b){_0x5d557b=_0x5d557b||0x1f4;return function(_0xf00ed6){logger[_0xe758('0x24')](_0xf00ed6[_0xe758('0x25')]);if(_0xf00ed6[_0xe758('0x26')]){delete _0xf00ed6['name'];}_0xfe2be2[_0xe758('0x14')](_0x5d557b)['send'](_0xf00ed6);};}exports[_0xe758('0x27')]=function(_0x3979cd,_0x14b59d){var _0x34f0f5={},_0x148e94={},_0x5be009={'count':0x0,'rows':[]};var _0x4d7e4a=_['map'](db[_0xe758('0x28')]['rawAttributes'],function(_0x44f767){return{'name':_0x44f767[_0xe758('0x29')],'type':_0x44f767['type']['key']};});_0x148e94[_0xe758('0x2a')]=_['map'](_0x4d7e4a,_0xe758('0x26'));_0x148e94[_0xe758('0x2b')]=_[_0xe758('0x2c')](_0x3979cd['query']);_0x148e94[_0xe758('0x2d')]=_['intersection'](_0x148e94[_0xe758('0x2a')],_0x148e94[_0xe758('0x2b')]);_0x34f0f5['attributes']=_[_0xe758('0x2e')](_0x148e94[_0xe758('0x2a')],qs[_0xe758('0x2f')](_0x3979cd['query']['fields']));_0x34f0f5[_0xe758('0x30')]=_0x34f0f5['attributes'][_0xe758('0x31')]?_0x34f0f5[_0xe758('0x30')]:_0x148e94[_0xe758('0x2a')];if(!_0x3979cd[_0xe758('0x2b')][_0xe758('0x32')](_0xe758('0x33'))){_0x34f0f5['limit']=qs[_0xe758('0x34')](_0x3979cd['query']['limit']);_0x34f0f5[_0xe758('0x17')]=qs[_0xe758('0x17')](_0x3979cd['query'][_0xe758('0x17')]);}_0x34f0f5[_0xe758('0x35')]=qs[_0xe758('0x36')](_0x3979cd['query'][_0xe758('0x36')]);_0x34f0f5[_0xe758('0x37')]=qs[_0xe758('0x2d')](_[_0xe758('0x38')](_0x3979cd['query'],_0x148e94[_0xe758('0x2d')]),_0x4d7e4a);if(_0x3979cd[_0xe758('0x2b')][_0xe758('0x39')]){_0x34f0f5[_0xe758('0x37')]=_['merge'](_0x34f0f5[_0xe758('0x37')],{'$or':_['map'](_0x4d7e4a,function(_0x50304f){if(_0x50304f[_0xe758('0x3a')]!==_0xe758('0x3b')){var _0x932fad={};_0x932fad[_0x50304f['name']]={'$like':'%'+_0x3979cd[_0xe758('0x2b')][_0xe758('0x39')]+'%'};return _0x932fad;}})});}_0x34f0f5=_[_0xe758('0x3c')]({},_0x34f0f5,_0x3979cd[_0xe758('0x3d')]);var _0x539a0d={'where':_0x34f0f5[_0xe758('0x37')]};return db[_0xe758('0x28')][_0xe758('0x19')](_0x539a0d)[_0xe758('0x20')](function(_0x4f9edc){_0x5be009[_0xe758('0x19')]=_0x4f9edc;if(_0x3979cd['query'][_0xe758('0x3e')]){_0x34f0f5[_0xe758('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xe758('0x40')](_0x34f0f5);})[_0xe758('0x20')](function(_0x4c2855){_0x5be009[_0xe758('0x41')]=_0x4c2855;return _0x5be009;})[_0xe758('0x20')](respondWithFilteredResult(_0x14b59d,_0x34f0f5))[_0xe758('0x42')](handleError(_0x14b59d,null));};exports[_0xe758('0x43')]=function(_0x1aec7b,_0x17a1b9){var _0x2117b7={'raw':![],'where':{'id':_0x1aec7b[_0xe758('0x44')]['id']}},_0x35bf82={};_0x35bf82['model']=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x35bf82[_0xe758('0x2b')]=_[_0xe758('0x2c')](_0x1aec7b[_0xe758('0x2b')]);_0x35bf82[_0xe758('0x2d')]=_[_0xe758('0x2e')](_0x35bf82[_0xe758('0x2a')],_0x35bf82['query']);_0x2117b7[_0xe758('0x30')]=_[_0xe758('0x2e')](_0x35bf82['model'],qs['fields'](_0x1aec7b[_0xe758('0x2b')][_0xe758('0x2f')]));_0x2117b7[_0xe758('0x30')]=_0x2117b7[_0xe758('0x30')]['length']?_0x2117b7[_0xe758('0x30')]:_0x35bf82[_0xe758('0x2a')];if(_0x1aec7b[_0xe758('0x2b')]['includeAll']){_0x2117b7['include']=[{'all':!![]}];}_0x2117b7=_[_0xe758('0x3c')]({},_0x2117b7,_0x1aec7b[_0xe758('0x3d')]);return db[_0xe758('0x28')][_0xe758('0x45')](_0x2117b7)[_0xe758('0x20')](handleEntityNotFound(_0x17a1b9,null))['then'](respondWithResult(_0x17a1b9,null))[_0xe758('0x42')](handleError(_0x17a1b9,null));};exports[_0xe758('0x46')]=function(_0x58ebcc,_0x4ab7c6){return db[_0xe758('0x28')][_0xe758('0x46')](_0x58ebcc['body'],{})[_0xe758('0x20')](function(_0x10a365){var _0x3899ef=_0x58ebcc['user'][_0xe758('0x21')]({'plain':!![]});if(!_0x3899ef)throw new Error(_0xe758('0x47'));if(_0x3899ef['role']===_0xe758('0x48')){var _0x206cc3=_0x10a365['get']({'plain':!![]});var _0x4f10bb=_0xe758('0x22');return db[_0xe758('0x49')][_0xe758('0x45')]({'where':{'name':_0x4f10bb,'userProfileId':_0x3899ef[_0xe758('0x4a')]},'raw':!![]})[_0xe758('0x20')](function(_0x29bc4e){if(_0x29bc4e&&_0x29bc4e[_0xe758('0x4b')]===0x0){return db[_0xe758('0x23')]['create']({'name':_0x206cc3[_0xe758('0x26')],'resourceId':_0x206cc3['id'],'type':_0x29bc4e[_0xe758('0x26')],'sectionId':_0x29bc4e['id']},{})[_0xe758('0x20')](function(){return _0x10a365;});}else{return _0x10a365;}})['catch'](function(_0x49c2c6){logger[_0xe758('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49c2c6);throw _0x49c2c6;});}return _0x10a365;})[_0xe758('0x20')](respondWithResult(_0x4ab7c6,0xc9))[_0xe758('0x42')](handleError(_0x4ab7c6,null));};exports['update']=function(_0x2f43ea,_0xbd8d26){if(_0x2f43ea[_0xe758('0x4c')]['id']){delete _0x2f43ea[_0xe758('0x4c')]['id'];}return db['VoiceChanSpy'][_0xe758('0x45')]({'where':{'id':_0x2f43ea[_0xe758('0x44')]['id']}})['then'](handleEntityNotFound(_0xbd8d26,null))[_0xe758('0x20')](saveUpdates(_0x2f43ea['body'],null))['then'](respondWithResult(_0xbd8d26,null))[_0xe758('0x42')](handleError(_0xbd8d26,null));};exports[_0xe758('0x4d')]=function(_0x147424,_0x74ffb8){return db[_0xe758('0x28')][_0xe758('0x45')]({'where':{'id':_0x147424['params']['id']}})[_0xe758('0x20')](handleEntityNotFound(_0x74ffb8,null))['then'](removeEntity(_0x74ffb8,null))[_0xe758('0x42')](handleError(_0x74ffb8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 73adac0..470a676 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 _0xfa18=['recordingFormat','auth','merge','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','Set','CDR(type)=%s','chanspy','record','push','MixMonitor'];(function(_0x42dd6c,_0x4ea28c){var _0x3346a2=function(_0x17877b){while(--_0x17877b){_0x42dd6c['push'](_0x42dd6c['shift']());}};_0x3346a2(++_0x4ea28c);}(_0xfa18,0xd7));var _0x8fa1=function(_0x344b3c,_0x524c9e){_0x344b3c=_0x344b3c-0x0;var _0x2613f8=_0xfa18[_0x344b3c];return _0x2613f8;};'use strict';var _=require(_0x8fa1('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x8fa1('0x1'));var getUserApplications=function(_0x467d1a,_0x5854e8,_0x4d174d){var _0x3d1a1f=0x1;var _0x19ecba=[];var _0x4d073f={'context':_0x5854e8[_0x8fa1('0x2')]||'from-sip','exten':util[_0x8fa1('0x3')](_0x8fa1('0x4'),_0x467d1a[_0x8fa1('0x5')],_0x4d174d),'type':_0x8fa1('0x6'),'isApp':![],'ChanSpyId':_0x467d1a['id'],'UserId':_0x5854e8['id']};_0x19ecba['push'](_['merge']({'app':_0x8fa1('0x7'),'appdata':util['format'](_0x8fa1('0x8'),_0x8fa1('0x9')),'priority':_0x3d1a1f++},_0x4d073f));if(_0x467d1a[_0x8fa1('0xa')]){_0x19ecba[_0x8fa1('0xb')](_['merge']({'app':_0x8fa1('0xc'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x467d1a[_0x8fa1('0xd')]),'priority':_0x3d1a1f++},_0x4d073f));}if(_0x467d1a[_0x8fa1('0xe')]){_0x19ecba[_0x8fa1('0xb')](_[_0x8fa1('0xf')]({'app':'Authenticate','appdata':_0x467d1a[_0x8fa1('0x10')],'priority':_0x3d1a1f++},_0x4d073f));}_0x19ecba[_0x8fa1('0xb')](_[_0x8fa1('0xf')]({'app':_0x8fa1('0x11'),'appdata':util['format'](_0x8fa1('0x12'),_0x5854e8[_0x8fa1('0x13')],_0x467d1a[_0x8fa1('0x14')]?_0x467d1a[_0x8fa1('0x14')][_0x8fa1('0x15')](''):''),'priority':_0x3d1a1f++},_0x4d073f));if(_0x467d1a[_0x8fa1('0xa')]){_0x19ecba[_0x8fa1('0xb')](_[_0x8fa1('0xf')]({'app':_0x8fa1('0x16'),'priority':_0x3d1a1f++},_0x4d073f));}return _0x19ecba;};var getChanSpyApplications=function(_0x46405f,_0x1769a8){var _0x3c9cde=[];for(var _0x5de447=0x0,_0x491585=0x1;_0x5de447<_0x1769a8[_0x8fa1('0x17')];_0x5de447++,_0x491585=0x1){_0x3c9cde=_0x3c9cde[_0x8fa1('0x18')](getUserApplications(_0x46405f,_0x1769a8[_0x5de447],_0x1769a8[_0x5de447]['internal']));if(_0x1769a8[_0x5de447][_0x8fa1('0x19')]!=_0x1769a8[_0x5de447][_0x8fa1('0x13')]){_0x3c9cde=_0x3c9cde[_0x8fa1('0x18')](getUserApplications(_0x46405f,_0x1769a8[_0x5de447],_0x1769a8[_0x5de447][_0x8fa1('0x13')]));}}return _0x3c9cde;};var getChanSpyPromise=function(_0x245a41,_0x5e0b0e){return new BPromise(function(_0xf77a2,_0x4270a5){return _0x245a41[_0x8fa1('0x1a')][_0x8fa1('0x1b')]({'attributes':['id','name',_0x8fa1('0x19')],'where':{'role':_0x8fa1('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x183397){if(_0x183397){return _0xf77a2(getChanSpyApplications(_0x5e0b0e,_0x183397));}return _0xf77a2([]);})[_0x8fa1('0x1d')](function(_0x7bc935){_0x4270a5(_0x7bc935);});});};module[_0x8fa1('0x1e')]=function(_0x108cc5,_0x40e6c6){var _0x7589fc=_0x108cc5['models'];return _0x108cc5[_0x8fa1('0x1f')](_0x8fa1('0x20'),attributes,{'tableName':_0x8fa1('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x590cdb,_0x32a85b,_0x1aca2f){return getChanSpyPromise(_0x7589fc,_0x590cdb)[_0x8fa1('0x22')](function(_0x1cccc6){if(_0x1cccc6&&_0x1cccc6[_0x8fa1('0x17')]){return _0x7589fc[_0x8fa1('0x23')][_0x8fa1('0x24')](_0x1cccc6);}})[_0x8fa1('0x22')](function(){_0x1aca2f();})[_0x8fa1('0x1d')](function(_0x372a04){_0x1aca2f(_0x372a04);});},'afterUpdate':function(_0x4cf66e,_0x4ac444,_0x481e61){return _0x7589fc[_0x8fa1('0x23')][_0x8fa1('0x25')]({'where':{'ChanSpyId':_0x4cf66e['id']}})['then'](function(){return getChanSpyPromise(_0x7589fc,_0x4cf66e);})[_0x8fa1('0x22')](function(_0x4e93d9){if(_0x4e93d9&&_0x4e93d9['length']){return _0x7589fc[_0x8fa1('0x23')][_0x8fa1('0x24')](_0x4e93d9);}})[_0x8fa1('0x22')](function(){_0x481e61();})[_0x8fa1('0x1d')](function(_0x32d566){_0x481e61(_0x32d566);});},'afterDestroy':function(_0x331f1a,_0x2a23a8,_0x4ba7d4){return _0x7589fc['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x331f1a['id']}})[_0x8fa1('0x22')](function(){_0x4ba7d4();})[_0x8fa1('0x1d')](function(_0x4d869c){_0x4ba7d4(_0x4d869c);});}}});}; \ No newline at end of file +var _0xc6b6=['define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','context','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','models'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0xc6b6,0x1be));var _0x6c6b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc6b6[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x6c6b('0x0'));var util=require(_0x6c6b('0x1'));var BPromise=require(_0x6c6b('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x92f03f,_0x113f91,_0x3bed2b){var _0x2e8398=0x1;var _0x2f2462=[];var _0x354be1={'context':_0x113f91[_0x6c6b('0x3')]||'from-sip','exten':util[_0x6c6b('0x4')](_0x6c6b('0x5'),_0x92f03f[_0x6c6b('0x6')],_0x3bed2b),'type':_0x6c6b('0x7'),'isApp':![],'ChanSpyId':_0x92f03f['id'],'UserId':_0x113f91['id']};_0x2f2462[_0x6c6b('0x8')](_[_0x6c6b('0x9')]({'app':_0x6c6b('0xa'),'appdata':util['format'](_0x6c6b('0xb'),_0x6c6b('0xc')),'priority':_0x2e8398++},_0x354be1));if(_0x92f03f[_0x6c6b('0xd')]){_0x2f2462[_0x6c6b('0x8')](_['merge']({'app':'MixMonitor','appdata':util[_0x6c6b('0x4')](_0x6c6b('0xe'),_0x92f03f[_0x6c6b('0xf')]),'priority':_0x2e8398++},_0x354be1));}if(_0x92f03f[_0x6c6b('0x10')]){_0x2f2462[_0x6c6b('0x8')](_['merge']({'app':_0x6c6b('0x11'),'appdata':_0x92f03f[_0x6c6b('0x12')],'priority':_0x2e8398++},_0x354be1));}_0x2f2462['push'](_['merge']({'app':_0x6c6b('0x13'),'appdata':util[_0x6c6b('0x4')](_0x6c6b('0x14'),_0x113f91[_0x6c6b('0x15')],_0x92f03f[_0x6c6b('0x16')]?_0x92f03f['options'][_0x6c6b('0x17')](''):''),'priority':_0x2e8398++},_0x354be1));if(_0x92f03f[_0x6c6b('0xd')]){_0x2f2462['push'](_[_0x6c6b('0x9')]({'app':_0x6c6b('0x18'),'priority':_0x2e8398++},_0x354be1));}return _0x2f2462;};var getChanSpyApplications=function(_0x4a1239,_0x5a7d68){var _0x5356ad=[];for(var _0x42da02=0x0,_0x1a4d85=0x1;_0x42da02<_0x5a7d68[_0x6c6b('0x19')];_0x42da02++,_0x1a4d85=0x1){_0x5356ad=_0x5356ad[_0x6c6b('0x1a')](getUserApplications(_0x4a1239,_0x5a7d68[_0x42da02],_0x5a7d68[_0x42da02][_0x6c6b('0x1b')]));if(_0x5a7d68[_0x42da02][_0x6c6b('0x1b')]!=_0x5a7d68[_0x42da02]['name']){_0x5356ad=_0x5356ad[_0x6c6b('0x1a')](getUserApplications(_0x4a1239,_0x5a7d68[_0x42da02],_0x5a7d68[_0x42da02][_0x6c6b('0x15')]));}}return _0x5356ad;};var getChanSpyPromise=function(_0x22f24d,_0x12f115){return new BPromise(function(_0x55f9d1,_0x2dcf66){return _0x22f24d[_0x6c6b('0x1c')]['findAll']({'attributes':['id',_0x6c6b('0x15'),_0x6c6b('0x1b')],'where':{'role':_0x6c6b('0x1d'),'chanspy':!![]},'raw':!![]})[_0x6c6b('0x1e')](function(_0x3c8ca2){if(_0x3c8ca2){return _0x55f9d1(getChanSpyApplications(_0x12f115,_0x3c8ca2));}return _0x55f9d1([]);})[_0x6c6b('0x1f')](function(_0x5ed46b){_0x2dcf66(_0x5ed46b);});});};module[_0x6c6b('0x20')]=function(_0x16c9e2,_0x4cb943){var _0x4ec7f5=_0x16c9e2[_0x6c6b('0x21')];return _0x16c9e2[_0x6c6b('0x22')](_0x6c6b('0x23'),attributes,{'tableName':_0x6c6b('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x496ade,_0x4086bf,_0x5882cd){return getChanSpyPromise(_0x4ec7f5,_0x496ade)['then'](function(_0x38b9eb){if(_0x38b9eb&&_0x38b9eb['length']){return _0x4ec7f5[_0x6c6b('0x25')]['bulkCreate'](_0x38b9eb);}})['then'](function(){_0x5882cd();})[_0x6c6b('0x1f')](function(_0x5e5af2){_0x5882cd(_0x5e5af2);});},'afterUpdate':function(_0x18b5f1,_0x2670bc,_0x5f2bb5){return _0x4ec7f5[_0x6c6b('0x25')][_0x6c6b('0x26')]({'where':{'ChanSpyId':_0x18b5f1['id']}})[_0x6c6b('0x1e')](function(){return getChanSpyPromise(_0x4ec7f5,_0x18b5f1);})[_0x6c6b('0x1e')](function(_0xa34a07){if(_0xa34a07&&_0xa34a07['length']){return _0x4ec7f5[_0x6c6b('0x25')][_0x6c6b('0x27')](_0xa34a07);}})['then'](function(){_0x5f2bb5();})[_0x6c6b('0x1f')](function(_0xe07996){_0x5f2bb5(_0xe07996);});},'afterDestroy':function(_0x54bd62,_0x2becac,_0x38749a){return _0x4ec7f5[_0x6c6b('0x25')][_0x6c6b('0x26')]({'where':{'ChanSpyId':_0x54bd62['id']}})[_0x6c6b('0x1e')](function(){_0x38749a();})['catch'](function(_0x52d5e2){_0x38749a(_0x52d5e2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 3a7cda8..9364a08 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 _0x57f8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x298378,_0x84f466){var _0x467ced=function(_0xe6b6e9){while(--_0xe6b6e9){_0x298378['push'](_0x298378['shift']());}};_0x467ced(++_0x84f466);}(_0x57f8,0x198));var _0x857f=function(_0x424a50,_0x1fd66d){_0x424a50=_0x424a50-0x0;var _0x1427b2=_0x57f8[_0x424a50];return _0x1427b2;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});} \ No newline at end of file +var _0x0565=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','message','error','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x444ef9,_0x5d1b9f){var _0x586574=function(_0xceb7a4){while(--_0xceb7a4){_0x444ef9['push'](_0x444ef9['shift']());}};_0x586574(++_0x5d1b9f);}(_0x0565,0xf2));var _0x5056=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x0565[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 348f877..63f548a 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 _0xd41d=['express','fs-extra','../../components/interaction/service','./voiceContext.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x261b2c,_0xdb87c){var _0x35a619=function(_0x53fae2){while(--_0x53fae2){_0x261b2c['push'](_0x261b2c['shift']());}};_0x35a619(++_0xdb87c);}(_0xd41d,0x11c));var _0xdd41=function(_0x436882,_0x773db9){_0x436882=_0x436882-0x0;var _0x47c573=_0xd41d[_0x436882];return _0x47c573;};'use strict';var multer=require(_0xdd41('0x0'));var util=require(_0xdd41('0x1'));var path=require(_0xdd41('0x2'));var timeout=require(_0xdd41('0x3'));var express=require(_0xdd41('0x4'));var router=express['Router']();var fs_extra=require(_0xdd41('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdd41('0x6'));var config=require('../../config/environment');var controller=require(_0xdd41('0x7'));router[_0xdd41('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdd41('0x9'),auth[_0xdd41('0xa')](),controller[_0xdd41('0xb')]);router[_0xdd41('0xc')]('/',auth[_0xdd41('0xa')](),controller[_0xdd41('0xd')]);router[_0xdd41('0xe')]('/:id',auth[_0xdd41('0xa')](),controller[_0xdd41('0xf')]);router[_0xdd41('0x10')]('/:id',auth[_0xdd41('0xa')](),controller[_0xdd41('0x11')]);module['exports']=router; \ No newline at end of file +var _0xca4d=['connect-timeout','express','Router','./voiceContext.controller','isAuthenticated','get','show','post','create','/:id','exports','multer','util'];(function(_0x4b0a5a,_0x49f7ab){var _0x12d259=function(_0x3cc158){while(--_0x3cc158){_0x4b0a5a['push'](_0x4b0a5a['shift']());}};_0x12d259(++_0x49f7ab);}(_0xca4d,0x10f));var _0xdca4=function(_0x439af2,_0x2a9019){_0x439af2=_0x439af2-0x0;var _0x1af38d=_0xca4d[_0x439af2];return _0x1af38d;};'use strict';var multer=require(_0xdca4('0x0'));var util=require(_0xdca4('0x1'));var path=require('path');var timeout=require(_0xdca4('0x2'));var express=require(_0xdca4('0x3'));var router=express[_0xdca4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdca4('0x5'));router['get']('/',auth[_0xdca4('0x6')](),controller['index']);router[_0xdca4('0x7')]('/:id',auth[_0xdca4('0x6')](),controller[_0xdca4('0x8')]);router[_0xdca4('0x9')]('/',auth[_0xdca4('0x6')](),controller[_0xdca4('0xa')]);router['put'](_0xdca4('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xdca4('0x6')](),controller['destroy']);module[_0xdca4('0xc')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 85ca78c..6f97368 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 _0x3a57=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x4814a7,_0x1a084d){var _0x406700=function(_0x77483b){while(--_0x77483b){_0x4814a7['push'](_0x4814a7['shift']());}};_0x406700(++_0x1a084d);}(_0x3a57,0xfc));var _0x73a5=function(_0x3f865a,_0xf3dc5f){_0x3f865a=_0x3f865a-0x0;var _0x467792=_0x3a57[_0x3f865a];return _0x467792;};'use strict';var Sequelize=require(_0x73a5('0x0'));module[_0x73a5('0x1')]={'name':{'type':Sequelize[_0x73a5('0x2')],'unique':_0x73a5('0x3')},'description':{'type':Sequelize[_0x73a5('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x73a5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe13d=['BOOLEAN','exports','STRING','name'];(function(_0x1128a7,_0x19cb00){var _0x2a2cda=function(_0x228adb){while(--_0x228adb){_0x1128a7['push'](_0x1128a7['shift']());}};_0x2a2cda(++_0x19cb00);}(_0xe13d,0xdd));var _0xde13=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xe13d[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require('sequelize');module[_0xde13('0x0')]={'name':{'type':Sequelize[_0xde13('0x1')],'unique':_0xde13('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xde13('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index bd21468..50805d6 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 _0x1b25=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','join','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','Contexts','UserProfileResource','destroy','name','send','index','map','VoiceContext','fieldName','type','model','query','keys','filters','intersection'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x1b25,0x162));var _0x51b2=function(_0x36e5fe,_0x425955){_0x36e5fe=_0x36e5fe-0x0;var _0x3cded9=_0x1b25[_0x36e5fe];return _0x3cded9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51b2('0x1'));var rp=require(_0x51b2('0x2'));var moment=require(_0x51b2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x51b2('0x4'));var path=require(_0x51b2('0x5'));var sox=require(_0x51b2('0x6'));var csv=require(_0x51b2('0x7'));var ejs=require(_0x51b2('0x8'));var fs=require('fs');var fs_extra=require(_0x51b2('0x9'));var _=require(_0x51b2('0xa'));var squel=require(_0x51b2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x51b2('0xc'));var toCsv=require(_0x51b2('0x7'));var querystring=require(_0x51b2('0xd'));var Papa=require(_0x51b2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x51b2('0xf'));var as=require(_0x51b2('0x10'));var hardwareService=require(_0x51b2('0x11'));var logger=require(_0x51b2('0x12'))(_0x51b2('0x13'));var utils=require('../../config/utils');var config=require(_0x51b2('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x51b2('0x15'));var client=jayson[_0x51b2('0x16')][_0x51b2('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4ce0c2,_0xc437e9,_0x127436,_0x2930fa){return new BPromise(function(_0x1bd0eb,_0x2c815e){var _0xc263f7=_0x2930fa||client;return _0xc263f7[_0x51b2('0x18')](_0x4ce0c2,_0x127436)[_0x51b2('0x19')](function(_0x1686d6){logger[_0x51b2('0x1a')](_0x51b2('0x1b'),_0xc437e9,'request\x20sent');logger[_0x51b2('0x1c')](_0x51b2('0x1d'),_0xc437e9,_0x51b2('0x1e'),JSON[_0x51b2('0x1f')](_0x1686d6));if(_0x1686d6[_0x51b2('0x20')]){if(_0x1686d6[_0x51b2('0x20')][_0x51b2('0x21')]===0x1f4){logger[_0x51b2('0x20')]('VoiceContext,\x20%s,\x20%s',_0xc437e9,_0x1686d6[_0x51b2('0x20')][_0x51b2('0x22')]);return _0x2c815e(_0x1686d6['error']['message']);}logger['error'](_0x51b2('0x1b'),_0xc437e9,_0x1686d6['error'][_0x51b2('0x22')]);return _0x1bd0eb(_0x1686d6[_0x51b2('0x20')]['message']);}else{logger[_0x51b2('0x1a')](_0x51b2('0x1b'),_0xc437e9,'request\x20sent');_0x1bd0eb(_0x1686d6[_0x51b2('0x23')][_0x51b2('0x22')]);}})[_0x51b2('0x24')](function(_0x21d647){logger[_0x51b2('0x20')](_0x51b2('0x1b'),_0xc437e9,_0x21d647);_0x2c815e(_0x21d647);});});}function respondWithStatusCode(_0x313e82,_0x1514fc){_0x1514fc=_0x1514fc||0xcc;return function(_0xd8e9ea){if(_0xd8e9ea){return _0x313e82[_0x51b2('0x25')](_0x1514fc);}return _0x313e82['status'](_0x1514fc)[_0x51b2('0x26')]();};}function respondWithResult(_0x287073,_0x595935){_0x595935=_0x595935||0xc8;return function(_0x443ed2){if(_0x443ed2){return _0x287073[_0x51b2('0x27')](_0x595935)[_0x51b2('0x28')](_0x443ed2);}};}function respondWithFilteredResult(_0x1c7a78,_0x279137){return function(_0x492d55){if(_0x492d55){var _0x2b3c5f=typeof _0x279137[_0x51b2('0x29')]===_0x51b2('0x2a')&&typeof _0x279137[_0x51b2('0x2b')]===_0x51b2('0x2a');var _0x3424eb=_0x492d55[_0x51b2('0x2c')];var _0x26ca71=_0x2b3c5f?0x0:_0x279137[_0x51b2('0x29')];var _0x4cb214=_0x2b3c5f?_0x492d55[_0x51b2('0x2c')]:_0x279137['offset']+_0x279137['limit'];var _0x5834b2;if(_0x4cb214>=_0x3424eb){_0x4cb214=_0x3424eb;_0x5834b2=0xc8;}else{_0x5834b2=0xce;}_0x1c7a78[_0x51b2('0x27')](_0x5834b2);return _0x1c7a78[_0x51b2('0x2d')](_0x51b2('0x2e'),_0x26ca71+'-'+_0x4cb214+'/'+_0x3424eb)['json'](_0x492d55);}return null;};}function patchUpdates(_0x267c1c){return function(_0x23133b){try{jsonpatch[_0x51b2('0x2f')](_0x23133b,_0x267c1c,!![]);}catch(_0xb6ff40){return BPromise[_0x51b2('0x30')](_0xb6ff40);}return _0x23133b[_0x51b2('0x31')]();};}function saveUpdates(_0x58e010,_0x4a13f2){return function(_0x187f2a){if(_0x187f2a){return _0x187f2a[_0x51b2('0x32')](_0x58e010)[_0x51b2('0x19')](function(_0x4c5329){return _0x4c5329;});}return null;};}function removeEntity(_0x10e183,_0xa7cbd9){return function(_0x58cd6b){if(_0x58cd6b){return _0x58cd6b['destroy']()[_0x51b2('0x19')](function(){var _0x2f735c=_0x58cd6b['get']({'plain':!![]});var _0xbc486b=_0x51b2('0x33');return db[_0x51b2('0x34')][_0x51b2('0x35')]({'where':{'type':_0xbc486b,'resourceId':_0x2f735c['id']}})[_0x51b2('0x19')](function(){return _0x58cd6b;});})['then'](function(){_0x10e183[_0x51b2('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa39af,_0x224c5f){return function(_0x182580){if(!_0x182580){_0xa39af[_0x51b2('0x25')](0x194);}return _0x182580;};}function handleError(_0x5e82f8,_0x34b49b){_0x34b49b=_0x34b49b||0x1f4;return function(_0x5b4167){logger[_0x51b2('0x20')](_0x5b4167['stack']);if(_0x5b4167[_0x51b2('0x36')]){delete _0x5b4167['name'];}_0x5e82f8[_0x51b2('0x27')](_0x34b49b)[_0x51b2('0x37')](_0x5b4167);};}exports[_0x51b2('0x38')]=function(_0x2c42d3,_0x1ce1bd){var _0x16339a={},_0x1c5109={},_0x56854f={'count':0x0,'rows':[]};var _0x219d33=_[_0x51b2('0x39')](db[_0x51b2('0x3a')]['rawAttributes'],function(_0x2fa380){return{'name':_0x2fa380[_0x51b2('0x3b')],'type':_0x2fa380[_0x51b2('0x3c')]['key']};});_0x1c5109[_0x51b2('0x3d')]=_[_0x51b2('0x39')](_0x219d33,_0x51b2('0x36'));_0x1c5109[_0x51b2('0x3e')]=_[_0x51b2('0x3f')](_0x2c42d3['query']);_0x1c5109[_0x51b2('0x40')]=_[_0x51b2('0x41')](_0x1c5109[_0x51b2('0x3d')],_0x1c5109[_0x51b2('0x3e')]);_0x16339a[_0x51b2('0x42')]=_[_0x51b2('0x41')](_0x1c5109[_0x51b2('0x3d')],qs[_0x51b2('0x43')](_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x43')]));_0x16339a[_0x51b2('0x42')]=_0x16339a[_0x51b2('0x42')][_0x51b2('0x44')]?_0x16339a[_0x51b2('0x42')]:_0x1c5109[_0x51b2('0x3d')];if(!_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x45')](_0x51b2('0x46'))){_0x16339a[_0x51b2('0x2b')]=qs[_0x51b2('0x2b')](_0x2c42d3['query']['limit']);_0x16339a['offset']=qs[_0x51b2('0x29')](_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x29')]);}_0x16339a[_0x51b2('0x47')]=qs[_0x51b2('0x48')](_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x48')]);_0x16339a[_0x51b2('0x49')]=qs[_0x51b2('0x40')](_[_0x51b2('0x4a')](_0x2c42d3[_0x51b2('0x3e')],_0x1c5109[_0x51b2('0x40')]),_0x219d33);if(_0x2c42d3['query'][_0x51b2('0x4b')]){_0x16339a[_0x51b2('0x49')]=_[_0x51b2('0x4c')](_0x16339a['where'],{'$or':_['map'](_0x219d33,function(_0x22498e){if(_0x22498e[_0x51b2('0x3c')]!==_0x51b2('0x4d')){var _0x174423={};_0x174423[_0x22498e[_0x51b2('0x36')]]={'$like':'%'+_0x2c42d3['query'][_0x51b2('0x4b')]+'%'};return _0x174423;}})});}_0x16339a=_[_0x51b2('0x4c')]({},_0x16339a,_0x2c42d3[_0x51b2('0x4e')]);var _0x434ada={'where':_0x16339a[_0x51b2('0x49')]};return db[_0x51b2('0x3a')]['count'](_0x434ada)[_0x51b2('0x19')](function(_0x57a4a9){_0x56854f[_0x51b2('0x2c')]=_0x57a4a9;if(_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x4f')]){_0x16339a[_0x51b2('0x50')]=[{'all':!![]}];}return db['VoiceContext'][_0x51b2('0x51')](_0x16339a);})[_0x51b2('0x19')](function(_0x32bd9a){_0x56854f[_0x51b2('0x52')]=_0x32bd9a;return _0x56854f;})[_0x51b2('0x19')](respondWithFilteredResult(_0x1ce1bd,_0x16339a))['catch'](handleError(_0x1ce1bd,null));};exports[_0x51b2('0x53')]=function(_0x2e8dec,_0x278128){var _0x303341={'raw':![],'where':{'id':_0x2e8dec[_0x51b2('0x54')]['id']}},_0x1084bc={};_0x1084bc['model']=_[_0x51b2('0x3f')](db[_0x51b2('0x3a')][_0x51b2('0x55')]);_0x1084bc[_0x51b2('0x3e')]=_['keys'](_0x2e8dec[_0x51b2('0x3e')]);_0x1084bc['filters']=_[_0x51b2('0x41')](_0x1084bc['model'],_0x1084bc[_0x51b2('0x3e')]);_0x303341[_0x51b2('0x42')]=_['intersection'](_0x1084bc[_0x51b2('0x3d')],qs['fields'](_0x2e8dec['query'][_0x51b2('0x43')]));_0x303341[_0x51b2('0x42')]=_0x303341['attributes'][_0x51b2('0x44')]?_0x303341[_0x51b2('0x42')]:_0x1084bc[_0x51b2('0x3d')];if(_0x2e8dec[_0x51b2('0x3e')][_0x51b2('0x4f')]){_0x303341[_0x51b2('0x50')]=[{'all':!![]}];}_0x303341=_[_0x51b2('0x4c')]({},_0x303341,_0x2e8dec[_0x51b2('0x4e')]);return db[_0x51b2('0x3a')][_0x51b2('0x56')](_0x303341)[_0x51b2('0x19')](handleEntityNotFound(_0x278128,null))[_0x51b2('0x19')](respondWithResult(_0x278128,null))[_0x51b2('0x24')](handleError(_0x278128,null));};exports[_0x51b2('0x57')]=function(_0x311ce7,_0x58b495,_0x2460cb){var _0x4abccb;return db[_0x51b2('0x3a')][_0x51b2('0x57')](_0x311ce7[_0x51b2('0x58')],{'raw':!![]})[_0x51b2('0x19')](function(_0x3b5a63){_0x4abccb=_0x3b5a63;return db[_0x51b2('0x3a')][_0x51b2('0x51')]({'raw':!![]});})['then'](function(_0x73bbbd){var _0x5c26fc=fs[_0x51b2('0x59')](path['join'](config[_0x51b2('0x5a')],_0x51b2('0x5b')),_0x51b2('0x5c'));var _0x660c10=ejs[_0x51b2('0x5d')](_0x5c26fc,{'contexts':_0x73bbbd||[]});fs[_0x51b2('0x5e')](_0x51b2('0x5f'),_0x660c10);})[_0x51b2('0x19')](function(){return respondWithRpcPromise(_0x51b2('0x60'),_0x51b2('0x57'),{'module':_0x51b2('0x61')});})[_0x51b2('0x19')](function(){var _0x51bc7a=_0x311ce7[_0x51b2('0x62')][_0x51b2('0x63')]({'plain':!![]});if(!_0x51bc7a)throw new Error(_0x51b2('0x64'));if(_0x51bc7a[_0x51b2('0x65')]===_0x51b2('0x62')){var _0x242ca4=_0x4abccb['get']({'plain':!![]});return db[_0x51b2('0x66')][_0x51b2('0x56')]({'where':{'name':_0x51b2('0x33'),'userProfileId':_0x51bc7a[_0x51b2('0x67')]},'raw':!![]})[_0x51b2('0x19')](function(_0x554733){if(_0x554733&&_0x554733['autoAssociation']===0x0){return db[_0x51b2('0x34')][_0x51b2('0x57')]({'name':_0x242ca4[_0x51b2('0x36')],'resourceId':_0x242ca4['id'],'type':_0x554733['name'],'sectionId':_0x554733['id']},{})[_0x51b2('0x19')](function(){return _0x4abccb;});}else{return _0x4abccb;}})[_0x51b2('0x24')](function(_0xf55349){logger[_0x51b2('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf55349);throw _0xf55349;});}return _0x4abccb;})[_0x51b2('0x19')](respondWithResult(_0x58b495,0xc9))[_0x51b2('0x24')](handleError(_0x58b495,null));};exports[_0x51b2('0x32')]=function(_0x471259,_0x2b1cf8,_0x4051a3){var _0x3467fb;return db['VoiceContext'][_0x51b2('0x56')]({'where':{'id':_0x471259['params']['id']}})[_0x51b2('0x19')](handleEntityNotFound(_0x2b1cf8,null))[_0x51b2('0x19')](saveUpdates(_0x471259['body'],null))['then'](function(_0xfe1815){if(_0xfe1815){_0x3467fb=_0xfe1815;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x51b2('0x19')](function(_0x2d9415){var _0x3431dd=fs[_0x51b2('0x59')](path[_0x51b2('0x68')](config['root'],_0x51b2('0x5b')),_0x51b2('0x5c'));var _0x1b0506=ejs['render'](_0x3431dd,{'contexts':_0x2d9415||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x1b0506);})['then'](function(){return respondWithRpcPromise('Reload',_0x51b2('0x32'),{'module':_0x51b2('0x61')});})['then'](function(){return _0x3467fb;})['then'](respondWithResult(_0x2b1cf8,null))['catch'](handleError(_0x2b1cf8,null));};exports[_0x51b2('0x35')]=function(_0x572053,_0x4d34a4,_0x350511){var _0x5f5125;return db[_0x51b2('0x3a')]['find']({'where':{'id':_0x572053[_0x51b2('0x54')]['id']}})[_0x51b2('0x19')](handleEntityNotFound(_0x4d34a4,null))[_0x51b2('0x19')](removeEntity(_0x4d34a4,null))[_0x51b2('0x19')](function(){return db[_0x51b2('0x3a')][_0x51b2('0x51')]({'raw':!![]});})['then'](function(_0xeb633a){var _0x3a84a5=fs[_0x51b2('0x59')](path[_0x51b2('0x68')](config['root'],_0x51b2('0x5b')),_0x51b2('0x5c'));var _0x262976=ejs[_0x51b2('0x5d')](_0x3a84a5,{'contexts':_0xeb633a});fs['writeFileSync'](_0x51b2('0x5f'),_0x262976);return respondWithRpcPromise(_0x51b2('0x60'),_0x51b2('0x35'),{'module':_0x51b2('0x61')});})['catch'](handleError(_0x4d34a4,null));}; \ No newline at end of file +var _0x9193=['info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','name','index','map','VoiceContext','fieldName','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','create','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','root','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','request','then'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x9193,0x1d4));var _0x3919=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x9193[_0x40b493];return _0x548365;};'use strict';var emlformat=require(_0x3919('0x0'));var rimraf=require(_0x3919('0x1'));var zipdir=require(_0x3919('0x2'));var jsonpatch=require(_0x3919('0x3'));var rp=require(_0x3919('0x4'));var moment=require(_0x3919('0x5'));var BPromise=require(_0x3919('0x6'));var Mustache=require(_0x3919('0x7'));var util=require(_0x3919('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3919('0x9'));var ejs=require(_0x3919('0xa'));var fs=require('fs');var fs_extra=require(_0x3919('0xb'));var _=require(_0x3919('0xc'));var squel=require(_0x3919('0xd'));var crypto=require(_0x3919('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3919('0xf'));var toCsv=require(_0x3919('0x9'));var querystring=require(_0x3919('0x10'));var Papa=require(_0x3919('0x11'));var Redis=require(_0x3919('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3919('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3919('0x14'))(_0x3919('0x15'));var utils=require(_0x3919('0x16'));var config=require(_0x3919('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x3919('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x488e25,_0x10df7c,_0x493bab,_0x37901b){return new BPromise(function(_0x5906d3,_0x3d55f4){var _0xfd0438=_0x37901b||client;return _0xfd0438[_0x3919('0x19')](_0x488e25,_0x493bab)[_0x3919('0x1a')](function(_0x3ac48d){logger[_0x3919('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x10df7c,_0x3919('0x1c'));logger[_0x3919('0x1d')](_0x3919('0x1e'),_0x10df7c,'request\x20sent',JSON[_0x3919('0x1f')](_0x3ac48d));if(_0x3ac48d[_0x3919('0x20')]){if(_0x3ac48d[_0x3919('0x20')][_0x3919('0x21')]===0x1f4){logger['error'](_0x3919('0x22'),_0x10df7c,_0x3ac48d[_0x3919('0x20')][_0x3919('0x23')]);return _0x3d55f4(_0x3ac48d[_0x3919('0x20')][_0x3919('0x23')]);}logger[_0x3919('0x20')]('VoiceContext,\x20%s,\x20%s',_0x10df7c,_0x3ac48d[_0x3919('0x20')][_0x3919('0x23')]);return _0x5906d3(_0x3ac48d[_0x3919('0x20')][_0x3919('0x23')]);}else{logger[_0x3919('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x10df7c,'request\x20sent');_0x5906d3(_0x3ac48d[_0x3919('0x24')][_0x3919('0x23')]);}})[_0x3919('0x25')](function(_0x57a320){logger['error'](_0x3919('0x22'),_0x10df7c,_0x57a320);_0x3d55f4(_0x57a320);});});}function respondWithStatusCode(_0x2344a4,_0x3a3f6a){_0x3a3f6a=_0x3a3f6a||0xcc;return function(_0x3d69ed){if(_0x3d69ed){return _0x2344a4[_0x3919('0x26')](_0x3a3f6a);}return _0x2344a4[_0x3919('0x27')](_0x3a3f6a)[_0x3919('0x28')]();};}function respondWithResult(_0x54ffea,_0x49c2ab){_0x49c2ab=_0x49c2ab||0xc8;return function(_0x3b5779){if(_0x3b5779){return _0x54ffea['status'](_0x49c2ab)[_0x3919('0x29')](_0x3b5779);}};}function respondWithFilteredResult(_0x466fd7,_0x5353fd){return function(_0x3262fb){if(_0x3262fb){var _0x45dade=typeof _0x5353fd[_0x3919('0x2a')]==='undefined'&&typeof _0x5353fd[_0x3919('0x2b')]==='undefined';var _0xa7aecd=_0x3262fb[_0x3919('0x2c')];var _0xbff6c2=_0x45dade?0x0:_0x5353fd['offset'];var _0x379cf8=_0x45dade?_0x3262fb['count']:_0x5353fd['offset']+_0x5353fd['limit'];var _0x50b0a4;if(_0x379cf8>=_0xa7aecd){_0x379cf8=_0xa7aecd;_0x50b0a4=0xc8;}else{_0x50b0a4=0xce;}_0x466fd7['status'](_0x50b0a4);return _0x466fd7[_0x3919('0x2d')](_0x3919('0x2e'),_0xbff6c2+'-'+_0x379cf8+'/'+_0xa7aecd)[_0x3919('0x29')](_0x3262fb);}return null;};}function patchUpdates(_0x2f6992){return function(_0x1a480b){try{jsonpatch[_0x3919('0x2f')](_0x1a480b,_0x2f6992,!![]);}catch(_0x579d11){return BPromise['reject'](_0x579d11);}return _0x1a480b[_0x3919('0x30')]();};}function saveUpdates(_0x3e69e6,_0x14b911){return function(_0x4f9dc7){if(_0x4f9dc7){return _0x4f9dc7[_0x3919('0x31')](_0x3e69e6)[_0x3919('0x1a')](function(_0x23760b){return _0x23760b;});}return null;};}function removeEntity(_0x3168f4,_0x230160){return function(_0xfbff94){if(_0xfbff94){return _0xfbff94[_0x3919('0x32')]()[_0x3919('0x1a')](function(){var _0x22e50e=_0xfbff94[_0x3919('0x33')]({'plain':!![]});var _0xfc1b34='Contexts';return db[_0x3919('0x34')]['destroy']({'where':{'type':_0xfc1b34,'resourceId':_0x22e50e['id']}})[_0x3919('0x1a')](function(){return _0xfbff94;});})[_0x3919('0x1a')](function(){_0x3168f4[_0x3919('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x108b36,_0x16d9b5){return function(_0x1b65c6){if(!_0x1b65c6){_0x108b36[_0x3919('0x26')](0x194);}return _0x1b65c6;};}function handleError(_0x1fbc3c,_0x5e9bae){_0x5e9bae=_0x5e9bae||0x1f4;return function(_0x46e0c7){logger[_0x3919('0x20')](_0x46e0c7['stack']);if(_0x46e0c7[_0x3919('0x35')]){delete _0x46e0c7[_0x3919('0x35')];}_0x1fbc3c[_0x3919('0x27')](_0x5e9bae)['send'](_0x46e0c7);};}exports[_0x3919('0x36')]=function(_0x3dc3e2,_0x44d7d2){var _0x4f167a={},_0x247c35={},_0x5e0042={'count':0x0,'rows':[]};var _0x28c11e=_[_0x3919('0x37')](db[_0x3919('0x38')]['rawAttributes'],function(_0x2d896f){return{'name':_0x2d896f[_0x3919('0x39')],'type':_0x2d896f['type']['key']};});_0x247c35['model']=_['map'](_0x28c11e,'name');_0x247c35[_0x3919('0x3a')]=_['keys'](_0x3dc3e2[_0x3919('0x3a')]);_0x247c35['filters']=_[_0x3919('0x3b')](_0x247c35[_0x3919('0x3c')],_0x247c35[_0x3919('0x3a')]);_0x4f167a['attributes']=_[_0x3919('0x3b')](_0x247c35['model'],qs[_0x3919('0x3d')](_0x3dc3e2[_0x3919('0x3a')]['fields']));_0x4f167a[_0x3919('0x3e')]=_0x4f167a[_0x3919('0x3e')][_0x3919('0x3f')]?_0x4f167a[_0x3919('0x3e')]:_0x247c35[_0x3919('0x3c')];if(!_0x3dc3e2[_0x3919('0x3a')][_0x3919('0x40')]('nolimit')){_0x4f167a[_0x3919('0x2b')]=qs[_0x3919('0x2b')](_0x3dc3e2[_0x3919('0x3a')][_0x3919('0x2b')]);_0x4f167a[_0x3919('0x2a')]=qs['offset'](_0x3dc3e2[_0x3919('0x3a')][_0x3919('0x2a')]);}_0x4f167a[_0x3919('0x41')]=qs['sort'](_0x3dc3e2[_0x3919('0x3a')][_0x3919('0x42')]);_0x4f167a['where']=qs[_0x3919('0x43')](_[_0x3919('0x44')](_0x3dc3e2[_0x3919('0x3a')],_0x247c35['filters']),_0x28c11e);if(_0x3dc3e2[_0x3919('0x3a')][_0x3919('0x45')]){_0x4f167a['where']=_[_0x3919('0x46')](_0x4f167a[_0x3919('0x47')],{'$or':_[_0x3919('0x37')](_0x28c11e,function(_0x1397b4){if(_0x1397b4['type']!=='VIRTUAL'){var _0x471a90={};_0x471a90[_0x1397b4['name']]={'$like':'%'+_0x3dc3e2[_0x3919('0x3a')][_0x3919('0x45')]+'%'};return _0x471a90;}})});}_0x4f167a=_[_0x3919('0x46')]({},_0x4f167a,_0x3dc3e2[_0x3919('0x48')]);var _0x4ab913={'where':_0x4f167a[_0x3919('0x47')]};return db['VoiceContext'][_0x3919('0x2c')](_0x4ab913)[_0x3919('0x1a')](function(_0x9cb96b){_0x5e0042['count']=_0x9cb96b;if(_0x3dc3e2[_0x3919('0x3a')][_0x3919('0x49')]){_0x4f167a[_0x3919('0x4a')]=[{'all':!![]}];}return db['VoiceContext'][_0x3919('0x4b')](_0x4f167a);})[_0x3919('0x1a')](function(_0x565fe8){_0x5e0042[_0x3919('0x4c')]=_0x565fe8;return _0x5e0042;})[_0x3919('0x1a')](respondWithFilteredResult(_0x44d7d2,_0x4f167a))['catch'](handleError(_0x44d7d2,null));};exports[_0x3919('0x4d')]=function(_0x59937a,_0x203fc0){var _0x170a4d={'raw':![],'where':{'id':_0x59937a[_0x3919('0x4e')]['id']}},_0xf9420={};_0xf9420['model']=_['keys'](db[_0x3919('0x38')][_0x3919('0x4f')]);_0xf9420['query']=_[_0x3919('0x50')](_0x59937a[_0x3919('0x3a')]);_0xf9420[_0x3919('0x43')]=_[_0x3919('0x3b')](_0xf9420['model'],_0xf9420[_0x3919('0x3a')]);_0x170a4d[_0x3919('0x3e')]=_[_0x3919('0x3b')](_0xf9420[_0x3919('0x3c')],qs['fields'](_0x59937a['query'][_0x3919('0x3d')]));_0x170a4d[_0x3919('0x3e')]=_0x170a4d[_0x3919('0x3e')][_0x3919('0x3f')]?_0x170a4d['attributes']:_0xf9420[_0x3919('0x3c')];if(_0x59937a['query'][_0x3919('0x49')]){_0x170a4d[_0x3919('0x4a')]=[{'all':!![]}];}_0x170a4d=_[_0x3919('0x46')]({},_0x170a4d,_0x59937a[_0x3919('0x48')]);return db[_0x3919('0x38')][_0x3919('0x51')](_0x170a4d)[_0x3919('0x1a')](handleEntityNotFound(_0x203fc0,null))[_0x3919('0x1a')](respondWithResult(_0x203fc0,null))[_0x3919('0x25')](handleError(_0x203fc0,null));};exports[_0x3919('0x52')]=function(_0x16af24,_0x2125cb,_0x51a95d){var _0x51d22d;return db[_0x3919('0x38')][_0x3919('0x52')](_0x16af24['body'],{'raw':!![]})['then'](function(_0x21d47b){_0x51d22d=_0x21d47b;return db[_0x3919('0x38')][_0x3919('0x4b')]({'raw':!![]});})[_0x3919('0x1a')](function(_0x2d1289){var _0x547ff1=fs[_0x3919('0x53')](path[_0x3919('0x54')](config['root'],_0x3919('0x55')),_0x3919('0x56'));var _0x126469=ejs[_0x3919('0x57')](_0x547ff1,{'contexts':_0x2d1289||[]});fs[_0x3919('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x126469);})[_0x3919('0x1a')](function(){return respondWithRpcPromise(_0x3919('0x59'),_0x3919('0x52'),{'module':_0x3919('0x5a')});})[_0x3919('0x1a')](function(){var _0x597aba=_0x16af24['user'][_0x3919('0x33')]({'plain':!![]});if(!_0x597aba)throw new Error(_0x3919('0x5b'));if(_0x597aba[_0x3919('0x5c')]==='user'){var _0x4e3b1f=_0x51d22d[_0x3919('0x33')]({'plain':!![]});return db[_0x3919('0x5d')][_0x3919('0x51')]({'where':{'name':'Contexts','userProfileId':_0x597aba['userProfileId']},'raw':!![]})['then'](function(_0x5bb5e5){if(_0x5bb5e5&&_0x5bb5e5[_0x3919('0x5e')]===0x0){return db[_0x3919('0x34')]['create']({'name':_0x4e3b1f[_0x3919('0x35')],'resourceId':_0x4e3b1f['id'],'type':_0x5bb5e5[_0x3919('0x35')],'sectionId':_0x5bb5e5['id']},{})['then'](function(){return _0x51d22d;});}else{return _0x51d22d;}})[_0x3919('0x25')](function(_0x298f0f){logger[_0x3919('0x20')](_0x3919('0x5f'),_0x298f0f);throw _0x298f0f;});}return _0x51d22d;})['then'](respondWithResult(_0x2125cb,0xc9))[_0x3919('0x25')](handleError(_0x2125cb,null));};exports[_0x3919('0x31')]=function(_0x3545cd,_0x1b2df4,_0x1e9ee5){var _0x1afac3;return db['VoiceContext']['find']({'where':{'id':_0x3545cd['params']['id']}})[_0x3919('0x1a')](handleEntityNotFound(_0x1b2df4,null))[_0x3919('0x1a')](saveUpdates(_0x3545cd[_0x3919('0x60')],null))[_0x3919('0x1a')](function(_0x560dac){if(_0x560dac){_0x1afac3=_0x560dac;return db[_0x3919('0x38')][_0x3919('0x4b')]({'raw':!![]});}})[_0x3919('0x1a')](function(_0x47cf17){var _0x383d98=fs['readFileSync'](path['join'](config[_0x3919('0x61')],_0x3919('0x55')),_0x3919('0x56'));var _0x60fb5d=ejs['render'](_0x383d98,{'contexts':_0x47cf17||[]});fs[_0x3919('0x58')](_0x3919('0x62'),_0x60fb5d);})[_0x3919('0x1a')](function(){return respondWithRpcPromise(_0x3919('0x59'),_0x3919('0x31'),{'module':_0x3919('0x5a')});})[_0x3919('0x1a')](function(){return _0x1afac3;})[_0x3919('0x1a')](respondWithResult(_0x1b2df4,null))[_0x3919('0x25')](handleError(_0x1b2df4,null));};exports[_0x3919('0x32')]=function(_0xf36024,_0x448bdf,_0x2f2504){var _0x28a25c;return db[_0x3919('0x38')][_0x3919('0x51')]({'where':{'id':_0xf36024[_0x3919('0x4e')]['id']}})[_0x3919('0x1a')](handleEntityNotFound(_0x448bdf,null))['then'](removeEntity(_0x448bdf,null))[_0x3919('0x1a')](function(){return db[_0x3919('0x38')][_0x3919('0x4b')]({'raw':!![]});})[_0x3919('0x1a')](function(_0x29400a){var _0x3e16d1=fs[_0x3919('0x53')](path[_0x3919('0x54')](config[_0x3919('0x61')],_0x3919('0x55')),'utf8');var _0x36bb33=ejs[_0x3919('0x57')](_0x3e16d1,{'contexts':_0x29400a});fs[_0x3919('0x58')](_0x3919('0x62'),_0x36bb33);return respondWithRpcPromise(_0x3919('0x59'),'destroy',{'module':_0x3919('0x5a')});})[_0x3919('0x25')](handleError(_0x448bdf,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 560a65a..2ba244e 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 _0x4c4a=['path','../../config/environment','exports','VoiceContext','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x4ebffa,_0x1ab8db){_0x4ebffa=_0x4ebffa-0x0;var _0x4aec5f=_0x4c4a[_0x4ebffa];return _0x4aec5f;};'use strict';var _=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var logger=require(_0xa4c4('0x2'))('api');var moment=require(_0xa4c4('0x3'));var BPromise=require(_0xa4c4('0x4'));var rp=require(_0xa4c4('0x5'));var fs=require('fs');var path=require(_0xa4c4('0x6'));var rimraf=require('rimraf');var config=require(_0xa4c4('0x7'));var attributes=require('./voiceContext.attributes');module[_0xa4c4('0x8')]=function(_0x11aded,_0x5ca539){return _0x11aded['define'](_0xa4c4('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbde=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xcbde,0x1df));var _0xecbd=function(_0x3342fe,_0x2f7f8a){_0x3342fe=_0x3342fe-0x0;var _0x4fee7d=_0xcbde[_0x3342fe];return _0x4fee7d;};'use strict';var _=require('lodash');var util=require(_0xecbd('0x0'));var logger=require(_0xecbd('0x1'))(_0xecbd('0x2'));var moment=require('moment');var BPromise=require(_0xecbd('0x3'));var rp=require(_0xecbd('0x4'));var fs=require('fs');var path=require(_0xecbd('0x5'));var rimraf=require(_0xecbd('0x6'));var config=require(_0xecbd('0x7'));var attributes=require(_0xecbd('0x8'));module[_0xecbd('0x9')]=function(_0x203e17,_0x6b2490){return _0x203e17['define'](_0xecbd('0xa'),attributes,{'tableName':'voice_contexts','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 22eb7c6..4af693d 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 _0x076b=['rpc','../../config/environment','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x291517,_0x438909){var _0x1473cc=function(_0x2ff13b){while(--_0x2ff13b){_0x291517['push'](_0x291517['shift']());}};_0x1473cc(++_0x438909);}(_0x076b,0x1c1));var _0xb076=function(_0x110005,_0x54031f){_0x110005=_0x110005-0x0;var _0x162ac7=_0x076b[_0x110005];return _0x162ac7;};'use strict';var _=require(_0xb076('0x0'));var util=require(_0xb076('0x1'));var moment=require(_0xb076('0x2'));var BPromise=require(_0xb076('0x3'));var rs=require(_0xb076('0x4'));var fs=require('fs');var Redis=require(_0xb076('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb076('0x6'))(_0xb076('0x7'));var config=require(_0xb076('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43270b,_0x1821c4,_0x593373){return new BPromise(function(_0x5bda23,_0x26aca5){return client[_0xb076('0x9')](_0x43270b,_0x593373)['then'](function(_0x3dbea1){logger[_0xb076('0xa')](_0xb076('0xb'),_0x1821c4,_0xb076('0xc'));logger[_0xb076('0xd')](_0xb076('0xe'),_0x1821c4,'request\x20sent',JSON['stringify'](_0x3dbea1));if(_0x3dbea1[_0xb076('0xf')]){if(_0x3dbea1[_0xb076('0xf')][_0xb076('0x10')]===0x1f4){logger['error'](_0xb076('0xb'),_0x1821c4,_0x3dbea1[_0xb076('0xf')]['message']);return _0x26aca5(_0x3dbea1['error'][_0xb076('0x11')]);}logger[_0xb076('0xf')](_0xb076('0xb'),_0x1821c4,_0x3dbea1[_0xb076('0xf')]['message']);return _0x5bda23(_0x3dbea1[_0xb076('0xf')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x1821c4,'request\x20sent');_0x5bda23(_0x3dbea1[_0xb076('0x12')][_0xb076('0x11')]);}})['catch'](function(_0x4402c4){logger[_0xb076('0xf')]('VoiceContext,\x20%s,\x20%s',_0x1821c4,_0x4402c4);_0x26aca5(_0x4402c4);});});} \ No newline at end of file +var _0xa149=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa149,0x18c));var _0x9a14=function(_0x3c5fef,_0x1cd543){_0x3c5fef=_0x3c5fef-0x0;var _0x555f22=_0xa149[_0x3c5fef];return _0x555f22;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var moment=require(_0x9a14('0x2'));var BPromise=require(_0x9a14('0x3'));var rs=require(_0x9a14('0x4'));var fs=require('fs');var Redis=require(_0x9a14('0x5'));var db=require(_0x9a14('0x6'))['db'];var utils=require(_0x9a14('0x7'));var logger=require(_0x9a14('0x8'))('rpc');var config=require(_0x9a14('0x9'));var jayson=require(_0x9a14('0xa'));var client=jayson['client'][_0x9a14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3beb93,_0x286760,_0x17d2e5){return new BPromise(function(_0x109f69,_0x26efc5){return client['request'](_0x3beb93,_0x17d2e5)[_0x9a14('0xc')](function(_0x4bdd6c){logger[_0x9a14('0xd')](_0x9a14('0xe'),_0x286760,_0x9a14('0xf'));logger[_0x9a14('0x10')](_0x9a14('0x11'),_0x286760,_0x9a14('0xf'),JSON['stringify'](_0x4bdd6c));if(_0x4bdd6c['error']){if(_0x4bdd6c['error']['code']===0x1f4){logger[_0x9a14('0x12')](_0x9a14('0xe'),_0x286760,_0x4bdd6c['error'][_0x9a14('0x13')]);return _0x26efc5(_0x4bdd6c['error'][_0x9a14('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x286760,_0x4bdd6c[_0x9a14('0x12')][_0x9a14('0x13')]);return _0x109f69(_0x4bdd6c[_0x9a14('0x12')][_0x9a14('0x13')]);}else{logger['info'](_0x9a14('0xe'),_0x286760,_0x9a14('0xf'));_0x109f69(_0x4bdd6c[_0x9a14('0x14')][_0x9a14('0x13')]);}})[_0x9a14('0x15')](function(_0x5b3a7a){logger[_0x9a14('0x12')](_0x9a14('0xe'),_0x286760,_0x5b3a7a);_0x26efc5(_0x5b3a7a);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index eafc563..97ce993 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 _0x9bde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','util','connect-timeout','Router'];(function(_0x406184,_0x3712fb){var _0x23e4f9=function(_0xabd8a8){while(--_0xabd8a8){_0x406184['push'](_0x406184['shift']());}};_0x23e4f9(++_0x3712fb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1afafe,_0x469709){_0x1afafe=_0x1afafe-0x0;var _0x595639=_0x9bde[_0x1afafe];return _0x595639;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9bd('0x10')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x11')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x13f7=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','describe','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x1ab7f0,_0x18528e){var _0x517d64=function(_0x2e7874){while(--_0x2e7874){_0x1ab7f0['push'](_0x1ab7f0['shift']());}};_0x517d64(++_0x18528e);}(_0x13f7,0x164));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x713f('0x0'));var util=require(_0x713f('0x1'));var path=require(_0x713f('0x2'));var timeout=require(_0x713f('0x3'));var express=require('express');var router=express[_0x713f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x713f('0x5'));var interaction=require(_0x713f('0x6'));var config=require(_0x713f('0x7'));var controller=require('./voiceDialReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x713f('0x8')]);router[_0x713f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x713f('0xa')]);router['get'](_0x713f('0xb'),auth[_0x713f('0xc')](),controller[_0x713f('0xd')]);router[_0x713f('0xe')]('/',auth[_0x713f('0xc')](),controller['create']);router[_0x713f('0xf')](_0x713f('0xb'),auth[_0x713f('0xc')](),controller['update']);router[_0x713f('0x10')](_0x713f('0xb'),auth[_0x713f('0xc')](),controller[_0x713f('0x11')]);module[_0x713f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 44c4e48..61845b3 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 _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x32ad3f,_0x179fb4){var _0x10959f=function(_0x566075){while(--_0x566075){_0x32ad3f['push'](_0x32ad3f['shift']());}};_0x10959f(++_0x179fb4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file +var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x53f201,_0x22906b){var _0x2c8baf=function(_0x77bdd2){while(--_0x77bdd2){_0x53f201['push'](_0x53f201['shift']());}};_0x2c8baf(++_0x22906b);}(_0xedd9,0xfc));var _0x9edd=function(_0x5194b9,_0x794f60){_0x5194b9=_0x5194b9-0x0;var _0x1dd232=_0xedd9[_0x5194b9];return _0x1dd232;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 736c4d8..8e5dfd0 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 _0x50a2=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','keys','options','find','create','describe','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x44a14f,_0x1c6d76){var _0x5f274a=function(_0x23635b){while(--_0x23635b){_0x44a14f['push'](_0x44a14f['shift']());}};_0x5f274a(++_0x1c6d76);}(_0x50a2,0x1f3));var _0x250a=function(_0x2f90e5,_0x33f676){_0x2f90e5=_0x2f90e5-0x0;var _0x30e9a3=_0x50a2[_0x2f90e5];return _0x30e9a3;};'use strict';var emlformat=require(_0x250a('0x0'));var rimraf=require(_0x250a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x250a('0x2'));var rp=require(_0x250a('0x3'));var moment=require(_0x250a('0x4'));var BPromise=require(_0x250a('0x5'));var Mustache=require(_0x250a('0x6'));var util=require(_0x250a('0x7'));var path=require(_0x250a('0x8'));var sox=require(_0x250a('0x9'));var csv=require(_0x250a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x250a('0xb'));var _=require(_0x250a('0xc'));var squel=require(_0x250a('0xd'));var crypto=require(_0x250a('0xe'));var jsforce=require(_0x250a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x250a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x250a('0x10'));var authService=require(_0x250a('0x11'));var qs=require(_0x250a('0x12'));var as=require(_0x250a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x250a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x250a('0x15'));var licenseUtil=require(_0x250a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x516961,_0x31b0e6){_0x31b0e6=_0x31b0e6||0xcc;return function(_0x417310){if(_0x417310){return _0x516961[_0x250a('0x17')](_0x31b0e6);}return _0x516961[_0x250a('0x18')](_0x31b0e6)['end']();};}function respondWithResult(_0x1db21d,_0xb1fdc4){_0xb1fdc4=_0xb1fdc4||0xc8;return function(_0x12cb1d){if(_0x12cb1d){return _0x1db21d[_0x250a('0x18')](_0xb1fdc4)[_0x250a('0x19')](_0x12cb1d);}};}function respondWithFilteredResult(_0x49b472,_0x11b850){return function(_0x11e3ca){if(_0x11e3ca){var _0x2cbab9=typeof _0x11b850[_0x250a('0x1a')]===_0x250a('0x1b')&&typeof _0x11b850[_0x250a('0x1c')]===_0x250a('0x1b');var _0x4a57dd=_0x11e3ca['count'];var _0x2748c4=_0x2cbab9?0x0:_0x11b850['offset'];var _0x5404b8=_0x2cbab9?_0x11e3ca[_0x250a('0x1d')]:_0x11b850[_0x250a('0x1a')]+_0x11b850[_0x250a('0x1c')];var _0x45d63e;if(_0x5404b8>=_0x4a57dd){_0x5404b8=_0x4a57dd;_0x45d63e=0xc8;}else{_0x45d63e=0xce;}_0x49b472[_0x250a('0x18')](_0x45d63e);return _0x49b472[_0x250a('0x1e')](_0x250a('0x1f'),_0x2748c4+'-'+_0x5404b8+'/'+_0x4a57dd)[_0x250a('0x19')](_0x11e3ca);}return null;};}function patchUpdates(_0x3668a1){return function(_0x47e57b){try{jsonpatch[_0x250a('0x20')](_0x47e57b,_0x3668a1,!![]);}catch(_0x5dd1b1){return BPromise[_0x250a('0x21')](_0x5dd1b1);}return _0x47e57b[_0x250a('0x22')]();};}function saveUpdates(_0x2827ea,_0xf8b40b){return function(_0x1a6bd8){if(_0x1a6bd8){return _0x1a6bd8[_0x250a('0x23')](_0x2827ea)[_0x250a('0x24')](function(_0x330a2c){return _0x330a2c;});}return null;};}function removeEntity(_0x5474c3,_0xe4b163){return function(_0x320693){if(_0x320693){return _0x320693['destroy']()['then'](function(){_0x5474c3['status'](0xcc)[_0x250a('0x25')]();});}};}function handleEntityNotFound(_0x4a0cc8,_0x103ef1){return function(_0x9b0d13){if(!_0x9b0d13){_0x4a0cc8[_0x250a('0x17')](0x194);}return _0x9b0d13;};}function handleError(_0x56f7af,_0x1555fe){_0x1555fe=_0x1555fe||0x1f4;return function(_0xd1d5dc){logger[_0x250a('0x26')](_0xd1d5dc['stack']);if(_0xd1d5dc['name']){delete _0xd1d5dc[_0x250a('0x27')];}_0x56f7af[_0x250a('0x18')](_0x1555fe)['send'](_0xd1d5dc);};}exports[_0x250a('0x28')]=function(_0x4c5ce9,_0x48d1a0){var _0x4d63ad={},_0x31a52c={},_0x211efc={'count':0x0,'rows':[]};var _0x1211ec=_['map'](db[_0x250a('0x29')][_0x250a('0x2a')],function(_0x1f6b8d){return{'name':_0x1f6b8d[_0x250a('0x2b')],'type':_0x1f6b8d[_0x250a('0x2c')][_0x250a('0x2d')]};});_0x31a52c[_0x250a('0x2e')]=_[_0x250a('0x2f')](_0x1211ec,_0x250a('0x27'));_0x31a52c[_0x250a('0x30')]=_['keys'](_0x4c5ce9[_0x250a('0x30')]);_0x31a52c[_0x250a('0x31')]=_[_0x250a('0x32')](_0x31a52c[_0x250a('0x2e')],_0x31a52c['query']);_0x4d63ad[_0x250a('0x33')]=_['intersection'](_0x31a52c[_0x250a('0x2e')],qs[_0x250a('0x34')](_0x4c5ce9['query'][_0x250a('0x34')]));_0x4d63ad[_0x250a('0x33')]=_0x4d63ad['attributes']['length']?_0x4d63ad[_0x250a('0x33')]:_0x31a52c[_0x250a('0x2e')];if(!_0x4c5ce9[_0x250a('0x30')][_0x250a('0x35')](_0x250a('0x36'))){_0x4d63ad[_0x250a('0x1c')]=qs[_0x250a('0x1c')](_0x4c5ce9[_0x250a('0x30')][_0x250a('0x1c')]);_0x4d63ad['offset']=qs[_0x250a('0x1a')](_0x4c5ce9[_0x250a('0x30')][_0x250a('0x1a')]);}_0x4d63ad[_0x250a('0x37')]=qs['sort'](_0x4c5ce9[_0x250a('0x30')][_0x250a('0x38')]);_0x4d63ad['where']=qs[_0x250a('0x31')](_['pick'](_0x4c5ce9[_0x250a('0x30')],_0x31a52c[_0x250a('0x31')]),_0x1211ec);if(_0x4c5ce9[_0x250a('0x30')]['filter']){_0x4d63ad[_0x250a('0x39')]=_[_0x250a('0x3a')](_0x4d63ad[_0x250a('0x39')],{'$or':_['map'](_0x1211ec,function(_0x6adaa9){if(_0x6adaa9[_0x250a('0x2c')]!==_0x250a('0x3b')){var _0x1a8e13={};_0x1a8e13[_0x6adaa9['name']]={'$like':'%'+_0x4c5ce9[_0x250a('0x30')][_0x250a('0x3c')]+'%'};return _0x1a8e13;}})});}_0x4d63ad=_['merge']({},_0x4d63ad,_0x4c5ce9['options']);var _0x3ef174={'where':_0x4d63ad[_0x250a('0x39')]};return db[_0x250a('0x29')][_0x250a('0x1d')](_0x3ef174)[_0x250a('0x24')](function(_0x508cc7){_0x211efc[_0x250a('0x1d')]=_0x508cc7;if(_0x4c5ce9[_0x250a('0x30')][_0x250a('0x3d')]){_0x4d63ad[_0x250a('0x3e')]=[{'all':!![]}];}return db[_0x250a('0x29')][_0x250a('0x3f')](_0x4d63ad);})['then'](function(_0xdf64d3){_0x211efc[_0x250a('0x40')]=_0xdf64d3;return _0x211efc;})[_0x250a('0x24')](respondWithFilteredResult(_0x48d1a0,_0x4d63ad))[_0x250a('0x41')](handleError(_0x48d1a0,null));};exports['show']=function(_0x14a468,_0x1adf18){var _0x58f806={'raw':!![],'where':{'id':_0x14a468[_0x250a('0x42')]['id']}},_0x1b20d5={};_0x1b20d5[_0x250a('0x2e')]=_[_0x250a('0x43')](db[_0x250a('0x29')]['rawAttributes']);_0x1b20d5[_0x250a('0x30')]=_[_0x250a('0x43')](_0x14a468[_0x250a('0x30')]);_0x1b20d5[_0x250a('0x31')]=_[_0x250a('0x32')](_0x1b20d5[_0x250a('0x2e')],_0x1b20d5[_0x250a('0x30')]);_0x58f806['attributes']=_[_0x250a('0x32')](_0x1b20d5[_0x250a('0x2e')],qs[_0x250a('0x34')](_0x14a468[_0x250a('0x30')][_0x250a('0x34')]));_0x58f806['attributes']=_0x58f806[_0x250a('0x33')]['length']?_0x58f806[_0x250a('0x33')]:_0x1b20d5[_0x250a('0x2e')];if(_0x14a468[_0x250a('0x30')][_0x250a('0x3d')]){_0x58f806[_0x250a('0x3e')]=[{'all':!![]}];}_0x58f806=_[_0x250a('0x3a')]({},_0x58f806,_0x14a468[_0x250a('0x44')]);return db[_0x250a('0x29')][_0x250a('0x45')](_0x58f806)['then'](handleEntityNotFound(_0x1adf18,null))[_0x250a('0x24')](respondWithResult(_0x1adf18,null))['catch'](handleError(_0x1adf18,null));};exports[_0x250a('0x46')]=function(_0x2f213c,_0x39f577){return db['VoiceDialReport'][_0x250a('0x46')](_0x2f213c['body'],{})[_0x250a('0x24')](respondWithResult(_0x39f577,0xc9))['catch'](handleError(_0x39f577,null));};exports[_0x250a('0x23')]=function(_0x5358f7,_0x1ede5f){if(_0x5358f7['body']['id']){delete _0x5358f7['body']['id'];}return db['VoiceDialReport'][_0x250a('0x45')]({'where':{'id':_0x5358f7[_0x250a('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ede5f,null))[_0x250a('0x24')](saveUpdates(_0x5358f7['body'],null))[_0x250a('0x24')](respondWithResult(_0x1ede5f,null))['catch'](handleError(_0x1ede5f,null));};exports['destroy']=function(_0x3f0ecd,_0x33c621){return db[_0x250a('0x29')][_0x250a('0x45')]({'where':{'id':_0x3f0ecd[_0x250a('0x42')]['id']}})[_0x250a('0x24')](handleEntityNotFound(_0x33c621,null))[_0x250a('0x24')](removeEntity(_0x33c621,null))[_0x250a('0x41')](handleError(_0x33c621,null));};exports[_0x250a('0x47')]=function(_0xf028a8,_0x617185){return db[_0x250a('0x29')][_0x250a('0x47')]()[_0x250a('0x24')](respondWithResult(_0x617185,null))['catch'](handleError(_0x617185,null));}; \ No newline at end of file +var _0x9ae7=['fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','apply','reject','save','update','error','name','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9ae7,0x1b3));var _0x79ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ae7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x79ae('0x0'));var rimraf=require(_0x79ae('0x1'));var zipdir=require(_0x79ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79ae('0x3'));var moment=require('moment');var BPromise=require(_0x79ae('0x4'));var Mustache=require('mustache');var util=require(_0x79ae('0x5'));var path=require(_0x79ae('0x6'));var sox=require(_0x79ae('0x7'));var csv=require(_0x79ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79ae('0x9'));var squel=require(_0x79ae('0xa'));var crypto=require(_0x79ae('0xb'));var jsforce=require(_0x79ae('0xc'));var deskjs=require(_0x79ae('0xd'));var toCsv=require(_0x79ae('0x8'));var querystring=require(_0x79ae('0xe'));var Papa=require(_0x79ae('0xf'));var Redis=require(_0x79ae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x79ae('0x11'));var as=require(_0x79ae('0x12'));var hardwareService=require(_0x79ae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x79ae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x79ae('0x15'))['db'];function respondWithStatusCode(_0x42078e,_0x3751c7){_0x3751c7=_0x3751c7||0xcc;return function(_0x57b24b){if(_0x57b24b){return _0x42078e[_0x79ae('0x16')](_0x3751c7);}return _0x42078e['status'](_0x3751c7)[_0x79ae('0x17')]();};}function respondWithResult(_0x42012f,_0x4ab0ef){_0x4ab0ef=_0x4ab0ef||0xc8;return function(_0x3a88fa){if(_0x3a88fa){return _0x42012f[_0x79ae('0x18')](_0x4ab0ef)['json'](_0x3a88fa);}};}function respondWithFilteredResult(_0x1a8d3c,_0x5b77bc){return function(_0x5a878d){if(_0x5a878d){var _0x2276c8=typeof _0x5b77bc[_0x79ae('0x19')]==='undefined'&&typeof _0x5b77bc['limit']===_0x79ae('0x1a');var _0x347132=_0x5a878d['count'];var _0x1edebd=_0x2276c8?0x0:_0x5b77bc[_0x79ae('0x19')];var _0x36555d=_0x2276c8?_0x5a878d[_0x79ae('0x1b')]:_0x5b77bc[_0x79ae('0x19')]+_0x5b77bc[_0x79ae('0x1c')];var _0xc0731d;if(_0x36555d>=_0x347132){_0x36555d=_0x347132;_0xc0731d=0xc8;}else{_0xc0731d=0xce;}_0x1a8d3c[_0x79ae('0x18')](_0xc0731d);return _0x1a8d3c[_0x79ae('0x1d')]('Content-Range',_0x1edebd+'-'+_0x36555d+'/'+_0x347132)['json'](_0x5a878d);}return null;};}function patchUpdates(_0x4681c0){return function(_0x213197){try{jsonpatch[_0x79ae('0x1e')](_0x213197,_0x4681c0,!![]);}catch(_0x208f57){return BPromise[_0x79ae('0x1f')](_0x208f57);}return _0x213197[_0x79ae('0x20')]();};}function saveUpdates(_0x54b354,_0x19669e){return function(_0x128101){if(_0x128101){return _0x128101[_0x79ae('0x21')](_0x54b354)['then'](function(_0x6eca51){return _0x6eca51;});}return null;};}function removeEntity(_0x4da441,_0x2046ba){return function(_0x3c586c){if(_0x3c586c){return _0x3c586c['destroy']()['then'](function(){_0x4da441['status'](0xcc)[_0x79ae('0x17')]();});}};}function handleEntityNotFound(_0x59b5d8,_0x28044e){return function(_0x43e97f){if(!_0x43e97f){_0x59b5d8[_0x79ae('0x16')](0x194);}return _0x43e97f;};}function handleError(_0x276689,_0xc25418){_0xc25418=_0xc25418||0x1f4;return function(_0x344cfa){logger[_0x79ae('0x22')](_0x344cfa['stack']);if(_0x344cfa[_0x79ae('0x23')]){delete _0x344cfa[_0x79ae('0x23')];}_0x276689[_0x79ae('0x18')](_0xc25418)['send'](_0x344cfa);};}exports['index']=function(_0x548dc8,_0x4562a0){var _0x38d9c6={},_0x5f0f9c={},_0x4ea781={'count':0x0,'rows':[]};var _0x1148cb=_[_0x79ae('0x24')](db[_0x79ae('0x25')][_0x79ae('0x26')],function(_0x1c7721){return{'name':_0x1c7721[_0x79ae('0x27')],'type':_0x1c7721[_0x79ae('0x28')][_0x79ae('0x29')]};});_0x5f0f9c[_0x79ae('0x2a')]=_[_0x79ae('0x24')](_0x1148cb,_0x79ae('0x23'));_0x5f0f9c['query']=_[_0x79ae('0x2b')](_0x548dc8[_0x79ae('0x2c')]);_0x5f0f9c[_0x79ae('0x2d')]=_[_0x79ae('0x2e')](_0x5f0f9c[_0x79ae('0x2a')],_0x5f0f9c[_0x79ae('0x2c')]);_0x38d9c6[_0x79ae('0x2f')]=_['intersection'](_0x5f0f9c[_0x79ae('0x2a')],qs[_0x79ae('0x30')](_0x548dc8['query'][_0x79ae('0x30')]));_0x38d9c6[_0x79ae('0x2f')]=_0x38d9c6[_0x79ae('0x2f')]['length']?_0x38d9c6[_0x79ae('0x2f')]:_0x5f0f9c[_0x79ae('0x2a')];if(!_0x548dc8[_0x79ae('0x2c')][_0x79ae('0x31')](_0x79ae('0x32'))){_0x38d9c6[_0x79ae('0x1c')]=qs[_0x79ae('0x1c')](_0x548dc8[_0x79ae('0x2c')][_0x79ae('0x1c')]);_0x38d9c6['offset']=qs[_0x79ae('0x19')](_0x548dc8[_0x79ae('0x2c')][_0x79ae('0x19')]);}_0x38d9c6['order']=qs[_0x79ae('0x33')](_0x548dc8['query'][_0x79ae('0x33')]);_0x38d9c6[_0x79ae('0x34')]=qs[_0x79ae('0x2d')](_[_0x79ae('0x35')](_0x548dc8[_0x79ae('0x2c')],_0x5f0f9c[_0x79ae('0x2d')]),_0x1148cb);if(_0x548dc8[_0x79ae('0x2c')][_0x79ae('0x36')]){_0x38d9c6[_0x79ae('0x34')]=_[_0x79ae('0x37')](_0x38d9c6[_0x79ae('0x34')],{'$or':_[_0x79ae('0x24')](_0x1148cb,function(_0x55c29f){if(_0x55c29f['type']!==_0x79ae('0x38')){var _0x2ec638={};_0x2ec638[_0x55c29f[_0x79ae('0x23')]]={'$like':'%'+_0x548dc8[_0x79ae('0x2c')]['filter']+'%'};return _0x2ec638;}})});}_0x38d9c6=_[_0x79ae('0x37')]({},_0x38d9c6,_0x548dc8[_0x79ae('0x39')]);var _0x473681={'where':_0x38d9c6[_0x79ae('0x34')]};return db[_0x79ae('0x25')][_0x79ae('0x1b')](_0x473681)[_0x79ae('0x3a')](function(_0x3f183e){_0x4ea781[_0x79ae('0x1b')]=_0x3f183e;if(_0x548dc8[_0x79ae('0x2c')][_0x79ae('0x3b')]){_0x38d9c6[_0x79ae('0x3c')]=[{'all':!![]}];}return db[_0x79ae('0x25')]['findAll'](_0x38d9c6);})[_0x79ae('0x3a')](function(_0x474613){_0x4ea781[_0x79ae('0x3d')]=_0x474613;return _0x4ea781;})[_0x79ae('0x3a')](respondWithFilteredResult(_0x4562a0,_0x38d9c6))[_0x79ae('0x3e')](handleError(_0x4562a0,null));};exports['show']=function(_0x5a3df0,_0x529c74){var _0x4c5916={'raw':!![],'where':{'id':_0x5a3df0[_0x79ae('0x3f')]['id']}},_0x2e0ec3={};_0x2e0ec3[_0x79ae('0x2a')]=_['keys'](db['VoiceDialReport'][_0x79ae('0x26')]);_0x2e0ec3[_0x79ae('0x2c')]=_['keys'](_0x5a3df0['query']);_0x2e0ec3[_0x79ae('0x2d')]=_[_0x79ae('0x2e')](_0x2e0ec3[_0x79ae('0x2a')],_0x2e0ec3[_0x79ae('0x2c')]);_0x4c5916[_0x79ae('0x2f')]=_['intersection'](_0x2e0ec3[_0x79ae('0x2a')],qs['fields'](_0x5a3df0[_0x79ae('0x2c')][_0x79ae('0x30')]));_0x4c5916[_0x79ae('0x2f')]=_0x4c5916['attributes'][_0x79ae('0x40')]?_0x4c5916[_0x79ae('0x2f')]:_0x2e0ec3[_0x79ae('0x2a')];if(_0x5a3df0[_0x79ae('0x2c')][_0x79ae('0x3b')]){_0x4c5916[_0x79ae('0x3c')]=[{'all':!![]}];}_0x4c5916=_[_0x79ae('0x37')]({},_0x4c5916,_0x5a3df0['options']);return db[_0x79ae('0x25')]['find'](_0x4c5916)['then'](handleEntityNotFound(_0x529c74,null))[_0x79ae('0x3a')](respondWithResult(_0x529c74,null))['catch'](handleError(_0x529c74,null));};exports[_0x79ae('0x41')]=function(_0x24c46a,_0x5df68c){return db[_0x79ae('0x25')][_0x79ae('0x41')](_0x24c46a[_0x79ae('0x42')],{})[_0x79ae('0x3a')](respondWithResult(_0x5df68c,0xc9))['catch'](handleError(_0x5df68c,null));};exports['update']=function(_0x3e921f,_0xc14fea){if(_0x3e921f[_0x79ae('0x42')]['id']){delete _0x3e921f[_0x79ae('0x42')]['id'];}return db[_0x79ae('0x25')]['find']({'where':{'id':_0x3e921f[_0x79ae('0x3f')]['id']}})[_0x79ae('0x3a')](handleEntityNotFound(_0xc14fea,null))['then'](saveUpdates(_0x3e921f[_0x79ae('0x42')],null))[_0x79ae('0x3a')](respondWithResult(_0xc14fea,null))['catch'](handleError(_0xc14fea,null));};exports['destroy']=function(_0x76ba0c,_0xfe987a){return db[_0x79ae('0x25')][_0x79ae('0x43')]({'where':{'id':_0x76ba0c[_0x79ae('0x3f')]['id']}})[_0x79ae('0x3a')](handleEntityNotFound(_0xfe987a,null))[_0x79ae('0x3a')](removeEntity(_0xfe987a,null))[_0x79ae('0x3e')](handleError(_0xfe987a,null));};exports[_0x79ae('0x44')]=function(_0x3e3157,_0x41a440){return db[_0x79ae('0x25')]['describe']()[_0x79ae('0x3a')](respondWithResult(_0x41a440,null))[_0x79ae('0x3e')](handleError(_0x41a440,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6292889..98a5c25 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 _0x3291=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57e692,_0x533428){var _0x373592=function(_0x11ac5b){while(--_0x11ac5b){_0x57e692['push'](_0x57e692['shift']());}};_0x373592(++_0x533428);}(_0x3291,0x1cb));var _0x1329=function(_0x119840,_0x5610b7){_0x119840=_0x119840-0x0;var _0x262bdd=_0x3291[_0x119840];return _0x262bdd;};'use strict';var _=require(_0x1329('0x0'));var util=require(_0x1329('0x1'));var logger=require(_0x1329('0x2'))('api');var moment=require(_0x1329('0x3'));var BPromise=require(_0x1329('0x4'));var rp=require(_0x1329('0x5'));var fs=require('fs');var path=require(_0x1329('0x6'));var rimraf=require(_0x1329('0x7'));var config=require(_0x1329('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x556d3c,_0x44381f){return _0x556d3c[_0x1329('0x9')](_0x1329('0xa'),attributes,{'tableName':_0x1329('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1329('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ab6=['moment','bluebird','request-promise','path','rimraf','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api'];(function(_0x15a195,_0x469d82){var _0x1e9453=function(_0x4e0589){while(--_0x4e0589){_0x15a195['push'](_0x15a195['shift']());}};_0x1e9453(++_0x469d82);}(_0x8ab6,0x8c));var _0x68ab=function(_0x3a917a,_0x49f893){_0x3a917a=_0x3a917a-0x0;var _0x45a2c7=_0x8ab6[_0x3a917a];return _0x45a2c7;};'use strict';var _=require(_0x68ab('0x0'));var util=require(_0x68ab('0x1'));var logger=require(_0x68ab('0x2'))(_0x68ab('0x3'));var moment=require(_0x68ab('0x4'));var BPromise=require(_0x68ab('0x5'));var rp=require(_0x68ab('0x6'));var fs=require('fs');var path=require(_0x68ab('0x7'));var rimraf=require(_0x68ab('0x8'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x1f8b97,_0x19383b){return _0x1f8b97['define'](_0x68ab('0x9'),attributes,{'tableName':_0x68ab('0xa'),'paranoid':![],'indexes':[{'fields':[_0x68ab('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 f58f375..18a3c71 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 _0x6038=['then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','body','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6038,0xfc));var _0x8603=function(_0x1f26fe,_0xe0e914){_0x1f26fe=_0x1f26fe-0x0;var _0x4a73f6=_0x6038[_0x1f26fe];return _0x4a73f6;};'use strict';var _=require('lodash');var util=require(_0x8603('0x0'));var moment=require(_0x8603('0x1'));var BPromise=require(_0x8603('0x2'));var rs=require(_0x8603('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8603('0x4'))['db'];var utils=require(_0x8603('0x5'));var logger=require(_0x8603('0x6'))('rpc');var config=require(_0x8603('0x7'));var jayson=require(_0x8603('0x8'));var client=jayson[_0x8603('0x9')][_0x8603('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1127fa,_0x5d664a,_0x517c85){return new BPromise(function(_0x2cdb86,_0x2afbbb){return client[_0x8603('0xb')](_0x1127fa,_0x517c85)[_0x8603('0xc')](function(_0x161359){logger[_0x8603('0xd')](_0x8603('0xe'),_0x5d664a,'request\x20sent');logger[_0x8603('0xf')](_0x8603('0x10'),_0x5d664a,_0x8603('0x11'),JSON[_0x8603('0x12')](_0x161359));if(_0x161359[_0x8603('0x13')]){if(_0x161359['error'][_0x8603('0x14')]===0x1f4){logger[_0x8603('0x13')](_0x8603('0xe'),_0x5d664a,_0x161359[_0x8603('0x13')][_0x8603('0x15')]);return _0x2afbbb(_0x161359['error'][_0x8603('0x15')]);}logger[_0x8603('0x13')](_0x8603('0xe'),_0x5d664a,_0x161359['error'][_0x8603('0x15')]);return _0x2cdb86(_0x161359[_0x8603('0x13')][_0x8603('0x15')]);}else{logger['info'](_0x8603('0xe'),_0x5d664a,_0x8603('0x11'));_0x2cdb86(_0x161359[_0x8603('0x16')][_0x8603('0x15')]);}})[_0x8603('0x17')](function(_0x16cbde){logger[_0x8603('0x13')](_0x8603('0xe'),_0x5d664a,_0x16cbde);_0x2afbbb(_0x16cbde);});});}exports[_0x8603('0x18')]=function(_0x2c2610){var _0x503ce0=this;return new Promise(function(_0x4ab14f,_0x1e29d0){return db[_0x8603('0x19')][_0x8603('0x1a')](_0x2c2610['body'],{'raw':_0x2c2610['options']?_0x2c2610[_0x8603('0x1b')][_0x8603('0x1c')]===undefined?!![]:![]:!![]})[_0x8603('0xc')](function(_0x5919fe){logger[_0x8603('0xd')](_0x8603('0x18'),_0x2c2610);logger[_0x8603('0xf')](_0x8603('0x18'),_0x2c2610,JSON[_0x8603('0x12')](_0x5919fe));_0x4ab14f(_0x5919fe);})['catch'](function(_0x3ff34b){logger[_0x8603('0x13')](_0x8603('0x18'),_0x3ff34b[_0x8603('0x15')],_0x2c2610);_0x1e29d0(_0x503ce0['error'](0x1f4,_0x3ff34b['message']));});});};exports[_0x8603('0x1d')]=function(_0x4b2dc0){var _0x37989c=this;return new Promise(function(_0x1b033d,_0x1f8b55){return db[_0x8603('0x19')]['update'](_0x4b2dc0[_0x8603('0x1e')],{'raw':_0x4b2dc0[_0x8603('0x1b')]?_0x4b2dc0['options'][_0x8603('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b2dc0['options']?_0x4b2dc0['options']['where']||null:null,'attributes':_0x4b2dc0[_0x8603('0x1b')]?_0x4b2dc0[_0x8603('0x1b')][_0x8603('0x1f')]||null:null,'limit':_0x4b2dc0[_0x8603('0x1b')]?_0x4b2dc0[_0x8603('0x1b')][_0x8603('0x20')]||null:null})[_0x8603('0xc')](function(_0x41d10){logger[_0x8603('0xd')](_0x8603('0x1d'),_0x4b2dc0);logger[_0x8603('0xf')](_0x8603('0x1d'),_0x4b2dc0,JSON[_0x8603('0x12')](_0x41d10));_0x1b033d(_0x41d10);})[_0x8603('0x17')](function(_0x4c16e9){logger[_0x8603('0x13')](_0x8603('0x1d'),_0x4c16e9[_0x8603('0x15')],_0x4b2dc0);_0x1f8b55(_0x37989c[_0x8603('0x13')](0x1f4,_0x4c16e9[_0x8603('0x15')]));});});}; \ No newline at end of file +var _0xc94c=['lodash','util','moment','../../config/logger','../../config/environment','jayson/promise','client','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','UpdateVoiceDialReport','update','where','limit'];(function(_0x51015e,_0x54e9cf){var _0x35e769=function(_0x3642f7){while(--_0x3642f7){_0x51015e['push'](_0x51015e['shift']());}};_0x35e769(++_0x54e9cf);}(_0xc94c,0x188));var _0xcc94=function(_0x5b7877,_0x4763b2){_0x5b7877=_0x5b7877-0x0;var _0x59768f=_0xc94c[_0x5b7877];return _0x59768f;};'use strict';var _=require(_0xcc94('0x0'));var util=require(_0xcc94('0x1'));var moment=require(_0xcc94('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('../../config/utils');var logger=require(_0xcc94('0x3'))('rpc');var config=require(_0xcc94('0x4'));var jayson=require(_0xcc94('0x5'));var client=jayson[_0xcc94('0x6')][_0xcc94('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13b204,_0x575be4,_0x1aa933){return new BPromise(function(_0x37c959,_0x2ca6e7){return client['request'](_0x13b204,_0x1aa933)[_0xcc94('0x8')](function(_0x4f4eb2){logger['info'](_0xcc94('0x9'),_0x575be4,_0xcc94('0xa'));logger['debug'](_0xcc94('0xb'),_0x575be4,_0xcc94('0xa'),JSON[_0xcc94('0xc')](_0x4f4eb2));if(_0x4f4eb2[_0xcc94('0xd')]){if(_0x4f4eb2[_0xcc94('0xd')]['code']===0x1f4){logger['error'](_0xcc94('0x9'),_0x575be4,_0x4f4eb2[_0xcc94('0xd')][_0xcc94('0xe')]);return _0x2ca6e7(_0x4f4eb2[_0xcc94('0xd')][_0xcc94('0xe')]);}logger[_0xcc94('0xd')](_0xcc94('0x9'),_0x575be4,_0x4f4eb2['error'][_0xcc94('0xe')]);return _0x37c959(_0x4f4eb2['error'][_0xcc94('0xe')]);}else{logger[_0xcc94('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x575be4,_0xcc94('0xa'));_0x37c959(_0x4f4eb2['result'][_0xcc94('0xe')]);}})[_0xcc94('0x10')](function(_0x44bf4e){logger[_0xcc94('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x575be4,_0x44bf4e);_0x2ca6e7(_0x44bf4e);});});}exports[_0xcc94('0x11')]=function(_0x10d9a2){var _0x422492=this;return new Promise(function(_0x54cf89,_0xf0ba81){return db[_0xcc94('0x12')][_0xcc94('0x13')](_0x10d9a2[_0xcc94('0x14')],{'raw':_0x10d9a2[_0xcc94('0x15')]?_0x10d9a2[_0xcc94('0x15')][_0xcc94('0x16')]===undefined?!![]:![]:!![]})[_0xcc94('0x8')](function(_0x2bc9de){logger[_0xcc94('0xf')](_0xcc94('0x11'),_0x10d9a2);logger[_0xcc94('0x17')](_0xcc94('0x11'),_0x10d9a2,JSON[_0xcc94('0xc')](_0x2bc9de));_0x54cf89(_0x2bc9de);})[_0xcc94('0x10')](function(_0x1b22ae){logger[_0xcc94('0xd')](_0xcc94('0x11'),_0x1b22ae['message'],_0x10d9a2);_0xf0ba81(_0x422492['error'](0x1f4,_0x1b22ae[_0xcc94('0xe')]));});});};exports[_0xcc94('0x18')]=function(_0x2d1c34){var _0x449eef=this;return new Promise(function(_0x28d457,_0x5e844e){return db[_0xcc94('0x12')][_0xcc94('0x19')](_0x2d1c34[_0xcc94('0x14')],{'raw':_0x2d1c34[_0xcc94('0x15')]?_0x2d1c34[_0xcc94('0x15')][_0xcc94('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d1c34[_0xcc94('0x15')]?_0x2d1c34[_0xcc94('0x15')][_0xcc94('0x1a')]||null:null,'attributes':_0x2d1c34[_0xcc94('0x15')]?_0x2d1c34[_0xcc94('0x15')]['attributes']||null:null,'limit':_0x2d1c34['options']?_0x2d1c34[_0xcc94('0x15')][_0xcc94('0x1b')]||null:null})[_0xcc94('0x8')](function(_0x482110){logger[_0xcc94('0xf')]('UpdateVoiceDialReport',_0x2d1c34);logger['debug'](_0xcc94('0x18'),_0x2d1c34,JSON[_0xcc94('0xc')](_0x482110));_0x28d457(_0x482110);})['catch'](function(_0x3cf994){logger['error']('UpdateVoiceDialReport',_0x3cf994['message'],_0x2d1c34);_0x5e844e(_0x449eef['error'](0x1f4,_0x3cf994[_0xcc94('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 278b0a0..f96056e 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 _0x8fa8=['util','path','connect-timeout','Router','fs-extra','../../config/environment','./voiceExtension.controller','isAuthenticated','get','/:id','show','post','addApplications','put','destroy','multer'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x8fa8,0xef));var _0x88fa=function(_0x43f235,_0x4f58e6){_0x43f235=_0x43f235-0x0;var _0x299390=_0x8fa8[_0x43f235];return _0x299390;};'use strict';var multer=require(_0x88fa('0x0'));var util=require(_0x88fa('0x1'));var path=require(_0x88fa('0x2'));var timeout=require(_0x88fa('0x3'));var express=require('express');var router=express[_0x88fa('0x4')]();var fs_extra=require(_0x88fa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x88fa('0x6'));var controller=require(_0x88fa('0x7'));router['get']('/',auth[_0x88fa('0x8')](),controller['index']);router[_0x88fa('0x9')](_0x88fa('0xa'),auth[_0x88fa('0x8')](),controller[_0x88fa('0xb')]);router[_0x88fa('0xc')]('/',auth[_0x88fa('0x8')](),controller['create']);router['post']('/:id/applications',auth[_0x88fa('0x8')](),controller[_0x88fa('0xd')]);router[_0x88fa('0xe')](_0x88fa('0xa'),auth[_0x88fa('0x8')](),controller['update']);router['delete'](_0x88fa('0xa'),auth['isAuthenticated'](),controller[_0x88fa('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9b3e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update'];(function(_0x35e858,_0x4c8b77){var _0x5623dd=function(_0x3f0ac5){while(--_0x3f0ac5){_0x35e858['push'](_0x35e858['shift']());}};_0x5623dd(++_0x4c8b77);}(_0x9b3e,0x18a));var _0xe9b3=function(_0x561fef,_0x382ada){_0x561fef=_0x561fef-0x0;var _0xaff78b=_0x9b3e[_0x561fef];return _0xaff78b;};'use strict';var multer=require(_0xe9b3('0x0'));var util=require(_0xe9b3('0x1'));var path=require(_0xe9b3('0x2'));var timeout=require(_0xe9b3('0x3'));var express=require(_0xe9b3('0x4'));var router=express[_0xe9b3('0x5')]();var fs_extra=require(_0xe9b3('0x6'));var auth=require(_0xe9b3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe9b3('0x8'));router[_0xe9b3('0x9')]('/',auth[_0xe9b3('0xa')](),controller[_0xe9b3('0xb')]);router['get'](_0xe9b3('0xc'),auth[_0xe9b3('0xa')](),controller[_0xe9b3('0xd')]);router[_0xe9b3('0xe')]('/',auth[_0xe9b3('0xa')](),controller[_0xe9b3('0xf')]);router[_0xe9b3('0xe')](_0xe9b3('0x10'),auth[_0xe9b3('0xa')](),controller[_0xe9b3('0x11')]);router[_0xe9b3('0x12')](_0xe9b3('0xc'),auth[_0xe9b3('0xa')](),controller[_0xe9b3('0x13')]);router[_0xe9b3('0x14')](_0xe9b3('0xc'),auth[_0xe9b3('0xa')](),controller[_0xe9b3('0x15')]);module[_0xe9b3('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 56d5811..b6aa3cb 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 _0xd648=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports'];(function(_0x351cbd,_0x11342b){var _0x164e92=function(_0x559443){while(--_0x559443){_0x351cbd['push'](_0x351cbd['shift']());}};_0x164e92(++_0x11342b);}(_0xd648,0x9e));var _0x8d64=function(_0x4c0a7a,_0xc8e1ac){_0x4c0a7a=_0x4c0a7a-0x0;var _0xe258c8=_0xd648[_0x4c0a7a];return _0xe258c8;};'use strict';var Sequelize=require(_0x8d64('0x0'));module[_0x8d64('0x1')]={'context':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'unique':_0x8d64('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8d64('0x3')},'priority':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x8d64('0x3')},'tag':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8d64('0x4')},'appdata':{'type':Sequelize[_0x8d64('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8d64('0x5')](_0x8d64('0x6'),_0x8d64('0x7'),_0x8d64('0x8'),'inbound-fax',_0x8d64('0x9'),'system',_0x8d64('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x8d64('0x2')]},'interval':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x8d64('0xb')]},'isApp':{'type':Sequelize[_0x8d64('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8d64('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x8d64('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x8d64('0xb')]},'recordingFormat':{'type':Sequelize[_0x8d64('0x2')],'defaultValue':_0x8d64('0xd')},'answer':{'type':Sequelize[_0x8d64('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x8d64('0xe')],'get':function(_0x3d53b3){return this['getDataValue'](_0x8d64('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x015c=['getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x015c,0x9a));var _0xc015=function(_0x16fd26,_0x36b3d5){_0x16fd26=_0x16fd26-0x0;var _0x1f7542=_0x015c[_0x16fd26];return _0x1f7542;};'use strict';var Sequelize=require(_0xc015('0x0'));module[_0xc015('0x1')]={'context':{'type':Sequelize[_0xc015('0x2')],'allowNull':![],'unique':_0xc015('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xc015('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xc015('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc015('0x2')],'allowNull':![],'defaultValue':_0xc015('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc015('0x5')](_0xc015('0x6'),'outbound',_0xc015('0x7'),_0xc015('0x8'),_0xc015('0x9'),_0xc015('0xa'),_0xc015('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xc015('0x2')]},'interval':{'type':Sequelize[_0xc015('0x2')],'allowNull':![],'defaultValue':_0xc015('0xc')},'IntervalId':{'type':Sequelize[_0xc015('0xd')]},'isApp':{'type':Sequelize[_0xc015('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc015('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc015('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc015('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc015('0xd')]},'recordingFormat':{'type':Sequelize[_0xc015('0x2')],'defaultValue':_0xc015('0xf')},'answer':{'type':Sequelize[_0xc015('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f4fce){return this[_0xc015('0x10')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 2d5646e..51d4d1b 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 _0x28e2=['redis','defaults','register','sendStatus','end','status','json','undefined','limit','count','offset','set','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','then','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','options','body','startsWith','exten','concat','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x3576e9,_0x1c581b){var _0x5c959d=function(_0x7a72d6){while(--_0x7a72d6){_0x3576e9['push'](_0x3576e9['shift']());}};_0x5c959d(++_0x1c581b);}(_0x28e2,0x10e));var _0x228e=function(_0x9bf4c,_0x8deb29){_0x9bf4c=_0x9bf4c-0x0;var _0x3d5b2f=_0x28e2[_0x9bf4c];return _0x3d5b2f;};'use strict';var _=require(_0x228e('0x0'));var Redis=require(_0x228e('0x1'));var qs=require(_0x228e('0x2'));var logger=require(_0x228e('0x3'))('api');var config=require(_0x228e('0x4'));var db=require(_0x228e('0x5'))['db'];config[_0x228e('0x6')]=_[_0x228e('0x7')](config[_0x228e('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x228e('0x6')]));require('./voiceExtension.socket')[_0x228e('0x8')](socket);function respondWithStatusCode(_0xcca7b1,_0x2c9818){_0x2c9818=_0x2c9818||0xcc;return function(_0xd3bcf6){if(_0xd3bcf6){return _0xcca7b1[_0x228e('0x9')](_0x2c9818);}return _0xcca7b1['status'](_0x2c9818)[_0x228e('0xa')]();};}function respondWithResult(_0x36d7d,_0x2018cb){_0x2018cb=_0x2018cb||0xc8;return function(_0x3b4e14){if(_0x3b4e14){return _0x36d7d[_0x228e('0xb')](_0x2018cb)[_0x228e('0xc')](_0x3b4e14);}};}function respondWithFilteredResult(_0x5b70a6,_0x5b0535){return function(_0x53a5a9){if(_0x53a5a9){var _0x1d05db=typeof _0x5b0535['offset']===_0x228e('0xd')&&typeof _0x5b0535[_0x228e('0xe')]===_0x228e('0xd');var _0x2a9ffa=_0x53a5a9['count'];var _0x5f0d74=_0x1d05db?0x0:_0x5b0535['offset'];var _0x207cff=_0x1d05db?_0x53a5a9[_0x228e('0xf')]:_0x5b0535[_0x228e('0x10')]+_0x5b0535[_0x228e('0xe')];var _0x320009;if(_0x207cff>=_0x2a9ffa){_0x207cff=_0x2a9ffa;_0x320009=0xc8;}else{_0x320009=0xce;}_0x5b70a6['status'](_0x320009);return _0x5b70a6[_0x228e('0x11')]('Content-Range',_0x5f0d74+'-'+_0x207cff+'/'+_0x2a9ffa)['json'](_0x53a5a9);}return null;};}function removeEntity(_0x194cf3){return function(_0x403b13){if(_0x403b13){return _0x403b13[_0x228e('0x12')]()['then'](function(){var _0x4162ff=_0x403b13[_0x228e('0x13')]({'plain':!![]});var _0x433912=[{'name':_0x228e('0x14'),'value':_0x228e('0x15'),'ignore':![]},{'name':_0x228e('0x16'),'value':_0x228e('0x17'),'ignore':![]},{'name':_0x228e('0x18'),'value':_0x228e('0x19'),'ignore':![]}];var _0x5e0ae0=_(_0x433912)[_0x228e('0x1a')](_0x228e('0x1b'))[_0x228e('0x1c')](_0x228e('0x1d'))[_0x228e('0x1d')]();if(_[_0x228e('0x1e')](_0x5e0ae0,_0x4162ff[_0x228e('0x1f')])){return;}var _0x3bdb87=_[_0x228e('0x20')](_0x433912,['value',_0x4162ff['type']])['name'];return db[_0x228e('0x21')][_0x228e('0x12')]({'where':{'type':_0x3bdb87,'resourceId':_0x4162ff['id']}})[_0x228e('0x22')](function(){return _0x403b13;});})[_0x228e('0x22')](function(){_0x194cf3[_0x228e('0xb')](0xcc)[_0x228e('0xa')]();});}};}function handleEntityNotFound(_0x385ea7){return function(_0x597003){if(!_0x597003){_0x385ea7['sendStatus'](0x194);}return _0x597003;};}function handleError(_0x29f0c1,_0x4e99ae){_0x4e99ae=_0x4e99ae||0x1f4;return function(_0x217cad){logger['error'](_0x217cad[_0x228e('0x23')]);if(_0x217cad['name']){delete _0x217cad[_0x228e('0x24')];}_0x29f0c1[_0x228e('0xb')](_0x4e99ae)[_0x228e('0x25')](_0x217cad);};}exports[_0x228e('0x26')]=function(_0x254fc8,_0x3e9534){var _0x2c3425={},_0x27b3ce={},_0xd24eeb={'count':0x0,'rows':[]};var _0x54d8f5=_[_0x228e('0x1c')](db[_0x228e('0x27')][_0x228e('0x28')],function(_0x515170){return{'name':_0x515170[_0x228e('0x29')],'type':_0x515170['type']['key']};});_0x27b3ce[_0x228e('0x2a')]=_[_0x228e('0x1c')](_0x54d8f5,_0x228e('0x24'));_0x27b3ce[_0x228e('0x2b')]=_['keys'](_0x254fc8[_0x228e('0x2b')]);_0x27b3ce[_0x228e('0x2c')]=_[_0x228e('0x2d')](_0x27b3ce[_0x228e('0x2a')],_0x27b3ce['query']);_0x2c3425['attributes']=_[_0x228e('0x2d')](_0x27b3ce[_0x228e('0x2a')],qs[_0x228e('0x2e')](_0x254fc8[_0x228e('0x2b')][_0x228e('0x2e')]));_0x2c3425[_0x228e('0x2f')]=_0x2c3425[_0x228e('0x2f')][_0x228e('0x30')]?_0x2c3425[_0x228e('0x2f')]:_0x27b3ce['model'];if(!_0x254fc8[_0x228e('0x2b')]['hasOwnProperty']('nolimit')){_0x2c3425[_0x228e('0xe')]=qs[_0x228e('0xe')](_0x254fc8['query'][_0x228e('0xe')]);_0x2c3425['offset']=qs[_0x228e('0x10')](_0x254fc8['query'][_0x228e('0x10')]);}_0x2c3425['order']=qs['sort'](_0x254fc8[_0x228e('0x2b')][_0x228e('0x31')]);_0x2c3425[_0x228e('0x32')]=qs[_0x228e('0x2c')](_['pick'](_0x254fc8[_0x228e('0x2b')],_0x27b3ce['filters']),_0x54d8f5);if(_0x254fc8[_0x228e('0x2b')][_0x228e('0x1a')]){_0x2c3425['where']=_['merge'](_0x2c3425['where'],{'$or':_[_0x228e('0x1c')](_0x54d8f5,function(_0x254e04){if(_0x254e04[_0x228e('0x1f')]!==_0x228e('0x33')){var _0x5b11ca={};_0x5b11ca[_0x254e04[_0x228e('0x24')]]={'$like':'%'+_0x254fc8[_0x228e('0x2b')][_0x228e('0x1a')]+'%'};return _0x5b11ca;}})});}_0x2c3425=_[_0x228e('0x34')]({},_0x2c3425,_0x254fc8['options']);var _0x461cd5={'where':_0x2c3425[_0x228e('0x32')]};return db['VoiceExtension'][_0x228e('0xf')](_0x461cd5)[_0x228e('0x22')](function(_0x2f312c){_0xd24eeb[_0x228e('0xf')]=_0x2f312c;if(_0x254fc8[_0x228e('0x2b')][_0x228e('0x35')]){_0x2c3425[_0x228e('0x36')]=[{'all':!![]}];}return db[_0x228e('0x27')][_0x228e('0x37')](_0x2c3425);})[_0x228e('0x22')](function(_0x5b7f80){_0xd24eeb[_0x228e('0x38')]=_0x5b7f80;return _0xd24eeb;})[_0x228e('0x22')](respondWithFilteredResult(_0x3e9534,_0x2c3425))[_0x228e('0x39')](handleError(_0x3e9534,null));};exports['show']=function(_0x55df2f,_0x209b78){var _0x445982={'raw':![],'where':{'id':_0x55df2f[_0x228e('0x3a')]['id']}},_0x3fb029={};_0x3fb029[_0x228e('0x2a')]=_['keys'](db[_0x228e('0x27')][_0x228e('0x28')]);_0x3fb029[_0x228e('0x2b')]=_[_0x228e('0x3b')](_0x55df2f[_0x228e('0x2b')]);_0x3fb029[_0x228e('0x2c')]=_[_0x228e('0x2d')](_0x3fb029[_0x228e('0x2a')],_0x3fb029[_0x228e('0x2b')]);_0x445982[_0x228e('0x2f')]=_[_0x228e('0x2d')](_0x3fb029[_0x228e('0x2a')],qs['fields'](_0x55df2f[_0x228e('0x2b')][_0x228e('0x2e')]));_0x445982[_0x228e('0x2f')]=_0x445982['attributes'][_0x228e('0x30')]?_0x445982['attributes']:_0x3fb029[_0x228e('0x2a')];if(_0x55df2f['query'][_0x228e('0x35')]){_0x445982[_0x228e('0x36')]=[{'all':!![]}];}_0x445982=_[_0x228e('0x34')]({},_0x445982,_0x55df2f[_0x228e('0x3c')]);return db[_0x228e('0x27')][_0x228e('0x20')](_0x445982)['then'](handleEntityNotFound(_0x209b78,null))[_0x228e('0x22')](respondWithResult(_0x209b78,null))[_0x228e('0x39')](handleError(_0x209b78,null));};exports[_0x228e('0x12')]=function(_0x146548,_0x434a17){return db[_0x228e('0x27')][_0x228e('0x20')]({'where':{'id':_0x146548[_0x228e('0x3a')]['id']}})[_0x228e('0x22')](handleEntityNotFound(_0x434a17,null))[_0x228e('0x22')](removeEntity(_0x434a17,null))[_0x228e('0x39')](handleError(_0x434a17,null));};exports['create']=function(_0x1b5d38,_0x2ff9e8){if(_0x1b5d38[_0x228e('0x3d')][_0x228e('0x1f')]===_0x228e('0x17')&&!_[_0x228e('0x3e')](_0x1b5d38[_0x228e('0x3d')]['exten'],'_')){_0x1b5d38['body'][_0x228e('0x3f')]='_'[_0x228e('0x40')](_0x1b5d38['body'][_0x228e('0x3f')]);}return db['VoiceExtension'][_0x228e('0x41')](_0x1b5d38[_0x228e('0x3d')],{'raw':![]})[_0x228e('0x22')](function(_0x56db6c){var _0x4444af=_0x1b5d38['user'][_0x228e('0x13')]({'plain':!![]});if(!_0x4444af)throw new Error(_0x228e('0x42'));if(_0x4444af[_0x228e('0x43')]===_0x228e('0x44')){var _0x3c62c0=_0x56db6c[_0x228e('0x13')]({'plain':!![]});var _0x4bbed7=[{'name':_0x228e('0x14'),'value':'inbound'},{'name':'OutboundRoutes','value':_0x228e('0x17')},{'name':'InternalRoutes','value':_0x228e('0x19')}];var _0x1e71fd=_['find'](_0x4bbed7,[_0x228e('0x1d'),_0x3c62c0['type']])['name'];return db[_0x228e('0x45')][_0x228e('0x20')]({'where':{'name':_0x1e71fd,'userProfileId':_0x4444af[_0x228e('0x46')]},'raw':!![]})[_0x228e('0x22')](function(_0x35a089){if(_0x35a089&&_0x35a089[_0x228e('0x47')]===0x0){return db['UserProfileResource'][_0x228e('0x41')]({'name':_0x3c62c0[_0x228e('0x24')],'resourceId':_0x3c62c0['id'],'type':_0x35a089['name'],'sectionId':_0x35a089['id']},{})[_0x228e('0x22')](function(){return _0x56db6c;});}else{return _0x56db6c;}})[_0x228e('0x39')](function(_0xd31caa){logger[_0x228e('0x48')](_0x228e('0x49'),_0xd31caa);throw _0xd31caa;});}return _0x56db6c;})[_0x228e('0x22')](respondWithResult(_0x2ff9e8,0xc9))[_0x228e('0x39')](handleError(_0x2ff9e8,null));};exports[_0x228e('0x4a')]=function(_0x268f28,_0x5ee1c9){if(_0x268f28['body']['id']){delete _0x268f28[_0x228e('0x3d')]['id'];}return db[_0x228e('0x27')][_0x228e('0x20')]({'where':{'id':_0x268f28['params']['id']}})[_0x228e('0x22')](handleEntityNotFound(_0x5ee1c9,null))[_0x228e('0x22')](function(_0x2c48cc){if(_0x2c48cc){return db[_0x228e('0x27')][_0x228e('0x4a')](_['pick'](_0x268f28['body'],[_0x228e('0x3f'),_0x228e('0x4b'),_0x228e('0x4c'),'recordingFormat','cutdigits',_0x228e('0x4d'),_0x228e('0x4e')]),{'where':{'context':_0x2c48cc[_0x228e('0x4b')],'exten':_0x2c48cc[_0x228e('0x3f')]},'individualHooks':!![]})['then'](function(_0x81c459){return _0x81c459;});}return null;})['then'](respondWithStatusCode(_0x5ee1c9,null))[_0x228e('0x39')](handleError(_0x5ee1c9,null));};exports[_0x228e('0x4f')]=function(_0x57649b,_0x505921){var _0x3addd6=_0x57649b[_0x228e('0x3a')]['id'];var _0x25ffe4=_0x57649b[_0x228e('0x3d')];var _0x166c00=0xc8;var _0x541c6f=null;return db[_0x228e('0x50')][_0x228e('0x51')]({'isolationLevel':db['sequelize'][_0x228e('0x52')]['ISOLATION_LEVELS'][_0x228e('0x53')]},function(_0x22952e){return db['VoiceExtension'][_0x228e('0x54')]({'where':{'id':_0x3addd6},'transaction':_0x22952e})[_0x228e('0x22')](function(_0x1be6bc){if(_0x1be6bc){return db[_0x228e('0x27')]['destroy']({'where':{'VoiceExtensionId':_0x3addd6},'transaction':_0x22952e})['then'](function(){var _0x34dbd2=_[_0x228e('0x1c')](_0x25ffe4,function(_0xca0592){_0xca0592[_0x228e('0x55')]=_0x3addd6;_0xca0592[_0x228e('0x56')]=!![];return _0xca0592;});return _0x1be6bc[_0x228e('0x57')](_0x34dbd2);})[_0x228e('0x22')](function(_0x1bc87b){return db[_0x228e('0x27')][_0x228e('0x58')](_0x1bc87b,{'transaction':_0x22952e});});}else{_0x166c00=0x194;_0x541c6f=[];}});})['then'](function(){if(_0x166c00!==0x194){return db[_0x228e('0x27')][_0x228e('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3addd6},'order':_0x228e('0x5a')})[_0x228e('0x22')](function(_0x2a8abb){_0x541c6f=_0x2a8abb;});}})[_0x228e('0x39')](function(_0x5597d2){_0x166c00=0x1f4;logger[_0x228e('0x48')](_0x5597d2[_0x228e('0x23')]);if(_0x5597d2[_0x228e('0x24')]){delete _0x5597d2[_0x228e('0x24')];}_0x541c6f=_0x5597d2;})[_0x228e('0x5b')](function(){if(_0x541c6f===null){_0x505921[_0x228e('0x9')](_0x166c00);}else{if(_0x166c00===0x1f4){_0x505921[_0x228e('0xb')](_0x166c00)[_0x228e('0x25')](_0x541c6f);}else{_0x505921[_0x228e('0xb')](_0x166c00)['json'](_0x541c6f);}}});}; \ No newline at end of file +var _0xb013=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','mandatoryDisposition','alias','transaction','sequelize','Transaction','ISOLATION_LEVELS','isApp','createRouting','bulkCreate','findAndCountAll','stack','send','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','value','includes','find','type','UserProfileResource','destroy','error','name','index','map','fieldName','key','model','query','filters','attributes','intersection','fields','sort','where','merge','options','count','includeAll','include','VoiceExtension','findAll','rows','catch','params','rawAttributes','keys','create','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','userProfileId'];(function(_0x58d1ab,_0x15e7cf){var _0x118f0e=function(_0x4c478f){while(--_0x4c478f){_0x58d1ab['push'](_0x58d1ab['shift']());}};_0x118f0e(++_0x15e7cf);}(_0xb013,0x113));var _0x3b01=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xb013[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x3b01('0x0'));var Redis=require('ioredis');var qs=require(_0x3b01('0x1'));var logger=require(_0x3b01('0x2'))('api');var config=require(_0x3b01('0x3'));var db=require(_0x3b01('0x4'))['db'];config[_0x3b01('0x5')]=_[_0x3b01('0x6')](config[_0x3b01('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b01('0x7'))(new Redis(config[_0x3b01('0x5')]));require(_0x3b01('0x8'))[_0x3b01('0x9')](socket);function respondWithStatusCode(_0x22a034,_0x3182e8){_0x3182e8=_0x3182e8||0xcc;return function(_0x375256){if(_0x375256){return _0x22a034[_0x3b01('0xa')](_0x3182e8);}return _0x22a034[_0x3b01('0xb')](_0x3182e8)[_0x3b01('0xc')]();};}function respondWithResult(_0x1acd5a,_0x2e77bc){_0x2e77bc=_0x2e77bc||0xc8;return function(_0x46e5ee){if(_0x46e5ee){return _0x1acd5a[_0x3b01('0xb')](_0x2e77bc)[_0x3b01('0xd')](_0x46e5ee);}};}function respondWithFilteredResult(_0x362fff,_0x3ce0f3){return function(_0x2a4a53){if(_0x2a4a53){var _0x3496fb=typeof _0x3ce0f3['offset']===_0x3b01('0xe')&&typeof _0x3ce0f3[_0x3b01('0xf')]===_0x3b01('0xe');var _0x29fd9c=_0x2a4a53['count'];var _0x4435a4=_0x3496fb?0x0:_0x3ce0f3[_0x3b01('0x10')];var _0x53fa87=_0x3496fb?_0x2a4a53['count']:_0x3ce0f3[_0x3b01('0x10')]+_0x3ce0f3[_0x3b01('0xf')];var _0x4afcb6;if(_0x53fa87>=_0x29fd9c){_0x53fa87=_0x29fd9c;_0x4afcb6=0xc8;}else{_0x4afcb6=0xce;}_0x362fff['status'](_0x4afcb6);return _0x362fff[_0x3b01('0x11')](_0x3b01('0x12'),_0x4435a4+'-'+_0x53fa87+'/'+_0x29fd9c)[_0x3b01('0xd')](_0x2a4a53);}return null;};}function removeEntity(_0x154313){return function(_0x2c019a){if(_0x2c019a){return _0x2c019a['destroy']()[_0x3b01('0x13')](function(){var _0x49f835=_0x2c019a[_0x3b01('0x14')]({'plain':!![]});var _0x42777e=[{'name':_0x3b01('0x15'),'value':_0x3b01('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0x3b01('0x17'),'ignore':![]},{'name':_0x3b01('0x18'),'value':_0x3b01('0x19'),'ignore':![]}];var _0x290869=_(_0x42777e)[_0x3b01('0x1a')](_0x3b01('0x1b'))['map'](_0x3b01('0x1c'))[_0x3b01('0x1c')]();if(_[_0x3b01('0x1d')](_0x290869,_0x49f835['type'])){return;}var _0xd68878=_[_0x3b01('0x1e')](_0x42777e,[_0x3b01('0x1c'),_0x49f835[_0x3b01('0x1f')]])['name'];return db[_0x3b01('0x20')][_0x3b01('0x21')]({'where':{'type':_0xd68878,'resourceId':_0x49f835['id']}})[_0x3b01('0x13')](function(){return _0x2c019a;});})[_0x3b01('0x13')](function(){_0x154313[_0x3b01('0xb')](0xcc)[_0x3b01('0xc')]();});}};}function handleEntityNotFound(_0x2f4370){return function(_0x23a773){if(!_0x23a773){_0x2f4370[_0x3b01('0xa')](0x194);}return _0x23a773;};}function handleError(_0x22f651,_0x3d676b){_0x3d676b=_0x3d676b||0x1f4;return function(_0x195745){logger[_0x3b01('0x22')](_0x195745['stack']);if(_0x195745[_0x3b01('0x23')]){delete _0x195745[_0x3b01('0x23')];}_0x22f651[_0x3b01('0xb')](_0x3d676b)['send'](_0x195745);};}exports[_0x3b01('0x24')]=function(_0x5b25d2,_0x24da38){var _0xd89e75={},_0x58fb61={},_0xcbed1e={'count':0x0,'rows':[]};var _0x45b3ff=_[_0x3b01('0x25')](db['VoiceExtension']['rawAttributes'],function(_0x494b89){return{'name':_0x494b89[_0x3b01('0x26')],'type':_0x494b89[_0x3b01('0x1f')][_0x3b01('0x27')]};});_0x58fb61[_0x3b01('0x28')]=_[_0x3b01('0x25')](_0x45b3ff,'name');_0x58fb61[_0x3b01('0x29')]=_['keys'](_0x5b25d2['query']);_0x58fb61[_0x3b01('0x2a')]=_['intersection'](_0x58fb61[_0x3b01('0x28')],_0x58fb61[_0x3b01('0x29')]);_0xd89e75[_0x3b01('0x2b')]=_[_0x3b01('0x2c')](_0x58fb61[_0x3b01('0x28')],qs[_0x3b01('0x2d')](_0x5b25d2[_0x3b01('0x29')][_0x3b01('0x2d')]));_0xd89e75[_0x3b01('0x2b')]=_0xd89e75[_0x3b01('0x2b')]['length']?_0xd89e75[_0x3b01('0x2b')]:_0x58fb61[_0x3b01('0x28')];if(!_0x5b25d2['query']['hasOwnProperty']('nolimit')){_0xd89e75[_0x3b01('0xf')]=qs['limit'](_0x5b25d2[_0x3b01('0x29')]['limit']);_0xd89e75[_0x3b01('0x10')]=qs[_0x3b01('0x10')](_0x5b25d2['query'][_0x3b01('0x10')]);}_0xd89e75['order']=qs[_0x3b01('0x2e')](_0x5b25d2['query'][_0x3b01('0x2e')]);_0xd89e75[_0x3b01('0x2f')]=qs[_0x3b01('0x2a')](_['pick'](_0x5b25d2[_0x3b01('0x29')],_0x58fb61['filters']),_0x45b3ff);if(_0x5b25d2[_0x3b01('0x29')][_0x3b01('0x1a')]){_0xd89e75[_0x3b01('0x2f')]=_[_0x3b01('0x30')](_0xd89e75['where'],{'$or':_['map'](_0x45b3ff,function(_0x203779){if(_0x203779[_0x3b01('0x1f')]!=='VIRTUAL'){var _0x1ea99a={};_0x1ea99a[_0x203779[_0x3b01('0x23')]]={'$like':'%'+_0x5b25d2[_0x3b01('0x29')][_0x3b01('0x1a')]+'%'};return _0x1ea99a;}})});}_0xd89e75=_['merge']({},_0xd89e75,_0x5b25d2[_0x3b01('0x31')]);var _0x272b37={'where':_0xd89e75[_0x3b01('0x2f')]};return db['VoiceExtension'][_0x3b01('0x32')](_0x272b37)[_0x3b01('0x13')](function(_0x143ec8){_0xcbed1e[_0x3b01('0x32')]=_0x143ec8;if(_0x5b25d2[_0x3b01('0x29')][_0x3b01('0x33')]){_0xd89e75[_0x3b01('0x34')]=[{'all':!![]}];}return db[_0x3b01('0x35')][_0x3b01('0x36')](_0xd89e75);})[_0x3b01('0x13')](function(_0x7eb541){_0xcbed1e[_0x3b01('0x37')]=_0x7eb541;return _0xcbed1e;})[_0x3b01('0x13')](respondWithFilteredResult(_0x24da38,_0xd89e75))[_0x3b01('0x38')](handleError(_0x24da38,null));};exports['show']=function(_0x3da281,_0x549340){var _0x5efdc5={'raw':![],'where':{'id':_0x3da281[_0x3b01('0x39')]['id']}},_0x7e65b5={};_0x7e65b5[_0x3b01('0x28')]=_['keys'](db[_0x3b01('0x35')][_0x3b01('0x3a')]);_0x7e65b5['query']=_[_0x3b01('0x3b')](_0x3da281[_0x3b01('0x29')]);_0x7e65b5[_0x3b01('0x2a')]=_[_0x3b01('0x2c')](_0x7e65b5[_0x3b01('0x28')],_0x7e65b5[_0x3b01('0x29')]);_0x5efdc5[_0x3b01('0x2b')]=_[_0x3b01('0x2c')](_0x7e65b5[_0x3b01('0x28')],qs[_0x3b01('0x2d')](_0x3da281[_0x3b01('0x29')]['fields']));_0x5efdc5[_0x3b01('0x2b')]=_0x5efdc5[_0x3b01('0x2b')]['length']?_0x5efdc5[_0x3b01('0x2b')]:_0x7e65b5[_0x3b01('0x28')];if(_0x3da281[_0x3b01('0x29')][_0x3b01('0x33')]){_0x5efdc5['include']=[{'all':!![]}];}_0x5efdc5=_[_0x3b01('0x30')]({},_0x5efdc5,_0x3da281[_0x3b01('0x31')]);return db[_0x3b01('0x35')][_0x3b01('0x1e')](_0x5efdc5)[_0x3b01('0x13')](handleEntityNotFound(_0x549340,null))[_0x3b01('0x13')](respondWithResult(_0x549340,null))[_0x3b01('0x38')](handleError(_0x549340,null));};exports[_0x3b01('0x21')]=function(_0x2b69fc,_0x3213a7){return db['VoiceExtension'][_0x3b01('0x1e')]({'where':{'id':_0x2b69fc[_0x3b01('0x39')]['id']}})[_0x3b01('0x13')](handleEntityNotFound(_0x3213a7,null))[_0x3b01('0x13')](removeEntity(_0x3213a7,null))[_0x3b01('0x38')](handleError(_0x3213a7,null));};exports[_0x3b01('0x3c')]=function(_0x23b41c,_0x3c0885){if(_0x23b41c[_0x3b01('0x3d')][_0x3b01('0x1f')]==='outbound'&&!_['startsWith'](_0x23b41c[_0x3b01('0x3d')][_0x3b01('0x3e')],'_')){_0x23b41c[_0x3b01('0x3d')][_0x3b01('0x3e')]='_'['concat'](_0x23b41c[_0x3b01('0x3d')][_0x3b01('0x3e')]);}return db[_0x3b01('0x35')]['create'](_0x23b41c[_0x3b01('0x3d')],{'raw':![]})[_0x3b01('0x13')](function(_0x30183c){var _0x3ecefb=_0x23b41c[_0x3b01('0x3f')]['get']({'plain':!![]});if(!_0x3ecefb)throw new Error(_0x3b01('0x40'));if(_0x3ecefb[_0x3b01('0x41')]===_0x3b01('0x3f')){var _0x5cda4a=_0x30183c['get']({'plain':!![]});var _0x2e5fe6=[{'name':_0x3b01('0x15'),'value':_0x3b01('0x16')},{'name':_0x3b01('0x42'),'value':_0x3b01('0x17')},{'name':'InternalRoutes','value':'internal'}];var _0x2da043=_[_0x3b01('0x1e')](_0x2e5fe6,[_0x3b01('0x1c'),_0x5cda4a[_0x3b01('0x1f')]])['name'];return db[_0x3b01('0x43')][_0x3b01('0x1e')]({'where':{'name':_0x2da043,'userProfileId':_0x3ecefb[_0x3b01('0x44')]},'raw':!![]})[_0x3b01('0x13')](function(_0x94229b){if(_0x94229b&&_0x94229b[_0x3b01('0x45')]===0x0){return db['UserProfileResource'][_0x3b01('0x3c')]({'name':_0x5cda4a['name'],'resourceId':_0x5cda4a['id'],'type':_0x94229b[_0x3b01('0x23')],'sectionId':_0x94229b['id']},{})['then'](function(){return _0x30183c;});}else{return _0x30183c;}})[_0x3b01('0x38')](function(_0x206200){logger[_0x3b01('0x22')](_0x3b01('0x46'),_0x206200);throw _0x206200;});}return _0x30183c;})[_0x3b01('0x13')](respondWithResult(_0x3c0885,0xc9))[_0x3b01('0x38')](handleError(_0x3c0885,null));};exports[_0x3b01('0x47')]=function(_0x1502dc,_0x5c8208){if(_0x1502dc[_0x3b01('0x3d')]['id']){delete _0x1502dc['body']['id'];}return db['VoiceExtension'][_0x3b01('0x1e')]({'where':{'id':_0x1502dc['params']['id']}})[_0x3b01('0x13')](handleEntityNotFound(_0x5c8208,null))['then'](function(_0x1d0635){if(_0x1d0635){return db['VoiceExtension'][_0x3b01('0x47')](_['pick'](_0x1502dc[_0x3b01('0x3d')],[_0x3b01('0x3e'),_0x3b01('0x48'),_0x3b01('0x49'),'recordingFormat','cutdigits',_0x3b01('0x4a'),_0x3b01('0x4b')]),{'where':{'context':_0x1d0635['context'],'exten':_0x1d0635[_0x3b01('0x3e')]},'individualHooks':!![]})[_0x3b01('0x13')](function(_0x48e9bd){return _0x48e9bd;});}return null;})['then'](respondWithStatusCode(_0x5c8208,null))[_0x3b01('0x38')](handleError(_0x5c8208,null));};exports['addApplications']=function(_0x556cc7,_0x368300){var _0x16d038=_0x556cc7[_0x3b01('0x39')]['id'];var _0x2f8bde=_0x556cc7['body'];var _0x329ea3=0xc8;var _0x4ada73=null;return db['sequelize'][_0x3b01('0x4c')]({'isolationLevel':db[_0x3b01('0x4d')][_0x3b01('0x4e')][_0x3b01('0x4f')]['READ_COMMITTED']},function(_0x489981){return db['VoiceExtension']['findOne']({'where':{'id':_0x16d038},'transaction':_0x489981})[_0x3b01('0x13')](function(_0x1c786c){if(_0x1c786c){return db[_0x3b01('0x35')]['destroy']({'where':{'VoiceExtensionId':_0x16d038},'transaction':_0x489981})[_0x3b01('0x13')](function(){var _0x2a7e58=_[_0x3b01('0x25')](_0x2f8bde,function(_0x29e395){_0x29e395['VoiceExtensionId']=_0x16d038;_0x29e395[_0x3b01('0x50')]=!![];return _0x29e395;});return _0x1c786c[_0x3b01('0x51')](_0x2a7e58);})['then'](function(_0x4a522f){return db[_0x3b01('0x35')][_0x3b01('0x52')](_0x4a522f,{'transaction':_0x489981});});}else{_0x329ea3=0x194;_0x4ada73=[];}});})[_0x3b01('0x13')](function(){if(_0x329ea3!==0x194){return db[_0x3b01('0x35')][_0x3b01('0x53')]({'where':{'isApp':!![],'VoiceExtensionId':_0x16d038},'order':'cast(priority\x20as\x20unsigned)'})[_0x3b01('0x13')](function(_0x36383f){_0x4ada73=_0x36383f;});}})[_0x3b01('0x38')](function(_0x2c3ba9){_0x329ea3=0x1f4;logger[_0x3b01('0x22')](_0x2c3ba9[_0x3b01('0x54')]);if(_0x2c3ba9[_0x3b01('0x23')]){delete _0x2c3ba9['name'];}_0x4ada73=_0x2c3ba9;})['finally'](function(){if(_0x4ada73===null){_0x368300[_0x3b01('0xa')](_0x329ea3);}else{if(_0x329ea3===0x1f4){_0x368300[_0x3b01('0xb')](_0x329ea3)[_0x3b01('0x55')](_0x4ada73);}else{_0x368300[_0x3b01('0xb')](_0x329ea3)[_0x3b01('0xd')](_0x4ada73);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index cafbc05..a4c61d4 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 _0x56dc=['../../mysqldb','VoiceExtension','update','emit','hasOwnProperty','hook','events'];(function(_0x5796d9,_0x2f67a6){var _0x430a31=function(_0x45d577){while(--_0x45d577){_0x5796d9['push'](_0x5796d9['shift']());}};_0x430a31(++_0x2f67a6);}(_0x56dc,0x1cd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc56d('0x0'));var VoiceExtension=require(_0xc56d('0x1'))['db'][_0xc56d('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc56d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3fce06){return function(_0x581280,_0xe14da3,_0xa90056){VoiceExtensionEvents[_0xc56d('0x4')](_0x3fce06+':'+_0x581280['id'],_0x581280);VoiceExtensionEvents[_0xc56d('0x4')](_0x3fce06,_0x581280);_0xa90056(null);};}for(var e in events){if(events[_0xc56d('0x5')](e)){var event=events[e];VoiceExtension[_0xc56d('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xab24=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab24,0xf5));var _0x4ab2=function(_0x1e7540,_0x9f8aef){_0x1e7540=_0x1e7540-0x0;var _0x33709b=_0xab24[_0x1e7540];return _0x33709b;};'use strict';var EventEmitter=require(_0x4ab2('0x0'));var VoiceExtension=require(_0x4ab2('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4ab2('0x2')](0x0);var events={'afterCreate':_0x4ab2('0x3'),'afterUpdate':_0x4ab2('0x4'),'afterDestroy':_0x4ab2('0x5')};function emitEvent(_0xda992f){return function(_0x11243d,_0x4ec424,_0x250aee){VoiceExtensionEvents[_0x4ab2('0x6')](_0xda992f+':'+_0x11243d['id'],_0x11243d);VoiceExtensionEvents[_0x4ab2('0x6')](_0xda992f,_0x11243d);_0x250aee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x4ab2('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 40a1536..33871a3 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 _0xf8de=['./voiceExtension.attributes','exports','type','Set','alias','CDR(routeAlias)=','No\x20alias\x20set','context','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','param','phone','prefix','${EXTEN:','recordingFormat','U(xcally-mixmonitor-context)','join','findAll','interval','IntervalId','intervals','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','concat','priority','define','VoiceExtension','voice_extensions','get','then','Hangup'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf8de,0x1d4));var _0xef8d=function(_0x92426b,_0x1c1a47){_0x92426b=_0x92426b-0x0;var _0x3896eb=_0xf8de[_0x92426b];return _0x3896eb;};'use strict';var _=require('lodash');var attributes=require(_0xef8d('0x0'));module[_0xef8d('0x1')]=function(_0x51c905){var _0x1b57df=_0x51c905['models'];function _0x3651ec(_0x1426a9){var _0x3cdc6d=0x2;var _0x58851e=[{'type':_0x1426a9[_0xef8d('0x2')],'app':_0xef8d('0x3'),'appdata':'CDR(type)='+_0x1426a9[_0xef8d('0x2')],'context':_0x1426a9['context'],'exten':_0x1426a9['exten'],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']},{'type':_0x1426a9[_0xef8d('0x2')],'app':_0x1426a9[_0xef8d('0x4')]?_0xef8d('0x3'):'NoOp','appdata':_0x1426a9['alias']?_0xef8d('0x5')+_0x1426a9[_0xef8d('0x4')]:_0xef8d('0x6'),'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']}];if(_0x1426a9[_0xef8d('0x2')]===_0xef8d('0x9')){_0x58851e[_0xef8d('0xa')]({'type':_0xef8d('0x9'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0xb')+_0x1426a9['id'],'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']});}_0x58851e[_0xef8d('0xa')]({'type':_0x1426a9[_0xef8d('0x2')],'app':_0xef8d('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1426a9['context'],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']},{'type':_0x1426a9['type'],'app':_0xef8d('0x3'),'appdata':_0xef8d('0xc'),'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']},{'type':_0x1426a9['type'],'app':'Set','appdata':_0xef8d('0xd'),'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']});return _0x58851e;}function _0x3311e5(_0x2315e5){var _0x595fe8=0x2;var _0x346f3b=[{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0xf'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':'outbound','app':_0x2315e5[_0xef8d('0x4')]?_0xef8d('0x3'):_0xef8d('0x10'),'appdata':_0x2315e5[_0xef8d('0x4')]?_0xef8d('0x5')+_0x2315e5['alias']:_0xef8d('0x6'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':'CDR(destination)='+(_0x2315e5[_0xef8d('0x11')]?'${EXTEN:'+_0x2315e5['cutdigits']+'}':_0xef8d('0x12')),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0xb')+_0x2315e5['id'],'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5['exten'],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':'ExecIf','appdata':_0xef8d('0x13')+(_0x595fe8+0x2)+_0xef8d('0x14')+(_0x595fe8+0x1)+')','context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0x2315e5[_0xef8d('0x11')]?'CDR(prefix)=${EXTEN:0:'+_0x2315e5[_0xef8d('0x11')]+'}':_0xef8d('0x15'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0x16'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':'Set','appdata':_0xef8d('0xc'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':'outbound','app':_0xef8d('0x3'),'appdata':_0xef8d('0x17')+_0x2315e5['id'],'context':_0x2315e5['context'],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']}];if(_0x2315e5[_0xef8d('0x18')]('recordingFormat')&&_0x2315e5['recordingFormat']!==_0xef8d('0x19')){_0x346f3b[_0xef8d('0xa')]({'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2315e5['context'],'exten':_0x2315e5['exten'],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':'Set','appdata':_0xef8d('0x1a')+_0x2315e5['recordingFormat']||_0xef8d('0x1b'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']});}return _0x346f3b;}function _0x37c108(_0x2b37b9,_0x55d441){var _0x246878=[{'name':_0xef8d('0x1c'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xef8d('0x1d'),'param':0x2},{'name':_0xef8d('0x1e'),'param':0x3}];var _0x13b05b={};var _0x326089=_0x55d441[_0xef8d('0x1f')](',');var _0x39b36a=[];for(var _0xc98f91=0x0;_0xc98f91<_0x246878[_0xef8d('0x20')];_0xc98f91++){switch(_0x246878[_0xc98f91][_0xef8d('0x21')]){case'trunk':_0x13b05b[_0xef8d('0x1c')]=_0x326089[_0x246878[_0xc98f91][_0xef8d('0x22')]][_0xef8d('0x1f')]('/')[0x1];_0x13b05b[_0xef8d('0x23')]=_0x326089[_0x246878[_0xc98f91][_0xef8d('0x22')]]['split']('/')[0x2];_0x13b05b[_0xef8d('0x24')]=_0x13b05b[_0xef8d('0x23')]?_0x13b05b[_0xef8d('0x23')][_0xef8d('0x1f')]('$')[0x0]:undefined;_0x13b05b[_0xef8d('0x23')]=_0x2b37b9[_0xef8d('0x11')]?(_0x13b05b[_0xef8d('0x24')]||'')+_0xef8d('0x25')+_0x2b37b9[_0xef8d('0x11')]+'}':(_0x13b05b[_0xef8d('0x24')]||'')+'${EXTEN}';_0x39b36a[_0x246878[_0xc98f91][_0xef8d('0x22')]]=['SIP',_0x13b05b[_0xef8d('0x1c')],_0x13b05b[_0xef8d('0x23')]]['join']('/');break;case'options':_0x13b05b[_0xef8d('0x1d')]=_0x326089[_0x246878[_0xc98f91][_0xef8d('0x22')]];if(_0x2b37b9[_0xef8d('0x26')]!=='none'){if(_0x13b05b[_0xef8d('0x1d')]['indexOf'](_0xef8d('0x27'))<0x0){_0x13b05b[_0xef8d('0x1d')]+=_0xef8d('0x27');}}else{_0x13b05b[_0xef8d('0x1d')]=_0x13b05b['options']['replace'](_0xef8d('0x27'),'');}_0x39b36a[_0x246878[_0xc98f91][_0xef8d('0x22')]]=_0x13b05b[_0xef8d('0x1d')];break;default:_0x39b36a[_0x246878[_0xc98f91][_0xef8d('0x22')]]=_0x326089[_0x246878[_0xc98f91]['param']];}}return _0x39b36a[_0xef8d('0x28')](',');}function _0x766c76(_0x5ae7fc,_0x273bc7,_0x5c2a69){return new Promise(function(_0x194fd7,_0x2acbb3){var _0x517316=[];if(_['isEmpty'](_0x273bc7))return _0x194fd7(_0x517316);_0x1b57df['Interval'][_0xef8d('0x29')]({'attributes':['id',_0xef8d('0x2a'),_0xef8d('0x2b')],'raw':!![]})['then'](function(_0x223005){for(var _0x1064d3=0x0,_0xf68025=0x0;_0x1064d3<_0x273bc7[_0xef8d('0x20')];_0x1064d3++,_0xf68025=0x0){var _0x1bdf3d=_0x273bc7[_0x1064d3];var _0x4e9a9d=[];var _0xd397d1=[];delete _0x1bdf3d['id'];if(_0x1bdf3d[_0xef8d('0x2a')]!=='*,*,*,*'){_0x1bdf3d['intervals']=[_0x1bdf3d[_0xef8d('0x2a')]];}else{_0x1bdf3d[_0xef8d('0x2c')]=_0x1bdf3d['IntervalId']?_[_0xef8d('0x2d')](_['filter'](_0x223005,{'IntervalId':_0x1bdf3d[_0xef8d('0x2b')]}),_0xef8d('0x2a')):[];}_0x1bdf3d[_0xef8d('0x7')]=_0x5ae7fc[_0xef8d('0x7')];_0x1bdf3d['exten']=_0x5ae7fc[_0xef8d('0x8')];if(_0x1bdf3d[_0xef8d('0x2')])_0x1bdf3d[_0xef8d('0x2')]=_0x1bdf3d[_0xef8d('0x2')]['toLowerCase']();if(_0x5ae7fc[_0xef8d('0x2')]===_0xef8d('0xe')){if(_0x1bdf3d[_0xef8d('0x18')]('tag')&&_0x1bdf3d[_0xef8d('0x2e')]&&_0x1bdf3d[_0xef8d('0x2e')]!=='--'){_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d['type'][_0xef8d('0x2f')](),'app':_0xef8d('0x3'),'appdata':_0xef8d('0x30')+_0x1bdf3d['tag'],'context':_0x5ae7fc['context'],'exten':_0x5ae7fc['exten'],'priority':_0x1bdf3d[_0xef8d('0x2c')]['length']+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d['type'][_0xef8d('0x2f')](),'app':'ExecIf','appdata':_0xef8d('0x31')+(_0x1bdf3d[_0xef8d('0x32')]?_0xef8d('0x33')+_0x1bdf3d['callerID']+')':_0xef8d('0x34')),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc['exten'],'priority':_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}else{if(_0x1bdf3d[_0xef8d('0x18')](_0xef8d('0x35'))){if([_0xef8d('0x36'),_0xef8d('0x37')][_0xef8d('0x38')](_0x1bdf3d[_0xef8d('0x39')][_0xef8d('0x2f')]())&&_0x1bdf3d[_0xef8d('0x3a')]!==_0xef8d('0x3b')){if(_0x1bdf3d['answer']){_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d[_0xef8d('0x2')][_0xef8d('0x2f')](),'app':_0xef8d('0x3c'),'appdata':_0xef8d('0x3d'),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});_0x4e9a9d['push']({'type':_0x1bdf3d[_0xef8d('0x2')][_0xef8d('0x2f')](),'app':'Set','appdata':_0xef8d('0x3e'),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')]['length']+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}else{_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d[_0xef8d('0x2')][_0xef8d('0x2f')](),'app':_0xef8d('0x3c'),'appdata':_0xef8d('0x3f'),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d[_0xef8d('0x2')]['toLowerCase'](),'app':_0xef8d('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')]['length']+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}}}}for(var _0x51e93d=0x0;_0x51e93d<_0x1bdf3d[_0xef8d('0x2c')]['length'];_0x51e93d++){var _0x54269e=_0x5c2a69+_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')];var _0x413cd8=_0x51e93d===_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]-0x1?_0x5c2a69+_0x4e9a9d[_0xef8d('0x20')]+_0xd397d1[_0xef8d('0x20')]+0x2:_0x5c2a69+_0x51e93d+0x1;_0x4e9a9d[_0xef8d('0x40')](_0x51e93d,0x0,{'type':_0x5ae7fc[_0xef8d('0x2')],'app':_0xef8d('0x41'),'appdata':_0x1bdf3d[_0xef8d('0x2c')][_0x51e93d]+'?'+_0x5ae7fc[_0xef8d('0x7')]+_0xef8d('0x42')+_0x54269e+':'+_0x5ae7fc['context']+_0xef8d('0x42')+_0x413cd8,'exten':_0x5ae7fc[_0xef8d('0x8')],'context':_0x5ae7fc[_0xef8d('0x7')],'priority':_0x5c2a69+_0x51e93d,'VoiceExtensionId':_0x5ae7fc['id']});}if(_0x1bdf3d[_0xef8d('0x3a')]===_0xef8d('0x43'))_0x1bdf3d['appdata']=_0x37c108(_0x5ae7fc,_0x1bdf3d[_0xef8d('0x44')]);_0x1bdf3d['priority']=_0x4e9a9d[_0xef8d('0x20')]?_[_0xef8d('0x45')](_0x4e9a9d)['priority']+0x1:_0x5c2a69;_0x517316=_[_0xef8d('0x46')](_0x517316,_0x4e9a9d,[_0x1bdf3d],_0xd397d1);_0x5c2a69=_['last'](_0x517316)[_0xef8d('0x47')]+0x1;}return _0x194fd7(_0x517316);})['catch'](function(_0x4ab161){_0x2acbb3(_0x4ab161);});});}return _0x51c905[_0xef8d('0x48')](_0xef8d('0x49'),attributes,{'tableName':_0xef8d('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1678e7){var _0x5e7237=this[_0xef8d('0x4b')]({'plain':!![]});var _0x5eda3a=_0x5e7237['type']===_0xef8d('0xe')?_0x3311e5(_0x5e7237):_0x3651ec(_0x5e7237);return _0x766c76(_0x5e7237,_0x1678e7,_[_0xef8d('0x45')](_0x5eda3a)['priority']+0x1)[_0xef8d('0x4c')](function(_0x1ee613){var _0x347a55=_[_0xef8d('0x46')](_0x5eda3a,_0x1ee613);_0x347a55['push']({'type':_0x5e7237[_0xef8d('0x2')],'app':_0xef8d('0x4d'),'exten':_0x5e7237['exten'],'context':_0x5e7237['context'],'priority':_[_0xef8d('0x45')](_0x347a55)[_0xef8d('0x47')]+0x1,'VoiceExtensionId':_0x5e7237['id']});return _0x347a55;});}}});}; \ No newline at end of file +var _0x4eea=['get','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','exten','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','name','param','prefix','phone','${EXTEN}','SIP','none','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','IntervalId','then','length','interval','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','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',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','VoiceExtension'];(function(_0x1845e3,_0x5bbe18){var _0x123cca=function(_0x3400c6){while(--_0x3400c6){_0x1845e3['push'](_0x1845e3['shift']());}};_0x123cca(++_0x5bbe18);}(_0x4eea,0x149));var _0xa4ee=function(_0x5b786e,_0x15f835){_0x5b786e=_0x5b786e-0x0;var _0x2a0c5f=_0x4eea[_0x5b786e];return _0x2a0c5f;};'use strict';var _=require('lodash');var attributes=require(_0xa4ee('0x0'));module[_0xa4ee('0x1')]=function(_0x537771){var _0xae3bb7=_0x537771[_0xa4ee('0x2')];function _0x53eae3(_0x42695c){var _0x3ed6eb=0x2;var _0x4c435d=[{'type':_0x42695c[_0xa4ee('0x3')],'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0x5')+_0x42695c['type'],'context':_0x42695c['context'],'exten':_0x42695c['exten'],'priority':_0x3ed6eb++,'VoiceExtensionId':_0x42695c['id']},{'type':_0x42695c[_0xa4ee('0x3')],'app':_0x42695c[_0xa4ee('0x6')]?'Set':_0xa4ee('0x7'),'appdata':_0x42695c[_0xa4ee('0x6')]?_0xa4ee('0x8')+_0x42695c[_0xa4ee('0x6')]:_0xa4ee('0x9'),'context':_0x42695c[_0xa4ee('0xa')],'exten':_0x42695c[_0xa4ee('0xb')],'priority':_0x3ed6eb++,'VoiceExtensionId':_0x42695c['id']}];if(_0x42695c[_0xa4ee('0x3')]==='inbound'){_0x4c435d[_0xa4ee('0xc')]({'type':_0xa4ee('0xd'),'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0xe')+_0x42695c['id'],'context':_0x42695c[_0xa4ee('0xa')],'exten':_0x42695c['exten'],'priority':_0x3ed6eb++,'VoiceExtensionId':_0x42695c['id']});}_0x4c435d[_0xa4ee('0xc')]({'type':_0x42695c[_0xa4ee('0x3')],'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0xf'),'context':_0x42695c[_0xa4ee('0xa')],'exten':_0x42695c[_0xa4ee('0xb')],'priority':_0x3ed6eb++,'VoiceExtensionId':_0x42695c['id']},{'type':_0x42695c[_0xa4ee('0x3')],'app':'Set','appdata':_0xa4ee('0x10'),'context':_0x42695c[_0xa4ee('0xa')],'exten':_0x42695c['exten'],'priority':_0x3ed6eb++,'VoiceExtensionId':_0x42695c['id']},{'type':_0x42695c['type'],'app':'Set','appdata':_0xa4ee('0x11'),'context':_0x42695c[_0xa4ee('0xa')],'exten':_0x42695c['exten'],'priority':_0x3ed6eb++,'VoiceExtensionId':_0x42695c['id']});return _0x4c435d;}function _0x5a9d88(_0x2b8c4e){var _0x1da811=0x2;var _0x48f25f=[{'type':_0xa4ee('0x12'),'app':_0xa4ee('0x4'),'appdata':'CDR(type)=outbound','context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e['exten'],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':_0x2b8c4e['alias']?'Set':_0xa4ee('0x7'),'appdata':_0x2b8c4e[_0xa4ee('0x6')]?_0xa4ee('0x8')+_0x2b8c4e['alias']:'No\x20alias\x20set','context':_0x2b8c4e['context'],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':'Set','appdata':_0xa4ee('0x13')+(_0x2b8c4e[_0xa4ee('0x14')]?_0xa4ee('0x15')+_0x2b8c4e['cutdigits']+'}':'${EXTEN}'),'context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0xe')+_0x2b8c4e['id'],'context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':_0xa4ee('0x16'),'appdata':_0xa4ee('0x17')+(_0x1da811+0x2)+'):Goto('+(_0x1da811+0x1)+')','context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e['exten'],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':'outbound','app':_0xa4ee('0x4'),'appdata':_0x2b8c4e['cutdigits']?_0xa4ee('0x18')+_0x2b8c4e[_0xa4ee('0x14')]+'}':_0xa4ee('0x19'),'context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0xf'),'context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':'outbound','app':_0xa4ee('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0x11'),'context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':'Set','appdata':_0xa4ee('0x1a')+_0x2b8c4e['id'],'context':_0x2b8c4e['context'],'exten':_0x2b8c4e['exten'],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']}];if(_0x2b8c4e[_0xa4ee('0x1b')](_0xa4ee('0x1c'))&&_0x2b8c4e[_0xa4ee('0x1c')]!=='none'){_0x48f25f[_0xa4ee('0xc')]({'type':'outbound','app':_0xa4ee('0x4'),'appdata':_0xa4ee('0x1d'),'context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e[_0xa4ee('0xb')],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']},{'type':_0xa4ee('0x12'),'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0x1e')+_0x2b8c4e['recordingFormat']||_0xa4ee('0x1f'),'context':_0x2b8c4e[_0xa4ee('0xa')],'exten':_0x2b8c4e['exten'],'priority':_0x1da811++,'VoiceExtensionId':_0x2b8c4e['id']});}return _0x48f25f;}function _0x5404b3(_0x259b21,_0x964e9c){var _0x282e84=[{'name':_0xa4ee('0x20'),'param':0x0},{'name':_0xa4ee('0x21'),'param':0x1},{'name':_0xa4ee('0x22'),'param':0x2},{'name':_0xa4ee('0x23'),'param':0x3}];var _0x297828={};var _0x218ba5=_0x964e9c[_0xa4ee('0x24')](',');var _0x29161e=[];for(var _0x415614=0x0;_0x415614<_0x282e84['length'];_0x415614++){switch(_0x282e84[_0x415614][_0xa4ee('0x25')]){case _0xa4ee('0x20'):_0x297828['trunk']=_0x218ba5[_0x282e84[_0x415614][_0xa4ee('0x26')]][_0xa4ee('0x24')]('/')[0x1];_0x297828['phone']=_0x218ba5[_0x282e84[_0x415614][_0xa4ee('0x26')]][_0xa4ee('0x24')]('/')[0x2];_0x297828[_0xa4ee('0x27')]=_0x297828[_0xa4ee('0x28')]?_0x297828[_0xa4ee('0x28')][_0xa4ee('0x24')]('$')[0x0]:undefined;_0x297828[_0xa4ee('0x28')]=_0x259b21[_0xa4ee('0x14')]?(_0x297828[_0xa4ee('0x27')]||'')+_0xa4ee('0x15')+_0x259b21[_0xa4ee('0x14')]+'}':(_0x297828['prefix']||'')+_0xa4ee('0x29');_0x29161e[_0x282e84[_0x415614][_0xa4ee('0x26')]]=[_0xa4ee('0x2a'),_0x297828[_0xa4ee('0x20')],_0x297828[_0xa4ee('0x28')]]['join']('/');break;case'options':_0x297828['options']=_0x218ba5[_0x282e84[_0x415614][_0xa4ee('0x26')]];if(_0x259b21[_0xa4ee('0x1c')]!==_0xa4ee('0x2b')){if(_0x297828[_0xa4ee('0x22')][_0xa4ee('0x2c')](_0xa4ee('0x2d'))<0x0){_0x297828[_0xa4ee('0x22')]+=_0xa4ee('0x2d');}}else{_0x297828[_0xa4ee('0x22')]=_0x297828[_0xa4ee('0x22')][_0xa4ee('0x2e')]('U(xcally-mixmonitor-context)','');}_0x29161e[_0x282e84[_0x415614][_0xa4ee('0x26')]]=_0x297828[_0xa4ee('0x22')];break;default:_0x29161e[_0x282e84[_0x415614][_0xa4ee('0x26')]]=_0x218ba5[_0x282e84[_0x415614][_0xa4ee('0x26')]];}}return _0x29161e[_0xa4ee('0x2f')](',');}function _0x50cea2(_0x2edda4,_0x234675,_0x5667bc){return new Promise(function(_0x13badd,_0x36da56){var _0x36e87c=[];if(_[_0xa4ee('0x30')](_0x234675))return _0x13badd(_0x36e87c);_0xae3bb7[_0xa4ee('0x31')]['findAll']({'attributes':['id','interval',_0xa4ee('0x32')],'raw':!![]})[_0xa4ee('0x33')](function(_0x498689){for(var _0x58556b=0x0,_0x522b0f=0x0;_0x58556b<_0x234675[_0xa4ee('0x34')];_0x58556b++,_0x522b0f=0x0){var _0x222f39=_0x234675[_0x58556b];var _0x591b64=[];var _0x3a8363=[];delete _0x222f39['id'];if(_0x222f39[_0xa4ee('0x35')]!==_0xa4ee('0x36')){_0x222f39['intervals']=[_0x222f39[_0xa4ee('0x35')]];}else{_0x222f39[_0xa4ee('0x37')]=_0x222f39['IntervalId']?_[_0xa4ee('0x38')](_['filter'](_0x498689,{'IntervalId':_0x222f39[_0xa4ee('0x32')]}),_0xa4ee('0x35')):[];}_0x222f39[_0xa4ee('0xa')]=_0x2edda4[_0xa4ee('0xa')];_0x222f39[_0xa4ee('0xb')]=_0x2edda4[_0xa4ee('0xb')];if(_0x222f39[_0xa4ee('0x3')])_0x222f39[_0xa4ee('0x3')]=_0x222f39[_0xa4ee('0x3')][_0xa4ee('0x39')]();if(_0x2edda4[_0xa4ee('0x3')]===_0xa4ee('0x12')){if(_0x222f39[_0xa4ee('0x1b')](_0xa4ee('0x3a'))&&_0x222f39[_0xa4ee('0x3a')]&&_0x222f39[_0xa4ee('0x3a')]!=='--'){_0x591b64['push']({'type':_0x222f39[_0xa4ee('0x3')][_0xa4ee('0x39')](),'app':_0xa4ee('0x4'),'appdata':_0xa4ee('0x3b')+_0x222f39[_0xa4ee('0x3a')],'context':_0x2edda4['context'],'exten':_0x2edda4[_0xa4ee('0xb')],'priority':_0x222f39[_0xa4ee('0x37')][_0xa4ee('0x34')]+_0x5667bc+_0x522b0f++,'VoiceExtensionId':_0x2edda4['id']});}_0x591b64[_0xa4ee('0xc')]({'type':_0x222f39[_0xa4ee('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0xa4ee('0x3c')+(_0x222f39[_0xa4ee('0x3d')]?'Set(CALLERID(all)='+_0x222f39[_0xa4ee('0x3d')]+')':_0xa4ee('0x3e')),'context':_0x2edda4[_0xa4ee('0xa')],'exten':_0x2edda4['exten'],'priority':_0x222f39[_0xa4ee('0x37')][_0xa4ee('0x34')]+_0x5667bc+_0x522b0f++,'VoiceExtensionId':_0x2edda4['id']});}else{if(_0x222f39[_0xa4ee('0x1b')](_0xa4ee('0x3f'))){if([_0xa4ee('0x40'),_0xa4ee('0x41')][_0xa4ee('0x42')](_0x222f39[_0xa4ee('0x43')][_0xa4ee('0x39')]())&&_0x222f39[_0xa4ee('0x44')]!==_0xa4ee('0x45')){if(_0x222f39[_0xa4ee('0x3f')]){_0x591b64[_0xa4ee('0xc')]({'type':_0x222f39[_0xa4ee('0x3')][_0xa4ee('0x39')](),'app':_0xa4ee('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2edda4['context'],'exten':_0x2edda4['exten'],'priority':_0x222f39[_0xa4ee('0x37')][_0xa4ee('0x34')]+_0x5667bc+_0x522b0f++,'VoiceExtensionId':_0x2edda4['id']});_0x591b64['push']({'type':_0x222f39[_0xa4ee('0x3')]['toLowerCase'](),'app':'Set','appdata':_0xa4ee('0x46'),'context':_0x2edda4[_0xa4ee('0xa')],'exten':_0x2edda4['exten'],'priority':_0x222f39['intervals'][_0xa4ee('0x34')]+_0x5667bc+_0x522b0f++,'VoiceExtensionId':_0x2edda4['id']});}else{_0x591b64[_0xa4ee('0xc')]({'type':_0x222f39['type']['toLowerCase'](),'app':_0xa4ee('0x16'),'appdata':_0xa4ee('0x47'),'context':_0x2edda4[_0xa4ee('0xa')],'exten':_0x2edda4[_0xa4ee('0xb')],'priority':_0x222f39[_0xa4ee('0x37')][_0xa4ee('0x34')]+_0x5667bc+_0x522b0f++,'VoiceExtensionId':_0x2edda4['id']});_0x591b64[_0xa4ee('0xc')]({'type':_0x222f39[_0xa4ee('0x3')]['toLowerCase'](),'app':'Set','appdata':_0xa4ee('0x48'),'context':_0x2edda4[_0xa4ee('0xa')],'exten':_0x2edda4[_0xa4ee('0xb')],'priority':_0x222f39[_0xa4ee('0x37')]['length']+_0x5667bc+_0x522b0f++,'VoiceExtensionId':_0x2edda4['id']});}}}}for(var _0x241f54=0x0;_0x241f54<_0x222f39[_0xa4ee('0x37')][_0xa4ee('0x34')];_0x241f54++){var _0x5690b1=_0x5667bc+_0x222f39['intervals'][_0xa4ee('0x34')];var _0x289fba=_0x241f54===_0x222f39[_0xa4ee('0x37')][_0xa4ee('0x34')]-0x1?_0x5667bc+_0x591b64[_0xa4ee('0x34')]+_0x3a8363[_0xa4ee('0x34')]+0x2:_0x5667bc+_0x241f54+0x1;_0x591b64['splice'](_0x241f54,0x0,{'type':_0x2edda4[_0xa4ee('0x3')],'app':'GotoIfTime','appdata':_0x222f39['intervals'][_0x241f54]+'?'+_0x2edda4['context']+_0xa4ee('0x49')+_0x5690b1+':'+_0x2edda4[_0xa4ee('0xa')]+_0xa4ee('0x49')+_0x289fba,'exten':_0x2edda4[_0xa4ee('0xb')],'context':_0x2edda4['context'],'priority':_0x5667bc+_0x241f54,'VoiceExtensionId':_0x2edda4['id']});}if(_0x222f39[_0xa4ee('0x44')]===_0xa4ee('0x4a'))_0x222f39[_0xa4ee('0x4b')]=_0x5404b3(_0x2edda4,_0x222f39['appdata']);_0x222f39[_0xa4ee('0x4c')]=_0x591b64['length']?_[_0xa4ee('0x4d')](_0x591b64)[_0xa4ee('0x4c')]+0x1:_0x5667bc;_0x36e87c=_[_0xa4ee('0x4e')](_0x36e87c,_0x591b64,[_0x222f39],_0x3a8363);_0x5667bc=_[_0xa4ee('0x4d')](_0x36e87c)['priority']+0x1;}return _0x13badd(_0x36e87c);})[_0xa4ee('0x4f')](function(_0x182347){_0x36da56(_0x182347);});});}return _0x537771['define'](_0xa4ee('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x29c03f){var _0x1da386=this[_0xa4ee('0x51')]({'plain':!![]});var _0x4f5f11=_0x1da386[_0xa4ee('0x3')]===_0xa4ee('0x12')?_0x5a9d88(_0x1da386):_0x53eae3(_0x1da386);return _0x50cea2(_0x1da386,_0x29c03f,_[_0xa4ee('0x4d')](_0x4f5f11)[_0xa4ee('0x4c')]+0x1)[_0xa4ee('0x33')](function(_0x9a181){var _0x2dfc29=_[_0xa4ee('0x4e')](_0x4f5f11,_0x9a181);_0x2dfc29[_0xa4ee('0xc')]({'type':_0x1da386['type'],'app':'Hangup','exten':_0x1da386['exten'],'context':_0x1da386['context'],'priority':_[_0xa4ee('0x4d')](_0x2dfc29)[_0xa4ee('0x4c')]+0x1,'VoiceExtensionId':_0x1da386['id']});return _0x2dfc29;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index decb834..8890eef 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 _0x56a6=['where','attributes','limit','include','map','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','GetVoiceExtension','findAll','options'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x56a6,0x17b));var _0x656a=function(_0x11b0d3,_0x3db152){_0x11b0d3=_0x11b0d3-0x0;var _0x14cdea=_0x56a6[_0x11b0d3];return _0x14cdea;};'use strict';var _=require(_0x656a('0x0'));var util=require(_0x656a('0x1'));var moment=require(_0x656a('0x2'));var BPromise=require(_0x656a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x656a('0x4'))['db'];var utils=require(_0x656a('0x5'));var logger=require(_0x656a('0x6'))('rpc');var config=require(_0x656a('0x7'));var jayson=require(_0x656a('0x8'));var client=jayson[_0x656a('0x9')]['http']({'port':0x232a});config[_0x656a('0xa')]=_[_0x656a('0xb')](config[_0x656a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x656a('0xc'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x656a('0xd')](socket);function respondWithRpcPromise(_0x11c10f,_0x380aa8,_0x218d19){return new BPromise(function(_0x4d9f32,_0x2bc0ae){return client[_0x656a('0xe')](_0x11c10f,_0x218d19)[_0x656a('0xf')](function(_0x111aaa){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x380aa8,'request\x20sent');logger[_0x656a('0x10')](_0x656a('0x11'),_0x380aa8,_0x656a('0x12'),JSON[_0x656a('0x13')](_0x111aaa));if(_0x111aaa[_0x656a('0x14')]){if(_0x111aaa['error'][_0x656a('0x15')]===0x1f4){logger[_0x656a('0x14')](_0x656a('0x16'),_0x380aa8,_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);return _0x2bc0ae(_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);}logger[_0x656a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x380aa8,_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);return _0x4d9f32(_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);}else{logger[_0x656a('0x18')](_0x656a('0x16'),_0x380aa8,_0x656a('0x12'));_0x4d9f32(_0x111aaa[_0x656a('0x19')][_0x656a('0x17')]);}})['catch'](function(_0x38be9f){logger[_0x656a('0x14')](_0x656a('0x16'),_0x380aa8,_0x38be9f);_0x2bc0ae(_0x38be9f);});});}exports[_0x656a('0x1a')]=function(_0x2ecc76){var _0x17377a=this;return new Promise(function(_0x3e1307,_0x1cecf4){return db['VoiceExtension'][_0x656a('0x1b')]({'raw':_0x2ecc76['options']?_0x2ecc76['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ecc76['options']?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x1d')]||null:null,'attributes':_0x2ecc76['options']?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x1e')]||null:null,'limit':_0x2ecc76[_0x656a('0x1c')]?_0x2ecc76['options'][_0x656a('0x1f')]||null:null,'include':_0x2ecc76[_0x656a('0x1c')]?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x20')]?_[_0x656a('0x21')](_0x2ecc76[_0x656a('0x1c')][_0x656a('0x20')],function(_0x15271f){return{'model':db[_0x15271f['model']],'as':_0x15271f['as'],'attributes':_0x15271f[_0x656a('0x1e')],'include':_0x15271f['include']?_[_0x656a('0x21')](_0x15271f['include'],function(_0x2008fe){return{'model':db[_0x2008fe['model']],'as':_0x2008fe['as'],'attributes':_0x2008fe[_0x656a('0x1e')],'include':_0x2008fe['include']?_[_0x656a('0x21')](_0x2008fe['include'],function(_0x55abd2){return{'model':db[_0x55abd2['model']],'as':_0x55abd2['as'],'attributes':_0x55abd2[_0x656a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb19ba7){logger['info'](_0x656a('0x1a'),_0x2ecc76);logger[_0x656a('0x10')](_0x656a('0x1a'),_0x2ecc76,JSON[_0x656a('0x13')](_0xb19ba7));_0x3e1307(_0xb19ba7);})['catch'](function(_0x4f81bb){logger[_0x656a('0x14')](_0x656a('0x1a'),_0x4f81bb['message'],_0x2ecc76);_0x1cecf4(_0x17377a[_0x656a('0x14')](0x1f4,_0x4f81bb[_0x656a('0x17')]));});});}; \ No newline at end of file +var _0x0c42=['../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x20ad4f,_0x4f4b1e){var _0x2750f0=function(_0x133b69){while(--_0x133b69){_0x20ad4f['push'](_0x20ad4f['shift']());}};_0x2750f0(++_0x4f4b1e);}(_0x0c42,0x191));var _0x20c4=function(_0xe12b82,_0x5e9d8a){_0xe12b82=_0xe12b82-0x0;var _0x1967c4=_0x0c42[_0xe12b82];return _0x1967c4;};'use strict';var _=require(_0x20c4('0x0'));var util=require(_0x20c4('0x1'));var moment=require(_0x20c4('0x2'));var BPromise=require(_0x20c4('0x3'));var rs=require(_0x20c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x20c4('0x5'));var logger=require(_0x20c4('0x6'))(_0x20c4('0x7'));var config=require(_0x20c4('0x8'));var jayson=require(_0x20c4('0x9'));var client=jayson['client'][_0x20c4('0xa')]({'port':0x232a});config['redis']=_[_0x20c4('0xb')](config['redis'],{'host':_0x20c4('0xc'),'port':0x18eb});var socket=require(_0x20c4('0xd'))(new Redis(config[_0x20c4('0xe')]));require('./voiceExtension.socket')[_0x20c4('0xf')](socket);function respondWithRpcPromise(_0x219b9f,_0x94a2e8,_0xf3917){return new BPromise(function(_0xdc42c3,_0x312ee0){return client[_0x20c4('0x10')](_0x219b9f,_0xf3917)[_0x20c4('0x11')](function(_0x4ae2fd){logger[_0x20c4('0x12')](_0x20c4('0x13'),_0x94a2e8,_0x20c4('0x14'));logger[_0x20c4('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x94a2e8,_0x20c4('0x14'),JSON['stringify'](_0x4ae2fd));if(_0x4ae2fd[_0x20c4('0x16')]){if(_0x4ae2fd[_0x20c4('0x16')]['code']===0x1f4){logger[_0x20c4('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x94a2e8,_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);return _0x312ee0(_0x4ae2fd[_0x20c4('0x16')]['message']);}logger[_0x20c4('0x16')](_0x20c4('0x13'),_0x94a2e8,_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);return _0xdc42c3(_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);}else{logger[_0x20c4('0x12')](_0x20c4('0x13'),_0x94a2e8,_0x20c4('0x14'));_0xdc42c3(_0x4ae2fd[_0x20c4('0x18')][_0x20c4('0x17')]);}})['catch'](function(_0x513dc7){logger[_0x20c4('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x94a2e8,_0x513dc7);_0x312ee0(_0x513dc7);});});}exports[_0x20c4('0x19')]=function(_0x2c1892){var _0x805816=this;return new Promise(function(_0x294c37,_0x28ba0a){return db[_0x20c4('0x1a')][_0x20c4('0x1b')]({'raw':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1e')]||null:null,'attributes':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1f')]||null:null,'limit':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x20')]||null:null,'include':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x21')]?_[_0x20c4('0x22')](_0x2c1892[_0x20c4('0x1c')]['include'],function(_0x5efa2b){return{'model':db[_0x5efa2b[_0x20c4('0x23')]],'as':_0x5efa2b['as'],'attributes':_0x5efa2b[_0x20c4('0x1f')],'include':_0x5efa2b['include']?_[_0x20c4('0x22')](_0x5efa2b[_0x20c4('0x21')],function(_0x5bc23a){return{'model':db[_0x5bc23a[_0x20c4('0x23')]],'as':_0x5bc23a['as'],'attributes':_0x5bc23a[_0x20c4('0x1f')],'include':_0x5bc23a['include']?_[_0x20c4('0x22')](_0x5bc23a['include'],function(_0x19907c){return{'model':db[_0x19907c['model']],'as':_0x19907c['as'],'attributes':_0x19907c[_0x20c4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x20c4('0x11')](function(_0x26a63e){logger[_0x20c4('0x12')](_0x20c4('0x19'),_0x2c1892);logger[_0x20c4('0x15')]('GetVoiceExtension',_0x2c1892,JSON['stringify'](_0x26a63e));_0x294c37(_0x26a63e);})[_0x20c4('0x24')](function(_0x1673ff){logger[_0x20c4('0x16')](_0x20c4('0x19'),_0x1673ff[_0x20c4('0x17')],_0x2c1892);_0x28ba0a(_0x805816['error'](0x1f4,_0x1673ff[_0x20c4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a288092..c643aff 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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x25f06d,_0x2a7d61){var _0x3ab4a0=function(_0xd7dc59){while(--_0xd7dc59){_0x25f06d['push'](_0x25f06d['shift']());}};_0x3ab4a0(++_0x2a7d61);}(_0x4975,0x86));var _0x5497=function(_0x4d7ff7,_0x39d87e){_0x4d7ff7=_0x4d7ff7-0x0;var _0x4f620e=_0x4975[_0x4d7ff7];return _0x4f620e;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x186f13,_0x30cc06){var _0x1d9efe=function(_0x1d1845){while(--_0x1d1845){_0x186f13['push'](_0x186f13['shift']());}};_0x1d9efe(++_0x30cc06);}(_0x5fc3,0xa8));var _0x35fc=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0x5fc3[_0x587ba2];return _0x50ec73;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 1290a6a..7005d6b 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 _0x5430=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x5430,0x10c));var _0x0543=function(_0x46f04f,_0x3431eb){_0x46f04f=_0x46f04f-0x0;var _0x343e44=_0x5430[_0x46f04f];return _0x343e44;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0xe')]('/',auth['isAuthenticated'](),controller[_0x0543('0xf')]);router[_0x0543('0x10')]('/:id',auth[_0x0543('0x8')](),controller[_0x0543('0x11')]);router[_0x0543('0x12')](_0x0543('0xa'),auth[_0x0543('0x8')](),controller[_0x0543('0x13')]);module[_0x0543('0x14')]=router; \ No newline at end of file +var _0x1883=['index','/:id','/:id/messages','getMessages','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x1883,0xab));var _0x3188=function(_0x2d70e9,_0x26f559){_0x2d70e9=_0x2d70e9-0x0;var _0xec4b8c=_0x1883[_0x2d70e9];return _0xec4b8c;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['show']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['post']('/',auth[_0x3188('0xc')](),controller[_0x3188('0x11')]);router[_0x3188('0x12')](_0x3188('0xe'),auth['isAuthenticated'](),controller[_0x3188('0x13')]);router[_0x3188('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3188('0x15')]);module[_0x3188('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6e500b7..4b5ecbf 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 _0xbb84=['string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','setDataValue','email'];(function(_0x3be533,_0x3cc880){var _0x163eda=function(_0x3ccafa){while(--_0x3ccafa){_0x3be533['push'](_0x3be533['shift']());}};_0x163eda(++_0x3cc880);}(_0xbb84,0x17b));var _0x4bb8=function(_0x3727ae,_0x165f88){_0x3727ae=_0x3727ae-0x0;var _0x1c3f01=_0xbb84[_0x3727ae];return _0x1c3f01;};'use strict';var Sequelize=require(_0x4bb8('0x0'));module[_0x4bb8('0x1')]={'customer_id':{'type':Sequelize[_0x4bb8('0x2')]},'context':{'type':Sequelize[_0x4bb8('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x4bb8('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x4bb8('0x2')]},'fullname':{'type':Sequelize[_0x4bb8('0x2')]},'email':{'type':Sequelize[_0x4bb8('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4f88f4){this[_0x4bb8('0x3')](_0x4bb8('0x4'),typeof _0x4f88f4===_0x4bb8('0x5')&&_0x4f88f4['trim']()?_0x4f88f4[_0x4bb8('0x6')]():null);}},'pager':{'type':Sequelize[_0x4bb8('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x4bb8('0x7')},'attach':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4bb8('0x2')]},'callback':{'type':Sequelize[_0x4bb8('0x2')]},'review':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4bb8('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4bb8('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4bb8('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4bb8('0x8')]('yes','no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'stamp':{'type':_0x4bb8('0xb')},'emailsubject':{'type':Sequelize[_0x4bb8('0x2')]},'emailbody':{'type':Sequelize[_0x4bb8('0x2')]},'maxsecs':{'type':Sequelize[_0x4bb8('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4bb8('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4bb8('0xd')](_0x4bb8('0xe'))+_0x4bb8('0xf')+this[_0x4bb8('0xd')]('mailbox');}}}; \ No newline at end of file +var _0x7f0d=['getDataValue','fullname','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x11805c,_0x5bbf28){var _0x4140ab=function(_0x5d1d5a){while(--_0x5d1d5a){_0x11805c['push'](_0x11805c['shift']());}};_0x4140ab(++_0x5bbf28);}(_0x7f0d,0x8e));var _0xd7f0=function(_0x2078ed,_0xe8b0f5){_0x2078ed=_0x2078ed-0x0;var _0x333fd4=_0x7f0d[_0x2078ed];return _0x333fd4;};'use strict';var Sequelize=require(_0xd7f0('0x0'));module[_0xd7f0('0x1')]={'customer_id':{'type':Sequelize[_0xd7f0('0x2')]},'context':{'type':Sequelize[_0xd7f0('0x2')],'defaultValue':_0xd7f0('0x3'),'unique':_0xd7f0('0x4')},'mailbox':{'type':Sequelize[_0xd7f0('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd7f0('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4b6d79){this[_0xd7f0('0x5')]('email',typeof _0x4b6d79==='string'&&_0x4b6d79[_0xd7f0('0x6')]()?_0x4b6d79['trim']():null);}},'pager':{'type':Sequelize[_0xd7f0('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xd7f0('0x2')]},'callback':{'type':Sequelize[_0xd7f0('0x2')]},'review':{'type':Sequelize['ENUM'](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xd7f0('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':_0xd7f0('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xd7f0('0x7')](_0xd7f0('0x8'),'no'),'defaultValue':_0xd7f0('0x8'),'allowNull':![]},'stamp':{'type':_0xd7f0('0xa')},'emailsubject':{'type':Sequelize[_0xd7f0('0x2')]},'emailbody':{'type':Sequelize[_0xd7f0('0x2')]},'maxsecs':{'type':Sequelize[_0xd7f0('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd7f0('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd7f0('0xc')](_0xd7f0('0xd'))+'\x20-\x20'+this[_0xd7f0('0xc')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 2465d8e..7a604ac 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 _0xb574=['filter','merge','VoiceMail','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','length','pick','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0xb574,0x106));var _0x4b57=function(_0x515dd1,_0x31e5c8){_0x515dd1=_0x515dd1-0x0;var _0xc7bf47=_0xb574[_0x515dd1];return _0xc7bf47;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];function respondWithStatusCode(_0x357c8b,_0x43d066){_0x43d066=_0x43d066||0xcc;return function(_0xf8a6fc){if(_0xf8a6fc){return _0x357c8b[_0x4b57('0x16')](_0x43d066);}return _0x357c8b[_0x4b57('0x17')](_0x43d066)[_0x4b57('0x18')]();};}function respondWithResult(_0xd5ee6d,_0x31cced){_0x31cced=_0x31cced||0xc8;return function(_0x4e15be){if(_0x4e15be){return _0xd5ee6d['status'](_0x31cced)[_0x4b57('0x19')](_0x4e15be);}};}function respondWithFilteredResult(_0x24f776,_0x10b9ff){return function(_0x58d6bd){if(_0x58d6bd){var _0x284640=typeof _0x10b9ff['offset']===_0x4b57('0x1a')&&typeof _0x10b9ff[_0x4b57('0x1b')]===_0x4b57('0x1a');var _0x10eda5=_0x58d6bd[_0x4b57('0x1c')];var _0xfb71cc=_0x284640?0x0:_0x10b9ff['offset'];var _0x1b35ff=_0x284640?_0x58d6bd[_0x4b57('0x1c')]:_0x10b9ff[_0x4b57('0x1d')]+_0x10b9ff[_0x4b57('0x1b')];var _0x4baaeb;if(_0x1b35ff>=_0x10eda5){_0x1b35ff=_0x10eda5;_0x4baaeb=0xc8;}else{_0x4baaeb=0xce;}_0x24f776[_0x4b57('0x17')](_0x4baaeb);return _0x24f776[_0x4b57('0x1e')](_0x4b57('0x1f'),_0xfb71cc+'-'+_0x1b35ff+'/'+_0x10eda5)[_0x4b57('0x19')](_0x58d6bd);}return null;};}function patchUpdates(_0xef1eae){return function(_0x4454c8){try{jsonpatch['apply'](_0x4454c8,_0xef1eae,!![]);}catch(_0x4b504b){return BPromise[_0x4b57('0x20')](_0x4b504b);}return _0x4454c8[_0x4b57('0x21')]();};}function saveUpdates(_0x567d8f,_0x380554){return function(_0x4a34b2){if(_0x4a34b2){return _0x4a34b2[_0x4b57('0x22')](_0x567d8f)[_0x4b57('0x23')](function(_0x56f017){return _0x56f017;});}return null;};}function removeEntity(_0x271361,_0x368c5f){return function(_0x4d07c9){if(_0x4d07c9){return _0x4d07c9[_0x4b57('0x24')]()[_0x4b57('0x23')](function(){var _0x25d190=_0x4d07c9[_0x4b57('0x25')]({'plain':!![]});var _0x540eff=_0x4b57('0x26');return db['UserProfileResource'][_0x4b57('0x24')]({'where':{'type':_0x540eff,'resourceId':_0x25d190['id']}})['then'](function(){return _0x4d07c9;});})[_0x4b57('0x23')](function(){_0x271361[_0x4b57('0x17')](0xcc)[_0x4b57('0x18')]();});}};}function handleEntityNotFound(_0x6584c4,_0x104f52){return function(_0x392e37){if(!_0x392e37){_0x6584c4['sendStatus'](0x194);}return _0x392e37;};}function handleError(_0x5c3c7a,_0x16d196){_0x16d196=_0x16d196||0x1f4;return function(_0x4c58e4){logger[_0x4b57('0x27')](_0x4c58e4[_0x4b57('0x28')]);if(_0x4c58e4[_0x4b57('0x29')]){delete _0x4c58e4[_0x4b57('0x29')];}_0x5c3c7a[_0x4b57('0x17')](_0x16d196)[_0x4b57('0x2a')](_0x4c58e4);};}exports['index']=function(_0xab365c,_0x2e9922){var _0x68be27={},_0x3cd331={},_0x4ccf89={'count':0x0,'rows':[]};var _0xa91ba=_[_0x4b57('0x2b')](db['VoiceMail'][_0x4b57('0x2c')],function(_0xa5b5dc){return{'name':_0xa5b5dc[_0x4b57('0x2d')],'type':_0xa5b5dc[_0x4b57('0x2e')]['key']};});_0x3cd331['model']=_['map'](_0xa91ba,_0x4b57('0x29'));_0x3cd331[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0xab365c[_0x4b57('0x2f')]);_0x3cd331[_0x4b57('0x31')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],_0x3cd331[_0x4b57('0x2f')]);_0x68be27[_0x4b57('0x33')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0xab365c[_0x4b57('0x2f')]['fields']));_0x68be27[_0x4b57('0x33')]=_0x68be27[_0x4b57('0x33')]['length']?_0x68be27[_0x4b57('0x33')]:_0x3cd331[_0x4b57('0x32')];if(!_0xab365c[_0x4b57('0x2f')][_0x4b57('0x35')](_0x4b57('0x36'))){_0x68be27[_0x4b57('0x1b')]=qs['limit'](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1b')]);_0x68be27[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1d')]);}_0x68be27[_0x4b57('0x37')]=qs['sort'](_0xab365c['query'][_0x4b57('0x38')]);_0x68be27[_0x4b57('0x39')]=qs[_0x4b57('0x31')](_['pick'](_0xab365c[_0x4b57('0x2f')],_0x3cd331[_0x4b57('0x31')]),_0xa91ba);if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]){_0x68be27['where']=_[_0x4b57('0x3b')](_0x68be27[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0xa91ba,function(_0x2d24ab){if(_0x2d24ab['type']!=='VIRTUAL'){var _0x5d624c={};_0x5d624c[_0x2d24ab[_0x4b57('0x29')]]={'$like':'%'+_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]+'%'};return _0x5d624c;}})});}_0x68be27=_[_0x4b57('0x3b')]({},_0x68be27,_0xab365c['options']);var _0x445353={'where':_0x68be27[_0x4b57('0x39')]};return db[_0x4b57('0x3c')][_0x4b57('0x1c')](_0x445353)[_0x4b57('0x23')](function(_0x453129){_0x4ccf89[_0x4b57('0x1c')]=_0x453129;if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3d')]){_0x68be27['include']=[{'all':!![]}];}return db[_0x4b57('0x3c')][_0x4b57('0x3e')](_0x68be27);})[_0x4b57('0x23')](function(_0x5b2f50){_0x4ccf89[_0x4b57('0x3f')]=_0x5b2f50;return _0x4ccf89;})['then'](respondWithFilteredResult(_0x2e9922,_0x68be27))[_0x4b57('0x40')](handleError(_0x2e9922,null));};exports[_0x4b57('0x41')]=function(_0x457273,_0x19ba66){var _0x189fd0={'raw':!![],'where':{'id':_0x457273[_0x4b57('0x42')]['id']}},_0x477352={};_0x477352[_0x4b57('0x32')]=_[_0x4b57('0x30')](db[_0x4b57('0x3c')][_0x4b57('0x2c')]);_0x477352[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x457273['query']);_0x477352['filters']=_[_0x4b57('0x43')](_0x477352[_0x4b57('0x32')],_0x477352[_0x4b57('0x2f')]);_0x189fd0[_0x4b57('0x33')]=_['intersection'](_0x477352[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x457273['query'][_0x4b57('0x34')]));_0x189fd0['attributes']=_0x189fd0[_0x4b57('0x33')]['length']?_0x189fd0['attributes']:_0x477352[_0x4b57('0x32')];if(_0x457273[_0x4b57('0x2f')]['includeAll']){_0x189fd0[_0x4b57('0x44')]=[{'all':!![]}];}_0x189fd0=_[_0x4b57('0x3b')]({},_0x189fd0,_0x457273[_0x4b57('0x45')]);return db[_0x4b57('0x3c')][_0x4b57('0x46')](_0x189fd0)[_0x4b57('0x23')](handleEntityNotFound(_0x19ba66,null))['then'](respondWithResult(_0x19ba66,null))[_0x4b57('0x40')](handleError(_0x19ba66,null));};exports[_0x4b57('0x47')]=function(_0x4a632c,_0xd529fb){return db[_0x4b57('0x3c')][_0x4b57('0x47')](_0x4a632c['body'],{})[_0x4b57('0x23')](function(_0x5cba5f){var _0x213dca=_0x4a632c[_0x4b57('0x48')][_0x4b57('0x25')]({'plain':!![]});if(!_0x213dca)throw new Error(_0x4b57('0x49'));if(_0x213dca[_0x4b57('0x4a')]===_0x4b57('0x48')){var _0x3d1ecd=_0x5cba5f[_0x4b57('0x25')]({'plain':!![]});var _0x5ab120=_0x4b57('0x26');return db[_0x4b57('0x4b')][_0x4b57('0x46')]({'where':{'name':_0x5ab120,'userProfileId':_0x213dca['userProfileId']},'raw':!![]})[_0x4b57('0x23')](function(_0xcf72b6){if(_0xcf72b6&&_0xcf72b6[_0x4b57('0x4c')]===0x0){return db['UserProfileResource'][_0x4b57('0x47')]({'name':_0x3d1ecd[_0x4b57('0x29')],'resourceId':_0x3d1ecd['id'],'type':_0xcf72b6[_0x4b57('0x29')],'sectionId':_0xcf72b6['id']},{})[_0x4b57('0x23')](function(){return _0x5cba5f;});}else{return _0x5cba5f;}})[_0x4b57('0x40')](function(_0xb7c37c){logger[_0x4b57('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb7c37c);throw _0xb7c37c;});}return _0x5cba5f;})['then'](respondWithResult(_0xd529fb,0xc9))[_0x4b57('0x40')](handleError(_0xd529fb,null));};exports[_0x4b57('0x22')]=function(_0x3b4cbf,_0x2e64c2){if(_0x3b4cbf['body']['id']){delete _0x3b4cbf[_0x4b57('0x4d')]['id'];}return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x3b4cbf[_0x4b57('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e64c2,null))['then'](saveUpdates(_0x3b4cbf[_0x4b57('0x4d')],null))[_0x4b57('0x23')](respondWithResult(_0x2e64c2,null))['catch'](handleError(_0x2e64c2,null));};exports['destroy']=function(_0x451737,_0x5c1082){return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x451737[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x5c1082,null))[_0x4b57('0x23')](removeEntity(_0x5c1082,null))['catch'](handleError(_0x5c1082,null));};exports['getMessages']=function(_0x54ff9d,_0x4c241a,_0x179802){return db[_0x4b57('0x3c')]['findOne']({'where':{'id':_0x54ff9d[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x4c241a,null))[_0x4b57('0x23')](function(_0x9ed750){var _0x64b0fd;var _0x1fcc10={},_0xf1bf63={};_0xf1bf63[_0x4b57('0x32')]=_[_0x4b57('0x30')](db['VoiceMailMessage'][_0x4b57('0x2c')]);_0xf1bf63['query']=_[_0x4b57('0x30')](_0x54ff9d[_0x4b57('0x2f')]);_0xf1bf63['filters']=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],_0xf1bf63[_0x4b57('0x2f')]);_0x1fcc10[_0x4b57('0x33')]=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x34')]));_0x1fcc10[_0x4b57('0x33')]=_0x1fcc10[_0x4b57('0x33')][_0x4b57('0x4e')]?_0x1fcc10['attributes']:_0xf1bf63[_0x4b57('0x32')];if(!_0x54ff9d[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x36'))){_0x1fcc10['limit']=qs['limit'](_0x54ff9d['query'][_0x4b57('0x1b')]);_0x1fcc10['offset']=qs[_0x4b57('0x1d')](_0x54ff9d[_0x4b57('0x2f')]['offset']);}_0x1fcc10['order']=qs[_0x4b57('0x38')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x38')]);_0x1fcc10['where']=qs[_0x4b57('0x31')](_[_0x4b57('0x4f')](_0x54ff9d['query'],_0xf1bf63[_0x4b57('0x31')]));if(_0x54ff9d[_0x4b57('0x2f')]['filter']){_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0x1fcc10[_0x4b57('0x33')],function(_0x5d9dd5){var _0x2112d5={};_0x2112d5[_0x5d9dd5]={'$like':'%'+_0x54ff9d['query']['filter']+'%'};return _0x2112d5;})});}_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10['where'],{'mailboxuser':_0x9ed750['mailbox']});_0x1fcc10=_[_0x4b57('0x3b')]({},_0x1fcc10,_0x54ff9d[_0x4b57('0x45')]);return db['VoiceMailMessage']['findAndCountAll'](_0x1fcc10)['then'](respondWithFilteredResult(_0x4c241a,_0x1fcc10));})[_0x4b57('0x40')](handleError(_0x4c241a,null));}; \ No newline at end of file +var _0x0565=['lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','Voicemails','sendStatus','stack','name','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','error','update','findOne','VoiceMailMessage','mailbox','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x1e6b81,_0x1eb3ec){var _0x457c87=function(_0x46f35e){while(--_0x46f35e){_0x1e6b81['push'](_0x1e6b81['shift']());}};_0x457c87(++_0x1eb3ec);}(_0x0565,0xf2));var _0x5056=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x0565[_0x47aa64];return _0x549c7a;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548bcf,_0x53e98a){_0x53e98a=_0x53e98a||0xcc;return function(_0x2d44fb){if(_0x2d44fb){return _0x548bcf['sendStatus'](_0x53e98a);}return _0x548bcf[_0x5056('0x19')](_0x53e98a)[_0x5056('0x1a')]();};}function respondWithResult(_0x7af76b,_0x543cee){_0x543cee=_0x543cee||0xc8;return function(_0x1e8b64){if(_0x1e8b64){return _0x7af76b[_0x5056('0x19')](_0x543cee)[_0x5056('0x1b')](_0x1e8b64);}};}function respondWithFilteredResult(_0x56c3ef,_0x21561d){return function(_0x6a044a){if(_0x6a044a){var _0x4ac332=typeof _0x21561d[_0x5056('0x1c')]==='undefined'&&typeof _0x21561d[_0x5056('0x1d')]===_0x5056('0x1e');var _0x1c0ee9=_0x6a044a[_0x5056('0x1f')];var _0x4056ce=_0x4ac332?0x0:_0x21561d['offset'];var _0x9ea88=_0x4ac332?_0x6a044a[_0x5056('0x1f')]:_0x21561d['offset']+_0x21561d['limit'];var _0x20776c;if(_0x9ea88>=_0x1c0ee9){_0x9ea88=_0x1c0ee9;_0x20776c=0xc8;}else{_0x20776c=0xce;}_0x56c3ef[_0x5056('0x19')](_0x20776c);return _0x56c3ef[_0x5056('0x20')](_0x5056('0x21'),_0x4056ce+'-'+_0x9ea88+'/'+_0x1c0ee9)[_0x5056('0x1b')](_0x6a044a);}return null;};}function patchUpdates(_0xf04e08){return function(_0x33035c){try{jsonpatch['apply'](_0x33035c,_0xf04e08,!![]);}catch(_0x13b363){return BPromise[_0x5056('0x22')](_0x13b363);}return _0x33035c['save']();};}function saveUpdates(_0x271efc,_0x1bccef){return function(_0x2564d0){if(_0x2564d0){return _0x2564d0['update'](_0x271efc)[_0x5056('0x23')](function(_0x26a3c2){return _0x26a3c2;});}return null;};}function removeEntity(_0x5afbfe,_0x4a64be){return function(_0x29e166){if(_0x29e166){return _0x29e166[_0x5056('0x24')]()[_0x5056('0x23')](function(){var _0x37f7b5=_0x29e166['get']({'plain':!![]});var _0x267048=_0x5056('0x25');return db['UserProfileResource'][_0x5056('0x24')]({'where':{'type':_0x267048,'resourceId':_0x37f7b5['id']}})['then'](function(){return _0x29e166;});})[_0x5056('0x23')](function(){_0x5afbfe[_0x5056('0x19')](0xcc)[_0x5056('0x1a')]();});}};}function handleEntityNotFound(_0x2b8fab,_0x45f600){return function(_0x50f2a8){if(!_0x50f2a8){_0x2b8fab[_0x5056('0x26')](0x194);}return _0x50f2a8;};}function handleError(_0x346e9e,_0x14cb84){_0x14cb84=_0x14cb84||0x1f4;return function(_0x2ac79a){logger['error'](_0x2ac79a[_0x5056('0x27')]);if(_0x2ac79a['name']){delete _0x2ac79a[_0x5056('0x28')];}_0x346e9e['status'](_0x14cb84)['send'](_0x2ac79a);};}exports['index']=function(_0x113be0,_0x252f75){var _0x482939={},_0x27f4be={},_0x2c5728={'count':0x0,'rows':[]};var _0x9e2986=_[_0x5056('0x29')](db[_0x5056('0x2a')][_0x5056('0x2b')],function(_0x173fac){return{'name':_0x173fac[_0x5056('0x2c')],'type':_0x173fac[_0x5056('0x2d')][_0x5056('0x2e')]};});_0x27f4be[_0x5056('0x2f')]=_['map'](_0x9e2986,'name');_0x27f4be[_0x5056('0x30')]=_[_0x5056('0x31')](_0x113be0['query']);_0x27f4be[_0x5056('0x32')]=_[_0x5056('0x33')](_0x27f4be['model'],_0x27f4be[_0x5056('0x30')]);_0x482939[_0x5056('0x34')]=_[_0x5056('0x33')](_0x27f4be[_0x5056('0x2f')],qs[_0x5056('0x35')](_0x113be0[_0x5056('0x30')][_0x5056('0x35')]));_0x482939[_0x5056('0x34')]=_0x482939[_0x5056('0x34')][_0x5056('0x36')]?_0x482939[_0x5056('0x34')]:_0x27f4be[_0x5056('0x2f')];if(!_0x113be0[_0x5056('0x30')][_0x5056('0x37')](_0x5056('0x38'))){_0x482939['limit']=qs[_0x5056('0x1d')](_0x113be0['query'][_0x5056('0x1d')]);_0x482939[_0x5056('0x1c')]=qs[_0x5056('0x1c')](_0x113be0[_0x5056('0x30')]['offset']);}_0x482939[_0x5056('0x39')]=qs[_0x5056('0x3a')](_0x113be0['query'][_0x5056('0x3a')]);_0x482939['where']=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x113be0[_0x5056('0x30')],_0x27f4be['filters']),_0x9e2986);if(_0x113be0[_0x5056('0x30')][_0x5056('0x3c')]){_0x482939[_0x5056('0x3d')]=_[_0x5056('0x3e')](_0x482939[_0x5056('0x3d')],{'$or':_[_0x5056('0x29')](_0x9e2986,function(_0x1aa311){if(_0x1aa311[_0x5056('0x2d')]!==_0x5056('0x3f')){var _0x430db0={};_0x430db0[_0x1aa311[_0x5056('0x28')]]={'$like':'%'+_0x113be0[_0x5056('0x30')][_0x5056('0x3c')]+'%'};return _0x430db0;}})});}_0x482939=_[_0x5056('0x3e')]({},_0x482939,_0x113be0[_0x5056('0x40')]);var _0x351ebd={'where':_0x482939['where']};return db['VoiceMail'][_0x5056('0x1f')](_0x351ebd)[_0x5056('0x23')](function(_0x6946b4){_0x2c5728[_0x5056('0x1f')]=_0x6946b4;if(_0x113be0[_0x5056('0x30')][_0x5056('0x41')]){_0x482939[_0x5056('0x42')]=[{'all':!![]}];}return db[_0x5056('0x2a')]['findAll'](_0x482939);})['then'](function(_0x68a385){_0x2c5728[_0x5056('0x43')]=_0x68a385;return _0x2c5728;})[_0x5056('0x23')](respondWithFilteredResult(_0x252f75,_0x482939))['catch'](handleError(_0x252f75,null));};exports[_0x5056('0x44')]=function(_0x5b99e9,_0x285fee){var _0x40375b={'raw':!![],'where':{'id':_0x5b99e9[_0x5056('0x45')]['id']}},_0x2ef93e={};_0x2ef93e[_0x5056('0x2f')]=_[_0x5056('0x31')](db['VoiceMail'][_0x5056('0x2b')]);_0x2ef93e[_0x5056('0x30')]=_[_0x5056('0x31')](_0x5b99e9['query']);_0x2ef93e['filters']=_['intersection'](_0x2ef93e['model'],_0x2ef93e[_0x5056('0x30')]);_0x40375b[_0x5056('0x34')]=_[_0x5056('0x33')](_0x2ef93e[_0x5056('0x2f')],qs[_0x5056('0x35')](_0x5b99e9['query']['fields']));_0x40375b[_0x5056('0x34')]=_0x40375b[_0x5056('0x34')][_0x5056('0x36')]?_0x40375b[_0x5056('0x34')]:_0x2ef93e[_0x5056('0x2f')];if(_0x5b99e9[_0x5056('0x30')][_0x5056('0x41')]){_0x40375b['include']=[{'all':!![]}];}_0x40375b=_['merge']({},_0x40375b,_0x5b99e9[_0x5056('0x40')]);return db[_0x5056('0x2a')]['find'](_0x40375b)[_0x5056('0x23')](handleEntityNotFound(_0x285fee,null))[_0x5056('0x23')](respondWithResult(_0x285fee,null))['catch'](handleError(_0x285fee,null));};exports['create']=function(_0x83d8e4,_0x1ab1a9){return db['VoiceMail']['create'](_0x83d8e4[_0x5056('0x46')],{})[_0x5056('0x23')](function(_0x528575){var _0x5c3f73=_0x83d8e4[_0x5056('0x47')][_0x5056('0x48')]({'plain':!![]});if(!_0x5c3f73)throw new Error(_0x5056('0x49'));if(_0x5c3f73[_0x5056('0x4a')]===_0x5056('0x47')){var _0xdf427c=_0x528575[_0x5056('0x48')]({'plain':!![]});var _0x366ba2=_0x5056('0x25');return db[_0x5056('0x4b')][_0x5056('0x4c')]({'where':{'name':_0x366ba2,'userProfileId':_0x5c3f73[_0x5056('0x4d')]},'raw':!![]})[_0x5056('0x23')](function(_0x327821){if(_0x327821&&_0x327821[_0x5056('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0xdf427c[_0x5056('0x28')],'resourceId':_0xdf427c['id'],'type':_0x327821[_0x5056('0x28')],'sectionId':_0x327821['id']},{})[_0x5056('0x23')](function(){return _0x528575;});}else{return _0x528575;}})[_0x5056('0x4f')](function(_0x35776b){logger[_0x5056('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35776b);throw _0x35776b;});}return _0x528575;})[_0x5056('0x23')](respondWithResult(_0x1ab1a9,0xc9))[_0x5056('0x4f')](handleError(_0x1ab1a9,null));};exports[_0x5056('0x51')]=function(_0x3d22cc,_0x1ff74a){if(_0x3d22cc[_0x5056('0x46')]['id']){delete _0x3d22cc[_0x5056('0x46')]['id'];}return db[_0x5056('0x2a')][_0x5056('0x4c')]({'where':{'id':_0x3d22cc[_0x5056('0x45')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x1ff74a,null))[_0x5056('0x23')](saveUpdates(_0x3d22cc[_0x5056('0x46')],null))['then'](respondWithResult(_0x1ff74a,null))[_0x5056('0x4f')](handleError(_0x1ff74a,null));};exports[_0x5056('0x24')]=function(_0x2df8e8,_0x5363fd){return db[_0x5056('0x2a')][_0x5056('0x4c')]({'where':{'id':_0x2df8e8[_0x5056('0x45')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x5363fd,null))['then'](removeEntity(_0x5363fd,null))['catch'](handleError(_0x5363fd,null));};exports['getMessages']=function(_0x427007,_0x55ae24,_0x1934e1){return db[_0x5056('0x2a')][_0x5056('0x52')]({'where':{'id':_0x427007[_0x5056('0x45')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x55ae24,null))[_0x5056('0x23')](function(_0x5330b4){var _0x48568b;var _0x25da13={},_0x333d22={};_0x333d22['model']=_[_0x5056('0x31')](db[_0x5056('0x53')][_0x5056('0x2b')]);_0x333d22[_0x5056('0x30')]=_[_0x5056('0x31')](_0x427007['query']);_0x333d22[_0x5056('0x32')]=_[_0x5056('0x33')](_0x333d22['model'],_0x333d22[_0x5056('0x30')]);_0x25da13[_0x5056('0x34')]=_[_0x5056('0x33')](_0x333d22[_0x5056('0x2f')],qs[_0x5056('0x35')](_0x427007[_0x5056('0x30')][_0x5056('0x35')]));_0x25da13[_0x5056('0x34')]=_0x25da13[_0x5056('0x34')][_0x5056('0x36')]?_0x25da13[_0x5056('0x34')]:_0x333d22[_0x5056('0x2f')];if(!_0x427007[_0x5056('0x30')]['hasOwnProperty'](_0x5056('0x38'))){_0x25da13[_0x5056('0x1d')]=qs[_0x5056('0x1d')](_0x427007[_0x5056('0x30')][_0x5056('0x1d')]);_0x25da13[_0x5056('0x1c')]=qs['offset'](_0x427007[_0x5056('0x30')]['offset']);}_0x25da13[_0x5056('0x39')]=qs[_0x5056('0x3a')](_0x427007['query']['sort']);_0x25da13[_0x5056('0x3d')]=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x427007[_0x5056('0x30')],_0x333d22['filters']));if(_0x427007['query'][_0x5056('0x3c')]){_0x25da13[_0x5056('0x3d')]=_[_0x5056('0x3e')](_0x25da13['where'],{'$or':_[_0x5056('0x29')](_0x25da13['attributes'],function(_0x57cb62){var _0x1bfae9={};_0x1bfae9[_0x57cb62]={'$like':'%'+_0x427007[_0x5056('0x30')]['filter']+'%'};return _0x1bfae9;})});}_0x25da13[_0x5056('0x3d')]=_[_0x5056('0x3e')](_0x25da13[_0x5056('0x3d')],{'mailboxuser':_0x5330b4[_0x5056('0x54')]});_0x25da13=_[_0x5056('0x3e')]({},_0x25da13,_0x427007[_0x5056('0x40')]);return db[_0x5056('0x53')]['findAndCountAll'](_0x25da13)[_0x5056('0x23')](respondWithFilteredResult(_0x55ae24,_0x25da13));})[_0x5056('0x4f')](handleError(_0x55ae24,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9c758ec..8d11579 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 _0x8804=['request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','moment'];(function(_0x3b7d61,_0x354a99){var _0x1ab2a1=function(_0x322d12){while(--_0x322d12){_0x3b7d61['push'](_0x3b7d61['shift']());}};_0x1ab2a1(++_0x354a99);}(_0x8804,0x1f4));var _0x4880=function(_0x5f50c4,_0x2f1054){_0x5f50c4=_0x5f50c4-0x0;var _0x27637e=_0x8804[_0x5f50c4];return _0x27637e;};'use strict';var _=require(_0x4880('0x0'));var util=require(_0x4880('0x1'));var logger=require(_0x4880('0x2'))('api');var moment=require(_0x4880('0x3'));var BPromise=require('bluebird');var rp=require(_0x4880('0x4'));var fs=require('fs');var path=require(_0x4880('0x5'));var rimraf=require('rimraf');var config=require(_0x4880('0x6'));var attributes=require(_0x4880('0x7'));module[_0x4880('0x8')]=function(_0x5ce591,_0x155320){return _0x5ce591[_0x4880('0x9')](_0x4880('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4880('0xb'),'fields':[_0x4880('0xc'),_0x4880('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9961=['moment','bluebird','request-promise','../../config/environment','./voiceMail.attributes','define','voice_voicemail','lodash','../../config/logger','api'];(function(_0xdf91b5,_0x234b7d){var _0xee828b=function(_0x513578){while(--_0x513578){_0xdf91b5['push'](_0xdf91b5['shift']());}};_0xee828b(++_0x234b7d);}(_0x9961,0x1a1));var _0x1996=function(_0x22fde2,_0x43df30){_0x22fde2=_0x22fde2-0x0;var _0x71a01c=_0x9961[_0x22fde2];return _0x71a01c;};'use strict';var _=require(_0x1996('0x0'));var util=require('util');var logger=require(_0x1996('0x1'))(_0x1996('0x2'));var moment=require(_0x1996('0x3'));var BPromise=require(_0x1996('0x4'));var rp=require(_0x1996('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1996('0x6'));var attributes=require(_0x1996('0x7'));module['exports']=function(_0x2ac479,_0x42c02c){return _0x2ac479[_0x1996('0x8')]('VoiceMail',attributes,{'tableName':_0x1996('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','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 857cad3..86c357e 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 _0x5700=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b27a2,_0x26be85){var _0x4d0878=function(_0x39925b){while(--_0x39925b){_0x3b27a2['push'](_0x3b27a2['shift']());}};_0x4d0878(++_0x26be85);}(_0x5700,0x13a));var _0x0570=function(_0x550d37,_0x3bd05f){_0x550d37=_0x550d37-0x0;var _0x4a3ace=_0x5700[_0x550d37];return _0x4a3ace;};'use strict';var _=require(_0x0570('0x0'));var util=require(_0x0570('0x1'));var moment=require(_0x0570('0x2'));var BPromise=require(_0x0570('0x3'));var rs=require(_0x0570('0x4'));var fs=require('fs');var Redis=require(_0x0570('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0570('0x6'));var logger=require(_0x0570('0x7'))(_0x0570('0x8'));var config=require(_0x0570('0x9'));var jayson=require(_0x0570('0xa'));var client=jayson[_0x0570('0xb')][_0x0570('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e1d84,_0x2b17d3,_0x128a54){return new BPromise(function(_0x20b02c,_0x29e7e8){return client[_0x0570('0xd')](_0x3e1d84,_0x128a54)[_0x0570('0xe')](function(_0x27e378){logger[_0x0570('0xf')](_0x0570('0x10'),_0x2b17d3,'request\x20sent');logger[_0x0570('0x11')](_0x0570('0x12'),_0x2b17d3,_0x0570('0x13'),JSON[_0x0570('0x14')](_0x27e378));if(_0x27e378[_0x0570('0x15')]){if(_0x27e378['error'][_0x0570('0x16')]===0x1f4){logger[_0x0570('0x15')](_0x0570('0x10'),_0x2b17d3,_0x27e378['error'][_0x0570('0x17')]);return _0x29e7e8(_0x27e378['error']['message']);}logger[_0x0570('0x15')](_0x0570('0x10'),_0x2b17d3,_0x27e378[_0x0570('0x15')][_0x0570('0x17')]);return _0x20b02c(_0x27e378[_0x0570('0x15')][_0x0570('0x17')]);}else{logger[_0x0570('0xf')](_0x0570('0x10'),_0x2b17d3,_0x0570('0x13'));_0x20b02c(_0x27e378['result'][_0x0570('0x17')]);}})['catch'](function(_0x35ee9b){logger['error'](_0x0570('0x10'),_0x2b17d3,_0x35ee9b);_0x29e7e8(_0x35ee9b);});});} \ No newline at end of file +var _0xbb99=['../../config/environment','client','http','request','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','rpc'];(function(_0x1dc3be,_0x4241a6){var _0x12c9a5=function(_0x18fd33){while(--_0x18fd33){_0x1dc3be['push'](_0x1dc3be['shift']());}};_0x12c9a5(++_0x4241a6);}(_0xbb99,0x1e8));var _0x9bb9=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xbb99[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x9bb9('0x0'));var util=require(_0x9bb9('0x1'));var moment=require(_0x9bb9('0x2'));var BPromise=require(_0x9bb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9bb9('0x5'));var config=require(_0x9bb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9bb9('0x7')][_0x9bb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42a1c5,_0x911153,_0x478130){return new BPromise(function(_0x3e4a78,_0x93ca3f){return client[_0x9bb9('0x9')](_0x42a1c5,_0x478130)['then'](function(_0x3817c6){logger[_0x9bb9('0xa')]('VoiceMail,\x20%s,\x20%s',_0x911153,_0x9bb9('0xb'));logger[_0x9bb9('0xc')](_0x9bb9('0xd'),_0x911153,_0x9bb9('0xb'),JSON[_0x9bb9('0xe')](_0x3817c6));if(_0x3817c6[_0x9bb9('0xf')]){if(_0x3817c6['error'][_0x9bb9('0x10')]===0x1f4){logger[_0x9bb9('0xf')](_0x9bb9('0x11'),_0x911153,_0x3817c6[_0x9bb9('0xf')][_0x9bb9('0x12')]);return _0x93ca3f(_0x3817c6['error']['message']);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x911153,_0x3817c6['error']['message']);return _0x3e4a78(_0x3817c6[_0x9bb9('0xf')]['message']);}else{logger[_0x9bb9('0xa')](_0x9bb9('0x11'),_0x911153,_0x9bb9('0xb'));_0x3e4a78(_0x3817c6['result'][_0x9bb9('0x12')]);}})['catch'](function(_0x8afdc0){logger[_0x9bb9('0xf')]('VoiceMail,\x20%s,\x20%s',_0x911153,_0x8afdc0);_0x93ca3f(_0x8afdc0);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index a342b98..d09283b 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 _0xcca8=['show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index'];(function(_0x138697,_0x2cf1f4){var _0x24b07a=function(_0x3ff19b){while(--_0x3ff19b){_0x138697['push'](_0x138697['shift']());}};_0x24b07a(++_0x2cf1f4);}(_0xcca8,0x197));var _0x8cca=function(_0x1c4b31,_0x33f926){_0x1c4b31=_0x1c4b31-0x0;var _0x429be1=_0xcca8[_0x1c4b31];return _0x429be1;};'use strict';var multer=require(_0x8cca('0x0'));var util=require(_0x8cca('0x1'));var path=require('path');var timeout=require(_0x8cca('0x2'));var express=require(_0x8cca('0x3'));var router=express[_0x8cca('0x4')]();var fs_extra=require(_0x8cca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8cca('0x6'));var config=require('../../config/environment');var controller=require(_0x8cca('0x7'));router[_0x8cca('0x8')]('/',auth[_0x8cca('0x9')](),controller[_0x8cca('0xa')]);router[_0x8cca('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8cca('0xb')]);router[_0x8cca('0x8')](_0x8cca('0xc'),auth[_0x8cca('0x9')](),controller[_0x8cca('0xd')]);router[_0x8cca('0xe')]('/',auth[_0x8cca('0x9')](),controller[_0x8cca('0xf')]);router[_0x8cca('0x10')](_0x8cca('0x11'),auth[_0x8cca('0x9')](),controller[_0x8cca('0x12')]);router[_0x8cca('0x13')](_0x8cca('0x11'),auth[_0x8cca('0x9')](),controller[_0x8cca('0x14')]);module[_0x8cca('0x15')]=router; \ No newline at end of file +var _0xa663=['create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','post'];(function(_0x5da45a,_0xeb5d80){var _0xa7f98d=function(_0x3eefed){while(--_0x3eefed){_0x5da45a['push'](_0x5da45a['shift']());}};_0xa7f98d(++_0xeb5d80);}(_0xa663,0xf6));var _0x3a66=function(_0x5b8155,_0x51c636){_0x5b8155=_0x5b8155-0x0;var _0x1d6f07=_0xa663[_0x5b8155];return _0x1d6f07;};'use strict';var multer=require(_0x3a66('0x0'));var util=require(_0x3a66('0x1'));var path=require(_0x3a66('0x2'));var timeout=require(_0x3a66('0x3'));var express=require(_0x3a66('0x4'));var router=express[_0x3a66('0x5')]();var fs_extra=require(_0x3a66('0x6'));var auth=require(_0x3a66('0x7'));var interaction=require(_0x3a66('0x8'));var config=require(_0x3a66('0x9'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x3a66('0xa')](),controller[_0x3a66('0xb')]);router[_0x3a66('0xc')](_0x3a66('0xd'),auth['isAuthenticated'](),controller[_0x3a66('0xe')]);router[_0x3a66('0xc')](_0x3a66('0xf'),auth[_0x3a66('0xa')](),controller[_0x3a66('0x10')]);router[_0x3a66('0x11')]('/',auth[_0x3a66('0xa')](),controller[_0x3a66('0x12')]);router[_0x3a66('0x13')](_0x3a66('0xd'),auth[_0x3a66('0xa')](),controller['update']);router[_0x3a66('0x14')]('/:id',auth[_0x3a66('0xa')](),controller[_0x3a66('0x15')]);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 8daf7b4..df240f8 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 _0x042b=['sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x1c319e,_0xfa1167){var _0x381d3a=function(_0x41011f){while(--_0x41011f){_0x1c319e['push'](_0x1c319e['shift']());}};_0x381d3a(++_0xfa1167);}(_0x042b,0x6c));var _0xb042=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x042b[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xb042('0x0'));module[_0xb042('0x1')]={'name':{'type':Sequelize[_0xb042('0x2')],'get':function(_0x2656ca){return this[_0xb042('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb042('0x5')](_0xb042('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb042('0x7')](_0xb042('0x8'))}}; \ No newline at end of file +var _0xf4f0=['literal','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x3afea0,_0x43df46){var _0x5694b8=function(_0x5a53ac){while(--_0x5a53ac){_0x3afea0['push'](_0x3afea0['shift']());}};_0x5694b8(++_0x43df46);}(_0xf4f0,0x19f));var _0x0f4f=function(_0x3e6707,_0x37475e){_0x3e6707=_0x3e6707-0x0;var _0x12b38d=_0xf4f0[_0x3e6707];return _0x12b38d;};'use strict';var Sequelize=require(_0x0f4f('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f4f('0x1')],'get':function(_0x583b55){return this[_0x0f4f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x0f4f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0f4f('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x0f4f('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0f4f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0f4f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0f4f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x0f4f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0f4f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x0f4f('0x5')](_0x0f4f('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x0f4f('0x7'),'defaultValue':Sequelize[_0x0f4f('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 7930ca0..c2d067e 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 _0x277a=['mustache','util','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','rows','catch','params','find','create','body','download','recording','Sequelize','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x32f4c8,_0x29b891){var _0x4e551a=function(_0x583455){while(--_0x583455){_0x32f4c8['push'](_0x32f4c8['shift']());}};_0x4e551a(++_0x29b891);}(_0x277a,0x18a));var _0xa277=function(_0x4a9c61,_0x2cce4e){_0x4a9c61=_0x4a9c61-0x0;var _0x43d663=_0x277a[_0x4a9c61];return _0x43d663;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa277('0x0'));var zipdir=require(_0xa277('0x1'));var jsonpatch=require(_0xa277('0x2'));var rp=require(_0xa277('0x3'));var moment=require(_0xa277('0x4'));var BPromise=require(_0xa277('0x5'));var Mustache=require(_0xa277('0x6'));var util=require(_0xa277('0x7'));var path=require('path');var sox=require(_0xa277('0x8'));var csv=require(_0xa277('0x9'));var ejs=require(_0xa277('0xa'));var fs=require('fs');var fs_extra=require(_0xa277('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa277('0x9'));var querystring=require(_0xa277('0xd'));var Papa=require(_0xa277('0xe'));var Redis=require(_0xa277('0xf'));var authService=require(_0xa277('0x10'));var qs=require(_0xa277('0x11'));var as=require(_0xa277('0x12'));var hardwareService=require(_0xa277('0x13'));var logger=require('../../config/logger')(_0xa277('0x14'));var utils=require(_0xa277('0x15'));var config=require(_0xa277('0x16'));var licenseUtil=require(_0xa277('0x17'));var db=require(_0xa277('0x18'))['db'];function respondWithStatusCode(_0x547f12,_0x2457cd){_0x2457cd=_0x2457cd||0xcc;return function(_0x48c6d2){if(_0x48c6d2){return _0x547f12[_0xa277('0x19')](_0x2457cd);}return _0x547f12['status'](_0x2457cd)[_0xa277('0x1a')]();};}function respondWithResult(_0x140f23,_0x164ee1){_0x164ee1=_0x164ee1||0xc8;return function(_0x4ac510){if(_0x4ac510){return _0x140f23['status'](_0x164ee1)[_0xa277('0x1b')](_0x4ac510);}};}function respondWithFilteredResult(_0x4c03e2,_0x3964de){return function(_0x306fce){if(_0x306fce){var _0x5ed46a=typeof _0x3964de[_0xa277('0x1c')]==='undefined'&&typeof _0x3964de[_0xa277('0x1d')]==='undefined';var _0x2e8c1e=_0x306fce[_0xa277('0x1e')];var _0x57adef=_0x5ed46a?0x0:_0x3964de[_0xa277('0x1c')];var _0x4376e2=_0x5ed46a?_0x306fce[_0xa277('0x1e')]:_0x3964de['offset']+_0x3964de[_0xa277('0x1d')];var _0xa4c39;if(_0x4376e2>=_0x2e8c1e){_0x4376e2=_0x2e8c1e;_0xa4c39=0xc8;}else{_0xa4c39=0xce;}_0x4c03e2['status'](_0xa4c39);return _0x4c03e2[_0xa277('0x1f')](_0xa277('0x20'),_0x57adef+'-'+_0x4376e2+'/'+_0x2e8c1e)[_0xa277('0x1b')](_0x306fce);}return null;};}function patchUpdates(_0xb1fb7b){return function(_0x5599c1){try{jsonpatch[_0xa277('0x21')](_0x5599c1,_0xb1fb7b,!![]);}catch(_0x114461){return BPromise[_0xa277('0x22')](_0x114461);}return _0x5599c1[_0xa277('0x23')]();};}function saveUpdates(_0x1625a1,_0x192be7){return function(_0x222118){if(_0x222118){return _0x222118[_0xa277('0x24')](_0x1625a1)[_0xa277('0x25')](function(_0x2a6a9f){return _0x2a6a9f;});}return null;};}function removeEntity(_0x2e0332,_0x54ebc4){return function(_0x3bbd34){if(_0x3bbd34){return _0x3bbd34[_0xa277('0x26')]()['then'](function(){_0x2e0332[_0xa277('0x27')](0xcc)[_0xa277('0x1a')]();});}};}function handleEntityNotFound(_0x1dbfb2,_0x3102ed){return function(_0x2c35c4){if(!_0x2c35c4){_0x1dbfb2['sendStatus'](0x194);}return _0x2c35c4;};}function handleError(_0x48eb0f,_0x40dae4){_0x40dae4=_0x40dae4||0x1f4;return function(_0x325205){logger[_0xa277('0x28')](_0x325205['stack']);if(_0x325205[_0xa277('0x29')]){delete _0x325205['name'];}_0x48eb0f[_0xa277('0x27')](_0x40dae4)[_0xa277('0x2a')](_0x325205);};}exports['index']=function(_0x55accf,_0x1fc964){var _0x1521a0={},_0x4d07f4={},_0x19059c={'count':0x0,'rows':[]};var _0x475fea=_[_0xa277('0x2b')](db[_0xa277('0x2c')][_0xa277('0x2d')],function(_0x2c3177){return{'name':_0x2c3177[_0xa277('0x2e')],'type':_0x2c3177[_0xa277('0x2f')]['key']};});_0x4d07f4[_0xa277('0x30')]=_[_0xa277('0x31')](_['map'](_0x475fea,'name'),[_0xa277('0x29')]);_0x4d07f4['query']=_[_0xa277('0x32')](_0x55accf['query']);_0x4d07f4[_0xa277('0x33')]=_['intersection'](_0x4d07f4[_0xa277('0x30')],_0x4d07f4[_0xa277('0x34')]);_0x1521a0[_0xa277('0x35')]=_[_0xa277('0x36')](_0x4d07f4[_0xa277('0x30')],qs[_0xa277('0x37')](_0x55accf['query'][_0xa277('0x37')]));_0x1521a0['attributes']=_0x1521a0[_0xa277('0x35')][_0xa277('0x38')]?_0x1521a0[_0xa277('0x35')]:_0x4d07f4['model'];if(!_0x55accf['query'][_0xa277('0x39')](_0xa277('0x3a'))){_0x1521a0['limit']=qs[_0xa277('0x1d')](_0x55accf['query'][_0xa277('0x1d')]);_0x1521a0['offset']=qs[_0xa277('0x1c')](_0x55accf[_0xa277('0x34')][_0xa277('0x1c')]);}_0x1521a0[_0xa277('0x3b')]=qs['sort'](_0x55accf[_0xa277('0x34')][_0xa277('0x3c')]);_0x1521a0[_0xa277('0x3d')]=qs[_0xa277('0x33')](_[_0xa277('0x3e')](_0x55accf[_0xa277('0x34')],_0x4d07f4[_0xa277('0x33')]),_0x475fea);if(_0x55accf[_0xa277('0x34')][_0xa277('0x3f')]){_0x1521a0[_0xa277('0x3d')]=_['merge'](_0x1521a0[_0xa277('0x3d')],{'$or':_[_0xa277('0x2b')](_0x475fea,function(_0x56fbb7){if(_0x56fbb7['type']!=='VIRTUAL'){var _0x211aca={};_0x211aca[_0x56fbb7[_0xa277('0x29')]]={'$like':'%'+_0x55accf[_0xa277('0x34')]['filter']+'%'};return _0x211aca;}})});}_0x1521a0=_['merge']({},_0x1521a0,_0x55accf[_0xa277('0x40')]);var _0x14f044={'where':_0x1521a0[_0xa277('0x3d')]};return db[_0xa277('0x2c')][_0xa277('0x1e')](_0x14f044)[_0xa277('0x25')](function(_0xeeacd1){_0x19059c[_0xa277('0x1e')]=_0xeeacd1;if(_0x55accf[_0xa277('0x34')]['includeAll']){_0x1521a0['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa277('0x41')](_0x1521a0);})['then'](function(_0x3cb014){_0x19059c[_0xa277('0x42')]=_0x3cb014;return _0x19059c;})['then'](respondWithFilteredResult(_0x1fc964,_0x1521a0))[_0xa277('0x43')](handleError(_0x1fc964,null));};exports['show']=function(_0x2fe4aa,_0x3403bf){var _0x502fac={'raw':!![],'where':{'id':_0x2fe4aa[_0xa277('0x44')]['id']}},_0x2d694f={};_0x2d694f[_0xa277('0x30')]=_[_0xa277('0x32')](db[_0xa277('0x2c')]['rawAttributes']);_0x2d694f['query']=_['keys'](_0x2fe4aa[_0xa277('0x34')]);_0x2d694f[_0xa277('0x33')]=_[_0xa277('0x36')](_0x2d694f['model'],_0x2d694f[_0xa277('0x34')]);_0x502fac[_0xa277('0x35')]=_[_0xa277('0x36')](_0x2d694f[_0xa277('0x30')],qs['fields'](_0x2fe4aa[_0xa277('0x34')][_0xa277('0x37')]));_0x502fac['attributes']=_0x502fac[_0xa277('0x35')][_0xa277('0x38')]?_0x502fac['attributes']:_0x2d694f[_0xa277('0x30')];if(_0x2fe4aa[_0xa277('0x34')]['includeAll']){_0x502fac['include']=[{'all':!![]}];}_0x502fac=_['merge']({},_0x502fac,_0x2fe4aa['options']);return db[_0xa277('0x2c')][_0xa277('0x45')](_0x502fac)[_0xa277('0x25')](handleEntityNotFound(_0x3403bf,null))[_0xa277('0x25')](respondWithResult(_0x3403bf,null))[_0xa277('0x43')](handleError(_0x3403bf,null));};exports[_0xa277('0x46')]=function(_0x502e94,_0xb6be7f){return db[_0xa277('0x2c')][_0xa277('0x46')](_0x502e94[_0xa277('0x47')],{})[_0xa277('0x25')](respondWithResult(_0xb6be7f,0xc9))[_0xa277('0x43')](handleError(_0xb6be7f,null));};exports[_0xa277('0x24')]=function(_0x6f92f0,_0x11e37b){if(_0x6f92f0[_0xa277('0x47')]['id']){delete _0x6f92f0[_0xa277('0x47')]['id'];}return db[_0xa277('0x2c')][_0xa277('0x45')]({'where':{'id':_0x6f92f0[_0xa277('0x44')]['id']}})['then'](handleEntityNotFound(_0x11e37b,null))[_0xa277('0x25')](saveUpdates(_0x6f92f0[_0xa277('0x47')],null))[_0xa277('0x25')](respondWithResult(_0x11e37b,null))['catch'](handleError(_0x11e37b,null));};exports[_0xa277('0x26')]=function(_0x5e2a83,_0x59c583){return db[_0xa277('0x2c')][_0xa277('0x45')]({'where':{'id':_0x5e2a83['params']['id']}})['then'](handleEntityNotFound(_0x59c583,null))[_0xa277('0x25')](removeEntity(_0x59c583,null))[_0xa277('0x43')](handleError(_0x59c583,null));};exports[_0xa277('0x48')]=function(_0x4016de,_0x5d02db,_0x1bba07){return db['VoiceMailMessage'][_0xa277('0x45')]({'where':{'id':_0x4016de[_0xa277('0x44')]['id']},'attributes':['id',_0xa277('0x49'),'msg_id']})[_0xa277('0x25')](handleEntityNotFound(_0x5d02db,null))[_0xa277('0x25')](function(_0x2f8c67){if(_0x2f8c67){if(!_0x2f8c67[_0xa277('0x49')]){throw new db[(_0xa277('0x4a'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x1db231={'Content-Type':'audio/wav','Content-Disposition':_0xa277('0x4b')};if(_0x2f8c67[_0xa277('0x4c')]){_0x1db231[_0xa277('0x4d')]=_0xa277('0x4e')+_0x2f8c67[_0xa277('0x4c')]+_0xa277('0x4f');}_0x5d02db[_0xa277('0x1f')](_0x1db231);return _0x5d02db[_0xa277('0x2a')](new Buffer(_0x2f8c67[_0xa277('0x49')]));}})[_0xa277('0x43')](handleError(_0x5d02db,null));}; \ No newline at end of file +var _0x2510=['lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','map','VoiceMailMessage','fieldName','type','differenceBy','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','include','rows','catch','show','params','keys','options','create','body','find','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x38b169,_0x2daa5c){var _0x106e3a=function(_0x36838f){while(--_0x36838f){_0x38b169['push'](_0x38b169['shift']());}};_0x106e3a(++_0x2daa5c);}(_0x2510,0x138));var _0x0251=function(_0x22ba2c,_0x2abf73){_0x22ba2c=_0x22ba2c-0x0;var _0x16b892=_0x2510[_0x22ba2c];return _0x16b892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0251('0x0'));var zipdir=require(_0x0251('0x1'));var jsonpatch=require(_0x0251('0x2'));var rp=require(_0x0251('0x3'));var moment=require(_0x0251('0x4'));var BPromise=require(_0x0251('0x5'));var Mustache=require(_0x0251('0x6'));var util=require(_0x0251('0x7'));var path=require(_0x0251('0x8'));var sox=require(_0x0251('0x9'));var csv=require('to-csv');var ejs=require(_0x0251('0xa'));var fs=require('fs');var fs_extra=require(_0x0251('0xb'));var _=require(_0x0251('0xc'));var squel=require(_0x0251('0xd'));var crypto=require('crypto');var jsforce=require(_0x0251('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0251('0xf'));var querystring=require(_0x0251('0x10'));var Papa=require(_0x0251('0x11'));var Redis=require(_0x0251('0x12'));var authService=require(_0x0251('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0251('0x14'));var hardwareService=require(_0x0251('0x15'));var logger=require(_0x0251('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0251('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0251('0x18'))['db'];function respondWithStatusCode(_0x84a3e8,_0xfa3d16){_0xfa3d16=_0xfa3d16||0xcc;return function(_0x3e6313){if(_0x3e6313){return _0x84a3e8[_0x0251('0x19')](_0xfa3d16);}return _0x84a3e8[_0x0251('0x1a')](_0xfa3d16)['end']();};}function respondWithResult(_0x1acb22,_0x12ce21){_0x12ce21=_0x12ce21||0xc8;return function(_0x307ad5){if(_0x307ad5){return _0x1acb22[_0x0251('0x1a')](_0x12ce21)['json'](_0x307ad5);}};}function respondWithFilteredResult(_0x3f2ca0,_0x5465d1){return function(_0x2a46e8){if(_0x2a46e8){var _0x51ebfc=typeof _0x5465d1[_0x0251('0x1b')]===_0x0251('0x1c')&&typeof _0x5465d1[_0x0251('0x1d')]===_0x0251('0x1c');var _0x4ebf3f=_0x2a46e8[_0x0251('0x1e')];var _0x4f7652=_0x51ebfc?0x0:_0x5465d1[_0x0251('0x1b')];var _0x20946d=_0x51ebfc?_0x2a46e8[_0x0251('0x1e')]:_0x5465d1['offset']+_0x5465d1[_0x0251('0x1d')];var _0x1a3b7f;if(_0x20946d>=_0x4ebf3f){_0x20946d=_0x4ebf3f;_0x1a3b7f=0xc8;}else{_0x1a3b7f=0xce;}_0x3f2ca0['status'](_0x1a3b7f);return _0x3f2ca0[_0x0251('0x1f')](_0x0251('0x20'),_0x4f7652+'-'+_0x20946d+'/'+_0x4ebf3f)[_0x0251('0x21')](_0x2a46e8);}return null;};}function patchUpdates(_0x58f310){return function(_0x5214cf){try{jsonpatch[_0x0251('0x22')](_0x5214cf,_0x58f310,!![]);}catch(_0x25c330){return BPromise[_0x0251('0x23')](_0x25c330);}return _0x5214cf['save']();};}function saveUpdates(_0x212f39,_0x4091e4){return function(_0x4bb830){if(_0x4bb830){return _0x4bb830[_0x0251('0x24')](_0x212f39)['then'](function(_0x57dc7f){return _0x57dc7f;});}return null;};}function removeEntity(_0x58a7fa,_0x2da02b){return function(_0x354af4){if(_0x354af4){return _0x354af4[_0x0251('0x25')]()[_0x0251('0x26')](function(){_0x58a7fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a35a,_0x58e4d7){return function(_0x3a961a){if(!_0x3a961a){_0x55a35a['sendStatus'](0x194);}return _0x3a961a;};}function handleError(_0x2b9b07,_0x37baab){_0x37baab=_0x37baab||0x1f4;return function(_0x154cf6){logger[_0x0251('0x27')](_0x154cf6[_0x0251('0x28')]);if(_0x154cf6[_0x0251('0x29')]){delete _0x154cf6['name'];}_0x2b9b07[_0x0251('0x1a')](_0x37baab)[_0x0251('0x2a')](_0x154cf6);};}exports['index']=function(_0x3a465b,_0x536e6a){var _0x592e35={},_0x2d6c64={},_0x464579={'count':0x0,'rows':[]};var _0x1e851e=_[_0x0251('0x2b')](db[_0x0251('0x2c')]['rawAttributes'],function(_0x187c7a){return{'name':_0x187c7a[_0x0251('0x2d')],'type':_0x187c7a[_0x0251('0x2e')]['key']};});_0x2d6c64['model']=_[_0x0251('0x2f')](_[_0x0251('0x2b')](_0x1e851e,_0x0251('0x29')),[_0x0251('0x29')]);_0x2d6c64[_0x0251('0x30')]=_['keys'](_0x3a465b[_0x0251('0x30')]);_0x2d6c64[_0x0251('0x31')]=_[_0x0251('0x32')](_0x2d6c64[_0x0251('0x33')],_0x2d6c64['query']);_0x592e35[_0x0251('0x34')]=_[_0x0251('0x32')](_0x2d6c64[_0x0251('0x33')],qs[_0x0251('0x35')](_0x3a465b[_0x0251('0x30')][_0x0251('0x35')]));_0x592e35[_0x0251('0x34')]=_0x592e35[_0x0251('0x34')][_0x0251('0x36')]?_0x592e35['attributes']:_0x2d6c64[_0x0251('0x33')];if(!_0x3a465b[_0x0251('0x30')][_0x0251('0x37')](_0x0251('0x38'))){_0x592e35['limit']=qs['limit'](_0x3a465b[_0x0251('0x30')][_0x0251('0x1d')]);_0x592e35[_0x0251('0x1b')]=qs[_0x0251('0x1b')](_0x3a465b['query'][_0x0251('0x1b')]);}_0x592e35[_0x0251('0x39')]=qs['sort'](_0x3a465b[_0x0251('0x30')]['sort']);_0x592e35[_0x0251('0x3a')]=qs[_0x0251('0x31')](_['pick'](_0x3a465b[_0x0251('0x30')],_0x2d6c64[_0x0251('0x31')]),_0x1e851e);if(_0x3a465b[_0x0251('0x30')][_0x0251('0x3b')]){_0x592e35['where']=_[_0x0251('0x3c')](_0x592e35[_0x0251('0x3a')],{'$or':_[_0x0251('0x2b')](_0x1e851e,function(_0x45f48c){if(_0x45f48c[_0x0251('0x2e')]!==_0x0251('0x3d')){var _0xed0aac={};_0xed0aac[_0x45f48c[_0x0251('0x29')]]={'$like':'%'+_0x3a465b[_0x0251('0x30')]['filter']+'%'};return _0xed0aac;}})});}_0x592e35=_[_0x0251('0x3c')]({},_0x592e35,_0x3a465b['options']);var _0x46af57={'where':_0x592e35[_0x0251('0x3a')]};return db[_0x0251('0x2c')][_0x0251('0x1e')](_0x46af57)[_0x0251('0x26')](function(_0x6642eb){_0x464579[_0x0251('0x1e')]=_0x6642eb;if(_0x3a465b[_0x0251('0x30')]['includeAll']){_0x592e35[_0x0251('0x3e')]=[{'all':!![]}];}return db[_0x0251('0x2c')]['findAll'](_0x592e35);})[_0x0251('0x26')](function(_0x3dbc3b){_0x464579[_0x0251('0x3f')]=_0x3dbc3b;return _0x464579;})[_0x0251('0x26')](respondWithFilteredResult(_0x536e6a,_0x592e35))[_0x0251('0x40')](handleError(_0x536e6a,null));};exports[_0x0251('0x41')]=function(_0x589ab1,_0x567fc3){var _0x4dcd35={'raw':!![],'where':{'id':_0x589ab1[_0x0251('0x42')]['id']}},_0x24a073={};_0x24a073[_0x0251('0x33')]=_[_0x0251('0x43')](db[_0x0251('0x2c')]['rawAttributes']);_0x24a073[_0x0251('0x30')]=_[_0x0251('0x43')](_0x589ab1[_0x0251('0x30')]);_0x24a073['filters']=_[_0x0251('0x32')](_0x24a073['model'],_0x24a073[_0x0251('0x30')]);_0x4dcd35[_0x0251('0x34')]=_[_0x0251('0x32')](_0x24a073[_0x0251('0x33')],qs[_0x0251('0x35')](_0x589ab1['query']['fields']));_0x4dcd35[_0x0251('0x34')]=_0x4dcd35[_0x0251('0x34')]['length']?_0x4dcd35['attributes']:_0x24a073[_0x0251('0x33')];if(_0x589ab1[_0x0251('0x30')]['includeAll']){_0x4dcd35[_0x0251('0x3e')]=[{'all':!![]}];}_0x4dcd35=_[_0x0251('0x3c')]({},_0x4dcd35,_0x589ab1[_0x0251('0x44')]);return db['VoiceMailMessage']['find'](_0x4dcd35)[_0x0251('0x26')](handleEntityNotFound(_0x567fc3,null))[_0x0251('0x26')](respondWithResult(_0x567fc3,null))[_0x0251('0x40')](handleError(_0x567fc3,null));};exports[_0x0251('0x45')]=function(_0x16685f,_0x215595){return db[_0x0251('0x2c')][_0x0251('0x45')](_0x16685f['body'],{})[_0x0251('0x26')](respondWithResult(_0x215595,0xc9))[_0x0251('0x40')](handleError(_0x215595,null));};exports[_0x0251('0x24')]=function(_0x3d4008,_0xde63c0){if(_0x3d4008[_0x0251('0x46')]['id']){delete _0x3d4008['body']['id'];}return db[_0x0251('0x2c')][_0x0251('0x47')]({'where':{'id':_0x3d4008[_0x0251('0x42')]['id']}})[_0x0251('0x26')](handleEntityNotFound(_0xde63c0,null))[_0x0251('0x26')](saveUpdates(_0x3d4008[_0x0251('0x46')],null))['then'](respondWithResult(_0xde63c0,null))[_0x0251('0x40')](handleError(_0xde63c0,null));};exports[_0x0251('0x25')]=function(_0x58a7ea,_0x4440be){return db[_0x0251('0x2c')][_0x0251('0x47')]({'where':{'id':_0x58a7ea[_0x0251('0x42')]['id']}})['then'](handleEntityNotFound(_0x4440be,null))[_0x0251('0x26')](removeEntity(_0x4440be,null))[_0x0251('0x40')](handleError(_0x4440be,null));};exports[_0x0251('0x48')]=function(_0x43fa6e,_0x4218e4,_0x343215){return db[_0x0251('0x2c')][_0x0251('0x47')]({'where':{'id':_0x43fa6e['params']['id']},'attributes':['id',_0x0251('0x49'),_0x0251('0x4a')]})[_0x0251('0x26')](handleEntityNotFound(_0x4218e4,null))['then'](function(_0x3a9620){if(_0x3a9620){if(!_0x3a9620[_0x0251('0x49')]){throw new db[(_0x0251('0x4b'))]['ValidationError'](_0x0251('0x4c'));}var _0x350c0a={'Content-Type':'audio/wav','Content-Disposition':_0x0251('0x4d')};if(_0x3a9620['msg_id']){_0x350c0a[_0x0251('0x4e')]=_0x0251('0x4f')+_0x3a9620[_0x0251('0x4a')]+_0x0251('0x50');}_0x4218e4['set'](_0x350c0a);return _0x4218e4[_0x0251('0x2a')](new Buffer(_0x3a9620[_0x0251('0x49')]));}})[_0x0251('0x40')](handleError(_0x4218e4,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 39681bf..ac9365a 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 _0x3a88=['request-promise','path','../../config/environment','exports','define','voice_voicemail_messages','dir','lodash','../../config/logger','moment','bluebird'];(function(_0x39f670,_0x1767b3){var _0x5b574d=function(_0x5ed586){while(--_0x5ed586){_0x39f670['push'](_0x39f670['shift']());}};_0x5b574d(++_0x1767b3);}(_0x3a88,0x13b));var _0x83a8=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0x3a88[_0x9e0cb3];return _0x5926b7;};'use strict';var _=require(_0x83a8('0x0'));var util=require('util');var logger=require(_0x83a8('0x1'))('api');var moment=require(_0x83a8('0x2'));var BPromise=require(_0x83a8('0x3'));var rp=require(_0x83a8('0x4'));var fs=require('fs');var path=require(_0x83a8('0x5'));var rimraf=require('rimraf');var config=require(_0x83a8('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x83a8('0x7')]=function(_0x32352a,_0x399158){return _0x32352a[_0x83a8('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x83a8('0x9'),'paranoid':![],'indexes':[{'name':_0x83a8('0xa'),'fields':[_0x83a8('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xeb83=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceMailMessage.attributes','VoiceMailMessage','dir'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xeb83,0x1c3));var _0x3eb8=function(_0x27d4de,_0x3aa8a8){_0x27d4de=_0x27d4de-0x0;var _0x5ca7e5=_0xeb83[_0x27d4de];return _0x5ca7e5;};'use strict';var _=require(_0x3eb8('0x0'));var util=require(_0x3eb8('0x1'));var logger=require(_0x3eb8('0x2'))(_0x3eb8('0x3'));var moment=require(_0x3eb8('0x4'));var BPromise=require('bluebird');var rp=require(_0x3eb8('0x5'));var fs=require('fs');var path=require(_0x3eb8('0x6'));var rimraf=require('rimraf');var config=require(_0x3eb8('0x7'));var attributes=require(_0x3eb8('0x8'));module['exports']=function(_0x5e034d,_0x4cbfb9){return _0x5e034d['define'](_0x3eb8('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x3eb8('0xa'),'fields':[_0x3eb8('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c85cb71..238ce9c 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 _0xeeeb=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xeeeb,0x153));var _0xbeee=function(_0x1355ac,_0xc35a81){_0x1355ac=_0x1355ac-0x0;var _0x53e3fa=_0xeeeb[_0x1355ac];return _0x53e3fa;};'use strict';var _=require('lodash');var util=require(_0xbeee('0x0'));var moment=require('moment');var BPromise=require(_0xbeee('0x1'));var rs=require(_0xbeee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeee('0x3'));var logger=require(_0xbeee('0x4'))(_0xbeee('0x5'));var config=require('../../config/environment');var jayson=require(_0xbeee('0x6'));var client=jayson[_0xbeee('0x7')][_0xbeee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10d0dc,_0x42e460,_0x2204af){return new BPromise(function(_0x2a1f0b,_0x21b085){return client[_0xbeee('0x9')](_0x10d0dc,_0x2204af)['then'](function(_0x520aa8){logger['info'](_0xbeee('0xa'),_0x42e460,_0xbeee('0xb'));logger[_0xbeee('0xc')](_0xbeee('0xd'),_0x42e460,_0xbeee('0xb'),JSON[_0xbeee('0xe')](_0x520aa8));if(_0x520aa8[_0xbeee('0xf')]){if(_0x520aa8['error'][_0xbeee('0x10')]===0x1f4){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x42e460,_0x520aa8[_0xbeee('0xf')][_0xbeee('0x11')]);return _0x21b085(_0x520aa8['error'][_0xbeee('0x11')]);}logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x42e460,_0x520aa8['error'][_0xbeee('0x11')]);return _0x2a1f0b(_0x520aa8[_0xbeee('0xf')][_0xbeee('0x11')]);}else{logger[_0xbeee('0x12')](_0xbeee('0xa'),_0x42e460,_0xbeee('0xb'));_0x2a1f0b(_0x520aa8[_0xbeee('0x13')][_0xbeee('0x11')]);}})['catch'](function(_0x117942){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x42e460,_0x117942);_0x21b085(_0x117942);});});} \ No newline at end of file +var _0x0480=['stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0x0480,0x1a9));var _0x0048=function(_0x41d914,_0x466fc4){_0x41d914=_0x41d914-0x0;var _0x3f1bdd=_0x0480[_0x41d914];return _0x3f1bdd;};'use strict';var _=require(_0x0048('0x0'));var util=require(_0x0048('0x1'));var moment=require(_0x0048('0x2'));var BPromise=require('bluebird');var rs=require(_0x0048('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0048('0x4'))['db'];var utils=require(_0x0048('0x5'));var logger=require(_0x0048('0x6'))(_0x0048('0x7'));var config=require(_0x0048('0x8'));var jayson=require(_0x0048('0x9'));var client=jayson['client'][_0x0048('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x341f1d,_0x380d90,_0x3ac041){return new BPromise(function(_0x1b891a,_0x567a4b){return client[_0x0048('0xb')](_0x341f1d,_0x3ac041)[_0x0048('0xc')](function(_0x23f9f1){logger['info'](_0x0048('0xd'),_0x380d90,'request\x20sent');logger['debug'](_0x0048('0xe'),_0x380d90,_0x0048('0xf'),JSON[_0x0048('0x10')](_0x23f9f1));if(_0x23f9f1[_0x0048('0x11')]){if(_0x23f9f1['error']['code']===0x1f4){logger[_0x0048('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x380d90,_0x23f9f1['error'][_0x0048('0x12')]);return _0x567a4b(_0x23f9f1[_0x0048('0x11')][_0x0048('0x12')]);}logger['error'](_0x0048('0xd'),_0x380d90,_0x23f9f1[_0x0048('0x11')][_0x0048('0x12')]);return _0x1b891a(_0x23f9f1[_0x0048('0x11')][_0x0048('0x12')]);}else{logger['info'](_0x0048('0xd'),_0x380d90,'request\x20sent');_0x1b891a(_0x23f9f1[_0x0048('0x13')][_0x0048('0x12')]);}})[_0x0048('0x14')](function(_0x3ed42c){logger[_0x0048('0x11')](_0x0048('0xd'),_0x380d90,_0x3ed42c);_0x567a4b(_0x3ed42c);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index d8c4a70..111a1a5 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 _0x043a=['delete','destroy','/:id/sounds/:id2','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','show','/:id/sounds','isAuthenticated','getSounds','post','create','addSound','put','/:id','update'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x043a,0x17b));var _0xa043=function(_0x4cda86,_0x573385){_0x4cda86=_0x4cda86-0x0;var _0x20cdad=_0x043a[_0x4cda86];return _0x20cdad;};'use strict';var multer=require(_0xa043('0x0'));var util=require(_0xa043('0x1'));var path=require(_0xa043('0x2'));var timeout=require('connect-timeout');var express=require(_0xa043('0x3'));var router=express['Router']();var fs_extra=require(_0xa043('0x4'));var auth=require(_0xa043('0x5'));var interaction=require(_0xa043('0x6'));var config=require(_0xa043('0x7'));var controller=require(_0xa043('0x8'));router[_0xa043('0x9')]('/',auth['isAuthenticated'](),controller[_0xa043('0xa')]);router[_0xa043('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa043('0xb')]);router['get'](_0xa043('0xc'),auth[_0xa043('0xd')](),controller[_0xa043('0xe')]);router[_0xa043('0xf')]('/',auth['isAuthenticated'](),controller[_0xa043('0x10')]);router[_0xa043('0xf')](_0xa043('0xc'),auth[_0xa043('0xd')](),controller[_0xa043('0x11')]);router[_0xa043('0x12')](_0xa043('0x13'),auth[_0xa043('0xd')](),controller[_0xa043('0x14')]);router[_0xa043('0x15')](_0xa043('0x13'),auth['isAuthenticated'](),controller[_0xa043('0x16')]);router[_0xa043('0x15')](_0xa043('0x17'),auth['isAuthenticated'](),controller['removeSound']);module[_0xa043('0x18')]=router; \ No newline at end of file +var _0x40ae=['get','/:id','show','/:id/sounds','post','create','addSound','put','update','delete','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated'];(function(_0x1ad681,_0x54b109){var _0x4d16e5=function(_0x2ebbb8){while(--_0x2ebbb8){_0x1ad681['push'](_0x1ad681['shift']());}};_0x4d16e5(++_0x54b109);}(_0x40ae,0x85));var _0xe40a=function(_0xf97aa4,_0xc1b468){_0xf97aa4=_0xf97aa4-0x0;var _0x5ebd85=_0x40ae[_0xf97aa4];return _0x5ebd85;};'use strict';var multer=require('multer');var util=require(_0xe40a('0x0'));var path=require(_0xe40a('0x1'));var timeout=require(_0xe40a('0x2'));var express=require(_0xe40a('0x3'));var router=express[_0xe40a('0x4')]();var fs_extra=require(_0xe40a('0x5'));var auth=require(_0xe40a('0x6'));var interaction=require(_0xe40a('0x7'));var config=require(_0xe40a('0x8'));var controller=require(_0xe40a('0x9'));router['get']('/',auth[_0xe40a('0xa')](),controller['index']);router[_0xe40a('0xb')](_0xe40a('0xc'),auth[_0xe40a('0xa')](),controller[_0xe40a('0xd')]);router[_0xe40a('0xb')](_0xe40a('0xe'),auth['isAuthenticated'](),controller['getSounds']);router[_0xe40a('0xf')]('/',auth[_0xe40a('0xa')](),controller[_0xe40a('0x10')]);router[_0xe40a('0xf')](_0xe40a('0xe'),auth[_0xe40a('0xa')](),controller[_0xe40a('0x11')]);router[_0xe40a('0x12')](_0xe40a('0xc'),auth['isAuthenticated'](),controller[_0xe40a('0x13')]);router[_0xe40a('0x14')](_0xe40a('0xc'),auth[_0xe40a('0xa')](),controller['destroy']);router[_0xe40a('0x14')](_0xe40a('0x15'),auth['isAuthenticated'](),controller[_0xe40a('0x16')]);module[_0xe40a('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 c41f8c8..8de6321 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 _0x07b7=['mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','custom','files'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07b7,0x9c));var _0x707b=function(_0x5700d2,_0x59b5fa){_0x5700d2=_0x5700d2-0x0;var _0x25c1e0=_0x07b7[_0x5700d2];return _0x25c1e0;};'use strict';var Sequelize=require('sequelize');module[_0x707b('0x0')]={'name':{'type':Sequelize[_0x707b('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x707b('0x2'),_0x707b('0x3'),'mp3nb','quietmp3nb','quietmp3',_0x707b('0x4')),'allowNull':!![],'defaultValue':_0x707b('0x3')},'directory':{'type':Sequelize[_0x707b('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x707b('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x707b('0x1')],'allowNull':!![],'defaultValue':_0x707b('0x5')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x707b('0x6')},'defaultEntry':{'type':Sequelize[_0x707b('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4cf9=['custom','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name'];(function(_0x28601c,_0x29c450){var _0x1030c7=function(_0x40ae86){while(--_0x40ae86){_0x28601c['push'](_0x28601c['shift']());}};_0x1030c7(++_0x29c450);}(_0x4cf9,0xfa));var _0x94cf=function(_0x1b9078,_0x291bac){_0x1b9078=_0x1b9078-0x0;var _0x4d459a=_0x4cf9[_0x1b9078];return _0x4d459a;};'use strict';var Sequelize=require(_0x94cf('0x0'));module['exports']={'name':{'type':Sequelize[_0x94cf('0x1')],'allowNull':![],'unique':_0x94cf('0x2')},'mode':{'type':Sequelize['ENUM'](_0x94cf('0x3'),_0x94cf('0x4'),_0x94cf('0x5'),_0x94cf('0x6'),'quietmp3',_0x94cf('0x7')),'allowNull':!![],'defaultValue':_0x94cf('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x94cf('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x94cf('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x94cf('0x1')],'allowNull':!![],'defaultValue':_0x94cf('0x8')},'format':{'type':Sequelize[_0x94cf('0x1')],'allowNull':!![]},'stamp':{'type':_0x94cf('0x9')},'defaultEntry':{'type':Sequelize[_0x94cf('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 1007945..d3d8985 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 _0x6bbe=['request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','limit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','show','params','find','body','sequelize','transaction','directory','root','server/files/moh','create','files','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','format','extname','%s.%s','symlinkSync','ValidationError','removeSound','id2','createdAt','getSounds','eml-format','rimraf','fast-json-patch'];(function(_0x3c07b0,_0x4ab6ec){var _0x16b9a8=function(_0x5b5628){while(--_0x5b5628){_0x3c07b0['push'](_0x3c07b0['shift']());}};_0x16b9a8(++_0x4ab6ec);}(_0x6bbe,0xdd));var _0xe6bb=function(_0x577093,_0x34015e){_0x577093=_0x577093-0x0;var _0xffc12e=_0x6bbe[_0x577093];return _0xffc12e;};'use strict';var emlformat=require(_0xe6bb('0x0'));var rimraf=require(_0xe6bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6bb('0x2'));var rp=require(_0xe6bb('0x3'));var moment=require('moment');var BPromise=require(_0xe6bb('0x4'));var Mustache=require('mustache');var util=require(_0xe6bb('0x5'));var path=require(_0xe6bb('0x6'));var sox=require(_0xe6bb('0x7'));var csv=require(_0xe6bb('0x8'));var ejs=require(_0xe6bb('0x9'));var fs=require('fs');var fs_extra=require(_0xe6bb('0xa'));var _=require('lodash');var squel=require(_0xe6bb('0xb'));var crypto=require(_0xe6bb('0xc'));var jsforce=require(_0xe6bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6bb('0xe'));var Papa=require(_0xe6bb('0xf'));var Redis=require('ioredis');var authService=require(_0xe6bb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe6bb('0x11'));var hardwareService=require(_0xe6bb('0x12'));var logger=require(_0xe6bb('0x13'))('api');var utils=require(_0xe6bb('0x14'));var config=require(_0xe6bb('0x15'));var licenseUtil=require(_0xe6bb('0x16'));var db=require(_0xe6bb('0x17'))['db'];function respondWithStatusCode(_0x54f0dc,_0x2312f6){_0x2312f6=_0x2312f6||0xcc;return function(_0x49e25a){if(_0x49e25a){return _0x54f0dc[_0xe6bb('0x18')](_0x2312f6);}return _0x54f0dc[_0xe6bb('0x19')](_0x2312f6)[_0xe6bb('0x1a')]();};}function respondWithResult(_0x386024,_0x54e112){_0x54e112=_0x54e112||0xc8;return function(_0x43d689){if(_0x43d689){return _0x386024[_0xe6bb('0x19')](_0x54e112)[_0xe6bb('0x1b')](_0x43d689);}};}function respondWithFilteredResult(_0x1abe0f,_0xef708b){return function(_0x331651){if(_0x331651){var _0x5a64e7=typeof _0xef708b['offset']===_0xe6bb('0x1c')&&typeof _0xef708b['limit']===_0xe6bb('0x1c');var _0x5a2e71=_0x331651[_0xe6bb('0x1d')];var _0x33b4e0=_0x5a64e7?0x0:_0xef708b['offset'];var _0x13c61a=_0x5a64e7?_0x331651[_0xe6bb('0x1d')]:_0xef708b['offset']+_0xef708b['limit'];var _0xfd1e13;if(_0x13c61a>=_0x5a2e71){_0x13c61a=_0x5a2e71;_0xfd1e13=0xc8;}else{_0xfd1e13=0xce;}_0x1abe0f[_0xe6bb('0x19')](_0xfd1e13);return _0x1abe0f[_0xe6bb('0x1e')](_0xe6bb('0x1f'),_0x33b4e0+'-'+_0x13c61a+'/'+_0x5a2e71)['json'](_0x331651);}return null;};}function patchUpdates(_0x2f6d87){return function(_0x8fabbb){try{jsonpatch[_0xe6bb('0x20')](_0x8fabbb,_0x2f6d87,!![]);}catch(_0x444df0){return BPromise['reject'](_0x444df0);}return _0x8fabbb[_0xe6bb('0x21')]();};}function saveUpdates(_0x36186b,_0x31aba3){return function(_0x25fe35){if(_0x25fe35){return _0x25fe35[_0xe6bb('0x22')](_0x36186b)['then'](function(_0x56d392){return _0x56d392;});}return null;};}function removeEntity(_0x585b00,_0x4aebd0){return function(_0x508178){if(_0x508178){return _0x508178[_0xe6bb('0x23')]()[_0xe6bb('0x24')](function(){var _0x686482=_0x508178[_0xe6bb('0x25')]({'plain':!![]});var _0x18f11d=_0xe6bb('0x26');return db[_0xe6bb('0x27')][_0xe6bb('0x23')]({'where':{'type':_0x18f11d,'resourceId':_0x686482['id']}})[_0xe6bb('0x24')](function(){return _0x508178;});})[_0xe6bb('0x24')](function(){_0x585b00[_0xe6bb('0x19')](0xcc)[_0xe6bb('0x1a')]();});}};}function handleEntityNotFound(_0x3b1efa,_0x366e93){return function(_0x4a1c78){if(!_0x4a1c78){_0x3b1efa[_0xe6bb('0x18')](0x194);}return _0x4a1c78;};}function handleError(_0x363193,_0x4862a7){_0x4862a7=_0x4862a7||0x1f4;return function(_0x5e85b8){logger['error'](_0x5e85b8[_0xe6bb('0x28')]);if(_0x5e85b8[_0xe6bb('0x29')]){delete _0x5e85b8[_0xe6bb('0x29')];}_0x363193[_0xe6bb('0x19')](_0x4862a7)[_0xe6bb('0x2a')](_0x5e85b8);};}exports[_0xe6bb('0x2b')]=function(_0x454555,_0x579901){var _0x25062e={},_0x196103={},_0x55a9ad={'count':0x0,'rows':[]};var _0x5e3cb1=_[_0xe6bb('0x2c')](db['VoiceMusicOnHold'][_0xe6bb('0x2d')],function(_0x428ecc){return{'name':_0x428ecc[_0xe6bb('0x2e')],'type':_0x428ecc['type']['key']};});_0x196103[_0xe6bb('0x2f')]=_[_0xe6bb('0x2c')](_0x5e3cb1,_0xe6bb('0x29'));_0x196103['query']=_[_0xe6bb('0x30')](_0x454555[_0xe6bb('0x31')]);_0x196103['filters']=_['intersection'](_0x196103[_0xe6bb('0x2f')],_0x196103[_0xe6bb('0x31')]);_0x25062e[_0xe6bb('0x32')]=_[_0xe6bb('0x33')](_0x196103[_0xe6bb('0x2f')],qs['fields'](_0x454555['query'][_0xe6bb('0x34')]));_0x25062e[_0xe6bb('0x32')]=_0x25062e[_0xe6bb('0x32')][_0xe6bb('0x35')]?_0x25062e[_0xe6bb('0x32')]:_0x196103[_0xe6bb('0x2f')];if(!_0x454555[_0xe6bb('0x31')][_0xe6bb('0x36')]('nolimit')){_0x25062e[_0xe6bb('0x37')]=qs[_0xe6bb('0x37')](_0x454555[_0xe6bb('0x31')][_0xe6bb('0x37')]);_0x25062e[_0xe6bb('0x38')]=qs[_0xe6bb('0x38')](_0x454555[_0xe6bb('0x31')][_0xe6bb('0x38')]);}_0x25062e[_0xe6bb('0x39')]=qs['sort'](_0x454555['query'][_0xe6bb('0x3a')]);delete _0x454555[_0xe6bb('0x31')][_0xe6bb('0x3a')];_0x25062e[_0xe6bb('0x3b')]=qs[_0xe6bb('0x3c')](_[_0xe6bb('0x3d')](_0x454555['query'],_0x196103[_0xe6bb('0x3c')]),_0x5e3cb1);if(_0x454555[_0xe6bb('0x31')][_0xe6bb('0x3e')]){_0x25062e[_0xe6bb('0x3b')]=_['merge'](_0x25062e[_0xe6bb('0x3b')],{'$or':_[_0xe6bb('0x2c')](_0x5e3cb1,function(_0x496e89){if(_0x496e89['type']!==_0xe6bb('0x3f')){var _0x2dc36f={};_0x2dc36f[_0x496e89['name']]={'$like':'%'+_0x454555[_0xe6bb('0x31')]['filter']+'%'};return _0x2dc36f;}})});}_0x25062e=_[_0xe6bb('0x40')]({},_0x25062e,_0x454555[_0xe6bb('0x41')]);var _0x533700={'where':_0x25062e[_0xe6bb('0x3b')]};return db['VoiceMusicOnHold'][_0xe6bb('0x1d')](_0x533700)[_0xe6bb('0x24')](function(_0x57619c){_0x55a9ad[_0xe6bb('0x1d')]=_0x57619c;if(_0x454555[_0xe6bb('0x31')][_0xe6bb('0x42')]){_0x25062e[_0xe6bb('0x43')]=[{'all':!![]}];}return db[_0xe6bb('0x44')][_0xe6bb('0x45')](_0x25062e);})[_0xe6bb('0x24')](function(_0x4c27a2){_0x55a9ad[_0xe6bb('0x46')]=_0x4c27a2;return _0x55a9ad;})[_0xe6bb('0x24')](respondWithFilteredResult(_0x579901,_0x25062e))[_0xe6bb('0x47')](handleError(_0x579901,null));};exports[_0xe6bb('0x48')]=function(_0x3356db,_0x1e70a9){var _0x59cbdb={'raw':![],'where':{'id':_0x3356db[_0xe6bb('0x49')]['id']}},_0x4e0533={};_0x4e0533[_0xe6bb('0x2f')]=_[_0xe6bb('0x30')](db['VoiceMusicOnHold'][_0xe6bb('0x2d')]);_0x4e0533[_0xe6bb('0x31')]=_['keys'](_0x3356db[_0xe6bb('0x31')]);_0x4e0533[_0xe6bb('0x3c')]=_[_0xe6bb('0x33')](_0x4e0533[_0xe6bb('0x2f')],_0x4e0533[_0xe6bb('0x31')]);_0x59cbdb['attributes']=_['intersection'](_0x4e0533[_0xe6bb('0x2f')],qs['fields'](_0x3356db[_0xe6bb('0x31')][_0xe6bb('0x34')]));_0x59cbdb[_0xe6bb('0x32')]=_0x59cbdb[_0xe6bb('0x32')][_0xe6bb('0x35')]?_0x59cbdb[_0xe6bb('0x32')]:_0x4e0533['model'];if(_0x3356db['query'][_0xe6bb('0x42')]){_0x59cbdb['include']=[{'all':!![]}];}_0x59cbdb=_[_0xe6bb('0x40')]({},_0x59cbdb,_0x3356db[_0xe6bb('0x41')]);return db[_0xe6bb('0x44')][_0xe6bb('0x4a')](_0x59cbdb)[_0xe6bb('0x24')](handleEntityNotFound(_0x1e70a9,null))[_0xe6bb('0x24')](respondWithResult(_0x1e70a9,null))[_0xe6bb('0x47')](handleError(_0x1e70a9,null));};exports['update']=function(_0x45794c,_0x551676){if(_0x45794c[_0xe6bb('0x4b')]['id']){delete _0x45794c[_0xe6bb('0x4b')]['id'];}return db[_0xe6bb('0x44')][_0xe6bb('0x4a')]({'where':{'id':_0x45794c['params']['id']}})[_0xe6bb('0x24')](handleEntityNotFound(_0x551676,null))[_0xe6bb('0x24')](saveUpdates(_0x45794c[_0xe6bb('0x4b')],null))[_0xe6bb('0x24')](respondWithResult(_0x551676,null))[_0xe6bb('0x47')](handleError(_0x551676,null));};exports['create']=function(_0x1fa704,_0x15bf4c,_0x228358){return db[_0xe6bb('0x4c')][_0xe6bb('0x4d')](function(_0x1d4bbe){if(_0x1fa704['body']['mode']==='files'){_0x1fa704['body'][_0xe6bb('0x4e')]=path['join'](config[_0xe6bb('0x4f')],_0xe6bb('0x50'),_0x1fa704[_0xe6bb('0x4b')][_0xe6bb('0x29')]);}return db[_0xe6bb('0x44')][_0xe6bb('0x51')](_0x1fa704[_0xe6bb('0x4b')],{'transaction':_0x1d4bbe})['then'](function(_0x22d093){if(_0x1fa704[_0xe6bb('0x4b')]['mode']===_0xe6bb('0x52')){fs[_0xe6bb('0x53')](_0x22d093[_0xe6bb('0x4e')],parseInt(_0xe6bb('0x54'),0x8));}var _0xa7122a=_0x1fa704[_0xe6bb('0x55')][_0xe6bb('0x25')]({'plain':!![]});if(!_0xa7122a)throw new Error(_0xe6bb('0x56'));if(_0xa7122a[_0xe6bb('0x57')]===_0xe6bb('0x55')){var _0x2b0b69=_0x22d093[_0xe6bb('0x25')]({'plain':!![]});return db[_0xe6bb('0x58')]['find']({'where':{'name':_0xe6bb('0x26'),'userProfileId':_0xa7122a[_0xe6bb('0x59')]},'raw':!![]})[_0xe6bb('0x24')](function(_0x59ff44){if(_0x59ff44&&_0x59ff44['autoAssociation']===0x0){return db[_0xe6bb('0x27')]['create']({'name':_0x2b0b69[_0xe6bb('0x29')],'resourceId':_0x2b0b69['id'],'type':_0x59ff44[_0xe6bb('0x29')],'sectionId':_0x59ff44['id']},{})[_0xe6bb('0x24')](function(){return _0x22d093;});}else{return _0x22d093;}})[_0xe6bb('0x47')](function(_0x40f290){logger['error'](_0xe6bb('0x5a'),_0x40f290);});}return _0x22d093;});})[_0xe6bb('0x24')](respondWithResult(_0x15bf4c,0xc9))[_0xe6bb('0x47')](handleError(_0x15bf4c,null));};exports[_0xe6bb('0x23')]=function(_0x48e2e6,_0x10855d,_0x1a2052){var _0x2b4bf5;return db[_0xe6bb('0x44')][_0xe6bb('0x4a')]({'where':{'id':_0x48e2e6[_0xe6bb('0x49')]['id']}})['then'](function(_0x515fcc){if(_0x515fcc){return db[_0xe6bb('0x4c')][_0xe6bb('0x4d')](function(_0x1f38ed){return _0x515fcc[_0xe6bb('0x23')]({'transaction':_0x1f38ed,'raw':!![]})[_0xe6bb('0x24')](function(_0x58f44e){if(_0x58f44e[_0xe6bb('0x4e')]){fs[_0xe6bb('0x5b')](_0x58f44e['directory'])[_0xe6bb('0x5c')](function(_0x497b22){fs[_0xe6bb('0x5d')](path[_0xe6bb('0x5e')](_0x58f44e[_0xe6bb('0x4e')],_0x497b22));});fs[_0xe6bb('0x5f')](_0x58f44e[_0xe6bb('0x4e')]);}return _0x58f44e;});})['catch'](function(_0x41bbc0){throw new db[(_0xe6bb('0x60'))]['ValidationError'](_0x41bbc0[_0xe6bb('0x61')]);});}})['then'](handleEntityNotFound(_0x10855d,null))[_0xe6bb('0x24')](removeEntity(_0x10855d,null))[_0xe6bb('0x47')](handleError(_0x10855d,null));};exports[_0xe6bb('0x62')]=function(_0x4c916f,_0x103479,_0x3563d7){return db[_0xe6bb('0x4c')][_0xe6bb('0x4d')](function(_0x585bd3){var _0x59124c;return db['VoiceMusicOnHold'][_0xe6bb('0x4a')]({'where':{'id':_0x4c916f[_0xe6bb('0x49')]['id']}})[_0xe6bb('0x24')](function(_0x5485f4){if(_0x5485f4){_0x59124c=_0x5485f4;return _0x5485f4[_0xe6bb('0x62')](_0x4c916f['body']['id'],{'transaction':_0x585bd3});}})[_0xe6bb('0x24')](function(_0x345f54){if(_0x345f54){return db[_0xe6bb('0x63')][_0xe6bb('0x64')]({'where':{'id':_0x4c916f[_0xe6bb('0x4b')]['id']},'attributes':['id','name',_0xe6bb('0x65'),_0xe6bb('0x66'),'createdAt'],'raw':!![]});}})[_0xe6bb('0x24')](function(_0x380057){if(_0x380057){var _0x5315f1=path['join'](config[_0xe6bb('0x4f')],'server/files/sounds/converted',util[_0xe6bb('0x67')]('%s.%s',path['basename'](_0x380057['save_name'],path[_0xe6bb('0x68')](_0x380057[_0xe6bb('0x65')])),_0x380057['converted_format']));var _0x335327=path[_0xe6bb('0x5e')](config[_0xe6bb('0x4f')],_0xe6bb('0x50'),_0x59124c[_0xe6bb('0x29')],util[_0xe6bb('0x67')](_0xe6bb('0x69'),_0x380057[_0xe6bb('0x29')],_0x380057[_0xe6bb('0x66')]));fs[_0xe6bb('0x6a')](_0x5315f1,_0x335327);return _0x380057;}})[_0xe6bb('0x47')](function(_0x13dc1b){throw new db['Sequelize'][(_0xe6bb('0x6b'))](_0x13dc1b[_0xe6bb('0x61')]);});})['then'](handleEntityNotFound(_0x103479,null))[_0xe6bb('0x24')](respondWithResult(_0x103479,0xc9))[_0xe6bb('0x47')](handleError(_0x103479,null));};exports[_0xe6bb('0x6c')]=function(_0x5e1cef,_0x72e794,_0x1f8be0){return db[_0xe6bb('0x4c')]['transaction'](function(_0xc2246f){var _0x3f1195;return db[_0xe6bb('0x44')]['findOne']({'where':{'id':_0x5e1cef[_0xe6bb('0x49')]['id']}})[_0xe6bb('0x24')](handleEntityNotFound(_0x72e794,null))[_0xe6bb('0x24')](function(_0x2957c4){if(_0x2957c4){_0x3f1195=_0x2957c4;return _0x2957c4[_0xe6bb('0x6c')](_0x5e1cef[_0xe6bb('0x49')][_0xe6bb('0x6d')]);}})['then'](function(_0x4d3c18){if(_0x4d3c18){return db[_0xe6bb('0x63')]['findOne']({'where':{'id':_0x5e1cef[_0xe6bb('0x49')]['id2']},'attributes':['id','name',_0xe6bb('0x65'),_0xe6bb('0x66'),_0xe6bb('0x6e')],'raw':!![]});}})[_0xe6bb('0x24')](function(_0x5afac6){if(_0x5afac6){fs[_0xe6bb('0x5d')](path['join'](_0x3f1195[_0xe6bb('0x4e')],util[_0xe6bb('0x67')](_0xe6bb('0x69'),_0x5afac6[_0xe6bb('0x29')],_0x5afac6[_0xe6bb('0x66')])));return _0x5afac6;}})[_0xe6bb('0x47')](function(_0x3df8cf){throw new db['Sequelize'][(_0xe6bb('0x6b'))](_0x3df8cf[_0xe6bb('0x61')]);});})['then'](handleEntityNotFound(_0x72e794,null))[_0xe6bb('0x24')](respondWithStatusCode(_0x72e794,0xcc))['catch'](handleError(_0x72e794,null));};exports[_0xe6bb('0x6f')]=function(_0x184dfa,_0x4f18c7,_0x1dbc0d){var _0x3d6b77={};var _0xd2e618={};var _0xb6223f;var _0x552677;return db[_0xe6bb('0x44')]['findOne']({'where':{'id':_0x184dfa[_0xe6bb('0x49')]['id']}})[_0xe6bb('0x24')](handleEntityNotFound(_0x4f18c7,null))['then'](function(_0x3643bf){if(_0x3643bf){_0xb6223f=_0x3643bf;_0xd2e618[_0xe6bb('0x2f')]=_[_0xe6bb('0x30')](db[_0xe6bb('0x63')][_0xe6bb('0x2d')]);_0xd2e618[_0xe6bb('0x31')]=_[_0xe6bb('0x30')](_0x184dfa[_0xe6bb('0x31')]);_0xd2e618[_0xe6bb('0x3c')]=_[_0xe6bb('0x33')](_0xd2e618[_0xe6bb('0x2f')],_0xd2e618[_0xe6bb('0x31')]);_0x3d6b77['attributes']=_[_0xe6bb('0x33')](_0xd2e618[_0xe6bb('0x2f')],qs[_0xe6bb('0x34')](_0x184dfa['query']['fields']));_0x3d6b77[_0xe6bb('0x32')]=_0x3d6b77[_0xe6bb('0x32')]['length']?_0x3d6b77[_0xe6bb('0x32')]:_0xd2e618[_0xe6bb('0x2f')];_0x3d6b77['order']=qs[_0xe6bb('0x3a')](_0x184dfa[_0xe6bb('0x31')]['sort']);_0x3d6b77[_0xe6bb('0x3b')]=qs[_0xe6bb('0x3c')](_['pick'](_0x184dfa[_0xe6bb('0x31')],_0xd2e618[_0xe6bb('0x3c')]));if(_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x3e')]){_0x3d6b77[_0xe6bb('0x3b')]=_[_0xe6bb('0x40')](_0x3d6b77[_0xe6bb('0x3b')],{'$or':_[_0xe6bb('0x2c')](_0x3d6b77[_0xe6bb('0x32')],function(_0x39778a){var _0x285fed={};_0x285fed[_0x39778a]={'$like':'%'+_0x184dfa[_0xe6bb('0x31')]['filter']+'%'};return _0x285fed;})});}_0x3d6b77=_[_0xe6bb('0x40')]({},_0x3d6b77,_0x184dfa[_0xe6bb('0x41')]);return _0xb6223f[_0xe6bb('0x6f')](_0x3d6b77);}})[_0xe6bb('0x24')](function(_0x42fa71){if(_0x42fa71){_0x552677=_0x42fa71[_0xe6bb('0x35')];if(!_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x36')]('nolimit')){_0x3d6b77['limit']=qs[_0xe6bb('0x37')](_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x37')]);_0x3d6b77[_0xe6bb('0x38')]=qs[_0xe6bb('0x38')](_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x38')]);}return _0xb6223f[_0xe6bb('0x6f')](_0x3d6b77);}})[_0xe6bb('0x24')](function(_0x4c383c){if(_0x4c383c){return _0x4c383c?{'count':_0x552677,'rows':_0x4c383c}:null;}})[_0xe6bb('0x24')](respondWithResult(_0x4f18c7,null))[_0xe6bb('0x47')](handleError(_0x4f18c7,null));}; \ No newline at end of file +var _0x7fe5=['UserProfileResource','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','save_name','symlinkSync','removeSound','getSounds','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','MusicOnHolds','destroy','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','find','catch','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation'];(function(_0x533bf7,_0x29485b){var _0x9e4c57=function(_0xe4211f){while(--_0xe4211f){_0x533bf7['push'](_0x533bf7['shift']());}};_0x9e4c57(++_0x29485b);}(_0x7fe5,0xf8));var _0x57fe=function(_0x12fc36,_0x6530d3){_0x12fc36=_0x12fc36-0x0;var _0x55c667=_0x7fe5[_0x12fc36];return _0x55c667;};'use strict';var emlformat=require(_0x57fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x57fe('0x1'));var jsonpatch=require(_0x57fe('0x2'));var rp=require(_0x57fe('0x3'));var moment=require(_0x57fe('0x4'));var BPromise=require(_0x57fe('0x5'));var Mustache=require(_0x57fe('0x6'));var util=require('util');var path=require(_0x57fe('0x7'));var sox=require('sox');var csv=require(_0x57fe('0x8'));var ejs=require(_0x57fe('0x9'));var fs=require('fs');var fs_extra=require(_0x57fe('0xa'));var _=require('lodash');var squel=require(_0x57fe('0xb'));var crypto=require(_0x57fe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x57fe('0xd'));var toCsv=require(_0x57fe('0x8'));var querystring=require(_0x57fe('0xe'));var Papa=require(_0x57fe('0xf'));var Redis=require(_0x57fe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x57fe('0x11'));var as=require(_0x57fe('0x12'));var hardwareService=require(_0x57fe('0x13'));var logger=require('../../config/logger')(_0x57fe('0x14'));var utils=require(_0x57fe('0x15'));var config=require(_0x57fe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x57fe('0x17'))['db'];function respondWithStatusCode(_0x55fc36,_0x185739){_0x185739=_0x185739||0xcc;return function(_0x35259d){if(_0x35259d){return _0x55fc36[_0x57fe('0x18')](_0x185739);}return _0x55fc36[_0x57fe('0x19')](_0x185739)[_0x57fe('0x1a')]();};}function respondWithResult(_0x375c8e,_0x4b7f85){_0x4b7f85=_0x4b7f85||0xc8;return function(_0x3559f6){if(_0x3559f6){return _0x375c8e[_0x57fe('0x19')](_0x4b7f85)[_0x57fe('0x1b')](_0x3559f6);}};}function respondWithFilteredResult(_0x15562e,_0x2d4b86){return function(_0xb18d8d){if(_0xb18d8d){var _0x2eb950=typeof _0x2d4b86[_0x57fe('0x1c')]===_0x57fe('0x1d')&&typeof _0x2d4b86[_0x57fe('0x1e')]===_0x57fe('0x1d');var _0x4b3206=_0xb18d8d[_0x57fe('0x1f')];var _0x2572bb=_0x2eb950?0x0:_0x2d4b86['offset'];var _0x4d39a2=_0x2eb950?_0xb18d8d['count']:_0x2d4b86[_0x57fe('0x1c')]+_0x2d4b86['limit'];var _0x314df1;if(_0x4d39a2>=_0x4b3206){_0x4d39a2=_0x4b3206;_0x314df1=0xc8;}else{_0x314df1=0xce;}_0x15562e['status'](_0x314df1);return _0x15562e[_0x57fe('0x20')]('Content-Range',_0x2572bb+'-'+_0x4d39a2+'/'+_0x4b3206)[_0x57fe('0x1b')](_0xb18d8d);}return null;};}function patchUpdates(_0x7e78ad){return function(_0x3429f4){try{jsonpatch[_0x57fe('0x21')](_0x3429f4,_0x7e78ad,!![]);}catch(_0x4f81ef){return BPromise[_0x57fe('0x22')](_0x4f81ef);}return _0x3429f4['save']();};}function saveUpdates(_0xc3e66,_0x4a491e){return function(_0x407dcf){if(_0x407dcf){return _0x407dcf[_0x57fe('0x23')](_0xc3e66)[_0x57fe('0x24')](function(_0x30af2a){return _0x30af2a;});}return null;};}function removeEntity(_0x5a075a,_0x2f9d04){return function(_0x2d5779){if(_0x2d5779){return _0x2d5779['destroy']()[_0x57fe('0x24')](function(){var _0x111602=_0x2d5779[_0x57fe('0x25')]({'plain':!![]});var _0x49c005=_0x57fe('0x26');return db['UserProfileResource'][_0x57fe('0x27')]({'where':{'type':_0x49c005,'resourceId':_0x111602['id']}})[_0x57fe('0x24')](function(){return _0x2d5779;});})[_0x57fe('0x24')](function(){_0x5a075a[_0x57fe('0x19')](0xcc)[_0x57fe('0x1a')]();});}};}function handleEntityNotFound(_0x1a717c,_0x2ac03d){return function(_0x47b412){if(!_0x47b412){_0x1a717c['sendStatus'](0x194);}return _0x47b412;};}function handleError(_0x331e14,_0x5e6d0b){_0x5e6d0b=_0x5e6d0b||0x1f4;return function(_0x3ef87e){logger[_0x57fe('0x28')](_0x3ef87e[_0x57fe('0x29')]);if(_0x3ef87e[_0x57fe('0x2a')]){delete _0x3ef87e[_0x57fe('0x2a')];}_0x331e14['status'](_0x5e6d0b)[_0x57fe('0x2b')](_0x3ef87e);};}exports[_0x57fe('0x2c')]=function(_0x1b84d4,_0x19b903){var _0x263602={},_0x1358c1={},_0x137f49={'count':0x0,'rows':[]};var _0xe6cb16=_['map'](db[_0x57fe('0x2d')][_0x57fe('0x2e')],function(_0x1b7ade){return{'name':_0x1b7ade[_0x57fe('0x2f')],'type':_0x1b7ade['type'][_0x57fe('0x30')]};});_0x1358c1['model']=_[_0x57fe('0x31')](_0xe6cb16,'name');_0x1358c1[_0x57fe('0x32')]=_[_0x57fe('0x33')](_0x1b84d4[_0x57fe('0x32')]);_0x1358c1[_0x57fe('0x34')]=_['intersection'](_0x1358c1[_0x57fe('0x35')],_0x1358c1[_0x57fe('0x32')]);_0x263602[_0x57fe('0x36')]=_[_0x57fe('0x37')](_0x1358c1['model'],qs[_0x57fe('0x38')](_0x1b84d4[_0x57fe('0x32')]['fields']));_0x263602[_0x57fe('0x36')]=_0x263602['attributes'][_0x57fe('0x39')]?_0x263602[_0x57fe('0x36')]:_0x1358c1[_0x57fe('0x35')];if(!_0x1b84d4[_0x57fe('0x32')]['hasOwnProperty']('nolimit')){_0x263602[_0x57fe('0x1e')]=qs['limit'](_0x1b84d4[_0x57fe('0x32')][_0x57fe('0x1e')]);_0x263602['offset']=qs[_0x57fe('0x1c')](_0x1b84d4[_0x57fe('0x32')][_0x57fe('0x1c')]);}_0x263602[_0x57fe('0x3a')]=qs[_0x57fe('0x3b')](_0x1b84d4[_0x57fe('0x32')][_0x57fe('0x3b')]);delete _0x1b84d4[_0x57fe('0x32')][_0x57fe('0x3b')];_0x263602[_0x57fe('0x3c')]=qs[_0x57fe('0x34')](_[_0x57fe('0x3d')](_0x1b84d4[_0x57fe('0x32')],_0x1358c1[_0x57fe('0x34')]),_0xe6cb16);if(_0x1b84d4['query'][_0x57fe('0x3e')]){_0x263602[_0x57fe('0x3c')]=_[_0x57fe('0x3f')](_0x263602[_0x57fe('0x3c')],{'$or':_[_0x57fe('0x31')](_0xe6cb16,function(_0x4af5f9){if(_0x4af5f9['type']!==_0x57fe('0x40')){var _0x864d3e={};_0x864d3e[_0x4af5f9[_0x57fe('0x2a')]]={'$like':'%'+_0x1b84d4[_0x57fe('0x32')]['filter']+'%'};return _0x864d3e;}})});}_0x263602=_['merge']({},_0x263602,_0x1b84d4[_0x57fe('0x41')]);var _0x4ced6c={'where':_0x263602[_0x57fe('0x3c')]};return db[_0x57fe('0x2d')][_0x57fe('0x1f')](_0x4ced6c)[_0x57fe('0x24')](function(_0x2991df){_0x137f49[_0x57fe('0x1f')]=_0x2991df;if(_0x1b84d4[_0x57fe('0x32')][_0x57fe('0x42')]){_0x263602[_0x57fe('0x43')]=[{'all':!![]}];}return db[_0x57fe('0x2d')]['findAll'](_0x263602);})[_0x57fe('0x24')](function(_0x3d1186){_0x137f49['rows']=_0x3d1186;return _0x137f49;})[_0x57fe('0x24')](respondWithFilteredResult(_0x19b903,_0x263602))['catch'](handleError(_0x19b903,null));};exports['show']=function(_0x52ad3a,_0x52ebce){var _0x4e7727={'raw':![],'where':{'id':_0x52ad3a[_0x57fe('0x44')]['id']}},_0x2ba93c={};_0x2ba93c[_0x57fe('0x35')]=_[_0x57fe('0x33')](db['VoiceMusicOnHold']['rawAttributes']);_0x2ba93c[_0x57fe('0x32')]=_[_0x57fe('0x33')](_0x52ad3a[_0x57fe('0x32')]);_0x2ba93c[_0x57fe('0x34')]=_[_0x57fe('0x37')](_0x2ba93c['model'],_0x2ba93c[_0x57fe('0x32')]);_0x4e7727[_0x57fe('0x36')]=_[_0x57fe('0x37')](_0x2ba93c[_0x57fe('0x35')],qs[_0x57fe('0x38')](_0x52ad3a[_0x57fe('0x32')][_0x57fe('0x38')]));_0x4e7727[_0x57fe('0x36')]=_0x4e7727[_0x57fe('0x36')]['length']?_0x4e7727[_0x57fe('0x36')]:_0x2ba93c[_0x57fe('0x35')];if(_0x52ad3a[_0x57fe('0x32')][_0x57fe('0x42')]){_0x4e7727['include']=[{'all':!![]}];}_0x4e7727=_[_0x57fe('0x3f')]({},_0x4e7727,_0x52ad3a[_0x57fe('0x41')]);return db[_0x57fe('0x2d')][_0x57fe('0x45')](_0x4e7727)[_0x57fe('0x24')](handleEntityNotFound(_0x52ebce,null))['then'](respondWithResult(_0x52ebce,null))[_0x57fe('0x46')](handleError(_0x52ebce,null));};exports['update']=function(_0x5f8297,_0xd76560){if(_0x5f8297[_0x57fe('0x47')]['id']){delete _0x5f8297[_0x57fe('0x47')]['id'];}return db[_0x57fe('0x2d')]['find']({'where':{'id':_0x5f8297[_0x57fe('0x44')]['id']}})[_0x57fe('0x24')](handleEntityNotFound(_0xd76560,null))[_0x57fe('0x24')](saveUpdates(_0x5f8297['body'],null))[_0x57fe('0x24')](respondWithResult(_0xd76560,null))[_0x57fe('0x46')](handleError(_0xd76560,null));};exports[_0x57fe('0x48')]=function(_0x359cf1,_0x41930f,_0x123e6f){return db[_0x57fe('0x49')][_0x57fe('0x4a')](function(_0x22fb04){if(_0x359cf1[_0x57fe('0x47')]['mode']===_0x57fe('0x4b')){_0x359cf1[_0x57fe('0x47')][_0x57fe('0x4c')]=path[_0x57fe('0x4d')](config[_0x57fe('0x4e')],_0x57fe('0x4f'),_0x359cf1[_0x57fe('0x47')][_0x57fe('0x2a')]);}return db[_0x57fe('0x2d')][_0x57fe('0x48')](_0x359cf1[_0x57fe('0x47')],{'transaction':_0x22fb04})[_0x57fe('0x24')](function(_0x293e0c){if(_0x359cf1[_0x57fe('0x47')][_0x57fe('0x50')]===_0x57fe('0x4b')){fs[_0x57fe('0x51')](_0x293e0c[_0x57fe('0x4c')],parseInt(_0x57fe('0x52'),0x8));}var _0x434d9b=_0x359cf1['user']['get']({'plain':!![]});if(!_0x434d9b)throw new Error(_0x57fe('0x53'));if(_0x434d9b[_0x57fe('0x54')]===_0x57fe('0x55')){var _0x17da9c=_0x293e0c[_0x57fe('0x25')]({'plain':!![]});return db[_0x57fe('0x56')]['find']({'where':{'name':_0x57fe('0x26'),'userProfileId':_0x434d9b['userProfileId']},'raw':!![]})[_0x57fe('0x24')](function(_0x2f25e6){if(_0x2f25e6&&_0x2f25e6[_0x57fe('0x57')]===0x0){return db[_0x57fe('0x58')][_0x57fe('0x48')]({'name':_0x17da9c[_0x57fe('0x2a')],'resourceId':_0x17da9c['id'],'type':_0x2f25e6[_0x57fe('0x2a')],'sectionId':_0x2f25e6['id']},{})[_0x57fe('0x24')](function(){return _0x293e0c;});}else{return _0x293e0c;}})[_0x57fe('0x46')](function(_0x22c746){logger[_0x57fe('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22c746);});}return _0x293e0c;});})[_0x57fe('0x24')](respondWithResult(_0x41930f,0xc9))['catch'](handleError(_0x41930f,null));};exports[_0x57fe('0x27')]=function(_0x1f5ef9,_0x41c88d,_0xcfff7d){var _0x3ea50f;return db[_0x57fe('0x2d')][_0x57fe('0x45')]({'where':{'id':_0x1f5ef9[_0x57fe('0x44')]['id']}})['then'](function(_0x4a6e33){if(_0x4a6e33){return db['sequelize'][_0x57fe('0x4a')](function(_0xd11dc8){return _0x4a6e33['destroy']({'transaction':_0xd11dc8,'raw':!![]})[_0x57fe('0x24')](function(_0x5cbb73){if(_0x5cbb73[_0x57fe('0x4c')]){fs[_0x57fe('0x59')](_0x5cbb73['directory'])[_0x57fe('0x5a')](function(_0x50bb83){fs[_0x57fe('0x5b')](path['join'](_0x5cbb73[_0x57fe('0x4c')],_0x50bb83));});fs[_0x57fe('0x5c')](_0x5cbb73[_0x57fe('0x4c')]);}return _0x5cbb73;});})['catch'](function(_0x45d39f){throw new db[(_0x57fe('0x5d'))][(_0x57fe('0x5e'))](_0x45d39f[_0x57fe('0x5f')]);});}})[_0x57fe('0x24')](handleEntityNotFound(_0x41c88d,null))[_0x57fe('0x24')](removeEntity(_0x41c88d,null))[_0x57fe('0x46')](handleError(_0x41c88d,null));};exports[_0x57fe('0x60')]=function(_0x554460,_0x104c28,_0x1637f9){return db[_0x57fe('0x49')]['transaction'](function(_0x19e192){var _0xa109ca;return db[_0x57fe('0x2d')]['find']({'where':{'id':_0x554460['params']['id']}})[_0x57fe('0x24')](function(_0x3bb25a){if(_0x3bb25a){_0xa109ca=_0x3bb25a;return _0x3bb25a[_0x57fe('0x60')](_0x554460[_0x57fe('0x47')]['id'],{'transaction':_0x19e192});}})[_0x57fe('0x24')](function(_0x4da592){if(_0x4da592){return db[_0x57fe('0x61')][_0x57fe('0x62')]({'where':{'id':_0x554460[_0x57fe('0x47')]['id']},'attributes':['id','name','save_name',_0x57fe('0x63'),_0x57fe('0x64')],'raw':!![]});}})[_0x57fe('0x24')](function(_0x4f7845){if(_0x4f7845){var _0x19084b=path[_0x57fe('0x4d')](config[_0x57fe('0x4e')],_0x57fe('0x65'),util[_0x57fe('0x66')](_0x57fe('0x67'),path[_0x57fe('0x68')](_0x4f7845['save_name'],path[_0x57fe('0x69')](_0x4f7845[_0x57fe('0x6a')])),_0x4f7845['converted_format']));var _0x58fda2=path[_0x57fe('0x4d')](config['root'],_0x57fe('0x4f'),_0xa109ca[_0x57fe('0x2a')],util[_0x57fe('0x66')](_0x57fe('0x67'),_0x4f7845[_0x57fe('0x2a')],_0x4f7845[_0x57fe('0x63')]));fs[_0x57fe('0x6b')](_0x19084b,_0x58fda2);return _0x4f7845;}})[_0x57fe('0x46')](function(_0x607c2){throw new db[(_0x57fe('0x5d'))][(_0x57fe('0x5e'))](_0x607c2['message']);});})[_0x57fe('0x24')](handleEntityNotFound(_0x104c28,null))[_0x57fe('0x24')](respondWithResult(_0x104c28,0xc9))[_0x57fe('0x46')](handleError(_0x104c28,null));};exports[_0x57fe('0x6c')]=function(_0x4b2fd9,_0x475695,_0x49742d){return db[_0x57fe('0x49')]['transaction'](function(_0x353307){var _0x22cb78;return db[_0x57fe('0x2d')][_0x57fe('0x62')]({'where':{'id':_0x4b2fd9['params']['id']}})['then'](handleEntityNotFound(_0x475695,null))[_0x57fe('0x24')](function(_0x586a79){if(_0x586a79){_0x22cb78=_0x586a79;return _0x586a79[_0x57fe('0x6c')](_0x4b2fd9[_0x57fe('0x44')]['id2']);}})[_0x57fe('0x24')](function(_0x5f5300){if(_0x5f5300){return db[_0x57fe('0x61')][_0x57fe('0x62')]({'where':{'id':_0x4b2fd9[_0x57fe('0x44')]['id2']},'attributes':['id',_0x57fe('0x2a'),_0x57fe('0x6a'),'converted_format','createdAt'],'raw':!![]});}})[_0x57fe('0x24')](function(_0x58f46f){if(_0x58f46f){fs['unlinkSync'](path[_0x57fe('0x4d')](_0x22cb78[_0x57fe('0x4c')],util[_0x57fe('0x66')](_0x57fe('0x67'),_0x58f46f[_0x57fe('0x2a')],_0x58f46f['converted_format'])));return _0x58f46f;}})[_0x57fe('0x46')](function(_0x541ea5){throw new db[(_0x57fe('0x5d'))][(_0x57fe('0x5e'))](_0x541ea5[_0x57fe('0x5f')]);});})[_0x57fe('0x24')](handleEntityNotFound(_0x475695,null))['then'](respondWithStatusCode(_0x475695,0xcc))[_0x57fe('0x46')](handleError(_0x475695,null));};exports[_0x57fe('0x6d')]=function(_0x4247ab,_0x5d17d3,_0x455269){var _0x3d182b={};var _0x1027f8={};var _0x434c79;var _0x29be2c;return db[_0x57fe('0x2d')][_0x57fe('0x62')]({'where':{'id':_0x4247ab[_0x57fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d17d3,null))[_0x57fe('0x24')](function(_0xc3e10d){if(_0xc3e10d){_0x434c79=_0xc3e10d;_0x1027f8[_0x57fe('0x35')]=_['keys'](db[_0x57fe('0x61')]['rawAttributes']);_0x1027f8[_0x57fe('0x32')]=_[_0x57fe('0x33')](_0x4247ab['query']);_0x1027f8[_0x57fe('0x34')]=_[_0x57fe('0x37')](_0x1027f8[_0x57fe('0x35')],_0x1027f8[_0x57fe('0x32')]);_0x3d182b['attributes']=_[_0x57fe('0x37')](_0x1027f8[_0x57fe('0x35')],qs[_0x57fe('0x38')](_0x4247ab[_0x57fe('0x32')][_0x57fe('0x38')]));_0x3d182b['attributes']=_0x3d182b[_0x57fe('0x36')][_0x57fe('0x39')]?_0x3d182b[_0x57fe('0x36')]:_0x1027f8[_0x57fe('0x35')];_0x3d182b[_0x57fe('0x3a')]=qs[_0x57fe('0x3b')](_0x4247ab[_0x57fe('0x32')][_0x57fe('0x3b')]);_0x3d182b['where']=qs['filters'](_[_0x57fe('0x3d')](_0x4247ab[_0x57fe('0x32')],_0x1027f8['filters']));if(_0x4247ab[_0x57fe('0x32')]['filter']){_0x3d182b[_0x57fe('0x3c')]=_[_0x57fe('0x3f')](_0x3d182b[_0x57fe('0x3c')],{'$or':_['map'](_0x3d182b[_0x57fe('0x36')],function(_0x67dee6){var _0x51ebdc={};_0x51ebdc[_0x67dee6]={'$like':'%'+_0x4247ab[_0x57fe('0x32')]['filter']+'%'};return _0x51ebdc;})});}_0x3d182b=_[_0x57fe('0x3f')]({},_0x3d182b,_0x4247ab[_0x57fe('0x41')]);return _0x434c79[_0x57fe('0x6d')](_0x3d182b);}})['then'](function(_0x4c8750){if(_0x4c8750){_0x29be2c=_0x4c8750[_0x57fe('0x39')];if(!_0x4247ab[_0x57fe('0x32')][_0x57fe('0x6e')](_0x57fe('0x6f'))){_0x3d182b[_0x57fe('0x1e')]=qs[_0x57fe('0x1e')](_0x4247ab[_0x57fe('0x32')][_0x57fe('0x1e')]);_0x3d182b['offset']=qs['offset'](_0x4247ab['query'][_0x57fe('0x1c')]);}return _0x434c79[_0x57fe('0x6d')](_0x3d182b);}})[_0x57fe('0x24')](function(_0x3270a7){if(_0x3270a7){return _0x3270a7?{'count':_0x29be2c,'rows':_0x3270a7}:null;}})[_0x57fe('0x24')](respondWithResult(_0x5d17d3,null))[_0x57fe('0x46')](handleError(_0x5d17d3,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 5fcd9f4..e6d9d61 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 _0x7a7d=['util','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a7d,0x17b));var _0xd7a7=function(_0x4ef7c0,_0x5d99ba){_0x4ef7c0=_0x4ef7c0-0x0;var _0x544af5=_0x7a7d[_0x4ef7c0];return _0x544af5;};'use strict';var _=require(_0xd7a7('0x0'));var util=require(_0xd7a7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd7a7('0x2'));var BPromise=require(_0xd7a7('0x3'));var rp=require(_0xd7a7('0x4'));var fs=require('fs');var path=require(_0xd7a7('0x5'));var rimraf=require('rimraf');var config=require(_0xd7a7('0x6'));var attributes=require(_0xd7a7('0x7'));module['exports']=function(_0x8ca44e,_0x57499a){return _0x8ca44e[_0xd7a7('0x8')](_0xd7a7('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x258f=['VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x258f,0xda));var _0xf258=function(_0x1cf3dc,_0x2f7373){_0x1cf3dc=_0x1cf3dc-0x0;var _0x4e67e5=_0x258f[_0x1cf3dc];return _0x4e67e5;};'use strict';var _=require('lodash');var util=require(_0xf258('0x0'));var logger=require(_0xf258('0x1'))(_0xf258('0x2'));var moment=require(_0xf258('0x3'));var BPromise=require(_0xf258('0x4'));var rp=require(_0xf258('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0xf258('0x6')]=function(_0x4a8958,_0x29a9b4){return _0x4a8958['define'](_0xf258('0x7'),attributes,{'tableName':_0xf258('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 cef2597..bc3d87e 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x4633eb,_0x1dbb0c){var _0x46a764=function(_0x25a3db){while(--_0x25a3db){_0x4633eb['push'](_0x4633eb['shift']());}};_0x46a764(++_0x1dbb0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x236ee6,_0x393e81){var _0x31a109=function(_0x48f123){while(--_0x48f123){_0x236ee6['push'](_0x236ee6['shift']());}};_0x31a109(++_0x393e81);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index d788c3c..01c0800 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 _0xea81=['addTeams','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xea81,0x1ed));var _0x1ea8=function(_0x3565f7,_0x216844){_0x3565f7=_0x3565f7-0x0;var _0x3b9e0f=_0xea81[_0x3565f7];return _0x3b9e0f;};'use strict';var multer=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var path=require(_0x1ea8('0x2'));var timeout=require(_0x1ea8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1ea8('0x4'));var auth=require(_0x1ea8('0x5'));var interaction=require(_0x1ea8('0x6'));var config=require(_0x1ea8('0x7'));var controller=require(_0x1ea8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1ea8('0x9')](_0x1ea8('0xa'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0xc')]);router['get'](_0x1ea8('0xd'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0xe')]);router[_0x1ea8('0x9')](_0x1ea8('0xf'),auth['isAuthenticated'](),controller[_0x1ea8('0x10')]);router['get'](_0x1ea8('0x11'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x12')]);router[_0x1ea8('0x13')]('/',auth[_0x1ea8('0xb')](),controller['create']);router['post'](_0x1ea8('0xf'),auth[_0x1ea8('0xb')](),controller['addAgents']);router[_0x1ea8('0x13')](_0x1ea8('0x11'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x14')]);router[_0x1ea8('0x15')]('/:id',auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x16')]);router[_0x1ea8('0x17')]('/:id',auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x18')]);router['delete']('/:id/users',auth[_0x1ea8('0xb')](),controller['removeAgents']);router[_0x1ea8('0x17')]('/:id/teams',auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x19')]);module[_0x1ea8('0x1a')]=router; \ No newline at end of file +var _0x68de=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getAgents','create','post','/:id/teams','addTeams','update','delete','destroy','/:id/users','removeAgents','removeTeams','exports','multer','util'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x68de,0xfa));var _0xe68d=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x68de[_0x5eef05];return _0x56d4b8;};'use strict';var multer=require(_0xe68d('0x0'));var util=require(_0xe68d('0x1'));var path=require(_0xe68d('0x2'));var timeout=require('connect-timeout');var express=require(_0xe68d('0x3'));var router=express[_0xe68d('0x4')]();var fs_extra=require(_0xe68d('0x5'));var auth=require(_0xe68d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe68d('0x7'));var controller=require(_0xe68d('0x8'));router[_0xe68d('0x9')]('/',auth[_0xe68d('0xa')](),controller[_0xe68d('0xb')]);router['get'](_0xe68d('0xc'),auth['isAuthenticated'](),controller[_0xe68d('0xd')]);router[_0xe68d('0x9')](_0xe68d('0xe'),auth[_0xe68d('0xa')](),controller[_0xe68d('0xf')]);router[_0xe68d('0x9')]('/:id/users',auth[_0xe68d('0xa')](),controller[_0xe68d('0x10')]);router[_0xe68d('0x9')]('/:id/teams',auth[_0xe68d('0xa')](),controller['getTeams']);router['post']('/',auth[_0xe68d('0xa')](),controller[_0xe68d('0x11')]);router[_0xe68d('0x12')]('/:id/users',auth[_0xe68d('0xa')](),controller['addAgents']);router[_0xe68d('0x12')](_0xe68d('0x13'),auth[_0xe68d('0xa')](),controller[_0xe68d('0x14')]);router['put']('/:id',auth[_0xe68d('0xa')](),controller[_0xe68d('0x15')]);router[_0xe68d('0x16')](_0xe68d('0xe'),auth[_0xe68d('0xa')](),controller[_0xe68d('0x17')]);router[_0xe68d('0x16')](_0xe68d('0x18'),auth[_0xe68d('0xa')](),controller[_0xe68d('0x19')]);router[_0xe68d('0x16')](_0xe68d('0x13'),auth[_0xe68d('0xa')](),controller[_0xe68d('0x1a')]);module[_0xe68d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 4f6c365..2c181ac 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 _0xf7a7=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xf7a7,0x88));var _0x7f7a=function(_0x408eef,_0x40838c){_0x408eef=_0x408eef-0x0;var _0x564096=_0xf7a7[_0x408eef];return _0x564096;};'use strict';var Sequelize=require(_0x7f7a('0x0'));module[_0x7f7a('0x1')]={'name':{'type':Sequelize[_0x7f7a('0x2')],'allowNull':![],'unique':_0x7f7a('0x3')},'prefix':{'type':Sequelize[_0x7f7a('0x4')],'get':function(_0x58ff3c){return _0x7f7a('0x5')+this[_0x7f7a('0x6')](_0x7f7a('0x3'))+'-';}},'description':{'type':Sequelize[_0x7f7a('0x2')]},'callerIdAll':{'type':Sequelize[_0x7f7a('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7f7a('0x7')]}}; \ No newline at end of file +var _0x4b96=['STRING','name','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x31471b,_0x1a8c88){var _0x2c35c4=function(_0x21a7be){while(--_0x21a7be){_0x31471b['push'](_0x31471b['shift']());}};_0x2c35c4(++_0x1a8c88);}(_0x4b96,0x16a));var _0x64b9=function(_0x48d6e1,_0x4b419d){_0x48d6e1=_0x48d6e1-0x0;var _0x210826=_0x4b96[_0x48d6e1];return _0x210826;};'use strict';var Sequelize=require(_0x64b9('0x0'));module[_0x64b9('0x1')]={'name':{'type':Sequelize[_0x64b9('0x2')],'allowNull':![],'unique':_0x64b9('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xfcfa7){return _0x64b9('0x4')+this[_0x64b9('0x5')](_0x64b9('0x3'))+'-';}},'description':{'type':Sequelize[_0x64b9('0x2')]},'callerIdAll':{'type':Sequelize[_0x64b9('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x64b9('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 119ad28..e63a996 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 _0x36ee=['show','params','find','describe','create','sequelize','transaction','get','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','body','findById','addAgents','spread','ids','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','User','nolimit','getTeams','findOne','Team','findAll','Agents','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','includes','all','forEach','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','then','destroy','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x3e6b6e,_0x4e0b58){var _0x56d4f9=function(_0x275ed6){while(--_0x275ed6){_0x3e6b6e['push'](_0x3e6b6e['shift']());}};_0x56d4f9(++_0x4e0b58);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];config['redis']=_[_0xe36e('0x19')](config[_0xe36e('0x1a')],{'host':_0xe36e('0x1b'),'port':0x18eb});var socket=require(_0xe36e('0x1c'))(new Redis(config['redis']));require(_0xe36e('0x1d'))['register'](socket);function respondWithStatusCode(_0x525155,_0x27ff47){_0x27ff47=_0x27ff47||0xcc;return function(_0x300f21){if(_0x300f21){return _0x525155[_0xe36e('0x1e')](_0x27ff47);}return _0x525155[_0xe36e('0x1f')](_0x27ff47)[_0xe36e('0x20')]();};}function respondWithResult(_0x924cd5,_0x2096f6){_0x2096f6=_0x2096f6||0xc8;return function(_0x39bae8){if(_0x39bae8){return _0x924cd5[_0xe36e('0x1f')](_0x2096f6)[_0xe36e('0x21')](_0x39bae8);}};}function respondWithFilteredResult(_0x5792e8,_0x333554){return function(_0x2184ae){if(_0x2184ae){var _0x56c019=typeof _0x333554[_0xe36e('0x22')]==='undefined'&&typeof _0x333554[_0xe36e('0x23')]===_0xe36e('0x24');var _0x5e15f5=_0x2184ae[_0xe36e('0x25')];var _0x6aa186=_0x56c019?0x0:_0x333554[_0xe36e('0x22')];var _0x597331=_0x56c019?_0x2184ae[_0xe36e('0x25')]:_0x333554[_0xe36e('0x22')]+_0x333554[_0xe36e('0x23')];var _0x3c4017;if(_0x597331>=_0x5e15f5){_0x597331=_0x5e15f5;_0x3c4017=0xc8;}else{_0x3c4017=0xce;}_0x5792e8[_0xe36e('0x1f')](_0x3c4017);return _0x5792e8[_0xe36e('0x26')]('Content-Range',_0x6aa186+'-'+_0x597331+'/'+_0x5e15f5)[_0xe36e('0x21')](_0x2184ae);}return null;};}function patchUpdates(_0x4f214a){return function(_0x23bcf3){try{jsonpatch[_0xe36e('0x27')](_0x23bcf3,_0x4f214a,!![]);}catch(_0x437f3f){return BPromise['reject'](_0x437f3f);}return _0x23bcf3['save']();};}function saveUpdates(_0x4749a8,_0x10818d){return function(_0xb0cd85){if(_0xb0cd85){return _0xb0cd85[_0xe36e('0x28')](_0x4749a8)[_0xe36e('0x29')](function(_0x1507f9){return _0x1507f9;});}return null;};}function removeEntity(_0x1a045c,_0x5ac484){return function(_0x3cafbf){if(_0x3cafbf){return _0x3cafbf[_0xe36e('0x2a')]()[_0xe36e('0x29')](function(){var _0x262caa=_0x3cafbf['get']({'plain':!![]});var _0x2d757c='VoicePrefixes';return db[_0xe36e('0x2b')]['destroy']({'where':{'type':_0x2d757c,'resourceId':_0x262caa['id']}})[_0xe36e('0x29')](function(){return _0x3cafbf;});})['then'](function(){_0x1a045c[_0xe36e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b1045,_0x59548b){return function(_0x4bb75b){if(!_0x4bb75b){_0x3b1045['sendStatus'](0x194);}return _0x4bb75b;};}function handleError(_0x5b5d53,_0x203fa2){_0x203fa2=_0x203fa2||0x1f4;return function(_0x1fc639){logger['error'](_0x1fc639['stack']);if(_0x1fc639[_0xe36e('0x2c')]){delete _0x1fc639[_0xe36e('0x2c')];}_0x5b5d53[_0xe36e('0x1f')](_0x203fa2)[_0xe36e('0x2d')](_0x1fc639);};}exports[_0xe36e('0x2e')]=function(_0x4759b4,_0x57bb9b){var _0xb98e78={},_0x11c95d={},_0x57272f={'count':0x0,'rows':[]};var _0x87e595=_[_0xe36e('0x2f')](db[_0xe36e('0x30')][_0xe36e('0x31')],function(_0x21623e){return{'name':_0x21623e[_0xe36e('0x32')],'type':_0x21623e[_0xe36e('0x33')][_0xe36e('0x34')]};});_0x11c95d[_0xe36e('0x35')]=_[_0xe36e('0x2f')](_0x87e595,_0xe36e('0x2c'));_0x11c95d['query']=_[_0xe36e('0x36')](_0x4759b4['query']);_0x11c95d['filters']=_[_0xe36e('0x37')](_0x11c95d['model'],_0x11c95d[_0xe36e('0x38')]);_0xb98e78[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x11c95d[_0xe36e('0x35')],qs['fields'](_0x4759b4['query'][_0xe36e('0x3a')]));_0xb98e78[_0xe36e('0x39')]=_0xb98e78[_0xe36e('0x39')][_0xe36e('0x3b')]?_0xb98e78['attributes']:_0x11c95d[_0xe36e('0x35')];if(!_0x4759b4[_0xe36e('0x38')][_0xe36e('0x3c')]('nolimit')){_0xb98e78[_0xe36e('0x23')]=qs[_0xe36e('0x23')](_0x4759b4['query'][_0xe36e('0x23')]);_0xb98e78[_0xe36e('0x22')]=qs[_0xe36e('0x22')](_0x4759b4[_0xe36e('0x38')][_0xe36e('0x22')]);}_0xb98e78[_0xe36e('0x3d')]=qs[_0xe36e('0x3e')](_0x4759b4[_0xe36e('0x38')][_0xe36e('0x3e')]);_0xb98e78[_0xe36e('0x3f')]=qs[_0xe36e('0x40')](_[_0xe36e('0x41')](_0x4759b4[_0xe36e('0x38')],_0x11c95d['filters']),_0x87e595);if(_0x4759b4[_0xe36e('0x38')][_0xe36e('0x42')]){_0xb98e78[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0xb98e78[_0xe36e('0x3f')],{'$or':_['map'](_0x87e595,function(_0x591e33){if(_0x591e33[_0xe36e('0x33')]!==_0xe36e('0x44')){var _0x1acc12={};_0x1acc12[_0x591e33[_0xe36e('0x2c')]]={'$like':'%'+_0x4759b4[_0xe36e('0x38')][_0xe36e('0x42')]+'%'};return _0x1acc12;}})});}_0xb98e78=_[_0xe36e('0x43')]({},_0xb98e78,_0x4759b4[_0xe36e('0x45')]);var _0x48066c={'where':_0xb98e78[_0xe36e('0x3f')]};return db[_0xe36e('0x30')]['count'](_0x48066c)[_0xe36e('0x29')](function(_0x5ef3e4){_0x57272f[_0xe36e('0x25')]=_0x5ef3e4;if(_0x4759b4[_0xe36e('0x38')][_0xe36e('0x46')]){_0xb98e78[_0xe36e('0x47')]=[{'all':!![]}];}return db[_0xe36e('0x30')]['findAll'](_0xb98e78);})[_0xe36e('0x29')](function(_0x2961c9){_0x57272f[_0xe36e('0x48')]=_0x2961c9;return _0x57272f;})[_0xe36e('0x29')](respondWithFilteredResult(_0x57bb9b,_0xb98e78))[_0xe36e('0x49')](handleError(_0x57bb9b,null));};exports[_0xe36e('0x4a')]=function(_0x569809,_0x122704){var _0x134d71={'raw':![],'where':{'id':_0x569809[_0xe36e('0x4b')]['id']}},_0x2a6817={};_0x2a6817[_0xe36e('0x35')]=_['keys'](db[_0xe36e('0x30')][_0xe36e('0x31')]);_0x2a6817[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x569809[_0xe36e('0x38')]);_0x2a6817[_0xe36e('0x40')]=_[_0xe36e('0x37')](_0x2a6817[_0xe36e('0x35')],_0x2a6817[_0xe36e('0x38')]);_0x134d71['attributes']=_['intersection'](_0x2a6817[_0xe36e('0x35')],qs['fields'](_0x569809[_0xe36e('0x38')][_0xe36e('0x3a')]));_0x134d71[_0xe36e('0x39')]=_0x134d71[_0xe36e('0x39')]['length']?_0x134d71[_0xe36e('0x39')]:_0x2a6817[_0xe36e('0x35')];if(_0x569809['query'][_0xe36e('0x46')]){_0x134d71[_0xe36e('0x47')]=[{'all':!![]}];}_0x134d71=_[_0xe36e('0x43')]({},_0x134d71,_0x569809[_0xe36e('0x45')]);return db[_0xe36e('0x30')][_0xe36e('0x4c')](_0x134d71)[_0xe36e('0x29')](handleEntityNotFound(_0x122704,null))[_0xe36e('0x29')](respondWithResult(_0x122704,null))[_0xe36e('0x49')](handleError(_0x122704,null));};exports[_0xe36e('0x2a')]=function(_0x7307bc,_0x13ccc5){return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x7307bc[_0xe36e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13ccc5,null))[_0xe36e('0x29')](removeEntity(_0x13ccc5,null))['catch'](handleError(_0x13ccc5,null));};exports['describe']=function(_0x10b8ff,_0x3e8ccb){return db['VoicePrefix'][_0xe36e('0x4d')]()[_0xe36e('0x29')](respondWithResult(_0x3e8ccb,null))[_0xe36e('0x49')](handleError(_0x3e8ccb,null));};exports[_0xe36e('0x4e')]=function(_0xa4be24,_0x22788b){var _0x935e84;return db[_0xe36e('0x4f')][_0xe36e('0x50')](function(_0x55d190){return db[_0xe36e('0x30')][_0xe36e('0x4e')](_0xa4be24['body'],{'transaction':_0x55d190})[_0xe36e('0x29')](function(_0x1da952){_0x935e84=_0x1da952[_0xe36e('0x51')]({'plain':!![]});return db[_0xe36e('0x52')][_0xe36e('0x4c')]({'where':{'id':_0x935e84['VoiceExtensionId']},'raw':!![]})['then'](function(_0x56f5b6){return createVoicePrefixExtensions(_0x935e84,_0x56f5b6,_0x55d190);});});})['then'](function(){var _0x47605d=_0xa4be24[_0xe36e('0x53')][_0xe36e('0x51')]({'plain':!![]});if(!_0x47605d)throw new Error(_0xe36e('0x54'));if(_0x47605d[_0xe36e('0x55')]===_0xe36e('0x53')){var _0x7c3766=_0x935e84;return db[_0xe36e('0x56')][_0xe36e('0x4c')]({'where':{'name':'VoicePrefixes','userProfileId':_0x47605d[_0xe36e('0x57')]},'raw':!![]})[_0xe36e('0x29')](function(_0x5a058b){if(_0x5a058b&&_0x5a058b[_0xe36e('0x58')]===0x0){return db[_0xe36e('0x2b')][_0xe36e('0x4e')]({'name':_0x7c3766[_0xe36e('0x2c')],'resourceId':_0x7c3766['id'],'type':_0x5a058b[_0xe36e('0x2c')],'sectionId':_0x5a058b['id']},{})[_0xe36e('0x29')](function(){return _0x935e84;});}else{return _0x935e84;}})[_0xe36e('0x49')](function(_0x1a70d1){logger[_0xe36e('0x59')](_0xe36e('0x5a'),_0x1a70d1);throw _0x1a70d1;});}return _0x935e84;})[_0xe36e('0x29')](respondWithResult(_0x22788b,null))[_0xe36e('0x49')](handleError(_0x22788b,null));};function Extension(_0x389e91,_0x6f979f,_0x3512ec,_0x3e4860){this[_0xe36e('0x5b')]=_0xe36e('0x5c');this[_0xe36e('0x5d')]=_0x389e91;this[_0xe36e('0x5e')]=_0x3512ec;this[_0xe36e('0x33')]=_0xe36e('0x5f');this[_0xe36e('0x60')]=_0xe36e('0x61');this[_0xe36e('0x62')]=_0x6f979f;this['appdata']=_0x3e4860;}function createVoicePrefixExtensions(_0x429a01,_0xedaa96,_0x49336b){return new BPromise(function(_0xce5583,_0x41bad0){var _0x180dc3=new Extension(formatPrefixName(_0x429a01[_0xe36e('0x63')]),0x1,_0xe36e('0x64'),_0xe36e('0x65'));_0x180dc3['VoicePrefixId']=_0x429a01['id'];return db[_0xe36e('0x52')]['create'](_0x180dc3,{'transaction':_0x49336b})[_0xe36e('0x29')](function(_0x1fc1e5){var _0x2b0059=_0x1fc1e5[_0xe36e('0x51')]({'plain':!![]});var _0x2a767d=_[_0xe36e('0x2f')](addVoicePrefixExtensions(_0x429a01,_0xedaa96),function(_0x2ab6aa){_0x2ab6aa[_0xe36e('0x66')]=_0x2b0059['id'];_0x2ab6aa['VoicePrefixId']=_0x429a01['id'];return _0x2ab6aa;});return db[_0xe36e('0x52')][_0xe36e('0x67')](_0x2a767d,{'transaction':_0x49336b})['then'](function(_0x3068e1){if(!_0x3068e1){return _0x41bad0(_0xe36e('0x68'));}else{return _0xce5583(_0x3068e1);}})[_0xe36e('0x49')](function(_0x1e8943){return _0x41bad0(_0x1e8943);});});;});};function addVoicePrefixExtensions(_0x30786a,_0x3565cb){var _0x3d4874=[];var _0x48ff05=formatPrefixName(_0x30786a[_0xe36e('0x63')]);_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x2,_0xe36e('0x6a'),_0xe36e('0x6b')+_0x30786a[_0xe36e('0x2c')]));if(_0x30786a[_0xe36e('0x6c')]){_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x3,_0xe36e('0x6a'),_0xe36e('0x6d')+_0x30786a[_0xe36e('0x6c')]));}else{_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x3,'NoOp',_0xe36e('0x6e')));}_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x4,_0xe36e('0x6f'),_0x3565cb[_0xe36e('0x5b')]+','+'${EXTEN:'+(0x8+_0x30786a['name'][_0xe36e('0x3b')])+'}'+','+0x1));return _0x3d4874;}function formatPrefixName(_0x55911b){var _0x585bd5='_';for(var _0x59c454=0x0;_0x59c454<_0x55911b[_0xe36e('0x3b')];_0x59c454++){if(_0x55911b['charAt'](_0x59c454)=='-'){_0x585bd5+=_0x55911b[_0xe36e('0x70')](_0x59c454);}else{_0x585bd5+='['+_0x55911b[_0xe36e('0x70')](_0x59c454)+']';}}_0x585bd5+='.';return _0x585bd5;}exports[_0xe36e('0x28')]=function(_0x221a90,_0x1bd60d,_0x46f789){var _0x11e610=_0x221a90[_0xe36e('0x71')];_0x11e610[_0xe36e('0x63')]='system-'+_0x11e610[_0xe36e('0x2c')]+'-';return db['sequelize'][_0xe36e('0x50')](function(_0x517c2a){return db[_0xe36e('0x30')][_0xe36e('0x28')](_0x11e610,{'where':{'id':_0x11e610['id']},'transaction':_0x517c2a})[_0xe36e('0x29')](function(){return db[_0xe36e('0x52')]['destroy']({'where':{'VoicePrefixId':_0x11e610['id']},'transaction':_0x517c2a})['then'](function(){return db[_0xe36e('0x52')][_0xe36e('0x4c')]({'where':{'id':_0x11e610[_0xe36e('0x66')]},'raw':!![]})[_0xe36e('0x29')](function(_0x3be728){return createVoicePrefixExtensions(_0x11e610,_0x3be728,_0x517c2a);});});});})[_0xe36e('0x29')](function(){return db['VoicePrefix'][_0xe36e('0x72')](_0x11e610['id']);})[_0xe36e('0x29')](respondWithResult(_0x1bd60d,null))['catch'](handleError(_0x1bd60d,null));};exports[_0xe36e('0x73')]=function(_0x5eea4f,_0x45ebca,_0x421c28){return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x5eea4f['params']['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x45ebca,null))['then'](function(_0x49a74b){if(_0x49a74b){return _0x49a74b[_0xe36e('0x73')](_0x5eea4f[_0xe36e('0x71')]['ids'],_['omit'](_0x5eea4f[_0xe36e('0x71')],['ids','id'])||{})[_0xe36e('0x74')](function(_0x36ddc0){for(var _0x2c0ed5=0x0;_0x2c0ed5<_0x5eea4f[_0xe36e('0x71')][_0xe36e('0x75')][_0xe36e('0x3b')];_0x2c0ed5+=0x1){socket['emit'](_0xe36e('0x76'),{'UserId':Number(_0x5eea4f[_0xe36e('0x71')][_0xe36e('0x75')][_0x2c0ed5]),'VoicePrefixId':Number(_0x5eea4f[_0xe36e('0x4b')]['id'])});}return _0x36ddc0;});}})['then'](respondWithResult(_0x45ebca,null))[_0xe36e('0x49')](handleError(_0x45ebca,null));};exports[_0xe36e('0x77')]=function(_0x2eef73,_0x39c9fe,_0x5ee201){return db[_0xe36e('0x30')]['find']({'where':{'id':_0x2eef73[_0xe36e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39c9fe,null))[_0xe36e('0x29')](function(_0x522968){if(_0x522968){return _0x522968['removeAgents'](_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')])[_0xe36e('0x29')](function(){if(_['isArray'](_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')])){for(var _0x48e4f5=0x0;_0x48e4f5<_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')][_0xe36e('0x3b')];_0x48e4f5+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')][_0x48e4f5]),'VoicePrefixId':Number(_0x2eef73[_0xe36e('0x4b')]['id'])});}}else{socket[_0xe36e('0x78')](_0xe36e('0x79'),{'UserId':Number(_0x2eef73['query'][_0xe36e('0x75')]),'VoicePrefixId':Number(_0x2eef73[_0xe36e('0x4b')]['id'])});}});}})[_0xe36e('0x29')](respondWithStatusCode(_0x39c9fe,null))[_0xe36e('0x49')](handleError(_0x39c9fe,null));};exports[_0xe36e('0x7a')]=function(_0x5bdeea,_0x3712f6,_0x24fcf8){var _0x188dc9={};var _0x493d0f={};var _0x25e4eb;var _0x499f0a;return db[_0xe36e('0x30')]['findOne']({'where':{'id':_0x5bdeea[_0xe36e('0x4b')]['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x3712f6,null))['then'](function(_0x463355){if(_0x463355){_0x25e4eb=_0x463355;_0x493d0f['model']=_[_0xe36e('0x36')](db[_0xe36e('0x7b')][_0xe36e('0x31')]);_0x493d0f[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x5bdeea['query']);_0x493d0f[_0xe36e('0x40')]=_['intersection'](_0x493d0f[_0xe36e('0x35')],_0x493d0f[_0xe36e('0x38')]);_0x188dc9[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x493d0f[_0xe36e('0x35')],qs[_0xe36e('0x3a')](_0x5bdeea['query'][_0xe36e('0x3a')]));_0x188dc9[_0xe36e('0x39')]=_0x188dc9[_0xe36e('0x39')]['length']?_0x188dc9[_0xe36e('0x39')]:_0x493d0f[_0xe36e('0x35')];_0x188dc9[_0xe36e('0x3d')]=qs[_0xe36e('0x3e')](_0x5bdeea['query'][_0xe36e('0x3e')]);_0x188dc9['where']=qs[_0xe36e('0x40')](_['pick'](_0x5bdeea[_0xe36e('0x38')],_0x493d0f[_0xe36e('0x40')]));if(_0x5bdeea[_0xe36e('0x38')]['filter']){_0x188dc9[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0x188dc9['where'],{'$or':_[_0xe36e('0x2f')](_0x188dc9[_0xe36e('0x39')],function(_0x1f4dd2){var _0x531eac={};_0x531eac[_0x1f4dd2]={'$like':'%'+_0x5bdeea['query'][_0xe36e('0x42')]+'%'};return _0x531eac;})});}_0x188dc9=_[_0xe36e('0x43')]({},_0x188dc9,_0x5bdeea[_0xe36e('0x45')]);return _0x25e4eb[_0xe36e('0x7a')](_0x188dc9);}})[_0xe36e('0x29')](function(_0x5e62f1){if(_0x5e62f1){_0x499f0a=_0x5e62f1[_0xe36e('0x3b')];if(!_0x5bdeea[_0xe36e('0x38')][_0xe36e('0x3c')](_0xe36e('0x7c'))){_0x188dc9['limit']=qs[_0xe36e('0x23')](_0x5bdeea[_0xe36e('0x38')]['limit']);_0x188dc9['offset']=qs['offset'](_0x5bdeea[_0xe36e('0x38')]['offset']);}return _0x25e4eb['getAgents'](_0x188dc9);}})[_0xe36e('0x29')](function(_0x96f37a){if(_0x96f37a){return _0x96f37a?{'count':_0x499f0a,'rows':_0x96f37a}:null;}})[_0xe36e('0x29')](respondWithResult(_0x3712f6,null))[_0xe36e('0x49')](handleError(_0x3712f6,null));};exports[_0xe36e('0x7d')]=function(_0x378126,_0x48fbed,_0x2ebe8e){var _0x4f9354={};var _0x493692={};var _0x4451ec;var _0x21644d;return db[_0xe36e('0x30')][_0xe36e('0x7e')]({'where':{'id':_0x378126['params']['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x48fbed,null))[_0xe36e('0x29')](function(_0x23e62d){if(_0x23e62d){_0x4451ec=_0x23e62d;_0x493692[_0xe36e('0x35')]=_['keys'](db[_0xe36e('0x7f')]['rawAttributes']);_0x493692[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x378126[_0xe36e('0x38')]);_0x493692[_0xe36e('0x40')]=_[_0xe36e('0x37')](_0x493692['model'],_0x493692[_0xe36e('0x38')]);_0x4f9354[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x493692[_0xe36e('0x35')],qs[_0xe36e('0x3a')](_0x378126[_0xe36e('0x38')][_0xe36e('0x3a')]));_0x4f9354[_0xe36e('0x39')]=_0x4f9354[_0xe36e('0x39')][_0xe36e('0x3b')]?_0x4f9354[_0xe36e('0x39')]:_0x493692[_0xe36e('0x35')];_0x4f9354[_0xe36e('0x3d')]=qs['sort'](_0x378126['query']['sort']);_0x4f9354[_0xe36e('0x3f')]=qs[_0xe36e('0x40')](_[_0xe36e('0x41')](_0x378126[_0xe36e('0x38')],_0x493692['filters']));if(_0x378126[_0xe36e('0x38')][_0xe36e('0x42')]){_0x4f9354[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0x4f9354['where'],{'$or':_[_0xe36e('0x2f')](_0x4f9354[_0xe36e('0x39')],function(_0xdd1816){var _0x18dd36={};_0x18dd36[_0xdd1816]={'$like':'%'+_0x378126['query']['filter']+'%'};return _0x18dd36;})});}_0x4f9354=_[_0xe36e('0x43')]({},_0x4f9354,_0x378126[_0xe36e('0x45')]);return _0x4451ec['getTeams'](_0x4f9354);}})['then'](function(_0x59bf4d){if(_0x59bf4d){_0x21644d=_0x59bf4d[_0xe36e('0x3b')];if(!_0x378126[_0xe36e('0x38')][_0xe36e('0x3c')]('nolimit')){_0x4f9354[_0xe36e('0x23')]=qs[_0xe36e('0x23')](_0x378126[_0xe36e('0x38')][_0xe36e('0x23')]);_0x4f9354['offset']=qs[_0xe36e('0x22')](_0x378126[_0xe36e('0x38')][_0xe36e('0x22')]);}return _0x4451ec[_0xe36e('0x7d')](_0x4f9354);}})['then'](function(_0x3de53b){if(_0x3de53b){return _0x3de53b?{'count':_0x21644d,'rows':_0x3de53b}:null;}})['then'](respondWithResult(_0x48fbed,null))[_0xe36e('0x49')](handleError(_0x48fbed,null));};exports['addTeams']=function(_0x1c95cd,_0x2b3e81,_0x498822){var _0x2376b2=_0x1c95cd[_0xe36e('0x71')]['ids'];var _0x179b3f;return db[_0xe36e('0x7f')][_0xe36e('0x80')]({'where':{'id':_0x2376b2},'attributes':['id'],'include':[{'model':db[_0xe36e('0x7b')],'as':_0xe36e('0x81'),'attributes':['id',_0xe36e('0x2c'),'online',_0xe36e('0x82'),_0xe36e('0x83')],'raw':!![]}]})['then'](function(_0xda5f86){if(_0xda5f86){_0x179b3f=_0xda5f86;var _0x48e276=_[_0xe36e('0x84')](_0xda5f86,function(_0x7872d5){var _0x2aefd4=_0x7872d5[_0xe36e('0x51')]({'plain':!![]});return _0x2aefd4['Agents'];});return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x1c95cd[_0xe36e('0x4b')]['id']}})[_0xe36e('0x29')](function(_0x43f149){return db['sequelize'][_0xe36e('0x50')](function(_0x25abc5){return _0x43f149['addTeams'](_0x2376b2,{'transaction':_0x25abc5})['then'](function(){return BPromise[_0xe36e('0x85')](_0x179b3f,function(_0x51c98c){return db[_0xe36e('0x86')][_0xe36e('0x87')]({'TeamId':_0x51c98c['id'],'VoicePrefixId':_0x1c95cd[_0xe36e('0x4b')]['id']},{'transaction':_0x25abc5});});})[_0xe36e('0x29')](function(){return BPromise[_0xe36e('0x85')](_0x48e276,function(_0x3bd8e1){return db[_0xe36e('0x88')][_0xe36e('0x89')]({'where':{'UserId':_0x3bd8e1['id'],'VoicePrefixId':_0x1c95cd[_0xe36e('0x4b')]['id']},'transaction':_0x25abc5});});})[_0xe36e('0x29')](function(){_0x48e276['forEach'](function(_0xab0e50){socket['emit'](_0xe36e('0x76'),{'UserId':_0xab0e50['id'],'VoicePrefixId':_0x43f149['id']});});});});});}})[_0xe36e('0x29')](respondWithStatusCode(_0x2b3e81,null))[_0xe36e('0x49')](handleError(_0x2b3e81,null));};exports['removeTeams']=function(_0x3fc054,_0x947053,_0x51c758){return db[_0xe36e('0x7f')]['findAll']({'where':{'id':_0x3fc054[_0xe36e('0x38')][_0xe36e('0x75')]},'attributes':['id'],'include':[{'model':db[_0xe36e('0x7b')],'as':_0xe36e('0x81'),'attributes':['id'],'raw':!![]}]})[_0xe36e('0x29')](handleEntityNotFound(_0x947053,null))[_0xe36e('0x29')](function(_0x257b00){var _0x2056ed=_[_0xe36e('0x2f')](_0x257b00,'id');var _0x31ae71=[];var _0x166c22=[];var _0x47b082=squel['select']();_0x47b082[_0xe36e('0x8a')](_0xe36e('0x8b'))[_0xe36e('0x8c')](_0xe36e('0x8d'),'tq')['join'](_0xe36e('0x8e'),'ut',_0xe36e('0x8f'))['where'](_0xe36e('0x90'),_0x3fc054['params']['id']);for(var _0x260fff=0x0;_0x260fff<_0x257b00[_0xe36e('0x3b')];_0x260fff+=0x1){let _0x27d09b=_0x257b00[_0x260fff];for(var _0x5bc8b1=0x0;_0x5bc8b1<_0x27d09b[_0xe36e('0x81')][_0xe36e('0x3b')];_0x5bc8b1+=0x1){let _0x2e0e12=_0x27d09b[_0xe36e('0x81')][_0x5bc8b1];var _0x7a5d80=_0x47b082[_0xe36e('0x91')]();_0x7a5d80[_0xe36e('0x3f')]('ut.UserId\x20=\x20?',_0x2e0e12['id']);_0x166c22[_0xe36e('0x69')](db[_0xe36e('0x4f')][_0xe36e('0x38')](_0x7a5d80[_0xe36e('0x92')](),{'type':db[_0xe36e('0x4f')][_0xe36e('0x93')][_0xe36e('0x94')]})[_0xe36e('0x29')](function(_0xacc91e){if(_0xacc91e['length']===0x1){return _0x2e0e12['id'];}else{var _0x3e0dc9=_[_0xe36e('0x95')](_['map'](_0xacc91e,'TeamId'),function(_0x546461){return _[_0xe36e('0x96')](_0x2056ed,_0x546461);});if(_0x3e0dc9){return _0x2e0e12['id'];}}}));}}return BPromise[_0xe36e('0x97')](_0x166c22)['then'](function(_0x20208c){_0x31ae71=_(_0x31ae71)['union'](_0x20208c)['compact']()['value']();return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x3fc054['params']['id']}})[_0xe36e('0x29')](function(_0x2c9191){return db['sequelize'][_0xe36e('0x50')](function(_0x15b38e){return _0x2c9191['removeTeams'](_0x3fc054[_0xe36e('0x38')][_0xe36e('0x75')],{'transaction':_0x15b38e})['then'](function(){if(!_['isEmpty'](_0x31ae71)){return _0x2c9191[_0xe36e('0x77')](_0x31ae71,{'transaction':_0x15b38e});}})[_0xe36e('0x29')](function(){_0x31ae71[_0xe36e('0x98')](function(_0x3c7778){socket[_0xe36e('0x78')](_0xe36e('0x79'),{'UserId':_0x3c7778,'VoicePrefixId':_0x2c9191['id']});});});});});});})[_0xe36e('0x29')](respondWithStatusCode(_0x947053,null))[_0xe36e('0x49')](handleError(_0x947053,null));}; \ No newline at end of file +var _0x4fc2=['set','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoicePrefix','include','findAll','rows','catch','show','params','length','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','context','charAt','body','findById','addAgents','omit','spread','ids','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','findOrCreate','forEach','removeTeams','User','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','json','offset','undefined','count'];(function(_0x3022ce,_0x36c0f7){var _0x152199=function(_0x29972e){while(--_0x29972e){_0x3022ce['push'](_0x3022ce['shift']());}};_0x152199(++_0x36c0f7);}(_0x4fc2,0x111));var _0x24fc=function(_0x30c57f,_0x4e26ca){_0x30c57f=_0x30c57f-0x0;var _0x570756=_0x4fc2[_0x30c57f];return _0x570756;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];config['redis']=_[_0x24fc('0x1b')](config[_0x24fc('0x1c')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1c')]));require(_0x24fc('0x1f'))['register'](socket);function respondWithStatusCode(_0x2a0971,_0x18c0a7){_0x18c0a7=_0x18c0a7||0xcc;return function(_0x2ffed3){if(_0x2ffed3){return _0x2a0971[_0x24fc('0x20')](_0x18c0a7);}return _0x2a0971['status'](_0x18c0a7)[_0x24fc('0x21')]();};}function respondWithResult(_0x588543,_0x4af098){_0x4af098=_0x4af098||0xc8;return function(_0x3385c7){if(_0x3385c7){return _0x588543[_0x24fc('0x22')](_0x4af098)[_0x24fc('0x23')](_0x3385c7);}};}function respondWithFilteredResult(_0x25cb40,_0x52a884){return function(_0x23873c){if(_0x23873c){var _0x1cb3d0=typeof _0x52a884[_0x24fc('0x24')]===_0x24fc('0x25')&&typeof _0x52a884['limit']===_0x24fc('0x25');var _0x4073e0=_0x23873c[_0x24fc('0x26')];var _0x5b0516=_0x1cb3d0?0x0:_0x52a884[_0x24fc('0x24')];var _0x36a771=_0x1cb3d0?_0x23873c[_0x24fc('0x26')]:_0x52a884[_0x24fc('0x24')]+_0x52a884['limit'];var _0x323beb;if(_0x36a771>=_0x4073e0){_0x36a771=_0x4073e0;_0x323beb=0xc8;}else{_0x323beb=0xce;}_0x25cb40['status'](_0x323beb);return _0x25cb40[_0x24fc('0x27')]('Content-Range',_0x5b0516+'-'+_0x36a771+'/'+_0x4073e0)[_0x24fc('0x23')](_0x23873c);}return null;};}function patchUpdates(_0x44c121){return function(_0x2ffade){try{jsonpatch['apply'](_0x2ffade,_0x44c121,!![]);}catch(_0x313a25){return BPromise['reject'](_0x313a25);}return _0x2ffade[_0x24fc('0x28')]();};}function saveUpdates(_0x2bb93a,_0x36a9b4){return function(_0x34b5b2){if(_0x34b5b2){return _0x34b5b2[_0x24fc('0x29')](_0x2bb93a)[_0x24fc('0x2a')](function(_0x3f0875){return _0x3f0875;});}return null;};}function removeEntity(_0x20192b,_0x168d98){return function(_0x2a5c4b){if(_0x2a5c4b){return _0x2a5c4b['destroy']()[_0x24fc('0x2a')](function(){var _0x16f27f=_0x2a5c4b[_0x24fc('0x2b')]({'plain':!![]});var _0x5bb4c8=_0x24fc('0x2c');return db[_0x24fc('0x2d')][_0x24fc('0x2e')]({'where':{'type':_0x5bb4c8,'resourceId':_0x16f27f['id']}})[_0x24fc('0x2a')](function(){return _0x2a5c4b;});})[_0x24fc('0x2a')](function(){_0x20192b[_0x24fc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x240ae7,_0x29a461){return function(_0x3c99ed){if(!_0x3c99ed){_0x240ae7[_0x24fc('0x20')](0x194);}return _0x3c99ed;};}function handleError(_0x9f7bbc,_0x490aa5){_0x490aa5=_0x490aa5||0x1f4;return function(_0x55c27f){logger['error'](_0x55c27f[_0x24fc('0x2f')]);if(_0x55c27f['name']){delete _0x55c27f[_0x24fc('0x30')];}_0x9f7bbc[_0x24fc('0x22')](_0x490aa5)[_0x24fc('0x31')](_0x55c27f);};}exports[_0x24fc('0x32')]=function(_0x4dbd52,_0x66eec0){var _0x33f368={},_0x523c1f={},_0xf46cd5={'count':0x0,'rows':[]};var _0x1b174d=_['map'](db['VoicePrefix'][_0x24fc('0x33')],function(_0x56eae7){return{'name':_0x56eae7[_0x24fc('0x34')],'type':_0x56eae7[_0x24fc('0x35')]['key']};});_0x523c1f[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x1b174d,_0x24fc('0x30'));_0x523c1f[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x4dbd52[_0x24fc('0x38')]);_0x523c1f[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],_0x523c1f['query']);_0x33f368[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x4dbd52[_0x24fc('0x38')]['fields']));_0x33f368['attributes']=_0x33f368[_0x24fc('0x3c')]['length']?_0x33f368[_0x24fc('0x3c')]:_0x523c1f[_0x24fc('0x36')];if(!_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3e')]('nolimit')){_0x33f368[_0x24fc('0x3f')]=qs['limit'](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x33f368[_0x24fc('0x24')]=qs[_0x24fc('0x24')](_0x4dbd52[_0x24fc('0x38')]['offset']);}_0x33f368[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x41')]);_0x33f368['where']=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x4dbd52['query'],_0x523c1f[_0x24fc('0x3a')]),_0x1b174d);if(_0x4dbd52['query'][_0x24fc('0x43')]){_0x33f368[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x33f368[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x1b174d,function(_0x278b18){if(_0x278b18[_0x24fc('0x35')]!==_0x24fc('0x46')){var _0x4a18bb={};_0x4a18bb[_0x278b18[_0x24fc('0x30')]]={'$like':'%'+_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x4a18bb;}})});}_0x33f368=_['merge']({},_0x33f368,_0x4dbd52[_0x24fc('0x47')]);var _0x1e3b52={'where':_0x33f368['where']};return db[_0x24fc('0x48')][_0x24fc('0x26')](_0x1e3b52)[_0x24fc('0x2a')](function(_0x5e4e9b){_0xf46cd5[_0x24fc('0x26')]=_0x5e4e9b;if(_0x4dbd52[_0x24fc('0x38')]['includeAll']){_0x33f368[_0x24fc('0x49')]=[{'all':!![]}];}return db[_0x24fc('0x48')][_0x24fc('0x4a')](_0x33f368);})[_0x24fc('0x2a')](function(_0x4c8dad){_0xf46cd5[_0x24fc('0x4b')]=_0x4c8dad;return _0xf46cd5;})[_0x24fc('0x2a')](respondWithFilteredResult(_0x66eec0,_0x33f368))[_0x24fc('0x4c')](handleError(_0x66eec0,null));};exports[_0x24fc('0x4d')]=function(_0xbcbcfa,_0x58a950){var _0x2a27e6={'raw':![],'where':{'id':_0xbcbcfa[_0x24fc('0x4e')]['id']}},_0x1b9c90={};_0x1b9c90[_0x24fc('0x36')]=_['keys'](db[_0x24fc('0x48')][_0x24fc('0x33')]);_0x1b9c90['query']=_['keys'](_0xbcbcfa[_0x24fc('0x38')]);_0x1b9c90['filters']=_['intersection'](_0x1b9c90[_0x24fc('0x36')],_0x1b9c90['query']);_0x2a27e6[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x1b9c90[_0x24fc('0x36')],qs['fields'](_0xbcbcfa[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x2a27e6[_0x24fc('0x3c')]=_0x2a27e6[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x2a27e6[_0x24fc('0x3c')]:_0x1b9c90[_0x24fc('0x36')];if(_0xbcbcfa[_0x24fc('0x38')]['includeAll']){_0x2a27e6['include']=[{'all':!![]}];}_0x2a27e6=_[_0x24fc('0x45')]({},_0x2a27e6,_0xbcbcfa[_0x24fc('0x47')]);return db[_0x24fc('0x48')]['find'](_0x2a27e6)['then'](handleEntityNotFound(_0x58a950,null))[_0x24fc('0x2a')](respondWithResult(_0x58a950,null))[_0x24fc('0x4c')](handleError(_0x58a950,null));};exports[_0x24fc('0x2e')]=function(_0x134f64,_0x21f8b8){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x134f64[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x21f8b8,null))[_0x24fc('0x2a')](removeEntity(_0x21f8b8,null))[_0x24fc('0x4c')](handleError(_0x21f8b8,null));};exports[_0x24fc('0x51')]=function(_0x5ec1c0,_0x1c9a28){return db[_0x24fc('0x48')][_0x24fc('0x51')]()[_0x24fc('0x2a')](respondWithResult(_0x1c9a28,null))[_0x24fc('0x4c')](handleError(_0x1c9a28,null));};exports['create']=function(_0x428012,_0x4bf3a8){var _0x2c8f74;return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x41ddfb){return db[_0x24fc('0x48')][_0x24fc('0x54')](_0x428012['body'],{'transaction':_0x41ddfb})[_0x24fc('0x2a')](function(_0xc2ba88){_0x2c8f74=_0xc2ba88[_0x24fc('0x2b')]({'plain':!![]});return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0x2c8f74[_0x24fc('0x56')]},'raw':!![]})['then'](function(_0x36d500){return createVoicePrefixExtensions(_0x2c8f74,_0x36d500,_0x41ddfb);});});})[_0x24fc('0x2a')](function(){var _0x1628b4=_0x428012[_0x24fc('0x57')][_0x24fc('0x2b')]({'plain':!![]});if(!_0x1628b4)throw new Error(_0x24fc('0x58'));if(_0x1628b4[_0x24fc('0x59')]==='user'){var _0xd673f8=_0x2c8f74;return db[_0x24fc('0x5a')]['find']({'where':{'name':_0x24fc('0x2c'),'userProfileId':_0x1628b4[_0x24fc('0x5b')]},'raw':!![]})[_0x24fc('0x2a')](function(_0x2ba959){if(_0x2ba959&&_0x2ba959[_0x24fc('0x5c')]===0x0){return db[_0x24fc('0x2d')]['create']({'name':_0xd673f8[_0x24fc('0x30')],'resourceId':_0xd673f8['id'],'type':_0x2ba959['name'],'sectionId':_0x2ba959['id']},{})[_0x24fc('0x2a')](function(){return _0x2c8f74;});}else{return _0x2c8f74;}})[_0x24fc('0x4c')](function(_0x50e5b0){logger[_0x24fc('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50e5b0);throw _0x50e5b0;});}return _0x2c8f74;})[_0x24fc('0x2a')](respondWithResult(_0x4bf3a8,null))['catch'](handleError(_0x4bf3a8,null));};function Extension(_0xdff811,_0x27b612,_0x57daaf,_0x2edef7){this['context']=_0x24fc('0x5e');this[_0x24fc('0x5f')]=_0xdff811;this['app']=_0x57daaf;this[_0x24fc('0x35')]=_0x24fc('0x60');this[_0x24fc('0x61')]=_0x24fc('0x62');this[_0x24fc('0x63')]=_0x27b612;this['appdata']=_0x2edef7;}function createVoicePrefixExtensions(_0x39da59,_0x2f62b0,_0x2d657a){return new BPromise(function(_0x2b5dca,_0x11d0e0){var _0x5e9c03=new Extension(formatPrefixName(_0x39da59['prefix']),0x1,_0x24fc('0x64'),_0x24fc('0x65'));_0x5e9c03['VoicePrefixId']=_0x39da59['id'];return db['VoiceExtension'][_0x24fc('0x54')](_0x5e9c03,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0x28ef6a){var _0x1c47cd=_0x28ef6a['get']({'plain':!![]});var _0x20973d=_[_0x24fc('0x37')](addVoicePrefixExtensions(_0x39da59,_0x2f62b0),function(_0x14427b){_0x14427b[_0x24fc('0x56')]=_0x1c47cd['id'];_0x14427b[_0x24fc('0x66')]=_0x39da59['id'];return _0x14427b;});return db[_0x24fc('0x55')][_0x24fc('0x67')](_0x20973d,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0xbe136e){if(!_0xbe136e){return _0x11d0e0(_0x24fc('0x68'));}else{return _0x2b5dca(_0xbe136e);}})[_0x24fc('0x4c')](function(_0x456690){return _0x11d0e0(_0x456690);});});;});};function addVoicePrefixExtensions(_0x8dbb4a,_0x24ca4b){var _0x354fc6=[];var _0x54ead5=formatPrefixName(_0x8dbb4a[_0x24fc('0x69')]);_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x2,_0x24fc('0x6b'),_0x24fc('0x6c')+_0x8dbb4a[_0x24fc('0x30')]));if(_0x8dbb4a[_0x24fc('0x6d')]){_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x6b'),'PREFIX-CALLERIDALL='+_0x8dbb4a[_0x24fc('0x6d')]));}else{_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x64'),_0x24fc('0x6e')));}_0x354fc6['push'](new Extension(_0x54ead5,0x4,_0x24fc('0x6f'),_0x24ca4b[_0x24fc('0x70')]+','+'${EXTEN:'+(0x8+_0x8dbb4a['name']['length'])+'}'+','+0x1));return _0x354fc6;}function formatPrefixName(_0x2ae2ac){var _0x698283='_';for(var _0x246ef1=0x0;_0x246ef1<_0x2ae2ac[_0x24fc('0x4f')];_0x246ef1++){if(_0x2ae2ac[_0x24fc('0x71')](_0x246ef1)=='-'){_0x698283+=_0x2ae2ac[_0x24fc('0x71')](_0x246ef1);}else{_0x698283+='['+_0x2ae2ac['charAt'](_0x246ef1)+']';}}_0x698283+='.';return _0x698283;}exports[_0x24fc('0x29')]=function(_0x15e8a3,_0x5a2c09,_0x51b1c0){var _0xfc6b7f=_0x15e8a3[_0x24fc('0x72')];_0xfc6b7f[_0x24fc('0x69')]='system-'+_0xfc6b7f[_0x24fc('0x30')]+'-';return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x4f5547){return db['VoicePrefix']['update'](_0xfc6b7f,{'where':{'id':_0xfc6b7f['id']},'transaction':_0x4f5547})['then'](function(){return db['VoiceExtension'][_0x24fc('0x2e')]({'where':{'VoicePrefixId':_0xfc6b7f['id']},'transaction':_0x4f5547})[_0x24fc('0x2a')](function(){return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0xfc6b7f['VoiceExtensionId']},'raw':!![]})[_0x24fc('0x2a')](function(_0x56dd0b){return createVoicePrefixExtensions(_0xfc6b7f,_0x56dd0b,_0x4f5547);});});});})[_0x24fc('0x2a')](function(){return db['VoicePrefix'][_0x24fc('0x73')](_0xfc6b7f['id']);})[_0x24fc('0x2a')](respondWithResult(_0x5a2c09,null))[_0x24fc('0x4c')](handleError(_0x5a2c09,null));};exports[_0x24fc('0x74')]=function(_0x3c4e2c,_0x291d60,_0x35c5f7){return db['VoicePrefix'][_0x24fc('0x50')]({'where':{'id':_0x3c4e2c[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x291d60,null))['then'](function(_0x5201e7){if(_0x5201e7){return _0x5201e7[_0x24fc('0x74')](_0x3c4e2c[_0x24fc('0x72')]['ids'],_[_0x24fc('0x75')](_0x3c4e2c[_0x24fc('0x72')],['ids','id'])||{})[_0x24fc('0x76')](function(_0x383503){for(var _0x5249ea=0x0;_0x5249ea<_0x3c4e2c[_0x24fc('0x72')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x5249ea+=0x1){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':Number(_0x3c4e2c[_0x24fc('0x72')]['ids'][_0x5249ea]),'VoicePrefixId':Number(_0x3c4e2c['params']['id'])});}return _0x383503;});}})[_0x24fc('0x2a')](respondWithResult(_0x291d60,null))['catch'](handleError(_0x291d60,null));};exports[_0x24fc('0x7a')]=function(_0x52d54e,_0x5233c5,_0x436652){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x52d54e[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x5233c5,null))[_0x24fc('0x2a')](function(_0x44eb26){if(_0x44eb26){return _0x44eb26[_0x24fc('0x7a')](_0x52d54e['query'][_0x24fc('0x77')])[_0x24fc('0x2a')](function(){if(_['isArray'](_0x52d54e['query'][_0x24fc('0x77')])){for(var _0x3cb0b5=0x0;_0x3cb0b5<_0x52d54e[_0x24fc('0x38')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x3cb0b5+=0x1){socket['emit'](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e[_0x24fc('0x38')]['ids'][_0x3cb0b5]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}}else{socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e['query'][_0x24fc('0x77')]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}});}})[_0x24fc('0x2a')](respondWithStatusCode(_0x5233c5,null))[_0x24fc('0x4c')](handleError(_0x5233c5,null));};exports[_0x24fc('0x7c')]=function(_0x1ce8cb,_0x17f88a,_0x46b320){var _0x188edb={};var _0x54f379={};var _0x7f4f80;var _0x2921a7;return db[_0x24fc('0x48')]['findOne']({'where':{'id':_0x1ce8cb['params']['id']}})['then'](handleEntityNotFound(_0x17f88a,null))[_0x24fc('0x2a')](function(_0x560c80){if(_0x560c80){_0x7f4f80=_0x560c80;_0x54f379[_0x24fc('0x36')]=_[_0x24fc('0x39')](db['User'][_0x24fc('0x33')]);_0x54f379['query']=_[_0x24fc('0x39')](_0x1ce8cb['query']);_0x54f379[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x54f379[_0x24fc('0x36')],_0x54f379[_0x24fc('0x38')]);_0x188edb[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x54f379['model'],qs[_0x24fc('0x3d')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x188edb[_0x24fc('0x3c')]=_0x188edb[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x188edb[_0x24fc('0x3c')]:_0x54f379[_0x24fc('0x36')];_0x188edb[_0x24fc('0x40')]=qs['sort'](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x41')]);_0x188edb[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_['pick'](_0x1ce8cb[_0x24fc('0x38')],_0x54f379[_0x24fc('0x3a')]));if(_0x1ce8cb[_0x24fc('0x38')]['filter']){_0x188edb[_0x24fc('0x44')]=_['merge'](_0x188edb['where'],{'$or':_['map'](_0x188edb[_0x24fc('0x3c')],function(_0x49c35c){var _0x29f1c1={};_0x29f1c1[_0x49c35c]={'$like':'%'+_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x29f1c1;})});}_0x188edb=_[_0x24fc('0x45')]({},_0x188edb,_0x1ce8cb['options']);return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x3d8394){if(_0x3d8394){_0x2921a7=_0x3d8394[_0x24fc('0x4f')];if(!_0x1ce8cb[_0x24fc('0x38')]['hasOwnProperty'](_0x24fc('0x7d'))){_0x188edb[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x1ce8cb[_0x24fc('0x38')]['limit']);_0x188edb['offset']=qs[_0x24fc('0x24')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x49e6f2){if(_0x49e6f2){return _0x49e6f2?{'count':_0x2921a7,'rows':_0x49e6f2}:null;}})[_0x24fc('0x2a')](respondWithResult(_0x17f88a,null))[_0x24fc('0x4c')](handleError(_0x17f88a,null));};exports[_0x24fc('0x7e')]=function(_0x5d5a59,_0xa8881f,_0x69a2cd){var _0x437233={};var _0x1e1474={};var _0xc52004;var _0x4c10d9;return db['VoicePrefix']['findOne']({'where':{'id':_0x5d5a59[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0xa8881f,null))[_0x24fc('0x2a')](function(_0x23a033){if(_0x23a033){_0xc52004=_0x23a033;_0x1e1474[_0x24fc('0x36')]=_[_0x24fc('0x39')](db[_0x24fc('0x7f')][_0x24fc('0x33')]);_0x1e1474[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5d5a59[_0x24fc('0x38')]);_0x1e1474[_0x24fc('0x3a')]=_['intersection'](_0x1e1474['model'],_0x1e1474[_0x24fc('0x38')]);_0x437233['attributes']=_[_0x24fc('0x3b')](_0x1e1474[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x437233[_0x24fc('0x3c')]=_0x437233[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x437233[_0x24fc('0x3c')]:_0x1e1474['model'];_0x437233[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x5d5a59['query']['sort']);_0x437233[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x5d5a59[_0x24fc('0x38')],_0x1e1474[_0x24fc('0x3a')]));if(_0x5d5a59[_0x24fc('0x38')]['filter']){_0x437233[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x437233[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x437233['attributes'],function(_0x2fb68a){var _0x10519f={};_0x10519f[_0x2fb68a]={'$like':'%'+_0x5d5a59[_0x24fc('0x38')]['filter']+'%'};return _0x10519f;})});}_0x437233=_[_0x24fc('0x45')]({},_0x437233,_0x5d5a59[_0x24fc('0x47')]);return _0xc52004[_0x24fc('0x7e')](_0x437233);}})['then'](function(_0x163a99){if(_0x163a99){_0x4c10d9=_0x163a99[_0x24fc('0x4f')];if(!_0x5d5a59['query']['hasOwnProperty'](_0x24fc('0x7d'))){_0x437233[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x437233[_0x24fc('0x24')]=qs['offset'](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0xc52004[_0x24fc('0x7e')](_0x437233);}})[_0x24fc('0x2a')](function(_0x6f8974){if(_0x6f8974){return _0x6f8974?{'count':_0x4c10d9,'rows':_0x6f8974}:null;}})[_0x24fc('0x2a')](respondWithResult(_0xa8881f,null))['catch'](handleError(_0xa8881f,null));};exports[_0x24fc('0x80')]=function(_0x4a2522,_0x5226aa,_0x260a62){var _0x19b426=_0x4a2522['body'][_0x24fc('0x77')];var _0x45e8da;return db[_0x24fc('0x7f')][_0x24fc('0x4a')]({'where':{'id':_0x19b426},'attributes':['id'],'include':[{'model':db['User'],'as':_0x24fc('0x81'),'attributes':['id',_0x24fc('0x30'),_0x24fc('0x82'),_0x24fc('0x83'),_0x24fc('0x84')],'raw':!![]}]})[_0x24fc('0x2a')](function(_0x4e31bd){if(_0x4e31bd){_0x45e8da=_0x4e31bd;var _0x492328=_['flatMap'](_0x4e31bd,function(_0xc4f001){var _0x3fb8fc=_0xc4f001['get']({'plain':!![]});return _0x3fb8fc[_0x24fc('0x81')];});return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x4a2522['params']['id']}})[_0x24fc('0x2a')](function(_0x15dbba){return db['sequelize']['transaction'](function(_0x33c581){return _0x15dbba[_0x24fc('0x80')](_0x19b426,{'transaction':_0x33c581})[_0x24fc('0x2a')](function(){return BPromise['each'](_0x45e8da,function(_0x2e4e38){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x2e4e38['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},{'transaction':_0x33c581});});})['then'](function(){return BPromise['each'](_0x492328,function(_0x6dee4c){return db['UserVoicePrefix'][_0x24fc('0x85')]({'where':{'UserId':_0x6dee4c['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},'transaction':_0x33c581});});})[_0x24fc('0x2a')](function(){_0x492328[_0x24fc('0x86')](function(_0x4ae346){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':_0x4ae346['id'],'VoicePrefixId':_0x15dbba['id']});});});});});}})['then'](respondWithStatusCode(_0x5226aa,null))[_0x24fc('0x4c')](handleError(_0x5226aa,null));};exports[_0x24fc('0x87')]=function(_0x30d523,_0x8b1efd,_0x2a19f9){return db['Team'][_0x24fc('0x4a')]({'where':{'id':_0x30d523[_0x24fc('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x24fc('0x88')],'as':_0x24fc('0x81'),'attributes':['id'],'raw':!![]}]})[_0x24fc('0x2a')](handleEntityNotFound(_0x8b1efd,null))[_0x24fc('0x2a')](function(_0x18197a){var _0x5aaa55=_[_0x24fc('0x37')](_0x18197a,'id');var _0x5d6e00=[];var _0x5c8969=[];var _0x42c158=squel[_0x24fc('0x89')]();_0x42c158[_0x24fc('0x8a')]('tq.TeamId')['from'](_0x24fc('0x8b'),'tq')[_0x24fc('0x8c')](_0x24fc('0x8d'),'ut',_0x24fc('0x8e'))[_0x24fc('0x44')](_0x24fc('0x8f'),_0x30d523[_0x24fc('0x4e')]['id']);for(var _0x1efb25=0x0;_0x1efb25<_0x18197a['length'];_0x1efb25+=0x1){let _0x5bbe2c=_0x18197a[_0x1efb25];for(var _0x316b8f=0x0;_0x316b8f<_0x5bbe2c['Agents']['length'];_0x316b8f+=0x1){let _0x1bf646=_0x5bbe2c[_0x24fc('0x81')][_0x316b8f];var _0x31c499=_0x42c158[_0x24fc('0x90')]();_0x31c499[_0x24fc('0x44')](_0x24fc('0x91'),_0x1bf646['id']);_0x5c8969[_0x24fc('0x6a')](db['sequelize'][_0x24fc('0x38')](_0x31c499[_0x24fc('0x92')](),{'type':db[_0x24fc('0x52')][_0x24fc('0x93')][_0x24fc('0x94')]})[_0x24fc('0x2a')](function(_0x3be176){if(_0x3be176[_0x24fc('0x4f')]===0x1){return _0x1bf646['id'];}else{var _0x9fd1b5=_[_0x24fc('0x95')](_[_0x24fc('0x37')](_0x3be176,_0x24fc('0x96')),function(_0x11ed4f){return _[_0x24fc('0x97')](_0x5aaa55,_0x11ed4f);});if(_0x9fd1b5){return _0x1bf646['id'];}}}));}}return BPromise[_0x24fc('0x98')](_0x5c8969)[_0x24fc('0x2a')](function(_0x29af09){_0x5d6e00=_(_0x5d6e00)[_0x24fc('0x99')](_0x29af09)[_0x24fc('0x9a')]()[_0x24fc('0x9b')]();return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x30d523[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](function(_0x219be8){return db['sequelize'][_0x24fc('0x53')](function(_0x4217f0){return _0x219be8[_0x24fc('0x87')](_0x30d523[_0x24fc('0x38')]['ids'],{'transaction':_0x4217f0})['then'](function(){if(!_['isEmpty'](_0x5d6e00)){return _0x219be8[_0x24fc('0x7a')](_0x5d6e00,{'transaction':_0x4217f0});}})['then'](function(){_0x5d6e00[_0x24fc('0x86')](function(_0x49e026){socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':_0x49e026,'VoicePrefixId':_0x219be8['id']});});});});});});})[_0x24fc('0x2a')](respondWithStatusCode(_0x8b1efd,null))[_0x24fc('0x4c')](handleError(_0x8b1efd,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index a93356d..d5aaf8e 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 _0x4b2f=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4f1af9,_0xc95c63){var _0x11a60e=function(_0x19de7f){while(--_0x19de7f){_0x4f1af9['push'](_0x4f1af9['shift']());}};_0x11a60e(++_0xc95c63);}(_0x4b2f,0x106));var _0xf4b2=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x4b2f[_0x44039a];return _0x525de5;};'use strict';var EventEmitter=require(_0xf4b2('0x0'));var VoicePrefix=require(_0xf4b2('0x1'))['db'][_0xf4b2('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf4b2('0x3')](0x0);var events={'afterCreate':_0xf4b2('0x4'),'afterUpdate':'update','afterDestroy':_0xf4b2('0x5')};function emitEvent(_0x5429a9){return function(_0x3d187b,_0x19e7b4,_0x358630){VoicePrefixEvents[_0xf4b2('0x6')](_0x5429a9+':'+_0x3d187b['id'],_0x3d187b);VoicePrefixEvents['emit'](_0x5429a9,_0x3d187b);_0x358630(null);};}for(var e in events){if(events[_0xf4b2('0x7')](e)){var event=events[e];VoicePrefix[_0xf4b2('0x8')](e,emitEvent(event));}}module[_0xf4b2('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x2572=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x339bf8,_0x24ed9b){var _0x4a82b3=function(_0x3aa707){while(--_0x3aa707){_0x339bf8['push'](_0x339bf8['shift']());}};_0x4a82b3(++_0x24ed9b);}(_0x2572,0x70));var _0x2257=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2572[_0x28947d];return _0x12d2ee;};'use strict';var EventEmitter=require(_0x2257('0x0'));var VoicePrefix=require(_0x2257('0x1'))['db'][_0x2257('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2257('0x3')](0x0);var events={'afterCreate':_0x2257('0x4'),'afterUpdate':_0x2257('0x5'),'afterDestroy':_0x2257('0x6')};function emitEvent(_0x3ffae1){return function(_0x2dccb3,_0x2f84ef,_0x469326){VoicePrefixEvents[_0x2257('0x7')](_0x3ffae1+':'+_0x2dccb3['id'],_0x2dccb3);VoicePrefixEvents['emit'](_0x3ffae1,_0x2dccb3);_0x469326(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x2257('0x8')](e,emitEvent(event));}}module[_0x2257('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 2e1cbf6..d30ee88 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 _0xeae2=['request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util','api','bluebird'];(function(_0x519c2b,_0x734ea){var _0x2abc77=function(_0x530a9d){while(--_0x530a9d){_0x519c2b['push'](_0x519c2b['shift']());}};_0x2abc77(++_0x734ea);}(_0xeae2,0x13d));var _0x2eae=function(_0x2d2acf,_0x44bd65){_0x2d2acf=_0x2d2acf-0x0;var _0x11127f=_0xeae2[_0x2d2acf];return _0x11127f;};'use strict';var _=require('lodash');var util=require(_0x2eae('0x0'));var logger=require('../../config/logger')(_0x2eae('0x1'));var moment=require('moment');var BPromise=require(_0x2eae('0x2'));var rp=require(_0x2eae('0x3'));var fs=require('fs');var path=require(_0x2eae('0x4'));var rimraf=require(_0x2eae('0x5'));var config=require(_0x2eae('0x6'));var attributes=require(_0x2eae('0x7'));module[_0x2eae('0x8')]=function(_0x225216,_0x361287){return _0x225216['define'](_0x2eae('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x780f=['exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2a7692,_0xf63b79){var _0x321408=function(_0x55d74e){while(--_0x55d74e){_0x2a7692['push'](_0x2a7692['shift']());}};_0x321408(++_0xf63b79);}(_0x780f,0x9d));var _0xf780=function(_0x51c52b,_0x147712){_0x51c52b=_0x51c52b-0x0;var _0x581ce3=_0x780f[_0x51c52b];return _0x581ce3;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var logger=require(_0xf780('0x2'))(_0xf780('0x3'));var moment=require('moment');var BPromise=require(_0xf780('0x4'));var rp=require(_0xf780('0x5'));var fs=require('fs');var path=require(_0xf780('0x6'));var rimraf=require('rimraf');var config=require(_0xf780('0x7'));var attributes=require('./voicePrefix.attributes');module[_0xf780('0x8')]=function(_0x5d9435,_0x668d4f){return _0x5d9435['define'](_0xf780('0x9'),attributes,{'tableName':_0xf780('0xa'),'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 8295221..cc9b11d 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 _0xa5c1=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voicePrefix.socket','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5b2e68,_0x339b1b){var _0x160b72=function(_0x4f1a40){while(--_0x4f1a40){_0x5b2e68['push'](_0x5b2e68['shift']());}};_0x160b72(++_0x339b1b);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x58b1c3,_0x5d1ded){_0x58b1c3=_0x58b1c3-0x0;var _0x1e6f8e=_0xa5c1[_0x58b1c3];return _0x1e6f8e;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});config[_0x1a5c('0xa')]=_['defaults'](config[_0x1a5c('0xa')],{'host':_0x1a5c('0xb'),'port':0x18eb});var socket=require(_0x1a5c('0xc'))(new Redis(config['redis']));require(_0x1a5c('0xd'))['register'](socket);function respondWithRpcPromise(_0x211e4b,_0x4edb10,_0x5097cf){return new BPromise(function(_0x1323be,_0x1ac373){return client['request'](_0x211e4b,_0x5097cf)[_0x1a5c('0xe')](function(_0x3f7368){logger[_0x1a5c('0xf')](_0x1a5c('0x10'),_0x4edb10,_0x1a5c('0x11'));logger[_0x1a5c('0x12')](_0x1a5c('0x13'),_0x4edb10,'request\x20sent',JSON[_0x1a5c('0x14')](_0x3f7368));if(_0x3f7368[_0x1a5c('0x15')]){if(_0x3f7368['error'][_0x1a5c('0x16')]===0x1f4){logger[_0x1a5c('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x4edb10,_0x3f7368[_0x1a5c('0x15')][_0x1a5c('0x17')]);return _0x1ac373(_0x3f7368[_0x1a5c('0x15')][_0x1a5c('0x17')]);}logger['error'](_0x1a5c('0x10'),_0x4edb10,_0x3f7368['error'][_0x1a5c('0x17')]);return _0x1323be(_0x3f7368[_0x1a5c('0x15')][_0x1a5c('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x4edb10,_0x1a5c('0x11'));_0x1323be(_0x3f7368[_0x1a5c('0x18')][_0x1a5c('0x17')]);}})[_0x1a5c('0x19')](function(_0x232798){logger['error'](_0x1a5c('0x10'),_0x4edb10,_0x232798);_0x1ac373(_0x232798);});});} \ No newline at end of file +var _0xb4d9=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb5e37f,_0xc624f1){var _0x23f431=function(_0x3ec670){while(--_0x3ec670){_0xb5e37f['push'](_0xb5e37f['shift']());}};_0x23f431(++_0xc624f1);}(_0xb4d9,0xce));var _0x9b4d=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb4d9[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var moment=require('moment');var BPromise=require(_0x9b4d('0x2'));var rs=require(_0x9b4d('0x3'));var fs=require('fs');var Redis=require(_0x9b4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b4d('0x5'));var logger=require(_0x9b4d('0x6'))(_0x9b4d('0x7'));var config=require(_0x9b4d('0x8'));var jayson=require(_0x9b4d('0x9'));var client=jayson[_0x9b4d('0xa')][_0x9b4d('0xb')]({'port':0x232a});config[_0x9b4d('0xc')]=_[_0x9b4d('0xd')](config[_0x9b4d('0xc')],{'host':_0x9b4d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b4d('0xc')]));require('./voicePrefix.socket')[_0x9b4d('0xf')](socket);function respondWithRpcPromise(_0x524f61,_0x209081,_0x3835fb){return new BPromise(function(_0x463d64,_0x18173c){return client[_0x9b4d('0x10')](_0x524f61,_0x3835fb)[_0x9b4d('0x11')](function(_0x3092e4){logger[_0x9b4d('0x12')](_0x9b4d('0x13'),_0x209081,_0x9b4d('0x14'));logger[_0x9b4d('0x15')](_0x9b4d('0x16'),_0x209081,'request\x20sent',JSON[_0x9b4d('0x17')](_0x3092e4));if(_0x3092e4[_0x9b4d('0x18')]){if(_0x3092e4[_0x9b4d('0x18')][_0x9b4d('0x19')]===0x1f4){logger['error'](_0x9b4d('0x13'),_0x209081,_0x3092e4['error']['message']);return _0x18173c(_0x3092e4[_0x9b4d('0x18')][_0x9b4d('0x1a')]);}logger[_0x9b4d('0x18')](_0x9b4d('0x13'),_0x209081,_0x3092e4[_0x9b4d('0x18')][_0x9b4d('0x1a')]);return _0x463d64(_0x3092e4['error']['message']);}else{logger[_0x9b4d('0x12')](_0x9b4d('0x13'),_0x209081,_0x9b4d('0x14'));_0x463d64(_0x3092e4[_0x9b4d('0x1b')][_0x9b4d('0x1a')]);}})[_0x9b4d('0x1c')](function(_0x1c277d){logger[_0x9b4d('0x18')](_0x9b4d('0x13'),_0x209081,_0x1c277d);_0x18173c(_0x1c277d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8136acb..b3e07f0 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 _0x8b1a=['length','voicePrefix:','./voicePrefix.events','save','remove','removeListener','register'];(function(_0x43af2e,_0x1b6991){var _0x39f771=function(_0x3b4b45){while(--_0x3b4b45){_0x43af2e['push'](_0x43af2e['shift']());}};_0x39f771(++_0x1b6991);}(_0x8b1a,0x152));var _0xa8b1=function(_0x1d109b,_0x258f57){_0x1d109b=_0x1d109b-0x0;var _0xa6d98a=_0x8b1a[_0x1d109b];return _0xa6d98a;};'use strict';var VoicePrefixEvents=require(_0xa8b1('0x0'));var events=[_0xa8b1('0x1'),_0xa8b1('0x2'),'update'];function createListener(_0x88101,_0x201783){return function(_0x39eb72){_0x201783['emit'](_0x88101,_0x39eb72);};}function removeListener(_0x353bea,_0x2427cc){return function(){VoicePrefixEvents[_0xa8b1('0x3')](_0x353bea,_0x2427cc);};}exports[_0xa8b1('0x4')]=function(_0x493b8e){for(var _0x90c588=0x0,_0x5db169=events[_0xa8b1('0x5')];_0x90c588<_0x5db169;_0x90c588++){var _0x459cf9=events[_0x90c588];var _0x5d958d=createListener(_0xa8b1('0x6')+_0x459cf9,_0x493b8e);VoicePrefixEvents['on'](_0x459cf9,_0x5d958d);}}; \ No newline at end of file +var _0x0fd9=['register','length','voicePrefix:','save','remove','update','emit','removeListener'];(function(_0xd6fcb5,_0x526523){var _0x278ac7=function(_0x3a9512){while(--_0x3a9512){_0xd6fcb5['push'](_0xd6fcb5['shift']());}};_0x278ac7(++_0x526523);}(_0x0fd9,0xa3));var _0x90fd=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x0fd9[_0x1e9424];return _0x1bd96c;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x90fd('0x0'),_0x90fd('0x1'),_0x90fd('0x2')];function createListener(_0x32f6b6,_0x546a58){return function(_0x4acbd9){_0x546a58[_0x90fd('0x3')](_0x32f6b6,_0x4acbd9);};}function removeListener(_0x2a5f76,_0xb7cf6){return function(){VoicePrefixEvents[_0x90fd('0x4')](_0x2a5f76,_0xb7cf6);};}exports[_0x90fd('0x5')]=function(_0x23e11b){for(var _0x5e2107=0x0,_0x4ff2d4=events[_0x90fd('0x6')];_0x5e2107<_0x4ff2d4;_0x5e2107++){var _0x50c778=events[_0x5e2107];var _0x5a604a=createListener(_0x90fd('0x7')+_0x50c778,_0x23e11b);VoicePrefixEvents['on'](_0x50c778,_0x5a604a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index e381739..9ce94f1 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(_0x3c3e68,_0x280a1e){var _0x4f0b42=function(_0xc74161){while(--_0xc74161){_0x3c3e68['push'](_0x3c3e68['shift']());}};_0x4f0b42(++_0x280a1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xb10b,0x12a));var _0xbb10=function(_0x118749,_0x50e848){_0x118749=_0x118749-0x0;var _0x20d489=_0xb10b[_0x118749];return _0x20d489;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index ab4617b..c463e47 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 _0xee93=['Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','outbound','inbound','default','ENUM','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','all','TEXT','periodic_announce','join','split','setDataValue','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate'];(function(_0x191cdc,_0x140a9d){var _0x4e53e3=function(_0x14c7a0){while(--_0x14c7a0){_0x191cdc['push'](_0x191cdc['shift']());}};_0x4e53e3(++_0x140a9d);}(_0xee93,0x78));var _0x3ee9=function(_0x57ce61,_0x40a9e9){_0x57ce61=_0x57ce61-0x0;var _0x1b17ee=_0xee93[_0x57ce61];return _0x1b17ee;};'use strict';var Sequelize=require(_0x3ee9('0x0'));module[_0x3ee9('0x1')]={'name':{'type':Sequelize[_0x3ee9('0x2')],'allowNull':![],'unique':_0x3ee9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x3ee9('0x4')),'allowNull':![],'defaultValue':_0x3ee9('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x3ee9('0x6')},'announce':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3ee9('0x7')]('rr',_0x3ee9('0x8'),_0x3ee9('0x9'),_0x3ee9('0xa'),'random',_0x3ee9('0xb'),_0x3ee9('0xc'),_0x3ee9('0xd'),_0x3ee9('0xe')),'allowNull':![],'defaultValue':_0x3ee9('0x8'),'set':function(_0x4a7756){this['setDataValue'](_0x3ee9('0xf'),_0x4a7756?_0x4a7756:_0x3ee9('0xb'));},'get':function(){var _0x32ec3b=this[_0x3ee9('0x10')](_0x3ee9('0x11'));var _0x40dc2b=this['getDataValue'](_0x3ee9('0x12'));var _0x28a585=this['getDataValue'](_0x3ee9('0xf'));if(_0x32ec3b==='outbound'){if(_0x40dc2b===_0x3ee9('0x13')){return null;}if(_0x40dc2b===_0x3ee9('0x14')&&!['rrmemory',_0x3ee9('0x15')][_0x3ee9('0x16')](_0x28a585)){this['setDataValue'](_0x3ee9('0xf'),_0x3ee9('0xb'));}}return _0x28a585;}},'servicelevel':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3ee9('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3ee9('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':_0x3ee9('0x18')},'autopause':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no',_0x3ee9('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3ee9('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3ee9('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3ee9('0x7')]('yes','no'),'defaultValue':_0x3ee9('0x18')},'announce_holdtime':{'type':Sequelize[_0x3ee9('0x7')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x3ee9('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3ee9('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3ee9('0x2')]},'queue_youarenext':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x3ee9('0x2')]},'queue_quantity2':{'type':Sequelize[_0x3ee9('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3ee9('0x2')]},'queue_less_than':{'type':Sequelize[_0x3ee9('0x2')]},'periodic_announce':{'type':Sequelize[_0x3ee9('0x1a')],'set':function(_0x1c8150){this['setDataValue'](_0x3ee9('0x1b'),_0x1c8150?_0x1c8150[_0x3ee9('0x1c')](','):[]);},'get':function(){return this[_0x3ee9('0x10')](_0x3ee9('0x1b'))?this[_0x3ee9('0x10')](_0x3ee9('0x1b'))[_0x3ee9('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':_0x3ee9('0x18'),'set':function(_0x179271){this[_0x3ee9('0x1e')](_0x3ee9('0x1f'),_0x179271?_0x179271[_0x3ee9('0x1c')](','):undefined);},'get':function(){return this[_0x3ee9('0x10')](_0x3ee9('0x1f'))?this[_0x3ee9('0x10')](_0x3ee9('0x1f'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':'no','set':function(_0x214819){this[_0x3ee9('0x1e')](_0x3ee9('0x20'),_0x214819?_0x214819[_0x3ee9('0x1c')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x3ee9('0x10')](_0x3ee9('0x20'))[_0x3ee9('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3ee9('0x2')]},'description':{'type':Sequelize[_0x3ee9('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x324e1f){this[_0x3ee9('0x1e')](_0x3ee9('0x21'),_0x324e1f);if(_0x324e1f){if(this[_0x3ee9('0x10')](_0x3ee9('0x22'))<0x2){this['setDataValue'](_0x3ee9('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':0x0,'comment':_0x3ee9('0x24')},'dialMethod':{'type':Sequelize['ENUM'](_0x3ee9('0x13'),'progressive','power','predictive',_0x3ee9('0x14')),'defaultValue':_0x3ee9('0x25'),'comment':_0x3ee9('0x26')},'dialLimitChannel':{'type':Sequelize[_0x3ee9('0x17')](0x4)[_0x3ee9('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3ee9('0x28')},'dialLimitQueue':{'type':Sequelize[_0x3ee9('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3ee9('0x29')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x3ee9('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3ee9('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x3ee9('0x7')]('agentBusyFactor',_0x3ee9('0x2b')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3ee9('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3ee9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':'tTxX','comment':_0x3ee9('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x2f')},'dialQueueProject':{'type':Sequelize[_0x3ee9('0x2')],'comment':_0x3ee9('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'comment':_0x3ee9('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':_0x3ee9('0x35')},'dialPrefix':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3ee9('0x36'),_0x3ee9('0x37'),'onlyIfOpen'),'defaultValue':_0x3ee9('0x36')},'dialAMDActive':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3ee9('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3ee9('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x3ee9('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ee9('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3ee9('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3ee9('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3ee9('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3ee9('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3ee9('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ee9('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3ee9('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':0x0,'comment':_0x3ee9('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x41'),_0x3ee9('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x3ee9('0x2')],'comment':_0x3ee9('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3ee9('0x43')},'dialCutDigit':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3ee9('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x45')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x3ee9('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':![],'comment':_0x3ee9('0x4f'),'set':function(_0x564a0e){if(!_0x564a0e)this[_0x3ee9('0x1e')](_0x3ee9('0x50'),null);this[_0x3ee9('0x1e')](_0x3ee9('0x51'),_0x564a0e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x05e5=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','outbound','inbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x05e5,0x153));var _0x505e=function(_0x15035b,_0x3eba0a){_0x15035b=_0x15035b-0x0;var _0x2cc7b1=_0x05e5[_0x15035b];return _0x2cc7b1;};'use strict';var Sequelize=require('sequelize');module[_0x505e('0x0')]={'name':{'type':Sequelize[_0x505e('0x1')],'allowNull':![],'unique':_0x505e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x505e('0x3')]('inbound',_0x505e('0x4')),'allowNull':![],'defaultValue':_0x505e('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x505e('0x6')},'announce':{'type':Sequelize[_0x505e('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x505e('0x3')]('rr',_0x505e('0x7'),'leastrecent',_0x505e('0x8'),_0x505e('0x9'),_0x505e('0xa'),_0x505e('0xb'),_0x505e('0xc'),_0x505e('0xd')),'allowNull':![],'defaultValue':_0x505e('0x7'),'set':function(_0x584369){this[_0x505e('0xe')](_0x505e('0xf'),_0x584369?_0x584369:_0x505e('0xa'));},'get':function(){var _0x3548a9=this[_0x505e('0x10')](_0x505e('0x11'));var _0x3e5e77=this['getDataValue'](_0x505e('0x12'));var _0x29e2f0=this[_0x505e('0x10')](_0x505e('0xf'));if(_0x3548a9==='outbound'){if(_0x3e5e77==='preview'){return null;}if(_0x3e5e77===_0x505e('0x13')&&![_0x505e('0xa'),_0x505e('0x14')][_0x505e('0x15')](_0x29e2f0)){this[_0x505e('0xe')](_0x505e('0xf'),_0x505e('0xa'));}}return _0x29e2f0;}},'servicelevel':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x505e('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x505e('0x16')](0xb)},'timeout':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x505e('0x1')]},'weight':{'type':Sequelize[_0x505e('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':_0x505e('0x17')},'autopause':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no',_0x505e('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x505e('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x505e('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x505e('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x505e('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x505e('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x505e('0x3')]('yes','no'),'defaultValue':_0x505e('0x17')},'announce_holdtime':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no',_0x505e('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x505e('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x505e('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x505e('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x505e('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x505e('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x505e('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x505e('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x505e('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x505e('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x505e('0x1')]},'queue_less_than':{'type':Sequelize[_0x505e('0x1')]},'periodic_announce':{'type':Sequelize[_0x505e('0x1a')],'set':function(_0x5412da){this[_0x505e('0xe')](_0x505e('0x1b'),_0x5412da?_0x5412da[_0x505e('0x1c')](','):[]);},'get':function(){return this[_0x505e('0x10')](_0x505e('0x1b'))?this[_0x505e('0x10')](_0x505e('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x505e('0x1')],'defaultValue':_0x505e('0x17'),'set':function(_0x246a76){this[_0x505e('0xe')]('joinempty',_0x246a76?_0x246a76[_0x505e('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x505e('0x1d'))?this[_0x505e('0x10')]('joinempty')[_0x505e('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x505e('0x1')],'defaultValue':'no','set':function(_0x4f0b2a){this[_0x505e('0xe')](_0x505e('0x1f'),_0x4f0b2a?_0x4f0b2a[_0x505e('0x1c')](','):undefined);},'get':function(){return this[_0x505e('0x10')](_0x505e('0x1f'))?this[_0x505e('0x10')](_0x505e('0x1f'))[_0x505e('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x505e('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x505e('0x20')],'defaultValue':0x0,'set':function(_0x9dc00b){this[_0x505e('0xe')](_0x505e('0x21'),_0x9dc00b);if(_0x9dc00b){if(this[_0x505e('0x10')](_0x505e('0x22'))<0x2){this[_0x505e('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x505e('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x505e('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x505e('0x3')]('preview',_0x505e('0x23'),_0x505e('0x24'),_0x505e('0x25'),_0x505e('0x13')),'defaultValue':_0x505e('0x23'),'comment':_0x505e('0x26')},'dialLimitChannel':{'type':Sequelize[_0x505e('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x505e('0x27')},'dialLimitQueue':{'type':Sequelize[_0x505e('0x16')](0x4)[_0x505e('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x505e('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x505e('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x505e('0x3')](_0x505e('0x2b'),'dropRate'),'defaultValue':_0x505e('0x2c'),'comment':_0x505e('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x505e('0x29')](0x2)[_0x505e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x505e('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x505e('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x505e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x505e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x505e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x505e('0x30')},'dialQueueOptions':{'type':Sequelize[_0x505e('0x1')],'defaultValue':_0x505e('0x31'),'comment':_0x505e('0x32')},'dialQueueTimeout':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x505e('0x33')},'dialQueueProject':{'type':Sequelize[_0x505e('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x505e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x505e('0x16')](0x5)[_0x505e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x505e('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x505e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x505e('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x505e('0x16')](0x5)[_0x505e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x505e('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x505e('0x28')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x505e('0x37')},'dialTimezone':{'type':Sequelize[_0x505e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x505e('0x1')],'defaultValue':_0x505e('0x38')},'dialPrefix':{'type':Sequelize[_0x505e('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x505e('0x3')]('always','never',_0x505e('0x39')),'defaultValue':_0x505e('0x3a')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x505e('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x505e('0x16')](0x9)[_0x505e('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x505e('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x505e('0x16')](0x9)[_0x505e('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x505e('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x505e('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x505e('0x16')](0x9)[_0x505e('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x505e('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x505e('0x16')](0x9)[_0x505e('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x505e('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x505e('0x16')](0x9)[_0x505e('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x505e('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x505e('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x505e('0x16')](0x5)[_0x505e('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x505e('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x505e('0x16')](0x9)[_0x505e('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x505e('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x505e('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x505e('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x505e('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x505e('0x45'),_0x505e('0x46')),'defaultValue':_0x505e('0x45')},'dialQueueProject2':{'type':Sequelize[_0x505e('0x1')],'comment':_0x505e('0x47')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x505e('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x505e('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x505e('0x48')},'dialCutDigit':{'type':Sequelize[_0x505e('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x505e('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x505e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x505e('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x505e('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x505e('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x505e('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x505e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x505e('0x4d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x505e('0x16')](0x5)[_0x505e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x505e('0x4e')},'dialMachineMaxRetry':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x505e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x505e('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x505e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x505e('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x505e('0x16')](0x5)[_0x505e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x505e('0x16')],'allowNull':!![],'comment':_0x505e('0x51')},'mandatoryDisposition':{'type':Sequelize[_0x505e('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x37d37c){if(!_0x37d37c)this['setDataValue'](_0x505e('0x52'),null);this[_0x505e('0xe')](_0x505e('0x53'),_0x37d37c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x505e('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x505e('0x16')](0x3)[_0x505e('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x505e('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index a3df850..c49d02c 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 _0xaafc=['sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','end','error','stack','send','index','fieldName','model','keys','filters','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','rows','catch','show','params','intersection','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','order','getHopperHistories','findOne','CmHopperHistory','VoiceQueueId','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','online','voicePause','interface','Agents','forEach','penalty','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','addAgents','userVoiceQueue:save','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','cm_hopper','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x1733e5,_0x296d54){var _0x232fa1=function(_0x595ae8){while(--_0x595ae8){_0x1733e5['push'](_0x1733e5['shift']());}};_0x232fa1(++_0x296d54);}(_0xaafc,0x176));var _0xcaaf=function(_0x5618ce,_0x3b99ac){_0x5618ce=_0x5618ce-0x0;var _0x59fa1a=_0xaafc[_0x5618ce];return _0x59fa1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaaf('0x0'));var zipdir=require(_0xcaaf('0x1'));var jsonpatch=require(_0xcaaf('0x2'));var rp=require(_0xcaaf('0x3'));var moment=require('moment');var BPromise=require(_0xcaaf('0x4'));var Mustache=require(_0xcaaf('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcaaf('0x6'));var csv=require('to-csv');var ejs=require(_0xcaaf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaaf('0x8'));var squel=require(_0xcaaf('0x9'));var crypto=require(_0xcaaf('0xa'));var jsforce=require(_0xcaaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcaaf('0xc'));var querystring=require('querystring');var Papa=require(_0xcaaf('0xd'));var Redis=require('ioredis');var authService=require(_0xcaaf('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcaaf('0xf'));var hardwareService=require(_0xcaaf('0x10'));var logger=require(_0xcaaf('0x11'))(_0xcaaf('0x12'));var utils=require(_0xcaaf('0x13'));var config=require(_0xcaaf('0x14'));var licenseUtil=require(_0xcaaf('0x15'));var db=require(_0xcaaf('0x16'))['db'];config[_0xcaaf('0x17')]=_['defaults'](config[_0xcaaf('0x17')],{'host':_0xcaaf('0x18'),'port':0x18eb});var socket=require(_0xcaaf('0x19'))(new Redis(config[_0xcaaf('0x17')]));require(_0xcaaf('0x1a'))[_0xcaaf('0x1b')](socket);function respondWithStatusCode(_0x6afc3,_0x439c40){_0x439c40=_0x439c40||0xcc;return function(_0x42861d){if(_0x42861d){return _0x6afc3[_0xcaaf('0x1c')](_0x439c40);}return _0x6afc3[_0xcaaf('0x1d')](_0x439c40)['end']();};}function respondWithResult(_0x301344,_0xb8532b){_0xb8532b=_0xb8532b||0xc8;return function(_0x7f23fb){if(_0x7f23fb){return _0x301344[_0xcaaf('0x1d')](_0xb8532b)[_0xcaaf('0x1e')](_0x7f23fb);}};}function respondWithFilteredResult(_0x360078,_0x4b55e3){return function(_0xf8e303){if(_0xf8e303){var _0x10ad54=typeof _0x4b55e3['offset']===_0xcaaf('0x1f')&&typeof _0x4b55e3[_0xcaaf('0x20')]===_0xcaaf('0x1f');var _0x43631b=_0xf8e303[_0xcaaf('0x21')];var _0x535eb8=_0x10ad54?0x0:_0x4b55e3[_0xcaaf('0x22')];var _0x731e33=_0x10ad54?_0xf8e303[_0xcaaf('0x21')]:_0x4b55e3[_0xcaaf('0x22')]+_0x4b55e3[_0xcaaf('0x20')];var _0x5bdc7a;if(_0x731e33>=_0x43631b){_0x731e33=_0x43631b;_0x5bdc7a=0xc8;}else{_0x5bdc7a=0xce;}_0x360078[_0xcaaf('0x1d')](_0x5bdc7a);return _0x360078[_0xcaaf('0x23')](_0xcaaf('0x24'),_0x535eb8+'-'+_0x731e33+'/'+_0x43631b)[_0xcaaf('0x1e')](_0xf8e303);}return null;};}function patchUpdates(_0x359339){return function(_0x16f83d){try{jsonpatch[_0xcaaf('0x25')](_0x16f83d,_0x359339,!![]);}catch(_0x5e0463){return BPromise[_0xcaaf('0x26')](_0x5e0463);}return _0x16f83d[_0xcaaf('0x27')]();};}function saveUpdates(_0x3f62c8,_0x4c1dcd){return function(_0x34f878){if(_0x34f878){return _0x34f878[_0xcaaf('0x28')](_0x3f62c8)[_0xcaaf('0x29')](function(_0x3dac7d){return _0x3dac7d;});}return null;};}function removeEntity(_0x2a6d15,_0x4346e2){return function(_0x1cc1fb){if(_0x1cc1fb){return _0x1cc1fb['destroy']()[_0xcaaf('0x29')](function(){var _0x52145b=_0x1cc1fb['get']({'plain':!![]});var _0x548b1d=[{'name':_0xcaaf('0x2a'),'value':_0xcaaf('0x2b'),'ignore':![]},{'name':_0xcaaf('0x2c'),'value':_0xcaaf('0x2d'),'ignore':![]}];var _0xc98ce4=_(_0x548b1d)[_0xcaaf('0x2e')](_0xcaaf('0x2f'))[_0xcaaf('0x30')](_0xcaaf('0x31'))['value']();if(_['includes'](_0xc98ce4,_0x52145b[_0xcaaf('0x32')])){return;}var _0x563769=_[_0xcaaf('0x33')](_0x548b1d,['value',_0x52145b[_0xcaaf('0x32')]])[_0xcaaf('0x34')];return db[_0xcaaf('0x35')][_0xcaaf('0x36')]({'where':{'type':_0x563769,'resourceId':_0x52145b['id']}})['then'](function(){return _0x1cc1fb;});})[_0xcaaf('0x29')](function(){_0x2a6d15[_0xcaaf('0x1d')](0xcc)[_0xcaaf('0x37')]();});}};}function handleEntityNotFound(_0x571948,_0x4b204a){return function(_0x120e52){if(!_0x120e52){_0x571948[_0xcaaf('0x1c')](0x194);}return _0x120e52;};}function handleError(_0x5696e4,_0x38a8eb){_0x38a8eb=_0x38a8eb||0x1f4;return function(_0x315565){logger[_0xcaaf('0x38')](_0x315565[_0xcaaf('0x39')]);if(_0x315565[_0xcaaf('0x34')]){delete _0x315565[_0xcaaf('0x34')];}_0x5696e4[_0xcaaf('0x1d')](_0x38a8eb)[_0xcaaf('0x3a')](_0x315565);};}exports[_0xcaaf('0x3b')]=function(_0x4f1eb1,_0x48b018){var _0x318e42={},_0x581c02={},_0xf88073={'count':0x0,'rows':[]};var _0x351beb=_[_0xcaaf('0x30')](db['VoiceQueue']['rawAttributes'],function(_0x41b0f0){return{'name':_0x41b0f0[_0xcaaf('0x3c')],'type':_0x41b0f0['type']['key']};});_0x581c02[_0xcaaf('0x3d')]=_[_0xcaaf('0x30')](_0x351beb,_0xcaaf('0x34'));_0x581c02['query']=_[_0xcaaf('0x3e')](_0x4f1eb1['query']);_0x581c02[_0xcaaf('0x3f')]=_['intersection'](_0x581c02[_0xcaaf('0x3d')],_0x581c02[_0xcaaf('0x40')]);_0x318e42['attributes']=_['intersection'](_0x581c02[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x4f1eb1['query'][_0xcaaf('0x41')]));_0x318e42[_0xcaaf('0x42')]=_0x318e42['attributes'][_0xcaaf('0x43')]?_0x318e42['attributes']:_0x581c02[_0xcaaf('0x3d')];if(!_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x318e42[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x318e42[_0xcaaf('0x22')]=qs['offset'](_0x4f1eb1['query'][_0xcaaf('0x22')]);}_0x318e42['order']=qs[_0xcaaf('0x46')](_0x4f1eb1['query'][_0xcaaf('0x46')]);_0x318e42[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x4f1eb1['query'],_0x581c02[_0xcaaf('0x3f')]),_0x351beb);if(_0x4f1eb1[_0xcaaf('0x40')]['filter']){_0x318e42[_0xcaaf('0x47')]=_[_0xcaaf('0x49')](_0x318e42[_0xcaaf('0x47')],{'$or':_[_0xcaaf('0x30')](_0x351beb,function(_0xc45f78){if(_0xc45f78[_0xcaaf('0x32')]!==_0xcaaf('0x4a')){var _0xaed7a3={};_0xaed7a3[_0xc45f78[_0xcaaf('0x34')]]={'$like':'%'+_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x2e')]+'%'};return _0xaed7a3;}})});}_0x318e42=_[_0xcaaf('0x49')]({},_0x318e42,_0x4f1eb1[_0xcaaf('0x4b')]);var _0x307f3c={'where':_0x318e42[_0xcaaf('0x47')]};return db[_0xcaaf('0x4c')]['count'](_0x307f3c)['then'](function(_0x4849e9){_0xf88073['count']=_0x4849e9;if(_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x4d')]){_0x318e42[_0xcaaf('0x4e')]=[{'all':!![]}];}return db[_0xcaaf('0x4c')]['findAll'](_0x318e42);})['then'](function(_0x50eeb1){_0xf88073[_0xcaaf('0x4f')]=_0x50eeb1;return _0xf88073;})[_0xcaaf('0x29')](respondWithFilteredResult(_0x48b018,_0x318e42))[_0xcaaf('0x50')](handleError(_0x48b018,null));};exports[_0xcaaf('0x51')]=function(_0x1d4304,_0x389374){var _0x3e5e78={'raw':![],'where':{'id':_0x1d4304[_0xcaaf('0x52')]['id']}},_0x549326={};_0x549326[_0xcaaf('0x3d')]=_['keys'](db['VoiceQueue']['rawAttributes']);_0x549326[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x1d4304['query']);_0x549326[_0xcaaf('0x3f')]=_['intersection'](_0x549326['model'],_0x549326[_0xcaaf('0x40')]);_0x3e5e78[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x549326[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x1d4304[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x3e5e78['attributes']=_0x3e5e78[_0xcaaf('0x42')]['length']?_0x3e5e78[_0xcaaf('0x42')]:_0x549326[_0xcaaf('0x3d')];if(_0x1d4304[_0xcaaf('0x40')][_0xcaaf('0x4d')]){_0x3e5e78['include']=[{'all':!![]}];}_0x3e5e78=_[_0xcaaf('0x49')]({},_0x3e5e78,_0x1d4304['options']);return db[_0xcaaf('0x4c')][_0xcaaf('0x33')](_0x3e5e78)[_0xcaaf('0x29')](handleEntityNotFound(_0x389374,null))[_0xcaaf('0x29')](respondWithResult(_0x389374,null))[_0xcaaf('0x50')](handleError(_0x389374,null));};exports[_0xcaaf('0x54')]=function(_0x7ce144,_0xb003d4){return db['VoiceQueue'][_0xcaaf('0x54')](_0x7ce144[_0xcaaf('0x55')],{})['then'](function(_0x2fe994){var _0x5a84ab=_0x7ce144[_0xcaaf('0x56')][_0xcaaf('0x57')]({'plain':!![]});if(!_0x5a84ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a84ab[_0xcaaf('0x58')]===_0xcaaf('0x56')){var _0x596c5e=_0x2fe994[_0xcaaf('0x57')]({'plain':!![]});var _0x4ab689=[{'name':_0xcaaf('0x2a'),'value':'inbound'},{'name':_0xcaaf('0x2c'),'value':_0xcaaf('0x2d')}];var _0xd456d4=_[_0xcaaf('0x33')](_0x4ab689,[_0xcaaf('0x31'),_0x596c5e[_0xcaaf('0x32')]])[_0xcaaf('0x34')];return db[_0xcaaf('0x59')][_0xcaaf('0x33')]({'where':{'name':_0xd456d4,'userProfileId':_0x5a84ab[_0xcaaf('0x5a')]},'raw':!![]})[_0xcaaf('0x29')](function(_0x516c6c){if(_0x516c6c&&_0x516c6c[_0xcaaf('0x5b')]===0x0){return db[_0xcaaf('0x35')][_0xcaaf('0x54')]({'name':_0x596c5e[_0xcaaf('0x34')],'resourceId':_0x596c5e['id'],'type':_0x516c6c[_0xcaaf('0x34')],'sectionId':_0x516c6c['id']},{})[_0xcaaf('0x29')](function(){return _0x2fe994;});}else{return _0x2fe994;}})[_0xcaaf('0x50')](function(_0x2aabf8){logger[_0xcaaf('0x38')](_0xcaaf('0x5c'),_0x2aabf8);throw _0x2aabf8;});}return _0x2fe994;})['then'](respondWithResult(_0xb003d4,0xc9))['catch'](handleError(_0xb003d4,null));};exports[_0xcaaf('0x5d')]=function(_0x6807c6,_0x5c9b2b){var _0x8fc513={'where':{'id':_0x6807c6['params']['id']}},_0x233695={};_0x233695[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db['VoiceQueue'][_0xcaaf('0x5e')]);_0x8fc513[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x233695['model'],qs[_0xcaaf('0x41')](_0x6807c6[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x8fc513[_0xcaaf('0x42')]=_0x8fc513[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x8fc513[_0xcaaf('0x42')]:_0x233695['model'];if(_0x6807c6['query'][_0xcaaf('0x4d')]){_0x8fc513[_0xcaaf('0x4e')]=[{'all':!![]}];}_0x8fc513=_[_0xcaaf('0x49')]({},_0x8fc513,_0x6807c6['options']);return db[_0xcaaf('0x4c')][_0xcaaf('0x33')](_0x8fc513)['then'](handleEntityNotFound(_0x5c9b2b,null))[_0xcaaf('0x29')](function(_0x328a53){if(_0x328a53){var _0x21df31=_0x328a53[_0xcaaf('0x57')]({'plain':!![]});_0x21df31=qs[_0xcaaf('0x5f')](_0x21df31,['id','createdAt',_0xcaaf('0x60')]);_0x6807c6[_0xcaaf('0x55')]=_[_0xcaaf('0x5f')](_0x6807c6[_0xcaaf('0x55')],['id',_0xcaaf('0x61'),_0xcaaf('0x60')]);return db[_0xcaaf('0x4c')]['create'](_[_0xcaaf('0x49')](_0x21df31,_0x6807c6['body']),{'include':_0x6807c6[_0xcaaf('0x40')]['includeAll']?[{'all':!![]}]:undefined})[_0xcaaf('0x29')](function(_0x2ff77a){var _0x21b3bc=_0x6807c6[_0xcaaf('0x56')][_0xcaaf('0x57')]({'plain':!![]});if(!_0x21b3bc)throw new Error(_0xcaaf('0x62'));if(_0x21b3bc['role']===_0xcaaf('0x56')){var _0x324d87=_0x2ff77a[_0xcaaf('0x57')]({'plain':!![]});var _0x277854=[{'name':_0xcaaf('0x2a'),'value':_0xcaaf('0x2b')},{'name':_0xcaaf('0x2c'),'value':_0xcaaf('0x2d')}];var _0x3ff275=_[_0xcaaf('0x33')](_0x277854,['value',_0x324d87[_0xcaaf('0x32')]])['name'];return db[_0xcaaf('0x59')][_0xcaaf('0x33')]({'where':{'name':_0x3ff275,'userProfileId':_0x21b3bc[_0xcaaf('0x5a')]},'raw':!![]})[_0xcaaf('0x29')](function(_0x5066cb){if(_0x5066cb&&_0x5066cb[_0xcaaf('0x5b')]===0x0){return db[_0xcaaf('0x35')][_0xcaaf('0x54')]({'name':_0x324d87[_0xcaaf('0x34')],'resourceId':_0x324d87['id'],'type':_0x5066cb[_0xcaaf('0x34')],'sectionId':_0x5066cb['id']},{})['then'](function(){return _0x2ff77a;});}else{return _0x2ff77a;}})[_0xcaaf('0x50')](function(_0x128bf6){logger[_0xcaaf('0x38')](_0xcaaf('0x5c'),_0x128bf6);throw _0x128bf6;});}return _0x2ff77a;});}})[_0xcaaf('0x29')](respondWithResult(_0x5c9b2b,0xc9))[_0xcaaf('0x50')](handleError(_0x5c9b2b,null));};exports[_0xcaaf('0x28')]=function(_0x459131,_0x5bc89e){if(_0x459131[_0xcaaf('0x55')]['id']){delete _0x459131['body']['id'];}return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x459131[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x5bc89e,null))['then'](saveUpdates(_0x459131[_0xcaaf('0x55')],null))['then'](respondWithResult(_0x5bc89e,null))[_0xcaaf('0x50')](handleError(_0x5bc89e,null));};exports[_0xcaaf('0x36')]=function(_0x260eb7,_0xb3f865){return db[_0xcaaf('0x4c')]['find']({'where':{'id':_0x260eb7['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0xb3f865,null))[_0xcaaf('0x29')](removeEntity(_0xb3f865,null))[_0xcaaf('0x50')](handleError(_0xb3f865,null));};exports[_0xcaaf('0x63')]=function(_0x1b27df,_0x170c15,_0x500c95){var _0x11e4a3={'raw':![],'where':{}};var _0x30b544={};var _0x5614c8={'count':0x0,'rows':[]};return db[_0xcaaf('0x4c')]['findOne']({'where':{'id':_0x1b27df[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x170c15,null))['then'](function(_0x58f134){if(_0x58f134){_0x30b544[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x64')][_0xcaaf('0x5e')]);_0x30b544[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x1b27df[_0xcaaf('0x40')]);_0x30b544[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0x30b544[_0xcaaf('0x3d')],_0x30b544[_0xcaaf('0x40')]);_0x11e4a3[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x30b544['model'],qs[_0xcaaf('0x41')](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x11e4a3[_0xcaaf('0x42')]=_0x11e4a3[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x11e4a3['attributes']:_0x30b544['model'];if(!_0x1b27df[_0xcaaf('0x40')]['hasOwnProperty'](_0xcaaf('0x45'))){_0x11e4a3[_0xcaaf('0x20')]=qs['limit'](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x11e4a3['offset']=qs[_0xcaaf('0x22')](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x22')]);}_0x11e4a3[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x11e4a3['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x1b27df[_0xcaaf('0x40')],_0x30b544[_0xcaaf('0x3f')]));_0x11e4a3[_0xcaaf('0x47')]['VoiceQueueId']=_0x58f134['id'];if(_0x1b27df[_0xcaaf('0x40')]['filter']){_0x11e4a3[_0xcaaf('0x47')]=_['merge'](_0x11e4a3[_0xcaaf('0x47')],{'$or':_['map'](_0x11e4a3['attributes'],function(_0x3d45df){var _0x31113e={};_0x31113e[_0x3d45df]={'$like':'%'+_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x2e')]+'%'};return _0x31113e;})});}_0x11e4a3=_[_0xcaaf('0x49')]({},_0x11e4a3,_0x1b27df['options']);return db[_0xcaaf('0x64')][_0xcaaf('0x21')]({'where':_0x11e4a3[_0xcaaf('0x47')]})[_0xcaaf('0x29')](function(_0x5d358a){_0x5614c8['count']=_0x5d358a;if(_0x1b27df['query'][_0xcaaf('0x4d')]){_0x11e4a3[_0xcaaf('0x4e')]=[{'all':!![]}];}return db[_0xcaaf('0x64')]['findAll'](_0x11e4a3);})[_0xcaaf('0x29')](function(_0x216853){_0x5614c8['rows']=_0x216853;return _0x5614c8;});}})['then'](respondWithFilteredResult(_0x170c15,_0x11e4a3))[_0xcaaf('0x50')](handleError(_0x170c15,null));};exports[_0xcaaf('0x66')]=function(_0x4acd87,_0x575eed,_0x5eb172){var _0x2ffad7={'raw':!![],'where':{}};var _0xf998a0={};var _0xd7242f={'count':0x0,'rows':[]};return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x4acd87['params']['id']}})['then'](handleEntityNotFound(_0x575eed,null))[_0xcaaf('0x29')](function(_0x208b08){if(_0x208b08){_0xf998a0['model']=_[_0xcaaf('0x3e')](db[_0xcaaf('0x68')]['rawAttributes']);_0xf998a0[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x4acd87[_0xcaaf('0x40')]);_0xf998a0[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0xf998a0[_0xcaaf('0x3d')],_0xf998a0[_0xcaaf('0x40')]);_0x2ffad7[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0xf998a0[_0xcaaf('0x3d')],qs['fields'](_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x2ffad7[_0xcaaf('0x42')]=_0x2ffad7['attributes'][_0xcaaf('0x43')]?_0x2ffad7[_0xcaaf('0x42')]:_0xf998a0[_0xcaaf('0x3d')];if(!_0x4acd87[_0xcaaf('0x40')]['hasOwnProperty'](_0xcaaf('0x45'))){_0x2ffad7['limit']=qs['limit'](_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x2ffad7['offset']=qs[_0xcaaf('0x22')](_0x4acd87[_0xcaaf('0x40')]['offset']);}_0x2ffad7[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x4acd87[_0xcaaf('0x40')]['sort']);_0x2ffad7[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x4acd87[_0xcaaf('0x40')],_0xf998a0[_0xcaaf('0x3f')]));_0x2ffad7[_0xcaaf('0x47')][_0xcaaf('0x69')]=_0x208b08['id'];if(_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x2ffad7['where']=_[_0xcaaf('0x49')](_0x2ffad7[_0xcaaf('0x47')],{'$or':_['map'](_0x2ffad7['attributes'],function(_0x3a631c){var _0x29a759={};_0x29a759[_0x3a631c]={'$like':'%'+_0x4acd87['query']['filter']+'%'};return _0x29a759;})});}_0x2ffad7=_[_0xcaaf('0x49')]({},_0x2ffad7,_0x4acd87[_0xcaaf('0x4b')]);return db[_0xcaaf('0x68')][_0xcaaf('0x21')]({'where':_0x2ffad7[_0xcaaf('0x47')]})[_0xcaaf('0x29')](function(_0x33a955){_0xd7242f[_0xcaaf('0x21')]=_0x33a955;if(_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x4d')]){_0x2ffad7['include']=[{'all':!![]}];}return db[_0xcaaf('0x68')][_0xcaaf('0x6a')](_0x2ffad7);})[_0xcaaf('0x29')](function(_0x39db13){_0xd7242f['rows']=_0x39db13;return _0xd7242f;});}})[_0xcaaf('0x29')](respondWithFilteredResult(_0x575eed,_0x2ffad7))[_0xcaaf('0x50')](handleError(_0x575eed,null));};exports[_0xcaaf('0x6b')]=function(_0x41940c,_0xb29707,_0x350d7c){var _0x19ce1a={'raw':!![],'where':{}};var _0x3ba3f7={};var _0x533b5d={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x41940c[_0xcaaf('0x52')]['id']}})['then'](handleEntityNotFound(_0xb29707,null))['then'](function(_0x134c09){if(_0x134c09){_0x3ba3f7[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x6c')][_0xcaaf('0x5e')]);_0x3ba3f7[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x41940c[_0xcaaf('0x40')]);_0x3ba3f7[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0x3ba3f7[_0xcaaf('0x3d')],_0x3ba3f7[_0xcaaf('0x40')]);_0x19ce1a['attributes']=_[_0xcaaf('0x53')](_0x3ba3f7[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x41940c['query'][_0xcaaf('0x41')]));_0x19ce1a[_0xcaaf('0x42')]=_0x19ce1a[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x19ce1a[_0xcaaf('0x42')]:_0x3ba3f7['model'];if(!_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x19ce1a[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x19ce1a[_0xcaaf('0x22')]=qs[_0xcaaf('0x22')](_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x22')]);}_0x19ce1a[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x41940c['query']['sort']);_0x19ce1a['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x41940c[_0xcaaf('0x40')],_0x3ba3f7[_0xcaaf('0x3f')]));_0x19ce1a[_0xcaaf('0x47')][_0xcaaf('0x69')]=_0x134c09['id'];if(_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x19ce1a[_0xcaaf('0x47')]=_[_0xcaaf('0x49')](_0x19ce1a['where'],{'$or':_[_0xcaaf('0x30')](_0x19ce1a[_0xcaaf('0x42')],function(_0x3edfba){var _0x57c543={};_0x57c543[_0x3edfba]={'$like':'%'+_0x41940c[_0xcaaf('0x40')]['filter']+'%'};return _0x57c543;})});}_0x19ce1a=_[_0xcaaf('0x49')]({},_0x19ce1a,_0x41940c['options']);return db[_0xcaaf('0x6c')][_0xcaaf('0x21')]({'where':_0x19ce1a['where']})['then'](function(_0x45ceb0){_0x533b5d[_0xcaaf('0x21')]=_0x45ceb0;if(_0x41940c[_0xcaaf('0x40')]['includeAll']){_0x19ce1a[_0xcaaf('0x4e')]=[{'all':!![]}];}return db[_0xcaaf('0x6c')]['findAll'](_0x19ce1a);})[_0xcaaf('0x29')](function(_0x247eed){_0x533b5d['rows']=_0x247eed;return _0x533b5d;});}})[_0xcaaf('0x29')](respondWithFilteredResult(_0xb29707,_0x19ce1a))[_0xcaaf('0x50')](handleError(_0xb29707,null));};exports[_0xcaaf('0x6d')]=function(_0x13ce94,_0x3f3943,_0x3129a9){var _0xbf198f={'raw':!![],'where':{}};var _0xb3f5f7={};var _0x1d6a0c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xcaaf('0x67')]({'where':{'id':_0x13ce94['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x3f3943,null))['then'](function(_0x2946f0){if(_0x2946f0){_0xb3f5f7[_0xcaaf('0x3d')]=_['keys'](db[_0xcaaf('0x6e')][_0xcaaf('0x5e')]);_0xb3f5f7['query']=_[_0xcaaf('0x3e')](_0x13ce94[_0xcaaf('0x40')]);_0xb3f5f7['filters']=_[_0xcaaf('0x53')](_0xb3f5f7[_0xcaaf('0x3d')],_0xb3f5f7[_0xcaaf('0x40')]);_0xbf198f['attributes']=_[_0xcaaf('0x53')](_0xb3f5f7[_0xcaaf('0x3d')],qs['fields'](_0x13ce94[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0xbf198f[_0xcaaf('0x42')]=_0xbf198f[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0xbf198f[_0xcaaf('0x42')]:_0xb3f5f7[_0xcaaf('0x3d')];if(!_0x13ce94['query']['hasOwnProperty']('nolimit')){_0xbf198f[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x13ce94['query'][_0xcaaf('0x20')]);_0xbf198f['offset']=qs[_0xcaaf('0x22')](_0x13ce94['query'][_0xcaaf('0x22')]);}_0xbf198f[_0xcaaf('0x65')]=qs['sort'](_0x13ce94[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0xbf198f['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x13ce94[_0xcaaf('0x40')],_0xb3f5f7[_0xcaaf('0x3f')]));_0xbf198f[_0xcaaf('0x47')][_0xcaaf('0x69')]=_0x2946f0['id'];if(_0x13ce94[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0xbf198f[_0xcaaf('0x47')]=_['merge'](_0xbf198f[_0xcaaf('0x47')],{'$or':_[_0xcaaf('0x30')](_0xbf198f[_0xcaaf('0x42')],function(_0x40bf4d){var _0x49b260={};_0x49b260[_0x40bf4d]={'$like':'%'+_0x13ce94['query'][_0xcaaf('0x2e')]+'%'};return _0x49b260;})});}_0xbf198f=_['merge']({},_0xbf198f,_0x13ce94[_0xcaaf('0x4b')]);return db['CmHopperBlack'][_0xcaaf('0x21')]({'where':_0xbf198f['where']})[_0xcaaf('0x29')](function(_0x391365){_0x1d6a0c[_0xcaaf('0x21')]=_0x391365;if(_0x13ce94[_0xcaaf('0x40')]['includeAll']){_0xbf198f[_0xcaaf('0x4e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xcaaf('0x6a')](_0xbf198f);})[_0xcaaf('0x29')](function(_0x573a25){_0x1d6a0c['rows']=_0x573a25;return _0x1d6a0c;});}})[_0xcaaf('0x29')](respondWithFilteredResult(_0x3f3943,_0xbf198f))[_0xcaaf('0x50')](handleError(_0x3f3943,null));};exports[_0xcaaf('0x6f')]=function(_0x2222d8,_0x2867e6,_0x53389e){var _0xa6e28a={};var _0x39feff={};var _0x56e144;var _0x4b79a;return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x2222d8['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x2867e6,null))[_0xcaaf('0x29')](function(_0x31df8b){if(_0x31df8b){_0x56e144=_0x31df8b;_0x39feff[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x70')][_0xcaaf('0x5e')]);_0x39feff['query']=_['keys'](_0x2222d8[_0xcaaf('0x40')]);_0x39feff[_0xcaaf('0x3f')]=_['intersection'](_0x39feff[_0xcaaf('0x3d')],_0x39feff[_0xcaaf('0x40')]);_0xa6e28a[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x39feff[_0xcaaf('0x3d')],qs['fields'](_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0xa6e28a[_0xcaaf('0x42')]=_0xa6e28a[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0xa6e28a[_0xcaaf('0x42')]:_0x39feff['model'];_0xa6e28a[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x2222d8['query'][_0xcaaf('0x46')]);_0xa6e28a[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x2222d8[_0xcaaf('0x40')],_0x39feff[_0xcaaf('0x3f')]));if(_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0xa6e28a[_0xcaaf('0x47')]=_['merge'](_0xa6e28a[_0xcaaf('0x47')],{'$or':_[_0xcaaf('0x30')](_0xa6e28a[_0xcaaf('0x42')],function(_0x215f4c){var _0x121bef={};_0x121bef[_0x215f4c]={'$like':'%'+_0x2222d8['query'][_0xcaaf('0x2e')]+'%'};return _0x121bef;})});}_0xa6e28a=_[_0xcaaf('0x49')]({},_0xa6e28a,_0x2222d8['options']);return _0x56e144[_0xcaaf('0x6f')](_0xa6e28a);}})[_0xcaaf('0x29')](function(_0x4235bc){if(_0x4235bc){_0x4b79a=_0x4235bc[_0xcaaf('0x43')];if(!_0x2222d8[_0xcaaf('0x40')]['hasOwnProperty']('nolimit')){_0xa6e28a[_0xcaaf('0x20')]=qs['limit'](_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0xa6e28a[_0xcaaf('0x22')]=qs[_0xcaaf('0x22')](_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x56e144[_0xcaaf('0x6f')](_0xa6e28a);}})[_0xcaaf('0x29')](function(_0x5a14a1){if(_0x5a14a1){return _0x5a14a1?{'count':_0x4b79a,'rows':_0x5a14a1}:null;}})[_0xcaaf('0x29')](respondWithResult(_0x2867e6,null))[_0xcaaf('0x50')](handleError(_0x2867e6,null));};exports[_0xcaaf('0x71')]=function(_0x141bbf,_0x14bc83,_0x428424){var _0x5ce1f9=_0x141bbf[_0xcaaf('0x55')]['teams'];var _0x468220=_[_0xcaaf('0x30')](_0x5ce1f9,'id');return db[_0xcaaf('0x70')][_0xcaaf('0x6a')]({'where':{'id':_0x468220},'attributes':['id'],'include':[{'model':db[_0xcaaf('0x72')],'as':'Agents','attributes':['id','name',_0xcaaf('0x73'),_0xcaaf('0x74'),_0xcaaf('0x75')],'raw':!![]}]})[_0xcaaf('0x29')](function(_0x309971){if(_0x309971){var _0x3a37f0=_['flatMap'](_0x309971,function(_0x388a3a){var _0x5753dc=_0x388a3a[_0xcaaf('0x57')]({'plain':!![]});_0x5753dc[_0xcaaf('0x76')][_0xcaaf('0x77')](function(_0x5b4560){_0x5b4560[_0xcaaf('0x78')]=_[_0xcaaf('0x33')](_0x5ce1f9,{'id':_0x5753dc['id']})[_0xcaaf('0x78')];});return _0x5753dc[_0xcaaf('0x76')];});return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x141bbf[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](function(_0x355c28){return db['sequelize'][_0xcaaf('0x79')](function(_0x408fdf){return _0x355c28['addTeams'](_0x468220,{'transaction':_0x408fdf})[_0xcaaf('0x29')](function(){return BPromise['each'](_0x5ce1f9,function(_0x1da9e3){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x1da9e3['id'],'VoiceQueueId':_0x141bbf[_0xcaaf('0x52')]['id'],'penalty':_0x1da9e3[_0xcaaf('0x78')]},{'transaction':_0x408fdf});});})[_0xcaaf('0x29')](function(){return BPromise[_0xcaaf('0x7a')](_0x3a37f0,function(_0x5eb0c4){return db[_0xcaaf('0x7b')][_0xcaaf('0x7c')]({'where':{'UserId':_0x5eb0c4['id'],'VoiceQueueId':_0x141bbf[_0xcaaf('0x52')]['id']},'defaults':{'penalty':_0x5eb0c4['penalty']},'transaction':_0x408fdf});});})[_0xcaaf('0x29')](function(){return BPromise['each'](_['filter'](_0x3a37f0,{'online':!![]}),function(_0xa7037a){return db[_0xcaaf('0x7d')][_0xcaaf('0x7e')]({'membername':_0xa7037a[_0xcaaf('0x34')],'UserId':_0xa7037a['id'],'queue_name':_0x355c28[_0xcaaf('0x34')],'VoiceQueueId':_0x355c28['id'],'interface':_[_0xcaaf('0x7f')](_0xa7037a[_0xcaaf('0x75')])?util[_0xcaaf('0x80')]('SIP/%s',_0xa7037a[_0xcaaf('0x34')]):_0xa7037a[_0xcaaf('0x75')],'paused':_0xa7037a['voicePause']||![],'penalty':_0xa7037a[_0xcaaf('0x78')]},{'transaction':_0x408fdf});});})['then'](function(){_0x3a37f0[_0xcaaf('0x77')](function(_0x5a9d46){socket[_0xcaaf('0x81')]('userVoiceQueue:save',{'UserId':_0x5a9d46['id'],'VoiceQueueId':_0x355c28['id']});});});});});}})[_0xcaaf('0x29')](respondWithStatusCode(_0x14bc83,null))[_0xcaaf('0x50')](handleError(_0x14bc83,null));};exports[_0xcaaf('0x82')]=function(_0x72fcbf,_0x53230f,_0x5250e3){return db[_0xcaaf('0x70')]['findAll']({'where':{'id':_0x72fcbf['query'][_0xcaaf('0x83')]},'attributes':['id'],'include':[{'model':db[_0xcaaf('0x72')],'as':_0xcaaf('0x76'),'attributes':['id'],'raw':!![]}]})[_0xcaaf('0x29')](handleEntityNotFound(_0x53230f,null))[_0xcaaf('0x29')](function(_0x27b76f){var _0x26d915=_['map'](_0x27b76f,'id');var _0x43877d=[];var _0x534ea8=[];var _0x214ff8=squel[_0xcaaf('0x84')]();_0x214ff8[_0xcaaf('0x85')](_0xcaaf('0x86'))[_0xcaaf('0x87')](_0xcaaf('0x88'),'tq')[_0xcaaf('0x89')]('user_has_teams','ut',_0xcaaf('0x8a'))[_0xcaaf('0x47')]('VoiceQueueId\x20=\x20?',_0x72fcbf[_0xcaaf('0x52')]['id']);for(var _0x174477=0x0;_0x174477<_0x27b76f[_0xcaaf('0x43')];_0x174477+=0x1){let _0x57d0db=_0x27b76f[_0x174477];for(var _0x2986eb=0x0;_0x2986eb<_0x57d0db[_0xcaaf('0x76')][_0xcaaf('0x43')];_0x2986eb+=0x1){let _0x3563c1=_0x57d0db[_0xcaaf('0x76')][_0x2986eb];var _0x29b03f=_0x214ff8[_0xcaaf('0x5d')]();_0x29b03f['where'](_0xcaaf('0x8b'),_0x3563c1['id']);_0x534ea8[_0xcaaf('0x8c')](db['sequelize']['query'](_0x29b03f[_0xcaaf('0x8d')](),{'type':db[_0xcaaf('0x8e')]['QueryTypes'][_0xcaaf('0x8f')]})[_0xcaaf('0x29')](function(_0x49efa8){if(_0x49efa8['length']===0x1){return _0x3563c1['id'];}else{var _0x5ee8ee=_[_0xcaaf('0x90')](_['map'](_0x49efa8,'TeamId'),function(_0x75d543){return _[_0xcaaf('0x91')](_0x26d915,_0x75d543);});if(_0x5ee8ee){return _0x3563c1['id'];}}}));}}return BPromise[_0xcaaf('0x92')](_0x534ea8)[_0xcaaf('0x29')](function(_0x5b5ea0){_0x43877d=_(_0x43877d)[_0xcaaf('0x93')](_0x5b5ea0)[_0xcaaf('0x94')]()['value']();return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x72fcbf[_0xcaaf('0x52')]['id']}})['then'](function(_0x5b3909){return db['sequelize'][_0xcaaf('0x79')](function(_0x74bca3){return _0x5b3909[_0xcaaf('0x82')](_0x72fcbf['query']['ids'],{'transaction':_0x74bca3})['then'](function(){if(!_[_0xcaaf('0x95')](_0x43877d)){return _0x5b3909[_0xcaaf('0x96')](_0x43877d,{'transaction':_0x74bca3})[_0xcaaf('0x29')](function(){return db['UserVoiceQueueRt'][_0xcaaf('0x36')]({'where':{'VoiceQueueId':_0x72fcbf['params']['id'],'UserId':_0x43877d},'transaction':_0x74bca3});});}})[_0xcaaf('0x29')](function(){_0x43877d['forEach'](function(_0x5298fb){socket[_0xcaaf('0x81')]('userVoiceQueue:remove',{'UserId':_0x5298fb,'VoiceQueueId':_0x5b3909['id']});});});});});});})[_0xcaaf('0x29')](respondWithStatusCode(_0x53230f,null))[_0xcaaf('0x50')](handleError(_0x53230f,null));};exports[_0xcaaf('0x97')]=function(_0x37ceac,_0x5c657a,_0x2981a6){var _0x10107c,_0x93dfda;return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x37ceac['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x5c657a,null))[_0xcaaf('0x29')](function(_0x15ab82){if(_0x15ab82){_0x93dfda=_0x15ab82;return _0x15ab82[_0xcaaf('0x97')](_0x37ceac[_0xcaaf('0x55')][_0xcaaf('0x83')],_[_0xcaaf('0x5f')](_0x37ceac['body'],['ids','id'])||{})['spread'](function(_0x29be61){for(var _0x34a149=0x0;_0x34a149<_0x37ceac['body']['ids']['length'];_0x34a149+=0x1){socket['emit'](_0xcaaf('0x98'),{'UserId':Number(_0x37ceac['body']['ids'][_0x34a149]),'VoiceQueueId':Number(_0x37ceac[_0xcaaf('0x52')]['id'])});}return _0x29be61;});}})[_0xcaaf('0x29')](function(_0x4b852c){_0x10107c=_0x4b852c||[];if(_0x93dfda){return db['User'][_0xcaaf('0x6a')]({'where':{'id':_0x37ceac[_0xcaaf('0x55')][_0xcaaf('0x83')]},'attributes':['id',_0xcaaf('0x34'),'online',_0xcaaf('0x74'),_0xcaaf('0x75')],'raw':!![]});}})[_0xcaaf('0x29')](function(_0x35bf2a){if(!_[_0xcaaf('0x95')](_0x35bf2a)){var _0x4c32c3=[];for(var _0x1f675f=0x0;_0x1f675f<_0x35bf2a[_0xcaaf('0x43')];_0x1f675f++){if(_0x35bf2a[_0x1f675f][_0xcaaf('0x73')]){_0x4c32c3[_0xcaaf('0x8c')](db[_0xcaaf('0x7d')][_0xcaaf('0x7e')]({'membername':_0x35bf2a[_0x1f675f][_0xcaaf('0x34')],'UserId':_0x35bf2a[_0x1f675f]['id'],'queue_name':_0x93dfda[_0xcaaf('0x34')],'VoiceQueueId':_0x93dfda['id'],'interface':_[_0xcaaf('0x7f')](_0x35bf2a[_0x1f675f][_0xcaaf('0x75')])?util[_0xcaaf('0x80')](_0xcaaf('0x99'),_0x35bf2a[_0x1f675f][_0xcaaf('0x34')]):_0x35bf2a[_0x1f675f][_0xcaaf('0x75')],'paused':_0x35bf2a[_0x1f675f][_0xcaaf('0x74')]||![],'penalty':_0x37ceac[_0xcaaf('0x55')]['penalty']||0x0}));}}return BPromise[_0xcaaf('0x92')](_0x4c32c3);}})['then'](function(){return _0x10107c;})[_0xcaaf('0x29')](respondWithResult(_0x5c657a,null))[_0xcaaf('0x50')](handleError(_0x5c657a,null));};exports[_0xcaaf('0x96')]=function(_0x36e48c,_0x2e12bf,_0x2fcb83){return db[_0xcaaf('0x4c')]['find']({'where':{'id':_0x36e48c[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x2e12bf,null))['then'](function(_0x2fdb86){if(_0x2fdb86){return _0x2fdb86[_0xcaaf('0x96')](_0x36e48c[_0xcaaf('0x40')]['ids'])[_0xcaaf('0x29')](function(){if(_[_0xcaaf('0x9a')](_0x36e48c[_0xcaaf('0x40')][_0xcaaf('0x83')])){for(var _0x1522ea=0x0;_0x1522ea<_0x36e48c[_0xcaaf('0x40')][_0xcaaf('0x83')][_0xcaaf('0x43')];_0x1522ea+=0x1){socket['emit'](_0xcaaf('0x9b'),{'UserId':Number(_0x36e48c[_0xcaaf('0x40')][_0xcaaf('0x83')][_0x1522ea]),'VoiceQueueId':Number(_0x36e48c[_0xcaaf('0x52')]['id'])});}}else{socket['emit'](_0xcaaf('0x9b'),{'UserId':Number(_0x36e48c['query'][_0xcaaf('0x83')]),'VoiceQueueId':Number(_0x36e48c['params']['id'])});}});}})[_0xcaaf('0x29')](function(_0x380a81){return db['UserVoiceQueueRt'][_0xcaaf('0x36')]({'where':{'VoiceQueueId':_0x36e48c[_0xcaaf('0x52')]['id'],'UserId':_0x36e48c[_0xcaaf('0x40')]['ids']}})['then'](function(){return _0x380a81;});})[_0xcaaf('0x29')](respondWithStatusCode(_0x2e12bf,null))[_0xcaaf('0x50')](handleError(_0x2e12bf,null));};exports[_0xcaaf('0x9c')]=function(_0x106633,_0x26c4ca,_0x1a7199){var _0x1a9084={};var _0x2137a5={};var _0x541a6b;var _0x168a96;return db['VoiceQueue'][_0xcaaf('0x67')]({'where':{'id':_0x106633[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x26c4ca,null))[_0xcaaf('0x29')](function(_0x402b32){if(_0x402b32){_0x541a6b=_0x402b32;_0x2137a5[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db['User']['rawAttributes']);_0x2137a5[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x106633[_0xcaaf('0x40')]);_0x2137a5['filters']=_[_0xcaaf('0x53')](_0x2137a5[_0xcaaf('0x3d')],_0x2137a5['query']);_0x1a9084[_0xcaaf('0x42')]=_['intersection'](_0x2137a5[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x1a9084[_0xcaaf('0x42')]=_0x1a9084[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x1a9084[_0xcaaf('0x42')]:_0x2137a5[_0xcaaf('0x3d')];_0x1a9084['order']=qs[_0xcaaf('0x46')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x1a9084['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x106633['query'],_0x2137a5[_0xcaaf('0x3f')]));if(_0x106633[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x1a9084[_0xcaaf('0x47')]=_[_0xcaaf('0x49')](_0x1a9084[_0xcaaf('0x47')],{'$or':_['map'](_0x1a9084['attributes'],function(_0x1aa8e3){var _0x164db0={};_0x164db0[_0x1aa8e3]={'$like':'%'+_0x106633['query']['filter']+'%'};return _0x164db0;})});}_0x1a9084=_[_0xcaaf('0x49')]({},_0x1a9084,_0x106633[_0xcaaf('0x4b')]);return _0x541a6b['getAgents'](_0x1a9084);}})['then'](function(_0x53f736){if(_0x53f736){_0x168a96=_0x53f736[_0xcaaf('0x43')];if(!_0x106633[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x1a9084[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x1a9084['offset']=qs[_0xcaaf('0x22')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x541a6b[_0xcaaf('0x9c')](_0x1a9084);}})[_0xcaaf('0x29')](function(_0x2c984d){if(_0x2c984d){return _0x2c984d?{'count':_0x168a96,'rows':_0x2c984d}:null;}})[_0xcaaf('0x29')](respondWithResult(_0x26c4ca,null))[_0xcaaf('0x50')](handleError(_0x26c4ca,null));};exports[_0xcaaf('0x9d')]=function(_0x40d661,_0x5d5ee3,_0x2332b5){var _0x14eb32={};var _0x70e4be={};var _0x2a8933;var _0x1e8ad5;return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x40d661['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x5d5ee3,null))['then'](function(_0x1b6882){if(_0x1b6882){_0x2a8933=_0x1b6882;_0x70e4be[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x7d')]['rawAttributes']);_0x70e4be[_0xcaaf('0x40')]=_['keys'](_0x40d661[_0xcaaf('0x40')]);_0x70e4be[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0x70e4be['model'],_0x70e4be['query']);_0x14eb32[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x70e4be[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x14eb32[_0xcaaf('0x42')]=_0x14eb32[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x14eb32['attributes']:_0x70e4be[_0xcaaf('0x3d')];_0x14eb32[_0xcaaf('0x65')]=qs['sort'](_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x14eb32[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x40d661[_0xcaaf('0x40')],_0x70e4be[_0xcaaf('0x3f')]));if(_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x14eb32['where']=_['merge'](_0x14eb32[_0xcaaf('0x47')],{'$or':_['map'](_0x14eb32[_0xcaaf('0x42')],function(_0xc28592){var _0x15389f={};_0x15389f[_0xc28592]={'$like':'%'+_0x40d661['query']['filter']+'%'};return _0x15389f;})});}_0x14eb32=_[_0xcaaf('0x49')]({},_0x14eb32,_0x40d661[_0xcaaf('0x4b')]);return _0x2a8933[_0xcaaf('0x9d')](_0x14eb32);}})[_0xcaaf('0x29')](function(_0x3ffd4e){if(_0x3ffd4e){_0x1e8ad5=_0x3ffd4e['length'];if(!_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x14eb32[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x40d661[_0xcaaf('0x40')]['limit']);_0x14eb32['offset']=qs[_0xcaaf('0x22')](_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x2a8933['getMembers'](_0x14eb32);}})[_0xcaaf('0x29')](function(_0x2931c4){return _0x2931c4?{'count':_0x1e8ad5,'rows':_0x2931c4}:null;})[_0xcaaf('0x29')](respondWithResult(_0x5d5ee3,null))['catch'](handleError(_0x5d5ee3,null));};exports[_0xcaaf('0x9e')]=function(_0x4145f2,_0x23e686,_0x55e7d8){var _0x4354e2={};var _0xd2db7c={};var _0x14285c;var _0x284d84;return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x4145f2[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x23e686,null))[_0xcaaf('0x29')](function(_0x58904e){if(_0x58904e){_0x14285c=_0x58904e;_0xd2db7c[_0xcaaf('0x3d')]=_['keys'](db[_0xcaaf('0x9f')][_0xcaaf('0x5e')]);_0xd2db7c[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x4145f2[_0xcaaf('0x40')]);_0xd2db7c[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0xd2db7c[_0xcaaf('0x3d')],_0xd2db7c[_0xcaaf('0x40')]);_0x4354e2[_0xcaaf('0x42')]=_['intersection'](_0xd2db7c[_0xcaaf('0x3d')],qs['fields'](_0x4145f2[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x4354e2[_0xcaaf('0x42')]=_0x4354e2['attributes']['length']?_0x4354e2[_0xcaaf('0x42')]:_0xd2db7c[_0xcaaf('0x3d')];_0x4354e2[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x4145f2[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x4354e2[_0xcaaf('0x47')]=qs['filters'](_[_0xcaaf('0x48')](_0x4145f2[_0xcaaf('0x40')],_0xd2db7c[_0xcaaf('0x3f')]));if(_0x4145f2['query'][_0xcaaf('0x2e')]){_0x4354e2[_0xcaaf('0x47')]=_['merge'](_0x4354e2['where'],{'$or':_['map'](_0x4354e2[_0xcaaf('0x42')],function(_0x120107){var _0x1a2dae={};_0x1a2dae[_0x120107]={'$like':'%'+_0x4145f2[_0xcaaf('0x40')]['filter']+'%'};return _0x1a2dae;})});}_0x4354e2=_[_0xcaaf('0x49')]({},_0x4354e2,_0x4145f2[_0xcaaf('0x4b')]);return _0x14285c[_0xcaaf('0x9e')](_0x4354e2);}})['then'](function(_0x2dc9d7){if(_0x2dc9d7){_0x284d84=_0x2dc9d7[_0xcaaf('0x43')];if(!_0x4145f2['query']['hasOwnProperty'](_0xcaaf('0x45'))){_0x4354e2[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x4145f2[_0xcaaf('0x40')]['limit']);_0x4354e2[_0xcaaf('0x22')]=qs[_0xcaaf('0x22')](_0x4145f2[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x14285c[_0xcaaf('0x9e')](_0x4354e2);}})[_0xcaaf('0x29')](function(_0x35aaf9){if(_0x35aaf9){return _0x35aaf9?{'count':_0x284d84,'rows':_0x35aaf9}:null;}})[_0xcaaf('0x29')](respondWithResult(_0x23e686,null))['catch'](handleError(_0x23e686,null));};exports['addLists']=function(_0x15f8f9,_0x122730,_0x2e757d){var _0x3c77c7=moment()[_0xcaaf('0x80')](_0xcaaf('0xa0'));var _0x2dcdf4,_0x25786c;return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x15f8f9[_0xcaaf('0x52')]['id']}})['then'](handleEntityNotFound(_0x122730,null))['then'](function(_0x226c32){if(_0x226c32){_0x25786c=_0x226c32;return _0x226c32[_0xcaaf('0xa1')](_0x15f8f9['body'][_0xcaaf('0x83')],_['omit'](_0x15f8f9[_0xcaaf('0x55')],[_0xcaaf('0x83'),'id'])||{});}return null;})['spread'](function(_0x464f1c){var _0x1d346f;_0x2dcdf4=_0x464f1c||[];var _0x1160fd=[];if(_0x464f1c){for(var _0x1006d1=0x0;_0x1006d1<_0x464f1c[_0xcaaf('0x43')];_0x1006d1+=0x1){var _0x19e303=_0x464f1c[_0x1006d1]['get']({'plain':!![]});_0x25786c['dialCheckDuplicateType']=_0x15f8f9[_0xcaaf('0x55')][_0xcaaf('0xa2')]?_0x15f8f9['body'][_0xcaaf('0xa2')]:_0x25786c[_0xcaaf('0xa2')];switch(_0x25786c[_0xcaaf('0xa2')]){case _0xcaaf('0xa3'):_0x1d346f=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')]('cm_hopper')[_0xcaaf('0xa6')](['phone','scheduledAt','ContactId','ListId',_0xcaaf('0x69'),_0xcaaf('0x61'),_0xcaaf('0x60')],squel['select']()['field']('phone',_0xcaaf('0xa7'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0xa8'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))['field'](_0x19e303[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),_0xcaaf('0xab'))[_0xcaaf('0x85')](_0x15f8f9[_0xcaaf('0x52')]['id'][_0xcaaf('0x8d')](),_0xcaaf('0x69'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x61'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xac'))[_0xcaaf('0x47')](_0xcaaf('0xad'))['where']('ListId\x20=\x20?',_0x19e303[_0xcaaf('0xaa')]['toString']())['where'](_0xcaaf('0xae'))['where'](_0xcaaf('0xaf'),squel[_0xcaaf('0x84')]()['field'](_0xcaaf('0xb0'))[_0xcaaf('0x87')](_0xcaaf('0xb1'))[_0xcaaf('0x47')](_0xcaaf('0xb2'),_0x15f8f9[_0xcaaf('0x52')]['id']['toString']()))[_0xcaaf('0x47')](_0xcaaf('0xaf'),squel['select']()[_0xcaaf('0x85')](_0xcaaf('0xb3'))[_0xcaaf('0x87')]('cm_hopper')['where'](_0xcaaf('0xb2'),_0x15f8f9['params']['id'][_0xcaaf('0x8d')]())))[_0xcaaf('0x8d')]();break;case _0xcaaf('0xb4'):_0x1d346f=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')]('cm_hopper')['fromQuery']([_0xcaaf('0xa7'),_0xcaaf('0xa8'),'ContactId',_0xcaaf('0xab'),'VoiceQueueId',_0xcaaf('0x61'),'updatedAt'],squel[_0xcaaf('0x84')]()[_0xcaaf('0x85')](_0xcaaf('0xa7'),'phone')[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0xa8'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))[_0xcaaf('0x85')](_0x19e303[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),_0xcaaf('0xab'))['field'](_0x15f8f9[_0xcaaf('0x52')]['id']['toString'](),_0xcaaf('0x69'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x61'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xac'))[_0xcaaf('0x47')](_0xcaaf('0xad'))[_0xcaaf('0x47')](_0xcaaf('0xb5'),_0x19e303['CmListId']['toString']())[_0xcaaf('0x47')](_0xcaaf('0xae'))[_0xcaaf('0x47')](_0xcaaf('0xaf'),squel['select']()[_0xcaaf('0x85')](_0xcaaf('0xb3'))[_0xcaaf('0x87')](_0xcaaf('0xb6'))['where'](_0xcaaf('0xb2'),_0x15f8f9[_0xcaaf('0x52')]['id'][_0xcaaf('0x8d')]())))[_0xcaaf('0x8d')]();break;default:_0x1d346f=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')](_0xcaaf('0xb6'))[_0xcaaf('0xa6')]([_0xcaaf('0xa7'),'scheduledAt',_0xcaaf('0xa9'),'ListId',_0xcaaf('0x69'),'createdAt',_0xcaaf('0x60')],squel[_0xcaaf('0x84')]()[_0xcaaf('0x85')](_0xcaaf('0xa7'),_0xcaaf('0xa7'))['field']('\x27'+_0x3c77c7+'\x27',_0xcaaf('0xa8'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))[_0xcaaf('0x85')](_0x19e303[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),'ListId')['field'](_0x15f8f9[_0xcaaf('0x52')]['id'][_0xcaaf('0x8d')](),_0xcaaf('0x69'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27','createdAt')['field']('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xac'))[_0xcaaf('0x47')]('deletedAt\x20IS\x20NULL')[_0xcaaf('0x47')]('ListId\x20=\x20?',_0x19e303['CmListId'][_0xcaaf('0x8d')]())['where'](_0xcaaf('0xae')))['toString']();}_0x1160fd[_0xcaaf('0x8c')](db['sequelize']['query'](_0x1d346f));}return BPromise[_0xcaaf('0x92')](_0x1160fd);}})[_0xcaaf('0x29')](function(){var _0x3d84a4=[];var _0x36d7b9=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')](_0xcaaf('0xb7'))[_0xcaaf('0xa6')]([_0xcaaf('0xb8'),_0xcaaf('0xa7'),_0xcaaf('0xb9'),_0xcaaf('0x61'),_0xcaaf('0x60')],squel[_0xcaaf('0x84')]()['field'](_0xcaaf('0xba'))[_0xcaaf('0x85')](_0xcaaf('0xbb'))[_0xcaaf('0x85')](_0xcaaf('0xbc'))['field']('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x61'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xbd'),'ci')[_0xcaaf('0x89')]('cm_hopper','h',_0xcaaf('0xbe'))[_0xcaaf('0x47')](_0xcaaf('0xbf'),_0x3c77c7)['where'](_0xcaaf('0xc0'),_0xcaaf('0xc1')))[_0xcaaf('0x8d')]();_0x3d84a4[_0xcaaf('0x8c')](db[_0xcaaf('0x8e')][_0xcaaf('0x40')](_0x36d7b9));return BPromise[_0xcaaf('0x92')](_0x3d84a4);})[_0xcaaf('0x29')](function(){return _0x2dcdf4;})[_0xcaaf('0x29')](respondWithResult(_0x122730,null))[_0xcaaf('0x50')](handleError(_0x122730,null));};exports[_0xcaaf('0xc2')]=function(_0x477420,_0x3e2fd0,_0x47893b){return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x477420['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x3e2fd0,null))[_0xcaaf('0x29')](function(_0x50494e){if(_0x50494e){return _0x50494e['removeLists'](_0x477420[_0xcaaf('0x40')][_0xcaaf('0x83')]);}})[_0xcaaf('0x29')](function(_0x7fbe59){if(_0x7fbe59){return db[_0xcaaf('0x64')][_0xcaaf('0x36')]({'where':{'ListId':_0x477420['query']['ids'],'VoiceQueueId':_0x477420['params']['id']}})[_0xcaaf('0x29')](function(){return _0x7fbe59;});}})['then'](respondWithStatusCode(_0x3e2fd0,null))[_0xcaaf('0x50')](handleError(_0x3e2fd0,null));};exports[_0xcaaf('0xc3')]=function(_0x80e581,_0x2c1947,_0x5ec143){var _0x3b4bdc={};var _0x327b0a={};var _0x20850c;var _0x16de28;return db[_0xcaaf('0x4c')]['findOne']({'where':{'id':_0x80e581[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x2c1947,null))[_0xcaaf('0x29')](function(_0x10e3df){if(_0x10e3df){_0x20850c=_0x10e3df;_0x327b0a[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db['CmList']['rawAttributes']);_0x327b0a[_0xcaaf('0x40')]=_['keys'](_0x80e581['query']);_0x327b0a[_0xcaaf('0x3f')]=_['intersection'](_0x327b0a[_0xcaaf('0x3d')],_0x327b0a['query']);_0x3b4bdc[_0xcaaf('0x42')]=_['intersection'](_0x327b0a[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x80e581[_0xcaaf('0x40')]['fields']));_0x3b4bdc['attributes']=_0x3b4bdc[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x3b4bdc['attributes']:_0x327b0a[_0xcaaf('0x3d')];_0x3b4bdc[_0xcaaf('0x65')]=qs['sort'](_0x80e581['query']['sort']);_0x3b4bdc[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x80e581['query'],_0x327b0a[_0xcaaf('0x3f')]));if(_0x80e581[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x3b4bdc['where']=_[_0xcaaf('0x49')](_0x3b4bdc[_0xcaaf('0x47')],{'$or':_['map'](_0x3b4bdc[_0xcaaf('0x42')],function(_0x40ff82){var _0x102aba={};_0x102aba[_0x40ff82]={'$like':'%'+_0x80e581[_0xcaaf('0x40')][_0xcaaf('0x2e')]+'%'};return _0x102aba;})});}_0x3b4bdc=_[_0xcaaf('0x49')]({},_0x3b4bdc,_0x80e581['options']);return _0x20850c[_0xcaaf('0xc3')](_0x3b4bdc);}})[_0xcaaf('0x29')](function(_0x45b9c4){if(_0x45b9c4){_0x16de28=_0x45b9c4['length'];if(!_0x80e581[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x3b4bdc[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x80e581[_0xcaaf('0x40')]['limit']);_0x3b4bdc[_0xcaaf('0x22')]=qs['offset'](_0x80e581[_0xcaaf('0x40')]['offset']);}return _0x20850c[_0xcaaf('0xc3')](_0x3b4bdc);}})['then'](function(_0x11ca86){if(_0x11ca86){return _0x11ca86?{'count':_0x16de28,'rows':_0x11ca86}:null;}})['then'](respondWithResult(_0x2c1947,null))[_0xcaaf('0x50')](handleError(_0x2c1947,null));};exports[_0xcaaf('0xc4')]=function(_0x1f76cd,_0x56ee5f,_0x28fe6e){var _0x235db6,_0x312db9;return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x1f76cd[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x56ee5f,null))[_0xcaaf('0x29')](function(_0x3f3ae6){if(_0x3f3ae6){_0x312db9=_0x3f3ae6;return _0x3f3ae6[_0xcaaf('0xc4')](_0x1f76cd[_0xcaaf('0x55')][_0xcaaf('0x83')],_[_0xcaaf('0x5f')](_0x1f76cd[_0xcaaf('0x55')],['ids','id'])||{});}return null;})[_0xcaaf('0xc5')](function(_0x794900){var _0x237a6e;_0x235db6=_0x794900||[];var _0x5364e4=[];if(_0x794900){for(var _0x1913ac=0x0;_0x1913ac<_0x794900[_0xcaaf('0x43')];_0x1913ac+=0x1){var _0x5b6042=_0x794900[_0x1913ac]['get']({'plain':!![]});_0x237a6e=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')](_0xcaaf('0xc6'))[_0xcaaf('0xa6')]([_0xcaaf('0xa7'),_0xcaaf('0xa9'),_0xcaaf('0xab'),_0xcaaf('0x69'),_0xcaaf('0x61'),'updatedAt'],squel[_0xcaaf('0x84')]()[_0xcaaf('0x85')](_0xcaaf('0xa7'),_0xcaaf('0xa7'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))[_0xcaaf('0x85')](_0x5b6042[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),_0xcaaf('0xab'))[_0xcaaf('0x85')](_0x1f76cd['params']['id'][_0xcaaf('0x8d')](),_0xcaaf('0x69'))['field'](_0xcaaf('0xc7'),_0xcaaf('0x61'))[_0xcaaf('0x85')](_0xcaaf('0xc7'),_0xcaaf('0x60'))['from'](_0xcaaf('0xac'))[_0xcaaf('0x47')]('deletedAt\x20IS\x20NULL')[_0xcaaf('0x47')](_0xcaaf('0xb5'),_0x5b6042[_0xcaaf('0xaa')]['toString']())['where'](_0xcaaf('0xae')))[_0xcaaf('0x8d')]();_0x5364e4[_0xcaaf('0x8c')](db[_0xcaaf('0x8e')][_0xcaaf('0x40')](_0x237a6e));}return BPromise[_0xcaaf('0x92')](_0x5364e4);}})['then'](function(){return _0x235db6;})[_0xcaaf('0x29')](respondWithResult(_0x56ee5f,null))[_0xcaaf('0x50')](handleError(_0x56ee5f,null));};exports['removeBlackLists']=function(_0x39bdac,_0x12c4c1,_0x2a4521){return db['VoiceQueue']['find']({'where':{'id':_0x39bdac[_0xcaaf('0x52')]['id']}})['then'](handleEntityNotFound(_0x12c4c1,null))[_0xcaaf('0x29')](function(_0x1fe409){if(_0x1fe409){return _0x1fe409[_0xcaaf('0xc8')](_0x39bdac['query']['ids']);}})['then'](function(_0x572b9b){if(_0x572b9b){return db[_0xcaaf('0x6e')][_0xcaaf('0x36')]({'where':{'ListId':_0x39bdac[_0xcaaf('0x40')][_0xcaaf('0x83')],'VoiceQueueId':_0x39bdac[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](function(){return _0x572b9b;});}})[_0xcaaf('0x29')](respondWithStatusCode(_0x12c4c1,null))[_0xcaaf('0x50')](handleError(_0x12c4c1,null));}; \ No newline at end of file +var _0x3cd8=['key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','merge','VoiceQueue','findAll','catch','show','rawAttributes','includeAll','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','pick','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','compact','ids','removeAgents','userVoiceQueue:remove','addAgents','isEmpty','UserVoiceQueueRt','isNil','format','all','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','cm_hopper','insert','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','type','name','error','stack','send','index','fieldName'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x3cd8,0x150));var _0x83cd=function(_0x52ca59,_0x279dda){_0x52ca59=_0x52ca59-0x0;var _0x1ab7e5=_0x3cd8[_0x52ca59];return _0x1ab7e5;};'use strict';var emlformat=require(_0x83cd('0x0'));var rimraf=require(_0x83cd('0x1'));var zipdir=require(_0x83cd('0x2'));var jsonpatch=require(_0x83cd('0x3'));var rp=require(_0x83cd('0x4'));var moment=require(_0x83cd('0x5'));var BPromise=require(_0x83cd('0x6'));var Mustache=require(_0x83cd('0x7'));var util=require('util');var path=require(_0x83cd('0x8'));var sox=require(_0x83cd('0x9'));var csv=require(_0x83cd('0xa'));var ejs=require(_0x83cd('0xb'));var fs=require('fs');var fs_extra=require(_0x83cd('0xc'));var _=require(_0x83cd('0xd'));var squel=require(_0x83cd('0xe'));var crypto=require(_0x83cd('0xf'));var jsforce=require(_0x83cd('0x10'));var deskjs=require(_0x83cd('0x11'));var toCsv=require(_0x83cd('0xa'));var querystring=require(_0x83cd('0x12'));var Papa=require(_0x83cd('0x13'));var Redis=require(_0x83cd('0x14'));var authService=require(_0x83cd('0x15'));var qs=require(_0x83cd('0x16'));var as=require(_0x83cd('0x17'));var hardwareService=require(_0x83cd('0x18'));var logger=require(_0x83cd('0x19'))(_0x83cd('0x1a'));var utils=require('../../config/utils');var config=require(_0x83cd('0x1b'));var licenseUtil=require(_0x83cd('0x1c'));var db=require(_0x83cd('0x1d'))['db'];config[_0x83cd('0x1e')]=_[_0x83cd('0x1f')](config[_0x83cd('0x1e')],{'host':_0x83cd('0x20'),'port':0x18eb});var socket=require(_0x83cd('0x21'))(new Redis(config['redis']));require(_0x83cd('0x22'))[_0x83cd('0x23')](socket);function respondWithStatusCode(_0x2d330d,_0x28dccb){_0x28dccb=_0x28dccb||0xcc;return function(_0x2adc87){if(_0x2adc87){return _0x2d330d[_0x83cd('0x24')](_0x28dccb);}return _0x2d330d['status'](_0x28dccb)['end']();};}function respondWithResult(_0x268f58,_0x40ba0f){_0x40ba0f=_0x40ba0f||0xc8;return function(_0x2eafe7){if(_0x2eafe7){return _0x268f58[_0x83cd('0x25')](_0x40ba0f)[_0x83cd('0x26')](_0x2eafe7);}};}function respondWithFilteredResult(_0x3d6303,_0x7343f7){return function(_0x1e136e){if(_0x1e136e){var _0x5e35e3=typeof _0x7343f7[_0x83cd('0x27')]==='undefined'&&typeof _0x7343f7[_0x83cd('0x28')]===_0x83cd('0x29');var _0x23d9e4=_0x1e136e['count'];var _0x4c84d3=_0x5e35e3?0x0:_0x7343f7[_0x83cd('0x27')];var _0x50e044=_0x5e35e3?_0x1e136e[_0x83cd('0x2a')]:_0x7343f7[_0x83cd('0x27')]+_0x7343f7['limit'];var _0x327f7e;if(_0x50e044>=_0x23d9e4){_0x50e044=_0x23d9e4;_0x327f7e=0xc8;}else{_0x327f7e=0xce;}_0x3d6303[_0x83cd('0x25')](_0x327f7e);return _0x3d6303[_0x83cd('0x2b')](_0x83cd('0x2c'),_0x4c84d3+'-'+_0x50e044+'/'+_0x23d9e4)[_0x83cd('0x26')](_0x1e136e);}return null;};}function patchUpdates(_0x3f6c85){return function(_0x10b957){try{jsonpatch[_0x83cd('0x2d')](_0x10b957,_0x3f6c85,!![]);}catch(_0x507f7e){return BPromise['reject'](_0x507f7e);}return _0x10b957[_0x83cd('0x2e')]();};}function saveUpdates(_0x56c424,_0xf338c6){return function(_0x2a99aa){if(_0x2a99aa){return _0x2a99aa[_0x83cd('0x2f')](_0x56c424)['then'](function(_0x30c29e){return _0x30c29e;});}return null;};}function removeEntity(_0x33bb16,_0x3558fa){return function(_0x4029a1){if(_0x4029a1){return _0x4029a1[_0x83cd('0x30')]()[_0x83cd('0x31')](function(){var _0x14ab2e=_0x4029a1[_0x83cd('0x32')]({'plain':!![]});var _0x5a9899=[{'name':_0x83cd('0x33'),'value':_0x83cd('0x34'),'ignore':![]},{'name':_0x83cd('0x35'),'value':_0x83cd('0x36'),'ignore':![]}];var _0x78734f=_(_0x5a9899)[_0x83cd('0x37')](_0x83cd('0x38'))[_0x83cd('0x39')](_0x83cd('0x3a'))[_0x83cd('0x3a')]();if(_[_0x83cd('0x3b')](_0x78734f,_0x14ab2e['type'])){return;}var _0x47255d=_[_0x83cd('0x3c')](_0x5a9899,['value',_0x14ab2e[_0x83cd('0x3d')]])[_0x83cd('0x3e')];return db['UserProfileResource']['destroy']({'where':{'type':_0x47255d,'resourceId':_0x14ab2e['id']}})['then'](function(){return _0x4029a1;});})[_0x83cd('0x31')](function(){_0x33bb16[_0x83cd('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0xce66f5,_0x3abd40){return function(_0x256984){if(!_0x256984){_0xce66f5[_0x83cd('0x24')](0x194);}return _0x256984;};}function handleError(_0xca5746,_0x228f82){_0x228f82=_0x228f82||0x1f4;return function(_0x1600ca){logger[_0x83cd('0x3f')](_0x1600ca[_0x83cd('0x40')]);if(_0x1600ca[_0x83cd('0x3e')]){delete _0x1600ca[_0x83cd('0x3e')];}_0xca5746['status'](_0x228f82)[_0x83cd('0x41')](_0x1600ca);};}exports[_0x83cd('0x42')]=function(_0xbe4d9d,_0x3d26c3){var _0x59a344={},_0x5edb25={},_0x513cf0={'count':0x0,'rows':[]};var _0x4aec79=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x44a7fa){return{'name':_0x44a7fa[_0x83cd('0x43')],'type':_0x44a7fa[_0x83cd('0x3d')][_0x83cd('0x44')]};});_0x5edb25[_0x83cd('0x45')]=_[_0x83cd('0x39')](_0x4aec79,'name');_0x5edb25[_0x83cd('0x46')]=_[_0x83cd('0x47')](_0xbe4d9d[_0x83cd('0x46')]);_0x5edb25['filters']=_[_0x83cd('0x48')](_0x5edb25[_0x83cd('0x45')],_0x5edb25[_0x83cd('0x46')]);_0x59a344['attributes']=_['intersection'](_0x5edb25[_0x83cd('0x45')],qs[_0x83cd('0x49')](_0xbe4d9d['query'][_0x83cd('0x49')]));_0x59a344[_0x83cd('0x4a')]=_0x59a344[_0x83cd('0x4a')][_0x83cd('0x4b')]?_0x59a344[_0x83cd('0x4a')]:_0x5edb25['model'];if(!_0xbe4d9d[_0x83cd('0x46')]['hasOwnProperty'](_0x83cd('0x4c'))){_0x59a344[_0x83cd('0x28')]=qs[_0x83cd('0x28')](_0xbe4d9d[_0x83cd('0x46')]['limit']);_0x59a344[_0x83cd('0x27')]=qs[_0x83cd('0x27')](_0xbe4d9d['query'][_0x83cd('0x27')]);}_0x59a344[_0x83cd('0x4d')]=qs['sort'](_0xbe4d9d['query'][_0x83cd('0x4e')]);_0x59a344[_0x83cd('0x4f')]=qs[_0x83cd('0x50')](_['pick'](_0xbe4d9d[_0x83cd('0x46')],_0x5edb25[_0x83cd('0x50')]),_0x4aec79);if(_0xbe4d9d[_0x83cd('0x46')]['filter']){_0x59a344['where']=_[_0x83cd('0x51')](_0x59a344[_0x83cd('0x4f')],{'$or':_[_0x83cd('0x39')](_0x4aec79,function(_0x438a40){if(_0x438a40['type']!=='VIRTUAL'){var _0x2b392c={};_0x2b392c[_0x438a40[_0x83cd('0x3e')]]={'$like':'%'+_0xbe4d9d['query'][_0x83cd('0x37')]+'%'};return _0x2b392c;}})});}_0x59a344=_[_0x83cd('0x51')]({},_0x59a344,_0xbe4d9d['options']);var _0x2feb8f={'where':_0x59a344[_0x83cd('0x4f')]};return db[_0x83cd('0x52')][_0x83cd('0x2a')](_0x2feb8f)[_0x83cd('0x31')](function(_0x56aecf){_0x513cf0[_0x83cd('0x2a')]=_0x56aecf;if(_0xbe4d9d['query']['includeAll']){_0x59a344['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x83cd('0x53')](_0x59a344);})['then'](function(_0x11ecae){_0x513cf0['rows']=_0x11ecae;return _0x513cf0;})['then'](respondWithFilteredResult(_0x3d26c3,_0x59a344))[_0x83cd('0x54')](handleError(_0x3d26c3,null));};exports[_0x83cd('0x55')]=function(_0x5edb06,_0x5e11da){var _0x4fcd81={'raw':![],'where':{'id':_0x5edb06['params']['id']}},_0x11986a={};_0x11986a['model']=_[_0x83cd('0x47')](db[_0x83cd('0x52')][_0x83cd('0x56')]);_0x11986a['query']=_[_0x83cd('0x47')](_0x5edb06[_0x83cd('0x46')]);_0x11986a[_0x83cd('0x50')]=_[_0x83cd('0x48')](_0x11986a[_0x83cd('0x45')],_0x11986a[_0x83cd('0x46')]);_0x4fcd81[_0x83cd('0x4a')]=_[_0x83cd('0x48')](_0x11986a[_0x83cd('0x45')],qs['fields'](_0x5edb06[_0x83cd('0x46')][_0x83cd('0x49')]));_0x4fcd81['attributes']=_0x4fcd81[_0x83cd('0x4a')]['length']?_0x4fcd81['attributes']:_0x11986a['model'];if(_0x5edb06[_0x83cd('0x46')][_0x83cd('0x57')]){_0x4fcd81[_0x83cd('0x58')]=[{'all':!![]}];}_0x4fcd81=_['merge']({},_0x4fcd81,_0x5edb06[_0x83cd('0x59')]);return db[_0x83cd('0x52')]['find'](_0x4fcd81)[_0x83cd('0x31')](handleEntityNotFound(_0x5e11da,null))['then'](respondWithResult(_0x5e11da,null))['catch'](handleError(_0x5e11da,null));};exports[_0x83cd('0x5a')]=function(_0x3939c6,_0x4058e0){return db[_0x83cd('0x52')][_0x83cd('0x5a')](_0x3939c6[_0x83cd('0x5b')],{})[_0x83cd('0x31')](function(_0x526039){var _0x3a2500=_0x3939c6[_0x83cd('0x5c')][_0x83cd('0x32')]({'plain':!![]});if(!_0x3a2500)throw new Error(_0x83cd('0x5d'));if(_0x3a2500[_0x83cd('0x5e')]===_0x83cd('0x5c')){var _0x5e351a=_0x526039[_0x83cd('0x32')]({'plain':!![]});var _0x10c1b9=[{'name':_0x83cd('0x33'),'value':_0x83cd('0x34')},{'name':_0x83cd('0x35'),'value':_0x83cd('0x36')}];var _0x5c3aee=_[_0x83cd('0x3c')](_0x10c1b9,[_0x83cd('0x3a'),_0x5e351a[_0x83cd('0x3d')]])[_0x83cd('0x3e')];return db['UserProfileSection'][_0x83cd('0x3c')]({'where':{'name':_0x5c3aee,'userProfileId':_0x3a2500['userProfileId']},'raw':!![]})[_0x83cd('0x31')](function(_0x43e1b1){if(_0x43e1b1&&_0x43e1b1[_0x83cd('0x5f')]===0x0){return db[_0x83cd('0x60')][_0x83cd('0x5a')]({'name':_0x5e351a['name'],'resourceId':_0x5e351a['id'],'type':_0x43e1b1[_0x83cd('0x3e')],'sectionId':_0x43e1b1['id']},{})[_0x83cd('0x31')](function(){return _0x526039;});}else{return _0x526039;}})[_0x83cd('0x54')](function(_0x1ede2a){logger[_0x83cd('0x3f')](_0x83cd('0x61'),_0x1ede2a);throw _0x1ede2a;});}return _0x526039;})[_0x83cd('0x31')](respondWithResult(_0x4058e0,0xc9))[_0x83cd('0x54')](handleError(_0x4058e0,null));};exports[_0x83cd('0x62')]=function(_0x2591c9,_0x171b38){var _0x3a247d={'where':{'id':_0x2591c9[_0x83cd('0x63')]['id']}},_0x488e59={};_0x488e59[_0x83cd('0x45')]=_['keys'](db[_0x83cd('0x52')][_0x83cd('0x56')]);_0x3a247d['attributes']=_[_0x83cd('0x48')](_0x488e59['model'],qs[_0x83cd('0x49')](_0x2591c9[_0x83cd('0x46')]['fields']));_0x3a247d[_0x83cd('0x4a')]=_0x3a247d[_0x83cd('0x4a')][_0x83cd('0x4b')]?_0x3a247d['attributes']:_0x488e59[_0x83cd('0x45')];if(_0x2591c9[_0x83cd('0x46')]['includeAll']){_0x3a247d[_0x83cd('0x58')]=[{'all':!![]}];}_0x3a247d=_[_0x83cd('0x51')]({},_0x3a247d,_0x2591c9['options']);return db['VoiceQueue'][_0x83cd('0x3c')](_0x3a247d)['then'](handleEntityNotFound(_0x171b38,null))['then'](function(_0x2f37cd){if(_0x2f37cd){var _0x113c83=_0x2f37cd[_0x83cd('0x32')]({'plain':!![]});_0x113c83=qs[_0x83cd('0x64')](_0x113c83,['id',_0x83cd('0x65'),_0x83cd('0x66')]);_0x2591c9[_0x83cd('0x5b')]=_[_0x83cd('0x64')](_0x2591c9[_0x83cd('0x5b')],['id',_0x83cd('0x65'),_0x83cd('0x66')]);return db[_0x83cd('0x52')][_0x83cd('0x5a')](_['merge'](_0x113c83,_0x2591c9[_0x83cd('0x5b')]),{'include':_0x2591c9[_0x83cd('0x46')][_0x83cd('0x57')]?[{'all':!![]}]:undefined})['then'](function(_0x9559af){var _0x3dd814=_0x2591c9[_0x83cd('0x5c')][_0x83cd('0x32')]({'plain':!![]});if(!_0x3dd814)throw new Error(_0x83cd('0x5d'));if(_0x3dd814[_0x83cd('0x5e')]===_0x83cd('0x5c')){var _0x59a1e2=_0x9559af[_0x83cd('0x32')]({'plain':!![]});var _0x51ffb5=[{'name':_0x83cd('0x33'),'value':_0x83cd('0x34')},{'name':_0x83cd('0x35'),'value':_0x83cd('0x36')}];var _0x243fa0=_['find'](_0x51ffb5,[_0x83cd('0x3a'),_0x59a1e2['type']])[_0x83cd('0x3e')];return db['UserProfileSection'][_0x83cd('0x3c')]({'where':{'name':_0x243fa0,'userProfileId':_0x3dd814[_0x83cd('0x67')]},'raw':!![]})[_0x83cd('0x31')](function(_0x10bd52){if(_0x10bd52&&_0x10bd52['autoAssociation']===0x0){return db[_0x83cd('0x60')][_0x83cd('0x5a')]({'name':_0x59a1e2['name'],'resourceId':_0x59a1e2['id'],'type':_0x10bd52[_0x83cd('0x3e')],'sectionId':_0x10bd52['id']},{})[_0x83cd('0x31')](function(){return _0x9559af;});}else{return _0x9559af;}})[_0x83cd('0x54')](function(_0x753451){logger['error'](_0x83cd('0x61'),_0x753451);throw _0x753451;});}return _0x9559af;});}})['then'](respondWithResult(_0x171b38,0xc9))['catch'](handleError(_0x171b38,null));};exports[_0x83cd('0x2f')]=function(_0x2259f3,_0x39890b){if(_0x2259f3[_0x83cd('0x5b')]['id']){delete _0x2259f3[_0x83cd('0x5b')]['id'];}return db[_0x83cd('0x52')]['find']({'where':{'id':_0x2259f3[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x39890b,null))[_0x83cd('0x31')](saveUpdates(_0x2259f3['body'],null))['then'](respondWithResult(_0x39890b,null))[_0x83cd('0x54')](handleError(_0x39890b,null));};exports[_0x83cd('0x30')]=function(_0x404870,_0x5a1fd4){return db[_0x83cd('0x52')][_0x83cd('0x3c')]({'where':{'id':_0x404870[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x5a1fd4,null))[_0x83cd('0x31')](removeEntity(_0x5a1fd4,null))[_0x83cd('0x54')](handleError(_0x5a1fd4,null));};exports[_0x83cd('0x68')]=function(_0x15399e,_0x3d7290,_0x4bd7ff){var _0x3ef6cd={'raw':![],'where':{}};var _0x2415a8={};var _0x70554f={'count':0x0,'rows':[]};return db[_0x83cd('0x52')][_0x83cd('0x69')]({'where':{'id':_0x15399e['params']['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x3d7290,null))['then'](function(_0x4acbb2){if(_0x4acbb2){_0x2415a8[_0x83cd('0x45')]=_[_0x83cd('0x47')](db[_0x83cd('0x6a')][_0x83cd('0x56')]);_0x2415a8[_0x83cd('0x46')]=_[_0x83cd('0x47')](_0x15399e['query']);_0x2415a8[_0x83cd('0x50')]=_[_0x83cd('0x48')](_0x2415a8[_0x83cd('0x45')],_0x2415a8[_0x83cd('0x46')]);_0x3ef6cd[_0x83cd('0x4a')]=_[_0x83cd('0x48')](_0x2415a8['model'],qs[_0x83cd('0x49')](_0x15399e['query'][_0x83cd('0x49')]));_0x3ef6cd['attributes']=_0x3ef6cd[_0x83cd('0x4a')][_0x83cd('0x4b')]?_0x3ef6cd[_0x83cd('0x4a')]:_0x2415a8[_0x83cd('0x45')];if(!_0x15399e[_0x83cd('0x46')][_0x83cd('0x6b')](_0x83cd('0x4c'))){_0x3ef6cd[_0x83cd('0x28')]=qs[_0x83cd('0x28')](_0x15399e[_0x83cd('0x46')][_0x83cd('0x28')]);_0x3ef6cd[_0x83cd('0x27')]=qs['offset'](_0x15399e[_0x83cd('0x46')][_0x83cd('0x27')]);}_0x3ef6cd[_0x83cd('0x4d')]=qs['sort'](_0x15399e[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x3ef6cd['where']=qs[_0x83cd('0x50')](_[_0x83cd('0x6c')](_0x15399e[_0x83cd('0x46')],_0x2415a8['filters']));_0x3ef6cd['where']['VoiceQueueId']=_0x4acbb2['id'];if(_0x15399e[_0x83cd('0x46')]['filter']){_0x3ef6cd[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x3ef6cd[_0x83cd('0x4f')],{'$or':_[_0x83cd('0x39')](_0x3ef6cd[_0x83cd('0x4a')],function(_0x2efd5a){var _0x27206a={};_0x27206a[_0x2efd5a]={'$like':'%'+_0x15399e[_0x83cd('0x46')][_0x83cd('0x37')]+'%'};return _0x27206a;})});}_0x3ef6cd=_[_0x83cd('0x51')]({},_0x3ef6cd,_0x15399e['options']);return db[_0x83cd('0x6a')][_0x83cd('0x2a')]({'where':_0x3ef6cd[_0x83cd('0x4f')]})['then'](function(_0x37b341){_0x70554f[_0x83cd('0x2a')]=_0x37b341;if(_0x15399e[_0x83cd('0x46')][_0x83cd('0x57')]){_0x3ef6cd['include']=[{'all':!![]}];}return db[_0x83cd('0x6a')][_0x83cd('0x53')](_0x3ef6cd);})[_0x83cd('0x31')](function(_0x1092bd){_0x70554f[_0x83cd('0x6d')]=_0x1092bd;return _0x70554f;});}})['then'](respondWithFilteredResult(_0x3d7290,_0x3ef6cd))[_0x83cd('0x54')](handleError(_0x3d7290,null));};exports[_0x83cd('0x6e')]=function(_0x122b34,_0x37b70a,_0x43a4d7){var _0x59a30b={'raw':!![],'where':{}};var _0x165893={};var _0x34469a={'count':0x0,'rows':[]};return db[_0x83cd('0x52')][_0x83cd('0x69')]({'where':{'id':_0x122b34[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x37b70a,null))[_0x83cd('0x31')](function(_0x135316){if(_0x135316){_0x165893[_0x83cd('0x45')]=_[_0x83cd('0x47')](db[_0x83cd('0x6f')][_0x83cd('0x56')]);_0x165893['query']=_[_0x83cd('0x47')](_0x122b34[_0x83cd('0x46')]);_0x165893['filters']=_[_0x83cd('0x48')](_0x165893[_0x83cd('0x45')],_0x165893['query']);_0x59a30b[_0x83cd('0x4a')]=_[_0x83cd('0x48')](_0x165893[_0x83cd('0x45')],qs['fields'](_0x122b34['query']['fields']));_0x59a30b[_0x83cd('0x4a')]=_0x59a30b[_0x83cd('0x4a')][_0x83cd('0x4b')]?_0x59a30b[_0x83cd('0x4a')]:_0x165893[_0x83cd('0x45')];if(!_0x122b34[_0x83cd('0x46')][_0x83cd('0x6b')](_0x83cd('0x4c'))){_0x59a30b['limit']=qs['limit'](_0x122b34[_0x83cd('0x46')][_0x83cd('0x28')]);_0x59a30b['offset']=qs[_0x83cd('0x27')](_0x122b34[_0x83cd('0x46')][_0x83cd('0x27')]);}_0x59a30b['order']=qs[_0x83cd('0x4e')](_0x122b34[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x59a30b['where']=qs[_0x83cd('0x50')](_['pick'](_0x122b34[_0x83cd('0x46')],_0x165893['filters']));_0x59a30b[_0x83cd('0x4f')][_0x83cd('0x70')]=_0x135316['id'];if(_0x122b34[_0x83cd('0x46')][_0x83cd('0x37')]){_0x59a30b[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x59a30b['where'],{'$or':_[_0x83cd('0x39')](_0x59a30b['attributes'],function(_0x7baeaf){var _0x3ae26e={};_0x3ae26e[_0x7baeaf]={'$like':'%'+_0x122b34['query'][_0x83cd('0x37')]+'%'};return _0x3ae26e;})});}_0x59a30b=_[_0x83cd('0x51')]({},_0x59a30b,_0x122b34['options']);return db[_0x83cd('0x6f')]['count']({'where':_0x59a30b[_0x83cd('0x4f')]})[_0x83cd('0x31')](function(_0x3bb335){_0x34469a[_0x83cd('0x2a')]=_0x3bb335;if(_0x122b34[_0x83cd('0x46')][_0x83cd('0x57')]){_0x59a30b[_0x83cd('0x58')]=[{'all':!![]}];}return db[_0x83cd('0x6f')][_0x83cd('0x53')](_0x59a30b);})['then'](function(_0x6882aa){_0x34469a[_0x83cd('0x6d')]=_0x6882aa;return _0x34469a;});}})[_0x83cd('0x31')](respondWithFilteredResult(_0x37b70a,_0x59a30b))[_0x83cd('0x54')](handleError(_0x37b70a,null));};exports['getHopperFinals']=function(_0x2a91bf,_0x5e2faa,_0x58e7a6){var _0x3708e9={'raw':!![],'where':{}};var _0x2ea749={};var _0x367cae={'count':0x0,'rows':[]};return db[_0x83cd('0x52')][_0x83cd('0x69')]({'where':{'id':_0x2a91bf[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x5e2faa,null))['then'](function(_0x121b75){if(_0x121b75){_0x2ea749['model']=_['keys'](db[_0x83cd('0x71')][_0x83cd('0x56')]);_0x2ea749[_0x83cd('0x46')]=_['keys'](_0x2a91bf['query']);_0x2ea749[_0x83cd('0x50')]=_[_0x83cd('0x48')](_0x2ea749[_0x83cd('0x45')],_0x2ea749[_0x83cd('0x46')]);_0x3708e9[_0x83cd('0x4a')]=_['intersection'](_0x2ea749[_0x83cd('0x45')],qs[_0x83cd('0x49')](_0x2a91bf[_0x83cd('0x46')][_0x83cd('0x49')]));_0x3708e9[_0x83cd('0x4a')]=_0x3708e9[_0x83cd('0x4a')][_0x83cd('0x4b')]?_0x3708e9['attributes']:_0x2ea749[_0x83cd('0x45')];if(!_0x2a91bf[_0x83cd('0x46')][_0x83cd('0x6b')]('nolimit')){_0x3708e9[_0x83cd('0x28')]=qs[_0x83cd('0x28')](_0x2a91bf[_0x83cd('0x46')][_0x83cd('0x28')]);_0x3708e9['offset']=qs[_0x83cd('0x27')](_0x2a91bf[_0x83cd('0x46')][_0x83cd('0x27')]);}_0x3708e9[_0x83cd('0x4d')]=qs['sort'](_0x2a91bf['query']['sort']);_0x3708e9[_0x83cd('0x4f')]=qs[_0x83cd('0x50')](_[_0x83cd('0x6c')](_0x2a91bf[_0x83cd('0x46')],_0x2ea749[_0x83cd('0x50')]));_0x3708e9['where']['VoiceQueueId']=_0x121b75['id'];if(_0x2a91bf[_0x83cd('0x46')][_0x83cd('0x37')]){_0x3708e9[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x3708e9['where'],{'$or':_[_0x83cd('0x39')](_0x3708e9[_0x83cd('0x4a')],function(_0x394a62){var _0xb869fb={};_0xb869fb[_0x394a62]={'$like':'%'+_0x2a91bf[_0x83cd('0x46')][_0x83cd('0x37')]+'%'};return _0xb869fb;})});}_0x3708e9=_[_0x83cd('0x51')]({},_0x3708e9,_0x2a91bf[_0x83cd('0x59')]);return db['CmHopperFinal'][_0x83cd('0x2a')]({'where':_0x3708e9[_0x83cd('0x4f')]})[_0x83cd('0x31')](function(_0x511908){_0x367cae[_0x83cd('0x2a')]=_0x511908;if(_0x2a91bf[_0x83cd('0x46')][_0x83cd('0x57')]){_0x3708e9[_0x83cd('0x58')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x83cd('0x53')](_0x3708e9);})[_0x83cd('0x31')](function(_0x43d263){_0x367cae[_0x83cd('0x6d')]=_0x43d263;return _0x367cae;});}})[_0x83cd('0x31')](respondWithFilteredResult(_0x5e2faa,_0x3708e9))[_0x83cd('0x54')](handleError(_0x5e2faa,null));};exports['getHopperBlacks']=function(_0x36143c,_0x4a6b3e,_0x3b0825){var _0x307e5e={'raw':!![],'where':{}};var _0x39cf6d={};var _0x5c85d7={'count':0x0,'rows':[]};return db[_0x83cd('0x52')][_0x83cd('0x69')]({'where':{'id':_0x36143c['params']['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x4a6b3e,null))[_0x83cd('0x31')](function(_0x54e434){if(_0x54e434){_0x39cf6d['model']=_[_0x83cd('0x47')](db[_0x83cd('0x72')]['rawAttributes']);_0x39cf6d['query']=_['keys'](_0x36143c[_0x83cd('0x46')]);_0x39cf6d[_0x83cd('0x50')]=_[_0x83cd('0x48')](_0x39cf6d[_0x83cd('0x45')],_0x39cf6d[_0x83cd('0x46')]);_0x307e5e[_0x83cd('0x4a')]=_['intersection'](_0x39cf6d[_0x83cd('0x45')],qs[_0x83cd('0x49')](_0x36143c['query'][_0x83cd('0x49')]));_0x307e5e[_0x83cd('0x4a')]=_0x307e5e['attributes'][_0x83cd('0x4b')]?_0x307e5e[_0x83cd('0x4a')]:_0x39cf6d[_0x83cd('0x45')];if(!_0x36143c[_0x83cd('0x46')][_0x83cd('0x6b')](_0x83cd('0x4c'))){_0x307e5e[_0x83cd('0x28')]=qs[_0x83cd('0x28')](_0x36143c['query'][_0x83cd('0x28')]);_0x307e5e[_0x83cd('0x27')]=qs[_0x83cd('0x27')](_0x36143c['query'][_0x83cd('0x27')]);}_0x307e5e[_0x83cd('0x4d')]=qs[_0x83cd('0x4e')](_0x36143c[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x307e5e[_0x83cd('0x4f')]=qs['filters'](_[_0x83cd('0x6c')](_0x36143c['query'],_0x39cf6d[_0x83cd('0x50')]));_0x307e5e[_0x83cd('0x4f')][_0x83cd('0x70')]=_0x54e434['id'];if(_0x36143c[_0x83cd('0x46')][_0x83cd('0x37')]){_0x307e5e[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x307e5e[_0x83cd('0x4f')],{'$or':_['map'](_0x307e5e[_0x83cd('0x4a')],function(_0x37649d){var _0x5bce66={};_0x5bce66[_0x37649d]={'$like':'%'+_0x36143c[_0x83cd('0x46')][_0x83cd('0x37')]+'%'};return _0x5bce66;})});}_0x307e5e=_['merge']({},_0x307e5e,_0x36143c[_0x83cd('0x59')]);return db['CmHopperBlack'][_0x83cd('0x2a')]({'where':_0x307e5e[_0x83cd('0x4f')]})['then'](function(_0x36a743){_0x5c85d7[_0x83cd('0x2a')]=_0x36a743;if(_0x36143c[_0x83cd('0x46')]['includeAll']){_0x307e5e[_0x83cd('0x58')]=[{'all':!![]}];}return db[_0x83cd('0x72')]['findAll'](_0x307e5e);})[_0x83cd('0x31')](function(_0xc617ec){_0x5c85d7['rows']=_0xc617ec;return _0x5c85d7;});}})[_0x83cd('0x31')](respondWithFilteredResult(_0x4a6b3e,_0x307e5e))['catch'](handleError(_0x4a6b3e,null));};exports[_0x83cd('0x73')]=function(_0x4ed47c,_0xc067df,_0x5b4d80){var _0x561840={};var _0x409fc6={};var _0x1b55af;var _0xba9164;return db[_0x83cd('0x52')][_0x83cd('0x69')]({'where':{'id':_0x4ed47c['params']['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0xc067df,null))['then'](function(_0x4b6cf7){if(_0x4b6cf7){_0x1b55af=_0x4b6cf7;_0x409fc6[_0x83cd('0x45')]=_[_0x83cd('0x47')](db[_0x83cd('0x74')][_0x83cd('0x56')]);_0x409fc6['query']=_[_0x83cd('0x47')](_0x4ed47c['query']);_0x409fc6[_0x83cd('0x50')]=_['intersection'](_0x409fc6[_0x83cd('0x45')],_0x409fc6[_0x83cd('0x46')]);_0x561840[_0x83cd('0x4a')]=_['intersection'](_0x409fc6['model'],qs[_0x83cd('0x49')](_0x4ed47c['query']['fields']));_0x561840['attributes']=_0x561840[_0x83cd('0x4a')][_0x83cd('0x4b')]?_0x561840[_0x83cd('0x4a')]:_0x409fc6['model'];_0x561840['order']=qs['sort'](_0x4ed47c[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x561840[_0x83cd('0x4f')]=qs['filters'](_['pick'](_0x4ed47c[_0x83cd('0x46')],_0x409fc6[_0x83cd('0x50')]));if(_0x4ed47c['query']['filter']){_0x561840[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x561840[_0x83cd('0x4f')],{'$or':_[_0x83cd('0x39')](_0x561840['attributes'],function(_0x4ee68d){var _0x25ddd8={};_0x25ddd8[_0x4ee68d]={'$like':'%'+_0x4ed47c[_0x83cd('0x46')]['filter']+'%'};return _0x25ddd8;})});}_0x561840=_['merge']({},_0x561840,_0x4ed47c[_0x83cd('0x59')]);return _0x1b55af[_0x83cd('0x73')](_0x561840);}})[_0x83cd('0x31')](function(_0x106ed7){if(_0x106ed7){_0xba9164=_0x106ed7[_0x83cd('0x4b')];if(!_0x4ed47c[_0x83cd('0x46')]['hasOwnProperty']('nolimit')){_0x561840[_0x83cd('0x28')]=qs[_0x83cd('0x28')](_0x4ed47c['query']['limit']);_0x561840[_0x83cd('0x27')]=qs['offset'](_0x4ed47c['query'][_0x83cd('0x27')]);}return _0x1b55af['getTeams'](_0x561840);}})[_0x83cd('0x31')](function(_0x406c81){if(_0x406c81){return _0x406c81?{'count':_0xba9164,'rows':_0x406c81}:null;}})['then'](respondWithResult(_0xc067df,null))[_0x83cd('0x54')](handleError(_0xc067df,null));};exports[_0x83cd('0x75')]=function(_0x5a20aa,_0x1b6f4e,_0x7ecc7e){var _0x3874ed=_0x5a20aa[_0x83cd('0x5b')][_0x83cd('0x76')];var _0x7e5768=_['map'](_0x3874ed,'id');return db[_0x83cd('0x74')][_0x83cd('0x53')]({'where':{'id':_0x7e5768},'attributes':['id'],'include':[{'model':db[_0x83cd('0x77')],'as':'Agents','attributes':['id',_0x83cd('0x3e'),_0x83cd('0x78'),_0x83cd('0x79'),_0x83cd('0x7a')],'raw':!![]}]})[_0x83cd('0x31')](function(_0x1f96f7){if(_0x1f96f7){var _0x295520=_[_0x83cd('0x7b')](_0x1f96f7,function(_0x398e97){var _0x57ba2c=_0x398e97[_0x83cd('0x32')]({'plain':!![]});_0x57ba2c[_0x83cd('0x7c')][_0x83cd('0x7d')](function(_0x5ff798){_0x5ff798[_0x83cd('0x7e')]=_['find'](_0x3874ed,{'id':_0x57ba2c['id']})[_0x83cd('0x7e')];});return _0x57ba2c[_0x83cd('0x7c')];});return db[_0x83cd('0x52')][_0x83cd('0x3c')]({'where':{'id':_0x5a20aa[_0x83cd('0x63')]['id']}})['then'](function(_0x5e9ceb){return db[_0x83cd('0x7f')][_0x83cd('0x80')](function(_0x34307a){return _0x5e9ceb[_0x83cd('0x75')](_0x7e5768,{'transaction':_0x34307a})['then'](function(){return BPromise['each'](_0x3874ed,function(_0x34c7f3){return db[_0x83cd('0x81')][_0x83cd('0x82')]({'TeamId':_0x34c7f3['id'],'VoiceQueueId':_0x5a20aa[_0x83cd('0x63')]['id'],'penalty':_0x34c7f3[_0x83cd('0x7e')]},{'transaction':_0x34307a});});})[_0x83cd('0x31')](function(){return BPromise[_0x83cd('0x83')](_0x295520,function(_0x27a617){return db[_0x83cd('0x84')][_0x83cd('0x85')]({'where':{'UserId':_0x27a617['id'],'VoiceQueueId':_0x5a20aa[_0x83cd('0x63')]['id']},'defaults':{'penalty':_0x27a617[_0x83cd('0x7e')]},'transaction':_0x34307a});});})[_0x83cd('0x31')](function(){return BPromise['each'](_[_0x83cd('0x37')](_0x295520,{'online':!![]}),function(_0x179668){return db['UserVoiceQueueRt'][_0x83cd('0x82')]({'membername':_0x179668[_0x83cd('0x3e')],'UserId':_0x179668['id'],'queue_name':_0x5e9ceb[_0x83cd('0x3e')],'VoiceQueueId':_0x5e9ceb['id'],'interface':_['isNil'](_0x179668[_0x83cd('0x7a')])?util['format'](_0x83cd('0x86'),_0x179668[_0x83cd('0x3e')]):_0x179668['interface'],'paused':_0x179668[_0x83cd('0x79')]||![],'penalty':_0x179668['penalty']},{'transaction':_0x34307a});});})['then'](function(){_0x295520[_0x83cd('0x7d')](function(_0x1019b2){socket[_0x83cd('0x87')](_0x83cd('0x88'),{'UserId':_0x1019b2['id'],'VoiceQueueId':_0x5e9ceb['id']});});});});});}})[_0x83cd('0x31')](respondWithStatusCode(_0x1b6f4e,null))[_0x83cd('0x54')](handleError(_0x1b6f4e,null));};exports[_0x83cd('0x89')]=function(_0x310ac7,_0x7394e6,_0x22eb24){return db[_0x83cd('0x74')]['findAll']({'where':{'id':_0x310ac7['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x83cd('0x77')],'as':_0x83cd('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x7394e6,null))[_0x83cd('0x31')](function(_0x3ee611){var _0x74716=_[_0x83cd('0x39')](_0x3ee611,'id');var _0x148e30=[];var _0x3758f3=[];var _0x1ac6c6=squel[_0x83cd('0x8a')]();_0x1ac6c6[_0x83cd('0x8b')](_0x83cd('0x8c'))[_0x83cd('0x8d')](_0x83cd('0x8e'),'tq')[_0x83cd('0x8f')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x83cd('0x4f')](_0x83cd('0x90'),_0x310ac7[_0x83cd('0x63')]['id']);for(var _0x42432d=0x0;_0x42432d<_0x3ee611[_0x83cd('0x4b')];_0x42432d+=0x1){let _0x16c1ec=_0x3ee611[_0x42432d];for(var _0x12349e=0x0;_0x12349e<_0x16c1ec['Agents'][_0x83cd('0x4b')];_0x12349e+=0x1){let _0x36a016=_0x16c1ec[_0x83cd('0x7c')][_0x12349e];var _0xe0fb46=_0x1ac6c6[_0x83cd('0x62')]();_0xe0fb46[_0x83cd('0x4f')](_0x83cd('0x91'),_0x36a016['id']);_0x3758f3[_0x83cd('0x92')](db[_0x83cd('0x7f')]['query'](_0xe0fb46[_0x83cd('0x93')](),{'type':db[_0x83cd('0x7f')][_0x83cd('0x94')][_0x83cd('0x95')]})[_0x83cd('0x31')](function(_0x44b4eb){if(_0x44b4eb[_0x83cd('0x4b')]===0x1){return _0x36a016['id'];}else{var _0x57979a=_[_0x83cd('0x96')](_[_0x83cd('0x39')](_0x44b4eb,'TeamId'),function(_0x26de5e){return _[_0x83cd('0x3b')](_0x74716,_0x26de5e);});if(_0x57979a){return _0x36a016['id'];}}}));}}return BPromise['all'](_0x3758f3)['then'](function(_0x31be5b){_0x148e30=_(_0x148e30)[_0x83cd('0x97')](_0x31be5b)[_0x83cd('0x98')]()[_0x83cd('0x3a')]();return db[_0x83cd('0x52')][_0x83cd('0x3c')]({'where':{'id':_0x310ac7['params']['id']}})[_0x83cd('0x31')](function(_0x2255d8){return db[_0x83cd('0x7f')]['transaction'](function(_0x41838c){return _0x2255d8[_0x83cd('0x89')](_0x310ac7['query'][_0x83cd('0x99')],{'transaction':_0x41838c})[_0x83cd('0x31')](function(){if(!_['isEmpty'](_0x148e30)){return _0x2255d8[_0x83cd('0x9a')](_0x148e30,{'transaction':_0x41838c})['then'](function(){return db['UserVoiceQueueRt'][_0x83cd('0x30')]({'where':{'VoiceQueueId':_0x310ac7[_0x83cd('0x63')]['id'],'UserId':_0x148e30},'transaction':_0x41838c});});}})[_0x83cd('0x31')](function(){_0x148e30['forEach'](function(_0x51c943){socket[_0x83cd('0x87')](_0x83cd('0x9b'),{'UserId':_0x51c943,'VoiceQueueId':_0x2255d8['id']});});});});});});})[_0x83cd('0x31')](respondWithStatusCode(_0x7394e6,null))[_0x83cd('0x54')](handleError(_0x7394e6,null));};exports[_0x83cd('0x9c')]=function(_0x646a32,_0x5af588,_0x2623ce){var _0x21e7b6,_0x1cb6d2;return db[_0x83cd('0x52')]['find']({'where':{'id':_0x646a32['params']['id']}})['then'](handleEntityNotFound(_0x5af588,null))[_0x83cd('0x31')](function(_0x54bc3c){if(_0x54bc3c){_0x1cb6d2=_0x54bc3c;return _0x54bc3c[_0x83cd('0x9c')](_0x646a32[_0x83cd('0x5b')]['ids'],_['omit'](_0x646a32[_0x83cd('0x5b')],[_0x83cd('0x99'),'id'])||{})['spread'](function(_0x116ed6){for(var _0x6626e7=0x0;_0x6626e7<_0x646a32[_0x83cd('0x5b')][_0x83cd('0x99')][_0x83cd('0x4b')];_0x6626e7+=0x1){socket[_0x83cd('0x87')](_0x83cd('0x88'),{'UserId':Number(_0x646a32[_0x83cd('0x5b')][_0x83cd('0x99')][_0x6626e7]),'VoiceQueueId':Number(_0x646a32['params']['id'])});}return _0x116ed6;});}})[_0x83cd('0x31')](function(_0x4a2e0f){_0x21e7b6=_0x4a2e0f||[];if(_0x1cb6d2){return db[_0x83cd('0x77')]['findAll']({'where':{'id':_0x646a32['body'][_0x83cd('0x99')]},'attributes':['id','name',_0x83cd('0x78'),_0x83cd('0x79'),_0x83cd('0x7a')],'raw':!![]});}})[_0x83cd('0x31')](function(_0x1833ec){if(!_[_0x83cd('0x9d')](_0x1833ec)){var _0x22abc2=[];for(var _0x4b6a1b=0x0;_0x4b6a1b<_0x1833ec[_0x83cd('0x4b')];_0x4b6a1b++){if(_0x1833ec[_0x4b6a1b]['online']){_0x22abc2[_0x83cd('0x92')](db[_0x83cd('0x9e')][_0x83cd('0x82')]({'membername':_0x1833ec[_0x4b6a1b][_0x83cd('0x3e')],'UserId':_0x1833ec[_0x4b6a1b]['id'],'queue_name':_0x1cb6d2[_0x83cd('0x3e')],'VoiceQueueId':_0x1cb6d2['id'],'interface':_[_0x83cd('0x9f')](_0x1833ec[_0x4b6a1b][_0x83cd('0x7a')])?util[_0x83cd('0xa0')]('SIP/%s',_0x1833ec[_0x4b6a1b][_0x83cd('0x3e')]):_0x1833ec[_0x4b6a1b][_0x83cd('0x7a')],'paused':_0x1833ec[_0x4b6a1b][_0x83cd('0x79')]||![],'penalty':_0x646a32[_0x83cd('0x5b')][_0x83cd('0x7e')]||0x0}));}}return BPromise[_0x83cd('0xa1')](_0x22abc2);}})[_0x83cd('0x31')](function(){return _0x21e7b6;})[_0x83cd('0x31')](respondWithResult(_0x5af588,null))[_0x83cd('0x54')](handleError(_0x5af588,null));};exports['removeAgents']=function(_0x6e644f,_0x11d7a1,_0x209f45){return db[_0x83cd('0x52')][_0x83cd('0x3c')]({'where':{'id':_0x6e644f[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x11d7a1,null))['then'](function(_0x285790){if(_0x285790){return _0x285790[_0x83cd('0x9a')](_0x6e644f['query'][_0x83cd('0x99')])[_0x83cd('0x31')](function(){if(_[_0x83cd('0xa2')](_0x6e644f[_0x83cd('0x46')][_0x83cd('0x99')])){for(var _0x1c5f25=0x0;_0x1c5f25<_0x6e644f[_0x83cd('0x46')]['ids'][_0x83cd('0x4b')];_0x1c5f25+=0x1){socket[_0x83cd('0x87')]('userVoiceQueue:remove',{'UserId':Number(_0x6e644f[_0x83cd('0x46')]['ids'][_0x1c5f25]),'VoiceQueueId':Number(_0x6e644f[_0x83cd('0x63')]['id'])});}}else{socket[_0x83cd('0x87')]('userVoiceQueue:remove',{'UserId':Number(_0x6e644f[_0x83cd('0x46')][_0x83cd('0x99')]),'VoiceQueueId':Number(_0x6e644f[_0x83cd('0x63')]['id'])});}});}})[_0x83cd('0x31')](function(_0x3afb4b){return db[_0x83cd('0x9e')][_0x83cd('0x30')]({'where':{'VoiceQueueId':_0x6e644f['params']['id'],'UserId':_0x6e644f[_0x83cd('0x46')][_0x83cd('0x99')]}})[_0x83cd('0x31')](function(){return _0x3afb4b;});})[_0x83cd('0x31')](respondWithStatusCode(_0x11d7a1,null))['catch'](handleError(_0x11d7a1,null));};exports[_0x83cd('0xa3')]=function(_0x2337ff,_0x1f380d,_0x458234){var _0x1d001c={};var _0x32813a={};var _0x236c5c;var _0xa19373;return db[_0x83cd('0x52')]['findOne']({'where':{'id':_0x2337ff['params']['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x1f380d,null))[_0x83cd('0x31')](function(_0x878e05){if(_0x878e05){_0x236c5c=_0x878e05;_0x32813a['model']=_[_0x83cd('0x47')](db[_0x83cd('0x77')][_0x83cd('0x56')]);_0x32813a[_0x83cd('0x46')]=_[_0x83cd('0x47')](_0x2337ff[_0x83cd('0x46')]);_0x32813a[_0x83cd('0x50')]=_[_0x83cd('0x48')](_0x32813a[_0x83cd('0x45')],_0x32813a[_0x83cd('0x46')]);_0x1d001c[_0x83cd('0x4a')]=_[_0x83cd('0x48')](_0x32813a[_0x83cd('0x45')],qs[_0x83cd('0x49')](_0x2337ff['query']['fields']));_0x1d001c[_0x83cd('0x4a')]=_0x1d001c['attributes'][_0x83cd('0x4b')]?_0x1d001c[_0x83cd('0x4a')]:_0x32813a['model'];_0x1d001c[_0x83cd('0x4d')]=qs[_0x83cd('0x4e')](_0x2337ff[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x1d001c[_0x83cd('0x4f')]=qs[_0x83cd('0x50')](_['pick'](_0x2337ff[_0x83cd('0x46')],_0x32813a['filters']));if(_0x2337ff['query'][_0x83cd('0x37')]){_0x1d001c[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x1d001c[_0x83cd('0x4f')],{'$or':_[_0x83cd('0x39')](_0x1d001c['attributes'],function(_0x4f272e){var _0x4f02c7={};_0x4f02c7[_0x4f272e]={'$like':'%'+_0x2337ff[_0x83cd('0x46')][_0x83cd('0x37')]+'%'};return _0x4f02c7;})});}_0x1d001c=_[_0x83cd('0x51')]({},_0x1d001c,_0x2337ff[_0x83cd('0x59')]);return _0x236c5c[_0x83cd('0xa3')](_0x1d001c);}})[_0x83cd('0x31')](function(_0x2182ef){if(_0x2182ef){_0xa19373=_0x2182ef['length'];if(!_0x2337ff[_0x83cd('0x46')][_0x83cd('0x6b')]('nolimit')){_0x1d001c['limit']=qs['limit'](_0x2337ff[_0x83cd('0x46')][_0x83cd('0x28')]);_0x1d001c[_0x83cd('0x27')]=qs[_0x83cd('0x27')](_0x2337ff[_0x83cd('0x46')][_0x83cd('0x27')]);}return _0x236c5c['getAgents'](_0x1d001c);}})[_0x83cd('0x31')](function(_0x3397ec){if(_0x3397ec){return _0x3397ec?{'count':_0xa19373,'rows':_0x3397ec}:null;}})[_0x83cd('0x31')](respondWithResult(_0x1f380d,null))[_0x83cd('0x54')](handleError(_0x1f380d,null));};exports['getMembers']=function(_0x5b2c4,_0x13279e,_0x3ccfd4){var _0x134b24={};var _0xec2384={};var _0x919818;var _0x55f002;return db[_0x83cd('0x52')][_0x83cd('0x69')]({'where':{'id':_0x5b2c4[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x13279e,null))[_0x83cd('0x31')](function(_0x433f0d){if(_0x433f0d){_0x919818=_0x433f0d;_0xec2384[_0x83cd('0x45')]=_[_0x83cd('0x47')](db[_0x83cd('0x9e')]['rawAttributes']);_0xec2384[_0x83cd('0x46')]=_[_0x83cd('0x47')](_0x5b2c4[_0x83cd('0x46')]);_0xec2384[_0x83cd('0x50')]=_[_0x83cd('0x48')](_0xec2384[_0x83cd('0x45')],_0xec2384[_0x83cd('0x46')]);_0x134b24[_0x83cd('0x4a')]=_[_0x83cd('0x48')](_0xec2384[_0x83cd('0x45')],qs[_0x83cd('0x49')](_0x5b2c4['query'][_0x83cd('0x49')]));_0x134b24[_0x83cd('0x4a')]=_0x134b24['attributes']['length']?_0x134b24['attributes']:_0xec2384[_0x83cd('0x45')];_0x134b24[_0x83cd('0x4d')]=qs['sort'](_0x5b2c4[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x134b24['where']=qs[_0x83cd('0x50')](_[_0x83cd('0x6c')](_0x5b2c4[_0x83cd('0x46')],_0xec2384['filters']));if(_0x5b2c4[_0x83cd('0x46')][_0x83cd('0x37')]){_0x134b24[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x134b24[_0x83cd('0x4f')],{'$or':_[_0x83cd('0x39')](_0x134b24[_0x83cd('0x4a')],function(_0x5e6c22){var _0x41b702={};_0x41b702[_0x5e6c22]={'$like':'%'+_0x5b2c4[_0x83cd('0x46')][_0x83cd('0x37')]+'%'};return _0x41b702;})});}_0x134b24=_[_0x83cd('0x51')]({},_0x134b24,_0x5b2c4[_0x83cd('0x59')]);return _0x919818[_0x83cd('0xa4')](_0x134b24);}})[_0x83cd('0x31')](function(_0x31be82){if(_0x31be82){_0x55f002=_0x31be82[_0x83cd('0x4b')];if(!_0x5b2c4['query']['hasOwnProperty'](_0x83cd('0x4c'))){_0x134b24['limit']=qs[_0x83cd('0x28')](_0x5b2c4[_0x83cd('0x46')][_0x83cd('0x28')]);_0x134b24['offset']=qs[_0x83cd('0x27')](_0x5b2c4[_0x83cd('0x46')][_0x83cd('0x27')]);}return _0x919818[_0x83cd('0xa4')](_0x134b24);}})[_0x83cd('0x31')](function(_0x1c5de5){return _0x1c5de5?{'count':_0x55f002,'rows':_0x1c5de5}:null;})[_0x83cd('0x31')](respondWithResult(_0x13279e,null))[_0x83cd('0x54')](handleError(_0x13279e,null));};exports[_0x83cd('0xa5')]=function(_0x1cc759,_0x2f273f,_0x1df558){var _0x595246={};var _0x2416b7={};var _0x3bbaf8;var _0x8e967b;return db[_0x83cd('0x52')][_0x83cd('0x69')]({'where':{'id':_0x1cc759[_0x83cd('0x63')]['id']}})['then'](handleEntityNotFound(_0x2f273f,null))[_0x83cd('0x31')](function(_0x21973b){if(_0x21973b){_0x3bbaf8=_0x21973b;_0x2416b7[_0x83cd('0x45')]=_[_0x83cd('0x47')](db['CmList'][_0x83cd('0x56')]);_0x2416b7[_0x83cd('0x46')]=_[_0x83cd('0x47')](_0x1cc759[_0x83cd('0x46')]);_0x2416b7['filters']=_['intersection'](_0x2416b7[_0x83cd('0x45')],_0x2416b7['query']);_0x595246[_0x83cd('0x4a')]=_[_0x83cd('0x48')](_0x2416b7['model'],qs[_0x83cd('0x49')](_0x1cc759[_0x83cd('0x46')][_0x83cd('0x49')]));_0x595246['attributes']=_0x595246[_0x83cd('0x4a')][_0x83cd('0x4b')]?_0x595246[_0x83cd('0x4a')]:_0x2416b7[_0x83cd('0x45')];_0x595246['order']=qs[_0x83cd('0x4e')](_0x1cc759[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x595246[_0x83cd('0x4f')]=qs['filters'](_['pick'](_0x1cc759[_0x83cd('0x46')],_0x2416b7['filters']));if(_0x1cc759[_0x83cd('0x46')][_0x83cd('0x37')]){_0x595246[_0x83cd('0x4f')]=_['merge'](_0x595246['where'],{'$or':_[_0x83cd('0x39')](_0x595246[_0x83cd('0x4a')],function(_0x3369b1){var _0x4f732b={};_0x4f732b[_0x3369b1]={'$like':'%'+_0x1cc759['query'][_0x83cd('0x37')]+'%'};return _0x4f732b;})});}_0x595246=_['merge']({},_0x595246,_0x1cc759[_0x83cd('0x59')]);return _0x3bbaf8[_0x83cd('0xa5')](_0x595246);}})['then'](function(_0x31c12b){if(_0x31c12b){_0x8e967b=_0x31c12b[_0x83cd('0x4b')];if(!_0x1cc759[_0x83cd('0x46')][_0x83cd('0x6b')]('nolimit')){_0x595246[_0x83cd('0x28')]=qs['limit'](_0x1cc759['query'][_0x83cd('0x28')]);_0x595246[_0x83cd('0x27')]=qs[_0x83cd('0x27')](_0x1cc759['query'][_0x83cd('0x27')]);}return _0x3bbaf8[_0x83cd('0xa5')](_0x595246);}})[_0x83cd('0x31')](function(_0x338120){if(_0x338120){return _0x338120?{'count':_0x8e967b,'rows':_0x338120}:null;}})[_0x83cd('0x31')](respondWithResult(_0x2f273f,null))[_0x83cd('0x54')](handleError(_0x2f273f,null));};exports[_0x83cd('0xa6')]=function(_0x50baa1,_0x1168a0,_0x533303){var _0x5ac7a2=moment()[_0x83cd('0xa0')](_0x83cd('0xa7'));var _0x206be6,_0x55efab;return db['VoiceQueue'][_0x83cd('0x3c')]({'where':{'id':_0x50baa1[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x1168a0,null))[_0x83cd('0x31')](function(_0x344a38){if(_0x344a38){_0x55efab=_0x344a38;return _0x344a38[_0x83cd('0xa6')](_0x50baa1[_0x83cd('0x5b')][_0x83cd('0x99')],_['omit'](_0x50baa1[_0x83cd('0x5b')],[_0x83cd('0x99'),'id'])||{});}return null;})['spread'](function(_0x16b8a9){var _0x176d34;_0x206be6=_0x16b8a9||[];var _0x5d37bb=[];if(_0x16b8a9){for(var _0x48b45c=0x0;_0x48b45c<_0x16b8a9[_0x83cd('0x4b')];_0x48b45c+=0x1){var _0x3e6495=_0x16b8a9[_0x48b45c][_0x83cd('0x32')]({'plain':!![]});_0x55efab[_0x83cd('0xa8')]=_0x50baa1[_0x83cd('0x5b')][_0x83cd('0xa8')]?_0x50baa1[_0x83cd('0x5b')][_0x83cd('0xa8')]:_0x55efab['dialCheckDuplicateType'];switch(_0x55efab['dialCheckDuplicateType']){case _0x83cd('0xa9'):_0x176d34=squel['insert']()[_0x83cd('0xaa')]('cm_hopper')[_0x83cd('0xab')]([_0x83cd('0xac'),_0x83cd('0xad'),_0x83cd('0xae'),'ListId',_0x83cd('0x70'),'createdAt',_0x83cd('0x66')],squel[_0x83cd('0x8a')]()[_0x83cd('0x8b')](_0x83cd('0xac'),_0x83cd('0xac'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27','scheduledAt')['field']('id',_0x83cd('0xae'))[_0x83cd('0x8b')](_0x3e6495[_0x83cd('0xaf')][_0x83cd('0x93')](),_0x83cd('0xb0'))[_0x83cd('0x8b')](_0x50baa1[_0x83cd('0x63')]['id'][_0x83cd('0x93')](),_0x83cd('0x70'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0x65'))['field']('\x27'+_0x5ac7a2+'\x27','updatedAt')[_0x83cd('0x8d')](_0x83cd('0xb1'))[_0x83cd('0x4f')](_0x83cd('0xb2'))[_0x83cd('0x4f')](_0x83cd('0xb3'),_0x3e6495[_0x83cd('0xaf')][_0x83cd('0x93')]())[_0x83cd('0x4f')](_0x83cd('0xb4'))['where'](_0x83cd('0xb5'),squel[_0x83cd('0x8a')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x83cd('0x8d')](_0x83cd('0xb6'))['where'](_0x83cd('0x90'),_0x50baa1[_0x83cd('0x63')]['id'][_0x83cd('0x93')]()))[_0x83cd('0x4f')](_0x83cd('0xb5'),squel['select']()[_0x83cd('0x8b')]('COALESCE(phone,\x27\x27)')['from'](_0x83cd('0xb7'))[_0x83cd('0x4f')](_0x83cd('0x90'),_0x50baa1['params']['id']['toString']())))[_0x83cd('0x93')]();break;case'onlyIfOpen':_0x176d34=squel[_0x83cd('0xb8')]()[_0x83cd('0xaa')](_0x83cd('0xb7'))[_0x83cd('0xab')]([_0x83cd('0xac'),'scheduledAt','ContactId','ListId',_0x83cd('0x70'),_0x83cd('0x65'),_0x83cd('0x66')],squel[_0x83cd('0x8a')]()[_0x83cd('0x8b')](_0x83cd('0xac'),_0x83cd('0xac'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0xad'))[_0x83cd('0x8b')]('id',_0x83cd('0xae'))[_0x83cd('0x8b')](_0x3e6495[_0x83cd('0xaf')][_0x83cd('0x93')](),_0x83cd('0xb0'))[_0x83cd('0x8b')](_0x50baa1[_0x83cd('0x63')]['id'][_0x83cd('0x93')](),_0x83cd('0x70'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0x65'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0x66'))[_0x83cd('0x8d')](_0x83cd('0xb1'))[_0x83cd('0x4f')](_0x83cd('0xb2'))[_0x83cd('0x4f')](_0x83cd('0xb3'),_0x3e6495[_0x83cd('0xaf')]['toString']())[_0x83cd('0x4f')](_0x83cd('0xb4'))[_0x83cd('0x4f')](_0x83cd('0xb5'),squel[_0x83cd('0x8a')]()[_0x83cd('0x8b')](_0x83cd('0xb9'))[_0x83cd('0x8d')]('cm_hopper')[_0x83cd('0x4f')](_0x83cd('0x90'),_0x50baa1[_0x83cd('0x63')]['id'][_0x83cd('0x93')]())))['toString']();break;default:_0x176d34=squel[_0x83cd('0xb8')]()[_0x83cd('0xaa')]('cm_hopper')[_0x83cd('0xab')]([_0x83cd('0xac'),_0x83cd('0xad'),'ContactId',_0x83cd('0xb0'),_0x83cd('0x70'),_0x83cd('0x65'),_0x83cd('0x66')],squel[_0x83cd('0x8a')]()[_0x83cd('0x8b')](_0x83cd('0xac'),_0x83cd('0xac'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0xad'))[_0x83cd('0x8b')]('id',_0x83cd('0xae'))[_0x83cd('0x8b')](_0x3e6495[_0x83cd('0xaf')][_0x83cd('0x93')](),'ListId')['field'](_0x50baa1['params']['id'][_0x83cd('0x93')](),_0x83cd('0x70'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0x65'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27','updatedAt')[_0x83cd('0x8d')]('cm_contacts')['where'](_0x83cd('0xb2'))[_0x83cd('0x4f')](_0x83cd('0xb3'),_0x3e6495['CmListId'][_0x83cd('0x93')]())['where'](_0x83cd('0xb4')))[_0x83cd('0x93')]();}_0x5d37bb['push'](db['sequelize']['query'](_0x176d34));}return BPromise[_0x83cd('0xa1')](_0x5d37bb);}})[_0x83cd('0x31')](function(){var _0x2b7a9d=[];var _0x176b14=squel[_0x83cd('0xb8')]()[_0x83cd('0xaa')](_0x83cd('0xba'))[_0x83cd('0xab')]([_0x83cd('0xbb'),_0x83cd('0xac'),_0x83cd('0xbc'),_0x83cd('0x65'),_0x83cd('0x66')],squel['select']()[_0x83cd('0x8b')](_0x83cd('0xbd'))['field'](_0x83cd('0xbe'))['field']('ci.OrderBy+1')[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0x65'))[_0x83cd('0x8b')]('\x27'+_0x5ac7a2+'\x27',_0x83cd('0x66'))[_0x83cd('0x8d')](_0x83cd('0xbf'),'ci')[_0x83cd('0x8f')](_0x83cd('0xb7'),'h',_0x83cd('0xc0'))[_0x83cd('0x4f')]('h.scheduledat=?',_0x5ac7a2)[_0x83cd('0x4f')](_0x83cd('0xc1'),_0x83cd('0xc2')))[_0x83cd('0x93')]();_0x2b7a9d[_0x83cd('0x92')](db[_0x83cd('0x7f')][_0x83cd('0x46')](_0x176b14));return BPromise[_0x83cd('0xa1')](_0x2b7a9d);})[_0x83cd('0x31')](function(){return _0x206be6;})['then'](respondWithResult(_0x1168a0,null))['catch'](handleError(_0x1168a0,null));};exports[_0x83cd('0xc3')]=function(_0xcce07b,_0x42bac3,_0xffc6a0){return db[_0x83cd('0x52')][_0x83cd('0x3c')]({'where':{'id':_0xcce07b['params']['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x42bac3,null))[_0x83cd('0x31')](function(_0x4f9e0a){if(_0x4f9e0a){return _0x4f9e0a[_0x83cd('0xc3')](_0xcce07b[_0x83cd('0x46')][_0x83cd('0x99')]);}})[_0x83cd('0x31')](function(_0x4d097e){if(_0x4d097e){return db[_0x83cd('0x6a')][_0x83cd('0x30')]({'where':{'ListId':_0xcce07b[_0x83cd('0x46')][_0x83cd('0x99')],'VoiceQueueId':_0xcce07b[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](function(){return _0x4d097e;});}})[_0x83cd('0x31')](respondWithStatusCode(_0x42bac3,null))['catch'](handleError(_0x42bac3,null));};exports[_0x83cd('0xc4')]=function(_0x41225e,_0x3ca728,_0x568bec){var _0x4c16f0={};var _0x1fd3dc={};var _0x36f3cb;var _0x1f771f;return db['VoiceQueue'][_0x83cd('0x69')]({'where':{'id':_0x41225e[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x3ca728,null))['then'](function(_0x9c109d){if(_0x9c109d){_0x36f3cb=_0x9c109d;_0x1fd3dc['model']=_[_0x83cd('0x47')](db[_0x83cd('0xc5')][_0x83cd('0x56')]);_0x1fd3dc['query']=_['keys'](_0x41225e[_0x83cd('0x46')]);_0x1fd3dc['filters']=_['intersection'](_0x1fd3dc[_0x83cd('0x45')],_0x1fd3dc[_0x83cd('0x46')]);_0x4c16f0[_0x83cd('0x4a')]=_[_0x83cd('0x48')](_0x1fd3dc[_0x83cd('0x45')],qs['fields'](_0x41225e[_0x83cd('0x46')][_0x83cd('0x49')]));_0x4c16f0[_0x83cd('0x4a')]=_0x4c16f0[_0x83cd('0x4a')]['length']?_0x4c16f0[_0x83cd('0x4a')]:_0x1fd3dc[_0x83cd('0x45')];_0x4c16f0[_0x83cd('0x4d')]=qs[_0x83cd('0x4e')](_0x41225e[_0x83cd('0x46')][_0x83cd('0x4e')]);_0x4c16f0[_0x83cd('0x4f')]=qs[_0x83cd('0x50')](_['pick'](_0x41225e[_0x83cd('0x46')],_0x1fd3dc[_0x83cd('0x50')]));if(_0x41225e[_0x83cd('0x46')][_0x83cd('0x37')]){_0x4c16f0[_0x83cd('0x4f')]=_[_0x83cd('0x51')](_0x4c16f0[_0x83cd('0x4f')],{'$or':_[_0x83cd('0x39')](_0x4c16f0[_0x83cd('0x4a')],function(_0xc82511){var _0x1c6111={};_0x1c6111[_0xc82511]={'$like':'%'+_0x41225e[_0x83cd('0x46')][_0x83cd('0x37')]+'%'};return _0x1c6111;})});}_0x4c16f0=_['merge']({},_0x4c16f0,_0x41225e[_0x83cd('0x59')]);return _0x36f3cb[_0x83cd('0xc4')](_0x4c16f0);}})['then'](function(_0x1f0ece){if(_0x1f0ece){_0x1f771f=_0x1f0ece[_0x83cd('0x4b')];if(!_0x41225e[_0x83cd('0x46')][_0x83cd('0x6b')](_0x83cd('0x4c'))){_0x4c16f0[_0x83cd('0x28')]=qs[_0x83cd('0x28')](_0x41225e['query']['limit']);_0x4c16f0['offset']=qs['offset'](_0x41225e[_0x83cd('0x46')]['offset']);}return _0x36f3cb['getBlackLists'](_0x4c16f0);}})['then'](function(_0x1315ec){if(_0x1315ec){return _0x1315ec?{'count':_0x1f771f,'rows':_0x1315ec}:null;}})[_0x83cd('0x31')](respondWithResult(_0x3ca728,null))[_0x83cd('0x54')](handleError(_0x3ca728,null));};exports[_0x83cd('0xc6')]=function(_0x2cb051,_0xc7c14a,_0x47bd27){var _0x4f4061,_0x47e6fa;return db[_0x83cd('0x52')][_0x83cd('0x3c')]({'where':{'id':_0x2cb051[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0xc7c14a,null))['then'](function(_0x32e00c){if(_0x32e00c){_0x47e6fa=_0x32e00c;return _0x32e00c[_0x83cd('0xc6')](_0x2cb051[_0x83cd('0x5b')][_0x83cd('0x99')],_['omit'](_0x2cb051['body'],[_0x83cd('0x99'),'id'])||{});}return null;})['spread'](function(_0x5392c6){var _0x18e3ea;_0x4f4061=_0x5392c6||[];var _0x132a0a=[];if(_0x5392c6){for(var _0x198587=0x0;_0x198587<_0x5392c6['length'];_0x198587+=0x1){var _0x5ef67b=_0x5392c6[_0x198587][_0x83cd('0x32')]({'plain':!![]});_0x18e3ea=squel[_0x83cd('0xb8')]()['into'](_0x83cd('0xc7'))[_0x83cd('0xab')](['phone',_0x83cd('0xae'),_0x83cd('0xb0'),_0x83cd('0x70'),'createdAt',_0x83cd('0x66')],squel[_0x83cd('0x8a')]()[_0x83cd('0x8b')](_0x83cd('0xac'),_0x83cd('0xac'))['field']('id',_0x83cd('0xae'))[_0x83cd('0x8b')](_0x5ef67b[_0x83cd('0xaf')]['toString'](),_0x83cd('0xb0'))['field'](_0x2cb051[_0x83cd('0x63')]['id'][_0x83cd('0x93')](),_0x83cd('0x70'))[_0x83cd('0x8b')](_0x83cd('0xc8'),_0x83cd('0x65'))[_0x83cd('0x8b')](_0x83cd('0xc8'),_0x83cd('0x66'))[_0x83cd('0x8d')]('cm_contacts')[_0x83cd('0x4f')](_0x83cd('0xb2'))[_0x83cd('0x4f')](_0x83cd('0xb3'),_0x5ef67b[_0x83cd('0xaf')][_0x83cd('0x93')]())['where'](_0x83cd('0xb4')))[_0x83cd('0x93')]();_0x132a0a['push'](db[_0x83cd('0x7f')][_0x83cd('0x46')](_0x18e3ea));}return BPromise[_0x83cd('0xa1')](_0x132a0a);}})[_0x83cd('0x31')](function(){return _0x4f4061;})[_0x83cd('0x31')](respondWithResult(_0xc7c14a,null))['catch'](handleError(_0xc7c14a,null));};exports[_0x83cd('0xc9')]=function(_0x3a8a8e,_0x34f45a,_0x52ac7f){return db[_0x83cd('0x52')][_0x83cd('0x3c')]({'where':{'id':_0x3a8a8e['params']['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x34f45a,null))[_0x83cd('0x31')](function(_0x4e0ce3){if(_0x4e0ce3){return _0x4e0ce3['removeBlackLists'](_0x3a8a8e['query']['ids']);}})[_0x83cd('0x31')](function(_0x2b2c21){if(_0x2b2c21){return db[_0x83cd('0x72')][_0x83cd('0x30')]({'where':{'ListId':_0x3a8a8e[_0x83cd('0x46')][_0x83cd('0x99')],'VoiceQueueId':_0x3a8a8e[_0x83cd('0x63')]['id']}})[_0x83cd('0x31')](function(){return _0x2b2c21;});}})[_0x83cd('0x31')](respondWithStatusCode(_0x34f45a,null))['catch'](handleError(_0x34f45a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index ec3e981..58316c1 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 _0x11c0=['save','update','remove','exports','events','../../mysqldb','VoiceQueue'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x11c0,0x138));var _0x011c=function(_0xbe3803,_0x82837c){_0xbe3803=_0xbe3803-0x0;var _0x58652a=_0x11c0[_0xbe3803];return _0x58652a;};'use strict';var EventEmitter=require(_0x011c('0x0'));var VoiceQueue=require(_0x011c('0x1'))['db'][_0x011c('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x011c('0x3'),'afterUpdate':_0x011c('0x4'),'afterDestroy':_0x011c('0x5')};function emitEvent(_0x6529ca){return function(_0x533df9,_0x21c601,_0xcf1698){VoiceQueueEvents['emit'](_0x6529ca+':'+_0x533df9['id'],_0x533df9);VoiceQueueEvents['emit'](_0x6529ca,_0x533df9);_0xcf1698(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x011c('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xb70b=['emit','hasOwnProperty','exports','VoiceQueue','setMaxListeners','save','remove'];(function(_0x31232e,_0x4d6fab){var _0x37d379=function(_0x3716f7){while(--_0x3716f7){_0x31232e['push'](_0x31232e['shift']());}};_0x37d379(++_0x4d6fab);}(_0xb70b,0xc0));var _0xbb70=function(_0x303889,_0x57189c){_0x303889=_0x303889-0x0;var _0x15fc36=_0xb70b[_0x303889];return _0x15fc36;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0xbb70('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbb70('0x1')](0x0);var events={'afterCreate':_0xbb70('0x2'),'afterUpdate':'update','afterDestroy':_0xbb70('0x3')};function emitEvent(_0x187fa3){return function(_0x1d4967,_0x512d5a,_0x2af1bc){VoiceQueueEvents[_0xbb70('0x4')](_0x187fa3+':'+_0x1d4967['id'],_0x1d4967);VoiceQueueEvents[_0xbb70('0x4')](_0x187fa3,_0x1d4967);_0x2af1bc(null);};}for(var e in events){if(events[_0xbb70('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xbb70('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index aeeb4d3..b6794a8 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0xfe4a8d,_0x33d75d){var _0x1bf633=function(_0x57f0e5){while(--_0x57f0e5){_0xfe4a8d['push'](_0xfe4a8d['shift']());}};_0x1bf633(++_0x33d75d);}(_0x008c,0x188));var _0xc008=function(_0x20d9ff,_0x1bcc4b){_0x20d9ff=_0x20d9ff-0x0;var _0x1f78aa=_0x008c[_0x20d9ff];return _0x1f78aa;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3088d2,_0xc589c){var _0x98b34e=function(_0x2b7e42){while(--_0x2b7e42){_0x3088d2['push'](_0x3088d2['shift']());}};_0x98b34e(++_0xc589c);}(_0x34e8,0x12c));var _0x834e=function(_0x4410db,_0x4d4d26){_0x4410db=_0x4410db-0x0;var _0x1666ec=_0x34e8[_0x4410db];return _0x1666ec;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 3a12cb7..7399365 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 _0x71b7=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetVoiceQueue','VoiceQueue','options','where','limit','include','map','model','attributes','then','debug','stringify','ShowVoiceQueue','find'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x71b7,0x160));var _0x771b=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x71b7[_0x31eb67];return _0x2a8cb8;};'use strict';var _=require(_0x771b('0x0'));var util=require(_0x771b('0x1'));var moment=require(_0x771b('0x2'));var BPromise=require(_0x771b('0x3'));var rs=require(_0x771b('0x4'));var fs=require('fs');var Redis=require(_0x771b('0x5'));var db=require(_0x771b('0x6'))['db'];var utils=require(_0x771b('0x7'));var logger=require(_0x771b('0x8'))(_0x771b('0x9'));var config=require('../../config/environment');var jayson=require(_0x771b('0xa'));var client=jayson[_0x771b('0xb')]['http']({'port':0x232a});config[_0x771b('0xc')]=_[_0x771b('0xd')](config[_0x771b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x771b('0xc')]));require(_0x771b('0xe'))[_0x771b('0xf')](socket);function respondWithRpcPromise(_0x1fff47,_0x44f554,_0x104188){return new BPromise(function(_0x10e185,_0x12c33e){return client[_0x771b('0x10')](_0x1fff47,_0x104188)['then'](function(_0x50a7d5){logger[_0x771b('0x11')](_0x771b('0x12'),_0x44f554,_0x771b('0x13'));logger['debug'](_0x771b('0x14'),_0x44f554,_0x771b('0x13'),JSON['stringify'](_0x50a7d5));if(_0x50a7d5[_0x771b('0x15')]){if(_0x50a7d5['error']['code']===0x1f4){logger[_0x771b('0x15')](_0x771b('0x12'),_0x44f554,_0x50a7d5[_0x771b('0x15')][_0x771b('0x16')]);return _0x12c33e(_0x50a7d5[_0x771b('0x15')]['message']);}logger[_0x771b('0x15')](_0x771b('0x12'),_0x44f554,_0x50a7d5[_0x771b('0x15')][_0x771b('0x16')]);return _0x10e185(_0x50a7d5['error'][_0x771b('0x16')]);}else{logger[_0x771b('0x11')](_0x771b('0x12'),_0x44f554,'request\x20sent');_0x10e185(_0x50a7d5['result'][_0x771b('0x16')]);}})[_0x771b('0x17')](function(_0x4d0c07){logger[_0x771b('0x15')](_0x771b('0x12'),_0x44f554,_0x4d0c07);_0x12c33e(_0x4d0c07);});});}exports[_0x771b('0x18')]=function(_0x4dcc51){var _0x535027=this;return new Promise(function(_0x43eb16,_0x584d50){return db[_0x771b('0x19')]['findAll']({'raw':_0x4dcc51['options']?_0x4dcc51[_0x771b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4dcc51[_0x771b('0x1a')]?_0x4dcc51[_0x771b('0x1a')][_0x771b('0x1b')]||null:null,'attributes':_0x4dcc51[_0x771b('0x1a')]?_0x4dcc51[_0x771b('0x1a')]['attributes']||null:null,'limit':_0x4dcc51[_0x771b('0x1a')]?_0x4dcc51[_0x771b('0x1a')][_0x771b('0x1c')]||null:null,'include':_0x4dcc51['options']?_0x4dcc51[_0x771b('0x1a')][_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x4dcc51[_0x771b('0x1a')]['include'],function(_0x1343f0){return{'model':db[_0x1343f0[_0x771b('0x1f')]],'as':_0x1343f0['as'],'attributes':_0x1343f0[_0x771b('0x20')],'include':_0x1343f0[_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x1343f0[_0x771b('0x1d')],function(_0x463d28){return{'model':db[_0x463d28[_0x771b('0x1f')]],'as':_0x463d28['as'],'attributes':_0x463d28[_0x771b('0x20')],'include':_0x463d28[_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x463d28[_0x771b('0x1d')],function(_0x16c7f8){return{'model':db[_0x16c7f8[_0x771b('0x1f')]],'as':_0x16c7f8['as'],'attributes':_0x16c7f8[_0x771b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x771b('0x21')](function(_0x1137f4){logger[_0x771b('0x11')](_0x771b('0x18'),_0x4dcc51);logger[_0x771b('0x22')]('GetVoiceQueue',_0x4dcc51,JSON[_0x771b('0x23')](_0x1137f4));_0x43eb16(_0x1137f4);})[_0x771b('0x17')](function(_0x26cb04){logger[_0x771b('0x15')](_0x771b('0x18'),_0x26cb04[_0x771b('0x16')],_0x4dcc51);_0x584d50(_0x535027[_0x771b('0x15')](0x1f4,_0x26cb04[_0x771b('0x16')]));});});};exports[_0x771b('0x24')]=function(_0x304ac0){var _0x5bdd5d=this;return new Promise(function(_0x1f78a6,_0x2adb70){return db['VoiceQueue'][_0x771b('0x25')]({'raw':_0x304ac0['options']?_0x304ac0[_0x771b('0x1a')][_0x771b('0x26')]===undefined?!![]:![]:!![],'where':_0x304ac0[_0x771b('0x1a')]?_0x304ac0['options'][_0x771b('0x1b')]||null:null,'attributes':_0x304ac0[_0x771b('0x1a')]?_0x304ac0[_0x771b('0x1a')][_0x771b('0x20')]||null:null,'include':_0x304ac0[_0x771b('0x1a')]?_0x304ac0[_0x771b('0x1a')]['include']?_[_0x771b('0x1e')](_0x304ac0[_0x771b('0x1a')][_0x771b('0x1d')],function(_0x1290ed){return{'model':db[_0x1290ed['model']],'as':_0x1290ed['as'],'attributes':_0x1290ed[_0x771b('0x20')],'include':_0x1290ed[_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x1290ed['include'],function(_0x1d6129){return{'model':db[_0x1d6129['model']],'as':_0x1d6129['as'],'attributes':_0x1d6129[_0x771b('0x20')],'include':_0x1d6129['include']?_[_0x771b('0x1e')](_0x1d6129[_0x771b('0x1d')],function(_0x1f985d){return{'model':db[_0x1f985d[_0x771b('0x1f')]],'as':_0x1f985d['as'],'attributes':_0x1f985d[_0x771b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x771b('0x21')](function(_0x540cfa){logger[_0x771b('0x11')](_0x771b('0x24'),_0x304ac0);logger['debug'](_0x771b('0x24'),_0x304ac0,JSON[_0x771b('0x23')](_0x540cfa));_0x1f78a6(_0x540cfa);})[_0x771b('0x17')](function(_0x503187){logger[_0x771b('0x15')]('ShowVoiceQueue',_0x503187[_0x771b('0x16')],_0x304ac0);_0x2adb70(_0x5bdd5d[_0x771b('0x15')](0x1f4,_0x503187[_0x771b('0x16')]));});});}; \ No newline at end of file +var _0xed4d=['redis','defaults','request','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','map','model','include','attributes','then','stringify','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xed4d,0xea));var _0xded4=function(_0x331cf2,_0x4cfeb4){_0x331cf2=_0x331cf2-0x0;var _0x5e63b2=_0xed4d[_0x331cf2];return _0x5e63b2;};'use strict';var _=require(_0xded4('0x0'));var util=require(_0xded4('0x1'));var moment=require(_0xded4('0x2'));var BPromise=require(_0xded4('0x3'));var rs=require(_0xded4('0x4'));var fs=require('fs');var Redis=require(_0xded4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xded4('0x6'))(_0xded4('0x7'));var config=require(_0xded4('0x8'));var jayson=require(_0xded4('0x9'));var client=jayson[_0xded4('0xa')]['http']({'port':0x232a});config[_0xded4('0xb')]=_[_0xded4('0xc')](config[_0xded4('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xded4('0xb')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1ef363,_0x470fa1,_0x2c604e){return new BPromise(function(_0x5020cd,_0x15faa0){return client[_0xded4('0xd')](_0x1ef363,_0x2c604e)['then'](function(_0x2df691){logger[_0xded4('0xe')](_0xded4('0xf'),_0x470fa1,'request\x20sent');logger[_0xded4('0x10')](_0xded4('0x11'),_0x470fa1,_0xded4('0x12'),JSON['stringify'](_0x2df691));if(_0x2df691[_0xded4('0x13')]){if(_0x2df691[_0xded4('0x13')]['code']===0x1f4){logger['error'](_0xded4('0xf'),_0x470fa1,_0x2df691[_0xded4('0x13')][_0xded4('0x14')]);return _0x15faa0(_0x2df691[_0xded4('0x13')][_0xded4('0x14')]);}logger[_0xded4('0x13')](_0xded4('0xf'),_0x470fa1,_0x2df691[_0xded4('0x13')][_0xded4('0x14')]);return _0x5020cd(_0x2df691['error']['message']);}else{logger[_0xded4('0xe')]('VoiceQueue,\x20%s,\x20%s',_0x470fa1,_0xded4('0x12'));_0x5020cd(_0x2df691[_0xded4('0x15')][_0xded4('0x14')]);}})[_0xded4('0x16')](function(_0x30c7e6){logger[_0xded4('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x470fa1,_0x30c7e6);_0x15faa0(_0x30c7e6);});});}exports[_0xded4('0x17')]=function(_0x5efdd4){var _0x29889d=this;return new Promise(function(_0x199afb,_0x50d6ca){return db[_0xded4('0x18')]['findAll']({'raw':_0x5efdd4[_0xded4('0x19')]?_0x5efdd4[_0xded4('0x19')][_0xded4('0x1a')]===undefined?!![]:![]:!![],'where':_0x5efdd4['options']?_0x5efdd4['options'][_0xded4('0x1b')]||null:null,'attributes':_0x5efdd4[_0xded4('0x19')]?_0x5efdd4[_0xded4('0x19')]['attributes']||null:null,'limit':_0x5efdd4['options']?_0x5efdd4[_0xded4('0x19')]['limit']||null:null,'include':_0x5efdd4[_0xded4('0x19')]?_0x5efdd4[_0xded4('0x19')]['include']?_[_0xded4('0x1c')](_0x5efdd4[_0xded4('0x19')]['include'],function(_0x2f9698){return{'model':db[_0x2f9698[_0xded4('0x1d')]],'as':_0x2f9698['as'],'attributes':_0x2f9698['attributes'],'include':_0x2f9698[_0xded4('0x1e')]?_[_0xded4('0x1c')](_0x2f9698['include'],function(_0x817c28){return{'model':db[_0x817c28[_0xded4('0x1d')]],'as':_0x817c28['as'],'attributes':_0x817c28['attributes'],'include':_0x817c28[_0xded4('0x1e')]?_['map'](_0x817c28['include'],function(_0x1ff984){return{'model':db[_0x1ff984[_0xded4('0x1d')]],'as':_0x1ff984['as'],'attributes':_0x1ff984[_0xded4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xded4('0x20')](function(_0xc034e8){logger[_0xded4('0xe')](_0xded4('0x17'),_0x5efdd4);logger[_0xded4('0x10')](_0xded4('0x17'),_0x5efdd4,JSON[_0xded4('0x21')](_0xc034e8));_0x199afb(_0xc034e8);})[_0xded4('0x16')](function(_0x304dbe){logger[_0xded4('0x13')](_0xded4('0x17'),_0x304dbe[_0xded4('0x14')],_0x5efdd4);_0x50d6ca(_0x29889d[_0xded4('0x13')](0x1f4,_0x304dbe[_0xded4('0x14')]));});});};exports[_0xded4('0x22')]=function(_0x5b05d1){var _0x11bbc7=this;return new Promise(function(_0x319753,_0x311ab2){return db['VoiceQueue']['find']({'raw':_0x5b05d1['options']?_0x5b05d1[_0xded4('0x19')][_0xded4('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b05d1['options']?_0x5b05d1[_0xded4('0x19')][_0xded4('0x1b')]||null:null,'attributes':_0x5b05d1[_0xded4('0x19')]?_0x5b05d1['options'][_0xded4('0x1f')]||null:null,'include':_0x5b05d1[_0xded4('0x19')]?_0x5b05d1[_0xded4('0x19')]['include']?_[_0xded4('0x1c')](_0x5b05d1[_0xded4('0x19')]['include'],function(_0x2ca055){return{'model':db[_0x2ca055[_0xded4('0x1d')]],'as':_0x2ca055['as'],'attributes':_0x2ca055[_0xded4('0x1f')],'include':_0x2ca055[_0xded4('0x1e')]?_[_0xded4('0x1c')](_0x2ca055[_0xded4('0x1e')],function(_0x43c7ed){return{'model':db[_0x43c7ed[_0xded4('0x1d')]],'as':_0x43c7ed['as'],'attributes':_0x43c7ed[_0xded4('0x1f')],'include':_0x43c7ed[_0xded4('0x1e')]?_['map'](_0x43c7ed[_0xded4('0x1e')],function(_0xee82f9){return{'model':db[_0xee82f9[_0xded4('0x1d')]],'as':_0xee82f9['as'],'attributes':_0xee82f9[_0xded4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ebdb2){logger[_0xded4('0xe')](_0xded4('0x22'),_0x5b05d1);logger['debug'](_0xded4('0x22'),_0x5b05d1,JSON[_0xded4('0x21')](_0x3ebdb2));_0x319753(_0x3ebdb2);})[_0xded4('0x16')](function(_0x4c24d1){logger['error'](_0xded4('0x22'),_0x4c24d1[_0xded4('0x14')],_0x5b05d1);_0x311ab2(_0x11bbc7[_0xded4('0x13')](0x1f4,_0x4c24d1[_0xded4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 56f893f..6f95f35 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 _0x9c3a=['voiceQueue:','remove','emit','removeListener','register','length'];(function(_0x38d92b,_0x1be181){var _0x56c746=function(_0x2d8a65){while(--_0x2d8a65){_0x38d92b['push'](_0x38d92b['shift']());}};_0x56c746(++_0x1be181);}(_0x9c3a,0xf7));var _0xa9c3=function(_0x10946e,_0x10e622){_0x10946e=_0x10946e-0x0;var _0x3b3bb2=_0x9c3a[_0x10946e];return _0x3b3bb2;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0xa9c3('0x0'),'update'];function createListener(_0x3b678b,_0x551ec5){return function(_0x5112f1){_0x551ec5[_0xa9c3('0x1')](_0x3b678b,_0x5112f1);};}function removeListener(_0x3a09e7,_0x210333){return function(){VoiceQueueEvents[_0xa9c3('0x2')](_0x3a09e7,_0x210333);};}exports[_0xa9c3('0x3')]=function(_0x2032f8){for(var _0x1192c5=0x0,_0x2791a0=events[_0xa9c3('0x4')];_0x1192c5<_0x2791a0;_0x1192c5++){var _0x225429=events[_0x1192c5];var _0x438e24=createListener(_0xa9c3('0x5')+_0x225429,_0x2032f8);VoiceQueueEvents['on'](_0x225429,_0x438e24);}}; \ No newline at end of file +var _0x6153=['register','length','voiceQueue:','./voiceQueue.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6153,0x1f3));var _0x3615=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6153[_0x40a045];return _0x1a687c;};'use strict';var VoiceQueueEvents=require(_0x3615('0x0'));var events=[_0x3615('0x1'),_0x3615('0x2'),'update'];function createListener(_0x2c6103,_0x47d2c2){return function(_0xd7bc85){_0x47d2c2[_0x3615('0x3')](_0x2c6103,_0xd7bc85);};}function removeListener(_0x5ca51f,_0x4f4478){return function(){VoiceQueueEvents[_0x3615('0x4')](_0x5ca51f,_0x4f4478);};}exports[_0x3615('0x5')]=function(_0x3a69ac){for(var _0x27ef69=0x0,_0x3b15b6=events[_0x3615('0x6')];_0x27ef69<_0x3b15b6;_0x27ef69++){var _0x1920d0=events[_0x27ef69];var _0x326bba=createListener(_0x3615('0x7')+_0x1920d0,_0x3a69ac);VoiceQueueEvents['on'](_0x1920d0,_0x326bba);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 2b24c1f..dc6561f 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 _0x0d56=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/index','/:id','show','post','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x0d56,0x1c3));var _0x60d5=function(_0x1b46e1,_0x441fd6){_0x1b46e1=_0x1b46e1-0x0;var _0x594ad1=_0x0d56[_0x1b46e1];return _0x594ad1;};'use strict';var multer=require('multer');var util=require(_0x60d5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60d5('0x1'));var router=express[_0x60d5('0x2')]();var fs_extra=require(_0x60d5('0x3'));var auth=require(_0x60d5('0x4'));var interaction=require(_0x60d5('0x5'));var config=require(_0x60d5('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x60d5('0x7')]('/',auth[_0x60d5('0x8')](),controller['index']);router['get'](_0x60d5('0x9'),auth['isAuthenticated'](),controller[_0x60d5('0xa')]);router[_0x60d5('0x7')](_0x60d5('0xb'),auth[_0x60d5('0x8')](),controller['getVoiceQueuesReport']);router[_0x60d5('0x7')](_0x60d5('0xc'),auth[_0x60d5('0x8')](),controller[_0x60d5('0xd')]);router[_0x60d5('0xe')]('/',auth[_0x60d5('0x8')](),controller['create']);router['put'](_0x60d5('0xc'),auth[_0x60d5('0x8')](),controller[_0x60d5('0xf')]);router[_0x60d5('0x10')](_0x60d5('0xc'),auth[_0x60d5('0x8')](),controller[_0x60d5('0x11')]);module[_0x60d5('0x12')]=router; \ No newline at end of file +var _0x915b=['get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x915b,0xa8));var _0xb915=function(_0x21122e,_0x5cc1fd){_0x21122e=_0x21122e-0x0;var _0x25527b=_0x915b[_0x21122e];return _0x25527b;};'use strict';var multer=require(_0xb915('0x0'));var util=require(_0xb915('0x1'));var path=require(_0xb915('0x2'));var timeout=require('connect-timeout');var express=require(_0xb915('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb915('0x4'));var interaction=require(_0xb915('0x5'));var config=require(_0xb915('0x6'));var controller=require(_0xb915('0x7'));router[_0xb915('0x8')]('/',auth[_0xb915('0x9')](),controller[_0xb915('0xa')]);router[_0xb915('0x8')](_0xb915('0xb'),auth[_0xb915('0x9')](),controller[_0xb915('0xc')]);router[_0xb915('0x8')](_0xb915('0xd'),auth[_0xb915('0x9')](),controller[_0xb915('0xe')]);router[_0xb915('0x8')](_0xb915('0xf'),auth[_0xb915('0x9')](),controller[_0xb915('0x10')]);router[_0xb915('0x11')]('/',auth[_0xb915('0x9')](),controller[_0xb915('0x12')]);router[_0xb915('0x13')](_0xb915('0xf'),auth[_0xb915('0x9')](),controller['update']);router[_0xb915('0x14')](_0xb915('0xf'),auth[_0xb915('0x9')](),controller[_0xb915('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 9775d0d..f84e5f8 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 _0x2e48=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x2e48,0x16a));var _0x82e4=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x2e48[_0x5ef161];return _0x1c6e9e;};'use strict';var Sequelize=require(_0x82e4('0x0'));var moment=require(_0x82e4('0x1'));module['exports']={'type':{'type':Sequelize[_0x82e4('0x2')]},'uniqueid':{'type':Sequelize[_0x82e4('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x82e4('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x82e4('0x3')],'set':function(_0xdb2435){var _0x322a58=moment(_0xdb2435);var _0xb6e754=moment(this[_0x82e4('0x4')](_0x82e4('0x5')))['format'](_0x82e4('0x6'));var _0x442b70=_0x322a58[_0x82e4('0x7')](_0xb6e754,_0x82e4('0x8'));this[_0x82e4('0x9')]('queuecallerleaveAt',_0xdb2435);this['setDataValue'](_0x82e4('0xa'),_0x442b70||null);}},'position':{'type':Sequelize[_0x82e4('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x82e4('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x82e4('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x82e4('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x82e4('0xd')},'originalposition':{'type':Sequelize[_0x82e4('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x82e4('0x2')]},'accountcode':{'type':Sequelize[_0x82e4('0x2')]},'context':{'type':Sequelize[_0x82e4('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x82e4('0x2')]},'holdtime':{'type':Sequelize[_0x82e4('0xb')]},'mohtime':{'type':Sequelize[_0x82e4('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x82e4('0x2')]},'transfer':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x82e4('0xe')},'transferexten':{'type':Sequelize[_0x82e4('0x2')]},'transferuniqueid':{'type':Sequelize[_0x82e4('0x2')]},'disposition':{'type':Sequelize[_0x82e4('0x2')]},'secondDisposition':{'type':Sequelize[_0x82e4('0x2')]},'thirdDisposition':{'type':Sequelize[_0x82e4('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x82e4('0x2')]}}; \ No newline at end of file +var _0xb04a=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x11b959,_0xb50e64){var _0x57fc48=function(_0xb23ac9){while(--_0xb23ac9){_0x11b959['push'](_0x11b959['shift']());}};_0x57fc48(++_0xb50e64);}(_0xb04a,0x72));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xab04('0x0'));var moment=require(_0xab04('0x1'));module[_0xab04('0x2')]={'type':{'type':Sequelize[_0xab04('0x3')]},'uniqueid':{'type':Sequelize[_0xab04('0x3')]},'calleridnum':{'type':Sequelize[_0xab04('0x3')]},'calleridname':{'type':Sequelize[_0xab04('0x3')]},'queue':{'type':Sequelize[_0xab04('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xab04('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xab04('0x4')],'set':function(_0x26162e){var _0x411979=moment(_0x26162e);var _0x2f5569=moment(this['getDataValue'](_0xab04('0x5')))[_0xab04('0x6')](_0xab04('0x7'));var _0x22db8d=_0x411979[_0xab04('0x8')](_0x2f5569,_0xab04('0x9'));this[_0xab04('0xa')](_0xab04('0xb'),_0x26162e);this[_0xab04('0xa')](_0xab04('0xc'),_0x22db8d||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xab04('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xab04('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xab04('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xab04('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xab04('0x4')]},'queuecallerexit':{'type':Sequelize[_0xab04('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xab04('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xab04('0xd')]},'channel':{'type':Sequelize[_0xab04('0x3')]},'connectedlinenum':{'type':Sequelize[_0xab04('0x3')]},'connectedlinename':{'type':Sequelize[_0xab04('0x3')]},'accountcode':{'type':Sequelize[_0xab04('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xab04('0x3')]},'priority':{'type':Sequelize[_0xab04('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xab04('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xab04('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xab04('0x3')]},'transfer':{'type':Sequelize[_0xab04('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xab04('0x3')],'comment':_0xab04('0xf')},'transferexten':{'type':Sequelize[_0xab04('0x3')]},'transferuniqueid':{'type':Sequelize[_0xab04('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xab04('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xab04('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index e9a51dc..8fdbac7 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 _0xc548=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','VoiceQueueReport','include','findAll','catch','params','includeAll','options','find','create','body','destroy','describe','getVoiceQueuesReport','map','rows','rimraf','fast-json-patch','request-promise','moment','sox','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send'];(function(_0xe95813,_0x501a97){var _0x47a6ec=function(_0x12be33){while(--_0x12be33){_0xe95813['push'](_0xe95813['shift']());}};_0x47a6ec(++_0x501a97);}(_0xc548,0x1b3));var _0x8c54=function(_0x395c1c,_0x18ef5b){_0x395c1c=_0x395c1c-0x0;var _0x391a95=_0xc548[_0x395c1c];return _0x391a95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c54('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c54('0x1'));var rp=require(_0x8c54('0x2'));var moment=require(_0x8c54('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8c54('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c54('0x5'));var _=require('lodash');var squel=require(_0x8c54('0x6'));var crypto=require(_0x8c54('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x8c54('0x8'));var toCsv=require(_0x8c54('0x9'));var querystring=require('querystring');var Papa=require(_0x8c54('0xa'));var Redis=require(_0x8c54('0xb'));var authService=require(_0x8c54('0xc'));var qs=require(_0x8c54('0xd'));var as=require(_0x8c54('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c54('0xf'))(_0x8c54('0x10'));var utils=require(_0x8c54('0x11'));var config=require(_0x8c54('0x12'));var licenseUtil=require(_0x8c54('0x13'));var db=require(_0x8c54('0x14'))['db'];config['redis']=_[_0x8c54('0x15')](config[_0x8c54('0x16')],{'host':_0x8c54('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c54('0x16')]));require(_0x8c54('0x18'))[_0x8c54('0x19')](socket);function respondWithStatusCode(_0x4e6c57,_0x112e38){_0x112e38=_0x112e38||0xcc;return function(_0x45b2c4){if(_0x45b2c4){return _0x4e6c57[_0x8c54('0x1a')](_0x112e38);}return _0x4e6c57['status'](_0x112e38)[_0x8c54('0x1b')]();};}function respondWithResult(_0x588be1,_0x7e881b){_0x7e881b=_0x7e881b||0xc8;return function(_0xad7853){if(_0xad7853){return _0x588be1[_0x8c54('0x1c')](_0x7e881b)[_0x8c54('0x1d')](_0xad7853);}};}function respondWithFilteredResult(_0x40ecf4,_0x543ccd){return function(_0x237b06){if(_0x237b06){var _0x590b01=typeof _0x543ccd[_0x8c54('0x1e')]===_0x8c54('0x1f')&&typeof _0x543ccd['limit']===_0x8c54('0x1f');var _0x2cf407=_0x237b06[_0x8c54('0x20')];var _0xe10ee8=_0x590b01?0x0:_0x543ccd[_0x8c54('0x1e')];var _0x4552f5=_0x590b01?_0x237b06[_0x8c54('0x20')]:_0x543ccd[_0x8c54('0x1e')]+_0x543ccd[_0x8c54('0x21')];var _0x3ff9b5;if(_0x4552f5>=_0x2cf407){_0x4552f5=_0x2cf407;_0x3ff9b5=0xc8;}else{_0x3ff9b5=0xce;}_0x40ecf4[_0x8c54('0x1c')](_0x3ff9b5);return _0x40ecf4[_0x8c54('0x22')](_0x8c54('0x23'),_0xe10ee8+'-'+_0x4552f5+'/'+_0x2cf407)[_0x8c54('0x1d')](_0x237b06);}return null;};}function patchUpdates(_0x3c69aa){return function(_0x4013bf){try{jsonpatch[_0x8c54('0x24')](_0x4013bf,_0x3c69aa,!![]);}catch(_0x511712){return BPromise[_0x8c54('0x25')](_0x511712);}return _0x4013bf[_0x8c54('0x26')]();};}function saveUpdates(_0x29fd84,_0x2d21bf){return function(_0x142ab2){if(_0x142ab2){return _0x142ab2[_0x8c54('0x27')](_0x29fd84)['then'](function(_0x2a226f){return _0x2a226f;});}return null;};}function removeEntity(_0x585727,_0x1d93c7){return function(_0x956569){if(_0x956569){return _0x956569['destroy']()[_0x8c54('0x28')](function(){_0x585727[_0x8c54('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c09f5,_0x67253b){return function(_0x561a5c){if(!_0x561a5c){_0x5c09f5['sendStatus'](0x194);}return _0x561a5c;};}function handleError(_0x52cfa0,_0x52e87c){_0x52e87c=_0x52e87c||0x1f4;return function(_0xe2acaa){logger[_0x8c54('0x29')](_0xe2acaa[_0x8c54('0x2a')]);if(_0xe2acaa[_0x8c54('0x2b')]){delete _0xe2acaa[_0x8c54('0x2b')];}_0x52cfa0[_0x8c54('0x1c')](_0x52e87c)[_0x8c54('0x2c')](_0xe2acaa);};}exports['index']=function(_0x1204ef,_0x457550){var _0x4588b2={},_0x295300={},_0x3af3a2={'count':0x0,'rows':[]};var _0x3401b0=_['map'](db['VoiceQueueReport'][_0x8c54('0x2d')],function(_0x237183){return{'name':_0x237183[_0x8c54('0x2e')],'type':_0x237183[_0x8c54('0x2f')]['key']};});_0x295300[_0x8c54('0x30')]=_['map'](_0x3401b0,_0x8c54('0x2b'));_0x295300[_0x8c54('0x31')]=_[_0x8c54('0x32')](_0x1204ef[_0x8c54('0x31')]);_0x295300[_0x8c54('0x33')]=_[_0x8c54('0x34')](_0x295300[_0x8c54('0x30')],_0x295300['query']);_0x4588b2[_0x8c54('0x35')]=_[_0x8c54('0x34')](_0x295300[_0x8c54('0x30')],qs[_0x8c54('0x36')](_0x1204ef['query'][_0x8c54('0x36')]));_0x4588b2[_0x8c54('0x35')]=_0x4588b2['attributes'][_0x8c54('0x37')]?_0x4588b2[_0x8c54('0x35')]:_0x295300[_0x8c54('0x30')];if(!_0x1204ef[_0x8c54('0x31')][_0x8c54('0x38')](_0x8c54('0x39'))){_0x4588b2[_0x8c54('0x21')]=qs['limit'](_0x1204ef[_0x8c54('0x31')][_0x8c54('0x21')]);_0x4588b2[_0x8c54('0x1e')]=qs[_0x8c54('0x1e')](_0x1204ef['query'][_0x8c54('0x1e')]);}_0x4588b2[_0x8c54('0x3a')]=qs[_0x8c54('0x3b')](_0x1204ef[_0x8c54('0x31')][_0x8c54('0x3b')]);_0x4588b2['where']=qs[_0x8c54('0x33')](_[_0x8c54('0x3c')](_0x1204ef[_0x8c54('0x31')],_0x295300['filters']),_0x3401b0);if(_0x1204ef[_0x8c54('0x31')][_0x8c54('0x3d')]){_0x4588b2[_0x8c54('0x3e')]=_['merge'](_0x4588b2['where'],{'$or':_['map'](_0x3401b0,function(_0xa4c90f){if(_0xa4c90f[_0x8c54('0x2f')]!==_0x8c54('0x3f')){var _0x91ae38={};_0x91ae38[_0xa4c90f['name']]={'$like':'%'+_0x1204ef[_0x8c54('0x31')]['filter']+'%'};return _0x91ae38;}})});}_0x4588b2=_[_0x8c54('0x40')]({},_0x4588b2,_0x1204ef['options']);var _0x594ef6={'where':_0x4588b2['where']};return db[_0x8c54('0x41')][_0x8c54('0x20')](_0x594ef6)[_0x8c54('0x28')](function(_0x51587a){_0x3af3a2[_0x8c54('0x20')]=_0x51587a;if(_0x1204ef['query']['includeAll']){_0x4588b2[_0x8c54('0x42')]=[{'all':!![]}];}return db[_0x8c54('0x41')][_0x8c54('0x43')](_0x4588b2);})[_0x8c54('0x28')](function(_0x188b58){_0x3af3a2['rows']=_0x188b58;return _0x3af3a2;})[_0x8c54('0x28')](respondWithFilteredResult(_0x457550,_0x4588b2))[_0x8c54('0x44')](handleError(_0x457550,null));};exports['show']=function(_0x1dc4fd,_0x4ee6af){var _0x11f9cd={'raw':![],'where':{'id':_0x1dc4fd[_0x8c54('0x45')]['id']}},_0x50491c={};_0x50491c['model']=_['keys'](db[_0x8c54('0x41')]['rawAttributes']);_0x50491c['query']=_[_0x8c54('0x32')](_0x1dc4fd[_0x8c54('0x31')]);_0x50491c[_0x8c54('0x33')]=_[_0x8c54('0x34')](_0x50491c[_0x8c54('0x30')],_0x50491c[_0x8c54('0x31')]);_0x11f9cd[_0x8c54('0x35')]=_[_0x8c54('0x34')](_0x50491c['model'],qs[_0x8c54('0x36')](_0x1dc4fd[_0x8c54('0x31')][_0x8c54('0x36')]));_0x11f9cd[_0x8c54('0x35')]=_0x11f9cd['attributes'][_0x8c54('0x37')]?_0x11f9cd[_0x8c54('0x35')]:_0x50491c['model'];if(_0x1dc4fd['query'][_0x8c54('0x46')]){_0x11f9cd['include']=[{'all':!![]}];}_0x11f9cd=_['merge']({},_0x11f9cd,_0x1dc4fd[_0x8c54('0x47')]);return db[_0x8c54('0x41')][_0x8c54('0x48')](_0x11f9cd)[_0x8c54('0x28')](handleEntityNotFound(_0x4ee6af,null))[_0x8c54('0x28')](respondWithResult(_0x4ee6af,null))[_0x8c54('0x44')](handleError(_0x4ee6af,null));};exports[_0x8c54('0x49')]=function(_0x357abd,_0x7a53f5){return db['VoiceQueueReport'][_0x8c54('0x49')](_0x357abd[_0x8c54('0x4a')],{})[_0x8c54('0x28')](respondWithResult(_0x7a53f5,0xc9))[_0x8c54('0x44')](handleError(_0x7a53f5,null));};exports[_0x8c54('0x27')]=function(_0x21ebb3,_0x13366b){if(_0x21ebb3[_0x8c54('0x4a')]['id']){delete _0x21ebb3[_0x8c54('0x4a')]['id'];}return db[_0x8c54('0x41')][_0x8c54('0x48')]({'where':{'id':_0x21ebb3[_0x8c54('0x45')]['id']}})['then'](handleEntityNotFound(_0x13366b,null))[_0x8c54('0x28')](saveUpdates(_0x21ebb3[_0x8c54('0x4a')],null))[_0x8c54('0x28')](respondWithResult(_0x13366b,null))[_0x8c54('0x44')](handleError(_0x13366b,null));};exports[_0x8c54('0x4b')]=function(_0x40b292,_0x38e652){return db[_0x8c54('0x41')][_0x8c54('0x48')]({'where':{'id':_0x40b292[_0x8c54('0x45')]['id']}})[_0x8c54('0x28')](handleEntityNotFound(_0x38e652,null))[_0x8c54('0x28')](removeEntity(_0x38e652,null))[_0x8c54('0x44')](handleError(_0x38e652,null));};exports[_0x8c54('0x4c')]=function(_0x2c7665,_0x56a8dd){return db[_0x8c54('0x41')]['describe']()[_0x8c54('0x28')](respondWithResult(_0x56a8dd,null))['catch'](handleError(_0x56a8dd,null));};exports[_0x8c54('0x4d')]=function(_0x40ea25,_0x5b463b){var _0x389a94={},_0x71891b={},_0x5d7c78={'count':0x0,'rows':[]};_0x71891b[_0x8c54('0x30')]=_[_0x8c54('0x32')](db[_0x8c54('0x41')][_0x8c54('0x2d')]);_0x71891b[_0x8c54('0x31')]=_[_0x8c54('0x32')](_0x40ea25[_0x8c54('0x31')]);_0x71891b[_0x8c54('0x33')]=_[_0x8c54('0x34')](_0x71891b[_0x8c54('0x30')],_0x71891b[_0x8c54('0x31')]);_0x389a94[_0x8c54('0x35')]=_[_0x8c54('0x34')](_0x71891b[_0x8c54('0x30')],qs[_0x8c54('0x36')](_0x40ea25[_0x8c54('0x31')]['fields']));_0x389a94[_0x8c54('0x35')]=_0x389a94[_0x8c54('0x35')][_0x8c54('0x37')]?_0x389a94['attributes']:_0x71891b[_0x8c54('0x30')];if(!_0x40ea25[_0x8c54('0x31')][_0x8c54('0x38')](_0x8c54('0x39'))){_0x389a94[_0x8c54('0x21')]=qs['limit'](_0x40ea25[_0x8c54('0x31')][_0x8c54('0x21')]);_0x389a94[_0x8c54('0x1e')]=qs[_0x8c54('0x1e')](_0x40ea25[_0x8c54('0x31')][_0x8c54('0x1e')]);}_0x389a94[_0x8c54('0x3a')]=qs[_0x8c54('0x3b')](_0x40ea25[_0x8c54('0x31')]['sort']);_0x389a94[_0x8c54('0x3e')]=qs['filters'](_[_0x8c54('0x3c')](_0x40ea25[_0x8c54('0x31')],_0x71891b[_0x8c54('0x33')]));if(_0x40ea25[_0x8c54('0x31')][_0x8c54('0x3d')]){_0x389a94[_0x8c54('0x3e')]=_[_0x8c54('0x40')](_0x389a94[_0x8c54('0x3e')],{'$or':_[_0x8c54('0x4e')](_0x389a94[_0x8c54('0x35')],function(_0x8013cc){var _0x58210a={};_0x58210a[_0x8013cc]={'$like':'%'+_0x40ea25[_0x8c54('0x31')][_0x8c54('0x3d')]+'%'};return _0x58210a;})});}_0x389a94=_[_0x8c54('0x40')]({},_0x389a94,_0x40ea25[_0x8c54('0x47')]);var _0x5430fe={'where':_0x389a94[_0x8c54('0x3e')]};return db[_0x8c54('0x41')][_0x8c54('0x20')](_0x5430fe)[_0x8c54('0x28')](function(_0x38740f){_0x5d7c78[_0x8c54('0x20')]=_0x38740f;if(_0x40ea25[_0x8c54('0x31')][_0x8c54('0x46')]){_0x389a94[_0x8c54('0x42')]=[{'all':!![]}];}return db[_0x8c54('0x41')]['findAll'](_0x389a94);})['then'](function(_0x10b118){_0x5d7c78[_0x8c54('0x4f')]=_0x10b118;return _0x5d7c78;})[_0x8c54('0x28')](respondWithFilteredResult(_0x5b463b,_0x389a94,_0x8c54('0x4d')))[_0x8c54('0x44')](handleError(_0x5b463b,null,_0x8c54('0x4d')));}; \ No newline at end of file +var _0xb768=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','limit','count','status','set','apply','reject','update','then','destroy','name','send','index','map','VoiceQueueReport','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','where','include','findAll','catch','show','params','rawAttributes','keys','length','includeAll','options','find','create','body','describe','getVoiceQueuesReport','rows','eml-format'];(function(_0x36550d,_0xa0adae){var _0x59a437=function(_0x25a4bd){while(--_0x25a4bd){_0x36550d['push'](_0x36550d['shift']());}};_0x59a437(++_0xa0adae);}(_0xb768,0xf2));var _0x8b76=function(_0x5f5868,_0x45756d){_0x5f5868=_0x5f5868-0x0;var _0x1b579a=_0xb768[_0x5f5868];return _0x1b579a;};'use strict';var emlformat=require(_0x8b76('0x0'));var rimraf=require(_0x8b76('0x1'));var zipdir=require(_0x8b76('0x2'));var jsonpatch=require(_0x8b76('0x3'));var rp=require(_0x8b76('0x4'));var moment=require(_0x8b76('0x5'));var BPromise=require(_0x8b76('0x6'));var Mustache=require(_0x8b76('0x7'));var util=require('util');var path=require(_0x8b76('0x8'));var sox=require(_0x8b76('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b76('0xa'));var _=require(_0x8b76('0xb'));var squel=require(_0x8b76('0xc'));var crypto=require(_0x8b76('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8b76('0xe'));var querystring=require(_0x8b76('0xf'));var Papa=require(_0x8b76('0x10'));var Redis=require(_0x8b76('0x11'));var authService=require(_0x8b76('0x12'));var qs=require(_0x8b76('0x13'));var as=require(_0x8b76('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b76('0x15'))('api');var utils=require(_0x8b76('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8b76('0x17'))['db'];config['redis']=_[_0x8b76('0x18')](config[_0x8b76('0x19')],{'host':_0x8b76('0x1a'),'port':0x18eb});var socket=require(_0x8b76('0x1b'))(new Redis(config[_0x8b76('0x19')]));require('./voiceQueueReport.socket')[_0x8b76('0x1c')](socket);function respondWithStatusCode(_0x3b5e96,_0x323d69){_0x323d69=_0x323d69||0xcc;return function(_0x24125d){if(_0x24125d){return _0x3b5e96[_0x8b76('0x1d')](_0x323d69);}return _0x3b5e96['status'](_0x323d69)[_0x8b76('0x1e')]();};}function respondWithResult(_0x457c4f,_0x44d86a){_0x44d86a=_0x44d86a||0xc8;return function(_0x222aee){if(_0x222aee){return _0x457c4f['status'](_0x44d86a)[_0x8b76('0x1f')](_0x222aee);}};}function respondWithFilteredResult(_0x24f87a,_0xf1982){return function(_0xe6c49d){if(_0xe6c49d){var _0x39f10d=typeof _0xf1982[_0x8b76('0x20')]==='undefined'&&typeof _0xf1982[_0x8b76('0x21')]==='undefined';var _0x2f72d3=_0xe6c49d[_0x8b76('0x22')];var _0x242c14=_0x39f10d?0x0:_0xf1982[_0x8b76('0x20')];var _0x1c1a36=_0x39f10d?_0xe6c49d['count']:_0xf1982[_0x8b76('0x20')]+_0xf1982[_0x8b76('0x21')];var _0x5c9415;if(_0x1c1a36>=_0x2f72d3){_0x1c1a36=_0x2f72d3;_0x5c9415=0xc8;}else{_0x5c9415=0xce;}_0x24f87a[_0x8b76('0x23')](_0x5c9415);return _0x24f87a[_0x8b76('0x24')]('Content-Range',_0x242c14+'-'+_0x1c1a36+'/'+_0x2f72d3)[_0x8b76('0x1f')](_0xe6c49d);}return null;};}function patchUpdates(_0x32277d){return function(_0x267838){try{jsonpatch[_0x8b76('0x25')](_0x267838,_0x32277d,!![]);}catch(_0x209297){return BPromise[_0x8b76('0x26')](_0x209297);}return _0x267838['save']();};}function saveUpdates(_0x2c1472,_0x8f7bb8){return function(_0x35c313){if(_0x35c313){return _0x35c313[_0x8b76('0x27')](_0x2c1472)[_0x8b76('0x28')](function(_0x55df46){return _0x55df46;});}return null;};}function removeEntity(_0x497ce6,_0x5593ca){return function(_0x4105b0){if(_0x4105b0){return _0x4105b0[_0x8b76('0x29')]()[_0x8b76('0x28')](function(){_0x497ce6[_0x8b76('0x23')](0xcc)[_0x8b76('0x1e')]();});}};}function handleEntityNotFound(_0x1ea4e3,_0x3b7c74){return function(_0x1cf3a3){if(!_0x1cf3a3){_0x1ea4e3['sendStatus'](0x194);}return _0x1cf3a3;};}function handleError(_0x30e89e,_0x1274c1){_0x1274c1=_0x1274c1||0x1f4;return function(_0xee1808){logger['error'](_0xee1808['stack']);if(_0xee1808[_0x8b76('0x2a')]){delete _0xee1808['name'];}_0x30e89e[_0x8b76('0x23')](_0x1274c1)[_0x8b76('0x2b')](_0xee1808);};}exports[_0x8b76('0x2c')]=function(_0x2da737,_0x25bc54){var _0x593be2={},_0xd785d5={},_0x107ace={'count':0x0,'rows':[]};var _0x55e6bb=_[_0x8b76('0x2d')](db[_0x8b76('0x2e')]['rawAttributes'],function(_0x3a1dac){return{'name':_0x3a1dac[_0x8b76('0x2f')],'type':_0x3a1dac[_0x8b76('0x30')][_0x8b76('0x31')]};});_0xd785d5[_0x8b76('0x32')]=_[_0x8b76('0x2d')](_0x55e6bb,_0x8b76('0x2a'));_0xd785d5[_0x8b76('0x33')]=_['keys'](_0x2da737[_0x8b76('0x33')]);_0xd785d5['filters']=_[_0x8b76('0x34')](_0xd785d5[_0x8b76('0x32')],_0xd785d5[_0x8b76('0x33')]);_0x593be2[_0x8b76('0x35')]=_['intersection'](_0xd785d5[_0x8b76('0x32')],qs[_0x8b76('0x36')](_0x2da737[_0x8b76('0x33')][_0x8b76('0x36')]));_0x593be2[_0x8b76('0x35')]=_0x593be2[_0x8b76('0x35')]['length']?_0x593be2[_0x8b76('0x35')]:_0xd785d5[_0x8b76('0x32')];if(!_0x2da737['query'][_0x8b76('0x37')](_0x8b76('0x38'))){_0x593be2[_0x8b76('0x21')]=qs[_0x8b76('0x21')](_0x2da737['query']['limit']);_0x593be2[_0x8b76('0x20')]=qs[_0x8b76('0x20')](_0x2da737[_0x8b76('0x33')][_0x8b76('0x20')]);}_0x593be2[_0x8b76('0x39')]=qs[_0x8b76('0x3a')](_0x2da737[_0x8b76('0x33')][_0x8b76('0x3a')]);_0x593be2['where']=qs[_0x8b76('0x3b')](_[_0x8b76('0x3c')](_0x2da737[_0x8b76('0x33')],_0xd785d5[_0x8b76('0x3b')]),_0x55e6bb);if(_0x2da737[_0x8b76('0x33')][_0x8b76('0x3d')]){_0x593be2['where']=_[_0x8b76('0x3e')](_0x593be2['where'],{'$or':_[_0x8b76('0x2d')](_0x55e6bb,function(_0x36b23e){if(_0x36b23e[_0x8b76('0x30')]!==_0x8b76('0x3f')){var _0x1b88b9={};_0x1b88b9[_0x36b23e[_0x8b76('0x2a')]]={'$like':'%'+_0x2da737[_0x8b76('0x33')][_0x8b76('0x3d')]+'%'};return _0x1b88b9;}})});}_0x593be2=_[_0x8b76('0x3e')]({},_0x593be2,_0x2da737['options']);var _0x561744={'where':_0x593be2[_0x8b76('0x40')]};return db['VoiceQueueReport'][_0x8b76('0x22')](_0x561744)[_0x8b76('0x28')](function(_0xdb06e3){_0x107ace['count']=_0xdb06e3;if(_0x2da737[_0x8b76('0x33')]['includeAll']){_0x593be2[_0x8b76('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x8b76('0x42')](_0x593be2);})['then'](function(_0x52505c){_0x107ace['rows']=_0x52505c;return _0x107ace;})[_0x8b76('0x28')](respondWithFilteredResult(_0x25bc54,_0x593be2))[_0x8b76('0x43')](handleError(_0x25bc54,null));};exports[_0x8b76('0x44')]=function(_0x3a4d7a,_0x265b31){var _0x4cc2da={'raw':![],'where':{'id':_0x3a4d7a[_0x8b76('0x45')]['id']}},_0x5d3095={};_0x5d3095['model']=_['keys'](db[_0x8b76('0x2e')][_0x8b76('0x46')]);_0x5d3095['query']=_[_0x8b76('0x47')](_0x3a4d7a[_0x8b76('0x33')]);_0x5d3095['filters']=_[_0x8b76('0x34')](_0x5d3095['model'],_0x5d3095[_0x8b76('0x33')]);_0x4cc2da[_0x8b76('0x35')]=_[_0x8b76('0x34')](_0x5d3095['model'],qs['fields'](_0x3a4d7a[_0x8b76('0x33')][_0x8b76('0x36')]));_0x4cc2da[_0x8b76('0x35')]=_0x4cc2da['attributes'][_0x8b76('0x48')]?_0x4cc2da[_0x8b76('0x35')]:_0x5d3095[_0x8b76('0x32')];if(_0x3a4d7a[_0x8b76('0x33')][_0x8b76('0x49')]){_0x4cc2da['include']=[{'all':!![]}];}_0x4cc2da=_[_0x8b76('0x3e')]({},_0x4cc2da,_0x3a4d7a[_0x8b76('0x4a')]);return db[_0x8b76('0x2e')][_0x8b76('0x4b')](_0x4cc2da)[_0x8b76('0x28')](handleEntityNotFound(_0x265b31,null))[_0x8b76('0x28')](respondWithResult(_0x265b31,null))[_0x8b76('0x43')](handleError(_0x265b31,null));};exports[_0x8b76('0x4c')]=function(_0x4b9ef6,_0x1b86a8){return db['VoiceQueueReport'][_0x8b76('0x4c')](_0x4b9ef6[_0x8b76('0x4d')],{})[_0x8b76('0x28')](respondWithResult(_0x1b86a8,0xc9))[_0x8b76('0x43')](handleError(_0x1b86a8,null));};exports[_0x8b76('0x27')]=function(_0x54575f,_0x8f2a1c){if(_0x54575f[_0x8b76('0x4d')]['id']){delete _0x54575f[_0x8b76('0x4d')]['id'];}return db[_0x8b76('0x2e')][_0x8b76('0x4b')]({'where':{'id':_0x54575f[_0x8b76('0x45')]['id']}})[_0x8b76('0x28')](handleEntityNotFound(_0x8f2a1c,null))[_0x8b76('0x28')](saveUpdates(_0x54575f['body'],null))['then'](respondWithResult(_0x8f2a1c,null))[_0x8b76('0x43')](handleError(_0x8f2a1c,null));};exports[_0x8b76('0x29')]=function(_0x5c62df,_0xc9a182){return db[_0x8b76('0x2e')][_0x8b76('0x4b')]({'where':{'id':_0x5c62df[_0x8b76('0x45')]['id']}})[_0x8b76('0x28')](handleEntityNotFound(_0xc9a182,null))[_0x8b76('0x28')](removeEntity(_0xc9a182,null))['catch'](handleError(_0xc9a182,null));};exports[_0x8b76('0x4e')]=function(_0x199156,_0x216286){return db[_0x8b76('0x2e')][_0x8b76('0x4e')]()[_0x8b76('0x28')](respondWithResult(_0x216286,null))[_0x8b76('0x43')](handleError(_0x216286,null));};exports[_0x8b76('0x4f')]=function(_0x4e543b,_0x5b4fb7){var _0x571ece={},_0x8b043a={},_0x374b0a={'count':0x0,'rows':[]};_0x8b043a[_0x8b76('0x32')]=_[_0x8b76('0x47')](db[_0x8b76('0x2e')]['rawAttributes']);_0x8b043a['query']=_[_0x8b76('0x47')](_0x4e543b[_0x8b76('0x33')]);_0x8b043a[_0x8b76('0x3b')]=_[_0x8b76('0x34')](_0x8b043a[_0x8b76('0x32')],_0x8b043a[_0x8b76('0x33')]);_0x571ece['attributes']=_[_0x8b76('0x34')](_0x8b043a[_0x8b76('0x32')],qs[_0x8b76('0x36')](_0x4e543b['query'][_0x8b76('0x36')]));_0x571ece[_0x8b76('0x35')]=_0x571ece['attributes'][_0x8b76('0x48')]?_0x571ece[_0x8b76('0x35')]:_0x8b043a['model'];if(!_0x4e543b['query'][_0x8b76('0x37')]('nolimit')){_0x571ece[_0x8b76('0x21')]=qs[_0x8b76('0x21')](_0x4e543b[_0x8b76('0x33')]['limit']);_0x571ece['offset']=qs[_0x8b76('0x20')](_0x4e543b[_0x8b76('0x33')][_0x8b76('0x20')]);}_0x571ece[_0x8b76('0x39')]=qs[_0x8b76('0x3a')](_0x4e543b[_0x8b76('0x33')][_0x8b76('0x3a')]);_0x571ece['where']=qs[_0x8b76('0x3b')](_['pick'](_0x4e543b[_0x8b76('0x33')],_0x8b043a[_0x8b76('0x3b')]));if(_0x4e543b[_0x8b76('0x33')][_0x8b76('0x3d')]){_0x571ece[_0x8b76('0x40')]=_[_0x8b76('0x3e')](_0x571ece[_0x8b76('0x40')],{'$or':_['map'](_0x571ece[_0x8b76('0x35')],function(_0x5a004b){var _0x1f2388={};_0x1f2388[_0x5a004b]={'$like':'%'+_0x4e543b[_0x8b76('0x33')][_0x8b76('0x3d')]+'%'};return _0x1f2388;})});}_0x571ece=_['merge']({},_0x571ece,_0x4e543b[_0x8b76('0x4a')]);var _0x41570e={'where':_0x571ece[_0x8b76('0x40')]};return db[_0x8b76('0x2e')]['count'](_0x41570e)[_0x8b76('0x28')](function(_0x4d3b63){_0x374b0a[_0x8b76('0x22')]=_0x4d3b63;if(_0x4e543b['query']['includeAll']){_0x571ece[_0x8b76('0x41')]=[{'all':!![]}];}return db[_0x8b76('0x2e')][_0x8b76('0x42')](_0x571ece);})[_0x8b76('0x28')](function(_0x15d965){_0x374b0a[_0x8b76('0x50')]=_0x15d965;return _0x374b0a;})[_0x8b76('0x28')](respondWithFilteredResult(_0x5b4fb7,_0x571ece,'getVoiceQueuesReport'))[_0x8b76('0x43')](handleError(_0x5b4fb7,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a54884f..1acf2b3 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 _0x7441=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x58aabf,_0x36bc75){var _0x40f31a=function(_0x2a7e46){while(--_0x2a7e46){_0x58aabf['push'](_0x58aabf['shift']());}};_0x40f31a(++_0x36bc75);}(_0x7441,0x194));var _0x1744=function(_0x4bd57d,_0x40b79f){_0x4bd57d=_0x4bd57d-0x0;var _0x2283d1=_0x7441[_0x4bd57d];return _0x2283d1;};'use strict';var EventEmitter=require(_0x1744('0x0'));var VoiceQueueReport=require(_0x1744('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1744('0x2')](0x0);var events={'afterCreate':_0x1744('0x3'),'afterUpdate':_0x1744('0x4'),'afterDestroy':_0x1744('0x5')};function emitEvent(_0x5bbbcf){return function(_0x14de52,_0x3ca22a,_0x3410b8){VoiceQueueReportEvents[_0x1744('0x6')](_0x5bbbcf+':'+_0x14de52['id'],_0x14de52);VoiceQueueReportEvents['emit'](_0x5bbbcf,_0x14de52);_0x3410b8(null);};}for(var e in events){if(events[_0x1744('0x7')](e)){var event=events[e];VoiceQueueReport[_0x1744('0x8')](e,emitEvent(event));}}module[_0x1744('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xaec5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove'];(function(_0x4f040b,_0x58acd3){var _0x760991=function(_0x57228b){while(--_0x57228b){_0x4f040b['push'](_0x4f040b['shift']());}};_0x760991(++_0x58acd3);}(_0xaec5,0xe0));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5aec('0x0'));var VoiceQueueReport=require(_0x5aec('0x1'))['db'][_0x5aec('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5aec('0x3')](0x0);var events={'afterCreate':_0x5aec('0x4'),'afterUpdate':'update','afterDestroy':_0x5aec('0x5')};function emitEvent(_0x1166e5){return function(_0x2d9a71,_0x4510e6,_0x5984cc){VoiceQueueReportEvents[_0x5aec('0x6')](_0x1166e5+':'+_0x2d9a71['id'],_0x2d9a71);VoiceQueueReportEvents[_0x5aec('0x6')](_0x1166e5,_0x2d9a71);_0x5984cc(null);};}for(var e in events){if(events[_0x5aec('0x7')](e)){var event=events[e];VoiceQueueReport[_0x5aec('0x8')](e,emitEvent(event));}}module[_0x5aec('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 6d4860e..8aea530 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 _0x982c=['rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x4f6b61,_0x14cc4d){var _0x281cd0=function(_0x4e0822){while(--_0x4e0822){_0x4f6b61['push'](_0x4f6b61['shift']());}};_0x281cd0(++_0x14cc4d);}(_0x982c,0x1c8));var _0xc982=function(_0x56aed2,_0x50b419){_0x56aed2=_0x56aed2-0x0;var _0x571ed4=_0x982c[_0x56aed2];return _0x571ed4;};'use strict';var _=require(_0xc982('0x0'));var util=require(_0xc982('0x1'));var logger=require(_0xc982('0x2'))('api');var moment=require(_0xc982('0x3'));var BPromise=require(_0xc982('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc982('0x5'));var rimraf=require(_0xc982('0x6'));var config=require(_0xc982('0x7'));var attributes=require(_0xc982('0x8'));module['exports']=function(_0x146259,_0x48ac44){return _0x146259[_0xc982('0x9')](_0xc982('0xa'),attributes,{'tableName':_0xc982('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc982('0xc')]},{'fields':[_0xc982('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf58=['define','VoiceQueueReport','report_queue','uniqueid','lodash','util','api','moment','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x21b63c,_0x4d9c8b){var _0x4c7a59=function(_0x4fe8f2){while(--_0x4fe8f2){_0x21b63c['push'](_0x21b63c['shift']());}};_0x4c7a59(++_0x4d9c8b);}(_0xcf58,0x1b1));var _0x8cf5=function(_0x3bf19b,_0x114b58){_0x3bf19b=_0x3bf19b-0x0;var _0x52f89d=_0xcf58[_0x3bf19b];return _0x52f89d;};'use strict';var _=require(_0x8cf5('0x0'));var util=require(_0x8cf5('0x1'));var logger=require('../../config/logger')(_0x8cf5('0x2'));var moment=require(_0x8cf5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cf5('0x4'));var rimraf=require(_0x8cf5('0x5'));var config=require(_0x8cf5('0x6'));var attributes=require(_0x8cf5('0x7'));module[_0x8cf5('0x8')]=function(_0x4d3f4b,_0x2b191d){return _0x4d3f4b[_0x8cf5('0x9')](_0x8cf5('0xa'),attributes,{'tableName':_0x8cf5('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8cf5('0xc')]},{'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 ea18824..0fee18f 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 _0x01da=['CreateVoiceQueueReport','create','body','where','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','stringify','catch'];(function(_0x5f516e,_0x298150){var _0x1c81e5=function(_0x25be12){while(--_0x25be12){_0x5f516e['push'](_0x5f516e['shift']());}};_0x1c81e5(++_0x298150);}(_0x01da,0x188));var _0xa01d=function(_0x3dc9c7,_0x469098){_0x3dc9c7=_0x3dc9c7-0x0;var _0x4cb08c=_0x01da[_0x3dc9c7];return _0x4cb08c;};'use strict';var _=require('lodash');var util=require(_0xa01d('0x0'));var moment=require(_0xa01d('0x1'));var BPromise=require(_0xa01d('0x2'));var rs=require(_0xa01d('0x3'));var fs=require('fs');var Redis=require(_0xa01d('0x4'));var db=require(_0xa01d('0x5'))['db'];var utils=require(_0xa01d('0x6'));var logger=require(_0xa01d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa01d('0x8'));var client=jayson[_0xa01d('0x9')][_0xa01d('0xa')]({'port':0x232a});config['redis']=_[_0xa01d('0xb')](config[_0xa01d('0xc')],{'host':_0xa01d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa01d('0xc')]));require('./voiceQueueReport.socket')[_0xa01d('0xe')](socket);function respondWithRpcPromise(_0x24fd67,_0x49c46c,_0x26de50){return new BPromise(function(_0x2552f0,_0x40de13){return client[_0xa01d('0xf')](_0x24fd67,_0x26de50)[_0xa01d('0x10')](function(_0x110165){logger[_0xa01d('0x11')](_0xa01d('0x12'),_0x49c46c,_0xa01d('0x13'));logger[_0xa01d('0x14')](_0xa01d('0x15'),_0x49c46c,_0xa01d('0x13'),JSON['stringify'](_0x110165));if(_0x110165['error']){if(_0x110165[_0xa01d('0x16')][_0xa01d('0x17')]===0x1f4){logger[_0xa01d('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x49c46c,_0x110165[_0xa01d('0x16')][_0xa01d('0x18')]);return _0x40de13(_0x110165[_0xa01d('0x16')][_0xa01d('0x18')]);}logger[_0xa01d('0x16')](_0xa01d('0x12'),_0x49c46c,_0x110165[_0xa01d('0x16')][_0xa01d('0x18')]);return _0x2552f0(_0x110165[_0xa01d('0x16')]['message']);}else{logger[_0xa01d('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x49c46c,_0xa01d('0x13'));_0x2552f0(_0x110165[_0xa01d('0x19')][_0xa01d('0x18')]);}})['catch'](function(_0x43f754){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x49c46c,_0x43f754);_0x40de13(_0x43f754);});});}exports[_0xa01d('0x1a')]=function(_0x494589){var _0x5d927f=this;return new Promise(function(_0x5f43e1,_0x70a2d9){return db[_0xa01d('0x1b')][_0xa01d('0x1c')]({'raw':_0x494589[_0xa01d('0x1d')]?_0x494589[_0xa01d('0x1d')][_0xa01d('0x1e')]===undefined?!![]:![]:!![],'where':_0x494589[_0xa01d('0x1d')]?_0x494589[_0xa01d('0x1d')]['where']||null:null,'attributes':_0x494589[_0xa01d('0x1d')]?_0x494589['options'][_0xa01d('0x1f')]||null:null,'limit':_0x494589['options']?_0x494589[_0xa01d('0x1d')][_0xa01d('0x20')]||null:null,'include':_0x494589[_0xa01d('0x1d')]?_0x494589[_0xa01d('0x1d')][_0xa01d('0x21')]?_[_0xa01d('0x22')](_0x494589[_0xa01d('0x1d')]['include'],function(_0x162058){return{'model':db[_0x162058[_0xa01d('0x23')]],'as':_0x162058['as'],'attributes':_0x162058['attributes'],'include':_0x162058['include']?_[_0xa01d('0x22')](_0x162058[_0xa01d('0x21')],function(_0x56bc19){return{'model':db[_0x56bc19[_0xa01d('0x23')]],'as':_0x56bc19['as'],'attributes':_0x56bc19['attributes'],'include':_0x56bc19['include']?_[_0xa01d('0x22')](_0x56bc19[_0xa01d('0x21')],function(_0x34d944){return{'model':db[_0x34d944[_0xa01d('0x23')]],'as':_0x34d944['as'],'attributes':_0x34d944[_0xa01d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa01d('0x10')](function(_0x1094a3){logger[_0xa01d('0x11')](_0xa01d('0x1a'),_0x494589);logger[_0xa01d('0x14')](_0xa01d('0x1a'),_0x494589,JSON[_0xa01d('0x24')](_0x1094a3));_0x5f43e1(_0x1094a3);})[_0xa01d('0x25')](function(_0x5bcf59){logger[_0xa01d('0x16')](_0xa01d('0x1a'),_0x5bcf59[_0xa01d('0x18')],_0x494589);_0x70a2d9(_0x5d927f['error'](0x1f4,_0x5bcf59[_0xa01d('0x18')]));});});};exports[_0xa01d('0x26')]=function(_0x3cd582){var _0x813407=this;return new Promise(function(_0x29d0c4,_0x15b164){return db[_0xa01d('0x1b')][_0xa01d('0x27')](_0x3cd582[_0xa01d('0x28')],{'raw':_0x3cd582['options']?_0x3cd582[_0xa01d('0x1d')][_0xa01d('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x13538d){logger[_0xa01d('0x11')](_0xa01d('0x26'),_0x3cd582);logger[_0xa01d('0x14')](_0xa01d('0x26'),_0x3cd582,JSON[_0xa01d('0x24')](_0x13538d));_0x29d0c4(_0x13538d);})[_0xa01d('0x25')](function(_0x4b602a){logger[_0xa01d('0x16')](_0xa01d('0x26'),_0x4b602a[_0xa01d('0x18')],_0x3cd582);_0x15b164(_0x813407['error'](0x1f4,_0x4b602a['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x3b94b6){var _0x2fcf9c=this;return new Promise(function(_0x442dd0,_0x10b3ec){return db[_0xa01d('0x1b')]['update'](_0x3b94b6[_0xa01d('0x28')],{'raw':_0x3b94b6['options']?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b94b6[_0xa01d('0x1d')]?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x29')]||null:null,'attributes':_0x3b94b6[_0xa01d('0x1d')]?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x1f')]||null:null,'limit':_0x3b94b6[_0xa01d('0x1d')]?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x20')]||null:null})[_0xa01d('0x10')](function(_0x58fe80){logger[_0xa01d('0x11')]('UpdateVoiceQueueReport',_0x3b94b6);logger[_0xa01d('0x14')](_0xa01d('0x2a'),_0x3b94b6,JSON['stringify'](_0x58fe80));_0x442dd0(_0x58fe80);})['catch'](function(_0x24279f){logger[_0xa01d('0x16')](_0xa01d('0x2a'),_0x24279f[_0xa01d('0x18')],_0x3b94b6);_0x10b3ec(_0x2fcf9c[_0xa01d('0x16')](0x1f4,_0x24279f[_0xa01d('0x18')]));});});}; \ No newline at end of file +var _0x43c5=['GetVoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','VoiceQueueReport','create','body','CreateVoiceQueueReport','debug','update','limit','UpdateVoiceQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x14384a,_0x3656de){var _0x2909bf=function(_0x3bb1f4){while(--_0x3bb1f4){_0x14384a['push'](_0x14384a['shift']());}};_0x2909bf(++_0x3656de);}(_0x43c5,0x1df));var _0x543c=function(_0x1e914e,_0x4ee375){_0x1e914e=_0x1e914e-0x0;var _0x113a08=_0x43c5[_0x1e914e];return _0x113a08;};'use strict';var _=require(_0x543c('0x0'));var util=require(_0x543c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x543c('0x2'));var fs=require('fs');var Redis=require(_0x543c('0x3'));var db=require(_0x543c('0x4'))['db'];var utils=require(_0x543c('0x5'));var logger=require('../../config/logger')(_0x543c('0x6'));var config=require(_0x543c('0x7'));var jayson=require(_0x543c('0x8'));var client=jayson[_0x543c('0x9')][_0x543c('0xa')]({'port':0x232a});config[_0x543c('0xb')]=_['defaults'](config[_0x543c('0xb')],{'host':_0x543c('0xc'),'port':0x18eb});var socket=require(_0x543c('0xd'))(new Redis(config[_0x543c('0xb')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x5bba32,_0x20156c,_0x179623){return new BPromise(function(_0x3a95c4,_0x5372cc){return client['request'](_0x5bba32,_0x179623)[_0x543c('0xe')](function(_0x466489){logger[_0x543c('0xf')](_0x543c('0x10'),_0x20156c,_0x543c('0x11'));logger['debug'](_0x543c('0x12'),_0x20156c,_0x543c('0x11'),JSON[_0x543c('0x13')](_0x466489));if(_0x466489[_0x543c('0x14')]){if(_0x466489[_0x543c('0x14')][_0x543c('0x15')]===0x1f4){logger[_0x543c('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x20156c,_0x466489[_0x543c('0x14')][_0x543c('0x16')]);return _0x5372cc(_0x466489[_0x543c('0x14')][_0x543c('0x16')]);}logger[_0x543c('0x14')](_0x543c('0x10'),_0x20156c,_0x466489[_0x543c('0x14')][_0x543c('0x16')]);return _0x3a95c4(_0x466489[_0x543c('0x14')]['message']);}else{logger['info'](_0x543c('0x10'),_0x20156c,_0x543c('0x11'));_0x3a95c4(_0x466489[_0x543c('0x17')][_0x543c('0x16')]);}})[_0x543c('0x18')](function(_0x2b58f1){logger[_0x543c('0x14')](_0x543c('0x10'),_0x20156c,_0x2b58f1);_0x5372cc(_0x2b58f1);});});}exports[_0x543c('0x19')]=function(_0x3e5cfb){var _0x296b23=this;return new Promise(function(_0x3eaf50,_0x118965){return db['VoiceQueueReport'][_0x543c('0x1a')]({'raw':_0x3e5cfb[_0x543c('0x1b')]?_0x3e5cfb[_0x543c('0x1b')][_0x543c('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e5cfb[_0x543c('0x1b')]?_0x3e5cfb['options'][_0x543c('0x1d')]||null:null,'attributes':_0x3e5cfb[_0x543c('0x1b')]?_0x3e5cfb[_0x543c('0x1b')][_0x543c('0x1e')]||null:null,'limit':_0x3e5cfb['options']?_0x3e5cfb[_0x543c('0x1b')]['limit']||null:null,'include':_0x3e5cfb[_0x543c('0x1b')]?_0x3e5cfb['options'][_0x543c('0x1f')]?_[_0x543c('0x20')](_0x3e5cfb['options'][_0x543c('0x1f')],function(_0x4800ae){return{'model':db[_0x4800ae[_0x543c('0x21')]],'as':_0x4800ae['as'],'attributes':_0x4800ae[_0x543c('0x1e')],'include':_0x4800ae[_0x543c('0x1f')]?_[_0x543c('0x20')](_0x4800ae[_0x543c('0x1f')],function(_0x46c8d5){return{'model':db[_0x46c8d5[_0x543c('0x21')]],'as':_0x46c8d5['as'],'attributes':_0x46c8d5[_0x543c('0x1e')],'include':_0x46c8d5[_0x543c('0x1f')]?_[_0x543c('0x20')](_0x46c8d5[_0x543c('0x1f')],function(_0x372698){return{'model':db[_0x372698[_0x543c('0x21')]],'as':_0x372698['as'],'attributes':_0x372698[_0x543c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x543c('0xe')](function(_0x495e2e){logger[_0x543c('0xf')](_0x543c('0x19'),_0x3e5cfb);logger['debug'](_0x543c('0x19'),_0x3e5cfb,JSON[_0x543c('0x13')](_0x495e2e));_0x3eaf50(_0x495e2e);})[_0x543c('0x18')](function(_0x19a1b9){logger['error'](_0x543c('0x19'),_0x19a1b9[_0x543c('0x16')],_0x3e5cfb);_0x118965(_0x296b23[_0x543c('0x14')](0x1f4,_0x19a1b9[_0x543c('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0x136ae2){var _0x205b64=this;return new Promise(function(_0xf8adaa,_0x556490){return db[_0x543c('0x22')][_0x543c('0x23')](_0x136ae2[_0x543c('0x24')],{'raw':_0x136ae2['options']?_0x136ae2['options'][_0x543c('0x1c')]===undefined?!![]:![]:!![]})[_0x543c('0xe')](function(_0x2b0583){logger['info'](_0x543c('0x25'),_0x136ae2);logger[_0x543c('0x26')](_0x543c('0x25'),_0x136ae2,JSON[_0x543c('0x13')](_0x2b0583));_0xf8adaa(_0x2b0583);})[_0x543c('0x18')](function(_0x51b08d){logger['error'](_0x543c('0x25'),_0x51b08d[_0x543c('0x16')],_0x136ae2);_0x556490(_0x205b64[_0x543c('0x14')](0x1f4,_0x51b08d[_0x543c('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x51e349){var _0x938d13=this;return new Promise(function(_0x23c8b2,_0x65e378){return db[_0x543c('0x22')][_0x543c('0x27')](_0x51e349['body'],{'raw':_0x51e349[_0x543c('0x1b')]?_0x51e349['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e349[_0x543c('0x1b')]?_0x51e349[_0x543c('0x1b')][_0x543c('0x1d')]||null:null,'attributes':_0x51e349['options']?_0x51e349['options']['attributes']||null:null,'limit':_0x51e349[_0x543c('0x1b')]?_0x51e349[_0x543c('0x1b')][_0x543c('0x28')]||null:null})[_0x543c('0xe')](function(_0x242537){logger['info'](_0x543c('0x29'),_0x51e349);logger[_0x543c('0x26')](_0x543c('0x29'),_0x51e349,JSON[_0x543c('0x13')](_0x242537));_0x23c8b2(_0x242537);})['catch'](function(_0x169fb7){logger['error']('UpdateVoiceQueueReport',_0x169fb7[_0x543c('0x16')],_0x51e349);_0x65e378(_0x938d13[_0x543c('0x14')](0x1f4,_0x169fb7['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index d6a7062..715db21 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 _0x97ed=['voiceQueueReport:','./voiceQueueReport.events','save','emit','removeListener','length'];(function(_0x38722f,_0x369bdc){var _0x219d0c=function(_0x4ad531){while(--_0x4ad531){_0x38722f['push'](_0x38722f['shift']());}};_0x219d0c(++_0x369bdc);}(_0x97ed,0x1e7));var _0xd97e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x97ed[_0x4b369d];return _0x571a98;};'use strict';var VoiceQueueReportEvents=require(_0xd97e('0x0'));var events=[_0xd97e('0x1'),'remove','update'];function createListener(_0x1069c7,_0x18d811){return function(_0x5cc925){_0x18d811[_0xd97e('0x2')](_0x1069c7,_0x5cc925);};}function removeListener(_0x27b80c,_0x3d09f8){return function(){VoiceQueueReportEvents[_0xd97e('0x3')](_0x27b80c,_0x3d09f8);};}exports['register']=function(_0x2468bc){for(var _0x538bdd=0x0,_0x4f7f99=events[_0xd97e('0x4')];_0x538bdd<_0x4f7f99;_0x538bdd++){var _0x52a86d=events[_0x538bdd];var _0x51a495=createListener(_0xd97e('0x5')+_0x52a86d,_0x2468bc);VoiceQueueReportEvents['on'](_0x52a86d,_0x51a495);}}; \ No newline at end of file +var _0xe002=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','removeListener','register'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0xe002,0xf7));var _0x2e00=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xe002[_0x996bc8];return _0x20b0ea;};'use strict';var VoiceQueueReportEvents=require(_0x2e00('0x0'));var events=[_0x2e00('0x1'),_0x2e00('0x2'),'update'];function createListener(_0xbe48a1,_0x125b19){return function(_0xa53610){_0x125b19['emit'](_0xbe48a1,_0xa53610);};}function removeListener(_0x34f964,_0xba44f2){return function(){VoiceQueueReportEvents[_0x2e00('0x3')](_0x34f964,_0xba44f2);};}exports[_0x2e00('0x4')]=function(_0x3cd8e8){for(var _0x120155=0x0,_0x351729=events[_0x2e00('0x5')];_0x120155<_0x351729;_0x120155++){var _0x52b046=events[_0x120155];var _0x36a23a=createListener(_0x2e00('0x6')+_0x52b046,_0x3cd8e8);VoiceQueueReportEvents['on'](_0x52b046,_0x36a23a);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 18430ea..b5ed5e6 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 _0xb035=['get','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index'];(function(_0x4c2769,_0x42aadd){var _0x27bdf9=function(_0x4136a5){while(--_0x4136a5){_0x4c2769['push'](_0x4c2769['shift']());}};_0x27bdf9(++_0x42aadd);}(_0xb035,0x87));var _0x5b03=function(_0x2ecfca,_0x4f5d2c){_0x2ecfca=_0x2ecfca-0x0;var _0x3cbd36=_0xb035[_0x2ecfca];return _0x3cbd36;};'use strict';var multer=require(_0x5b03('0x0'));var util=require('util');var path=require(_0x5b03('0x1'));var timeout=require(_0x5b03('0x2'));var express=require(_0x5b03('0x3'));var router=express[_0x5b03('0x4')]();var fs_extra=require(_0x5b03('0x5'));var auth=require(_0x5b03('0x6'));var interaction=require(_0x5b03('0x7'));var config=require(_0x5b03('0x8'));var controller=require(_0x5b03('0x9'));router['get']('/',auth[_0x5b03('0xa')](),controller[_0x5b03('0xb')]);router[_0x5b03('0xc')](_0x5b03('0xd'),auth[_0x5b03('0xa')](),controller[_0x5b03('0xe')]);router[_0x5b03('0xf')]('/',auth[_0x5b03('0xa')](),controller[_0x5b03('0x10')]);router[_0x5b03('0x11')](_0x5b03('0xd'),auth['isAuthenticated'](),controller[_0x5b03('0x12')]);router[_0x5b03('0x13')](_0x5b03('0xd'),auth[_0x5b03('0xa')](),controller[_0x5b03('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5010=['../../config/environment','index','isAuthenticated','show','post','create','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x421752,_0x20f492){var _0x23ed3e=function(_0x3a9e19){while(--_0x3a9e19){_0x421752['push'](_0x421752['shift']());}};_0x23ed3e(++_0x20f492);}(_0x5010,0x1c9));var _0x0501=function(_0x463dba,_0x184fa3){_0x463dba=_0x463dba-0x0;var _0x30b5fb=_0x5010[_0x463dba];return _0x30b5fb;};'use strict';var multer=require(_0x0501('0x0'));var util=require(_0x0501('0x1'));var path=require(_0x0501('0x2'));var timeout=require(_0x0501('0x3'));var express=require(_0x0501('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0501('0x5'));var interaction=require(_0x0501('0x6'));var config=require(_0x0501('0x7'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0501('0x8')]);router['get']('/:id',auth[_0x0501('0x9')](),controller[_0x0501('0xa')]);router[_0x0501('0xb')]('/',auth[_0x0501('0x9')](),controller[_0x0501('0xc')]);router['put'](_0x0501('0xd'),auth[_0x0501('0x9')](),controller[_0x0501('0xe')]);router[_0x0501('0xf')](_0x0501('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 3cf1c2e..2c283de 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 _0xe98d=['STRING','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x36c467,_0x537519){var _0x240018=function(_0x5a4df9){while(--_0x5a4df9){_0x36c467['push'](_0x36c467['shift']());}};_0x240018(++_0x537519);}(_0xe98d,0x1d2));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xde98('0x0'));var moment=require(_0xde98('0x1'));module['exports']={'time':{'type':Sequelize[_0xde98('0x2')]},'callid':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['literal'](_0xde98('0x3'))}}; \ No newline at end of file +var _0xdee5=['moment','exports','STRING','DATE','literal'];(function(_0x4a9148,_0x4a699e){var _0x27057a=function(_0xbbaad3){while(--_0xbbaad3){_0x4a9148['push'](_0x4a9148['shift']());}};_0x27057a(++_0x4a699e);}(_0xdee5,0xf0));var _0x5dee=function(_0x368259,_0x3bead5){_0x368259=_0x368259-0x0;var _0x57b342=_0xdee5[_0x368259];return _0x57b342;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5dee('0x0'));module[_0x5dee('0x1')]={'time':{'type':Sequelize[_0x5dee('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5dee('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5dee('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5dee('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5dee('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5dee('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5dee('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5dee('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5dee('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x5dee('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index bed18be..0062b60 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 _0xa664=['options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','error','name','send','VoiceQueuesLog','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where'];(function(_0x53c3ba,_0xf3c01){var _0x423b79=function(_0x41e5ff){while(--_0x41e5ff){_0x53c3ba['push'](_0x53c3ba['shift']());}};_0x423b79(++_0xf3c01);}(_0xa664,0x1c9));var _0x4a66=function(_0x2d4f30,_0x421b00){_0x2d4f30=_0x2d4f30-0x0;var _0x8a4b42=_0xa664[_0x2d4f30];return _0x8a4b42;};'use strict';var emlformat=require(_0x4a66('0x0'));var rimraf=require(_0x4a66('0x1'));var zipdir=require(_0x4a66('0x2'));var jsonpatch=require(_0x4a66('0x3'));var rp=require(_0x4a66('0x4'));var moment=require('moment');var BPromise=require(_0x4a66('0x5'));var Mustache=require(_0x4a66('0x6'));var util=require('util');var path=require(_0x4a66('0x7'));var sox=require(_0x4a66('0x8'));var csv=require(_0x4a66('0x9'));var ejs=require(_0x4a66('0xa'));var fs=require('fs');var fs_extra=require(_0x4a66('0xb'));var _=require(_0x4a66('0xc'));var squel=require(_0x4a66('0xd'));var crypto=require(_0x4a66('0xe'));var jsforce=require(_0x4a66('0xf'));var deskjs=require(_0x4a66('0x10'));var toCsv=require(_0x4a66('0x9'));var querystring=require(_0x4a66('0x11'));var Papa=require(_0x4a66('0x12'));var Redis=require(_0x4a66('0x13'));var authService=require(_0x4a66('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4a66('0x15'));var hardwareService=require(_0x4a66('0x16'));var logger=require('../../config/logger')(_0x4a66('0x17'));var utils=require(_0x4a66('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4a66('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x588022,_0x17c44d){_0x17c44d=_0x17c44d||0xcc;return function(_0x1edff0){if(_0x1edff0){return _0x588022[_0x4a66('0x1a')](_0x17c44d);}return _0x588022[_0x4a66('0x1b')](_0x17c44d)[_0x4a66('0x1c')]();};}function respondWithResult(_0x2d1beb,_0x389ed4){_0x389ed4=_0x389ed4||0xc8;return function(_0x26b838){if(_0x26b838){return _0x2d1beb[_0x4a66('0x1b')](_0x389ed4)[_0x4a66('0x1d')](_0x26b838);}};}function respondWithFilteredResult(_0x3c71fa,_0x320802){return function(_0x1c42a6){if(_0x1c42a6){var _0x59859c=typeof _0x320802['offset']===_0x4a66('0x1e')&&typeof _0x320802['limit']===_0x4a66('0x1e');var _0x558719=_0x1c42a6['count'];var _0x3ba757=_0x59859c?0x0:_0x320802[_0x4a66('0x1f')];var _0x5ad578=_0x59859c?_0x1c42a6[_0x4a66('0x20')]:_0x320802['offset']+_0x320802[_0x4a66('0x21')];var _0x3052a4;if(_0x5ad578>=_0x558719){_0x5ad578=_0x558719;_0x3052a4=0xc8;}else{_0x3052a4=0xce;}_0x3c71fa['status'](_0x3052a4);return _0x3c71fa[_0x4a66('0x22')]('Content-Range',_0x3ba757+'-'+_0x5ad578+'/'+_0x558719)[_0x4a66('0x1d')](_0x1c42a6);}return null;};}function patchUpdates(_0x5ca19c){return function(_0x4c61f6){try{jsonpatch['apply'](_0x4c61f6,_0x5ca19c,!![]);}catch(_0x6b1d1f){return BPromise[_0x4a66('0x23')](_0x6b1d1f);}return _0x4c61f6[_0x4a66('0x24')]();};}function saveUpdates(_0x166959,_0x18242f){return function(_0x4f129c){if(_0x4f129c){return _0x4f129c[_0x4a66('0x25')](_0x166959)[_0x4a66('0x26')](function(_0x3c5635){return _0x3c5635;});}return null;};}function removeEntity(_0x42831f,_0x4aa180){return function(_0x25f1f6){if(_0x25f1f6){return _0x25f1f6[_0x4a66('0x27')]()[_0x4a66('0x26')](function(){_0x42831f[_0x4a66('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d902,_0x53addd){return function(_0x1c30e6){if(!_0x1c30e6){_0x42d902['sendStatus'](0x194);}return _0x1c30e6;};}function handleError(_0x3a3f15,_0x5bc3ac){_0x5bc3ac=_0x5bc3ac||0x1f4;return function(_0x94e4d){logger[_0x4a66('0x28')](_0x94e4d['stack']);if(_0x94e4d[_0x4a66('0x29')]){delete _0x94e4d[_0x4a66('0x29')];}_0x3a3f15[_0x4a66('0x1b')](_0x5bc3ac)[_0x4a66('0x2a')](_0x94e4d);};}exports['index']=function(_0xf76eeb,_0x1523f9){var _0xc731f6={},_0x1fee13={},_0x2487f6={'count':0x0,'rows':[]};var _0x2d836a=_['map'](db[_0x4a66('0x2b')]['rawAttributes'],function(_0x23b58f){return{'name':_0x23b58f['fieldName'],'type':_0x23b58f[_0x4a66('0x2c')][_0x4a66('0x2d')]};});_0x1fee13['model']=_[_0x4a66('0x2e')](_0x2d836a,_0x4a66('0x29'));_0x1fee13['query']=_['keys'](_0xf76eeb[_0x4a66('0x2f')]);_0x1fee13['filters']=_[_0x4a66('0x30')](_0x1fee13[_0x4a66('0x31')],_0x1fee13[_0x4a66('0x2f')]);_0xc731f6[_0x4a66('0x32')]=_[_0x4a66('0x30')](_0x1fee13['model'],qs['fields'](_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x33')]));_0xc731f6['attributes']=_0xc731f6[_0x4a66('0x32')][_0x4a66('0x34')]?_0xc731f6[_0x4a66('0x32')]:_0x1fee13[_0x4a66('0x31')];if(!_0xf76eeb['query'][_0x4a66('0x35')](_0x4a66('0x36'))){_0xc731f6['limit']=qs[_0x4a66('0x21')](_0xf76eeb[_0x4a66('0x2f')]['limit']);_0xc731f6[_0x4a66('0x1f')]=qs[_0x4a66('0x1f')](_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x1f')]);}_0xc731f6['order']=qs[_0x4a66('0x37')](_0xf76eeb['query'][_0x4a66('0x37')]);_0xc731f6['where']=qs[_0x4a66('0x38')](_[_0x4a66('0x39')](_0xf76eeb['query'],_0x1fee13['filters']),_0x2d836a);if(_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x3a')]){_0xc731f6['where']=_[_0x4a66('0x3b')](_0xc731f6[_0x4a66('0x3c')],{'$or':_[_0x4a66('0x2e')](_0x2d836a,function(_0xc9566a){if(_0xc9566a[_0x4a66('0x2c')]!=='VIRTUAL'){var _0x4b8877={};_0x4b8877[_0xc9566a[_0x4a66('0x29')]]={'$like':'%'+_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x3a')]+'%'};return _0x4b8877;}})});}_0xc731f6=_['merge']({},_0xc731f6,_0xf76eeb[_0x4a66('0x3d')]);var _0x1f0b33={'where':_0xc731f6[_0x4a66('0x3c')]};return db[_0x4a66('0x2b')][_0x4a66('0x20')](_0x1f0b33)['then'](function(_0x357b20){_0x2487f6[_0x4a66('0x20')]=_0x357b20;if(_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x3e')]){_0xc731f6[_0x4a66('0x3f')]=[{'all':!![]}];}return db[_0x4a66('0x2b')][_0x4a66('0x40')](_0xc731f6);})[_0x4a66('0x26')](function(_0x36fb37){_0x2487f6[_0x4a66('0x41')]=_0x36fb37;return _0x2487f6;})[_0x4a66('0x26')](respondWithFilteredResult(_0x1523f9,_0xc731f6))['catch'](handleError(_0x1523f9,null));};exports[_0x4a66('0x42')]=function(_0x3d87a3,_0x248e0f){var _0x50bd8f={'raw':!![],'where':{'id':_0x3d87a3[_0x4a66('0x43')]['id']}},_0x4ff02f={};_0x4ff02f[_0x4a66('0x31')]=_['keys'](db[_0x4a66('0x2b')][_0x4a66('0x44')]);_0x4ff02f[_0x4a66('0x2f')]=_[_0x4a66('0x45')](_0x3d87a3['query']);_0x4ff02f[_0x4a66('0x38')]=_['intersection'](_0x4ff02f[_0x4a66('0x31')],_0x4ff02f[_0x4a66('0x2f')]);_0x50bd8f['attributes']=_[_0x4a66('0x30')](_0x4ff02f[_0x4a66('0x31')],qs[_0x4a66('0x33')](_0x3d87a3[_0x4a66('0x2f')][_0x4a66('0x33')]));_0x50bd8f[_0x4a66('0x32')]=_0x50bd8f['attributes'][_0x4a66('0x34')]?_0x50bd8f[_0x4a66('0x32')]:_0x4ff02f[_0x4a66('0x31')];if(_0x3d87a3[_0x4a66('0x2f')][_0x4a66('0x3e')]){_0x50bd8f[_0x4a66('0x3f')]=[{'all':!![]}];}_0x50bd8f=_['merge']({},_0x50bd8f,_0x3d87a3[_0x4a66('0x3d')]);return db[_0x4a66('0x2b')][_0x4a66('0x46')](_0x50bd8f)[_0x4a66('0x26')](handleEntityNotFound(_0x248e0f,null))[_0x4a66('0x26')](respondWithResult(_0x248e0f,null))[_0x4a66('0x47')](handleError(_0x248e0f,null));};exports['create']=function(_0x3a7b70,_0x538690){return db[_0x4a66('0x2b')][_0x4a66('0x48')](_0x3a7b70[_0x4a66('0x49')],{})['then'](respondWithResult(_0x538690,0xc9))[_0x4a66('0x47')](handleError(_0x538690,null));};exports[_0x4a66('0x25')]=function(_0x166187,_0x1d0d87){if(_0x166187[_0x4a66('0x49')]['id']){delete _0x166187[_0x4a66('0x49')]['id'];}return db[_0x4a66('0x2b')][_0x4a66('0x46')]({'where':{'id':_0x166187[_0x4a66('0x43')]['id']}})[_0x4a66('0x26')](handleEntityNotFound(_0x1d0d87,null))[_0x4a66('0x26')](saveUpdates(_0x166187[_0x4a66('0x49')],null))['then'](respondWithResult(_0x1d0d87,null))['catch'](handleError(_0x1d0d87,null));};exports['destroy']=function(_0x73296,_0x49bf9e){return db['VoiceQueuesLog']['find']({'where':{'id':_0x73296[_0x4a66('0x43')]['id']}})[_0x4a66('0x26')](handleEntityNotFound(_0x49bf9e,null))[_0x4a66('0x26')](removeEntity(_0x49bf9e,null))[_0x4a66('0x47')](handleError(_0x49bf9e,null));}; \ No newline at end of file +var _0x7c7f=['../../mysqldb','status','json','offset','count','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','rows','catch','show','params','includeAll','include','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1d0889,_0x2a2101){var _0x3de078=function(_0x2aa261){while(--_0x2aa261){_0x1d0889['push'](_0x1d0889['shift']());}};_0x3de078(++_0x2a2101);}(_0x7c7f,0x15f));var _0xf7c7=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x7c7f[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0xf7c7('0x0'));var rimraf=require(_0xf7c7('0x1'));var zipdir=require(_0xf7c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7c7('0x3'));var moment=require(_0xf7c7('0x4'));var BPromise=require(_0xf7c7('0x5'));var Mustache=require(_0xf7c7('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf7c7('0x7'));var csv=require(_0xf7c7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7c7('0x9'));var _=require(_0xf7c7('0xa'));var squel=require(_0xf7c7('0xb'));var crypto=require(_0xf7c7('0xc'));var jsforce=require(_0xf7c7('0xd'));var deskjs=require(_0xf7c7('0xe'));var toCsv=require(_0xf7c7('0x8'));var querystring=require(_0xf7c7('0xf'));var Papa=require(_0xf7c7('0x10'));var Redis=require(_0xf7c7('0x11'));var authService=require(_0xf7c7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf7c7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf7c7('0x14'));var utils=require(_0xf7c7('0x15'));var config=require(_0xf7c7('0x16'));var licenseUtil=require(_0xf7c7('0x17'));var db=require(_0xf7c7('0x18'))['db'];function respondWithStatusCode(_0x3a5853,_0x23c734){_0x23c734=_0x23c734||0xcc;return function(_0x24204f){if(_0x24204f){return _0x3a5853['sendStatus'](_0x23c734);}return _0x3a5853[_0xf7c7('0x19')](_0x23c734)['end']();};}function respondWithResult(_0x2378dc,_0xac3b79){_0xac3b79=_0xac3b79||0xc8;return function(_0x4773dc){if(_0x4773dc){return _0x2378dc[_0xf7c7('0x19')](_0xac3b79)[_0xf7c7('0x1a')](_0x4773dc);}};}function respondWithFilteredResult(_0x2029c8,_0x350c70){return function(_0x3e52c5){if(_0x3e52c5){var _0x17b460=typeof _0x350c70[_0xf7c7('0x1b')]==='undefined'&&typeof _0x350c70['limit']==='undefined';var _0x4943fc=_0x3e52c5[_0xf7c7('0x1c')];var _0x27455b=_0x17b460?0x0:_0x350c70['offset'];var _0x5c9a2c=_0x17b460?_0x3e52c5[_0xf7c7('0x1c')]:_0x350c70[_0xf7c7('0x1b')]+_0x350c70[_0xf7c7('0x1d')];var _0x3dff0c;if(_0x5c9a2c>=_0x4943fc){_0x5c9a2c=_0x4943fc;_0x3dff0c=0xc8;}else{_0x3dff0c=0xce;}_0x2029c8['status'](_0x3dff0c);return _0x2029c8[_0xf7c7('0x1e')](_0xf7c7('0x1f'),_0x27455b+'-'+_0x5c9a2c+'/'+_0x4943fc)['json'](_0x3e52c5);}return null;};}function patchUpdates(_0x34a1a1){return function(_0x205524){try{jsonpatch[_0xf7c7('0x20')](_0x205524,_0x34a1a1,!![]);}catch(_0x5da14e){return BPromise['reject'](_0x5da14e);}return _0x205524[_0xf7c7('0x21')]();};}function saveUpdates(_0x33c053,_0xccacc){return function(_0x4333c0){if(_0x4333c0){return _0x4333c0[_0xf7c7('0x22')](_0x33c053)[_0xf7c7('0x23')](function(_0x47087b){return _0x47087b;});}return null;};}function removeEntity(_0xea5de5,_0x3ce9ee){return function(_0x41846d){if(_0x41846d){return _0x41846d['destroy']()[_0xf7c7('0x23')](function(){_0xea5de5[_0xf7c7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3daa38,_0x4959e3){return function(_0x14d5bd){if(!_0x14d5bd){_0x3daa38[_0xf7c7('0x24')](0x194);}return _0x14d5bd;};}function handleError(_0x46b194,_0x1b55b2){_0x1b55b2=_0x1b55b2||0x1f4;return function(_0x66ddad){logger[_0xf7c7('0x25')](_0x66ddad[_0xf7c7('0x26')]);if(_0x66ddad[_0xf7c7('0x27')]){delete _0x66ddad[_0xf7c7('0x27')];}_0x46b194['status'](_0x1b55b2)[_0xf7c7('0x28')](_0x66ddad);};}exports[_0xf7c7('0x29')]=function(_0x3f3d93,_0x45c6be){var _0x36e426={},_0x46ba39={},_0x345c0b={'count':0x0,'rows':[]};var _0x21f3a9=_[_0xf7c7('0x2a')](db[_0xf7c7('0x2b')][_0xf7c7('0x2c')],function(_0x214f48){return{'name':_0x214f48[_0xf7c7('0x2d')],'type':_0x214f48[_0xf7c7('0x2e')][_0xf7c7('0x2f')]};});_0x46ba39[_0xf7c7('0x30')]=_['map'](_0x21f3a9,'name');_0x46ba39['query']=_[_0xf7c7('0x31')](_0x3f3d93['query']);_0x46ba39['filters']=_[_0xf7c7('0x32')](_0x46ba39['model'],_0x46ba39[_0xf7c7('0x33')]);_0x36e426[_0xf7c7('0x34')]=_[_0xf7c7('0x32')](_0x46ba39[_0xf7c7('0x30')],qs['fields'](_0x3f3d93[_0xf7c7('0x33')][_0xf7c7('0x35')]));_0x36e426['attributes']=_0x36e426['attributes'][_0xf7c7('0x36')]?_0x36e426[_0xf7c7('0x34')]:_0x46ba39[_0xf7c7('0x30')];if(!_0x3f3d93[_0xf7c7('0x33')][_0xf7c7('0x37')](_0xf7c7('0x38'))){_0x36e426[_0xf7c7('0x1d')]=qs[_0xf7c7('0x1d')](_0x3f3d93[_0xf7c7('0x33')][_0xf7c7('0x1d')]);_0x36e426['offset']=qs[_0xf7c7('0x1b')](_0x3f3d93[_0xf7c7('0x33')][_0xf7c7('0x1b')]);}_0x36e426[_0xf7c7('0x39')]=qs[_0xf7c7('0x3a')](_0x3f3d93[_0xf7c7('0x33')][_0xf7c7('0x3a')]);_0x36e426[_0xf7c7('0x3b')]=qs[_0xf7c7('0x3c')](_[_0xf7c7('0x3d')](_0x3f3d93[_0xf7c7('0x33')],_0x46ba39['filters']),_0x21f3a9);if(_0x3f3d93[_0xf7c7('0x33')]['filter']){_0x36e426[_0xf7c7('0x3b')]=_['merge'](_0x36e426['where'],{'$or':_[_0xf7c7('0x2a')](_0x21f3a9,function(_0x3c3681){if(_0x3c3681[_0xf7c7('0x2e')]!=='VIRTUAL'){var _0xe62574={};_0xe62574[_0x3c3681[_0xf7c7('0x27')]]={'$like':'%'+_0x3f3d93[_0xf7c7('0x33')][_0xf7c7('0x3e')]+'%'};return _0xe62574;}})});}_0x36e426=_[_0xf7c7('0x3f')]({},_0x36e426,_0x3f3d93[_0xf7c7('0x40')]);var _0x41ebf1={'where':_0x36e426['where']};return db[_0xf7c7('0x2b')][_0xf7c7('0x1c')](_0x41ebf1)[_0xf7c7('0x23')](function(_0x1e1b04){_0x345c0b[_0xf7c7('0x1c')]=_0x1e1b04;if(_0x3f3d93[_0xf7c7('0x33')]['includeAll']){_0x36e426['include']=[{'all':!![]}];}return db[_0xf7c7('0x2b')]['findAll'](_0x36e426);})[_0xf7c7('0x23')](function(_0x596d4b){_0x345c0b[_0xf7c7('0x41')]=_0x596d4b;return _0x345c0b;})[_0xf7c7('0x23')](respondWithFilteredResult(_0x45c6be,_0x36e426))[_0xf7c7('0x42')](handleError(_0x45c6be,null));};exports[_0xf7c7('0x43')]=function(_0xfd21a3,_0x5e33ed){var _0x66b7c2={'raw':!![],'where':{'id':_0xfd21a3[_0xf7c7('0x44')]['id']}},_0x7b5262={};_0x7b5262[_0xf7c7('0x30')]=_[_0xf7c7('0x31')](db['VoiceQueuesLog'][_0xf7c7('0x2c')]);_0x7b5262[_0xf7c7('0x33')]=_[_0xf7c7('0x31')](_0xfd21a3[_0xf7c7('0x33')]);_0x7b5262['filters']=_[_0xf7c7('0x32')](_0x7b5262[_0xf7c7('0x30')],_0x7b5262[_0xf7c7('0x33')]);_0x66b7c2['attributes']=_[_0xf7c7('0x32')](_0x7b5262[_0xf7c7('0x30')],qs[_0xf7c7('0x35')](_0xfd21a3[_0xf7c7('0x33')][_0xf7c7('0x35')]));_0x66b7c2['attributes']=_0x66b7c2[_0xf7c7('0x34')][_0xf7c7('0x36')]?_0x66b7c2[_0xf7c7('0x34')]:_0x7b5262[_0xf7c7('0x30')];if(_0xfd21a3[_0xf7c7('0x33')][_0xf7c7('0x45')]){_0x66b7c2[_0xf7c7('0x46')]=[{'all':!![]}];}_0x66b7c2=_[_0xf7c7('0x3f')]({},_0x66b7c2,_0xfd21a3[_0xf7c7('0x40')]);return db[_0xf7c7('0x2b')][_0xf7c7('0x47')](_0x66b7c2)[_0xf7c7('0x23')](handleEntityNotFound(_0x5e33ed,null))[_0xf7c7('0x23')](respondWithResult(_0x5e33ed,null))[_0xf7c7('0x42')](handleError(_0x5e33ed,null));};exports[_0xf7c7('0x48')]=function(_0x3b8ec7,_0x4db1fe){return db[_0xf7c7('0x2b')][_0xf7c7('0x48')](_0x3b8ec7[_0xf7c7('0x49')],{})[_0xf7c7('0x23')](respondWithResult(_0x4db1fe,0xc9))[_0xf7c7('0x42')](handleError(_0x4db1fe,null));};exports[_0xf7c7('0x22')]=function(_0x22b81f,_0x30a38a){if(_0x22b81f[_0xf7c7('0x49')]['id']){delete _0x22b81f[_0xf7c7('0x49')]['id'];}return db[_0xf7c7('0x2b')]['find']({'where':{'id':_0x22b81f['params']['id']}})[_0xf7c7('0x23')](handleEntityNotFound(_0x30a38a,null))[_0xf7c7('0x23')](saveUpdates(_0x22b81f['body'],null))[_0xf7c7('0x23')](respondWithResult(_0x30a38a,null))[_0xf7c7('0x42')](handleError(_0x30a38a,null));};exports[_0xf7c7('0x4a')]=function(_0x2ea3d2,_0x14cc8b){return db[_0xf7c7('0x2b')][_0xf7c7('0x47')]({'where':{'id':_0x2ea3d2[_0xf7c7('0x44')]['id']}})[_0xf7c7('0x23')](handleEntityNotFound(_0x14cc8b,null))['then'](removeEntity(_0x14cc8b,null))[_0xf7c7('0x42')](handleError(_0x14cc8b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 1ab9e9e..ab0ea29 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 _0xe7e4=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event','dtm','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3c5aee,_0x419da5){var _0x47c4b4=function(_0x4e9e2e){while(--_0x4e9e2e){_0x3c5aee['push'](_0x3c5aee['shift']());}};_0x47c4b4(++_0x419da5);}(_0xe7e4,0xa3));var _0x4e7e=function(_0x13bbe6,_0x128ce5){_0x13bbe6=_0x13bbe6-0x0;var _0xc0a81d=_0xe7e4[_0x13bbe6];return _0xc0a81d;};'use strict';var _=require('lodash');var util=require(_0x4e7e('0x0'));var logger=require(_0x4e7e('0x1'))('api');var moment=require(_0x4e7e('0x2'));var BPromise=require(_0x4e7e('0x3'));var rp=require(_0x4e7e('0x4'));var fs=require('fs');var path=require(_0x4e7e('0x5'));var rimraf=require(_0x4e7e('0x6'));var config=require(_0x4e7e('0x7'));var attributes=require(_0x4e7e('0x8'));module[_0x4e7e('0x9')]=function(_0x4f038a,_0x38a076){return _0x4f038a['define'](_0x4e7e('0xa'),attributes,{'tableName':_0x4e7e('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x4e7e('0xc'),_0x4e7e('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7800=['define','VoiceQueuesLog','event','dtm','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0xb3504,_0x4b5442){var _0x1e6cc9=function(_0x353693){while(--_0x353693){_0xb3504['push'](_0xb3504['shift']());}};_0x1e6cc9(++_0x4b5442);}(_0x7800,0x1ee));var _0x0780=function(_0x98c584,_0x1e56d2){_0x98c584=_0x98c584-0x0;var _0x3cdd5b=_0x7800[_0x98c584];return _0x3cdd5b;};'use strict';var _=require(_0x0780('0x0'));var util=require(_0x0780('0x1'));var logger=require(_0x0780('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0780('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0780('0x4'));var config=require(_0x0780('0x5'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x4eecb3,_0x1c0432){return _0x4eecb3[_0x0780('0x6')](_0x0780('0x7'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x0780('0x8'),_0x0780('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index d2809c2..dd3ed37 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 _0x44f8=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','catch','lodash'];(function(_0x1320fe,_0x5dae3a){var _0xe9340a=function(_0x465a8d){while(--_0x465a8d){_0x1320fe['push'](_0x1320fe['shift']());}};_0xe9340a(++_0x5dae3a);}(_0x44f8,0xfb));var _0x844f=function(_0x22e2c7,_0x202cac){_0x22e2c7=_0x22e2c7-0x0;var _0x350b99=_0x44f8[_0x22e2c7];return _0x350b99;};'use strict';var _=require(_0x844f('0x0'));var util=require(_0x844f('0x1'));var moment=require(_0x844f('0x2'));var BPromise=require('bluebird');var rs=require(_0x844f('0x3'));var fs=require('fs');var Redis=require(_0x844f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x844f('0x5'))(_0x844f('0x6'));var config=require(_0x844f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x844f('0x8')][_0x844f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc3be,_0x3e5ece,_0x3bc2d4){return new BPromise(function(_0xca8bd6,_0x36ff38){return client[_0x844f('0xa')](_0x2fc3be,_0x3bc2d4)['then'](function(_0xe1201d){logger[_0x844f('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3e5ece,_0x844f('0xc'));logger[_0x844f('0xd')](_0x844f('0xe'),_0x3e5ece,_0x844f('0xc'),JSON[_0x844f('0xf')](_0xe1201d));if(_0xe1201d[_0x844f('0x10')]){if(_0xe1201d[_0x844f('0x10')][_0x844f('0x11')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x3e5ece,_0xe1201d[_0x844f('0x10')]['message']);return _0x36ff38(_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);}logger[_0x844f('0x10')](_0x844f('0x13'),_0x3e5ece,_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);return _0xca8bd6(_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);}else{logger[_0x844f('0xb')](_0x844f('0x13'),_0x3e5ece,'request\x20sent');_0xca8bd6(_0xe1201d['result'][_0x844f('0x12')]);}})[_0x844f('0x14')](function(_0x41f991){logger[_0x844f('0x10')](_0x844f('0x13'),_0x3e5ece,_0x41f991);_0x36ff38(_0x41f991);});});} \ No newline at end of file +var _0x663a=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','jayson/promise','http'];(function(_0x3ef0f1,_0x29953f){var _0x1ead35=function(_0x14bbd6){while(--_0x14bbd6){_0x3ef0f1['push'](_0x3ef0f1['shift']());}};_0x1ead35(++_0x29953f);}(_0x663a,0x119));var _0xa663=function(_0x285a67,_0x5c70a0){_0x285a67=_0x285a67-0x0;var _0x4e9c0c=_0x663a[_0x285a67];return _0x4e9c0c;};'use strict';var _=require(_0xa663('0x0'));var util=require(_0xa663('0x1'));var moment=require(_0xa663('0x2'));var BPromise=require(_0xa663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa663('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa663('0x5'));var client=jayson['client'][_0xa663('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4c3abd,_0x583cbf,_0x11730c){return new BPromise(function(_0x527c06,_0xeb2d61){return client[_0xa663('0x7')](_0x4c3abd,_0x11730c)[_0xa663('0x8')](function(_0x4535ff){logger[_0xa663('0x9')](_0xa663('0xa'),_0x583cbf,'request\x20sent');logger[_0xa663('0xb')](_0xa663('0xc'),_0x583cbf,'request\x20sent',JSON[_0xa663('0xd')](_0x4535ff));if(_0x4535ff[_0xa663('0xe')]){if(_0x4535ff[_0xa663('0xe')]['code']===0x1f4){logger[_0xa663('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x583cbf,_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);return _0xeb2d61(_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);}logger[_0xa663('0xe')](_0xa663('0xa'),_0x583cbf,_0x4535ff['error'][_0xa663('0xf')]);return _0x527c06(_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);}else{logger[_0xa663('0x9')](_0xa663('0xa'),_0x583cbf,'request\x20sent');_0x527c06(_0x4535ff[_0xa663('0x10')][_0xa663('0xf')]);}})[_0xa663('0x11')](function(_0x25d390){logger['error'](_0xa663('0xa'),_0x583cbf,_0x25d390);_0xeb2d61(_0x25d390);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 96bcba3..f9e31c1 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 _0x690c=['download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','update','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/download'];(function(_0x3845c6,_0x199090){var _0x2ace58=function(_0x42b108){while(--_0x42b108){_0x3845c6['push'](_0x3845c6['shift']());}};_0x2ace58(++_0x199090);}(_0x690c,0xba));var _0xc690=function(_0x3b9607,_0x1806da){_0x3b9607=_0x3b9607-0x0;var _0x3d530f=_0x690c[_0x3b9607];return _0x3d530f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc690('0x0'));var express=require('express');var router=express[_0xc690('0x1')]();var fs_extra=require(_0xc690('0x2'));var auth=require(_0xc690('0x3'));var interaction=require(_0xc690('0x4'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xc690('0x5')]('/',auth[_0xc690('0x6')](),controller[_0xc690('0x7')]);router[_0xc690('0x5')]('/describe',auth[_0xc690('0x6')](),controller[_0xc690('0x8')]);router[_0xc690('0x5')](_0xc690('0x9'),auth['isAuthenticated'](),controller[_0xc690('0xa')]);router[_0xc690('0x5')](_0xc690('0xb'),auth[_0xc690('0x6')](),controller[_0xc690('0xc')]);router[_0xc690('0x5')](_0xc690('0xd'),controller['downloads']);router[_0xc690('0x5')](_0xc690('0xe'),auth[_0xc690('0x6')](),controller[_0xc690('0xf')]);router['post']('/',auth[_0xc690('0x6')](),controller[_0xc690('0x10')]);router[_0xc690('0x11')](_0xc690('0xe'),auth[_0xc690('0x6')](),controller[_0xc690('0x12')]);router['put'](_0xc690('0x9'),auth[_0xc690('0x6')](),controller[_0xc690('0x13')]);router[_0xc690('0x14')](_0xc690('0x9'),auth['isAuthenticated'](),controller[_0xc690('0x15')]);module['exports']=router; \ No newline at end of file +var _0x15e9=['download','/:id/downloads','downloads','post','/:id/transcribe','/:id','update','delete','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','describe','isAuthenticated','show','/:id/download'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x15e9,0x95));var _0x915e=function(_0x4d20dc,_0x2bc8e0){_0x4d20dc=_0x4d20dc-0x0;var _0x379343=_0x15e9[_0x4d20dc];return _0x379343;};'use strict';var multer=require('multer');var util=require(_0x915e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x915e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x915e('0x2'));var interaction=require(_0x915e('0x3'));var config=require(_0x915e('0x4'));var controller=require(_0x915e('0x5'));router[_0x915e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x915e('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x915e('0x7')]);router[_0x915e('0x6')]('/:id',auth[_0x915e('0x8')](),controller[_0x915e('0x9')]);router[_0x915e('0x6')](_0x915e('0xa'),auth[_0x915e('0x8')](),controller[_0x915e('0xb')]);router[_0x915e('0x6')](_0x915e('0xc'),controller[_0x915e('0xd')]);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0x915e('0xe')]('/',auth[_0x915e('0x8')](),controller['create']);router[_0x915e('0xe')](_0x915e('0xf'),auth[_0x915e('0x8')](),controller['runTranscribe']);router['put'](_0x915e('0x10'),auth[_0x915e('0x8')](),controller[_0x915e('0x11')]);router[_0x915e('0x12')]('/:id',auth[_0x915e('0x8')](),controller['destroy']);module[_0x915e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index e17c826..c9aab00 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(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 0d4d0c6..a7e7078 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 _0xab38=['end','listBuckets','createBucket','startTranscriptionJob','basename','readFileSync','Location','bucket','Bucket','location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','VoiceRecording','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','decryptFile','recording','ValidationError','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab38,0x14b));var _0x8ab3=function(_0x1dbf16,_0x9f799d){_0x1dbf16=_0x1dbf16-0x0;var _0x34307d=_0xab38[_0x1dbf16];return _0x34307d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ab3('0x0'));var zipdir=require(_0x8ab3('0x1'));var jsonpatch=require(_0x8ab3('0x2'));var rp=require(_0x8ab3('0x3'));var moment=require(_0x8ab3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8ab3('0x5'));var path=require(_0x8ab3('0x6'));var sox=require(_0x8ab3('0x7'));var csv=require(_0x8ab3('0x8'));var ejs=require(_0x8ab3('0x9'));var fs=require('fs');var fs_extra=require(_0x8ab3('0xa'));var _=require('lodash');var squel=require(_0x8ab3('0xb'));var crypto=require('crypto');var jsforce=require(_0x8ab3('0xc'));var deskjs=require(_0x8ab3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8ab3('0xe'));var Papa=require(_0x8ab3('0xf'));var AWS=require(_0x8ab3('0x10'));var uuidv4=require(_0x8ab3('0x11'));var Redis=require(_0x8ab3('0x12'));var authService=require(_0x8ab3('0x13'));var qs=require(_0x8ab3('0x14'));var as=require(_0x8ab3('0x15'));var hardwareService=require(_0x8ab3('0x16'));var logger=require('../../config/logger')(_0x8ab3('0x17'));var utils=require(_0x8ab3('0x18'));var config=require(_0x8ab3('0x19'));var licenseUtil=require(_0x8ab3('0x1a'));var db=require(_0x8ab3('0x1b'))['db'];function respondWithStatusCode(_0x380003,_0x453741){_0x453741=_0x453741||0xcc;return function(_0x4746fa){if(_0x4746fa){return _0x380003['sendStatus'](_0x453741);}return _0x380003['status'](_0x453741)['end']();};}function respondWithResult(_0x2daf3b,_0x129fc2){_0x129fc2=_0x129fc2||0xc8;return function(_0x40f209){if(_0x40f209){return _0x2daf3b[_0x8ab3('0x1c')](_0x129fc2)[_0x8ab3('0x1d')](_0x40f209);}};}function respondWithFilteredResult(_0x51f9c6,_0x5ecfbb){return function(_0x5cb651){if(_0x5cb651){var _0x9949f1=typeof _0x5ecfbb[_0x8ab3('0x1e')]===_0x8ab3('0x1f')&&typeof _0x5ecfbb['limit']===_0x8ab3('0x1f');var _0x491f5a=_0x5cb651[_0x8ab3('0x20')];var _0x376a98=_0x9949f1?0x0:_0x5ecfbb['offset'];var _0x33cfce=_0x9949f1?_0x5cb651[_0x8ab3('0x20')]:_0x5ecfbb['offset']+_0x5ecfbb[_0x8ab3('0x21')];var _0x1053a4;if(_0x33cfce>=_0x491f5a){_0x33cfce=_0x491f5a;_0x1053a4=0xc8;}else{_0x1053a4=0xce;}_0x51f9c6[_0x8ab3('0x1c')](_0x1053a4);return _0x51f9c6[_0x8ab3('0x22')](_0x8ab3('0x23'),_0x376a98+'-'+_0x33cfce+'/'+_0x491f5a)[_0x8ab3('0x1d')](_0x5cb651);}return null;};}function patchUpdates(_0x23e372){return function(_0x20112a){try{jsonpatch[_0x8ab3('0x24')](_0x20112a,_0x23e372,!![]);}catch(_0x397834){return BPromise[_0x8ab3('0x25')](_0x397834);}return _0x20112a['save']();};}function saveUpdates(_0x2ad37e,_0x1eb2f8){return function(_0x18798c){if(_0x18798c){return _0x18798c[_0x8ab3('0x26')](_0x2ad37e)['then'](function(_0xeb576d){return _0xeb576d;});}return null;};}function removeEntity(_0x18c210,_0x1792d4){return function(_0x15ce5e){if(_0x15ce5e){return _0x15ce5e[_0x8ab3('0x27')]()[_0x8ab3('0x28')](function(){_0x18c210[_0x8ab3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281431,_0x3fb995){return function(_0x1e80b3){if(!_0x1e80b3){_0x281431['sendStatus'](0x194);}return _0x1e80b3;};}function handleError(_0xaefadb,_0x2b1950){_0x2b1950=_0x2b1950||0x1f4;return function(_0x2dd21a){logger['error'](_0x2dd21a[_0x8ab3('0x29')]);if(_0x2dd21a[_0x8ab3('0x2a')]){delete _0x2dd21a['name'];}_0xaefadb[_0x8ab3('0x1c')](_0x2b1950)[_0x8ab3('0x2b')](_0x2dd21a);};}exports[_0x8ab3('0x2c')]=function(_0x4d3fbf,_0x55e143){var _0x2598d0={},_0x2754b6={},_0x1f68e8={'count':0x0,'rows':[]};var _0x44ab2f=_[_0x8ab3('0x2d')](db['VoiceRecording'][_0x8ab3('0x2e')],function(_0x55aa6c){return{'name':_0x55aa6c[_0x8ab3('0x2f')],'type':_0x55aa6c['type'][_0x8ab3('0x30')]};});_0x2754b6[_0x8ab3('0x31')]=_[_0x8ab3('0x32')](_['map'](_0x44ab2f,_0x8ab3('0x2a')),[_0x8ab3('0x33')]);_0x2754b6[_0x8ab3('0x34')]=_[_0x8ab3('0x35')](_0x4d3fbf[_0x8ab3('0x34')]);_0x2754b6[_0x8ab3('0x36')]=_[_0x8ab3('0x37')](_0x2754b6[_0x8ab3('0x31')],_0x2754b6[_0x8ab3('0x34')]);_0x2598d0[_0x8ab3('0x38')]=_[_0x8ab3('0x37')](_0x2754b6[_0x8ab3('0x31')],qs[_0x8ab3('0x39')](_0x4d3fbf[_0x8ab3('0x34')][_0x8ab3('0x39')]));_0x2598d0[_0x8ab3('0x38')]=_0x2598d0[_0x8ab3('0x38')][_0x8ab3('0x3a')]?_0x2598d0['attributes']:_0x2754b6['model'];if(!_0x4d3fbf[_0x8ab3('0x34')]['hasOwnProperty']('nolimit')){_0x2598d0[_0x8ab3('0x21')]=qs[_0x8ab3('0x21')](_0x4d3fbf['query'][_0x8ab3('0x21')]);_0x2598d0[_0x8ab3('0x1e')]=qs['offset'](_0x4d3fbf['query']['offset']);}_0x2598d0[_0x8ab3('0x3b')]=qs[_0x8ab3('0x3c')](_0x4d3fbf[_0x8ab3('0x34')]['sort']);_0x2598d0['where']=qs[_0x8ab3('0x36')](_[_0x8ab3('0x3d')](_0x4d3fbf[_0x8ab3('0x34')],_0x2754b6[_0x8ab3('0x36')]),_0x44ab2f);if(_0x4d3fbf[_0x8ab3('0x34')][_0x8ab3('0x3e')]){_0x2598d0[_0x8ab3('0x3f')]=_[_0x8ab3('0x40')](_0x2598d0[_0x8ab3('0x3f')],{'$or':_[_0x8ab3('0x2d')](_0x44ab2f,function(_0x202351){if(_0x202351[_0x8ab3('0x41')]!==_0x8ab3('0x42')){var _0x785ed4={};_0x785ed4[_0x202351['name']]={'$like':'%'+_0x4d3fbf[_0x8ab3('0x34')]['filter']+'%'};return _0x785ed4;}})});}_0x2598d0=_['merge']({},_0x2598d0,_0x4d3fbf['options']);var _0x7ad008={'where':_0x2598d0[_0x8ab3('0x3f')]};return db['VoiceRecording']['count'](_0x7ad008)[_0x8ab3('0x28')](function(_0x2ca9fa){_0x1f68e8[_0x8ab3('0x20')]=_0x2ca9fa;if(_0x4d3fbf['query'][_0x8ab3('0x43')]){_0x2598d0[_0x8ab3('0x44')]=[{'all':!![]}];}return db[_0x8ab3('0x45')]['findAll'](_0x2598d0);})['then'](function(_0x1ff671){_0x1f68e8['rows']=_0x1ff671;return _0x1f68e8;})[_0x8ab3('0x28')](respondWithFilteredResult(_0x55e143,_0x2598d0))[_0x8ab3('0x46')](handleError(_0x55e143,null));};exports[_0x8ab3('0x47')]=function(_0x11eac7,_0x57a451){var _0x4874c0={'raw':![],'where':{'id':_0x11eac7[_0x8ab3('0x48')]['id']}},_0x399fdc={};_0x399fdc[_0x8ab3('0x31')]=_[_0x8ab3('0x35')](db['VoiceRecording'][_0x8ab3('0x2e')]);_0x399fdc[_0x8ab3('0x34')]=_['keys'](_0x11eac7[_0x8ab3('0x34')]);_0x399fdc[_0x8ab3('0x36')]=_['intersection'](_0x399fdc['model'],_0x399fdc['query']);_0x4874c0[_0x8ab3('0x38')]=_[_0x8ab3('0x37')](_0x399fdc[_0x8ab3('0x31')],qs[_0x8ab3('0x39')](_0x11eac7[_0x8ab3('0x34')][_0x8ab3('0x39')]));_0x4874c0['attributes']=_0x4874c0['attributes'][_0x8ab3('0x3a')]?_0x4874c0[_0x8ab3('0x38')]:_0x399fdc[_0x8ab3('0x31')];if(_0x11eac7[_0x8ab3('0x34')][_0x8ab3('0x43')]){_0x4874c0[_0x8ab3('0x44')]=[{'all':!![]}];}_0x4874c0=_[_0x8ab3('0x40')]({},_0x4874c0,_0x11eac7['options']);return db[_0x8ab3('0x45')][_0x8ab3('0x49')](_0x4874c0)['then'](handleEntityNotFound(_0x57a451,null))[_0x8ab3('0x28')](respondWithResult(_0x57a451,null))[_0x8ab3('0x46')](handleError(_0x57a451,null));};exports[_0x8ab3('0x4a')]=function(_0x132ead,_0x327d74){return db[_0x8ab3('0x45')][_0x8ab3('0x4a')](_0x132ead[_0x8ab3('0x4b')],{})[_0x8ab3('0x28')](respondWithResult(_0x327d74,0xc9))[_0x8ab3('0x46')](handleError(_0x327d74,null));};exports[_0x8ab3('0x26')]=function(_0x176e29,_0x4a7e86){if(_0x176e29[_0x8ab3('0x4b')]['id']){delete _0x176e29[_0x8ab3('0x4b')]['id'];}return db[_0x8ab3('0x45')][_0x8ab3('0x49')]({'where':{'id':_0x176e29[_0x8ab3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a7e86,null))[_0x8ab3('0x28')](saveUpdates(_0x176e29[_0x8ab3('0x4b')],null))['then'](respondWithResult(_0x4a7e86,null))['catch'](handleError(_0x4a7e86,null));};exports[_0x8ab3('0x4c')]=function(_0x334e3b,_0x56d6fd){return db['VoiceRecording']['describe']()[_0x8ab3('0x28')](respondWithResult(_0x56d6fd,null))[_0x8ab3('0x46')](handleError(_0x56d6fd,null));};exports[_0x8ab3('0x4d')]=function(_0x57b3c1,_0x11642c,_0x4dcdd2){var _0x53c0f6=require(_0x8ab3('0x4e'));var _0x27d936=![];var _0x5c0acb={};if(_0x57b3c1[_0x8ab3('0x34')][_0x8ab3('0x41')]&&_0x57b3c1['query'][_0x8ab3('0x41')]===_0x8ab3('0x4f')){_0x5c0acb[_0x8ab3('0x4f')]=_0x57b3c1[_0x8ab3('0x48')]['id'];}else{_0x5c0acb['id']=_0x57b3c1['params']['id'];}return db[_0x8ab3('0x45')]['find']({'where':_0x5c0acb,'attributes':['id','value'],'raw':!![]})[_0x8ab3('0x28')](handleEntityNotFound(_0x11642c,null))[_0x8ab3('0x28')](function(_0x86bf7f){if(_0x86bf7f){var _0x1debea=_0x86bf7f[_0x8ab3('0x50')];var _0x130e26=util['format'](_0x8ab3('0x51'),_0x1debea);if(fs[_0x8ab3('0x52')](_0x130e26)){_0x27d936=!![];return _0x53c0f6['decryptFile'](_0x130e26,_0x1debea,config[_0x8ab3('0x53')]['recording'])['then'](function(){return _0x86bf7f;});}return _0x86bf7f;}})[_0x8ab3('0x28')](function(_0x5c4fc2){if(_0x5c4fc2){var _0x2e4d33=_0x5c4fc2[_0x8ab3('0x50')];if(!fs[_0x8ab3('0x52')](_0x2e4d33)){throw new db[(_0x8ab3('0x54'))]['ValidationError'](_0x8ab3('0x55'));}if(_0x5c4fc2[_0x8ab3('0x56')]){return _0x11642c[_0x8ab3('0x4d')](_0x2e4d33,_0x5c4fc2[_0x8ab3('0x56')]+path['extname'](_0x2e4d33),function(){if(_0x27d936){fs['unlink'](_0x2e4d33);}});}else{return _0x11642c[_0x8ab3('0x4d')](_0x2e4d33,function(_0x391b41){if(_0x27d936){fs[_0x8ab3('0x57')](_0x2e4d33);}});}}})[_0x8ab3('0x46')](function(_0x201eab){if(_0x201eab[_0x8ab3('0x58')]==='VoiceRecording\x20not\x20found'){_0x11642c['status'](0x194)[_0x8ab3('0x2b')](_0x8ab3('0x59'));}else{return handleError(_0x11642c,null);}});};exports[_0x8ab3('0x5a')]=function(_0x1cf8dc,_0x22e166,_0xf1939b){var _0x525f2c=require(_0x8ab3('0x4e'));var _0x100147=![];var _0x1871f6={'$and':[db[_0x8ab3('0x5b')]['where'](db[_0x8ab3('0x5b')]['fn'](_0x8ab3('0x5c'),db['sequelize']['col']('uniqueid')),_0x1cf8dc[_0x8ab3('0x34')][_0x8ab3('0x5d')])]};if(_0x1cf8dc[_0x8ab3('0x34')][_0x8ab3('0x41')]&&_0x1cf8dc['query'][_0x8ab3('0x41')]===_0x8ab3('0x4f')){_0x1871f6[_0x8ab3('0x5e')]['push']({'uniqueid':_0x1cf8dc[_0x8ab3('0x48')]['id']});}else{_0x1871f6[_0x8ab3('0x5e')][_0x8ab3('0x5f')]({'id':_0x1cf8dc['params']['id']});}return db[_0x8ab3('0x45')][_0x8ab3('0x49')]({'where':_0x1871f6,'attributes':['id','value'],'raw':!![]})[_0x8ab3('0x28')](handleEntityNotFound(_0x22e166,null))[_0x8ab3('0x28')](function(_0x4c4ba7){if(_0x4c4ba7){var _0x30fae3=util['format'](_0x8ab3('0x51'),_0x4c4ba7['value']);if(fs[_0x8ab3('0x52')](_0x30fae3)){_0x100147=!![];return _0x525f2c[_0x8ab3('0x60')](_0x30fae3,_0x4c4ba7[_0x8ab3('0x50')],config['secrets'][_0x8ab3('0x61')])[_0x8ab3('0x28')](function(){return _0x4c4ba7;});}return _0x4c4ba7;}})[_0x8ab3('0x28')](function(_0x254702){if(_0x254702){if(!fs[_0x8ab3('0x52')](_0x254702[_0x8ab3('0x50')])){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x55'));}if(_0x254702[_0x8ab3('0x56')]){return _0x22e166[_0x8ab3('0x4d')](_0x254702[_0x8ab3('0x50')],_0x254702[_0x8ab3('0x56')]+path[_0x8ab3('0x63')](_0x254702[_0x8ab3('0x50')]),function(){if(_0x100147){fs[_0x8ab3('0x57')](_0x254702[_0x8ab3('0x50')]);}});}else{return _0x22e166['download'](_0x254702[_0x8ab3('0x50')],function(_0x191d72){if(_0x100147){fs['unlink'](_0x254702[_0x8ab3('0x50')]);}});}}})[_0x8ab3('0x46')](handleError(_0x22e166,null));};exports[_0x8ab3('0x27')]=function(_0x384167,_0x154021){return db[_0x8ab3('0x45')][_0x8ab3('0x49')]({'where':{'id':_0x384167['params']['id']}})[_0x8ab3('0x28')](function(_0x18845f){if(_[_0x8ab3('0x64')](_0x18845f)){throw new ReferenceError(_0x8ab3('0x65'));}return _0x18845f;})['then'](function(_0x46cc25){var _0x4cb1d1=_0x46cc25['value'];logger[_0x8ab3('0x66')](_0x8ab3('0x67'),_0x4cb1d1);if(!_[_0x8ab3('0x64')](_0x46cc25[_0x8ab3('0x50')])&&fs[_0x8ab3('0x52')](_0x4cb1d1)){logger[_0x8ab3('0x66')](_0x8ab3('0x68')+_0x4cb1d1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8ab3('0x69')](_0x4cb1d1);}_0x4cb1d1=_0x4cb1d1+'.cypher';if(!_[_0x8ab3('0x64')](_0x46cc25[_0x8ab3('0x50')])&&fs[_0x8ab3('0x52')](_0x4cb1d1)){logger[_0x8ab3('0x66')](_0x8ab3('0x68')+_0x4cb1d1+_0x8ab3('0x6a'));fs[_0x8ab3('0x69')](_0x4cb1d1);}return _0x46cc25;})['then'](function(_0x42a124){if(!_0x42a124)throw new InternalError();return _0x42a124[_0x8ab3('0x27')]();})[_0x8ab3('0x28')](function(){_0x154021[_0x8ab3('0x1c')](0xcc)[_0x8ab3('0x6b')]();})['catch'](handleError(_0x154021,null));};function getBucketslist(_0x21fc95,_0x768f9,_0x59209d){return new Promise(function(_0x520000,_0x1b2e46){var _0x40c010=new AWS['S3']({'accessKeyId':_0x768f9,'secretAccessKey':_0x21fc95,'region':_0x59209d});_0x40c010[_0x8ab3('0x6c')]({},function(_0x218750,_0x25cf9c){if(_0x218750){return _0x1b2e46(_0x218750);}else{return _0x520000(_0x25cf9c);}});});}function createBucket(_0x31e5b8,_0x2d08a7,_0x444f6f,_0x23a51c){return new Promise(function(_0x3747ef,_0x3b8087){var _0x42aa4c=new AWS['S3']({'accessKeyId':_0x2d08a7,'secretAccessKey':_0x31e5b8,'region':_0x444f6f});_0x42aa4c[_0x8ab3('0x6d')]({'Bucket':_0x23a51c},function(_0x3a6142,_0x52595f){if(_0x3a6142){return _0x3b8087(_0x3a6142);}else{return _0x3747ef(_0x52595f);}});});}function uploadFile(_0x57e938,_0xc088c2,_0x380c55,_0x3a52d5,_0x1914f6,_0x518cca){return new Promise(function(_0x1fe448,_0x218da3){var _0x20cbf1=new AWS['S3']({'accessKeyId':_0xc088c2,'secretAccessKey':_0x57e938,'region':_0x380c55});_0x20cbf1['upload']({'Bucket':_0x3a52d5,'Key':_0x1914f6,'Body':_0x518cca},function(_0x239d23,_0x26f646){if(_0x239d23){return _0x218da3(_0x239d23);}else{return _0x1fe448(_0x26f646);}});});}function startTranscribe(_0x40b070,_0x27fba3,_0x48ef48,_0x490c4b,_0x5c74f8,_0x80560b){return new Promise(function(_0x1ebb48,_0x7eb99e){var _0x3474f0=new AWS['TranscribeService']({'accessKeyId':_0x27fba3,'secretAccessKey':_0x40b070,'region':_0x48ef48});_0x3474f0[_0x8ab3('0x6e')]({'TranscriptionJobName':_0x490c4b,'LanguageCode':_0x5c74f8,'Media':{'MediaFileUri':_0x80560b}},function(_0x215ccc,_0x181d64){if(_0x215ccc){return _0x7eb99e(_0x215ccc);}else{return _0x1ebb48(_0x181d64);}});});}function transcribe(_0x2772ed,_0x1946ba,_0x139707,_0x2cf603,_0x20aaac,_0x2fd38c,_0x4b41e2){return new Promise(function(_0x2cf36b,_0x59e844){var _0x1354a8={};logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x2772ed,_0x20aaac));return uploadFile(_0x1946ba,_0x139707,_0x2cf603,_0x20aaac,path[_0x8ab3('0x6f')](_0x2fd38c),fs[_0x8ab3('0x70')](_0x2fd38c))[_0x8ab3('0x28')](function(_0x18c832){logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x2772ed,_0x20aaac,_0x18c832[_0x8ab3('0x71')]));_0x1354a8[_0x8ab3('0x72')]=_0x18c832[_0x8ab3('0x73')];_0x1354a8[_0x8ab3('0x74')]=_0x18c832[_0x8ab3('0x71')];logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2772ed));return startTranscribe(_0x1946ba,_0x139707,_0x2cf603,uuidv4(),_0x4b41e2,_0x18c832['Location']);})[_0x8ab3('0x28')](function(_0x4a9a30){logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x2772ed,_0x4a9a30[_0x8ab3('0x75')][_0x8ab3('0x76')]));_0x1354a8[_0x8ab3('0x77')]=_0x4a9a30['TranscriptionJob'][_0x8ab3('0x76')];_0x1354a8[_0x8ab3('0x78')]=_0x4a9a30[_0x8ab3('0x75')][_0x8ab3('0x79')];return _0x2cf36b(_0x1354a8);})[_0x8ab3('0x46')](function(_0x4ad21b){return _0x59e844(_0x4ad21b);});});}exports['runTranscribe']=function(_0x3fd9e4,_0x4206ac,_0x20ed32){var _0x542cb9;var _0x2a6377;var _0x476401;var _0x35ed8a=require(_0x8ab3('0x4e'));return db[_0x8ab3('0x45')]['findOne']({'where':{'id':_0x3fd9e4[_0x8ab3('0x48')]['id']}})[_0x8ab3('0x28')](function(_0x2d23fc){if(_0x2d23fc){var _0xadfe64=util['format'](_0x8ab3('0x51'),_0x2d23fc[_0x8ab3('0x50')]);if(fs[_0x8ab3('0x52')](_0xadfe64)){cypher=!![];return _0x35ed8a[_0x8ab3('0x60')](_0xadfe64,_0x2d23fc[_0x8ab3('0x50')],config[_0x8ab3('0x53')][_0x8ab3('0x61')])['then'](function(){return _0x2d23fc;});}return _0x2d23fc;}})[_0x8ab3('0x28')](function(_0x5c0aed){if(!_0x5c0aed){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x7a'));}_0x2a6377=_0x5c0aed;return db['Setting'][_0x8ab3('0x7b')]({'where':{'id':0x1}});})[_0x8ab3('0x28')](handleEntityNotFound(_0x4206ac,null))[_0x8ab3('0x28')](function(_0x2aeb1e){if(_0x2aeb1e){_0x542cb9=_0x2aeb1e;if(!_0x542cb9[_0x8ab3('0x7c')]||!_0x542cb9[_0x8ab3('0x7d')]||!_0x542cb9[_0x8ab3('0x7e')]||!_0x542cb9[_0x8ab3('0x7f')]||!_0x542cb9['bucket']){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x80'));}if(_0x3fd9e4[_0x8ab3('0x4b')][_0x8ab3('0x81')]&&(!_0x542cb9[_0x8ab3('0x82')]||!_0x542cb9['sentimentAccountId']||!_0x542cb9['sentimentRegion']||!_0x542cb9[_0x8ab3('0x7f')]||!_0x542cb9['bucket'])){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x83'));}return db[_0x8ab3('0x84')][_0x8ab3('0x7b')]({'where':{'id':_0x542cb9['transcribeAccountId']}});}})[_0x8ab3('0x28')](function(_0x5e421f){if(!_0x5e421f){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5e421f['data1']||!_0x5e421f[_0x8ab3('0x85')]){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x86'));}_0x476401=_0x5e421f;return getBucketslist(_0x476401[_0x8ab3('0x87')],_0x476401[_0x8ab3('0x85')],_0x542cb9['transcribeRegion']);})[_0x8ab3('0x28')](function(_0x127554){if(_0x127554&&_0x127554[_0x8ab3('0x88')]){var _0x4edfa7=_[_0x8ab3('0x49')](_0x127554[_0x8ab3('0x88')],function(_0x18048d){return _0x18048d['Name']===_0x542cb9['bucket'];});if(!_0x4edfa7){logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')](_0x8ab3('0x89'),_0x3fd9e4[_0x8ab3('0x48')]['id'],_0x542cb9[_0x8ab3('0x72')]));return createBucket(_0x476401[_0x8ab3('0x87')],_0x476401[_0x8ab3('0x85')],_0x542cb9[_0x8ab3('0x7e')],_0x542cb9[_0x8ab3('0x72')]);}logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3fd9e4['params']['id'],_0x542cb9[_0x8ab3('0x72')]));return;}})[_0x8ab3('0x28')](function(_0x554839){if(_0x2a6377['transcribeStatus']===_0x8ab3('0x8a')){return transcribe(_0x3fd9e4['params']['id'],_0x476401['data1'],_0x476401['data2'],_0x542cb9[_0x8ab3('0x7e')],_0x542cb9[_0x8ab3('0x72')],_0x2a6377[_0x8ab3('0x50')],_0x542cb9[_0x8ab3('0x7f')]);}else{logger['info'](util[_0x8ab3('0x33')](_0x8ab3('0x8b'),_0x3fd9e4[_0x8ab3('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x8ab3('0x28')](function(_0x3915d7){if(_0x3915d7){_0x3915d7[_0x8ab3('0x8c')]=_0x3fd9e4[_0x8ab3('0x4b')][_0x8ab3('0x81')];return _0x2a6377['updateAttributes'](_0x3915d7);}})['then'](respondWithResult(_0x4206ac,null))[_0x8ab3('0x46')](handleError(_0x4206ac,null));};function writeFile(_0x458fdd,_0x18a8e1){return new Promise(function(_0x2c4f77,_0x221101){fs[_0x8ab3('0x8d')](_0x18a8e1,_0x458fdd,function(_0x3ab1fe,_0x51f630){if(_0x3ab1fe){return _0x221101(_0x3ab1fe);}else{return _0x2c4f77(_0x51f630);}});});}exports['downloadTranscribe']=function(_0x4b411c,_0x2278b6,_0x31ed27){return db[_0x8ab3('0x45')][_0x8ab3('0x7b')]({'where':{'id':_0x4b411c[_0x8ab3('0x48')]['id']}})[_0x8ab3('0x28')](handleEntityNotFound(_0x2278b6))['then'](function(_0x4366df){if(_0x4366df&&_0x4366df[_0x8ab3('0x8e')]){var _0x148dad=_0x4366df[_0x8ab3('0x8e')];var _0x4fedfb=config['root']+_0x8ab3('0x8f')+_0x4366df['id']+_0x8ab3('0x90');if(fs[_0x8ab3('0x52')](_0x4fedfb)){return _0x4fedfb;}return writeFile(_0x148dad,_0x4fedfb)['then'](function(){return _0x4fedfb;});}else{throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x91'));}})['then'](function(_0x30f6d3){return _0x2278b6[_0x8ab3('0x4d')](_0x30f6d3);})[_0x8ab3('0x46')](handleError(_0x2278b6));}; \ No newline at end of file +var _0xccb6=['include','findAll','rows','catch','show','params','VoiceRecording','length','merge','create','body','find','describe','download','../../components/encryptor','value','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','Not\x20found','sequelize','MD5','uniqueid','token','$and','push','secrets','VoiceRecording\x20not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','aws-sdk','uuid/v4','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','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','differenceBy','format','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll'];(function(_0x184f83,_0x2deea4){var _0x30d4d2=function(_0x38506c){while(--_0x38506c){_0x184f83['push'](_0x184f83['shift']());}};_0x30d4d2(++_0x2deea4);}(_0xccb6,0x197));var _0x6ccb=function(_0x420a02,_0x91fee){_0x420a02=_0x420a02-0x0;var _0x46ad48=_0xccb6[_0x420a02];return _0x46ad48;};'use strict';var emlformat=require(_0x6ccb('0x0'));var rimraf=require(_0x6ccb('0x1'));var zipdir=require(_0x6ccb('0x2'));var jsonpatch=require(_0x6ccb('0x3'));var rp=require(_0x6ccb('0x4'));var moment=require(_0x6ccb('0x5'));var BPromise=require(_0x6ccb('0x6'));var Mustache=require(_0x6ccb('0x7'));var util=require(_0x6ccb('0x8'));var path=require(_0x6ccb('0x9'));var sox=require(_0x6ccb('0xa'));var csv=require(_0x6ccb('0xb'));var ejs=require(_0x6ccb('0xc'));var fs=require('fs');var fs_extra=require(_0x6ccb('0xd'));var _=require(_0x6ccb('0xe'));var squel=require(_0x6ccb('0xf'));var crypto=require(_0x6ccb('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6ccb('0x11'));var Papa=require('papaparse');var AWS=require(_0x6ccb('0x12'));var uuidv4=require(_0x6ccb('0x13'));var Redis=require(_0x6ccb('0x14'));var authService=require(_0x6ccb('0x15'));var qs=require(_0x6ccb('0x16'));var as=require(_0x6ccb('0x17'));var hardwareService=require(_0x6ccb('0x18'));var logger=require(_0x6ccb('0x19'))(_0x6ccb('0x1a'));var utils=require(_0x6ccb('0x1b'));var config=require(_0x6ccb('0x1c'));var licenseUtil=require(_0x6ccb('0x1d'));var db=require(_0x6ccb('0x1e'))['db'];function respondWithStatusCode(_0x310b11,_0x59769b){_0x59769b=_0x59769b||0xcc;return function(_0x67d8c3){if(_0x67d8c3){return _0x310b11['sendStatus'](_0x59769b);}return _0x310b11[_0x6ccb('0x1f')](_0x59769b)[_0x6ccb('0x20')]();};}function respondWithResult(_0x12896b,_0x4283a6){_0x4283a6=_0x4283a6||0xc8;return function(_0x25a33c){if(_0x25a33c){return _0x12896b['status'](_0x4283a6)[_0x6ccb('0x21')](_0x25a33c);}};}function respondWithFilteredResult(_0x292922,_0x19b9ff){return function(_0x14f124){if(_0x14f124){var _0x2fc058=typeof _0x19b9ff[_0x6ccb('0x22')]===_0x6ccb('0x23')&&typeof _0x19b9ff['limit']==='undefined';var _0x29f410=_0x14f124[_0x6ccb('0x24')];var _0xd06c0a=_0x2fc058?0x0:_0x19b9ff[_0x6ccb('0x22')];var _0xa0f24a=_0x2fc058?_0x14f124[_0x6ccb('0x24')]:_0x19b9ff[_0x6ccb('0x22')]+_0x19b9ff[_0x6ccb('0x25')];var _0x4a8085;if(_0xa0f24a>=_0x29f410){_0xa0f24a=_0x29f410;_0x4a8085=0xc8;}else{_0x4a8085=0xce;}_0x292922[_0x6ccb('0x1f')](_0x4a8085);return _0x292922[_0x6ccb('0x26')](_0x6ccb('0x27'),_0xd06c0a+'-'+_0xa0f24a+'/'+_0x29f410)[_0x6ccb('0x21')](_0x14f124);}return null;};}function patchUpdates(_0x2cdf21){return function(_0x2af8fc){try{jsonpatch[_0x6ccb('0x28')](_0x2af8fc,_0x2cdf21,!![]);}catch(_0x241e14){return BPromise[_0x6ccb('0x29')](_0x241e14);}return _0x2af8fc[_0x6ccb('0x2a')]();};}function saveUpdates(_0x35074b,_0x4049e7){return function(_0x4b72af){if(_0x4b72af){return _0x4b72af[_0x6ccb('0x2b')](_0x35074b)[_0x6ccb('0x2c')](function(_0x3caa61){return _0x3caa61;});}return null;};}function removeEntity(_0x4a5a85,_0x4cc716){return function(_0xba7670){if(_0xba7670){return _0xba7670[_0x6ccb('0x2d')]()[_0x6ccb('0x2c')](function(){_0x4a5a85[_0x6ccb('0x1f')](0xcc)[_0x6ccb('0x20')]();});}};}function handleEntityNotFound(_0x249b56,_0xe5e1ac){return function(_0x586805){if(!_0x586805){_0x249b56[_0x6ccb('0x2e')](0x194);}return _0x586805;};}function handleError(_0x3c5de,_0x417ecd){_0x417ecd=_0x417ecd||0x1f4;return function(_0x41e252){logger[_0x6ccb('0x2f')](_0x41e252['stack']);if(_0x41e252['name']){delete _0x41e252[_0x6ccb('0x30')];}_0x3c5de[_0x6ccb('0x1f')](_0x417ecd)[_0x6ccb('0x31')](_0x41e252);};}exports['index']=function(_0x240821,_0x4202c2){var _0x32eb0e={},_0x2fa34c={},_0x124156={'count':0x0,'rows':[]};var _0x3b6e87=_[_0x6ccb('0x32')](db['VoiceRecording'][_0x6ccb('0x33')],function(_0xffb2ac){return{'name':_0xffb2ac[_0x6ccb('0x34')],'type':_0xffb2ac[_0x6ccb('0x35')]['key']};});_0x2fa34c['model']=_[_0x6ccb('0x36')](_['map'](_0x3b6e87,_0x6ccb('0x30')),[_0x6ccb('0x37')]);_0x2fa34c['query']=_[_0x6ccb('0x38')](_0x240821[_0x6ccb('0x39')]);_0x2fa34c['filters']=_[_0x6ccb('0x3a')](_0x2fa34c[_0x6ccb('0x3b')],_0x2fa34c[_0x6ccb('0x39')]);_0x32eb0e[_0x6ccb('0x3c')]=_[_0x6ccb('0x3a')](_0x2fa34c['model'],qs[_0x6ccb('0x3d')](_0x240821[_0x6ccb('0x39')][_0x6ccb('0x3d')]));_0x32eb0e[_0x6ccb('0x3c')]=_0x32eb0e['attributes']['length']?_0x32eb0e[_0x6ccb('0x3c')]:_0x2fa34c['model'];if(!_0x240821[_0x6ccb('0x39')][_0x6ccb('0x3e')](_0x6ccb('0x3f'))){_0x32eb0e[_0x6ccb('0x25')]=qs[_0x6ccb('0x25')](_0x240821[_0x6ccb('0x39')][_0x6ccb('0x25')]);_0x32eb0e[_0x6ccb('0x22')]=qs[_0x6ccb('0x22')](_0x240821[_0x6ccb('0x39')]['offset']);}_0x32eb0e[_0x6ccb('0x40')]=qs[_0x6ccb('0x41')](_0x240821[_0x6ccb('0x39')][_0x6ccb('0x41')]);_0x32eb0e[_0x6ccb('0x42')]=qs[_0x6ccb('0x43')](_[_0x6ccb('0x44')](_0x240821[_0x6ccb('0x39')],_0x2fa34c[_0x6ccb('0x43')]),_0x3b6e87);if(_0x240821[_0x6ccb('0x39')][_0x6ccb('0x45')]){_0x32eb0e[_0x6ccb('0x42')]=_['merge'](_0x32eb0e['where'],{'$or':_[_0x6ccb('0x32')](_0x3b6e87,function(_0x31fff3){if(_0x31fff3[_0x6ccb('0x35')]!==_0x6ccb('0x46')){var _0xbad68d={};_0xbad68d[_0x31fff3['name']]={'$like':'%'+_0x240821['query'][_0x6ccb('0x45')]+'%'};return _0xbad68d;}})});}_0x32eb0e=_['merge']({},_0x32eb0e,_0x240821[_0x6ccb('0x47')]);var _0x1b7943={'where':_0x32eb0e['where']};return db['VoiceRecording'][_0x6ccb('0x24')](_0x1b7943)['then'](function(_0x5c716e){_0x124156[_0x6ccb('0x24')]=_0x5c716e;if(_0x240821[_0x6ccb('0x39')][_0x6ccb('0x48')]){_0x32eb0e[_0x6ccb('0x49')]=[{'all':!![]}];}return db['VoiceRecording'][_0x6ccb('0x4a')](_0x32eb0e);})['then'](function(_0x39bf23){_0x124156[_0x6ccb('0x4b')]=_0x39bf23;return _0x124156;})['then'](respondWithFilteredResult(_0x4202c2,_0x32eb0e))[_0x6ccb('0x4c')](handleError(_0x4202c2,null));};exports[_0x6ccb('0x4d')]=function(_0x2ad6d4,_0x2d11bf){var _0x4ca8d8={'raw':![],'where':{'id':_0x2ad6d4[_0x6ccb('0x4e')]['id']}},_0x24545b={};_0x24545b[_0x6ccb('0x3b')]=_[_0x6ccb('0x38')](db[_0x6ccb('0x4f')][_0x6ccb('0x33')]);_0x24545b[_0x6ccb('0x39')]=_[_0x6ccb('0x38')](_0x2ad6d4[_0x6ccb('0x39')]);_0x24545b[_0x6ccb('0x43')]=_['intersection'](_0x24545b[_0x6ccb('0x3b')],_0x24545b[_0x6ccb('0x39')]);_0x4ca8d8[_0x6ccb('0x3c')]=_[_0x6ccb('0x3a')](_0x24545b['model'],qs[_0x6ccb('0x3d')](_0x2ad6d4[_0x6ccb('0x39')][_0x6ccb('0x3d')]));_0x4ca8d8[_0x6ccb('0x3c')]=_0x4ca8d8[_0x6ccb('0x3c')][_0x6ccb('0x50')]?_0x4ca8d8['attributes']:_0x24545b[_0x6ccb('0x3b')];if(_0x2ad6d4['query'][_0x6ccb('0x48')]){_0x4ca8d8[_0x6ccb('0x49')]=[{'all':!![]}];}_0x4ca8d8=_[_0x6ccb('0x51')]({},_0x4ca8d8,_0x2ad6d4[_0x6ccb('0x47')]);return db[_0x6ccb('0x4f')]['find'](_0x4ca8d8)['then'](handleEntityNotFound(_0x2d11bf,null))['then'](respondWithResult(_0x2d11bf,null))['catch'](handleError(_0x2d11bf,null));};exports[_0x6ccb('0x52')]=function(_0x176422,_0x4a097a){return db['VoiceRecording'][_0x6ccb('0x52')](_0x176422[_0x6ccb('0x53')],{})[_0x6ccb('0x2c')](respondWithResult(_0x4a097a,0xc9))[_0x6ccb('0x4c')](handleError(_0x4a097a,null));};exports[_0x6ccb('0x2b')]=function(_0x266fc8,_0x32e577){if(_0x266fc8[_0x6ccb('0x53')]['id']){delete _0x266fc8[_0x6ccb('0x53')]['id'];}return db[_0x6ccb('0x4f')][_0x6ccb('0x54')]({'where':{'id':_0x266fc8[_0x6ccb('0x4e')]['id']}})[_0x6ccb('0x2c')](handleEntityNotFound(_0x32e577,null))[_0x6ccb('0x2c')](saveUpdates(_0x266fc8[_0x6ccb('0x53')],null))[_0x6ccb('0x2c')](respondWithResult(_0x32e577,null))[_0x6ccb('0x4c')](handleError(_0x32e577,null));};exports[_0x6ccb('0x55')]=function(_0x559fbe,_0x36ecd8){return db[_0x6ccb('0x4f')][_0x6ccb('0x55')]()[_0x6ccb('0x2c')](respondWithResult(_0x36ecd8,null))[_0x6ccb('0x4c')](handleError(_0x36ecd8,null));};exports[_0x6ccb('0x56')]=function(_0x165039,_0x5adbcb,_0x415cef){var _0x3479fd=require(_0x6ccb('0x57'));var _0x55bd81=![];var _0x237854={};if(_0x165039[_0x6ccb('0x39')][_0x6ccb('0x35')]&&_0x165039[_0x6ccb('0x39')][_0x6ccb('0x35')]==='uniqueid'){_0x237854['uniqueid']=_0x165039[_0x6ccb('0x4e')]['id'];}else{_0x237854['id']=_0x165039[_0x6ccb('0x4e')]['id'];}return db['VoiceRecording'][_0x6ccb('0x54')]({'where':_0x237854,'attributes':['id',_0x6ccb('0x58')],'raw':!![]})[_0x6ccb('0x2c')](handleEntityNotFound(_0x5adbcb,null))[_0x6ccb('0x2c')](function(_0x3abd84){if(_0x3abd84){var _0x406fa2=_0x3abd84[_0x6ccb('0x58')];var _0x5d4148=util['format'](_0x6ccb('0x59'),_0x406fa2);if(fs['existsSync'](_0x5d4148)){_0x55bd81=!![];return _0x3479fd[_0x6ccb('0x5a')](_0x5d4148,_0x406fa2,config['secrets'][_0x6ccb('0x5b')])[_0x6ccb('0x2c')](function(){return _0x3abd84;});}return _0x3abd84;}})[_0x6ccb('0x2c')](function(_0x1769d2){if(_0x1769d2){var _0x2b687b=_0x1769d2[_0x6ccb('0x58')];if(!fs[_0x6ccb('0x5c')](_0x2b687b)){throw new db[(_0x6ccb('0x5d'))][(_0x6ccb('0x5e'))]('VoiceRecording\x20not\x20found');}if(_0x1769d2[_0x6ccb('0x5f')]){return _0x5adbcb[_0x6ccb('0x56')](_0x2b687b,_0x1769d2['filename']+path[_0x6ccb('0x60')](_0x2b687b),function(){if(_0x55bd81){fs[_0x6ccb('0x61')](_0x2b687b);}});}else{return _0x5adbcb[_0x6ccb('0x56')](_0x2b687b,function(_0x419f6d){if(_0x55bd81){fs[_0x6ccb('0x61')](_0x2b687b);}});}}})[_0x6ccb('0x4c')](function(_0x576dfd){if(_0x576dfd['message']==='VoiceRecording\x20not\x20found'){_0x5adbcb[_0x6ccb('0x1f')](0x194)[_0x6ccb('0x31')](_0x6ccb('0x62'));}else{return handleError(_0x5adbcb,null);}});};exports['downloads']=function(_0x1a6b34,_0x2c4fa1,_0x3813f8){var _0xc438f6=require(_0x6ccb('0x57'));var _0x3dd6be=![];var _0x55c99f={'$and':[db[_0x6ccb('0x63')][_0x6ccb('0x42')](db[_0x6ccb('0x63')]['fn'](_0x6ccb('0x64'),db['sequelize']['col'](_0x6ccb('0x65'))),_0x1a6b34[_0x6ccb('0x39')][_0x6ccb('0x66')])]};if(_0x1a6b34[_0x6ccb('0x39')][_0x6ccb('0x35')]&&_0x1a6b34[_0x6ccb('0x39')][_0x6ccb('0x35')]===_0x6ccb('0x65')){_0x55c99f[_0x6ccb('0x67')][_0x6ccb('0x68')]({'uniqueid':_0x1a6b34[_0x6ccb('0x4e')]['id']});}else{_0x55c99f[_0x6ccb('0x67')][_0x6ccb('0x68')]({'id':_0x1a6b34['params']['id']});}return db[_0x6ccb('0x4f')][_0x6ccb('0x54')]({'where':_0x55c99f,'attributes':['id','value'],'raw':!![]})[_0x6ccb('0x2c')](handleEntityNotFound(_0x2c4fa1,null))['then'](function(_0x16717e){if(_0x16717e){var _0x35d0ad=util['format'](_0x6ccb('0x59'),_0x16717e[_0x6ccb('0x58')]);if(fs[_0x6ccb('0x5c')](_0x35d0ad)){_0x3dd6be=!![];return _0xc438f6[_0x6ccb('0x5a')](_0x35d0ad,_0x16717e[_0x6ccb('0x58')],config[_0x6ccb('0x69')][_0x6ccb('0x5b')])['then'](function(){return _0x16717e;});}return _0x16717e;}})['then'](function(_0x2bb10d){if(_0x2bb10d){if(!fs[_0x6ccb('0x5c')](_0x2bb10d[_0x6ccb('0x58')])){throw new db['Sequelize'][(_0x6ccb('0x5e'))](_0x6ccb('0x6a'));}if(_0x2bb10d[_0x6ccb('0x5f')]){return _0x2c4fa1[_0x6ccb('0x56')](_0x2bb10d[_0x6ccb('0x58')],_0x2bb10d['filename']+path[_0x6ccb('0x60')](_0x2bb10d['value']),function(){if(_0x3dd6be){fs[_0x6ccb('0x61')](_0x2bb10d[_0x6ccb('0x58')]);}});}else{return _0x2c4fa1[_0x6ccb('0x56')](_0x2bb10d['value'],function(_0x47a6b4){if(_0x3dd6be){fs[_0x6ccb('0x61')](_0x2bb10d['value']);}});}}})[_0x6ccb('0x4c')](handleError(_0x2c4fa1,null));};exports[_0x6ccb('0x2d')]=function(_0x87a603,_0x4dab94){return db[_0x6ccb('0x4f')][_0x6ccb('0x54')]({'where':{'id':_0x87a603['params']['id']}})[_0x6ccb('0x2c')](function(_0x795cd8){if(_[_0x6ccb('0x6b')](_0x795cd8)){throw new ReferenceError(_0x6ccb('0x6c'));}return _0x795cd8;})[_0x6ccb('0x2c')](function(_0x55104c){var _0xbf3a1b=_0x55104c[_0x6ccb('0x58')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0xbf3a1b);if(!_[_0x6ccb('0x6b')](_0x55104c[_0x6ccb('0x58')])&&fs[_0x6ccb('0x5c')](_0xbf3a1b)){logger[_0x6ccb('0x6d')](_0x6ccb('0x6e')+_0xbf3a1b+_0x6ccb('0x6f'));fs['unlinkSync'](_0xbf3a1b);}_0xbf3a1b=_0xbf3a1b+_0x6ccb('0x70');if(!_[_0x6ccb('0x6b')](_0x55104c[_0x6ccb('0x58')])&&fs[_0x6ccb('0x5c')](_0xbf3a1b)){logger[_0x6ccb('0x6d')](_0x6ccb('0x6e')+_0xbf3a1b+_0x6ccb('0x6f'));fs[_0x6ccb('0x71')](_0xbf3a1b);}return _0x55104c;})[_0x6ccb('0x2c')](function(_0x5c54ad){if(!_0x5c54ad)throw new InternalError();return _0x5c54ad[_0x6ccb('0x2d')]();})['then'](function(){_0x4dab94[_0x6ccb('0x1f')](0xcc)[_0x6ccb('0x20')]();})[_0x6ccb('0x4c')](handleError(_0x4dab94,null));};function getBucketslist(_0x23dd4c,_0x2abf07,_0x54c35f){return new Promise(function(_0xd96cef,_0x11a381){var _0x59ceeb=new AWS['S3']({'accessKeyId':_0x2abf07,'secretAccessKey':_0x23dd4c,'region':_0x54c35f});_0x59ceeb['listBuckets']({},function(_0x1bc3cc,_0x48039d){if(_0x1bc3cc){return _0x11a381(_0x1bc3cc);}else{return _0xd96cef(_0x48039d);}});});}function createBucket(_0x573444,_0x5a7003,_0x2c0b6f,_0x497e2b){return new Promise(function(_0x259265,_0x3366ae){var _0x43a3f1=new AWS['S3']({'accessKeyId':_0x5a7003,'secretAccessKey':_0x573444,'region':_0x2c0b6f});_0x43a3f1[_0x6ccb('0x72')]({'Bucket':_0x497e2b},function(_0x2263bf,_0x2005bc){if(_0x2263bf){return _0x3366ae(_0x2263bf);}else{return _0x259265(_0x2005bc);}});});}function uploadFile(_0x740a18,_0xb0963f,_0x17dee4,_0x2508be,_0x2daaa4,_0x5c96be){return new Promise(function(_0x1f6f33,_0x5885ab){var _0x30bb38=new AWS['S3']({'accessKeyId':_0xb0963f,'secretAccessKey':_0x740a18,'region':_0x17dee4});_0x30bb38['upload']({'Bucket':_0x2508be,'Key':_0x2daaa4,'Body':_0x5c96be},function(_0x3cb9df,_0x54cdb3){if(_0x3cb9df){return _0x5885ab(_0x3cb9df);}else{return _0x1f6f33(_0x54cdb3);}});});}function startTranscribe(_0x4791b7,_0x4a7d2,_0xa61c9e,_0x560f7c,_0x5f101e,_0xa0db05){return new Promise(function(_0x54999f,_0x253640){var _0x474c98=new AWS[(_0x6ccb('0x73'))]({'accessKeyId':_0x4a7d2,'secretAccessKey':_0x4791b7,'region':_0xa61c9e});_0x474c98[_0x6ccb('0x74')]({'TranscriptionJobName':_0x560f7c,'LanguageCode':_0x5f101e,'Media':{'MediaFileUri':_0xa0db05}},function(_0x58dfb9,_0x2a9833){if(_0x58dfb9){return _0x253640(_0x58dfb9);}else{return _0x54999f(_0x2a9833);}});});}function transcribe(_0x128f21,_0x346204,_0x5d9e3f,_0x1f9e58,_0x4159c5,_0x2f8751,_0x5c661b){return new Promise(function(_0x23b40f,_0x44c8cb){var _0x1ca211={};logger[_0x6ccb('0x6d')](util['format'](_0x6ccb('0x75'),_0x128f21,_0x4159c5));return uploadFile(_0x346204,_0x5d9e3f,_0x1f9e58,_0x4159c5,path[_0x6ccb('0x76')](_0x2f8751),fs[_0x6ccb('0x77')](_0x2f8751))[_0x6ccb('0x2c')](function(_0x4bf631){logger[_0x6ccb('0x6d')](util['format'](_0x6ccb('0x78'),_0x128f21,_0x4159c5,_0x4bf631[_0x6ccb('0x79')]));_0x1ca211['bucket']=_0x4bf631[_0x6ccb('0x7a')];_0x1ca211[_0x6ccb('0x7b')]=_0x4bf631[_0x6ccb('0x79')];logger[_0x6ccb('0x6d')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x128f21));return startTranscribe(_0x346204,_0x5d9e3f,_0x1f9e58,uuidv4(),_0x5c661b,_0x4bf631[_0x6ccb('0x79')]);})[_0x6ccb('0x2c')](function(_0x59b796){logger[_0x6ccb('0x6d')](util[_0x6ccb('0x37')](_0x6ccb('0x7c'),_0x128f21,_0x59b796[_0x6ccb('0x7d')][_0x6ccb('0x7e')]));_0x1ca211['transcribeName']=_0x59b796[_0x6ccb('0x7d')][_0x6ccb('0x7e')];_0x1ca211[_0x6ccb('0x7f')]=_0x59b796['TranscriptionJob'][_0x6ccb('0x80')];return _0x23b40f(_0x1ca211);})[_0x6ccb('0x4c')](function(_0x1f47f7){return _0x44c8cb(_0x1f47f7);});});}exports[_0x6ccb('0x81')]=function(_0x3ec5c8,_0x5cd40e,_0x4759f8){var _0x4d5a8b;var _0x51140d;var _0x52bb77;var _0x1d0fd1=require(_0x6ccb('0x57'));return db[_0x6ccb('0x4f')][_0x6ccb('0x82')]({'where':{'id':_0x3ec5c8[_0x6ccb('0x4e')]['id']}})['then'](function(_0x3e72fa){if(_0x3e72fa){var _0x16d1f8=util[_0x6ccb('0x37')]('%s.cypher',_0x3e72fa[_0x6ccb('0x58')]);if(fs[_0x6ccb('0x5c')](_0x16d1f8)){cypher=!![];return _0x1d0fd1[_0x6ccb('0x5a')](_0x16d1f8,_0x3e72fa[_0x6ccb('0x58')],config[_0x6ccb('0x69')][_0x6ccb('0x5b')])[_0x6ccb('0x2c')](function(){return _0x3e72fa;});}return _0x3e72fa;}})[_0x6ccb('0x2c')](function(_0x6ac7fb){if(!_0x6ac7fb){throw new db[(_0x6ccb('0x5d'))][(_0x6ccb('0x5e'))](_0x6ccb('0x83'));}_0x51140d=_0x6ac7fb;return db[_0x6ccb('0x84')][_0x6ccb('0x82')]({'where':{'id':0x1}});})[_0x6ccb('0x2c')](handleEntityNotFound(_0x5cd40e,null))['then'](function(_0xeecde8){if(_0xeecde8){_0x4d5a8b=_0xeecde8;if(!_0x4d5a8b['transcribe']||!_0x4d5a8b['transcribeAccountId']||!_0x4d5a8b[_0x6ccb('0x85')]||!_0x4d5a8b[_0x6ccb('0x86')]||!_0x4d5a8b[_0x6ccb('0x87')]){throw new db[(_0x6ccb('0x5d'))][(_0x6ccb('0x5e'))](_0x6ccb('0x88'));}if(_0x3ec5c8['body']['runSentiment']&&(!_0x4d5a8b[_0x6ccb('0x89')]||!_0x4d5a8b['sentimentAccountId']||!_0x4d5a8b[_0x6ccb('0x8a')]||!_0x4d5a8b['language']||!_0x4d5a8b[_0x6ccb('0x87')])){throw new db['Sequelize'][(_0x6ccb('0x5e'))](_0x6ccb('0x8b'));}return db[_0x6ccb('0x8c')][_0x6ccb('0x82')]({'where':{'id':_0x4d5a8b[_0x6ccb('0x8d')]}});}})[_0x6ccb('0x2c')](function(_0xddb97){if(!_0xddb97){throw new db['Sequelize'][(_0x6ccb('0x5e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xddb97[_0x6ccb('0x8e')]||!_0xddb97['data2']){throw new db[(_0x6ccb('0x5d'))][(_0x6ccb('0x5e'))](_0x6ccb('0x8f'));}_0x52bb77=_0xddb97;return getBucketslist(_0x52bb77[_0x6ccb('0x8e')],_0x52bb77[_0x6ccb('0x90')],_0x4d5a8b[_0x6ccb('0x85')]);})[_0x6ccb('0x2c')](function(_0xd4fc19){if(_0xd4fc19&&_0xd4fc19[_0x6ccb('0x91')]){var _0x383c24=_['find'](_0xd4fc19[_0x6ccb('0x91')],function(_0x46ca24){return _0x46ca24[_0x6ccb('0x92')]===_0x4d5a8b[_0x6ccb('0x87')];});if(!_0x383c24){logger[_0x6ccb('0x6d')](util[_0x6ccb('0x37')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x3ec5c8[_0x6ccb('0x4e')]['id'],_0x4d5a8b['bucket']));return createBucket(_0x52bb77[_0x6ccb('0x8e')],_0x52bb77[_0x6ccb('0x90')],_0x4d5a8b[_0x6ccb('0x85')],_0x4d5a8b['bucket']);}logger[_0x6ccb('0x6d')](util[_0x6ccb('0x37')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3ec5c8['params']['id'],_0x4d5a8b[_0x6ccb('0x87')]));return;}})['then'](function(_0x46b86b){if(_0x51140d[_0x6ccb('0x7f')]===_0x6ccb('0x93')){return transcribe(_0x3ec5c8[_0x6ccb('0x4e')]['id'],_0x52bb77[_0x6ccb('0x8e')],_0x52bb77[_0x6ccb('0x90')],_0x4d5a8b[_0x6ccb('0x85')],_0x4d5a8b[_0x6ccb('0x87')],_0x51140d[_0x6ccb('0x58')],_0x4d5a8b['language']);}else{logger[_0x6ccb('0x6d')](util['format'](_0x6ccb('0x94'),_0x3ec5c8[_0x6ccb('0x4e')]['id']));return{'transcribeStatus':_0x6ccb('0x95')};}})[_0x6ccb('0x2c')](function(_0x140f99){if(_0x140f99){_0x140f99[_0x6ccb('0x96')]=_0x3ec5c8[_0x6ccb('0x53')][_0x6ccb('0x97')];return _0x51140d[_0x6ccb('0x98')](_0x140f99);}})['then'](respondWithResult(_0x5cd40e,null))[_0x6ccb('0x4c')](handleError(_0x5cd40e,null));};function writeFile(_0x145325,_0x24a10f){return new Promise(function(_0x5b6299,_0xd42a0b){fs[_0x6ccb('0x99')](_0x24a10f,_0x145325,function(_0x1693f7,_0x2a89d7){if(_0x1693f7){return _0xd42a0b(_0x1693f7);}else{return _0x5b6299(_0x2a89d7);}});});}exports[_0x6ccb('0x9a')]=function(_0x4eedc5,_0x55dd6e,_0x455b34){return db[_0x6ccb('0x4f')][_0x6ccb('0x82')]({'where':{'id':_0x4eedc5[_0x6ccb('0x4e')]['id']}})[_0x6ccb('0x2c')](handleEntityNotFound(_0x55dd6e))['then'](function(_0x3ba66c){if(_0x3ba66c&&_0x3ba66c[_0x6ccb('0x9b')]){var _0x281b20=_0x3ba66c[_0x6ccb('0x9b')];var _0xf2a4e=config[_0x6ccb('0x9c')]+_0x6ccb('0x9d')+_0x3ba66c['id']+_0x6ccb('0x9e');if(fs['existsSync'](_0xf2a4e)){return _0xf2a4e;}return writeFile(_0x281b20,_0xf2a4e)[_0x6ccb('0x2c')](function(){return _0xf2a4e;});}else{throw new db['Sequelize'][(_0x6ccb('0x5e'))](_0x6ccb('0x9f'));}})[_0x6ccb('0x2c')](function(_0x10ea75){return _0x55dd6e[_0x6ccb('0x56')](_0x10ea75);})[_0x6ccb('0x4c')](handleError(_0x55dd6e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 598ed9d..6475482 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 _0xb458=['transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x1dd4ff,_0x50c3f1){var _0x8c605e=function(_0x178e2b){while(--_0x178e2b){_0x1dd4ff['push'](_0x1dd4ff['shift']());}};_0x8c605e(++_0x50c3f1);}(_0xb458,0x103));var _0x8b45=function(_0x52ce8b,_0x2793af){_0x52ce8b=_0x52ce8b-0x0;var _0x2857f2=_0xb458[_0x52ce8b];return _0x2857f2;};'use strict';var attributes=require(_0x8b45('0x0'));module[_0x8b45('0x1')]=function(_0x4544e3,_0x494751){return _0x4544e3['define'](_0x8b45('0x2'),attributes,{'tableName':_0x8b45('0x3'),'paranoid':![],'indexes':[{'name':_0x8b45('0x4'),'fields':[_0x8b45('0x4')]},{'name':'transcribeStatus','fields':[_0x8b45('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12cc=['define','VoiceRecording','uniqueid','transcribeStatus','exports'];(function(_0xde2213,_0x139688){var _0x51b9cc=function(_0x1c976e){while(--_0x1c976e){_0xde2213['push'](_0xde2213['shift']());}};_0x51b9cc(++_0x139688);}(_0x12cc,0xc2));var _0xc12c=function(_0x130bf5,_0x4485d7){_0x130bf5=_0x130bf5-0x0;var _0x4cf321=_0x12cc[_0x130bf5];return _0x4cf321;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xc12c('0x0')]=function(_0x3183a9,_0x265de9){return _0x3183a9[_0xc12c('0x1')](_0xc12c('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc12c('0x3')]},{'name':_0xc12c('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 048c47d..ba739d9 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 _0x2272=['client','http','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','encryptFile','secrets','recording','unlink','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x23071e,_0x4df73d){var _0x397837=function(_0x3a1e44){while(--_0x3a1e44){_0x23071e['push'](_0x23071e['shift']());}};_0x397837(++_0x4df73d);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('VoiceRecording,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531f75['options']?_0x531f75[_0x2227('0x1c')][_0x2227('0x1e')]||null:null,'attributes':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x1f')]||null:null,'limit':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x20')]||null:null})[_0x2227('0xc')](function(_0x34c090){logger[_0x2227('0xd')]('UpdateVoiceRecording',_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x34c090));_0x620012(_0x34c090);})[_0x2227('0x17')](function(_0xbfdce1){logger['error']('UpdateVoiceRecording',_0xbfdce1[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0xbfdce1[_0x2227('0x15')]));});});};exports[_0x2227('0x21')]=function(_0x5be889){var _0x191a3e=this;return new Promise(function(_0x301304,_0x2d8ea0){var _0x1957ee=require('../../components/encryptor');var _0x204def;return db[_0x2227('0x22')][_0x2227('0x23')]({'attributes':['id',_0x2227('0x24')],'where':{'id':0x1},'raw':!![]})[_0x2227('0xc')](function(_0x4789eb){_0x204def=_0x4789eb;return db['VoiceRecording']['create'](_0x5be889[_0x2227('0x1b')]);})['then'](function(_0x2ba581){if(_0x204def[_0x2227('0x24')]&&fs['existsSync'](_0x2ba581['value'])){var _0x1f1ba7=util[_0x2227('0x25')](_0x2227('0x26'),_0x2ba581['value']);return _0x1957ee[_0x2227('0x27')](_0x2ba581['value'],_0x1f1ba7,config[_0x2227('0x28')][_0x2227('0x29')])[_0x2227('0xc')](function(){fs[_0x2227('0x2a')](_0x2ba581[_0x2227('0x2b')]);logger[_0x2227('0xd')](_0x2227('0x2c'));return _0x2ba581;});}return _0x2ba581;})[_0x2227('0xc')](function(_0xd38f59){logger[_0x2227('0xd')](_0x2227('0x21'),_0x5be889);logger['debug'](_0x2227('0x21'),_0x5be889,JSON[_0x2227('0x11')](_0xd38f59));_0x301304(_0xd38f59);})[_0x2227('0x17')](function(_0x6cd5d7){logger['error'](_0x2227('0x21'),_0x6cd5d7[_0x2227('0x15')],_0x5be889);_0x2d8ea0(_0x191a3e[_0x2227('0x12')](0x1f4,_0x6cd5d7[_0x2227('0x15')]));});});}; \ No newline at end of file +var _0x5fdc=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','info','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','catch'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x5fdc,0x127));var _0xc5fd=function(_0x537a48,_0x90fd35){_0x537a48=_0x537a48-0x0;var _0x5e304d=_0x5fdc[_0x537a48];return _0x5e304d;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['update'](_0x27f611[_0xc5fd('0x1b')],{'raw':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f611[_0xc5fd('0x1c')]?_0x27f611['options'][_0xc5fd('0x1e')]||null:null,'attributes':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1f')]||null:null,'limit':_0x27f611['options']?_0x27f611['options'][_0xc5fd('0x20')]||null:null})[_0xc5fd('0xf')](function(_0x3d7211){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')]('UpdateVoiceRecording',_0x27f611,JSON[_0xc5fd('0x13')](_0x3d7211));_0x2ee392(_0x3d7211);})[_0xc5fd('0x21')](function(_0x1a5174){logger[_0xc5fd('0x14')](_0xc5fd('0x19'),_0x1a5174[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x1a5174['message']));});});};exports[_0xc5fd('0x22')]=function(_0x48cd1d){var _0x2ee700=this;return new Promise(function(_0x231368,_0x44681d){var _0x2bee22=require('../../components/encryptor');var _0x176313;return db[_0xc5fd('0x23')][_0xc5fd('0x24')]({'attributes':['id',_0xc5fd('0x25')],'where':{'id':0x1},'raw':!![]})[_0xc5fd('0xf')](function(_0x209975){_0x176313=_0x209975;return db['VoiceRecording'][_0xc5fd('0x26')](_0x48cd1d['body']);})['then'](function(_0x12a962){if(_0x176313[_0xc5fd('0x25')]&&fs[_0xc5fd('0x27')](_0x12a962[_0xc5fd('0x28')])){var _0x7693c4=util[_0xc5fd('0x29')](_0xc5fd('0x2a'),_0x12a962[_0xc5fd('0x28')]);return _0x2bee22['encryptFile'](_0x12a962[_0xc5fd('0x28')],_0x7693c4,config[_0xc5fd('0x2b')][_0xc5fd('0x2c')])[_0xc5fd('0xf')](function(){fs[_0xc5fd('0x2d')](_0x12a962[_0xc5fd('0x28')]);logger[_0xc5fd('0x18')](_0xc5fd('0x2e'));return _0x12a962;});}return _0x12a962;})[_0xc5fd('0xf')](function(_0x466aa1){logger[_0xc5fd('0x18')](_0xc5fd('0x22'),_0x48cd1d);logger['debug'](_0xc5fd('0x22'),_0x48cd1d,JSON[_0xc5fd('0x13')](_0x466aa1));_0x231368(_0x466aa1);})[_0xc5fd('0x21')](function(_0x1fa329){logger[_0xc5fd('0x14')](_0xc5fd('0x22'),_0x1fa329[_0xc5fd('0x16')],_0x48cd1d);_0x44681d(_0x2ee700[_0xc5fd('0x14')](0x1f4,_0x1fa329[_0xc5fd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 5c4853d..29514e4 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 _0xf1d1=['/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xf1d1,0xeb));var _0x1f1d=function(_0x15407c,_0x337d1a){_0x15407c=_0x15407c-0x0;var _0xbf1f4f=_0xf1d1[_0x15407c];return _0xbf1f4f;};'use strict';var multer=require(_0x1f1d('0x0'));var util=require(_0x1f1d('0x1'));var path=require(_0x1f1d('0x2'));var timeout=require(_0x1f1d('0x3'));var express=require(_0x1f1d('0x4'));var router=express['Router']();var fs_extra=require(_0x1f1d('0x5'));var auth=require(_0x1f1d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f1d('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x1f1d('0x8')]('/',auth[_0x1f1d('0x9')](),controller[_0x1f1d('0xa')]);router[_0x1f1d('0x8')]('/describe',auth[_0x1f1d('0x9')](),controller[_0x1f1d('0xb')]);router[_0x1f1d('0x8')](_0x1f1d('0xc'),auth[_0x1f1d('0x9')](),controller['show']);router[_0x1f1d('0xd')]('/',auth[_0x1f1d('0x9')](),controller[_0x1f1d('0xe')]);router[_0x1f1d('0xf')](_0x1f1d('0xc'),auth['isAuthenticated'](),controller[_0x1f1d('0x10')]);router['delete'](_0x1f1d('0xc'),auth[_0x1f1d('0x9')](),controller[_0x1f1d('0x11')]);module[_0x1f1d('0x12')]=router; \ No newline at end of file +var _0x0940=['exports','util','path','connect-timeout','./voiceTransferReport.controller','get','describe','/:id','isAuthenticated','post','create','update','destroy'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x0940,0xde));var _0x0094=function(_0x1da037,_0x34092e){_0x1da037=_0x1da037-0x0;var _0x515236=_0x0940[_0x1da037];return _0x515236;};'use strict';var multer=require('multer');var util=require(_0x0094('0x0'));var path=require(_0x0094('0x1'));var timeout=require(_0x0094('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0094('0x3'));router[_0x0094('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0094('0x5')]);router['get'](_0x0094('0x6'),auth[_0x0094('0x7')](),controller['show']);router[_0x0094('0x8')]('/',auth[_0x0094('0x7')](),controller[_0x0094('0x9')]);router['put'](_0x0094('0x6'),auth[_0x0094('0x7')](),controller[_0x0094('0xa')]);router['delete']('/:id',auth[_0x0094('0x7')](),controller[_0x0094('0xb')]);module[_0x0094('0xc')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e813990..a6587c2 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 _0xb081=['moment','ENUM','attended','STRING','Yes','sequelize'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xb081,0x15b));var _0x1b08=function(_0x103080,_0x40ac65){_0x103080=_0x103080-0x0;var _0x2d05a0=_0xb081[_0x103080];return _0x2d05a0;};'use strict';var Sequelize=require(_0x1b08('0x0'));var moment=require(_0x1b08('0x1'));module['exports']={'type':{'type':Sequelize[_0x1b08('0x2')]('blind',_0x1b08('0x3'))},'result':{'type':Sequelize[_0x1b08('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x1b08('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1b08('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x1b08('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1b08('0x4')]},'transfererexten':{'type':Sequelize[_0x1b08('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1b08('0x4')]},'transfereechannel':{'type':Sequelize[_0x1b08('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1b08('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x1b08('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1b08('0x4')]},'transfereecontext':{'type':Sequelize[_0x1b08('0x4')]},'transfereeexten':{'type':Sequelize[_0x1b08('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x1b08('0x4')]},'isexternal':{'type':Sequelize[_0x1b08('0x2')](_0x1b08('0x5'),'No')},'context':{'type':Sequelize[_0x1b08('0x4')]},'extension':{'type':Sequelize[_0x1b08('0x4')]}}; \ No newline at end of file +var _0x7f4b=['sequelize','moment','ENUM','attended','STRING','Yes'];(function(_0x374477,_0x373a16){var _0x13f06d=function(_0x45a5db){while(--_0x45a5db){_0x374477['push'](_0x374477['shift']());}};_0x13f06d(++_0x373a16);}(_0x7f4b,0x144));var _0xb7f4=function(_0x45495a,_0x353d64){_0x45495a=_0x45495a-0x0;var _0xf6fb7c=_0x7f4b[_0x45495a];return _0xf6fb7c;};'use strict';var Sequelize=require(_0xb7f4('0x0'));var moment=require(_0xb7f4('0x1'));module['exports']={'type':{'type':Sequelize[_0xb7f4('0x2')]('blind',_0xb7f4('0x3'))},'result':{'type':Sequelize[_0xb7f4('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xb7f4('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb7f4('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xb7f4('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xb7f4('0x4')]},'transferercontext':{'type':Sequelize[_0xb7f4('0x4')]},'transfererexten':{'type':Sequelize[_0xb7f4('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xb7f4('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xb7f4('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xb7f4('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb7f4('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xb7f4('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xb7f4('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0xb7f4('0x5'),'No')},'context':{'type':Sequelize[_0xb7f4('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 010a8ad..63314b5 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 _0x5646=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','catch','show','params','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring'];(function(_0xa3a7a2,_0x3b6eeb){var _0x341268=function(_0x24bb5f){while(--_0x24bb5f){_0xa3a7a2['push'](_0xa3a7a2['shift']());}};_0x341268(++_0x3b6eeb);}(_0x5646,0x119));var _0x6564=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x5646[_0x543242];return _0x4c99b6;};'use strict';var emlformat=require(_0x6564('0x0'));var rimraf=require(_0x6564('0x1'));var zipdir=require(_0x6564('0x2'));var jsonpatch=require(_0x6564('0x3'));var rp=require(_0x6564('0x4'));var moment=require('moment');var BPromise=require(_0x6564('0x5'));var Mustache=require(_0x6564('0x6'));var util=require(_0x6564('0x7'));var path=require(_0x6564('0x8'));var sox=require('sox');var csv=require(_0x6564('0x9'));var ejs=require(_0x6564('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6564('0xb'));var crypto=require(_0x6564('0xc'));var jsforce=require(_0x6564('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6564('0xe'));var Papa=require('papaparse');var Redis=require(_0x6564('0xf'));var authService=require(_0x6564('0x10'));var qs=require(_0x6564('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6564('0x12'));var logger=require(_0x6564('0x13'))(_0x6564('0x14'));var utils=require(_0x6564('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6564('0x16'));var db=require(_0x6564('0x17'))['db'];function respondWithStatusCode(_0x2b8e5d,_0x4fb3b3){_0x4fb3b3=_0x4fb3b3||0xcc;return function(_0x27b842){if(_0x27b842){return _0x2b8e5d[_0x6564('0x18')](_0x4fb3b3);}return _0x2b8e5d['status'](_0x4fb3b3)[_0x6564('0x19')]();};}function respondWithResult(_0x3f8e16,_0x7f733f){_0x7f733f=_0x7f733f||0xc8;return function(_0x1ca28d){if(_0x1ca28d){return _0x3f8e16[_0x6564('0x1a')](_0x7f733f)[_0x6564('0x1b')](_0x1ca28d);}};}function respondWithFilteredResult(_0x5bad52,_0x4a2c18){return function(_0x534536){if(_0x534536){var _0x1fae19=typeof _0x4a2c18[_0x6564('0x1c')]===_0x6564('0x1d')&&typeof _0x4a2c18[_0x6564('0x1e')]===_0x6564('0x1d');var _0x46fe31=_0x534536[_0x6564('0x1f')];var _0x1a553f=_0x1fae19?0x0:_0x4a2c18[_0x6564('0x1c')];var _0x2e587d=_0x1fae19?_0x534536[_0x6564('0x1f')]:_0x4a2c18[_0x6564('0x1c')]+_0x4a2c18[_0x6564('0x1e')];var _0x33b12f;if(_0x2e587d>=_0x46fe31){_0x2e587d=_0x46fe31;_0x33b12f=0xc8;}else{_0x33b12f=0xce;}_0x5bad52[_0x6564('0x1a')](_0x33b12f);return _0x5bad52[_0x6564('0x20')](_0x6564('0x21'),_0x1a553f+'-'+_0x2e587d+'/'+_0x46fe31)[_0x6564('0x1b')](_0x534536);}return null;};}function patchUpdates(_0x3ec559){return function(_0x1c178d){try{jsonpatch[_0x6564('0x22')](_0x1c178d,_0x3ec559,!![]);}catch(_0x2e1207){return BPromise[_0x6564('0x23')](_0x2e1207);}return _0x1c178d[_0x6564('0x24')]();};}function saveUpdates(_0x1eea88,_0x1f5f89){return function(_0x2ea7da){if(_0x2ea7da){return _0x2ea7da[_0x6564('0x25')](_0x1eea88)[_0x6564('0x26')](function(_0x3680dd){return _0x3680dd;});}return null;};}function removeEntity(_0x2d47a2,_0x509879){return function(_0x111d26){if(_0x111d26){return _0x111d26[_0x6564('0x27')]()[_0x6564('0x26')](function(){_0x2d47a2['status'](0xcc)[_0x6564('0x19')]();});}};}function handleEntityNotFound(_0x32705d,_0xf03f4){return function(_0x5d6695){if(!_0x5d6695){_0x32705d[_0x6564('0x18')](0x194);}return _0x5d6695;};}function handleError(_0x4c87e3,_0x2bd0a3){_0x2bd0a3=_0x2bd0a3||0x1f4;return function(_0x284e6e){logger[_0x6564('0x28')](_0x284e6e['stack']);if(_0x284e6e[_0x6564('0x29')]){delete _0x284e6e['name'];}_0x4c87e3[_0x6564('0x1a')](_0x2bd0a3)[_0x6564('0x2a')](_0x284e6e);};}exports[_0x6564('0x2b')]=function(_0x43552f,_0x45d43b){var _0x46bafe={},_0x5d19f2={},_0x21929a={'count':0x0,'rows':[]};var _0x3b1c8b=_[_0x6564('0x2c')](db[_0x6564('0x2d')][_0x6564('0x2e')],function(_0x5b9993){return{'name':_0x5b9993['fieldName'],'type':_0x5b9993[_0x6564('0x2f')][_0x6564('0x30')]};});_0x5d19f2[_0x6564('0x31')]=_['map'](_0x3b1c8b,'name');_0x5d19f2[_0x6564('0x32')]=_[_0x6564('0x33')](_0x43552f['query']);_0x5d19f2[_0x6564('0x34')]=_[_0x6564('0x35')](_0x5d19f2[_0x6564('0x31')],_0x5d19f2[_0x6564('0x32')]);_0x46bafe[_0x6564('0x36')]=_[_0x6564('0x35')](_0x5d19f2[_0x6564('0x31')],qs[_0x6564('0x37')](_0x43552f[_0x6564('0x32')]['fields']));_0x46bafe[_0x6564('0x36')]=_0x46bafe[_0x6564('0x36')][_0x6564('0x38')]?_0x46bafe[_0x6564('0x36')]:_0x5d19f2['model'];if(!_0x43552f[_0x6564('0x32')][_0x6564('0x39')](_0x6564('0x3a'))){_0x46bafe[_0x6564('0x1e')]=qs[_0x6564('0x1e')](_0x43552f['query']['limit']);_0x46bafe[_0x6564('0x1c')]=qs['offset'](_0x43552f[_0x6564('0x32')][_0x6564('0x1c')]);}_0x46bafe[_0x6564('0x3b')]=qs[_0x6564('0x3c')](_0x43552f[_0x6564('0x32')][_0x6564('0x3c')]);_0x46bafe[_0x6564('0x3d')]=qs[_0x6564('0x34')](_['pick'](_0x43552f['query'],_0x5d19f2['filters']),_0x3b1c8b);if(_0x43552f[_0x6564('0x32')][_0x6564('0x3e')]){_0x46bafe[_0x6564('0x3d')]=_[_0x6564('0x3f')](_0x46bafe[_0x6564('0x3d')],{'$or':_['map'](_0x3b1c8b,function(_0x32ba4a){if(_0x32ba4a[_0x6564('0x2f')]!=='VIRTUAL'){var _0x5d4a57={};_0x5d4a57[_0x32ba4a[_0x6564('0x29')]]={'$like':'%'+_0x43552f['query'][_0x6564('0x3e')]+'%'};return _0x5d4a57;}})});}_0x46bafe=_[_0x6564('0x3f')]({},_0x46bafe,_0x43552f[_0x6564('0x40')]);var _0x503044={'where':_0x46bafe[_0x6564('0x3d')]};return db['VoiceTransferReport'][_0x6564('0x1f')](_0x503044)[_0x6564('0x26')](function(_0x3d6ee0){_0x21929a['count']=_0x3d6ee0;if(_0x43552f[_0x6564('0x32')]['includeAll']){_0x46bafe['include']=[{'all':!![]}];}return db[_0x6564('0x2d')]['findAll'](_0x46bafe);})[_0x6564('0x26')](function(_0x5a4dc4){_0x21929a['rows']=_0x5a4dc4;return _0x21929a;})['then'](respondWithFilteredResult(_0x45d43b,_0x46bafe))[_0x6564('0x41')](handleError(_0x45d43b,null));};exports[_0x6564('0x42')]=function(_0x273be9,_0x1e1d97){var _0x2d63a7={'raw':!![],'where':{'id':_0x273be9[_0x6564('0x43')]['id']}},_0x3f68b7={};_0x3f68b7[_0x6564('0x31')]=_[_0x6564('0x33')](db['VoiceTransferReport']['rawAttributes']);_0x3f68b7['query']=_[_0x6564('0x33')](_0x273be9[_0x6564('0x32')]);_0x3f68b7[_0x6564('0x34')]=_['intersection'](_0x3f68b7['model'],_0x3f68b7['query']);_0x2d63a7['attributes']=_[_0x6564('0x35')](_0x3f68b7[_0x6564('0x31')],qs[_0x6564('0x37')](_0x273be9[_0x6564('0x32')]['fields']));_0x2d63a7[_0x6564('0x36')]=_0x2d63a7[_0x6564('0x36')][_0x6564('0x38')]?_0x2d63a7['attributes']:_0x3f68b7[_0x6564('0x31')];if(_0x273be9[_0x6564('0x32')][_0x6564('0x44')]){_0x2d63a7[_0x6564('0x45')]=[{'all':!![]}];}_0x2d63a7=_[_0x6564('0x3f')]({},_0x2d63a7,_0x273be9[_0x6564('0x40')]);return db[_0x6564('0x2d')]['find'](_0x2d63a7)[_0x6564('0x26')](handleEntityNotFound(_0x1e1d97,null))[_0x6564('0x26')](respondWithResult(_0x1e1d97,null))[_0x6564('0x41')](handleError(_0x1e1d97,null));};exports[_0x6564('0x46')]=function(_0x42c37a,_0x1bb452){return db[_0x6564('0x2d')]['create'](_0x42c37a[_0x6564('0x47')],{})[_0x6564('0x26')](respondWithResult(_0x1bb452,0xc9))['catch'](handleError(_0x1bb452,null));};exports[_0x6564('0x25')]=function(_0x3b8904,_0x2692ce){if(_0x3b8904[_0x6564('0x47')]['id']){delete _0x3b8904[_0x6564('0x47')]['id'];}return db[_0x6564('0x2d')][_0x6564('0x48')]({'where':{'id':_0x3b8904[_0x6564('0x43')]['id']}})[_0x6564('0x26')](handleEntityNotFound(_0x2692ce,null))[_0x6564('0x26')](saveUpdates(_0x3b8904[_0x6564('0x47')],null))[_0x6564('0x26')](respondWithResult(_0x2692ce,null))[_0x6564('0x41')](handleError(_0x2692ce,null));};exports[_0x6564('0x27')]=function(_0x87f5f3,_0x2050a5){return db[_0x6564('0x2d')][_0x6564('0x48')]({'where':{'id':_0x87f5f3[_0x6564('0x43')]['id']}})[_0x6564('0x26')](handleEntityNotFound(_0x2050a5,null))['then'](removeEntity(_0x2050a5,null))['catch'](handleError(_0x2050a5,null));};exports[_0x6564('0x49')]=function(_0x417a73,_0x2c6c54){return db[_0x6564('0x2d')]['describe']()[_0x6564('0x26')](respondWithResult(_0x2c6c54,null))[_0x6564('0x41')](handleError(_0x2c6c54,null));}; \ No newline at end of file +var _0x5d90=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','update','destroy','then','stack','name','send','map','VoiceTransferReport','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','keys','length','find','create','body','catch','describe'];(function(_0x5f1cb0,_0x4dc1ba){var _0x4f2da9=function(_0xcfd169){while(--_0xcfd169){_0x5f1cb0['push'](_0x5f1cb0['shift']());}};_0x4f2da9(++_0x4dc1ba);}(_0x5d90,0xde));var _0x05d9=function(_0x1d2bb0,_0x2dddb2){_0x1d2bb0=_0x1d2bb0-0x0;var _0x1bd62b=_0x5d90[_0x1d2bb0];return _0x1bd62b;};'use strict';var emlformat=require(_0x05d9('0x0'));var rimraf=require(_0x05d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05d9('0x2'));var rp=require(_0x05d9('0x3'));var moment=require(_0x05d9('0x4'));var BPromise=require(_0x05d9('0x5'));var Mustache=require(_0x05d9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x05d9('0x7'));var csv=require('to-csv');var ejs=require(_0x05d9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05d9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x05d9('0xa'));var deskjs=require(_0x05d9('0xb'));var toCsv=require(_0x05d9('0xc'));var querystring=require(_0x05d9('0xd'));var Papa=require(_0x05d9('0xe'));var Redis=require(_0x05d9('0xf'));var authService=require(_0x05d9('0x10'));var qs=require(_0x05d9('0x11'));var as=require(_0x05d9('0x12'));var hardwareService=require(_0x05d9('0x13'));var logger=require(_0x05d9('0x14'))(_0x05d9('0x15'));var utils=require(_0x05d9('0x16'));var config=require(_0x05d9('0x17'));var licenseUtil=require(_0x05d9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d1183,_0x1112b5){_0x1112b5=_0x1112b5||0xcc;return function(_0x2e72d9){if(_0x2e72d9){return _0x2d1183[_0x05d9('0x19')](_0x1112b5);}return _0x2d1183[_0x05d9('0x1a')](_0x1112b5)[_0x05d9('0x1b')]();};}function respondWithResult(_0x118da3,_0x295cd5){_0x295cd5=_0x295cd5||0xc8;return function(_0x27536e){if(_0x27536e){return _0x118da3[_0x05d9('0x1a')](_0x295cd5)[_0x05d9('0x1c')](_0x27536e);}};}function respondWithFilteredResult(_0x1be7d5,_0x14e2ea){return function(_0x1365c9){if(_0x1365c9){var _0x4e9dd1=typeof _0x14e2ea[_0x05d9('0x1d')]===_0x05d9('0x1e')&&typeof _0x14e2ea[_0x05d9('0x1f')]===_0x05d9('0x1e');var _0x2a8c2e=_0x1365c9['count'];var _0x1552b6=_0x4e9dd1?0x0:_0x14e2ea[_0x05d9('0x1d')];var _0x313960=_0x4e9dd1?_0x1365c9['count']:_0x14e2ea[_0x05d9('0x1d')]+_0x14e2ea[_0x05d9('0x1f')];var _0x400cd2;if(_0x313960>=_0x2a8c2e){_0x313960=_0x2a8c2e;_0x400cd2=0xc8;}else{_0x400cd2=0xce;}_0x1be7d5[_0x05d9('0x1a')](_0x400cd2);return _0x1be7d5[_0x05d9('0x20')]('Content-Range',_0x1552b6+'-'+_0x313960+'/'+_0x2a8c2e)[_0x05d9('0x1c')](_0x1365c9);}return null;};}function patchUpdates(_0xd8c2b5){return function(_0x454f95){try{jsonpatch['apply'](_0x454f95,_0xd8c2b5,!![]);}catch(_0x5b33f4){return BPromise[_0x05d9('0x21')](_0x5b33f4);}return _0x454f95[_0x05d9('0x22')]();};}function saveUpdates(_0x452e52,_0x1e4939){return function(_0x5eabae){if(_0x5eabae){return _0x5eabae[_0x05d9('0x23')](_0x452e52)['then'](function(_0x4476b7){return _0x4476b7;});}return null;};}function removeEntity(_0x26fd5c,_0x2fadd4){return function(_0x29adeb){if(_0x29adeb){return _0x29adeb[_0x05d9('0x24')]()[_0x05d9('0x25')](function(){_0x26fd5c[_0x05d9('0x1a')](0xcc)[_0x05d9('0x1b')]();});}};}function handleEntityNotFound(_0x7054e8,_0x1b42fb){return function(_0x4d2709){if(!_0x4d2709){_0x7054e8['sendStatus'](0x194);}return _0x4d2709;};}function handleError(_0x3a5a36,_0x10c57c){_0x10c57c=_0x10c57c||0x1f4;return function(_0x247968){logger['error'](_0x247968[_0x05d9('0x26')]);if(_0x247968[_0x05d9('0x27')]){delete _0x247968['name'];}_0x3a5a36[_0x05d9('0x1a')](_0x10c57c)[_0x05d9('0x28')](_0x247968);};}exports['index']=function(_0x4d4ff2,_0x1da950){var _0x2fdd19={},_0x19a25d={},_0x128ab7={'count':0x0,'rows':[]};var _0x5bde7a=_[_0x05d9('0x29')](db[_0x05d9('0x2a')]['rawAttributes'],function(_0x218aaf){return{'name':_0x218aaf['fieldName'],'type':_0x218aaf['type'][_0x05d9('0x2b')]};});_0x19a25d[_0x05d9('0x2c')]=_[_0x05d9('0x29')](_0x5bde7a,_0x05d9('0x27'));_0x19a25d[_0x05d9('0x2d')]=_['keys'](_0x4d4ff2[_0x05d9('0x2d')]);_0x19a25d[_0x05d9('0x2e')]=_[_0x05d9('0x2f')](_0x19a25d[_0x05d9('0x2c')],_0x19a25d[_0x05d9('0x2d')]);_0x2fdd19['attributes']=_[_0x05d9('0x2f')](_0x19a25d[_0x05d9('0x2c')],qs['fields'](_0x4d4ff2[_0x05d9('0x2d')][_0x05d9('0x30')]));_0x2fdd19['attributes']=_0x2fdd19[_0x05d9('0x31')]['length']?_0x2fdd19[_0x05d9('0x31')]:_0x19a25d[_0x05d9('0x2c')];if(!_0x4d4ff2[_0x05d9('0x2d')][_0x05d9('0x32')](_0x05d9('0x33'))){_0x2fdd19[_0x05d9('0x1f')]=qs[_0x05d9('0x1f')](_0x4d4ff2[_0x05d9('0x2d')][_0x05d9('0x1f')]);_0x2fdd19[_0x05d9('0x1d')]=qs[_0x05d9('0x1d')](_0x4d4ff2[_0x05d9('0x2d')][_0x05d9('0x1d')]);}_0x2fdd19[_0x05d9('0x34')]=qs[_0x05d9('0x35')](_0x4d4ff2['query'][_0x05d9('0x35')]);_0x2fdd19[_0x05d9('0x36')]=qs[_0x05d9('0x2e')](_[_0x05d9('0x37')](_0x4d4ff2[_0x05d9('0x2d')],_0x19a25d[_0x05d9('0x2e')]),_0x5bde7a);if(_0x4d4ff2[_0x05d9('0x2d')][_0x05d9('0x38')]){_0x2fdd19[_0x05d9('0x36')]=_['merge'](_0x2fdd19[_0x05d9('0x36')],{'$or':_[_0x05d9('0x29')](_0x5bde7a,function(_0x43ffa0){if(_0x43ffa0[_0x05d9('0x39')]!==_0x05d9('0x3a')){var _0x51c5fc={};_0x51c5fc[_0x43ffa0[_0x05d9('0x27')]]={'$like':'%'+_0x4d4ff2['query'][_0x05d9('0x38')]+'%'};return _0x51c5fc;}})});}_0x2fdd19=_[_0x05d9('0x3b')]({},_0x2fdd19,_0x4d4ff2[_0x05d9('0x3c')]);var _0xadaeba={'where':_0x2fdd19[_0x05d9('0x36')]};return db['VoiceTransferReport'][_0x05d9('0x3d')](_0xadaeba)['then'](function(_0x26fa8b){_0x128ab7[_0x05d9('0x3d')]=_0x26fa8b;if(_0x4d4ff2[_0x05d9('0x2d')][_0x05d9('0x3e')]){_0x2fdd19[_0x05d9('0x3f')]=[{'all':!![]}];}return db[_0x05d9('0x2a')]['findAll'](_0x2fdd19);})['then'](function(_0x226e50){_0x128ab7[_0x05d9('0x40')]=_0x226e50;return _0x128ab7;})[_0x05d9('0x25')](respondWithFilteredResult(_0x1da950,_0x2fdd19))['catch'](handleError(_0x1da950,null));};exports[_0x05d9('0x41')]=function(_0x212232,_0x465c8d){var _0x522fd3={'raw':!![],'where':{'id':_0x212232[_0x05d9('0x42')]['id']}},_0x24682f={};_0x24682f[_0x05d9('0x2c')]=_[_0x05d9('0x43')](db[_0x05d9('0x2a')]['rawAttributes']);_0x24682f[_0x05d9('0x2d')]=_[_0x05d9('0x43')](_0x212232['query']);_0x24682f[_0x05d9('0x2e')]=_[_0x05d9('0x2f')](_0x24682f[_0x05d9('0x2c')],_0x24682f[_0x05d9('0x2d')]);_0x522fd3[_0x05d9('0x31')]=_[_0x05d9('0x2f')](_0x24682f[_0x05d9('0x2c')],qs[_0x05d9('0x30')](_0x212232[_0x05d9('0x2d')][_0x05d9('0x30')]));_0x522fd3[_0x05d9('0x31')]=_0x522fd3['attributes'][_0x05d9('0x44')]?_0x522fd3[_0x05d9('0x31')]:_0x24682f[_0x05d9('0x2c')];if(_0x212232[_0x05d9('0x2d')]['includeAll']){_0x522fd3[_0x05d9('0x3f')]=[{'all':!![]}];}_0x522fd3=_[_0x05d9('0x3b')]({},_0x522fd3,_0x212232[_0x05d9('0x3c')]);return db[_0x05d9('0x2a')][_0x05d9('0x45')](_0x522fd3)['then'](handleEntityNotFound(_0x465c8d,null))[_0x05d9('0x25')](respondWithResult(_0x465c8d,null))['catch'](handleError(_0x465c8d,null));};exports[_0x05d9('0x46')]=function(_0x48906a,_0x38134f){return db[_0x05d9('0x2a')][_0x05d9('0x46')](_0x48906a[_0x05d9('0x47')],{})[_0x05d9('0x25')](respondWithResult(_0x38134f,0xc9))[_0x05d9('0x48')](handleError(_0x38134f,null));};exports[_0x05d9('0x23')]=function(_0x4bf3d3,_0x3d4ee1){if(_0x4bf3d3[_0x05d9('0x47')]['id']){delete _0x4bf3d3[_0x05d9('0x47')]['id'];}return db[_0x05d9('0x2a')][_0x05d9('0x45')]({'where':{'id':_0x4bf3d3[_0x05d9('0x42')]['id']}})[_0x05d9('0x25')](handleEntityNotFound(_0x3d4ee1,null))[_0x05d9('0x25')](saveUpdates(_0x4bf3d3[_0x05d9('0x47')],null))[_0x05d9('0x25')](respondWithResult(_0x3d4ee1,null))[_0x05d9('0x48')](handleError(_0x3d4ee1,null));};exports['destroy']=function(_0x1e242e,_0x7db2f){return db[_0x05d9('0x2a')][_0x05d9('0x45')]({'where':{'id':_0x1e242e[_0x05d9('0x42')]['id']}})[_0x05d9('0x25')](handleEntityNotFound(_0x7db2f,null))[_0x05d9('0x25')](removeEntity(_0x7db2f,null))[_0x05d9('0x48')](handleError(_0x7db2f,null));};exports['describe']=function(_0x5183dd,_0xfa1c4a){return db[_0x05d9('0x2a')][_0x05d9('0x49')]()['then'](respondWithResult(_0xfa1c4a,null))['catch'](handleError(_0xfa1c4a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c47b661..d796c63 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 _0x6348=['../../config/logger','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x2fa097,_0x1b3f7f){var _0x159339=function(_0xa187fc){while(--_0xa187fc){_0x2fa097['push'](_0x2fa097['shift']());}};_0x159339(++_0x1b3f7f);}(_0x6348,0xc4));var _0x8634=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0x6348[_0x30f87a];return _0x3a8efc;};'use strict';var _=require(_0x8634('0x0'));var util=require(_0x8634('0x1'));var logger=require(_0x8634('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8634('0x3'));var fs=require('fs');var path=require(_0x8634('0x4'));var rimraf=require('rimraf');var config=require(_0x8634('0x5'));var attributes=require(_0x8634('0x6'));module[_0x8634('0x7')]=function(_0x22a17c,_0x470285){return _0x22a17c[_0x8634('0x8')](_0x8634('0x9'),attributes,{'tableName':_0x8634('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb7d=['exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x8b10d4,_0x547b6d){var _0x3492b2=function(_0xe7c585){while(--_0xe7c585){_0x8b10d4['push'](_0x8b10d4['shift']());}};_0x3492b2(++_0x547b6d);}(_0xdb7d,0x19b));var _0xddb7=function(_0xe0d025,_0x220fa0){_0xe0d025=_0xe0d025-0x0;var _0x2901dd=_0xdb7d[_0xe0d025];return _0x2901dd;};'use strict';var _=require('lodash');var util=require(_0xddb7('0x0'));var logger=require(_0xddb7('0x1'))(_0xddb7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xddb7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddb7('0x4'));var config=require(_0xddb7('0x5'));var attributes=require(_0xddb7('0x6'));module[_0xddb7('0x7')]=function(_0x4564ed,_0x4db261){return _0x4564ed[_0xddb7('0x8')](_0xddb7('0x9'),attributes,{'tableName':_0xddb7('0xa'),'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 4418581..9301022 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 _0xd1d1=['body','options','raw','CreateVoiceTransferReport','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xd1d1,0xee));var _0x1d1d=function(_0x5dcf98,_0x492c03){_0x5dcf98=_0x5dcf98-0x0;var _0x3a900c=_0xd1d1[_0x5dcf98];return _0x3a900c;};'use strict';var _=require(_0x1d1d('0x0'));var util=require(_0x1d1d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d1d('0x2'));var db=require(_0x1d1d('0x3'))['db'];var utils=require(_0x1d1d('0x4'));var logger=require('../../config/logger')(_0x1d1d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d1d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fa388,_0x2432f3,_0x4696a9){return new BPromise(function(_0x45198d,_0x35c456){return client[_0x1d1d('0x7')](_0x2fa388,_0x4696a9)[_0x1d1d('0x8')](function(_0x2291b3){logger[_0x1d1d('0x9')](_0x1d1d('0xa'),_0x2432f3,_0x1d1d('0xb'));logger[_0x1d1d('0xc')](_0x1d1d('0xd'),_0x2432f3,'request\x20sent',JSON[_0x1d1d('0xe')](_0x2291b3));if(_0x2291b3[_0x1d1d('0xf')]){if(_0x2291b3[_0x1d1d('0xf')][_0x1d1d('0x10')]===0x1f4){logger['error'](_0x1d1d('0xa'),_0x2432f3,_0x2291b3[_0x1d1d('0xf')][_0x1d1d('0x11')]);return _0x35c456(_0x2291b3[_0x1d1d('0xf')]['message']);}logger['error'](_0x1d1d('0xa'),_0x2432f3,_0x2291b3['error'][_0x1d1d('0x11')]);return _0x45198d(_0x2291b3[_0x1d1d('0xf')][_0x1d1d('0x11')]);}else{logger[_0x1d1d('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x2432f3,_0x1d1d('0xb'));_0x45198d(_0x2291b3[_0x1d1d('0x12')][_0x1d1d('0x11')]);}})[_0x1d1d('0x13')](function(_0xb8d13f){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2432f3,_0xb8d13f);_0x35c456(_0xb8d13f);});});}exports['CreateVoiceTransferReport']=function(_0x179707){var _0x58340b=this;return new Promise(function(_0x46380a,_0x6cffb0){return db[_0x1d1d('0x14')][_0x1d1d('0x15')](_0x179707[_0x1d1d('0x16')],{'raw':_0x179707[_0x1d1d('0x17')]?_0x179707[_0x1d1d('0x17')][_0x1d1d('0x18')]===undefined?!![]:![]:!![]})[_0x1d1d('0x8')](function(_0x2f00e4){logger[_0x1d1d('0x9')](_0x1d1d('0x19'),_0x179707);logger[_0x1d1d('0xc')](_0x1d1d('0x19'),_0x179707,JSON[_0x1d1d('0xe')](_0x2f00e4));_0x46380a(_0x2f00e4);})[_0x1d1d('0x13')](function(_0x36c143){logger[_0x1d1d('0xf')](_0x1d1d('0x19'),_0x36c143[_0x1d1d('0x11')],_0x179707);_0x6cffb0(_0x58340b[_0x1d1d('0xf')](0x1f4,_0x36c143[_0x1d1d('0x11')]));});});}; \ No newline at end of file +var _0x2662=['../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4827f5,_0x5cc92c){var _0x54104d=function(_0x189039){while(--_0x189039){_0x4827f5['push'](_0x4827f5['shift']());}};_0x54104d(++_0x5cc92c);}(_0x2662,0x13d));var _0x2266=function(_0x6076b8,_0x444d1b){_0x6076b8=_0x6076b8-0x0;var _0x22cb92=_0x2662[_0x6076b8];return _0x22cb92;};'use strict';var _=require(_0x2266('0x0'));var util=require(_0x2266('0x1'));var moment=require(_0x2266('0x2'));var BPromise=require(_0x2266('0x3'));var rs=require(_0x2266('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2266('0x5'))['db'];var utils=require(_0x2266('0x6'));var logger=require(_0x2266('0x7'))(_0x2266('0x8'));var config=require('../../config/environment');var jayson=require(_0x2266('0x9'));var client=jayson[_0x2266('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59755a,_0x2ff682,_0x5a3e6e){return new BPromise(function(_0x332e12,_0x398ff4){return client[_0x2266('0xb')](_0x59755a,_0x5a3e6e)['then'](function(_0x111f6e){logger[_0x2266('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x2ff682,_0x2266('0xd'));logger[_0x2266('0xe')](_0x2266('0xf'),_0x2ff682,'request\x20sent',JSON[_0x2266('0x10')](_0x111f6e));if(_0x111f6e[_0x2266('0x11')]){if(_0x111f6e['error'][_0x2266('0x12')]===0x1f4){logger[_0x2266('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2ff682,_0x111f6e['error'][_0x2266('0x13')]);return _0x398ff4(_0x111f6e[_0x2266('0x11')][_0x2266('0x13')]);}logger[_0x2266('0x11')](_0x2266('0x14'),_0x2ff682,_0x111f6e[_0x2266('0x11')][_0x2266('0x13')]);return _0x332e12(_0x111f6e[_0x2266('0x11')]['message']);}else{logger[_0x2266('0xc')](_0x2266('0x14'),_0x2ff682,_0x2266('0xd'));_0x332e12(_0x111f6e['result'][_0x2266('0x13')]);}})[_0x2266('0x15')](function(_0x10d556){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2ff682,_0x10d556);_0x398ff4(_0x10d556);});});}exports[_0x2266('0x16')]=function(_0x542b46){var _0x5c709=this;return new Promise(function(_0x51347f,_0x4aa57f){return db['VoiceTransferReport'][_0x2266('0x17')](_0x542b46[_0x2266('0x18')],{'raw':_0x542b46[_0x2266('0x19')]?_0x542b46[_0x2266('0x19')][_0x2266('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x188e80){logger['info']('CreateVoiceTransferReport',_0x542b46);logger[_0x2266('0xe')](_0x2266('0x16'),_0x542b46,JSON[_0x2266('0x10')](_0x188e80));_0x51347f(_0x188e80);})[_0x2266('0x15')](function(_0x488013){logger['error'](_0x2266('0x16'),_0x488013[_0x2266('0x13')],_0x542b46);_0x4aa57f(_0x5c709[_0x2266('0x11')](0x1f4,_0x488013[_0x2266('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 8df9380..9115270 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 _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0x483d14,_0x4de57a){var _0x447a7b=function(_0x1f21f4){while(--_0x1f21f4){_0x483d14['push'](_0x483d14['shift']());}};_0x447a7b(++_0x4de57a);}(_0xaa88,0x137));var _0x8aa8=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0xaa88[_0x1d9163];return _0xb42197;};'use strict';var express=require(_0x8aa8('0x0'));var router=express[_0x8aa8('0x1')]();var auth=require(_0x8aa8('0x2'));var controller=require(_0x8aa8('0x3'));router['post'](_0x8aa8('0x4'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x7')]);router[_0x8aa8('0x8')](_0x8aa8('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x8aa8('0xa')]);router['post'](_0x8aa8('0xb'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0xc')]);router['post'](_0x8aa8('0xd'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['hold']);router[_0x8aa8('0x8')](_0x8aa8('0xe'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['unhold']);router[_0x8aa8('0x8')](_0x8aa8('0xf'),auth['isAuthenticated'](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x8')]('/transfer',auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x91a7=['/originate','isWebrtcLicence','/hangup','isAuthenticated','hangup','/answer','answer','post','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller'];(function(_0x4bd710,_0x237f88){var _0x30f143=function(_0x5ac459){while(--_0x5ac459){_0x4bd710['push'](_0x4bd710['shift']());}};_0x30f143(++_0x237f88);}(_0x91a7,0xe7));var _0x791a=function(_0x5b401b,_0x4144c5){_0x5b401b=_0x5b401b-0x0;var _0x10b378=_0x91a7[_0x5b401b];return _0x10b378;};'use strict';var express=require('express');var router=express[_0x791a('0x0')]();var auth=require(_0x791a('0x1'));var controller=require(_0x791a('0x2'));router['post'](_0x791a('0x3'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller['originate']);router['post'](_0x791a('0x5'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x7')]);router['post'](_0x791a('0x8'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x9')]);router[_0x791a('0xa')](_0x791a('0xb'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['hold']);router[_0x791a('0xa')](_0x791a('0xc'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller[_0x791a('0xd')]);router[_0x791a('0xa')](_0x791a('0xe'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['calls']);router['post'](_0x791a('0xf'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x10')]);module[_0x791a('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 383e72e..f29b931 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 _0xc3fe=['sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','status','json','userId','callNumber','callbackUrl','format','user:%s','webbar:originate','hangup','hangup\x20fired:','entityFound:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','transfer','transferNumber','webbar:transfer','path','lodash','../../mysqldb','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','defaults','redis','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','send','request','then','message','catch','findOne','agent','VoiceChannels','all','filter','UserId','sessionId','length'];(function(_0x4ae974,_0x3ce884){var _0x241a27=function(_0x39c3ee){while(--_0x39c3ee){_0x4ae974['push'](_0x4ae974['shift']());}};_0x241a27(++_0x3ce884);}(_0xc3fe,0xff));var _0xec3f=function(_0x28eae0,_0x4ed189){_0x28eae0=_0x28eae0-0x0;var _0x7f4d81=_0xc3fe[_0x28eae0];return _0x7f4d81;};'use strict';var path=require(_0xec3f('0x0'));var fs=require('fs');var _=require(_0xec3f('0x1'));var db=require(_0xec3f('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xec3f('0x3'));var BPromise=require(_0xec3f('0x4'));var jayson=require(_0xec3f('0x5'));var amiClient=jayson['client'][_0xec3f('0x6')]({'port':0x232a});var logger=require(_0xec3f('0x7'))(_0xec3f('0x8'));var Redis=require('ioredis');config['redis']=_[_0xec3f('0x9')](config[_0xec3f('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xec3f('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'callNumber':{'type':_0xec3f('0xd'),'required':[!![],_0xec3f('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xec3f('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':_0xec3f('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':_0xec3f('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0xec3f('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xec3f('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xec3f('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xec3f('0xc')]}});function emit(_0x10ff81,_0x5bd7c0,_0x225edd){logger[_0xec3f('0x10')](_0x10ff81,_0x5bd7c0,JSON[_0xec3f('0x11')](_0x225edd));io['to'](_0x10ff81)[_0xec3f('0x12')](_0x5bd7c0,_0x225edd);}function handleError(_0x54d20c){return function(_0x7805c){console[_0xec3f('0x13')](_0xec3f('0x14'),_0x7805c,_0x7805c instanceof RangeError);logger[_0xec3f('0x15')](_0x7805c[_0xec3f('0x16')]);if(_0x7805c instanceof RangeError){if(_0x7805c['name']){delete _0x7805c[_0xec3f('0x17')];}_0x54d20c['status'](0x194)[_0xec3f('0x18')](_0x7805c);}else{if(_0x7805c[_0xec3f('0x17')]){delete _0x7805c[_0xec3f('0x17')];}_0x54d20c['status'](0x1f4)[_0xec3f('0x18')](_0x7805c);}};}function checkError(){return function(_0x21fda1){if(!_0x21fda1){throw new RangeError('NotFound');}return _0x21fda1;};}function respondWithRpcPromise(_0x35fc70,_0x317805){return new BPromise(function(_0x1f173f,_0x395b9a){var _0x4d9598=amiClient;return _0x4d9598[_0xec3f('0x19')](_0x35fc70,_0x317805)[_0xec3f('0x1a')](function(_0x2f45bb){if(_0x2f45bb['error']){if(_0x2f45bb[_0xec3f('0x15')]['code']===0x1f4){return _0x395b9a(_0x2f45bb[_0xec3f('0x15')]['message']);}return _0x1f173f(_0x2f45bb['error'][_0xec3f('0x1b')]);}else{_0x1f173f(_0x2f45bb['result']);}})[_0xec3f('0x1c')](function(_0xa12054){_0x395b9a(_0xa12054);});});}function getAgent(_0x31c7ff){return db['User'][_0xec3f('0x1d')]({'where':{'id':_0x31c7ff,'role':_0xec3f('0x1e')}})['then'](checkError());}function getAgentCheckSession(_0x53cc0d,_0x3e5244){return new BPromise(function(_0x48e166,_0x1300a8){var _0x1b3155=respondWithRpcPromise(_0xec3f('0x1f'));var _0x2eac8d=getAgent(_0x53cc0d);Promise[_0xec3f('0x20')]([_0x1b3155,_0x2eac8d])[_0xec3f('0x1a')](function(_0x2f2d15){var _0x237134=_0x2f2d15[0x0];var _0x56217e=_0x2f2d15[0x1];var _0x1c2a9c=_[_0xec3f('0x21')](_0x237134['rows'],function(_0x91c11a){return _0x91c11a[_0xec3f('0x22')]==_0x56217e['id']&&_0x91c11a[_0xec3f('0x23')]==_0x3e5244;});if(_0x1c2a9c[_0xec3f('0x24')]==0x1){_0x48e166(_0x56217e);}else{_0x1300a8(new RangeError(_0xec3f('0x25')+_0x3e5244+_0xec3f('0x26')));}});});}exports[_0xec3f('0x27')]=function(_0x29af36,_0x32a522){logger[_0xec3f('0x10')](_0xec3f('0x28'),_0x29af36[_0xec3f('0x29')]);var _0x3d95d4=originateValidation[_0xec3f('0x2a')](_0x29af36[_0xec3f('0x29')]);if(_0x3d95d4['length']>0x0){return _0x32a522[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x3d95d4);}var _0x37504a=_0x29af36[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x598fdc=_0x29af36[_0xec3f('0x29')][_0xec3f('0x2e')];var _0x20b655=_0x29af36['body']['callerId'];var _0x1aded9=_0x29af36['body'][_0xec3f('0x2f')];return getAgent(_0x37504a)['then'](function(_0x131839){logger['info']('entityFound:',_0x131839[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x131839[_0xec3f('0x17')]),_0xec3f('0x32'),{'callNumber':_0x598fdc,'callerId':_0x20b655,'callbackUrl':_0x1aded9});return _0x32a522[_0xec3f('0x2b')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x32a522));};exports[_0xec3f('0x33')]=function(_0x3bff24,_0xbbb4f9){logger[_0xec3f('0x10')](_0xec3f('0x34'),_0x3bff24[_0xec3f('0x29')]);var _0x4bd7a5=hangupValidation[_0xec3f('0x2a')](_0x3bff24['body']);if(_0x4bd7a5[_0xec3f('0x24')]>0x0){return _0xbbb4f9[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x4bd7a5);}var _0x2d91db=_0x3bff24[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x54fbb9=_0x3bff24[_0xec3f('0x29')][_0xec3f('0x23')];return getAgent(_0x2d91db)[_0xec3f('0x1a')](function(_0x38a9e3){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x38a9e3['name']);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x38a9e3['name']),_0xec3f('0x36'),{'sessionId':_0x54fbb9});return _0xbbb4f9[_0xec3f('0x2b')](0xc8)['json']({'error':![],'message':_0xec3f('0x37')});})[_0xec3f('0x1c')](handleError(_0xbbb4f9));};exports[_0xec3f('0x38')]=function(_0xe96e53,_0xef42fc){logger[_0xec3f('0x10')]('answer\x20fired:',_0xe96e53[_0xec3f('0x29')]);var _0x386e96=answerValidation[_0xec3f('0x2a')](_0xe96e53[_0xec3f('0x29')]);if(_0x386e96[_0xec3f('0x24')]>0x0){return _0xef42fc[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x386e96);}var _0x18c560=_0xe96e53[_0xec3f('0x29')]['userId'];var _0x8d0f18=_0xe96e53['body'][_0xec3f('0x23')];return getAgent(_0x18c560)[_0xec3f('0x1a')](function(_0x33beca){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x33beca[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x33beca[_0xec3f('0x17')]),_0xec3f('0x39'),{'sessionId':_0x8d0f18});return _0xef42fc[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xec3f('0x1c')](handleError(_0xef42fc));};exports[_0xec3f('0x3a')]=function(_0x531c21,_0x2e21c7){logger[_0xec3f('0x10')](_0xec3f('0x3b'),_0x531c21[_0xec3f('0x29')]);var _0x50039e=holdValidation['validate'](_0x531c21[_0xec3f('0x29')]);if(_0x50039e[_0xec3f('0x24')]>0x0){return _0x2e21c7['status'](0x190)[_0xec3f('0x2c')](_0x50039e);}var _0x28acd1=_0x531c21[_0xec3f('0x29')]['userId'];var _0x377ff7=_0x531c21['body']['sessionId'];return getAgent(_0x28acd1)['then'](function(_0x97c57d){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x97c57d[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x97c57d['name']),_0xec3f('0x3c'),{'sessionId':_0x377ff7});return _0x2e21c7[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':_0xec3f('0x3d')});})[_0xec3f('0x1c')](handleError(_0x2e21c7));};exports[_0xec3f('0x3e')]=function(_0x515bf2,_0x2ab636){logger['info'](_0xec3f('0x3f'),_0x515bf2['body']);var _0x425d90=unholdValidation['validate'](_0x515bf2[_0xec3f('0x29')]);if(_0x425d90[_0xec3f('0x24')]>0x0){return _0x2ab636[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x425d90);}var _0x5603c8=_0x515bf2[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x10eb47=_0x515bf2['body'][_0xec3f('0x23')];return getAgent(_0x5603c8)[_0xec3f('0x1a')](function(_0x4daab6){logger[_0xec3f('0x10')]('entityFound:',_0x4daab6[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x4daab6['name']),_0xec3f('0x40'),{'sessionId':_0x10eb47});return _0x2ab636['status'](0xc8)[_0xec3f('0x2c')]({'error':![],'message':_0xec3f('0x41')});})[_0xec3f('0x1c')](handleError(_0x2ab636));};exports[_0xec3f('0x42')]=function(_0x2c2b81,_0x24ca77){logger['info'](_0xec3f('0x43'),_0x24ca77['body']);var _0x13825e=callsValidation[_0xec3f('0x2a')](_0x2c2b81[_0xec3f('0x29')]);if(_0x13825e[_0xec3f('0x24')]>0x0){return _0x24ca77[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x13825e);}var _0x1a9073=_0x2c2b81['body'][_0xec3f('0x2d')];var _0x218682=respondWithRpcPromise(_0xec3f('0x1f'));var _0x2e56c8=getAgent(_0x1a9073);return Promise[_0xec3f('0x20')]([_0x218682,_0x2e56c8])[_0xec3f('0x1a')](function(_0x5269b7){var _0x31eb9f=_0x5269b7[0x0];var _0x2a5a1f=_0x5269b7[0x1];var _0x2dc0b8=_[_0xec3f('0x21')](_0x31eb9f[_0xec3f('0x44')],function(_0x59d4cd){return _0x59d4cd[_0xec3f('0x22')]==_0x2a5a1f['id'];});return _0x24ca77[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'count':_0x2dc0b8['length'],'rows':_0x2dc0b8});})[_0xec3f('0x1c')](handleError(_0x24ca77));};exports[_0xec3f('0x45')]=function(_0xced939,_0x5526f5){logger['info']('conference\x20fired:',_0xced939[_0xec3f('0x29')]);var _0x32ecf3=conferenceValidation[_0xec3f('0x2a')](_0xced939['body']);if(_0x32ecf3['length']>0x0){return _0x5526f5[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x32ecf3);}var _0xc69314=_0xced939[_0xec3f('0x29')][_0xec3f('0x2d')];return getAgent(_0xc69314)[_0xec3f('0x1a')](function(_0x4e4361){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x4e4361[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x4e4361['name']),'webbar:conference');return _0x5526f5[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x5526f5));};exports[_0xec3f('0x46')]=function(_0xfef5e8,_0x5247db){logger[_0xec3f('0x10')]('transfer\x20fired:',_0xfef5e8[_0xec3f('0x29')]);var _0x17ef99=transferValidation[_0xec3f('0x2a')](_0xfef5e8[_0xec3f('0x29')]);if(_0x17ef99['length']>0x0){return _0x5247db[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x17ef99);}var _0x557a8d=_0xfef5e8['body'][_0xec3f('0x2d')];var _0x27c38d=_0xfef5e8['body']['sessionId'];var _0x1f8041=_0xfef5e8[_0xec3f('0x29')][_0xec3f('0x47')];return getAgent(_0x557a8d)['then'](function(_0x53502c){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x53502c[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x53502c[_0xec3f('0x17')]),_0xec3f('0x48'),{'sessionId':_0x27c38d,'transferNumber':_0x1f8041});return _0x5247db[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x5247db));}; \ No newline at end of file +var _0xa8a8=['webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','findOne','agent','all','filter','rows','UserId','sessionId','length','sessionId\x20','body','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','json','userId','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','calls','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber'];(function(_0x4d2a45,_0x9a0502){var _0x4541bf=function(_0x2fa373){while(--_0x2fa373){_0x4d2a45['push'](_0x4d2a45['shift']());}};_0x4541bf(++_0x9a0502);}(_0xa8a8,0xec));var _0x8a8a=function(_0x5a0bf6,_0x543385){_0x5a0bf6=_0x5a0bf6-0x0;var _0x48bbea=_0xa8a8[_0x5a0bf6];return _0x48bbea;};'use strict';var path=require(_0x8a8a('0x0'));var fs=require('fs');var _=require(_0x8a8a('0x1'));var db=require(_0x8a8a('0x2'))['db'];var config=require(_0x8a8a('0x3'));var util=require('util');var BPromise=require(_0x8a8a('0x4'));var jayson=require(_0x8a8a('0x5'));var amiClient=jayson[_0x8a8a('0x6')][_0x8a8a('0x7')]({'port':0x232a});var logger=require(_0x8a8a('0x8'))(_0x8a8a('0x9'));var Redis=require(_0x8a8a('0xa'));config[_0x8a8a('0xb')]=_[_0x8a8a('0xc')](config[_0x8a8a('0xb')],{'host':_0x8a8a('0xd'),'port':0x18eb});var io=require(_0x8a8a('0xe'))(new Redis(config[_0x8a8a('0xb')]));var Schema=require(_0x8a8a('0xf'));var originateValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x8a8a('0x11')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x8a8a('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8a8a('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':_0x8a8a('0x12'),'required':[!![],_0x8a8a('0x14')]},'transferNumber':{'type':'string','required':[!![],_0x8a8a('0x15')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':_0x8a8a('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':_0x8a8a('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a8a('0x13')]}});function emit(_0x568b83,_0x1f36b6,_0x3046ae){logger[_0x8a8a('0x16')](_0x568b83,_0x1f36b6,JSON[_0x8a8a('0x17')](_0x3046ae));io['to'](_0x568b83)[_0x8a8a('0x18')](_0x1f36b6,_0x3046ae);}function handleError(_0x5dd616){return function(_0x9d55f9){console[_0x8a8a('0x19')](_0x8a8a('0x1a'),_0x9d55f9,_0x9d55f9 instanceof RangeError);logger[_0x8a8a('0x1b')](_0x9d55f9[_0x8a8a('0x1c')]);if(_0x9d55f9 instanceof RangeError){if(_0x9d55f9[_0x8a8a('0x1d')]){delete _0x9d55f9['name'];}_0x5dd616['status'](0x194)['send'](_0x9d55f9);}else{if(_0x9d55f9['name']){delete _0x9d55f9['name'];}_0x5dd616[_0x8a8a('0x1e')](0x1f4)[_0x8a8a('0x1f')](_0x9d55f9);}};}function checkError(){return function(_0xe0f449){if(!_0xe0f449){throw new RangeError(_0x8a8a('0x20'));}return _0xe0f449;};}function respondWithRpcPromise(_0x22ebd4,_0x2f6af2){return new BPromise(function(_0x242bac,_0xe0321c){var _0x25d5d4=amiClient;return _0x25d5d4[_0x8a8a('0x21')](_0x22ebd4,_0x2f6af2)[_0x8a8a('0x22')](function(_0x3aa2bb){if(_0x3aa2bb[_0x8a8a('0x1b')]){if(_0x3aa2bb[_0x8a8a('0x1b')][_0x8a8a('0x23')]===0x1f4){return _0xe0321c(_0x3aa2bb['error'][_0x8a8a('0x24')]);}return _0x242bac(_0x3aa2bb[_0x8a8a('0x1b')][_0x8a8a('0x24')]);}else{_0x242bac(_0x3aa2bb[_0x8a8a('0x25')]);}})[_0x8a8a('0x26')](function(_0x251315){_0xe0321c(_0x251315);});});}function getAgent(_0x3aa46d){return db['User'][_0x8a8a('0x27')]({'where':{'id':_0x3aa46d,'role':_0x8a8a('0x28')}})[_0x8a8a('0x22')](checkError());}function getAgentCheckSession(_0x54ff7e,_0x58f42b){return new BPromise(function(_0x2dafcd,_0x129d11){var _0x5c70bd=respondWithRpcPromise('VoiceChannels');var _0x4b3bc5=getAgent(_0x54ff7e);Promise[_0x8a8a('0x29')]([_0x5c70bd,_0x4b3bc5])['then'](function(_0x10b916){var _0xdd6221=_0x10b916[0x0];var _0x49ea81=_0x10b916[0x1];var _0x36c7f8=_[_0x8a8a('0x2a')](_0xdd6221[_0x8a8a('0x2b')],function(_0x8df0cb){return _0x8df0cb[_0x8a8a('0x2c')]==_0x49ea81['id']&&_0x8df0cb[_0x8a8a('0x2d')]==_0x58f42b;});if(_0x36c7f8[_0x8a8a('0x2e')]==0x1){_0x2dafcd(_0x49ea81);}else{_0x129d11(new RangeError(_0x8a8a('0x2f')+_0x58f42b+'\x20not\x20found!'));}});});}exports['originate']=function(_0x56e79e,_0x2a00a7){logger[_0x8a8a('0x16')]('originate\x20fired:',_0x56e79e[_0x8a8a('0x30')]);var _0x304e83=originateValidation['validate'](_0x56e79e[_0x8a8a('0x30')]);if(_0x304e83[_0x8a8a('0x2e')]>0x0){return _0x2a00a7[_0x8a8a('0x1e')](0x190)['json'](_0x304e83);}var _0x5bee53=_0x56e79e[_0x8a8a('0x30')]['userId'];var _0x2a3198=_0x56e79e[_0x8a8a('0x30')][_0x8a8a('0x31')];var _0x196698=_0x56e79e[_0x8a8a('0x30')][_0x8a8a('0x32')];var _0x37ce45=_0x56e79e[_0x8a8a('0x30')][_0x8a8a('0x33')];return getAgent(_0x5bee53)[_0x8a8a('0x22')](function(_0x27de26){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x27de26[_0x8a8a('0x1d')]);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x27de26[_0x8a8a('0x1d')]),_0x8a8a('0x37'),{'callNumber':_0x2a3198,'callerId':_0x196698,'callbackUrl':_0x37ce45});return _0x2a00a7['status'](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x8a8a('0x26')](handleError(_0x2a00a7));};exports[_0x8a8a('0x38')]=function(_0x376de3,_0x117a5c){logger[_0x8a8a('0x16')]('hangup\x20fired:',_0x376de3['body']);var _0x8d8481=hangupValidation['validate'](_0x376de3[_0x8a8a('0x30')]);if(_0x8d8481['length']>0x0){return _0x117a5c['status'](0x190)[_0x8a8a('0x39')](_0x8d8481);}var _0x1ac761=_0x376de3[_0x8a8a('0x30')][_0x8a8a('0x3a')];var _0x31307c=_0x376de3[_0x8a8a('0x30')][_0x8a8a('0x2d')];return getAgent(_0x1ac761)['then'](function(_0x40d509){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x40d509['name']);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x40d509[_0x8a8a('0x1d')]),'webbar:hangup',{'sessionId':_0x31307c});return _0x117a5c[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':_0x8a8a('0x3b')});})[_0x8a8a('0x26')](handleError(_0x117a5c));};exports[_0x8a8a('0x3c')]=function(_0x3e5b15,_0x4ffdd9){logger['info'](_0x8a8a('0x3d'),_0x3e5b15['body']);var _0x13e0d4=answerValidation[_0x8a8a('0xf')](_0x3e5b15['body']);if(_0x13e0d4['length']>0x0){return _0x4ffdd9[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x13e0d4);}var _0x41d986=_0x3e5b15[_0x8a8a('0x30')]['userId'];var _0x103223=_0x3e5b15['body'][_0x8a8a('0x2d')];return getAgent(_0x41d986)[_0x8a8a('0x22')](function(_0x4c19ff){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x4c19ff[_0x8a8a('0x1d')]);emit(util['format'](_0x8a8a('0x36'),_0x4c19ff[_0x8a8a('0x1d')]),_0x8a8a('0x3e'),{'sessionId':_0x103223});return _0x4ffdd9['status'](0xc8)['json']({'error':![],'message':_0x8a8a('0x3f')});})[_0x8a8a('0x26')](handleError(_0x4ffdd9));};exports[_0x8a8a('0x40')]=function(_0x5c6c98,_0x18449b){logger[_0x8a8a('0x16')](_0x8a8a('0x41'),_0x5c6c98[_0x8a8a('0x30')]);var _0x2d4c11=holdValidation[_0x8a8a('0xf')](_0x5c6c98[_0x8a8a('0x30')]);if(_0x2d4c11[_0x8a8a('0x2e')]>0x0){return _0x18449b[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x2d4c11);}var _0x150b42=_0x5c6c98['body'][_0x8a8a('0x3a')];var _0x3ba9d9=_0x5c6c98[_0x8a8a('0x30')][_0x8a8a('0x2d')];return getAgent(_0x150b42)[_0x8a8a('0x22')](function(_0x2e22b0){logger['info'](_0x8a8a('0x34'),_0x2e22b0[_0x8a8a('0x1d')]);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x2e22b0['name']),_0x8a8a('0x42'),{'sessionId':_0x3ba9d9});return _0x18449b[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x18449b));};exports[_0x8a8a('0x43')]=function(_0x39a8e0,_0xf4b6ee){logger[_0x8a8a('0x16')](_0x8a8a('0x44'),_0x39a8e0[_0x8a8a('0x30')]);var _0x1d1b5c=unholdValidation[_0x8a8a('0xf')](_0x39a8e0[_0x8a8a('0x30')]);if(_0x1d1b5c['length']>0x0){return _0xf4b6ee['status'](0x190)[_0x8a8a('0x39')](_0x1d1b5c);}var _0x10f689=_0x39a8e0['body']['userId'];var _0x171463=_0x39a8e0['body'][_0x8a8a('0x2d')];return getAgent(_0x10f689)['then'](function(_0x4642d5){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x4642d5[_0x8a8a('0x1d')]);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x4642d5[_0x8a8a('0x1d')]),_0x8a8a('0x45'),{'sessionId':_0x171463});return _0xf4b6ee[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':'unhold\x20executed!'});})[_0x8a8a('0x26')](handleError(_0xf4b6ee));};exports[_0x8a8a('0x46')]=function(_0x32a4ed,_0x1e3bf5){logger[_0x8a8a('0x16')]('calls\x20fired:',_0x1e3bf5[_0x8a8a('0x30')]);var _0x140673=callsValidation['validate'](_0x32a4ed['body']);if(_0x140673[_0x8a8a('0x2e')]>0x0){return _0x1e3bf5[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x140673);}var _0x2ba3bf=_0x32a4ed[_0x8a8a('0x30')][_0x8a8a('0x3a')];var _0x5ed59c=respondWithRpcPromise('VoiceChannels');var _0x495371=getAgent(_0x2ba3bf);return Promise[_0x8a8a('0x29')]([_0x5ed59c,_0x495371])['then'](function(_0x3984dd){var _0xb84ee7=_0x3984dd[0x0];var _0x4e1ca8=_0x3984dd[0x1];var _0x225801=_[_0x8a8a('0x2a')](_0xb84ee7[_0x8a8a('0x2b')],function(_0x119fb5){return _0x119fb5['UserId']==_0x4e1ca8['id'];});return _0x1e3bf5[_0x8a8a('0x1e')](0xc8)['json']({'count':_0x225801[_0x8a8a('0x2e')],'rows':_0x225801});})[_0x8a8a('0x26')](handleError(_0x1e3bf5));};exports['conference']=function(_0x254e4c,_0x101543){logger[_0x8a8a('0x16')](_0x8a8a('0x47'),_0x254e4c['body']);var _0x2b9e36=conferenceValidation[_0x8a8a('0xf')](_0x254e4c[_0x8a8a('0x30')]);if(_0x2b9e36['length']>0x0){return _0x101543['status'](0x190)[_0x8a8a('0x39')](_0x2b9e36);}var _0x4a18fb=_0x254e4c['body']['userId'];return getAgent(_0x4a18fb)[_0x8a8a('0x22')](function(_0x7d79a4){logger['info'](_0x8a8a('0x34'),_0x7d79a4['name']);emit(util['format'](_0x8a8a('0x36'),_0x7d79a4[_0x8a8a('0x1d')]),'webbar:conference');return _0x101543[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':_0x8a8a('0x48')});})[_0x8a8a('0x26')](handleError(_0x101543));};exports[_0x8a8a('0x49')]=function(_0x126dba,_0x4c8272){logger[_0x8a8a('0x16')](_0x8a8a('0x4a'),_0x126dba['body']);var _0x2ce579=transferValidation[_0x8a8a('0xf')](_0x126dba[_0x8a8a('0x30')]);if(_0x2ce579[_0x8a8a('0x2e')]>0x0){return _0x4c8272[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x2ce579);}var _0x81c1dd=_0x126dba[_0x8a8a('0x30')][_0x8a8a('0x3a')];var _0x176ad3=_0x126dba['body'][_0x8a8a('0x2d')];var _0x2f7537=_0x126dba['body'][_0x8a8a('0x4b')];return getAgent(_0x81c1dd)[_0x8a8a('0x22')](function(_0x2640e3){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x2640e3['name']);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x2640e3[_0x8a8a('0x1d')]),_0x8a8a('0x4c'),{'sessionId':_0x176ad3,'transferNumber':_0x2f7537});return _0x4c8272[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':_0x8a8a('0x4d')});})['catch'](handleError(_0x4c8272));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index ee00cfd..68611a7 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 _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0xe63091,_0x4c2ea0){var _0x551016=function(_0x4d6f6f){while(--_0x4d6f6f){_0xe63091['push'](_0xe63091['shift']());}};_0x551016(++_0x4c2ea0);}(_0xda2d,0x102));var _0xdda2=function(_0x39fdb3,_0x27f519){_0x39fdb3=_0x39fdb3-0x0;var _0x7edcf2=_0xda2d[_0x39fdb3];return _0x7edcf2;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file +var _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x270ec7,_0x5e09e5){var _0x4c8770=function(_0x28078d){while(--_0x28078d){_0x270ec7['push'](_0x270ec7['shift']());}};_0x4c8770(++_0x5e09e5);}(_0x0b0e,0x187));var _0xe0b0=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x0b0e[_0xac0de1];return _0x1c1995;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b8eb572..340dcaa 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 _0x278f=['STRING','generate','ENUM','twilio','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0xd4b4ce,_0x148799){var _0x44dc6f=function(_0x4e103c){while(--_0x4e103c){_0xd4b4ce['push'](_0xd4b4ce['shift']());}};_0x44dc6f(++_0x148799);}(_0x278f,0x6c));var _0xf278=function(_0x2fe8eb,_0x32c380){_0x2fe8eb=_0x2fe8eb-0x0;var _0x3d8bec=_0x278f[_0x2fe8eb];return _0x3d8bec;};'use strict';var Sequelize=require(_0xf278('0x0'));var rs=require(_0xf278('0x1'));module[_0xf278('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf278('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xf278('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf278('0x5')]();}},'phone':{'type':Sequelize[_0xf278('0x4')]},'type':{'type':Sequelize[_0xf278('0x6')](_0xf278('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0xf278('0x4')]},'baseUrl':{'type':Sequelize[_0xf278('0x4')]},'authToken':{'type':Sequelize[_0xf278('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf278('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf278('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf278('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf278('0x9')],'comment':_0xf278('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![],'comment':_0xf278('0xb'),'set':function(_0x1921c4){if(!_0x1921c4){this[_0xf278('0xc')]('mandatoryDispositionPauseId',null);}this[_0xf278('0xc')](_0xf278('0xd'),_0x1921c4);}},'description':{'type':Sequelize[_0xf278('0x4')]}}; \ No newline at end of file +var _0x2385=['STRING','twilio','sinch','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0x12be6d,_0x340a27){var _0x52981f=function(_0x39578f){while(--_0x39578f){_0x12be6d['push'](_0x12be6d['shift']());}};_0x52981f(++_0x340a27);}(_0x2385,0xb2));var _0x5238=function(_0x11dd7d,_0x484e2b){_0x11dd7d=_0x11dd7d-0x0;var _0x197c3d=_0x2385[_0x11dd7d];return _0x197c3d;};'use strict';var Sequelize=require(_0x5238('0x0'));var rs=require(_0x5238('0x1'));module[_0x5238('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x5238('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5238('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x5238('0x4')]},'type':{'type':Sequelize['ENUM'](_0x5238('0x5'),_0x5238('0x6'))},'accountSid':{'type':Sequelize[_0x5238('0x4')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x5238('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5238('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5238('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5238('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5238('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5238('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5238('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5238('0x7')],'defaultValue':![],'comment':_0x5238('0x9'),'set':function(_0x5d4724){if(!_0x5d4724){this[_0x5238('0xa')](_0x5238('0xb'),null);}this[_0x5238('0xa')](_0x5238('0xc'),_0x5d4724);}},'description':{'type':Sequelize[_0x5238('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index e59a1aa..fdd98de 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 _0xd8f9=['sinch','statuses','state','read','WhatsappMessage','timestamp','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','messageId','MessageSid','notifications','message_id','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','list','Contacts','contact','WhatsappInteraction','interaction','created','applications','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','text/xml','\x0a','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','WhatsappAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','update','find','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','rawAttributes','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','removeAgents','userWhatsappAccount:remove','emit','getAgents','User','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','finally','getApplications','notify','Applications'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd8f9,0x1c5));var _0x9d8f=function(_0x46685e,_0x4a6c5d){_0x46685e=_0x46685e-0x0;var _0x5492be=_0xd8f9[_0x46685e];return _0x5492be;};'use strict';var emlformat=require(_0x9d8f('0x0'));var rimraf=require(_0x9d8f('0x1'));var zipdir=require(_0x9d8f('0x2'));var jsonpatch=require(_0x9d8f('0x3'));var rp=require(_0x9d8f('0x4'));var moment=require(_0x9d8f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d8f('0x6'));var path=require(_0x9d8f('0x7'));var sox=require(_0x9d8f('0x8'));var csv=require(_0x9d8f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d8f('0xa'));var _=require(_0x9d8f('0xb'));var squel=require(_0x9d8f('0xc'));var crypto=require(_0x9d8f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d8f('0xe'));var toCsv=require(_0x9d8f('0x9'));var querystring=require('querystring');var Papa=require(_0x9d8f('0xf'));var Redis=require(_0x9d8f('0x10'));var authService=require(_0x9d8f('0x11'));var qs=require(_0x9d8f('0x12'));var as=require(_0x9d8f('0x13'));var hardwareService=require(_0x9d8f('0x14'));var logger=require(_0x9d8f('0x15'))(_0x9d8f('0x16'));var utils=require(_0x9d8f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9d8f('0x18'));var db=require(_0x9d8f('0x19'))['db'];config[_0x9d8f('0x1a')]=_[_0x9d8f('0x1b')](config[_0x9d8f('0x1a')],{'host':_0x9d8f('0x1c'),'port':0x18eb});var socket=require(_0x9d8f('0x1d'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x9d8f('0x1e')](socket);var jayson=require(_0x9d8f('0x1f'));var client=jayson[_0x9d8f('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3eef07,_0x791211,_0x3e334f,_0x4618f1){return new BPromise(function(_0x313f13,_0x528dce){var _0x351d06=_0x4618f1||client;return _0x351d06['request'](_0x3eef07,_0x3e334f)[_0x9d8f('0x21')](function(_0x4d600d){logger[_0x9d8f('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x791211,'request\x20sent');logger[_0x9d8f('0x23')](_0x9d8f('0x24'),_0x791211,_0x9d8f('0x25'),JSON['stringify'](_0x4d600d));if(_0x4d600d['error']){if(_0x4d600d['error']['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x791211,_0x4d600d[_0x9d8f('0x26')]['message']);return _0x528dce(_0x4d600d[_0x9d8f('0x26')][_0x9d8f('0x27')]);}logger[_0x9d8f('0x26')](_0x9d8f('0x28'),_0x791211,_0x4d600d[_0x9d8f('0x26')]['message']);return _0x313f13(_0x4d600d[_0x9d8f('0x26')][_0x9d8f('0x27')]);}else{logger[_0x9d8f('0x22')](_0x9d8f('0x28'),_0x791211,_0x9d8f('0x25'));_0x313f13(_0x4d600d[_0x9d8f('0x29')][_0x9d8f('0x27')]);}})[_0x9d8f('0x2a')](function(_0x4c8c79){logger[_0x9d8f('0x26')](_0x9d8f('0x28'),_0x791211,_0x4c8c79);_0x528dce(_0x4c8c79);});});}function respondWithStatusCode(_0x65852a,_0x4ba8a2){_0x4ba8a2=_0x4ba8a2||0xcc;return function(_0x11112c){if(_0x11112c){return _0x65852a[_0x9d8f('0x2b')](_0x4ba8a2);}return _0x65852a[_0x9d8f('0x2c')](_0x4ba8a2)[_0x9d8f('0x2d')]();};}function respondWithResult(_0x59be6e,_0x708e01){_0x708e01=_0x708e01||0xc8;return function(_0x5ad301){if(_0x5ad301){return _0x59be6e['status'](_0x708e01)[_0x9d8f('0x2e')](_0x5ad301);}};}function respondWithFilteredResult(_0x48b406,_0x5b168f){return function(_0x5fd00){if(_0x5fd00){var _0x41b388=typeof _0x5b168f[_0x9d8f('0x2f')]===_0x9d8f('0x30')&&typeof _0x5b168f[_0x9d8f('0x31')]===_0x9d8f('0x30');var _0x15b3fe=_0x5fd00[_0x9d8f('0x32')];var _0x1c8b11=_0x41b388?0x0:_0x5b168f[_0x9d8f('0x2f')];var _0x37a4a9=_0x41b388?_0x5fd00['count']:_0x5b168f[_0x9d8f('0x2f')]+_0x5b168f['limit'];var _0x1d9016;if(_0x37a4a9>=_0x15b3fe){_0x37a4a9=_0x15b3fe;_0x1d9016=0xc8;}else{_0x1d9016=0xce;}_0x48b406[_0x9d8f('0x2c')](_0x1d9016);return _0x48b406['set'](_0x9d8f('0x33'),_0x1c8b11+'-'+_0x37a4a9+'/'+_0x15b3fe)[_0x9d8f('0x2e')](_0x5fd00);}return null;};}function patchUpdates(_0x3c4a32){return function(_0x259a9c){try{jsonpatch[_0x9d8f('0x34')](_0x259a9c,_0x3c4a32,!![]);}catch(_0x6c573f){return BPromise['reject'](_0x6c573f);}return _0x259a9c['save']();};}function saveUpdates(_0x1dba5a,_0x103b34){return function(_0x166ea2){if(_0x166ea2){return _0x166ea2['update'](_0x1dba5a)[_0x9d8f('0x21')](function(_0x22ed57){return _0x22ed57;});}return null;};}function removeEntity(_0x17dfd0,_0x5e2959){return function(_0x496d9e){if(_0x496d9e){return _0x496d9e[_0x9d8f('0x35')]()[_0x9d8f('0x21')](function(){var _0x5baedf=_0x496d9e[_0x9d8f('0x36')]({'plain':!![]});var _0x3b8f76=_0x9d8f('0x37');return db[_0x9d8f('0x38')][_0x9d8f('0x35')]({'where':{'type':_0x3b8f76,'resourceId':_0x5baedf['id']}})[_0x9d8f('0x21')](function(){return _0x496d9e;});})[_0x9d8f('0x21')](function(){_0x17dfd0[_0x9d8f('0x2c')](0xcc)[_0x9d8f('0x2d')]();});}};}function handleEntityNotFound(_0xda007b,_0x2a4a77){return function(_0xa8cf3e){if(!_0xa8cf3e){_0xda007b[_0x9d8f('0x2b')](0x194);}return _0xa8cf3e;};}function handleError(_0x8fc594,_0x3544bf){_0x3544bf=_0x3544bf||0x1f4;return function(_0x221c9e){logger[_0x9d8f('0x26')](_0x221c9e[_0x9d8f('0x39')]);if(_0x221c9e[_0x9d8f('0x3a')]){delete _0x221c9e[_0x9d8f('0x3a')];}_0x8fc594[_0x9d8f('0x2c')](_0x3544bf)[_0x9d8f('0x3b')](_0x221c9e);};}exports['index']=function(_0x53eeec,_0x576874){var _0x13ef2e={'include':[{'model':db[_0x9d8f('0x3c')],'as':_0x9d8f('0x3d')}]},_0x5b09ba={},_0x2fc65e={'count':0x0,'rows':[]};var _0xfb0042=_[_0x9d8f('0x3e')](db[_0x9d8f('0x3f')]['rawAttributes'],function(_0x523594){return{'name':_0x523594[_0x9d8f('0x40')],'type':_0x523594[_0x9d8f('0x41')]['key']};});_0x5b09ba[_0x9d8f('0x42')]=_[_0x9d8f('0x3e')](_0xfb0042,_0x9d8f('0x3a'));_0x5b09ba['query']=_[_0x9d8f('0x43')](_0x53eeec[_0x9d8f('0x44')]);_0x5b09ba[_0x9d8f('0x45')]=_['intersection'](_0x5b09ba[_0x9d8f('0x42')],_0x5b09ba[_0x9d8f('0x44')]);_0x13ef2e[_0x9d8f('0x46')]=_['intersection'](_0x5b09ba[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x53eeec['query'][_0x9d8f('0x47')]));_0x13ef2e[_0x9d8f('0x46')]=_0x13ef2e[_0x9d8f('0x46')]['length']?_0x13ef2e[_0x9d8f('0x46')]:_0x5b09ba[_0x9d8f('0x42')];if(!_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x48')](_0x9d8f('0x49'))){_0x13ef2e[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x31')]);_0x13ef2e[_0x9d8f('0x2f')]=qs[_0x9d8f('0x2f')](_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}_0x13ef2e[_0x9d8f('0x4a')]=qs[_0x9d8f('0x4b')](_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x13ef2e[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_[_0x9d8f('0x4d')](_0x53eeec[_0x9d8f('0x44')],_0x5b09ba[_0x9d8f('0x45')]),_0xfb0042);if(_0x53eeec['query'][_0x9d8f('0x4e')]){_0x13ef2e[_0x9d8f('0x4c')]=_[_0x9d8f('0x4f')](_0x13ef2e[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0xfb0042,function(_0x5e148f){if(_0x5e148f[_0x9d8f('0x41')]!==_0x9d8f('0x50')){var _0x26d59e={};_0x26d59e[_0x5e148f[_0x9d8f('0x3a')]]={'$like':'%'+_0x53eeec[_0x9d8f('0x44')]['filter']+'%'};return _0x26d59e;}})});}_0x13ef2e=_[_0x9d8f('0x4f')]({},_0x13ef2e,_0x53eeec[_0x9d8f('0x51')]);var _0x3bba7a={'where':_0x13ef2e[_0x9d8f('0x4c')]};return db[_0x9d8f('0x3f')][_0x9d8f('0x32')](_0x3bba7a)[_0x9d8f('0x21')](function(_0x3b689f){_0x2fc65e[_0x9d8f('0x32')]=_0x3b689f;if(_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x52')]){_0x13ef2e[_0x9d8f('0x53')]=[{'all':!![]}];}return db[_0x9d8f('0x3f')]['findAll'](_0x13ef2e);})[_0x9d8f('0x21')](function(_0x2801b5){_0x2fc65e[_0x9d8f('0x54')]=_0x2801b5;return _0x2fc65e;})[_0x9d8f('0x21')](respondWithFilteredResult(_0x576874,_0x13ef2e))[_0x9d8f('0x2a')](handleError(_0x576874,null));};exports[_0x9d8f('0x55')]=function(_0x23cdbf,_0xb93eef){var _0x224fe7={'raw':![],'where':{'id':_0x23cdbf[_0x9d8f('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x9d8f('0x3d')}]},_0x47fefa={};_0x47fefa[_0x9d8f('0x42')]=_[_0x9d8f('0x43')](db[_0x9d8f('0x3f')]['rawAttributes']);_0x47fefa['query']=_[_0x9d8f('0x43')](_0x23cdbf['query']);_0x47fefa[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x47fefa['model'],_0x47fefa[_0x9d8f('0x44')]);_0x224fe7[_0x9d8f('0x46')]=_[_0x9d8f('0x57')](_0x47fefa['model'],qs['fields'](_0x23cdbf['query'][_0x9d8f('0x47')]));_0x224fe7['attributes']=_0x224fe7['attributes'][_0x9d8f('0x58')]?_0x224fe7[_0x9d8f('0x46')]:_0x47fefa['model'];if(_0x23cdbf['query'][_0x9d8f('0x52')]){_0x224fe7[_0x9d8f('0x53')]=[{'all':!![]}];}_0x224fe7=_[_0x9d8f('0x4f')]({},_0x224fe7,_0x23cdbf['options']);return db['WhatsappAccount']['find'](_0x224fe7)[_0x9d8f('0x21')](handleEntityNotFound(_0xb93eef,null))[_0x9d8f('0x21')](respondWithResult(_0xb93eef,null))['catch'](handleError(_0xb93eef,null));};exports[_0x9d8f('0x59')]=function(_0x172a7e,_0x4ad571){return db[_0x9d8f('0x3f')][_0x9d8f('0x59')](_0x172a7e[_0x9d8f('0x5a')],{})[_0x9d8f('0x21')](function(_0x22457d){var _0x2b02a1=_0x172a7e[_0x9d8f('0x5b')][_0x9d8f('0x36')]({'plain':!![]});if(!_0x2b02a1)throw new Error(_0x9d8f('0x5c'));if(_0x2b02a1[_0x9d8f('0x5d')]===_0x9d8f('0x5b')){var _0x46ec41=_0x22457d[_0x9d8f('0x36')]({'plain':!![]});var _0x10a9e3=_0x9d8f('0x37');return db[_0x9d8f('0x5e')]['find']({'where':{'name':_0x10a9e3,'userProfileId':_0x2b02a1['userProfileId']},'raw':!![]})['then'](function(_0x247033){if(_0x247033&&_0x247033['autoAssociation']===0x0){return db[_0x9d8f('0x38')]['create']({'name':_0x46ec41[_0x9d8f('0x3a')],'resourceId':_0x46ec41['id'],'type':_0x247033['name'],'sectionId':_0x247033['id']},{})[_0x9d8f('0x21')](function(){return _0x22457d;});}else{return _0x22457d;}})['catch'](function(_0x1a3dc8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a3dc8);throw _0x1a3dc8;});}return _0x22457d;})[_0x9d8f('0x21')](respondWithResult(_0x4ad571,0xc9))[_0x9d8f('0x2a')](handleError(_0x4ad571,null));};exports[_0x9d8f('0x5f')]=function(_0x34b6fd,_0x4f4f72){if(_0x34b6fd[_0x9d8f('0x5a')]['id']){delete _0x34b6fd[_0x9d8f('0x5a')]['id'];}return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x34b6fd[_0x9d8f('0x56')]['id']},'include':[{'model':db[_0x9d8f('0x3c')],'as':_0x9d8f('0x3d')}]})[_0x9d8f('0x21')](handleEntityNotFound(_0x4f4f72,null))[_0x9d8f('0x21')](saveUpdates(_0x34b6fd[_0x9d8f('0x5a')],null))[_0x9d8f('0x21')](respondWithResult(_0x4f4f72,null))[_0x9d8f('0x2a')](handleError(_0x4f4f72,null));};exports[_0x9d8f('0x35')]=function(_0x2f35f8,_0x5332c4){return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x2f35f8['params']['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x5332c4,null))[_0x9d8f('0x21')](removeEntity(_0x5332c4,null))['catch'](handleError(_0x5332c4,null));};exports[_0x9d8f('0x61')]=function(_0x2ae638,_0x3a88c5){return db[_0x9d8f('0x3f')][_0x9d8f('0x61')]()['then'](respondWithResult(_0x3a88c5,null))['catch'](handleError(_0x3a88c5,null));};exports[_0x9d8f('0x62')]=function(_0x3ee82b,_0x47246f,_0x3e29a9){if(_0x3ee82b[_0x9d8f('0x5a')]['id']){delete _0x3ee82b[_0x9d8f('0x5a')]['id'];}return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x3ee82b[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x47246f,null))['then'](function(_0x416613){if(_0x416613){_0x3ee82b[_0x9d8f('0x5a')][_0x9d8f('0x63')]=_0x416613['id'];return db[_0x9d8f('0x64')][_0x9d8f('0x59')](_0x3ee82b[_0x9d8f('0x5a')]);}})['then'](respondWithResult(_0x47246f,null))[_0x9d8f('0x2a')](handleError(_0x47246f,null));};exports[_0x9d8f('0x65')]=function(_0x1107e7,_0x5167b7,_0x2c4e62){var _0x173c6c={'raw':![],'where':{}};var _0x294e26={};var _0xd3fae6={'count':0x0,'rows':[]};return db[_0x9d8f('0x3f')]['findOne']({'where':{'id':_0x1107e7['params']['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x5167b7,null))[_0x9d8f('0x21')](function(_0x2f1624){if(_0x2f1624){_0x294e26[_0x9d8f('0x42')]=_[_0x9d8f('0x43')](db[_0x9d8f('0x64')][_0x9d8f('0x66')]);_0x294e26['query']=_['keys'](_0x1107e7[_0x9d8f('0x44')]);_0x294e26[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x294e26[_0x9d8f('0x42')],_0x294e26[_0x9d8f('0x44')]);_0x173c6c['attributes']=_[_0x9d8f('0x57')](_0x294e26[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0x173c6c['attributes']=_0x173c6c[_0x9d8f('0x46')][_0x9d8f('0x58')]?_0x173c6c[_0x9d8f('0x46')]:_0x294e26[_0x9d8f('0x42')];if(!_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x48')](_0x9d8f('0x49'))){_0x173c6c[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x1107e7['query']['limit']);_0x173c6c['offset']=qs['offset'](_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}_0x173c6c[_0x9d8f('0x4a')]=qs['sort'](_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x173c6c[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_[_0x9d8f('0x4d')](_0x1107e7['query'],_0x294e26['filters']));_0x173c6c[_0x9d8f('0x4c')][_0x9d8f('0x63')]=_0x2f1624['id'];if(_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x4e')]){_0x173c6c['where']=_[_0x9d8f('0x4f')](_0x173c6c[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0x173c6c[_0x9d8f('0x46')],function(_0x19d5cc){var _0x481bd4={};_0x481bd4[_0x19d5cc]={'$like':'%'+_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x481bd4;})});}_0x173c6c=_[_0x9d8f('0x4f')]({},_0x173c6c,_0x1107e7[_0x9d8f('0x51')]);return db['Disposition'][_0x9d8f('0x32')]({'where':_0x173c6c[_0x9d8f('0x4c')]})[_0x9d8f('0x21')](function(_0x276bef){_0xd3fae6[_0x9d8f('0x32')]=_0x276bef;if(_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x52')]){_0x173c6c['include']=[{'all':!![]}];}return db['Disposition'][_0x9d8f('0x67')](_0x173c6c);})[_0x9d8f('0x21')](function(_0x28c7e0){_0xd3fae6['rows']=_0x28c7e0;return _0xd3fae6;});}})[_0x9d8f('0x21')](respondWithFilteredResult(_0x5167b7,_0x173c6c))[_0x9d8f('0x2a')](handleError(_0x5167b7,null));};exports[_0x9d8f('0x68')]=function(_0x44ec79,_0x3caf24,_0xcf7191){return db['WhatsappAccount'][_0x9d8f('0x60')]({'where':{'id':_0x44ec79[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x3caf24,null))[_0x9d8f('0x21')](function(_0x1eee66){if(_0x1eee66){return _0x1eee66[_0x9d8f('0x68')](_0x44ec79[_0x9d8f('0x44')][_0x9d8f('0x69')]);}})[_0x9d8f('0x21')](respondWithStatusCode(_0x3caf24,null))['catch'](handleError(_0x3caf24,null));};exports[_0x9d8f('0x6a')]=function(_0x343ad0,_0x10efdf,_0x2c45c6){if(_0x343ad0[_0x9d8f('0x5a')]['id']){delete _0x343ad0['body']['id'];}return db[_0x9d8f('0x3f')]['find']({'where':{'id':_0x343ad0[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x10efdf,null))[_0x9d8f('0x21')](function(_0x47aab1){if(_0x47aab1){_0x343ad0['body'][_0x9d8f('0x63')]=_0x47aab1['id'];return db[_0x9d8f('0x6b')][_0x9d8f('0x59')](_0x343ad0[_0x9d8f('0x5a')]);}})[_0x9d8f('0x21')](respondWithResult(_0x10efdf,null))[_0x9d8f('0x2a')](handleError(_0x10efdf,null));};exports[_0x9d8f('0x6c')]=function(_0x580e78,_0x244b77,_0x5d06a2){var _0x2287c7={'raw':![],'where':{}};var _0x3f074e={};var _0x2dc52f={'count':0x0,'rows':[]};return db[_0x9d8f('0x3f')][_0x9d8f('0x6d')]({'where':{'id':_0x580e78[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x244b77,null))[_0x9d8f('0x21')](function(_0x133c79){if(_0x133c79){_0x3f074e['model']=_[_0x9d8f('0x43')](db['CannedAnswer'][_0x9d8f('0x66')]);_0x3f074e[_0x9d8f('0x44')]=_['keys'](_0x580e78['query']);_0x3f074e[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x3f074e[_0x9d8f('0x42')],_0x3f074e[_0x9d8f('0x44')]);_0x2287c7[_0x9d8f('0x46')]=_['intersection'](_0x3f074e[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0x2287c7[_0x9d8f('0x46')]=_0x2287c7['attributes'][_0x9d8f('0x58')]?_0x2287c7['attributes']:_0x3f074e['model'];if(!_0x580e78[_0x9d8f('0x44')]['hasOwnProperty'](_0x9d8f('0x49'))){_0x2287c7[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x31')]);_0x2287c7[_0x9d8f('0x2f')]=qs[_0x9d8f('0x2f')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}_0x2287c7[_0x9d8f('0x4a')]=qs[_0x9d8f('0x4b')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x2287c7[_0x9d8f('0x4c')]=qs['filters'](_[_0x9d8f('0x4d')](_0x580e78[_0x9d8f('0x44')],_0x3f074e['filters']));_0x2287c7['where']['WhatsappAccountId']=_0x133c79['id'];if(_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x4e')]){_0x2287c7['where']=_[_0x9d8f('0x4f')](_0x2287c7[_0x9d8f('0x4c')],{'$or':_['map'](_0x2287c7['attributes'],function(_0x3654bf){var _0x1ebb0b={};_0x1ebb0b[_0x3654bf]={'$like':'%'+_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x1ebb0b;})});}_0x2287c7=_[_0x9d8f('0x4f')]({},_0x2287c7,_0x580e78[_0x9d8f('0x51')]);return db[_0x9d8f('0x6b')][_0x9d8f('0x32')]({'where':_0x2287c7['where']})[_0x9d8f('0x21')](function(_0xf7f28f){_0x2dc52f['count']=_0xf7f28f;if(_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x52')]){_0x2287c7['include']=[{'all':!![]}];}return db[_0x9d8f('0x6b')]['findAll'](_0x2287c7);})['then'](function(_0x5f3227){_0x2dc52f['rows']=_0x5f3227;return _0x2dc52f;});}})['then'](respondWithFilteredResult(_0x244b77,_0x2287c7))[_0x9d8f('0x2a')](handleError(_0x244b77,null));};exports[_0x9d8f('0x6e')]=function(_0x3186ea,_0x466ac7,_0x463322){return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x3186ea['params']['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x466ac7,null))[_0x9d8f('0x21')](function(_0x133a27){if(_0x133a27){return _0x133a27[_0x9d8f('0x6e')](_0x3186ea['query'][_0x9d8f('0x69')]);}})[_0x9d8f('0x21')](respondWithStatusCode(_0x466ac7,null))[_0x9d8f('0x2a')](handleError(_0x466ac7,null));};exports['addAgents']=function(_0x746294,_0x2c2202,_0xd4eb7f){return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x746294[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x2c2202,null))[_0x9d8f('0x21')](function(_0x1cd874){if(_0x1cd874){return _0x1cd874[_0x9d8f('0x6f')](_0x746294['body']['ids'],_[_0x9d8f('0x70')](_0x746294[_0x9d8f('0x5a')],['ids','id'])||{})['spread'](function(_0x1abf20){for(var _0x453169=0x0;_0x453169<_0x746294[_0x9d8f('0x5a')]['ids'][_0x9d8f('0x58')];_0x453169+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x746294[_0x9d8f('0x5a')][_0x9d8f('0x69')][_0x453169]),'WhatsappAccountId':Number(_0x746294['params']['id'])});}return _0x1abf20;});}})[_0x9d8f('0x21')](respondWithResult(_0x2c2202,null))[_0x9d8f('0x2a')](handleError(_0x2c2202,null));};exports[_0x9d8f('0x71')]=function(_0x68c462,_0xbefa14,_0x4d35d6){return db[_0x9d8f('0x3f')]['find']({'where':{'id':_0x68c462[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0xbefa14,null))['then'](function(_0x775719){if(_0x775719){return _0x775719[_0x9d8f('0x71')](_0x68c462[_0x9d8f('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x68c462[_0x9d8f('0x44')]['ids'])){for(var _0x16540f=0x0;_0x16540f<_0x68c462[_0x9d8f('0x44')][_0x9d8f('0x69')][_0x9d8f('0x58')];_0x16540f+=0x1){socket['emit'](_0x9d8f('0x72'),{'UserId':Number(_0x68c462['query'][_0x9d8f('0x69')][_0x16540f]),'WhatsappAccountId':Number(_0x68c462['params']['id'])});}}else{socket[_0x9d8f('0x73')](_0x9d8f('0x72'),{'UserId':Number(_0x68c462[_0x9d8f('0x44')][_0x9d8f('0x69')]),'WhatsappAccountId':Number(_0x68c462[_0x9d8f('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0xbefa14,null))[_0x9d8f('0x2a')](handleError(_0xbefa14,null));};exports[_0x9d8f('0x74')]=function(_0xc78ea6,_0x148541,_0x4cfee4){var _0x59bcef={};var _0x10185a={};var _0x5b603b;var _0x204c61;return db['WhatsappAccount'][_0x9d8f('0x6d')]({'where':{'id':_0xc78ea6[_0x9d8f('0x56')]['id']}})['then'](handleEntityNotFound(_0x148541,null))[_0x9d8f('0x21')](function(_0x14ad6a){if(_0x14ad6a){_0x5b603b=_0x14ad6a;_0x10185a[_0x9d8f('0x42')]=_['keys'](db[_0x9d8f('0x75')][_0x9d8f('0x66')]);_0x10185a[_0x9d8f('0x44')]=_[_0x9d8f('0x43')](_0xc78ea6[_0x9d8f('0x44')]);_0x10185a[_0x9d8f('0x45')]=_['intersection'](_0x10185a[_0x9d8f('0x42')],_0x10185a[_0x9d8f('0x44')]);_0x59bcef[_0x9d8f('0x46')]=_['intersection'](_0x10185a[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0x59bcef['attributes']=_0x59bcef['attributes'][_0x9d8f('0x58')]?_0x59bcef[_0x9d8f('0x46')]:_0x10185a[_0x9d8f('0x42')];_0x59bcef['order']=qs[_0x9d8f('0x4b')](_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x59bcef[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_[_0x9d8f('0x4d')](_0xc78ea6[_0x9d8f('0x44')],_0x10185a[_0x9d8f('0x45')]));if(_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x4e')]){_0x59bcef[_0x9d8f('0x4c')]=_[_0x9d8f('0x4f')](_0x59bcef[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0x59bcef[_0x9d8f('0x46')],function(_0x20f2f8){var _0x19ce94={};_0x19ce94[_0x20f2f8]={'$like':'%'+_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x19ce94;})});}_0x59bcef=_[_0x9d8f('0x4f')]({},_0x59bcef,_0xc78ea6[_0x9d8f('0x51')]);return _0x5b603b[_0x9d8f('0x74')](_0x59bcef);}})[_0x9d8f('0x21')](function(_0x60f25d){if(_0x60f25d){_0x204c61=_0x60f25d['length'];if(!_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x48')]('nolimit')){_0x59bcef[_0x9d8f('0x31')]=qs['limit'](_0xc78ea6['query'][_0x9d8f('0x31')]);_0x59bcef['offset']=qs[_0x9d8f('0x2f')](_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}return _0x5b603b[_0x9d8f('0x74')](_0x59bcef);}})[_0x9d8f('0x21')](function(_0x5d470d){if(_0x5d470d){return _0x5d470d?{'count':_0x204c61,'rows':_0x5d470d}:null;}})[_0x9d8f('0x21')](respondWithResult(_0x148541,null))[_0x9d8f('0x2a')](handleError(_0x148541,null));};exports[_0x9d8f('0x76')]=function(_0x2a0e53,_0x22e60){var _0x64a492=_0x2a0e53[_0x9d8f('0x56')]['id'];var _0x4a720f=_0x2a0e53[_0x9d8f('0x5a')];var _0x1d1cf0=0xc8;var _0x5b6750=null;return db[_0x9d8f('0x77')][_0x9d8f('0x78')]({'isolationLevel':db[_0x9d8f('0x77')][_0x9d8f('0x79')]['ISOLATION_LEVELS'][_0x9d8f('0x7a')]},function(_0x3dee08){return db['WhatsappAccount'][_0x9d8f('0x6d')]({'where':{'id':_0x64a492},'transaction':_0x3dee08})[_0x9d8f('0x21')](function(_0x132f1d){if(_0x132f1d){return db[_0x9d8f('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x64a492},'transaction':_0x3dee08})[_0x9d8f('0x21')](function(){var _0x35a85d=_[_0x9d8f('0x3e')](_0x4a720f,function(_0x15a0e4){_0x15a0e4[_0x9d8f('0x63')]=_0x64a492;return _0x15a0e4;});return db[_0x9d8f('0x7b')][_0x9d8f('0x7c')](_0x35a85d,{'transaction':_0x3dee08});});}else{_0x1d1cf0=0x194;_0x5b6750=[];}});})[_0x9d8f('0x21')](function(){if(_0x1d1cf0!==0x194){return db[_0x9d8f('0x7b')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x64a492},'order':'priority'})[_0x9d8f('0x21')](function(_0x3c731a){_0x5b6750=_0x3c731a;});}})[_0x9d8f('0x2a')](function(_0x558a7b){_0x1d1cf0=0x1f4;logger[_0x9d8f('0x26')](_0x558a7b[_0x9d8f('0x39')]);if(_0x558a7b[_0x9d8f('0x3a')]){delete _0x558a7b[_0x9d8f('0x3a')];}_0x5b6750=_0x558a7b;})[_0x9d8f('0x7d')](function(){if(_0x5b6750===null){_0x22e60['sendStatus'](_0x1d1cf0);}else{if(_0x1d1cf0===0x1f4){_0x22e60[_0x9d8f('0x2c')](_0x1d1cf0)[_0x9d8f('0x3b')](_0x5b6750);}else{_0x22e60[_0x9d8f('0x2c')](_0x1d1cf0)[_0x9d8f('0x2e')](_0x5b6750);}}});};exports[_0x9d8f('0x7e')]=function(_0x3ec140,_0x26726e,_0x34615d){var _0xfcf10a={};var _0x115c68={};var _0xa1e94c;var _0x193b42;return db[_0x9d8f('0x3f')][_0x9d8f('0x6d')]({'where':{'id':_0x3ec140[_0x9d8f('0x56')]['id']}})['then'](handleEntityNotFound(_0x26726e,null))[_0x9d8f('0x21')](function(_0x524ec5){if(_0x524ec5){_0xa1e94c=_0x524ec5;_0x115c68[_0x9d8f('0x42')]=_[_0x9d8f('0x43')](db[_0x9d8f('0x7b')][_0x9d8f('0x66')]);_0x115c68['query']=_['keys'](_0x3ec140['query']);_0x115c68[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x115c68[_0x9d8f('0x42')],_0x115c68[_0x9d8f('0x44')]);_0xfcf10a[_0x9d8f('0x46')]=_['intersection'](_0x115c68[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0xfcf10a[_0x9d8f('0x46')]=_0xfcf10a[_0x9d8f('0x46')][_0x9d8f('0x58')]?_0xfcf10a[_0x9d8f('0x46')]:_0x115c68[_0x9d8f('0x42')];_0xfcf10a['order']=qs[_0x9d8f('0x4b')](_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0xfcf10a[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_['pick'](_0x3ec140[_0x9d8f('0x44')],_0x115c68[_0x9d8f('0x45')]));if(_0x3ec140[_0x9d8f('0x44')]['filter']){_0xfcf10a[_0x9d8f('0x4c')]=_[_0x9d8f('0x4f')](_0xfcf10a[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0xfcf10a[_0x9d8f('0x46')],function(_0x146bfe){var _0x2682d7={};_0x2682d7[_0x146bfe]={'$like':'%'+_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x2682d7;})});}_0xfcf10a=_[_0x9d8f('0x4f')]({},_0xfcf10a,_0x3ec140[_0x9d8f('0x51')]);return _0xa1e94c[_0x9d8f('0x7e')](_0xfcf10a);}})[_0x9d8f('0x21')](function(_0x5f38ca){if(_0x5f38ca){_0x193b42=_0x5f38ca[_0x9d8f('0x58')];if(!_0x3ec140['query']['hasOwnProperty'](_0x9d8f('0x49'))){_0xfcf10a[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x3ec140[_0x9d8f('0x44')]['limit']);_0xfcf10a[_0x9d8f('0x2f')]=qs['offset'](_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}return _0xa1e94c[_0x9d8f('0x7e')](_0xfcf10a);}})['then'](function(_0x2b6322){if(_0x2b6322){return _0x2b6322?{'count':_0x193b42,'rows':_0x2b6322}:null;}})[_0x9d8f('0x21')](respondWithResult(_0x26726e,null))[_0x9d8f('0x2a')](handleError(_0x26726e,null));};exports[_0x9d8f('0x7f')]=function(_0x49a71c,_0x52cdea,_0x161aef){var _0x469010={'channel':'whatsapp'};var _0x2eaa5e=[];var _0x34950b=[];var _0x5ab4e1={};return db['WhatsappAccount'][_0x9d8f('0x60')]({'where':{'id':_0x49a71c[_0x9d8f('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x9d8f('0x80')}]})[_0x9d8f('0x21')](handleEntityNotFound(_0x52cdea,null))['then'](function(_0x463269){_0x469010['account']=_0x463269;if(_0x469010['account']&&_0x469010['account']['type']===_0x9d8f('0x81')&&_0x49a71c['body'][_0x9d8f('0x82')]){if(_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x82')]['length']===0x0)return;if(_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x82')][0x0][_0x9d8f('0x83')]!==_0x9d8f('0x84'))return;return db[_0x9d8f('0x85')]['update']({'read':!![],'readAt':_0x49a71c[_0x9d8f('0x5a')]['statuses'][0x0][_0x9d8f('0x86')]},{'where':{'messageId':_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x82')][0x0]['message_id']},'individualHooks':!![]})[_0x9d8f('0x21')](function(_0x5e3f29){return _0x52cdea[_0x9d8f('0x2c')](0xc8)['json'](_0x5e3f29);});}_0x469010['applications']=_['orderBy'](_0x463269[_0x9d8f('0x80')],[_0x9d8f('0x87')],[_0x9d8f('0x88')]);if(_0x469010[_0x9d8f('0x89')]['Applications']){delete _0x469010[_0x9d8f('0x89')][_0x9d8f('0x80')];}return db[_0x9d8f('0x8a')]['describe']()[_0x9d8f('0x21')](function(_0x552adb){if(!_0x552adb){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x8d'));}_0x2eaa5e=_[_0x9d8f('0x8e')](_[_0x9d8f('0x43')](_0x552adb),[_0x9d8f('0x8f'),_0x9d8f('0x90')]);_0x34950b=_['difference'](_[_0x9d8f('0x43')](_0x552adb),[_0x9d8f('0x8f'),'updatedAt',_0x9d8f('0x91'),_0x9d8f('0x92')]);_0x469010[_0x9d8f('0x5a')]={'mapKey':'mobile'};if(_0x469010[_0x9d8f('0x89')]&&_0x469010['account'][_0x9d8f('0x41')]===_0x9d8f('0x93')){_0x469010['body'][_0x9d8f('0x94')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x95')]['replace']('whatsapp:','');_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')]=_0x49a71c[_0x9d8f('0x5a')]['Body'];_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x96')]=_0x49a71c['body'][_0x9d8f('0x97')];}if(_0x469010[_0x9d8f('0x89')]&&_0x469010['account'][_0x9d8f('0x41')]===_0x9d8f('0x81')){_0x469010['body'][_0x9d8f('0x94')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x98')][0x0][_0x9d8f('0x94')];_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x98')][0x0][_0x9d8f('0x27')]['body'];_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x96')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x98')][0x0][_0x9d8f('0x99')];}if(_0x469010['body']['id']){delete _0x469010[_0x9d8f('0x5a')]['id'];}if(_[_0x9d8f('0x9a')](_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x94')])){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x9b'));}if(_[_0x9d8f('0x9a')](_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')])||_0x469010[_0x9d8f('0x5a')]['body']===''){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x9c'));}if(_[_0x9d8f('0x9a')](_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x9d')])){throw new db['Sequelize'][(_0x9d8f('0x8c'))](_0x9d8f('0x9e')+_0x34950b);}if(!_[_0x9d8f('0x9f')](_0x34950b,_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x9d')])){throw new db['Sequelize'][(_0x9d8f('0x8c'))](_0x9d8f('0xa0')+_0x34950b);}_0x5ab4e1[_0x469010['body'][_0x9d8f('0x9d')]]=_0x469010['body'][_0x9d8f('0x94')];return db[_0x9d8f('0xa1')]['find']({'where':{'id':_0x469010[_0x9d8f('0x89')][_0x9d8f('0x92')]},'include':[{'model':db[_0x9d8f('0x8a')],'as':'Contacts','where':_0x5ab4e1,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x9d8f('0x21')](handleEntityNotFound(_0x52cdea,null))[_0x9d8f('0x21')](function(_0x26fbe0){if(_0x26fbe0){_0x469010[_0x9d8f('0xa2')]=_[_0x9d8f('0x70')](_0x26fbe0,[_0x9d8f('0xa3')]);if(_0x26fbe0[_0x9d8f('0xa3')][_0x9d8f('0x58')]){return _0x26fbe0[_0x9d8f('0xa3')][0x0];}var _0x192d1d=_[_0x9d8f('0x1b')](_0x469010[_0x9d8f('0x5a')],{'firstName':_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x94')],'ListId':_0x26fbe0['id']});_0x192d1d[_0x469010[_0x9d8f('0x5a')]['mapKey']]=_0x469010['body'][_0x9d8f('0x94')];return db['CmContact'][_0x9d8f('0x59')](_0x192d1d,{'fields':_0x2eaa5e,'raw':!![]});}})[_0x9d8f('0x21')](handleEntityNotFound(_0x52cdea,null))['then'](function(_0x2ca101){if(_0x2ca101){_0x469010[_0x9d8f('0xa4')]=_0x2ca101;var _0x2cb3af={'ContactId':_0x2ca101['id'],'phone':_0x469010[_0x9d8f('0x5a')]['from'],'WhatsappAccountId':_0x49a71c[_0x9d8f('0x56')]['id']};var _0x4224a7={'ContactId':_0x2ca101['id'],'WhatsappAccountId':_0x49a71c[_0x9d8f('0x56')]['id'],'closed':![]};return db[_0x9d8f('0xa5')]['find']({'where':_0x4224a7})[_0x9d8f('0x21')](function(_0x27798e){if(_0x27798e){return[_0x27798e,![]];}return db[_0x9d8f('0xa5')][_0x9d8f('0x59')](_0x2cb3af)[_0x9d8f('0x21')](function(_0x58b88f){return[_0x58b88f,!![]];});});}})['spread'](function(_0x17ae8b,_0x4def77){_0x469010[_0x9d8f('0xa6')]=_0x17ae8b[_0x9d8f('0x36')]({'plain':!![]});_0x469010[_0x9d8f('0xa6')][_0x9d8f('0xa7')]=![];if(_0x4def77){if(_0x469010[_0x9d8f('0x89')]['autoclose']){_0x469010[_0x9d8f('0xa8')]['push']({'id':0x0,'priority':_0x469010['applications'][_0x9d8f('0x58')]+0x1,'app':_0x9d8f('0xa9'),'appdata':_0x9d8f('0xaa'),'interval':_0x9d8f('0xab')});}_0x469010[_0x9d8f('0xa6')][_0x9d8f('0xa7')]=!![];}return db[_0x9d8f('0x85')][_0x9d8f('0x59')]({'phone':_0x469010[_0x9d8f('0x5a')]['from'],'messageId':_0x469010['body'][_0x9d8f('0x96')],'body':_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')],'WhatsappAccountId':_0x49a71c[_0x9d8f('0x56')]['id'],'WhatsappInteractionId':_0x17ae8b['id'],'direction':'in','ContactId':_0x17ae8b[_0x9d8f('0xac')],'AttachmentId':_0x469010[_0x9d8f('0x5a')][_0x9d8f('0xad')]});})[_0x9d8f('0x21')](function(_0x3de5c1){_0x469010['message']=_0x3de5c1;if(_0x469010[_0x9d8f('0xa6')][_0x9d8f('0xae')]){return db['User'][_0x9d8f('0x60')]({'attributes':['id',_0x9d8f('0x3a')],'where':{'id':_0x469010['interaction']['UserId']}})[_0x9d8f('0x21')](function(_0x5afeea){if(_0x5afeea){_0x469010[_0x9d8f('0xa8')][_0x9d8f('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5afeea[_0x9d8f('0x3a')]+','+(_0x469010['account'][_0x9d8f('0xb0')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9d8f('0xb1'),_0x9d8f('0xb2'),_0x469010);});}return respondWithRpcPromise(_0x9d8f('0xb1'),_0x9d8f('0xb2'),_0x469010);})[_0x9d8f('0x21')](function(_0x51c739){if(_0x51c739){var _0x2f75ba=0xc8;var _0x19a31a=_0x9d8f('0xb3');logger[_0x9d8f('0x22')](_0x9d8f('0x24'),_0x19a31a,_0x2f75ba,_0x9d8f('0xb4'));logger[_0x9d8f('0x23')](_0x9d8f('0xb5'),_0x19a31a,_0x2f75ba,'entity\x20found',JSON[_0x9d8f('0xb6')](_0x51c739));if(_0x469010[_0x9d8f('0x89')][_0x9d8f('0x41')]==='twilio'){return _0x52cdea[_0x9d8f('0x2c')](_0x2f75ba)[_0x9d8f('0xb7')]('Content-Type',_0x9d8f('0xb8'))[_0x9d8f('0x3b')](_0x9d8f('0xb9'));}else{return _0x52cdea[_0x9d8f('0x2c')](_0x2f75ba)[_0x9d8f('0x2e')](_0x51c739);}}});})[_0x9d8f('0x2a')](handleError(_0x52cdea,null));};exports[_0x9d8f('0x3b')]=function(_0x2b7f37,_0x9344b3,_0x55804f){var _0x2366d7,_0x45e6ab,_0x59e065;if(_['isNil'](_0x2b7f37[_0x9d8f('0x5a')]['body'])||_0x2b7f37[_0x9d8f('0x5a')]['body']===''){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x9c'));}if(_[_0x9d8f('0x9a')](_0x2b7f37[_0x9d8f('0x5a')]['to'])){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0xba'));}_0x2366d7=_0x2b7f37[_0x9d8f('0x5a')]['to'];return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x2b7f37[_0x9d8f('0x56')]['id']},'include':[{'model':db[_0x9d8f('0xa1')],'as':'List','include':[{'model':db[_0x9d8f('0x8a')],'as':_0x9d8f('0xa3'),'where':{'mobile':_0x2366d7},'limit':0x1,'order':[[_0x9d8f('0x90'),_0x9d8f('0xbb')]]}]}]})[_0x9d8f('0x21')](handleEntityNotFound(_0x9344b3,null))[_0x9d8f('0x21')](function(_0x4d20e9){if(_0x4d20e9&&_0x4d20e9[_0x9d8f('0xbc')]){_0x45e6ab=_0x4d20e9['get']({'plain':!![]});if(_0x45e6ab[_0x9d8f('0xbc')]&&_0x45e6ab[_0x9d8f('0xbc')]['Contacts'][_0x9d8f('0x58')]){return _0x45e6ab[_0x9d8f('0xbc')][_0x9d8f('0xa3')][0x0];}return db[_0x9d8f('0x8a')]['create'](_[_0x9d8f('0x1b')](_0x2b7f37['body'],{'firstName':_0x2366d7,'mobile':_0x2366d7,'phone':_0x2366d7,'ListId':_0x45e6ab['ListId']}));}})[_0x9d8f('0x21')](handleEntityNotFound(_0x9344b3,null))[_0x9d8f('0x21')](function(_0x3cf64f){if(_0x3cf64f){_0x59e065=_0x3cf64f;return db[_0x9d8f('0xa5')][_0x9d8f('0x60')]({'where':{'ContactId':_0x59e065['id'],'closed':![],'WhatsappAccountId':_0x45e6ab['id']}})[_0x9d8f('0x21')](function(_0x551680){if(_0x551680){return[_0x551680,![]];}return db[_0x9d8f('0xa5')]['create']({'UserId':_0x2b7f37[_0x9d8f('0x5b')]['id'],'ContactId':_0x59e065['id'],'WhatsappAccountId':_0x45e6ab['id'],'phone':_0x2366d7,'firstMsgDirection':_0x9d8f('0xbd'),'Messages':[_[_0x9d8f('0x4f')](_0x2b7f37['body'],{'read':![],'body':_0x2b7f37[_0x9d8f('0x5a')][_0x9d8f('0x5a')],'phone':_0x2366d7,'WhatsappAccountId':_0x45e6ab['id'],'UserId':_0x2b7f37[_0x9d8f('0x5b')]['id'],'ContactId':_0x59e065['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x9d8f('0xbe')}]})['then'](function(_0x4cfe41){return[_0x4cfe41,!![]];});});}})[_0x9d8f('0xbf')](function(_0x42924a,_0x3acd05){if(_0x3acd05){return _0x42924a;}return db[_0x9d8f('0x85')][_0x9d8f('0x59')](_['merge'](_0x2b7f37[_0x9d8f('0x5a')],{'read':![],'body':_0x2b7f37['body'][_0x9d8f('0x5a')],'phone':_0x2366d7,'WhatsappAccountId':_0x45e6ab['id'],'WhatsappInteractionId':_0x42924a['id'],'UserId':_0x2b7f37[_0x9d8f('0x5b')]['id'],'ContactId':_0x59e065['id']}))[_0x9d8f('0x21')](function(_0x2afcfc){_0x42924a[_0x9d8f('0xc0')][_0x9d8f('0xbe')]=[];_0x42924a['dataValues']['Messages'][_0x9d8f('0xc1')](_0x2afcfc[_0x9d8f('0xc0')]);return _0x42924a;});})[_0x9d8f('0x21')](respondWithResult(_0x9344b3,null))[_0x9d8f('0x2a')](handleError(_0x9344b3,null));}; \ No newline at end of file +var _0xb0e6=['difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','replace','Body','messageId','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a','List','dataValues','eml-format','zip-dir','fast-json-patch','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','end','name','send','index','Pause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','include','findAll','rows','show','params','mandatoryDispositionPause','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','stack','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError'];(function(_0x41b336,_0x263367){var _0x4b75be=function(_0x73f477){while(--_0x73f477){_0x41b336['push'](_0x41b336['shift']());}};_0x4b75be(++_0x263367);}(_0xb0e6,0x1b3));var _0x6b0e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb0e6[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x6b0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b0e('0x1'));var jsonpatch=require(_0x6b0e('0x2'));var rp=require('request-promise');var moment=require(_0x6b0e('0x3'));var BPromise=require(_0x6b0e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6b0e('0x5'));var csv=require('to-csv');var ejs=require(_0x6b0e('0x6'));var fs=require('fs');var fs_extra=require(_0x6b0e('0x7'));var _=require(_0x6b0e('0x8'));var squel=require('squel');var crypto=require(_0x6b0e('0x9'));var jsforce=require(_0x6b0e('0xa'));var deskjs=require(_0x6b0e('0xb'));var toCsv=require(_0x6b0e('0xc'));var querystring=require(_0x6b0e('0xd'));var Papa=require(_0x6b0e('0xe'));var Redis=require(_0x6b0e('0xf'));var authService=require(_0x6b0e('0x10'));var qs=require(_0x6b0e('0x11'));var as=require(_0x6b0e('0x12'));var hardwareService=require(_0x6b0e('0x13'));var logger=require(_0x6b0e('0x14'))(_0x6b0e('0x15'));var utils=require(_0x6b0e('0x16'));var config=require(_0x6b0e('0x17'));var licenseUtil=require(_0x6b0e('0x18'));var db=require('../../mysqldb')['db'];config[_0x6b0e('0x19')]=_[_0x6b0e('0x1a')](config['redis'],{'host':_0x6b0e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b0e('0x19')]));require(_0x6b0e('0x1c'))[_0x6b0e('0x1d')](socket);var jayson=require(_0x6b0e('0x1e'));var client=jayson[_0x6b0e('0x1f')][_0x6b0e('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x7aeb04,_0x19d06d,_0x356bdf,_0x300b9c){return new BPromise(function(_0x583607,_0x408840){var _0x58a600=_0x300b9c||client;return _0x58a600[_0x6b0e('0x21')](_0x7aeb04,_0x356bdf)[_0x6b0e('0x22')](function(_0x365a4f){logger[_0x6b0e('0x23')](_0x6b0e('0x24'),_0x19d06d,_0x6b0e('0x25'));logger[_0x6b0e('0x26')](_0x6b0e('0x27'),_0x19d06d,'request\x20sent',JSON[_0x6b0e('0x28')](_0x365a4f));if(_0x365a4f[_0x6b0e('0x29')]){if(_0x365a4f[_0x6b0e('0x29')]['code']===0x1f4){logger[_0x6b0e('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x19d06d,_0x365a4f[_0x6b0e('0x29')][_0x6b0e('0x2a')]);return _0x408840(_0x365a4f[_0x6b0e('0x29')][_0x6b0e('0x2a')]);}logger[_0x6b0e('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x19d06d,_0x365a4f['error']['message']);return _0x583607(_0x365a4f[_0x6b0e('0x29')][_0x6b0e('0x2a')]);}else{logger['info'](_0x6b0e('0x24'),_0x19d06d,_0x6b0e('0x25'));_0x583607(_0x365a4f[_0x6b0e('0x2b')][_0x6b0e('0x2a')]);}})['catch'](function(_0x151453){logger[_0x6b0e('0x29')](_0x6b0e('0x24'),_0x19d06d,_0x151453);_0x408840(_0x151453);});});}function respondWithStatusCode(_0x2a746b,_0x30fabb){_0x30fabb=_0x30fabb||0xcc;return function(_0x34b7a5){if(_0x34b7a5){return _0x2a746b[_0x6b0e('0x2c')](_0x30fabb);}return _0x2a746b[_0x6b0e('0x2d')](_0x30fabb)['end']();};}function respondWithResult(_0xa3b829,_0x47d418){_0x47d418=_0x47d418||0xc8;return function(_0x422db2){if(_0x422db2){return _0xa3b829[_0x6b0e('0x2d')](_0x47d418)[_0x6b0e('0x2e')](_0x422db2);}};}function respondWithFilteredResult(_0x44e046,_0x42d85d){return function(_0x4ad008){if(_0x4ad008){var _0x4c910b=typeof _0x42d85d[_0x6b0e('0x2f')]===_0x6b0e('0x30')&&typeof _0x42d85d['limit']===_0x6b0e('0x30');var _0x12881d=_0x4ad008[_0x6b0e('0x31')];var _0xa9455c=_0x4c910b?0x0:_0x42d85d[_0x6b0e('0x2f')];var _0x1203da=_0x4c910b?_0x4ad008[_0x6b0e('0x31')]:_0x42d85d[_0x6b0e('0x2f')]+_0x42d85d[_0x6b0e('0x32')];var _0x3fe9d9;if(_0x1203da>=_0x12881d){_0x1203da=_0x12881d;_0x3fe9d9=0xc8;}else{_0x3fe9d9=0xce;}_0x44e046[_0x6b0e('0x2d')](_0x3fe9d9);return _0x44e046['set'](_0x6b0e('0x33'),_0xa9455c+'-'+_0x1203da+'/'+_0x12881d)[_0x6b0e('0x2e')](_0x4ad008);}return null;};}function patchUpdates(_0x2a3097){return function(_0x35ba46){try{jsonpatch[_0x6b0e('0x34')](_0x35ba46,_0x2a3097,!![]);}catch(_0x304b7e){return BPromise[_0x6b0e('0x35')](_0x304b7e);}return _0x35ba46['save']();};}function saveUpdates(_0x31da9f,_0x484a85){return function(_0x46cc14){if(_0x46cc14){return _0x46cc14[_0x6b0e('0x36')](_0x31da9f)['then'](function(_0x1688db){return _0x1688db;});}return null;};}function removeEntity(_0x483ff5,_0x2d4812){return function(_0x5b7f7e){if(_0x5b7f7e){return _0x5b7f7e[_0x6b0e('0x37')]()[_0x6b0e('0x22')](function(){var _0x536696=_0x5b7f7e[_0x6b0e('0x38')]({'plain':!![]});var _0x16208d=_0x6b0e('0x39');return db['UserProfileResource'][_0x6b0e('0x37')]({'where':{'type':_0x16208d,'resourceId':_0x536696['id']}})[_0x6b0e('0x22')](function(){return _0x5b7f7e;});})[_0x6b0e('0x22')](function(){_0x483ff5[_0x6b0e('0x2d')](0xcc)[_0x6b0e('0x3a')]();});}};}function handleEntityNotFound(_0x1bb5ea,_0x3abba8){return function(_0x2785a9){if(!_0x2785a9){_0x1bb5ea[_0x6b0e('0x2c')](0x194);}return _0x2785a9;};}function handleError(_0x2d6891,_0x416497){_0x416497=_0x416497||0x1f4;return function(_0x5636fe){logger[_0x6b0e('0x29')](_0x5636fe['stack']);if(_0x5636fe[_0x6b0e('0x3b')]){delete _0x5636fe[_0x6b0e('0x3b')];}_0x2d6891[_0x6b0e('0x2d')](_0x416497)[_0x6b0e('0x3c')](_0x5636fe);};}exports[_0x6b0e('0x3d')]=function(_0x1ab711,_0x267aad){var _0x3febe7={'include':[{'model':db[_0x6b0e('0x3e')],'as':'mandatoryDispositionPause'}]},_0x15dca8={},_0x1c63dd={'count':0x0,'rows':[]};var _0x2615d0=_['map'](db[_0x6b0e('0x3f')][_0x6b0e('0x40')],function(_0x92edaf){return{'name':_0x92edaf[_0x6b0e('0x41')],'type':_0x92edaf[_0x6b0e('0x42')][_0x6b0e('0x43')]};});_0x15dca8['model']=_[_0x6b0e('0x44')](_0x2615d0,_0x6b0e('0x3b'));_0x15dca8[_0x6b0e('0x45')]=_[_0x6b0e('0x46')](_0x1ab711[_0x6b0e('0x45')]);_0x15dca8[_0x6b0e('0x47')]=_[_0x6b0e('0x48')](_0x15dca8[_0x6b0e('0x49')],_0x15dca8[_0x6b0e('0x45')]);_0x3febe7[_0x6b0e('0x4a')]=_[_0x6b0e('0x48')](_0x15dca8[_0x6b0e('0x49')],qs[_0x6b0e('0x4b')](_0x1ab711[_0x6b0e('0x45')]['fields']));_0x3febe7[_0x6b0e('0x4a')]=_0x3febe7[_0x6b0e('0x4a')][_0x6b0e('0x4c')]?_0x3febe7[_0x6b0e('0x4a')]:_0x15dca8['model'];if(!_0x1ab711[_0x6b0e('0x45')][_0x6b0e('0x4d')](_0x6b0e('0x4e'))){_0x3febe7[_0x6b0e('0x32')]=qs[_0x6b0e('0x32')](_0x1ab711[_0x6b0e('0x45')][_0x6b0e('0x32')]);_0x3febe7[_0x6b0e('0x2f')]=qs[_0x6b0e('0x2f')](_0x1ab711[_0x6b0e('0x45')][_0x6b0e('0x2f')]);}_0x3febe7[_0x6b0e('0x4f')]=qs[_0x6b0e('0x50')](_0x1ab711[_0x6b0e('0x45')][_0x6b0e('0x50')]);_0x3febe7['where']=qs[_0x6b0e('0x47')](_[_0x6b0e('0x51')](_0x1ab711[_0x6b0e('0x45')],_0x15dca8['filters']),_0x2615d0);if(_0x1ab711['query'][_0x6b0e('0x52')]){_0x3febe7[_0x6b0e('0x53')]=_['merge'](_0x3febe7['where'],{'$or':_[_0x6b0e('0x44')](_0x2615d0,function(_0x1f4cc2){if(_0x1f4cc2[_0x6b0e('0x42')]!==_0x6b0e('0x54')){var _0x2e3503={};_0x2e3503[_0x1f4cc2['name']]={'$like':'%'+_0x1ab711[_0x6b0e('0x45')][_0x6b0e('0x52')]+'%'};return _0x2e3503;}})});}_0x3febe7=_['merge']({},_0x3febe7,_0x1ab711['options']);var _0x509eac={'where':_0x3febe7[_0x6b0e('0x53')]};return db['WhatsappAccount']['count'](_0x509eac)[_0x6b0e('0x22')](function(_0x2ef5d0){_0x1c63dd[_0x6b0e('0x31')]=_0x2ef5d0;if(_0x1ab711['query']['includeAll']){_0x3febe7[_0x6b0e('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x6b0e('0x56')](_0x3febe7);})['then'](function(_0x18ba1c){_0x1c63dd[_0x6b0e('0x57')]=_0x18ba1c;return _0x1c63dd;})[_0x6b0e('0x22')](respondWithFilteredResult(_0x267aad,_0x3febe7))['catch'](handleError(_0x267aad,null));};exports[_0x6b0e('0x58')]=function(_0x757c7c,_0x5ce808){var _0x109bcc={'raw':![],'where':{'id':_0x757c7c[_0x6b0e('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x6b0e('0x5a')}]},_0x27d144={};_0x27d144[_0x6b0e('0x49')]=_[_0x6b0e('0x46')](db[_0x6b0e('0x3f')][_0x6b0e('0x40')]);_0x27d144[_0x6b0e('0x45')]=_[_0x6b0e('0x46')](_0x757c7c['query']);_0x27d144[_0x6b0e('0x47')]=_[_0x6b0e('0x48')](_0x27d144[_0x6b0e('0x49')],_0x27d144['query']);_0x109bcc['attributes']=_[_0x6b0e('0x48')](_0x27d144['model'],qs[_0x6b0e('0x4b')](_0x757c7c[_0x6b0e('0x45')][_0x6b0e('0x4b')]));_0x109bcc[_0x6b0e('0x4a')]=_0x109bcc[_0x6b0e('0x4a')][_0x6b0e('0x4c')]?_0x109bcc['attributes']:_0x27d144[_0x6b0e('0x49')];if(_0x757c7c[_0x6b0e('0x45')][_0x6b0e('0x5b')]){_0x109bcc[_0x6b0e('0x55')]=[{'all':!![]}];}_0x109bcc=_[_0x6b0e('0x5c')]({},_0x109bcc,_0x757c7c[_0x6b0e('0x5d')]);return db['WhatsappAccount'][_0x6b0e('0x5e')](_0x109bcc)[_0x6b0e('0x22')](handleEntityNotFound(_0x5ce808,null))[_0x6b0e('0x22')](respondWithResult(_0x5ce808,null))['catch'](handleError(_0x5ce808,null));};exports[_0x6b0e('0x5f')]=function(_0x3637ca,_0x36bb79){return db[_0x6b0e('0x3f')]['create'](_0x3637ca['body'],{})[_0x6b0e('0x22')](function(_0x4709b8){var _0x1b42f6=_0x3637ca[_0x6b0e('0x60')][_0x6b0e('0x38')]({'plain':!![]});if(!_0x1b42f6)throw new Error(_0x6b0e('0x61'));if(_0x1b42f6[_0x6b0e('0x62')]==='user'){var _0xa6f74b=_0x4709b8['get']({'plain':!![]});var _0x4c59b1=_0x6b0e('0x39');return db[_0x6b0e('0x63')]['find']({'where':{'name':_0x4c59b1,'userProfileId':_0x1b42f6[_0x6b0e('0x64')]},'raw':!![]})[_0x6b0e('0x22')](function(_0x1be884){if(_0x1be884&&_0x1be884[_0x6b0e('0x65')]===0x0){return db['UserProfileResource'][_0x6b0e('0x5f')]({'name':_0xa6f74b[_0x6b0e('0x3b')],'resourceId':_0xa6f74b['id'],'type':_0x1be884[_0x6b0e('0x3b')],'sectionId':_0x1be884['id']},{})['then'](function(){return _0x4709b8;});}else{return _0x4709b8;}})[_0x6b0e('0x66')](function(_0xb443ce){logger[_0x6b0e('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb443ce);throw _0xb443ce;});}return _0x4709b8;})[_0x6b0e('0x22')](respondWithResult(_0x36bb79,0xc9))[_0x6b0e('0x66')](handleError(_0x36bb79,null));};exports[_0x6b0e('0x36')]=function(_0x434a04,_0x2ea40f){if(_0x434a04[_0x6b0e('0x67')]['id']){delete _0x434a04[_0x6b0e('0x67')]['id'];}return db[_0x6b0e('0x3f')][_0x6b0e('0x5e')]({'where':{'id':_0x434a04['params']['id']},'include':[{'model':db[_0x6b0e('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2ea40f,null))['then'](saveUpdates(_0x434a04['body'],null))[_0x6b0e('0x22')](respondWithResult(_0x2ea40f,null))[_0x6b0e('0x66')](handleError(_0x2ea40f,null));};exports['destroy']=function(_0x4704c4,_0x2c745c){return db[_0x6b0e('0x3f')][_0x6b0e('0x5e')]({'where':{'id':_0x4704c4['params']['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x2c745c,null))[_0x6b0e('0x22')](removeEntity(_0x2c745c,null))['catch'](handleError(_0x2c745c,null));};exports[_0x6b0e('0x68')]=function(_0xc5ca56,_0x3efd04){return db[_0x6b0e('0x3f')]['describe']()[_0x6b0e('0x22')](respondWithResult(_0x3efd04,null))['catch'](handleError(_0x3efd04,null));};exports[_0x6b0e('0x69')]=function(_0x1b8864,_0x5c9840,_0x775e91){if(_0x1b8864[_0x6b0e('0x67')]['id']){delete _0x1b8864['body']['id'];}return db[_0x6b0e('0x3f')][_0x6b0e('0x5e')]({'where':{'id':_0x1b8864[_0x6b0e('0x59')]['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x5c9840,null))[_0x6b0e('0x22')](function(_0x2281c5){if(_0x2281c5){_0x1b8864['body'][_0x6b0e('0x6a')]=_0x2281c5['id'];return db[_0x6b0e('0x6b')][_0x6b0e('0x5f')](_0x1b8864[_0x6b0e('0x67')]);}})['then'](respondWithResult(_0x5c9840,null))[_0x6b0e('0x66')](handleError(_0x5c9840,null));};exports[_0x6b0e('0x6c')]=function(_0x584327,_0x5ebae5,_0x54f7e3){var _0x19653a={'raw':![],'where':{}};var _0x430e94={};var _0x41efd0={'count':0x0,'rows':[]};return db[_0x6b0e('0x3f')][_0x6b0e('0x6d')]({'where':{'id':_0x584327[_0x6b0e('0x59')]['id']}})['then'](handleEntityNotFound(_0x5ebae5,null))[_0x6b0e('0x22')](function(_0x22d82b){if(_0x22d82b){_0x430e94[_0x6b0e('0x49')]=_['keys'](db['Disposition']['rawAttributes']);_0x430e94[_0x6b0e('0x45')]=_[_0x6b0e('0x46')](_0x584327[_0x6b0e('0x45')]);_0x430e94['filters']=_[_0x6b0e('0x48')](_0x430e94[_0x6b0e('0x49')],_0x430e94[_0x6b0e('0x45')]);_0x19653a[_0x6b0e('0x4a')]=_['intersection'](_0x430e94[_0x6b0e('0x49')],qs['fields'](_0x584327[_0x6b0e('0x45')]['fields']));_0x19653a[_0x6b0e('0x4a')]=_0x19653a[_0x6b0e('0x4a')][_0x6b0e('0x4c')]?_0x19653a[_0x6b0e('0x4a')]:_0x430e94[_0x6b0e('0x49')];if(!_0x584327[_0x6b0e('0x45')][_0x6b0e('0x4d')](_0x6b0e('0x4e'))){_0x19653a[_0x6b0e('0x32')]=qs[_0x6b0e('0x32')](_0x584327[_0x6b0e('0x45')][_0x6b0e('0x32')]);_0x19653a[_0x6b0e('0x2f')]=qs[_0x6b0e('0x2f')](_0x584327['query'][_0x6b0e('0x2f')]);}_0x19653a[_0x6b0e('0x4f')]=qs[_0x6b0e('0x50')](_0x584327['query'][_0x6b0e('0x50')]);_0x19653a[_0x6b0e('0x53')]=qs[_0x6b0e('0x47')](_[_0x6b0e('0x51')](_0x584327[_0x6b0e('0x45')],_0x430e94[_0x6b0e('0x47')]));_0x19653a[_0x6b0e('0x53')][_0x6b0e('0x6a')]=_0x22d82b['id'];if(_0x584327[_0x6b0e('0x45')][_0x6b0e('0x52')]){_0x19653a['where']=_['merge'](_0x19653a[_0x6b0e('0x53')],{'$or':_[_0x6b0e('0x44')](_0x19653a['attributes'],function(_0x49d459){var _0x518c43={};_0x518c43[_0x49d459]={'$like':'%'+_0x584327['query']['filter']+'%'};return _0x518c43;})});}_0x19653a=_['merge']({},_0x19653a,_0x584327['options']);return db['Disposition']['count']({'where':_0x19653a[_0x6b0e('0x53')]})[_0x6b0e('0x22')](function(_0x1ee597){_0x41efd0[_0x6b0e('0x31')]=_0x1ee597;if(_0x584327[_0x6b0e('0x45')]['includeAll']){_0x19653a[_0x6b0e('0x55')]=[{'all':!![]}];}return db[_0x6b0e('0x6b')][_0x6b0e('0x56')](_0x19653a);})[_0x6b0e('0x22')](function(_0x5465d9){_0x41efd0[_0x6b0e('0x57')]=_0x5465d9;return _0x41efd0;});}})[_0x6b0e('0x22')](respondWithFilteredResult(_0x5ebae5,_0x19653a))[_0x6b0e('0x66')](handleError(_0x5ebae5,null));};exports['removeDispositions']=function(_0x2ad68c,_0xa92381,_0x4c547b){return db[_0x6b0e('0x3f')][_0x6b0e('0x5e')]({'where':{'id':_0x2ad68c[_0x6b0e('0x59')]['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0xa92381,null))[_0x6b0e('0x22')](function(_0x4dacb5){if(_0x4dacb5){return _0x4dacb5[_0x6b0e('0x6e')](_0x2ad68c['query'][_0x6b0e('0x6f')]);}})[_0x6b0e('0x22')](respondWithStatusCode(_0xa92381,null))['catch'](handleError(_0xa92381,null));};exports[_0x6b0e('0x70')]=function(_0x366cd7,_0x2f7298,_0x45a650){if(_0x366cd7[_0x6b0e('0x67')]['id']){delete _0x366cd7[_0x6b0e('0x67')]['id'];}return db[_0x6b0e('0x3f')][_0x6b0e('0x5e')]({'where':{'id':_0x366cd7[_0x6b0e('0x59')]['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x2f7298,null))['then'](function(_0x1a37e1){if(_0x1a37e1){_0x366cd7[_0x6b0e('0x67')][_0x6b0e('0x6a')]=_0x1a37e1['id'];return db['CannedAnswer'][_0x6b0e('0x5f')](_0x366cd7['body']);}})[_0x6b0e('0x22')](respondWithResult(_0x2f7298,null))[_0x6b0e('0x66')](handleError(_0x2f7298,null));};exports[_0x6b0e('0x71')]=function(_0x17c094,_0x5b82f6,_0x39e8e6){var _0x409450={'raw':![],'where':{}};var _0x343b74={};var _0x406b28={'count':0x0,'rows':[]};return db[_0x6b0e('0x3f')][_0x6b0e('0x6d')]({'where':{'id':_0x17c094[_0x6b0e('0x59')]['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x5b82f6,null))['then'](function(_0x1b2cc8){if(_0x1b2cc8){_0x343b74['model']=_['keys'](db[_0x6b0e('0x72')][_0x6b0e('0x40')]);_0x343b74[_0x6b0e('0x45')]=_['keys'](_0x17c094['query']);_0x343b74[_0x6b0e('0x47')]=_['intersection'](_0x343b74[_0x6b0e('0x49')],_0x343b74[_0x6b0e('0x45')]);_0x409450['attributes']=_[_0x6b0e('0x48')](_0x343b74[_0x6b0e('0x49')],qs[_0x6b0e('0x4b')](_0x17c094[_0x6b0e('0x45')][_0x6b0e('0x4b')]));_0x409450[_0x6b0e('0x4a')]=_0x409450[_0x6b0e('0x4a')][_0x6b0e('0x4c')]?_0x409450[_0x6b0e('0x4a')]:_0x343b74[_0x6b0e('0x49')];if(!_0x17c094[_0x6b0e('0x45')][_0x6b0e('0x4d')](_0x6b0e('0x4e'))){_0x409450[_0x6b0e('0x32')]=qs[_0x6b0e('0x32')](_0x17c094[_0x6b0e('0x45')][_0x6b0e('0x32')]);_0x409450[_0x6b0e('0x2f')]=qs[_0x6b0e('0x2f')](_0x17c094['query'][_0x6b0e('0x2f')]);}_0x409450[_0x6b0e('0x4f')]=qs[_0x6b0e('0x50')](_0x17c094[_0x6b0e('0x45')][_0x6b0e('0x50')]);_0x409450[_0x6b0e('0x53')]=qs[_0x6b0e('0x47')](_['pick'](_0x17c094['query'],_0x343b74['filters']));_0x409450['where']['WhatsappAccountId']=_0x1b2cc8['id'];if(_0x17c094['query'][_0x6b0e('0x52')]){_0x409450[_0x6b0e('0x53')]=_[_0x6b0e('0x5c')](_0x409450[_0x6b0e('0x53')],{'$or':_[_0x6b0e('0x44')](_0x409450[_0x6b0e('0x4a')],function(_0x4fd2ea){var _0x57b6a6={};_0x57b6a6[_0x4fd2ea]={'$like':'%'+_0x17c094[_0x6b0e('0x45')][_0x6b0e('0x52')]+'%'};return _0x57b6a6;})});}_0x409450=_[_0x6b0e('0x5c')]({},_0x409450,_0x17c094[_0x6b0e('0x5d')]);return db[_0x6b0e('0x72')][_0x6b0e('0x31')]({'where':_0x409450[_0x6b0e('0x53')]})[_0x6b0e('0x22')](function(_0x9ae13c){_0x406b28['count']=_0x9ae13c;if(_0x17c094['query'][_0x6b0e('0x5b')]){_0x409450['include']=[{'all':!![]}];}return db[_0x6b0e('0x72')]['findAll'](_0x409450);})[_0x6b0e('0x22')](function(_0x25f38e){_0x406b28[_0x6b0e('0x57')]=_0x25f38e;return _0x406b28;});}})[_0x6b0e('0x22')](respondWithFilteredResult(_0x5b82f6,_0x409450))[_0x6b0e('0x66')](handleError(_0x5b82f6,null));};exports[_0x6b0e('0x73')]=function(_0x1c220a,_0x507bb2,_0x7ea63c){return db[_0x6b0e('0x3f')]['find']({'where':{'id':_0x1c220a['params']['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x507bb2,null))['then'](function(_0x2f33d2){if(_0x2f33d2){return _0x2f33d2[_0x6b0e('0x73')](_0x1c220a[_0x6b0e('0x45')][_0x6b0e('0x6f')]);}})[_0x6b0e('0x22')](respondWithStatusCode(_0x507bb2,null))[_0x6b0e('0x66')](handleError(_0x507bb2,null));};exports['addAgents']=function(_0x3f4999,_0x407172,_0x307229){return db[_0x6b0e('0x3f')][_0x6b0e('0x5e')]({'where':{'id':_0x3f4999['params']['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x407172,null))[_0x6b0e('0x22')](function(_0x8f76ff){if(_0x8f76ff){return _0x8f76ff['addAgents'](_0x3f4999[_0x6b0e('0x67')]['ids'],_['omit'](_0x3f4999[_0x6b0e('0x67')],[_0x6b0e('0x6f'),'id'])||{})[_0x6b0e('0x74')](function(_0x2d27a0){for(var _0x209c68=0x0;_0x209c68<_0x3f4999['body'][_0x6b0e('0x6f')][_0x6b0e('0x4c')];_0x209c68+=0x1){socket[_0x6b0e('0x75')]('userWhatsappAccount:save',{'UserId':Number(_0x3f4999[_0x6b0e('0x67')]['ids'][_0x209c68]),'WhatsappAccountId':Number(_0x3f4999['params']['id'])});}return _0x2d27a0;});}})[_0x6b0e('0x22')](respondWithResult(_0x407172,null))['catch'](handleError(_0x407172,null));};exports['removeAgents']=function(_0x404651,_0x173139,_0x5ce9ed){return db[_0x6b0e('0x3f')][_0x6b0e('0x5e')]({'where':{'id':_0x404651[_0x6b0e('0x59')]['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x173139,null))[_0x6b0e('0x22')](function(_0x13c353){if(_0x13c353){return _0x13c353[_0x6b0e('0x76')](_0x404651['query'][_0x6b0e('0x6f')])['then'](function(){if(_[_0x6b0e('0x77')](_0x404651[_0x6b0e('0x45')][_0x6b0e('0x6f')])){for(var _0x200dde=0x0;_0x200dde<_0x404651['query'][_0x6b0e('0x6f')]['length'];_0x200dde+=0x1){socket[_0x6b0e('0x75')](_0x6b0e('0x78'),{'UserId':Number(_0x404651[_0x6b0e('0x45')]['ids'][_0x200dde]),'WhatsappAccountId':Number(_0x404651[_0x6b0e('0x59')]['id'])});}}else{socket[_0x6b0e('0x75')](_0x6b0e('0x78'),{'UserId':Number(_0x404651[_0x6b0e('0x45')][_0x6b0e('0x6f')]),'WhatsappAccountId':Number(_0x404651[_0x6b0e('0x59')]['id'])});}});}})[_0x6b0e('0x22')](respondWithStatusCode(_0x173139,null))[_0x6b0e('0x66')](handleError(_0x173139,null));};exports[_0x6b0e('0x79')]=function(_0x27fbb8,_0x33aa23,_0xe2e08d){var _0x1a8209={};var _0xc83af9={};var _0x5a3d74;var _0x3167ff;return db[_0x6b0e('0x3f')][_0x6b0e('0x6d')]({'where':{'id':_0x27fbb8[_0x6b0e('0x59')]['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x33aa23,null))[_0x6b0e('0x22')](function(_0x3623eb){if(_0x3623eb){_0x5a3d74=_0x3623eb;_0xc83af9[_0x6b0e('0x49')]=_['keys'](db[_0x6b0e('0x7a')][_0x6b0e('0x40')]);_0xc83af9[_0x6b0e('0x45')]=_[_0x6b0e('0x46')](_0x27fbb8['query']);_0xc83af9[_0x6b0e('0x47')]=_[_0x6b0e('0x48')](_0xc83af9[_0x6b0e('0x49')],_0xc83af9[_0x6b0e('0x45')]);_0x1a8209[_0x6b0e('0x4a')]=_[_0x6b0e('0x48')](_0xc83af9[_0x6b0e('0x49')],qs[_0x6b0e('0x4b')](_0x27fbb8[_0x6b0e('0x45')][_0x6b0e('0x4b')]));_0x1a8209['attributes']=_0x1a8209[_0x6b0e('0x4a')][_0x6b0e('0x4c')]?_0x1a8209['attributes']:_0xc83af9[_0x6b0e('0x49')];_0x1a8209[_0x6b0e('0x4f')]=qs[_0x6b0e('0x50')](_0x27fbb8['query']['sort']);_0x1a8209[_0x6b0e('0x53')]=qs['filters'](_[_0x6b0e('0x51')](_0x27fbb8[_0x6b0e('0x45')],_0xc83af9['filters']));if(_0x27fbb8[_0x6b0e('0x45')][_0x6b0e('0x52')]){_0x1a8209['where']=_[_0x6b0e('0x5c')](_0x1a8209[_0x6b0e('0x53')],{'$or':_[_0x6b0e('0x44')](_0x1a8209[_0x6b0e('0x4a')],function(_0x225f78){var _0x3897b2={};_0x3897b2[_0x225f78]={'$like':'%'+_0x27fbb8[_0x6b0e('0x45')][_0x6b0e('0x52')]+'%'};return _0x3897b2;})});}_0x1a8209=_[_0x6b0e('0x5c')]({},_0x1a8209,_0x27fbb8[_0x6b0e('0x5d')]);return _0x5a3d74[_0x6b0e('0x79')](_0x1a8209);}})[_0x6b0e('0x22')](function(_0x400ff5){if(_0x400ff5){_0x3167ff=_0x400ff5['length'];if(!_0x27fbb8[_0x6b0e('0x45')]['hasOwnProperty'](_0x6b0e('0x4e'))){_0x1a8209[_0x6b0e('0x32')]=qs[_0x6b0e('0x32')](_0x27fbb8['query'][_0x6b0e('0x32')]);_0x1a8209[_0x6b0e('0x2f')]=qs[_0x6b0e('0x2f')](_0x27fbb8[_0x6b0e('0x45')][_0x6b0e('0x2f')]);}return _0x5a3d74[_0x6b0e('0x79')](_0x1a8209);}})[_0x6b0e('0x22')](function(_0xdbbbdd){if(_0xdbbbdd){return _0xdbbbdd?{'count':_0x3167ff,'rows':_0xdbbbdd}:null;}})['then'](respondWithResult(_0x33aa23,null))[_0x6b0e('0x66')](handleError(_0x33aa23,null));};exports[_0x6b0e('0x7b')]=function(_0x22308a,_0x23bbbf){var _0x5f3e36=_0x22308a['params']['id'];var _0x3572dc=_0x22308a[_0x6b0e('0x67')];var _0x404c5a=0xc8;var _0x396f4a=null;return db[_0x6b0e('0x7c')][_0x6b0e('0x7d')]({'isolationLevel':db[_0x6b0e('0x7c')]['Transaction'][_0x6b0e('0x7e')][_0x6b0e('0x7f')]},function(_0x5061b3){return db[_0x6b0e('0x3f')][_0x6b0e('0x6d')]({'where':{'id':_0x5f3e36},'transaction':_0x5061b3})['then'](function(_0x1a6990){if(_0x1a6990){return db[_0x6b0e('0x80')][_0x6b0e('0x37')]({'where':{'WhatsappAccountId':_0x5f3e36},'transaction':_0x5061b3})[_0x6b0e('0x22')](function(){var _0x2fd27c=_['map'](_0x3572dc,function(_0x45ba97){_0x45ba97['WhatsappAccountId']=_0x5f3e36;return _0x45ba97;});return db[_0x6b0e('0x80')][_0x6b0e('0x81')](_0x2fd27c,{'transaction':_0x5061b3});});}else{_0x404c5a=0x194;_0x396f4a=[];}});})[_0x6b0e('0x22')](function(){if(_0x404c5a!==0x194){return db[_0x6b0e('0x80')][_0x6b0e('0x82')]({'where':{'WhatsappAccountId':_0x5f3e36},'order':'priority'})[_0x6b0e('0x22')](function(_0x2c004b){_0x396f4a=_0x2c004b;});}})[_0x6b0e('0x66')](function(_0x23be29){_0x404c5a=0x1f4;logger[_0x6b0e('0x29')](_0x23be29[_0x6b0e('0x83')]);if(_0x23be29[_0x6b0e('0x3b')]){delete _0x23be29[_0x6b0e('0x3b')];}_0x396f4a=_0x23be29;})['finally'](function(){if(_0x396f4a===null){_0x23bbbf[_0x6b0e('0x2c')](_0x404c5a);}else{if(_0x404c5a===0x1f4){_0x23bbbf[_0x6b0e('0x2d')](_0x404c5a)['send'](_0x396f4a);}else{_0x23bbbf[_0x6b0e('0x2d')](_0x404c5a)[_0x6b0e('0x2e')](_0x396f4a);}}});};exports['getApplications']=function(_0x1b7424,_0x5b8708,_0x20d2ec){var _0x2d39a7={};var _0x50a56={};var _0x50962b;var _0x35a4cd;return db['WhatsappAccount'][_0x6b0e('0x6d')]({'where':{'id':_0x1b7424[_0x6b0e('0x59')]['id']}})[_0x6b0e('0x22')](handleEntityNotFound(_0x5b8708,null))[_0x6b0e('0x22')](function(_0x4b04ad){if(_0x4b04ad){_0x50962b=_0x4b04ad;_0x50a56['model']=_[_0x6b0e('0x46')](db['WhatsappApplication'][_0x6b0e('0x40')]);_0x50a56[_0x6b0e('0x45')]=_[_0x6b0e('0x46')](_0x1b7424[_0x6b0e('0x45')]);_0x50a56[_0x6b0e('0x47')]=_[_0x6b0e('0x48')](_0x50a56[_0x6b0e('0x49')],_0x50a56['query']);_0x2d39a7[_0x6b0e('0x4a')]=_[_0x6b0e('0x48')](_0x50a56[_0x6b0e('0x49')],qs[_0x6b0e('0x4b')](_0x1b7424[_0x6b0e('0x45')]['fields']));_0x2d39a7['attributes']=_0x2d39a7[_0x6b0e('0x4a')][_0x6b0e('0x4c')]?_0x2d39a7[_0x6b0e('0x4a')]:_0x50a56[_0x6b0e('0x49')];_0x2d39a7[_0x6b0e('0x4f')]=qs[_0x6b0e('0x50')](_0x1b7424[_0x6b0e('0x45')][_0x6b0e('0x50')]);_0x2d39a7['where']=qs[_0x6b0e('0x47')](_[_0x6b0e('0x51')](_0x1b7424[_0x6b0e('0x45')],_0x50a56[_0x6b0e('0x47')]));if(_0x1b7424[_0x6b0e('0x45')]['filter']){_0x2d39a7[_0x6b0e('0x53')]=_[_0x6b0e('0x5c')](_0x2d39a7['where'],{'$or':_[_0x6b0e('0x44')](_0x2d39a7['attributes'],function(_0x21c447){var _0x29f361={};_0x29f361[_0x21c447]={'$like':'%'+_0x1b7424['query'][_0x6b0e('0x52')]+'%'};return _0x29f361;})});}_0x2d39a7=_[_0x6b0e('0x5c')]({},_0x2d39a7,_0x1b7424[_0x6b0e('0x5d')]);return _0x50962b[_0x6b0e('0x84')](_0x2d39a7);}})['then'](function(_0x5c5320){if(_0x5c5320){_0x35a4cd=_0x5c5320[_0x6b0e('0x4c')];if(!_0x1b7424['query'][_0x6b0e('0x4d')](_0x6b0e('0x4e'))){_0x2d39a7[_0x6b0e('0x32')]=qs[_0x6b0e('0x32')](_0x1b7424[_0x6b0e('0x45')]['limit']);_0x2d39a7['offset']=qs['offset'](_0x1b7424[_0x6b0e('0x45')][_0x6b0e('0x2f')]);}return _0x50962b[_0x6b0e('0x84')](_0x2d39a7);}})['then'](function(_0x19d678){if(_0x19d678){return _0x19d678?{'count':_0x35a4cd,'rows':_0x19d678}:null;}})[_0x6b0e('0x22')](respondWithResult(_0x5b8708,null))[_0x6b0e('0x66')](handleError(_0x5b8708,null));};exports[_0x6b0e('0x85')]=function(_0x3dc4ae,_0x4b39f2,_0x6f24c){var _0x6a7fc0={'channel':_0x6b0e('0x86')};var _0x4c8130=[];var _0x49fc07=[];var _0x167433={};return db['WhatsappAccount'][_0x6b0e('0x5e')]({'where':{'id':_0x3dc4ae[_0x6b0e('0x59')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x6b0e('0x87')}]})[_0x6b0e('0x22')](handleEntityNotFound(_0x4b39f2,null))[_0x6b0e('0x22')](function(_0xa56b90){_0x6a7fc0[_0x6b0e('0x88')]=_0xa56b90;if(_0x6a7fc0[_0x6b0e('0x88')]&&_0x6a7fc0[_0x6b0e('0x88')]['type']===_0x6b0e('0x89')&&_0x3dc4ae['body'][_0x6b0e('0x8a')]){if(_0x3dc4ae[_0x6b0e('0x67')][_0x6b0e('0x8a')]['length']===0x0)return;if(_0x3dc4ae[_0x6b0e('0x67')]['statuses'][0x0][_0x6b0e('0x8b')]!==_0x6b0e('0x8c'))return;return db[_0x6b0e('0x8d')][_0x6b0e('0x36')]({'read':!![],'readAt':_0x3dc4ae[_0x6b0e('0x67')]['statuses'][0x0][_0x6b0e('0x8e')]},{'where':{'messageId':_0x3dc4ae[_0x6b0e('0x67')][_0x6b0e('0x8a')][0x0]['message_id']},'individualHooks':!![]})[_0x6b0e('0x22')](function(_0x3a5e2c){return _0x4b39f2[_0x6b0e('0x2d')](0xc8)[_0x6b0e('0x2e')](_0x3a5e2c);});}_0x6a7fc0[_0x6b0e('0x8f')]=_[_0x6b0e('0x90')](_0xa56b90[_0x6b0e('0x87')],[_0x6b0e('0x91')],[_0x6b0e('0x92')]);if(_0x6a7fc0[_0x6b0e('0x88')][_0x6b0e('0x87')]){delete _0x6a7fc0['account']['Applications'];}return db[_0x6b0e('0x93')]['describe']()[_0x6b0e('0x22')](function(_0x48c25f){if(!_0x48c25f){throw new db[(_0x6b0e('0x94'))][(_0x6b0e('0x95'))]('no\x20available\x20attributes');}_0x4c8130=_[_0x6b0e('0x96')](_[_0x6b0e('0x46')](_0x48c25f),[_0x6b0e('0x97'),_0x6b0e('0x98')]);_0x49fc07=_['difference'](_[_0x6b0e('0x46')](_0x48c25f),[_0x6b0e('0x97'),_0x6b0e('0x98'),_0x6b0e('0x99'),_0x6b0e('0x9a')]);_0x6a7fc0[_0x6b0e('0x67')]={'mapKey':_0x6b0e('0x9b')};if(_0x6a7fc0['account']&&_0x6a7fc0['account'][_0x6b0e('0x42')]==='twilio'){_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x9c')]=_0x3dc4ae[_0x6b0e('0x67')][_0x6b0e('0x9d')][_0x6b0e('0x9e')]('whatsapp:','');_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x67')]=_0x3dc4ae[_0x6b0e('0x67')][_0x6b0e('0x9f')];_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0xa0')]=_0x3dc4ae[_0x6b0e('0x67')]['MessageSid'];}if(_0x6a7fc0[_0x6b0e('0x88')]&&_0x6a7fc0['account'][_0x6b0e('0x42')]==='sinch'){_0x6a7fc0['body'][_0x6b0e('0x9c')]=_0x3dc4ae['body'][_0x6b0e('0xa1')][0x0][_0x6b0e('0x9c')];_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x67')]=_0x3dc4ae[_0x6b0e('0x67')][_0x6b0e('0xa1')][0x0][_0x6b0e('0x2a')][_0x6b0e('0x67')];_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0xa0')]=_0x3dc4ae['body'][_0x6b0e('0xa1')][0x0]['message_id'];}if(_0x6a7fc0[_0x6b0e('0x67')]['id']){delete _0x6a7fc0[_0x6b0e('0x67')]['id'];}if(_[_0x6b0e('0xa2')](_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x9c')])){throw new db['Sequelize'][(_0x6b0e('0x95'))](_0x6b0e('0xa3'));}if(_['isNil'](_0x6a7fc0['body'][_0x6b0e('0x67')])||_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x67')]===''){throw new db[(_0x6b0e('0x94'))][(_0x6b0e('0x95'))](_0x6b0e('0xa4'));}if(_['isNil'](_0x6a7fc0['body']['mapKey'])){throw new db['Sequelize'][(_0x6b0e('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49fc07);}if(!_[_0x6b0e('0xa5')](_0x49fc07,_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0xa6')])){throw new db[(_0x6b0e('0x94'))][(_0x6b0e('0x95'))](_0x6b0e('0xa7')+_0x49fc07);}_0x167433[_0x6a7fc0['body']['mapKey']]=_0x6a7fc0['body'][_0x6b0e('0x9c')];return db[_0x6b0e('0xa8')][_0x6b0e('0x5e')]({'where':{'id':_0x6a7fc0[_0x6b0e('0x88')][_0x6b0e('0x9a')]},'include':[{'model':db[_0x6b0e('0x93')],'as':'Contacts','where':_0x167433,'limit':0x1,'order':[['updatedAt',_0x6b0e('0xa9')]]}]});})[_0x6b0e('0x22')](handleEntityNotFound(_0x4b39f2,null))['then'](function(_0x39c906){if(_0x39c906){_0x6a7fc0[_0x6b0e('0xaa')]=_['omit'](_0x39c906,['Contacts']);if(_0x39c906['Contacts'][_0x6b0e('0x4c')]){return _0x39c906[_0x6b0e('0xab')][0x0];}var _0x7f9645=_[_0x6b0e('0x1a')](_0x6a7fc0[_0x6b0e('0x67')],{'firstName':_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x9c')],'ListId':_0x39c906['id']});_0x7f9645[_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0xa6')]]=_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x9c')];return db[_0x6b0e('0x93')][_0x6b0e('0x5f')](_0x7f9645,{'fields':_0x4c8130,'raw':!![]});}})[_0x6b0e('0x22')](handleEntityNotFound(_0x4b39f2,null))['then'](function(_0x5577ff){if(_0x5577ff){_0x6a7fc0[_0x6b0e('0xac')]=_0x5577ff;var _0x2c1f68={'ContactId':_0x5577ff['id'],'phone':_0x6a7fc0[_0x6b0e('0x67')][_0x6b0e('0x9c')],'WhatsappAccountId':_0x3dc4ae[_0x6b0e('0x59')]['id']};var _0x4ac6d9={'ContactId':_0x5577ff['id'],'WhatsappAccountId':_0x3dc4ae[_0x6b0e('0x59')]['id'],'closed':![]};return db[_0x6b0e('0xad')]['find']({'where':_0x4ac6d9})['then'](function(_0x8f336d){if(_0x8f336d){return[_0x8f336d,![]];}return db[_0x6b0e('0xad')]['create'](_0x2c1f68)['then'](function(_0x51049d){return[_0x51049d,!![]];});});}})['spread'](function(_0x2e93b7,_0x281d88){_0x6a7fc0[_0x6b0e('0xae')]=_0x2e93b7['get']({'plain':!![]});_0x6a7fc0['interaction'][_0x6b0e('0xaf')]=![];if(_0x281d88){if(_0x6a7fc0[_0x6b0e('0x88')][_0x6b0e('0xb0')]){_0x6a7fc0['applications'][_0x6b0e('0xb1')]({'id':0x0,'priority':_0x6a7fc0[_0x6b0e('0x8f')][_0x6b0e('0x4c')]+0x1,'app':_0x6b0e('0xb2'),'appdata':_0x6b0e('0xb3'),'interval':_0x6b0e('0xb4')});}_0x6a7fc0['interaction'][_0x6b0e('0xaf')]=!![];}return db['WhatsappMessage'][_0x6b0e('0x5f')]({'phone':_0x6a7fc0['body'][_0x6b0e('0x9c')],'messageId':_0x6a7fc0[_0x6b0e('0x67')]['messageId'],'body':_0x6a7fc0[_0x6b0e('0x67')]['body'],'WhatsappAccountId':_0x3dc4ae['params']['id'],'WhatsappInteractionId':_0x2e93b7['id'],'direction':'in','ContactId':_0x2e93b7['ContactId'],'AttachmentId':_0x6a7fc0['body'][_0x6b0e('0xb5')]});})[_0x6b0e('0x22')](function(_0x1891a0){_0x6a7fc0[_0x6b0e('0x2a')]=_0x1891a0;if(_0x6a7fc0[_0x6b0e('0xae')][_0x6b0e('0xb6')]){return db['User'][_0x6b0e('0x5e')]({'attributes':['id',_0x6b0e('0x3b')],'where':{'id':_0x6a7fc0[_0x6b0e('0xae')][_0x6b0e('0xb6')]}})['then'](function(_0x233ebd){if(_0x233ebd){_0x6a7fc0[_0x6b0e('0x8f')][_0x6b0e('0xb7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x233ebd[_0x6b0e('0x3b')]+','+(_0x6a7fc0[_0x6b0e('0x88')][_0x6b0e('0xb8')]||0xa),'interval':_0x6b0e('0xb4')});}return respondWithRpcPromise(_0x6b0e('0xb9'),_0x6b0e('0xba'),_0x6a7fc0);});}return respondWithRpcPromise(_0x6b0e('0xb9'),'startRouting',_0x6a7fc0);})['then'](function(_0xc4644b){if(_0xc4644b){var _0x19870f=0xc8;var _0x5bbb95=_0x6b0e('0xbb');logger[_0x6b0e('0x23')](_0x6b0e('0x27'),_0x5bbb95,_0x19870f,_0x6b0e('0xbc'));logger[_0x6b0e('0x26')](_0x6b0e('0xbd'),_0x5bbb95,_0x19870f,_0x6b0e('0xbc'),JSON['stringify'](_0xc4644b));if(_0x6a7fc0[_0x6b0e('0x88')][_0x6b0e('0x42')]==='twilio'){return _0x4b39f2['status'](_0x19870f)[_0x6b0e('0xbe')]('Content-Type',_0x6b0e('0xbf'))[_0x6b0e('0x3c')](_0x6b0e('0xc0'));}else{return _0x4b39f2[_0x6b0e('0x2d')](_0x19870f)[_0x6b0e('0x2e')](_0xc4644b);}}});})[_0x6b0e('0x66')](handleError(_0x4b39f2,null));};exports[_0x6b0e('0x3c')]=function(_0x51102d,_0x369dea,_0x5b56e3){var _0x471818,_0xfa41c7,_0x496ae3;if(_['isNil'](_0x51102d[_0x6b0e('0x67')]['body'])||_0x51102d['body'][_0x6b0e('0x67')]===''){throw new db[(_0x6b0e('0x94'))][(_0x6b0e('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6b0e('0xa2')](_0x51102d['body']['to'])){throw new db[(_0x6b0e('0x94'))][(_0x6b0e('0x95'))]('to\x20is\x20mandatory');}_0x471818=_0x51102d['body']['to'];return db['WhatsappAccount'][_0x6b0e('0x5e')]({'where':{'id':_0x51102d['params']['id']},'include':[{'model':db[_0x6b0e('0xa8')],'as':_0x6b0e('0xc1'),'include':[{'model':db[_0x6b0e('0x93')],'as':_0x6b0e('0xab'),'where':{'mobile':_0x471818},'limit':0x1,'order':[[_0x6b0e('0x98'),'DESC']]}]}]})[_0x6b0e('0x22')](handleEntityNotFound(_0x369dea,null))[_0x6b0e('0x22')](function(_0x1b7f4e){if(_0x1b7f4e&&_0x1b7f4e[_0x6b0e('0xc1')]){_0xfa41c7=_0x1b7f4e['get']({'plain':!![]});if(_0xfa41c7[_0x6b0e('0xc1')]&&_0xfa41c7[_0x6b0e('0xc1')][_0x6b0e('0xab')][_0x6b0e('0x4c')]){return _0xfa41c7['List'][_0x6b0e('0xab')][0x0];}return db['CmContact']['create'](_[_0x6b0e('0x1a')](_0x51102d['body'],{'firstName':_0x471818,'mobile':_0x471818,'phone':_0x471818,'ListId':_0xfa41c7[_0x6b0e('0x9a')]}));}})['then'](handleEntityNotFound(_0x369dea,null))[_0x6b0e('0x22')](function(_0x469991){if(_0x469991){_0x496ae3=_0x469991;return db['WhatsappInteraction'][_0x6b0e('0x5e')]({'where':{'ContactId':_0x496ae3['id'],'closed':![],'WhatsappAccountId':_0xfa41c7['id']}})[_0x6b0e('0x22')](function(_0x5d3859){if(_0x5d3859){return[_0x5d3859,![]];}return db[_0x6b0e('0xad')][_0x6b0e('0x5f')]({'UserId':_0x51102d[_0x6b0e('0x60')]['id'],'ContactId':_0x496ae3['id'],'WhatsappAccountId':_0xfa41c7['id'],'phone':_0x471818,'firstMsgDirection':'out','Messages':[_[_0x6b0e('0x5c')](_0x51102d[_0x6b0e('0x67')],{'read':![],'body':_0x51102d[_0x6b0e('0x67')][_0x6b0e('0x67')],'phone':_0x471818,'WhatsappAccountId':_0xfa41c7['id'],'UserId':_0x51102d[_0x6b0e('0x60')]['id'],'ContactId':_0x496ae3['id']})]},{'include':[{'model':db[_0x6b0e('0x8d')],'as':'Messages'}]})[_0x6b0e('0x22')](function(_0x11d0f6){return[_0x11d0f6,!![]];});});}})[_0x6b0e('0x74')](function(_0x36396e,_0x5e536d){if(_0x5e536d){return _0x36396e;}return db[_0x6b0e('0x8d')][_0x6b0e('0x5f')](_[_0x6b0e('0x5c')](_0x51102d[_0x6b0e('0x67')],{'read':![],'body':_0x51102d[_0x6b0e('0x67')][_0x6b0e('0x67')],'phone':_0x471818,'WhatsappAccountId':_0xfa41c7['id'],'WhatsappInteractionId':_0x36396e['id'],'UserId':_0x51102d[_0x6b0e('0x60')]['id'],'ContactId':_0x496ae3['id']}))[_0x6b0e('0x22')](function(_0x55313f){_0x36396e[_0x6b0e('0xc2')]['Messages']=[];_0x36396e['dataValues']['Messages']['push'](_0x55313f[_0x6b0e('0xc2')]);return _0x36396e;});})[_0x6b0e('0x22')](respondWithResult(_0x369dea,null))[_0x6b0e('0x66')](handleError(_0x369dea,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 8c8aba9..985d229 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 _0xe96b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove'];(function(_0x4fa0fe,_0x23649c){var _0x45503e=function(_0x46c795){while(--_0x46c795){_0x4fa0fe['push'](_0x4fa0fe['shift']());}};_0x45503e(++_0x23649c);}(_0xe96b,0xc2));var _0xbe96=function(_0x2b9bef,_0x2596f1){_0x2b9bef=_0x2b9bef-0x0;var _0x31a71f=_0xe96b[_0x2b9bef];return _0x31a71f;};'use strict';var EventEmitter=require(_0xbe96('0x0'));var WhatsappAccount=require(_0xbe96('0x1'))['db'][_0xbe96('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbe96('0x3')](0x0);var events={'afterCreate':_0xbe96('0x4'),'afterUpdate':'update','afterDestroy':_0xbe96('0x5')};function emitEvent(_0xadad14){return function(_0x3fcea7,_0x4aa773,_0x3e5fce){WhatsappAccountEvents[_0xbe96('0x6')](_0xadad14+':'+_0x3fcea7['id'],_0x3fcea7);WhatsappAccountEvents[_0xbe96('0x6')](_0xadad14,_0x3fcea7);_0x3e5fce(null);};}for(var e in events){if(events[_0xbe96('0x7')](e)){var event=events[e];WhatsappAccount[_0xbe96('0x8')](e,emitEvent(event));}}module[_0xbe96('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x35ec=['events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x3ddb4e,_0x5d9ecf){var _0x16202e=function(_0x505a25){while(--_0x505a25){_0x3ddb4e['push'](_0x3ddb4e['shift']());}};_0x16202e(++_0x5d9ecf);}(_0x35ec,0x168));var _0xc35e=function(_0x759848,_0x28a92f){_0x759848=_0x759848-0x0;var _0xf23bbc=_0x35ec[_0x759848];return _0xf23bbc;};'use strict';var EventEmitter=require(_0xc35e('0x0'));var WhatsappAccount=require(_0xc35e('0x1'))['db'][_0xc35e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc35e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc35e('0x4'),'afterDestroy':_0xc35e('0x5')};function emitEvent(_0x1aea36){return function(_0x2870f5,_0x104052,_0x46f599){WhatsappAccountEvents[_0xc35e('0x6')](_0x1aea36+':'+_0x2870f5['id'],_0x2870f5);WhatsappAccountEvents[_0xc35e('0x6')](_0x1aea36,_0x2870f5);_0x46f599(null);};}for(var e in events){if(events[_0xc35e('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xc35e('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index de59cb1..56c0737 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 _0x99f2=['whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./whatsappAccount.attributes','exports','define'];(function(_0x137972,_0x36f5ba){var _0x12447d=function(_0x26392a){while(--_0x26392a){_0x137972['push'](_0x137972['shift']());}};_0x12447d(++_0x36f5ba);}(_0x99f2,0xe8));var _0x299f=function(_0x4efd19,_0x13f942){_0x4efd19=_0x4efd19-0x0;var _0x3b6425=_0x99f2[_0x4efd19];return _0x3b6425;};'use strict';var _=require(_0x299f('0x0'));var util=require(_0x299f('0x1'));var logger=require(_0x299f('0x2'))(_0x299f('0x3'));var moment=require(_0x299f('0x4'));var BPromise=require(_0x299f('0x5'));var rp=require(_0x299f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x299f('0x7'));module[_0x299f('0x8')]=function(_0x1e36b8,_0xd6bb5c){return _0x1e36b8[_0x299f('0x9')]('WhatsappAccount',attributes,{'tableName':_0x299f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb875=['WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x27fcf0,_0x2abcbe){var _0x47ab65=function(_0x1b76e5){while(--_0x1b76e5){_0x27fcf0['push'](_0x27fcf0['shift']());}};_0x47ab65(++_0x2abcbe);}(_0xb875,0x1bc));var _0x5b87=function(_0x5b96e6,_0x2bb5c9){_0x5b96e6=_0x5b96e6-0x0;var _0x4568fc=_0xb875[_0x5b96e6];return _0x4568fc;};'use strict';var _=require(_0x5b87('0x0'));var util=require(_0x5b87('0x1'));var logger=require(_0x5b87('0x2'))(_0x5b87('0x3'));var moment=require(_0x5b87('0x4'));var BPromise=require(_0x5b87('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b87('0x6'));var rimraf=require(_0x5b87('0x7'));var config=require(_0x5b87('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x5b87('0x9')]=function(_0x138dea,_0x9067b0){return _0x138dea[_0x5b87('0xa')](_0x5b87('0xb'),attributes,{'tableName':_0x5b87('0xc'),'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 d7f275c..c53a914 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 _0x281a=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','options','where','include','map','model','attributes','debug'];(function(_0x557df9,_0x534207){var _0x533796=function(_0x31f35e){while(--_0x31f35e){_0x557df9['push'](_0x557df9['shift']());}};_0x533796(++_0x534207);}(_0x281a,0x160));var _0xa281=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x281a[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa281('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa281('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xa281('0x2'));var logger=require(_0xa281('0x3'))(_0xa281('0x4'));var config=require('../../config/environment');var jayson=require(_0xa281('0x5'));var client=jayson['client'][_0xa281('0x6')]({'port':0x232a});config[_0xa281('0x7')]=_['defaults'](config[_0xa281('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa281('0x8'))(new Redis(config['redis']));require(_0xa281('0x9'))[_0xa281('0xa')](socket);function respondWithRpcPromise(_0x3a755c,_0x33bef3,_0x494e7b){return new BPromise(function(_0x2e3ee9,_0x285f9b){return client[_0xa281('0xb')](_0x3a755c,_0x494e7b)[_0xa281('0xc')](function(_0x28e87b){logger[_0xa281('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x33bef3,_0xa281('0xe'));logger['debug'](_0xa281('0xf'),_0x33bef3,_0xa281('0xe'),JSON[_0xa281('0x10')](_0x28e87b));if(_0x28e87b['error']){if(_0x28e87b[_0xa281('0x11')][_0xa281('0x12')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x33bef3,_0x28e87b[_0xa281('0x11')][_0xa281('0x13')]);return _0x285f9b(_0x28e87b[_0xa281('0x11')][_0xa281('0x13')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x33bef3,_0x28e87b['error'][_0xa281('0x13')]);return _0x2e3ee9(_0x28e87b[_0xa281('0x11')]['message']);}else{logger[_0xa281('0xd')](_0xa281('0x14'),_0x33bef3,'request\x20sent');_0x2e3ee9(_0x28e87b[_0xa281('0x15')][_0xa281('0x13')]);}})[_0xa281('0x16')](function(_0x90f990){logger[_0xa281('0x11')](_0xa281('0x14'),_0x33bef3,_0x90f990);_0x285f9b(_0x90f990);});});}exports[_0xa281('0x17')]=function(_0x19065c){var _0x393872=this;return new Promise(function(_0x58c44f,_0x187b46){return db[_0xa281('0x18')]['find']({'raw':_0x19065c['options']?_0x19065c[_0xa281('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x19065c[_0xa281('0x19')]?_0x19065c[_0xa281('0x19')][_0xa281('0x1a')]||null:null,'attributes':_0x19065c[_0xa281('0x19')]?_0x19065c[_0xa281('0x19')]['attributes']||null:null,'include':_0x19065c[_0xa281('0x19')]?_0x19065c['options'][_0xa281('0x1b')]?_[_0xa281('0x1c')](_0x19065c[_0xa281('0x19')][_0xa281('0x1b')],function(_0x271dfd){return{'model':db[_0x271dfd[_0xa281('0x1d')]],'as':_0x271dfd['as'],'attributes':_0x271dfd[_0xa281('0x1e')],'include':_0x271dfd[_0xa281('0x1b')]?_[_0xa281('0x1c')](_0x271dfd[_0xa281('0x1b')],function(_0x2fa0e8){return{'model':db[_0x2fa0e8[_0xa281('0x1d')]],'as':_0x2fa0e8['as'],'attributes':_0x2fa0e8[_0xa281('0x1e')],'include':_0x2fa0e8[_0xa281('0x1b')]?_[_0xa281('0x1c')](_0x2fa0e8[_0xa281('0x1b')],function(_0x7b1305){return{'model':db[_0x7b1305[_0xa281('0x1d')]],'as':_0x7b1305['as'],'attributes':_0x7b1305[_0xa281('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa281('0xc')](function(_0x5e5312){logger['info']('ShowWhatsappAccount',_0x19065c);logger[_0xa281('0x1f')](_0xa281('0x17'),_0x19065c,JSON[_0xa281('0x10')](_0x5e5312));_0x58c44f(_0x5e5312);})[_0xa281('0x16')](function(_0x4bf25f){logger[_0xa281('0x11')]('ShowWhatsappAccount',_0x4bf25f['message'],_0x19065c);_0x187b46(_0x393872[_0xa281('0x11')](0x1f4,_0x4bf25f['message']));});});}; \ No newline at end of file +var _0x7101=['raw','where','attributes','include','model','map','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options'];(function(_0x373858,_0xd24b55){var _0x375ccb=function(_0x45c49f){while(--_0x45c49f){_0x373858['push'](_0x373858['shift']());}};_0x375ccb(++_0xd24b55);}(_0x7101,0xdf));var _0x1710=function(_0x165082,_0x207ae8){_0x165082=_0x165082-0x0;var _0x21989b=_0x7101[_0x165082];return _0x21989b;};'use strict';var _=require('lodash');var util=require(_0x1710('0x0'));var moment=require(_0x1710('0x1'));var BPromise=require(_0x1710('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1710('0x3'));var db=require(_0x1710('0x4'))['db'];var utils=require(_0x1710('0x5'));var logger=require(_0x1710('0x6'))(_0x1710('0x7'));var config=require(_0x1710('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1710('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x1710('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1710('0xb'))(new Redis(config[_0x1710('0xa')]));require(_0x1710('0xc'))[_0x1710('0xd')](socket);function respondWithRpcPromise(_0x4d1602,_0x4e501c,_0x2992be){return new BPromise(function(_0x171621,_0x59ef56){return client[_0x1710('0xe')](_0x4d1602,_0x2992be)[_0x1710('0xf')](function(_0x156bd1){logger[_0x1710('0x10')](_0x1710('0x11'),_0x4e501c,_0x1710('0x12'));logger[_0x1710('0x13')](_0x1710('0x14'),_0x4e501c,_0x1710('0x12'),JSON['stringify'](_0x156bd1));if(_0x156bd1[_0x1710('0x15')]){if(_0x156bd1['error'][_0x1710('0x16')]===0x1f4){logger['error'](_0x1710('0x11'),_0x4e501c,_0x156bd1['error']['message']);return _0x59ef56(_0x156bd1['error'][_0x1710('0x17')]);}logger[_0x1710('0x15')](_0x1710('0x11'),_0x4e501c,_0x156bd1[_0x1710('0x15')][_0x1710('0x17')]);return _0x171621(_0x156bd1[_0x1710('0x15')]['message']);}else{logger[_0x1710('0x10')](_0x1710('0x11'),_0x4e501c,_0x1710('0x12'));_0x171621(_0x156bd1[_0x1710('0x18')][_0x1710('0x17')]);}})['catch'](function(_0x329b68){logger['error'](_0x1710('0x11'),_0x4e501c,_0x329b68);_0x59ef56(_0x329b68);});});}exports[_0x1710('0x19')]=function(_0x289d9b){var _0x3eb05c=this;return new Promise(function(_0x32b890,_0x54a1e6){return db[_0x1710('0x1a')][_0x1710('0x1b')]({'raw':_0x289d9b[_0x1710('0x1c')]?_0x289d9b[_0x1710('0x1c')][_0x1710('0x1d')]===undefined?!![]:![]:!![],'where':_0x289d9b[_0x1710('0x1c')]?_0x289d9b[_0x1710('0x1c')][_0x1710('0x1e')]||null:null,'attributes':_0x289d9b[_0x1710('0x1c')]?_0x289d9b[_0x1710('0x1c')][_0x1710('0x1f')]||null:null,'include':_0x289d9b[_0x1710('0x1c')]?_0x289d9b[_0x1710('0x1c')][_0x1710('0x20')]?_['map'](_0x289d9b['options'][_0x1710('0x20')],function(_0x4dba25){return{'model':db[_0x4dba25[_0x1710('0x21')]],'as':_0x4dba25['as'],'attributes':_0x4dba25[_0x1710('0x1f')],'include':_0x4dba25['include']?_[_0x1710('0x22')](_0x4dba25['include'],function(_0x3431b3){return{'model':db[_0x3431b3[_0x1710('0x21')]],'as':_0x3431b3['as'],'attributes':_0x3431b3[_0x1710('0x1f')],'include':_0x3431b3[_0x1710('0x20')]?_[_0x1710('0x22')](_0x3431b3[_0x1710('0x20')],function(_0x32a341){return{'model':db[_0x32a341[_0x1710('0x21')]],'as':_0x32a341['as'],'attributes':_0x32a341[_0x1710('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b19db){logger['info'](_0x1710('0x19'),_0x289d9b);logger['debug']('ShowWhatsappAccount',_0x289d9b,JSON[_0x1710('0x23')](_0x2b19db));_0x32b890(_0x2b19db);})['catch'](function(_0x539457){logger[_0x1710('0x15')](_0x1710('0x19'),_0x539457[_0x1710('0x17')],_0x289d9b);_0x54a1e6(_0x3eb05c[_0x1710('0x15')](0x1f4,_0x539457[_0x1710('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index ce97b3e..084965d 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 _0x18df=['length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x2a247d,_0x31b76e){var _0x42358b=function(_0x4897aa){while(--_0x4897aa){_0x2a247d['push'](_0x2a247d['shift']());}};_0x42358b(++_0x31b76e);}(_0x18df,0x134));var _0xf18d=function(_0x229290,_0x58a651){_0x229290=_0x229290-0x0;var _0x3f463f=_0x18df[_0x229290];return _0x3f463f;};'use strict';var WhatsappAccountEvents=require(_0xf18d('0x0'));var events=[_0xf18d('0x1'),_0xf18d('0x2'),_0xf18d('0x3')];function createListener(_0x450dde,_0xa9012a){return function(_0x52f1d3){_0xa9012a[_0xf18d('0x4')](_0x450dde,_0x52f1d3);};}function removeListener(_0x258f40,_0x4b1320){return function(){WhatsappAccountEvents[_0xf18d('0x5')](_0x258f40,_0x4b1320);};}exports[_0xf18d('0x6')]=function(_0x3df182){for(var _0x4dd193=0x0,_0x4b9bab=events[_0xf18d('0x7')];_0x4dd193<_0x4b9bab;_0x4dd193++){var _0x4a212e=events[_0x4dd193];var _0x4b2a16=createListener(_0xf18d('0x8')+_0x4a212e,_0x3df182);WhatsappAccountEvents['on'](_0x4a212e,_0x4b2a16);}}; \ No newline at end of file +var _0xbd72=['length','whatsappAccount:','./whatsappAccount.events','save','update','removeListener','register'];(function(_0x3700ad,_0x45fe7f){var _0x5b4cea=function(_0x4192c2){while(--_0x4192c2){_0x3700ad['push'](_0x3700ad['shift']());}};_0x5b4cea(++_0x45fe7f);}(_0xbd72,0x79));var _0x2bd7=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0xbd72[_0x533110];return _0xc3c866;};'use strict';var WhatsappAccountEvents=require(_0x2bd7('0x0'));var events=[_0x2bd7('0x1'),'remove',_0x2bd7('0x2')];function createListener(_0x5bad5e,_0x4622e6){return function(_0x5aae53){_0x4622e6['emit'](_0x5bad5e,_0x5aae53);};}function removeListener(_0x568488,_0xa67571){return function(){WhatsappAccountEvents[_0x2bd7('0x3')](_0x568488,_0xa67571);};}exports[_0x2bd7('0x4')]=function(_0x550fc9){for(var _0x1d0312=0x0,_0x145c85=events[_0x2bd7('0x5')];_0x1d0312<_0x145c85;_0x1d0312++){var _0x513b8c=events[_0x1d0312];var _0x5e5263=createListener(_0x2bd7('0x6')+_0x513b8c,_0x550fc9);WhatsappAccountEvents['on'](_0x513b8c,_0x5e5263);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 37c8eea..776c38c 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 _0x1d9f=['./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x1d9f,0x114));var _0xf1d9=function(_0x14bea3,_0x436ec5){_0x14bea3=_0x14bea3-0x0;var _0x59bae7=_0x1d9f[_0x14bea3];return _0x59bae7;};'use strict';var multer=require(_0xf1d9('0x0'));var util=require(_0xf1d9('0x1'));var path=require(_0xf1d9('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1d9('0x3'));var router=express[_0xf1d9('0x4')]();var fs_extra=require(_0xf1d9('0x5'));var auth=require(_0xf1d9('0x6'));var interaction=require(_0xf1d9('0x7'));var config=require(_0xf1d9('0x8'));var controller=require(_0xf1d9('0x9'));router[_0xf1d9('0xa')]('/',auth[_0xf1d9('0xb')](),controller['index']);router[_0xf1d9('0xa')](_0xf1d9('0xc'),auth[_0xf1d9('0xb')](),controller[_0xf1d9('0xd')]);router[_0xf1d9('0xe')]('/',auth['isAuthenticated'](),controller[_0xf1d9('0xf')]);router[_0xf1d9('0x10')](_0xf1d9('0xc'),auth[_0xf1d9('0xb')](),controller[_0xf1d9('0x11')]);router['delete'](_0xf1d9('0xc'),auth[_0xf1d9('0xb')](),controller[_0xf1d9('0x12')]);module['exports']=router; \ No newline at end of file +var _0x321e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','/:id','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2f2524,_0x538a0f){var _0x1b932a=function(_0x40b131){while(--_0x40b131){_0x2f2524['push'](_0x2f2524['shift']());}};_0x1b932a(++_0x538a0f);}(_0x321e,0x9a));var _0xe321=function(_0x3f08d8,_0x28eb87){_0x3f08d8=_0x3f08d8-0x0;var _0x5165d0=_0x321e[_0x3f08d8];return _0x5165d0;};'use strict';var multer=require(_0xe321('0x0'));var util=require(_0xe321('0x1'));var path=require(_0xe321('0x2'));var timeout=require(_0xe321('0x3'));var express=require(_0xe321('0x4'));var router=express[_0xe321('0x5')]();var fs_extra=require(_0xe321('0x6'));var auth=require(_0xe321('0x7'));var interaction=require(_0xe321('0x8'));var config=require(_0xe321('0x9'));var controller=require('./whatsappApplication.controller');router[_0xe321('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xe321('0xb')](),controller[_0xe321('0xc')]);router[_0xe321('0xd')]('/',auth[_0xe321('0xb')](),controller['create']);router['put'](_0xe321('0xe'),auth[_0xe321('0xb')](),controller['update']);router['delete'](_0xe321('0xe'),auth[_0xe321('0xb')](),controller['destroy']);module[_0xe321('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 34d9af8..dee4521 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 _0x3a89=['*,*,*,*','sequelize','STRING','noop'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a89,0x1ed));var _0x93a8=function(_0x43ba87,_0x3ddc7e){_0x43ba87=_0x43ba87-0x0;var _0x23fa6a=_0x3a89[_0x43ba87];return _0x23fa6a;};'use strict';var Sequelize=require(_0x93a8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x93a8('0x1')],'allowNull':![],'defaultValue':_0x93a8('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x93a8('0x3')}}; \ No newline at end of file +var _0xa23b=['STRING','TEXT','*,*,*,*','sequelize'];(function(_0x4b9b78,_0x1dc74a){var _0x330388=function(_0x49bcdc){while(--_0x49bcdc){_0x4b9b78['push'](_0x4b9b78['shift']());}};_0x330388(++_0x1dc74a);}(_0xa23b,0xe7));var _0xba23=function(_0x5b64a8,_0x1c12d3){_0x5b64a8=_0x5b64a8-0x0;var _0xd6bcde=_0xa23b[_0x5b64a8];return _0xd6bcde;};'use strict';var Sequelize=require(_0xba23('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xba23('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xba23('0x2')]()},'description':{'type':Sequelize[_0xba23('0x1')]},'interval':{'type':Sequelize[_0xba23('0x1')],'defaultValue':_0xba23('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f2b86ec..6daba83 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 _0x235b=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','WhatsappApplication','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','rawAttributes','fields','create','body','find','eml-format','fast-json-patch','request-promise','moment'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0x235b,0x1ed));var _0xb235=function(_0x7d20a1,_0x1eb4b0){_0x7d20a1=_0x7d20a1-0x0;var _0x4abebe=_0x235b[_0x7d20a1];return _0x4abebe;};'use strict';var emlformat=require(_0xb235('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb235('0x1'));var rp=require(_0xb235('0x2'));var moment=require(_0xb235('0x3'));var BPromise=require(_0xb235('0x4'));var Mustache=require(_0xb235('0x5'));var util=require(_0xb235('0x6'));var path=require('path');var sox=require(_0xb235('0x7'));var csv=require(_0xb235('0x8'));var ejs=require(_0xb235('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb235('0xa'));var squel=require(_0xb235('0xb'));var crypto=require(_0xb235('0xc'));var jsforce=require(_0xb235('0xd'));var deskjs=require(_0xb235('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb235('0xf'));var Redis=require(_0xb235('0x10'));var authService=require(_0xb235('0x11'));var qs=require(_0xb235('0x12'));var as=require(_0xb235('0x13'));var hardwareService=require(_0xb235('0x14'));var logger=require(_0xb235('0x15'))(_0xb235('0x16'));var utils=require('../../config/utils');var config=require(_0xb235('0x17'));var licenseUtil=require(_0xb235('0x18'));var db=require(_0xb235('0x19'))['db'];function respondWithStatusCode(_0x4e9804,_0x438371){_0x438371=_0x438371||0xcc;return function(_0x5aee68){if(_0x5aee68){return _0x4e9804[_0xb235('0x1a')](_0x438371);}return _0x4e9804[_0xb235('0x1b')](_0x438371)[_0xb235('0x1c')]();};}function respondWithResult(_0x147c1e,_0x47510a){_0x47510a=_0x47510a||0xc8;return function(_0xfa8e36){if(_0xfa8e36){return _0x147c1e[_0xb235('0x1b')](_0x47510a)['json'](_0xfa8e36);}};}function respondWithFilteredResult(_0xa2ac23,_0x2f5a4d){return function(_0x3d6ebc){if(_0x3d6ebc){var _0xa5e185=typeof _0x2f5a4d[_0xb235('0x1d')]===_0xb235('0x1e')&&typeof _0x2f5a4d[_0xb235('0x1f')]===_0xb235('0x1e');var _0x2d6520=_0x3d6ebc[_0xb235('0x20')];var _0x2f1c46=_0xa5e185?0x0:_0x2f5a4d[_0xb235('0x1d')];var _0x1f7cb9=_0xa5e185?_0x3d6ebc['count']:_0x2f5a4d[_0xb235('0x1d')]+_0x2f5a4d['limit'];var _0x2d3e1c;if(_0x1f7cb9>=_0x2d6520){_0x1f7cb9=_0x2d6520;_0x2d3e1c=0xc8;}else{_0x2d3e1c=0xce;}_0xa2ac23['status'](_0x2d3e1c);return _0xa2ac23[_0xb235('0x21')](_0xb235('0x22'),_0x2f1c46+'-'+_0x1f7cb9+'/'+_0x2d6520)['json'](_0x3d6ebc);}return null;};}function patchUpdates(_0x447ec6){return function(_0x3a9699){try{jsonpatch[_0xb235('0x23')](_0x3a9699,_0x447ec6,!![]);}catch(_0x2ed3e4){return BPromise[_0xb235('0x24')](_0x2ed3e4);}return _0x3a9699['save']();};}function saveUpdates(_0x26d55d,_0x12f787){return function(_0x403abf){if(_0x403abf){return _0x403abf[_0xb235('0x25')](_0x26d55d)[_0xb235('0x26')](function(_0x38561e){return _0x38561e;});}return null;};}function removeEntity(_0x57a3a8,_0x3eaa0d){return function(_0x57d7f5){if(_0x57d7f5){return _0x57d7f5[_0xb235('0x27')]()[_0xb235('0x26')](function(){_0x57a3a8[_0xb235('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5698b6,_0x4c4df1){return function(_0x21676c){if(!_0x21676c){_0x5698b6['sendStatus'](0x194);}return _0x21676c;};}function handleError(_0x493bd2,_0x1f0790){_0x1f0790=_0x1f0790||0x1f4;return function(_0x1c6621){logger[_0xb235('0x28')](_0x1c6621['stack']);if(_0x1c6621[_0xb235('0x29')]){delete _0x1c6621['name'];}_0x493bd2['status'](_0x1f0790)[_0xb235('0x2a')](_0x1c6621);};}exports[_0xb235('0x2b')]=function(_0x3751bd,_0x4fe640){var _0xa6def8={},_0x3b66e1={},_0x235df0={'count':0x0,'rows':[]};var _0x52f52e=_['map'](db[_0xb235('0x2c')]['rawAttributes'],function(_0x130574){return{'name':_0x130574['fieldName'],'type':_0x130574['type'][_0xb235('0x2d')]};});_0x3b66e1[_0xb235('0x2e')]=_['map'](_0x52f52e,_0xb235('0x29'));_0x3b66e1[_0xb235('0x2f')]=_[_0xb235('0x30')](_0x3751bd[_0xb235('0x2f')]);_0x3b66e1[_0xb235('0x31')]=_[_0xb235('0x32')](_0x3b66e1[_0xb235('0x2e')],_0x3b66e1[_0xb235('0x2f')]);_0xa6def8[_0xb235('0x33')]=_[_0xb235('0x32')](_0x3b66e1['model'],qs['fields'](_0x3751bd[_0xb235('0x2f')]['fields']));_0xa6def8['attributes']=_0xa6def8[_0xb235('0x33')][_0xb235('0x34')]?_0xa6def8[_0xb235('0x33')]:_0x3b66e1[_0xb235('0x2e')];if(!_0x3751bd[_0xb235('0x2f')]['hasOwnProperty'](_0xb235('0x35'))){_0xa6def8[_0xb235('0x1f')]=qs[_0xb235('0x1f')](_0x3751bd[_0xb235('0x2f')][_0xb235('0x1f')]);_0xa6def8[_0xb235('0x1d')]=qs[_0xb235('0x1d')](_0x3751bd[_0xb235('0x2f')]['offset']);}_0xa6def8[_0xb235('0x36')]=qs['sort'](_0x3751bd[_0xb235('0x2f')]['sort']);_0xa6def8[_0xb235('0x37')]=qs[_0xb235('0x31')](_['pick'](_0x3751bd[_0xb235('0x2f')],_0x3b66e1['filters']),_0x52f52e);if(_0x3751bd[_0xb235('0x2f')][_0xb235('0x38')]){_0xa6def8[_0xb235('0x37')]=_[_0xb235('0x39')](_0xa6def8['where'],{'$or':_['map'](_0x52f52e,function(_0x126218){if(_0x126218[_0xb235('0x3a')]!=='VIRTUAL'){var _0x473cd9={};_0x473cd9[_0x126218['name']]={'$like':'%'+_0x3751bd[_0xb235('0x2f')]['filter']+'%'};return _0x473cd9;}})});}_0xa6def8=_[_0xb235('0x39')]({},_0xa6def8,_0x3751bd[_0xb235('0x3b')]);var _0x3f4a74={'where':_0xa6def8['where']};return db[_0xb235('0x2c')][_0xb235('0x20')](_0x3f4a74)[_0xb235('0x26')](function(_0x3b468b){_0x235df0['count']=_0x3b468b;if(_0x3751bd[_0xb235('0x2f')][_0xb235('0x3c')]){_0xa6def8[_0xb235('0x3d')]=[{'all':!![]}];}return db[_0xb235('0x2c')][_0xb235('0x3e')](_0xa6def8);})[_0xb235('0x26')](function(_0x274ed8){_0x235df0['rows']=_0x274ed8;return _0x235df0;})[_0xb235('0x26')](respondWithFilteredResult(_0x4fe640,_0xa6def8))[_0xb235('0x3f')](handleError(_0x4fe640,null));};exports[_0xb235('0x40')]=function(_0x1ddc0f,_0x457a5a){var _0x5ad7ef={'raw':!![],'where':{'id':_0x1ddc0f[_0xb235('0x41')]['id']}},_0x4f243a={};_0x4f243a[_0xb235('0x2e')]=_[_0xb235('0x30')](db['WhatsappApplication'][_0xb235('0x42')]);_0x4f243a[_0xb235('0x2f')]=_[_0xb235('0x30')](_0x1ddc0f[_0xb235('0x2f')]);_0x4f243a[_0xb235('0x31')]=_[_0xb235('0x32')](_0x4f243a['model'],_0x4f243a['query']);_0x5ad7ef['attributes']=_[_0xb235('0x32')](_0x4f243a[_0xb235('0x2e')],qs[_0xb235('0x43')](_0x1ddc0f[_0xb235('0x2f')][_0xb235('0x43')]));_0x5ad7ef[_0xb235('0x33')]=_0x5ad7ef['attributes'][_0xb235('0x34')]?_0x5ad7ef[_0xb235('0x33')]:_0x4f243a[_0xb235('0x2e')];if(_0x1ddc0f[_0xb235('0x2f')][_0xb235('0x3c')]){_0x5ad7ef[_0xb235('0x3d')]=[{'all':!![]}];}_0x5ad7ef=_[_0xb235('0x39')]({},_0x5ad7ef,_0x1ddc0f['options']);return db['WhatsappApplication']['find'](_0x5ad7ef)[_0xb235('0x26')](handleEntityNotFound(_0x457a5a,null))['then'](respondWithResult(_0x457a5a,null))[_0xb235('0x3f')](handleError(_0x457a5a,null));};exports[_0xb235('0x44')]=function(_0x1d0916,_0x21b2aa){return db[_0xb235('0x2c')]['create'](_0x1d0916['body'],{})['then'](respondWithResult(_0x21b2aa,0xc9))[_0xb235('0x3f')](handleError(_0x21b2aa,null));};exports[_0xb235('0x25')]=function(_0x478ae8,_0x23276b){if(_0x478ae8[_0xb235('0x45')]['id']){delete _0x478ae8['body']['id'];}return db[_0xb235('0x2c')][_0xb235('0x46')]({'where':{'id':_0x478ae8['params']['id']}})['then'](handleEntityNotFound(_0x23276b,null))[_0xb235('0x26')](saveUpdates(_0x478ae8['body'],null))[_0xb235('0x26')](respondWithResult(_0x23276b,null))[_0xb235('0x3f')](handleError(_0x23276b,null));};exports[_0xb235('0x27')]=function(_0x4db9fe,_0xe2f5d0){return db['WhatsappApplication'][_0xb235('0x46')]({'where':{'id':_0x4db9fe[_0xb235('0x41')]['id']}})[_0xb235('0x26')](handleEntityNotFound(_0xe2f5d0,null))[_0xb235('0x26')](removeEntity(_0xe2f5d0,null))[_0xb235('0x3f')](handleError(_0xe2f5d0,null));}; \ No newline at end of file +var _0xc891=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','name','send','WhatsappApplication','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','create','body','find','catch','destroy','eml-format','fast-json-patch'];(function(_0x47ac28,_0x21ef8d){var _0x181e17=function(_0x2e71b3){while(--_0x2e71b3){_0x47ac28['push'](_0x47ac28['shift']());}};_0x181e17(++_0x21ef8d);}(_0xc891,0x152));var _0x1c89=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xc891[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x1'));var rp=require('request-promise');var moment=require(_0x1c89('0x2'));var BPromise=require(_0x1c89('0x3'));var Mustache=require(_0x1c89('0x4'));var util=require('util');var path=require(_0x1c89('0x5'));var sox=require(_0x1c89('0x6'));var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));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(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var licenseUtil=require(_0x1c89('0x12'));var db=require(_0x1c89('0x13'))['db'];function respondWithStatusCode(_0x7a4a2b,_0x27e7c0){_0x27e7c0=_0x27e7c0||0xcc;return function(_0x393b5f){if(_0x393b5f){return _0x7a4a2b[_0x1c89('0x14')](_0x27e7c0);}return _0x7a4a2b['status'](_0x27e7c0)[_0x1c89('0x15')]();};}function respondWithResult(_0x514e4d,_0x46be15){_0x46be15=_0x46be15||0xc8;return function(_0x424651){if(_0x424651){return _0x514e4d[_0x1c89('0x16')](_0x46be15)['json'](_0x424651);}};}function respondWithFilteredResult(_0x45354d,_0x29602e){return function(_0x2c9572){if(_0x2c9572){var _0x4af31b=typeof _0x29602e[_0x1c89('0x17')]===_0x1c89('0x18')&&typeof _0x29602e[_0x1c89('0x19')]===_0x1c89('0x18');var _0x33afcf=_0x2c9572[_0x1c89('0x1a')];var _0x2cb186=_0x4af31b?0x0:_0x29602e[_0x1c89('0x17')];var _0x166444=_0x4af31b?_0x2c9572[_0x1c89('0x1a')]:_0x29602e[_0x1c89('0x17')]+_0x29602e['limit'];var _0x18ce93;if(_0x166444>=_0x33afcf){_0x166444=_0x33afcf;_0x18ce93=0xc8;}else{_0x18ce93=0xce;}_0x45354d[_0x1c89('0x16')](_0x18ce93);return _0x45354d['set'](_0x1c89('0x1b'),_0x2cb186+'-'+_0x166444+'/'+_0x33afcf)[_0x1c89('0x1c')](_0x2c9572);}return null;};}function patchUpdates(_0x14121c){return function(_0x43a17a){try{jsonpatch['apply'](_0x43a17a,_0x14121c,!![]);}catch(_0x4ef155){return BPromise[_0x1c89('0x1d')](_0x4ef155);}return _0x43a17a[_0x1c89('0x1e')]();};}function saveUpdates(_0x253e07,_0x23def1){return function(_0x5b4fbc){if(_0x5b4fbc){return _0x5b4fbc[_0x1c89('0x1f')](_0x253e07)[_0x1c89('0x20')](function(_0x4fbd33){return _0x4fbd33;});}return null;};}function removeEntity(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(_0x1ac0cc){return _0x1ac0cc['destroy']()[_0x1c89('0x20')](function(){_0x45f604[_0x1c89('0x16')](0xcc)[_0x1c89('0x15')]();});}};}function handleEntityNotFound(_0x59a87e,_0x22afe9){return function(_0x49f69b){if(!_0x49f69b){_0x59a87e['sendStatus'](0x194);}return _0x49f69b;};}function handleError(_0x35cc05,_0x352449){_0x352449=_0x352449||0x1f4;return function(_0x4c4694){logger['error'](_0x4c4694['stack']);if(_0x4c4694[_0x1c89('0x21')]){delete _0x4c4694['name'];}_0x35cc05['status'](_0x352449)[_0x1c89('0x22')](_0x4c4694);};}exports['index']=function(_0x193d8d,_0x51aa70){var _0x4dac46={},_0x25500d={},_0x10dc12={'count':0x0,'rows':[]};var _0x14f7cb=_['map'](db[_0x1c89('0x23')][_0x1c89('0x24')],function(_0x487916){return{'name':_0x487916[_0x1c89('0x25')],'type':_0x487916['type'][_0x1c89('0x26')]};});_0x25500d[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x14f7cb,_0x1c89('0x21'));_0x25500d[_0x1c89('0x29')]=_[_0x1c89('0x2a')](_0x193d8d[_0x1c89('0x29')]);_0x25500d[_0x1c89('0x2b')]=_[_0x1c89('0x2c')](_0x25500d[_0x1c89('0x27')],_0x25500d['query']);_0x4dac46[_0x1c89('0x2d')]=_['intersection'](_0x25500d['model'],qs[_0x1c89('0x2e')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x4dac46[_0x1c89('0x2d')]=_0x4dac46[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x4dac46[_0x1c89('0x2d')]:_0x25500d[_0x1c89('0x27')];if(!_0x193d8d[_0x1c89('0x29')][_0x1c89('0x30')](_0x1c89('0x31'))){_0x4dac46['limit']=qs['limit'](_0x193d8d[_0x1c89('0x29')]['limit']);_0x4dac46['offset']=qs[_0x1c89('0x17')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x17')]);}_0x4dac46[_0x1c89('0x32')]=qs[_0x1c89('0x33')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x33')]);_0x4dac46['where']=qs[_0x1c89('0x2b')](_[_0x1c89('0x34')](_0x193d8d['query'],_0x25500d[_0x1c89('0x2b')]),_0x14f7cb);if(_0x193d8d[_0x1c89('0x29')][_0x1c89('0x35')]){_0x4dac46[_0x1c89('0x36')]=_[_0x1c89('0x37')](_0x4dac46['where'],{'$or':_[_0x1c89('0x28')](_0x14f7cb,function(_0x2e6ebd){if(_0x2e6ebd[_0x1c89('0x38')]!=='VIRTUAL'){var _0xed5122={};_0xed5122[_0x2e6ebd['name']]={'$like':'%'+_0x193d8d[_0x1c89('0x29')]['filter']+'%'};return _0xed5122;}})});}_0x4dac46=_[_0x1c89('0x37')]({},_0x4dac46,_0x193d8d[_0x1c89('0x39')]);var _0x45152f={'where':_0x4dac46[_0x1c89('0x36')]};return db[_0x1c89('0x23')][_0x1c89('0x1a')](_0x45152f)[_0x1c89('0x20')](function(_0x1b8566){_0x10dc12[_0x1c89('0x1a')]=_0x1b8566;if(_0x193d8d['query'][_0x1c89('0x3a')]){_0x4dac46[_0x1c89('0x3b')]=[{'all':!![]}];}return db[_0x1c89('0x23')][_0x1c89('0x3c')](_0x4dac46);})['then'](function(_0x36e3a7){_0x10dc12[_0x1c89('0x3d')]=_0x36e3a7;return _0x10dc12;})[_0x1c89('0x20')](respondWithFilteredResult(_0x51aa70,_0x4dac46))['catch'](handleError(_0x51aa70,null));};exports['show']=function(_0xa1d4bb,_0x21fa5c){var _0x5f33c0={'raw':!![],'where':{'id':_0xa1d4bb[_0x1c89('0x3e')]['id']}},_0xebb4c3={};_0xebb4c3[_0x1c89('0x27')]=_[_0x1c89('0x2a')](db[_0x1c89('0x23')][_0x1c89('0x24')]);_0xebb4c3[_0x1c89('0x29')]=_['keys'](_0xa1d4bb[_0x1c89('0x29')]);_0xebb4c3['filters']=_['intersection'](_0xebb4c3[_0x1c89('0x27')],_0xebb4c3[_0x1c89('0x29')]);_0x5f33c0[_0x1c89('0x2d')]=_[_0x1c89('0x2c')](_0xebb4c3[_0x1c89('0x27')],qs[_0x1c89('0x2e')](_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x5f33c0[_0x1c89('0x2d')]=_0x5f33c0[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x5f33c0[_0x1c89('0x2d')]:_0xebb4c3[_0x1c89('0x27')];if(_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x3a')]){_0x5f33c0[_0x1c89('0x3b')]=[{'all':!![]}];}_0x5f33c0=_['merge']({},_0x5f33c0,_0xa1d4bb[_0x1c89('0x39')]);return db['WhatsappApplication']['find'](_0x5f33c0)[_0x1c89('0x20')](handleEntityNotFound(_0x21fa5c,null))['then'](respondWithResult(_0x21fa5c,null))['catch'](handleError(_0x21fa5c,null));};exports[_0x1c89('0x3f')]=function(_0x4b4d3f,_0x5f102d){return db['WhatsappApplication'][_0x1c89('0x3f')](_0x4b4d3f['body'],{})[_0x1c89('0x20')](respondWithResult(_0x5f102d,0xc9))['catch'](handleError(_0x5f102d,null));};exports[_0x1c89('0x1f')]=function(_0x5114bb,_0x36d5fc){if(_0x5114bb[_0x1c89('0x40')]['id']){delete _0x5114bb[_0x1c89('0x40')]['id'];}return db['WhatsappApplication'][_0x1c89('0x41')]({'where':{'id':_0x5114bb[_0x1c89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36d5fc,null))['then'](saveUpdates(_0x5114bb[_0x1c89('0x40')],null))[_0x1c89('0x20')](respondWithResult(_0x36d5fc,null))[_0x1c89('0x42')](handleError(_0x36d5fc,null));};exports[_0x1c89('0x43')]=function(_0x94f616,_0x392fdb){return db[_0x1c89('0x23')][_0x1c89('0x41')]({'where':{'id':_0x94f616[_0x1c89('0x3e')]['id']}})[_0x1c89('0x20')](handleEntityNotFound(_0x392fdb,null))[_0x1c89('0x20')](removeEntity(_0x392fdb,null))[_0x1c89('0x42')](handleError(_0x392fdb,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0de785f..667b412 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 _0xb717=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb717,0x1b4));var _0x7b71=function(_0xfd8609,_0x4fafde){_0xfd8609=_0xfd8609-0x0;var _0x2514c1=_0xb717[_0xfd8609];return _0x2514c1;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b71('0xc'),'collate':_0x7b71('0xd')});}; \ No newline at end of file +var _0x1159=['define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x154d86,_0x2d74b0){var _0x161771=function(_0x155671){while(--_0x155671){_0x154d86['push'](_0x154d86['shift']());}};_0x161771(++_0x2d74b0);}(_0x1159,0xf3));var _0x9115=function(_0x2c0b3e,_0x2fc074){_0x2c0b3e=_0x2c0b3e-0x0;var _0x1dfada=_0x1159[_0x2c0b3e];return _0x1dfada;};'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 diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index aea6cc8..5832f24 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 _0x4bc3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x33d79d,_0x25afff){var _0x58a58e=function(_0x259cec){while(--_0x259cec){_0x33d79d['push'](_0x33d79d['shift']());}};_0x58a58e(++_0x25afff);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x4bc3[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0x377ef1,_0x5d1390){var _0x427550=function(_0x2d56be){while(--_0x2d56be){_0x377ef1['push'](_0x377ef1['shift']());}};_0x427550(++_0x5d1390);}(_0xedd9,0xfc));var _0x9edd=function(_0x4dc956,_0x32f4bb){_0x4dc956=_0x4dc956-0x0;var _0x4a998d=_0xedd9[_0x4dc956];return _0x4a998d;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 35ba146..6589757 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 _0x2675=['index','/describe','describe','/:id/messages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','removeTags','multer','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated'];(function(_0x437486,_0xe418db){var _0x3aac8a=function(_0x4bf79f){while(--_0x4bf79f){_0x437486['push'](_0x437486['shift']());}};_0x3aac8a(++_0xe418db);}(_0x2675,0x75));var _0x5267=function(_0x2192d5,_0x46d11a){_0x2192d5=_0x2192d5-0x0;var _0x259736=_0x2675[_0x2192d5];return _0x259736;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0x6')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller['getMessages']);router[_0x5267('0x6')]('/:id/download',auth[_0x5267('0x7')](),controller['download']);router[_0x5267('0xc')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xd')]);router[_0x5267('0xc')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller[_0x5267('0xe')]);router[_0x5267('0xc')](_0x5267('0xf'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x12')),controller['addTags']);router['put'](_0x5267('0x13'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x14')),controller[_0x5267('0x15')]);router[_0x5267('0x16')](_0x5267('0x13'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x17')),controller['destroy']);router[_0x5267('0x16')](_0x5267('0xf'),auth['isAuthenticated'](),controller[_0x5267('0x18')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','/:id','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id/messages','getMessages','download','post'];(function(_0x2484c6,_0x17dbbd){var _0x3d09a6=function(_0x4fa0a1){while(--_0x4fa0a1){_0x2484c6['push'](_0x2484c6['shift']());}};_0x3d09a6(++_0x17dbbd);}(_0x7a54,0x106));var _0x47a5=function(_0x287f1b,_0x2ac942){_0x287f1b=_0x287f1b-0x0;var _0xb2c7c6=_0x7a54[_0x287f1b];return _0xb2c7c6;};'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/download',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x10')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0x12')]);router[_0x47a5('0x10')](_0x47a5('0x13'),auth[_0x47a5('0xc')](),interaction[_0x47a5('0x14')](_0x47a5('0x15'),_0x47a5('0x16')),controller[_0x47a5('0x17')]);router['put'](_0x47a5('0x18'),auth[_0x47a5('0xc')](),interaction[_0x47a5('0x14')](_0x47a5('0x15'),_0x47a5('0x19')),controller['update']);router['delete'](_0x47a5('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0x47a5('0x15'),_0x47a5('0x1a')),controller[_0x47a5('0x1b')]);router[_0x47a5('0x1c')](_0x47a5('0x13'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1d')]);module[_0x47a5('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 d08688c..d58c81b 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 _0x3fa4=['sequelize','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x54c8ba,_0x3142d6){var _0xcd59b8=function(_0x3b1425){while(--_0x3b1425){_0x54c8ba['push'](_0x54c8ba['shift']());}};_0xcd59b8(++_0x3142d6);}(_0x3fa4,0xf0));var _0x43fa=function(_0x3ffcd6,_0x194c09){_0x3ffcd6=_0x3ffcd6-0x0;var _0x475e14=_0x3fa4[_0x3ffcd6];return _0x475e14;};'use strict';var Sequelize=require(_0x43fa('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x43fa('0x1')]},'disposition':{'type':Sequelize[_0x43fa('0x2')]},'secondDisposition':{'type':Sequelize[_0x43fa('0x2')]},'thirdDisposition':{'type':Sequelize[_0x43fa('0x2')]},'note':{'type':Sequelize[_0x43fa('0x2')]},'phone':{'type':Sequelize[_0x43fa('0x2')]},'read1stAt':{'type':Sequelize[_0x43fa('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x43fa('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x43fa('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x43fa('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x43fa('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xe626=['STRING','DATE','ENUM','sequelize','moment','exports','BOOLEAN'];(function(_0x1098ef,_0x287463){var _0x1ac5e7=function(_0x5b65b2){while(--_0x5b65b2){_0x1098ef['push'](_0x1098ef['shift']());}};_0x1ac5e7(++_0x287463);}(_0xe626,0x9d));var _0x6e62=function(_0x2b46ac,_0x3e056d){_0x2b46ac=_0x2b46ac-0x0;var _0xe79fea=_0xe626[_0x2b46ac];return _0xe79fea;};'use strict';var Sequelize=require(_0x6e62('0x0'));var moment=require(_0x6e62('0x1'));module[_0x6e62('0x2')]={'closed':{'type':Sequelize[_0x6e62('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6e62('0x4')]},'secondDisposition':{'type':Sequelize[_0x6e62('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6e62('0x4')]},'note':{'type':Sequelize[_0x6e62('0x4')]},'phone':{'type':Sequelize[_0x6e62('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6e62('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x6e62('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6e62('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 7425abc..060937e 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 _0x378c=['where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','omit','color','emit','removeTags','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Messages','direction','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','createdAt','closed','closedAt','disposition','Attachment','basename','createReadStream','pipe','createWriteStream','System','out','secret','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','count','Content-Range','update','then','destroy','end','stack','name','index','map','rawAttributes','key','getOptions','findAll','query','show','params','model','keys','WhatsappInteraction','filters','attributes','intersection','fields','length','includeAll','include','merge','options','catch','create','body','find','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','nolimit','limit','order','sort','pick'];(function(_0x2db6cb,_0x5d78fc){var _0x5e7e39=function(_0x39c11f){while(--_0x39c11f){_0x2db6cb['push'](_0x2db6cb['shift']());}};_0x5e7e39(++_0x5d78fc);}(_0x378c,0x137));var _0xc378=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x378c[_0x4c12ec];return _0x3ae42c;};'use strict';var rimraf=require(_0xc378('0x0'));var zipdir=require(_0xc378('0x1'));var moment=require('moment');var BPromise=require(_0xc378('0x2'));var util=require(_0xc378('0x3'));var path=require(_0xc378('0x4'));var ejs=require(_0xc378('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xc378('0x6'));var qs=require(_0xc378('0x7'));var pdf=require(_0xc378('0x8'));var logger=require(_0xc378('0x9'))(_0xc378('0xa'));var config=require(_0xc378('0xb'));var db=require(_0xc378('0xc'))['db'];config[_0xc378('0xd')]=_[_0xc378('0xe')](config['redis'],{'host':_0xc378('0xf'),'port':0x18eb});var socket=require(_0xc378('0x10'))(new Redis(config[_0xc378('0xd')]));require(_0xc378('0x11'))['register'](socket);function respondWithStatusCode(_0x4c4a20,_0xf4cc3d){_0xf4cc3d=_0xf4cc3d||0xcc;return function(_0x127c63){if(_0x127c63){return _0x4c4a20[_0xc378('0x12')](_0xf4cc3d);}return _0x4c4a20[_0xc378('0x13')](_0xf4cc3d)['end']();};}function respondWithResult(_0x13024c,_0x43cf0a){_0x43cf0a=_0x43cf0a||0xc8;return function(_0x22f218){if(_0x22f218){return _0x13024c[_0xc378('0x13')](_0x43cf0a)[_0xc378('0x14')](_0x22f218);}};}function respondWithFilteredResult(_0x43958a,_0x3c05e2){return function(_0x3a2ace){if(_0x3a2ace){var _0x551bfd=typeof _0x3c05e2[_0xc378('0x15')]===_0xc378('0x16')&&typeof _0x3c05e2['limit']===_0xc378('0x16');var _0x5dbd0a=_0x3a2ace[_0xc378('0x17')];var _0x56d7cc=_0x551bfd?0x0:_0x3c05e2[_0xc378('0x15')];var _0x2ed374=_0x551bfd?_0x3a2ace[_0xc378('0x17')]:_0x3c05e2['offset']+_0x3c05e2['limit'];var _0x5a732e;if(_0x2ed374>=_0x5dbd0a){_0x2ed374=_0x5dbd0a;_0x5a732e=0xc8;}else{_0x5a732e=0xce;}_0x43958a['status'](_0x5a732e);return _0x43958a['set'](_0xc378('0x18'),_0x56d7cc+'-'+_0x2ed374+'/'+_0x5dbd0a)['json'](_0x3a2ace);}return null;};}function saveUpdates(_0x2338d0){return function(_0x4a939c){if(_0x4a939c){return _0x4a939c[_0xc378('0x19')](_0x2338d0)[_0xc378('0x1a')](function(_0x453395){return _0x453395;});}return null;};}function removeEntity(_0x1d0481){return function(_0x228907){if(_0x228907){return _0x228907[_0xc378('0x1b')]()[_0xc378('0x1a')](function(){_0x1d0481[_0xc378('0x13')](0xcc)[_0xc378('0x1c')]();});}};}function handleEntityNotFound(_0xbbe24a){return function(_0x4d156c){if(!_0x4d156c){_0xbbe24a[_0xc378('0x12')](0x194);}return _0x4d156c;};}function handleError(_0x484e03,_0xa167d8){_0xa167d8=_0xa167d8||0x1f4;return function(_0x3a0fcc){logger['error'](_0x3a0fcc[_0xc378('0x1d')]);if(_0x3a0fcc[_0xc378('0x1e')]){delete _0x3a0fcc[_0xc378('0x1e')];}_0x484e03['status'](_0xa167d8)['send'](_0x3a0fcc);};}exports[_0xc378('0x1f')]=function(_0x5e1793,_0x5f2b0f){var _0x110c04={};var _0x347d98=_[_0xc378('0x20')](db['WhatsappInteraction'][_0xc378('0x21')],function(_0xb3f913){return{'name':_0xb3f913['fieldName'],'type':_0xb3f913['type'][_0xc378('0x22')]};});_0x110c04=qs[_0xc378('0x23')](_0x347d98,_0x5e1793);return interaction[_0xc378('0x24')]('whatsapp',_0x5e1793[_0xc378('0x25')],_0x5e1793['user'],_0x110c04,_0x347d98)[_0xc378('0x1a')](respondWithFilteredResult(_0x5f2b0f,_0x110c04))['catch'](handleError(_0x5f2b0f,null));};exports[_0xc378('0x26')]=function(_0x4a8cfb,_0x377345){var _0x4e39ec={'raw':![],'where':{'id':_0x4a8cfb[_0xc378('0x27')]['id']}},_0x2d1214={};_0x2d1214[_0xc378('0x28')]=_[_0xc378('0x29')](db[_0xc378('0x2a')][_0xc378('0x21')]);_0x2d1214[_0xc378('0x25')]=_[_0xc378('0x29')](_0x4a8cfb[_0xc378('0x25')]);_0x2d1214[_0xc378('0x2b')]=_['intersection'](_0x2d1214[_0xc378('0x28')],_0x2d1214[_0xc378('0x25')]);_0x4e39ec[_0xc378('0x2c')]=_[_0xc378('0x2d')](_0x2d1214[_0xc378('0x28')],qs['fields'](_0x4a8cfb[_0xc378('0x25')][_0xc378('0x2e')]));_0x4e39ec[_0xc378('0x2c')]=_0x4e39ec[_0xc378('0x2c')][_0xc378('0x2f')]?_0x4e39ec[_0xc378('0x2c')]:_0x2d1214[_0xc378('0x28')];if(_0x4a8cfb[_0xc378('0x25')][_0xc378('0x30')]){_0x4e39ec[_0xc378('0x31')]=[{'all':!![]}];}_0x4e39ec=_[_0xc378('0x32')]({},_0x4e39ec,_0x4a8cfb[_0xc378('0x33')]);return db[_0xc378('0x2a')]['find'](_0x4e39ec)[_0xc378('0x1a')](handleEntityNotFound(_0x377345,null))[_0xc378('0x1a')](respondWithResult(_0x377345,null))[_0xc378('0x34')](handleError(_0x377345,null));};exports['create']=function(_0x1266d8,_0x5e0e86){return db[_0xc378('0x2a')][_0xc378('0x35')](_0x1266d8['body'],{})[_0xc378('0x1a')](respondWithResult(_0x5e0e86,0xc9))['catch'](handleError(_0x5e0e86,null));};exports['update']=function(_0x2ab048,_0x16d29b){if(_0x2ab048[_0xc378('0x36')]['id']){delete _0x2ab048['body']['id'];}return db['WhatsappInteraction'][_0xc378('0x37')]({'where':{'id':_0x2ab048['params']['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x16d29b,null))[_0xc378('0x1a')](saveUpdates(_0x2ab048[_0xc378('0x36')],null))['then'](respondWithResult(_0x16d29b,null))[_0xc378('0x34')](handleError(_0x16d29b,null));};exports[_0xc378('0x1b')]=function(_0x330704,_0x2fb07e){return db[_0xc378('0x2a')][_0xc378('0x37')]({'where':{'id':_0x330704[_0xc378('0x27')]['id']}})['then'](handleEntityNotFound(_0x2fb07e,null))[_0xc378('0x1a')](removeEntity(_0x2fb07e,null))[_0xc378('0x34')](handleError(_0x2fb07e,null));};exports[_0xc378('0x38')]=function(_0x26918d,_0xaa3fc7){return db[_0xc378('0x2a')][_0xc378('0x38')]()[_0xc378('0x1a')](respondWithResult(_0xaa3fc7,null))[_0xc378('0x34')](handleError(_0xaa3fc7,null));};exports[_0xc378('0x39')]=function(_0x1af20e,_0x404793){return db[_0xc378('0x3a')][_0xc378('0x37')]({'where':{'id':_0x1af20e[_0xc378('0x27')]['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x404793,null))['then'](function(_0x3ffb0a){if(_0x3ffb0a){return _0x3ffb0a[_0xc378('0x39')](_0x1af20e[_0xc378('0x36')]['ids'],_['omit'](_0x1af20e['body'],[_0xc378('0x3b'),'id'])||{});}})[_0xc378('0x1a')](respondWithResult(_0x404793,null))['catch'](handleError(_0x404793,null));};exports[_0xc378('0x3c')]=function(_0x5b70fa,_0x10e614){var _0x34f76f={'raw':![],'where':{}};var _0x45b36b={};var _0x288f78={'count':0x0,'rows':[]};return db[_0xc378('0x2a')][_0xc378('0x3d')]({'where':{'id':_0x5b70fa['params']['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x10e614,null))[_0xc378('0x1a')](function(_0x28a3ac){if(_0x28a3ac){_0x45b36b[_0xc378('0x28')]=_[_0xc378('0x29')](db['WhatsappMessage'][_0xc378('0x21')]);_0x45b36b[_0xc378('0x25')]=_['keys'](_0x5b70fa['query']);_0x45b36b[_0xc378('0x2b')]=_['intersection'](_0x45b36b[_0xc378('0x28')],_0x45b36b['query']);_0x34f76f[_0xc378('0x2c')]=_[_0xc378('0x2d')](_0x45b36b[_0xc378('0x28')],qs[_0xc378('0x2e')](_0x5b70fa[_0xc378('0x25')][_0xc378('0x2e')]));_0x34f76f[_0xc378('0x2c')]=_0x34f76f[_0xc378('0x2c')][_0xc378('0x2f')]?_0x34f76f[_0xc378('0x2c')]:_0x45b36b[_0xc378('0x28')];if(!_0x5b70fa[_0xc378('0x25')]['hasOwnProperty'](_0xc378('0x3e'))){_0x34f76f[_0xc378('0x3f')]=qs[_0xc378('0x3f')](_0x5b70fa['query']['limit']);_0x34f76f[_0xc378('0x15')]=qs[_0xc378('0x15')](_0x5b70fa[_0xc378('0x25')][_0xc378('0x15')]);}_0x34f76f[_0xc378('0x40')]=qs[_0xc378('0x41')](_0x5b70fa[_0xc378('0x25')][_0xc378('0x41')]);_0x34f76f['where']=qs[_0xc378('0x2b')](_[_0xc378('0x42')](_0x5b70fa['query'],_0x45b36b[_0xc378('0x2b')]));_0x34f76f[_0xc378('0x43')][_0xc378('0x44')]=_0x28a3ac['id'];if(_0x5b70fa[_0xc378('0x25')][_0xc378('0x45')]){_0x34f76f['where']=_['merge'](_0x34f76f[_0xc378('0x43')],{'$or':_[_0xc378('0x20')](_0x34f76f[_0xc378('0x2c')],function(_0x172184){var _0x5b8953={};_0x5b8953[_0x172184]={'$like':'%'+_0x5b70fa[_0xc378('0x25')][_0xc378('0x45')]+'%'};return _0x5b8953;})});}if(_0x5b70fa[_0xc378('0x25')][_0xc378('0x46')]){var _0x16ffb2=_0x5b70fa[_0xc378('0x25')][_0xc378('0x46')]['split'](',');var _0x3ebe93={};_0x3ebe93[_0x16ffb2[0x0]]={'$gte':moment(_0x16ffb2[0x1])[_0xc378('0x47')](_0xc378('0x48'))};_0x34f76f[_0xc378('0x43')]=_[_0xc378('0x32')](_0x34f76f['where'],_0x3ebe93);}_0x34f76f=_['merge']({},_0x34f76f,_0x5b70fa[_0xc378('0x33')]);return db[_0xc378('0x3a')][_0xc378('0x17')]({'where':_0x34f76f[_0xc378('0x43')]})[_0xc378('0x1a')](function(_0x397ed4){_0x288f78[_0xc378('0x17')]=_0x397ed4;if(_0x5b70fa['query'][_0xc378('0x30')]){_0x34f76f['include']=[{'all':!![]}];}return db[_0xc378('0x3a')][_0xc378('0x24')](_0x34f76f);})[_0xc378('0x1a')](function(_0x2bbfb5){_0x288f78['rows']=_0x2bbfb5;return _0x288f78;});}})['then'](respondWithFilteredResult(_0x10e614,_0x34f76f))['catch'](handleError(_0x10e614,null));};exports[_0xc378('0x49')]=function(_0x58af64,_0x2cf3d8){return db[_0xc378('0x2a')]['find']({'where':{'id':_0x58af64[_0xc378('0x27')]['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x2cf3d8,null))[_0xc378('0x1a')](function(_0x146996){if(_0x146996){return _0x146996['setTags'](_0x58af64[_0xc378('0x36')]['ids'],_[_0xc378('0x4a')](_0x58af64[_0xc378('0x36')],[_0xc378('0x3b'),'id'])||{})['spread'](function(){return db['Tag'][_0xc378('0x24')]({'attributes':['id',_0xc378('0x1e'),_0xc378('0x4b')],'where':{'id':_0x58af64[_0xc378('0x36')][_0xc378('0x3b')]}});})['then'](function(_0x3410c1){socket[_0xc378('0x4c')]('whatsappInteractionTags:save',{'id':Number(_0x58af64['params']['id']),'tags':_0x3410c1||[]});return{'id':Number(_0x58af64['params']['id']),'tags':_0x3410c1||[]};});}})[_0xc378('0x1a')](respondWithResult(_0x2cf3d8,null))[_0xc378('0x34')](handleError(_0x2cf3d8,null));};exports['removeTags']=function(_0x31b31e,_0x312429){return db['WhatsappInteraction']['find']({'where':{'id':_0x31b31e[_0xc378('0x27')]['id']}})['then'](handleEntityNotFound(_0x312429,null))[_0xc378('0x1a')](function(_0x56467c){if(_0x56467c){return _0x56467c[_0xc378('0x4d')](_0x31b31e[_0xc378('0x25')]['ids']);}})['then'](respondWithStatusCode(_0x312429,null))[_0xc378('0x34')](handleError(_0x312429,null));};exports['download']=function(_0x485da8,_0x10045c){var _0x3bc76f=moment()[_0xc378('0x4e')]()[_0xc378('0x4f')]();var _0x1e1a3e=path[_0xc378('0x50')](config[_0xc378('0x51')],'server',_0xc378('0x52'),_0xc378('0x53'));var _0x5b95e3=path['join'](config[_0xc378('0x51')],_0xc378('0x54'),_0xc378('0x52'),_0xc378('0x55'));var _0x381d46=path[_0xc378('0x50')](_0x1e1a3e,_0x3bc76f);var _0x21f692=util[_0xc378('0x47')](_0xc378('0x56'),_0x485da8['params']['id'],_0x3bc76f);var _0x3f0ab8=path['join'](_0x1e1a3e,_0x21f692);var _0x1fc54f=[];_0x1fc54f['push']({'model':db[_0xc378('0x57')],'as':_0xc378('0x57'),'attributes':['id',_0xc378('0x58')],'raw':!![]});_0x1fc54f[_0xc378('0x59')]({'model':db[_0xc378('0x5a')],'as':_0xc378('0x5b'),'attributes':['id',_0xc378('0x5c'),_0xc378('0x5d')],'raw':!![]});if(_0x485da8[_0xc378('0x25')][_0xc378('0x55')]){_0x1fc54f[_0xc378('0x59')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x138e42=[{'model':db['WhatsappMessage'],'as':_0xc378('0x5e'),'attributes':['id','body','createdAt',_0xc378('0x5f'),'secret',_0xc378('0x60')],'include':_0x1fc54f}];_0x138e42[_0xc378('0x59')]({'model':db[_0xc378('0x61')],'as':_0xc378('0x62'),'attributes':['id','name']});_0x138e42[_0xc378('0x59')]({'model':db[_0xc378('0x57')],'as':_0xc378('0x63'),'attributes':['id',_0xc378('0x58')]});return db['WhatsappInteraction'][_0xc378('0x37')]({'where':{'id':_0x485da8[_0xc378('0x27')]['id']},'include':_0x138e42})[_0xc378('0x1a')](handleEntityNotFound(_0x10045c,null))[_0xc378('0x1a')](function(_0x27a0b9){if(_0x27a0b9){var _0x564a45=_0x27a0b9[_0xc378('0x64')]({'plain':!![]});fs[_0xc378('0x65')](_0x381d46);var _0x3de2a1={'channel':_0xc378('0x66'),'account':_0x564a45[_0xc378('0x62')][_0xc378('0x1e')],'agent':_0x564a45['Owner']?_0x564a45['Owner'][_0xc378('0x58')]:_0xc378('0x67'),'createdAt':moment(_0x564a45[_0xc378('0x68')])['format'](_0xc378('0x48'))['toString'](),'closedAt':_0x564a45[_0xc378('0x69')]?moment(_0x564a45[_0xc378('0x6a')])[_0xc378('0x47')](_0xc378('0x48'))[_0xc378('0x4f')]():'','disposition':_0x564a45[_0xc378('0x6b')],'messages':_(_0x564a45[_0xc378('0x5e')])[_0xc378('0x45')]({'secret':![]})[_0xc378('0x20')](function(_0xfc4967){if(_0xfc4967['Attachment']){var _0x472d4f=path[_0xc378('0x50')](_0x5b95e3,_0xfc4967[_0xc378('0x6c')][_0xc378('0x6d')]);if(fs['existsSync'](_0x472d4f)){fs[_0xc378('0x6e')](_0x472d4f)[_0xc378('0x6f')](fs[_0xc378('0x70')](path[_0xc378('0x50')](_0x381d46,_0xfc4967['Attachment'][_0xc378('0x6d')])));}}return{'date':moment(_0xfc4967[_0xc378('0x68')])[_0xc378('0x47')](_0xc378('0x48'))['toString'](),'sender':_0xfc4967[_0xc378('0x5f')]==='out'?_0xfc4967['User']?_0xfc4967[_0xc378('0x57')][_0xc378('0x58')]:_0xc378('0x71'):_0xfc4967[_0xc378('0x5b')][_0xc378('0x5c')]+(_0xfc4967[_0xc378('0x5b')][_0xc378('0x5d')]?'\x20'+_0xfc4967['Contact'][_0xc378('0x5d')]:''),'body':_0xfc4967[_0xc378('0x6c')]?_0xfc4967[_0xc378('0x6c')]['basename']:_0xfc4967[_0xc378('0x36')],'direction':_0xfc4967[_0xc378('0x5f')]===_0xc378('0x72')?'A':'C','secret':_0xfc4967[_0xc378('0x73')],'read':_0xfc4967['read'],'attachment':_0xfc4967[_0xc378('0x6c')]};})[_0xc378('0x74')]()};return ejs[_0xc378('0x75')](path[_0xc378('0x50')](config[_0xc378('0x51')],_0xc378('0x54'),_0xc378('0x76'),'downloadInteraction.ejs'),{'interaction':_0x3de2a1})[_0xc378('0x1a')](function(_0x2dd661){var _0x2e4832=path[_0xc378('0x50')](_0x381d46,_0xc378('0x77')+_0x564a45['id']+'-'+_0x3bc76f+_0xc378('0x78'));var _0x5663a1={'path':_0x2e4832,'channel':_0xc378('0x66'),'interactionId':_0x564a45['id']};return pdf[_0xc378('0x79')](_0x2dd661,_0x5663a1);})['then'](function(){return new BPromise(function(_0x269cf5,_0x8f301a){zipdir(_0x381d46,{'saveTo':_0x3f0ab8},function(_0x37629d,_0x481020){if(_0x37629d)return _0x8f301a(_0x37629d);return _0x269cf5(_0x481020);});})['then'](function(){return new BPromise(function(_0x2bc334,_0x40f7f8){rimraf(_0x381d46,function(_0x49259a){if(_0x49259a)_0x40f7f8(_0x49259a);return _0x2bc334();});});})['then'](function(){return _0x10045c[_0xc378('0x7a')](_0x3f0ab8,_0x21f692,function(_0x52a59a){if(_0x52a59a){console[_0xc378('0x7b')](_0xc378('0x7c'),_0x52a59a);}else{fs[_0xc378('0x7d')](_0x3f0ab8);}});});});}else{return _0x10045c[_0xc378('0x12')](0xc8);}})[_0xc378('0x34')](handleError(_0x10045c,null));}; \ No newline at end of file +var _0x39bb=['count','set','Content-Range','then','destroy','stack','name','index','map','WhatsappInteraction','rawAttributes','fieldName','key','whatsapp','catch','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','limit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','transcript-%d-%s.zip','User','fullname','CmContact','lastName','attachments','Attachment','Messages','createdAt','secret','read','push','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','System','Contact','firstName','out','value','renderFile','views','transcript-','.pdf','log','err','unlinkSync','rimraf','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined'];(function(_0x301ad4,_0x3ccbaa){var _0x1dfbd7=function(_0x18047b){while(--_0x18047b){_0x301ad4['push'](_0x301ad4['shift']());}};_0x1dfbd7(++_0x3ccbaa);}(_0x39bb,0x1e3));var _0xb39b=function(_0x9c173a,_0x461c9c){_0x9c173a=_0x9c173a-0x0;var _0x88d611=_0x39bb[_0x9c173a];return _0x88d611;};'use strict';var rimraf=require(_0xb39b('0x0'));var zipdir=require('zip-dir');var moment=require(_0xb39b('0x1'));var BPromise=require(_0xb39b('0x2'));var util=require('util');var path=require(_0xb39b('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb39b('0x4'));var Redis=require(_0xb39b('0x5'));var interaction=require(_0xb39b('0x6'));var qs=require(_0xb39b('0x7'));var pdf=require(_0xb39b('0x8'));var logger=require(_0xb39b('0x9'))(_0xb39b('0xa'));var config=require('../../config/environment');var db=require(_0xb39b('0xb'))['db'];config[_0xb39b('0xc')]=_['defaults'](config[_0xb39b('0xc')],{'host':_0xb39b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb39b('0xc')]));require('./whatsappInteraction.socket')[_0xb39b('0xe')](socket);function respondWithStatusCode(_0x2238f5,_0x2124f5){_0x2124f5=_0x2124f5||0xcc;return function(_0x166e78){if(_0x166e78){return _0x2238f5[_0xb39b('0xf')](_0x2124f5);}return _0x2238f5[_0xb39b('0x10')](_0x2124f5)[_0xb39b('0x11')]();};}function respondWithResult(_0x358a2a,_0x3f8e54){_0x3f8e54=_0x3f8e54||0xc8;return function(_0x1d4809){if(_0x1d4809){return _0x358a2a[_0xb39b('0x10')](_0x3f8e54)[_0xb39b('0x12')](_0x1d4809);}};}function respondWithFilteredResult(_0x42a0a4,_0xc6a0a1){return function(_0x378ecc){if(_0x378ecc){var _0x492a25=typeof _0xc6a0a1[_0xb39b('0x13')]===_0xb39b('0x14')&&typeof _0xc6a0a1['limit']===_0xb39b('0x14');var _0x12970c=_0x378ecc[_0xb39b('0x15')];var _0xca0436=_0x492a25?0x0:_0xc6a0a1[_0xb39b('0x13')];var _0x4153ef=_0x492a25?_0x378ecc[_0xb39b('0x15')]:_0xc6a0a1['offset']+_0xc6a0a1['limit'];var _0x173d8b;if(_0x4153ef>=_0x12970c){_0x4153ef=_0x12970c;_0x173d8b=0xc8;}else{_0x173d8b=0xce;}_0x42a0a4[_0xb39b('0x10')](_0x173d8b);return _0x42a0a4[_0xb39b('0x16')](_0xb39b('0x17'),_0xca0436+'-'+_0x4153ef+'/'+_0x12970c)[_0xb39b('0x12')](_0x378ecc);}return null;};}function saveUpdates(_0x1914d6){return function(_0x582392){if(_0x582392){return _0x582392['update'](_0x1914d6)[_0xb39b('0x18')](function(_0x506932){return _0x506932;});}return null;};}function removeEntity(_0x38baaa){return function(_0x337b31){if(_0x337b31){return _0x337b31[_0xb39b('0x19')]()[_0xb39b('0x18')](function(){_0x38baaa['status'](0xcc)[_0xb39b('0x11')]();});}};}function handleEntityNotFound(_0x15c52a){return function(_0x8134e6){if(!_0x8134e6){_0x15c52a[_0xb39b('0xf')](0x194);}return _0x8134e6;};}function handleError(_0x3d5c03,_0x3c2cd3){_0x3c2cd3=_0x3c2cd3||0x1f4;return function(_0x57d407){logger['error'](_0x57d407[_0xb39b('0x1a')]);if(_0x57d407[_0xb39b('0x1b')]){delete _0x57d407['name'];}_0x3d5c03['status'](_0x3c2cd3)['send'](_0x57d407);};}exports[_0xb39b('0x1c')]=function(_0x5870f3,_0x2bc1e4){var _0x5e65ea={};var _0x182f59=_[_0xb39b('0x1d')](db[_0xb39b('0x1e')][_0xb39b('0x1f')],function(_0xdb19e9){return{'name':_0xdb19e9[_0xb39b('0x20')],'type':_0xdb19e9['type'][_0xb39b('0x21')]};});_0x5e65ea=qs['getOptions'](_0x182f59,_0x5870f3);return interaction['findAll'](_0xb39b('0x22'),_0x5870f3['query'],_0x5870f3['user'],_0x5e65ea,_0x182f59)[_0xb39b('0x18')](respondWithFilteredResult(_0x2bc1e4,_0x5e65ea))[_0xb39b('0x23')](handleError(_0x2bc1e4,null));};exports['show']=function(_0x56bfcf,_0x18389d){var _0x314f7a={'raw':![],'where':{'id':_0x56bfcf[_0xb39b('0x24')]['id']}},_0x4e37cf={};_0x4e37cf[_0xb39b('0x25')]=_[_0xb39b('0x26')](db[_0xb39b('0x1e')][_0xb39b('0x1f')]);_0x4e37cf['query']=_[_0xb39b('0x26')](_0x56bfcf[_0xb39b('0x27')]);_0x4e37cf[_0xb39b('0x28')]=_[_0xb39b('0x29')](_0x4e37cf[_0xb39b('0x25')],_0x4e37cf['query']);_0x314f7a['attributes']=_[_0xb39b('0x29')](_0x4e37cf[_0xb39b('0x25')],qs['fields'](_0x56bfcf[_0xb39b('0x27')][_0xb39b('0x2a')]));_0x314f7a[_0xb39b('0x2b')]=_0x314f7a[_0xb39b('0x2b')][_0xb39b('0x2c')]?_0x314f7a[_0xb39b('0x2b')]:_0x4e37cf[_0xb39b('0x25')];if(_0x56bfcf[_0xb39b('0x27')][_0xb39b('0x2d')]){_0x314f7a[_0xb39b('0x2e')]=[{'all':!![]}];}_0x314f7a=_[_0xb39b('0x2f')]({},_0x314f7a,_0x56bfcf[_0xb39b('0x30')]);return db[_0xb39b('0x1e')][_0xb39b('0x31')](_0x314f7a)['then'](handleEntityNotFound(_0x18389d,null))['then'](respondWithResult(_0x18389d,null))['catch'](handleError(_0x18389d,null));};exports[_0xb39b('0x32')]=function(_0x106ee6,_0x2072da){return db['WhatsappInteraction'][_0xb39b('0x32')](_0x106ee6[_0xb39b('0x33')],{})[_0xb39b('0x18')](respondWithResult(_0x2072da,0xc9))[_0xb39b('0x23')](handleError(_0x2072da,null));};exports['update']=function(_0x2dba5f,_0x2bef20){if(_0x2dba5f[_0xb39b('0x33')]['id']){delete _0x2dba5f[_0xb39b('0x33')]['id'];}return db[_0xb39b('0x1e')][_0xb39b('0x31')]({'where':{'id':_0x2dba5f[_0xb39b('0x24')]['id']}})['then'](handleEntityNotFound(_0x2bef20,null))[_0xb39b('0x18')](saveUpdates(_0x2dba5f[_0xb39b('0x33')],null))[_0xb39b('0x18')](respondWithResult(_0x2bef20,null))[_0xb39b('0x23')](handleError(_0x2bef20,null));};exports[_0xb39b('0x19')]=function(_0x577d85,_0x402683){return db[_0xb39b('0x1e')][_0xb39b('0x31')]({'where':{'id':_0x577d85['params']['id']}})[_0xb39b('0x18')](handleEntityNotFound(_0x402683,null))[_0xb39b('0x18')](removeEntity(_0x402683,null))[_0xb39b('0x23')](handleError(_0x402683,null));};exports[_0xb39b('0x34')]=function(_0x21ac39,_0x4abcce){return db['WhatsappInteraction']['describe']()[_0xb39b('0x18')](respondWithResult(_0x4abcce,null))[_0xb39b('0x23')](handleError(_0x4abcce,null));};exports[_0xb39b('0x35')]=function(_0x22fbdf,_0x276518){return db[_0xb39b('0x36')]['find']({'where':{'id':_0x22fbdf[_0xb39b('0x24')]['id']}})[_0xb39b('0x18')](handleEntityNotFound(_0x276518,null))[_0xb39b('0x18')](function(_0x40ee4d){if(_0x40ee4d){return _0x40ee4d[_0xb39b('0x35')](_0x22fbdf[_0xb39b('0x33')][_0xb39b('0x37')],_[_0xb39b('0x38')](_0x22fbdf[_0xb39b('0x33')],[_0xb39b('0x37'),'id'])||{});}})['then'](respondWithResult(_0x276518,null))[_0xb39b('0x23')](handleError(_0x276518,null));};exports[_0xb39b('0x39')]=function(_0x2cc89f,_0x3ade75){var _0x372383={'raw':![],'where':{}};var _0x56f0d4={};var _0x2e36f1={'count':0x0,'rows':[]};return db[_0xb39b('0x1e')][_0xb39b('0x3a')]({'where':{'id':_0x2cc89f[_0xb39b('0x24')]['id']}})['then'](handleEntityNotFound(_0x3ade75,null))[_0xb39b('0x18')](function(_0x337708){if(_0x337708){_0x56f0d4[_0xb39b('0x25')]=_['keys'](db['WhatsappMessage'][_0xb39b('0x1f')]);_0x56f0d4[_0xb39b('0x27')]=_['keys'](_0x2cc89f[_0xb39b('0x27')]);_0x56f0d4[_0xb39b('0x28')]=_[_0xb39b('0x29')](_0x56f0d4[_0xb39b('0x25')],_0x56f0d4['query']);_0x372383[_0xb39b('0x2b')]=_[_0xb39b('0x29')](_0x56f0d4['model'],qs[_0xb39b('0x2a')](_0x2cc89f[_0xb39b('0x27')]['fields']));_0x372383[_0xb39b('0x2b')]=_0x372383['attributes']['length']?_0x372383['attributes']:_0x56f0d4[_0xb39b('0x25')];if(!_0x2cc89f[_0xb39b('0x27')][_0xb39b('0x3b')](_0xb39b('0x3c'))){_0x372383['limit']=qs['limit'](_0x2cc89f[_0xb39b('0x27')][_0xb39b('0x3d')]);_0x372383[_0xb39b('0x13')]=qs[_0xb39b('0x13')](_0x2cc89f[_0xb39b('0x27')][_0xb39b('0x13')]);}_0x372383[_0xb39b('0x3e')]=qs[_0xb39b('0x3f')](_0x2cc89f['query'][_0xb39b('0x3f')]);_0x372383[_0xb39b('0x40')]=qs[_0xb39b('0x28')](_[_0xb39b('0x41')](_0x2cc89f[_0xb39b('0x27')],_0x56f0d4['filters']));_0x372383[_0xb39b('0x40')][_0xb39b('0x42')]=_0x337708['id'];if(_0x2cc89f['query'][_0xb39b('0x43')]){_0x372383[_0xb39b('0x40')]=_[_0xb39b('0x2f')](_0x372383[_0xb39b('0x40')],{'$or':_['map'](_0x372383[_0xb39b('0x2b')],function(_0x302d9b){var _0xb6bb86={};_0xb6bb86[_0x302d9b]={'$like':'%'+_0x2cc89f[_0xb39b('0x27')]['filter']+'%'};return _0xb6bb86;})});}if(_0x2cc89f[_0xb39b('0x27')]['$gte']){var _0x93449e=_0x2cc89f['query'][_0xb39b('0x44')][_0xb39b('0x45')](',');var _0x101282={};_0x101282[_0x93449e[0x0]]={'$gte':moment(_0x93449e[0x1])[_0xb39b('0x46')](_0xb39b('0x47'))};_0x372383['where']=_[_0xb39b('0x2f')](_0x372383[_0xb39b('0x40')],_0x101282);}_0x372383=_['merge']({},_0x372383,_0x2cc89f['options']);return db[_0xb39b('0x36')][_0xb39b('0x15')]({'where':_0x372383[_0xb39b('0x40')]})['then'](function(_0x4bb60d){_0x2e36f1['count']=_0x4bb60d;if(_0x2cc89f[_0xb39b('0x27')][_0xb39b('0x2d')]){_0x372383[_0xb39b('0x2e')]=[{'all':!![]}];}return db[_0xb39b('0x36')]['findAll'](_0x372383);})[_0xb39b('0x18')](function(_0x3875ea){_0x2e36f1[_0xb39b('0x48')]=_0x3875ea;return _0x2e36f1;});}})['then'](respondWithFilteredResult(_0x3ade75,_0x372383))[_0xb39b('0x23')](handleError(_0x3ade75,null));};exports[_0xb39b('0x49')]=function(_0x5e565f,_0x42c23d){return db[_0xb39b('0x1e')][_0xb39b('0x31')]({'where':{'id':_0x5e565f[_0xb39b('0x24')]['id']}})[_0xb39b('0x18')](handleEntityNotFound(_0x42c23d,null))[_0xb39b('0x18')](function(_0x330dde){if(_0x330dde){return _0x330dde[_0xb39b('0x4a')](_0x5e565f[_0xb39b('0x33')][_0xb39b('0x37')],_['omit'](_0x5e565f['body'],[_0xb39b('0x37'),'id'])||{})[_0xb39b('0x4b')](function(){return db[_0xb39b('0x4c')][_0xb39b('0x4d')]({'attributes':['id','name','color'],'where':{'id':_0x5e565f[_0xb39b('0x33')][_0xb39b('0x37')]}});})['then'](function(_0x644cba){socket[_0xb39b('0x4e')](_0xb39b('0x4f'),{'id':Number(_0x5e565f['params']['id']),'tags':_0x644cba||[]});return{'id':Number(_0x5e565f[_0xb39b('0x24')]['id']),'tags':_0x644cba||[]};});}})[_0xb39b('0x18')](respondWithResult(_0x42c23d,null))[_0xb39b('0x23')](handleError(_0x42c23d,null));};exports[_0xb39b('0x50')]=function(_0x57e391,_0x39455d){return db[_0xb39b('0x1e')]['find']({'where':{'id':_0x57e391[_0xb39b('0x24')]['id']}})[_0xb39b('0x18')](handleEntityNotFound(_0x39455d,null))['then'](function(_0x519a7a){if(_0x519a7a){return _0x519a7a[_0xb39b('0x50')](_0x57e391[_0xb39b('0x27')][_0xb39b('0x37')]);}})['then'](respondWithStatusCode(_0x39455d,null))[_0xb39b('0x23')](handleError(_0x39455d,null));};exports[_0xb39b('0x51')]=function(_0x4af504,_0x560b06){var _0x3072eb=moment()[_0xb39b('0x52')]()[_0xb39b('0x53')]();var _0x41d84f=path[_0xb39b('0x54')](config[_0xb39b('0x55')],_0xb39b('0x56'),_0xb39b('0x57'),'tmp');var _0x14b8e8=path[_0xb39b('0x54')](config[_0xb39b('0x55')],'server',_0xb39b('0x57'),'attachments');var _0x288861=path['join'](_0x41d84f,_0x3072eb);var _0x4906dc=util[_0xb39b('0x46')](_0xb39b('0x58'),_0x4af504[_0xb39b('0x24')]['id'],_0x3072eb);var _0x924d4d=path[_0xb39b('0x54')](_0x41d84f,_0x4906dc);var _0x1fbd29=[];_0x1fbd29['push']({'model':db[_0xb39b('0x59')],'as':'User','attributes':['id',_0xb39b('0x5a')],'raw':!![]});_0x1fbd29['push']({'model':db[_0xb39b('0x5b')],'as':'Contact','attributes':['id','firstName',_0xb39b('0x5c')],'raw':!![]});if(_0x4af504['query'][_0xb39b('0x5d')]){_0x1fbd29['push']({'model':db[_0xb39b('0x5e')],'as':_0xb39b('0x5e'),'raw':!![]});}var _0x476da5=[{'model':db['WhatsappMessage'],'as':_0xb39b('0x5f'),'attributes':['id',_0xb39b('0x33'),_0xb39b('0x60'),'direction',_0xb39b('0x61'),_0xb39b('0x62')],'include':_0x1fbd29}];_0x476da5[_0xb39b('0x63')]({'model':db[_0xb39b('0x64')],'as':_0xb39b('0x65'),'attributes':['id',_0xb39b('0x1b')]});_0x476da5[_0xb39b('0x63')]({'model':db[_0xb39b('0x59')],'as':_0xb39b('0x66'),'attributes':['id','fullname']});return db[_0xb39b('0x1e')]['find']({'where':{'id':_0x4af504[_0xb39b('0x24')]['id']},'include':_0x476da5})[_0xb39b('0x18')](handleEntityNotFound(_0x560b06,null))[_0xb39b('0x18')](function(_0x44c534){if(_0x44c534){var _0x4535df=_0x44c534[_0xb39b('0x67')]({'plain':!![]});fs[_0xb39b('0x68')](_0x288861);var _0x574523={'channel':_0xb39b('0x69'),'account':_0x4535df[_0xb39b('0x65')][_0xb39b('0x1b')],'agent':_0x4535df[_0xb39b('0x66')]?_0x4535df[_0xb39b('0x66')][_0xb39b('0x5a')]:'N.A.','createdAt':moment(_0x4535df[_0xb39b('0x60')])[_0xb39b('0x46')](_0xb39b('0x47'))[_0xb39b('0x53')](),'closedAt':_0x4535df['closed']?moment(_0x4535df[_0xb39b('0x6a')])['format'](_0xb39b('0x47'))[_0xb39b('0x53')]():'','disposition':_0x4535df[_0xb39b('0x6b')],'messages':_(_0x4535df[_0xb39b('0x5f')])[_0xb39b('0x43')]({'secret':![]})[_0xb39b('0x1d')](function(_0x3b6008){if(_0x3b6008['Attachment']){var _0x54a64b=path[_0xb39b('0x54')](_0x14b8e8,_0x3b6008[_0xb39b('0x5e')][_0xb39b('0x6c')]);if(fs[_0xb39b('0x6d')](_0x54a64b)){fs[_0xb39b('0x6e')](_0x54a64b)[_0xb39b('0x6f')](fs[_0xb39b('0x70')](path[_0xb39b('0x54')](_0x288861,_0x3b6008[_0xb39b('0x5e')][_0xb39b('0x6c')])));}}return{'date':moment(_0x3b6008[_0xb39b('0x60')])[_0xb39b('0x46')](_0xb39b('0x47'))[_0xb39b('0x53')](),'sender':_0x3b6008[_0xb39b('0x71')]==='out'?_0x3b6008['User']?_0x3b6008[_0xb39b('0x59')][_0xb39b('0x5a')]:_0xb39b('0x72'):_0x3b6008[_0xb39b('0x73')][_0xb39b('0x74')]+(_0x3b6008[_0xb39b('0x73')]['lastName']?'\x20'+_0x3b6008[_0xb39b('0x73')][_0xb39b('0x5c')]:''),'body':_0x3b6008[_0xb39b('0x5e')]?_0x3b6008[_0xb39b('0x5e')][_0xb39b('0x6c')]:_0x3b6008[_0xb39b('0x33')],'direction':_0x3b6008['direction']===_0xb39b('0x75')?'A':'C','secret':_0x3b6008[_0xb39b('0x61')],'read':_0x3b6008[_0xb39b('0x62')],'attachment':_0x3b6008[_0xb39b('0x5e')]};})[_0xb39b('0x76')]()};return ejs[_0xb39b('0x77')](path[_0xb39b('0x54')](config['root'],'server',_0xb39b('0x78'),'downloadInteraction.ejs'),{'interaction':_0x574523})['then'](function(_0x3faafd){var _0x2d6c46=path[_0xb39b('0x54')](_0x288861,_0xb39b('0x79')+_0x4535df['id']+'-'+_0x3072eb+_0xb39b('0x7a'));var _0x31fcb4={'path':_0x2d6c46,'channel':_0xb39b('0x69'),'interactionId':_0x4535df['id']};return pdf['createPdfFromHTML'](_0x3faafd,_0x31fcb4);})[_0xb39b('0x18')](function(){return new BPromise(function(_0x4dc272,_0xbb7d81){zipdir(_0x288861,{'saveTo':_0x924d4d},function(_0x6e7d97,_0xefa3d){if(_0x6e7d97)return _0xbb7d81(_0x6e7d97);return _0x4dc272(_0xefa3d);});})[_0xb39b('0x18')](function(){return new BPromise(function(_0x4c75f6,_0x2e1f21){rimraf(_0x288861,function(_0x49010a){if(_0x49010a)_0x2e1f21(_0x49010a);return _0x4c75f6();});});})['then'](function(){return _0x560b06[_0xb39b('0x51')](_0x924d4d,_0x4906dc,function(_0x110b5){if(_0x110b5){console[_0xb39b('0x7b')](_0xb39b('0x7c'),_0x110b5);}else{fs[_0xb39b('0x7d')](_0x924d4d);}});});});}else{return _0x560b06['sendStatus'](0xc8);}})[_0xb39b('0x23')](handleError(_0x560b06,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 9b9ac7f..9b2ca28 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 _0x915a=['hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch'];(function(_0x515a88,_0x186856){var _0x5ea902=function(_0x1924cc){while(--_0x1924cc){_0x515a88['push'](_0x515a88['shift']());}};_0x5ea902(++_0x186856);}(_0x915a,0x1d2));var _0xa915=function(_0x40d227,_0x40f916){_0x40d227=_0x40d227-0x0;var _0x4b774b=_0x915a[_0x40d227];return _0x4b774b;};'use strict';var EventEmitter=require(_0xa915('0x0'));var WhatsappInteraction=require(_0xa915('0x1'))['db'][_0xa915('0x2')];var WhatsappMessage=require(_0xa915('0x1'))['db'][_0xa915('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa915('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1106ee){return function(_0x422023,_0xf654ba,_0xb6900c){_0x422023[_0xa915('0x5')]({'attributes':['id'],'raw':!![]})[_0xa915('0x6')](function(_0x4e4368){_0x422023['setDataValue'](_0xa915('0x7'),_0x4e4368[_0xa915('0x8')](function(_0x173267){return{'id':_0x173267['id']};}));return WhatsappMessage[_0xa915('0x9')]({'where':{'WhatsappInteractionId':_0x422023['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x549502){_0x422023[_0xa915('0xa')]('unreadMessages',_0x549502[_0xa915('0xb')]);WhatsappInteractionEvents['emit'](_0x1106ee+':'+_0x422023['id'],_0x422023);WhatsappInteractionEvents[_0xa915('0xc')](_0x1106ee,_0x422023);_0xb6900c(null);})[_0xa915('0xd')](_0xb6900c(null));};}for(var e in events){if(events[_0xa915('0xe')](e)){var event=events[e];WhatsappInteraction[_0xa915('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x6a24=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0x6a24,0xd1));var _0x46a2=function(_0x342703,_0x25800d){_0x342703=_0x342703-0x0;var _0x5d9db6=_0x6a24[_0x342703];return _0x5d9db6;};'use strict';var EventEmitter=require(_0x46a2('0x0'));var WhatsappInteraction=require(_0x46a2('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x46a2('0x1'))['db'][_0x46a2('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x46a2('0x3')](0x0);var events={'afterCreate':_0x46a2('0x4'),'afterUpdate':_0x46a2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x30bf8b){return function(_0xb4cb9b,_0x4f6948,_0x22de0d){_0xb4cb9b[_0x46a2('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49870f){_0xb4cb9b[_0x46a2('0x7')](_0x46a2('0x8'),_0x49870f['map'](function(_0xafeea5){return{'id':_0xafeea5['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xb4cb9b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46a2('0x9')](function(_0x5086ae){_0xb4cb9b[_0x46a2('0x7')](_0x46a2('0xa'),_0x5086ae[_0x46a2('0xb')]);WhatsappInteractionEvents[_0x46a2('0xc')](_0x30bf8b+':'+_0xb4cb9b['id'],_0xb4cb9b);WhatsappInteractionEvents[_0x46a2('0xc')](_0x30bf8b,_0xb4cb9b);_0x22de0d(null);})[_0x46a2('0xd')](_0x22de0d(null));};}for(var e in events){if(events[_0x46a2('0xe')](e)){var event=events[e];WhatsappInteraction[_0x46a2('0xf')](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 f162282..f973be6 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 _0x3e1d=['WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x276221,_0x378da4){var _0x4fa716=function(_0x4dd561){while(--_0x4dd561){_0x276221['push'](_0x276221['shift']());}};_0x4fa716(++_0x378da4);}(_0x3e1d,0x13a));var _0xd3e1=function(_0x1a8192,_0x3453f2){_0x1a8192=_0x1a8192-0x0;var _0x131de2=_0x3e1d[_0x1a8192];return _0x131de2;};'use strict';var _=require('lodash');var util=require(_0xd3e1('0x0'));var logger=require('../../config/logger')(_0xd3e1('0x1'));var moment=require(_0xd3e1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3e1('0x3'));var rimraf=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var attributes=require(_0xd3e1('0x6'));module[_0xd3e1('0x7')]=function(_0x428ae7,_0x2a275f){return _0x428ae7['define'](_0xd3e1('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcf4a1a,_0x12d860,_0x80c6f0){if(_0xcf4a1a[_0xd3e1('0x9')](_0xd3e1('0xa'))){_0xcf4a1a[_0xd3e1('0xb')]=moment()[_0xd3e1('0xc')](_0xd3e1('0xd'));}_0x80c6f0(null,_0xcf4a1a);}}});}; \ No newline at end of file +var _0xb429=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb429,0x13e));var _0x9b42=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xb429[_0x387777];return _0x3f84c0;};'use strict';var _=require('lodash');var util=require(_0x9b42('0x0'));var logger=require('../../config/logger')(_0x9b42('0x1'));var moment=require(_0x9b42('0x2'));var BPromise=require(_0x9b42('0x3'));var rp=require(_0x9b42('0x4'));var fs=require('fs');var path=require(_0x9b42('0x5'));var rimraf=require(_0x9b42('0x6'));var config=require(_0x9b42('0x7'));var attributes=require(_0x9b42('0x8'));module[_0x9b42('0x9')]=function(_0x183bfa,_0x1dd1d6){return _0x183bfa[_0x9b42('0xa')](_0x9b42('0xb'),attributes,{'tableName':_0x9b42('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x182bbd,_0x325b02,_0x91845a){if(_0x182bbd[_0x9b42('0xd')](_0x9b42('0xe'))){_0x182bbd[_0x9b42('0xf')]=moment()[_0x9b42('0x10')](_0x9b42('0x11'));}_0x91845a(null,_0x182bbd);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 8c391ce..0d5ae13 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 _0xd887=['stringify','error','code','message','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','limit','debug','catch','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x9cfb,_0x3c156a){var _0x45306c=function(_0x4530ea){while(--_0x4530ea){_0x9cfb['push'](_0x9cfb['shift']());}};_0x45306c(++_0x3c156a);}(_0xd887,0x197));var _0x7d88=function(_0x1ed46f,_0x7691d7){_0x1ed46f=_0x1ed46f-0x0;var _0x43b931=_0xd887[_0x1ed46f];return _0x43b931;};'use strict';var _=require(_0x7d88('0x0'));var util=require(_0x7d88('0x1'));var moment=require(_0x7d88('0x2'));var BPromise=require(_0x7d88('0x3'));var rs=require(_0x7d88('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d88('0x5'))['db'];var utils=require(_0x7d88('0x6'));var logger=require(_0x7d88('0x7'))(_0x7d88('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d88('0x9'));var client=jayson[_0x7d88('0xa')][_0x7d88('0xb')]({'port':0x232a});config[_0x7d88('0xc')]=_[_0x7d88('0xd')](config[_0x7d88('0xc')],{'host':_0x7d88('0xe'),'port':0x18eb});var socket=require(_0x7d88('0xf'))(new Redis(config['redis']));require(_0x7d88('0x10'))[_0x7d88('0x11')](socket);function respondWithRpcPromise(_0x47b9fb,_0x4328be,_0x277e7a){return new BPromise(function(_0x5d63a8,_0x21926d){return client['request'](_0x47b9fb,_0x277e7a)[_0x7d88('0x12')](function(_0x1c1b65){logger[_0x7d88('0x13')](_0x7d88('0x14'),_0x4328be,_0x7d88('0x15'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4328be,'request\x20sent',JSON[_0x7d88('0x16')](_0x1c1b65));if(_0x1c1b65[_0x7d88('0x17')]){if(_0x1c1b65['error'][_0x7d88('0x18')]===0x1f4){logger[_0x7d88('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x4328be,_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);return _0x21926d(_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);}logger[_0x7d88('0x17')](_0x7d88('0x14'),_0x4328be,_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);return _0x5d63a8(_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);}else{logger[_0x7d88('0x13')](_0x7d88('0x14'),_0x4328be,_0x7d88('0x15'));_0x5d63a8(_0x1c1b65['result'][_0x7d88('0x19')]);}})['catch'](function(_0x45dc5b){logger[_0x7d88('0x17')](_0x7d88('0x14'),_0x4328be,_0x45dc5b);_0x21926d(_0x45dc5b);});});}exports[_0x7d88('0x1a')]=function(_0x865f31){var _0x1fd0ff=this;return new Promise(function(_0x1ddaa8,_0x39766c){return db[_0x7d88('0x1b')][_0x7d88('0x1c')](_0x865f31[_0x7d88('0x1d')],{'raw':_0x865f31[_0x7d88('0x1e')]?_0x865f31[_0x7d88('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x865f31[_0x7d88('0x1e')]?_0x865f31['options']['where']||null:null,'attributes':_0x865f31[_0x7d88('0x1e')]?_0x865f31[_0x7d88('0x1e')]['attributes']||null:null,'limit':_0x865f31[_0x7d88('0x1e')]?_0x865f31[_0x7d88('0x1e')][_0x7d88('0x1f')]||null:null})[_0x7d88('0x12')](function(_0x396562){logger[_0x7d88('0x13')](_0x7d88('0x1a'),_0x865f31);logger[_0x7d88('0x20')](_0x7d88('0x1a'),_0x865f31,JSON[_0x7d88('0x16')](_0x396562));_0x1ddaa8(_0x396562);})[_0x7d88('0x21')](function(_0x301f32){logger[_0x7d88('0x17')](_0x7d88('0x1a'),_0x301f32['message'],_0x865f31);_0x39766c(_0x1fd0ff['error'](0x1f4,_0x301f32['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4e86b6){return new Promise(function(_0x39e497,_0x58771d){return db[_0x7d88('0x1b')][_0x7d88('0x22')]({'where':_0x4e86b6['options']?_0x4e86b6[_0x7d88('0x1e')]['where']||null:null})[_0x7d88('0x12')](function(_0x52972b){if(_0x52972b){return _0x52972b[_0x7d88('0x23')](_0x4e86b6[_0x7d88('0x1d')][_0x7d88('0x24')],_['omit'](_0x4e86b6[_0x7d88('0x1d')],[_0x7d88('0x24'),'id'])||{});}})[_0x7d88('0x25')](function(_0x31aa2d){logger['info'](_0x7d88('0x26'),_0x4e86b6);logger[_0x7d88('0x20')](_0x7d88('0x26'),_0x4e86b6,JSON[_0x7d88('0x16')](_0x31aa2d));_0x39e497(_0x31aa2d);})['catch'](function(_0x4a6fb8){logger[_0x7d88('0x17')]('AddTags',_0x4a6fb8[_0x7d88('0x19')],_0x4e86b6);_0x58771d(_this[_0x7d88('0x17')](0x1f4,_0x4a6fb8[_0x7d88('0x19')]));});});}; \ No newline at end of file +var _0x3ab5=['debug','stringify','error','code','message','result','catch','update','body','options','raw','where','limit','then','UpdateWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3ab5,0x94));var _0x53ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3ab5[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x53ab('0x0'));var moment=require(_0x53ab('0x1'));var BPromise=require(_0x53ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53ab('0x3'));var db=require(_0x53ab('0x4'))['db'];var utils=require(_0x53ab('0x5'));var logger=require(_0x53ab('0x6'))(_0x53ab('0x7'));var config=require('../../config/environment');var jayson=require(_0x53ab('0x8'));var client=jayson[_0x53ab('0x9')][_0x53ab('0xa')]({'port':0x232a});config[_0x53ab('0xb')]=_[_0x53ab('0xc')](config[_0x53ab('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x53ab('0xd'))(new Redis(config['redis']));require(_0x53ab('0xe'))[_0x53ab('0xf')](socket);function respondWithRpcPromise(_0x4d0dff,_0x514d33,_0x27027d){return new BPromise(function(_0x5b2030,_0x3d9b9a){return client[_0x53ab('0x10')](_0x4d0dff,_0x27027d)['then'](function(_0x371ec2){logger[_0x53ab('0x11')](_0x53ab('0x12'),_0x514d33,_0x53ab('0x13'));logger[_0x53ab('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x514d33,_0x53ab('0x13'),JSON[_0x53ab('0x15')](_0x371ec2));if(_0x371ec2[_0x53ab('0x16')]){if(_0x371ec2[_0x53ab('0x16')][_0x53ab('0x17')]===0x1f4){logger['error'](_0x53ab('0x12'),_0x514d33,_0x371ec2[_0x53ab('0x16')]['message']);return _0x3d9b9a(_0x371ec2['error']['message']);}logger[_0x53ab('0x16')](_0x53ab('0x12'),_0x514d33,_0x371ec2[_0x53ab('0x16')][_0x53ab('0x18')]);return _0x5b2030(_0x371ec2[_0x53ab('0x16')]['message']);}else{logger[_0x53ab('0x11')](_0x53ab('0x12'),_0x514d33,'request\x20sent');_0x5b2030(_0x371ec2[_0x53ab('0x19')][_0x53ab('0x18')]);}})[_0x53ab('0x1a')](function(_0x12dc95){logger['error'](_0x53ab('0x12'),_0x514d33,_0x12dc95);_0x3d9b9a(_0x12dc95);});});}exports['UpdateWhatsappInteraction']=function(_0x6d6fe8){var _0x4020b0=this;return new Promise(function(_0xe75b17,_0x12c7fd){return db['WhatsappInteraction'][_0x53ab('0x1b')](_0x6d6fe8[_0x53ab('0x1c')],{'raw':_0x6d6fe8[_0x53ab('0x1d')]?_0x6d6fe8['options'][_0x53ab('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6d6fe8[_0x53ab('0x1d')]?_0x6d6fe8[_0x53ab('0x1d')][_0x53ab('0x1f')]||null:null,'attributes':_0x6d6fe8[_0x53ab('0x1d')]?_0x6d6fe8[_0x53ab('0x1d')]['attributes']||null:null,'limit':_0x6d6fe8[_0x53ab('0x1d')]?_0x6d6fe8['options'][_0x53ab('0x20')]||null:null})[_0x53ab('0x21')](function(_0x2b2283){logger[_0x53ab('0x11')](_0x53ab('0x22'),_0x6d6fe8);logger[_0x53ab('0x14')](_0x53ab('0x22'),_0x6d6fe8,JSON[_0x53ab('0x15')](_0x2b2283));_0xe75b17(_0x2b2283);})[_0x53ab('0x1a')](function(_0x5b1d2f){logger[_0x53ab('0x16')](_0x53ab('0x22'),_0x5b1d2f['message'],_0x6d6fe8);_0x12c7fd(_0x4020b0[_0x53ab('0x16')](0x1f4,_0x5b1d2f[_0x53ab('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x247b12){return new Promise(function(_0x19a307,_0xd11b90){return db[_0x53ab('0x23')][_0x53ab('0x24')]({'where':_0x247b12['options']?_0x247b12[_0x53ab('0x1d')][_0x53ab('0x1f')]||null:null})['then'](function(_0x4fe8ff){if(_0x4fe8ff){return _0x4fe8ff[_0x53ab('0x25')](_0x247b12[_0x53ab('0x1c')][_0x53ab('0x26')],_[_0x53ab('0x27')](_0x247b12['body'],[_0x53ab('0x26'),'id'])||{});}})[_0x53ab('0x28')](function(_0x4e8347){logger['info']('AddTags',_0x247b12);logger[_0x53ab('0x14')](_0x53ab('0x29'),_0x247b12,JSON[_0x53ab('0x15')](_0x4e8347));_0x19a307(_0x4e8347);})[_0x53ab('0x1a')](function(_0x593b0b){logger['error'](_0x53ab('0x29'),_0x593b0b[_0x53ab('0x18')],_0x247b12);_0xd11b90(_this['error'](0x1f4,_0x593b0b['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 339a3eb..c6d42b7 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 _0x09fa=['remove','update','emit','removeListener','register','length','./whatsappInteraction.events','save'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x09fa,0x1c6));var _0xa09f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x09fa[_0x413feb];return _0x40ee88;};'use strict';var WhatsappInteractionEvents=require(_0xa09f('0x0'));var events=[_0xa09f('0x1'),_0xa09f('0x2'),_0xa09f('0x3')];function createListener(_0x4f05c5,_0x5759f3){return function(_0x276a76){_0x5759f3[_0xa09f('0x4')](_0x4f05c5,_0x276a76);};}function removeListener(_0x66dd3a,_0x2fb610){return function(){WhatsappInteractionEvents[_0xa09f('0x5')](_0x66dd3a,_0x2fb610);};}exports[_0xa09f('0x6')]=function(_0x30b84f){for(var _0x2b9f4e=0x0,_0x41a171=events[_0xa09f('0x7')];_0x2b9f4e<_0x41a171;_0x2b9f4e++){var _0xf1c9c4=events[_0x2b9f4e];var _0x215771=createListener('whatsappInteraction:'+_0xf1c9c4,_0x30b84f);WhatsappInteractionEvents['on'](_0xf1c9c4,_0x215771);}}; \ No newline at end of file +var _0xc556=['removeListener','register','length','whatsappInteraction:','remove','update'];(function(_0x15c6d1,_0x2df0f5){var _0x3034f2=function(_0x395fe8){while(--_0x395fe8){_0x15c6d1['push'](_0x15c6d1['shift']());}};_0x3034f2(++_0x2df0f5);}(_0xc556,0x17e));var _0x6c55=function(_0x15ca63,_0x204506){_0x15ca63=_0x15ca63-0x0;var _0x25678f=_0xc556[_0x15ca63];return _0x25678f;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x6c55('0x0'),_0x6c55('0x1')];function createListener(_0x3808f1,_0x2b4a67){return function(_0x5a2b87){_0x2b4a67['emit'](_0x3808f1,_0x5a2b87);};}function removeListener(_0x13faeb,_0x3749b9){return function(){WhatsappInteractionEvents[_0x6c55('0x2')](_0x13faeb,_0x3749b9);};}exports[_0x6c55('0x3')]=function(_0x4b2055){for(var _0x502176=0x0,_0x241d73=events[_0x6c55('0x4')];_0x502176<_0x241d73;_0x502176++){var _0x3b0394=events[_0x502176];var _0x20b346=createListener(_0x6c55('0x5')+_0x3b0394,_0x4b2055);WhatsappInteractionEvents['on'](_0x3b0394,_0x20b346);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 546d454..155f5f0 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 _0xe54c=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x43ecf0,_0x105b05){var _0x26ce17=function(_0x37df70){while(--_0x37df70){_0x43ecf0['push'](_0x43ecf0['shift']());}};_0x26ce17(++_0x105b05);}(_0xe54c,0x85));var _0xce54=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xe54c[_0x258b93];return _0x35484b;};'use strict';var multer=require(_0xce54('0x0'));var util=require(_0xce54('0x1'));var path=require(_0xce54('0x2'));var timeout=require('connect-timeout');var express=require(_0xce54('0x3'));var router=express['Router']();var fs_extra=require(_0xce54('0x4'));var auth=require(_0xce54('0x5'));var interaction=require(_0xce54('0x6'));var config=require(_0xce54('0x7'));var controller=require(_0xce54('0x8'));router['get']('/',auth[_0xce54('0x9')](),controller[_0xce54('0xa')]);router['get'](_0xce54('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xce54('0xc'),auth[_0xce54('0x9')](),controller[_0xce54('0xd')]);router[_0xce54('0xe')]('/',auth['isAuthenticated'](),interaction[_0xce54('0xf')](_0xce54('0x10'),'whatsappmessage:create'),controller['create']);router[_0xce54('0xe')](_0xce54('0x11'),controller[_0xce54('0x12')]);router[_0xce54('0x13')](_0xce54('0xc'),auth['isAuthenticated'](),controller[_0xce54('0x14')]);router['put'](_0xce54('0x15'),auth[_0xce54('0x9')](),controller[_0xce54('0x16')]);router['put'](_0xce54('0x17'),auth[_0xce54('0x9')](),controller[_0xce54('0x18')]);router['delete'](_0xce54('0xc'),auth[_0xce54('0x9')](),controller[_0xce54('0x19')]);module[_0xce54('0x1a')]=router; \ No newline at end of file +var _0x8066=['create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','whatsappmessage:create'];(function(_0xffc56b,_0x5caa71){var _0xa0731b=function(_0x2f8357){while(--_0x2f8357){_0xffc56b['push'](_0xffc56b['shift']());}};_0xa0731b(++_0x5caa71);}(_0x8066,0x161));var _0x6806=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x8066[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x6806('0x0'));var util=require('util');var path=require(_0x6806('0x1'));var timeout=require(_0x6806('0x2'));var express=require(_0x6806('0x3'));var router=express[_0x6806('0x4')]();var fs_extra=require(_0x6806('0x5'));var auth=require(_0x6806('0x6'));var interaction=require(_0x6806('0x7'));var config=require(_0x6806('0x8'));var controller=require(_0x6806('0x9'));router['get']('/',auth[_0x6806('0xa')](),controller[_0x6806('0xb')]);router[_0x6806('0xc')](_0x6806('0xd'),auth[_0x6806('0xa')](),controller[_0x6806('0xe')]);router[_0x6806('0xc')](_0x6806('0xf'),auth['isAuthenticated'](),controller[_0x6806('0x10')]);router['post']('/',auth[_0x6806('0xa')](),interaction[_0x6806('0x11')]('whatsapp',_0x6806('0x12')),controller[_0x6806('0x13')]);router[_0x6806('0x14')](_0x6806('0x15'),controller[_0x6806('0x16')]);router[_0x6806('0x17')]('/:id',auth[_0x6806('0xa')](),controller[_0x6806('0x18')]);router['put'](_0x6806('0x19'),auth[_0x6806('0xa')](),controller[_0x6806('0x1a')]);router[_0x6806('0x17')](_0x6806('0x1b'),auth['isAuthenticated'](),controller[_0x6806('0x1c')]);router['delete'](_0x6806('0xf'),auth[_0x6806('0xa')](),controller[_0x6806('0x1d')]);module[_0x6806('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 335bafd..7f913ec 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 _0x711a=['DATE','sequelize','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x1f4ae2,_0x2ef893){var _0x4a4d7e=function(_0x31fc8e){while(--_0x31fc8e){_0x1f4ae2['push'](_0x1f4ae2['shift']());}};_0x4a4d7e(++_0x2ef893);}(_0x711a,0x14a));var _0xa711=function(_0x316b74,_0x4440f3){_0x316b74=_0x316b74-0x0;var _0x4c7c94=_0x711a[_0x316b74];return _0x4c7c94;};'use strict';var Sequelize=require(_0xa711('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa711('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa711('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa711('0x3')]('in',_0xa711('0x4')),'defaultValue':_0xa711('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa711('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa711('0x5')]},'readAt':{'type':Sequelize[_0xa711('0x6')]},'secret':{'type':Sequelize[_0xa711('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa711('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1fd9=['TEXT','medium','BOOLEAN','out','STRING','sequelize','exports'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x1fd9,0x19b));var _0x91fd=function(_0x4d6ffd,_0x1f4eb2){_0x4d6ffd=_0x4d6ffd-0x0;var _0x7849a7=_0x1fd9[_0x4d6ffd];return _0x7849a7;};'use strict';var Sequelize=require(_0x91fd('0x0'));module[_0x91fd('0x1')]={'body':{'type':Sequelize[_0x91fd('0x2')](_0x91fd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x91fd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x91fd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x91fd('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x91fd('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x91fd('0x6')]},'providerResponse':{'type':Sequelize[_0x91fd('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index deef559..43210ec 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 _0x8183=['moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','whatsapp-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp','RejectMessage','rejectMessage','Sequelize','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch'];(function(_0x221637,_0x42a5e0){var _0x11bf9e=function(_0xbc416e){while(--_0xbc416e){_0x221637['push'](_0x221637['shift']());}};_0x11bf9e(++_0x42a5e0);}(_0x8183,0x123));var _0x3818=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x8183[_0x2df507];return _0x1f7167;};'use strict';var emlformat=require(_0x3818('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3818('0x1'));var jsonpatch=require(_0x3818('0x2'));var rp=require('request-promise');var moment=require(_0x3818('0x3'));var BPromise=require(_0x3818('0x4'));var Mustache=require(_0x3818('0x5'));var util=require(_0x3818('0x6'));var path=require('path');var sox=require(_0x3818('0x7'));var csv=require(_0x3818('0x8'));var ejs=require(_0x3818('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3818('0xa'));var squel=require(_0x3818('0xb'));var crypto=require(_0x3818('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3818('0xd'));var toCsv=require(_0x3818('0x8'));var querystring=require(_0x3818('0xe'));var Papa=require(_0x3818('0xf'));var Redis=require(_0x3818('0x10'));var authService=require(_0x3818('0x11'));var qs=require(_0x3818('0x12'));var as=require(_0x3818('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3818('0x14'))(_0x3818('0x15'));var utils=require(_0x3818('0x16'));var config=require(_0x3818('0x17'));var licenseUtil=require(_0x3818('0x18'));var db=require(_0x3818('0x19'))['db'];config[_0x3818('0x1a')]=_[_0x3818('0x1b')](config['redis'],{'host':_0x3818('0x1c'),'port':0x18eb});var socket=require(_0x3818('0x1d'))(new Redis(config[_0x3818('0x1a')]));require('./whatsappMessage.socket')[_0x3818('0x1e')](socket);var jayson=require(_0x3818('0x1f'));var client=jayson[_0x3818('0x20')][_0x3818('0x21')]({'port':0x232c});var client9002=jayson[_0x3818('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20879c,_0x4ccd8a,_0x46d5d4,_0x3a6143){return new BPromise(function(_0x4aa99f,_0x24d0e2){var _0x4f5fd0=_0x3a6143||client;return _0x4f5fd0['request'](_0x20879c,_0x46d5d4)[_0x3818('0x22')](function(_0x406f51){logger['info'](_0x3818('0x23'),_0x4ccd8a,_0x3818('0x24'));logger['debug'](_0x3818('0x25'),_0x4ccd8a,'request\x20sent',JSON['stringify'](_0x406f51));if(_0x406f51[_0x3818('0x26')]){if(_0x406f51['error'][_0x3818('0x27')]===0x1f4){logger[_0x3818('0x26')](_0x3818('0x23'),_0x4ccd8a,_0x406f51['error'][_0x3818('0x28')]);return _0x24d0e2(_0x406f51[_0x3818('0x26')][_0x3818('0x28')]);}logger[_0x3818('0x26')](_0x3818('0x23'),_0x4ccd8a,_0x406f51['error'][_0x3818('0x28')]);return _0x4aa99f(_0x406f51[_0x3818('0x26')]['message']);}else{logger[_0x3818('0x29')](_0x3818('0x23'),_0x4ccd8a,_0x3818('0x24'));_0x4aa99f(_0x406f51['result'][_0x3818('0x28')]);}})['catch'](function(_0x1444cc){logger[_0x3818('0x26')](_0x3818('0x23'),_0x4ccd8a,_0x1444cc);_0x24d0e2(_0x1444cc);});});}function respondWithStatusCode(_0x364cf2,_0x5d84a8){_0x5d84a8=_0x5d84a8||0xcc;return function(_0x695d0d){if(_0x695d0d){return _0x364cf2[_0x3818('0x2a')](_0x5d84a8);}return _0x364cf2[_0x3818('0x2b')](_0x5d84a8)['end']();};}function respondWithResult(_0x46dfab,_0x389b13){_0x389b13=_0x389b13||0xc8;return function(_0x56ebdb){if(_0x56ebdb){return _0x46dfab[_0x3818('0x2b')](_0x389b13)[_0x3818('0x2c')](_0x56ebdb);}};}function respondWithFilteredResult(_0x49f75c,_0x33d8c6){return function(_0x1fd1a6){if(_0x1fd1a6){var _0x53b5d2=typeof _0x33d8c6[_0x3818('0x2d')]==='undefined'&&typeof _0x33d8c6['limit']===_0x3818('0x2e');var _0x413075=_0x1fd1a6[_0x3818('0x2f')];var _0x59641f=_0x53b5d2?0x0:_0x33d8c6['offset'];var _0xcdf813=_0x53b5d2?_0x1fd1a6[_0x3818('0x2f')]:_0x33d8c6[_0x3818('0x2d')]+_0x33d8c6[_0x3818('0x30')];var _0x4447b0;if(_0xcdf813>=_0x413075){_0xcdf813=_0x413075;_0x4447b0=0xc8;}else{_0x4447b0=0xce;}_0x49f75c[_0x3818('0x2b')](_0x4447b0);return _0x49f75c[_0x3818('0x31')](_0x3818('0x32'),_0x59641f+'-'+_0xcdf813+'/'+_0x413075)[_0x3818('0x2c')](_0x1fd1a6);}return null;};}function patchUpdates(_0x5353b9){return function(_0x10a8fa){try{jsonpatch[_0x3818('0x33')](_0x10a8fa,_0x5353b9,!![]);}catch(_0x1dfcb0){return BPromise[_0x3818('0x34')](_0x1dfcb0);}return _0x10a8fa[_0x3818('0x35')]();};}function saveUpdates(_0x22cb01,_0x479223){return function(_0x53fedb){if(_0x53fedb){return _0x53fedb[_0x3818('0x36')](_0x22cb01)[_0x3818('0x22')](function(_0x197064){return _0x197064;});}return null;};}function removeEntity(_0x29b521,_0x1981fd){return function(_0x19e7d5){if(_0x19e7d5){return _0x19e7d5[_0x3818('0x37')]()[_0x3818('0x22')](function(){_0x29b521[_0x3818('0x2b')](0xcc)[_0x3818('0x38')]();});}};}function handleEntityNotFound(_0x5e1209,_0x27e53e){return function(_0x107357){if(!_0x107357){_0x5e1209[_0x3818('0x2a')](0x194);}return _0x107357;};}function handleError(_0x336649,_0xd13fd0){_0xd13fd0=_0xd13fd0||0x1f4;return function(_0xa99e18){logger[_0x3818('0x26')](_0xa99e18[_0x3818('0x39')]);if(_0xa99e18[_0x3818('0x3a')]){delete _0xa99e18[_0x3818('0x3a')];}_0x336649[_0x3818('0x2b')](_0xd13fd0)[_0x3818('0x3b')](_0xa99e18);};}exports[_0x3818('0x3c')]=function(_0x3ee523,_0x55ea29){var _0x2bd957={},_0x4e594f={},_0x1a0ae9={'count':0x0,'rows':[]};var _0x2c98a8=_['map'](db[_0x3818('0x3d')][_0x3818('0x3e')],function(_0x32895f){return{'name':_0x32895f[_0x3818('0x3f')],'type':_0x32895f['type'][_0x3818('0x40')]};});_0x4e594f[_0x3818('0x41')]=_[_0x3818('0x42')](_0x2c98a8,_0x3818('0x3a'));_0x4e594f[_0x3818('0x43')]=_['keys'](_0x3ee523[_0x3818('0x43')]);_0x4e594f[_0x3818('0x44')]=_['intersection'](_0x4e594f['model'],_0x4e594f['query']);_0x2bd957[_0x3818('0x45')]=_[_0x3818('0x46')](_0x4e594f[_0x3818('0x41')],qs[_0x3818('0x47')](_0x3ee523[_0x3818('0x43')][_0x3818('0x47')]));_0x2bd957[_0x3818('0x45')]=_0x2bd957[_0x3818('0x45')]['length']?_0x2bd957['attributes']:_0x4e594f[_0x3818('0x41')];if(!_0x3ee523[_0x3818('0x43')][_0x3818('0x48')](_0x3818('0x49'))){_0x2bd957[_0x3818('0x30')]=qs[_0x3818('0x30')](_0x3ee523['query'][_0x3818('0x30')]);_0x2bd957[_0x3818('0x2d')]=qs[_0x3818('0x2d')](_0x3ee523[_0x3818('0x43')][_0x3818('0x2d')]);}_0x2bd957[_0x3818('0x4a')]=qs[_0x3818('0x4b')](_0x3ee523[_0x3818('0x43')][_0x3818('0x4b')]);_0x2bd957[_0x3818('0x4c')]=qs['filters'](_[_0x3818('0x4d')](_0x3ee523['query'],_0x4e594f['filters']),_0x2c98a8);if(_0x3ee523[_0x3818('0x43')][_0x3818('0x4e')]){_0x2bd957[_0x3818('0x4c')]=_[_0x3818('0x4f')](_0x2bd957[_0x3818('0x4c')],{'$or':_[_0x3818('0x42')](_0x2c98a8,function(_0x3a8b44){if(_0x3a8b44[_0x3818('0x50')]!==_0x3818('0x51')){var _0x4fda01={};_0x4fda01[_0x3a8b44['name']]={'$like':'%'+_0x3ee523[_0x3818('0x43')][_0x3818('0x4e')]+'%'};return _0x4fda01;}})});}_0x2bd957=_[_0x3818('0x4f')]({},_0x2bd957,_0x3ee523['options']);var _0x184052={'where':_0x2bd957[_0x3818('0x4c')]};return db[_0x3818('0x3d')][_0x3818('0x2f')](_0x184052)[_0x3818('0x22')](function(_0x5bf590){_0x1a0ae9[_0x3818('0x2f')]=_0x5bf590;if(_0x3ee523[_0x3818('0x43')][_0x3818('0x52')]){_0x2bd957[_0x3818('0x53')]=[{'all':!![]}];}return db[_0x3818('0x3d')][_0x3818('0x54')](_0x2bd957);})[_0x3818('0x22')](function(_0x2f23fc){_0x1a0ae9[_0x3818('0x55')]=_0x2f23fc;return _0x1a0ae9;})[_0x3818('0x22')](respondWithFilteredResult(_0x55ea29,_0x2bd957))[_0x3818('0x56')](handleError(_0x55ea29,null));};exports[_0x3818('0x57')]=function(_0x21f86b,_0x2a42ed){var _0x44d2f9={'raw':!![],'where':{'id':_0x21f86b[_0x3818('0x58')]['id']}},_0x2768e4={};_0x2768e4['model']=_['keys'](db[_0x3818('0x3d')][_0x3818('0x3e')]);_0x2768e4[_0x3818('0x43')]=_[_0x3818('0x59')](_0x21f86b[_0x3818('0x43')]);_0x2768e4[_0x3818('0x44')]=_['intersection'](_0x2768e4['model'],_0x2768e4[_0x3818('0x43')]);_0x44d2f9[_0x3818('0x45')]=_[_0x3818('0x46')](_0x2768e4[_0x3818('0x41')],qs['fields'](_0x21f86b[_0x3818('0x43')][_0x3818('0x47')]));_0x44d2f9[_0x3818('0x45')]=_0x44d2f9[_0x3818('0x45')]['length']?_0x44d2f9[_0x3818('0x45')]:_0x2768e4[_0x3818('0x41')];if(_0x21f86b[_0x3818('0x43')][_0x3818('0x52')]){_0x44d2f9[_0x3818('0x53')]=[{'all':!![]}];}_0x44d2f9=_[_0x3818('0x4f')]({},_0x44d2f9,_0x21f86b['options']);return db[_0x3818('0x3d')]['find'](_0x44d2f9)[_0x3818('0x22')](handleEntityNotFound(_0x2a42ed,null))['then'](respondWithResult(_0x2a42ed,null))[_0x3818('0x56')](handleError(_0x2a42ed,null));};exports[_0x3818('0x5a')]=function(_0x38ceee,_0x376428){return db['WhatsappMessage'][_0x3818('0x5a')](_0x38ceee[_0x3818('0x5b')],{})[_0x3818('0x22')](respondWithResult(_0x376428,0xc9))['catch'](handleError(_0x376428,null));};exports[_0x3818('0x36')]=function(_0x568227,_0x4d6399){if(_0x568227['body']['id']){delete _0x568227[_0x3818('0x5b')]['id'];}return db[_0x3818('0x3d')]['find']({'where':{'id':_0x568227[_0x3818('0x58')]['id']}})['then'](handleEntityNotFound(_0x4d6399,null))[_0x3818('0x22')](saveUpdates(_0x568227['body'],null))[_0x3818('0x22')](respondWithResult(_0x4d6399,null))[_0x3818('0x56')](handleError(_0x4d6399,null));};exports['destroy']=function(_0xee092b,_0x455655){return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0xee092b['params']['id']}})[_0x3818('0x22')](handleEntityNotFound(_0x455655,null))[_0x3818('0x22')](removeEntity(_0x455655,null))[_0x3818('0x56')](handleError(_0x455655,null));};exports[_0x3818('0x5d')]=function(_0x298ead,_0x131e7e){return db['WhatsappMessage'][_0x3818('0x5d')]()['then'](respondWithResult(_0x131e7e,null))['catch'](handleError(_0x131e7e,null));};var interaction_log=require('../../config/logger')(_0x3818('0x5e'));exports['accept']=function(_0x2644df,_0x9b3ac3,_0x48bc66){var _0x176119={'agent':{},'channel':'whatsapp'};if(_0x2644df[_0x3818('0x5b')]['id']){delete _0x2644df[_0x3818('0x5b')]['id'];}_0x2644df[_0x3818('0x5b')][_0x3818('0x5f')]=!![];_0x2644df[_0x3818('0x5b')][_0x3818('0x60')]=moment()['format'](_0x3818('0x61'));_0x2644df[_0x3818('0x5b')][_0x3818('0x62')]=_0x2644df[_0x3818('0x5b')][_0x3818('0x62')]||_0x2644df[_0x3818('0x63')]['id'];_0x176119[_0x3818('0x64')]['id']=_0x2644df[_0x3818('0x5b')]['UserId'];return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0x2644df[_0x3818('0x58')]['id'],'UserId':null}})[_0x3818('0x22')](handleEntityNotFound(_0x9b3ac3,null))[_0x3818('0x22')](saveUpdates(_0x2644df[_0x3818('0x5b')],null))['then'](function(_0x783155){if(_0x783155){_0x176119[_0x3818('0x28')]=_0x783155['get']({'plain':!![]});return db[_0x3818('0x65')]['find']({'where':{'id':_0x783155[_0x3818('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x9b3ac3,null))['then'](function(_0xe179bd){if(_0xe179bd){return _0xe179bd['update']({'UserId':_0x2644df[_0x3818('0x5b')][_0x3818('0x62')],'read1stAt':_[_0x3818('0x67')](_0xe179bd[_0x3818('0x68')])?moment()[_0x3818('0x69')](_0x3818('0x61')):undefined});}return null;})['then'](function(_0x3e8cb9){if(_0x3e8cb9){_0x176119[_0x3818('0x6a')]=_0x3e8cb9[_0x3818('0x6b')]({'plain':!![]});interaction_log[_0x3818('0x29')](_0x3818('0x6c'),_0x2644df['user']['id'],_0x2644df[_0x3818('0x63')][_0x3818('0x3a')],_0x2644df[_0x3818('0x63')][_0x3818('0x6d')],_0x176119[_0x3818('0x6a')]['id'],_0x2644df[_0x3818('0x5b')]?JSON[_0x3818('0x6e')](_0x2644df[_0x3818('0x5b')]):_0x3818('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x3818('0x70'),_0x176119);}return null;})[_0x3818('0x22')](function(_0x139c93){var _0x43d64a=_0x3818('0x71')+_0x139c93['message'][_0x3818('0x72')];return db[_0x3818('0x73')]['query'](_0x43d64a,{'type':db['Sequelize']['QueryTypes'][_0x3818('0x74')],'raw':!![]})['then'](function(_0x441b75){return _0x441b75;});})[_0x3818('0x22')](function(_0xed36c){if(_0xed36c){_0x176119[_0x3818('0x28')][_0x3818('0x75')]=_0xed36c[0x0];if(!_0x2644df[_0x3818('0x5b')][_0x3818('0x62')])return;return db[_0x3818('0x76')][_0x3818('0x5c')]({'where':{'id':_0x2644df[_0x3818('0x5b')][_0x3818('0x62')],'role':_0x3818('0x64')},'attributes':['id',_0x3818('0x3a'),_0x3818('0x77'),_0x3818('0x78'),'internal'],'raw':!![]});}return null;})[_0x3818('0x22')](function(_0x1ca595){if(!_0x1ca595)return null;_0x176119[_0x3818('0x28')][_0x3818('0x64')]=_0x1ca595;return _0x176119;})['then'](function(_0x1c0adc){if(_0x1c0adc){if(_0x2644df['body'][_0x3818('0x79')]){_0x176119[_0x3818('0x28')][_0x3818('0x7a')]=util[_0x3818('0x69')](_0x3818('0x7b'),_0x2644df['user'][_0x3818('0x3a')]);_0x176119[_0x3818('0x28')]['channel']=_0x176119[_0x3818('0x7c')];_0x176119[_0x3818('0x28')][_0x3818('0x7d')]=_0x176119['channel'];_0x176119[_0x3818('0x28')][_0x3818('0x7e')]=_0x3818('0x7f');return respondWithRpcPromise(_0x3818('0x80'),_0x3818('0x80'),{'event':_0x3818('0x81'),'message':_0x176119[_0x3818('0x28')]},client9002)[_0x3818('0x22')](function(){return _0x176119;});}return _0x176119;}return null;})[_0x3818('0x22')](respondWithResult(_0x9b3ac3,null))['catch'](handleError(_0x9b3ac3,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x3818('0x34')]=function(_0x76a417,_0x34a6c6,_0x21fdb4){var _0x5b1496={'agent':{},'channel':_0x3818('0x82')};if(_0x76a417[_0x3818('0x5b')]['id']){delete _0x76a417['body']['id'];}_0x76a417[_0x3818('0x5b')][_0x3818('0x62')]=_0x76a417['body']['UserId']||_0x76a417[_0x3818('0x63')]['id'];_0x5b1496[_0x3818('0x64')]['id']=_0x76a417[_0x3818('0x5b')][_0x3818('0x62')];return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0x76a417['params']['id'],'UserId':null}})[_0x3818('0x22')](handleEntityNotFound(_0x34a6c6,null))[_0x3818('0x22')](function(_0x2da4e3){if(_0x2da4e3){_0x5b1496[_0x3818('0x28')]=_0x2da4e3['get']({'plain':!![]});return db[_0x3818('0x65')][_0x3818('0x5c')]({'where':{'id':_0x2da4e3['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x34a6c6,null))['then'](function(_0x444319){if(_0x444319){_0x5b1496[_0x3818('0x6a')]=_0x444319[_0x3818('0x6b')]({'plain':!![]});interaction_log[_0x3818('0x29')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x76a417[_0x3818('0x63')]['id'],_0x76a417[_0x3818('0x63')][_0x3818('0x3a')],_0x76a417[_0x3818('0x63')][_0x3818('0x6d')],_0x5b1496[_0x3818('0x6a')]['id'],_0x76a417[_0x3818('0x5b')]?JSON['stringify'](_0x76a417[_0x3818('0x5b')]):'null');return respondWithRpcPromise(_0x3818('0x83'),_0x3818('0x84'),_0x5b1496);}return null;})[_0x3818('0x22')](function(_0x1a57e5){var _0x512582=_0x3818('0x71')+_0x1a57e5['message'][_0x3818('0x72')];return db[_0x3818('0x73')][_0x3818('0x43')](_0x512582,{'type':db[_0x3818('0x85')]['QueryTypes'][_0x3818('0x74')],'raw':!![]})[_0x3818('0x22')](function(_0x3a39c1){return _0x3a39c1;});})['then'](function(_0xaaf890){if(_0xaaf890){_0x5b1496['message'][_0x3818('0x75')]=_0xaaf890[0x0];if(!_0x76a417[_0x3818('0x5b')][_0x3818('0x62')])return;return db[_0x3818('0x76')][_0x3818('0x5c')]({'where':{'id':_0x76a417[_0x3818('0x5b')][_0x3818('0x62')],'role':_0x3818('0x64')},'attributes':['id',_0x3818('0x3a'),_0x3818('0x77'),_0x3818('0x78'),_0x3818('0x86')],'raw':!![]});}return null;})[_0x3818('0x22')](function(_0x2eb382){if(!_0x2eb382)return null;_0x5b1496['message']['agent']=_0x2eb382;return _0x5b1496;})[_0x3818('0x22')](function(_0x220c3d){if(_0x220c3d){_0x220c3d[_0x3818('0x28')][_0x3818('0x7a')]=util['format'](_0x3818('0x7b'),_0x76a417['user'][_0x3818('0x3a')]);_0x220c3d[_0x3818('0x28')]['channel']=_0x5b1496['channel'];_0x220c3d[_0x3818('0x28')][_0x3818('0x7d')]=_0x5b1496[_0x3818('0x7c')];_0x220c3d['message']['event']=_0x3818('0x34');respondWithRpcPromise(_0x3818('0x80'),_0x3818('0x80'),{'event':_0x3818('0x87'),'message':_0x220c3d[_0x3818('0x28')]},client9002);return _0x5b1496;}return null;})[_0x3818('0x22')](respondWithResult(_0x34a6c6,null))['catch'](handleError(_0x34a6c6,null));};exports[_0x3818('0x2b')]=function(_0x10baa4,_0x41653d,_0x32a0e9){if(_0x10baa4[_0x3818('0x5b')]['id']){delete _0x10baa4[_0x3818('0x5b')]['id'];}var _0x55bfce;return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0x10baa4[_0x3818('0x58')]['id']}})[_0x3818('0x22')](handleEntityNotFound(_0x41653d,null))[_0x3818('0x22')](function(_0x41135e){if(_0x41135e){_0x55bfce=_0x41135e;return db[_0x3818('0x88')][_0x3818('0x5c')]({'where':{'id':_0x41135e[_0x3818('0x89')]}});}})[_0x3818('0x22')](handleEntityNotFound(_0x41653d,null))[_0x3818('0x22')](function(_0x9f203b){if(_0x9f203b){logger[_0x3818('0x8a')](_0x3818('0x8b'),'status',_0x3818('0x8c'),_0x9f203b['type'],util[_0x3818('0x8d')](_0x10baa4[_0x3818('0x5b')],{'showHidden':![],'depth':null}));switch(_0x9f203b['type']){case _0x3818('0x8e'):if(_0x10baa4[_0x3818('0x5b')][_0x3818('0x8f')]&&_0x10baa4['body']['MessageSid']===_0x55bfce[_0x3818('0x90')]&&_0x10baa4['body'][_0x3818('0x91')]&&_0x10baa4['body']['MessageStatus']===_0x3818('0x5f')){return _0x55bfce[_0x3818('0x36')]({'read':!![]});}else{logger[_0x3818('0x26')](_0x3818('0x92'),_0x3818('0x2b'),_0x3818('0x8e'),util[_0x3818('0x8d')](_0x10baa4[_0x3818('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x55bfce;}})[_0x3818('0x22')](respondWithResult(_0x41653d,null))[_0x3818('0x56')](handleError(_0x41653d,null));}; \ No newline at end of file +var _0x645b=['options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','describe','whatsapp-interactions','accept','readAt','format','agent','UserId','get','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','read','twilio','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','name','index','map','WhatsappMessage','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','VIRTUAL'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x645b,0x1cd));var _0xb645=function(_0x211c2b,_0x5aaa57){_0x211c2b=_0x211c2b-0x0;var _0x153d26=_0x645b[_0x211c2b];return _0x153d26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb645('0x0'));var zipdir=require(_0xb645('0x1'));var jsonpatch=require(_0xb645('0x2'));var rp=require(_0xb645('0x3'));var moment=require(_0xb645('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb645('0x5'));var sox=require(_0xb645('0x6'));var csv=require(_0xb645('0x7'));var ejs=require(_0xb645('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb645('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb645('0xa'));var toCsv=require(_0xb645('0x7'));var querystring=require(_0xb645('0xb'));var Papa=require(_0xb645('0xc'));var Redis=require(_0xb645('0xd'));var authService=require(_0xb645('0xe'));var qs=require(_0xb645('0xf'));var as=require(_0xb645('0x10'));var hardwareService=require(_0xb645('0x11'));var logger=require(_0xb645('0x12'))(_0xb645('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb645('0x14'));var db=require(_0xb645('0x15'))['db'];config[_0xb645('0x16')]=_[_0xb645('0x17')](config[_0xb645('0x16')],{'host':_0xb645('0x18'),'port':0x18eb});var socket=require(_0xb645('0x19'))(new Redis(config[_0xb645('0x16')]));require('./whatsappMessage.socket')[_0xb645('0x1a')](socket);var jayson=require(_0xb645('0x1b'));var client=jayson[_0xb645('0x1c')][_0xb645('0x1d')]({'port':0x232c});var client9002=jayson[_0xb645('0x1c')][_0xb645('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x404caa,_0x5a023c,_0x529af6,_0x5958e1){return new BPromise(function(_0x548643,_0x1a2b06){var _0x24ab4b=_0x5958e1||client;return _0x24ab4b[_0xb645('0x1e')](_0x404caa,_0x529af6)['then'](function(_0x210434){logger[_0xb645('0x1f')](_0xb645('0x20'),_0x5a023c,_0xb645('0x21'));logger['debug'](_0xb645('0x22'),_0x5a023c,_0xb645('0x21'),JSON[_0xb645('0x23')](_0x210434));if(_0x210434['error']){if(_0x210434[_0xb645('0x24')][_0xb645('0x25')]===0x1f4){logger[_0xb645('0x24')](_0xb645('0x20'),_0x5a023c,_0x210434[_0xb645('0x24')][_0xb645('0x26')]);return _0x1a2b06(_0x210434[_0xb645('0x24')][_0xb645('0x26')]);}logger[_0xb645('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x5a023c,_0x210434[_0xb645('0x24')][_0xb645('0x26')]);return _0x548643(_0x210434[_0xb645('0x24')][_0xb645('0x26')]);}else{logger['info'](_0xb645('0x20'),_0x5a023c,_0xb645('0x21'));_0x548643(_0x210434[_0xb645('0x27')][_0xb645('0x26')]);}})['catch'](function(_0x4b152f){logger['error'](_0xb645('0x20'),_0x5a023c,_0x4b152f);_0x1a2b06(_0x4b152f);});});}function respondWithStatusCode(_0x1ed1b2,_0x24ed44){_0x24ed44=_0x24ed44||0xcc;return function(_0xbd7598){if(_0xbd7598){return _0x1ed1b2[_0xb645('0x28')](_0x24ed44);}return _0x1ed1b2[_0xb645('0x29')](_0x24ed44)[_0xb645('0x2a')]();};}function respondWithResult(_0x28a2ff,_0x4bbf76){_0x4bbf76=_0x4bbf76||0xc8;return function(_0x47c018){if(_0x47c018){return _0x28a2ff[_0xb645('0x29')](_0x4bbf76)[_0xb645('0x2b')](_0x47c018);}};}function respondWithFilteredResult(_0x5a36b3,_0x44b09f){return function(_0x54d0a8){if(_0x54d0a8){var _0x590898=typeof _0x44b09f[_0xb645('0x2c')]===_0xb645('0x2d')&&typeof _0x44b09f[_0xb645('0x2e')]===_0xb645('0x2d');var _0x9a0d81=_0x54d0a8[_0xb645('0x2f')];var _0x145f04=_0x590898?0x0:_0x44b09f[_0xb645('0x2c')];var _0x147751=_0x590898?_0x54d0a8[_0xb645('0x2f')]:_0x44b09f[_0xb645('0x2c')]+_0x44b09f[_0xb645('0x2e')];var _0x543c31;if(_0x147751>=_0x9a0d81){_0x147751=_0x9a0d81;_0x543c31=0xc8;}else{_0x543c31=0xce;}_0x5a36b3[_0xb645('0x29')](_0x543c31);return _0x5a36b3[_0xb645('0x30')](_0xb645('0x31'),_0x145f04+'-'+_0x147751+'/'+_0x9a0d81)['json'](_0x54d0a8);}return null;};}function patchUpdates(_0x467c29){return function(_0x5d5615){try{jsonpatch[_0xb645('0x32')](_0x5d5615,_0x467c29,!![]);}catch(_0x37d13b){return BPromise[_0xb645('0x33')](_0x37d13b);}return _0x5d5615['save']();};}function saveUpdates(_0x3b6b1d,_0x2ae70a){return function(_0x467a7c){if(_0x467a7c){return _0x467a7c[_0xb645('0x34')](_0x3b6b1d)[_0xb645('0x35')](function(_0x36094c){return _0x36094c;});}return null;};}function removeEntity(_0x3d96e0,_0x3d50f5){return function(_0x2f8acd){if(_0x2f8acd){return _0x2f8acd['destroy']()[_0xb645('0x35')](function(){_0x3d96e0[_0xb645('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3efaf4,_0x2e570f){return function(_0xb5009c){if(!_0xb5009c){_0x3efaf4[_0xb645('0x28')](0x194);}return _0xb5009c;};}function handleError(_0x55242e,_0x54247a){_0x54247a=_0x54247a||0x1f4;return function(_0x5c787d){logger['error'](_0x5c787d['stack']);if(_0x5c787d[_0xb645('0x36')]){delete _0x5c787d[_0xb645('0x36')];}_0x55242e[_0xb645('0x29')](_0x54247a)['send'](_0x5c787d);};}exports[_0xb645('0x37')]=function(_0x4b119d,_0x5f380e){var _0x2f4d1e={},_0x23e1e3={},_0x4ef212={'count':0x0,'rows':[]};var _0x42241d=_[_0xb645('0x38')](db[_0xb645('0x39')]['rawAttributes'],function(_0x24020b){return{'name':_0x24020b['fieldName'],'type':_0x24020b['type'][_0xb645('0x3a')]};});_0x23e1e3[_0xb645('0x3b')]=_[_0xb645('0x38')](_0x42241d,_0xb645('0x36'));_0x23e1e3['query']=_[_0xb645('0x3c')](_0x4b119d[_0xb645('0x3d')]);_0x23e1e3[_0xb645('0x3e')]=_[_0xb645('0x3f')](_0x23e1e3[_0xb645('0x3b')],_0x23e1e3[_0xb645('0x3d')]);_0x2f4d1e[_0xb645('0x40')]=_[_0xb645('0x3f')](_0x23e1e3['model'],qs['fields'](_0x4b119d['query'][_0xb645('0x41')]));_0x2f4d1e[_0xb645('0x40')]=_0x2f4d1e[_0xb645('0x40')][_0xb645('0x42')]?_0x2f4d1e[_0xb645('0x40')]:_0x23e1e3[_0xb645('0x3b')];if(!_0x4b119d[_0xb645('0x3d')]['hasOwnProperty'](_0xb645('0x43'))){_0x2f4d1e[_0xb645('0x2e')]=qs[_0xb645('0x2e')](_0x4b119d[_0xb645('0x3d')][_0xb645('0x2e')]);_0x2f4d1e[_0xb645('0x2c')]=qs[_0xb645('0x2c')](_0x4b119d[_0xb645('0x3d')][_0xb645('0x2c')]);}_0x2f4d1e[_0xb645('0x44')]=qs['sort'](_0x4b119d[_0xb645('0x3d')][_0xb645('0x45')]);_0x2f4d1e['where']=qs[_0xb645('0x3e')](_['pick'](_0x4b119d[_0xb645('0x3d')],_0x23e1e3[_0xb645('0x3e')]),_0x42241d);if(_0x4b119d['query'][_0xb645('0x46')]){_0x2f4d1e[_0xb645('0x47')]=_[_0xb645('0x48')](_0x2f4d1e[_0xb645('0x47')],{'$or':_[_0xb645('0x38')](_0x42241d,function(_0x4bf38f){if(_0x4bf38f[_0xb645('0x49')]!==_0xb645('0x4a')){var _0x363bef={};_0x363bef[_0x4bf38f[_0xb645('0x36')]]={'$like':'%'+_0x4b119d[_0xb645('0x3d')][_0xb645('0x46')]+'%'};return _0x363bef;}})});}_0x2f4d1e=_[_0xb645('0x48')]({},_0x2f4d1e,_0x4b119d[_0xb645('0x4b')]);var _0x5dbafc={'where':_0x2f4d1e[_0xb645('0x47')]};return db[_0xb645('0x39')][_0xb645('0x2f')](_0x5dbafc)[_0xb645('0x35')](function(_0x409b92){_0x4ef212['count']=_0x409b92;if(_0x4b119d[_0xb645('0x3d')][_0xb645('0x4c')]){_0x2f4d1e['include']=[{'all':!![]}];}return db[_0xb645('0x39')]['findAll'](_0x2f4d1e);})[_0xb645('0x35')](function(_0x109a8){_0x4ef212[_0xb645('0x4d')]=_0x109a8;return _0x4ef212;})[_0xb645('0x35')](respondWithFilteredResult(_0x5f380e,_0x2f4d1e))[_0xb645('0x4e')](handleError(_0x5f380e,null));};exports[_0xb645('0x4f')]=function(_0x34a8ae,_0x4e2f04){var _0x3b630e={'raw':!![],'where':{'id':_0x34a8ae[_0xb645('0x50')]['id']}},_0x52c499={};_0x52c499[_0xb645('0x3b')]=_['keys'](db[_0xb645('0x39')][_0xb645('0x51')]);_0x52c499[_0xb645('0x3d')]=_['keys'](_0x34a8ae[_0xb645('0x3d')]);_0x52c499[_0xb645('0x3e')]=_[_0xb645('0x3f')](_0x52c499[_0xb645('0x3b')],_0x52c499[_0xb645('0x3d')]);_0x3b630e[_0xb645('0x40')]=_[_0xb645('0x3f')](_0x52c499[_0xb645('0x3b')],qs[_0xb645('0x41')](_0x34a8ae[_0xb645('0x3d')]['fields']));_0x3b630e[_0xb645('0x40')]=_0x3b630e[_0xb645('0x40')][_0xb645('0x42')]?_0x3b630e[_0xb645('0x40')]:_0x52c499[_0xb645('0x3b')];if(_0x34a8ae['query'][_0xb645('0x4c')]){_0x3b630e[_0xb645('0x52')]=[{'all':!![]}];}_0x3b630e=_[_0xb645('0x48')]({},_0x3b630e,_0x34a8ae['options']);return db[_0xb645('0x39')][_0xb645('0x53')](_0x3b630e)[_0xb645('0x35')](handleEntityNotFound(_0x4e2f04,null))[_0xb645('0x35')](respondWithResult(_0x4e2f04,null))[_0xb645('0x4e')](handleError(_0x4e2f04,null));};exports[_0xb645('0x54')]=function(_0x4ae803,_0x6ed6a0){return db[_0xb645('0x39')]['create'](_0x4ae803[_0xb645('0x55')],{})[_0xb645('0x35')](respondWithResult(_0x6ed6a0,0xc9))[_0xb645('0x4e')](handleError(_0x6ed6a0,null));};exports[_0xb645('0x34')]=function(_0x450263,_0x5259e8){if(_0x450263['body']['id']){delete _0x450263[_0xb645('0x55')]['id'];}return db[_0xb645('0x39')][_0xb645('0x53')]({'where':{'id':_0x450263[_0xb645('0x50')]['id']}})['then'](handleEntityNotFound(_0x5259e8,null))[_0xb645('0x35')](saveUpdates(_0x450263[_0xb645('0x55')],null))[_0xb645('0x35')](respondWithResult(_0x5259e8,null))['catch'](handleError(_0x5259e8,null));};exports[_0xb645('0x56')]=function(_0x2a4846,_0x50f4d5){return db[_0xb645('0x39')][_0xb645('0x53')]({'where':{'id':_0x2a4846['params']['id']}})[_0xb645('0x35')](handleEntityNotFound(_0x50f4d5,null))[_0xb645('0x35')](removeEntity(_0x50f4d5,null))[_0xb645('0x4e')](handleError(_0x50f4d5,null));};exports[_0xb645('0x57')]=function(_0x1277c7,_0x418e8e){return db[_0xb645('0x39')][_0xb645('0x57')]()[_0xb645('0x35')](respondWithResult(_0x418e8e,null))[_0xb645('0x4e')](handleError(_0x418e8e,null));};var interaction_log=require(_0xb645('0x12'))(_0xb645('0x58'));exports[_0xb645('0x59')]=function(_0x4a0f74,_0x2c45c1,_0x33d899){var _0x561669={'agent':{},'channel':'whatsapp'};if(_0x4a0f74[_0xb645('0x55')]['id']){delete _0x4a0f74['body']['id'];}_0x4a0f74[_0xb645('0x55')]['read']=!![];_0x4a0f74[_0xb645('0x55')][_0xb645('0x5a')]=moment()[_0xb645('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a0f74[_0xb645('0x55')]['UserId']=_0x4a0f74[_0xb645('0x55')]['UserId']||_0x4a0f74['user']['id'];_0x561669[_0xb645('0x5c')]['id']=_0x4a0f74[_0xb645('0x55')][_0xb645('0x5d')];return db['WhatsappMessage'][_0xb645('0x53')]({'where':{'id':_0x4a0f74[_0xb645('0x50')]['id'],'UserId':null}})[_0xb645('0x35')](handleEntityNotFound(_0x2c45c1,null))[_0xb645('0x35')](saveUpdates(_0x4a0f74[_0xb645('0x55')],null))['then'](function(_0x27d34b){if(_0x27d34b){_0x561669[_0xb645('0x26')]=_0x27d34b[_0xb645('0x5e')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x27d34b[_0xb645('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x2c45c1,null))[_0xb645('0x35')](function(_0x196699){if(_0x196699){return _0x196699[_0xb645('0x34')]({'UserId':_0x4a0f74['body']['UserId'],'read1stAt':_['isNil'](_0x196699[_0xb645('0x60')])?moment()[_0xb645('0x5b')](_0xb645('0x61')):undefined});}return null;})['then'](function(_0x20d867){if(_0x20d867){_0x561669[_0xb645('0x62')]=_0x20d867['get']({'plain':!![]});interaction_log[_0xb645('0x1f')](_0xb645('0x63'),_0x4a0f74[_0xb645('0x64')]['id'],_0x4a0f74[_0xb645('0x64')][_0xb645('0x36')],_0x4a0f74[_0xb645('0x64')][_0xb645('0x65')],_0x561669[_0xb645('0x62')]['id'],_0x4a0f74[_0xb645('0x55')]?JSON[_0xb645('0x23')](_0x4a0f74['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x561669);}return null;})['then'](function(_0x51785d){var _0xba5799=_0xb645('0x66')+_0x51785d[_0xb645('0x26')][_0xb645('0x67')];return db['sequelize'][_0xb645('0x3d')](_0xba5799,{'type':db[_0xb645('0x68')][_0xb645('0x69')][_0xb645('0x6a')],'raw':!![]})['then'](function(_0x236359){return _0x236359;});})[_0xb645('0x35')](function(_0x584486){if(_0x584486){_0x561669[_0xb645('0x26')][_0xb645('0x6b')]=_0x584486[0x0];if(!_0x4a0f74[_0xb645('0x55')]['UserId'])return;return db[_0xb645('0x6c')][_0xb645('0x53')]({'where':{'id':_0x4a0f74[_0xb645('0x55')][_0xb645('0x5d')],'role':'agent'},'attributes':['id','name',_0xb645('0x6d'),_0xb645('0x6e'),_0xb645('0x6f')],'raw':!![]});}return null;})['then'](function(_0x4c3dac){if(!_0x4c3dac)return null;_0x561669[_0xb645('0x26')][_0xb645('0x5c')]=_0x4c3dac;return _0x561669;})[_0xb645('0x35')](function(_0x4f732c){if(_0x4f732c){if(_0x4a0f74[_0xb645('0x55')][_0xb645('0x70')]){_0x561669[_0xb645('0x26')][_0xb645('0x71')]=util[_0xb645('0x5b')](_0xb645('0x72'),_0x4a0f74[_0xb645('0x64')]['name']);_0x561669[_0xb645('0x26')][_0xb645('0x73')]=_0x561669[_0xb645('0x73')];_0x561669['message'][_0xb645('0x74')]=_0x561669['channel'];_0x561669[_0xb645('0x26')][_0xb645('0x75')]=_0xb645('0x59');return respondWithRpcPromise(_0xb645('0x76'),'EventManager',{'event':'acceptmessage','message':_0x561669['message']},client9002)['then'](function(){return _0x561669;});}return _0x561669;}return null;})['then'](respondWithResult(_0x2c45c1,null))['catch'](handleError(_0x2c45c1,null));};var interaction_log=require(_0xb645('0x12'))(_0xb645('0x58'));exports[_0xb645('0x33')]=function(_0x300a50,_0x4a4bab,_0x4641c8){var _0x55eb01={'agent':{},'channel':_0xb645('0x77')};if(_0x300a50['body']['id']){delete _0x300a50['body']['id'];}_0x300a50[_0xb645('0x55')][_0xb645('0x5d')]=_0x300a50[_0xb645('0x55')][_0xb645('0x5d')]||_0x300a50['user']['id'];_0x55eb01[_0xb645('0x5c')]['id']=_0x300a50[_0xb645('0x55')][_0xb645('0x5d')];return db['WhatsappMessage'][_0xb645('0x53')]({'where':{'id':_0x300a50[_0xb645('0x50')]['id'],'UserId':null}})[_0xb645('0x35')](handleEntityNotFound(_0x4a4bab,null))[_0xb645('0x35')](function(_0x2578da){if(_0x2578da){_0x55eb01[_0xb645('0x26')]=_0x2578da[_0xb645('0x5e')]({'plain':!![]});return db['WhatsappInteraction'][_0xb645('0x53')]({'where':{'id':_0x2578da[_0xb645('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x4a4bab,null))[_0xb645('0x35')](function(_0x338f95){if(_0x338f95){_0x55eb01['interaction']=_0x338f95[_0xb645('0x5e')]({'plain':!![]});interaction_log[_0xb645('0x1f')](_0xb645('0x78'),_0x300a50[_0xb645('0x64')]['id'],_0x300a50['user'][_0xb645('0x36')],_0x300a50[_0xb645('0x64')]['role'],_0x55eb01['interaction']['id'],_0x300a50['body']?JSON[_0xb645('0x23')](_0x300a50[_0xb645('0x55')]):_0xb645('0x79'));return respondWithRpcPromise(_0xb645('0x7a'),_0xb645('0x7b'),_0x55eb01);}return null;})[_0xb645('0x35')](function(_0x412921){var _0x34662e=_0xb645('0x66')+_0x412921['message'][_0xb645('0x67')];return db[_0xb645('0x7c')]['query'](_0x34662e,{'type':db[_0xb645('0x68')][_0xb645('0x69')]['SELECT'],'raw':!![]})['then'](function(_0x415503){return _0x415503;});})[_0xb645('0x35')](function(_0x229b53){if(_0x229b53){_0x55eb01[_0xb645('0x26')][_0xb645('0x6b')]=_0x229b53[0x0];if(!_0x300a50['body'][_0xb645('0x5d')])return;return db[_0xb645('0x6c')]['find']({'where':{'id':_0x300a50['body'][_0xb645('0x5d')],'role':_0xb645('0x5c')},'attributes':['id',_0xb645('0x36'),_0xb645('0x6d'),_0xb645('0x6e'),_0xb645('0x6f')],'raw':!![]});}return null;})[_0xb645('0x35')](function(_0x211774){if(!_0x211774)return null;_0x55eb01[_0xb645('0x26')][_0xb645('0x5c')]=_0x211774;return _0x55eb01;})[_0xb645('0x35')](function(_0x3be054){if(_0x3be054){_0x3be054[_0xb645('0x26')][_0xb645('0x71')]=util[_0xb645('0x5b')](_0xb645('0x72'),_0x300a50['user']['name']);_0x3be054[_0xb645('0x26')][_0xb645('0x73')]=_0x55eb01[_0xb645('0x73')];_0x3be054[_0xb645('0x26')][_0xb645('0x74')]=_0x55eb01[_0xb645('0x73')];_0x3be054[_0xb645('0x26')][_0xb645('0x75')]=_0xb645('0x33');respondWithRpcPromise(_0xb645('0x76'),'EventManager',{'event':'rejectmessage','message':_0x3be054['message']},client9002);return _0x55eb01;}return null;})['then'](respondWithResult(_0x4a4bab,null))[_0xb645('0x4e')](handleError(_0x4a4bab,null));};exports[_0xb645('0x29')]=function(_0x387e4e,_0x2bda2d,_0x203126){if(_0x387e4e['body']['id']){delete _0x387e4e[_0xb645('0x55')]['id'];}var _0x58074;return db[_0xb645('0x39')][_0xb645('0x53')]({'where':{'id':_0x387e4e[_0xb645('0x50')]['id']}})['then'](handleEntityNotFound(_0x2bda2d,null))[_0xb645('0x35')](function(_0x34cece){if(_0x34cece){_0x58074=_0x34cece;return db[_0xb645('0x7d')][_0xb645('0x53')]({'where':{'id':_0x34cece[_0xb645('0x7e')]}});}})[_0xb645('0x35')](handleEntityNotFound(_0x2bda2d,null))['then'](function(_0x566bf6){if(_0x566bf6){logger['debug'](_0xb645('0x7f'),_0xb645('0x29'),_0xb645('0x80'),_0x566bf6[_0xb645('0x49')],util[_0xb645('0x81')](_0x387e4e['body'],{'showHidden':![],'depth':null}));switch(_0x566bf6[_0xb645('0x49')]){case'twilio':if(_0x387e4e[_0xb645('0x55')]['MessageSid']&&_0x387e4e[_0xb645('0x55')][_0xb645('0x82')]===_0x58074['messageId']&&_0x387e4e[_0xb645('0x55')][_0xb645('0x83')]&&_0x387e4e[_0xb645('0x55')][_0xb645('0x83')]===_0xb645('0x84')){return _0x58074[_0xb645('0x34')]({'read':!![]});}else{logger[_0xb645('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xb645('0x29'),_0xb645('0x85'),util[_0xb645('0x81')](_0x387e4e[_0xb645('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x58074;}})['then'](respondWithResult(_0x2bda2d,null))[_0xb645('0x4e')](handleError(_0x2bda2d,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 2350ad2..e14f62d 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 _0x4af8=['emit','hasOwnProperty','exports','save','update','remove'];(function(_0x3a6830,_0x324721){var _0x380957=function(_0x3201bd){while(--_0x3201bd){_0x3a6830['push'](_0x3a6830['shift']());}};_0x380957(++_0x324721);}(_0x4af8,0x1ad));var _0x84af=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4af8[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84af('0x0'),'afterUpdate':_0x84af('0x1'),'afterDestroy':_0x84af('0x2')};function emitEvent(_0x1446d3){return function(_0x482825,_0x294e04,_0x83633){WhatsappMessageEvents['emit'](_0x1446d3+':'+_0x482825['id'],_0x482825);WhatsappMessageEvents[_0x84af('0x3')](_0x1446d3,_0x482825);_0x83633(null);};}for(var e in events){if(events[_0x84af('0x4')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x84af('0x5')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9434=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xe075e8,_0x4fe11a){var _0x240582=function(_0xdf5765){while(--_0xdf5765){_0xe075e8['push'](_0xe075e8['shift']());}};_0x240582(++_0x4fe11a);}(_0x9434,0x168));var _0x4943=function(_0x3d6e2d,_0x174757){_0x3d6e2d=_0x3d6e2d-0x0;var _0x22a3d6=_0x9434[_0x3d6e2d];return _0x22a3d6;};'use strict';var EventEmitter=require(_0x4943('0x0'));var WhatsappMessage=require(_0x4943('0x1'))['db'][_0x4943('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4943('0x3')](0x0);var events={'afterCreate':_0x4943('0x4'),'afterUpdate':_0x4943('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1159f9){return function(_0xda4cba,_0x5117c7,_0x2ce3d9){WhatsappMessageEvents[_0x4943('0x6')](_0x1159f9+':'+_0xda4cba['id'],_0xda4cba);WhatsappMessageEvents['emit'](_0x1159f9,_0xda4cba);_0x2ce3d9(null);};}for(var e in events){if(events[_0x4943('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 1272cae..7380372 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 _0x064e=['models','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT'];(function(_0x4c4fe3,_0x5d6769){var _0x321a0d=function(_0x2d5c98){while(--_0x2d5c98){_0x4c4fe3['push'](_0x4c4fe3['shift']());}};_0x321a0d(++_0x5d6769);}(_0x064e,0xaa));var _0xe064=function(_0x55db5d,_0x54ca64){_0x55db5d=_0x55db5d-0x0;var _0x52839e=_0x064e[_0x55db5d];return _0x52839e;};'use strict';var _=require(_0xe064('0x0'));var util=require(_0xe064('0x1'));var logger=require(_0xe064('0x2'))(_0xe064('0x3'));var moment=require(_0xe064('0x4'));var BPromise=require(_0xe064('0x5'));var rp=require(_0xe064('0x6'));var fetch=require(_0xe064('0x7'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe064('0x8'));var attributes=require(_0xe064('0x9'));module['exports']=function(_0x378e83,_0xa0f1e1){return _0x378e83['define'](_0xe064('0xa'),attributes,{'tableName':_0xe064('0xb'),'paranoid':![],'indexes':[{'name':_0xe064('0xc'),'fields':[_0xe064('0xc')]},{'name':_0xe064('0xd'),'fields':[_0xe064('0xe')],'type':_0xe064('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4afeb2,_0x38ef00,_0x2fba1f){var _0xccd8b7=_0x378e83[_0xe064('0x10')];var _0x8271cd=_0x4afeb2['get']({'plain':!![]});if(_0x8271cd['direction'][_0xe064('0x11')]()==='in'||_0x8271cd[_0xe064('0x12')][_0xe064('0x11')]()===_0xe064('0x13')&&!_0x8271cd[_0xe064('0x14')]&&!_[_0xe064('0x15')](_0x8271cd[_0xe064('0x16')])){_0xccd8b7[_0xe064('0x17')][_0xe064('0x18')]({'where':{'id':_0x8271cd[_0xe064('0x19')]}})[_0xe064('0x1a')](function(_0x390b55){if(_0x390b55){_0x390b55[_0xe064('0x1b')]({'lastMsgAt':_0x8271cd[_0xe064('0x1c')],'lastMsgDirection':_0x8271cd['direction'][_0xe064('0x11')]()});}})['catch'](function(_0x3dca65){console['error'](_0x3dca65);});}if(_0x8271cd[_0xe064('0x12')]===_0xe064('0x13')&&!_0x8271cd['secret']){var _0x2d1697;_0xccd8b7[_0xe064('0x1d')][_0xe064('0x1e')]({'where':{'id':_0x8271cd[_0xe064('0x1f')]},'raw':!![]})[_0xe064('0x1a')](function(_0x29d2f2){_0x2d1697=_0x29d2f2;if(_0x2d1697&&_0x2d1697['type']){switch(_0x2d1697[_0xe064('0x20')]){case'twilio':var _0xd5de23=require(_0xe064('0x21'));if(_0x2d1697[_0xe064('0x22')]&&_0x2d1697[_0xe064('0x23')]&&_0x2d1697[_0xe064('0x24')]){var _0x50e93f=new _0xd5de23(_0x2d1697[_0xe064('0x22')],_0x2d1697[_0xe064('0x23')]);_0x50e93f[_0xe064('0x25')]['create']({'body':_0x8271cd['body'],'to':'whatsapp:'+_0x8271cd[_0xe064('0x24')],'from':_0xe064('0x26')+_0x2d1697[_0xe064('0x24')],'statusCallback':_0x2d1697[_0xe064('0x27')]+_0xe064('0x28')+_0x8271cd['id']+_0xe064('0x29')+_0x2d1697['token']})[_0xe064('0x1a')](function(_0x34a356){if(_0x34a356['sid']){return _0x4afeb2[_0xe064('0x1b')]({'messageId':_0x34a356['sid']});}})[_0xe064('0x2a')](function(_0x290ba1){logger['error'](_0xe064('0x2b'),_0xe064('0x2c'),_0xe064('0x21'),util[_0xe064('0x2d')](_0x290ba1,{'showHidden':![],'depth':null}));});}else{logger[_0xe064('0x2e')](_0xe064('0x2b'),_0xe064('0x2c'),_0xe064('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xe064('0x2f'):var _0x2d75d5=_0x2d1697[_0xe064('0x22')];var _0x118715=_0x2d1697[_0xe064('0x23')];var _0x149dc4=_0x2d1697[_0xe064('0x30')]+_0xe064('0x31')+_0x2d75d5+_0xe064('0x32');var _0x3812a7={'to':[_0x8271cd[_0xe064('0x24')]],'message':{'type':_0xe064('0x33'),'text':_0x8271cd[_0xe064('0xe')]}};var _0x2dc757={'method':_0xe064('0x34'),'uri':_0x149dc4,'headers':{'Authorization':_0xe064('0x35')+_0x118715,'Content-Type':_0xe064('0x36')},'body':_0x3812a7,'json':!![]};rp(_0x2dc757)[_0xe064('0x1a')](function(_0x179d37){if(_0x179d37[_0xe064('0x37')][0x0]['message_id']){return _0x4afeb2['update']({'messageId':_0x179d37[_0xe064('0x37')][0x0][_0xe064('0x38')]});}})[_0xe064('0x2a')](function(_0x2693ec){logger[_0xe064('0x39')](_0xe064('0x3a'),_0x2693ec);});break;}}})[_0xe064('0x3b')](function(){_0x2fba1f();});}else{_0x2fba1f();}}},'charset':_0xe064('0x3c'),'collate':_0xe064('0x3d')});}; \ No newline at end of file +var _0xae24=['POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./whatsappMessage.attributes','exports','define','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','whatsapp:','/api/whatsapp/messages/','token','update','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','text'];(function(_0x5b67e0,_0x1afb1d){var _0x4e8ab5=function(_0x47ea69){while(--_0x47ea69){_0x5b67e0['push'](_0x5b67e0['shift']());}};_0x4e8ab5(++_0x1afb1d);}(_0xae24,0x182));var _0x4ae2=function(_0x3bcb3f,_0x4f9d87){_0x3bcb3f=_0x3bcb3f-0x0;var _0x37e501=_0xae24[_0x3bcb3f];return _0x37e501;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x4ae2('0x4'));var rimraf=require('rimraf');var config=require(_0x4ae2('0x5'));var attributes=require(_0x4ae2('0x6'));module[_0x4ae2('0x7')]=function(_0x3e6055,_0x428054){return _0x3e6055[_0x4ae2('0x8')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x4ae2('0x9'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0x4ae2('0xa')],'type':_0x4ae2('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c32b7,_0x3b3acc,_0x449e1a){var _0x171449=_0x3e6055[_0x4ae2('0xc')];var _0x52458f=_0x5c32b7[_0x4ae2('0xd')]({'plain':!![]});if(_0x52458f[_0x4ae2('0xe')][_0x4ae2('0xf')]()==='in'||_0x52458f['direction'][_0x4ae2('0xf')]()===_0x4ae2('0x10')&&!_0x52458f[_0x4ae2('0x11')]&&!_[_0x4ae2('0x12')](_0x52458f[_0x4ae2('0x13')])){_0x171449[_0x4ae2('0x14')][_0x4ae2('0x15')]({'where':{'id':_0x52458f[_0x4ae2('0x16')]}})[_0x4ae2('0x17')](function(_0x5e2bfd){if(_0x5e2bfd){_0x5e2bfd['update']({'lastMsgAt':_0x52458f['createdAt'],'lastMsgDirection':_0x52458f[_0x4ae2('0xe')][_0x4ae2('0xf')]()});}})['catch'](function(_0x463765){console[_0x4ae2('0x18')](_0x463765);});}if(_0x52458f[_0x4ae2('0xe')]===_0x4ae2('0x10')&&!_0x52458f[_0x4ae2('0x11')]){var _0x3b207c;_0x171449[_0x4ae2('0x19')][_0x4ae2('0x1a')]({'where':{'id':_0x52458f[_0x4ae2('0x1b')]},'raw':!![]})[_0x4ae2('0x17')](function(_0x4d5071){_0x3b207c=_0x4d5071;if(_0x3b207c&&_0x3b207c['type']){switch(_0x3b207c[_0x4ae2('0x1c')]){case _0x4ae2('0x1d'):var _0x51e20c=require(_0x4ae2('0x1d'));if(_0x3b207c[_0x4ae2('0x1e')]&&_0x3b207c[_0x4ae2('0x1f')]&&_0x3b207c[_0x4ae2('0x20')]){var _0x8732bb=new _0x51e20c(_0x3b207c['accountSid'],_0x3b207c[_0x4ae2('0x1f')]);_0x8732bb['messages']['create']({'body':_0x52458f[_0x4ae2('0xa')],'to':_0x4ae2('0x21')+_0x52458f[_0x4ae2('0x20')],'from':_0x4ae2('0x21')+_0x3b207c[_0x4ae2('0x20')],'statusCallback':_0x3b207c['remote']+_0x4ae2('0x22')+_0x52458f['id']+'/status?token='+_0x3b207c[_0x4ae2('0x23')]})[_0x4ae2('0x17')](function(_0x130239){if(_0x130239['sid']){return _0x5c32b7[_0x4ae2('0x24')]({'messageId':_0x130239[_0x4ae2('0x25')]});}})[_0x4ae2('0x26')](function(_0x2aaa6f){logger[_0x4ae2('0x18')](_0x4ae2('0x27'),'afterCreate','twilio',util[_0x4ae2('0x28')](_0x2aaa6f,{'showHidden':![],'depth':null}));});}else{logger[_0x4ae2('0x18')](_0x4ae2('0x27'),_0x4ae2('0x29'),_0x4ae2('0x1d'),_0x4ae2('0x2a'));}break;case'sinch':var _0x5ec1fd=_0x3b207c[_0x4ae2('0x1e')];var _0x4e7741=_0x3b207c['authToken'];var _0x5e9f03=_0x3b207c[_0x4ae2('0x2b')]+_0x4ae2('0x2c')+_0x5ec1fd+'/messages/';var _0x883fd5={'to':[_0x52458f[_0x4ae2('0x20')]],'message':{'type':_0x4ae2('0x2d'),'text':_0x52458f[_0x4ae2('0xa')]}};var _0x14fdb3={'method':_0x4ae2('0x2e'),'uri':_0x5e9f03,'headers':{'Authorization':_0x4ae2('0x2f')+_0x4e7741,'Content-Type':_0x4ae2('0x30')},'body':_0x883fd5,'json':!![]};rp(_0x14fdb3)[_0x4ae2('0x17')](function(_0x3542df){if(_0x3542df[_0x4ae2('0x31')][0x0][_0x4ae2('0x32')]){return _0x5c32b7[_0x4ae2('0x24')]({'messageId':_0x3542df[_0x4ae2('0x31')][0x0][_0x4ae2('0x32')]});}})[_0x4ae2('0x26')](function(_0x451d2a){logger['err'](_0x4ae2('0x33'),_0x451d2a);});break;}}})['finally'](function(){_0x449e1a();});}else{_0x449e1a();}}},'charset':_0x4ae2('0x34'),'collate':_0x4ae2('0x35')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 5587e4a..03b2abb 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 _0x26b7=['redis','defaults','localhost','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4b6d39,_0x453cf5){var _0x1b5acc=function(_0x280262){while(--_0x280262){_0x4b6d39['push'](_0x4b6d39['shift']());}};_0x1b5acc(++_0x453cf5);}(_0x26b7,0x13e));var _0x726b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x26b7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x726b('0x0'));var util=require(_0x726b('0x1'));var moment=require(_0x726b('0x2'));var BPromise=require(_0x726b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x726b('0x4'));var db=require(_0x726b('0x5'))['db'];var utils=require(_0x726b('0x6'));var logger=require(_0x726b('0x7'))(_0x726b('0x8'));var config=require(_0x726b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x726b('0xa')][_0x726b('0xb')]({'port':0x232a});config[_0x726b('0xc')]=_[_0x726b('0xd')](config[_0x726b('0xc')],{'host':_0x726b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x726b('0xc')]));require(_0x726b('0xf'))[_0x726b('0x10')](socket);function respondWithRpcPromise(_0x48b860,_0x4207d2,_0x1da536){return new BPromise(function(_0xd70bb3,_0x3a0819){return client[_0x726b('0x11')](_0x48b860,_0x1da536)['then'](function(_0xe47d19){logger[_0x726b('0x12')](_0x726b('0x13'),_0x4207d2,_0x726b('0x14'));logger['debug'](_0x726b('0x15'),_0x4207d2,_0x726b('0x14'),JSON[_0x726b('0x16')](_0xe47d19));if(_0xe47d19['error']){if(_0xe47d19['error']['code']===0x1f4){logger[_0x726b('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0xe47d19[_0x726b('0x17')][_0x726b('0x18')]);return _0x3a0819(_0xe47d19[_0x726b('0x17')][_0x726b('0x18')]);}logger[_0x726b('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0xe47d19[_0x726b('0x17')]['message']);return _0xd70bb3(_0xe47d19[_0x726b('0x17')][_0x726b('0x18')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0x726b('0x14'));_0xd70bb3(_0xe47d19[_0x726b('0x19')][_0x726b('0x18')]);}})['catch'](function(_0x20abeb){logger[_0x726b('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0x20abeb);_0x3a0819(_0x20abeb);});});}exports[_0x726b('0x1a')]=function(_0x2d80aa){var _0x14e77d=this;return new Promise(function(_0x338a11,_0x53049f){return db[_0x726b('0x1b')][_0x726b('0x1c')](_0x2d80aa['body'],{'raw':_0x2d80aa[_0x726b('0x1d')]?_0x2d80aa[_0x726b('0x1d')][_0x726b('0x1e')]===undefined?!![]:![]:!![]})[_0x726b('0x1f')](function(_0x35a202){logger[_0x726b('0x12')]('CreateWhatsappMessage',_0x2d80aa);logger['debug'](_0x726b('0x1a'),_0x2d80aa,JSON[_0x726b('0x16')](_0x35a202));_0x338a11(_0x35a202);})[_0x726b('0x20')](function(_0x1310ac){logger[_0x726b('0x17')](_0x726b('0x1a'),_0x1310ac['message'],_0x2d80aa);_0x53049f(_0x14e77d[_0x726b('0x17')](0x1f4,_0x1310ac[_0x726b('0x18')]));});});}; \ No newline at end of file +var _0xb82c=['result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message'];(function(_0x5ca557,_0x44a2b8){var _0x3115dd=function(_0x410ac4){while(--_0x410ac4){_0x5ca557['push'](_0x5ca557['shift']());}};_0x3115dd(++_0x44a2b8);}(_0xb82c,0x110));var _0xcb82=function(_0xdc5664,_0x4eef5a){_0xdc5664=_0xdc5664-0x0;var _0xd65a92=_0xb82c[_0xdc5664];return _0xd65a92;};'use strict';var _=require(_0xcb82('0x0'));var util=require(_0xcb82('0x1'));var moment=require(_0xcb82('0x2'));var BPromise=require(_0xcb82('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb82('0x4'))['db'];var utils=require(_0xcb82('0x5'));var logger=require('../../config/logger')(_0xcb82('0x6'));var config=require(_0xcb82('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcb82('0x8')][_0xcb82('0x9')]({'port':0x232a});config[_0xcb82('0xa')]=_['defaults'](config['redis'],{'host':_0xcb82('0xb'),'port':0x18eb});var socket=require(_0xcb82('0xc'))(new Redis(config[_0xcb82('0xa')]));require(_0xcb82('0xd'))[_0xcb82('0xe')](socket);function respondWithRpcPromise(_0x31620a,_0x1b4ce8,_0x549ae5){return new BPromise(function(_0x31db15,_0x361050){return client[_0xcb82('0xf')](_0x31620a,_0x549ae5)[_0xcb82('0x10')](function(_0x3fdb5b){logger[_0xcb82('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x1b4ce8,_0xcb82('0x12'));logger['debug'](_0xcb82('0x13'),_0x1b4ce8,_0xcb82('0x12'),JSON[_0xcb82('0x14')](_0x3fdb5b));if(_0x3fdb5b[_0xcb82('0x15')]){if(_0x3fdb5b[_0xcb82('0x15')][_0xcb82('0x16')]===0x1f4){logger[_0xcb82('0x15')](_0xcb82('0x17'),_0x1b4ce8,_0x3fdb5b[_0xcb82('0x15')][_0xcb82('0x18')]);return _0x361050(_0x3fdb5b['error'][_0xcb82('0x18')]);}logger[_0xcb82('0x15')](_0xcb82('0x17'),_0x1b4ce8,_0x3fdb5b[_0xcb82('0x15')]['message']);return _0x31db15(_0x3fdb5b[_0xcb82('0x15')][_0xcb82('0x18')]);}else{logger[_0xcb82('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x1b4ce8,'request\x20sent');_0x31db15(_0x3fdb5b[_0xcb82('0x19')][_0xcb82('0x18')]);}})['catch'](function(_0x1603b3){logger['error'](_0xcb82('0x17'),_0x1b4ce8,_0x1603b3);_0x361050(_0x1603b3);});});}exports[_0xcb82('0x1a')]=function(_0x5a8164){var _0xe26abf=this;return new Promise(function(_0x5eb4aa,_0x56f247){return db[_0xcb82('0x1b')][_0xcb82('0x1c')](_0x5a8164[_0xcb82('0x1d')],{'raw':_0x5a8164[_0xcb82('0x1e')]?_0x5a8164['options'][_0xcb82('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x432e71){logger[_0xcb82('0x11')](_0xcb82('0x1a'),_0x5a8164);logger[_0xcb82('0x20')]('CreateWhatsappMessage',_0x5a8164,JSON[_0xcb82('0x14')](_0x432e71));_0x5eb4aa(_0x432e71);})['catch'](function(_0x57ccd3){logger[_0xcb82('0x15')](_0xcb82('0x1a'),_0x57ccd3[_0xcb82('0x18')],_0x5a8164);_0x56f247(_0xe26abf['error'](0x1f4,_0x57ccd3[_0xcb82('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index e4b3964..2094467 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 _0x6d10=['length','./whatsappMessage.events','remove','update','emit','register'];(function(_0x474ab8,_0x2ce35b){var _0x1db6d6=function(_0x16a631){while(--_0x16a631){_0x474ab8['push'](_0x474ab8['shift']());}};_0x1db6d6(++_0x2ce35b);}(_0x6d10,0x151));var _0x06d1=function(_0x49739f,_0x28e1b6){_0x49739f=_0x49739f-0x0;var _0x3b040f=_0x6d10[_0x49739f];return _0x3b040f;};'use strict';var WhatsappMessageEvents=require(_0x06d1('0x0'));var events=['save',_0x06d1('0x1'),_0x06d1('0x2')];function createListener(_0x374f31,_0x291828){return function(_0x31e987){_0x291828[_0x06d1('0x3')](_0x374f31,_0x31e987);};}function removeListener(_0x59a130,_0x540bf8){return function(){WhatsappMessageEvents['removeListener'](_0x59a130,_0x540bf8);};}exports[_0x06d1('0x4')]=function(_0x552a96){for(var _0x401b1f=0x0,_0x4d4649=events[_0x06d1('0x5')];_0x401b1f<_0x4d4649;_0x401b1f++){var _0x3db860=events[_0x401b1f];var _0x17b196=createListener('whatsappMessage:'+_0x3db860,_0x552a96);WhatsappMessageEvents['on'](_0x3db860,_0x17b196);}}; \ No newline at end of file +var _0x8a8a=['update','emit','removeListener','register','length','whatsappMessage:','save','remove'];(function(_0x23f4e3,_0x306148){var _0x13b2ce=function(_0x508801){while(--_0x508801){_0x23f4e3['push'](_0x23f4e3['shift']());}};_0x13b2ce(++_0x306148);}(_0x8a8a,0x1ee));var _0xa8a8=function(_0x43015f,_0x328752){_0x43015f=_0x43015f-0x0;var _0x244d3b=_0x8a8a[_0x43015f];return _0x244d3b;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xa8a8('0x0'),_0xa8a8('0x1'),_0xa8a8('0x2')];function createListener(_0xfac093,_0x3e3ece){return function(_0x2f25fc){_0x3e3ece[_0xa8a8('0x3')](_0xfac093,_0x2f25fc);};}function removeListener(_0x57fd36,_0x2e8442){return function(){WhatsappMessageEvents[_0xa8a8('0x4')](_0x57fd36,_0x2e8442);};}exports[_0xa8a8('0x5')]=function(_0x1ec931){for(var _0x589054=0x0,_0x2498a8=events[_0xa8a8('0x6')];_0x589054<_0x2498a8;_0x589054++){var _0x109678=events[_0x589054];var _0x296352=createListener(_0xa8a8('0x7')+_0x109678,_0x1ec931);WhatsappMessageEvents['on'](_0x109678,_0x296352);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a7322ef..58afe38 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 _0xcd19=['get','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xcd19,0x98));var _0x9cd1=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0xcd19[_0x4a93bb];return _0x208468;};'use strict';var multer=require(_0x9cd1('0x0'));var util=require(_0x9cd1('0x1'));var path=require(_0x9cd1('0x2'));var timeout=require(_0x9cd1('0x3'));var express=require(_0x9cd1('0x4'));var router=express[_0x9cd1('0x5')]();var fs_extra=require(_0x9cd1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9cd1('0x7'));var config=require(_0x9cd1('0x8'));var controller=require(_0x9cd1('0x9'));router[_0x9cd1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9cd1('0xb'),auth[_0x9cd1('0xc')](),controller['describe']);router[_0x9cd1('0xa')](_0x9cd1('0xd'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0xe')]);router[_0x9cd1('0xa')]('/:id/members',auth[_0x9cd1('0xc')](),controller[_0x9cd1('0xf')]);router[_0x9cd1('0xa')](_0x9cd1('0x10'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x11')]);router[_0x9cd1('0xa')](_0x9cd1('0x12'),auth['isAuthenticated'](),controller[_0x9cd1('0x13')]);router['post']('/',auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x14')]);router[_0x9cd1('0x15')](_0x9cd1('0x10'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x16')]);router[_0x9cd1('0x15')](_0x9cd1('0x12'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x17')]);router['put']('/:id',auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x18')]);router[_0x9cd1('0x19')](_0x9cd1('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x9cd1('0x19')](_0x9cd1('0x10'),auth[_0x9cd1('0xc')](),controller['removeTeams']);router[_0x9cd1('0x19')](_0x9cd1('0x12'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xb3c3=['delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','/:id/users','addAgents','put','update'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xb3c3,0x14a));var _0x3b3c=function(_0x30d04e,_0x416a8a){_0x30d04e=_0x30d04e-0x0;var _0x57ecbe=_0xb3c3[_0x30d04e];return _0x57ecbe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b3c('0x0'));var timeout=require(_0x3b3c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3b3c('0x2'));var auth=require(_0x3b3c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3b3c('0x4'));var controller=require(_0x3b3c('0x5'));router[_0x3b3c('0x6')]('/',auth[_0x3b3c('0x7')](),controller['index']);router[_0x3b3c('0x6')](_0x3b3c('0x8'),auth[_0x3b3c('0x7')](),controller['describe']);router['get'](_0x3b3c('0x9'),auth[_0x3b3c('0x7')](),controller[_0x3b3c('0xa')]);router[_0x3b3c('0x6')]('/:id/members',auth[_0x3b3c('0x7')](),controller[_0x3b3c('0xb')]);router[_0x3b3c('0x6')](_0x3b3c('0xc'),auth[_0x3b3c('0x7')](),controller[_0x3b3c('0xd')]);router[_0x3b3c('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x3b3c('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3b3c('0xf')](_0x3b3c('0xc'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x3b3c('0x10'),auth[_0x3b3c('0x7')](),controller[_0x3b3c('0x11')]);router[_0x3b3c('0x12')]('/:id',auth[_0x3b3c('0x7')](),controller[_0x3b3c('0x13')]);router[_0x3b3c('0x14')](_0x3b3c('0x9'),auth[_0x3b3c('0x7')](),controller[_0x3b3c('0x15')]);router[_0x3b3c('0x14')](_0x3b3c('0xc'),auth['isAuthenticated'](),controller[_0x3b3c('0x16')]);router[_0x3b3c('0x14')](_0x3b3c('0x10'),auth['isAuthenticated'](),controller[_0x3b3c('0x17')]);module[_0x3b3c('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index bf0a51d..2d0750e 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 _0x4584=['roundrobin','sequelize','STRING','name','INTEGER','beepall'];(function(_0x4a8b5f,_0x2d0344){var _0x59b741=function(_0x124a96){while(--_0x124a96){_0x4a8b5f['push'](_0x4a8b5f['shift']());}};_0x59b741(++_0x2d0344);}(_0x4584,0x1cf));var _0x4458=function(_0x17b94e,_0x1b2f59){_0x17b94e=_0x17b94e-0x0;var _0x14ab53=_0x4584[_0x17b94e];return _0x14ab53;};'use strict';var Sequelize=require(_0x4458('0x0'));module['exports']={'name':{'type':Sequelize[_0x4458('0x1')],'unique':_0x4458('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4458('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4458('0x4'),_0x4458('0x5'))},'description':{'type':Sequelize[_0x4458('0x1')]}}; \ No newline at end of file +var _0x89c4=['rrmemory','beepall','roundrobin','STRING','sequelize','exports','name'];(function(_0x362deb,_0x3892f9){var _0x288806=function(_0x481834){while(--_0x481834){_0x362deb['push'](_0x362deb['shift']());}};_0x288806(++_0x3892f9);}(_0x89c4,0x82));var _0x489c=function(_0x297256,_0x4af8da){_0x297256=_0x297256-0x0;var _0xc7bc0=_0x89c4[_0x297256];return _0xc7bc0;};'use strict';var Sequelize=require(_0x489c('0x0'));module[_0x489c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x489c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x489c('0x3'),_0x489c('0x4'),_0x489c('0x5'))},'description':{'type':Sequelize[_0x489c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 34d1382..51a041b 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 _0xedb6=['clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserWhatsappQueue','length','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','findOne','getTeams','addTeams','ids','Agents','online','each','forEach','emit','userWhatsappQueue:save','removeTeams','Team','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x43e1f4,_0x5bc9ba){var _0x1da2f8=function(_0x2e6bfa){while(--_0x2e6bfa){_0x43e1f4['push'](_0x43e1f4['shift']());}};_0x1da2f8(++_0x5bc9ba);}(_0xedb6,0x124));var _0x6edb=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0xedb6[_0xf34109];return _0x570bfc;};'use strict';var emlformat=require(_0x6edb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6edb('0x1'));var jsonpatch=require(_0x6edb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6edb('0x3'));var util=require(_0x6edb('0x4'));var path=require('path');var sox=require(_0x6edb('0x5'));var csv=require(_0x6edb('0x6'));var ejs=require(_0x6edb('0x7'));var fs=require('fs');var fs_extra=require(_0x6edb('0x8'));var _=require(_0x6edb('0x9'));var squel=require(_0x6edb('0xa'));var crypto=require(_0x6edb('0xb'));var jsforce=require(_0x6edb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6edb('0xd'));var Papa=require('papaparse');var Redis=require(_0x6edb('0xe'));var authService=require(_0x6edb('0xf'));var qs=require(_0x6edb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6edb('0x11'));var logger=require(_0x6edb('0x12'))(_0x6edb('0x13'));var utils=require(_0x6edb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6edb('0x15'));var db=require(_0x6edb('0x16'))['db'];config[_0x6edb('0x17')]=_[_0x6edb('0x18')](config[_0x6edb('0x17')],{'host':_0x6edb('0x19'),'port':0x18eb});var socket=require(_0x6edb('0x1a'))(new Redis(config[_0x6edb('0x17')]));require(_0x6edb('0x1b'))[_0x6edb('0x1c')](socket);function respondWithStatusCode(_0x1afdf9,_0x29bb08){_0x29bb08=_0x29bb08||0xcc;return function(_0x320ced){if(_0x320ced){return _0x1afdf9[_0x6edb('0x1d')](_0x29bb08);}return _0x1afdf9['status'](_0x29bb08)[_0x6edb('0x1e')]();};}function respondWithResult(_0x4cb37a,_0x1ac153){_0x1ac153=_0x1ac153||0xc8;return function(_0x2d965f){if(_0x2d965f){return _0x4cb37a[_0x6edb('0x1f')](_0x1ac153)['json'](_0x2d965f);}};}function respondWithFilteredResult(_0x380cdd,_0x53f668){return function(_0x44050f){if(_0x44050f){var _0x3a907c=typeof _0x53f668[_0x6edb('0x20')]===_0x6edb('0x21')&&typeof _0x53f668[_0x6edb('0x22')]===_0x6edb('0x21');var _0xfe4222=_0x44050f['count'];var _0x41bb31=_0x3a907c?0x0:_0x53f668[_0x6edb('0x20')];var _0x13803b=_0x3a907c?_0x44050f[_0x6edb('0x23')]:_0x53f668[_0x6edb('0x20')]+_0x53f668['limit'];var _0x159e5b;if(_0x13803b>=_0xfe4222){_0x13803b=_0xfe4222;_0x159e5b=0xc8;}else{_0x159e5b=0xce;}_0x380cdd[_0x6edb('0x1f')](_0x159e5b);return _0x380cdd[_0x6edb('0x24')]('Content-Range',_0x41bb31+'-'+_0x13803b+'/'+_0xfe4222)[_0x6edb('0x25')](_0x44050f);}return null;};}function patchUpdates(_0x1fcf32){return function(_0x371943){try{jsonpatch[_0x6edb('0x26')](_0x371943,_0x1fcf32,!![]);}catch(_0x1e9794){return BPromise[_0x6edb('0x27')](_0x1e9794);}return _0x371943[_0x6edb('0x28')]();};}function saveUpdates(_0x562aa4,_0x3a85e0){return function(_0x2aa536){if(_0x2aa536){return _0x2aa536['update'](_0x562aa4)[_0x6edb('0x29')](function(_0x5af8d8){return _0x5af8d8;});}return null;};}function removeEntity(_0x2e28f7,_0x4047bd){return function(_0x1120ff){if(_0x1120ff){return _0x1120ff[_0x6edb('0x2a')]()[_0x6edb('0x29')](function(){var _0x52d87d=_0x1120ff[_0x6edb('0x2b')]({'plain':!![]});var _0x2c4b72=_0x6edb('0x2c');return db[_0x6edb('0x2d')][_0x6edb('0x2a')]({'where':{'type':_0x2c4b72,'resourceId':_0x52d87d['id']}})[_0x6edb('0x29')](function(){return _0x1120ff;});})[_0x6edb('0x29')](function(){_0x2e28f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x345dcb,_0x8d5fc7){return function(_0x384f0e){if(!_0x384f0e){_0x345dcb['sendStatus'](0x194);}return _0x384f0e;};}function handleError(_0x2e1b74,_0x35f980){_0x35f980=_0x35f980||0x1f4;return function(_0x3ab4d4){logger['error'](_0x3ab4d4[_0x6edb('0x2e')]);if(_0x3ab4d4[_0x6edb('0x2f')]){delete _0x3ab4d4['name'];}_0x2e1b74[_0x6edb('0x1f')](_0x35f980)['send'](_0x3ab4d4);};}exports[_0x6edb('0x30')]=function(_0x3502c1,_0x22a175){var _0x5800a1={},_0x172ed5={},_0x38fa92={'count':0x0,'rows':[]};var _0x421140=_[_0x6edb('0x31')](db[_0x6edb('0x32')][_0x6edb('0x33')],function(_0x25c165){return{'name':_0x25c165[_0x6edb('0x34')],'type':_0x25c165[_0x6edb('0x35')][_0x6edb('0x36')]};});_0x172ed5['model']=_[_0x6edb('0x31')](_0x421140,_0x6edb('0x2f'));_0x172ed5['query']=_['keys'](_0x3502c1[_0x6edb('0x37')]);_0x172ed5[_0x6edb('0x38')]=_[_0x6edb('0x39')](_0x172ed5[_0x6edb('0x3a')],_0x172ed5[_0x6edb('0x37')]);_0x5800a1[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x172ed5[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x3502c1[_0x6edb('0x37')][_0x6edb('0x3c')]));_0x5800a1[_0x6edb('0x3b')]=_0x5800a1[_0x6edb('0x3b')]['length']?_0x5800a1[_0x6edb('0x3b')]:_0x172ed5[_0x6edb('0x3a')];if(!_0x3502c1[_0x6edb('0x37')][_0x6edb('0x3d')](_0x6edb('0x3e'))){_0x5800a1[_0x6edb('0x22')]=qs[_0x6edb('0x22')](_0x3502c1[_0x6edb('0x37')][_0x6edb('0x22')]);_0x5800a1[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x3502c1['query'][_0x6edb('0x20')]);}_0x5800a1[_0x6edb('0x3f')]=qs[_0x6edb('0x40')](_0x3502c1[_0x6edb('0x37')][_0x6edb('0x40')]);_0x5800a1[_0x6edb('0x41')]=qs[_0x6edb('0x38')](_[_0x6edb('0x42')](_0x3502c1['query'],_0x172ed5[_0x6edb('0x38')]),_0x421140);if(_0x3502c1[_0x6edb('0x37')][_0x6edb('0x43')]){_0x5800a1[_0x6edb('0x41')]=_[_0x6edb('0x44')](_0x5800a1['where'],{'$or':_[_0x6edb('0x31')](_0x421140,function(_0x42a3f6){if(_0x42a3f6[_0x6edb('0x35')]!=='VIRTUAL'){var _0xcbdf04={};_0xcbdf04[_0x42a3f6['name']]={'$like':'%'+_0x3502c1[_0x6edb('0x37')][_0x6edb('0x43')]+'%'};return _0xcbdf04;}})});}_0x5800a1=_[_0x6edb('0x44')]({},_0x5800a1,_0x3502c1[_0x6edb('0x45')]);var _0x6a6a9a={'where':_0x5800a1[_0x6edb('0x41')]};return db[_0x6edb('0x32')][_0x6edb('0x23')](_0x6a6a9a)[_0x6edb('0x29')](function(_0x10bdda){_0x38fa92[_0x6edb('0x23')]=_0x10bdda;if(_0x3502c1[_0x6edb('0x37')][_0x6edb('0x46')]){_0x5800a1[_0x6edb('0x47')]=[{'all':!![]}];}return db[_0x6edb('0x32')][_0x6edb('0x48')](_0x5800a1);})['then'](function(_0x402c9c){_0x38fa92['rows']=_0x402c9c;return _0x38fa92;})[_0x6edb('0x29')](respondWithFilteredResult(_0x22a175,_0x5800a1))[_0x6edb('0x49')](handleError(_0x22a175,null));};exports[_0x6edb('0x4a')]=function(_0x55d98f,_0x1434b8){var _0x8678e1={'raw':!![],'where':{'id':_0x55d98f[_0x6edb('0x4b')]['id']}},_0xef116e={};_0xef116e[_0x6edb('0x3a')]=_[_0x6edb('0x4c')](db[_0x6edb('0x32')][_0x6edb('0x33')]);_0xef116e[_0x6edb('0x37')]=_[_0x6edb('0x4c')](_0x55d98f['query']);_0xef116e[_0x6edb('0x38')]=_[_0x6edb('0x39')](_0xef116e[_0x6edb('0x3a')],_0xef116e[_0x6edb('0x37')]);_0x8678e1[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0xef116e[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x55d98f[_0x6edb('0x37')][_0x6edb('0x3c')]));_0x8678e1['attributes']=_0x8678e1[_0x6edb('0x3b')]['length']?_0x8678e1[_0x6edb('0x3b')]:_0xef116e['model'];if(_0x55d98f['query'][_0x6edb('0x46')]){_0x8678e1[_0x6edb('0x47')]=[{'all':!![]}];}_0x8678e1=_['merge']({},_0x8678e1,_0x55d98f[_0x6edb('0x45')]);return db[_0x6edb('0x32')][_0x6edb('0x4d')](_0x8678e1)['then'](handleEntityNotFound(_0x1434b8,null))[_0x6edb('0x29')](respondWithResult(_0x1434b8,null))['catch'](handleError(_0x1434b8,null));};exports['create']=function(_0x1f69ae,_0x9733c5){return db['WhatsappQueue']['create'](_0x1f69ae[_0x6edb('0x4e')],{})[_0x6edb('0x29')](function(_0x5a3e88){var _0x5607d6=_0x1f69ae[_0x6edb('0x4f')][_0x6edb('0x2b')]({'plain':!![]});if(!_0x5607d6)throw new Error(_0x6edb('0x50'));if(_0x5607d6['role']===_0x6edb('0x4f')){var _0xfb103f=_0x5a3e88[_0x6edb('0x2b')]({'plain':!![]});var _0x4e789d=_0x6edb('0x2c');return db[_0x6edb('0x51')][_0x6edb('0x4d')]({'where':{'name':_0x4e789d,'userProfileId':_0x5607d6[_0x6edb('0x52')]},'raw':!![]})['then'](function(_0x5ee92a){if(_0x5ee92a&&_0x5ee92a[_0x6edb('0x53')]===0x0){return db[_0x6edb('0x2d')]['create']({'name':_0xfb103f[_0x6edb('0x2f')],'resourceId':_0xfb103f['id'],'type':_0x5ee92a[_0x6edb('0x2f')],'sectionId':_0x5ee92a['id']},{})[_0x6edb('0x29')](function(){return _0x5a3e88;});}else{return _0x5a3e88;}})[_0x6edb('0x49')](function(_0x55b4cc){logger[_0x6edb('0x54')](_0x6edb('0x55'),_0x55b4cc);throw _0x55b4cc;});}return _0x5a3e88;})['then'](respondWithResult(_0x9733c5,0xc9))[_0x6edb('0x49')](handleError(_0x9733c5,null));};exports[_0x6edb('0x56')]=function(_0x145822,_0x1fa0d7){if(_0x145822['body']['id']){delete _0x145822[_0x6edb('0x4e')]['id'];}return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x145822['params']['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x1fa0d7,null))[_0x6edb('0x29')](saveUpdates(_0x145822['body'],null))[_0x6edb('0x29')](respondWithResult(_0x1fa0d7,null))[_0x6edb('0x49')](handleError(_0x1fa0d7,null));};exports[_0x6edb('0x2a')]=function(_0x4c62f3,_0x5f01e5){return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x4c62f3[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x5f01e5,null))[_0x6edb('0x29')](removeEntity(_0x5f01e5,null))[_0x6edb('0x49')](handleError(_0x5f01e5,null));};exports[_0x6edb('0x57')]=function(_0x5d1f77,_0xcc9a8a){return db['WhatsappQueue'][_0x6edb('0x57')]()[_0x6edb('0x29')](respondWithResult(_0xcc9a8a,null))[_0x6edb('0x49')](handleError(_0xcc9a8a,null));};exports['getMembers']=function(_0x4f89b8,_0x1db734,_0x2a326e){var _0x340acc={'raw':!![],'where':{}},_0x5f5742={},_0x3850c9;return db[_0x6edb('0x32')]['findOne']({'where':{'id':_0x4f89b8['params']['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x1db734,null))[_0x6edb('0x29')](function(_0x23f982){if(_0x23f982){_0x3850c9=_0x23f982[_0x6edb('0x2b')]({'plain':!![]});_0x5f5742[_0x6edb('0x3a')]=_[_0x6edb('0x4c')](db[_0x6edb('0x58')][_0x6edb('0x33')]);_0x5f5742[_0x6edb('0x37')]=_[_0x6edb('0x4c')](_0x4f89b8[_0x6edb('0x37')]);_0x5f5742['filters']=_[_0x6edb('0x39')](_0x5f5742['model'],_0x5f5742['query']);_0x340acc[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x5f5742[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x4f89b8['query']['fields']));_0x340acc[_0x6edb('0x3b')]=_0x340acc[_0x6edb('0x3b')][_0x6edb('0x59')]?_0x340acc['attributes']:_0x5f5742[_0x6edb('0x3a')];if(!_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x3d')](_0x6edb('0x3e'))){_0x340acc[_0x6edb('0x22')]=qs['limit'](_0x4f89b8[_0x6edb('0x37')]['limit']);_0x340acc[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x20')]);}_0x340acc['order']=qs[_0x6edb('0x40')](_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x40')]);_0x340acc[_0x6edb('0x41')]=qs[_0x6edb('0x38')](_['pick'](_0x4f89b8[_0x6edb('0x37')],_0x5f5742[_0x6edb('0x38')]));_0x340acc[_0x6edb('0x41')][_0x6edb('0x5a')]=_0x23f982['id'];if(_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x43')]){_0x340acc[_0x6edb('0x41')]=_['merge'](_0x340acc['where'],{'$or':_['map'](_0x340acc[_0x6edb('0x3b')],function(_0x58c427){var _0x420db0={};_0x420db0[_0x58c427]={'$like':'%'+_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x43')]+'%'};return _0x420db0;})});}_0x340acc=_[_0x6edb('0x44')]({},_0x340acc,_0x4f89b8[_0x6edb('0x45')]);return db[_0x6edb('0x58')][_0x6edb('0x48')](_0x340acc);}})[_0x6edb('0x29')](function(_0x4e980e){if(_0x4e980e){return db[_0x6edb('0x5b')][_0x6edb('0x5c')]({'where':{'id':_[_0x6edb('0x31')](_0x4e980e,_0x6edb('0x5d')),'role':_0x6edb('0x5e')},'attributes':['id',_0x6edb('0x2f'),_0x6edb('0x5f'),_0x6edb('0x60'),_0x6edb('0x61')]});}})[_0x6edb('0x29')](function(_0x518ee5){if(_0x518ee5){return{'count':_0x518ee5['count'],'rows':_[_0x6edb('0x31')](_0x518ee5[_0x6edb('0x62')],function(_0x55b149){return{'membername':_0x55b149[_0x6edb('0x2f')],'UserId':_0x55b149['id'],'queue_name':_0x3850c9[_0x6edb('0x2f')],'WhatsappQueueId':_0x3850c9['id'],'interface':util[_0x6edb('0x63')](_0x6edb('0x64'),'SIP',_0x55b149['name']),'penalty':0x0,'paused':_0x55b149[_0x6edb('0x5f')],'createdAt':_0x55b149[_0x6edb('0x61')],'updatedAt':_0x55b149['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6edb('0x29')](respondWithFilteredResult(_0x1db734,_0x340acc))[_0x6edb('0x49')](handleError(_0x1db734,null));};exports['getTeams']=function(_0x150a6d,_0xdf42e2,_0x141b02){var _0x1575c1={};var _0x5b05b7={};var _0x56bfd6;var _0x278afe;return db['WhatsappQueue'][_0x6edb('0x65')]({'where':{'id':_0x150a6d[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0xdf42e2,null))['then'](function(_0x32c3e0){if(_0x32c3e0){_0x56bfd6=_0x32c3e0;_0x5b05b7['model']=_[_0x6edb('0x4c')](db['Team'][_0x6edb('0x33')]);_0x5b05b7['query']=_['keys'](_0x150a6d[_0x6edb('0x37')]);_0x5b05b7[_0x6edb('0x38')]=_[_0x6edb('0x39')](_0x5b05b7[_0x6edb('0x3a')],_0x5b05b7[_0x6edb('0x37')]);_0x1575c1[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x5b05b7[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x150a6d['query'][_0x6edb('0x3c')]));_0x1575c1[_0x6edb('0x3b')]=_0x1575c1[_0x6edb('0x3b')][_0x6edb('0x59')]?_0x1575c1[_0x6edb('0x3b')]:_0x5b05b7[_0x6edb('0x3a')];_0x1575c1[_0x6edb('0x3f')]=qs['sort'](_0x150a6d[_0x6edb('0x37')][_0x6edb('0x40')]);_0x1575c1['where']=qs[_0x6edb('0x38')](_[_0x6edb('0x42')](_0x150a6d[_0x6edb('0x37')],_0x5b05b7[_0x6edb('0x38')]));if(_0x150a6d['query'][_0x6edb('0x43')]){_0x1575c1[_0x6edb('0x41')]=_[_0x6edb('0x44')](_0x1575c1['where'],{'$or':_[_0x6edb('0x31')](_0x1575c1['attributes'],function(_0x15a6fa){var _0x522f1e={};_0x522f1e[_0x15a6fa]={'$like':'%'+_0x150a6d[_0x6edb('0x37')]['filter']+'%'};return _0x522f1e;})});}_0x1575c1=_[_0x6edb('0x44')]({},_0x1575c1,_0x150a6d['options']);return _0x56bfd6[_0x6edb('0x66')](_0x1575c1);}})['then'](function(_0x713333){if(_0x713333){_0x278afe=_0x713333[_0x6edb('0x59')];if(!_0x150a6d[_0x6edb('0x37')][_0x6edb('0x3d')]('nolimit')){_0x1575c1[_0x6edb('0x22')]=qs[_0x6edb('0x22')](_0x150a6d[_0x6edb('0x37')][_0x6edb('0x22')]);_0x1575c1[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x150a6d[_0x6edb('0x37')][_0x6edb('0x20')]);}return _0x56bfd6['getTeams'](_0x1575c1);}})[_0x6edb('0x29')](function(_0x4433da){if(_0x4433da){return _0x4433da?{'count':_0x278afe,'rows':_0x4433da}:null;}})[_0x6edb('0x29')](respondWithResult(_0xdf42e2,null))[_0x6edb('0x49')](handleError(_0xdf42e2,null));};exports[_0x6edb('0x67')]=function(_0x3553ee,_0x1f0fa5,_0x22f3a8){var _0x70afa4=_0x3553ee['body'][_0x6edb('0x68')];return db['Team'][_0x6edb('0x48')]({'where':{'id':_0x70afa4},'attributes':['id'],'include':[{'model':db[_0x6edb('0x5b')],'as':_0x6edb('0x69'),'attributes':['id',_0x6edb('0x2f'),_0x6edb('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x6edb('0x29')](function(_0x34427a){if(_0x34427a){var _0x3feea1=_['flatMap'](_0x34427a,function(_0x21c3ed){var _0x398574=_0x21c3ed[_0x6edb('0x2b')]({'plain':!![]});return _0x398574[_0x6edb('0x69')];});return db[_0x6edb('0x32')]['find']({'where':{'id':_0x3553ee[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](function(_0x357aba){return db['sequelize']['transaction'](function(_0x4cbf86){return _0x357aba[_0x6edb('0x67')](_0x70afa4,{'transaction':_0x4cbf86})['then'](function(){return BPromise[_0x6edb('0x6b')](_0x3feea1,function(_0x466e6d){return db[_0x6edb('0x58')]['findOrCreate']({'where':{'UserId':_0x466e6d['id'],'WhatsappQueueId':_0x3553ee[_0x6edb('0x4b')]['id']},'transaction':_0x4cbf86});});})[_0x6edb('0x29')](function(){_0x3feea1[_0x6edb('0x6c')](function(_0x13719b){socket[_0x6edb('0x6d')](_0x6edb('0x6e'),{'UserId':_0x13719b['id'],'WhatsappQueueId':_0x357aba['id']});});});});});}})[_0x6edb('0x29')](respondWithStatusCode(_0x1f0fa5,null))[_0x6edb('0x49')](handleError(_0x1f0fa5,null));};exports[_0x6edb('0x6f')]=function(_0x2a8412,_0x1ad56c,_0x8d8692){return db[_0x6edb('0x70')][_0x6edb('0x48')]({'where':{'id':_0x2a8412['query'][_0x6edb('0x68')]},'attributes':['id'],'include':[{'model':db[_0x6edb('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1ad56c,null))[_0x6edb('0x29')](function(_0x4bb710){var _0x525b59=_[_0x6edb('0x31')](_0x4bb710,'id');var _0x15d437=[];var _0x510262=[];var _0x44cda4=squel['select']();_0x44cda4['field'](_0x6edb('0x71'))[_0x6edb('0x72')](_0x6edb('0x73'),'tq')[_0x6edb('0x74')](_0x6edb('0x75'),'ut',_0x6edb('0x76'))[_0x6edb('0x41')]('WhatsappQueueId\x20=\x20?',_0x2a8412[_0x6edb('0x4b')]['id']);for(var _0x2e16a8=0x0;_0x2e16a8<_0x4bb710[_0x6edb('0x59')];_0x2e16a8+=0x1){let _0x95676=_0x4bb710[_0x2e16a8];for(var _0x5774fd=0x0;_0x5774fd<_0x95676[_0x6edb('0x69')][_0x6edb('0x59')];_0x5774fd+=0x1){let _0x460877=_0x95676[_0x6edb('0x69')][_0x5774fd];var _0x33a095=_0x44cda4[_0x6edb('0x77')]();_0x33a095['where'](_0x6edb('0x78'),_0x460877['id']);_0x510262[_0x6edb('0x79')](db[_0x6edb('0x7a')][_0x6edb('0x37')](_0x33a095['toString'](),{'type':db[_0x6edb('0x7a')][_0x6edb('0x7b')][_0x6edb('0x7c')]})['then'](function(_0x2ed991){if(_0x2ed991['length']===0x1){return _0x460877['id'];}else{var _0x358d64=_[_0x6edb('0x7d')](_[_0x6edb('0x31')](_0x2ed991,_0x6edb('0x7e')),function(_0x390be4){return _[_0x6edb('0x7f')](_0x525b59,_0x390be4);});if(_0x358d64){return _0x460877['id'];}}}));}}return BPromise[_0x6edb('0x80')](_0x510262)[_0x6edb('0x29')](function(_0x2b8ac1){_0x15d437=_(_0x15d437)['union'](_0x2b8ac1)['compact']()['value']();return db['WhatsappQueue']['find']({'where':{'id':_0x2a8412[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](function(_0x862d9b){return db[_0x6edb('0x7a')][_0x6edb('0x81')](function(_0x3cf1d5){return _0x862d9b[_0x6edb('0x6f')](_0x2a8412[_0x6edb('0x37')][_0x6edb('0x68')],{'transaction':_0x3cf1d5})['then'](function(){if(!_[_0x6edb('0x82')](_0x15d437)){return _0x862d9b[_0x6edb('0x83')](_0x15d437,{'transaction':_0x3cf1d5});}})[_0x6edb('0x29')](function(){_0x15d437[_0x6edb('0x6c')](function(_0x569381){socket[_0x6edb('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x569381,'WhatsappQueueId':_0x862d9b['id']});});});});});});})['then'](respondWithStatusCode(_0x1ad56c,null))[_0x6edb('0x49')](handleError(_0x1ad56c,null));};exports[_0x6edb('0x84')]=function(_0x486772,_0x42c0ff,_0x5714c6){return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x486772[_0x6edb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42c0ff,null))['then'](function(_0x14dc69){if(_0x14dc69){return _0x14dc69[_0x6edb('0x84')](_0x486772['body']['ids'],_[_0x6edb('0x85')](_0x486772[_0x6edb('0x4e')],[_0x6edb('0x68'),'id'])||{})[_0x6edb('0x86')](function(_0x5e4324){for(var _0x30754f=0x0;_0x30754f<_0x486772[_0x6edb('0x4e')][_0x6edb('0x68')][_0x6edb('0x59')];_0x30754f+=0x1){socket['emit'](_0x6edb('0x6e'),{'UserId':Number(_0x486772[_0x6edb('0x4e')][_0x6edb('0x68')][_0x30754f]),'WhatsappQueueId':Number(_0x486772[_0x6edb('0x4b')]['id'])});}return _0x5e4324;});}})[_0x6edb('0x29')](respondWithResult(_0x42c0ff,null))[_0x6edb('0x49')](handleError(_0x42c0ff,null));};exports[_0x6edb('0x83')]=function(_0x1b0788,_0x925ce2,_0x554c10){return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x1b0788[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x925ce2,null))[_0x6edb('0x29')](function(_0x4144e8){if(_0x4144e8){return _0x4144e8[_0x6edb('0x83')](_0x1b0788[_0x6edb('0x37')]['ids'])[_0x6edb('0x29')](function(){if(_[_0x6edb('0x87')](_0x1b0788[_0x6edb('0x37')][_0x6edb('0x68')])){for(var _0x26a63a=0x0;_0x26a63a<_0x1b0788[_0x6edb('0x37')][_0x6edb('0x68')][_0x6edb('0x59')];_0x26a63a+=0x1){socket[_0x6edb('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x1b0788['query'][_0x6edb('0x68')][_0x26a63a]),'WhatsappQueueId':Number(_0x1b0788['params']['id'])});}}else{socket[_0x6edb('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x1b0788[_0x6edb('0x37')]['ids']),'WhatsappQueueId':Number(_0x1b0788[_0x6edb('0x4b')]['id'])});}});}})[_0x6edb('0x29')](respondWithStatusCode(_0x925ce2,null))[_0x6edb('0x49')](handleError(_0x925ce2,null));};exports[_0x6edb('0x88')]=function(_0x2e6ea9,_0x419b19,_0x160c66){var _0x4cece4={};var _0x42a6e2={};var _0x459bd6;var _0x4c83eb;return db['WhatsappQueue'][_0x6edb('0x65')]({'where':{'id':_0x2e6ea9[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x419b19,null))[_0x6edb('0x29')](function(_0x382e26){if(_0x382e26){_0x459bd6=_0x382e26;_0x42a6e2[_0x6edb('0x3a')]=_[_0x6edb('0x4c')](db[_0x6edb('0x5b')]['rawAttributes']);_0x42a6e2[_0x6edb('0x37')]=_[_0x6edb('0x4c')](_0x2e6ea9[_0x6edb('0x37')]);_0x42a6e2[_0x6edb('0x38')]=_['intersection'](_0x42a6e2[_0x6edb('0x3a')],_0x42a6e2[_0x6edb('0x37')]);_0x4cece4[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x42a6e2[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x2e6ea9['query'][_0x6edb('0x3c')]));_0x4cece4[_0x6edb('0x3b')]=_0x4cece4[_0x6edb('0x3b')][_0x6edb('0x59')]?_0x4cece4[_0x6edb('0x3b')]:_0x42a6e2['model'];_0x4cece4['order']=qs[_0x6edb('0x40')](_0x2e6ea9[_0x6edb('0x37')][_0x6edb('0x40')]);_0x4cece4[_0x6edb('0x41')]=qs[_0x6edb('0x38')](_[_0x6edb('0x42')](_0x2e6ea9[_0x6edb('0x37')],_0x42a6e2[_0x6edb('0x38')]));if(_0x2e6ea9[_0x6edb('0x37')][_0x6edb('0x43')]){_0x4cece4[_0x6edb('0x41')]=_[_0x6edb('0x44')](_0x4cece4[_0x6edb('0x41')],{'$or':_[_0x6edb('0x31')](_0x4cece4[_0x6edb('0x3b')],function(_0x580bfe){var _0x3ee83b={};_0x3ee83b[_0x580bfe]={'$like':'%'+_0x2e6ea9[_0x6edb('0x37')]['filter']+'%'};return _0x3ee83b;})});}_0x4cece4=_[_0x6edb('0x44')]({},_0x4cece4,_0x2e6ea9[_0x6edb('0x45')]);return _0x459bd6['getAgents'](_0x4cece4);}})['then'](function(_0xf22bad){if(_0xf22bad){_0x4c83eb=_0xf22bad[_0x6edb('0x59')];if(!_0x2e6ea9['query']['hasOwnProperty']('nolimit')){_0x4cece4['limit']=qs[_0x6edb('0x22')](_0x2e6ea9[_0x6edb('0x37')][_0x6edb('0x22')]);_0x4cece4[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x2e6ea9[_0x6edb('0x37')]['offset']);}return _0x459bd6['getAgents'](_0x4cece4);}})[_0x6edb('0x29')](function(_0x3ecb73){if(_0x3ecb73){return _0x3ecb73?{'count':_0x4c83eb,'rows':_0x3ecb73}:null;}})[_0x6edb('0x29')](respondWithResult(_0x419b19,null))[_0x6edb('0x49')](handleError(_0x419b19,null));}; \ No newline at end of file +var _0xbc6a=['includeAll','include','findAll','catch','params','length','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','keys','hasOwnProperty','UserWhatsappQueue','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','removeTeams','User','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','includes','union','compact','ids','removeAgents','forEach','addAgents','omit','spread','userWhatsappQueue:save','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','WhatsappQueues','UserProfileResource','error','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options'];(function(_0x25a7fc,_0x339cb9){var _0x5d8629=function(_0x57d363){while(--_0x57d363){_0x25a7fc['push'](_0x25a7fc['shift']());}};_0x5d8629(++_0x339cb9);}(_0xbc6a,0x161));var _0xabc6=function(_0x5aa76f,_0x16b110){_0x5aa76f=_0x5aa76f-0x0;var _0x1ac4c4=_0xbc6a[_0x5aa76f];return _0x1ac4c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabc6('0x0'));var zipdir=require(_0xabc6('0x1'));var jsonpatch=require(_0xabc6('0x2'));var rp=require(_0xabc6('0x3'));var moment=require(_0xabc6('0x4'));var BPromise=require(_0xabc6('0x5'));var Mustache=require('mustache');var util=require(_0xabc6('0x6'));var path=require(_0xabc6('0x7'));var sox=require(_0xabc6('0x8'));var csv=require(_0xabc6('0x9'));var ejs=require(_0xabc6('0xa'));var fs=require('fs');var fs_extra=require(_0xabc6('0xb'));var _=require(_0xabc6('0xc'));var squel=require(_0xabc6('0xd'));var crypto=require(_0xabc6('0xe'));var jsforce=require(_0xabc6('0xf'));var deskjs=require(_0xabc6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xabc6('0x11'));var Papa=require(_0xabc6('0x12'));var Redis=require(_0xabc6('0x13'));var authService=require(_0xabc6('0x14'));var qs=require(_0xabc6('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabc6('0x16'));var logger=require('../../config/logger')(_0xabc6('0x17'));var utils=require(_0xabc6('0x18'));var config=require(_0xabc6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xabc6('0x1a'))['db'];config['redis']=_[_0xabc6('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabc6('0x1c')]));require(_0xabc6('0x1d'))[_0xabc6('0x1e')](socket);function respondWithStatusCode(_0x816b38,_0x440e14){_0x440e14=_0x440e14||0xcc;return function(_0x28a6de){if(_0x28a6de){return _0x816b38[_0xabc6('0x1f')](_0x440e14);}return _0x816b38[_0xabc6('0x20')](_0x440e14)[_0xabc6('0x21')]();};}function respondWithResult(_0x2b1edb,_0x234824){_0x234824=_0x234824||0xc8;return function(_0x275825){if(_0x275825){return _0x2b1edb['status'](_0x234824)['json'](_0x275825);}};}function respondWithFilteredResult(_0xe7df7d,_0x179d29){return function(_0x4ebfd8){if(_0x4ebfd8){var _0x550e0a=typeof _0x179d29[_0xabc6('0x22')]==='undefined'&&typeof _0x179d29['limit']===_0xabc6('0x23');var _0x8dd3cb=_0x4ebfd8[_0xabc6('0x24')];var _0xe8481b=_0x550e0a?0x0:_0x179d29[_0xabc6('0x22')];var _0x5dc6fd=_0x550e0a?_0x4ebfd8['count']:_0x179d29['offset']+_0x179d29['limit'];var _0x501724;if(_0x5dc6fd>=_0x8dd3cb){_0x5dc6fd=_0x8dd3cb;_0x501724=0xc8;}else{_0x501724=0xce;}_0xe7df7d[_0xabc6('0x20')](_0x501724);return _0xe7df7d['set'](_0xabc6('0x25'),_0xe8481b+'-'+_0x5dc6fd+'/'+_0x8dd3cb)[_0xabc6('0x26')](_0x4ebfd8);}return null;};}function patchUpdates(_0x4ffcb7){return function(_0x43c018){try{jsonpatch[_0xabc6('0x27')](_0x43c018,_0x4ffcb7,!![]);}catch(_0xe6651e){return BPromise[_0xabc6('0x28')](_0xe6651e);}return _0x43c018[_0xabc6('0x29')]();};}function saveUpdates(_0x2920b5,_0x4fcc43){return function(_0x5c06a2){if(_0x5c06a2){return _0x5c06a2[_0xabc6('0x2a')](_0x2920b5)['then'](function(_0x337b4c){return _0x337b4c;});}return null;};}function removeEntity(_0x45732e,_0x59a911){return function(_0x312670){if(_0x312670){return _0x312670[_0xabc6('0x2b')]()[_0xabc6('0x2c')](function(){var _0x2d8943=_0x312670['get']({'plain':!![]});var _0x7ebc02=_0xabc6('0x2d');return db[_0xabc6('0x2e')][_0xabc6('0x2b')]({'where':{'type':_0x7ebc02,'resourceId':_0x2d8943['id']}})[_0xabc6('0x2c')](function(){return _0x312670;});})['then'](function(){_0x45732e[_0xabc6('0x20')](0xcc)[_0xabc6('0x21')]();});}};}function handleEntityNotFound(_0x13074f,_0x36ec2b){return function(_0x5a0009){if(!_0x5a0009){_0x13074f[_0xabc6('0x1f')](0x194);}return _0x5a0009;};}function handleError(_0x3db82d,_0x1cc624){_0x1cc624=_0x1cc624||0x1f4;return function(_0x1c554b){logger[_0xabc6('0x2f')](_0x1c554b['stack']);if(_0x1c554b[_0xabc6('0x30')]){delete _0x1c554b[_0xabc6('0x30')];}_0x3db82d[_0xabc6('0x20')](_0x1cc624)[_0xabc6('0x31')](_0x1c554b);};}exports[_0xabc6('0x32')]=function(_0x534f6c,_0x39bc77){var _0x5b0801={},_0x34dda6={},_0x404f18={'count':0x0,'rows':[]};var _0x10a012=_[_0xabc6('0x33')](db[_0xabc6('0x34')][_0xabc6('0x35')],function(_0x5c5886){return{'name':_0x5c5886[_0xabc6('0x36')],'type':_0x5c5886[_0xabc6('0x37')][_0xabc6('0x38')]};});_0x34dda6[_0xabc6('0x39')]=_[_0xabc6('0x33')](_0x10a012,_0xabc6('0x30'));_0x34dda6['query']=_['keys'](_0x534f6c[_0xabc6('0x3a')]);_0x34dda6[_0xabc6('0x3b')]=_[_0xabc6('0x3c')](_0x34dda6[_0xabc6('0x39')],_0x34dda6['query']);_0x5b0801[_0xabc6('0x3d')]=_[_0xabc6('0x3c')](_0x34dda6['model'],qs[_0xabc6('0x3e')](_0x534f6c['query'][_0xabc6('0x3e')]));_0x5b0801['attributes']=_0x5b0801[_0xabc6('0x3d')]['length']?_0x5b0801[_0xabc6('0x3d')]:_0x34dda6[_0xabc6('0x39')];if(!_0x534f6c[_0xabc6('0x3a')]['hasOwnProperty'](_0xabc6('0x3f'))){_0x5b0801[_0xabc6('0x40')]=qs[_0xabc6('0x40')](_0x534f6c[_0xabc6('0x3a')][_0xabc6('0x40')]);_0x5b0801[_0xabc6('0x22')]=qs[_0xabc6('0x22')](_0x534f6c[_0xabc6('0x3a')][_0xabc6('0x22')]);}_0x5b0801[_0xabc6('0x41')]=qs[_0xabc6('0x42')](_0x534f6c[_0xabc6('0x3a')][_0xabc6('0x42')]);_0x5b0801['where']=qs[_0xabc6('0x3b')](_[_0xabc6('0x43')](_0x534f6c['query'],_0x34dda6[_0xabc6('0x3b')]),_0x10a012);if(_0x534f6c[_0xabc6('0x3a')][_0xabc6('0x44')]){_0x5b0801[_0xabc6('0x45')]=_['merge'](_0x5b0801[_0xabc6('0x45')],{'$or':_[_0xabc6('0x33')](_0x10a012,function(_0x5f4742){if(_0x5f4742[_0xabc6('0x37')]!==_0xabc6('0x46')){var _0x338760={};_0x338760[_0x5f4742[_0xabc6('0x30')]]={'$like':'%'+_0x534f6c['query']['filter']+'%'};return _0x338760;}})});}_0x5b0801=_[_0xabc6('0x47')]({},_0x5b0801,_0x534f6c[_0xabc6('0x48')]);var _0x263d06={'where':_0x5b0801[_0xabc6('0x45')]};return db['WhatsappQueue'][_0xabc6('0x24')](_0x263d06)[_0xabc6('0x2c')](function(_0x579d2f){_0x404f18[_0xabc6('0x24')]=_0x579d2f;if(_0x534f6c[_0xabc6('0x3a')][_0xabc6('0x49')]){_0x5b0801[_0xabc6('0x4a')]=[{'all':!![]}];}return db[_0xabc6('0x34')][_0xabc6('0x4b')](_0x5b0801);})[_0xabc6('0x2c')](function(_0x3cd362){_0x404f18['rows']=_0x3cd362;return _0x404f18;})[_0xabc6('0x2c')](respondWithFilteredResult(_0x39bc77,_0x5b0801))[_0xabc6('0x4c')](handleError(_0x39bc77,null));};exports['show']=function(_0x4180cf,_0x414657){var _0x58e907={'raw':!![],'where':{'id':_0x4180cf[_0xabc6('0x4d')]['id']}},_0x1da6a0={};_0x1da6a0['model']=_['keys'](db[_0xabc6('0x34')][_0xabc6('0x35')]);_0x1da6a0[_0xabc6('0x3a')]=_['keys'](_0x4180cf[_0xabc6('0x3a')]);_0x1da6a0[_0xabc6('0x3b')]=_[_0xabc6('0x3c')](_0x1da6a0[_0xabc6('0x39')],_0x1da6a0[_0xabc6('0x3a')]);_0x58e907[_0xabc6('0x3d')]=_[_0xabc6('0x3c')](_0x1da6a0[_0xabc6('0x39')],qs[_0xabc6('0x3e')](_0x4180cf[_0xabc6('0x3a')]['fields']));_0x58e907['attributes']=_0x58e907[_0xabc6('0x3d')][_0xabc6('0x4e')]?_0x58e907['attributes']:_0x1da6a0[_0xabc6('0x39')];if(_0x4180cf[_0xabc6('0x3a')][_0xabc6('0x49')]){_0x58e907['include']=[{'all':!![]}];}_0x58e907=_[_0xabc6('0x47')]({},_0x58e907,_0x4180cf[_0xabc6('0x48')]);return db[_0xabc6('0x34')][_0xabc6('0x4f')](_0x58e907)[_0xabc6('0x2c')](handleEntityNotFound(_0x414657,null))[_0xabc6('0x2c')](respondWithResult(_0x414657,null))[_0xabc6('0x4c')](handleError(_0x414657,null));};exports[_0xabc6('0x50')]=function(_0xf3fa2f,_0x1b7e10){return db['WhatsappQueue']['create'](_0xf3fa2f['body'],{})[_0xabc6('0x2c')](function(_0x1a7e89){var _0x4a20b0=_0xf3fa2f[_0xabc6('0x51')][_0xabc6('0x52')]({'plain':!![]});if(!_0x4a20b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a20b0['role']==='user'){var _0x458cd1=_0x1a7e89['get']({'plain':!![]});var _0x133859='WhatsappQueues';return db[_0xabc6('0x53')][_0xabc6('0x4f')]({'where':{'name':_0x133859,'userProfileId':_0x4a20b0[_0xabc6('0x54')]},'raw':!![]})[_0xabc6('0x2c')](function(_0x5cdbe1){if(_0x5cdbe1&&_0x5cdbe1[_0xabc6('0x55')]===0x0){return db[_0xabc6('0x2e')]['create']({'name':_0x458cd1['name'],'resourceId':_0x458cd1['id'],'type':_0x5cdbe1[_0xabc6('0x30')],'sectionId':_0x5cdbe1['id']},{})[_0xabc6('0x2c')](function(){return _0x1a7e89;});}else{return _0x1a7e89;}})[_0xabc6('0x4c')](function(_0x49e06a){logger[_0xabc6('0x2f')](_0xabc6('0x56'),_0x49e06a);throw _0x49e06a;});}return _0x1a7e89;})[_0xabc6('0x2c')](respondWithResult(_0x1b7e10,0xc9))[_0xabc6('0x4c')](handleError(_0x1b7e10,null));};exports[_0xabc6('0x2a')]=function(_0x7d4467,_0x24cfdd){if(_0x7d4467[_0xabc6('0x57')]['id']){delete _0x7d4467[_0xabc6('0x57')]['id'];}return db[_0xabc6('0x34')][_0xabc6('0x4f')]({'where':{'id':_0x7d4467[_0xabc6('0x4d')]['id']}})[_0xabc6('0x2c')](handleEntityNotFound(_0x24cfdd,null))[_0xabc6('0x2c')](saveUpdates(_0x7d4467[_0xabc6('0x57')],null))[_0xabc6('0x2c')](respondWithResult(_0x24cfdd,null))[_0xabc6('0x4c')](handleError(_0x24cfdd,null));};exports[_0xabc6('0x2b')]=function(_0x1df0b9,_0x46b196){return db[_0xabc6('0x34')][_0xabc6('0x4f')]({'where':{'id':_0x1df0b9[_0xabc6('0x4d')]['id']}})[_0xabc6('0x2c')](handleEntityNotFound(_0x46b196,null))[_0xabc6('0x2c')](removeEntity(_0x46b196,null))['catch'](handleError(_0x46b196,null));};exports['describe']=function(_0x2ac2fd,_0x3f3e14){return db[_0xabc6('0x34')]['describe']()[_0xabc6('0x2c')](respondWithResult(_0x3f3e14,null))[_0xabc6('0x4c')](handleError(_0x3f3e14,null));};exports[_0xabc6('0x58')]=function(_0x389b8e,_0x57b69d,_0x5f2a86){var _0x5a1e97={'raw':!![],'where':{}},_0x1d185b={},_0x292463;return db[_0xabc6('0x34')][_0xabc6('0x59')]({'where':{'id':_0x389b8e[_0xabc6('0x4d')]['id']}})[_0xabc6('0x2c')](handleEntityNotFound(_0x57b69d,null))[_0xabc6('0x2c')](function(_0x424e5a){if(_0x424e5a){_0x292463=_0x424e5a[_0xabc6('0x52')]({'plain':!![]});_0x1d185b['model']=_[_0xabc6('0x5a')](db['UserWhatsappQueue'][_0xabc6('0x35')]);_0x1d185b['query']=_[_0xabc6('0x5a')](_0x389b8e[_0xabc6('0x3a')]);_0x1d185b[_0xabc6('0x3b')]=_[_0xabc6('0x3c')](_0x1d185b[_0xabc6('0x39')],_0x1d185b['query']);_0x5a1e97[_0xabc6('0x3d')]=_[_0xabc6('0x3c')](_0x1d185b[_0xabc6('0x39')],qs['fields'](_0x389b8e[_0xabc6('0x3a')]['fields']));_0x5a1e97[_0xabc6('0x3d')]=_0x5a1e97[_0xabc6('0x3d')]['length']?_0x5a1e97[_0xabc6('0x3d')]:_0x1d185b[_0xabc6('0x39')];if(!_0x389b8e[_0xabc6('0x3a')][_0xabc6('0x5b')](_0xabc6('0x3f'))){_0x5a1e97[_0xabc6('0x40')]=qs[_0xabc6('0x40')](_0x389b8e[_0xabc6('0x3a')][_0xabc6('0x40')]);_0x5a1e97['offset']=qs[_0xabc6('0x22')](_0x389b8e[_0xabc6('0x3a')][_0xabc6('0x22')]);}_0x5a1e97['order']=qs[_0xabc6('0x42')](_0x389b8e[_0xabc6('0x3a')]['sort']);_0x5a1e97[_0xabc6('0x45')]=qs[_0xabc6('0x3b')](_['pick'](_0x389b8e['query'],_0x1d185b[_0xabc6('0x3b')]));_0x5a1e97['where']['WhatsappQueueId']=_0x424e5a['id'];if(_0x389b8e[_0xabc6('0x3a')]['filter']){_0x5a1e97[_0xabc6('0x45')]=_[_0xabc6('0x47')](_0x5a1e97[_0xabc6('0x45')],{'$or':_[_0xabc6('0x33')](_0x5a1e97[_0xabc6('0x3d')],function(_0x1a7b9e){var _0x2da865={};_0x2da865[_0x1a7b9e]={'$like':'%'+_0x389b8e[_0xabc6('0x3a')][_0xabc6('0x44')]+'%'};return _0x2da865;})});}_0x5a1e97=_[_0xabc6('0x47')]({},_0x5a1e97,_0x389b8e[_0xabc6('0x48')]);return db[_0xabc6('0x5c')][_0xabc6('0x4b')](_0x5a1e97);}})[_0xabc6('0x2c')](function(_0xd450b){if(_0xd450b){return db['User'][_0xabc6('0x5d')]({'where':{'id':_[_0xabc6('0x33')](_0xd450b,_0xabc6('0x5e')),'role':_0xabc6('0x5f')},'attributes':['id',_0xabc6('0x30'),_0xabc6('0x60'),_0xabc6('0x61'),_0xabc6('0x62')]});}})[_0xabc6('0x2c')](function(_0x5d0d01){if(_0x5d0d01){return{'count':_0x5d0d01['count'],'rows':_[_0xabc6('0x33')](_0x5d0d01[_0xabc6('0x63')],function(_0x3af2b7){return{'membername':_0x3af2b7[_0xabc6('0x30')],'UserId':_0x3af2b7['id'],'queue_name':_0x292463[_0xabc6('0x30')],'WhatsappQueueId':_0x292463['id'],'interface':util[_0xabc6('0x64')](_0xabc6('0x65'),_0xabc6('0x66'),_0x3af2b7[_0xabc6('0x30')]),'penalty':0x0,'paused':_0x3af2b7[_0xabc6('0x60')],'createdAt':_0x3af2b7[_0xabc6('0x62')],'updatedAt':_0x3af2b7[_0xabc6('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xabc6('0x2c')](respondWithFilteredResult(_0x57b69d,_0x5a1e97))['catch'](handleError(_0x57b69d,null));};exports[_0xabc6('0x67')]=function(_0x49645e,_0xd7ce4b,_0x5bb439){var _0x280d09={};var _0x496acf={};var _0x2ad2fb;var _0x3f1b65;return db[_0xabc6('0x34')][_0xabc6('0x59')]({'where':{'id':_0x49645e[_0xabc6('0x4d')]['id']}})[_0xabc6('0x2c')](handleEntityNotFound(_0xd7ce4b,null))['then'](function(_0x460669){if(_0x460669){_0x2ad2fb=_0x460669;_0x496acf[_0xabc6('0x39')]=_[_0xabc6('0x5a')](db[_0xabc6('0x68')][_0xabc6('0x35')]);_0x496acf[_0xabc6('0x3a')]=_[_0xabc6('0x5a')](_0x49645e['query']);_0x496acf[_0xabc6('0x3b')]=_['intersection'](_0x496acf['model'],_0x496acf[_0xabc6('0x3a')]);_0x280d09[_0xabc6('0x3d')]=_[_0xabc6('0x3c')](_0x496acf[_0xabc6('0x39')],qs[_0xabc6('0x3e')](_0x49645e[_0xabc6('0x3a')][_0xabc6('0x3e')]));_0x280d09['attributes']=_0x280d09[_0xabc6('0x3d')][_0xabc6('0x4e')]?_0x280d09[_0xabc6('0x3d')]:_0x496acf['model'];_0x280d09[_0xabc6('0x41')]=qs[_0xabc6('0x42')](_0x49645e['query'][_0xabc6('0x42')]);_0x280d09['where']=qs[_0xabc6('0x3b')](_[_0xabc6('0x43')](_0x49645e[_0xabc6('0x3a')],_0x496acf[_0xabc6('0x3b')]));if(_0x49645e[_0xabc6('0x3a')][_0xabc6('0x44')]){_0x280d09['where']=_['merge'](_0x280d09[_0xabc6('0x45')],{'$or':_[_0xabc6('0x33')](_0x280d09[_0xabc6('0x3d')],function(_0x3e8287){var _0x25851f={};_0x25851f[_0x3e8287]={'$like':'%'+_0x49645e[_0xabc6('0x3a')]['filter']+'%'};return _0x25851f;})});}_0x280d09=_['merge']({},_0x280d09,_0x49645e[_0xabc6('0x48')]);return _0x2ad2fb[_0xabc6('0x67')](_0x280d09);}})[_0xabc6('0x2c')](function(_0x25e8d3){if(_0x25e8d3){_0x3f1b65=_0x25e8d3['length'];if(!_0x49645e['query'][_0xabc6('0x5b')](_0xabc6('0x3f'))){_0x280d09[_0xabc6('0x40')]=qs['limit'](_0x49645e[_0xabc6('0x3a')][_0xabc6('0x40')]);_0x280d09[_0xabc6('0x22')]=qs[_0xabc6('0x22')](_0x49645e[_0xabc6('0x3a')]['offset']);}return _0x2ad2fb[_0xabc6('0x67')](_0x280d09);}})[_0xabc6('0x2c')](function(_0xa7ff51){if(_0xa7ff51){return _0xa7ff51?{'count':_0x3f1b65,'rows':_0xa7ff51}:null;}})[_0xabc6('0x2c')](respondWithResult(_0xd7ce4b,null))['catch'](handleError(_0xd7ce4b,null));};exports[_0xabc6('0x69')]=function(_0x36b347,_0x181fb2,_0x5c8e1c){var _0x19fc55=_0x36b347[_0xabc6('0x57')]['ids'];return db['Team']['findAll']({'where':{'id':_0x19fc55},'attributes':['id'],'include':[{'model':db['User'],'as':_0xabc6('0x6a'),'attributes':['id',_0xabc6('0x30'),_0xabc6('0x6b'),_0xabc6('0x6c'),_0xabc6('0x6d')],'raw':!![]}]})[_0xabc6('0x2c')](function(_0x47d95b){if(_0x47d95b){var _0x4ffc8b=_['flatMap'](_0x47d95b,function(_0x6440d4){var _0x49ff6d=_0x6440d4[_0xabc6('0x52')]({'plain':!![]});return _0x49ff6d[_0xabc6('0x6a')];});return db[_0xabc6('0x34')][_0xabc6('0x4f')]({'where':{'id':_0x36b347['params']['id']}})[_0xabc6('0x2c')](function(_0x123b9b){return db[_0xabc6('0x6e')][_0xabc6('0x6f')](function(_0x198d08){return _0x123b9b[_0xabc6('0x69')](_0x19fc55,{'transaction':_0x198d08})[_0xabc6('0x2c')](function(){return BPromise[_0xabc6('0x70')](_0x4ffc8b,function(_0x41d10c){return db['UserWhatsappQueue'][_0xabc6('0x71')]({'where':{'UserId':_0x41d10c['id'],'WhatsappQueueId':_0x36b347[_0xabc6('0x4d')]['id']},'transaction':_0x198d08});});})[_0xabc6('0x2c')](function(){_0x4ffc8b['forEach'](function(_0x31e836){socket[_0xabc6('0x72')]('userWhatsappQueue:save',{'UserId':_0x31e836['id'],'WhatsappQueueId':_0x123b9b['id']});});});});});}})[_0xabc6('0x2c')](respondWithStatusCode(_0x181fb2,null))[_0xabc6('0x4c')](handleError(_0x181fb2,null));};exports[_0xabc6('0x73')]=function(_0x3050b3,_0x575fb3,_0x47607e){return db[_0xabc6('0x68')][_0xabc6('0x4b')]({'where':{'id':_0x3050b3['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xabc6('0x74')],'as':_0xabc6('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xabc6('0x2c')](handleEntityNotFound(_0x575fb3,null))[_0xabc6('0x2c')](function(_0x3b03ce){var _0x2fbc61=_['map'](_0x3b03ce,'id');var _0xd99a5f=[];var _0x4f86a7=[];var _0x1e9080=squel[_0xabc6('0x75')]();_0x1e9080['field'](_0xabc6('0x76'))[_0xabc6('0x77')](_0xabc6('0x78'),'tq')[_0xabc6('0x79')](_0xabc6('0x7a'),'ut',_0xabc6('0x7b'))[_0xabc6('0x45')](_0xabc6('0x7c'),_0x3050b3[_0xabc6('0x4d')]['id']);for(var _0x3ab007=0x0;_0x3ab007<_0x3b03ce['length'];_0x3ab007+=0x1){let _0xb5d5ed=_0x3b03ce[_0x3ab007];for(var _0x1cf394=0x0;_0x1cf394<_0xb5d5ed[_0xabc6('0x6a')][_0xabc6('0x4e')];_0x1cf394+=0x1){let _0x4a5923=_0xb5d5ed[_0xabc6('0x6a')][_0x1cf394];var _0x30db20=_0x1e9080[_0xabc6('0x7d')]();_0x30db20[_0xabc6('0x45')]('ut.UserId\x20=\x20?',_0x4a5923['id']);_0x4f86a7['push'](db[_0xabc6('0x6e')][_0xabc6('0x3a')](_0x30db20['toString'](),{'type':db['sequelize'][_0xabc6('0x7e')][_0xabc6('0x7f')]})[_0xabc6('0x2c')](function(_0x55c0b9){if(_0x55c0b9[_0xabc6('0x4e')]===0x1){return _0x4a5923['id'];}else{var _0x2bf460=_[_0xabc6('0x80')](_['map'](_0x55c0b9,'TeamId'),function(_0x492974){return _[_0xabc6('0x81')](_0x2fbc61,_0x492974);});if(_0x2bf460){return _0x4a5923['id'];}}}));}}return BPromise['all'](_0x4f86a7)[_0xabc6('0x2c')](function(_0x95f696){_0xd99a5f=_(_0xd99a5f)[_0xabc6('0x82')](_0x95f696)[_0xabc6('0x83')]()['value']();return db['WhatsappQueue'][_0xabc6('0x4f')]({'where':{'id':_0x3050b3[_0xabc6('0x4d')]['id']}})[_0xabc6('0x2c')](function(_0x3a36cc){return db['sequelize']['transaction'](function(_0x1b6658){return _0x3a36cc['removeTeams'](_0x3050b3[_0xabc6('0x3a')][_0xabc6('0x84')],{'transaction':_0x1b6658})['then'](function(){if(!_['isEmpty'](_0xd99a5f)){return _0x3a36cc[_0xabc6('0x85')](_0xd99a5f,{'transaction':_0x1b6658});}})[_0xabc6('0x2c')](function(){_0xd99a5f[_0xabc6('0x86')](function(_0x38574e){socket[_0xabc6('0x72')]('userWhatsappQueue:remove',{'UserId':_0x38574e,'WhatsappQueueId':_0x3a36cc['id']});});});});});});})[_0xabc6('0x2c')](respondWithStatusCode(_0x575fb3,null))[_0xabc6('0x4c')](handleError(_0x575fb3,null));};exports[_0xabc6('0x87')]=function(_0x340aef,_0x2cbc71,_0x2a4ce9){return db[_0xabc6('0x34')]['find']({'where':{'id':_0x340aef['params']['id']}})['then'](handleEntityNotFound(_0x2cbc71,null))['then'](function(_0x3766f2){if(_0x3766f2){return _0x3766f2[_0xabc6('0x87')](_0x340aef[_0xabc6('0x57')][_0xabc6('0x84')],_[_0xabc6('0x88')](_0x340aef[_0xabc6('0x57')],[_0xabc6('0x84'),'id'])||{})[_0xabc6('0x89')](function(_0x31a796){for(var _0x22a66a=0x0;_0x22a66a<_0x340aef[_0xabc6('0x57')][_0xabc6('0x84')][_0xabc6('0x4e')];_0x22a66a+=0x1){socket[_0xabc6('0x72')](_0xabc6('0x8a'),{'UserId':Number(_0x340aef[_0xabc6('0x57')][_0xabc6('0x84')][_0x22a66a]),'WhatsappQueueId':Number(_0x340aef['params']['id'])});}return _0x31a796;});}})[_0xabc6('0x2c')](respondWithResult(_0x2cbc71,null))[_0xabc6('0x4c')](handleError(_0x2cbc71,null));};exports[_0xabc6('0x85')]=function(_0x2473bd,_0xd386c8,_0x3ec8a4){return db['WhatsappQueue'][_0xabc6('0x4f')]({'where':{'id':_0x2473bd['params']['id']}})[_0xabc6('0x2c')](handleEntityNotFound(_0xd386c8,null))[_0xabc6('0x2c')](function(_0x82770d){if(_0x82770d){return _0x82770d[_0xabc6('0x85')](_0x2473bd['query'][_0xabc6('0x84')])[_0xabc6('0x2c')](function(){if(_[_0xabc6('0x8b')](_0x2473bd[_0xabc6('0x3a')][_0xabc6('0x84')])){for(var _0x42a6b5=0x0;_0x42a6b5<_0x2473bd[_0xabc6('0x3a')][_0xabc6('0x84')][_0xabc6('0x4e')];_0x42a6b5+=0x1){socket[_0xabc6('0x72')](_0xabc6('0x8c'),{'UserId':Number(_0x2473bd['query'][_0xabc6('0x84')][_0x42a6b5]),'WhatsappQueueId':Number(_0x2473bd[_0xabc6('0x4d')]['id'])});}}else{socket[_0xabc6('0x72')](_0xabc6('0x8c'),{'UserId':Number(_0x2473bd[_0xabc6('0x3a')][_0xabc6('0x84')]),'WhatsappQueueId':Number(_0x2473bd[_0xabc6('0x4d')]['id'])});}});}})[_0xabc6('0x2c')](respondWithStatusCode(_0xd386c8,null))[_0xabc6('0x4c')](handleError(_0xd386c8,null));};exports[_0xabc6('0x8d')]=function(_0x2549cc,_0x18682e,_0x124c9c){var _0x34259a={};var _0x4c3d90={};var _0xfd5a77;var _0x39febe;return db[_0xabc6('0x34')][_0xabc6('0x59')]({'where':{'id':_0x2549cc[_0xabc6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x18682e,null))['then'](function(_0x21a03c){if(_0x21a03c){_0xfd5a77=_0x21a03c;_0x4c3d90[_0xabc6('0x39')]=_[_0xabc6('0x5a')](db[_0xabc6('0x74')]['rawAttributes']);_0x4c3d90['query']=_['keys'](_0x2549cc[_0xabc6('0x3a')]);_0x4c3d90['filters']=_[_0xabc6('0x3c')](_0x4c3d90[_0xabc6('0x39')],_0x4c3d90[_0xabc6('0x3a')]);_0x34259a[_0xabc6('0x3d')]=_[_0xabc6('0x3c')](_0x4c3d90['model'],qs[_0xabc6('0x3e')](_0x2549cc['query'][_0xabc6('0x3e')]));_0x34259a[_0xabc6('0x3d')]=_0x34259a['attributes'][_0xabc6('0x4e')]?_0x34259a[_0xabc6('0x3d')]:_0x4c3d90[_0xabc6('0x39')];_0x34259a[_0xabc6('0x41')]=qs[_0xabc6('0x42')](_0x2549cc[_0xabc6('0x3a')][_0xabc6('0x42')]);_0x34259a['where']=qs[_0xabc6('0x3b')](_[_0xabc6('0x43')](_0x2549cc[_0xabc6('0x3a')],_0x4c3d90[_0xabc6('0x3b')]));if(_0x2549cc[_0xabc6('0x3a')][_0xabc6('0x44')]){_0x34259a['where']=_[_0xabc6('0x47')](_0x34259a['where'],{'$or':_[_0xabc6('0x33')](_0x34259a[_0xabc6('0x3d')],function(_0xe48c75){var _0x31652a={};_0x31652a[_0xe48c75]={'$like':'%'+_0x2549cc['query'][_0xabc6('0x44')]+'%'};return _0x31652a;})});}_0x34259a=_[_0xabc6('0x47')]({},_0x34259a,_0x2549cc['options']);return _0xfd5a77[_0xabc6('0x8d')](_0x34259a);}})[_0xabc6('0x2c')](function(_0x1bf8ca){if(_0x1bf8ca){_0x39febe=_0x1bf8ca[_0xabc6('0x4e')];if(!_0x2549cc[_0xabc6('0x3a')][_0xabc6('0x5b')](_0xabc6('0x3f'))){_0x34259a[_0xabc6('0x40')]=qs['limit'](_0x2549cc[_0xabc6('0x3a')][_0xabc6('0x40')]);_0x34259a[_0xabc6('0x22')]=qs[_0xabc6('0x22')](_0x2549cc['query'][_0xabc6('0x22')]);}return _0xfd5a77[_0xabc6('0x8d')](_0x34259a);}})['then'](function(_0x49d532){if(_0x49d532){return _0x49d532?{'count':_0x39febe,'rows':_0x49d532}:null;}})[_0xabc6('0x2c')](respondWithResult(_0x18682e,null))[_0xabc6('0x4c')](handleError(_0x18682e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 770b7d0..3ee3151 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 _0xdd0b=['emit','hasOwnProperty','hook','../../mysqldb','WhatsappQueue','save','update'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdd0b,0x106));var _0xbdd0=function(_0x3fbf62,_0x323aef){_0x3fbf62=_0x3fbf62-0x0;var _0x669f5=_0xdd0b[_0x3fbf62];return _0x669f5;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xbdd0('0x0'))['db'][_0xbdd0('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbdd0('0x2'),'afterUpdate':_0xbdd0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50899a){return function(_0x344705,_0x572ea8,_0x50e28a){WhatsappQueueEvents[_0xbdd0('0x4')](_0x50899a+':'+_0x344705['id'],_0x344705);WhatsappQueueEvents[_0xbdd0('0x4')](_0x50899a,_0x344705);_0x50e28a(null);};}for(var e in events){if(events[_0xbdd0('0x5')](e)){var event=events[e];WhatsappQueue[_0xbdd0('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x8f23=['hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','save','update','remove','emit'];(function(_0x4c0663,_0x1860b3){var _0x44a122=function(_0x48cca9){while(--_0x48cca9){_0x4c0663['push'](_0x4c0663['shift']());}};_0x44a122(++_0x1860b3);}(_0x8f23,0x16b));var _0x38f2=function(_0x1ccea7,_0x3ca216){_0x1ccea7=_0x1ccea7-0x0;var _0x8a889c=_0x8f23[_0x1ccea7];return _0x8a889c;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x38f2('0x0'))['db'][_0x38f2('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x38f2('0x2'),'afterUpdate':_0x38f2('0x3'),'afterDestroy':_0x38f2('0x4')};function emitEvent(_0x38b6a6){return function(_0xfc8540,_0x4d629b,_0x3e5088){WhatsappQueueEvents[_0x38f2('0x5')](_0x38b6a6+':'+_0xfc8540['id'],_0xfc8540);WhatsappQueueEvents[_0x38f2('0x5')](_0x38b6a6,_0xfc8540);_0x3e5088(null);};}for(var e in events){if(events[_0x38f2('0x6')](e)){var event=events[e];WhatsappQueue[_0x38f2('0x7')](e,emitEvent(event));}}module[_0x38f2('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index cff4ee7..8f46939 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 _0x36f2=['exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./whatsappQueue.attributes'];(function(_0x48f791,_0x57dbd7){var _0x5ec5ea=function(_0x1b8718){while(--_0x1b8718){_0x48f791['push'](_0x48f791['shift']());}};_0x5ec5ea(++_0x57dbd7);}(_0x36f2,0x159));var _0x236f=function(_0x4cee49,_0x5b5316){_0x4cee49=_0x4cee49-0x0;var _0x57de24=_0x36f2[_0x4cee49];return _0x57de24;};'use strict';var _=require(_0x236f('0x0'));var util=require('util');var logger=require(_0x236f('0x1'))(_0x236f('0x2'));var moment=require(_0x236f('0x3'));var BPromise=require('bluebird');var rp=require(_0x236f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x236f('0x5'));var attributes=require(_0x236f('0x6'));module[_0x236f('0x7')]=function(_0x1562b6,_0x2f5945){return _0x1562b6[_0x236f('0x8')](_0x236f('0x9'),attributes,{'tableName':_0x236f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76cc=['moment','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger'];(function(_0x1e1f36,_0x1f4ee7){var _0x437120=function(_0x2d9ab6){while(--_0x2d9ab6){_0x1e1f36['push'](_0x1e1f36['shift']());}};_0x437120(++_0x1f4ee7);}(_0x76cc,0x1c0));var _0xc76c=function(_0x5ed9eb,_0xd9381e){_0x5ed9eb=_0x5ed9eb-0x0;var _0x564d3c=_0x76cc[_0x5ed9eb];return _0x564d3c;};'use strict';var _=require(_0xc76c('0x0'));var util=require(_0xc76c('0x1'));var logger=require(_0xc76c('0x2'))('api');var moment=require(_0xc76c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc76c('0x4'));var rimraf=require('rimraf');var config=require(_0xc76c('0x5'));var attributes=require(_0xc76c('0x6'));module[_0xc76c('0x7')]=function(_0x56d7b2,_0x5563a8){return _0x56d7b2[_0xc76c('0x8')](_0xc76c('0x9'),attributes,{'tableName':_0xc76c('0xa'),'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 22d1898..efa5374 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 _0x9b5a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','catch','ShowWhatsappQueue','find','stringify','lodash','util'];(function(_0x425ed1,_0x34856f){var _0x151d21=function(_0x463387){while(--_0x463387){_0x425ed1['push'](_0x425ed1['shift']());}};_0x151d21(++_0x34856f);}(_0x9b5a,0x1de));var _0xa9b5=function(_0x1be231,_0x17ee4b){_0x1be231=_0x1be231-0x0;var _0x5309ff=_0x9b5a[_0x1be231];return _0x5309ff;};'use strict';var _=require(_0xa9b5('0x0'));var util=require(_0xa9b5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa9b5('0x2'));var fs=require('fs');var Redis=require(_0xa9b5('0x3'));var db=require(_0xa9b5('0x4'))['db'];var utils=require(_0xa9b5('0x5'));var logger=require('../../config/logger')(_0xa9b5('0x6'));var config=require(_0xa9b5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa9b5('0x8')][_0xa9b5('0x9')]({'port':0x232a});config[_0xa9b5('0xa')]=_[_0xa9b5('0xb')](config[_0xa9b5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa9b5('0xc'))(new Redis(config['redis']));require(_0xa9b5('0xd'))[_0xa9b5('0xe')](socket);function respondWithRpcPromise(_0x571768,_0x57603e,_0x362935){return new BPromise(function(_0x56fdcd,_0x4686c2){return client[_0xa9b5('0xf')](_0x571768,_0x362935)[_0xa9b5('0x10')](function(_0x53a1e9){logger[_0xa9b5('0x11')](_0xa9b5('0x12'),_0x57603e,_0xa9b5('0x13'));logger[_0xa9b5('0x14')](_0xa9b5('0x15'),_0x57603e,_0xa9b5('0x13'),JSON['stringify'](_0x53a1e9));if(_0x53a1e9[_0xa9b5('0x16')]){if(_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x17')]===0x1f4){logger[_0xa9b5('0x16')](_0xa9b5('0x12'),_0x57603e,_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x18')]);return _0x4686c2(_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x18')]);}logger[_0xa9b5('0x16')](_0xa9b5('0x12'),_0x57603e,_0x53a1e9[_0xa9b5('0x16')]['message']);return _0x56fdcd(_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x18')]);}else{logger['info'](_0xa9b5('0x12'),_0x57603e,_0xa9b5('0x13'));_0x56fdcd(_0x53a1e9[_0xa9b5('0x19')][_0xa9b5('0x18')]);}})['catch'](function(_0x44d40d){logger[_0xa9b5('0x16')](_0xa9b5('0x12'),_0x57603e,_0x44d40d);_0x4686c2(_0x44d40d);});});}exports[_0xa9b5('0x1a')]=function(_0xacfbc1){var _0x235f4a=this;return new Promise(function(_0x55268c,_0x12d914){return db[_0xa9b5('0x1b')]['findAll']({'raw':_0xacfbc1['options']?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x1d')]===undefined?!![]:![]:!![],'where':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x1e')]||null:null,'attributes':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x1f')]||null:null,'limit':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x20')]||null:null,'include':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1['options'][_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0xacfbc1['options'][_0xa9b5('0x21')],function(_0x5ed93f){return{'model':db[_0x5ed93f['model']],'as':_0x5ed93f['as'],'attributes':_0x5ed93f[_0xa9b5('0x1f')],'include':_0x5ed93f[_0xa9b5('0x21')]?_['map'](_0x5ed93f['include'],function(_0x4e38d9){return{'model':db[_0x4e38d9[_0xa9b5('0x23')]],'as':_0x4e38d9['as'],'attributes':_0x4e38d9[_0xa9b5('0x1f')],'include':_0x4e38d9[_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x4e38d9[_0xa9b5('0x21')],function(_0x70aa31){return{'model':db[_0x70aa31[_0xa9b5('0x23')]],'as':_0x70aa31['as'],'attributes':_0x70aa31[_0xa9b5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bb1d3){logger[_0xa9b5('0x11')](_0xa9b5('0x1a'),_0xacfbc1);logger['debug'](_0xa9b5('0x1a'),_0xacfbc1,JSON['stringify'](_0x2bb1d3));_0x55268c(_0x2bb1d3);})[_0xa9b5('0x24')](function(_0x2a8b9c){logger[_0xa9b5('0x16')]('GetWhatsappQueue',_0x2a8b9c[_0xa9b5('0x18')],_0xacfbc1);_0x12d914(_0x235f4a[_0xa9b5('0x16')](0x1f4,_0x2a8b9c['message']));});});};exports[_0xa9b5('0x25')]=function(_0x200afe){var _0x502eb7=this;return new Promise(function(_0xccf62,_0x5cbe80){return db['WhatsappQueue'][_0xa9b5('0x26')]({'raw':_0x200afe[_0xa9b5('0x1c')]?_0x200afe[_0xa9b5('0x1c')][_0xa9b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x200afe[_0xa9b5('0x1c')]?_0x200afe[_0xa9b5('0x1c')]['where']||null:null,'attributes':_0x200afe[_0xa9b5('0x1c')]?_0x200afe['options'][_0xa9b5('0x1f')]||null:null,'include':_0x200afe['options']?_0x200afe[_0xa9b5('0x1c')][_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x200afe[_0xa9b5('0x1c')]['include'],function(_0x16d223){return{'model':db[_0x16d223['model']],'as':_0x16d223['as'],'attributes':_0x16d223['attributes'],'include':_0x16d223[_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x16d223[_0xa9b5('0x21')],function(_0x426ba7){return{'model':db[_0x426ba7[_0xa9b5('0x23')]],'as':_0x426ba7['as'],'attributes':_0x426ba7[_0xa9b5('0x1f')],'include':_0x426ba7[_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x426ba7[_0xa9b5('0x21')],function(_0x76aae7){return{'model':db[_0x76aae7[_0xa9b5('0x23')]],'as':_0x76aae7['as'],'attributes':_0x76aae7[_0xa9b5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa9b5('0x10')](function(_0x1c41eb){logger[_0xa9b5('0x11')]('ShowWhatsappQueue',_0x200afe);logger[_0xa9b5('0x14')](_0xa9b5('0x25'),_0x200afe,JSON[_0xa9b5('0x27')](_0x1c41eb));_0xccf62(_0x1c41eb);})[_0xa9b5('0x24')](function(_0xe492f8){logger[_0xa9b5('0x16')](_0xa9b5('0x25'),_0xe492f8[_0xa9b5('0x18')],_0x200afe);_0x5cbe80(_0x502eb7['error'](0x1f4,_0xe492f8['message']));});});}; \ No newline at end of file +var _0x458f=['jayson/promise','http','redis','defaults','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','model','map','ShowWhatsappQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4a0ba6,_0x1c1502){var _0x121ac0=function(_0x558076){while(--_0x558076){_0x4a0ba6['push'](_0x4a0ba6['shift']());}};_0x121ac0(++_0x1c1502);}(_0x458f,0x1b5));var _0xf458=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x458f[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf458('0x0'));var util=require(_0xf458('0x1'));var moment=require(_0xf458('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf458('0x3'));var db=require(_0xf458('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf458('0x5'))(_0xf458('0x6'));var config=require('../../config/environment');var jayson=require(_0xf458('0x7'));var client=jayson['client'][_0xf458('0x8')]({'port':0x232a});config[_0xf458('0x9')]=_[_0xf458('0xa')](config[_0xf458('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf458('0xb'))[_0xf458('0xc')](socket);function respondWithRpcPromise(_0x3c4a0a,_0x2a295f,_0x3f9711){return new BPromise(function(_0x12fe07,_0x2e48d5){return client[_0xf458('0xd')](_0x3c4a0a,_0x3f9711)[_0xf458('0xe')](function(_0x4b3f49){logger[_0xf458('0xf')](_0xf458('0x10'),_0x2a295f,_0xf458('0x11'));logger[_0xf458('0x12')](_0xf458('0x13'),_0x2a295f,_0xf458('0x11'),JSON[_0xf458('0x14')](_0x4b3f49));if(_0x4b3f49['error']){if(_0x4b3f49['error'][_0xf458('0x15')]===0x1f4){logger[_0xf458('0x16')](_0xf458('0x10'),_0x2a295f,_0x4b3f49[_0xf458('0x16')]['message']);return _0x2e48d5(_0x4b3f49['error'][_0xf458('0x17')]);}logger[_0xf458('0x16')](_0xf458('0x10'),_0x2a295f,_0x4b3f49['error']['message']);return _0x12fe07(_0x4b3f49[_0xf458('0x16')]['message']);}else{logger['info'](_0xf458('0x10'),_0x2a295f,_0xf458('0x11'));_0x12fe07(_0x4b3f49['result'][_0xf458('0x17')]);}})[_0xf458('0x18')](function(_0x443517){logger[_0xf458('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x2a295f,_0x443517);_0x2e48d5(_0x443517);});});}exports[_0xf458('0x19')]=function(_0x52ef7d){var _0x4797c9=this;return new Promise(function(_0x418c88,_0x5a2b3e){return db[_0xf458('0x1a')][_0xf458('0x1b')]({'raw':_0x52ef7d[_0xf458('0x1c')]?_0x52ef7d[_0xf458('0x1c')][_0xf458('0x1d')]===undefined?!![]:![]:!![],'where':_0x52ef7d[_0xf458('0x1c')]?_0x52ef7d[_0xf458('0x1c')][_0xf458('0x1e')]||null:null,'attributes':_0x52ef7d[_0xf458('0x1c')]?_0x52ef7d[_0xf458('0x1c')][_0xf458('0x1f')]||null:null,'limit':_0x52ef7d[_0xf458('0x1c')]?_0x52ef7d[_0xf458('0x1c')]['limit']||null:null,'include':_0x52ef7d['options']?_0x52ef7d[_0xf458('0x1c')][_0xf458('0x20')]?_['map'](_0x52ef7d[_0xf458('0x1c')][_0xf458('0x20')],function(_0x3423c1){return{'model':db[_0x3423c1[_0xf458('0x21')]],'as':_0x3423c1['as'],'attributes':_0x3423c1[_0xf458('0x1f')],'include':_0x3423c1[_0xf458('0x20')]?_[_0xf458('0x22')](_0x3423c1[_0xf458('0x20')],function(_0x297108){return{'model':db[_0x297108[_0xf458('0x21')]],'as':_0x297108['as'],'attributes':_0x297108[_0xf458('0x1f')],'include':_0x297108['include']?_['map'](_0x297108['include'],function(_0x2b6d36){return{'model':db[_0x2b6d36[_0xf458('0x21')]],'as':_0x2b6d36['as'],'attributes':_0x2b6d36['attributes']};}):[]};}):[]};}):[]:[]})[_0xf458('0xe')](function(_0x355c0b){logger[_0xf458('0xf')]('GetWhatsappQueue',_0x52ef7d);logger[_0xf458('0x12')](_0xf458('0x19'),_0x52ef7d,JSON[_0xf458('0x14')](_0x355c0b));_0x418c88(_0x355c0b);})[_0xf458('0x18')](function(_0x55d732){logger[_0xf458('0x16')](_0xf458('0x19'),_0x55d732['message'],_0x52ef7d);_0x5a2b3e(_0x4797c9[_0xf458('0x16')](0x1f4,_0x55d732['message']));});});};exports[_0xf458('0x23')]=function(_0x45fcb9){var _0x2b1082=this;return new Promise(function(_0x495b51,_0x2f6fe3){return db['WhatsappQueue'][_0xf458('0x24')]({'raw':_0x45fcb9[_0xf458('0x1c')]?_0x45fcb9[_0xf458('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x45fcb9[_0xf458('0x1c')]?_0x45fcb9[_0xf458('0x1c')]['where']||null:null,'attributes':_0x45fcb9[_0xf458('0x1c')]?_0x45fcb9[_0xf458('0x1c')]['attributes']||null:null,'include':_0x45fcb9[_0xf458('0x1c')]?_0x45fcb9['options'][_0xf458('0x20')]?_['map'](_0x45fcb9['options']['include'],function(_0x4e1f2a){return{'model':db[_0x4e1f2a[_0xf458('0x21')]],'as':_0x4e1f2a['as'],'attributes':_0x4e1f2a[_0xf458('0x1f')],'include':_0x4e1f2a[_0xf458('0x20')]?_[_0xf458('0x22')](_0x4e1f2a[_0xf458('0x20')],function(_0x4409d8){return{'model':db[_0x4409d8['model']],'as':_0x4409d8['as'],'attributes':_0x4409d8[_0xf458('0x1f')],'include':_0x4409d8[_0xf458('0x20')]?_[_0xf458('0x22')](_0x4409d8[_0xf458('0x20')],function(_0x1dc088){return{'model':db[_0x1dc088[_0xf458('0x21')]],'as':_0x1dc088['as'],'attributes':_0x1dc088['attributes']};}):[]};}):[]};}):[]:[]})[_0xf458('0xe')](function(_0xb018aa){logger[_0xf458('0xf')](_0xf458('0x23'),_0x45fcb9);logger['debug'](_0xf458('0x23'),_0x45fcb9,JSON[_0xf458('0x14')](_0xb018aa));_0x495b51(_0xb018aa);})[_0xf458('0x18')](function(_0x3cdfb0){logger[_0xf458('0x16')](_0xf458('0x23'),_0x3cdfb0[_0xf458('0x17')],_0x45fcb9);_0x2f6fe3(_0x2b1082[_0xf458('0x16')](0x1f4,_0x3cdfb0[_0xf458('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index f48f2b3..5765440 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 _0xbea2=['emit','removeListener','register','./whatsappQueue.events'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xbea2,0x167));var _0x2bea=function(_0x464cca,_0x2dc048){_0x464cca=_0x464cca-0x0;var _0x3ffc68=_0xbea2[_0x464cca];return _0x3ffc68;};'use strict';var WhatsappQueueEvents=require(_0x2bea('0x0'));var events=['save','remove','update'];function createListener(_0x486f62,_0x44adf9){return function(_0x8f0d86){_0x44adf9[_0x2bea('0x1')](_0x486f62,_0x8f0d86);};}function removeListener(_0x13d813,_0x393628){return function(){WhatsappQueueEvents[_0x2bea('0x2')](_0x13d813,_0x393628);};}exports[_0x2bea('0x3')]=function(_0x5385ac){for(var _0x4a4571=0x0,_0x2acb8d=events['length'];_0x4a4571<_0x2acb8d;_0x4a4571++){var _0x21cb81=events[_0x4a4571];var _0x50d38b=createListener('whatsappQueue:'+_0x21cb81,_0x5385ac);WhatsappQueueEvents['on'](_0x21cb81,_0x50d38b);}}; \ No newline at end of file +var _0xc4ff=['save','remove','update','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4ff,0x101));var _0xfc4f=function(_0x378425,_0x168b59){_0x378425=_0x378425-0x0;var _0x3ea212=_0xc4ff[_0x378425];return _0x3ea212;};'use strict';var WhatsappQueueEvents=require(_0xfc4f('0x0'));var events=[_0xfc4f('0x1'),_0xfc4f('0x2'),_0xfc4f('0x3')];function createListener(_0x41d7bb,_0x1284f2){return function(_0x5aac26){_0x1284f2['emit'](_0x41d7bb,_0x5aac26);};}function removeListener(_0x3ca904,_0x2c7451){return function(){WhatsappQueueEvents['removeListener'](_0x3ca904,_0x2c7451);};}exports['register']=function(_0x8b8666){for(var _0x1d87e5=0x0,_0x40a19a=events[_0xfc4f('0x4')];_0x1d87e5<_0x40a19a;_0x1d87e5++){var _0xb69ac4=events[_0x1d87e5];var _0x457fbf=createListener(_0xfc4f('0x5')+_0xb69ac4,_0x8b8666);WhatsappQueueEvents['on'](_0xb69ac4,_0x457fbf);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 38eede6..48a8f4b 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 _0x0596=['isAuthenticated','index','/describe','show','post','put','update','delete','/:id','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get'];(function(_0xed26d8,_0x47de0e){var _0x5d3166=function(_0x1c05cb){while(--_0x1c05cb){_0xed26d8['push'](_0xed26d8['shift']());}};_0x5d3166(++_0x47de0e);}(_0x0596,0x171));var _0x6059=function(_0x352c35,_0x4d8372){_0x352c35=_0x352c35-0x0;var _0x3bfb40=_0x0596[_0x352c35];return _0x3bfb40;};'use strict';var multer=require('multer');var util=require(_0x6059('0x0'));var path=require(_0x6059('0x1'));var timeout=require(_0x6059('0x2'));var express=require(_0x6059('0x3'));var router=express[_0x6059('0x4')]();var fs_extra=require(_0x6059('0x5'));var auth=require(_0x6059('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6059('0x7'));router[_0x6059('0x8')]('/',auth[_0x6059('0x9')](),controller[_0x6059('0xa')]);router[_0x6059('0x8')](_0x6059('0xb'),auth[_0x6059('0x9')](),controller['describe']);router[_0x6059('0x8')]('/:id',auth[_0x6059('0x9')](),controller[_0x6059('0xc')]);router[_0x6059('0xd')]('/',auth[_0x6059('0x9')](),controller['create']);router[_0x6059('0xe')]('/:id',auth[_0x6059('0x9')](),controller[_0x6059('0xf')]);router[_0x6059('0x10')](_0x6059('0x11'),auth[_0x6059('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf6ba=['/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x597980,_0x2722d9){var _0x5957cf=function(_0x4228a1){while(--_0x4228a1){_0x597980['push'](_0x597980['shift']());}};_0x5957cf(++_0x2722d9);}(_0xf6ba,0x135));var _0xaf6b=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xf6ba[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0xaf6b('0x0'));var util=require(_0xaf6b('0x1'));var path=require(_0xaf6b('0x2'));var timeout=require(_0xaf6b('0x3'));var express=require(_0xaf6b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf6b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf6b('0x6'));var controller=require(_0xaf6b('0x7'));router[_0xaf6b('0x8')]('/',auth[_0xaf6b('0x9')](),controller[_0xaf6b('0xa')]);router['get'](_0xaf6b('0xb'),auth[_0xaf6b('0x9')](),controller['describe']);router[_0xaf6b('0x8')](_0xaf6b('0xc'),auth['isAuthenticated'](),controller[_0xaf6b('0xd')]);router[_0xaf6b('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf6b('0xf')]);router[_0xaf6b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xaf6b('0x11')]);router[_0xaf6b('0x12')](_0xaf6b('0xc'),auth[_0xaf6b('0x9')](),controller['destroy']);module[_0xaf6b('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 65148ea..96fa396 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(_0x57e837,_0x1a512a){var _0x26672f=function(_0x23a1f2){while(--_0x23a1f2){_0x57e837['push'](_0x57e837['shift']());}};_0x26672f(++_0x1a512a);}(_0x7a54,0x106));var _0x47a5=function(_0x4c23bb,_0x9d3592){_0x4c23bb=_0x4c23bb-0x0;var _0x1767e5=_0x7a54[_0x4c23bb];return _0x1767e5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x12510d,_0x57e377){var _0x55cef2=function(_0x527e9c){while(--_0x527e9c){_0x12510d['push'](_0x12510d['shift']());}};_0x55cef2(++_0x57e377);}(_0x7a54,0x106));var _0x47a5=function(_0xe53a9b,_0x4c9478){_0xe53a9b=_0xe53a9b-0x0;var _0xc32071=_0x7a54[_0xe53a9b];return _0xc32071;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 58fa1ce..7419c69 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 _0x7d25=['mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','includeAll','include','rows','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x55978d,_0x25876c){var _0xe02814=function(_0x1bea18){while(--_0x1bea18){_0x55978d['push'](_0x55978d['shift']());}};_0xe02814(++_0x25876c);}(_0x7d25,0x8a));var _0x57d2=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7d25[_0x45783c];return _0x1161da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];function respondWithStatusCode(_0x43d7fb,_0x32c33a){_0x32c33a=_0x32c33a||0xcc;return function(_0x28428b){if(_0x28428b){return _0x43d7fb[_0x57d2('0x17')](_0x32c33a);}return _0x43d7fb[_0x57d2('0x18')](_0x32c33a)[_0x57d2('0x19')]();};}function respondWithResult(_0x1ba57e,_0x4086f3){_0x4086f3=_0x4086f3||0xc8;return function(_0x5382d9){if(_0x5382d9){return _0x1ba57e['status'](_0x4086f3)[_0x57d2('0x1a')](_0x5382d9);}};}function respondWithFilteredResult(_0x148ef3,_0x4ec4b1){return function(_0x8cf637){if(_0x8cf637){var _0x319489=typeof _0x4ec4b1['offset']===_0x57d2('0x1b')&&typeof _0x4ec4b1['limit']===_0x57d2('0x1b');var _0x4b4fe0=_0x8cf637[_0x57d2('0x1c')];var _0x7d4cf1=_0x319489?0x0:_0x4ec4b1[_0x57d2('0x1d')];var _0x4a94e3=_0x319489?_0x8cf637['count']:_0x4ec4b1[_0x57d2('0x1d')]+_0x4ec4b1[_0x57d2('0x1e')];var _0x2662cd;if(_0x4a94e3>=_0x4b4fe0){_0x4a94e3=_0x4b4fe0;_0x2662cd=0xc8;}else{_0x2662cd=0xce;}_0x148ef3[_0x57d2('0x18')](_0x2662cd);return _0x148ef3['set'](_0x57d2('0x1f'),_0x7d4cf1+'-'+_0x4a94e3+'/'+_0x4b4fe0)[_0x57d2('0x1a')](_0x8cf637);}return null;};}function patchUpdates(_0x55191e){return function(_0x5f3fd5){try{jsonpatch[_0x57d2('0x20')](_0x5f3fd5,_0x55191e,!![]);}catch(_0x326d49){return BPromise[_0x57d2('0x21')](_0x326d49);}return _0x5f3fd5[_0x57d2('0x22')]();};}function saveUpdates(_0x386196,_0x803c25){return function(_0x32c7c8){if(_0x32c7c8){return _0x32c7c8[_0x57d2('0x23')](_0x386196)[_0x57d2('0x24')](function(_0x26718e){return _0x26718e;});}return null;};}function removeEntity(_0x46a4d1,_0x456fe1){return function(_0x12ff19){if(_0x12ff19){return _0x12ff19[_0x57d2('0x25')]()['then'](function(){_0x46a4d1[_0x57d2('0x18')](0xcc)[_0x57d2('0x19')]();});}};}function handleEntityNotFound(_0x3c7de8,_0x452d5e){return function(_0x4363b3){if(!_0x4363b3){_0x3c7de8['sendStatus'](0x194);}return _0x4363b3;};}function handleError(_0x1d203c,_0x608b10){_0x608b10=_0x608b10||0x1f4;return function(_0x995928){logger[_0x57d2('0x26')](_0x995928[_0x57d2('0x27')]);if(_0x995928[_0x57d2('0x28')]){delete _0x995928[_0x57d2('0x28')];}_0x1d203c['status'](_0x608b10)[_0x57d2('0x29')](_0x995928);};}exports[_0x57d2('0x2a')]=function(_0x277426,_0x1fe383){var _0x1957a6={},_0x7c33f3={},_0x1dd6cb={'count':0x0,'rows':[]};var _0x1d3a3a=_[_0x57d2('0x2b')](db[_0x57d2('0x2c')]['rawAttributes'],function(_0x4e9178){return{'name':_0x4e9178[_0x57d2('0x2d')],'type':_0x4e9178[_0x57d2('0x2e')][_0x57d2('0x2f')]};});_0x7c33f3['model']=_[_0x57d2('0x2b')](_0x1d3a3a,_0x57d2('0x28'));_0x7c33f3[_0x57d2('0x30')]=_[_0x57d2('0x31')](_0x277426[_0x57d2('0x30')]);_0x7c33f3[_0x57d2('0x32')]=_[_0x57d2('0x33')](_0x7c33f3[_0x57d2('0x34')],_0x7c33f3[_0x57d2('0x30')]);_0x1957a6['attributes']=_[_0x57d2('0x33')](_0x7c33f3[_0x57d2('0x34')],qs['fields'](_0x277426[_0x57d2('0x30')][_0x57d2('0x35')]));_0x1957a6['attributes']=_0x1957a6[_0x57d2('0x36')][_0x57d2('0x37')]?_0x1957a6[_0x57d2('0x36')]:_0x7c33f3[_0x57d2('0x34')];if(!_0x277426[_0x57d2('0x30')]['hasOwnProperty']('nolimit')){_0x1957a6['limit']=qs['limit'](_0x277426[_0x57d2('0x30')][_0x57d2('0x1e')]);_0x1957a6[_0x57d2('0x1d')]=qs[_0x57d2('0x1d')](_0x277426[_0x57d2('0x30')]['offset']);}_0x1957a6[_0x57d2('0x38')]=qs['sort'](_0x277426[_0x57d2('0x30')][_0x57d2('0x39')]);_0x1957a6[_0x57d2('0x3a')]=qs['filters'](_[_0x57d2('0x3b')](_0x277426[_0x57d2('0x30')],_0x7c33f3['filters']),_0x1d3a3a);if(_0x277426[_0x57d2('0x30')][_0x57d2('0x3c')]){_0x1957a6[_0x57d2('0x3a')]=_[_0x57d2('0x3d')](_0x1957a6[_0x57d2('0x3a')],{'$or':_[_0x57d2('0x2b')](_0x1d3a3a,function(_0x47f379){if(_0x47f379[_0x57d2('0x2e')]!=='VIRTUAL'){var _0x1d3303={};_0x1d3303[_0x47f379[_0x57d2('0x28')]]={'$like':'%'+_0x277426[_0x57d2('0x30')][_0x57d2('0x3c')]+'%'};return _0x1d3303;}})});}_0x1957a6=_[_0x57d2('0x3d')]({},_0x1957a6,_0x277426['options']);var _0x282e6e={'where':_0x1957a6[_0x57d2('0x3a')]};return db['WhatsappQueueReport'][_0x57d2('0x1c')](_0x282e6e)[_0x57d2('0x24')](function(_0x1713bc){_0x1dd6cb['count']=_0x1713bc;if(_0x277426[_0x57d2('0x30')][_0x57d2('0x3e')]){_0x1957a6[_0x57d2('0x3f')]=[{'all':!![]}];}return db[_0x57d2('0x2c')]['findAll'](_0x1957a6);})['then'](function(_0x11a2ec){_0x1dd6cb[_0x57d2('0x40')]=_0x11a2ec;return _0x1dd6cb;})[_0x57d2('0x24')](respondWithFilteredResult(_0x1fe383,_0x1957a6))['catch'](handleError(_0x1fe383,null));};exports['show']=function(_0xebeac5,_0x5116b5){var _0xe42c98={'raw':!![],'where':{'id':_0xebeac5[_0x57d2('0x41')]['id']}},_0x1bb8ad={};_0x1bb8ad[_0x57d2('0x34')]=_[_0x57d2('0x31')](db['WhatsappQueueReport'][_0x57d2('0x42')]);_0x1bb8ad[_0x57d2('0x30')]=_['keys'](_0xebeac5[_0x57d2('0x30')]);_0x1bb8ad['filters']=_[_0x57d2('0x33')](_0x1bb8ad[_0x57d2('0x34')],_0x1bb8ad[_0x57d2('0x30')]);_0xe42c98[_0x57d2('0x36')]=_['intersection'](_0x1bb8ad['model'],qs[_0x57d2('0x35')](_0xebeac5['query']['fields']));_0xe42c98[_0x57d2('0x36')]=_0xe42c98['attributes']['length']?_0xe42c98[_0x57d2('0x36')]:_0x1bb8ad['model'];if(_0xebeac5[_0x57d2('0x30')]['includeAll']){_0xe42c98[_0x57d2('0x3f')]=[{'all':!![]}];}_0xe42c98=_['merge']({},_0xe42c98,_0xebeac5['options']);return db[_0x57d2('0x2c')][_0x57d2('0x43')](_0xe42c98)[_0x57d2('0x24')](handleEntityNotFound(_0x5116b5,null))[_0x57d2('0x24')](respondWithResult(_0x5116b5,null))[_0x57d2('0x44')](handleError(_0x5116b5,null));};exports[_0x57d2('0x45')]=function(_0x4c88dd,_0x4541b2){return db[_0x57d2('0x2c')][_0x57d2('0x45')](_0x4c88dd[_0x57d2('0x46')],{})[_0x57d2('0x24')](respondWithResult(_0x4541b2,0xc9))[_0x57d2('0x44')](handleError(_0x4541b2,null));};exports[_0x57d2('0x23')]=function(_0x406375,_0x51f172){if(_0x406375[_0x57d2('0x46')]['id']){delete _0x406375[_0x57d2('0x46')]['id'];}return db['WhatsappQueueReport'][_0x57d2('0x43')]({'where':{'id':_0x406375['params']['id']}})['then'](handleEntityNotFound(_0x51f172,null))[_0x57d2('0x24')](saveUpdates(_0x406375[_0x57d2('0x46')],null))[_0x57d2('0x24')](respondWithResult(_0x51f172,null))[_0x57d2('0x44')](handleError(_0x51f172,null));};exports['destroy']=function(_0x265d24,_0x176e24){return db['WhatsappQueueReport']['find']({'where':{'id':_0x265d24[_0x57d2('0x41')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x176e24,null))[_0x57d2('0x24')](removeEntity(_0x176e24,null))[_0x57d2('0x44')](handleError(_0x176e24,null));};exports[_0x57d2('0x47')]=function(_0x396220,_0x5a3e86){return db['WhatsappQueueReport']['describe']()[_0x57d2('0x24')](respondWithResult(_0x5a3e86,null))['catch'](handleError(_0x5a3e86,null));}; \ No newline at end of file +var _0x84a0=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','name','map','WhatsappQueueReport'];(function(_0x5e7eb4,_0x2a66f5){var _0x46143a=function(_0x27bdb0){while(--_0x27bdb0){_0x5e7eb4['push'](_0x5e7eb4['shift']());}};_0x46143a(++_0x2a66f5);}(_0x84a0,0x66));var _0x084a=function(_0x2fbb21,_0x1f3785){_0x2fbb21=_0x2fbb21-0x0;var _0x1caa91=_0x84a0[_0x2fbb21];return _0x1caa91;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];function respondWithStatusCode(_0x3ca72f,_0xec90a5){_0xec90a5=_0xec90a5||0xcc;return function(_0x9245b1){if(_0x9245b1){return _0x3ca72f[_0x084a('0x18')](_0xec90a5);}return _0x3ca72f[_0x084a('0x19')](_0xec90a5)[_0x084a('0x1a')]();};}function respondWithResult(_0x3a76d1,_0x5aef40){_0x5aef40=_0x5aef40||0xc8;return function(_0x4277c9){if(_0x4277c9){return _0x3a76d1['status'](_0x5aef40)[_0x084a('0x1b')](_0x4277c9);}};}function respondWithFilteredResult(_0x3ccaca,_0x366624){return function(_0x2d35b8){if(_0x2d35b8){var _0xd20527=typeof _0x366624['offset']===_0x084a('0x1c')&&typeof _0x366624['limit']===_0x084a('0x1c');var _0x355b45=_0x2d35b8['count'];var _0xf2c333=_0xd20527?0x0:_0x366624[_0x084a('0x1d')];var _0x4134b9=_0xd20527?_0x2d35b8[_0x084a('0x1e')]:_0x366624[_0x084a('0x1d')]+_0x366624[_0x084a('0x1f')];var _0x447a19;if(_0x4134b9>=_0x355b45){_0x4134b9=_0x355b45;_0x447a19=0xc8;}else{_0x447a19=0xce;}_0x3ccaca[_0x084a('0x19')](_0x447a19);return _0x3ccaca[_0x084a('0x20')](_0x084a('0x21'),_0xf2c333+'-'+_0x4134b9+'/'+_0x355b45)[_0x084a('0x1b')](_0x2d35b8);}return null;};}function patchUpdates(_0x279e25){return function(_0x116328){try{jsonpatch[_0x084a('0x22')](_0x116328,_0x279e25,!![]);}catch(_0xf0dd98){return BPromise['reject'](_0xf0dd98);}return _0x116328[_0x084a('0x23')]();};}function saveUpdates(_0x1ad257,_0x41a90f){return function(_0x2d62bf){if(_0x2d62bf){return _0x2d62bf[_0x084a('0x24')](_0x1ad257)['then'](function(_0x755c24){return _0x755c24;});}return null;};}function removeEntity(_0x288e9e,_0x6346a5){return function(_0x1f2c9f){if(_0x1f2c9f){return _0x1f2c9f[_0x084a('0x25')]()[_0x084a('0x26')](function(){_0x288e9e['status'](0xcc)[_0x084a('0x1a')]();});}};}function handleEntityNotFound(_0x2af138,_0x54233b){return function(_0x5b1474){if(!_0x5b1474){_0x2af138[_0x084a('0x18')](0x194);}return _0x5b1474;};}function handleError(_0x3dd8b9,_0xfc9b8c){_0xfc9b8c=_0xfc9b8c||0x1f4;return function(_0x4c5658){logger['error'](_0x4c5658['stack']);if(_0x4c5658['name']){delete _0x4c5658[_0x084a('0x27')];}_0x3dd8b9['status'](_0xfc9b8c)['send'](_0x4c5658);};}exports['index']=function(_0x3b8176,_0x4651e6){var _0x388062={},_0x2c4149={},_0x3be7a6={'count':0x0,'rows':[]};var _0x25a2a1=_[_0x084a('0x28')](db[_0x084a('0x29')]['rawAttributes'],function(_0x2ed3cd){return{'name':_0x2ed3cd[_0x084a('0x2a')],'type':_0x2ed3cd['type'][_0x084a('0x2b')]};});_0x2c4149[_0x084a('0x2c')]=_[_0x084a('0x28')](_0x25a2a1,_0x084a('0x27'));_0x2c4149[_0x084a('0x2d')]=_[_0x084a('0x2e')](_0x3b8176[_0x084a('0x2d')]);_0x2c4149[_0x084a('0x2f')]=_[_0x084a('0x30')](_0x2c4149[_0x084a('0x2c')],_0x2c4149[_0x084a('0x2d')]);_0x388062[_0x084a('0x31')]=_[_0x084a('0x30')](_0x2c4149['model'],qs['fields'](_0x3b8176[_0x084a('0x2d')][_0x084a('0x32')]));_0x388062[_0x084a('0x31')]=_0x388062[_0x084a('0x31')][_0x084a('0x33')]?_0x388062['attributes']:_0x2c4149[_0x084a('0x2c')];if(!_0x3b8176[_0x084a('0x2d')][_0x084a('0x34')]('nolimit')){_0x388062[_0x084a('0x1f')]=qs[_0x084a('0x1f')](_0x3b8176[_0x084a('0x2d')]['limit']);_0x388062['offset']=qs['offset'](_0x3b8176[_0x084a('0x2d')][_0x084a('0x1d')]);}_0x388062[_0x084a('0x35')]=qs['sort'](_0x3b8176[_0x084a('0x2d')][_0x084a('0x36')]);_0x388062[_0x084a('0x37')]=qs[_0x084a('0x2f')](_[_0x084a('0x38')](_0x3b8176[_0x084a('0x2d')],_0x2c4149[_0x084a('0x2f')]),_0x25a2a1);if(_0x3b8176[_0x084a('0x2d')][_0x084a('0x39')]){_0x388062[_0x084a('0x37')]=_[_0x084a('0x3a')](_0x388062[_0x084a('0x37')],{'$or':_[_0x084a('0x28')](_0x25a2a1,function(_0x1659d3){if(_0x1659d3[_0x084a('0x3b')]!=='VIRTUAL'){var _0x220f88={};_0x220f88[_0x1659d3[_0x084a('0x27')]]={'$like':'%'+_0x3b8176[_0x084a('0x2d')][_0x084a('0x39')]+'%'};return _0x220f88;}})});}_0x388062=_[_0x084a('0x3a')]({},_0x388062,_0x3b8176[_0x084a('0x3c')]);var _0xa7b652={'where':_0x388062[_0x084a('0x37')]};return db[_0x084a('0x29')]['count'](_0xa7b652)[_0x084a('0x26')](function(_0x3d1aa5){_0x3be7a6[_0x084a('0x1e')]=_0x3d1aa5;if(_0x3b8176[_0x084a('0x2d')][_0x084a('0x3d')]){_0x388062[_0x084a('0x3e')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x084a('0x3f')](_0x388062);})[_0x084a('0x26')](function(_0x55c5f4){_0x3be7a6[_0x084a('0x40')]=_0x55c5f4;return _0x3be7a6;})[_0x084a('0x26')](respondWithFilteredResult(_0x4651e6,_0x388062))[_0x084a('0x41')](handleError(_0x4651e6,null));};exports['show']=function(_0x1aa4ea,_0xba1081){var _0x4fe9c2={'raw':!![],'where':{'id':_0x1aa4ea[_0x084a('0x42')]['id']}},_0x3e2b92={};_0x3e2b92['model']=_['keys'](db[_0x084a('0x29')][_0x084a('0x43')]);_0x3e2b92[_0x084a('0x2d')]=_[_0x084a('0x2e')](_0x1aa4ea[_0x084a('0x2d')]);_0x3e2b92[_0x084a('0x2f')]=_[_0x084a('0x30')](_0x3e2b92[_0x084a('0x2c')],_0x3e2b92[_0x084a('0x2d')]);_0x4fe9c2[_0x084a('0x31')]=_[_0x084a('0x30')](_0x3e2b92['model'],qs['fields'](_0x1aa4ea[_0x084a('0x2d')][_0x084a('0x32')]));_0x4fe9c2[_0x084a('0x31')]=_0x4fe9c2['attributes'][_0x084a('0x33')]?_0x4fe9c2[_0x084a('0x31')]:_0x3e2b92[_0x084a('0x2c')];if(_0x1aa4ea[_0x084a('0x2d')][_0x084a('0x3d')]){_0x4fe9c2['include']=[{'all':!![]}];}_0x4fe9c2=_[_0x084a('0x3a')]({},_0x4fe9c2,_0x1aa4ea['options']);return db[_0x084a('0x29')][_0x084a('0x44')](_0x4fe9c2)[_0x084a('0x26')](handleEntityNotFound(_0xba1081,null))['then'](respondWithResult(_0xba1081,null))['catch'](handleError(_0xba1081,null));};exports[_0x084a('0x45')]=function(_0xef8fc7,_0x505965){return db[_0x084a('0x29')][_0x084a('0x45')](_0xef8fc7[_0x084a('0x46')],{})[_0x084a('0x26')](respondWithResult(_0x505965,0xc9))['catch'](handleError(_0x505965,null));};exports[_0x084a('0x24')]=function(_0x865368,_0x31677b){if(_0x865368[_0x084a('0x46')]['id']){delete _0x865368['body']['id'];}return db[_0x084a('0x29')][_0x084a('0x44')]({'where':{'id':_0x865368[_0x084a('0x42')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x31677b,null))['then'](saveUpdates(_0x865368['body'],null))[_0x084a('0x26')](respondWithResult(_0x31677b,null))[_0x084a('0x41')](handleError(_0x31677b,null));};exports[_0x084a('0x25')]=function(_0x264f09,_0xf936e){return db[_0x084a('0x29')][_0x084a('0x44')]({'where':{'id':_0x264f09[_0x084a('0x42')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0xf936e,null))[_0x084a('0x26')](removeEntity(_0xf936e,null))[_0x084a('0x41')](handleError(_0xf936e,null));};exports[_0x084a('0x47')]=function(_0x4fe1b5,_0xcdd5b){return db[_0x084a('0x29')][_0x084a('0x47')]()[_0x084a('0x26')](respondWithResult(_0xcdd5b,null))[_0x084a('0x41')](handleError(_0xcdd5b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index ba6b770..1758cb0 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 _0xd321=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd321,0x12f));var _0x1d32=function(_0x329250,_0x578523){_0x329250=_0x329250-0x0;var _0x194ab2=_0xd321[_0x329250];return _0x194ab2;};'use strict';var _=require(_0x1d32('0x0'));var util=require(_0x1d32('0x1'));var logger=require(_0x1d32('0x2'))(_0x1d32('0x3'));var moment=require(_0x1d32('0x4'));var BPromise=require(_0x1d32('0x5'));var rp=require(_0x1d32('0x6'));var fs=require('fs');var path=require(_0x1d32('0x7'));var rimraf=require(_0x1d32('0x8'));var config=require(_0x1d32('0x9'));var attributes=require(_0x1d32('0xa'));module['exports']=function(_0x492df6,_0x8113b3){return _0x492df6[_0x1d32('0xb')](_0x1d32('0xc'),attributes,{'tableName':_0x1d32('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1d32('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3deb=['exports','define','report_whatsapp_queue','uniqueid','../../config/logger','moment','request-promise','path','rimraf','./whatsappQueueReport.attributes'];(function(_0x313535,_0x458400){var _0x3f915a=function(_0x37147a){while(--_0x37147a){_0x313535['push'](_0x313535['shift']());}};_0x3f915a(++_0x458400);}(_0x3deb,0x1bc));var _0xb3de=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3deb[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb3de('0x0'))('api');var moment=require(_0xb3de('0x1'));var BPromise=require('bluebird');var rp=require(_0xb3de('0x2'));var fs=require('fs');var path=require(_0xb3de('0x3'));var rimraf=require(_0xb3de('0x4'));var config=require('../../config/environment');var attributes=require(_0xb3de('0x5'));module[_0xb3de('0x6')]=function(_0x37f9de,_0x547ee0){return _0x37f9de[_0xb3de('0x7')]('WhatsappQueueReport',attributes,{'tableName':_0xb3de('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb3de('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 3b74fa5..49b7e76 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 _0xc260=['stringify','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x5c84a4,_0x4d6003){var _0x5e53f7=function(_0x4bff1e){while(--_0x4bff1e){_0x5c84a4['push'](_0x5c84a4['shift']());}};_0x5e53f7(++_0x4d6003);}(_0xc260,0x10f));var _0x0c26=function(_0x346e33,_0x3826ec){_0x346e33=_0x346e33-0x0;var _0x316933=_0xc260[_0x346e33];return _0x316933;};'use strict';var _=require(_0x0c26('0x0'));var util=require(_0x0c26('0x1'));var moment=require(_0x0c26('0x2'));var BPromise=require(_0x0c26('0x3'));var rs=require(_0x0c26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c26('0x5'))['db'];var utils=require(_0x0c26('0x6'));var logger=require('../../config/logger')(_0x0c26('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c26('0x8'));var client=jayson['client'][_0x0c26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x249491,_0x284726,_0x14d2a1){return new BPromise(function(_0xd8331e,_0x512054){return client[_0x0c26('0xa')](_0x249491,_0x14d2a1)[_0x0c26('0xb')](function(_0xeb0d29){logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));logger[_0x0c26('0xf')](_0x0c26('0x10'),_0x284726,_0x0c26('0xe'),JSON[_0x0c26('0x11')](_0xeb0d29));if(_0xeb0d29['error']){if(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x13')]===0x1f4){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);return _0x512054(_0xeb0d29[_0x0c26('0x12')]['message']);}logger['error'](_0x0c26('0xd'),_0x284726,_0xeb0d29['error'][_0x0c26('0x14')]);return _0xd8331e(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);}else{logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));_0xd8331e(_0xeb0d29['result'][_0x0c26('0x14')]);}})[_0x0c26('0x15')](function(_0x5e87bf){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0x5e87bf);_0x512054(_0x5e87bf);});});}exports[_0x0c26('0x16')]=function(_0x55fead){var _0x2f37d7=this;return new Promise(function(_0xe29adc,_0x5702dc){return db[_0x0c26('0x17')][_0x0c26('0x18')](_0x55fead[_0x0c26('0x19')],{'raw':_0x55fead['options']?_0x55fead[_0x0c26('0x1a')][_0x0c26('0x1b')]===undefined?!![]:![]:!![]})[_0x0c26('0xb')](function(_0xfff859){logger[_0x0c26('0xc')](_0x0c26('0x16'),_0x55fead);logger['debug']('CreateWhatsappQueueReport',_0x55fead,JSON[_0x0c26('0x11')](_0xfff859));_0xe29adc(_0xfff859);})[_0x0c26('0x15')](function(_0x5af0ca){logger[_0x0c26('0x12')](_0x0c26('0x16'),_0x5af0ca[_0x0c26('0x14')],_0x55fead);_0x5702dc(_0x2f37d7['error'](0x1f4,_0x5af0ca[_0x0c26('0x14')]));});});};exports[_0x0c26('0x1c')]=function(_0x1f3021){var _0x2174e3=this;return new Promise(function(_0x120942,_0x8fb00e){return db[_0x0c26('0x17')]['update'](_0x1f3021[_0x0c26('0x19')],{'raw':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1d')]||null:null,'attributes':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1e')]||null:null,'limit':_0x1f3021['options']?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1f')]||null:null})['then'](function(_0x2c2111){logger[_0x0c26('0xc')](_0x0c26('0x1c'),_0x1f3021);logger['debug'](_0x0c26('0x1c'),_0x1f3021,JSON['stringify'](_0x2c2111));_0x120942(_0x2c2111);})[_0x0c26('0x15')](function(_0x4c90dc){logger[_0x0c26('0x12')]('UpdateWhatsappQueueReport',_0x4c90dc[_0x0c26('0x14')],_0x1f3021);_0x8fb00e(_0x2174e3['error'](0x1f4,_0x4c90dc[_0x0c26('0x14')]));});});}; \ No newline at end of file +var _0xc009=['stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xc009,0xc9));var _0x9c00=function(_0x23f97a,_0x4d0d14){_0x23f97a=_0x23f97a-0x0;var _0x220bad=_0xc009[_0x23f97a];return _0x220bad;};'use strict';var _=require(_0x9c00('0x0'));var util=require(_0x9c00('0x1'));var moment=require('moment');var BPromise=require(_0x9c00('0x2'));var rs=require(_0x9c00('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9c00('0x4'));var logger=require('../../config/logger')(_0x9c00('0x5'));var config=require(_0x9c00('0x6'));var jayson=require(_0x9c00('0x7'));var client=jayson[_0x9c00('0x8')][_0x9c00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54f6e4,_0x41d55b,_0x558614){return new BPromise(function(_0x1627e2,_0x50e080){return client[_0x9c00('0xa')](_0x54f6e4,_0x558614)[_0x9c00('0xb')](function(_0x26addf){logger[_0x9c00('0xc')](_0x9c00('0xd'),_0x41d55b,_0x9c00('0xe'));logger[_0x9c00('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x41d55b,_0x9c00('0xe'),JSON[_0x9c00('0x10')](_0x26addf));if(_0x26addf[_0x9c00('0x11')]){if(_0x26addf['error'][_0x9c00('0x12')]===0x1f4){logger[_0x9c00('0x11')](_0x9c00('0xd'),_0x41d55b,_0x26addf[_0x9c00('0x11')]['message']);return _0x50e080(_0x26addf[_0x9c00('0x11')][_0x9c00('0x13')]);}logger[_0x9c00('0x11')](_0x9c00('0xd'),_0x41d55b,_0x26addf['error'][_0x9c00('0x13')]);return _0x1627e2(_0x26addf['error'][_0x9c00('0x13')]);}else{logger[_0x9c00('0xc')](_0x9c00('0xd'),_0x41d55b,_0x9c00('0xe'));_0x1627e2(_0x26addf[_0x9c00('0x14')][_0x9c00('0x13')]);}})[_0x9c00('0x15')](function(_0x20d34d){logger[_0x9c00('0x11')](_0x9c00('0xd'),_0x41d55b,_0x20d34d);_0x50e080(_0x20d34d);});});}exports[_0x9c00('0x16')]=function(_0x1b2085){var _0x4ef291=this;return new Promise(function(_0x1a3217,_0x51511a){return db[_0x9c00('0x17')]['create'](_0x1b2085[_0x9c00('0x18')],{'raw':_0x1b2085[_0x9c00('0x19')]?_0x1b2085[_0x9c00('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x48ab9c){logger['info']('CreateWhatsappQueueReport',_0x1b2085);logger['debug'](_0x9c00('0x16'),_0x1b2085,JSON[_0x9c00('0x10')](_0x48ab9c));_0x1a3217(_0x48ab9c);})[_0x9c00('0x15')](function(_0x539cfb){logger[_0x9c00('0x11')](_0x9c00('0x16'),_0x539cfb[_0x9c00('0x13')],_0x1b2085);_0x51511a(_0x4ef291[_0x9c00('0x11')](0x1f4,_0x539cfb[_0x9c00('0x13')]));});});};exports[_0x9c00('0x1a')]=function(_0x4cc5dc){var _0x5f3bf3=this;return new Promise(function(_0x2fde35,_0x277612){return db[_0x9c00('0x17')][_0x9c00('0x1b')](_0x4cc5dc[_0x9c00('0x18')],{'raw':_0x4cc5dc['options']?_0x4cc5dc['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cc5dc[_0x9c00('0x19')]?_0x4cc5dc['options'][_0x9c00('0x1c')]||null:null,'attributes':_0x4cc5dc['options']?_0x4cc5dc[_0x9c00('0x19')][_0x9c00('0x1d')]||null:null,'limit':_0x4cc5dc[_0x9c00('0x19')]?_0x4cc5dc[_0x9c00('0x19')][_0x9c00('0x1e')]||null:null})[_0x9c00('0xb')](function(_0x305ba0){logger['info'](_0x9c00('0x1a'),_0x4cc5dc);logger[_0x9c00('0xf')](_0x9c00('0x1a'),_0x4cc5dc,JSON[_0x9c00('0x10')](_0x305ba0));_0x2fde35(_0x305ba0);})[_0x9c00('0x15')](function(_0x3f5a8a){logger[_0x9c00('0x11')]('UpdateWhatsappQueueReport',_0x3f5a8a['message'],_0x4cc5dc);_0x277612(_0x5f3bf3[_0x9c00('0x11')](0x1f4,_0x3f5a8a[_0x9c00('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 75f73be..ca7a32a 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 _0x90f5=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','show','create','/:id','update'];(function(_0x526fb1,_0x1d0359){var _0x33582f=function(_0x2df327){while(--_0x2df327){_0x526fb1['push'](_0x526fb1['shift']());}};_0x33582f(++_0x1d0359);}(_0x90f5,0x132));var _0x590f=function(_0x4cfc63,_0x3e5b6e){_0x4cfc63=_0x4cfc63-0x0;var _0x1f42c1=_0x90f5[_0x4cfc63];return _0x1f42c1;};'use strict';var multer=require(_0x590f('0x0'));var util=require(_0x590f('0x1'));var path=require(_0x590f('0x2'));var timeout=require(_0x590f('0x3'));var express=require(_0x590f('0x4'));var router=express[_0x590f('0x5')]();var fs_extra=require(_0x590f('0x6'));var auth=require(_0x590f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x590f('0x8'));var controller=require(_0x590f('0x9'));router[_0x590f('0xa')]('/',auth[_0x590f('0xb')](),controller[_0x590f('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x590f('0xd')]);router['post']('/',auth[_0x590f('0xb')](),controller[_0x590f('0xe')]);router['put'](_0x590f('0xf'),auth['isAuthenticated'](),controller[_0x590f('0x10')]);router[_0x590f('0x11')](_0x590f('0xf'),auth[_0x590f('0xb')](),controller[_0x590f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7ba7=['create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','show','post'];(function(_0x5ee42c,_0x5e4cc){var _0x6fb0d0=function(_0x14bbaa){while(--_0x14bbaa){_0x5ee42c['push'](_0x5ee42c['shift']());}};_0x6fb0d0(++_0x5e4cc);}(_0x7ba7,0x1bd));var _0x77ba=function(_0x3ebff4,_0x5efe9a){_0x3ebff4=_0x3ebff4-0x0;var _0x6331b7=_0x7ba7[_0x3ebff4];return _0x6331b7;};'use strict';var multer=require(_0x77ba('0x0'));var util=require(_0x77ba('0x1'));var path=require('path');var timeout=require(_0x77ba('0x2'));var express=require(_0x77ba('0x3'));var router=express[_0x77ba('0x4')]();var fs_extra=require(_0x77ba('0x5'));var auth=require(_0x77ba('0x6'));var interaction=require(_0x77ba('0x7'));var config=require('../../config/environment');var controller=require(_0x77ba('0x8'));router[_0x77ba('0x9')]('/',auth[_0x77ba('0xa')](),controller[_0x77ba('0xb')]);router[_0x77ba('0x9')](_0x77ba('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x77ba('0x9')]('/:id',auth[_0x77ba('0xa')](),controller[_0x77ba('0xd')]);router[_0x77ba('0xe')]('/',auth[_0x77ba('0xa')](),controller[_0x77ba('0xf')]);router[_0x77ba('0x10')]('/:id',auth[_0x77ba('0xa')](),controller[_0x77ba('0x11')]);router[_0x77ba('0x12')]('/:id',auth[_0x77ba('0xa')](),controller[_0x77ba('0x13')]);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 d3c98b6..ffb73c8 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 _0x6017=['sequelize','exports','STRING','account','agent','DATE'];(function(_0x1a268a,_0x5b532f){var _0x43e531=function(_0x16318c){while(--_0x16318c){_0x1a268a['push'](_0x1a268a['shift']());}};_0x43e531(++_0x5b532f);}(_0x6017,0xae));var _0x7601=function(_0x4c7521,_0x5475e1){_0x4c7521=_0x4c7521-0x0;var _0x162bce=_0x6017[_0x4c7521];return _0x162bce;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'uniqueid':{'type':Sequelize[_0x7601('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7601('0x3'),_0x7601('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7601('0x5')]}}; \ No newline at end of file +var _0x94e6=['ENUM','account','agent','queue','DATE','sequelize','STRING'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x94e6,0x194));var _0x694e=function(_0x1635cd,_0x2efb69){_0x1635cd=_0x1635cd-0x0;var _0x569296=_0x94e6[_0x1635cd];return _0x569296;};'use strict';var Sequelize=require(_0x694e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x694e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x694e('0x2')](_0x694e('0x3'),_0x694e('0x4'),_0x694e('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x694e('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index d0e0f01..3c2395b 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 _0x3ece=['Content-Range','apply','reject','save','update','then','error','stack','send','index','WhatsappTransferReport','rawAttributes','key','model','map','name','query','keys','intersection','fields','length','attributes','limit','order','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set'];(function(_0x599de7,_0x3dfdf4){var _0x38fc23=function(_0x31fdaa){while(--_0x31fdaa){_0x599de7['push'](_0x599de7['shift']());}};_0x38fc23(++_0x3dfdf4);}(_0x3ece,0x10e));var _0xe3ec=function(_0x79be50,_0x575246){_0x79be50=_0x79be50-0x0;var _0x403ffc=_0x3ece[_0x79be50];return _0x403ffc;};'use strict';var emlformat=require(_0xe3ec('0x0'));var rimraf=require(_0xe3ec('0x1'));var zipdir=require(_0xe3ec('0x2'));var jsonpatch=require(_0xe3ec('0x3'));var rp=require('request-promise');var moment=require(_0xe3ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe3ec('0x5'));var util=require(_0xe3ec('0x6'));var path=require('path');var sox=require(_0xe3ec('0x7'));var csv=require('to-csv');var ejs=require(_0xe3ec('0x8'));var fs=require('fs');var fs_extra=require(_0xe3ec('0x9'));var _=require(_0xe3ec('0xa'));var squel=require('squel');var crypto=require(_0xe3ec('0xb'));var jsforce=require(_0xe3ec('0xc'));var deskjs=require(_0xe3ec('0xd'));var toCsv=require(_0xe3ec('0xe'));var querystring=require(_0xe3ec('0xf'));var Papa=require(_0xe3ec('0x10'));var Redis=require(_0xe3ec('0x11'));var authService=require(_0xe3ec('0x12'));var qs=require(_0xe3ec('0x13'));var as=require(_0xe3ec('0x14'));var hardwareService=require(_0xe3ec('0x15'));var logger=require('../../config/logger')(_0xe3ec('0x16'));var utils=require(_0xe3ec('0x17'));var config=require(_0xe3ec('0x18'));var licenseUtil=require(_0xe3ec('0x19'));var db=require(_0xe3ec('0x1a'))['db'];function respondWithStatusCode(_0x3b6d16,_0x179eff){_0x179eff=_0x179eff||0xcc;return function(_0x597b82){if(_0x597b82){return _0x3b6d16[_0xe3ec('0x1b')](_0x179eff);}return _0x3b6d16[_0xe3ec('0x1c')](_0x179eff)['end']();};}function respondWithResult(_0x46fd4c,_0x412e77){_0x412e77=_0x412e77||0xc8;return function(_0x23ad5c){if(_0x23ad5c){return _0x46fd4c[_0xe3ec('0x1c')](_0x412e77)[_0xe3ec('0x1d')](_0x23ad5c);}};}function respondWithFilteredResult(_0xd722c8,_0x4acaa8){return function(_0x2186f1){if(_0x2186f1){var _0x227c98=typeof _0x4acaa8[_0xe3ec('0x1e')]===_0xe3ec('0x1f')&&typeof _0x4acaa8['limit']===_0xe3ec('0x1f');var _0x2ee3ed=_0x2186f1[_0xe3ec('0x20')];var _0x2bb9d8=_0x227c98?0x0:_0x4acaa8['offset'];var _0x1f1201=_0x227c98?_0x2186f1[_0xe3ec('0x20')]:_0x4acaa8[_0xe3ec('0x1e')]+_0x4acaa8['limit'];var _0x1af896;if(_0x1f1201>=_0x2ee3ed){_0x1f1201=_0x2ee3ed;_0x1af896=0xc8;}else{_0x1af896=0xce;}_0xd722c8['status'](_0x1af896);return _0xd722c8[_0xe3ec('0x21')](_0xe3ec('0x22'),_0x2bb9d8+'-'+_0x1f1201+'/'+_0x2ee3ed)['json'](_0x2186f1);}return null;};}function patchUpdates(_0x29089b){return function(_0x10e7bf){try{jsonpatch[_0xe3ec('0x23')](_0x10e7bf,_0x29089b,!![]);}catch(_0x42c7f3){return BPromise[_0xe3ec('0x24')](_0x42c7f3);}return _0x10e7bf[_0xe3ec('0x25')]();};}function saveUpdates(_0x470186,_0x51030a){return function(_0x14f8a8){if(_0x14f8a8){return _0x14f8a8[_0xe3ec('0x26')](_0x470186)[_0xe3ec('0x27')](function(_0x56f94f){return _0x56f94f;});}return null;};}function removeEntity(_0x336240,_0x25ecd7){return function(_0x269dfe){if(_0x269dfe){return _0x269dfe['destroy']()['then'](function(){_0x336240['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ebfa,_0x2aa949){return function(_0x542719){if(!_0x542719){_0x56ebfa['sendStatus'](0x194);}return _0x542719;};}function handleError(_0x45a2a6,_0x1cd0f3){_0x1cd0f3=_0x1cd0f3||0x1f4;return function(_0x186542){logger[_0xe3ec('0x28')](_0x186542[_0xe3ec('0x29')]);if(_0x186542['name']){delete _0x186542['name'];}_0x45a2a6[_0xe3ec('0x1c')](_0x1cd0f3)[_0xe3ec('0x2a')](_0x186542);};}exports[_0xe3ec('0x2b')]=function(_0x23533e,_0x20401d){var _0x1548d9={},_0xd40d27={},_0x2ececa={'count':0x0,'rows':[]};var _0xa458b2=_['map'](db[_0xe3ec('0x2c')][_0xe3ec('0x2d')],function(_0x554604){return{'name':_0x554604['fieldName'],'type':_0x554604['type'][_0xe3ec('0x2e')]};});_0xd40d27[_0xe3ec('0x2f')]=_[_0xe3ec('0x30')](_0xa458b2,_0xe3ec('0x31'));_0xd40d27[_0xe3ec('0x32')]=_[_0xe3ec('0x33')](_0x23533e[_0xe3ec('0x32')]);_0xd40d27['filters']=_['intersection'](_0xd40d27[_0xe3ec('0x2f')],_0xd40d27[_0xe3ec('0x32')]);_0x1548d9['attributes']=_[_0xe3ec('0x34')](_0xd40d27[_0xe3ec('0x2f')],qs[_0xe3ec('0x35')](_0x23533e[_0xe3ec('0x32')][_0xe3ec('0x35')]));_0x1548d9['attributes']=_0x1548d9['attributes'][_0xe3ec('0x36')]?_0x1548d9[_0xe3ec('0x37')]:_0xd40d27[_0xe3ec('0x2f')];if(!_0x23533e[_0xe3ec('0x32')]['hasOwnProperty']('nolimit')){_0x1548d9[_0xe3ec('0x38')]=qs[_0xe3ec('0x38')](_0x23533e[_0xe3ec('0x32')]['limit']);_0x1548d9[_0xe3ec('0x1e')]=qs['offset'](_0x23533e['query'][_0xe3ec('0x1e')]);}_0x1548d9[_0xe3ec('0x39')]=qs['sort'](_0x23533e[_0xe3ec('0x32')]['sort']);_0x1548d9[_0xe3ec('0x3a')]=qs['filters'](_['pick'](_0x23533e['query'],_0xd40d27[_0xe3ec('0x3b')]),_0xa458b2);if(_0x23533e[_0xe3ec('0x32')]['filter']){_0x1548d9[_0xe3ec('0x3a')]=_[_0xe3ec('0x3c')](_0x1548d9[_0xe3ec('0x3a')],{'$or':_[_0xe3ec('0x30')](_0xa458b2,function(_0x22f6a5){if(_0x22f6a5[_0xe3ec('0x3d')]!==_0xe3ec('0x3e')){var _0x5e6015={};_0x5e6015[_0x22f6a5[_0xe3ec('0x31')]]={'$like':'%'+_0x23533e[_0xe3ec('0x32')][_0xe3ec('0x3f')]+'%'};return _0x5e6015;}})});}_0x1548d9=_[_0xe3ec('0x3c')]({},_0x1548d9,_0x23533e[_0xe3ec('0x40')]);var _0x2e7170={'where':_0x1548d9['where']};return db[_0xe3ec('0x2c')][_0xe3ec('0x20')](_0x2e7170)['then'](function(_0x2eab11){_0x2ececa['count']=_0x2eab11;if(_0x23533e[_0xe3ec('0x32')][_0xe3ec('0x41')]){_0x1548d9[_0xe3ec('0x42')]=[{'all':!![]}];}return db[_0xe3ec('0x2c')][_0xe3ec('0x43')](_0x1548d9);})[_0xe3ec('0x27')](function(_0xca92a){_0x2ececa['rows']=_0xca92a;return _0x2ececa;})['then'](respondWithFilteredResult(_0x20401d,_0x1548d9))[_0xe3ec('0x44')](handleError(_0x20401d,null));};exports[_0xe3ec('0x45')]=function(_0x26679d,_0x25a986){var _0x13da78={'raw':!![],'where':{'id':_0x26679d[_0xe3ec('0x46')]['id']}},_0xe40deb={};_0xe40deb[_0xe3ec('0x2f')]=_['keys'](db['WhatsappTransferReport'][_0xe3ec('0x2d')]);_0xe40deb[_0xe3ec('0x32')]=_[_0xe3ec('0x33')](_0x26679d[_0xe3ec('0x32')]);_0xe40deb[_0xe3ec('0x3b')]=_[_0xe3ec('0x34')](_0xe40deb[_0xe3ec('0x2f')],_0xe40deb['query']);_0x13da78[_0xe3ec('0x37')]=_['intersection'](_0xe40deb[_0xe3ec('0x2f')],qs[_0xe3ec('0x35')](_0x26679d['query'][_0xe3ec('0x35')]));_0x13da78[_0xe3ec('0x37')]=_0x13da78['attributes'][_0xe3ec('0x36')]?_0x13da78[_0xe3ec('0x37')]:_0xe40deb[_0xe3ec('0x2f')];if(_0x26679d['query'][_0xe3ec('0x41')]){_0x13da78['include']=[{'all':!![]}];}_0x13da78=_[_0xe3ec('0x3c')]({},_0x13da78,_0x26679d['options']);return db[_0xe3ec('0x2c')]['find'](_0x13da78)[_0xe3ec('0x27')](handleEntityNotFound(_0x25a986,null))[_0xe3ec('0x27')](respondWithResult(_0x25a986,null))[_0xe3ec('0x44')](handleError(_0x25a986,null));};exports[_0xe3ec('0x47')]=function(_0x21e309,_0x226ebb){return db[_0xe3ec('0x2c')][_0xe3ec('0x47')](_0x21e309[_0xe3ec('0x48')],{})[_0xe3ec('0x27')](respondWithResult(_0x226ebb,0xc9))[_0xe3ec('0x44')](handleError(_0x226ebb,null));};exports[_0xe3ec('0x26')]=function(_0x180a43,_0x1fcb81){if(_0x180a43['body']['id']){delete _0x180a43[_0xe3ec('0x48')]['id'];}return db['WhatsappTransferReport'][_0xe3ec('0x49')]({'where':{'id':_0x180a43['params']['id']}})[_0xe3ec('0x27')](handleEntityNotFound(_0x1fcb81,null))[_0xe3ec('0x27')](saveUpdates(_0x180a43['body'],null))['then'](respondWithResult(_0x1fcb81,null))[_0xe3ec('0x44')](handleError(_0x1fcb81,null));};exports[_0xe3ec('0x4a')]=function(_0x5b691b,_0x5e204c){return db[_0xe3ec('0x2c')]['find']({'where':{'id':_0x5b691b[_0xe3ec('0x46')]['id']}})[_0xe3ec('0x27')](handleEntityNotFound(_0x5e204c,null))[_0xe3ec('0x27')](removeEntity(_0x5e204c,null))[_0xe3ec('0x44')](handleError(_0x5e204c,null));};exports[_0xe3ec('0x4b')]=function(_0x46f4cf,_0x30b5df){return db['WhatsappTransferReport'][_0xe3ec('0x4b')]()[_0xe3ec('0x27')](respondWithResult(_0x30b5df,null))[_0xe3ec('0x44')](handleError(_0x30b5df,null));}; \ No newline at end of file +var _0xeb6c=['offset','undefined','limit','count','set','Content-Range','json','apply','update','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','WhatsappTransferReport','includeAll','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status'];(function(_0xe90ac5,_0x1bdafb){var _0x3f9067=function(_0x413227){while(--_0x413227){_0xe90ac5['push'](_0xe90ac5['shift']());}};_0x3f9067(++_0x1bdafb);}(_0xeb6c,0x1a7));var _0xceb6=function(_0x1b4a3e,_0x3440ec){_0x1b4a3e=_0x1b4a3e-0x0;var _0x45bbe6=_0xeb6c[_0x1b4a3e];return _0x45bbe6;};'use strict';var emlformat=require(_0xceb6('0x0'));var rimraf=require(_0xceb6('0x1'));var zipdir=require(_0xceb6('0x2'));var jsonpatch=require(_0xceb6('0x3'));var rp=require(_0xceb6('0x4'));var moment=require(_0xceb6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xceb6('0x6'));var util=require(_0xceb6('0x7'));var path=require('path');var sox=require(_0xceb6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xceb6('0x9'));var _=require(_0xceb6('0xa'));var squel=require(_0xceb6('0xb'));var crypto=require(_0xceb6('0xc'));var jsforce=require(_0xceb6('0xd'));var deskjs=require(_0xceb6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xceb6('0xf'));var Papa=require(_0xceb6('0x10'));var Redis=require(_0xceb6('0x11'));var authService=require(_0xceb6('0x12'));var qs=require(_0xceb6('0x13'));var as=require(_0xceb6('0x14'));var hardwareService=require(_0xceb6('0x15'));var logger=require(_0xceb6('0x16'))(_0xceb6('0x17'));var utils=require(_0xceb6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xceb6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x101fcb,_0x208e12){_0x208e12=_0x208e12||0xcc;return function(_0x14c6ec){if(_0x14c6ec){return _0x101fcb['sendStatus'](_0x208e12);}return _0x101fcb[_0xceb6('0x1a')](_0x208e12)['end']();};}function respondWithResult(_0x10c97c,_0x388664){_0x388664=_0x388664||0xc8;return function(_0x302474){if(_0x302474){return _0x10c97c['status'](_0x388664)['json'](_0x302474);}};}function respondWithFilteredResult(_0x4cebcc,_0x351d19){return function(_0x4aead9){if(_0x4aead9){var _0x471abe=typeof _0x351d19[_0xceb6('0x1b')]===_0xceb6('0x1c')&&typeof _0x351d19[_0xceb6('0x1d')]==='undefined';var _0x1044d9=_0x4aead9['count'];var _0xc7aa7c=_0x471abe?0x0:_0x351d19['offset'];var _0x43d34d=_0x471abe?_0x4aead9[_0xceb6('0x1e')]:_0x351d19[_0xceb6('0x1b')]+_0x351d19[_0xceb6('0x1d')];var _0xe9114a;if(_0x43d34d>=_0x1044d9){_0x43d34d=_0x1044d9;_0xe9114a=0xc8;}else{_0xe9114a=0xce;}_0x4cebcc[_0xceb6('0x1a')](_0xe9114a);return _0x4cebcc[_0xceb6('0x1f')](_0xceb6('0x20'),_0xc7aa7c+'-'+_0x43d34d+'/'+_0x1044d9)[_0xceb6('0x21')](_0x4aead9);}return null;};}function patchUpdates(_0x3efc39){return function(_0x530b37){try{jsonpatch[_0xceb6('0x22')](_0x530b37,_0x3efc39,!![]);}catch(_0x55e5dc){return BPromise['reject'](_0x55e5dc);}return _0x530b37['save']();};}function saveUpdates(_0x443007,_0x417e9f){return function(_0x2676d2){if(_0x2676d2){return _0x2676d2[_0xceb6('0x23')](_0x443007)[_0xceb6('0x24')](function(_0x348164){return _0x348164;});}return null;};}function removeEntity(_0xa1a095,_0x54f21a){return function(_0x42a406){if(_0x42a406){return _0x42a406['destroy']()['then'](function(){_0xa1a095[_0xceb6('0x1a')](0xcc)[_0xceb6('0x25')]();});}};}function handleEntityNotFound(_0x214a2e,_0x3df445){return function(_0x3f843b){if(!_0x3f843b){_0x214a2e[_0xceb6('0x26')](0x194);}return _0x3f843b;};}function handleError(_0x121f9a,_0x5b1d20){_0x5b1d20=_0x5b1d20||0x1f4;return function(_0x2cb99d){logger[_0xceb6('0x27')](_0x2cb99d[_0xceb6('0x28')]);if(_0x2cb99d[_0xceb6('0x29')]){delete _0x2cb99d[_0xceb6('0x29')];}_0x121f9a[_0xceb6('0x1a')](_0x5b1d20)[_0xceb6('0x2a')](_0x2cb99d);};}exports[_0xceb6('0x2b')]=function(_0x5bb23e,_0x531316){var _0x190b6b={},_0x209f70={},_0x4c7f32={'count':0x0,'rows':[]};var _0x52601d=_[_0xceb6('0x2c')](db['WhatsappTransferReport'][_0xceb6('0x2d')],function(_0x30c781){return{'name':_0x30c781['fieldName'],'type':_0x30c781[_0xceb6('0x2e')][_0xceb6('0x2f')]};});_0x209f70['model']=_[_0xceb6('0x2c')](_0x52601d,_0xceb6('0x29'));_0x209f70['query']=_[_0xceb6('0x30')](_0x5bb23e[_0xceb6('0x31')]);_0x209f70[_0xceb6('0x32')]=_['intersection'](_0x209f70[_0xceb6('0x33')],_0x209f70[_0xceb6('0x31')]);_0x190b6b['attributes']=_[_0xceb6('0x34')](_0x209f70[_0xceb6('0x33')],qs['fields'](_0x5bb23e[_0xceb6('0x31')][_0xceb6('0x35')]));_0x190b6b[_0xceb6('0x36')]=_0x190b6b['attributes'][_0xceb6('0x37')]?_0x190b6b['attributes']:_0x209f70[_0xceb6('0x33')];if(!_0x5bb23e[_0xceb6('0x31')][_0xceb6('0x38')](_0xceb6('0x39'))){_0x190b6b[_0xceb6('0x1d')]=qs['limit'](_0x5bb23e[_0xceb6('0x31')][_0xceb6('0x1d')]);_0x190b6b[_0xceb6('0x1b')]=qs[_0xceb6('0x1b')](_0x5bb23e[_0xceb6('0x31')][_0xceb6('0x1b')]);}_0x190b6b[_0xceb6('0x3a')]=qs[_0xceb6('0x3b')](_0x5bb23e[_0xceb6('0x31')][_0xceb6('0x3b')]);_0x190b6b[_0xceb6('0x3c')]=qs[_0xceb6('0x32')](_[_0xceb6('0x3d')](_0x5bb23e['query'],_0x209f70['filters']),_0x52601d);if(_0x5bb23e['query']['filter']){_0x190b6b[_0xceb6('0x3c')]=_['merge'](_0x190b6b[_0xceb6('0x3c')],{'$or':_[_0xceb6('0x2c')](_0x52601d,function(_0x31e17f){if(_0x31e17f[_0xceb6('0x2e')]!==_0xceb6('0x3e')){var _0x3c9950={};_0x3c9950[_0x31e17f[_0xceb6('0x29')]]={'$like':'%'+_0x5bb23e[_0xceb6('0x31')][_0xceb6('0x3f')]+'%'};return _0x3c9950;}})});}_0x190b6b=_[_0xceb6('0x40')]({},_0x190b6b,_0x5bb23e['options']);var _0x4e534f={'where':_0x190b6b[_0xceb6('0x3c')]};return db[_0xceb6('0x41')][_0xceb6('0x1e')](_0x4e534f)[_0xceb6('0x24')](function(_0x42740a){_0x4c7f32[_0xceb6('0x1e')]=_0x42740a;if(_0x5bb23e[_0xceb6('0x31')][_0xceb6('0x42')]){_0x190b6b['include']=[{'all':!![]}];}return db[_0xceb6('0x41')][_0xceb6('0x43')](_0x190b6b);})[_0xceb6('0x24')](function(_0x584009){_0x4c7f32[_0xceb6('0x44')]=_0x584009;return _0x4c7f32;})[_0xceb6('0x24')](respondWithFilteredResult(_0x531316,_0x190b6b))[_0xceb6('0x45')](handleError(_0x531316,null));};exports[_0xceb6('0x46')]=function(_0x432337,_0x36b8a3){var _0x315f68={'raw':!![],'where':{'id':_0x432337[_0xceb6('0x47')]['id']}},_0x20555d={};_0x20555d[_0xceb6('0x33')]=_[_0xceb6('0x30')](db['WhatsappTransferReport'][_0xceb6('0x2d')]);_0x20555d[_0xceb6('0x31')]=_[_0xceb6('0x30')](_0x432337[_0xceb6('0x31')]);_0x20555d[_0xceb6('0x32')]=_[_0xceb6('0x34')](_0x20555d[_0xceb6('0x33')],_0x20555d[_0xceb6('0x31')]);_0x315f68[_0xceb6('0x36')]=_['intersection'](_0x20555d[_0xceb6('0x33')],qs['fields'](_0x432337[_0xceb6('0x31')][_0xceb6('0x35')]));_0x315f68[_0xceb6('0x36')]=_0x315f68[_0xceb6('0x36')][_0xceb6('0x37')]?_0x315f68[_0xceb6('0x36')]:_0x20555d[_0xceb6('0x33')];if(_0x432337['query'][_0xceb6('0x42')]){_0x315f68['include']=[{'all':!![]}];}_0x315f68=_[_0xceb6('0x40')]({},_0x315f68,_0x432337['options']);return db[_0xceb6('0x41')][_0xceb6('0x48')](_0x315f68)[_0xceb6('0x24')](handleEntityNotFound(_0x36b8a3,null))[_0xceb6('0x24')](respondWithResult(_0x36b8a3,null))[_0xceb6('0x45')](handleError(_0x36b8a3,null));};exports['create']=function(_0x2e398e,_0x24ef83){return db[_0xceb6('0x41')]['create'](_0x2e398e[_0xceb6('0x49')],{})[_0xceb6('0x24')](respondWithResult(_0x24ef83,0xc9))['catch'](handleError(_0x24ef83,null));};exports[_0xceb6('0x23')]=function(_0x4a985a,_0x2ef0ab){if(_0x4a985a[_0xceb6('0x49')]['id']){delete _0x4a985a[_0xceb6('0x49')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x4a985a[_0xceb6('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ef0ab,null))['then'](saveUpdates(_0x4a985a[_0xceb6('0x49')],null))[_0xceb6('0x24')](respondWithResult(_0x2ef0ab,null))[_0xceb6('0x45')](handleError(_0x2ef0ab,null));};exports['destroy']=function(_0x1a711c,_0x5e2e7d){return db[_0xceb6('0x41')]['find']({'where':{'id':_0x1a711c[_0xceb6('0x47')]['id']}})[_0xceb6('0x24')](handleEntityNotFound(_0x5e2e7d,null))[_0xceb6('0x24')](removeEntity(_0x5e2e7d,null))[_0xceb6('0x45')](handleError(_0x5e2e7d,null));};exports[_0xceb6('0x4a')]=function(_0x2b38fc,_0x1613d4){return db[_0xceb6('0x41')]['describe']()[_0xceb6('0x24')](respondWithResult(_0x1613d4,null))['catch'](handleError(_0x1613d4,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index b583ea7..031c9a9 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 _0x6421=['api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','../../config/logger'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x6421,0x1e7));var _0x1642=function(_0x316ab8,_0x288f5d){_0x316ab8=_0x316ab8-0x0;var _0x572ec7=_0x6421[_0x316ab8];return _0x572ec7;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var logger=require(_0x1642('0x2'))(_0x1642('0x3'));var moment=require(_0x1642('0x4'));var BPromise=require('bluebird');var rp=require(_0x1642('0x5'));var fs=require('fs');var path=require(_0x1642('0x6'));var rimraf=require(_0x1642('0x7'));var config=require(_0x1642('0x8'));var attributes=require(_0x1642('0x9'));module[_0x1642('0xa')]=function(_0x320140,_0x4fed29){return _0x320140[_0x1642('0xb')](_0x1642('0xc'),attributes,{'tableName':_0x1642('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x378e=['../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x378e,0xf4));var _0xe378=function(_0x2af627,_0x33d47f){_0x2af627=_0x2af627-0x0;var _0x14eda9=_0x378e[_0x2af627];return _0x14eda9;};'use strict';var _=require(_0xe378('0x0'));var util=require(_0xe378('0x1'));var logger=require(_0xe378('0x2'))(_0xe378('0x3'));var moment=require(_0xe378('0x4'));var BPromise=require(_0xe378('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe378('0x6'));var rimraf=require(_0xe378('0x7'));var config=require(_0xe378('0x8'));var attributes=require(_0xe378('0x9'));module[_0xe378('0xa')]=function(_0x3438af,_0xe4045){return _0x3438af[_0xe378('0xb')]('WhatsappTransferReport',attributes,{'tableName':_0xe378('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe378('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index a6e9f23..357724b 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 _0x86ab=['stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x41efc4,_0x1c54cb){var _0x172f72=function(_0x258b48){while(--_0x258b48){_0x41efc4['push'](_0x41efc4['shift']());}};_0x172f72(++_0x1c54cb);}(_0x86ab,0x1bc));var _0xb86a=function(_0x439562,_0x44bfa3){_0x439562=_0x439562-0x0;var _0x51b29a=_0x86ab[_0x439562];return _0x51b29a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb86a('0x0'));var BPromise=require(_0xb86a('0x1'));var rs=require(_0xb86a('0x2'));var fs=require('fs');var Redis=require(_0xb86a('0x3'));var db=require(_0xb86a('0x4'))['db'];var utils=require(_0xb86a('0x5'));var logger=require('../../config/logger')(_0xb86a('0x6'));var config=require(_0xb86a('0x7'));var jayson=require(_0xb86a('0x8'));var client=jayson[_0xb86a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33f8bc,_0x47e902,_0x1368fb){return new BPromise(function(_0x5f4f98,_0x33ddef){return client[_0xb86a('0xa')](_0x33f8bc,_0x1368fb)[_0xb86a('0xb')](function(_0x15c9af){logger[_0xb86a('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e902,_0xb86a('0xd'));logger[_0xb86a('0xe')](_0xb86a('0xf'),_0x47e902,_0xb86a('0xd'),JSON[_0xb86a('0x10')](_0x15c9af));if(_0x15c9af[_0xb86a('0x11')]){if(_0x15c9af['error'][_0xb86a('0x12')]===0x1f4){logger[_0xb86a('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e902,_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);return _0x33ddef(_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);}logger[_0xb86a('0x11')](_0xb86a('0x14'),_0x47e902,_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);return _0x5f4f98(_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);}else{logger[_0xb86a('0xc')](_0xb86a('0x14'),_0x47e902,_0xb86a('0xd'));_0x5f4f98(_0x15c9af[_0xb86a('0x15')][_0xb86a('0x13')]);}})[_0xb86a('0x16')](function(_0x5e179d){logger[_0xb86a('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e902,_0x5e179d);_0x33ddef(_0x5e179d);});});} \ No newline at end of file +var _0x5c4f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x410458,_0x4af7d5){var _0x2adf96=function(_0x50e3a3){while(--_0x50e3a3){_0x410458['push'](_0x410458['shift']());}};_0x2adf96(++_0x4af7d5);}(_0x5c4f,0x64));var _0xf5c4=function(_0x3483b1,_0x43faaa){_0x3483b1=_0x3483b1-0x0;var _0x155342=_0x5c4f[_0x3483b1];return _0x155342;};'use strict';var _=require(_0xf5c4('0x0'));var util=require(_0xf5c4('0x1'));var moment=require(_0xf5c4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5c4('0x3'));var db=require(_0xf5c4('0x4'))['db'];var utils=require(_0xf5c4('0x5'));var logger=require(_0xf5c4('0x6'))('rpc');var config=require(_0xf5c4('0x7'));var jayson=require(_0xf5c4('0x8'));var client=jayson[_0xf5c4('0x9')][_0xf5c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d9bc5,_0x2d51f2,_0x1bccda){return new BPromise(function(_0x4c7cdb,_0x1b9341){return client['request'](_0x1d9bc5,_0x1bccda)[_0xf5c4('0xb')](function(_0x20b625){logger[_0xf5c4('0xc')](_0xf5c4('0xd'),_0x2d51f2,'request\x20sent');logger[_0xf5c4('0xe')](_0xf5c4('0xf'),_0x2d51f2,_0xf5c4('0x10'),JSON[_0xf5c4('0x11')](_0x20b625));if(_0x20b625[_0xf5c4('0x12')]){if(_0x20b625['error']['code']===0x1f4){logger[_0xf5c4('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2d51f2,_0x20b625[_0xf5c4('0x12')]['message']);return _0x1b9341(_0x20b625[_0xf5c4('0x12')][_0xf5c4('0x13')]);}logger[_0xf5c4('0x12')](_0xf5c4('0xd'),_0x2d51f2,_0x20b625[_0xf5c4('0x12')]['message']);return _0x4c7cdb(_0x20b625[_0xf5c4('0x12')][_0xf5c4('0x13')]);}else{logger['info'](_0xf5c4('0xd'),_0x2d51f2,_0xf5c4('0x10'));_0x4c7cdb(_0x20b625['result'][_0xf5c4('0x13')]);}})[_0xf5c4('0x14')](function(_0x2d0688){logger[_0xf5c4('0x12')](_0xf5c4('0xd'),_0x2d51f2,_0x2d0688);_0x1b9341(_0x2d0688);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index bc63cb8..09442a0 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c70=['sequelize','then','seedDB','default','listen','info','start','exitCode','length','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','filter','None','log','App\x20Ready!','catch','error','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider'];(function(_0x1424ad,_0x4a8bc5){var _0x446de3=function(_0x20b8c1){while(--_0x20b8c1){_0x1424ad['push'](_0x1424ad['shift']());}};_0x446de3(++_0x4a8bc5);}(_0x3c70,0x10c));var _0x03c7=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x3c70[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x03c7('0x0'));var db=require(_0x03c7('0x1'))['db'];var seedDb=require(_0x03c7('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x03c7('0x3'));var config=require(_0x03c7('0x4'));var logger=require(_0x03c7('0x5'))(_0x03c7('0x6'));var pm2=require(_0x03c7('0x7'));var pm2Config=require(_0x03c7('0x8'));var schedule=require('./config/schedule');var chat=require(_0x03c7('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x03c7('0xa'));var provider=require(_0x03c7('0xb'));function main(){return db[_0x03c7('0xc')]['sync']()[_0x03c7('0xd')](function(){if(config[_0x03c7('0xe')]){return seedDb[_0x03c7('0xf')]();}})['then'](function(){return checkLicense[_0x03c7('0xf')]();})['then'](function(){return rpc[_0x03c7('0x10')]();})[_0x03c7('0xd')](function(_0x57c8fb){logger[_0x03c7('0x11')](_0x57c8fb);return chat[_0x03c7('0x12')]();})[_0x03c7('0xd')](function(){return whatsapp[_0x03c7('0x12')]();})[_0x03c7('0xd')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x03c7('0x12')]();})[_0x03c7('0xd')](function(){return provider['start']();})[_0x03c7('0xd')](function(_0x35b1d1){logger[_0x03c7('0x11')](_0x35b1d1);return pm2[_0x03c7('0x12')](pm2Config);})[_0x03c7('0xd')](function(_0x5adce3){var _0x23b568=_0x5adce3['filter'](function(_0xdc48a7){return typeof _0xdc48a7[_0x03c7('0x13')]==='number'&&_0xdc48a7[_0x03c7('0x13')]>=0x0;});if(_0x23b568[_0x03c7('0x14')]>0x0){throw new Error(_0x23b568[_0x03c7('0x14')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x03c7('0x15')](_0x23b568,function(_0x6c852d){return'\x22'+_0x6c852d[_0x03c7('0x16')][_0x03c7('0x17')]+'\x22';}));}logger[_0x03c7('0x11')](_0x03c7('0x18'),_['map'](_['filter'](_0x5adce3,{'status':_0x03c7('0x19')}),_0x03c7('0x17'))[_0x03c7('0x1a')]());logger[_0x03c7('0x11')](_0x03c7('0x1b'),_['map'](_[_0x03c7('0x1c')](_0x5adce3,function(_0x1e6fae){return _0x1e6fae['status']!=='online';}),'name')[_0x03c7('0x1a')]()||_0x03c7('0x1d'));console[_0x03c7('0x1e')](_0x03c7('0x1f'));})[_0x03c7('0x20')](function(_0x12668d){console[_0x03c7('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x12668d);logger[_0x03c7('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x12668d);process[_0x03c7('0x22')](0x1);});}main(); \ No newline at end of file +var _0x818f=['App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','join','status','online','None'];(function(_0x38e38e,_0x5b27aa){var _0x19963d=function(_0x3833e2){while(--_0x3833e2){_0x38e38e['push'](_0x38e38e['shift']());}};_0x19963d(++_0x5b27aa);}(_0x818f,0x1da));var _0xf818=function(_0xaa32e,_0xb36be8){_0xaa32e=_0xaa32e-0x0;var _0x498bd4=_0x818f[_0xaa32e];return _0x498bd4;};'use strict';var _=require(_0xf818('0x0'));var db=require(_0xf818('0x1'))['db'];var seedDb=require(_0xf818('0x2'));var checkLicense=require(_0xf818('0x3'));var rpc=require(_0xf818('0x4'));var config=require(_0xf818('0x5'));var logger=require('./config/logger')(_0xf818('0x6'));var pm2=require(_0xf818('0x7'));var pm2Config=require(_0xf818('0x8'));var schedule=require(_0xf818('0x9'));var chat=require(_0xf818('0xa'));var whatsapp=require(_0xf818('0xb'));var transcribe=require(_0xf818('0xc'));var provider=require(_0xf818('0xd'));function main(){return db[_0xf818('0xe')]['sync']()[_0xf818('0xf')](function(){if(config[_0xf818('0x10')]){return seedDb[_0xf818('0x11')]();}})['then'](function(){return checkLicense['default']();})[_0xf818('0xf')](function(){return rpc[_0xf818('0x12')]();})[_0xf818('0xf')](function(_0x3386f9){logger[_0xf818('0x13')](_0x3386f9);return chat['start']();})[_0xf818('0xf')](function(){return whatsapp[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return schedule[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return transcribe['start']();})['then'](function(){return provider[_0xf818('0x14')]();})[_0xf818('0xf')](function(_0x950109){logger[_0xf818('0x13')](_0x950109);return pm2['start'](pm2Config);})[_0xf818('0xf')](function(_0x3234c5){var _0xbc3568=_0x3234c5[_0xf818('0x15')](function(_0xbfdd71){return typeof _0xbfdd71['exitCode']==='number'&&_0xbfdd71[_0xf818('0x16')]>=0x0;});if(_0xbc3568['length']>0x0){throw new Error(_0xbc3568[_0xf818('0x17')]+_0xf818('0x18')+_['map'](_0xbc3568,function(_0x2bf9f3){return'\x22'+_0x2bf9f3[_0xf818('0x19')][_0xf818('0x1a')]+'\x22';}));}logger['info'](_0xf818('0x1b'),_[_0xf818('0x1c')](_[_0xf818('0x15')](_0x3234c5,{'status':'online'}),'name')[_0xf818('0x1d')]());logger[_0xf818('0x13')]('Offline\x20apps:',_[_0xf818('0x1c')](_['filter'](_0x3234c5,function(_0x1849bf){return _0x1849bf[_0xf818('0x1e')]!==_0xf818('0x1f');}),'name')[_0xf818('0x1d')]()||_0xf818('0x20'));console['log'](_0xf818('0x21'));})[_0xf818('0x22')](function(_0x1160f4){console[_0xf818('0x23')](_0xf818('0x24'),_0x1160f4);logger[_0xf818('0x25')](_0xf818('0x26'),_0x1160f4);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 53001ec..0314703 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 _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0x50f28b,_0x14e6ce){var _0x3f8781=function(_0x292caa){while(--_0x292caa){_0x50f28b['push'](_0x50f28b['shift']());}};_0x3f8781(++_0x14e6ce);}(_0x4b84,0x1cc));var _0x44b8=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0x4b84[_0xbebf50];return _0xce1496;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file +var _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0x52838b,_0x3be638){var _0x22a20d=function(_0x4e5e91){while(--_0x4e5e91){_0x52838b['push'](_0x52838b['shift']());}};_0x22a20d(++_0x3be638);}(_0x4b84,0x1cc));var _0x44b8=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0x4b84[_0x590b61];return _0x1a14dc;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 6901027..8525d86 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 _0xafd3=['skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','catch','CmContact','describe','keys','startsWith','cf_','findOne','slice','all','length','fieldType','map','type','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter','user','clause','tags'];(function(_0x239f7c,_0x4b4c0d){var _0x3d35ca=function(_0x4ca9f7){while(--_0x4ca9f7){_0x239f7c['push'](_0x239f7c['shift']());}};_0x3d35ca(++_0x4b4c0d);}(_0xafd3,0x1b8));var _0x3afd=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0xafd3[_0x26b80e];return _0x84a8a8;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var db=require(_0x3afd('0x0'))['db'];exports['findAll']=function(_0x1c9ff9,_0x50ce72,_0xe49c63,_0x30dc53){var _0x46cba0={'count':0x0,'rows':[]};var _0x3c6bf4=sqlUtils[_0x3afd('0x1')](_0x50ce72,_0x1c9ff9);if(_0x3c6bf4){return Promise['resolve'](_0x46cba0);}var _0x3215db=sqlUtils[_0x3afd('0x2')]();var _0xc01e64={};var _0x13dc01=![];var _0x4db7d3=![];return Promise[_0x3afd('0x3')]()[_0x3afd('0x4')](function(){if(_0x1c9ff9[_0x3afd('0x5')]){return sqlUtils[_0x3afd('0x6')](_0x1c9ff9['search'],_0x30dc53);}else{return sqlUtils[_0x3afd('0x7')](_0x1c9ff9,_0x30dc53);}})[_0x3afd('0x4')](function(_0x424533){_0x3215db['where'](_0x424533[_0x3afd('0x8')]);_0x3215db[_0x3afd('0x9')](_0x424533[_0x3afd('0xa')]);_0x3215db[_0x3afd('0x9')](_0x424533[_0x3afd('0xb')]);_0x3215db[_0x3afd('0x9')](_0x424533[_0x3afd('0xc')][_0x3afd('0xd')]);_0xc01e64=_0x424533[_0x3afd('0xe')];_0x4db7d3=_0x424533[_0x3afd('0xc')][_0x3afd('0xf')];return sqlUtils['checkListsRestrictions'](_0x50ce72,_0x1c9ff9,_0x4db7d3);})[_0x3afd('0x4')](function(_0x2b2886){_0x3215db[_0x3afd('0x9')](_0x2b2886);var _0x1bcd15=_0x1c9ff9[_0x3afd('0x5')]?_0xc01e64[_0x3afd('0x10')]:_0x1c9ff9[_0x3afd('0x11')];_0x13dc01=_0x1bcd15?!![]:![];return sqlUtils[_0x3afd('0x12')](_0x3215db,_0x1bcd15);})[_0x3afd('0x4')](function(_0x1fb97a){_0x46cba0[_0x3afd('0x13')]=_0x1fb97a;if(_0x46cba0[_0x3afd('0x13')]===0x0){return;}if(_0x1c9ff9['User']){_0x4db7d3=!![];}return sqlUtils[_0x3afd('0x14')](_0x3215db,_0x1c9ff9[_0x3afd('0xa')],_0xe49c63,_0x13dc01,_0xc01e64[_0x3afd('0xd')],_0x4db7d3);})[_0x3afd('0x4')](function(_0x49597e){if(!_0x49597e){return[];}return sqlUtils[_0x3afd('0x15')](_0x49597e,_0x1c9ff9,_0xe49c63);})[_0x3afd('0x4')](function(_0x17f5bc){_0x46cba0['rows']=_0x17f5bc;return _0x46cba0;})[_0x3afd('0x16')](function(_0x2975c2){throw _0x2975c2;});};exports['describe']=function(){var _0x3c2674={};var _0x562463=[];return db[_0x3afd('0x17')][_0x3afd('0x18')]()[_0x3afd('0x4')](function(_0x589d87){_0x3c2674=_0x589d87;var _0x28a3b3=Object[_0x3afd('0x19')](_0x3c2674)[_0x3afd('0xb')](function(_0x22bf61){return _[_0x3afd('0x1a')](_0x22bf61,_0x3afd('0x1b'))?_0x22bf61:undefined;});var _0x82231b=_0x28a3b3['map'](function(_0x4e0a7d){return db['CmCustomField'][_0x3afd('0x1c')]({'where':{'id':_0x4e0a7d[_0x3afd('0x1d')](0x3)},'raw':!![]});});return Promise[_0x3afd('0x1e')](_0x82231b);})[_0x3afd('0x4')](function(_0x420474){for(var _0x1296bb=0x0;_0x1296bb<_0x420474[_0x3afd('0x1f')];_0x1296bb++){if(_0x420474[_0x1296bb]){var _0x15d853=_0x3afd('0x1b')+_0x420474[_0x1296bb]['id'];_0x3c2674[_0x15d853][_0x3afd('0x20')]=_0x420474[_0x1296bb]['type'];}}_0x562463=_[_0x3afd('0x21')](Object['keys'](_0x3c2674),function(_0x36877b){return{'name':_0x36877b,'type':_0x3c2674[_0x36877b][_0x3afd('0x22')]};});return _0x562463;})[_0x3afd('0x16')](function(_0x3f5063){throw _0x3f5063;});}; \ No newline at end of file +var _0x3ad9=['describe','CmContact','keys','startsWith','map','slice','all','cf_','fieldType','type','lodash','./sql-utils','findAll','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','countFilteredContacts','count','User','getFilteredContacts','rows','catch'];(function(_0x173d97,_0x1028d6){var _0x2ebce0=function(_0x58eae0){while(--_0x58eae0){_0x173d97['push'](_0x173d97['shift']());}};_0x2ebce0(++_0x1028d6);}(_0x3ad9,0xd0));var _0x93ad=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x3ad9[_0x4b1032];return _0x5a1d55;};'use strict';var _=require(_0x93ad('0x0'));var sqlUtils=require(_0x93ad('0x1'));var db=require('../../mysqldb')['db'];exports[_0x93ad('0x2')]=function(_0x3b05ee,_0x2dc448,_0x43bce6,_0x54f0cc){var _0x48b2f0={'count':0x0,'rows':[]};var _0x5a7431=sqlUtils['skipContactsQuery'](_0x2dc448,_0x3b05ee);if(_0x5a7431){return Promise['resolve'](_0x48b2f0);}var _0x6de1f7=sqlUtils['getContactsSubquery']();var _0x57c18e={};var _0x5c7a87=![];var _0x38ed26=![];return Promise['resolve']()[_0x93ad('0x3')](function(){if(_0x3b05ee[_0x93ad('0x4')]){return sqlUtils[_0x93ad('0x5')](_0x3b05ee['search'],_0x54f0cc);}else{return sqlUtils[_0x93ad('0x6')](_0x3b05ee,_0x54f0cc);}})[_0x93ad('0x3')](function(_0x12b9ca){_0x6de1f7[_0x93ad('0x7')](_0x12b9ca[_0x93ad('0x8')]);_0x6de1f7[_0x93ad('0x7')](_0x12b9ca[_0x93ad('0x9')]);_0x6de1f7[_0x93ad('0x7')](_0x12b9ca[_0x93ad('0xa')]);_0x6de1f7[_0x93ad('0x7')](_0x12b9ca[_0x93ad('0xb')][_0x93ad('0xc')]);_0x57c18e=_0x12b9ca[_0x93ad('0xd')];_0x38ed26=_0x12b9ca['user'][_0x93ad('0xe')];return sqlUtils[_0x93ad('0xf')](_0x2dc448,_0x3b05ee,_0x38ed26);})[_0x93ad('0x3')](function(_0x18ca12){_0x6de1f7[_0x93ad('0x7')](_0x18ca12);var _0x527c40=_0x3b05ee[_0x93ad('0x4')]?_0x57c18e[_0x93ad('0x10')]:_0x3b05ee['tag'];_0x5c7a87=_0x527c40?!![]:![];return sqlUtils[_0x93ad('0x11')](_0x6de1f7,_0x527c40);})['then'](function(_0x350253){_0x48b2f0['count']=_0x350253;if(_0x48b2f0[_0x93ad('0x12')]===0x0){return;}if(_0x3b05ee[_0x93ad('0x13')]){_0x38ed26=!![];}return sqlUtils['buildContactsQuery'](_0x6de1f7,_0x3b05ee[_0x93ad('0x9')],_0x43bce6,_0x5c7a87,_0x57c18e[_0x93ad('0xc')],_0x38ed26);})[_0x93ad('0x3')](function(_0x441b28){if(!_0x441b28){return[];}return sqlUtils[_0x93ad('0x14')](_0x441b28,_0x3b05ee,_0x43bce6);})['then'](function(_0x27f7dd){_0x48b2f0[_0x93ad('0x15')]=_0x27f7dd;return _0x48b2f0;})[_0x93ad('0x16')](function(_0x59dcca){throw _0x59dcca;});};exports[_0x93ad('0x17')]=function(){var _0xd99887={};var _0x4c6060=[];return db[_0x93ad('0x18')][_0x93ad('0x17')]()[_0x93ad('0x3')](function(_0x5677a5){_0xd99887=_0x5677a5;var _0x436d61=Object[_0x93ad('0x19')](_0xd99887)[_0x93ad('0xa')](function(_0x506b87){return _[_0x93ad('0x1a')](_0x506b87,'cf_')?_0x506b87:undefined;});var _0x1936a3=_0x436d61[_0x93ad('0x1b')](function(_0x1db567){return db['CmCustomField']['findOne']({'where':{'id':_0x1db567[_0x93ad('0x1c')](0x3)},'raw':!![]});});return Promise[_0x93ad('0x1d')](_0x1936a3);})[_0x93ad('0x3')](function(_0x1d3337){for(var _0x344908=0x0;_0x344908<_0x1d3337['length'];_0x344908++){if(_0x1d3337[_0x344908]){var _0x444b66=_0x93ad('0x1e')+_0x1d3337[_0x344908]['id'];_0xd99887[_0x444b66][_0x93ad('0x1f')]=_0x1d3337[_0x344908][_0x93ad('0x20')];}}_0x4c6060=_[_0x93ad('0x1b')](Object[_0x93ad('0x19')](_0xd99887),function(_0x269d62){return{'name':_0x269d62,'type':_0xd99887[_0x269d62][_0x93ad('0x20')]};});return _0x4c6060;})[_0x93ad('0x16')](function(_0x3d8a59){throw _0x3d8a59;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 10c0836..6951ceb 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 _0x99a2=['parseSearch','conditions','length','find','name','fieldType','castTo','buildExpression','type','text','value','start','end','Tag','tags','clause','and','ids','user','uc.UserId\x20=\x20?','keys','map','some','compact','Contact','push','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.id','limit','offset','group','subqry.id','having','order','subqry.','DESC','findAll','color','keyBy','Sequelize','SELECT','CmContact','query','Tags','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','QueryTypes','toString','exports','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','left_join','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?'];(function(_0x5d7e52,_0x7c228c){var _0x31d265=function(_0xf66218){while(--_0xf66218){_0x5d7e52['push'](_0x5d7e52['shift']());}};_0x31d265(++_0x7c228c);}(_0x99a2,0xab));var _0x299a=function(_0x51677a,_0x4761d4){_0x51677a=_0x51677a-0x0;var _0x1b1fe2=_0x99a2[_0x51677a];return _0x1b1fe2;};'use strict';var _=require('lodash');var squel=require(_0x299a('0x0'));var as=require(_0x299a('0x1'));var qs=require('../parsers/qs');var utils=require(_0x299a('0x2'));var db=require(_0x299a('0x3'))['db'];function skipContactsQuery(_0x1270fb,_0x56d878){var _0x15eaab=![];if(_0x1270fb[_0x299a('0x4')]===_0x299a('0x5')&&!_0x56d878[_0x299a('0x6')]&&!_0x56d878[_0x299a('0x7')]&&_0x56d878[_0x299a('0x8')]!==_0x299a('0x9')){_0x15eaab=!![];}return _0x15eaab;}function getContactsSubquery(){return squel[_0x299a('0xa')]()[_0x299a('0xb')](_0x299a('0xc'),'c')[_0x299a('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x25053e,_0x3dd660){var _0x33ec22=_0x3dd660?'c':_0x299a('0xe');_0x25053e[_0x299a('0xf')]('cm_user_has_contacts','uc',_0x299a('0x10')+_0x33ec22+'.id')[_0x299a('0xf')](_0x299a('0x11'),'ct',_0x299a('0x12')+_0x33ec22+_0x299a('0x13'))[_0x299a('0xf')]('tools_tags','t',_0x299a('0x14'));return _0x25053e;}function addFieldsToQuery(_0x50efdd,_0x3f5b37,_0x6eeb1d,_0x34efcd,_0x338e36){var _0x25ccf2=_0x338e36?'c':_0x299a('0xe');if(!_0x3f5b37){_0x3f5b37=['id',_0x299a('0x15'),_0x299a('0x16'),_0x299a('0x17'),_0x299a('0x18'),_0x299a('0x19'),_0x299a('0x1a'),'ListId',_0x299a('0x1b'),_0x299a('0x1c'),'updatedAt',_0x299a('0x1d'),'TagIds'];}else if(!_0x3f5b37['includes']('id')){_0x3f5b37['push']('id');}var _0x33e671=_0x6eeb1d&&_0x338e36||!_0x6eeb1d&&!_0x338e36;if(_0x34efcd){_0x33e671=_0x34efcd&&_0x338e36||!_0x34efcd&&!_0x338e36;}_0x3f5b37[_0x299a('0x1e')](function(_0x3b83b6){if(_0x3b83b6===_0x299a('0x1f')){if(_0x33e671){_0x50efdd[_0x299a('0x20')](_0x299a('0x21'),_0x3b83b6);}else if(_0x6eeb1d||_0x34efcd){_0x50efdd[_0x299a('0x20')](_0x25ccf2+'.'+_0x3b83b6);}}else{_0x50efdd[_0x299a('0x20')](_0x25ccf2+'.'+_0x3b83b6);}});return _0x50efdd;}function getSqlClauses(){var _0x3d0af4={'default':squel[_0x299a('0x22')](),'fields':squel['expr'](),'filter':squel[_0x299a('0x22')](),'tags':{'clause':squel[_0x299a('0x22')](),'ids':null},'user':{'clause':squel[_0x299a('0x22')](),'skip':![]}};return _0x3d0af4;}function parseTagParameter(_0x1b543e){var _0x42ec8d=squel[_0x299a('0x22')]();if(_0x1b543e){var _0x37a87f=utils['getSelectedTags'](_0x1b543e);_0x37a87f[_0x299a('0x1e')](function(_0x5a7a35){_0x42ec8d['or'](_0x299a('0x23'),'%,'+_0x5a7a35+',%');});}return _0x42ec8d;}function parseSearchFilter(_0x4ca3c5){var _0x5a8843=squel[_0x299a('0x22')]();if(_0x4ca3c5){var _0x3a1b20=_0x4ca3c5[_0x299a('0x24')]('\x5c','\x5c\x5c')[_0x299a('0x24')](/'/g,'\x27\x27');if(_0x3a1b20[_0x299a('0x25')]('\x20')['length']>0x1){_0x5a8843['or'](_0x299a('0x26'),qs[_0x299a('0x27')](_0x3a1b20,!![]),null);}else{if(qs['isNumeric'](_0x3a1b20)){_0x5a8843['or'](_0x299a('0x28'),_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x29'),_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2a'),_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2b'),_0x3a1b20+'%');}else if(qs['isEmail'](_0x3a1b20)){_0x5a8843['or'](_0x299a('0x2c'),_0x3a1b20+'%');}else{_0x5a8843['or'](_0x299a('0x2d'),'%'+_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2e'),'%'+_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2c'),'%'+_0x3a1b20+'%');}}}return _0x5a8843;}function parseAdvancedSearchFilter(_0x37d9b5,_0xe484aa){var _0x1191f6=getSqlClauses();var _0x28f5de=as[_0x299a('0x2f')](_0x37d9b5);var _0x43d671=_0x28f5de['sqlOperator'];for(var _0x593c93=0x0;_0x593c93<_0x28f5de[_0x299a('0x30')][_0x299a('0x31')];_0x593c93++){var _0x316ba0=_0x28f5de[_0x299a('0x30')][_0x593c93];var _0x1cc2f5='c';var _0xcce628=_[_0x299a('0x32')](_0xe484aa,[_0x299a('0x33'),_0x316ba0[_0x299a('0x20')]]);if(_0xcce628){if(_0x316ba0[_0x299a('0x20')]==='dateOfBirth'||_0xcce628[_0x299a('0x34')]==='datetime'){_0x316ba0[_0x299a('0x35')]='DATE';}var _0x46e1b4=as[_0x299a('0x36')](_0x1cc2f5,_0xcce628[_0x299a('0x37')],_0x316ba0);_0x1191f6['default'][_0x43d671](_0x46e1b4[_0x299a('0x38')],_0x46e1b4[_0x299a('0x39')][_0x299a('0x3a')],_0x46e1b4['value'][_0x299a('0x3b')]);}else{if(_0x316ba0['field']===_0x299a('0x3c')){var _0x54c5e9=_0x316ba0[_0x299a('0x39')][_0x299a('0x25')](',')['map'](function(_0x5561b5){return Number(_0x5561b5);});var _0x5ef0f1=parseTagParameter(_0x54c5e9);_0x1191f6[_0x299a('0x3d')][_0x299a('0x3e')][_0x299a('0x3f')](_0x5ef0f1);_0x1191f6['tags'][_0x299a('0x40')]=_0x54c5e9;}else if(_0x316ba0[_0x299a('0x20')]==='User'){_0x1191f6[_0x299a('0x41')][_0x299a('0x3e')]['and'](_0x299a('0x42'),_0x316ba0[_0x299a('0x39')]);_0x1191f6[_0x299a('0x41')]['skip']=!![];}}}return _0x1191f6;}function parseModelFields(_0x1079f3,_0xc23d1b){var _0x332b4f=squel['expr']();var _0x34dc01=_(_0x1079f3)[_0x299a('0x43')]()[_0x299a('0x44')](function(_0x11c256){return _[_0x299a('0x45')](_0xc23d1b,['name',_0x11c256])?_0x11c256:undefined;})[_0x299a('0x46')]()[_0x299a('0x39')]();if(_0x1079f3[_0x299a('0x47')]){_0x34dc01[_0x299a('0x48')](_0x299a('0x47'));}if(_0x1079f3[_0x299a('0x49')]){_0x34dc01[_0x299a('0x48')](_0x299a('0x49'));}if(_0x34dc01['length']>0x0){_0x34dc01[_0x299a('0x1e')](function(_0x24c9fd){if(_0x24c9fd===_0x299a('0x7')){_0x332b4f['and'](_0x299a('0x4a'),[][_0x299a('0x4b')](_0x1079f3[_0x24c9fd]));}else if(_0x24c9fd===_0x299a('0x47')){var _0x272336='%'+_0x1079f3[_0x24c9fd]+'%';_0x332b4f['and'](_0x299a('0x4c'),_0x272336);}else if(_0x24c9fd==='User'){_0x332b4f[_0x299a('0x3f')](_0x299a('0x42'),_0x1079f3[_0x24c9fd]);}else{_0x332b4f['and']('c.'+_0x24c9fd+_0x299a('0x4d'),_0x1079f3[_0x24c9fd]);}});}return _0x332b4f;}function parseQueryParameters(_0x4cfb1e,_0x5e5425){var _0x49ab11=getSqlClauses();return Promise[_0x299a('0x4e')]()['then'](function(){return parseModelFields(_0x4cfb1e,_0x5e5425);})[_0x299a('0x4f')](function(_0x5989ad){_0x49ab11[_0x299a('0x50')][_0x299a('0x3f')](_0x5989ad);return parseTagParameter(_0x4cfb1e[_0x299a('0x51')]);})['then'](function(_0x1e59f5){_0x49ab11[_0x299a('0x3d')][_0x299a('0x3e')]['and'](_0x1e59f5);return parseSearchFilter(_0x4cfb1e['filter']);})[_0x299a('0x4f')](function(_0x311718){_0x49ab11[_0x299a('0x52')]=_0x311718;return _0x49ab11;});}function checkListsRestrictions(_0x17ba87,_0x28b031,_0x48a8df){var _0x4254ba=squel[_0x299a('0x22')]();return Promise['resolve']()[_0x299a('0x4f')](function(){if(_0x28b031[_0x299a('0x6')]&&_0x17ba87[_0x299a('0x4')]===_0x299a('0x5')&&!_0x48a8df){return _0x17ba87[_0x299a('0x53')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x2d6e6a){if(_0x2d6e6a){if(_0x2d6e6a[_0x299a('0x31')]===0x0){_0x4254ba[_0x299a('0x3f')](_0x299a('0x54'));}else{_0x4254ba[_0x299a('0x3f')]('c.ListId\x20IN\x20?',_[_0x299a('0x44')](_0x2d6e6a,'id'));}}})['then'](function(){return _0x4254ba;});}function buildContactsQuery(_0x2dd4c9,_0x487e7,_0x38849c,_0x17e8d1,_0x5c3b72,_0x562d61){if(_0x487e7){_0x487e7=_0x38849c['attributes'];}_0x2dd4c9=addFieldsToQuery(_0x2dd4c9,_0x487e7,_0x17e8d1,_0x562d61,!![]);var _0x46a1f7=squel[_0x299a('0xa')]();_0x46a1f7=addFieldsToQuery(_0x46a1f7,_0x487e7,_0x17e8d1,_0x562d61,![]);if(_0x17e8d1||_0x562d61){_0x2dd4c9=applyJoinClauses(_0x2dd4c9,!![]);_0x2dd4c9['group'](_0x299a('0x55'));if(_0x38849c[_0x299a('0x56')]){_0x46a1f7[_0x299a('0x56')](_0x38849c[_0x299a('0x56')]);}if(_0x38849c['offset']){_0x46a1f7[_0x299a('0x57')](_0x38849c['offset']);}}else{_0x46a1f7=applyJoinClauses(_0x46a1f7,![]);_0x46a1f7[_0x299a('0x58')](_0x299a('0x59'));if(_0x38849c[_0x299a('0x56')]){_0x2dd4c9[_0x299a('0x56')](_0x38849c['limit']);}if(_0x38849c['offset']){_0x2dd4c9[_0x299a('0x57')](_0x38849c[_0x299a('0x57')]);}}_0x46a1f7[_0x299a('0x5a')](_0x5c3b72);if(_0x38849c['order']){_0x38849c[_0x299a('0x5b')][_0x299a('0x1e')](function(_0x378db6){_0x2dd4c9[_0x299a('0x5b')]('c.'+_0x378db6[0x0],_0x378db6[0x1]==='DESC'?![]:!![]);_0x46a1f7[_0x299a('0x5b')](_0x299a('0x5c')+_0x378db6[0x0],_0x378db6[0x1]===_0x299a('0x5d')?![]:!![]);});}_0x46a1f7[_0x299a('0xb')](_0x2dd4c9,_0x299a('0xe'));return _0x46a1f7;}function getFilteredContacts(_0x51fc74){var _0x43357f=[];return db[_0x299a('0x3c')][_0x299a('0x5e')]({'attributes':['id',_0x299a('0x33'),_0x299a('0x5f')],'raw':!![]})[_0x299a('0x4f')](function(_0x4b1bb3){_0x43357f=_[_0x299a('0x60')](_0x4b1bb3,'id');var _0x514e8a={'type':db[_0x299a('0x61')]['QueryTypes'][_0x299a('0x62')],'model':db[_0x299a('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x299a('0x64')](_0x51fc74['toString'](),_0x514e8a);})['then'](function(_0x5b7e97){_0x5b7e97[_0x299a('0x1e')](function(_0x24f367){if(_0x24f367[_0x299a('0x1f')]){_0x24f367[_0x299a('0x65')]=[];_0x24f367[_0x299a('0x1f')]['split'](',')['forEach'](function(_0x35196f){_0x24f367['Tags'][_0x299a('0x48')](_0x43357f[_0x35196f]);});}delete _0x24f367['TagIds'];});return _0x5b7e97;});}function countFilteredContacts(_0x78c06,_0x351b42){var _0x1baa06=_0x78c06['clone']();_0x1baa06[_0x299a('0x20')](_0x299a('0x66'));_0x1baa06=applyJoinClauses(_0x1baa06,!![]);_0x78c06[_0x299a('0x58')]('c.id');var _0xe012df=utils[_0x299a('0x67')](_0x351b42);if(!_[_0x299a('0x68')](_0xe012df)){_0x1baa06[_0x299a('0xd')](_0x299a('0x69'),_0xe012df);}var _0x12444b={'type':db[_0x299a('0x61')][_0x299a('0x6a')][_0x299a('0x62')],'raw':!![]};return db['sequelize'][_0x299a('0x64')](_0x1baa06[_0x299a('0x6b')](),_0x12444b)[_0x299a('0x4f')](function(_0x591227){return _0x591227[0x0][_0x299a('0x66')];});}module[_0x299a('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x4855=['replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','castTo','type','default','value','start','Tag','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','map','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','tag','filter','resolve','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','from','findAll','color','keyBy','Sequelize','SELECT','CmContact','toString','Tags','push','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','sequelize','query','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','cm_contacts','where','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?'];(function(_0x5bd60b,_0x2b405e){var _0x439a92=function(_0x331573){while(--_0x331573){_0x5bd60b['push'](_0x5bd60b['shift']());}};_0x439a92(++_0x2b405e);}(_0x4855,0xc1));var _0x5485=function(_0x4d560a,_0x48d9dd){_0x4d560a=_0x4d560a-0x0;var _0x368b51=_0x4855[_0x4d560a];return _0x368b51;};'use strict';var _=require('lodash');var squel=require(_0x5485('0x0'));var as=require(_0x5485('0x1'));var qs=require(_0x5485('0x2'));var utils=require(_0x5485('0x3'));var db=require(_0x5485('0x4'))['db'];function skipContactsQuery(_0x4b62c1,_0x3f2994){var _0x44c360=![];if(_0x4b62c1[_0x5485('0x5')]===_0x5485('0x6')&&!_0x3f2994[_0x5485('0x7')]&&!_0x3f2994[_0x5485('0x8')]&&_0x3f2994[_0x5485('0x9')]!==_0x5485('0xa')){_0x44c360=!![];}return _0x44c360;}function getContactsSubquery(){return squel[_0x5485('0xb')]()['from'](_0x5485('0xc'),'c')[_0x5485('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x233df9,_0x4fa1f2){var _0x1efa00=_0x4fa1f2?'c':_0x5485('0xe');_0x233df9[_0x5485('0xf')](_0x5485('0x10'),'uc','uc.CmContactId\x20=\x20'+_0x1efa00+_0x5485('0x11'))[_0x5485('0xf')](_0x5485('0x12'),'ct',_0x5485('0x13')+_0x1efa00+_0x5485('0x11'))['left_join'](_0x5485('0x14'),'t',_0x5485('0x15'));return _0x233df9;}function addFieldsToQuery(_0x4e3b47,_0x5e6336,_0x100a5e,_0x2cdef1,_0x2bd5b6){var _0x759b6f=_0x2bd5b6?'c':_0x5485('0xe');if(!_0x5e6336){_0x5e6336=['id','firstName',_0x5485('0x16'),_0x5485('0x17'),_0x5485('0x18'),_0x5485('0x19'),_0x5485('0x1a'),_0x5485('0x8'),_0x5485('0x1b'),_0x5485('0x1c'),_0x5485('0x1d'),_0x5485('0x1e'),'TagIds'];}else if(!_0x5e6336[_0x5485('0x1f')]('id')){_0x5e6336['push']('id');}var _0x3b8788=_0x100a5e&&_0x2bd5b6||!_0x100a5e&&!_0x2bd5b6;if(_0x2cdef1){_0x3b8788=_0x2cdef1&&_0x2bd5b6||!_0x2cdef1&&!_0x2bd5b6;}_0x5e6336[_0x5485('0x20')](function(_0x348f50){if(_0x348f50===_0x5485('0x21')){if(_0x3b8788){_0x4e3b47[_0x5485('0x22')](_0x5485('0x23'),_0x348f50);}else if(_0x100a5e||_0x2cdef1){_0x4e3b47[_0x5485('0x22')](_0x759b6f+'.'+_0x348f50);}}else{_0x4e3b47[_0x5485('0x22')](_0x759b6f+'.'+_0x348f50);}});return _0x4e3b47;}function getSqlClauses(){var _0x15f146={'default':squel[_0x5485('0x24')](),'fields':squel[_0x5485('0x24')](),'filter':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x5485('0x24')](),'skip':![]}};return _0x15f146;}function parseTagParameter(_0x4df477){var _0x51576d=squel['expr']();if(_0x4df477){var _0x46cc5b=utils[_0x5485('0x25')](_0x4df477);_0x46cc5b[_0x5485('0x20')](function(_0x1b0a20){_0x51576d['or'](_0x5485('0x26'),'%,'+_0x1b0a20+',%');});}return _0x51576d;}function parseSearchFilter(_0x33b9ca){var _0x3dfe53=squel['expr']();if(_0x33b9ca){var _0x4d2e52=_0x33b9ca[_0x5485('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x4d2e52[_0x5485('0x28')]('\x20')['length']>0x1){_0x3dfe53['or'](_0x5485('0x29'),qs[_0x5485('0x2a')](_0x4d2e52,!![]),null);}else{if(qs[_0x5485('0x2b')](_0x4d2e52)){_0x3dfe53['or'](_0x5485('0x2c'),_0x4d2e52+'%');_0x3dfe53['or'](_0x5485('0x2d'),_0x4d2e52+'%');_0x3dfe53['or'](_0x5485('0x2e'),_0x4d2e52+'%');_0x3dfe53['or'](_0x5485('0x2f'),_0x4d2e52+'%');}else if(qs[_0x5485('0x30')](_0x4d2e52)){_0x3dfe53['or'](_0x5485('0x31'),_0x4d2e52+'%');}else{_0x3dfe53['or']('c.firstName\x20LIKE\x20?','%'+_0x4d2e52+'%');_0x3dfe53['or'](_0x5485('0x32'),'%'+_0x4d2e52+'%');_0x3dfe53['or'](_0x5485('0x31'),'%'+_0x4d2e52+'%');}}}return _0x3dfe53;}function parseAdvancedSearchFilter(_0x6f787f,_0xfb948){var _0x2697a2=getSqlClauses();var _0xbc6f71=as[_0x5485('0x33')](_0x6f787f);var _0x2e4c0e=_0xbc6f71[_0x5485('0x34')];for(var _0x19a099=0x0;_0x19a099<_0xbc6f71[_0x5485('0x35')][_0x5485('0x36')];_0x19a099++){var _0x45ae4c=_0xbc6f71[_0x5485('0x35')][_0x19a099];var _0x2f1873='c';var _0x2e8767=_[_0x5485('0x37')](_0xfb948,[_0x5485('0x38'),_0x45ae4c[_0x5485('0x22')]]);if(_0x2e8767){if(_0x45ae4c['field']===_0x5485('0x39')||_0x2e8767[_0x5485('0x3a')]==='datetime'){_0x45ae4c[_0x5485('0x3b')]='DATE';}var _0x4e6da3=as['buildExpression'](_0x2f1873,_0x2e8767[_0x5485('0x3c')],_0x45ae4c);_0x2697a2[_0x5485('0x3d')][_0x2e4c0e](_0x4e6da3['text'],_0x4e6da3[_0x5485('0x3e')][_0x5485('0x3f')],_0x4e6da3['value']['end']);}else{if(_0x45ae4c['field']===_0x5485('0x40')){var _0xf2ba35=_0x45ae4c['value'][_0x5485('0x28')](',')['map'](function(_0x1c7128){return Number(_0x1c7128);});var _0x3f2447=parseTagParameter(_0xf2ba35);_0x2697a2[_0x5485('0x41')][_0x5485('0x42')][_0x5485('0x43')](_0x3f2447);_0x2697a2[_0x5485('0x41')][_0x5485('0x44')]=_0xf2ba35;}else if(_0x45ae4c[_0x5485('0x22')]===_0x5485('0x45')){_0x2697a2[_0x5485('0x46')][_0x5485('0x42')]['and'](_0x5485('0x47'),_0x45ae4c[_0x5485('0x3e')]);_0x2697a2['user'][_0x5485('0x48')]=!![];}}}return _0x2697a2;}function parseModelFields(_0x322415,_0x3ec178){var _0x540340=squel[_0x5485('0x24')]();var _0x30ae15=_(_0x322415)[_0x5485('0x49')]()[_0x5485('0x4a')](function(_0x3d9499){return _[_0x5485('0x4b')](_0x3ec178,['name',_0x3d9499])?_0x3d9499:undefined;})[_0x5485('0x4c')]()[_0x5485('0x3e')]();if(_0x322415['Contact']){_0x30ae15['push'](_0x5485('0x4d'));}if(_0x322415['User']){_0x30ae15['push']('User');}if(_0x30ae15[_0x5485('0x36')]>0x0){_0x30ae15['forEach'](function(_0xd34e86){if(_0xd34e86==='ListId'){_0x540340[_0x5485('0x43')](_0x5485('0x4e'),[][_0x5485('0x4f')](_0x322415[_0xd34e86]));}else if(_0xd34e86===_0x5485('0x4d')){var _0x4f1272='%'+_0x322415[_0xd34e86]+'%';_0x540340['and'](_0x5485('0x50'),_0x4f1272);}else if(_0xd34e86===_0x5485('0x45')){_0x540340[_0x5485('0x43')](_0x5485('0x47'),_0x322415[_0xd34e86]);}else{_0x540340[_0x5485('0x43')]('c.'+_0xd34e86+'\x20=\x20?',_0x322415[_0xd34e86]);}});}return _0x540340;}function parseQueryParameters(_0x52e3ea,_0x1a7325){var _0x5c57b7=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x52e3ea,_0x1a7325);})[_0x5485('0x51')](function(_0x46bcc8){_0x5c57b7[_0x5485('0x52')][_0x5485('0x43')](_0x46bcc8);return parseTagParameter(_0x52e3ea[_0x5485('0x53')]);})['then'](function(_0x18abb1){_0x5c57b7[_0x5485('0x41')][_0x5485('0x42')][_0x5485('0x43')](_0x18abb1);return parseSearchFilter(_0x52e3ea[_0x5485('0x54')]);})[_0x5485('0x51')](function(_0x5ca0e2){_0x5c57b7[_0x5485('0x54')]=_0x5ca0e2;return _0x5c57b7;});}function checkListsRestrictions(_0x4ab230,_0x724afd,_0x18a979){var _0x208515=squel['expr']();return Promise[_0x5485('0x55')]()['then'](function(){if(_0x724afd[_0x5485('0x7')]&&_0x4ab230['role']===_0x5485('0x6')&&!_0x18a979){return _0x4ab230[_0x5485('0x56')]({'attributes':['id'],'raw':!![]});}})[_0x5485('0x51')](function(_0x4ee2be){if(_0x4ee2be){if(_0x4ee2be[_0x5485('0x36')]===0x0){_0x208515[_0x5485('0x43')](_0x5485('0x57'));}else{_0x208515[_0x5485('0x43')]('c.ListId\x20IN\x20?',_[_0x5485('0x4a')](_0x4ee2be,'id'));}}})[_0x5485('0x51')](function(){return _0x208515;});}function buildContactsQuery(_0x46bbdb,_0x5bb8c7,_0x2d9431,_0x5b1184,_0x3399c8,_0x35d5d6){if(_0x5bb8c7){_0x5bb8c7=_0x2d9431[_0x5485('0x58')];}_0x46bbdb=addFieldsToQuery(_0x46bbdb,_0x5bb8c7,_0x5b1184,_0x35d5d6,!![]);var _0x1a4d2b=squel[_0x5485('0xb')]();_0x1a4d2b=addFieldsToQuery(_0x1a4d2b,_0x5bb8c7,_0x5b1184,_0x35d5d6,![]);if(_0x5b1184||_0x35d5d6){_0x46bbdb=applyJoinClauses(_0x46bbdb,!![]);_0x46bbdb[_0x5485('0x59')](_0x5485('0x5a'));if(_0x2d9431[_0x5485('0x5b')]){_0x1a4d2b[_0x5485('0x5b')](_0x2d9431[_0x5485('0x5b')]);}if(_0x2d9431[_0x5485('0x5c')]){_0x1a4d2b[_0x5485('0x5c')](_0x2d9431['offset']);}}else{_0x1a4d2b=applyJoinClauses(_0x1a4d2b,![]);_0x1a4d2b[_0x5485('0x59')](_0x5485('0x5d'));if(_0x2d9431[_0x5485('0x5b')]){_0x46bbdb[_0x5485('0x5b')](_0x2d9431[_0x5485('0x5b')]);}if(_0x2d9431[_0x5485('0x5c')]){_0x46bbdb['offset'](_0x2d9431[_0x5485('0x5c')]);}}_0x1a4d2b[_0x5485('0x5e')](_0x3399c8);if(_0x2d9431['order']){_0x2d9431['order']['forEach'](function(_0x41e7f0){_0x46bbdb[_0x5485('0x5f')]('c.'+_0x41e7f0[0x0],_0x41e7f0[0x1]===_0x5485('0x60')?![]:!![]);_0x1a4d2b[_0x5485('0x5f')](_0x5485('0x61')+_0x41e7f0[0x0],_0x41e7f0[0x1]===_0x5485('0x60')?![]:!![]);});}_0x1a4d2b[_0x5485('0x62')](_0x46bbdb,'subqry');return _0x1a4d2b;}function getFilteredContacts(_0x296c1d){var _0x1e2e24=[];return db['Tag'][_0x5485('0x63')]({'attributes':['id','name',_0x5485('0x64')],'raw':!![]})['then'](function(_0x55f056){_0x1e2e24=_[_0x5485('0x65')](_0x55f056,'id');var _0x4a286d={'type':db[_0x5485('0x66')]['QueryTypes'][_0x5485('0x67')],'model':db[_0x5485('0x68')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x296c1d[_0x5485('0x69')](),_0x4a286d);})[_0x5485('0x51')](function(_0x5c3052){_0x5c3052['forEach'](function(_0x8f51b5){if(_0x8f51b5[_0x5485('0x21')]){_0x8f51b5[_0x5485('0x6a')]=[];_0x8f51b5[_0x5485('0x21')][_0x5485('0x28')](',')[_0x5485('0x20')](function(_0x9bbdcb){_0x8f51b5[_0x5485('0x6a')][_0x5485('0x6b')](_0x1e2e24[_0x9bbdcb]);});}delete _0x8f51b5['TagIds'];});return _0x5c3052;});}function countFilteredContacts(_0x53880b,_0x34f74b){var _0x30271c=_0x53880b[_0x5485('0x6c')]();_0x30271c[_0x5485('0x22')](_0x5485('0x6d'));_0x30271c=applyJoinClauses(_0x30271c,!![]);_0x53880b[_0x5485('0x59')](_0x5485('0x5a'));var _0x22439e=utils[_0x5485('0x25')](_0x34f74b);if(!_[_0x5485('0x6e')](_0x22439e)){_0x30271c[_0x5485('0xd')](_0x5485('0x6f'),_0x22439e);}var _0xe23f39={'type':db[_0x5485('0x66')][_0x5485('0x70')][_0x5485('0x67')],'raw':!![]};return db[_0x5485('0x71')][_0x5485('0x72')](_0x30271c[_0x5485('0x69')](),_0xe23f39)[_0x5485('0x51')](function(_0x293779){return _0x293779[0x0]['COUNT(*)'];});}module[_0x5485('0x73')]={'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 64bcac7..d68bd6b 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 _0xbaee=['utf8','base64','decryptString','secret','createDecipher','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','encryptString'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbaee,0x186));var _0xebae=function(_0x11e651,_0x5fd7c3){_0x11e651=_0x11e651-0x0;var _0x2f77fb=_0xbaee[_0x11e651];return _0x2f77fb;};'use strict';var crypto=require(_0xebae('0x0'));var fs=require('fs');var BPromise=require(_0xebae('0x1'));var _=require(_0xebae('0x2'));var config=require(_0xebae('0x3'));var logger=require(_0xebae('0x4'))(_0xebae('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xebae('0x6')};if(config['encrypt']&&config[_0xebae('0x7')][_0xebae('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xebae('0x8')]);if(isSupported){fileOptions[_0xebae('0x8')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xebae('0x9')](config[_0xebae('0x7')][_0xebae('0x8')],_0xebae('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x32487c){return AES_SUPPORTED_RX[_0xebae('0xb')](_0x32487c);}function getSupportedCiphers(){return crypto[_0xebae('0xc')]()[_0xebae('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3eaf2d){return getSupportedCiphers()[_0xebae('0xe')](_0x3eaf2d)>-0x1;}function combineOptions(_0x61c364){var _0x250f38={};for(var _0x5be54c in fileOptions){if(fileOptions[_0xebae('0xf')](_0x5be54c)){_0x250f38[_0x5be54c]=fileOptions[_0x5be54c];}}if(_0x61c364){for(var _0x1e6196 in _0x61c364){if(_0x61c364[_0xebae('0xf')](_0x1e6196)){_0x250f38[_0x1e6196]=_0x61c364[_0x1e6196];}}}return _0x250f38;}exports[_0xebae('0x10')]=function(_0x77d04b,_0x251625,_0x201661,_0xeb74d6){return new BPromise(function(_0x5e031b,_0x100d02){_0xeb74d6=combineOptions(_0xeb74d6);var _0x4cfbd6=new Buffer(_0x201661);var _0x504e9b=fs[_0xebae('0x11')](_0x77d04b);var _0x722c5f=fs[_0xebae('0x12')](_0x251625);var _0x30a85f=crypto[_0xebae('0x13')](_0xeb74d6[_0xebae('0x8')],_0x4cfbd6);_0x504e9b['on'](_0xebae('0x14'),function(_0x14ee2a){var _0xfc35f8=new Buffer(_0x30a85f[_0xebae('0x15')](_0x14ee2a),_0xebae('0x16'));_0x722c5f[_0xebae('0x17')](_0xfc35f8);});_0x504e9b['on'](_0xebae('0x18'),function(){try{var _0x24a401=new Buffer(_0x30a85f[_0xebae('0x19')](_0xebae('0x16')),_0xebae('0x16'));_0x722c5f[_0xebae('0x17')](_0x24a401);_0x722c5f['end']();_0x722c5f['on'](_0xebae('0x1a'),function(){return _0x5e031b(_0x251625);});}catch(_0xd082a7){fs[_0xebae('0x1b')](_0x251625);return _0x100d02(_0xd082a7);}});});};exports[_0xebae('0x1c')]=function(_0x58d389,_0x594775,_0x3d98d6,_0x3b99d1){return new BPromise(function(_0x25e199,_0x1d96c6){_0x3b99d1=combineOptions(_0x3b99d1);var _0x1e3036=new Buffer(_0x3d98d6);var _0x5c4653=fs[_0xebae('0x11')](_0x58d389);var _0x566490=fs[_0xebae('0x12')](_0x594775);var _0x18af00=crypto['createDecipher'](_0x3b99d1['algorithm'],_0x1e3036);_0x5c4653['on'](_0xebae('0x14'),function(_0x197d49){var _0x14661d=new Buffer(_0x18af00[_0xebae('0x15')](_0x197d49),_0xebae('0x16'));_0x566490[_0xebae('0x17')](_0x14661d);});_0x5c4653['on']('end',function(){try{var _0x56473a=new Buffer(_0x18af00[_0xebae('0x19')](_0xebae('0x16')),'binary');_0x566490['write'](_0x56473a);_0x566490[_0xebae('0x18')]();_0x566490['on'](_0xebae('0x1a'),function(){return _0x25e199(_0x594775);});}catch(_0x9939f6){fs[_0xebae('0x1b')](_0x594775);return _0x1d96c6(_0x9939f6);}});});};exports[_0xebae('0x1d')]=function(_0x20af3b,_0x36a85d,_0x6e9ad1){var _0xacb78e=_0x6e9ad1||stringOptions[_0xebae('0x8')];var _0x5eaeff=_0x36a85d||stringOptions['secret'];var _0x232a9b=crypto[_0xebae('0x13')](_0xacb78e,_0x5eaeff);var _0x2a1f1c=_0x232a9b[_0xebae('0x15')](_0x20af3b,_0xebae('0x1e'),_0xebae('0x1f'));_0x2a1f1c+=_0x232a9b[_0xebae('0x19')](_0xebae('0x1f'));return _0x2a1f1c;};exports[_0xebae('0x20')]=function(_0x3c1271,_0x5e33e9,_0x37e820){var _0x252c20=_0x37e820||stringOptions[_0xebae('0x8')];var _0x358eaa=_0x5e33e9||stringOptions[_0xebae('0x21')];var _0x194325=crypto[_0xebae('0x22')](_0x252c20,_0x358eaa);var _0x2ac0bb=_0x194325[_0xebae('0x15')](_0x3c1271,_0xebae('0x1f'),_0xebae('0x1e'));_0x2ac0bb+=_0x194325['final']('utf8');return _0x2ac0bb;}; \ No newline at end of file +var _0x5d6e=['session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','write','final','binary','end','close','unlink','decryptFile','createDecipher','data','update','encryptString','base64','secret','utf8','crypto','bluebird','../../config/logger','app','secrets'];(function(_0x29dc61,_0x349f41){var _0x1b6b07=function(_0xe6e49f){while(--_0xe6e49f){_0x29dc61['push'](_0x29dc61['shift']());}};_0x1b6b07(++_0x349f41);}(_0x5d6e,0x1e5));var _0xe5d6=function(_0x179b68,_0x339d82){_0x179b68=_0x179b68-0x0;var _0x5e6d69=_0x5d6e[_0x179b68];return _0x5e6d69;};'use strict';var crypto=require(_0xe5d6('0x0'));var fs=require('fs');var BPromise=require(_0xe5d6('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0xe5d6('0x2'))(_0xe5d6('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xe5d6('0x4')][_0xe5d6('0x5')],'algorithm':_0xe5d6('0x6')};const fileOptions={'algorithm':_0xe5d6('0x7')};if(config[_0xe5d6('0x8')]&&config[_0xe5d6('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xe5d6('0x8')]['algorithm']);if(isSupported){fileOptions[_0xe5d6('0x9')]=config['encrypt'][_0xe5d6('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe5d6('0xa')](',\x20');logger['error'](config[_0xe5d6('0x8')]['algorithm'],_0xe5d6('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0xb20e62){return AES_SUPPORTED_RX[_0xe5d6('0xc')](_0xb20e62);}function getSupportedCiphers(){return crypto[_0xe5d6('0xd')]()[_0xe5d6('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0xe5f3af){return getSupportedCiphers()[_0xe5d6('0xf')](_0xe5f3af)>-0x1;}function combineOptions(_0xc8a7af){var _0x21dad2={};for(var _0x49b366 in fileOptions){if(fileOptions[_0xe5d6('0x10')](_0x49b366)){_0x21dad2[_0x49b366]=fileOptions[_0x49b366];}}if(_0xc8a7af){for(var _0xf6850b in _0xc8a7af){if(_0xc8a7af[_0xe5d6('0x10')](_0xf6850b)){_0x21dad2[_0xf6850b]=_0xc8a7af[_0xf6850b];}}}return _0x21dad2;}exports[_0xe5d6('0x11')]=function(_0x3955ab,_0x4c26ac,_0x1b58c2,_0x5dead1){return new BPromise(function(_0x295d95,_0x287846){_0x5dead1=combineOptions(_0x5dead1);var _0x461ded=new Buffer(_0x1b58c2);var _0x324506=fs[_0xe5d6('0x12')](_0x3955ab);var _0x3ff8e3=fs[_0xe5d6('0x13')](_0x4c26ac);var _0x47fd36=crypto[_0xe5d6('0x14')](_0x5dead1[_0xe5d6('0x9')],_0x461ded);_0x324506['on']('data',function(_0x241066){var _0xe6b8cd=new Buffer(_0x47fd36['update'](_0x241066),'binary');_0x3ff8e3[_0xe5d6('0x15')](_0xe6b8cd);});_0x324506['on']('end',function(){try{var _0x171ae9=new Buffer(_0x47fd36[_0xe5d6('0x16')](_0xe5d6('0x17')),'binary');_0x3ff8e3[_0xe5d6('0x15')](_0x171ae9);_0x3ff8e3[_0xe5d6('0x18')]();_0x3ff8e3['on'](_0xe5d6('0x19'),function(){return _0x295d95(_0x4c26ac);});}catch(_0x4bfd1d){fs[_0xe5d6('0x1a')](_0x4c26ac);return _0x287846(_0x4bfd1d);}});});};exports[_0xe5d6('0x1b')]=function(_0x3e789e,_0x432a82,_0x4f0f69,_0x4dde81){return new BPromise(function(_0x2fce7e,_0x8a24b3){_0x4dde81=combineOptions(_0x4dde81);var _0x78205e=new Buffer(_0x4f0f69);var _0x424490=fs[_0xe5d6('0x12')](_0x3e789e);var _0x420374=fs[_0xe5d6('0x13')](_0x432a82);var _0x40c514=crypto[_0xe5d6('0x1c')](_0x4dde81['algorithm'],_0x78205e);_0x424490['on'](_0xe5d6('0x1d'),function(_0x368459){var _0xcab19f=new Buffer(_0x40c514[_0xe5d6('0x1e')](_0x368459),_0xe5d6('0x17'));_0x420374['write'](_0xcab19f);});_0x424490['on'](_0xe5d6('0x18'),function(){try{var _0x4b3213=new Buffer(_0x40c514[_0xe5d6('0x16')]('binary'),'binary');_0x420374[_0xe5d6('0x15')](_0x4b3213);_0x420374[_0xe5d6('0x18')]();_0x420374['on']('close',function(){return _0x2fce7e(_0x432a82);});}catch(_0x467f05){fs[_0xe5d6('0x1a')](_0x432a82);return _0x8a24b3(_0x467f05);}});});};exports[_0xe5d6('0x1f')]=function(_0x5a32c8,_0x5965d1,_0xfcefca){var _0x27a751=_0xfcefca||stringOptions[_0xe5d6('0x9')];var _0x382d01=_0x5965d1||stringOptions['secret'];var _0x5ea247=crypto[_0xe5d6('0x14')](_0x27a751,_0x382d01);var _0x9e4616=_0x5ea247[_0xe5d6('0x1e')](_0x5a32c8,'utf8',_0xe5d6('0x20'));_0x9e4616+=_0x5ea247['final']('base64');return _0x9e4616;};exports['decryptString']=function(_0x5cf936,_0x48288c,_0x4a2df8){var _0x4213a5=_0x4a2df8||stringOptions[_0xe5d6('0x9')];var _0x2f49a2=_0x48288c||stringOptions[_0xe5d6('0x21')];var _0x15e92a=crypto[_0xe5d6('0x1c')](_0x4213a5,_0x2f49a2);var _0x105649=_0x15e92a[_0xe5d6('0x1e')](_0x5cf936,_0xe5d6('0x20'),'utf8');_0x105649+=_0x15e92a[_0xe5d6('0x16')](_0xe5d6('0x22'));return _0x105649;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 2c13063..5b925bd 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 _0xebb7=['%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','csv','catch','info','inspect','Failed','finally','exit','lodash','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Setting','split','splitSizeCsv','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','then','num','Empty','length','forEach'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xebb7,0x74));var _0x7ebb=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xebb7[_0x3ab9ee];return _0x82ee88;};'use strict';var util=require('util');var path=require('path');var _=require(_0x7ebb('0x0'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x7ebb('0x1'))[_0x7ebb('0x2')];var logger=require(_0x7ebb('0x3'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7ebb('0x4')][0x2]);var QUERY=process[_0x7ebb('0x4')][0x3];var PATH=process[_0x7ebb('0x4')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xab91bb,_0x4efeb2){var _0x1ddde2={'status':_0xab91bb};var _0x38a46e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4efeb2){_0x1ddde2[_0x7ebb('0x5')]=_0x4efeb2;}return db[_0x7ebb('0x6')][_0x7ebb('0x7')](_0x1ddde2,_0x38a46e);}function main(){var _0x151c2c=0x1388;var _0x12e41b;logger['info'](util[_0x7ebb('0x8')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x7ebb('0x9')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7ebb('0xa'),_0x7ebb('0xb')]})['then'](function(_0x416229){if(_0x416229){_0x12e41b=_0x416229;_0x151c2c=_0x12e41b['splitSizeCsv']||0x1388;}})['then'](function(){return dbH['sequelize'][_0x7ebb('0xc')](util['format'](_0x7ebb('0xd'),QUERY),{'type':dbH[_0x7ebb('0xe')][_0x7ebb('0xf')][_0x7ebb('0x10')]});})[_0x7ebb('0x11')](function(_0x4dfc28){if(!_0x4dfc28[0x0][_0x7ebb('0x12')]){return analyticExtractedReport(_0x7ebb('0x13'));}var _0x5459fd=[];var _0x505df5=0x0;if(_0x12e41b['split']){if(_0x4dfc28&&_0x4dfc28[_0x7ebb('0x14')]){var _0x2bf71b=_['range'](_0x4dfc28[0x0][_0x7ebb('0x12')]/_0x151c2c);var _0x1c1091=Number['isInteger'](_0x4dfc28[0x0][_0x7ebb('0x12')]/_0x151c2c)?_0x4dfc28[0x0][_0x7ebb('0x12')]%_0x151c2c:0x0;_0x2bf71b[_0x7ebb('0x15')](function(_0xdfb825){if(_0xdfb825>0x0){_0x505df5+=_0x151c2c;}_0x5459fd['push'](dbH[_0x7ebb('0xe')][_0x7ebb('0xc')](util['format'](_0x7ebb('0x16'),QUERY,_0x151c2c,_0x505df5),{'type':dbH[_0x7ebb('0xe')]['QueryTypes']['SELECT']}));});if(_0x1c1091>0x0){_0x505df5+=_0x151c2c;_0x5459fd[_0x7ebb('0x17')](dbH[_0x7ebb('0xe')][_0x7ebb('0xc')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c1091,_0x505df5),{'type':dbH[_0x7ebb('0xe')]['QueryTypes'][_0x7ebb('0x10')]}));}}}else{_0x5459fd[_0x7ebb('0x17')](dbH[_0x7ebb('0xe')][_0x7ebb('0xc')](QUERY,{'type':dbH['sequelize'][_0x7ebb('0xf')][_0x7ebb('0x10')]}));}var _0x515919=path[_0x7ebb('0x18')](PATH);var _0x337c93=path[_0x7ebb('0x19')](PATH,_0x7ebb('0x1a'));var _0x3b7f3a=_0x12e41b[_0x7ebb('0xa')]&&_0x5459fd[_0x7ebb('0x14')]>0x1;var _0x2d7a95=[];if(!fs[_0x7ebb('0x1b')](path[_0x7ebb('0x1c')](_0x515919,_0x337c93))&&_0x3b7f3a){fs[_0x7ebb('0x1d')](path[_0x7ebb('0x1c')](_0x515919,_0x337c93));}return BPromise[_0x7ebb('0x1e')](_0x5459fd,function(_0x290819){_0x2d7a95['push'](_0x290819);})['then'](function(){for(var _0x3ef850=0x0;_0x3ef850<_0x2d7a95[_0x7ebb('0x14')];_0x3ef850+=0x1){var _0x53a227;var _0x1b7457=_0x2d7a95[_0x3ef850];if(_0x3b7f3a){_0x53a227=path[_0x7ebb('0x1c')](_0x515919,_0x337c93,util['format'](_0x7ebb('0x1f'),_0x337c93,_0x3ef850,'csv'));}else{_0x53a227=path[_0x7ebb('0x1c')](_0x515919,util[_0x7ebb('0x8')](_0x7ebb('0x20'),_0x337c93,'csv'));}fs[_0x7ebb('0x21')](_0x53a227,csv(_0x1b7457));}})[_0x7ebb('0x11')](function(){if(_0x3b7f3a){return new Promise(function(_0x4891d9){zipdir(path[_0x7ebb('0x1c')](_0x515919,_0x337c93),{'saveTo':path[_0x7ebb('0x1c')](_0x515919,util[_0x7ebb('0x8')](_0x7ebb('0x20'),_0x337c93,'zip'))},function(_0x381ecd,_0x1772e1){rimraf(path[_0x7ebb('0x1c')](_0x515919,_0x337c93),function(){});_0x4891d9(_0x7ebb('0x22'));});});}})[_0x7ebb('0x11')](function(){logger['info'](util[_0x7ebb('0x8')](_0x7ebb('0x23'),EXTRACTED_REPORT_ID,_0x7ebb('0x24')));return analyticExtractedReport(_0x7ebb('0x25'),_0x3b7f3a?util[_0x7ebb('0x8')](_0x7ebb('0x20'),_0x337c93,_0x3b7f3a?_0x7ebb('0x26'):_0x7ebb('0x27')):null);});})[_0x7ebb('0x28')](function(_0x20c665){logger[_0x7ebb('0x29')](util[_0x7ebb('0x8')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7ebb('0x24')),util[_0x7ebb('0x2a')](_0x20c665,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7ebb('0x2b'));})[_0x7ebb('0x2c')](function(){process[_0x7ebb('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x33b7=['Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize','QueryTypes','SELECT','length','num','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','existsSync','join','csv','%s.%s','writeFileSync','zip','zip\x20finished','CSV'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x33b7,0x132));var _0x733b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x33b7[_0x37bd26];return _0xe83dc4;};'use strict';var util=require(_0x733b('0x0'));var path=require(_0x733b('0x1'));var _=require('lodash');var csv=require(_0x733b('0x2'));var fs=require('fs');var BPromise=require(_0x733b('0x3'));var zipdir=require(_0x733b('0x4'));var rimraf=require(_0x733b('0x5'));var db=require(_0x733b('0x6'))['db'];var dbH=require(_0x733b('0x6'))['dbH'];var logger=require(_0x733b('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x733b('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xe3b5a7,_0x1bf20c){var _0x9e1aac={'status':_0xe3b5a7};var _0x618c05={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1bf20c){_0x9e1aac[_0x733b('0x9')]=_0x1bf20c;}return db['AnalyticExtractedReport'][_0x733b('0xa')](_0x9e1aac,_0x618c05);}function main(){var _0x5dd44a=0x1388;var _0x130147;logger[_0x733b('0xb')](util[_0x733b('0xc')](_0x733b('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x733b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x733b('0xf'),_0x733b('0x10')]})['then'](function(_0x23f454){if(_0x23f454){_0x130147=_0x23f454;_0x5dd44a=_0x130147[_0x733b('0x10')]||0x1388;}})[_0x733b('0x11')](function(){return dbH[_0x733b('0x12')]['query'](util[_0x733b('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x733b('0x12')][_0x733b('0x13')][_0x733b('0x14')]});})[_0x733b('0x11')](function(_0x56eaef){if(!_0x56eaef[0x0]['num']){return analyticExtractedReport('Empty');}var _0x44f14b=[];var _0x1c4db2=0x0;if(_0x130147[_0x733b('0xf')]){if(_0x56eaef&&_0x56eaef[_0x733b('0x15')]){var _0x451802=_['range'](_0x56eaef[0x0][_0x733b('0x16')]/_0x5dd44a);var _0x15316a=Number[_0x733b('0x17')](_0x56eaef[0x0][_0x733b('0x16')]/_0x5dd44a)?_0x56eaef[0x0][_0x733b('0x16')]%_0x5dd44a:0x0;_0x451802[_0x733b('0x18')](function(_0x141359){if(_0x141359>0x0){_0x1c4db2+=_0x5dd44a;}_0x44f14b['push'](dbH[_0x733b('0x12')][_0x733b('0x19')](util['format'](_0x733b('0x1a'),QUERY,_0x5dd44a,_0x1c4db2),{'type':dbH['sequelize']['QueryTypes'][_0x733b('0x14')]}));});if(_0x15316a>0x0){_0x1c4db2+=_0x5dd44a;_0x44f14b['push'](dbH[_0x733b('0x12')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x15316a,_0x1c4db2),{'type':dbH[_0x733b('0x12')]['QueryTypes'][_0x733b('0x14')]}));}}}else{_0x44f14b[_0x733b('0x1b')](dbH[_0x733b('0x12')][_0x733b('0x19')](QUERY,{'type':dbH[_0x733b('0x12')]['QueryTypes'][_0x733b('0x14')]}));}var _0x1e57cb=path[_0x733b('0x1c')](PATH);var _0x4c718f=path[_0x733b('0x1d')](PATH,'.csv');var _0xca85af=_0x130147['split']&&_0x44f14b[_0x733b('0x15')]>0x1;var _0x3a975f=[];if(!fs[_0x733b('0x1e')](path['join'](_0x1e57cb,_0x4c718f))&&_0xca85af){fs['mkdirSync'](path['join'](_0x1e57cb,_0x4c718f));}return BPromise['each'](_0x44f14b,function(_0x4778fc){_0x3a975f[_0x733b('0x1b')](_0x4778fc);})[_0x733b('0x11')](function(){for(var _0x44e2a4=0x0;_0x44e2a4<_0x3a975f[_0x733b('0x15')];_0x44e2a4+=0x1){var _0x49b293;var _0x1c6610=_0x3a975f[_0x44e2a4];if(_0xca85af){_0x49b293=path[_0x733b('0x1f')](_0x1e57cb,_0x4c718f,util[_0x733b('0xc')]('%s%d.%s',_0x4c718f,_0x44e2a4,_0x733b('0x20')));}else{_0x49b293=path[_0x733b('0x1f')](_0x1e57cb,util['format'](_0x733b('0x21'),_0x4c718f,_0x733b('0x20')));}fs[_0x733b('0x22')](_0x49b293,csv(_0x1c6610));}})[_0x733b('0x11')](function(){if(_0xca85af){return new Promise(function(_0x23955e){zipdir(path['join'](_0x1e57cb,_0x4c718f),{'saveTo':path['join'](_0x1e57cb,util['format'](_0x733b('0x21'),_0x4c718f,_0x733b('0x23')))},function(_0x5b92fe,_0x4924ee){rimraf(path['join'](_0x1e57cb,_0x4c718f),function(){});_0x23955e(_0x733b('0x24'));});});}})[_0x733b('0x11')](function(){logger[_0x733b('0xb')](util[_0x733b('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x733b('0x25')));return analyticExtractedReport(_0x733b('0x26'),_0xca85af?util[_0x733b('0xc')](_0x733b('0x21'),_0x4c718f,_0xca85af?_0x733b('0x23'):_0x733b('0x20')):null);});})[_0x733b('0x27')](function(_0x2e204e){logger[_0x733b('0xb')](util['format'](_0x733b('0x28'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x2e204e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x733b('0x29'));})['finally'](function(){process[_0x733b('0x2a')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c16b442..a2465cf 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 _0x2f67=['lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','pageBreak','before','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','splitSizePdf','then','split','range','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','.pdf','existsSync','join','each','createPdfKitDocument','%s.%s','pdf','zip\x20finished','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2f67,0x10b));var _0x72f6=function(_0x1ad47f,_0x21db49){_0x1ad47f=_0x1ad47f-0x0;var _0x360dd2=_0x2f67[_0x1ad47f];return _0x360dd2;};'use strict';var _=require(_0x72f6('0x0'));var fs=require('fs');var util=require(_0x72f6('0x1'));var path=require(_0x72f6('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x72f6('0x3'));var PdfPrinter=require(_0x72f6('0x4'));var zipdir=require(_0x72f6('0x5'));var rimraf=require(_0x72f6('0x6'));var JSDOM=require(_0x72f6('0x7'))[_0x72f6('0x8')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x72f6('0x9'))['db'];var dbH=require('../../mysqldb')[_0x72f6('0xa')];var logger=require(_0x72f6('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x72f6('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x72f6('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x562972,_0x41facb){var _0x50f2cf={'status':_0x562972};var _0x4da30c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x41facb){_0x50f2cf[_0x72f6('0xe')]=_0x41facb;}return db[_0x72f6('0xf')][_0x72f6('0x10')](_0x50f2cf,_0x4da30c);}function getHeaders(_0x423a2b){return _['map'](_0x423a2b,function(_0xe10e6d){return{'text':_0xe10e6d,'style':'tableHeader'};});}function getRows(_0x5082e6,_0xc178a4){return _[_0x72f6('0x11')](_0xc178a4,function(_0xbedad6){return _(_0xbedad6)[_0x72f6('0x12')](_0x5082e6)[_0x72f6('0x11')](function(_0x370873){return _0x370873?_[_0x72f6('0x13')](_0x370873):'';})[_0x72f6('0x14')]();});}function createTable(_0x29b391,_0x5e5680){var _0x491176={'widths':_[_0x72f6('0x15')](Array(_0x29b391['length']),0x91),'heights':function(_0x5316a4){return _0x5316a4===0x0?_0x72f6('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2fb66b=getHeaders(_0x29b391);_0x491176[_0x72f6('0x17')][_0x72f6('0x18')](_0x2fb66b);var _0x32662=getRows(_0x29b391,_0x5e5680);_0x491176['body']=_0x491176[_0x72f6('0x17')][_0x72f6('0x19')](_0x32662);return _0x491176;}function createTables(_0x3f884c){var _0x209848=[];var _0x2f742f=_[_0x72f6('0x1a')](Object[_0x72f6('0x1b')](_0x3f884c[0x0]),0x5);_0x2f742f['forEach'](function(_0x1d7c93){_0x209848[_0x72f6('0x18')](createTable(_0x1d7c93,_0x3f884c));});return _0x209848;}function getPDFDocDefinition(_0x1bcd0c){var _0x512738=util[_0x72f6('0x1c')](_0x72f6('0x1d'),NAME,EXTRACTED_REPORT[_0x72f6('0x1e')],moment(EXTRACTED_REPORT[_0x72f6('0x1f')])[_0x72f6('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x72f6('0x20')])[_0x72f6('0x1c')](FORMAT));var _0x33bc1b=[];for(var _0x1bf25a=0x0;_0x1bf25a<_0x1bcd0c[_0x72f6('0x21')];_0x1bf25a++){var _0x34f81d=[];if(_0x1bf25a===0x0){_0x34f81d[_0x72f6('0x18')]({'text':_0x512738,'style':_0x72f6('0x22')});}var _0x15609b={'table':_0x1bcd0c[_0x1bf25a]};if(_0x1bf25a>0x0){_0x15609b[_0x72f6('0x23')]=_0x72f6('0x24');_0x15609b['margin']=[0x0,0x46,0x0,0x0];}_0x34f81d['push'](_0x15609b);_0x33bc1b[_0x72f6('0x18')](_0x34f81d);}return{'pageSize':'A4','pageOrientation':_0x72f6('0x25'),'content':_0x33bc1b,'footer':function(_0x2a205e,_0x1715a2){return{'text':_0x2a205e['toString']()+_0x72f6('0x26')+_0x1715a2,'style':_0x72f6('0x27')};},'defaultStyle':{'font':_0x72f6('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x72f6('0x29')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xdcd7e9){var _0x333b15=0x1388;var _0xec7415;if(!_0xdcd7e9[0x0][_0x72f6('0x2a')]){return analyticExtractedReport(_0x72f6('0x2b'));}return db[_0x72f6('0x2c')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x72f6('0x2d')]})[_0x72f6('0x2e')](function(_0x59c29c){if(_0x59c29c){_0xec7415=_0x59c29c;_0x333b15=_0xec7415[_0x72f6('0x2d')]||0x3e8;}})[_0x72f6('0x2e')](function(){var _0x49f9d2=[];var _0x12ea9f=0x0;if(_0xec7415[_0x72f6('0x2f')]){if(_0xdcd7e9&&_0xdcd7e9[_0x72f6('0x21')]){var _0x1c606c=_[_0x72f6('0x30')](_0xdcd7e9[0x0]['num']/_0x333b15);var _0x1cd7ac=Number[_0x72f6('0x31')](_0xdcd7e9[0x0][_0x72f6('0x2a')]/_0x333b15)?_0xdcd7e9[0x0]['num']%_0x333b15:0x0;_0x1c606c[_0x72f6('0x32')](function(_0x14f868){if(_0x14f868>0x0){_0x12ea9f+=_0x333b15;}_0x49f9d2[_0x72f6('0x18')](dbH[_0x72f6('0x33')][_0x72f6('0x34')](util[_0x72f6('0x1c')](_0x72f6('0x35'),QUERY,_0x333b15,_0x12ea9f),{'type':dbH[_0x72f6('0x33')]['QueryTypes'][_0x72f6('0x36')]}));});if(_0x1cd7ac>0x0){_0x12ea9f+=_0x333b15;_0x49f9d2[_0x72f6('0x18')](dbH['sequelize'][_0x72f6('0x34')](util[_0x72f6('0x1c')](_0x72f6('0x35'),QUERY,_0x1cd7ac,_0x12ea9f),{'type':dbH[_0x72f6('0x33')][_0x72f6('0x37')][_0x72f6('0x36')]}));}}}else{_0x49f9d2[_0x72f6('0x18')](dbH[_0x72f6('0x33')]['query'](QUERY,{'type':dbH[_0x72f6('0x33')][_0x72f6('0x37')][_0x72f6('0x36')]}));}var _0x4c68a9=path[_0x72f6('0x38')](PATH);var _0x29cd26=path['basename'](PATH,_0x72f6('0x39'));var _0x3a9a1d=_0xec7415['split']&&_0x49f9d2[_0x72f6('0x21')]>0x1;var _0x13f69b=[];if(!fs[_0x72f6('0x3a')](path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26))&&_0x3a9a1d){fs['mkdirSync'](path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26));}return BPromise[_0x72f6('0x3c')](_0x49f9d2,function(_0x47728d){_0x13f69b[_0x72f6('0x18')](_0x47728d);})[_0x72f6('0x2e')](function(){var _0x19e8b8=[];for(var _0x105b80=0x0;_0x105b80<_0x13f69b['length'];_0x105b80+=0x1){var _0x8133f8=_0x13f69b[_0x105b80];var _0x4bce1d=createTables(_['flatten'](_0x8133f8));var _0x13541f;var _0x14b06a=getPDFDocDefinition(_0x4bce1d);var _0x1c2d9a=getPDFPrinter();var _0x4fd43e=_0x1c2d9a[_0x72f6('0x3d')](_0x14b06a);if(_0x3a9a1d){_0x13541f=path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26,util[_0x72f6('0x1c')]('%s%d.%s',_0x29cd26,_0x105b80,'pdf'));}else{_0x13541f=path[_0x72f6('0x3b')](_0x4c68a9,util[_0x72f6('0x1c')](_0x72f6('0x3e'),_0x29cd26,_0x72f6('0x3f')));}_0x19e8b8['push'](writePDFDocument(_0x4fd43e,_0x13541f));}return Promise['all'](_0x19e8b8);})[_0x72f6('0x2e')](function(){if(_0x3a9a1d){return new Promise(function(_0x469174){zipdir(path['join'](_0x4c68a9,_0x29cd26),{'saveTo':path[_0x72f6('0x3b')](_0x4c68a9,util['format'](_0x72f6('0x3e'),_0x29cd26,'zip'))},function(){rimraf(path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26),function(){});_0x469174(_0x72f6('0x40'));});});}})['then'](function(){if(!_0x3a9a1d)return;rimraf(path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26),function(){});})['then'](function(){logger['info'](util[_0x72f6('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x72f6('0x41')));return analyticExtractedReport(_0x72f6('0x42'),_0x3a9a1d?util[_0x72f6('0x1c')](_0x72f6('0x3e'),_0x29cd26,_0x3a9a1d?'zip':_0x72f6('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x72f6('0x43')](util[_0x72f6('0x1c')](_0x72f6('0x44'),EXTRACTED_REPORT_ID,_0x72f6('0x41')));return db[_0x72f6('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x72f6('0x2e')](function(_0x1e9892){EXTRACTED_REPORT=_0x1e9892;return dbH[_0x72f6('0x33')][_0x72f6('0x34')](util[_0x72f6('0x1c')](_0x72f6('0x45'),QUERY),{'type':dbH[_0x72f6('0x33')][_0x72f6('0x37')]['SELECT']});})['then'](extractReport)['catch'](function(_0x346e5f){logger[_0x72f6('0x43')](util[_0x72f6('0x1c')](_0x72f6('0x46'),EXTRACTED_REPORT_ID,_0x72f6('0x41')),util['inspect'](_0x346e5f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x72f6('0x47'));})[_0x72f6('0x48')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x352539=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x72f6('0x49'),'italics':__dirname+_0x72f6('0x4a'),'bolditalics':__dirname+_0x72f6('0x4b')}});return _0x352539;}function getPDFDocDefinitionFromHTML(_0x3ed00b,_0x35fdd2){var _0x3d033c=util['format']('%s\x20#%d',_0x35fdd2[_0x72f6('0x4c')],_0x35fdd2[_0x72f6('0x4d')]);var _0x48e1b8=moment()[_0x72f6('0x1c')](_0x72f6('0x4e'))[_0x72f6('0x13')]();var _0x5ce818=htmlToPdfmake(_0x3ed00b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5ce818],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x72f6('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x72f6('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x72f6('0x4f')}},'header':function(){return[{'text':_0x72f6('0x50'),'style':_0x72f6('0x22')}];},'footer':function(_0x3cf1fb,_0x5b9dfa){return[{'text':util[_0x72f6('0x1c')](_0x72f6('0x51'),_0x3d033c,_0x3cf1fb,_0x5b9dfa,_0x48e1b8),'style':_0x72f6('0x27')}];}};}function writePDFDocument(_0x12c9bb,_0x4cf4d3){return new Promise(function(_0x311bb6,_0x5d7707){var _0x41a32f=_0x12c9bb[_0x72f6('0x52')](fs[_0x72f6('0x53')](_0x4cf4d3));_0x41a32f['on'](_0x72f6('0x54'),function(){_0x311bb6(_0x72f6('0x54'));});_0x41a32f['on'](_0x72f6('0x55'),function(_0x6d0f6a){_0x5d7707(_0x6d0f6a);});_0x12c9bb[_0x72f6('0x56')]();});}exports[_0x72f6('0x57')]=function(_0x40a6f4,_0x2f6276){var _0x5205af=getPDFPrinter();var _0x4b9d11=getPDFDocDefinitionFromHTML(_0x40a6f4,_0x2f6276);var _0x1ca6de=_0x5205af[_0x72f6('0x3d')](_0x4b9d11);return writePDFDocument(_0x1ca6de,_0x2f6276[_0x72f6('0x2')])[_0x72f6('0x58')](function(_0x100872){throw _0x100872;});}; \ No newline at end of file +var _0x8e77=['lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','auto','body','push','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','before','margin','landscape','footer','Arial','black','right','Empty','Setting','find','split','then','splitSizePdf','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','sequelize','dirname','.pdf','existsSync','mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','createPdfKitDocument','path'];(function(_0x276c22,_0x16b9f5){var _0x609740=function(_0x2b18c7){while(--_0x2b18c7){_0x276c22['push'](_0x276c22['shift']());}};_0x609740(++_0x16b9f5);}(_0x8e77,0x114));var _0x78e7=function(_0x42ab91,_0x2a0179){_0x42ab91=_0x42ab91-0x0;var _0x259d35=_0x8e77[_0x42ab91];return _0x259d35;};'use strict';var _=require(_0x78e7('0x0'));var fs=require('fs');var util=require(_0x78e7('0x1'));var path=require('path');var moment=require(_0x78e7('0x2'));var htmlToPdfmake=require(_0x78e7('0x3'));var PdfPrinter=require(_0x78e7('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x78e7('0x5'))['JSDOM'];var window=new JSDOM('')[_0x78e7('0x6')];var BPromise=require(_0x78e7('0x7'));var db=require(_0x78e7('0x8'))['db'];var dbH=require(_0x78e7('0x8'))[_0x78e7('0x9')];var logger=require(_0x78e7('0xa'))(_0x78e7('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x78e7('0xc')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x78e7('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x78e7('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a1cae,_0x4b6796){var _0x34744f={'status':_0x2a1cae};var _0x7f9f2f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4b6796){_0x34744f['savename']=_0x4b6796;}return db[_0x78e7('0xe')][_0x78e7('0xf')](_0x34744f,_0x7f9f2f);}function getHeaders(_0x325dae){return _[_0x78e7('0x10')](_0x325dae,function(_0x4d0176){return{'text':_0x4d0176,'style':_0x78e7('0x11')};});}function getRows(_0x31314e,_0x2ddb5a){return _['map'](_0x2ddb5a,function(_0x4acd78){return _(_0x4acd78)[_0x78e7('0x12')](_0x31314e)[_0x78e7('0x10')](function(_0x57edbf){return _0x57edbf?_[_0x78e7('0x13')](_0x57edbf):'';})[_0x78e7('0x14')]();});}function createTable(_0x4c2974,_0x343003){var _0x5967dc={'widths':_[_0x78e7('0x15')](Array(_0x4c2974['length']),0x91),'heights':function(_0x8f86b8){return _0x8f86b8===0x0?_0x78e7('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x436da9=getHeaders(_0x4c2974);_0x5967dc[_0x78e7('0x17')][_0x78e7('0x18')](_0x436da9);var _0x1edef9=getRows(_0x4c2974,_0x343003);_0x5967dc[_0x78e7('0x17')]=_0x5967dc[_0x78e7('0x17')]['concat'](_0x1edef9);return _0x5967dc;}function createTables(_0x12cea6){var _0x4cb2c8=[];var _0xe32fff=_[_0x78e7('0x19')](Object['keys'](_0x12cea6[0x0]),0x5);_0xe32fff[_0x78e7('0x1a')](function(_0x163a05){_0x4cb2c8[_0x78e7('0x18')](createTable(_0x163a05,_0x12cea6));});return _0x4cb2c8;}function getPDFDocDefinition(_0xab62d8){var _0xd8996e=util[_0x78e7('0x1b')](_0x78e7('0x1c'),NAME,EXTRACTED_REPORT[_0x78e7('0x1d')],moment(EXTRACTED_REPORT[_0x78e7('0x1e')])[_0x78e7('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x78e7('0x1f')])['format'](FORMAT));var _0xb685b9=[];for(var _0x8a4238=0x0;_0x8a4238<_0xab62d8[_0x78e7('0x20')];_0x8a4238++){var _0x213ebd=[];if(_0x8a4238===0x0){_0x213ebd['push']({'text':_0xd8996e,'style':_0x78e7('0x21')});}var _0x568f92={'table':_0xab62d8[_0x8a4238]};if(_0x8a4238>0x0){_0x568f92['pageBreak']=_0x78e7('0x22');_0x568f92[_0x78e7('0x23')]=[0x0,0x46,0x0,0x0];}_0x213ebd[_0x78e7('0x18')](_0x568f92);_0xb685b9[_0x78e7('0x18')](_0x213ebd);}return{'pageSize':'A4','pageOrientation':_0x78e7('0x24'),'content':_0xb685b9,'footer':function(_0x48e1fa,_0x217a31){return{'text':_0x48e1fa['toString']()+'\x20/\x20'+_0x217a31,'style':_0x78e7('0x25')};},'defaultStyle':{'font':_0x78e7('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x78e7('0x27')},'footer':{'alignment':_0x78e7('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3351ab){var _0x1cd5a1=0x1388;var _0x545b13;if(!_0x3351ab[0x0]['num']){return analyticExtractedReport(_0x78e7('0x29'));}return db[_0x78e7('0x2a')][_0x78e7('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x78e7('0x2c'),'splitSizePdf']})[_0x78e7('0x2d')](function(_0x2c5dd5){if(_0x2c5dd5){_0x545b13=_0x2c5dd5;_0x1cd5a1=_0x545b13[_0x78e7('0x2e')]||0x3e8;}})[_0x78e7('0x2d')](function(){var _0x221a52=[];var _0x48e81f=0x0;if(_0x545b13['split']){if(_0x3351ab&&_0x3351ab[_0x78e7('0x20')]){var _0x582184=_['range'](_0x3351ab[0x0][_0x78e7('0x2f')]/_0x1cd5a1);var _0x596ca5=Number['isInteger'](_0x3351ab[0x0][_0x78e7('0x2f')]/_0x1cd5a1)?_0x3351ab[0x0]['num']%_0x1cd5a1:0x0;_0x582184[_0x78e7('0x1a')](function(_0x22dbd4){if(_0x22dbd4>0x0){_0x48e81f+=_0x1cd5a1;}_0x221a52[_0x78e7('0x18')](dbH['sequelize'][_0x78e7('0x30')](util['format'](_0x78e7('0x31'),QUERY,_0x1cd5a1,_0x48e81f),{'type':dbH['sequelize'][_0x78e7('0x32')][_0x78e7('0x33')]}));});if(_0x596ca5>0x0){_0x48e81f+=_0x1cd5a1;_0x221a52['push'](dbH[_0x78e7('0x34')]['query'](util[_0x78e7('0x1b')](_0x78e7('0x31'),QUERY,_0x596ca5,_0x48e81f),{'type':dbH['sequelize'][_0x78e7('0x32')][_0x78e7('0x33')]}));}}}else{_0x221a52[_0x78e7('0x18')](dbH['sequelize'][_0x78e7('0x30')](QUERY,{'type':dbH['sequelize'][_0x78e7('0x32')][_0x78e7('0x33')]}));}var _0x2aecd2=path[_0x78e7('0x35')](PATH);var _0x6fbc13=path['basename'](PATH,_0x78e7('0x36'));var _0x5c5514=_0x545b13['split']&&_0x221a52[_0x78e7('0x20')]>0x1;var _0x44f348=[];if(!fs[_0x78e7('0x37')](path['join'](_0x2aecd2,_0x6fbc13))&&_0x5c5514){fs[_0x78e7('0x38')](path[_0x78e7('0x39')](_0x2aecd2,_0x6fbc13));}return BPromise[_0x78e7('0x3a')](_0x221a52,function(_0x311876){_0x44f348[_0x78e7('0x18')](_0x311876);})['then'](function(){var _0x24a939=[];for(var _0x18450b=0x0;_0x18450b<_0x44f348[_0x78e7('0x20')];_0x18450b+=0x1){var _0x1d4299=_0x44f348[_0x18450b];var _0x4ef9c3=createTables(_[_0x78e7('0x3b')](_0x1d4299));var _0x1f6b25;var _0x2734c4=getPDFDocDefinition(_0x4ef9c3);var _0x5c658f=getPDFPrinter();var _0xddb1f3=_0x5c658f['createPdfKitDocument'](_0x2734c4);if(_0x5c5514){_0x1f6b25=path[_0x78e7('0x39')](_0x2aecd2,_0x6fbc13,util[_0x78e7('0x1b')](_0x78e7('0x3c'),_0x6fbc13,_0x18450b,_0x78e7('0x3d')));}else{_0x1f6b25=path[_0x78e7('0x39')](_0x2aecd2,util[_0x78e7('0x1b')](_0x78e7('0x3e'),_0x6fbc13,_0x78e7('0x3d')));}_0x24a939['push'](writePDFDocument(_0xddb1f3,_0x1f6b25));}return Promise[_0x78e7('0x3f')](_0x24a939);})[_0x78e7('0x2d')](function(){if(_0x5c5514){return new Promise(function(_0x17e25a){zipdir(path['join'](_0x2aecd2,_0x6fbc13),{'saveTo':path[_0x78e7('0x39')](_0x2aecd2,util[_0x78e7('0x1b')](_0x78e7('0x3e'),_0x6fbc13,_0x78e7('0x40')))},function(){rimraf(path[_0x78e7('0x39')](_0x2aecd2,_0x6fbc13),function(){});_0x17e25a(_0x78e7('0x41'));});});}})['then'](function(){if(!_0x5c5514)return;rimraf(path[_0x78e7('0x39')](_0x2aecd2,_0x6fbc13),function(){});})['then'](function(){logger['info'](util[_0x78e7('0x1b')](_0x78e7('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x78e7('0x43'),_0x5c5514?util[_0x78e7('0x1b')](_0x78e7('0x3e'),_0x6fbc13,_0x5c5514?_0x78e7('0x40'):_0x78e7('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x78e7('0x1b')](_0x78e7('0x44'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x78e7('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x78e7('0x2d')](function(_0x4f75b3){EXTRACTED_REPORT=_0x4f75b3;return dbH['sequelize']['query'](util['format'](_0x78e7('0x45'),QUERY),{'type':dbH[_0x78e7('0x34')][_0x78e7('0x32')][_0x78e7('0x33')]});})[_0x78e7('0x2d')](extractReport)[_0x78e7('0x46')](function(_0x18d47a){logger[_0x78e7('0x47')](util[_0x78e7('0x1b')](_0x78e7('0x48'),EXTRACTED_REPORT_ID,_0x78e7('0x49')),util['inspect'](_0x18d47a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x78e7('0x4a'));})[_0x78e7('0x4b')](function(){process[_0x78e7('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xfb3556=new PdfPrinter({'Arial':{'normal':__dirname+_0x78e7('0x4d'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x78e7('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0xfb3556;}function getPDFDocDefinitionFromHTML(_0x939a98,_0x44f34f){var _0x36e227=util[_0x78e7('0x1b')](_0x78e7('0x4f'),_0x44f34f[_0x78e7('0x50')],_0x44f34f[_0x78e7('0x51')]);var _0x38cc84=moment()[_0x78e7('0x1b')](_0x78e7('0x52'))[_0x78e7('0x13')]();var _0x33f766=htmlToPdfmake(_0x939a98,{'window':window,'tableAutoSize':!![]});return{'content':[_0x33f766],'defaultStyle':{'font':_0x78e7('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x78e7('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x78e7('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x78e7('0x53')}},'header':function(){return[{'text':_0x78e7('0x54'),'style':_0x78e7('0x21')}];},'footer':function(_0x402dc3,_0x56aff0){return[{'text':util[_0x78e7('0x1b')](_0x78e7('0x55'),_0x36e227,_0x402dc3,_0x56aff0,_0x38cc84),'style':_0x78e7('0x25')}];}};}function writePDFDocument(_0xea312d,_0x2b97e5){return new Promise(function(_0xb13d22,_0x3775e7){var _0x33e453=_0xea312d['pipe'](fs[_0x78e7('0x56')](_0x2b97e5));_0x33e453['on'](_0x78e7('0x57'),function(){_0xb13d22(_0x78e7('0x57'));});_0x33e453['on'](_0x78e7('0x58'),function(_0x2a6900){_0x3775e7(_0x2a6900);});_0xea312d['end']();});}exports[_0x78e7('0x59')]=function(_0x214863,_0x43a253){var _0x4eea56=getPDFPrinter();var _0x12808b=getPDFDocDefinitionFromHTML(_0x214863,_0x43a253);var _0x2dc98c=_0x4eea56[_0x78e7('0x5a')](_0x12808b);return writePDFDocument(_0x2dc98c,_0x43a253[_0x78e7('0x5b')])['catch'](function(_0x378187){throw _0x378187;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ac7b6e5..1b07fa3 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 _0x964a=['find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','format','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','each','%s.%s','binary','zip','Completed','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0x84f43,_0x31e453){var _0x3348ab=function(_0x529151){while(--_0x529151){_0x84f43['push'](_0x84f43['shift']());}};_0x3348ab(++_0x31e453);}(_0x964a,0x13a));var _0xa964=function(_0x5381a5,_0x11c5b9){_0x5381a5=_0x5381a5-0x0;var _0x292189=_0x964a[_0x5381a5];return _0x292189;};'use strict';var util=require(_0xa964('0x0'));var path=require(_0xa964('0x1'));var _=require(_0xa964('0x2'));var fs=require('fs');var json2xls=require(_0xa964('0x3'));var BPromise=require(_0xa964('0x4'));var zipdir=require(_0xa964('0x5'));var rimraf=require(_0xa964('0x6'));var db=require(_0xa964('0x7'))['db'];var dbH=require(_0xa964('0x7'))[_0xa964('0x8')];var logger=require(_0xa964('0x9'))(_0xa964('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xa964('0xb')][0x2]);var QUERY=process[_0xa964('0xb')][0x3];var PATH=process[_0xa964('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x41dda6,_0x4bf9fd){var _0x37ce3e={'status':_0x41dda6};var _0x3eae36={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bf9fd){_0x37ce3e[_0xa964('0xc')]=_0x4bf9fd;}return db['AnalyticExtractedReport']['update'](_0x37ce3e,_0x3eae36);}function main(){var _0x6073b6=0x1388;var _0x3e7e5d;logger['info'](util['format'](_0xa964('0xd'),EXTRACTED_REPORT_ID,_0xa964('0xe')));return db['Setting'][_0xa964('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa964('0x10'),_0xa964('0x11')]})[_0xa964('0x12')](function(_0x228e7a){if(_0x228e7a){_0x3e7e5d=_0x228e7a;_0x6073b6=_0x3e7e5d[_0xa964('0x11')]||0x1388;}})[_0xa964('0x12')](function(){return dbH['sequelize'][_0xa964('0x13')](util['format'](_0xa964('0x14'),QUERY),{'type':dbH[_0xa964('0x15')][_0xa964('0x16')][_0xa964('0x17')]});})[_0xa964('0x12')](function(_0x4163eb){if(!_0x4163eb[0x0][_0xa964('0x18')]){return analyticExtractedReport(_0xa964('0x19'));}var _0x89a48f=[];var _0x248edd=0x0;if(_0x3e7e5d[_0xa964('0x10')]){if(_0x4163eb&&_0x4163eb['length']){var _0x3b0c60=_[_0xa964('0x1a')](_0x4163eb[0x0][_0xa964('0x18')]/_0x6073b6);var _0x58b250=Number['isInteger'](_0x4163eb[0x0]['num']/_0x6073b6)?_0x4163eb[0x0][_0xa964('0x18')]%_0x6073b6:0x0;_0x3b0c60['forEach'](function(_0x4b1204){if(_0x4b1204>0x0){_0x248edd+=_0x6073b6;}_0x89a48f['push'](dbH[_0xa964('0x15')][_0xa964('0x13')](util[_0xa964('0x1b')](_0xa964('0x1c'),QUERY,_0x6073b6,_0x248edd),{'type':dbH[_0xa964('0x15')]['QueryTypes'][_0xa964('0x17')]}));});if(_0x58b250>0x0){_0x248edd+=_0x6073b6;_0x89a48f[_0xa964('0x1d')](dbH[_0xa964('0x15')]['query'](util[_0xa964('0x1b')](_0xa964('0x1c'),QUERY,_0x58b250,_0x248edd),{'type':dbH[_0xa964('0x15')][_0xa964('0x16')][_0xa964('0x17')]}));}}}else{_0x89a48f[_0xa964('0x1d')](dbH[_0xa964('0x15')][_0xa964('0x13')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xa964('0x17')]}));}var _0x294bba=path[_0xa964('0x1e')](PATH);var _0x3e7ccc=path[_0xa964('0x1f')](PATH,_0xa964('0x20'));var _0x5c50dd=_0x3e7e5d['split']&&_0x89a48f[_0xa964('0x21')]>0x1;var _0x3fe27c=[];if(!fs[_0xa964('0x22')](path[_0xa964('0x23')](_0x294bba,_0x3e7ccc))&&_0x5c50dd){fs[_0xa964('0x24')](path[_0xa964('0x23')](_0x294bba,_0x3e7ccc));}return BPromise[_0xa964('0x25')](_0x89a48f,function(_0x159514){_0x3fe27c[_0xa964('0x1d')](_0x159514);})[_0xa964('0x12')](function(){for(var _0x50d23e=0x0;_0x50d23e<_0x3fe27c[_0xa964('0x21')];_0x50d23e+=0x1){var _0x5a2329;var _0x4d62c7=_0x3fe27c[_0x50d23e];if(_0x5c50dd){_0x5a2329=path[_0xa964('0x23')](_0x294bba,_0x3e7ccc,util[_0xa964('0x1b')]('%s%d.%s',_0x3e7ccc,_0x50d23e,'xlsx'));}else{_0x5a2329=path[_0xa964('0x23')](_0x294bba,util['format'](_0xa964('0x26'),_0x3e7ccc,'xlsx'));}fs['writeFileSync'](_0x5a2329,json2xls(_0x4d62c7),_0xa964('0x27'));}})['then'](function(){if(_0x5c50dd){return new Promise(function(_0x5e082a){zipdir(path['join'](_0x294bba,_0x3e7ccc),{'saveTo':path[_0xa964('0x23')](_0x294bba,util[_0xa964('0x1b')](_0xa964('0x26'),_0x3e7ccc,_0xa964('0x28')))},function(_0x1f0afd,_0x1efc31){rimraf(path[_0xa964('0x23')](_0x294bba,_0x3e7ccc),function(){});_0x5e082a('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0xa964('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xa964('0x29'),_0x5c50dd?util[_0xa964('0x1b')]('%s.%s',_0x3e7ccc,_0x5c50dd?'zip':_0xa964('0x2a')):null);});})['catch'](function(_0x3737df){logger['info'](util[_0xa964('0x1b')](_0xa964('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xa964('0x2c')](_0x3737df,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa964('0x2d'));})[_0xa964('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x35b1=['existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','update','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','num','length','range','isInteger','forEach','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0x35b1,0x1e5));var _0x135b=function(_0x2f02d4,_0x27b24a){_0x2f02d4=_0x2f02d4-0x0;var _0x4b707d=_0x35b1[_0x2f02d4];return _0x4b707d;};'use strict';var util=require(_0x135b('0x0'));var path=require(_0x135b('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x135b('0x2'));var BPromise=require(_0x135b('0x3'));var zipdir=require(_0x135b('0x4'));var rimraf=require(_0x135b('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x135b('0x6'))[_0x135b('0x7')];var logger=require('../../config/logger')(_0x135b('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x135b('0x9')][0x2]);var QUERY=process[_0x135b('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x148903,_0x57d701){var _0x5c102f={'status':_0x148903};var _0x12aad7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57d701){_0x5c102f[_0x135b('0xa')]=_0x57d701;}return db['AnalyticExtractedReport'][_0x135b('0xb')](_0x5c102f,_0x12aad7);}function main(){var _0x4006b6=0x1388;var _0x4843be;logger[_0x135b('0xc')](util[_0x135b('0xd')](_0x135b('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x135b('0xf')][_0x135b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x135b('0x11'),_0x135b('0x12')]})[_0x135b('0x13')](function(_0xcfbf58){if(_0xcfbf58){_0x4843be=_0xcfbf58;_0x4006b6=_0x4843be[_0x135b('0x12')]||0x1388;}})[_0x135b('0x13')](function(){return dbH[_0x135b('0x14')][_0x135b('0x15')](util[_0x135b('0xd')](_0x135b('0x16'),QUERY),{'type':dbH[_0x135b('0x14')][_0x135b('0x17')]['SELECT']});})['then'](function(_0x2ee82a){if(!_0x2ee82a[0x0][_0x135b('0x18')]){return analyticExtractedReport('Empty');}var _0x19eef4=[];var _0x2525ad=0x0;if(_0x4843be[_0x135b('0x11')]){if(_0x2ee82a&&_0x2ee82a[_0x135b('0x19')]){var _0x30cb86=_[_0x135b('0x1a')](_0x2ee82a[0x0][_0x135b('0x18')]/_0x4006b6);var _0xbcc39d=Number[_0x135b('0x1b')](_0x2ee82a[0x0][_0x135b('0x18')]/_0x4006b6)?_0x2ee82a[0x0]['num']%_0x4006b6:0x0;_0x30cb86[_0x135b('0x1c')](function(_0x5996bd){if(_0x5996bd>0x0){_0x2525ad+=_0x4006b6;}_0x19eef4[_0x135b('0x1d')](dbH[_0x135b('0x14')]['query'](util[_0x135b('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4006b6,_0x2525ad),{'type':dbH[_0x135b('0x14')][_0x135b('0x17')][_0x135b('0x1e')]}));});if(_0xbcc39d>0x0){_0x2525ad+=_0x4006b6;_0x19eef4[_0x135b('0x1d')](dbH['sequelize'][_0x135b('0x15')](util['format'](_0x135b('0x1f'),QUERY,_0xbcc39d,_0x2525ad),{'type':dbH[_0x135b('0x14')][_0x135b('0x17')]['SELECT']}));}}}else{_0x19eef4[_0x135b('0x1d')](dbH[_0x135b('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0x135b('0x17')][_0x135b('0x1e')]}));}var _0x453585=path[_0x135b('0x20')](PATH);var _0x3d55cd=path[_0x135b('0x21')](PATH,_0x135b('0x22'));var _0x406705=_0x4843be['split']&&_0x19eef4['length']>0x1;var _0x883b9c=[];if(!fs[_0x135b('0x23')](path['join'](_0x453585,_0x3d55cd))&&_0x406705){fs[_0x135b('0x24')](path[_0x135b('0x25')](_0x453585,_0x3d55cd));}return BPromise[_0x135b('0x26')](_0x19eef4,function(_0x2d98a6){_0x883b9c[_0x135b('0x1d')](_0x2d98a6);})[_0x135b('0x13')](function(){for(var _0xcff2b8=0x0;_0xcff2b8<_0x883b9c['length'];_0xcff2b8+=0x1){var _0x120975;var _0x2c002c=_0x883b9c[_0xcff2b8];if(_0x406705){_0x120975=path[_0x135b('0x25')](_0x453585,_0x3d55cd,util['format'](_0x135b('0x27'),_0x3d55cd,_0xcff2b8,_0x135b('0x28')));}else{_0x120975=path[_0x135b('0x25')](_0x453585,util['format'](_0x135b('0x29'),_0x3d55cd,_0x135b('0x28')));}fs[_0x135b('0x2a')](_0x120975,json2xls(_0x2c002c),_0x135b('0x2b'));}})[_0x135b('0x13')](function(){if(_0x406705){return new Promise(function(_0x4d710f){zipdir(path[_0x135b('0x25')](_0x453585,_0x3d55cd),{'saveTo':path[_0x135b('0x25')](_0x453585,util['format'](_0x135b('0x29'),_0x3d55cd,'zip'))},function(_0x34bce,_0x2c84a7){rimraf(path[_0x135b('0x25')](_0x453585,_0x3d55cd),function(){});_0x4d710f(_0x135b('0x2c'));});});}})[_0x135b('0x13')](function(){logger[_0x135b('0xc')](util[_0x135b('0xd')](_0x135b('0x2d'),EXTRACTED_REPORT_ID,_0x135b('0x2e')));return analyticExtractedReport(_0x135b('0x2f'),_0x406705?util['format'](_0x135b('0x29'),_0x3d55cd,_0x406705?'zip':'xlsx'):null);});})[_0x135b('0x30')](function(_0x10c1c8){logger[_0x135b('0xc')](util[_0x135b('0xd')](_0x135b('0x31'),EXTRACTED_REPORT_ID,_0x135b('0x2e')),util['inspect'](_0x10c1c8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x135b('0x32'));})[_0x135b('0x33')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index d2517f4..45ce93b 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 _0x6574=['answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','${EXTEN:','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','map','tag','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='];(function(_0x57fb3c,_0x6045f5){var _0x1a9344=function(_0x462e60){while(--_0x462e60){_0x57fb3c['push'](_0x57fb3c['shift']());}};_0x1a9344(++_0x6045f5);}(_0x6574,0xd9));var _0x4657=function(_0x553066,_0x1eeb56){_0x553066=_0x553066-0x0;var _0x3fd419=_0x6574[_0x553066];return _0x3fd419;};'use strict';var _=require(_0x4657('0x0'));var util=require('util');function rewrite(_0x5299cf,_0x5d46ab){var _0x4eedf3=this;return _0x5299cf[_0x4657('0x1')]['Interval'][_0x4657('0x2')]({'raw':!![]})[_0x4657('0x3')](function(_0x298837){_0x4eedf3[_0x4657('0x4')]=_0x298837;return _0x5299cf['models'][_0x4657('0x5')][_0x4657('0x2')]({'where':{'IntervalId':_0x5d46ab[_0x4657('0x6')]},'raw':!![]});})[_0x4657('0x3')](function(_0x35082d){return _0x5299cf[_0x4657('0x1')][_0x4657('0x5')][_0x4657('0x2')]({'where':{'exten':{'$in':_[_0x4657('0x7')](_['map'](_0x35082d,'exten'))}},'order':[{'raw':_0x4657('0x8')}],'raw':!![]});})[_0x4657('0x3')](function(_0x50d39d){var _0x41d05a=_[_0x4657('0x9')](_0x50d39d,{'priority':'1'});var _0x5eb37b=_[_0x4657('0x9')](_0x50d39d,{'isApp':0x1});var _0xcbbc8f=_['groupBy'](_0x5eb37b,_0x4657('0xa'));var _0x589119=[_0x4657('0xb'),_0x4657('0xc')];var _0x191cff=[];var _0x29aeb7=[];for(var _0x35b2ea in _0xcbbc8f){if(_0xcbbc8f[_0x4657('0xd')](_0x35b2ea)){_0x4eedf3[_0x4657('0xe')]=0x2;_0x4eedf3[_0x4657('0xf')]=[];_0x4eedf3[_0x4657('0x10')]=_[_0x4657('0x11')](_0x41d05a,{'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':util['format'](_0x4657('0x15'),_0xcbbc8f[_0x35b2ea][0x0]['type']),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});if(_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')]===_0x4657('0x18')){_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':'CDR(routeid)='+_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3['priority']++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}else if(_0xcbbc8f[_0x35b2ea][0x0]['type']===_0x4657('0x19')){if(_0x4eedf3[_0x4657('0x10')]){_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0]['type'],'app':_0x4657('0x14'),'appdata':_0x4657('0x1a')+(_0x4eedf3['extension']['cutdigits']?_0x4657('0x1b')+_0x4eedf3[_0x4657('0x10')][_0x4657('0x1c')]+'}':'${EXTEN}'),'context':_0xcbbc8f[_0x35b2ea][0x0]['context'],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0]['type'],'app':_0x4657('0x14'),'appdata':'CDR(routeid)='+_0xcbbc8f[_0x35b2ea][0x0]['VoiceExtensionId'],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0]['VoiceExtensionId']});var _0x3e710f=_0x4eedf3['priority']++;_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3e710f+0x2)+'):Goto('+(_0x3e710f+0x1)+')','context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x3e710f,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});if(_0x4eedf3[_0x4657('0x10')]){_0x4eedf3['extensions'][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':_0x4eedf3[_0x4657('0x10')][_0x4657('0x1c')]?_0x4657('0x1d')+_0x4eedf3[_0x4657('0x10')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3['priority']++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':_0x4657('0x1e')+_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});if(_0x4eedf3['extension']&&_0x4eedf3[_0x4657('0x10')]['hasOwnProperty']('recordingFormat')&&_0x4eedf3[_0x4657('0x10')][_0x4657('0x1f')]!=='none'){_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x20'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x4eedf3[_0x4657('0x10')][_0x4657('0x1f')]||_0x4657('0x21'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0]['exten'],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0]['type'],'app':_0x4657('0x14'),'appdata':_0x4657('0x22'),'context':_0xcbbc8f[_0x35b2ea][0x0]['context'],'exten':_0xcbbc8f[_0x35b2ea][0x0]['exten'],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':_0x4657('0x23'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3['priority']++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x24'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});for(var _0x5df576=0x0,_0x308287=0x0;_0x5df576<_0xcbbc8f[_0x35b2ea]['length'];_0x5df576+=0x1,_0x308287=0x0){var _0xfa8853=_0xcbbc8f[_0x35b2ea][_0x5df576];if(_0xfa8853[_0x4657('0x13')]){_0xfa8853[_0x4657('0x13')]=_0xfa8853[_0x4657('0x13')][_0x4657('0x25')]();}var _0x1a98f1=[];var _0x2badd7=[];delete _0xfa8853['id'];delete _0xfa8853[_0x4657('0x26')];delete _0xfa8853['updatedAt'];var _0x5e6f19=_0xfa8853[_0x4657('0x27')]!==_0x4657('0x28')?[_0xfa8853[_0x4657('0x27')]]:_0xfa8853[_0x4657('0x6')]?_[_0x4657('0x29')](_[_0x4657('0x9')](_0x4eedf3[_0x4657('0x4')],{'IntervalId':_0xfa8853['IntervalId']}),_0x4657('0x27')):[];if(_0xfa8853['hasOwnProperty'](_0x4657('0x2a'))){if(_0xfa8853[_0x4657('0x2a')]&&_0xfa8853[_0x4657('0x2a')]!=='--'){_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':'Set','appdata':'CDR(tag)='+_0xfa8853['tag'],'context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853['exten'],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3['priority']+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}}if(_0xfa8853['type']===_0x4657('0x19')&&_0xfa8853[_0x4657('0xd')](_0x4657('0x2c'))){if(_0xfa8853[_0x4657('0x2c')]){_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x2d'),'appdata':_0x4657('0x2e')+_0xfa8853[_0x4657('0x2c')]+')','context':_0xfa8853['context'],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}else{_0x1a98f1['push']({'type':_0xfa8853[_0x4657('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xfa8853['context'],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}}if(_0xfa8853['hasOwnProperty'](_0x4657('0x2f'))){if(_0x589119[_0x4657('0x30')](_0xfa8853[_0x4657('0x31')]['toLowerCase']())>=0x0&&_0xfa8853[_0x4657('0x32')]!==_0x4657('0x33')){if(_0xfa8853[_0x4657('0x2f')]){_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x2d'),'appdata':_0x4657('0x34'),'context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x35'),'context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19['length']+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853['VoiceExtensionId']});}else{_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x2d'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3['priority']+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x36'),'context':_0xfa8853['context'],'exten':_0xfa8853['exten'],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}}}for(var _0x185d03=0x0;_0x185d03<_0x5e6f19[_0x4657('0x2b')];_0x185d03+=0x1){var _0x67f2ec=_0x4eedf3['priority']+_0x5e6f19[_0x4657('0x2b')];var _0x5ac42a=_0x185d03===_0x5e6f19[_0x4657('0x2b')]-0x1?_0x4eedf3[_0x4657('0xe')]+_0x1a98f1[_0x4657('0x2b')]+_0x2badd7['length']+0x2:_0x4eedf3['priority']+_0x185d03+0x1;_0x1a98f1[_0x4657('0x37')](_0x185d03,0x0,{'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x38'),'appdata':_0x5e6f19[_0x185d03]+'?'+_0xfa8853['context']+_0x4657('0x39')+_0x67f2ec+':'+_0xfa8853[_0x4657('0x16')]+_0x4657('0x39')+_0x5ac42a,'exten':_0xfa8853['exten'],'context':_0xfa8853[_0x4657('0x16')],'priority':_0x4eedf3[_0x4657('0xe')]+_0x185d03,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}_0xfa8853[_0x4657('0xe')]=_0x1a98f1[_0x4657('0x2b')]?_[_0x4657('0x3a')](_0x1a98f1)['priority']+0x1:_0x4eedf3['priority'];_0x4eedf3[_0x4657('0xe')]=(_0x2badd7[_0x4657('0x2b')]?_[_0x4657('0x3a')](_0x2badd7)['priority']:_0xfa8853[_0x4657('0xe')])+0x1;_0x4eedf3['extensions']=_[_0x4657('0x3b')](_0x4eedf3['extensions'],_0x1a98f1,[_0xfa8853],_0x2badd7);}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Hangup','exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'priority':_0x4eedf3[_0x4657('0xe')],'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x191cff[_0x4657('0x12')](_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]);_0x29aeb7=_[_0x4657('0x3b')](_0x29aeb7,_0x4eedf3['extensions']);}}return _0x5299cf['transaction'](function(_0x59f76f){return _0x5299cf[_0x4657('0x1')][_0x4657('0x5')][_0x4657('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x191cff}},'transaction':_0x59f76f})['then'](function(_0x573077){return _0x5299cf[_0x4657('0x1')]['VoiceExtension'][_0x4657('0x3d')](_[_0x4657('0x3e')](_0x29aeb7,_0x4657('0xe')),{'transaction':_0x59f76f});});});})[_0x4657('0x3f')](function(_0x22ba78){console[_0x4657('0x40')](_0x22ba78);});}exports[_0x4657('0x41')]=rewrite; \ No newline at end of file +var _0xe97f=['VoiceExtension','findAll','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','find','extensions','type','Set','format','VoiceExtensionId','inbound','push','context','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','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','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','last','concat','Hangup','transaction','destroy','catch','rewrite','util','models','Interval','then','intervals'];(function(_0x1e1998,_0x584816){var _0x25a723=function(_0x51bd01){while(--_0x51bd01){_0x1e1998['push'](_0x1e1998['shift']());}};_0x25a723(++_0x584816);}(_0xe97f,0x1de));var _0xfe97=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe97f[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xfe97('0x0'));function rewrite(_0x4feb1f,_0x1ca960){var _0x29c260=this;return _0x4feb1f[_0xfe97('0x1')][_0xfe97('0x2')]['findAll']({'raw':!![]})[_0xfe97('0x3')](function(_0x9a1235){_0x29c260[_0xfe97('0x4')]=_0x9a1235;return _0x4feb1f[_0xfe97('0x1')][_0xfe97('0x5')][_0xfe97('0x6')]({'where':{'IntervalId':_0x1ca960[_0xfe97('0x7')]},'raw':!![]});})[_0xfe97('0x3')](function(_0x59c4d2){return _0x4feb1f[_0xfe97('0x1')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0xfe97('0x8')](_['map'](_0x59c4d2,_0xfe97('0x9')))}},'order':[{'raw':_0xfe97('0xa')}],'raw':!![]});})[_0xfe97('0x3')](function(_0x166ef0){var _0x147ae3=_['filter'](_0x166ef0,{'priority':'1'});var _0x2f43dc=_[_0xfe97('0xb')](_0x166ef0,{'isApp':0x1});var _0x1d0bbd=_[_0xfe97('0xc')](_0x2f43dc,_0xfe97('0x9'));var _0x3d324c=[_0xfe97('0xd'),_0xfe97('0xe')];var _0x1ec502=[];var _0x50e98f=[];for(var _0x3f16d4 in _0x1d0bbd){if(_0x1d0bbd[_0xfe97('0xf')](_0x3f16d4)){_0x29c260[_0xfe97('0x10')]=0x2;_0x29c260['extensions']=[];_0x29c260['extension']=_[_0xfe97('0x11')](_0x147ae3,{'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')]});_0x29c260[_0xfe97('0x12')]['push']({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':util[_0xfe97('0x15')]('CDR(type)=%s',_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')]),'context':_0x1d0bbd[_0x3f16d4][0x0]['context'],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});if(_0x1d0bbd[_0x3f16d4][0x0]['type']===_0xfe97('0x17')){_0x29c260[_0xfe97('0x12')][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':'Set','appdata':'CDR(routeid)='+_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')],'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});}else if(_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')]===_0xfe97('0x1a')){if(_0x29c260[_0xfe97('0x1b')]){_0x29c260[_0xfe97('0x12')]['push']({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':_0xfe97('0x1c')+(_0x29c260[_0xfe97('0x1b')][_0xfe97('0x1d')]?_0xfe97('0x1e')+_0x29c260[_0xfe97('0x1b')][_0xfe97('0x1d')]+'}':_0xfe97('0x1f')),'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260['priority']++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});}_0x29c260[_0xfe97('0x12')]['push']({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':'CDR(routeid)='+_0x1d0bbd[_0x3f16d4][0x0]['VoiceExtensionId'],'context':_0x1d0bbd[_0x3f16d4][0x0]['context'],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0]['VoiceExtensionId']});var _0x2353af=_0x29c260['priority']++;_0x29c260[_0xfe97('0x12')][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x20'),'appdata':_0xfe97('0x21')+(_0x2353af+0x2)+_0xfe97('0x22')+(_0x2353af+0x1)+')','context':_0x1d0bbd[_0x3f16d4][0x0]['context'],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x2353af,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});if(_0x29c260[_0xfe97('0x1b')]){_0x29c260[_0xfe97('0x12')][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':_0x29c260[_0xfe97('0x1b')][_0xfe97('0x1d')]?_0xfe97('0x23')+_0x29c260[_0xfe97('0x1b')][_0xfe97('0x1d')]+'}':_0xfe97('0x24'),'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260['priority']++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});}_0x29c260['extensions'][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':_0xfe97('0x25')+_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')],'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0]['exten'],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0]['VoiceExtensionId']});if(_0x29c260[_0xfe97('0x1b')]&&_0x29c260[_0xfe97('0x1b')]['hasOwnProperty']('recordingFormat')&&_0x29c260[_0xfe97('0x1b')][_0xfe97('0x26')]!==_0xfe97('0x27')){_0x29c260[_0xfe97('0x12')][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':_0xfe97('0x28'),'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0]['exten'],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0]['VoiceExtensionId']});_0x29c260[_0xfe97('0x12')][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0]['type'],'app':_0xfe97('0x14'),'appdata':_0xfe97('0x29')+_0x29c260[_0xfe97('0x1b')][_0xfe97('0x26')]||_0xfe97('0x2a'),'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0]['VoiceExtensionId']});}}_0x29c260['extensions']['push']({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':'Set','appdata':_0xfe97('0x2b'),'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260['priority']++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});_0x29c260[_0xfe97('0x12')][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0]['exten'],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0]['VoiceExtensionId']});_0x29c260['extensions']['push']({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':_0xfe97('0x2c'),'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'priority':_0x29c260[_0xfe97('0x10')]++,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});for(var _0x4bd5d1=0x0,_0x2cba95=0x0;_0x4bd5d1<_0x1d0bbd[_0x3f16d4]['length'];_0x4bd5d1+=0x1,_0x2cba95=0x0){var _0x50d7ba=_0x1d0bbd[_0x3f16d4][_0x4bd5d1];if(_0x50d7ba[_0xfe97('0x13')]){_0x50d7ba[_0xfe97('0x13')]=_0x50d7ba[_0xfe97('0x13')][_0xfe97('0x2d')]();}var _0xded340=[];var _0xa7bd18=[];delete _0x50d7ba['id'];delete _0x50d7ba[_0xfe97('0x2e')];delete _0x50d7ba[_0xfe97('0x2f')];var _0x55870a=_0x50d7ba[_0xfe97('0x30')]!==_0xfe97('0x31')?[_0x50d7ba[_0xfe97('0x30')]]:_0x50d7ba[_0xfe97('0x7')]?_['map'](_[_0xfe97('0xb')](_0x29c260['intervals'],{'IntervalId':_0x50d7ba[_0xfe97('0x7')]}),'interval'):[];if(_0x50d7ba[_0xfe97('0xf')]('tag')){if(_0x50d7ba[_0xfe97('0x32')]&&_0x50d7ba[_0xfe97('0x32')]!=='--'){_0xded340[_0xfe97('0x18')]({'type':_0x50d7ba[_0xfe97('0x13')],'app':'Set','appdata':_0xfe97('0x33')+_0x50d7ba[_0xfe97('0x32')],'context':_0x50d7ba[_0xfe97('0x19')],'exten':_0x50d7ba[_0xfe97('0x9')],'priority':_0x55870a['length']+_0x29c260[_0xfe97('0x10')]+_0x2cba95++,'VoiceExtensionId':_0x50d7ba[_0xfe97('0x16')]});}}if(_0x50d7ba[_0xfe97('0x13')]===_0xfe97('0x1a')&&_0x50d7ba[_0xfe97('0xf')](_0xfe97('0x34'))){if(_0x50d7ba[_0xfe97('0x34')]){_0xded340[_0xfe97('0x18')]({'type':_0x50d7ba[_0xfe97('0x13')],'app':'ExecIf','appdata':_0xfe97('0x35')+_0x50d7ba[_0xfe97('0x34')]+')','context':_0x50d7ba[_0xfe97('0x19')],'exten':_0x50d7ba[_0xfe97('0x9')],'priority':_0x55870a[_0xfe97('0x36')]+_0x29c260[_0xfe97('0x10')]+_0x2cba95++,'VoiceExtensionId':_0x50d7ba[_0xfe97('0x16')]});}else{_0xded340[_0xfe97('0x18')]({'type':_0x50d7ba['type'],'app':'ExecIf','appdata':_0xfe97('0x37'),'context':_0x50d7ba[_0xfe97('0x19')],'exten':_0x50d7ba[_0xfe97('0x9')],'priority':_0x55870a[_0xfe97('0x36')]+_0x29c260[_0xfe97('0x10')]+_0x2cba95++,'VoiceExtensionId':_0x50d7ba[_0xfe97('0x16')]});}}if(_0x50d7ba[_0xfe97('0xf')](_0xfe97('0x38'))){if(_0x3d324c[_0xfe97('0x39')](_0x50d7ba[_0xfe97('0x3a')][_0xfe97('0x2d')]())>=0x0&&_0x50d7ba['appType']!=='custom'){if(_0x50d7ba[_0xfe97('0x38')]){_0xded340[_0xfe97('0x18')]({'type':_0x50d7ba[_0xfe97('0x13')],'app':'ExecIf','appdata':_0xfe97('0x3b'),'context':_0x50d7ba[_0xfe97('0x19')],'exten':_0x50d7ba['exten'],'priority':_0x55870a['length']+_0x29c260['priority']+_0x2cba95++,'VoiceExtensionId':_0x50d7ba[_0xfe97('0x16')]});_0xded340[_0xfe97('0x18')]({'type':_0x50d7ba[_0xfe97('0x13')],'app':'Set','appdata':_0xfe97('0x3c'),'context':_0x50d7ba['context'],'exten':_0x50d7ba[_0xfe97('0x9')],'priority':_0x55870a[_0xfe97('0x36')]+_0x29c260[_0xfe97('0x10')]+_0x2cba95++,'VoiceExtensionId':_0x50d7ba['VoiceExtensionId']});}else{_0xded340[_0xfe97('0x18')]({'type':_0x50d7ba['type'],'app':_0xfe97('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x50d7ba[_0xfe97('0x19')],'exten':_0x50d7ba[_0xfe97('0x9')],'priority':_0x55870a[_0xfe97('0x36')]+_0x29c260['priority']+_0x2cba95++,'VoiceExtensionId':_0x50d7ba[_0xfe97('0x16')]});_0xded340[_0xfe97('0x18')]({'type':_0x50d7ba[_0xfe97('0x13')],'app':_0xfe97('0x14'),'appdata':_0xfe97('0x3d'),'context':_0x50d7ba['context'],'exten':_0x50d7ba['exten'],'priority':_0x55870a['length']+_0x29c260[_0xfe97('0x10')]+_0x2cba95++,'VoiceExtensionId':_0x50d7ba[_0xfe97('0x16')]});}}}for(var _0x22f419=0x0;_0x22f419<_0x55870a[_0xfe97('0x36')];_0x22f419+=0x1){var _0x294bf8=_0x29c260[_0xfe97('0x10')]+_0x55870a[_0xfe97('0x36')];var _0x483c2e=_0x22f419===_0x55870a[_0xfe97('0x36')]-0x1?_0x29c260[_0xfe97('0x10')]+_0xded340[_0xfe97('0x36')]+_0xa7bd18[_0xfe97('0x36')]+0x2:_0x29c260[_0xfe97('0x10')]+_0x22f419+0x1;_0xded340['splice'](_0x22f419,0x0,{'type':_0x50d7ba[_0xfe97('0x13')],'app':'GotoIfTime','appdata':_0x55870a[_0x22f419]+'?'+_0x50d7ba[_0xfe97('0x19')]+',${EXTEN},'+_0x294bf8+':'+_0x50d7ba[_0xfe97('0x19')]+',${EXTEN},'+_0x483c2e,'exten':_0x50d7ba['exten'],'context':_0x50d7ba['context'],'priority':_0x29c260[_0xfe97('0x10')]+_0x22f419,'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});}_0x50d7ba[_0xfe97('0x10')]=_0xded340[_0xfe97('0x36')]?_[_0xfe97('0x3e')](_0xded340)['priority']+0x1:_0x29c260[_0xfe97('0x10')];_0x29c260[_0xfe97('0x10')]=(_0xa7bd18[_0xfe97('0x36')]?_[_0xfe97('0x3e')](_0xa7bd18)[_0xfe97('0x10')]:_0x50d7ba[_0xfe97('0x10')])+0x1;_0x29c260[_0xfe97('0x12')]=_[_0xfe97('0x3f')](_0x29c260['extensions'],_0xded340,[_0x50d7ba],_0xa7bd18);}_0x29c260[_0xfe97('0x12')][_0xfe97('0x18')]({'type':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x13')],'app':_0xfe97('0x40'),'exten':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x9')],'context':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x19')],'priority':_0x29c260[_0xfe97('0x10')],'VoiceExtensionId':_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]});_0x1ec502[_0xfe97('0x18')](_0x1d0bbd[_0x3f16d4][0x0][_0xfe97('0x16')]);_0x50e98f=_['concat'](_0x50e98f,_0x29c260[_0xfe97('0x12')]);}}return _0x4feb1f[_0xfe97('0x41')](function(_0x5d1f47){return _0x4feb1f['models'][_0xfe97('0x5')][_0xfe97('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x1ec502}},'transaction':_0x5d1f47})[_0xfe97('0x3')](function(_0x425412){return _0x4feb1f[_0xfe97('0x1')][_0xfe97('0x5')]['bulkCreate'](_['sortBy'](_0x50e98f,_0xfe97('0x10')),{'transaction':_0x5d1f47});});});})[_0xfe97('0x43')](function(_0x469bb4){console['error'](_0x469bb4);});}exports[_0xfe97('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index fec7923..f580137 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 _0xa38f=['updatedAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_contacts','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','findAll','outbound','dialCheckDuplicateType','CmList','get','always','push','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','Lists','CampaignId','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','CSV\x20import\x20process\x20stopped!','createReadStream','parse','info','CSV\x20parsed\x20correctly!','bluebird','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString'];(function(_0x8b2d01,_0x14e813){var _0x36d0fb=function(_0x3119b2){while(--_0x3119b2){_0x8b2d01['push'](_0x8b2d01['shift']());}};_0x36d0fb(++_0x14e813);}(_0xa38f,0x16d));var _0xfa38=function(_0x264766,_0x377d88){_0x264766=_0x264766-0x0;var _0x553114=_0xa38f[_0x264766];return _0x553114;};'use strict';var BPromise=require(_0xfa38('0x0'));var util=require('util');var _=require(_0xfa38('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xfa38('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xfa38('0x3'));var logger=require(_0xfa38('0x4'))(_0xfa38('0x5'));config[_0xfa38('0x6')]=_[_0xfa38('0x7')](config[_0xfa38('0x6')],{'host':_0xfa38('0x8'),'port':0x18eb});var socket=require(_0xfa38('0x9'))(new Redis(config[_0xfa38('0x6')]));require(_0xfa38('0xa'))[_0xfa38('0xb')](socket);try{if(!process[_0xfa38('0xc')][0x2]||process['argv'][0x2]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x2]===_0xfa38('0xe')){throw new Error(_0xfa38('0xf'));}var FILEPATH=process[_0xfa38('0xc')][0x2];if(!process[_0xfa38('0xc')][0x3]||process[_0xfa38('0xc')][0x3]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x3]===_0xfa38('0xe')||!process[_0xfa38('0xc')][0x4]||process[_0xfa38('0xc')][0x4]===_0xfa38('0xd')||process['argv'][0x4]===_0xfa38('0xe')){throw new Error(_0xfa38('0x10'));}var FIELDS=_['zipObject'](process[_0xfa38('0xc')][0x3][_0xfa38('0x11')](','),process['argv'][0x4][_0xfa38('0x11')](','));if(!process[_0xfa38('0xc')][0x5]||process['argv'][0x5]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x5]===_0xfa38('0xe')){throw new Error(_0xfa38('0x12'));}var LISTID=process[_0xfa38('0xc')][0x5];var COMPANYID=process[_0xfa38('0xc')][0x6]&&process['argv'][0x6]!==_0xfa38('0xd')&&process[_0xfa38('0xc')][0x6]!==_0xfa38('0xe')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xfa38('0xc')][0x7]!==_0xfa38('0xe')?process[_0xfa38('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0xfa38('0xc')][0x8]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x8]==='null'){throw new Error(_0xfa38('0x13'));}var SOCKET_TIMESTAMP=process[_0xfa38('0xc')][0x8];}catch(_0x4b10e6){logger[_0xfa38('0x14')](_0x4b10e6);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(_0x3ee128,_0x24c1aa,_0x21dae4,_0x368826){var _0x4b6144={'message':_0x24c1aa};_0x4b6144[_0x3ee128]=!![];if(_0x21dae4){_0x4b6144[_0xfa38('0x15')]=_0x21dae4;}if(_0x368826){_0x4b6144['index']=_0x368826;}return _0x4b6144;}function isEmail(_0x47ab7c){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))*$/[_0xfa38('0x16')](_0x47ab7c);}function checkRow(_0x75ca91,_0x1f442e,_0xee457a){return new BPromise(function(_0x37ef46,_0x57aa6e){if(_[_0xfa38('0x17')](_0x75ca91)){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),_0xfa38('0x18'),null,_0xee457a));}if(_0x75ca91['errors']&&_0x75ca91['errors'][_0xfa38('0x19')]){var _0x3708e0=_[_0xfa38('0x1a')](_0x75ca91[_0xfa38('0x1b')],_0xfa38('0x1c'))[_0xfa38('0x1d')](';');return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),_0x3708e0,null,_0xee457a));}var _0x46629f={};for(var _0x5543d5 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5543d5)&&FIELDS[_0x5543d5]){_0x46629f[_0x5543d5]=_0x75ca91['data'][0x0][FIELDS[_0x5543d5]]||_0x75ca91[_0xfa38('0x1e')][0x0]['\ufeff'+FIELDS[_0x5543d5]];}}if(!_0x46629f[_0xfa38('0x1f')]){return _0x57aa6e(handleCheckRowError('error',_0xfa38('0x20'),null,_0xee457a));}if(!_0x46629f[_0xfa38('0x21')]){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),'phone\x20not\x20specified!',null,_0xee457a));}if(_0x46629f[_0xfa38('0x22')]){var _0x5b9dd0=moment(_0x46629f[_0xfa38('0x22')],_0xfa38('0x23'));if(!_0x5b9dd0[_0xfa38('0x24')]()){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0xee457a));}}if(_0x46629f[_0xfa38('0x25')]){if(!isEmail(_0x46629f[_0xfa38('0x25')])){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),_0xfa38('0x26'),null,_0xee457a));}}_0x46629f[_0xfa38('0x27')]=LISTID;_0x46629f[_0xfa38('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfa38('0x19')]&&_0x1f442e){var _0x12a2ab={};for(var _0x48e4a2=0x0,_0x5b27fd=DUPLICATES[_0xfa38('0x19')];_0x48e4a2<_0x5b27fd;_0x48e4a2+=0x1){_0x12a2ab[DUPLICATES[_0x48e4a2]]=_0x46629f[DUPLICATES[_0x48e4a2]];}var _0x337969=_['find'](_0x1f442e,_0x12a2ab);if(_0x337969){return _0x57aa6e(handleCheckRowError(_0xfa38('0x29'),_0xfa38('0x2a'),_0x337969,_0xee457a));}}return db[_0xfa38('0x2b')][_0xfa38('0x2c')](_0x46629f,{'raw':!![],'hooks':![],'fields':_[_0xfa38('0x2d')](_0x46629f)})[_0xfa38('0x2e')](function(_0x1bfcac){if(DUPLICATES&&DUPLICATES['length']&&_0x1f442e){_0x1f442e['push'](_[_0xfa38('0x2f')](_0x46629f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1bfcac['id'];return _0x37ef46();})[_0xfa38('0x30')](function(_0x98e4a6){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x98e4a6[_0xfa38('0x1c')]||JSON['stringify'](_0x98e4a6)),null,_0xee457a));});});}function checkHopper(){function _0x3940ae(){return function(_0x40f515){logger[_0xfa38('0x14')](_0xfa38('0x31'),_0xfa38('0x32'),util[_0xfa38('0x33')](_0x40f515,{'showHidden':![],'depth':null}));};}var _0x2f54c3=function(_0x51a2ca,_0x2840e4){var _0x20da04=squel[_0xfa38('0x34')]()[_0xfa38('0x35')](_0xfa38('0x36'))[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x38'),_0xfa38('0x39'),_0xfa38('0x27'),_0x2840e4,_0xfa38('0x3a'),'updatedAt'],squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'),'phone')['field'](_0xfa38('0x3d'),_0xfa38('0x38'))[_0xfa38('0x3c')]('id','ContactId')[_0xfa38('0x3c')](LISTID['toString'](),_0xfa38('0x27'))['field'](_0x51a2ca['id'][_0xfa38('0x3e')](),_0x2840e4)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')]('NOW()',_0xfa38('0x3f'))[_0xfa38('0x40')]('cm_contacts')[_0xfa38('0x41')](_0xfa38('0x42'))['where'](_0xfa38('0x43'),LISTID[_0xfa38('0x3e')]())['where'](_0xfa38('0x44'))[_0xfa38('0x41')](_0xfa38('0x45'),squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'))[_0xfa38('0x40')](_0xfa38('0x36'))[_0xfa38('0x41')](_0x2840e4+'\x20=\x20?',_0x51a2ca['id'][_0xfa38('0x3e')]())))[_0xfa38('0x3e')]();return _0x20da04;};var _0x5249ab=function(_0x461c96,_0x4f2f28){var _0x3caed7=squel[_0xfa38('0x34')]()[_0xfa38('0x35')](_0xfa38('0x36'))[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x38'),_0xfa38('0x39'),_0xfa38('0x27'),_0x4f2f28,_0xfa38('0x3a'),_0xfa38('0x3f')],squel['select']()[_0xfa38('0x3c')]('phone','phone')[_0xfa38('0x3c')]('NOW()',_0xfa38('0x38'))[_0xfa38('0x3c')]('id','ContactId')[_0xfa38('0x3c')](LISTID[_0xfa38('0x3e')](),'ListId')[_0xfa38('0x3c')](_0x461c96['id']['toString'](),_0x4f2f28)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3f'))[_0xfa38('0x40')](_0xfa38('0x46'))[_0xfa38('0x41')](_0xfa38('0x42'))[_0xfa38('0x41')](_0xfa38('0x43'),LISTID[_0xfa38('0x3e')]())[_0xfa38('0x41')](_0xfa38('0x47'),squel[_0xfa38('0x48')](hopperContacts))[_0xfa38('0x41')](_0xfa38('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')]('calleridnum')[_0xfa38('0x40')](_0xfa38('0x49'))['where'](_0x4f2f28+_0xfa38('0x4a'),_0x461c96['id']['toString']()))['where'](_0xfa38('0x45'),squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'))['from'](_0xfa38('0x36'))[_0xfa38('0x41')](_0x4f2f28+_0xfa38('0x4a'),_0x461c96['id'][_0xfa38('0x3e')]())))[_0xfa38('0x3e')]();return _0x3caed7;};function _0x452ab8(_0x582090,_0x5be580){var _0x5211c5=squel[_0xfa38('0x34')]()[_0xfa38('0x35')](_0xfa38('0x36'))[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x38'),_0xfa38('0x39'),_0xfa38('0x27'),_0x5be580,'createdAt',_0xfa38('0x3f')],squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'),_0xfa38('0x21'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x38'))[_0xfa38('0x3c')]('id',_0xfa38('0x39'))[_0xfa38('0x3c')](LISTID['toString'](),_0xfa38('0x27'))[_0xfa38('0x3c')](_0x582090['id']['toString'](),_0x5be580)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3f'))[_0xfa38('0x40')](_0xfa38('0x46'))[_0xfa38('0x41')](_0xfa38('0x42'))[_0xfa38('0x41')](_0xfa38('0x43'),LISTID['toString']())[_0xfa38('0x41')](_0xfa38('0x47'),squel[_0xfa38('0x48')](hopperContacts))[_0xfa38('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xfa38('0x3e')]();return _0x5211c5;}function _0x3e248e(_0x49db04,_0x2c6fdb){var _0x4e81c9=squel[_0xfa38('0x34')]()[_0xfa38('0x35')]('cm_hopper_black')[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x39'),'ListId',_0x2c6fdb,_0xfa38('0x3a'),'updatedAt'],squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')]('phone',_0xfa38('0x21'))[_0xfa38('0x3c')]('id',_0xfa38('0x39'))[_0xfa38('0x3c')](LISTID[_0xfa38('0x3e')](),_0xfa38('0x27'))[_0xfa38('0x3c')](_0x49db04['id'][_0xfa38('0x3e')](),_0x2c6fdb)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3f'))[_0xfa38('0x40')]('cm_contacts')[_0xfa38('0x41')](_0xfa38('0x42'))[_0xfa38('0x41')](_0xfa38('0x43'),LISTID['toString']())[_0xfa38('0x41')](_0xfa38('0x47'),squel['str'](hopperContacts))[_0xfa38('0x41')](_0xfa38('0x44')))['toString']();return _0x4e81c9;}return db['VoiceQueue'][_0xfa38('0x4b')]({'where':{'type':_0xfa38('0x4c')},'attributes':['id',_0xfa38('0x4d')],'include':[{'model':db[_0xfa38('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x115044){var _0x185d68=[];if(_0x115044){var _0x281ed0;for(var _0x5593a1=0x0,_0x23837a;_0x5593a1<_0x115044[_0xfa38('0x19')];_0x5593a1+=0x1){_0x23837a=_0x115044[_0x5593a1][_0xfa38('0x4f')]({'plain':!![]});switch(_0x23837a[_0xfa38('0x4d')]){case _0xfa38('0x50'):_0x185d68[_0xfa38('0x51')](db[_0xfa38('0x52')][_0xfa38('0x53')](_0x5249ab(_0x23837a,_0xfa38('0x54')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));break;case'onlyIfOpen':_0x185d68[_0xfa38('0x51')](db['sequelize'][_0xfa38('0x53')](_0x2f54c3(_0x23837a,_0xfa38('0x54')))['then'](function(){})[_0xfa38('0x30')](_0x3940ae()));break;default:_0x185d68[_0xfa38('0x51')](db['sequelize']['query'](_0x452ab8(_0x23837a,_0xfa38('0x54')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));}}}return _0x185d68;})[_0xfa38('0x55')]()[_0xfa38('0x2e')](function(){return db[_0xfa38('0x56')][_0xfa38('0x4b')]({'where':{'type':_0xfa38('0x4c')},'attributes':['id'],'include':[{'model':db[_0xfa38('0x4e')],'as':_0xfa38('0x57'),'where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x225b30){var _0x57cff4=[];if(_0x225b30){var _0x33d30d;for(var _0x47bbae=0x0,_0x1b09ba;_0x47bbae<_0x225b30[_0xfa38('0x19')];_0x47bbae+=0x1){_0x1b09ba=_0x225b30[_0x47bbae][_0xfa38('0x4f')]({'plain':!![]});_0x57cff4[_0xfa38('0x51')](db[_0xfa38('0x52')]['query'](_0x3e248e(_0x1b09ba,_0xfa38('0x54')))['then'](function(){})['catch'](_0x3940ae()));}}return _0x57cff4;})[_0xfa38('0x55')]();})[_0xfa38('0x2e')](function(){return db['Campaign']['findAll']({'attributes':['id',_0xfa38('0x4d')],'include':[{'model':db[_0xfa38('0x4e')],'as':_0xfa38('0x58'),'where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x22cbd8){var _0x45d03c=[];if(_0x22cbd8){for(var _0x164285=0x0,_0x36c2a1;_0x164285<_0x22cbd8[_0xfa38('0x19')];_0x164285+=0x1){_0x36c2a1=_0x22cbd8[_0x164285][_0xfa38('0x4f')]({'plain':!![]});switch(_0x36c2a1[_0xfa38('0x4d')]){case'always':_0x45d03c['push'](db['sequelize'][_0xfa38('0x53')](_0x5249ab(_0x36c2a1,_0xfa38('0x59')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));break;case _0xfa38('0x5a'):_0x45d03c[_0xfa38('0x51')](db[_0xfa38('0x52')]['query'](_0x2f54c3(_0x36c2a1,'CampaignId'))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));break;default:_0x45d03c[_0xfa38('0x51')](db[_0xfa38('0x52')]['query'](_0x452ab8(_0x36c2a1,_0xfa38('0x59')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));}}}return _0x45d03c;})[_0xfa38('0x55')]();})[_0xfa38('0x2e')](function(){return db[_0xfa38('0x5b')][_0xfa38('0x4b')]({'attributes':['id'],'include':[{'model':db[_0xfa38('0x4e')],'as':_0xfa38('0x57'),'where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x55cc61){var _0x525819=[];if(_0x55cc61){for(var _0x2b5e0e=0x0,_0x7d451c;_0x2b5e0e<_0x55cc61['length'];_0x2b5e0e+=0x1){_0x7d451c=_0x55cc61[_0x2b5e0e][_0xfa38('0x4f')]({'plain':!![]});_0x525819['push'](db[_0xfa38('0x52')]['query'](_0x3e248e(_0x7d451c,_0xfa38('0x59')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));}}return _0x525819;})[_0xfa38('0x55')]();})[_0xfa38('0x30')](function(_0x8bf058){logger['error'](_0xfa38('0x5c'),_0xfa38('0x5d'),_0x8bf058[_0xfa38('0x1c')]);});}var processPromises=function(_0x182cc7){return BPromise[_0xfa38('0x55')](promises)[_0xfa38('0x2e')](function(_0x42c18f){})[_0xfa38('0x30')](function(_0x13c3ff){logger[_0xfa38('0x14')](_0xfa38('0x5e'),JSON[_0xfa38('0x5f')](_0x13c3ff));})[_0xfa38('0x60')](function(){socket[_0xfa38('0x61')](_0xfa38('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x182cc7){return _0x182cc7[_0xfa38('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xfa38('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xfa38('0x2e')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xfa38('0x64')](FILEPATH);}catch(_0x5a72e7){logger[_0xfa38('0x14')](_0xfa38('0x65'),JSON[_0xfa38('0x5f')](_0x5a72e7));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xfa38('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0xfa38('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xfa38('0x11')](',');return db[_0xfa38('0x2b')][_0xfa38('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xfa38('0x2e')](function(_0x57f9a9){var _0x1d6286=fs[_0xfa38('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfa38('0x68')](_0x1d6286,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b4c88,_0x5dab04){total+=0x1;var _0x9e6e98=total;promises[_0xfa38('0x51')](checkRow(_0x3b4c88,_0x57f9a9,_0x9e6e98)['then'](function(){success+=0x1;})['catch'](function(_0x5755e3){if(_0x5755e3[_0xfa38('0x14')]){errors+=0x1;delete _0x5755e3[_0xfa38('0x14')];}else if(_0x5755e3[_0xfa38('0x29')]){duplicates+=0x1;delete _0x5755e3[_0xfa38('0x29')];}rows[_0xfa38('0x51')](_0x5755e3);}));if(total%0xc8===0x0){_0x5dab04['pause']();return processPromises(_0x5dab04);}},'complete':function(){return processPromises()[_0xfa38('0x2e')](function(){logger[_0xfa38('0x69')](_0xfa38('0x6a'));endCsv();});},'error':function(_0x3f4e9a,_0x2bea12){logger[_0xfa38('0x69')]('CSV\x20parse\x20error',JSON[_0xfa38('0x5f')](_0x3f4e9a));endCsv();}});})[_0xfa38('0x30')](function(_0x5a035b){logger[_0xfa38('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xfa38('0x5f')](_0x5a035b));});}main(); \ No newline at end of file +var _0xc581=['get','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_hopper','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_hopper_final','str','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xc581,0xfa));var _0x1c58=function(_0x2eb525,_0x6a2437){_0x2eb525=_0x2eb525-0x0;var _0x5782a6=_0xc581[_0x2eb525];return _0x5782a6;};'use strict';var BPromise=require(_0x1c58('0x0'));var util=require(_0x1c58('0x1'));var _=require(_0x1c58('0x2'));var fs=require('fs');var squel=require(_0x1c58('0x3'));var Papa=require(_0x1c58('0x4'));var Redis=require('ioredis');var db=require(_0x1c58('0x5'))['db'];var config=require(_0x1c58('0x6'));var logger=require(_0x1c58('0x7'))(_0x1c58('0x8'));config[_0x1c58('0x9')]=_[_0x1c58('0xa')](config['redis'],{'host':_0x1c58('0xb'),'port':0x18eb});var socket=require(_0x1c58('0xc'))(new Redis(config['redis']));require(_0x1c58('0xd'))['register'](socket);try{if(!process[_0x1c58('0xe')][0x2]||process[_0x1c58('0xe')][0x2]===_0x1c58('0xf')||process[_0x1c58('0xe')][0x2]===_0x1c58('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x1c58('0xe')][0x2];if(!process[_0x1c58('0xe')][0x3]||process['argv'][0x3]===_0x1c58('0xf')||process[_0x1c58('0xe')][0x3]===_0x1c58('0x10')||!process[_0x1c58('0xe')][0x4]||process[_0x1c58('0xe')][0x4]===_0x1c58('0xf')||process[_0x1c58('0xe')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process['argv'][0x3][_0x1c58('0x11')](','),process[_0x1c58('0xe')][0x4][_0x1c58('0x11')](','));if(!process['argv'][0x5]||process[_0x1c58('0xe')][0x5]===_0x1c58('0xf')||process['argv'][0x5]==='null'){throw new Error(_0x1c58('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0x1c58('0xe')][0x6]!==_0x1c58('0x10')?process['argv'][0x6]:null;var DUPLICATES=process[_0x1c58('0xe')][0x7]&&process[_0x1c58('0xe')][0x7]!==_0x1c58('0xf')&&process[_0x1c58('0xe')][0x7]!==_0x1c58('0x10')?process[_0x1c58('0xe')][0x7]:null;if(!process['argv'][0x8]||process[_0x1c58('0xe')][0x8]===_0x1c58('0xf')||process[_0x1c58('0xe')][0x8]===_0x1c58('0x10')){throw new Error(_0x1c58('0x13'));}var SOCKET_TIMESTAMP=process[_0x1c58('0xe')][0x8];}catch(_0x3b58bc){logger['error'](_0x3b58bc);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(_0x252800,_0x1c6d62,_0x3056ba,_0x5b2926){var _0x169c8b={'message':_0x1c6d62};_0x169c8b[_0x252800]=!![];if(_0x3056ba){_0x169c8b[_0x1c58('0x14')]=_0x3056ba;}if(_0x5b2926){_0x169c8b['index']=_0x5b2926;}return _0x169c8b;}function isEmail(_0xf0290d){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))*$/[_0x1c58('0x15')](_0xf0290d);}function checkRow(_0x203330,_0xa198d4,_0x383bdd){return new BPromise(function(_0x13ab4a,_0x44df58){if(_[_0x1c58('0x16')](_0x203330)){return _0x44df58(handleCheckRowError(_0x1c58('0x17'),_0x1c58('0x18'),null,_0x383bdd));}if(_0x203330['errors']&&_0x203330[_0x1c58('0x19')][_0x1c58('0x1a')]){var _0x147853=_[_0x1c58('0x1b')](_0x203330['errors'],_0x1c58('0x1c'))[_0x1c58('0x1d')](';');return _0x44df58(handleCheckRowError(_0x1c58('0x17'),_0x147853,null,_0x383bdd));}var _0x2c2309={};for(var _0xa07ac in FIELDS){if(FIELDS[_0x1c58('0x1e')](_0xa07ac)&&FIELDS[_0xa07ac]){_0x2c2309[_0xa07ac]=_0x203330[_0x1c58('0x1f')][0x0][FIELDS[_0xa07ac]]||_0x203330[_0x1c58('0x1f')][0x0]['\ufeff'+FIELDS[_0xa07ac]];}}if(!_0x2c2309[_0x1c58('0x20')]){return _0x44df58(handleCheckRowError('error',_0x1c58('0x21'),null,_0x383bdd));}if(!_0x2c2309[_0x1c58('0x22')]){return _0x44df58(handleCheckRowError(_0x1c58('0x17'),'phone\x20not\x20specified!',null,_0x383bdd));}if(_0x2c2309[_0x1c58('0x23')]){var _0x1b5e23=moment(_0x2c2309[_0x1c58('0x23')],_0x1c58('0x24'));if(!_0x1b5e23[_0x1c58('0x25')]()){return _0x44df58(handleCheckRowError(_0x1c58('0x17'),_0x1c58('0x26'),null,_0x383bdd));}}if(_0x2c2309[_0x1c58('0x27')]){if(!isEmail(_0x2c2309['email'])){return _0x44df58(handleCheckRowError(_0x1c58('0x17'),_0x1c58('0x28'),null,_0x383bdd));}}_0x2c2309[_0x1c58('0x29')]=LISTID;_0x2c2309['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1c58('0x1a')]&&_0xa198d4){var _0x46de10={};for(var _0x3b09ed=0x0,_0x2ee8af=DUPLICATES[_0x1c58('0x1a')];_0x3b09ed<_0x2ee8af;_0x3b09ed+=0x1){_0x46de10[DUPLICATES[_0x3b09ed]]=_0x2c2309[DUPLICATES[_0x3b09ed]];}var _0x3a81f8=_[_0x1c58('0x2a')](_0xa198d4,_0x46de10);if(_0x3a81f8){return _0x44df58(handleCheckRowError('duplicate',_0x1c58('0x2b'),_0x3a81f8,_0x383bdd));}}return db[_0x1c58('0x2c')][_0x1c58('0x2d')](_0x2c2309,{'raw':!![],'hooks':![],'fields':_[_0x1c58('0x2e')](_0x2c2309)})[_0x1c58('0x2f')](function(_0x4439bb){if(DUPLICATES&&DUPLICATES[_0x1c58('0x1a')]&&_0xa198d4){_0xa198d4[_0x1c58('0x30')](_[_0x1c58('0x31')](_0x2c2309,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4439bb['id'];return _0x13ab4a();})[_0x1c58('0x32')](function(_0x1dea13){return _0x44df58(handleCheckRowError(_0x1c58('0x17'),_0x1c58('0x33')+(_0x1dea13[_0x1c58('0x1c')]||JSON[_0x1c58('0x34')](_0x1dea13)),null,_0x383bdd));});});}function checkHopper(){function _0x547548(){return function(_0x16dd76){logger[_0x1c58('0x17')](_0x1c58('0x35'),_0x1c58('0x36'),util[_0x1c58('0x37')](_0x16dd76,{'showHidden':![],'depth':null}));};}var _0x103391=function(_0xf48bc,_0x299ae8){var _0x53f979=squel[_0x1c58('0x38')]()[_0x1c58('0x39')]('cm_hopper')[_0x1c58('0x3a')]([_0x1c58('0x22'),_0x1c58('0x3b'),_0x1c58('0x3c'),'ListId',_0x299ae8,_0x1c58('0x3d'),_0x1c58('0x3e')],squel[_0x1c58('0x3f')]()[_0x1c58('0x40')](_0x1c58('0x22'),_0x1c58('0x22'))[_0x1c58('0x40')](_0x1c58('0x41'),_0x1c58('0x3b'))[_0x1c58('0x40')]('id','ContactId')[_0x1c58('0x40')](LISTID[_0x1c58('0x42')](),_0x1c58('0x29'))[_0x1c58('0x40')](_0xf48bc['id']['toString'](),_0x299ae8)['field'](_0x1c58('0x41'),_0x1c58('0x3d'))[_0x1c58('0x40')](_0x1c58('0x41'),_0x1c58('0x3e'))[_0x1c58('0x43')]('cm_contacts')[_0x1c58('0x44')](_0x1c58('0x45'))['where']('ListId\x20=\x20?',LISTID[_0x1c58('0x42')]())[_0x1c58('0x44')](_0x1c58('0x46'))[_0x1c58('0x44')](_0x1c58('0x47'),squel[_0x1c58('0x3f')]()[_0x1c58('0x40')](_0x1c58('0x22'))[_0x1c58('0x43')]('cm_hopper')[_0x1c58('0x44')](_0x299ae8+_0x1c58('0x48'),_0xf48bc['id'][_0x1c58('0x42')]())))[_0x1c58('0x42')]();return _0x53f979;};var _0x1e8e3c=function(_0x1486c3,_0x5621ce){var _0x414459=squel[_0x1c58('0x38')]()['into'](_0x1c58('0x49'))[_0x1c58('0x3a')]([_0x1c58('0x22'),_0x1c58('0x3b'),'ContactId','ListId',_0x5621ce,_0x1c58('0x3d'),_0x1c58('0x3e')],squel[_0x1c58('0x3f')]()[_0x1c58('0x40')]('phone',_0x1c58('0x22'))[_0x1c58('0x40')]('NOW()','scheduledAt')[_0x1c58('0x40')]('id',_0x1c58('0x3c'))[_0x1c58('0x40')](LISTID[_0x1c58('0x42')](),'ListId')[_0x1c58('0x40')](_0x1486c3['id'][_0x1c58('0x42')](),_0x5621ce)[_0x1c58('0x40')](_0x1c58('0x41'),_0x1c58('0x3d'))[_0x1c58('0x40')]('NOW()',_0x1c58('0x3e'))[_0x1c58('0x43')](_0x1c58('0x4a'))[_0x1c58('0x44')](_0x1c58('0x45'))['where'](_0x1c58('0x4b'),LISTID[_0x1c58('0x42')]())[_0x1c58('0x44')](_0x1c58('0x4c'),squel['str'](hopperContacts))[_0x1c58('0x44')](_0x1c58('0x46'))[_0x1c58('0x44')](_0x1c58('0x47'),squel[_0x1c58('0x3f')]()[_0x1c58('0x40')](_0x1c58('0x4d'))[_0x1c58('0x43')](_0x1c58('0x4e'))['where'](_0x5621ce+_0x1c58('0x48'),_0x1486c3['id'][_0x1c58('0x42')]()))[_0x1c58('0x44')](_0x1c58('0x47'),squel[_0x1c58('0x3f')]()['field'](_0x1c58('0x22'))[_0x1c58('0x43')]('cm_hopper')['where'](_0x5621ce+_0x1c58('0x48'),_0x1486c3['id'][_0x1c58('0x42')]())))[_0x1c58('0x42')]();return _0x414459;};function _0x31c9f9(_0x4bed64,_0x4bcc82){var _0x344976=squel[_0x1c58('0x38')]()[_0x1c58('0x39')](_0x1c58('0x49'))[_0x1c58('0x3a')]([_0x1c58('0x22'),_0x1c58('0x3b'),_0x1c58('0x3c'),_0x1c58('0x29'),_0x4bcc82,_0x1c58('0x3d'),'updatedAt'],squel[_0x1c58('0x3f')]()[_0x1c58('0x40')]('phone',_0x1c58('0x22'))[_0x1c58('0x40')](_0x1c58('0x41'),_0x1c58('0x3b'))['field']('id','ContactId')[_0x1c58('0x40')](LISTID[_0x1c58('0x42')](),_0x1c58('0x29'))['field'](_0x4bed64['id'][_0x1c58('0x42')](),_0x4bcc82)[_0x1c58('0x40')]('NOW()',_0x1c58('0x3d'))[_0x1c58('0x40')](_0x1c58('0x41'),_0x1c58('0x3e'))[_0x1c58('0x43')](_0x1c58('0x4a'))[_0x1c58('0x44')](_0x1c58('0x45'))[_0x1c58('0x44')](_0x1c58('0x4b'),LISTID[_0x1c58('0x42')]())[_0x1c58('0x44')](_0x1c58('0x4c'),squel[_0x1c58('0x4f')](hopperContacts))[_0x1c58('0x44')](_0x1c58('0x46')))['toString']();return _0x344976;}function _0x23738e(_0x47026b,_0x5ad0f1){var _0x3fa4d7=squel[_0x1c58('0x38')]()[_0x1c58('0x39')](_0x1c58('0x50'))[_0x1c58('0x3a')]([_0x1c58('0x22'),_0x1c58('0x3c'),'ListId',_0x5ad0f1,_0x1c58('0x3d'),_0x1c58('0x3e')],squel[_0x1c58('0x3f')]()[_0x1c58('0x40')](_0x1c58('0x22'),_0x1c58('0x22'))[_0x1c58('0x40')]('id','ContactId')[_0x1c58('0x40')](LISTID['toString'](),_0x1c58('0x29'))[_0x1c58('0x40')](_0x47026b['id'][_0x1c58('0x42')](),_0x5ad0f1)['field']('NOW()',_0x1c58('0x3d'))[_0x1c58('0x40')]('NOW()','updatedAt')[_0x1c58('0x43')](_0x1c58('0x4a'))['where'](_0x1c58('0x45'))[_0x1c58('0x44')](_0x1c58('0x4b'),LISTID[_0x1c58('0x42')]())[_0x1c58('0x44')](_0x1c58('0x4c'),squel[_0x1c58('0x4f')](hopperContacts))[_0x1c58('0x44')](_0x1c58('0x46')))['toString']();return _0x3fa4d7;}return db[_0x1c58('0x51')][_0x1c58('0x52')]({'where':{'type':'outbound'},'attributes':['id',_0x1c58('0x53')],'include':[{'model':db[_0x1c58('0x54')],'as':_0x1c58('0x55'),'where':{'id':LISTID}}]})[_0x1c58('0x2f')](function(_0x5e49e6){var _0x3da212=[];if(_0x5e49e6){var _0x1afbcf;for(var _0x437b00=0x0,_0x1c32a7;_0x437b00<_0x5e49e6['length'];_0x437b00+=0x1){_0x1c32a7=_0x5e49e6[_0x437b00]['get']({'plain':!![]});switch(_0x1c32a7[_0x1c58('0x53')]){case'always':_0x3da212[_0x1c58('0x30')](db[_0x1c58('0x56')][_0x1c58('0x57')](_0x1e8e3c(_0x1c32a7,_0x1c58('0x58')))[_0x1c58('0x2f')](function(){})['catch'](_0x547548()));break;case _0x1c58('0x59'):_0x3da212[_0x1c58('0x30')](db['sequelize'][_0x1c58('0x57')](_0x103391(_0x1c32a7,_0x1c58('0x58')))[_0x1c58('0x2f')](function(){})['catch'](_0x547548()));break;default:_0x3da212[_0x1c58('0x30')](db['sequelize'][_0x1c58('0x57')](_0x31c9f9(_0x1c32a7,'VoiceQueueId'))[_0x1c58('0x2f')](function(){})['catch'](_0x547548()));}}}return _0x3da212;})[_0x1c58('0x5a')]()[_0x1c58('0x2f')](function(){return db['VoiceQueue'][_0x1c58('0x52')]({'where':{'type':_0x1c58('0x5b')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x1c58('0x2f')](function(_0x42d0e4){var _0x1c611c=[];if(_0x42d0e4){var _0x4ba5e5;for(var _0x40b83e=0x0,_0x2b6cd4;_0x40b83e<_0x42d0e4['length'];_0x40b83e+=0x1){_0x2b6cd4=_0x42d0e4[_0x40b83e][_0x1c58('0x5c')]({'plain':!![]});_0x1c611c[_0x1c58('0x30')](db[_0x1c58('0x56')][_0x1c58('0x57')](_0x23738e(_0x2b6cd4,_0x1c58('0x58')))[_0x1c58('0x2f')](function(){})[_0x1c58('0x32')](_0x547548()));}}return _0x1c611c;})[_0x1c58('0x5a')]();})[_0x1c58('0x2f')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x1c58('0x53')],'include':[{'model':db[_0x1c58('0x54')],'as':_0x1c58('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x12043a){var _0x2ea7b3=[];if(_0x12043a){for(var _0x3f7981=0x0,_0x13aaf7;_0x3f7981<_0x12043a[_0x1c58('0x1a')];_0x3f7981+=0x1){_0x13aaf7=_0x12043a[_0x3f7981][_0x1c58('0x5c')]({'plain':!![]});switch(_0x13aaf7[_0x1c58('0x53')]){case'always':_0x2ea7b3[_0x1c58('0x30')](db[_0x1c58('0x56')][_0x1c58('0x57')](_0x1e8e3c(_0x13aaf7,_0x1c58('0x5d')))[_0x1c58('0x2f')](function(){})['catch'](_0x547548()));break;case'onlyIfOpen':_0x2ea7b3[_0x1c58('0x30')](db['sequelize'][_0x1c58('0x57')](_0x103391(_0x13aaf7,'CampaignId'))[_0x1c58('0x2f')](function(){})['catch'](_0x547548()));break;default:_0x2ea7b3[_0x1c58('0x30')](db[_0x1c58('0x56')][_0x1c58('0x57')](_0x31c9f9(_0x13aaf7,'CampaignId'))[_0x1c58('0x2f')](function(){})['catch'](_0x547548()));}}}return _0x2ea7b3;})['all']();})[_0x1c58('0x2f')](function(){return db['Campaign'][_0x1c58('0x52')]({'attributes':['id'],'include':[{'model':db[_0x1c58('0x54')],'as':_0x1c58('0x5e'),'where':{'id':LISTID}}]})[_0x1c58('0x2f')](function(_0x42a8ed){var _0x441fde=[];if(_0x42a8ed){for(var _0x2b80b4=0x0,_0x357d2e;_0x2b80b4<_0x42a8ed['length'];_0x2b80b4+=0x1){_0x357d2e=_0x42a8ed[_0x2b80b4][_0x1c58('0x5c')]({'plain':!![]});_0x441fde[_0x1c58('0x30')](db[_0x1c58('0x56')][_0x1c58('0x57')](_0x23738e(_0x357d2e,_0x1c58('0x5d')))[_0x1c58('0x2f')](function(){})[_0x1c58('0x32')](_0x547548()));}}return _0x441fde;})[_0x1c58('0x5a')]();})['catch'](function(_0x2927d2){logger[_0x1c58('0x17')](_0x1c58('0x5f'),_0x1c58('0x60'),_0x2927d2[_0x1c58('0x1c')]);});}var processPromises=function(_0x287656){return BPromise['all'](promises)['then'](function(_0x68dabf){})[_0x1c58('0x32')](function(_0x2929fb){logger[_0x1c58('0x17')](_0x1c58('0x61'),JSON[_0x1c58('0x34')](_0x2929fb));})[_0x1c58('0x62')](function(){socket[_0x1c58('0x63')](_0x1c58('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x287656){return _0x287656[_0x1c58('0x65')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x1c58('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x1c58('0x2f')](function(){socket[_0x1c58('0x63')](_0x1c58('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1c58('0x66')](FILEPATH);}catch(_0x4ac7c1){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x4ac7c1));}finally{process[_0x1c58('0x67')](0x0);}});};process['on'](_0x1c58('0x68'),function(){logger[_0x1c58('0x69')](_0x1c58('0x6a'));endCsv();});function main(){return BPromise[_0x1c58('0x6b')]()[_0x1c58('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x1c58('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1c58('0x2f')](function(_0x1a6cf8){var _0x50a9c4=fs[_0x1c58('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1c58('0x6d')](_0x50a9c4,{'header':!![],'skipEmptyLines':!![],'step':function(_0x321f6d,_0x6e3d4c){total+=0x1;var _0x523d29=total;promises[_0x1c58('0x30')](checkRow(_0x321f6d,_0x1a6cf8,_0x523d29)[_0x1c58('0x2f')](function(){success+=0x1;})[_0x1c58('0x32')](function(_0x117ca8){if(_0x117ca8['error']){errors+=0x1;delete _0x117ca8[_0x1c58('0x17')];}else if(_0x117ca8[_0x1c58('0x6e')]){duplicates+=0x1;delete _0x117ca8['duplicate'];}rows[_0x1c58('0x30')](_0x117ca8);}));if(total%0xc8===0x0){_0x6e3d4c[_0x1c58('0x6f')]();return processPromises(_0x6e3d4c);}},'complete':function(){return processPromises()[_0x1c58('0x2f')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x439d81,_0x1296c9){logger[_0x1c58('0x69')](_0x1c58('0x70'),JSON['stringify'](_0x439d81));endCsv();}});})[_0x1c58('0x32')](function(_0x5169e0){logger[_0x1c58('0x17')](_0x1c58('0x71'),JSON[_0x1c58('0x34')](_0x5169e0));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 7d4252d..4c958a2 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 _0x1eab=['name','_description','parse','createReadStream','data','rows','find','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','hasOwnProperty','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','campaigns','campaigns_has_cm_blacklists','CampaignId','voice_queues_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','from','.id\x20=\x20','where','\x20=\x20','join','CmContact','findAll','AdditionalPhones','length','push','all','then','split','isNil','filter','CmContactHasItem','findOne','update','updated','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.updatedAt','insert','into','fromQuery','phone','ContactId','createdAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','ListId','cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','cm_hopper','scheduledat','cm_contacts.id','updatedAt','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','message','exit','errors','code','info','query','spread','catch','error','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','clone','root','.csv','includes','header'];(function(_0x4a9050,_0x525966){var _0x23c28e=function(_0x57c714){while(--_0x57c714){_0x4a9050['push'](_0x4a9050['shift']());}};_0x23c28e(++_0x525966);}(_0x1eab,0x1ad));var _0xb1ea=function(_0x44d323,_0x5f2ee1){_0x44d323=_0x44d323-0x0;var _0x3dd967=_0x1eab[_0x44d323];return _0x3dd967;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xb1ea('0x0'));var Papa=require(_0xb1ea('0x1'));var util=require(_0xb1ea('0x2'));var BPromise=require(_0xb1ea('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xb1ea('0x4'));var shared=require(_0xb1ea('0x5'));var logger=require(_0xb1ea('0x6'))(_0xb1ea('0x7'));config[_0xb1ea('0x8')]=_[_0xb1ea('0x9')](config[_0xb1ea('0x8')],{'host':_0xb1ea('0xa'),'port':0x18eb});var socket=require(_0xb1ea('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xb1ea('0xc')](_0xb1ea('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xb1ea('0xc')](_0xb1ea('0xd'));function isEmail(_0x84cd81){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))*$/[_0xb1ea('0xe')](_0x84cd81);}function selectNotIn(_0x1ad300,_0x302ab3,_0x4df2a1,_0x32b88b,_0x809491){return squel['select']()['field']('phone')[_0xb1ea('0xf')](_0x32b88b)['join'](_0x302ab3,null,_0x302ab3+_0xb1ea('0x10')+_0x32b88b+'.'+_0x4df2a1)[_0xb1ea('0x11')](_0x32b88b+'.'+_0x4df2a1+_0xb1ea('0x12')+_0x1ad300+'.'+_0x4df2a1)[_0xb1ea('0x11')](_0x302ab3+'.dialCheckDuplicateType\x20IN\x20('+_0x809491[_0xb1ea('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3dd70e,_0x2807d6){promisesAdditionalPhones=[];return db[_0xb1ea('0x14')][_0xb1ea('0x15')]({'raw':!![],'attributes':['id',_0xb1ea('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x446e87){if(_0x446e87!==null){var _0xdd8849=[];for(var _0x371c24=0x0;_0x371c24<_0x446e87[_0xb1ea('0x17')];_0x371c24++){var _0xc998de=_0x446e87[_0x371c24];_0xdd8849[_0xb1ea('0x18')](insertAdditionalPhones(_0xc998de));}}Promise[_0xb1ea('0x19')](_0xdd8849)[_0xb1ea('0x1a')](function(){_0x3dd70e({'val':0x1});});});});}function insertAdditionalPhones(_0x3fd34c){return new Promise(function(_0x157728,_0x6b044a){var _0x2c72e8=_0x3fd34c[_0xb1ea('0x16')];var _0x304ecc=_0x2c72e8[_0xb1ea('0x1b')](';');var _0x18b8ef=[];orderBy=0x0;for(var _0x2a12ed=0x0;_0x2a12ed<_0x304ecc['length'];_0x2a12ed++){_0x18b8ef['push'](splitAdditionalPhone(_0x3fd34c['id'],_0x304ecc[_0x2a12ed]));}Promise[_0xb1ea('0x19')](_0x18b8ef)[_0xb1ea('0x1a')](function(){_0x157728({'val':_0x304ecc[_0xb1ea('0x17')]});});});}function splitAdditionalPhone(_0x17e720,_0x83a7ed){return new Promise(function(_0x5eb3e0,_0x4be964){var _0x2d250a=_0x83a7ed['split'](':');var _0x27161c=_0x2d250a[0x0];var _0x2d3be9=_0x2d250a[0x1];if(!_[_0xb1ea('0x1c')](_0x2d3be9)){var _0x19c430=_0x2d3be9[_0xb1ea('0x1b')]('|');var _0x1dbb43=[];for(var _0xfa14bf=0x0;_0xfa14bf<_0x19c430['length'];_0xfa14bf++){if(_0x19c430[_0xfa14bf]!==''){var _0x37829b=_[_0xb1ea('0x1d')](promisesAdditionalPhones,{'contactId':_0x17e720,'phone':_0x19c430[_0xfa14bf]});if(_0x37829b[_0xb1ea('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0xb1ea('0x18')]({'contactId':_0x17e720,'contactTypeId':_0x27161c,'phone':_0x19c430[_0xfa14bf],'orderBy':orderBy});}}}_0x5eb3e0({'ok':0x1});}else _0x5eb3e0({'res':0x0});});}function createAdditionalPhone(_0x5d1bcf,_0x330bed,_0x36f808,_0x44797b){var _0x2bb978='';var _0x39ea3f='';var _0x242097=_0x36f808[_0xb1ea('0x1b')]('§');_0x2bb978=_0x242097[0x0];if(_0x242097[_0xb1ea('0x17')]==0x2)_0x39ea3f=_0x242097[0x1];return new Promise(function(_0x4a9459,_0x5bd84e){return db[_0xb1ea('0x1e')][_0xb1ea('0x1f')]({'where':{'CmContactId':_0x5d1bcf,'item':_0x2bb978}})['then'](function(_0x4a90b3){if(_0x4a90b3){return db[_0xb1ea('0x1e')][_0xb1ea('0x20')]({'ItemTypeId':_0x330bed,'description':_0x39ea3f,'OrderBy':_0x44797b},{'where':{'CmContactId':_0x5d1bcf,'item':_0x2bb978}})[_0xb1ea('0x1a')](function(_0x1dad92){_0x4a9459({'res':_0xb1ea('0x21')});});}else{return db[_0xb1ea('0x1e')]['create']({'CmContactId':_0x5d1bcf,'item':_0x2bb978,'description':_0x39ea3f,'ItemTypeId':_0x330bed,'OrderBy':_0x44797b,'ItemClass':_0xb1ea('0x22')})['then'](function(_0x366aa2){_0x4a9459({'res':_0xb1ea('0x23')});});}});});}function insertCmHopper(_0x90e071,_0x39e20d,_0xb7b964,_0x2d80fd,_0x30dc03){var _0x8f4919=['cm_contacts.phone',_0xb1ea('0x24'),'cm_contacts.id','cm_contacts.ListId',_0x39e20d+'.'+_0x2d80fd,'cm_contacts.createdAt',_0xb1ea('0x25'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x30dc03+'\x22'];return squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')]('cm_hopper')[_0xb1ea('0x28')]([_0xb1ea('0x29'),'scheduledat',_0xb1ea('0x2a'),'ListId',_0x2d80fd,_0xb1ea('0x2b'),'updatedAt',_0xb1ea('0x2c'),_0xb1ea('0x2d'),_0xb1ea('0x2e')],squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x8f4919)[_0xb1ea('0xf')](_0x39e20d)[_0xb1ea('0x13')](_0xb1ea('0x31'),null,_0xb1ea('0x32')+_0x39e20d+_0xb1ea('0x33'))[_0xb1ea('0x13')](_0xb7b964,null,_0xb7b964+_0xb1ea('0x10')+_0x39e20d+'.'+_0x2d80fd)[_0xb1ea('0x11')](_0x39e20d+_0xb1ea('0x34'),_0x90e071)[_0xb1ea('0x11')](_0xb1ea('0x35'),NOW)[_0xb1ea('0x11')](_0xb1ea('0x36'),selectNotIn(_0x39e20d,_0xb7b964,_0x2d80fd,'cm_hopper',[_0xb1ea('0x37'),_0xb1ea('0x38')]))[_0xb1ea('0x11')](_0xb1ea('0x36'),selectNotIn(_0x39e20d,_0xb7b964,_0x2d80fd,'cm_hopper',[_0xb1ea('0x37')])))[_0xb1ea('0x39')]();}function insertCmHopperBlack(_0x37d1ee,_0x4af53a,_0x3ce1fa,_0x14b7dc){var _0x14b0da=['cm_contacts.phone','cm_contacts.id',_0xb1ea('0x3a'),_0x4af53a+'.'+_0x14b7dc,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xb1ea('0x27')](_0xb1ea('0x3b'))[_0xb1ea('0x28')]([_0xb1ea('0x29'),_0xb1ea('0x2a'),_0xb1ea('0x3c'),_0x14b7dc,_0xb1ea('0x2b'),'updatedAt'],squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x14b0da)['from'](_0x4af53a)['join'](_0xb1ea('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x4af53a+_0xb1ea('0x33'))[_0xb1ea('0x13')](_0x3ce1fa,null,_0x3ce1fa+_0xb1ea('0x10')+_0x4af53a+'.'+_0x14b7dc)['where'](_0x4af53a+_0xb1ea('0x34'),_0x37d1ee)[_0xb1ea('0x11')](_0xb1ea('0x35'),NOW)[_0xb1ea('0x11')](_0xb1ea('0x36'),squel[_0xb1ea('0x2f')]()['field'](_0xb1ea('0x29'))[_0xb1ea('0xf')]('cm_hopper_black')[_0xb1ea('0x11')]('ListId\x20=\x20?',_0x37d1ee)[_0xb1ea('0x11')](_0x14b7dc+_0xb1ea('0x12')+_0x4af53a+'.'+_0x14b7dc)))[_0xb1ea('0x39')]();}function insertTzCmHopper(_0x10e63d,_0x437790,_0x13c394,_0x38ad44,_0x50350a,_0x3f53a1){var _0x419bbc=[_0xb1ea('0x3d'),_0xb1ea('0x3e')+_0x3f53a1+_0xb1ea('0x3f'),'cm_contacts.id',_0xb1ea('0x3a'),_0x437790+'.'+_0x38ad44,_0xb1ea('0x40'),_0xb1ea('0x25'),_0xb1ea('0x41'),_0xb1ea('0x42'),'\x22'+_0x50350a+'\x22'];var _0x329044=squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')](_0xb1ea('0x43'))[_0xb1ea('0x28')]([_0xb1ea('0x29'),_0xb1ea('0x44'),_0xb1ea('0x2a'),_0xb1ea('0x3c'),_0x38ad44,_0xb1ea('0x2b'),'updatedAt',_0xb1ea('0x2c'),'UserId',_0xb1ea('0x2e')],squel[_0xb1ea('0x2f')]()['fields'](_0x419bbc)[_0xb1ea('0xf')](_0x437790)[_0xb1ea('0x13')](_0xb1ea('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x437790+'.CmListId')['join'](_0x13c394,null,_0x13c394+_0xb1ea('0x10')+_0x437790+'.'+_0x38ad44)[_0xb1ea('0x13')](_0x3f53a1,null,_0x3f53a1+_0xb1ea('0x10')+_0x437790+'.'+_0x38ad44)[_0xb1ea('0x11')](_0x437790+'.CmListId\x20=\x20?',_0x10e63d)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb1ea('0x36'),selectNotIn(_0x437790,_0x13c394,_0x38ad44,_0xb1ea('0x43'),[_0xb1ea('0x37'),_0xb1ea('0x38')]))['where'](_0xb1ea('0x36'),selectNotIn(_0x437790,_0x13c394,_0x38ad44,'cm_hopper',[_0xb1ea('0x37')])))['toString']();return _0x329044;}function insertTzCmHopperBlack(_0x36a72e,_0x4f6b06,_0x4ded13,_0x1bcae0){var _0x33140f=[_0xb1ea('0x3d'),_0xb1ea('0x45'),_0xb1ea('0x3a'),_0x4f6b06+'.'+_0x1bcae0,_0xb1ea('0x40'),_0xb1ea('0x25')];return squel[_0xb1ea('0x26')]()['into'](_0xb1ea('0x3b'))[_0xb1ea('0x28')]([_0xb1ea('0x29'),_0xb1ea('0x2a'),'ListId',_0x1bcae0,_0xb1ea('0x2b'),_0xb1ea('0x46')],squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x33140f)[_0xb1ea('0xf')](_0x4f6b06)[_0xb1ea('0x13')](_0xb1ea('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x4f6b06+_0xb1ea('0x33'))[_0xb1ea('0x13')](_0x4ded13,null,_0x4ded13+_0xb1ea('0x10')+_0x4f6b06+'.'+_0x1bcae0)[_0xb1ea('0x11')](_0x4f6b06+'.CmListId\x20=\x20?',_0x36a72e)[_0xb1ea('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb1ea('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb1ea('0x2f')]()[_0xb1ea('0x47')](_0xb1ea('0x29'))[_0xb1ea('0xf')]('cm_hopper_black')[_0xb1ea('0x11')](_0xb1ea('0x48'),_0x36a72e)[_0xb1ea('0x11')](_0x1bcae0+_0xb1ea('0x12')+_0x4f6b06+'.'+_0x1bcae0)))[_0xb1ea('0x39')]();}function insertCmHopperAdditionalPhones(_0x456036){var _0x410f4b=[_0xb1ea('0x49'),'cm_contact_has_items.item',_0xb1ea('0x4a'),_0xb1ea('0x4b'),_0xb1ea('0x4c')];return squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')](_0xb1ea('0x4d'))[_0xb1ea('0x28')]([_0xb1ea('0x4e'),'phone','OrderBy',_0xb1ea('0x2b'),_0xb1ea('0x46')],squel['select']()[_0xb1ea('0x30')](_0x410f4b)['from']('cm_hopper')[_0xb1ea('0x13')](_0xb1ea('0x31'),null,_0xb1ea('0x4f'))[_0xb1ea('0x13')]('cm_contact_has_items',null,_0xb1ea('0x50'))['where']('cm_hopper.ListId\x20=\x20?',_0x456036)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0xb1ea('0x39')]();}function insertCmContact(_0x400256,_0x4e9bf3,_0x166dfc,_0x195019){var _0x1f0909=_[_0xb1ea('0x51')](_[_0xb1ea('0x52')](_0x195019),[_0xb1ea('0x3c'),'CompanyId',_0xb1ea('0x2b'),_0xb1ea('0x46'),_0xb1ea('0x53')]);return squel['insert']()[_0xb1ea('0x27')]('cm_contacts')[_0xb1ea('0x28')](_0x1f0909,squel[_0xb1ea('0x2f')]()['fields'](_0x1f0909)[_0xb1ea('0xf')](_0x4e9bf3)[_0xb1ea('0x11')]('('+_0x166dfc[_0xb1ea('0x13')](',')+_0xb1ea('0x54'),squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x166dfc)[_0xb1ea('0xf')](_0xb1ea('0x31'))['where'](_0xb1ea('0x48'),_0x400256)['where'](_0xb1ea('0x55')))[_0xb1ea('0x11')](_0xb1ea('0x56'),squel[_0xb1ea('0x2f')]()[_0xb1ea('0x47')](_0xb1ea('0x57'),_0xb1ea('0x58'))[_0xb1ea('0xf')](_0x4e9bf3)[_0xb1ea('0x59')](_0x166dfc[_0xb1ea('0x13')](','))))[_0xb1ea('0x39')]();}function handleStop(){logger['info'](_0xb1ea('0x5a'));stopped=!![];}function handleUncaughtException(_0x3679b0){logger['error'](_0x3679b0[_0xb1ea('0x5b')]);process[_0xb1ea('0x5c')](0x1);}function handleError(_0x22cce,_0xd8eef6){stats[_0xb1ea('0x5d')][_0xb1ea('0x18')]({'name':_0xd8eef6[_0xb1ea('0x5e')],'message':_0xd8eef6[_0xb1ea('0x5b')],'row':_0x22cce});}function handleQuery(_0x3a0ea6){logger[_0xb1ea('0x5f')](_0x3a0ea6);return db['sequelize'][_0xb1ea('0x60')](_0x3a0ea6)[_0xb1ea('0x61')](function(_0x31ca92){results[_0xb1ea('0x18')](_0x31ca92);})[_0xb1ea('0x62')](function(_0x4b4ad9){logger[_0xb1ea('0x63')](_0x4b4ad9[_0xb1ea('0x5b')]);});}function updateTzCampaigns(_0x375b01){return new Promise(function(_0x4ac579,_0x9749eb){var _0x829122=squel['select']()[_0xb1ea('0x30')]([_0xb1ea('0x64'),'campaigns.dialTimezone'])[_0xb1ea('0xf')]('campaigns')[_0xb1ea('0x13')](_0xb1ea('0x65'),null,_0xb1ea('0x66'))['where'](_0xb1ea('0x67')+_0x375b01);db[_0xb1ea('0x68')][_0xb1ea('0x60')](_0x829122[_0xb1ea('0x39')]())[_0xb1ea('0x61')](function(_0x57109a){var _0x46a164=[];for(var _0x534f65=0x0;_0x534f65<_0x57109a['length'];_0x534f65++){_0x46a164[_0xb1ea('0x18')](getTimezoneData(_0x57109a[_0x534f65],tmp_campaigns));}BPromise[_0xb1ea('0x19')](_0x46a164)[_0xb1ea('0x1a')](function(){_0x4ac579({'val':0x1});});})[_0xb1ea('0x62')](function(_0x289672){logger[_0xb1ea('0x63')](_0x289672[_0xb1ea('0x5b')]);_0x4ac579({'val':0x0});});});}function updateTzVoiceQueues(_0x195ec9){return new Promise(function(_0x5ed1db,_0x353cd9){var _0x5d464a=squel['select']()[_0xb1ea('0x30')]([_0xb1ea('0x69'),_0xb1ea('0x6a')])[_0xb1ea('0xf')](_0xb1ea('0x6b'))['join'](_0xb1ea('0x6c'),null,_0xb1ea('0x6d'))[_0xb1ea('0x11')](_0xb1ea('0x6e')+_0x195ec9);db[_0xb1ea('0x68')]['query'](_0x5d464a[_0xb1ea('0x39')]())[_0xb1ea('0x61')](function(_0x4f6853){var _0x191a7d=[];for(var _0x3576d2=0x0;_0x3576d2<_0x4f6853[_0xb1ea('0x17')];_0x3576d2++){_0x191a7d[_0xb1ea('0x18')](getTimezoneData(_0x4f6853[_0x3576d2],tmp_voice_queues));}BPromise[_0xb1ea('0x19')](_0x191a7d)['then'](function(){_0x5ed1db({'val':0x1});});})[_0xb1ea('0x62')](function(_0x55701d){logger[_0xb1ea('0x63')](_0x55701d['message']);_0x5ed1db({'val':0x0});});});}function getTimezoneData(_0x5acde2,_0x23b20a){return new Promise(function(_0x2690aa,_0x3b3f38){var _0x3ff27d=shared[_0xb1ea('0x6f')];var _0xa83deb=_0x3ff27d[_0x5acde2[_0xb1ea('0x70')]];if(_[_0xb1ea('0x1c')](_0xa83deb)){_0x2690aa({'ret':0x1});}else{var _0x5ddd47=_0xa83deb[_0xb1ea('0x71')];var _0x2e724f=squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')](_0x23b20a)['set']('id',_0x5acde2['id'])[_0xb1ea('0x72')](_0xb1ea('0x73'),_0x5ddd47)['set'](_0xb1ea('0x70'),_0x5acde2[_0xb1ea('0x70')])[_0xb1ea('0x39')]();return db['sequelize']['query'](_0x2e724f)[_0xb1ea('0x61')](function(_0x414476){_0x2690aa({'ret':0x1});})[_0xb1ea('0x62')](function(_0x27aaa8){logger[_0xb1ea('0x63')](_0x27aaa8[_0xb1ea('0x5b')]);_0x3b3f38({'ret':0x1});});}});}function handleTZQuery(_0x348e70){logger['info'](_0x348e70);return db[_0xb1ea('0x68')][_0xb1ea('0x60')](_0x348e70)[_0xb1ea('0x61')](function(_0x1a7a2c){})[_0xb1ea('0x62')](function(_0x1400fd){logger['error'](_0x1400fd['message']);});}function main(_0x3091a7,_0x16fc39,_0x330c2a,_0x364748){logger['info'](_0xb1ea('0x74'),_0x3091a7,JSON[_0xb1ea('0x75')](_0x16fc39));process[_0xb1ea('0x76')](_0xb1ea('0x77'));var _0x33a0a0=_0x16fc39[_0xb1ea('0x78')];var _0x40f056=_[_0xb1ea('0x79')](_0x33a0a0);var _0x39fc7e=_0x16fc39['socket_timestamp'];var _0xad9114=path[_0xb1ea('0x13')](config[_0xb1ea('0x7a')],'server/files/tmp',_0x39fc7e+_0xb1ea('0x7b'));hasTZ=_['keys'](_0x33a0a0)[_0xb1ea('0x7c')](_0xb1ea('0x70'));var _0x546434=_[_0xb1ea('0x52')](_0x33a0a0)['join']();logger[_0xb1ea('0x5f')](_0xb1ea('0x7d'),_0x546434);db['ContactItemType'][_0xb1ea('0x15')]({'raw':!![],'attributes':['id',_0xb1ea('0x7e')]})['then'](function(_0x2b4e33){for(var _0x4587c7=0x0;_0x4587c7<_0x2b4e33['length'];_0x4587c7++){if(_0x2b4e33[_0x4587c7][_0xb1ea('0x7e')]in _0x33a0a0){contactItemTypes[_0xb1ea('0x18')](_0x2b4e33[_0x4587c7]);delete _0x40f056[_0x2b4e33[_0x4587c7][_0xb1ea('0x7e')]];hasAdditionalPhones=!![];}for(var _0x1fefba in _0x33a0a0){if(_0x2b4e33[_0x4587c7][_0xb1ea('0x7e')]+_0xb1ea('0x7f')===_0x1fefba){phoneDescriptions[_0xb1ea('0x18')]({'itemTypeId':_0x2b4e33[_0x4587c7]['id'],'description':_0x1fefba});delete _0x40f056[_0x1fefba];}}}if(hasAdditionalPhones)_0x40f056[_0xb1ea('0x16')]='';var _0x5150dc=_[_0xb1ea('0x52')](_0x40f056)[_0xb1ea('0x13')]();logger[_0xb1ea('0x5f')](_0xb1ea('0x7d'),_0x5150dc);fs['writeFileSync'](_0xad9114,_0x5150dc+'\x0a');Papa[_0xb1ea('0x80')](fs[_0xb1ea('0x81')](_0x3091a7),{'header':!![],'skipEmptyLines':!![],'step':function(_0xd3a25f,_0x10f796){try{for(var _0x23a0b9=0x0,_0x36877d=[];_0x23a0b9<_0xd3a25f[_0xb1ea('0x82')]['length'];_0x23a0b9++){stats[_0xb1ea('0x83')]+=0x1;if(_0xd3a25f[_0xb1ea('0x5d')][_0x23a0b9]){handleError(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9],_0xd3a25f[_0xb1ea('0x5d')][_0x23a0b9]);}else{var _0x44d588=[];var _0x167f8e=[];var _0x452761={};for(var _0x37327d in _0x33a0a0){let _0x1debe7=contactItemTypes[_0xb1ea('0x84')](_0x5c9e9e=>_0x5c9e9e['name']===_0x37327d);let _0x429e68=contactItemTypes[_0xb1ea('0x84')](_0x231df2=>_0x231df2[_0xb1ea('0x7e')]+_0xb1ea('0x7f')===_0x37327d);if(_[_0xb1ea('0x1c')](_0x1debe7)&&_['isNil'](_0x429e68)){if(_0x33a0a0['hasOwnProperty'](_0x37327d)){if(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]]){var _0x581e23=_[_0xb1ea('0x85')](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]][_0xb1ea('0x86')](/"/g,'\x27'));switch(_0x37327d){case _0xb1ea('0x44'):var _0x4a7798=moment(_0x581e23,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4a7798[_0xb1ea('0x87')]()){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');}else{_0x44d588[_0xb1ea('0x18')](_0xb1ea('0x88'));}break;case _0xb1ea('0x2c'):var _0x3ad89d=parseInt(_0x581e23);_0x581e23=_[_0xb1ea('0x89')](_0x3ad89d)||_0x3ad89d<0x0||_0x3ad89d>0x4?_0x364748?0x3:0x2:_0x3ad89d;_0x36877d['push']('\x22'+_0x581e23+'\x22');break;case _0xb1ea('0x2d'):var _0x442e22=parseInt(_0x581e23);if(_[_0xb1ea('0x8a')](_0x442e22)&&_[_0xb1ea('0x7c')](_0x330c2a,_0x442e22)){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x442e22+'\x22');}else{_0x44d588['push']('agent\x20not\x20exists');}break;case _0xb1ea('0x8b'):if(isEmail(_0x581e23)){_0x36877d['push']('\x22'+_0x581e23+'\x22');}else{_0x44d588[_0xb1ea('0x18')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x10bb7e=moment(_0x581e23,_0xb1ea('0x8c'),!![]);if(_0x10bb7e['isValid']()){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');}else{_0x44d588[_0xb1ea('0x18')](_0xb1ea('0x8d'));}break;case _0xb1ea('0x70'):var _0xfd7d18=shared[_0xb1ea('0x6f')];var _0x5da673=_0xfd7d18[_0x581e23];if(!_[_0xb1ea('0x1c')](_0x5da673)){var _0x61eb14=_0x5da673[_0xb1ea('0x71')];_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');_0x36877d[_0xb1ea('0x18')]('\x22'+_0x61eb14+'\x22');}break;default:_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');}}else{switch(_0x37327d){case'firstName':case _0xb1ea('0x29'):_0x44d588[_0xb1ea('0x18')](_0x37327d+_0xb1ea('0x8e'));break;default:_0x36877d[_0xb1ea('0x18')]('\x22\x22');}}}}else{var _0x39bd09='';if(!_[_0xb1ea('0x1c')](_0x1debe7)){if(!_0x452761[_0xb1ea('0x8f')](_0x1debe7['id'])){if(!_[_0xb1ea('0x1c')](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]])){var _0x581e23=_['trim'](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]][_0xb1ea('0x86')](/"/g,'\x27'));var _0x44a01e=phoneDescriptions['find'](_0x1674b6=>_0x1674b6['itemTypeId']===_0x1debe7['id']);if(!_[_0xb1ea('0x1c')](_0x44a01e)){var _0x42b73f=_['trim'](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x44a01e['description']]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x42b73f))_0x581e23=_0x581e23+'§'+_0x42b73f;}if(_0x39bd09=='')_0x39bd09=_0x581e23;else _0x39bd09+='|'+_0x581e23;}_0x167f8e[_0xb1ea('0x18')](_0x1debe7['id']+':'+_0x39bd09);_0x452761[_0x1debe7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x167f8e['join'](';')+'\x22');}if(_0x44d588['length']){handleError(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9],{'code':'SystemRow','message':_0x44d588['join']()});}else{fs['appendFileSync'](_0xad9114,_0x36877d[_0xb1ea('0x13')]()+'\x0a');}_0x36877d=[];}if(!(stats['rows']%0xc8)){socket[_0xb1ea('0x90')]('contact:import:'+_0x39fc7e,stats);stats[_0xb1ea('0x5d')]=[];}}if(stopped){logger[_0xb1ea('0x5f')](_0xb1ea('0x91'));_0x10f796[_0xb1ea('0x92')]();}}catch(_0x181333){handleError(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9],{'code':_0xb1ea('0x93'),'message':_0x181333['message']});logger[_0xb1ea('0x63')](_0xb1ea('0x94'),_0x181333[_0xb1ea('0x5b')]);}},'complete':function(){try{var _0x3c2300=[];var _0x20a1d9=[];var _0x332b2c=_0xb1ea('0x31');if(_0x16fc39[_0xb1ea('0x95')]&&_0x16fc39[_0xb1ea('0x95')][_0xb1ea('0x17')]){_0x332b2c=_0xb1ea('0x96')+_0x39fc7e;_0x3c2300[_0xb1ea('0x18')](_0xb1ea('0x97')+_0x332b2c+_0xb1ea('0x98'));}tmp_campaigns=_0xb1ea('0x99')+_0x39fc7e;tmp_voice_queues=_0xb1ea('0x9a')+_0x39fc7e;_0x20a1d9[_0xb1ea('0x18')](_0xb1ea('0x97')+tmp_campaigns+_0xb1ea('0x9b'));_0x20a1d9[_0xb1ea('0x18')](_0xb1ea('0x97')+tmp_voice_queues+_0xb1ea('0x9b'));BPromise[_0xb1ea('0x9c')](_0x20a1d9,handleTZQuery)['then'](function(_0x4e7e70){updateTzCampaigns(_0x16fc39[_0xb1ea('0x3c')])[_0xb1ea('0x1a')](function(_0x2381f5){updateTzVoiceQueues(_0x16fc39['ListId'])[_0xb1ea('0x1a')](function(_0x13eb37){if(hasTZ)_0x5150dc=_0x5150dc[_0xb1ea('0x86')](_0xb1ea('0x70'),_0xb1ea('0x9d'));var _0x410b02=util[_0xb1ea('0xc')](_0xb1ea('0x9e'),_0xad9114,_0x332b2c,_0x5150dc,_0x16fc39[_0xb1ea('0x3c')],_0x16fc39['CompanyId']||null,NOW,NOW);if(_[_0xb1ea('0x1c')](_0x33a0a0[_0xb1ea('0x44')])){_0x410b02+=_0xb1ea('0x9f');}_0x3c2300['push'](_0x410b02);if(_0x16fc39[_0xb1ea('0x95')]&&_0x16fc39[_0xb1ea('0x95')]['length']){_0x3c2300[_0xb1ea('0x18')](insertCmContact(_0x16fc39[_0xb1ea('0x3c')],_0x332b2c,_0x16fc39[_0xb1ea('0x95')],_0x33a0a0));_0x3c2300[_0xb1ea('0x18')](_0xb1ea('0xa0')+_0x332b2c+';');}BPromise[_0xb1ea('0x9c')](_0x3c2300,handleQuery)[_0xb1ea('0x1a')](function(_0x5c0a78){BPromise['all']([handleAdditionalPhones()])[_0xb1ea('0x1a')](function(){_0x3c2300=[];for(var _0x453ad2=0x0;_0x453ad2\x20\x20');}var _0x578018=path['join'](config['root'],_0xb1ea('0xaf'),process[_0xb1ea('0xae')][0x2]);if(!fs[_0xb1ea('0xb0')](_0x578018)){throw new Error('file\x20doesn\x27t\x20exists');}var _0xa9362a={};try{_0xa9362a=JSON[_0xb1ea('0x80')](process[_0xb1ea('0xae')][0x3]);if(!_0xa9362a['binding']){throw new Error(_0xb1ea('0xb1'));}if(!_0xa9362a[_0xb1ea('0x78')][_0xb1ea('0x29')]){throw new Error(_0xb1ea('0xb2'));}if(!_0xa9362a['binding'][_0xb1ea('0xb3')]){throw new Error(_0xb1ea('0xb4'));}var _0x5913a1=0x0;if(_0xa9362a[_0xb1ea('0x78')][_0xb1ea('0x2d')]){_0x5913a1=0x1;}if(!_0xa9362a[_0xb1ea('0x3c')]){throw new Error(_0xb1ea('0xb5'));}}catch(_0x26627c){throw new Error(_0xb1ea('0xb6'));}var _0x42b78b=[];try{_0x42b78b=_['map'](JSON[_0xb1ea('0x80')](process[_0xb1ea('0xae')][0x4]),'id');}catch(_0x148455){logger[_0xb1ea('0x5f')](_0xb1ea('0xb7'));}main(_0x578018,_0xa9362a,_0x42b78b,_0x5913a1);}validate();process['on']('SIGINT',handleStop);process['on'](_0xb1ea('0xb8'),handleUncaughtException); \ No newline at end of file +var _0x669d=['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','DROP\x20TABLE\x20','contactTypeId','orderBy','VoiceQueueId','campaigns','campaigns_has_cm_blacklists','CampaignId','voice_queues_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../config/environment','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','push','AdditionalPhones','split','length','isNil','filter','findOne','CmContactHasItem','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','fromQuery','fields','cm_contacts','.CmListId','cm_hopper_black','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','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','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','group','Received\x20SIGINT','error','message','exit','errors','code','info','sequelize','spread','catch','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','all','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','query','timezones','utcOffset','set','offset','main','stringify','send','start','binding','root','server/files/tmp','.csv','includes','dialTimezone','keys','header','ContactItemType','name','_description','writeFileSync','parse','data','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','YYYY-MM-DD','firstName','\x20not\x20specified','find','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each'];(function(_0x54fcee,_0x1f449d){var _0x4334e2=function(_0x3a8d33){while(--_0x3a8d33){_0x54fcee['push'](_0x54fcee['shift']());}};_0x4334e2(++_0x1f449d);}(_0x669d,0x17d));var _0xd669=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x669d[_0x5f3f88];return _0xd08119;};'use strict';var fs=require('fs');var path=require(_0xd669('0x0'));var _=require(_0xd669('0x1'));var Papa=require(_0xd669('0x2'));var util=require(_0xd669('0x3'));var BPromise=require(_0xd669('0x4'));var moment=require('moment');var squel=require(_0xd669('0x5'));var Redis=require(_0xd669('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0xd669('0x7'));var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0xd669('0x8'));config[_0xd669('0x9')]=_[_0xd669('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd669('0xb'))(new Redis(config[_0xd669('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xd669('0xc')](_0xd669('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xd669('0xc')](_0xd669('0xd'));function isEmail(_0x2cbca8){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'](_0x2cbca8);}function selectNotIn(_0x9e58d6,_0x4d6e1f,_0x142de5,_0x4206f4,_0x499fcd){return squel[_0xd669('0xe')]()[_0xd669('0xf')](_0xd669('0x10'))[_0xd669('0x11')](_0x4206f4)[_0xd669('0x12')](_0x4d6e1f,null,_0x4d6e1f+_0xd669('0x13')+_0x4206f4+'.'+_0x142de5)[_0xd669('0x14')](_0x4206f4+'.'+_0x142de5+_0xd669('0x15')+_0x9e58d6+'.'+_0x142de5)[_0xd669('0x14')](_0x4d6e1f+_0xd669('0x16')+_0x499fcd['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x52c2c0,_0x53d96a){promisesAdditionalPhones=[];return db[_0xd669('0x17')][_0xd669('0x18')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xd669('0x19')](function(_0x264d41){if(_0x264d41!==null){var _0x3e8f04=[];for(var _0x2960ce=0x0;_0x2960ce<_0x264d41['length'];_0x2960ce++){var _0x468e94=_0x264d41[_0x2960ce];_0x3e8f04[_0xd669('0x1a')](insertAdditionalPhones(_0x468e94));}}Promise['all'](_0x3e8f04)[_0xd669('0x19')](function(){_0x52c2c0({'val':0x1});});});});}function insertAdditionalPhones(_0x53a7c3){return new Promise(function(_0x4efa65,_0x263c5c){var _0x1c9f97=_0x53a7c3[_0xd669('0x1b')];var _0x34c1d3=_0x1c9f97[_0xd669('0x1c')](';');var _0x3ffbdc=[];orderBy=0x0;for(var _0x3c00eb=0x0;_0x3c00eb<_0x34c1d3[_0xd669('0x1d')];_0x3c00eb++){_0x3ffbdc[_0xd669('0x1a')](splitAdditionalPhone(_0x53a7c3['id'],_0x34c1d3[_0x3c00eb]));}Promise['all'](_0x3ffbdc)[_0xd669('0x19')](function(){_0x4efa65({'val':_0x34c1d3[_0xd669('0x1d')]});});});}function splitAdditionalPhone(_0x5ad443,_0x4e4ec1){return new Promise(function(_0x3b244d,_0x5653bb){var _0x39474a=_0x4e4ec1[_0xd669('0x1c')](':');var _0x24b672=_0x39474a[0x0];var _0x29e1ec=_0x39474a[0x1];if(!_[_0xd669('0x1e')](_0x29e1ec)){var _0x516ad5=_0x29e1ec[_0xd669('0x1c')]('|');var _0x1e6c59=[];for(var _0x3d2923=0x0;_0x3d2923<_0x516ad5[_0xd669('0x1d')];_0x3d2923++){if(_0x516ad5[_0x3d2923]!==''){var _0x4d59ea=_[_0xd669('0x1f')](promisesAdditionalPhones,{'contactId':_0x5ad443,'phone':_0x516ad5[_0x3d2923]});if(_0x4d59ea[_0xd669('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0xd669('0x1a')]({'contactId':_0x5ad443,'contactTypeId':_0x24b672,'phone':_0x516ad5[_0x3d2923],'orderBy':orderBy});}}}_0x3b244d({'ok':0x1});}else _0x3b244d({'res':0x0});});}function createAdditionalPhone(_0x3ed2e,_0x21cf52,_0x4ce46f,_0x37468e){var _0x2b20b3='';var _0x297fbe='';var _0x1b252c=_0x4ce46f[_0xd669('0x1c')]('§');_0x2b20b3=_0x1b252c[0x0];if(_0x1b252c[_0xd669('0x1d')]==0x2)_0x297fbe=_0x1b252c[0x1];return new Promise(function(_0x612db8,_0x256bcd){return db['CmContactHasItem'][_0xd669('0x20')]({'where':{'CmContactId':_0x3ed2e,'item':_0x2b20b3}})[_0xd669('0x19')](function(_0x4346ca){if(_0x4346ca){return db[_0xd669('0x21')]['update']({'ItemTypeId':_0x21cf52,'description':_0x297fbe,'OrderBy':_0x37468e},{'where':{'CmContactId':_0x3ed2e,'item':_0x2b20b3}})[_0xd669('0x19')](function(_0x24003e){_0x612db8({'res':'updated'});});}else{return db['CmContactHasItem'][_0xd669('0x22')]({'CmContactId':_0x3ed2e,'item':_0x2b20b3,'description':_0x297fbe,'ItemTypeId':_0x21cf52,'OrderBy':_0x37468e,'ItemClass':'PHONE'})[_0xd669('0x19')](function(_0x57c484){_0x612db8({'res':_0xd669('0x23')});});}});});}function insertCmHopper(_0x5da510,_0x38108a,_0xe6b86f,_0x3ca5dc,_0x3209b4){var _0x1dd328=[_0xd669('0x24'),_0xd669('0x25'),_0xd669('0x26'),_0xd669('0x27'),_0x38108a+'.'+_0x3ca5dc,'cm_contacts.createdAt',_0xd669('0x28'),_0xd669('0x29'),_0xd669('0x2a'),'\x22'+_0x3209b4+'\x22'];return squel[_0xd669('0x2b')]()[_0xd669('0x2c')]('cm_hopper')['fromQuery']([_0xd669('0x10'),_0xd669('0x2d'),_0xd669('0x2e'),_0xd669('0x2f'),_0x3ca5dc,_0xd669('0x30'),_0xd669('0x31'),_0xd669('0x32'),_0xd669('0x33'),_0xd669('0x34')],squel['select']()['fields'](_0x1dd328)[_0xd669('0x11')](_0x38108a)['join']('cm_contacts',null,_0xd669('0x35')+_0x38108a+'.CmListId')[_0xd669('0x12')](_0xe6b86f,null,_0xe6b86f+_0xd669('0x13')+_0x38108a+'.'+_0x3ca5dc)[_0xd669('0x14')](_0x38108a+_0xd669('0x36'),_0x5da510)[_0xd669('0x14')](_0xd669('0x37'),NOW)['where'](_0xd669('0x38'),selectNotIn(_0x38108a,_0xe6b86f,_0x3ca5dc,_0xd669('0x39'),[_0xd669('0x3a'),_0xd669('0x3b')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x38108a,_0xe6b86f,_0x3ca5dc,_0xd669('0x39'),['\x22always\x22'])))[_0xd669('0x3c')]();}function insertCmHopperBlack(_0x114909,_0x19ce4c,_0x175cc1,_0x384227){var _0x15b4c2=[_0xd669('0x24'),_0xd669('0x26'),_0xd669('0x27'),_0x19ce4c+'.'+_0x384227,_0xd669('0x3d'),'cm_contacts.updatedAt'];return squel[_0xd669('0x2b')]()[_0xd669('0x2c')]('cm_hopper_black')[_0xd669('0x3e')]([_0xd669('0x10'),_0xd669('0x2e'),_0xd669('0x2f'),_0x384227,_0xd669('0x30'),_0xd669('0x31')],squel[_0xd669('0xe')]()[_0xd669('0x3f')](_0x15b4c2)[_0xd669('0x11')](_0x19ce4c)[_0xd669('0x12')](_0xd669('0x40'),null,_0xd669('0x35')+_0x19ce4c+_0xd669('0x41'))[_0xd669('0x12')](_0x175cc1,null,_0x175cc1+'.id\x20=\x20'+_0x19ce4c+'.'+_0x384227)[_0xd669('0x14')](_0x19ce4c+_0xd669('0x36'),_0x114909)['where'](_0xd669('0x37'),NOW)[_0xd669('0x14')](_0xd669('0x38'),squel[_0xd669('0xe')]()['field'](_0xd669('0x10'))[_0xd669('0x11')](_0xd669('0x42'))['where'](_0xd669('0x43'),_0x114909)[_0xd669('0x14')](_0x384227+_0xd669('0x15')+_0x19ce4c+'.'+_0x384227)))[_0xd669('0x3c')]();}function insertTzCmHopper(_0x155975,_0x41e5e2,_0x28aa91,_0x4e65d5,_0x2b44e9,_0x9b659e){var _0x39941d=[_0xd669('0x24'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x9b659e+_0xd669('0x44'),_0xd669('0x26'),_0xd669('0x27'),_0x41e5e2+'.'+_0x4e65d5,_0xd669('0x3d'),_0xd669('0x28'),_0xd669('0x29'),'cm_contacts.UserId','\x22'+_0x2b44e9+'\x22'];var _0x33ba84=squel[_0xd669('0x2b')]()[_0xd669('0x2c')]('cm_hopper')[_0xd669('0x3e')]([_0xd669('0x10'),_0xd669('0x2d'),_0xd669('0x2e'),_0xd669('0x2f'),_0x4e65d5,_0xd669('0x30'),'updatedAt',_0xd669('0x32'),_0xd669('0x33'),_0xd669('0x34')],squel[_0xd669('0xe')]()[_0xd669('0x3f')](_0x39941d)[_0xd669('0x11')](_0x41e5e2)['join'](_0xd669('0x40'),null,_0xd669('0x35')+_0x41e5e2+_0xd669('0x41'))['join'](_0x28aa91,null,_0x28aa91+_0xd669('0x13')+_0x41e5e2+'.'+_0x4e65d5)[_0xd669('0x12')](_0x9b659e,null,_0x9b659e+'.id\x20=\x20'+_0x41e5e2+'.'+_0x4e65d5)['where'](_0x41e5e2+_0xd669('0x36'),_0x155975)[_0xd669('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xd669('0x38'),selectNotIn(_0x41e5e2,_0x28aa91,_0x4e65d5,'cm_hopper',[_0xd669('0x3a'),_0xd669('0x3b')]))[_0xd669('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x41e5e2,_0x28aa91,_0x4e65d5,'cm_hopper',['\x22always\x22'])))[_0xd669('0x3c')]();return _0x33ba84;}function insertTzCmHopperBlack(_0x204ec3,_0xd4f627,_0x368b7b,_0x111ccd){var _0x43704c=[_0xd669('0x24'),_0xd669('0x26'),_0xd669('0x27'),_0xd4f627+'.'+_0x111ccd,_0xd669('0x3d'),_0xd669('0x28')];return squel['insert']()[_0xd669('0x2c')](_0xd669('0x42'))[_0xd669('0x3e')]([_0xd669('0x10'),'ContactId',_0xd669('0x2f'),_0x111ccd,_0xd669('0x30'),_0xd669('0x31')],squel[_0xd669('0xe')]()[_0xd669('0x3f')](_0x43704c)['from'](_0xd4f627)['join'](_0xd669('0x40'),null,_0xd669('0x35')+_0xd4f627+'.CmListId')[_0xd669('0x12')](_0x368b7b,null,_0x368b7b+_0xd669('0x13')+_0xd4f627+'.'+_0x111ccd)[_0xd669('0x14')](_0xd4f627+_0xd669('0x36'),_0x204ec3)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xd669('0x38'),squel['select']()['field'](_0xd669('0x10'))[_0xd669('0x11')]('cm_hopper_black')[_0xd669('0x14')]('ListId\x20=\x20?',_0x204ec3)['where'](_0x111ccd+_0xd669('0x15')+_0xd4f627+'.'+_0x111ccd)))[_0xd669('0x3c')]();}function insertCmHopperAdditionalPhones(_0x223e48){var _0x19420e=[_0xd669('0x45'),_0xd669('0x46'),_0xd669('0x47'),_0xd669('0x48'),_0xd669('0x49')];return squel[_0xd669('0x2b')]()[_0xd669('0x2c')](_0xd669('0x4a'))[_0xd669('0x3e')]([_0xd669('0x4b'),_0xd669('0x10'),_0xd669('0x4c'),_0xd669('0x30'),_0xd669('0x31')],squel[_0xd669('0xe')]()[_0xd669('0x3f')](_0x19420e)[_0xd669('0x11')](_0xd669('0x39'))['join'](_0xd669('0x40'),null,_0xd669('0x4d'))[_0xd669('0x12')]('cm_contact_has_items',null,_0xd669('0x4e'))[_0xd669('0x14')](_0xd669('0x4f'),_0x223e48)[_0xd669('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xd669('0x3c')]();}function insertCmContact(_0x35f51b,_0x6bed92,_0x153c78,_0x1d8033){var _0x5a194d=_['concat'](_['keys'](_0x1d8033),['ListId',_0xd669('0x50'),_0xd669('0x30'),_0xd669('0x31'),'scheduledAt']);return squel['insert']()[_0xd669('0x2c')](_0xd669('0x40'))['fromQuery'](_0x5a194d,squel[_0xd669('0xe')]()[_0xd669('0x3f')](_0x5a194d)[_0xd669('0x11')](_0x6bed92)[_0xd669('0x14')]('('+_0x153c78[_0xd669('0x12')](',')+_0xd669('0x51'),squel['select']()['fields'](_0x153c78)[_0xd669('0x11')](_0xd669('0x40'))['where'](_0xd669('0x43'),_0x35f51b)[_0xd669('0x14')](_0xd669('0x52')))['where']('id\x20IN\x20?',squel[_0xd669('0xe')]()['field']('MIN(id)','min_id')[_0xd669('0x11')](_0x6bed92)[_0xd669('0x53')](_0x153c78['join'](','))))['toString']();}function handleStop(){logger['info'](_0xd669('0x54'));stopped=!![];}function handleUncaughtException(_0x285ac1){logger[_0xd669('0x55')](_0x285ac1[_0xd669('0x56')]);process[_0xd669('0x57')](0x1);}function handleError(_0x3b2fa1,_0x2b4e3a){stats[_0xd669('0x58')][_0xd669('0x1a')]({'name':_0x2b4e3a[_0xd669('0x59')],'message':_0x2b4e3a[_0xd669('0x56')],'row':_0x3b2fa1});}function handleQuery(_0x2119a0){logger[_0xd669('0x5a')](_0x2119a0);return db[_0xd669('0x5b')]['query'](_0x2119a0)[_0xd669('0x5c')](function(_0x26f97d){results['push'](_0x26f97d);})[_0xd669('0x5d')](function(_0x509c5d){logger[_0xd669('0x55')](_0x509c5d['message']);});}function updateTzCampaigns(_0x52a82d){return new Promise(function(_0x11ee1a,_0x18c21e){var _0x58570b=squel[_0xd669('0xe')]()[_0xd669('0x3f')]([_0xd669('0x5e'),'campaigns.dialTimezone'])[_0xd669('0x11')]('campaigns')['join'](_0xd669('0x5f'),null,_0xd669('0x60'))['where'](_0xd669('0x61')+_0x52a82d);db[_0xd669('0x5b')]['query'](_0x58570b[_0xd669('0x3c')]())[_0xd669('0x5c')](function(_0x51f71b){var _0x2b503c=[];for(var _0x3c7997=0x0;_0x3c7997<_0x51f71b['length'];_0x3c7997++){_0x2b503c[_0xd669('0x1a')](getTimezoneData(_0x51f71b[_0x3c7997],tmp_campaigns));}BPromise[_0xd669('0x62')](_0x2b503c)['then'](function(){_0x11ee1a({'val':0x1});});})['catch'](function(_0x396e04){logger[_0xd669('0x55')](_0x396e04[_0xd669('0x56')]);_0x11ee1a({'val':0x0});});});}function updateTzVoiceQueues(_0x1939f4){return new Promise(function(_0xf5c50a,_0x398d8a){var _0x3603de=squel['select']()['fields'](['voice_queues.id',_0xd669('0x63')])[_0xd669('0x11')](_0xd669('0x64'))[_0xd669('0x12')](_0xd669('0x65'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xd669('0x14')](_0xd669('0x66')+_0x1939f4);db[_0xd669('0x5b')][_0xd669('0x67')](_0x3603de['toString']())['spread'](function(_0x33173a){var _0x5a4d05=[];for(var _0x4509f2=0x0;_0x4509f2<_0x33173a[_0xd669('0x1d')];_0x4509f2++){_0x5a4d05['push'](getTimezoneData(_0x33173a[_0x4509f2],tmp_voice_queues));}BPromise[_0xd669('0x62')](_0x5a4d05)[_0xd669('0x19')](function(){_0xf5c50a({'val':0x1});});})[_0xd669('0x5d')](function(_0x57da0e){logger[_0xd669('0x55')](_0x57da0e[_0xd669('0x56')]);_0xf5c50a({'val':0x0});});});}function getTimezoneData(_0x227496,_0x431a01){return new Promise(function(_0x30bab9,_0x3faaaa){var _0x4662a5=shared[_0xd669('0x68')];var _0x19df6c=_0x4662a5[_0x227496['dialTimezone']];if(_[_0xd669('0x1e')](_0x19df6c)){_0x30bab9({'ret':0x1});}else{var _0x1ac9fc=_0x19df6c[_0xd669('0x69')];var _0xab5947=squel[_0xd669('0x2b')]()[_0xd669('0x2c')](_0x431a01)[_0xd669('0x6a')]('id',_0x227496['id'])['set'](_0xd669('0x6b'),_0x1ac9fc)[_0xd669('0x6a')]('dialTimezone',_0x227496['dialTimezone'])[_0xd669('0x3c')]();return db[_0xd669('0x5b')]['query'](_0xab5947)[_0xd669('0x5c')](function(_0x2ea90e){_0x30bab9({'ret':0x1});})[_0xd669('0x5d')](function(_0x4fbef2){logger[_0xd669('0x55')](_0x4fbef2[_0xd669('0x56')]);_0x3faaaa({'ret':0x1});});}});}function handleTZQuery(_0x478efc){logger[_0xd669('0x5a')](_0x478efc);return db[_0xd669('0x5b')][_0xd669('0x67')](_0x478efc)['spread'](function(_0x1fec39){})[_0xd669('0x5d')](function(_0x50a7ee){logger[_0xd669('0x55')](_0x50a7ee[_0xd669('0x56')]);});}function main(_0x2e3761,_0x12c6fa,_0x2bdb90,_0x5d364c){logger['info'](_0xd669('0x6c'),_0x2e3761,JSON[_0xd669('0x6d')](_0x12c6fa));process[_0xd669('0x6e')](_0xd669('0x6f'));var _0x1fb258=_0x12c6fa[_0xd669('0x70')];var _0x239b32=_['clone'](_0x1fb258);var _0x212ff9=_0x12c6fa['socket_timestamp'];var _0x1f7493=path[_0xd669('0x12')](config[_0xd669('0x71')],_0xd669('0x72'),_0x212ff9+_0xd669('0x73'));hasTZ=_['keys'](_0x1fb258)[_0xd669('0x74')](_0xd669('0x75'));var _0x168e50=_[_0xd669('0x76')](_0x1fb258)[_0xd669('0x12')]();logger[_0xd669('0x5a')](_0xd669('0x77'),_0x168e50);db[_0xd669('0x78')][_0xd669('0x18')]({'raw':!![],'attributes':['id',_0xd669('0x79')]})[_0xd669('0x19')](function(_0x2af541){for(var _0x4b320a=0x0;_0x4b320a<_0x2af541[_0xd669('0x1d')];_0x4b320a++){if(_0x2af541[_0x4b320a]['name']in _0x1fb258){contactItemTypes[_0xd669('0x1a')](_0x2af541[_0x4b320a]);delete _0x239b32[_0x2af541[_0x4b320a]['name']];hasAdditionalPhones=!![];}for(var _0x404745 in _0x1fb258){if(_0x2af541[_0x4b320a]['name']+_0xd669('0x7a')===_0x404745){phoneDescriptions['push']({'itemTypeId':_0x2af541[_0x4b320a]['id'],'description':_0x404745});delete _0x239b32[_0x404745];}}}if(hasAdditionalPhones)_0x239b32[_0xd669('0x1b')]='';var _0x8c8914=_['keys'](_0x239b32)['join']();logger['info'](_0xd669('0x77'),_0x8c8914);fs[_0xd669('0x7b')](_0x1f7493,_0x8c8914+'\x0a');Papa[_0xd669('0x7c')](fs['createReadStream'](_0x2e3761),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3579ff,_0x3694ef){try{for(var _0x4badee=0x0,_0x13cb2b=[];_0x4badee<_0x3579ff[_0xd669('0x7d')][_0xd669('0x1d')];_0x4badee++){stats[_0xd669('0x7e')]+=0x1;if(_0x3579ff[_0xd669('0x58')][_0x4badee]){handleError(_0x3579ff[_0xd669('0x7d')][_0x4badee],_0x3579ff['errors'][_0x4badee]);}else{var _0x1fcb73=[];var _0x3a3884=[];var _0x33f03e={};for(var _0x28b6b9 in _0x1fb258){let _0x1ca2d9=contactItemTypes['find'](_0x18cd9e=>_0x18cd9e[_0xd669('0x79')]===_0x28b6b9);let _0x1a3841=contactItemTypes['find'](_0x5ab9af=>_0x5ab9af[_0xd669('0x79')]+'_description'===_0x28b6b9);if(_[_0xd669('0x1e')](_0x1ca2d9)&&_[_0xd669('0x1e')](_0x1a3841)){if(_0x1fb258[_0xd669('0x7f')](_0x28b6b9)){if(_0x3579ff['data'][_0x4badee][_0x1fb258[_0x28b6b9]]){var _0x2102bd=_[_0xd669('0x80')](_0x3579ff[_0xd669('0x7d')][_0x4badee][_0x1fb258[_0x28b6b9]][_0xd669('0x81')](/"/g,'\x27'));switch(_0x28b6b9){case _0xd669('0x2d'):var _0x342e0f=moment(_0x2102bd,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x342e0f[_0xd669('0x82')]()){_0x13cb2b[_0xd669('0x1a')]('\x22'+_0x2102bd+'\x22');}else{_0x1fcb73[_0xd669('0x1a')](_0xd669('0x83'));}break;case _0xd669('0x32'):var _0x505f7d=parseInt(_0x2102bd);_0x2102bd=_[_0xd669('0x84')](_0x505f7d)||_0x505f7d<0x0||_0x505f7d>0x4?_0x5d364c?0x3:0x2:_0x505f7d;_0x13cb2b[_0xd669('0x1a')]('\x22'+_0x2102bd+'\x22');break;case _0xd669('0x33'):var _0x437d17=parseInt(_0x2102bd);if(_[_0xd669('0x85')](_0x437d17)&&_[_0xd669('0x74')](_0x2bdb90,_0x437d17)){_0x13cb2b[_0xd669('0x1a')]('\x22'+_0x437d17+'\x22');}else{_0x1fcb73[_0xd669('0x1a')](_0xd669('0x86'));}break;case _0xd669('0x87'):if(isEmail(_0x2102bd)){_0x13cb2b[_0xd669('0x1a')]('\x22'+_0x2102bd+'\x22');}else{_0x1fcb73['push']('email\x20wrong\x20format');}break;case'dateOfBirth':var _0xff028f=moment(_0x2102bd,_0xd669('0x88'),!![]);if(_0xff028f[_0xd669('0x82')]()){_0x13cb2b[_0xd669('0x1a')]('\x22'+_0x2102bd+'\x22');}else{_0x1fcb73[_0xd669('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xd669('0x75'):var _0x40eee2=shared[_0xd669('0x68')];var _0x31e5cd=_0x40eee2[_0x2102bd];if(!_[_0xd669('0x1e')](_0x31e5cd)){var _0x3a6c5b=_0x31e5cd[_0xd669('0x69')];_0x13cb2b[_0xd669('0x1a')]('\x22'+_0x2102bd+'\x22');_0x13cb2b['push']('\x22'+_0x3a6c5b+'\x22');}break;default:_0x13cb2b['push']('\x22'+_0x2102bd+'\x22');}}else{switch(_0x28b6b9){case _0xd669('0x89'):case _0xd669('0x10'):_0x1fcb73[_0xd669('0x1a')](_0x28b6b9+_0xd669('0x8a'));break;default:_0x13cb2b['push']('\x22\x22');}}}}else{var _0x1646d1='';if(!_[_0xd669('0x1e')](_0x1ca2d9)){if(!_0x33f03e[_0xd669('0x7f')](_0x1ca2d9['id'])){if(!_[_0xd669('0x1e')](_0x3579ff[_0xd669('0x7d')][_0x4badee][_0x1fb258[_0x28b6b9]])){var _0x2102bd=_[_0xd669('0x80')](_0x3579ff['data'][_0x4badee][_0x1fb258[_0x28b6b9]][_0xd669('0x81')](/"/g,'\x27'));var _0x225c65=phoneDescriptions[_0xd669('0x8b')](_0x417cf6=>_0x417cf6[_0xd669('0x8c')]===_0x1ca2d9['id']);if(!_[_0xd669('0x1e')](_0x225c65)){var _0x50023a=_[_0xd669('0x80')](_0x3579ff[_0xd669('0x7d')][_0x4badee][_0x1fb258[_0x225c65[_0xd669('0x8d')]]][_0xd669('0x81')](/"/g,'\x27'));if(!_[_0xd669('0x1e')](_0x50023a))_0x2102bd=_0x2102bd+'§'+_0x50023a;}if(_0x1646d1=='')_0x1646d1=_0x2102bd;else _0x1646d1+='|'+_0x2102bd;}_0x3a3884[_0xd669('0x1a')](_0x1ca2d9['id']+':'+_0x1646d1);_0x33f03e[_0x1ca2d9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x13cb2b[_0xd669('0x1a')]('\x22'+_0x3a3884[_0xd669('0x12')](';')+'\x22');}if(_0x1fcb73[_0xd669('0x1d')]){handleError(_0x3579ff[_0xd669('0x7d')][_0x4badee],{'code':'SystemRow','message':_0x1fcb73[_0xd669('0x12')]()});}else{fs[_0xd669('0x8e')](_0x1f7493,_0x13cb2b[_0xd669('0x12')]()+'\x0a');}_0x13cb2b=[];}if(!(stats[_0xd669('0x7e')]%0xc8)){socket[_0xd669('0x8f')](_0xd669('0x90')+_0x212ff9,stats);stats[_0xd669('0x58')]=[];}}if(stopped){logger[_0xd669('0x5a')](_0xd669('0x91'));_0x3694ef[_0xd669('0x92')]();}}catch(_0x429b2e){handleError(_0x3579ff[_0xd669('0x7d')][_0x4badee],{'code':_0xd669('0x93'),'message':_0x429b2e[_0xd669('0x56')]});logger[_0xd669('0x55')](_0xd669('0x94'),_0x429b2e[_0xd669('0x56')]);}},'complete':function(){try{var _0x49633b=[];var _0x225cfa=[];var _0x353f71=_0xd669('0x40');if(_0x12c6fa[_0xd669('0x95')]&&_0x12c6fa[_0xd669('0x95')]['length']){_0x353f71=_0xd669('0x96')+_0x212ff9;_0x49633b[_0xd669('0x1a')](_0xd669('0x97')+_0x353f71+_0xd669('0x98'));}tmp_campaigns=_0xd669('0x99')+_0x212ff9;tmp_voice_queues='voice_queues_'+_0x212ff9;_0x225cfa[_0xd669('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xd669('0x9a'));_0x225cfa[_0xd669('0x1a')](_0xd669('0x97')+tmp_voice_queues+_0xd669('0x9a'));BPromise[_0xd669('0x9b')](_0x225cfa,handleTZQuery)[_0xd669('0x19')](function(_0x1805ea){updateTzCampaigns(_0x12c6fa[_0xd669('0x2f')])[_0xd669('0x19')](function(_0xf7c4af){updateTzVoiceQueues(_0x12c6fa['ListId'])[_0xd669('0x19')](function(_0x24fa0f){if(hasTZ)_0x8c8914=_0x8c8914['replace']('dialTimezone','dialTimezone,utcOffset');var _0x192648=util[_0xd669('0xc')](_0xd669('0x9c'),_0x1f7493,_0x353f71,_0x8c8914,_0x12c6fa['ListId'],_0x12c6fa[_0xd669('0x50')]||null,NOW,NOW);if(_[_0xd669('0x1e')](_0x1fb258[_0xd669('0x2d')])){_0x192648+=',\x20scheduledAt\x20=\x20NOW()';}_0x49633b[_0xd669('0x1a')](_0x192648);if(_0x12c6fa[_0xd669('0x95')]&&_0x12c6fa[_0xd669('0x95')][_0xd669('0x1d')]){_0x49633b[_0xd669('0x1a')](insertCmContact(_0x12c6fa['ListId'],_0x353f71,_0x12c6fa['duplicates'],_0x1fb258));_0x49633b['push'](_0xd669('0x9d')+_0x353f71+';');}BPromise[_0xd669('0x9b')](_0x49633b,handleQuery)[_0xd669('0x19')](function(_0x1c0de0){BPromise['all']([handleAdditionalPhones()])[_0xd669('0x19')](function(){_0x49633b=[];for(var _0x518fec=0x0;_0x518fec\x20\x20','binding\x20doesn\x27t\x20exists','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','length','isNil','push','all','then','catch','error','message','AdditionalPhones','split','CmContactHasItem','update','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','updatedAt','priority','UserId'];(function(_0x3b1cea,_0x44a0ea){var _0x1a0b7a=function(_0x579fc1){while(--_0x579fc1){_0x3b1cea['push'](_0x3b1cea['shift']());}};_0x1a0b7a(++_0x44a0ea);}(_0x0972,0x64));var _0x2097=function(_0x32106b,_0x5d4d67){_0x32106b=_0x32106b-0x0;var _0x3bf643=_0x0972[_0x32106b];return _0x3bf643;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x2097('0x0'));var Papa=require('papaparse');var util=require(_0x2097('0x1'));var BPromise=require('bluebird');var moment=require(_0x2097('0x2'));var squel=require(_0x2097('0x3'));var Redis=require('ioredis');var db=require(_0x2097('0x4'))['db'];var config=require(_0x2097('0x5'));var logger=require(_0x2097('0x6'))(_0x2097('0x7'));config[_0x2097('0x8')]=_[_0x2097('0x9')](config[_0x2097('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2097('0xa'))(new Redis(config[_0x2097('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x2097('0xb')](_0x2097('0xc'));var tempTableName=_0x2097('0xd')+moment()['format'](_0x2097('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x3b8b76){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))*$/[_0x2097('0xf')](_0x3b8b76);}function selectNotIn(_0x430754,_0x7baeb3,_0x3b5847,_0x3d5519,_0x1d1166){return squel[_0x2097('0x10')]()[_0x2097('0x11')](_0x2097('0x12'))[_0x2097('0x13')](_0x3d5519)[_0x2097('0x14')](_0x7baeb3,null,_0x7baeb3+_0x2097('0x15')+_0x3d5519+'.'+_0x3b5847)[_0x2097('0x16')](_0x3d5519+'.'+_0x3b5847+_0x2097('0x17')+_0x430754+'.'+_0x3b5847)[_0x2097('0x16')](_0x7baeb3+_0x2097('0x18')+_0x1d1166[_0x2097('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x354387,_0x5d0a43){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2097('0x19')][_0x2097('0x1a')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x4fc8c5){if(_0x4fc8c5!==null){var _0x409deb=[];for(var _0x588396=0x0;_0x588396<_0x4fc8c5[_0x2097('0x1b')];_0x588396++){var _0xb12c94=_0x4fc8c5[_0x588396];if(!_[_0x2097('0x1c')](_0xb12c94[_0x2097('0x12')])){if(!_[_0x2097('0x1c')](_0xb12c94['AdditionalPhones']))_0x409deb[_0x2097('0x1d')](insertAdditionalPhones(_0xb12c94));promisesContact[_0x2097('0x1d')]({'contact':_0xb12c94});}}}Promise[_0x2097('0x1e')](_0x409deb)[_0x2097('0x1f')](function(){_0x354387({'val':0x1});});})[_0x2097('0x20')](function(_0x235304){logger[_0x2097('0x21')](_0x235304[_0x2097('0x22')]);});});}function insertAdditionalPhones(_0x5d8b9e){return new Promise(function(_0x4d957e,_0xf65dc6){var _0x569c21=_0x5d8b9e[_0x2097('0x23')];if(_[_0x2097('0x1c')](_0x569c21))_0xf65dc6({'val':0x0});else{var _0x49f601=_0x569c21[_0x2097('0x24')](';');var _0x5b0582=[];orderBy=0x0;for(var _0x2e17c8=0x0;_0x2e17c8<_0x49f601[_0x2097('0x1b')];_0x2e17c8++){_0x5b0582[_0x2097('0x1d')](splitAdditionalPhone(_0x5d8b9e['id'],_0x49f601[_0x2e17c8]));}Promise[_0x2097('0x1e')](_0x5b0582)[_0x2097('0x1f')](function(){_0x4d957e({'val':_0x49f601[_0x2097('0x1b')]});});}});}function splitAdditionalPhone(_0x56390a,_0xae5f9){return new Promise(function(_0x500234,_0x3f9279){var _0x32405b=_0xae5f9[_0x2097('0x24')](':');var _0x9f59bc=_0x32405b[0x0];var _0x499988=_0x32405b[0x1];if(_0x499988!==''){var _0x2d683a=_0x499988[_0x2097('0x24')]('|');var _0x56af3b=[];for(var _0x1229fc=0x0;_0x1229fc<_0x2d683a['length'];_0x1229fc++){if(_0x2d683a[_0x1229fc]!==''){var _0x29b879=_['filter'](promisesAdditionalPhones,{'contactId':_0x56390a,'phone':_0x2d683a[_0x1229fc]});if(_0x29b879[_0x2097('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x2097('0x1d')]({'contactId':_0x56390a,'contactTypeId':_0x9f59bc,'phone':_0x2d683a[_0x1229fc],'orderBy':orderBy});}}}_0x500234({'ok':0x1});}else _0x500234({'res':0x0});});}function createAdditionalPhone(_0x407a2a,_0x7eefb4,_0x410afa,_0x36228c){var _0x450e0b='';var _0x4b443d='';var _0x11242f=_0x410afa[_0x2097('0x24')]('§');_0x450e0b=_0x11242f[0x0];if(_0x11242f['length']==0x2)_0x4b443d=_0x11242f[0x1];return new Promise(function(_0x1398d0,_0x41487d){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x407a2a,'item':_0x450e0b}})[_0x2097('0x1f')](function(_0x11b051){if(_0x11b051){return db[_0x2097('0x25')][_0x2097('0x26')]({'ItemTypeId':_0x7eefb4,'description':_0x4b443d,'OrderBy':_0x36228c},{'where':{'CmContactId':_0x407a2a,'item':_0x450e0b}})[_0x2097('0x1f')](function(_0x180654){_0x1398d0({'res':'updated'});});}else{return db[_0x2097('0x25')]['create']({'CmContactId':_0x407a2a,'item':_0x450e0b,'ItemTypeId':_0x7eefb4,'description':_0x4b443d,'OrderBy':_0x36228c,'ItemClass':_0x2097('0x27')})[_0x2097('0x1f')](function(_0x2bc39c){_0x1398d0({'res':_0x2097('0x28')});});}});});}function updateContact(_0x44e398){return new Promise(function(_0x395d9f,_0x9bc312){var _0x455cf7=_0x44e398['id'];delete _0x44e398['id'];return db[_0x2097('0x29')]['update'](_0x44e398,{'where':{'id':_0x455cf7}})[_0x2097('0x1f')](function(_0x40baed){updatedRows+=0x1;return db[_0x2097('0x2a')]['update']({'phone':_0x44e398[_0x2097('0x12')]},{'where':{'ContactId':_0x455cf7}})[_0x2097('0x1f')](function(_0x3c2fa6){_0x395d9f({'ret':'OK'});});});});}function insertCmHopper(_0x396162,_0x542a52,_0x50b101,_0x5689f6,_0x3484ff){var _0x8f464d=[_0x2097('0x2b'),_0x2097('0x2c'),_0x2097('0x2d'),_0x2097('0x2e'),_0x542a52+'.'+_0x5689f6,'cm_contacts.createdAt',_0x2097('0x2f'),_0x2097('0x30'),_0x2097('0x31'),'\x22'+_0x3484ff+'\x22'];return squel[_0x2097('0x32')]()[_0x2097('0x33')](_0x2097('0x34'))['fromQuery']([_0x2097('0x12'),_0x2097('0x35'),_0x2097('0x36'),'ListId',_0x5689f6,'createdAt',_0x2097('0x37'),_0x2097('0x38'),_0x2097('0x39'),_0x2097('0x3a')],squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0x8f464d)[_0x2097('0x13')](_0x542a52)[_0x2097('0x14')](_0x2097('0x3c'),null,_0x2097('0x3d')+_0x542a52+_0x2097('0x3e'))[_0x2097('0x14')](_0x50b101,null,_0x50b101+'.id\x20=\x20'+_0x542a52+'.'+_0x5689f6)[_0x2097('0x16')](_0x542a52+_0x2097('0x3f'),_0x396162)[_0x2097('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2097('0x16')](_0x2097('0x40'),selectNotIn(_0x542a52,_0x50b101,_0x5689f6,_0x2097('0x34'),[_0x2097('0x41'),_0x2097('0x42')]))[_0x2097('0x16')](_0x2097('0x40'),selectNotIn(_0x542a52,_0x50b101,_0x5689f6,_0x2097('0x34'),['\x22always\x22'])))[_0x2097('0x43')]();}function insertCmHopperBlack(_0x283adc,_0x186ca5,_0x3288ae,_0x12e0e2){var _0xe3ac1b=[_0x2097('0x2b'),_0x2097('0x2d'),'cm_contacts.ListId',_0x186ca5+'.'+_0x12e0e2,_0x2097('0x44'),'cm_contacts.updatedAt'];return squel[_0x2097('0x32')]()[_0x2097('0x33')](_0x2097('0x45'))[_0x2097('0x46')]([_0x2097('0x12'),'ContactId',_0x2097('0x47'),_0x12e0e2,_0x2097('0x48'),_0x2097('0x37')],squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0xe3ac1b)['from'](_0x186ca5)[_0x2097('0x14')](_0x2097('0x3c'),null,_0x2097('0x3d')+_0x186ca5+_0x2097('0x3e'))[_0x2097('0x14')](_0x3288ae,null,_0x3288ae+_0x2097('0x15')+_0x186ca5+'.'+_0x12e0e2)[_0x2097('0x16')](_0x186ca5+_0x2097('0x3f'),_0x283adc)['where'](_0x2097('0x49'),NOW)[_0x2097('0x16')](_0x2097('0x40'),squel[_0x2097('0x10')]()['field']('phone')['from'](_0x2097('0x45'))[_0x2097('0x16')]('ListId\x20=\x20?',_0x283adc)[_0x2097('0x16')](_0x12e0e2+_0x2097('0x4a'),_0x186ca5+'.'+_0x12e0e2)))['toString']();}function insertCmHopperAdditionalPhones(_0x593033){var _0x23acf3=[_0x2097('0x4b'),_0x2097('0x4c'),'cm_contact_has_items.OrderBy',_0x2097('0x4d'),_0x2097('0x4e')];return squel['insert']()[_0x2097('0x33')](_0x2097('0x4f'))[_0x2097('0x46')]([_0x2097('0x50'),_0x2097('0x12'),'OrderBy','createdAt',_0x2097('0x37')],squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0x23acf3)['from']('cm_hopper')[_0x2097('0x14')](_0x2097('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x2097('0x14')](_0x2097('0x51'),null,_0x2097('0x52'))[_0x2097('0x16')](_0x2097('0x53'),_0x593033)['where'](_0x2097('0x49'),NOW))[_0x2097('0x43')]();}function insertCmContact(_0x190859,_0x54fe12,_0x4a25e2,_0xdf72c7){var _0x4edf1d=_[_0x2097('0x54')](_['keys'](_0xdf72c7),[_0x2097('0x47'),'CompanyId','createdAt','updatedAt']);return squel[_0x2097('0x32')]()['into']('cm_contacts')[_0x2097('0x46')](_0x4edf1d,squel['select']()[_0x2097('0x3b')](_0x4edf1d)[_0x2097('0x13')](_0x54fe12)['where']('('+_0x4a25e2[_0x2097('0x14')](',')+_0x2097('0x55'),squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0x4a25e2)[_0x2097('0x13')]('cm_contacts')[_0x2097('0x16')]('ListId\x20=\x20?',_0x190859))[_0x2097('0x16')](_0x2097('0x56'),squel[_0x2097('0x10')]()['field'](_0x2097('0x57'),_0x2097('0x58'))[_0x2097('0x13')](_0x54fe12)[_0x2097('0x59')](_0x4a25e2[_0x2097('0x14')](','))))['toString']();}function handleStop(){logger['info'](_0x2097('0x5a'));stopped=!![];}function handleUncaughtException(_0x275578){logger['error'](_0x275578['message']);process['exit'](0x1);}function handleError(_0x5781aa,_0x14b2d4){stats['errors'][_0x2097('0x1d')]({'name':_0x14b2d4[_0x2097('0x5b')],'message':_0x14b2d4['message'],'row':_0x5781aa});}function handleQuery(_0x13558a){logger[_0x2097('0x5c')](_0x13558a);return db[_0x2097('0x19')][_0x2097('0x1a')](_0x13558a)[_0x2097('0x5d')](function(_0x60332a){results[_0x2097('0x1d')](_0x60332a);})[_0x2097('0x20')](function(_0x2ec365){logger['error'](_0x2ec365[_0x2097('0x22')]);});}function main(_0x28226d,_0x1546d9,_0x4705e1,_0x412321){logger[_0x2097('0x5c')]('main',_0x28226d,JSON[_0x2097('0x5e')](_0x1546d9));process[_0x2097('0x5f')](_0x2097('0x60'));var _0x3c3b38=_0x1546d9[_0x2097('0x61')];var _0x5d6b8a=_[_0x2097('0x62')](_0x3c3b38);var _0x28dd95=_0x1546d9['socket_timestamp'];var _0x4d053f=path['join'](config[_0x2097('0x63')],_0x2097('0x64'),_0x28dd95+_0x2097('0x65'));logger[_0x2097('0x5c')](_0x2097('0x66'),_0x1546d9);db[_0x2097('0x67')][_0x2097('0x68')]({'raw':!![],'attributes':['id',_0x2097('0x69')]})[_0x2097('0x1f')](function(_0x5453bc){for(var _0x5cfae9=0x0;_0x5cfae9<_0x5453bc[_0x2097('0x1b')];_0x5cfae9++){if(_0x5453bc[_0x5cfae9][_0x2097('0x69')]in _0x3c3b38){contactItemTypes[_0x2097('0x1d')](_0x5453bc[_0x5cfae9]);delete _0x5d6b8a[_0x5453bc[_0x5cfae9][_0x2097('0x69')]];hasAdditionalPhones=!![];}for(var _0x4649dc in _0x3c3b38){if(_0x5453bc[_0x5cfae9][_0x2097('0x69')]+'_description'===_0x4649dc){phoneDescriptions[_0x2097('0x1d')]({'itemTypeId':_0x5453bc[_0x5cfae9]['id'],'description':_0x4649dc});delete _0x5d6b8a[_0x4649dc];}}}if(hasAdditionalPhones)_0x5d6b8a[_0x2097('0x23')]='';var _0x1614ca=_[_0x2097('0x6a')](_0x5d6b8a)['join']();logger['info'](_0x2097('0x6b'),_0x1614ca);fs[_0x2097('0x6c')](_0x4d053f,_0x1614ca+'\x0a');Papa['parse'](fs[_0x2097('0x6d')](_0x28226d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x426290,_0x17551b){try{for(var _0x17fd21=0x0,_0x1f824f=[];_0x17fd21<_0x426290[_0x2097('0x6e')][_0x2097('0x1b')];_0x17fd21++){stats[_0x2097('0x6f')]+=0x1;if(_0x426290['errors'][_0x17fd21]){handleError(_0x426290[_0x2097('0x6e')][_0x17fd21],_0x426290[_0x2097('0x70')][_0x17fd21]);}else{var _0x525325=[];var _0x1742a9=[];var _0xd81d45={};for(var _0x2bde2b in _0x3c3b38){let _0x143c4f=contactItemTypes[_0x2097('0x71')](_0x46d6b5=>_0x46d6b5[_0x2097('0x69')]===_0x2bde2b);let _0x22d1ce=contactItemTypes[_0x2097('0x71')](_0x1b7021=>_0x1b7021[_0x2097('0x69')]+'_description'===_0x2bde2b);if(_[_0x2097('0x1c')](_0x143c4f)&&_[_0x2097('0x1c')](_0x22d1ce)){if(_0x3c3b38[_0x2097('0x72')](_0x2bde2b)){if(_0x426290[_0x2097('0x6e')][_0x17fd21][_0x3c3b38[_0x2bde2b]]){var _0x34b687=_['trim'](_0x426290[_0x2097('0x6e')][_0x17fd21][_0x3c3b38[_0x2bde2b]][_0x2097('0x73')](/"/g,'\x27'));switch(_0x2bde2b){case _0x2097('0x35'):var _0x563235=moment(_0x34b687,_0x2097('0xc'),!![]);if(_0x563235['isValid']()){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}else{_0x525325['push'](_0x2097('0x74'));}break;case'priority':var _0x274bd4=parseInt(_0x34b687);_0x34b687=_['isNaN'](_0x274bd4)||_0x274bd4<0x0||_0x274bd4>0x4?_0x412321?0x3:0x2:_0x274bd4;_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');break;case _0x2097('0x39'):var _0x18f796=parseInt(_0x34b687);if(_[_0x2097('0x75')](_0x18f796)&&_[_0x2097('0x76')](_0x4705e1,_0x18f796)){_0x1f824f['push']('\x22'+_0x18f796+'\x22');}else{_0x525325[_0x2097('0x1d')](_0x2097('0x77'));}break;case _0x2097('0x78'):if(isEmail(_0x34b687)){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}else{_0x525325[_0x2097('0x1d')](_0x2097('0x79'));}break;case _0x2097('0x7a'):var _0x360dd5=moment(_0x34b687,_0x2097('0x7b'),!![]);if(_0x360dd5[_0x2097('0x7c')]()){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}else{_0x525325[_0x2097('0x1d')](_0x2097('0x7d'));}break;default:_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}}else{switch(_0x2bde2b){case _0x2097('0x7e'):case _0x2097('0x12'):_0x525325['push'](_0x2bde2b+_0x2097('0x7f'));break;default:_0x1f824f['push']('\x22\x22');}}}}else{var _0x5c886c='';if(!_[_0x2097('0x1c')](_0x143c4f)){if(!_0xd81d45[_0x2097('0x72')](_0x143c4f['id'])){for(var _0x107fab=0x0;_0x107fab<_0x3c3b38[_0x2bde2b]['length'];_0x107fab++){var _0x34b687=_[_0x2097('0x80')](_0x426290[_0x2097('0x6e')][_0x17fd21][_0x3c3b38[_0x2bde2b][_0x107fab]][_0x2097('0x73')](/"/g,'\x27'));var _0x568a15=phoneDescriptions[_0x2097('0x71')](_0x5088a2=>_0x5088a2[_0x2097('0x81')]===_0x143c4f['id']);if(!_[_0x2097('0x1c')](_0x568a15)){var _0x2619db=_[_0x2097('0x80')](_0x426290['data'][_0x17fd21][_0x3c3b38[_0x568a15[_0x2097('0x82')]][0x0]][_0x2097('0x73')](/"/g,'\x27'));if(!_[_0x2097('0x1c')](_0x2619db))_0x34b687=_0x34b687+'§'+_0x2619db;}if(_0x5c886c=='')_0x5c886c=_0x34b687;else _0x5c886c+='|'+_0x34b687;}_0x1742a9['push'](_0x143c4f['id']+':'+_0x5c886c);_0xd81d45[_0x143c4f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x1742a9[_0x2097('0x14')](';')+'\x22');}if(_0x525325[_0x2097('0x1b')]){handleError(_0x426290['data'][_0x17fd21],{'code':_0x2097('0x83'),'message':_0x525325[_0x2097('0x14')]()});}else{fs[_0x2097('0x84')](_0x4d053f,_0x1f824f[_0x2097('0x14')]()+'\x0a');}_0x1f824f=[];}if(!(stats[_0x2097('0x6f')]%0xc8)){socket[_0x2097('0x85')]('contact:import:'+_0x28dd95,stats);stats['errors']=[];}}if(stopped){logger[_0x2097('0x5c')](_0x2097('0x86'));_0x17551b[_0x2097('0x87')]();}}catch(_0x16451c){handleError(_0x426290[_0x2097('0x6e')][_0x17fd21],{'code':_0x2097('0x88'),'message':_0x16451c['message']});logger[_0x2097('0x21')](_0x2097('0x89'),_0x16451c[_0x2097('0x22')]);}},'complete':function(){try{var _0x36d42d=[];var _0x9b0763=tempTableName;_0x36d42d[_0x2097('0x1d')](_0x2097('0x8a')+_0x9b0763+'\x20LIKE\x20cm_contacts;');logger[_0x2097('0x5c')](_0x2097('0x8b'),contactItemTypes[_0x2097('0x1b')]);var _0x46bac8=util[_0x2097('0xb')](_0x2097('0x8c'),_0x4d053f,_0x9b0763,_0x1614ca,_0x1546d9['ListId'],_0x1546d9['CompanyId']||null,NOW,NOW);if(_[_0x2097('0x1c')](_0x3c3b38['scheduledat'])){_0x46bac8+=',\x20scheduledAt\x20=\x20NOW()';}_0x36d42d[_0x2097('0x1d')](_0x46bac8);BPromise[_0x2097('0x8d')](_0x36d42d,handleQuery)[_0x2097('0x1f')](function(_0x3c5a58){BPromise[_0x2097('0x1e')]([handleAdditionalPhones()])[_0x2097('0x1f')](function(){_0x36d42d=[];for(var _0x290481=0x0;_0x290481\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','moment','ioredis','../../../mysqldb','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','then','catch','split','length','filter','findOne','CmContactHasItem','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','fromQuery','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','OrderBy','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','min_id','info','Received\x20SIGINT','error','message','exit','code','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body'];(function(_0x4eab75,_0x1d0b2b){var _0xa8e07=function(_0x3b22c6){while(--_0x3b22c6){_0x4eab75['push'](_0x4eab75['shift']());}};_0xa8e07(++_0x1d0b2b);}(_0xef6a,0x1e9));var _0xaef6=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xef6a[_0x29d94e];return _0x106237;};'use strict';var fs=require('fs');var path=require(_0xaef6('0x0'));var _=require(_0xaef6('0x1'));var Papa=require(_0xaef6('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xaef6('0x3'));var squel=require('squel');var Redis=require(_0xaef6('0x4'));var db=require(_0xaef6('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0xaef6('0x6')]=_[_0xaef6('0x7')](config[_0xaef6('0x6')],{'host':_0xaef6('0x8'),'port':0x18eb});var socket=require(_0xaef6('0x9'))(new Redis(config[_0xaef6('0x6')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xaef6('0xa')](_0xaef6('0xb'));var tempTableName='cm_contacts_temp_'+moment()[_0xaef6('0xa')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5160d6){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))*$/[_0xaef6('0xc')](_0x5160d6);}function selectNotIn(_0x28f830,_0x52a7f1,_0xbb45c,_0x564fb3,_0xd20652){return squel[_0xaef6('0xd')]()[_0xaef6('0xe')](_0xaef6('0xf'))[_0xaef6('0x10')](_0x564fb3)[_0xaef6('0x11')](_0x52a7f1,null,_0x52a7f1+_0xaef6('0x12')+_0x564fb3+'.'+_0xbb45c)[_0xaef6('0x13')](_0x564fb3+'.'+_0xbb45c+_0xaef6('0x14')+_0x28f830+'.'+_0xbb45c)[_0xaef6('0x13')](_0x52a7f1+_0xaef6('0x15')+_0xd20652['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x51d062,_0x1bf878){promisesAdditionalPhones=[];promisesContact=[];return db[_0xaef6('0x16')][_0xaef6('0x17')](_0xaef6('0x18')+tempTableName)[_0xaef6('0x19')](function(_0x4014b2){if(_0x4014b2!==null){var _0x581d7a=[];for(var _0x206cc5=0x0;_0x206cc5<_0x4014b2['length'];_0x206cc5++){var _0x4af2f8=_0x4014b2[_0x206cc5];if(!_[_0xaef6('0x1a')](_0x4af2f8[_0xaef6('0xf')])){if(!_[_0xaef6('0x1a')](_0x4af2f8[_0xaef6('0x1b')]))_0x581d7a[_0xaef6('0x1c')](insertAdditionalPhones(_0x4af2f8));promisesContact[_0xaef6('0x1c')]({'contact':_0x4af2f8});}}}Promise[_0xaef6('0x1d')](_0x581d7a)[_0xaef6('0x1e')](function(){_0x51d062({'val':0x1});});})[_0xaef6('0x1f')](function(_0x1e536b){logger['error'](_0x1e536b['message']);});});}function insertAdditionalPhones(_0x5399db){return new Promise(function(_0x43e9ec,_0x20a93f){var _0x510169=_0x5399db['AdditionalPhones'];if(_[_0xaef6('0x1a')](_0x510169))_0x20a93f({'val':0x0});else{var _0x22bcb8=_0x510169[_0xaef6('0x20')](';');var _0x595481=[];orderBy=0x0;for(var _0x374620=0x0;_0x374620<_0x22bcb8['length'];_0x374620++){_0x595481[_0xaef6('0x1c')](splitAdditionalPhone(_0x5399db['id'],_0x22bcb8[_0x374620]));}Promise['all'](_0x595481)[_0xaef6('0x1e')](function(){_0x43e9ec({'val':_0x22bcb8[_0xaef6('0x21')]});});}});}function splitAdditionalPhone(_0x5f23e4,_0x53a512){return new Promise(function(_0x4710fa,_0x1da26f){var _0x34020e=_0x53a512['split'](':');var _0x5b7f7c=_0x34020e[0x0];var _0x2ddda9=_0x34020e[0x1];if(_0x2ddda9!==''){var _0x42eb31=_0x2ddda9[_0xaef6('0x20')]('|');var _0x333324=[];for(var _0x3ae979=0x0;_0x3ae979<_0x42eb31[_0xaef6('0x21')];_0x3ae979++){if(_0x42eb31[_0x3ae979]!==''){var _0x319b18=_[_0xaef6('0x22')](promisesAdditionalPhones,{'contactId':_0x5f23e4,'phone':_0x42eb31[_0x3ae979]});if(_0x319b18[_0xaef6('0x21')]==0x0){orderBy++;promisesAdditionalPhones[_0xaef6('0x1c')]({'contactId':_0x5f23e4,'contactTypeId':_0x5b7f7c,'phone':_0x42eb31[_0x3ae979],'orderBy':orderBy});}}}_0x4710fa({'ok':0x1});}else _0x4710fa({'res':0x0});});}function createAdditionalPhone(_0x3d5bae,_0x26313f,_0x3d98c1,_0x155cda){var _0x34527b='';var _0x19cbc4='';var _0x22cb31=_0x3d98c1['split']('§');_0x34527b=_0x22cb31[0x0];if(_0x22cb31[_0xaef6('0x21')]==0x2)_0x19cbc4=_0x22cb31[0x1];return new Promise(function(_0x5290ee,_0x3300cf){return db['CmContactHasItem'][_0xaef6('0x23')]({'where':{'CmContactId':_0x3d5bae,'item':_0x34527b}})['then'](function(_0xe0b2cc){if(_0xe0b2cc){return db[_0xaef6('0x24')][_0xaef6('0x25')]({'ItemTypeId':_0x26313f,'description':_0x19cbc4,'OrderBy':_0x155cda},{'where':{'CmContactId':_0x3d5bae,'item':_0x34527b}})[_0xaef6('0x1e')](function(_0x22936d){_0x5290ee({'res':'updated'});});}else{return db[_0xaef6('0x24')][_0xaef6('0x26')]({'CmContactId':_0x3d5bae,'item':_0x34527b,'ItemTypeId':_0x26313f,'description':_0x19cbc4,'OrderBy':_0x155cda,'ItemClass':_0xaef6('0x27')})['then'](function(_0xb9bc8f){_0x5290ee({'res':_0xaef6('0x28')});});}});});}function updateContact(_0x586ee0){return new Promise(function(_0x27a77d,_0xeca35){var _0x47989e=_0x586ee0['id'];delete _0x586ee0['id'];return db[_0xaef6('0x29')][_0xaef6('0x25')](_0x586ee0,{'where':{'id':_0x47989e}})[_0xaef6('0x1e')](function(_0x3c1a){updatedRows+=0x1;return db[_0xaef6('0x2a')][_0xaef6('0x25')]({'phone':_0x586ee0[_0xaef6('0xf')]},{'where':{'ContactId':_0x47989e}})[_0xaef6('0x1e')](function(_0x3b2713){_0x27a77d({'ret':'OK'});});});});}function insertCmHopper(_0x4f6110,_0x123169,_0x52f97f,_0x227ed8,_0x553369){var _0x2d268e=[_0xaef6('0x2b'),_0xaef6('0x2c'),_0xaef6('0x2d'),_0xaef6('0x2e'),_0x123169+'.'+_0x227ed8,_0xaef6('0x2f'),_0xaef6('0x30'),_0xaef6('0x31'),'cm_contacts.UserId','\x22'+_0x553369+'\x22'];return squel[_0xaef6('0x32')]()[_0xaef6('0x33')](_0xaef6('0x34'))['fromQuery']([_0xaef6('0xf'),_0xaef6('0x35'),_0xaef6('0x36'),_0xaef6('0x37'),_0x227ed8,_0xaef6('0x38'),_0xaef6('0x39'),_0xaef6('0x3a'),_0xaef6('0x3b'),'recallme'],squel[_0xaef6('0xd')]()[_0xaef6('0x3c')](_0x2d268e)[_0xaef6('0x10')](_0x123169)['join'](_0xaef6('0x3d'),null,_0xaef6('0x3e')+_0x123169+_0xaef6('0x3f'))['join'](_0x52f97f,null,_0x52f97f+_0xaef6('0x12')+_0x123169+'.'+_0x227ed8)['where'](_0x123169+_0xaef6('0x40'),_0x4f6110)[_0xaef6('0x13')](_0xaef6('0x41'),NOW)['where'](_0xaef6('0x42'),selectNotIn(_0x123169,_0x52f97f,_0x227ed8,_0xaef6('0x34'),[_0xaef6('0x43'),_0xaef6('0x44')]))[_0xaef6('0x13')](_0xaef6('0x42'),selectNotIn(_0x123169,_0x52f97f,_0x227ed8,_0xaef6('0x34'),[_0xaef6('0x43')])))[_0xaef6('0x45')]();}function insertCmHopperBlack(_0x2bc1ff,_0x53cbd4,_0xee27fd,_0x12e876){var _0x5a77a0=[_0xaef6('0x2b'),'cm_contacts.id','cm_contacts.ListId',_0x53cbd4+'.'+_0x12e876,'cm_contacts.createdAt',_0xaef6('0x30')];return squel[_0xaef6('0x32')]()[_0xaef6('0x33')](_0xaef6('0x46'))[_0xaef6('0x47')]([_0xaef6('0xf'),_0xaef6('0x36'),_0xaef6('0x37'),_0x12e876,_0xaef6('0x38'),'updatedAt'],squel[_0xaef6('0xd')]()[_0xaef6('0x3c')](_0x5a77a0)[_0xaef6('0x10')](_0x53cbd4)[_0xaef6('0x11')](_0xaef6('0x3d'),null,_0xaef6('0x3e')+_0x53cbd4+_0xaef6('0x3f'))[_0xaef6('0x11')](_0xee27fd,null,_0xee27fd+_0xaef6('0x12')+_0x53cbd4+'.'+_0x12e876)[_0xaef6('0x13')](_0x53cbd4+_0xaef6('0x40'),_0x2bc1ff)[_0xaef6('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xaef6('0x13')](_0xaef6('0x42'),squel[_0xaef6('0xd')]()['field']('phone')['from'](_0xaef6('0x46'))['where']('ListId\x20=\x20?',_0x2bc1ff)['where'](_0x12e876+'\x20=\x20?',_0x53cbd4+'.'+_0x12e876)))[_0xaef6('0x45')]();}function insertCmHopperAdditionalPhones(_0x2eb5e2){var _0x465d91=[_0xaef6('0x48'),_0xaef6('0x49'),'cm_contact_has_items.OrderBy',_0xaef6('0x4a'),_0xaef6('0x4b')];return squel[_0xaef6('0x32')]()[_0xaef6('0x33')]('cm_hopper_additional_phones')[_0xaef6('0x47')](['CmHopperId',_0xaef6('0xf'),_0xaef6('0x4c'),'createdAt',_0xaef6('0x39')],squel[_0xaef6('0xd')]()[_0xaef6('0x3c')](_0x465d91)[_0xaef6('0x10')]('cm_hopper')[_0xaef6('0x11')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xaef6('0x13')]('cm_hopper.ListId\x20=\x20?',_0x2eb5e2)[_0xaef6('0x13')](_0xaef6('0x41'),NOW))['toString']();}function insertCmContact(_0x101c8f,_0x1870a3,_0xf72096,_0x568037){var _0x26cdd6=_['concat'](_['keys'](_0x568037),[_0xaef6('0x37'),_0xaef6('0x4d'),_0xaef6('0x38'),_0xaef6('0x39')]);return squel['insert']()['into'](_0xaef6('0x3d'))[_0xaef6('0x47')](_0x26cdd6,squel[_0xaef6('0xd')]()[_0xaef6('0x3c')](_0x26cdd6)['from'](_0x1870a3)[_0xaef6('0x13')]('('+_0xf72096[_0xaef6('0x11')](',')+_0xaef6('0x4e'),squel['select']()[_0xaef6('0x3c')](_0xf72096)['from'](_0xaef6('0x3d'))['where'](_0xaef6('0x4f'),_0x101c8f))[_0xaef6('0x13')](_0xaef6('0x50'),squel[_0xaef6('0xd')]()['field']('MIN(id)',_0xaef6('0x51'))[_0xaef6('0x10')](_0x1870a3)['group'](_0xf72096[_0xaef6('0x11')](','))))[_0xaef6('0x45')]();}function handleStop(){logger[_0xaef6('0x52')](_0xaef6('0x53'));stopped=!![];}function handleUncaughtException(_0x15be7b){logger[_0xaef6('0x54')](_0x15be7b[_0xaef6('0x55')]);process[_0xaef6('0x56')](0x1);}function handleError(_0x29bde6,_0xbf3807){stats['errors'][_0xaef6('0x1c')]({'name':_0xbf3807[_0xaef6('0x57')],'message':_0xbf3807[_0xaef6('0x55')],'row':_0x29bde6});}function handleQuery(_0x106e9f){logger[_0xaef6('0x52')](_0x106e9f);return db[_0xaef6('0x16')][_0xaef6('0x17')](_0x106e9f)['spread'](function(_0x14a55c){results[_0xaef6('0x1c')](_0x14a55c);})['catch'](function(_0x566dd3){logger[_0xaef6('0x54')](_0x566dd3[_0xaef6('0x55')]);});}function main(_0x1883c1,_0x3ae54b,_0x537946,_0x754dcf){logger[_0xaef6('0x52')](_0xaef6('0x58'),_0x1883c1,JSON[_0xaef6('0x59')](_0x3ae54b));process[_0xaef6('0x5a')](_0xaef6('0x5b'));var _0x46668d=_0x3ae54b[_0xaef6('0x5c')];var _0x1ea7be=_[_0xaef6('0x5d')](_0x46668d);var _0x3aa52f=_0x3ae54b[_0xaef6('0x5e')];var _0x2bda66=path['join'](config[_0xaef6('0x5f')],_0xaef6('0x60'),_0x3aa52f+_0xaef6('0x61'));logger[_0xaef6('0x52')](_0xaef6('0x62'),_0x3ae54b);db[_0xaef6('0x63')]['findAll']({'raw':!![],'attributes':['id',_0xaef6('0x64')]})[_0xaef6('0x1e')](function(_0x2527a1){for(var _0x147d19=0x0;_0x147d19<_0x2527a1[_0xaef6('0x21')];_0x147d19++){if(_0x2527a1[_0x147d19][_0xaef6('0x64')]in _0x46668d){contactItemTypes[_0xaef6('0x1c')](_0x2527a1[_0x147d19]);delete _0x1ea7be[_0x2527a1[_0x147d19]['name']];hasAdditionalPhones=!![];}for(var _0x450c1a in _0x46668d){if(_0x2527a1[_0x147d19][_0xaef6('0x64')]+'_description'===_0x450c1a){phoneDescriptions[_0xaef6('0x1c')]({'itemTypeId':_0x2527a1[_0x147d19]['id'],'description':_0x450c1a});delete _0x1ea7be[_0x450c1a];}}}if(hasAdditionalPhones)_0x1ea7be['AdditionalPhones']='';var _0x5ff6c9=_['keys'](_0x1ea7be)[_0xaef6('0x11')]();logger[_0xaef6('0x52')]('header',_0x5ff6c9);fs[_0xaef6('0x65')](_0x2bda66,_0x5ff6c9+'\x0a');Papa[_0xaef6('0x66')](fs[_0xaef6('0x67')](_0x1883c1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x28c6fb,_0x1d4cf1){try{for(var _0x5c6e4a=0x0,_0x4b0641=[];_0x5c6e4a<_0x28c6fb[_0xaef6('0x68')][_0xaef6('0x21')];_0x5c6e4a++){stats['rows']+=0x1;if(_0x28c6fb['errors'][_0x5c6e4a]){handleError(_0x28c6fb[_0xaef6('0x68')][_0x5c6e4a],_0x28c6fb['errors'][_0x5c6e4a]);}else{var _0x5d2cce=[];var _0x2936d8=[];var _0xe2c6d8={};for(var _0x74225d in _0x46668d){let _0x5588e1=contactItemTypes['find'](_0x431e33=>_0x431e33['name']===_0x74225d);let _0x5a932c=contactItemTypes[_0xaef6('0x69')](_0x9ea612=>_0x9ea612[_0xaef6('0x64')]+'_description'===_0x74225d);if(_[_0xaef6('0x1a')](_0x5588e1)&&_[_0xaef6('0x1a')](_0x5a932c)){if(_0x46668d[_0xaef6('0x6a')](_0x74225d)){if(_0x28c6fb['data'][_0x5c6e4a][_0x46668d[_0x74225d]]){var _0x13ab0a=_['trim'](_0x28c6fb['data'][_0x5c6e4a][_0x46668d[_0x74225d]]['replace'](/"/g,'\x27'));switch(_0x74225d){case _0xaef6('0x35'):var _0x47294a=moment(_0x13ab0a,_0xaef6('0xb'),!![]);if(_0x47294a[_0xaef6('0x6b')]()){_0x4b0641[_0xaef6('0x1c')]('\x22'+_0x13ab0a+'\x22');}else{_0x5d2cce['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x1461ef=parseInt(_0x13ab0a);_0x13ab0a=_[_0xaef6('0x6c')](_0x1461ef)||_0x1461ef<0x0||_0x1461ef>0x4?_0x754dcf?0x3:0x2:_0x1461ef;_0x4b0641[_0xaef6('0x1c')]('\x22'+_0x13ab0a+'\x22');break;case _0xaef6('0x3b'):var _0x45b078=parseInt(_0x13ab0a);if(_[_0xaef6('0x6d')](_0x45b078)&&_[_0xaef6('0x6e')](_0x537946,_0x45b078)){_0x4b0641[_0xaef6('0x1c')]('\x22'+_0x45b078+'\x22');}else{_0x5d2cce[_0xaef6('0x1c')](_0xaef6('0x6f'));}break;case _0xaef6('0x70'):if(isEmail(_0x13ab0a)){_0x4b0641[_0xaef6('0x1c')]('\x22'+_0x13ab0a+'\x22');}else{_0x5d2cce[_0xaef6('0x1c')](_0xaef6('0x71'));}break;case _0xaef6('0x72'):var _0x43869d=moment(_0x13ab0a,_0xaef6('0x73'),!![]);if(_0x43869d['isValid']()){_0x4b0641[_0xaef6('0x1c')]('\x22'+_0x13ab0a+'\x22');}else{_0x5d2cce['push'](_0xaef6('0x74'));}break;default:_0x4b0641[_0xaef6('0x1c')]('\x22'+_0x13ab0a+'\x22');}}else{switch(_0x74225d){case'firstName':case _0xaef6('0xf'):_0x5d2cce['push'](_0x74225d+'\x20not\x20specified');break;default:_0x4b0641[_0xaef6('0x1c')]('\x22\x22');}}}}else{var _0x5b5ecb='';if(!_[_0xaef6('0x1a')](_0x5588e1)){if(!_0xe2c6d8[_0xaef6('0x6a')](_0x5588e1['id'])){for(var _0x4bc541=0x0;_0x4bc541<_0x46668d[_0x74225d]['length'];_0x4bc541++){var _0x13ab0a=_['trim'](_0x28c6fb[_0xaef6('0x68')][_0x5c6e4a][_0x46668d[_0x74225d][_0x4bc541]][_0xaef6('0x75')](/"/g,'\x27'));var _0x494d14=phoneDescriptions[_0xaef6('0x69')](_0x1c58fb=>_0x1c58fb[_0xaef6('0x76')]===_0x5588e1['id']);if(!_[_0xaef6('0x1a')](_0x494d14)){var _0x493cb8=_['trim'](_0x28c6fb['data'][_0x5c6e4a][_0x46668d[_0x494d14[_0xaef6('0x77')]][0x0]][_0xaef6('0x75')](/"/g,'\x27'));if(!_[_0xaef6('0x1a')](_0x493cb8))_0x13ab0a=_0x13ab0a+'§'+_0x493cb8;}if(_0x5b5ecb=='')_0x5b5ecb=_0x13ab0a;else _0x5b5ecb+='|'+_0x13ab0a;}_0x2936d8[_0xaef6('0x1c')](_0x5588e1['id']+':'+_0x5b5ecb);_0xe2c6d8[_0x5588e1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4b0641['push']('\x22'+_0x2936d8[_0xaef6('0x11')](';')+'\x22');}if(_0x5d2cce[_0xaef6('0x21')]){handleError(_0x28c6fb[_0xaef6('0x68')][_0x5c6e4a],{'code':_0xaef6('0x78'),'message':_0x5d2cce[_0xaef6('0x11')]()});}else{fs[_0xaef6('0x79')](_0x2bda66,_0x4b0641[_0xaef6('0x11')]()+'\x0a');}_0x4b0641=[];}if(!(stats[_0xaef6('0x7a')]%0xc8)){socket['emit']('contact:import:'+_0x3aa52f,stats);stats[_0xaef6('0x7b')]=[];}}if(stopped){logger[_0xaef6('0x52')](_0xaef6('0x7c'));_0x1d4cf1[_0xaef6('0x7d')]();}}catch(_0x48ecdc){handleError(_0x28c6fb[_0xaef6('0x68')][_0x5c6e4a],{'code':_0xaef6('0x7e'),'message':_0x48ecdc['message']});logger[_0xaef6('0x54')]('step',_0x48ecdc['message']);}},'complete':function(){try{var _0x4ac146=[];var _0x51c112=tempTableName;_0x4ac146[_0xaef6('0x1c')]('CREATE\x20TABLE\x20'+_0x51c112+_0xaef6('0x7f'));logger[_0xaef6('0x52')](_0xaef6('0x80'),contactItemTypes[_0xaef6('0x21')]);var _0x2b75d0=util[_0xaef6('0xa')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2bda66,_0x51c112,_0x5ff6c9,_0x3ae54b[_0xaef6('0x37')],_0x3ae54b[_0xaef6('0x4d')]||null,NOW,NOW);if(_[_0xaef6('0x1a')](_0x46668d[_0xaef6('0x35')])){_0x2b75d0+=',\x20scheduledAt\x20=\x20NOW()';}_0x4ac146['push'](_0x2b75d0);BPromise[_0xaef6('0x81')](_0x4ac146,handleQuery)[_0xaef6('0x1e')](function(_0x49c760){BPromise[_0xaef6('0x1d')]([handleAdditionalPhones()])[_0xaef6('0x1e')](function(){_0x4ac146=[];for(var _0x999243=0x0;_0x999243\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.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.MailAccountId','i.UserId','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','Contact.email','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','sequelize','groupBy','Setting','enableEmailPreview','all','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','where','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','agent','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','from','left_join','users','length','ui.','\x20IN\x20?','interactions','cm_contacts','messages'];(function(_0x20ec24,_0x29b81b){var _0x4890f9=function(_0x413b1f){while(--_0x413b1f){_0x20ec24['push'](_0x20ec24['shift']());}};_0x4890f9(++_0x29b81b);}(_0x1020,0x1ac));var _0x0102=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x1020[_0x256b72];return _0x2183e3;};'use strict';var _=require('lodash');var squel=require(_0x0102('0x0'));var as=require(_0x0102('0x1'));var qs=require(_0x0102('0x2'));var updateInteraction=require(_0x0102('0x3'))[_0x0102('0x4')];var utils=require(_0x0102('0x5'));var db=require(_0x0102('0x6'))['db'];function skipInteractionsQuery(_0x1c8721,_0x20de29,_0x33082d){var _0x50bdfc=![];var _0x6f148c=utils[_0x0102('0x7')](_0x1c8721);if(_0x20de29['role']===_0x0102('0x8')&&!_0x33082d['search']&&!_0x33082d[_0x6f148c]){_0x50bdfc=!![];}return _0x50bdfc;}function getTagsQuery(){return squel[_0x0102('0x9')]()[_0x0102('0xa')]('id')['field'](_0x0102('0xb'))[_0x0102('0xa')](_0x0102('0xc'))['from'](_0x0102('0xd'));}function getUsersQuery(_0x2344c1,_0x2fe78a){var _0x264920=utils[_0x0102('0xe')](_0x2344c1);var _0x163df7=_0x0102('0xf')+_0x2344c1+_0x0102('0x10');var _0x180f09=squel[_0x0102('0x9')]()[_0x0102('0xa')](_0x0102('0x11'))[_0x0102('0xa')](_0x0102('0x12'))['field']('ui.'+_0x264920)[_0x0102('0x13')](_0x163df7,'ui')[_0x0102('0x14')](_0x0102('0x15'),'u','u.id\x20=\x20ui.UserId');if(_0x2fe78a[_0x0102('0x16')]>0x0){_0x180f09['where'](_0x0102('0x17')+_0x264920+_0x0102('0x18'),_['map'](_0x2fe78a,'id'));}return _0x180f09;}function getInteractionsQuery(_0x196b9e){var _0x2c15a6=utils['getInteractionsTables'](_0x196b9e);var _0x5fcf3c=utils[_0x0102('0x7')](_0x196b9e);var _0x1732bd=utils[_0x0102('0xe')](_0x196b9e);return squel['select']()[_0x0102('0x13')](_0x2c15a6[_0x0102('0x19')],'i')[_0x0102('0x14')](_0x0102('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0102('0x14')](_0x0102('0x15'),'o','o.id\x20=\x20i.UserId')[_0x0102('0x14')](_0x2c15a6['accounts'],'a','a.id\x20=\x20i.'+_0x5fcf3c)[_0x0102('0x14')](_0x2c15a6[_0x0102('0x1b')],'me',_0x0102('0x1c')+_0x1732bd+_0x0102('0x1d'))[_0x0102('0x14')](_0x2c15a6[_0x0102('0x1e')],'it',_0x0102('0x1f')+_0x1732bd+_0x0102('0x1d'))[_0x0102('0x14')]('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x57c5eb={'body':squel[_0x0102('0x20')](),'contact':squel[_0x0102('0x20')](),'default':squel[_0x0102('0x20')](),'fields':squel['expr'](),'filter':squel[_0x0102('0x20')](),'read':squel['expr'](),'tags':{'clause':squel[_0x0102('0x20')](),'ids':null},'user':squel['expr']()};return _0x57c5eb;}function parseTagParameter(_0x154384){var _0xa92841=squel[_0x0102('0x20')]();if(_0x154384){var _0x397296=utils['getSelectedTags'](_0x154384);_0x397296[_0x0102('0x21')](function(_0x41f208){_0xa92841['or'](_0x0102('0x22'),'%,'+_0x41f208+',%');});}return _0xa92841;}function parseReadParameter(_0x2c7263){var _0x19cc94='';if(_0x2c7263){_0x19cc94=_0x0102('0x23');if(_0x2c7263==='1'){_0x19cc94=_0x19cc94['replace']('{OPERATOR}','=');}else{_0x19cc94=_0x19cc94[_0x0102('0x24')](_0x0102('0x25'),'>');}}return _0x19cc94;}function parseSearchFilter(_0x3f5073,_0x1b0e6){var _0xb25734=squel[_0x0102('0x20')]();if(_0x1b0e6){var _0x2978e2=_0x1b0e6[_0x0102('0x24')]('\x5c','\x5c\x5c')[_0x0102('0x24')](/'/g,'\x27\x27');if(qs[_0x0102('0x26')](_0x2978e2)){_0xb25734['or'](_0x0102('0x27'),_0x2978e2+'%');if([_0x0102('0x28'),_0x0102('0x29')]['includes'](_0x3f5073)){_0xb25734['or']('i.phone\x20LIKE\x20?',_0x2978e2+'%');}else if(_0x3f5073===_0x0102('0x2a')){_0xb25734['or'](_0x0102('0x2b'),_0x2978e2+'%');}else if(_0x3f5073==='openchannel'){_0xb25734['or'](_0x0102('0x2c'),_0x2978e2+'%');}}else if(_0x3f5073===_0x0102('0x2d')&&qs[_0x0102('0x2e')](_0x2978e2)){_0xb25734['or'](_0x0102('0x2f'),_0x2978e2+'%');}else{if(_0x3f5073===_0x0102('0x2d')){_0xb25734['or'](_0x0102('0x30'),qs[_0x0102('0x31')](_0x2978e2,!![]))['or'](_0x0102('0x32'),qs['getFullTextValue'](_0x2978e2));}else if(_0x3f5073!==_0x0102('0x2a')){_0xb25734['or'](_0x0102('0x33'),qs[_0x0102('0x31')](_0x2978e2));}_0xb25734['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0102('0x31')](_0x2978e2,!![]),null);}}return _0xb25734;}function parseAdvancedSearchFilter(_0xad7b4a,_0x595ed5){var _0x4e703a=getSqlClauses();var _0xf5c945=as[_0x0102('0x34')](_0xad7b4a);var _0x26e66d=_0xf5c945[_0x0102('0x35')];for(var _0x840bbb=0x0;_0x840bbb<_0xf5c945[_0x0102('0x36')][_0x0102('0x16')];_0x840bbb++){var _0x25dc91=_0xf5c945[_0x0102('0x36')][_0x840bbb];var _0x157f66='i';var _0x3c6fe9=_['find'](_0x595ed5,['name',_0x25dc91[_0x0102('0xa')]]);if(_0x3c6fe9){var _0x2662ab=as[_0x0102('0x37')](_0x157f66,_0x3c6fe9[_0x0102('0x38')],_0x25dc91);_0x4e703a[_0x0102('0x39')][_0x26e66d](_0x2662ab[_0x0102('0x3a')],_0x2662ab[_0x0102('0x3b')]['start'],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);}else{switch(_0x25dc91['field']){case'unreadMessages':var _0x293c68=parseReadParameter(_0x25dc91[_0x0102('0x3b')]);_0x4e703a[_0x0102('0x3d')][_0x0102('0x3e')](_0x293c68);break;case'Contact':if(_0x25dc91[_0x0102('0x3f')]===_0x0102('0x40')){if(_0x25dc91[_0x0102('0x3b')][_0x0102('0x41')]('\x20')['length']>0x1){_0x4e703a[_0x0102('0x42')][_0x26e66d](_0x0102('0x43'),qs[_0x0102('0x31')](_0x25dc91[_0x0102('0x3b')],!![]),null);}else{var _0x1a6a95='%'+_0x25dc91[_0x0102('0x3b')]+'%';_0x4e703a[_0x0102('0x42')][_0x26e66d](_0x0102('0x44'),_0x1a6a95,_0x1a6a95,_0x1a6a95);}}else{_0x3c6fe9=_[_0x0102('0x45')](_0x595ed5,[_0x0102('0xb'),_0x0102('0x46')]);_0x25dc91[_0x0102('0xa')]=_0x0102('0x46');_0x2662ab=as[_0x0102('0x37')](_0x157f66,_0x3c6fe9[_0x0102('0x38')],_0x25dc91);_0x4e703a['contact'][_0x26e66d](_0x2662ab[_0x0102('0x3a')],_0x2662ab['value'][_0x0102('0x47')],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);}break;case _0x0102('0x48'):var _0x4701d2=_0x25dc91[_0x0102('0x3b')][_0x0102('0x41')](',')[_0x0102('0x49')](function(_0x2242c2){return Number(_0x2242c2);});var _0x248766=parseTagParameter(_0x4701d2);_0x4e703a['tags'][_0x0102('0x4a')][_0x0102('0x3e')](_0x248766);_0x4e703a[_0x0102('0x4b')][_0x0102('0x4c')]=_0x4701d2;break;case _0x0102('0x4d'):if(_0x25dc91[_0x0102('0x3f')]==='$substring'){_0x4e703a[_0x0102('0x4e')][_0x26e66d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x25dc91[_0x0102('0x3b')]+'%',null);}else{_0x3c6fe9=_[_0x0102('0x45')](_0x595ed5,['name',_0x0102('0x4f')]);_0x25dc91[_0x0102('0xa')]=_0x0102('0x4f');_0x2662ab=as[_0x0102('0x37')](_0x157f66,_0x3c6fe9[_0x0102('0x38')],_0x25dc91);_0x4e703a[_0x0102('0x4e')][_0x26e66d](_0x2662ab[_0x0102('0x3a')],_0x2662ab['value'][_0x0102('0x47')],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);}break;case'body':case _0x0102('0x50'):_0x2662ab=as[_0x0102('0x37')]('me',null,_0x25dc91);_0x4e703a['body'][_0x26e66d](_0x2662ab['text'],_0x2662ab[_0x0102('0x3b')][_0x0102('0x47')],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);break;}}}return _0x4e703a;}function parseModelFields(_0x489d58,_0x572dca,_0x1bb2cf){var _0x38470d=utils[_0x0102('0x7')](_0x489d58);var _0x446cab=squel[_0x0102('0x20')]();var _0x242c65=_(_0x572dca)[_0x0102('0x51')]()[_0x0102('0x49')](function(_0x5deab3){return _[_0x0102('0x52')](_0x1bb2cf,[_0x0102('0xb'),_0x5deab3])?_0x5deab3:undefined;})[_0x0102('0x53')]()['value']();if(_0x242c65[_0x0102('0x16')]>0x0){_0x242c65[_0x0102('0x21')](function(_0x82b197){if(_0x82b197===_0x38470d){_0x446cab[_0x0102('0x3e')]('i.'+_0x38470d+_0x0102('0x18'),[][_0x0102('0x54')](_0x572dca[_0x82b197]));}else if(_0x82b197==='createdAt'){var _0xe74846=JSON['parse'](_0x572dca[_0x82b197])['$gte'];var _0x1ba207=JSON[_0x0102('0x55')](_0x572dca[_0x82b197])['$lte'];_0x446cab[_0x0102('0x3e')](_0x0102('0x56'),_0xe74846,_0x1ba207);}else{if(_0x572dca[_0x82b197]===_0x0102('0x57')){_0x446cab[_0x0102('0x3e')]('i.'+_0x82b197+_0x0102('0x58'));}else{_0x446cab['and']('i.'+_0x82b197+_0x0102('0x59'),_0x572dca[_0x82b197]);}}});}return _0x446cab;}function parseQueryParameters(_0x268b7b,_0x1e562b,_0x2b718e){var _0x6e65ca=getSqlClauses();return Promise[_0x0102('0x5a')]()[_0x0102('0x5b')](function(){return parseModelFields(_0x268b7b,_0x1e562b,_0x2b718e);})[_0x0102('0x5b')](function(_0x68386c){_0x6e65ca[_0x0102('0x5c')][_0x0102('0x3e')](_0x68386c);return parseReadParameter(_0x1e562b[_0x0102('0x3d')]);})['then'](function(_0x4d0ca1){_0x6e65ca[_0x0102('0x3d')][_0x0102('0x3e')](_0x4d0ca1);return parseTagParameter(_0x1e562b[_0x0102('0x5d')]);})[_0x0102('0x5b')](function(_0x54bcea){_0x6e65ca[_0x0102('0x4b')][_0x0102('0x4a')][_0x0102('0x3e')](_0x54bcea);return parseSearchFilter(_0x268b7b,_0x1e562b[_0x0102('0x5e')]);})[_0x0102('0x5b')](function(_0x4e5763){_0x6e65ca[_0x0102('0x5e')]=_0x4e5763;return _0x6e65ca;});}function checkAccountsRestrictions(_0x39a09c,_0x3e109a,_0x55ce88){var _0xb337a8=utils['getAccountFK'](_0x39a09c);var _0x49ba4f=_0x0102('0x5f')+_[_0x0102('0x60')](_0x39a09c)+(_0x39a09c===_0x0102('0x61')?'Websites':'Accounts');var _0x15e17f=squel['expr']();return Promise[_0x0102('0x5a')]()[_0x0102('0x5b')](function(){if(_0x55ce88['search']&&_0x3e109a['role']===_0x0102('0x8')){return _0x3e109a[_0x49ba4f]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x11b352){if(_0x11b352){if(_0x11b352[_0x0102('0x16')]===0x0){_0x15e17f['and']('i.'+_0xb337a8+_0x0102('0x58'));}else{_0x15e17f[_0x0102('0x3e')]('i.'+_0xb337a8+'\x20IN\x20?',_[_0x0102('0x49')](_0x11b352,'id'));}}else if(!_0x55ce88[_0xb337a8]){_0x15e17f[_0x0102('0x3e')]('i.'+_0xb337a8+_0x0102('0x62'));}})['then'](function(){return _0x15e17f;});}function getClosedOrderClause(_0x263fdc,_0x49e9fe){var _0x39759b='';var _0x2bd92f=[_0x0102('0x63'),_0x0102('0x64'),_0x0102('0x65')];if(_0x263fdc==='mail'){_0x2bd92f['unshift'](_0x0102('0x66'));}if(_0x49e9fe['closed']==='0'&&_0x263fdc===_0x0102('0x2d')){_0x39759b=_0x0102('0x66');}else{if(_0x49e9fe['closed']==='1'){_0x2bd92f[_0x0102('0x67')]();}_0x39759b=_0x0102('0x68')+_0x2bd92f[_0x0102('0x69')](',\x20')+')';}return _0x39759b;}function getFilteredInteractions(_0x12de50,_0x394b4d,_0x1e6808,_0x1a7b34){var _0x3a62d4=utils[_0x0102('0xe')](_0x12de50);var _0x3b45bc=_[_0x0102('0x60')](_0x12de50)+_0x0102('0x6a');var _0x30e6fb=[];var _0x2be2c1=getTagsQuery();var _0x2de788={'type':db[_0x0102('0x6b')][_0x0102('0x6c')][_0x0102('0x6d')],'raw':!![]};var _0x2d75b2=[];var _0x121a2d=[];return db['sequelize'][_0x0102('0x6e')](_0x2be2c1[_0x0102('0x6f')](),_0x2de788)[_0x0102('0x5b')](function(_0x48ef90){_0x30e6fb=_[_0x0102('0x70')](_0x48ef90,'id');_0x2de788=_['merge'](_0x2de788,{'model':db[_0x3b45bc],'mapToModel':!![],'nest':!![]});if(_0x1e6808['fields']){_0x1a7b34['attributes']['forEach'](function(_0x52476d){_0x394b4d[_0x0102('0xa')]('i.'+_0x52476d);});}else{_0x394b4d[_0x0102('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x394b4d[_0x0102('0xa')](_0x0102('0x71'),_0x0102('0x72'));_0x394b4d['field'](_0x0102('0x73'),'Account.mandatoryDisposition');if(_0x12de50===_0x0102('0x2d')){_0x394b4d[_0x0102('0xa')](_0x0102('0x74'),_0x0102('0x75'));_0x394b4d[_0x0102('0xa')](_0x0102('0x76'),'contactName');_0x394b4d[_0x0102('0xa')](_0x0102('0x77'));_0x394b4d['field'](_0x0102('0x78'));_0x394b4d[_0x0102('0xa')]('i.updatedAt');_0x394b4d[_0x0102('0xa')](_0x0102('0x79'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7a'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7b'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7c'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7d'));_0x394b4d[_0x0102('0xa')]('i.subject');_0x394b4d[_0x0102('0xa')]('i.disposition');_0x394b4d[_0x0102('0xa')]('i.secondDisposition');_0x394b4d[_0x0102('0xa')](_0x0102('0x63'));_0x394b4d[_0x0102('0xa')]('i.substatus');_0x394b4d[_0x0102('0xa')]('i.to');_0x394b4d[_0x0102('0xa')]('i.ContactId');_0x394b4d[_0x0102('0xa')](_0x0102('0x7e'));_0x394b4d['field'](_0x0102('0x7f'));}else if(_0x12de50==='openchannel'){_0x394b4d[_0x0102('0xa')]('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',_0x0102('0x80'));}else{_0x394b4d[_0x0102('0xa')](_0x0102('0x81'),'contactName');}if(_0x12de50!==_0x0102('0x2d')){_0x394b4d[_0x0102('0xa')]('i.*');}_0x394b4d[_0x0102('0xa')](_0x0102('0x82'),_0x0102('0x83'));_0x394b4d[_0x0102('0xa')]('c.lastName',_0x0102('0x84'));_0x394b4d[_0x0102('0xa')]('c.email',_0x0102('0x85'));_0x394b4d[_0x0102('0xa')]('c.phone','Contact.phone');_0x394b4d[_0x0102('0xa')]('c.mobile',_0x0102('0x86'));_0x394b4d['field'](_0x0102('0x87'),'Contact.fax');_0x394b4d[_0x0102('0xa')]('o.fullname','Owner.fullname');_0x394b4d['field'](_0x0102('0x88'),_0x0102('0x89'));_0x394b4d[_0x0102('0xa')](_0x0102('0x8a'),'TagIds');}if(_0x1a7b34[_0x0102('0x8b')]){_0x394b4d[_0x0102('0x8b')](_0x1a7b34['limit']);}if(_0x1a7b34[_0x0102('0x8c')]){_0x394b4d[_0x0102('0x8c')](_0x1a7b34['offset']);}return db[_0x0102('0x8d')][_0x0102('0x6e')](_0x394b4d[_0x0102('0x6f')](),_0x2de788);})[_0x0102('0x5b')](function(_0x3122b9){_0x2d75b2=_0x3122b9;var _0x385099=getUsersQuery(_0x12de50,_0x2d75b2);return db[_0x0102('0x8d')][_0x0102('0x6e')](_0x385099['toString'](),_0x2de788);})[_0x0102('0x5b')](function(_0x27a314){_0x121a2d=_[_0x0102('0x8e')](_0x27a314,_0x3a62d4);if(_0x12de50===_0x0102('0x2d')){return db[_0x0102('0x8f')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x0102('0x5b')](function(_0x112591){var _0x1b37a4=_0x112591?_0x112591[_0x0102('0x90')]:undefined;var _0x51ced0=_0x2d75b2[_0x0102('0x49')](function(_0x358e18){return updateInteraction(_0x358e18,_0x30e6fb,_0x121a2d,_0x1b37a4);});return Promise[_0x0102('0x91')](_0x51ced0);});}function countFilteredInteractions(_0x4501eb,_0xd1f420){var _0x7f0a43=_0x4501eb[_0x0102('0x92')]();_0x7f0a43['field']('COUNT(*)');_0x7f0a43[_0x0102('0xa')](_0x0102('0x93'),_0x0102('0x94'));var _0x28a155=utils['getSelectedTags'](_0xd1f420);if(!_[_0x0102('0x95')](_0x28a155)){_0x7f0a43[_0x0102('0x96')]('t.id\x20IN\x20?',_0x28a155);}var _0x433a14={'type':db[_0x0102('0x6b')][_0x0102('0x6c')][_0x0102('0x6d')],'raw':!![]};return db[_0x0102('0x8d')][_0x0102('0x6e')](_0x7f0a43[_0x0102('0x6f')](),_0x433a14);}module[_0x0102('0x97')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x1584=['SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','all','isEmpty','exports','squel','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','where','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','me.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','length','buildExpression','type','text','value','start','end','unreadMessages','read','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','Tag','tags','clause','and','operator','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','map','some','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','tag','filter','capitalize','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','getInteractionFK','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','keyBy','merge','fields','attributes'];(function(_0x597120,_0x4c8386){var _0x11678f=function(_0x9e5089){while(--_0x9e5089){_0x597120['push'](_0x597120['shift']());}};_0x11678f(++_0x4c8386);}(_0x1584,0xc5));var _0x4158=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x1584[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var squel=require(_0x4158('0x0'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x4158('0x1'))[_0x4158('0x2')];var utils=require(_0x4158('0x3'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5a750b,_0x1980fb,_0x5112f1){var _0x4e0243=![];var _0x6e4959=utils[_0x4158('0x4')](_0x5a750b);if(_0x1980fb[_0x4158('0x5')]===_0x4158('0x6')&&!_0x5112f1[_0x4158('0x7')]&&!_0x5112f1[_0x6e4959]){_0x4e0243=!![];}return _0x4e0243;}function getTagsQuery(){return squel[_0x4158('0x8')]()[_0x4158('0x9')]('id')[_0x4158('0x9')](_0x4158('0xa'))[_0x4158('0x9')](_0x4158('0xb'))[_0x4158('0xc')](_0x4158('0xd'));}function getUsersQuery(_0x17f8f4,_0x4fec89){var _0x532f17=utils['getInteractionFK'](_0x17f8f4);var _0x1aaf1d='user_has_'+_0x17f8f4+'_interactions';var _0x2768ff=squel[_0x4158('0x8')]()[_0x4158('0x9')](_0x4158('0xe'))[_0x4158('0x9')](_0x4158('0xf'))[_0x4158('0x9')]('ui.'+_0x532f17)[_0x4158('0xc')](_0x1aaf1d,'ui')[_0x4158('0x10')](_0x4158('0x11'),'u',_0x4158('0x12'));if(_0x4fec89['length']>0x0){_0x2768ff[_0x4158('0x13')]('ui.'+_0x532f17+'\x20IN\x20?',_['map'](_0x4fec89,'id'));}return _0x2768ff;}function getInteractionsQuery(_0x2af3c1){var _0x415439=utils[_0x4158('0x14')](_0x2af3c1);var _0x533369=utils[_0x4158('0x4')](_0x2af3c1);var _0x38dee8=utils['getInteractionFK'](_0x2af3c1);return squel[_0x4158('0x8')]()['from'](_0x415439[_0x4158('0x15')],'i')[_0x4158('0x10')](_0x4158('0x16'),'c',_0x4158('0x17'))[_0x4158('0x10')](_0x4158('0x11'),'o','o.id\x20=\x20i.UserId')[_0x4158('0x10')](_0x415439[_0x4158('0x18')],'a','a.id\x20=\x20i.'+_0x533369)[_0x4158('0x10')](_0x415439['messages'],'me',_0x4158('0x19')+_0x38dee8+_0x4158('0x1a'))['left_join'](_0x415439['interactionsTags'],'it','it.'+_0x38dee8+'\x20=\x20i.id')[_0x4158('0x10')](_0x4158('0xd'),'t',_0x4158('0x1b'));}function getSqlClauses(){var _0x28979d={'body':squel['expr'](),'contact':squel['expr'](),'default':squel['expr'](),'fields':squel[_0x4158('0x1c')](),'filter':squel[_0x4158('0x1c')](),'read':squel['expr'](),'tags':{'clause':squel[_0x4158('0x1c')](),'ids':null},'user':squel[_0x4158('0x1c')]()};return _0x28979d;}function parseTagParameter(_0x607c48){var _0x10f869=squel[_0x4158('0x1c')]();if(_0x607c48){var _0x3b42f4=utils[_0x4158('0x1d')](_0x607c48);_0x3b42f4[_0x4158('0x1e')](function(_0x340f4d){_0x10f869['or'](_0x4158('0x1f'),'%,'+_0x340f4d+',%');});}return _0x10f869;}function parseReadParameter(_0x57cbd0){var _0x3d3a40='';if(_0x57cbd0){_0x3d3a40='unreadMessages\x20{OPERATOR}\x200';if(_0x57cbd0==='1'){_0x3d3a40=_0x3d3a40[_0x4158('0x20')](_0x4158('0x21'),'=');}else{_0x3d3a40=_0x3d3a40[_0x4158('0x20')](_0x4158('0x21'),'>');}}return _0x3d3a40;}function parseSearchFilter(_0x132306,_0xfb1a0c){var _0x2ca7b9=squel[_0x4158('0x1c')]();if(_0xfb1a0c){var _0x2bda3a=_0xfb1a0c[_0x4158('0x20')]('\x5c','\x5c\x5c')[_0x4158('0x20')](/'/g,'\x27\x27');if(qs[_0x4158('0x22')](_0x2bda3a)){_0x2ca7b9['or'](_0x4158('0x23'),_0x2bda3a+'%');if([_0x4158('0x24'),'whatsapp'][_0x4158('0x25')](_0x132306)){_0x2ca7b9['or'](_0x4158('0x26'),_0x2bda3a+'%');}else if(_0x132306===_0x4158('0x27')){_0x2ca7b9['or'](_0x4158('0x28'),_0x2bda3a+'%');}else if(_0x132306===_0x4158('0x29')){_0x2ca7b9['or'](_0x4158('0x2a'),_0x2bda3a+'%');}}else if(_0x132306===_0x4158('0x2b')&&qs['isEmail'](_0x2bda3a)){_0x2ca7b9['or'](_0x4158('0x2c'),_0x2bda3a+'%');}else{if(_0x132306===_0x4158('0x2b')){_0x2ca7b9['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4158('0x2d')](_0x2bda3a,!![]))['or'](_0x4158('0x2e'),qs[_0x4158('0x2d')](_0x2bda3a));}else if(_0x132306!=='fax'){_0x2ca7b9['or'](_0x4158('0x2f'),qs[_0x4158('0x2d')](_0x2bda3a));}_0x2ca7b9['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2bda3a,!![]),null);}}return _0x2ca7b9;}function parseAdvancedSearchFilter(_0x18ec39,_0x3ccffb){var _0x36bf76=getSqlClauses();var _0x29d1ff=as[_0x4158('0x30')](_0x18ec39);var _0x4b56c6=_0x29d1ff['sqlOperator'];for(var _0x40b5fb=0x0;_0x40b5fb<_0x29d1ff[_0x4158('0x31')][_0x4158('0x32')];_0x40b5fb++){var _0x186c98=_0x29d1ff[_0x4158('0x31')][_0x40b5fb];var _0x4dcd4f='i';var _0x253e1e=_['find'](_0x3ccffb,[_0x4158('0xa'),_0x186c98[_0x4158('0x9')]]);if(_0x253e1e){var _0x68aa5d=as[_0x4158('0x33')](_0x4dcd4f,_0x253e1e[_0x4158('0x34')],_0x186c98);_0x36bf76['default'][_0x4b56c6](_0x68aa5d[_0x4158('0x35')],_0x68aa5d[_0x4158('0x36')][_0x4158('0x37')],_0x68aa5d[_0x4158('0x36')][_0x4158('0x38')]);}else{switch(_0x186c98[_0x4158('0x9')]){case _0x4158('0x39'):var _0x4b8187=parseReadParameter(_0x186c98['value']);_0x36bf76[_0x4158('0x3a')]['and'](_0x4b8187);break;case'Contact':if(_0x186c98['operator']===_0x4158('0x3b')){if(_0x186c98['value'][_0x4158('0x3c')]('\x20')['length']>0x1){_0x36bf76[_0x4158('0x3d')][_0x4b56c6](_0x4158('0x3e'),qs[_0x4158('0x2d')](_0x186c98['value'],!![]),null);}else{var _0x479464='%'+_0x186c98[_0x4158('0x36')]+'%';_0x36bf76['contact'][_0x4b56c6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x479464,_0x479464,_0x479464);}}else{_0x253e1e=_[_0x4158('0x3f')](_0x3ccffb,[_0x4158('0xa'),'ContactId']);_0x186c98[_0x4158('0x9')]=_0x4158('0x40');_0x68aa5d=as[_0x4158('0x33')](_0x4dcd4f,_0x253e1e[_0x4158('0x34')],_0x186c98);_0x36bf76[_0x4158('0x3d')][_0x4b56c6](_0x68aa5d[_0x4158('0x35')],_0x68aa5d[_0x4158('0x36')][_0x4158('0x37')],_0x68aa5d['value']['end']);}break;case _0x4158('0x41'):var _0x2def8f=_0x186c98[_0x4158('0x36')][_0x4158('0x3c')](',')['map'](function(_0x4042b1){return Number(_0x4042b1);});var _0x36a4cc=parseTagParameter(_0x2def8f);_0x36bf76[_0x4158('0x42')][_0x4158('0x43')][_0x4158('0x44')](_0x36a4cc);_0x36bf76[_0x4158('0x42')]['ids']=_0x2def8f;break;case'User':if(_0x186c98[_0x4158('0x45')]===_0x4158('0x3b')){_0x36bf76[_0x4158('0x46')][_0x4b56c6](_0x4158('0x47'),'%'+_0x186c98[_0x4158('0x36')]+'%',null);}else{_0x253e1e=_[_0x4158('0x3f')](_0x3ccffb,[_0x4158('0xa'),_0x4158('0x48')]);_0x186c98['field']='UserId';_0x68aa5d=as[_0x4158('0x33')](_0x4dcd4f,_0x253e1e[_0x4158('0x34')],_0x186c98);_0x36bf76[_0x4158('0x46')][_0x4b56c6](_0x68aa5d[_0x4158('0x35')],_0x68aa5d[_0x4158('0x36')][_0x4158('0x37')],_0x68aa5d[_0x4158('0x36')][_0x4158('0x38')]);}break;case _0x4158('0x49'):case _0x4158('0x4a'):_0x68aa5d=as['buildExpression']('me',null,_0x186c98);_0x36bf76['body'][_0x4b56c6](_0x68aa5d[_0x4158('0x35')],_0x68aa5d[_0x4158('0x36')][_0x4158('0x37')],_0x68aa5d[_0x4158('0x36')][_0x4158('0x38')]);break;}}}return _0x36bf76;}function parseModelFields(_0x33c779,_0x21225a,_0x207277){var _0x35b084=utils[_0x4158('0x4')](_0x33c779);var _0x528681=squel['expr']();var _0x50f20e=_(_0x21225a)[_0x4158('0x4b')]()[_0x4158('0x4c')](function(_0x3c4580){return _[_0x4158('0x4d')](_0x207277,[_0x4158('0xa'),_0x3c4580])?_0x3c4580:undefined;})['compact']()[_0x4158('0x36')]();if(_0x50f20e['length']>0x0){_0x50f20e['forEach'](function(_0x5c4d33){if(_0x5c4d33===_0x35b084){_0x528681[_0x4158('0x44')]('i.'+_0x35b084+_0x4158('0x4e'),[][_0x4158('0x4f')](_0x21225a[_0x5c4d33]));}else if(_0x5c4d33===_0x4158('0x50')){var _0x5b70eb=JSON[_0x4158('0x51')](_0x21225a[_0x5c4d33])[_0x4158('0x52')];var _0x2bd8eb=JSON[_0x4158('0x51')](_0x21225a[_0x5c4d33])[_0x4158('0x53')];_0x528681[_0x4158('0x44')](_0x4158('0x54'),_0x5b70eb,_0x2bd8eb);}else{if(_0x21225a[_0x5c4d33]===_0x4158('0x55')){_0x528681['and']('i.'+_0x5c4d33+_0x4158('0x56'));}else{_0x528681['and']('i.'+_0x5c4d33+_0x4158('0x57'),_0x21225a[_0x5c4d33]);}}});}return _0x528681;}function parseQueryParameters(_0x47f495,_0x2f61e4,_0x691cf6){var _0x24a93d=getSqlClauses();return Promise[_0x4158('0x58')]()[_0x4158('0x59')](function(){return parseModelFields(_0x47f495,_0x2f61e4,_0x691cf6);})[_0x4158('0x59')](function(_0x3d502c){_0x24a93d['fields']['and'](_0x3d502c);return parseReadParameter(_0x2f61e4[_0x4158('0x3a')]);})[_0x4158('0x59')](function(_0x206cdd){_0x24a93d['read'][_0x4158('0x44')](_0x206cdd);return parseTagParameter(_0x2f61e4[_0x4158('0x5a')]);})[_0x4158('0x59')](function(_0x3f73fd){_0x24a93d[_0x4158('0x42')][_0x4158('0x43')][_0x4158('0x44')](_0x3f73fd);return parseSearchFilter(_0x47f495,_0x2f61e4[_0x4158('0x5b')]);})['then'](function(_0x424089){_0x24a93d['filter']=_0x424089;return _0x24a93d;});}function checkAccountsRestrictions(_0xd7d754,_0x56fb50,_0x3f9433){var _0x1655cb=utils[_0x4158('0x4')](_0xd7d754);var _0x5c4347='get'+_[_0x4158('0x5c')](_0xd7d754)+(_0xd7d754==='chat'?_0x4158('0x5d'):_0x4158('0x5e'));var _0x1cf6bf=squel[_0x4158('0x1c')]();return Promise[_0x4158('0x58')]()[_0x4158('0x59')](function(){if(_0x3f9433[_0x4158('0x7')]&&_0x56fb50[_0x4158('0x5')]==='agent'){return _0x56fb50[_0x5c4347]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x2d2271){if(_0x2d2271){if(_0x2d2271[_0x4158('0x32')]===0x0){_0x1cf6bf[_0x4158('0x44')]('i.'+_0x1655cb+_0x4158('0x56'));}else{_0x1cf6bf[_0x4158('0x44')]('i.'+_0x1655cb+'\x20IN\x20?',_[_0x4158('0x4c')](_0x2d2271,'id'));}}else if(!_0x3f9433[_0x1655cb]){_0x1cf6bf['and']('i.'+_0x1655cb+_0x4158('0x5f'));}})[_0x4158('0x59')](function(){return _0x1cf6bf;});}function getClosedOrderClause(_0x1f8feb,_0x5c7ff6){var _0x5e8027='';var _0x1d6b1e=['i.thirdDisposition',_0x4158('0x60'),_0x4158('0x61')];if(_0x1f8feb===_0x4158('0x2b')){_0x1d6b1e[_0x4158('0x62')](_0x4158('0x63'));}if(_0x5c7ff6[_0x4158('0x64')]==='0'&&_0x1f8feb===_0x4158('0x2b')){_0x5e8027=_0x4158('0x63');}else{if(_0x5c7ff6['closed']==='1'){_0x1d6b1e[_0x4158('0x65')]();}_0x5e8027=_0x4158('0x66')+_0x1d6b1e[_0x4158('0x67')](',\x20')+')';}return _0x5e8027;}function getFilteredInteractions(_0x5db4bb,_0x33d0e7,_0x5f1db9,_0x3c63bf){var _0x528a76=utils[_0x4158('0x68')](_0x5db4bb);var _0x9c1b1=_['capitalize'](_0x5db4bb)+_0x4158('0x69');var _0x196f73=[];var _0x4a3009=getTagsQuery();var _0x7a768b={'type':db[_0x4158('0x6a')][_0x4158('0x6b')][_0x4158('0x6c')],'raw':!![]};var _0x119dc4=[];var _0x2420a6=[];return db[_0x4158('0x6d')][_0x4158('0x6e')](_0x4a3009['toString'](),_0x7a768b)[_0x4158('0x59')](function(_0x339f02){_0x196f73=_[_0x4158('0x6f')](_0x339f02,'id');_0x7a768b=_[_0x4158('0x70')](_0x7a768b,{'model':db[_0x9c1b1],'mapToModel':!![],'nest':!![]});if(_0x5f1db9[_0x4158('0x71')]){_0x3c63bf[_0x4158('0x72')]['forEach'](function(_0x141fbc){_0x33d0e7[_0x4158('0x9')]('i.'+_0x141fbc);});}else{_0x33d0e7['field'](_0x4158('0x73'),'unreadMessages');_0x33d0e7[_0x4158('0x9')]('a.key',_0x4158('0x74'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x75'),_0x4158('0x76'));if(_0x5db4bb===_0x4158('0x2b')){_0x33d0e7[_0x4158('0x9')]('a.email',_0x4158('0x77'));_0x33d0e7['field'](_0x4158('0x78'),_0x4158('0x79'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x7a'));_0x33d0e7['field']('i.createdAt');_0x33d0e7['field']('i.updatedAt');_0x33d0e7[_0x4158('0x9')](_0x4158('0x7b'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x7c'));_0x33d0e7[_0x4158('0x9')]('i.attach');_0x33d0e7[_0x4158('0x9')]('i.lastMsgAt');_0x33d0e7[_0x4158('0x9')](_0x4158('0x7d'));_0x33d0e7['field'](_0x4158('0x7e'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x61'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x60'));_0x33d0e7[_0x4158('0x9')]('i.thirdDisposition');_0x33d0e7[_0x4158('0x9')](_0x4158('0x63'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x7f'));_0x33d0e7['field'](_0x4158('0x80'));_0x33d0e7[_0x4158('0x9')]('i.MailAccountId');_0x33d0e7[_0x4158('0x9')](_0x4158('0x81'));}else if(_0x5db4bb===_0x4158('0x29')){_0x33d0e7[_0x4158('0x9')](_0x4158('0x82'),_0x4158('0x79'));}else{_0x33d0e7[_0x4158('0x9')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}if(_0x5db4bb!==_0x4158('0x2b')){_0x33d0e7[_0x4158('0x9')](_0x4158('0x83'));}_0x33d0e7['field'](_0x4158('0x84'),_0x4158('0x85'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x86'),_0x4158('0x87'));_0x33d0e7[_0x4158('0x9')]('c.email','Contact.email');_0x33d0e7[_0x4158('0x9')]('c.phone',_0x4158('0x88'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x89'),_0x4158('0x8a'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x8b'),_0x4158('0x8c'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x8d'),_0x4158('0x8e'));_0x33d0e7[_0x4158('0x9')]('o.internal',_0x4158('0x8f'));_0x33d0e7[_0x4158('0x9')](_0x4158('0x90'),_0x4158('0x91'));}if(_0x3c63bf[_0x4158('0x92')]){_0x33d0e7[_0x4158('0x92')](_0x3c63bf['limit']);}if(_0x3c63bf[_0x4158('0x93')]){_0x33d0e7[_0x4158('0x93')](_0x3c63bf[_0x4158('0x93')]);}return db[_0x4158('0x6d')][_0x4158('0x6e')](_0x33d0e7[_0x4158('0x94')](),_0x7a768b);})[_0x4158('0x59')](function(_0x17ceb1){_0x119dc4=_0x17ceb1;var _0x29e526=getUsersQuery(_0x5db4bb,_0x119dc4);return db['sequelize'][_0x4158('0x6e')](_0x29e526[_0x4158('0x94')](),_0x7a768b);})['then'](function(_0x535270){_0x2420a6=_[_0x4158('0x95')](_0x535270,_0x528a76);if(_0x5db4bb==='mail'){return db[_0x4158('0x96')][_0x4158('0x97')]({'attributes':[_0x4158('0x98')],'raw':!![]});}})[_0x4158('0x59')](function(_0x48950d){var _0x6d5ce6=_0x48950d?_0x48950d[_0x4158('0x98')]:undefined;var _0x1d0044=_0x119dc4[_0x4158('0x4c')](function(_0x20e507){return updateInteraction(_0x20e507,_0x196f73,_0x2420a6,_0x6d5ce6);});return Promise[_0x4158('0x99')](_0x1d0044);});}function countFilteredInteractions(_0x43665f,_0xeba20d){var _0x5cbb18=_0x43665f['clone']();_0x5cbb18['field']('COUNT(*)');_0x5cbb18['field'](_0x4158('0x73'),'unreadMessages');var _0x1b44fd=utils['getSelectedTags'](_0xeba20d);if(!_[_0x4158('0x9a')](_0x1b44fd)){_0x5cbb18[_0x4158('0x13')]('t.id\x20IN\x20?',_0x1b44fd);}var _0x2cbd6e={'type':db['Sequelize'][_0x4158('0x6b')][_0x4158('0x6c')],'raw':!![]};return db['sequelize']['query'](_0x5cbb18['toString'](),_0x2cbd6e);}module[_0x4158('0x9b')]={'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 a67d9d3..be7eb5d 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 _0x463e=['abandoned','total','closed','disposition','answered','UserId','MailMessage','findOne','out','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','unmanaged'];(function(_0x363fcf,_0x8c89a5){var _0x5cf75=function(_0xa29b26){while(--_0xa29b26){_0x363fcf['push'](_0x363fcf['shift']());}};_0x5cf75(++_0x8c89a5);}(_0x463e,0x1b6));var _0xe463=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x463e[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xe463('0x0'));var db=require(_0xe463('0x1'))['db'];function getInteractionUsers(_0x4b8142,_0x5242d3){return new Promise(function(_0x35bb7b,_0xd9aafb){try{var _0x438c96=[];if(_0x5242d3[_0x4b8142]){_0x438c96=_0x5242d3[_0x4b8142][_0xe463('0x2')](function(_0x4c1f3a){return{'id':_0x4c1f3a['id'],'fullname':_0x4c1f3a[_0xe463('0x3')]};});}return _0x35bb7b(_0x438c96);}catch(_0x38f4ac){_0xd9aafb(_0x38f4ac);}});}function getInteractionTags(_0x49b8f6,_0x5003dc){var _0x46ef35=[];if(_0x49b8f6){_0x49b8f6[_0xe463('0x4')](',')[_0xe463('0x5')](function(_0x327f8a){_0x46ef35[_0xe463('0x6')](_0x5003dc[_0x327f8a]);});}return _0x46ef35;}function updateWaitingCounter(_0x46d794){if(_0x46d794['waiting']){_0x46d794[_0xe463('0x7')]-=0x1;}}function updateInteractionCounters(_0x22debd){_0x22debd[_0xe463('0x7')]=0x0;_0x22debd[_0xe463('0x8')]=0x0;_0x22debd['answered']=0x0;_0x22debd[_0xe463('0x9')]=0x0;_0x22debd[_0xe463('0xa')]=0x0;_0x22debd[_0xe463('0xb')]=0x0;if(_0x22debd[_0xe463('0xc')]){if(_0x22debd[_0xe463('0xd')]==='abandoned'){_0x22debd[_0xe463('0xa')]+=0x1;updateWaitingCounter(_0x22debd);}if(_0x22debd['UserId']){_0x22debd[_0xe463('0xe')]+=0x1;if(_0x22debd[_0xe463('0x8')]){_0x22debd[_0xe463('0x8')]-=0x1;}}else{if(_0x22debd[_0xe463('0xd')]){_0x22debd[_0xe463('0x9')]+=0x1;updateWaitingCounter(_0x22debd);}}}else{if(!_0x22debd[_0xe463('0xf')]){_0x22debd['waiting']+=0x1;}if(_0x22debd['UserId']){_0x22debd[_0xe463('0x8')]+=0x1;updateWaitingCounter(_0x22debd);}}_0x22debd[_0xe463('0xb')]+=0x1;return _0x22debd;}function getLastMessageText(_0x23d63c){return db[_0xe463('0x10')][_0xe463('0x11')]({'where':{'$and':[{'MailInteractionId':_0x23d63c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe463('0x12')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe463('0x13')],'order':'-id','raw':!![]})[_0xe463('0x14')](function(_0x36ee28){if(_0x36ee28&&_0x36ee28['plainBody']){_0x23d63c[_0xe463('0x15')]=_[_0xe463('0x16')](_0x36ee28[_0xe463('0x13')]);}return _0x23d63c;})[_0xe463('0x17')](function(_0x1622ce){throw _0x1622ce;});}exports[_0xe463('0x18')]=function(_0x26c6eb,_0x58c915,_0x248b58,_0x586f99){return new Promise(function(_0x477b1b,_0x41eaa9){return getInteractionUsers(_0x26c6eb['id'],_0x248b58)[_0xe463('0x14')](function(_0x34b6aa){_0x26c6eb[_0xe463('0x19')]=_0x34b6aa;return getInteractionTags(_0x26c6eb[_0xe463('0x1a')],_0x58c915);})[_0xe463('0x14')](function(_0x185d3f){_0x26c6eb[_0xe463('0x1b')]=_0x185d3f;delete _0x26c6eb[_0xe463('0x1a')];return updateInteractionCounters(_0x26c6eb);})[_0xe463('0x14')](function(_0x516dda){if(_0x586f99){return getLastMessageText(_0x516dda);}else{return _0x516dda;}})['then'](function(_0x237a27){_0x477b1b(_0x237a27);})[_0xe463('0x17')](function(_0x3375ee){_0x41eaa9(_0x3375ee);});});}; \ No newline at end of file +var _0x0934=['answered','total','closed','disposition','abandoned','unmanaged','UserId','MailMessage','findOne','out','-id','then','lastMsgText','trimStart','plainBody','updateInteraction','Users','TagIds','lodash','map','forEach','push','waiting','talking'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0934,0x8a));var _0x4093=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x0934[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x4093('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x2ee070,_0x306335){return new Promise(function(_0x4d9b31,_0x3a9b21){try{var _0x13aec7=[];if(_0x306335[_0x2ee070]){_0x13aec7=_0x306335[_0x2ee070][_0x4093('0x1')](function(_0x5a42b7){return{'id':_0x5a42b7['id'],'fullname':_0x5a42b7['fullname']};});}return _0x4d9b31(_0x13aec7);}catch(_0x1a7ab3){_0x3a9b21(_0x1a7ab3);}});}function getInteractionTags(_0x41e786,_0xa7c158){var _0x4265a5=[];if(_0x41e786){_0x41e786['split'](',')[_0x4093('0x2')](function(_0x5d29be){_0x4265a5[_0x4093('0x3')](_0xa7c158[_0x5d29be]);});}return _0x4265a5;}function updateWaitingCounter(_0x41d9d1){if(_0x41d9d1['waiting']){_0x41d9d1['waiting']-=0x1;}}function updateInteractionCounters(_0x4ec8c1){_0x4ec8c1[_0x4093('0x4')]=0x0;_0x4ec8c1[_0x4093('0x5')]=0x0;_0x4ec8c1[_0x4093('0x6')]=0x0;_0x4ec8c1['unmanaged']=0x0;_0x4ec8c1['abandoned']=0x0;_0x4ec8c1[_0x4093('0x7')]=0x0;if(_0x4ec8c1[_0x4093('0x8')]){if(_0x4ec8c1[_0x4093('0x9')]===_0x4093('0xa')){_0x4ec8c1[_0x4093('0xa')]+=0x1;updateWaitingCounter(_0x4ec8c1);}if(_0x4ec8c1['UserId']){_0x4ec8c1[_0x4093('0x6')]+=0x1;if(_0x4ec8c1[_0x4093('0x5')]){_0x4ec8c1['talking']-=0x1;}}else{if(_0x4ec8c1[_0x4093('0x9')]){_0x4ec8c1[_0x4093('0xb')]+=0x1;updateWaitingCounter(_0x4ec8c1);}}}else{if(!_0x4ec8c1[_0x4093('0xc')]){_0x4ec8c1[_0x4093('0x4')]+=0x1;}if(_0x4ec8c1[_0x4093('0xc')]){_0x4ec8c1[_0x4093('0x5')]+=0x1;updateWaitingCounter(_0x4ec8c1);}}_0x4ec8c1[_0x4093('0x7')]+=0x1;return _0x4ec8c1;}function getLastMessageText(_0x2bb7d6){return db[_0x4093('0xd')][_0x4093('0xe')]({'where':{'$and':[{'MailInteractionId':_0x2bb7d6['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4093('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x4093('0x10'),'raw':!![]})[_0x4093('0x11')](function(_0x278d89){if(_0x278d89&&_0x278d89['plainBody']){_0x2bb7d6[_0x4093('0x12')]=_[_0x4093('0x13')](_0x278d89[_0x4093('0x14')]);}return _0x2bb7d6;})['catch'](function(_0xf4b39f){throw _0xf4b39f;});}exports[_0x4093('0x15')]=function(_0x53c414,_0x1926b5,_0x2fbf41,_0x2f65b1){return new Promise(function(_0x11db65,_0x24bc8b){return getInteractionUsers(_0x53c414['id'],_0x2fbf41)['then'](function(_0x2022bc){_0x53c414[_0x4093('0x16')]=_0x2022bc;return getInteractionTags(_0x53c414[_0x4093('0x17')],_0x1926b5);})['then'](function(_0x174586){_0x53c414['Tags']=_0x174586;delete _0x53c414[_0x4093('0x17')];return updateInteractionCounters(_0x53c414);})[_0x4093('0x11')](function(_0x58dd9c){if(_0x2f65b1){return getLastMessageText(_0x58dd9c);}else{return _0x58dd9c;}})[_0x4093('0x11')](function(_0x17fdec){_0x11db65(_0x17fdec);})['catch'](function(_0x48c4cb){_0x24bc8b(_0x48c4cb);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 4b15f5b..0023ea3 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 _0xa2f1=['user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','exports','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','chat','InteractionId','upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages'];(function(_0x1e2c98,_0x515861){var _0x2b866a=function(_0xabc193){while(--_0xabc193){_0x1e2c98['push'](_0x1e2c98['shift']());}};_0x2b866a(++_0x515861);}(_0xa2f1,0x1d0));var _0x1a2f=function(_0x54e74d,_0x420af5){_0x54e74d=_0x54e74d-0x0;var _0x24e035=_0xa2f1[_0x54e74d];return _0x24e035;};'use strict';var _=require(_0x1a2f('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x1a2f('0x1'))(_0x1a2f('0x2')),'mail':require(_0x1a2f('0x1'))(_0x1a2f('0x3')),'fax':require(_0x1a2f('0x1'))(_0x1a2f('0x4')),'sms':require(_0x1a2f('0x1'))(_0x1a2f('0x5')),'chat':require(_0x1a2f('0x1'))(_0x1a2f('0x6')),'whatsapp':require(_0x1a2f('0x1'))('whatsapp-interactions')};function getAccountFK(_0x63f2bd){return _[_0x1a2f('0x7')](_0x63f2bd)+(_0x63f2bd===_0x1a2f('0x8')?'Website':'Account')+'Id';}function getInteractionFK(_0x37595d){return _[_0x1a2f('0x7')](_0x37595d)+_0x1a2f('0x9');}function getInteractionId(_0x4b73c4,_0x27fb9e,_0x11daf9){if(_0x4b73c4&&_0x4b73c4[_[_0x1a2f('0xa')](_0x11daf9)+_0x1a2f('0x9')]){return _0x4b73c4[_[_0x1a2f('0xa')](_0x11daf9)+_0x1a2f('0x9')];}else if(_0x4b73c4&&_0x4b73c4['id']){return _0x4b73c4['id'];}else if(_0x27fb9e&&_0x27fb9e['id']){return _0x27fb9e['id'];}else{return _0x1a2f('0xb');}}function getInteractionsTables(_0x30eb17){return{'accounts':_0x30eb17+'_'+(_0x30eb17==='chat'?_0x1a2f('0xc'):_0x1a2f('0xd')),'interactions':_0x30eb17+'_interactions','interactionsTags':_0x30eb17+_0x1a2f('0xe'),'messages':_0x30eb17+_0x1a2f('0xf'),'userInteractions':_0x1a2f('0x10')+_0x30eb17+_0x1a2f('0x11')};}function getSelectedTags(_0x4afd4c){var _0x461edf=[];if(_0x4afd4c){_0x461edf=Array[_0x1a2f('0x12')](_0x4afd4c)?_0x4afd4c:[_0x4afd4c];}return _0x461edf;}function log(_0x227648,_0x3a81de,_0x550f0b,_0x426d3f,_0x24e864,_0x362c02){loggers[_0x24e864[_0x1a2f('0x13')]()][_0x227648](_0x1a2f('0x14'),_0x362c02[_0x1a2f('0x15')](),_0x3a81de?_0x3a81de['id']:null,_0x3a81de?_0x3a81de[_0x1a2f('0x16')]:null,_0x3a81de?_0x3a81de[_0x1a2f('0x17')]:null,getInteractionId(_0x550f0b,_0x426d3f,_0x24e864),_0x550f0b?JSON[_0x1a2f('0x18')](_0x550f0b):'null');}function updateUser(_0x5336e8,_0x1d2df5,_0x1dd360,_0x5da674,_0x250069){db[_[_0x1a2f('0xa')](_0x5da674)+_0x1a2f('0x19')][_0x1a2f('0x1a')]({'where':{'id':getInteractionId(_0x1d2df5,_0x1dd360,_0x5da674)}})[_0x1a2f('0x1b')](function(_0x5c18d8){if(_0x5c18d8){return _0x5c18d8[_0x1a2f('0x1c')]({'UserId':_0x5336e8?_0x5336e8['id']:null});}})[_0x1a2f('0x1b')](function(_0x1c7d0f){if(_0x1c7d0f){log(_0x1a2f('0x1d'),_0x5336e8,_0x1d2df5,_0x1dd360,_0x5da674,_0x250069);}})[_0x1a2f('0x1e')](function(){log('error',_0x5336e8,_0x1d2df5,_0x1dd360,_0x5da674,_0x250069);});}module[_0x1a2f('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x40cc=['catch','error','lodash','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','whatsapp-interactions','Website','Account','InteractionId','upperFirst','unknown','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','toUpperCase','name','stringify','findOne','then','info'];(function(_0xef475,_0x75141f){var _0x1cb05e=function(_0x1f20e9){while(--_0x1f20e9){_0xef475['push'](_0xef475['shift']());}};_0x1cb05e(++_0x75141f);}(_0x40cc,0x192));var _0xc40c=function(_0x311aad,_0x54d658){_0x311aad=_0x311aad-0x0;var _0x1779bd=_0x40cc[_0x311aad];return _0x1779bd;};'use strict';var _=require(_0xc40c('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xc40c('0x1'))(_0xc40c('0x2')),'mail':require('../../config/logger')(_0xc40c('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xc40c('0x1'))(_0xc40c('0x4')),'chat':require(_0xc40c('0x1'))('chat-interactions'),'whatsapp':require(_0xc40c('0x1'))(_0xc40c('0x5'))};function getAccountFK(_0x12f490){return _['capitalize'](_0x12f490)+(_0x12f490==='chat'?_0xc40c('0x6'):_0xc40c('0x7'))+'Id';}function getInteractionFK(_0xdf96fb){return _['capitalize'](_0xdf96fb)+_0xc40c('0x8');}function getInteractionId(_0x2f8057,_0x1ae280,_0x24abf4){if(_0x2f8057&&_0x2f8057[_['upperFirst'](_0x24abf4)+'InteractionId']){return _0x2f8057[_[_0xc40c('0x9')](_0x24abf4)+_0xc40c('0x8')];}else if(_0x2f8057&&_0x2f8057['id']){return _0x2f8057['id'];}else if(_0x1ae280&&_0x1ae280['id']){return _0x1ae280['id'];}else{return _0xc40c('0xa');}}function getInteractionsTables(_0x37a9b2){return{'accounts':_0x37a9b2+'_'+(_0x37a9b2==='chat'?'websites':'accounts'),'interactions':_0x37a9b2+_0xc40c('0xb'),'interactionsTags':_0x37a9b2+_0xc40c('0xc'),'messages':_0x37a9b2+_0xc40c('0xd'),'userInteractions':_0xc40c('0xe')+_0x37a9b2+_0xc40c('0xb')};}function getSelectedTags(_0x4164c9){var _0x176da3=[];if(_0x4164c9){_0x176da3=Array[_0xc40c('0xf')](_0x4164c9)?_0x4164c9:[_0x4164c9];}return _0x176da3;}function log(_0x5884ae,_0x21a86f,_0x418930,_0x248a8e,_0x1c298b,_0x1fc6ba){loggers[_0x1c298b[_0xc40c('0x10')]()][_0x5884ae]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1fc6ba[_0xc40c('0x11')](),_0x21a86f?_0x21a86f['id']:null,_0x21a86f?_0x21a86f[_0xc40c('0x12')]:null,_0x21a86f?_0x21a86f['role']:null,getInteractionId(_0x418930,_0x248a8e,_0x1c298b),_0x418930?JSON[_0xc40c('0x13')](_0x418930):'null');}function updateUser(_0xedecdb,_0x5381f7,_0x131d0f,_0x305eda,_0x2b71fc){db[_[_0xc40c('0x9')](_0x305eda)+'Interaction'][_0xc40c('0x14')]({'where':{'id':getInteractionId(_0x5381f7,_0x131d0f,_0x305eda)}})['then'](function(_0x348cd9){if(_0x348cd9){return _0x348cd9['update']({'UserId':_0xedecdb?_0xedecdb['id']:null});}})[_0xc40c('0x15')](function(_0x5c7d9c){if(_0x5c7d9c){log(_0xc40c('0x16'),_0xedecdb,_0x5381f7,_0x131d0f,_0x305eda,_0x2b71fc);}})[_0xc40c('0x17')](function(){log(_0xc40c('0x18'),_0xedecdb,_0x5381f7,_0x131d0f,_0x305eda,_0x2b71fc);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index f936c5c..c0767b3 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 _0x1c68=['%s:%s:%s','update','base64','parse','hasOwnProperty','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format'];(function(_0x3a840c,_0x71c4c0){var _0x59ecdc=function(_0x537b84){while(--_0x537b84){_0x3a840c['push'](_0x3a840c['shift']());}};_0x59ecdc(++_0x71c4c0);}(_0x1c68,0x9e));var _0x81c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c68[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x81c6('0x0'));var util=require(_0x81c6('0x1'));var compose=require(_0x81c6('0x2'));var db=require(_0x81c6('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4009e3,_0x438ac9){if(_0x4009e3&&_0x438ac9){if(_0x438ac9['data1']&&_0x438ac9['license']){var _0x44f468=_0x438ac9[_0x81c6('0x4')];var _0x177eac=_0x438ac9[_0x81c6('0x5')];var _0x1551b1=_0x44f468[_0x81c6('0x6')]('-')[0x4];var _0x80a660=_0x44f468[_0x81c6('0x6')]('-')[0x0];var _0x402f13=crypto[_0x81c6('0x7')](_0x81c6('0x8'),util[_0x81c6('0x9')](_0x81c6('0xa'),_0x1551b1,_0x44f468,_0x80a660));var _0x3177d3=_0x402f13[_0x81c6('0xb')](_0x177eac,_0x81c6('0xc'),'utf8');_0x3177d3+=_0x402f13['final']('utf8');var _0x20a615=JSON[_0x81c6('0xd')](_0x3177d3);return _0x20a615[_0x81c6('0xe')](_0x4009e3)?_0x20a615[_0x4009e3]:null;}}return null;}function isLimit(_0xf9f622,_0x4aed87,_0x44302f,_0x5ee76d){var _0x498da7=_0x4aed87;return compose()['use'](function(_0x337ca8,_0x19c5b7,_0x5a3034){return db['License'][_0x81c6('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x81c6('0x10')](function(_0x584f18){var _0xed901e=getValueFromLicense(_0xf9f622,_0x584f18);return _0xed901e?_0xed901e:_0x498da7;})[_0x81c6('0x10')](function(_0xf3a3db){_0x498da7=_0xf3a3db;return _0x44302f[_0x81c6('0x11')](_0x5ee76d);})[_0x81c6('0x10')](function(_0x565d9a){if(_0x565d9a>=_0x498da7){return _0x19c5b7[_0x81c6('0x12')](0x193)[_0x81c6('0x13')]({'message':util[_0x81c6('0x9')](_0x81c6('0x14'),_0xf9f622)});}_0x5a3034();})['catch'](function(_0x16cbf7){_0x5a3034(_0x16cbf7);});});}function isUserLimit(){return isLimit(_0x81c6('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x81c6('0x16')}]}});}exports[_0x81c6('0x17')]=isUserLimit; \ No newline at end of file +var _0x14ec=['json','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x14ec,0x18d));var _0xc14e=function(_0x135696,_0x1418a7){_0x135696=_0x135696-0x0;var _0x5c80a7=_0x14ec[_0x135696];return _0x5c80a7;};'use strict';var crypto=require(_0xc14e('0x0'));var util=require(_0xc14e('0x1'));var compose=require(_0xc14e('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xc14e('0x3'));function getValueFromLicense(_0x46f1bd,_0x319d41){if(_0x46f1bd&&_0x319d41){if(_0x319d41[_0xc14e('0x4')]&&_0x319d41[_0xc14e('0x5')]){var _0x48f129=_0x319d41[_0xc14e('0x4')];var _0x29ef71=_0x319d41['license'];var _0x369d80=_0x48f129[_0xc14e('0x6')]('-')[0x4];var _0x3392d1=_0x48f129[_0xc14e('0x6')]('-')[0x0];var _0x215746=crypto[_0xc14e('0x7')](_0xc14e('0x8'),util[_0xc14e('0x9')](_0xc14e('0xa'),_0x369d80,_0x48f129,_0x3392d1));var _0x1ae2b4=_0x215746[_0xc14e('0xb')](_0x29ef71,_0xc14e('0xc'),_0xc14e('0xd'));_0x1ae2b4+=_0x215746[_0xc14e('0xe')]('utf8');var _0x2de756=JSON[_0xc14e('0xf')](_0x1ae2b4);return _0x2de756[_0xc14e('0x10')](_0x46f1bd)?_0x2de756[_0x46f1bd]:null;}}return null;}function isLimit(_0x7c4768,_0x590eca,_0x4624f6,_0x3caa8d){var _0x403911=_0x590eca;return compose()[_0xc14e('0x11')](function(_0x45d898,_0x4471c6,_0x324aad){return db[_0xc14e('0x12')][_0xc14e('0x13')]({'where':{'id':0x1},'raw':!![]})[_0xc14e('0x14')](function(_0x485d05){var _0x49a008=getValueFromLicense(_0x7c4768,_0x485d05);return _0x49a008?_0x49a008:_0x403911;})['then'](function(_0x48e1cf){_0x403911=_0x48e1cf;return _0x4624f6[_0xc14e('0x15')](_0x3caa8d);})[_0xc14e('0x14')](function(_0x2aae1b){if(_0x2aae1b>=_0x403911){return _0x4471c6[_0xc14e('0x16')](0x193)[_0xc14e('0x17')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x7c4768)});}_0x324aad();})[_0xc14e('0x18')](function(_0x1ae0b4){_0x324aad(_0x1ae0b4);});});}function isUserLimit(){return isLimit(_0xc14e('0x19'),0x1,db[_0xc14e('0x1a')],{'where':{'$or':[{'role':_0xc14e('0x1b')},{'role':_0xc14e('0x1c')}]}});}exports[_0xc14e('0x1d')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 77f75b3..37148db 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 _0xd57f=['<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','$lte','<=\x20?','>=\x20?','$between','start','$startsWith','utcOffset','format','add','hours','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','DATE','$eq','operator','value','$gt','days','YYYY-MM-DD','castTo','field','text','includes','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?'];(function(_0x156371,_0xe7ddb7){var _0x12c7dc=function(_0x1ab17b){while(--_0x1ab17b){_0x156371['push'](_0x156371['shift']());}};_0x12c7dc(++_0xe7ddb7);}(_0xd57f,0x10e));var _0xfd57=function(_0x5668f0,_0x281b14){_0x5668f0=_0x5668f0-0x0;var _0x1c86ad=_0xd57f[_0x5668f0];return _0x1c86ad;};'use strict';var _=require(_0xfd57('0x0'));var moment=require(_0xfd57('0x1'));exports[_0xfd57('0x2')]=function(_0x1d1388){var _0xb85ede={'conditions':[]};_0xb85ede[_0xfd57('0x3')]=_['startsWith'](_0x1d1388,_0xfd57('0x4'))?'or':_0xfd57('0x5');var _0x4323c5=_0x1d1388[_0xfd57('0x6')](_0xfd57('0x7'),'')[_0xfd57('0x6')](_0xfd57('0x4'),'')['split']('||');for(var _0x28f833=0x0;_0x28f833<_0x4323c5['length'];_0x28f833++){var _0xf7299d=_0x4323c5[_0x28f833][_0xfd57('0x8')](':=');var _0x590e7e=_0xf7299d[0x0];var _0x4e4af1=_0xf7299d[_0xfd57('0x9')](0x1);_0x4e4af1[_0xfd57('0xa')](function(_0x822d5){var _0x369452=_0x822d5[_0xfd57('0x8')]('[')[_0xfd57('0xb')]();var _0x25ca73=_0x822d5[_0xfd57('0xc')](/\[(.*?)\]/g);_0x25ca73['forEach'](function(_0x6e38f1){var _0x1ad3f6=_0x6e38f1[_0xfd57('0x8')]('[')[_0xfd57('0xd')](function(_0x2496b8){return _0x2496b8[_0xfd57('0xe')](']')>-0x1;})[_0xfd57('0xf')](function(_0x316091){return _0x316091[_0xfd57('0x8')](']')[0x0];})[0x0];_0xb85ede['conditions'][_0xfd57('0x10')]({'field':_0x590e7e,'operator':_0x369452,'value':_0x1ad3f6});});});}return _0xb85ede;};exports[_0xfd57('0x11')]=function(_0x2728f0,_0x276dd9,_0x312e19){var _0x10cc7b={};if(_0x276dd9===_0xfd57('0x12')){if(_0x312e19['operator']===_0xfd57('0x13')){_0x312e19[_0xfd57('0x14')]='$between';_0x312e19[_0xfd57('0x15')]+=','+_0x312e19[_0xfd57('0x15')];}else if(_['includes']([_0xfd57('0x16'),'$lte'],_0x312e19['operator'])){_0x312e19[_0xfd57('0x15')]=moment(_0x312e19[_0xfd57('0x15')])['add'](0x1,_0xfd57('0x17'))['format'](_0xfd57('0x18'));}}if(_0x312e19[_0xfd57('0x19')]){_0x276dd9=_0x312e19[_0xfd57('0x19')];_0x10cc7b['text']='CAST('+_0x2728f0+'.'+_0x312e19[_0xfd57('0x1a')]+'\x20AS\x20'+_0x312e19['castTo']+')\x20'+parseOperator(_0x312e19[_0xfd57('0x14')]);}else{_0x10cc7b[_0xfd57('0x1b')]=_0x2728f0+'.'+_0x312e19[_0xfd57('0x1a')]+'\x20'+parseOperator(_0x312e19['operator']);}if(_[_0xfd57('0x1c')]([_0xfd57('0x1d'),_0xfd57('0x1e')],_0x312e19[_0xfd57('0x14')]))_0x10cc7b[_0xfd57('0x1b')]='('+_0x10cc7b[_0xfd57('0x1b')]+'\x20OR\x20'+_0x2728f0+'.'+_0x312e19['field']+_0xfd57('0x1f');_0x10cc7b[_0xfd57('0x15')]=parseValue(_0x276dd9,_0x312e19['operator'],_0x312e19[_0xfd57('0x15')]);return _0x10cc7b;};function parseOperator(_0x241d94){var _0x2ebb64;switch(_0x241d94){case _0xfd57('0x20'):_0x2ebb64=_0xfd57('0x21');break;case _0xfd57('0x1e'):_0x2ebb64=_0xfd57('0x22');break;case _0xfd57('0x13'):_0x2ebb64=_0xfd57('0x23');break;case'$ne':_0x2ebb64=_0xfd57('0x24');break;case _0xfd57('0x25'):case'$startsWith':case _0xfd57('0x26'):_0x2ebb64=_0xfd57('0x27');break;case'$lt':_0x2ebb64=_0xfd57('0x28');break;case _0xfd57('0x16'):_0x2ebb64='>\x20?';break;case _0xfd57('0x29'):_0x2ebb64=_0xfd57('0x2a');break;case'$gte':_0x2ebb64=_0xfd57('0x2b');break;case _0xfd57('0x2c'):_0x2ebb64='BETWEEN\x20?\x20AND\x20?';break;}return _0x2ebb64;}function parseValue(_0x285508,_0x5f25fd,_0x377279){var _0x92f0d8={'start':undefined,'end':undefined};switch(_0x5f25fd){case _0xfd57('0x20'):case _0xfd57('0x1e'):_0x92f0d8[_0xfd57('0x2d')]=_0x377279[_0xfd57('0x8')](',');break;case _0xfd57('0x25'):_0x92f0d8[_0xfd57('0x2d')]='%'+_0x377279+'%';break;case _0xfd57('0x2e'):_0x92f0d8[_0xfd57('0x2d')]=_0x377279+'%';break;case _0xfd57('0x26'):_0x92f0d8[_0xfd57('0x2d')]='%'+_0x377279;break;case _0xfd57('0x2c'):var _0xed681e=_0x377279[_0xfd57('0x8')](',');var _0x377279=_0xed681e[_0xfd57('0xb')]();var _0xbe7c47=_0xed681e['pop']();if(_0x285508==='DATE'){_0x377279=moment(_0x377279)[_0xfd57('0x2f')](0x0,!![])[_0xfd57('0x30')]();_0xbe7c47=moment(_0xbe7c47)[_0xfd57('0x2f')](0x0,!![])[_0xfd57('0x31')](0x17,_0xfd57('0x32'))[_0xfd57('0x31')](0x3b,'minutes')[_0xfd57('0x31')](0x3b,'seconds')[_0xfd57('0x30')]();}_0x92f0d8={'start':_0x377279,'end':_0xbe7c47};break;default:_0x92f0d8[_0xfd57('0x2d')]=_0x377279;break;}return _0x92f0d8;} \ No newline at end of file +var _0xbebb=['indexOf','map','conditions','DATE','operator','$eq','$between','value','includes','$gt','days','format','YYYY-MM-DD','castTo','text','\x20AS\x20','$ne','$notIn','\x20OR\x20','field','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','start','$endsWith','shift','pop','utcOffset','add','minutes','seconds','lodash','parseSearch','sqlOperator','[$or]','and','replace','split','length','slice','forEach','match','filter'];(function(_0x2d3ca7,_0x2e5017){var _0x39367b=function(_0x22a903){while(--_0x22a903){_0x2d3ca7['push'](_0x2d3ca7['shift']());}};_0x39367b(++_0x2e5017);}(_0xbebb,0xd0));var _0xbbeb=function(_0x394ea8,_0x202f38){_0x394ea8=_0x394ea8-0x0;var _0x1304bc=_0xbebb[_0x394ea8];return _0x1304bc;};'use strict';var _=require(_0xbbeb('0x0'));var moment=require('moment');exports[_0xbbeb('0x1')]=function(_0x195d09){var _0x2f5701={'conditions':[]};_0x2f5701[_0xbbeb('0x2')]=_['startsWith'](_0x195d09,_0xbbeb('0x3'))?'or':_0xbbeb('0x4');var _0x4a5433=_0x195d09[_0xbbeb('0x5')]('[$and]','')[_0xbbeb('0x5')](_0xbbeb('0x3'),'')[_0xbbeb('0x6')]('||');for(var _0x5d7b78=0x0;_0x5d7b78<_0x4a5433[_0xbbeb('0x7')];_0x5d7b78++){var _0xfae61c=_0x4a5433[_0x5d7b78][_0xbbeb('0x6')](':=');var _0x8c453c=_0xfae61c[0x0];var _0x4a5f8a=_0xfae61c[_0xbbeb('0x8')](0x1);_0x4a5f8a[_0xbbeb('0x9')](function(_0x4a4a8f){var _0x330ac6=_0x4a4a8f['split']('[')['shift']();var _0x593b65=_0x4a4a8f[_0xbbeb('0xa')](/\[(.*?)\]/g);_0x593b65[_0xbbeb('0x9')](function(_0x1dbaa3){var _0xbff6d1=_0x1dbaa3[_0xbbeb('0x6')]('[')[_0xbbeb('0xb')](function(_0x5176d8){return _0x5176d8[_0xbbeb('0xc')](']')>-0x1;})[_0xbbeb('0xd')](function(_0x36e5fc){return _0x36e5fc[_0xbbeb('0x6')](']')[0x0];})[0x0];_0x2f5701[_0xbbeb('0xe')]['push']({'field':_0x8c453c,'operator':_0x330ac6,'value':_0xbff6d1});});});}return _0x2f5701;};exports['buildExpression']=function(_0x14b6a2,_0x157753,_0x4d53e7){var _0x4405b5={};if(_0x157753===_0xbbeb('0xf')){if(_0x4d53e7[_0xbbeb('0x10')]===_0xbbeb('0x11')){_0x4d53e7[_0xbbeb('0x10')]=_0xbbeb('0x12');_0x4d53e7[_0xbbeb('0x13')]+=','+_0x4d53e7[_0xbbeb('0x13')];}else if(_[_0xbbeb('0x14')]([_0xbbeb('0x15'),'$lte'],_0x4d53e7[_0xbbeb('0x10')])){_0x4d53e7[_0xbbeb('0x13')]=moment(_0x4d53e7['value'])['add'](0x1,_0xbbeb('0x16'))[_0xbbeb('0x17')](_0xbbeb('0x18'));}}if(_0x4d53e7[_0xbbeb('0x19')]){_0x157753=_0x4d53e7[_0xbbeb('0x19')];_0x4405b5[_0xbbeb('0x1a')]='CAST('+_0x14b6a2+'.'+_0x4d53e7['field']+_0xbbeb('0x1b')+_0x4d53e7[_0xbbeb('0x19')]+')\x20'+parseOperator(_0x4d53e7[_0xbbeb('0x10')]);}else{_0x4405b5[_0xbbeb('0x1a')]=_0x14b6a2+'.'+_0x4d53e7['field']+'\x20'+parseOperator(_0x4d53e7[_0xbbeb('0x10')]);}if(_[_0xbbeb('0x14')]([_0xbbeb('0x1c'),_0xbbeb('0x1d')],_0x4d53e7[_0xbbeb('0x10')]))_0x4405b5[_0xbbeb('0x1a')]='('+_0x4405b5['text']+_0xbbeb('0x1e')+_0x14b6a2+'.'+_0x4d53e7[_0xbbeb('0x1f')]+_0xbbeb('0x20');_0x4405b5[_0xbbeb('0x13')]=parseValue(_0x157753,_0x4d53e7[_0xbbeb('0x10')],_0x4d53e7[_0xbbeb('0x13')]);return _0x4405b5;};function parseOperator(_0xf753bf){var _0x4c9615;switch(_0xf753bf){case _0xbbeb('0x21'):_0x4c9615=_0xbbeb('0x22');break;case'$notIn':_0x4c9615='NOT\x20IN\x20?';break;case'$eq':_0x4c9615=_0xbbeb('0x23');break;case _0xbbeb('0x1c'):_0x4c9615=_0xbbeb('0x24');break;case _0xbbeb('0x25'):case _0xbbeb('0x26'):case'$endsWith':_0x4c9615=_0xbbeb('0x27');break;case _0xbbeb('0x28'):_0x4c9615=_0xbbeb('0x29');break;case _0xbbeb('0x15'):_0x4c9615=_0xbbeb('0x2a');break;case _0xbbeb('0x2b'):_0x4c9615=_0xbbeb('0x2c');break;case _0xbbeb('0x2d'):_0x4c9615=_0xbbeb('0x2e');break;case'$between':_0x4c9615='BETWEEN\x20?\x20AND\x20?';break;}return _0x4c9615;}function parseValue(_0x37784,_0x1175df,_0x3c3fab){var _0xc91cf7={'start':undefined,'end':undefined};switch(_0x1175df){case _0xbbeb('0x21'):case _0xbbeb('0x1d'):_0xc91cf7[_0xbbeb('0x2f')]=_0x3c3fab[_0xbbeb('0x6')](',');break;case _0xbbeb('0x25'):_0xc91cf7[_0xbbeb('0x2f')]='%'+_0x3c3fab+'%';break;case _0xbbeb('0x26'):_0xc91cf7[_0xbbeb('0x2f')]=_0x3c3fab+'%';break;case _0xbbeb('0x30'):_0xc91cf7['start']='%'+_0x3c3fab;break;case _0xbbeb('0x12'):var _0x16de60=_0x3c3fab[_0xbbeb('0x6')](',');var _0x3c3fab=_0x16de60[_0xbbeb('0x31')]();var _0x73dde0=_0x16de60[_0xbbeb('0x32')]();if(_0x37784===_0xbbeb('0xf')){_0x3c3fab=moment(_0x3c3fab)[_0xbbeb('0x33')](0x0,!![])[_0xbbeb('0x17')]();_0x73dde0=moment(_0x73dde0)[_0xbbeb('0x33')](0x0,!![])[_0xbbeb('0x34')](0x17,'hours')[_0xbbeb('0x34')](0x3b,_0xbbeb('0x35'))[_0xbbeb('0x34')](0x3b,_0xbbeb('0x36'))[_0xbbeb('0x17')]();}_0xc91cf7={'start':_0x3c3fab,'end':_0x73dde0};break;default:_0xc91cf7[_0xbbeb('0x2f')]=_0x3c3fab;break;}return _0xc91cf7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 5bd201e..a8378c1 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 _0x6018=['columns','value','VIRTUAL','col','sequelize','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','cast','unsigned','substr','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','\x22{EXPR}\x22','forEach','replace','push','{EXPR}','join','getOptions','query','$id','model','attributes','nolimit','limit','order','where','pick','filter'];(function(_0xd1dff5,_0x5f0269){var _0x280abf=function(_0x9b0f7e){while(--_0x9b0f7e){_0xd1dff5['push'](_0xd1dff5['shift']());}};_0x280abf(++_0x5f0269);}(_0x6018,0xf8));var _0x8601=function(_0x574573,_0x147478){_0x574573=_0x574573-0x0;var _0x17fa77=_0x6018[_0x574573];return _0x17fa77;};'use strict';var _=require('lodash');var sequelize=require(_0x8601('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x49830b){var _0x3b5910=['ne'];try{var _0x243619=JSON['parse'](_0x49830b);var _0x3270c3=Object[_0x8601('0x1')](_0x243619)[0x0];return _0x3b5910[_0x8601('0x2')](_0x3270c3);}catch(_0x438eb3){return![];}}function getOperatorValue(_0x3261ea){var _0x43dda1=JSON[_0x8601('0x3')](_0x3261ea);var _0x3c990c=Object[_0x8601('0x1')](_0x43dda1)[0x0];var _0x2e3bfc=_0x43dda1[_0x3c990c];return{['$'+_0x3c990c]:_0x2e3bfc};}exports[_0x8601('0x4')]=function(_0x30ead9){var _0x3048c2=null;if(_0x30ead9){_0x3048c2=_0x30ead9[_0x8601('0x5')](',');}return _0x3048c2;};exports[_0x8601('0x6')]=function(_0x53461c,_0x55526e){var _0xa9152a={};if(!_[_0x8601('0x7')](_0x53461c)){_[_0x8601('0x8')](_0x53461c,function(_0x3fae0b,_0x31a5c1){try{if(_0x55526e){var _0x4333ec=_[_0x8601('0x9')](_0x55526e,{'name':_0x31a5c1})||{};if(hasSequelizeOperator(_0x3fae0b)){_0xa9152a[_0x31a5c1]=getOperatorValue(_0x3fae0b);}else if(_0x4333ec[_0x8601('0xa')]===_0x8601('0xb')&&_[_0x8601('0xc')](_0x3fae0b)){var _0x14ce29=JSON['parse'](_0x3fae0b);var _0x2079cb={'$gte':moment(moment(_0x14ce29[_0x8601('0xd')])['format']('YYYY-MM-DD'))['utc']()[_0x8601('0xe')](),'$lte':moment(moment(_0x14ce29[_0x8601('0xf')])[_0x8601('0xe')](_0x8601('0x10')))[_0x8601('0x11')]()[_0x8601('0x12')](0x1,'s')[_0x8601('0xe')]()};_0xa9152a[_0x31a5c1]=_0x2079cb;}else if(_0x4333ec[_0x8601('0x13')]===_0x8601('0x14')){_0xa9152a[_0x31a5c1]=_0x3fae0b;}else{_0xa9152a[_0x31a5c1]=_[_0x8601('0x15')](_0x3fae0b)?_0x3fae0b:JSON[_0x8601('0x3')](_0x3fae0b);}}else{_0xa9152a[_0x31a5c1]=_['isArray'](_0x3fae0b)?_0x3fae0b:JSON['parse'](_0x3fae0b);}}catch(_0x32f7fb){_0xa9152a[_0x31a5c1]=_0x3fae0b[_0x8601('0x5')](',');}});}return _0xa9152a;};exports['limit']=function(_0x43cc2b){_0x43cc2b=parseInt(_0x43cc2b,0xa);if(!_0x43cc2b||_0x43cc2b<0x0){_0x43cc2b=LIMIT_VALUE;}return _0x43cc2b;};exports[_0x8601('0x16')]=function(_0xd39f1c){_0xd39f1c=parseInt(_0xd39f1c,0xa);if(!_0xd39f1c||_0xd39f1c<0x0){_0xd39f1c=0x0;}return _0xd39f1c;};exports[_0x8601('0x17')]=function(_0x3cb241){var _0x295149,_0x1003ba=null;if(_0x3cb241){_0x295149=_0x3cb241['split'](',');_0x1003ba=_[_0x8601('0x18')](_0x295149,function(_0x384189){if(_0x384189[_0x8601('0x19')]('-')===0x0){return[_0x384189===_0x8601('0x1a')?sequelize[_0x8601('0x1b')](sequelize['col']('priority'),_0x8601('0x1c')):_0x384189[_0x8601('0x1d')](0x1),'DESC'];}else{return[_0x384189===_0x8601('0x1a')?sequelize[_0x8601('0x1b')](sequelize['col'](_0x8601('0x1a')),'unsigned'):_0x384189,_0x8601('0x1e')];}});}return _0x1003ba;};exports[_0x8601('0x1f')]=function(_0x234df5,_0x21ddc0){if(_[_0x8601('0x7')](_0x234df5)){return _0x234df5;}if(_[_0x8601('0x15')](_0x234df5)){for(var _0x46e196=0x0;_0x46e196<_0x234df5[_0x8601('0x20')];_0x46e196+=0x1){_0x234df5[_0x46e196]=this[_0x8601('0x1f')](_0x234df5[_0x46e196],_0x21ddc0);}return _0x234df5;}if(!_[_0x8601('0x21')](_0x234df5)){return _0x234df5;}if(_[_0x8601('0x22')](_0x21ddc0)){_0x21ddc0=[_0x21ddc0];}if(!_[_0x8601('0x15')](_0x21ddc0)){return _0x234df5;}for(var _0x5a7403=0x0;_0x5a7403<_0x21ddc0[_0x8601('0x20')];_0x5a7403+=0x1){_['unset'](_0x234df5,_0x21ddc0[_0x5a7403]);}for(var _0x24a1a3 in _0x234df5){if(_0x234df5[_0x8601('0x23')](_0x24a1a3)){_0x234df5[_0x24a1a3]=this[_0x8601('0x1f')](_0x234df5[_0x24a1a3],_0x21ddc0);}}return _0x234df5;};exports[_0x8601('0x24')]=function(_0x194a1e){return _0x194a1e[_0x8601('0x25')](RegExp(_0x8601('0x26')))?!![]:![];};exports['isEmail']=function(_0x3df539){return _0x3df539[_0x8601('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x8601('0x27')]=function(_0x5cdeb5,_0x541aab){var _0x22015d=[];var _0x1ad97d=/[ `!@#$%^&*()_\-?~]/;var _0x302222=_0x541aab?_0x8601('0x28'):'{EXPR}';_0x5cdeb5[_0x8601('0x5')](/[ ,]+/)[_0x8601('0x29')](function(_0x33e6a3){_0x33e6a3=_0x33e6a3[_0x8601('0x2a')](/([^:]")"+/g,'$1');_0x33e6a3='+'+_0x33e6a3+'*';var _0x2e7cb0=_0x33e6a3[_0x8601('0x25')](_0x1ad97d);if(_0x2e7cb0){_0x33e6a3='\x22'+_0x33e6a3+'\x22';}_0x22015d[_0x8601('0x2b')](_0x33e6a3);});_0x302222=_0x302222[_0x8601('0x2a')](_0x8601('0x2c'),_0x22015d[_0x8601('0x2d')]('\x20'));return _0x302222;};exports[_0x8601('0x2e')]=function(_0x17905f,_0x57a6ec,_0x463e85){var _0x4c30c9={},_0x4ebff5={};if(_0x57a6ec[_0x8601('0x2f')][_0x8601('0x30')]){_0x57a6ec[_0x8601('0x2f')]['id']=_0x57a6ec['query'][_0x8601('0x30')];delete _0x57a6ec[_0x8601('0x2f')][_0x8601('0x30')];}_0x4c30c9[_0x8601('0x31')]=_[_0x8601('0x18')](_0x17905f,_0x8601('0x13'));_0x4c30c9[_0x8601('0x2f')]=_[_0x8601('0x1')](_0x57a6ec[_0x8601('0x2f')]);_0x4c30c9[_0x8601('0x6')]=_['intersection'](_0x4c30c9[_0x8601('0x31')],_0x4c30c9[_0x8601('0x2f')]);_0x4ebff5['attributes']=_['intersection'](_0x4c30c9[_0x8601('0x31')],this[_0x8601('0x4')](_0x57a6ec['query'][_0x8601('0x4')]));_0x4ebff5[_0x8601('0x32')]=_0x4ebff5[_0x8601('0x32')][_0x8601('0x20')]?_0x4ebff5[_0x8601('0x32')]:_0x4c30c9[_0x8601('0x31')];if(!_0x57a6ec[_0x8601('0x2f')][_0x8601('0x23')](_0x8601('0x33'))){_0x4ebff5['limit']=this[_0x8601('0x34')](_0x57a6ec[_0x8601('0x2f')]['limit']);_0x4ebff5[_0x8601('0x16')]=this[_0x8601('0x16')](_0x57a6ec['query'][_0x8601('0x16')]);}_0x4ebff5[_0x8601('0x35')]=this['sort'](_0x57a6ec[_0x8601('0x2f')]['sort']);_0x4ebff5[_0x8601('0x36')]=this[_0x8601('0x6')](_[_0x8601('0x37')](_0x57a6ec[_0x8601('0x2f')],_0x4c30c9[_0x8601('0x6')]),_0x17905f);if(_0x57a6ec['query'][_0x8601('0x38')]){var _0x3d6544=_0x17905f;var _0x73ad41=_0x57a6ec[_0x8601('0x2f')][_0x8601('0x38')];if(typeof _0x73ad41==='object'){_0x3d6544=_['filter'](_0x17905f,function(_0x390b24){return _[_0x8601('0x2')](_0x73ad41[_0x8601('0x39')],_0x390b24[_0x8601('0x13')]);});_0x73ad41=_0x73ad41[_0x8601('0x3a')];}_0x4ebff5[_0x8601('0x36')]=_['merge'](_0x4ebff5[_0x8601('0x36')],{'$or':_['map'](_0x3d6544,function(_0x514b91){if(_0x514b91['type']!==_0x8601('0x3b')){if(_0x463e85){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x8601('0x3c')](_0x514b91[_0x8601('0x13')])),{'$like':sequelize['fn']('lower','%'+_0x57a6ec[_0x8601('0x2f')][_0x8601('0x38')]+'%')});}else{var _0x99b79c={};_0x99b79c[_0x514b91[_0x8601('0x13')]]={'$like':'%'+_0x57a6ec[_0x8601('0x2f')][_0x8601('0x38')]+'%'};return _0x99b79c;}}})});}_0x4ebff5=_['merge']({},_0x4ebff5,_0x57a6ec['options']);return _0x4ebff5;}; \ No newline at end of file +var _0x7933=['indexOf','cast','col','priority','unsigned','substr','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','join','getOptions','query','$id','model','intersection','attributes','nolimit','offset','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','parse','keys','fields','split','filters','type','DATE','isPlainObject','$gte','format','utc','$lte','name','uniqueid','isArray','limit','sort','map'];(function(_0x34f92e,_0x2efa98){var _0x43df2e=function(_0x2f3e66){while(--_0x2f3e66){_0x34f92e['push'](_0x34f92e['shift']());}};_0x43df2e(++_0x2efa98);}(_0x7933,0xa6));var _0x3793=function(_0x3a377c,_0x2a47f5){_0x3a377c=_0x3a377c-0x0;var _0x374bb1=_0x7933[_0x3a377c];return _0x374bb1;};'use strict';var _=require(_0x3793('0x0'));var sequelize=require(_0x3793('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x369449){var _0x4c2b85=['ne'];try{var _0x1f9830=JSON[_0x3793('0x2')](_0x369449);var _0x1172b9=Object[_0x3793('0x3')](_0x1f9830)[0x0];return _0x4c2b85['includes'](_0x1172b9);}catch(_0x317a6a){return![];}}function getOperatorValue(_0x1aa871){var _0x528c1f=JSON[_0x3793('0x2')](_0x1aa871);var _0x2cdb6a=Object[_0x3793('0x3')](_0x528c1f)[0x0];var _0x5817d4=_0x528c1f[_0x2cdb6a];return{['$'+_0x2cdb6a]:_0x5817d4};}exports[_0x3793('0x4')]=function(_0x12ffaf){var _0x108f42=null;if(_0x12ffaf){_0x108f42=_0x12ffaf[_0x3793('0x5')](',');}return _0x108f42;};exports[_0x3793('0x6')]=function(_0xd80b94,_0x3a6f18){var _0x1ad58b={};if(!_['isEmpty'](_0xd80b94)){_['forOwn'](_0xd80b94,function(_0x54a5c2,_0xd3935){try{if(_0x3a6f18){var _0x59b4dc=_['find'](_0x3a6f18,{'name':_0xd3935})||{};if(hasSequelizeOperator(_0x54a5c2)){_0x1ad58b[_0xd3935]=getOperatorValue(_0x54a5c2);}else if(_0x59b4dc[_0x3793('0x7')]===_0x3793('0x8')&&_[_0x3793('0x9')](_0x54a5c2)){var _0x3d626f=JSON[_0x3793('0x2')](_0x54a5c2);var _0x4e432f={'$gte':moment(moment(_0x3d626f[_0x3793('0xa')])[_0x3793('0xb')]('YYYY-MM-DD'))[_0x3793('0xc')]()[_0x3793('0xb')](),'$lte':moment(moment(_0x3d626f[_0x3793('0xd')])[_0x3793('0xb')]('YYYY-MM-DD'))[_0x3793('0xc')]()['subtract'](0x1,'s')[_0x3793('0xb')]()};_0x1ad58b[_0xd3935]=_0x4e432f;}else if(_0x59b4dc[_0x3793('0xe')]===_0x3793('0xf')){_0x1ad58b[_0xd3935]=_0x54a5c2;}else{_0x1ad58b[_0xd3935]=_['isArray'](_0x54a5c2)?_0x54a5c2:JSON[_0x3793('0x2')](_0x54a5c2);}}else{_0x1ad58b[_0xd3935]=_[_0x3793('0x10')](_0x54a5c2)?_0x54a5c2:JSON['parse'](_0x54a5c2);}}catch(_0x240d63){_0x1ad58b[_0xd3935]=_0x54a5c2[_0x3793('0x5')](',');}});}return _0x1ad58b;};exports[_0x3793('0x11')]=function(_0x4d3fc3){_0x4d3fc3=parseInt(_0x4d3fc3,0xa);if(!_0x4d3fc3||_0x4d3fc3<0x0){_0x4d3fc3=LIMIT_VALUE;}return _0x4d3fc3;};exports['offset']=function(_0x3c57ba){_0x3c57ba=parseInt(_0x3c57ba,0xa);if(!_0x3c57ba||_0x3c57ba<0x0){_0x3c57ba=0x0;}return _0x3c57ba;};exports[_0x3793('0x12')]=function(_0x30a498){var _0xe464b6,_0x1a7fd8=null;if(_0x30a498){_0xe464b6=_0x30a498[_0x3793('0x5')](',');_0x1a7fd8=_[_0x3793('0x13')](_0xe464b6,function(_0x517c7b){if(_0x517c7b[_0x3793('0x14')]('-')===0x0){return[_0x517c7b==='priority'?sequelize[_0x3793('0x15')](sequelize[_0x3793('0x16')](_0x3793('0x17')),_0x3793('0x18')):_0x517c7b[_0x3793('0x19')](0x1),'DESC'];}else{return[_0x517c7b===_0x3793('0x17')?sequelize[_0x3793('0x15')](sequelize[_0x3793('0x16')](_0x3793('0x17')),_0x3793('0x18')):_0x517c7b,_0x3793('0x1a')];}});}return _0x1a7fd8;};exports[_0x3793('0x1b')]=function(_0x556de3,_0x4470ae){if(_[_0x3793('0x1c')](_0x556de3)){return _0x556de3;}if(_[_0x3793('0x10')](_0x556de3)){for(var _0x59d4b5=0x0;_0x59d4b5<_0x556de3[_0x3793('0x1d')];_0x59d4b5+=0x1){_0x556de3[_0x59d4b5]=this[_0x3793('0x1b')](_0x556de3[_0x59d4b5],_0x4470ae);}return _0x556de3;}if(!_[_0x3793('0x1e')](_0x556de3)){return _0x556de3;}if(_[_0x3793('0x1f')](_0x4470ae)){_0x4470ae=[_0x4470ae];}if(!_[_0x3793('0x10')](_0x4470ae)){return _0x556de3;}for(var _0x50f784=0x0;_0x50f784<_0x4470ae[_0x3793('0x1d')];_0x50f784+=0x1){_[_0x3793('0x20')](_0x556de3,_0x4470ae[_0x50f784]);}for(var _0x4d1ab2 in _0x556de3){if(_0x556de3[_0x3793('0x21')](_0x4d1ab2)){_0x556de3[_0x4d1ab2]=this[_0x3793('0x1b')](_0x556de3[_0x4d1ab2],_0x4470ae);}}return _0x556de3;};exports[_0x3793('0x22')]=function(_0x4f0f24){return _0x4f0f24['match'](RegExp(_0x3793('0x23')))?!![]:![];};exports[_0x3793('0x24')]=function(_0xdeb0b2){return _0xdeb0b2[_0x3793('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x3793('0x26')]=function(_0x18a46b,_0x40167a){var _0x854d31=[];var _0x5433e0=/[ `!@#$%^&*()_\-?~]/;var _0x5416ea=_0x40167a?_0x3793('0x27'):_0x3793('0x28');_0x18a46b[_0x3793('0x5')](/[ ,]+/)[_0x3793('0x29')](function(_0x24b3cd){_0x24b3cd=_0x24b3cd['replace'](/([^:]")"+/g,'$1');_0x24b3cd='+'+_0x24b3cd+'*';var _0x9c8a74=_0x24b3cd[_0x3793('0x25')](_0x5433e0);if(_0x9c8a74){_0x24b3cd='\x22'+_0x24b3cd+'\x22';}_0x854d31['push'](_0x24b3cd);});_0x5416ea=_0x5416ea[_0x3793('0x2a')](_0x3793('0x28'),_0x854d31[_0x3793('0x2b')]('\x20'));return _0x5416ea;};exports[_0x3793('0x2c')]=function(_0x506867,_0x5bd173,_0x1d4e27){var _0x47d6aa={},_0xe1633d={};if(_0x5bd173[_0x3793('0x2d')][_0x3793('0x2e')]){_0x5bd173[_0x3793('0x2d')]['id']=_0x5bd173['query'][_0x3793('0x2e')];delete _0x5bd173['query'][_0x3793('0x2e')];}_0x47d6aa[_0x3793('0x2f')]=_[_0x3793('0x13')](_0x506867,_0x3793('0xe'));_0x47d6aa['query']=_[_0x3793('0x3')](_0x5bd173[_0x3793('0x2d')]);_0x47d6aa[_0x3793('0x6')]=_[_0x3793('0x30')](_0x47d6aa[_0x3793('0x2f')],_0x47d6aa[_0x3793('0x2d')]);_0xe1633d[_0x3793('0x31')]=_[_0x3793('0x30')](_0x47d6aa[_0x3793('0x2f')],this['fields'](_0x5bd173['query']['fields']));_0xe1633d[_0x3793('0x31')]=_0xe1633d['attributes'][_0x3793('0x1d')]?_0xe1633d[_0x3793('0x31')]:_0x47d6aa[_0x3793('0x2f')];if(!_0x5bd173[_0x3793('0x2d')][_0x3793('0x21')](_0x3793('0x32'))){_0xe1633d[_0x3793('0x11')]=this[_0x3793('0x11')](_0x5bd173['query'][_0x3793('0x11')]);_0xe1633d[_0x3793('0x33')]=this[_0x3793('0x33')](_0x5bd173['query']['offset']);}_0xe1633d['order']=this[_0x3793('0x12')](_0x5bd173['query'][_0x3793('0x12')]);_0xe1633d[_0x3793('0x34')]=this[_0x3793('0x6')](_[_0x3793('0x35')](_0x5bd173[_0x3793('0x2d')],_0x47d6aa[_0x3793('0x6')]),_0x506867);if(_0x5bd173[_0x3793('0x2d')][_0x3793('0x36')]){var _0x1e5910=_0x506867;var _0x14d400=_0x5bd173[_0x3793('0x2d')][_0x3793('0x36')];if(typeof _0x14d400===_0x3793('0x37')){_0x1e5910=_[_0x3793('0x36')](_0x506867,function(_0x4c91fe){return _['includes'](_0x14d400[_0x3793('0x38')],_0x4c91fe[_0x3793('0xe')]);});_0x14d400=_0x14d400[_0x3793('0x39')];}_0xe1633d[_0x3793('0x34')]=_[_0x3793('0x3a')](_0xe1633d[_0x3793('0x34')],{'$or':_['map'](_0x1e5910,function(_0x3fd6b9){if(_0x3fd6b9['type']!==_0x3793('0x3b')){if(_0x1d4e27){return sequelize[_0x3793('0x34')](sequelize['fn']('lower',sequelize[_0x3793('0x16')](_0x3fd6b9[_0x3793('0xe')])),{'$like':sequelize['fn'](_0x3793('0x3c'),'%'+_0x5bd173[_0x3793('0x2d')][_0x3793('0x36')]+'%')});}else{var _0x416d5b={};_0x416d5b[_0x3fd6b9[_0x3793('0xe')]]={'$like':'%'+_0x5bd173['query'][_0x3793('0x36')]+'%'};return _0x416d5b;}}})});}_0xe1633d=_[_0x3793('0x3a')]({},_0xe1633d,_0x5bd173[_0x3793('0x3d')]);return _0xe1633d;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 05aee25..bdb8e82 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 _0x148f=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','catch','getRealtimeAgents','getAgentStatus','isArray','startCase','Queue','findOne','getAgents','flatten','value','filter','busy','map','resolve','includes','findAll','name','chatPause','find','merge','globalStatus','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','indexOf','fullname','internal','validateSortParameter','sort','pause','pauseType','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','openchannelPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','lodash','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus','Agents','then','error'];(function(_0x31fd8c,_0x30e511){var _0x3523d7=function(_0x2025ea){while(--_0x2025ea){_0x31fd8c['push'](_0x31fd8c['shift']());}};_0x3523d7(++_0x30e511);}(_0x148f,0x15b));var _0xf148=function(_0x537d26,_0xf8f9f6){_0x537d26=_0x537d26-0x0;var _0x35dd78=_0x148f[_0x537d26];return _0x35dd78;};'use strict';var _=require(_0xf148('0x0'));var jayson=require(_0xf148('0x1'));var db=require(_0xf148('0x2'))['db'];var amiClient=jayson[_0xf148('0x3')][_0xf148('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0xf148('0x4')]({'port':0x232c});function isAgentPaused(_0x3c08dc,_0x4bf67b){var _0x537ff4=[_0x3c08dc['chatPause'],_0x3c08dc[_0xf148('0x5')],_0x3c08dc[_0xf148('0x6')],_0x3c08dc['openchannelPause'],_0x3c08dc[_0xf148('0x7')],_0x3c08dc[_0xf148('0x8')],_0x3c08dc[_0xf148('0x9')]];if(!_0x4bf67b)return _[_0xf148('0xa')](_0x537ff4);var _0x3d1775=_['filter'](_0x537ff4);return _0x3d1775[_0xf148('0xb')]>0x0&&_0x3d1775[_0xf148('0xb')]<_0x537ff4['length']?!![]:![];}function isIdle(_0x49942b){return _0x49942b===_0xf148('0xc')||_0x49942b===_0xf148('0xd')||_0x49942b===_0xf148('0xe')||_0x49942b===_0xf148('0xf')||_[_0xf148('0x10')](_0x49942b);}function isAgentIdle(_0x3e26ae){if(_0x3e26ae['voiceStatus']!=='idle'&&_0x3e26ae['voicePause']){_0x3e26ae[_0xf148('0x11')]='pause';return![];}return _[_0xf148('0xa')]([_0x3e26ae[_0xf148('0x12')],_0x3e26ae[_0xf148('0x13')],_0x3e26ae['mailStatus'],_0x3e26ae[_0xf148('0x14')],_0x3e26ae[_0xf148('0x15')],_0x3e26ae['voiceStatus'],_0x3e26ae['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xf148('0x16'),{})[_0xf148('0x17')](function(_0x175181){if(_0x175181[_0xf148('0x18')]){throw new Error(_0xf148('0x19'));}var _0x23a1b8=_0x175181[_0xf148('0x1a')];return routingClient['request'](_0xf148('0x16'),{})[_0xf148('0x17')](function(_0x3d850f){if(_0x3d850f['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3c39bc=_0x3d850f['result'];return _['merge']({},_0x23a1b8,_0x3c39bc);});})[_0xf148('0x1b')](function(_0x514b81){throw _0x514b81;});}exports[_0xf148('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x201132){var _0xfe580c=_0xf148('0xd');if(isAgentPaused(_0x201132))_0xfe580c='pause';else if(isAgentPaused(_0x201132,!![]))_0xfe580c='*pause';else if(isAgentIdle(_0x201132))_0xfe580c='idle';else _0xfe580c='busy';return _0xfe580c;}exports[_0xf148('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x43df83,_0x5df6e8){var _0x4b28f9=_[_0xf148('0x1e')](_0x43df83)?_0x43df83:[_0x43df83];var _0x4fc44a=_[_0xf148('0x1f')](_0x5df6e8)+_0xf148('0x20');var _0x3e8718=_['map'](_0x4b28f9,function(_0x574a30){return db[_0x4fc44a][_0xf148('0x21')]({'where':{'id':_0x574a30}})['then'](function(_0x2fdca5){if(!_0x2fdca5)return[];return _0x2fdca5[_0xf148('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x3e8718)[_0xf148('0x17')](function(_0x1bc7ac){var _0x41c14f=_(_0x1bc7ac)[_0xf148('0x23')]()['map']('id')['uniq']()[_0xf148('0x24')]();return _0x41c14f;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3759f3,_0x4a64c4,_0x1430c6){try{if(_0x4a64c4['length']>0x0){_0x3759f3=_0x3759f3[_0xf148('0x25')](function(_0x58a022){return _0x4a64c4['includes'](_0x58a022['id']);});}var _0x2a8a90=_0x3759f3[_0xf148('0x25')](function(_0x6a9bb){var _0x21e558=_0xf148('0x26');if(isAgentIdle(_0x6a9bb)){_0x21e558=_0xf148('0xc');}return _0x21e558===_0x1430c6;});return _[_0xf148('0x27')](_0x2a8a90,'id');}catch(_0x28b9ce){throw _0x28b9ce;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xdf3aa9,_0x33655e,_0x4ee2d4){return Promise[_0xf148('0x28')]()[_0xf148('0x17')](function(){if(_0x33655e[_0xf148('0xb')]>0x0){_0xdf3aa9=_0xdf3aa9[_0xf148('0x25')](function(_0x87e82b){return _0x33655e[_0xf148('0x29')](_0x87e82b['id']);});}return _0xdf3aa9;})[_0xf148('0x17')](function(){return db['User'][_0xf148('0x2a')]({'attributes':['id',_0xf148('0x2b'),'fullname',_0xf148('0x2c'),_0xf148('0x5'),_0xf148('0x6'),'openchannelPause',_0xf148('0x7'),'voicePause',_0xf148('0x9'),'pauseType'],'where':{'id':{'$in':_[_0xf148('0x27')](_0xdf3aa9,'id')}},'raw':!![]});})[_0xf148('0x17')](function(_0x4c982a){return _0x4c982a['map'](function(_0x42610d){var _0x208239=_[_0xf148('0x2d')](_0xdf3aa9,['id',_0x42610d['id']]);var _0xd109d4=filterAgentAttributes(_0x208239);_[_0xf148('0x2e')](_0x42610d,_0xd109d4);_0x42610d[_0xf148('0x2f')]=getAgentStatus(_0x42610d);return _0x42610d;});})[_0xf148('0x17')](function(_0x4f3d2a){var _0x4cbf1e=sortAgentsByStatus(_0x4f3d2a,_0x4ee2d4);return _[_0xf148('0x27')](_0x4cbf1e,'id');})['catch'](function(_0x533e43){throw _0x533e43;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x36cb9e){var _0x43b305={'fields':[],'order':null};var _0x3e05c2=_0x36cb9e['split'](',');_0x43b305[_0xf148('0x30')]=_['filter'](_0x3e05c2,function(_0xfcb190){if(!_0xfcb190[_0xf148('0x29')](_0xf148('0x2f'))){return!![];}_0x43b305[_0xf148('0x31')]=_[_0xf148('0x32')](_0xfcb190,'-')?_0xf148('0x33'):_0xf148('0x34');return![];});return _0x43b305;}exports[_0xf148('0x35')]=getUpdatedSortOptions;function validateSortParameter(_0x39e9b2){if(_0x39e9b2[_0xf148('0x29')]('fullname')&&!_0x39e9b2['includes']('internal')){var _0x4ea016=_0x39e9b2['substring'](0x0,_0x39e9b2[_0xf148('0x36')](_0xf148('0x37')));_0x39e9b2+=','+_0x4ea016+_0xf148('0x38');}return _0x39e9b2;}exports[_0xf148('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x12373a,_0x5cfb81){var _0xe0df7c=_0x12373a[_0xf148('0x3a')](function(_0x243486,_0x4418ad){if(_0x243486['globalStatus']===_0x4418ad[_0xf148('0x2f')]){if(_0x243486['globalStatus']===_0xf148('0x3b')){if(_0x5cfb81==='DESC'){return(_0x243486[_0xf148('0x3c')]||'')<(_0x4418ad['pauseType']||'')||_0x243486[_0xf148('0x37')]['toLowerCase']()>_0x4418ad[_0xf148('0x37')][_0xf148('0x3d')]()?0x1:-0x1;}else{return(_0x243486[_0xf148('0x3c')]||'')<(_0x4418ad[_0xf148('0x3c')]||'')||_0x243486[_0xf148('0x37')][_0xf148('0x3d')]()>_0x4418ad['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x5cfb81==='DESC'){return _0x243486['fullname'][_0xf148('0x3d')]()<_0x4418ad[_0xf148('0x37')][_0xf148('0x3d')]()?0x1:-0x1;}else{return _0x243486[_0xf148('0x37')]['toLowerCase']()<_0x4418ad['fullname'][_0xf148('0x3d')]()?-0x1:0x1;}}}else{if(_0x5cfb81===_0xf148('0x33')){return _0x243486[_0xf148('0x2f')]<_0x4418ad['globalStatus']?0x1:-0x1;}else{return _0x243486['globalStatus']<_0x4418ad['globalStatus']?-0x1:0x1;}}});return _0xe0df7c;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x169b77){var _0x17d3e2=[_0xf148('0x3e'),_0xf148('0x3f'),_0xf148('0x40'),_0xf148('0x41'),'pauseType',_0xf148('0x41'),_0xf148('0x38'),_0xf148('0x42'),_0xf148('0x2c'),_0xf148('0x43'),_0xf148('0x6'),_0xf148('0x7'),'whatsappPause',_0xf148('0x5'),_0xf148('0x8'),_0xf148('0x44'),_0xf148('0x45'),_0xf148('0x46'),_0xf148('0x47'),_0xf148('0x48'),_0xf148('0x49'),'chatCurrentCapacity',_0xf148('0x4a'),_0xf148('0x4b'),_0xf148('0x4c'),_0xf148('0x4d'),_0xf148('0x4e'),_0xf148('0x12'),_0xf148('0x14'),_0xf148('0x4f'),'smsStatus',_0xf148('0x50'),_0xf148('0x13'),_0xf148('0x11'),_0xf148('0x51'),_0xf148('0x52'),_0xf148('0x53'),_0xf148('0x54'),_0xf148('0x55'),_0xf148('0x56'),'voiceStatusTime',_0xf148('0x57'),_0xf148('0x58'),'screenrecording',_0xf148('0x59'),_0xf148('0x5a'),_0xf148('0x5b')];var _0x372eac=[_0xf148('0x2c'),_0xf148('0x43'),_0xf148('0x6'),_0xf148('0x7'),'whatsappPause',_0xf148('0x5'),'voicePause',_0xf148('0x3f')];var _0x1947a2=_(_0x169b77)[_0xf148('0x5c')](_0x372eac)['pick'](_0x17d3e2)[_0xf148('0x24')]();return _0x1947a2;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x6dc6=['substring','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastPauseAt','address','chatCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','online','omit','pick','value','lodash','jayson/promise','client','http','chatPause','faxPause','openchannelPause','whatsappPause','every','filter','length','ringing','isNil','voiceStatus','voicePause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','unknown','pause','busy','getAgentStatus','startCase','Queue','findOne','getAgents','all','flatten','uniq','getAgentIdsByQueues','includes','idle','map','getAgentIdsByStatus','resolve','findAll','name','mailPause','smsPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','getUpdatedSortOptions','fullname','internal'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6dc6,0x12e));var _0x66dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6dc6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x66dc('0x0'));var jayson=require(_0x66dc('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x66dc('0x2')][_0x66dc('0x3')]({'port':0x232a});var routingClient=jayson[_0x66dc('0x2')][_0x66dc('0x3')]({'port':0x232c});function isAgentPaused(_0x41bb11,_0x4cb390){var _0xadb1c0=[_0x41bb11[_0x66dc('0x4')],_0x41bb11[_0x66dc('0x5')],_0x41bb11['mailPause'],_0x41bb11[_0x66dc('0x6')],_0x41bb11['smsPause'],_0x41bb11['voicePause'],_0x41bb11[_0x66dc('0x7')]];if(!_0x4cb390)return _[_0x66dc('0x8')](_0xadb1c0);var _0x1383b2=_[_0x66dc('0x9')](_0xadb1c0);return _0x1383b2['length']>0x0&&_0x1383b2[_0x66dc('0xa')]<_0xadb1c0['length']?!![]:![];}function isIdle(_0x5eb6f2){return _0x5eb6f2==='idle'||_0x5eb6f2==='unknown'||_0x5eb6f2==='unavailable'||_0x5eb6f2===_0x66dc('0xb')||_[_0x66dc('0xc')](_0x5eb6f2);}function isAgentIdle(_0x4d31eb){if(_0x4d31eb[_0x66dc('0xd')]!=='idle'&&_0x4d31eb[_0x66dc('0xe')]){_0x4d31eb[_0x66dc('0xd')]='pause';return![];}return _[_0x66dc('0x8')]([_0x4d31eb[_0x66dc('0xf')],_0x4d31eb[_0x66dc('0x10')],_0x4d31eb[_0x66dc('0x11')],_0x4d31eb[_0x66dc('0x12')],_0x4d31eb[_0x66dc('0x13')],_0x4d31eb[_0x66dc('0xd')],_0x4d31eb[_0x66dc('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x66dc('0x15')](function(_0x147e00){if(_0x147e00[_0x66dc('0x16')]){throw new Error(_0x66dc('0x17'));}var _0x364b73=_0x147e00[_0x66dc('0x18')];return routingClient[_0x66dc('0x19')]('Agents',{})['then'](function(_0x59116e){if(_0x59116e['error']){throw new Error(_0x66dc('0x1a'));}var _0x23c093=_0x59116e[_0x66dc('0x18')];return _[_0x66dc('0x1b')]({},_0x364b73,_0x23c093);});})[_0x66dc('0x1c')](function(_0x1a410e){throw _0x1a410e;});}exports[_0x66dc('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x46eca2){var _0x254b2b=_0x66dc('0x1e');if(isAgentPaused(_0x46eca2))_0x254b2b=_0x66dc('0x1f');else if(isAgentPaused(_0x46eca2,!![]))_0x254b2b='*pause';else if(isAgentIdle(_0x46eca2))_0x254b2b='idle';else _0x254b2b=_0x66dc('0x20');return _0x254b2b;}exports[_0x66dc('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x2a1de3,_0x1b978f){var _0x16ea40=_['isArray'](_0x2a1de3)?_0x2a1de3:[_0x2a1de3];var _0x1a4d93=_[_0x66dc('0x22')](_0x1b978f)+_0x66dc('0x23');var _0x48fcab=_['map'](_0x16ea40,function(_0x49723b){return db[_0x1a4d93][_0x66dc('0x24')]({'where':{'id':_0x49723b}})[_0x66dc('0x15')](function(_0x109117){if(!_0x109117)return[];return _0x109117[_0x66dc('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x66dc('0x26')](_0x48fcab)['then'](function(_0x28aca3){var _0x5c99ac=_(_0x28aca3)[_0x66dc('0x27')]()['map']('id')[_0x66dc('0x28')]()['value']();return _0x5c99ac;});}exports[_0x66dc('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x175143,_0xa4720d,_0x779b84){try{if(_0xa4720d['length']>0x0){_0x175143=_0x175143[_0x66dc('0x9')](function(_0x3b3d3a){return _0xa4720d[_0x66dc('0x2a')](_0x3b3d3a['id']);});}var _0x16b86f=_0x175143[_0x66dc('0x9')](function(_0xf63368){var _0x580c6a=_0x66dc('0x20');if(isAgentIdle(_0xf63368)){_0x580c6a=_0x66dc('0x2b');}return _0x580c6a===_0x779b84;});return _[_0x66dc('0x2c')](_0x16b86f,'id');}catch(_0x5af319){throw _0x5af319;}}exports[_0x66dc('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x501cd3,_0x2d23a3,_0x5d0cc0){return Promise[_0x66dc('0x2e')]()[_0x66dc('0x15')](function(){if(_0x2d23a3['length']>0x0){_0x501cd3=_0x501cd3[_0x66dc('0x9')](function(_0x2ce260){return _0x2d23a3['includes'](_0x2ce260['id']);});}return _0x501cd3;})['then'](function(){return db['User'][_0x66dc('0x2f')]({'attributes':['id',_0x66dc('0x30'),'fullname','chatPause',_0x66dc('0x5'),_0x66dc('0x31'),_0x66dc('0x6'),_0x66dc('0x32'),_0x66dc('0xe'),_0x66dc('0x7'),_0x66dc('0x33')],'where':{'id':{'$in':_[_0x66dc('0x2c')](_0x501cd3,'id')}},'raw':!![]});})[_0x66dc('0x15')](function(_0x55f2cf){return _0x55f2cf[_0x66dc('0x2c')](function(_0x3b8f9f){var _0x6d2adc=_[_0x66dc('0x34')](_0x501cd3,['id',_0x3b8f9f['id']]);var _0x517df2=filterAgentAttributes(_0x6d2adc);_[_0x66dc('0x1b')](_0x3b8f9f,_0x517df2);_0x3b8f9f[_0x66dc('0x35')]=getAgentStatus(_0x3b8f9f);return _0x3b8f9f;});})[_0x66dc('0x15')](function(_0x2f70ea){var _0xbec449=sortAgentsByStatus(_0x2f70ea,_0x5d0cc0);return _[_0x66dc('0x2c')](_0xbec449,'id');})['catch'](function(_0x2a8d10){throw _0x2a8d10;});}exports[_0x66dc('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4d9408){var _0x1f9dd1={'fields':[],'order':null};var _0x14ef4e=_0x4d9408['split'](',');_0x1f9dd1[_0x66dc('0x37')]=_[_0x66dc('0x9')](_0x14ef4e,function(_0x136298){if(!_0x136298[_0x66dc('0x2a')](_0x66dc('0x35'))){return!![];}_0x1f9dd1[_0x66dc('0x38')]=_[_0x66dc('0x39')](_0x136298,'-')?_0x66dc('0x3a'):'ASC';return![];});return _0x1f9dd1;}exports[_0x66dc('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x212da7){if(_0x212da7[_0x66dc('0x2a')](_0x66dc('0x3c'))&&!_0x212da7[_0x66dc('0x2a')](_0x66dc('0x3d'))){var _0x23f967=_0x212da7[_0x66dc('0x3e')](0x0,_0x212da7['indexOf'](_0x66dc('0x3c')));_0x212da7+=','+_0x23f967+'internal';}return _0x212da7;}exports[_0x66dc('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0xf5182e,_0x3131cb){var _0x2624a4=_0xf5182e[_0x66dc('0x40')](function(_0x5e36bb,_0x157409){if(_0x5e36bb[_0x66dc('0x35')]===_0x157409[_0x66dc('0x35')]){if(_0x5e36bb[_0x66dc('0x35')]==='pause'){if(_0x3131cb===_0x66dc('0x3a')){return(_0x5e36bb[_0x66dc('0x33')]||'')<(_0x157409[_0x66dc('0x33')]||'')||_0x5e36bb[_0x66dc('0x3c')]['toLowerCase']()>_0x157409[_0x66dc('0x3c')][_0x66dc('0x41')]()?0x1:-0x1;}else{return(_0x5e36bb[_0x66dc('0x33')]||'')<(_0x157409['pauseType']||'')||_0x5e36bb[_0x66dc('0x3c')]['toLowerCase']()>_0x157409['fullname'][_0x66dc('0x41')]()?-0x1:0x1;}}else{if(_0x3131cb===_0x66dc('0x3a')){return _0x5e36bb[_0x66dc('0x3c')][_0x66dc('0x41')]()<_0x157409[_0x66dc('0x3c')][_0x66dc('0x41')]()?0x1:-0x1;}else{return _0x5e36bb[_0x66dc('0x3c')][_0x66dc('0x41')]()<_0x157409[_0x66dc('0x3c')][_0x66dc('0x41')]()?-0x1:0x1;}}}else{if(_0x3131cb===_0x66dc('0x3a')){return _0x5e36bb['globalStatus']<_0x157409[_0x66dc('0x35')]?0x1:-0x1;}else{return _0x5e36bb[_0x66dc('0x35')]<_0x157409[_0x66dc('0x35')]?-0x1:0x1;}}});return _0x2624a4;}exports[_0x66dc('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x265de9){var _0x4783e6=[_0x66dc('0x43'),'online','lastLoginAt','lastPauseAt',_0x66dc('0x33'),_0x66dc('0x44'),_0x66dc('0x3d'),_0x66dc('0x45'),_0x66dc('0x4'),_0x66dc('0x6'),_0x66dc('0x31'),_0x66dc('0x32'),_0x66dc('0x7'),_0x66dc('0x5'),'voicePause',_0x66dc('0x46'),'openchannelCapacity','mailCapacity',_0x66dc('0x47'),_0x66dc('0x48'),'faxCapacity',_0x66dc('0x49'),_0x66dc('0x4a'),_0x66dc('0x4b'),_0x66dc('0x4c'),'whatsappCurrentCapacity',_0x66dc('0x4d'),_0x66dc('0xf'),'openchannelStatus','mailStatus',_0x66dc('0x13'),_0x66dc('0x14'),_0x66dc('0x10'),_0x66dc('0xd'),_0x66dc('0x4e'),_0x66dc('0x4f'),'mailStatusTime',_0x66dc('0x50'),'whatsappStatusTime',_0x66dc('0x51'),_0x66dc('0x52'),_0x66dc('0x53'),_0x66dc('0x54'),_0x66dc('0x55'),_0x66dc('0x56'),'phoneBarEnableAutomaticScreenRecording','routealias'];var _0x7c7f46=[_0x66dc('0x4'),_0x66dc('0x6'),_0x66dc('0x31'),'smsPause',_0x66dc('0x7'),_0x66dc('0x5'),'voicePause',_0x66dc('0x57')];var _0x31fcd3=_(_0x265de9)[_0x66dc('0x58')](_0x7c7f46)[_0x66dc('0x59')](_0x4783e6)[_0x66dc('0x5a')]();return _0x31fcd3;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 2184a22..6b860f6 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 _0xbaa7=['format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','find','pick','initializeQueues','jayson/promise','client','available','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','dialMethod','Trunk','erlangCalls','erlangCallToSecond','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','Queues','then','error'];(function(_0x121b45,_0x45003b){var _0x5bb560=function(_0x96e321){while(--_0x96e321){_0x121b45['push'](_0x121b45['shift']());}};_0x5bb560(++_0x45003b);}(_0xbaa7,0x197));var _0x7baa=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbaa7[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var jayson=require(_0x7baa('0x0'));var util=require('util');var amiClient=jayson[_0x7baa('0x1')]['http']({'port':0x232a});var routingClient=jayson[_0x7baa('0x1')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x7baa('0x2'),_0x7baa('0x3'),_0x7baa('0x4'),_0x7baa('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x7baa('0x6'),_0x7baa('0x7'),_0x7baa('0x8'),_0x7baa('0x9'),'notInUse','onHold',_0x7baa('0xa'),_0x7baa('0xb'),_0x7baa('0xc'),_0x7baa('0xd'),_0x7baa('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x7baa('0xf'),_0x7baa('0x10'),_0x7baa('0x11'),'statusMessage','dialActive',_0x7baa('0x12'),_0x7baa('0x13'),'startPredictive','startProgressive',_0x7baa('0x14'),_0x7baa('0x15'),'erlangAbandonmentRate','erlangBusyFactor',_0x7baa('0x16'),'dialPredictiveIntervalMaxThreshold',_0x7baa('0x17'),_0x7baa('0x18'),'predictiveIntervalTotalCalls',_0x7baa('0x19'),'predictiveIntervalDroppedCallsTimeout',_0x7baa('0x1a'),_0x7baa('0x1b'),_0x7baa('0x1c')];function getRealtimeQueues(_0x5f1ed6,_0x202697){var _0xbdbd6=_0x202697===_0x7baa('0x1d')?amiClient:routingClient;return _0xbdbd6['request'](_['startCase'](_0x202697)+_0x7baa('0x1e'),_0x5f1ed6)[_0x7baa('0x1f')](function(_0x40fd2d){if(_0x40fd2d[_0x7baa('0x20')])throw new Error(util[_0x7baa('0x21')](_0x7baa('0x22'),_0x202697));return _0x40fd2d[_0x7baa('0x23')];})['catch'](function(_0x4b21ce){throw _0x4b21ce;});}exports[_0x7baa('0x24')]=getRealtimeQueues;function initializeQueues(_0xe265c0,_0x1e2af7,_0xad5690,_0x447a5c){var _0x1d4a85=DEFAULT_QUEUE_ATTRIBUTES;if(_0xad5690===_0x7baa('0x1d')){if(_0x447a5c===_0x7baa('0x25')){_0x1d4a85=_0x1d4a85[_0x7baa('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x447a5c===_0x7baa('0x27')){_0x1d4a85=_0x1d4a85[_0x7baa('0x26')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xe265c0[_0x7baa('0x28')](function(_0x4006d9){var _0x33c4b8=_0x4006d9['get']({'plain':!![]});_0x33c4b8[_0x7baa('0x4')]=0x0;_0x33c4b8[_0x7baa('0x9')]=0x0;_0x33c4b8[_0x7baa('0x3')]=0x0;_0x33c4b8['available']=0x0;_0x33c4b8['waiting']=0x0;if(_0xad5690===_0x7baa('0x1d')){_0x33c4b8['talking']=0x0;_0x33c4b8[_0x7baa('0x6')]=0x0;if(_0x447a5c==='outbound'){_0x33c4b8[_0x7baa('0xf')]=0x0;_0x33c4b8[_0x7baa('0x10')]=0x0;}}var _0x310308=_[_0x7baa('0x29')](_0x1e2af7,['id',_0x33c4b8['id']]);if(_0x310308){_['merge'](_0x33c4b8,_[_0x7baa('0x2a')](_0x310308,_0x1d4a85));}return _0x33c4b8;});}exports[_0x7baa('0x2b')]=initializeQueues; \ No newline at end of file +var _0x1724=['getRealtimeQueues','inbound','concat','outbound','map','get','paused','loggedIn','waiting','busy','originated','find','merge','initializeQueues','lodash','jayson/promise','util','http','client','available','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch'];(function(_0x4a3144,_0x45f138){var _0x430391=function(_0x3adbc8){while(--_0x3adbc8){_0x4a3144['push'](_0x4a3144['shift']());}};_0x430391(++_0x45f138);}(_0x1724,0x7e));var _0x4172=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x1724[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x4172('0x0'));var jayson=require(_0x4172('0x1'));var util=require(_0x4172('0x2'));var amiClient=jayson['client'][_0x4172('0x3')]({'port':0x232a});var routingClient=jayson[_0x4172('0x4')][_0x4172('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x4172('0x5'),'loggedIn','paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x4172('0x6'),_0x4172('0x7'),_0x4172('0x8'),_0x4172('0x9'),_0x4172('0xa'),_0x4172('0xb'),_0x4172('0xc'),_0x4172('0xd'),_0x4172('0xe'),_0x4172('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x4172('0x10'),'originated','message','statusMessage','dialActive',_0x4172('0x11'),_0x4172('0x12'),_0x4172('0x13'),_0x4172('0x14'),_0x4172('0x15'),_0x4172('0x16'),_0x4172('0x17'),'erlangBusyFactor',_0x4172('0x18'),_0x4172('0x19'),_0x4172('0x1a'),'predictiveIntervalAvailable',_0x4172('0x1b'),_0x4172('0x1c'),_0x4172('0x1d'),_0x4172('0x1e'),_0x4172('0x1f'),_0x4172('0x20')];function getRealtimeQueues(_0x2a6134,_0xa94db9){var _0x5d8d94=_0xa94db9===_0x4172('0x21')?amiClient:routingClient;return _0x5d8d94[_0x4172('0x22')](_['startCase'](_0xa94db9)+_0x4172('0x23'),_0x2a6134)[_0x4172('0x24')](function(_0x16fd92){if(_0x16fd92[_0x4172('0x25')])throw new Error(util[_0x4172('0x26')](_0x4172('0x27'),_0xa94db9));return _0x16fd92[_0x4172('0x28')];})[_0x4172('0x29')](function(_0x419007){throw _0x419007;});}exports[_0x4172('0x2a')]=getRealtimeQueues;function initializeQueues(_0x345e80,_0x4c8104,_0x135e4c,_0x575039){var _0xcf8e47=DEFAULT_QUEUE_ATTRIBUTES;if(_0x135e4c==='voice'){if(_0x575039===_0x4172('0x2b')){_0xcf8e47=_0xcf8e47[_0x4172('0x2c')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x575039===_0x4172('0x2d')){_0xcf8e47=_0xcf8e47[_0x4172('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x345e80[_0x4172('0x2e')](function(_0x35f9bf){var _0x7bbb80=_0x35f9bf[_0x4172('0x2f')]({'plain':!![]});_0x7bbb80[_0x4172('0x30')]=0x0;_0x7bbb80[_0x4172('0x8')]=0x0;_0x7bbb80[_0x4172('0x31')]=0x0;_0x7bbb80['available']=0x0;_0x7bbb80[_0x4172('0x32')]=0x0;if(_0x135e4c===_0x4172('0x21')){_0x7bbb80['talking']=0x0;_0x7bbb80[_0x4172('0x33')]=0x0;if(_0x575039===_0x4172('0x2d')){_0x7bbb80[_0x4172('0x10')]=0x0;_0x7bbb80[_0x4172('0x34')]=0x0;}}var _0x69fb25=_[_0x4172('0x35')](_0x4c8104,['id',_0x7bbb80['id']]);if(_0x69fb25){_[_0x4172('0x36')](_0x7bbb80,_['pick'](_0x69fb25,_0xcf8e47));}return _0x7bbb80;});}exports[_0x4172('0x37')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 80a587d..b7ad763 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4607e1,_0x596f78){var _0x22f1b2=function(_0x122dcc){while(--_0x122dcc){_0x4607e1['push'](_0x4607e1['shift']());}};_0x22f1b2(++_0x596f78);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 bd21ae8..61d7a95 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 _0x47ad=['../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','md5','update','digest','hex','getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x47ad,0x10d));var _0xd47a=function(_0x108831,_0x5e4f70){_0x108831=_0x108831-0x0;var _0x4da77a=_0x47ad[_0x108831];return _0x4da77a;};'use strict';var _=require(_0xd47a('0x0'));var os=require('os');var crypto=require(_0xd47a('0x1'));var machine=require(_0xd47a('0x2'));var exec=require('child_process')['execSync'];var config=require(_0xd47a('0x3'));function getInterfaces(){var _0x283a6c=[];var _0x517372=os[_0xd47a('0x4')]();var _0xdaf93b=_[_0xd47a('0x5')](_[_0xd47a('0x6')](_0x517372));for(var _0x4b5944=0x0;_0x4b5944<_0xdaf93b[_0xd47a('0x7')];_0x4b5944++){var _0x4fad20=_0x517372[_0xdaf93b[_0x4b5944]][_0xd47a('0x8')](function(_0x3a56a9){return _0x3a56a9['family']===_0xd47a('0x9')&&_0x3a56a9['internal']===![];});_0x283a6c=_0x283a6c[_0xd47a('0xa')](_0x4fad20);}return _0x283a6c;}function getFirstInterface(){var _0x266f07=_[_0xd47a('0xb')](getInterfaces());return{'macAddress':_0x266f07&&_0x266f07['mac']?_0x266f07[_0xd47a('0xc')]:_0xd47a('0xd'),'ipAddress':_0x266f07&&_0x266f07[_0xd47a('0xe')]?_0x266f07['address']:_0xd47a('0xf')};}exports[_0xd47a('0x10')]=getFirstInterface;function getCPUhash(){var _0x2f66a5=_[_0xd47a('0x5')](os[_0xd47a('0x11')]()['map'](function(_0x518bb4){return _0x518bb4[_0xd47a('0x12')];}))[_0xd47a('0x13')](':');return crypto['createHash'](_0xd47a('0x14'))[_0xd47a('0x15')](_0x2f66a5)[_0xd47a('0x16')](_0xd47a('0x17'));}exports[_0xd47a('0x18')]=function(){var _0x147dbd=os['platform']();var _0x3fb66e=/[0-9a-f-]{36}/;if(config[_0xd47a('0x19')]&&_0x3fb66e['test'](config[_0xd47a('0x19')])){return config['licenseToken'];}else if(_0x147dbd===_0xd47a('0x1a')){return exec(_0xd47a('0x1b'),{'encoding':_0xd47a('0x1c')})[_0xd47a('0x1d')]('\x0d\x0a','');}else{var _0x41f40e=getFirstInterface();var _0x15728a=getCPUhash();var _0x257979=_0x15728a+'|'+os[_0xd47a('0x1e')]()+'|'+_0x41f40e[_0xd47a('0x1f')]+'|'+_0x41f40e[_0xd47a('0x20')];var _0x17081c=crypto['createHash'](_0xd47a('0x14'))[_0xd47a('0x15')](_0x257979)[_0xd47a('0x16')](_0xd47a('0x17'));return _0x17081c[_0xd47a('0x21')](0x0,0x8)+'-'+_0x17081c['substring'](0x8,0xc)+'-'+_0x17081c[_0xd47a('0x21')](0xc,0x10)+'-'+_0x17081c[_0xd47a('0x21')](0x10,0x14)+'-'+_0x17081c[_0xd47a('0x21')](0x14);}}; \ No newline at end of file +var _0x277d=['internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','md5','update','digest','hex','getUuid','test','licenseToken','win32','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','child_process','networkInterfaces','orderBy','keys','length','filter','family','IPv4'];(function(_0xf7ad88,_0x2b01e8){var _0x26d6c4=function(_0x1435e9){while(--_0x1435e9){_0xf7ad88['push'](_0xf7ad88['shift']());}};_0x26d6c4(++_0x2b01e8);}(_0x277d,0x1ca));var _0xd277=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x277d[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd277('0x0'));var os=require('os');var crypto=require(_0xd277('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xd277('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x220aea=[];var _0x14d250=os[_0xd277('0x3')]();var _0x28ee7a=_[_0xd277('0x4')](_[_0xd277('0x5')](_0x14d250));for(var _0x1fc5c1=0x0;_0x1fc5c1<_0x28ee7a[_0xd277('0x6')];_0x1fc5c1++){var _0x5bb325=_0x14d250[_0x28ee7a[_0x1fc5c1]][_0xd277('0x7')](function(_0x4b2d0b){return _0x4b2d0b[_0xd277('0x8')]===_0xd277('0x9')&&_0x4b2d0b[_0xd277('0xa')]===![];});_0x220aea=_0x220aea[_0xd277('0xb')](_0x5bb325);}return _0x220aea;}function getFirstInterface(){var _0x26a8aa=_[_0xd277('0xc')](getInterfaces());return{'macAddress':_0x26a8aa&&_0x26a8aa[_0xd277('0xd')]?_0x26a8aa['mac']:_0xd277('0xe'),'ipAddress':_0x26a8aa&&_0x26a8aa[_0xd277('0xf')]?_0x26a8aa[_0xd277('0xf')]:_0xd277('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x3ec393=_[_0xd277('0x4')](os[_0xd277('0x11')]()[_0xd277('0x12')](function(_0x1b0a6d){return _0x1b0a6d[_0xd277('0x13')];}))[_0xd277('0x14')](':');return crypto['createHash'](_0xd277('0x15'))[_0xd277('0x16')](_0x3ec393)[_0xd277('0x17')](_0xd277('0x18'));}exports[_0xd277('0x19')]=function(){var _0x528156=os['platform']();var _0x4337bd=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4337bd[_0xd277('0x1a')](config['licenseToken'])){return config[_0xd277('0x1b')];}else if(_0x528156===_0xd277('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xd277('0x1d')})[_0xd277('0x1e')]('\x0d\x0a','');}else{var _0x2c534e=getFirstInterface();var _0x2b255e=getCPUhash();var _0x3b46b5=_0x2b255e+'|'+os[_0xd277('0x1f')]()+'|'+_0x2c534e[_0xd277('0x20')]+'|'+_0x2c534e[_0xd277('0x21')];var _0x10a07c=crypto[_0xd277('0x22')](_0xd277('0x15'))['update'](_0x3b46b5)[_0xd277('0x17')](_0xd277('0x18'));return _0x10a07c[_0xd277('0x23')](0x0,0x8)+'-'+_0x10a07c[_0xd277('0x23')](0x8,0xc)+'-'+_0x10a07c[_0xd277('0x23')](0xc,0x10)+'-'+_0x10a07c[_0xd277('0x23')](0x10,0x14)+'-'+_0x10a07c[_0xd277('0x23')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index dd70270..17f7642 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 _0x95c6=['error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','get','data1','data2','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x344294,_0x5bd8c5){var _0x14a5e4=function(_0x59a62f){while(--_0x59a62f){_0x344294['push'](_0x344294['shift']());}};_0x14a5e4(++_0x5bd8c5);}(_0x95c6,0x1b7));var _0x695c=function(_0x5703d5,_0x125ba7){_0x5703d5=_0x5703d5-0x0;var _0x1e4625=_0x95c6[_0x5703d5];return _0x1e4625;};'use strict';var util=require(_0x695c('0x0'));var moment=require('moment');var rp=require(_0x695c('0x1'));var BPromise=require(_0x695c('0x2'));var pkginfo=require(_0x695c('0x3'))(module,_0x695c('0x4'));var db=require(_0x695c('0x5'))['db'];var encryptor=require(_0x695c('0x6'));var hardware=require(_0x695c('0x7'));var logger=require(_0x695c('0x8'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4967a0){return new BPromise(function(_0x25a968,_0x1367ba){var _0x383c8a=util['format'](_0x695c('0x9'),HOST,_0x4967a0,module['exports']['version']);if(oldToken){_0x383c8a=util[_0x695c('0xa')](_0x695c('0xb'),HOST,_0x4967a0,module[_0x695c('0xc')][_0x695c('0x4')],oldToken);}var _0x33b989={'uri':_0x383c8a,'method':_0x695c('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x33b989)[_0x695c('0xe')](function(_0x2266e6){_0x25a968(_0x2266e6);})['catch'](function(_0x594648){_0x1367ba(_0x594648);});});}function manageLicense(_0x39afca,_0x4fdbb4){var _0x4bde80=_0x4fdbb4[_0x695c('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x4bde80[_0x695c('0x10')]!==_0x39afca&&!_0x4bde80[_0x695c('0x11')]){oldToken=_0x4bde80[_0x695c('0x10')];}httpRequest(_0x39afca)[_0x695c('0xe')](function(_0x2b4086){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2b4086['active']){isOldTokenSent=![];if(!_0x4bde80[_0x695c('0x12')]&&_0x4bde80[_0x695c('0x12')]!=_0x2b4086['license']||_0x4bde80[_0x695c('0x12')]&&_0x4bde80[_0x695c('0x11')]){logger[_0x695c('0x13')](_0x695c('0x14'));}if(_0x4bde80['license']&&!_0x4bde80[_0x695c('0x11')]&&_0x4bde80[_0x695c('0x12')]!=_0x2b4086[_0x695c('0x12')]){logger['info'](_0x695c('0x15'));}if(_0x4bde80[_0x695c('0x12')]&&!_0x4bde80[_0x695c('0x11')]&&_0x4bde80['license']==_0x2b4086[_0x695c('0x12')]){return _0x4fdbb4;}return _0x4fdbb4[_0x695c('0x16')]({'data1':_0x39afca,'data2':null,'license':_0x2b4086['license']});}else{if(_0x2b4086['license']||_0x4bde80[_0x695c('0x12')]){if(!_0x4bde80[_0x695c('0x11')]){if(_0x4bde80[_0x695c('0x10')]==_0x39afca){GRAY_PERIOD_REASON=_0x695c('0x17');logger['info'](_0x695c('0x18'));}else{GRAY_PERIOD_REASON=_0x695c('0x19');logger[_0x695c('0x13')](_0x695c('0x1a'),_0x4bde80[_0x695c('0x10')],_0x39afca);}logger[_0x695c('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x695c('0x1b')](),moment()[_0x695c('0xa')](_0x695c('0x1c')));return _0x4fdbb4['update']({'data2':encryptor[_0x695c('0x1d')](moment()[_0x695c('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x695c('0x1e')](encryptor[_0x695c('0x1f')](_0x4bde80[_0x695c('0x11')]),_0x695c('0x20'))>DAYS){logger[_0x695c('0x13')](_0x695c('0x21'),moment()[_0x695c('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4fdbb4['update']({'data1':_0x39afca,'data2':null,'license':null});}}}else{if(_0x4bde80[_0x695c('0x10')]!=_0x39afca){logger[_0x695c('0x13')](_0x695c('0x1a'),_0x4bde80['data1'],_0x39afca);return _0x4fdbb4[_0x695c('0x16')]({'data1':_0x39afca,'data2':null,'license':null});}}}return _0x4fdbb4;})[_0x695c('0xe')](function(_0x4dc6de){_0x4fdbb4=_0x4dc6de;})['catch'](function(_0x480fea){logger[_0x695c('0x22')](_0x480fea[_0x695c('0x23')]);})[_0x695c('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x695c('0x25')](),_0x4fdbb4);},TIME);});}function defaultLicense(){var _0x1917c2=hardware[_0x695c('0x25')]();if(_0x1917c2){return db[_0x695c('0x26')][_0x695c('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x1917c2}})[_0x695c('0x28')](function(_0x1f4e14,_0xe626ec){logger['info'](_0x695c('0x29'),_0x1917c2);manageLicense(_0x1917c2,_0x1f4e14);})[_0x695c('0x2a')](function(_0x5119a6){logger[_0x695c('0x22')](_0x5119a6[_0x695c('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x88d9=['../../components/encryptor','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','update','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','util','moment','request-promise','bluebird','pkginfo','version'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x88d9,0x1c8));var _0x988d=function(_0x5b23c6,_0xe2cbad){_0x5b23c6=_0x5b23c6-0x0;var _0x3a4920=_0x88d9[_0x5b23c6];return _0x3a4920;};'use strict';var util=require(_0x988d('0x0'));var moment=require(_0x988d('0x1'));var rp=require(_0x988d('0x2'));var BPromise=require(_0x988d('0x3'));var pkginfo=require(_0x988d('0x4'))(module,_0x988d('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x988d('0x6'));var hardware=require('./hardware');var logger=require(_0x988d('0x7'))(_0x988d('0x8'));var HOST=_0x988d('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x45b247){return new BPromise(function(_0x538bc3,_0x493f98){var _0xbc2552=util['format'](_0x988d('0xa'),HOST,_0x45b247,module[_0x988d('0xb')][_0x988d('0x5')]);if(oldToken){_0xbc2552=util[_0x988d('0xc')](_0x988d('0xd'),HOST,_0x45b247,module[_0x988d('0xb')]['version'],oldToken);}var _0x44a62a={'uri':_0xbc2552,'method':_0x988d('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x44a62a)[_0x988d('0xf')](function(_0x2b83d7){_0x538bc3(_0x2b83d7);})[_0x988d('0x10')](function(_0x23b75b){_0x493f98(_0x23b75b);});});}function manageLicense(_0x4ee295,_0x4af711){var _0xaa862e=_0x4af711[_0x988d('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0xaa862e[_0x988d('0x12')]!==_0x4ee295&&!_0xaa862e[_0x988d('0x13')]){oldToken=_0xaa862e[_0x988d('0x12')];}httpRequest(_0x4ee295)['then'](function(_0x30f0dc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x30f0dc[_0x988d('0x14')]){isOldTokenSent=![];if(!_0xaa862e[_0x988d('0x8')]&&_0xaa862e[_0x988d('0x8')]!=_0x30f0dc['license']||_0xaa862e[_0x988d('0x8')]&&_0xaa862e[_0x988d('0x13')]){logger[_0x988d('0x15')](_0x988d('0x16'));}if(_0xaa862e[_0x988d('0x8')]&&!_0xaa862e[_0x988d('0x13')]&&_0xaa862e[_0x988d('0x8')]!=_0x30f0dc['license']){logger[_0x988d('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xaa862e['license']&&!_0xaa862e[_0x988d('0x13')]&&_0xaa862e[_0x988d('0x8')]==_0x30f0dc[_0x988d('0x8')]){return _0x4af711;}return _0x4af711['update']({'data1':_0x4ee295,'data2':null,'license':_0x30f0dc['license']});}else{if(_0x30f0dc['license']||_0xaa862e['license']){if(!_0xaa862e['data2']){if(_0xaa862e[_0x988d('0x12')]==_0x4ee295){GRAY_PERIOD_REASON=_0x988d('0x17');logger[_0x988d('0x15')](_0x988d('0x18'));}else{GRAY_PERIOD_REASON=_0x988d('0x19');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xaa862e[_0x988d('0x12')],_0x4ee295);}logger[_0x988d('0x15')](_0x988d('0x1a'),GRAY_PERIOD_REASON[_0x988d('0x1b')](),moment()[_0x988d('0xc')](_0x988d('0x1c')));return _0x4af711['update']({'data2':encryptor[_0x988d('0x1d')](moment()['format'](_0x988d('0x1c')))});}else{if(moment()[_0x988d('0x1e')](encryptor[_0x988d('0x1f')](_0xaa862e['data2']),_0x988d('0x20'))>DAYS){logger[_0x988d('0x15')](_0x988d('0x21'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4af711[_0x988d('0x22')]({'data1':_0x4ee295,'data2':null,'license':null});}}}else{if(_0xaa862e[_0x988d('0x12')]!=_0x4ee295){logger[_0x988d('0x15')](_0x988d('0x23'),_0xaa862e[_0x988d('0x12')],_0x4ee295);return _0x4af711[_0x988d('0x22')]({'data1':_0x4ee295,'data2':null,'license':null});}}}return _0x4af711;})[_0x988d('0xf')](function(_0x5716e9){_0x4af711=_0x5716e9;})[_0x988d('0x10')](function(_0x5ce3b2){logger['error'](_0x5ce3b2['message']);})[_0x988d('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x988d('0x25')](),_0x4af711);},TIME);});}function defaultLicense(){var _0x5eeb8d=hardware[_0x988d('0x25')]();if(_0x5eeb8d){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x5eeb8d}})[_0x988d('0x26')](function(_0x490429,_0x14f508){logger['info'](_0x988d('0x27'),_0x5eeb8d);manageLicense(_0x5eeb8d,_0x490429);})['catch'](function(_0x5ced13){logger[_0x988d('0x28')](_0x5ced13[_0x988d('0x29')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index ceac188..c554026 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 _0xb115=['lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','find','defaults','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','uuid','machineUuid','grayReason','disabled','message','then','User','findAll','role','sequelize','col','count','user','telephone','telephones','forEach','admin','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util'];(function(_0x40d032,_0x86acd4){var _0x2cdec1=function(_0x21b4f6){while(--_0x21b4f6){_0x40d032['push'](_0x40d032['shift']());}};_0x2cdec1(++_0x86acd4);}(_0xb115,0x18b));var _0x5b11=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb115[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x5b11('0x0'));var _=require(_0x5b11('0x1'));var moment=require(_0x5b11('0x2'));var BPromise=require(_0x5b11('0x3'));var hardware=require(_0x5b11('0x4'));var encryptor=require(_0x5b11('0x5'));var db=require(_0x5b11('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5b11('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5b11('0x8'),'machineUuid':hardware[_0x5b11('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x5b11('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xf0192e){return new BPromise(function(_0x2001cb,_0x290a9c){return db['License'][_0x5b11('0xa')](_[_0x5b11('0xb')](_0xf0192e,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2e4af3){return checkLicense(_0x2e4af3,null);})['then'](function(_0x17d755){_0x2001cb(_0x17d755);return;})['catch'](function(_0x433057){_0x290a9c(_0x433057);});});}function checkLicense(_0x5538c9,_0x4cf849){if(!_0x5538c9){demoLicense['uuid']=_0x5538c9[_0x5b11('0xc')];return demoLicense;}try{var _0x54e368=_0x4cf849||_0x5538c9[_0x5b11('0xd')];if(_[_0x5b11('0xe')](_0x54e368)){throw new Error(_0x5b11('0xf'));}var _0x1ad058=_0x5538c9[_0x5b11('0xc')];var _0x1aa0e5=_0x5538c9[_0x5b11('0x10')];var _0x2ffea9=_0x1ad058[_0x5b11('0x11')]('-')[0x4];var _0x4a8c26=_0x1ad058['split']('-')[0x0];var _0x244ade=encryptor[_0x5b11('0x12')](_0x54e368,util[_0x5b11('0x13')](_0x5b11('0x14'),_0x2ffea9,_0x1ad058,_0x4a8c26));var _0x25eae1=JSON['parse'](_0x244ade);_0x25eae1[_0x5b11('0x15')]=![];_0x25eae1[_0x5b11('0x16')]=_0x1ad058;_0x25eae1[_0x5b11('0x17')]=hardware[_0x5b11('0x9')]();if(_0x1aa0e5){var _0x1cf72f=encryptor[_0x5b11('0x12')](_0x1aa0e5);_0x25eae1['gray']=_0x1cf72f;_0x25eae1['deadline']=moment(_0x1cf72f)['add'](0x7,'days')['format']();_0x25eae1[_0x5b11('0x18')]=_0x25eae1[_0x5b11('0x16')]!=_0x25eae1['machineUuid']?'changed':_0x5b11('0x19');}return _0x25eae1;}catch(_0x221556){breakingLicense[_0x5b11('0x16')]=_0x5538c9['data1'];breakingLicense[_0x5b11('0x1a')]=_0x221556[_0x5b11('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x63b943,_0xc2e267){getLicense()[_0x5b11('0x1b')](function(_0x46ecb0){return db[_0x5b11('0x1c')][_0x5b11('0x1d')]({'attributes':[_0x5b11('0x1e'),[db[_0x5b11('0x1f')]['fn']('COUNT',db['sequelize'][_0x5b11('0x20')](_0x5b11('0x1e'))),_0x5b11('0x21')]],'group':_0x5b11('0x1e'),'where':{'role':{'$or':['admin',_0x5b11('0x22'),_0x5b11('0x23')]}},'raw':!![]})['then'](function(_0x4fd7d5){var _0x5ecb1f={'user':_0x46ecb0['users']||0x0,'telephone':_0x46ecb0[_0x5b11('0x24')]||0x0};_0x4fd7d5[_0x5b11('0x25')](function(_0x85112c){var _0x592a95=_0x85112c[_0x5b11('0x1e')]===_0x5b11('0x26')?_0x5b11('0x22'):_0x85112c[_0x5b11('0x1e')];_0x5ecb1f[_0x592a95]-=_0x85112c[_0x5b11('0x21')];if(_0x5ecb1f[_0x592a95]<0x0)_0x5ecb1f[_0x592a95]=0x0;});_0x63b943(_0x5ecb1f);return;});})[_0x5b11('0x27')](function(_0x1a1a3a){_0xc2e267(_0x1a1a3a);});});}function checkUserLimits(_0x3ca1d3){return new BPromise(function(_0x30030d,_0x434e90){getLimits()['then'](function(_0x19c4f6){var _0x1a70e3=_[_0x5b11('0x28')](_[_0x5b11('0x29')](_0x3ca1d3,_0x5b11('0x1e')),[_0x5b11('0x26'),_0x5b11('0x22'),_0x5b11('0x23')]);var _0xdc34c4=(_0x1a70e3[_0x5b11('0x26')]||0x0)+(_0x1a70e3[_0x5b11('0x22')]||0x0);var _0x436e49=_0x1a70e3[_0x5b11('0x23')]||0x0;if(_0xdc34c4>_0x19c4f6[_0x5b11('0x22')])return _0x434e90(_0x5b11('0x2a'));if(_0x436e49>_0x19c4f6[_0x5b11('0x23')])return _0x434e90('License\x20limit\x20reached\x20for\x20telephones');return _0x30030d();})[_0x5b11('0x27')](function(_0x409a65){_0x434e90(_0x409a65);});});}module[_0x5b11('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x7e9e=['telephone','users','forEach','admin','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','find','defaults','then','catch','uuid','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','demo','deadline','add','days','grayReason','machineUuid','changed','message','sequelize','col','role','user'];(function(_0x587d73,_0x3566bf){var _0x3aaf5b=function(_0x45b214){while(--_0x45b214){_0x587d73['push'](_0x587d73['shift']());}};_0x3aaf5b(++_0x3566bf);}(_0x7e9e,0x117));var _0xe7e9=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0x7e9e[_0x5f746f];return _0x198d15;};'use strict';var util=require(_0xe7e9('0x0'));var _=require(_0xe7e9('0x1'));var moment=require(_0xe7e9('0x2'));var BPromise=require(_0xe7e9('0x3'));var hardware=require(_0xe7e9('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0xe7e9('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe7e9('0x6'),'machineUuid':hardware[_0xe7e9('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe7e9('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe7e9('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4d637c){return new BPromise(function(_0x1d24f8,_0x49d65f){return db['License'][_0xe7e9('0xa')](_[_0xe7e9('0xb')](_0x4d637c,{'raw':!![],'where':{'id':0x1}}))[_0xe7e9('0xc')](function(_0x40180c){return checkLicense(_0x40180c,null);})[_0xe7e9('0xc')](function(_0xe90ef2){_0x1d24f8(_0xe90ef2);return;})[_0xe7e9('0xd')](function(_0x59e765){_0x49d65f(_0x59e765);});});}function checkLicense(_0x365861,_0x13fd42){if(!_0x365861){demoLicense[_0xe7e9('0xe')]=_0x365861['data1'];return demoLicense;}try{var _0x58eb6e=_0x13fd42||_0x365861['license'];if(_[_0xe7e9('0xf')](_0x58eb6e)){throw new Error(_0xe7e9('0x10'));}var _0x175602=_0x365861[_0xe7e9('0x11')];var _0x204a31=_0x365861[_0xe7e9('0x12')];var _0xa64321=_0x175602[_0xe7e9('0x13')]('-')[0x4];var _0x5ee2e3=_0x175602['split']('-')[0x0];var _0xfe4ade=encryptor[_0xe7e9('0x14')](_0x58eb6e,util[_0xe7e9('0x15')](_0xe7e9('0x16'),_0xa64321,_0x175602,_0x5ee2e3));var _0x1981c8=JSON[_0xe7e9('0x17')](_0xfe4ade);_0x1981c8[_0xe7e9('0x18')]=![];_0x1981c8[_0xe7e9('0xe')]=_0x175602;_0x1981c8['machineUuid']=hardware[_0xe7e9('0x7')]();if(_0x204a31){var _0x3b19fb=encryptor[_0xe7e9('0x14')](_0x204a31);_0x1981c8['gray']=_0x3b19fb;_0x1981c8[_0xe7e9('0x19')]=moment(_0x3b19fb)[_0xe7e9('0x1a')](0x7,_0xe7e9('0x1b'))['format']();_0x1981c8[_0xe7e9('0x1c')]=_0x1981c8['uuid']!=_0x1981c8[_0xe7e9('0x1d')]?_0xe7e9('0x1e'):'disabled';}return _0x1981c8;}catch(_0x57086a){breakingLicense[_0xe7e9('0xe')]=_0x365861[_0xe7e9('0x11')];breakingLicense[_0xe7e9('0x1f')]=_0x57086a[_0xe7e9('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x43ffac,_0x526f86){getLicense()['then'](function(_0x8f397d){return db['User']['findAll']({'attributes':['role',[db[_0xe7e9('0x20')]['fn']('COUNT',db[_0xe7e9('0x20')][_0xe7e9('0x21')]('role')),'count']],'group':_0xe7e9('0x22'),'where':{'role':{'$or':['admin',_0xe7e9('0x23'),_0xe7e9('0x24')]}},'raw':!![]})['then'](function(_0x26b9b8){var _0x1fd1b4={'user':_0x8f397d[_0xe7e9('0x25')]||0x0,'telephone':_0x8f397d['telephones']||0x0};_0x26b9b8[_0xe7e9('0x26')](function(_0x1fa5ca){var _0x2bcb88=_0x1fa5ca[_0xe7e9('0x22')]===_0xe7e9('0x27')?_0xe7e9('0x23'):_0x1fa5ca[_0xe7e9('0x22')];_0x1fd1b4[_0x2bcb88]-=_0x1fa5ca[_0xe7e9('0x28')];if(_0x1fd1b4[_0x2bcb88]<0x0)_0x1fd1b4[_0x2bcb88]=0x0;});_0x43ffac(_0x1fd1b4);return;});})[_0xe7e9('0xd')](function(_0x1b6880){_0x526f86(_0x1b6880);});});}function checkUserLimits(_0x447559){return new BPromise(function(_0x15cdf1,_0x20f34e){getLimits()[_0xe7e9('0xc')](function(_0x5835bd){var _0x971e6b=_[_0xe7e9('0x29')](_[_0xe7e9('0x2a')](_0x447559,_0xe7e9('0x22')),[_0xe7e9('0x27'),_0xe7e9('0x23'),_0xe7e9('0x24')]);var _0x155e47=(_0x971e6b['admin']||0x0)+(_0x971e6b['user']||0x0);var _0x4bc994=_0x971e6b[_0xe7e9('0x24')]||0x0;if(_0x155e47>_0x5835bd[_0xe7e9('0x23')])return _0x20f34e(_0xe7e9('0x2b'));if(_0x4bc994>_0x5835bd[_0xe7e9('0x24')])return _0x20f34e(_0xe7e9('0x2c'));return _0x15cdf1();})[_0xe7e9('0xd')](function(_0x1f4771){_0x20f34e(_0x1f4771);});});}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 a6d743c..3da74a7 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1e3=['http://localhost:9000','app-id','exports'];(function(_0x1d5cbb,_0x425e7f){var _0x1da5d5=function(_0x462f8d){while(--_0x462f8d){_0x1d5cbb['push'](_0x1d5cbb['shift']());}};_0x1da5d5(++_0x425e7f);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x2e212a,_0x34051a){_0x2e212a=_0x2e212a-0x0;var _0x291e40=_0xe1e3[_0x2e212a];return _0x291e40;};'use strict';module[_0x3e1e('0x0')]={'DOMAIN':_0x3e1e('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x3e1e('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x5464=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x45cd35,_0x41147c){var _0x16db84=function(_0x1ce5e9){while(--_0x1ce5e9){_0x45cd35['push'](_0x45cd35['shift']());}};_0x16db84(++_0x41147c);}(_0x5464,0x15d));var _0x4546=function(_0x207987,_0x16226e){_0x207987=_0x207987-0x0;var _0x4d30c9=_0x5464[_0x207987];return _0x4d30c9;};'use strict';module[_0x4546('0x0')]={'DOMAIN':_0x4546('0x1'),'SESSION_SECRET':_0x4546('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x4546('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 2a7ed8b..736ca75 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87b2=['../utils/loggers'];(function(_0x2a43fc,_0x3f309f){var _0x3c5022=function(_0x257102){while(--_0x257102){_0x2a43fc['push'](_0x2a43fc['shift']());}};_0x3c5022(++_0x3f309f);}(_0x87b2,0xa7));var _0x287b=function(_0x288792,_0x52c342){_0x288792=_0x288792-0x0;var _0x1acecc=_0x87b2[_0x288792];return _0x1acecc;};'use strict';var fileLogger=require(_0x287b('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file +var _0xe158=['fileLogger','exports','../utils/loggers'];(function(_0xb39e78,_0xeaae8b){var _0x12fc00=function(_0x5b5847){while(--_0x5b5847){_0xb39e78['push'](_0xb39e78['shift']());}};_0x12fc00(++_0xeaae8b);}(_0xe158,0x122));var _0x8e15=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0xe158[_0x1ab0e6];return _0x248815;};'use strict';var fileLogger=require(_0x8e15('0x0'))[_0x8e15('0x1')];module[_0x8e15('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c7babbb..7890ba2 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 _0x14b5=['../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','join'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x14b5,0x1e7));var _0x514b=function(_0x882544,_0x51d29d){_0x882544=_0x882544-0x0;var _0x20b5f7=_0x14b5[_0x882544];return _0x20b5f7;};'use strict';var path=require(_0x514b('0x0'));var cfg=require(_0x514b('0x1'));var env={'NODE_PATH':path['resolve'](path[_0x514b('0x2')](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0x514b('0x2')](__dirname,_0x514b('0x3')),'env':env},{'name':_0x514b('0x4'),'script':path['join'](__dirname,_0x514b('0x5')),'env':env},{'name':_0x514b('0x6'),'script':path[_0x514b('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x514b('0x7'),'script':path[_0x514b('0x2')](__dirname,_0x514b('0x8')),'env':env},{'name':_0x514b('0x9'),'script':path[_0x514b('0x2')](__dirname,_0x514b('0xa')),'env':env},{'name':_0x514b('0xb'),'script':path[_0x514b('0x2')](__dirname,_0x514b('0xc')),'env':env}]};module[_0x514b('0xd')]=pm2config; \ No newline at end of file +var _0x08ac=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','express','../../services/express/index.js','ami'];(function(_0x580222,_0x2a4a8f){var _0x3ecea9=function(_0x2e261b){while(--_0x2e261b){_0x580222['push'](_0x580222['shift']());}};_0x3ecea9(++_0x2a4a8f);}(_0x08ac,0x152));var _0xc08a=function(_0x3f731b,_0x5bb0fd){_0x3f731b=_0x3f731b-0x0;var _0x6ae4cd=_0x08ac[_0x3f731b];return _0x6ae4cd;};'use strict';var path=require(_0xc08a('0x0'));var cfg=require(_0xc08a('0x1'));var env={'NODE_PATH':path[_0xc08a('0x2')](path[_0xc08a('0x3')](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':_0xc08a('0x4'),'script':path['join'](__dirname,_0xc08a('0x5')),'env':env},{'name':_0xc08a('0x6'),'script':path[_0xc08a('0x3')](__dirname,_0xc08a('0x7')),'env':env},{'name':_0xc08a('0x8'),'script':path[_0xc08a('0x3')](__dirname,_0xc08a('0x9')),'env':env},{'name':_0xc08a('0xa'),'script':path['join'](__dirname,_0xc08a('0xb')),'env':env},{'name':'routing','script':path[_0xc08a('0x3')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0xc08a('0xc'),'script':path['join'](__dirname,_0xc08a('0xd')),'env':env}]};module[_0xc08a('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7ec43f4..87a52d1 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 _0xb0ee=['list','delete','dump','pm2','start','disconnect','then','stop','restart'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb0ee,0xed));var _0xeb0e=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xb0ee[_0x2112d4];return _0x434972;};'use strict';var pm2=require(_0xeb0e('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x3e6a14,_0x40b599){return pm2['connect'](function(_0x3cea61){if(_0x3cea61){return _0x40b599(_0x3cea61);}return _0x3e6a14('connected');});});};exports[_0xeb0e('0x1')]=function(_0x17385c){return connect()['then'](function(){return new BPromise(function(_0x596ca7,_0xce0ab3){return pm2['start'](_0x17385c,function(_0x5d47a2,_0x18f0d5){if(_0x5d47a2){return _0xce0ab3(_0x5d47a2);}pm2[_0xeb0e('0x2')]();return _0x596ca7(_0x18f0d5);});});});};exports['stop']=function(_0x3ac0f7){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x21b492,_0x476745){return pm2[_0xeb0e('0x4')](_0x3ac0f7,function(_0x22ab07,_0x5143db){if(_0x22ab07){return _0x476745(_0x22ab07);}pm2[_0xeb0e('0x2')]();return _0x21b492(_0x5143db);});});});};exports[_0xeb0e('0x5')]=function(_0x273ba3){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x1a51e4,_0x23e92d){return pm2[_0xeb0e('0x5')](_0x273ba3,function(_0x45e324,_0xb3b5c9){if(_0x45e324){return _0x23e92d(_0x45e324);}pm2[_0xeb0e('0x2')]();return _0x1a51e4(_0xb3b5c9);});});});};exports[_0xeb0e('0x6')]=function(){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x43bfe4,_0x1d71bf){return pm2['list'](function(_0xb331ca,_0x41b2fb){if(_0xb331ca){return _0x1d71bf(_0xb331ca);}pm2[_0xeb0e('0x2')]();return _0x43bfe4(_0x41b2fb);});});});};exports['describe']=function(_0x59f906){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x3dd98f,_0x5da19b){return pm2['describe'](_0x59f906,function(_0x41c847,_0x5aaebf){if(_0x41c847){return _0x5da19b(_0x41c847);}pm2[_0xeb0e('0x2')]();return _0x3dd98f(_0x5aaebf);});});});};exports[_0xeb0e('0x7')]=function(_0x132066){return connect()['then'](function(){return new BPromise(function(_0x48b7fa,_0x112844){return pm2[_0xeb0e('0x7')](_0x132066,function(_0x5b80c8,_0x45badb){if(_0x5b80c8){return _0x112844(_0x5b80c8);}pm2[_0xeb0e('0x2')]();return _0x48b7fa(_0x45badb);});});});};exports[_0xeb0e('0x8')]=function(){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x3ba49c,_0x4f3cec){return pm2[_0xeb0e('0x8')](function(_0x579fda){if(_0x579fda){return _0x4f3cec(_0x579fda);}return _0x3ba49c('saved');});});});}; \ No newline at end of file +var _0x415c=['dump','saved','pm2','./config','connect','connected','start','then','disconnect','stop','list','describe','delete'];(function(_0x176129,_0x721b4a){var _0x218260=function(_0x3b4520){while(--_0x3b4520){_0x176129['push'](_0x176129['shift']());}};_0x218260(++_0x721b4a);}(_0x415c,0xdf));var _0xc415=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x415c[_0x1ca890];return _0x3f8e01;};'use strict';var pm2=require(_0xc415('0x0'));var BPromise=require('bluebird');var config=require(_0xc415('0x1'));function connect(){return new BPromise(function(_0x968986,_0x5ee730){return pm2[_0xc415('0x2')](function(_0x46a077){if(_0x46a077){return _0x5ee730(_0x46a077);}return _0x968986(_0xc415('0x3'));});});};exports[_0xc415('0x4')]=function(_0x322ddf){return connect()[_0xc415('0x5')](function(){return new BPromise(function(_0x1c0b8a,_0x2e57dd){return pm2[_0xc415('0x4')](_0x322ddf,function(_0x16e623,_0x40c3a5){if(_0x16e623){return _0x2e57dd(_0x16e623);}pm2[_0xc415('0x6')]();return _0x1c0b8a(_0x40c3a5);});});});};exports[_0xc415('0x7')]=function(_0x65b306){return connect()[_0xc415('0x5')](function(){return new BPromise(function(_0x378bcf,_0xede3bb){return pm2[_0xc415('0x7')](_0x65b306,function(_0x1c1ebf,_0x4b2e8a){if(_0x1c1ebf){return _0xede3bb(_0x1c1ebf);}pm2[_0xc415('0x6')]();return _0x378bcf(_0x4b2e8a);});});});};exports['restart']=function(_0x40219b){return connect()[_0xc415('0x5')](function(){return new BPromise(function(_0x495f00,_0x344ba4){return pm2['restart'](_0x40219b,function(_0x5618c7,_0x4e6c32){if(_0x5618c7){return _0x344ba4(_0x5618c7);}pm2[_0xc415('0x6')]();return _0x495f00(_0x4e6c32);});});});};exports[_0xc415('0x8')]=function(){return connect()[_0xc415('0x5')](function(){return new BPromise(function(_0x20b609,_0x54171b){return pm2[_0xc415('0x8')](function(_0x544918,_0x27ff94){if(_0x544918){return _0x54171b(_0x544918);}pm2[_0xc415('0x6')]();return _0x20b609(_0x27ff94);});});});};exports[_0xc415('0x9')]=function(_0x5d020d){return connect()[_0xc415('0x5')](function(){return new BPromise(function(_0x3b03ee,_0x3b85a6){return pm2[_0xc415('0x9')](_0x5d020d,function(_0x28314f,_0x34c2dd){if(_0x28314f){return _0x3b85a6(_0x28314f);}pm2[_0xc415('0x6')]();return _0x3b03ee(_0x34c2dd);});});});};exports[_0xc415('0xa')]=function(_0x5e89be){return connect()['then'](function(){return new BPromise(function(_0xf92dc5,_0x49260d){return pm2[_0xc415('0xa')](_0x5e89be,function(_0x32a73a,_0x44b43b){if(_0x32a73a){return _0x49260d(_0x32a73a);}pm2[_0xc415('0x6')]();return _0xf92dc5(_0x44b43b);});});});};exports[_0xc415('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1cdedf,_0xa95ee5){return pm2[_0xc415('0xb')](function(_0x380d9a){if(_0x380d9a){return _0xa95ee5(_0x380d9a);}return _0x1cdedf(_0xc415('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index fbee9db..e347a56 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 _0x715c=['inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x3d8185,_0x241999){var _0x418a3d=function(_0x21ba8b){while(--_0x21ba8b){_0x3d8185['push'](_0x3d8185['shift']());}};_0x418a3d(++_0x241999);}(_0x715c,0xfa));var _0xc715=function(_0x5a9ff7,_0x377f07){_0x5a9ff7=_0x5a9ff7-0x0;var _0x26572e=_0x715c[_0x5a9ff7];return _0x26572e;};'use strict';var _=require(_0xc715('0x0'));var moment=require('moment');var Redis=require(_0xc715('0x1'));var util=require(_0xc715('0x2'));var config=require(_0xc715('0x3'));var db=require(_0xc715('0x4'))['db'];var logger=require('../logger')(_0xc715('0x5'));config[_0xc715('0x6')]=_['defaults'](config['redis'],{'host':_0xc715('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x59b7bf=0x0;var _0x17dd02=[];return db[_0xc715('0x8')]['find']({'raw':!![],'attributes':['id',_0xc715('0x9')],'where':{'id':0x1}})[_0xc715('0xa')](function(_0x3f770f){_0x59b7bf=_0x3f770f[_0xc715('0x9')];if(_0x59b7bf){return db[_0xc715('0xb')][_0xc715('0xc')]({'raw':!![],'attributes':['id',_0xc715('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc715('0xe')](_0x3f770f[_0xc715('0x9')],'minutes')}}});}else{return[];}})[_0xc715('0xa')](function(_0x99360e){if(_0x99360e&&_0x99360e[_0xc715('0xf')]){_0x17dd02=_[_0xc715('0x10')](_0x99360e||[],'id');logger[_0xc715('0x11')](_0xc715('0x12'),_0x17dd02['join']());return db[_0xc715('0xb')][_0xc715('0x13')]({'closeReason':_0xc715('0x14'),'disposition':_0xc715('0x15'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x17dd02}});}})[_0xc715('0xa')](function(){if(_0x17dd02&&_0x17dd02[_0xc715('0xf')]){logger[_0xc715('0x11')](_0xc715('0x16'),_0x17dd02[_0xc715('0x17')]());for(var _0x1cdee7=0x0;_0x1cdee7<_0x17dd02['length'];_0x1cdee7++){io[_0xc715('0x18')](_0xc715('0x19'),{'id':_0x17dd02[_0x1cdee7],'closed':!![]});}}})[_0xc715('0x1a')](function(_0x4a15a3){logger[_0xc715('0x1b')](_0xc715('0x1c'),_0x4a15a3?util[_0xc715('0x1d')](_0x4a15a3,{'showHidden':![],'depth':null}):'');});}exports[_0xc715('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5d8e=['moment','util','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash'];(function(_0xd86d3,_0xe012cc){var _0x3b9fe4=function(_0x41c4eb){while(--_0x41c4eb){_0xd86d3['push'](_0xd86d3['shift']());}};_0x3b9fe4(++_0xe012cc);}(_0x5d8e,0x16b));var _0xe5d8=function(_0x4f66de,_0x336742){_0x4f66de=_0x4f66de-0x0;var _0x4ecc95=_0x5d8e[_0x4f66de];return _0x4ecc95;};'use strict';var _=require(_0xe5d8('0x0'));var moment=require(_0xe5d8('0x1'));var Redis=require('ioredis');var util=require(_0xe5d8('0x2'));var config=require('../../config/environment');var db=require(_0xe5d8('0x3'))['db'];var logger=require(_0xe5d8('0x4'))('schedule');config[_0xe5d8('0x5')]=_[_0xe5d8('0x6')](config[_0xe5d8('0x5')],{'host':_0xe5d8('0x7'),'port':0x18eb});var io=require(_0xe5d8('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x31e0f0=0x0;var _0x3fdd9f=[];return db[_0xe5d8('0x9')][_0xe5d8('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xe5d8('0xb')](function(_0x1c3217){_0x31e0f0=_0x1c3217[_0xe5d8('0xc')];if(_0x31e0f0){return db[_0xe5d8('0xd')]['findAll']({'raw':!![],'attributes':['id',_0xe5d8('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1c3217[_0xe5d8('0xc')],'minutes')}}});}else{return[];}})[_0xe5d8('0xb')](function(_0x306eaa){if(_0x306eaa&&_0x306eaa[_0xe5d8('0xf')]){_0x3fdd9f=_['map'](_0x306eaa||[],'id');logger[_0xe5d8('0x10')](_0xe5d8('0x11'),_0x3fdd9f[_0xe5d8('0x12')]());return db[_0xe5d8('0xd')]['update']({'closeReason':_0xe5d8('0x13'),'disposition':_0xe5d8('0x14'),'closed':!![],'closedAt':moment()[_0xe5d8('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3fdd9f}});}})[_0xe5d8('0xb')](function(){if(_0x3fdd9f&&_0x3fdd9f[_0xe5d8('0xf')]){logger[_0xe5d8('0x10')](_0xe5d8('0x16'),_0x3fdd9f[_0xe5d8('0x12')]());for(var _0x244122=0x0;_0x244122<_0x3fdd9f['length'];_0x244122++){io['emit']('chatInteraction:update',{'id':_0x3fdd9f[_0x244122],'closed':!![]});}}})[_0xe5d8('0x17')](function(_0x937570){logger[_0xe5d8('0x18')](_0xe5d8('0x19'),_0x937570?util[_0xe5d8('0x1a')](_0x937570,{'showHidden':![],'depth':null}):'');});}exports[_0xe5d8('0x1b')]=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 2f30b3b..fc38a36 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 _0xeb78=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2151d5,_0x32cda6){var _0x38ca81=function(_0x2a1746){while(--_0x2a1746){_0x2151d5['push'](_0x2151d5['shift']());}};_0x38ca81(++_0x32cda6);}(_0xeb78,0xe1));var _0x8eb7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb78[_0x321bb2];return _0x9c12ed;};'use strict';function start(){var _0x37cf52=require(_0x8eb7('0x0'));return _0x37cf52['startAllRefreshIntervals']();}module[_0x8eb7('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xaba8=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4a2ea2,_0x277520){var _0x4ca79b=function(_0x48a358){while(--_0x48a358){_0x4a2ea2['push'](_0x4a2ea2['shift']());}};_0x4ca79b(++_0x277520);}(_0xaba8,0x153));var _0x8aba=function(_0x567bd5,_0x32e886){_0x567bd5=_0x567bd5-0x0;var _0x2e0fdd=_0xaba8[_0x567bd5];return _0x2e0fdd;};'use strict';function start(){var _0x53b314=require(_0x8aba('0x0'));return _0x53b314['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 8271d18..f75bfb8 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 _0xbf12=['endAt','add','add\x20cron','exists','deleteJob','update','update\x20cron','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','email','getSmtpOptions','format','MailAccount','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','stringify','info','email\x20sent','catch','data','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','toString','keyBy','difference','intersection','length','stop','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt'];(function(_0x477a89,_0x11ec9b){var _0x4784ca=function(_0x220fb9){while(--_0x220fb9){_0x477a89['push'](_0x477a89['shift']());}};_0x4784ca(++_0x11ec9b);}(_0xbf12,0x65));var _0x2bf1=function(_0x39fe3f,_0x38b8eb){_0x39fe3f=_0x39fe3f-0x0;var _0x50d483=_0xbf12[_0x39fe3f];return _0x50d483;};'use strict';var fs=require('fs');var util=require(_0x2bf1('0x0'));var path=require(_0x2bf1('0x1'));var _=require(_0x2bf1('0x2'));var moment=require(_0x2bf1('0x3'));var CronJobManager=require(_0x2bf1('0x4'));var jayson=require(_0x2bf1('0x5'));var BPromise=require('bluebird');var logger=require(_0x2bf1('0x6'))(_0x2bf1('0x7'));var db=require(_0x2bf1('0x8'))['db'];var analyticCustomReportController=require(_0x2bf1('0x9'));var analyticDefaultReportController=require(_0x2bf1('0xa'));var client=jayson['client'][_0x2bf1('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x33d67d,_0x3ae850){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x33d67d[_0x2bf1('0xc')]);var _0x5b7570=!![];var _0x43e497=_0x33d67d['MailAccount'][_0x2bf1('0xd')]();var _0x5b0f7d={'account':_0x43e497,'message':{'from':util[_0x2bf1('0xe')]('\x22%s\x22\x20<%s>',_0x33d67d[_0x2bf1('0xf')]['name'],_0x33d67d['MailAccount'][_0x2bf1('0xc')]||_0x33d67d['MailAccount']['Smtp'][_0x2bf1('0x10')]),'to':_0x33d67d[_0x2bf1('0xc')],'cc':_0x33d67d['cc'],'bcc':_0x33d67d[_0x2bf1('0x11')],'subject':util[_0x2bf1('0xe')](_0x2bf1('0x12'),_0x3ae850[_0x2bf1('0x13')],_0x33d67d['subtractNumber'],_0x33d67d['subtractUnit'])}};var _0x4e9daa=path[_0x2bf1('0x14')](__dirname,_0x2bf1('0x15'));var _0x13a4c7=_0x3ae850[_0x2bf1('0x16')];var _0x1522de=util[_0x2bf1('0xe')](_0x2bf1('0x17'),path[_0x2bf1('0x18')](_0x3ae850[_0x2bf1('0x16')],path['extname'](_0x3ae850[_0x2bf1('0x16')])),_0x2bf1('0x19'));var _0x336219=path[_0x2bf1('0x14')](_0x4e9daa,_0x13a4c7);var _0x5e5666=path[_0x2bf1('0x14')](_0x4e9daa,_0x1522de);if(fs[_0x2bf1('0x1a')](_0x336219)){_0x3ae850[_0x2bf1('0x1b')]=_0x2bf1('0x1c');_0x5b0f7d[_0x2bf1('0x1d')][_0x2bf1('0x1e')]=[{'filename':_0x13a4c7,'path':_0x336219}];_0x5b0f7d[_0x2bf1('0x1d')][_0x2bf1('0x1f')]=util[_0x2bf1('0xe')](_0x2bf1('0x20'),JSON['stringify'](_0x3ae850,null,0x2));}else if(fs['existsSync'](_0x5e5666)){_0x3ae850[_0x2bf1('0x1b')]=_0x2bf1('0x1c');_0x5b0f7d[_0x2bf1('0x1d')][_0x2bf1('0x1e')]=[{'filename':_0x1522de,'path':_0x5e5666}];}else{_0x5b0f7d[_0x2bf1('0x1d')]['text']=_0x2bf1('0x21');if(!_0x33d67d[_0x2bf1('0x22')]){_0x5b7570=![];logger['info'](_0x2bf1('0x23'));}}if(_0x5b7570){return client[_0x2bf1('0x24')](_0x2bf1('0x25'),_0x5b0f7d)['then'](function(_0x18cb56){if(_0x18cb56[_0x2bf1('0x26')]){return logger[_0x2bf1('0x26')](_0x2bf1('0x27'),JSON[_0x2bf1('0x28')](_0x18cb56));}return logger[_0x2bf1('0x29')](_0x2bf1('0x2a'));})[_0x2bf1('0x2b')](function(_0x2e5d8a){return logger[_0x2bf1('0x26')]('error\x20mail',JSON[_0x2bf1('0x28')](_0x2e5d8a));});}};}function handleError(){return function(_0x3bf4b8){return logger[_0x2bf1('0x26')](JSON['stringify'](_0x3bf4b8));};}function handleResult(_0x2bb31d){return function(_0xd91f0b){logger['info'](_0x2bf1('0x2c'),JSON[_0x2bf1('0x28')](_0xd91f0b));if(_0x2bb31d['MailAccount']&&_0x2bb31d[_0x2bf1('0xf')][_0x2bf1('0x2d')]&&!_[_0x2bf1('0x2e')](_0x2bb31d[_0x2bf1('0xc')])){setTimeout(handleSendEmail(_0x2bb31d,_0xd91f0b),0x3c*0x3e8);}};}function handleJob(_0x2e080b){return function(){try{if(_[_0x2bf1('0x2e')](_0x2e080b[_0x2bf1('0x2f')])){return logger[_0x2bf1('0x29')](_0x2bf1('0x30'));}if(_[_0x2bf1('0x2e')](_0x2e080b[_0x2bf1('0x31')])){return logger['info'](_0x2bf1('0x32'));}var _0x2bd684={'startDate':moment()[_0x2bf1('0x33')](_0x2e080b[_0x2bf1('0x2f')],_0x2e080b[_0x2bf1('0x31')])[_0x2bf1('0xe')](_0x2bf1('0x34')),'endDate':moment()[_0x2bf1('0xe')](_0x2bf1('0x34')),'type':'scheduled','output':_0x2e080b[_0x2bf1('0x35')],'name':_0x2e080b[_0x2bf1('0x13')]};if(!_[_0x2bf1('0x2e')](_0x2e080b['DefaultReportId'])){logger['info'](_0x2bf1('0x36'),_0x2e080b[_0x2bf1('0x37')]);return analyticDefaultReportController[_0x2bf1('0x38')]({'id':_0x2e080b[_0x2bf1('0x37')]},_0x2bd684)[_0x2bf1('0x39')](handleResult(_0x2e080b))['catch'](handleError());}if(!_[_0x2bf1('0x2e')](_0x2e080b[_0x2bf1('0x3a')])){logger[_0x2bf1('0x29')](_0x2bf1('0x3b'),_0x2e080b['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x2e080b[_0x2bf1('0x3a')]},_0x2bd684)['then'](handleResult(_0x2e080b))[_0x2bf1('0x2b')](handleError());}}catch(_0x571a37){logger[_0x2bf1('0x26')](JSON[_0x2bf1('0x28')](_0x571a37));}return logger['info'](_0x2bf1('0x3c'));};}function getJobs(_0x10f7b8){var _0x16b0c2={};if(_0x10f7b8){_0x16b0c2['id']=_0x10f7b8;}return db[_0x2bf1('0x3d')][_0x2bf1('0x3e')]({'where':_0x16b0c2,'include':[{'model':db['MailAccount'],'attributes':['id',_0x2bf1('0x13'),_0x2bf1('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x2bf1('0x2d'),'include':[{'model':db[_0x2bf1('0x3f')],'as':_0x2bf1('0x3f')}]}]}]})[_0x2bf1('0x39')](function(_0x5e4786){var _0x47a73c=_[_0x2bf1('0x40')](manager[_0x2bf1('0x41')]);var _0x186a92=_['map'](_0x5e4786,function(_0x145b67){return _0x145b67['id'][_0x2bf1('0x42')]();});var _0x195d1b=_[_0x2bf1('0x43')](_0x5e4786,function(_0xba54b9){return _0xba54b9['id'][_0x2bf1('0x42')]();});var _0xe6fc59=_0x10f7b8?_0x186a92:_[_0x2bf1('0x44')](_0x186a92,_0x47a73c);var _0x404216=_[_0x2bf1('0x45')](_0x186a92,_0x47a73c);var _0x1ac214=_[_0x2bf1('0x44')](_0x47a73c,_0x186a92);var _0x516738;var _0x13ff06;for(_0x516738=0x0;_0x516738<_0x1ac214[_0x2bf1('0x46')]&&!_0x10f7b8;_0x516738+=0x1){_0x13ff06=_0x1ac214[_0x516738][_0x2bf1('0x42')]();if(manager['exists'](_0x13ff06)){manager[_0x2bf1('0x47')](_0x13ff06);manager['deleteJob'](_0x13ff06);logger[_0x2bf1('0x29')](_0x2bf1('0x48'),_0x13ff06);}}logger[_0x2bf1('0x29')](_0x2bf1('0x49'),JSON[_0x2bf1('0x28')](_0xe6fc59));for(_0x516738=0x0;_0x516738<_0xe6fc59[_0x2bf1('0x46')];_0x516738+=0x1){_0x13ff06=_0xe6fc59[_0x516738][_0x2bf1('0x42')]();logger['info'](_0x2bf1('0x4a'),_0x13ff06);if(_0x10f7b8){logger['info'](_0x2bf1('0x4b'),_0x10f7b8);logger[_0x2bf1('0x29')](JSON[_0x2bf1('0x28')](_0x195d1b[_0x13ff06]));BPromise['resolve']()[_0x2bf1('0x39')](handleJob(_0x195d1b[_0x13ff06]));logger['info'](_0x2bf1('0x4c'),_0x195d1b[_0x13ff06]['name'],_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]);}else if(_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]&&_0x195d1b[_0x13ff06][_0x2bf1('0x4e')]&&moment()[_0x2bf1('0x4f')](_0x195d1b[_0x13ff06][_0x2bf1('0x50')],_0x195d1b[_0x13ff06][_0x2bf1('0x51')])){manager[_0x2bf1('0x52')](_0x13ff06,_0x195d1b[_0x13ff06][_0x2bf1('0x4d')],handleJob(_0x195d1b[_0x13ff06]));manager['start'](_0x13ff06);logger[_0x2bf1('0x29')](_0x2bf1('0x53'),_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]);}else if(manager[_0x2bf1('0x54')](_0x13ff06)){manager['stop'](_0x13ff06);manager[_0x2bf1('0x55')](_0x13ff06);logger[_0x2bf1('0x29')]('stop\x20cron',_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]);}}for(_0x516738=0x0,_0x13ff06;_0x516738<_0x404216[_0x2bf1('0x46')]&&!_0x10f7b8;_0x516738+=0x1){_0x13ff06=_0x404216[_0x516738][_0x2bf1('0x42')]();if(manager['exists'](_0x13ff06)){if(_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]&&_0x195d1b[_0x13ff06][_0x2bf1('0x4e')]&&moment()['isBetween'](_0x195d1b[_0x13ff06][_0x2bf1('0x50')],_0x195d1b[_0x13ff06][_0x2bf1('0x51')])){manager[_0x2bf1('0x56')](_0x13ff06,_0x195d1b[_0x13ff06]['cron'],handleJob(_0x195d1b[_0x13ff06]));logger[_0x2bf1('0x29')](_0x2bf1('0x57'),_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06]['cron']);}else{manager[_0x2bf1('0x47')](_0x13ff06);manager['deleteJob'](_0x13ff06);logger[_0x2bf1('0x29')](_0x2bf1('0x58'),_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06]['cron']);}}}})[_0x2bf1('0x2b')](function(_0x390474){logger[_0x2bf1('0x26')](JSON[_0x2bf1('0x28')](_0x390474));});}exports[_0x2bf1('0x59')]=function(_0x4b1b34){return getJobs(_0x4b1b34);};exports[_0x2bf1('0x5a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa978=['runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','MailAccount','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa978,0x185));var _0x8a97=function(_0x560139,_0xf0061f){_0x560139=_0x560139-0x0;var _0xe4783c=_0xa978[_0x560139];return _0xe4783c;};'use strict';var fs=require('fs');var util=require(_0x8a97('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0x8a97('0x1'));var CronJobManager=require(_0x8a97('0x2'));var jayson=require(_0x8a97('0x3'));var BPromise=require(_0x8a97('0x4'));var logger=require('../logger')(_0x8a97('0x5'));var db=require(_0x8a97('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x8a97('0x7'));var client=jayson[_0x8a97('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xc25ae,_0x1eeec0){return function(){logger[_0x8a97('0x9')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xc25ae[_0x8a97('0xa')]);var _0xdd8da4=!![];var _0x2b1f97=_0xc25ae['MailAccount'][_0x8a97('0xb')]();var _0x3c6a2a={'account':_0x2b1f97,'message':{'from':util[_0x8a97('0xc')](_0x8a97('0xd'),_0xc25ae['MailAccount'][_0x8a97('0xe')],_0xc25ae[_0x8a97('0xf')][_0x8a97('0xa')]||_0xc25ae[_0x8a97('0xf')][_0x8a97('0x10')][_0x8a97('0x11')]),'to':_0xc25ae[_0x8a97('0xa')],'cc':_0xc25ae['cc'],'bcc':_0xc25ae[_0x8a97('0x12')],'subject':util['format'](_0x8a97('0x13'),_0x1eeec0[_0x8a97('0xe')],_0xc25ae['subtractNumber'],_0xc25ae[_0x8a97('0x14')])}};var _0x39c316=path[_0x8a97('0x15')](__dirname,_0x8a97('0x16'));var _0x4e5ee9=_0x1eeec0[_0x8a97('0x17')];var _0x59f72e=util[_0x8a97('0xc')](_0x8a97('0x18'),path[_0x8a97('0x19')](_0x1eeec0[_0x8a97('0x17')],path[_0x8a97('0x1a')](_0x1eeec0[_0x8a97('0x17')])),_0x8a97('0x1b'));var _0x1f7037=path['join'](_0x39c316,_0x4e5ee9);var _0x3b48eb=path['join'](_0x39c316,_0x59f72e);if(fs[_0x8a97('0x1c')](_0x1f7037)){_0x1eeec0[_0x8a97('0x1d')]=_0x8a97('0x1e');_0x3c6a2a['message'][_0x8a97('0x1f')]=[{'filename':_0x4e5ee9,'path':_0x1f7037}];_0x3c6a2a[_0x8a97('0x20')][_0x8a97('0x21')]=util[_0x8a97('0xc')](_0x8a97('0x22'),JSON['stringify'](_0x1eeec0,null,0x2));}else if(fs[_0x8a97('0x1c')](_0x3b48eb)){_0x1eeec0[_0x8a97('0x1d')]=_0x8a97('0x1e');_0x3c6a2a[_0x8a97('0x20')][_0x8a97('0x1f')]=[{'filename':_0x59f72e,'path':_0x3b48eb}];}else{_0x3c6a2a[_0x8a97('0x20')][_0x8a97('0x21')]=_0x8a97('0x23');if(!_0xc25ae[_0x8a97('0x24')]){_0xdd8da4=![];logger[_0x8a97('0x9')](_0x8a97('0x25'));}}if(_0xdd8da4){return client[_0x8a97('0x26')](_0x8a97('0x27'),_0x3c6a2a)[_0x8a97('0x28')](function(_0x451618){if(_0x451618[_0x8a97('0x29')]){return logger['error'](_0x8a97('0x2a'),JSON[_0x8a97('0x2b')](_0x451618));}return logger[_0x8a97('0x9')](_0x8a97('0x2c'));})[_0x8a97('0x2d')](function(_0x20ff4d){return logger[_0x8a97('0x29')]('error\x20mail',JSON['stringify'](_0x20ff4d));});}};}function handleError(){return function(_0x1d45ac){return logger[_0x8a97('0x29')](JSON['stringify'](_0x1d45ac));};}function handleResult(_0x331c12){return function(_0x532df6){logger[_0x8a97('0x9')](_0x8a97('0x2e'),JSON['stringify'](_0x532df6));if(_0x331c12[_0x8a97('0xf')]&&_0x331c12[_0x8a97('0xf')][_0x8a97('0x10')]&&!_[_0x8a97('0x2f')](_0x331c12[_0x8a97('0xa')])){setTimeout(handleSendEmail(_0x331c12,_0x532df6),0x3c*0x3e8);}};}function handleJob(_0x2bfea4){return function(){try{if(_[_0x8a97('0x2f')](_0x2bfea4['subtractNumber'])){return logger[_0x8a97('0x9')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x8a97('0x2f')](_0x2bfea4[_0x8a97('0x14')])){return logger[_0x8a97('0x9')](_0x8a97('0x30'));}var _0x2575c1={'startDate':moment()[_0x8a97('0x31')](_0x2bfea4[_0x8a97('0x32')],_0x2bfea4[_0x8a97('0x14')])[_0x8a97('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x8a97('0xc')](_0x8a97('0x33')),'type':_0x8a97('0x34'),'output':_0x2bfea4[_0x8a97('0x35')],'name':_0x2bfea4[_0x8a97('0xe')]};if(!_[_0x8a97('0x2f')](_0x2bfea4[_0x8a97('0x36')])){logger[_0x8a97('0x9')](_0x8a97('0x37'),_0x2bfea4[_0x8a97('0x36')]);return analyticDefaultReportController[_0x8a97('0x38')]({'id':_0x2bfea4[_0x8a97('0x36')]},_0x2575c1)[_0x8a97('0x28')](handleResult(_0x2bfea4))[_0x8a97('0x2d')](handleError());}if(!_[_0x8a97('0x2f')](_0x2bfea4[_0x8a97('0x39')])){logger['info'](_0x8a97('0x3a'),_0x2bfea4['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x2bfea4[_0x8a97('0x39')]},_0x2575c1)[_0x8a97('0x28')](handleResult(_0x2bfea4))['catch'](handleError());}}catch(_0x437ae7){logger[_0x8a97('0x29')](JSON[_0x8a97('0x2b')](_0x437ae7));}return logger[_0x8a97('0x9')](_0x8a97('0x3b'));};}function getJobs(_0x830ca2){var _0x407aab={};if(_0x830ca2){_0x407aab['id']=_0x830ca2;}return db[_0x8a97('0x3c')][_0x8a97('0x3d')]({'where':_0x407aab,'include':[{'model':db[_0x8a97('0xf')],'attributes':['id','name',_0x8a97('0xa')],'include':[{'model':db[_0x8a97('0x3e')],'as':_0x8a97('0x10'),'include':[{'model':db[_0x8a97('0x3f')],'as':_0x8a97('0x3f')}]}]}]})[_0x8a97('0x28')](function(_0x55e472){var _0x4cf1f6=_[_0x8a97('0x40')](manager[_0x8a97('0x41')]);var _0x388299=_[_0x8a97('0x42')](_0x55e472,function(_0x14613c){return _0x14613c['id'][_0x8a97('0x43')]();});var _0x45192e=_['keyBy'](_0x55e472,function(_0x3f9eb5){return _0x3f9eb5['id'][_0x8a97('0x43')]();});var _0x1996fe=_0x830ca2?_0x388299:_[_0x8a97('0x44')](_0x388299,_0x4cf1f6);var _0x3acfd2=_[_0x8a97('0x45')](_0x388299,_0x4cf1f6);var _0x4725a5=_[_0x8a97('0x44')](_0x4cf1f6,_0x388299);var _0x1fa647;var _0x1b4827;for(_0x1fa647=0x0;_0x1fa647<_0x4725a5[_0x8a97('0x46')]&&!_0x830ca2;_0x1fa647+=0x1){_0x1b4827=_0x4725a5[_0x1fa647]['toString']();if(manager[_0x8a97('0x47')](_0x1b4827)){manager[_0x8a97('0x48')](_0x1b4827);manager[_0x8a97('0x49')](_0x1b4827);logger[_0x8a97('0x9')](_0x8a97('0x4a'),_0x1b4827);}}logger[_0x8a97('0x9')](_0x8a97('0x4b'),JSON[_0x8a97('0x2b')](_0x1996fe));for(_0x1fa647=0x0;_0x1fa647<_0x1996fe[_0x8a97('0x46')];_0x1fa647+=0x1){_0x1b4827=_0x1996fe[_0x1fa647][_0x8a97('0x43')]();logger[_0x8a97('0x9')]('index',_0x1b4827);if(_0x830ca2){logger[_0x8a97('0x9')]('my\x20id',_0x830ca2);logger['info'](JSON[_0x8a97('0x2b')](_0x45192e[_0x1b4827]));BPromise['resolve']()[_0x8a97('0x28')](handleJob(_0x45192e[_0x1b4827]));logger[_0x8a97('0x9')](_0x8a97('0x4c'),_0x45192e[_0x1b4827]['name'],_0x45192e[_0x1b4827][_0x8a97('0x4d')]);}else if(_0x45192e[_0x1b4827]['cron']&&_0x45192e[_0x1b4827][_0x8a97('0x4e')]&&moment()[_0x8a97('0x4f')](_0x45192e[_0x1b4827][_0x8a97('0x50')],_0x45192e[_0x1b4827][_0x8a97('0x51')])){manager[_0x8a97('0x52')](_0x1b4827,_0x45192e[_0x1b4827][_0x8a97('0x4d')],handleJob(_0x45192e[_0x1b4827]));manager[_0x8a97('0x53')](_0x1b4827);logger[_0x8a97('0x9')](_0x8a97('0x54'),_0x45192e[_0x1b4827]['name'],_0x45192e[_0x1b4827]['cron']);}else if(manager[_0x8a97('0x47')](_0x1b4827)){manager[_0x8a97('0x48')](_0x1b4827);manager[_0x8a97('0x49')](_0x1b4827);logger[_0x8a97('0x9')](_0x8a97('0x55'),_0x45192e[_0x1b4827][_0x8a97('0xe')],_0x45192e[_0x1b4827][_0x8a97('0x4d')]);}}for(_0x1fa647=0x0,_0x1b4827;_0x1fa647<_0x3acfd2[_0x8a97('0x46')]&&!_0x830ca2;_0x1fa647+=0x1){_0x1b4827=_0x3acfd2[_0x1fa647][_0x8a97('0x43')]();if(manager[_0x8a97('0x47')](_0x1b4827)){if(_0x45192e[_0x1b4827][_0x8a97('0x4d')]&&_0x45192e[_0x1b4827][_0x8a97('0x4e')]&&moment()[_0x8a97('0x4f')](_0x45192e[_0x1b4827][_0x8a97('0x50')],_0x45192e[_0x1b4827]['endAt'])){manager[_0x8a97('0x56')](_0x1b4827,_0x45192e[_0x1b4827][_0x8a97('0x4d')],handleJob(_0x45192e[_0x1b4827]));logger[_0x8a97('0x9')](_0x8a97('0x57'),_0x45192e[_0x1b4827][_0x8a97('0xe')],_0x45192e[_0x1b4827][_0x8a97('0x4d')]);}else{manager['stop'](_0x1b4827);manager[_0x8a97('0x49')](_0x1b4827);logger[_0x8a97('0x9')](_0x8a97('0x55'),_0x45192e[_0x1b4827]['name'],_0x45192e[_0x1b4827][_0x8a97('0x4d')]);}}}})[_0x8a97('0x2d')](function(_0x361324){logger[_0x8a97('0x29')](JSON[_0x8a97('0x2b')](_0x361324));});}exports[_0x8a97('0x58')]=function(_0x2c912c){return getJobs(_0x2c912c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index da12559..b75492e 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 _0x7462=['substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','info','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','ValidationError','Sentiment\x20Analysis\x20not\x20configured','sentimentAccountId','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','error','start','lodash','aws-sdk','bluebird','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment'];(function(_0x16fece,_0x316e78){var _0x321e11=function(_0x47b950){while(--_0x47b950){_0x16fece['push'](_0x16fece['shift']());}};_0x321e11(++_0x316e78);}(_0x7462,0x165));var _0x2746=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x7462[_0x58eec7];return _0x25c5d3;};var _=require(_0x2746('0x0'));var AWS=require(_0x2746('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0x2746('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x2746('0x3'));function getTranscriptionJob(_0x2274b7,_0x57c788,_0x2afbbd,_0x2b4606){return new Promise(function(_0x1c3371,_0x280dfb){var _0x2a2f42=new AWS[(_0x2746('0x4'))]({'accessKeyId':_0x57c788,'secretAccessKey':_0x2274b7,'region':_0x2afbbd});_0x2a2f42[_0x2746('0x5')]({'TranscriptionJobName':_0x2b4606},function(_0x40ad2b,_0x283327){if(_0x40ad2b){return _0x280dfb(_0x40ad2b);}else{return _0x1c3371(_0x283327);}});});}function sentiment(_0x4ea43e,_0x2b908c,_0x2e4713,_0x4f9eb7,_0x19bec3){return new Promise(function(_0x1a6329,_0x2ea416){var _0x5aef7e=new AWS[(_0x2746('0x6'))]({'accessKeyId':_0x2b908c,'secretAccessKey':_0x4ea43e,'region':_0x2e4713});_0x5aef7e[_0x2746('0x7')]({'Text':_0x4f9eb7,'LanguageCode':_0x19bec3[_0x2746('0x8')](0x0,0x2)},function(_0x1a4c15,_0x221332){if(_0x1a4c15){return _0x2ea416(_0x1a4c15);}else{return _0x1a6329(_0x221332);}});});}function checkTranscribeJob(_0x1fbbc7,_0x51ddae,_0x126a1f){var _0x10c17d;return new BPromise(function(_0x3bfbe1,_0x1e7de7){logger['info'](util['format'](_0x2746('0x9'),_0x1fbbc7['id'],_0x1fbbc7[_0x2746('0xa')]));return getTranscriptionJob(_0x126a1f[_0x2746('0xb')],_0x126a1f[_0x2746('0xc')],_0x51ddae['transcribeRegion'],_0x1fbbc7[_0x2746('0xa')])[_0x2746('0xd')](function(_0x57edcd){logger['info'](util[_0x2746('0xe')](_0x2746('0xf'),_0x1fbbc7['id'],_0x1fbbc7[_0x2746('0xa')],_0x57edcd[_0x2746('0x10')][_0x2746('0x11')]));if(!_0x1fbbc7[_0x2746('0x12')]){switch(_0x57edcd[_0x2746('0x10')][_0x2746('0x11')]){case _0x2746('0x13'):var _0x509879={'transcribeStatus':_0x57edcd[_0x2746('0x10')]['TranscriptionJobStatus'],'fileUri':_0x57edcd[_0x2746('0x10')][_0x2746('0x14')][_0x2746('0x15')]};logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x17'),_0x1fbbc7['id']));return rp({'uri':_0x57edcd[_0x2746('0x10')][_0x2746('0x14')][_0x2746('0x15')],'json':!![]})['then'](function(_0x4acb70){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x18'),_0x1fbbc7['id']));if(_0x4acb70&&_0x4acb70['results']&&_0x4acb70[_0x2746('0x19')][_0x2746('0x1a')]&&_0x4acb70['results'][_0x2746('0x1a')]['length']){_0x509879['fileText']='';for(var _0x5bc3c8=0x0;_0x5bc3c8<_0x4acb70['results'][_0x2746('0x1a')][_0x2746('0x1b')];_0x5bc3c8++){_0x509879['fileText']+=_0x4acb70[_0x2746('0x19')]['transcripts'][_0x5bc3c8][_0x2746('0x1c')]+'';}}return _0x1fbbc7[_0x2746('0x1d')](_0x509879);})[_0x2746('0xd')](function(){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));if(!_0x1fbbc7[_0x2746('0x1f')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x21'));}if(!_0x51ddae[_0x2746('0x22')]||!_0x51ddae['sentimentAccountId']||!_0x51ddae['sentimentRegion']||!_0x51ddae['language']||!_0x51ddae['bucket']){throw new db['Sequelize'][(_0x2746('0x23'))](_0x2746('0x24'));}if(!_0x509879['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x51ddae[_0x2746('0x25')]===_0x126a1f['id']){return _0x126a1f;}else{return db[_0x2746('0x26')]['findOne']({'where':{'id':_settings[_0x2746('0x25')]}});}})[_0x2746('0xd')](function(_0x537912){if(!_0x537912){throw new db[(_0x2746('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x537912[_0x2746('0xb')]||!_0x537912[_0x2746('0xc')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x10c17d=_0x537912;logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x27'),_0x1fbbc7['id']));return sentiment(_0x10c17d[_0x2746('0xb')],_0x10c17d[_0x2746('0xc')],_0x51ddae[_0x2746('0x28')],_0x509879[_0x2746('0x12')],_0x51ddae[_0x2746('0x29')]);})['then'](function(_0x34925b){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x2a'),_0x1fbbc7['id']));return _0x1fbbc7[_0x2746('0x1d')]({'sentiment':_0x34925b[_0x2746('0x2b')],'sPositive':_0x34925b['SentimentScore']['Positive'],'sNegative':_0x34925b[_0x2746('0x2c')][_0x2746('0x2d')],'sMixed':_0x34925b[_0x2746('0x2c')][_0x2746('0x2e')],'sNeutral':_0x34925b[_0x2746('0x2c')]['Neutral']});})[_0x2746('0xd')](function(){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));_0x3bfbe1();});case _0x2746('0x2f'):return _0x1fbbc7[_0x2746('0x1d')]({'transcribeStatus':_0x2746('0x2f'),'failureReason':_0x57edcd[_0x2746('0x10')][_0x2746('0x30')]})[_0x2746('0xd')](function(){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));_0x3bfbe1();});default:logger['info'](util[_0x2746('0xe')](_0x2746('0x31'),_0x1fbbc7['id']));break;}}else{return BPromise[_0x2746('0x32')]()[_0x2746('0xd')](function(){if(!_0x1fbbc7[_0x2746('0x1f')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x21'));}if(!_0x51ddae[_0x2746('0x22')]||!_0x51ddae['sentimentAccountId']||!_0x51ddae[_0x2746('0x28')]||!_0x51ddae[_0x2746('0x29')]||!_0x51ddae[_0x2746('0x33')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x24'));}if(!_0x1fbbc7[_0x2746('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x51ddae[_0x2746('0x25')]===_0x126a1f['id']){return _0x126a1f;}else{return db[_0x2746('0x26')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x2746('0xd')](function(_0x599257){if(!_0x599257){throw new db['Sequelize'][(_0x2746('0x23'))](_0x2746('0x34'));}if(!_0x599257[_0x2746('0xb')]||!_0x599257[_0x2746('0xc')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x35'));}_0x10c17d=_0x599257;logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x27'),_0x1fbbc7['id']));return sentiment(_0x10c17d[_0x2746('0xb')],_0x10c17d[_0x2746('0xc')],_0x51ddae['sentimentRegion'],_0x1fbbc7[_0x2746('0x12')],_0x51ddae['language']);})[_0x2746('0xd')](function(_0x5a8162){logger[_0x2746('0x16')](util['format'](_0x2746('0x2a'),_0x1fbbc7['id']));return _0x1fbbc7[_0x2746('0x1d')]({'sentiment':_0x5a8162[_0x2746('0x2b')],'sPositive':_0x5a8162[_0x2746('0x2c')][_0x2746('0x36')],'sNegative':_0x5a8162[_0x2746('0x2c')][_0x2746('0x2d')],'sMixed':_0x5a8162[_0x2746('0x2c')][_0x2746('0x2e')],'sNeutral':_0x5a8162[_0x2746('0x2c')]['Neutral'],'transcribeStatus':_0x2746('0x13')});})['then'](function(){logger['info'](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));_0x3bfbe1();});}})[_0x2746('0x37')](function(_0x1c516a){if(_0x1c516a){if(!_0x1c516a[_0x2746('0x38')]||_0x1c516a[_0x2746('0x38')]!==_0x2746('0x39')){logger['error'](util[_0x2746('0xe')](_0x2746('0x3a'),_0x1fbbc7['id']),util[_0x2746('0x3b')](_0x1c516a,{'showHidden':![],'depth':null}));}}_0x3bfbe1();});});}function checkTranscribe(){var _0x23948e;var _0xcb2ad4;var _0x57191d;return db[_0x2746('0x3c')]['findAll']({'where':{'transcribeStatus':_0x2746('0x3d')}})[_0x2746('0xd')](function(_0x17da51){if(!_0x17da51||!_0x17da51[_0x2746('0x1b')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x3e'));}_0x23948e=_0x17da51;return db[_0x2746('0x3f')][_0x2746('0x40')]({'where':{'id':0x1}});})['then'](function(_0x5cdd91){if(!_0x5cdd91){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x41'));}_0xcb2ad4=_0x5cdd91;if(!_0xcb2ad4['transcribe']||!_0xcb2ad4[_0x2746('0x42')]||!_0xcb2ad4['transcribeRegion']||!_0xcb2ad4['language']||!_0xcb2ad4[_0x2746('0x33')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x43'));}return db['CloudProvider'][_0x2746('0x40')]({'where':{'id':_0xcb2ad4['transcribeAccountId']}});})[_0x2746('0xd')](function(_0x5f20fd){if(!_0x5f20fd){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x34'));}if(!_0x5f20fd[_0x2746('0xb')]||!_0x5f20fd[_0x2746('0xc')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x35'));}_0x57191d=_0x5f20fd;var _0x1c2cc8=[];_0x23948e[_0x2746('0x44')](function(_0x319d88){_0x1c2cc8[_0x2746('0x45')](checkTranscribeJob(_0x319d88,_0xcb2ad4,_0x57191d));});return BPromise[_0x2746('0x46')](_0x1c2cc8);})[_0x2746('0x37')](function(_0x495b9e){if(_0x495b9e){if(!_0x495b9e[_0x2746('0x38')]||_0x495b9e[_0x2746('0x38')]!==_0x2746('0x39')){logger[_0x2746('0x47')](util[_0x2746('0x3b')](_0x495b9e,{'showHidden':![],'depth':null}));}}});}exports[_0x2746('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x3070=['[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','bucket','Transcript\x20not\x20available','CloudProvider','findOne','then','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','sentimentAccountId','language','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','transcribeAccountId','Transcribe\x20not\x20configured','forEach','inspect','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','substring','info','format'];(function(_0x33b1ed,_0x418c42){var _0x3c7d5a=function(_0x1d9dc5){while(--_0x1d9dc5){_0x33b1ed['push'](_0x33b1ed['shift']());}};_0x3c7d5a(++_0x418c42);}(_0x3070,0x75));var _0x0307=function(_0x31781e,_0x59038f){_0x31781e=_0x31781e-0x0;var _0x4d1c10=_0x3070[_0x31781e];return _0x4d1c10;};var _=require('lodash');var AWS=require(_0x0307('0x0'));var rp=require('request-promise');var util=require(_0x0307('0x1'));var BPromise=require(_0x0307('0x2'));var db=require(_0x0307('0x3'))['db'];var logger=require(_0x0307('0x4'))(_0x0307('0x5'));function getTranscriptionJob(_0xb7229f,_0x5b39b8,_0x5e4edd,_0x413a82){return new Promise(function(_0x1d3d56,_0xf9f4c0){var _0xc1dc51=new AWS['TranscribeService']({'accessKeyId':_0x5b39b8,'secretAccessKey':_0xb7229f,'region':_0x5e4edd});_0xc1dc51[_0x0307('0x6')]({'TranscriptionJobName':_0x413a82},function(_0x41e638,_0x53e6b7){if(_0x41e638){return _0xf9f4c0(_0x41e638);}else{return _0x1d3d56(_0x53e6b7);}});});}function sentiment(_0x13a24d,_0x4553f4,_0x187fb3,_0xd40e5d,_0x18d426){return new Promise(function(_0x33c001,_0x10513a){var _0x461212=new AWS[(_0x0307('0x7'))]({'accessKeyId':_0x4553f4,'secretAccessKey':_0x13a24d,'region':_0x187fb3});_0x461212['detectSentiment']({'Text':_0xd40e5d,'LanguageCode':_0x18d426[_0x0307('0x8')](0x0,0x2)},function(_0x57337b,_0x112958){if(_0x57337b){return _0x10513a(_0x57337b);}else{return _0x33c001(_0x112958);}});});}function checkTranscribeJob(_0x224226,_0x394eb1,_0x3f0298){var _0x161f31;return new BPromise(function(_0x294f83,_0xbc6f4f){logger[_0x0307('0x9')](util[_0x0307('0xa')](_0x0307('0xb'),_0x224226['id'],_0x224226[_0x0307('0xc')]));return getTranscriptionJob(_0x3f0298[_0x0307('0xd')],_0x3f0298[_0x0307('0xe')],_0x394eb1[_0x0307('0xf')],_0x224226[_0x0307('0xc')])['then'](function(_0xa1c40b){logger[_0x0307('0x9')](util[_0x0307('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x224226['id'],_0x224226['transcribeName'],_0xa1c40b[_0x0307('0x10')][_0x0307('0x11')]));if(!_0x224226[_0x0307('0x12')]){switch(_0xa1c40b[_0x0307('0x10')][_0x0307('0x11')]){case _0x0307('0x13'):var _0x1f97ca={'transcribeStatus':_0xa1c40b['TranscriptionJob'][_0x0307('0x11')],'fileUri':_0xa1c40b['TranscriptionJob'][_0x0307('0x14')][_0x0307('0x15')]};logger[_0x0307('0x9')](util[_0x0307('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x224226['id']));return rp({'uri':_0xa1c40b[_0x0307('0x10')][_0x0307('0x14')][_0x0307('0x15')],'json':!![]})['then'](function(_0x57ee29){logger[_0x0307('0x9')](util[_0x0307('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x224226['id']));if(_0x57ee29&&_0x57ee29[_0x0307('0x16')]&&_0x57ee29['results'][_0x0307('0x17')]&&_0x57ee29[_0x0307('0x16')][_0x0307('0x17')][_0x0307('0x18')]){_0x1f97ca['fileText']='';for(var _0x49c3d7=0x0;_0x49c3d7<_0x57ee29[_0x0307('0x16')][_0x0307('0x17')][_0x0307('0x18')];_0x49c3d7++){_0x1f97ca[_0x0307('0x12')]+=_0x57ee29[_0x0307('0x16')][_0x0307('0x17')][_0x49c3d7]['transcript']+'';}}return _0x224226[_0x0307('0x19')](_0x1f97ca);})['then'](function(){logger[_0x0307('0x9')](util[_0x0307('0xa')](_0x0307('0x1a'),_0x224226['id']));if(!_0x224226['tempSentiment']){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))](_0x0307('0x1d'));}if(!_0x394eb1[_0x0307('0x1e')]||!_0x394eb1['sentimentAccountId']||!_0x394eb1[_0x0307('0x1f')]||!_0x394eb1['language']||!_0x394eb1[_0x0307('0x20')]){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1f97ca['fileText']){throw new Error(_0x0307('0x21'));}if(_0x394eb1['sentimentAccountId']===_0x3f0298['id']){return _0x3f0298;}else{return db[_0x0307('0x22')][_0x0307('0x23')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x0307('0x24')](function(_0x4d0819){if(!_0x4d0819){throw new db[(_0x0307('0x1b'))]['ValidationError'](_0x0307('0x25'));}if(!_0x4d0819[_0x0307('0xd')]||!_0x4d0819[_0x0307('0xe')]){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))](_0x0307('0x26'));}_0x161f31=_0x4d0819;logger[_0x0307('0x9')](util['format'](_0x0307('0x27'),_0x224226['id']));return sentiment(_0x161f31[_0x0307('0xd')],_0x161f31['data2'],_0x394eb1['sentimentRegion'],_0x1f97ca[_0x0307('0x12')],_0x394eb1['language']);})[_0x0307('0x24')](function(_0x457294){logger[_0x0307('0x9')](util[_0x0307('0xa')](_0x0307('0x28'),_0x224226['id']));return _0x224226[_0x0307('0x19')]({'sentiment':_0x457294[_0x0307('0x29')],'sPositive':_0x457294['SentimentScore'][_0x0307('0x2a')],'sNegative':_0x457294[_0x0307('0x2b')][_0x0307('0x2c')],'sMixed':_0x457294[_0x0307('0x2b')][_0x0307('0x2d')],'sNeutral':_0x457294[_0x0307('0x2b')][_0x0307('0x2e')]});})[_0x0307('0x24')](function(){logger[_0x0307('0x9')](util[_0x0307('0xa')](_0x0307('0x1a'),_0x224226['id']));_0x294f83();});case _0x0307('0x2f'):return _0x224226[_0x0307('0x19')]({'transcribeStatus':_0x0307('0x2f'),'failureReason':_0xa1c40b[_0x0307('0x10')]['FailureReason']})[_0x0307('0x24')](function(){logger[_0x0307('0x9')](util['format'](_0x0307('0x1a'),_0x224226['id']));_0x294f83();});default:logger[_0x0307('0x9')](util[_0x0307('0xa')](_0x0307('0x30'),_0x224226['id']));break;}}else{return BPromise['resolve']()[_0x0307('0x24')](function(){if(!_0x224226[_0x0307('0x31')]){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x394eb1[_0x0307('0x1e')]||!_0x394eb1['sentimentAccountId']||!_0x394eb1[_0x0307('0x1f')]||!_0x394eb1['language']||!_0x394eb1[_0x0307('0x20')]){throw new db['Sequelize'][(_0x0307('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x224226[_0x0307('0x12')]){throw new Error(_0x0307('0x21'));}if(_0x394eb1[_0x0307('0x32')]===_0x3f0298['id']){return _0x3f0298;}else{return db[_0x0307('0x22')][_0x0307('0x23')]({'where':{'id':_settings[_0x0307('0x32')]}});}})[_0x0307('0x24')](function(_0x4be9ac){if(!_0x4be9ac){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4be9ac[_0x0307('0xd')]||!_0x4be9ac[_0x0307('0xe')]){throw new db[(_0x0307('0x1b'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x161f31=_0x4be9ac;logger[_0x0307('0x9')](util[_0x0307('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x224226['id']));return sentiment(_0x161f31['data1'],_0x161f31[_0x0307('0xe')],_0x394eb1[_0x0307('0x1f')],_0x224226['fileText'],_0x394eb1[_0x0307('0x33')]);})['then'](function(_0x117e56){logger['info'](util[_0x0307('0xa')](_0x0307('0x28'),_0x224226['id']));return _0x224226[_0x0307('0x19')]({'sentiment':_0x117e56[_0x0307('0x29')],'sPositive':_0x117e56[_0x0307('0x2b')]['Positive'],'sNegative':_0x117e56[_0x0307('0x2b')][_0x0307('0x2c')],'sMixed':_0x117e56['SentimentScore'][_0x0307('0x2d')],'sNeutral':_0x117e56['SentimentScore'][_0x0307('0x2e')],'transcribeStatus':_0x0307('0x13')});})['then'](function(){logger[_0x0307('0x9')](util[_0x0307('0xa')](_0x0307('0x1a'),_0x224226['id']));_0x294f83();});}})[_0x0307('0x34')](function(_0x8a0efb){if(_0x8a0efb){if(!_0x8a0efb['name']||_0x8a0efb[_0x0307('0x35')]!==_0x0307('0x36')){logger[_0x0307('0x37')](util[_0x0307('0xa')](_0x0307('0x38'),_0x224226['id']),util['inspect'](_0x8a0efb,{'showHidden':![],'depth':null}));}}_0x294f83();});});}function checkTranscribe(){var _0x10ffb6;var _0x378813;var _0x54717e;return db[_0x0307('0x39')][_0x0307('0x3a')]({'where':{'transcribeStatus':_0x0307('0x3b')}})[_0x0307('0x24')](function(_0x411ad8){if(!_0x411ad8||!_0x411ad8[_0x0307('0x18')]){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))]('No\x20transcribe\x20job\x20to\x20check');}_0x10ffb6=_0x411ad8;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x0307('0x24')](function(_0x5888b5){if(!_0x5888b5){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))]('Settings\x20not\x20available');}_0x378813=_0x5888b5;if(!_0x378813[_0x0307('0x5')]||!_0x378813[_0x0307('0x3c')]||!_0x378813['transcribeRegion']||!_0x378813['language']||!_0x378813[_0x0307('0x20')]){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))](_0x0307('0x3d'));}return db['CloudProvider'][_0x0307('0x23')]({'where':{'id':_0x378813[_0x0307('0x3c')]}});})['then'](function(_0xc01a14){if(!_0xc01a14){throw new db[(_0x0307('0x1b'))][(_0x0307('0x1c'))](_0x0307('0x25'));}if(!_0xc01a14[_0x0307('0xd')]||!_0xc01a14['data2']){throw new db['Sequelize']['ValidationError'](_0x0307('0x26'));}_0x54717e=_0xc01a14;var _0x5691d6=[];_0x10ffb6[_0x0307('0x3e')](function(_0xcc699b){_0x5691d6['push'](checkTranscribeJob(_0xcc699b,_0x378813,_0x54717e));});return BPromise['all'](_0x5691d6);})[_0x0307('0x34')](function(_0x3415b4){if(_0x3415b4){if(!_0x3415b4[_0x0307('0x35')]||_0x3415b4[_0x0307('0x35')]!==_0x0307('0x36')){logger['error'](util[_0x0307('0x3f')](_0x3415b4,{'showHidden':![],'depth':null}));}}});}exports['start']=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 c9fe1ef..8be590a 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 _0x8f73=['schedule','redis','defaults','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','../../mysqldb','../logger'];(function(_0x5b8423,_0x4c3ec7){var _0x1131c3=function(_0x12462b){while(--_0x12462b){_0x5b8423['push'](_0x5b8423['shift']());}};_0x1131c3(++_0x4c3ec7);}(_0x8f73,0xe6));var _0x38f7=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x8f73[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x38f7('0x0'));var moment=require(_0x38f7('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require(_0x38f7('0x2'))['db'];var logger=require(_0x38f7('0x3'))(_0x38f7('0x4'));config[_0x38f7('0x5')]=_[_0x38f7('0x6')](config[_0x38f7('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x38f7('0x5')]));function closeInteractions(){var _0x54aa70=[];return db[_0x38f7('0x7')][_0x38f7('0x8')]({'raw':!![],'attributes':['id',_0x38f7('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x38f7('0xa'))}}})[_0x38f7('0xb')](function(_0x1493c9){if(_0x1493c9&&_0x1493c9[_0x38f7('0xc')]){_0x54aa70=_[_0x38f7('0xd')](_0x1493c9||[],'id');logger['info'](_0x38f7('0xe'),_0x54aa70[_0x38f7('0xf')]());return db['WhatsappInteraction']['update']({'closeReason':_0x38f7('0x10'),'disposition':_0x38f7('0x11'),'closed':!![],'closedAt':moment()[_0x38f7('0x12')](_0x38f7('0x13'))},{'where':{'id':_0x54aa70}});}})[_0x38f7('0xb')](function(){if(_0x54aa70&&_0x54aa70[_0x38f7('0xc')]){logger[_0x38f7('0x14')](_0x38f7('0x15'),_0x54aa70[_0x38f7('0xf')]());for(var _0x19e159=0x0;_0x19e159<_0x54aa70[_0x38f7('0xc')];_0x19e159++){io['emit']('whatsappInteraction:update',{'id':_0x54aa70[_0x19e159],'closed':!![]});}}})[_0x38f7('0x16')](function(_0x335a04){logger[_0x38f7('0x17')](_0x38f7('0x18'),_0x335a04?util[_0x38f7('0x19')](_0x335a04,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9a0a=['redis','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule'];(function(_0x2c3f9f,_0x1165c9){var _0x290e1c=function(_0x3f1e65){while(--_0x3f1e65){_0x2c3f9f['push'](_0x2c3f9f['shift']());}};_0x290e1c(++_0x1165c9);}(_0x9a0a,0x7c));var _0xa9a0=function(_0x58a282,_0x399ec3){_0x58a282=_0x58a282-0x0;var _0x2c8bc3=_0x9a0a[_0x58a282];return _0x2c8bc3;};'use strict';var _=require(_0xa9a0('0x0'));var moment=require(_0xa9a0('0x1'));var Redis=require(_0xa9a0('0x2'));var util=require(_0xa9a0('0x3'));var config=require(_0xa9a0('0x4'));var db=require(_0xa9a0('0x5'))['db'];var logger=require(_0xa9a0('0x6'))(_0xa9a0('0x7'));config[_0xa9a0('0x8')]=_['defaults'](config[_0xa9a0('0x8')],{'host':_0xa9a0('0x9'),'port':0x18eb});var io=require(_0xa9a0('0xa'))(new Redis(config[_0xa9a0('0x8')]));function closeInteractions(){var _0x1357ea=[];return db[_0xa9a0('0xb')]['findAll']({'raw':!![],'attributes':['id',_0xa9a0('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa9a0('0xd')](0x18,_0xa9a0('0xe'))}}})[_0xa9a0('0xf')](function(_0x316175){if(_0x316175&&_0x316175['length']){_0x1357ea=_[_0xa9a0('0x10')](_0x316175||[],'id');logger['info'](_0xa9a0('0x11'),_0x1357ea[_0xa9a0('0x12')]());return db[_0xa9a0('0xb')][_0xa9a0('0x13')]({'closeReason':'system','disposition':_0xa9a0('0x14'),'closed':!![],'closedAt':moment()[_0xa9a0('0x15')](_0xa9a0('0x16'))},{'where':{'id':_0x1357ea}});}})[_0xa9a0('0xf')](function(){if(_0x1357ea&&_0x1357ea[_0xa9a0('0x17')]){logger[_0xa9a0('0x18')](_0xa9a0('0x19'),_0x1357ea['join']());for(var _0x228311=0x0;_0x228311<_0x1357ea[_0xa9a0('0x17')];_0x228311++){io[_0xa9a0('0x1a')](_0xa9a0('0x1b'),{'id':_0x1357ea[_0x228311],'closed':!![]});}}})[_0xa9a0('0x1c')](function(_0xa3c21e){logger[_0xa9a0('0x1d')](_0xa9a0('0x1e'),_0xa3c21e?util[_0xa9a0('0x1f')](_0xa3c21e,{'showHidden':![],'depth':null}):'');});}exports[_0xa9a0('0x20')]=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 ff881c8..63f262e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc77=['then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','bulkCreate'];(function(_0x172033,_0x1cd43a){var _0x5bf5fa=function(_0x2c9a36){while(--_0x2c9a36){_0x172033['push'](_0x172033['shift']());}};_0x5bf5fa(++_0x1cd43a);}(_0xcc77,0x198));var _0x7cc7=function(_0x5f218a,_0x278674){_0x5f218a=_0x5f218a-0x0;var _0x5056f2=_0xcc77[_0x5f218a];return _0x5056f2;};'use strict';var util=require('util');var db=require(_0x7cc7('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7cc7('0x1')]({'id':i,'firstName':_0x7cc7('0x2')+i,'lastName':_0x7cc7('0x3')+i,'phone':0xf879fb460+i,'email':_0x7cc7('0x4')+i+_0x7cc7('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7cc7('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x7cc7('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7cc7('0x6')](),'updatedAt':Date[_0x7cc7('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7cc7('0x1')]({'id':i,'firstName':_0x7cc7('0x2')+i,'lastName':_0x7cc7('0x3')+i,'phone':0xf879fb460+i,'email':_0x7cc7('0x4')+i+_0x7cc7('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x7cc7('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7cc7('0x6')](),'updatedAt':Date[_0x7cc7('0x6')]()});}db[_0x7cc7('0x7')][_0x7cc7('0x8')]({'where':{}})['then'](function(){return db[_0x7cc7('0x7')][_0x7cc7('0x9')](contacts);})[_0x7cc7('0xa')](function(){console[_0x7cc7('0xb')](_0x7cc7('0xc'),_0x7cc7('0xd'));return db['CmHopper'][_0x7cc7('0x8')]({'where':{}});})[_0x7cc7('0xa')](function(){return db[_0x7cc7('0xe')][_0x7cc7('0x9')](hopper);})[_0x7cc7('0xa')](function(){console['log'](_0x7cc7('0xc'),_0x7cc7('0xf'));return db[_0x7cc7('0x7')][_0x7cc7('0x9')](contacts2);})[_0x7cc7('0xa')](function(){console[_0x7cc7('0xb')](_0x7cc7('0xc'),_0x7cc7('0x10'));return db['CmHopper'][_0x7cc7('0x9')](hopper2);})[_0x7cc7('0xa')](function(){console['log']('finished\x20populating',_0x7cc7('0x11'));})[_0x7cc7('0x12')](function(_0x30a3e4){console[_0x7cc7('0xb')](_0x30a3e4);}); \ No newline at end of file +var _0x9bac=['destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','catch','util','../mysqldb','push','Innocenzo','Biondo','now','@xcally.com','CmContact'];(function(_0x12c403,_0x29d41f){var _0x2ec86c=function(_0xe37905){while(--_0xe37905){_0x12c403['push'](_0x12c403['shift']());}};_0x2ec86c(++_0x29d41f);}(_0x9bac,0x1e8));var _0xc9ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9bac[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xc9ba('0x0'));var db=require(_0xc9ba('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc9ba('0x2')]({'id':i,'firstName':_0xc9ba('0x3')+i,'lastName':_0xc9ba('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc9ba('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc9ba('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc9ba('0x5')](),'updatedAt':Date[_0xc9ba('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc9ba('0x2')]({'id':i,'firstName':_0xc9ba('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc9ba('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xc9ba('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc9ba('0x5')](),'updatedAt':Date['now']()});}db[_0xc9ba('0x7')][_0xc9ba('0x8')]({'where':{}})[_0xc9ba('0x9')](function(){return db[_0xc9ba('0x7')][_0xc9ba('0xa')](contacts);})[_0xc9ba('0x9')](function(){console['log'](_0xc9ba('0xb'),_0xc9ba('0xc'));return db[_0xc9ba('0xd')][_0xc9ba('0x8')]({'where':{}});})[_0xc9ba('0x9')](function(){return db[_0xc9ba('0xd')][_0xc9ba('0xa')](hopper);})['then'](function(){console[_0xc9ba('0xe')](_0xc9ba('0xb'),'hopper1');return db[_0xc9ba('0x7')]['bulkCreate'](contacts2);})[_0xc9ba('0x9')](function(){console['log'](_0xc9ba('0xb'),'contacts2');return db[_0xc9ba('0xd')][_0xc9ba('0xa')](hopper2);})[_0xc9ba('0x9')](function(){console[_0xc9ba('0xe')](_0xc9ba('0xb'),'hopper2');})[_0xc9ba('0xf')](function(_0x4db6b6){console[_0xc9ba('0xe')](_0x4db6b6);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 0970b98..be51867 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ce3=['log','add\x20user','../mysqldb','format','agent','%s%s','%s%s@xcally.com','password','friend','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then'];(function(_0x27d13b,_0x1224fa){var _0x4e126a=function(_0xdbddeb){while(--_0xdbddeb){_0x27d13b['push'](_0x27d13b['shift']());}};_0x4e126a(++_0x1224fa);}(_0x0ce3,0x122));var _0x30ce=function(_0x155488,_0x5dd87b){_0x155488=_0x155488-0x0;var _0xbe08ab=_0x0ce3[_0x155488];return _0xbe08ab;};'use strict';var util=require('util');var db=require(_0x30ce('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x30ce('0x1')]('%s%s',_0x30ce('0x2'),i),'fullname':util[_0x30ce('0x1')](_0x30ce('0x3'),'agent',i),'email':util[_0x30ce('0x1')](_0x30ce('0x4'),'agent',i),'role':'agent','password':_0x30ce('0x5'),'internal':0xfa0+i,'type':_0x30ce('0x6'),'transport':['udp','ws','wss'],'disallow':['all'],'allow':[_0x30ce('0x7')],'defaultuser':util[_0x30ce('0x1')]('%s%s',_0x30ce('0x2'),i),'encryption':_0x30ce('0x8'),'avpf':_0x30ce('0x8'),'force_avp':_0x30ce('0x8'),'icesupport':_0x30ce('0x8'),'dtlsenable':_0x30ce('0x8'),'dtlsverify':'no','dtlscertfile':_0x30ce('0x9'),'dtlsprivatekey':_0x30ce('0xa'),'dtlssetup':_0x30ce('0xb'),'callerid':util[_0x30ce('0x1')](_0x30ce('0xc'),util[_0x30ce('0x1')](_0x30ce('0x3'),_0x30ce('0x2'),i),0xfa0+i)});}db[_0x30ce('0xd')][_0x30ce('0xe')](users)[_0x30ce('0xf')](function(){console[_0x30ce('0x10')](_0x30ce('0x11'));})['catch'](function(_0x33a2c9){console[_0x30ce('0x10')](_0x33a2c9);}); \ No newline at end of file +var _0x1b16=['../mysqldb','push','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','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch'];(function(_0x1ed56f,_0x35e3f9){var _0x565342=function(_0x4ae3fe){while(--_0x4ae3fe){_0x1ed56f['push'](_0x1ed56f['shift']());}};_0x565342(++_0x35e3f9);}(_0x1b16,0x114));var _0x61b1=function(_0x1458ba,_0x2b3bc8){_0x1458ba=_0x1458ba-0x0;var _0x4476f4=_0x1b16[_0x1458ba];return _0x4476f4;};'use strict';var util=require('util');var db=require(_0x61b1('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x61b1('0x1')]({'name':util[_0x61b1('0x2')](_0x61b1('0x3'),_0x61b1('0x4'),i),'fullname':util[_0x61b1('0x2')](_0x61b1('0x3'),_0x61b1('0x4'),i),'email':util['format'](_0x61b1('0x5'),_0x61b1('0x4'),i),'role':_0x61b1('0x4'),'password':_0x61b1('0x6'),'internal':0xfa0+i,'type':_0x61b1('0x7'),'transport':[_0x61b1('0x8'),'ws',_0x61b1('0x9')],'disallow':[_0x61b1('0xa')],'allow':[_0x61b1('0xb')],'defaultuser':util[_0x61b1('0x2')](_0x61b1('0x3'),_0x61b1('0x4'),i),'encryption':_0x61b1('0xc'),'avpf':'yes','force_avp':_0x61b1('0xc'),'icesupport':'yes','dtlsenable':_0x61b1('0xc'),'dtlsverify':'no','dtlscertfile':_0x61b1('0xd'),'dtlsprivatekey':_0x61b1('0xe'),'dtlssetup':_0x61b1('0xf'),'callerid':util['format'](_0x61b1('0x10'),util[_0x61b1('0x2')](_0x61b1('0x3'),'agent',i),0xfa0+i)});}db[_0x61b1('0x11')][_0x61b1('0x12')](users)[_0x61b1('0x13')](function(){console[_0x61b1('0x14')](_0x61b1('0x15'));})[_0x61b1('0x16')](function(_0x3b728f){console['log'](_0x3b728f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 6bb80d9..0a411a8 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2507=['catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','name','role','agent','telephone','type','ivr','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','UserProfileResource','resourceId','map','User','Campaign','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','user','WhatsappQueues','Trunks','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions'];(function(_0x1d6d92,_0x2e6f0b){var _0x31ef3a=function(_0x134f39){while(--_0x134f39){_0x1d6d92['push'](_0x1d6d92['shift']());}};_0x31ef3a(++_0x2e6f0b);}(_0x2507,0xda));var _0x7250=function(_0x3610f3,_0x4bcf94){_0x3610f3=_0x3610f3-0x0;var _0x1fb087=_0x2507[_0x3610f3];return _0x1fb087;};'use strict';var _=require(_0x7250('0x0'));var util=require(_0x7250('0x1'));var BPromise=require(_0x7250('0x2'));var db=require(_0x7250('0x3'))['db'];var config=require(_0x7250('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7250('0x5'),'model':db['User'],'attributes':['id',_0x7250('0x6'),_0x7250('0x7')],'raw':!![],'where':{'role':_0x7250('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7250('0x6')],'where':{'role':_0x7250('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7250('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x7250('0x6')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7250('0x6'),_0x7250('0xa')],'where':{'type':_0x7250('0xb')}};function getAssociatedResources(_0x1a176c,_0x5bdd5d,_0x324c49){return db['UserProfileSection'][_0x7250('0xc')]({'where':{'name':_0x1a176c,'userProfileId':_0x5bdd5d},'raw':!![]})[_0x7250('0xd')](function(_0x387920){if(_0x387920){if(_0x387920['autoAssociation']){switch(_0x1a176c){case _0x7250('0xe'):case _0x7250('0xf'):case _0x7250('0x10'):case _0x7250('0x11'):case _0x7250('0x12'):case _0x7250('0x13'):case'WhatsappQueues':return db[_0x324c49][_0x7250('0x14')](queryQueues);case _0x7250('0x15'):return db[_0x324c49]['findAll'](queryTelephones);case'Trunks':return db[_0x324c49]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x324c49][_0x7250('0x14')](queryCampaigns);}}else{return db[_0x7250('0x16')][_0x7250('0x14')]({'attributes':[_0x7250('0x17')],'where':{'sectionId':_0x387920['id']},'raw':!![]})[_0x7250('0xd')](function(_0x3cc084){if(_0x3cc084){var _0x1bc07b={'where':{'id':_[_0x7250('0x18')](_0x3cc084,'resourceId')},'raw':!![]};switch(_0x324c49){case _0x7250('0x19'):_0x1bc07b['where'][_0x7250('0x7')]=_0x7250('0x9');break;case _0x7250('0x1a'):_0x1bc07b['where'][_0x7250('0xa')]=_0x7250('0xb');break;}return db[_0x324c49][_0x7250('0x14')](_0x1bc07b);}else{return[];}});}}else{return[];}})[_0x7250('0xd')](function(_0xe5eb87){return _0xe5eb87;});}function joinOrLeaveQueues(_0x40f154,_0x4e8c07,_0x4acd29,_0x1ac465){_0x40f154[_0x4e8c07](util[_0x7250('0x1b')](_0x7250('0x1c'),_0x4acd29,_0x1ac465[_0x7250('0x6')]));if(_0x1ac465['Agents']){for(var _0x4c9245=0x0;_0x4c9245<_0x1ac465['Agents']['length'];_0x4c9245+=0x1){_0x40f154[_0x4e8c07](util[_0x7250('0x1b')](_0x7250('0x1d'),_0x1ac465['Agents'][_0x4c9245]['name']));}}}function joinOrLeave(_0x5ec630,_0x4fd807,_0x30bdc3){var _0x17fee4;if(_0x5ec630[_0x7250('0x1e')]['query']['id']){db[_0x7250('0x19')][_0x7250('0x1f')]({'attributes':['id',_0x7250('0x6'),_0x7250('0x7'),_0x7250('0x20')],'where':{'id':_0x5ec630[_0x7250('0x1e')][_0x7250('0x21')]['id']},'include':[{'model':db[_0x7250('0x22')],'as':_0x7250('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x24')],'as':_0x7250('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x26')],'as':_0x7250('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x28')],'as':_0x7250('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x2a')],'as':_0x7250('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x2c')],'as':_0x7250('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x7250('0xd')](function(_0x5b1cb1){if(_0x5b1cb1){_0x17fee4=_0x5b1cb1;_0x5ec630[_0x4fd807](util[_0x7250('0x1b')](_0x7250('0x1d'),_0x5b1cb1[_0x7250('0x6')]));var _0x5a2c80=[];switch(_0x5b1cb1[_0x7250('0x7')]){case _0x7250('0x2e'):_0x5ec630[_0x4fd807]('voice:inbound');_0x5ec630[_0x4fd807](_0x7250('0x2f'));if(queryQueues['hasOwnProperty'](_0x7250('0x30'))){delete queryQueues[_0x7250('0x30')];}_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x32')]['findAll'](queryQueues));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x33')][_0x7250('0x14')](queryQueues));_0x5a2c80['push'](db['FaxQueue'][_0x7250('0x14')](queryQueues));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x34')][_0x7250('0x14')](queryQueues));_0x5a2c80['push'](db['MailQueue'][_0x7250('0x14')](queryQueues));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x35')][_0x7250('0x14')](queryQueues));_0x5a2c80['push'](db[_0x7250('0x36')]['findAll'](queryQueues));_0x5a2c80['push'](db[_0x7250('0x19')]['findAll'](queryTelephones));_0x5a2c80[_0x7250('0x31')](db['Trunk']['findAll'](queryTrunks));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x1a')][_0x7250('0x14')](queryCampaigns));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x19')][_0x7250('0x14')](queryAgents));break;case _0x7250('0x37'):_0x5ec630[_0x4fd807]('voice:inbound');_0x5ec630[_0x4fd807](_0x7250('0x2f'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0xe'),_0x5b1cb1[_0x7250('0x20')],_0x7250('0x32')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources('ChatQueues',_0x5b1cb1[_0x7250('0x20')],_0x7250('0x33')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x10'),_0x5b1cb1['userProfileId'],'FaxQueue'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources('SmsQueues',_0x5b1cb1[_0x7250('0x20')],_0x7250('0x34')));_0x5a2c80['push'](getAssociatedResources(_0x7250('0x12'),_0x5b1cb1[_0x7250('0x20')],'MailQueue'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x13'),_0x5b1cb1['userProfileId'],_0x7250('0x35')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x38'),_0x5b1cb1[_0x7250('0x20')],'WhatsappQueue'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x15'),_0x5b1cb1[_0x7250('0x20')],_0x7250('0x19')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x39'),_0x5b1cb1[_0x7250('0x20')],_0x7250('0x3a')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources('IvrCampaigns',_0x5b1cb1[_0x7250('0x20')],'Campaign'));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x19')][_0x7250('0x14')](queryAgents));break;case _0x7250('0x8'):_0x5ec630[_0x4fd807](_0x7250('0x3b'));_0x5ec630[_0x4fd807](_0x7250('0x2f'));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1[_0x7250('0x3c')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1[_0x7250('0x3d')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80['push'](_0x5b1cb1[_0x7250('0x3e')]({'attributes':['id','name']}));_0x5a2c80['push'](_0x5b1cb1['getSmsQueues']({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80['push'](_0x5b1cb1[_0x7250('0x3f')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1[_0x7250('0x40')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x7250('0x41')](_0x5a2c80);}})['then'](function(_0x5292b4){if(_0x5292b4&&_0x5292b4[_0x7250('0x42')]){for(var _0x2244c4=0x0;_0x2244c4<_0x5292b4[_0x7250('0x42')];_0x2244c4+=0x1){for(var _0x8d2c62=0x0;_0x8d2c62<_0x5292b4[_0x2244c4][_0x7250('0x42')];_0x8d2c62+=0x1){switch(_0x2244c4){case 0x0:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x43'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x1:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x44'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x2:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x45'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x3:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x46'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x4:joinOrLeaveQueues(_0x5ec630,_0x4fd807,'mail',_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x5:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x47'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x6:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x48'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x7:if(_0x17fee4[_0x7250('0x7')]!==_0x7250('0x8'))_0x5ec630[_0x4fd807](util[_0x7250('0x1b')](_0x7250('0x49'),_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;case 0x8:if(_0x17fee4[_0x7250('0x7')]!==_0x7250('0x8'))_0x5ec630[_0x4fd807](util[_0x7250('0x1b')]('trunk:%s',_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;case 0x9:if(_0x17fee4[_0x7250('0x7')]!==_0x7250('0x8'))_0x5ec630[_0x4fd807](util['format'](_0x7250('0x4a'),_0x5292b4[_0x2244c4][_0x8d2c62]['type'],_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;case 0xa:_0x5ec630[_0x4fd807](util[_0x7250('0x1b')](_0x7250('0x1d'),_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;}}}}})[_0x7250('0xd')](function(){if(_0x4fd807===_0x7250('0x4b')){var _0xfb30b8=_[_0x7250('0x18')](_0x17fee4[_0x7250('0x23')],'id');return _0x17fee4['removeChatInteractions'](_0xfb30b8)[_0x7250('0xd')](function(){for(var _0x31640b=0x0;_0x31640b<_0xfb30b8['length'];_0x31640b+=0x1){_0x30bdc3['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xfb30b8[_0x31640b]),'UserId':Number(_0x17fee4['id'])});}});}})['then'](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x3ffb6c=_['map'](_0x17fee4[_0x7250('0x25')],'id');return _0x17fee4[_0x7250('0x4c')](_0x3ffb6c)[_0x7250('0xd')](function(){for(var _0x4da41b=0x0;_0x4da41b<_0x3ffb6c[_0x7250('0x42')];_0x4da41b+=0x1){_0x30bdc3[_0x7250('0x4d')](_0x7250('0x4e'),{'MailInteractionId':Number(_0x3ffb6c[_0x4da41b]),'UserId':Number(_0x17fee4['id'])});}});}})['then'](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x674a2f=_['map'](_0x17fee4[_0x7250('0x27')],'id');return _0x17fee4[_0x7250('0x4f')](_0x674a2f)[_0x7250('0xd')](function(){for(var _0x58d017=0x0;_0x58d017<_0x674a2f[_0x7250('0x42')];_0x58d017+=0x1){_0x30bdc3[_0x7250('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x674a2f[_0x58d017]),'UserId':Number(_0x17fee4['id'])});}});}})[_0x7250('0xd')](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x53d3ec=_['map'](_0x17fee4['SmsInteractions'],'id');return _0x17fee4[_0x7250('0x50')](_0x53d3ec)[_0x7250('0xd')](function(){for(var _0x5a3e65=0x0;_0x5a3e65<_0x53d3ec[_0x7250('0x42')];_0x5a3e65+=0x1){_0x30bdc3[_0x7250('0x4d')](_0x7250('0x51'),{'SmsInteractionId':Number(_0x53d3ec[_0x5a3e65]),'UserId':Number(_0x17fee4['id'])});}});}})[_0x7250('0xd')](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x56cbc2=_[_0x7250('0x18')](_0x17fee4[_0x7250('0x2b')],'id');return _0x17fee4[_0x7250('0x52')](_0x56cbc2)[_0x7250('0xd')](function(){for(var _0x3fd618=0x0;_0x3fd618<_0x56cbc2[_0x7250('0x42')];_0x3fd618+=0x1){_0x30bdc3[_0x7250('0x4d')](_0x7250('0x53'),{'OpenchannelInteractionId':Number(_0x56cbc2[_0x3fd618]),'UserId':Number(_0x17fee4['id'])});}});}})['then'](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x4d8c9a=_[_0x7250('0x18')](_0x17fee4[_0x7250('0x2d')],'id');return _0x17fee4[_0x7250('0x54')](_0x4d8c9a)[_0x7250('0xd')](function(){for(var _0x48f85d=0x0;_0x48f85d<_0x4d8c9a[_0x7250('0x42')];_0x48f85d+=0x1){_0x30bdc3[_0x7250('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4d8c9a[_0x48f85d]),'UserId':Number(_0x17fee4['id'])});}});}})[_0x7250('0x55')](function(_0x2d67f8){_0x5ec630[_0x7250('0x56')](_0x2d67f8);});}}function onDisconnect(_0x26bb7f,_0x5540d7){joinOrLeave(_0x26bb7f,_0x7250('0x4b'),_0x5540d7);}function onConnect(_0x50a283){joinOrLeave(_0x50a283,_0x7250('0x57'));}exports[_0x7250('0x58')]=function(_0x5739e6){_0x5739e6['on'](_0x7250('0x59'),function(_0x528364){_0x528364[_0x7250('0x5a')](0x0);_0x528364[_0x7250('0x5b')]=_0x528364[_0x7250('0x5c')][_0x7250('0x59')][_0x7250('0x5d')]+':'+_0x528364[_0x7250('0x5c')][_0x7250('0x59')][_0x7250('0x5e')];_0x528364[_0x7250('0x5f')]=new Date();_0x528364[_0x7250('0x56')]=function(_0x170e53){console['log'](_0x7250('0x60')+_0x528364[_0x7250('0x61')][_0x7250('0x6')]+'['+_0x528364['address']+']',_0x170e53);};_0x528364['on'](_0x7250('0x62'),function(){onDisconnect(_0x528364,_0x5739e6);_0x528364['log'](_0x7250('0x63'));});onConnect(_0x528364);_0x528364['log'](_0x7250('0x64'));});}; \ No newline at end of file +var _0xbb3e=['../mysqldb','name','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','then','resourceId','where','Campaign','Agents','length','format','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','SmsQueue','MailQueues','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','removeMailInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','log','join','default','connection','address','remoteAddress','request','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird'];(function(_0x14fdf9,_0x1cec84){var _0x48a2a9=function(_0x587762){while(--_0x587762){_0x14fdf9['push'](_0x14fdf9['shift']());}};_0x48a2a9(++_0x1cec84);}(_0xbb3e,0x181));var _0xebb3=function(_0x35a3f3,_0x77834b){_0x35a3f3=_0x35a3f3-0x0;var _0x15ca35=_0xbb3e[_0x35a3f3];return _0x15ca35;};'use strict';var _=require(_0xebb3('0x0'));var util=require(_0xebb3('0x1'));var BPromise=require(_0xebb3('0x2'));var db=require(_0xebb3('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xebb3('0x4')],'include':[{'as':'Agents','model':db[_0xebb3('0x5')],'attributes':['id',_0xebb3('0x4'),_0xebb3('0x6')],'raw':!![],'where':{'role':_0xebb3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xebb3('0x4')],'where':{'role':_0xebb3('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xebb3('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xebb3('0x4')],'where':{'role':_0xebb3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xebb3('0x4'),_0xebb3('0x9')],'where':{'type':_0xebb3('0xa')}};function getAssociatedResources(_0x396ce9,_0x1a26d9,_0xead996){return db[_0xebb3('0xb')][_0xebb3('0xc')]({'where':{'name':_0x396ce9,'userProfileId':_0x1a26d9},'raw':!![]})['then'](function(_0x9d52d2){if(_0x9d52d2){if(_0x9d52d2[_0xebb3('0xd')]){switch(_0x396ce9){case'VoiceQueues':case _0xebb3('0xe'):case _0xebb3('0xf'):case _0xebb3('0x10'):case'MailQueues':case'OpenchannelQueues':case _0xebb3('0x11'):return db[_0xead996][_0xebb3('0x12')](queryQueues);case _0xebb3('0x13'):return db[_0xead996][_0xebb3('0x12')](queryTelephones);case _0xebb3('0x14'):return db[_0xead996][_0xebb3('0x12')](queryTrunks);case _0xebb3('0x15'):return db[_0xead996][_0xebb3('0x12')](queryCampaigns);}}else{return db[_0xebb3('0x16')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x9d52d2['id']},'raw':!![]})[_0xebb3('0x17')](function(_0xe35eb4){if(_0xe35eb4){var _0x50f75e={'where':{'id':_['map'](_0xe35eb4,_0xebb3('0x18'))},'raw':!![]};switch(_0xead996){case'User':_0x50f75e[_0xebb3('0x19')][_0xebb3('0x6')]=_0xebb3('0x8');break;case _0xebb3('0x1a'):_0x50f75e[_0xebb3('0x19')][_0xebb3('0x9')]=_0xebb3('0xa');break;}return db[_0xead996][_0xebb3('0x12')](_0x50f75e);}else{return[];}});}}else{return[];}})[_0xebb3('0x17')](function(_0x5c99b){return _0x5c99b;});}function joinOrLeaveQueues(_0x5cffe1,_0x58bde1,_0x102184,_0x39acdf){_0x5cffe1[_0x58bde1](util['format']('%s:queue:%s',_0x102184,_0x39acdf['name']));if(_0x39acdf[_0xebb3('0x1b')]){for(var _0x116da4=0x0;_0x116da4<_0x39acdf['Agents'][_0xebb3('0x1c')];_0x116da4+=0x1){_0x5cffe1[_0x58bde1](util[_0xebb3('0x1d')](_0xebb3('0x1e'),_0x39acdf['Agents'][_0x116da4]['name']));}}}function joinOrLeave(_0x2cba1c,_0x2b1e69,_0x2e006b){var _0x2f79bb;if(_0x2cba1c[_0xebb3('0x1f')][_0xebb3('0x20')]['id']){db[_0xebb3('0x5')]['find']({'attributes':['id',_0xebb3('0x4'),'role',_0xebb3('0x21')],'where':{'id':_0x2cba1c[_0xebb3('0x1f')]['query']['id']},'include':[{'model':db[_0xebb3('0x22')],'as':_0xebb3('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xebb3('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xebb3('0x25')],'as':_0xebb3('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xebb3('0x27')],'as':_0xebb3('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xebb3('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xebb3('0x2a')],'as':_0xebb3('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xebb3('0x17')](function(_0x397ad3){if(_0x397ad3){_0x2f79bb=_0x397ad3;_0x2cba1c[_0x2b1e69](util['format']('user:%s',_0x397ad3[_0xebb3('0x4')]));var _0x3abbe2=[];switch(_0x397ad3['role']){case'admin':_0x2cba1c[_0x2b1e69](_0xebb3('0x2c'));_0x2cba1c[_0x2b1e69](_0xebb3('0x2d'));if(queryQueues[_0xebb3('0x2e')](_0xebb3('0x2f'))){delete queryQueues['include'];}_0x3abbe2[_0xebb3('0x30')](db[_0xebb3('0x31')]['findAll'](queryQueues));_0x3abbe2[_0xebb3('0x30')](db[_0xebb3('0x32')][_0xebb3('0x12')](queryQueues));_0x3abbe2['push'](db[_0xebb3('0x33')]['findAll'](queryQueues));_0x3abbe2[_0xebb3('0x30')](db['SmsQueue'][_0xebb3('0x12')](queryQueues));_0x3abbe2['push'](db[_0xebb3('0x34')][_0xebb3('0x12')](queryQueues));_0x3abbe2[_0xebb3('0x30')](db[_0xebb3('0x35')][_0xebb3('0x12')](queryQueues));_0x3abbe2[_0xebb3('0x30')](db[_0xebb3('0x36')]['findAll'](queryQueues));_0x3abbe2['push'](db[_0xebb3('0x5')]['findAll'](queryTelephones));_0x3abbe2[_0xebb3('0x30')](db[_0xebb3('0x37')][_0xebb3('0x12')](queryTrunks));_0x3abbe2[_0xebb3('0x30')](db[_0xebb3('0x1a')][_0xebb3('0x12')](queryCampaigns));_0x3abbe2[_0xebb3('0x30')](db['User']['findAll'](queryAgents));break;case _0xebb3('0x38'):_0x2cba1c[_0x2b1e69]('voice:inbound');_0x2cba1c[_0x2b1e69](_0xebb3('0x2d'));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources(_0xebb3('0x39'),_0x397ad3['userProfileId'],'VoiceQueue'));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources(_0xebb3('0xe'),_0x397ad3[_0xebb3('0x21')],_0xebb3('0x32')));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources('FaxQueues',_0x397ad3[_0xebb3('0x21')],_0xebb3('0x33')));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources(_0xebb3('0x10'),_0x397ad3[_0xebb3('0x21')],_0xebb3('0x3a')));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources(_0xebb3('0x3b'),_0x397ad3['userProfileId'],_0xebb3('0x34')));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources(_0xebb3('0x3c'),_0x397ad3[_0xebb3('0x21')],_0xebb3('0x35')));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources(_0xebb3('0x11'),_0x397ad3['userProfileId'],'WhatsappQueue'));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources('Telephones',_0x397ad3['userProfileId'],_0xebb3('0x5')));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources('Trunks',_0x397ad3['userProfileId'],'Trunk'));_0x3abbe2[_0xebb3('0x30')](getAssociatedResources(_0xebb3('0x15'),_0x397ad3[_0xebb3('0x21')],_0xebb3('0x1a')));_0x3abbe2[_0xebb3('0x30')](db[_0xebb3('0x5')]['findAll'](queryAgents));break;case'agent':_0x2cba1c[_0x2b1e69]('voice:inbound');_0x2cba1c[_0x2b1e69](_0xebb3('0x2d'));_0x3abbe2[_0xebb3('0x30')](_0x397ad3[_0xebb3('0x3d')]({'attributes':['id',_0xebb3('0x4')]}));_0x3abbe2[_0xebb3('0x30')](_0x397ad3[_0xebb3('0x3e')]({'attributes':['id',_0xebb3('0x4')]}));_0x3abbe2['push'](_0x397ad3[_0xebb3('0x3f')]({'attributes':['id','name']}));_0x3abbe2[_0xebb3('0x30')](_0x397ad3['getSmsQueues']({'attributes':['id',_0xebb3('0x4')]}));_0x3abbe2[_0xebb3('0x30')](_0x397ad3[_0xebb3('0x40')]({'attributes':['id','name']}));_0x3abbe2[_0xebb3('0x30')](_0x397ad3[_0xebb3('0x41')]({'attributes':['id',_0xebb3('0x4')]}));_0x3abbe2['push'](_0x397ad3[_0xebb3('0x42')]({'attributes':['id',_0xebb3('0x4')]}));break;}return BPromise[_0xebb3('0x43')](_0x3abbe2);}})[_0xebb3('0x17')](function(_0x40116a){if(_0x40116a&&_0x40116a[_0xebb3('0x1c')]){for(var _0x1346e5=0x0;_0x1346e5<_0x40116a['length'];_0x1346e5+=0x1){for(var _0xbd503f=0x0;_0xbd503f<_0x40116a[_0x1346e5]['length'];_0xbd503f+=0x1){switch(_0x1346e5){case 0x0:joinOrLeaveQueues(_0x2cba1c,_0x2b1e69,'voice',_0x40116a[_0x1346e5][_0xbd503f]);break;case 0x1:joinOrLeaveQueues(_0x2cba1c,_0x2b1e69,_0xebb3('0x44'),_0x40116a[_0x1346e5][_0xbd503f]);break;case 0x2:joinOrLeaveQueues(_0x2cba1c,_0x2b1e69,_0xebb3('0x45'),_0x40116a[_0x1346e5][_0xbd503f]);break;case 0x3:joinOrLeaveQueues(_0x2cba1c,_0x2b1e69,'sms',_0x40116a[_0x1346e5][_0xbd503f]);break;case 0x4:joinOrLeaveQueues(_0x2cba1c,_0x2b1e69,_0xebb3('0x46'),_0x40116a[_0x1346e5][_0xbd503f]);break;case 0x5:joinOrLeaveQueues(_0x2cba1c,_0x2b1e69,_0xebb3('0x47'),_0x40116a[_0x1346e5][_0xbd503f]);break;case 0x6:joinOrLeaveQueues(_0x2cba1c,_0x2b1e69,_0xebb3('0x48'),_0x40116a[_0x1346e5][_0xbd503f]);break;case 0x7:if(_0x2f79bb[_0xebb3('0x6')]!==_0xebb3('0x7'))_0x2cba1c[_0x2b1e69](util[_0xebb3('0x1d')](_0xebb3('0x49'),_0x40116a[_0x1346e5][_0xbd503f][_0xebb3('0x4')]));break;case 0x8:if(_0x2f79bb[_0xebb3('0x6')]!=='agent')_0x2cba1c[_0x2b1e69](util['format'](_0xebb3('0x4a'),_0x40116a[_0x1346e5][_0xbd503f][_0xebb3('0x4')]));break;case 0x9:if(_0x2f79bb['role']!==_0xebb3('0x7'))_0x2cba1c[_0x2b1e69](util[_0xebb3('0x1d')](_0xebb3('0x4b'),_0x40116a[_0x1346e5][_0xbd503f][_0xebb3('0x9')],_0x40116a[_0x1346e5][_0xbd503f][_0xebb3('0x4')]));break;case 0xa:_0x2cba1c[_0x2b1e69](util['format'](_0xebb3('0x1e'),_0x40116a[_0x1346e5][_0xbd503f]['name']));break;}}}}})[_0xebb3('0x17')](function(){if(_0x2b1e69===_0xebb3('0x4c')){var _0x2e9c56=_[_0xebb3('0x4d')](_0x2f79bb[_0xebb3('0x23')],'id');return _0x2f79bb[_0xebb3('0x4e')](_0x2e9c56)[_0xebb3('0x17')](function(){for(var _0x515388=0x0;_0x515388<_0x2e9c56[_0xebb3('0x1c')];_0x515388+=0x1){_0x2e006b[_0xebb3('0x4f')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2e9c56[_0x515388]),'UserId':Number(_0x2f79bb['id'])});}});}})[_0xebb3('0x17')](function(){if(_0x2b1e69==='leave'){var _0x1920b9=_[_0xebb3('0x4d')](_0x2f79bb['MailInteractions'],'id');return _0x2f79bb[_0xebb3('0x50')](_0x1920b9)['then'](function(){for(var _0x1a9764=0x0;_0x1a9764<_0x1920b9['length'];_0x1a9764+=0x1){_0x2e006b[_0xebb3('0x4f')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1920b9[_0x1a9764]),'UserId':Number(_0x2f79bb['id'])});}});}})[_0xebb3('0x17')](function(){if(_0x2b1e69==='leave'){var _0x54cd2f=_[_0xebb3('0x4d')](_0x2f79bb[_0xebb3('0x26')],'id');return _0x2f79bb['removeFaxInteractions'](_0x54cd2f)[_0xebb3('0x17')](function(){for(var _0x499769=0x0;_0x499769<_0x54cd2f[_0xebb3('0x1c')];_0x499769+=0x1){_0x2e006b[_0xebb3('0x4f')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x54cd2f[_0x499769]),'UserId':Number(_0x2f79bb['id'])});}});}})['then'](function(){if(_0x2b1e69===_0xebb3('0x4c')){var _0x45468e=_[_0xebb3('0x4d')](_0x2f79bb[_0xebb3('0x28')],'id');return _0x2f79bb[_0xebb3('0x51')](_0x45468e)[_0xebb3('0x17')](function(){for(var _0x3fd963=0x0;_0x3fd963<_0x45468e['length'];_0x3fd963+=0x1){_0x2e006b[_0xebb3('0x4f')](_0xebb3('0x52'),{'SmsInteractionId':Number(_0x45468e[_0x3fd963]),'UserId':Number(_0x2f79bb['id'])});}});}})[_0xebb3('0x17')](function(){if(_0x2b1e69===_0xebb3('0x4c')){var _0x30665d=_[_0xebb3('0x4d')](_0x2f79bb[_0xebb3('0x29')],'id');return _0x2f79bb['removeOpenchannelInteractions'](_0x30665d)[_0xebb3('0x17')](function(){for(var _0x146df1=0x0;_0x146df1<_0x30665d['length'];_0x146df1+=0x1){_0x2e006b[_0xebb3('0x4f')](_0xebb3('0x53'),{'OpenchannelInteractionId':Number(_0x30665d[_0x146df1]),'UserId':Number(_0x2f79bb['id'])});}});}})[_0xebb3('0x17')](function(){if(_0x2b1e69==='leave'){var _0x5bdb63=_['map'](_0x2f79bb[_0xebb3('0x2b')],'id');return _0x2f79bb['removeWhatsappInteractions'](_0x5bdb63)[_0xebb3('0x17')](function(){for(var _0x5cfa12=0x0;_0x5cfa12<_0x5bdb63[_0xebb3('0x1c')];_0x5cfa12+=0x1){_0x2e006b[_0xebb3('0x4f')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x5bdb63[_0x5cfa12]),'UserId':Number(_0x2f79bb['id'])});}});}})['catch'](function(_0x527d3b){_0x2cba1c[_0xebb3('0x54')](_0x527d3b);});}}function onDisconnect(_0x45edad,_0x1076f6){joinOrLeave(_0x45edad,_0xebb3('0x4c'),_0x1076f6);}function onConnect(_0x278528){joinOrLeave(_0x278528,_0xebb3('0x55'));}exports[_0xebb3('0x56')]=function(_0x43ae1e){_0x43ae1e['on'](_0xebb3('0x57'),function(_0x41e99d){_0x41e99d['setMaxListeners'](0x0);_0x41e99d[_0xebb3('0x58')]=_0x41e99d['request'][_0xebb3('0x57')][_0xebb3('0x59')]+':'+_0x41e99d[_0xebb3('0x5a')][_0xebb3('0x57')][_0xebb3('0x5b')];_0x41e99d[_0xebb3('0x5c')]=new Date();_0x41e99d[_0xebb3('0x54')]=function(_0x52a731){console['log']('SocketIO\x20'+_0x41e99d[_0xebb3('0x5d')][_0xebb3('0x4')]+'['+_0x41e99d[_0xebb3('0x58')]+']',_0x52a731);};_0x41e99d['on'](_0xebb3('0x5e'),function(){onDisconnect(_0x41e99d,_0x43ae1e);_0x41e99d[_0xebb3('0x54')](_0xebb3('0x5f'));});onConnect(_0x41e99d);_0x41e99d[_0xebb3('0x54')](_0xebb3('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 1574254..1af5338 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 _0x9c61=['MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','QueryTypes','contact','UserId','interface','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','resolve','Sequelize','SELECT','undefined','format','SIP/%s','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','default','model','condition','util','../../mysqldb','jayson/promise','triggers','client','http','afterCreate','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxMessage','Mail'];(function(_0x2cc7d6,_0xbef312){var _0x23e4ce=function(_0x26b017){while(--_0x26b017){_0x2cc7d6['push'](_0x2cc7d6['shift']());}};_0x23e4ce(++_0xbef312);}(_0x9c61,0x19f));var _0x19c6=function(_0x2040a7,_0x8da657){_0x2040a7=_0x2040a7-0x0;var _0x346357=_0x9c61[_0x2040a7];return _0x346357;};'use strict';var util=require(_0x19c6('0x0'));var db=require(_0x19c6('0x1'))['db'];var jayson=require(_0x19c6('0x2'));var logger=require('../logger')(_0x19c6('0x3'));var client=jayson[_0x19c6('0x4')][_0x19c6('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x19c6('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x19c6('0x7'),'model':'ChatInteraction','event':_0x19c6('0x8'),'condition':_0x19c6('0x9'),'callback':afterUpdate},{'channel':_0x19c6('0x7'),'model':_0x19c6('0xa'),'event':'afterCreate','condition':_0x19c6('0xb'),'callback':afterCreateMessage},{'channel':_0x19c6('0x7'),'model':_0x19c6('0xc'),'event':'afterCreate','condition':_0x19c6('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x19c6('0xd'),'model':_0x19c6('0xe'),'event':_0x19c6('0x6'),'condition':_0x19c6('0xf'),'callback':afterCreate},{'channel':_0x19c6('0xd'),'model':_0x19c6('0xe'),'event':_0x19c6('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x19c6('0xd'),'model':_0x19c6('0x10'),'event':'afterCreate','condition':_0x19c6('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x19c6('0x11'),'event':_0x19c6('0x6'),'condition':_0x19c6('0xf'),'callback':afterCreate},{'channel':_0x19c6('0x12'),'model':_0x19c6('0x11'),'event':'afterUpdate','condition':_0x19c6('0x9'),'callback':afterUpdate},{'channel':_0x19c6('0x12'),'model':_0x19c6('0x13'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x19c6('0x6'),'condition':_0x19c6('0xf'),'callback':afterCreate},{'channel':_0x19c6('0x14'),'model':'FaxInteraction','event':_0x19c6('0x8'),'condition':_0x19c6('0x9'),'callback':afterUpdate},{'channel':'Fax','model':_0x19c6('0x15'),'event':_0x19c6('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x19c6('0x16'),'model':_0x19c6('0x17'),'event':_0x19c6('0x6'),'condition':_0x19c6('0xf'),'callback':afterCreate},{'channel':_0x19c6('0x16'),'model':'MailInteraction','event':_0x19c6('0x8'),'condition':_0x19c6('0x9'),'callback':afterUpdate},{'channel':_0x19c6('0x16'),'model':'MailMessage','event':_0x19c6('0x6'),'condition':_0x19c6('0xb'),'callback':afterCreateMessage},{'channel':_0x19c6('0x18'),'model':_0x19c6('0x19'),'event':_0x19c6('0x6'),'condition':_0x19c6('0xf'),'callback':afterCreate},{'channel':_0x19c6('0x18'),'model':'OpenchannelInteraction','event':_0x19c6('0x8'),'condition':_0x19c6('0x9'),'callback':afterUpdate},{'channel':_0x19c6('0x18'),'model':_0x19c6('0x1a'),'event':_0x19c6('0x6'),'condition':_0x19c6('0xb'),'callback':afterCreateMessage}];function request(_0x4d8293){return client[_0x19c6('0x1b')](_0x19c6('0x1c'),_0x4d8293)[_0x19c6('0x1d')](function(_0x5a6679){logger[_0x19c6('0x1e')](_0x19c6('0x1f'),_0x19c6('0x1c'),_0x5a6679);if(_0x5a6679['error']){if(_0x5a6679[_0x19c6('0x20')][_0x19c6('0x21')]===0x1f4){logger['error'](_0x19c6('0x1f'),_0x19c6('0x1c'),_0x5a6679['error']);}}})[_0x19c6('0x22')](function(_0x3ca80b){logger[_0x19c6('0x20')](_0x19c6('0x1f'),_0x19c6('0x1c'),_0x3ca80b);});}function afterCreateMessage(_0x52cc49){return function(_0x8e6674){_0x8e6674=_0x8e6674[_0x19c6('0x23')]({'plain':!![]});_0x8e6674[_0x19c6('0x24')]=_0x52cc49;_0x8e6674[_0x19c6('0x25')]=_0x52cc49;_0x8e6674[_0x19c6('0x26')]=_0x8e6674[_0x19c6('0x27')];Promise['resolve']()['then'](function(){if(typeof _0x8e6674[_0x19c6('0x28')]==='undefined')return null;var _0x960303=_0x19c6('0x29')+_0x8e6674[_0x19c6('0x28')];return db[_0x19c6('0x2a')][_0x19c6('0x2b')](_0x960303,{'type':db['Sequelize'][_0x19c6('0x2c')]['SELECT'],'raw':!![]});})['then'](function(_0x4441dc){if(_0x4441dc){_0x8e6674[_0x19c6('0x2d')]=_0x4441dc[0x0];}if(typeof _0x8e6674[_0x19c6('0x2e')]==='undefined')return;return getAgent(_0x8e6674[_0x19c6('0x2e')]);})[_0x19c6('0x1d')](function(_0xb0ed21){if(_0xb0ed21){_0x8e6674[_0x19c6('0x2f')]=util['format']('SIP/%s',_0xb0ed21[_0x19c6('0x30')]);_0x8e6674[_0x19c6('0x31')]=_0xb0ed21;_0x8e6674[_0x19c6('0x24')]=_0x52cc49;return request({'event':_0x19c6('0x32'),'message':_0x8e6674});}else{return request({'event':_0x19c6('0x33'),'message':_0x8e6674});}})[_0x19c6('0x22')](function(_0x1d9864){logger['error'](_0x19c6('0x1f'),_0x19c6('0x34'),_0x1d9864);});};}function afterCreateOfflineMessage(_0x233cda){return function(_0x30a374){_0x30a374=_0x30a374[_0x19c6('0x23')]({'plain':!![]});_0x30a374[_0x19c6('0x24')]=_0x233cda;_0x30a374[_0x19c6('0x25')]=_0x233cda;_0x30a374[_0x19c6('0x26')]=_0x19c6('0x35');return request({'event':_0x30a374[_0x19c6('0x26')],'message':_0x30a374});};}function afterCreate(_0x13ef40,_0x31f4d4){return function(_0x2c5ded){_0x2c5ded=_0x2c5ded[_0x19c6('0x23')]({'plain':!![]});_0x2c5ded[_0x19c6('0x24')]=_0x13ef40;_0x2c5ded[_0x19c6('0x25')]=_0x13ef40;_0x2c5ded[_0x19c6('0x26')]=_0x19c6('0x36');Promise[_0x19c6('0x37')]()['then'](function(){var _0x3d8f98=_0x19c6('0x29')+_0x2c5ded[_0x19c6('0x28')];return db[_0x19c6('0x2a')][_0x19c6('0x2b')](_0x3d8f98,{'type':db[_0x19c6('0x38')][_0x19c6('0x2c')][_0x19c6('0x39')],'raw':!![]});})[_0x19c6('0x1d')](function(_0x2d7612){if(_0x2d7612){_0x2c5ded[_0x19c6('0x2d')]=_0x2d7612[0x0];}if(typeof _0x2c5ded[_0x19c6('0x2e')]===_0x19c6('0x3a'))return;return getAgent(_0x2c5ded[_0x19c6('0x2e')]);})[_0x19c6('0x1d')](function(_0x50f0e7){if(_0x50f0e7){_0x2c5ded[_0x19c6('0x2f')]=util[_0x19c6('0x3b')](_0x19c6('0x3c'),_0x50f0e7['name']);_0x2c5ded['agent']=_0x50f0e7;}return request({'event':_0x31f4d4,'message':_0x2c5ded});})[_0x19c6('0x22')](function(_0x2265c4){logger[_0x19c6('0x20')](_0x19c6('0x1f'),_0x19c6('0x3d'),_0x2265c4);});};}function afterUpdate(_0x4f0eae){return function(_0x43e5a6){var _0x351250=_0x43e5a6[_0x19c6('0x3e')]('closed')&&_0x43e5a6[_0x19c6('0x3f')];var _0x105ed4=_0x43e5a6[_0x19c6('0x3e')](_0x19c6('0x40'));if(_0x351250||_0x105ed4){var _0x231adc=_0x351250?'closedinteraction':'substatus';var _0x4391eb=_0x43e5a6[_0x19c6('0x23')]({'plain':!![]});_0x4391eb['channel']=_0x4f0eae;_0x4391eb['motionChannel']=_0x4f0eae;_0x4391eb['event']=_0x351250?_0x19c6('0x3f'):_0x19c6('0x40');var _0x221fcb=_0x19c6('0x29')+_0x4391eb[_0x19c6('0x28')];return db[_0x19c6('0x2a')][_0x19c6('0x2b')](_0x221fcb,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x4b9537){if(_0x4b9537){_0x4391eb[_0x19c6('0x2d')]=_0x4b9537[0x0];}if(typeof _0x4391eb[_0x19c6('0x2e')]===_0x19c6('0x3a'))return;return getAgent(_0x4391eb[_0x19c6('0x2e')]);})[_0x19c6('0x1d')](function(_0x13b52d){if(_0x13b52d){_0x4391eb[_0x19c6('0x2f')]=util[_0x19c6('0x3b')](_0x19c6('0x3c'),_0x13b52d[_0x19c6('0x30')]);_0x4391eb[_0x19c6('0x31')]=_0x13b52d;}return request({'event':_0x231adc,'message':_0x4391eb});})['catch'](function(_0x51badc){logger[_0x19c6('0x20')](_0x19c6('0x1f'),_0x19c6('0x41'),_0x51badc);});}};}function getAgent(_0x34e83d){return db[_0x19c6('0x42')][_0x19c6('0x43')]({'where':{'id':_0x34e83d},'attributes':['id',_0x19c6('0x30'),_0x19c6('0x44'),_0x19c6('0x45'),'internal'],'raw':!![]})[_0x19c6('0x1d')](function(_0xbe218c){return _0xbe218c;});}exports[_0x19c6('0x46')]=function(){for(var _0x5b624e=0x0;_0x5b624e=_0x462218[_0x3779('0x12')]){throw Error(_0x3779('0x13'));}_0x46bd28(_0x36878f);})[_0x3779('0x14')](function(_0x52ce74){_0x49c01d(_0x52ce74);});});}; \ No newline at end of file +var _0x7524=['getLicense','role','agent','User','count','then','Maximum\x20login\x20has\x20been\x20reached','catch','../mysqldb','voice','chat','fax','sms','whatsapp','getChannels','isValidChannel','toLowerCase','includes','updateAttributes'];(function(_0x9f69df,_0x55ca35){var _0x244ec5=function(_0x3ae255){while(--_0x3ae255){_0x9f69df['push'](_0x9f69df['shift']());}};_0x244ec5(++_0x55ca35);}(_0x7524,0xb3));var _0x4752=function(_0x349fb8,_0x172243){_0x349fb8=_0x349fb8-0x0;var _0x26ba4d=_0x7524[_0x349fb8];return _0x26ba4d;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x4752('0x0'))['db'];var util=require('./license/util');var channels=[_0x4752('0x1'),'mail',_0x4752('0x2'),_0x4752('0x3'),_0x4752('0x4'),_0x4752('0x5'),'openchannel'];exports[_0x4752('0x6')]=function(){return channels;};exports[_0x4752('0x7')]=function(_0x36a7f5){_0x36a7f5=_0x36a7f5[_0x4752('0x8')]();return _[_0x4752('0x9')](channels,_0x36a7f5);};exports['clearBlockUser']=function(_0x596709,_0x44c75a,_0x4c19b6,_0x5b0d50){var _0x5ba0f3={'loginAttempts':_0x44c75a,'blocked':_0x4c19b6};if(!_['isUndefined'](_0x5b0d50)){_0x5ba0f3['blockedAt']=_0x5b0d50;}return _0x596709[_0x4752('0xa')](_0x5ba0f3);};exports[_0x4752('0xb')]=function(_0x4ce78b){return new BPromise(function(_0x13de0f,_0x3b80c0){var _0x15c875=0x0;if(_0x4ce78b[_0x4752('0xc')]!==_0x4752('0xd')){_0x13de0f(_0x4ce78b);}db[_0x4752('0xe')][_0x4752('0xf')]({'where':{'role':_0x4752('0xd'),'online':!![],'id':{'$ne':_0x4ce78b['id']}}})[_0x4752('0x10')](function(_0x2e9a8e){_0x15c875=_0x2e9a8e;return util[_0x4752('0xb')]();})[_0x4752('0x10')](function(_0xa590be){if(_0xa590be&&_0xa590be['agents']&&_0x15c875>=_0xa590be['agents']){throw Error(_0x4752('0x11'));}_0x13de0f(_0x4ce78b);})[_0x4752('0x12')](function(_0x1d527f){_0x3b80c0(_0x1d527f);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 8b3469d..d6212ef 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['Not\x20Found','error','stack','send','exports','api','message','name','Error','Bad\x20Request','Forbidden','OutOfInterval'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0xcb91[_0x137d1d];return _0x485108;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x1cb9('0x0'));var APIError=function(_0xe4a5bf,_0x17d4ec){this[_0x1cb9('0x1')]=_0xe4a5bf||'Internal\x20Server\x20Error';this[_0x1cb9('0x2')]=_0x17d4ec||_0x1cb9('0x3');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x13d5fd){this[_0x1cb9('0x1')]=_0x13d5fd||'Bad\x20Request';this[_0x1cb9('0x2')]=_0x1cb9('0x4');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x38737d){this[_0x1cb9('0x1')]=_0x38737d||'Entity\x20not\x20found';this[_0x1cb9('0x2')]='Not\x20Found';util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x45a12f){switch(_0x45a12f){case _0x1cb9('0x4'):return 0x190;case _0x1cb9('0x5'),_0x1cb9('0x6'):return 0x193;case _0x1cb9('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x50ce71){return function(_0x9b58f1){logger[_0x1cb9('0x8')](_0x9b58f1[_0x1cb9('0x9')]);var _0x3fdd83=getStatusCode(_0x9b58f1[_0x1cb9('0x2')]);if(_0x9b58f1['name'])delete _0x9b58f1['name'];return _0x50ce71['status'](_0x3fdd83)[_0x1cb9('0xa')](_0x9b58f1);};}module[_0x1cb9('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xb821=['status','exports','../config/logger','api','message','Error','inherits','name','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack'];(function(_0x52e5d5,_0x52c10a){var _0x574da5=function(_0xbd3fa5){while(--_0xbd3fa5){_0x52e5d5['push'](_0x52e5d5['shift']());}};_0x574da5(++_0x52c10a);}(_0xb821,0xa7));var _0x1b82=function(_0xafdbba,_0x411e9c){_0xafdbba=_0xafdbba-0x0;var _0x54abc3=_0xb821[_0xafdbba];return _0x54abc3;};'use strict';var util=require('util');var logger=require(_0x1b82('0x0'))(_0x1b82('0x1'));var APIError=function(_0x5924c6,_0x4a4f81){this[_0x1b82('0x2')]=_0x5924c6||'Internal\x20Server\x20Error';this['name']=_0x4a4f81||_0x1b82('0x3');util[_0x1b82('0x4')](APIError,Error);};var APIBadRequestError=function(_0x3fadf0){this[_0x1b82('0x2')]=_0x3fadf0||'Bad\x20Request';this[_0x1b82('0x5')]=_0x1b82('0x6');util[_0x1b82('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3632dd){this[_0x1b82('0x2')]=_0x3632dd||_0x1b82('0x7');this[_0x1b82('0x5')]=_0x1b82('0x8');util[_0x1b82('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x4955b5){switch(_0x4955b5){case _0x1b82('0x6'):return 0x190;case _0x1b82('0x9'),_0x1b82('0xa'):return 0x193;case _0x1b82('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xcffb87){return function(_0x17a96b){logger[_0x1b82('0xb')](_0x17a96b[_0x1b82('0xc')]);var _0x5f521f=getStatusCode(_0x17a96b[_0x1b82('0x5')]);if(_0x17a96b[_0x1b82('0x5')])delete _0x17a96b[_0x1b82('0x5')];return _0xcffb87[_0x1b82('0xd')](_0x5f521f)['send'](_0x17a96b);};}module[_0x1b82('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 228dde2..24f5a95 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a5c=['status','json','send','exports','404'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9a5c,0x184));var _0xc9a5=function(_0x17225e,_0x41a3ad){_0x17225e=_0x17225e-0x0;var _0x28536d=_0x9a5c[_0x17225e];return _0x28536d;};'use strict';module[_0xc9a5('0x0')][0x194]=function pageNotFound(_0x33a93d,_0x5cd502){var _0x35a64a=_0xc9a5('0x1');var _0x4374c0=0x194;var _0x1ad288={'status':_0x4374c0};_0x5cd502[_0xc9a5('0x2')](_0x1ad288[_0xc9a5('0x2')]);_0x5cd502['render'](_0x35a64a,{},function(_0x4b0a4b,_0x320e96){if(_0x4b0a4b){return _0x5cd502[_0xc9a5('0x2')](_0x1ad288[_0xc9a5('0x2')])[_0xc9a5('0x3')](_0x1ad288);}_0x5cd502[_0xc9a5('0x4')](_0x320e96);});}; \ No newline at end of file +var _0x6f90=['404','status','render','json'];(function(_0x513d85,_0x4c11ee){var _0x908d16=function(_0x1a2de6){while(--_0x1a2de6){_0x513d85['push'](_0x513d85['shift']());}};_0x908d16(++_0x4c11ee);}(_0x6f90,0x198));var _0x06f9=function(_0x3ff425,_0x20d0b5){_0x3ff425=_0x3ff425-0x0;var _0x5c2a65=_0x6f90[_0x3ff425];return _0x5c2a65;};'use strict';module['exports'][0x194]=function pageNotFound(_0x262601,_0x564580){var _0x4343fb=_0x06f9('0x0');var _0x45b652=0x194;var _0x12ff41={'status':_0x45b652};_0x564580[_0x06f9('0x1')](_0x12ff41[_0x06f9('0x1')]);_0x564580[_0x06f9('0x2')](_0x4343fb,{},function(_0x544db3,_0x27d56f){if(_0x544db3){return _0x564580[_0x06f9('0x1')](_0x12ff41[_0x06f9('0x1')])[_0x06f9('0x3')](_0x12ff41);}_0x564580['send'](_0x27d56f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 45cbab9..d2d8b6a 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(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 49e4e9d..a2947dd 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dfd=['./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/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/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./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/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','/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/voice/prefixes','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/google','./api/authActiveDirectory','/api/jira','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','/api/logs','/apidoc','static','join','/www','root','/demo','/snippet','snippet','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','path','express','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x2dfd,0x10f));var _0xd2df=function(_0x199a78,_0x3108b7){_0x199a78=_0x199a78-0x0;var _0x28fecb=_0x2dfd[_0x199a78];return _0x28fecb;};'use strict';var path=require(_0xd2df('0x0'));var express=require(_0xd2df('0x1'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require(_0xd2df('0x2'))[_0xd2df('0x3')];var clientSideLogs=require(_0xd2df('0x4'));exports[_0xd2df('0x5')]=function(_0x35b6b8){return setupLoggers(_0x35b6b8)[_0xd2df('0x6')](function(){_0x35b6b8[_0xd2df('0x7')]('/api/users',require(_0xd2df('0x8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x9'),require(_0xd2df('0xa')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb'),require(_0xd2df('0xc')));_0x35b6b8[_0xd2df('0x7')]('/api/voice/extensions',require(_0xd2df('0xd')));_0x35b6b8['use'](_0xd2df('0xe'),require('./api/voiceMusicOnHold'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf'),require(_0xd2df('0x10')));_0x35b6b8['use'](_0xd2df('0x11'),require(_0xd2df('0x12')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x13'),require(_0xd2df('0x14')));_0x35b6b8[_0xd2df('0x7')]('/api/voice/mails',require(_0xd2df('0x15')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x16'),require('./api/voiceMailMessage'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x17'),require('./api/voiceCallReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x18'),require(_0xd2df('0x19')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x1a'),require(_0xd2df('0x1b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x1c'),require(_0xd2df('0x1d')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x1e'),require(_0xd2df('0x1f')));_0x35b6b8['use'](_0xd2df('0x20'),require(_0xd2df('0x21')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x22'),require(_0xd2df('0x23')));_0x35b6b8['use'](_0xd2df('0x24'),require(_0xd2df('0x25')));_0x35b6b8['use'](_0xd2df('0x26'),require(_0xd2df('0x27')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x28'),require('./api/mailQueue'));_0x35b6b8['use'](_0xd2df('0x29'),require(_0xd2df('0x2a')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x2b'),require(_0xd2df('0x2c')));_0x35b6b8['use'](_0xd2df('0x2d'),require(_0xd2df('0x2e')));_0x35b6b8['use'](_0xd2df('0x2f'),require('./api/mailApplication'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x30'),require(_0xd2df('0x31')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x32'),require(_0xd2df('0x33')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x34'),require(_0xd2df('0x35')));_0x35b6b8[_0xd2df('0x7')]('/api/fax/accounts',require(_0xd2df('0x36')));_0x35b6b8['use']('/api/fax/applications',require(_0xd2df('0x37')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x38'),require(_0xd2df('0x39')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x3a'),require(_0xd2df('0x3b')));_0x35b6b8['use'](_0xd2df('0x3c'),require(_0xd2df('0x3d')));_0x35b6b8[_0xd2df('0x7')]('/api/fax/reports/queue',require(_0xd2df('0x3e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x3f'),require(_0xd2df('0x40')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x41'),require(_0xd2df('0x42')));_0x35b6b8['use'](_0xd2df('0x43'),require(_0xd2df('0x44')));_0x35b6b8[_0xd2df('0x7')]('/api/sms/messages',require(_0xd2df('0x45')));_0x35b6b8['use'](_0xd2df('0x46'),require('./api/smsQueue'));_0x35b6b8[_0xd2df('0x7')]('/api/openchannel/accounts',require(_0xd2df('0x47')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x48'),require(_0xd2df('0x49')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x4a'),require('./api/openchannelInteraction'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x4b'),require(_0xd2df('0x4c')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x4d'),require(_0xd2df('0x4e')));_0x35b6b8['use'](_0xd2df('0x4f'),require('./api/chatWebsite'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x50'),require(_0xd2df('0x51')));_0x35b6b8[_0xd2df('0x7')]('/api/chat/applications',require(_0xd2df('0x52')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x53'),require('./api/chatInteraction'));_0x35b6b8[_0xd2df('0x7')]('/api/chat/messages',require('./api/chatMessage'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x54'),require(_0xd2df('0x55')));_0x35b6b8['use']('/api/chat/queues',require(_0xd2df('0x56')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x57'),require(_0xd2df('0x58')));_0x35b6b8[_0xd2df('0x7')]('/api/chat/proactive_actions',require(_0xd2df('0x59')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x5a'),require(_0xd2df('0x5b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x5c'),require('./api/cmContact'));_0x35b6b8[_0xd2df('0x7')]('/api/cm/hopper',require(_0xd2df('0x5d')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x5e'),require(_0xd2df('0x5f')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x60'),require(_0xd2df('0x61')));_0x35b6b8['use'](_0xd2df('0x62'),require(_0xd2df('0x63')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x64'),require('./api/cmCustomField'));_0x35b6b8['use'](_0xd2df('0x65'),require(_0xd2df('0x66')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x67'),require(_0xd2df('0x68')));_0x35b6b8[_0xd2df('0x7')]('/api/canned_answers',require(_0xd2df('0x69')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x6a'),require(_0xd2df('0x6b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x6c'),require('./api/condition'));_0x35b6b8[_0xd2df('0x7')]('/api/intervals',require(_0xd2df('0x6d')));_0x35b6b8['use']('/api/pauses',require(_0xd2df('0x6e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x6f'),require(_0xd2df('0x70')));_0x35b6b8['use'](_0xd2df('0x71'),require(_0xd2df('0x72')));_0x35b6b8['use'](_0xd2df('0x73'),require(_0xd2df('0x74')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x75'),require(_0xd2df('0x76')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x77'),require(_0xd2df('0x78')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x79'),require('./api/contactItemType'));_0x35b6b8['use'](_0xd2df('0x7a'),require(_0xd2df('0x7b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x7c'),require('./api/cmHopperAdditionalPhone'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x7d'),require(_0xd2df('0x7e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x7f'),require(_0xd2df('0x80')));_0x35b6b8['use'](_0xd2df('0x81'),require(_0xd2df('0x82')));_0x35b6b8['use'](_0xd2df('0x83'),require(_0xd2df('0x84')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x85'),require(_0xd2df('0x86')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x87'),require('./api/analyticCustomReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x88'),require('./api/analyticDefaultReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x89'),require(_0xd2df('0x8a')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x8b'),require(_0xd2df('0x8c')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x8d'),require(_0xd2df('0x8e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x8f'),require(_0xd2df('0x90')));_0x35b6b8['use']('/api/integrations/salesforce/accounts',require(_0xd2df('0x91')));_0x35b6b8['use'](_0xd2df('0x92'),require('./api/intSalesforceConfiguration'));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/salesforce/fields',require(_0xd2df('0x93')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x94'),require(_0xd2df('0x95')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x96'),require(_0xd2df('0x97')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x98'),require('./api/intSugarcrmField'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x99'),require(_0xd2df('0x9a')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/desk/configurations',require(_0xd2df('0x9b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x9c'),require(_0xd2df('0x9d')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x9e'),require(_0xd2df('0x9f')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa0'),require(_0xd2df('0xa1')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa2'),require(_0xd2df('0xa3')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa4'),require(_0xd2df('0xa5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa6'),require(_0xd2df('0xa7')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/zendesk/fields',require(_0xd2df('0xa8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa9'),require(_0xd2df('0xaa')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xab'),require(_0xd2df('0xac')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/freshdesk/fields',require(_0xd2df('0xad')));_0x35b6b8['use'](_0xd2df('0xae'),require('./api/intVtigerAccount'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xaf'),require(_0xd2df('0xb0')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb1'),require('./api/intVtigerField'));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/servicenow/accounts',require(_0xd2df('0xb2')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb3'),require(_0xd2df('0xb4')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb5'),require(_0xd2df('0xb6')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb7'),require('./api/intDynamics365Account'));_0x35b6b8['use']('/api/integrations/dynamics365/configurations',require(_0xd2df('0xb8')));_0x35b6b8['use']('/api/integrations/dynamics365/fields',require(_0xd2df('0xb9')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x35b6b8['use'](_0xd2df('0xba'),require(_0xd2df('0xbb')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xbc'),require(_0xd2df('0xbd')));_0x35b6b8['use']('/api/networks',require('./api/network'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xbe'),require('./api/chatQueueReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xbf'),require(_0xd2df('0xc0')));_0x35b6b8[_0xd2df('0x7')]('/api/jscripty/answers/reports',require(_0xd2df('0xc1')));_0x35b6b8['use'](_0xd2df('0xc2'),require(_0xd2df('0xc3')));_0x35b6b8['use'](_0xd2df('0xc4'),require('./api/jscriptySessionReport'));_0x35b6b8[_0xd2df('0x7')]('/api/sms/reports/queue',require(_0xd2df('0xc5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xc6'),require('./api/squareReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xc7'),require(_0xd2df('0xc8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xc9'),require(_0xd2df('0xca')));_0x35b6b8['use']('/api/settings',require(_0xd2df('0xcb')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xcc'),require(_0xd2df('0xcd')));_0x35b6b8['use'](_0xd2df('0xce'),require(_0xd2df('0xcf')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd0'),require(_0xd2df('0xd1')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd2'),require(_0xd2df('0xd3')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd4'),require(_0xd2df('0xd5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd6'),require('./api/license'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd7'),require(_0xd2df('0xd8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd9'),require('./api/migration'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xda'),require(_0xd2df('0xdb')));_0x35b6b8['use'](_0xd2df('0xdc'),require(_0xd2df('0xdd')));_0x35b6b8['use'](_0xd2df('0xde'),require(_0xd2df('0xdf')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe0'),require(_0xd2df('0xe1')));_0x35b6b8[_0xd2df('0x7')]('/api/fax/reports/transfer',require(_0xd2df('0xe2')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe3'),require(_0xd2df('0xe4')));_0x35b6b8[_0xd2df('0x7')]('/api/sms/reports/transfer',require(_0xd2df('0xe5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe6'),require('./api/cmList'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe7'),require('./api/voicePrefix'));_0x35b6b8['use']('/api/userProfiles',require(_0xd2df('0xe8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe9'),require('./api/userProfileSection'));_0x35b6b8['use'](_0xd2df('0xea'),require(_0xd2df('0xeb')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xec'),require(_0xd2df('0xed')));_0x35b6b8['use'](_0xd2df('0xee'),require(_0xd2df('0xef')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf0'),require('./api/whatsappApplication'));_0x35b6b8[_0xd2df('0x7')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf1'),require(_0xd2df('0xf2')));_0x35b6b8[_0xd2df('0x7')]('/api/whatsapp/reports/queue',require(_0xd2df('0xf3')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf4'),require(_0xd2df('0xf5')));_0x35b6b8[_0xd2df('0x7')]('/api/whatsapp/queues',require(_0xd2df('0xf6')));_0x35b6b8['use'](_0xd2df('0xf7'),require(_0xd2df('0xf8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf9'),require(_0xd2df('0xfa')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xfb'),require(_0xd2df('0xfc')));_0x35b6b8[_0xd2df('0x7')]('/api/auth/local',require('./api/authLocal'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xfd'),require('./api/authGoogle'));_0x35b6b8[_0xd2df('0x7')]('/api/auth/activedirectory',require(_0xd2df('0xfe')));_0x35b6b8['use'](_0xd2df('0xff'),require('./api/jira'));_0x35b6b8['use']('/api/rpc',require(_0xd2df('0x100')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x101'),require(_0xd2df('0x102')));_0x35b6b8[_0xd2df('0x7')]('/api/system',require('./api/system'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x103'),require(_0xd2df('0x104')));_0x35b6b8['use']('/api/webbar',require('./api/webbar'));_0x35b6b8['use'](_0xd2df('0x105'),clientSideLogs);_0x35b6b8['use'](_0xd2df('0x106'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config['root'],'/apidoc')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x109'),express['static'](path['join'](config[_0xd2df('0x10a')],'/www')));_0x35b6b8['use'](_0xd2df('0x10b'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config[_0xd2df('0x10a')],_0xd2df('0x10b'))));_0x35b6b8['use'](_0xd2df('0x10c'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config[_0xd2df('0x10a')],_0xd2df('0x10d'),_0xd2df('0x10e'))));_0x35b6b8['use'](_0xd2df('0x10f'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config[_0xd2df('0x10a')],_0xd2df('0x110'))));_0x35b6b8[_0xd2df('0x111')](_0xd2df('0x112'))[_0xd2df('0x113')](errors[0x194]);_0x35b6b8[_0xd2df('0x111')]('/*')[_0xd2df('0x113')](function(_0x4b78b7,_0x19715e){_0x19715e[_0xd2df('0x114')](path[_0xd2df('0x115')](_0x35b6b8['get'](_0xd2df('0x116'))+'/index.html'));});return _0x35b6b8;});}; \ No newline at end of file +var _0x91c5=['./api/template','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/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/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/user-setting','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.1.0','/server/files/plugins','route','get','resolve','/index.html','path','express','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','/api/voice/mails','./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/voice/queues/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/contactItemType','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates'];(function(_0x3dd27a,_0x76f3b6){var _0x159a60=function(_0x45ce6c){while(--_0x45ce6c){_0x3dd27a['push'](_0x3dd27a['shift']());}};_0x159a60(++_0x76f3b6);}(_0x91c5,0x1ae));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';var path=require(_0x591c('0x0'));var express=require(_0x591c('0x1'));var errors=require('./errors');var config=require(_0x591c('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0x591c('0x3')];var clientSideLogs=require(_0x591c('0x4'));exports[_0x591c('0x5')]=function(_0x175992){return setupLoggers(_0x175992)[_0x591c('0x6')](function(){_0x175992[_0x591c('0x7')]('/api/users',require(_0x591c('0x8')));_0x175992[_0x591c('0x7')](_0x591c('0x9'),require(_0x591c('0xa')));_0x175992[_0x591c('0x7')](_0x591c('0xb'),require(_0x591c('0xc')));_0x175992[_0x591c('0x7')]('/api/voice/extensions',require(_0x591c('0xd')));_0x175992[_0x591c('0x7')]('/api/voice/mohs',require(_0x591c('0xe')));_0x175992[_0x591c('0x7')](_0x591c('0xf'),require(_0x591c('0x10')));_0x175992['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x175992['use'](_0x591c('0x11'),require('./api/screenRecording'));_0x175992['use'](_0x591c('0x12'),require(_0x591c('0x13')));_0x175992['use'](_0x591c('0x14'),require('./api/voiceMailMessage'));_0x175992[_0x591c('0x7')](_0x591c('0x15'),require(_0x591c('0x16')));_0x175992[_0x591c('0x7')](_0x591c('0x17'),require(_0x591c('0x18')));_0x175992[_0x591c('0x7')](_0x591c('0x19'),require(_0x591c('0x1a')));_0x175992['use'](_0x591c('0x1b'),require('./api/voiceQueueReport'));_0x175992[_0x591c('0x7')]('/api/members/reports',require(_0x591c('0x1c')));_0x175992[_0x591c('0x7')](_0x591c('0x1d'),require('./api/trunk'));_0x175992[_0x591c('0x7')](_0x591c('0x1e'),require(_0x591c('0x1f')));_0x175992[_0x591c('0x7')](_0x591c('0x20'),require(_0x591c('0x21')));_0x175992['use']('/api/mail/accounts',require(_0x591c('0x22')));_0x175992[_0x591c('0x7')](_0x591c('0x23'),require(_0x591c('0x24')));_0x175992[_0x591c('0x7')](_0x591c('0x25'),require(_0x591c('0x26')));_0x175992[_0x591c('0x7')]('/api/mail/interactions',require('./api/mailInteraction'));_0x175992[_0x591c('0x7')](_0x591c('0x27'),require(_0x591c('0x28')));_0x175992['use'](_0x591c('0x29'),require(_0x591c('0x2a')));_0x175992[_0x591c('0x7')]('/api/mail/reports/queue',require(_0x591c('0x2b')));_0x175992[_0x591c('0x7')]('/api/dashboards',require('./api/dashboard'));_0x175992[_0x591c('0x7')]('/api/dashboards/items',require(_0x591c('0x2c')));_0x175992['use'](_0x591c('0x2d'),require('./api/faxAccount'));_0x175992['use'](_0x591c('0x2e'),require(_0x591c('0x2f')));_0x175992[_0x591c('0x7')](_0x591c('0x30'),require('./api/faxInteraction'));_0x175992[_0x591c('0x7')](_0x591c('0x31'),require(_0x591c('0x32')));_0x175992['use'](_0x591c('0x33'),require('./api/faxQueue'));_0x175992[_0x591c('0x7')](_0x591c('0x34'),require(_0x591c('0x35')));_0x175992['use'](_0x591c('0x36'),require(_0x591c('0x37')));_0x175992[_0x591c('0x7')](_0x591c('0x38'),require(_0x591c('0x39')));_0x175992[_0x591c('0x7')]('/api/sms/interactions',require('./api/smsInteraction'));_0x175992[_0x591c('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x175992['use'](_0x591c('0x3a'),require(_0x591c('0x3b')));_0x175992[_0x591c('0x7')]('/api/openchannel/accounts',require(_0x591c('0x3c')));_0x175992[_0x591c('0x7')]('/api/openchannel/applications',require(_0x591c('0x3d')));_0x175992[_0x591c('0x7')]('/api/openchannel/interactions',require(_0x591c('0x3e')));_0x175992[_0x591c('0x7')](_0x591c('0x3f'),require('./api/openchannelMessage'));_0x175992[_0x591c('0x7')](_0x591c('0x40'),require(_0x591c('0x41')));_0x175992[_0x591c('0x7')](_0x591c('0x42'),require(_0x591c('0x43')));_0x175992[_0x591c('0x7')](_0x591c('0x44'),require('./api/openchannelQueueReport'));_0x175992['use']('/api/chat/applications',require('./api/chatApplication'));_0x175992['use'](_0x591c('0x45'),require('./api/chatInteraction'));_0x175992[_0x591c('0x7')](_0x591c('0x46'),require(_0x591c('0x47')));_0x175992[_0x591c('0x7')](_0x591c('0x48'),require(_0x591c('0x49')));_0x175992[_0x591c('0x7')](_0x591c('0x4a'),require(_0x591c('0x4b')));_0x175992[_0x591c('0x7')](_0x591c('0x4c'),require('./api/chatGroup'));_0x175992[_0x591c('0x7')](_0x591c('0x4d'),require(_0x591c('0x4e')));_0x175992[_0x591c('0x7')](_0x591c('0x4f'),require('./api/cmCompany'));_0x175992['use'](_0x591c('0x50'),require(_0x591c('0x51')));_0x175992[_0x591c('0x7')]('/api/cm/hopper',require(_0x591c('0x52')));_0x175992[_0x591c('0x7')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x175992[_0x591c('0x7')](_0x591c('0x53'),require(_0x591c('0x54')));_0x175992['use'](_0x591c('0x55'),require(_0x591c('0x56')));_0x175992['use'](_0x591c('0x57'),require(_0x591c('0x58')));_0x175992[_0x591c('0x7')](_0x591c('0x59'),require(_0x591c('0x5a')));_0x175992[_0x591c('0x7')](_0x591c('0x5b'),require('./api/automation'));_0x175992[_0x591c('0x7')](_0x591c('0x5c'),require(_0x591c('0x5d')));_0x175992['use']('/api/dispositions',require(_0x591c('0x5e')));_0x175992['use'](_0x591c('0x5f'),require('./api/condition'));_0x175992[_0x591c('0x7')](_0x591c('0x60'),require(_0x591c('0x61')));_0x175992[_0x591c('0x7')](_0x591c('0x62'),require(_0x591c('0x63')));_0x175992[_0x591c('0x7')](_0x591c('0x64'),require(_0x591c('0x65')));_0x175992['use'](_0x591c('0x66'),require(_0x591c('0x67')));_0x175992['use'](_0x591c('0x68'),require(_0x591c('0x69')));_0x175992[_0x591c('0x7')](_0x591c('0x6a'),require(_0x591c('0x6b')));_0x175992[_0x591c('0x7')](_0x591c('0x6c'),require(_0x591c('0x6d')));_0x175992[_0x591c('0x7')]('/api/contact_item_types',require(_0x591c('0x6e')));_0x175992[_0x591c('0x7')]('/api/cm_contact_has_items',require(_0x591c('0x6f')));_0x175992[_0x591c('0x7')]('/api/cm_hopper_additional_phones',require(_0x591c('0x70')));_0x175992[_0x591c('0x7')](_0x591c('0x71'),require(_0x591c('0x72')));_0x175992['use']('/api/triggers',require('./api/trigger'));_0x175992[_0x591c('0x7')]('/api/variables',require('./api/variable'));_0x175992[_0x591c('0x7')](_0x591c('0x73'),require('./api/integration'));_0x175992['use']('/api/integrations/reports',require(_0x591c('0x74')));_0x175992[_0x591c('0x7')](_0x591c('0x75'),require(_0x591c('0x76')));_0x175992['use'](_0x591c('0x77'),require('./api/analyticDefaultReport'));_0x175992['use']('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x175992[_0x591c('0x7')](_0x591c('0x78'),require(_0x591c('0x79')));_0x175992[_0x591c('0x7')](_0x591c('0x7a'),require(_0x591c('0x7b')));_0x175992[_0x591c('0x7')](_0x591c('0x7c'),require(_0x591c('0x7d')));_0x175992[_0x591c('0x7')](_0x591c('0x7e'),require(_0x591c('0x7f')));_0x175992[_0x591c('0x7')](_0x591c('0x80'),require(_0x591c('0x81')));_0x175992[_0x591c('0x7')](_0x591c('0x82'),require('./api/intSalesforceField'));_0x175992[_0x591c('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x591c('0x83')));_0x175992[_0x591c('0x7')](_0x591c('0x84'),require(_0x591c('0x85')));_0x175992[_0x591c('0x7')](_0x591c('0x86'),require('./api/intSugarcrmField'));_0x175992[_0x591c('0x7')](_0x591c('0x87'),require(_0x591c('0x88')));_0x175992['use'](_0x591c('0x89'),require(_0x591c('0x8a')));_0x175992[_0x591c('0x7')](_0x591c('0x8b'),require(_0x591c('0x8c')));_0x175992[_0x591c('0x7')](_0x591c('0x8d'),require(_0x591c('0x8e')));_0x175992[_0x591c('0x7')]('/api/integrations/zoho/configurations',require(_0x591c('0x8f')));_0x175992['use'](_0x591c('0x90'),require(_0x591c('0x91')));_0x175992[_0x591c('0x7')](_0x591c('0x92'),require(_0x591c('0x93')));_0x175992['use'](_0x591c('0x94'),require(_0x591c('0x95')));_0x175992['use'](_0x591c('0x96'),require(_0x591c('0x97')));_0x175992[_0x591c('0x7')]('/api/integrations/freshdesk/accounts',require(_0x591c('0x98')));_0x175992['use'](_0x591c('0x99'),require(_0x591c('0x9a')));_0x175992[_0x591c('0x7')]('/api/integrations/freshdesk/fields',require(_0x591c('0x9b')));_0x175992[_0x591c('0x7')]('/api/integrations/vtiger/accounts',require(_0x591c('0x9c')));_0x175992[_0x591c('0x7')](_0x591c('0x9d'),require(_0x591c('0x9e')));_0x175992[_0x591c('0x7')](_0x591c('0x9f'),require(_0x591c('0xa0')));_0x175992[_0x591c('0x7')](_0x591c('0xa1'),require(_0x591c('0xa2')));_0x175992[_0x591c('0x7')]('/api/integrations/servicenow/configurations',require(_0x591c('0xa3')));_0x175992[_0x591c('0x7')]('/api/integrations/servicenow/fields',require(_0x591c('0xa4')));_0x175992['use'](_0x591c('0xa5'),require(_0x591c('0xa6')));_0x175992['use']('/api/integrations/dynamics365/configurations',require(_0x591c('0xa7')));_0x175992[_0x591c('0x7')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x175992['use'](_0x591c('0xa8'),require('./api/intFreshsalesAccount'));_0x175992[_0x591c('0x7')](_0x591c('0xa9'),require(_0x591c('0xaa')));_0x175992[_0x591c('0x7')](_0x591c('0xab'),require(_0x591c('0xac')));_0x175992[_0x591c('0x7')]('/api/networks',require(_0x591c('0xad')));_0x175992[_0x591c('0x7')](_0x591c('0xae'),require(_0x591c('0xaf')));_0x175992[_0x591c('0x7')](_0x591c('0xb0'),require('./api/chatInternalMessage'));_0x175992['use'](_0x591c('0xb1'),require(_0x591c('0xb2')));_0x175992[_0x591c('0x7')](_0x591c('0xb3'),require('./api/jscriptyQuestionReport'));_0x175992['use'](_0x591c('0xb4'),require('./api/jscriptySessionReport'));_0x175992['use'](_0x591c('0xb5'),require(_0x591c('0xb6')));_0x175992['use'](_0x591c('0xb7'),require(_0x591c('0xb8')));_0x175992[_0x591c('0x7')]('/api/square/details/reports',require(_0x591c('0xb9')));_0x175992['use'](_0x591c('0xba'),require(_0x591c('0xbb')));_0x175992[_0x591c('0x7')]('/api/settings',require('./api/setting'));_0x175992[_0x591c('0x7')](_0x591c('0xbc'),require(_0x591c('0xbd')));_0x175992[_0x591c('0x7')]('/api/square/projects',require(_0x591c('0xbe')));_0x175992[_0x591c('0x7')](_0x591c('0xbf'),require(_0x591c('0xc0')));_0x175992['use'](_0x591c('0xc1'),require(_0x591c('0xc2')));_0x175992[_0x591c('0x7')](_0x591c('0xc3'),require('./api/team'));_0x175992[_0x591c('0x7')]('/api/license',require(_0x591c('0xc4')));_0x175992['use'](_0x591c('0xc5'),require(_0x591c('0xc6')));_0x175992['use'](_0x591c('0xc7'),require(_0x591c('0xc8')));_0x175992['use'](_0x591c('0xc9'),require(_0x591c('0xca')));_0x175992[_0x591c('0x7')](_0x591c('0xcb'),require(_0x591c('0xcc')));_0x175992['use'](_0x591c('0xcd'),require(_0x591c('0xce')));_0x175992[_0x591c('0x7')](_0x591c('0xcf'),require(_0x591c('0xd0')));_0x175992[_0x591c('0x7')](_0x591c('0xd1'),require('./api/faxTransferReport'));_0x175992[_0x591c('0x7')](_0x591c('0xd2'),require(_0x591c('0xd3')));_0x175992[_0x591c('0x7')](_0x591c('0xd4'),require(_0x591c('0xd5')));_0x175992[_0x591c('0x7')](_0x591c('0xd6'),require(_0x591c('0xd7')));_0x175992[_0x591c('0x7')](_0x591c('0xd8'),require(_0x591c('0xd9')));_0x175992[_0x591c('0x7')](_0x591c('0xda'),require(_0x591c('0xdb')));_0x175992[_0x591c('0x7')](_0x591c('0xdc'),require('./api/userProfileSection'));_0x175992['use'](_0x591c('0xdd'),require(_0x591c('0xde')));_0x175992[_0x591c('0x7')](_0x591c('0xdf'),require(_0x591c('0xe0')));_0x175992['use'](_0x591c('0xe1'),require(_0x591c('0xe2')));_0x175992[_0x591c('0x7')](_0x591c('0xe3'),require(_0x591c('0xe4')));_0x175992[_0x591c('0x7')](_0x591c('0xe5'),require(_0x591c('0xe6')));_0x175992[_0x591c('0x7')](_0x591c('0xe7'),require(_0x591c('0xe8')));_0x175992['use'](_0x591c('0xe9'),require(_0x591c('0xea')));_0x175992[_0x591c('0x7')](_0x591c('0xeb'),require(_0x591c('0xec')));_0x175992[_0x591c('0x7')](_0x591c('0xed'),require(_0x591c('0xee')));_0x175992[_0x591c('0x7')](_0x591c('0xef'),require(_0x591c('0xf0')));_0x175992[_0x591c('0x7')]('/api/realtime',require('./api/realtime'));_0x175992[_0x591c('0x7')]('/api/user-settings',require(_0x591c('0xf1')));_0x175992[_0x591c('0x7')]('/api/auth/local',require(_0x591c('0xf2')));_0x175992['use'](_0x591c('0xf3'),require('./api/authGoogle'));_0x175992[_0x591c('0x7')](_0x591c('0xf4'),require(_0x591c('0xf5')));_0x175992[_0x591c('0x7')](_0x591c('0xf6'),require(_0x591c('0xf7')));_0x175992[_0x591c('0x7')](_0x591c('0xf8'),require('./api/rpc'));_0x175992[_0x591c('0x7')](_0x591c('0xf9'),require(_0x591c('0xfa')));_0x175992[_0x591c('0x7')](_0x591c('0xfb'),require(_0x591c('0xfc')));_0x175992[_0x591c('0x7')](_0x591c('0xfd'),require(_0x591c('0xfe')));_0x175992['use'](_0x591c('0xff'),require(_0x591c('0x100')));_0x175992[_0x591c('0x7')](_0x591c('0x101'),clientSideLogs);_0x175992[_0x591c('0x7')]('/apidoc',express[_0x591c('0x102')](path[_0x591c('0x103')](config[_0x591c('0x104')],_0x591c('0x105'))));_0x175992['use'](_0x591c('0x106'),express['static'](path[_0x591c('0x103')](config['root'],_0x591c('0x106'))));_0x175992[_0x591c('0x7')](_0x591c('0x107'),express['static'](path[_0x591c('0x103')](config[_0x591c('0x104')],_0x591c('0x107'))));_0x175992['use'](_0x591c('0x108'),express[_0x591c('0x102')](path[_0x591c('0x103')](config['root'],_0x591c('0x109'),_0x591c('0x10a'))));_0x175992[_0x591c('0x7')]('/plugins',express[_0x591c('0x102')](path['join'](config[_0x591c('0x104')],_0x591c('0x10b'))));_0x175992[_0x591c('0x10c')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x591c('0x10d')](errors[0x194]);_0x175992[_0x591c('0x10c')]('/*')[_0x591c('0x10d')](function(_0x2ee15b,_0x396f54){_0x396f54['sendFile'](path[_0x591c('0x10e')](_0x175992[_0x591c('0x10d')]('appPath')+_0x591c('0x10f')));});return _0x175992;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index aa38534..8829df2 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66a9=['../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc'];(function(_0xedacb5,_0x3d9f18){var _0x3f5427=function(_0x36753b){while(--_0x36753b){_0xedacb5['push'](_0xedacb5['shift']());}};_0x3f5427(++_0x3d9f18);}(_0x66a9,0x1a3));var _0x966a=function(_0x14a05c,_0x304800){_0x14a05c=_0x14a05c-0x0;var _0x4199e=_0x66a9[_0x14a05c];return _0x4199e;};'use strict';var jayson=require(_0x966a('0x0'));var _=require(_0x966a('0x1'));var config=require('../config/environment');exports[_0x966a('0x2')]=function(){return new Promise(function(_0x23f246,_0x51e636){var _0x4935b7={};_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x4')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x5')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x6')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x7')));_0x4935b7=_['merge'](_0x4935b7,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x8')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x9')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xa')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0xb')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/trunk/trunk.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xc')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xd')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xe')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xf')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x10')));_0x4935b7=_['merge'](_0x4935b7,require('../api/mailInteraction/mailInteraction.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/mailMessage/mailMessage.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x11')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x12')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x13')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x14')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x15')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x16')));_0x4935b7=_['merge'](_0x4935b7,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/smsAccount/smsAccount.rpc'));_0x4935b7=_['merge'](_0x4935b7,require('../api/smsInteraction/smsInteraction.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/smsMessage/smsMessage.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x17')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x18')));_0x4935b7=_['merge'](_0x4935b7,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4935b7=_['merge'](_0x4935b7,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x19')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1a')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1b')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/cmContact/cmContact.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1c')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x1d')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x1e')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1f')));_0x4935b7=_['merge'](_0x4935b7,require('../api/interval/interval.rpc'));_0x4935b7=_['merge'](_0x4935b7,require('../api/pause/pause.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x20')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x21')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x22')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x23')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x24')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x25')));_0x4935b7=_['merge'](_0x4935b7,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x26')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x27')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x28')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x29')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2a')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2b')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x2c')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x2d')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/setting/setting.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2e')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2f')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/squareRecording/squareRecording.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x30')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x31')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/attachment/attachment.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x32')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x33')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x34')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x35')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x36')));var _0x4d9bfb=jayson[_0x966a('0x37')](_0x4935b7)[_0x966a('0x38')]();var _0x116a19=config['rpc'][_0x966a('0x39')]||config[_0x966a('0x39')]+0x1;var _0x2b3d83=config[_0x966a('0x3a')]['ip']||_0x966a('0x3b');_0x4d9bfb['on'](_0x966a('0x3c'),function(_0x4bca7f){return _0x51e636(_0x4bca7f);});_0x4d9bfb[_0x966a('0x2')](_0x116a19,_0x2b3d83,function(){console[_0x966a('0x3d')](_0x966a('0x3e'),_0x2b3d83,_0x116a19);require(_0x966a('0x3f'))[_0x966a('0x40')]();return _0x23f246(_0x966a('0x41')+_0x2b3d83+':'+_0x116a19);});});}; \ No newline at end of file +var _0xcfab=['../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.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/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc'];(function(_0x303310,_0x3d6211){var _0x1e4370=function(_0x1d648){while(--_0x1d648){_0x303310['push'](_0x303310['shift']());}};_0x1e4370(++_0x3d6211);}(_0xcfab,0x1e0));var _0xbcfa=function(_0x43fcbb,_0x21779){_0x43fcbb=_0x43fcbb-0x0;var _0x460fce=_0xcfab[_0x43fcbb];return _0x460fce;};'use strict';var jayson=require(_0xbcfa('0x0'));var _=require('lodash');var config=require(_0xbcfa('0x1'));exports['listen']=function(){return new Promise(function(_0x253680,_0x4cb4f2){var _0x26cfdc={};_0x26cfdc=_['merge'](_0x26cfdc,require('../api/user/user.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x3')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/voiceQueue/voiceQueue.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x4')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x5')));_0x26cfdc=_['merge'](_0x26cfdc,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x6')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x7')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x8')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x9')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0xa')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0xb')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0xc')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0xd')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0xe')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0xf')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x10')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/faxAccount/faxAccount.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/faxApplication/faxApplication.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x11')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x12')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x13')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x14')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x15')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x16')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x17')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x18')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x19')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x1a')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x1b')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x1c')));_0x26cfdc=_['merge'](_0x26cfdc,require('../api/chatMessage/chatMessage.rpc'));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x1d')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x1e')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/cmHopper/cmHopper.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x1f')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x20')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x21')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x22')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x23')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x24')));_0x26cfdc=_['merge'](_0x26cfdc,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x25')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x26')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/variable/variable.rpc'));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x27')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x28')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x29')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x2a')));_0x26cfdc=_['merge'](_0x26cfdc,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x2b')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x2c')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x2d')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x2e')));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x2f')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x30')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/setting/setting.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x31')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/squareProject/squareProject.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x32')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x33')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x34')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/attachment/attachment.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x35')));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require(_0xbcfa('0x36')));_0x26cfdc=_['merge'](_0x26cfdc,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x26cfdc=_[_0xbcfa('0x2')](_0x26cfdc,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x26cfdc=_['merge'](_0x26cfdc,require(_0xbcfa('0x37')));var _0x536e6e=jayson[_0xbcfa('0x38')](_0x26cfdc)[_0xbcfa('0x39')]();var _0x151d74=config[_0xbcfa('0x3a')][_0xbcfa('0x3b')]||config['port']+0x1;var _0x3a1a88=config[_0xbcfa('0x3a')]['ip']||_0xbcfa('0x3c');_0x536e6e['on'](_0xbcfa('0x3d'),function(_0x4a602c){return _0x4cb4f2(_0x4a602c);});_0x536e6e['listen'](_0x151d74,_0x3a1a88,function(){console[_0xbcfa('0x3e')](_0xbcfa('0x3f'),_0x3a1a88,_0x151d74);require(_0xbcfa('0x40'))['default']();return _0x253680(_0xbcfa('0x41')+_0x3a1a88+':'+_0x151d74);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3e071b1..fa95887 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 _0x73c5=['label','exports','lodash','events','EventEmitter','./reply','./error','call','utf8','headers','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','format','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x73c5,0x197));var _0x573c=function(_0x141cd4,_0x13b5f9){_0x141cd4=_0x141cd4-0x0;var _0x514038=_0x73c5[_0x141cd4];return _0x514038;};'use strict';var util=require('util');var _=require(_0x573c('0x0'));var EventEmitter=require(_0x573c('0x1'))[_0x573c('0x2')];var AGIReply=require(_0x573c('0x3'));var AGIError=require(_0x573c('0x4'));function AGIChannel(_0x1ac483){var _0x33425c=this,_0x198b29=new AGIReply(),_0x2410f8=![],_0x1d0159={};EventEmitter[_0x573c('0x5')](_0x33425c);_0x1ac483['setEncoding'](_0x573c('0x6'));_0x1ac483['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x198b29['setEncoding'](_0x573c('0x6'));_0x198b29['on'](_0x573c('0x7'),function(_0xfe74a6){for(var _0x2e5af2 in _0xfe74a6){_0x33425c[_0x2e5af2]=_0xfe74a6[_0x2e5af2];}_0x33425c['emit']('ready');});_0x198b29['on'](_0x573c('0x8'),function(_0x464467){if(_0x464467[_0x573c('0x9')]()==_0x573c('0xa')){_0x33425c[_0x573c('0xb')]('hangup');return;}if(_0x464467[_0x573c('0xc')](0x0,0xb)==_0x573c('0xd')){_0x2410f8=!![];}if(_0x2410f8){_0x1d0159['rx']+=_0x464467+'\x0a';if(_0x464467[_0x573c('0xe')](_0x573c('0xf'))!=-0x1){_0x2410f8=![];}}else{_0x1d0159['rx']=_0x464467;}if(_0x2410f8){return;}if(typeof _0x1d0159['cb']==_0x573c('0x10')){var _0x3209cd=_0x1d0159['rx']['substring'](0x0,0x3),_0x129ba4=null,_0x5cc2e4=null;_0x3209cd=parseInt(_0x3209cd);if(isNaN(_0x3209cd)){_0x1d0159['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x573c('0x11')});return;}if(_0x3209cd!=0xc8){_0x1d0159['cb'](null,{'code':_0x3209cd,'result':-0x1,'extra':'KO'});return;}_0x129ba4=_0x1d0159['rx'][_0x573c('0xc')](0x4)[_0x573c('0x12')]('result=','');if(_0x129ba4[_0x573c('0x13')]('\x20')!=-0x1){_0x129ba4=_0x129ba4[_0x573c('0x14')](0x0,_0x129ba4['indexOf']('\x20'));}if(_[_0x573c('0x15')](_0x129ba4,'-1')){_0x129ba4=parseInt(_0x129ba4);}_0x5cc2e4=_0x1d0159['rx']['split']('\x20');if(_0x5cc2e4['length']==0x3){_0x5cc2e4=_0x5cc2e4[0x2][_0x573c('0xc')](0x1,_0x5cc2e4[0x2][_0x573c('0x16')]-0x1);}else if(_0x5cc2e4[_0x573c('0x16')]>0x3){var _0x35a616=/\((.+)\)/;var _0x2f9aa9=_0x1d0159['rx'][_0x573c('0x17')](_0x35a616);if(_0x2f9aa9){_0x5cc2e4=_0x2f9aa9[0x1];}else{_0x5cc2e4=null;}}else{_0x5cc2e4=null;}_0x1d0159['cb'](null,{'code':_0x3209cd,'result':_0x129ba4,'extra':_0x5cc2e4});}});_0x1ac483['on'](_0x573c('0x18'),function(_0x2c2754){_0x33425c[_0x573c('0xb')](_0x573c('0x18'),new AGIError(_0x573c('0x19'),_0x2c2754[_0x573c('0x1a')]));});_0x1ac483['on'](_0x573c('0x1b'),function(){_0x33425c['emit'](_0x573c('0x1b'),new AGIError(_0x573c('0x1c')));});_0x1ac483['on'](_0x573c('0x1d'),function(){_0x33425c['emit'](_0x573c('0x1d'),new AGIError(_0x573c('0x1e')));_0x1ac483[_0x573c('0x1f')]();});_0x1ac483[_0x573c('0x20')](_0x198b29);this[_0x573c('0x21')]=function(_0x3a9ed6,_0x333cbf){var _0x3a9ed6=_0x3a9ed6||'',_0x333cbf=typeof _0x333cbf==_0x573c('0x10')?_0x333cbf:new Function();_0x1d0159={'tx':_0x3a9ed6,'rx':'','cb':_0x333cbf};_0x1ac483[_0x573c('0x22')](_0x3a9ed6+'\x0a');},this[_0x573c('0x1b')]=function(){_0x1ac483[_0x573c('0x1f')]();};}util[_0x573c('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x573c('0x24')]=function(_0x393d1e){return this['command'][_0x573c('0x25')](this,_0x393d1e);};AGIChannel[_0x573c('0x26')]['answer']=function(){return this[_0x573c('0x24')](_0x573c('0x27'));};AGIChannel[_0x573c('0x26')]['getData']=function(_0x33441c,_0x2beb78,_0x10f009){_0x33441c=_0x33441c===undefined?'beep':_0x33441c;_0x2beb78=_0x2beb78===undefined?'5':_0x2beb78;_0x10f009=_0x10f009===undefined?'1':_0x10f009;return this[_0x573c('0x24')](util['format'](_0x573c('0x28'),_0x33441c,_0x2beb78*0x3e8,_0x10f009));};AGIChannel[_0x573c('0x26')][_0x573c('0x29')]=function(_0x573a1b){_0x573a1b=_0x573a1b||_0x573c('0x2a');return this['sendRequest'](util['format'](_0x573c('0x2b'),_0x573a1b));};AGIChannel[_0x573c('0x26')]['exec']=function(_0x2cdc39,_0x34c97e){if(_[_0x573c('0x2c')](_0x34c97e)){return this[_0x573c('0x24')](util['format'](_0x573c('0x2d'),_0x2cdc39,_0x34c97e[_0x573c('0x2e')](',')));}return this[_0x573c('0x24')](util['format'](_0x573c('0x2d'),_0x2cdc39,_0x34c97e));};AGIChannel[_0x573c('0x26')][_0x573c('0x2f')]=function(_0x46d5d5){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x31'),_0x46d5d5));};AGIChannel[_0x573c('0x26')][_0x573c('0x32')]=function(_0x2391e6){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x33'),_0x2391e6));};AGIChannel[_0x573c('0x26')]['setPriority']=function(_0x5cb419){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x34'),_0x5cb419));};AGIChannel[_0x573c('0x26')][_0x573c('0xa')]=function(){return this[_0x573c('0x24')](_0x573c('0x35'));};AGIChannel['prototype'][_0x573c('0x36')]=function(_0x2f89bd,_0x2dc65d){var _0x110b2a=_[_0x573c('0x37')](_0x2dc65d)||_[_0x573c('0x38')](_0x2dc65d)?_0x2dc65d[_0x573c('0x39')]():_0x2dc65d;return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x3a'),_0x2f89bd,_0x110b2a?_0x110b2a[_0x573c('0x39')]()[_0x573c('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x573c('0x26')][_0x573c('0x3b')]=function(_0xd53c17,_0x47cc79){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x3c'),_0xd53c17,_0x47cc79));};AGIChannel[_0x573c('0x26')][_0x573c('0x3d')]=function(_0x4d9407,_0x46c19d){return this[_0x573c('0x24')](util['format'](_0x573c('0x3e'),_0x4d9407,_0x46c19d));};AGIChannel[_0x573c('0x26')][_0x573c('0x3f')]=function(_0x455b9d,_0x2dbcdd){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x40'),_0x455b9d,_0x2dbcdd));};AGIChannel[_0x573c('0x26')][_0x573c('0x41')]=function(_0x5c4193,_0x482678,_0x18221d){_0x482678=_0x482678||this[_0x573c('0x42')];_0x18221d=_0x18221d||0x1;this['setContext'](_0x5c4193);this[_0x573c('0x32')](_0x482678);this[_0x573c('0x43')](_0x18221d);return this['noop'](util[_0x573c('0x30')]('GOTO\x20%s\x20%s\x20%s',_0x5c4193,_0x482678,_0x18221d));};AGIChannel[_0x573c('0x26')][_0x573c('0x44')]=function(_0x176504){return this['sendRequest'](util[_0x573c('0x30')](_0x573c('0x45'),_0x176504));};AGIChannel['prototype']['recordFile']=function(_0x465ddc,_0x5e6894,_0x2b61f7,_0x539015,_0x26310d,_0x2616db){_0x5e6894=_0x5e6894||_0x573c('0x46');_0x2b61f7=_0x2b61f7||'';_0x539015=_0x539015===undefined?-0x1:_0x539015==='-1'?-0x1:_0x539015*0x3e8;_0x26310d=_0x26310d===undefined?'':'s='+_0x26310d;_0x2616db=_0x2616db?_0x573c('0x47'):'';return this['sendRequest'](util['format'](_0x573c('0x48'),_0x465ddc,_0x5e6894,_0x2b61f7,_0x539015,_0x2616db,_0x26310d));};AGIChannel['prototype'][_0x573c('0x49')]=function(_0x34d594,_0x2df41f){_0x2df41f=_0x2df41f||'';return this[_0x573c('0x24')](util[_0x573c('0x30')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x34d594,_0x2df41f));};AGIChannel[_0x573c('0x26')]['agi']=function(_0x3f07f1){return this[_0x573c('0x4a')](_0x573c('0x4b'),_0x3f07f1);};AGIChannel['prototype'][_0x573c('0x4c')]=function(_0x126cc){return this['exec'](_0x573c('0x4d'),_0x126cc);};AGIChannel[_0x573c('0x26')]['error']=function(_0x3d8929,_0x56e986){this['noop'](util[_0x573c('0x30')](_0x573c('0x4e'),_0x3d8929['id'],_0x3d8929[_0x573c('0x4f')],_0x56e986));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x573c('0x50')]=AGIChannel; \ No newline at end of file +var _0xc274=['NO\x20MESSAGE','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','./reply','./error','call','utf8','setTimeout','setEncoding','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','function','no\x20code','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop'];(function(_0x5866d1,_0xa6dc72){var _0x30071f=function(_0x482390){while(--_0x482390){_0x5866d1['push'](_0x5866d1['shift']());}};_0x30071f(++_0xa6dc72);}(_0xc274,0x151));var _0x4c27=function(_0x46d48f,_0x5e3afc){_0x46d48f=_0x46d48f-0x0;var _0x53e28e=_0xc274[_0x46d48f];return _0x53e28e;};'use strict';var util=require('util');var _=require(_0x4c27('0x0'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x4c27('0x1'));var AGIError=require(_0x4c27('0x2'));function AGIChannel(_0xce0b00){var _0x15133d=this,_0x2771df=new AGIReply(),_0x17970c=![],_0x534d34={};EventEmitter[_0x4c27('0x3')](_0x15133d);_0xce0b00['setEncoding'](_0x4c27('0x4'));_0xce0b00[_0x4c27('0x5')](0x8*0x3c*0x3c*0x3e8);_0x2771df[_0x4c27('0x6')]('utf8');_0x2771df['on']('headers',function(_0x36daa2){for(var _0x5eb920 in _0x36daa2){_0x15133d[_0x5eb920]=_0x36daa2[_0x5eb920];}_0x15133d[_0x4c27('0x7')](_0x4c27('0x8'));});_0x2771df['on'](_0x4c27('0x9'),function(_0x846d26){if(_0x846d26[_0x4c27('0xa')]()=='hangup'){_0x15133d[_0x4c27('0x7')](_0x4c27('0xb'));return;}if(_0x846d26[_0x4c27('0xc')](0x0,0xb)==_0x4c27('0xd')){_0x17970c=!![];}if(_0x17970c){_0x534d34['rx']+=_0x846d26+'\x0a';if(_0x846d26['search']('520\x20End\x20of\x20proper')!=-0x1){_0x17970c=![];}}else{_0x534d34['rx']=_0x846d26;}if(_0x17970c){return;}if(typeof _0x534d34['cb']==_0x4c27('0xe')){var _0x277793=_0x534d34['rx'][_0x4c27('0xc')](0x0,0x3),_0x502935=null,_0x557349=null;_0x277793=parseInt(_0x277793);if(isNaN(_0x277793)){_0x534d34['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4c27('0xf')});return;}if(_0x277793!=0xc8){_0x534d34['cb'](null,{'code':_0x277793,'result':-0x1,'extra':'KO'});return;}_0x502935=_0x534d34['rx'][_0x4c27('0xc')](0x4)['replace'](_0x4c27('0x10'),'');if(_0x502935[_0x4c27('0x11')]('\x20')!=-0x1){_0x502935=_0x502935[_0x4c27('0x12')](0x0,_0x502935['indexOf']('\x20'));}if(_[_0x4c27('0x13')](_0x502935,'-1')){_0x502935=parseInt(_0x502935);}_0x557349=_0x534d34['rx']['split']('\x20');if(_0x557349['length']==0x3){_0x557349=_0x557349[0x2][_0x4c27('0xc')](0x1,_0x557349[0x2][_0x4c27('0x14')]-0x1);}else if(_0x557349[_0x4c27('0x14')]>0x3){var _0x4762ad=/\((.+)\)/;var _0x4af791=_0x534d34['rx'][_0x4c27('0x15')](_0x4762ad);if(_0x4af791){_0x557349=_0x4af791[0x1];}else{_0x557349=null;}}else{_0x557349=null;}_0x534d34['cb'](null,{'code':_0x277793,'result':_0x502935,'extra':_0x557349});}});_0xce0b00['on'](_0x4c27('0x16'),function(_0x4bf2fb){_0x15133d[_0x4c27('0x7')](_0x4c27('0x16'),new AGIError(_0x4c27('0x17'),_0x4bf2fb[_0x4c27('0x18')]));});_0xce0b00['on']('close',function(){_0x15133d[_0x4c27('0x7')](_0x4c27('0x19'),new AGIError(_0x4c27('0x1a')));});_0xce0b00['on']('timeout',function(){_0x15133d[_0x4c27('0x7')](_0x4c27('0x1b'),new AGIError(_0x4c27('0x1c')));_0xce0b00[_0x4c27('0x1d')]();});_0xce0b00[_0x4c27('0x1e')](_0x2771df);this[_0x4c27('0x1f')]=function(_0x2aab4e,_0x1c1738){var _0x2aab4e=_0x2aab4e||'',_0x1c1738=typeof _0x1c1738==_0x4c27('0xe')?_0x1c1738:new Function();_0x534d34={'tx':_0x2aab4e,'rx':'','cb':_0x1c1738};_0xce0b00[_0x4c27('0x20')](_0x2aab4e+'\x0a');},this[_0x4c27('0x19')]=function(){_0xce0b00[_0x4c27('0x1d')]();};}util[_0x4c27('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x4c27('0x22')][_0x4c27('0x23')]=function(_0x2977b5){return this[_0x4c27('0x1f')][_0x4c27('0x24')](this,_0x2977b5);};AGIChannel['prototype'][_0x4c27('0x25')]=function(){return this[_0x4c27('0x23')](_0x4c27('0x26'));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x27')]=function(_0x57bc09,_0x2d2258,_0x383e75){_0x57bc09=_0x57bc09===undefined?_0x4c27('0x28'):_0x57bc09;_0x2d2258=_0x2d2258===undefined?'5':_0x2d2258;_0x383e75=_0x383e75===undefined?'1':_0x383e75;return this[_0x4c27('0x23')](util[_0x4c27('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x57bc09,_0x2d2258*0x3e8,_0x383e75));};AGIChannel['prototype'][_0x4c27('0x2a')]=function(_0x37d6d6){_0x37d6d6=_0x37d6d6||_0x4c27('0x2b');return this[_0x4c27('0x23')](util['format']('VERBOSE\x20\x22%s\x22',_0x37d6d6));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x2c')]=function(_0x52c61e,_0x3b66f7){if(_[_0x4c27('0x2d')](_0x3b66f7)){return this[_0x4c27('0x23')](util[_0x4c27('0x29')]('EXEC\x20%s\x20%s',_0x52c61e,_0x3b66f7[_0x4c27('0x2e')](',')));}return this['sendRequest'](util[_0x4c27('0x29')](_0x4c27('0x2f'),_0x52c61e,_0x3b66f7));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x30')]=function(_0x5d216b){return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x31'),_0x5d216b));};AGIChannel['prototype'][_0x4c27('0x32')]=function(_0x8edceb){return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x33'),_0x8edceb));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x34')]=function(_0x1ac642){return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x35'),_0x1ac642));};AGIChannel[_0x4c27('0x22')]['hangup']=function(){return this[_0x4c27('0x23')]('HANGUP');};AGIChannel[_0x4c27('0x22')][_0x4c27('0x36')]=function(_0x295fc1,_0x29c327){var _0x3f52b0=_[_0x4c27('0x37')](_0x29c327)||_['isNumber'](_0x29c327)?_0x29c327[_0x4c27('0x38')]():_0x29c327;return this['sendRequest'](util[_0x4c27('0x29')](_0x4c27('0x39'),_0x295fc1,_0x3f52b0?_0x3f52b0[_0x4c27('0x38')]()[_0x4c27('0x3a')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4c27('0x22')]['sayNumber']=function(_0x150742,_0x107a9b){return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x3b'),_0x150742,_0x107a9b));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x3c')]=function(_0x55e737,_0x6f9e79){return this['sendRequest'](util['format'](_0x4c27('0x3d'),_0x55e737,_0x6f9e79));};AGIChannel[_0x4c27('0x22')]['sayPhonetic']=function(_0x5071cc,_0x77b252){return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x3e'),_0x5071cc,_0x77b252));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x3f')]=function(_0x19b073,_0x3c6268,_0x5616cd){_0x3c6268=_0x3c6268||this[_0x4c27('0x40')];_0x5616cd=_0x5616cd||0x1;this['setContext'](_0x19b073);this[_0x4c27('0x32')](_0x3c6268);this['setPriority'](_0x5616cd);return this['noop'](util['format'](_0x4c27('0x41'),_0x19b073,_0x3c6268,_0x5616cd));};AGIChannel[_0x4c27('0x22')]['getVariable']=function(_0x2bcf7a){return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x42'),_0x2bcf7a));};AGIChannel[_0x4c27('0x22')]['recordFile']=function(_0x8e51a0,_0x4d538b,_0x41c842,_0x2da8ac,_0x456b0c,_0x56eb4d){_0x4d538b=_0x4d538b||_0x4c27('0x43');_0x41c842=_0x41c842||'';_0x2da8ac=_0x2da8ac===undefined?-0x1:_0x2da8ac==='-1'?-0x1:_0x2da8ac*0x3e8;_0x456b0c=_0x456b0c===undefined?'':'s='+_0x456b0c;_0x56eb4d=_0x56eb4d?'BEEP':'';return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x44'),_0x8e51a0,_0x4d538b,_0x41c842,_0x2da8ac,_0x56eb4d,_0x456b0c));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x45')]=function(_0x33738f,_0x45e767){_0x45e767=_0x45e767||'';return this[_0x4c27('0x23')](util[_0x4c27('0x29')](_0x4c27('0x46'),_0x33738f,_0x45e767));};AGIChannel[_0x4c27('0x22')][_0x4c27('0x47')]=function(_0x23b539){return this[_0x4c27('0x2c')]('AGI',_0x23b539);};AGIChannel[_0x4c27('0x22')]['wait']=function(_0x17f187){return this['exec'](_0x4c27('0x48'),_0x17f187);};AGIChannel[_0x4c27('0x22')]['error']=function(_0x37057b,_0x40757e){this[_0x4c27('0x2a')](util[_0x4c27('0x29')](_0x4c27('0x49'),_0x37057b['id'],_0x37057b[_0x4c27('0x4a')],_0x40757e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4c27('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ffd5e73..38656f4 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 _0x309d=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x26a5d3,_0x1eac55){var _0x2fb09d=function(_0x55e2f9){while(--_0x55e2f9){_0x26a5d3['push'](_0x26a5d3['shift']());}};_0x2fb09d(++_0x1eac55);}(_0x309d,0xa6));var _0xd309=function(_0x397e1f,_0x3193f7){_0x397e1f=_0x397e1f-0x0;var _0x452db3=_0x309d[_0x397e1f];return _0x452db3;};'use strict';var util=require(_0xd309('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xd309('0x1'),'E_AGI_SERVER_ERROR':_0xd309('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xd309('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xd309('0x4'),'E_AGI_COMMAND_EMPTY':_0xd309('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd309('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x23566b){var _0x23566b=_0x23566b||null,_0x414d48=_0x414d48||[],_0x233050=0x1,_0x2870f8='';if(!error[_0x23566b]){_0x23566b='E_AGI_UNDEFINED';}_0x414d48['push'](error[_0x23566b]);while(arguments[_0x233050]){_0x414d48[_0xd309('0x7')](arguments[_0x233050]);_0x233050++;}_0x2870f8=util[_0xd309('0x8')][_0xd309('0x9')](util,_0x414d48);this[_0xd309('0xa')]=_0x2870f8;this[_0xd309('0xb')]=_0x23566b;}module[_0xd309('0xc')]=AGIError; \ No newline at end of file +var _0x3129=['push','format','apply','message','name','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.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x3e5444,_0x503bc7){var _0x3f5d92=function(_0x39df44){while(--_0x39df44){_0x3e5444['push'](_0x3e5444['shift']());}};_0x3f5d92(++_0x503bc7);}(_0x3129,0x66));var _0x9312=function(_0x2f72af,_0xfaebbb){_0x2f72af=_0x2f72af-0x0;var _0x4247ad=_0x3129[_0x2f72af];return _0x4247ad;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x9312('0x0'),'E_AGI_ARGUMENT_PORT':_0x9312('0x1'),'E_AGI_SERVER_ERROR':_0x9312('0x2'),'E_AGI_SERVER_CLOSE':_0x9312('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x9312('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x9312('0x5'),'E_AGI_SOCKET_ERROR':_0x9312('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x9312('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9312('0x8'),'E_AGI_IVR_ENTRY':_0x9312('0x9')};function AGIError(_0x121d61){var _0x121d61=_0x121d61||null,_0x460a90=_0x460a90||[],_0x323bca=0x1,_0x366af7='';if(!error[_0x121d61]){_0x121d61='E_AGI_UNDEFINED';}_0x460a90[_0x9312('0xa')](error[_0x121d61]);while(arguments[_0x323bca]){_0x460a90['push'](arguments[_0x323bca]);_0x323bca++;}_0x366af7=util[_0x9312('0xb')][_0x9312('0xc')](util,_0x460a90);this[_0x9312('0xd')]=_0x366af7;this[_0x9312('0xe')]=_0x121d61;}module[_0x9312('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 1dec60c..06de7c5 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 _0x0473=['message','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','subscribe','agi','emit','error'];(function(_0x31f216,_0x5ea0d3){var _0x4fcada=function(_0x56eb01){while(--_0x56eb01){_0x31f216['push'](_0x31f216['shift']());}};_0x4fcada(++_0x5ea0d3);}(_0x0473,0x6c));var _0x3047=function(_0x59d692,_0x637365){_0x59d692=_0x59d692-0x0;var _0x13316a=_0x0473[_0x59d692];return _0x13316a;};'use strict';var _=require(_0x3047('0x0'));var EventEmitter=require(_0x3047('0x1'))[_0x3047('0x2')];var Redis=require(_0x3047('0x3'));var AGIError=require(_0x3047('0x4'));var config=require(_0x3047('0x5'));config[_0x3047('0x6')]=_[_0x3047('0x7')](config[_0x3047('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x3047('0x6')]);sub[_0x3047('0x8')](_0x3047('0x9'),function(_0xaadea5){if(_0xaadea5)return eventEmitter[_0x3047('0xa')](_0x3047('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0xaadea5));});sub['on'](_0x3047('0xc'),function(_0xae78a5,_0x477eec){if(_0xae78a5!==_0x3047('0x9'))return;try{var _0x8a35b2=JSON['parse'](_0x477eec);eventEmitter['emit'](_0x3047('0xd'),_0x8a35b2);}catch(_0x39ec2d){eventEmitter[_0x3047('0xa')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x39ec2d));}});module[_0x3047('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xe0c1=['exports','lodash','events','./error','redis','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','parse','projectUpdate','error'];(function(_0x26c42d,_0x9863e0){var _0x4a7d6a=function(_0x109183){while(--_0x109183){_0x26c42d['push'](_0x26c42d['shift']());}};_0x4a7d6a(++_0x9863e0);}(_0xe0c1,0x146));var _0x1e0c=function(_0xeb34e2,_0x834e4){_0xeb34e2=_0xeb34e2-0x0;var _0x4d8e23=_0xe0c1[_0xeb34e2];return _0x4d8e23;};'use strict';var _=require(_0x1e0c('0x0'));var EventEmitter=require(_0x1e0c('0x1'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0x1e0c('0x2'));var config=require('../../config/environment');config['redis']=_['defaults'](config[_0x1e0c('0x3')],{'host':_0x1e0c('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x1e0c('0x3')]);sub[_0x1e0c('0x5')](_0x1e0c('0x6'),function(_0x3fbda6){if(_0x3fbda6)return eventEmitter[_0x1e0c('0x7')]('error',new AGIError(_0x1e0c('0x8'),_0x3fbda6));});sub['on']('message',function(_0x439966,_0xf1937d){if(_0x439966!==_0x1e0c('0x6'))return;try{var _0x1acf24=JSON[_0x1e0c('0x9')](_0xf1937d);eventEmitter[_0x1e0c('0x7')](_0x1e0c('0xa'),_0x1acf24);}catch(_0x51b4a2){eventEmitter[_0x1e0c('0x7')](_0x1e0c('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x51b4a2));}});module[_0x1e0c('0xc')]={'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 4040b54..0ff2309 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 _0x9d72=['prototype','addVertex','vertices','push','numberOfEdges','size','info','length','condition','agicommand','target','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','edges'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x9d72,0x1b3));var _0x29d7=function(_0x2a6a46,_0x36aa81){_0x2a6a46=_0x2a6a46-0x0;var _0xaf0836=_0x9d72[_0x2a6a46];return _0xaf0836;};'use strict';var _=require(_0x29d7('0x0'));var logger=require(_0x29d7('0x1'))('agi');var verticesWithRetry=[_0x29d7('0x2'),_0x29d7('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x29d7('0x4')]={};this['numberOfEdges']=0x0;};Graph[_0x29d7('0x5')][_0x29d7('0x6')]=function(_0x2699d6){this[_0x29d7('0x7')][_0x2699d6['id']]=_0x2699d6;this['edges'][_0x2699d6['id']]=[];};Graph[_0x29d7('0x5')]['addEdge']=function(_0x382d85,_0x1655fc,_0x3e0900){this[_0x29d7('0x4')][_0x382d85][_0x29d7('0x8')]({'target':_0x1655fc,'condition':_0x3e0900});this[_0x29d7('0x9')]+=0x1;};Graph[_0x29d7('0x5')][_0x29d7('0xa')]=function(){return _['size'](this[_0x29d7('0x7')]);};Graph['prototype']['relations']=function(){return this[_0x29d7('0x9')];};Graph[_0x29d7('0x5')]['getVertex']=function(_0x257f7c){return this[_0x29d7('0x7')][_0x257f7c];};Graph[_0x29d7('0x5')]['traverseBFS']=function(_0x25b96c,_0x57ed56){if(!this[_0x29d7('0x7')][_0x25b96c]){return logger[_0x29d7('0xb')]('no\x20vertex\x20found');}var _0x22a6dd=_0x57ed56(this['vertices'][_0x25b96c]);if(!_0x22a6dd){return logger['info']('stop\x20traverse');}if(this[_0x29d7('0x4')][_0x25b96c][_0x29d7('0xc')]===0x0){return logger[_0x29d7('0xb')]('no\x20edge/s\x20available');}for(var _0x3a815f=0x0,_0x3d8422=[],_0x2e4d3c=![];_0x3a815f\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','find','production','initialize','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','syncho'];(function(_0x16a3f7,_0x57babe){var _0x362bf2=function(_0x9c3788){while(--_0x9c3788){_0x16a3f7['push'](_0x16a3f7['shift']());}};_0x362bf2(++_0x57babe);}(_0x2e38,0x143));var _0x82e3=function(_0x819d68,_0x4acdb0){_0x819d68=_0x819d68-0x0;var _0x35ce88=_0x2e38[_0x819d68];return _0x35ce88;};'use strict';var _=require('lodash');var syncho=require(_0x82e3('0x0'));var util=require('util');var config=require(_0x82e3('0x1'));var logger=require(_0x82e3('0x2'))(_0x82e3('0x3'));var utilLicense=require(_0x82e3('0x4'));var rpc=require('./rpc');var Project=require(_0x82e3('0x5'));var AGIEmitter=require('./events')[_0x82e3('0x6')];var projects=[];config[_0x82e3('0x3')]=_['defaults'](config['agi'],{'ip':_0x82e3('0x7'),'port':0x11dd});AGIEmitter['on'](_0x82e3('0x8'),projectUpdateHandler);function connectionHandler(_0x113ece){process[_0x82e3('0x9')](function(){syncho(function(){try{setChannelVariables(_0x113ece);agiHandler(_0x113ece);}catch(_0x2678cf){logger[_0x82e3('0xa')](_0x2678cf[_0x82e3('0xb')]);}});});}function projectUpdateHandler(_0x494ee1){try{var _0x58e7a9=_[_0x82e3('0xc')](projects,['id',_0x494ee1['id']]);if(_0x58e7a9>-0x1){if(_0x494ee1['deleted']===!![]){projects[_0x82e3('0xd')](_0x58e7a9,0x1);}else{projects[_0x58e7a9]=_0x494ee1;}}else{projects['push'](_0x494ee1);}}catch(_0x3e40d6){logger['error'](_0x3e40d6[_0x82e3('0xb')]);}}function listeningHandler(){console[_0x82e3('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x82e3('0x3')][_0x82e3('0xf')]);logger['info'](util[_0x82e3('0x10')](_0x82e3('0x11'),config[_0x82e3('0x3')]['ip'],config[_0x82e3('0x3')][_0x82e3('0xf')]));}function errorHandler(_0x2de8c3){if(_0x2de8c3&&_0x2de8c3[_0x82e3('0x12')]&&_0x2de8c3[_0x82e3('0x13')]){logger[_0x82e3('0xa')](util[_0x82e3('0x10')](_0x82e3('0x14'),_0x2de8c3[_0x82e3('0x12')],_0x2de8c3[_0x82e3('0x13')]));}else{logger[_0x82e3('0xa')](util['format']('[ERROR]\x20%s',_0x2de8c3[_0x82e3('0xb')]));}}function closeHandler(){logger[_0x82e3('0x15')](util[_0x82e3('0x10')](_0x82e3('0x16'),this[_0x82e3('0x17')],this[_0x82e3('0x18')],this[_0x82e3('0x19')],this[_0x82e3('0x1a')],this[_0x82e3('0x1b')]));try{createSquareReport(this);}catch(_0x2993cc){logger[_0x82e3('0xa')](_0x2993cc[_0x82e3('0xb')]);}}function timeoutHandler(){logger['info'](util[_0x82e3('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82e3('0x17')],this['calleridname'],this['callerid'],this[_0x82e3('0x1a')],this[_0x82e3('0x1b')]));}function hangupHandler(){logger['info'](util[_0x82e3('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82e3('0x17')],this[_0x82e3('0x18')],this[_0x82e3('0x19')],this['dnid'],this[_0x82e3('0x1b')]));this[_0x82e3('0x1c')]=!![];}function createSquareReport(_0x4aa7fc,_0x113682){rpc[_0x82e3('0x1d')](_0x4aa7fc)['then'](function(_0x1841cd){if(_0x113682){_0x113682(null,_0x1841cd);}})[_0x82e3('0x1e')](function(_0x588c13){if(_0x113682){_0x113682(null,_0x588c13);}});}function setChannelVariables(_0x5786a1){for(var _0x404594 in _0x5786a1){if(_0x5786a1[_0x82e3('0x1f')](_0x404594)){if(_0x404594[_0x82e3('0x20')](_0x82e3('0x21'))===0x0){_0x5786a1[_0x404594[_0x82e3('0x22')](0x4)]=_0x5786a1[_0x404594];delete _0x5786a1[_0x404594];}}}}function agiHandler(_0x2c3e04){logger[_0x82e3('0x23')](_0x82e3('0x24'),JSON['stringify'](_0x2c3e04,null,0x2));logger[_0x82e3('0x15')](util['format'](_0x82e3('0x25'),_0x2c3e04[_0x82e3('0x17')],_0x2c3e04[_0x82e3('0x18')],_0x2c3e04['callerid'],_0x2c3e04[_0x82e3('0x1a')],_0x2c3e04[_0x82e3('0x1b')]));_0x2c3e04['on']('error',errorHandler);_0x2c3e04['on'](_0x82e3('0x26'),closeHandler);_0x2c3e04['on']('timeout',timeoutHandler);_0x2c3e04['evtHangup']=![];_0x2c3e04['on']('hangup',hangupHandler);var _0x39c4ef=_[_0x82e3('0x27')](projects,[_0x82e3('0x12'),_0x2c3e04[_0x82e3('0x17')]]);if(!_0x39c4ef)return Project['handleNotFound'](_0x2c3e04);if(!_0x39c4ef[_0x82e3('0x28')])return Project['handleUnpublished'](_0x2c3e04);return Project[_0x82e3('0x29')](_0x39c4ef,_0x2c3e04);}function main(){var _0x574e03;return utilLicense['getLicense']()[_0x82e3('0x2a')](function(_0x103272){if(!_0x103272)return;if(_0x103272[_0x82e3('0x2b')]){if(_0x103272[_0x82e3('0x2c')]&&_0x103272['callysquare']>0x0){logger['info'](util[_0x82e3('0x10')](_0x82e3('0x2d'),_0x103272[_0x82e3('0x2c')]));_0x574e03=_0x103272[_0x82e3('0x2c')];}else{logger[_0x82e3('0x15')](_0x82e3('0x2e'));}}else{logger[_0x82e3('0x15')](_0x82e3('0x2f'));_0x574e03=-0x1;}})[_0x82e3('0x2a')](function(){return Project[_0x82e3('0x30')]();})[_0x82e3('0x2a')](function(_0x121ab4){projects=_0x121ab4;return;})[_0x82e3('0x1e')](function(_0x3ad6a9){logger[_0x82e3('0xa')](_0x82e3('0x31'),_0x3ad6a9[_0x82e3('0xb')]);})[_0x82e3('0x32')](function(){var _0x15f554=require(_0x82e3('0x33'))(config[_0x82e3('0x3')][_0x82e3('0xf')],config[_0x82e3('0x3')]['ip'],_0x574e03);_0x15f554['on'](_0x82e3('0xa'),errorHandler);_0x15f554['on'](_0x82e3('0x34'),listeningHandler);_0x15f554['on'](_0x82e3('0x35'),connectionHandler);_0x15f554['on'](_0x82e3('0x26'),closeHandler);});}main(); \ No newline at end of file +var _0xd6b4=['find','handleNotFound','production','handleUnpublished','initialize','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','finally','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close','timeout','hangup'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xd6b4,0x13d));var _0x4d6b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd6b4[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x4d6b('0x0'));var syncho=require(_0x4d6b('0x1'));var util=require(_0x4d6b('0x2'));var config=require(_0x4d6b('0x3'));var logger=require(_0x4d6b('0x4'))(_0x4d6b('0x5'));var utilLicense=require(_0x4d6b('0x6'));var rpc=require('./rpc');var Project=require(_0x4d6b('0x7'));var AGIEmitter=require(_0x4d6b('0x8'))[_0x4d6b('0x9')];var projects=[];config[_0x4d6b('0x5')]=_[_0x4d6b('0xa')](config['agi'],{'ip':_0x4d6b('0xb'),'port':0x11dd});AGIEmitter['on'](_0x4d6b('0xc'),projectUpdateHandler);function connectionHandler(_0x13650d){process[_0x4d6b('0xd')](function(){syncho(function(){try{setChannelVariables(_0x13650d);agiHandler(_0x13650d);}catch(_0xa42bf){logger[_0x4d6b('0xe')](_0xa42bf[_0x4d6b('0xf')]);}});});}function projectUpdateHandler(_0x2f173f){try{var _0x4e8f51=_[_0x4d6b('0x10')](projects,['id',_0x2f173f['id']]);if(_0x4e8f51>-0x1){if(_0x2f173f[_0x4d6b('0x11')]===!![]){projects[_0x4d6b('0x12')](_0x4e8f51,0x1);}else{projects[_0x4e8f51]=_0x2f173f;}}else{projects[_0x4d6b('0x13')](_0x2f173f);}}catch(_0x13721e){logger['error'](_0x13721e[_0x4d6b('0xf')]);}}function listeningHandler(){console[_0x4d6b('0x14')](_0x4d6b('0x15'),config[_0x4d6b('0x5')]['port']);logger['info'](util[_0x4d6b('0x16')](_0x4d6b('0x17'),config[_0x4d6b('0x5')]['ip'],config[_0x4d6b('0x5')][_0x4d6b('0x18')]));}function errorHandler(_0x51a025){if(_0x51a025&&_0x51a025[_0x4d6b('0x19')]&&_0x51a025['message']){logger[_0x4d6b('0xe')](util[_0x4d6b('0x16')]('[%s]\x20%s',_0x51a025[_0x4d6b('0x19')],_0x51a025[_0x4d6b('0x1a')]));}else{logger[_0x4d6b('0xe')](util[_0x4d6b('0x16')]('[ERROR]\x20%s',_0x51a025[_0x4d6b('0xf')]));}}function closeHandler(){logger[_0x4d6b('0x1b')](util[_0x4d6b('0x16')](_0x4d6b('0x1c'),this[_0x4d6b('0x1d')],this[_0x4d6b('0x1e')],this[_0x4d6b('0x1f')],this[_0x4d6b('0x20')],this['uniqueid']));try{createSquareReport(this);}catch(_0x21d0a6){logger[_0x4d6b('0xe')](_0x21d0a6[_0x4d6b('0xf')]);}}function timeoutHandler(){logger['info'](util[_0x4d6b('0x16')](_0x4d6b('0x21'),this[_0x4d6b('0x1d')],this[_0x4d6b('0x1e')],this[_0x4d6b('0x1f')],this[_0x4d6b('0x20')],this[_0x4d6b('0x22')]));}function hangupHandler(){logger[_0x4d6b('0x1b')](util['format'](_0x4d6b('0x23'),this[_0x4d6b('0x1d')],this[_0x4d6b('0x1e')],this['callerid'],this[_0x4d6b('0x20')],this['uniqueid']));this[_0x4d6b('0x24')]=!![];}function createSquareReport(_0xfeabba,_0x1c9d90){rpc[_0x4d6b('0x25')](_0xfeabba)[_0x4d6b('0x26')](function(_0x53588b){if(_0x1c9d90){_0x1c9d90(null,_0x53588b);}})['catch'](function(_0x4e4af7){if(_0x1c9d90){_0x1c9d90(null,_0x4e4af7);}});}function setChannelVariables(_0x556b57){for(var _0xcc9af6 in _0x556b57){if(_0x556b57[_0x4d6b('0x27')](_0xcc9af6)){if(_0xcc9af6[_0x4d6b('0x28')](_0x4d6b('0x29'))===0x0){_0x556b57[_0xcc9af6[_0x4d6b('0x2a')](0x4)]=_0x556b57[_0xcc9af6];delete _0x556b57[_0xcc9af6];}}}}function agiHandler(_0x48e306){logger[_0x4d6b('0x2b')](_0x4d6b('0x2c'),JSON[_0x4d6b('0x2d')](_0x48e306,null,0x2));logger[_0x4d6b('0x1b')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x48e306[_0x4d6b('0x1d')],_0x48e306['calleridname'],_0x48e306[_0x4d6b('0x1f')],_0x48e306[_0x4d6b('0x20')],_0x48e306[_0x4d6b('0x22')]));_0x48e306['on']('error',errorHandler);_0x48e306['on'](_0x4d6b('0x2e'),closeHandler);_0x48e306['on'](_0x4d6b('0x2f'),timeoutHandler);_0x48e306[_0x4d6b('0x24')]=![];_0x48e306['on'](_0x4d6b('0x30'),hangupHandler);var _0x34ee84=_[_0x4d6b('0x31')](projects,[_0x4d6b('0x19'),_0x48e306[_0x4d6b('0x1d')]]);if(!_0x34ee84)return Project[_0x4d6b('0x32')](_0x48e306);if(!_0x34ee84[_0x4d6b('0x33')])return Project[_0x4d6b('0x34')](_0x48e306);return Project[_0x4d6b('0x35')](_0x34ee84,_0x48e306);}function main(){var _0xe49114;return utilLicense['getLicense']()[_0x4d6b('0x26')](function(_0x29fc96){if(!_0x29fc96)return;if(_0x29fc96['voice']){if(_0x29fc96[_0x4d6b('0x36')]&&_0x29fc96[_0x4d6b('0x36')]>0x0){logger[_0x4d6b('0x1b')](util[_0x4d6b('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x29fc96[_0x4d6b('0x36')]));_0xe49114=_0x29fc96['callysquare'];}else{logger['info'](_0x4d6b('0x37'));}}else{logger[_0x4d6b('0x1b')](_0x4d6b('0x38'));_0xe49114=-0x1;}})[_0x4d6b('0x26')](function(){return Project[_0x4d6b('0x39')]();})[_0x4d6b('0x26')](function(_0x1fa1f2){projects=_0x1fa1f2;return;})[_0x4d6b('0x3a')](function(_0x363547){logger['error']('[LICENSE]',_0x363547[_0x4d6b('0xf')]);})[_0x4d6b('0x3b')](function(){var _0x3f0bd3=require('./server')(config[_0x4d6b('0x5')][_0x4d6b('0x18')],config[_0x4d6b('0x5')]['ip'],_0xe49114);_0x3f0bd3['on'](_0x4d6b('0xe'),errorHandler);_0x3f0bd3['on']('listening',listeningHandler);_0x3f0bd3['on'](_0x4d6b('0x3c'),connectionHandler);_0x3f0bd3['on'](_0x4d6b('0x2e'),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 46d2a3a..f759ddd 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 _0xde7d=['catch','sendMailMessage','jayson/promise','http','request','then','error','message'];(function(_0x110924,_0x1374bb){var _0x12905b=function(_0x47d32c){while(--_0x47d32c){_0x110924['push'](_0x110924['shift']());}};_0x12905b(++_0x1374bb);}(_0xde7d,0x1b2));var _0xdde7=function(_0x5b0be6,_0x1b7517){_0x5b0be6=_0x5b0be6-0x0;var _0x4587c8=_0xde7d[_0x5b0be6];return _0x4587c8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xdde7('0x0'));var client=jayson['client'][_0xdde7('0x1')]({'port':0x232b});function request(_0x223c0d,_0x19a554){return new BPromise(function(_0x224c1e,_0x1c599f){return client[_0xdde7('0x2')](_0x223c0d,_0x19a554)[_0xdde7('0x3')](function(_0x1f225e){if(_0x1f225e['error']){return _0x1c599f(_0x1f225e[_0xdde7('0x4')][_0xdde7('0x5')]);}else{return _0x224c1e(_0x1f225e['result']);}})[_0xdde7('0x6')](function(_0x1f6064){return _0x1c599f(_0x1f6064);});});}exports[_0xdde7('0x7')]=function(_0x11a626,_0x3d97dc){return request('SendMail',{'account':_0x11a626,'message':_0x3d97dc});}; \ No newline at end of file +var _0xf409=['client','then','error','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0xe91a3,_0x4164df){var _0x4af9c6=function(_0x18f259){while(--_0x18f259){_0xe91a3['push'](_0xe91a3['shift']());}};_0x4af9c6(++_0x4164df);}(_0xf409,0x157));var _0x9f40=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xf409[_0x53cf8e];return _0x459197;};'use strict';var BPromise=require(_0x9f40('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x9f40('0x1')]['http']({'port':0x232b});function request(_0xca4ac3,_0x459e9e){return new BPromise(function(_0x3c3199,_0x204c27){return client['request'](_0xca4ac3,_0x459e9e)[_0x9f40('0x2')](function(_0x542971){if(_0x542971[_0x9f40('0x3')]){return _0x204c27(_0x542971['error']['message']);}else{return _0x3c3199(_0x542971[_0x9f40('0x4')]);}})[_0x9f40('0x5')](function(_0x11d605){return _0x204c27(_0x11d605);});});}exports[_0x9f40('0x6')]=function(_0x37b848,_0x342707){return request(_0x9f40('0x7'),{'account':_0x37b848,'message':_0x342707});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index e297667..6b1e70c 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 _0x7cd3=['maxRetry','addVertex','mxCell','length','source','addEdge','target','mxGraphModel','root','inspect','production','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','traverseBFS','start','clear','vertex','gotoc','context','extension','priority','response','result','evtHangup','debug','error','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','xml2json','util','agi','./rpc','./graph','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry'];(function(_0x304632,_0x5a3cb1){var _0x170cc3=function(_0x104f65){while(--_0x104f65){_0x304632['push'](_0x304632['shift']());}};_0x170cc3(++_0x5a3cb1);}(_0x7cd3,0x67));var _0x37cd=function(_0x25d3f4,_0x372757){_0x25d3f4=_0x25d3f4-0x0;var _0x16e7b3=_0x7cd3[_0x25d3f4];return _0x16e7b3;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0x37cd('0x0'));var util=require(_0x37cd('0x1'));var logger=require('../../config/logger')(_0x37cd('0x2'));var rpc=require(_0x37cd('0x3'));var mailRpc=require('./mailRpc');var Graph=require(_0x37cd('0x4'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x37cd('0x5')](function(_0x1151d6){logger['error'](_0x37cd('0x6'),_0x1151d6[_0x37cd('0x7')]);return[];});}function addVertex(_0x70ea2,_0xffeb4,_0x52a309){_0xffeb4[_0x37cd('0x8')]=_0x52a309;if(_0xffeb4[_0x37cd('0x9')](_0x37cd('0xa'))){_0xffeb4[_0x37cd('0xb')]=parseInt(_0xffeb4[_0x37cd('0xa')],0xa);}_0x70ea2[_0x37cd('0xc')](_['omit'](_0xffeb4,_0x37cd('0xd')));}function initGraph(_0x19478c,_0x22e953){var _0x303d12=new Graph();for(var _0x111b14 in _0x19478c){if(_0x19478c[_0x37cd('0x9')](_0x111b14)){if(_['isArray'](_0x19478c[_0x111b14])){for(var _0x5830c8=0x0;_0x5830c8<_0x19478c[_0x111b14][_0x37cd('0xe')];_0x5830c8+=0x1){addVertex(_0x303d12,_0x19478c[_0x111b14][_0x5830c8],_0x111b14);}}else{addVertex(_0x303d12,_0x19478c[_0x111b14],_0x111b14);}}}for(var _0x513130=0x0;_0x513130<_0x22e953['length'];_0x513130+=0x1){if(_0x22e953[_0x513130][_0x37cd('0xf')]&&_0x22e953[_0x513130]['target']){_0x303d12[_0x37cd('0x10')](_0x22e953[_0x513130]['source'],_0x22e953[_0x513130][_0x37cd('0x11')],_0x22e953[_0x513130]['value']);}}return _0x303d12;}function getRoot(_0x95ade4){return parser['toJson'](_0x95ade4,{'object':!![]})[_0x37cd('0x12')][_0x37cd('0x13')];}function inspect(_0x5170b2){return util[_0x37cd('0x14')](_0x5170b2,{'showHidden':![],'depth':null});}function initialize(_0xbd5235,_0x2462f2){var _0x111f66=getRoot(_0xbd5235[_0x37cd('0x15')]);if(!_0x111f66||!_0x111f66['start'])return;var _0x23b9c6,_0x3f70ca,_0x5cfe7b;logger['debug']('root',JSON[_0x37cd('0x16')](_0x111f66,null,0x2));_0x2462f2[_0x37cd('0x17')]=moment()[_0x37cd('0x18')](_0x37cd('0x19'));_0x23b9c6=initGraph(_[_0x37cd('0x1a')](_0x111f66,'mxCell'),_0x111f66[_0x37cd('0xd')]);_0x3f70ca=new Vertices(_0x2462f2,rpc,mailRpc);logger[_0x37cd('0x1b')](util[_0x37cd('0x18')](_0x37cd('0x1c'),_0x2462f2[_0x37cd('0x1d')],_0x2462f2['calleridname'],_0x2462f2[_0x37cd('0x1e')],_0x2462f2[_0x37cd('0x1f')],_0x2462f2[_0x37cd('0x20')]));_0x23b9c6[_0x37cd('0x21')](_0x111f66[_0x37cd('0x22')]['id'],function(_0x5cd03f){try{_0x5cd03f=_0x3f70ca[_0x37cd('0x23')](_0x5cd03f);logger['debug'](_0x37cd('0x24'),JSON[_0x37cd('0x16')](_0x5cd03f,null,0x2));if(_0x5cd03f[_0x37cd('0x8')]===_0x37cd('0x25')){logger[_0x37cd('0x1b')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x2462f2[_0x37cd('0x26')]=_0x5cd03f[_0x37cd('0x26')]||_0x2462f2[_0x37cd('0x26')];_0x2462f2[_0x37cd('0x27')]=_0x5cd03f[_0x37cd('0x27')];_0x2462f2['priority']=_0x5cd03f['priority']?_0x5cd03f[_0x37cd('0x28')]-0x1:0x1;return null;}else if(_0x5cd03f&&_0x3f70ca[_0x5cd03f[_0x37cd('0x8')]]){_0x5cfe7b=_0x3f70ca[_0x5cd03f[_0x37cd('0x8')]](_0x5cd03f);logger['info'](_0x37cd('0x29'),JSON['stringify'](_0x5cfe7b,null,0x2));if(_0x5cfe7b&&_0x5cfe7b['code']===AGI_CODE_SUCCESS&&_0x5cfe7b[_0x37cd('0x2a')]!==AGI_RESULT_ERROR&&!_0x2462f2[_0x37cd('0x2b')]){logger[_0x37cd('0x2c')]('response',inspect(_0x5cfe7b));return _['isUndefined'](_0x5cfe7b['result'])?null:_0x5cfe7b[_0x37cd('0x2a')]['toString']();}else{logger['error'](_0x37cd('0x29'),inspect(_0x5cfe7b));return null;}}else{logger[_0x37cd('0x2d')](_0x37cd('0x2e'));return null;}}catch(_0x9e6754){logger[_0x37cd('0x2d')](_0x9e6754[_0x37cd('0x7')]);return null;}});if(_0x111f66['finally']){logger[_0x37cd('0x1b')](util[_0x37cd('0x18')](_0x37cd('0x2f'),_0x2462f2[_0x37cd('0x1d')],_0x2462f2[_0x37cd('0x30')],_0x2462f2['callerid'],_0x2462f2['dnid'],_0x2462f2[_0x37cd('0x20')]));_0x23b9c6[_0x37cd('0x21')](_0x111f66['finally']['id'],function(_0x5bb9ee){try{_0x5bb9ee=_0x3f70ca['clear'](_0x5bb9ee);logger[_0x37cd('0x2c')](_0x37cd('0x24'),JSON['stringify'](_0x5bb9ee,null,0x2));if(_0x5bb9ee&&_0x3f70ca[_0x5bb9ee[_0x37cd('0x8')]]){_0x5cfe7b=_0x3f70ca[_0x5bb9ee['agicommand']](_0x5bb9ee);if(_0x5cfe7b){logger[_0x37cd('0x2c')](_0x37cd('0x29'),inspect(_0x5cfe7b));return _[_0x37cd('0x31')](_0x5cfe7b[_0x37cd('0x2a')])?null:_0x5cfe7b['result'][_0x37cd('0x32')]();}else{logger[_0x37cd('0x2d')]('response',inspect(_0x5cfe7b));return null;}}else{logger[_0x37cd('0x2d')](_0x37cd('0x2e'));return null;}}catch(_0x48d731){logger[_0x37cd('0x2d')](_0x48d731['stack']);return null;}});}logger[_0x37cd('0x1b')](util[_0x37cd('0x18')](_0x37cd('0x33'),_0x2462f2[_0x37cd('0x1d')],_0x2462f2['calleridname'],_0x2462f2['callerid'],_0x2462f2[_0x37cd('0x1f')],_0x2462f2['uniqueid']));logger['info'](util[_0x37cd('0x18')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x2462f2['context'],_0x2462f2[_0x37cd('0x27')],parseInt(_0x2462f2[_0x37cd('0x28')],0xa)+0x1));_0x2462f2[_0x37cd('0x34')](_0x2462f2[_0x37cd('0x26')],_0x2462f2[_0x37cd('0x27')],parseInt(_0x2462f2[_0x37cd('0x28')],0xa)+0x1);_0x2462f2[_0x37cd('0x35')]();}function handleNotFound(_0x22800e){logger[_0x37cd('0x2d')](util['format'](_0x37cd('0x36'),_0x22800e['arg_1']));_0x22800e[_0x37cd('0x34')](_0x22800e[_0x37cd('0x26')],_0x22800e['extension'],parseInt(_0x22800e[_0x37cd('0x28')],0xa)+0x1);_0x22800e['close']();}function handleUnpublished(_0x55f60c){logger[_0x37cd('0x2d')](util[_0x37cd('0x18')](_0x37cd('0x37'),_0x55f60c[_0x37cd('0x1d')]));_0x55f60c[_0x37cd('0x34')](_0x55f60c['context'],_0x55f60c[_0x37cd('0x27')],parseInt(_0x55f60c[_0x37cd('0x28')],0xa)+0x1);_0x55f60c[_0x37cd('0x35')]();}module[_0x37cd('0x38')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x30e6=['extension','priority','response','result','evtHangup','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','finally','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','moment','xml2json','./mailRpc','./vertices','getSquareProjects','error','stack','agicommand','retry','maxRetry','addVertex','omit','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','stringify','joinAt','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','traverseBFS','clear','debug','vertex','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0x70588,_0x2e21dd){var _0x1981d8=function(_0x5bbfb6){while(--_0x5bbfb6){_0x70588['push'](_0x70588['shift']());}};_0x1981d8(++_0x2e21dd);}(_0x30e6,0xf0));var _0x630e=function(_0x3fd97e,_0x563fef){_0x3fd97e=_0x3fd97e-0x0;var _0xbfeb95=_0x30e6[_0x3fd97e];return _0xbfeb95;};'use strict';var _=require('lodash');var moment=require(_0x630e('0x0'));var parser=require(_0x630e('0x1'));var util=require('util');var logger=require('../../config/logger')('agi');var rpc=require('./rpc');var mailRpc=require(_0x630e('0x2'));var Graph=require('./graph');var Vertices=require(_0x630e('0x3'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x630e('0x4')]()['catch'](function(_0x5b4d82){logger[_0x630e('0x5')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x5b4d82[_0x630e('0x6')]);return[];});}function addVertex(_0x1adc47,_0x1534aa,_0x517ae9){_0x1534aa[_0x630e('0x7')]=_0x517ae9;if(_0x1534aa['hasOwnProperty'](_0x630e('0x8'))){_0x1534aa[_0x630e('0x9')]=parseInt(_0x1534aa[_0x630e('0x8')],0xa);}_0x1adc47[_0x630e('0xa')](_[_0x630e('0xb')](_0x1534aa,'mxCell'));}function initGraph(_0x4e5e73,_0x12279b){var _0x49130e=new Graph();for(var _0x3c7581 in _0x4e5e73){if(_0x4e5e73[_0x630e('0xc')](_0x3c7581)){if(_[_0x630e('0xd')](_0x4e5e73[_0x3c7581])){for(var _0x4e0673=0x0;_0x4e0673<_0x4e5e73[_0x3c7581][_0x630e('0xe')];_0x4e0673+=0x1){addVertex(_0x49130e,_0x4e5e73[_0x3c7581][_0x4e0673],_0x3c7581);}}else{addVertex(_0x49130e,_0x4e5e73[_0x3c7581],_0x3c7581);}}}for(var _0x77d6a7=0x0;_0x77d6a7<_0x12279b[_0x630e('0xe')];_0x77d6a7+=0x1){if(_0x12279b[_0x77d6a7][_0x630e('0xf')]&&_0x12279b[_0x77d6a7][_0x630e('0x10')]){_0x49130e[_0x630e('0x11')](_0x12279b[_0x77d6a7][_0x630e('0xf')],_0x12279b[_0x77d6a7][_0x630e('0x10')],_0x12279b[_0x77d6a7][_0x630e('0x12')]);}}return _0x49130e;}function getRoot(_0xe1ba74){return parser[_0x630e('0x13')](_0xe1ba74,{'object':!![]})[_0x630e('0x14')][_0x630e('0x15')];}function inspect(_0x133d7f){return util[_0x630e('0x16')](_0x133d7f,{'showHidden':![],'depth':null});}function initialize(_0x5296a5,_0x249a23){var _0x2e3583=getRoot(_0x5296a5[_0x630e('0x17')]);if(!_0x2e3583||!_0x2e3583[_0x630e('0x18')])return;var _0x451f31,_0x41b6e2,_0x59d820;logger['debug'](_0x630e('0x15'),JSON[_0x630e('0x19')](_0x2e3583,null,0x2));_0x249a23[_0x630e('0x1a')]=moment()[_0x630e('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');_0x451f31=initGraph(_[_0x630e('0xb')](_0x2e3583,'mxCell'),_0x2e3583['mxCell']);_0x41b6e2=new Vertices(_0x249a23,rpc,mailRpc);logger['info'](util['format'](_0x630e('0x1c'),_0x249a23['arg_1'],_0x249a23[_0x630e('0x1d')],_0x249a23[_0x630e('0x1e')],_0x249a23[_0x630e('0x1f')],_0x249a23['uniqueid']));_0x451f31[_0x630e('0x20')](_0x2e3583[_0x630e('0x18')]['id'],function(_0x49dafc){try{_0x49dafc=_0x41b6e2[_0x630e('0x21')](_0x49dafc);logger[_0x630e('0x22')](_0x630e('0x23'),JSON[_0x630e('0x19')](_0x49dafc,null,0x2));if(_0x49dafc[_0x630e('0x7')]===_0x630e('0x24')){logger[_0x630e('0x25')](_0x630e('0x26'));_0x249a23[_0x630e('0x27')]=_0x49dafc['context']||_0x249a23['context'];_0x249a23[_0x630e('0x28')]=_0x49dafc['extension'];_0x249a23['priority']=_0x49dafc[_0x630e('0x29')]?_0x49dafc[_0x630e('0x29')]-0x1:0x1;return null;}else if(_0x49dafc&&_0x41b6e2[_0x49dafc[_0x630e('0x7')]]){_0x59d820=_0x41b6e2[_0x49dafc[_0x630e('0x7')]](_0x49dafc);logger[_0x630e('0x25')](_0x630e('0x2a'),JSON[_0x630e('0x19')](_0x59d820,null,0x2));if(_0x59d820&&_0x59d820['code']===AGI_CODE_SUCCESS&&_0x59d820[_0x630e('0x2b')]!==AGI_RESULT_ERROR&&!_0x249a23[_0x630e('0x2c')]){logger['debug'](_0x630e('0x2a'),inspect(_0x59d820));return _['isUndefined'](_0x59d820[_0x630e('0x2b')])?null:_0x59d820[_0x630e('0x2b')][_0x630e('0x2d')]();}else{logger[_0x630e('0x5')](_0x630e('0x2a'),inspect(_0x59d820));return null;}}else{logger[_0x630e('0x5')](_0x630e('0x2e'));return null;}}catch(_0x5656e6){logger[_0x630e('0x5')](_0x5656e6[_0x630e('0x6')]);return null;}});if(_0x2e3583['finally']){logger[_0x630e('0x25')](util[_0x630e('0x1b')](_0x630e('0x2f'),_0x249a23[_0x630e('0x30')],_0x249a23[_0x630e('0x1d')],_0x249a23[_0x630e('0x1e')],_0x249a23[_0x630e('0x1f')],_0x249a23['uniqueid']));_0x451f31[_0x630e('0x20')](_0x2e3583[_0x630e('0x31')]['id'],function(_0x30b916){try{_0x30b916=_0x41b6e2[_0x630e('0x21')](_0x30b916);logger[_0x630e('0x22')](_0x630e('0x23'),JSON[_0x630e('0x19')](_0x30b916,null,0x2));if(_0x30b916&&_0x41b6e2[_0x30b916['agicommand']]){_0x59d820=_0x41b6e2[_0x30b916[_0x630e('0x7')]](_0x30b916);if(_0x59d820){logger[_0x630e('0x22')](_0x630e('0x2a'),inspect(_0x59d820));return _[_0x630e('0x32')](_0x59d820['result'])?null:_0x59d820[_0x630e('0x2b')][_0x630e('0x2d')]();}else{logger[_0x630e('0x5')]('response',inspect(_0x59d820));return null;}}else{logger['error'](_0x630e('0x2e'));return null;}}catch(_0xcbecb4){logger[_0x630e('0x5')](_0xcbecb4['stack']);return null;}});}logger[_0x630e('0x25')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x249a23[_0x630e('0x30')],_0x249a23[_0x630e('0x1d')],_0x249a23['callerid'],_0x249a23['dnid'],_0x249a23['uniqueid']));logger[_0x630e('0x25')](util[_0x630e('0x1b')](_0x630e('0x33'),_0x249a23[_0x630e('0x27')],_0x249a23[_0x630e('0x28')],parseInt(_0x249a23[_0x630e('0x29')],0xa)+0x1));_0x249a23[_0x630e('0x34')](_0x249a23[_0x630e('0x27')],_0x249a23[_0x630e('0x28')],parseInt(_0x249a23[_0x630e('0x29')],0xa)+0x1);_0x249a23[_0x630e('0x35')]();}function handleNotFound(_0x4a5792){logger[_0x630e('0x5')](util['format']('Project\x20%s\x20not\x20found',_0x4a5792['arg_1']));_0x4a5792[_0x630e('0x34')](_0x4a5792[_0x630e('0x27')],_0x4a5792[_0x630e('0x28')],parseInt(_0x4a5792[_0x630e('0x29')],0xa)+0x1);_0x4a5792[_0x630e('0x35')]();}function handleUnpublished(_0x4ee21d){logger['error'](util[_0x630e('0x1b')](_0x630e('0x36'),_0x4ee21d[_0x630e('0x30')]));_0x4ee21d['continueAt'](_0x4ee21d['context'],_0x4ee21d[_0x630e('0x28')],parseInt(_0x4ee21d[_0x630e('0x29')],0xa)+0x1);_0x4ee21d['close']();}module[_0x630e('0x37')]={'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 10baa53..6e4c06f 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 _0xa4f3=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','toString','substring','length','split','indexOf','slice','trim','exports','stream'];(function(_0x3d0276,_0x4f9026){var _0x1d5139=function(_0x579ea6){while(--_0x579ea6){_0x3d0276['push'](_0x3d0276['shift']());}};_0x1d5139(++_0x4f9026);}(_0xa4f3,0x10f));var _0x3a4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4f3[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var Transform=require(_0x3a4f('0x0'))[_0x3a4f('0x1')];function AGIReply(_0x34f8e8){Transform[_0x3a4f('0x2')](this,_0x34f8e8);this[_0x3a4f('0x3')]='';this[_0x3a4f('0x4')]=![];}util[_0x3a4f('0x5')](AGIReply,Transform);AGIReply[_0x3a4f('0x6')][_0x3a4f('0x7')]=function(_0x128c87,_0x530926,_0x1d8206){var _0xe297f1='\x0a',_0x279824=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x2235e7=-0x1,_0x18eec7=-0x1,_0x470ce='',_0x3d12d9=0x0,_0x75acbd='',_0x1dcab3='';this[_0x3a4f('0x3')]+=_0x128c87[_0x3a4f('0x8')]();_0x75acbd=this[_0x3a4f('0x3')];if(!this[_0x3a4f('0x4')]){_0x3d12d9=0x0;while(_0x279824[_0x3d12d9]){while((_0x18eec7=_0x75acbd['indexOf'](_0x279824[_0x3d12d9]))!=-0x1){_0x470ce=_0x279824[_0x3d12d9];_0x1dcab3=_0x75acbd['substring'](0x0,_0x18eec7);_0x75acbd=_0x75acbd[_0x3a4f('0x9')](_0x18eec7+_0x470ce[_0x3a4f('0xa')]);var _0x36d102=_0x1dcab3[_0x3a4f('0xb')](_0xe297f1),_0x3e8014=0x0,_0x55a92d={},_0x60d653='',_0x575edd='',_0x3b4294=-0x1;while(_0x36d102[_0x3e8014]){_0x3b4294=_0x36d102[_0x3e8014][_0x3a4f('0xc')](':');if(_0x3b4294!=-0x1){_0x60d653=_0x36d102[_0x3e8014][_0x3a4f('0xd')](0x0,_0x3b4294)[_0x3a4f('0xe')]();_0x575edd=_0x36d102[_0x3e8014][_0x3a4f('0xd')](_0x3b4294+0x1)[_0x3a4f('0xe')]();if(_0x60d653[_0x3a4f('0xa')]>0x0){_0x55a92d[_0x60d653]=_0x575edd;}}else{}_0x3e8014++;}this['emit']('headers',_0x55a92d);this[_0x3a4f('0x4')]=!![];}_0x3d12d9++;}this[_0x3a4f('0x3')]=_0x75acbd;}else{while((_0x2235e7=_0x75acbd[_0x3a4f('0xc')](_0xe297f1))!=-0x1){_0x1dcab3=_0x75acbd['substring'](0x0,_0x2235e7);this['emit']('line',_0x1dcab3);_0x75acbd=_0x75acbd[_0x3a4f('0x9')](_0x2235e7+_0xe297f1[_0x3a4f('0xa')]);}this['_localBuffer']=_0x75acbd;}_0x1d8206();};module[_0x3a4f('0xf')]=AGIReply; \ No newline at end of file +var _0x4dd2=['line','stream','Transform','_localBuffer','inherits','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim','emit','_inBody'];(function(_0x34fc32,_0x1b372f){var _0x567758=function(_0x54ca0f){while(--_0x54ca0f){_0x34fc32['push'](_0x34fc32['shift']());}};_0x567758(++_0x1b372f);}(_0x4dd2,0xf1));var _0x24dd=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4dd2[_0x334841];return _0x5beb4b;};'use strict';var util=require('util');var Transform=require(_0x24dd('0x0'))[_0x24dd('0x1')];function AGIReply(_0x2f171a){Transform['call'](this,_0x2f171a);this[_0x24dd('0x2')]='';this['_inBody']=![];}util[_0x24dd('0x3')](AGIReply,Transform);AGIReply['prototype'][_0x24dd('0x4')]=function(_0x2cbda5,_0x317135,_0x5d3f24){var _0x524c5b='\x0a',_0x21b5b4=['\x0a\x0a',_0x24dd('0x5')],_0x390472=-0x1,_0x1dd44c=-0x1,_0x424e48='',_0x312f04=0x0,_0x51cb64='',_0x43f2e0='';this[_0x24dd('0x2')]+=_0x2cbda5[_0x24dd('0x6')]();_0x51cb64=this[_0x24dd('0x2')];if(!this['_inBody']){_0x312f04=0x0;while(_0x21b5b4[_0x312f04]){while((_0x1dd44c=_0x51cb64[_0x24dd('0x7')](_0x21b5b4[_0x312f04]))!=-0x1){_0x424e48=_0x21b5b4[_0x312f04];_0x43f2e0=_0x51cb64[_0x24dd('0x8')](0x0,_0x1dd44c);_0x51cb64=_0x51cb64[_0x24dd('0x8')](_0x1dd44c+_0x424e48[_0x24dd('0x9')]);var _0xb8065a=_0x43f2e0['split'](_0x524c5b),_0x1468d2=0x0,_0x3fce8b={},_0x167581='',_0x4d8c55='',_0x46b06c=-0x1;while(_0xb8065a[_0x1468d2]){_0x46b06c=_0xb8065a[_0x1468d2][_0x24dd('0x7')](':');if(_0x46b06c!=-0x1){_0x167581=_0xb8065a[_0x1468d2][_0x24dd('0xa')](0x0,_0x46b06c)['trim']();_0x4d8c55=_0xb8065a[_0x1468d2]['slice'](_0x46b06c+0x1)[_0x24dd('0xb')]();if(_0x167581[_0x24dd('0x9')]>0x0){_0x3fce8b[_0x167581]=_0x4d8c55;}}else{}_0x1468d2++;}this[_0x24dd('0xc')]('headers',_0x3fce8b);this[_0x24dd('0xd')]=!![];}_0x312f04++;}this['_localBuffer']=_0x51cb64;}else{while((_0x390472=_0x51cb64[_0x24dd('0x7')](_0x524c5b))!=-0x1){_0x43f2e0=_0x51cb64[_0x24dd('0x8')](0x0,_0x390472);this[_0x24dd('0xc')](_0x24dd('0xe'),_0x43f2e0);_0x51cb64=_0x51cb64['substring'](_0x390472+_0x524c5b[_0x24dd('0x9')]);}this[_0x24dd('0x2')]=_0x51cb64;}_0x5d3f24();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 6c39ceb..2698c8e 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 _0x5395=['getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','Intervals','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','createCmContact','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production'];(function(_0x58c333,_0x3a9060){var _0x8bcfc=function(_0x33b317){while(--_0x33b317){_0x58c333['push'](_0x58c333['shift']());}};_0x8bcfc(++_0x3a9060);}(_0x5395,0x150));var _0x5539=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5395[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x5539('0x0'));var moment=require('moment');var jayson=require(_0x5539('0x1'));var client=jayson['client']['http']({'port':0x2329});function request(_0xa713ee,_0x2d8e1c){return new Promise(function(_0x2d24c7,_0x4cd571){return client[_0x5539('0x2')](_0xa713ee,_0x2d8e1c)[_0x5539('0x3')](function(_0x12052b){if(_0x12052b[_0x5539('0x4')]){return _0x4cd571(_0x12052b[_0x5539('0x4')][_0x5539('0x5')]);}else{return _0x2d24c7(_0x12052b[_0x5539('0x6')]);}})[_0x5539('0x7')](function(_0x56b645){return _0x4cd571(_0x56b645);});});}exports[_0x5539('0x8')]=function(){return request(_0x5539('0x9'),{'options':{'raw':![],'attributes':['id',_0x5539('0xa'),_0x5539('0xb')]}});};exports['getSquareProject']=function(_0x5513f6){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x5513f6},'attributes':['production']}});};exports[_0x5539('0xc')]=function(_0x5867ed){return request(_0x5539('0xd'),{'options':{'raw':![],'where':{'id':_0x5867ed},'include':[{'model':'MailServerOut','as':_0x5539('0xe'),'include':[{'model':_0x5539('0xf'),'as':'CloudProvider'}]}],'attributes':['id',_0x5539('0xa'),_0x5539('0x10')],'smtp':!![]}});};exports[_0x5539('0x11')]=function(_0xe57fc5){return request(_0x5539('0x12'),{'options':{'where':{'id':_0xe57fc5},'attributes':[_0x5539('0xa')]}});};exports[_0x5539('0x13')]=function(_0x498eef){return request(_0x5539('0x14'),{'options':{'where':{'id':_0x498eef},'attributes':[_0x5539('0xa')]}});};exports['getVariableById']=function(_0x42129b){return request('ShowVariable',{'options':{'where':{'id':_0x42129b},'attributes':[_0x5539('0xa')]}});};exports[_0x5539('0x15')]=function(_0x3d1585){return request(_0x5539('0x16'),{'options':{'where':{'id':_0x3d1585},'attributes':[_0x5539('0x17')]}});};exports[_0x5539('0x18')]=function(_0x437b01){return request(_0x5539('0x19'),{'options':{'where':{'id':_0x437b01},'attributes':['name']}});};exports['getContactByPhone']=function(_0x52476f){return request(_0x5539('0x1a'),{'options':{'where':{'phone':_0x52476f['phone']},'attributes':['id']}});};exports[_0x5539('0x1b')]=function(_0x2f9cb1){return request(_0x5539('0x1c'),{'options':{'where':{'id':_0x2f9cb1},'attributes':['name']}});};exports[_0x5539('0x1d')]=function(_0x5c52e7){return request('ShowSound',{'options':{'where':{'id':_0x5c52e7},'attributes':[_0x5539('0x1e')]}});};exports['getIntervalById']=function(_0x2fb510){return request(_0x5539('0x1f'),{'options':{'raw':![],'where':{'id':_0x2fb510},'include':[{'model':_0x5539('0x20'),'as':_0x5539('0x21')}]}});};exports['getSmsAccountById']=function(_0x55732d){return request('ShowSmsAccount',{'options':{'where':{'id':_0x55732d},'attributes':['id',_0x5539('0xa')]}});};exports[_0x5539('0x22')]=function(_0x19b989){return request(_0x5539('0x23'),{'body':_0x19b989});};exports[_0x5539('0x24')]=function(_0x1f4744){return request(_0x5539('0x25'),{'body':_0x1f4744});};exports[_0x5539('0x26')]=function(_0x406385){return request(_0x5539('0x27'),{'body':_[_0x5539('0x28')](_0x406385,{'project_name':_0x406385[_0x5539('0x29')],'prev_project_name':_0x406385[_0x5539('0x2a')]||'','is_subproject':_0x406385[_0x5539('0x2a')]?!![]:![],'leaveAt':moment()[_0x5539('0x2b')](_0x5539('0x2c'))})});};exports[_0x5539('0x2d')]=function(_0x4e0e29){return request('CreateSquareRecording',{'body':_0x4e0e29});};exports[_0x5539('0x2e')]=function(_0x2bce98){return request('CreateSquareMessage',{'body':_0x2bce98});};exports[_0x5539('0x2f')]=function(_0x5c0be7){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x5c0be7[_0x5539('0x30')],'ListId':_0x5c0be7[_0x5539('0x31')]}}})['then'](function(_0x1e00ab){if(_0x1e00ab){return _0x1e00ab;}return request(_0x5539('0x32'),{'body':_0x5c0be7});});};exports['getPauseById']=function(_0x481f49){return request(_0x5539('0x33'),{'options':{'where':{'id':_0x481f49},'attributes':['name']}});};exports[_0x5539('0x34')]=function(_0x15fc1f,_0x593d5d){return request(_0x5539('0x35'),{'body':{'interface':_0x593d5d},'options':{'where':_0x15fc1f}});};exports['agentPause']=function(_0x30f054,_0x5e8d3d,_0x529f46){return request(_0x5539('0x36'),{'body':{'type':_0x5e8d3d,'uniqueid':_0x529f46},'options':{'where':_0x30f054}});};exports['agentUnpause']=function(_0xfb4b2b){return request(_0x5539('0x37'),{'body':{},'options':{'where':_0xfb4b2b}});};exports[_0x5539('0x38')]=function(_0x5cc66e){return request(_0x5539('0x39'),{'body':{},'options':{'where':_0x5cc66e}});}; \ No newline at end of file +var _0x6183=['createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','moment','jayson/promise','client','request','then','error','message','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage'];(function(_0x752c08,_0x4e36d){var _0x41717c=function(_0x187400){while(--_0x187400){_0x752c08['push'](_0x752c08['shift']());}};_0x41717c(++_0x4e36d);}(_0x6183,0x19b));var _0x3618=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x6183[_0x152aa1];return _0x1bc01a;};'use strict';var _=require('lodash');var moment=require(_0x3618('0x0'));var jayson=require(_0x3618('0x1'));var client=jayson[_0x3618('0x2')]['http']({'port':0x2329});function request(_0x2d9b70,_0x3ec8a8){return new Promise(function(_0x176f61,_0x2d62a7){return client[_0x3618('0x3')](_0x2d9b70,_0x3ec8a8)[_0x3618('0x4')](function(_0x14895f){if(_0x14895f[_0x3618('0x5')]){return _0x2d62a7(_0x14895f[_0x3618('0x5')][_0x3618('0x6')]);}else{return _0x176f61(_0x14895f['result']);}})['catch'](function(_0x42e73a){return _0x2d62a7(_0x42e73a);});});}exports[_0x3618('0x7')]=function(){return request(_0x3618('0x8'),{'options':{'raw':![],'attributes':['id',_0x3618('0x9'),_0x3618('0xa')]}});};exports[_0x3618('0xb')]=function(_0x33148d){return request(_0x3618('0xc'),{'options':{'raw':![],'where':{'name':_0x33148d},'attributes':[_0x3618('0xa')]}});};exports[_0x3618('0xd')]=function(_0x714f6f){return request(_0x3618('0xe'),{'options':{'raw':![],'where':{'id':_0x714f6f},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x3618('0xf'),'as':'CloudProvider'}]}],'attributes':['id',_0x3618('0x9'),_0x3618('0x10')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x32bf30){return request(_0x3618('0xc'),{'options':{'where':{'id':_0x32bf30},'attributes':[_0x3618('0x9')]}});};exports[_0x3618('0x11')]=function(_0x35cc8b){return request(_0x3618('0x12'),{'options':{'where':{'id':_0x35cc8b},'attributes':[_0x3618('0x9')]}});};exports[_0x3618('0x13')]=function(_0x48bed1){return request(_0x3618('0x14'),{'options':{'where':{'id':_0x48bed1},'attributes':['name']}});};exports[_0x3618('0x15')]=function(_0x3e9a42){return request(_0x3618('0x16'),{'options':{'where':{'id':_0x3e9a42},'attributes':['dsn']}});};exports['getUserById']=function(_0x5e9c82){return request(_0x3618('0x17'),{'options':{'where':{'id':_0x5e9c82},'attributes':[_0x3618('0x9')]}});};exports[_0x3618('0x18')]=function(_0x188dd7){return request(_0x3618('0x19'),{'options':{'where':{'phone':_0x188dd7[_0x3618('0x1a')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x43f95c){return request(_0x3618('0x1b'),{'options':{'where':{'id':_0x43f95c},'attributes':['name']}});};exports[_0x3618('0x1c')]=function(_0x33deaf){return request(_0x3618('0x1d'),{'options':{'where':{'id':_0x33deaf},'attributes':['save_name']}});};exports[_0x3618('0x1e')]=function(_0x3df977){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x3df977},'include':[{'model':_0x3618('0x1f'),'as':_0x3618('0x20')}]}});};exports[_0x3618('0x21')]=function(_0x5012c2){return request(_0x3618('0x22'),{'options':{'where':{'id':_0x5012c2},'attributes':['id',_0x3618('0x9')]}});};exports[_0x3618('0x23')]=function(_0x3d6b4e){return request(_0x3618('0x24'),{'body':_0x3d6b4e});};exports[_0x3618('0x25')]=function(_0x5798bc){return request('CreateSquareDetailsReport',{'body':_0x5798bc});};exports[_0x3618('0x26')]=function(_0x1b8914){return request(_0x3618('0x27'),{'body':_['merge'](_0x1b8914,{'project_name':_0x1b8914[_0x3618('0x28')],'prev_project_name':_0x1b8914[_0x3618('0x29')]||'','is_subproject':_0x1b8914[_0x3618('0x29')]?!![]:![],'leaveAt':moment()['format'](_0x3618('0x2a'))})});};exports[_0x3618('0x2b')]=function(_0x154b41){return request(_0x3618('0x2c'),{'body':_0x154b41});};exports[_0x3618('0x2d')]=function(_0x1705da){return request(_0x3618('0x2e'),{'body':_0x1705da});};exports['createCmContact']=function(_0x3f991a){return request(_0x3618('0x2f'),{'options':{'raw':![],'where':{'phone':_0x3f991a[_0x3618('0x1a')],'ListId':_0x3f991a[_0x3618('0x30')]}}})[_0x3618('0x4')](function(_0xf770df){if(_0xf770df){return _0xf770df;}return request(_0x3618('0x31'),{'body':_0x3f991a});});};exports[_0x3618('0x32')]=function(_0x5476cc){return request('ShowPause',{'options':{'where':{'id':_0x5476cc},'attributes':[_0x3618('0x9')]}});};exports['agentLogin']=function(_0x292694,_0x1e2699){return request('LoginUser',{'body':{'interface':_0x1e2699},'options':{'where':_0x292694}});};exports[_0x3618('0x33')]=function(_0x30a095,_0x10162e,_0x11aebc){return request(_0x3618('0x34'),{'body':{'type':_0x10162e,'uniqueid':_0x11aebc},'options':{'where':_0x30a095}});};exports[_0x3618('0x35')]=function(_0xeded01){return request('UnpauseUser',{'body':{},'options':{'where':_0xeded01}});};exports[_0x3618('0x36')]=function(_0x396eb6){return request(_0x3618('0x37'),{'body':{},'options':{'where':_0x396eb6}});}; \ 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 228dc82..cd48c8c 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 _0x5031=['./polly','./lex','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5031,0x144));var _0x1503=function(_0x4595a3,_0x5ed375){_0x4595a3=_0x4595a3-0x0;var _0x1e950f=_0x5031[_0x4595a3];return _0x1e950f;};var polly=require(_0x1503('0x0'));var lex=require(_0x1503('0x1'));module[_0x1503('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd072=['./polly','./lex','exports'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0xd072,0x132));var _0x2d07=function(_0x2efc7a,_0x36c388){_0x2efc7a=_0x2efc7a-0x0;var _0x8b1e05=_0xd072[_0x2efc7a];return _0x8b1e05;};var polly=require(_0x2d07('0x0'));var lex=require(_0x2d07('0x1'));module[_0x2d07('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 50b6b6c..c5ac4a9 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 _0xee5b=['./lib/api'];(function(_0x1c90b3,_0x42e708){var _0x413867=function(_0x19c6f4){while(--_0x19c6f4){_0x1c90b3['push'](_0x1c90b3['shift']());}};_0x413867(++_0x42e708);}(_0xee5b,0x1f4));var _0xbee5=function(_0x34dc4b,_0xdd40ea){_0x34dc4b=_0x34dc4b-0x0;var _0x173934=_0xee5b[_0x34dc4b];return _0x173934;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ No newline at end of file +var _0xac4a=['exports','./lib/api'];(function(_0x31223c,_0x337cda){var _0x49c772=function(_0x30f242){while(--_0x30f242){_0x31223c['push'](_0x31223c['shift']());}};_0x49c772(++_0x337cda);}(_0xac4a,0x13f));var _0xaac4=function(_0x39f050,_0x3982d2){_0x39f050=_0x39f050-0x0;var _0x257557=_0xac4a[_0x39f050];return _0x257557;};'use strict';var lex=require(_0xaac4('0x0'));module[_0xaac4('0x1')]=function(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e){return lex(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e);}; \ 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 349c108..545d7c4 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(_0x589e7b,_0x567422){var _0x331513=function(_0x281b16){while(--_0x281b16){_0x589e7b['push'](_0x589e7b['shift']());}};_0x331513(++_0x567422);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x484584,_0x35c420){var _0x2d089e=function(_0x5e0666){while(--_0x5e0666){_0x484584['push'](_0x484584['shift']());}};_0x2d089e(++_0x35c420);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 fd62900..c7f349b 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 _0x8150=['exports','./lib/api'];(function(_0x10887c,_0x273db2){var _0x33548a=function(_0x2f5002){while(--_0x2f5002){_0x10887c['push'](_0x10887c['shift']());}};_0x33548a(++_0x273db2);}(_0x8150,0x1ef));var _0x0815=function(_0x177af0,_0x494e75){_0x177af0=_0x177af0-0x0;var _0x4e2480=_0x8150[_0x177af0];return _0x4e2480;};'use strict';var polly=require(_0x0815('0x0'));module[_0x0815('0x1')]=function(_0x48a3cd,_0x289e99,_0x88eada,_0x262a59,_0x5c8792,_0x48ce46,_0x172d05){return polly(_0x48a3cd,_0x289e99,_0x88eada,_0x262a59,_0x5c8792,_0x48ce46,_0x172d05);}; \ No newline at end of file +var _0xb134=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb134,0x115));var _0x4b13=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xb134[_0x29e3ec];return _0x25727e;};'use strict';var polly=require(_0x4b13('0x0'));module[_0x4b13('0x1')]=function(_0x39dcf0,_0x3eab27,_0x12ebdf,_0x562f82,_0x4f664d,_0x3e9401,_0x2f5364){return polly(_0x39dcf0,_0x3eab27,_0x12ebdf,_0x562f82,_0x4f664d,_0x3e9401,_0x2f5364);}; \ 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 dd9a0d6..38f9cd8 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 _0x7fc4=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','path'];(function(_0x4009af,_0x1bc8ac){var _0x16e058=function(_0x1f5c30){while(--_0x1f5c30){_0x4009af['push'](_0x4009af['shift']());}};_0x16e058(++_0x1bc8ac);}(_0x7fc4,0x121));var _0x47fc=function(_0x2be785,_0x1ffda7){_0x2be785=_0x2be785-0x0;var _0x322198=_0x7fc4[_0x2be785];return _0x322198;};'use strict';var fs=require('fs');var path=require(_0x47fc('0x0'));var BPromise=require('bluebird');var rs=require(_0x47fc('0x1'));var AWS=require(_0x47fc('0x2'));function pollyResult(_0x3951c2,_0x3b27c6,_0x54ad0c){return new BPromise(function(_0x15ad2e,_0x4b83b9){_0x3951c2[_0x47fc('0x3')](_0x3b27c6,function(_0x157f72,_0x49ef75){if(_0x157f72){_0x4b83b9(_0x157f72);}else if(_0x49ef75){if(_0x49ef75[_0x47fc('0x4')]instanceof Buffer){fs[_0x47fc('0x5')](_0x54ad0c,_0x49ef75['AudioStream'],function(_0x2490be){if(_0x2490be){_0x4b83b9(_0x2490be);}else{_0x15ad2e();}});}else{_0x4b83b9(new Error(_0x47fc('0x6')));}}else{_0x4b83b9(new Error(_0x47fc('0x7')));}});});}module[_0x47fc('0x8')]=function(_0x3819b0,_0x4623a4,_0x380256,_0x599446,_0x3f21e9,_0x1dcf02,_0x5f2fc4){var _0x1b3ce8=new AWS[(_0x47fc('0x9'))]({'accessKeyId':_0x3819b0,'secretAccessKey':_0x4623a4,'region':_0x380256});var _0x3e5b34={'Text':_0x3f21e9,'TextType':_0x1dcf02||'text','OutputFormat':'mp3','VoiceId':_0x599446};return pollyResult(_0x1b3ce8,_0x3e5b34,_0x5f2fc4);}; \ No newline at end of file +var _0x8bef=['randomstring','aws-sdk','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x1c0b46,_0x39e4c1){var _0x48fe48=function(_0x55406d){while(--_0x55406d){_0x1c0b46['push'](_0x1c0b46['shift']());}};_0x48fe48(++_0x39e4c1);}(_0x8bef,0x1c1));var _0xf8be=function(_0x58f457,_0x990c9b){_0x58f457=_0x58f457-0x0;var _0x2e8229=_0x8bef[_0x58f457];return _0x2e8229;};'use strict';var fs=require('fs');var path=require(_0xf8be('0x0'));var BPromise=require(_0xf8be('0x1'));var rs=require(_0xf8be('0x2'));var AWS=require(_0xf8be('0x3'));function pollyResult(_0xd75e33,_0x1a6cc5,_0x2f2cbd){return new BPromise(function(_0x18babb,_0xf52545){_0xd75e33['synthesizeSpeech'](_0x1a6cc5,function(_0x5d630f,_0x3b5925){if(_0x5d630f){_0xf52545(_0x5d630f);}else if(_0x3b5925){if(_0x3b5925[_0xf8be('0x4')]instanceof Buffer){fs[_0xf8be('0x5')](_0x2f2cbd,_0x3b5925[_0xf8be('0x4')],function(_0x565eab){if(_0x565eab){_0xf52545(_0x565eab);}else{_0x18babb();}});}else{_0xf52545(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xf52545(new Error(_0xf8be('0x6')));}});});}module[_0xf8be('0x7')]=function(_0x5f4f3b,_0x2fefda,_0x37c4e2,_0x321603,_0x4a0bc0,_0x2b5c4a,_0x53b675){var _0x1db94b=new AWS[(_0xf8be('0x8'))]({'accessKeyId':_0x5f4f3b,'secretAccessKey':_0x2fefda,'region':_0x37c4e2});var _0x5b3951={'Text':_0x4a0bc0,'TextType':_0x2b5c4a||_0xf8be('0x9'),'OutputFormat':_0xf8be('0xa'),'VoiceId':_0x321603};return pollyResult(_0x1db94b,_0x5b3951,_0x53b675);}; \ 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 3f75829..018720e 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 _0xc696=['exports'];(function(_0x54d1ca,_0xa99489){var _0x119f49=function(_0x1228ac){while(--_0x1228ac){_0x54d1ca['push'](_0x54d1ca['shift']());}};_0x119f49(++_0xa99489);}(_0xc696,0xe1));var _0x6c69=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc696[_0xa148b7];return _0x51efd3;};'use strict';var asr=require('./lib/api');module[_0x6c69('0x0')]=function(_0x92b8e6,_0x340f03,_0x5f0058,_0x42199a){return asr(_0x92b8e6,_0x340f03,_0x5f0058);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x62b41b,_0x9521c1,_0x470a5d,_0xf7494f){return asr(_0x62b41b,_0x9521c1,_0x470a5d);}; \ 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 089908d..b7f28e6 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 _0xee11=['base64','POST','LINEAR16','8000','url','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0xf6528d,_0x73f4e7){var _0x45b975=function(_0x3ebfb1){while(--_0x3ebfb1){_0xf6528d['push'](_0xf6528d['shift']());}};_0x45b975(++_0x73f4e7);}(_0xee11,0x146));var _0x1ee1=function(_0x2158a6,_0x11993c){_0x2158a6=_0x2158a6-0x0;var _0x4da6ed=_0xee11[_0x2158a6];return _0x4da6ed;};'use strict';var url=require(_0x1ee1('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x1ee1('0x1')]=function(_0x1a6844,_0x3a1711,_0x1eb386){return new BPromise(function(_0x2a94ef,_0x14d420){var _0x3eb96f;if(typeof _0x1a6844!==_0x1ee1('0x2')||_0x1a6844['length']===0x0){return _0x14d420(_0x1ee1('0x3'));}if(typeof _0x3a1711!==_0x1ee1('0x2')||_0x3a1711[_0x1ee1('0x4')]===0x0){return _0x14d420(_0x1ee1('0x5'));}if(typeof _0x1eb386!==_0x1ee1('0x6')&&(typeof _0x1eb386!=='string'||_0x1eb386['length']===0x0)){return _0x14d420(_0x1ee1('0x7'));}try{_0x3eb96f=fs[_0x1ee1('0x8')](_0x1a6844)[_0x1ee1('0x9')](_0x1ee1('0xa'));}catch(_0x5b5e05){return _0x14d420(_0x5b5e05);}return _0x2a94ef({'method':_0x1ee1('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x3a1711,'body':{'config':{'encoding':_0x1ee1('0xc'),'sampleRateHertz':_0x1ee1('0xd'),'languageCode':_0x1eb386},'audio':{'content':_0x3eb96f}},'json':!![]});});}; \ No newline at end of file +var _0xc577=['length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url','exports'];(function(_0x48d6c2,_0x1ce5d2){var _0x39eeb1=function(_0xa992a7){while(--_0xa992a7){_0x48d6c2['push'](_0x48d6c2['shift']());}};_0x39eeb1(++_0x1ce5d2);}(_0xc577,0x172));var _0x7c57=function(_0xfb8f31,_0x2d3880){_0xfb8f31=_0xfb8f31-0x0;var _0x28b6e0=_0xc577[_0xfb8f31];return _0x28b6e0;};'use strict';var url=require(_0x7c57('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x7c57('0x1')]=function(_0x35af09,_0xe9a500,_0x2a2415){return new BPromise(function(_0x3abdb2,_0x304922){var _0x2ea08b;if(typeof _0x35af09!=='string'||_0x35af09[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x3'));}if(typeof _0xe9a500!==_0x7c57('0x4')||_0xe9a500[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x5'));}if(typeof _0x2a2415!=='undefined'&&(typeof _0x2a2415!=='string'||_0x2a2415['length']===0x0)){return _0x304922(_0x7c57('0x6'));}try{_0x2ea08b=fs['readFileSync'](_0x35af09)[_0x7c57('0x7')](_0x7c57('0x8'));}catch(_0x11dd41){return _0x304922(_0x11dd41);}return _0x3abdb2({'method':_0x7c57('0x9'),'uri':host+'/v1/speech:recognize?key='+_0xe9a500,'body':{'config':{'encoding':_0x7c57('0xa'),'sampleRateHertz':_0x7c57('0xb'),'languageCode':_0x2a2415},'audio':{'content':_0x2ea08b}},'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 b84a250..1e51c78 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 _0xce94=['exports','./asr'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xce94,0x9f));var _0x4ce9=function(_0x464f26,_0x4d650a){_0x464f26=_0x464f26-0x0;var _0x3ae467=_0xce94[_0x464f26];return _0x3ae467;};var asr=require(_0x4ce9('0x0'));module[_0x4ce9('0x1')]={'asr':asr}; \ No newline at end of file +var _0x181a=['exports'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x181a,0x1a7));var _0xa181=function(_0x29a50e,_0x3c06dd){_0x29a50e=_0x29a50e-0x0;var _0x24413e=_0x181a[_0x29a50e];return _0x24413e;};var asr=require('./asr');module[_0xa181('0x0')]={'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 067c4d5..e7e48eb 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 _0x77bc=['util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','download\x20error','https:','end','wav','error\x20convert','info','start','resolve','tmp','generate','.wav','writeFileSync','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','from','audioContent','base64','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','data','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','responseId','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','sox','google-tts-api','url','parse'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x77bc,0x196));var _0xc77b=function(_0x34f692,_0x31290b){_0x34f692=_0x34f692-0x0;var _0x3851e6=_0x77bc[_0x34f692];return _0x3851e6;};'use strict';var apiai=require(_0xc77b('0x0'));var BPromise=require(_0xc77b('0x1'));var dialogflow=require(_0xc77b('0x2'));var fs=require('fs');var http=require(_0xc77b('0x3'));var https=require(_0xc77b('0x4'));var md5=require(_0xc77b('0x5'));var path=require(_0xc77b('0x6'));var querystring=require('querystring');var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0xc77b('0x7'));var tts=require(_0xc77b('0x8'));var urlParse=require(_0xc77b('0x9'))[_0xc77b('0xa')];var util=require(_0xc77b('0xb'));var aws=require(_0xc77b('0xc'));var google=require(_0xc77b('0xd'));var sestek=require(_0xc77b('0xe'));var tilde=require(_0xc77b('0xf'));var logger=require('../../../config/logger')(_0xc77b('0x10'));var ISPEECH_API=_0xc77b('0x11');function downloadFile(_0x4413e7,_0x344fe0){return new BPromise(function(_0x49d11b,_0x55c987){var _0x542d96=urlParse(_0x4413e7);var _0x216342=_0x542d96[_0xc77b('0x12')]==='https:'?https:http;var _0x5090df={'host':_0x542d96[_0xc77b('0x13')],'path':_0x542d96['path'],'headers':{'user-agent':_0xc77b('0x14')}};_0x216342[_0xc77b('0x15')](_0x5090df,function(_0x117606){if(_0x117606[_0xc77b('0x16')]!==0xc8){logger[_0xc77b('0x17')](_0xc77b('0x18')+_0x4413e7+_0xc77b('0x19')+_0x117606[_0xc77b('0x16')]+'\x20('+_0x117606['statusMessage']+')');_0x55c987(new Error(_0xc77b('0x18')+_0x4413e7+_0xc77b('0x19')+_0x117606[_0xc77b('0x16')]+'\x20('+_0x117606[_0xc77b('0x1a')]+')'));return;}var _0x2b0a76=fs[_0xc77b('0x1b')](_0x344fe0);_0x2b0a76['on'](_0xc77b('0x1c'),function(){logger['info']('finish\x20download\x20file');_0x2b0a76[_0xc77b('0x1d')](_0x49d11b);});_0x2b0a76['on']('error',function(_0xe6837){fs['unlink'](_0x344fe0);logger[_0xc77b('0x17')](_0xc77b('0x1e'),_0xe6837);_0x55c987(_0xe6837);});_0x117606['pipe'](_0x2b0a76);})['on'](_0xc77b('0x17'),function(_0x4728bb){logger[_0xc77b('0x17')](_0x4728bb);_0x55c987(_0x4728bb);})['end']();});}function uploadFile(_0x73f7c2){return new BPromise(function(_0x4af815,_0x2bb7ec){var _0x462612=urlParse(_0x73f7c2);var _0x14ac92=_0x462612[_0xc77b('0x12')]===_0xc77b('0x1f')?https:http;var _0x1642c2={'host':_0x462612['host'],'path':_0x462612[_0xc77b('0x6')],'headers':{'user-agent':_0xc77b('0x14')}};_0x14ac92[_0xc77b('0x15')](_0x1642c2,function(_0x23f5fe){if(_0x23f5fe[_0xc77b('0x16')]!==0xc8){_0x2bb7ec(new Error(_0xc77b('0x18')+_0x73f7c2+_0xc77b('0x19')+_0x23f5fe[_0xc77b('0x16')]+'\x20('+_0x23f5fe[_0xc77b('0x1a')]+')'));return;}var _0xeef821='';_0x23f5fe['on']('data',function(_0x276f96){_0xeef821+=_0x276f96;});_0x23f5fe['on'](_0xc77b('0x20'),function(){_0x4af815(_0xeef821);});})['on'](_0xc77b('0x17'),function(_0x18c668){_0x2bb7ec(_0x18c668);})[_0xc77b('0x20')]();});}function convertFile(_0x1d433c,_0x4bdaca){return new BPromise(function(_0x3e260f,_0x3d5df3){var _0x149d5c=sox['transcode'](_0x1d433c,_0x4bdaca,{'sampleRate':0x1f40,'format':_0xc77b('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x149d5c['on'](_0xc77b('0x17'),function(_0xaeea68){logger[_0xc77b('0x17')](_0xc77b('0x22'),_0xaeea68);_0x3d5df3(_0xaeea68);});_0x149d5c['on'](_0xc77b('0x20'),function(){logger[_0xc77b('0x23')]('finish\x20to\x20convert');_0x3e260f();});_0x149d5c[_0xc77b('0x24')]();});}function base64Decode(_0x5679ea,_0x1cc842){var _0x4c360a=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));fs[_0xc77b('0x29')](_0x4c360a,_0x5679ea,'base64');return convertFile(_0x4c360a,_0x1cc842)['then'](function(){try{fs[_0xc77b('0x2a')](_0x4c360a);fs[_0xc77b('0x2b')](_0x1cc842,_0xc77b('0x2c'));}catch(_0x135885){logger[_0xc77b('0x17')](_0x135885);}return _0x1cc842[_0xc77b('0x2d')]('.')[0x0];});}function base64Encode(_0x49416c){var _0x1c7d9a=fs[_0xc77b('0x2e')](_0x49416c);return new Buffer(_0x1c7d9a)[_0xc77b('0x2f')]('base64');}exports[_0xc77b('0x30')]=function(_0x4fb837,_0x43817,_0x3f28f6,_0x3ea505,_0x25982a,_0x10d8b5){var _0xc0aa34,_0x1927c6;var _0x3f8772=_0xc77b('0x31');var _0x5b2901=_0xc77b('0x32')+_0x4fb837;var _0x3f9be0={};if(_0x43817===_0xc77b('0x33')){_0x3f9be0[_0xc77b('0x34')]={'ssml':_0x3f28f6};}else{_0x3f9be0[_0xc77b('0x34')]={'text':_0x3f28f6};};_0x3f9be0[_0xc77b('0x35')]={'languageCode':_0x3ea505,'ssmlGender':_0x25982a};_0x3f9be0[_0xc77b('0x36')]={'audioEncoding':_0xc77b('0x37'),'sampleRateHertz':0x1f40};var _0xef5772={'url':_0x3f8772+_0xc77b('0x38')+_0x5b2901,'method':_0xc77b('0x39'),'json':!![],'body':_0x3f9be0};return rp(_0xef5772)[_0xc77b('0x3a')](function(_0x5e82b2){return new BPromise(function(_0x4865d9,_0x39e46a){_0xc0aa34=path[_0xc77b('0x25')](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+'.mp3');var _0x1db25c=Buffer[_0xc77b('0x3b')](_0x5e82b2[_0xc77b('0x3c')],_0xc77b('0x3d'));return fs['writeFile'](_0xc0aa34,_0x1db25c,function(_0x32f179){_0x39e46a(_0x32f179);},function(_0x443564){fs['chmodSync'](_0xc0aa34,'777');_0x4865d9(_0x443564);});});})[_0xc77b('0x3a')](function(_0x573b7b){_0x1927c6=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0xc0aa34,_0x1927c6);})[_0xc77b('0x3a')](function(){try{fs[_0xc77b('0x2a')](_0xc0aa34);fs[_0xc77b('0x2b')](_0x1927c6,_0xc77b('0x2c'));}catch(_0x2e5310){logger[_0xc77b('0x17')](_0x2e5310);}logger[_0xc77b('0x23')](_0xc77b('0x3e'),_0x1927c6['split']('.')[0x0]);return _0x1927c6['split']('.')[0x0];});};exports[_0xc77b('0x3f')]=function(_0x5cbac2,_0x123ee1){var _0x2855f5=_0xc77b('0x40');var _0x151f05,_0x3a1c30;var _0x109d23;var _0x188a76={'encoding':_0xc77b('0x41'),'method':_0xc77b('0x39'),'timeout':0x2710,'url':_0x2855f5,'headers':{'Content-Type':_0xc77b('0x42')},'body':_0xc77b('0x43')+encodeURIComponent(JSON[_0xc77b('0x44')]([[[_0xc77b('0x45'),JSON['stringify']([_0x5cbac2,_0x123ee1||'en',![],_0xc77b('0x46')]),null,'generic']]]))};return rp(_0x188a76)['then'](function(_0x308970){try{_0x109d23=eval(_0x308970[_0xc77b('0x47')](0x5))[0x0][0x2];}catch(_0x28b25f){throw new Error(_0xc77b('0x48')+_0x308970['data']);}if(!_0x109d23){if(_0x5cbac2[_0xc77b('0x49')]>0xc8){throw new Error(_0xc77b('0x4a'));}else{throw new Error('lang\x20\x22'+_0x123ee1+'\x22\x20might\x20not\x20exist');}}try{_0x109d23=eval(_0x109d23)[0x0];}catch(_0x4cc7d9){throw new Error(_0xc77b('0x48')+res[_0xc77b('0x4b')]);}const _0xdb0d6d=_0x109d23;_0x151f05=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+'.mp3');fs[_0xc77b('0x29')](_0x151f05,_0x109d23,{'encoding':_0xc77b('0x3d')});_0x3a1c30=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0x151f05,_0x3a1c30);})['then'](function(){try{fs[_0xc77b('0x2a')](_0x151f05);fs[_0xc77b('0x2b')](_0x3a1c30,_0xc77b('0x2c'));}catch(_0x4b9444){logger[_0xc77b('0x17')](_0x4b9444);}logger['info'](_0xc77b('0x4c'),_0x3a1c30['split']('.')[0x0]);return _0x3a1c30[_0xc77b('0x2d')]('.')[0x0];});};exports[_0xc77b('0x4d')]=function(_0x2bafd9,_0x331203,_0x50ff94){return google[_0xc77b('0x4e')](_0x2bafd9,_0x331203,_0x50ff94)[_0xc77b('0x3a')](function(_0x23cdaa){logger[_0xc77b('0x23')](_0x23cdaa[_0xc77b('0x4f')]);return rp(_0x23cdaa);})['then'](function(_0x1bb560){var _0xf5fcd5='';var _0x15ef01=0x0;try{fs['unlink'](_0x2bafd9);}catch(_0x3d07aa){logger[_0xc77b('0x17')](_0x3d07aa);}if(_0x1bb560&&_0x1bb560[_0xc77b('0x50')]){_0xf5fcd5=_0x1bb560['results']['map'](function(_0x178850){return _0x178850&&_0x178850[_0xc77b('0x51')][0x0]&&_0x178850[_0xc77b('0x51')][0x0]['transcript']?_0x178850[_0xc77b('0x51')][0x0][_0xc77b('0x52')]:'';})[_0xc77b('0x53')]('\x0a');_0x15ef01=_0x1bb560[_0xc77b('0x50')][_0xc77b('0x54')](function(_0x333df4){return _0x333df4&&_0x333df4[_0xc77b('0x51')][0x0]&&_0x333df4[_0xc77b('0x51')][0x0][_0xc77b('0x55')]?_0x333df4['alternatives'][0x0][_0xc77b('0x55')]:0x0;})[_0xc77b('0x53')]('\x0a');}logger[_0xc77b('0x23')](_0xc77b('0x56'),_0xf5fcd5);logger['info'](_0xc77b('0x57'),_0x15ef01);return{'transcript':_0xf5fcd5,'confidence':_0x15ef01};})[_0xc77b('0x58')](function(_0x139e8b){logger[_0xc77b('0x17')](_0xc77b('0x59'),_0x139e8b[_0xc77b('0x16')],_0x139e8b[_0xc77b('0x5a')],_0x139e8b[_0xc77b('0x5b')]);});};exports[_0xc77b('0x5c')]=function(_0x426f3e,_0x122289,_0x4000cf,_0x400593){var _0xa43f30=apiai(_0x122289,{'language':_0x400593||'en'});return _0xa43f30[_0xc77b('0x5d')](_0x4000cf,{'sessionId':md5(_0x426f3e)})['then'](function(_0x4d2fa7){logger[_0xc77b('0x23')](JSON[_0xc77b('0x44')](_0x4d2fa7));return{'source':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x5f')],'resolvedQuery':_0x4d2fa7['result'][_0xc77b('0x60')],'action':_0x4d2fa7['result'][_0xc77b('0x61')],'actionIncomplete':_0x4d2fa7['result']['actionIncomplete'],'speech':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x62')][_0xc77b('0x63')],'score':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x64')],'statusCode':_0x4d2fa7[_0xc77b('0x65')][_0xc77b('0x66')],'endConversation':_0x4d2fa7['result'][_0xc77b('0x67')]['endConversation']||![],'isFallbackIntent':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x67')][_0xc77b('0x68')]};});};exports[_0xc77b('0x69')]=function(_0x1f8997,_0x9da2af,_0x54d098,_0x113146,_0x21f1f6,_0x3a0816){var _0x7d4e71=_0x113146['replace'](/\\n/g,'\x0a');var _0x46f0e8={'credentials':{'private_key':_0x7d4e71,'client_email':_0x54d098}};var _0x5ed24d=new dialogflow['SessionsClient'](_0x46f0e8);var _0x17515c=_0x5ed24d['sessionPath'](_0x9da2af,md5(_0x1f8997));var _0x3b6487={'session':_0x17515c,'queryInput':{'text':{'text':_0x21f1f6,'languageCode':_0x3a0816}}};return _0x5ed24d[_0xc77b('0x6a')](_0x3b6487)['then'](function(_0xce1ca6){if(_0xce1ca6&&_0xce1ca6[_0xc77b('0x49')]){logger[_0xc77b('0x23')](_0xc77b('0x6b'),JSON[_0xc77b('0x44')](_0xce1ca6));var _0x35fd9d=_0xce1ca6[0x0];if(_0x35fd9d){var _0x53a32e={'action':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x61')],'allRequiredParamsPresent':_0x35fd9d['queryResult']['allRequiredParamsPresent'],'endConversation':_0x35fd9d['queryResult']['diagnosticInfo']&&_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x6d')][_0xc77b('0x6e')]?_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x6d')][_0xc77b('0x6e')][_0xc77b('0x6f')][_0xc77b('0x70')]:![],'fulfillmentText':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x71')],'intentName':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x72')][_0xc77b('0x5a')],'intentDisplayName':_0x35fd9d['queryResult'][_0xc77b('0x72')][_0xc77b('0x73')],'isFallbackIntent':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x72')]['isFallback'],'languageCode':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x74')],'queryText':_0x35fd9d[_0xc77b('0x6c')]['queryText'],'responseId':_0x35fd9d[_0xc77b('0x75')],'score':_0x35fd9d[_0xc77b('0x6c')]['intentDetectionConfidence'],'speech':_0x35fd9d[_0xc77b('0x6c')]['fulfillmentText'],'providerResponse':JSON[_0xc77b('0x44')](_0xce1ca6)};return _0x53a32e;}}});};exports[_0xc77b('0x76')]=function(_0x408bb7,_0x234bf5,_0x46dc2f,_0x167eda){return tilde[_0xc77b('0x4e')](_0x408bb7,_0x234bf5,_0x46dc2f,_0x167eda)[_0xc77b('0x3a')](function(_0x1018f7){try{fs['unlink'](_0x408bb7);}catch(_0x16ce48){logger['error'](_0x16ce48);}logger[_0xc77b('0x23')](_0xc77b('0x77'),_0x1018f7[_0xc77b('0x52')]);logger[_0xc77b('0x23')](_0xc77b('0x78'),_0x1018f7[_0xc77b('0x55')]);return _0x1018f7;});};exports[_0xc77b('0x79')]=function(_0x52366b,_0x16c038,_0x1b7793,_0x56bc45,_0x4c6a4f,_0x4a3716){var _0x4ad172=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x7a'));var _0x725114;return aws['polly'](_0x52366b,_0x16c038,_0x1b7793,_0x56bc45,_0x4c6a4f,_0x4a3716,_0x4ad172)[_0xc77b('0x3a')](function(){_0x725114=path[_0xc77b('0x25')](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0x4ad172,_0x725114);})[_0xc77b('0x3a')](function(){try{fs[_0xc77b('0x2a')](_0x4ad172);fs[_0xc77b('0x2b')](_0x725114,'777');}catch(_0xe650e4){logger[_0xc77b('0x17')](_0xe650e4);}return _0x725114[_0xc77b('0x2d')]('.')[0x0];});};exports[_0xc77b('0x7b')]=function(_0x3b74e5,_0x23a858,_0x43497c,_0x33563d,_0x21ed96,_0x214753){return aws[_0xc77b('0x7c')](_0x3b74e5,_0x23a858,_0x43497c,_0x33563d,_0x21ed96,_0x214753)[_0xc77b('0x3a')](function(_0x2f9fb1){logger[_0xc77b('0x23')](JSON[_0xc77b('0x44')](_0x2f9fb1));return _0x2f9fb1;});};exports['ispeechTTS']=function(_0x2e9087,_0x381da2,_0x50d7c0,_0x563322){var _0x4b03a9=util[_0xc77b('0x7d')](_0xc77b('0x7e'),ISPEECH_API,_0x2e9087,encodeURIComponent(_0x381da2),_0x50d7c0,_0x563322);var _0x2b03c8=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs['generate'](0x4)+'.mp3');var _0x16f51e;return downloadFile(_0x4b03a9,_0x2b03c8)[_0xc77b('0x3a')](function(){_0x16f51e=path['resolve'](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0x2b03c8,_0x16f51e);})[_0xc77b('0x3a')](function(){try{fs['unlink'](_0x2b03c8);fs['chmodSync'](_0x16f51e,'777');}catch(_0x2b670c){logger[_0xc77b('0x17')](_0x2b670c);}return _0x16f51e[_0xc77b('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x3052fc,_0x137e36,_0x3db1b8,_0x8192d7){var _0x7f17a5=util['format'](_0xc77b('0x7f'),ISPEECH_API,_0x137e36,_0x3db1b8,base64Encode(_0x3052fc),_0x8192d7?util[_0xc77b('0x7d')](_0xc77b('0x80'),encodeURIComponent(_0x8192d7)):_0xc77b('0x81'));return uploadFile(_0x7f17a5)['then'](function(_0x3c3f5a){return querystring['parse'](_0x3c3f5a);});};exports[_0xc77b('0x82')]=function(_0x4c6812,_0x494170){return sestek[_0xc77b('0x83')](_0x4c6812,_0x494170)[_0xc77b('0x3a')](function(_0x11b193){logger['info'](JSON[_0xc77b('0x44')](_0x11b193));var _0x4d9da1={'speech':_0x11b193[_0xc77b('0x84')],'action':_0x11b193[_0xc77b('0x85')]?_0x11b193[_0xc77b('0x85')][_0xc77b('0x86')]:undefined,'actiondata':_0x11b193[_0xc77b('0x85')]?_0x11b193['channelData'][_0xc77b('0x87')]:undefined};if(_0x11b193[_0xc77b('0x85')]&&_0x11b193['channelData']['AudioFromTts']){return base64Decode(_0x11b193[_0xc77b('0x85')][_0xc77b('0x88')][_0xc77b('0x89')],path[_0xc77b('0x25')](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+'.wav'))[_0xc77b('0x3a')](function(_0x2f2001){_0x4d9da1['audiofile']=_0x2f2001;return _0x4d9da1;});}return _0x4d9da1;});};exports[_0xc77b('0x8a')]=function(){return __dirname;}; \ No newline at end of file +var _0x55e0=['WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','pipe','end','host','data','transcode','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','text:synthesize','POST','from','audioContent','writeFile','chmodSync','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','displayName','intent','isFallback','languageCode','queryText','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','.mp3','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','util','./aws','./google','./sestek','protocol','https:','path'];(function(_0x12ee93,_0x29635c){var _0x280a43=function(_0x3eeb2d){while(--_0x3eeb2d){_0x12ee93['push'](_0x12ee93['shift']());}};_0x280a43(++_0x29635c);}(_0x55e0,0xfc));var _0x055e=function(_0x40b05d,_0x45d9ca){_0x40b05d=_0x40b05d-0x0;var _0x4f36cc=_0x55e0[_0x40b05d];return _0x4f36cc;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x055e('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x055e('0x1'));var https=require(_0x055e('0x2'));var md5=require(_0x055e('0x3'));var path=require('path');var querystring=require(_0x055e('0x4'));var rp=require(_0x055e('0x5'));var rs=require(_0x055e('0x6'));var sox=require(_0x055e('0x7'));var tts=require(_0x055e('0x8'));var urlParse=require('url')['parse'];var util=require(_0x055e('0x9'));var aws=require(_0x055e('0xa'));var google=require(_0x055e('0xb'));var sestek=require(_0x055e('0xc'));var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2141e6,_0x1bc2e0){return new BPromise(function(_0xe19404,_0x4fa6b9){var _0x39900a=urlParse(_0x2141e6);var _0x2f232a=_0x39900a[_0x055e('0xd')]===_0x055e('0xe')?https:http;var _0xcc8f3c={'host':_0x39900a['host'],'path':_0x39900a[_0x055e('0xf')],'headers':{'user-agent':_0x055e('0x10')}};_0x2f232a[_0x055e('0x11')](_0xcc8f3c,function(_0x1de4ab){if(_0x1de4ab[_0x055e('0x12')]!==0xc8){logger[_0x055e('0x13')](_0x055e('0x14')+_0x2141e6+_0x055e('0x15')+_0x1de4ab[_0x055e('0x12')]+'\x20('+_0x1de4ab[_0x055e('0x16')]+')');_0x4fa6b9(new Error('request\x20to\x20'+_0x2141e6+_0x055e('0x15')+_0x1de4ab[_0x055e('0x12')]+'\x20('+_0x1de4ab[_0x055e('0x16')]+')'));return;}var _0xe9efa0=fs[_0x055e('0x17')](_0x1bc2e0);_0xe9efa0['on']('finish',function(){logger[_0x055e('0x18')](_0x055e('0x19'));_0xe9efa0[_0x055e('0x1a')](_0xe19404);});_0xe9efa0['on'](_0x055e('0x13'),function(_0x33dff0){fs[_0x055e('0x1b')](_0x1bc2e0);logger['error']('download\x20error',_0x33dff0);_0x4fa6b9(_0x33dff0);});_0x1de4ab[_0x055e('0x1c')](_0xe9efa0);})['on'](_0x055e('0x13'),function(_0x65440c){logger[_0x055e('0x13')](_0x65440c);_0x4fa6b9(_0x65440c);})[_0x055e('0x1d')]();});}function uploadFile(_0x55275e){return new BPromise(function(_0x1027a2,_0x1c80a5){var _0x3bbafc=urlParse(_0x55275e);var _0x354075=_0x3bbafc[_0x055e('0xd')]===_0x055e('0xe')?https:http;var _0x48d97e={'host':_0x3bbafc[_0x055e('0x1e')],'path':_0x3bbafc['path'],'headers':{'user-agent':_0x055e('0x10')}};_0x354075['get'](_0x48d97e,function(_0xb0d688){if(_0xb0d688[_0x055e('0x12')]!==0xc8){_0x1c80a5(new Error(_0x055e('0x14')+_0x55275e+_0x055e('0x15')+_0xb0d688['statusCode']+'\x20('+_0xb0d688['statusMessage']+')'));return;}var _0x531d12='';_0xb0d688['on'](_0x055e('0x1f'),function(_0x11c84b){_0x531d12+=_0x11c84b;});_0xb0d688['on'](_0x055e('0x1d'),function(){_0x1027a2(_0x531d12);});})['on'](_0x055e('0x13'),function(_0x453444){_0x1c80a5(_0x453444);})[_0x055e('0x1d')]();});}function convertFile(_0x583d53,_0x3171c6){return new BPromise(function(_0x582423,_0x5d570e){var _0x35abb3=sox[_0x055e('0x20')](_0x583d53,_0x3171c6,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x35abb3['on'](_0x055e('0x13'),function(_0x118f51){logger[_0x055e('0x13')](_0x055e('0x21'),_0x118f51);_0x5d570e(_0x118f51);});_0x35abb3['on'](_0x055e('0x1d'),function(){logger['info'](_0x055e('0x22'));_0x582423();});_0x35abb3['start']();});}function base64Decode(_0x5ad3ff,_0xb1dedf){var _0x385507=path[_0x055e('0x23')](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+_0x055e('0x26'));fs[_0x055e('0x27')](_0x385507,_0x5ad3ff,_0x055e('0x28'));return convertFile(_0x385507,_0xb1dedf)[_0x055e('0x29')](function(){try{fs['unlink'](_0x385507);fs['chmodSync'](_0xb1dedf,_0x055e('0x2a'));}catch(_0xae20c9){logger[_0x055e('0x13')](_0xae20c9);}return _0xb1dedf['split']('.')[0x0];});}function base64Encode(_0x2fe5a2){var _0x4b77b5=fs[_0x055e('0x2b')](_0x2fe5a2);return new Buffer(_0x4b77b5)[_0x055e('0x2c')](_0x055e('0x28'));}exports[_0x055e('0x2d')]=function(_0x504a0c,_0x1e54a9,_0x10143f,_0x541ef5,_0x429c8e,_0x2149d6){var _0x4dae34,_0x54e262;var _0x459b39='https://texttospeech.googleapis.com/v1/';var _0x3732aa=_0x055e('0x2e')+_0x504a0c;var _0x3a1949={};if(_0x1e54a9===_0x055e('0x2f')){_0x3a1949[_0x055e('0x30')]={'ssml':_0x10143f};}else{_0x3a1949[_0x055e('0x30')]={'text':_0x10143f};};_0x3a1949[_0x055e('0x31')]={'languageCode':_0x541ef5,'ssmlGender':_0x429c8e};_0x3a1949['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3580ee={'url':_0x459b39+_0x055e('0x32')+_0x3732aa,'method':_0x055e('0x33'),'json':!![],'body':_0x3a1949};return rp(_0x3580ee)['then'](function(_0x492e99){return new BPromise(function(_0x572fef,_0x179407){_0x4dae34=path[_0x055e('0x23')](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+'.mp3');var _0x3999e0=Buffer[_0x055e('0x34')](_0x492e99[_0x055e('0x35')],_0x055e('0x28'));return fs[_0x055e('0x36')](_0x4dae34,_0x3999e0,function(_0x1f7b5d){_0x179407(_0x1f7b5d);},function(_0x5eceeb){fs[_0x055e('0x37')](_0x4dae34,_0x055e('0x2a'));_0x572fef(_0x5eceeb);});});})[_0x055e('0x29')](function(_0x402121){_0x54e262=path[_0x055e('0x23')](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+'.wav');return convertFile(_0x4dae34,_0x54e262);})['then'](function(){try{fs[_0x055e('0x1b')](_0x4dae34);fs[_0x055e('0x37')](_0x54e262,'777');}catch(_0x54e724){logger[_0x055e('0x13')](_0x54e724);}logger[_0x055e('0x18')]('googleCloudTTS\x20path',_0x54e262[_0x055e('0x38')]('.')[0x0]);return _0x54e262['split']('.')[0x0];});};exports['googleTTS']=function(_0x4eed57,_0x3de889){var _0xacf379=_0x055e('0x39');var _0x17e775,_0x2f3865;var _0x1df862;var _0x26f49e={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0xacf379,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x055e('0x3a')]([[[_0x055e('0x3b'),JSON[_0x055e('0x3a')]([_0x4eed57,_0x3de889||'en',![],_0x055e('0x3c')]),null,_0x055e('0x3d')]]]))};return rp(_0x26f49e)[_0x055e('0x29')](function(_0x16ccde){try{_0x1df862=eval(_0x16ccde[_0x055e('0x3e')](0x5))[0x0][0x2];}catch(_0x228e75){throw new Error(_0x055e('0x3f')+_0x16ccde[_0x055e('0x1f')]);}if(!_0x1df862){if(_0x4eed57[_0x055e('0x40')]>0xc8){throw new Error(_0x055e('0x41'));}else{throw new Error('lang\x20\x22'+_0x3de889+_0x055e('0x42'));}}try{_0x1df862=eval(_0x1df862)[0x0];}catch(_0x595d3f){throw new Error(_0x055e('0x3f')+res['data']);}const _0x21a533=_0x1df862;_0x17e775=path['resolve'](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+'.mp3');fs[_0x055e('0x27')](_0x17e775,_0x1df862,{'encoding':_0x055e('0x28')});_0x2f3865=path[_0x055e('0x23')](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+'.wav');return convertFile(_0x17e775,_0x2f3865);})[_0x055e('0x29')](function(){try{fs[_0x055e('0x1b')](_0x17e775);fs[_0x055e('0x37')](_0x2f3865,_0x055e('0x2a'));}catch(_0x520ef1){logger[_0x055e('0x13')](_0x520ef1);}logger['info'](_0x055e('0x43'),_0x2f3865[_0x055e('0x38')]('.')[0x0]);return _0x2f3865[_0x055e('0x38')]('.')[0x0];});};exports[_0x055e('0x44')]=function(_0x44c874,_0x37d48d,_0x4c90e3){return google[_0x055e('0x45')](_0x44c874,_0x37d48d,_0x4c90e3)[_0x055e('0x29')](function(_0x29e944){logger[_0x055e('0x18')](_0x29e944[_0x055e('0x46')]);return rp(_0x29e944);})[_0x055e('0x29')](function(_0x18212c){var _0xf529b2='';var _0xdae371=0x0;try{fs['unlink'](_0x44c874);}catch(_0x1750b8){logger[_0x055e('0x13')](_0x1750b8);}if(_0x18212c&&_0x18212c[_0x055e('0x47')]){_0xf529b2=_0x18212c[_0x055e('0x47')][_0x055e('0x48')](function(_0x25fe71){return _0x25fe71&&_0x25fe71['alternatives'][0x0]&&_0x25fe71[_0x055e('0x49')][0x0][_0x055e('0x4a')]?_0x25fe71['alternatives'][0x0]['transcript']:'';})[_0x055e('0x4b')]('\x0a');_0xdae371=_0x18212c[_0x055e('0x47')][_0x055e('0x48')](function(_0x22a086){return _0x22a086&&_0x22a086[_0x055e('0x49')][0x0]&&_0x22a086['alternatives'][0x0]['confidence']?_0x22a086[_0x055e('0x49')][0x0][_0x055e('0x4c')]:0x0;})[_0x055e('0x4b')]('\x0a');}logger[_0x055e('0x18')](_0x055e('0x4d'),_0xf529b2);logger[_0x055e('0x18')]('googleASR\x20confidence',_0xdae371);return{'transcript':_0xf529b2,'confidence':_0xdae371};})[_0x055e('0x4e')](function(_0x3ed76c){logger[_0x055e('0x13')](_0x055e('0x4f'),_0x3ed76c[_0x055e('0x12')],_0x3ed76c[_0x055e('0x50')],_0x3ed76c[_0x055e('0x51')]);});};exports[_0x055e('0x52')]=function(_0x27ef5f,_0x3bb296,_0x1cb051,_0x41c0a9){var _0x98d1f=apiai(_0x3bb296,{'language':_0x41c0a9||'en'});return _0x98d1f[_0x055e('0x53')](_0x1cb051,{'sessionId':md5(_0x27ef5f)})['then'](function(_0x9a6b04){logger['info'](JSON['stringify'](_0x9a6b04));return{'source':_0x9a6b04[_0x055e('0x54')][_0x055e('0x55')],'resolvedQuery':_0x9a6b04['result'][_0x055e('0x56')],'action':_0x9a6b04[_0x055e('0x54')][_0x055e('0x57')],'actionIncomplete':_0x9a6b04['result'][_0x055e('0x58')],'speech':_0x9a6b04[_0x055e('0x54')][_0x055e('0x59')]['speech'],'score':_0x9a6b04[_0x055e('0x54')][_0x055e('0x5a')],'statusCode':_0x9a6b04['status'][_0x055e('0x5b')],'endConversation':_0x9a6b04[_0x055e('0x54')][_0x055e('0x5c')][_0x055e('0x5d')]||![],'isFallbackIntent':_0x9a6b04[_0x055e('0x54')][_0x055e('0x5c')][_0x055e('0x5e')]};});};exports['googleDialogflowV2']=function(_0x8e1be5,_0x466621,_0x48f1cd,_0x1d74f2,_0x177a95,_0x53f83c){var _0x1e0a73=_0x1d74f2[_0x055e('0x5f')](/\\n/g,'\x0a');var _0x4d5522={'credentials':{'private_key':_0x1e0a73,'client_email':_0x48f1cd}};var _0x51ddc4=new dialogflow[(_0x055e('0x60'))](_0x4d5522);var _0x471419=_0x51ddc4['sessionPath'](_0x466621,md5(_0x8e1be5));var _0x8bd5b0={'session':_0x471419,'queryInput':{'text':{'text':_0x177a95,'languageCode':_0x53f83c}}};return _0x51ddc4[_0x055e('0x61')](_0x8bd5b0)['then'](function(_0x4f99fd){if(_0x4f99fd&&_0x4f99fd[_0x055e('0x40')]){logger[_0x055e('0x18')](_0x055e('0x62'),JSON[_0x055e('0x3a')](_0x4f99fd));var _0x3b69b5=_0x4f99fd[0x0];if(_0x3b69b5){var _0x479eb6={'action':_0x3b69b5[_0x055e('0x63')]['action'],'allRequiredParamsPresent':_0x3b69b5[_0x055e('0x63')][_0x055e('0x64')],'endConversation':_0x3b69b5['queryResult'][_0x055e('0x65')]&&_0x3b69b5['queryResult'][_0x055e('0x65')][_0x055e('0x66')]?_0x3b69b5[_0x055e('0x63')][_0x055e('0x65')]['fields'][_0x055e('0x67')]['boolValue']:![],'fulfillmentText':_0x3b69b5[_0x055e('0x63')][_0x055e('0x68')],'intentName':_0x3b69b5['queryResult']['intent']['name'],'intentDisplayName':_0x3b69b5[_0x055e('0x63')]['intent'][_0x055e('0x69')],'isFallbackIntent':_0x3b69b5[_0x055e('0x63')][_0x055e('0x6a')][_0x055e('0x6b')],'languageCode':_0x3b69b5[_0x055e('0x63')][_0x055e('0x6c')],'queryText':_0x3b69b5[_0x055e('0x63')][_0x055e('0x6d')],'responseId':_0x3b69b5['responseId'],'score':_0x3b69b5[_0x055e('0x63')][_0x055e('0x6e')],'speech':_0x3b69b5['queryResult'][_0x055e('0x68')],'providerResponse':JSON['stringify'](_0x4f99fd)};return _0x479eb6;}}});};exports['tildeASR']=function(_0x12a18f,_0x96eb50,_0x1719c8,_0x34eb4d){return tilde[_0x055e('0x45')](_0x12a18f,_0x96eb50,_0x1719c8,_0x34eb4d)['then'](function(_0x709f8f){try{fs['unlink'](_0x12a18f);}catch(_0x3210a2){logger['error'](_0x3210a2);}logger[_0x055e('0x18')](_0x055e('0x6f'),_0x709f8f[_0x055e('0x4a')]);logger[_0x055e('0x18')](_0x055e('0x70'),_0x709f8f['confidence']);return _0x709f8f;});};exports['awsPolly']=function(_0x2673c4,_0x3a3b4b,_0x28830d,_0x3802a4,_0x58d8b0,_0x580bad){var _0x564d94=path[_0x055e('0x23')](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+_0x055e('0x71'));var _0x58ae65;return aws[_0x055e('0x72')](_0x2673c4,_0x3a3b4b,_0x28830d,_0x3802a4,_0x58d8b0,_0x580bad,_0x564d94)['then'](function(){_0x58ae65=path['resolve'](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+_0x055e('0x26'));return convertFile(_0x564d94,_0x58ae65);})[_0x055e('0x29')](function(){try{fs[_0x055e('0x1b')](_0x564d94);fs[_0x055e('0x37')](_0x58ae65,_0x055e('0x2a'));}catch(_0x3ba8bc){logger[_0x055e('0x13')](_0x3ba8bc);}return _0x58ae65[_0x055e('0x38')]('.')[0x0];});};exports[_0x055e('0x73')]=function(_0x4f5e05,_0x14ba55,_0x2b295a,_0x5b57b5,_0x204762,_0x2421d4){return aws['lex'](_0x4f5e05,_0x14ba55,_0x2b295a,_0x5b57b5,_0x204762,_0x2421d4)[_0x055e('0x29')](function(_0xaddbd9){logger[_0x055e('0x18')](JSON[_0x055e('0x3a')](_0xaddbd9));return _0xaddbd9;});};exports[_0x055e('0x74')]=function(_0x396554,_0x174529,_0x56fade,_0x2e7302){var _0x2ae404=util['format'](_0x055e('0x75'),ISPEECH_API,_0x396554,encodeURIComponent(_0x174529),_0x56fade,_0x2e7302);var _0xa76016=path['resolve'](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+'.mp3');var _0x405361;return downloadFile(_0x2ae404,_0xa76016)[_0x055e('0x29')](function(){_0x405361=path[_0x055e('0x23')](__dirname,_0x055e('0x24'),rs[_0x055e('0x25')](0x4)+_0x055e('0x26'));return convertFile(_0xa76016,_0x405361);})[_0x055e('0x29')](function(){try{fs[_0x055e('0x1b')](_0xa76016);fs[_0x055e('0x37')](_0x405361,_0x055e('0x2a'));}catch(_0x104622){logger[_0x055e('0x13')](_0x104622);}return _0x405361[_0x055e('0x38')]('.')[0x0];});};exports[_0x055e('0x76')]=function(_0x1cb218,_0x101fbc,_0x22a567,_0x1ad5b3){var _0x328400=util[_0x055e('0x77')](_0x055e('0x78'),ISPEECH_API,_0x101fbc,_0x22a567,base64Encode(_0x1cb218),_0x1ad5b3?util[_0x055e('0x77')](_0x055e('0x79'),encodeURIComponent(_0x1ad5b3)):_0x055e('0x7a'));return uploadFile(_0x328400)[_0x055e('0x29')](function(_0x223c24){return querystring[_0x055e('0x7b')](_0x223c24);});};exports[_0x055e('0x7c')]=function(_0x27e5fb,_0x1b8526){return sestek[_0x055e('0x7d')](_0x27e5fb,_0x1b8526)[_0x055e('0x29')](function(_0xe13c2c){logger['info'](JSON[_0x055e('0x3a')](_0xe13c2c));var _0xa37f5d={'speech':_0xe13c2c[_0x055e('0x7e')],'action':_0xe13c2c[_0x055e('0x7f')]?_0xe13c2c['channelData'][_0x055e('0x80')]:undefined,'actiondata':_0xe13c2c[_0x055e('0x7f')]?_0xe13c2c[_0x055e('0x7f')][_0x055e('0x81')]:undefined};if(_0xe13c2c[_0x055e('0x7f')]&&_0xe13c2c[_0x055e('0x7f')][_0x055e('0x82')]){return base64Decode(_0xe13c2c[_0x055e('0x7f')]['AudioFromTts'][_0x055e('0x83')],path[_0x055e('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0x055e('0x26')))[_0x055e('0x29')](function(_0x134118){_0xa37f5d[_0x055e('0x84')]=_0x134118;return _0xa37f5d;});}return _0xa37f5d;});};exports[_0x055e('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 c2d17e3..f5a52f9 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 _0x50b4=['./nda','exports'];(function(_0x183f7b,_0x514925){var _0x3380e4=function(_0xa57138){while(--_0xa57138){_0x183f7b['push'](_0x183f7b['shift']());}};_0x3380e4(++_0x514925);}(_0x50b4,0xbc));var _0x450b=function(_0x32d9c6,_0x223bff){_0x32d9c6=_0x32d9c6-0x0;var _0x581958=_0x50b4[_0x32d9c6];return _0x581958;};var nda=require(_0x450b('0x0'));module[_0x450b('0x1')]={'nda':nda}; \ No newline at end of file +var _0x1d43=['./nda'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x1d43,0x1a8));var _0x31d4=function(_0x2781ca,_0x324bfd){_0x2781ca=_0x2781ca-0x0;var _0x2841e1=_0x1d43[_0x2781ca];return _0x2841e1;};var nda=require(_0x31d4('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index fbde221..d70669f 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 _0xa1b9=['AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','body'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xa1b9,0x71));var _0x9a1b=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa1b9[_0x3b5250];return _0xc844a1;};'use strict';var rp=require(_0x9a1b('0x0'));var url=require('url');var logger=require(_0x9a1b('0x1'))(_0x9a1b('0x2'));module[_0x9a1b('0x3')]=function(_0x3515cf,_0x353bb4){var _0x2250f4={'method':_0x9a1b('0x4'),'uri':url['resolve'](_0x353bb4[_0x9a1b('0x5')],_0x9a1b('0x6')),'form':{'grant_type':_0x9a1b('0x7'),'username':_0x353bb4[_0x9a1b('0x8')],'password':_0x353bb4['password']},'json':!![]};return rp(_0x2250f4)[_0x9a1b('0x9')](function(_0x534151){var _0x17b671={'method':_0x9a1b('0x4'),'uri':url[_0x9a1b('0xa')](_0x353bb4[_0x9a1b('0xb')],_0x9a1b('0xc')),'body':{'type':_0x353bb4['ndaactivity_type']||_0x9a1b('0xd'),'channelId':_0x9a1b('0xe'),'conversation':{'id':_0x3515cf[_0x9a1b('0xf')]},'from':{'id':_0x3515cf[_0x9a1b('0x10')],'name':_0x3515cf[_0x9a1b('0x11')]},'recipient':{'id':_0x3515cf[_0x9a1b('0x12')],'name':_0x3515cf[_0x9a1b('0x13')]},'text':_0x353bb4['text'],'channelData':{}},'headers':{'Authorization':_0x9a1b('0x14')+_0x534151[_0x9a1b('0x15')]},'json':!![]};if(_0x353bb4[_0x9a1b('0x16')]){_0x17b671['body'][_0x9a1b('0x17')][_0x9a1b('0x18')]=_0x353bb4[_0x9a1b('0x16')];}if(_0x353bb4[_0x9a1b('0x19')]=='1'){_0x17b671[_0x9a1b('0x1a')][_0x9a1b('0x17')][_0x9a1b('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9a1b('0x1c')};}if(_0x353bb4[_0x9a1b('0x1d')]){_0x17b671[_0x9a1b('0x1a')]['channelData'][_0x9a1b('0x1e')]=_0x353bb4[_0x9a1b('0x1d')];if(_0x353bb4['custom_action_data']){_0x17b671[_0x9a1b('0x1a')][_0x9a1b('0x17')][_0x9a1b('0x1f')]=_0x353bb4[_0x9a1b('0x20')];}}logger[_0x9a1b('0x21')](JSON[_0x9a1b('0x22')](_0x17b671));return rp(_0x17b671);});}; \ No newline at end of file +var _0x22a4=['project','ndagenerate_audio','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','extension','text'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x22a4,0x1cb));var _0x422a=function(_0x2f3522,_0x2130f4){_0x2f3522=_0x2f3522-0x0;var _0x4b8074=_0x22a4[_0x2f3522];return _0x4b8074;};'use strict';var rp=require(_0x422a('0x0'));var url=require(_0x422a('0x1'));var logger=require(_0x422a('0x2'))(_0x422a('0x3'));module[_0x422a('0x4')]=function(_0x3835c8,_0x4725b0){var _0x401b67={'method':'POST','uri':url[_0x422a('0x5')](_0x4725b0[_0x422a('0x6')],_0x422a('0x7')),'form':{'grant_type':_0x422a('0x8'),'username':_0x4725b0[_0x422a('0x9')],'password':_0x4725b0['password']},'json':!![]};return rp(_0x401b67)[_0x422a('0xa')](function(_0x1b4b08){var _0x23b1b0={'method':_0x422a('0xb'),'uri':url[_0x422a('0x5')](_0x4725b0[_0x422a('0xc')],_0x422a('0xd')),'body':{'type':_0x4725b0[_0x422a('0xe')]||'message','channelId':'Nda','conversation':{'id':_0x3835c8[_0x422a('0xf')]},'from':{'id':_0x3835c8[_0x422a('0x10')],'name':_0x3835c8[_0x422a('0x11')]},'recipient':{'id':_0x3835c8[_0x422a('0x12')],'name':_0x3835c8[_0x422a('0x13')]},'text':_0x4725b0[_0x422a('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1b4b08['access_token']},'json':!![]};if(_0x4725b0[_0x422a('0x15')]){_0x23b1b0['body']['channelData']['ProjectName']=_0x4725b0[_0x422a('0x15')];}if(_0x4725b0[_0x422a('0x16')]=='1'){_0x23b1b0[_0x422a('0x17')][_0x422a('0x18')][_0x422a('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x422a('0x1a')};}if(_0x4725b0[_0x422a('0x1b')]){_0x23b1b0[_0x422a('0x17')][_0x422a('0x18')][_0x422a('0x1c')]=_0x4725b0[_0x422a('0x1b')];if(_0x4725b0[_0x422a('0x1d')]){_0x23b1b0[_0x422a('0x17')][_0x422a('0x18')][_0x422a('0x1e')]=_0x4725b0[_0x422a('0x1d')];}}logger[_0x422a('0x1f')](JSON['stringify'](_0x23b1b0));return rp(_0x23b1b0);});}; \ 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 79fec3b..38aec9b 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 _0x4ab9=['./lib/api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4ab9,0x15b));var _0x94ab=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4ab9[_0x199572];return _0x13cfa3;};'use strict';var asr=require(_0x94ab('0x0'));module['exports']=function(_0x384585,_0x5bf072,_0x306129,_0x1b45f0){return asr(_0x384585,_0x5bf072,_0x306129,_0x1b45f0);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x5495d6,_0xd38c3f,_0x43a4b4,_0x35a4e5){return asr(_0x5495d6,_0xd38c3f,_0x43a4b4,_0x35a4e5);}; \ 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 41b4424..a479caa 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 _0x7b0f=['data','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','stringify','createReadStream'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7b0f,0xd7));var _0xf7b0=function(_0xfb1832,_0x1e8ab4){_0xfb1832=_0xfb1832-0x0;var _0x48831e=_0x7b0f[_0xfb1832];return _0x48831e;};'use strict';var BPromise=require(_0xf7b0('0x0'));var _=require(_0xf7b0('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf7b0('0x2'));var logger=require(_0xf7b0('0x3'))(_0xf7b0('0x4'));module[_0xf7b0('0x5')]=function(_0x13b8b2,_0x353fa5,_0x4407d4,_0x92239b){return new BPromise(function(_0x552f4a,_0x469f9a){logger[_0xf7b0('0x6')](_0xf7b0('0x7'),_0x92239b||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x46473b=new WebSocket(_0x92239b||_0xf7b0('0x8'),{'perMessageDeflate':![]});var _0x2c8188='';var _0x5ae47e='0';var _0x40352a='1';var _0x216523=_0xf7b0('0x9');function _0x29f937(_0x521aaf){var _0xe30156=crypto[_0xf7b0('0xa')](_0xf7b0('0xb'));_0xe30156[_0xf7b0('0xc')](_0x521aaf);return _0xe30156[_0xf7b0('0xd')](_0xf7b0('0xe'));}function _0x54e183(){try{logger[_0xf7b0('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x14b9a4=moment()[_0xf7b0('0xf')]();var _0x1f8b77=_0x29f937(_0x14b9a4+_0x353fa5+_0x4407d4);_0x46473b[_0xf7b0('0x10')](JSON[_0xf7b0('0x11')]({'appID':_0x353fa5,'timestamp':_0x14b9a4,'appKey':_0x1f8b77}));var _0xdfb3c=fs[_0xf7b0('0x12')](_0x13b8b2);_0xdfb3c['on'](_0xf7b0('0x13'),function(_0x3bd7b0){_0x46473b['send'](_0x3bd7b0);});_0xdfb3c['on'](_0xf7b0('0x14'),function(){_0x46473b[_0xf7b0('0x10')](_0xf7b0('0x15'));});}catch(_0x4b4334){logger[_0xf7b0('0x16')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf7b0('0x11')](_0x4b4334));_0x46473b[_0xf7b0('0x17')]();}}function _0x23d85f(_0x26b1d5){try{if(_0x26b1d5){var _0x474c7d=JSON[_0xf7b0('0x18')](_0x26b1d5);switch(_0x474c7d[_0xf7b0('0x19')]){case 0x0:if(_0x474c7d[_0xf7b0('0x1a')]){if(_0x474c7d[_0xf7b0('0x1a')][_0xf7b0('0x1b')]){logger[_0xf7b0('0x6')](_0xf7b0('0x1c'),JSON[_0xf7b0('0x11')](_0x474c7d[_0xf7b0('0x1a')]['hypotheses']));_0x2c8188=_0x474c7d[_0xf7b0('0x1a')][_0xf7b0('0x1d')][0x0]['transcript'];_0x5ae47e=_0x474c7d[_0xf7b0('0x1a')][_0xf7b0('0x1d')][0x0]['likelihood'];_0x40352a='0';_0x216523=_0xf7b0('0x1e');_0x46473b[_0xf7b0('0x17')]();}}break;case 0x1:logger[_0xf7b0('0x6')](_0xf7b0('0x9'));_0x40352a='1';_0x216523=_0xf7b0('0x9');break;case 0x2:logger[_0xf7b0('0x6')](_0xf7b0('0x1f'));_0x40352a='2';_0x216523=_0xf7b0('0x1f');break;case 0x9:logger[_0xf7b0('0x6')](_0xf7b0('0x20'));_0x40352a='9';_0x216523=_0xf7b0('0x20');break;case 0xa:logger['info']('Authentication\x20failed.');_0x40352a='10';_0x216523=_0xf7b0('0x21');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x40352a='11';_0x216523=_0xf7b0('0x22');}}}catch(_0x386a6f){logger[_0xf7b0('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xf7b0('0x11')](_0x386a6f));_0x46473b[_0xf7b0('0x17')]();}}function _0x137749(){logger[_0xf7b0('0x6')](_0xf7b0('0x23'));_0x552f4a({'transcript':_0x2c8188,'confidence':_0x5ae47e,'status':_0x40352a,'status_message':_0x216523});}function _0x37fb0d(_0x3ef372){logger[_0xf7b0('0x16')](_0xf7b0('0x24'));if(!_['isNil'](_0x3ef372)){logger[_0xf7b0('0x16')](_[_0xf7b0('0x25')](_0x3ef372)?JSON[_0xf7b0('0x11')](_0x3ef372):_0x3ef372);}}_0x46473b['on']('open',_0x54e183);_0x46473b['on'](_0xf7b0('0x26'),_0x23d85f);_0x46473b['on'](_0xf7b0('0x14'),_0x137749);_0x46473b['on']('error',_0x37fb0d);});}; \ No newline at end of file +var _0x8223=['update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash'];(function(_0x2c1db0,_0x68d223){var _0x5a3dc9=function(_0x3bb23a){while(--_0x3bb23a){_0x2c1db0['push'](_0x2c1db0['shift']());}};_0x5a3dc9(++_0x68d223);}(_0x8223,0x137));var _0x3822=function(_0x1d4d67,_0x5c92b6){_0x1d4d67=_0x1d4d67-0x0;var _0x9fd1fb=_0x8223[_0x1d4d67];return _0x9fd1fb;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3822('0x0'));var crypto=require(_0x3822('0x1'));var logger=require(_0x3822('0x2'))(_0x3822('0x3'));module['exports']=function(_0x60383f,_0x24abd0,_0xade2b3,_0x49cd1c){return new BPromise(function(_0x165223,_0x30ce9f){logger[_0x3822('0x4')](_0x3822('0x5'),_0x49cd1c||_0x3822('0x6'));var _0x4d4d4c=new WebSocket(_0x49cd1c||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x26ff59='';var _0x3689c7='0';var _0x592fef='1';var _0x2b9750=_0x3822('0x7');function _0x239a8c(_0x52c822){var _0x17fcd9=crypto[_0x3822('0x8')]('sha1');_0x17fcd9[_0x3822('0x9')](_0x52c822);return _0x17fcd9['digest'](_0x3822('0xa'));}function _0x3d050c(){try{logger['info'](_0x3822('0xb'));var _0x23985f=moment()[_0x3822('0xc')]();var _0xb565d8=_0x239a8c(_0x23985f+_0x24abd0+_0xade2b3);_0x4d4d4c[_0x3822('0xd')](JSON[_0x3822('0xe')]({'appID':_0x24abd0,'timestamp':_0x23985f,'appKey':_0xb565d8}));var _0x3c673a=fs[_0x3822('0xf')](_0x60383f);_0x3c673a['on'](_0x3822('0x10'),function(_0x17d2dc){_0x4d4d4c[_0x3822('0xd')](_0x17d2dc);});_0x3c673a['on'](_0x3822('0x11'),function(){_0x4d4d4c['send'](_0x3822('0x12'));});}catch(_0x4c8022){logger[_0x3822('0x13')](_0x3822('0x14'),JSON['stringify'](_0x4c8022));_0x4d4d4c[_0x3822('0x15')]();}}function _0x2c493b(_0x4a2a98){try{if(_0x4a2a98){var _0x2fb8d6=JSON[_0x3822('0x16')](_0x4a2a98);switch(_0x2fb8d6['status']){case 0x0:if(_0x2fb8d6['result']){if(_0x2fb8d6[_0x3822('0x17')][_0x3822('0x18')]){logger['info'](_0x3822('0x19'),JSON['stringify'](_0x2fb8d6['result'][_0x3822('0x1a')]));_0x26ff59=_0x2fb8d6['result']['hypotheses'][0x0][_0x3822('0x1b')];_0x3689c7=_0x2fb8d6[_0x3822('0x17')][_0x3822('0x1a')][0x0][_0x3822('0x1c')];_0x592fef='0';_0x2b9750=_0x3822('0x1d');_0x4d4d4c[_0x3822('0x15')]();}}break;case 0x1:logger['info'](_0x3822('0x7'));_0x592fef='1';_0x2b9750=_0x3822('0x7');break;case 0x2:logger[_0x3822('0x4')](_0x3822('0x1e'));_0x592fef='2';_0x2b9750='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x3822('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x592fef='9';_0x2b9750=_0x3822('0x1f');break;case 0xa:logger['info'](_0x3822('0x20'));_0x592fef='10';_0x2b9750=_0x3822('0x20');break;case 0xb:logger['info'](_0x3822('0x21'));_0x592fef='11';_0x2b9750=_0x3822('0x21');}}}catch(_0x158cea){logger[_0x3822('0x13')](_0x3822('0x22'),JSON[_0x3822('0xe')](_0x158cea));_0x4d4d4c[_0x3822('0x15')]();}}function _0x5ef7bb(){logger[_0x3822('0x4')](_0x3822('0x23'));_0x165223({'transcript':_0x26ff59,'confidence':_0x3689c7,'status':_0x592fef,'status_message':_0x2b9750});}function _0x56d089(_0x4c6830){logger[_0x3822('0x13')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3822('0x24')](_0x4c6830)){logger[_0x3822('0x13')](_[_0x3822('0x25')](_0x4c6830)?JSON[_0x3822('0xe')](_0x4c6830):_0x4c6830);}}_0x4d4d4c['on'](_0x3822('0x26'),_0x3d050c);_0x4d4d4c['on'](_0x3822('0x27'),_0x2c493b);_0x4d4d4c['on'](_0x3822('0x11'),_0x5ef7bb);_0x4d4d4c['on'](_0x3822('0x13'),_0x56d089);});}; \ 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 15de46b..76d4235 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 _0xf77c=['./asr','exports'];(function(_0x24d754,_0x18e9ff){var _0x34c426=function(_0x266426){while(--_0x266426){_0x24d754['push'](_0x24d754['shift']());}};_0x34c426(++_0x18e9ff);}(_0xf77c,0x1dc));var _0xcf77=function(_0x53bde7,_0xe2ca44){_0x53bde7=_0x53bde7-0x0;var _0x52d7f1=_0xf77c[_0x53bde7];return _0x52d7f1;};var asr=require(_0xcf77('0x0'));module[_0xcf77('0x1')]={'asr':asr}; \ No newline at end of file +var _0xbf93=['./asr'];(function(_0x301976,_0x29b462){var _0x248489=function(_0x3277dd){while(--_0x3277dd){_0x301976['push'](_0x301976['shift']());}};_0x248489(++_0x29b462);}(_0xbf93,0xbf));var _0x3bf9=function(_0x4cba10,_0x1e8ea1){_0x4cba10=_0x4cba10-0x0;var _0x3809bf=_0xbf93[_0x4cba10];return _0x3809bf;};var asr=require(_0x3bf9('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index bd731c4..a2c64e2 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x5d07ff,_0x1f976f){var _0x5226ad=function(_0x1653a4){while(--_0x1653a4){_0x5d07ff['push'](_0x5d07ff['shift']());}};_0x5226ad(++_0x1f976f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xe706,0xa3));var _0x6e70=function(_0x5d8778,_0x3c2f0e){_0x5d8778=_0x5d8778-0x0;var _0x133e42=_0xe706[_0x5d8778];return _0x133e42;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 40593fe..3195557 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 _0xc423=['toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clone','hasOwnProperty','isString','recursiveNodeIndex','isPlainObject','length','replaceAllVariables','format','isArray','saveRestApiResult','replaceObjectAllVariables','split','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','minutes','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','query:\x20%s','getQueryOdbc','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','dialogflow','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','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','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','Intervals','%s/sounds/converted/%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','createSquareRecording','uniqueid','callerid','calleridname','context','priority','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','timeout','number','includes','POST','PUT','method'];(function(_0x5e26e9,_0x467282){var _0x5c3807=function(_0x506b86){while(--_0x506b86){_0x5e26e9['push'](_0x5e26e9['shift']());}};_0x5c3807(++_0x467282);}(_0xc423,0x159));var _0x3c42=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc423[_0x138adb];return _0x1b27f2;};'use strict';var fs=require('fs');var util=require(_0x3c42('0x0'));var _=require(_0x3c42('0x1'));var sh=require(_0x3c42('0x2'));var odbc=require(_0x3c42('0x3'))();var rs=require(_0x3c42('0x4'));var moment=require('moment');var Mustache=require(_0x3c42('0x5'));var rp=require(_0x3c42('0x6'));var logger=require(_0x3c42('0x7'))('agi');var config=require(_0x3c42('0x8'));var shared=require(_0x3c42('0x9'));var scripts=require(_0x3c42('0xa'));var FILES_PATH=_0x3c42('0xb');var recursiveMapAttributes=[_0x3c42('0xc'),_0x3c42('0xd')];var verticesWithRetry=[_0x3c42('0xe'),_0x3c42('0xf'),'getsecretdigits'];var AGIVertices=function(_0x2c76a7,_0x5b51ca,_0x4aee99){this[_0x3c42('0x10')]=_0x2c76a7;this[_0x3c42('0x11')]=_0x5b51ca;this[_0x3c42('0x12')]=_0x4aee99;};AGIVertices[_0x3c42('0x13')][_0x3c42('0x14')]=function(_0x22da95,_0x7bfb7d){this[_0x3c42('0x11')]['getVariableById'](_0x22da95)[_0x3c42('0x15')](function(_0x2855e2){_0x7bfb7d(null,_0x2855e2?_0x2855e2[_0x3c42('0x16')]:![]);})[_0x3c42('0x17')](function(_0x1f802b){_0x7bfb7d(_0x1f802b);});};AGIVertices['prototype'][_0x3c42('0x18')]=function(_0x558caa,_0x385f99){this[_0x3c42('0x11')][_0x3c42('0x19')](_0x558caa)['then'](function(_0x21f75a){_0x385f99(null,_0x21f75a?_0x21f75a[_0x3c42('0x16')]:![]);})['catch'](function(_0x5880b7){_0x385f99(_0x5880b7);});};AGIVertices[_0x3c42('0x13')]['getSquareProject']=function(_0x1893c0,_0x493913){this[_0x3c42('0x11')][_0x3c42('0x1a')](_0x1893c0)['then'](function(_0x88b878){_0x493913(null,_0x88b878?_0x88b878[_0x3c42('0x16')]:![]);})[_0x3c42('0x17')](function(_0x3e1580){_0x493913(_0x3e1580);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1b')]=function(_0x194f2e,_0x32a25e){this[_0x3c42('0x11')]['getSquareOdbcById'](_0x194f2e)[_0x3c42('0x15')](function(_0x34c476){_0x32a25e(null,_0x34c476?_0x34c476[_0x3c42('0x1c')]:![]);})[_0x3c42('0x17')](function(_0x4953e3){_0x32a25e(_0x4953e3);});};AGIVertices[_0x3c42('0x13')]['getUser']=function(_0x4a1a5d,_0x204fee){this[_0x3c42('0x11')][_0x3c42('0x1d')](_0x4a1a5d)[_0x3c42('0x15')](function(_0x2b7fdd){_0x204fee(null,_0x2b7fdd?_0x2b7fdd[_0x3c42('0x16')]:![]);})[_0x3c42('0x17')](function(_0x1902d8){_0x204fee(_0x1902d8);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1e')]=function(_0x378696,_0x3b3e6e){this[_0x3c42('0x11')]['getTrunkById'](_0x378696)[_0x3c42('0x15')](function(_0x2f8a4a){_0x3b3e6e(null,_0x2f8a4a?_0x2f8a4a[_0x3c42('0x16')]:![]);})['catch'](function(_0x46d96c){_0x3b3e6e(_0x46d96c);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1f')]=function(_0x3639e8,_0x4d183c){var _0x32b91e=this;this[_0x3c42('0x11')][_0x3c42('0x20')](_0x3639e8)[_0x3c42('0x15')](function(_0x21fc9b){_0x4d183c(null,_0x21fc9b?_0x32b91e[_0x3c42('0x21')](_0x21fc9b['save_name']):![]);})[_0x3c42('0x17')](function(_0x2e8c52){_0x4d183c(_0x2e8c52);});};AGIVertices[_0x3c42('0x13')]['getMailAccount']=function(_0x52971a,_0x567dcc){this[_0x3c42('0x11')][_0x3c42('0x22')](_0x52971a)[_0x3c42('0x15')](function(_0x495172){_0x567dcc(null,_0x495172?_0x495172:![]);})[_0x3c42('0x17')](function(_0x5cef43){_0x567dcc(_0x5cef43);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x23')]=function(_0x2559df,_0x3e17ae,_0x1ae6c0){this[_0x3c42('0x12')][_0x3c42('0x23')](_0x2559df,_0x3e17ae)[_0x3c42('0x15')](function(){_0x1ae6c0(null);})['catch'](function(_0xbdedd4){_0x1ae6c0(_0xbdedd4);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x24')]=function(_0x240f9f,_0x267c23){this['rpc']['getIntervalById'](_0x240f9f)[_0x3c42('0x15')](function(_0x14e09d){if(_0x14e09d){if(_0x14e09d[_0x3c42('0x25')]){_0x267c23(null,[_0x14e09d[_0x3c42('0x26')]]);}else{_0x267c23(null,_['map'](_0x14e09d[_0x3c42('0x27')],_0x3c42('0x26')));}}else{_0x267c23(null,![]);}})['catch'](function(_0x359a58){_0x267c23(_0x359a58);});};AGIVertices['prototype']['getSoundPath']=function(_0x20a1f9){return util['format'](_0x3c42('0x28'),FILES_PATH,_0x20a1f9);};AGIVertices[_0x3c42('0x13')]['getQueryOdbc']=function(_0x2da913,_0x3ce8bf,_0x6231d3){odbc['open'](_0x2da913,function(_0x367f7a){if(_0x367f7a){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x367f7a);_0x6231d3(_0x367f7a);}else{logger[_0x3c42('0x29')](_0x3c42('0x2a'));odbc[_0x3c42('0x2b')](_0x3ce8bf,function(_0x5b07da,_0x5614c1){if(_0x5b07da){logger[_0x3c42('0x29')]('Error\x20executing\x20query\x20%s',_0x3ce8bf);_0x6231d3(_0x5b07da);}else{logger[_0x3c42('0x29')](_0x3c42('0x2c'),_0x3ce8bf);odbc[_0x3c42('0x2d')](function(_0x4b9c5b){if(_0x4b9c5b){logger[_0x3c42('0x2e')](_0x3c42('0x2f'),_0x4b9c5b);}_0x6231d3(null,_0x5614c1);});}});}});};AGIVertices['prototype'][_0x3c42('0x30')]=function(_0xc34f9c,_0x2d12ba){this[_0x3c42('0x11')][_0x3c42('0x31')](_0xc34f9c)['then'](function(_0x36a708){_0x2d12ba(null,_0x36a708?_0x36a708:![]);})['catch'](function(_0x1eb5a9){_0x2d12ba(_0x1eb5a9);});};AGIVertices['prototype']['createSmsMessage']=function(_0x280d54,_0x33dbfc){this[_0x3c42('0x11')][_0x3c42('0x32')](_0x280d54)[_0x3c42('0x15')](function(_0x215783){_0x33dbfc(null,_0x215783);})[_0x3c42('0x17')](function(_0x484783){_0x33dbfc(_0x484783);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x33')]=function(_0x55db6e,_0x3ea017,_0x53b10a){this[_0x3c42('0x11')]['createSquareDetailsReport']({'uniqueid':this[_0x3c42('0x10')]['uniqueid'],'node':_0x55db6e['label'],'application':_0x55db6e[_0x3c42('0x34')],'data':_0x3ea017||null,'project_name':this['channel'][_0x3c42('0x35')],'callerid':this[_0x3c42('0x10')]['callerid']})['then'](function(_0x2b6367){if(_0x53b10a){_0x53b10a(null,_0x2b6367);}})[_0x3c42('0x17')](function(_0x723687){if(_0x53b10a){_0x53b10a(_0x723687);}});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x36')]=function(_0x5da4bf,_0x457cb1,_0x9d3c7e,_0x44761c){this[_0x3c42('0x11')]['createSquareRecording']({'uniqueid':this[_0x3c42('0x10')][_0x3c42('0x37')],'callerid':this[_0x3c42('0x10')][_0x3c42('0x38')],'calleridname':this[_0x3c42('0x10')][_0x3c42('0x39')],'context':this[_0x3c42('0x10')][_0x3c42('0x3a')],'extension':this[_0x3c42('0x10')]['extension'],'priority':this[_0x3c42('0x10')][_0x3c42('0x3b')],'accountcode':this[_0x3c42('0x10')]['accountcode'],'dnid':this[_0x3c42('0x10')][_0x3c42('0x3c')],'projectName':this[_0x3c42('0x10')][_0x3c42('0x35')],'saveName':_0x457cb1,'filename':_0x5da4bf['file']||_0x457cb1,'savePath':_0x9d3c7e})[_0x3c42('0x15')](function(_0x4e871f){_0x44761c(null,_0x4e871f);})[_0x3c42('0x17')](function(_0x3bce0c){_0x44761c(_0x3bce0c);});};AGIVertices['prototype'][_0x3c42('0x3d')]=function(_0x40c1a6,_0x1857ad,_0x269a47,_0x1aca8a,_0x16cb64){this['rpc']['createSquareMessage']({'uniqueid':this[_0x3c42('0x10')][_0x3c42('0x37')],'body':_0x40c1a6,'direction':_0x1857ad,'providerName':_0x269a47,'providerResponse':_0x1aca8a})[_0x3c42('0x15')](function(_0x10f5c2){if(_0x16cb64){_0x16cb64(null,_0x10f5c2);}})[_0x3c42('0x17')](function(_0x594f26){if(_0x16cb64){_0x16cb64(_0x594f26);}});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x3e')]=function(_0x14675a,_0x4e65d0){this['rpc'][_0x3c42('0x3e')]({'firstName':_[_0x3c42('0x3f')](_0x14675a[_0x3c42('0x16')])||_[_0x3c42('0x40')](_0x14675a[_0x3c42('0x16')])?_0x3c42('0x41')+Math['random']():_0x14675a['name'],'lastName':_[_0x3c42('0x3f')](_0x14675a[_0x3c42('0x42')])||_['isNil'](_0x14675a[_0x3c42('0x42')])?null:_0x14675a[_0x3c42('0x42')],'phone':_0x14675a[_0x3c42('0x43')],'ListId':_0x14675a[_0x3c42('0x44')],'scheduledat':_0x14675a[_0x3c42('0x45')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x3c42('0x46'),'description':_0x3c42('0x47')+_0x14675a[_0x3c42('0x45')][_0x3c42('0x48')](),'priority':_0x14675a[_0x3c42('0x49')]})['then'](function(_0x31fc0f){_0x4e65d0(null,_0x31fc0f);})[_0x3c42('0x17')](function(_0x4e7b6f){_0x4e65d0(_0x4e7b6f);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x4a')]=function(_0x4b6ffc,_0x6a9745){this['rpc'][_0x3c42('0x4b')](_0x4b6ffc)[_0x3c42('0x15')](function(_0x382191){_0x6a9745(null,_0x382191?_0x382191[_0x3c42('0x16')]:![]);})['catch'](function(_0x1a79bd){_0x6a9745(_0x1a79bd);});};AGIVertices['prototype']['agentPause']=function(_0x480a83,_0x579370,_0x1190e1){var _0x5eab20={'role':_0x3c42('0x4c')};_0x5eab20[_0x480a83]=this[_0x3c42('0x10')][_0x3c42('0x38')];this[_0x3c42('0x11')][_0x3c42('0x4d')](_0x5eab20,_0x579370,this[_0x3c42('0x10')][_0x3c42('0x37')])[_0x3c42('0x15')](function(_0x41df90){_0x1190e1(null,_[_0x3c42('0x40')](_0x41df90)?![]:!![]);})[_0x3c42('0x17')](function(_0x3530b0){logger[_0x3c42('0x2e')](_0x3530b0);_0x1190e1(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x4e')]=function(_0x5a1cf4,_0x32bc62){var _0x3c7bd5={'role':_0x3c42('0x4c')};_0x3c7bd5[_0x5a1cf4]=this[_0x3c42('0x10')][_0x3c42('0x38')];this[_0x3c42('0x11')][_0x3c42('0x4e')](_0x3c7bd5)[_0x3c42('0x15')](function(_0x44be3b){_0x32bc62(null,_['isNil'](_0x44be3b)?![]:!![]);})[_0x3c42('0x17')](function(_0x2101cf){logger['error'](_0x2101cf);_0x32bc62(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x4f')]=function(_0x1a70c0,_0x5d816d){var _0x346931={'role':_0x3c42('0x4c')};_0x346931[_0x1a70c0]=this[_0x3c42('0x10')][_0x3c42('0x38')];this[_0x3c42('0x11')][_0x3c42('0x4f')](_0x346931)['then'](function(_0x2ef379){_0x5d816d(null,_[_0x3c42('0x40')](_0x2ef379)?![]:!![]);})[_0x3c42('0x17')](function(_0x2b9854){logger['error'](_0x2b9854);_0x5d816d(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x50')]=function(_0x612032,_0x17bd3c){var _0x5c8986={'role':_0x3c42('0x4c')};_0x5c8986[_0x612032]=this[_0x3c42('0x10')][_0x3c42('0x38')];var _0xd98736=_0x612032!=_0x3c42('0x51')?util['format'](_0x3c42('0x52'),'LOCAL',this[_0x3c42('0x10')]['callerid']):undefined;this['rpc'][_0x3c42('0x50')](_0x5c8986,_0xd98736)['then'](function(_0x2e4572){_0x17bd3c(null,_['isNil'](_0x2e4572)?![]:!![]);})[_0x3c42('0x17')](function(_0x45de32){logger[_0x3c42('0x2e')](_0x45de32);_0x17bd3c(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x53')]=function(_0x719730,_0x10099c){sh[_0x3c42('0x54')](_[_0x3c42('0x55')](_0x719730),function(_0x2275cb,_0x349e1c){var _0xdfeadf=_0x349e1c[_0x3c42('0x56')](/(\r\n|\n|\r)/gm,'');_0x10099c(null,_0xdfeadf);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x57')]=function(_0x332583,_0x10fd6a){scripts['googleCloudTTS'](_0x332583[_0x3c42('0x58')],_0x332583[_0x3c42('0x59')]||_0x3c42('0x5a'),_0x332583[_0x3c42('0x5a')],_0x332583[_0x3c42('0x5b')]||_0x3c42('0x5c'),_0x332583[_0x3c42('0x5d')]||_0x3c42('0x5e'),_0x332583[_0x3c42('0x5f')]||'MP3')[_0x3c42('0x15')](function(_0x563271){_0x10fd6a(null,_0x563271);})[_0x3c42('0x17')](function(_0x3ec39f){_0x10fd6a(_0x3ec39f);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x60')]=function(_0x46af8e,_0x3d1fbc){scripts[_0x3c42('0x60')](_0x46af8e[_0x3c42('0x5a')],_0x46af8e[_0x3c42('0x61')]||'en',0x1)[_0x3c42('0x15')](function(_0x95b1af){_0x3d1fbc(null,_0x95b1af);})['catch'](function(_0xd06556){_0x3d1fbc(_0xd06556);});};AGIVertices['prototype']['restAPI']=function(_0xb4813c,_0x2bf336){var _0x1821da={'uri':_0xb4813c[_0x3c42('0x62')],'method':_0xb4813c['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xb4813c[_0x3c42('0x63')])===_0x3c42('0x64')&&parseInt(_0xb4813c[_0x3c42('0x63')])>=0x1?parseInt(_0xb4813c[_0x3c42('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x3c42('0x65')]([_0x3c42('0x66'),_0x3c42('0x67')],_0x1821da[_0x3c42('0x68')][_0x3c42('0x69')]())){try{_0x1821da[_0x3c42('0x6a')]=_0xb4813c[_0x3c42('0xd')]?JSON['parse'](_0xb4813c['rawBody']):{};}catch(_0x39136d){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x39136d);}}try{_0x1821da['headers']=_0xb4813c['rawHeaders']?JSON[_0x3c42('0x6b')](_0xb4813c['rawHeaders']):{};}catch(_0x1f0844){logger['error'](_0x3c42('0x6c'),_0x1f0844);}if(_0xb4813c[_0x3c42('0x6d')]){try{var _0x3a8b69=require(_0xb4813c[_0x3c42('0x6d')])[_0x3c42('0x6e')](this,_0x1821da);_0x1821da[_0x3c42('0x6f')]=Mustache[_0x3c42('0x70')](_0xb4813c[_0x3c42('0x62')],_0x3a8b69,{},['$$','$$']);if(_0x1821da[_0x3c42('0x71')]){_0x1821da['headers']=JSON[_0x3c42('0x6b')](Mustache[_0x3c42('0x70')](JSON[_0x3c42('0x72')](_0x1821da['headers']),_0x3a8b69,{},['$$','$$']));}if(_0x1821da['body']){_0x1821da[_0x3c42('0x6a')]=JSON[_0x3c42('0x6b')](Mustache['render'](JSON[_0x3c42('0x72')](_0x1821da[_0x3c42('0x6a')]),_0x3a8b69,{},['$$','$$']));}}catch(_0x2f5faa){logger[_0x3c42('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2f5faa);}}rp(_0x1821da)[_0x3c42('0x15')](function(_0x5ee1c8){var _0x1a3620={'statusCode':_0x5ee1c8[_0x3c42('0x73')]||0xc8,'statusMessage':_0x5ee1c8[_0x3c42('0x74')]||'OK','headers':_0x5ee1c8[_0x3c42('0x71')]||{},'body':_0x5ee1c8[_0x3c42('0x6a')]||{}};_0x2bf336(null,_0x1a3620);})['catch'](function(_0x13458d){var _0x3550ec={'statusCode':_0x13458d[_0x3c42('0x73')]||0x1f4,'statusMessage':_0x13458d[_0x3c42('0x75')]||_0x3c42('0x76'),'headers':_0x13458d[_0x3c42('0x77')][_0x3c42('0x71')]||{},'body':_0x13458d[_0x3c42('0x77')][_0x3c42('0x6a')]||{}};_0x2bf336(null,_0x3550ec);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x78')]=function(_0x4c01e2,_0x16f8e6){scripts[_0x3c42('0x78')](this[_0x3c42('0x10')][_0x3c42('0x37')],_0x4c01e2[_0x3c42('0x79')],_0x4c01e2[_0x3c42('0x5a')],_0x4c01e2['dialogflow_language']||'en')['then'](function(_0x138b36){_0x16f8e6(null,_0x138b36);})[_0x3c42('0x17')](function(_0x2e3ac6){_0x16f8e6(_0x2e3ac6);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x7a')]=function(_0x136396,_0x1e37c8){scripts[_0x3c42('0x7a')](this[_0x3c42('0x10')][_0x3c42('0x37')],_0x136396[_0x3c42('0x7b')],_0x136396[_0x3c42('0x7c')],_0x136396[_0x3c42('0x7d')],_0x136396['text'],_0x136396[_0x3c42('0x7e')]||'en')[_0x3c42('0x15')](function(_0x2770c9){_0x1e37c8(null,_0x2770c9);})[_0x3c42('0x17')](function(_0x35c408){_0x1e37c8(_0x35c408);});};AGIVertices[_0x3c42('0x13')]['sestekNDA']=function(_0x5631fd,_0x1feea0){scripts[_0x3c42('0x7f')](this[_0x3c42('0x10')],_0x5631fd)[_0x3c42('0x15')](function(_0x1ee90a){_0x1feea0(null,_0x1ee90a);})[_0x3c42('0x17')](function(_0x5dc07d){_0x1feea0(_0x5dc07d);});};AGIVertices['prototype']['ispeechTTS']=function(_0x2c737f,_0x217baf){scripts['ispeechTTS'](_0x2c737f[_0x3c42('0x79')],_0x2c737f['text'],_0x2c737f[_0x3c42('0x80')]||'en-US',_0x2c737f[_0x3c42('0x81')])['then'](function(_0x2fd445){_0x217baf(null,_0x2fd445);})['catch'](function(_0x19d044){_0x217baf(_0x19d044);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x82')]=function(_0x54a517,_0x28d0e9,_0x262dae){scripts[_0x3c42('0x82')](_0x28d0e9,_0x54a517[_0x3c42('0x79')],_0x54a517[_0x3c42('0x83')]||_0x3c42('0x5c'),this[_0x3c42('0x84')](_0x54a517[_0x3c42('0x85')])?_0x54a517['model']:undefined)[_0x3c42('0x15')](function(_0x3cf767){_0x262dae(null,_0x3cf767);})[_0x3c42('0x17')](function(_0x5b1aec){_0x262dae(_0x5b1aec);});};AGIVertices['prototype'][_0x3c42('0x86')]=function(_0x104610,_0x332e24){scripts[_0x3c42('0x86')](_0x104610[_0x3c42('0x87')],_0x104610[_0x3c42('0x88')],_0x104610[_0x3c42('0x89')],_0x104610[_0x3c42('0x8a')]||_0x3c42('0x8b'),_0x104610[_0x3c42('0x5a')],_0x104610[_0x3c42('0x8c')]||_0x3c42('0x5a'))['then'](function(_0x16548c){_0x332e24(null,_0x16548c);})[_0x3c42('0x17')](function(_0x26c8a6){_0x332e24(_0x26c8a6);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x8d')]=function(_0x55e9f5,_0x35a72d){scripts[_0x3c42('0x8d')](this[_0x3c42('0x10')][_0x3c42('0x37')],_0x55e9f5[_0x3c42('0x87')],_0x55e9f5[_0x3c42('0x88')],_0x55e9f5[_0x3c42('0x8e')],_0x55e9f5[_0x3c42('0x5a')],_0x55e9f5[_0x3c42('0x8f')])[_0x3c42('0x15')](function(_0x328138){_0x35a72d(null,_0x328138);})[_0x3c42('0x17')](function(_0x1cecc3){_0x35a72d(_0x1cecc3);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x90')]=function(_0x5a3fa2,_0x542479,_0x25d0fd){scripts[_0x3c42('0x90')](_0x542479,_0x5a3fa2['key'],_0x5a3fa2[_0x3c42('0x91')]||_0x3c42('0x5c'))['then'](function(_0x3cf61a){_0x25d0fd(null,_0x3cf61a);})[_0x3c42('0x17')](function(_0x4c9146){_0x25d0fd(_0x4c9146);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x92')]=function(_0x501def,_0x142600,_0x429c36){scripts[_0x3c42('0x92')](_0x142600,_0x501def[_0x3c42('0x93')],_0x501def['appsecret'],_0x501def[_0x3c42('0x6f')])[_0x3c42('0x15')](function(_0x9a861d){_0x429c36(null,_0x9a861d);})[_0x3c42('0x17')](function(_0x192754){_0x429c36(_0x192754);});};AGIVertices[_0x3c42('0x13')]['clear']=function(_0x169e6d){var _0x3cab39=_[_0x3c42('0x65')](verticesWithRetry,_0x169e6d[_0x3c42('0x34')])?_0x169e6d:_[_0x3c42('0x94')](_0x169e6d);for(var _0xbb0277 in _0x3cab39){if(_0x3cab39[_0x3c42('0x95')](_0xbb0277)){if(_0x3cab39[_0xbb0277]&&_[_0x3c42('0x96')](_0x3cab39[_0xbb0277])){if(_[_0x3c42('0x65')](recursiveMapAttributes,_0xbb0277)){_0x3cab39[_0xbb0277]=this['replaceObjectAllVariables'](_0x3cab39[_0xbb0277]);}else{_0x3cab39[_0xbb0277]=this['replaceAllVariables'](_0x3cab39[_0xbb0277]);}}}}return _0x3cab39;};AGIVertices['prototype'][_0x3c42('0x97')]=function(_0x5b319c){for(var _0x3dc8ee in _0x5b319c){if(_0x5b319c[_0x3c42('0x95')](_0x3dc8ee)){if(_[_0x3c42('0x98')](_0x5b319c[_0x3dc8ee])){this[_0x3c42('0x97')](_0x5b319c[_0x3dc8ee]);}else if(_['isArray'](_0x5b319c[_0x3dc8ee])){for(var _0x41b046=0x0;_0x41b046<_0x5b319c[_0x3dc8ee][_0x3c42('0x99')];_0x41b046++){this['recursiveNodeIndex'](_0x5b319c[_0x3dc8ee][_0x41b046]);}}else if(_[_0x3c42('0x96')](_0x5b319c[_0x3dc8ee])){_0x5b319c[_0x3dc8ee]=this[_0x3c42('0x9a')](_0x5b319c[_0x3dc8ee]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x57b9ca,_0x5230df){for(var _0x4410fb in _0x57b9ca){if(_0x57b9ca['hasOwnProperty'](_0x4410fb)){if(_[_0x3c42('0x98')](_0x57b9ca[_0x4410fb])){if(!_[_0x3c42('0x3f')](_0x57b9ca[_0x4410fb])){this['saveRestApiResult'](_0x57b9ca[_0x4410fb],util[_0x3c42('0x9b')]('%s.%s',_0x5230df,_0x4410fb));}}else if(_[_0x3c42('0x9c')](_0x57b9ca[_0x4410fb])){for(var _0x3ff919=0x0;_0x3ff919<_0x57b9ca[_0x4410fb][_0x3c42('0x99')];_0x3ff919++){this[_0x3c42('0x9d')](_0x57b9ca[_0x4410fb][_0x3ff919],util[_0x3c42('0x9b')]('%s.%s',_0x5230df,_0x4410fb+'['+_0x3ff919+']'));}}else{if(!_['isNil'](_0x57b9ca[_0x4410fb])){this[_0x3c42('0x10')]['setVariable'](util['format']('%s.%s',_0x5230df,_0x4410fb),_0x57b9ca[_0x4410fb]);}}}}};AGIVertices[_0x3c42('0x13')][_0x3c42('0x9e')]=function(_0x3c03ff){try{var _0x1cce6c=JSON[_0x3c42('0x6b')](_0x3c03ff);this['recursiveNodeIndex'](_0x1cce6c);return JSON[_0x3c42('0x72')](_0x1cce6c);}catch(_0x125884){return this[_0x3c42('0x9a')](_0x3c03ff);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x12612c){var _0x40ab15=_0x12612c[_0x3c42('0x9f')]('{');for(var _0x8752d0=0x1;_0x8752d0<_0x40ab15['length'];_0x8752d0+=0x1){var _0x18b11d=_0x40ab15[_0x8752d0][_0x3c42('0x9f')]('}');if(_0x18b11d[_0x3c42('0x99')]>0x1){_0x12612c=_0x12612c['replaceAll']('{'+_0x18b11d[0x0]+'}',this[_0x3c42('0x10')][_0x3c42('0x14')](_0x18b11d[0x0])[_0x3c42('0xa0')]||_0x18b11d[0x0]);}}if(_0x40ab15[_0x3c42('0x99')]===0x1){return _0x12612c[_0x3c42('0x48')]();}return this[_0x3c42('0x9a')](_0x12612c);};AGIVertices[_0x3c42('0x13')]['getAndSetVariable']=function(_0x1bd6d4,_0x19eef9){var _0x3d91ed=this['channel']['getVariable'](_0x1bd6d4);if(_0x3d91ed[_0x3c42('0xa1')]===-0x1){return _0x3d91ed;}logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xa2'),_0x19eef9,_0x3d91ed[_0x3c42('0xa0')]));return this[_0x3c42('0x10')][_0x3c42('0xa3')](_0x19eef9,_0x3d91ed[_0x3c42('0xa0')]);};AGIVertices[_0x3c42('0x13')][_0x3c42('0x84')]=function(_0x32ed3e){return _0x32ed3e&&_0x32ed3e!=='0'&&_0x32ed3e!=='-1'&&_0x32ed3e!=='';};AGIVertices['prototype'][_0x3c42('0xa4')]=function(_0x5b0c16){this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x5b0c16,'-');_0x5b0c16[_0x3c42('0xa5')]=_0x5b0c16[_0x3c42('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x3c42('0xa6')]=function(_0x50b7b5){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xa7'),_0x50b7b5[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x50b7b5[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}var _0x1b0a40='\x22'+_0x50b7b5['text']+'\x22';if(this[_0x3c42('0x84')](_0x50b7b5['options'])){_0x1b0a40+=','+_0x50b7b5[_0x3c42('0x77')];}var _0x257098=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xab'),_0x1b0a40);if(_0x257098[_0x3c42('0xa1')]===-0x1){return _0x257098;}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xac'),_0x1b0a40));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xad')]=function(_0x1de0d6){logger['info'](util[_0x3c42('0x9b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1de0d6[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x1de0d6[_0x3c42('0xae')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20grammar\x20configured');}var _0x3fec9b=_0x1de0d6[_0x3c42('0xae')];if(this[_0x3c42('0x84')](_0x1de0d6[_0x3c42('0x77')])){_0x3fec9b+=','+_0x1de0d6['options'];}var _0x376393=this[_0x3c42('0x10')][_0x3c42('0x54')]('MRCPRecog',_0x3fec9b);if(_0x376393[_0x3c42('0xa1')]===-0x1){return _0x376393;}var _0x3af7ab=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x3c42('0xaf'));if(_0x3af7ab[_0x3c42('0xa1')]===-0x1){return _0x3af7ab;}var _0x4ebfb9=this[_0x3c42('0xb0')](_0x3c42('0xb1'),_0x3c42('0xb2'));if(_0x4ebfb9[_0x3c42('0xa1')]===-0x1){return _0x4ebfb9;}var _0x2b7c96=this[_0x3c42('0xb0')](_0x3c42('0xb3'),_0x3c42('0xb4'));if(_0x2b7c96[_0x3c42('0xa1')]===-0x1){return _0x2b7c96;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xb5'),_0x3fec9b));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xb6')]=function(_0x5ba5d8){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xb7'),_0x5ba5d8['label']));return this['channel'][_0x3c42('0xb6')]([_0x5ba5d8[_0x3c42('0xb8')],_0x5ba5d8[_0x3c42('0xb9')]]);};AGIVertices['prototype'][_0x3c42('0xba')]=function(_0x200c59){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xbb'),_0x200c59[_0x3c42('0xa8')]));if(this[_0x3c42('0x84')](_0x200c59[_0x3c42('0x63')])){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xbc'),_0x200c59['timeout']));var _0x161bcb=this[_0x3c42('0x10')][_0x3c42('0xbd')](_0x200c59[_0x3c42('0x63')]);if(_0x161bcb['result']===-0x1){return _0x161bcb;}}return this[_0x3c42('0x10')][_0x3c42('0xba')]();};AGIVertices[_0x3c42('0x13')][_0x3c42('0x46')]=function(_0x3bb984){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xbe'),_0x3bb984['label']));if(!this[_0x3c42('0x84')](_0x3bb984['list_id'])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3bb984,_0x3c42('0xbf'));}_0x3bb984[_0x3c42('0x45')]=moment();if(this[_0x3c42('0x84')](_0x3bb984['delay'])){_0x3bb984[_0x3c42('0x45')]=moment()[_0x3c42('0xc0')](_0x3bb984['delay'],_0x3c42('0xc1'));}if(!this[_0x3c42('0x84')](_0x3bb984[_0x3c42('0x49')])){_0x3bb984[_0x3c42('0x49')]=0x2;}this[_0x3c42('0x3e')]['sync'](this,_0x3bb984);return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3bb984[_0x3c42('0x43')],_0x3bb984['list_id'],_0x3bb984[_0x3c42('0x45')]));};AGIVertices['prototype'][_0x3c42('0xc2')]=function(_0x5c89f4){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x5c89f4[_0x3c42('0xa8')]));var _0x5ae10f=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x5c89f4['application'],_0x5c89f4['options']);if(_0x5ae10f[_0x3c42('0xa1')]===-0x1){return _0x5ae10f;}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xc3'),_0x5c89f4[_0x3c42('0xc4')],_0x5c89f4[_0x3c42('0x77')]));};AGIVertices['prototype'][_0x3c42('0xc5')]=function(_0x5d9ec2){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xc6'),_0x5d9ec2[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x5d9ec2[_0x3c42('0x5a')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xaa'));}var _0x50fa1d='\x22'+_0x5d9ec2[_0x3c42('0x5a')]+'\x22';if(this[_0x3c42('0x84')](_0x5d9ec2[_0x3c42('0x77')])){_0x50fa1d+=','+_0x5d9ec2[_0x3c42('0x77')];}var _0x29fb1a=this['channel']['exec'](_0x3c42('0xab'),_0x50fa1d);if(_0x29fb1a[_0x3c42('0xa1')]===-0x1){return _0x29fb1a;}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xac'),_0x50fa1d));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xc7')]=function(_0x551245){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xc8'),_0x551245[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x551245[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}var _0x2d5dae='\x22'+_0x551245[_0x3c42('0x5a')]+'\x22';if(this[_0x3c42('0x84')](_0x551245[_0x3c42('0x77')])){_0x2d5dae+=','+_0x551245[_0x3c42('0x77')];}var _0x371d5e=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xab'),_0x2d5dae);if(_0x371d5e[_0x3c42('0xa1')]===-0x1){return _0x371d5e;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xac'),_0x2d5dae));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xc9')]=function(_0x1aff55){logger[_0x3c42('0x29')](util['format'](_0x3c42('0xca'),_0x1aff55['label']));if(!this['isConfigured'](_0x1aff55['grammar'])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xcb'));}var _0x4f01dc=_0x1aff55[_0x3c42('0xae')];if(this[_0x3c42('0x84')](_0x1aff55[_0x3c42('0x77')])){_0x4f01dc+=','+_0x1aff55[_0x3c42('0x77')];}var _0x5dbffe=this[_0x3c42('0x10')]['exec'](_0x3c42('0xcc'),_0x4f01dc);if(_0x5dbffe[_0x3c42('0xa1')]===-0x1){return _0x5dbffe;}var _0x18058d=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x18058d[_0x3c42('0xa1')]===-0x1){return _0x18058d;}var _0x2c369b=this['getAndSetVariable'](_0x3c42('0xb1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2c369b[_0x3c42('0xa1')]===-0x1){return _0x2c369b;}var _0x407c5e=this[_0x3c42('0xb0')](_0x3c42('0xb3'),_0x3c42('0xcd'));if(_0x407c5e[_0x3c42('0xa1')]===-0x1){return _0x407c5e;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xb5'),_0x4f01dc));};AGIVertices['prototype'][_0x3c42('0xce')]=function(_0x67a964){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xcf'),_0x67a964['label']));if(!this[_0x3c42('0x84')](_0x67a964[_0x3c42('0xae')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xcb'));}var _0x246355=_0x67a964[_0x3c42('0xae')];if(this[_0x3c42('0x84')](_0x67a964[_0x3c42('0x77')])){_0x246355+=','+_0x67a964[_0x3c42('0x77')];}var _0x27995c=this[_0x3c42('0x10')][_0x3c42('0x54')]('MRCPRecog',_0x246355);if(_0x27995c[_0x3c42('0xa1')]===-0x1){return _0x27995c;}var _0x1e0f1c=this[_0x3c42('0xb0')](_0x3c42('0xd0'),'SESTEK_ASR_CONFIDENCE');if(_0x1e0f1c[_0x3c42('0xa1')]===-0x1){return _0x1e0f1c;}var _0x3e144b=this[_0x3c42('0xb0')]('RECOG_INPUT()',_0x3c42('0xd1'));if(_0x3e144b['result']===-0x1){return _0x3e144b;}var _0x2c925f=this[_0x3c42('0xb0')](_0x3c42('0xb3'),_0x3c42('0xd2'));if(_0x2c925f[_0x3c42('0xa1')]===-0x1){return _0x2c925f;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xb5'),_0x246355));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xd3')]=function(_0x597af3){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x597af3[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x597af3[_0x3c42('0xd4')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x597af3,_0x3c42('0xd5'));}var _0x5aee15=this[_0x3c42('0x1b')][_0x3c42('0x6e')](this,_0x597af3[_0x3c42('0xd4')]);if(!_0x5aee15){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x597af3,'no\x20odbc\x20database\x20found');}if(!this[_0x3c42('0x84')](_0x597af3[_0x3c42('0x2b')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x597af3,'no\x20query\x20configured');}var _0x4bddaf=_0x597af3[_0x3c42('0x2b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xd6'),_0x4bddaf));var _0x2b0be9=this[_0x3c42('0xd7')][_0x3c42('0x6e')](this,_0x5aee15,_0x4bddaf);this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x597af3,_0x4bddaf);if(!this[_0x3c42('0x84')](_0x597af3[_0x3c42('0xd8')])){return this['channel'][_0x3c42('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x561a48=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x597af3[_0x3c42('0xd8')]);if(!_0x561a48){return this[_0x3c42('0x10')]['error'](_0x597af3,'no\x20variable\x20found');}var _0x294483=this;_0x2b0be9[_0x3c42('0xd9')](function(_0x120457,_0x1e22d8){Object[_0x3c42('0xda')](_0x120457)[_0x3c42('0xd9')](function(_0x4d88f7){_0x294483[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0xdb'),_0x561a48,_0x1e22d8,_0x4d88f7),_0x120457[_0x4d88f7]);});});this[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0xdc'),_0x561a48),_0x2b0be9[_0x3c42('0x99')]);return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xdd'),_0x561a48));};AGIVertices[_0x3c42('0x13')]['dial']=function(_0x52a837){logger[_0x3c42('0xde')](util['format'](_0x3c42('0xdf'),_0x52a837[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x52a837[_0x3c42('0xe0')])){return this['channel'][_0x3c42('0x2e')](_0x52a837,'no\x20user\x20selected');}var _0x2fa400=this[_0x3c42('0xe1')]['sync'](this,_0x52a837[_0x3c42('0xe0')]);if(!_0x2fa400){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x52a837,_0x3c42('0xe2'));}var _0x42373d=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xe3'),[util[_0x3c42('0x9b')](_0x3c42('0xe4'),_0x2fa400),_0x52a837[_0x3c42('0x63')],_0x52a837['opts'],_0x52a837[_0x3c42('0x62')]]);if(_0x42373d[_0x3c42('0xa1')]===-0x1){return _0x42373d;}return this['channel'][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xe5'),_0x3c42('0xe3')));};AGIVertices[_0x3c42('0x13')]['dialogflow']=function(_0x8ebceb){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x8ebceb[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x8ebceb['key'])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xe6'));}if(!this[_0x3c42('0x84')](_0x8ebceb[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0x8ebceb);this[_0x3c42('0x3d')](_0x8ebceb['text'],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xe7'),_0x8ebceb[_0x3c42('0x5a')]));var _0x1b14a1=this[_0x3c42('0x78')][_0x3c42('0x6e')](this,_0x8ebceb);if(_0x1b14a1){for(var _0x953296 in _0x1b14a1){if(_0x1b14a1['hasOwnProperty'](_0x953296)){this['channel']['setVariable'](util[_0x3c42('0x9b')](_0x3c42('0xe8'),_0x953296[_0x3c42('0x69')]()),_0x1b14a1[_0x953296]);}}this[_0x3c42('0x3d')](_0x1b14a1['speech'],'out',_0x3c42('0xe9'),'');return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Dialogflow\x20Result\x20%s',_0x1b14a1[_0x3c42('0xea')]));}return this['channel'][_0x3c42('0x2e')](_0x8ebceb,_0x3c42('0xeb'));};AGIVertices['prototype'][_0x3c42('0xec')]=function(_0x70691f){logger[_0x3c42('0x29')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x70691f['label']));if(!this[_0x3c42('0x84')](_0x70691f[_0x3c42('0x7b')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xed'));}if(!this['isConfigured'](_0x70691f[_0x3c42('0x7c')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xee'));}if(!this[_0x3c42('0x84')](_0x70691f[_0x3c42('0x7d')])){return this['channel'][_0x3c42('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x3c42('0x84')](_0x70691f['dialogflowV2_language'])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xef'));}if(!this[_0x3c42('0x84')](_0x70691f[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xf0')]=!![];this[_0x3c42('0x33')](_0x70691f);this[_0x3c42('0x3d')](_0x70691f[_0x3c42('0x5a')],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xf1'),_0x70691f['text']));var _0x5a0055=this[_0x3c42('0x7a')][_0x3c42('0x6e')](this,_0x70691f);if(_0x5a0055){for(var _0x2501ca in _0x5a0055){if(_0x5a0055[_0x3c42('0x95')](_0x2501ca)){if(_0x2501ca!==_0x3c42('0xf2')){this['channel'][_0x3c42('0xa3')](util['format']('DIALOGFLOW_%s',_0x2501ca[_0x3c42('0x69')]()),_0x5a0055[_0x2501ca]);}}}this[_0x3c42('0x3d')](_0x5a0055[_0x3c42('0xea')],_0x3c42('0xf3'),_0x3c42('0xec'),_0x5a0055[_0x3c42('0xf2')]);return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xf4'),_0x5a0055[_0x3c42('0xea')]));}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x70691f,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x3c42('0x13')][_0x3c42('0xf5')]=function(_0x3d1181){logger['info'](util['format'](_0x3c42('0xf6'),_0x3d1181['label']));if(!this[_0x3c42('0x84')](_0x3d1181['ndauth_url'])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0xf7'));}if(!this[_0x3c42('0x84')](_0x3d1181[_0x3c42('0xf8')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xf9'));}if(!this[_0x3c42('0x84')](_0x3d1181[_0x3c42('0xfa')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xfb'));}if(!this['isConfigured'](_0x3d1181['ndassistant_url'])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xf0')]=!![];this[_0x3c42('0x33')](_0x3d1181);this['createSquareMessage'](_0x3d1181[_0x3c42('0x5a')],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xfc'),_0x3d1181['text']));var _0x12c5f5=this[_0x3c42('0x7f')][_0x3c42('0x6e')](this,_0x3d1181);if(_0x12c5f5){for(var _0x2aa741 in _0x12c5f5){if(_0x12c5f5[_0x3c42('0x95')](_0x2aa741)){this[_0x3c42('0x10')]['setVariable'](util[_0x3c42('0x9b')](_0x3c42('0xfd'),_0x2aa741[_0x3c42('0x69')]()),_0x12c5f5[_0x2aa741]);}}this[_0x3c42('0x3d')](_0x12c5f5[_0x3c42('0xea')],_0x3c42('0xf3'),_0x3c42('0xf5'),'');if(_0x12c5f5[_0x3c42('0xfe')]){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xff'),_0x12c5f5[_0x3c42('0xfe')]));var _0x1a7ca4=this[_0x3c42('0x10')][_0x3c42('0x100')](_0x12c5f5[_0x3c42('0xfe')]);try{fs[_0x3c42('0x101')](_0x12c5f5[_0x3c42('0xfe')]+_0x3c42('0x102'));}catch(_0x55a886){logger[_0x3c42('0x2e')](_0x55a886);}return _0x1a7ca4;}else{return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x103'),_0x12c5f5[_0x3c42('0xea')]));}}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3d1181,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x3c42('0x13')][_0x3c42('0x104')]=function(_0x54aa35){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x105'),_0x54aa35[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x104'));};AGIVertices[_0x3c42('0x13')]['ext_dial']=function(_0xb43196){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x106'),_0xb43196[_0x3c42('0xa8')]));var _0x33d9e1='';if(_0xb43196['trunk_id']){if(!this[_0x3c42('0x84')](_0xb43196[_0x3c42('0x107')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0xb43196,_0x3c42('0x108'));}else{var _0x5b7709=parseInt(_0xb43196[_0x3c42('0x107')],0xa);if(isNaN(_0x5b7709)){_0x33d9e1=_0xb43196[_0x3c42('0x107')];}else{_0x33d9e1=this[_0x3c42('0x1e')][_0x3c42('0x6e')](this,_0xb43196[_0x3c42('0x107')]);if(!_0x33d9e1){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0xb43196,_0x3c42('0x109'));}}}}else if(_0xb43196[_0x3c42('0x10a')]){_0x33d9e1=_0xb43196[_0x3c42('0x10a')];}else{return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0xb43196,_0x3c42('0x108'));}var _0x32f0af=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xe3'),[util[_0x3c42('0x9b')](_0x3c42('0x10b'),_0x33d9e1,_0xb43196[_0x3c42('0x43')]),_0xb43196[_0x3c42('0x63')],_0xb43196[_0x3c42('0x10c')],_0xb43196[_0x3c42('0x62')]]);if(_0x32f0af[_0x3c42('0xa1')]===-0x1){return _0x32f0af;}return this['channel']['noop'](util[_0x3c42('0x9b')]('Executed\x20command\x20%s',_0x3c42('0xe3')));};AGIVertices['prototype']['finally']=function(_0x4f1d48){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x10d'),_0x4f1d48['label']));return this['channel'][_0x3c42('0xa9')](_0x3c42('0x10e'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xf')]=function(_0x56ce51){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x10f'),_0x56ce51[_0x3c42('0xa8')]));if(_0x56ce51['retry']===0x0){return this[_0x3c42('0xa4')](_0x56ce51);}_0x56ce51['retry']-=0x1;if(!this['isConfigured'](_0x56ce51[_0x3c42('0x110')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x56ce51,_0x3c42('0x111'));}var _0x4dccc4=this['getSound'][_0x3c42('0x6e')](this,_0x56ce51['file_id']);if(!_0x4dccc4){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x56ce51,_0x3c42('0x112'));}if(!this[_0x3c42('0x84')](_0x56ce51[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3c42('0x113'));}var _0x9e0ef3=this[_0x3c42('0x10')][_0x3c42('0x114')](_0x4dccc4,_0x56ce51[_0x3c42('0x115')],_0x56ce51[_0x3c42('0x116')]);var _0xc20566=_0x9e0ef3['result']?_0x9e0ef3[_0x3c42('0xa1')][_0x3c42('0x48')]():'';logger['info']('test',JSON[_0x3c42('0x72')](_0x9e0ef3));if(_0x9e0ef3[_0x3c42('0xa1')]===-0x1){this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x56ce51,_0xc20566);return _0x9e0ef3;}else if(_0x9e0ef3['extra']===_0x3c42('0x63')){_0x9e0ef3[_0x3c42('0xa1')]=_0xc20566[_0x3c42('0x99')]>=parseInt(_0x56ce51[_0x3c42('0x117')])?'x':'i';}else{_0x9e0ef3['result']=_0xc20566[_0x3c42('0x99')]>=parseInt(_0x56ce51['mindigit'])&&_0xc20566[_0x3c42('0x99')]<=parseInt(_0x56ce51[_0x3c42('0x116')])?'x':'i';}var _0x1a2212=this[_0x3c42('0x14')]['sync'](this,_0x56ce51[_0x3c42('0xd8')]);if(!_0x1a2212){return this['channel'][_0x3c42('0x2e')](_0x56ce51,_0x3c42('0x118'));}this[_0x3c42('0x10')][_0x3c42('0xa3')](_0x1a2212,_0xc20566);if(this[_0x3c42('0x84')](_0x56ce51[_0x3c42('0x119')])){var _0x3f2901=parseInt(_0x56ce51[_0x3c42('0x119')],0xa);var _0x7a64b0=rs[_0x3c42('0x11a')]({'charset':'*','length':_0x3f2901});var _0x173a18=_0xc20566[_0x3c42('0x99')];if(_0x173a18>0x0){if(_0x173a18>_0x3f2901){this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x56ce51,_0x56ce51[_0x3c42('0x11b')]==='first'?_0x7a64b0+_0xc20566[_0x3c42('0x11c')](_0x3f2901):_0xc20566[_0x3c42('0x11c')](0x0,_0x173a18-_0x3f2901)+_0x7a64b0);}else{this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x56ce51,rs[_0x3c42('0x11a')]({'charset':'*','length':_0x173a18}));}}else{this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x56ce51,'');}}else{this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x56ce51,_0xc20566);}return _0x9e0ef3;};AGIVertices[_0x3c42('0x13')]['getsecretdigits']=function(_0x51e790){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x51e790[_0x3c42('0xa8')]));return this[_0x3c42('0xf')](_0x51e790);};AGIVertices[_0x3c42('0x13')]['goal']=function(_0x17e193){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x11d'),_0x17e193['label']));this[_0x3c42('0x33')]['sync'](this,_0x17e193,_0x17e193[_0x3c42('0x11e')]);return this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x11f'),_0x17e193[_0x3c42('0x11e')]));};AGIVertices['prototype'][_0x3c42('0x120')]=function(_0x5185a2){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5185a2[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x5185a2[_0x3c42('0x87')])||!this[_0x3c42('0x84')](_0x5185a2[_0x3c42('0x88')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x121'));}if(!this[_0x3c42('0x84')](_0x5185a2['text'])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Trying\x20aws\x20Polly\x20%s',_0x5185a2[_0x3c42('0x5a')]));var _0x33e6c2=this[_0x3c42('0x86')][_0x3c42('0x6e')](this,_0x5185a2);if(_0x33e6c2){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x122'),_0x33e6c2));var _0x1c6ee1=this[_0x3c42('0x10')][_0x3c42('0x100')](_0x33e6c2);try{fs[_0x3c42('0x101')](_0x33e6c2+'.wav');}catch(_0x265461){logger[_0x3c42('0x2e')](_0x265461);}return _0x1c6ee1;}return this[_0x3c42('0x10')]['error'](_0x5185a2,_0x3c42('0x123'));};AGIVertices[_0x3c42('0x13')]['awslex']=function(_0x195054){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x124'),_0x195054[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x195054[_0x3c42('0x87')])||!this[_0x3c42('0x84')](_0x195054['aws_secret_access_key'])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0x121'));}if(!this[_0x3c42('0x84')](_0x195054[_0x3c42('0x8f')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0x3c42('0x84')](_0x195054['text'])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xf0')]=!![];this[_0x3c42('0x33')](_0x195054);this[_0x3c42('0x3d')](_0x195054[_0x3c42('0x5a')],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Trying\x20Amazon\x20Lex:\x20%s',_0x195054[_0x3c42('0x5a')]));var _0x2d3726=this[_0x3c42('0x8d')][_0x3c42('0x6e')](this,_0x195054);if(_0x2d3726){for(var _0x43e580 in _0x2d3726){if(_0x2d3726[_0x3c42('0x95')](_0x43e580)&&_[_0x3c42('0x96')](_0x2d3726[_0x43e580])){this['channel'][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x125'),_0x43e580[_0x3c42('0x69')]()),_0x2d3726[_0x43e580]);}}if(_['isNil'](_0x2d3726[_0x3c42('0x75')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x126'));}else{this[_0x3c42('0x3d')](_0x2d3726[_0x3c42('0x75')],_0x3c42('0xf3'),_0x3c42('0x127'),'');return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x128'),_0x2d3726[_0x3c42('0x75')]));}}return this['channel'][_0x3c42('0x2e')](_0x195054,_0x3c42('0x129'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x12a')]=function(_0x554418){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x12b'),_0x554418['label'],_0x554418['timeout']));if(!this[_0x3c42('0x84')](_0x554418[_0x3c42('0x79')])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0xe6'));}var _0x134831=_0x3c42('0x12c');var _0x44a6be=util[_0x3c42('0x9b')](_0x3c42('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x581ae4=util['format'](_0x3c42('0x12e'),_0x44a6be,_0x134831);var _0x3b05ee=!![];if(_0x554418[_0x3c42('0x12f')]===_0x3c42('0x130')){_0x3b05ee=![];}var _0x3c8cac=this[_0x3c42('0x10')][_0x3c42('0x131')](_0x44a6be,_0x134831,_0x554418[_0x3c42('0x132')],_0x554418[_0x3c42('0x63')],undefined,_0x3b05ee);if(_0x3c8cac[_0x3c42('0xa1')]!==-0x1){this['channel'][_0x3c42('0xa9')](util['format']('google\x20%s\x20file\x20created',_0x581ae4));var _0xf55a7d=this[_0x3c42('0x90')]['sync'](this,_0x554418,_0x581ae4);if(_0xf55a7d){for(var _0x15f303 in _0xf55a7d){if(_0xf55a7d['hasOwnProperty'](_0x15f303)){this[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x133'),_0x15f303['toUpperCase']()),_0xf55a7d[_0x15f303]);}}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x134'),JSON[_0x3c42('0x72')](_0xf55a7d)));}}return _0x3c8cac;};AGIVertices[_0x3c42('0x13')][_0x3c42('0x135')]=function(_0x455a70){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x136'),_0x455a70[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x455a70[_0x3c42('0x93')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20appid\x20configured');}if(!this[_0x3c42('0x84')](_0x455a70[_0x3c42('0x137')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x138'));}var _0x388f07=_0x3c42('0x12c');var _0x3f4f96=util[_0x3c42('0x9b')](_0x3c42('0x12d'),FILES_PATH,rs[_0x3c42('0x11a')](0x4));var _0x5ef6bd=util['format'](_0x3c42('0x12e'),_0x3f4f96,_0x388f07);var _0x235962=!![];if(_0x455a70[_0x3c42('0x12f')]==='NOBEEP'){_0x235962=![];}var _0x185c19=this[_0x3c42('0x10')][_0x3c42('0x131')](_0x3f4f96,_0x388f07,_0x455a70[_0x3c42('0x132')],_0x455a70[_0x3c42('0x63')],undefined,_0x235962);if(_0x185c19[_0x3c42('0xa1')]!==-0x1){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x139'),_0x5ef6bd));var _0x459011=this['tildeASR'][_0x3c42('0x6e')](this,_0x455a70,_0x5ef6bd);if(_0x459011){for(var _0x2687c3 in _0x459011){if(_0x459011[_0x3c42('0x95')](_0x2687c3)){this['channel'][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x13a'),_0x2687c3['toUpperCase']()),_0x459011[_0x2687c3]);}}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('TildeASR\x20Result\x20%s',JSON[_0x3c42('0x72')](_0x459011)));}}return _0x185c19;};AGIVertices['prototype'][_0x3c42('0x13b')]=function(_0x4f1747){logger['info'](util['format'](_0x3c42('0x13c'),_0x4f1747['label']));return this['channel'][_0x3c42('0x13d')](_0x4f1747['context'],_0x4f1747['extension'],_0x4f1747[_0x3c42('0x3b')]);};AGIVertices[_0x3c42('0x13')]['gotoif']=function(_0x10a4a6){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x13e'),_0x10a4a6['label']));if(!this[_0x3c42('0x84')](_0x10a4a6[_0x3c42('0x13f')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x10a4a6,_0x3c42('0x140'));}try{var _0x5511c8=eval(_0x10a4a6[_0x3c42('0x13f')])?_0x3c42('0x141'):_0x3c42('0x142');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x143'),_0x10a4a6[_0x3c42('0x13f')],_0x5511c8));return{'code':0xc8,'result':_0x5511c8};}catch(_0x1b7031){return{'code':0xc8,'result':_0x3c42('0x142')};}};AGIVertices['prototype'][_0x3c42('0x144')]=function(_0x523b8c){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x145'),_0x523b8c['label']));if(!this['isConfigured'](_0x523b8c[_0x3c42('0x146')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x523b8c,'no\x20interval\x20configured');}var _0x20594b=this[_0x3c42('0x24')][_0x3c42('0x6e')](this,_0x523b8c['interval_id']);if(!_0x20594b){return this[_0x3c42('0x10')]['error'](_0x523b8c,_0x3c42('0x147'));}for(var _0x5d9103=0x0;_0x5d9103<_0x20594b['length'];_0x5d9103+=0x1){var _0x3fcc09=this[_0x3c42('0x10')][_0x3c42('0x14')](util[_0x3c42('0x9b')](_0x3c42('0x148'),_0x20594b[_0x5d9103]));if(_0x3fcc09[_0x3c42('0xa1')]===-0x1){return _0x3fcc09;}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3fcc09[_0x3c42('0xa0')]));if(_0x3fcc09[_0x3c42('0xa0')]===_0x3c42('0x141')){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x141')));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x141')));return{'code':0xc8,'result':_0x3c42('0x141')};}else{logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x142')));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x142')));}}return{'code':0xc8,'result':_0x3c42('0x142')};};AGIVertices[_0x3c42('0x13')][_0x3c42('0x14a')]=function(_0x149ace){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x149ace[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0x14a')]();};AGIVertices[_0x3c42('0x13')][_0x3c42('0x14b')]=function(_0x4b80a2){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x14c'),_0x4b80a2[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x4b80a2[_0x3c42('0x79')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20key\x20configured');}var _0x4a6c84='wav';var _0x2007a6=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x3c42('0x11a')](0x4));var _0x38a3fa=util['format'](_0x3c42('0x12e'),_0x2007a6,_0x4a6c84);var _0x5240bd=!![];if(_0x4b80a2[_0x3c42('0x12f')]===_0x3c42('0x130')){_0x5240bd=![];}var _0x23d9c9=this['channel'][_0x3c42('0x131')](_0x2007a6,_0x4a6c84,_0x4b80a2['intKey'],_0x4b80a2['timeout'],undefined,_0x5240bd);if(_0x23d9c9[_0x3c42('0xa1')]!==-0x1){this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('ispeech\x20%s\x20file\x20created',_0x38a3fa));var _0x2112b5=this[_0x3c42('0x82')][_0x3c42('0x6e')](this,_0x4b80a2,_0x38a3fa);if(_0x2112b5){for(var _0x16be98 in _0x2112b5){if(_0x2112b5[_0x3c42('0x95')](_0x16be98)){this[_0x3c42('0x10')][_0x3c42('0xa3')](util['format']('ISPEECH_ASR_%s',_0x16be98[_0x3c42('0x69')]()),_0x2112b5[_0x16be98]);}}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x14d'),JSON['stringify'](_0x2112b5)));}}return _0x23d9c9;};AGIVertices['prototype']['ispeechtts']=function(_0x8f1a47){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x14e'),_0x8f1a47['label']));if(!this[_0x3c42('0x84')](_0x8f1a47[_0x3c42('0x79')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xe6'));}if(!this[_0x3c42('0x84')](_0x8f1a47[_0x3c42('0x5a')])){return this[_0x3c42('0x10')]['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x14f'),_0x8f1a47[_0x3c42('0x5a')]));var _0x444ba8=this['ispeechTTS'][_0x3c42('0x6e')](this,_0x8f1a47);if(_0x444ba8){this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format']('ispeech\x20%s\x20file\x20created',_0x444ba8));var _0x1f09dc=this[_0x3c42('0x10')]['streamFile'](_0x444ba8,_0x8f1a47[_0x3c42('0x132')]);try{fs[_0x3c42('0x101')](_0x444ba8+_0x3c42('0x102'));}catch(_0x1b0ecb){logger['error'](_0x1b0ecb);}return _0x1f09dc;}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x8f1a47,_0x3c42('0x150'));};AGIVertices['prototype']['login']=function(_0x43c276){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x151'),_0x43c276[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x43c276[_0x3c42('0x152')])){return this[_0x3c42('0x10')]['error'](_0x43c276,_0x3c42('0x153'));}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x154'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x43c276[_0x3c42('0x152')]));var _0x2f5cd5=this['agentLogin'][_0x3c42('0x6e')](this,_0x43c276[_0x3c42('0x152')]);if(_0x2f5cd5){logger['info'](util[_0x3c42('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x43c276['findBy']));this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0x155'),this['channel'][_0x3c42('0x38')],_0x43c276[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this['channel'][_0x3c42('0x38')],_0x43c276[_0x3c42('0x152')]));this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x157'),this['channel']['callerid'],_0x43c276[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices[_0x3c42('0x13')][_0x3c42('0x159')]=function(_0x2465ac){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x15a'),_0x2465ac[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x2465ac[_0x3c42('0x152')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2465ac,_0x3c42('0x153'));}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x2465ac[_0x3c42('0x152')]));var _0x185c14=this[_0x3c42('0x4f')]['sync'](this,_0x2465ac[_0x3c42('0x152')]);if(_0x185c14){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x155'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));this['channel']['noop'](util['format'](_0x3c42('0x155'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices[_0x3c42('0x13')]['math']=function(_0x484da0){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x15b'),_0x484da0[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x484da0[_0x3c42('0x15c')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x484da0,_0x3c42('0x15d'));}this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x15e'),_0x484da0[_0x3c42('0x15c')]));var _0x43fe74=eval(_0x484da0[_0x3c42('0x15c')]);if(!this['isConfigured'](_0x484da0[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x113'));}var _0x5aee19=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x484da0[_0x3c42('0xd8')]);if(!_0x5aee19){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x484da0,_0x3c42('0x118'));}if(_[_0x3c42('0x9c')](_0x43fe74)){var _0x201e3d=this;_0x43fe74['forEach'](function(_0x27eb7e,_0x31d853){_0x201e3d[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x15f'),_0x5aee19,_0x31d853),_0x27eb7e);});return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('variable\x20%s[key]\x20set',_0x5aee19));}else{return this['channel']['setVariable'](_0x5aee19,_0x43fe74);}};AGIVertices['prototype'][_0x3c42('0xe')]=function(_0x3b51e6){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x160'),_0x3b51e6[_0x3c42('0xa8')]));if(_0x3b51e6['retry']===0x0){return this['maxRetry'](_0x3b51e6);}_0x3b51e6[_0x3c42('0xa5')]-=0x1;if(!this[_0x3c42('0x84')](_0x3b51e6[_0x3c42('0x110')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3b51e6,_0x3c42('0x111'));}var _0x3066bd=this[_0x3c42('0x1f')][_0x3c42('0x6e')](this,_0x3b51e6['file_id']);if(!_0x3066bd){return this[_0x3c42('0x10')]['error'](_0x3b51e6,'no\x20file\x20audio\x20found');}var _0x15ad93=this[_0x3c42('0x10')]['getData'](_0x3066bd,_0x3b51e6['response'],_0x3b51e6[_0x3c42('0x161')]);var _0x1e9e7e=_0x15ad93[_0x3c42('0xa1')];if(_0x15ad93[_0x3c42('0xa1')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x3b51e6,'-1');return _0x15ad93;}else if(_0x15ad93[_0x3c42('0xa0')]===_0x3c42('0x63')){_0x15ad93[_0x3c42('0xa1')]=_0x15ad93[_0x3c42('0xa1')]['length']>0x0?_0x15ad93[_0x3c42('0xa1')]:'t';}else if(_[_0x3c42('0x3f')](_0x15ad93[_0x3c42('0xa1')])){_0x15ad93[_0x3c42('0xa1')]='#';_0x1e9e7e='#';}if(!this[_0x3c42('0x84')](_0x3b51e6[_0x3c42('0xd8')])){this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x113'));}else{var _0x1bc63f=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x3b51e6[_0x3c42('0xd8')]);if(!_0x1bc63f){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3b51e6,_0x3c42('0x118'));}this['channel']['setVariable'](_0x1bc63f,_0x1e9e7e);}this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x3b51e6,_0x1e9e7e);return _0x15ad93;};AGIVertices[_0x3c42('0x13')][_0x3c42('0xa9')]=function(_0x331315){logger[_0x3c42('0x29')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x331315[_0x3c42('0xa8')]));return this[_0x3c42('0x10')]['noop'](_0x331315[_0x3c42('0x162')]||_0x331315[_0x3c42('0xa8')]);};AGIVertices[_0x3c42('0x13')][_0x3c42('0x163')]=function(_0x25ae20){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x25ae20['label']));if(!this['isConfigured'](_0x25ae20[_0x3c42('0x152')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x25ae20,_0x3c42('0x153'));}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3c42('0x10')]['callerid'],_0x25ae20[_0x3c42('0x152')]));var _0x21a524=this[_0x3c42('0x4a')][_0x3c42('0x6e')](this,_0x25ae20['pause_id']);var _0xa8ffe9=this[_0x3c42('0x4d')][_0x3c42('0x6e')](this,_0x25ae20[_0x3c42('0x152')],_0x21a524);if(_0xa8ffe9){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x155'),this[_0x3c42('0x10')]['callerid'],_0x25ae20['findBy']));this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x155'),this['channel']['callerid'],_0x25ae20[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x25ae20[_0x3c42('0x152')]));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c42('0x10')]['callerid'],_0x25ae20['findBy']));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices['prototype']['playback']=function(_0x282dbe){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x164'),_0x282dbe[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x282dbe[_0x3c42('0x110')])){return this[_0x3c42('0x10')]['error'](_0x282dbe,'no\x20file\x20audio\x20selected');}var _0x1ad3a9=this[_0x3c42('0x1f')]['sync'](this,_0x282dbe[_0x3c42('0x110')]);if(!_0x1ad3a9){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x282dbe,'no\x20file\x20audio\x20found');}var _0x1e4ea1=this[_0x3c42('0x10')]['exec']('PLAYBACK',[_0x1ad3a9,_0x282dbe[_0x3c42('0x10c')]]);if(_0x1e4ea1[_0x3c42('0xa1')]===-0x1){return _0x1e4ea1;}return this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0xc3'),_0x3c42('0x165'),_0x1ad3a9));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x166')]=function(_0x4a6d20){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x167'),_0x4a6d20[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x4a6d20[_0x3c42('0x168')])){return this[_0x3c42('0x10')]['error'](_0x4a6d20,_0x3c42('0x169'));}var _0x387e42='';var _0x4b19dc=parseInt(_0x4a6d20[_0x3c42('0x168')],0xa);if(isNaN(_0x4b19dc)){_0x387e42=_0x4a6d20[_0x3c42('0x168')];}else{_0x387e42=this[_0x3c42('0x18')][_0x3c42('0x6e')](this,_0x4a6d20[_0x3c42('0x168')]);if(!_0x387e42){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x4a6d20,_0x3c42('0x16a'));}}var _0x845535='';if(this['isConfigured'](_0x4a6d20[_0x3c42('0x110')])){var _0x402df5=this['getSound'][_0x3c42('0x6e')](this,_0x4a6d20[_0x3c42('0x110')]);if(_0x402df5){_0x845535=_0x402df5;}}this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x4a6d20,_0x387e42);if(_0x4a6d20[_0x3c42('0x10c')][_0x3c42('0x16b')]('x')<0x0){_0x4a6d20['opts']+='x';}if(_0x4a6d20[_0x3c42('0x10c')][_0x3c42('0x16b')]('X')<0x0){_0x4a6d20['opts']+='X';}this['channel'][_0x3c42('0xa3')](_0x3c42('0x16c'),_0x387e42?_0x387e42['toLowerCase']():'');var _0x522a92=this['channel'][_0x3c42('0x54')](_0x3c42('0x16d'),[_0x387e42,_0x4a6d20[_0x3c42('0x10c')],_0x4a6d20['url'],_0x845535,_0x4a6d20[_0x3c42('0x63')],_0x4a6d20[_0x3c42('0xb6')],_0x4a6d20[_0x3c42('0x16e')],_0x4a6d20['gosub'],'',_0x4a6d20[_0x3c42('0x16f')]]);if(_0x522a92[_0x3c42('0xa1')]===-0x1){return _0x522a92;}return this['channel']['noop'](util['format'](_0x3c42('0xc3'),'QUEUE',_0x387e42));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x170')]=function(_0x2627a4){logger['info'](util['format'](_0x3c42('0x171'),_0x2627a4[_0x3c42('0xa8')]));var _0x48b939=_0x2627a4[_0x3c42('0x172')]||_0x3c42('0x12c');var _0x1d2f5e=util[_0x3c42('0x9b')](_0x3c42('0x173'),this[_0x3c42('0x10')][_0x3c42('0x37')],rs[_0x3c42('0x11a')](0x5));var _0x18972e=util[_0x3c42('0x9b')](_0x3c42('0x174'),FILES_PATH,_0x1d2f5e,_0x48b939);var _0x2f066e=util[_0x3c42('0x9b')](_0x3c42('0x12d'),FILES_PATH,_0x1d2f5e);this[_0x3c42('0x36')][_0x3c42('0x6e')](this,_0x2627a4,_0x1d2f5e,_0x18972e);this[_0x3c42('0x10')]['setVariable'](_0x3c42('0x175'),_0x1d2f5e);logger[_0x3c42('0x29')](_0x3c42('0x176'),_0x2f066e,_0x48b939,_0x2627a4[_0x3c42('0x177')],_0x2627a4['timeout']);return this['channel']['recordFile'](_0x2f066e,_0x48b939,_0x2627a4[_0x3c42('0x177')],_0x2627a4[_0x3c42('0x63')],undefined,!![]);};AGIVertices[_0x3c42('0x13')]['restapi']=function(_0x13b40f){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x13b40f[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x13b40f[_0x3c42('0x62')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x178'));}var _0x3ef695=this[_0x3c42('0x179')][_0x3c42('0x6e')](this,_0x13b40f);logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x17a'),util['inspect'](_0x3ef695,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x13b40f[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x17b'));}var _0x49ea9c=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x13b40f[_0x3c42('0xd8')]);if(!_0x49ea9c){return this['channel'][_0x3c42('0x2e')](_0x13b40f,_0x3c42('0x118'));}this[_0x3c42('0x10')][_0x3c42('0xa3')](util['format']('%s_STATUS_CODE',_0x49ea9c),_0x3ef695[_0x3c42('0x73')]?_0x3ef695['statusCode']:'200');this[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x17c'),_0x49ea9c),_0x3ef695['statusMessage']?_0x3ef695[_0x3c42('0x74')]:'OK');if(_0x3ef695['body']){try{this[_0x3c42('0x9d')](_0x3ef695[_0x3c42('0x6a')],_0x49ea9c);}catch(_0x533bf1){logger[_0x3c42('0x2e')](util[_0x3c42('0x9b')](_0x3c42('0x17d'),_0x49ea9c));}}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xdd'),_0x49ea9c));};AGIVertices['prototype']['saydigits']=function(_0x3698ac){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x17e'),_0x3698ac[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0x17f')](_0x3698ac[_0x3c42('0x180')]['replace'](/\s+/g,''),_0x3698ac['escape_digits']);};AGIVertices['prototype'][_0x3c42('0x181')]=function(_0x41a6aa){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x182'),_0x41a6aa[_0x3c42('0xa8')]));return this['channel'][_0x3c42('0x183')](_0x41a6aa['number'][_0x3c42('0x56')](/\s+/g,''),_0x41a6aa[_0x3c42('0x177')]);};AGIVertices[_0x3c42('0x13')][_0x3c42('0x184')]=function(_0x503891){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x185'),_0x503891[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0x186')](_0x503891['text'],_0x503891[_0x3c42('0x177')]);};AGIVertices[_0x3c42('0x13')]['sendMail']=function(_0x59d51f){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x187'),_0x59d51f[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x59d51f['account_id'])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0x188'));}var _0xae4d8f=this[_0x3c42('0x189')][_0x3c42('0x6e')](this,_0x59d51f['account_id']);if(!_0xae4d8f||!_0xae4d8f[_0x3c42('0x18a')]){return this[_0x3c42('0x10')]['error'](_0x59d51f,_0x3c42('0x18b'));}var _0x143295={'from':util[_0x3c42('0x9b')](_0x3c42('0x18c'),_0xae4d8f['name'],_0xae4d8f[_0x3c42('0x18d')]||_0xae4d8f[_0x3c42('0x18a')][_0x3c42('0x18e')]),'to':_0x59d51f['to']||'','cc':_0x59d51f['cc']||'','bcc':_0x59d51f[_0x3c42('0x18f')]||'','subject':_0x59d51f[_0x3c42('0x190')],'html':_0x59d51f[_0x3c42('0x5a')],'text':_0x59d51f[_0x3c42('0x5a')]};if(this[_0x3c42('0x84')](_0x59d51f[_0x3c42('0x191')])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x143295));this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x59d51f,_0x59d51f['account_id']);this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x192'),_0xae4d8f[_0x3c42('0x16')]));this[_0x3c42('0x23')][_0x3c42('0x6e')](this,_0xae4d8f[_0x3c42('0x193')],_0x143295);return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x194'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x195')]=function(_0x2cdb9d){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x196'),_0x2cdb9d['label']));return this['channel'][_0x3c42('0xa9')](_0x3c42('0x197'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x198')]=function(_0x5f5552){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x199'),_0x5f5552['label']));if(!this[_0x3c42('0x84')](_0x5f5552[_0x3c42('0x19a')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0x19b'));}var _0xfb81f9=this[_0x3c42('0x30')][_0x3c42('0x6e')](this,_0x5f5552['sms_account_id']);if(!_0xfb81f9){return this['channel'][_0x3c42('0x2e')](_0x5f5552,_0x3c42('0x19c'));}var _0xc43e02={'body':_0x5f5552[_0x3c42('0x19d')],'phone':_0x5f5552['to']||'','SmsAccountId':_0xfb81f9['id']};logger[_0x3c42('0xde')]('sendSMS\x20message',JSON[_0x3c42('0x72')](_0xc43e02));this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x5f5552,_0x5f5552[_0x3c42('0x19a')]);this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0x19e'),_0xfb81f9[_0x3c42('0x16')]));this[_0x3c42('0x32')][_0x3c42('0x6e')](this,_0xc43e02);return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x19f'));};AGIVertices['prototype']['set']=function(_0x2e5101){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x1a0'),_0x2e5101[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x2e5101[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e5101,_0x3c42('0x1a1'));}var _0x56ca3f=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x2e5101[_0x3c42('0xd8')]);if(!_0x56ca3f){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e5101,_0x3c42('0x118'));}return this[_0x3c42('0x10')][_0x3c42('0xa3')](_0x56ca3f,_0x2e5101[_0x3c42('0x1a2')]);};AGIVertices['prototype'][_0x3c42('0x1a3')]=function(_0x474fed){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x1a4'),_0x474fed[_0x3c42('0xa8')]));this['channel'][_0x3c42('0xa9')](_0x3c42('0x1a5'));if(_0x474fed['answer']==='yes'){this[_0x3c42('0x10')][_0x3c42('0xa9')]('Answer');return this[_0x3c42('0x10')][_0x3c42('0xba')]();}return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x1a6'));};AGIVertices[_0x3c42('0x13')]['subproject']=function(_0x2e51f6){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x1a7'),_0x2e51f6[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x2e51f6[_0x3c42('0x1a8')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e51f6,'no\x20subproject\x20selected');}var _0x43dd72=this[_0x3c42('0x1a9')][_0x3c42('0x6e')](this,_0x2e51f6[_0x3c42('0x1a8')]);if(!this[_0x3c42('0x84')](_0x43dd72)){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e51f6,util[_0x3c42('0x9b')](_0x3c42('0x1aa'),_0x2e51f6[_0x3c42('0x1a8')]));}if(_0x43dd72===this[_0x3c42('0x10')][_0x3c42('0x35')]){return this['channel'][_0x3c42('0x2e')](_0x2e51f6,_0x3c42('0x1ab'));}this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x2e51f6,_0x43dd72);var _0xc1efcc=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0x1ac'),util[_0x3c42('0x9b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x3c42('0x1ad')]||_0x3c42('0x1ae'),_0x43dd72,this['channel']['arg_1']));if(_0xc1efcc[_0x3c42('0xa1')]===-0x1){return _0xc1efcc;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Executed\x20command\x20%s\x20%s',_0x3c42('0x1ac'),_0x43dd72));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1af')]=function(_0x33e0f1){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x33e0f1['label']));var _0x58227d=this['shellCommand'][_0x3c42('0x6e')](this,_0x33e0f1[_0x3c42('0xb8')]);this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x33e0f1,_0x33e0f1['command']);if(this[_0x3c42('0x84')](_0x33e0f1[_0x3c42('0xd8')])){var _0x1b4a57=this['getVariable'][_0x3c42('0x6e')](this,_0x33e0f1[_0x3c42('0xd8')]);if(_0x1b4a57){this[_0x3c42('0x10')]['setVariable'](_0x1b4a57,_0x58227d);return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x1b0'),_0x33e0f1[_0x3c42('0xb8')],_0x1b4a57));}}return this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x1b1'),_0x33e0f1[_0x3c42('0xb8')]));};AGIVertices[_0x3c42('0x13')]['google_cloud_tts']=function(_0x25f6dd){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x25f6dd[_0x3c42('0xa8')]));_0x25f6dd[_0x3c42('0x5a')]=_0x25f6dd[_0x3c42('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x25f6dd[_0x3c42('0x58')])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0x1b2'));}if(!this['isConfigured'](_0x25f6dd['text'])){return this[_0x3c42('0x10')]['noop']('no\x20text\x20configured');}this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x1b3'),_0x25f6dd[_0x3c42('0x5a')]));var _0x3abf02=this['googleCloudTTS'][_0x3c42('0x6e')](this,_0x25f6dd);if(_0x3abf02){this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x1b4'),_0x3abf02));var _0x4328ae=this[_0x3c42('0x10')][_0x3c42('0x100')](_0x3abf02);try{fs[_0x3c42('0x101')](_0x3abf02+_0x3c42('0x102'));}catch(_0x3dd902){logger['error'](_0x3dd902);}return _0x4328ae;}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x25f6dd,_0x3c42('0x1b5'));};AGIVertices[_0x3c42('0x13')]['tts']=function(_0x597151){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x1b6'),_0x597151[_0x3c42('0xa8')]));_0x597151['text']=_0x597151['text'][_0x3c42('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x597151[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x1b7'),_0x597151[_0x3c42('0x5a')]));var _0x3e15a6=this[_0x3c42('0x60')]['sync'](this,_0x597151);if(_0x3e15a6){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x1b8'),_0x3e15a6));var _0x43c519=this[_0x3c42('0x10')]['streamFile'](_0x3e15a6);try{fs[_0x3c42('0x101')](_0x3e15a6+_0x3c42('0x102'));}catch(_0x21b854){logger[_0x3c42('0x2e')](_0x21b854);}return _0x43c519;}return this[_0x3c42('0x10')]['error'](_0x597151,_0x3c42('0x1b9'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1ba')]=function(_0x49858c){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x1bb'),_0x49858c[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x49858c[_0x3c42('0x152')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x49858c,_0x3c42('0x153'));}logger['info'](util[_0x3c42('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3c42('0x10')]['callerid'],_0x49858c[_0x3c42('0x152')]));var _0x446294=this[_0x3c42('0x4e')][_0x3c42('0x6e')](this,_0x49858c[_0x3c42('0x152')]);if(_0x446294){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c[_0x3c42('0x152')]));this['channel'][_0x3c42('0xa9')](util['format'](_0x3c42('0x155'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c['findBy']));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger[_0x3c42('0x29')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c[_0x3c42('0x152')]));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1bc')]=function(_0x3ab570){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x1bd'),_0x3ab570[_0x3c42('0xa8')]));var _0x28a797=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0x1be'),[_0x3ab570[_0x3c42('0x1bf')],_0x3ab570[_0x3c42('0x77')]]);if(_0x28a797[_0x3c42('0xa1')]===-0x1){return _0x28a797;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xc3'),_0x3c42('0x1be'),_0x3ab570[_0x3c42('0x1bf')]));};AGIVertices[_0x3c42('0x13')]['vswitch']=function(_0x2bfaeb){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x1c0'),_0x2bfaeb['label']));if(!this[_0x3c42('0x84')](_0x2bfaeb['variable_id'])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2bfaeb,_0x3c42('0x1a1'));}var _0x54087d=this[_0x3c42('0x14')]['sync'](this,_0x2bfaeb[_0x3c42('0xd8')]);if(!_0x54087d){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2bfaeb,'no\x20variable\x20found');}var _0x45ff7c=this[_0x3c42('0x10')][_0x3c42('0x14')](_0x54087d);return{'code':0xc8,'result':_0x45ff7c[_0x3c42('0xa0')]?_0x45ff7c[_0x3c42('0xa0')]:'-'};};String[_0x3c42('0x13')]['replaceAll']=function(_0x24e428,_0xb7372e){return this[_0x3c42('0x9f')](_0x24e428)[_0x3c42('0x1c1')](_0xb7372e);};module['exports']=AGIVertices; \ No newline at end of file +var _0x081e=['end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','no\x20queue\x20selected','queue_id','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','email','user','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','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','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','util','lodash','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','getsecretdigits','channel','rpc','mailRpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','lastName','isNil','phone','list_id','scheduledAt','toString','callback_priority','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','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','includes','PUT','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','options','googleDialogflow','key','googleDialogflowV2','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','extra','getAndSetVariable','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query:\x20%s','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','bot','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','toUpperCase','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20is\x20unreachable'];(function(_0x3eea6a,_0x466418){var _0x41c2ec=function(_0x2a1aa5){while(--_0x2a1aa5){_0x3eea6a['push'](_0x3eea6a['shift']());}};_0x41c2ec(++_0x466418);}(_0x081e,0xc5));var _0xe081=function(_0x49d77e,_0x47b0ca){_0x49d77e=_0x49d77e-0x0;var _0x37895e=_0x081e[_0x49d77e];return _0x37895e;};'use strict';var fs=require('fs');var util=require(_0xe081('0x0'));var _=require(_0xe081('0x1'));var sh=require('shelljs');var odbc=require(_0xe081('0x2'))();var rs=require('randomstring');var moment=require(_0xe081('0x3'));var Mustache=require(_0xe081('0x4'));var rp=require(_0xe081('0x5'));var logger=require(_0xe081('0x6'))(_0xe081('0x7'));var config=require(_0xe081('0x8'));var shared=require(_0xe081('0x9'));var scripts=require('./scripts');var FILES_PATH=_0xe081('0xa');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=['menu','getdigits',_0xe081('0xb')];var AGIVertices=function(_0x5851e6,_0x4106a9,_0x497c3d){this[_0xe081('0xc')]=_0x5851e6;this[_0xe081('0xd')]=_0x4106a9;this[_0xe081('0xe')]=_0x497c3d;};AGIVertices['prototype']['getVariable']=function(_0x1745b7,_0x59ddc0){this[_0xe081('0xd')][_0xe081('0xf')](_0x1745b7)[_0xe081('0x10')](function(_0x1d4526){_0x59ddc0(null,_0x1d4526?_0x1d4526[_0xe081('0x11')]:![]);})[_0xe081('0x12')](function(_0x4baa60){_0x59ddc0(_0x4baa60);});};AGIVertices[_0xe081('0x13')][_0xe081('0x14')]=function(_0x4a38b0,_0x1539b8){this[_0xe081('0xd')][_0xe081('0x15')](_0x4a38b0)['then'](function(_0x10d56b){_0x1539b8(null,_0x10d56b?_0x10d56b['name']:![]);})['catch'](function(_0x4cadc9){_0x1539b8(_0x4cadc9);});};AGIVertices['prototype'][_0xe081('0x16')]=function(_0x47026f,_0x12677b){this['rpc']['getSquareProjectById'](_0x47026f)[_0xe081('0x10')](function(_0x3a1fe2){_0x12677b(null,_0x3a1fe2?_0x3a1fe2[_0xe081('0x11')]:![]);})['catch'](function(_0x301f85){_0x12677b(_0x301f85);});};AGIVertices[_0xe081('0x13')][_0xe081('0x17')]=function(_0x3910b3,_0x2f354b){this[_0xe081('0xd')][_0xe081('0x18')](_0x3910b3)[_0xe081('0x10')](function(_0xa328b8){_0x2f354b(null,_0xa328b8?_0xa328b8['dsn']:![]);})[_0xe081('0x12')](function(_0x1018ec){_0x2f354b(_0x1018ec);});};AGIVertices[_0xe081('0x13')]['getUser']=function(_0x4af0a9,_0x2bb7b8){this[_0xe081('0xd')][_0xe081('0x19')](_0x4af0a9)[_0xe081('0x10')](function(_0x27a63d){_0x2bb7b8(null,_0x27a63d?_0x27a63d[_0xe081('0x11')]:![]);})['catch'](function(_0x3cbd9c){_0x2bb7b8(_0x3cbd9c);});};AGIVertices[_0xe081('0x13')][_0xe081('0x1a')]=function(_0x2eca97,_0x46e0f2){this[_0xe081('0xd')][_0xe081('0x1b')](_0x2eca97)[_0xe081('0x10')](function(_0x28cd52){_0x46e0f2(null,_0x28cd52?_0x28cd52[_0xe081('0x11')]:![]);})['catch'](function(_0x335986){_0x46e0f2(_0x335986);});};AGIVertices[_0xe081('0x13')][_0xe081('0x1c')]=function(_0x52f6e4,_0x68bdd5){var _0x4f8e73=this;this[_0xe081('0xd')][_0xe081('0x1d')](_0x52f6e4)[_0xe081('0x10')](function(_0x17f6e7){_0x68bdd5(null,_0x17f6e7?_0x4f8e73[_0xe081('0x1e')](_0x17f6e7['save_name']):![]);})[_0xe081('0x12')](function(_0x23ba5b){_0x68bdd5(_0x23ba5b);});};AGIVertices[_0xe081('0x13')][_0xe081('0x1f')]=function(_0xb52eef,_0x33761a){this[_0xe081('0xd')][_0xe081('0x20')](_0xb52eef)['then'](function(_0x265419){_0x33761a(null,_0x265419?_0x265419:![]);})[_0xe081('0x12')](function(_0x1aab2d){_0x33761a(_0x1aab2d);});};AGIVertices[_0xe081('0x13')]['sendMailMessage']=function(_0x277e66,_0x5200a8,_0x27e7d5){this[_0xe081('0xe')][_0xe081('0x21')](_0x277e66,_0x5200a8)['then'](function(){_0x27e7d5(null);})[_0xe081('0x12')](function(_0x44199f){_0x27e7d5(_0x44199f);});};AGIVertices[_0xe081('0x13')][_0xe081('0x22')]=function(_0x53f6de,_0x11b14b){this[_0xe081('0xd')][_0xe081('0x23')](_0x53f6de)['then'](function(_0x213c83){if(_0x213c83){if(_0x213c83[_0xe081('0x24')]){_0x11b14b(null,[_0x213c83[_0xe081('0x25')]]);}else{_0x11b14b(null,_[_0xe081('0x26')](_0x213c83['Intervals'],_0xe081('0x25')));}}else{_0x11b14b(null,![]);}})[_0xe081('0x12')](function(_0x1c8089){_0x11b14b(_0x1c8089);});};AGIVertices[_0xe081('0x13')]['getSoundPath']=function(_0x3e08bd){return util[_0xe081('0x27')](_0xe081('0x28'),FILES_PATH,_0x3e08bd);};AGIVertices['prototype'][_0xe081('0x29')]=function(_0x2a1fa7,_0x26a240,_0xaa1dd1){odbc[_0xe081('0x2a')](_0x2a1fa7,function(_0x2300d8){if(_0x2300d8){logger['error'](_0xe081('0x2b'),_0x2300d8);_0xaa1dd1(_0x2300d8);}else{logger[_0xe081('0x2c')]('ODBC\x20connection\x20successfully');odbc[_0xe081('0x2d')](_0x26a240,function(_0x43fef0,_0x1940a3){if(_0x43fef0){logger['info']('Error\x20executing\x20query\x20%s',_0x26a240);_0xaa1dd1(_0x43fef0);}else{logger[_0xe081('0x2c')](_0xe081('0x2e'),_0x26a240);odbc[_0xe081('0x2f')](function(_0x5c848f){if(_0x5c848f){logger[_0xe081('0x30')](_0xe081('0x31'),_0x5c848f);}_0xaa1dd1(null,_0x1940a3);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x3a82d3,_0x24e6f0){this[_0xe081('0xd')]['getSmsAccountById'](_0x3a82d3)[_0xe081('0x10')](function(_0xda5a3c){_0x24e6f0(null,_0xda5a3c?_0xda5a3c:![]);})['catch'](function(_0x287c81){_0x24e6f0(_0x287c81);});};AGIVertices[_0xe081('0x13')][_0xe081('0x32')]=function(_0x31d482,_0x562d21){this[_0xe081('0xd')]['createSmsMessage'](_0x31d482)['then'](function(_0x4c5065){_0x562d21(null,_0x4c5065);})[_0xe081('0x12')](function(_0x1d2e02){_0x562d21(_0x1d2e02);});};AGIVertices[_0xe081('0x13')][_0xe081('0x33')]=function(_0x187a6f,_0x501360,_0x187edf){this[_0xe081('0xd')][_0xe081('0x33')]({'uniqueid':this[_0xe081('0xc')]['uniqueid'],'node':_0x187a6f[_0xe081('0x34')],'application':_0x187a6f[_0xe081('0x35')],'data':_0x501360||null,'project_name':this[_0xe081('0xc')][_0xe081('0x36')],'callerid':this[_0xe081('0xc')][_0xe081('0x37')]})[_0xe081('0x10')](function(_0x8163f3){if(_0x187edf){_0x187edf(null,_0x8163f3);}})[_0xe081('0x12')](function(_0x548071){if(_0x187edf){_0x187edf(_0x548071);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x29bdf4,_0xfab250,_0x5c4cc6,_0x336536){this[_0xe081('0xd')][_0xe081('0x38')]({'uniqueid':this[_0xe081('0xc')]['uniqueid'],'callerid':this[_0xe081('0xc')][_0xe081('0x37')],'calleridname':this[_0xe081('0xc')][_0xe081('0x39')],'context':this['channel']['context'],'extension':this[_0xe081('0xc')][_0xe081('0x3a')],'priority':this['channel'][_0xe081('0x3b')],'accountcode':this[_0xe081('0xc')][_0xe081('0x3c')],'dnid':this[_0xe081('0xc')][_0xe081('0x3d')],'projectName':this[_0xe081('0xc')][_0xe081('0x36')],'saveName':_0xfab250,'filename':_0x29bdf4[_0xe081('0x3e')]||_0xfab250,'savePath':_0x5c4cc6})[_0xe081('0x10')](function(_0x2c6df0){_0x336536(null,_0x2c6df0);})['catch'](function(_0x4c15bc){_0x336536(_0x4c15bc);});};AGIVertices[_0xe081('0x13')][_0xe081('0x3f')]=function(_0x53db3b,_0x35df49,_0x3a5d83,_0x2938f0,_0x401053){this[_0xe081('0xd')][_0xe081('0x3f')]({'uniqueid':this['channel'][_0xe081('0x40')],'body':_0x53db3b,'direction':_0x35df49,'providerName':_0x3a5d83,'providerResponse':_0x2938f0})['then'](function(_0x14565b){if(_0x401053){_0x401053(null,_0x14565b);}})[_0xe081('0x12')](function(_0x2d5002){if(_0x401053){_0x401053(_0x2d5002);}});};AGIVertices[_0xe081('0x13')][_0xe081('0x41')]=function(_0xdc9239,_0x3393bd){this[_0xe081('0xd')][_0xe081('0x41')]({'firstName':_[_0xe081('0x42')](_0xdc9239[_0xe081('0x11')])||_['isNil'](_0xdc9239['name'])?'callback_'+Math['random']():_0xdc9239[_0xe081('0x11')],'lastName':_[_0xe081('0x42')](_0xdc9239[_0xe081('0x43')])||_[_0xe081('0x44')](_0xdc9239[_0xe081('0x43')])?null:_0xdc9239[_0xe081('0x43')],'phone':_0xdc9239[_0xe081('0x45')],'ListId':_0xdc9239[_0xe081('0x46')],'scheduledat':_0xdc9239[_0xe081('0x47')],'callbackUniqueid':this['channel'][_0xe081('0x40')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0xdc9239[_0xe081('0x47')][_0xe081('0x48')](),'priority':_0xdc9239[_0xe081('0x49')]})[_0xe081('0x10')](function(_0x7d8fba){_0x3393bd(null,_0x7d8fba);})[_0xe081('0x12')](function(_0x4d3ca0){_0x3393bd(_0x4d3ca0);});};AGIVertices[_0xe081('0x13')]['getPause']=function(_0x86d299,_0x17988a){this[_0xe081('0xd')]['getPauseById'](_0x86d299)[_0xe081('0x10')](function(_0x3295cc){_0x17988a(null,_0x3295cc?_0x3295cc[_0xe081('0x11')]:![]);})[_0xe081('0x12')](function(_0x3be55c){_0x17988a(_0x3be55c);});};AGIVertices['prototype']['agentPause']=function(_0x1e343e,_0x13ecd6,_0x4aad4e){var _0x3e2d5f={'role':_0xe081('0x4a')};_0x3e2d5f[_0x1e343e]=this[_0xe081('0xc')][_0xe081('0x37')];this[_0xe081('0xd')]['agentPause'](_0x3e2d5f,_0x13ecd6,this['channel'][_0xe081('0x40')])[_0xe081('0x10')](function(_0x5e80af){_0x4aad4e(null,_['isNil'](_0x5e80af)?![]:!![]);})[_0xe081('0x12')](function(_0x558114){logger[_0xe081('0x30')](_0x558114);_0x4aad4e(null,![]);});};AGIVertices[_0xe081('0x13')]['agentUnpause']=function(_0x28f53a,_0x2cbcda){var _0x302fcc={'role':_0xe081('0x4a')};_0x302fcc[_0x28f53a]=this[_0xe081('0xc')]['callerid'];this[_0xe081('0xd')][_0xe081('0x4b')](_0x302fcc)[_0xe081('0x10')](function(_0x15b50e){_0x2cbcda(null,_[_0xe081('0x44')](_0x15b50e)?![]:!![]);})[_0xe081('0x12')](function(_0x1efda8){logger[_0xe081('0x30')](_0x1efda8);_0x2cbcda(null,![]);});};AGIVertices['prototype'][_0xe081('0x4c')]=function(_0xd3b4be,_0x4a890c){var _0x10ec0b={'role':'agent'};_0x10ec0b[_0xd3b4be]=this[_0xe081('0xc')][_0xe081('0x37')];this[_0xe081('0xd')][_0xe081('0x4c')](_0x10ec0b)[_0xe081('0x10')](function(_0x3d6626){_0x4a890c(null,_['isNil'](_0x3d6626)?![]:!![]);})[_0xe081('0x12')](function(_0xca7628){logger[_0xe081('0x30')](_0xca7628);_0x4a890c(null,![]);});};AGIVertices[_0xe081('0x13')][_0xe081('0x4d')]=function(_0x4fb367,_0x3377ac){var _0x2277d4={'role':_0xe081('0x4a')};_0x2277d4[_0x4fb367]=this[_0xe081('0xc')][_0xe081('0x37')];var _0x5a4711=_0x4fb367!=_0xe081('0x4e')?util[_0xe081('0x27')]('%s/%s@from-sip/n',_0xe081('0x4f'),this[_0xe081('0xc')][_0xe081('0x37')]):undefined;this[_0xe081('0xd')][_0xe081('0x4d')](_0x2277d4,_0x5a4711)[_0xe081('0x10')](function(_0x10340c){_0x3377ac(null,_[_0xe081('0x44')](_0x10340c)?![]:!![]);})[_0xe081('0x12')](function(_0x3719a0){logger['error'](_0x3719a0);_0x3377ac(null,![]);});};AGIVertices[_0xe081('0x13')][_0xe081('0x50')]=function(_0x4204e5,_0x304fca){sh[_0xe081('0x51')](_[_0xe081('0x52')](_0x4204e5),function(_0x100eb0,_0x2872fa){var _0x36f290=_0x2872fa[_0xe081('0x53')](/(\r\n|\n|\r)/gm,'');_0x304fca(null,_0x36f290);});};AGIVertices[_0xe081('0x13')][_0xe081('0x54')]=function(_0x244fcb,_0x3d1d53){scripts['googleCloudTTS'](_0x244fcb[_0xe081('0x55')],_0x244fcb[_0xe081('0x56')]||_0xe081('0x57'),_0x244fcb[_0xe081('0x57')],_0x244fcb[_0xe081('0x58')]||_0xe081('0x59'),_0x244fcb[_0xe081('0x5a')]||_0xe081('0x5b'),_0x244fcb[_0xe081('0x5c')]||_0xe081('0x5d'))[_0xe081('0x10')](function(_0x40dd57){_0x3d1d53(null,_0x40dd57);})[_0xe081('0x12')](function(_0x3c6c99){_0x3d1d53(_0x3c6c99);});};AGIVertices[_0xe081('0x13')]['googleTTS']=function(_0x97e58e,_0x30fa7d){scripts[_0xe081('0x5e')](_0x97e58e[_0xe081('0x57')],_0x97e58e[_0xe081('0x5f')]||'en',0x1)['then'](function(_0x177105){_0x30fa7d(null,_0x177105);})[_0xe081('0x12')](function(_0x2ea29a){_0x30fa7d(_0x2ea29a);});};AGIVertices['prototype'][_0xe081('0x60')]=function(_0x50d5cb,_0x11d06b){var _0x489494={'uri':_0x50d5cb[_0xe081('0x61')],'method':_0x50d5cb[_0xe081('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x50d5cb[_0xe081('0x63')])===_0xe081('0x64')&&parseInt(_0x50d5cb[_0xe081('0x63')])>=0x1?parseInt(_0x50d5cb['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xe081('0x65')](['POST',_0xe081('0x66')],_0x489494[_0xe081('0x62')]['toUpperCase']())){try{_0x489494[_0xe081('0x67')]=_0x50d5cb[_0xe081('0x68')]?JSON[_0xe081('0x69')](_0x50d5cb[_0xe081('0x68')]):{};}catch(_0x4d4168){logger['error'](_0xe081('0x6a'),_0x4d4168);}}try{_0x489494[_0xe081('0x6b')]=_0x50d5cb['rawHeaders']?JSON[_0xe081('0x69')](_0x50d5cb[_0xe081('0x6c')]):{};}catch(_0x4b7258){logger[_0xe081('0x30')](_0xe081('0x6d'),_0x4b7258);}if(_0x50d5cb[_0xe081('0x6e')]){try{var _0x510b70=require(_0x50d5cb[_0xe081('0x6e')])[_0xe081('0x6f')](this,_0x489494);_0x489494[_0xe081('0x70')]=Mustache[_0xe081('0x71')](_0x50d5cb[_0xe081('0x61')],_0x510b70,{},['$$','$$']);if(_0x489494[_0xe081('0x6b')]){_0x489494[_0xe081('0x6b')]=JSON[_0xe081('0x69')](Mustache['render'](JSON[_0xe081('0x72')](_0x489494[_0xe081('0x6b')]),_0x510b70,{},['$$','$$']));}if(_0x489494[_0xe081('0x67')]){_0x489494['body']=JSON['parse'](Mustache[_0xe081('0x71')](JSON[_0xe081('0x72')](_0x489494[_0xe081('0x67')]),_0x510b70,{},['$$','$$']));}}catch(_0x2cc418){logger['error'](_0xe081('0x73'),_0x2cc418);}}rp(_0x489494)[_0xe081('0x10')](function(_0x1f21f8){var _0xe82305={'statusCode':_0x1f21f8['statusCode']||0xc8,'statusMessage':_0x1f21f8[_0xe081('0x74')]||'OK','headers':_0x1f21f8['headers']||{},'body':_0x1f21f8[_0xe081('0x67')]||{}};_0x11d06b(null,_0xe82305);})[_0xe081('0x12')](function(_0x1ae801){var _0x3f5290={'statusCode':_0x1ae801[_0xe081('0x75')]||0x1f4,'statusMessage':_0x1ae801['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1ae801[_0xe081('0x76')][_0xe081('0x6b')]||{},'body':_0x1ae801[_0xe081('0x76')][_0xe081('0x67')]||{}};_0x11d06b(null,_0x3f5290);});};AGIVertices['prototype'][_0xe081('0x77')]=function(_0x57b619,_0x54759a){scripts[_0xe081('0x77')](this[_0xe081('0xc')]['uniqueid'],_0x57b619[_0xe081('0x78')],_0x57b619[_0xe081('0x57')],_0x57b619['dialogflow_language']||'en')[_0xe081('0x10')](function(_0x2e7a0d){_0x54759a(null,_0x2e7a0d);})['catch'](function(_0x4f4d97){_0x54759a(_0x4f4d97);});};AGIVertices['prototype'][_0xe081('0x79')]=function(_0x2153c6,_0x378c8d){scripts[_0xe081('0x79')](this[_0xe081('0xc')]['uniqueid'],_0x2153c6['dialogflowV2_project_id'],_0x2153c6[_0xe081('0x7a')],_0x2153c6[_0xe081('0x7b')],_0x2153c6[_0xe081('0x57')],_0x2153c6['dialogflowV2_language']||'en')[_0xe081('0x10')](function(_0x449d2d){_0x378c8d(null,_0x449d2d);})[_0xe081('0x12')](function(_0x201810){_0x378c8d(_0x201810);});};AGIVertices[_0xe081('0x13')][_0xe081('0x7c')]=function(_0x47e894,_0xbac4){scripts[_0xe081('0x7c')](this[_0xe081('0xc')],_0x47e894)['then'](function(_0x271507){_0xbac4(null,_0x271507);})['catch'](function(_0x4e22a3){_0xbac4(_0x4e22a3);});};AGIVertices[_0xe081('0x13')][_0xe081('0x7d')]=function(_0x3ef06f,_0x3a8027){scripts[_0xe081('0x7d')](_0x3ef06f[_0xe081('0x78')],_0x3ef06f[_0xe081('0x57')],_0x3ef06f[_0xe081('0x7e')]||_0xe081('0x59'),_0x3ef06f['speed'])[_0xe081('0x10')](function(_0x1d5733){_0x3a8027(null,_0x1d5733);})[_0xe081('0x12')](function(_0xdbabe3){_0x3a8027(_0xdbabe3);});};AGIVertices[_0xe081('0x13')][_0xe081('0x7f')]=function(_0x1d4e79,_0x39f1f6,_0x3192f5){scripts[_0xe081('0x7f')](_0x39f1f6,_0x1d4e79[_0xe081('0x78')],_0x1d4e79[_0xe081('0x80')]||'en-US',this[_0xe081('0x81')](_0x1d4e79[_0xe081('0x82')])?_0x1d4e79[_0xe081('0x82')]:undefined)[_0xe081('0x10')](function(_0x14f2b6){_0x3192f5(null,_0x14f2b6);})[_0xe081('0x12')](function(_0x19fddf){_0x3192f5(_0x19fddf);});};AGIVertices['prototype']['awsPolly']=function(_0x11a01d,_0x1ec0e4){scripts[_0xe081('0x83')](_0x11a01d['aws_access_key_id'],_0x11a01d[_0xe081('0x84')],_0x11a01d[_0xe081('0x85')],_0x11a01d[_0xe081('0x86')]||_0xe081('0x87'),_0x11a01d['text'],_0x11a01d[_0xe081('0x88')]||'text')[_0xe081('0x10')](function(_0x9ac0d0){_0x1ec0e4(null,_0x9ac0d0);})['catch'](function(_0x2e65f9){_0x1ec0e4(_0x2e65f9);});};AGIVertices[_0xe081('0x13')][_0xe081('0x89')]=function(_0x1ad08d,_0xc7659){scripts['awsLex'](this[_0xe081('0xc')][_0xe081('0x40')],_0x1ad08d[_0xe081('0x8a')],_0x1ad08d[_0xe081('0x84')],_0x1ad08d[_0xe081('0x8b')],_0x1ad08d[_0xe081('0x57')],_0x1ad08d['aws_bot_name'])[_0xe081('0x10')](function(_0x8008ef){_0xc7659(null,_0x8008ef);})[_0xe081('0x12')](function(_0xee9a94){_0xc7659(_0xee9a94);});};AGIVertices[_0xe081('0x13')][_0xe081('0x8c')]=function(_0x419843,_0x2bafa4,_0x51c2c9){scripts[_0xe081('0x8c')](_0x2bafa4,_0x419843[_0xe081('0x78')],_0x419843['google_asr_language']||_0xe081('0x59'))[_0xe081('0x10')](function(_0x4fbb14){_0x51c2c9(null,_0x4fbb14);})[_0xe081('0x12')](function(_0x780206){_0x51c2c9(_0x780206);});};AGIVertices[_0xe081('0x13')]['tildeASR']=function(_0x3eb10a,_0x188a31,_0x54c9f9){scripts[_0xe081('0x8d')](_0x188a31,_0x3eb10a[_0xe081('0x8e')],_0x3eb10a[_0xe081('0x8f')],_0x3eb10a['uri'])[_0xe081('0x10')](function(_0x565dd3){_0x54c9f9(null,_0x565dd3);})[_0xe081('0x12')](function(_0x43ce2b){_0x54c9f9(_0x43ce2b);});};AGIVertices[_0xe081('0x13')][_0xe081('0x90')]=function(_0x390729){var _0x54d8f4=_[_0xe081('0x65')](verticesWithRetry,_0x390729[_0xe081('0x35')])?_0x390729:_[_0xe081('0x91')](_0x390729);for(var _0x479bfb in _0x54d8f4){if(_0x54d8f4[_0xe081('0x92')](_0x479bfb)){if(_0x54d8f4[_0x479bfb]&&_[_0xe081('0x93')](_0x54d8f4[_0x479bfb])){if(_['includes'](recursiveMapAttributes,_0x479bfb)){_0x54d8f4[_0x479bfb]=this['replaceObjectAllVariables'](_0x54d8f4[_0x479bfb]);}else{_0x54d8f4[_0x479bfb]=this[_0xe081('0x94')](_0x54d8f4[_0x479bfb]);}}}}return _0x54d8f4;};AGIVertices[_0xe081('0x13')][_0xe081('0x95')]=function(_0x1b26a0){for(var _0x1c66b2 in _0x1b26a0){if(_0x1b26a0[_0xe081('0x92')](_0x1c66b2)){if(_['isPlainObject'](_0x1b26a0[_0x1c66b2])){this[_0xe081('0x95')](_0x1b26a0[_0x1c66b2]);}else if(_[_0xe081('0x96')](_0x1b26a0[_0x1c66b2])){for(var _0x50d9ed=0x0;_0x50d9ed<_0x1b26a0[_0x1c66b2][_0xe081('0x97')];_0x50d9ed++){this[_0xe081('0x95')](_0x1b26a0[_0x1c66b2][_0x50d9ed]);}}else if(_['isString'](_0x1b26a0[_0x1c66b2])){_0x1b26a0[_0x1c66b2]=this[_0xe081('0x94')](_0x1b26a0[_0x1c66b2]);}}}};AGIVertices[_0xe081('0x13')][_0xe081('0x98')]=function(_0xfa7307,_0x5c38b5){for(var _0x2d0341 in _0xfa7307){if(_0xfa7307[_0xe081('0x92')](_0x2d0341)){if(_[_0xe081('0x99')](_0xfa7307[_0x2d0341])){if(!_['isEmpty'](_0xfa7307[_0x2d0341])){this[_0xe081('0x98')](_0xfa7307[_0x2d0341],util['format'](_0xe081('0x9a'),_0x5c38b5,_0x2d0341));}}else if(_[_0xe081('0x96')](_0xfa7307[_0x2d0341])){for(var _0xaef74d=0x0;_0xaef74d<_0xfa7307[_0x2d0341][_0xe081('0x97')];_0xaef74d++){this['saveRestApiResult'](_0xfa7307[_0x2d0341][_0xaef74d],util['format'](_0xe081('0x9a'),_0x5c38b5,_0x2d0341+'['+_0xaef74d+']'));}}else{if(!_[_0xe081('0x44')](_0xfa7307[_0x2d0341])){this[_0xe081('0xc')][_0xe081('0x9b')](util['format'](_0xe081('0x9a'),_0x5c38b5,_0x2d0341),_0xfa7307[_0x2d0341]);}}}}};AGIVertices[_0xe081('0x13')]['replaceObjectAllVariables']=function(_0x369387){try{var _0x59038a=JSON['parse'](_0x369387);this[_0xe081('0x95')](_0x59038a);return JSON[_0xe081('0x72')](_0x59038a);}catch(_0x53b084){return this[_0xe081('0x94')](_0x369387);}};AGIVertices[_0xe081('0x13')]['replaceAllVariables']=function(_0x59b67b){var _0x510215=_0x59b67b[_0xe081('0x9c')]('{');for(var _0x516a71=0x1;_0x516a71<_0x510215[_0xe081('0x97')];_0x516a71+=0x1){var _0xe28fed=_0x510215[_0x516a71][_0xe081('0x9c')]('}');if(_0xe28fed[_0xe081('0x97')]>0x1){_0x59b67b=_0x59b67b['replaceAll']('{'+_0xe28fed[0x0]+'}',this['channel']['getVariable'](_0xe28fed[0x0])[_0xe081('0x9d')]||_0xe28fed[0x0]);}}if(_0x510215['length']===0x1){return _0x59b67b[_0xe081('0x48')]();}return this[_0xe081('0x94')](_0x59b67b);};AGIVertices[_0xe081('0x13')][_0xe081('0x9e')]=function(_0x54296f,_0x901a03){var _0x5f4249=this[_0xe081('0xc')][_0xe081('0x9f')](_0x54296f);if(_0x5f4249[_0xe081('0xa0')]===-0x1){return _0x5f4249;}logger['info'](util[_0xe081('0x27')](_0xe081('0xa1'),_0x901a03,_0x5f4249[_0xe081('0x9d')]));return this[_0xe081('0xc')][_0xe081('0x9b')](_0x901a03,_0x5f4249[_0xe081('0x9d')]);};AGIVertices[_0xe081('0x13')]['isConfigured']=function(_0x4a670c){return _0x4a670c&&_0x4a670c!=='0'&&_0x4a670c!=='-1'&&_0x4a670c!=='';};AGIVertices[_0xe081('0x13')][_0xe081('0xa2')]=function(_0x320b0a){this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x320b0a,'-');_0x320b0a[_0xe081('0xa3')]=_0x320b0a[_0xe081('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xe081('0xa4')]=function(_0x4aa440){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xa5'),_0x4aa440[_0xe081('0x34')]));if(!this['isConfigured'](_0x4aa440[_0xe081('0x57')])){return this[_0xe081('0xc')]['noop'](_0xe081('0xa6'));}var _0x1a9656='\x22'+_0x4aa440[_0xe081('0x57')]+'\x22';if(this[_0xe081('0x81')](_0x4aa440[_0xe081('0x76')])){_0x1a9656+=','+_0x4aa440['options'];}var _0x56896a=this['channel'][_0xe081('0x51')](_0xe081('0xa7'),_0x1a9656);if(_0x56896a[_0xe081('0xa0')]===-0x1){return _0x56896a;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xa9'),_0x1a9656));};AGIVertices[_0xe081('0x13')]['mrcprecog']=function(_0x56072){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xaa'),_0x56072[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x56072[_0xe081('0xab')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xac'));}var _0x8f2bb0=_0x56072[_0xe081('0xab')];if(this['isConfigured'](_0x56072[_0xe081('0x76')])){_0x8f2bb0+=','+_0x56072[_0xe081('0x76')];}var _0x25c8b8=this[_0xe081('0xc')][_0xe081('0x51')](_0xe081('0xad'),_0x8f2bb0);if(_0x25c8b8[_0xe081('0xa0')]===-0x1){return _0x25c8b8;}var _0x4def93=this['getAndSetVariable'](_0xe081('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x4def93[_0xe081('0xa0')]===-0x1){return _0x4def93;}var _0x96a6b0=this[_0xe081('0x9e')](_0xe081('0xaf'),_0xe081('0xb0'));if(_0x96a6b0[_0xe081('0xa0')]===-0x1){return _0x96a6b0;}var _0x45a774=this['getAndSetVariable'](_0xe081('0xb1'),_0xe081('0xb2'));if(_0x45a774[_0xe081('0xa0')]===-0x1){return _0x45a774;}return this['channel'][_0xe081('0xa8')](util['format'](_0xe081('0xb3'),_0x8f2bb0));};AGIVertices['prototype'][_0xe081('0x7')]=function(_0x3a528f){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xb4'),_0x3a528f[_0xe081('0x34')]));return this['channel'][_0xe081('0x7')]([_0x3a528f[_0xe081('0xb5')],_0x3a528f['args']]);};AGIVertices[_0xe081('0x13')][_0xe081('0xb6')]=function(_0x58bc61){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xb7'),_0x58bc61[_0xe081('0x34')]));if(this['isConfigured'](_0x58bc61['timeout'])){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xb8'),_0x58bc61[_0xe081('0x63')]));var _0x5ef488=this['channel']['wait'](_0x58bc61[_0xe081('0x63')]);if(_0x5ef488[_0xe081('0xa0')]===-0x1){return _0x5ef488;}}return this[_0xe081('0xc')][_0xe081('0xb6')]();};AGIVertices[_0xe081('0x13')][_0xe081('0xb9')]=function(_0x103b7a){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x103b7a[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x103b7a[_0xe081('0x46')])){return this[_0xe081('0xc')]['error'](_0x103b7a,'no\x20list\x20selected');}_0x103b7a[_0xe081('0x47')]=moment();if(this[_0xe081('0x81')](_0x103b7a[_0xe081('0xba')])){_0x103b7a[_0xe081('0x47')]=moment()[_0xe081('0xbb')](_0x103b7a[_0xe081('0xba')],_0xe081('0xbc'));}if(!this[_0xe081('0x81')](_0x103b7a[_0xe081('0x49')])){_0x103b7a[_0xe081('0x49')]=0x2;}this[_0xe081('0x41')][_0xe081('0x6f')](this,_0x103b7a);return this[_0xe081('0xc')][_0xe081('0xa8')](util['format'](_0xe081('0xbd'),_0x103b7a['phone'],_0x103b7a['list_id'],_0x103b7a[_0xe081('0x47')]));};AGIVertices['prototype']['custom_app']=function(_0x129b0a){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xbe'),_0x129b0a[_0xe081('0x34')]));var _0x3c316d=this[_0xe081('0xc')][_0xe081('0x51')](_0x129b0a[_0xe081('0xbf')],_0x129b0a['options']);if(_0x3c316d[_0xe081('0xa0')]===-0x1){return _0x3c316d;}return this['channel'][_0xe081('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0x129b0a[_0xe081('0xbf')],_0x129b0a[_0xe081('0x76')]));};AGIVertices[_0xe081('0x13')][_0xe081('0xc0')]=function(_0x1d1e5e){logger['info'](util[_0xe081('0x27')](_0xe081('0xc1'),_0x1d1e5e['label']));if(!this['isConfigured'](_0x1d1e5e[_0xe081('0x57')])){return this[_0xe081('0xc')]['noop'](_0xe081('0xa6'));}var _0x342893='\x22'+_0x1d1e5e[_0xe081('0x57')]+'\x22';if(this['isConfigured'](_0x1d1e5e[_0xe081('0x76')])){_0x342893+=','+_0x1d1e5e[_0xe081('0x76')];}var _0x55f1a=this['channel'][_0xe081('0x51')](_0xe081('0xa7'),_0x342893);if(_0x55f1a[_0xe081('0xa0')]===-0x1){return _0x55f1a;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x342893));};AGIVertices[_0xe081('0x13')][_0xe081('0xc2')]=function(_0x42e5a5){logger[_0xe081('0x2c')](util['format'](_0xe081('0xc3'),_0x42e5a5[_0xe081('0x34')]));if(!this['isConfigured'](_0x42e5a5[_0xe081('0x57')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x51aa70='\x22'+_0x42e5a5['text']+'\x22';if(this[_0xe081('0x81')](_0x42e5a5[_0xe081('0x76')])){_0x51aa70+=','+_0x42e5a5[_0xe081('0x76')];}var _0x98bf8d=this[_0xe081('0xc')][_0xe081('0x51')](_0xe081('0xa7'),_0x51aa70);if(_0x98bf8d[_0xe081('0xa0')]===-0x1){return _0x98bf8d;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xa9'),_0x51aa70));};AGIVertices[_0xe081('0x13')][_0xe081('0xc4')]=function(_0x1cdd23){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1cdd23[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x1cdd23[_0xe081('0xab')])){return this[_0xe081('0xc')]['noop'](_0xe081('0xac'));}var _0x43b52c=_0x1cdd23[_0xe081('0xab')];if(this[_0xe081('0x81')](_0x1cdd23['options'])){_0x43b52c+=','+_0x1cdd23[_0xe081('0x76')];}var _0x413601=this[_0xe081('0xc')][_0xe081('0x51')](_0xe081('0xad'),_0x43b52c);if(_0x413601['result']===-0x1){return _0x413601;}var _0x5b6fcd=this[_0xe081('0x9e')]('RECOG_CONFIDENCE()',_0xe081('0xc5'));if(_0x5b6fcd[_0xe081('0xa0')]===-0x1){return _0x5b6fcd;}var _0x412be6=this['getAndSetVariable'](_0xe081('0xaf'),_0xe081('0xc6'));if(_0x412be6[_0xe081('0xa0')]===-0x1){return _0x412be6;}var _0x38ecff=this[_0xe081('0x9e')](_0xe081('0xb1'),_0xe081('0xc7'));if(_0x38ecff[_0xe081('0xa0')]===-0x1){return _0x38ecff;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xb3'),_0x43b52c));};AGIVertices[_0xe081('0x13')][_0xe081('0xc8')]=function(_0x5ca236){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xc9'),_0x5ca236[_0xe081('0x34')]));if(!this['isConfigured'](_0x5ca236[_0xe081('0xab')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xac'));}var _0x29e094=_0x5ca236['grammar'];if(this[_0xe081('0x81')](_0x5ca236[_0xe081('0x76')])){_0x29e094+=','+_0x5ca236['options'];}var _0x24319d=this[_0xe081('0xc')]['exec'](_0xe081('0xad'),_0x29e094);if(_0x24319d[_0xe081('0xa0')]===-0x1){return _0x24319d;}var _0x516e21=this[_0xe081('0x9e')](_0xe081('0xae'),'SESTEK_ASR_CONFIDENCE');if(_0x516e21[_0xe081('0xa0')]===-0x1){return _0x516e21;}var _0xd6e41b=this[_0xe081('0x9e')]('RECOG_INPUT()',_0xe081('0xca'));if(_0xd6e41b[_0xe081('0xa0')]===-0x1){return _0xd6e41b;}var _0x2e4b32=this['getAndSetVariable'](_0xe081('0xb1'),'SESTEK_ASR_INSTANCE');if(_0x2e4b32[_0xe081('0xa0')]===-0x1){return _0x2e4b32;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xb3'),_0x29e094));};AGIVertices[_0xe081('0x13')][_0xe081('0xcb')]=function(_0x5c1f2b){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xcc'),_0x5c1f2b[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x5c1f2b[_0xe081('0xcd')])){return this[_0xe081('0xc')]['error'](_0x5c1f2b,_0xe081('0xce'));}var _0x567043=this['getSquareOdbc'][_0xe081('0x6f')](this,_0x5c1f2b[_0xe081('0xcd')]);if(!_0x567043){return this[_0xe081('0xc')]['error'](_0x5c1f2b,'no\x20odbc\x20database\x20found');}if(!this[_0xe081('0x81')](_0x5c1f2b[_0xe081('0x2d')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x5c1f2b,'no\x20query\x20configured');}var _0x5966b0=_0x5c1f2b[_0xe081('0x2d')][_0xe081('0x53')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0xe081('0x27')](_0xe081('0xcf'),_0x5966b0));var _0xc85a43=this[_0xe081('0x29')][_0xe081('0x6f')](this,_0x567043,_0x5966b0);this[_0xe081('0x33')]['sync'](this,_0x5c1f2b,_0x5966b0);if(!this[_0xe081('0x81')](_0x5c1f2b[_0xe081('0xd0')])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x17e283=this[_0xe081('0x9f')][_0xe081('0x6f')](this,_0x5c1f2b[_0xe081('0xd0')]);if(!_0x17e283){return this[_0xe081('0xc')]['error'](_0x5c1f2b,_0xe081('0xd1'));}var _0x2e4c5d=this;_0xc85a43[_0xe081('0xd2')](function(_0x5608f4,_0x553729){Object['keys'](_0x5608f4)['forEach'](function(_0x5a02a0){_0x2e4c5d[_0xe081('0xc')]['setVariable'](util[_0xe081('0x27')](_0xe081('0xd3'),_0x17e283,_0x553729,_0x5a02a0),_0x5608f4[_0x5a02a0]);});});this[_0xe081('0xc')][_0xe081('0x9b')](util[_0xe081('0x27')](_0xe081('0xd4'),_0x17e283),_0xc85a43[_0xe081('0x97')]);return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')]('variable\x20%s\x20set',_0x17e283));};AGIVertices[_0xe081('0x13')][_0xe081('0xd5')]=function(_0x2d7aaf){logger[_0xe081('0xd6')](util[_0xe081('0x27')](_0xe081('0xd7'),_0x2d7aaf[_0xe081('0x34')]));if(!this['isConfigured'](_0x2d7aaf[_0xe081('0xd8')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x2d7aaf,_0xe081('0xd9'));}var _0xbc6ab1=this[_0xe081('0xda')][_0xe081('0x6f')](this,_0x2d7aaf[_0xe081('0xd8')]);if(!_0xbc6ab1){return this['channel']['error'](_0x2d7aaf,_0xe081('0xdb'));}var _0x25efa2=this[_0xe081('0xc')][_0xe081('0x51')](_0xe081('0xdc'),[util[_0xe081('0x27')](_0xe081('0xdd'),_0xbc6ab1),_0x2d7aaf[_0xe081('0x63')],_0x2d7aaf[_0xe081('0xde')],_0x2d7aaf[_0xe081('0x61')]]);if(_0x25efa2[_0xe081('0xa0')]===-0x1){return _0x25efa2;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xdf'),'DIAL'));};AGIVertices[_0xe081('0x13')]['dialogflow']=function(_0x624e84){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x624e84[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x624e84[_0xe081('0x78')])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20key\x20configured');}if(!this[_0xe081('0x81')](_0x624e84[_0xe081('0x57')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xa6'));}this['channel'][_0xe081('0xe0')]=!![];this[_0xe081('0x33')](_0x624e84);this[_0xe081('0x3f')](_0x624e84[_0xe081('0x57')],'in','','');this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')]('Trying\x20Dialogflow:\x20%s',_0x624e84['text']));var _0xf238b8=this[_0xe081('0x77')][_0xe081('0x6f')](this,_0x624e84);if(_0xf238b8){for(var _0x6f2e22 in _0xf238b8){if(_0xf238b8[_0xe081('0x92')](_0x6f2e22)){this[_0xe081('0xc')]['setVariable'](util[_0xe081('0x27')]('DIALOGFLOW_%s',_0x6f2e22['toUpperCase']()),_0xf238b8[_0x6f2e22]);}}this[_0xe081('0x3f')](_0xf238b8[_0xe081('0xe1')],_0xe081('0xe2'),_0xe081('0xe3'),'');return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xe4'),_0xf238b8['speech']));}return this[_0xe081('0xc')][_0xe081('0x30')](_0x624e84,_0xe081('0xe5'));};AGIVertices['prototype']['dialogflowV2']=function(_0x156db7){logger['info'](util[_0xe081('0x27')](_0xe081('0xe6'),_0x156db7[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x156db7[_0xe081('0xe7')])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20project_id\x20configured');}if(!this[_0xe081('0x81')](_0x156db7['client_email'])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x156db7[_0xe081('0x7b')])){return this['channel'][_0xe081('0xa8')]('no\x20private_key\x20configured');}if(!this[_0xe081('0x81')](_0x156db7[_0xe081('0xe8')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xe9'));}if(!this[_0xe081('0x81')](_0x156db7[_0xe081('0x57')])){return this[_0xe081('0xc')]['noop']('no\x20text\x20configured');}this[_0xe081('0xc')]['bot']=!![];this[_0xe081('0x33')](_0x156db7);this[_0xe081('0x3f')](_0x156db7[_0xe081('0x57')],'in','','');this[_0xe081('0xc')]['noop'](util[_0xe081('0x27')]('Trying\x20DialogflowV2:\x20%s',_0x156db7['text']));var _0xac944f=this['googleDialogflowV2'][_0xe081('0x6f')](this,_0x156db7);if(_0xac944f){for(var _0x1d2413 in _0xac944f){if(_0xac944f[_0xe081('0x92')](_0x1d2413)){if(_0x1d2413!==_0xe081('0xea')){this[_0xe081('0xc')][_0xe081('0x9b')](util[_0xe081('0x27')](_0xe081('0xeb'),_0x1d2413['toUpperCase']()),_0xac944f[_0x1d2413]);}}}this[_0xe081('0x3f')](_0xac944f['speech'],_0xe081('0xe2'),_0xe081('0xec'),_0xac944f['providerResponse']);return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xed'),_0xac944f[_0xe081('0xe1')]));}return this['channel'][_0xe081('0x30')](_0x156db7,_0xe081('0xee'));};AGIVertices[_0xe081('0x13')]['sesteknda']=function(_0x3018d6){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xef'),_0x3018d6[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x3018d6[_0xe081('0xf0')])){return this['channel'][_0xe081('0xa8')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xe081('0x81')](_0x3018d6[_0xe081('0xf1')])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20username\x20configured');}if(!this[_0xe081('0x81')](_0x3018d6[_0xe081('0xf2')])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x3018d6[_0xe081('0xf3')])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20text\x20configured');}this[_0xe081('0xc')][_0xe081('0xe0')]=!![];this['createSquareDetailsReport'](_0x3018d6);this['createSquareMessage'](_0x3018d6[_0xe081('0x57')],'in','','');this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xf4'),_0x3018d6['text']));var _0x4eac0d=this[_0xe081('0x7c')][_0xe081('0x6f')](this,_0x3018d6);if(_0x4eac0d){for(var _0x42e861 in _0x4eac0d){if(_0x4eac0d[_0xe081('0x92')](_0x42e861)){this['channel']['setVariable'](util['format'](_0xe081('0xf5'),_0x42e861[_0xe081('0xf6')]()),_0x4eac0d[_0x42e861]);}}this['createSquareMessage'](_0x4eac0d[_0xe081('0xe1')],_0xe081('0xe2'),_0xe081('0xf7'),'');if(_0x4eac0d[_0xe081('0xf8')]){this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0xf9'),_0x4eac0d['audiofile']));var _0x382666=this[_0xe081('0xc')][_0xe081('0xfa')](_0x4eac0d[_0xe081('0xf8')]);try{fs['unlink'](_0x4eac0d[_0xe081('0xf8')]+'.wav');}catch(_0x2042b1){logger[_0xe081('0x30')](_0x2042b1);}return _0x382666;}else{return this[_0xe081('0xc')][_0xe081('0xa8')](util['format']('SestekNDA\x20Result\x20%s',_0x4eac0d[_0xe081('0xe1')]));}}return this[_0xe081('0xc')][_0xe081('0x30')](_0x3018d6,_0xe081('0xfb'));};AGIVertices[_0xe081('0x13')][_0xe081('0xfc')]=function(_0x5e7145){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xfd'),_0x5e7145[_0xe081('0x34')]));return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xfc'));};AGIVertices[_0xe081('0x13')][_0xe081('0xfe')]=function(_0x51e4a6){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0xff'),_0x51e4a6[_0xe081('0x34')]));var _0x322391='';if(_0x51e4a6[_0xe081('0x100')]){if(!this['isConfigured'](_0x51e4a6[_0xe081('0x100')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x51e4a6,'no\x20trunk\x20selected');}else{var _0x46f84e=parseInt(_0x51e4a6[_0xe081('0x100')],0xa);if(isNaN(_0x46f84e)){_0x322391=_0x51e4a6[_0xe081('0x100')];}else{_0x322391=this[_0xe081('0x1a')]['sync'](this,_0x51e4a6[_0xe081('0x100')]);if(!_0x322391){return this[_0xe081('0xc')][_0xe081('0x30')](_0x51e4a6,_0xe081('0x101'));}}}}else if(_0x51e4a6[_0xe081('0x102')]){_0x322391=_0x51e4a6['trunk_name'];}else{return this[_0xe081('0xc')][_0xe081('0x30')](_0x51e4a6,_0xe081('0x103'));}var _0x1c24bd=this[_0xe081('0xc')][_0xe081('0x51')](_0xe081('0xdc'),[util[_0xe081('0x27')](_0xe081('0x104'),_0x322391,_0x51e4a6['phone']),_0x51e4a6[_0xe081('0x63')],_0x51e4a6[_0xe081('0xde')],_0x51e4a6[_0xe081('0x61')]]);if(_0x1c24bd['result']===-0x1){return _0x1c24bd;}return this['channel']['noop'](util['format'](_0xe081('0xdf'),'DIAL'));};AGIVertices['prototype']['finally']=function(_0x31682d){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x105'),_0x31682d[_0xe081('0x34')]));return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x106'));};AGIVertices[_0xe081('0x13')][_0xe081('0x107')]=function(_0x53195c){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x108'),_0x53195c[_0xe081('0x34')]));if(_0x53195c[_0xe081('0xa3')]===0x0){return this[_0xe081('0xa2')](_0x53195c);}_0x53195c['retry']-=0x1;if(!this[_0xe081('0x81')](_0x53195c['file_id'])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x53195c,'no\x20file\x20audio\x20selected');}var _0x5dee4b=this[_0xe081('0x1c')][_0xe081('0x6f')](this,_0x53195c['file_id']);if(!_0x5dee4b){return this['channel'][_0xe081('0x30')](_0x53195c,_0xe081('0x109'));}if(!this['isConfigured'](_0x53195c['variable_id'])){return this[_0xe081('0xc')]['error'](_0xe081('0x10a'));}var _0x37088f=this[_0xe081('0xc')][_0xe081('0x10b')](_0x5dee4b,_0x53195c[_0xe081('0x10c')],_0x53195c[_0xe081('0x10d')]);var _0x598fae=_0x37088f['result']?_0x37088f[_0xe081('0xa0')][_0xe081('0x48')]():'';logger['info'](_0xe081('0x10e'),JSON[_0xe081('0x72')](_0x37088f));if(_0x37088f['result']===-0x1){this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x53195c,_0x598fae);return _0x37088f;}else if(_0x37088f['extra']==='timeout'){_0x37088f[_0xe081('0xa0')]=_0x598fae[_0xe081('0x97')]>=parseInt(_0x53195c[_0xe081('0x10f')])?'x':'i';}else{_0x37088f[_0xe081('0xa0')]=_0x598fae[_0xe081('0x97')]>=parseInt(_0x53195c[_0xe081('0x10f')])&&_0x598fae[_0xe081('0x97')]<=parseInt(_0x53195c[_0xe081('0x10d')])?'x':'i';}var _0x46221f=this[_0xe081('0x9f')]['sync'](this,_0x53195c[_0xe081('0xd0')]);if(!_0x46221f){return this[_0xe081('0xc')]['error'](_0x53195c,_0xe081('0xd1'));}this['channel'][_0xe081('0x9b')](_0x46221f,_0x598fae);if(this['isConfigured'](_0x53195c['hiddendigitsnum'])){var _0x418dfe=parseInt(_0x53195c[_0xe081('0x110')],0xa);var _0x1c4b2c=rs[_0xe081('0x111')]({'charset':'*','length':_0x418dfe});var _0x1e2ff8=_0x598fae[_0xe081('0x97')];if(_0x1e2ff8>0x0){if(_0x1e2ff8>_0x418dfe){this['createSquareDetailsReport'][_0xe081('0x6f')](this,_0x53195c,_0x53195c[_0xe081('0x112')]===_0xe081('0x113')?_0x1c4b2c+_0x598fae['substr'](_0x418dfe):_0x598fae[_0xe081('0x114')](0x0,_0x1e2ff8-_0x418dfe)+_0x1c4b2c);}else{this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x53195c,rs[_0xe081('0x111')]({'charset':'*','length':_0x1e2ff8}));}}else{this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x53195c,'');}}else{this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x53195c,_0x598fae);}return _0x37088f;};AGIVertices[_0xe081('0x13')]['getsecretdigits']=function(_0xfdee5e){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0xfdee5e[_0xe081('0x34')]));return this[_0xe081('0x107')](_0xfdee5e);};AGIVertices[_0xe081('0x13')][_0xe081('0x115')]=function(_0x1bbc31){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x116'),_0x1bbc31[_0xe081('0x34')]));this['createSquareDetailsReport'][_0xe081('0x6f')](this,_0x1bbc31,_0x1bbc31[_0xe081('0x117')]);return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x118'),_0x1bbc31[_0xe081('0x117')]));};AGIVertices[_0xe081('0x13')][_0xe081('0x119')]=function(_0x10a631){logger['info'](util[_0xe081('0x27')](_0xe081('0x11a'),_0x10a631[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x10a631['aws_access_key_id'])||!this[_0xe081('0x81')](_0x10a631[_0xe081('0x84')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x11b'));}if(!this['isConfigured'](_0x10a631[_0xe081('0x57')])){return this['channel'][_0xe081('0xa8')](_0xe081('0xa6'));}this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x11c'),_0x10a631[_0xe081('0x57')]));var _0x49d743=this['awsPolly'][_0xe081('0x6f')](this,_0x10a631);if(_0x49d743){this['channel']['noop'](util[_0xe081('0x27')](_0xe081('0x11d'),_0x49d743));var _0x53abfb=this['channel'][_0xe081('0xfa')](_0x49d743);try{fs[_0xe081('0x11e')](_0x49d743+_0xe081('0x11f'));}catch(_0x405378){logger[_0xe081('0x30')](_0x405378);}return _0x53abfb;}return this[_0xe081('0xc')][_0xe081('0x30')](_0x10a631,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xe081('0x13')]['awslex']=function(_0x5f13ba){logger[_0xe081('0x2c')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5f13ba['label']));if(!this[_0xe081('0x81')](_0x5f13ba['aws_access_key_id'])||!this[_0xe081('0x81')](_0x5f13ba['aws_secret_access_key'])){return this[_0xe081('0xc')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xe081('0x81')](_0x5f13ba['aws_bot_name'])){return this[_0xe081('0xc')]['noop'](_0xe081('0x120'));}if(!this[_0xe081('0x81')](_0x5f13ba['text'])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xa6'));}this['channel'][_0xe081('0xe0')]=!![];this['createSquareDetailsReport'](_0x5f13ba);this[_0xe081('0x3f')](_0x5f13ba[_0xe081('0x57')],'in','','');this['channel'][_0xe081('0xa8')](util[_0xe081('0x27')]('Trying\x20Amazon\x20Lex:\x20%s',_0x5f13ba[_0xe081('0x57')]));var _0x39cf2e=this['awsLex'][_0xe081('0x6f')](this,_0x5f13ba);if(_0x39cf2e){for(var _0x4921e8 in _0x39cf2e){if(_0x39cf2e['hasOwnProperty'](_0x4921e8)&&_[_0xe081('0x93')](_0x39cf2e[_0x4921e8])){this['channel'][_0xe081('0x9b')](util['format'](_0xe081('0x121'),_0x4921e8[_0xe081('0xf6')]()),_0x39cf2e[_0x4921e8]);}}if(_['isNil'](_0x39cf2e[_0xe081('0x122')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x123'));}else{this[_0xe081('0x3f')](_0x39cf2e[_0xe081('0x122')],'out',_0xe081('0x124'),'');return this[_0xe081('0xc')][_0xe081('0xa8')](util['format'](_0xe081('0x125'),_0x39cf2e[_0xe081('0x122')]));}}return this[_0xe081('0xc')][_0xe081('0x30')](_0x5f13ba,_0xe081('0x126'));};AGIVertices[_0xe081('0x13')]['googleasr']=function(_0x3aac5a){logger[_0xe081('0x2c')](util['format'](_0xe081('0x127'),_0x3aac5a[_0xe081('0x34')],_0x3aac5a[_0xe081('0x63')]));if(!this[_0xe081('0x81')](_0x3aac5a['key'])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x128'));}var _0x5a564c='wav';var _0x2a8c4b=util[_0xe081('0x27')](_0xe081('0x129'),FILES_PATH,rs[_0xe081('0x111')](0x4));var _0x33b8c0=util[_0xe081('0x27')]('%s.%s',_0x2a8c4b,_0x5a564c);var _0x136b32=!![];if(_0x3aac5a[_0xe081('0x12a')]===_0xe081('0x12b')){_0x136b32=![];}var _0x7fc488=this['channel'][_0xe081('0x12c')](_0x2a8c4b,_0x5a564c,_0x3aac5a['intKey'],_0x3aac5a[_0xe081('0x63')],undefined,_0x136b32);if(_0x7fc488['result']!==-0x1){this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x12d'),_0x33b8c0));var _0x5cdfb4=this[_0xe081('0x8c')]['sync'](this,_0x3aac5a,_0x33b8c0);if(_0x5cdfb4){for(var _0x363283 in _0x5cdfb4){if(_0x5cdfb4[_0xe081('0x92')](_0x363283)){this[_0xe081('0xc')][_0xe081('0x9b')](util[_0xe081('0x27')]('GOOGLE_ASR_%s',_0x363283['toUpperCase']()),_0x5cdfb4[_0x363283]);}}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x12e'),JSON[_0xe081('0x72')](_0x5cdfb4)));}}return _0x7fc488;};AGIVertices['prototype'][_0xe081('0x12f')]=function(_0x8b4ab7){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x8b4ab7[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x8b4ab7[_0xe081('0x8e')])){return this[_0xe081('0xc')]['noop']('no\x20appid\x20configured');}if(!this[_0xe081('0x81')](_0x8b4ab7[_0xe081('0x8f')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x130'));}var _0x31b561=_0xe081('0x131');var _0x255866=util[_0xe081('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0xe081('0x111')](0x4));var _0x5be994=util[_0xe081('0x27')]('%s.%s',_0x255866,_0x31b561);var _0x475de4=!![];if(_0x8b4ab7['beep']==='NOBEEP'){_0x475de4=![];}var _0x72403e=this[_0xe081('0xc')][_0xe081('0x12c')](_0x255866,_0x31b561,_0x8b4ab7[_0xe081('0x132')],_0x8b4ab7[_0xe081('0x63')],undefined,_0x475de4);if(_0x72403e[_0xe081('0xa0')]!==-0x1){this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x133'),_0x5be994));var _0x98d5d0=this[_0xe081('0x8d')]['sync'](this,_0x8b4ab7,_0x5be994);if(_0x98d5d0){for(var _0x34b18d in _0x98d5d0){if(_0x98d5d0[_0xe081('0x92')](_0x34b18d)){this[_0xe081('0xc')][_0xe081('0x9b')](util[_0xe081('0x27')](_0xe081('0x134'),_0x34b18d[_0xe081('0xf6')]()),_0x98d5d0[_0x34b18d]);}}return this['channel']['noop'](util[_0xe081('0x27')](_0xe081('0x135'),JSON[_0xe081('0x72')](_0x98d5d0)));}}return _0x72403e;};AGIVertices['prototype'][_0xe081('0x136')]=function(_0x228c75){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x228c75[_0xe081('0x34')]));return this[_0xe081('0xc')]['continueAt'](_0x228c75['context'],_0x228c75[_0xe081('0x3a')],_0x228c75[_0xe081('0x3b')]);};AGIVertices[_0xe081('0x13')][_0xe081('0x137')]=function(_0x3dfc2a){logger['info'](util[_0xe081('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3dfc2a['label']));if(!this[_0xe081('0x81')](_0x3dfc2a[_0xe081('0x138')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x3dfc2a,_0xe081('0x139'));}try{var _0x4e7c38=eval(_0x3dfc2a['condition'])?_0xe081('0x13a'):_0xe081('0x13b');this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x13c'),_0x3dfc2a[_0xe081('0x138')],_0x4e7c38));return{'code':0xc8,'result':_0x4e7c38};}catch(_0x1e1ffe){return{'code':0xc8,'result':_0xe081('0x13b')};}};AGIVertices['prototype']['gotoiftime']=function(_0x172802){logger[_0xe081('0x2c')](util['format'](_0xe081('0x13d'),_0x172802[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x172802[_0xe081('0x13e')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x172802,'no\x20interval\x20configured');}var _0xf60c93=this['getIntervals'][_0xe081('0x6f')](this,_0x172802[_0xe081('0x13e')]);if(!_0xf60c93){return this[_0xe081('0xc')][_0xe081('0x30')](_0x172802,_0xe081('0x13f'));}for(var _0xb14222=0x0;_0xb14222<_0xf60c93[_0xe081('0x97')];_0xb14222+=0x1){var _0x2979c6=this[_0xe081('0xc')]['getVariable'](util[_0xe081('0x27')](_0xe081('0x140'),_0xf60c93[_0xb14222]));if(_0x2979c6[_0xe081('0xa0')]===-0x1){return _0x2979c6;}logger['info'](util[_0xe081('0x27')](_0xe081('0x141'),_0xf60c93[_0xb14222],_0x2979c6[_0xe081('0x9d')]));if(_0x2979c6['extra']==='true'){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x141'),_0xf60c93[_0xb14222],'true'));this[_0xe081('0xc')]['noop'](util[_0xe081('0x27')](_0xe081('0x141'),_0xf60c93[_0xb14222],_0xe081('0x13a')));return{'code':0xc8,'result':_0xe081('0x13a')};}else{logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x141'),_0xf60c93[_0xb14222],_0xe081('0x13b')));this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x141'),_0xf60c93[_0xb14222],_0xe081('0x13b')));}}return{'code':0xc8,'result':_0xe081('0x13b')};};AGIVertices[_0xe081('0x13')][_0xe081('0x142')]=function(_0x484cdd){logger[_0xe081('0x2c')](util['format'](_0xe081('0x143'),_0x484cdd['label']));return this[_0xe081('0xc')][_0xe081('0x142')]();};AGIVertices[_0xe081('0x13')][_0xe081('0x144')]=function(_0x6c0166){logger['info'](util[_0xe081('0x27')](_0xe081('0x145'),_0x6c0166[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x6c0166[_0xe081('0x78')])){return this['channel'][_0xe081('0xa8')]('no\x20key\x20configured');}var _0x1f2962=_0xe081('0x131');var _0xfda742=util['format'](_0xe081('0x129'),FILES_PATH,rs[_0xe081('0x111')](0x4));var _0x3ddc85=util[_0xe081('0x27')](_0xe081('0x9a'),_0xfda742,_0x1f2962);var _0x48d412=!![];if(_0x6c0166['beep']===_0xe081('0x12b')){_0x48d412=![];}var _0x1b519d=this[_0xe081('0xc')][_0xe081('0x12c')](_0xfda742,_0x1f2962,_0x6c0166['intKey'],_0x6c0166[_0xe081('0x63')],undefined,_0x48d412);if(_0x1b519d[_0xe081('0xa0')]!==-0x1){this[_0xe081('0xc')][_0xe081('0xa8')](util['format'](_0xe081('0x146'),_0x3ddc85));var _0x4e1769=this['ispeechASR']['sync'](this,_0x6c0166,_0x3ddc85);if(_0x4e1769){for(var _0x12b9be in _0x4e1769){if(_0x4e1769[_0xe081('0x92')](_0x12b9be)){this[_0xe081('0xc')]['setVariable'](util['format'](_0xe081('0x147'),_0x12b9be[_0xe081('0xf6')]()),_0x4e1769[_0x12b9be]);}}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x148'),JSON['stringify'](_0x4e1769)));}}return _0x1b519d;};AGIVertices[_0xe081('0x13')]['ispeechtts']=function(_0x50f3b8){logger[_0xe081('0x2c')](util['format'](_0xe081('0x149'),_0x50f3b8[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x50f3b8[_0xe081('0x78')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x128'));}if(!this['isConfigured'](_0x50f3b8[_0xe081('0x57')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xa6'));}this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x14a'),_0x50f3b8['text']));var _0x50177b=this[_0xe081('0x7d')][_0xe081('0x6f')](this,_0x50f3b8);if(_0x50177b){this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')]('ispeech\x20%s\x20file\x20created',_0x50177b));var _0x3c5cba=this['channel']['streamFile'](_0x50177b,_0x50f3b8['intKey']);try{fs['unlink'](_0x50177b+_0xe081('0x11f'));}catch(_0x792123){logger[_0xe081('0x30')](_0x792123);}return _0x3c5cba;}return this[_0xe081('0xc')][_0xe081('0x30')](_0x50f3b8,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xe081('0x13')][_0xe081('0x14b')]=function(_0x3cc868){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x14c'),_0x3cc868[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x3cc868[_0xe081('0x14d')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x3cc868,_0xe081('0x14e'));}logger[_0xe081('0x2c')](util[_0xe081('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xe081('0xc')]['callerid'],_0x3cc868[_0xe081('0x14d')]));var _0x310a03=this[_0xe081('0x4d')][_0xe081('0x6f')](this,_0x3cc868['findBy']);if(_0x310a03){logger[_0xe081('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe081('0x37')],_0x3cc868[_0xe081('0x14d')]));this[_0xe081('0xc')][_0xe081('0xa8')](util['format'](_0xe081('0x14f'),this[_0xe081('0xc')][_0xe081('0x37')],_0x3cc868['findBy']));return{'code':0xc8,'result':_0xe081('0x150')};}else{logger['info'](util[_0xe081('0x27')](_0xe081('0x151'),this[_0xe081('0xc')][_0xe081('0x37')],_0x3cc868[_0xe081('0x14d')]));this[_0xe081('0xc')]['noop'](util[_0xe081('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe081('0xc')][_0xe081('0x37')],_0x3cc868['findBy']));return{'code':0xc8,'result':_0xe081('0x152')};}};AGIVertices[_0xe081('0x13')][_0xe081('0x153')]=function(_0x1c8507){logger['info'](util[_0xe081('0x27')](_0xe081('0x154'),_0x1c8507[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x1c8507['findBy'])){return this['channel'][_0xe081('0x30')](_0x1c8507,_0xe081('0x14e'));}logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x155'),this[_0xe081('0xc')]['callerid'],_0x1c8507[_0xe081('0x14d')]));var _0x25b237=this[_0xe081('0x4c')][_0xe081('0x6f')](this,_0x1c8507[_0xe081('0x14d')]);if(_0x25b237){logger['info'](util[_0xe081('0x27')](_0xe081('0x14f'),this[_0xe081('0xc')][_0xe081('0x37')],_0x1c8507[_0xe081('0x14d')]));this[_0xe081('0xc')]['noop'](util['format'](_0xe081('0x14f'),this[_0xe081('0xc')]['callerid'],_0x1c8507['findBy']));return{'code':0xc8,'result':_0xe081('0x150')};}else{logger['info'](util['format'](_0xe081('0x151'),this[_0xe081('0xc')]['callerid'],_0x1c8507[_0xe081('0x14d')]));this[_0xe081('0xc')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe081('0xc')][_0xe081('0x37')],_0x1c8507[_0xe081('0x14d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe081('0x13')][_0xe081('0x156')]=function(_0x184b7f){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x184b7f[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x184b7f[_0xe081('0x157')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x184b7f,_0xe081('0x158'));}this['channel'][_0xe081('0xa8')](util[_0xe081('0x27')]('math\x20%s',_0x184b7f['operation']));var _0x3a9068=eval(_0x184b7f[_0xe081('0x157')]);if(!this[_0xe081('0x81')](_0x184b7f[_0xe081('0xd0')])){return this['channel']['noop'](_0xe081('0x10a'));}var _0x1ee833=this[_0xe081('0x9f')]['sync'](this,_0x184b7f['variable_id']);if(!_0x1ee833){return this[_0xe081('0xc')]['error'](_0x184b7f,'no\x20variable\x20found');}if(_[_0xe081('0x96')](_0x3a9068)){var _0x300042=this;_0x3a9068[_0xe081('0xd2')](function(_0x123308,_0x4e52ab){_0x300042[_0xe081('0xc')][_0xe081('0x9b')](util[_0xe081('0x27')](_0xe081('0x159'),_0x1ee833,_0x4e52ab),_0x123308);});return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x15a'),_0x1ee833));}else{return this[_0xe081('0xc')][_0xe081('0x9b')](_0x1ee833,_0x3a9068);}};AGIVertices[_0xe081('0x13')][_0xe081('0x15b')]=function(_0x7ab9ac){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x15c'),_0x7ab9ac[_0xe081('0x34')]));if(_0x7ab9ac[_0xe081('0xa3')]===0x0){return this[_0xe081('0xa2')](_0x7ab9ac);}_0x7ab9ac[_0xe081('0xa3')]-=0x1;if(!this['isConfigured'](_0x7ab9ac[_0xe081('0x15d')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x7ab9ac,_0xe081('0x15e'));}var _0x222978=this[_0xe081('0x1c')]['sync'](this,_0x7ab9ac['file_id']);if(!_0x222978){return this[_0xe081('0xc')]['error'](_0x7ab9ac,_0xe081('0x109'));}var _0x18bd30=this[_0xe081('0xc')][_0xe081('0x10b')](_0x222978,_0x7ab9ac['response'],_0x7ab9ac[_0xe081('0x15f')]);var _0x30e391=_0x18bd30['result'];if(_0x18bd30[_0xe081('0xa0')]===-0x1){this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x7ab9ac,'-1');return _0x18bd30;}else if(_0x18bd30['extra']===_0xe081('0x63')){_0x18bd30['result']=_0x18bd30[_0xe081('0xa0')][_0xe081('0x97')]>0x0?_0x18bd30[_0xe081('0xa0')]:'t';}else if(_['isEmpty'](_0x18bd30[_0xe081('0xa0')])){_0x18bd30[_0xe081('0xa0')]='#';_0x30e391='#';}if(!this[_0xe081('0x81')](_0x7ab9ac['variable_id'])){this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x9c3e86=this[_0xe081('0x9f')]['sync'](this,_0x7ab9ac['variable_id']);if(!_0x9c3e86){return this['channel'][_0xe081('0x30')](_0x7ab9ac,'no\x20variable\x20found');}this[_0xe081('0xc')][_0xe081('0x9b')](_0x9c3e86,_0x30e391);}this['createSquareDetailsReport']['sync'](this,_0x7ab9ac,_0x30e391);return _0x18bd30;};AGIVertices['prototype']['noop']=function(_0x1e8ff9){logger[_0xe081('0x2c')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x1e8ff9['label']));return this['channel'][_0xe081('0xa8')](_0x1e8ff9[_0xe081('0x160')]||_0x1e8ff9[_0xe081('0x34')]);};AGIVertices[_0xe081('0x13')][_0xe081('0x161')]=function(_0x5ebded){logger['info'](util[_0xe081('0x27')](_0xe081('0x162'),_0x5ebded['label']));if(!this[_0xe081('0x81')](_0x5ebded[_0xe081('0x14d')])){return this[_0xe081('0xc')]['error'](_0x5ebded,_0xe081('0x14e'));}logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x155'),this[_0xe081('0xc')][_0xe081('0x37')],_0x5ebded['findBy']));var _0x362786=this[_0xe081('0x163')]['sync'](this,_0x5ebded[_0xe081('0x164')]);var _0x51c89f=this[_0xe081('0x165')]['sync'](this,_0x5ebded['findBy'],_0x362786);if(_0x51c89f){logger['info'](util[_0xe081('0x27')](_0xe081('0x14f'),this[_0xe081('0xc')][_0xe081('0x37')],_0x5ebded[_0xe081('0x14d')]));this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x14f'),this['channel'][_0xe081('0x37')],_0x5ebded[_0xe081('0x14d')]));return{'code':0xc8,'result':_0xe081('0x150')};}else{logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x151'),this['channel'][_0xe081('0x37')],_0x5ebded[_0xe081('0x14d')]));this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x14f'),this[_0xe081('0xc')][_0xe081('0x37')],_0x5ebded[_0xe081('0x14d')]));return{'code':0xc8,'result':_0xe081('0x152')};}};AGIVertices[_0xe081('0x13')][_0xe081('0x166')]=function(_0x44b812){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x167'),_0x44b812[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x44b812[_0xe081('0x15d')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x44b812,_0xe081('0x15e'));}var _0xfa8722=this[_0xe081('0x1c')]['sync'](this,_0x44b812[_0xe081('0x15d')]);if(!_0xfa8722){return this[_0xe081('0xc')]['error'](_0x44b812,'no\x20file\x20audio\x20found');}var _0x2df2f4=this[_0xe081('0xc')][_0xe081('0x51')](_0xe081('0x168'),[_0xfa8722,_0x44b812[_0xe081('0xde')]]);if(_0x2df2f4[_0xe081('0xa0')]===-0x1){return _0x2df2f4;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x169'),'PLAYBACK',_0xfa8722));};AGIVertices[_0xe081('0x13')][_0xe081('0x16a')]=function(_0x299d26){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x299d26[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x299d26['queue_id'])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x299d26,_0xe081('0x16b'));}var _0x26a805='';var _0x55dff0=parseInt(_0x299d26[_0xe081('0x16c')],0xa);if(isNaN(_0x55dff0)){_0x26a805=_0x299d26[_0xe081('0x16c')];}else{_0x26a805=this[_0xe081('0x14')][_0xe081('0x6f')](this,_0x299d26[_0xe081('0x16c')]);if(!_0x26a805){return this[_0xe081('0xc')][_0xe081('0x30')](_0x299d26,_0xe081('0x16d'));}}var _0x33a286='';if(this[_0xe081('0x81')](_0x299d26['file_id'])){var _0x5b4e91=this['getSound']['sync'](this,_0x299d26[_0xe081('0x15d')]);if(_0x5b4e91){_0x33a286=_0x5b4e91;}}this[_0xe081('0x33')]['sync'](this,_0x299d26,_0x26a805);if(_0x299d26[_0xe081('0xde')]['indexOf']('x')<0x0){_0x299d26[_0xe081('0xde')]+='x';}if(_0x299d26[_0xe081('0xde')]['indexOf']('X')<0x0){_0x299d26[_0xe081('0xde')]+='X';}this[_0xe081('0xc')][_0xe081('0x9b')](_0xe081('0x16e'),_0x26a805?_0x26a805[_0xe081('0x16f')]():'');var _0x3ff3d8=this[_0xe081('0xc')]['exec'](_0xe081('0x170'),[_0x26a805,_0x299d26[_0xe081('0xde')],_0x299d26[_0xe081('0x61')],_0x33a286,_0x299d26[_0xe081('0x63')],_0x299d26['agi'],_0x299d26['macro'],_0x299d26[_0xe081('0x171')],'',_0x299d26[_0xe081('0x172')]]);if(_0x3ff3d8['result']===-0x1){return _0x3ff3d8;}return this[_0xe081('0xc')][_0xe081('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0xe081('0x170'),_0x26a805));};AGIVertices[_0xe081('0x13')][_0xe081('0x173')]=function(_0x458c66){logger[_0xe081('0x2c')](util['format'](_0xe081('0x174'),_0x458c66[_0xe081('0x34')]));var _0x1ab200=_0x458c66[_0xe081('0x175')]||_0xe081('0x131');var _0x55f041=util['format'](_0xe081('0x176'),this['channel'][_0xe081('0x40')],rs[_0xe081('0x111')](0x5));var _0x5b04a0=util[_0xe081('0x27')](_0xe081('0x177'),FILES_PATH,_0x55f041,_0x1ab200);var _0x584b0c=util[_0xe081('0x27')](_0xe081('0x129'),FILES_PATH,_0x55f041);this[_0xe081('0x38')][_0xe081('0x6f')](this,_0x458c66,_0x55f041,_0x5b04a0);this[_0xe081('0xc')]['setVariable'](_0xe081('0x178'),_0x55f041);logger[_0xe081('0x2c')](_0xe081('0x179'),_0x584b0c,_0x1ab200,_0x458c66['escape_digits'],_0x458c66[_0xe081('0x63')]);return this[_0xe081('0xc')]['recordFile'](_0x584b0c,_0x1ab200,_0x458c66[_0xe081('0x17a')],_0x458c66[_0xe081('0x63')],undefined,!![]);};AGIVertices[_0xe081('0x13')]['restapi']=function(_0x2ee95c){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x17b'),_0x2ee95c[_0xe081('0x34')]));if(!this['isConfigured'](_0x2ee95c[_0xe081('0x61')])){return this['channel']['noop']('no\x20url\x20configured');}var _0x3ca28e=this[_0xe081('0x60')]['sync'](this,_0x2ee95c);logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x17c'),util['inspect'](_0x3ca28e,{'showHidden':![],'depth':null})));if(!this[_0xe081('0x81')](_0x2ee95c[_0xe081('0xd0')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x17d'));}var _0xbab63b=this[_0xe081('0x9f')][_0xe081('0x6f')](this,_0x2ee95c[_0xe081('0xd0')]);if(!_0xbab63b){return this[_0xe081('0xc')][_0xe081('0x30')](_0x2ee95c,'no\x20variable\x20found');}this[_0xe081('0xc')][_0xe081('0x9b')](util[_0xe081('0x27')](_0xe081('0x17e'),_0xbab63b),_0x3ca28e[_0xe081('0x75')]?_0x3ca28e[_0xe081('0x75')]:_0xe081('0x17f'));this[_0xe081('0xc')][_0xe081('0x9b')](util[_0xe081('0x27')](_0xe081('0x180'),_0xbab63b),_0x3ca28e['statusMessage']?_0x3ca28e[_0xe081('0x74')]:'OK');if(_0x3ca28e['body']){try{this[_0xe081('0x98')](_0x3ca28e[_0xe081('0x67')],_0xbab63b);}catch(_0x22b076){logger['error'](util[_0xe081('0x27')](_0xe081('0x181'),_0xbab63b));}}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x182'),_0xbab63b));};AGIVertices['prototype'][_0xe081('0x183')]=function(_0x306a9a){logger['info'](util['format'](_0xe081('0x184'),_0x306a9a[_0xe081('0x34')]));return this['channel']['sayDigits'](_0x306a9a[_0xe081('0x185')][_0xe081('0x53')](/\s+/g,''),_0x306a9a[_0xe081('0x17a')]);};AGIVertices['prototype'][_0xe081('0x186')]=function(_0x255e63){logger['info'](util[_0xe081('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x255e63[_0xe081('0x34')]));return this[_0xe081('0xc')][_0xe081('0x187')](_0x255e63[_0xe081('0x64')][_0xe081('0x53')](/\s+/g,''),_0x255e63[_0xe081('0x17a')]);};AGIVertices[_0xe081('0x13')][_0xe081('0x188')]=function(_0xd75608){logger['info'](util[_0xe081('0x27')](_0xe081('0x189'),_0xd75608[_0xe081('0x34')]));return this[_0xe081('0xc')][_0xe081('0x18a')](_0xd75608[_0xe081('0x57')],_0xd75608[_0xe081('0x17a')]);};AGIVertices[_0xe081('0x13')][_0xe081('0x18b')]=function(_0x460eae){logger['info'](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x460eae['label']));if(!this[_0xe081('0x81')](_0x460eae[_0xe081('0x18c')])){return this[_0xe081('0xc')][_0xe081('0xa8')]('no\x20mail\x20account\x20configured');}var _0x31ec39=this['getMailAccount'][_0xe081('0x6f')](this,_0x460eae[_0xe081('0x18c')]);if(!_0x31ec39||!_0x31ec39[_0xe081('0x18d')]){return this[_0xe081('0xc')][_0xe081('0x30')](_0x460eae,_0xe081('0x18e'));}var _0x4f32d7={'from':util[_0xe081('0x27')]('\x22%s\x22\x20<%s>',_0x31ec39[_0xe081('0x11')],_0x31ec39[_0xe081('0x18f')]||_0x31ec39['Smtp'][_0xe081('0x190')]),'to':_0x460eae['to']||'','cc':_0x460eae['cc']||'','bcc':_0x460eae['bcc']||'','subject':_0x460eae['subject'],'html':_0x460eae[_0xe081('0x57')],'text':_0x460eae[_0xe081('0x57')]};if(this['isConfigured'](_0x460eae[_0xe081('0x191')])){}logger[_0xe081('0xd6')](_0xe081('0x192'),JSON[_0xe081('0x72')](_0x4f32d7));this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x460eae,_0x460eae['account_id']);this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x193'),_0x31ec39[_0xe081('0x11')]));this[_0xe081('0x21')][_0xe081('0x6f')](this,_0x31ec39[_0xe081('0x194')],_0x4f32d7);return this['channel'][_0xe081('0xa8')](_0xe081('0x195'));};AGIVertices[_0xe081('0x13')][_0xe081('0x196')]=function(_0xf92cb1){logger['info'](util[_0xe081('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0xf92cb1[_0xe081('0x34')]));return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x197'));};AGIVertices[_0xe081('0x13')][_0xe081('0x198')]=function(_0x273eeb){logger[_0xe081('0x2c')](util['format'](_0xe081('0x199'),_0x273eeb['label']));if(!this[_0xe081('0x81')](_0x273eeb[_0xe081('0x19a')])){return this[_0xe081('0xc')]['noop'](_0xe081('0x19b'));}var _0x49f682=this[_0xe081('0x19c')][_0xe081('0x6f')](this,_0x273eeb[_0xe081('0x19a')]);if(!_0x49f682){return this[_0xe081('0xc')][_0xe081('0x30')](_0x273eeb,'no\x20sms\x20account\x20found');}var _0x55d689={'body':_0x273eeb[_0xe081('0x19d')],'phone':_0x273eeb['to']||'','SmsAccountId':_0x49f682['id']};logger['debug']('sendSMS\x20message',JSON[_0xe081('0x72')](_0x55d689));this['createSquareDetailsReport'][_0xe081('0x6f')](this,_0x273eeb,_0x273eeb[_0xe081('0x19a')]);this['channel'][_0xe081('0xa8')](util[_0xe081('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x49f682['name']));this[_0xe081('0x32')]['sync'](this,_0x55d689);return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x19e'));};AGIVertices[_0xe081('0x13')][_0xe081('0x19f')]=function(_0x10cb0f){logger[_0xe081('0x2c')](util['format'](_0xe081('0x1a0'),_0x10cb0f[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x10cb0f[_0xe081('0xd0')])){return this['channel'][_0xe081('0x30')](_0x10cb0f,'no\x20variable\x20selected');}var _0x39e46a=this[_0xe081('0x9f')]['sync'](this,_0x10cb0f[_0xe081('0xd0')]);if(!_0x39e46a){return this[_0xe081('0xc')]['error'](_0x10cb0f,'no\x20variable\x20found');}return this[_0xe081('0xc')]['setVariable'](_0x39e46a,_0x10cb0f[_0xe081('0x1a1')]);};AGIVertices[_0xe081('0x13')][_0xe081('0x1a2')]=function(_0x212543){logger[_0xe081('0x2c')](util['format'](_0xe081('0x1a3'),_0x212543[_0xe081('0x34')]));this['channel'][_0xe081('0xa8')](_0xe081('0x1a4'));if(_0x212543[_0xe081('0xb6')]===_0xe081('0x1a5')){this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x1a6'));return this[_0xe081('0xc')][_0xe081('0xb6')]();}return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x1a7'));};AGIVertices[_0xe081('0x13')]['subproject']=function(_0x78c236){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x1a8'),_0x78c236['label']));if(!this[_0xe081('0x81')](_0x78c236[_0xe081('0x1a9')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x78c236,_0xe081('0x1aa'));}var _0x3d3625=this[_0xe081('0x16')][_0xe081('0x6f')](this,_0x78c236['project_id']);if(!this[_0xe081('0x81')](_0x3d3625)){return this[_0xe081('0xc')]['error'](_0x78c236,util['format'](_0xe081('0x1ab'),_0x78c236['project_id']));}if(_0x3d3625===this[_0xe081('0xc')][_0xe081('0x36')]){return this['channel'][_0xe081('0x30')](_0x78c236,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x78c236,_0x3d3625);var _0x5e652a=this['channel'][_0xe081('0x51')](_0xe081('0x1ac'),util[_0xe081('0x27')](_0xe081('0x1ad'),config[_0xe081('0x7')][_0xe081('0x1ae')]||_0xe081('0x1af'),_0x3d3625,this[_0xe081('0xc')][_0xe081('0x36')]));if(_0x5e652a['result']===-0x1){return _0x5e652a;}return this['channel'][_0xe081('0xa8')](util['format']('Executed\x20command\x20%s\x20%s','AGI',_0x3d3625));};AGIVertices[_0xe081('0x13')]['system']=function(_0x37d7d6){logger['info'](util[_0xe081('0x27')](_0xe081('0x1b0'),_0x37d7d6[_0xe081('0x34')]));var _0x2a94fe=this[_0xe081('0x50')][_0xe081('0x6f')](this,_0x37d7d6[_0xe081('0xb5')]);this[_0xe081('0x33')][_0xe081('0x6f')](this,_0x37d7d6,_0x37d7d6[_0xe081('0xb5')]);if(this[_0xe081('0x81')](_0x37d7d6[_0xe081('0xd0')])){var _0x29ccc6=this[_0xe081('0x9f')][_0xe081('0x6f')](this,_0x37d7d6[_0xe081('0xd0')]);if(_0x29ccc6){this[_0xe081('0xc')][_0xe081('0x9b')](_0x29ccc6,_0x2a94fe);return this['channel']['noop'](util['format'](_0xe081('0x1b1'),_0x37d7d6[_0xe081('0xb5')],_0x29ccc6));}}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x1b2'),_0x37d7d6[_0xe081('0xb5')]));};AGIVertices[_0xe081('0x13')]['google_cloud_tts']=function(_0x5043a7){logger['info'](util[_0xe081('0x27')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x5043a7[_0xe081('0x34')]));_0x5043a7[_0xe081('0x57')]=_0x5043a7['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe081('0x81')](_0x5043a7[_0xe081('0x55')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0x1b3'));}if(!this[_0xe081('0x81')](_0x5043a7[_0xe081('0x57')])){return this[_0xe081('0xc')][_0xe081('0xa8')](_0xe081('0xa6'));}this[_0xe081('0xc')][_0xe081('0xa8')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x5043a7[_0xe081('0x57')]));var _0x4cc443=this[_0xe081('0x54')][_0xe081('0x6f')](this,_0x5043a7);if(_0x4cc443){this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x4cc443));var _0x48f324=this[_0xe081('0xc')][_0xe081('0xfa')](_0x4cc443);try{fs['unlink'](_0x4cc443+_0xe081('0x11f'));}catch(_0x5ea934){logger[_0xe081('0x30')](_0x5ea934);}return _0x48f324;}return this[_0xe081('0xc')]['error'](_0x5043a7,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x4a4009){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x1b4'),_0x4a4009[_0xe081('0x34')]));_0x4a4009['text']=_0x4a4009[_0xe081('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe081('0x81')](_0x4a4009[_0xe081('0x57')])){return this['channel']['noop'](_0xe081('0xa6'));}this[_0xe081('0xc')]['noop'](util[_0xe081('0x27')](_0xe081('0x1b5'),_0x4a4009[_0xe081('0x57')]));var _0x2ab13a=this[_0xe081('0x5e')][_0xe081('0x6f')](this,_0x4a4009);if(_0x2ab13a){this['channel'][_0xe081('0xa8')](util[_0xe081('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x2ab13a));var _0xf4e603=this[_0xe081('0xc')][_0xe081('0xfa')](_0x2ab13a);try{fs[_0xe081('0x11e')](_0x2ab13a+_0xe081('0x11f'));}catch(_0xb00262){logger[_0xe081('0x30')](_0xb00262);}return _0xf4e603;}return this['channel'][_0xe081('0x30')](_0x4a4009,_0xe081('0x1b6'));};AGIVertices['prototype'][_0xe081('0x1b7')]=function(_0x292e15){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x292e15[_0xe081('0x34')]));if(!this['isConfigured'](_0x292e15[_0xe081('0x14d')])){return this[_0xe081('0xc')][_0xe081('0x30')](_0x292e15,'no\x20find\x20by\x20configured');}logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x155'),this[_0xe081('0xc')][_0xe081('0x37')],_0x292e15[_0xe081('0x14d')]));var _0x70e016=this['agentUnpause'][_0xe081('0x6f')](this,_0x292e15[_0xe081('0x14d')]);if(_0x70e016){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x14f'),this['channel']['callerid'],_0x292e15[_0xe081('0x14d')]));this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x14f'),this[_0xe081('0xc')][_0xe081('0x37')],_0x292e15['findBy']));return{'code':0xc8,'result':_0xe081('0x150')};}else{logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x151'),this[_0xe081('0xc')][_0xe081('0x37')],_0x292e15[_0xe081('0x14d')]));this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')](_0xe081('0x151'),this[_0xe081('0xc')]['callerid'],_0x292e15['findBy']));return{'code':0xc8,'result':_0xe081('0x152')};}};AGIVertices[_0xe081('0x13')][_0xe081('0x1b8')]=function(_0x319b3b){logger[_0xe081('0x2c')](util[_0xe081('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x319b3b['label']));var _0x3a4d4e=this[_0xe081('0xc')][_0xe081('0x51')](_0xe081('0x1b9'),[_0x319b3b['mailbox'],_0x319b3b[_0xe081('0x76')]]);if(_0x3a4d4e[_0xe081('0xa0')]===-0x1){return _0x3a4d4e;}return this[_0xe081('0xc')][_0xe081('0xa8')](util[_0xe081('0x27')]('Executed\x20command\x20%s\x20%s',_0xe081('0x1b9'),_0x319b3b[_0xe081('0x1ba')]));};AGIVertices['prototype'][_0xe081('0x1bb')]=function(_0x2e3a9b){logger[_0xe081('0x2c')](util[_0xe081('0x27')](_0xe081('0x1bc'),_0x2e3a9b[_0xe081('0x34')]));if(!this[_0xe081('0x81')](_0x2e3a9b[_0xe081('0xd0')])){return this[_0xe081('0xc')]['error'](_0x2e3a9b,_0xe081('0x1bd'));}var _0x50a2c1=this[_0xe081('0x9f')][_0xe081('0x6f')](this,_0x2e3a9b[_0xe081('0xd0')]);if(!_0x50a2c1){return this[_0xe081('0xc')]['error'](_0x2e3a9b,'no\x20variable\x20found');}var _0x3a41a3=this[_0xe081('0xc')][_0xe081('0x9f')](_0x50a2c1);return{'code':0xc8,'result':_0x3a41a3['extra']?_0x3a41a3[_0xe081('0x9d')]:'-'};};String['prototype'][_0xe081('0x1be')]=function(_0x567fcb,_0x296007){return this[_0xe081('0x9c')](_0x567fcb)[_0xe081('0x1bf')](_0x296007);};module[_0xe081('0x1c0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 21ccb61..8f053db 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 _0x13c3=['transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid'];(function(_0x2014e7,_0x2bd284){var _0x29452d=function(_0x76c1b0){while(--_0x76c1b0){_0x2014e7['push'](_0x2014e7['shift']());}};_0x29452d(++_0x2bd284);}(_0x13c3,0x110));var _0x313c=function(_0x58dba1,_0x530c35){_0x58dba1=_0x58dba1-0x0;var _0x5aae0e=_0x13c3[_0x58dba1];return _0x5aae0e;};'use strict';var _=require('lodash');var moment=require(_0x313c('0x0'));var ami=require(_0x313c('0x1'));var logger=require(_0x313c('0x2'))('acw');var RpcUser=require(_0x313c('0x3'));var RpcVoiceAgentReport=require(_0x313c('0x4'));function Acw(_0x26dde7){this[_0x313c('0x5')]=_0x26dde7[_0x313c('0x5')];this[_0x313c('0x6')]=_0x26dde7[_0x313c('0x6')];this[_0x313c('0x7')]=_0x26dde7[_0x313c('0x7')];this[_0x313c('0x8')]={};ami['on'](_0x313c('0x9'),this[_0x313c('0xa')][_0x313c('0xb')](this));ami['on'](_0x313c('0xc'),this[_0x313c('0xd')][_0x313c('0xb')](this));ami['on'](_0x313c('0xe'),this['syncHangup'][_0x313c('0xb')](this));ami['on'](_0x313c('0xf'),this[_0x313c('0x10')]['bind'](this));ami['on'](_0x313c('0x11'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x313c('0x12'),this[_0x313c('0x13')][_0x313c('0xb')](this));ami['on'](_0x313c('0x14'),this[_0x313c('0x15')][_0x313c('0xb')](this));}function getDiff(_0x3bc16d){var _0x14029e=moment()['milliseconds'](0x0);var _0x2abddf=moment(_0x3bc16d)['milliseconds'](0x0);return _0x14029e['diff'](_0x2abddf,'seconds');}Acw[_0x313c('0x16')][_0x313c('0x17')]=function(_0x2d3333){try{var _0x15088f=this;var _0x89720b=this['channels'][_0x2d3333][_0x313c('0x18')];var _0x3ab9ed=this[_0x313c('0x8')][_0x2d3333][_0x313c('0x19')];var _0x1e264a=this[_0x313c('0x5')][_0x3ab9ed];var _0x2538a7=![];var _0x5ae4a2='ACW';if(_0x1e264a[_0x313c('0x1a')]){if(_0x1e264a[_0x313c('0x1b')][_0x313c('0x1c')]){_0x2538a7=!![];_0x5ae4a2=_0x1e264a[_0x313c('0x1b')][_0x313c('0x1c')];}}return ami['Action']({'action':_0x313c('0x1d'),'interface':_0x89720b,'paused':!![],'reason':_0x5ae4a2})[_0x313c('0x1e')](function(){if(_0x15088f[_0x313c('0x6')][_0x89720b]){return RpcUser[_0x313c('0x1f')](_0x15088f['agents'][_0x89720b]['id'])['then'](function(_0x570298){if(_0x570298&&!_0x570298[_0x313c('0x20')]){logger['info'](_0x313c('0x21'),_0x2d3333,_0x89720b,_0x3ab9ed);var _0x2ce337=_0x15088f[_0x313c('0x8')][_0x2d3333]['attended']&&_0x15088f[_0x313c('0x8')][_0x2d3333][_0x313c('0x22')]?_0x15088f[_0x313c('0x8')][_0x2d3333]['destlinkedid']:_0x2d3333;return RpcUser[_0x313c('0x23')](_0x15088f[_0x313c('0x6')][_0x89720b],_0x5ae4a2,_0x2ce337)[_0x313c('0x1e')](function(){if(!_0x2538a7){_0x15088f[_0x313c('0x7')][_0x89720b]={};logger[_0x313c('0x24')](_0x313c('0x25'),_0x2d3333,_0x15088f[_0x313c('0x5')][_0x3ab9ed]['acwTimeout'],_0x89720b,_0x3ab9ed);_0x15088f['timers'][_0x89720b][_0x313c('0x26')]=setTimeout(_0x15088f[_0x313c('0x27')]['bind'](_0x15088f,_0x89720b),_0x15088f['voiceQueues'][_0x3ab9ed][_0x313c('0x28')]*0x3e8);_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x29')]=moment()[_0x313c('0x2a')](_0x313c('0x2b'));_0x15088f[_0x313c('0x7')][_0x89720b]['uniqueid']=_0x2d3333;_0x15088f[_0x313c('0x7')][_0x89720b]['queue']=_0x3ab9ed;_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x2c')]=function(){var _0x361876=getDiff(_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x29')]);clearTimeout(_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x26')]);_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x26')]=![];RpcVoiceAgentReport[_0x313c('0x2d')]({'acwtime':_0x361876},_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x2e')],_0x89720b)[_0x313c('0x1e')](function(_0x5b9b79){logger[_0x313c('0x24')](_0x313c('0x2f'),_0x2d3333,_0x361876,_0x5b9b79);})['catch'](function(_0x4b00c4){logger[_0x313c('0x30')](_0x313c('0x31'),_0x2d3333,_0x4b00c4);});delete _0x15088f[_0x313c('0x7')][_0x89720b];};}});}else{logger[_0x313c('0x24')](_0x313c('0x32'),_0x2d3333,_0x89720b,_0x3ab9ed);}});}})[_0x313c('0x33')](function(){logger[_0x313c('0x30')](_0x313c('0x25'),_0x2d3333,_0x15088f[_0x313c('0x5')][_0x3ab9ed][_0x313c('0x28')],_0x89720b,_0x3ab9ed);})[_0x313c('0x34')](function(){delete _0x15088f[_0x313c('0x8')][_0x2d3333];});}catch(_0x5cb92c){logger[_0x313c('0x30')](_0x313c('0x35'),_0x5cb92c[_0x313c('0x36')]);}};Acw[_0x313c('0x16')][_0x313c('0x27')]=function(_0x39c262){try{var _0xe462eb=this;if(_0xe462eb['timers'][_0x39c262]){_0xe462eb[_0x313c('0x7')][_0x39c262]['timer']=![];var _0x536f30=_0xe462eb[_0x313c('0x7')][_0x39c262][_0x313c('0x2e')];var _0x5b8846=_0xe462eb[_0x313c('0x7')][_0x39c262][_0x313c('0x19')];var _0x2defa1=_0xe462eb[_0x313c('0x5')][_0x5b8846][_0x313c('0x28')];logger[_0x313c('0x24')](_0x313c('0x37'),_0x536f30,_0x39c262);RpcUser[_0x313c('0x38')](this[_0x313c('0x6')][_0x39c262]);RpcVoiceAgentReport[_0x313c('0x2d')]({'acwtime':_0x2defa1,'agentacw':!![]},_0x536f30,_0x39c262)[_0x313c('0x1e')](function(_0x68a39b){logger[_0x313c('0x24')](_0x313c('0x2f'),_0x536f30,_0x2defa1,_0x68a39b);})['catch'](function(_0x69d850){logger[_0x313c('0x30')](_0x313c('0x31'),_0x536f30,_0x69d850);});}else{logger['error'](_0x313c('0x39'),_0x39c262);if(_0xe462eb[_0x313c('0x7')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0xe462eb[_0x313c('0x7')]));}}}catch(_0x598bce){logger[_0x313c('0x30')](_0x313c('0x3a'),_0x598bce['message']);}};Acw['prototype'][_0x313c('0xa')]=function(_0x2ecabb){try{if(this[_0x313c('0x5')][_0x2ecabb[_0x313c('0x19')]]&&(this['voiceQueues'][_0x2ecabb[_0x313c('0x19')]]['acw']||this[_0x313c('0x5')][_0x2ecabb[_0x313c('0x19')]]['mandatoryDisposition'])){if(this[_0x313c('0x6')][_0x2ecabb[_0x313c('0x18')]]){this[_0x313c('0x8')][_0x2ecabb['uniqueid']]={'queue':_0x2ecabb[_0x313c('0x19')],'interface':_0x2ecabb[_0x313c('0x18')],'destlinkedid':_0x2ecabb[_0x313c('0x22')]};}}}catch(_0x9c3620){logger[_0x313c('0x30')](_0x313c('0x3b'),_0x9c3620[_0x313c('0x36')]);}};Acw['prototype'][_0x313c('0x15')]=function(_0x2f6ef7){try{if(this[_0x313c('0x5')][_0x2f6ef7[_0x313c('0x19')]]&&(this['voiceQueues'][_0x2f6ef7[_0x313c('0x19')]][_0x313c('0x3c')]||this['voiceQueues'][_0x2f6ef7[_0x313c('0x19')]][_0x313c('0x1a')])){if(this[_0x313c('0x6')][_0x2f6ef7['interface']]){this['channels'][_0x2f6ef7[_0x313c('0x2e')]]={'queue':_0x2f6ef7[_0x313c('0x19')],'interface':_0x2f6ef7[_0x313c('0x18')]};}}}catch(_0x4add28){logger[_0x313c('0x30')](_0x313c('0x3d'),_0x4add28[_0x313c('0x36')]);}};Acw['prototype'][_0x313c('0xd')]=function(_0x23cc0a){try{if(this[_0x313c('0x8')][_0x23cc0a[_0x313c('0x2e')]]&&_[_0x313c('0x3e')](this[_0x313c('0x8')][_0x23cc0a[_0x313c('0x2e')]][_0x313c('0x3f')])){logger[_0x313c('0x24')](_0x313c('0x40'),_0x23cc0a[_0x313c('0x2e')]);this['startAcw'](_0x23cc0a[_0x313c('0x2e')]);}else if(this['channels'][_0x23cc0a[_0x313c('0x41')]]&&_['isUndefined'](this[_0x313c('0x8')][_0x23cc0a[_0x313c('0x41')]][_0x313c('0x3f')])){logger[_0x313c('0x24')](_0x313c('0x42'),_0x23cc0a[_0x313c('0x41')]);this[_0x313c('0x17')](_0x23cc0a[_0x313c('0x41')]);}}catch(_0x9bcb19){logger[_0x313c('0x30')]('[ACW][syncHangupRequest]\x20%s',_0x9bcb19[_0x313c('0x36')]);}};Acw[_0x313c('0x16')][_0x313c('0x43')]=function(_0x297d8f){try{if(this['channels'][_0x297d8f[_0x313c('0x2e')]]&&this[_0x313c('0x8')][_0x297d8f[_0x313c('0x2e')]]['attended']){logger[_0x313c('0x24')](_0x313c('0x44'),_0x297d8f[_0x313c('0x2e')]);this[_0x313c('0x17')](_0x297d8f[_0x313c('0x2e')]);}else if(this[_0x313c('0x8')][_0x297d8f['linkedid']]&&this['channels'][_0x297d8f[_0x313c('0x41')]][_0x313c('0x3f')]){logger[_0x313c('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x297d8f[_0x313c('0x41')]);this[_0x313c('0x17')](_0x297d8f[_0x313c('0x41')]);}}catch(_0x1da63d){logger['error'](_0x313c('0x45'),_0x1da63d[_0x313c('0x36')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0xdfc820){try{if(!_['isNil'](this[_0x313c('0x8')][_0xdfc820[_0x313c('0x46')]])){this[_0x313c('0x17')](_0xdfc820[_0x313c('0x46')]);if(this[_0x313c('0x8')][_0xdfc820[_0x313c('0x47')]]){this[_0x313c('0x8')][_0xdfc820[_0x313c('0x47')]][_0x313c('0x3f')]=!![];this[_0x313c('0x8')][_0xdfc820[_0x313c('0x48')]]=this[_0x313c('0x8')][_0xdfc820['secondtransfereruniqueid']];delete this[_0x313c('0x8')][_0xdfc820[_0x313c('0x47')]];}}else if(!_[_0x313c('0x49')](this[_0x313c('0x8')][_0xdfc820[_0x313c('0x48')]])){this[_0x313c('0x17')](_0xdfc820[_0x313c('0x48')]);if(this[_0x313c('0x8')][_0xdfc820[_0x313c('0x4a')]]){this['channels'][_0xdfc820[_0x313c('0x4a')]]['attended']=!![];this[_0x313c('0x8')][_0xdfc820['transfereeuniqueid']]=this[_0x313c('0x8')][_0xdfc820[_0x313c('0x4a')]];delete this[_0x313c('0x8')][_0xdfc820[_0x313c('0x4a')]];}}}catch(_0x40f32e){logger[_0x313c('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x40f32e[_0x313c('0x36')]);}};Acw['prototype'][_0x313c('0x13')]=function(_0xb218ed){try{if(this[_0x313c('0x8')][_0xb218ed[_0x313c('0x4b')]]){logger[_0x313c('0x24')](_0x313c('0x4c'),JSON[_0x313c('0x4d')](_0xb218ed[_0x313c('0x4b')]));this[_0x313c('0x17')](_0xb218ed[_0x313c('0x4b')]);}else if(this[_0x313c('0x8')][_0xb218ed[_0x313c('0x4e')]]){logger[_0x313c('0x24')](_0x313c('0x4f'),JSON[_0x313c('0x4d')](_0xb218ed[_0x313c('0x4e')]));this['startAcw'](_0xb218ed[_0x313c('0x4e')]);}}catch(_0x452c59){logger['error'](_0x313c('0x50'),_0x452c59[_0x313c('0x36')]);}};Acw[_0x313c('0x16')][_0x313c('0x10')]=function(_0x5eb1d7){try{if(this[_0x313c('0x5')][_0x5eb1d7[_0x313c('0x19')]]&&this[_0x313c('0x5')][_0x5eb1d7[_0x313c('0x19')]][_0x313c('0x51')]===_0x313c('0x52')){if(this['agents'][_0x5eb1d7[_0x313c('0x18')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5eb1d7[_0x313c('0x2e')],_0x5eb1d7[_0x313c('0x18')],_0x5eb1d7['queue']);return RpcUser[_0x313c('0x23')](this[_0x313c('0x6')][_0x5eb1d7['interface']],_0x313c('0x53'),_0x5eb1d7[_0x313c('0x2e')]);}}}catch(_0x304406){logger[_0x313c('0x30')](_0x313c('0x54'),_0x304406[_0x313c('0x36')]);}};module[_0x313c('0x55')]=Acw; \ No newline at end of file +var _0x5288=['moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','bind','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','interface','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash'];(function(_0x7efb7,_0x5ee7c1){var _0x5a7999=function(_0x50f90a){while(--_0x50f90a){_0x7efb7['push'](_0x7efb7['shift']());}};_0x5a7999(++_0x5ee7c1);}(_0x5288,0x101));var _0x8528=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x5288[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x8528('0x0'));var moment=require(_0x8528('0x1'));var ami=require(_0x8528('0x2'));var logger=require(_0x8528('0x3'))('acw');var RpcUser=require(_0x8528('0x4'));var RpcVoiceAgentReport=require(_0x8528('0x5'));function Acw(_0x1081ec){this[_0x8528('0x6')]=_0x1081ec[_0x8528('0x6')];this[_0x8528('0x7')]=_0x1081ec[_0x8528('0x7')];this['timers']=_0x1081ec[_0x8528('0x8')];this[_0x8528('0x9')]={};ami['on'](_0x8528('0xa'),this[_0x8528('0xb')]['bind'](this));ami['on'](_0x8528('0xc'),this['syncHangupRequest'][_0x8528('0xd')](this));ami['on'](_0x8528('0xe'),this[_0x8528('0xf')][_0x8528('0xd')](this));ami['on'](_0x8528('0x10'),this['syncAgentRingNoAnswer'][_0x8528('0xd')](this));ami['on'](_0x8528('0x11'),this[_0x8528('0x12')][_0x8528('0xd')](this));ami['on'](_0x8528('0x13'),this[_0x8528('0x14')][_0x8528('0xd')](this));ami['on'](_0x8528('0x15'),this[_0x8528('0x16')]['bind'](this));}function getDiff(_0x45030e){var _0x40a6d8=moment()['milliseconds'](0x0);var _0x3f07e9=moment(_0x45030e)[_0x8528('0x17')](0x0);return _0x40a6d8[_0x8528('0x18')](_0x3f07e9,_0x8528('0x19'));}Acw[_0x8528('0x1a')][_0x8528('0x1b')]=function(_0x1be08d){try{var _0x7a77e2=this;var _0x2478d1=this['channels'][_0x1be08d]['interface'];var _0xa8b9f0=this[_0x8528('0x9')][_0x1be08d][_0x8528('0x1c')];var _0x144449=this[_0x8528('0x6')][_0xa8b9f0];var _0x3552dd=![];var _0x3a16a='ACW';if(_0x144449[_0x8528('0x1d')]){if(_0x144449[_0x8528('0x1e')]['name']){_0x3552dd=!![];_0x3a16a=_0x144449[_0x8528('0x1e')]['name'];}}return ami[_0x8528('0x1f')]({'action':_0x8528('0x20'),'interface':_0x2478d1,'paused':!![],'reason':_0x3a16a})[_0x8528('0x21')](function(){if(_0x7a77e2['agents'][_0x2478d1]){return RpcUser[_0x8528('0x22')](_0x7a77e2[_0x8528('0x7')][_0x2478d1]['id'])['then'](function(_0x367683){if(_0x367683&&!_0x367683[_0x8528('0x23')]){logger[_0x8528('0x24')](_0x8528('0x25'),_0x1be08d,_0x2478d1,_0xa8b9f0);var _0x387b70=_0x7a77e2[_0x8528('0x9')][_0x1be08d][_0x8528('0x26')]&&_0x7a77e2['channels'][_0x1be08d][_0x8528('0x27')]?_0x7a77e2[_0x8528('0x9')][_0x1be08d][_0x8528('0x27')]:_0x1be08d;return RpcUser[_0x8528('0x28')](_0x7a77e2[_0x8528('0x7')][_0x2478d1],_0x3a16a,_0x387b70)['then'](function(){if(!_0x3552dd){_0x7a77e2[_0x8528('0x8')][_0x2478d1]={};logger[_0x8528('0x24')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1be08d,_0x7a77e2[_0x8528('0x6')][_0xa8b9f0][_0x8528('0x29')],_0x2478d1,_0xa8b9f0);_0x7a77e2['timers'][_0x2478d1][_0x8528('0x2a')]=setTimeout(_0x7a77e2[_0x8528('0x2b')][_0x8528('0xd')](_0x7a77e2,_0x2478d1),_0x7a77e2['voiceQueues'][_0xa8b9f0]['acwTimeout']*0x3e8);_0x7a77e2[_0x8528('0x8')][_0x2478d1][_0x8528('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x7a77e2[_0x8528('0x8')][_0x2478d1][_0x8528('0x2d')]=_0x1be08d;_0x7a77e2[_0x8528('0x8')][_0x2478d1][_0x8528('0x1c')]=_0xa8b9f0;_0x7a77e2['timers'][_0x2478d1][_0x8528('0x2e')]=function(){var _0x56221c=getDiff(_0x7a77e2['timers'][_0x2478d1][_0x8528('0x2c')]);clearTimeout(_0x7a77e2[_0x8528('0x8')][_0x2478d1]['timer']);_0x7a77e2['timers'][_0x2478d1][_0x8528('0x2a')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x56221c},_0x7a77e2['timers'][_0x2478d1][_0x8528('0x2d')],_0x2478d1)[_0x8528('0x21')](function(_0x42f499){logger['info'](_0x8528('0x2f'),_0x1be08d,_0x56221c,_0x42f499);})[_0x8528('0x30')](function(_0x5c19eb){logger[_0x8528('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x1be08d,_0x5c19eb);});delete _0x7a77e2[_0x8528('0x8')][_0x2478d1];};}});}else{logger['info'](_0x8528('0x32'),_0x1be08d,_0x2478d1,_0xa8b9f0);}});}})[_0x8528('0x30')](function(){logger[_0x8528('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1be08d,_0x7a77e2[_0x8528('0x6')][_0xa8b9f0]['acwTimeout'],_0x2478d1,_0xa8b9f0);})[_0x8528('0x33')](function(){delete _0x7a77e2[_0x8528('0x9')][_0x1be08d];});}catch(_0x3e2ede){logger['error']('[ACW][START]\x20%s',_0x3e2ede[_0x8528('0x34')]);}};Acw['prototype'][_0x8528('0x2b')]=function(_0x210380){try{var _0x45e7e5=this;if(_0x45e7e5[_0x8528('0x8')][_0x210380]){_0x45e7e5[_0x8528('0x8')][_0x210380][_0x8528('0x2a')]=![];var _0x1cdb77=_0x45e7e5[_0x8528('0x8')][_0x210380][_0x8528('0x2d')];var _0x14defc=_0x45e7e5[_0x8528('0x8')][_0x210380][_0x8528('0x1c')];var _0x2e1083=_0x45e7e5[_0x8528('0x6')][_0x14defc][_0x8528('0x29')];logger[_0x8528('0x24')]('[%s][TIMER][STOP][AGENT:%s]',_0x1cdb77,_0x210380);RpcUser[_0x8528('0x35')](this[_0x8528('0x7')][_0x210380]);RpcVoiceAgentReport[_0x8528('0x36')]({'acwtime':_0x2e1083,'agentacw':!![]},_0x1cdb77,_0x210380)[_0x8528('0x21')](function(_0x32931b){logger[_0x8528('0x24')](_0x8528('0x2f'),_0x1cdb77,_0x2e1083,_0x32931b);})[_0x8528('0x30')](function(_0x35f1a8){logger[_0x8528('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x1cdb77,_0x35f1a8);});}else{logger[_0x8528('0x31')](_0x8528('0x37'),_0x210380);if(_0x45e7e5[_0x8528('0x8')]){logger['info'](_0x8528('0x38'),JSON[_0x8528('0x39')](_0x45e7e5[_0x8528('0x8')]));}}}catch(_0x4533f4){logger[_0x8528('0x31')](_0x8528('0x3a'),_0x4533f4[_0x8528('0x34')]);}};Acw['prototype'][_0x8528('0xb')]=function(_0x2cec17){try{if(this[_0x8528('0x6')][_0x2cec17[_0x8528('0x1c')]]&&(this['voiceQueues'][_0x2cec17['queue']][_0x8528('0x3b')]||this['voiceQueues'][_0x2cec17['queue']][_0x8528('0x1d')])){if(this[_0x8528('0x7')][_0x2cec17['interface']]){this['channels'][_0x2cec17[_0x8528('0x2d')]]={'queue':_0x2cec17[_0x8528('0x1c')],'interface':_0x2cec17['interface'],'destlinkedid':_0x2cec17['destlinkedid']};}}}catch(_0x198ce4){logger[_0x8528('0x31')](_0x8528('0x3c'),_0x198ce4['message']);}};Acw[_0x8528('0x1a')][_0x8528('0x16')]=function(_0x98c83f){try{if(this[_0x8528('0x6')][_0x98c83f[_0x8528('0x1c')]]&&(this[_0x8528('0x6')][_0x98c83f[_0x8528('0x1c')]][_0x8528('0x3b')]||this[_0x8528('0x6')][_0x98c83f[_0x8528('0x1c')]][_0x8528('0x1d')])){if(this[_0x8528('0x7')][_0x98c83f['interface']]){this[_0x8528('0x9')][_0x98c83f[_0x8528('0x2d')]]={'queue':_0x98c83f[_0x8528('0x1c')],'interface':_0x98c83f[_0x8528('0x3d')]};}}}catch(_0x3426b1){logger[_0x8528('0x31')](_0x8528('0x3e'),_0x3426b1[_0x8528('0x34')]);}};Acw[_0x8528('0x1a')][_0x8528('0x3f')]=function(_0x84b2e4){try{if(this[_0x8528('0x9')][_0x84b2e4[_0x8528('0x2d')]]&&_['isUndefined'](this[_0x8528('0x9')][_0x84b2e4['uniqueid']][_0x8528('0x26')])){logger[_0x8528('0x24')](_0x8528('0x40'),_0x84b2e4['uniqueid']);this['startAcw'](_0x84b2e4[_0x8528('0x2d')]);}else if(this[_0x8528('0x9')][_0x84b2e4['linkedid']]&&_['isUndefined'](this['channels'][_0x84b2e4[_0x8528('0x41')]]['attended'])){logger[_0x8528('0x24')](_0x8528('0x42'),_0x84b2e4['linkedid']);this[_0x8528('0x1b')](_0x84b2e4[_0x8528('0x41')]);}}catch(_0x52d6e7){logger[_0x8528('0x31')](_0x8528('0x43'),_0x52d6e7['message']);}};Acw[_0x8528('0x1a')]['syncHangup']=function(_0x458f92){try{if(this[_0x8528('0x9')][_0x458f92[_0x8528('0x2d')]]&&this[_0x8528('0x9')][_0x458f92[_0x8528('0x2d')]][_0x8528('0x26')]){logger[_0x8528('0x24')](_0x8528('0x44'),_0x458f92[_0x8528('0x2d')]);this[_0x8528('0x1b')](_0x458f92[_0x8528('0x2d')]);}else if(this[_0x8528('0x9')][_0x458f92['linkedid']]&&this[_0x8528('0x9')][_0x458f92[_0x8528('0x41')]][_0x8528('0x26')]){logger[_0x8528('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x458f92[_0x8528('0x41')]);this[_0x8528('0x1b')](_0x458f92[_0x8528('0x41')]);}}catch(_0x59ee9c){logger[_0x8528('0x31')](_0x8528('0x45'),_0x59ee9c[_0x8528('0x34')]);}};Acw[_0x8528('0x1a')][_0x8528('0x12')]=function(_0x3098d6){try{if(!_[_0x8528('0x46')](this['channels'][_0x3098d6['transfereeuniqueid']])){this[_0x8528('0x1b')](_0x3098d6[_0x8528('0x47')]);if(this[_0x8528('0x9')][_0x3098d6['secondtransfereruniqueid']]){this[_0x8528('0x9')][_0x3098d6[_0x8528('0x48')]][_0x8528('0x26')]=!![];this['channels'][_0x3098d6[_0x8528('0x49')]]=this[_0x8528('0x9')][_0x3098d6['secondtransfereruniqueid']];delete this[_0x8528('0x9')][_0x3098d6[_0x8528('0x48')]];}}else if(!_[_0x8528('0x46')](this[_0x8528('0x9')][_0x3098d6[_0x8528('0x49')]])){this[_0x8528('0x1b')](_0x3098d6['transfertargetuniqueid']);if(this[_0x8528('0x9')][_0x3098d6[_0x8528('0x4a')]]){this[_0x8528('0x9')][_0x3098d6[_0x8528('0x4a')]][_0x8528('0x26')]=!![];this[_0x8528('0x9')][_0x3098d6[_0x8528('0x47')]]=this['channels'][_0x3098d6[_0x8528('0x4a')]];delete this[_0x8528('0x9')][_0x3098d6[_0x8528('0x4a')]];}}}catch(_0x3c9e6f){logger[_0x8528('0x31')](_0x8528('0x4b'),_0x3c9e6f['message']);}};Acw['prototype'][_0x8528('0x14')]=function(_0x194703){try{if(this[_0x8528('0x9')][_0x194703['transfereruniqueid']]){logger[_0x8528('0x24')](_0x8528('0x4c'),JSON[_0x8528('0x39')](_0x194703[_0x8528('0x4d')]));this[_0x8528('0x1b')](_0x194703[_0x8528('0x4d')]);}else if(this[_0x8528('0x9')][_0x194703[_0x8528('0x4e')]]){logger[_0x8528('0x24')](_0x8528('0x4f'),JSON[_0x8528('0x39')](_0x194703['transfererlinkedid']));this[_0x8528('0x1b')](_0x194703[_0x8528('0x4e')]);}}catch(_0x516178){logger[_0x8528('0x31')](_0x8528('0x50'),_0x516178[_0x8528('0x34')]);}};Acw[_0x8528('0x1a')][_0x8528('0x51')]=function(_0x18b647){try{if(this[_0x8528('0x6')][_0x18b647['queue']]&&this[_0x8528('0x6')][_0x18b647[_0x8528('0x1c')]][_0x8528('0x52')]===_0x8528('0x53')){if(this[_0x8528('0x7')][_0x18b647[_0x8528('0x3d')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x18b647[_0x8528('0x2d')],_0x18b647[_0x8528('0x3d')],_0x18b647[_0x8528('0x1c')]);return RpcUser[_0x8528('0x28')](this[_0x8528('0x7')][_0x18b647[_0x8528('0x3d')]],_0x8528('0x54'),_0x18b647['uniqueid']);}}}catch(_0x5580ce){logger[_0x8528('0x31')](_0x8528('0x55'),_0x5580ce[_0x8528('0x34')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 4055938..6c9d487 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 _0x5889=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionCoreShowChannels','coreshowchannels','info','username','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionQueueSummary','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','../../config/environment','asterisk','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','Action'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x5889,0x1b7));var _0x9588=function(_0x121fb7,_0x214eb3){_0x121fb7=_0x121fb7-0x0;var _0x491e64=_0x5889[_0x121fb7];return _0x491e64;};'use strict';var Manager=require(_0x9588('0x0'));var BPromise=require(_0x9588('0x1'));var util=require('util');var logger=require(_0x9588('0x2'))('ami');var config=require(_0x9588('0x3'));var ami=new Manager(config[_0x9588('0x4')]['port'],config['asterisk']['ip'],config['asterisk']['username'],config[_0x9588('0x4')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x9588('0x5')](ami[_0x9588('0x6')]);function error(_0x5c1f29){logger[_0x9588('0x7')](util[_0x9588('0x8')](_0x9588('0x9'),config[_0x9588('0x4')]['username'],config[_0x9588('0x4')]['ip'],config['asterisk'][_0x9588('0xa')],util[_0x9588('0xb')](_0x5c1f29,![],null)));}function close(){logger[_0x9588('0x7')](util[_0x9588('0x8')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x9588('0x4')]['username'],config[_0x9588('0x4')]['ip'],config[_0x9588('0x4')][_0x9588('0xa')]));}ami[_0x9588('0xc')]=function(){return function(){return ami['Action']({'action':_0x9588('0xd')});};};ami[_0x9588('0xe')]=function(){return function(){return ami[_0x9588('0xf')]({'action':_0x9588('0x10')});};};ami[_0x9588('0x11')]=function(){return function(){return ami[_0x9588('0xf')]({'action':_0x9588('0x12')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x9588('0x13')]=function(){return function(){return ami[_0x9588('0xf')]({'action':_0x9588('0x14')});};};function connect(){logger[_0x9588('0x15')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x9588('0x4')][_0x9588('0x16')],config[_0x9588('0x4')]['ip'],config[_0x9588('0x4')]['port']));ami[_0x9588('0x17')](_0x9588('0x7'),error);ami[_0x9588('0x17')](_0x9588('0x18'),close);}ami['on'](_0x9588('0x19'),connect);ami['on'](_0x9588('0x1a'),function(_0x168eec){logger['info'](util[_0x9588('0x8')](_0x9588('0x1b'),config[_0x9588('0x4')][_0x9588('0x16')],config[_0x9588('0x4')]['ip'],config['asterisk'][_0x9588('0xa')],util[_0x9588('0xb')](_0x168eec,![],null)));});ami['on'](_0x9588('0x1c'),function(){logger['info'](util[_0x9588('0x8')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x9588('0x4')][_0x9588('0x16')],config[_0x9588('0x4')]['ip'],config[_0x9588('0x4')][_0x9588('0xa')]));return Promise[_0x9588('0x1d')]()[_0x9588('0x1e')](ami[_0x9588('0xc')]())['then'](ami[_0x9588('0xe')]())[_0x9588('0x1e')](ami[_0x9588('0x11')]())[_0x9588('0x1e')](ami[_0x9588('0x1f')]())[_0x9588('0x1e')](ami['actionCoreShowChannels']())[_0x9588('0x20')](function(_0x209f7c){logger[_0x9588('0x7')](_0x9588('0x21'),util[_0x9588('0xb')](_0x209f7c,{'showHidden':![],'depth':null}));});});ami[_0x9588('0x17')](_0x9588('0x7'),error);ami[_0x9588('0x17')](_0x9588('0x18'),close);module[_0x9588('0x22')]=ami; \ No newline at end of file +var _0x881c=['coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipPeerStatus','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','ami','../../config/environment','password','keepConnected','Action','promisify','action','format','asterisk','port','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x881c,0xf3));var _0xc881=function(_0x44b538,_0x502912){_0x44b538=_0x44b538-0x0;var _0x40f69b=_0x881c[_0x44b538];return _0x40f69b;};'use strict';var Manager=require(_0xc881('0x0'));var BPromise=require(_0xc881('0x1'));var util=require('util');var logger=require('../../config/logger')(_0xc881('0x2'));var config=require(_0xc881('0x3'));var ami=new Manager(config['asterisk']['port'],config['asterisk']['ip'],config['asterisk']['username'],config['asterisk'][_0xc881('0x4')],!![]);ami[_0xc881('0x5')]();ami[_0xc881('0x6')]=BPromise[_0xc881('0x7')](ami[_0xc881('0x8')]);function error(_0x4023a0){logger['error'](util[_0xc881('0x9')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xc881('0xa')]['username'],config['asterisk']['ip'],config[_0xc881('0xa')][_0xc881('0xb')],util[_0xc881('0xc')](_0x4023a0,![],null)));}function close(){logger[_0xc881('0xd')](util[_0xc881('0x9')](_0xc881('0xe'),config[_0xc881('0xa')][_0xc881('0xf')],config[_0xc881('0xa')]['ip'],config[_0xc881('0xa')]['port']));}ami[_0xc881('0x10')]=function(){return function(){return ami[_0xc881('0x6')]({'action':_0xc881('0x11')});};};ami[_0xc881('0x12')]=function(){return function(){return ami['Action']({'action':_0xc881('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xc881('0x6')]({'action':_0xc881('0x14')});};};ami[_0xc881('0x15')]=function(){return function(){return ami[_0xc881('0x6')]({'action':_0xc881('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xc881('0x6')]({'action':_0xc881('0x17')});};};function connect(){logger[_0xc881('0x18')](util[_0xc881('0x9')](_0xc881('0x19'),config[_0xc881('0xa')][_0xc881('0xf')],config[_0xc881('0xa')]['ip'],config[_0xc881('0xa')]['port']));ami[_0xc881('0x1a')](_0xc881('0xd'),error);ami[_0xc881('0x1a')](_0xc881('0x1b'),close);}ami['on']('connect',connect);ami['on'](_0xc881('0x1c'),function(_0x29cbf5){logger['info'](util[_0xc881('0x9')](_0xc881('0x1d'),config['asterisk']['username'],config[_0xc881('0xa')]['ip'],config['asterisk'][_0xc881('0xb')],util[_0xc881('0xc')](_0x29cbf5,![],null)));});ami['on'](_0xc881('0x1e'),function(){logger['info'](util['format'](_0xc881('0x1f'),config['asterisk'][_0xc881('0xf')],config[_0xc881('0xa')]['ip'],config[_0xc881('0xa')][_0xc881('0xb')]));return Promise['resolve']()[_0xc881('0x20')](ami[_0xc881('0x10')]())[_0xc881('0x20')](ami['actionDeviceStateList']())[_0xc881('0x20')](ami[_0xc881('0x21')]())['then'](ami['actionQueueSummary']())[_0xc881('0x20')](ami[_0xc881('0x22')]())[_0xc881('0x23')](function(_0x5265b6){logger[_0xc881('0xd')](_0xc881('0x24'),util[_0xc881('0xc')](_0x5265b6,{'showHidden':![],'depth':null}));});});ami[_0xc881('0x1a')]('error',error);ami[_0xc881('0x1a')]('close',close);module[_0xc881('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a25454a..7066b3b 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x22ae56,_0x16955c){var _0x1544f5=function(_0x2d525f){while(--_0x2d525f){_0x22ae56['push'](_0x22ae56['shift']());}};_0x1544f5(++_0x16955c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1712c1,_0x2e1794){_0x1712c1=_0x1712c1-0x0;var _0x5af172=_0xb43b[_0x1712c1];return _0x5af172;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x51fe86,_0x422b66){var _0x3557d4=function(_0x524a6a){while(--_0x524a6a){_0x51fe86['push'](_0x51fe86['shift']());}};_0x3557d4(++_0x422b66);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5e2e2e,_0x59081c){_0x5e2e2e=_0x5e2e2e-0x0;var _0x1e5adc=_0x9bde[_0x5e2e2e];return _0x1e5adc;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9c8e9c5..d8b6bff 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 _0x0779=['[syncHangupIvr][createHistory]','dialQueueProject','AGI','cause-txt','Unknow','[syncHangupIvr]','running','statusMessage','getQueueCampaignStatusMessage','resolve','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:%s','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','verifyAdditionalPhones','custom:agentnosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','Contact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','checkContactLowerLimitOriginate','[actionOriginatePredictive]\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]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\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]','Umin\x20=\x20','exports','util','uuid','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../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','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\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','erlangBusyFactor','merge','getSeconds','startProgressive','startPredictive\x20value\x20cleared','handlePredictive','error','stack','contactsRescheduled','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','\x20INTERVAL_IS_NULL','Interval','Intervals','NULL_INTERVAL','isEmpty','CAMPAIGN_STATUS','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','length','push','Action','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','catch','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','checkIfTime','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','booked','Queue','method\x20not\x20recognized','dialGlobalInterval','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','state','voiceQueue','additional','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','Drop','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','statedesc','dropreason','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedMaxRetry','rescheduleContact','CampaignId','Abandoned','channel','actionid','strategy','rrmemory','isNil','locked','stateinterface','idHopper','paused','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','amd','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerCallsDay','[syncAgentComplete][createHistory][0]','countnoanswerretry','ivrAnswerCallsDay'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0779,0xf5));var _0x9077=function(_0x557aed,_0x481fb1){_0x557aed=_0x557aed-0x0;var _0x42d0d9=_0x0779[_0x557aed];return _0x42d0d9;};'use strict';var util=require(_0x9077('0x0'));var _=require('lodash');var uuid=require(_0x9077('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x9077('0x2'));var hopperUtils=require(_0x9077('0x3'));var ut=require(_0x9077('0x4'));var config=require(_0x9077('0x5'));var logger=require(_0x9077('0x6'))(_0x9077('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require('../../../config/logger')(_0x9077('0x8'));var loggerPredictiveCalls=require(_0x9077('0x6'))(_0x9077('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x9077('0xa'));var ami=require(_0x9077('0xb'));config[_0x9077('0xc')]=_[_0x9077('0xd')](config['redis'],{'host':_0x9077('0xe'),'port':0x18eb});var io=require(_0x9077('0xf'))(new Redis(config[_0x9077('0xc')]));var cmHopper=require(_0x9077('0x10'));var voiceQueueRt=require(_0x9077('0x11'));var RpcSetting=require(_0x9077('0x12'));var Interval=require(_0x9077('0x13'));var Action=require(_0x9077('0x14'));var History=require(_0x9077('0x15'));var Final=require(_0x9077('0x16'));var AgentComplete=require(_0x9077('0x17'));var QueueCallerAbandon=require(_0x9077('0x18'));var Hangup=require(_0x9077('0x19'));var ipAgi=process[_0x9077('0x1a')][_0x9077('0x1b')]||_0x9077('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9077('0x1d')][_0x9077('0x1e')]=function(_0x159519){this[_0x9077('0x1f')]=this[_0x9077('0x1f')]?this[_0x9077('0x1f')]['finally'](_0x159519):_0x159519();};function Dialer(_0x504a84,_0x90f750){this[_0x9077('0x20')]=new Sequence();this[_0x9077('0x21')]=_0x90f750;this[_0x9077('0x22')]=_0x504a84['voiceQueues'];this[_0x9077('0x23')]=_0x504a84['campaigns'];this[_0x9077('0x24')]=_0x504a84[_0x9077('0x24')];this[_0x9077('0x25')]=_0x504a84[_0x9077('0x25')];this[_0x9077('0x26')]=config[_0x9077('0x26')]||0x2;this[_0x9077('0x27')]={};this[_0x9077('0x28')]={};this[_0x9077('0x29')]={};this[_0x9077('0x2a')]={};this['optionPredictive']={};this[_0x9077('0x2b')]={};this['startProgressive']={};this[_0x9077('0x2c')]={};this[_0x9077('0x2d')]={};this[_0x9077('0x2e')]={};this[_0x9077('0x2f')]={};ami['on'](_0x9077('0x30'),this[_0x9077('0x31')][_0x9077('0x32')](this));ami['on'](_0x9077('0x33'),this['syncQueueCallerAbandon'][_0x9077('0x32')](this));ami['on'](_0x9077('0x34'),this['syncOriginateResponse'][_0x9077('0x32')](this));ami['on'](_0x9077('0x35'),this[_0x9077('0x36')][_0x9077('0x32')](this));ami['on'](_0x9077('0x37'),this[_0x9077('0xa')][_0x9077('0x32')](this));ami['on']('custom:queuesummarycomplete',this[_0x9077('0x38')][_0x9077('0x32')](this));ami['on'](_0x9077('0x39'),this[_0x9077('0x3a')][_0x9077('0x32')](this));ami['on'](_0x9077('0x3b'),this[_0x9077('0x3c')][_0x9077('0x32')](this));ami['on'](_0x9077('0x3d'),this[_0x9077('0x3e')]['bind'](this));ami['on']('queuemember',this[_0x9077('0x3f')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x9077('0x40')][_0x9077('0x32')](this));this[_0x9077('0x41')]();this['loopClearZombieChannels']();RpcSetting[_0x9077('0x42')]()[_0x9077('0x43')](function(_0x4992f0){previewRecallmeReminderInterval=_0x4992f0[_0x9077('0x44')];});}function isNotNull(_0x3b8ecf){return _0x3b8ecf!==null&&!_[_0x9077('0x45')](_0x3b8ecf);}function msgResponse(_0x18fb48,_0x2f9a7a,_0x4492fd){return{'action':_0x18fb48,'response':_0x2f9a7a,'message':_0x4492fd,'stack':_0x4492fd};}function emit(_0x1001d7,_0x2f696e,_0x2b5979){io['to'](_0x1001d7)[_0x9077('0x46')](_0x2f696e,_0x2b5979);}function emitOutboundVoiceQueueSummary(_0x4588fe){if(_0x4588fe[_0x9077('0x47')]===_0x9077('0x48')){logger[_0x9077('0x49')](_0x9077('0x4a'),util[_0x9077('0x4b')](_0x4588fe,{'showHidden':![],'depth':null}));emit(util[_0x9077('0x4c')](_0x9077('0x4d'),_0x4588fe[_0x9077('0x4e')]),'voice_queue:save',_0x4588fe);}}function checkGetDataPredictive(_0x4297d9){if(isNotNull(_0x4297d9)&&!_['isEmpty'](_0x4297d9)){loggerPredictive[_0x9077('0x4f')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x9077('0x4f')](_0x9077('0x50'),_0x4297d9[_0x9077('0x51')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x52'),_0x4297d9[_0x9077('0x53')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x54'),_0x4297d9['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x9077('0x4f')](_0x9077('0x55'),_0x4297d9[_0x9077('0x56')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x57'),_0x4297d9['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x9077('0x4f')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4297d9[_0x9077('0x58')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x59'));if(_0x4297d9['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x4297d9['predictiveIntervalAvgTalktime'])&&_0x4297d9[_0x9077('0x58')]>0x0){return!![];}loggerPredictive[_0x9077('0x4f')](_0x9077('0x5a'));if(!_[_0x9077('0x45')](_0x4297d9[_0x9077('0x5b')])&&_0x4297d9['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x9077('0x5c'));}else{loggerPredictive[_0x9077('0x4f')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x9077('0x4f')](_0x9077('0x5d'));}return![];}function mergeDataErlangB(_0x27f97d){return function(_0x57b4f3){loggerPredictive['info'](_0x9077('0x5e'));loggerPredictive[_0x9077('0x4f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57b4f3[_0x9077('0x5f')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x60'),_0x57b4f3['erlangCallToSecond']);loggerPredictive[_0x9077('0x4f')](_0x9077('0x61'),_0x57b4f3[_0x9077('0x62')]);loggerPredictive[_0x9077('0x4f')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57b4f3[_0x9077('0x63')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x61'),_0x57b4f3['erlangAbandonmentRate']);loggerPredictive[_0x9077('0x4f')]('---------------------------');_[_0x9077('0x64')](_0x27f97d,_0x57b4f3);};}function ifInterval(_0xcdae6f,_0x38761f){if(_[_0x9077('0x45')](_0x38761f)){return![];}return utils[_0x9077('0x65')](undefined,_0x38761f)<_0xcdae6f*0x3c;}function clearPredictiveAttributes(_0x283374){if(_0x283374[_0x9077('0x66')]){_0x283374['startProgressive']=undefined;loggerPredictive[_0x9077('0x49')](_0x283374[_0x9077('0x4e')],'startProgressive\x20value\x20cleared');}if(_0x283374[_0x9077('0x2b')]){_0x283374['startPredictive']=undefined;loggerPredictive['debug'](_0x283374['name'],_0x9077('0x67'));}if(_0x283374['handlePredictive']){clearInterval(_0x283374[_0x9077('0x68')]);_0x283374[_0x9077('0x68')]=undefined;loggerPredictive[_0x9077('0x49')](_0x283374[_0x9077('0x4e')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x3d900a,_0x35d6a9){return function(_0x639fb8){loggerPredictive[_0x9077('0x69')](_0x35d6a9['name'],_0x3d900a);loggerPredictive[_0x9077('0x69')](_0x639fb8[_0x9077('0x6a')]);clearPredictiveAttributes(_0x35d6a9);};}function loggerCatch(_0x249170){return function(_0x3c1ae9){logger[_0x9077('0x69')](_0x249170,util[_0x9077('0x4b')](_0x3c1ae9,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3d41f4,_0x35fd19,_0xfa9050){return function(_0x3baa06){utils['checkContactLowerLimitOriginate'](_0x35fd19,_0xfa9050,0x0);logger[_0x9077('0x69')](_0x3d41f4,util['inspect'](_0x3baa06,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5dfd80){return function(_0x4263fc){if(isNotNull(_0x4263fc)&&isNotNull(_0x4263fc[0x0])){if(_0x4263fc[0x0][_0x9077('0x6b')]>0x0){_0x5dfd80['message']=utils['CAMPAIGN_STATUS'][_0x9077('0x6c')];logger[_0x9077('0x4f')](_0x9077('0x6d')+_0x5dfd80[_0x9077('0x4e')],_0x4263fc[0x0][_0x9077('0x6b')],_0x9077('0x6e'));}else{_0x5dfd80[_0x9077('0x6f')]=utils['CAMPAIGN_STATUS'][_0x9077('0x70')];logger['info'](_0x9077('0x71')+_0x5dfd80[_0x9077('0x4e')]);}}};}function createObjHistory(_0x3fc485,_0x262a5c,_0xec053d,_0x10d988,_0x7da43){_0x3fc485[_0x9077('0x6f')]=_0xec053d;var _0xa0994c=new Action(_0x3fc485,_0x262a5c);var _0x3e4d64=new History(_0xa0994c);_0x3e4d64['state']=_0x10d988;_0x3e4d64['statedesc']=_0x7da43;_0x3e4d64[_0x9077('0x72')]=_0xa0994c['starttime'];return _0x3e4d64;}function unlockQueueStatus(_0x184056,_0x5b4e89){setTimeout(function(){if(_['isUndefined'](_0x184056[_0x9077('0x73')])){loggerBooked[_0x9077('0x69')](_0x9077('0x74'),_0x5b4e89);}_0x184056[_0x9077('0x73')]=!![];loggerBooked[_0x9077('0x4f')](_0x9077('0x75'),_0x5b4e89,JSON[_0x9077('0x76')](_[_0x9077('0x77')](_0x184056,[_0x9077('0x4e'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x5a22ee){return function(){if(!isNotNull(_0x5a22ee['Interval'])){_0x5a22ee[_0x9077('0x6f')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x5a22ee[_0x9077('0x4e')]+_0x9077('0x78');}if(!isNotNull(_0x5a22ee[_0x9077('0x79')][_0x9077('0x7a')])){_0x5a22ee[_0x9077('0x6f')]=utils['CAMPAIGN_STATUS'][_0x9077('0x7b')];throw _0x5a22ee['name']+_0x9077('0x78');}if(!isNotNull(_[_0x9077('0x7c')](_0x5a22ee['Interval'][_0x9077('0x7a')]))){_0x5a22ee['message']=utils[_0x9077('0x7d')]['NULL_INTERVAL'];throw _0x5a22ee[_0x9077('0x4e')]+_0x9077('0x78');}};}function checkIsIVRCampaignActive(_0x19d0d9){return function(){if(!utils['isIVRCampaignActive'](_0x19d0d9)){_0x19d0d9[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x7e')];throw _0x19d0d9[_0x9077('0x4e')]+_0x9077('0x7f');}};}function emitCampaignSummary(_0x255748){if(utils[_0x9077('0x80')](_0x255748)){emit(util[_0x9077('0x4c')](_0x9077('0x81'),_0x255748[_0x9077('0x4e')]),_0x9077('0x82'),_0x255748);}}function loggerCatchQueueSummary(_0x4d37b0,_0x291501){return function(_0x33fba7){clearPredictiveAttributes(_0x291501);emitCampaignSummary(_0x291501);loggerSyncQueueSummary[_0x9077('0x49')](_0x4d37b0,util[_0x9077('0x4b')](_0x33fba7,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1733cf){if(_0x1733cf[_0x9077('0x83')]){if(_0x1733cf['originated']===0x0){_0x1733cf['sendMessageOneNotActive']=![];_0x1733cf[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x7e')];loggerSyncQueueSummary[_0x9077('0x49')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1733cf[_0x9077('0x4e')],_0x9077('0x84'));}else{_0x1733cf[_0x9077('0x6f')]=utils[_0x9077('0x7d')]['DISACTIVED'];loggerSyncQueueSummary[_0x9077('0x49')](_0x9077('0x85'),_0x1733cf['name'],'is\x20disactive');}emitCampaignSummary(_0x1733cf);}}function myreject(_0x544e27){return function(_0x43277c){return _0x544e27(msgResponse(_0x9077('0x86'),_0x9077('0x87'),JSON[_0x9077('0x76')](_0x43277c)));};}Dialer[_0x9077('0x1d')][_0x9077('0x88')]=function(_0x4fd1e8){return!_['isUndefined'](_0x4fd1e8)&&_0x4fd1e8&&!_['isUndefined'](_0x4fd1e8[_0x9077('0x4e')])&&!_[_0x9077('0x45')](_0x4fd1e8[_0x9077('0x89')])&&_0x4fd1e8['active']&&(this['trunks'][util[_0x9077('0x4c')]('SIP/%s',_0x4fd1e8['name'])][_0x9077('0x8a')]===_0x9077('0x8b')||this[_0x9077('0x25')][util[_0x9077('0x4c')](_0x9077('0x8c'),_0x4fd1e8[_0x9077('0x4e')])][_0x9077('0x8a')]===_0x9077('0x8d'));};Dialer[_0x9077('0x1d')][_0x9077('0x8e')]=function(_0x348516){var _0x3a822f=this;return function(){if(!_0x3a822f['isTrunkReachable'](_0x348516[_0x9077('0x8f')])){if(!_0x3a822f[_0x9077('0x88')](_0x348516[_0x9077('0x90')])){_0x348516['message']=utils[_0x9077('0x7d')][_0x9077('0x91')];throw _0x348516[_0x9077('0x4e')]+_0x9077('0x92');}}};};Dialer[_0x9077('0x1d')]['checkIfTime']=function(_0x350e1e,_0x4763b9,_0x114b52,_0x52f8e9){var _0x32604a=this;return function(){var _0x152f9d=!![];return _0x32604a[_0x9077('0x93')](_0x350e1e,_0x4763b9,_0x114b52,_0x52f8e9,_0x152f9d);};};Dialer[_0x9077('0x1d')]['checkIfTimeIntervals']=function(_0x2e89f2,_0x2b496f,_0x1cd5c8,_0x282083){var _0x2785d5=this;return function(){var _0x3b14aa=![];return _0x2785d5[_0x9077('0x93')](_0x2e89f2[_0x9077('0x7a')],_0x2b496f,_0x1cd5c8,_0x282083,_0x3b14aa);};};Dialer[_0x9077('0x1d')][_0x9077('0x93')]=function(_0x1a2c2c,_0x463d65,_0x17623b,_0x541af3,_0x260801){var _0x2cf8f5=[];return new Promise(function(_0xf906bb,_0x4af4e1){if(!isNotNull(_0x1a2c2c)){_0x541af3['message']=utils[_0x9077('0x7d')][_0x9077('0x7b')];return _0x4af4e1(msgResponse(_0x9077('0x94'),_0x9077('0x95'),_0x17623b+_0x9077('0x96')));}if(_[_0x9077('0x7c')](_0x1a2c2c)){_0x541af3['message']=utils[_0x9077('0x7d')]['EMPTY_INTERVAL'];return _0x4af4e1(msgResponse(_0x9077('0x94'),_0x9077('0x95'),_0x17623b+_0x9077('0x97')));}if(_0x463d65&&_['isUndefined'](config['timezones'][_0x463d65])){_0x541af3[_0x9077('0x6f')]=utils[_0x9077('0x7d')]['UNKNOWN_TIMEZONE'];return _0x4af4e1(msgResponse(_0x9077('0x94'),_0x9077('0x95'),_0x17623b+_0x9077('0x98')+_0x463d65));}if(_['isArray'](_0x1a2c2c)){for(var _0x4ceb30=0x0;_0x4ceb30<_0x1a2c2c[_0x9077('0x99')];_0x4ceb30+=0x1){_0x2cf8f5[_0x9077('0x9a')](ami[_0x9077('0x9b')]({'action':_0x9077('0x9c'),'command':util['format'](_0x9077('0x9d'),_0x1a2c2c[_0x4ceb30][_0x9077('0x9e')],!_[_0x9077('0x45')](config[_0x9077('0x9f')][_0x463d65])?_0x463d65:'')})[_0x9077('0x43')](function(_0x4e6968){return _0x4e6968[_0x9077('0xa0')][_0x9077('0xa1')](_0x9077('0xa2'))>=0x0;})[_0x9077('0xa3')](myreject(_0x4af4e1)));}}else{_0x2cf8f5['push'](ami['Action']({'action':_0x9077('0x9c'),'command':util[_0x9077('0x4c')](_0x9077('0x9d'),_0x1a2c2c,!_['isUndefined'](config[_0x9077('0x9f')][_0x463d65])?_0x463d65:'')})[_0x9077('0x43')](function(_0x41befd){return _0x41befd['content'][_0x9077('0xa1')](_0x9077('0xa2'))>=0x0;})[_0x9077('0xa3')](myreject(_0x4af4e1)));}Promise[_0x9077('0xa4')](_0x2cf8f5)[_0x9077('0x43')](function(_0x6321f0){var _0x5cd2e3=_['some'](_0x6321f0);if(_0x5cd2e3){return _0xf906bb(_0x5cd2e3);}else{_0x541af3[_0x9077('0x6f')]=_0x260801?utils[_0x9077('0x7d')][_0x9077('0xa5')]:utils[_0x9077('0x7d')][_0x9077('0xa6')];return _0x4af4e1(msgResponse(_0x9077('0xa7'),'Failure',_0x9077('0xa8')+_0x260801+'\x20'+_0x17623b+_0x9077('0xa9')+util[_0x9077('0x4b')](_0x1a2c2c,{'showHidden':![],'depth':null})+_0x9077('0xaa')+_0x463d65));}})[_0x9077('0xa3')](function(_0x17dccd){return _0x4af4e1(msgResponse('ifTime','Failure',JSON[_0x9077('0x76')](_0x17dccd)));});});};Dialer[_0x9077('0x1d')][_0x9077('0x41')]=function(){var _0x44fbc9=this;return cmHopper[_0x9077('0xab')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x44fbc9['syncCampaigns']();},0x3e8);});};Dialer[_0x9077('0x1d')][_0x9077('0xac')]=function(){var _0x3e07be=this;var _0x27a236;for(var _0x40d46c in this[_0x9077('0x23')]){if(typeof this['campaigns'][_0x40d46c]!==_0x9077('0xad')){_0x27a236=this['campaigns'][_0x40d46c];if(utils[_0x9077('0x80')](_0x27a236)&&utils[_0x9077('0xae')](_0x27a236)){_0x27a236[_0x9077('0x83')]=!![];Promise['resolve']()[_0x9077('0x43')](checkIsIVRCampaignActive(_0x27a236))[_0x9077('0x43')](checkInterval(_0x27a236))[_0x9077('0x43')](_0x3e07be[_0x9077('0x8e')](_0x27a236))[_0x9077('0x43')](_0x3e07be[_0x9077('0xaf')](_0x27a236['dialGlobalInterval'],_0x27a236[_0x9077('0xb0')],_0x27a236[_0x9077('0x4e')],_0x27a236))['then'](_0x3e07be['checkIfTimeIntervals'](_0x27a236[_0x9077('0x79')],_0x27a236[_0x9077('0xb0')],_0x27a236['name'],_0x27a236))[_0x9077('0x43')](_0x3e07be[_0x9077('0xb1')](_0x27a236))[_0x9077('0xa3')](loggerCatchQueueSummary(_0x9077('0xb2'),_0x27a236));}else{notSendMessagesCampaign(_0x27a236);}}}};Dialer[_0x9077('0x1d')][_0x9077('0xb3')]=function(_0x480e82){if(_0x480e82[_0x9077('0xb4')]!==_0x9077('0x8')){clearPredictiveAttributes(_0x480e82);}switch(_0x480e82[_0x9077('0xb4')]){case _0x9077('0xb5'):this['handlePower'](_0x480e82,0x1);break;case _0x9077('0xb6'):this[_0x9077('0xb7')](_0x480e82,_0x480e82['dialPowerLevel']);break;case _0x9077('0x8'):this[_0x9077('0x8')](_0x480e82);break;case _0x9077('0xb8'):this[_0x9077('0xb7')](_0x480e82,0x1);break;default:logger[_0x9077('0x69')](_0x9077('0xb9'),_0x480e82[_0x9077('0x4e')],_0x9077('0xba'));}};Dialer[_0x9077('0x1d')][_0x9077('0x94')]=function(_0x2f7369,_0xc6141){var _0x149645=_0x2f7369[_0x9077('0xb0')];var _0x2dcc4e=_0xc6141?_0x2f7369[_0x9077('0xbb')]:_0x2f7369[_0x9077('0x79')][_0x9077('0x7a')];logger['silly'](_0x9077('0xbc'),_0x2dcc4e,_0x149645,_0x2f7369[_0x9077('0x4e')],util[_0x9077('0x4c')](_0x9077('0xbd'),_0x2f7369[_0x9077('0x4e')],_0x2f7369['id']));var _0x3303d1=null;return Interval[_0x9077('0xbe')](_0x2dcc4e,_0x149645)[_0x9077('0x43')](function(_0x5e452d){if(_0x5e452d===!![]){return _0x5e452d;}else{_0x2f7369[_0x9077('0x6f')]=_0xc6141?utils[_0x9077('0x7d')][_0x9077('0xa5')]:utils[_0x9077('0x7d')][_0x9077('0xa6')];_0x3303d1=msgResponse(_0x9077('0xa7'),_0x9077('0x95'),'Global:\x20'+_0xc6141+'\x20'+_0x2f7369['name']+_0x9077('0xa9')+util[_0x9077('0x4b')](_0x2dcc4e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x149645);}if(_0x3303d1!==null){logger[_0x9077('0xbf')](_0x9077('0xc0'),_0x3303d1);_0x3303d1[_0x9077('0xc1')]=_0xc6141;throw _0x3303d1;}})[_0x9077('0xa3')](function(_0x202690){logger['error'](_0x9077('0xc2'),_0x202690);throw msgResponse(_0x9077('0x86'),'Error',util[_0x9077('0x4b')](_0x202690,{'showHidden':![],'depth':null}));});};Dialer[_0x9077('0x1d')][_0x9077('0x31')]=function(_0x137b78){if(this[_0x9077('0x22')][_0x137b78[_0x9077('0xc3')]]){if(this['uniqueId'][_0x137b78['uniqueid']]&&this[_0x9077('0x2a')][_0x137b78[_0x9077('0xc4')]]['type']!==_0x9077('0xc5')){this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x137b78[_0x9077('0xc3')]]);this['uniqueId'][_0x137b78[_0x9077('0xc4')]]['answertime']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));}}};Dialer[_0x9077('0x1d')][_0x9077('0x36')]=function(_0x583a52){var _0x3d1580=this[_0x9077('0x2a')][_0x583a52['uniqueid']];if(this['voiceQueues'][_0x583a52[_0x9077('0xc3')]]){if(_0x3d1580&&_0x3d1580[_0x9077('0x47')]!=='ivr'){delete this[_0x9077('0x2a')][_0x583a52['uniqueid']];this['voiceQueues'][_0x583a52[_0x9077('0xc3')]]['outboundAnswerCallsDay']+=0x1;var _0x379e2d=new AgentComplete(_0x3d1580,_0x583a52);if(_0x583a52[_0x9077('0xc8')]==='agent'){_0x379e2d[_0x9077('0xc9')]=this[_0x9077('0x22')][_0x583a52[_0x9077('0xc3')]][_0x9077('0xca')]&&this[_0x9077('0x22')][_0x583a52[_0x9077('0xc3')]][_0x9077('0xcb')]?moment()[_0x9077('0x4c')](_0x9077('0xc7')):undefined;}hopperUtils[_0x9077('0xcc')](_0x379e2d)[_0x9077('0xa3')](loggerCatch(_0x9077('0xcd')));hopperUtils[_0x9077('0xce')](_0x379e2d)['catch'](loggerCatch(_0x9077('0xcf')));}}};Dialer[_0x9077('0x1d')][_0x9077('0xd0')]=function(_0x430a87){var _0x2e2e33=this[_0x9077('0x2a')][_0x430a87['uniqueid']];var _0x22483f=this;var _0x55b772=![];var _0x3fc01b;var _0x37d83d;if(this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]]){if(_0x2e2e33&&_0x2e2e33[_0x9077('0x47')]!=='ivr'){delete this['uniqueId'][_0x430a87['uniqueid']];this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]]);_0x2e2e33['droptime']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));var _0x4b3f32=new QueueCallerAbandon(_0x2e2e33,_0x430a87);if(utils[_0x9077('0x65')](_0x2e2e33[_0x9077('0xd1')],_0x2e2e33['responsetime'])>=_0x2e2e33['dialQueueTimeout']){this['voiceQueues'][_0x430a87['queue']][_0x9077('0xd2')]+=0x1;this[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0xd3')]+=0x1;this[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0xd4')]+=0x1;_0x4b3f32['state']=0xa;_0x4b3f32['statedesc']='Drop';_0x4b3f32['dropreason']='TIMEOUT';_0x4b3f32['agiafterat']=this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xca')]?moment()[_0x9077('0x4c')](_0x9077('0xc7')):undefined;_0x4b3f32[_0x9077('0xd5')]+=0x1;_0x4b3f32['countglobal']+=0x1;_0x3fc01b=this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xd6')];_0x37d83d=this['voiceQueues'][_0x430a87['queue']][_0x9077('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x4b3f32,_0x4b3f32[_0x9077('0xd8')],_0x2e2e33[_0x9077('0xd9')])[_0x9077('0x43')](function(_0x4843b3){_0x55b772=_0x4843b3[_0x9077('0xda')]==0x1;if(_0x4b3f32[_0x9077('0xd5')]>=_0x22483f['voiceQueues'][_0x430a87['queue']]['dialDropMaxRetry']){_0x22483f[_0x9077('0xdb')](_0x4b3f32,_0x4843b3['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4b3f32['countdropretry'],'scheduledat':moment()[_0x9077('0xdc')](_0x22483f[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0xd6')],_0x9077('0xdd'))['format'](_0x9077('0xc7')),'ContactId':_0x2e2e33[_0x9077('0xde')],'ListId':_0x2e2e33[_0x9077('0xdf')],'VoiceQueueId':_0x2e2e33[_0x9077('0xe0')]||undefined,'CampaignId':_0x2e2e33['CampaignId']||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0xe1')));var _0x3f34a0=new History(_0x4b3f32);_0x3f34a0['state']=0xa;_0x3f34a0['statedesc']=_0x9077('0xe2');_0x3f34a0['starttime']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));_0x3f34a0[_0x9077('0x72')]=_0x3f34a0[_0x9077('0xe3')];_0x3f34a0['calleridname']=_0x4b3f32[_0x9077('0xe4')];_0x3f34a0[_0x9077('0xe5')]=_0x4b3f32[_0x9077('0xe5')];hopperUtils['createHistory'](_0x3f34a0)[_0x9077('0xa3')](loggerCatch(_0x9077('0xe6')));}})[_0x9077('0x43')](function(){if(_0x55b772)hopperUtils[_0x9077('0xe7')](_0x4b3f32,_0x3fc01b,_0x37d83d)[_0x9077('0x43')](function(){return 0x1;});});}else{this[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0x56')]+=0x1;this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xe8')]+=0x1;_0x4b3f32['state']=0xb;_0x4b3f32[_0x9077('0xe9')]='Abandoned';_0x4b3f32[_0x9077('0xea')]=_0x9077('0xeb');_0x4b3f32[_0x9077('0xec')]+=0x1;_0x4b3f32[_0x9077('0xed')]+=0x1;_0x3fc01b=this['voiceQueues'][_0x430a87[_0x9077('0xc3')]]['dialAbandonedRetryFrequency'];_0x37d83d=this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x4b3f32,_0x4b3f32[_0x9077('0xd8')],_0x2e2e33[_0x9077('0xd9')])[_0x9077('0x43')](function(_0x10a7bf){if(_0x4b3f32[_0x9077('0xec')]>=_0x22483f[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xee')]){_0x22483f[_0x9077('0xdb')](_0x4b3f32,_0x10a7bf[_0x9077('0xda')]);}else{hopperUtils[_0x9077('0xef')]({'active':![],'countabandonedretry':_0x4b3f32[_0x9077('0xec')],'scheduledat':moment()['add'](_0x22483f['voiceQueues'][_0x430a87[_0x9077('0xc3')]]['dialAbandonedRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x2e2e33[_0x9077('0xde')],'ListId':_0x2e2e33[_0x9077('0xdf')],'VoiceQueueId':_0x2e2e33[_0x9077('0xe0')]||undefined,'CampaignId':_0x2e2e33[_0x9077('0xf0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x34b43a=new History(_0x4b3f32);_0x34b43a[_0x9077('0xd8')]=0xb;_0x34b43a['statedesc']=_0x9077('0xf1');_0x34b43a[_0x9077('0xe3')]=moment()[_0x9077('0x4c')](_0x9077('0xc7'));_0x34b43a['endtime']=_0x34b43a['starttime'];_0x34b43a['calleridname']=_0x4b3f32[_0x9077('0xe4')];_0x34b43a[_0x9077('0xe5')]=_0x4b3f32['calleridnum'];hopperUtils[_0x9077('0xcc')](_0x34b43a)[_0x9077('0xa3')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x9077('0x43')](function(){if(_0x55b772)hopperUtils[_0x9077('0xe7')](_0x4b3f32,_0x3fc01b,_0x37d83d)[_0x9077('0x43')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x9077('0x3c')]=function(_0x305c4b){if(this['actions'][_0x305c4b[_0x9077('0xc4')]]){this[_0x9077('0x28')][_0x305c4b[_0x9077('0xc4')]][_0x9077('0xf2')]=_0x305c4b['channel'];}if(this[_0x9077('0x2a')][_0x305c4b[_0x9077('0xc4')]]){this[_0x9077('0x2a')][_0x305c4b[_0x9077('0xc4')]][_0x9077('0xf2')]=_0x305c4b[_0x9077('0xf2')];}};Dialer[_0x9077('0x1d')]['syncQueueMember']=function(_0x3b096a){if(!this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]]){return;}var _0x35d1b5=this[_0x9077('0x22')][this['actions'][_0x3b096a['actionid']]['queue']][_0x9077('0xf4')]||_0x9077('0xf5');if(_0x35d1b5==='roundrobin'){if(this['actions'][_0x3b096a['actionid']]&&_[_0x9077('0xf6')](this['actions'][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xf7')])&&_0x3b096a[_0x9077('0x8a')]==='1'&&_0x3b096a['paused']==='0'){if(this[_0x9077('0x24')][_0x3b096a[_0x9077('0xf8')]]){if(!this[_0x9077('0x24')][_0x3b096a[_0x9077('0xf8')]][_0x9077('0xf7')]){this['agents'][_0x3b096a[_0x9077('0xf8')]][_0x9077('0xf7')]=!![];this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xf7')]=!![];this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xf8')]=_0x3b096a[_0x9077('0xf8')];}}}}else if(_0x35d1b5===_0x9077('0xf5')){if(this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]]){if(this[_0x9077('0x24')][_0x3b096a['stateinterface']]){this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]]['stateinterface']=_0x3b096a[_0x9077('0xf8')];if(_[_0x9077('0xf6')](this['queueBooked'][this['actions'][_0x3b096a['actionid']][_0x9077('0xc3')]])){this[_0x9077('0x2d')][this['actions'][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xc3')]]=[];}this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3b096a['actionid']][_0x9077('0xc3')]][_0x9077('0x9a')](_[_0x9077('0x64')](_[_0x9077('0x77')](this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]],[_0x9077('0xf9'),_0x9077('0xf8')]),{'status':_0x3b096a[_0x9077('0x8a')],'paused':_0x3b096a[_0x9077('0xfa')]}));}}}};Dialer['prototype'][_0x9077('0x40')]=function(_0x3a3db7){if(!this['actions'][_0x3a3db7[_0x9077('0xf3')]]){return;}var _0x417189=this;var _0x9edae2=this[_0x9077('0x22')][this['actions'][_0x3a3db7[_0x9077('0xf3')]]['queue']];var _0x18b3bb=_0x9edae2[_0x9077('0xf4')]||_0x9077('0xf5');if(_0x18b3bb===_0x9077('0xfb')){if(this[_0x9077('0x28')][_0x3a3db7['actionid']]&&this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xf8')]){this['preview'][_0x9077('0xfc')](this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xf9')],this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]]['stateinterface'])[_0x9077('0xa3')](function(_0x1856b6){logger['error'](_0x9077('0xfd'),util[_0x9077('0x4b')](_0x1856b6,{'showHidden':![],'depth':null}));})[_0x9077('0xfe')](function(){_0x417189[_0x9077('0xc6')](_0x417189[_0x9077('0x22')][_0x417189['actions'][_0x3a3db7['actionid']][_0x9077('0xc3')]]);_0x417189['agents'][_0x417189['actions'][_0x3a3db7[_0x9077('0xf3')]]['stateinterface']][_0x9077('0xf7')]=![];delete _0x417189['actions'][_0x3a3db7['actionid']];unlockQueueStatus(_0x9edae2);});}else{this[_0x9077('0xc6')](this['voiceQueues'][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xde')],'ListId':this[_0x9077('0x28')][_0x3a3db7['actionid']][_0x9077('0xdf')],'VoiceQueueId':this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xe0')]||undefined,'CampaignId':this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0xff')));delete this[_0x9077('0x28')][_0x3a3db7['actionid']];unlockQueueStatus(_0x9edae2);}}else if(_0x18b3bb==='rrmemory'){var _0x2a4edb;if(this['actions'][_0x3a3db7[_0x9077('0xf3')]]&&!_[_0x9077('0x7c')](this['queueBooked'][this['actions'][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]])){if(this['queueBookedRR'][_0x417189[_0x9077('0x28')][_0x3a3db7['actionid']][_0x9077('0xc3')]]){this[_0x9077('0x2e')][_0x417189['actions'][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]=this['queueBookedRR'][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]?this[_0x9077('0x2e')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]]['queue']]:this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]?this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]['_rr']||0x0:0x0;}this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]]['queue']]['_rr']=this['queueBookedRR'][this['actions'][_0x3a3db7['actionid']][_0x9077('0xc3')]];for(var _0x2a5657=0x0;_0x2a5657=_0x2cf5cd[_0x9077('0x126')]){_0x199cd6[_0x9077('0x127')](_0x47d4ed,_0x30b3d0,_0x380a03,_0x9077('0x128'));}else{if(_0x47d4ed['countmachineretry']>=_0x2cf5cd[_0x9077('0x129')]){_0x199cd6[_0x9077('0x12a')](_0x47d4ed,_0x30b3d0,_0x380a03,_0x9077('0x12b'));}else{hopperUtils[_0x9077('0xef')]({'active':![],'countmachineretry':_0x47d4ed[_0x9077('0x120')],'scheduledat':moment()['add'](_0x2cf5cd[_0x9077('0x12c')],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x47d4ed[_0x9077('0xde')],'ListId':_0x47d4ed[_0x9077('0xdf')],'VoiceQueueId':_0x47d4ed[_0x9077('0xe0')]||undefined,'CampaignId':_0x47d4ed[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x12d')));_0x30b3d0({'reschedule':0x1});}}});}if(_0x198d23[_0x9077('0x47')]===_0x9077('0xc5')&&this[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]][_0x9077('0x112')]&&_0x41bcdb[_0x9077('0x113')]===_0x9077('0x114')){delete this[_0x9077('0x2a')][_0x41bcdb[_0x9077('0xc4')]];this[_0x9077('0xc6')](this['campaigns'][_0x198d23[_0x9077('0xc3')]]);_0x137867=new Hangup(_0x198d23,_0x41bcdb);_0x137867[_0x9077('0xd8')]=0x12;_0x137867[_0x9077('0xe9')]=_0x9077('0x116');_0x137867[_0x9077('0x117')]=_0x9077('0x11f');ami['emit'](_0x9077('0x118'),ut[_0x9077('0x119')](_0x137867,'amd'));this[_0x9077('0x11a')](_0x137867,_0x9077('0x12e'),_0x9077('0x12f'));}if(_0x198d23[_0x9077('0x47')]==='ivr'&&this[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]][_0x9077('0x112')]&&_0x41bcdb[_0x9077('0x113')]===_0x9077('0x11d')){return new Promise(function(_0x3a1d08,_0x1a4773){delete _0x199cd6[_0x9077('0x2a')][_0x41bcdb[_0x9077('0xc4')]];_0x199cd6[_0x9077('0xc6')](_0x199cd6[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]]);_0x199cd6[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]][_0x9077('0x130')]+=0x1;_0x199cd6[_0x9077('0x23')][_0x198d23['queue']][_0x9077('0x115')]+=0x1;var _0x2d4dd9=_0x199cd6[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]];var _0x4fe667=new Hangup(_0x198d23,_0x41bcdb);_0x4fe667[_0x9077('0xd8')]=0x13;_0x4fe667[_0x9077('0xe9')]='Machine';_0x4fe667[_0x9077('0x117')]=_0x9077('0x11f');_0x4fe667[_0x9077('0x120')]+=0x1;_0x4fe667['countglobal']+=0x1;_0x4fe667[_0x9077('0x121')]=!![];ami[_0x9077('0x46')](_0x9077('0x118'),ut[_0x9077('0x119')](_0x4fe667,_0x9077('0x121')));hopperUtils[_0x9077('0xcc')](_0x4fe667)[_0x9077('0xa3')](loggerCatch(_0x9077('0x131')));if(_0x4fe667['countbusyretry']+_0x4fe667[_0x9077('0x123')]+_0x4fe667[_0x9077('0x132')]+_0x4fe667['countnosuchnumberretry']+_0x4fe667[_0x9077('0xd5')]+_0x4fe667[_0x9077('0xec')]+_0x4fe667['countmachineretry']+_0x4fe667[_0x9077('0x125')]>=_0x2d4dd9[_0x9077('0x126')]){_0x199cd6[_0x9077('0x127')](_0x4fe667,_0x3a1d08,_0x1a4773,_0x9077('0x128'));}else{if(_0x4fe667['countmachineretry']>=_0x2d4dd9[_0x9077('0x129')]){_0x199cd6[_0x9077('0x12a')](_0x4fe667,_0x3a1d08,_0x1a4773,'reason\x2019\x20machine....');}else{hopperUtils[_0x9077('0xef')]({'active':![],'countmachineretry':_0x4fe667[_0x9077('0x120')],'scheduledat':moment()[_0x9077('0xdc')](_0x2d4dd9[_0x9077('0x12c')],_0x9077('0xdd'))['format'](_0x9077('0xc7')),'ContactId':_0x4fe667[_0x9077('0xde')],'ListId':_0x4fe667[_0x9077('0xdf')],'VoiceQueueId':_0x4fe667['VoiceQueueId']||undefined,'CampaignId':_0x4fe667[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x12d')));_0x3a1d08({'reschedule':0x1});}}});}}};Dialer[_0x9077('0x1d')]['syncHangup']=function(_0x2e792e){var _0x34a49a=this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];var _0x3c68cc;if(_0x34a49a&&_0x34a49a[_0x9077('0x47')]===_0x9077('0xc5')){delete this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];this[_0x9077('0xc6')](this[_0x9077('0x23')][_0x34a49a[_0x9077('0xc3')]]);this[_0x9077('0x23')][_0x34a49a[_0x9077('0xc3')]][_0x9077('0x133')]+=0x1;_0x3c68cc=new Hangup(_0x34a49a,_0x2e792e);hopperUtils[_0x9077('0xcc')](_0x3c68cc)['catch'](loggerCatch(_0x9077('0x134')));hopperUtils[_0x9077('0xce')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch('[syncHangupIvr]'));}if(_0x34a49a&&_0x34a49a[_0x9077('0x47')]!==_0x9077('0xc5')&&isNotNull(this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]][_0x9077('0x135')])){delete this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x34a49a['queue']]);this[_0x9077('0x22')][_0x34a49a['queue']][_0x9077('0x130')]+=0x1;this['voiceQueues'][_0x34a49a[_0x9077('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3c68cc=new Hangup(_0x34a49a,_0x2e792e);_0x3c68cc['state']=0x10;_0x3c68cc[_0x9077('0xe9')]='AnswerAGI';_0x3c68cc[_0x9077('0x117')]=_0x9077('0x136');hopperUtils[_0x9077('0xcc')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch(_0x9077('0x134')));hopperUtils[_0x9077('0xce')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch('[syncHangupIvr]'));}if(_0x34a49a&&_0x34a49a[_0x9077('0x47')]!==_0x9077('0xc5')&&!isNotNull(this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]][_0x9077('0x135')])){delete this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]]);this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]]['outboundUnknownCallsDay']+=0x1;_0x3c68cc=new Hangup(_0x34a49a,_0x2e792e);_0x3c68cc['state']=0xc;_0x3c68cc[_0x9077('0xe9')]=_0x2e792e[_0x9077('0x137')];_0x3c68cc['membername']=_0x9077('0x138');hopperUtils[_0x9077('0xcc')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch(_0x9077('0x134')));hopperUtils[_0x9077('0xce')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch(_0x9077('0x139')));}};Dialer[_0x9077('0x1d')][_0x9077('0xa')]=function(_0x3033b7){var _0x27fc33=this;if(!_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]]){_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]]={'running':![]};}else if(_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]]['running']===!![]){return;}else if(_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]][_0x9077('0x13a')]===![]){_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]][_0x9077('0x13a')]=!![];}var _0x566fab=_0x27fc33[_0x9077('0x22')][_0x3033b7[_0x9077('0x4e')]];var _0x52ba07=_0x566fab[_0x9077('0x6f')]!==utils[_0x9077('0x7d')][_0x9077('0x7e')];var _0x6fcb38=utils['isPreviewCampaign'](_0x566fab);_0x566fab[_0x9077('0x13b')]=utils[_0x9077('0x13c')](_0x566fab,_0x27fc33[_0x9077('0x25')]);Promise[_0x9077('0x13d')]()[_0x9077('0x43')](function(){if(_0x566fab['statusMessage']===utils[_0x9077('0x7d')]['INACTIVE']){if(_0x52ba07){clearPredictiveAttributes(_0x566fab);_0x3033b7[_0x9077('0x2b')]=undefined;_0x3033b7[_0x9077('0x66')]=undefined;}if(_0x566fab[_0x9077('0x13b')]===utils['CAMPAIGN_STATUS'][_0x9077('0x7e')]){_0x3033b7['available']=0x0;_0x3033b7[_0x9077('0xfa')]=0x0;_0x3033b7[_0x9077('0x13e')]=0x0;_0x3033b7[_0x9077('0x13f')]=0x0;_0x3033b7[_0x9077('0x140')]=0x0;}}else if(_0x566fab[_0x9077('0x13b')]===utils[_0x9077('0x7d')][_0x9077('0x141')]&&!_0x6fcb38){return _0x27fc33[_0x9077('0x94')](_0x566fab,!![])['then'](function(){return _0x27fc33[_0x9077('0x94')](_0x566fab,![]);})[_0x9077('0x43')](function(){return _0x27fc33[_0x9077('0xb3')](_0x566fab);})['catch'](function(_0x2c65ad){loggerSyncQueueSummary['debug'](_0x9077('0x142'),util[_0x9077('0x4b')](_0x2c65ad,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x566fab);});}else{clearPredictiveAttributes(_0x566fab);}})[_0x9077('0x43')](function(){var _0x80084f=_0x3033b7[_0x9077('0x143')](_0x566fab);if(_0x80084f||_0x566fab[_0x9077('0x144')]){_0x566fab[_0x9077('0x144')]=![];_0x3033b7['updateReportFromOutboundQueue'](_0x566fab);Object[_0x9077('0x145')](_0x566fab,_0x3033b7);emitOutboundVoiceQueueSummary(_0x3033b7);}_0x27fc33[_0x9077('0x2f')][_0x566fab[_0x9077('0x4e')]]['running']=![];})[_0x9077('0xa3')](function(_0x177645){logger[_0x9077('0x69')](_0x9077('0x142'),util['inspect'](_0x177645,{'showHidden':![],'depth':null}));_0x27fc33[_0x9077('0x2f')][_0x566fab[_0x9077('0x4e')]]['running']=![];});};Dialer[_0x9077('0x1d')]['syncQueueSummaryComplete']=_[_0x9077('0x146')](function(){var _0x1f5cdf=_[_0x9077('0x147')](this['voiceQueues'],function(_0x305f0c){return _0x305f0c['dialPreviewRecallmeReminder'];});var _0x24aba3=_[_0x9077('0x147')](this[_0x9077('0x24')],function(_0x277a2d){return _0x277a2d['online']&&_0x277a2d['status']==='reachable';});if(_0x1f5cdf[_0x9077('0x99')]>0x0&&_0x24aba3[_0x9077('0x99')]>0x0){return Promise[_0x9077('0x13d')]()[_0x9077('0x43')](cmHopper[_0x9077('0x148')](_[_0x9077('0x149')](_0x1f5cdf,'id'),previewRecallmeReminderInterval,_[_0x9077('0x149')](_0x24aba3,'id')))[_0x9077('0x43')](function(_0x277a54){for(var _0x5cbef1=0x0;_0x5cbef1<_0x277a54['length'];_0x5cbef1++){var _0x618e89=_0x277a54[_0x5cbef1][_0x9077('0x14a')]['name'];if(_0x618e89)io['to'](util[_0x9077('0x4c')]('user:%s',_0x618e89))[_0x9077('0x46')](_0x9077('0x14b'),{'hopper':_0x277a54[_0x5cbef1]});}})[_0x9077('0xa3')](function(_0x3c7399){logger['error']('checkPreviewRecallReminder',_0x3c7399);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9077('0x1d')][_0x9077('0x14c')]=function(){var _0x5c796c=this;setInterval(function(){_0x5c796c[_0x9077('0x14d')](_0x5c796c[_0x9077('0x2a')],'[uniqueid]');_0x5c796c[_0x9077('0x14d')](_0x5c796c[_0x9077('0x28')],'[actions]');},0x32c8);};Dialer[_0x9077('0x1d')][_0x9077('0x14d')]=function(_0x4d30e6,_0x2f805e){var _0x1046a8=this;for(var _0x528b0c in _0x4d30e6){if(typeof _0x4d30e6[_0x528b0c]!==_0x9077('0xad')){this[_0x9077('0x20')][_0x9077('0x1e')](function(){if(!_['isNil'](_0x4d30e6[_0x528b0c])){return ami[_0x9077('0x9b')]({'action':_0x9077('0x8a'),'channel':_0x4d30e6[_0x528b0c]['channel']})[_0x9077('0xa3')](function(_0x249a62){if(_0x249a62[_0x9077('0x6f')]===_0x9077('0x14e')){setTimeout(function(){if(_0x4d30e6[_0x528b0c]&&_0x4d30e6[_0x528b0c][_0x9077('0x47')]!==_0x9077('0xc5')){_0x1046a8['updateOriginated'](_0x1046a8[_0x9077('0x22')][_0x4d30e6[_0x528b0c][_0x9077('0xc3')]]);logger[_0x9077('0x69')](_0x9077('0x14f'),_0x2f805e,_0x528b0c,_0x4d30e6[_0x528b0c][_0x9077('0xc3')]);delete _0x4d30e6[_0x528b0c];}if(_0x4d30e6[_0x528b0c]&&_0x4d30e6[_0x528b0c][_0x9077('0x47')]==='ivr'){_0x1046a8[_0x9077('0xc6')](_0x1046a8[_0x9077('0x23')][_0x4d30e6[_0x528b0c][_0x9077('0xc3')]]);logger[_0x9077('0x69')](_0x9077('0x150'),_0x2f805e,_0x528b0c,_0x4d30e6[_0x528b0c][_0x9077('0xc3')]);delete _0x4d30e6[_0x528b0c];}},0x2328);}});}});}}};Dialer[_0x9077('0x1d')][_0x9077('0x151')]=function(_0xc1339a){return Promise[_0x9077('0x13d')]()[_0x9077('0x43')](voiceQueueRt[_0x9077('0x151')](_0xc1339a))[_0x9077('0xa3')](loggerCatch(_0x9077('0x152')));};Dialer['prototype'][_0x9077('0xc6')]=function(_0x5d4339){if(!_['isUndefined'](_0x5d4339)&&_0x5d4339!==null){if(typeof _0x5d4339[_0x9077('0x153')]!==_0x9077('0xad')){if(_0x5d4339[_0x9077('0x153')]>0x0){_0x5d4339[_0x9077('0x153')]-=0x1;}else{logger['error'](_0x9077('0x154'));}}}else{logger[_0x9077('0x69')](_0x9077('0x155'));}};Dialer[_0x9077('0x1d')][_0x9077('0x156')]=function(_0x42d53b,_0x4f5b0e){var _0x258ff7=this;return function(_0x34ac1e){_0x258ff7['updateOriginated'](_0x4f5b0e);logger['error'](_0x42d53b,util[_0x9077('0x4b')](_0x34ac1e,{'showHidden':![],'depth':null}));};};Dialer[_0x9077('0x1d')][_0x9077('0x157')]=function(_0x1027a3,_0xa56c34,_0x43067c){var _0x5f494d={'state':0x19,'statedesc':_0x9077('0x158')};this[_0x9077('0xc6')](_0xa56c34);this['saveInDb'](_[_0x9077('0x64')](_0x5f494d,_[_0x9077('0x77')](_0x43067c,[_0x9077('0xde'),_0x9077('0xdf'),'UserId',_0x9077('0xe0'),_0x9077('0xf0')])),_0x9077('0x159'),_0x9077('0x15a'));logger[_0x9077('0x69')](_0x1027a3);};Dialer[_0x9077('0x1d')]['saveInDb']=function(_0x274d01,_0x5a21bd,_0x49c6e5){hopperUtils['createHistory'](_0x274d01)[_0x9077('0xa3')](loggerCatch(_0x5a21bd));hopperUtils[_0x9077('0xce')](_0x274d01)[_0x9077('0xa3')](loggerCatch(_0x49c6e5));};Dialer[_0x9077('0x1d')][_0x9077('0xdb')]=function(_0x3952b4,_0x3eef52){hopperUtils['createHistory'](_0x3952b4)[_0x9077('0xa3')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x3eef52==0x0){hopperUtils['moveContactManagedDialer'](_0x3952b4)['catch'](loggerCatch(_0x9077('0x15b')));}};Dialer[_0x9077('0x1d')][_0x9077('0x15c')]=function(_0x1dc59a){return Promise[_0x9077('0x13d')]()[_0x9077('0x43')](cmHopper['handlePreviewRecallNotifications'](_0x1dc59a['id'],previewRecallmeReminderInterval))[_0x9077('0x43')](function(_0x4783b7){for(var _0x363e86=0x0;_0x363e86<_0x4783b7[_0x9077('0x99')];_0x363e86++){var _0x32e6ff=_0x4783b7[_0x363e86][_0x9077('0x14a')][_0x9077('0x4e')];if(_0x32e6ff)io['to'](util[_0x9077('0x4c')](_0x9077('0x15d'),_0x32e6ff))[_0x9077('0x46')](_0x9077('0x14b'),{'hopper':_0x4783b7[_0x363e86]});}})[_0x9077('0xa3')](function(){});};Dialer['prototype'][_0x9077('0xb1')]=function(_0x22c688){var _0x140c49=this;return function(){_0x140c49[_0x9077('0x15e')](_0x22c688);};};Dialer[_0x9077('0x1d')][_0x9077('0x15f')]=function(_0x63cb1e,_0x1e02ac){var _0x2282b4=this;var _0x22f5f1=uuid['v4']();this[_0x9077('0x28')][_0x22f5f1]=new Action(_0x63cb1e,_0x1e02ac,_0x22f5f1);return new Promise(function(_0x20c01d,_0x469782){if(_[_0x9077('0x45')](_0x63cb1e)&&typeof _0x63cb1e!==_0x9077('0x160')){return _0x469782(msgResponse('originate',_0x9077('0x95'),_0x9077('0x161')));}if(_['isUndefined'](_0x1e02ac[_0x9077('0x162')])||_0x1e02ac['phone']===null){return _0x469782(msgResponse(_0x9077('0x163'),'Failure',_0x9077('0x164')));}var _0x4b78b5={'XMD-CALLERID':_0x2282b4['actions'][_0x22f5f1]['getCaller'](),'XMD-AGI':_0x63cb1e[_0x9077('0x135')]?util[_0x9077('0x4c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x63cb1e[_0x9077('0x135')]):_0x9077('0x165'),'XMD-AGIAFTER':_0x63cb1e['dialQueueProject2']?util[_0x9077('0x4c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x63cb1e[_0x9077('0xca')]):_0x9077('0x165'),'XMD-QUEUE':utils[_0x9077('0x166')](_0x63cb1e)?util['format'](_0x9077('0x167'),_0x63cb1e[_0x9077('0x4e')],_0x63cb1e[_0x9077('0x168')]||'',_0x63cb1e[_0x9077('0xcb')]?'c':'',_0x63cb1e[_0x9077('0x169')]||0x3):_0x9077('0x165'),'XMD-CONTACTID':_0x1e02ac['ContactId'],'XMD-CDRTYPE':_0x9077('0x7'),'CALLERID(all)':_0x2282b4[_0x9077('0x28')][_0x22f5f1][_0x9077('0x16a')](),'XMD-AMD':_0x63cb1e[_0x9077('0x112')]?_0x9077('0x141'):_0x9077('0x165'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x63cb1e[_0x9077('0x112')]){_0x4b78b5[_0x9077('0x16b')]=_0x63cb1e[_0x9077('0x16c')]||0x9c4;_0x4b78b5['XMD-AMDGREETING']=_0x63cb1e[_0x9077('0x16d')]||0x5dc;_0x4b78b5[_0x9077('0x16e')]=_0x63cb1e[_0x9077('0x16f')]||0x320;_0x4b78b5[_0x9077('0x170')]=_0x63cb1e[_0x9077('0x171')]||0x1388;_0x4b78b5[_0x9077('0x172')]=_0x63cb1e[_0x9077('0x173')]||0x64;_0x4b78b5[_0x9077('0x174')]=_0x63cb1e[_0x9077('0x175')]||0x32;_0x4b78b5['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x63cb1e[_0x9077('0x176')]||0x3;_0x4b78b5[_0x9077('0x177')]=_0x63cb1e['dialAMDSilenceThreshold']||0x100;_0x4b78b5[_0x9077('0x178')]=_0x63cb1e[_0x9077('0x179')]||0x1388;}if(utils['isOutboundQueue'](_0x63cb1e)){_0x4b78b5[_0x9077('0x17a')]=_0x1e02ac[_0x9077('0xe0')];}else{_0x4b78b5[_0x9077('0x17b')]=_0x1e02ac['CampaignId'];}var _0x14368c=utils[_0x9077('0x17c')](_0x1e02ac['Contact']);Object[_0x9077('0x145')](_0x4b78b5,_0x14368c);var _0x3d18a5=_0x2282b4[_0x9077('0x88')](_0x63cb1e[_0x9077('0x8f')])?utils['getCallerId'](_0x63cb1e[_0x9077('0x8f')][_0x9077('0x17d')],_0x63cb1e[_0x9077('0x17e')],_0x63cb1e[_0x9077('0x17f')]>0x0?utils['getCallerIdRandom'](_0x63cb1e[_0x9077('0x180')],_0x63cb1e[_0x9077('0x17f')]):_0x63cb1e[_0x9077('0x180')]):utils['getCallerId'](_[_0x9077('0xf6')](_0x63cb1e[_0x9077('0x90')])?_0x63cb1e['Trunk'][_0x9077('0x17d')]:_0x63cb1e[_0x9077('0x90')][_0x9077('0x17d')],_0x63cb1e['dialOriginateCallerIdName'],_0x63cb1e[_0x9077('0x17f')]>0x0?utils[_0x9077('0x181')](_0x63cb1e[_0x9077('0x180')],_0x63cb1e['dialRandomLastDigitCallerIdNumber']):_0x63cb1e['dialOriginateCallerIdNumber']);if(_0x3d18a5){_0x4b78b5['XMD-ORIGINATECALLERIDNAME']=_0x2282b4[_0x9077('0x28')][_0x22f5f1]['originatecalleridname']=utils[_0x9077('0x182')](_0x3d18a5);_0x4b78b5[_0x9077('0x183')]=_0x1e02ac[_0x9077('0x162')];}_0x63cb1e[_0x9077('0x184')]=_0x4b78b5;return ami[_0x9077('0x9b')]({'actionid':_0x22f5f1,'action':'originate','channel':_0x2282b4['isTrunkReachable'](_0x63cb1e[_0x9077('0x8f')])?util['format'](_0x9077('0x185'),_0x63cb1e[_0x9077('0x8f')][_0x9077('0x4e')],isNotNull(_0x63cb1e[_0x9077('0x186')])?_0x63cb1e['dialPrefix'][_0x9077('0x187')]()||'':'',_0x63cb1e[_0x9077('0x188')]>0x0?_0x1e02ac[_0x9077('0x162')][_0x9077('0x189')](_0x63cb1e[_0x9077('0x188')]):_0x1e02ac['phone']):util[_0x9077('0x4c')](_0x9077('0x185'),_[_0x9077('0xf6')](_0x63cb1e[_0x9077('0x90')])?_0x63cb1e[_0x9077('0x8f')][_0x9077('0x4e')]:_0x63cb1e[_0x9077('0x90')][_0x9077('0x4e')],isNotNull(_0x63cb1e['dialPrefix'])?_0x63cb1e[_0x9077('0x186')][_0x9077('0x187')]()||'':'',_0x63cb1e[_0x9077('0x188')]>0x0?_0x1e02ac['phone'][_0x9077('0x189')](_0x63cb1e[_0x9077('0x188')]):_0x1e02ac[_0x9077('0x162')]),'callerid':_0x3d18a5,'Exten':_0x9077('0x111'),'Context':_0x9077('0x18a'),'Priority':'1','variable':_0x4b78b5,'timeout':(_0x63cb1e[_0x9077('0x18b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x22f5f1})[_0x9077('0x43')](function(_0x9b9431){return _0x20c01d(_0x9b9431);})['catch'](function(_0x95595d){_0x63cb1e[_0x9077('0x18c')]+=0x1;var _0x33ee67=new History(_0x2282b4[_0x9077('0x28')][_0x22f5f1]);logger[_0x9077('0x69')](util[_0x9077('0x4c')](_0x9077('0x18d'),JSON['stringify'](_0x95595d)));_0x33ee67['state']=0xe;_0x33ee67['statedesc']=_0x9077('0x18e');_0x33ee67[_0x9077('0xe3')]=moment()['format'](_0x9077('0xc7'));_0x33ee67[_0x9077('0x72')]=_0x33ee67[_0x9077('0xe3')];hopperUtils[_0x9077('0xcc')](_0x33ee67)[_0x9077('0xa3')](loggerCatch(_0x9077('0x18f')));_0x2282b4[_0x9077('0xce')](_0x33ee67)[_0x9077('0xa3')](loggerCatch(_0x9077('0x18f')))[_0x9077('0xfe')](function(){delete _0x2282b4['actions'][_0x22f5f1];return _0x469782(msgResponse(_0x9077('0x163'),_0x9077('0x87'),'originate\x20action\x20Error'));});});});};Dialer[_0x9077('0x1d')]['checkRetriveMax']=function(_0xfa0780,_0x4ba994,_0x1bf893){var _0x152b43=new History(_0x4ba994);if(_0x152b43[_0x9077('0x122')]+_0x152b43['countcongestionretry']+_0x152b43[_0x9077('0x132')]+_0x152b43[_0x9077('0x124')]+_0x152b43[_0x9077('0xd5')]+_0x152b43['countabandonedretry']+_0x152b43[_0x9077('0x120')]+_0x152b43[_0x9077('0x125')]>=_0x1bf893[_0x9077('0x126')]-0x1){return!![];}switch(_0xfa0780){case 0x3:if(_0x152b43[_0x9077('0x132')]>=_0x1bf893['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countnoanswerretry':_0x152b43[_0x9077('0x132')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893[_0x9077('0x190')],'minutes')[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})['catch'](loggerCatch(_0x9077('0x191')));break;case 0x5:if(_0x152b43['countbusyretry']>=_0x1bf893[_0x9077('0x192')]-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countbusyretry':_0x152b43[_0x9077('0x122')]+=0x1,'scheduledat':moment()['add'](_0x1bf893['dialBusyRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x193')));break;case 0x8:if(_0x152b43[_0x9077('0x123')]>=_0x1bf893['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countcongestionretry':_0x152b43[_0x9077('0x123')]+=0x1,'scheduledat':moment()['add'](_0x1bf893['dialCongestionRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x152b43[_0x9077('0x124')]>=_0x1bf893[_0x9077('0x194')]-0x1){return!![];}else{hopperUtils[_0x9077('0xef')]({'active':![],'countnosuchnumberretry':_0x152b43[_0x9077('0x124')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893['dialNoSuchNumberRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43['VoiceQueueId']||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})['catch'](loggerCatch(_0x9077('0x195')));}break;case 0xa:if(_0x152b43['countdropretry']>=_0x1bf893[_0x9077('0x196')]-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countdropretry':_0x152b43[_0x9077('0xd5')]+=0x1,'scheduledat':moment()['add'](_0x1bf893[_0x9077('0xd6')],'minutes')[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43['ContactId'],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43['VoiceQueueId']||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0xe1')));break;case 0xb:if(_0x152b43[_0x9077('0xec')]>=_0x1bf893['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countabandonedretry':_0x152b43[_0x9077('0xec')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893[_0x9077('0x197')],_0x9077('0xdd'))[_0x9077('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x152b43['ContactId'],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x198')));break;case 0x13:if(_0x152b43['countmachineretry']>=_0x1bf893['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countmachineretry':_0x152b43[_0x9077('0x120')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893['dialMachineRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x152b43[_0x9077('0x125')]>=_0x1bf893['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countagentrejectretry':_0x152b43[_0x9077('0x125')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893[_0x9077('0x199')],'minutes')[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43['CampaignId']||undefined})[_0x9077('0xa3')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x9077('0x1d')]['callProgressDetecting']=function(_0x1f5644,_0x12eb68,_0x438e34){var _0x372b69=this;var _0x503a60=new History(_0x1f5644);var _0x1aea1a=![];var _0x1edb27;var _0x25ed0b;return new Promise(function(_0x98952f,_0xa9f2ab){if(_['isUndefined'](_0x12eb68)&&typeof _0x12eb68!==_0x9077('0x160')){return _0xa9f2ab(msgResponse(_0x9077('0x19a'),_0x9077('0x95'),_0x9077('0x19b')));}if(_[_0x9077('0x45')](_0x438e34)&&typeof _0x438e34!=='object'){return _0xa9f2ab(msgResponse(_0x9077('0x19a'),_0x9077('0x95'),'evt\x20is\x20undefine'));}hopperUtils[_0x9077('0x19c')](_0x503a60,_0x438e34[_0x9077('0xc8')],_0x12eb68)[_0x9077('0x43')](function(_0xea213){if(_0xea213['additional']==0x1)_0x1aea1a=!![];switch(_0x438e34[_0x9077('0xc8')]){case'0':_0x12eb68['outboundNoSuchCallsDay']+=0x1;_0x503a60[_0x9077('0xd8')]=0x0;_0x503a60['statedesc']='NoSuchNumber';_0x503a60[_0x9077('0x124')]+=0x1;_0x503a60[_0x9077('0xed')]+=0x1;ami[_0x9077('0x46')](_0x9077('0x19d'),ut[_0x9077('0x119')](_0x1f5644,'nosuchnumber'));_0x1edb27=_0x12eb68[_0x9077('0x19e')];_0x25ed0b=_0x12eb68['callAdditionalPhoneAfterMin'];hopperUtils[_0x9077('0xcc')](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x131')));if(_0x372b69[_0x9077('0x19f')](0x0,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60['countnosuchnumberretry']>=_0x12eb68[_0x9077('0x194')]){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a0'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a0'));}}break;case'3':_0x12eb68[_0x9077('0x1a1')]+=0x1;_0x503a60['state']=0x3;_0x503a60[_0x9077('0xe9')]=_0x9077('0x1a2');_0x503a60['countnoanswerretry']+=0x1;_0x503a60['countglobal']+=0x1;var _0x30729a=ut[_0x9077('0x1a3')](_0x1f5644,_0x12eb68);ami[_0x9077('0x46')](_0x9077('0x1a4'),_0x30729a);_0x1edb27=_0x12eb68[_0x9077('0x190')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1a5')));if(_0x372b69[_0x9077('0x19f')](0x3,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60['countnoanswerretry']>=_0x12eb68[_0x9077('0x1a6')]){_0x372b69['createStateFinal'](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a7'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a7'));}}break;case'5':_0x12eb68['outboundBusyCallsDay']+=0x1;_0x503a60[_0x9077('0xd8')]=0x5;_0x503a60[_0x9077('0xe9')]=_0x9077('0x1a8');_0x503a60[_0x9077('0x122')]+=0x1;_0x503a60['countglobal']+=0x1;ami[_0x9077('0x46')]('custom:agentbusy',ut[_0x9077('0x119')](_0x1f5644,_0x9077('0x1a9')));_0x1edb27=_0x12eb68[_0x9077('0x1aa')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils[_0x9077('0xcc')](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1ab')));if(_0x372b69[_0x9077('0x19f')](0x5,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0x122')]>=_0x12eb68['dialBusyMaxRetry']){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1ac'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1ac'));}}break;case'8':_0x12eb68[_0x9077('0x1ad')]+=0x1;_0x503a60[_0x9077('0xd8')]=0x8;_0x503a60[_0x9077('0xe9')]='Congestion';_0x503a60[_0x9077('0x123')]+=0x1;_0x503a60['countglobal']+=0x1;_0x1edb27=_0x12eb68[_0x9077('0x1ae')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];ami['emit'](_0x9077('0x1af'),ut[_0x9077('0x119')](_0x1f5644,_0x9077('0x1b0')));hopperUtils[_0x9077('0xcc')](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1b1')));if(_0x372b69[_0x9077('0x19f')](0x8,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0x123')]>=_0x12eb68[_0x9077('0x1b2')]){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1b3'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,'reason\x208\x20congestion');}}break;case'11':_0x12eb68[_0x9077('0x1b4')]+=0x1;_0x503a60[_0x9077('0xd8')]=0xb;_0x503a60[_0x9077('0xe9')]=_0x9077('0xf1');_0x503a60[_0x9077('0xec')]+=0x1;_0x503a60[_0x9077('0xed')]+=0x1;_0x1edb27=_0x12eb68[_0x9077('0x197')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1b5')));if(_0x372b69[_0x9077('0x19f')](0xb,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0xec')]>=_0x12eb68[_0x9077('0xee')]){_0x372b69['createStateFinal'](_0x503a60,_0x98952f,_0xa9f2ab,'reason\x2011\x20abandoned');}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1b6'));}}break;case'20':_0x12eb68[_0x9077('0x1b7')]+=0x1;_0x503a60[_0x9077('0xd8')]=0x14;_0x503a60['statedesc']=_0x9077('0x1b8');_0x503a60[_0x9077('0x125')]+=0x1;_0x503a60['countglobal']+=0x1;_0x1edb27=_0x12eb68['dialAgentRejectRetryFrequency'];_0x25ed0b=_0x12eb68['callAdditionalPhoneAfterMin'];ami[_0x9077('0x46')]('custom:agentreject',ut['buildObj'](_0x1f5644,_0x9077('0x1b9')));hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1ba')));if(_0x372b69[_0x9077('0x19f')](0x14,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60['countagentrejectretry']>=_0x12eb68[_0x9077('0x1bb')]){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1bc'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1bc'));}}break;default:_0x12eb68[_0x9077('0x1bd')]+=0x1;_0x503a60[_0x9077('0xd8')]=0xc;_0x503a60['statedesc']=_0x438e34[_0x9077('0xc8')];_0x1edb27=_0x12eb68[_0x9077('0x199')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1be')));if(_0x372b69['checkRetriveMax'](_0x438e34[_0x9077('0xc8')],_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0x122')]+_0x503a60[_0x9077('0x123')]+_0x503a60[_0x9077('0x132')]+_0x503a60[_0x9077('0x124')]+_0x503a60['countdropretry']+_0x503a60[_0x9077('0xec')]+_0x503a60[_0x9077('0x120')]+_0x503a60[_0x9077('0x125')]>=_0x12eb68[_0x9077('0x126')]){_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x438e34[_0x9077('0xc8')]);}else{_0x372b69['createStateFinal'](_0x503a60,_0x98952f,_0xa9f2ab,_0x438e34[_0x9077('0xc8')]);}}}})[_0x9077('0x43')](function(){if(_0x1aea1a){hopperUtils[_0x9077('0xe7')](_0x503a60,_0x1edb27,_0x25ed0b)[_0x9077('0x43')](function(){return _0x98952f(0x1);});}});});};Dialer[_0x9077('0x1d')][_0x9077('0x127')]=function(_0x30d2ac,_0x133016,_0x505176,_0x8ddf3d){var _0x15e9d8=new Final(_0x30d2ac);_0x15e9d8[_0x9077('0xd8')]=0xf;_0x15e9d8['statedesc']=_0x9077('0x1bf');this[_0x9077('0x12a')](_0x15e9d8,_0x133016,_0x505176,_0x8ddf3d);};Dialer[_0x9077('0x1d')][_0x9077('0x12a')]=function(_0x5f3d85,_0xde615c,_0x40239d,_0x180b8b){hopperUtils[_0x9077('0xce')](_0x5f3d85)[_0x9077('0x43')](function(){return _0xde615c(msgResponse(_0x9077('0x19a'),'Success',_0x180b8b));})[_0x9077('0xa3')](function(){return _0x40239d(msgResponse(_0x9077('0x1c0'),_0x9077('0x95'),_0x9077('0x1c1')));});};Dialer['prototype'][_0x9077('0x8')]=function(_0x1bd632){var _0xf45605=_0x1bd632[_0x9077('0x1c2')]/0x64;var _0x30fe51=_0x1bd632[_0x9077('0xd3')]/(_0x1bd632['outboundDropCallsDayTimeout']+_0x1bd632['outboundAnswerCallsDay']);var _0x4bfc5f=Math[_0x9077('0x1c3')](_0x1bd632[_0x9077('0x1c4')]*(_0x1bd632[_0x9077('0x1c5')]/0x64));var _0x309684=Math['round'](_0x1bd632[_0x9077('0x1c4')]*(_0x1bd632[_0x9077('0x1c6')]/0x64));var _0x447e9d=_0x1bd632[_0x9077('0x1c7')]+_0x1bd632[_0x9077('0x13f')];var _0x3ccb9b=Math[_0x9077('0x1c8')](_0x1bd632[_0x9077('0x5f')]*_0x1bd632['erlangAbandonmentRate']*_0x1bd632[_0x9077('0x1c9')]*_0x1bd632[_0x9077('0x1ca')]);if(_[_0x9077('0x45')](_0x1bd632[_0x9077('0x66')])){if(!_['isUndefined'](_0x1bd632[_0x9077('0x2b')])){_0x1bd632[_0x9077('0x2b')]=undefined;loggerPredictive[_0x9077('0x69')](_0x9077('0x1cb'),_0x9077('0x1cc'));}if(!_['isUndefined'](_0x1bd632['handlePredictive'])){loggerPredictive[_0x9077('0x69')](_0x9077('0x1cb'),_0x9077('0x1cd'));clearInterval(_0x1bd632[_0x9077('0x68')]);_0x1bd632[_0x9077('0x68')]=undefined;}_0x1bd632['startProgressive']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));loggerPredictive['info'](_0x1bd632['name'],'collection\x20data\x20in\x20progressive\x20at',_0x1bd632['startProgressive']);this[_0x9077('0xb7')](_0x1bd632,0x1);}else if(ifInterval(_0x1bd632[_0x9077('0x1ce')],_0x1bd632[_0x9077('0x66')])){this[_0x9077('0xb7')](_0x1bd632,0x1);loggerPredictiveCalls[_0x9077('0x4f')](_0x9077('0x1cf'),_0x1bd632['startProgressive'],_0x1bd632[_0x9077('0x4e')]);_0x1bd632[_0x9077('0x5f')]=0x0;_0x1bd632[_0x9077('0xd4')]=0x0;}else if(_0xf45605<_0x30fe51&&_0x1bd632[_0x9077('0x1d0')]===_0x9077('0x1d1')){clearPredictiveAttributes(_0x1bd632);loggerPredictive[_0x9077('0x4f')](_0x9077('0x1d2'),_0x9077('0x1d3'),_0x30fe51,'startProgressive',_0x1bd632[_0x9077('0x4e')]);}else if(_0x3ccb9b<_0x1bd632[_0x9077('0xd4')]&&_0x1bd632[_0x9077('0x1d0')]==='dropRate'){clearPredictiveAttributes(_0x1bd632);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x9077('0x1d4'),_0x3ccb9b,_0x9077('0x1d5'),_0x1bd632[_0x9077('0xd4')],_0x9077('0x66'),_0x1bd632[_0x9077('0x4e')]);}else if(!ifInterval(_0x1bd632['dialPredictiveInterval'],_0x1bd632['startProgressive'])&&_['isUndefined'](_0x1bd632[_0x9077('0x2b')])&&!_['isUndefined'](_0x1bd632['startProgressive'])){_0x1bd632[_0x9077('0x2b')]=moment()['format'](_0x9077('0xc7'));loggerPredictive['info'](_0x1bd632['name'],_0x9077('0x1d6'),_0x1bd632[_0x9077('0x2b')]);hopperUtils[_0x9077('0x1d7')](_0x1bd632[_0x9077('0x1ce')])[_0x9077('0x43')](this['getDataPredictive'](_0x1bd632))[_0x9077('0x43')](mergeDataErlangB(_0x1bd632))[_0x9077('0x43')](this[_0x9077('0x1d8')](_0x1bd632))[_0x9077('0xa3')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1bd632));}else if(!ifInterval(_0x1bd632[_0x9077('0x1ce')],_0x1bd632['startPredictive'])){_0x1bd632[_0x9077('0xd4')]=0x0;_0x1bd632[_0x9077('0x2b')]=moment()['format'](_0x9077('0xc7'));loggerPredictive[_0x9077('0x4f')](_0x1bd632[_0x9077('0x4e')],_0x9077('0x1d9'),_0x1bd632[_0x9077('0x2b')]);clearInterval(_0x1bd632['handlePredictive']);_0x1bd632[_0x9077('0x68')]=undefined;hopperUtils[_0x9077('0x1d7')](_0x1bd632[_0x9077('0x1ce')])[_0x9077('0x43')](this[_0x9077('0x1da')](_0x1bd632))['then'](mergeDataErlangB(_0x1bd632))[_0x9077('0x43')](this['startMethodPredictive'](_0x1bd632))[_0x9077('0xa3')](loggerCatchPredictive(_0x9077('0x1db'),_0x1bd632));}else if(_0x1bd632[_0x9077('0x1c4')]&&_0x447e9d<_0x1bd632[_0x9077('0x1c4')]-_0x309684){clearPredictiveAttributes(_0x1bd632);loggerPredictive[_0x9077('0x4f')](_0x1bd632[_0x9077('0x4e')],_0x9077('0x1dc'),_0x447e9d,')\x20are\x20less\x20than\x20threshold\x20(',_0x1bd632[_0x9077('0x1c4')],'-',_0x309684,'=',_0x1bd632['predictiveIntervalAvailable']-_0x309684,')');}else if(_0x1bd632[_0x9077('0x1c4')]&&_0x447e9d>_0x1bd632[_0x9077('0x1c4')]+_0x4bfc5f){clearPredictiveAttributes(_0x1bd632);loggerPredictive[_0x9077('0x4f')](_0x1bd632[_0x9077('0x4e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x447e9d,_0x9077('0x1dd'),_0x1bd632['predictiveIntervalAvailable'],'+',_0x4bfc5f,'=',_0x1bd632[_0x9077('0x1c4')]+_0x4bfc5f,')');}};Dialer[_0x9077('0x1d')]['getDataPredictive']=function(_0x5c12d5){var _0x34b12a=this;return function(_0xc128b9){return new Promise(function(_0x5c23fb,_0x2aa152){_['merge'](_0x5c12d5,_0xc128b9[0x0]);if(checkGetDataPredictive(_0xc128b9[0x0])){var _0x5cef03=_0x5c12d5[_0x9077('0x1c4')]=_0x5c12d5[_0x9077('0x13f')]+_0x5c12d5['available'];var _0xc8902c=_0x5c12d5[_0x9077('0x1ce')]*0x3c;var _0x233098=_0xc128b9[0x0][_0x9077('0x58')]+_0xc128b9[0x0]['predictiveIntervalAvgHoldtime'];var _0x5d9cf6=(_0xc128b9[0x0][_0x9077('0x53')]+_0xc128b9[0x0][_0x9077('0xd2')]+_0xc128b9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xc128b9[0x0][_0x9077('0x51')];_0x5c12d5[_0x9077('0x1c9')]=_0x5d9cf6>0x0?_0x5d9cf6:0x1;switch(_0x5c12d5[_0x9077('0x1d0')]){case'dropRate':var _0x4a0bcf=_0x5c12d5[_0x9077('0x1c2')]/0x64;return _0x34b12a[_0x9077('0x1de')](_0x5cef03,_0xc8902c,_0x233098,_0x5d9cf6,_0x4a0bcf)['then'](function(_0x37493a){return _0x5c23fb(_0x37493a);});case _0x9077('0x1df'):var _0x52348=_0x5c12d5[_0x9077('0x1c2')]/0x64;return _0x34b12a['busyFactor'](_0x5cef03,_0xc8902c,_0x233098,_0x5d9cf6,_0x52348)[_0x9077('0x43')](function(_0x2b3e3a){return _0x5c23fb(_0x2b3e3a);});default:return _0x2aa152(msgResponse(_0x9077('0x1e0'),_0x9077('0x95'),_0x9077('0x1e1')));}}else{return _0x2aa152(msgResponse(_0x9077('0x1e0'),_0x9077('0x95'),_0x9077('0x1e2')));}});};};Dialer[_0x9077('0x1d')]['getDataPredictiveOld']=function(_0x35cd6c){var _0x73f664=this;return function(_0x13de80){return new Promise(function(_0x3b92bb,_0x4d9cec){_[_0x9077('0x64')](_0x35cd6c,_0x13de80[0x0]);if(checkGetDataPredictive(_0x13de80[0x0])){loggerPredictive['info'](JSON[_0x9077('0x76')](_0x13de80[0x0]));if(_0x35cd6c[_0x9077('0x1d0')]===_0x9077('0x1d1')){return _0x73f664[_0x9077('0x151')](_0x35cd6c['id'])[_0x9077('0x43')](function(_0x2a37ea){var _0x2aeb87=_0x35cd6c[_0x9077('0x1e3')]-_0x2a37ea[0x0][_0x9077('0x1e4')];var _0x50c4d2=_0x35cd6c['dialPredictiveInterval']*0x3c;var _0x12cad6=_0x13de80[0x0]['predictiveIntervalAvgTalktime']+_0x13de80[0x0]['predictiveIntervalAvgHoldtime'];var _0x32d6f1=(_0x13de80[0x0]['predictiveIntervalAnsweredCalls']+_0x13de80[0x0][_0x9077('0xd2')]+_0x13de80[0x0][_0x9077('0x56')])/_0x13de80[0x0]['predictiveIntervalTotalCalls'];var _0xe75c41=_0x35cd6c['dialPredictiveOptimizationPercentage']/0x64;_0x35cd6c[_0x9077('0x1e5')]=_0x2a37ea[0x0]['outboundQueuePauses']||0x0;_0x35cd6c[_0x9077('0x1c9')]=_0x32d6f1>0x0?_0x32d6f1:0x1;return _0x73f664[_0x9077('0x1de')](_0x2aeb87,_0x50c4d2,_0x12cad6,_0x32d6f1,_0xe75c41);})[_0x9077('0x43')](function(_0x34fb69){return _0x3b92bb(_0x34fb69);})['catch'](function(_0x36aa46){return _0x4d9cec(msgResponse(_0x9077('0x1e6'),_0x9077('0x95'),JSON[_0x9077('0x76')](_0x36aa46)));});}if(_0x35cd6c[_0x9077('0x1d0')]==='agentBusyFactor'){return _0x73f664['getVoiceQueueRtPauses'](_0x35cd6c['id'])[_0x9077('0x43')](function(_0x3eb08f){var _0x5c3127=_0x35cd6c[_0x9077('0x1e3')]-_0x3eb08f[0x0][_0x9077('0x1e4')];var _0x5b67df=_0x35cd6c[_0x9077('0x1ce')]*0x3c;var _0x551aad=_0x13de80[0x0]['predictiveIntervalAvgTalktime']+_0x13de80[0x0][_0x9077('0x5b')];var _0x454a36=(_0x13de80[0x0][_0x9077('0x53')]+_0x13de80[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x13de80[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x13de80[0x0][_0x9077('0x51')];var _0x3097b4=_0x35cd6c[_0x9077('0x1c2')]/0x64;_0x35cd6c['predictiveIntervalPauses']=_0x3eb08f[0x0]['outboundQueuePauses']||0x0;_0x35cd6c[_0x9077('0x1c9')]=_0x454a36>0x0?_0x454a36:0x1;return _0x73f664[_0x9077('0x1e7')](_0x5c3127,_0x5b67df,_0x551aad,_0x454a36,_0x3097b4);})[_0x9077('0x43')](function(_0x52e353){return _0x3b92bb(_0x52e353);})[_0x9077('0xa3')](function(_0x516ea3){return _0x4d9cec(msgResponse(_0x9077('0x1e6'),_0x9077('0x95'),JSON[_0x9077('0x76')](_0x516ea3)));});}}else{return _0x4d9cec(msgResponse(_0x9077('0x1e0'),_0x9077('0x95'),_0x9077('0x1e2')));}});};};Dialer['prototype'][_0x9077('0x1d8')]=function(_0xa17cd4){var _0x27f1fe=this;return function(){var _0x487c7f=0x0;var _0x3768e5=Math[_0x9077('0x1c8')](_0xa17cd4[_0x9077('0x1e8')]*0x3e8);if(_0x3768e5>0x0){_0x3768e5=_0x3768e5<0x64?0x64:_0x3768e5;loggerPredictive[_0x9077('0x4f')](_0xa17cd4[_0x9077('0x4e')],_0x9077('0x1e9'),_0x3768e5,_0x9077('0x1ea'));_0xa17cd4[_0x9077('0x68')]=setInterval(function(){_0x27f1fe[_0x9077('0x68')](_0xa17cd4);loggerPredictiveCalls['info'](_0x9077('0x1eb'),_0x487c7f+=0x1);},_0x3768e5);}else{loggerPredictive[_0x9077('0x4f')](_0xa17cd4[_0x9077('0x4e')],_0x9077('0x1ec'));}};};Dialer[_0x9077('0x1d')][_0x9077('0x1ed')]=function(_0xa3d0ec,_0x16e62d){var _0x207d07=this;return function(_0x93ce37){if(_[_0x9077('0x7c')](_0x93ce37)){if(_[_0x9077('0xf6')](_0x16e62d[_0x9077('0x1ee')])||!_0x16e62d[_0x9077('0x1ef')]){if(_0xa3d0ec['dialMethod']===_0x9077('0xb8')){_0xa3d0ec[_0x9077('0x73')]=_[_0x9077('0x45')](_0xa3d0ec[_0x9077('0x73')])?!![]:_0xa3d0ec['queueStatusComplete'];var _0x2a1a3e=uuid['v4']();_0x207d07[_0x9077('0x28')][_0x2a1a3e]=new Action(_0xa3d0ec,_0x16e62d,_0x2a1a3e);loggerBooked[_0x9077('0x4f')](_0x9077('0x1f0'),_0x2a1a3e,'queueStatusComplete:\x20',JSON[_0x9077('0x76')](_0xa3d0ec[_0x9077('0x73')]),_0x9077('0x1f1'),_0xa3d0ec[_0x9077('0x4e')]);if(_0xa3d0ec[_0x9077('0x73')]){_0xa3d0ec[_0x9077('0x73')]=![];_0x207d07[_0x9077('0x2d')][_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xc3')]]=[];ami['Action']({'actionid':_0x2a1a3e,'action':_0x9077('0x1f2'),'queue':_0xa3d0ec[_0x9077('0x4e')]})['catch'](function(){_0x207d07[_0x9077('0xc6')](_0xa3d0ec);hopperUtils[_0x9077('0xef')]({'active':![],'ContactId':_0x207d07[_0x9077('0x28')][_0x2a1a3e]['ContactId'],'ListId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xdf')],'VoiceQueueId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xe0')]||undefined,'CampaignId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x1f3')));delete _0x207d07[_0x9077('0x28')][_0x2a1a3e];});}else{loggerBooked[_0x9077('0x4f')](_0x9077('0x1f4'),JSON[_0x9077('0x76')](_0xa3d0ec[_0x9077('0x73')]),_0x9077('0x1f1'),_0xa3d0ec[_0x9077('0x4e')]);_0x207d07[_0x9077('0xc6')](_0xa3d0ec);hopperUtils[_0x9077('0xef')]({'active':![],'ContactId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xde')],'ListId':_0x207d07['actions'][_0x2a1a3e][_0x9077('0xdf')],'VoiceQueueId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xe0')]||undefined,'CampaignId':_0x207d07[_0x9077('0x28')][_0x2a1a3e]['CampaignId']||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x1f3')));delete _0x207d07[_0x9077('0x28')][_0x2a1a3e];}}else{return _0x207d07['actionOriginate'](_0xa3d0ec,_0x16e62d);}}else{if(utils[_0x9077('0x65')](undefined,_0x16e62d[_0x9077('0x1f5')])<_0xa3d0ec[_0x9077('0x1f6')]*0x3c){if(_0x16e62d[_0x9077('0x14a')]&&!_0x16e62d[_0x9077('0x14a')][_0x9077('0x1f7')]){_0x207d07[_0x9077('0x21')][_0x9077('0xfc')](_0x16e62d['id'])['finally'](function(){_0x207d07[_0x9077('0xc6')](_0xa3d0ec);});}else{hopperUtils['unlockContact']({'active':![]},_0x16e62d['id'],0x1)[_0x9077('0xfe')](function(){_0x207d07[_0x9077('0xc6')](_0xa3d0ec);});}}else{_0xa3d0ec[_0x9077('0x1f8')]+=0x1;_0x207d07[_0x9077('0xc6')](_0xa3d0ec);if(_0xa3d0ec['dialRecallInQueue']){hopperUtils[_0x9077('0xef')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16e62d[_0x9077('0xde')],'ListId':_0x16e62d[_0x9077('0xdf')],'VoiceQueueId':_0x16e62d['VoiceQueueId']||undefined,'CampaignId':_0x16e62d[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x1f9')));hopperUtils['createHistory'](createObjHistory(_0xa3d0ec,_0x16e62d,utils[_0x9077('0x7d')][_0x9077('0x1fa')],0x17,'RecallInQueue'))[_0x9077('0xa3')](loggerCatch(_0x9077('0x1fb')));}else{_0x207d07[_0x9077('0x11a')](createObjHistory(_0xa3d0ec,_0x16e62d,utils[_0x9077('0x7d')][_0x9077('0x1fc')],0x16,'RecallFailedTimeout'),_0x9077('0x1fd'),_0x9077('0x1fe'));}}}}else{_0xa3d0ec[_0x9077('0x1ff')]+=0x1;_0x207d07[_0x9077('0x11a')](createObjHistory(_0xa3d0ec,_0x16e62d,utils['CAMPAIGN_STATUS']['BLACKLIST'],0xd,_0x9077('0x200')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x9077('0x201');}};};Dialer[_0x9077('0x1d')]['handleIvr']=function(_0x3f38c0){var _0x59ab60=this;var _0x361375=_0x3f38c0[_0x9077('0x202')]-_0x3f38c0['originated'];emitCampaignSummary(_0x3f38c0);if(_0x361375>0x0&&_0x3f38c0[_0x9077('0x203')]==0x0){if(_0x361375>this[_0x9077('0x26')]){_0x361375=this[_0x9077('0x26')];}_0x3f38c0[_0x9077('0x203')]=0x1;hopperUtils[_0x9077('0x204')](_0x3f38c0,_0x361375)[_0x9077('0x43')](function(_0x3f9132){_0x3f38c0['temp']=0x0;if(_0x3f9132){if(!utils[_0x9077('0x205')](_0x3f9132)){_0x3f38c0[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x70')];logger[_0x9077('0x4f')](_0x9077('0x206')+_0x3f38c0[_0x9077('0x4e')]);}else{_0x3f38c0[_0x9077('0x153')]+=_0x3f9132[_0x9077('0x99')];_0x3f38c0[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x207')];for(var _0x36bea6=0x0;_0x36bea6<_0x3f9132[_0x9077('0x99')];_0x36bea6+=0x1){_0x3f38c0['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x3f9132[_0x36bea6])||_[_0x9077('0xf6')](_0x3f9132[_0x36bea6][_0x9077('0x208')])||_['isNil'](_0x3f9132[_0x36bea6][_0x9077('0x162')])){_0x59ab60['emptyContact'](_0x9077('0x209'),_0x3f38c0,_0x3f9132[_0x36bea6]);}else{hopperUtils[_0x9077('0x20a')](_[_0x9077('0x77')](_0x3f9132[_0x36bea6],['CampaignId',_0x9077('0x162')]))[_0x9077('0x43')](_0x59ab60[_0x9077('0x1ed')](_0x3f38c0,_0x3f9132[_0x36bea6]))['catch'](_0x59ab60[_0x9077('0x156')](_0x9077('0x20b'),_0x3f38c0));}}}}})[_0x9077('0xa3')](loggerGetContactDialer(_0x9077('0x20c'),_0x3f38c0,_0x361375));}};Dialer[_0x9077('0x1d')][_0x9077('0xb7')]=function(_0x26ddba,_0x151a65){var _0x40947e=this;var _0x844026=[];if(_0x151a65<0x1||_0x26ddba[_0x9077('0xb4')]===_0x9077('0xb8')){_0x151a65=0x1;}var _0x15d359=Math[_0x9077('0x1c8')](_0x26ddba['available']*_0x151a65)-_0x26ddba['originated'];if(_0x26ddba[_0x9077('0x20d')]>0x0){var _0x57ac32=_0x26ddba['dialLimitQueue']-_0x26ddba[_0x9077('0x153')]-_0x26ddba[_0x9077('0x13f')]-_0x26ddba[_0x9077('0x140')];if(_0x15d359>_0x57ac32){_0x15d359=_0x57ac32;}}if(_0x15d359>0x0&&_0x26ddba[_0x9077('0x203')]==0x0){if(_0x26ddba['dialMethod']===_0x9077('0xb8')){_0x15d359=0x1;}if(_0x15d359>this['maxNumberOriginate']){_0x15d359=this[_0x9077('0x26')];}for(var _0x346e33 in this[_0x9077('0x24')]){if(typeof this['agents'][_0x346e33]!=='undefined'){if(this['agents'][_0x346e33][_0x9077('0xd8')]==='not_inuse'&&this[_0x9077('0x24')][_0x346e33][_0x9077('0x8a')]===_0x9077('0x8b')){_0x844026[_0x9077('0x9a')](this[_0x9077('0x24')][_0x346e33]['id']);}}}_0x26ddba[_0x9077('0x203')]=0x1;hopperUtils[_0x9077('0x20e')](_0x26ddba,_0x844026,_0x15d359)['then'](function(_0x272917){_0x26ddba['temp']=0x0;if(_0x272917){if(!utils[_0x9077('0x205')](_0x272917)){hopperUtils[_0x9077('0x20f')](_0x26ddba)[_0x9077('0x43')](sendMessageReschedule(_0x26ddba))[_0x9077('0xa3')](loggerCatch(_0x9077('0x210')));}else{_0x26ddba['originated']+=_0x272917[_0x9077('0x99')];_0x26ddba['message']=_0x26ddba[_0x9077('0xb4')]===_0x9077('0xb8')?utils[_0x9077('0x7d')][_0x9077('0x141')]:utils[_0x9077('0x7d')][_0x9077('0x207')];for(var _0x1ee922=0x0;_0x1ee922<_0x272917[_0x9077('0x99')];_0x1ee922+=0x1){if(_['isNil'](_0x272917[_0x1ee922])||_[_0x9077('0xf6')](_0x272917[_0x1ee922]['Contact'])||_[_0x9077('0xf6')](_0x272917[_0x1ee922][_0x9077('0x162')])){_0x40947e['emptyContact']('[actionOriginate]\x20',_0x26ddba,_0x272917[_0x1ee922]);}else{hopperUtils[_0x9077('0x211')](_[_0x9077('0x77')](_0x272917[_0x1ee922],['VoiceQueueId','phone']))[_0x9077('0x43')](_0x40947e['checkContactBlack'](_0x26ddba,_0x272917[_0x1ee922]))[_0x9077('0xa3')](_0x40947e[_0x9077('0x156')](_0x9077('0x209'),_0x26ddba));}}}}})[_0x9077('0xa3')](loggerGetContactDialer(_0x9077('0x212'),_0x26ddba,_0x15d359));}};Dialer[_0x9077('0x1d')][_0x9077('0x68')]=function(_0x40fbdf){if(_0x40fbdf['dialLimitQueue']>0x0){var _0x4e6abd=_0x40fbdf['dialLimitQueue']-_0x40fbdf[_0x9077('0x153')]-_0x40fbdf[_0x9077('0x13f')];if(_0x4e6abd>0x0&&_0x40fbdf[_0x9077('0x203')]==0x0){this[_0x9077('0x213')](_0x40fbdf);}else{loggerPredictiveCalls[_0x9077('0x4f')](_0x9077('0x214'));}}else{this[_0x9077('0x213')](_0x40fbdf);}};Dialer['prototype'][_0x9077('0x213')]=function(_0x4e5a86){var _0x4e4433=this;var _0x5916e4=[];_0x4e5a86['originated']+=0x1;for(var _0x96ddc4 in this[_0x9077('0x24')]){if(typeof this['agents'][_0x96ddc4]!==_0x9077('0xad')){if(this[_0x9077('0x24')][_0x96ddc4]['state']===_0x9077('0x215')&&this[_0x9077('0x24')][_0x96ddc4]['status']===_0x9077('0x8b')){_0x5916e4[_0x9077('0x9a')](this[_0x9077('0x24')][_0x96ddc4]['id']);}}}_0x4e5a86[_0x9077('0x203')]=0x1;return this['getContactDialer'](_0x4e5a86['id'],_0x5916e4,0x1,_0x4e5a86['dialOrderByScheduledAt'],_0x4e5a86)[_0x9077('0x43')](function(_0x2f53d5){_0x4e5a86[_0x9077('0x203')]=0x1;if(_0x2f53d5){if(!utils[_0x9077('0x205')](_0x2f53d5)){utils[_0x9077('0x216')](_0x4e5a86,0x1,0x0);return hopperUtils[_0x9077('0x20f')](_0x4e5a86)['then'](sendMessageReschedule(_0x4e5a86))[_0x9077('0xa3')](loggerCatch(_0x9077('0x210')));}else{_0x4e5a86['message']=utils[_0x9077('0x7d')]['RUNNING'];if(_[_0x9077('0xf6')](_0x2f53d5[0x0])||_[_0x9077('0xf6')](_0x2f53d5[0x0][_0x9077('0x208')])||_['isNil'](_0x2f53d5[0x0][_0x9077('0x162')])){_0x4e4433[_0x9077('0x157')](_0x9077('0x209'),_0x4e5a86,_0x2f53d5[0x0]);}else{return hopperUtils[_0x9077('0x211')](_[_0x9077('0x77')](_0x2f53d5[0x0],[_0x9077('0xe0'),_0x9077('0x162')]))[_0x9077('0x43')](_0x4e4433[_0x9077('0x1ed')](_0x4e5a86,_0x2f53d5[0x0]))[_0x9077('0xa3')](_0x4e4433[_0x9077('0x156')](_0x9077('0x217'),_0x4e5a86));}}}})[_0x9077('0xa3')](loggerGetContactDialer('[getContactDialerPredictive]',_0x4e5a86,0x1));};Dialer[_0x9077('0x1d')][_0x9077('0x1de')]=function(_0x165146,_0x273cc0,_0x356d6a,_0x10a869,_0x417d50,_0x3f4739){loggerPredictive[_0x9077('0x4f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x9077('0x218'),_0x165146);loggerPredictive['info'](_0x9077('0x219'),_0x273cc0);loggerPredictive[_0x9077('0x4f')](_0x9077('0x21a'),_0x356d6a);loggerPredictive['info'](_0x9077('0x21b'),_0x10a869);loggerPredictive[_0x9077('0x4f')](_0x9077('0x21c'),_0x417d50);loggerPredictive[_0x9077('0x4f')](_0x9077('0x59'));return new Promise(function(_0x1bad89,_0x5605ba){if(_0x165146<=0x0||isNaN(_0x165146)){return _0x5605ba(msgResponse(_0x9077('0x21d'),'Error',_0x9077('0x21e')+_0x165146));}if(_0x356d6a<=0x0||isNaN(_0x356d6a)){return _0x5605ba(msgResponse('[abandonmentRate]',_0x9077('0x87'),_0x9077('0x21f')+_0x356d6a));}if(_0x10a869<=0x0||isNaN(_0x10a869)){return _0x5605ba(msgResponse('[abandonmentRate]',_0x9077('0x87'),_0x9077('0x220')+_0x10a869));}if(_0x273cc0<=0x0||isNaN(_0x273cc0)){return _0x5605ba(msgResponse(_0x9077('0x21d'),_0x9077('0x87'),_0x9077('0x221')+_0x273cc0));}if(_0x417d50<=0x0||isNaN(_0x417d50)){return _0x5605ba(msgResponse(_0x9077('0x21d'),_0x9077('0x87'),_0x9077('0x222')+_0x417d50));}_0x3f4739=_0x3f4739||0x0;var _0xf74b61=0x1/_0x356d6a;var _0x5863c9=0x0;var _0x37292b=0x0;var _0x5beffe=0x0;var _0x34ec5c=0x0;for(var _0x11feca=0x0;_0x5beffe<_0x417d50;_0x11feca+=0x1){_0x37292b=_0x11feca/_0x273cc0;_0x5863c9=(_0x10a869*_0x37292b+_0x3f4739)/_0xf74b61;_0x5beffe=utils[_0x9077('0x223')](_0x5863c9,_0x165146);_0x34ec5c=_0x5863c9/_0x165146*(0x1-utils[_0x9077('0x223')](_0x5863c9,_0x165146));}return _0x1bad89({'erlangCalls':_0x11feca,'erlangCallToSecond':_0x273cc0/_0x11feca,'erlangAbandonmentRate':_0x5beffe,'erlangBusyFactor':_0x34ec5c});});};Dialer[_0x9077('0x1d')][_0x9077('0x1e7')]=function(_0x51f0e6,_0xb4deeb,_0x59fde0,_0x3a5c6d,_0x49c6b7,_0x5b8106){loggerPredictive[_0x9077('0x4f')](_0x9077('0x224'));loggerPredictive[_0x9077('0x4f')](_0x9077('0x218'),_0x51f0e6);loggerPredictive[_0x9077('0x4f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb4deeb);loggerPredictive[_0x9077('0x4f')]('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',_0x59fde0);loggerPredictive['info'](_0x9077('0x21b'),_0x3a5c6d);loggerPredictive[_0x9077('0x4f')](_0x9077('0x225'),_0x49c6b7);loggerPredictive['info']('---------------------------');return new Promise(function(_0x4c9c35,_0x20df4d){if(_0x51f0e6<=0x0||isNaN(_0x51f0e6)){return _0x20df4d(msgResponse('[busyFactor]',_0x9077('0x87'),_0x9077('0x21e')+_0x51f0e6));}if(_0x59fde0<=0x0||isNaN(_0x59fde0)){return _0x20df4d(msgResponse('[busyFactor]',_0x9077('0x87'),_0x9077('0x21f')+_0x59fde0));}if(_0x3a5c6d<=0x0||isNaN(_0x3a5c6d)){return _0x20df4d(msgResponse('[busyFactor]','Error',_0x9077('0x220')+_0x3a5c6d));}if(_0xb4deeb<=0x0||isNaN(_0xb4deeb)){return _0x20df4d(msgResponse(_0x9077('0x226'),'Error',_0x9077('0x221')+_0xb4deeb));}if(_0x49c6b7<=0x0||isNaN(_0x49c6b7)){return _0x20df4d(msgResponse(_0x9077('0x226'),_0x9077('0x87'),_0x9077('0x227')+_0x49c6b7));}_0x5b8106=_0x5b8106||0x0;var _0x5616d9=0x1/_0x59fde0;var _0x28fd01=0x0;var _0x2f0564=0x0;var _0x38458a=0x0;var _0x4eb86b=0x0;for(var _0x48e63d=0x0;_0x4eb86b<_0x49c6b7;_0x48e63d+=0x1){_0x2f0564=_0x48e63d/_0xb4deeb;_0x28fd01=(_0x3a5c6d*_0x2f0564+_0x5b8106)/_0x5616d9;_0x38458a=utils[_0x9077('0x223')](_0x28fd01,_0x51f0e6);_0x4eb86b=_0x28fd01/_0x51f0e6*(0x1-utils[_0x9077('0x223')](_0x28fd01,_0x51f0e6));}return _0x4c9c35({'erlangCalls':_0x48e63d,'erlangCallToSecond':_0xb4deeb/_0x48e63d,'erlangAbandonmentRate':_0x38458a,'erlangBusyFactor':_0x4eb86b});});};module[_0x9077('0x228')]=Dialer; \ No newline at end of file +var _0x730f=['syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','getSeconds','startProgressive\x20value\x20cleared','startPredictive','debug','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','Interval','NULL_INTERVAL','CAMPAIGN_STATUS','\x20INTERVAL_IS_NULL','isEmpty','Intervals','\x20NOT\x20Active','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','[ifTime][Action]','stringify','active','status','reachable','SIP/%s','checkIsTrunkReachable','Trunk','isTrunkReachable','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','then','content','true','catch','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','queue','uniqueId','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','type','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','syncNewExten','channel','actionid','rrmemory','isNil','locked','stateinterface','merge','pick','idHopper','strategy','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','paused','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','ListId','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','emit','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','membername','countmachineretry','amd','custom:amd','buildObj','countbusyretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','[rescheduleContact][Machine]','Machine','countnoanswerretry','stateGlobal','syncHangup','[syncHangupIvr][createHistory]','AGI','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','inUse','talking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','throttle','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','NONE','dialer','getCaller','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','dialOriginateCallerIdName','getCallerIdRandom','extractCalleridName','phone','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','available','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','recallme','booked','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','getContactDialer','checkContactLowerLimitOriginate','--------\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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/agentComplete','./models/hangup','env','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuecallerabandon','bind','originateresponse'];(function(_0x3476fa,_0x215f2b){var _0x83f228=function(_0x5cf57a){while(--_0x5cf57a){_0x3476fa['push'](_0x3476fa['shift']());}};_0x83f228(++_0x215f2b);}(_0x730f,0x1f2));var _0xf730=function(_0x404046,_0x52062d){_0x404046=_0x404046-0x0;var _0x430ea2=_0x730f[_0x404046];return _0x430ea2;};'use strict';var util=require('util');var _=require(_0xf730('0x0'));var uuid=require('uuid');var moment=require(_0xf730('0x1'));var rr=require('rr');var Redis=require(_0xf730('0x2'));var utils=require(_0xf730('0x3'));var hopperUtils=require(_0xf730('0x4'));var ut=require(_0xf730('0x5'));var config=require(_0xf730('0x6'));var logger=require(_0xf730('0x7'))('dialer');var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0xf730('0x7'))(_0xf730('0x8'));var loggerPredictiveCalls=require(_0xf730('0x7'))(_0xf730('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0xf730('0xa'));config[_0xf730('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf730('0xc'))(new Redis(config['redis']));var cmHopper=require(_0xf730('0xd'));var voiceQueueRt=require(_0xf730('0xe'));var RpcSetting=require(_0xf730('0xf'));var Interval=require('../rpc/interval');var Action=require(_0xf730('0x10'));var History=require(_0xf730('0x11'));var Final=require('./models/final');var AgentComplete=require(_0xf730('0x12'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0xf730('0x13'));var ipAgi=process[_0xf730('0x14')]['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xf730('0x15')]['enqueue']=function(_0x246d04){this['tail']=this[_0xf730('0x16')]?this[_0xf730('0x16')][_0xf730('0x17')](_0x246d04):_0x246d04();};function Dialer(_0x5624cf,_0x5ae803){this[_0xf730('0x18')]=new Sequence();this[_0xf730('0x19')]=_0x5ae803;this[_0xf730('0x1a')]=_0x5624cf[_0xf730('0x1a')];this[_0xf730('0x1b')]=_0x5624cf['campaigns'];this[_0xf730('0x1c')]=_0x5624cf[_0xf730('0x1c')];this[_0xf730('0x1d')]=_0x5624cf[_0xf730('0x1d')];this[_0xf730('0x1e')]=config[_0xf730('0x1e')]||0x2;this['channels']={};this[_0xf730('0x1f')]={};this[_0xf730('0x20')]={};this['uniqueId']={};this[_0xf730('0x21')]={};this['startPredictive']={};this[_0xf730('0x22')]={};this[_0xf730('0x23')]={};this[_0xf730('0x24')]={};this[_0xf730('0x25')]={};this['queuesSummary']={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0xf730('0x26'),this['syncQueueCallerAbandon'][_0xf730('0x27')](this));ami['on'](_0xf730('0x28'),this[_0xf730('0x29')][_0xf730('0x27')](this));ami['on'](_0xf730('0x2a'),this[_0xf730('0x2b')][_0xf730('0x27')](this));ami['on'](_0xf730('0x2c'),this[_0xf730('0x2d')][_0xf730('0x27')](this));ami['on'](_0xf730('0x2e'),this[_0xf730('0x2f')][_0xf730('0x27')](this));ami['on'](_0xf730('0x30'),this['syncHangup'][_0xf730('0x27')](this));ami['on']('newexten',this['syncNewExten'][_0xf730('0x27')](this));ami['on'](_0xf730('0x31'),this[_0xf730('0x32')]['bind'](this));ami['on'](_0xf730('0x33'),this[_0xf730('0x34')][_0xf730('0x27')](this));ami['on'](_0xf730('0x35'),this[_0xf730('0x36')][_0xf730('0x27')](this));this[_0xf730('0x37')]();this[_0xf730('0x38')]();RpcSetting[_0xf730('0x39')]()['then'](function(_0x2a0746){previewRecallmeReminderInterval=_0x2a0746[_0xf730('0x3a')];});}function isNotNull(_0x542c00){return _0x542c00!==null&&!_['isUndefined'](_0x542c00);}function msgResponse(_0x46b27c,_0xd63bb9,_0x176cce){return{'action':_0x46b27c,'response':_0xd63bb9,'message':_0x176cce,'stack':_0x176cce};}function emit(_0x3f0267,_0x30de4e,_0x1f4196){io['to'](_0x3f0267)['emit'](_0x30de4e,_0x1f4196);}function emitOutboundVoiceQueueSummary(_0x2c46ac){if(_0x2c46ac['type']===_0xf730('0x3b')){logger['debug'](_0xf730('0x3c'),util['inspect'](_0x2c46ac,{'showHidden':![],'depth':null}));emit(util['format'](_0xf730('0x3d'),_0x2c46ac[_0xf730('0x3e')]),_0xf730('0x3f'),_0x2c46ac);}}function checkGetDataPredictive(_0x5bba38){if(isNotNull(_0x5bba38)&&!_['isEmpty'](_0x5bba38)){loggerPredictive[_0xf730('0x40')](_0xf730('0x41'));loggerPredictive[_0xf730('0x40')](_0xf730('0x42'),_0x5bba38[_0xf730('0x43')]);loggerPredictive[_0xf730('0x40')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bba38[_0xf730('0x44')]);loggerPredictive['info'](_0xf730('0x45'),_0x5bba38['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xf730('0x40')](_0xf730('0x46'),_0x5bba38[_0xf730('0x47')]);loggerPredictive[_0xf730('0x40')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bba38[_0xf730('0x48')]);loggerPredictive[_0xf730('0x40')](_0xf730('0x49'),_0x5bba38[_0xf730('0x4a')]);loggerPredictive['info'](_0xf730('0x4b'));if(_0x5bba38['predictiveIntervalTotalCalls']>0x0){if(!_[_0xf730('0x4c')](_0x5bba38[_0xf730('0x4a')])&&_0x5bba38[_0xf730('0x4a')]>0x0){return!![];}loggerPredictive[_0xf730('0x40')](_0xf730('0x4d'));if(!_[_0xf730('0x4c')](_0x5bba38[_0xf730('0x48')])&&_0x5bba38[_0xf730('0x48')]>0x0){return!![];}loggerPredictive[_0xf730('0x40')](_0xf730('0x4e'));}else{loggerPredictive['info'](_0xf730('0x4f'));}}else{loggerPredictive[_0xf730('0x40')](_0xf730('0x50'));}return![];}function mergeDataErlangB(_0x1015ec){return function(_0x59cee2){loggerPredictive[_0xf730('0x40')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xf730('0x40')](_0xf730('0x51'),_0x59cee2[_0xf730('0x52')]);loggerPredictive[_0xf730('0x40')](_0xf730('0x53'),_0x59cee2[_0xf730('0x54')]);loggerPredictive[_0xf730('0x40')](_0xf730('0x55'),_0x59cee2['erlangAbandonmentRate']);loggerPredictive[_0xf730('0x40')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59cee2[_0xf730('0x56')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59cee2[_0xf730('0x57')]);loggerPredictive[_0xf730('0x40')]('---------------------------');_['merge'](_0x1015ec,_0x59cee2);};}function ifInterval(_0xbeff2f,_0x14f311){if(_[_0xf730('0x4c')](_0x14f311)){return![];}return utils[_0xf730('0x58')](undefined,_0x14f311)<_0xbeff2f*0x3c;}function clearPredictiveAttributes(_0x494965){if(_0x494965[_0xf730('0x22')]){_0x494965['startProgressive']=undefined;loggerPredictive['debug'](_0x494965[_0xf730('0x3e')],_0xf730('0x59'));}if(_0x494965['startPredictive']){_0x494965[_0xf730('0x5a')]=undefined;loggerPredictive[_0xf730('0x5b')](_0x494965['name'],_0xf730('0x5c'));}if(_0x494965[_0xf730('0x5d')]){clearInterval(_0x494965[_0xf730('0x5d')]);_0x494965[_0xf730('0x5d')]=undefined;loggerPredictive[_0xf730('0x5b')](_0x494965[_0xf730('0x3e')],_0xf730('0x5e'));}}function loggerCatchPredictive(_0x4822f2,_0x2dbb66){return function(_0x275de5){loggerPredictive[_0xf730('0x5f')](_0x2dbb66[_0xf730('0x3e')],_0x4822f2);loggerPredictive[_0xf730('0x5f')](_0x275de5[_0xf730('0x60')]);clearPredictiveAttributes(_0x2dbb66);};}function loggerCatch(_0xfbedfc){return function(_0x1b42cc){logger['error'](_0xfbedfc,util[_0xf730('0x61')](_0x1b42cc,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x226cc4,_0x436fdd,_0x2fe19a){return function(_0x123871){utils['checkContactLowerLimitOriginate'](_0x436fdd,_0x2fe19a,0x0);logger[_0xf730('0x5f')](_0x226cc4,util['inspect'](_0x123871,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x567449){return function(_0x3ac1c5){if(isNotNull(_0x3ac1c5)&&isNotNull(_0x3ac1c5[0x0])){if(_0x3ac1c5[0x0][_0xf730('0x62')]>0x0){_0x567449[_0xf730('0x63')]=utils['CAMPAIGN_STATUS'][_0xf730('0x64')];logger[_0xf730('0x40')](_0xf730('0x65')+_0x567449[_0xf730('0x3e')],_0x3ac1c5[0x0][_0xf730('0x62')],_0xf730('0x66'));}else{_0x567449[_0xf730('0x63')]=utils['CAMPAIGN_STATUS'][_0xf730('0x67')];logger[_0xf730('0x40')]('[getContactDialer2][Empty]'+_0x567449[_0xf730('0x3e')]);}}};}function createObjHistory(_0x2bd401,_0x241cc4,_0x3e2807,_0x510920,_0x19cc93){_0x2bd401[_0xf730('0x63')]=_0x3e2807;var _0x361134=new Action(_0x2bd401,_0x241cc4);var _0x443aa8=new History(_0x361134);_0x443aa8[_0xf730('0x68')]=_0x510920;_0x443aa8[_0xf730('0x69')]=_0x19cc93;_0x443aa8[_0xf730('0x6a')]=_0x361134[_0xf730('0x6b')];return _0x443aa8;}function unlockQueueStatus(_0x3d6525,_0x567ca6){setTimeout(function(){if(_[_0xf730('0x4c')](_0x3d6525[_0xf730('0x6c')])){loggerBooked['error'](_0xf730('0x6d'),_0x567ca6);}_0x3d6525[_0xf730('0x6c')]=!![];loggerBooked['info'](_0xf730('0x6e'),_0x567ca6,JSON['stringify'](_['pick'](_0x3d6525,[_0xf730('0x3e'),_0xf730('0x6c')])));},0x1f3);}function checkInterval(_0xaff3f0){return function(){if(!isNotNull(_0xaff3f0[_0xf730('0x6f')])){_0xaff3f0[_0xf730('0x63')]=utils['CAMPAIGN_STATUS'][_0xf730('0x70')];throw _0xaff3f0[_0xf730('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xaff3f0[_0xf730('0x6f')]['Intervals'])){_0xaff3f0['message']=utils[_0xf730('0x71')][_0xf730('0x70')];throw _0xaff3f0[_0xf730('0x3e')]+_0xf730('0x72');}if(!isNotNull(_[_0xf730('0x73')](_0xaff3f0[_0xf730('0x6f')][_0xf730('0x74')]))){_0xaff3f0[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x70')];throw _0xaff3f0['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x3f380f){return function(){if(!utils['isIVRCampaignActive'](_0x3f380f)){_0x3f380f[_0xf730('0x63')]=utils[_0xf730('0x71')]['INACTIVE'];throw _0x3f380f[_0xf730('0x3e')]+_0xf730('0x75');}};}function emitCampaignSummary(_0x11a66f){if(utils['isIVRCampaign'](_0x11a66f)){emit(util[_0xf730('0x76')](_0xf730('0x77'),_0x11a66f['name']),_0xf730('0x78'),_0x11a66f);}}function loggerCatchQueueSummary(_0x7e6f1e,_0x5d358d){return function(_0x5a9b1c){clearPredictiveAttributes(_0x5d358d);emitCampaignSummary(_0x5d358d);loggerSyncQueueSummary[_0xf730('0x5b')](_0x7e6f1e,util[_0xf730('0x61')](_0x5a9b1c,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2907e5){if(_0x2907e5[_0xf730('0x79')]){if(_0x2907e5[_0xf730('0x7a')]===0x0){_0x2907e5[_0xf730('0x79')]=![];_0x2907e5[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x7b')];loggerSyncQueueSummary[_0xf730('0x5b')](_0xf730('0x7c'),_0x2907e5['name'],_0xf730('0x7d'));}else{_0x2907e5[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x7e')];loggerSyncQueueSummary[_0xf730('0x5b')](_0xf730('0x7c'),_0x2907e5[_0xf730('0x3e')],'is\x20disactive');}emitCampaignSummary(_0x2907e5);}}function myreject(_0x581cfd){return function(_0x55fd0e){return _0x581cfd(msgResponse(_0xf730('0x7f'),'Error',JSON[_0xf730('0x80')](_0x55fd0e)));};}Dialer['prototype']['isTrunkReachable']=function(_0x17bc01){return!_[_0xf730('0x4c')](_0x17bc01)&&_0x17bc01&&!_[_0xf730('0x4c')](_0x17bc01[_0xf730('0x3e')])&&!_[_0xf730('0x4c')](_0x17bc01['active'])&&_0x17bc01[_0xf730('0x81')]&&(this[_0xf730('0x1d')][util[_0xf730('0x76')]('SIP/%s',_0x17bc01[_0xf730('0x3e')])][_0xf730('0x82')]===_0xf730('0x83')||this[_0xf730('0x1d')][util[_0xf730('0x76')](_0xf730('0x84'),_0x17bc01['name'])]['status']==='unmonitored');};Dialer['prototype'][_0xf730('0x85')]=function(_0x4893ef){var _0x4cdf60=this;return function(){if(!_0x4cdf60['isTrunkReachable'](_0x4893ef[_0xf730('0x86')])){if(!_0x4cdf60[_0xf730('0x87')](_0x4893ef['TrunkBackup'])){_0x4893ef[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x88')];throw _0x4893ef['name']+_0xf730('0x89');}}};};Dialer[_0xf730('0x15')][_0xf730('0x8a')]=function(_0x405a75,_0x59737e,_0x469c87,_0x3d45ab){var _0x5c629c=this;return function(){var _0x6138ab=!![];return _0x5c629c['ifTimeIvr'](_0x405a75,_0x59737e,_0x469c87,_0x3d45ab,_0x6138ab);};};Dialer[_0xf730('0x15')][_0xf730('0x8b')]=function(_0x38aa03,_0x36e2ea,_0x35c71d,_0x171f60){var _0x25009b=this;return function(){var _0x5df0cf=![];return _0x25009b[_0xf730('0x8c')](_0x38aa03[_0xf730('0x74')],_0x36e2ea,_0x35c71d,_0x171f60,_0x5df0cf);};};Dialer[_0xf730('0x15')][_0xf730('0x8c')]=function(_0x246943,_0x3f2404,_0x2d0b2f,_0x53690e,_0x3797c3){var _0x4d0e34=[];return new Promise(function(_0x479e6a,_0x362123){if(!isNotNull(_0x246943)){_0x53690e['message']=utils[_0xf730('0x71')]['NULL_INTERVAL'];return _0x362123(msgResponse(_0xf730('0x8d'),_0xf730('0x8e'),_0x2d0b2f+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xf730('0x73')](_0x246943)){_0x53690e[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x8f')];return _0x362123(msgResponse('ifTime',_0xf730('0x8e'),_0x2d0b2f+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3f2404&&_[_0xf730('0x4c')](config[_0xf730('0x90')][_0x3f2404])){_0x53690e[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x91')];return _0x362123(msgResponse('ifTime',_0xf730('0x8e'),_0x2d0b2f+_0xf730('0x92')+_0x3f2404));}if(_[_0xf730('0x93')](_0x246943)){for(var _0x4c49f0=0x0;_0x4c49f0<_0x246943[_0xf730('0x94')];_0x4c49f0+=0x1){_0x4d0e34[_0xf730('0x95')](ami[_0xf730('0x96')]({'action':_0xf730('0x97'),'command':util[_0xf730('0x76')](_0xf730('0x98'),_0x246943[_0x4c49f0][_0xf730('0x99')],!_[_0xf730('0x4c')](config[_0xf730('0x90')][_0x3f2404])?_0x3f2404:'')})[_0xf730('0x9a')](function(_0x5640ec){return _0x5640ec[_0xf730('0x9b')]['indexOf'](_0xf730('0x9c'))>=0x0;})[_0xf730('0x9d')](myreject(_0x362123)));}}else{_0x4d0e34[_0xf730('0x95')](ami[_0xf730('0x96')]({'action':_0xf730('0x97'),'command':util[_0xf730('0x76')](_0xf730('0x98'),_0x246943,!_[_0xf730('0x4c')](config[_0xf730('0x90')][_0x3f2404])?_0x3f2404:'')})[_0xf730('0x9a')](function(_0x200146){return _0x200146['content']['indexOf'](_0xf730('0x9c'))>=0x0;})[_0xf730('0x9d')](myreject(_0x362123)));}Promise[_0xf730('0x9e')](_0x4d0e34)[_0xf730('0x9a')](function(_0xfb40c){var _0x477cb2=_[_0xf730('0x9f')](_0xfb40c);if(_0x477cb2){return _0x479e6a(_0x477cb2);}else{_0x53690e[_0xf730('0x63')]=_0x3797c3?utils[_0xf730('0x71')][_0xf730('0xa0')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x362123(msgResponse(_0xf730('0xa1'),_0xf730('0x8e'),_0xf730('0xa2')+_0x3797c3+'\x20'+_0x2d0b2f+'\x20Interval\x20is\x20overtime:\x20'+util[_0xf730('0x61')](_0x246943,{'showHidden':![],'depth':null})+_0xf730('0xa3')+_0x3f2404));}})[_0xf730('0x9d')](function(_0x11774d){return _0x362123(msgResponse(_0xf730('0x8d'),_0xf730('0x8e'),JSON['stringify'](_0x11774d)));});});};Dialer['prototype'][_0xf730('0x37')]=function(){var _0x3b9190=this;return cmHopper[_0xf730('0xa4')]({'active':![]},{'where':{'active':!![]}})[_0xf730('0x9a')](function(){setInterval(function(){_0x3b9190[_0xf730('0xa5')]();},0x3e8);});};Dialer['prototype'][_0xf730('0xa5')]=function(){var _0x491d9e=this;var _0x4b91e1;for(var _0x165cd9 in this[_0xf730('0x1b')]){if(typeof this[_0xf730('0x1b')][_0x165cd9]!==_0xf730('0xa6')){_0x4b91e1=this[_0xf730('0x1b')][_0x165cd9];if(utils[_0xf730('0xa7')](_0x4b91e1)&&utils['isIVRCampaignActive'](_0x4b91e1)){_0x4b91e1[_0xf730('0x79')]=!![];Promise['resolve']()[_0xf730('0x9a')](checkIsIVRCampaignActive(_0x4b91e1))['then'](checkInterval(_0x4b91e1))[_0xf730('0x9a')](_0x491d9e['checkIsTrunkReachable'](_0x4b91e1))[_0xf730('0x9a')](_0x491d9e[_0xf730('0x8a')](_0x4b91e1['dialGlobalInterval'],_0x4b91e1[_0xf730('0xa8')],_0x4b91e1['name'],_0x4b91e1))[_0xf730('0x9a')](_0x491d9e['checkIfTimeIntervals'](_0x4b91e1[_0xf730('0x6f')],_0x4b91e1[_0xf730('0xa8')],_0x4b91e1['name'],_0x4b91e1))[_0xf730('0x9a')](_0x491d9e[_0xf730('0xa9')](_0x4b91e1))[_0xf730('0x9d')](loggerCatchQueueSummary(_0xf730('0xaa'),_0x4b91e1));}else{notSendMessagesCampaign(_0x4b91e1);}}}};Dialer['prototype'][_0xf730('0xab')]=function(_0x7b4811){if(_0x7b4811[_0xf730('0xac')]!==_0xf730('0x8')){clearPredictiveAttributes(_0x7b4811);}switch(_0x7b4811[_0xf730('0xac')]){case _0xf730('0xad'):this['handlePower'](_0x7b4811,0x1);break;case _0xf730('0xae'):this[_0xf730('0xaf')](_0x7b4811,_0x7b4811['dialPowerLevel']);break;case'predictive':this[_0xf730('0x8')](_0x7b4811);break;case'booked':this['handlePower'](_0x7b4811,0x1);break;default:logger[_0xf730('0x5f')](_0xf730('0xb0'),_0x7b4811[_0xf730('0x3e')],_0xf730('0xb1'));}};Dialer[_0xf730('0x15')][_0xf730('0x8d')]=function(_0xb9e4ab,_0x32bd2c){var _0x1c32ee=_0xb9e4ab[_0xf730('0xa8')];var _0x11cb78=_0x32bd2c?_0xb9e4ab[_0xf730('0xb2')]:_0xb9e4ab['Interval'][_0xf730('0x74')];logger[_0xf730('0xb3')](_0xf730('0xb4'),_0x11cb78,_0x1c32ee,_0xb9e4ab[_0xf730('0x3e')],util[_0xf730('0x76')](_0xf730('0xb5'),_0xb9e4ab[_0xf730('0x3e')],_0xb9e4ab['id']));var _0x1d671c=null;return Interval[_0xf730('0xb6')](_0x11cb78,_0x1c32ee)[_0xf730('0x9a')](function(_0x1fc0f2){if(_0x1fc0f2===!![]){return _0x1fc0f2;}else{_0xb9e4ab['message']=_0x32bd2c?utils[_0xf730('0x71')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xf730('0x71')][_0xf730('0xb7')];_0x1d671c=msgResponse(_0xf730('0xa1'),_0xf730('0x8e'),'Global:\x20'+_0x32bd2c+'\x20'+_0xb9e4ab[_0xf730('0x3e')]+_0xf730('0xb8')+util[_0xf730('0x61')](_0x11cb78,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1c32ee);}if(_0x1d671c!==null){logger[_0xf730('0xb3')](_0xf730('0xb9'),_0x1d671c);_0x1d671c[_0xf730('0xba')]=_0x32bd2c;throw _0x1d671c;}})[_0xf730('0x9d')](function(_0x3fdf58){logger[_0xf730('0x5f')](_0xf730('0xbb'),_0x3fdf58);throw msgResponse(_0xf730('0x7f'),_0xf730('0xbc'),util['inspect'](_0x3fdf58,{'showHidden':![],'depth':null}));});};Dialer[_0xf730('0x15')]['syncAgentConnect']=function(_0x30aa2d){if(this[_0xf730('0x1a')][_0x30aa2d[_0xf730('0xbd')]]){if(this[_0xf730('0xbe')][_0x30aa2d[_0xf730('0xbf')]]&&this[_0xf730('0xbe')][_0x30aa2d[_0xf730('0xbf')]]['type']!==_0xf730('0xc0')){this[_0xf730('0xc1')](this[_0xf730('0x1a')][_0x30aa2d[_0xf730('0xbd')]]);this[_0xf730('0xbe')][_0x30aa2d['uniqueid']][_0xf730('0xc2')]=moment()['format'](_0xf730('0xc3'));}}};Dialer[_0xf730('0x15')][_0xf730('0x2b')]=function(_0x321d59){var _0x5ea09e=this['uniqueId'][_0x321d59[_0xf730('0xbf')]];if(this[_0xf730('0x1a')][_0x321d59[_0xf730('0xbd')]]){if(_0x5ea09e&&_0x5ea09e['type']!==_0xf730('0xc0')){delete this[_0xf730('0xbe')][_0x321d59[_0xf730('0xbf')]];this[_0xf730('0x1a')][_0x321d59[_0xf730('0xbd')]][_0xf730('0xc4')]+=0x1;var _0x3b57b6=new AgentComplete(_0x5ea09e,_0x321d59);if(_0x321d59[_0xf730('0xc5')]===_0xf730('0xc6')){_0x3b57b6[_0xf730('0xc7')]=this[_0xf730('0x1a')][_0x321d59[_0xf730('0xbd')]][_0xf730('0xc8')]&&this[_0xf730('0x1a')][_0x321d59[_0xf730('0xbd')]]['dialAgiAfterHangupAgent']?moment()[_0xf730('0x76')](_0xf730('0xc3')):undefined;}hopperUtils[_0xf730('0xc9')](_0x3b57b6)[_0xf730('0x9d')](loggerCatch(_0xf730('0xca')));hopperUtils['moveContactManagedDialer'](_0x3b57b6)[_0xf730('0x9d')](loggerCatch(_0xf730('0xcb')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x5a9af3){var _0x22817d=this['uniqueId'][_0x5a9af3[_0xf730('0xbf')]];var _0x135be9=this;var _0x59be16=![];var _0xb3b7fc;var _0x385ca6;if(this['voiceQueues'][_0x5a9af3[_0xf730('0xbd')]]){if(_0x22817d&&_0x22817d[_0xf730('0xcc')]!=='ivr'){delete this[_0xf730('0xbe')][_0x5a9af3[_0xf730('0xbf')]];this[_0xf730('0xc1')](this[_0xf730('0x1a')][_0x5a9af3['queue']]);_0x22817d['droptime']=moment()[_0xf730('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4415a8=new QueueCallerAbandon(_0x22817d,_0x5a9af3);if(utils[_0xf730('0x58')](_0x22817d[_0xf730('0xcd')],_0x22817d[_0xf730('0xce')])>=_0x22817d[_0xf730('0xcf')]){this[_0xf730('0x1a')][_0x5a9af3['queue']][_0xf730('0xd0')]+=0x1;this[_0xf730('0x1a')][_0x5a9af3[_0xf730('0xbd')]][_0xf730('0xd1')]+=0x1;this[_0xf730('0x1a')][_0x5a9af3['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4415a8[_0xf730('0x68')]=0xa;_0x4415a8['statedesc']='Drop';_0x4415a8['dropreason']=_0xf730('0xd2');_0x4415a8[_0xf730('0xc7')]=this['voiceQueues'][_0x5a9af3[_0xf730('0xbd')]]['dialQueueProject2']?moment()['format'](_0xf730('0xc3')):undefined;_0x4415a8[_0xf730('0xd3')]+=0x1;_0x4415a8[_0xf730('0xd4')]+=0x1;_0xb3b7fc=this[_0xf730('0x1a')][_0x5a9af3['queue']]['dialDropRetryFrequency'];_0x385ca6=this[_0xf730('0x1a')][_0x5a9af3[_0xf730('0xbd')]][_0xf730('0xd5')];hopperUtils['verifyAdditionalPhones'](_0x4415a8,_0x4415a8[_0xf730('0x68')],_0x22817d[_0xf730('0xd6')])[_0xf730('0x9a')](function(_0x56b2c2){_0x59be16=_0x56b2c2[_0xf730('0xd7')]==0x1;if(_0x4415a8[_0xf730('0xd3')]>=_0x135be9[_0xf730('0x1a')][_0x5a9af3['queue']][_0xf730('0xd8')]){_0x135be9[_0xf730('0xd9')](_0x4415a8,_0x56b2c2[_0xf730('0xd7')]);}else{hopperUtils[_0xf730('0xda')]({'active':![],'countdropretry':_0x4415a8['countdropretry'],'scheduledat':moment()[_0xf730('0xdb')](_0x135be9[_0xf730('0x1a')][_0x5a9af3[_0xf730('0xbd')]][_0xf730('0xdc')],_0xf730('0xdd'))[_0xf730('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22817d[_0xf730('0xde')],'ListId':_0x22817d['ListId'],'VoiceQueueId':_0x22817d[_0xf730('0xdf')]||undefined,'CampaignId':_0x22817d[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0xe1')));var _0x17501c=new History(_0x4415a8);_0x17501c[_0xf730('0x68')]=0xa;_0x17501c[_0xf730('0x69')]=_0xf730('0xe2');_0x17501c[_0xf730('0x6b')]=moment()['format'](_0xf730('0xc3'));_0x17501c[_0xf730('0x6a')]=_0x17501c[_0xf730('0x6b')];_0x17501c[_0xf730('0xe3')]=_0x4415a8[_0xf730('0xe3')];_0x17501c[_0xf730('0xe4')]=_0x4415a8[_0xf730('0xe4')];hopperUtils[_0xf730('0xc9')](_0x17501c)[_0xf730('0x9d')](loggerCatch(_0xf730('0xe5')));}})[_0xf730('0x9a')](function(){if(_0x59be16)hopperUtils[_0xf730('0xe6')](_0x4415a8,_0xb3b7fc,_0x385ca6)[_0xf730('0x9a')](function(){return 0x1;});});}else{this[_0xf730('0x1a')][_0x5a9af3[_0xf730('0xbd')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xf730('0x1a')][_0x5a9af3['queue']][_0xf730('0xe7')]+=0x1;_0x4415a8['state']=0xb;_0x4415a8[_0xf730('0x69')]='Abandoned';_0x4415a8[_0xf730('0xe8')]=_0xf730('0xe9');_0x4415a8[_0xf730('0xea')]+=0x1;_0x4415a8['countglobal']+=0x1;_0xb3b7fc=this[_0xf730('0x1a')][_0x5a9af3[_0xf730('0xbd')]][_0xf730('0xeb')];_0x385ca6=this[_0xf730('0x1a')][_0x5a9af3[_0xf730('0xbd')]][_0xf730('0xd5')];hopperUtils[_0xf730('0xec')](_0x4415a8,_0x4415a8[_0xf730('0x68')],_0x22817d['voiceQueue'])['then'](function(_0x2e4f84){if(_0x4415a8[_0xf730('0xea')]>=_0x135be9[_0xf730('0x1a')][_0x5a9af3['queue']][_0xf730('0xed')]){_0x135be9[_0xf730('0xd9')](_0x4415a8,_0x2e4f84[_0xf730('0xd7')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4415a8[_0xf730('0xea')],'scheduledat':moment()[_0xf730('0xdb')](_0x135be9[_0xf730('0x1a')][_0x5a9af3['queue']][_0xf730('0xeb')],_0xf730('0xdd'))[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x22817d[_0xf730('0xde')],'ListId':_0x22817d['ListId'],'VoiceQueueId':_0x22817d['VoiceQueueId']||undefined,'CampaignId':_0x22817d['CampaignId']||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0xee')));var _0x322b9b=new History(_0x4415a8);_0x322b9b[_0xf730('0x68')]=0xb;_0x322b9b['statedesc']='Abandoned';_0x322b9b['starttime']=moment()[_0xf730('0x76')](_0xf730('0xc3'));_0x322b9b[_0xf730('0x6a')]=_0x322b9b['starttime'];_0x322b9b[_0xf730('0xe3')]=_0x4415a8[_0xf730('0xe3')];_0x322b9b[_0xf730('0xe4')]=_0x4415a8[_0xf730('0xe4')];hopperUtils[_0xf730('0xc9')](_0x322b9b)[_0xf730('0x9d')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xf730('0x9a')](function(){if(_0x59be16)hopperUtils[_0xf730('0xe6')](_0x4415a8,_0xb3b7fc,_0x385ca6)[_0xf730('0x9a')](function(){return 0x1;});});}}}};Dialer[_0xf730('0x15')][_0xf730('0xef')]=function(_0x4b33b1){if(this[_0xf730('0x1f')][_0x4b33b1[_0xf730('0xbf')]]){this[_0xf730('0x1f')][_0x4b33b1[_0xf730('0xbf')]]['channel']=_0x4b33b1[_0xf730('0xf0')];}if(this[_0xf730('0xbe')][_0x4b33b1[_0xf730('0xbf')]]){this[_0xf730('0xbe')][_0x4b33b1[_0xf730('0xbf')]][_0xf730('0xf0')]=_0x4b33b1[_0xf730('0xf0')];}};Dialer[_0xf730('0x15')][_0xf730('0x34')]=function(_0x3de367){if(!this[_0xf730('0x1f')][_0x3de367[_0xf730('0xf1')]]){return;}var _0x138179=this['voiceQueues'][this['actions'][_0x3de367[_0xf730('0xf1')]]['queue']]['strategy']||_0xf730('0xf2');if(_0x138179==='roundrobin'){if(this['actions'][_0x3de367[_0xf730('0xf1')]]&&_[_0xf730('0xf3')](this[_0xf730('0x1f')][_0x3de367[_0xf730('0xf1')]][_0xf730('0xf4')])&&_0x3de367['status']==='1'&&_0x3de367['paused']==='0'){if(this[_0xf730('0x1c')][_0x3de367[_0xf730('0xf5')]]){if(!this[_0xf730('0x1c')][_0x3de367[_0xf730('0xf5')]]['locked']){this[_0xf730('0x1c')][_0x3de367[_0xf730('0xf5')]][_0xf730('0xf4')]=!![];this[_0xf730('0x1f')][_0x3de367['actionid']][_0xf730('0xf4')]=!![];this['actions'][_0x3de367[_0xf730('0xf1')]][_0xf730('0xf5')]=_0x3de367[_0xf730('0xf5')];}}}}else if(_0x138179==='rrmemory'){if(this[_0xf730('0x1f')][_0x3de367['actionid']]){if(this[_0xf730('0x1c')][_0x3de367['stateinterface']]){this[_0xf730('0x1f')][_0x3de367['actionid']][_0xf730('0xf5')]=_0x3de367[_0xf730('0xf5')];if(_['isNil'](this[_0xf730('0x24')][this[_0xf730('0x1f')][_0x3de367[_0xf730('0xf1')]]['queue']])){this['queueBooked'][this[_0xf730('0x1f')][_0x3de367[_0xf730('0xf1')]][_0xf730('0xbd')]]=[];}this['queueBooked'][this[_0xf730('0x1f')][_0x3de367[_0xf730('0xf1')]][_0xf730('0xbd')]][_0xf730('0x95')](_[_0xf730('0xf6')](_[_0xf730('0xf7')](this[_0xf730('0x1f')][_0x3de367[_0xf730('0xf1')]],[_0xf730('0xf8'),'stateinterface']),{'status':_0x3de367[_0xf730('0x82')],'paused':_0x3de367['paused']}));}}}};Dialer[_0xf730('0x15')][_0xf730('0x36')]=function(_0x4f2259){if(!this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]]){return;}var _0x4fdec1=this;var _0x43604b=this[_0xf730('0x1a')][this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]]['queue']];var _0x65bbaf=_0x43604b[_0xf730('0xf9')]||_0xf730('0xf2');if(_0x65bbaf===_0xf730('0xfa')){if(this['actions'][_0x4f2259['actionid']]&&this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]][_0xf730('0xf5')]){this[_0xf730('0x19')][_0xf730('0xfb')](this[_0xf730('0x1f')][_0x4f2259['actionid']][_0xf730('0xf8')],this['actions'][_0x4f2259[_0xf730('0xf1')]]['stateinterface'])['catch'](function(_0x291fba){logger['error'](_0xf730('0xfc'),util[_0xf730('0x61')](_0x291fba,{'showHidden':![],'depth':null}));})[_0xf730('0x17')](function(){_0x4fdec1[_0xf730('0xc1')](_0x4fdec1[_0xf730('0x1a')][_0x4fdec1['actions'][_0x4f2259[_0xf730('0xf1')]][_0xf730('0xbd')]]);_0x4fdec1[_0xf730('0x1c')][_0x4fdec1[_0xf730('0x1f')][_0x4f2259['actionid']][_0xf730('0xf5')]][_0xf730('0xf4')]=![];delete _0x4fdec1[_0xf730('0x1f')][_0x4f2259['actionid']];unlockQueueStatus(_0x43604b);});}else{this[_0xf730('0xc1')](this[_0xf730('0x1a')][this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]]['queue']]);hopperUtils[_0xf730('0xda')]({'active':![],'ContactId':this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]][_0xf730('0xde')],'ListId':this['actions'][_0x4f2259[_0xf730('0xf1')]]['ListId'],'VoiceQueueId':this['actions'][_0x4f2259['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]][_0xf730('0xe0')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]];unlockQueueStatus(_0x43604b);}}else if(_0x65bbaf==='rrmemory'){var _0x5e05d8;if(this['actions'][_0x4f2259[_0xf730('0xf1')]]&&!_['isEmpty'](this[_0xf730('0x24')][this['actions'][_0x4f2259[_0xf730('0xf1')]][_0xf730('0xbd')]])){if(this['queueBookedRR'][_0x4fdec1[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]]['queue']]){this[_0xf730('0x25')][_0x4fdec1[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]][_0xf730('0xbd')]]=this[_0xf730('0x25')][this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]]['queue']]?this[_0xf730('0x25')][this[_0xf730('0x1f')][_0x4f2259[_0xf730('0xf1')]]['queue']]:this[_0xf730('0x24')][this['actions'][_0x4f2259[_0xf730('0xf1')]]['queue']]?this[_0xf730('0x24')][this['actions'][_0x4f2259[_0xf730('0xf1')]][_0xf730('0xbd')]]['_rr']||0x0:0x0;}this[_0xf730('0x24')][this[_0xf730('0x1f')][_0x4f2259['actionid']][_0xf730('0xbd')]]['_rr']=this[_0xf730('0x25')][this[_0xf730('0x1f')][_0x4f2259['actionid']][_0xf730('0xbd')]];for(var _0x2047c4=0x0;_0x2047c4=_0x569b13[_0xf730('0x122')]){_0x5b79b7['stateGlobal'](_0x129e6f,_0x3f0862,_0x48f2bf,_0xf730('0x123'));}else{if(_0x129e6f[_0xf730('0x11b')]>=_0x569b13[_0xf730('0x124')]){_0x5b79b7['createStateFinal'](_0x129e6f,_0x3f0862,_0x48f2bf,_0xf730('0x125'));}else{hopperUtils[_0xf730('0xda')]({'active':![],'countmachineretry':_0x129e6f[_0xf730('0x11b')],'scheduledat':moment()[_0xf730('0xdb')](_0x569b13['dialMachineRetryFrequency'],_0xf730('0xdd'))[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x129e6f['ContactId'],'ListId':_0x129e6f[_0xf730('0x103')],'VoiceQueueId':_0x129e6f[_0xf730('0xdf')]||undefined,'CampaignId':_0x129e6f[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0x126')));_0x3f0862({'reschedule':0x1});}}});}if(_0x4a2670[_0xf730('0xcc')]===_0xf730('0xc0')&&this[_0xf730('0x1b')][_0x4a2670['queue']][_0xf730('0x10f')]&&_0x176fcd['value']===_0xf730('0x111')){delete this[_0xf730('0xbe')][_0x176fcd[_0xf730('0xbf')]];this['updateOriginated'](this[_0xf730('0x1b')][_0x4a2670[_0xf730('0xbd')]]);_0x3c8ddb=new Hangup(_0x4a2670,_0x176fcd);_0x3c8ddb[_0xf730('0x68')]=0x12;_0x3c8ddb['statedesc']='HangupInAMD';_0x3c8ddb[_0xf730('0x11a')]=_0xf730('0x114');ami[_0xf730('0x115')]('custom:amd',ut[_0xf730('0x11e')](_0x3c8ddb,_0xf730('0x11c')));this['saveInDb'](_0x3c8ddb,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x4a2670['type']===_0xf730('0xc0')&&this[_0xf730('0x1b')][_0x4a2670['queue']][_0xf730('0x10f')]&&_0x176fcd[_0xf730('0x110')]==='MACHINE'){return new Promise(function(_0x3672be,_0x557e46){delete _0x5b79b7[_0xf730('0xbe')][_0x176fcd[_0xf730('0xbf')]];_0x5b79b7[_0xf730('0xc1')](_0x5b79b7[_0xf730('0x1b')][_0x4a2670['queue']]);_0x5b79b7['campaigns'][_0x4a2670[_0xf730('0xbd')]][_0xf730('0xc4')]+=0x1;_0x5b79b7[_0xf730('0x1b')][_0x4a2670[_0xf730('0xbd')]][_0xf730('0x112')]+=0x1;var _0xc4aca6=_0x5b79b7['campaigns'][_0x4a2670[_0xf730('0xbd')]];var _0x2085ed=new Hangup(_0x4a2670,_0x176fcd);_0x2085ed[_0xf730('0x68')]=0x13;_0x2085ed[_0xf730('0x69')]=_0xf730('0x127');_0x2085ed[_0xf730('0x11a')]='AMD';_0x2085ed[_0xf730('0x11b')]+=0x1;_0x2085ed[_0xf730('0xd4')]+=0x1;_0x2085ed[_0xf730('0x11c')]=!![];ami[_0xf730('0x115')]('custom:amd',ut[_0xf730('0x11e')](_0x2085ed,_0xf730('0x11c')));hopperUtils[_0xf730('0xc9')](_0x2085ed)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2085ed['countbusyretry']+_0x2085ed['countcongestionretry']+_0x2085ed[_0xf730('0x128')]+_0x2085ed[_0xf730('0x120')]+_0x2085ed[_0xf730('0xd3')]+_0x2085ed[_0xf730('0xea')]+_0x2085ed['countmachineretry']+_0x2085ed[_0xf730('0x121')]>=_0xc4aca6['dialGlobalMaxRetry']){_0x5b79b7[_0xf730('0x129')](_0x2085ed,_0x3672be,_0x557e46,'reason19\x20machine....');}else{if(_0x2085ed['countmachineretry']>=_0xc4aca6[_0xf730('0x124')]){_0x5b79b7['createStateFinal'](_0x2085ed,_0x3672be,_0x557e46,'reason\x2019\x20machine....');}else{hopperUtils[_0xf730('0xda')]({'active':![],'countmachineretry':_0x2085ed[_0xf730('0x11b')],'scheduledat':moment()[_0xf730('0xdb')](_0xc4aca6['dialMachineRetryFrequency'],_0xf730('0xdd'))[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x2085ed[_0xf730('0xde')],'ListId':_0x2085ed[_0xf730('0x103')],'VoiceQueueId':_0x2085ed['VoiceQueueId']||undefined,'CampaignId':_0x2085ed['CampaignId']||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0x126')));_0x3672be({'reschedule':0x1});}}});}}};Dialer[_0xf730('0x15')][_0xf730('0x12a')]=function(_0xb0fc52){var _0x2086e8=this[_0xf730('0xbe')][_0xb0fc52[_0xf730('0xbf')]];var _0x59a6ef;if(_0x2086e8&&_0x2086e8[_0xf730('0xcc')]===_0xf730('0xc0')){delete this['uniqueId'][_0xb0fc52['uniqueid']];this[_0xf730('0xc1')](this['campaigns'][_0x2086e8[_0xf730('0xbd')]]);this[_0xf730('0x1b')][_0x2086e8['queue']]['ivrAnswerCallsDay']+=0x1;_0x59a6ef=new Hangup(_0x2086e8,_0xb0fc52);hopperUtils[_0xf730('0xc9')](_0x59a6ef)[_0xf730('0x9d')](loggerCatch(_0xf730('0x12b')));hopperUtils['moveContactManagedDialer'](_0x59a6ef)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x2086e8&&_0x2086e8[_0xf730('0xcc')]!==_0xf730('0xc0')&&isNotNull(this[_0xf730('0x1a')][_0x2086e8[_0xf730('0xbd')]]['dialQueueProject'])){delete this[_0xf730('0xbe')][_0xb0fc52[_0xf730('0xbf')]];this[_0xf730('0xc1')](this[_0xf730('0x1a')][_0x2086e8['queue']]);this[_0xf730('0x1a')][_0x2086e8['queue']][_0xf730('0xc4')]+=0x1;this['voiceQueues'][_0x2086e8[_0xf730('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;_0x59a6ef=new Hangup(_0x2086e8,_0xb0fc52);_0x59a6ef['state']=0x10;_0x59a6ef[_0xf730('0x69')]='AnswerAGI';_0x59a6ef['membername']=_0xf730('0x12c');hopperUtils[_0xf730('0xc9')](_0x59a6ef)[_0xf730('0x9d')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xf730('0x12d')](_0x59a6ef)[_0xf730('0x9d')](loggerCatch(_0xf730('0x12e')));}if(_0x2086e8&&_0x2086e8['type']!==_0xf730('0xc0')&&!isNotNull(this[_0xf730('0x1a')][_0x2086e8[_0xf730('0xbd')]][_0xf730('0x12f')])){delete this[_0xf730('0xbe')][_0xb0fc52['uniqueid']];this['updateOriginated'](this[_0xf730('0x1a')][_0x2086e8[_0xf730('0xbd')]]);this['voiceQueues'][_0x2086e8[_0xf730('0xbd')]]['outboundUnknownCallsDay']+=0x1;_0x59a6ef=new Hangup(_0x2086e8,_0xb0fc52);_0x59a6ef[_0xf730('0x68')]=0xc;_0x59a6ef[_0xf730('0x69')]=_0xb0fc52[_0xf730('0x130')];_0x59a6ef[_0xf730('0x11a')]=_0xf730('0x131');hopperUtils[_0xf730('0xc9')](_0x59a6ef)[_0xf730('0x9d')](loggerCatch(_0xf730('0x12b')));hopperUtils['moveContactManagedDialer'](_0x59a6ef)[_0xf730('0x9d')](loggerCatch(_0xf730('0x12e')));}};Dialer[_0xf730('0x15')][_0xf730('0x2d')]=function(_0x32a36e){var _0x1e9f24=this;if(!_0x1e9f24['queuesSummary'][_0x32a36e[_0xf730('0x3e')]]){_0x1e9f24[_0xf730('0x132')][_0x32a36e[_0xf730('0x3e')]]={'running':![]};}else if(_0x1e9f24[_0xf730('0x132')][_0x32a36e[_0xf730('0x3e')]][_0xf730('0x133')]===!![]){return;}else if(_0x1e9f24[_0xf730('0x132')][_0x32a36e[_0xf730('0x3e')]][_0xf730('0x133')]===![]){_0x1e9f24[_0xf730('0x132')][_0x32a36e[_0xf730('0x3e')]]['running']=!![];}var _0x23ba74=_0x1e9f24['voiceQueues'][_0x32a36e['name']];var _0x14a12b=_0x23ba74[_0xf730('0x63')]!==utils['CAMPAIGN_STATUS']['INACTIVE'];var _0x425166=utils[_0xf730('0x134')](_0x23ba74);_0x23ba74[_0xf730('0x135')]=utils[_0xf730('0x136')](_0x23ba74,_0x1e9f24[_0xf730('0x1d')]);Promise[_0xf730('0x137')]()['then'](function(){if(_0x23ba74[_0xf730('0x135')]===utils[_0xf730('0x71')][_0xf730('0x7b')]){if(_0x14a12b){clearPredictiveAttributes(_0x23ba74);_0x32a36e[_0xf730('0x5a')]=undefined;_0x32a36e[_0xf730('0x22')]=undefined;}if(_0x23ba74['statusMessage']===utils[_0xf730('0x71')][_0xf730('0x7b')]){_0x32a36e['available']=0x0;_0x32a36e[_0xf730('0xfd')]=0x0;_0x32a36e[_0xf730('0x138')]=0x0;_0x32a36e[_0xf730('0x139')]=0x0;_0x32a36e['pTalking']=0x0;}}else if(_0x23ba74[_0xf730('0x135')]===utils['CAMPAIGN_STATUS'][_0xf730('0x13a')]&&!_0x425166){return _0x1e9f24['ifTime'](_0x23ba74,!![])[_0xf730('0x9a')](function(){return _0x1e9f24['ifTime'](_0x23ba74,![]);})[_0xf730('0x9a')](function(){return _0x1e9f24[_0xf730('0xab')](_0x23ba74);})[_0xf730('0x9d')](function(_0x4e2ff0){loggerSyncQueueSummary[_0xf730('0x5b')](_0xf730('0x13b'),util[_0xf730('0x61')](_0x4e2ff0,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x23ba74);});}else{clearPredictiveAttributes(_0x23ba74);}})[_0xf730('0x9a')](function(){var _0xb3960=_0x32a36e[_0xf730('0x13c')](_0x23ba74);if(_0xb3960||_0x23ba74[_0xf730('0x13d')]){_0x23ba74['queueSummaryCountersUpdated']=![];_0x32a36e[_0xf730('0x13e')](_0x23ba74);Object['assign'](_0x23ba74,_0x32a36e);emitOutboundVoiceQueueSummary(_0x32a36e);}_0x1e9f24['queuesSummary'][_0x23ba74[_0xf730('0x3e')]][_0xf730('0x133')]=![];})[_0xf730('0x9d')](function(_0x1a8dda){logger[_0xf730('0x5f')](_0xf730('0x13b'),util['inspect'](_0x1a8dda,{'showHidden':![],'depth':null}));_0x1e9f24[_0xf730('0x132')][_0x23ba74[_0xf730('0x3e')]]['running']=![];});};Dialer['prototype'][_0xf730('0x2f')]=_[_0xf730('0x13f')](function(){var _0xe749fa=_[_0xf730('0x140')](this['voiceQueues'],function(_0x244f24){return _0x244f24['dialPreviewRecallmeReminder'];});var _0x254559=_['filter'](this['agents'],function(_0x3e169d){return _0x3e169d[_0xf730('0x141')]&&_0x3e169d['status']===_0xf730('0x83');});if(_0xe749fa[_0xf730('0x94')]>0x0&&_0x254559[_0xf730('0x94')]>0x0){return Promise[_0xf730('0x137')]()[_0xf730('0x9a')](cmHopper[_0xf730('0x142')](_['map'](_0xe749fa,'id'),previewRecallmeReminderInterval,_[_0xf730('0x143')](_0x254559,'id')))[_0xf730('0x9a')](function(_0x1c25af){for(var _0x53200a=0x0;_0x53200a<_0x1c25af[_0xf730('0x94')];_0x53200a++){var _0x1572ac=_0x1c25af[_0x53200a][_0xf730('0x144')]['name'];if(_0x1572ac)io['to'](util[_0xf730('0x76')](_0xf730('0x145'),_0x1572ac))[_0xf730('0x115')](_0xf730('0x146'),{'hopper':_0x1c25af[_0x53200a]});}})[_0xf730('0x9d')](function(_0x298a3a){logger['error'](_0xf730('0x147'),_0x298a3a);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xf730('0x15')]['loopClearZombieChannels']=function(){var _0x5a2f0a=this;setInterval(function(){_0x5a2f0a[_0xf730('0x148')](_0x5a2f0a[_0xf730('0xbe')],_0xf730('0x149'));_0x5a2f0a['clearZombieChannels'](_0x5a2f0a[_0xf730('0x1f')],_0xf730('0x14a'));},0x32c8);};Dialer[_0xf730('0x15')][_0xf730('0x148')]=function(_0x540fb8,_0x29b8d2){var _0x492d34=this;for(var _0x17a8e6 in _0x540fb8){if(typeof _0x540fb8[_0x17a8e6]!==_0xf730('0xa6')){this[_0xf730('0x18')][_0xf730('0x14b')](function(){if(!_[_0xf730('0xf3')](_0x540fb8[_0x17a8e6])){return ami[_0xf730('0x96')]({'action':_0xf730('0x82'),'channel':_0x540fb8[_0x17a8e6][_0xf730('0xf0')]})[_0xf730('0x9d')](function(_0x157a81){if(_0x157a81[_0xf730('0x63')]===_0xf730('0x14c')){setTimeout(function(){if(_0x540fb8[_0x17a8e6]&&_0x540fb8[_0x17a8e6][_0xf730('0xcc')]!==_0xf730('0xc0')){_0x492d34[_0xf730('0xc1')](_0x492d34[_0xf730('0x1a')][_0x540fb8[_0x17a8e6][_0xf730('0xbd')]]);logger[_0xf730('0x5f')](_0xf730('0x14d'),_0x29b8d2,_0x17a8e6,_0x540fb8[_0x17a8e6][_0xf730('0xbd')]);delete _0x540fb8[_0x17a8e6];}if(_0x540fb8[_0x17a8e6]&&_0x540fb8[_0x17a8e6][_0xf730('0xcc')]===_0xf730('0xc0')){_0x492d34['updateOriginated'](_0x492d34[_0xf730('0x1b')][_0x540fb8[_0x17a8e6][_0xf730('0xbd')]]);logger[_0xf730('0x5f')](_0xf730('0x14e'),_0x29b8d2,_0x17a8e6,_0x540fb8[_0x17a8e6][_0xf730('0xbd')]);delete _0x540fb8[_0x17a8e6];}},0x2328);}});}});}}};Dialer['prototype'][_0xf730('0x14f')]=function(_0x42a011){return Promise[_0xf730('0x137')]()[_0xf730('0x9a')](voiceQueueRt[_0xf730('0x14f')](_0x42a011))[_0xf730('0x9d')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0xf730('0xc1')]=function(_0x4d818f){if(!_[_0xf730('0x4c')](_0x4d818f)&&_0x4d818f!==null){if(typeof _0x4d818f[_0xf730('0x7a')]!==_0xf730('0xa6')){if(_0x4d818f[_0xf730('0x7a')]>0x0){_0x4d818f[_0xf730('0x7a')]-=0x1;}else{logger[_0xf730('0x5f')](_0xf730('0x150'));}}}else{logger[_0xf730('0x5f')](_0xf730('0x151'));}};Dialer['prototype']['loggerHandler']=function(_0x2c793a,_0xee63ea){var _0x1787bc=this;return function(_0x4996b7){_0x1787bc[_0xf730('0xc1')](_0xee63ea);logger[_0xf730('0x5f')](_0x2c793a,util[_0xf730('0x61')](_0x4996b7,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xf730('0x152')]=function(_0x49063a,_0x3720bd,_0x251512){var _0x18141d={'state':0x19,'statedesc':_0xf730('0x153')};this[_0xf730('0xc1')](_0x3720bd);this[_0xf730('0x116')](_['merge'](_0x18141d,_[_0xf730('0xf7')](_0x251512,[_0xf730('0xde'),_0xf730('0x103'),_0xf730('0x154'),'VoiceQueueId',_0xf730('0xe0')])),_0xf730('0x155'),_0xf730('0x156'));logger[_0xf730('0x5f')](_0x49063a);};Dialer[_0xf730('0x15')][_0xf730('0x116')]=function(_0x1b91da,_0x569bd7,_0x1dc48c){hopperUtils['createHistory'](_0x1b91da)[_0xf730('0x9d')](loggerCatch(_0x569bd7));hopperUtils[_0xf730('0x12d')](_0x1b91da)[_0xf730('0x9d')](loggerCatch(_0x1dc48c));};Dialer['prototype'][_0xf730('0xd9')]=function(_0x1c4295,_0x2b5053){hopperUtils[_0xf730('0xc9')](_0x1c4295)['catch'](loggerCatch(_0xf730('0xca')));if(_0x2b5053==0x0){hopperUtils[_0xf730('0x12d')](_0x1c4295)[_0xf730('0x9d')](loggerCatch(_0xf730('0x157')));}};Dialer[_0xf730('0x15')][_0xf730('0x147')]=function(_0x10f1c3){return Promise[_0xf730('0x137')]()[_0xf730('0x9a')](cmHopper['handlePreviewRecallNotifications'](_0x10f1c3['id'],previewRecallmeReminderInterval))[_0xf730('0x9a')](function(_0x93299){for(var _0x50c819=0x0;_0x50c819<_0x93299[_0xf730('0x94')];_0x50c819++){var _0x421d1b=_0x93299[_0x50c819][_0xf730('0x144')]['name'];if(_0x421d1b)io['to'](util['format'](_0xf730('0x145'),_0x421d1b))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x93299[_0x50c819]});}})[_0xf730('0x9d')](function(){});};Dialer[_0xf730('0x15')][_0xf730('0xa9')]=function(_0x2fc18e){var _0x4f3b77=this;return function(){_0x4f3b77[_0xf730('0x158')](_0x2fc18e);};};Dialer[_0xf730('0x15')][_0xf730('0x159')]=function(_0x140ccd,_0xc959f6){var _0x3f07be=this;var _0x4d29d3=uuid['v4']();this[_0xf730('0x1f')][_0x4d29d3]=new Action(_0x140ccd,_0xc959f6,_0x4d29d3);return new Promise(function(_0x2de75b,_0x1ec2a5){if(_[_0xf730('0x4c')](_0x140ccd)&&typeof _0x140ccd!==_0xf730('0x15a')){return _0x1ec2a5(msgResponse(_0xf730('0x15b'),_0xf730('0x8e'),_0xf730('0x15c')));}if(_[_0xf730('0x4c')](_0xc959f6['phone'])||_0xc959f6['phone']===null){return _0x1ec2a5(msgResponse('originate',_0xf730('0x8e'),_0xf730('0x15d')));}var _0x597121={'XMD-CALLERID':_0x3f07be[_0xf730('0x1f')][_0x4d29d3]['getCaller'](),'XMD-AGI':_0x140ccd['dialQueueProject']?util['format'](_0xf730('0x15e'),ipAgi,_0x140ccd[_0xf730('0x12f')]):'NONE','XMD-AGIAFTER':_0x140ccd[_0xf730('0xc8')]?util[_0xf730('0x76')](_0xf730('0x15e'),ipAgi,_0x140ccd['dialQueueProject2']):'NONE','XMD-QUEUE':utils[_0xf730('0x15f')](_0x140ccd)?util[_0xf730('0x76')](_0xf730('0x160'),_0x140ccd['name'],_0x140ccd['dialQueueOptions']||'',_0x140ccd[_0xf730('0x161')]?'c':'',_0x140ccd['dialQueueTimeout']||0x3):_0xf730('0x162'),'XMD-CONTACTID':_0xc959f6[_0xf730('0xde')],'XMD-CDRTYPE':_0xf730('0x163'),'CALLERID(all)':_0x3f07be[_0xf730('0x1f')][_0x4d29d3][_0xf730('0x164')](),'XMD-AMD':_0x140ccd[_0xf730('0x10f')]?_0xf730('0x13a'):_0xf730('0x162'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x140ccd['dialAMDActive']){_0x597121[_0xf730('0x165')]=_0x140ccd['dialAMDInitialSilence']||0x9c4;_0x597121['XMD-AMDGREETING']=_0x140ccd['dialAMDGreeting']||0x5dc;_0x597121[_0xf730('0x166')]=_0x140ccd[_0xf730('0x167')]||0x320;_0x597121[_0xf730('0x168')]=_0x140ccd['dialAMDTotalAnalysisTime']||0x1388;_0x597121[_0xf730('0x169')]=_0x140ccd[_0xf730('0x16a')]||0x64;_0x597121['XMD-AMDBETWEENWORDSSILENCE']=_0x140ccd[_0xf730('0x16b')]||0x32;_0x597121[_0xf730('0x16c')]=_0x140ccd[_0xf730('0x16d')]||0x3;_0x597121[_0xf730('0x16e')]=_0x140ccd[_0xf730('0x16f')]||0x100;_0x597121['XMD-AMDMAXIMUMWORDLENGTH']=_0x140ccd['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xf730('0x15f')](_0x140ccd)){_0x597121[_0xf730('0x170')]=_0xc959f6['VoiceQueueId'];}else{_0x597121[_0xf730('0x171')]=_0xc959f6[_0xf730('0xe0')];}var _0x53f1da=utils[_0xf730('0x172')](_0xc959f6[_0xf730('0x173')]);Object['assign'](_0x597121,_0x53f1da);var _0x501edc=_0x3f07be['isTrunkReachable'](_0x140ccd['Trunk'])?utils['getCallerId'](_0x140ccd[_0xf730('0x86')][_0xf730('0x174')],_0x140ccd['dialOriginateCallerIdName'],_0x140ccd[_0xf730('0x175')]>0x0?utils['getCallerIdRandom'](_0x140ccd[_0xf730('0x176')],_0x140ccd[_0xf730('0x175')]):_0x140ccd[_0xf730('0x176')]):utils['getCallerId'](_[_0xf730('0xf3')](_0x140ccd[_0xf730('0x177')])?_0x140ccd[_0xf730('0x86')]['callerid']:_0x140ccd[_0xf730('0x177')][_0xf730('0x174')],_0x140ccd[_0xf730('0x178')],_0x140ccd[_0xf730('0x175')]>0x0?utils[_0xf730('0x179')](_0x140ccd[_0xf730('0x176')],_0x140ccd['dialRandomLastDigitCallerIdNumber']):_0x140ccd[_0xf730('0x176')]);if(_0x501edc){_0x597121['XMD-ORIGINATECALLERIDNAME']=_0x3f07be[_0xf730('0x1f')][_0x4d29d3]['originatecalleridname']=utils[_0xf730('0x17a')](_0x501edc);_0x597121['XMD-ORIGINATECALLERIDNUM']=_0xc959f6[_0xf730('0x17b')];}_0x140ccd[_0xf730('0x17c')]=_0x597121;return ami[_0xf730('0x96')]({'actionid':_0x4d29d3,'action':_0xf730('0x15b'),'channel':_0x3f07be[_0xf730('0x87')](_0x140ccd[_0xf730('0x86')])?util[_0xf730('0x76')](_0xf730('0x17d'),_0x140ccd[_0xf730('0x86')]['name'],isNotNull(_0x140ccd[_0xf730('0x17e')])?_0x140ccd['dialPrefix']['trim']()||'':'',_0x140ccd[_0xf730('0x17f')]>0x0?_0xc959f6['phone'][_0xf730('0x180')](_0x140ccd['dialCutDigit']):_0xc959f6[_0xf730('0x17b')]):util[_0xf730('0x76')](_0xf730('0x17d'),_[_0xf730('0xf3')](_0x140ccd['TrunkBackup'])?_0x140ccd[_0xf730('0x86')][_0xf730('0x3e')]:_0x140ccd[_0xf730('0x177')][_0xf730('0x3e')],isNotNull(_0x140ccd[_0xf730('0x17e')])?_0x140ccd[_0xf730('0x17e')][_0xf730('0x181')]()||'':'',_0x140ccd['dialCutDigit']>0x0?_0xc959f6[_0xf730('0x17b')][_0xf730('0x180')](_0x140ccd[_0xf730('0x17f')]):_0xc959f6['phone']),'callerid':_0x501edc,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x597121,'timeout':(_0x140ccd['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4d29d3})[_0xf730('0x9a')](function(_0x17f98a){return _0x2de75b(_0x17f98a);})['catch'](function(_0x3b94ba){_0x140ccd[_0xf730('0x182')]+=0x1;var _0x13f571=new History(_0x3f07be[_0xf730('0x1f')][_0x4d29d3]);logger[_0xf730('0x5f')](util[_0xf730('0x76')](_0xf730('0x183'),JSON[_0xf730('0x80')](_0x3b94ba)));_0x13f571[_0xf730('0x68')]=0xe;_0x13f571[_0xf730('0x69')]='OriginateError';_0x13f571['starttime']=moment()[_0xf730('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x13f571[_0xf730('0x6a')]=_0x13f571['starttime'];hopperUtils[_0xf730('0xc9')](_0x13f571)[_0xf730('0x9d')](loggerCatch(_0xf730('0x184')));_0x3f07be[_0xf730('0x12d')](_0x13f571)[_0xf730('0x9d')](loggerCatch('[originate][error]'))[_0xf730('0x17')](function(){delete _0x3f07be['actions'][_0x4d29d3];return _0x1ec2a5(msgResponse(_0xf730('0x15b'),_0xf730('0xbc'),'originate\x20action\x20Error'));});});});};Dialer[_0xf730('0x15')][_0xf730('0x185')]=function(_0x37031c,_0x5d191,_0x42e228){var _0x544f00=new History(_0x5d191);if(_0x544f00[_0xf730('0x11f')]+_0x544f00[_0xf730('0x186')]+_0x544f00[_0xf730('0x128')]+_0x544f00[_0xf730('0x120')]+_0x544f00['countdropretry']+_0x544f00[_0xf730('0xea')]+_0x544f00[_0xf730('0x11b')]+_0x544f00[_0xf730('0x121')]>=_0x42e228['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x37031c){case 0x3:if(_0x544f00[_0xf730('0x128')]>=_0x42e228[_0xf730('0x187')]-0x1){return!![];}hopperUtils[_0xf730('0xda')]({'active':![],'countnoanswerretry':_0x544f00[_0xf730('0x128')]+=0x1,'scheduledat':moment()[_0xf730('0xdb')](_0x42e228[_0xf730('0x188')],_0xf730('0xdd'))[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x544f00['ContactId'],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00[_0xf730('0xdf')]||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x544f00[_0xf730('0x11f')]>=_0x42e228[_0xf730('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x544f00[_0xf730('0x11f')]+=0x1,'scheduledat':moment()[_0xf730('0xdb')](_0x42e228[_0xf730('0x18a')],'minutes')[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x544f00[_0xf730('0xde')],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00['VoiceQueueId']||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x544f00[_0xf730('0x186')]>=_0x42e228[_0xf730('0x18b')]-0x1){return!![];}hopperUtils[_0xf730('0xda')]({'active':![],'countcongestionretry':_0x544f00[_0xf730('0x186')]+=0x1,'scheduledat':moment()[_0xf730('0xdb')](_0x42e228[_0xf730('0x18c')],_0xf730('0xdd'))[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x544f00[_0xf730('0xde')],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00['VoiceQueueId']||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x544f00[_0xf730('0x120')]>=_0x42e228[_0xf730('0x18d')]-0x1){return!![];}else{hopperUtils[_0xf730('0xda')]({'active':![],'countnosuchnumberretry':_0x544f00[_0xf730('0x120')]+=0x1,'scheduledat':moment()[_0xf730('0xdb')](_0x42e228['dialNoSuchNumberRetryFrequency'],'minutes')[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x544f00[_0xf730('0xde')],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00[_0xf730('0xdf')]||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0x18e')));}break;case 0xa:if(_0x544f00[_0xf730('0xd3')]>=_0x42e228['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xf730('0xda')]({'active':![],'countdropretry':_0x544f00[_0xf730('0xd3')]+=0x1,'scheduledat':moment()[_0xf730('0xdb')](_0x42e228['dialDropRetryFrequency'],_0xf730('0xdd'))[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x544f00['ContactId'],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00[_0xf730('0xdf')]||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0xe1')));break;case 0xb:if(_0x544f00[_0xf730('0xea')]>=_0x42e228[_0xf730('0xed')]-0x1){return!![];}hopperUtils[_0xf730('0xda')]({'active':![],'countabandonedretry':_0x544f00[_0xf730('0xea')]+=0x1,'scheduledat':moment()['add'](_0x42e228[_0xf730('0xeb')],_0xf730('0xdd'))[_0xf730('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x544f00[_0xf730('0xde')],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00[_0xf730('0xdf')]||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0xee')));break;case 0x13:if(_0x544f00[_0xf730('0x11b')]>=_0x42e228[_0xf730('0x124')]-0x1){return!![];}hopperUtils[_0xf730('0xda')]({'active':![],'countmachineretry':_0x544f00[_0xf730('0x11b')]+=0x1,'scheduledat':moment()[_0xf730('0xdb')](_0x42e228[_0xf730('0x18f')],'minutes')[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x544f00[_0xf730('0xde')],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00['VoiceQueueId']||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})['catch'](loggerCatch(_0xf730('0x126')));break;case 0x14:if(_0x544f00['countagentrejectretry']>=_0x42e228[_0xf730('0x190')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x544f00[_0xf730('0x121')]+=0x1,'scheduledat':moment()['add'](_0x42e228[_0xf730('0x191')],'minutes')[_0xf730('0x76')](_0xf730('0xc3')),'ContactId':_0x544f00[_0xf730('0xde')],'ListId':_0x544f00[_0xf730('0x103')],'VoiceQueueId':_0x544f00[_0xf730('0xdf')]||undefined,'CampaignId':_0x544f00[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0x192')));break;default:return!![];}};Dialer[_0xf730('0x15')][_0xf730('0x193')]=function(_0x209ade,_0x5b5880,_0xc821bf){var _0x7b1b=this;var _0x28d7ca=new History(_0x209ade);var _0x4c70b6=![];var _0x40b785;var _0x512a4;return new Promise(function(_0x584015,_0x412d61){if(_['isUndefined'](_0x5b5880)&&typeof _0x5b5880!=='object'){return _0x412d61(msgResponse('[callProgressDetecting]',_0xf730('0x8e'),_0xf730('0x194')));}if(_[_0xf730('0x4c')](_0xc821bf)&&typeof _0xc821bf!==_0xf730('0x15a')){return _0x412d61(msgResponse('[callProgressDetecting]',_0xf730('0x8e'),'evt\x20is\x20undefine'));}hopperUtils[_0xf730('0xec')](_0x28d7ca,_0xc821bf[_0xf730('0xc5')],_0x5b5880)['then'](function(_0x15076c){if(_0x15076c[_0xf730('0xd7')]==0x1)_0x4c70b6=!![];switch(_0xc821bf[_0xf730('0xc5')]){case'0':_0x5b5880['outboundNoSuchCallsDay']+=0x1;_0x28d7ca[_0xf730('0x68')]=0x0;_0x28d7ca[_0xf730('0x69')]=_0xf730('0x195');_0x28d7ca['countnosuchnumberretry']+=0x1;_0x28d7ca[_0xf730('0xd4')]+=0x1;ami[_0xf730('0x115')](_0xf730('0x196'),ut[_0xf730('0x11e')](_0x209ade,_0xf730('0x197')));_0x40b785=_0x5b5880[_0xf730('0x198')];_0x512a4=_0x5b5880[_0xf730('0xd5')];hopperUtils[_0xf730('0xc9')](_0x28d7ca)[_0xf730('0x9d')](loggerCatch(_0xf730('0x199')));if(_0x7b1b[_0xf730('0x185')](0x0,_0x209ade,_0x5b5880)&&!_0x4c70b6){if(_0x28d7ca[_0xf730('0x120')]>=_0x5b5880[_0xf730('0x18d')]){_0x7b1b['createStateFinal'](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x19a'));}else{_0x7b1b[_0xf730('0x129')](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x19a'));}}break;case'3':_0x5b5880[_0xf730('0x19b')]+=0x1;_0x28d7ca[_0xf730('0x68')]=0x3;_0x28d7ca[_0xf730('0x69')]='NoAnswer';_0x28d7ca[_0xf730('0x128')]+=0x1;_0x28d7ca[_0xf730('0xd4')]+=0x1;var _0x390ee4=ut[_0xf730('0x19c')](_0x209ade,_0x5b5880);ami[_0xf730('0x115')](_0xf730('0x19d'),_0x390ee4);_0x40b785=_0x5b5880[_0xf730('0x188')];_0x512a4=_0x5b5880[_0xf730('0xd5')];hopperUtils[_0xf730('0xc9')](_0x28d7ca)['catch'](loggerCatch(_0xf730('0x19e')));if(_0x7b1b[_0xf730('0x185')](0x3,_0x209ade,_0x5b5880)&&!_0x4c70b6){if(_0x28d7ca['countnoanswerretry']>=_0x5b5880[_0xf730('0x187')]){_0x7b1b[_0xf730('0x19f')](_0x28d7ca,_0x584015,_0x412d61,'reason\x203\x20ringing\x20no\x20answer');}else{_0x7b1b[_0xf730('0x129')](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x1a0'));}}break;case'5':_0x5b5880['outboundBusyCallsDay']+=0x1;_0x28d7ca[_0xf730('0x68')]=0x5;_0x28d7ca['statedesc']=_0xf730('0x1a1');_0x28d7ca['countbusyretry']+=0x1;_0x28d7ca[_0xf730('0xd4')]+=0x1;ami[_0xf730('0x115')](_0xf730('0x1a2'),ut[_0xf730('0x11e')](_0x209ade,_0xf730('0x1a3')));_0x40b785=_0x5b5880[_0xf730('0x18a')];_0x512a4=_0x5b5880[_0xf730('0xd5')];hopperUtils[_0xf730('0xc9')](_0x28d7ca)['catch'](loggerCatch(_0xf730('0x1a4')));if(_0x7b1b[_0xf730('0x185')](0x5,_0x209ade,_0x5b5880)&&!_0x4c70b6){if(_0x28d7ca[_0xf730('0x11f')]>=_0x5b5880['dialBusyMaxRetry']){_0x7b1b[_0xf730('0x19f')](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x1a5'));}else{_0x7b1b[_0xf730('0x129')](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x1a5'));}}break;case'8':_0x5b5880[_0xf730('0x1a6')]+=0x1;_0x28d7ca[_0xf730('0x68')]=0x8;_0x28d7ca[_0xf730('0x69')]='Congestion';_0x28d7ca[_0xf730('0x186')]+=0x1;_0x28d7ca[_0xf730('0xd4')]+=0x1;_0x40b785=_0x5b5880[_0xf730('0x18c')];_0x512a4=_0x5b5880[_0xf730('0xd5')];ami['emit'](_0xf730('0x1a7'),ut[_0xf730('0x11e')](_0x209ade,'congestion'));hopperUtils[_0xf730('0xc9')](_0x28d7ca)[_0xf730('0x9d')](loggerCatch(_0xf730('0x1a8')));if(_0x7b1b[_0xf730('0x185')](0x8,_0x209ade,_0x5b5880)&&!_0x4c70b6){if(_0x28d7ca[_0xf730('0x186')]>=_0x5b5880[_0xf730('0x18b')]){_0x7b1b[_0xf730('0x19f')](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x1a9'));}else{_0x7b1b['stateGlobal'](_0x28d7ca,_0x584015,_0x412d61,'reason\x208\x20congestion');}}break;case'11':_0x5b5880['outboundAbandonedCallsDay']+=0x1;_0x28d7ca['state']=0xb;_0x28d7ca[_0xf730('0x69')]='Abandoned';_0x28d7ca['countabandonedretry']+=0x1;_0x28d7ca[_0xf730('0xd4')]+=0x1;_0x40b785=_0x5b5880[_0xf730('0xeb')];_0x512a4=_0x5b5880[_0xf730('0xd5')];hopperUtils[_0xf730('0xc9')](_0x28d7ca)[_0xf730('0x9d')](loggerCatch(_0xf730('0x1aa')));if(_0x7b1b[_0xf730('0x185')](0xb,_0x209ade,_0x5b5880)&&!_0x4c70b6){if(_0x28d7ca['countabandonedretry']>=_0x5b5880[_0xf730('0xed')]){_0x7b1b[_0xf730('0x19f')](_0x28d7ca,_0x584015,_0x412d61,'reason\x2011\x20abandoned');}else{_0x7b1b[_0xf730('0x129')](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x1ab'));}}break;case'20':_0x5b5880[_0xf730('0x1ac')]+=0x1;_0x28d7ca[_0xf730('0x68')]=0x14;_0x28d7ca[_0xf730('0x69')]=_0xf730('0x1ad');_0x28d7ca['countagentrejectretry']+=0x1;_0x28d7ca['countglobal']+=0x1;_0x40b785=_0x5b5880['dialAgentRejectRetryFrequency'];_0x512a4=_0x5b5880[_0xf730('0xd5')];ami['emit'](_0xf730('0x1ae'),ut['buildObj'](_0x209ade,_0xf730('0x1af')));hopperUtils[_0xf730('0xc9')](_0x28d7ca)[_0xf730('0x9d')](loggerCatch(_0xf730('0x1b0')));if(_0x7b1b[_0xf730('0x185')](0x14,_0x209ade,_0x5b5880)&&!_0x4c70b6){if(_0x28d7ca[_0xf730('0x121')]>=_0x5b5880[_0xf730('0x190')]){_0x7b1b['createStateFinal'](_0x28d7ca,_0x584015,_0x412d61,_0xf730('0x1b1'));}else{_0x7b1b[_0xf730('0x129')](_0x28d7ca,_0x584015,_0x412d61,'reason\x2020\x20agentreject');}}break;default:_0x5b5880[_0xf730('0x1b2')]+=0x1;_0x28d7ca[_0xf730('0x68')]=0xc;_0x28d7ca[_0xf730('0x69')]=_0xc821bf['reason'];_0x40b785=_0x5b5880[_0xf730('0x191')];_0x512a4=_0x5b5880[_0xf730('0xd5')];hopperUtils['createHistory'](_0x28d7ca)['catch'](loggerCatch(_0xf730('0x1b3')));if(_0x7b1b[_0xf730('0x185')](_0xc821bf['reason'],_0x209ade,_0x5b5880)&&!_0x4c70b6){if(_0x28d7ca['countbusyretry']+_0x28d7ca[_0xf730('0x186')]+_0x28d7ca[_0xf730('0x128')]+_0x28d7ca['countnosuchnumberretry']+_0x28d7ca[_0xf730('0xd3')]+_0x28d7ca[_0xf730('0xea')]+_0x28d7ca['countmachineretry']+_0x28d7ca[_0xf730('0x121')]>=_0x5b5880[_0xf730('0x122')]){_0x7b1b[_0xf730('0x129')](_0x28d7ca,_0x584015,_0x412d61,_0xc821bf['reason']);}else{_0x7b1b[_0xf730('0x19f')](_0x28d7ca,_0x584015,_0x412d61,_0xc821bf[_0xf730('0xc5')]);}}}})['then'](function(){if(_0x4c70b6){hopperUtils[_0xf730('0xe6')](_0x28d7ca,_0x40b785,_0x512a4)[_0xf730('0x9a')](function(){return _0x584015(0x1);});}});});};Dialer['prototype'][_0xf730('0x129')]=function(_0x3b8e71,_0x1d8b6d,_0x2269da,_0xa4b3f6){var _0x2e9fa5=new Final(_0x3b8e71);_0x2e9fa5[_0xf730('0x68')]=0xf;_0x2e9fa5[_0xf730('0x69')]=_0xf730('0x1b4');this[_0xf730('0x19f')](_0x2e9fa5,_0x1d8b6d,_0x2269da,_0xa4b3f6);};Dialer[_0xf730('0x15')][_0xf730('0x19f')]=function(_0x2e782e,_0x287a13,_0x2065bf,_0x26feb7){hopperUtils[_0xf730('0x12d')](_0x2e782e)[_0xf730('0x9a')](function(){return _0x287a13(msgResponse(_0xf730('0x1b5'),'Success',_0x26feb7));})['catch'](function(){return _0x2065bf(msgResponse(_0xf730('0x1b6'),'Failure','contact\x20not\x20moved'));});};Dialer[_0xf730('0x15')][_0xf730('0x8')]=function(_0x3867b3){var _0x24a747=_0x3867b3[_0xf730('0x1b7')]/0x64;var _0x3243af=_0x3867b3[_0xf730('0xd1')]/(_0x3867b3[_0xf730('0xd1')]+_0x3867b3[_0xf730('0xc4')]);var _0x20c5fd=Math[_0xf730('0x1b8')](_0x3867b3[_0xf730('0x1b9')]*(_0x3867b3[_0xf730('0x1ba')]/0x64));var _0x373707=Math[_0xf730('0x1b8')](_0x3867b3[_0xf730('0x1b9')]*(_0x3867b3['predictiveIntervalMinThreshold']/0x64));var _0x452a3f=_0x3867b3[_0xf730('0x1bb')]+_0x3867b3[_0xf730('0x139')];var _0x483605=Math[_0xf730('0x1bc')](_0x3867b3[_0xf730('0x52')]*_0x3867b3[_0xf730('0x57')]*_0x3867b3['predictiveIntervalHitRate']*_0x3867b3[_0xf730('0x1bd')]);if(_[_0xf730('0x4c')](_0x3867b3['startProgressive'])){if(!_[_0xf730('0x4c')](_0x3867b3[_0xf730('0x5a')])){_0x3867b3[_0xf730('0x5a')]=undefined;loggerPredictive[_0xf730('0x5f')]('[startMethodPredictive][StartProgressive]',_0xf730('0x1be'));}if(!_[_0xf730('0x4c')](_0x3867b3[_0xf730('0x5d')])){loggerPredictive['error'](_0xf730('0x1bf'),_0xf730('0x1c0'));clearInterval(_0x3867b3[_0xf730('0x5d')]);_0x3867b3[_0xf730('0x5d')]=undefined;}_0x3867b3[_0xf730('0x22')]=moment()[_0xf730('0x76')](_0xf730('0xc3'));loggerPredictive['info'](_0x3867b3['name'],'collection\x20data\x20in\x20progressive\x20at',_0x3867b3[_0xf730('0x22')]);this[_0xf730('0xaf')](_0x3867b3,0x1);}else if(ifInterval(_0x3867b3[_0xf730('0x1c1')],_0x3867b3[_0xf730('0x22')])){this[_0xf730('0xaf')](_0x3867b3,0x1);loggerPredictiveCalls[_0xf730('0x40')]('[startMethodPredictive][StartProgressive][Loop]',_0x3867b3[_0xf730('0x22')],_0x3867b3[_0xf730('0x3e')]);_0x3867b3[_0xf730('0x52')]=0x0;_0x3867b3[_0xf730('0x1c2')]=0x0;}else if(_0x24a747<_0x3243af&&_0x3867b3[_0xf730('0x1c3')]===_0xf730('0x1c4')){clearPredictiveAttributes(_0x3867b3);loggerPredictive[_0xf730('0x40')](_0xf730('0x1c5'),'Dropped\x20calls\x20day',_0x3243af,_0xf730('0x22'),_0x3867b3['name']);}else if(_0x483605<_0x3867b3[_0xf730('0x1c2')]&&_0x3867b3['dialPredictiveOptimization']===_0xf730('0x1c4')){clearPredictiveAttributes(_0x3867b3);loggerPredictive[_0xf730('0x40')](_0xf730('0x1c6'),_0xf730('0x1c7'),_0x483605,_0xf730('0x1c8'),_0x3867b3[_0xf730('0x1c2')],_0xf730('0x22'),_0x3867b3['name']);}else if(!ifInterval(_0x3867b3['dialPredictiveInterval'],_0x3867b3[_0xf730('0x22')])&&_[_0xf730('0x4c')](_0x3867b3['startPredictive'])&&!_[_0xf730('0x4c')](_0x3867b3['startProgressive'])){_0x3867b3[_0xf730('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf730('0x40')](_0x3867b3[_0xf730('0x3e')],_0xf730('0x1c9'),_0x3867b3['startPredictive']);hopperUtils['avgHandleTime'](_0x3867b3[_0xf730('0x1c1')])[_0xf730('0x9a')](this[_0xf730('0x1ca')](_0x3867b3))[_0xf730('0x9a')](mergeDataErlangB(_0x3867b3))[_0xf730('0x9a')](this[_0xf730('0x1cb')](_0x3867b3))[_0xf730('0x9d')](loggerCatchPredictive(_0xf730('0x1cc'),_0x3867b3));}else if(!ifInterval(_0x3867b3['dialPredictiveInterval'],_0x3867b3[_0xf730('0x5a')])){_0x3867b3['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3867b3['startPredictive']=moment()[_0xf730('0x76')](_0xf730('0xc3'));loggerPredictive[_0xf730('0x40')](_0x3867b3[_0xf730('0x3e')],'recalculate\x20predictive\x20at',_0x3867b3[_0xf730('0x5a')]);clearInterval(_0x3867b3['handlePredictive']);_0x3867b3[_0xf730('0x5d')]=undefined;hopperUtils['avgHandleTime'](_0x3867b3['dialPredictiveInterval'])[_0xf730('0x9a')](this['getDataPredictive'](_0x3867b3))[_0xf730('0x9a')](mergeDataErlangB(_0x3867b3))[_0xf730('0x9a')](this[_0xf730('0x1cb')](_0x3867b3))[_0xf730('0x9d')](loggerCatchPredictive(_0xf730('0x1cd'),_0x3867b3));}else if(_0x3867b3[_0xf730('0x1b9')]&&_0x452a3f<_0x3867b3[_0xf730('0x1b9')]-_0x373707){clearPredictiveAttributes(_0x3867b3);loggerPredictive[_0xf730('0x40')](_0x3867b3[_0xf730('0x3e')],_0xf730('0x1ce'),_0x452a3f,_0xf730('0x1cf'),_0x3867b3['predictiveIntervalAvailable'],'-',_0x373707,'=',_0x3867b3['predictiveIntervalAvailable']-_0x373707,')');}else if(_0x3867b3[_0xf730('0x1b9')]&&_0x452a3f>_0x3867b3[_0xf730('0x1b9')]+_0x20c5fd){clearPredictiveAttributes(_0x3867b3);loggerPredictive[_0xf730('0x40')](_0x3867b3[_0xf730('0x3e')],_0xf730('0x1ce'),_0x452a3f,_0xf730('0x1d0'),_0x3867b3[_0xf730('0x1b9')],'+',_0x20c5fd,'=',_0x3867b3['predictiveIntervalAvailable']+_0x20c5fd,')');}};Dialer[_0xf730('0x15')]['getDataPredictive']=function(_0x1c5333){var _0x3f35d1=this;return function(_0x859482){return new Promise(function(_0x406028,_0x5fd56a){_[_0xf730('0xf6')](_0x1c5333,_0x859482[0x0]);if(checkGetDataPredictive(_0x859482[0x0])){var _0x3a7a9b=_0x1c5333['predictiveIntervalAvailable']=_0x1c5333[_0xf730('0x139')]+_0x1c5333[_0xf730('0x1bb')];var _0x1dcc64=_0x1c5333['dialPredictiveInterval']*0x3c;var _0x22e4b5=_0x859482[0x0][_0xf730('0x4a')]+_0x859482[0x0][_0xf730('0x48')];var _0x4b0462=(_0x859482[0x0]['predictiveIntervalAnsweredCalls']+_0x859482[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x859482[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x859482[0x0][_0xf730('0x43')];_0x1c5333[_0xf730('0x1d1')]=_0x4b0462>0x0?_0x4b0462:0x1;switch(_0x1c5333[_0xf730('0x1c3')]){case'dropRate':var _0xa25149=_0x1c5333[_0xf730('0x1b7')]/0x64;return _0x3f35d1[_0xf730('0x1d2')](_0x3a7a9b,_0x1dcc64,_0x22e4b5,_0x4b0462,_0xa25149)[_0xf730('0x9a')](function(_0x252edc){return _0x406028(_0x252edc);});case _0xf730('0x1d3'):var _0x53c889=_0x1c5333[_0xf730('0x1b7')]/0x64;return _0x3f35d1[_0xf730('0x1d4')](_0x3a7a9b,_0x1dcc64,_0x22e4b5,_0x4b0462,_0x53c889)['then'](function(_0x32ba1b){return _0x406028(_0x32ba1b);});default:return _0x5fd56a(msgResponse(_0xf730('0x1d5'),_0xf730('0x8e'),'Unknown\x20Predictive'));}}else{return _0x5fd56a(msgResponse(_0xf730('0x1d5'),'Failure',_0xf730('0x1d6')));}});};};Dialer[_0xf730('0x15')]['getDataPredictiveOld']=function(_0x4d6d18){var _0x483079=this;return function(_0x4c23f3){return new Promise(function(_0xc7eb18,_0xfe62dc){_[_0xf730('0xf6')](_0x4d6d18,_0x4c23f3[0x0]);if(checkGetDataPredictive(_0x4c23f3[0x0])){loggerPredictive[_0xf730('0x40')](JSON[_0xf730('0x80')](_0x4c23f3[0x0]));if(_0x4d6d18[_0xf730('0x1c3')]==='dropRate'){return _0x483079['getVoiceQueueRtPauses'](_0x4d6d18['id'])[_0xf730('0x9a')](function(_0x176fc6){var _0x56be94=_0x4d6d18[_0xf730('0x1d7')]-_0x176fc6[0x0][_0xf730('0x1d8')];var _0x44b878=_0x4d6d18[_0xf730('0x1c1')]*0x3c;var _0x2d1302=_0x4c23f3[0x0][_0xf730('0x4a')]+_0x4c23f3[0x0]['predictiveIntervalAvgHoldtime'];var _0x390d0c=(_0x4c23f3[0x0][_0xf730('0x44')]+_0x4c23f3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4c23f3[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4c23f3[0x0]['predictiveIntervalTotalCalls'];var _0x2a732c=_0x4d6d18[_0xf730('0x1b7')]/0x64;_0x4d6d18[_0xf730('0x1d9')]=_0x176fc6[0x0][_0xf730('0x1d8')]||0x0;_0x4d6d18[_0xf730('0x1d1')]=_0x390d0c>0x0?_0x390d0c:0x1;return _0x483079[_0xf730('0x1d2')](_0x56be94,_0x44b878,_0x2d1302,_0x390d0c,_0x2a732c);})[_0xf730('0x9a')](function(_0x5cdbb1){return _0xc7eb18(_0x5cdbb1);})['catch'](function(_0x1262b6){return _0xfe62dc(msgResponse(_0xf730('0x1da'),_0xf730('0x8e'),JSON[_0xf730('0x80')](_0x1262b6)));});}if(_0x4d6d18[_0xf730('0x1c3')]==='agentBusyFactor'){return _0x483079[_0xf730('0x14f')](_0x4d6d18['id'])['then'](function(_0x31c640){var _0x46df32=_0x4d6d18[_0xf730('0x1d7')]-_0x31c640[0x0][_0xf730('0x1d8')];var _0x299d14=_0x4d6d18[_0xf730('0x1c1')]*0x3c;var _0x56b718=_0x4c23f3[0x0][_0xf730('0x4a')]+_0x4c23f3[0x0][_0xf730('0x48')];var _0x260304=(_0x4c23f3[0x0][_0xf730('0x44')]+_0x4c23f3[0x0][_0xf730('0xd0')]+_0x4c23f3[0x0][_0xf730('0x47')])/_0x4c23f3[0x0][_0xf730('0x43')];var _0x5c023f=_0x4d6d18[_0xf730('0x1b7')]/0x64;_0x4d6d18[_0xf730('0x1d9')]=_0x31c640[0x0][_0xf730('0x1d8')]||0x0;_0x4d6d18[_0xf730('0x1d1')]=_0x260304>0x0?_0x260304:0x1;return _0x483079[_0xf730('0x1d4')](_0x46df32,_0x299d14,_0x56b718,_0x260304,_0x5c023f);})[_0xf730('0x9a')](function(_0x1a1b11){return _0xc7eb18(_0x1a1b11);})[_0xf730('0x9d')](function(_0x44e39c){return _0xfe62dc(msgResponse(_0xf730('0x1da'),_0xf730('0x8e'),JSON[_0xf730('0x80')](_0x44e39c)));});}}else{return _0xfe62dc(msgResponse(_0xf730('0x1d5'),_0xf730('0x8e'),_0xf730('0x1d6')));}});};};Dialer[_0xf730('0x15')]['startMethodPredictive']=function(_0x586626){var _0x4d4ffc=this;return function(){var _0x581446=0x0;var _0x4525fc=Math[_0xf730('0x1bc')](_0x586626[_0xf730('0x54')]*0x3e8);if(_0x4525fc>0x0){_0x4525fc=_0x4525fc<0x64?0x64:_0x4525fc;loggerPredictive[_0xf730('0x40')](_0x586626[_0xf730('0x3e')],_0xf730('0x1db'),_0x4525fc,_0xf730('0x1dc'));_0x586626[_0xf730('0x5d')]=setInterval(function(){_0x4d4ffc['handlePredictive'](_0x586626);loggerPredictiveCalls[_0xf730('0x40')](_0xf730('0x1dd'),_0x581446+=0x1);},_0x4525fc);}else{loggerPredictive[_0xf730('0x40')](_0x586626['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xf730('0x15')]['checkContactBlack']=function(_0x3f06c3,_0x4dc000){var _0x2178fe=this;return function(_0x104400){if(_[_0xf730('0x73')](_0x104400)){if(_[_0xf730('0xf3')](_0x4dc000['UserId'])||!_0x4dc000[_0xf730('0x1de')]){if(_0x3f06c3['dialMethod']===_0xf730('0x1df')){_0x3f06c3[_0xf730('0x6c')]=_[_0xf730('0x4c')](_0x3f06c3[_0xf730('0x6c')])?!![]:_0x3f06c3[_0xf730('0x6c')];var _0x4f3c00=uuid['v4']();_0x2178fe[_0xf730('0x1f')][_0x4f3c00]=new Action(_0x3f06c3,_0x4dc000,_0x4f3c00);loggerBooked[_0xf730('0x40')]('[booked][checkContactBlack]',_0x4f3c00,'queueStatusComplete:\x20',JSON['stringify'](_0x3f06c3[_0xf730('0x6c')]),'Queue:\x20',_0x3f06c3[_0xf730('0x3e')]);if(_0x3f06c3[_0xf730('0x6c')]){_0x3f06c3[_0xf730('0x6c')]=![];_0x2178fe[_0xf730('0x24')][_0x2178fe[_0xf730('0x1f')][_0x4f3c00]['queue']]=[];ami[_0xf730('0x96')]({'actionid':_0x4f3c00,'action':_0xf730('0x1e0'),'queue':_0x3f06c3[_0xf730('0x3e')]})[_0xf730('0x9d')](function(){_0x2178fe['updateOriginated'](_0x3f06c3);hopperUtils[_0xf730('0xda')]({'active':![],'ContactId':_0x2178fe[_0xf730('0x1f')][_0x4f3c00][_0xf730('0xde')],'ListId':_0x2178fe[_0xf730('0x1f')][_0x4f3c00][_0xf730('0x103')],'VoiceQueueId':_0x2178fe[_0xf730('0x1f')][_0x4f3c00][_0xf730('0xdf')]||undefined,'CampaignId':_0x2178fe[_0xf730('0x1f')][_0x4f3c00][_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0x1e1')));delete _0x2178fe[_0xf730('0x1f')][_0x4f3c00];});}else{loggerBooked[_0xf730('0x40')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x3f06c3[_0xf730('0x6c')]),_0xf730('0x1e2'),_0x3f06c3[_0xf730('0x3e')]);_0x2178fe['updateOriginated'](_0x3f06c3);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x2178fe[_0xf730('0x1f')][_0x4f3c00][_0xf730('0xde')],'ListId':_0x2178fe['actions'][_0x4f3c00][_0xf730('0x103')],'VoiceQueueId':_0x2178fe[_0xf730('0x1f')][_0x4f3c00][_0xf730('0xdf')]||undefined,'CampaignId':_0x2178fe[_0xf730('0x1f')][_0x4f3c00][_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2178fe[_0xf730('0x1f')][_0x4f3c00];}}else{return _0x2178fe[_0xf730('0x159')](_0x3f06c3,_0x4dc000);}}else{if(utils['getSeconds'](undefined,_0x4dc000[_0xf730('0x1e3')])<_0x3f06c3[_0xf730('0x1e4')]*0x3c){if(_0x4dc000[_0xf730('0x144')]&&!_0x4dc000[_0xf730('0x144')]['voicePause']){_0x2178fe[_0xf730('0x19')][_0xf730('0xfb')](_0x4dc000['id'])[_0xf730('0x17')](function(){_0x2178fe['updateOriginated'](_0x3f06c3);});}else{hopperUtils[_0xf730('0x1e5')]({'active':![]},_0x4dc000['id'],0x1)[_0xf730('0x17')](function(){_0x2178fe[_0xf730('0xc1')](_0x3f06c3);});}}else{_0x3f06c3[_0xf730('0x1e6')]+=0x1;_0x2178fe[_0xf730('0xc1')](_0x3f06c3);if(_0x3f06c3[_0xf730('0x1e7')]){hopperUtils[_0xf730('0xda')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4dc000[_0xf730('0xde')],'ListId':_0x4dc000[_0xf730('0x103')],'VoiceQueueId':_0x4dc000[_0xf730('0xdf')]||undefined,'CampaignId':_0x4dc000[_0xf730('0xe0')]||undefined})[_0xf730('0x9d')](loggerCatch(_0xf730('0x1e8')));hopperUtils[_0xf730('0xc9')](createObjHistory(_0x3f06c3,_0x4dc000,utils['CAMPAIGN_STATUS'][_0xf730('0x1e9')],0x17,_0xf730('0x1ea')))[_0xf730('0x9d')](loggerCatch(_0xf730('0x1eb')));}else{_0x2178fe['saveInDb'](createObjHistory(_0x3f06c3,_0x4dc000,utils['CAMPAIGN_STATUS'][_0xf730('0x1ec')],0x16,'RecallFailedTimeout'),_0xf730('0x1ed'),_0xf730('0x1ee'));}}}}else{_0x3f06c3[_0xf730('0x1ef')]+=0x1;_0x2178fe[_0xf730('0x116')](createObjHistory(_0x3f06c3,_0x4dc000,utils[_0xf730('0x71')][_0xf730('0x1f0')],0xd,_0xf730('0x1f1')),_0xf730('0x1f2'),'[Originate][MoveBlacklist]');throw _0xf730('0x1f3');}};};Dialer[_0xf730('0x15')][_0xf730('0x158')]=function(_0x489769){var _0x13bc51=this;var _0x4b7172=_0x489769['limitCalls']-_0x489769[_0xf730('0x7a')];emitCampaignSummary(_0x489769);if(_0x4b7172>0x0&&_0x489769[_0xf730('0x1f4')]==0x0){if(_0x4b7172>this[_0xf730('0x1e')]){_0x4b7172=this['maxNumberOriginate'];}_0x489769['temp']=0x1;hopperUtils[_0xf730('0x1f5')](_0x489769,_0x4b7172)[_0xf730('0x9a')](function(_0x246dbf){_0x489769['temp']=0x0;if(_0x246dbf){if(!utils[_0xf730('0x1f6')](_0x246dbf)){_0x489769[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x67')];logger['info'](_0xf730('0x1f7')+_0x489769[_0xf730('0x3e')]);}else{_0x489769[_0xf730('0x7a')]+=_0x246dbf['length'];_0x489769[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x1f8')];for(var _0x5f0fad=0x0;_0x5f0fad<_0x246dbf[_0xf730('0x94')];_0x5f0fad+=0x1){_0x489769[_0xf730('0x1f9')]+=0x1;if(_[_0xf730('0xf3')](_0x246dbf[_0x5f0fad])||_[_0xf730('0xf3')](_0x246dbf[_0x5f0fad][_0xf730('0x173')])||_[_0xf730('0xf3')](_0x246dbf[_0x5f0fad]['phone'])){_0x13bc51['emptyContact']('[actionOriginate]\x20',_0x489769,_0x246dbf[_0x5f0fad]);}else{hopperUtils[_0xf730('0x1fa')](_['pick'](_0x246dbf[_0x5f0fad],['CampaignId',_0xf730('0x17b')]))[_0xf730('0x9a')](_0x13bc51[_0xf730('0x1fb')](_0x489769,_0x246dbf[_0x5f0fad]))[_0xf730('0x9d')](_0x13bc51[_0xf730('0x1fc')](_0xf730('0x1fd'),_0x489769));}}}}})[_0xf730('0x9d')](loggerGetContactDialer(_0xf730('0x1fe'),_0x489769,_0x4b7172));}};Dialer[_0xf730('0x15')][_0xf730('0xaf')]=function(_0x488e72,_0x3abb21){var _0x32c1fb=this;var _0x30ebe4=[];if(_0x3abb21<0x1||_0x488e72[_0xf730('0xac')]===_0xf730('0x1df')){_0x3abb21=0x1;}var _0x74a98c=Math[_0xf730('0x1bc')](_0x488e72[_0xf730('0x1bb')]*_0x3abb21)-_0x488e72[_0xf730('0x7a')];if(_0x488e72[_0xf730('0x1ff')]>0x0){var _0xdaa6a5=_0x488e72[_0xf730('0x1ff')]-_0x488e72['originated']-_0x488e72[_0xf730('0x139')]-_0x488e72[_0xf730('0x200')];if(_0x74a98c>_0xdaa6a5){_0x74a98c=_0xdaa6a5;}}if(_0x74a98c>0x0&&_0x488e72[_0xf730('0x1f4')]==0x0){if(_0x488e72['dialMethod']==='booked'){_0x74a98c=0x1;}if(_0x74a98c>this[_0xf730('0x1e')]){_0x74a98c=this[_0xf730('0x1e')];}for(var _0x49c754 in this['agents']){if(typeof this[_0xf730('0x1c')][_0x49c754]!==_0xf730('0xa6')){if(this[_0xf730('0x1c')][_0x49c754][_0xf730('0x68')]===_0xf730('0x201')&&this[_0xf730('0x1c')][_0x49c754][_0xf730('0x82')]===_0xf730('0x83')){_0x30ebe4[_0xf730('0x95')](this[_0xf730('0x1c')][_0x49c754]['id']);}}}_0x488e72[_0xf730('0x1f4')]=0x1;hopperUtils['getContactDialer'](_0x488e72,_0x30ebe4,_0x74a98c)[_0xf730('0x9a')](function(_0x56482e){_0x488e72[_0xf730('0x1f4')]=0x0;if(_0x56482e){if(!utils[_0xf730('0x1f6')](_0x56482e)){hopperUtils[_0xf730('0x202')](_0x488e72)[_0xf730('0x9a')](sendMessageReschedule(_0x488e72))['catch'](loggerCatch(_0xf730('0x203')));}else{_0x488e72[_0xf730('0x7a')]+=_0x56482e['length'];_0x488e72[_0xf730('0x63')]=_0x488e72[_0xf730('0xac')]===_0xf730('0x1df')?utils[_0xf730('0x71')][_0xf730('0x13a')]:utils[_0xf730('0x71')][_0xf730('0x1f8')];for(var _0x4d616b=0x0;_0x4d616b<_0x56482e['length'];_0x4d616b+=0x1){if(_[_0xf730('0xf3')](_0x56482e[_0x4d616b])||_[_0xf730('0xf3')](_0x56482e[_0x4d616b][_0xf730('0x173')])||_[_0xf730('0xf3')](_0x56482e[_0x4d616b][_0xf730('0x17b')])){_0x32c1fb[_0xf730('0x152')]('[actionOriginate]\x20',_0x488e72,_0x56482e[_0x4d616b]);}else{hopperUtils[_0xf730('0x204')](_[_0xf730('0xf7')](_0x56482e[_0x4d616b],[_0xf730('0xdf'),_0xf730('0x17b')]))[_0xf730('0x9a')](_0x32c1fb[_0xf730('0x1fb')](_0x488e72,_0x56482e[_0x4d616b]))[_0xf730('0x9d')](_0x32c1fb[_0xf730('0x1fc')](_0xf730('0x205'),_0x488e72));}}}}})[_0xf730('0x9d')](loggerGetContactDialer(_0xf730('0x206'),_0x488e72,_0x74a98c));}};Dialer[_0xf730('0x15')][_0xf730('0x5d')]=function(_0x4d7c3c){if(_0x4d7c3c[_0xf730('0x1ff')]>0x0){var _0x5e00dc=_0x4d7c3c['dialLimitQueue']-_0x4d7c3c[_0xf730('0x7a')]-_0x4d7c3c[_0xf730('0x139')];if(_0x5e00dc>0x0&&_0x4d7c3c[_0xf730('0x1f4')]==0x0){this[_0xf730('0x207')](_0x4d7c3c);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0xf730('0x207')](_0x4d7c3c);}};Dialer[_0xf730('0x15')][_0xf730('0x207')]=function(_0x5c5e05){var _0x3d37b8=this;var _0x3e9f88=[];_0x5c5e05[_0xf730('0x7a')]+=0x1;for(var _0x3fca95 in this[_0xf730('0x1c')]){if(typeof this[_0xf730('0x1c')][_0x3fca95]!==_0xf730('0xa6')){if(this[_0xf730('0x1c')][_0x3fca95]['state']==='not_inuse'&&this[_0xf730('0x1c')][_0x3fca95][_0xf730('0x82')]===_0xf730('0x83')){_0x3e9f88[_0xf730('0x95')](this[_0xf730('0x1c')][_0x3fca95]['id']);}}}_0x5c5e05[_0xf730('0x1f4')]=0x1;return this[_0xf730('0x208')](_0x5c5e05['id'],_0x3e9f88,0x1,_0x5c5e05['dialOrderByScheduledAt'],_0x5c5e05)['then'](function(_0x4f2108){_0x5c5e05[_0xf730('0x1f4')]=0x1;if(_0x4f2108){if(!utils[_0xf730('0x1f6')](_0x4f2108)){utils[_0xf730('0x209')](_0x5c5e05,0x1,0x0);return hopperUtils['countReScheduled'](_0x5c5e05)[_0xf730('0x9a')](sendMessageReschedule(_0x5c5e05))[_0xf730('0x9d')](loggerCatch(_0xf730('0x203')));}else{_0x5c5e05[_0xf730('0x63')]=utils[_0xf730('0x71')][_0xf730('0x1f8')];if(_['isNil'](_0x4f2108[0x0])||_[_0xf730('0xf3')](_0x4f2108[0x0][_0xf730('0x173')])||_['isNil'](_0x4f2108[0x0][_0xf730('0x17b')])){_0x3d37b8[_0xf730('0x152')](_0xf730('0x205'),_0x5c5e05,_0x4f2108[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x4f2108[0x0],[_0xf730('0xdf'),_0xf730('0x17b')]))[_0xf730('0x9a')](_0x3d37b8['checkContactBlack'](_0x5c5e05,_0x4f2108[0x0]))[_0xf730('0x9d')](_0x3d37b8[_0xf730('0x1fc')]('[actionOriginatePredictive]\x20',_0x5c5e05));}}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x5c5e05,0x1));};Dialer[_0xf730('0x15')]['abandonmentRate']=function(_0x452d1e,_0x31cebd,_0x141fbc,_0x23a6aa,_0x268d57,_0x1a36f0){loggerPredictive[_0xf730('0x40')](_0xf730('0x20a'));loggerPredictive[_0xf730('0x40')](_0xf730('0x20b'),_0x452d1e);loggerPredictive['info'](_0xf730('0x20c'),_0x31cebd);loggerPredictive[_0xf730('0x40')](_0xf730('0x20d'),_0x141fbc);loggerPredictive['info'](_0xf730('0x20e'),_0x23a6aa);loggerPredictive[_0xf730('0x40')](_0xf730('0x20f'),_0x268d57);loggerPredictive['info'](_0xf730('0x4b'));return new Promise(function(_0x357391,_0xd6bda9){if(_0x452d1e<=0x0||isNaN(_0x452d1e)){return _0xd6bda9(msgResponse('[abandonmentRate]',_0xf730('0xbc'),_0xf730('0x210')+_0x452d1e));}if(_0x141fbc<=0x0||isNaN(_0x141fbc)){return _0xd6bda9(msgResponse(_0xf730('0x211'),_0xf730('0xbc'),_0xf730('0x212')+_0x141fbc));}if(_0x23a6aa<=0x0||isNaN(_0x23a6aa)){return _0xd6bda9(msgResponse('[abandonmentRate]','Error',_0xf730('0x213')+_0x23a6aa));}if(_0x31cebd<=0x0||isNaN(_0x31cebd)){return _0xd6bda9(msgResponse(_0xf730('0x211'),_0xf730('0xbc'),_0xf730('0x214')+_0x31cebd));}if(_0x268d57<=0x0||isNaN(_0x268d57)){return _0xd6bda9(msgResponse(_0xf730('0x211'),_0xf730('0xbc'),_0xf730('0x215')+_0x268d57));}_0x1a36f0=_0x1a36f0||0x0;var _0x28202e=0x1/_0x141fbc;var _0x28e48f=0x0;var _0x16ba5c=0x0;var _0x5abd26=0x0;var _0x322132=0x0;for(var _0x57d50e=0x0;_0x5abd26<_0x268d57;_0x57d50e+=0x1){_0x16ba5c=_0x57d50e/_0x31cebd;_0x28e48f=(_0x23a6aa*_0x16ba5c+_0x1a36f0)/_0x28202e;_0x5abd26=utils[_0xf730('0x216')](_0x28e48f,_0x452d1e);_0x322132=_0x28e48f/_0x452d1e*(0x1-utils['erlangb'](_0x28e48f,_0x452d1e));}return _0x357391({'erlangCalls':_0x57d50e,'erlangCallToSecond':_0x31cebd/_0x57d50e,'erlangAbandonmentRate':_0x5abd26,'erlangBusyFactor':_0x322132});});};Dialer[_0xf730('0x15')][_0xf730('0x1d4')]=function(_0x49a777,_0x2ec971,_0x1233cc,_0x549869,_0x181373,_0x311523){loggerPredictive[_0xf730('0x40')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xf730('0x40')]('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',_0x49a777);loggerPredictive[_0xf730('0x40')](_0xf730('0x20c'),_0x2ec971);loggerPredictive[_0xf730('0x40')](_0xf730('0x20d'),_0x1233cc);loggerPredictive[_0xf730('0x40')]('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',_0x549869);loggerPredictive['info'](_0xf730('0x217'),_0x181373);loggerPredictive['info']('---------------------------');return new Promise(function(_0x46778b,_0x58e295){if(_0x49a777<=0x0||isNaN(_0x49a777)){return _0x58e295(msgResponse('[busyFactor]',_0xf730('0xbc'),'m\x20=\x20'+_0x49a777));}if(_0x1233cc<=0x0||isNaN(_0x1233cc)){return _0x58e295(msgResponse(_0xf730('0x218'),_0xf730('0xbc'),_0xf730('0x212')+_0x1233cc));}if(_0x549869<=0x0||isNaN(_0x549869)){return _0x58e295(msgResponse(_0xf730('0x218'),'Error',_0xf730('0x213')+_0x549869));}if(_0x2ec971<=0x0||isNaN(_0x2ec971)){return _0x58e295(msgResponse(_0xf730('0x218'),_0xf730('0xbc'),_0xf730('0x214')+_0x2ec971));}if(_0x181373<=0x0||isNaN(_0x181373)){return _0x58e295(msgResponse(_0xf730('0x218'),_0xf730('0xbc'),_0xf730('0x219')+_0x181373));}_0x311523=_0x311523||0x0;var _0x494a16=0x1/_0x1233cc;var _0x5ae545=0x0;var _0x39983d=0x0;var _0x53e6ab=0x0;var _0x223219=0x0;for(var _0x14ea78=0x0;_0x223219<_0x181373;_0x14ea78+=0x1){_0x39983d=_0x14ea78/_0x2ec971;_0x5ae545=(_0x549869*_0x39983d+_0x311523)/_0x494a16;_0x53e6ab=utils[_0xf730('0x216')](_0x5ae545,_0x49a777);_0x223219=_0x5ae545/_0x49a777*(0x1-utils['erlangb'](_0x5ae545,_0x49a777));}return _0x46778b({'erlangCalls':_0x14ea78,'erlangCallToSecond':_0x2ec971/_0x14ea78,'erlangAbandonmentRate':_0x53e6ab,'erlangBusyFactor':_0x223219});});};module[_0xf730('0x21a')]=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 f3cf5bd..100d795 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 _0x2a97=['originatecalleridname','dialCutDigit','substring','prototype','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x29fb75,_0x53ab6e){var _0xd73edc=function(_0x2aa4a4){while(--_0x2aa4a4){_0x29fb75['push'](_0x29fb75['shift']());}};_0xd73edc(++_0x53ab6e);}(_0x2a97,0xec));var _0x72a9=function(_0x164010,_0x5d3f7d){_0x164010=_0x164010-0x0;var _0x1680ac=_0x2a97[_0x164010];return _0x1680ac;};'use strict';var util=require(_0x72a9('0x0'));var _=require('lodash');var moment=require(_0x72a9('0x1'));function checkNameSurname(_0x526e29,_0x339e71,_0xa87964){var _0x2599e='';if(!_[_0x72a9('0x2')](_0x339e71)&&_0x72a9('0x3')===typeof _0x339e71){_0x2599e+=_0x339e71;}if(!_[_0x72a9('0x2')](_0xa87964)&&_0x72a9('0x3')===typeof _0xa87964){_0x2599e+='\x20'+_0xa87964;}if(_0x2599e!==''){return _0x2599e;}return _0x526e29;}function Action(_0x51a315,_0x373047,_0x3c0d39){this[_0x72a9('0x4')]=_0x51a315;this[_0x72a9('0x5')]=_0x3c0d39||undefined;this[_0x72a9('0x6')]=checkNameSurname(_0x373047[_0x72a9('0x7')]['phone'],_0x373047['Contact']['firstName'],_0x373047[_0x72a9('0x7')][_0x72a9('0x8')]);this[_0x72a9('0x9')]=_0x373047[_0x72a9('0xa')];this[_0x72a9('0xb')]=_0x51a315[_0x72a9('0x6')];this['active']=_0x373047[_0x72a9('0xc')]||![];this['type']=_0x51a315[_0x72a9('0xd')];this[_0x72a9('0xe')]=_0x51a315['dialQueueTimeout']||0x3;this[_0x72a9('0xf')]=_0x373047[_0x72a9('0xf')];this[_0x72a9('0x10')]=_0x373047[_0x72a9('0x10')];this['countcongestionretry']=_0x373047[_0x72a9('0x11')];this[_0x72a9('0x12')]=_0x373047[_0x72a9('0x12')];this[_0x72a9('0x13')]=_0x373047['countnosuchnumberretry'];this[_0x72a9('0x14')]=_0x373047['countdropretry'];this['countabandonedretry']=_0x373047[_0x72a9('0x15')];this[_0x72a9('0x16')]=_0x373047[_0x72a9('0x16')];this['countagentrejectretry']=_0x373047[_0x72a9('0x17')];this[_0x72a9('0x18')]=_0x373047['ContactId'];this[_0x72a9('0x19')]=_0x373047[_0x72a9('0x19')];this[_0x72a9('0x1a')]=_0x373047[_0x72a9('0x1a')];this[_0x72a9('0x1b')]=_0x373047[_0x72a9('0x1b')];this[_0x72a9('0x1c')]=_0x373047['CampaignId'];this[_0x72a9('0x1d')]=_0x373047['id'];this[_0x72a9('0x1e')]=_0x373047[_0x72a9('0x7')][_0x72a9('0x1f')]||'';this[_0x72a9('0x20')]=moment()[_0x72a9('0x21')](_0x72a9('0x22'));this[_0x72a9('0x23')]=_0x373047[_0x72a9('0x23')];this[_0x72a9('0x24')]=_0x373047[_0x72a9('0x24')];this['callbackat']=_0x373047[_0x72a9('0x25')];this[_0x72a9('0x26')]=_0x373047[_0x72a9('0x26')];this[_0x72a9('0x27')]='';this[_0x72a9('0x28')]='';}Action['prototype']['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x72a9('0x6')],this['voiceQueue'][_0x72a9('0x29')]>0x0?this['number'][_0x72a9('0x2a')](this[_0x72a9('0x4')][_0x72a9('0x29')]):this[_0x72a9('0x9')]);};Action[_0x72a9('0x2b')][_0x72a9('0x2c')]=function(){return this[_0x72a9('0xb')];};module[_0x72a9('0x2d')]=Action; \ No newline at end of file +var _0x7cdd=['Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name'];(function(_0x449b6e,_0x25e5e0){var _0x467114=function(_0x4595ce){while(--_0x4595ce){_0x449b6e['push'](_0x449b6e['shift']());}};_0x467114(++_0x25e5e0);}(_0x7cdd,0x197));var _0xd7cd=function(_0x5948a6,_0x3095c3){_0x5948a6=_0x5948a6-0x0;var _0x119e75=_0x7cdd[_0x5948a6];return _0x119e75;};'use strict';var util=require(_0xd7cd('0x0'));var _=require(_0xd7cd('0x1'));var moment=require('moment');function checkNameSurname(_0x1200fd,_0x4975ad,_0x49cfdb){var _0x246d60='';if(!_[_0xd7cd('0x2')](_0x4975ad)&&_0xd7cd('0x3')===typeof _0x4975ad){_0x246d60+=_0x4975ad;}if(!_[_0xd7cd('0x2')](_0x49cfdb)&&'string'===typeof _0x49cfdb){_0x246d60+='\x20'+_0x49cfdb;}if(_0x246d60!==''){return _0x246d60;}return _0x1200fd;}function Action(_0xf6f65b,_0x15da4f,_0x47512e){this[_0xd7cd('0x4')]=_0xf6f65b;this[_0xd7cd('0x5')]=_0x47512e||undefined;this[_0xd7cd('0x6')]=checkNameSurname(_0x15da4f[_0xd7cd('0x7')][_0xd7cd('0x8')],_0x15da4f['Contact'][_0xd7cd('0x9')],_0x15da4f['Contact'][_0xd7cd('0xa')]);this['number']=_0x15da4f[_0xd7cd('0x8')];this[_0xd7cd('0xb')]=_0xf6f65b[_0xd7cd('0x6')];this[_0xd7cd('0xc')]=_0x15da4f['active']||![];this[_0xd7cd('0xd')]=_0xf6f65b[_0xd7cd('0xd')];this[_0xd7cd('0xe')]=_0xf6f65b['dialQueueTimeout']||0x3;this['scheduledat']=_0x15da4f['scheduledat'];this[_0xd7cd('0xf')]=_0x15da4f[_0xd7cd('0xf')];this['countcongestionretry']=_0x15da4f[_0xd7cd('0x10')];this[_0xd7cd('0x11')]=_0x15da4f[_0xd7cd('0x11')];this['countnosuchnumberretry']=_0x15da4f[_0xd7cd('0x12')];this[_0xd7cd('0x13')]=_0x15da4f[_0xd7cd('0x13')];this[_0xd7cd('0x14')]=_0x15da4f[_0xd7cd('0x14')];this[_0xd7cd('0x15')]=_0x15da4f[_0xd7cd('0x15')];this[_0xd7cd('0x16')]=_0x15da4f[_0xd7cd('0x16')];this[_0xd7cd('0x17')]=_0x15da4f[_0xd7cd('0x17')];this[_0xd7cd('0x18')]=_0x15da4f['ListId'];this[_0xd7cd('0x19')]=_0x15da4f[_0xd7cd('0x19')];this[_0xd7cd('0x1a')]=_0x15da4f[_0xd7cd('0x1a')];this[_0xd7cd('0x1b')]=_0x15da4f['CampaignId'];this[_0xd7cd('0x1c')]=_0x15da4f['id'];this[_0xd7cd('0x1d')]=_0x15da4f[_0xd7cd('0x7')][_0xd7cd('0x9')]||'';this['starttime']=moment()[_0xd7cd('0x1e')](_0xd7cd('0x1f'));this[_0xd7cd('0x20')]=_0x15da4f['callback'];this[_0xd7cd('0x21')]=_0x15da4f[_0xd7cd('0x21')];this[_0xd7cd('0x22')]=_0x15da4f['callbackat'];this[_0xd7cd('0x23')]=_0x15da4f[_0xd7cd('0x23')];this[_0xd7cd('0x24')]='';this[_0xd7cd('0x25')]='';}Action[_0xd7cd('0x26')][_0xd7cd('0x27')]=function(){return util['format'](_0xd7cd('0x28'),this[_0xd7cd('0x6')],this[_0xd7cd('0x4')][_0xd7cd('0x29')]>0x0?this[_0xd7cd('0x2a')][_0xd7cd('0x2b')](this[_0xd7cd('0x4')][_0xd7cd('0x29')]):this['number']);};Action[_0xd7cd('0x26')][_0xd7cd('0x2c')]=function(){return this[_0xd7cd('0xb')];};module[_0xd7cd('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 8a6a229..7f36ed8 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 _0x5286=['originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x4e9287,_0x3b84d){var _0x546585=function(_0x22c57c){while(--_0x22c57c){_0x4e9287['push'](_0x4e9287['shift']());}};_0x546585(++_0x3b84d);}(_0x5286,0x1f2));var _0x6528=function(_0x4eebe4,_0x26fb3f){_0x4eebe4=_0x4eebe4-0x0;var _0x328c1d=_0x5286[_0x4eebe4];return _0x328c1d;};'use strict';var moment=require(_0x6528('0x0'));var utils=require(_0x6528('0x1'));function AgentComplete(_0xa5028,_0x4107c7){this[_0x6528('0x2')]=0x4;this[_0x6528('0x3')]=_0x6528('0x4');this[_0x6528('0x5')]=_0xa5028[_0x6528('0x5')];this[_0x6528('0x6')]=_0xa5028[_0x6528('0x6')];this[_0x6528('0x7')]=_0xa5028[_0x6528('0x6')]===_0x6528('0x8')?_0x6528('0x9'):_0xa5028[_0x6528('0x6')];this[_0x6528('0xa')]=_0xa5028[_0x6528('0xa')];this[_0x6528('0xb')]=_0xa5028[_0x6528('0xb')];this[_0x6528('0xc')]=_0xa5028[_0x6528('0xc')];this[_0x6528('0xd')]=_0xa5028[_0x6528('0xa')]+_0xa5028[_0x6528('0xb')]+_0xa5028[_0x6528('0xc')]+_0xa5028[_0x6528('0xe')]+_0xa5028['countdropretry']+_0xa5028['countabandonedretry']+_0xa5028[_0x6528('0xf')]+_0xa5028[_0x6528('0x10')];this[_0x6528('0xe')]=_0xa5028[_0x6528('0xe')];this['countdropretry']=_0xa5028[_0x6528('0x11')];this[_0x6528('0x12')]=_0xa5028[_0x6528('0x12')];this[_0x6528('0xf')]=_0xa5028['countmachineretry'];this[_0x6528('0x10')]=_0xa5028[_0x6528('0x10')];this[_0x6528('0x13')]=_0x4107c7[_0x6528('0x13')];this['calleridname']=_0xa5028[_0x6528('0x14')];this['calleridnum']=_0xa5028[_0x6528('0x15')];this[_0x6528('0x16')]=_0xa5028[_0x6528('0x16')];this['responsetime']=_0xa5028[_0x6528('0x17')];this['answertime']=_0xa5028[_0x6528('0x18')];this[_0x6528('0x19')]=moment()[_0x6528('0x1a')](_0x6528('0x1b'));this[_0x6528('0x1c')]=utils[_0x6528('0x1d')](_0xa5028[_0x6528('0x17')],_0xa5028[_0x6528('0x16')]);this[_0x6528('0x1e')]=utils[_0x6528('0x1d')](_0xa5028[_0x6528('0x18')],_0xa5028['responsetime']);this[_0x6528('0x1f')]=utils['getSeconds'](this[_0x6528('0x19')],_0xa5028['answertime']);this[_0x6528('0x9')]=_0x4107c7[_0x6528('0x9')];this[_0x6528('0x20')]=_0x4107c7[_0x6528('0x20')];this[_0x6528('0x21')]=_0x4107c7[_0x6528('0x21')];this['callback']=_0xa5028['callback'];this[_0x6528('0x22')]=_0xa5028[_0x6528('0x22')];this[_0x6528('0x23')]=_0xa5028[_0x6528('0x23')];this['recallme']=_0xa5028['recallme'];this[_0x6528('0x24')]=_0xa5028[_0x6528('0x24')];this['ListId']=_0xa5028[_0x6528('0x25')];this[_0x6528('0x26')]=_0xa5028[_0x6528('0x26')];this[_0x6528('0x27')]=_0xa5028[_0x6528('0x27')];this[_0x6528('0x28')]=_0xa5028[_0x6528('0x28')];this['originatecalleridnum']=_0xa5028[_0x6528('0x29')]||'';this[_0x6528('0x2a')]=_0xa5028[_0x6528('0x2a')]||'';this[_0x6528('0x2b')]=_0xa5028[_0x6528('0x2b')];}module[_0x6528('0x2c')]=AgentComplete; \ No newline at end of file +var _0xee94=['queue','membername','reason','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','../utils','state','statedesc','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime'];(function(_0x690918,_0x5e6749){var _0xa9610e=function(_0x5ada9a){while(--_0x5ada9a){_0x690918['push'](_0x690918['shift']());}};_0xa9610e(++_0x5e6749);}(_0xee94,0x8b));var _0x4ee9=function(_0x95f433,_0x32e415){_0x95f433=_0x95f433-0x0;var _0x5c1bea=_0xee94[_0x95f433];return _0x5c1bea;};'use strict';var moment=require('moment');var utils=require(_0x4ee9('0x0'));function AgentComplete(_0x3806c7,_0x3d7af4){this[_0x4ee9('0x1')]=0x4;this[_0x4ee9('0x2')]='Answer';this[_0x4ee9('0x3')]=_0x3806c7[_0x4ee9('0x3')];this[_0x4ee9('0x4')]=_0x3806c7['type'];this['campaigntype']=_0x3806c7[_0x4ee9('0x4')]===_0x4ee9('0x5')?'queue':_0x3806c7[_0x4ee9('0x4')];this[_0x4ee9('0x6')]=_0x3806c7['countbusyretry'];this[_0x4ee9('0x7')]=_0x3806c7[_0x4ee9('0x7')];this[_0x4ee9('0x8')]=_0x3806c7[_0x4ee9('0x8')];this[_0x4ee9('0x9')]=_0x3806c7['countbusyretry']+_0x3806c7[_0x4ee9('0x7')]+_0x3806c7[_0x4ee9('0x8')]+_0x3806c7[_0x4ee9('0xa')]+_0x3806c7[_0x4ee9('0xb')]+_0x3806c7[_0x4ee9('0xc')]+_0x3806c7[_0x4ee9('0xd')]+_0x3806c7[_0x4ee9('0xe')];this[_0x4ee9('0xa')]=_0x3806c7[_0x4ee9('0xa')];this[_0x4ee9('0xb')]=_0x3806c7['countdropretry'];this[_0x4ee9('0xc')]=_0x3806c7[_0x4ee9('0xc')];this[_0x4ee9('0xd')]=_0x3806c7[_0x4ee9('0xd')];this['countagentrejectretry']=_0x3806c7[_0x4ee9('0xe')];this[_0x4ee9('0xf')]=_0x3d7af4[_0x4ee9('0xf')];this['calleridname']=_0x3806c7[_0x4ee9('0x10')];this[_0x4ee9('0x11')]=_0x3806c7[_0x4ee9('0x12')];this['starttime']=_0x3806c7[_0x4ee9('0x13')];this[_0x4ee9('0x14')]=_0x3806c7['responsetime'];this['answertime']=_0x3806c7[_0x4ee9('0x15')];this['endtime']=moment()[_0x4ee9('0x16')](_0x4ee9('0x17'));this[_0x4ee9('0x18')]=utils[_0x4ee9('0x19')](_0x3806c7['responsetime'],_0x3806c7[_0x4ee9('0x13')]);this[_0x4ee9('0x1a')]=utils[_0x4ee9('0x19')](_0x3806c7[_0x4ee9('0x15')],_0x3806c7[_0x4ee9('0x14')]);this[_0x4ee9('0x1b')]=utils[_0x4ee9('0x19')](this[_0x4ee9('0x1c')],_0x3806c7[_0x4ee9('0x15')]);this[_0x4ee9('0x1d')]=_0x3d7af4[_0x4ee9('0x1d')];this[_0x4ee9('0x1e')]=_0x3d7af4[_0x4ee9('0x1e')];this[_0x4ee9('0x1f')]=_0x3d7af4[_0x4ee9('0x1f')];this['callback']=_0x3806c7['callback'];this[_0x4ee9('0x20')]=_0x3806c7['callbackuniqueid'];this[_0x4ee9('0x21')]=_0x3806c7[_0x4ee9('0x21')];this['recallme']=_0x3806c7['recallme'];this[_0x4ee9('0x22')]=_0x3806c7['ContactId'];this[_0x4ee9('0x23')]=_0x3806c7[_0x4ee9('0x23')];this[_0x4ee9('0x24')]=_0x3806c7[_0x4ee9('0x24')];this[_0x4ee9('0x25')]=_0x3806c7[_0x4ee9('0x25')];this[_0x4ee9('0x26')]=_0x3806c7[_0x4ee9('0x26')];this[_0x4ee9('0x27')]=_0x3806c7[_0x4ee9('0x27')]||'';this[_0x4ee9('0x28')]=_0x3806c7[_0x4ee9('0x28')]||'';this['agiafterat']=_0x3806c7['agiafterat'];}module[_0x4ee9('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 3400ecf..f6a0646 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 _0xa636=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3b2137,_0xa40206){var _0x190198=function(_0x38ee1f){while(--_0x38ee1f){_0x3b2137['push'](_0x3b2137['shift']());}};_0x190198(++_0xa40206);}(_0xa636,0x14f));var _0x6a63=function(_0x589274,_0xa3f1bd){_0x589274=_0x589274-0x0;var _0x21814b=_0xa636[_0x589274];return _0x21814b;};'use strict';function Final(_0x5c72b6){this['uniqueid']=_0x5c72b6['uniqueid'];this['scheduledat']=_0x5c72b6['scheduledat'];this['type']=_0x5c72b6[_0x6a63('0x0')];this[_0x6a63('0x1')]=_0x5c72b6[_0x6a63('0x0')]==='outbound'?_0x6a63('0x2'):_0x5c72b6['type'];this[_0x6a63('0x3')]=_0x5c72b6[_0x6a63('0x3')];this[_0x6a63('0x4')]=_0x5c72b6[_0x6a63('0x4')];this[_0x6a63('0x5')]=_0x5c72b6['countnoanswerretry'];this[_0x6a63('0x6')]=_0x5c72b6[_0x6a63('0x3')]+_0x5c72b6[_0x6a63('0x4')]+_0x5c72b6['countnoanswerretry']+_0x5c72b6[_0x6a63('0x7')]+_0x5c72b6[_0x6a63('0x8')]+_0x5c72b6[_0x6a63('0x9')]+_0x5c72b6[_0x6a63('0xa')]+_0x5c72b6['countagentrejectretry'];this['countnosuchnumberretry']=_0x5c72b6[_0x6a63('0x7')];this[_0x6a63('0x8')]=_0x5c72b6[_0x6a63('0x8')];this['countabandonedretry']=_0x5c72b6[_0x6a63('0x9')];this[_0x6a63('0xa')]=_0x5c72b6[_0x6a63('0xa')];this[_0x6a63('0xb')]=_0x5c72b6[_0x6a63('0xb')];this[_0x6a63('0x2')]=_0x5c72b6['queue'];this['calleridname']=_0x5c72b6['calleridname'];this['calleridnum']=_0x5c72b6[_0x6a63('0xc')];this['starttime']=_0x5c72b6[_0x6a63('0xd')];this['responsetime']=_0x5c72b6[_0x6a63('0xe')];this[_0x6a63('0xf')]=_0x5c72b6['responsetime'];this['ringtime']=_0x5c72b6[_0x6a63('0x10')]||0x0;this[_0x6a63('0x11')]=_0x5c72b6[_0x6a63('0x11')]||0x0;this['talktime']=_0x5c72b6[_0x6a63('0x12')]||0x0;this[_0x6a63('0x13')]=_0x5c72b6[_0x6a63('0x13')];this[_0x6a63('0x14')]=_0x5c72b6[_0x6a63('0x14')];this[_0x6a63('0x15')]=_0x5c72b6['callbackat'];this[_0x6a63('0x16')]=_0x5c72b6[_0x6a63('0x16')];this[_0x6a63('0x17')]=_0x5c72b6['ContactId'];this[_0x6a63('0x18')]=_0x5c72b6[_0x6a63('0x18')];this[_0x6a63('0x19')]=_0x5c72b6[_0x6a63('0x19')];this[_0x6a63('0x1a')]=_0x5c72b6['VoiceQueueId'];this['CampaignId']=_0x5c72b6['CampaignId'];this[_0x6a63('0x1b')]=_0x5c72b6['originatecalleridnum']||'';this['originatecalleridname']=_0x5c72b6[_0x6a63('0x1c')]||'';this['state']=_0x5c72b6[_0x6a63('0x1d')];this[_0x6a63('0x1e')]=_0x5c72b6[_0x6a63('0x1e')];}module['exports']=Final; \ No newline at end of file +var _0x029a=['countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x2dec51,_0x30ab37){var _0x595adc=function(_0x3fa70a){while(--_0x3fa70a){_0x2dec51['push'](_0x2dec51['shift']());}};_0x595adc(++_0x30ab37);}(_0x029a,0x182));var _0xa029=function(_0x33dca0,_0x24ef37){_0x33dca0=_0x33dca0-0x0;var _0xf7eb0e=_0x029a[_0x33dca0];return _0xf7eb0e;};'use strict';function Final(_0x1fd26c){this[_0xa029('0x0')]=_0x1fd26c[_0xa029('0x0')];this[_0xa029('0x1')]=_0x1fd26c[_0xa029('0x1')];this['type']=_0x1fd26c[_0xa029('0x2')];this[_0xa029('0x3')]=_0x1fd26c[_0xa029('0x2')]===_0xa029('0x4')?_0xa029('0x5'):_0x1fd26c[_0xa029('0x2')];this[_0xa029('0x6')]=_0x1fd26c['countbusyretry'];this[_0xa029('0x7')]=_0x1fd26c['countcongestionretry'];this[_0xa029('0x8')]=_0x1fd26c[_0xa029('0x8')];this[_0xa029('0x9')]=_0x1fd26c['countbusyretry']+_0x1fd26c[_0xa029('0x7')]+_0x1fd26c['countnoanswerretry']+_0x1fd26c['countnosuchnumberretry']+_0x1fd26c[_0xa029('0xa')]+_0x1fd26c[_0xa029('0xb')]+_0x1fd26c['countmachineretry']+_0x1fd26c[_0xa029('0xc')];this[_0xa029('0xd')]=_0x1fd26c[_0xa029('0xd')];this[_0xa029('0xa')]=_0x1fd26c[_0xa029('0xa')];this[_0xa029('0xb')]=_0x1fd26c[_0xa029('0xb')];this[_0xa029('0xe')]=_0x1fd26c[_0xa029('0xe')];this['countagentrejectretry']=_0x1fd26c[_0xa029('0xc')];this[_0xa029('0x5')]=_0x1fd26c[_0xa029('0x5')];this[_0xa029('0xf')]=_0x1fd26c['calleridname'];this[_0xa029('0x10')]=_0x1fd26c[_0xa029('0x10')];this[_0xa029('0x11')]=_0x1fd26c['starttime'];this[_0xa029('0x12')]=_0x1fd26c[_0xa029('0x12')];this[_0xa029('0x13')]=_0x1fd26c[_0xa029('0x12')];this[_0xa029('0x14')]=_0x1fd26c['ringtime']||0x0;this[_0xa029('0x15')]=_0x1fd26c['holdtime']||0x0;this[_0xa029('0x16')]=_0x1fd26c[_0xa029('0x16')]||0x0;this[_0xa029('0x17')]=_0x1fd26c['callback'];this[_0xa029('0x18')]=_0x1fd26c['callbackuniqueid'];this[_0xa029('0x19')]=_0x1fd26c[_0xa029('0x19')];this[_0xa029('0x1a')]=_0x1fd26c[_0xa029('0x1a')];this[_0xa029('0x1b')]=_0x1fd26c[_0xa029('0x1b')];this[_0xa029('0x1c')]=_0x1fd26c[_0xa029('0x1c')];this[_0xa029('0x1d')]=_0x1fd26c[_0xa029('0x1d')];this[_0xa029('0x1e')]=_0x1fd26c['VoiceQueueId'];this[_0xa029('0x1f')]=_0x1fd26c[_0xa029('0x1f')];this[_0xa029('0x20')]=_0x1fd26c['originatecalleridnum']||'';this[_0xa029('0x21')]=_0x1fd26c[_0xa029('0x21')]||'';this[_0xa029('0x22')]=_0x1fd26c[_0xa029('0x22')];this['statedesc']=_0x1fd26c['statedesc'];}module[_0xa029('0x23')]=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 b85d8e9..11bb9c0 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 _0xbbee=['moment','../utils','statedesc','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports'];(function(_0x392e2b,_0x15625a){var _0x49fbc0=function(_0x294d67){while(--_0x294d67){_0x392e2b['push'](_0x392e2b['shift']());}};_0x49fbc0(++_0x15625a);}(_0xbbee,0x10a));var _0xebbe=function(_0x1e9c05,_0x60d7a0){_0x1e9c05=_0x1e9c05-0x0;var _0x417e78=_0xbbee[_0x1e9c05];return _0x417e78;};'use strict';var moment=require(_0xebbe('0x0'));var utils=require(_0xebbe('0x1'));function Hangup(_0x29a424,_0x4feaae){this['state']=0x4;this[_0xebbe('0x2')]='Answer';this[_0xebbe('0x3')]=_0x29a424['scheduledat'];this[_0xebbe('0x4')]=_0x29a424['type'];this[_0xebbe('0x5')]=_0x29a424[_0xebbe('0x4')]===_0xebbe('0x6')?_0xebbe('0x7'):_0x29a424[_0xebbe('0x4')];this[_0xebbe('0x8')]=_0x29a424[_0xebbe('0x8')]||![];this['countbusyretry']=_0x29a424[_0xebbe('0x9')];this['countcongestionretry']=_0x29a424['countcongestionretry'];this[_0xebbe('0xa')]=_0x29a424[_0xebbe('0xa')];this['countglobal']=_0x29a424[_0xebbe('0x9')]+_0x29a424['countcongestionretry']+_0x29a424[_0xebbe('0xa')]+_0x29a424['countnosuchnumberretry']+_0x29a424['countdropretry']+_0x29a424[_0xebbe('0xb')]+_0x29a424[_0xebbe('0xc')]+_0x29a424[_0xebbe('0xd')];this[_0xebbe('0xe')]=_0x29a424[_0xebbe('0xe')];this[_0xebbe('0xf')]=_0x29a424[_0xebbe('0xf')];this['countabandonedretry']=_0x29a424[_0xebbe('0xb')];this[_0xebbe('0xc')]=_0x29a424[_0xebbe('0xc')];this[_0xebbe('0xd')]=_0x29a424['countagentrejectretry'];this[_0xebbe('0x10')]=_0x4feaae['uniqueid'];this[_0xebbe('0x11')]=_0x29a424['name'];this['calleridnum']=_0x29a424[_0xebbe('0x12')];this[_0xebbe('0x13')]=_0x29a424['starttime'];this[_0xebbe('0x14')]=_0x29a424[_0xebbe('0x14')];this[_0xebbe('0x15')]=moment()[_0xebbe('0x16')](_0xebbe('0x17'));this['ringtime']=utils[_0xebbe('0x18')](_0x29a424[_0xebbe('0x14')],_0x29a424[_0xebbe('0x13')]);this['holdtime']=0x0;this[_0xebbe('0x19')]=utils[_0xebbe('0x18')](this[_0xebbe('0x15')],_0x29a424[_0xebbe('0x14')]);this[_0xebbe('0x7')]=_0x29a424['queue'];this[_0xebbe('0x1a')]=_0xebbe('0x1b');this['reason']=_0x4feaae['cause-txt'];this[_0xebbe('0x1c')]=_0x29a424['callback'];this['callbackuniqueid']=_0x29a424[_0xebbe('0x1d')];this[_0xebbe('0x1e')]=_0x29a424[_0xebbe('0x1e')];this[_0xebbe('0x1f')]=_0x29a424[_0xebbe('0x1f')];this['ContactId']=_0x29a424[_0xebbe('0x20')];this['ListId']=_0x29a424[_0xebbe('0x21')];this[_0xebbe('0x22')]=_0x29a424[_0xebbe('0x22')];this[_0xebbe('0x23')]=_0x29a424[_0xebbe('0x23')];this[_0xebbe('0x24')]=_0x29a424['CampaignId'];}module[_0xebbe('0x25')]=Hangup; \ No newline at end of file +var _0x18a6=['ContactId','ListId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','starttime','responsetime','endtime','format','ringtime','getSeconds','talktime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme'];(function(_0x8edd99,_0x16f22b){var _0x2ea175=function(_0x17f55b){while(--_0x17f55b){_0x8edd99['push'](_0x8edd99['shift']());}};_0x2ea175(++_0x16f22b);}(_0x18a6,0x12d));var _0x618a=function(_0x455d76,_0x2f5fc3){_0x455d76=_0x455d76-0x0;var _0x517163=_0x18a6[_0x455d76];return _0x517163;};'use strict';var moment=require(_0x618a('0x0'));var utils=require('../utils');function Hangup(_0x2a0035,_0x5f0413){this[_0x618a('0x1')]=0x4;this[_0x618a('0x2')]='Answer';this[_0x618a('0x3')]=_0x2a0035[_0x618a('0x3')];this[_0x618a('0x4')]=_0x2a0035['type'];this[_0x618a('0x5')]=_0x2a0035['type']===_0x618a('0x6')?'queue':_0x2a0035[_0x618a('0x4')];this[_0x618a('0x7')]=_0x2a0035[_0x618a('0x7')]||![];this[_0x618a('0x8')]=_0x2a0035[_0x618a('0x8')];this[_0x618a('0x9')]=_0x2a0035[_0x618a('0x9')];this[_0x618a('0xa')]=_0x2a0035['countnoanswerretry'];this[_0x618a('0xb')]=_0x2a0035['countbusyretry']+_0x2a0035['countcongestionretry']+_0x2a0035['countnoanswerretry']+_0x2a0035[_0x618a('0xc')]+_0x2a0035[_0x618a('0xd')]+_0x2a0035['countabandonedretry']+_0x2a0035[_0x618a('0xe')]+_0x2a0035[_0x618a('0xf')];this[_0x618a('0xc')]=_0x2a0035['countnosuchnumberretry'];this[_0x618a('0xd')]=_0x2a0035[_0x618a('0xd')];this[_0x618a('0x10')]=_0x2a0035[_0x618a('0x10')];this['countmachineretry']=_0x2a0035[_0x618a('0xe')];this[_0x618a('0xf')]=_0x2a0035['countagentrejectretry'];this['uniqueid']=_0x5f0413['uniqueid'];this['calleridname']=_0x2a0035['name'];this['calleridnum']=_0x2a0035['number'];this[_0x618a('0x11')]=_0x2a0035[_0x618a('0x11')];this[_0x618a('0x12')]=_0x2a0035['responsetime'];this[_0x618a('0x13')]=moment()[_0x618a('0x14')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x618a('0x15')]=utils[_0x618a('0x16')](_0x2a0035['responsetime'],_0x2a0035['starttime']);this['holdtime']=0x0;this[_0x618a('0x17')]=utils[_0x618a('0x16')](this['endtime'],_0x2a0035[_0x618a('0x12')]);this['queue']=_0x2a0035[_0x618a('0x18')];this[_0x618a('0x19')]='IVR';this[_0x618a('0x1a')]=_0x5f0413[_0x618a('0x1b')];this['callback']=_0x2a0035[_0x618a('0x1c')];this['callbackuniqueid']=_0x2a0035[_0x618a('0x1d')];this[_0x618a('0x1e')]=_0x2a0035[_0x618a('0x1e')];this[_0x618a('0x1f')]=_0x2a0035['recallme'];this['ContactId']=_0x2a0035[_0x618a('0x20')];this[_0x618a('0x21')]=_0x2a0035[_0x618a('0x21')];this['UserId']=_0x2a0035['UserId'];this['VoiceQueueId']=_0x2a0035[_0x618a('0x22')];this['CampaignId']=_0x2a0035[_0x618a('0x23')];}module[_0x618a('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 7f7556b..1b741cc 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 _0x1add=['countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','queue','calleridname','name','number','starttime','responsetime','endtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x4d3309,_0xcb6015){var _0x5aee3b=function(_0x55b610){while(--_0x55b610){_0x4d3309['push'](_0x4d3309['shift']());}};_0x5aee3b(++_0xcb6015);}(_0x1add,0x1d5));var _0xd1ad=function(_0x5e8ec3,_0x23491c){_0x5e8ec3=_0x5e8ec3-0x0;var _0x326f97=_0x1add[_0x5e8ec3];return _0x326f97;};'use strict';var utils=require('../utils');function History(_0x250063){this['uniqueid']=_0x250063[_0xd1ad('0x0')];this['scheduledat']=_0x250063[_0xd1ad('0x1')]||undefined;this['type']=_0x250063[_0xd1ad('0x2')];this['campaigntype']=_0x250063[_0xd1ad('0x2')]==='outbound'?'queue':_0x250063[_0xd1ad('0x2')];this[_0xd1ad('0x3')]=_0x250063[_0xd1ad('0x3')];this[_0xd1ad('0x4')]=_0x250063[_0xd1ad('0x4')];this[_0xd1ad('0x5')]=_0x250063[_0xd1ad('0x5')];this[_0xd1ad('0x6')]=_0x250063['countbusyretry']+_0x250063['countcongestionretry']+_0x250063[_0xd1ad('0x5')]+_0x250063['countnosuchnumberretry']+_0x250063['countdropretry']+_0x250063['countabandonedretry']+_0x250063[_0xd1ad('0x7')]+_0x250063[_0xd1ad('0x8')];this['countnosuchnumberretry']=_0x250063[_0xd1ad('0x9')];this[_0xd1ad('0xa')]=_0x250063[_0xd1ad('0xa')];this[_0xd1ad('0xb')]=_0x250063[_0xd1ad('0xb')];this[_0xd1ad('0x7')]=_0x250063[_0xd1ad('0x7')];this[_0xd1ad('0x8')]=_0x250063[_0xd1ad('0x8')];this[_0xd1ad('0xc')]=_0x250063['queue'];this[_0xd1ad('0xd')]=_0x250063[_0xd1ad('0xe')];this['calleridnum']=_0x250063[_0xd1ad('0xf')];this[_0xd1ad('0x10')]=_0x250063[_0xd1ad('0x10')];this[_0xd1ad('0x11')]=_0x250063['responsetime'];this[_0xd1ad('0x12')]=_0x250063[_0xd1ad('0x11')];this['ringtime']=utils[_0xd1ad('0x13')](_0x250063[_0xd1ad('0x11')],_0x250063[_0xd1ad('0x10')]);this['holdtime']=0x0;this[_0xd1ad('0x14')]=0x0;this[_0xd1ad('0x15')]=_0x250063[_0xd1ad('0x15')];this[_0xd1ad('0x16')]=_0x250063[_0xd1ad('0x16')];this['callbackat']=_0x250063[_0xd1ad('0x17')];this[_0xd1ad('0x18')]=_0x250063[_0xd1ad('0x18')];this[_0xd1ad('0x19')]=_0x250063[_0xd1ad('0x19')];this[_0xd1ad('0x1a')]=_0x250063[_0xd1ad('0x1a')];this[_0xd1ad('0x1b')]=_0x250063[_0xd1ad('0x1b')];this[_0xd1ad('0x1c')]=_0x250063[_0xd1ad('0x1c')];this[_0xd1ad('0x1d')]=_0x250063[_0xd1ad('0x1d')];this[_0xd1ad('0x1e')]=_0x250063[_0xd1ad('0x1e')]||'';this['originatecalleridname']=_0x250063['originatecalleridname']||'';this[_0xd1ad('0x1f')]=_0x250063[_0xd1ad('0x1f')];this[_0xd1ad('0x20')]=_0x250063[_0xd1ad('0x20')];}module[_0xd1ad('0x21')]=History; \ No newline at end of file +var _0x47e0=['getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime'];(function(_0x4fc851,_0xc37372){var _0x5bf3a9=function(_0x384f11){while(--_0x384f11){_0x4fc851['push'](_0x4fc851['shift']());}};_0x5bf3a9(++_0xc37372);}(_0x47e0,0x113));var _0x047e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47e0[_0x20a584];return _0x4b41a8;};'use strict';var utils=require('../utils');function History(_0x1a16d8){this['uniqueid']=_0x1a16d8['uniqueid'];this['scheduledat']=_0x1a16d8[_0x047e('0x0')]||undefined;this['type']=_0x1a16d8[_0x047e('0x1')];this[_0x047e('0x2')]=_0x1a16d8[_0x047e('0x1')]===_0x047e('0x3')?_0x047e('0x4'):_0x1a16d8[_0x047e('0x1')];this[_0x047e('0x5')]=_0x1a16d8[_0x047e('0x5')];this[_0x047e('0x6')]=_0x1a16d8[_0x047e('0x6')];this[_0x047e('0x7')]=_0x1a16d8['countnoanswerretry'];this[_0x047e('0x8')]=_0x1a16d8[_0x047e('0x5')]+_0x1a16d8[_0x047e('0x6')]+_0x1a16d8[_0x047e('0x7')]+_0x1a16d8[_0x047e('0x9')]+_0x1a16d8[_0x047e('0xa')]+_0x1a16d8['countabandonedretry']+_0x1a16d8[_0x047e('0xb')]+_0x1a16d8[_0x047e('0xc')];this['countnosuchnumberretry']=_0x1a16d8[_0x047e('0x9')];this[_0x047e('0xa')]=_0x1a16d8[_0x047e('0xa')];this[_0x047e('0xd')]=_0x1a16d8['countabandonedretry'];this[_0x047e('0xb')]=_0x1a16d8[_0x047e('0xb')];this[_0x047e('0xc')]=_0x1a16d8[_0x047e('0xc')];this[_0x047e('0x4')]=_0x1a16d8[_0x047e('0x4')];this[_0x047e('0xe')]=_0x1a16d8[_0x047e('0xf')];this[_0x047e('0x10')]=_0x1a16d8[_0x047e('0x11')];this[_0x047e('0x12')]=_0x1a16d8['starttime'];this['responsetime']=_0x1a16d8['responsetime'];this['endtime']=_0x1a16d8[_0x047e('0x13')];this[_0x047e('0x14')]=utils[_0x047e('0x15')](_0x1a16d8[_0x047e('0x13')],_0x1a16d8[_0x047e('0x12')]);this[_0x047e('0x16')]=0x0;this[_0x047e('0x17')]=0x0;this[_0x047e('0x18')]=_0x1a16d8[_0x047e('0x18')];this[_0x047e('0x19')]=_0x1a16d8[_0x047e('0x19')];this[_0x047e('0x1a')]=_0x1a16d8[_0x047e('0x1a')];this[_0x047e('0x1b')]=_0x1a16d8['recallme'];this[_0x047e('0x1c')]=_0x1a16d8['ContactId'];this['ListId']=_0x1a16d8[_0x047e('0x1d')];this[_0x047e('0x1e')]=_0x1a16d8[_0x047e('0x1e')];this[_0x047e('0x1f')]=_0x1a16d8['VoiceQueueId'];this[_0x047e('0x20')]=_0x1a16d8[_0x047e('0x20')];this[_0x047e('0x21')]=_0x1a16d8[_0x047e('0x21')]||'';this['originatecalleridname']=_0x1a16d8['originatecalleridname']||'';this['state']=_0x1a16d8[_0x047e('0x22')];this[_0x047e('0x23')]=_0x1a16d8[_0x047e('0x23')];}module[_0x047e('0x24')]=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 c021991..9e14149 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 _0xd2ab=['queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','ringtime','getSeconds','talktime'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd2ab,0x15a));var _0xbd2a=function(_0x53bfdf,_0x481ffd){_0x53bfdf=_0x53bfdf-0x0;var _0x5ec08f=_0xd2ab[_0x53bfdf];return _0x5ec08f;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x4a2088,_0x4643d1){this[_0xbd2a('0x0')]=_0x4a2088[_0xbd2a('0x0')];this[_0xbd2a('0x1')]=_0x4a2088['type'];this[_0xbd2a('0x2')]=_0x4a2088[_0xbd2a('0x1')]===_0xbd2a('0x3')?'queue':_0x4a2088[_0xbd2a('0x1')];this[_0xbd2a('0x4')]=_0x4a2088[_0xbd2a('0x4')];this['countcongestionretry']=_0x4a2088[_0xbd2a('0x5')];this[_0xbd2a('0x6')]=_0x4a2088[_0xbd2a('0x6')];this[_0xbd2a('0x7')]=_0x4a2088[_0xbd2a('0x4')]+_0x4a2088[_0xbd2a('0x5')]+_0x4a2088['countnoanswerretry']+_0x4a2088[_0xbd2a('0x8')]+_0x4a2088[_0xbd2a('0x9')]+_0x4a2088[_0xbd2a('0xa')]+_0x4a2088[_0xbd2a('0xb')]+_0x4a2088[_0xbd2a('0xc')];this['countnosuchnumberretry']=_0x4a2088[_0xbd2a('0x8')];this[_0xbd2a('0x9')]=_0x4a2088[_0xbd2a('0x9')];this[_0xbd2a('0xa')]=_0x4a2088[_0xbd2a('0xa')];this[_0xbd2a('0xb')]=_0x4a2088[_0xbd2a('0xb')];this[_0xbd2a('0xc')]=_0x4a2088[_0xbd2a('0xc')];this[_0xbd2a('0xd')]=_0x4643d1['uniqueid'];this['calleridname']=_0x4a2088[_0xbd2a('0xe')];this[_0xbd2a('0xf')]=_0x4a2088[_0xbd2a('0x10')];this[_0xbd2a('0x11')]=_0x4a2088[_0xbd2a('0x11')];this[_0xbd2a('0x12')]=_0x4a2088['responsetime'];this[_0xbd2a('0x13')]=_0x4a2088[_0xbd2a('0x13')];this['dropreason']=_0x4a2088['dropreason'];this['endtime']=this['droptime'];this[_0xbd2a('0x14')]=utils[_0xbd2a('0x15')](_0x4a2088[_0xbd2a('0x12')],_0x4a2088[_0xbd2a('0x11')]);this['holdtime']=utils['getSeconds'](this[_0xbd2a('0x13')],_0x4a2088[_0xbd2a('0x12')]);this[_0xbd2a('0x16')]=0x0;this['queue']=_0x4643d1[_0xbd2a('0x17')];this[_0xbd2a('0x18')]=_0x4643d1[_0xbd2a('0x19')];this[_0xbd2a('0x1a')]=_0x4643d1[_0xbd2a('0x1a')];this[_0xbd2a('0x1b')]=_0x4a2088['callback'];this[_0xbd2a('0x1c')]=_0x4a2088[_0xbd2a('0x1c')];this[_0xbd2a('0x1d')]=_0x4a2088[_0xbd2a('0x1d')];this[_0xbd2a('0x1e')]=_0x4a2088['recallme'];this['ContactId']=_0x4a2088['ContactId'];this[_0xbd2a('0x1f')]=_0x4a2088[_0xbd2a('0x1f')];this[_0xbd2a('0x20')]=_0x4a2088['UserId'];this[_0xbd2a('0x21')]=_0x4a2088[_0xbd2a('0x21')];this[_0xbd2a('0x22')]=_0x4a2088['CampaignId'];this[_0xbd2a('0x23')]=_0x4a2088['originatecalleridnum']||'';this[_0xbd2a('0x24')]=_0x4a2088['originatecalleridname']||'';this[_0xbd2a('0x25')]=_0x4a2088[_0xbd2a('0x25')];this[_0xbd2a('0x26')]=_0x4a2088[_0xbd2a('0x26')];this[_0xbd2a('0x27')]=_0x4a2088['statedesc'];}module[_0xbd2a('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xe203=['state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat'];(function(_0x2c862a,_0x3b8037){var _0x4607f2=function(_0x199668){while(--_0x199668){_0x2c862a['push'](_0x2c862a['shift']());}};_0x4607f2(++_0x3b8037);}(_0xe203,0x18f));var _0x3e20=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe203[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x3e20('0x0'));function QueueCallerAbandon(_0x4c4992,_0x2c855d){this[_0x3e20('0x1')]=_0x4c4992['scheduledat'];this[_0x3e20('0x2')]=_0x4c4992['type'];this[_0x3e20('0x3')]=_0x4c4992[_0x3e20('0x2')]===_0x3e20('0x4')?_0x3e20('0x5'):_0x4c4992[_0x3e20('0x2')];this[_0x3e20('0x6')]=_0x4c4992[_0x3e20('0x6')];this[_0x3e20('0x7')]=_0x4c4992[_0x3e20('0x7')];this[_0x3e20('0x8')]=_0x4c4992[_0x3e20('0x8')];this[_0x3e20('0x9')]=_0x4c4992[_0x3e20('0x6')]+_0x4c4992[_0x3e20('0x7')]+_0x4c4992['countnoanswerretry']+_0x4c4992['countnosuchnumberretry']+_0x4c4992[_0x3e20('0xa')]+_0x4c4992[_0x3e20('0xb')]+_0x4c4992['countmachineretry']+_0x4c4992[_0x3e20('0xc')];this[_0x3e20('0xd')]=_0x4c4992[_0x3e20('0xd')];this['countdropretry']=_0x4c4992[_0x3e20('0xa')];this[_0x3e20('0xb')]=_0x4c4992[_0x3e20('0xb')];this[_0x3e20('0xe')]=_0x4c4992[_0x3e20('0xe')];this[_0x3e20('0xc')]=_0x4c4992[_0x3e20('0xc')];this['uniqueid']=_0x2c855d[_0x3e20('0xf')];this[_0x3e20('0x10')]=_0x4c4992[_0x3e20('0x11')];this[_0x3e20('0x12')]=_0x4c4992[_0x3e20('0x13')];this[_0x3e20('0x14')]=_0x4c4992[_0x3e20('0x14')];this[_0x3e20('0x15')]=_0x4c4992[_0x3e20('0x15')];this['droptime']=_0x4c4992[_0x3e20('0x16')];this[_0x3e20('0x17')]=_0x4c4992['dropreason'];this[_0x3e20('0x18')]=this[_0x3e20('0x16')];this[_0x3e20('0x19')]=utils[_0x3e20('0x1a')](_0x4c4992[_0x3e20('0x15')],_0x4c4992['starttime']);this['holdtime']=utils[_0x3e20('0x1a')](this[_0x3e20('0x16')],_0x4c4992[_0x3e20('0x15')]);this[_0x3e20('0x1b')]=0x0;this['queue']=_0x2c855d[_0x3e20('0x5')];this['membername']=_0x2c855d[_0x3e20('0x1c')];this[_0x3e20('0x1d')]=_0x2c855d[_0x3e20('0x1d')];this[_0x3e20('0x1e')]=_0x4c4992[_0x3e20('0x1e')];this[_0x3e20('0x1f')]=_0x4c4992[_0x3e20('0x1f')];this['callbackat']=_0x4c4992[_0x3e20('0x20')];this[_0x3e20('0x21')]=_0x4c4992[_0x3e20('0x21')];this['ContactId']=_0x4c4992[_0x3e20('0x22')];this[_0x3e20('0x23')]=_0x4c4992[_0x3e20('0x23')];this[_0x3e20('0x24')]=_0x4c4992[_0x3e20('0x24')];this['VoiceQueueId']=_0x4c4992['VoiceQueueId'];this[_0x3e20('0x25')]=_0x4c4992[_0x3e20('0x25')];this[_0x3e20('0x26')]=_0x4c4992[_0x3e20('0x26')]||'';this[_0x3e20('0x27')]=_0x4c4992['originatecalleridname']||'';this[_0x3e20('0x28')]=_0x4c4992['agiafterat'];this[_0x3e20('0x29')]=_0x4c4992[_0x3e20('0x29')];this[_0x3e20('0x2a')]=_0x4c4992[_0x3e20('0x2a')];}module[_0x3e20('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 7bc8301..3e0fb21 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 _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(_0x23989a,_0xe9eab9){var _0x168b80=function(_0x1dfb4e){while(--_0x1dfb4e){_0x23989a['push'](_0x23989a['shift']());}};_0x168b80(++_0xe9eab9);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0xfdbd[_0x4d7116];return _0x4593dc;};'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 +var _0x687b=['checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp','[getContactDialerIvr]','countReScheduled','[rescheduleContact]','rescheduleContact','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]'];(function(_0x51642b,_0x4e0286){var _0x8c4450=function(_0x1f050c){while(--_0x1f050c){_0x51642b['push'](_0x51642b['shift']());}};_0x8c4450(++_0x4e0286);}(_0x687b,0x14a));var _0xb687=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x687b[_0x57fa7e];return _0x320671;};'use strict';var util=require(_0xb687('0x0'));var logger=require(_0xb687('0x1'))(_0xb687('0x2'));var cmHopper=require(_0xb687('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xb687('0x4'));function inspectError(_0x2a4a7c){return util[_0xb687('0x5')](_0x2a4a7c,{'showHidden':![],'depth':null});}function getContactDialer(_0x31bd0d,_0x46e5b3,_0x194c55){return cmHopper[_0xb687('0x6')](_0x31bd0d['id'],_0x46e5b3,_0x194c55,_0x31bd0d[_0xb687('0x7')])[_0xb687('0x8')](function(_0x27b750){_0x31bd0d['temp']=0x0;logger[_0xb687('0x9')](_0xb687('0xa'),inspectError(_0x27b750));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x1a99c5,_0x21e3ab){return cmHopper[_0xb687('0xb')](_0x1a99c5['id'],_0x21e3ab,_0x1a99c5[_0xb687('0x7')])[_0xb687('0x8')](function(_0x309d84){_0x1a99c5[_0xb687('0xc')]=0x0;logger[_0xb687('0x9')](_0xb687('0xd'),inspectError(_0x309d84));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x226e56){return cmHopper[_0xb687('0xe')](_0x226e56)[_0xb687('0x8')](function(_0x12a0be){logger['error']('[countReScheduled]',inspectError(_0x12a0be));});}exports[_0xb687('0xe')]=countReScheduled;function rescheduleContact(_0x155ebe){return cmHopper['rescheduleContact'](_0x155ebe)[_0xb687('0x8')](function(_0x2f1ac0){logger[_0xb687('0x9')](_0xb687('0xf'),inspectError(_0x2f1ac0));});}exports[_0xb687('0x10')]=rescheduleContact;function unlockContact(_0x3ab914,_0x30622f,_0x141375){return cmHopper[_0xb687('0x11')](_0x3ab914,_0x30622f,_0x141375)[_0xb687('0x8')](function(_0x25124a){logger[_0xb687('0x9')]('[unlockContact]',inspectError(_0x25124a));});}exports[_0xb687('0x11')]=unlockContact;function moveContactManagedDialer(_0x328301){return cmHopper[_0xb687('0x12')](_0x328301)['catch'](function(_0x48958d){logger[_0xb687('0x9')](_0xb687('0x13'),inspectError(_0x48958d));});}exports[_0xb687('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x4b593b){return cmHopperBlack[_0xb687('0x14')](_0x4b593b)['catch'](function(_0x1bd2bf){logger[_0xb687('0x9')](_0xb687('0x15'),inspectError(_0x1bd2bf));});}exports[_0xb687('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x49d5a1){return cmHopperBlack[_0xb687('0x16')](_0x49d5a1)['catch'](function(_0x335541){logger[_0xb687('0x9')](_0xb687('0x17'),inspectError(_0x335541));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1dc06b,_0x491623,_0xa95e91){return cmHopperAdditionalPhone[_0xb687('0x18')](_0x1dc06b,_0x491623,_0xa95e91)[_0xb687('0x8')](function(_0x38866c){logger[_0xb687('0x9')](_0xb687('0x19'),inspectError(_0x38866c));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xf45db0,_0x129347,_0x1c1585){return cmHopperAdditionalPhone[_0xb687('0x1a')](_0xf45db0,_0x129347,_0x1c1585)[_0xb687('0x8')](function(_0x4136c9){logger[_0xb687('0x9')](_0xb687('0x1b'),inspectError(_0x4136c9));});}exports[_0xb687('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x2e6185){return cmHopperHistory['avgHandleTime'](_0x2e6185)[_0xb687('0x8')](function(_0x192966){logger[_0xb687('0x9')](_0xb687('0x1c'),inspectError(_0x192966));});}exports[_0xb687('0x1d')]=avgHandleTime;function createHistory(_0x173c58){return cmHopperHistory['createHistory'](_0x173c58)[_0xb687('0x8')](function(_0x5143af){logger[_0xb687('0x9')](_0xb687('0x1e'),inspectError(_0x5143af));});}exports[_0xb687('0x1f')]=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 0c7554b..7e74914 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 _0xecda=['error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','toUpperCase','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom'];(function(_0x7544a,_0x3032f8){var _0x3eb052=function(_0x7b21e1){while(--_0x7b21e1){_0x7544a['push'](_0x7544a['shift']());}};_0x3eb052(++_0x3032f8);}(_0xecda,0x6c));var _0xaecd=function(_0x4005e8,_0x52a3b5){_0x4005e8=_0x4005e8-0x0;var _0x2d2903=_0xecda[_0x4005e8];return _0x2d2903;};'use strict';var _=require(_0xaecd('0x0'));var moment=require(_0xaecd('0x1'));var util=require(_0xaecd('0x2'));var logger=require('../../../../config/logger')(_0xaecd('0x3'));var timezones=require(_0xaecd('0x4'))[_0xaecd('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xaecd('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xaecd('0x7'),'DISACTIVED':_0xaecd('0x8'),'EMPTY_INTERVAL':_0xaecd('0x9'),'INACTIVE':_0xaecd('0xa'),'NO_AGENTS_LOGGED':_0xaecd('0xb'),'NO_AVAILABLE_CONTACTS':_0xaecd('0xc'),'NULL_INTERVAL':_0xaecd('0xd'),'OVERTIME_INTERVAL':_0xaecd('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0xaecd('0xf'),'QUEUE_RECALL':_0xaecd('0x10'),'RECALL_TIMEOUT':_0xaecd('0x11'),'RUNNING':_0xaecd('0x12'),'UNKNOWN_TIMEZONE':_0xaecd('0x13'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xaecd('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x42646a){return _0x42646a[_0xaecd('0x15')]===_0xaecd('0x16');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x4549d8){return _0x4549d8[_0xaecd('0x17')]===_0xaecd('0x18');}exports[_0xaecd('0x19')]=isIVRCampaign;function isOutboundQueue(_0x593ec7){return _0x593ec7[_0xaecd('0x17')]===_0xaecd('0x1a');}exports[_0xaecd('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x5ee342){return _0x5ee342[_0xaecd('0x1c')];}exports[_0xaecd('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x59efa1){return _0x59efa1['active'];}exports[_0xaecd('0x1e')]=isIVRCampaignActive;function getSeconds(_0x217549,_0xa40baa){var _0x30e92b=moment(_0x217549)['milliseconds'](0x0);var _0xfd8b99=moment(_0xa40baa)[_0xaecd('0x1f')](0x0);return _0x30e92b['diff'](_0xfd8b99,_0xaecd('0x20'));}exports[_0xaecd('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0xfb37ed,_0xc3e8a){var _0x1c0c86=![];var _0x32dff4=_0xfb37ed['dialMethod']!==_0xc3e8a[_0xaecd('0x15')]||_0xfb37ed[_0xaecd('0x1c')]!==_0xc3e8a[_0xaecd('0x1c')]||_0xfb37ed[_0xaecd('0x22')]!==_0xc3e8a[_0xaecd('0x22')];var _0x3ba5f7=_0xfb37ed[_0xaecd('0x23')]!==_0xc3e8a[_0xaecd('0x23')]||_0xfb37ed[_0xaecd('0x24')]!==_0xc3e8a[_0xaecd('0x24')]||_0xfb37ed[_0xaecd('0x25')]!==_0xc3e8a[_0xaecd('0x25')]||_0xfb37ed['paused']!==_0xc3e8a[_0xaecd('0x26')]||_0xfb37ed[_0xaecd('0x27')]!==_0xc3e8a[_0xaecd('0x27')]||_0xfb37ed[_0xaecd('0x28')]!==_0xc3e8a[_0xaecd('0x28')]||_0xfb37ed[_0xaecd('0x29')]!==_0xc3e8a['waiting']||_0xfb37ed[_0xaecd('0x2a')]!==_0xc3e8a['inUse']||_0xfb37ed[_0xaecd('0x2b')]!==_0xc3e8a[_0xaecd('0x2b')];if(_0xfb37ed[_0xaecd('0x2c')]&&_0xc3e8a[_0xaecd('0x2c')]){_0x1c0c86=_0xfb37ed['Trunk'][_0xaecd('0x2d')]!==_0xc3e8a['Trunk'][_0xaecd('0x2d')]||_0xfb37ed['Trunk'][_0xaecd('0x2e')]!==_0xc3e8a[_0xaecd('0x2c')]['active'];}return _0x32dff4||_0x3ba5f7||_0x1c0c86;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x387a0a){var _0x55c03a=null;var _0x5b055c=_0x387a0a[_0xaecd('0x2f')];if(_[_0xaecd('0x30')](_0x387a0a[_0xaecd('0x31')])||_['isNil'](_0x387a0a[_0xaecd('0x32')])||_[_0xaecd('0x30')](_0x387a0a[_0xaecd('0x32')][_0xaecd('0x33')])){_0x55c03a=CAMPAIGN_STATUS[_0xaecd('0x34')];}else if(_[_0xaecd('0x35')](_0x387a0a[_0xaecd('0x31')])||_[_0xaecd('0x35')](_0x387a0a[_0xaecd('0x32')][_0xaecd('0x33')])){_0x55c03a=CAMPAIGN_STATUS[_0xaecd('0x36')];}else if(_0x5b055c&&!timezones[_0x5b055c]){_0x55c03a=CAMPAIGN_STATUS[_0xaecd('0x37')];}return _0x55c03a;}function checkAnyValidTrunk(_0xc364c8,_0x3077f8){var _0x2d43d0=null;var _0x39676e=_0xaecd('0x38');var _0x1517b5=[_0xaecd('0x39'),_0xaecd('0x3a')];var _0x94e64f=!![];if(_0xc364c8['Trunk']&&_0xc364c8[_0xaecd('0x2c')][_0xaecd('0x2e')]){_0x39676e+=_0xc364c8[_0xaecd('0x2c')][_0xaecd('0x2d')];_0x2d43d0=_0x3077f8[_0x39676e];_0x94e64f=_0x1517b5['includes'](_0x2d43d0[_0xaecd('0x3b')]);}else if(_0xc364c8['TrunkBackup']&&_0xc364c8[_0xaecd('0x3c')][_0xaecd('0x2e')]){_0x39676e+=_0xc364c8[_0xaecd('0x3c')][_0xaecd('0x2d')];_0x2d43d0=_0x3077f8[_0x39676e];_0x94e64f=_0x1517b5[_0xaecd('0x3d')](_0x2d43d0[_0xaecd('0x3b')]);}return _0x94e64f;}function getQueueCampaignStatusMessage(_0x55849d,_0x29469e){var _0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x3e')];var _0x297d7b=isPreviewCampaign(_0x55849d);if(!isQueueCampaignActive(_0x55849d)){if(_0x297d7b){_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x3f')];}else{if(_0x55849d[_0xaecd('0x2b')]===0x0&&_0x55849d[_0xaecd('0x27')]===0x0&&_0x55849d[_0xaecd('0x29')]===0x0&&(_0x55849d[_0xaecd('0x28')]||0x0)===0x0){_0x4baf66=CAMPAIGN_STATUS['INACTIVE'];}else{_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x40')];}}}else if(_0x55849d[_0xaecd('0x24')]===0x0){_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x41')];}else if(!checkAnyValidTrunk(_0x55849d,_0x29469e)){_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x42')];}else if(!isPreviewCampaign(_0x55849d)){var _0x2fb11d=checkAnyValidQueueCampaignInterval(_0x55849d);if(_0x2fb11d){_0x4baf66=_0x2fb11d;}}return _0x4baf66;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3bf626){var _0x12dd41=CAMPAIGN_STATUS[_0xaecd('0x40')];if(_0x3bf626['originated']===0x0&&_0x3bf626['talking']===0x0&&_0x3bf626[_0xaecd('0x29')]===0x0&&(_0x3bf626[_0xaecd('0x28')]||0x0)===0x0){_0x12dd41=CAMPAIGN_STATUS[_0xaecd('0x3f')];}return _0x12dd41;}exports[_0xaecd('0x43')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x185cac){var _0x23ebcb=_0x185cac[_0xaecd('0x44')](/"(.*?)"/);return _0x23ebcb?_0x23ebcb[0x1]:_0x185cac;}exports[_0xaecd('0x45')]=extractCalleridName;function getCallerId(_0xe3d79b,_0x647e2f,_0x40df54){if(!_[_0xaecd('0x46')](_0x40df54)&&typeof _0x40df54===_0xaecd('0x47')&&!_[_0xaecd('0x35')](_0x40df54)){if(!_[_0xaecd('0x46')](_0x647e2f)&&typeof _0x647e2f==='string'&&!_[_0xaecd('0x35')](_0x647e2f)){return util[_0xaecd('0x48')](_0xaecd('0x49'),_0x647e2f,_0x40df54);}return util[_0xaecd('0x48')](_0xaecd('0x49'),_0x40df54,_0x40df54);}if(!_[_0xaecd('0x46')](_0xe3d79b)&&typeof _0xe3d79b===_0xaecd('0x47')&&!_['isEmpty'](_0xe3d79b)){return _0xe3d79b;}return _0xaecd('0x4a');}exports[_0xaecd('0x4b')]=getCallerId;function getCallerIdRandom(_0x29b276,_0x2ff60b){var _0x117854;var _0x1174bb;var _0x5783d4;if(_0x2ff60b<=0x0){_0x2ff60b=0x1;}_0x117854=new RegExp(_0xaecd('0x4c')+_0x2ff60b+'}$');_0x1174bb=Math['pow'](0xa,_0x2ff60b-0x1);_0x5783d4=Math[_0xaecd('0x4d')](0xa,_0x2ff60b)-0x1;return util['format']('%s',_[_0xaecd('0x4e')](_0x29b276,_0x117854,_[_0xaecd('0x4f')](_0x1174bb,_0x5783d4)[_0xaecd('0x50')]()));}exports[_0xaecd('0x51')]=getCallerIdRandom;function decrementOriginate(_0x93ef1e){if(_0x93ef1e['originated']&&_0x93ef1e[_0xaecd('0x2b')]>0x0){_0x93ef1e['originated']-=0x1;}else{logger[_0xaecd('0x52')](_0xaecd('0x53'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x5ef334){return _0x5ef334&&_0x5ef334['length']>0x0;}exports[_0xaecd('0x54')]=checkContactEmpty;function erlangb(_0x241d85,_0x49040e){if(_0x49040e===0x0){return 0x0;}var _0x46c6f7=0x1;for(var _0x5d63de=0x1;_0x5d63de<=_0x49040e;_0x5d63de+=0x1){_0x46c6f7=0x1+_0x46c6f7*_0x5d63de/_0x241d85;}return 0x1/_0x46c6f7;}exports[_0xaecd('0x55')]=erlangb;function checkContactLowerLimitOriginate(_0x35da73,_0x1aff37,_0x42b918){if(_0x1aff37>_0x42b918){for(var _0x30fe0e=0x0;_0x30fe0e<_0x1aff37-_0x42b918;_0x30fe0e+=0x1){decrementOriginate(_0x35da73);}}}exports[_0xaecd('0x56')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1e2e0b){var _0x17b88d={};var _0x4d9c8a=['id',_0xaecd('0x57'),_0xaecd('0x58'),_0xaecd('0x59'),_0xaecd('0x5a')];if(_0x1e2e0b){for(var _0x13d093 in _0x1e2e0b){if(typeof _0x1e2e0b[_0x13d093]!==_0xaecd('0x5b')){if(!_['isNil'](_0x1e2e0b[_0x13d093])&&!_0x4d9c8a[_0xaecd('0x3d')](_0x13d093)){_0x17b88d[util[_0xaecd('0x48')](_0xaecd('0x5c'),'XMD-',_0x13d093[_0xaecd('0x5d')]())]=_0x1e2e0b[_0x13d093];}}}}return _0x17b88d;}exports[_0xaecd('0x5e')]=setXMDContactVariables; \ No newline at end of file +var _0xa289=['moment','util','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','format','replace','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','XMD-','toUpperCase','setXMDContactVariables','lodash'];(function(_0x3427b6,_0x3567e6){var _0x3dcf63=function(_0x44fa77){while(--_0x44fa77){_0x3427b6['push'](_0x3427b6['shift']());}};_0x3dcf63(++_0x3567e6);}(_0xa289,0x119));var _0x9a28=function(_0x11ceda,_0x50fc90){_0x11ceda=_0x11ceda-0x0;var _0x281334=_0xa289[_0x11ceda];return _0x281334;};'use strict';var _=require(_0x9a28('0x0'));var moment=require(_0x9a28('0x1'));var util=require(_0x9a28('0x2'));var logger=require(_0x9a28('0x3'))(_0x9a28('0x4'));var timezones=require('../../../../config/environment/shared')[_0x9a28('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x9a28('0x6'),'BLACKLIST':_0x9a28('0x7'),'CONTACTS_RESCHEDULED':_0x9a28('0x8'),'DEACTIVATED':_0x9a28('0x9'),'DISACTIVED':_0x9a28('0xa'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x9a28('0xb'),'NO_AGENTS_LOGGED':_0x9a28('0xc'),'NO_AVAILABLE_CONTACTS':_0x9a28('0xd'),'NULL_INTERVAL':_0x9a28('0xe'),'OVERTIME_INTERVAL':_0x9a28('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x9a28('0x10'),'QUEUE_RECALL':_0x9a28('0x11'),'RECALL_TIMEOUT':_0x9a28('0x12'),'RUNNING':_0x9a28('0x13'),'UNKNOWN_TIMEZONE':_0x9a28('0x14'),'UNREACHABLE_TRUNK':_0x9a28('0x15')};exports[_0x9a28('0x16')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4d8fbb){return _0x4d8fbb[_0x9a28('0x17')]===_0x9a28('0x18');}exports[_0x9a28('0x19')]=isPreviewCampaign;function isIVRCampaign(_0x34b0f5){return _0x34b0f5[_0x9a28('0x1a')]===_0x9a28('0x1b');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x4e1f86){return _0x4e1f86[_0x9a28('0x1a')]===_0x9a28('0x1c');}exports[_0x9a28('0x1d')]=isOutboundQueue;function isQueueCampaignActive(_0xb25ec3){return _0xb25ec3[_0x9a28('0x1e')];}exports[_0x9a28('0x1f')]=isQueueCampaignActive;function isIVRCampaignActive(_0x2b0496){return _0x2b0496[_0x9a28('0x20')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x3c2048,_0x8825ec){var _0x1e4a77=moment(_0x3c2048)[_0x9a28('0x21')](0x0);var _0xcdefcd=moment(_0x8825ec)[_0x9a28('0x21')](0x0);return _0x1e4a77['diff'](_0xcdefcd,_0x9a28('0x22'));}exports[_0x9a28('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x5555aa,_0x1a73d2){var _0x548eea=![];var _0x2a03e3=_0x5555aa[_0x9a28('0x17')]!==_0x1a73d2[_0x9a28('0x17')]||_0x5555aa[_0x9a28('0x1e')]!==_0x1a73d2[_0x9a28('0x1e')]||_0x5555aa[_0x9a28('0x24')]!==_0x1a73d2[_0x9a28('0x24')];var _0x32f2a3=_0x5555aa[_0x9a28('0x25')]!==_0x1a73d2[_0x9a28('0x25')]||_0x5555aa[_0x9a28('0x26')]!==_0x1a73d2[_0x9a28('0x26')]||_0x5555aa[_0x9a28('0x27')]!==_0x1a73d2['loggedInDb']||_0x5555aa['paused']!==_0x1a73d2[_0x9a28('0x28')]||_0x5555aa[_0x9a28('0x29')]!==_0x1a73d2[_0x9a28('0x29')]||_0x5555aa['pTalking']!==_0x1a73d2[_0x9a28('0x2a')]||_0x5555aa[_0x9a28('0x2b')]!==_0x1a73d2[_0x9a28('0x2b')]||_0x5555aa[_0x9a28('0x2c')]!==_0x1a73d2[_0x9a28('0x2c')]||_0x5555aa['originated']!==_0x1a73d2[_0x9a28('0x2d')];if(_0x5555aa[_0x9a28('0x2e')]&&_0x1a73d2[_0x9a28('0x2e')]){_0x548eea=_0x5555aa['Trunk']['name']!==_0x1a73d2['Trunk'][_0x9a28('0x2f')]||_0x5555aa[_0x9a28('0x2e')][_0x9a28('0x20')]!==_0x1a73d2[_0x9a28('0x2e')][_0x9a28('0x20')];}return _0x2a03e3||_0x32f2a3||_0x548eea;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x38f94c){var _0x2341f1=null;var _0x56bbc8=_0x38f94c['dialTimezone'];if(_[_0x9a28('0x30')](_0x38f94c[_0x9a28('0x31')])||_[_0x9a28('0x30')](_0x38f94c['Interval'])||_['isNil'](_0x38f94c[_0x9a28('0x32')][_0x9a28('0x33')])){_0x2341f1=CAMPAIGN_STATUS[_0x9a28('0x34')];}else if(_['isEmpty'](_0x38f94c['dialGlobalInterval'])||_[_0x9a28('0x35')](_0x38f94c['Interval'][_0x9a28('0x33')])){_0x2341f1=CAMPAIGN_STATUS[_0x9a28('0x36')];}else if(_0x56bbc8&&!timezones[_0x56bbc8]){_0x2341f1=CAMPAIGN_STATUS[_0x9a28('0x37')];}return _0x2341f1;}function checkAnyValidTrunk(_0x298fda,_0x5394af){var _0x2b6770=null;var _0x3b6e5c=_0x9a28('0x38');var _0x3f4e7f=[_0x9a28('0x39'),_0x9a28('0x3a')];var _0x3321ff=!![];if(_0x298fda['Trunk']&&_0x298fda[_0x9a28('0x2e')][_0x9a28('0x20')]){_0x3b6e5c+=_0x298fda[_0x9a28('0x2e')][_0x9a28('0x2f')];_0x2b6770=_0x5394af[_0x3b6e5c];_0x3321ff=_0x3f4e7f[_0x9a28('0x3b')](_0x2b6770[_0x9a28('0x3c')]);}else if(_0x298fda[_0x9a28('0x3d')]&&_0x298fda[_0x9a28('0x3d')][_0x9a28('0x20')]){_0x3b6e5c+=_0x298fda[_0x9a28('0x3d')][_0x9a28('0x2f')];_0x2b6770=_0x5394af[_0x3b6e5c];_0x3321ff=_0x3f4e7f[_0x9a28('0x3b')](_0x2b6770[_0x9a28('0x3c')]);}return _0x3321ff;}function getQueueCampaignStatusMessage(_0x25d140,_0x5012e2){var _0x33c38a=CAMPAIGN_STATUS[_0x9a28('0x6')];var _0x112478=isPreviewCampaign(_0x25d140);if(!isQueueCampaignActive(_0x25d140)){if(_0x112478){_0x33c38a=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x25d140[_0x9a28('0x2d')]===0x0&&_0x25d140[_0x9a28('0x29')]===0x0&&_0x25d140['waiting']===0x0&&(_0x25d140[_0x9a28('0x2a')]||0x0)===0x0){_0x33c38a=CAMPAIGN_STATUS[_0x9a28('0x3e')];}else{_0x33c38a=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x25d140['loggedIn']===0x0){_0x33c38a=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x25d140,_0x5012e2)){_0x33c38a=CAMPAIGN_STATUS[_0x9a28('0x3f')];}else if(!isPreviewCampaign(_0x25d140)){var _0x2d7408=checkAnyValidQueueCampaignInterval(_0x25d140);if(_0x2d7408){_0x33c38a=_0x2d7408;}}return _0x33c38a;}exports[_0x9a28('0x40')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x58094f){var _0x16b87d=CAMPAIGN_STATUS[_0x9a28('0x41')];if(_0x58094f[_0x9a28('0x2d')]===0x0&&_0x58094f[_0x9a28('0x29')]===0x0&&_0x58094f['waiting']===0x0&&(_0x58094f[_0x9a28('0x2a')]||0x0)===0x0){_0x16b87d=CAMPAIGN_STATUS[_0x9a28('0x3e')];}return _0x16b87d;}exports[_0x9a28('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x51aee2){var _0x36ba92=_0x51aee2[_0x9a28('0x43')](/"(.*?)"/);return _0x36ba92?_0x36ba92[0x1]:_0x51aee2;}exports[_0x9a28('0x44')]=extractCalleridName;function getCallerId(_0x523d2e,_0x34e438,_0x4adf15){if(!_[_0x9a28('0x45')](_0x4adf15)&&typeof _0x4adf15===_0x9a28('0x46')&&!_[_0x9a28('0x35')](_0x4adf15)){if(!_[_0x9a28('0x45')](_0x34e438)&&typeof _0x34e438===_0x9a28('0x46')&&!_[_0x9a28('0x35')](_0x34e438)){return util['format'](_0x9a28('0x47'),_0x34e438,_0x4adf15);}return util['format'](_0x9a28('0x47'),_0x4adf15,_0x4adf15);}if(!_[_0x9a28('0x45')](_0x523d2e)&&typeof _0x523d2e===_0x9a28('0x46')&&!_[_0x9a28('0x35')](_0x523d2e)){return _0x523d2e;}return'\x22\x22\x20<>';}exports[_0x9a28('0x48')]=getCallerId;function getCallerIdRandom(_0x40e9a4,_0x18bddd){var _0x21a52b;var _0x4a8dfe;var _0x4b17d8;if(_0x18bddd<=0x0){_0x18bddd=0x1;}_0x21a52b=new RegExp(_0x9a28('0x49')+_0x18bddd+'}$');_0x4a8dfe=Math[_0x9a28('0x4a')](0xa,_0x18bddd-0x1);_0x4b17d8=Math[_0x9a28('0x4a')](0xa,_0x18bddd)-0x1;return util[_0x9a28('0x4b')]('%s',_[_0x9a28('0x4c')](_0x40e9a4,_0x21a52b,_[_0x9a28('0x4d')](_0x4a8dfe,_0x4b17d8)[_0x9a28('0x4e')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0xd73944){if(_0xd73944[_0x9a28('0x2d')]&&_0xd73944[_0x9a28('0x2d')]>0x0){_0xd73944['originated']-=0x1;}else{logger[_0x9a28('0x4f')](_0x9a28('0x50'));}}exports[_0x9a28('0x51')]=decrementOriginate;function checkContactEmpty(_0x315abf){return _0x315abf&&_0x315abf[_0x9a28('0x52')]>0x0;}exports[_0x9a28('0x53')]=checkContactEmpty;function erlangb(_0x119d9c,_0x44a6c6){if(_0x44a6c6===0x0){return 0x0;}var _0x17d241=0x1;for(var _0xba3f4e=0x1;_0xba3f4e<=_0x44a6c6;_0xba3f4e+=0x1){_0x17d241=0x1+_0x17d241*_0xba3f4e/_0x119d9c;}return 0x1/_0x17d241;}exports[_0x9a28('0x54')]=erlangb;function checkContactLowerLimitOriginate(_0x3cb874,_0x450ca9,_0x68a2b0){if(_0x450ca9>_0x68a2b0){for(var _0x324ee6=0x0;_0x324ee6<_0x450ca9-_0x68a2b0;_0x324ee6+=0x1){decrementOriginate(_0x3cb874);}}}exports[_0x9a28('0x55')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x342e2c){var _0x51275f={};var _0x250b25=['id',_0x9a28('0x56'),_0x9a28('0x57'),_0x9a28('0x58'),_0x9a28('0x59')];if(_0x342e2c){for(var _0x580bce in _0x342e2c){if(typeof _0x342e2c[_0x580bce]!==_0x9a28('0x5a')){if(!_[_0x9a28('0x30')](_0x342e2c[_0x580bce])&&!_0x250b25[_0x9a28('0x3b')](_0x580bce)){_0x51275f[util[_0x9a28('0x4b')]('%s%s',_0x9a28('0x5b'),_0x580bce[_0x9a28('0x5c')]())]=_0x342e2c[_0x580bce];}}}}return _0x51275f;}exports[_0x9a28('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 4df2fa9..f489cca 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(_0x5191e5,_0x354417){var _0x5c57d4=function(_0x475bd9){while(--_0x475bd9){_0x5191e5['push'](_0x5191e5['shift']());}};_0x5c57d4(++_0x354417);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x486df4,_0x428ba9){var _0x10f620=function(_0x23d24c){while(--_0x23d24c){_0x486df4['push'](_0x486df4['shift']());}};_0x10f620(++_0x428ba9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 c0e6c6f..032b833 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 _0xb245=['newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState'];(function(_0x1c6815,_0x39a650){var _0x244537=function(_0x2c11c5){while(--_0x2c11c5){_0x1c6815['push'](_0x1c6815['shift']());}};_0x244537(++_0x39a650);}(_0xb245,0xc5));var _0x5b24=function(_0x254254,_0x23dc4d){_0x254254=_0x254254-0x0;var _0x302c27=_0xb245[_0x254254];return _0x302c27;};'use strict';var util=require(_0x5b24('0x0'));var _=require(_0x5b24('0x1'));var BPromise=require(_0x5b24('0x2'));var uuid=require('uuid');var moment=require(_0x5b24('0x3'));var path=require(_0x5b24('0x4'));var tiff2pdf=require(_0x5b24('0x5'));var gs=require('./util/gs');var logger=require(_0x5b24('0x6'))(_0x5b24('0x7'));var ami=require(_0x5b24('0x8'));var rpcDb=require(_0x5b24('0x9'));var Channel=require('./channel');var ut=require(_0x5b24('0xa'));var Action=require(_0x5b24('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x59d07e){this['channels']={};this[_0x5b24('0xc')]=_0x59d07e[_0x5b24('0xc')];this[_0x5b24('0xd')]=_0x59d07e[_0x5b24('0xd')];this[_0x5b24('0xe')]={};ami['on']('newchannel',this[_0x5b24('0xf')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x11'),this[_0x5b24('0x12')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x13'),this[_0x5b24('0x14')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x15'),this[_0x5b24('0x16')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x17'),this[_0x5b24('0x18')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x19'),this['syncReceiveFax'][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x1a'),this['syncHangup'][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x1b'),this['syncOriginateResponse'][_0x5b24('0x10')](this));}Fax[_0x5b24('0x1c')]['syncNewchannel']=function(_0x8cbe05){if(_0x8cbe05[_0x5b24('0x1d')]===_0x5b24('0x1e')){for(var _0x6ccdd9 in this[_0x5b24('0xc')]){if(this[_0x5b24('0xc')][_0x5b24('0x1f')](_0x6ccdd9)){if(_0x8cbe05[_0x5b24('0x20')]===this[_0x5b24('0xc')][_0x6ccdd9][_0x5b24('0x21')]){this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]]={};this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]][_0x5b24('0x24')]=_0x8cbe05['channel'];this['channels'][_0x8cbe05[_0x5b24('0x23')]]['id']=this[_0x5b24('0xc')][_0x6ccdd9]['id'];this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]]['name']=this['faxAccounts'][_0x6ccdd9][_0x5b24('0x25')];logger[_0x5b24('0x26')](_0x8cbe05[_0x5b24('0x23')],_0x5b24('0x27'));}}}}if(this[_0x5b24('0xe')][_0x8cbe05['uniqueid']]){this[_0x5b24('0x22')][_0x8cbe05['uniqueid']]={};this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]]['channel']=_0x8cbe05[_0x5b24('0x24')];logger[_0x5b24('0x26')](_0x8cbe05[_0x5b24('0x23')],'\x20syncNewchannel\x20');}};Fax[_0x5b24('0x1c')][_0x5b24('0x12')]=function(_0x1fb2e1){if(this[_0x5b24('0x22')][_0x1fb2e1[_0x5b24('0x23')]]){for(var _0x166c97 in _0x1fb2e1[_0x5b24('0x28')]){if(_0x1fb2e1['variable'][_0x5b24('0x1f')](_0x166c97)){this['channels'][_0x1fb2e1['uniqueid']][_0x166c97]=_0x1fb2e1[_0x5b24('0x29')];}}}};Fax[_0x5b24('0x1c')][_0x5b24('0x14')]=function(_0x4daef0){if(this['channels'][_0x4daef0['uniqueid']]){this[_0x5b24('0x22')][_0x4daef0[_0x5b24('0x23')]]['channelstate']=_0x4daef0[_0x5b24('0x2a')];this[_0x5b24('0x22')][_0x4daef0['uniqueid']][_0x5b24('0x2b')]=_0x4daef0[_0x5b24('0x2b')];}};Fax['prototype'][_0x5b24('0x16')]=function(_0x350339){if(this['channels'][_0x350339[_0x5b24('0x23')]]){for(var _0x1cc271 in _0x350339['variable']){if(_0x350339['variable'][_0x5b24('0x1f')](_0x1cc271)){this['channels'][_0x350339['uniqueid']][_0x1cc271]=_0x350339[_0x5b24('0x29')];}}}};Fax[_0x5b24('0x1c')][_0x5b24('0x18')]=function(_0x1dfbe0){if(this[_0x5b24('0x22')][_0x1dfbe0[_0x5b24('0x23')]]){this[_0x5b24('0x22')][_0x1dfbe0['uniqueid']][_0x5b24('0x2c')]=_0x1dfbe0[_0x5b24('0x2c')];this['channels'][_0x1dfbe0[_0x5b24('0x23')]][_0x5b24('0x2d')]=_0x1dfbe0[_0x5b24('0x2d')];this['channels'][_0x1dfbe0[_0x5b24('0x23')]][_0x5b24('0x21')]=_0x1dfbe0[_0x5b24('0x21')];this[_0x5b24('0x22')][_0x1dfbe0[_0x5b24('0x23')]]['filename']=_0x1dfbe0['filename'];logger[_0x5b24('0x26')](_0x1dfbe0[_0x5b24('0x23')],'\x20syncFaxStatus\x20');}};Fax[_0x5b24('0x1c')]['syncReceiveFax']=function(_0x2c444b){var _0x2fa66b=this;if(this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]]){var _0xbdf818=this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]]['id'];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x2e')]=_0x2c444b['remotestationid'];this[_0x5b24('0x22')][_0x2c444b['uniqueid']][_0x5b24('0x2f')]=_0x2c444b[_0x5b24('0x2f')];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x21')]=_0x2c444b[_0x5b24('0x21')];this['channels'][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x30')]=_0x2c444b['resolution'];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x31')]=_0x2c444b[_0x5b24('0x31')];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x32')]=_0x2c444b[_0x5b24('0x32')];this['channels'][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x33')]=_0x2c444b[_0x5b24('0x33')];if(this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x2c444b[_0x5b24('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x2c7546){logger[_0x5b24('0x26')](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x34'),_0x2c7546[_0x5b24('0x35')]);attachment[_0x5b24('0x36')]({'name':path[_0x5b24('0x37')](_0x2c444b['filename'])[_0x5b24('0x25')],'basename':path['parse'](_0x2c444b[_0x5b24('0x32')])[_0x5b24('0x25')]+_0x5b24('0x38'),'type':_0x5b24('0x39')})[_0x5b24('0x3a')](function(_0x3c86c1){faxAccount['notify'](_0xbdf818,{'from':_0x2c444b[_0x5b24('0x33')],'mapKey':_0x5b24('0x7'),'body':path[_0x5b24('0x37')](_0x2c444b[_0x5b24('0x32')])[_0x5b24('0x25')]+_0x5b24('0x38'),'AttachmentId':_0x3c86c1['id']})['catch'](function(_0x1e8d2e){logger['error'](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x3b'),JSON[_0x5b24('0x3c')](_0x1e8d2e));});})[_0x5b24('0x3d')](function(_0x18bfb7){logger['error'](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x3e'),JSON[_0x5b24('0x3c')](_0x18bfb7));});});}logger[_0x5b24('0x26')](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x3e'));}};Fax[_0x5b24('0x1c')]['syncOriginateResponse']=function(_0x2e54fd){if(this[_0x5b24('0xe')][_0x2e54fd[_0x5b24('0x23')]]){_[_0x5b24('0x3f')](this[_0x5b24('0x22')][_0x2e54fd[_0x5b24('0x23')]],_['pick'](_0x2e54fd,['response','reason']));}};function updateStatus(_0x1045b8){if(_0x1045b8[_0x5b24('0x40')]){faxMessage[_0x5b24('0x41')](_0x1045b8[_0x5b24('0x40')],{'failMessage':_0x5b24('0x42')})[_0x5b24('0x3a')](function(_0x2c3635){ut[_0x5b24('0x43')]('[Fax][Message][Error][Updated]',_0x2c3635);})[_0x5b24('0x3d')](function(_0x458aa4){ut[_0x5b24('0x43')](_0x5b24('0x44'),_0x458aa4);});}else{ut[_0x5b24('0x43')](_0x5b24('0x45'));}}Fax[_0x5b24('0x1c')][_0x5b24('0x46')]=function(_0x7fa341,_0x4e045c,_0x5c3298){var _0x4ce53b=this;var _0x7f499b={};if(_0x4e045c){_0x7f499b={'read':_0x4e045c};}else{_0x7f499b={'failMessage':_0x5c3298};}if(this['actions'][_0x7fa341][_0x5b24('0x40')]){faxMessage[_0x5b24('0x41')](this[_0x5b24('0xe')][_0x7fa341][_0x5b24('0x40')],_0x7f499b)[_0x5b24('0x3a')](function(_0x2d3711){ut[_0x5b24('0x43')](_0x5b24('0x47'),_0x2d3711);})[_0x5b24('0x3d')](function(_0x3541ae){ut[_0x5b24('0x43')](_0x5b24('0x48'),_0x3541ae);})['finally'](function(){delete _0x4ce53b[_0x5b24('0x22')][_0x7fa341];delete _0x4ce53b[_0x5b24('0xe')][_0x7fa341];});}else{ut[_0x5b24('0x43')](_0x5b24('0x49'));delete this['channels'][_0x7fa341];delete this[_0x5b24('0xe')][_0x7fa341];}};Fax[_0x5b24('0x1c')][_0x5b24('0x4a')]=function(_0x27298f){var _0x2e3661=this;if(this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]){if(this[_0x5b24('0xe')][_0x27298f[_0x5b24('0x23')]]){this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]['id']=this[_0x5b24('0xe')][_0x27298f['uniqueid']]['id'];this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]['name']=this['actions'][_0x27298f[_0x5b24('0x23')]][_0x5b24('0x25')];}logger[_0x5b24('0x26')](_0x27298f['uniqueid'],this[_0x5b24('0xe')][_0x27298f[_0x5b24('0x23')]]?'\x20hangup\x20sendFile\x20':_0x5b24('0x4b'),JSON[_0x5b24('0x3c')](this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]));if(this[_0x5b24('0xe')][_0x27298f[_0x5b24('0x23')]]){if(this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]][_0x5b24('0x4c')]>0x0&&this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]][_0x5b24('0x17')]==='SUCCESS'){this[_0x5b24('0x46')](_0x27298f[_0x5b24('0x23')],!![]);}else{this[_0x5b24('0x46')](_0x27298f[_0x5b24('0x23')],![],this[_0x5b24('0x22')][_0x27298f['uniqueid']][_0x5b24('0x4d')]?_0x5b24('0x4e')+this[_0x5b24('0x22')][_0x27298f['uniqueid']][_0x5b24('0x4d')]:_0x5b24('0x4f'));}}}};Fax[_0x5b24('0x1c')][_0x5b24('0x50')]=function(_0xa1c333){var _0xc46242=this;return new BPromise(function(_0x3b2a3d,_0x199484){_0xc46242[_0x5b24('0x51')](_0xa1c333,_0xc46242[_0x5b24('0xc')][_0xa1c333[_0x5b24('0x52')]])[_0x5b24('0x3a')](function(_0x30d7ce){ut[_0x5b24('0x43')]('[Fax][execOriginate][success]',_0x30d7ce);_0x3b2a3d(ut[_0x5b24('0x35')]('Fax\x20received'));})[_0x5b24('0x3d')](function(_0x5cc6bc){ut[_0x5b24('0x43')](_0x5b24('0x53'),_0x5cc6bc);updateStatus(_0xa1c333);_0x199484(ut[_0x5b24('0x35')]('Fax\x20failed'));});});};Fax['prototype'][_0x5b24('0x54')]=function(_0x43cca4){var _0x104555=this;return new BPromise(function(_0x4b4639,_0x54cd20){var _0x7a2e80=_0x104555[_0x5b24('0x55')](_0x104555['faxAccounts'][_0x43cca4['FaxAccountId']]['Trunk'],_0x43cca4);if(_0x7a2e80[_0x5b24('0x56')]){_0x4b4639(ut['message'](_0x5b24('0x57')));}else{_0x54cd20(ut[_0x5b24('0x35')](_0x7a2e80['message']));}});};function originate(_0xe38052,_0x2ca0fc,_0x4cc11d){return new BPromise(function(_0x145740,_0x3d0bac){if(_0x4cc11d){var _0x19a97d=util['format'](_0x5b24('0x58'),path[_0x5b24('0x37')](_0xe38052[_0x5b24('0x4')])['name'],_0xe38052[_0x5b24('0x4')]);gs[_0x5b24('0x59')](_0x19a97d)[_0x5b24('0x3a')](function(){_0xe38052[_0x5b24('0x4')]=util[_0x5b24('0x5a')](_0x5b24('0x5b'),path[_0x5b24('0x37')](_0xe38052[_0x5b24('0x4')])[_0x5b24('0x5c')],path[_0x5b24('0x37')](_0xe38052[_0x5b24('0x4')])[_0x5b24('0x25')]);_0x2ca0fc['XMF-PATH']=_0xe38052[_0x5b24('0x4')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x5b24('0x5d')](ut['variablesAction'](_0xe38052,_0x2ca0fc))['then'](function(_0x45d06b){_0x145740(_0x45d06b);})[_0x5b24('0x3d')](function(_0x18c312){_0x3d0bac(_0x18c312);});})['catch'](function(_0x47d174){_0x3d0bac(_0x47d174);});}else{ami[_0x5b24('0x5d')](ut[_0x5b24('0x5e')](_0xe38052,_0x2ca0fc))[_0x5b24('0x3a')](function(_0x594f64){_0x145740(_0x594f64);})[_0x5b24('0x3d')](function(_0xb12715){_0x3d0bac(_0xb12715);});}});}Fax[_0x5b24('0x1c')][_0x5b24('0x51')]=function(_0x2372b3,_0x137189){var _0x4c359b=this;return new BPromise(function(_0x25167a,_0x3800c5){var _0x263b0e=uuid['v4']();var _0x2faedb=ut[_0x5b24('0x5f')](_0x2372b3,_0x137189);_0x4c359b[_0x5b24('0xe')][_0x263b0e]=new Action(_0x263b0e,_0x137189,_0x2372b3);var _0x3ab65e=_0x4c359b[_0x5b24('0xe')][_0x263b0e];if(path[_0x5b24('0x37')](_0x2372b3[_0x5b24('0x4')])['ext']===_0x5b24('0x38')){originate(_0x3ab65e,_0x2faedb,!![])[_0x5b24('0x3a')](function(_0x27d68c){_0x25167a(_0x27d68c);})[_0x5b24('0x3d')](function(_0x12221a){_0x3800c5(_0x12221a);});}else{originate(_0x3ab65e,_0x2faedb,![])[_0x5b24('0x3a')](function(_0x184a40){_0x25167a(_0x184a40);})[_0x5b24('0x3d')](function(_0x480656){_0x3800c5(_0x480656);});}});};Fax[_0x5b24('0x1c')][_0x5b24('0x60')]=function(_0xbe0f86){return!_['isNil'](_0xbe0f86)&&!_[_0x5b24('0x61')](_0xbe0f86[_0x5b24('0x25')])&&!_[_0x5b24('0x61')](_0xbe0f86['active'])&&_0xbe0f86[_0x5b24('0x62')]&&!_[_0x5b24('0x61')](this[_0x5b24('0xd')][util['format'](_0x5b24('0x63'),_0xbe0f86[_0x5b24('0x25')])])&&!_['isNil'](this[_0x5b24('0xd')][util['format'](_0x5b24('0x63'),_0xbe0f86[_0x5b24('0x25')])][_0x5b24('0x2d')])&&(this[_0x5b24('0xd')][util[_0x5b24('0x5a')](_0x5b24('0x63'),_0xbe0f86['name'])][_0x5b24('0x2d')]===_0x5b24('0x64')||this[_0x5b24('0xd')][util[_0x5b24('0x5a')](_0x5b24('0x63'),_0xbe0f86[_0x5b24('0x25')])]['status']===_0x5b24('0x65'));};Fax[_0x5b24('0x1c')][_0x5b24('0x55')]=function(_0x555e1a,_0x2a80b5){if(!this[_0x5b24('0x60')](_0x555e1a)){ut[_0x5b24('0x43')](_0x5b24('0x66'),_[_0x5b24('0x61')](_0x555e1a)?'':_0x555e1a[_0x5b24('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x5b24('0x67')};}if(_[_0x5b24('0x61')](_0x2a80b5[_0x5b24('0x7')])){ut[_0x5b24('0x43')](_0x5b24('0x68'),JSON[_0x5b24('0x3c')](_0x2a80b5));return{'isValid':![],'message':_0x5b24('0x69')};}if(_['isNil'](_0x2a80b5[_0x5b24('0x4')])){ut['logger'](_0x5b24('0x6a'),JSON[_0x5b24('0x3c')](_0x2a80b5));return{'isValid':![],'message':_0x5b24('0x6b')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x5b24('0x6c')]=Fax; \ No newline at end of file +var _0xa668=['SIP/%s','reachable','unmonitored','checkTrunk','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','lodash','bluebird','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','from-voip-provider','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','channelstate','hasOwnProperty','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','.pdf','application/pdf','then','parse','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isNil','active'];(function(_0xb93f26,_0x332732){var _0x307f8d=function(_0x5a5f5b){while(--_0x5a5f5b){_0xb93f26['push'](_0xb93f26['shift']());}};_0x307f8d(++_0x332732);}(_0xa668,0xe6));var _0x8a66=function(_0x3bc111,_0x137248){_0x3bc111=_0x3bc111-0x0;var _0x3431d1=_0xa668[_0x3bc111];return _0x3431d1;};'use strict';var util=require('util');var _=require(_0x8a66('0x0'));var BPromise=require(_0x8a66('0x1'));var uuid=require('uuid');var moment=require(_0x8a66('0x2'));var path=require(_0x8a66('0x3'));var tiff2pdf=require(_0x8a66('0x4'));var gs=require(_0x8a66('0x5'));var logger=require('../../../config/logger')(_0x8a66('0x6'));var ami=require(_0x8a66('0x7'));var rpcDb=require(_0x8a66('0x8'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x8a66('0x9'));var faxAccount=require(_0x8a66('0xa'));var attachment=require(_0x8a66('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0xc50070){this['channels']={};this[_0x8a66('0xc')]=_0xc50070['faxAccounts'];this[_0x8a66('0xd')]=_0xc50070[_0x8a66('0xd')];this[_0x8a66('0xe')]={};ami['on']('newchannel',this[_0x8a66('0xf')][_0x8a66('0x10')](this));ami['on'](_0x8a66('0x11'),this['syncVarSet'][_0x8a66('0x10')](this));ami['on']('newstate',this[_0x8a66('0x12')][_0x8a66('0x10')](this));ami['on'](_0x8a66('0x13'),this[_0x8a66('0x14')][_0x8a66('0x10')](this));ami['on'](_0x8a66('0x15'),this[_0x8a66('0x16')]['bind'](this));ami['on'](_0x8a66('0x17'),this[_0x8a66('0x18')]['bind'](this));ami['on'](_0x8a66('0x19'),this[_0x8a66('0x1a')][_0x8a66('0x10')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x8a66('0x10')](this));}Fax[_0x8a66('0x1b')][_0x8a66('0xf')]=function(_0x167ca4){if(_0x167ca4[_0x8a66('0x1c')]===_0x8a66('0x1d')){for(var _0xb8154d in this[_0x8a66('0xc')]){if(this['faxAccounts']['hasOwnProperty'](_0xb8154d)){if(_0x167ca4['exten']===this[_0x8a66('0xc')][_0xb8154d][_0x8a66('0x1e')]){this[_0x8a66('0x1f')][_0x167ca4[_0x8a66('0x20')]]={};this['channels'][_0x167ca4[_0x8a66('0x20')]][_0x8a66('0x21')]=_0x167ca4[_0x8a66('0x21')];this[_0x8a66('0x1f')][_0x167ca4[_0x8a66('0x20')]]['id']=this[_0x8a66('0xc')][_0xb8154d]['id'];this['channels'][_0x167ca4[_0x8a66('0x20')]][_0x8a66('0x22')]=this[_0x8a66('0xc')][_0xb8154d][_0x8a66('0x22')];logger[_0x8a66('0x23')](_0x167ca4[_0x8a66('0x20')],'\x20syncNewchannel\x20');}}}}if(this[_0x8a66('0xe')][_0x167ca4[_0x8a66('0x20')]]){this[_0x8a66('0x1f')][_0x167ca4[_0x8a66('0x20')]]={};this[_0x8a66('0x1f')][_0x167ca4[_0x8a66('0x20')]][_0x8a66('0x21')]=_0x167ca4['channel'];logger[_0x8a66('0x23')](_0x167ca4[_0x8a66('0x20')],_0x8a66('0x24'));}};Fax[_0x8a66('0x1b')][_0x8a66('0x25')]=function(_0x577f3e){if(this['channels'][_0x577f3e[_0x8a66('0x20')]]){for(var _0x598b09 in _0x577f3e[_0x8a66('0x26')]){if(_0x577f3e[_0x8a66('0x26')]['hasOwnProperty'](_0x598b09)){this[_0x8a66('0x1f')][_0x577f3e[_0x8a66('0x20')]][_0x598b09]=_0x577f3e['value'];}}}};Fax['prototype'][_0x8a66('0x12')]=function(_0x378048){if(this[_0x8a66('0x1f')][_0x378048[_0x8a66('0x20')]]){this[_0x8a66('0x1f')][_0x378048[_0x8a66('0x20')]][_0x8a66('0x27')]=_0x378048[_0x8a66('0x27')];this[_0x8a66('0x1f')][_0x378048['uniqueid']]['channelstatedesc']=_0x378048['channelstatedesc'];}};Fax['prototype'][_0x8a66('0x14')]=function(_0x3f3cbf){if(this[_0x8a66('0x1f')][_0x3f3cbf[_0x8a66('0x20')]]){for(var _0x422867 in _0x3f3cbf['variable']){if(_0x3f3cbf['variable'][_0x8a66('0x28')](_0x422867)){this['channels'][_0x3f3cbf['uniqueid']][_0x422867]=_0x3f3cbf[_0x8a66('0x29')];}}}};Fax[_0x8a66('0x1b')][_0x8a66('0x16')]=function(_0x3fe077){if(this['channels'][_0x3fe077[_0x8a66('0x20')]]){this[_0x8a66('0x1f')][_0x3fe077[_0x8a66('0x20')]][_0x8a66('0x2a')]=_0x3fe077[_0x8a66('0x2a')];this[_0x8a66('0x1f')][_0x3fe077[_0x8a66('0x20')]][_0x8a66('0x2b')]=_0x3fe077[_0x8a66('0x2b')];this[_0x8a66('0x1f')][_0x3fe077[_0x8a66('0x20')]][_0x8a66('0x1e')]=_0x3fe077[_0x8a66('0x1e')];this[_0x8a66('0x1f')][_0x3fe077[_0x8a66('0x20')]][_0x8a66('0x2c')]=_0x3fe077[_0x8a66('0x2c')];logger['info'](_0x3fe077[_0x8a66('0x20')],_0x8a66('0x2d'));}};Fax['prototype'][_0x8a66('0x18')]=function(_0x5ba7fc){var _0x331b67=this;if(this[_0x8a66('0x1f')][_0x5ba7fc['uniqueid']]){var _0xa1e038=this[_0x8a66('0x1f')][_0x5ba7fc[_0x8a66('0x20')]]['id'];this[_0x8a66('0x1f')][_0x5ba7fc[_0x8a66('0x20')]][_0x8a66('0x2e')]=_0x5ba7fc[_0x8a66('0x2e')];this['channels'][_0x5ba7fc[_0x8a66('0x20')]][_0x8a66('0x2f')]=_0x5ba7fc[_0x8a66('0x2f')];this[_0x8a66('0x1f')][_0x5ba7fc[_0x8a66('0x20')]][_0x8a66('0x1e')]=_0x5ba7fc[_0x8a66('0x1e')];this[_0x8a66('0x1f')][_0x5ba7fc[_0x8a66('0x20')]][_0x8a66('0x30')]=_0x5ba7fc['resolution'];this[_0x8a66('0x1f')][_0x5ba7fc[_0x8a66('0x20')]][_0x8a66('0x31')]=_0x5ba7fc[_0x8a66('0x31')];this[_0x8a66('0x1f')][_0x5ba7fc[_0x8a66('0x20')]]['filename']=_0x5ba7fc[_0x8a66('0x2c')];this['channels'][_0x5ba7fc['uniqueid']][_0x8a66('0x32')]=_0x5ba7fc[_0x8a66('0x32')];if(this[_0x8a66('0x1f')][_0x5ba7fc[_0x8a66('0x20')]]['pagestransferred']>0x0){tiff2pdf(_0x5ba7fc[_0x8a66('0x2c')],_0x8a66('0x33'),function(_0x3205b7){logger[_0x8a66('0x23')](_0x5ba7fc[_0x8a66('0x20')],'\x20result\x20conversion\x20file\x20',_0x3205b7[_0x8a66('0x34')]);attachment[_0x8a66('0x35')]({'name':path['parse'](_0x5ba7fc[_0x8a66('0x2c')])[_0x8a66('0x22')],'basename':path['parse'](_0x5ba7fc['filename'])[_0x8a66('0x22')]+_0x8a66('0x36'),'type':_0x8a66('0x37')})[_0x8a66('0x38')](function(_0x48472e){faxAccount['notify'](_0xa1e038,{'from':_0x5ba7fc['calleridnum'],'mapKey':'fax','body':path[_0x8a66('0x39')](_0x5ba7fc[_0x8a66('0x2c')])[_0x8a66('0x22')]+_0x8a66('0x36'),'AttachmentId':_0x48472e['id']})[_0x8a66('0x3a')](function(_0x51e801){logger[_0x8a66('0x3b')](_0x5ba7fc['uniqueid'],_0x8a66('0x3c'),JSON[_0x8a66('0x3d')](_0x51e801));});})[_0x8a66('0x3a')](function(_0x450afc){logger[_0x8a66('0x3b')](_0x5ba7fc[_0x8a66('0x20')],_0x8a66('0x3e'),JSON[_0x8a66('0x3d')](_0x450afc));});});}logger[_0x8a66('0x23')](_0x5ba7fc[_0x8a66('0x20')],_0x8a66('0x3e'));}};Fax[_0x8a66('0x1b')]['syncOriginateResponse']=function(_0x153346){if(this[_0x8a66('0xe')][_0x153346[_0x8a66('0x20')]]){_[_0x8a66('0x3f')](this[_0x8a66('0x1f')][_0x153346[_0x8a66('0x20')]],_[_0x8a66('0x40')](_0x153346,['response',_0x8a66('0x41')]));}};function updateStatus(_0x5cc192){if(_0x5cc192['AttachmentId']){faxMessage[_0x8a66('0x42')](_0x5cc192['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x8a66('0x38')](function(_0xaa091c){ut[_0x8a66('0x43')](_0x8a66('0x44'),_0xaa091c);})[_0x8a66('0x3a')](function(_0x5a0493){ut[_0x8a66('0x43')]('[Fax][Message][Error][NoUpdate1]',_0x5a0493);});}else{ut[_0x8a66('0x43')](_0x8a66('0x45'));}}Fax['prototype'][_0x8a66('0x46')]=function(_0x1a7485,_0x20984d,_0x17ee69){var _0x28aef8=this;var _0xf91041={};if(_0x20984d){_0xf91041={'read':_0x20984d};}else{_0xf91041={'failMessage':_0x17ee69};}if(this[_0x8a66('0xe')][_0x1a7485]['AttachmentId']){faxMessage[_0x8a66('0x42')](this['actions'][_0x1a7485][_0x8a66('0x47')],_0xf91041)[_0x8a66('0x38')](function(_0x51a064){ut[_0x8a66('0x43')]('[Fax][Message][Updated]',_0x51a064);})['catch'](function(_0x3464a3){ut[_0x8a66('0x43')](_0x8a66('0x48'),_0x3464a3);})[_0x8a66('0x49')](function(){delete _0x28aef8[_0x8a66('0x1f')][_0x1a7485];delete _0x28aef8[_0x8a66('0xe')][_0x1a7485];});}else{ut[_0x8a66('0x43')]('[Fax][Message][NoUpdate2]');delete this[_0x8a66('0x1f')][_0x1a7485];delete this[_0x8a66('0xe')][_0x1a7485];}};Fax['prototype'][_0x8a66('0x1a')]=function(_0x112c3a){var _0x5dbbbb=this;if(this[_0x8a66('0x1f')][_0x112c3a[_0x8a66('0x20')]]){if(this[_0x8a66('0xe')][_0x112c3a[_0x8a66('0x20')]]){this[_0x8a66('0x1f')][_0x112c3a[_0x8a66('0x20')]]['id']=this['actions'][_0x112c3a[_0x8a66('0x20')]]['id'];this[_0x8a66('0x1f')][_0x112c3a[_0x8a66('0x20')]]['name']=this[_0x8a66('0xe')][_0x112c3a[_0x8a66('0x20')]][_0x8a66('0x22')];}logger[_0x8a66('0x23')](_0x112c3a[_0x8a66('0x20')],this[_0x8a66('0xe')][_0x112c3a['uniqueid']]?_0x8a66('0x4a'):_0x8a66('0x4b'),JSON['stringify'](this[_0x8a66('0x1f')][_0x112c3a[_0x8a66('0x20')]]));if(this[_0x8a66('0xe')][_0x112c3a[_0x8a66('0x20')]]){if(this[_0x8a66('0x1f')][_0x112c3a[_0x8a66('0x20')]][_0x8a66('0x4c')]>0x0&&this[_0x8a66('0x1f')][_0x112c3a[_0x8a66('0x20')]][_0x8a66('0x15')]===_0x8a66('0x4d')){this['updateStatus'](_0x112c3a[_0x8a66('0x20')],!![]);}else{this['updateStatus'](_0x112c3a[_0x8a66('0x20')],![],this['channels'][_0x112c3a[_0x8a66('0x20')]][_0x8a66('0x4e')]?_0x8a66('0x4f')+this['channels'][_0x112c3a['uniqueid']][_0x8a66('0x4e')]:_0x8a66('0x50'));}}}};Fax[_0x8a66('0x1b')]['send']=function(_0x2e7232){var _0x14d539=this;return new BPromise(function(_0x4a99a7,_0x4a2133){_0x14d539[_0x8a66('0x51')](_0x2e7232,_0x14d539[_0x8a66('0xc')][_0x2e7232[_0x8a66('0x52')]])['then'](function(_0x2bf988){ut['logger'](_0x8a66('0x53'),_0x2bf988);_0x4a99a7(ut['message'](_0x8a66('0x54')));})['catch'](function(_0x57d4b3){ut[_0x8a66('0x43')](_0x8a66('0x55'),_0x57d4b3);updateStatus(_0x2e7232);_0x4a2133(ut[_0x8a66('0x34')](_0x8a66('0x56')));});});};Fax[_0x8a66('0x1b')][_0x8a66('0x57')]=function(_0x2dd14d){var _0x303394=this;return new BPromise(function(_0x19fbf8,_0x24f058){var _0x50dff5=_0x303394['checkTrunk'](_0x303394[_0x8a66('0xc')][_0x2dd14d[_0x8a66('0x52')]]['Trunk'],_0x2dd14d);if(_0x50dff5['isValid']){_0x19fbf8(ut[_0x8a66('0x34')]('Trunk\x20Reachable'));}else{_0x24f058(ut[_0x8a66('0x34')](_0x50dff5[_0x8a66('0x34')]));}});};function originate(_0x31bbfb,_0xcb6789,_0x41ff0e){return new BPromise(function(_0x4f4444,_0x37f9ea){if(_0x41ff0e){var _0x475c45=util[_0x8a66('0x58')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x31bbfb[_0x8a66('0x3')])[_0x8a66('0x22')],_0x31bbfb[_0x8a66('0x3')]);gs['execute'](_0x475c45)[_0x8a66('0x38')](function(){_0x31bbfb[_0x8a66('0x3')]=util[_0x8a66('0x58')](_0x8a66('0x59'),path[_0x8a66('0x39')](_0x31bbfb['path'])[_0x8a66('0x5a')],path[_0x8a66('0x39')](_0x31bbfb[_0x8a66('0x3')])['name']);_0xcb6789[_0x8a66('0x5b')]=_0x31bbfb[_0x8a66('0x3')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x8a66('0x5c')](ut[_0x8a66('0x5d')](_0x31bbfb,_0xcb6789))[_0x8a66('0x38')](function(_0x27e684){_0x4f4444(_0x27e684);})[_0x8a66('0x3a')](function(_0x46d9f2){_0x37f9ea(_0x46d9f2);});})[_0x8a66('0x3a')](function(_0x1147fd){_0x37f9ea(_0x1147fd);});}else{ami['Action'](ut['variablesAction'](_0x31bbfb,_0xcb6789))[_0x8a66('0x38')](function(_0xf5b355){_0x4f4444(_0xf5b355);})[_0x8a66('0x3a')](function(_0x3a7d71){_0x37f9ea(_0x3a7d71);});}});}Fax['prototype'][_0x8a66('0x51')]=function(_0x356690,_0xdcb3db){var _0x2261de=this;return new BPromise(function(_0x2261ff,_0x1cfef2){var _0x23a9bb=uuid['v4']();var _0x596ad4=ut['addVariables'](_0x356690,_0xdcb3db);_0x2261de[_0x8a66('0xe')][_0x23a9bb]=new Action(_0x23a9bb,_0xdcb3db,_0x356690);var _0x1d710c=_0x2261de[_0x8a66('0xe')][_0x23a9bb];if(path[_0x8a66('0x39')](_0x356690[_0x8a66('0x3')])[_0x8a66('0x5e')]==='.pdf'){originate(_0x1d710c,_0x596ad4,!![])[_0x8a66('0x38')](function(_0x1b5725){_0x2261ff(_0x1b5725);})[_0x8a66('0x3a')](function(_0x15fe73){_0x1cfef2(_0x15fe73);});}else{originate(_0x1d710c,_0x596ad4,![])[_0x8a66('0x38')](function(_0x236685){_0x2261ff(_0x236685);})[_0x8a66('0x3a')](function(_0x592893){_0x1cfef2(_0x592893);});}});};Fax[_0x8a66('0x1b')]['isTrunkReachable']=function(_0x56a5b4){return!_[_0x8a66('0x5f')](_0x56a5b4)&&!_[_0x8a66('0x5f')](_0x56a5b4[_0x8a66('0x22')])&&!_['isNil'](_0x56a5b4['active'])&&_0x56a5b4[_0x8a66('0x60')]&&!_[_0x8a66('0x5f')](this['trunks'][util[_0x8a66('0x58')](_0x8a66('0x61'),_0x56a5b4[_0x8a66('0x22')])])&&!_[_0x8a66('0x5f')](this[_0x8a66('0xd')][util[_0x8a66('0x58')](_0x8a66('0x61'),_0x56a5b4[_0x8a66('0x22')])][_0x8a66('0x2b')])&&(this[_0x8a66('0xd')][util[_0x8a66('0x58')](_0x8a66('0x61'),_0x56a5b4['name'])][_0x8a66('0x2b')]===_0x8a66('0x62')||this[_0x8a66('0xd')][util[_0x8a66('0x58')](_0x8a66('0x61'),_0x56a5b4[_0x8a66('0x22')])][_0x8a66('0x2b')]===_0x8a66('0x63'));};Fax['prototype'][_0x8a66('0x64')]=function(_0x273a11,_0x2fb05d){if(!this[_0x8a66('0x65')](_0x273a11)){ut[_0x8a66('0x43')](_0x8a66('0x66'),_['isNil'](_0x273a11)?'':_0x273a11[_0x8a66('0x22')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x8a66('0x67')};}if(_[_0x8a66('0x5f')](_0x2fb05d[_0x8a66('0x6')])){ut['logger'](_0x8a66('0x68'),JSON[_0x8a66('0x3d')](_0x2fb05d));return{'isValid':![],'message':_0x8a66('0x69')};}if(_[_0x8a66('0x5f')](_0x2fb05d[_0x8a66('0x3')])){ut['logger'](_0x8a66('0x6a'),JSON[_0x8a66('0x3d')](_0x2fb05d));return{'isValid':![],'message':_0x8a66('0x6b')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x8a66('0x6c')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index af5b6c2..a95fe3a 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 _0x1a10=['preview','../rpc/faxAccount','notify','catch','[Notify]\x20','util'];(function(_0x376bbe,_0x15f5a0){var _0x2f5ea2=function(_0x33a18f){while(--_0x33a18f){_0x376bbe['push'](_0x376bbe['shift']());}};_0x2f5ea2(++_0x15f5a0);}(_0x1a10,0x15b));var _0x01a1=function(_0x32c91f,_0x3454e8){_0x32c91f=_0x32c91f-0x0;var _0x26c6ec=_0x1a10[_0x32c91f];return _0x26c6ec;};'use strict';var util=require(_0x01a1('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x01a1('0x1'));var _=require('lodash');var faxAccount=require(_0x01a1('0x2'));function loggerCatch(_0x51da19){return function(_0x47af8f){logger['error'](_0x51da19,util['inspect'](_0x47af8f,{'showHidden':![],'depth':null}));};}exports[_0x01a1('0x3')]=function(_0x53348f,_0xabee0b){return BPromise['resolve']()['then'](faxAccount[_0x01a1('0x3')](_0x53348f,_0xabee0b))[_0x01a1('0x4')](loggerCatch(_0x01a1('0x5')));}; \ No newline at end of file +var _0xab01=['preview','lodash','../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xab01,0x1ad));var _0x1ab0=function(_0x1722f9,_0x33444c){_0x1722f9=_0x1722f9-0x0;var _0x396946=_0xab01[_0x1722f9];return _0x396946;};'use strict';var util=require(_0x1ab0('0x0'));var BPromise=require(_0x1ab0('0x1'));var logger=require(_0x1ab0('0x2'))(_0x1ab0('0x3'));var _=require(_0x1ab0('0x4'));var faxAccount=require(_0x1ab0('0x5'));function loggerCatch(_0x2e70bc){return function(_0x90469){logger[_0x1ab0('0x6')](_0x2e70bc,util['inspect'](_0x90469,{'showHidden':![],'depth':null}));};}exports[_0x1ab0('0x7')]=function(_0x5f4a1f,_0x2e0438){return BPromise[_0x1ab0('0x8')]()[_0x1ab0('0x9')](faxAccount[_0x1ab0('0x7')](_0x5f4a1f,_0x2e0438))[_0x1ab0('0xa')](loggerCatch(_0x1ab0('0xb')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 81a55d7..f5d45ee 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 _0x267f=['inspect','util','../../../../config/logger','fax','child_process','execute','info','Exec\x20gs'];(function(_0x5b40ed,_0x6a237){var _0x2e0440=function(_0x53b6f7){while(--_0x53b6f7){_0x5b40ed['push'](_0x5b40ed['shift']());}};_0x2e0440(++_0x6a237);}(_0x267f,0x99));var _0xf267=function(_0x50f74,_0x5a7a23){_0x50f74=_0x50f74-0x0;var _0x5cdada=_0x267f[_0x50f74];return _0x5cdada;};'use strict';var util=require(_0xf267('0x0'));var logger=require(_0xf267('0x1'))(_0xf267('0x2'));var BPromise=require('bluebird');var exec=require(_0xf267('0x3'))['exec'];exports[_0xf267('0x4')]=function(_0x26ed5c){return new BPromise(function(_0x532a81,_0x1ffd27){exec(_0x26ed5c,function(_0x255d1b,_0x47fc70,_0xf59788){logger[_0xf267('0x5')](_0xf267('0x6'),_0x47fc70);if(_0x255d1b){logger[_0xf267('0x5')](_0xf267('0x6'),'\x20Error\x20:',util[_0xf267('0x7')](_0x255d1b,{'showHidden':![],'depth':null}),_0x47fc70,_0xf59788);_0x1ffd27(_0x255d1b);}_0x532a81(_0x47fc70);});});}; \ No newline at end of file +var _0x1aab=['bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0xfc3f90,_0x5b0e68){var _0x584a43=function(_0x578d0a){while(--_0x578d0a){_0xfc3f90['push'](_0xfc3f90['shift']());}};_0x584a43(++_0x5b0e68);}(_0x1aab,0x151));var _0xb1aa=function(_0x1f120c,_0x22cd8f){_0x1f120c=_0x1f120c-0x0;var _0x3f43f5=_0x1aab[_0x1f120c];return _0x3f43f5;};'use strict';var util=require(_0xb1aa('0x0'));var logger=require(_0xb1aa('0x1'))(_0xb1aa('0x2'));var BPromise=require(_0xb1aa('0x3'));var exec=require(_0xb1aa('0x4'))['exec'];exports[_0xb1aa('0x5')]=function(_0x159d9b){return new BPromise(function(_0x14481a,_0x13cf5c){exec(_0x159d9b,function(_0x9d9ac1,_0x9bca1d,_0x498618){logger[_0xb1aa('0x6')](_0xb1aa('0x7'),_0x9bca1d);if(_0x9d9ac1){logger[_0xb1aa('0x6')](_0xb1aa('0x7'),_0xb1aa('0x8'),util[_0xb1aa('0x9')](_0x9d9ac1,{'showHidden':![],'depth':null}),_0x9bca1d,_0x498618);_0x13cf5c(_0x9d9ac1);}_0x14481a(_0x9bca1d);});});}; \ 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 37991c5..2867b3f 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 _0xa89c=['headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','format','util','moment','fax','message','logger','inspect','ecm'];(function(_0x1e6fa6,_0x459d6f){var _0x35ec83=function(_0x4543f6){while(--_0x4543f6){_0x1e6fa6['push'](_0x1e6fa6['shift']());}};_0x35ec83(++_0x459d6f);}(_0xa89c,0xbf));var _0xca89=function(_0x1931e4,_0x183bca){_0x1931e4=_0x1931e4-0x0;var _0x2042ac=_0xa89c[_0x1931e4];return _0x2042ac;};'use strict';var util=require(_0xca89('0x0'));var _=require('lodash');var moment=require(_0xca89('0x1'));var logger=require('../../../../config/logger')(_0xca89('0x2'));exports[_0xca89('0x3')]=function(_0x1e1ee7){return{'message':_0x1e1ee7};};exports[_0xca89('0x4')]=function(_0x35bd6e,_0xd5e4e7){logger['info'](_0x35bd6e,util[_0xca89('0x5')](_0xd5e4e7,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x5571ac,_0x49745f){var _0x40a072={'XMF-ECM':_0x49745f[_0xca89('0x6')],'XMF-HEADERINFO':_0x49745f[_0xca89('0x7')],'XMF-MINRATE':_0x49745f['minrate'],'XMF-MAXRATE':_0x49745f[_0xca89('0x8')],'XMF-MODEM':util['format'](_0xca89('0x9'),_0x49745f[_0xca89('0xa')]),'XMF-GATEWAY':_0x49745f[_0xca89('0xb')],'XMF-FAXDETECT':_0x49745f[_0xca89('0xc')],'XMF-T38TIMEOUT':_0x49745f[_0xca89('0xd')],'XMF-LOCALSTATIONID':_0x49745f[_0xca89('0xe')],'XMF-PATH':_0x5571ac[_0xca89('0xf')]};return _0x40a072;};exports[_0xca89('0x10')]=function(_0x67f39c,_0x17951c){return{'actionid':_0x67f39c[_0xca89('0x11')],'action':'originate','channel':_0x67f39c[_0xca89('0x12')],'Exten':_0xca89('0x13'),'Context':_0xca89('0x14'),'Priority':'1','callerid':util[_0xca89('0x15')]('\x22%s\x22\x20<%s>',_0x67f39c[_0xca89('0x7')]?_0x67f39c['headerinfo']:'',_0x67f39c['localstationid']),'variable':_0x17951c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x67f39c['uniqueid']};}; \ No newline at end of file +var _0xadc2=['from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','util','moment','../../../../config/logger','fax','logger','inspect','ecm','minrate','maxrate','format','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax'];(function(_0x14326e,_0x5c55e3){var _0x57f9e9=function(_0x17b5df){while(--_0x17b5df){_0x14326e['push'](_0x14326e['shift']());}};_0x57f9e9(++_0x5c55e3);}(_0xadc2,0x77));var _0x2adc=function(_0xa515c,_0x57ca32){_0xa515c=_0xa515c-0x0;var _0x4b737e=_0xadc2[_0xa515c];return _0x4b737e;};'use strict';var util=require(_0x2adc('0x0'));var _=require('lodash');var moment=require(_0x2adc('0x1'));var logger=require(_0x2adc('0x2'))(_0x2adc('0x3'));exports['message']=function(_0x1b341f){return{'message':_0x1b341f};};exports[_0x2adc('0x4')]=function(_0x56095a,_0x14a4e1){logger['info'](_0x56095a,util[_0x2adc('0x5')](_0x14a4e1,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1988c4,_0x8d1c5a){var _0xe187a7={'XMF-ECM':_0x8d1c5a[_0x2adc('0x6')],'XMF-HEADERINFO':_0x8d1c5a['headerinfo'],'XMF-MINRATE':_0x8d1c5a[_0x2adc('0x7')],'XMF-MAXRATE':_0x8d1c5a[_0x2adc('0x8')],'XMF-MODEM':util[_0x2adc('0x9')](_0x2adc('0xa'),_0x8d1c5a[_0x2adc('0xb')]),'XMF-GATEWAY':_0x8d1c5a['gateway'],'XMF-FAXDETECT':_0x8d1c5a['faxdetect'],'XMF-T38TIMEOUT':_0x8d1c5a[_0x2adc('0xc')],'XMF-LOCALSTATIONID':_0x8d1c5a[_0x2adc('0xd')],'XMF-PATH':_0x1988c4[_0x2adc('0xe')]};return _0xe187a7;};exports[_0x2adc('0xf')]=function(_0xc024cd,_0x4aa628){return{'actionid':_0xc024cd['uniqueid'],'action':_0x2adc('0x10'),'channel':_0xc024cd[_0x2adc('0x11')],'Exten':_0x2adc('0x12'),'Context':_0x2adc('0x13'),'Priority':'1','callerid':util[_0x2adc('0x9')](_0x2adc('0x14'),_0xc024cd[_0x2adc('0x15')]?_0xc024cd[_0x2adc('0x15')]:'',_0xc024cd[_0x2adc('0xd')]),'variable':_0x4aa628,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xc024cd[_0x2adc('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 8cbe512..77dbb3f 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 _0x1215=['then','getAgents','getTelephones','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','[index.js][main]','util','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','../../config/logger','ami','get','hour','resolve'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1215,0x1b0));var _0x5121=function(_0xb46ca8,_0x4f87be){_0xb46ca8=_0xb46ca8-0x0;var _0x52ed62=_0x1215[_0xb46ca8];return _0x52ed62;};'use strict';var util=require(_0x5121('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x5121('0x1'));var Report=require('./report');var Acw=require(_0x5121('0x2'));var Trigger=require(_0x5121('0x3'));var Dialer=require(_0x5121('0x4'));var Preview=require(_0x5121('0x5'));var Fax=require(_0x5121('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0x5121('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x5121('0x8'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x5121('0x9'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5121('0xa'));var faxAccount=require(_0x5121('0xb'));var zendesk=require(_0x5121('0xc'));var salesforce=require(_0x5121('0xd'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x5121('0xe'));var desk=require(_0x5121('0xf'));var zoho=require(_0x5121('0x10'));var vtiger=require(_0x5121('0x11'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x5121('0x12'))(_0x5121('0x13'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5121('0x14')](_0x5121('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x5121('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x5121('0x16')]()[_0x5121('0x17')](user[_0x5121('0x18')]())[_0x5121('0x17')](realtime['initAgents']())['then'](user[_0x5121('0x19')]())[_0x5121('0x17')](realtime['initTelephones']())['then'](trunk['getTrunks']())['then'](realtime[_0x5121('0x1a')]())[_0x5121('0x17')](voiceQueue[_0x5121('0x1b')]())[_0x5121('0x17')](realtime['initVoiceQueues']())['then'](trigger[_0x5121('0x1c')]())[_0x5121('0x17')](realtime['initTriggers']())['then'](template[_0x5121('0x1d')]())[_0x5121('0x17')](realtime[_0x5121('0x1e')]())['then'](zendesk[_0x5121('0x1f')]())[_0x5121('0x17')](realtime[_0x5121('0x20')]())[_0x5121('0x17')](salesforce['getSalesforceAccounts']())[_0x5121('0x17')](realtime[_0x5121('0x21')]())[_0x5121('0x17')](sugarcrm[_0x5121('0x22')]())[_0x5121('0x17')](realtime[_0x5121('0x23')]())[_0x5121('0x17')](freshdesk[_0x5121('0x24')]())['then'](realtime[_0x5121('0x25')]())[_0x5121('0x17')](desk[_0x5121('0x26')]())['then'](realtime[_0x5121('0x27')]())[_0x5121('0x17')](zoho['getZohoAccounts']())['then'](realtime[_0x5121('0x28')]())[_0x5121('0x17')](vtiger[_0x5121('0x29')]())[_0x5121('0x17')](realtime[_0x5121('0x2a')]())[_0x5121('0x17')](freshsales['getFreshsalesAccounts']())[_0x5121('0x17')](realtime[_0x5121('0x2b')]())[_0x5121('0x17')](servicenow[_0x5121('0x2c')]())[_0x5121('0x17')](realtime[_0x5121('0x2d')]())[_0x5121('0x17')](dynamics365[_0x5121('0x2e')]())[_0x5121('0x17')](realtime[_0x5121('0x2f')]())[_0x5121('0x17')](campaign[_0x5121('0x30')]())[_0x5121('0x17')](realtime[_0x5121('0x31')]())[_0x5121('0x17')](voiceExtension[_0x5121('0x32')]())[_0x5121('0x17')](realtime[_0x5121('0x33')]())[_0x5121('0x17')](faxAccount[_0x5121('0x34')]())[_0x5121('0x17')](realtime[_0x5121('0x35')]())[_0x5121('0x17')](function(){return realtime;});}function initParams(){return Promise[_0x5121('0x16')]()[_0x5121('0x17')](voiceQueueReport[_0x5121('0x36')]())[_0x5121('0x17')](realtime[_0x5121('0x37')]())[_0x5121('0x17')](cmHopperHistory[_0x5121('0x38')]())['then'](realtime[_0x5121('0x39')]())[_0x5121('0x17')](cmHopperHistory[_0x5121('0x3a')]())[_0x5121('0x17')](realtime[_0x5121('0x3b')]())[_0x5121('0x17')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x5121('0x3c')]())[_0x5121('0x3d')](function(_0x12bedb){logger[_0x5121('0x3e')]('[index.js][initParams]',util[_0x5121('0x3f')](_0x12bedb,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x5121('0x17')](function(){return initParams();})[_0x5121('0x17')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3d5bda){logger[_0x5121('0x3e')](_0x5121('0x40'),util['inspect'](_0x3d5bda,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x3f94=['./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','getTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','inspect','listen','[index.js][main]','moment','./realtime','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trigger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3f94,0x18f));var _0x43f9=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x3f94[_0x468b0f];return _0x3e74d9;};'use strict';var util=require('util');var moment=require(_0x43f9('0x0'));var server=require('./server');var Realtime=require(_0x43f9('0x1'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x43f9('0x2'));var Dialer=require(_0x43f9('0x3'));var Preview=require(_0x43f9('0x4'));var Fax=require(_0x43f9('0x5'));var user=require(_0x43f9('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x43f9('0x7'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x43f9('0x8'));var template=require('./rpc/template');var cmHopperHistory=require(_0x43f9('0x9'));var campaign=require(_0x43f9('0xa'));var voiceExtension=require(_0x43f9('0xb'));var faxAccount=require(_0x43f9('0xc'));var zendesk=require(_0x43f9('0xd'));var salesforce=require(_0x43f9('0xe'));var sugarcrm=require(_0x43f9('0xf'));var freshdesk=require(_0x43f9('0x10'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x43f9('0x11'));var vtiger=require(_0x43f9('0x12'));var freshsales=require(_0x43f9('0x13'));var servicenow=require(_0x43f9('0x14'));var dynamics365=require(_0x43f9('0x15'));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(_0x43f9('0x16'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x43f9('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x43f9('0x17')](_0x43f9('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x43f9('0x19')]()[_0x43f9('0x1a')](user[_0x43f9('0x1b')]())['then'](realtime[_0x43f9('0x1c')]())['then'](user[_0x43f9('0x1d')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x1e')]())[_0x43f9('0x1a')](trunk['getTrunks']())[_0x43f9('0x1a')](realtime[_0x43f9('0x1f')]())['then'](voiceQueue[_0x43f9('0x20')]())[_0x43f9('0x1a')](realtime['initVoiceQueues']())[_0x43f9('0x1a')](trigger[_0x43f9('0x21')]())[_0x43f9('0x1a')](realtime['initTriggers']())[_0x43f9('0x1a')](template[_0x43f9('0x22')]())['then'](realtime['initTemplates']())['then'](zendesk[_0x43f9('0x23')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x24')]())[_0x43f9('0x1a')](salesforce[_0x43f9('0x25')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x26')]())[_0x43f9('0x1a')](sugarcrm[_0x43f9('0x27')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x28')]())[_0x43f9('0x1a')](freshdesk[_0x43f9('0x29')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x2a')]())[_0x43f9('0x1a')](desk[_0x43f9('0x2b')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x2c')]())['then'](zoho[_0x43f9('0x2d')]())['then'](realtime[_0x43f9('0x2e')]())[_0x43f9('0x1a')](vtiger['getVtigerAccounts']())['then'](realtime[_0x43f9('0x2f')]())[_0x43f9('0x1a')](freshsales[_0x43f9('0x30')]())[_0x43f9('0x1a')](realtime['initFreshsalesAccounts']())[_0x43f9('0x1a')](servicenow[_0x43f9('0x31')]())[_0x43f9('0x1a')](realtime['initServicenowAccounts']())[_0x43f9('0x1a')](dynamics365[_0x43f9('0x32')]())[_0x43f9('0x1a')](realtime['initDynamics365Accounts']())['then'](campaign[_0x43f9('0x33')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x34')]())['then'](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x43f9('0x35')]())[_0x43f9('0x1a')](faxAccount[_0x43f9('0x36')]())['then'](realtime[_0x43f9('0x37')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x43f9('0x1a')](voiceQueueReport[_0x43f9('0x38')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x39')]())[_0x43f9('0x1a')](cmHopperHistory[_0x43f9('0x3a')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x3b')]())[_0x43f9('0x1a')](cmHopperHistory[_0x43f9('0x3c')]())[_0x43f9('0x1a')](realtime[_0x43f9('0x3d')]())[_0x43f9('0x1a')](voiceCallReport[_0x43f9('0x3e')]())[_0x43f9('0x1a')](realtime['initVoiceCallReports']())[_0x43f9('0x3f')](function(_0x2abdfe){logger[_0x43f9('0x40')]('[index.js][initParams]',util[_0x43f9('0x41')](_0x2abdfe,{'showHidden':![],'depth':null}));});}function main(){return server[_0x43f9('0x42')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x43f9('0x1a')](function(){return initParams();})[_0x43f9('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x43f9('0x3f')](function(_0x36bad5){logger['error'](_0x43f9('0x43'),util[_0x43f9('0x41')](_0x36bad5,{'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 36acf24..ab96d39 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 _0x0f3e=['status','unknown','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','updateStatusRealtime','not_inuse','idle','talking','voiceStatus','statePause','toNumber','onhold','stringify','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime'];(function(_0x2f8b74,_0x550f71){var _0x1b6a96=function(_0x55ac51){while(--_0x55ac51){_0x2f8b74['push'](_0x2f8b74['shift']());}};_0x1b6a96(++_0x550f71);}(_0x0f3e,0x92));var _0xe0f3=function(_0x272e71,_0x3aeff4){_0x272e71=_0x272e71-0x0;var _0x2f1ff3=_0x0f3e[_0x272e71];return _0x2f1ff3;};'use strict';var _=require('lodash');var util=require(_0xe0f3('0x0'));var moment=require(_0xe0f3('0x1'));var md5=require(_0xe0f3('0x2'));var Redis=require(_0xe0f3('0x3'));var config=require('../../../config/environment');config[_0xe0f3('0x4')]=_[_0xe0f3('0x5')](config[_0xe0f3('0x4')],{'host':_0xe0f3('0x6'),'port':0x18eb});var io=require(_0xe0f3('0x7'))(new Redis(config[_0xe0f3('0x4')]));function Agent(_0x5a8357){this['id']=_0x5a8357['id']||0x0;this['name']=_0x5a8357[_0xe0f3('0x8')]||'';this[_0xe0f3('0x9')]=_0x5a8357[_0xe0f3('0x9')]||'';this[_0xe0f3('0xa')]=_0x5a8357[_0xe0f3('0xa')]||'';this[_0xe0f3('0xb')]=_0x5a8357['fullname']||'';this[_0xe0f3('0xc')]='unknown';this[_0xe0f3('0xd')]=0x0;this[_0xe0f3('0xe')]=_0xe0f3('0xf');this[_0xe0f3('0x10')]='';this[_0xe0f3('0x11')]='';this[_0xe0f3('0x12')]='';this[_0xe0f3('0x13')]='';this[_0xe0f3('0x14')]=_0x5a8357['online']||![];this['voiceStatus']=_0xe0f3('0xf');this[_0xe0f3('0x15')]=0x0;this[_0xe0f3('0x16')]='';this[_0xe0f3('0x17')]='';this['onhold']=![];this[_0xe0f3('0x18')]=![];this[_0xe0f3('0x2')]='';}Agent['prototype'][_0xe0f3('0x19')]=function(_0xd61883){var _0x325442;if(_0xd61883&&_0xd61883['state']){_0x325442=_0xd61883[_0xe0f3('0xc')]['toLowerCase']();switch(_0x325442){case _0xe0f3('0x1a'):_0x325442=_0xe0f3('0x1b');break;case'inuse':_0x325442=_0xe0f3('0x1c');break;}}if(_0x325442&&this[_0xe0f3('0x1d')]!==_0x325442||_0xd61883[_0xe0f3('0x1e')]){this['voiceStatusTime']=_[_0xe0f3('0x1f')](moment()['format']('x'));}if(_0x325442){this[_0xe0f3('0x1d')]=_0x325442;}var _0x23eae3={'id':this['id'],'name':this[_0xe0f3('0x8')],'email':this[_0xe0f3('0x9')],'accountcode':this[_0xe0f3('0xa')],'fullname':this['fullname'],'state':this[_0xe0f3('0xc')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0xe0f3('0x10')],'online':this[_0xe0f3('0x14')],'voiceStatus':this[_0xe0f3('0x1d')],'voiceStatusTime':this[_0xe0f3('0x15')],'voiceStatusCallerIdNumber':this[_0xe0f3('0x16')],'voiceStatusQueue':this[_0xe0f3('0x17')],'interface':this[_0xe0f3('0x13')],'onhold':this[_0xe0f3('0x20')]};var _0x535f11=md5(JSON[_0xe0f3('0x21')](_0x23eae3));if(this['md5']!==_0x535f11){this[_0xe0f3('0x2')]=_0x535f11;io['to'](util[_0xe0f3('0x22')](_0xe0f3('0x23'),_0x23eae3[_0xe0f3('0x8')]))['emit'](_0xe0f3('0x24'),_0x23eae3);io[_0xe0f3('0x25')](_0xe0f3('0x26'),_0x23eae3);}};module[_0xe0f3('0x27')]=Agent; \ No newline at end of file +var _0x701c=['moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','idle','statePause','format','address','voiceStatusTime','stringify','user:%s','emit','user:presence','exports','lodash'];(function(_0x2b0383,_0x5b1286){var _0x2d87e6=function(_0x452361){while(--_0x452361){_0x2b0383['push'](_0x2b0383['shift']());}};_0x2d87e6(++_0x5b1286);}(_0x701c,0x167));var _0xc701=function(_0x20025e,_0x44c8e1){_0x20025e=_0x20025e-0x0;var _0x4a5ac4=_0x701c[_0x20025e];return _0x4a5ac4;};'use strict';var _=require(_0xc701('0x0'));var util=require('util');var moment=require(_0xc701('0x1'));var md5=require(_0xc701('0x2'));var Redis=require(_0xc701('0x3'));var config=require(_0xc701('0x4'));config[_0xc701('0x5')]=_[_0xc701('0x6')](config[_0xc701('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc701('0x7'))(new Redis(config['redis']));function Agent(_0x1d3c17){this['id']=_0x1d3c17['id']||0x0;this[_0xc701('0x8')]=_0x1d3c17[_0xc701('0x8')]||'';this[_0xc701('0x9')]=_0x1d3c17['email']||'';this[_0xc701('0xa')]=_0x1d3c17[_0xc701('0xa')]||'';this['fullname']=_0x1d3c17[_0xc701('0xb')]||'';this[_0xc701('0xc')]=_0xc701('0xd');this[_0xc701('0xe')]=0x0;this[_0xc701('0xf')]=_0xc701('0xd');this['address']='';this['phone']='';this[_0xc701('0x10')]='';this[_0xc701('0x11')]='';this[_0xc701('0x12')]=_0x1d3c17[_0xc701('0x12')]||![];this[_0xc701('0x13')]='unknown';this['voiceStatusTime']=0x0;this[_0xc701('0x14')]='';this[_0xc701('0x15')]='';this[_0xc701('0x16')]=![];this['local']=![];this['md5']='';}Agent[_0xc701('0x17')][_0xc701('0x18')]=function(_0x3570c8){var _0x4e17ad;if(_0x3570c8&&_0x3570c8[_0xc701('0xc')]){_0x4e17ad=_0x3570c8[_0xc701('0xc')][_0xc701('0x19')]();switch(_0x4e17ad){case'not_inuse':_0x4e17ad=_0xc701('0x1a');break;case'inuse':_0x4e17ad='talking';break;}}if(_0x4e17ad&&this['voiceStatus']!==_0x4e17ad||_0x3570c8[_0xc701('0x1b')]){this['voiceStatusTime']=_['toNumber'](moment()[_0xc701('0x1c')]('x'));}if(_0x4e17ad){this[_0xc701('0x13')]=_0x4e17ad;}var _0x4ce70e={'id':this['id'],'name':this[_0xc701('0x8')],'email':this[_0xc701('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xc701('0xb')],'state':this[_0xc701('0xc')],'stateTime':this['stateTime'],'status':this[_0xc701('0xf')],'address':this[_0xc701('0x1d')],'online':this[_0xc701('0x12')],'voiceStatus':this[_0xc701('0x13')],'voiceStatusTime':this[_0xc701('0x1e')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xc701('0x15')],'interface':this[_0xc701('0x11')],'onhold':this['onhold']};var _0x111870=md5(JSON[_0xc701('0x1f')](_0x4ce70e));if(this[_0xc701('0x2')]!==_0x111870){this['md5']=_0x111870;io['to'](util['format'](_0xc701('0x20'),_0x4ce70e[_0xc701('0x8')]))[_0xc701('0x21')]('user:save',_0x4ce70e);io[_0xc701('0x21')](_0xc701('0x22'),_0x4ce70e);}};module[_0xc701('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ac8b814..7be2bf0 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 _0x0b71=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x69a3c1,_0x4dfbff){var _0x5cdf04=function(_0x4ade30){while(--_0x4ade30){_0x69a3c1['push'](_0x69a3c1['shift']());}};_0x5cdf04(++_0x4dfbff);}(_0x0b71,0x65));var _0x10b7=function(_0xaaec73,_0x3b0d5a){_0xaaec73=_0xaaec73-0x0;var _0xfa096e=_0x0b71[_0xaaec73];return _0xfa096e;};'use strict';function Campaign(_0x1fc8da){this['id']=_0x1fc8da['id']||0x0;this[_0x10b7('0x0')]=_0x1fc8da[_0x10b7('0x0')]||'';this[_0x10b7('0x1')]=_0x1fc8da[_0x10b7('0x1')]||_0x10b7('0x2');this[_0x10b7('0x3')]=0x0;this[_0x10b7('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x10b7('0x5')]=0x0;this[_0x10b7('0x6')]='';this[_0x10b7('0x7')]=!![];this['active']=_0x1fc8da[_0x10b7('0x8')];this['limitCalls']=_0x1fc8da[_0x10b7('0x9')];this['dialTimezone']=_0x1fc8da[_0x10b7('0xa')]||null;this[_0x10b7('0xb')]=_0x1fc8da['dialGlobalInterval']?_0x1fc8da[_0x10b7('0xb')]:null;this['dialOriginateCallerIdName']=_0x1fc8da['dialOriginateCallerIdName'];this[_0x10b7('0xc')]=_0x1fc8da[_0x10b7('0xc')];this[_0x10b7('0xd')]=_0x1fc8da['dialOriginateTimeout']||0x1e;this[_0x10b7('0xe')]=_0x1fc8da[_0x10b7('0xe')];this[_0x10b7('0xf')]=_0x1fc8da[_0x10b7('0xf')];this[_0x10b7('0x10')]=_0x1fc8da[_0x10b7('0x10')];this[_0x10b7('0x11')]=_0x1fc8da[_0x10b7('0x11')];this[_0x10b7('0x12')]=_0x1fc8da[_0x10b7('0x12')];this['dialNoAnswerRetryFrequency']=_0x1fc8da['dialNoAnswerRetryFrequency'];this[_0x10b7('0x13')]=_0x1fc8da[_0x10b7('0x13')];this[_0x10b7('0x14')]=_0x1fc8da[_0x10b7('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1fc8da[_0x10b7('0x15')]||0x96;this[_0x10b7('0x16')]=_0x1fc8da[_0x10b7('0x16')]||0x3;this['dialDropRetryFrequency']=_0x1fc8da[_0x10b7('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x1fc8da['dialAbandonedMaxRetry']||0x3;this[_0x10b7('0x18')]=_0x1fc8da['dialAbandonedRetryFrequency']||0x96;this[_0x10b7('0x19')]=_0x1fc8da[_0x10b7('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x1fc8da[_0x10b7('0x1a')]||0x96;this[_0x10b7('0x1b')]=_0x1fc8da[_0x10b7('0x1b')]||0x3;this[_0x10b7('0x1c')]=_0x1fc8da[_0x10b7('0x1c')]||0x96;this[_0x10b7('0x1d')]=_0x1fc8da['dialOrderByScheduledAt']||'DESC';this[_0x10b7('0x1e')]=_0x1fc8da['dialPrefix']||undefined;this[_0x10b7('0x1f')]=_0x1fc8da[_0x10b7('0x1f')]||undefined;this['dialCutDigit']=_0x1fc8da['dialCutDigit']||undefined;this['TrunkBackup']=_0x1fc8da[_0x10b7('0x20')]?_0x1fc8da[_0x10b7('0x20')]:undefined;this[_0x10b7('0x21')]=_0x1fc8da[_0x10b7('0x21')]?_0x1fc8da[_0x10b7('0x21')]:undefined;this[_0x10b7('0x22')]=_0x1fc8da[_0x10b7('0x22')]?_0x1fc8da['Interval']:undefined;this[_0x10b7('0x23')]=_0x1fc8da[_0x10b7('0x23')]?_0x1fc8da[_0x10b7('0x23')]:undefined;this[_0x10b7('0x24')]=_0x1fc8da['SquareProject']?_0x1fc8da['SquareProject'][_0x10b7('0x0')]:undefined;this[_0x10b7('0x25')]=_0x1fc8da[_0x10b7('0x25')]||![];this[_0x10b7('0x26')]=_0x1fc8da[_0x10b7('0x26')];this['dialAMDGreeting']=_0x1fc8da[_0x10b7('0x27')];this[_0x10b7('0x28')]=_0x1fc8da[_0x10b7('0x28')];this[_0x10b7('0x29')]=_0x1fc8da['dialAMDTotalAnalysisTime'];this[_0x10b7('0x2a')]=_0x1fc8da[_0x10b7('0x2a')];this[_0x10b7('0x2b')]=_0x1fc8da[_0x10b7('0x2b')];this[_0x10b7('0x2c')]=_0x1fc8da[_0x10b7('0x2c')];this[_0x10b7('0x2d')]=_0x1fc8da['dialAMDSilenceThreshold'];this[_0x10b7('0x2e')]=_0x1fc8da['dialAMDMaximumWordLength'];}module[_0x10b7('0x2f')]=Campaign; \ No newline at end of file +var _0x191f=['TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','type','campaign','originated','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x191f,0x9b));var _0xf191=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0x191f[_0x3f6b1b];return _0x4a3d2b;};'use strict';function Campaign(_0x2a1fbb){this['id']=_0x2a1fbb['id']||0x0;this['name']=_0x2a1fbb['name']||'';this[_0xf191('0x0')]=_0x2a1fbb[_0xf191('0x0')]||_0xf191('0x1');this[_0xf191('0x2')]=0x0;this[_0xf191('0x3')]=0x0;this[_0xf191('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0xf191('0x5')]=!![];this[_0xf191('0x6')]=_0x2a1fbb[_0xf191('0x6')];this[_0xf191('0x7')]=_0x2a1fbb[_0xf191('0x7')];this[_0xf191('0x8')]=_0x2a1fbb['dialTimezone']||null;this['dialGlobalInterval']=_0x2a1fbb[_0xf191('0x9')]?_0x2a1fbb[_0xf191('0x9')]:null;this[_0xf191('0xa')]=_0x2a1fbb[_0xf191('0xa')];this[_0xf191('0xb')]=_0x2a1fbb[_0xf191('0xb')];this[_0xf191('0xc')]=_0x2a1fbb[_0xf191('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x2a1fbb[_0xf191('0xd')];this['dialCongestionRetryFrequency']=_0x2a1fbb[_0xf191('0xe')];this[_0xf191('0xf')]=_0x2a1fbb[_0xf191('0xf')];this[_0xf191('0x10')]=_0x2a1fbb[_0xf191('0x10')];this[_0xf191('0x11')]=_0x2a1fbb['dialNoAnswerMaxRetry'];this[_0xf191('0x12')]=_0x2a1fbb['dialNoAnswerRetryFrequency'];this[_0xf191('0x13')]=_0x2a1fbb['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x2a1fbb['dialNoSuchNumberMaxRetry']||0x3;this[_0xf191('0x14')]=_0x2a1fbb[_0xf191('0x14')]||0x96;this[_0xf191('0x15')]=_0x2a1fbb[_0xf191('0x15')]||0x3;this[_0xf191('0x16')]=_0x2a1fbb[_0xf191('0x16')]||0x96;this[_0xf191('0x17')]=_0x2a1fbb[_0xf191('0x17')]||0x3;this[_0xf191('0x18')]=_0x2a1fbb[_0xf191('0x18')]||0x96;this[_0xf191('0x19')]=_0x2a1fbb[_0xf191('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x2a1fbb['dialMachineRetryFrequency']||0x96;this[_0xf191('0x1a')]=_0x2a1fbb[_0xf191('0x1a')]||0x3;this[_0xf191('0x1b')]=_0x2a1fbb[_0xf191('0x1b')]||0x96;this[_0xf191('0x1c')]=_0x2a1fbb['dialOrderByScheduledAt']||_0xf191('0x1d');this[_0xf191('0x1e')]=_0x2a1fbb[_0xf191('0x1e')]||undefined;this[_0xf191('0x1f')]=_0x2a1fbb[_0xf191('0x1f')]||undefined;this[_0xf191('0x20')]=_0x2a1fbb[_0xf191('0x20')]||undefined;this[_0xf191('0x21')]=_0x2a1fbb[_0xf191('0x21')]?_0x2a1fbb[_0xf191('0x21')]:undefined;this[_0xf191('0x22')]=_0x2a1fbb[_0xf191('0x22')]?_0x2a1fbb[_0xf191('0x22')]:undefined;this[_0xf191('0x23')]=_0x2a1fbb[_0xf191('0x23')]?_0x2a1fbb[_0xf191('0x23')]:undefined;this[_0xf191('0x24')]=_0x2a1fbb['SquareProject']?_0x2a1fbb[_0xf191('0x24')]:undefined;this[_0xf191('0x25')]=_0x2a1fbb['SquareProject']?_0x2a1fbb['SquareProject']['name']:undefined;this[_0xf191('0x26')]=_0x2a1fbb[_0xf191('0x26')]||![];this[_0xf191('0x27')]=_0x2a1fbb['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x2a1fbb['dialAMDGreeting'];this[_0xf191('0x28')]=_0x2a1fbb['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x2a1fbb[_0xf191('0x29')];this['dialAMDMinWordLength']=_0x2a1fbb[_0xf191('0x2a')];this[_0xf191('0x2b')]=_0x2a1fbb[_0xf191('0x2b')];this[_0xf191('0x2c')]=_0x2a1fbb[_0xf191('0x2c')];this[_0xf191('0x2d')]=_0x2a1fbb[_0xf191('0x2d')];this[_0xf191('0x2e')]=_0x2a1fbb[_0xf191('0x2e')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 80aa3a3..17fc389 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 _0x08d3=['duration','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x08d3,0x119));var _0x308d=function(_0x5a53d8,_0x289696){_0x5a53d8=_0x5a53d8-0x0;var _0x58f920=_0x08d3[_0x5a53d8];return _0x58f920;};'use strict';function Channel(){this[_0x308d('0x0')]=null;this[_0x308d('0x1')]='';this[_0x308d('0x2')]='';this[_0x308d('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x308d('0x4')]=undefined;this[_0x308d('0x5')]=0x0;this[_0x308d('0x6')]='';this[_0x308d('0x7')]=0x0;this[_0x308d('0x8')]=0x0;this['exten']=0x0;this[_0x308d('0x9')]=![];this[_0x308d('0xa')]=null;this[_0x308d('0xb')]=null;this[_0x308d('0xc')]=![];this[_0x308d('0xd')]=![];this[_0x308d('0xe')]='';this[_0x308d('0xf')]='';this[_0x308d('0x10')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x308d('0x11')]=null;this[_0x308d('0x12')]=null;this[_0x308d('0x13')]=null;this['monitor']=![];this[_0x308d('0x14')]=null;this[_0x308d('0x15')]=null;this[_0x308d('0x16')]=[];this[_0x308d('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x308d('0x18')]=undefined;this[_0x308d('0x19')]=0x0;}module[_0x308d('0x1a')]=Channel; \ No newline at end of file +var _0x5352=['disposition','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','linkedid','answered','endtime','lastapplication','duration','billableseconds','type','tag'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x5352,0x1ea));var _0x2535=function(_0x22cc36,_0x2c8292){_0x22cc36=_0x22cc36-0x0;var _0x7fc85=_0x5352[_0x22cc36];return _0x7fc85;};'use strict';function Channel(){this[_0x2535('0x0')]=null;this[_0x2535('0x1')]='';this[_0x2535('0x2')]='';this[_0x2535('0x3')]=0x0;this[_0x2535('0x4')]='';this[_0x2535('0x5')]=undefined;this['connectedlinename']=undefined;this[_0x2535('0x6')]=0x0;this['context']='';this[_0x2535('0x7')]=0x0;this[_0x2535('0x8')]=0x0;this['exten']=0x0;this[_0x2535('0x9')]=![];this['answertime']=null;this[_0x2535('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x2535('0xb')]='';this['lastdata']='';this[_0x2535('0xc')]=0x0;this[_0x2535('0xd')]=0x0;this['holdtime']=0x0;this[_0x2535('0xe')]=null;this[_0x2535('0xf')]=null;this[_0x2535('0x10')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0x2535('0x11')]=[];this[_0x2535('0x12')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x2535('0x13')]=undefined;this[_0x2535('0x14')]=0x0;}module[_0x2535('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e6b1fb2..88a89ae 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 _0xd98b=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x28f33f,_0x45b63b){var _0x3443be=function(_0x4b231b){while(--_0x4b231b){_0x28f33f['push'](_0x28f33f['shift']());}};_0x3443be(++_0x45b63b);}(_0xd98b,0xa8));var _0xbd98=function(_0x441dd4,_0x582db9){_0x441dd4=_0x441dd4-0x0;var _0x54ea8b=_0xd98b[_0x441dd4];return _0x54ea8b;};'use strict';function DeskAccount(_0x3e0c02){this['id']=_0x3e0c02['id']||0x0;this[_0xbd98('0x0')]=_0x3e0c02['name']||'';this[_0xbd98('0x1')]=_0x3e0c02['username']||'';this[_0xbd98('0x2')]=_0x3e0c02[_0xbd98('0x2')]||'';this[_0xbd98('0x3')]=_0x3e0c02['authType']||'';this[_0xbd98('0x4')]=_0x3e0c02[_0xbd98('0x4')]||'';this[_0xbd98('0x5')]=_0x3e0c02[_0xbd98('0x5')]||'';this[_0xbd98('0x6')]=_0x3e0c02[_0xbd98('0x6')]||'';this['token']=_0x3e0c02[_0xbd98('0x7')]||'';this[_0xbd98('0x8')]=_0x3e0c02[_0xbd98('0x8')]||'';this[_0xbd98('0x9')]=_0x3e0c02[_0xbd98('0x9')]||'';this[_0xbd98('0xa')]=_0x3e0c02[_0xbd98('0xa')]||'';this[_0xbd98('0xb')]=_0x3e0c02[_0xbd98('0xb')]||{};}module[_0xbd98('0xc')]=DeskAccount; \ No newline at end of file +var _0x1701=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0x1701,0x103));var _0x1170=function(_0x553bf7,_0x4acdaa){_0x553bf7=_0x553bf7-0x0;var _0x24437f=_0x1701[_0x553bf7];return _0x24437f;};'use strict';function DeskAccount(_0x2dad95){this['id']=_0x2dad95['id']||0x0;this['name']=_0x2dad95[_0x1170('0x0')]||'';this[_0x1170('0x1')]=_0x2dad95['username']||'';this['remoteUri']=_0x2dad95[_0x1170('0x2')]||'';this[_0x1170('0x3')]=_0x2dad95[_0x1170('0x3')]||'';this[_0x1170('0x4')]=_0x2dad95['password']||'';this['consumerKey']=_0x2dad95[_0x1170('0x5')]||'';this[_0x1170('0x6')]=_0x2dad95[_0x1170('0x6')]||'';this[_0x1170('0x7')]=_0x2dad95[_0x1170('0x7')]||'';this[_0x1170('0x8')]=_0x2dad95['tokenSecret']||'';this[_0x1170('0x9')]=_0x2dad95['type']||'';this[_0x1170('0xa')]=_0x2dad95[_0x1170('0xa')]||'';this[_0x1170('0xb')]=_0x2dad95[_0x1170('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index e01a0aa..0767cc2 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 _0x5d33=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x5d33,0x118));var _0x35d3=function(_0x14c17f,_0xb4b92f){_0x14c17f=_0x14c17f-0x0;var _0x23dadc=_0x5d33[_0x14c17f];return _0x23dadc;};'use strict';function Dynamics365Account(_0x40f14a){this['id']=_0x40f14a['id']||0x0;this['name']=_0x40f14a[_0x35d3('0x0')]||'';this[_0x35d3('0x1')]=_0x40f14a[_0x35d3('0x1')]||'';this[_0x35d3('0x2')]=_0x40f14a[_0x35d3('0x2')]||'';this[_0x35d3('0x3')]=_0x40f14a[_0x35d3('0x3')]||'';this['tenantId']=_0x40f14a[_0x35d3('0x4')]||'';this[_0x35d3('0x5')]=_0x40f14a[_0x35d3('0x5')]||'';this[_0x35d3('0x6')]=_0x40f14a['clientSecret']||{};this[_0x35d3('0x7')]=_0x40f14a[_0x35d3('0x7')]||'';this[_0x35d3('0x8')]=_0x40f14a[_0x35d3('0x8')]||![];this[_0x35d3('0x9')]=_0x40f14a[_0x35d3('0x9')]||{};this['CloudProvider']=_0x40f14a[_0x35d3('0xa')]||{};}module[_0x35d3('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x4c1e=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x521df7,_0x277fd6){var _0x4b57b5=function(_0x345f75){while(--_0x345f75){_0x521df7['push'](_0x521df7['shift']());}};_0x4b57b5(++_0x277fd6);}(_0x4c1e,0x155));var _0xe4c1=function(_0x18a410,_0xa4811e){_0x18a410=_0x18a410-0x0;var _0x16ae87=_0x4c1e[_0x18a410];return _0x16ae87;};'use strict';function Dynamics365Account(_0x3fc38f){this['id']=_0x3fc38f['id']||0x0;this[_0xe4c1('0x0')]=_0x3fc38f[_0xe4c1('0x0')]||'';this[_0xe4c1('0x1')]=_0x3fc38f[_0xe4c1('0x1')]||'';this[_0xe4c1('0x2')]=_0x3fc38f['password']||'';this['remoteUri']=_0x3fc38f[_0xe4c1('0x3')]||'';this[_0xe4c1('0x4')]=_0x3fc38f[_0xe4c1('0x4')]||'';this['clientId']=_0x3fc38f[_0xe4c1('0x5')]||'';this[_0xe4c1('0x6')]=_0x3fc38f[_0xe4c1('0x6')]||{};this[_0xe4c1('0x7')]=_0x3fc38f['serverUrl']||'';this['modernAuthentication']=_0x3fc38f[_0xe4c1('0x8')]||![];this[_0xe4c1('0x9')]=_0x3fc38f[_0xe4c1('0x9')]||{};this[_0xe4c1('0xa')]=_0x3fc38f[_0xe4c1('0xa')]||{};}module[_0xe4c1('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 59327df..9ea8369 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 _0x7abd=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x7abd,0x16d));var _0xd7ab=function(_0x4cdb1e,_0x291f0d){_0x4cdb1e=_0x4cdb1e-0x0;var _0x1a978c=_0x7abd[_0x4cdb1e];return _0x1a978c;};'use strict';function FaxAccount(_0x155f4d){this['id']=_0x155f4d['id']||0x0;this['name']=_0x155f4d[_0xd7ab('0x0')]||'';this[_0xd7ab('0x1')]=_0x155f4d[_0xd7ab('0x1')];this[_0xd7ab('0x2')]=_0x155f4d['ecm'];this['headerinfo']=_0x155f4d[_0xd7ab('0x3')];this[_0xd7ab('0x4')]=_0x155f4d[_0xd7ab('0x4')];this[_0xd7ab('0x5')]=_0x155f4d['minrate']||0x960;this['maxrate']=_0x155f4d[_0xd7ab('0x6')]||0x3840;this['modem']=_0x155f4d[_0xd7ab('0x7')]||_0xd7ab('0x8');this[_0xd7ab('0x9')]=_0x155f4d[_0xd7ab('0x9')]||'no';this[_0xd7ab('0xa')]=_0x155f4d['faxdetect']||'no';this[_0xd7ab('0xb')]=_0x155f4d[_0xd7ab('0xb')]||0x1388;this[_0xd7ab('0xc')]=_0x155f4d['tech']||_0xd7ab('0xd');this[_0xd7ab('0xe')]=_0x155f4d[_0xd7ab('0xe')]?_0x155f4d[_0xd7ab('0xe')]:undefined;this[_0xd7ab('0xf')]=_0x155f4d[_0xd7ab('0xf')];this['key']=_0x155f4d[_0xd7ab('0x10')];}module[_0xd7ab('0x11')]=FaxAccount; \ No newline at end of file +var _0x6060=['ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x3ed3ad,_0x424953){var _0x2c628f=function(_0x77fdb9){while(--_0x77fdb9){_0x3ed3ad['push'](_0x3ed3ad['shift']());}};_0x2c628f(++_0x424953);}(_0x6060,0x113));var _0x0606=function(_0x119b4d,_0x2c3583){_0x119b4d=_0x119b4d-0x0;var _0x1256c0=_0x6060[_0x119b4d];return _0x1256c0;};'use strict';function FaxAccount(_0x2ef29c){this['id']=_0x2ef29c['id']||0x0;this[_0x0606('0x0')]=_0x2ef29c[_0x0606('0x0')]||'';this[_0x0606('0x1')]=_0x2ef29c[_0x0606('0x1')];this[_0x0606('0x2')]=_0x2ef29c[_0x0606('0x2')];this[_0x0606('0x3')]=_0x2ef29c[_0x0606('0x3')];this['localstationid']=_0x2ef29c['localstationid'];this[_0x0606('0x4')]=_0x2ef29c[_0x0606('0x4')]||0x960;this[_0x0606('0x5')]=_0x2ef29c[_0x0606('0x5')]||0x3840;this[_0x0606('0x6')]=_0x2ef29c[_0x0606('0x6')]||'v17,v27,v29';this[_0x0606('0x7')]=_0x2ef29c[_0x0606('0x7')]||'no';this[_0x0606('0x8')]=_0x2ef29c[_0x0606('0x8')]||'no';this['t38timeout']=_0x2ef29c[_0x0606('0x9')]||0x1388;this[_0x0606('0xa')]=_0x2ef29c[_0x0606('0xa')]||_0x0606('0xb');this[_0x0606('0xc')]=_0x2ef29c['Trunk']?_0x2ef29c['Trunk']:undefined;this[_0x0606('0xd')]=_0x2ef29c[_0x0606('0xd')];this[_0x0606('0xe')]=_0x2ef29c[_0x0606('0xe')];}module[_0x0606('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 89b1e22..fe3e402 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 _0x1694=['token','remoteUri','serverUrl','Configurations','exports','name','apiKey'];(function(_0x852045,_0x2769f5){var _0x46b545=function(_0x56151c){while(--_0x56151c){_0x852045['push'](_0x852045['shift']());}};_0x46b545(++_0x2769f5);}(_0x1694,0x124));var _0x4169=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x1694[_0x4baae2];return _0x1a2285;};'use strict';function FreshdeskAccount(_0x2a4ad8){this['id']=_0x2a4ad8['id']||0x0;this[_0x4169('0x0')]=_0x2a4ad8['name']||'';this['username']=_0x2a4ad8['username']||'';this[_0x4169('0x1')]=_0x2a4ad8[_0x4169('0x2')]||'';this['remoteUri']=_0x2a4ad8[_0x4169('0x3')]||'';this[_0x4169('0x4')]=_0x2a4ad8['serverUrl']||'';this['Configurations']=_0x2a4ad8[_0x4169('0x5')]||{};}module[_0x4169('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x7a2b=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1eeeac,_0x1af529){var _0x113813=function(_0x117c56){while(--_0x117c56){_0x1eeeac['push'](_0x1eeeac['shift']());}};_0x113813(++_0x1af529);}(_0x7a2b,0xf5));var _0xb7a2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7a2b[_0x501510];return _0x1e6ee5;};'use strict';function FreshdeskAccount(_0x3d181f){this['id']=_0x3d181f['id']||0x0;this[_0xb7a2('0x0')]=_0x3d181f[_0xb7a2('0x0')]||'';this[_0xb7a2('0x1')]=_0x3d181f['username']||'';this[_0xb7a2('0x2')]=_0x3d181f[_0xb7a2('0x3')]||'';this[_0xb7a2('0x4')]=_0x3d181f[_0xb7a2('0x4')]||'';this['serverUrl']=_0x3d181f[_0xb7a2('0x5')]||'';this[_0xb7a2('0x6')]=_0x3d181f[_0xb7a2('0x6')]||{};}module[_0xb7a2('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index eb2fc4a..0b0e6b5 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 _0x0e76=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x5b2249,_0x128eef){var _0x5f3737=function(_0x418fd4){while(--_0x418fd4){_0x5b2249['push'](_0x5b2249['shift']());}};_0x5f3737(++_0x128eef);}(_0x0e76,0xc4));var _0x60e7=function(_0x2a3a1e,_0x391126){_0x2a3a1e=_0x2a3a1e-0x0;var _0x417a1c=_0x0e76[_0x2a3a1e];return _0x417a1c;};'use strict';function FreshsalesAccount(_0x412a52){this['id']=_0x412a52['id']||0x0;this['name']=_0x412a52['name']||'';this[_0x60e7('0x0')]=_0x412a52['username']||'';this[_0x60e7('0x1')]=_0x412a52[_0x60e7('0x2')]||'';this[_0x60e7('0x3')]=_0x412a52[_0x60e7('0x3')]||'';this[_0x60e7('0x4')]=_0x412a52['serverUrl']||'';this[_0x60e7('0x5')]=_0x412a52[_0x60e7('0x5')]||{};}module[_0x60e7('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xf350=['remoteUri','serverUrl','exports','username','apiKey','token'];(function(_0x533f8d,_0x102243){var _0x84a044=function(_0x37bcfe){while(--_0x37bcfe){_0x533f8d['push'](_0x533f8d['shift']());}};_0x84a044(++_0x102243);}(_0xf350,0x105));var _0x0f35=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf350[_0x122ef9];return _0x42fba0;};'use strict';function FreshsalesAccount(_0x4aa891){this['id']=_0x4aa891['id']||0x0;this['name']=_0x4aa891['name']||'';this[_0x0f35('0x0')]=_0x4aa891[_0x0f35('0x0')]||'';this[_0x0f35('0x1')]=_0x4aa891[_0x0f35('0x2')]||'';this[_0x0f35('0x3')]=_0x4aa891[_0x0f35('0x3')]||'';this[_0x0f35('0x4')]=_0x4aa891['serverUrl']||'';this['Configurations']=_0x4aa891['Configurations']||{};}module[_0x0f35('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 7222122..28a57ce 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 _0x4c06=['queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','routealias','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete','queuecallercompleteAt'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0x4c06,0x1d6));var _0x64c0=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x4c06[_0x58a4ac];return _0x545810;};'use strict';function QueueReport(){this[_0x64c0('0x0')]=_0x64c0('0x1');this[_0x64c0('0x2')]='';this[_0x64c0('0x3')]='';this['calleridname']='';this['queue']='';this[_0x64c0('0x4')]=null;this[_0x64c0('0x5')]=null;this[_0x64c0('0x6')]=0x1;this['count']=0x1;this[_0x64c0('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x64c0('0x8')]=![];this[_0x64c0('0x9')]=null;this[_0x64c0('0xa')]=![];this[_0x64c0('0xb')]=null;this['originalposition']=0x1;this['channel']='';this[_0x64c0('0xc')]='';this[_0x64c0('0xd')]='';this[_0x64c0('0xe')]='';this[_0x64c0('0xf')]='';this[_0x64c0('0x10')]='';this[_0x64c0('0x11')]='';this['holdtime']=0x0;this[_0x64c0('0x12')]=![];this[_0x64c0('0x13')]='';this[_0x64c0('0x14')]='voice';this[_0x64c0('0x15')]=null;this['mohtime']=0x0;this[_0x64c0('0x16')]={};}module[_0x64c0('0x17')]=QueueReport; \ No newline at end of file +var _0x5475=['originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x5475,0x178));var _0x5547=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x5475[_0x13e741];return _0x3f8bb3;};'use strict';function QueueReport(){this['type']=_0x5547('0x0');this[_0x5547('0x1')]='';this[_0x5547('0x2')]='';this[_0x5547('0x3')]='';this[_0x5547('0x4')]='';this[_0x5547('0x5')]=null;this[_0x5547('0x6')]=null;this[_0x5547('0x7')]=0x1;this[_0x5547('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x5547('0x9')]=null;this[_0x5547('0xa')]=![];this[_0x5547('0xb')]=null;this[_0x5547('0xc')]=![];this[_0x5547('0xd')]=null;this[_0x5547('0xe')]=0x1;this[_0x5547('0xf')]='';this[_0x5547('0x10')]='';this[_0x5547('0x11')]='';this[_0x5547('0x12')]='';this[_0x5547('0x13')]='';this[_0x5547('0x14')]='';this[_0x5547('0x15')]='';this[_0x5547('0x16')]=0x0;this['assigned']=![];this[_0x5547('0x17')]='';this[_0x5547('0x18')]=_0x5547('0x19');this[_0x5547('0x1a')]=null;this[_0x5547('0x1b')]=0x0;this[_0x5547('0x1c')]={};}module[_0x5547('0x1d')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index c7ac08d..105c6e7 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 _0xcc5b=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x4cebf0,_0x1b2de0){var _0x5d869c=function(_0x518459){while(--_0x518459){_0x4cebf0['push'](_0x4cebf0['shift']());}};_0x5d869c(++_0x1b2de0);}(_0xcc5b,0x1e3));var _0xbcc5=function(_0x5f8d3b,_0xa35280){_0x5f8d3b=_0x5f8d3b-0x0;var _0x337d02=_0xcc5b[_0x5f8d3b];return _0x337d02;};'use strict';function SalesforceAccount(_0xedd65b){this['id']=_0xedd65b['id']||0x0;this[_0xbcc5('0x0')]=_0xedd65b['name']||'';this[_0xbcc5('0x1')]=_0xedd65b['username']||'';this[_0xbcc5('0x2')]=_0xedd65b['remoteUri']||'';this['password']=_0xedd65b[_0xbcc5('0x3')]||'';this['clientId']=_0xedd65b[_0xbcc5('0x4')]||'';this[_0xbcc5('0x5')]=_0xedd65b[_0xbcc5('0x5')]||'';this[_0xbcc5('0x6')]=_0xedd65b[_0xbcc5('0x6')]||'';this[_0xbcc5('0x7')]=_0xedd65b[_0xbcc5('0x7')]||_0xbcc5('0x8');this['serverUrl']=_0xedd65b[_0xbcc5('0x9')]||'';this[_0xbcc5('0xa')]=_0xedd65b['Configurations']||{};}module[_0xbcc5('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x2ffe=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x1e8e55,_0x5b6937){var _0x962246=function(_0x658954){while(--_0x658954){_0x1e8e55['push'](_0x1e8e55['shift']());}};_0x962246(++_0x5b6937);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x66069e,_0x3f65b5){_0x66069e=_0x66069e-0x0;var _0x162cf5=_0x2ffe[_0x66069e];return _0x162cf5;};'use strict';function SalesforceAccount(_0x40ef96){this['id']=_0x40ef96['id']||0x0;this[_0xe2ff('0x0')]=_0x40ef96[_0xe2ff('0x0')]||'';this[_0xe2ff('0x1')]=_0x40ef96[_0xe2ff('0x1')]||'';this[_0xe2ff('0x2')]=_0x40ef96['remoteUri']||'';this[_0xe2ff('0x3')]=_0x40ef96[_0xe2ff('0x3')]||'';this['clientId']=_0x40ef96['clientId']||'';this[_0xe2ff('0x4')]=_0x40ef96[_0xe2ff('0x4')]||'';this[_0xe2ff('0x5')]=_0x40ef96['securityToken']||'';this[_0xe2ff('0x6')]=_0x40ef96[_0xe2ff('0x6')]||_0xe2ff('0x7');this[_0xe2ff('0x8')]=_0x40ef96[_0xe2ff('0x8')]||'';this[_0xe2ff('0x9')]=_0x40ef96[_0xe2ff('0x9')]||{};}module[_0xe2ff('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9c2f643..4cbc8aa 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 _0x4dad=['serverUrl','Configurations','name','password','remoteUri'];(function(_0x3c1122,_0x2a502b){var _0x2e2f8e=function(_0x193e1d){while(--_0x193e1d){_0x3c1122['push'](_0x3c1122['shift']());}};_0x2e2f8e(++_0x2a502b);}(_0x4dad,0x15b));var _0xd4da=function(_0x46b6a1,_0x5f75b7){_0x46b6a1=_0x46b6a1-0x0;var _0x428b88=_0x4dad[_0x46b6a1];return _0x428b88;};'use strict';function ServicenowAccount(_0x38c266){this['id']=_0x38c266['id']||0x0;this[_0xd4da('0x0')]=_0x38c266[_0xd4da('0x0')]||'';this['username']=_0x38c266['username']||'';this[_0xd4da('0x1')]=_0x38c266[_0xd4da('0x1')]||'';this[_0xd4da('0x2')]=_0x38c266[_0xd4da('0x2')]||'';this['serverUrl']=_0x38c266[_0xd4da('0x3')]||'';this[_0xd4da('0x4')]=_0x38c266['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x103f=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4b1180,_0x2d52ba){var _0x5ce6d1=function(_0x2f3a51){while(--_0x2f3a51){_0x4b1180['push'](_0x4b1180['shift']());}};_0x5ce6d1(++_0x2d52ba);}(_0x103f,0x18e));var _0xf103=function(_0x348f32,_0x3acd2a){_0x348f32=_0x348f32-0x0;var _0x2a20b2=_0x103f[_0x348f32];return _0x2a20b2;};'use strict';function ServicenowAccount(_0x3a3feb){this['id']=_0x3a3feb['id']||0x0;this[_0xf103('0x0')]=_0x3a3feb[_0xf103('0x0')]||'';this[_0xf103('0x1')]=_0x3a3feb['username']||'';this[_0xf103('0x2')]=_0x3a3feb[_0xf103('0x2')]||'';this['remoteUri']=_0x3a3feb[_0xf103('0x3')]||'';this[_0xf103('0x4')]=_0x3a3feb[_0xf103('0x4')]||'';this[_0xf103('0x5')]=_0x3a3feb['Configurations']||{};}module[_0xf103('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 4dd9908..3c34b7b 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 _0xb9ce=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x5d57fb,_0x3683a5){var _0x5d9327=function(_0x2b1536){while(--_0x2b1536){_0x5d57fb['push'](_0x5d57fb['shift']());}};_0x5d9327(++_0x3683a5);}(_0xb9ce,0x11c));var _0xeb9c=function(_0x4f397b,_0x78337d){_0x4f397b=_0x4f397b-0x0;var _0x12e7a1=_0xb9ce[_0x4f397b];return _0x12e7a1;};'use strict';function SugarcrmAccount(_0x4849e7){this['id']=_0x4849e7['id']||0x0;this[_0xeb9c('0x0')]=_0x4849e7[_0xeb9c('0x0')]||'';this[_0xeb9c('0x1')]=_0x4849e7[_0xeb9c('0x1')]||'';this[_0xeb9c('0x2')]=_0x4849e7[_0xeb9c('0x2')]||'';this[_0xeb9c('0x3')]=_0x4849e7[_0xeb9c('0x3')]||'';this[_0xeb9c('0x4')]=_0x4849e7[_0xeb9c('0x4')]||'';this[_0xeb9c('0x5')]=_0x4849e7[_0xeb9c('0x5')]||{};}module[_0xeb9c('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x96fe=['exports','username','password','remoteUri','serverUrl','Configurations'];(function(_0x4121a3,_0x736927){var _0x836207=function(_0x363ff5){while(--_0x363ff5){_0x4121a3['push'](_0x4121a3['shift']());}};_0x836207(++_0x736927);}(_0x96fe,0x127));var _0xe96f=function(_0x3fdb2c,_0x5b0012){_0x3fdb2c=_0x3fdb2c-0x0;var _0x2eff85=_0x96fe[_0x3fdb2c];return _0x2eff85;};'use strict';function SugarcrmAccount(_0x42a9fb){this['id']=_0x42a9fb['id']||0x0;this['name']=_0x42a9fb['name']||'';this[_0xe96f('0x0')]=_0x42a9fb[_0xe96f('0x0')]||'';this['password']=_0x42a9fb[_0xe96f('0x1')]||'';this[_0xe96f('0x2')]=_0x42a9fb['remoteUri']||'';this[_0xe96f('0x3')]=_0x42a9fb[_0xe96f('0x3')]||'';this[_0xe96f('0x4')]=_0x42a9fb[_0xe96f('0x4')]||{};}module[_0xe96f('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 9ab2e5c..9d65260 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 _0x315f=['name','state','address'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x315f,0x174));var _0xf315=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x315f[_0x1dfa63];return _0x26f2a9;};'use strict';function Telephone(_0x5bc489){this['id']=_0x5bc489['id']||0x0;this['name']=_0x5bc489[_0xf315('0x0')]||'';this['accountcode']=_0x5bc489['accountcode']||'';this[_0xf315('0x1')]='unknown';this['stateTime']=0x0;this['status']='unknown';this[_0xf315('0x2')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x0c24=['status','unknown','address','name','accountcode','state'];(function(_0x54c532,_0x170896){var _0x2ccb1c=function(_0x1c68ca){while(--_0x1c68ca){_0x54c532['push'](_0x54c532['shift']());}};_0x2ccb1c(++_0x170896);}(_0x0c24,0x13b));var _0x40c2=function(_0x4cc198,_0x11a598){_0x4cc198=_0x4cc198-0x0;var _0x3e8858=_0x0c24[_0x4cc198];return _0x3e8858;};'use strict';function Telephone(_0x4336e9){this['id']=_0x4336e9['id']||0x0;this['name']=_0x4336e9[_0x40c2('0x0')]||'';this[_0x40c2('0x1')]=_0x4336e9['accountcode']||'';this[_0x40c2('0x2')]='unknown';this['stateTime']=0x0;this[_0x40c2('0x3')]=_0x40c2('0x4');this[_0x40c2('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 10d355d..38925f7 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x34809b,_0x2ce939){var _0x466cd4=function(_0x2fbe86){while(--_0x2fbe86){_0x34809b['push'](_0x34809b['shift']());}};_0x466cd4(++_0x2ce939);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0xb10b[_0x2a2e72];return _0x3cfb4a;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x19dfa1,_0x233a84){var _0x401949=function(_0x221cc3){while(--_0x221cc3){_0x19dfa1['push'](_0x19dfa1['shift']());}};_0x401949(++_0x233a84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 9f6425a..cd7e0da 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x50a902,_0x127447){var _0x44b05b=function(_0x531920){while(--_0x531920){_0x50a902['push'](_0x50a902['shift']());}};_0x44b05b(++_0x127447);}(_0xda2d,0x102));var _0xdda2=function(_0x255c48,_0x1de1a5){_0x255c48=_0x255c48-0x0;var _0x2917c8=_0xda2d[_0x255c48];return _0x2917c8;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x54d01b,_0x3c0c5b){var _0xe1400f=function(_0x1c6992){while(--_0x1c6992){_0x54d01b['push'](_0x54d01b['shift']());}};_0xe1400f(++_0x3c0c5b);}(_0x2032,0xd9));var _0x2203=function(_0x1c5eb2,_0x545a09){_0x1c5eb2=_0x1c5eb2-0x0;var _0x346e35=_0x2032[_0x1c5eb2];return _0x346e35;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b0ae631..c0bf15b 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 _0x664a=['registry','indexOf','split','host','domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','status'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x664a,0xfb));var _0xa664=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x664a[_0xa464c9];return _0x3d73c4;};'use strict';function Trunk(_0x4ddaf3){this['id']=_0x4ddaf3['id']||0x0;this[_0xa664('0x0')]=_0x4ddaf3[_0xa664('0x0')]||![];this[_0xa664('0x1')]=_0x4ddaf3['name']||'';this[_0xa664('0x2')]=_0xa664('0x3');this['stateTime']=0x0;this[_0xa664('0x4')]=_0xa664('0x3');this[_0xa664('0x5')]=_0x4ddaf3[_0xa664('0x5')]&&_0x4ddaf3[_0xa664('0x5')][_0xa664('0x6')](':')?_0x4ddaf3[_0xa664('0x5')][_0xa664('0x7')](':')[0x0]:'';this[_0xa664('0x8')]='';this['port']='';this[_0xa664('0x9')]='';this[_0xa664('0xa')]='';this[_0xa664('0xb')]='';this[_0xa664('0xc')]='unknown';this['registrationtime']='';this[_0xa664('0xd')]='';this['defaultuser']=_0x4ddaf3[_0xa664('0xe')]||'';}module[_0xa664('0xf')]=Trunk; \ No newline at end of file +var _0x2a23=['refresh','stateRegistry','registrationtime','defaultuser','active','name','state','stateTime','status','unknown','registry','indexOf','split','host','port','domain'];(function(_0x4c667f,_0x335204){var _0xe099b0=function(_0x2e5b46){while(--_0x2e5b46){_0x4c667f['push'](_0x4c667f['shift']());}};_0xe099b0(++_0x335204);}(_0x2a23,0x194));var _0x32a2=function(_0x3aafb0,_0xc68ac2){_0x3aafb0=_0x3aafb0-0x0;var _0x16d86c=_0x2a23[_0x3aafb0];return _0x16d86c;};'use strict';function Trunk(_0x518eb4){this['id']=_0x518eb4['id']||0x0;this[_0x32a2('0x0')]=_0x518eb4[_0x32a2('0x0')]||![];this['name']=_0x518eb4[_0x32a2('0x1')]||'';this[_0x32a2('0x2')]='unknown';this[_0x32a2('0x3')]=0x0;this[_0x32a2('0x4')]=_0x32a2('0x5');this['registry']=_0x518eb4[_0x32a2('0x6')]&&_0x518eb4[_0x32a2('0x6')][_0x32a2('0x7')](':')?_0x518eb4['registry'][_0x32a2('0x8')](':')[0x0]:'';this[_0x32a2('0x9')]='';this[_0x32a2('0xa')]='';this[_0x32a2('0xb')]='';this['domainport']='';this[_0x32a2('0xc')]='';this[_0x32a2('0xd')]=_0x32a2('0x5');this[_0x32a2('0xe')]='';this['address']='';this[_0x32a2('0xf')]=_0x518eb4['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index c364a17..8f18d26 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 _0x7c83=['exten','recordingFormat'];(function(_0x9b0b5a,_0xabb2cb){var _0x5370c2=function(_0x5e1b30){while(--_0x5e1b30){_0x9b0b5a['push'](_0x9b0b5a['shift']());}};_0x5370c2(++_0xabb2cb);}(_0x7c83,0x1e8));var _0x37c8=function(_0x3dc7d1,_0x2508c4){_0x3dc7d1=_0x3dc7d1-0x0;var _0x160fb2=_0x7c83[_0x3dc7d1];return _0x160fb2;};'use strict';function voiceExtension(_0x55891a){this['id']=_0x55891a['id']||0x0;this[_0x37c8('0x0')]=_0x55891a[_0x37c8('0x0')]||'';this['recordingFormat']=_0x55891a[_0x37c8('0x1')]||'none';this['mandatoryDisposition']=_0x55891a['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xb08e=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x46277b,_0x46feb8){var _0x3c1805=function(_0x351ae7){while(--_0x351ae7){_0x46277b['push'](_0x46277b['shift']());}};_0x3c1805(++_0x46feb8);}(_0xb08e,0x16d));var _0xeb08=function(_0x41e32e,_0x4c57b6){_0x41e32e=_0x41e32e-0x0;var _0x4b7cf5=_0xb08e[_0x41e32e];return _0x4b7cf5;};'use strict';function voiceExtension(_0x25f2ce){this['id']=_0x25f2ce['id']||0x0;this[_0xeb08('0x0')]=_0x25f2ce[_0xeb08('0x0')]||'';this[_0xeb08('0x1')]=_0x25f2ce[_0xeb08('0x1')]||_0xeb08('0x2');this[_0xeb08('0x3')]=_0x25f2ce[_0xeb08('0x3')]||![];}module[_0xeb08('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 3d908ee..2570ad7 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 _0x5a43=['unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','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','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','abandoned','busy','inUse','invalid','notInUse','onHold','paused','ringing','talking'];(function(_0x2c541b,_0x281f54){var _0x1453bd=function(_0x39c2d6){while(--_0x39c2d6){_0x2c541b['push'](_0x2c541b['shift']());}};_0x1453bd(++_0x281f54);}(_0x5a43,0xf1));var _0x35a4=function(_0x2c180b,_0x51d396){_0x2c180b=_0x2c180b-0x0;var _0x590047=_0x5a43[_0x2c180b];return _0x590047;};'use strict';var monitorFormat={'wav':_0x35a4('0x0'),'wav49':_0x35a4('0x1'),'gsm':_0x35a4('0x2')};var strategy={'fewestcalls':_0x35a4('0x3'),'leastrecent':_0x35a4('0x4'),'linear':_0x35a4('0x5'),'random':_0x35a4('0x6'),'ringall':'ringall','rr':'roundrobin','rrmemory':'rrmemory','rrordered':'rrordered','wrandom':_0x35a4('0x7')};function VoiceQueue(_0x38c350){this['id']=_0x38c350['id']||0x0;this[_0x35a4('0x8')]=_0x38c350[_0x35a4('0x8')]||'';this[_0x35a4('0x9')]=_0x38c350[_0x35a4('0x9')]||'';this['type']=_0x38c350[_0x35a4('0xa')]||_0x35a4('0xb');this[_0x35a4('0xc')]=0x0;this[_0x35a4('0xd')]=0x0;this[_0x35a4('0xe')]=0x0;this[_0x35a4('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x35a4('0x10')]=0x0;this['available']=0x0;this[_0x35a4('0x11')]=0x0;this[_0x35a4('0x12')]=0x0;this[_0x35a4('0x13')]=0x0;this['loggedIn']=0x0;this[_0x35a4('0x14')]=0x0;this[_0x35a4('0x15')]=0x0;this[_0x35a4('0x16')]=0x0;this[_0x35a4('0x17')]=0x0;this['ringInUse']=0x0;this[_0x35a4('0x18')]=0x0;this[_0x35a4('0x19')]=0x0;this['unknown']=0x0;this[_0x35a4('0x1a')]=_0x38c350['acw']||![];this[_0x35a4('0x1b')]=_0x38c350[_0x35a4('0x1b')]||0xa;this[_0x35a4('0x1c')]=_0x38c350[_0x35a4('0x1c')]||'no';this[_0x35a4('0x1d')]=!![];this[_0x35a4('0x1e')]='';this[_0x35a4('0x1f')]='';this[_0x35a4('0x20')]=0x0;this[_0x35a4('0x21')]=0x0;this['dialTimezone']=_0x38c350[_0x35a4('0x22')]||null;this[_0x35a4('0x23')]=_0x38c350[_0x35a4('0x23')]?_0x38c350[_0x35a4('0x23')]:null;this[_0x35a4('0x24')]=_0x38c350[_0x35a4('0x24')];this[_0x35a4('0x25')]=_0x38c350[_0x35a4('0x25')]||'progressive';this[_0x35a4('0x26')]=_0x38c350['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x38c350[_0x35a4('0x27')]||0x0;this[_0x35a4('0x28')]=_0x38c350[_0x35a4('0x28')]||0x1;this['dialPredictiveOptimization']=_0x38c350[_0x35a4('0x29')]||_0x35a4('0x2a');this[_0x35a4('0x2b')]=_0x38c350['dialPredictiveOptimizationPercentage']||0.03;this[_0x35a4('0x2c')]=_0x38c350[_0x35a4('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x38c350[_0x35a4('0x2d')]||_0x35a4('0x2e');this[_0x35a4('0x2f')]=_0x38c350[_0x35a4('0x2f')]||'anonymous';this['dialOriginateTimeout']=_0x38c350[_0x35a4('0x30')]||0x1e;this['dialQueueOptions']=_0x38c350[_0x35a4('0x31')]||_0x35a4('0x32');this[_0x35a4('0x33')]=_0x38c350[_0x35a4('0x33')]||0x3;this[_0x35a4('0x34')]=_0x38c350[_0x35a4('0x34')]||undefined;this['dialCongestionMaxRetry']=_0x38c350['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x38c350[_0x35a4('0x35')]||0x96;this[_0x35a4('0x36')]=_0x38c350['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x38c350[_0x35a4('0x37')]||0x96;this[_0x35a4('0x38')]=_0x38c350[_0x35a4('0x38')]||0x3;this[_0x35a4('0x39')]=_0x38c350['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x38c350['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x38c350[_0x35a4('0x3a')]||0x96;this[_0x35a4('0x3b')]=_0x38c350[_0x35a4('0x3b')]||0x3;this[_0x35a4('0x3c')]=_0x38c350[_0x35a4('0x3c')]||0x96;this[_0x35a4('0x3d')]=_0x38c350[_0x35a4('0x3d')]||0x3;this[_0x35a4('0x3e')]=_0x38c350[_0x35a4('0x3e')]||0x96;this[_0x35a4('0x3f')]=_0x38c350[_0x35a4('0x3f')]||0x3;this[_0x35a4('0x40')]=_0x38c350[_0x35a4('0x40')]||0x96;this[_0x35a4('0x41')]=_0x38c350[_0x35a4('0x41')]||0x3;this[_0x35a4('0x42')]=_0x38c350['dialAgentRejectRetryFrequency']||0x96;this[_0x35a4('0x43')]=_0x38c350[_0x35a4('0x43')]||0x3;this[_0x35a4('0x44')]=_0x38c350['dialGlobalMaxRetry']||0x4;this[_0x35a4('0x45')]=_0x38c350[_0x35a4('0x45')]?_0x38c350[_0x35a4('0x45')]:undefined;this['TrunkBackup']=_0x38c350['TrunkBackup']?_0x38c350[_0x35a4('0x46')]:undefined;this['dialPrefix']=_0x38c350[_0x35a4('0x47')]||undefined;this[_0x35a4('0x48')]=_0x38c350[_0x35a4('0x48')]?_0x38c350['Interval']:undefined;this['dialOrderByScheduledAt']=_0x38c350[_0x35a4('0x49')]||_0x35a4('0x4a');this[_0x35a4('0x4b')]=_0x38c350[_0x35a4('0x4b')]||undefined;this[_0x35a4('0x4c')]=_0x38c350[_0x35a4('0x4c')]||undefined;this[_0x35a4('0x4d')]=strategy[_0x38c350[_0x35a4('0x4d')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x38c350[_0x35a4('0x4e')]||![];this[_0x35a4('0x4f')]=_0x38c350[_0x35a4('0x4f')];this[_0x35a4('0x50')]=_0x38c350[_0x35a4('0x50')];this['dialAMDAfterGreetingSilence']=_0x38c350[_0x35a4('0x51')];this['dialAMDTotalAnalysisTime']=_0x38c350[_0x35a4('0x52')];this['dialAMDMinWordLength']=_0x38c350[_0x35a4('0x53')];this[_0x35a4('0x54')]=_0x38c350[_0x35a4('0x54')];this[_0x35a4('0x55')]=_0x38c350[_0x35a4('0x55')];this[_0x35a4('0x56')]=_0x38c350['dialAMDSilenceThreshold'];this[_0x35a4('0x57')]=_0x38c350[_0x35a4('0x57')];this[_0x35a4('0x58')]=0x0;this[_0x35a4('0x59')]=0x0;this[_0x35a4('0x5a')]=_0x38c350[_0x35a4('0x5a')];this[_0x35a4('0x5b')]=0x0;this[_0x35a4('0x5c')]=0x0;this[_0x35a4('0x5d')]=0x0;this[_0x35a4('0x5e')]=0x0;this[_0x35a4('0x5f')]=0x0;this[_0x35a4('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x35a4('0x61')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x35a4('0x62')]=0x0;this[_0x35a4('0x63')]=0x0;this[_0x35a4('0x64')]=0x0;this[_0x35a4('0x65')]=0x0;this[_0x35a4('0x66')]=0x0;this[_0x35a4('0x67')]=undefined;this[_0x35a4('0x68')]=undefined;this[_0x35a4('0x69')]=undefined;this[_0x35a4('0x6a')]=1.05;this[_0x35a4('0x6b')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x35a4('0x6c')]=0x0;this[_0x35a4('0x6d')]=0x0;this[_0x35a4('0x6e')]=0x0;this[_0x35a4('0x6f')]=0x0;this[_0x35a4('0x70')]=0x0;this[_0x35a4('0x71')]=0x0;this[_0x35a4('0x72')]=_0x38c350['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x35a4('0x73')]=_0x38c350[_0x35a4('0x74')]||0xa;this[_0x35a4('0x75')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x35a4('0x76')]=0x1;this[_0x35a4('0x77')]=0x0;this[_0x35a4('0x78')]=0x0;this[_0x35a4('0x79')]=0x0;this[_0x35a4('0x7a')]=0x0;this[_0x35a4('0x7b')]=_0x38c350[_0x35a4('0x7b')]||0x1e;this['dialRecallInQueue']=_0x38c350[_0x35a4('0x7c')]||![];this['dialPreviewAutoRecallMe']=!!_0x38c350[_0x35a4('0x7d')]||![];this[_0x35a4('0x7e')]=!!_0x38c350[_0x35a4('0x7e')]||![];this[_0x35a4('0x7f')]=_0x38c350['dialQueueProject2']||undefined;this[_0x35a4('0x80')]=_0x38c350[_0x35a4('0x80')]||![];this[_0x35a4('0x81')]=_0x38c350[_0x35a4('0x81')]||![];this[_0x35a4('0x9')]=monitorFormat[_0x38c350[_0x35a4('0x9')]]?monitorFormat[_0x38c350[_0x35a4('0x9')]]:undefined;this[_0x35a4('0x82')]=_0x38c350[_0x35a4('0x82')]||![];this['mandatoryDispositionPause']=_0x38c350[_0x35a4('0x83')]?_0x38c350[_0x35a4('0x83')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x35a4('0x84')]=VoiceQueue; \ No newline at end of file +var _0xaccc=['dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','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','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','available','inUse','invalid','loggedIn','notInUse','ringing','ringInUse','unavailable','unknown','acw','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel'];(function(_0x3a8449,_0x29dfbd){var _0x273d83=function(_0x16c049){while(--_0x16c049){_0x3a8449['push'](_0x3a8449['shift']());}};_0x273d83(++_0x29dfbd);}(_0xaccc,0xda));var _0xcacc=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xaccc[_0x48b810];return _0x23c17d;};'use strict';var monitorFormat={'wav':_0xcacc('0x0'),'wav49':_0xcacc('0x1'),'gsm':_0xcacc('0x2')};var strategy={'fewestcalls':_0xcacc('0x3'),'leastrecent':_0xcacc('0x4'),'linear':_0xcacc('0x5'),'random':'random','ringall':_0xcacc('0x6'),'rr':_0xcacc('0x7'),'rrmemory':_0xcacc('0x8'),'rrordered':_0xcacc('0x9'),'wrandom':'wrandom'};function VoiceQueue(_0x2b21bb){this['id']=_0x2b21bb['id']||0x0;this['name']=_0x2b21bb[_0xcacc('0xa')]||'';this[_0xcacc('0xb')]=_0x2b21bb[_0xcacc('0xb')]||'';this[_0xcacc('0xc')]=_0x2b21bb[_0xcacc('0xc')]||_0xcacc('0xd');this[_0xcacc('0xe')]=0x0;this[_0xcacc('0xf')]=0x0;this[_0xcacc('0x10')]=0x0;this[_0xcacc('0x11')]=0x0;this[_0xcacc('0x12')]=0x0;this[_0xcacc('0x13')]=0x0;this['unmanaged']=0x0;this[_0xcacc('0x14')]=0x0;this[_0xcacc('0x15')]=0x0;this['busy']=0x0;this[_0xcacc('0x16')]=0x0;this[_0xcacc('0x17')]=0x0;this[_0xcacc('0x18')]=0x0;this[_0xcacc('0x19')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0xcacc('0x1a')]=0x0;this[_0xcacc('0x1b')]=0x0;this['talking']=0x0;this[_0xcacc('0x1c')]=0x0;this[_0xcacc('0x1d')]=0x0;this[_0xcacc('0x1e')]=_0x2b21bb[_0xcacc('0x1e')]||![];this['acwTimeout']=_0x2b21bb['acwTimeout']||0xa;this[_0xcacc('0x1f')]=_0x2b21bb[_0xcacc('0x1f')]||'no';this[_0xcacc('0x20')]=!![];this[_0xcacc('0x21')]='';this[_0xcacc('0x22')]='';this[_0xcacc('0x23')]=0x0;this[_0xcacc('0x24')]=0x0;this[_0xcacc('0x25')]=_0x2b21bb['dialTimezone']||null;this[_0xcacc('0x26')]=_0x2b21bb[_0xcacc('0x26')]?_0x2b21bb[_0xcacc('0x26')]:null;this['dialActive']=_0x2b21bb[_0xcacc('0x27')];this[_0xcacc('0x28')]=_0x2b21bb[_0xcacc('0x28')]||'progressive';this[_0xcacc('0x29')]=_0x2b21bb[_0xcacc('0x29')]||0x0;this[_0xcacc('0x2a')]=_0x2b21bb[_0xcacc('0x2a')]||0x0;this[_0xcacc('0x2b')]=_0x2b21bb[_0xcacc('0x2b')]||0x1;this[_0xcacc('0x2c')]=_0x2b21bb[_0xcacc('0x2c')]||_0xcacc('0x2d');this['dialPredictiveOptimizationPercentage']=_0x2b21bb[_0xcacc('0x2e')]||0.03;this[_0xcacc('0x2f')]=_0x2b21bb[_0xcacc('0x2f')]||0x258;this[_0xcacc('0x30')]=_0x2b21bb[_0xcacc('0x30')]||'anonymous';this[_0xcacc('0x31')]=_0x2b21bb[_0xcacc('0x31')]||_0xcacc('0x32');this['dialOriginateTimeout']=_0x2b21bb[_0xcacc('0x33')]||0x1e;this[_0xcacc('0x34')]=_0x2b21bb[_0xcacc('0x34')]||_0xcacc('0x35');this[_0xcacc('0x36')]=_0x2b21bb['dialQueueTimeout']||0x3;this[_0xcacc('0x37')]=_0x2b21bb[_0xcacc('0x37')]||undefined;this[_0xcacc('0x38')]=_0x2b21bb[_0xcacc('0x38')]||0x3;this[_0xcacc('0x39')]=_0x2b21bb[_0xcacc('0x39')]||0x96;this[_0xcacc('0x3a')]=_0x2b21bb[_0xcacc('0x3a')]||0x3;this['dialBusyRetryFrequency']=_0x2b21bb[_0xcacc('0x3b')]||0x96;this[_0xcacc('0x3c')]=_0x2b21bb['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x2b21bb[_0xcacc('0x3d')]||0x96;this[_0xcacc('0x3e')]=_0x2b21bb[_0xcacc('0x3e')]||0x3;this[_0xcacc('0x3f')]=_0x2b21bb[_0xcacc('0x3f')]||0x96;this[_0xcacc('0x40')]=_0x2b21bb['dialDropMaxRetry']||0x3;this[_0xcacc('0x41')]=_0x2b21bb['dialDropRetryFrequency']||0x96;this[_0xcacc('0x42')]=_0x2b21bb[_0xcacc('0x42')]||0x3;this[_0xcacc('0x43')]=_0x2b21bb['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x2b21bb[_0xcacc('0x44')]||0x3;this[_0xcacc('0x45')]=_0x2b21bb['dialMachineRetryFrequency']||0x96;this[_0xcacc('0x46')]=_0x2b21bb[_0xcacc('0x46')]||0x3;this[_0xcacc('0x47')]=_0x2b21bb['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x2b21bb[_0xcacc('0x48')]||0x3;this['dialGlobalMaxRetry']=_0x2b21bb[_0xcacc('0x49')]||0x4;this[_0xcacc('0x4a')]=_0x2b21bb[_0xcacc('0x4a')]?_0x2b21bb[_0xcacc('0x4a')]:undefined;this[_0xcacc('0x4b')]=_0x2b21bb['TrunkBackup']?_0x2b21bb[_0xcacc('0x4b')]:undefined;this[_0xcacc('0x4c')]=_0x2b21bb[_0xcacc('0x4c')]||undefined;this[_0xcacc('0x4d')]=_0x2b21bb[_0xcacc('0x4d')]?_0x2b21bb['Interval']:undefined;this[_0xcacc('0x4e')]=_0x2b21bb[_0xcacc('0x4e')]||_0xcacc('0x4f');this[_0xcacc('0x50')]=_0x2b21bb[_0xcacc('0x50')]||undefined;this['dialCutDigit']=_0x2b21bb[_0xcacc('0x51')]||undefined;this[_0xcacc('0x52')]=strategy[_0x2b21bb['strategy']];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x2b21bb['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x2b21bb['dialAMDInitialSilence'];this[_0xcacc('0x53')]=_0x2b21bb[_0xcacc('0x53')];this[_0xcacc('0x54')]=_0x2b21bb[_0xcacc('0x54')];this[_0xcacc('0x55')]=_0x2b21bb[_0xcacc('0x55')];this[_0xcacc('0x56')]=_0x2b21bb['dialAMDMinWordLength'];this[_0xcacc('0x57')]=_0x2b21bb['dialAMDBetweenWordsSilence'];this[_0xcacc('0x58')]=_0x2b21bb[_0xcacc('0x58')];this[_0xcacc('0x59')]=_0x2b21bb[_0xcacc('0x59')];this[_0xcacc('0x5a')]=_0x2b21bb[_0xcacc('0x5a')];this[_0xcacc('0x5b')]=0x0;this[_0xcacc('0x5c')]=0x0;this[_0xcacc('0x5d')]=_0x2b21bb['timeout'];this[_0xcacc('0x5e')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xcacc('0x5f')]=0x0;this[_0xcacc('0x60')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xcacc('0x61')]=0x0;this[_0xcacc('0x62')]=0x0;this[_0xcacc('0x63')]=0x0;this[_0xcacc('0x64')]=0x0;this[_0xcacc('0x65')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0xcacc('0x66')]=undefined;this[_0xcacc('0x67')]=undefined;this[_0xcacc('0x68')]=undefined;this[_0xcacc('0x69')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xcacc('0x6a')]=0x0;this[_0xcacc('0x6b')]=0x0;this[_0xcacc('0x6c')]=0x0;this[_0xcacc('0x6d')]=0x0;this[_0xcacc('0x6e')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xcacc('0x6f')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2b21bb['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xcacc('0x70')]=_0x2b21bb[_0xcacc('0x71')]||0xa;this[_0xcacc('0x72')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xcacc('0x73')]=0x1;this[_0xcacc('0x74')]=0x0;this[_0xcacc('0x75')]=0x0;this[_0xcacc('0x76')]=0x0;this['erlangBusyFactor']=0x0;this[_0xcacc('0x77')]=_0x2b21bb[_0xcacc('0x77')]||0x1e;this[_0xcacc('0x78')]=_0x2b21bb['dialRecallInQueue']||![];this[_0xcacc('0x79')]=!!_0x2b21bb[_0xcacc('0x79')]||![];this[_0xcacc('0x7a')]=!!_0x2b21bb[_0xcacc('0x7a')]||![];this['dialQueueProject2']=_0x2b21bb[_0xcacc('0x7b')]||undefined;this['dialAgiAfterHangupClient']=_0x2b21bb[_0xcacc('0x7c')]||![];this[_0xcacc('0x7d')]=_0x2b21bb[_0xcacc('0x7d')]||![];this[_0xcacc('0xb')]=monitorFormat[_0x2b21bb[_0xcacc('0xb')]]?monitorFormat[_0x2b21bb[_0xcacc('0xb')]]:undefined;this[_0xcacc('0x7e')]=_0x2b21bb['mandatoryDisposition']||![];this[_0xcacc('0x7f')]=_0x2b21bb[_0xcacc('0x7f')]?_0x2b21bb[_0xcacc('0x7f')]:undefined;this[_0xcacc('0x80')]=![];}module[_0xcacc('0x81')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 96f45f8..36a334e 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 _0xeea0=['unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','busy','loggedin','callers','length','online','incall','includes','status','booked','queue','dialer','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','waiting','answered','inUse','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','name','strategy','abandoned','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','talking','total','type','unavailable'];(function(_0x3bdbd9,_0x5df43a){var _0x1df32d=function(_0x30e79e){while(--_0x30e79e){_0x3bdbd9['push'](_0x3bdbd9['shift']());}};_0x1df32d(++_0x5df43a);}(_0xeea0,0x91));var _0x0eea=function(_0x1dba94,_0x13f39f){_0x1dba94=_0x1dba94-0x0;var _0x23f0d1=_0xeea0[_0x1dba94];return _0x23f0d1;};'use strict';var INBOUND_COUNTERS=[_0x0eea('0x0'),_0x0eea('0x1'),_0x0eea('0x2'),_0x0eea('0x3'),_0x0eea('0x4'),'talking',_0x0eea('0x5')];var OUTBOUND_COUNTERS=[_0x0eea('0x0'),_0x0eea('0x6'),_0x0eea('0x7'),_0x0eea('0x1'),_0x0eea('0x2'),_0x0eea('0x8'),'outboundAbandonedCallsDay',_0x0eea('0x9'),_0x0eea('0xa'),_0x0eea('0xb'),_0x0eea('0xc'),_0x0eea('0xd'),'outboundNoSuchCallsDay',_0x0eea('0xe'),_0x0eea('0xf'),_0x0eea('0x10'),_0x0eea('0x3'),'pTalking','talking',_0x0eea('0x11'),'sumDuration','total',_0x0eea('0x5')];function VoiceQueueSummary(_0x6e9c6e){this['id']=_0x6e9c6e['id'];this['name']=_0x6e9c6e[_0x0eea('0x12')];this['strategy']=_0x6e9c6e[_0x0eea('0x13')];this['abandoned']=_0x6e9c6e[_0x0eea('0x14')]||0x0;this['answered']=_0x6e9c6e['answered']||0x0;this[_0x0eea('0x0')]=_0x6e9c6e[_0x0eea('0x0')]||0x0;this['busy']=_0x6e9c6e['busy']||0x0;this['inUse']=_0x6e9c6e[_0x0eea('0x7')]||0x0;this[_0x0eea('0x15')]=_0x6e9c6e[_0x0eea('0x15')]||0x0;this[_0x0eea('0x1')]=_0x6e9c6e[_0x0eea('0x1')]||0x0;this[_0x0eea('0x2')]=_0x6e9c6e['loggedInDb']||0x0;this[_0x0eea('0x16')]=_0x6e9c6e[_0x0eea('0x16')]||0x0;this[_0x0eea('0x17')]=_0x6e9c6e[_0x0eea('0x17')]||0x0;this['paused']=_0x6e9c6e[_0x0eea('0x3')]||0x0;this[_0x0eea('0x4')]=_0x6e9c6e[_0x0eea('0x4')]||0x0;this[_0x0eea('0x18')]=_0x6e9c6e[_0x0eea('0x18')];this[_0x0eea('0x11')]=_0x6e9c6e['sumBillable'];this[_0x0eea('0x19')]=_0x6e9c6e[_0x0eea('0x19')];this['sumHoldTime']=_0x6e9c6e[_0x0eea('0x1a')]||0x0;this[_0x0eea('0x1b')]=_0x6e9c6e[_0x0eea('0x1b')]||0x0;this[_0x0eea('0x1c')]=_0x6e9c6e['total']||0x0;this[_0x0eea('0x1d')]=_0x6e9c6e['type'];this[_0x0eea('0x1e')]=_0x6e9c6e['unavailable']||0x0;this[_0x0eea('0x1f')]=_0x6e9c6e[_0x0eea('0x1f')]||0x0;this[_0x0eea('0x20')]=_0x6e9c6e['unmanaged']||0x0;this['waiting']=_0x6e9c6e[_0x0eea('0x5')]||0x0;if(_0x6e9c6e[_0x0eea('0x1d')]===_0x0eea('0x21')){this[_0x0eea('0x22')]=_0x6e9c6e['pTalking']||0x0;this[_0x0eea('0x23')]=_0x6e9c6e[_0x0eea('0x23')];this[_0x0eea('0x24')]=_0x6e9c6e[_0x0eea('0x24')];this[_0x0eea('0x25')]=_0x6e9c6e[_0x0eea('0x25')];this[_0x0eea('0x26')]=_0x6e9c6e[_0x0eea('0x26')];this[_0x0eea('0x27')]=_0x6e9c6e[_0x0eea('0x27')];this[_0x0eea('0x28')]=_0x6e9c6e[_0x0eea('0x28')];this[_0x0eea('0x29')]=_0x6e9c6e[_0x0eea('0x29')];this[_0x0eea('0x2a')]=_0x6e9c6e[_0x0eea('0x2a')];this[_0x0eea('0x9')]=_0x6e9c6e['outboundAnswerCallsDay'];this[_0x0eea('0xa')]=_0x6e9c6e[_0x0eea('0xa')];this[_0x0eea('0xb')]=_0x6e9c6e[_0x0eea('0xb')];this[_0x0eea('0xc')]=_0x6e9c6e[_0x0eea('0xc')];this[_0x0eea('0x2b')]=_0x6e9c6e[_0x0eea('0x2b')];this['outboundDropCallsDayCallersExit']=_0x6e9c6e['outboundDropCallsDayCallersExit'];this[_0x0eea('0x2c')]=_0x6e9c6e[_0x0eea('0x2c')];this[_0x0eea('0xd')]=_0x6e9c6e[_0x0eea('0xd')];this[_0x0eea('0x2d')]=_0x6e9c6e['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x6e9c6e['outboundOriginateFailureCallsDay'];this[_0x0eea('0xe')]=_0x6e9c6e['outboundReCallsDay'];this[_0x0eea('0xf')]=_0x6e9c6e['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x6e9c6e[_0x0eea('0x10')];this[_0x0eea('0x2e')]=_0x6e9c6e[_0x0eea('0x2e')];this[_0x0eea('0x2f')]=_0x6e9c6e['predictiveIntervalAvgHoldtime'];this[_0x0eea('0x30')]=_0x6e9c6e[_0x0eea('0x30')];this[_0x0eea('0x31')]=_0x6e9c6e[_0x0eea('0x31')];this[_0x0eea('0x32')]=_0x6e9c6e[_0x0eea('0x32')];this[_0x0eea('0x33')]=_0x6e9c6e[_0x0eea('0x33')];this[_0x0eea('0x34')]=_0x6e9c6e[_0x0eea('0x34')];this['predictiveIntervalHitRate']=_0x6e9c6e['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x6e9c6e[_0x0eea('0x35')];this[_0x0eea('0x36')]=_0x6e9c6e[_0x0eea('0x36')];this[_0x0eea('0x37')]=_0x6e9c6e[_0x0eea('0x37')];this['predictiveIntervalTotalCalls']=_0x6e9c6e[_0x0eea('0x38')];this['originated']=_0x6e9c6e[_0x0eea('0x8')];this['erlangCalls']=_0x6e9c6e['erlangCalls'];this[_0x0eea('0x39')]=_0x6e9c6e[_0x0eea('0x39')];this[_0x0eea('0x3a')]=_0x6e9c6e[_0x0eea('0x3a')];this[_0x0eea('0x3b')]=_0x6e9c6e[_0x0eea('0x3b')];this[_0x0eea('0x3c')]=_0x6e9c6e['startPredictive'];this[_0x0eea('0x3d')]=_0x6e9c6e[_0x0eea('0x3d')];this['message']=_0x6e9c6e[_0x0eea('0x3e')];this[_0x0eea('0x3f')]=_0x6e9c6e[_0x0eea('0x3f')];}if(_0x6e9c6e['Trunk']){this[_0x0eea('0x40')]={'id':_0x6e9c6e[_0x0eea('0x40')]['id'],'name':_0x6e9c6e['Trunk'][_0x0eea('0x12')],'active':_0x6e9c6e['Trunk'][_0x0eea('0x41')],'callerid':_0x6e9c6e['Trunk'][_0x0eea('0x42')]};}}VoiceQueueSummary[_0x0eea('0x43')][_0x0eea('0x44')]=function(_0x155b0f,_0xe51e79,_0x381916,_0x4455bb){this['loggedInDb']=0x0;this[_0x0eea('0x1b')]=0x0;this['paused']=0x0;this[_0x0eea('0x1f')]=0x0;this[_0x0eea('0x17')]=0x0;this[_0x0eea('0x7')]=0x0;this[_0x0eea('0x45')]=0x0;this[_0x0eea('0x15')]=0x0;this[_0x0eea('0x1e')]=0x0;this[_0x0eea('0x4')]=0x0;this[_0x0eea('0x18')]=0x0;this[_0x0eea('0x16')]=0x0;if(_0x381916){if(_0x381916[_0x0eea('0x0')]){this[_0x0eea('0x0')]=Number(_0x381916[_0x0eea('0x0')]);}if(_0x381916[_0x0eea('0x46')]){this['loggedIn']=Number(_0x381916[_0x0eea('0x46')]);}if(_0x381916[_0x0eea('0x47')]){this[_0x0eea('0x5')]=Number(_0x381916['callers']);}}for(var _0x1d3034=0x0;_0x1d3034<_0x155b0f[_0x0eea('0x48')];_0x1d3034++){var _0x28a6e0=_0xe51e79['SIP/'+_0x155b0f[_0x1d3034][_0x0eea('0x12')]];if(_0x28a6e0&&_0x28a6e0[_0x0eea('0x49')]){this[_0x0eea('0x2')]+=0x1;}if(_0x155b0f[_0x1d3034][_0x0eea('0x4a')]==='1'){this[_0x0eea('0x1b')]+=0x1;}if(_0x155b0f[_0x1d3034][_0x0eea('0x3')]==='1'&&!['2','7','8'][_0x0eea('0x4b')](_0x155b0f[_0x1d3034][_0x0eea('0x4c')])){this['paused']+=0x1;}switch(_0x155b0f[_0x1d3034]['status']){case'0':this[_0x0eea('0x1f')]+=0x1;break;case'1':this[_0x0eea('0x17')]+=0x1;break;case'2':this[_0x0eea('0x7')]+=0x1;break;case'3':this[_0x0eea('0x45')]+=0x1;break;case'4':this[_0x0eea('0x15')]+=0x1;break;case'5':this[_0x0eea('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x0eea('0x18')]+=0x1;break;case'8':this[_0x0eea('0x16')]+=0x1;break;}}if(this[_0x0eea('0x24')]===_0x0eea('0x4d')){var _0x6de9c1=Object['keys'](_0x4455bb);for(var _0xb266c4=0x0;_0xb266c4<_0x6de9c1['length'];_0xb266c4++){var _0x571853=_0x6de9c1[_0xb266c4];var _0x360eb1=_0x4455bb[_0x571853];if(_0x360eb1[_0x0eea('0x4e')]===this[_0x0eea('0x12')]&&_0x360eb1[_0x0eea('0x1d')]===_0x0eea('0x4f')&&_0x360eb1['exten']===_0x0eea('0x50')){this[_0x0eea('0x1b')]+=0x1;}}if(this[_0x0eea('0x1b')]>this[_0x0eea('0x7')]){this[_0x0eea('0x1b')]=this[_0x0eea('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype'][_0x0eea('0x51')]=function(_0x5c1ef){var _0x3f118d=![];if(_0x5c1ef){_0x3f118d=INBOUND_COUNTERS[_0x0eea('0x52')](function(_0x4e1cfd){return this[_0x4e1cfd]!==_0x5c1ef[_0x4e1cfd];},this);}return _0x3f118d;};VoiceQueueSummary[_0x0eea('0x43')][_0x0eea('0x53')]=function(_0x562e6f){var _0x2a3a4e=![];var _0x217dac=![];var _0x30e6c9=![];if(_0x562e6f){_0x2a3a4e=this[_0x0eea('0x24')]!==_0x562e6f['dialMethod']||this[_0x0eea('0x23')]!==_0x562e6f[_0x0eea('0x23')]||this[_0x0eea('0x3e')]!==_0x562e6f[_0x0eea('0x3e')]||this[_0x0eea('0x3f')]!==_0x562e6f[_0x0eea('0x3f')];_0x217dac=OUTBOUND_COUNTERS[_0x0eea('0x52')](function(_0x4cf65b){return this[_0x4cf65b]!==_0x562e6f[_0x4cf65b];},this);if(this[_0x0eea('0x40')]&&_0x562e6f[_0x0eea('0x40')]){_0x30e6c9=this['Trunk'][_0x0eea('0x12')]!==_0x562e6f[_0x0eea('0x40')][_0x0eea('0x12')]||this[_0x0eea('0x40')][_0x0eea('0x41')]!==_0x562e6f[_0x0eea('0x40')]['active'];}}return _0x2a3a4e||_0x217dac||_0x30e6c9;};VoiceQueueSummary[_0x0eea('0x43')][_0x0eea('0x54')]=function(_0x29055c){this['answered']=_0x29055c[_0x0eea('0x6')];this[_0x0eea('0x3e')]=_0x29055c[_0x0eea('0x3e')];this[_0x0eea('0x3f')]=_0x29055c[_0x0eea('0x3f')];this['originated']=_0x29055c[_0x0eea('0x8')];this[_0x0eea('0x55')]=_0x29055c[_0x0eea('0x55')];this[_0x0eea('0x9')]=_0x29055c['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x29055c[_0x0eea('0xa')];this[_0x0eea('0xb')]=_0x29055c[_0x0eea('0xb')];this[_0x0eea('0xc')]=_0x29055c['outboundCongestionCallsDay'];this[_0x0eea('0xd')]=_0x29055c[_0x0eea('0xd')];this[_0x0eea('0x2d')]=_0x29055c['outboundNoSuchCallsDay'];this[_0x0eea('0xe')]=_0x29055c[_0x0eea('0xe')];this[_0x0eea('0xf')]=_0x29055c[_0x0eea('0xf')];this[_0x0eea('0x10')]=_0x29055c[_0x0eea('0x10')];this[_0x0eea('0x11')]=_0x29055c['sumBillable'];this[_0x0eea('0x19')]=_0x29055c['sumDuration'];this[_0x0eea('0x1c')]=_0x29055c[_0x0eea('0x1c')];if(this[_0x0eea('0x24')]===_0x0eea('0x56')){this[_0x0eea('0x22')]=_0x29055c['pTalking'];}};module[_0x0eea('0x57')]=VoiceQueueSummary; \ No newline at end of file +var _0xdb70=['outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','includes','status','booked','queue','some','compareToOutboundQueue','dialMethod','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay'];(function(_0x593250,_0x39b92c){var _0x5a9900=function(_0x537a61){while(--_0x537a61){_0x593250['push'](_0x593250['shift']());}};_0x5a9900(++_0x39b92c);}(_0xdb70,0xa0));var _0x0db7=function(_0x581bd4,_0x12c35f){_0x581bd4=_0x581bd4-0x0;var _0x5c0fe2=_0xdb70[_0x581bd4];return _0x5c0fe2;};'use strict';var INBOUND_COUNTERS=[_0x0db7('0x0'),_0x0db7('0x1'),_0x0db7('0x2'),'paused',_0x0db7('0x3'),_0x0db7('0x4'),_0x0db7('0x5')];var OUTBOUND_COUNTERS=[_0x0db7('0x0'),_0x0db7('0x6'),_0x0db7('0x7'),_0x0db7('0x1'),_0x0db7('0x2'),_0x0db7('0x8'),_0x0db7('0x9'),_0x0db7('0xa'),'outboundBlacklistCallsDay',_0x0db7('0xb'),_0x0db7('0xc'),_0x0db7('0xd'),_0x0db7('0xe'),_0x0db7('0xf'),_0x0db7('0x10'),'outboundUnknownCallsDay',_0x0db7('0x11'),_0x0db7('0x12'),'talking',_0x0db7('0x13'),_0x0db7('0x14'),_0x0db7('0x15'),_0x0db7('0x5')];function VoiceQueueSummary(_0x4e6f65){this['id']=_0x4e6f65['id'];this[_0x0db7('0x16')]=_0x4e6f65['name'];this[_0x0db7('0x17')]=_0x4e6f65[_0x0db7('0x17')];this[_0x0db7('0x18')]=_0x4e6f65[_0x0db7('0x18')]||0x0;this[_0x0db7('0x6')]=_0x4e6f65['answered']||0x0;this[_0x0db7('0x0')]=_0x4e6f65[_0x0db7('0x0')]||0x0;this[_0x0db7('0x19')]=_0x4e6f65[_0x0db7('0x19')]||0x0;this[_0x0db7('0x7')]=_0x4e6f65[_0x0db7('0x7')]||0x0;this[_0x0db7('0x1a')]=_0x4e6f65[_0x0db7('0x1a')]||0x0;this[_0x0db7('0x1')]=_0x4e6f65[_0x0db7('0x1')]||0x0;this['loggedInDb']=_0x4e6f65[_0x0db7('0x2')]||0x0;this[_0x0db7('0x1b')]=_0x4e6f65[_0x0db7('0x1b')]||0x0;this[_0x0db7('0x1c')]=_0x4e6f65[_0x0db7('0x1c')]||0x0;this[_0x0db7('0x11')]=_0x4e6f65['paused']||0x0;this['ringing']=_0x4e6f65[_0x0db7('0x3')]||0x0;this[_0x0db7('0x1d')]=_0x4e6f65[_0x0db7('0x1d')];this['sumBillable']=_0x4e6f65[_0x0db7('0x13')];this[_0x0db7('0x14')]=_0x4e6f65[_0x0db7('0x14')];this[_0x0db7('0x1e')]=_0x4e6f65['sumHoldTime']||0x0;this[_0x0db7('0x4')]=_0x4e6f65['talking']||0x0;this[_0x0db7('0x15')]=_0x4e6f65['total']||0x0;this['type']=_0x4e6f65[_0x0db7('0x1f')];this[_0x0db7('0x20')]=_0x4e6f65[_0x0db7('0x20')]||0x0;this[_0x0db7('0x21')]=_0x4e6f65[_0x0db7('0x21')]||0x0;this[_0x0db7('0x22')]=_0x4e6f65[_0x0db7('0x22')]||0x0;this[_0x0db7('0x5')]=_0x4e6f65[_0x0db7('0x5')]||0x0;if(_0x4e6f65[_0x0db7('0x1f')]===_0x0db7('0x23')){this[_0x0db7('0x12')]=_0x4e6f65[_0x0db7('0x12')]||0x0;this[_0x0db7('0x24')]=_0x4e6f65['dialActive'];this['dialMethod']=_0x4e6f65['dialMethod'];this['dialOriginateCallerIdName']=_0x4e6f65['dialOriginateCallerIdName'];this[_0x0db7('0x25')]=_0x4e6f65[_0x0db7('0x25')];this[_0x0db7('0x26')]=_0x4e6f65['dialOriginateTimeout'];this['dialPrefix']=_0x4e6f65[_0x0db7('0x27')];this[_0x0db7('0x28')]=_0x4e6f65[_0x0db7('0x28')];this[_0x0db7('0x29')]=_0x4e6f65[_0x0db7('0x29')];this[_0x0db7('0xa')]=_0x4e6f65['outboundAnswerCallsDay'];this[_0x0db7('0x2a')]=_0x4e6f65['outboundBlacklistCallsDay'];this[_0x0db7('0xb')]=_0x4e6f65[_0x0db7('0xb')];this[_0x0db7('0xc')]=_0x4e6f65[_0x0db7('0xc')];this['outboundDropCallsDayACS']=_0x4e6f65[_0x0db7('0x2b')];this['outboundDropCallsDayCallersExit']=_0x4e6f65[_0x0db7('0x2c')];this[_0x0db7('0x2d')]=_0x4e6f65[_0x0db7('0x2d')];this['outboundNoAnswerCallsDay']=_0x4e6f65[_0x0db7('0xd')];this[_0x0db7('0xe')]=_0x4e6f65['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x4e6f65[_0x0db7('0x2e')];this[_0x0db7('0xf')]=_0x4e6f65[_0x0db7('0xf')];this['outboundRejectCallsDay']=_0x4e6f65['outboundRejectCallsDay'];this[_0x0db7('0x2f')]=_0x4e6f65[_0x0db7('0x2f')];this[_0x0db7('0x30')]=_0x4e6f65['predictiveIntervalAnsweredCalls'];this[_0x0db7('0x31')]=_0x4e6f65[_0x0db7('0x31')];this[_0x0db7('0x32')]=_0x4e6f65[_0x0db7('0x32')];this['predictiveIntervalDroppedCallsCallersExit']=_0x4e6f65[_0x0db7('0x33')];this['predictiveIntervalDroppedCallsTimeout']=_0x4e6f65[_0x0db7('0x34')];this['predictiveIntervalErlangCalls']=_0x4e6f65[_0x0db7('0x35')];this[_0x0db7('0x36')]=_0x4e6f65[_0x0db7('0x36')];this['predictiveIntervalHitRate']=_0x4e6f65['predictiveIntervalHitRate'];this[_0x0db7('0x37')]=_0x4e6f65[_0x0db7('0x37')];this[_0x0db7('0x38')]=_0x4e6f65[_0x0db7('0x38')];this[_0x0db7('0x39')]=_0x4e6f65[_0x0db7('0x39')];this['predictiveIntervalTotalCalls']=_0x4e6f65[_0x0db7('0x3a')];this[_0x0db7('0x8')]=_0x4e6f65['originated'];this[_0x0db7('0x3b')]=_0x4e6f65['erlangCalls'];this[_0x0db7('0x3c')]=_0x4e6f65['erlangCallToSecond'];this[_0x0db7('0x3d')]=_0x4e6f65[_0x0db7('0x3d')];this['erlangBusyFactor']=_0x4e6f65[_0x0db7('0x3e')];this[_0x0db7('0x3f')]=_0x4e6f65['startPredictive'];this[_0x0db7('0x40')]=_0x4e6f65['startProgressive'];this[_0x0db7('0x41')]=_0x4e6f65[_0x0db7('0x41')];this[_0x0db7('0x42')]=_0x4e6f65[_0x0db7('0x42')];}if(_0x4e6f65[_0x0db7('0x43')]){this['Trunk']={'id':_0x4e6f65[_0x0db7('0x43')]['id'],'name':_0x4e6f65[_0x0db7('0x43')][_0x0db7('0x16')],'active':_0x4e6f65[_0x0db7('0x43')][_0x0db7('0x44')],'callerid':_0x4e6f65[_0x0db7('0x43')][_0x0db7('0x45')]};}}VoiceQueueSummary[_0x0db7('0x46')][_0x0db7('0x47')]=function(_0x4591fe,_0x27e541,_0x3db78d,_0x58fee1){this[_0x0db7('0x2')]=0x0;this['talking']=0x0;this[_0x0db7('0x11')]=0x0;this[_0x0db7('0x21')]=0x0;this['notInUse']=0x0;this[_0x0db7('0x7')]=0x0;this['busy']=0x0;this[_0x0db7('0x1a')]=0x0;this[_0x0db7('0x20')]=0x0;this[_0x0db7('0x3')]=0x0;this[_0x0db7('0x1d')]=0x0;this[_0x0db7('0x1b')]=0x0;if(_0x3db78d){if(_0x3db78d[_0x0db7('0x0')]){this[_0x0db7('0x0')]=Number(_0x3db78d[_0x0db7('0x0')]);}if(_0x3db78d[_0x0db7('0x48')]){this['loggedIn']=Number(_0x3db78d['loggedin']);}if(_0x3db78d['callers']){this[_0x0db7('0x5')]=Number(_0x3db78d[_0x0db7('0x49')]);}}for(var _0x45e68c=0x0;_0x45e68c<_0x4591fe[_0x0db7('0x4a')];_0x45e68c++){var _0x1badb1=_0x27e541[_0x0db7('0x4b')+_0x4591fe[_0x45e68c]['name']];if(_0x1badb1&&_0x1badb1[_0x0db7('0x4c')]){this[_0x0db7('0x2')]+=0x1;}if(_0x4591fe[_0x45e68c]['incall']==='1'){this[_0x0db7('0x4')]+=0x1;}if(_0x4591fe[_0x45e68c][_0x0db7('0x11')]==='1'&&!['2','7','8'][_0x0db7('0x4d')](_0x4591fe[_0x45e68c]['status'])){this[_0x0db7('0x11')]+=0x1;}switch(_0x4591fe[_0x45e68c][_0x0db7('0x4e')]){case'0':this[_0x0db7('0x21')]+=0x1;break;case'1':this[_0x0db7('0x1c')]+=0x1;break;case'2':this[_0x0db7('0x7')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x0db7('0x1a')]+=0x1;break;case'5':this[_0x0db7('0x20')]+=0x1;break;case'6':this[_0x0db7('0x3')]+=0x1;break;case'7':this[_0x0db7('0x1d')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0x0db7('0x4f')){var _0x4c671a=Object['keys'](_0x58fee1);for(var _0x3281bd=0x0;_0x3281bd<_0x4c671a[_0x0db7('0x4a')];_0x3281bd++){var _0x4c2544=_0x4c671a[_0x3281bd];var _0x44b795=_0x58fee1[_0x4c2544];if(_0x44b795[_0x0db7('0x50')]===this[_0x0db7('0x16')]&&_0x44b795[_0x0db7('0x1f')]==='dialer'&&_0x44b795['exten']==='xcally-motion-preview'){this[_0x0db7('0x4')]+=0x1;}}if(this[_0x0db7('0x4')]>this[_0x0db7('0x7')]){this[_0x0db7('0x4')]=this['inUse'];}this[_0x0db7('0x12')]=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x4f9a51){var _0x3f2ac9=![];if(_0x4f9a51){_0x3f2ac9=INBOUND_COUNTERS[_0x0db7('0x51')](function(_0x12bfda){return this[_0x12bfda]!==_0x4f9a51[_0x12bfda];},this);}return _0x3f2ac9;};VoiceQueueSummary[_0x0db7('0x46')][_0x0db7('0x52')]=function(_0x4d746a){var _0x2c597e=![];var _0x1f19e=![];var _0x48267d=![];if(_0x4d746a){_0x2c597e=this['dialMethod']!==_0x4d746a[_0x0db7('0x53')]||this[_0x0db7('0x24')]!==_0x4d746a['dialActive']||this['message']!==_0x4d746a['message']||this[_0x0db7('0x42')]!==_0x4d746a[_0x0db7('0x42')];_0x1f19e=OUTBOUND_COUNTERS[_0x0db7('0x51')](function(_0x161b3c){return this[_0x161b3c]!==_0x4d746a[_0x161b3c];},this);if(this['Trunk']&&_0x4d746a[_0x0db7('0x43')]){_0x48267d=this[_0x0db7('0x43')][_0x0db7('0x16')]!==_0x4d746a[_0x0db7('0x43')]['name']||this['Trunk']['active']!==_0x4d746a[_0x0db7('0x43')]['active'];}}return _0x2c597e||_0x1f19e||_0x48267d;};VoiceQueueSummary[_0x0db7('0x46')][_0x0db7('0x54')]=function(_0x54f32a){this[_0x0db7('0x6')]=_0x54f32a[_0x0db7('0x6')];this[_0x0db7('0x41')]=_0x54f32a[_0x0db7('0x41')];this[_0x0db7('0x42')]=_0x54f32a[_0x0db7('0x42')];this[_0x0db7('0x8')]=_0x54f32a[_0x0db7('0x8')];this['outboundAbandonedCallsDay']=_0x54f32a[_0x0db7('0x9')];this[_0x0db7('0xa')]=_0x54f32a['outboundAnswerCallsDay'];this[_0x0db7('0x2a')]=_0x54f32a['outboundBlacklistCallsDay'];this[_0x0db7('0xb')]=_0x54f32a['outboundBusyCallsDay'];this[_0x0db7('0xc')]=_0x54f32a[_0x0db7('0xc')];this[_0x0db7('0xd')]=_0x54f32a[_0x0db7('0xd')];this[_0x0db7('0xe')]=_0x54f32a[_0x0db7('0xe')];this['outboundReCallsDay']=_0x54f32a[_0x0db7('0xf')];this[_0x0db7('0x10')]=_0x54f32a[_0x0db7('0x10')];this['outboundUnknownCallsDay']=_0x54f32a[_0x0db7('0x2f')];this[_0x0db7('0x13')]=_0x54f32a[_0x0db7('0x13')];this[_0x0db7('0x14')]=_0x54f32a['sumDuration'];this['total']=_0x54f32a[_0x0db7('0x15')];if(this['dialMethod']===_0x0db7('0x55')){this[_0x0db7('0x12')]=_0x54f32a['pTalking'];}};module[_0x0db7('0x56')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index c02937c..3172054 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 _0xffb8=['Configurations','exports','name','accessKey','remoteUri','serverUrl'];(function(_0x211149,_0x2c95bb){var _0x26db7e=function(_0x40e4fe){while(--_0x40e4fe){_0x211149['push'](_0x211149['shift']());}};_0x26db7e(++_0x2c95bb);}(_0xffb8,0x164));var _0x8ffb=function(_0x155d2a,_0x2f7a99){_0x155d2a=_0x155d2a-0x0;var _0x24a26f=_0xffb8[_0x155d2a];return _0x24a26f;};'use strict';function VtigerAccount(_0x578c3f){this['id']=_0x578c3f['id']||0x0;this[_0x8ffb('0x0')]=_0x578c3f[_0x8ffb('0x0')]||'';this['username']=_0x578c3f['username']||'';this[_0x8ffb('0x1')]=_0x578c3f['accessKey']||'';this[_0x8ffb('0x2')]=_0x578c3f[_0x8ffb('0x2')]||'';this[_0x8ffb('0x3')]=_0x578c3f[_0x8ffb('0x3')]||'';this[_0x8ffb('0x4')]=_0x578c3f[_0x8ffb('0x4')]||{};}module[_0x8ffb('0x5')]=VtigerAccount; \ No newline at end of file +var _0x3709=['accessKey','remoteUri','Configurations','exports','name','username'];(function(_0x4f4f0a,_0x452f48){var _0x2ba6ed=function(_0x10a67f){while(--_0x10a67f){_0x4f4f0a['push'](_0x4f4f0a['shift']());}};_0x2ba6ed(++_0x452f48);}(_0x3709,0xb2));var _0x9370=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x3709[_0x297fd3];return _0x2af381;};'use strict';function VtigerAccount(_0x341770){this['id']=_0x341770['id']||0x0;this[_0x9370('0x0')]=_0x341770[_0x9370('0x0')]||'';this['username']=_0x341770[_0x9370('0x1')]||'';this[_0x9370('0x2')]=_0x341770[_0x9370('0x2')]||'';this['remoteUri']=_0x341770[_0x9370('0x3')]||'';this['serverUrl']=_0x341770['serverUrl']||'';this[_0x9370('0x4')]=_0x341770['Configurations']||{};}module[_0x9370('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 035e325..5419eaf 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 _0x5263=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x36702a,_0x7a2902){var _0x4a4730=function(_0x53ec67){while(--_0x53ec67){_0x36702a['push'](_0x36702a['shift']());}};_0x4a4730(++_0x7a2902);}(_0x5263,0x1a4));var _0x3526=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x5263[_0x3b0731];return _0x4204d7;};'use strict';function ZendeskAccount(_0x3bc4a8){this['id']=_0x3bc4a8['id']||0x0;this[_0x3526('0x0')]=_0x3bc4a8[_0x3526('0x0')]||'';this[_0x3526('0x1')]=_0x3bc4a8[_0x3526('0x1')]||'';this[_0x3526('0x2')]=_0x3bc4a8[_0x3526('0x2')]||'';this[_0x3526('0x3')]=_0x3bc4a8[_0x3526('0x3')]||'';this[_0x3526('0x4')]=_0x3bc4a8[_0x3526('0x4')]||'';this['authType']=_0x3bc4a8[_0x3526('0x5')]||'';this[_0x3526('0x6')]=_0x3bc4a8[_0x3526('0x6')]||_0x3526('0x7');this['serverUrl']=_0x3bc4a8[_0x3526('0x8')]||'';this[_0x3526('0x9')]=_0x3bc4a8['Configurations']||{};}module[_0x3526('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x7d4f=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x7f6e9,_0x2cf772){var _0x5a3124=function(_0x4d1156){while(--_0x4d1156){_0x7f6e9['push'](_0x7f6e9['shift']());}};_0x5a3124(++_0x2cf772);}(_0x7d4f,0x19c));var _0xf7d4=function(_0x4a9d87,_0x2cc20f){_0x4a9d87=_0x4a9d87-0x0;var _0x1ad978=_0x7d4f[_0x4a9d87];return _0x1ad978;};'use strict';function ZendeskAccount(_0x4e58ab){this['id']=_0x4e58ab['id']||0x0;this['name']=_0x4e58ab[_0xf7d4('0x0')]||'';this[_0xf7d4('0x1')]=_0x4e58ab[_0xf7d4('0x1')]||'';this[_0xf7d4('0x2')]=_0x4e58ab['password']||'';this[_0xf7d4('0x3')]=_0x4e58ab[_0xf7d4('0x3')]||'';this[_0xf7d4('0x4')]=_0x4e58ab['remoteUri']||'';this[_0xf7d4('0x5')]=_0x4e58ab[_0xf7d4('0x5')]||'';this[_0xf7d4('0x6')]=_0x4e58ab[_0xf7d4('0x6')]||_0xf7d4('0x7');this[_0xf7d4('0x8')]=_0x4e58ab[_0xf7d4('0x8')]||'';this[_0xf7d4('0x9')]=_0x4e58ab['Configurations']||{};}module[_0xf7d4('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index f740e19..09b772e 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 _0x9f00=['zone','clientId','serverUrl','code','refreshToken','Configurations','name','description','host'];(function(_0x930141,_0x4367c2){var _0x5bbad7=function(_0x1c9ba2){while(--_0x1c9ba2){_0x930141['push'](_0x930141['shift']());}};_0x5bbad7(++_0x4367c2);}(_0x9f00,0x69));var _0x09f0=function(_0x4237dc,_0x171899){_0x4237dc=_0x4237dc-0x0;var _0x35ed7f=_0x9f00[_0x4237dc];return _0x35ed7f;};'use strict';function ZohoAccount(_0x5ddf0b){this['id']=_0x5ddf0b['id']||0x0;this['name']=_0x5ddf0b[_0x09f0('0x0')]||'';this[_0x09f0('0x1')]=_0x5ddf0b[_0x09f0('0x1')]||'';this[_0x09f0('0x2')]=_0x5ddf0b[_0x09f0('0x2')]||'';this[_0x09f0('0x3')]=_0x5ddf0b[_0x09f0('0x3')]||'';this[_0x09f0('0x4')]=_0x5ddf0b[_0x09f0('0x4')]||'';this['clientSecret']=_0x5ddf0b['clientSecret']||'';this[_0x09f0('0x5')]=_0x5ddf0b['serverUrl']||'';this['code']=_0x5ddf0b[_0x09f0('0x6')]||'';this[_0x09f0('0x7')]=_0x5ddf0b[_0x09f0('0x7')]||'';this['Configurations']=_0x5ddf0b[_0x09f0('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xbfba=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0x4e8236,_0x2b2720){var _0x3f5e47=function(_0x455b7a){while(--_0x455b7a){_0x4e8236['push'](_0x4e8236['shift']());}};_0x3f5e47(++_0x2b2720);}(_0xbfba,0x145));var _0xabfb=function(_0x391e33,_0x448af9){_0x391e33=_0x391e33-0x0;var _0x5cdf62=_0xbfba[_0x391e33];return _0x5cdf62;};'use strict';function ZohoAccount(_0x37f7f4){this['id']=_0x37f7f4['id']||0x0;this[_0xabfb('0x0')]=_0x37f7f4['name']||'';this[_0xabfb('0x1')]=_0x37f7f4['description']||'';this[_0xabfb('0x2')]=_0x37f7f4[_0xabfb('0x2')]||'';this[_0xabfb('0x3')]=_0x37f7f4['zone']||'';this[_0xabfb('0x4')]=_0x37f7f4[_0xabfb('0x4')]||'';this['clientSecret']=_0x37f7f4[_0xabfb('0x5')]||'';this[_0xabfb('0x6')]=_0x37f7f4[_0xabfb('0x6')]||'';this[_0xabfb('0x7')]=_0x37f7f4[_0xabfb('0x7')]||'';this[_0xabfb('0x8')]=_0x37f7f4[_0xabfb('0x8')]||'';this[_0xabfb('0x9')]=_0x37f7f4['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 4c1bb55..afded0f 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 _0x4888=['SIP/%s','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','calleridname','number','exports','lodash','moment','isNil','string','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent'];(function(_0x3d5c91,_0x47cdbe){var _0x2fb2d8=function(_0x5eec7a){while(--_0x5eec7a){_0x3d5c91['push'](_0x3d5c91['shift']());}};_0x2fb2d8(++_0x47cdbe);}(_0x4888,0x198));var _0x8488=function(_0x59fc33,_0x2e182d){_0x59fc33=_0x59fc33-0x0;var _0x39066f=_0x4888[_0x59fc33];return _0x39066f;};'use strict';var util=require('util');var _=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));function checkNameSurname(_0x2af900,_0x13b2f0,_0x257275){var _0xacc8f0='';if(!_[_0x8488('0x2')](_0x13b2f0)&&'string'===typeof _0x13b2f0){_0xacc8f0+=_0x13b2f0;}if(!_[_0x8488('0x2')](_0x257275)&&_0x8488('0x3')===typeof _0x257275){_0xacc8f0+='\x20'+_0x257275;}if(_0xacc8f0!==''){return _0xacc8f0;}return _0x2af900;}function Action(_0x1a97f4,_0x421292,_0x326887,_0x19e508,_0x5250a1){this['uniqueid']=_0x326887||undefined;this['idContact']=_0x1a97f4['id'];this['queue']=_0x421292[_0x8488('0x4')];this[_0x8488('0x5')]=_0x421292['type'];this[_0x8488('0x6')]=_0x8488('0x7');this[_0x8488('0x8')]=![];this[_0x8488('0x9')]=_['isNil'](_0x1a97f4[_0x8488('0xa')])?undefined:_0x1a97f4[_0x8488('0xa')][_0x8488('0x4')];this[_0x8488('0xb')]=this[_0x8488('0x9')]?util['format'](_0x8488('0xc'),this[_0x8488('0x9')]):_0x19e508||undefined;this['calleridname']=checkNameSurname(_0x1a97f4['Contact'][_0x8488('0xd')],_0x1a97f4['Contact'][_0x8488('0xe')],_0x1a97f4['Contact']['lastName']);this[_0x8488('0xf')]=_0x1a97f4[_0x8488('0xf')]||![];this[_0x8488('0x10')]=_0x1a97f4[_0x8488('0xd')];this[_0x8488('0x11')]=_0x1a97f4[_0x8488('0x11')];this[_0x8488('0x12')]=_0x1a97f4['countbusyretry']||0x0;this[_0x8488('0x13')]=_0x1a97f4[_0x8488('0x13')]||0x0;this[_0x8488('0x14')]=_0x1a97f4[_0x8488('0x14')]||0x0;this[_0x8488('0x15')]=(_0x1a97f4[_0x8488('0x12')]||0x0)+(_0x1a97f4[_0x8488('0x13')]||0x0)+(_0x1a97f4[_0x8488('0x14')]||0x0)+(_0x1a97f4[_0x8488('0x16')]||0x0)+(_0x1a97f4[_0x8488('0x17')]||0x0)+(_0x1a97f4[_0x8488('0x18')]||0x0)+(_0x1a97f4[_0x8488('0x19')]||0x0)+(_0x1a97f4[_0x8488('0x1a')]||0x0);this['countnosuchnumberretry']=_0x1a97f4['countnosuchnumberretry']||0x0;this[_0x8488('0x17')]=_0x1a97f4[_0x8488('0x17')]||0x0;this[_0x8488('0x18')]=_0x1a97f4[_0x8488('0x18')]||0x0;this[_0x8488('0x19')]=_0x1a97f4[_0x8488('0x19')]||0x0;this[_0x8488('0x1a')]=_0x1a97f4[_0x8488('0x1a')]||0x0;this[_0x8488('0x1b')]=_0x1a97f4['callback'];this[_0x8488('0x1c')]=_0x1a97f4[_0x8488('0x1c')];this[_0x8488('0x1d')]=_0x1a97f4[_0x8488('0x1d')];this[_0x8488('0x1e')]=_0x1a97f4['recallme'];this['ContactId']=_0x1a97f4['ContactId'];this['ListId']=_0x1a97f4[_0x8488('0x1f')];this['UserId']=_['isNil'](_0x1a97f4[_0x8488('0xa')])?_0x1a97f4[_0x8488('0x20')]:_0x1a97f4[_0x8488('0xa')]['id'];this[_0x8488('0x21')]=_0x1a97f4[_0x8488('0x21')];this['originatecalleridnum']='';this[_0x8488('0x22')]='';}Action[_0x8488('0x23')][_0x8488('0x24')]=function(){return util[_0x8488('0x25')](_0x8488('0x26'),this[_0x8488('0x27')],this[_0x8488('0x28')]);};module[_0x8488('0x29')]=Action; \ No newline at end of file +var _0xda2d=['lodash','moment','isNil','string','uniqueid','idContact','queue','type','dialAnswer','membername','Agent','name','channelAgent','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','exports'];(function(_0xe27035,_0x1f4876){var _0x3745bc=function(_0xfa83f4){while(--_0xfa83f4){_0xe27035['push'](_0xe27035['shift']());}};_0x3745bc(++_0x1f4876);}(_0xda2d,0x102));var _0xdda2=function(_0x4a680d,_0x1e1662){_0x4a680d=_0x4a680d-0x0;var _0x49a604=_0xda2d[_0x4a680d];return _0x49a604;};'use strict';var util=require('util');var _=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));function checkNameSurname(_0xd495d2,_0x1f1fcc,_0x329c5e){var _0x58973d='';if(!_['isNil'](_0x1f1fcc)&&'string'===typeof _0x1f1fcc){_0x58973d+=_0x1f1fcc;}if(!_[_0xdda2('0x2')](_0x329c5e)&&_0xdda2('0x3')===typeof _0x329c5e){_0x58973d+='\x20'+_0x329c5e;}if(_0x58973d!==''){return _0x58973d;}return _0xd495d2;}function Action(_0x2965a5,_0x39f6c9,_0xc256bc,_0xf38e58,_0x2f55dc){this[_0xdda2('0x4')]=_0xc256bc||undefined;this[_0xdda2('0x5')]=_0x2965a5['id'];this[_0xdda2('0x6')]=_0x39f6c9['name'];this[_0xdda2('0x7')]=_0x39f6c9[_0xdda2('0x7')];this['campaigntype']=_0xdda2('0x6');this[_0xdda2('0x8')]=![];this[_0xdda2('0x9')]=_[_0xdda2('0x2')](_0x2965a5[_0xdda2('0xa')])?undefined:_0x2965a5[_0xdda2('0xa')][_0xdda2('0xb')];this[_0xdda2('0xc')]=this['membername']?util['format']('SIP/%s',this[_0xdda2('0x9')]):_0xf38e58||undefined;this[_0xdda2('0xd')]=checkNameSurname(_0x2965a5[_0xdda2('0xe')][_0xdda2('0xf')],_0x2965a5[_0xdda2('0xe')][_0xdda2('0x10')],_0x2965a5[_0xdda2('0xe')]['lastName']);this[_0xdda2('0x11')]=_0x2965a5['active']||![];this[_0xdda2('0x12')]=_0x2965a5[_0xdda2('0xf')];this[_0xdda2('0x13')]=_0x2965a5[_0xdda2('0x13')];this[_0xdda2('0x14')]=_0x2965a5['countbusyretry']||0x0;this['countcongestionretry']=_0x2965a5[_0xdda2('0x15')]||0x0;this['countnoanswerretry']=_0x2965a5[_0xdda2('0x16')]||0x0;this[_0xdda2('0x17')]=(_0x2965a5[_0xdda2('0x14')]||0x0)+(_0x2965a5[_0xdda2('0x15')]||0x0)+(_0x2965a5[_0xdda2('0x16')]||0x0)+(_0x2965a5[_0xdda2('0x18')]||0x0)+(_0x2965a5[_0xdda2('0x19')]||0x0)+(_0x2965a5[_0xdda2('0x1a')]||0x0)+(_0x2965a5[_0xdda2('0x1b')]||0x0)+(_0x2965a5[_0xdda2('0x1c')]||0x0);this[_0xdda2('0x18')]=_0x2965a5[_0xdda2('0x18')]||0x0;this['countdropretry']=_0x2965a5[_0xdda2('0x19')]||0x0;this['countabandonedretry']=_0x2965a5[_0xdda2('0x1a')]||0x0;this[_0xdda2('0x1b')]=_0x2965a5[_0xdda2('0x1b')]||0x0;this['countagentrejectretry']=_0x2965a5[_0xdda2('0x1c')]||0x0;this['callback']=_0x2965a5[_0xdda2('0x1d')];this[_0xdda2('0x1e')]=_0x2965a5['callbackuniqueid'];this[_0xdda2('0x1f')]=_0x2965a5[_0xdda2('0x1f')];this[_0xdda2('0x20')]=_0x2965a5[_0xdda2('0x20')];this[_0xdda2('0x21')]=_0x2965a5['ContactId'];this[_0xdda2('0x22')]=_0x2965a5[_0xdda2('0x22')];this[_0xdda2('0x23')]=_[_0xdda2('0x2')](_0x2965a5['Agent'])?_0x2965a5['UserId']:_0x2965a5[_0xdda2('0xa')]['id'];this[_0xdda2('0x24')]=_0x2965a5[_0xdda2('0x24')];this['originatecalleridnum']='';this[_0xdda2('0x25')]='';}Action[_0xdda2('0x26')][_0xdda2('0x27')]=function(){return util[_0xdda2('0x28')](_0xdda2('0x29'),this[_0xdda2('0xd')],this['number']);};module[_0xdda2('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index cdf0e00..1d2d27a 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 _0x0278=['dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','phone','lookAgent','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','Empty\x20Contact','Queue','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[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','execCall','Trunk','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','setXMDContactVariables','Contact','merge','toLowerVariables','starttime','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','filterKey','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','lodash','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','../dialer/utils','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','type','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','queue','originated:\x20','stringify','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','format','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','sendMessageOneNotActive','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','activeContact','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0x0278,0x7d));var _0x8027=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x0278[_0x4fde08];return _0x12e725;};'use strict';var util=require('util');var _=require(_0x8027('0x0'));var uuid=require(_0x8027('0x1'));var moment=require(_0x8027('0x2'));var Redis=require(_0x8027('0x3'));var config=require(_0x8027('0x4'));var logger=require('../../../config/logger')(_0x8027('0x5'));var loggerAction=require(_0x8027('0x6'))(_0x8027('0x7'));var ami=require(_0x8027('0x8'));var rpcDb=require(_0x8027('0x9'));var cmHopperAdditionalPhone=require(_0x8027('0xa'));var Action=require('./action');var ut=require(_0x8027('0xb'));var utils=require(_0x8027('0xc'));config[_0x8027('0xd')]=_[_0x8027('0xe')](config[_0x8027('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x8027('0xf'))(new Redis(config[_0x8027('0xd')]));var Sequence=function(){};Sequence[_0x8027('0x10')]['enqueue']=function(_0x404c05){this['tail']=this[_0x8027('0x11')]?this[_0x8027('0x11')][_0x8027('0x12')](_0x404c05):_0x404c05();};function Preview(_0x4eef66){this[_0x8027('0x13')]=new Sequence();this[_0x8027('0x14')]=_0x4eef66[_0x8027('0x15')];this[_0x8027('0x16')]=_0x4eef66['trunks'];this[_0x8027('0x17')]={};this[_0x8027('0x18')]=_0x4eef66[_0x8027('0x18')];this[_0x8027('0x19')]=0x0;ami['on'](_0x8027('0x1a'),this[_0x8027('0x1b')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x1d'),this['syncHangup'][_0x8027('0x1c')](this));ami['on']('hanguprequest',this[_0x8027('0x1e')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x1f'),this[_0x8027('0x20')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x21'),this[_0x8027('0x22')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x23'),this[_0x8027('0x24')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x25'),this[_0x8027('0x26')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x27'),this[_0x8027('0x28')][_0x8027('0x1c')](this));this[_0x8027('0x29')](this[_0x8027('0x14')]);}function emit(_0x26f6aa,_0x396ac3,_0x5078fc){io['to'](_0x26f6aa)[_0x8027('0x2a')](_0x396ac3,_0x5078fc);}function emitVoiceQueueChannelRemove(_0x20eff1){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x20eff1));emit(util['format'](_0x8027('0x2b'),_0x20eff1['name']),_0x8027('0x2c'),_0x20eff1);io['emit'](_0x8027('0x2d'),_0x20eff1);}function notSendMessagesQueue(_0xd56427){if(_0xd56427['sendMessageOneNotActive']){if(_0xd56427[_0x8027('0x2e')]===0x0&&_0xd56427[_0x8027('0x2f')]===0x0){_0xd56427['sendMessageOneNotActive']=![];_0xd56427[_0x8027('0x30')]=0x0;_0xd56427[_0x8027('0x31')]=0x0;_0xd56427[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x34')];ut[_0x8027('0x35')](_0x8027('0x36'),_0xd56427[_0x8027('0x37')]+_0x8027('0x38'));}else{_0xd56427[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x39')];ut[_0x8027('0x35')](_0x8027('0x36'),_0xd56427[_0x8027('0x37')]+_0x8027('0x3a'));}}}Preview[_0x8027('0x10')][_0x8027('0x29')]=function(){var _0x336ccb=this;setInterval(function(){_0x336ccb['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x2069e4=this[_0x8027('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x2e5c4b in _0x2069e4){if(_0x2069e4[_0x8027('0x3b')](_0x2e5c4b)&&(_0x2069e4[_0x2e5c4b][_0x8027('0x3c')]===_0x8027('0x5')||_0x2069e4[_0x2e5c4b][_0x8027('0x3c')]===_0x8027('0x3d'))&&_0x2069e4[_0x2e5c4b]['type']===_0x8027('0x3e')){if(this[_0x8027('0x19')]>0x7){this[_0x8027('0x19')]=0x0;this[_0x8027('0x3f')]();}}if(_0x2069e4[_0x8027('0x3b')](_0x2e5c4b)&&_0x2069e4[_0x2e5c4b][_0x8027('0x3c')]===_0x8027('0x5')&&_0x2069e4[_0x2e5c4b][_0x8027('0x40')]===_0x8027('0x3e')){if(_0x2069e4[_0x2e5c4b][_0x8027('0x41')]){this[_0x8027('0x42')](_0x2069e4[_0x2e5c4b]);if(_0x2069e4[_0x2e5c4b][_0x8027('0x43')])this[_0x8027('0x44')](_0x2069e4[_0x2e5c4b]);}else{notSendMessagesQueue(_0x2069e4[_0x2e5c4b]);}}}};Preview[_0x8027('0x10')][_0x8027('0x45')]=function(_0x2c25ff){var _0x8ce276=this;this[_0x8027('0x13')]['enqueue'](function(){if(!_[_0x8027('0x46')](_0x8ce276[_0x8027('0x17')][_0x2c25ff])){loggerAction[_0x8027('0x47')](_0x8027('0x48'),_0x2c25ff,'Queue',_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')],_0x8027('0x4a'),JSON[_0x8027('0x4b')](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')]]['originated']),_0x8027('0x4c'),JSON[_0x8027('0x4b')](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff]['queue']][_0x8027('0x2f')]),JSON[_0x8027('0x4b')](_0x8ce276[_0x8027('0x17')][_0x2c25ff]['dialAnswer']),JSON[_0x8027('0x4b')](_[_0x8027('0x4d')](_0x8ce276[_0x8027('0x17')][_0x2c25ff],[_0x8027('0x4e'),'UserId',_0x8027('0x4f'),_0x8027('0x50')])));return ami[_0x8027('0x51')]({'action':_0x8027('0x52'),'channel':_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x53')]})[_0x8027('0x54')](function(_0x1759ec){if(_0x1759ec[_0x8027('0x32')]===_0x8027('0x55')){setTimeout(function(){if(_0x8ce276['actions'][_0x2c25ff]){ut[_0x8027('0x56')](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')]],_0x8027('0x57'));if(_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x58')]===!![]){ut['decrementTalkink'](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff]['queue']],'[clearZombieChannel]');ut['loggerError'](_0x8027('0x59')+_0x2c25ff,_0x8ce276[_0x8027('0x17')][_0x2c25ff]['queue']);}ut[_0x8027('0x5a')](_0x8027('0x5b')+_0x2c25ff,_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')]);delete _0x8ce276[_0x8027('0x17')][_0x2c25ff];}},0x2328);}});}});};Preview[_0x8027('0x10')][_0x8027('0x3f')]=function(){var _0x2e7c01=this;loggerAction[_0x8027('0x47')](_0x8027('0x5c'),_[_0x8027('0x5d')](this[_0x8027('0x17')]));for(var _0x5dd7d2 in this[_0x8027('0x17')]){if(_0x2e7c01['actions']['hasOwnProperty'](_0x5dd7d2)){_0x2e7c01['clearZombieChannel'](_0x5dd7d2);}}};Preview[_0x8027('0x10')][_0x8027('0x44')]=function(_0x15ce43){var _0x260e41=this;rpcDb[_0x8027('0x5e')](_0x15ce43['id'],ut[_0x8027('0x5f')](this[_0x8027('0x18')]))[_0x8027('0x60')](function(_0x478059){if(!_[_0x8027('0x46')](_0x478059)){for(var _0x4b708b=0x0;_0x4b708b<_0x478059['length'];_0x4b708b+=0x1){if(ut['getDiff'](_0x478059[_0x4b708b][_0x8027('0x61')])<_0x15ce43[_0x8027('0x62')]*0x3c){if(_0x478059[_0x4b708b][_0x8027('0x63')]&&!_0x478059[_0x4b708b]['Agent'][_0x8027('0x64')]){_0x260e41[_0x8027('0x65')](_0x478059[_0x4b708b]['id'])[_0x8027('0x60')](ut[_0x8027('0x66')](_0x8027('0x67')))[_0x8027('0x54')](ut[_0x8027('0x66')](_0x8027('0x67')));}else{rpcDb[_0x8027('0x68')](_0x478059[_0x4b708b]['id']);}}else{var _0x1237d6=new Action(_0x478059[_0x4b708b],_0x15ce43);_0x1237d6['starttime']=moment()[_0x8027('0x69')]('YYYY-MM-DD\x20HH:mm:ss');_0x15ce43[_0x8027('0x6a')]+=0x1;ut[_0x8027('0x6b')](_0x1237d6,0x17,'RecallInQueue');if(_0x15ce43[_0x8027('0x6c')]){rpcDb[_0x8027('0x6d')](ut['createBody'](_0x478059[_0x4b708b]));rpcDb[_0x8027('0x6e')](_0x1237d6,_0x8027('0x6f'));}else{ut['logCustomer'](_0x1237d6,0x16,_0x8027('0x70'));rpcDb['createCustomerHistory'](_0x1237d6,_0x8027('0x71'));rpcDb[_0x8027('0x72')](_0x1237d6,_0x8027('0x71'));}}}}})[_0x8027('0x54')](ut[_0x8027('0x66')](_0x8027('0x73')));};Preview[_0x8027('0x10')]['setMessage']=function(_0x996e07){_0x996e07[_0x8027('0x74')]=!![];if(ut['IsNotLoggedIn'](_0x996e07['loggedIn'])){_0x996e07[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x75')];}else if(!ut[_0x8027('0x76')](_0x996e07[_0x8027('0x41')])){_0x996e07[_0x8027('0x32')]=utils[_0x8027('0x33')]['INACTIVE'];}else if(!this[_0x8027('0x77')](_0x996e07['Trunk'])){if(!this['isTrunkReachable'](_0x996e07['TrunkBackup'])){_0x996e07['message']=utils['CAMPAIGN_STATUS'][_0x8027('0x78')];}else{_0x996e07[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x79')];}}else{_0x996e07[_0x8027('0x32')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}};Preview[_0x8027('0x10')][_0x8027('0x7a')]=function(_0x6c65c9,_0x3f2442,_0x135e44){var _0x195cec=this;var _0x2d83df=this[_0x8027('0x17')][_0x3f2442];var _0x3bc256=this[_0x8027('0x14')][_0x2d83df[_0x8027('0x49')]];var _0x144d0e;var _0x1949d5=![];var _0x19a93d=0x2;var _0xd089c7=0x3;if(_0x3bc256){switch(_0x135e44){case'1':_0x3bc256[_0x8027('0x7b')]+=0x1;_0x2d83df[_0x8027('0x7c')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x0,_0x8027('0x7f'));ami[_0x8027('0x2a')](_0x8027('0x80'),ut['buildObj'](_0x2d83df,_0x8027('0x81')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0x82'));_0x195cec[_0x8027('0x83')](_0x2d83df,'0',_0x3bc256)[_0x8027('0x60')](function(_0x155b5c){_0x1949d5=_0x155b5c['additional']==0x1;_0x19a93d=_0x3bc256['dialNoSuchNumberRetryFrequency'];_0xd089c7=_0x3bc256[_0x8027('0x84')];if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256['dialGlobalMaxRetry']){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,'Global');rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0x86'));}else{if(_0x2d83df['countnosuchnumberretry']>=_0x3bc256[_0x8027('0x87')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0x86'));}else{rpcDb[_0x8027('0x88')](ut[_0x8027('0x89')](_0x2d83df,'countnosuchnumberretry',_0x3bc256[_0x8027('0x8a')]),_0x2d83df['unlockAgent'],_0x2d83df['activeContact']);}}delete this[_0x8027('0x17')][_0x6c65c9['linkedid']];}else{_0x2d83df[_0x8027('0x7c')]++;logger[_0x8027('0x47')](_0x8027('0x8b'),_0x2d83df['countnosuchnumberretry']);logger[_0x8027('0x47')]('id',_0x2d83df[_0x8027('0x8c')]);_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnosuchnumberretry':_0x2d83df[_0x8027('0x7c')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});});}});break;case _0x8027('0x8f'):var _0x386d1b=moment()[_0x8027('0x69')](_0x8027('0x90'));_0x2d83df[_0x8027('0x91')]=_0x386d1b;_0x2d83df[_0x8027('0x92')]=_0x386d1b;_0x2d83df[_0x8027('0x58')]=!![];_0x3bc256[_0x8027('0x2f')]+=0x1;logger[_0x8027('0x47')](_0x8027('0x93'),_0x2d83df[_0x8027('0x94')],_0x8027('0x95'),_0x3bc256[_0x8027('0x37')],'pTalking:\x20',_0x3bc256[_0x8027('0x2f')]);ami[_0x8027('0x2a')](_0x8027('0x96'),ut[_0x8027('0x97')](_0x2d83df,_0x8027('0x98'),this[_0x8027('0x14')][_0x2d83df[_0x8027('0x49')]]));if(_0x3bc256[_0x8027('0x99')]){ami[_0x8027('0x2a')](_0x8027('0x9a'),ut[_0x8027('0x9b')](_0x2d83df));}break;case'16':ami[_0x8027('0x2a')](_0x8027('0x9c'),ut[_0x8027('0x97')](_0x2d83df,'complete',this[_0x8027('0x14')][_0x2d83df[_0x8027('0x49')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d83df,_0x8027('0x9d')));_0x3bc256[_0x8027('0x9e')]+=0x1;_0x3bc256[_0x8027('0x9f')]+=0x1;_0x3bc256[_0x8027('0xa0')]+=0x1;ut[_0x8027('0xa1')](_0x3bc256,_0x8027('0xa2'));_0x2d83df['countglobal']=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x4,'Answer');rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xa3'));rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xa4'));rpcDb['crateCustomerReportQueue'](_0x2d83df);_0x3bc256[_0x8027('0xa5')]+=_0x2d83df[_0x8027('0xa6')];_0x3bc256[_0x8027('0xa7')]+=_0x2d83df[_0x8027('0xa6')];logger[_0x8027('0x47')]('[syncHangup][talking][decrement]',_0x2d83df[_0x8027('0x94')],_0x8027('0x95'),_0x3bc256[_0x8027('0x37')],_0x8027('0x4c'),_0x3bc256['pTalking']);delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];break;case _0x8027('0xa9'):_0x3bc256[_0x8027('0xaa')]+=0x1;_0x2d83df[_0x8027('0xab')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x5,_0x8027('0xac'));_0x19a93d=_0x3bc256[_0x8027('0xad')];_0xd089c7=_0x3bc256[_0x8027('0x84')];ami['emit']('custom:agentbusy',ut[_0x8027('0x97')](_0x2d83df,_0x8027('0xae')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xaf'));_0x195cec['verifyAdditionalPhones'](_0x2d83df,'5',_0x3bc256)[_0x8027('0x60')](function(_0x3a5248){_0x1949d5=_0x3a5248[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0xb3'));}else{if(_0x2d83df[_0x8027('0xab')]>=_0x3bc256['dialBusyMaxRetry']){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xaf'));}else{rpcDb[_0x8027('0x88')](ut[_0x8027('0x89')](_0x2d83df,_0x8027('0xab'),_0x3bc256['dialBusyRetryFrequency']),_0x2d83df[_0x8027('0xb4')],_0x2d83df['activeContact']);}}}else{_0x2d83df['countbusyretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countbusyretry':_0x2d83df[_0x8027('0xab')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});});}});break;case _0x8027('0xb5'):_0x3bc256[_0x8027('0xb6')]+=0x1;_0x2d83df[_0x8027('0xb7')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x3,_0x8027('0xb8'));_0x19a93d=_0x3bc256[_0x8027('0xb9')];_0xd089c7=_0x3bc256[_0x8027('0x84')];var _0x5e10f1=ut['buildNoAnswerEventPayload'](_0x2d83df,_0x3bc256);ami[_0x8027('0x2a')](_0x8027('0xba'),_0x5e10f1);rpcDb[_0x8027('0x6e')](_0x2d83df,'[callProgressDetectingCustomer][logNoAnswer]');_0x195cec[_0x8027('0x83')](_0x2d83df,'3',_0x3bc256)['then'](function(_0x348a65){_0x1949d5=_0x348a65[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0xbb'));}else{if(_0x2d83df['countnoanswerretry']>=_0x3bc256[_0x8027('0xbc')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xbd'));}else{rpcDb['rescheduleContact'](ut[_0x8027('0x89')](_0x2d83df,'countnoanswerretry',_0x3bc256[_0x8027('0xb9')]),_0x2d83df[_0x8027('0xb4')],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df[_0x8027('0xb7')]++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df['countnoanswerretry']}})[_0x8027('0x60')](function(){_0x195cec['swapAdditionalPhones'](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});break;case'CONGESTION':_0x3bc256[_0x8027('0xbf')]+=0x1;_0x2d83df['countcongestionretry']+=0x1;_0x2d83df['countglobal']=ut[_0x8027('0x7e')](_0x2d83df);ut['logCustomer'](_0x2d83df,0x8,_0x8027('0xc0'));_0x19a93d=_0x3bc256['dialCongestionRetryFrequency'];_0xd089c7=_0x3bc256['callAdditionalPhoneAfterMin'];ami['emit'](_0x8027('0xc1'),ut[_0x8027('0x97')](_0x2d83df,'congestion'));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xc2'));_0x195cec[_0x8027('0x83')](_0x2d83df,'8',_0x3bc256)[_0x8027('0x60')](function(_0x27bd1f){_0x1949d5=_0x27bd1f['additional']==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256['dialGlobalMaxRetry']){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb[_0x8027('0x72')](_0x144d0e,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2d83df[_0x8027('0xc3')]>=_0x3bc256[_0x8027('0xc4')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xc2'));}else{rpcDb['rescheduleContact'](ut[_0x8027('0x89')](_0x2d83df,'countcongestionretry',_0x3bc256['dialBusyRetryFrequency']),_0x2d83df[_0x8027('0xb4')],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df['countcongestionretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countcongestionretry':_0x2d83df[_0x8027('0xc3')]}})['then'](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});break;case _0x8027('0xc5'):_0x3bc256[_0x8027('0xc6')]+=0x1;_0x2d83df[_0x8027('0xc7')]+=0x1;_0x2d83df['countglobal']=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x14,'AgentReject');_0x19a93d=_0x3bc256[_0x8027('0xc8')];_0xd089c7=_0x3bc256[_0x8027('0x84')];ami[_0x8027('0x2a')](_0x8027('0xc9'),ut[_0x8027('0x97')](_0x2d83df,_0x8027('0xca')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xcb'));_0x195cec[_0x8027('0x83')](_0x2d83df,'20',_0x3bc256)[_0x8027('0x60')](function(_0x4b78a5){_0x1949d5=_0x4b78a5[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0x14,_0x8027('0xcc'));rpcDb['createCustomerFinal'](_0x144d0e,_0x8027('0xcd'));}else{if(_0x2d83df[_0x8027('0xc7')]>=_0x3bc256[_0x8027('0xce')]){rpcDb['createCustomerFinal'](_0x2d83df,_0x8027('0xcd'));}else{rpcDb[_0x8027('0x88')](ut[_0x8027('0x89')](_0x2d83df,'countagentrejectretry',_0x3bc256[_0x8027('0xc8')]),_0x2d83df['unlockAgent'],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df[_0x8027('0xb7')]++;_0x195cec['incrementPreviewCounters']({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df['countnoanswerretry']}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});break;case _0x8027('0xcf'):_0x3bc256[_0x8027('0xd0')]+=0x1;_0x2d83df['countabandonedretry']+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0xb,_0x8027('0xd1'));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xd2'));_0x195cec[_0x8027('0x83')](_0x2d83df,'11',_0x3bc256)[_0x8027('0x60')](function(_0x242e68){_0x1949d5=_0x242e68[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb['createCustomerFinal'](_0x144d0e,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d83df[_0x8027('0xd3')]>=_0x3bc256[_0x8027('0xd4')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xd2'));}else{rpcDb[_0x8027('0x88')](ut['scheduledAt'](_0x2d83df,'countabandonedretry',_0x3bc256['dialAbandonedRetryFrequency']),_0x2d83df[_0x8027('0xb4')],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df[_0x8027('0xb7')]++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df[_0x8027('0xb7')]}})['then'](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});});}});break;case'18':_0x3bc256['outboundUnknownCallsDay']+=0x1;_0x2d83df[_0x8027('0xd5')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut['totalGlobal'](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x12,_0x6c65c9[_0x8027('0xd6')]||_0x6c65c9[_0x8027('0xd7')]);ami[_0x8027('0x2a')](_0x8027('0xd8'),ut['buildObj'](_0x2d83df,_0x8027('0xd9')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xda'));_0x195cec['verifyAdditionalPhones'](_0x2d83df,'18',_0x3bc256)[_0x8027('0x60')](function(_0x516de3){_0x1949d5=_0x516de3[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut['totalGlobal'](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut['cloneAction'](_0x2d83df,0x12,'Global');rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0xda'));}else{rpcDb[_0x8027('0x72')](_0x2d83df,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x2d83df['countnoanswerretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df[_0x8027('0xb7')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];break;case'19':_0x3bc256[_0x8027('0xdb')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x13,_0x6c65c9['cause-txt']||_0x6c65c9[_0x8027('0xd7')]);ami[_0x8027('0x2a')](_0x8027('0xd8'),ut[_0x8027('0x97')](_0x2d83df,_0x8027('0xd9')));rpcDb[_0x8027('0x6e')](_0x2d83df,'[callProgressDetectingCustomer][machine]');_0x195cec[_0x8027('0x83')](_0x2d83df,'18',_0x3bc256)[_0x8027('0x60')](function(_0x5c1fe3){_0x1949d5=_0x5c1fe3['additional']==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut['cloneAction'](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb['createCustomerFinal'](_0x144d0e,_0x8027('0xdc'));}else{rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xdc'));}}else{_0x2d83df['countnoanswerretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df[_0x8027('0xb7')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];break;default:if(_0x2d83df[_0x8027('0x58')]){ut[_0x8027('0xa1')](_0x3bc256,'[default]');ut['loggerError'](_0x8027('0xdd')+_0x3bc256[_0x8027('0x37')],_0x6c65c9);}_0x3bc256[_0x8027('0xdb')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0xc,_0x6c65c9['cause-txt']||_0x6c65c9[_0x8027('0xd7')]);_0x19a93d=_0x3bc256[_0x8027('0xc8')];_0xd089c7=_0x3bc256[_0x8027('0x84')];rpcDb['createCustomerHistory'](_0x2d83df,'[callProgressDetectingCustomer][logUnknown]');_0x195cec[_0x8027('0x83')](_0x2d83df,'20',_0x3bc256)[_0x8027('0x60')](function(_0x13113f){_0x1949d5=_0x13113f[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut['totalGlobal'](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut['cloneAction'](_0x2d83df,0xf,'Global');rpcDb[_0x8027('0x72')](_0x144d0e,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x8027('0x72')](_0x2d83df,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];}else{_0x195cec['swapAdditionalPhones'](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});}});}if(!(_0x2d83df['dialAnswer']&&_0x135e44==='16')){ut['updateOriginated'](_0x3bc256,'[callProgressDetectingCustomer]');logger[_0x8027('0x47')](_0x8027('0xde'),_0x2d83df[_0x8027('0x94')],_0x8027('0x95'),_0x3bc256[_0x8027('0x37')],_0x8027('0x4a'),_0x3bc256[_0x8027('0x2e')]);}if(_0x135e44!==_0x8027('0x8f')){delete this[_0x8027('0x17')][_0x6c65c9['linkedid']];delete this[_0x8027('0x17')][_0x6c65c9['destlinkedid']];}_0x3bc256['queueSummaryCountersUpdated']=!![];}};Preview[_0x8027('0x10')]['callProgressDetectingAgent']=function(_0x3974f0,_0x3bb975,_0x13df40){if(_[_0x8027('0xdf')](_0x3bb975)&&_0x8027('0xe0')!==typeof _0x3bb975){return;}if(_[_0x8027('0xdf')](_0x13df40)&&_0x8027('0xe0')!==typeof _0x13df40){return;}switch(_0x13df40[_0x8027('0xe1')]){case'0':ut[_0x8027('0xe2')](_0x3974f0,0x0,_0x8027('0x7f'));rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe4'));break;case'3':ut['logAgent'](_0x3974f0,0x3,'NoAnswer');rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe5'));break;case'5':ut['logAgent'](_0x3974f0,0x5,'Busy');rpcDb[_0x8027('0xe3')](_0x3974f0,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x8027('0xe2')](_0x3974f0,0x8,_0x8027('0xc0'));rpcDb[_0x8027('0xe3')](_0x3974f0,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8027('0xe2')](_0x3974f0,0x16,_0x8027('0xe6'));rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe7'));break;default:ut[_0x8027('0xe2')](_0x3974f0,0xc,_0x13df40['reason']);rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe8'));}ut['updateOriginated'](_0x3bb975,_0x8027('0xe9'));logger[_0x8027('0x47')](_0x8027('0xea'),_0x3974f0[_0x8027('0x94')],_0x8027('0x95'),_0x3bb975[_0x8027('0x37')],_0x8027('0x4a'),_0x3bb975[_0x8027('0x2e')]);delete this['actions'][_0x3974f0[_0x8027('0x94')]];};Preview[_0x8027('0x10')][_0x8027('0x83')]=function(_0x5a652e,_0x26bead,_0x237f6e){return cmHopperAdditionalPhone[_0x8027('0x83')](_0x5a652e,_0x26bead,_0x237f6e)[_0x8027('0x54')](logger[_0x8027('0x47')](_0x8027('0xeb')));};Preview[_0x8027('0x10')][_0x8027('0x8e')]=function(_0x4c9519,_0x17409f,_0x467463){return cmHopperAdditionalPhone[_0x8027('0x8e')](_0x4c9519,_0x17409f,_0x467463)['catch'](logger[_0x8027('0x47')](_0x8027('0xec')));};Preview[_0x8027('0x10')][_0x8027('0x8d')]=function(_0xeea65){return Promise[_0x8027('0xed')]()['then'](cmHopperAdditionalPhone[_0x8027('0x8d')](_0xeea65))[_0x8027('0x54')](logger[_0x8027('0x47')]('[incrementPreviewCounters]\x20'));};Preview[_0x8027('0x10')]['checkInBlack']=function(_0x3f0ad7,_0x42ff73,_0x67e484,_0x5db2fe,_0x308eb5){var _0x59a245=this;return new Promise(function(_0x4257ef,_0x32ac3b){if(_[_0x8027('0x46')](_0x42ff73)||_[_0x8027('0x46')](_0x42ff73['Contact'])||_[_0x8027('0x46')](_0x42ff73[_0x8027('0xee')])||_[_0x8027('0x46')](_0x42ff73[_0x8027('0x4f')])){_0x32ac3b(ut['message']('Contact\x20is\x20undefined',_0x5db2fe,_0x308eb5));return;}var _0x3a40e5=uuid['v4']();var _0x1a8035=_0x59a245[_0x8027('0x14')][_0x42ff73['Queue'][_0x8027('0x37')]];var _0x2714e4=_0x67e484?_0x59a245['agents'][_0x67e484]['id']:undefined;_0x59a245[_0x8027('0x17')][_0x3a40e5]=new Action(_0x42ff73,_0x1a8035,_0x3a40e5,_0x67e484,_0x2714e4);var _0x449ce0=_0x59a245['actions'][_0x3a40e5];_0x449ce0[_0x8027('0xb4')]=_0x5db2fe;_0x449ce0[_0x8027('0xbe')]=_0x308eb5;_0x449ce0[_0x8027('0xef')]=_0x67e484;if(_['isEmpty'](_0x3f0ad7)){_0x59a245['execCall'](_0x449ce0,_0x1a8035,_0x42ff73,_0x67e484)[_0x8027('0x60')](function(_0x4e11b0){logger[_0x8027('0x47')](_0x8027('0xf0'),'Queue:\x20'+_0x449ce0[_0x8027('0x49')]+'\x20IdHopper:\x20'+_0x449ce0[_0x8027('0x8c')],JSON['stringify'](_0x4e11b0));ami['emit'](_0x8027('0xf1'),ut[_0x8027('0x97')](_0x449ce0,_0x8027('0xf2'),_0x59a245[_0x8027('0x14')][_0x449ce0['queue']]));_0x4257ef(ut[_0x8027('0x32')](_0x8027('0xf3')));})['catch'](function(_0x149754){ut[_0x8027('0x35')](_0x8027('0xf4'),_0x149754);_0x32ac3b(ut['message'](_0x8027('0xf5'),_0x5db2fe,_0x308eb5));});}else{_0x1a8035[_0x8027('0xf6')]+=0x1;ut[_0x8027('0xf7')](_0x449ce0);rpcDb[_0x8027('0xf8')](_0x449ce0,_0x8027('0xf9'));delete _0x59a245[_0x8027('0x17')][_0x3a40e5];_0x32ac3b(ut[_0x8027('0x32')]('Contact\x20in\x20black\x20List',_0x5db2fe,_0x308eb5));}});};Preview['prototype'][_0x8027('0x77')]=function(_0x4643f0){return!_[_0x8027('0x46')](_0x4643f0)&&!_[_0x8027('0x46')](_0x4643f0[_0x8027('0x37')])&&!_['isNil'](_0x4643f0[_0x8027('0xfa')])&&_0x4643f0[_0x8027('0xfa')]&&!_['isNil'](this[_0x8027('0x16')][util['format']('SIP/%s',_0x4643f0[_0x8027('0x37')])])&&!_[_0x8027('0x46')](this['trunks'][util[_0x8027('0x69')](_0x8027('0xfb'),_0x4643f0[_0x8027('0x37')])]['status'])&&(this[_0x8027('0x16')][util[_0x8027('0x69')]('SIP/%s',_0x4643f0[_0x8027('0x37')])]['status']===_0x8027('0xfc')||this[_0x8027('0x16')][util['format'](_0x8027('0xfb'),_0x4643f0['name'])][_0x8027('0x52')]===_0x8027('0xfd'));};Preview['prototype']['run']=function(_0xe684de,_0x18b165){return this['execRun'](_0xe684de,_0x18b165)[_0x8027('0x60')](function(_0x2320ac){return _['pick'](_0x2320ac,[_0x8027('0x32')]);})['catch'](function(_0x5127fa){if(_0x5127fa['unlock']){rpcDb[_0x8027('0xfe')](_0xe684de);}if(_0x5127fa['active']){rpcDb[_0x8027('0x68')](_0xe684de);}throw _[_0x8027('0x4d')](_0x5127fa,['message']);});};Preview[_0x8027('0x10')][_0x8027('0xff')]=function(_0x33c7af,_0x2345e8){var _0x2b1bff=this;var _0x556f29,_0x4f1bd8;return rpcDb[_0x8027('0x100')](_0x33c7af)[_0x8027('0x60')](function(_0x3502c2){if(!_[_0x8027('0x46')](_0x3502c2[0x0])){_0x4f1bd8=_0x3502c2[0x0][_0x8027('0x101')]?![]:!![];_0x556f29=_0x3502c2[0x0][_0x8027('0x101')]?!![]:![];_0x556f29=_0x2345e8?!![]:_0x556f29;}var _0x44ce6a=_0x2b1bff[_0x8027('0x102')](_0x3502c2);if(_0x44ce6a[_0x8027('0x103')]){rpcDb['checkIsBlackList'](_[_0x8027('0x4d')](_0x3502c2[0x0],[_0x8027('0x4f'),_0x8027('0xee')]))[_0x8027('0x60')](function(_0x2d3a2d){_0x2b1bff['checkInBlack'](_0x2d3a2d,_0x3502c2[0x0],_0x2345e8,_0x4f1bd8,_0x556f29)[_0x8027('0x60')](function(_0x1cd0d4){return _0x1cd0d4;})[_0x8027('0x54')](function(_0x9c4e54){throw _0x9c4e54;});})[_0x8027('0x54')](function(_0x26688d){ut[_0x8027('0x35')](_0x8027('0x104'),_0x26688d);throw ut[_0x8027('0x32')](_0x8027('0x105'),_0x4f1bd8,_0x556f29);});}else{throw ut[_0x8027('0x32')](_0x44ce6a['message'],_0x4f1bd8,_0x556f29);}})[_0x8027('0x54')](function(_0x5c15e5){ut[_0x8027('0x35')]('[Preview][getContactPreview]',_0x5c15e5);throw ut[_0x8027('0x32')](_0x8027('0x105'),![],!![]);});};Preview[_0x8027('0x10')]['validateContact']=function(_0x23ebdf){if(_[_0x8027('0x46')](_0x23ebdf)||_[_0x8027('0x106')](_0x23ebdf)||!_['isNil'](_0x23ebdf[0x0]['Agent'])&&_['isNil'](_0x23ebdf[0x0]['Agent'][_0x8027('0x37')])){ut[_0x8027('0x35')]('[Preview][validateContact][Empty\x20Contact]',_0x23ebdf);return{'isValid':![],'message':_0x8027('0x107')};}var _0x2ebde6=this[_0x8027('0x14')][_0x23ebdf[0x0][_0x8027('0x108')]['name']];_0x2ebde6[_0x8027('0x32')]=utils['CAMPAIGN_STATUS'][_0x8027('0x79')];if(_[_0x8027('0x46')](_0x2ebde6)){ut[_0x8027('0x35')](_0x8027('0x109'),_0x2ebde6);return{'isValid':![],'message':_0x8027('0x10a')};}if(!this[_0x8027('0x77')](_0x2ebde6['Trunk'])){ut[_0x8027('0x35')](_0x8027('0x10b'),_0x8027('0x10c')+_0x2ebde6[_0x8027('0x37')]+_0x8027('0x10d'));if(!this['isTrunkReachable'](_0x2ebde6[_0x8027('0x10e')])){ut[_0x8027('0x35')](_0x8027('0x10b'),_0x2ebde6['name']+_0x8027('0x10f'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x8027('0x76')](_0x2ebde6[_0x8027('0x41')])){ut['logger'](_0x8027('0x110'),_0x2ebde6[_0x8027('0x37')]+_0x8027('0x111'));return{'isValid':![],'message':_0x8027('0x10c')+_0x2ebde6['name']+_0x8027('0x111')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x8027('0x10')][_0x8027('0x112')]=function(_0x3be856,_0x714a6d,_0x56bb18,_0x501bdb){var _0x5c39ce=this;return new Promise(function(_0x505c8d,_0x4cc5b0){var _0x3c70a7=_0x3be856['uniqueid'];var _0x3bb1b7=_0x5c39ce['isTrunkReachable'](_0x714a6d[_0x8027('0x113')])?util[_0x8027('0x69')](_0x8027('0x114'),_0x714a6d[_0x8027('0x113')][_0x8027('0x37')],_['isNil'](_0x714a6d[_0x8027('0x115')])?'':_0x714a6d[_0x8027('0x115')][_0x8027('0x116')]()||'',_0x714a6d[_0x8027('0x117')]>0x0?_0x56bb18[_0x8027('0xee')][_0x8027('0x118')](_0x714a6d['dialCutDigit']):_0x56bb18['phone']):util['format'](_0x8027('0x114'),_[_0x8027('0x46')](_0x714a6d[_0x8027('0x10e')])?_0x714a6d[_0x8027('0x113')][_0x8027('0x37')]:_0x714a6d[_0x8027('0x10e')]['name'],_[_0x8027('0x46')](_0x714a6d[_0x8027('0x115')])?'':_0x714a6d[_0x8027('0x115')][_0x8027('0x116')]()||'',_0x714a6d[_0x8027('0x117')]>0x0?_0x56bb18[_0x8027('0xee')][_0x8027('0x118')](_0x714a6d[_0x8027('0x117')]):_0x56bb18[_0x8027('0xee')]);var _0x3752cd=_0x5c39ce['isTrunkReachable'](_0x714a6d[_0x8027('0x113')])?ut['getCallerId'](_0x714a6d['Trunk'][_0x8027('0x119')],_0x714a6d[_0x8027('0x11a')],_0x714a6d['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x714a6d[_0x8027('0x11b')],_0x714a6d[_0x8027('0x11c')]):_0x714a6d['dialOriginateCallerIdNumber']):ut[_0x8027('0x11d')](_[_0x8027('0x46')](_0x714a6d[_0x8027('0x10e')])?_0x714a6d[_0x8027('0x113')][_0x8027('0x119')]:_0x714a6d[_0x8027('0x10e')]['callerid'],_0x714a6d[_0x8027('0x11a')],_0x714a6d['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8027('0x11e')](_0x714a6d['dialOriginateCallerIdNumber'],_0x714a6d[_0x8027('0x11c')]):_0x714a6d[_0x8027('0x11b')]);if(_0x3752cd){_0x3be856[_0x8027('0x11f')]=ut[_0x8027('0x120')](_0x3752cd);_0x3be856[_0x8027('0x121')]=ut['extractCalleridNumber'](_0x3752cd);}var _0x23d1ca=ut[_0x8027('0x122')](_0x714a6d,_0x56bb18,_0x3bb1b7,_0x3752cd,_0x3c70a7,_0x3be856);var _0x5f5d7e=utils[_0x8027('0x123')](_0x56bb18[_0x8027('0x124')]);Object['assign'](_0x23d1ca,_0x5f5d7e);_[_0x8027('0x125')](_0x3be856,ut[_0x8027('0x126')](_0x23d1ca));_0x3be856[_0x8027('0x127')]=moment()[_0x8027('0x69')](_0x8027('0x90'));_0x714a6d[_0x8027('0x128')]=_0x23d1ca;var _0x5138c4=ut[_0x8027('0x129')](_0x3be856,_0x714a6d,_0x23d1ca,_0x3be856[_0x8027('0xbe')],_0x501bdb);return ami[_0x8027('0x51')](_0x5138c4)[_0x8027('0x60')](function(_0x40727a){_0x714a6d[_0x8027('0x2e')]+=0x1;logger[_0x8027('0x47')](_0x8027('0x12a'),_0x3c70a7,_0x8027('0x95'),_0x714a6d[_0x8027('0x37')],'originated:\x20',_0x714a6d['originated']);_0x505c8d(_0x40727a);})[_0x8027('0x54')](function(_0x3475c3){ut['logAgent'](_0x3be856,0xe,_0x8027('0x12b'));rpcDb[_0x8027('0xe3')](_0x3be856,_0x8027('0x12c'));_0x4cc5b0(_0x3475c3);});});};Preview['prototype'][_0x8027('0x22')]=function(_0x26021d){if(this[_0x8027('0x17')][_0x26021d[_0x8027('0xa8')]]){this[_0x8027('0x17')][_0x26021d[_0x8027('0xa8')]][_0x8027('0x53')]=_0x26021d[_0x8027('0x53')];}};Preview[_0x8027('0x10')][_0x8027('0x1b')]=function(_0x9fcd80){var _0x23c221=this;var _0x17156f=this[_0x8027('0x17')][_0x9fcd80[_0x8027('0x12d')]];if(_0x17156f){if(_0x17156f['lookAgent']&&this[_0x8027('0x18')][_0x17156f[_0x8027('0xef')]]){ut[_0x8027('0x12e')](_0x17156f,this[_0x8027('0x18')][_0x17156f[_0x8027('0xef')]][_0x8027('0x37')],this[_0x8027('0x18')][_0x17156f[_0x8027('0xef')]]['id']);}var _0xd99e69=_[_0x8027('0x12f')](_0x17156f);_0xd99e69[_0x8027('0x91')]=moment()[_0x8027('0x69')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3ccd8f=_0x23c221['campaignsPreview'][_0x17156f[_0x8027('0x49')]];if(ut['isFailure'](_0x9fcd80[_0x8027('0x130')])){if(_0x17156f[_0x8027('0xb4')]){rpcDb[_0x8027('0xfe')](_0x17156f[_0x8027('0x8c')]);}if(_0x17156f[_0x8027('0xbe')]){rpcDb[_0x8027('0x68')](_0x17156f[_0x8027('0x8c')]);}ami[_0x8027('0x2a')]('custom:agentringnoanswer',ut['buildObj'](_0x17156f,_0x8027('0x131'),this[_0x8027('0x14')][_0x17156f[_0x8027('0x49')]]));this['callProgressDetectingAgent'](_0xd99e69,_0x3ccd8f,_0x9fcd80);}else{_0x17156f[_0x8027('0x127')]=moment()[_0x8027('0x69')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8027('0xe2')](_0xd99e69,0x4,'Answer');rpcDb[_0x8027('0xe3')](_0xd99e69,_0x8027('0x132'));}}};Preview[_0x8027('0x10')][_0x8027('0x133')]=function(_0x397a21){var _0x91ff49=this['actions'][_0x397a21['linkedid']];var _0x11f7f3;if(_0x91ff49){_0x11f7f3=this[_0x8027('0x14')][_0x91ff49['queue']];logger[_0x8027('0x47')](_0x8027('0x134'),_0x397a21['linkedid'],_0x8027('0x95'),_0x11f7f3['name'],_0x8027('0x4c'),_0x11f7f3[_0x8027('0x2f')]);}if(this[_0x8027('0x17')][_0x397a21[_0x8027('0xa8')]]&&_0x397a21[_0x8027('0xa8')]!==_0x397a21['uniqueid']){if(_0x397a21[_0x8027('0x135')]==='16'&&this[_0x8027('0x17')][_0x397a21['linkedid']]['dialAnswer']){this[_0x8027('0x7a')](_0x397a21,_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')]);}else if(this['actions'][_0x397a21['linkedid']][_0x8027('0x58')]){logger['info'](_0x8027('0x136'),_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')],_0x8027('0x95'),_0x11f7f3[_0x8027('0x37')],_0x8027('0x4c'),_0x11f7f3[_0x8027('0x2f')]);this[_0x8027('0x7a')](_0x397a21,_0x397a21['linkedid'],_0x397a21['cause']);}}else if(_0x91ff49&&_[_0x8027('0x46')](_0x91ff49['statedesc'])&&_0x11f7f3['dialQueueProject']&&_0x397a21[_0x8027('0xa8')]===_0x397a21['uniqueid']&&_[_0x8027('0x46')](_0x397a21[_0x8027('0xe1')])&&_0x397a21[_0x8027('0x135')]==='16'&&_0x397a21[_0x8027('0x137')]==='6'&&_[_0x8027('0xdf')](_0x91ff49[_0x8027('0x138')])){if(_0x91ff49[_0x8027('0xb4')]){rpcDb[_0x8027('0xfe')](_0x91ff49['idContact']);}if(_0x91ff49[_0x8027('0xbe')]){rpcDb[_0x8027('0x68')](_0x91ff49[_0x8027('0x8c')]);}_0x397a21[_0x8027('0xe1')]='22';this[_0x8027('0x139')](_0x91ff49,_0x11f7f3,_0x397a21);}else if(_0x91ff49&&_0x91ff49['transfer']){if(_0x397a21['cause']==='16'&&this[_0x8027('0x17')][_0x397a21[_0x8027('0xa8')]][_0x8027('0x58')]){logger['info'](_0x8027('0x13a'),_0x397a21['linkedid'],_0x397a21['cause'],'\x20Queue',_0x11f7f3['name'],_0x8027('0x4c'),_0x11f7f3['pTalking']);this['callProgressDetectingCustomer'](_0x397a21,_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')]);}else if(this[_0x8027('0x17')][_0x397a21[_0x8027('0xa8')]]['dialAnswer']){logger[_0x8027('0x47')](_0x8027('0x136'),_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')],_0x8027('0x95'),_0x11f7f3[_0x8027('0x37')],_0x8027('0x4c'),_0x11f7f3[_0x8027('0x2f')]);this[_0x8027('0x7a')](_0x397a21,_0x397a21[_0x8027('0xa8')],_0x397a21['cause']);}}};Preview[_0x8027('0x10')][_0x8027('0x20')]=function(_0x33e29c){if(this[_0x8027('0x17')][_0x33e29c[_0x8027('0x13b')]]&&_0x33e29c['destlinkedid']!==_0x33e29c[_0x8027('0x13c')]){this['callProgressDetectingCustomer'](_0x33e29c,_0x33e29c[_0x8027('0x13b')],_0x33e29c['dialstatus']);}};Preview[_0x8027('0x10')][_0x8027('0x1e')]=function(_0x7dbb88){if(this[_0x8027('0x17')][_0x7dbb88[_0x8027('0xa8')]]&&_0x7dbb88[_0x8027('0xa8')]!==_0x7dbb88[_0x8027('0x94')]&&!this[_0x8027('0x17')][_0x7dbb88[_0x8027('0xa8')]][_0x8027('0x58')]){if(_0x7dbb88['cause']==='1'){this[_0x8027('0x7a')](_0x7dbb88,_0x7dbb88['linkedid'],_0x7dbb88[_0x8027('0x135')]);}}};Preview['prototype'][_0x8027('0x13d')]=function(_0xa70954,_0x424928,_0x4af591){if(this[_0x8027('0x17')][_0xa70954]){if(_[_0x8027('0x46')](this[_0x8027('0x17')][_0xa70954]['variables'])){this[_0x8027('0x17')][_0xa70954][_0x8027('0x128')]={};}this['actions'][_0xa70954][_0x8027('0x128')][_0x424928]=_0x4af591;}};Preview[_0x8027('0x10')]['syncVarSet']=function(_0x4046bc){try{if(!_[_0x8027('0x46')](_0x4046bc)){if(ut[_0x8027('0x13e')](_['keys'](_0x4046bc[_0x8027('0x13f')])[0x0])){this[_0x8027('0x13d')](_0x4046bc[_0x8027('0x94')],_['keys'](_0x4046bc[_0x8027('0x13f')])[0x0],_0x4046bc[_0x8027('0x140')]);}}}catch(_0x6541f5){logger[_0x8027('0x141')]('[syncVarSet][Preview]',util[_0x8027('0x142')](_0x6541f5,{'showHidden':![],'depth':null}));}};Preview[_0x8027('0x10')][_0x8027('0x26')]=function(_0x5a7690){if(_0x5a7690){if(this[_0x8027('0x17')][_0x5a7690[_0x8027('0x143')]]){this['actions'][_0x5a7690[_0x8027('0x143')]]['transfer']=!![];}}};Preview[_0x8027('0x10')][_0x8027('0x28')]=function(_0x191c1e){if(_0x191c1e){if(this[_0x8027('0x17')][_0x191c1e[_0x8027('0x144')]]){this[_0x8027('0x17')][_0x191c1e[_0x8027('0x144')]][_0x8027('0x138')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xdd8d=['complete','outboundAnswerCallsDay','total','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','pTalking:\x20','BUSY','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','custom:agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','countabandonedetry','outboundUnknownCallsDay','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','originated:\x20','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','campaign\x20Name:\x20','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','assign','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','destuniqueid','addVariable','filterKey','keys','variable','value','error','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/environment','../../../config/logger','actionPreview','./rpcDb','./action','./util/util','../dialer/utils','redis','localhost','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','preview','outbound','hasOwnProperty','dialMethod','type','dialActive','setMessage','dialPreviewAutoRecallMe','prototype','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','stringify','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw'];(function(_0x2af72b,_0x4dcf2d){var _0xb38c05=function(_0x104560){while(--_0x104560){_0x2af72b['push'](_0x2af72b['shift']());}};_0xb38c05(++_0x4dcf2d);}(_0xdd8d,0x1e5));var _0xddd8=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xdd8d[_0x1ac6ec];return _0x48a489;};'use strict';var util=require(_0xddd8('0x0'));var _=require(_0xddd8('0x1'));var uuid=require(_0xddd8('0x2'));var moment=require('moment');var Redis=require(_0xddd8('0x3'));var config=require(_0xddd8('0x4'));var logger=require(_0xddd8('0x5'))('preview');var loggerAction=require(_0xddd8('0x5'))(_0xddd8('0x6'));var ami=require('../ami');var rpcDb=require(_0xddd8('0x7'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xddd8('0x8'));var ut=require(_0xddd8('0x9'));var utils=require(_0xddd8('0xa'));config[_0xddd8('0xb')]=_['defaults'](config[_0xddd8('0xb')],{'host':_0xddd8('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xddd8('0xd')]=function(_0x4ccb2b){this['tail']=this['tail']?this[_0xddd8('0xe')][_0xddd8('0xf')](_0x4ccb2b):_0x4ccb2b();};function Preview(_0x3795fa){this[_0xddd8('0x10')]=new Sequence();this[_0xddd8('0x11')]=_0x3795fa[_0xddd8('0x12')];this['trunks']=_0x3795fa[_0xddd8('0x13')];this[_0xddd8('0x14')]={};this['agents']=_0x3795fa[_0xddd8('0x15')];this[_0xddd8('0x16')]=0x0;ami['on'](_0xddd8('0x17'),this[_0xddd8('0x18')][_0xddd8('0x19')](this));ami['on'](_0xddd8('0x1a'),this[_0xddd8('0x1b')][_0xddd8('0x19')](this));ami['on']('hanguprequest',this[_0xddd8('0x1c')][_0xddd8('0x19')](this));ami['on'](_0xddd8('0x1d'),this[_0xddd8('0x1e')][_0xddd8('0x19')](this));ami['on']('newexten',this[_0xddd8('0x1f')][_0xddd8('0x19')](this));ami['on'](_0xddd8('0x20'),this[_0xddd8('0x21')]['bind'](this));ami['on']('attendedtransfer',this[_0xddd8('0x22')][_0xddd8('0x19')](this));ami['on'](_0xddd8('0x23'),this[_0xddd8('0x24')][_0xddd8('0x19')](this));this[_0xddd8('0x25')](this[_0xddd8('0x11')]);}function emit(_0x33b8c0,_0x2fd953,_0x13fe89){io['to'](_0x33b8c0)[_0xddd8('0x26')](_0x2fd953,_0x13fe89);}function emitVoiceQueueChannelRemove(_0x589c15){logger[_0xddd8('0x27')](_0xddd8('0x28'),JSON['stringify'](_0x589c15));emit(util[_0xddd8('0x29')](_0xddd8('0x2a'),_0x589c15[_0xddd8('0x2b')]),_0xddd8('0x2c'),_0x589c15);io['emit'](_0xddd8('0x2d'),_0x589c15);}function notSendMessagesQueue(_0x3b64de){if(_0x3b64de['sendMessageOneNotActive']){if(_0x3b64de[_0xddd8('0x2e')]===0x0&&_0x3b64de[_0xddd8('0x2f')]===0x0){_0x3b64de['sendMessageOneNotActive']=![];_0x3b64de['available']=0x0;_0x3b64de[_0xddd8('0x30')]=0x0;_0x3b64de[_0xddd8('0x31')]=utils[_0xddd8('0x32')][_0xddd8('0x33')];ut[_0xddd8('0x34')](_0xddd8('0x35'),_0x3b64de[_0xddd8('0x2b')]+_0xddd8('0x36'));}else{_0x3b64de[_0xddd8('0x31')]=utils[_0xddd8('0x32')][_0xddd8('0x37')];ut[_0xddd8('0x34')](_0xddd8('0x35'),_0x3b64de[_0xddd8('0x2b')]+_0xddd8('0x38'));}}}Preview['prototype'][_0xddd8('0x25')]=function(){var _0x3de781=this;setInterval(function(){_0x3de781[_0xddd8('0x39')]();},0x7cf);};Preview['prototype'][_0xddd8('0x39')]=function(){var _0x5d167f=this[_0xddd8('0x11')];this[_0xddd8('0x16')]+=0x1;for(var _0x337324 in _0x5d167f){if(_0x5d167f['hasOwnProperty'](_0x337324)&&(_0x5d167f[_0x337324]['dialMethod']===_0xddd8('0x3a')||_0x5d167f[_0x337324]['dialMethod']==='booked')&&_0x5d167f[_0x337324]['type']===_0xddd8('0x3b')){if(this['clockClearZombieChannels']>0x7){this[_0xddd8('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x5d167f[_0xddd8('0x3c')](_0x337324)&&_0x5d167f[_0x337324][_0xddd8('0x3d')]==='preview'&&_0x5d167f[_0x337324][_0xddd8('0x3e')]===_0xddd8('0x3b')){if(_0x5d167f[_0x337324][_0xddd8('0x3f')]){this[_0xddd8('0x40')](_0x5d167f[_0x337324]);if(_0x5d167f[_0x337324][_0xddd8('0x41')])this['recallMe'](_0x5d167f[_0x337324]);}else{notSendMessagesQueue(_0x5d167f[_0x337324]);}}}};Preview[_0xddd8('0x42')][_0xddd8('0x43')]=function(_0x2d9572){var _0x4c5f20=this;this[_0xddd8('0x10')]['enqueue'](function(){if(!_[_0xddd8('0x44')](_0x4c5f20['actions'][_0x2d9572])){loggerAction[_0xddd8('0x27')](_0xddd8('0x45'),_0x2d9572,'Queue',_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x46')],'originated:\x20',JSON[_0xddd8('0x47')](_0x4c5f20[_0xddd8('0x11')][_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x46')]][_0xddd8('0x2e')]),'pTalking:\x20',JSON[_0xddd8('0x47')](_0x4c5f20[_0xddd8('0x11')][_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x46')]][_0xddd8('0x2f')]),JSON[_0xddd8('0x47')](_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x48')]),JSON[_0xddd8('0x47')](_[_0xddd8('0x49')](_0x4c5f20[_0xddd8('0x14')][_0x2d9572],['contactId',_0xddd8('0x4a'),_0xddd8('0x4b'),_0xddd8('0x4c')])));return ami[_0xddd8('0x4d')]({'action':_0xddd8('0x4e'),'channel':_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x4f')]})[_0xddd8('0x50')](function(_0x3c239d){if(_0x3c239d[_0xddd8('0x31')]===_0xddd8('0x51')){setTimeout(function(){if(_0x4c5f20[_0xddd8('0x14')][_0x2d9572]){ut['updateOriginated'](_0x4c5f20[_0xddd8('0x11')][_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x46')]],_0xddd8('0x52'));if(_0x4c5f20[_0xddd8('0x14')][_0x2d9572]['dialAnswer']===!![]){ut[_0xddd8('0x53')](_0x4c5f20[_0xddd8('0x11')][_0x4c5f20['actions'][_0x2d9572][_0xddd8('0x46')]],_0xddd8('0x52'));ut[_0xddd8('0x54')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2d9572,_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x46')]);}ut['loggerError'](_0xddd8('0x55')+_0x2d9572,_0x4c5f20[_0xddd8('0x14')][_0x2d9572][_0xddd8('0x46')]);delete _0x4c5f20[_0xddd8('0x14')][_0x2d9572];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x306a01=this;loggerAction[_0xddd8('0x27')](_0xddd8('0x56'),_[_0xddd8('0x57')](this['actions']));for(var _0x121fb2 in this[_0xddd8('0x14')]){if(_0x306a01[_0xddd8('0x14')][_0xddd8('0x3c')](_0x121fb2)){_0x306a01[_0xddd8('0x43')](_0x121fb2);}}};Preview[_0xddd8('0x42')]['recallMe']=function(_0x37ccaf){var _0x4e7fef=this;rpcDb[_0xddd8('0x58')](_0x37ccaf['id'],ut['agentReadyId'](this[_0xddd8('0x15')]))[_0xddd8('0x59')](function(_0x360447){if(!_[_0xddd8('0x44')](_0x360447)){for(var _0xaa2a6=0x0;_0xaa2a6<_0x360447[_0xddd8('0x5a')];_0xaa2a6+=0x1){if(ut[_0xddd8('0x5b')](_0x360447[_0xaa2a6][_0xddd8('0x5c')])<_0x37ccaf[_0xddd8('0x5d')]*0x3c){if(_0x360447[_0xaa2a6]['Agent']&&!_0x360447[_0xaa2a6][_0xddd8('0x5e')][_0xddd8('0x5f')]){_0x4e7fef[_0xddd8('0x60')](_0x360447[_0xaa2a6]['id'])[_0xddd8('0x59')](ut[_0xddd8('0x61')](_0xddd8('0x62')))[_0xddd8('0x50')](ut[_0xddd8('0x61')](_0xddd8('0x62')));}else{rpcDb[_0xddd8('0x63')](_0x360447[_0xaa2a6]['id']);}}else{var _0x283b5e=new Action(_0x360447[_0xaa2a6],_0x37ccaf);_0x283b5e[_0xddd8('0x64')]=moment()[_0xddd8('0x29')](_0xddd8('0x65'));_0x37ccaf[_0xddd8('0x66')]+=0x1;ut[_0xddd8('0x67')](_0x283b5e,0x17,_0xddd8('0x68'));if(_0x37ccaf[_0xddd8('0x69')]){rpcDb['rescheduleContactInQueue'](ut[_0xddd8('0x6a')](_0x360447[_0xaa2a6]));rpcDb['createCustomerHistory'](_0x283b5e,_0xddd8('0x6b'));}else{ut['logCustomer'](_0x283b5e,0x16,_0xddd8('0x6c'));rpcDb[_0xddd8('0x6d')](_0x283b5e,_0xddd8('0x6e'));rpcDb['createCustomerFinal'](_0x283b5e,_0xddd8('0x6e'));}}}}})['catch'](ut['logger2'](_0xddd8('0x6f')));};Preview[_0xddd8('0x42')]['setMessage']=function(_0x351a34){_0x351a34['sendMessageOneNotActive']=!![];if(ut[_0xddd8('0x70')](_0x351a34[_0xddd8('0x71')])){_0x351a34[_0xddd8('0x31')]=utils[_0xddd8('0x32')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xddd8('0x72')](_0x351a34['dialActive'])){_0x351a34['message']=utils[_0xddd8('0x32')]['INACTIVE'];}else if(!this[_0xddd8('0x73')](_0x351a34['Trunk'])){if(!this['isTrunkReachable'](_0x351a34[_0xddd8('0x74')])){_0x351a34[_0xddd8('0x31')]=utils[_0xddd8('0x32')]['UNREACHABLE_TRUNK'];}else{_0x351a34[_0xddd8('0x31')]=utils[_0xddd8('0x32')][_0xddd8('0x75')];}}else{_0x351a34['message']=utils[_0xddd8('0x32')][_0xddd8('0x75')];}};Preview[_0xddd8('0x42')][_0xddd8('0x76')]=function(_0xf69787,_0x53f790,_0x2dfca8){var _0x585e8a=this;var _0x58b943=this[_0xddd8('0x14')][_0x53f790];var _0x37691e=this[_0xddd8('0x11')][_0x58b943[_0xddd8('0x46')]];var _0x4d60b9;var _0x5562b7=![];var _0x39c3a3=0x2;var _0x5609df=0x3;if(_0x37691e){switch(_0x2dfca8){case'1':_0x37691e[_0xddd8('0x77')]+=0x1;_0x58b943[_0xddd8('0x78')]+=0x1;_0x58b943[_0xddd8('0x79')]=ut[_0xddd8('0x7a')](_0x58b943);ut[_0xddd8('0x67')](_0x58b943,0x0,_0xddd8('0x7b'));ami[_0xddd8('0x26')]('custom:agentnosuchnumber',ut['buildObj'](_0x58b943,_0xddd8('0x7c')));rpcDb[_0xddd8('0x6d')](_0x58b943,'[callProgressDetectingCustomer][logNoSuch]');_0x585e8a[_0xddd8('0x7d')](_0x58b943,'0',_0x37691e)['then'](function(_0x4e3273){_0x5562b7=_0x4e3273[_0xddd8('0x7e')]==0x1;_0x39c3a3=_0x37691e[_0xddd8('0x7f')];_0x5609df=_0x37691e['callAdditionalPhoneAfterMin'];if(!_0x5562b7){if(ut[_0xddd8('0x7a')](_0x58b943)>=_0x37691e[_0xddd8('0x80')]){_0x4d60b9=ut['cloneAction'](_0x58b943,0xf,'Global');rpcDb[_0xddd8('0x81')](_0x4d60b9,_0xddd8('0x82'));}else{if(_0x58b943[_0xddd8('0x78')]>=_0x37691e[_0xddd8('0x83')]){rpcDb[_0xddd8('0x81')](_0x58b943,_0xddd8('0x82'));}else{rpcDb[_0xddd8('0x84')](ut[_0xddd8('0x85')](_0x58b943,'countnosuchnumberretry',_0x37691e['dialNoSuchNumberRetryFrequency']),_0x58b943[_0xddd8('0x86')],_0x58b943['activeContact']);}}delete this[_0xddd8('0x14')][_0xf69787[_0xddd8('0x87')]];}else{_0x58b943['countnosuchnumberretry']++;logger['info']('actioncountonusuch',_0x58b943[_0xddd8('0x78')]);logger['info']('id',_0x58b943[_0xddd8('0x88')]);_0x585e8a[_0xddd8('0x89')]({'id':_0x58b943[_0xddd8('0x88')],'field':{'countnosuchnumberretry':_0x58b943['countnosuchnumberretry']}})[_0xddd8('0x59')](function(){_0x585e8a[_0xddd8('0x8a')](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});break;case _0xddd8('0x8b'):var _0x24fb9c=moment()[_0xddd8('0x29')](_0xddd8('0x65'));_0x58b943[_0xddd8('0x8c')]=_0x24fb9c;_0x58b943[_0xddd8('0x8d')]=_0x24fb9c;_0x58b943[_0xddd8('0x48')]=!![];_0x37691e[_0xddd8('0x2f')]+=0x1;logger[_0xddd8('0x27')](_0xddd8('0x8e'),_0x58b943[_0xddd8('0x8f')],_0xddd8('0x90'),_0x37691e[_0xddd8('0x2b')],'pTalking:\x20',_0x37691e[_0xddd8('0x2f')]);ami['emit'](_0xddd8('0x91'),ut[_0xddd8('0x92')](_0x58b943,_0xddd8('0x93'),this['campaignsPreview'][_0x58b943[_0xddd8('0x46')]]));if(_0x37691e[_0xddd8('0x94')]){ami[_0xddd8('0x26')](_0xddd8('0x95'),ut[_0xddd8('0x96')](_0x58b943));}break;case'16':ami[_0xddd8('0x26')]('custom:agentcomplete',ut[_0xddd8('0x92')](_0x58b943,_0xddd8('0x97'),this['campaignsPreview'][_0x58b943['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x58b943,'complete'));_0x37691e[_0xddd8('0x98')]+=0x1;_0x37691e[_0xddd8('0x99')]+=0x1;_0x37691e[_0xddd8('0x9a')]+=0x1;ut[_0xddd8('0x53')](_0x37691e,'[16]');_0x58b943['countglobal']=ut[_0xddd8('0x7a')](_0x58b943);ut[_0xddd8('0x67')](_0x58b943,0x4,'Answer');rpcDb[_0xddd8('0x6d')](_0x58b943,_0xddd8('0x9b'));rpcDb[_0xddd8('0x81')](_0x58b943,_0xddd8('0x9c'));rpcDb[_0xddd8('0x9d')](_0x58b943);_0x37691e[_0xddd8('0x9e')]+=_0x58b943[_0xddd8('0x9f')];_0x37691e[_0xddd8('0xa0')]+=_0x58b943[_0xddd8('0x9f')];logger[_0xddd8('0x27')]('[syncHangup][talking][decrement]',_0x58b943['uniqueid'],_0xddd8('0x90'),_0x37691e[_0xddd8('0x2b')],_0xddd8('0xa1'),_0x37691e[_0xddd8('0x2f')]);delete this[_0xddd8('0x14')][_0xf69787[_0xddd8('0x87')]];break;case _0xddd8('0xa2'):_0x37691e[_0xddd8('0xa3')]+=0x1;_0x58b943['countbusyretry']+=0x1;_0x58b943[_0xddd8('0x79')]=ut[_0xddd8('0x7a')](_0x58b943);ut[_0xddd8('0x67')](_0x58b943,0x5,_0xddd8('0xa4'));_0x39c3a3=_0x37691e[_0xddd8('0xa5')];_0x5609df=_0x37691e[_0xddd8('0xa6')];ami[_0xddd8('0x26')]('custom:agentbusy',ut['buildObj'](_0x58b943,_0xddd8('0xa7')));rpcDb[_0xddd8('0x6d')](_0x58b943,'[callProgressDetectingCustomer][logBusy]');_0x585e8a[_0xddd8('0x7d')](_0x58b943,'5',_0x37691e)[_0xddd8('0x59')](function(_0x40b7f5){_0x5562b7=_0x40b7f5[_0xddd8('0x7e')]==0x1;if(!_0x5562b7){if(ut[_0xddd8('0x7a')](_0x58b943)>=_0x37691e[_0xddd8('0x80')]){_0x4d60b9=ut[_0xddd8('0xa8')](_0x58b943,0xf,'Global');rpcDb[_0xddd8('0x81')](_0x4d60b9,_0xddd8('0xa9'));}else{if(_0x58b943[_0xddd8('0xaa')]>=_0x37691e[_0xddd8('0xab')]){rpcDb[_0xddd8('0x81')](_0x58b943,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xddd8('0x84')](ut['scheduledAt'](_0x58b943,_0xddd8('0xaa'),_0x37691e[_0xddd8('0xa5')]),_0x58b943[_0xddd8('0x86')],_0x58b943[_0xddd8('0xac')]);}}}else{_0x58b943['countbusyretry']++;_0x585e8a['incrementPreviewCounters']({'id':_0x58b943[_0xddd8('0x88')],'field':{'countbusyretry':_0x58b943[_0xddd8('0xaa')]}})[_0xddd8('0x59')](function(){_0x585e8a[_0xddd8('0x8a')](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});break;case _0xddd8('0xad'):_0x37691e[_0xddd8('0xae')]+=0x1;_0x58b943[_0xddd8('0xaf')]+=0x1;_0x58b943[_0xddd8('0x79')]=ut['totalGlobal'](_0x58b943);ut[_0xddd8('0x67')](_0x58b943,0x3,_0xddd8('0xb0'));_0x39c3a3=_0x37691e['dialNoAnswerRetryFrequency'];_0x5609df=_0x37691e[_0xddd8('0xa6')];var _0x4e0562=ut[_0xddd8('0xb1')](_0x58b943,_0x37691e);ami[_0xddd8('0x26')](_0xddd8('0xb2'),_0x4e0562);rpcDb['createCustomerHistory'](_0x58b943,_0xddd8('0xb3'));_0x585e8a[_0xddd8('0x7d')](_0x58b943,'3',_0x37691e)[_0xddd8('0x59')](function(_0x4421ae){_0x5562b7=_0x4421ae[_0xddd8('0x7e')]==0x1;if(!_0x5562b7){if(ut[_0xddd8('0x7a')](_0x58b943)>=_0x37691e['dialGlobalMaxRetry']){_0x4d60b9=ut['cloneAction'](_0x58b943,0xf,_0xddd8('0xb4'));rpcDb[_0xddd8('0x81')](_0x4d60b9,_0xddd8('0xb5'));}else{if(_0x58b943[_0xddd8('0xaf')]>=_0x37691e[_0xddd8('0xb6')]){rpcDb[_0xddd8('0x81')](_0x58b943,_0xddd8('0xb3'));}else{rpcDb[_0xddd8('0x84')](ut[_0xddd8('0x85')](_0x58b943,_0xddd8('0xaf'),_0x37691e[_0xddd8('0xb7')]),_0x58b943[_0xddd8('0x86')],_0x58b943[_0xddd8('0xac')]);}}}else{_0x58b943[_0xddd8('0xaf')]++;_0x585e8a[_0xddd8('0x89')]({'id':_0x58b943['idContact'],'field':{'countnoanswerretry':_0x58b943[_0xddd8('0xaf')]}})[_0xddd8('0x59')](function(){_0x585e8a[_0xddd8('0x8a')](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});break;case'CONGESTION':_0x37691e[_0xddd8('0xb8')]+=0x1;_0x58b943[_0xddd8('0xb9')]+=0x1;_0x58b943[_0xddd8('0x79')]=ut[_0xddd8('0x7a')](_0x58b943);ut['logCustomer'](_0x58b943,0x8,'Congestion');_0x39c3a3=_0x37691e[_0xddd8('0xba')];_0x5609df=_0x37691e[_0xddd8('0xa6')];ami[_0xddd8('0x26')](_0xddd8('0xbb'),ut[_0xddd8('0x92')](_0x58b943,_0xddd8('0xbc')));rpcDb[_0xddd8('0x6d')](_0x58b943,'[callProgressDetectingCustomer][logCongestion]');_0x585e8a['verifyAdditionalPhones'](_0x58b943,'8',_0x37691e)[_0xddd8('0x59')](function(_0x539410){_0x5562b7=_0x539410[_0xddd8('0x7e')]==0x1;if(!_0x5562b7){if(ut[_0xddd8('0x7a')](_0x58b943)>=_0x37691e[_0xddd8('0x80')]){_0x4d60b9=ut[_0xddd8('0xa8')](_0x58b943,0xf,_0xddd8('0xb4'));rpcDb['createCustomerFinal'](_0x4d60b9,_0xddd8('0xbd'));}else{if(_0x58b943[_0xddd8('0xb9')]>=_0x37691e[_0xddd8('0xbe')]){rpcDb[_0xddd8('0x81')](_0x58b943,_0xddd8('0xbf'));}else{rpcDb[_0xddd8('0x84')](ut[_0xddd8('0x85')](_0x58b943,_0xddd8('0xb9'),_0x37691e['dialBusyRetryFrequency']),_0x58b943[_0xddd8('0x86')],_0x58b943[_0xddd8('0xac')]);}}}else{_0x58b943['countcongestionretry']++;_0x585e8a[_0xddd8('0x89')]({'id':_0x58b943['idContact'],'field':{'countcongestionretry':_0x58b943['countcongestionretry']}})['then'](function(){_0x585e8a['swapAdditionalPhones'](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});break;case _0xddd8('0xc0'):_0x37691e['outboundRejectCallsDay']+=0x1;_0x58b943[_0xddd8('0xc1')]+=0x1;_0x58b943['countglobal']=ut['totalGlobal'](_0x58b943);ut['logCustomer'](_0x58b943,0x14,'AgentReject');_0x39c3a3=_0x37691e['dialAgentRejectRetryFrequency'];_0x5609df=_0x37691e[_0xddd8('0xa6')];ami[_0xddd8('0x26')](_0xddd8('0xc2'),ut[_0xddd8('0x92')](_0x58b943,'agentreject'));rpcDb[_0xddd8('0x6d')](_0x58b943,'[syncHangupRequest][logAgentReject]');_0x585e8a[_0xddd8('0x7d')](_0x58b943,'20',_0x37691e)['then'](function(_0x2e9b48){_0x5562b7=_0x2e9b48['additional']==0x1;if(!_0x5562b7){if(ut['totalGlobal'](_0x58b943)>=_0x37691e[_0xddd8('0x80')]){_0x4d60b9=ut[_0xddd8('0xa8')](_0x58b943,0x14,_0xddd8('0xc3'));rpcDb[_0xddd8('0x81')](_0x4d60b9,_0xddd8('0xc4'));}else{if(_0x58b943['countagentrejectretry']>=_0x37691e['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x58b943,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xddd8('0x85')](_0x58b943,_0xddd8('0xc1'),_0x37691e[_0xddd8('0xc5')]),_0x58b943[_0xddd8('0x86')],_0x58b943[_0xddd8('0xac')]);}}}else{_0x58b943[_0xddd8('0xaf')]++;_0x585e8a[_0xddd8('0x89')]({'id':_0x58b943[_0xddd8('0x88')],'field':{'countnoanswerretry':_0x58b943[_0xddd8('0xaf')]}})[_0xddd8('0x59')](function(){_0x585e8a[_0xddd8('0x8a')](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});break;case'ABANDONED':_0x37691e['outboundAbandonedCallsDay']+=0x1;_0x58b943[_0xddd8('0xc6')]+=0x1;_0x58b943[_0xddd8('0x79')]=ut['totalGlobal'](_0x58b943);ut['logCustomer'](_0x58b943,0xb,_0xddd8('0xc7'));rpcDb[_0xddd8('0x6d')](_0x58b943,'[callProgressDetectingCustomer][logAbandoned]');_0x585e8a[_0xddd8('0x7d')](_0x58b943,'11',_0x37691e)[_0xddd8('0x59')](function(_0x4d4f85){_0x5562b7=_0x4d4f85[_0xddd8('0x7e')]==0x1;if(!_0x5562b7){if(ut[_0xddd8('0x7a')](_0x58b943)>=_0x37691e['dialGlobalMaxRetry']){_0x4d60b9=ut[_0xddd8('0xa8')](_0x58b943,0xf,_0xddd8('0xb4'));rpcDb[_0xddd8('0x81')](_0x4d60b9,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x58b943[_0xddd8('0xc8')]>=_0x37691e['dialAbandonedMaxRety']){rpcDb[_0xddd8('0x81')](_0x58b943,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xddd8('0x84')](ut['scheduledAt'](_0x58b943,'countabandonedretry',_0x37691e['dialAbandonedRetryFrequency']),_0x58b943[_0xddd8('0x86')],_0x58b943[_0xddd8('0xac')]);}}}else{_0x58b943[_0xddd8('0xaf')]++;_0x585e8a['incrementPreviewCounters']({'id':_0x58b943[_0xddd8('0x88')],'field':{'countnoanswerretry':_0x58b943['countnoanswerretry']}})[_0xddd8('0x59')](function(){_0x585e8a[_0xddd8('0x8a')](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});break;case'18':_0x37691e[_0xddd8('0xc9')]+=0x1;_0x58b943['countmachineretry']+=0x1;_0x58b943[_0xddd8('0x79')]=ut['totalGlobal'](_0x58b943);ut['logCustomer'](_0x58b943,0x12,_0xf69787[_0xddd8('0xca')]||_0xf69787[_0xddd8('0xcb')]);ami[_0xddd8('0x26')]('custom:amd',ut[_0xddd8('0x92')](_0x58b943,_0xddd8('0xcc')));rpcDb['createCustomerHistory'](_0x58b943,_0xddd8('0xcd'));_0x585e8a['verifyAdditionalPhones'](_0x58b943,'18',_0x37691e)['then'](function(_0x4f8e51){_0x5562b7=_0x4f8e51[_0xddd8('0x7e')]==0x1;if(!_0x5562b7){if(ut['totalGlobal'](_0x58b943)>=_0x37691e['dialGlobalMaxRetry']){_0x4d60b9=ut[_0xddd8('0xa8')](_0x58b943,0x12,_0xddd8('0xb4'));rpcDb[_0xddd8('0x81')](_0x4d60b9,_0xddd8('0xcd'));}else{rpcDb[_0xddd8('0x81')](_0x58b943,_0xddd8('0xcd'));}}else{_0x58b943[_0xddd8('0xaf')]++;_0x585e8a[_0xddd8('0x89')]({'id':_0x58b943[_0xddd8('0x88')],'field':{'countnoanswerretry':_0x58b943[_0xddd8('0xaf')]}})[_0xddd8('0x59')](function(){_0x585e8a[_0xddd8('0x8a')](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});delete this[_0xddd8('0x14')][_0xf69787[_0xddd8('0x87')]];break;case'19':_0x37691e['outboundUnknownCallsDay']+=0x1;_0x58b943['countglobal']=ut[_0xddd8('0x7a')](_0x58b943);ut[_0xddd8('0x67')](_0x58b943,0x13,_0xf69787['cause-txt']||_0xf69787['dialstatus']);ami[_0xddd8('0x26')]('custom:amd',ut[_0xddd8('0x92')](_0x58b943,_0xddd8('0xcc')));rpcDb[_0xddd8('0x6d')](_0x58b943,_0xddd8('0xce'));_0x585e8a[_0xddd8('0x7d')](_0x58b943,'18',_0x37691e)[_0xddd8('0x59')](function(_0x5c2ec1){_0x5562b7=_0x5c2ec1[_0xddd8('0x7e')]==0x1;if(!_0x5562b7){if(ut[_0xddd8('0x7a')](_0x58b943)>=_0x37691e[_0xddd8('0x80')]){_0x4d60b9=ut[_0xddd8('0xa8')](_0x58b943,0xf,_0xddd8('0xb4'));rpcDb[_0xddd8('0x81')](_0x4d60b9,_0xddd8('0xce'));}else{rpcDb[_0xddd8('0x81')](_0x58b943,_0xddd8('0xce'));}}else{_0x58b943[_0xddd8('0xaf')]++;_0x585e8a[_0xddd8('0x89')]({'id':_0x58b943[_0xddd8('0x88')],'field':{'countnoanswerretry':_0x58b943[_0xddd8('0xaf')]}})[_0xddd8('0x59')](function(){_0x585e8a[_0xddd8('0x8a')](_0x58b943,_0x39c3a3,_0x5609df)[_0xddd8('0x59')](function(){});});}});delete this['actions'][_0xf69787[_0xddd8('0x87')]];break;default:if(_0x58b943[_0xddd8('0x48')]){ut[_0xddd8('0x53')](_0x37691e,_0xddd8('0xcf'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x37691e['name'],_0xf69787);}_0x37691e[_0xddd8('0xc9')]+=0x1;_0x58b943[_0xddd8('0x79')]=ut[_0xddd8('0x7a')](_0x58b943);ut['logCustomer'](_0x58b943,0xc,_0xf69787[_0xddd8('0xca')]||_0xf69787[_0xddd8('0xcb')]);_0x39c3a3=_0x37691e['dialAgentRejectRetryFrequency'];_0x5609df=_0x37691e[_0xddd8('0xa6')];rpcDb[_0xddd8('0x6d')](_0x58b943,'[callProgressDetectingCustomer][logUnknown]');_0x585e8a['verifyAdditionalPhones'](_0x58b943,'20',_0x37691e)[_0xddd8('0x59')](function(_0x3a487b){_0x5562b7=_0x3a487b['additional']==0x1;if(!_0x5562b7){if(ut[_0xddd8('0x7a')](_0x58b943)>=_0x37691e['dialGlobalMaxRetry']){_0x4d60b9=ut[_0xddd8('0xa8')](_0x58b943,0xf,_0xddd8('0xb4'));rpcDb[_0xddd8('0x81')](_0x4d60b9,_0xddd8('0xd0'));}else{rpcDb[_0xddd8('0x81')](_0x58b943,_0xddd8('0xd0'));}delete this[_0xddd8('0x14')][_0xf69787[_0xddd8('0x87')]];}else{_0x585e8a['swapAdditionalPhones'](_0x58b943,_0x39c3a3,_0x5609df)['then'](function(){});}});}if(!(_0x58b943[_0xddd8('0x48')]&&_0x2dfca8==='16')){ut[_0xddd8('0xd1')](_0x37691e,_0xddd8('0xd2'));logger[_0xddd8('0x27')]('[originated][decrement][callProgressDetectingCustomer]',_0x58b943[_0xddd8('0x8f')],'\x20Queue',_0x37691e[_0xddd8('0x2b')],_0xddd8('0xd3'),_0x37691e[_0xddd8('0x2e')]);}if(_0x2dfca8!==_0xddd8('0x8b')){delete this['actions'][_0xf69787[_0xddd8('0x87')]];delete this[_0xddd8('0x14')][_0xf69787[_0xddd8('0xd4')]];}_0x37691e[_0xddd8('0xd5')]=!![];}};Preview[_0xddd8('0x42')][_0xddd8('0xd6')]=function(_0x592006,_0x271acd,_0x51ecb2){if(_[_0xddd8('0xd7')](_0x271acd)&&_0xddd8('0xd8')!==typeof _0x271acd){return;}if(_[_0xddd8('0xd7')](_0x51ecb2)&&_0xddd8('0xd8')!==typeof _0x51ecb2){return;}switch(_0x51ecb2[_0xddd8('0xd9')]){case'0':ut[_0xddd8('0xda')](_0x592006,0x0,_0xddd8('0x7b'));rpcDb[_0xddd8('0xdb')](_0x592006,_0xddd8('0xdc'));break;case'3':ut['logAgent'](_0x592006,0x3,_0xddd8('0xb0'));rpcDb['createAgentHistory'](_0x592006,_0xddd8('0xdd'));break;case'5':ut[_0xddd8('0xda')](_0x592006,0x5,'Busy');rpcDb[_0xddd8('0xdb')](_0x592006,_0xddd8('0xde'));break;case'8':ut[_0xddd8('0xda')](_0x592006,0x8,'Congestion');rpcDb['createAgentHistory'](_0x592006,_0xddd8('0xdf'));break;case'22':ut[_0xddd8('0xda')](_0x592006,0x16,'AnswerAGI');rpcDb[_0xddd8('0xdb')](_0x592006,_0xddd8('0xe0'));break;default:ut[_0xddd8('0xda')](_0x592006,0xc,_0x51ecb2[_0xddd8('0xd9')]);rpcDb[_0xddd8('0xdb')](_0x592006,_0xddd8('0xdf'));}ut[_0xddd8('0xd1')](_0x271acd,_0xddd8('0xe1'));logger[_0xddd8('0x27')]('[originated][decrement][callProgressDetectingAgent]',_0x592006[_0xddd8('0x8f')],_0xddd8('0x90'),_0x271acd[_0xddd8('0x2b')],_0xddd8('0xd3'),_0x271acd['originated']);delete this['actions'][_0x592006[_0xddd8('0x8f')]];};Preview['prototype'][_0xddd8('0x7d')]=function(_0x32f04c,_0x1e9420,_0x38bb4b){return cmHopperAdditionalPhone[_0xddd8('0x7d')](_0x32f04c,_0x1e9420,_0x38bb4b)[_0xddd8('0x50')](logger['info'](_0xddd8('0xe2')));};Preview[_0xddd8('0x42')][_0xddd8('0x8a')]=function(_0x18d02a,_0x384d77,_0x2d2ca7){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x18d02a,_0x384d77,_0x2d2ca7)[_0xddd8('0x50')](logger['info'](_0xddd8('0xe3')));};Preview['prototype'][_0xddd8('0x89')]=function(_0x516098){return Promise[_0xddd8('0xe4')]()['then'](cmHopperAdditionalPhone[_0xddd8('0x89')](_0x516098))['catch'](logger[_0xddd8('0x27')](_0xddd8('0xe5')));};Preview[_0xddd8('0x42')][_0xddd8('0xe6')]=function(_0x450e0c,_0x26aea4,_0xc5ee0a,_0x4767f8,_0x5e3e75){var _0x4737a5=this;return new Promise(function(_0x1a5400,_0x42921c){if(_['isNil'](_0x26aea4)||_['isNil'](_0x26aea4[_0xddd8('0xe7')])||_[_0xddd8('0x44')](_0x26aea4[_0xddd8('0xe8')])||_[_0xddd8('0x44')](_0x26aea4[_0xddd8('0x4b')])){_0x42921c(ut['message']('Contact\x20is\x20undefined',_0x4767f8,_0x5e3e75));return;}var _0x1c3bfe=uuid['v4']();var _0x3febc9=_0x4737a5[_0xddd8('0x11')][_0x26aea4['Queue'][_0xddd8('0x2b')]];var _0x56c1c7=_0xc5ee0a?_0x4737a5[_0xddd8('0x15')][_0xc5ee0a]['id']:undefined;_0x4737a5[_0xddd8('0x14')][_0x1c3bfe]=new Action(_0x26aea4,_0x3febc9,_0x1c3bfe,_0xc5ee0a,_0x56c1c7);var _0x4362fc=_0x4737a5[_0xddd8('0x14')][_0x1c3bfe];_0x4362fc['unlockAgent']=_0x4767f8;_0x4362fc['activeContact']=_0x5e3e75;_0x4362fc['lookAgent']=_0xc5ee0a;if(_['isEmpty'](_0x450e0c)){_0x4737a5[_0xddd8('0xe9')](_0x4362fc,_0x3febc9,_0x26aea4,_0xc5ee0a)['then'](function(_0x29bead){logger['info'](_0xddd8('0xea'),'Queue:\x20'+_0x4362fc[_0xddd8('0x46')]+_0xddd8('0xeb')+_0x4362fc[_0xddd8('0x88')],JSON[_0xddd8('0x47')](_0x29bead));ami[_0xddd8('0x26')](_0xddd8('0xec'),ut['buildObj'](_0x4362fc,_0xddd8('0xed'),_0x4737a5['campaignsPreview'][_0x4362fc[_0xddd8('0x46')]]));_0x1a5400(ut['message'](_0xddd8('0xee')));})[_0xddd8('0x50')](function(_0x40bd76){ut[_0xddd8('0x34')](_0xddd8('0xef'),_0x40bd76);_0x42921c(ut[_0xddd8('0x31')](_0xddd8('0xf0'),_0x4767f8,_0x5e3e75));});}else{_0x3febc9[_0xddd8('0xf1')]+=0x1;ut[_0xddd8('0xf2')](_0x4362fc);rpcDb[_0xddd8('0xf3')](_0x4362fc,_0xddd8('0xf4'));delete _0x4737a5[_0xddd8('0x14')][_0x1c3bfe];_0x42921c(ut[_0xddd8('0x31')](_0xddd8('0xf5'),_0x4767f8,_0x5e3e75));}});};Preview[_0xddd8('0x42')][_0xddd8('0x73')]=function(_0x20edfb){return!_[_0xddd8('0x44')](_0x20edfb)&&!_[_0xddd8('0x44')](_0x20edfb['name'])&&!_['isNil'](_0x20edfb[_0xddd8('0xf6')])&&_0x20edfb[_0xddd8('0xf6')]&&!_[_0xddd8('0x44')](this[_0xddd8('0x13')][util[_0xddd8('0x29')]('SIP/%s',_0x20edfb[_0xddd8('0x2b')])])&&!_[_0xddd8('0x44')](this[_0xddd8('0x13')][util[_0xddd8('0x29')]('SIP/%s',_0x20edfb[_0xddd8('0x2b')])][_0xddd8('0x4e')])&&(this[_0xddd8('0x13')][util[_0xddd8('0x29')](_0xddd8('0xf7'),_0x20edfb[_0xddd8('0x2b')])]['status']===_0xddd8('0xf8')||this[_0xddd8('0x13')][util['format']('SIP/%s',_0x20edfb['name'])][_0xddd8('0x4e')]===_0xddd8('0xf9'));};Preview[_0xddd8('0x42')][_0xddd8('0x60')]=function(_0xf294a5,_0x2b283c){return this['execRun'](_0xf294a5,_0x2b283c)['then'](function(_0x10eb90){return _['pick'](_0x10eb90,[_0xddd8('0x31')]);})[_0xddd8('0x50')](function(_0x35a07a){if(_0x35a07a[_0xddd8('0xfa')]){rpcDb[_0xddd8('0xfb')](_0xf294a5);}if(_0x35a07a[_0xddd8('0xf6')]){rpcDb[_0xddd8('0x63')](_0xf294a5);}throw _[_0xddd8('0x49')](_0x35a07a,[_0xddd8('0x31')]);});};Preview[_0xddd8('0x42')][_0xddd8('0xfc')]=function(_0x3af102,_0x4af1a9){var _0x2bd37b=this;var _0xea7fd2,_0x5bb34d;return rpcDb[_0xddd8('0xfd')](_0x3af102)[_0xddd8('0x59')](function(_0x66ff38){if(!_[_0xddd8('0x44')](_0x66ff38[0x0])){_0x5bb34d=_0x66ff38[0x0][_0xddd8('0xfe')]?![]:!![];_0xea7fd2=_0x66ff38[0x0][_0xddd8('0xfe')]?!![]:![];_0xea7fd2=_0x4af1a9?!![]:_0xea7fd2;}var _0x570793=_0x2bd37b[_0xddd8('0xff')](_0x66ff38);if(_0x570793[_0xddd8('0x100')]){rpcDb[_0xddd8('0x101')](_['pick'](_0x66ff38[0x0],[_0xddd8('0x4b'),_0xddd8('0xe8')]))['then'](function(_0x2749c9){_0x2bd37b['checkInBlack'](_0x2749c9,_0x66ff38[0x0],_0x4af1a9,_0x5bb34d,_0xea7fd2)[_0xddd8('0x59')](function(_0x259c81){return _0x259c81;})['catch'](function(_0x4372d0){throw _0x4372d0;});})['catch'](function(_0x3266f9){ut[_0xddd8('0x34')](_0xddd8('0x102'),_0x3266f9);throw ut['message'](_0xddd8('0x103'),_0x5bb34d,_0xea7fd2);});}else{throw ut['message'](_0x570793[_0xddd8('0x31')],_0x5bb34d,_0xea7fd2);}})[_0xddd8('0x50')](function(_0x4217f1){ut[_0xddd8('0x34')](_0xddd8('0x104'),_0x4217f1);throw ut['message'](_0xddd8('0x103'),![],!![]);});};Preview[_0xddd8('0x42')][_0xddd8('0xff')]=function(_0x35042f){if(_[_0xddd8('0x44')](_0x35042f)||_['isEmpty'](_0x35042f)||!_['isNil'](_0x35042f[0x0][_0xddd8('0x5e')])&&_['isNil'](_0x35042f[0x0]['Agent'][_0xddd8('0x2b')])){ut[_0xddd8('0x34')](_0xddd8('0x105'),_0x35042f);return{'isValid':![],'message':_0xddd8('0x106')};}var _0x586746=this['campaignsPreview'][_0x35042f[0x0]['Queue'][_0xddd8('0x2b')]];_0x586746[_0xddd8('0x31')]=utils[_0xddd8('0x32')][_0xddd8('0x75')];if(_[_0xddd8('0x44')](_0x586746)){ut['logger'](_0xddd8('0x107'),_0x586746);return{'isValid':![],'message':_0xddd8('0x108')};}if(!this[_0xddd8('0x73')](_0x586746[_0xddd8('0x109')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xddd8('0x10a')+_0x586746['name']+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x586746[_0xddd8('0x74')])){ut[_0xddd8('0x34')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x586746['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xddd8('0x72')](_0x586746[_0xddd8('0x3f')])){ut[_0xddd8('0x34')](_0xddd8('0x10b'),_0x586746['name']+_0xddd8('0x10c'));return{'isValid':![],'message':_0xddd8('0x10a')+_0x586746[_0xddd8('0x2b')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0xddd8('0xe9')]=function(_0x3da26b,_0x60d708,_0x4f783a,_0x37e37d){var _0x4fbd72=this;return new Promise(function(_0x3be8c9,_0x599d41){var _0x429ea5=_0x3da26b[_0xddd8('0x8f')];var _0x4d64fe=_0x4fbd72[_0xddd8('0x73')](_0x60d708[_0xddd8('0x109')])?util[_0xddd8('0x29')](_0xddd8('0x10d'),_0x60d708[_0xddd8('0x109')][_0xddd8('0x2b')],_['isNil'](_0x60d708[_0xddd8('0x10e')])?'':_0x60d708[_0xddd8('0x10e')][_0xddd8('0x10f')]()||'',_0x60d708[_0xddd8('0x110')]>0x0?_0x4f783a[_0xddd8('0xe8')][_0xddd8('0x111')](_0x60d708['dialCutDigit']):_0x4f783a[_0xddd8('0xe8')]):util[_0xddd8('0x29')](_0xddd8('0x10d'),_[_0xddd8('0x44')](_0x60d708[_0xddd8('0x74')])?_0x60d708[_0xddd8('0x109')][_0xddd8('0x2b')]:_0x60d708['TrunkBackup'][_0xddd8('0x2b')],_[_0xddd8('0x44')](_0x60d708[_0xddd8('0x10e')])?'':_0x60d708[_0xddd8('0x10e')]['trim']()||'',_0x60d708[_0xddd8('0x110')]>0x0?_0x4f783a[_0xddd8('0xe8')][_0xddd8('0x111')](_0x60d708['dialCutDigit']):_0x4f783a['phone']);var _0xb1e629=_0x4fbd72[_0xddd8('0x73')](_0x60d708[_0xddd8('0x109')])?ut[_0xddd8('0x112')](_0x60d708[_0xddd8('0x109')][_0xddd8('0x113')],_0x60d708[_0xddd8('0x114')],_0x60d708[_0xddd8('0x115')]>0x0?ut['getCallerIdRandom'](_0x60d708['dialOriginateCallerIdNumber'],_0x60d708[_0xddd8('0x115')]):_0x60d708['dialOriginateCallerIdNumber']):ut[_0xddd8('0x112')](_[_0xddd8('0x44')](_0x60d708[_0xddd8('0x74')])?_0x60d708[_0xddd8('0x109')]['callerid']:_0x60d708[_0xddd8('0x74')]['callerid'],_0x60d708[_0xddd8('0x114')],_0x60d708[_0xddd8('0x115')]>0x0?ut[_0xddd8('0x116')](_0x60d708[_0xddd8('0x117')],_0x60d708[_0xddd8('0x115')]):_0x60d708[_0xddd8('0x117')]);if(_0xb1e629){_0x3da26b[_0xddd8('0x118')]=ut[_0xddd8('0x119')](_0xb1e629);_0x3da26b[_0xddd8('0x11a')]=ut[_0xddd8('0x11b')](_0xb1e629);}var _0x51842b=ut[_0xddd8('0x11c')](_0x60d708,_0x4f783a,_0x4d64fe,_0xb1e629,_0x429ea5,_0x3da26b);var _0xbb775c=utils[_0xddd8('0x11d')](_0x4f783a['Contact']);Object[_0xddd8('0x11e')](_0x51842b,_0xbb775c);_['merge'](_0x3da26b,ut[_0xddd8('0x11f')](_0x51842b));_0x3da26b[_0xddd8('0x64')]=moment()[_0xddd8('0x29')](_0xddd8('0x65'));_0x60d708[_0xddd8('0x120')]=_0x51842b;var _0x427ef8=ut[_0xddd8('0x121')](_0x3da26b,_0x60d708,_0x51842b,_0x3da26b['activeContact'],_0x37e37d);return ami[_0xddd8('0x4d')](_0x427ef8)[_0xddd8('0x59')](function(_0x16bb92){_0x60d708['originated']+=0x1;logger['info'](_0xddd8('0x122'),_0x429ea5,_0xddd8('0x90'),_0x60d708['name'],_0xddd8('0xd3'),_0x60d708[_0xddd8('0x2e')]);_0x3be8c9(_0x16bb92);})[_0xddd8('0x50')](function(_0x17aa6c){ut[_0xddd8('0xda')](_0x3da26b,0xe,_0xddd8('0x123'));rpcDb[_0xddd8('0xdb')](_0x3da26b,_0xddd8('0x124'));_0x599d41(_0x17aa6c);});});};Preview[_0xddd8('0x42')]['syncNewExten']=function(_0x335fa3){if(this[_0xddd8('0x14')][_0x335fa3[_0xddd8('0x87')]]){this[_0xddd8('0x14')][_0x335fa3['linkedid']][_0xddd8('0x4f')]=_0x335fa3[_0xddd8('0x4f')];}};Preview[_0xddd8('0x42')][_0xddd8('0x18')]=function(_0x3e5986){var _0x4ec895=this;var _0x5548ac=this[_0xddd8('0x14')][_0x3e5986[_0xddd8('0x125')]];if(_0x5548ac){if(_0x5548ac[_0xddd8('0x126')]&&this['agents'][_0x5548ac[_0xddd8('0x126')]]){ut[_0xddd8('0x127')](_0x5548ac,this[_0xddd8('0x15')][_0x5548ac[_0xddd8('0x126')]][_0xddd8('0x2b')],this['agents'][_0x5548ac['lookAgent']]['id']);}var _0xf8db56=_[_0xddd8('0x128')](_0x5548ac);_0xf8db56[_0xddd8('0x8c')]=moment()[_0xddd8('0x29')](_0xddd8('0x65'));var _0x319242=_0x4ec895[_0xddd8('0x11')][_0x5548ac[_0xddd8('0x46')]];if(ut[_0xddd8('0x129')](_0x3e5986[_0xddd8('0x12a')])){if(_0x5548ac[_0xddd8('0x86')]){rpcDb[_0xddd8('0xfb')](_0x5548ac[_0xddd8('0x88')]);}if(_0x5548ac[_0xddd8('0xac')]){rpcDb['disableContact'](_0x5548ac[_0xddd8('0x88')]);}ami[_0xddd8('0x26')](_0xddd8('0x12b'),ut[_0xddd8('0x92')](_0x5548ac,_0xddd8('0x12c'),this[_0xddd8('0x11')][_0x5548ac[_0xddd8('0x46')]]));this[_0xddd8('0xd6')](_0xf8db56,_0x319242,_0x3e5986);}else{_0x5548ac[_0xddd8('0x64')]=moment()[_0xddd8('0x29')](_0xddd8('0x65'));ut[_0xddd8('0xda')](_0xf8db56,0x4,_0xddd8('0x12d'));rpcDb[_0xddd8('0xdb')](_0xf8db56,_0xddd8('0x12e'));}}};Preview[_0xddd8('0x42')]['syncHangup']=function(_0xf82291){var _0x167200=this['actions'][_0xf82291['linkedid']];var _0x184769;if(_0x167200){_0x184769=this[_0xddd8('0x11')][_0x167200[_0xddd8('0x46')]];logger[_0xddd8('0x27')](_0xddd8('0x12f'),_0xf82291[_0xddd8('0x87')],_0xddd8('0x90'),_0x184769['name'],_0xddd8('0xa1'),_0x184769[_0xddd8('0x2f')]);}if(this[_0xddd8('0x14')][_0xf82291[_0xddd8('0x87')]]&&_0xf82291[_0xddd8('0x87')]!==_0xf82291[_0xddd8('0x8f')]){if(_0xf82291[_0xddd8('0x130')]==='16'&&this[_0xddd8('0x14')][_0xf82291[_0xddd8('0x87')]][_0xddd8('0x48')]){this[_0xddd8('0x76')](_0xf82291,_0xf82291[_0xddd8('0x87')],_0xf82291[_0xddd8('0x130')]);}else if(this[_0xddd8('0x14')][_0xf82291[_0xddd8('0x87')]]['dialAnswer']){logger[_0xddd8('0x27')](_0xddd8('0x131'),_0xf82291[_0xddd8('0x87')],_0xf82291[_0xddd8('0x130')],_0xddd8('0x90'),_0x184769[_0xddd8('0x2b')],_0xddd8('0xa1'),_0x184769[_0xddd8('0x2f')]);this[_0xddd8('0x76')](_0xf82291,_0xf82291[_0xddd8('0x87')],_0xf82291[_0xddd8('0x130')]);}}else if(_0x167200&&_[_0xddd8('0x44')](_0x167200[_0xddd8('0x132')])&&_0x184769['dialQueueProject']&&_0xf82291[_0xddd8('0x87')]===_0xf82291['uniqueid']&&_['isNil'](_0xf82291[_0xddd8('0xd9')])&&_0xf82291[_0xddd8('0x130')]==='16'&&_0xf82291[_0xddd8('0x133')]==='6'&&_[_0xddd8('0xd7')](_0x167200[_0xddd8('0x134')])){if(_0x167200[_0xddd8('0x86')]){rpcDb[_0xddd8('0xfb')](_0x167200[_0xddd8('0x88')]);}if(_0x167200['activeContact']){rpcDb[_0xddd8('0x63')](_0x167200[_0xddd8('0x88')]);}_0xf82291['reason']='22';this[_0xddd8('0xd6')](_0x167200,_0x184769,_0xf82291);}else if(_0x167200&&_0x167200['transfer']){if(_0xf82291['cause']==='16'&&this['actions'][_0xf82291[_0xddd8('0x87')]]['dialAnswer']){logger[_0xddd8('0x27')]('[syncHangup][talking][transfer]',_0xf82291[_0xddd8('0x87')],_0xf82291[_0xddd8('0x130')],'\x20Queue',_0x184769[_0xddd8('0x2b')],_0xddd8('0xa1'),_0x184769[_0xddd8('0x2f')]);this[_0xddd8('0x76')](_0xf82291,_0xf82291[_0xddd8('0x87')],_0xf82291['cause']);}else if(this[_0xddd8('0x14')][_0xf82291[_0xddd8('0x87')]][_0xddd8('0x48')]){logger['info'](_0xddd8('0x131'),_0xf82291[_0xddd8('0x87')],_0xf82291['cause'],_0xddd8('0x90'),_0x184769['name'],_0xddd8('0xa1'),_0x184769[_0xddd8('0x2f')]);this[_0xddd8('0x76')](_0xf82291,_0xf82291[_0xddd8('0x87')],_0xf82291[_0xddd8('0x130')]);}}};Preview[_0xddd8('0x42')][_0xddd8('0x1e')]=function(_0x2bf690){if(this[_0xddd8('0x14')][_0x2bf690[_0xddd8('0xd4')]]&&_0x2bf690['destlinkedid']!==_0x2bf690[_0xddd8('0x135')]){this[_0xddd8('0x76')](_0x2bf690,_0x2bf690[_0xddd8('0xd4')],_0x2bf690[_0xddd8('0xcb')]);}};Preview[_0xddd8('0x42')]['syncHangupRequest']=function(_0x5d630f){if(this[_0xddd8('0x14')][_0x5d630f[_0xddd8('0x87')]]&&_0x5d630f[_0xddd8('0x87')]!==_0x5d630f[_0xddd8('0x8f')]&&!this[_0xddd8('0x14')][_0x5d630f['linkedid']][_0xddd8('0x48')]){if(_0x5d630f['cause']==='1'){this['callProgressDetectingCustomer'](_0x5d630f,_0x5d630f[_0xddd8('0x87')],_0x5d630f[_0xddd8('0x130')]);}}};Preview[_0xddd8('0x42')][_0xddd8('0x136')]=function(_0x44bcba,_0x3a443d,_0x4335d1){if(this['actions'][_0x44bcba]){if(_[_0xddd8('0x44')](this[_0xddd8('0x14')][_0x44bcba][_0xddd8('0x120')])){this[_0xddd8('0x14')][_0x44bcba]['variables']={};}this[_0xddd8('0x14')][_0x44bcba][_0xddd8('0x120')][_0x3a443d]=_0x4335d1;}};Preview[_0xddd8('0x42')][_0xddd8('0x21')]=function(_0xbdfe7f){try{if(!_[_0xddd8('0x44')](_0xbdfe7f)){if(ut[_0xddd8('0x137')](_[_0xddd8('0x138')](_0xbdfe7f[_0xddd8('0x139')])[0x0])){this['addVariable'](_0xbdfe7f[_0xddd8('0x8f')],_[_0xddd8('0x138')](_0xbdfe7f[_0xddd8('0x139')])[0x0],_0xbdfe7f[_0xddd8('0x13a')]);}}}catch(_0x5d7f2c){logger[_0xddd8('0x13b')]('[syncVarSet][Preview]',util['inspect'](_0x5d7f2c,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xddd8('0x22')]=function(_0x54c38a){if(_0x54c38a){if(this['actions'][_0x54c38a['transfertargetlinkedid']]){this[_0xddd8('0x14')][_0x54c38a['transfertargetlinkedid']][_0xddd8('0x134')]=!![];}}};Preview[_0xddd8('0x42')]['syncBlindTransfer']=function(_0xc044d2){if(_0xc044d2){if(this[_0xddd8('0x14')][_0xc044d2[_0xddd8('0x13c')]]){this[_0xddd8('0x14')][_0xc044d2[_0xddd8('0x13c')]][_0xddd8('0x134')]=!![];}}};module[_0xddd8('0x13d')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5b8e1c4..e93ed3a 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 _0x613b=['rescheduleContact','[rescheduleContactInQueue]\x20','util','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','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','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','membername','COMPLETED','getContactRecallMe','rescheduleContactInQueue'];(function(_0x507f38,_0x542216){var _0x59f8cb=function(_0x1d4e9c){while(--_0x1d4e9c){_0x507f38['push'](_0x507f38['shift']());}};_0x59f8cb(++_0x542216);}(_0x613b,0xd6));var _0xb613=function(_0x1b753c,_0x59fe55){_0x1b753c=_0x1b753c-0x0;var _0x4b2078=_0x613b[_0x1b753c];return _0x4b2078;};'use strict';var util=require(_0xb613('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xb613('0x1'));var cmHopper=require(_0xb613('0x2'));var cmHopperHistory=require(_0xb613('0x3'));var cmHopperBlack=require(_0xb613('0x4'));var agentReportPreview=require(_0xb613('0x5'));var voiceQueueReport=require(_0xb613('0x6'));function loggerCatch(_0x19548f){return function(_0x3d58e8){logger['error'](_0x19548f,util[_0xb613('0x7')](_0x3d58e8,{'showHidden':![],'depth':null}));};}function create(_0x24329e){return cmHopperHistory[_0xb613('0x8')](_0x24329e)['catch'](loggerCatch(_0xb613('0x9')));}function createAgent(_0x15ca8a){return BPromise[_0xb613('0xa')]()[_0xb613('0xb')](agentReportPreview[_0xb613('0x8')](_0x15ca8a))[_0xb613('0xc')](loggerCatch(_0xb613('0x9')));}function moveContact(_0x52691d){return cmHopper[_0xb613('0xd')](_0x52691d,!![])[_0xb613('0xc')](loggerCatch(_0xb613('0xe')));}exports[_0xb613('0xf')]=function(_0x51036d){return cmHopperBlack[_0xb613('0xf')](_0x51036d)[_0xb613('0xc')](loggerCatch(_0xb613('0x10')));};exports[_0xb613('0x11')]=function(_0x8ff7ab){return BPromise[_0xb613('0xa')]()[_0xb613('0xb')](cmHopper[_0xb613('0x11')](_0x8ff7ab))[_0xb613('0xc')](loggerCatch(_0xb613('0x12')));};exports[_0xb613('0x8')]=function(_0x34aa44,_0x15b0f7){create(_0x34aa44)[_0xb613('0xc')](loggerCatch(_0x15b0f7));moveContact(_0x34aa44)['catch'](loggerCatch(_0x15b0f7));};exports[_0xb613('0x13')]=function(_0x4dd25d,_0x35cfcd){createAgent(_0x4dd25d)[_0xb613('0xc')](loggerCatch(_0x35cfcd));};exports['createCustomerHistory']=function(_0x5e49ae,_0x3b7900){create(_0x5e49ae)[_0xb613('0xc')](loggerCatch(_0x3b7900));};exports[_0xb613('0x14')]=function(_0x5b7ceb,_0x245319){moveContact(_0x5b7ceb)[_0xb613('0xc')](loggerCatch(_0x245319));};exports['rescheduleContact']=function(_0x2c4a7f,_0x299358,_0xa1863a){if(_0x299358){_0x2c4a7f[_0xb613('0x15')]=null;}if(_0xa1863a){_0x2c4a7f[_0xb613('0x16')]=![];}return cmHopper['rescheduleContact'](_0x2c4a7f)[_0xb613('0xc')](loggerCatch(_0xb613('0x17')));};exports[_0xb613('0x18')]=function(_0x2eb6fe){return cmHopper[_0xb613('0x18')](_0x2eb6fe)[_0xb613('0xc')](loggerCatch(_0xb613('0x19')));};exports['unlockContact']=function(_0x269fd4){return cmHopper[_0xb613('0x1a')]({'UserId':null},_0x269fd4,0x1)[_0xb613('0xc')](loggerCatch(_0xb613('0x1b')));};exports[_0xb613('0x1c')]=function(_0xa5bcde){return cmHopper[_0xb613('0x1a')]({'active':![]},_0xa5bcde,0x1)[_0xb613('0xc')](loggerCatch(_0xb613('0x1d')));};exports[_0xb613('0x1e')]=function(_0x4f6dcc){var _0x2b48ea={};_0x2b48ea['type']=_0x4f6dcc[_0xb613('0x1f')];_0x2b48ea['uniqueid']=_0x4f6dcc[_0xb613('0x20')];_0x2b48ea[_0xb613('0x21')]=_0x4f6dcc['calleridnum'];_0x2b48ea[_0xb613('0x22')]=_0x4f6dcc[_0xb613('0x22')];_0x2b48ea[_0xb613('0x23')]=_0x4f6dcc[_0xb613('0x23')];_0x2b48ea[_0xb613('0x24')]=_0x4f6dcc[_0xb613('0x25')];_0x2b48ea['queuecallerleaveAt']=_0x4f6dcc[_0xb613('0x25')];_0x2b48ea[_0xb613('0x26')]=0x1;_0x2b48ea[_0xb613('0x27')]=_0x4f6dcc[_0xb613('0x28')];_0x2b48ea[_0xb613('0x29')]=_0x4f6dcc['membername'];_0x2b48ea['context']=_0xb613('0x2a');_0x2b48ea[_0xb613('0x2b')]=_0xb613('0x2c');_0x2b48ea[_0xb613('0x2d')]=0x0;_0x2b48ea['assigned']=0x1;_0x2b48ea[_0xb613('0x2e')]=_0x4f6dcc[_0xb613('0x2f')];_0x2b48ea['queuecallerexitreason']=_0xb613('0x30');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x2b48ea))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xb613('0x31')]=function(_0x5827dd,_0x2bfa12){return BPromise[_0xb613('0xa')]()['then'](cmHopper[_0xb613('0x31')](_0x5827dd,_0x2bfa12))[_0xb613('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xb613('0x32')]=function(_0x49d816){return cmHopper[_0xb613('0x33')](_0x49d816,!![],!![])[_0xb613('0xc')](loggerCatch(_0xb613('0x34')));}; \ No newline at end of file +var _0xbff7=['unlockContact','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','[createHistory]\x20','resolve','then','createHistory','catch','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbff7,0x1ad));var _0x7bff=function(_0x4223ab,_0x4778bc){_0x4223ab=_0x4223ab-0x0;var _0x30d94c=_0xbff7[_0x4223ab];return _0x30d94c;};'use strict';var util=require(_0x7bff('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var cmHopper=require(_0x7bff('0x1'));var cmHopperHistory=require(_0x7bff('0x2'));var cmHopperBlack=require(_0x7bff('0x3'));var agentReportPreview=require(_0x7bff('0x4'));var voiceQueueReport=require(_0x7bff('0x5'));function loggerCatch(_0x504619){return function(_0xf10a01){logger['error'](_0x504619,util['inspect'](_0xf10a01,{'showHidden':![],'depth':null}));};}function create(_0x498d76){return cmHopperHistory['createHistory'](_0x498d76)['catch'](loggerCatch(_0x7bff('0x6')));}function createAgent(_0x48cd61){return BPromise[_0x7bff('0x7')]()[_0x7bff('0x8')](agentReportPreview[_0x7bff('0x9')](_0x48cd61))[_0x7bff('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x52e550){return cmHopper[_0x7bff('0xb')](_0x52e550,!![])[_0x7bff('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x7bff('0xc')]=function(_0x27bbd5){return cmHopperBlack[_0x7bff('0xc')](_0x27bbd5)[_0x7bff('0xa')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x7bff('0xd')]=function(_0x12c256){return BPromise[_0x7bff('0x7')]()[_0x7bff('0x8')](cmHopper[_0x7bff('0xd')](_0x12c256))['catch'](loggerCatch(_0x7bff('0xe')));};exports['createHistory']=function(_0x1572a4,_0xc3ae53){create(_0x1572a4)[_0x7bff('0xa')](loggerCatch(_0xc3ae53));moveContact(_0x1572a4)['catch'](loggerCatch(_0xc3ae53));};exports['createAgentHistory']=function(_0x4568c2,_0x470e75){createAgent(_0x4568c2)[_0x7bff('0xa')](loggerCatch(_0x470e75));};exports['createCustomerHistory']=function(_0x48d458,_0x7a794d){create(_0x48d458)[_0x7bff('0xa')](loggerCatch(_0x7a794d));};exports[_0x7bff('0xf')]=function(_0x5a2011,_0x939671){moveContact(_0x5a2011)['catch'](loggerCatch(_0x939671));};exports[_0x7bff('0x10')]=function(_0x49e2a8,_0x4fabbd,_0x27bee2){if(_0x4fabbd){_0x49e2a8[_0x7bff('0x11')]=null;}if(_0x27bee2){_0x49e2a8[_0x7bff('0x12')]=![];}return cmHopper['rescheduleContact'](_0x49e2a8)['catch'](loggerCatch(_0x7bff('0x13')));};exports[_0x7bff('0x14')]=function(_0x1c709){return cmHopper[_0x7bff('0x14')](_0x1c709)[_0x7bff('0xa')](loggerCatch('[countReScheduled]\x20'));};exports[_0x7bff('0x15')]=function(_0xe00dbb){return cmHopper[_0x7bff('0x15')]({'UserId':null},_0xe00dbb,0x1)[_0x7bff('0xa')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x1af801){return cmHopper[_0x7bff('0x15')]({'active':![]},_0x1af801,0x1)['catch'](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x352ac4){var _0x462a6b={};_0x462a6b[_0x7bff('0x16')]=_0x352ac4[_0x7bff('0x16')];_0x462a6b[_0x7bff('0x17')]=_0x352ac4[_0x7bff('0x17')];_0x462a6b[_0x7bff('0x18')]=_0x352ac4[_0x7bff('0x18')];_0x462a6b[_0x7bff('0x19')]=_0x352ac4[_0x7bff('0x19')];_0x462a6b['queue']=_0x352ac4['queue'];_0x462a6b[_0x7bff('0x1a')]=_0x352ac4[_0x7bff('0x1b')];_0x462a6b[_0x7bff('0x1c')]=_0x352ac4[_0x7bff('0x1b')];_0x462a6b[_0x7bff('0x1d')]=0x1;_0x462a6b[_0x7bff('0x1e')]=_0x352ac4['endtime'];_0x462a6b[_0x7bff('0x1f')]=_0x352ac4[_0x7bff('0x20')];_0x462a6b[_0x7bff('0x21')]='from-sip';_0x462a6b[_0x7bff('0x22')]=_0x7bff('0x23');_0x462a6b[_0x7bff('0x24')]=0x0;_0x462a6b[_0x7bff('0x25')]=0x1;_0x462a6b[_0x7bff('0x26')]=_0x352ac4[_0x7bff('0x20')];_0x462a6b[_0x7bff('0x27')]=_0x7bff('0x28');return BPromise[_0x7bff('0x7')]()[_0x7bff('0x8')](voiceQueueReport[_0x7bff('0x29')](_0x462a6b))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x7bff('0x2a')]=function(_0x4d73f4,_0x112118){return BPromise[_0x7bff('0x7')]()[_0x7bff('0x8')](cmHopper[_0x7bff('0x2a')](_0x4d73f4,_0x112118))[_0x7bff('0xa')](loggerCatch(_0x7bff('0x2b')));};exports[_0x7bff('0x2c')]=function(_0x1ff253){return cmHopper[_0x7bff('0x10')](_0x1ff253,!![],!![])[_0x7bff('0xa')](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 7629a26..3555b88 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 _0xd303=['extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','error','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','Queue','name','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','endtime','responsetime','ringtime','getSeconds','logLookAgent','membername','starttime','talktime','answertime','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','createBody','CampaignId','idContact','campaigntype','dialAnswer','countglobal','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','random'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0xd303,0x95));var _0x3d30=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0xd303[_0x2c3a8f];return _0x189412;};'use strict';var util=require(_0x3d30('0x0'));var _=require('lodash');var moment=require(_0x3d30('0x1'));var logger=require(_0x3d30('0x2'))(_0x3d30('0x3'));var ipAgi=process[_0x3d30('0x4')][_0x3d30('0x5')]||_0x3d30('0x6');var utils=require(_0x3d30('0x7'));exports[_0x3d30('0x8')]=function(_0x16ae73){return function(_0x2d6299){logger['error'](_0x16ae73,util[_0x3d30('0x9')](_0x2d6299,{'showHidden':![],'depth':null}));};};exports[_0x3d30('0xa')]=function(_0x162370,_0xcb1f61){logger[_0x3d30('0xb')](_0x162370,util[_0x3d30('0x9')](_0xcb1f61,{'showHidden':![],'depth':null}));};exports[_0x3d30('0xc')]=function(_0x575549,_0x26a1ea){logger[_0x3d30('0xd')](_0x575549,util[_0x3d30('0x9')](_0x26a1ea,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1f9171){return function(_0x1be48a){logger[_0x3d30('0xb')](_0x1f9171,util[_0x3d30('0x9')](_0x1be48a,{'showHidden':![],'depth':null}));};};exports[_0x3d30('0xe')]=function(_0x1b754e,_0x322eb1,_0x4de26b){return{'message':_0x1b754e,'unlock':_0x322eb1,'active':_0x4de26b};};exports['getCallerId']=function(_0x270eae,_0x30221e,_0x5a0cb4){if(!_[_0x3d30('0xf')](_0x5a0cb4)&&_0x3d30('0x10')===typeof _0x5a0cb4&&!_[_0x3d30('0x11')](_0x5a0cb4)){if(!_[_0x3d30('0xf')](_0x30221e)&&_0x3d30('0x10')===typeof _0x30221e&&!_[_0x3d30('0x11')](_0x30221e)){return util[_0x3d30('0x12')](_0x3d30('0x13'),_0x30221e,_0x5a0cb4);}return util['format']('\x22%s\x22\x20<%s>',_0x5a0cb4,_0x5a0cb4);}if(!_['isUndefined'](_0x270eae)&&_0x3d30('0x10')===typeof _0x270eae&&!_[_0x3d30('0x11')](_0x270eae)){return _0x270eae;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x5a03d8){if(_['isNil'](_0x5a03d8)){return![];}return _0x5a03d8;};exports['addVariables']=function(_0x3225df,_0x393512,_0xa427fe,_0x4d7a70,_0x2cba08,_0x5921de){var _0x195e87={'XMD-QUEUE':_0x393512['Queue']?_0x393512[_0x3d30('0x14')][_0x3d30('0x15')]:'','XMD-CALLERID':_0x4d7a70,'XMD-CALLERID-PREVIEW':_0x5921de?util[_0x3d30('0x12')](_0x3d30('0x13'),_0x5921de[_0x3d30('0x16')],_0x5921de[_0x3d30('0x17')]):_0x4d7a70,'XMD-DIALID':_0x2cba08,'XMD-CONTACTID':_0x393512[_0x3d30('0x18')],'XMD-CDRTYPE':_0x3d30('0x19'),'CALLERID(all)':_0x4d7a70,'XMD-VOICEQUEUEID':_0x393512['VoiceQueueId'],'XMD-DIALCHANNEL':_0xa427fe,'XMD-DIALTIMEOUT':_0x3225df['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x3d30('0x1a'),_0x3225df['dialQueueProject2']?'g':'',_['isEmpty'](_0x3225df[_0x3d30('0x1b')])?'':_0x3d30('0x1c')),'XMD-DIALURL':_0x3225df['dialPreviewUrl']||'','XMD-AGI':_0x3225df[_0x3d30('0x1d')]?util[_0x3d30('0x12')](_0x3d30('0x1e'),ipAgi,_0x3225df['dialQueueProject']):_0x3d30('0x1f'),'XMD-AGIAFTER':_0x3225df['dialQueueProject2']?util[_0x3d30('0x12')](_0x3d30('0x1e'),ipAgi,_0x3225df[_0x3d30('0x20')]):_0x3d30('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x5921de?_0x5921de[_0x3d30('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x5921de?_0x5921de[_0x3d30('0x22')]:'','XMD-DESTINATION':_0x3d30('0x23'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x3225df[_0x3d30('0x1b')])){_0x195e87[util['format']('%s',_0x3d30('0x24'))]=_0x3225df[_0x3d30('0x1b')];_0x195e87[util['format']('%s',_0x3d30('0x25'))]=_0x2cba08;}return _0x195e87;};exports[_0x3d30('0x26')]=function(_0x30b66){var _0x30cce0={};for(var _0x1bc1c2 in _0x30b66){if(_0x30b66[_0x3d30('0x27')](_0x1bc1c2)){_0x30cce0[util['format']('%s',_[_0x3d30('0x28')](_0x1bc1c2))]=_0x30b66[_0x1bc1c2];}}return{'variables':_0x30cce0};};exports['updateOriginated']=function(_0x43ea2b,_0x487951){if(!_[_0x3d30('0x29')](_0x43ea2b)){if(_0x43ea2b['hasOwnProperty'](_0x3d30('0x2a'))){if(_0x43ea2b[_0x3d30('0x2a')]>0x0){_0x43ea2b[_0x3d30('0x2a')]-=0x1;}else{logger[_0x3d30('0xd')](_0x3d30('0x2b'),_0x487951);}}}else{logger[_0x3d30('0xd')](_0x3d30('0x2c'),_0x487951);}};exports[_0x3d30('0x2d')]=function(_0x584ee4){var _0x2c7215=moment()[_0x3d30('0x12')](_0x3d30('0x2e'));_0x584ee4[_0x3d30('0x2f')]=0xd;_0x584ee4[_0x3d30('0x30')]=_0x3d30('0x31');_0x584ee4['starttime']=_0x2c7215;_0x584ee4['responsetime']=_0x2c7215;_0x584ee4[_0x3d30('0x32')]=_0x2c7215;};exports['logAgent']=function(_0x192b3d,_0x296a15,_0x36d4a0){var _0x1f7d68=moment()[_0x3d30('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x192b3d[_0x3d30('0x2f')]=_0x296a15;_0x192b3d[_0x3d30('0x30')]=_0x36d4a0;_0x192b3d[_0x3d30('0x33')]=_0x1f7d68;_0x192b3d[_0x3d30('0x34')]=utils[_0x3d30('0x35')](_0x192b3d[_0x3d30('0x33')],_0x192b3d['starttime']);};exports[_0x3d30('0x36')]=function(_0x4f0568,_0x39ee55,_0xdb86e7){_0x4f0568[_0x3d30('0x37')]=_0x39ee55;_0x4f0568['UserId']=_0xdb86e7;};exports['logCustomer']=function(_0x52f1f6,_0x2eb2bd,_0x5be6f1){var _0x588c3c=moment()[_0x3d30('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x52f1f6['state']=_0x2eb2bd;_0x52f1f6[_0x3d30('0x30')]=_0x5be6f1;_0x52f1f6[_0x3d30('0x33')]=_0x52f1f6[_0x3d30('0x33')]?_0x52f1f6[_0x3d30('0x33')]:_0x588c3c;_0x52f1f6[_0x3d30('0x32')]=_0x52f1f6[_0x3d30('0x32')]?_0x52f1f6[_0x3d30('0x32')]:_0x588c3c;_0x52f1f6[_0x3d30('0x34')]=utils[_0x3d30('0x35')](_0x52f1f6[_0x3d30('0x33')]||0x0,_0x52f1f6[_0x3d30('0x38')]||0x0);_0x52f1f6[_0x3d30('0x39')]=_0x52f1f6[_0x3d30('0x3a')]?utils[_0x3d30('0x35')](_0x52f1f6[_0x3d30('0x32')],_0x52f1f6['answertime']):0x0;};exports['isFailure']=function(_0x1d3a6a){return _0x1d3a6a==='Failure';};exports[_0x3d30('0x3b')]=function(_0x17042f,_0x36ec4c,_0x12a506,_0x487943,_0xb4612e){var _0x2bdbbc=_0x487943?_0x3d30('0x3c'):_0x17042f[_0x3d30('0x16')];_0x2bdbbc=_0xb4612e?'BOOKED':_0x2bdbbc;return{'actionid':_0x17042f[_0x3d30('0x3d')],'action':_0x3d30('0x3e'),'channel':_0x17042f[_0x3d30('0x3f')],'callerid':util[_0x3d30('0x12')](_0x3d30('0x13'),_0x2bdbbc,_0x17042f[_0x3d30('0x17')]),'Exten':_0x3d30('0x23'),'Context':_0x3d30('0x40'),'Priority':'1','variable':_0x12a506,'timeout':(_0x36ec4c['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x17042f[_0x3d30('0x3d')]};};exports[_0x3d30('0x41')]=function(_0x643515){return _0x643515[_0x3d30('0x42')]+_0x643515[_0x3d30('0x43')]+_0x643515[_0x3d30('0x44')]+_0x643515[_0x3d30('0x45')]+_0x643515['countnosuchnumberretry'];};exports[_0x3d30('0x46')]=function(_0x2f4de0){var _0x45c535=_[_0x3d30('0x47')](_0x2f4de0);_0x45c535[_0x3d30('0x2f')]=0xf;_0x45c535[_0x3d30('0x30')]=_0x3d30('0x48');return _0x45c535;};exports[_0x3d30('0x49')]=function(_0x4ecac6,_0x546211,_0xd7548c){var _0x1905bb={};_0x1905bb[_0x546211]=_0x4ecac6[_0x546211];_0x1905bb[_0x3d30('0x4a')]=![];_0x1905bb[_0x3d30('0x4b')]=moment()['add'](_0xd7548c,_0x3d30('0x4c'))[_0x3d30('0x12')](_0x3d30('0x2e'));_0x1905bb[_0x3d30('0x18')]=_0x4ecac6['ContactId'];_0x1905bb[_0x3d30('0x4d')]=_0x4ecac6[_0x3d30('0x4d')];_0x1905bb[_0x3d30('0x4e')]=_0x4ecac6['VoiceQueueId']||undefined;return _0x1905bb;};exports['decrementTalkink']=function(_0x4fcedd,_0x201a31){if(!_[_0x3d30('0x29')](_0x4fcedd)){if(_0x4fcedd['pTalking']>0x0){_0x4fcedd[_0x3d30('0x4f')]-=0x1;}else{logger[_0x3d30('0xd')](_0x201a31,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x3d30('0xd')](_0x201a31,_0x3d30('0x50'));}};exports[_0x3d30('0x51')]=function(_0x4607ff){if(_0x4607ff<=0x0){return!![];}return![];};function buildObj(_0x3a0dcb,_0x4dfc5c,_0x2b883b){_0x3a0dcb[_0x3d30('0x52')]=_0x4dfc5c;_0x3a0dcb[_0x3d30('0x15')]=_0x3a0dcb[_0x3d30('0x53')];_0x3a0dcb[_0x3d30('0x54')]=_0x3a0dcb[_0x3d30('0x3f')];_0x3a0dcb[_0x3d30('0x55')]=_0x3d30('0x56');if(_0x2b883b){_0x3a0dcb[_0x3d30('0x57')]=_0x2b883b[_0x3d30('0x57')];}return _0x3a0dcb;}exports[_0x3d30('0x58')]=buildObj;exports[_0x3d30('0x59')]=function(_0x4229b7){var _0x321d43={};_0x321d43[_0x3d30('0x53')]=_0x4229b7['queue'];_0x321d43[_0x3d30('0x54')]=_0x4229b7[_0x3d30('0x3f')];_0x321d43[_0x3d30('0x3d')]=_0x4229b7[_0x3d30('0x3d')];return _0x321d43;};exports[_0x3d30('0x5a')]=function(_0x3e215c){var _0xc59b15=[];for(var _0x4e86dd in _0x3e215c){if(_0x3e215c['hasOwnProperty'](_0x4e86dd)){if(!_['isNil'](_0x3e215c[_0x4e86dd])&&_0x3e215c[_0x4e86dd][_0x3d30('0x2f')]===_0x3d30('0x5b')&&_0x3e215c[_0x4e86dd]['status']===_0x3d30('0x5c')){_0xc59b15[_0x3d30('0x5d')](_0x3e215c[_0x4e86dd]['id']);}}}return _0xc59b15;};exports[_0x3d30('0x5e')]=function(_0x1d93af){var _0x466f14=moment()[_0x3d30('0x5f')](0x0);var _0xf69c99=moment(_0x1d93af)[_0x3d30('0x5f')](0x0);return _0x466f14['diff'](_0xf69c99,'seconds');};exports[_0x3d30('0x60')]=function(_0x3fdb54){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fdb54[_0x3d30('0x18')],'ListId':_0x3fdb54[_0x3d30('0x4d')],'VoiceQueueId':_0x3fdb54['VoiceQueueId']||undefined,'CampaignId':_0x3fdb54[_0x3d30('0x61')]||undefined};};exports['filterKey']=function(_0x5bb942){if(_0x5bb942===_0x3d30('0x3d')||_0x5bb942===_0x3d30('0x62')||_0x5bb942===_0x3d30('0x53')||_0x5bb942==='type'||_0x5bb942===_0x3d30('0x63')||_0x5bb942===_0x3d30('0x64')||_0x5bb942===_0x3d30('0x37')||_0x5bb942===_0x3d30('0x3f')||_0x5bb942==='calleridname'||_0x5bb942===_0x3d30('0x4a')||_0x5bb942===_0x3d30('0x17')||_0x5bb942===_0x3d30('0x4b')||_0x5bb942===_0x3d30('0x42')||_0x5bb942===_0x3d30('0x43')||_0x5bb942===_0x3d30('0x44')||_0x5bb942===_0x3d30('0x65')||_0x5bb942==='callback'||_0x5bb942===_0x3d30('0x66')||_0x5bb942===_0x3d30('0x67')||_0x5bb942===_0x3d30('0x68')||_0x5bb942===_0x3d30('0x18')||_0x5bb942==='ListId'||_0x5bb942===_0x3d30('0x69')||_0x5bb942===_0x3d30('0x4e')||_0x5bb942===_0x3d30('0x6a')||_0x5bb942===_0x3d30('0x6b')||_0x5bb942===_0x3d30('0x6c')||_0x5bb942===_0x3d30('0x6d')||_0x5bb942===_0x3d30('0x6e')||_0x5bb942===_0x3d30('0x6f')||_0x5bb942===_0x3d30('0x70')||_0x5bb942===_0x3d30('0x71')||_0x5bb942==='xmd-dialid'||_0x5bb942==='xmd-dialchannel'||_0x5bb942===_0x3d30('0x72')||_0x5bb942===_0x3d30('0x73')||_0x5bb942===_0x3d30('0x74')||_0x5bb942==='xmd-agiafter'||_0x5bb942===_0x3d30('0x75')||_0x5bb942===_0x3d30('0x76')||_0x5bb942===_0x3d30('0x77')||_0x5bb942===_0x3d30('0x78')||_0x5bb942===_0x3d30('0x79')||_0x5bb942===_0x3d30('0x7a')||_0x5bb942===_0x3d30('0x7b')||_0x5bb942===_0x3d30('0x7c')||_0x5bb942==='rtpaudioqosrttbridged'||_0x5bb942===_0x3d30('0x76')||_0x5bb942===_0x3d30('0x77')||_0x5bb942===_0x3d30('0x78')||_0x5bb942===_0x3d30('0x79')||_0x5bb942===_0x3d30('0x7a')||_0x5bb942==='rtpaudioqoslossbridged'||_0x5bb942===_0x3d30('0x7c')||_0x5bb942===_0x3d30('0x7d')||_0x5bb942===_0x3d30('0x7e')||_0x5bb942===_0x3d30('0x7f')||_0x5bb942===_0x3d30('0x2f')||_0x5bb942===_0x3d30('0x30')){return![];}return!![];};exports[_0x3d30('0x80')]=function(_0x392f7c,_0x32e293){var _0x3e6473,_0x51dcfb,_0x5bfde1;if(_0x32e293<=0x0){_0x32e293=0x1;}_0x3e6473=new RegExp(_0x3d30('0x81')+_0x32e293+'}$');_0x51dcfb=Math['pow'](0xa,_0x32e293-0x1);_0x5bfde1=Math['pow'](0xa,_0x32e293)-0x1;return util[_0x3d30('0x12')]('%s',_['replace'](_0x392f7c,_0x3e6473,_[_0x3d30('0x82')](_0x51dcfb,_0x5bfde1)));};exports[_0x3d30('0x83')]=function(_0x46daa0){var _0x58fcc0=_0x46daa0[_0x3d30('0x84')](/"(.*?)"/);return _0x58fcc0?_0x58fcc0[0x1]:_0x46daa0;};exports[_0x3d30('0x85')]=function(_0x32762a){var _0x56447b=_0x32762a[_0x3d30('0x84')](/<(.*?)>/);return _0x56447b?_0x56447b[0x1]:_0x32762a;};function buildNoAnswerEventPayload(_0x275add,_0x506341){var _0x288e46=buildObj(_0x275add,_0x3d30('0x86'));if(!_[_0x3d30('0x11')](_0x506341['variables'])){Object[_0x3d30('0x87')](_0x506341[_0x3d30('0x88')])[_0x3d30('0x89')](function(_0xd5f3bb){_0x288e46[_0xd5f3bb[_0x3d30('0x8a')]()]=_0x506341[_0x3d30('0x88')][_0xd5f3bb];});}return _0x288e46;}exports[_0x3d30('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xcfeb=['xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','responsetime','starttime','logLookAgent','membername','logCustomer','statedesc','talktime','answertime','isFailure','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','voice','mandatoryDisposition','buildAcw','queue','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype'];(function(_0x1633d2,_0x460044){var _0x518f28=function(_0x29b9fd){while(--_0x29b9fd){_0x1633d2['push'](_0x1633d2['shift']());}};_0x518f28(++_0x460044);}(_0xcfeb,0x12f));var _0xbcfe=function(_0x503f10,_0x506ac9){_0x503f10=_0x503f10-0x0;var _0x51e62a=_0xcfeb[_0x503f10];return _0x51e62a;};'use strict';var util=require(_0xbcfe('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xbcfe('0x1'))('preview');var ipAgi=process[_0xbcfe('0x2')][_0xbcfe('0x3')]||_0xbcfe('0x4');var utils=require(_0xbcfe('0x5'));exports[_0xbcfe('0x6')]=function(_0x6ac4d3){return function(_0x14567f){logger[_0xbcfe('0x7')](_0x6ac4d3,util[_0xbcfe('0x8')](_0x14567f,{'showHidden':![],'depth':null}));};};exports[_0xbcfe('0x9')]=function(_0x106d53,_0x1acbd6){logger[_0xbcfe('0xa')](_0x106d53,util[_0xbcfe('0x8')](_0x1acbd6,{'showHidden':![],'depth':null}));};exports[_0xbcfe('0xb')]=function(_0x5dc8f2,_0x11e16e){logger[_0xbcfe('0x7')](_0x5dc8f2,util[_0xbcfe('0x8')](_0x11e16e,{'showHidden':![],'depth':null}));};exports[_0xbcfe('0xc')]=function(_0x127aa0){return function(_0x5ae632){logger[_0xbcfe('0xa')](_0x127aa0,util[_0xbcfe('0x8')](_0x5ae632,{'showHidden':![],'depth':null}));};};exports[_0xbcfe('0xd')]=function(_0x12aa1b,_0x215700,_0x743154){return{'message':_0x12aa1b,'unlock':_0x215700,'active':_0x743154};};exports[_0xbcfe('0xe')]=function(_0x5af851,_0x4c4809,_0x41a2e1){if(!_[_0xbcfe('0xf')](_0x41a2e1)&&_0xbcfe('0x10')===typeof _0x41a2e1&&!_[_0xbcfe('0x11')](_0x41a2e1)){if(!_[_0xbcfe('0xf')](_0x4c4809)&&'string'===typeof _0x4c4809&&!_['isEmpty'](_0x4c4809)){return util[_0xbcfe('0x12')]('\x22%s\x22\x20<%s>',_0x4c4809,_0x41a2e1);}return util[_0xbcfe('0x12')](_0xbcfe('0x13'),_0x41a2e1,_0x41a2e1);}if(!_[_0xbcfe('0xf')](_0x5af851)&&_0xbcfe('0x10')===typeof _0x5af851&&!_[_0xbcfe('0x11')](_0x5af851)){return _0x5af851;}return _0xbcfe('0x14');};exports[_0xbcfe('0x15')]=function(_0xc849db){if(_[_0xbcfe('0x16')](_0xc849db)){return![];}return _0xc849db;};exports[_0xbcfe('0x17')]=function(_0x459a13,_0x376038,_0x41352a,_0x34b414,_0x5b92b0,_0x51547f){var _0x3eda0a={'XMD-QUEUE':_0x376038[_0xbcfe('0x18')]?_0x376038[_0xbcfe('0x18')][_0xbcfe('0x19')]:'','XMD-CALLERID':_0x34b414,'XMD-CALLERID-PREVIEW':_0x51547f?util[_0xbcfe('0x12')](_0xbcfe('0x13'),_0x51547f['calleridname'],_0x51547f['calleridnum']):_0x34b414,'XMD-DIALID':_0x5b92b0,'XMD-CONTACTID':_0x376038[_0xbcfe('0x1a')],'XMD-CDRTYPE':_0xbcfe('0x1b'),'CALLERID(all)':_0x34b414,'XMD-VOICEQUEUEID':_0x376038[_0xbcfe('0x1c')],'XMD-DIALCHANNEL':_0x41352a,'XMD-DIALTIMEOUT':_0x459a13[_0xbcfe('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xbcfe('0x12')]('\x22rtTxX%s%s\x22',_0x459a13[_0xbcfe('0x1e')]?'g':'',_[_0xbcfe('0x11')](_0x459a13['monitor_format'])?'':_0xbcfe('0x1f')),'XMD-DIALURL':_0x459a13['dialPreviewUrl']||'','XMD-AGI':_0x459a13['dialQueueProject']?util['format'](_0xbcfe('0x20'),ipAgi,_0x459a13['dialQueueProject']):_0xbcfe('0x21'),'XMD-AGIAFTER':_0x459a13[_0xbcfe('0x1e')]?util['format'](_0xbcfe('0x20'),ipAgi,_0x459a13[_0xbcfe('0x1e')]):_0xbcfe('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x51547f?_0x51547f[_0xbcfe('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x51547f?_0x51547f[_0xbcfe('0x23')]:'','XMD-DESTINATION':_0xbcfe('0x24'),'SIPADDHEADER':_0xbcfe('0x25')};if(!_['isEmpty'](_0x459a13['monitor_format'])){_0x3eda0a[util[_0xbcfe('0x12')]('%s',_0xbcfe('0x26'))]=_0x459a13[_0xbcfe('0x27')];_0x3eda0a[util[_0xbcfe('0x12')]('%s',_0xbcfe('0x28'))]=_0x5b92b0;}return _0x3eda0a;};exports[_0xbcfe('0x29')]=function(_0x334128){var _0x4ff856={};for(var _0x4e7b51 in _0x334128){if(_0x334128[_0xbcfe('0x2a')](_0x4e7b51)){_0x4ff856[util[_0xbcfe('0x12')]('%s',_['toLower'](_0x4e7b51))]=_0x334128[_0x4e7b51];}}return{'variables':_0x4ff856};};exports[_0xbcfe('0x2b')]=function(_0xb1370a,_0x2b4119){if(!_[_0xbcfe('0x16')](_0xb1370a)){if(_0xb1370a[_0xbcfe('0x2a')](_0xbcfe('0x2c'))){if(_0xb1370a[_0xbcfe('0x2c')]>0x0){_0xb1370a[_0xbcfe('0x2c')]-=0x1;}else{logger[_0xbcfe('0x7')](_0xbcfe('0x2d'),_0x2b4119);}}}else{logger[_0xbcfe('0x7')](_0xbcfe('0x2e'),_0x2b4119);}};exports[_0xbcfe('0x2f')]=function(_0x3be2a2){var _0x18e6f3=moment()[_0xbcfe('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x3be2a2[_0xbcfe('0x30')]=0xd;_0x3be2a2['statedesc']=_0xbcfe('0x31');_0x3be2a2['starttime']=_0x18e6f3;_0x3be2a2['responsetime']=_0x18e6f3;_0x3be2a2[_0xbcfe('0x32')]=_0x18e6f3;};exports[_0xbcfe('0x33')]=function(_0x5312d9,_0x4ee1c4,_0x37bca2){var _0x4db31c=moment()[_0xbcfe('0x12')](_0xbcfe('0x34'));_0x5312d9[_0xbcfe('0x30')]=_0x4ee1c4;_0x5312d9['statedesc']=_0x37bca2;_0x5312d9['responsetime']=_0x4db31c;_0x5312d9[_0xbcfe('0x35')]=utils[_0xbcfe('0x36')](_0x5312d9[_0xbcfe('0x37')],_0x5312d9[_0xbcfe('0x38')]);};exports[_0xbcfe('0x39')]=function(_0x12a4ab,_0x4e6f1a,_0x3f2160){_0x12a4ab[_0xbcfe('0x3a')]=_0x4e6f1a;_0x12a4ab['UserId']=_0x3f2160;};exports[_0xbcfe('0x3b')]=function(_0x2473bf,_0x75f479,_0x31fb3c){var _0xd524ef=moment()['format'](_0xbcfe('0x34'));_0x2473bf[_0xbcfe('0x30')]=_0x75f479;_0x2473bf[_0xbcfe('0x3c')]=_0x31fb3c;_0x2473bf[_0xbcfe('0x37')]=_0x2473bf['responsetime']?_0x2473bf[_0xbcfe('0x37')]:_0xd524ef;_0x2473bf[_0xbcfe('0x32')]=_0x2473bf[_0xbcfe('0x32')]?_0x2473bf[_0xbcfe('0x32')]:_0xd524ef;_0x2473bf['ringtime']=utils['getSeconds'](_0x2473bf['responsetime']||0x0,_0x2473bf[_0xbcfe('0x38')]||0x0);_0x2473bf[_0xbcfe('0x3d')]=_0x2473bf[_0xbcfe('0x3e')]?utils[_0xbcfe('0x36')](_0x2473bf[_0xbcfe('0x32')],_0x2473bf[_0xbcfe('0x3e')]):0x0;};exports[_0xbcfe('0x3f')]=function(_0x382364){return _0x382364==='Failure';};exports['variablesAction']=function(_0x48363a,_0x12b4b1,_0x4971a3,_0x1c110f,_0x316088){var _0x3aee79=_0x1c110f?_0xbcfe('0x40'):_0x48363a[_0xbcfe('0x41')];_0x3aee79=_0x316088?_0xbcfe('0x42'):_0x3aee79;return{'actionid':_0x48363a[_0xbcfe('0x43')],'action':_0xbcfe('0x44'),'channel':_0x48363a[_0xbcfe('0x45')],'callerid':util[_0xbcfe('0x12')](_0xbcfe('0x13'),_0x3aee79,_0x48363a[_0xbcfe('0x46')]),'Exten':_0xbcfe('0x24'),'Context':_0xbcfe('0x47'),'Priority':'1','variable':_0x4971a3,'timeout':(_0x12b4b1['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x48363a[_0xbcfe('0x43')]};};exports[_0xbcfe('0x48')]=function(_0xf17c2b){return _0xf17c2b['countbusyretry']+_0xf17c2b[_0xbcfe('0x49')]+_0xf17c2b[_0xbcfe('0x4a')]+_0xf17c2b[_0xbcfe('0x4b')]+_0xf17c2b[_0xbcfe('0x4c')];};exports[_0xbcfe('0x4d')]=function(_0x1c0608){var _0x8fedf9=_[_0xbcfe('0x4e')](_0x1c0608);_0x8fedf9[_0xbcfe('0x30')]=0xf;_0x8fedf9['statedesc']=_0xbcfe('0x4f');return _0x8fedf9;};exports['scheduledAt']=function(_0x386762,_0xb936b2,_0x331957){var _0x1c440f={};_0x1c440f[_0xb936b2]=_0x386762[_0xb936b2];_0x1c440f[_0xbcfe('0x50')]=![];_0x1c440f[_0xbcfe('0x51')]=moment()[_0xbcfe('0x52')](_0x331957,_0xbcfe('0x53'))['format'](_0xbcfe('0x34'));_0x1c440f[_0xbcfe('0x1a')]=_0x386762[_0xbcfe('0x1a')];_0x1c440f[_0xbcfe('0x54')]=_0x386762[_0xbcfe('0x54')];_0x1c440f['VoiceQueueId']=_0x386762[_0xbcfe('0x1c')]||undefined;return _0x1c440f;};exports[_0xbcfe('0x55')]=function(_0x468b62,_0x505472){if(!_[_0xbcfe('0x16')](_0x468b62)){if(_0x468b62[_0xbcfe('0x56')]>0x0){_0x468b62[_0xbcfe('0x56')]-=0x1;}else{logger[_0xbcfe('0x7')](_0x505472,_0xbcfe('0x57'));}}else{logger['error'](_0x505472,_0xbcfe('0x58'));}};exports[_0xbcfe('0x59')]=function(_0x573783){if(_0x573783<=0x0){return!![];}return![];};function buildObj(_0x4e273f,_0x4980a2,_0x34942d){_0x4e273f[_0xbcfe('0x5a')]=_0x4980a2;_0x4e273f['name']=_0x4e273f['queue'];_0x4e273f[_0xbcfe('0x5b')]=_0x4e273f[_0xbcfe('0x45')];_0x4e273f['motionChannel']=_0xbcfe('0x5c');if(_0x34942d){_0x4e273f[_0xbcfe('0x5d')]=_0x34942d[_0xbcfe('0x5d')];}return _0x4e273f;}exports['buildObj']=buildObj;exports[_0xbcfe('0x5e')]=function(_0x511b80){var _0x4f1946={};_0x4f1946[_0xbcfe('0x5f')]=_0x511b80[_0xbcfe('0x5f')];_0x4f1946['interface']=_0x511b80[_0xbcfe('0x45')];_0x4f1946[_0xbcfe('0x43')]=_0x511b80['uniqueid'];return _0x4f1946;};exports['agentReadyId']=function(_0x49d14b){var _0x237c16=[];for(var _0x63a990 in _0x49d14b){if(_0x49d14b['hasOwnProperty'](_0x63a990)){if(!_['isNil'](_0x49d14b[_0x63a990])&&_0x49d14b[_0x63a990][_0xbcfe('0x30')]==='not_inuse'&&_0x49d14b[_0x63a990]['status']===_0xbcfe('0x60')){_0x237c16[_0xbcfe('0x61')](_0x49d14b[_0x63a990]['id']);}}}return _0x237c16;};exports[_0xbcfe('0x62')]=function(_0x26aab1){var _0x295fcc=moment()[_0xbcfe('0x63')](0x0);var _0x31b56b=moment(_0x26aab1)['milliseconds'](0x0);return _0x295fcc[_0xbcfe('0x64')](_0x31b56b,'seconds');};exports[_0xbcfe('0x65')]=function(_0x227679){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x227679[_0xbcfe('0x1a')],'ListId':_0x227679['ListId'],'VoiceQueueId':_0x227679[_0xbcfe('0x1c')]||undefined,'CampaignId':_0x227679[_0xbcfe('0x66')]||undefined};};exports[_0xbcfe('0x67')]=function(_0xc9587d){if(_0xc9587d===_0xbcfe('0x43')||_0xc9587d===_0xbcfe('0x68')||_0xc9587d===_0xbcfe('0x5f')||_0xc9587d===_0xbcfe('0x69')||_0xc9587d===_0xbcfe('0x6a')||_0xc9587d===_0xbcfe('0x6b')||_0xc9587d===_0xbcfe('0x3a')||_0xc9587d===_0xbcfe('0x45')||_0xc9587d===_0xbcfe('0x41')||_0xc9587d===_0xbcfe('0x50')||_0xc9587d===_0xbcfe('0x46')||_0xc9587d===_0xbcfe('0x51')||_0xc9587d===_0xbcfe('0x6c')||_0xc9587d==='countcongestionretry'||_0xc9587d===_0xbcfe('0x4a')||_0xc9587d===_0xbcfe('0x6d')||_0xc9587d==='callback'||_0xc9587d==='callbackuniqueid'||_0xc9587d===_0xbcfe('0x6e')||_0xc9587d==='recallme'||_0xc9587d===_0xbcfe('0x1a')||_0xc9587d===_0xbcfe('0x54')||_0xc9587d==='UserId'||_0xc9587d===_0xbcfe('0x1c')||_0xc9587d==='sipcallid'||_0xc9587d===_0xbcfe('0x6f')||_0xc9587d===_0xbcfe('0x70')||_0xc9587d===_0xbcfe('0x71')||_0xc9587d===_0xbcfe('0x72')||_0xc9587d==='xmd-dialurl'||_0xc9587d===_0xbcfe('0x73')||_0xc9587d===_0xbcfe('0x74')||_0xc9587d===_0xbcfe('0x75')||_0xc9587d==='xmd-dialchannel'||_0xc9587d===_0xbcfe('0x76')||_0xc9587d===_0xbcfe('0x77')||_0xc9587d===_0xbcfe('0x78')||_0xc9587d==='xmd-agiafter'||_0xc9587d===_0xbcfe('0x79')||_0xc9587d===_0xbcfe('0x7a')||_0xc9587d===_0xbcfe('0x7b')||_0xc9587d===_0xbcfe('0x7c')||_0xc9587d===_0xbcfe('0x7d')||_0xc9587d===_0xbcfe('0x7e')||_0xc9587d===_0xbcfe('0x7f')||_0xc9587d==='rtpaudioqosrtt'||_0xc9587d==='rtpaudioqosrttbridged'||_0xc9587d===_0xbcfe('0x7a')||_0xc9587d==='rtpaudioqosbridged'||_0xc9587d===_0xbcfe('0x7c')||_0xc9587d===_0xbcfe('0x7d')||_0xc9587d===_0xbcfe('0x7e')||_0xc9587d===_0xbcfe('0x7f')||_0xc9587d===_0xbcfe('0x80')||_0xc9587d===_0xbcfe('0x81')||_0xc9587d==='bridgepeer'||_0xc9587d===_0xbcfe('0x82')||_0xc9587d===_0xbcfe('0x30')||_0xc9587d===_0xbcfe('0x3c')){return![];}return!![];};exports[_0xbcfe('0x83')]=function(_0x43dfd2,_0x436965){var _0x344e50,_0x54b318,_0x384bf6;if(_0x436965<=0x0){_0x436965=0x1;}_0x344e50=new RegExp(_0xbcfe('0x84')+_0x436965+'}$');_0x54b318=Math[_0xbcfe('0x85')](0xa,_0x436965-0x1);_0x384bf6=Math[_0xbcfe('0x85')](0xa,_0x436965)-0x1;return util['format']('%s',_[_0xbcfe('0x86')](_0x43dfd2,_0x344e50,_[_0xbcfe('0x87')](_0x54b318,_0x384bf6)));};exports['extractCalleridName']=function(_0x526a4b){var _0x1b4236=_0x526a4b['match'](/"(.*?)"/);return _0x1b4236?_0x1b4236[0x1]:_0x526a4b;};exports['extractCalleridNumber']=function(_0x2d6907){var _0x184b56=_0x2d6907['match'](/<(.*?)>/);return _0x184b56?_0x184b56[0x1]:_0x2d6907;};function buildNoAnswerEventPayload(_0x23fc68,_0x34a1e3){var _0x4181d8=buildObj(_0x23fc68,_0xbcfe('0x88'));if(!_[_0xbcfe('0x11')](_0x34a1e3[_0xbcfe('0x89')])){Object['keys'](_0x34a1e3[_0xbcfe('0x89')])[_0xbcfe('0x8a')](function(_0x100a52){_0x4181d8[_0x100a52[_0xbcfe('0x8b')]()]=_0x34a1e3[_0xbcfe('0x89')][_0x100a52];});}return _0x4181d8;}exports[_0xbcfe('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 507207f..d378909 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 _0xba37=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean'];(function(_0x8592c8,_0x4abba3){var _0x45e3d2=function(_0x4ea8ef){while(--_0x4ea8ef){_0x8592c8['push'](_0x8592c8['shift']());}};_0x45e3d2(++_0x4abba3);}(_0xba37,0x93));var _0x7ba3=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xba37[_0x36ed48];return _0x51c63a;};'use strict';exports['queueadd']={'queue':{'type':_0x7ba3('0x0'),'required':!![]},'interface':{'type':_0x7ba3('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x7ba3('0x1'),'required':![]},'paused':{'type':_0x7ba3('0x2'),'required':![]}};exports[_0x7ba3('0x3')]={'queue':{'type':_0x7ba3('0x0'),'required':!![]},'interface':{'type':_0x7ba3('0x0'),'required':!![]}};exports[_0x7ba3('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x7ba3('0x2')},'reason':{'type':_0x7ba3('0x0'),'required':![]}};exports[_0x7ba3('0x5')]={'module':{'type':_0x7ba3('0x0'),'required':![]}};exports[_0x7ba3('0x6')]={'uniqueid':{'type':_0x7ba3('0x0'),'required':!![]}};exports[_0x7ba3('0x7')]={'uniqueid':{'type':_0x7ba3('0x0'),'required':!![]},'filename':{'type':_0x7ba3('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0x7ba3('0x0')}};exports[_0x7ba3('0x8')]={'uniqueid':{'type':_0x7ba3('0x0'),'required':!![]}};exports[_0x7ba3('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x7ba3('0x0'),'required':!![]},'context':{'type':_0x7ba3('0x0')}}; \ No newline at end of file +var _0x2ca5=['voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queuepause','reload','voicechannel'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2ca5,0xca));var _0x52ca=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0x2ca5[_0x5e4b85];return _0x5cd3cb;};'use strict';exports['queueadd']={'queue':{'type':_0x52ca('0x0'),'required':!![]},'interface':{'type':_0x52ca('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x52ca('0x1'),'required':![]},'paused':{'type':_0x52ca('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x52ca('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x52ca('0x0'),'required':![]}};exports[_0x52ca('0x4')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x52ca('0x5')]={'uniqueid':{'type':_0x52ca('0x0'),'required':!![]},'filename':{'type':_0x52ca('0x0')},'format':{'type':_0x52ca('0x0')},'mixmonitorid':{'type':_0x52ca('0x0')}};exports[_0x52ca('0x6')]={'uniqueid':{'type':_0x52ca('0x0'),'required':!![]}};exports[_0x52ca('0x7')]={'uniqueid':{'type':_0x52ca('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 1162364..15fb993 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0x0b0e[_0x45aa72];return _0x75adaa;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file +var _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x5ece28,_0x1ef67a){var _0x21d125=function(_0x5b0b06){while(--_0x5b0b06){_0x5ece28['push'](_0x5ece28['shift']());}};_0x21d125(++_0x1ef67a);}(_0x757a,0xde));var _0xa757=function(_0x49c168,_0x4c8732){_0x49c168=_0x49c168-0x0;var _0x45a137=_0x757a[_0x49c168];return _0x45a137;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 36838c5..415728e 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 _0xd7d4=['assign','mergeDBDataToRealtime'];(function(_0x5d7139,_0x30dd9a){var _0x2d960a=function(_0x162ba5){while(--_0x162ba5){_0x5d7139['push'](_0x5d7139['shift']());}};_0x2d960a(++_0x30dd9a);}(_0xd7d4,0xe8));var _0x4d7d=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0xd7d4[_0x2f54b6];return _0x169f21;};'use strict';function mergeDBDataToRealtime(_0x41c91c,_0x28d824){var _0x3491f9=Object[_0x4d7d('0x0')]({},_0x41c91c);for(var _0x40376d in _0x28d824){if(_0x3491f9['hasOwnProperty'](_0x40376d)){_0x3491f9[_0x40376d]=_0x28d824[_0x40376d];}}return _0x3491f9;}exports[_0x4d7d('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x05a4=['mergeDBDataToRealtime','hasOwnProperty'];(function(_0x20f13a,_0x483593){var _0xa89dbb=function(_0x15bcbb){while(--_0x15bcbb){_0x20f13a['push'](_0x20f13a['shift']());}};_0xa89dbb(++_0x483593);}(_0x05a4,0xe7));var _0x405a=function(_0x5ddeff,_0x574bc3){_0x5ddeff=_0x5ddeff-0x0;var _0x17f808=_0x05a4[_0x5ddeff];return _0x17f808;};'use strict';function mergeDBDataToRealtime(_0x30319d,_0x49263c){var _0x5dd873=Object['assign']({},_0x30319d);for(var _0x17995a in _0x49263c){if(_0x5dd873[_0x405a('0x0')](_0x17995a)){_0x5dd873[_0x17995a]=_0x49263c[_0x17995a];}}return _0x5dd873;}exports[_0x405a('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 348b8d7..d13db84 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 _0xdd7c=['destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','membername','monitors','monitorFilename','filename','createdAt','connectedlinename','exten','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','isNil','accountcode','name','SIP/%s','length','connectedlinenum','assigned','interface','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','split','getAgentByInternal','outbound','internal','voiceCallReport','destination','type','lastdata','from-voip-provider','callerid','context','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum'];(function(_0x9b251e,_0x148914){var _0x2e4d35=function(_0x3d0b43){while(--_0x3d0b43){_0x9b251e['push'](_0x9b251e['shift']());}};_0x2e4d35(++_0x148914);}(_0xdd7c,0xd7));var _0xcdd7=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xdd7c[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0xcdd7('0x0'));var moment=require('moment');var util=require(_0xcdd7('0x1'));var config=require(_0xcdd7('0x2'));var ami=require(_0xcdd7('0x3'));var RpcVoiceAgentReport=require(_0xcdd7('0x4'));var RpcVoiceCallReport=require(_0xcdd7('0x5'));var RpcVoiceDialReport=require(_0xcdd7('0x6'));var RpcMemberReport=require(_0xcdd7('0x7'));var RpcVoiceQueueReport=require(_0xcdd7('0x8'));var RpcVoiceRecording=require(_0xcdd7('0x9'));var RpcVoiceTransferReport=require(_0xcdd7('0xa'));var VoiceQueueReport=require(_0xcdd7('0xb'));var VoiceCallReport=require(_0xcdd7('0xc'));var VoiceAgentReport=require(_0xcdd7('0xd'));var VoiceDialReport=require(_0xcdd7('0xe'));var UserReport=require(_0xcdd7('0xf'));function Report(_0x2139d9){this[_0xcdd7('0x10')]=_0x2139d9;this[_0xcdd7('0x11')]=_0x2139d9[_0xcdd7('0x11')];this[_0xcdd7('0x12')]=_0x2139d9['telephones'];}Report['prototype'][_0xcdd7('0x13')]=function(_0xf9a677){var _0x13749b=new VoiceQueueReport(this[_0xcdd7('0x10')]);var _0x318a05=new VoiceAgentReport(this[_0xcdd7('0x10')]);var _0x1f895d=new VoiceDialReport(this['realtime']);var _0x3d6a38=new VoiceCallReport(this['realtime']);var _0x373639=new UserReport(this['realtime']);if(config['xdr']&&config[_0xcdd7('0x14')][_0xcdd7('0x15')]){ami['on'](_0xcdd7('0x16'),this[_0xcdd7('0x17')]['bind'](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0xcdd7('0x18')](this));ami['on']('custom:voiceAgentReport',this[_0xcdd7('0x19')][_0xcdd7('0x18')](this));ami['on'](_0xcdd7('0x1a'),this[_0xcdd7('0x1b')][_0xcdd7('0x18')](this));ami['on'](_0xcdd7('0x1c'),this[_0xcdd7('0x1d')][_0xcdd7('0x18')](this));ami['on'](_0xcdd7('0x1e'),this[_0xcdd7('0x1f')][_0xcdd7('0x18')](this));}};Report[_0xcdd7('0x20')][_0xcdd7('0x21')]=function(_0x5b58fa){var _0xb05df;_0xb05df=_[_0xcdd7('0x22')](this[_0xcdd7('0x11')],function(_0x2e1940){return _0x2e1940['accountcode']==_0x5b58fa||_0x2e1940['name']==_0x5b58fa;});if(_[_0xcdd7('0x23')](_0xb05df)){var _0x45a63c=_[_0xcdd7('0x22')](this['telephones'],function(_0x2f80ba){return _0x2f80ba[_0xcdd7('0x24')]==_0x5b58fa||_0x2f80ba[_0xcdd7('0x25')]==_0x5b58fa;});if(_0x45a63c){_0xb05df=_[_0xcdd7('0x22')](this[_0xcdd7('0x11')],function(_0x141661){return _0x141661['interface']==util['format'](_0xcdd7('0x26'),_0x45a63c['name']);});}}return _0xb05df;};Report[_0xcdd7('0x20')][_0xcdd7('0x17')]=function(_0x1c0364){for(var _0x150813=0x0;_0x150813<_0x1c0364[_0xcdd7('0x27')];_0x150813+=0x1){var _0x505340=this[_0xcdd7('0x21')](_0x1c0364[_0x150813][_0xcdd7('0x28')]);if(_0x505340){_0x1c0364[_0x150813][_0xcdd7('0x24')]=_0x505340[_0xcdd7('0x24')];_0x1c0364[_0x150813][_0xcdd7('0x29')]=!![];_0x1c0364[_0x150813]['lastAssignedTo']=_0x505340[_0xcdd7('0x25')];_0x1c0364[_0x150813][_0xcdd7('0x2a')]=_[_0xcdd7('0x23')](_0x505340[_0xcdd7('0x2a')])?util['format'](_0xcdd7('0x26'),_0x505340[_0xcdd7('0x25')]):_0x505340[_0xcdd7('0x2a')];if(_0x1c0364[_0x150813][_0xcdd7('0x2b')]){_0x1c0364[_0x150813][_0xcdd7('0x2c')]=moment()[_0xcdd7('0x2d')](_0xcdd7('0x2e'));}if(_0x1c0364[_0x150813][_0xcdd7('0x2f')]){_0x1c0364[_0x150813][_0xcdd7('0x30')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xcdd7('0x17')](_0x1c0364[_0x150813]);}RpcVoiceQueueReport[_0xcdd7('0x31')](_0x1c0364[_0x150813]);}};function extractCalleridNumber(_0x293b4c){var _0x85569d=_0x293b4c[_0xcdd7('0x32')](/<(.*?)>/);return _0x85569d?_0x85569d[0x1]:_0x293b4c;}Report[_0xcdd7('0x20')]['getAgentByInternal']=function(_0x30405f){for(var _0x2f273d=0x0;_0x2f273d','calleridname','transfers','linkedid','transfereelinkedid','type','UserId','membername','monitor','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','startsWith','Local','substring','indexOf','mobile','phone','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','accountcode'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbe71,0xfa));var _0x1be7=function(_0x1c8f6d,_0x5c89b5){_0x1c8f6d=_0x1c8f6d-0x0;var _0x8a6b22=_0xbe71[_0x1c8f6d];return _0x8a6b22;};'use strict';var _=require(_0x1be7('0x0'));var moment=require(_0x1be7('0x1'));var util=require(_0x1be7('0x2'));var config=require(_0x1be7('0x3'));var ami=require(_0x1be7('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x1be7('0x5'));var RpcVoiceDialReport=require(_0x1be7('0x6'));var RpcMemberReport=require(_0x1be7('0x7'));var RpcVoiceQueueReport=require(_0x1be7('0x8'));var RpcVoiceRecording=require(_0x1be7('0x9'));var RpcVoiceTransferReport=require(_0x1be7('0xa'));var VoiceQueueReport=require(_0x1be7('0xb'));var VoiceCallReport=require(_0x1be7('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x1be7('0xd'));var UserReport=require(_0x1be7('0xe'));function Report(_0x211c5a){this[_0x1be7('0xf')]=_0x211c5a;this[_0x1be7('0x10')]=_0x211c5a['agents'];this[_0x1be7('0x11')]=_0x211c5a[_0x1be7('0x11')];}Report['prototype'][_0x1be7('0x12')]=function(_0x4786a6){var _0x724eb0=new VoiceQueueReport(this['realtime']);var _0x314afa=new VoiceAgentReport(this[_0x1be7('0xf')]);var _0x346eb9=new VoiceDialReport(this[_0x1be7('0xf')]);var _0xa4989d=new VoiceCallReport(this[_0x1be7('0xf')]);var _0x189aad=new UserReport(this[_0x1be7('0xf')]);if(config['xdr']&&config[_0x1be7('0x13')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on'](_0x1be7('0x14'),this[_0x1be7('0x15')][_0x1be7('0x16')](this));ami['on'](_0x1be7('0x17'),this[_0x1be7('0x18')]['bind'](this));ami['on'](_0x1be7('0x19'),this[_0x1be7('0x1a')][_0x1be7('0x16')](this));ami['on'](_0x1be7('0x1b'),this[_0x1be7('0x1c')][_0x1be7('0x16')](this));ami['on'](_0x1be7('0x1d'),this[_0x1be7('0x1e')][_0x1be7('0x16')](this));}};Report[_0x1be7('0x1f')][_0x1be7('0x20')]=function(_0x86edce){var _0x248ca9;_0x248ca9=_[_0x1be7('0x21')](this[_0x1be7('0x10')],function(_0x25f7c0){return _0x25f7c0['accountcode']==_0x86edce||_0x25f7c0['name']==_0x86edce;});if(_['isNil'](_0x248ca9)){var _0x50ed1a=_['find'](this[_0x1be7('0x11')],function(_0x518736){return _0x518736['accountcode']==_0x86edce||_0x518736[_0x1be7('0x22')]==_0x86edce;});if(_0x50ed1a){_0x248ca9=_[_0x1be7('0x21')](this[_0x1be7('0x10')],function(_0xbd5250){return _0xbd5250[_0x1be7('0x23')]==util['format'](_0x1be7('0x24'),_0x50ed1a[_0x1be7('0x22')]);});}}return _0x248ca9;};Report[_0x1be7('0x1f')][_0x1be7('0x25')]=function(_0x52d097){for(var _0x1340e6=0x0;_0x1340e6<_0x52d097[_0x1be7('0x26')];_0x1340e6+=0x1){var _0x18a3e1=this[_0x1be7('0x20')](_0x52d097[_0x1340e6][_0x1be7('0x27')]);if(_0x18a3e1){_0x52d097[_0x1340e6][_0x1be7('0x28')]=_0x18a3e1[_0x1be7('0x28')];_0x52d097[_0x1340e6][_0x1be7('0x29')]=!![];_0x52d097[_0x1340e6][_0x1be7('0x2a')]=_0x18a3e1[_0x1be7('0x22')];_0x52d097[_0x1340e6][_0x1be7('0x23')]=_[_0x1be7('0x2b')](_0x18a3e1[_0x1be7('0x23')])?util[_0x1be7('0x2c')](_0x1be7('0x24'),_0x18a3e1[_0x1be7('0x22')]):_0x18a3e1[_0x1be7('0x23')];if(_0x52d097[_0x1340e6]['queuecallercomplete']){_0x52d097[_0x1340e6][_0x1be7('0x2d')]=moment()[_0x1be7('0x2c')](_0x1be7('0x2e'));}if(_0x52d097[_0x1340e6][_0x1be7('0x2f')]){_0x52d097[_0x1340e6][_0x1be7('0x30')]=moment()['format'](_0x1be7('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x52d097[_0x1340e6]);}RpcVoiceQueueReport[_0x1be7('0x31')](_0x52d097[_0x1340e6]);}};function extractCalleridNumber(_0x3da809){var _0x3766f9=_0x3da809[_0x1be7('0x32')](/<(.*?)>/);return _0x3766f9?_0x3766f9[0x1]:_0x3da809;}Report[_0x1be7('0x1f')]['getAgentByInternal']=function(_0x2471b4){for(var _0x2571ac=0x0;_0x2571ac0x0?!![]:![];if(!_0x367904){return this[_0x9174('0x19')](this[_0x9174('0x16')][_0x9174('0x69')]);}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x1b')]=function(_0x8a9644){var _0x332fae=this['summary']['id'];if(this[_0x9174('0x16')][_0x9174('0x61')][_0x332fae]&&this['summary'][_0x9174('0x61')][_0x332fae][_0x8a9644[_0x9174('0x60')]]){this['summary'][_0x9174('0x61')][_0x332fae][_0x8a9644[_0x9174('0x60')]][_0x9174('0x12')][_0x9174('0x6a')](_0x8a9644);}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x6b')]=function(_0x58bc17){var _0x83c898=this;try{if(this['isNotNull'](_0x58bc17)&&this[_0x9174('0x5b')](_0x58bc17[_0x9174('0x4f')])){logger[_0x9174('0x49')](_0x9174('0x6c'),util[_0x9174('0x3f')](_0x58bc17,{'showHidden':![],'depth':null}));var _0x3ffa85=this[_0x9174('0x14')][_0x58bc17[_0x9174('0x4f')]];if(_0x3ffa85){logger[_0x9174('0x49')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3ffa85['name']);this[_0x9174('0x16')][_0x9174('0x5d')][_0x3ffa85[_0x9174('0x59')]]={'summaryEvent':_0x58bc17};this[_0x9174('0x16')][_0x9174('0x68')]+=0x1;return ami[_0x9174('0x39')]({'action':'queuestatus','queue':_0x3ffa85[_0x9174('0x59')]})[_0x9174('0x6d')](function(_0x17386c){if(!_0x83c898[_0x9174('0x16')][_0x9174('0x61')][_0x58bc17[_0x9174('0x60')]]){_0x83c898[_0x9174('0x16')][_0x9174('0x61')][_0x58bc17[_0x9174('0x60')]]={};}_0x83c898[_0x9174('0x16')][_0x9174('0x61')][_0x58bc17['actionid']][_0x17386c[_0x9174('0x60')]]={'queue':_0x3ffa85[_0x9174('0x59')],'agents':[]};})[_0x9174('0x5e')](function(_0x5d4494){throw _0x5d4494;});}}}catch(_0x2fb81c){logger[_0x9174('0x3d')](_0x9174('0x62'),util[_0x9174('0x3f')](_0x2fb81c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x19')]=function(_0x16389c){if(this[_0x9174('0x16')]['statusRequests']>0x0){this['summary'][_0x9174('0x69')]=_0x16389c;return;}logger[_0x9174('0x49')](_0x9174('0x6e'),util[_0x9174('0x3f')](_0x16389c,{'showHidden':![],'depth':null}));this[_0x9174('0x16')]=initializeSummary();ami[_0x9174('0x47')](_0x9174('0x6f'),{});};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x1f')]=function(_0x115f16){try{if(this['isNotNull'](_0x115f16)){logger[_0x9174('0x49')](_0x9174('0x70'),_0x115f16[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x115f16,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9174('0x10')][_0x115f16[_0x9174('0x4c')]])){this[_0x9174('0x10')][_0x115f16[_0x9174('0x4c')]]=[];}if(_[_0x9174('0x5c')](this[_0x9174('0x13')][_0x115f16[_0x9174('0x4c')]])){this[_0x9174('0x13')][_0x115f16[_0x9174('0x4c')]]={};}var _0x4df0c3=new QueueReport();_0x4df0c3['queue']=_0x115f16[_0x9174('0x4f')];_0x4df0c3[_0x9174('0x64')]=this[_0x9174('0x14')][_0x4df0c3[_0x9174('0x4f')]]&&this[_0x9174('0x14')][_0x4df0c3[_0x9174('0x4f')]]['type']?this['voiceQueues'][_0x4df0c3[_0x9174('0x4f')]][_0x9174('0x64')]||_0x9174('0x57'):_0x9174('0x57');_0x4df0c3['queuecallerjoinAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0x4df0c3['position']=_0x115f16[_0x9174('0x72')];_0x4df0c3['count']=_0x115f16[_0x9174('0x73')];_0x4df0c3[_0x9174('0x4c')]=_0x115f16[_0x9174('0x4c')];_0x4df0c3[_0x9174('0x74')]=this[_0x9174('0x13')][_0x115f16[_0x9174('0x4c')]][_0x9174('0x74')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4df0c3['queue'],_0x4df0c3[_0x9174('0x64')]);Object['assign'](_0x4df0c3,_[_0x9174('0x75')](_0x115f16,_[_0x9174('0x76')](_0x4df0c3)));this[_0x9174('0x10')][_0x115f16['uniqueid']][_0x9174('0x6a')](_0x4df0c3);this['channels'][_0x115f16['uniqueid']]=_0x4df0c3;this[_0x9174('0x48')](_0x4df0c3,_0x9174('0x1e'));}}catch(_0x7ae70a){logger[_0x9174('0x3d')](_0x9174('0x70'),_0x115f16[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x7ae70a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')]['syncQueueCallerAbandon']=function(_0x57aa40){try{if(this['isNotNull'](_0x57aa40)){logger[_0x9174('0x49')](_0x9174('0x77'),_0x57aa40[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x57aa40,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x57aa40[_0x9174('0x4c')]]){var _0x1936c2=_['last'](this[_0x9174('0x10')][_0x57aa40[_0x9174('0x4c')]]);_0x1936c2[_0x9174('0x37')]=![];_0x1936c2['queuecallercompleteAt']=null;_0x1936c2[_0x9174('0x78')]=_0x57aa40[_0x9174('0x78')];_0x1936c2[_0x9174('0x79')]=_0x57aa40['originalposition'];_0x1936c2[_0x9174('0x36')]=!![];_0x1936c2['queuecallerabandonAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0x1936c2[_0x9174('0x52')]=_0x9174('0x7a');_0x1936c2[_0x9174('0x7b')]=null;logger[_0x9174('0x7c')](_0x9174('0x7d'),_0x1936c2[_0x9174('0x4f')],_0x1936c2[_0x9174('0x64')]);this['channels'][_0x57aa40['uniqueid']]=_0x1936c2;this[_0x9174('0x46')](_0x1936c2,_0x9174('0x36'));}}}catch(_0x367ca6){logger['error'](_0x9174('0x77'),_0x57aa40['uniqueid'],util[_0x9174('0x3f')](_0x367ca6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x21')]=function(_0x286ae6){try{if(this[_0x9174('0x5b')](_0x286ae6)){logger[_0x9174('0x49')](_0x9174('0x7e'),_0x286ae6[_0x9174('0x4c')],util['inspect'](_0x286ae6,{'showHidden':![],'depth':null}));if(this[_0x9174('0x10')][_0x286ae6[_0x9174('0x4c')]]){var _0x11100f=_[_0x9174('0x7f')](this[_0x9174('0x10')][_0x286ae6['uniqueid']]);_0x11100f['queuecallerleaveAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0x11100f[_0x9174('0x80')]=_0x286ae6[_0x9174('0x80')];_0x11100f['connectedlinename']=_0x286ae6[_0x9174('0x81')];logger[_0x9174('0x7c')](_0x9174('0x82'),_0x11100f[_0x9174('0x4f')],_0x11100f[_0x9174('0x64')],_0x286ae6[_0x9174('0x80')],_0x286ae6[_0x9174('0x81')]);this[_0x9174('0x13')][_0x286ae6['uniqueid']]=_0x11100f;this[_0x9174('0x48')](_0x11100f,'queuecallerleave');}}}catch(_0x319cea){logger['error'](_0x9174('0x7e'),_0x286ae6['uniqueid'],util['inspect'](_0x319cea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x25')]=function(_0x38866d){try{if(this['isNotNull'](_0x38866d)){logger[_0x9174('0x49')](_0x9174('0x83'),_0x38866d['uniqueid'],util['inspect'](_0x38866d,{'showHidden':![],'depth':null}));if(this[_0x9174('0x10')][_0x38866d[_0x9174('0x4c')]]){var _0x28b4d9=_[_0x9174('0x7f')](this[_0x9174('0x10')][_0x38866d[_0x9174('0x4c')]]);_0x28b4d9[_0x9174('0x37')]=!![];_0x28b4d9[_0x9174('0x52')]='COMPLETEDBYAGENT';logger[_0x9174('0x7c')](_0x9174('0x84'),_0x28b4d9[_0x9174('0x4f')],_0x28b4d9['type']);}}}catch(_0x53dec4){logger['error'](_0x9174('0x83'),_0x38866d[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x53dec4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9174('0x23')]=function(_0x443b54){try{if(this[_0x9174('0x5b')](_0x443b54)){logger['debug'](_0x9174('0x85'),_0x443b54[_0x9174('0x4c')],util['inspect'](_0x443b54,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x443b54[_0x9174('0x4c')]]){var _0x414962=_[_0x9174('0x7f')](this['queueReports'][_0x443b54[_0x9174('0x4c')]]);_0x414962[_0x9174('0x36')]=![];_0x414962[_0x9174('0x86')]=null;_0x414962[_0x9174('0x87')]=!![];_0x414962[_0x9174('0x7b')]=_0x443b54[_0x9174('0x88')];_0x414962['holdtime']=_0x443b54['holdtime'];_0x414962[_0x9174('0x37')]=!![];_0x414962[_0x9174('0x35')]=![];_0x414962[_0x9174('0x89')]=null;if(!_0x414962[_0x9174('0x8a')]){if(_0x443b54[_0x9174('0x8b')]==_0x9174('0x8a')){_0x414962[_0x9174('0x52')]='COMPLETED';logger[_0x9174('0x7c')](_0x9174('0x8c'),_0x414962[_0x9174('0x4f')],_0x414962[_0x9174('0x64')]);}else{if(_[_0x9174('0x8d')](_0x443b54['channel'][_0x9174('0x8e')](),'local/')){if(this['queueReports'][_0x443b54['linkedid']]){var _0x200b2c=_[_0x9174('0x7f')](this['queueReports'][_0x443b54[_0x9174('0x8f')]]);_0x200b2c[_0x9174('0x37')]=![];_0x200b2c[_0x9174('0x35')]=!![];_0x200b2c['queuecallerexitAt']=moment(_0x414962['queuecallerjoinAt'])['add'](_0x443b54[_0x9174('0x78')],_0x9174('0x90'))[_0x9174('0x4d')](_0x9174('0x71'));_0x200b2c[_0x9174('0x52')]=_0x9174('0x91');_0x200b2c[_0x9174('0x8a')]=!![];_0x200b2c[_0x9174('0x92')]=_0x9174('0x93');_0x200b2c[_0x9174('0x94')]=_0x443b54[_0x9174('0x95')];_0x200b2c['transferuniqueid']=_0x443b54['uniqueid'];logger[_0x9174('0x7c')](_0x9174('0x96'),_0x200b2c['queue'],_0x200b2c[_0x9174('0x64')]);var _0x1f72b5=this['queueReports'][_0x443b54[_0x9174('0x8f')]];this['queueReports'][_0x443b54[_0x9174('0x8f')]]=this[_0x9174('0x10')][_0x443b54[_0x9174('0x4c')]];this[_0x9174('0x10')][_0x443b54[_0x9174('0x4c')]]=_0x1f72b5;}}else{_0x414962[_0x9174('0x52')]=_0x9174('0x97')+_0x443b54['reason'][_0x9174('0x98')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x414962['queue'],_0x414962[_0x9174('0x64')],_0x414962['queuecallerexitreason']);}}}this[_0x9174('0x13')][_0x443b54['uniqueid']]=_0x414962;}}}catch(_0x408786){logger['error'](_0x9174('0x85'),_0x443b54[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x408786,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x99')]=function(_0x18d47a){try{if(this[_0x9174('0x5b')](_0x18d47a)){logger[_0x9174('0x49')](_0x9174('0x9a'),_0x18d47a[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x18d47a,{'showHidden':![],'depth':null}));this[_0x9174('0x9b')](_0x18d47a[_0x9174('0x4c')],_[_0x9174('0x76')](_0x18d47a[_0x9174('0x9c')])[0x0],_0x18d47a[_0x9174('0x9d')]);if(this['queueReports'][_0x18d47a[_0x9174('0x4c')]]){var _0xa849b6=_[_0x9174('0x7f')](this[_0x9174('0x10')][_0x18d47a['uniqueid']]);if(_0xa849b6){if(this[_0x9174('0x5b')](_0x18d47a[_0x9174('0x9c')])&&this[_0x9174('0x5b')](_0x18d47a[_0x9174('0x9c')]['queuestatus'])){switch(_0x18d47a['value']){case _0x9174('0x9e'):_0xa849b6[_0x9174('0x35')]=![];_0xa849b6['queuecallerexitAt']=null;break;case'TIMEOUT':_0xa849b6[_0x9174('0x9f')]=_0x9174('0xa0');_0xa849b6[_0x9174('0x35')]=!![];_0xa849b6[_0x9174('0x89')]=moment()['format'](_0x9174('0x71'));_0xa849b6[_0x9174('0xa1')]=moment()['format'](_0x9174('0x71'));logger[_0x9174('0x49')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x18d47a[_0x9174('0x4c')],util[_0x9174('0x3f')](_0xa849b6,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0xa849b6);break;default:_0xa849b6[_0x9174('0x35')]=!![];_0xa849b6[_0x9174('0x89')]=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0xa849b6[_0x9174('0xa1')]=moment()[_0x9174('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');}_0xa849b6[_0x9174('0x36')]=![];_0xa849b6[_0x9174('0x86')]=null;_0xa849b6[_0x9174('0x52')]=_0x18d47a['value'];this['channels'][_0x18d47a[_0x9174('0x4c')]]=_0xa849b6;this[_0x9174('0x46')](_0xa849b6,'varset');}else if(this[_0x9174('0x5b')](_0x18d47a[_0x9174('0x9c')])&&this[_0x9174('0x5b')](_0x18d47a['variable']['queueposition'])){if(!_0xa849b6[_0x9174('0x36')]){_0xa849b6[_0x9174('0x35')]=!![];_0xa849b6['queuecallerexitAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0xa849b6[_0x9174('0x52')]='EXITWITHKEY';_0xa849b6[_0x9174('0xa1')]=moment()[_0x9174('0x4d')](_0x9174('0x71'));this[_0x9174('0x13')][_0x18d47a[_0x9174('0x4c')]]=_0xa849b6;}}logger[_0x9174('0x7c')](_0x9174('0xa2'),_0x18d47a[_0x9174('0x4c')],_0xa849b6[_0x9174('0x4f')],_0xa849b6[_0x9174('0x64')],_[_0x9174('0x76')](_0x18d47a['variable'])[0x0],_0x18d47a[_0x9174('0x9d')]);_0xa849b6['variables']=this[_0x9174('0x41')][_0x18d47a['uniqueid']];}}}}catch(_0x56ca64){logger[_0x9174('0x3d')]('[%s][voiceQueueReport][varset]',_0x18d47a[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x56ca64,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x75be9d,_0x16418b,_0x4a4cfb){var _0x4492b3=[_0x9174('0xa3'),'rtpaudioqosbridged',_0x9174('0xa4'),_0x9174('0xa5'),_0x9174('0xa6'),_0x9174('0xa7'),_0x9174('0xa8'),_0x9174('0xa9'),_0x9174('0xaa'),_0x9174('0xab'),_0x9174('0xac'),_0x9174('0xad'),_0x9174('0xae'),_0x9174('0xaf'),_0x9174('0xb0'),_0x9174('0xb1'),_0x9174('0x88'),_0x9174('0xb2'),_0x9174('0xb3')];if(!_[_0x9174('0xb4')](_0x16418b)&&!_[_0x9174('0xb5')](_0x4492b3,_0x16418b)){if(_[_0x9174('0x5c')](this[_0x9174('0x41')][_0x75be9d])){this['variables'][_0x75be9d]={};}this[_0x9174('0x41')][_0x75be9d][_0x16418b]=_0x4a4cfb;}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0xb6')]=function(_0x4f9d4c,_0x4ac79e,_0x1574cb){var _0x3ed3be={};for(var _0x11de19=0x0;_0x11de190x0?!![]:![];if(!_0x41622f){return this[_0x8a3c('0x17')](this[_0x8a3c('0x12')][_0x8a3c('0x6a')]);}};VoiceQueueReport[_0x8a3c('0x36')]['syncQueueMember']=function(_0x1fe4c9){var _0x4a4da9=this[_0x8a3c('0x12')]['id'];if(this['summary'][_0x8a3c('0x60')][_0x4a4da9]&&this[_0x8a3c('0x12')][_0x8a3c('0x60')][_0x4a4da9][_0x1fe4c9[_0x8a3c('0x5f')]]){this[_0x8a3c('0x12')][_0x8a3c('0x60')][_0x4a4da9][_0x1fe4c9[_0x8a3c('0x5f')]][_0x8a3c('0x46')]['push'](_0x1fe4c9);}};VoiceQueueReport[_0x8a3c('0x36')][_0x8a3c('0x14')]=function(_0x1c844a){var _0x31b680=this;try{if(this[_0x8a3c('0x5b')](_0x1c844a)&&this[_0x8a3c('0x5b')](_0x1c844a[_0x8a3c('0x4f')])){logger[_0x8a3c('0x4b')](_0x8a3c('0x6b'),util[_0x8a3c('0x41')](_0x1c844a,{'showHidden':![],'depth':null}));var _0x4f10d0=this['voiceQueues'][_0x1c844a[_0x8a3c('0x4f')]];if(_0x4f10d0){logger[_0x8a3c('0x4b')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x4f10d0[_0x8a3c('0x5a')]);this[_0x8a3c('0x12')]['queues'][_0x4f10d0['name']]={'summaryEvent':_0x1c844a};this[_0x8a3c('0x12')][_0x8a3c('0x69')]+=0x1;return ami[_0x8a3c('0x3a')]({'action':_0x8a3c('0x60'),'queue':_0x4f10d0[_0x8a3c('0x5a')]})[_0x8a3c('0x6c')](function(_0x32d274){if(!_0x31b680[_0x8a3c('0x12')]['queuestatus'][_0x1c844a[_0x8a3c('0x5f')]]){_0x31b680[_0x8a3c('0x12')]['queuestatus'][_0x1c844a[_0x8a3c('0x5f')]]={};}_0x31b680[_0x8a3c('0x12')][_0x8a3c('0x60')][_0x1c844a[_0x8a3c('0x5f')]][_0x32d274[_0x8a3c('0x5f')]]={'queue':_0x4f10d0[_0x8a3c('0x5a')],'agents':[]};})[_0x8a3c('0x3c')](function(_0x150582){throw _0x150582;});}}}catch(_0x4ef7a6){logger[_0x8a3c('0x3f')]('[voiceQueueReport][queuesummary]',util[_0x8a3c('0x41')](_0x4ef7a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8a3c('0x17')]=function(_0x30dc08){if(this[_0x8a3c('0x12')][_0x8a3c('0x69')]>0x0){this[_0x8a3c('0x12')][_0x8a3c('0x6a')]=_0x30dc08;return;}logger[_0x8a3c('0x4b')](_0x8a3c('0x6d'),util['inspect'](_0x30dc08,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x8a3c('0x49')](_0x8a3c('0x6e'),{});};VoiceQueueReport[_0x8a3c('0x36')][_0x8a3c('0x6f')]=function(_0x5cdad8){try{if(this[_0x8a3c('0x5b')](_0x5cdad8)){logger[_0x8a3c('0x4b')](_0x8a3c('0x70'),_0x5cdad8[_0x8a3c('0x53')],util[_0x8a3c('0x41')](_0x5cdad8,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x5cdad8[_0x8a3c('0x53')]])){this[_0x8a3c('0xd')][_0x5cdad8[_0x8a3c('0x53')]]=[];}if(_['isUndefined'](this[_0x8a3c('0x38')][_0x5cdad8['uniqueid']])){this[_0x8a3c('0x38')][_0x5cdad8['uniqueid']]={};}var _0x28c921=new QueueReport();_0x28c921[_0x8a3c('0x4f')]=_0x5cdad8[_0x8a3c('0x4f')];_0x28c921[_0x8a3c('0x56')]=this[_0x8a3c('0x10')][_0x28c921[_0x8a3c('0x4f')]]&&this[_0x8a3c('0x10')][_0x28c921['queue']][_0x8a3c('0x56')]?this[_0x8a3c('0x10')][_0x28c921[_0x8a3c('0x4f')]]['type']||_0x8a3c('0x57'):_0x8a3c('0x57');_0x28c921[_0x8a3c('0x71')]=moment()[_0x8a3c('0x59')](_0x8a3c('0x72'));_0x28c921[_0x8a3c('0x73')]=_0x5cdad8[_0x8a3c('0x73')];_0x28c921['count']=_0x5cdad8['count'];_0x28c921['uniqueid']=_0x5cdad8[_0x8a3c('0x53')];_0x28c921[_0x8a3c('0x74')]=this[_0x8a3c('0x38')][_0x5cdad8[_0x8a3c('0x53')]][_0x8a3c('0x74')];logger['info'](_0x8a3c('0x75'),_0x28c921[_0x8a3c('0x4f')],_0x28c921[_0x8a3c('0x56')]);Object[_0x8a3c('0x76')](_0x28c921,_[_0x8a3c('0x77')](_0x5cdad8,_[_0x8a3c('0x78')](_0x28c921)));this['queueReports'][_0x5cdad8[_0x8a3c('0x53')]][_0x8a3c('0x79')](_0x28c921);this[_0x8a3c('0x38')][_0x5cdad8['uniqueid']]=_0x28c921;this[_0x8a3c('0x4a')](_0x28c921,_0x8a3c('0x1a'));}}catch(_0x2661ba){logger[_0x8a3c('0x3f')](_0x8a3c('0x70'),_0x5cdad8['uniqueid'],util[_0x8a3c('0x41')](_0x2661ba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8a3c('0x36')][_0x8a3c('0x1b')]=function(_0x1b98eb){try{if(this[_0x8a3c('0x5b')](_0x1b98eb)){logger[_0x8a3c('0x4b')](_0x8a3c('0x7a'),_0x1b98eb['uniqueid'],util[_0x8a3c('0x41')](_0x1b98eb,{'showHidden':![],'depth':null}));if(this[_0x8a3c('0xd')][_0x1b98eb[_0x8a3c('0x53')]]){var _0x1169f1=_[_0x8a3c('0x7b')](this[_0x8a3c('0xd')][_0x1b98eb[_0x8a3c('0x53')]]);_0x1169f1[_0x8a3c('0x35')]=![];_0x1169f1[_0x8a3c('0x7c')]=null;_0x1169f1[_0x8a3c('0x7d')]=_0x1b98eb['holdtime'];_0x1169f1[_0x8a3c('0x7e')]=_0x1b98eb['originalposition'];_0x1169f1[_0x8a3c('0x7f')]=!![];_0x1169f1['queuecallerabandonAt']=moment()[_0x8a3c('0x59')](_0x8a3c('0x72'));_0x1169f1[_0x8a3c('0x54')]='ABANDONED';_0x1169f1[_0x8a3c('0x80')]=null;logger[_0x8a3c('0x81')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x1169f1[_0x8a3c('0x4f')],_0x1169f1[_0x8a3c('0x56')]);this['channels'][_0x1b98eb[_0x8a3c('0x53')]]=_0x1169f1;this[_0x8a3c('0x47')](_0x1169f1,_0x8a3c('0x7f'));}}}catch(_0x1c0669){logger[_0x8a3c('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1b98eb[_0x8a3c('0x53')],util[_0x8a3c('0x41')](_0x1c0669,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8a3c('0x36')][_0x8a3c('0x1d')]=function(_0x44cb7c){try{if(this[_0x8a3c('0x5b')](_0x44cb7c)){logger[_0x8a3c('0x4b')](_0x8a3c('0x82'),_0x44cb7c['uniqueid'],util[_0x8a3c('0x41')](_0x44cb7c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x44cb7c[_0x8a3c('0x53')]]){var _0x5ab1c1=_['last'](this['queueReports'][_0x44cb7c[_0x8a3c('0x53')]]);_0x5ab1c1['queuecallerleaveAt']=moment()[_0x8a3c('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ab1c1[_0x8a3c('0x83')]=_0x44cb7c[_0x8a3c('0x83')];_0x5ab1c1['connectedlinename']=_0x44cb7c[_0x8a3c('0x84')];logger[_0x8a3c('0x81')](_0x8a3c('0x85'),_0x5ab1c1[_0x8a3c('0x4f')],_0x5ab1c1['type'],_0x44cb7c[_0x8a3c('0x83')],_0x44cb7c[_0x8a3c('0x84')]);this[_0x8a3c('0x38')][_0x44cb7c[_0x8a3c('0x53')]]=_0x5ab1c1;this[_0x8a3c('0x4a')](_0x5ab1c1,_0x8a3c('0x1c'));}}}catch(_0x224ce2){logger[_0x8a3c('0x3f')](_0x8a3c('0x82'),_0x44cb7c[_0x8a3c('0x53')],util['inspect'](_0x224ce2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8a3c('0x36')][_0x8a3c('0x21')]=function(_0x4ddb34){try{if(this['isNotNull'](_0x4ddb34)){logger['debug'](_0x8a3c('0x86'),_0x4ddb34[_0x8a3c('0x53')],util[_0x8a3c('0x41')](_0x4ddb34,{'showHidden':![],'depth':null}));if(this[_0x8a3c('0xd')][_0x4ddb34['uniqueid']]){var _0xeab7bb=_[_0x8a3c('0x7b')](this[_0x8a3c('0xd')][_0x4ddb34[_0x8a3c('0x53')]]);_0xeab7bb[_0x8a3c('0x35')]=!![];_0xeab7bb[_0x8a3c('0x54')]=_0x8a3c('0x87');logger[_0x8a3c('0x81')](_0x8a3c('0x88'),_0xeab7bb[_0x8a3c('0x4f')],_0xeab7bb['type']);}}}catch(_0x21f035){logger[_0x8a3c('0x3f')](_0x8a3c('0x86'),_0x4ddb34[_0x8a3c('0x53')],util[_0x8a3c('0x41')](_0x21f035,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8a3c('0x1f')]=function(_0x4eb3d6){try{if(this['isNotNull'](_0x4eb3d6)){logger[_0x8a3c('0x4b')](_0x8a3c('0x89'),_0x4eb3d6[_0x8a3c('0x53')],util['inspect'](_0x4eb3d6,{'showHidden':![],'depth':null}));if(this[_0x8a3c('0xd')][_0x4eb3d6['uniqueid']]){var _0x14fc03=_[_0x8a3c('0x7b')](this[_0x8a3c('0xd')][_0x4eb3d6[_0x8a3c('0x53')]]);_0x14fc03[_0x8a3c('0x7f')]=![];_0x14fc03['queuecallerabandonAt']=null;_0x14fc03[_0x8a3c('0x8a')]=!![];_0x14fc03[_0x8a3c('0x80')]=_0x4eb3d6[_0x8a3c('0x8b')];_0x14fc03[_0x8a3c('0x7d')]=_0x4eb3d6['holdtime'];_0x14fc03[_0x8a3c('0x35')]=!![];_0x14fc03[_0x8a3c('0x34')]=![];_0x14fc03[_0x8a3c('0x8c')]=null;if(!_0x14fc03['transfer']){if(_0x4eb3d6[_0x8a3c('0x8d')]==_0x8a3c('0x8e')){_0x14fc03['queuecallerexitreason']=_0x8a3c('0x8f');logger[_0x8a3c('0x81')](_0x8a3c('0x90'),_0x14fc03[_0x8a3c('0x4f')],_0x14fc03[_0x8a3c('0x56')]);}else{if(_[_0x8a3c('0x91')](_0x4eb3d6[_0x8a3c('0x3b')][_0x8a3c('0x92')](),'local/')){if(this[_0x8a3c('0xd')][_0x4eb3d6[_0x8a3c('0x93')]]){var _0x4c02ff=_[_0x8a3c('0x7b')](this[_0x8a3c('0xd')][_0x4eb3d6[_0x8a3c('0x93')]]);_0x4c02ff[_0x8a3c('0x35')]=![];_0x4c02ff[_0x8a3c('0x34')]=!![];_0x4c02ff[_0x8a3c('0x8c')]=moment(_0x14fc03[_0x8a3c('0x71')])[_0x8a3c('0x94')](_0x4eb3d6[_0x8a3c('0x7d')],_0x8a3c('0x95'))[_0x8a3c('0x59')](_0x8a3c('0x72'));_0x4c02ff[_0x8a3c('0x54')]=_0x8a3c('0x96');_0x4c02ff['transfer']=!![];_0x4c02ff[_0x8a3c('0x97')]='FORWARD';_0x4c02ff[_0x8a3c('0x98')]=_0x4eb3d6['destexten'];_0x4c02ff[_0x8a3c('0x99')]=_0x4eb3d6[_0x8a3c('0x53')];logger[_0x8a3c('0x81')](_0x8a3c('0x9a'),_0x4c02ff['queue'],_0x4c02ff[_0x8a3c('0x56')]);var _0x1712f3=this[_0x8a3c('0xd')][_0x4eb3d6[_0x8a3c('0x93')]];this[_0x8a3c('0xd')][_0x4eb3d6[_0x8a3c('0x93')]]=this['queueReports'][_0x4eb3d6[_0x8a3c('0x53')]];this[_0x8a3c('0xd')][_0x4eb3d6[_0x8a3c('0x53')]]=_0x1712f3;}}else{_0x14fc03[_0x8a3c('0x54')]=_0x8a3c('0x9b')+_0x4eb3d6[_0x8a3c('0x8d')][_0x8a3c('0x9c')]();logger[_0x8a3c('0x81')](_0x8a3c('0x9d'),_0x14fc03['queue'],_0x14fc03[_0x8a3c('0x56')],_0x14fc03[_0x8a3c('0x54')]);}}}this[_0x8a3c('0x38')][_0x4eb3d6[_0x8a3c('0x53')]]=_0x14fc03;}}}catch(_0x21fc20){logger[_0x8a3c('0x3f')](_0x8a3c('0x89'),_0x4eb3d6[_0x8a3c('0x53')],util[_0x8a3c('0x41')](_0x21fc20,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8a3c('0x36')][_0x8a3c('0x22')]=function(_0x3cea06){try{if(this['isNotNull'](_0x3cea06)){logger[_0x8a3c('0x4b')]('[%s][voiceQueueReport][varset]',_0x3cea06[_0x8a3c('0x53')],util[_0x8a3c('0x41')](_0x3cea06,{'showHidden':![],'depth':null}));this[_0x8a3c('0x9e')](_0x3cea06[_0x8a3c('0x53')],_[_0x8a3c('0x78')](_0x3cea06[_0x8a3c('0x9f')])[0x0],_0x3cea06[_0x8a3c('0xa0')]);if(this['queueReports'][_0x3cea06[_0x8a3c('0x53')]]){var _0x33d4a4=_[_0x8a3c('0x7b')](this['queueReports'][_0x3cea06['uniqueid']]);if(_0x33d4a4){if(this['isNotNull'](_0x3cea06[_0x8a3c('0x9f')])&&this['isNotNull'](_0x3cea06[_0x8a3c('0x9f')][_0x8a3c('0x60')])){switch(_0x3cea06[_0x8a3c('0xa0')]){case _0x8a3c('0xa1'):_0x33d4a4['queuecallerexit']=![];_0x33d4a4[_0x8a3c('0x8c')]=null;break;case _0x8a3c('0xa2'):_0x33d4a4['lastevent']='timeout';_0x33d4a4[_0x8a3c('0x34')]=!![];_0x33d4a4[_0x8a3c('0x8c')]=moment()['format'](_0x8a3c('0x72'));_0x33d4a4[_0x8a3c('0xa3')]=moment()[_0x8a3c('0x59')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x8a3c('0x4b')](_0x8a3c('0xa4'),_0x3cea06[_0x8a3c('0x53')],util[_0x8a3c('0x41')](_0x33d4a4,{'showHidden':![],'depth':null}));ami[_0x8a3c('0x49')](_0x8a3c('0xa5'),_0x33d4a4);break;default:_0x33d4a4[_0x8a3c('0x34')]=!![];_0x33d4a4['queuecallerexitAt']=moment()['format'](_0x8a3c('0x72'));_0x33d4a4[_0x8a3c('0xa3')]=moment()[_0x8a3c('0x59')]('YYYY-MM-DD\x20HH:mm:ss');}_0x33d4a4[_0x8a3c('0x7f')]=![];_0x33d4a4[_0x8a3c('0xa6')]=null;_0x33d4a4['queuecallerexitreason']=_0x3cea06[_0x8a3c('0xa0')];this[_0x8a3c('0x38')][_0x3cea06[_0x8a3c('0x53')]]=_0x33d4a4;this['emitVoiceQueueChannelRemove'](_0x33d4a4,_0x8a3c('0xa7'));}else if(this[_0x8a3c('0x5b')](_0x3cea06[_0x8a3c('0x9f')])&&this[_0x8a3c('0x5b')](_0x3cea06[_0x8a3c('0x9f')][_0x8a3c('0xa8')])){if(!_0x33d4a4[_0x8a3c('0x7f')]){_0x33d4a4[_0x8a3c('0x34')]=!![];_0x33d4a4[_0x8a3c('0x8c')]=moment()[_0x8a3c('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x33d4a4[_0x8a3c('0x54')]=_0x8a3c('0xa9');_0x33d4a4[_0x8a3c('0xa3')]=moment()[_0x8a3c('0x59')](_0x8a3c('0x72'));this[_0x8a3c('0x38')][_0x3cea06[_0x8a3c('0x53')]]=_0x33d4a4;}}logger[_0x8a3c('0x81')](_0x8a3c('0xaa'),_0x3cea06[_0x8a3c('0x53')],_0x33d4a4[_0x8a3c('0x4f')],_0x33d4a4[_0x8a3c('0x56')],_[_0x8a3c('0x78')](_0x3cea06[_0x8a3c('0x9f')])[0x0],_0x3cea06[_0x8a3c('0xa0')]);_0x33d4a4[_0x8a3c('0xab')]=this[_0x8a3c('0xab')][_0x3cea06['uniqueid']];}}}}catch(_0x58ace8){logger[_0x8a3c('0x3f')](_0x8a3c('0xac'),_0x3cea06[_0x8a3c('0x53')],util['inspect'](_0x58ace8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8a3c('0x36')]['addVariable']=function(_0x5795c8,_0x41ff8f,_0x8458d7){var _0x124e6b=[_0x8a3c('0xad'),_0x8a3c('0xae'),_0x8a3c('0xaf'),_0x8a3c('0xb0'),_0x8a3c('0xb1'),_0x8a3c('0xb2'),_0x8a3c('0xb3'),_0x8a3c('0xb4'),_0x8a3c('0xb5'),_0x8a3c('0xb6'),'bridgepeer','bridgepvtcallid',_0x8a3c('0xb7'),_0x8a3c('0xb8'),'memberinterface',_0x8a3c('0xb9'),_0x8a3c('0x8b'),_0x8a3c('0xba'),'memberrealtime'];if(!_['isNil'](_0x41ff8f)&&!_[_0x8a3c('0xbb')](_0x124e6b,_0x41ff8f)){if(_[_0x8a3c('0x5c')](this[_0x8a3c('0xab')][_0x5795c8])){this[_0x8a3c('0xab')][_0x5795c8]={};}this[_0x8a3c('0xab')][_0x5795c8][_0x41ff8f]=_0x8458d7;}};VoiceQueueReport[_0x8a3c('0x36')][_0x8a3c('0xbc')]=function(_0x494871,_0x582ae3,_0x3988c8){var _0x47518c={};for(var _0x2d8671=0x0;_0x2d8671=0x0?moment(_0x172416[_0x13af('0x18')])[_0x13af('0xd')](_0x172416[_0x13af('0x19')],_0x13af('0xe')):null,'data1':'outbound','data2':_0x172416['accountcode'],'data3':_0x172416['exten'],'data4':_0x172416[_0x13af('0x1a')]||null,'role':_0x13af('0x13'),'internal':_0x172416[_0x13af('0x15')]?_[_0x13af('0x14')](_0x172416[_0x13af('0x15')]):undefined,'uniqueid':_0x172416[_0x13af('0x1b')]},'log':_0x13af('0x7')});}; \ No newline at end of file +var _0xfe4e=['Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','membername','starttime','endtime','outbound','dialstring','moment','lodash','../client','queuecallerexitAt'];(function(_0x480e97,_0xfd12e6){var _0x1a714a=function(_0x2ae079){while(--_0x2ae079){_0x480e97['push'](_0x480e97['shift']());}};_0x1a714a(++_0xfd12e6);}(_0xfe4e,0x164));var _0xefe4=function(_0x8da794,_0x55359e){_0x8da794=_0x8da794-0x0;var _0x21f603=_0xfe4e[_0x8da794];return _0x21f603;};'use strict';var moment=require(_0xefe4('0x0'));var _=require(_0xefe4('0x1'));var util=require('util');var client=require(_0xefe4('0x2'));exports['voiceQueueReport']=function(_0x365f61){var _0x15acf7=_0x365f61['queuecallercompleteAt']||_0x365f61[_0xefe4('0x3')];return client[_0xefe4('0x4')]('CreateMemberReport',{'body':{'channel':_0xefe4('0x5'),'membername':_0x365f61[_0xefe4('0x6')],'interface':_[_0xefe4('0x7')](_0x365f61[_0xefe4('0x8')])?util[_0xefe4('0x9')](_0xefe4('0xa'),_0x365f61[_0xefe4('0x6')]):_0x365f61[_0xefe4('0x8')],'type':_0xefe4('0xb'),'enterAt':_0x365f61[_0xefe4('0xc')],'exitAt':_0x15acf7,'duration':moment(_0x15acf7)[_0xefe4('0xd')](_0x365f61['queuecallerleaveAt'],_0xefe4('0xe')),'data1':_0xefe4('0xf'),'data2':_0x365f61[_0xefe4('0x10')],'data3':_0x365f61[_0xefe4('0x11')],'data4':null,'data5':_0x365f61[_0xefe4('0x12')],'role':_0xefe4('0x13'),'internal':_0x365f61[_0xefe4('0x14')]?_[_0xefe4('0x15')](_0x365f61[_0xefe4('0x14')]):undefined,'uniqueid':_0x365f61[_0xefe4('0x16')]},'log':_0xefe4('0x17')});};exports[_0xefe4('0x18')]=function(_0x502fcf){return client[_0xefe4('0x4')](_0xefe4('0x17'),{'body':{'channel':'voice','membername':_0x502fcf[_0xefe4('0x19')],'interface':_0x502fcf[_0xefe4('0x8')],'type':_0xefe4('0xb'),'enterAt':_0x502fcf[_0xefe4('0x1a')],'exitAt':_0x502fcf['endtime'],'duration':moment(_0x502fcf[_0xefe4('0x1b')])[_0xefe4('0xd')](_0x502fcf['starttime'],_0xefe4('0xe'))>=0x0?moment(_0x502fcf['endtime'])['diff'](_0x502fcf[_0xefe4('0x1a')],_0xefe4('0xe')):null,'data1':_0xefe4('0x1c'),'data2':_0x502fcf[_0xefe4('0x14')],'data3':_0x502fcf[_0xefe4('0x11')],'data4':_0x502fcf[_0xefe4('0x1d')]||null,'role':_0xefe4('0x13'),'internal':_0x502fcf[_0xefe4('0x14')]?_[_0xefe4('0x15')](_0x502fcf[_0xefe4('0x14')]):undefined,'uniqueid':_0x502fcf['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 1ac8138..6f9ac3b 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 _0x065e=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x34f72d,_0x5f376c){var _0x4289d8=function(_0x25b5dc){while(--_0x25b5dc){_0x34f72d['push'](_0x34f72d['shift']());}};_0x4289d8(++_0x5f376c);}(_0x065e,0x1a7));var _0xe065=function(_0x4bf615,_0xc5f51e){_0x4bf615=_0x4bf615-0x0;var _0x5744e7=_0x065e[_0x4bf615];return _0x5744e7;};'use strict';var client=require(_0xe065('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe065('0x1'),_0xe065('0x2')]},'log':_0xe065('0x3')});}; \ No newline at end of file +var _0xb4c3=['GetSettings','../client','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x1c22c1,_0x49fe56){var _0x46d1fd=function(_0x1b4100){while(--_0x1b4100){_0x1c22c1['push'](_0x1c22c1['shift']());}};_0x46d1fd(++_0x49fe56);}(_0xb4c3,0x115));var _0x3b4c=function(_0x18d966,_0xeb34dd){_0x18d966=_0x18d966-0x0;var _0x421d23=_0xb4c3[_0x18d966];return _0x421d23;};'use strict';var client=require(_0x3b4c('0x0'));exports['getSettings']=function(){return client[_0x3b4c('0x1')](_0x3b4c('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3b4c('0x3'),_0x3b4c('0x4')]},'log':_0x3b4c('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index a481b0c..a0e91f4 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 _0xd5ee=['Request','name','GetTemplate','../client'];(function(_0x1aa4c4,_0xc969a4){var _0x50da18=function(_0x15d53e){while(--_0x15d53e){_0x1aa4c4['push'](_0x1aa4c4['shift']());}};_0x50da18(++_0xc969a4);}(_0xd5ee,0x93));var _0xed5e=function(_0x195223,_0x121404){_0x195223=_0x195223-0x0;var _0x3a62dd=_0xd5ee[_0x195223];return _0x3a62dd;};'use strict';var client=require(_0xed5e('0x0'));exports['getTemplates']=function(_0x276b8a){return function(_0x1cd899){return client[_0xed5e('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xed5e('0x2'),'html']},'log':_0xed5e('0x3')});};}; \ No newline at end of file +var _0x6bdd=['name','getTemplates','Request','GetTemplate'];(function(_0x57e372,_0x5576f6){var _0x352c1a=function(_0x24a558){while(--_0x24a558){_0x57e372['push'](_0x57e372['shift']());}};_0x352c1a(++_0x5576f6);}(_0x6bdd,0xe9));var _0xd6bd=function(_0x15adc6,_0xbc8322){_0x15adc6=_0x15adc6-0x0;var _0x3bb841=_0x6bdd[_0x15adc6];return _0x3bb841;};'use strict';var client=require('../client');exports[_0xd6bd('0x0')]=function(_0x1966c){return function(_0x4685fc){return client[_0xd6bd('0x1')](_0xd6bd('0x2'),{'options':{'raw':!![],'attributes':['id',_0xd6bd('0x3'),'html']},'log':_0xd6bd('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index d640976..bccf955 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 _0x65ec=['data6','data7','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','action','data1','data2','data4','data5'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x65ec,0x11f));var _0xc65e=function(_0x759283,_0x34e291){_0x759283=_0x759283-0x0;var _0x924af9=_0x65ec[_0x759283];return _0x924af9;};'use strict';var client=require('../client');exports[_0xc65e('0x0')]=function(_0x3c6f61){return function(_0x1a631f){return client[_0xc65e('0x1')](_0xc65e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc65e('0x3'),_0xc65e('0x4')],'include':[{'model':_0xc65e('0x5'),'as':_0xc65e('0x6'),'attributes':['id',_0xc65e('0x7'),_0xc65e('0x8'),_0xc65e('0x9')]},{'model':_0xc65e('0x5'),'as':_0xc65e('0xa'),'attributes':['id',_0xc65e('0x7'),'operator','value']},{'model':_0xc65e('0xb'),'as':'Actions','attributes':['id',_0xc65e('0xc'),_0xc65e('0xd'),_0xc65e('0xe'),'data3',_0xc65e('0xf'),_0xc65e('0x10'),_0xc65e('0x11'),_0xc65e('0x12')]}]},'log':_0xc65e('0x2')});};}; \ No newline at end of file +var _0x663b=['Action','Actions','data1','data3','data6','GetTrigger','getTriggers','channel','status','Condition','AllConditions','operator','value','field'];(function(_0x1a74b0,_0x25af97){var _0x5540dd=function(_0xb9391d){while(--_0xb9391d){_0x1a74b0['push'](_0x1a74b0['shift']());}};_0x5540dd(++_0x25af97);}(_0x663b,0x84));var _0xb663=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0x663b[_0x9e0cb3];return _0x5926b7;};'use strict';var client=require('../client');exports[_0xb663('0x0')]=function(_0xb3865a){return function(_0xd6fc7a){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0xb663('0x1'),_0xb663('0x2')],'include':[{'model':_0xb663('0x3'),'as':_0xb663('0x4'),'attributes':['id','field',_0xb663('0x5'),_0xb663('0x6')]},{'model':_0xb663('0x3'),'as':'AnyConditions','attributes':['id',_0xb663('0x7'),_0xb663('0x5'),'value']},{'model':_0xb663('0x8'),'as':_0xb663('0x9'),'attributes':['id','action',_0xb663('0xa'),'data2',_0xb663('0xb'),'data4','data5',_0xb663('0xc'),'data7']}]},'log':_0xb663('0xd')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d2a6426..a7ed5e0 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 _0xb332=['registry','../client','GetTrunk'];(function(_0x543215,_0x19bc06){var _0x4157bd=function(_0x5bda8a){while(--_0x5bda8a){_0x543215['push'](_0x543215['shift']());}};_0x4157bd(++_0x19bc06);}(_0xb332,0xd9));var _0x2b33=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xb332[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x2b33('0x0'));exports['getTrunks']=function(_0x196261){return function(_0x199daa){return client['Request'](_0x2b33('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x2b33('0x2'),'defaultuser']},'log':_0x2b33('0x1')});};}; \ No newline at end of file +var _0xa7ac=['GetTrunk','name','registry','defaultuser','getTrunks'];(function(_0x43fbda,_0x8a8037){var _0x38f63c=function(_0x599f4a){while(--_0x599f4a){_0x43fbda['push'](_0x43fbda['shift']());}};_0x38f63c(++_0x8a8037);}(_0xa7ac,0x14e));var _0xca7a=function(_0x53a25,_0x44711a){_0x53a25=_0x53a25-0x0;var _0x613045=_0xa7ac[_0x53a25];return _0x613045;};'use strict';var client=require('../client');exports[_0xca7a('0x0')]=function(_0x58dc33){return function(_0x1aaf24){return client['Request'](_0xca7a('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xca7a('0x2'),_0xca7a('0x3'),_0xca7a('0x4')]},'log':_0xca7a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index eb9bd9e..f093324 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x1222b3,_0x3bbd73){var _0x51a4f0=function(_0x3f6879){while(--_0x3f6879){_0x1222b3['push'](_0x1222b3['shift']());}};_0x51a4f0(++_0x3bbd73);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xcb91[_0x53b8e0];return _0x10630c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe706,0xa3));var _0x6e70=function(_0x26986a,_0x168f62){_0x26986a=_0x26986a-0x0;var _0x361f12=_0xe706[_0x26986a];return _0x361f12;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 3e2f2f8..e59b24f 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 _0xd1d7=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x4a4248,_0x30660d){var _0x1a76ed=function(_0xbaf3c1){while(--_0xbaf3c1){_0x4a4248['push'](_0x4a4248['shift']());}};_0x1a76ed(++_0x30660d);}(_0xd1d7,0x17f));var _0x7d1d=function(_0x4bf77c,_0x53999d){_0x4bf77c=_0x4bf77c-0x0;var _0x5d73c5=_0xd1d7[_0x4bf77c];return _0x5d73c5;};'use strict';var client=require(_0x7d1d('0x0'));exports[_0x7d1d('0x1')]=function(_0x804408){return client['Request'](_0x7d1d('0x2'),{'body':_0x804408,'log':_0x7d1d('0x2')});};exports[_0x7d1d('0x3')]=function(_0x347a39,_0x4389b0,_0x28cb11){return client[_0x7d1d('0x4')](_0x7d1d('0x5'),{'body':_0x347a39,'options':{'where':{'uniqueid':_0x4389b0,'interface':_0x28cb11,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x58bd=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x5396c6,_0x2a54e6){var _0x3fb91e=function(_0x568564){while(--_0x568564){_0x5396c6['push'](_0x5396c6['shift']());}};_0x3fb91e(++_0x2a54e6);}(_0x58bd,0x116));var _0xd58b=function(_0x54a823,_0x127dea){_0x54a823=_0x54a823-0x0;var _0x2c6884=_0x58bd[_0x54a823];return _0x2c6884;};'use strict';var client=require(_0xd58b('0x0'));exports[_0xd58b('0x1')]=function(_0x1e77d7){return client[_0xd58b('0x2')](_0xd58b('0x3'),{'body':_0x1e77d7,'log':_0xd58b('0x3')});};exports[_0xd58b('0x4')]=function(_0x6e7643,_0x44b3c5,_0x3bcd76){return client[_0xd58b('0x2')](_0xd58b('0x5'),{'body':_0x6e7643,'options':{'where':{'uniqueid':_0x44b3c5,'interface':_0x3bcd76,'agentcomplete':!![]}},'log':_0xd58b('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 90cb258..608ca19 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 _0xd5b9=['moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x4df66b,_0x4413b0){var _0x106d14=function(_0xff2207){while(--_0xff2207){_0x4df66b['push'](_0x4df66b['shift']());}};_0x106d14(++_0x4413b0);}(_0xd5b9,0x1e0));var _0x9d5b=function(_0x43772d,_0x2dbbd5){_0x43772d=_0x43772d-0x0;var _0x81657c=_0xd5b9[_0x43772d];return _0x81657c;};'use strict';var moment=require(_0x9d5b('0x0'));var util=require(_0x9d5b('0x1'));var _=require(_0x9d5b('0x2'));var client=require(_0x9d5b('0x3'));exports[_0x9d5b('0x4')]=function(_0x3252ce){return client[_0x9d5b('0x5')](_0x9d5b('0x6'),{'body':_[_0x9d5b('0x7')](_0x3252ce,{'source':_0x3252ce[_0x9d5b('0x8')],'destinationcontext':_0x3252ce[_0x9d5b('0x9')],'callerid':_0x3252ce[_0x9d5b('0xa')],'amaflags':_0x9d5b('0xb')}),'log':_0x9d5b('0x6')});};exports[_0x9d5b('0xc')]=function(){return function(){return client[_0x9d5b('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x9d5b('0xd')],'createdAt':{'$between':[moment()[_0x9d5b('0xe')](_0x9d5b('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x9d5b('0x10')](_0x9d5b('0xf'))[_0x9d5b('0x11')](_0x9d5b('0x12'))]}},'attributes':[_0x9d5b('0x13'),_0x9d5b('0x14'),_0x9d5b('0x15'),_0x9d5b('0x16')]},'log':_0x9d5b('0x17')});};}; \ No newline at end of file +var _0xc694=['billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','endOf','format','duration'];(function(_0x3edb18,_0x500676){var _0x4f5749=function(_0x58de56){while(--_0x58de56){_0x3edb18['push'](_0x3edb18['shift']());}};_0x4f5749(++_0x500676);}(_0xc694,0xe9));var _0x4c69=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0xc694[_0x1aab74];return _0x396af2;};'use strict';var moment=require(_0x4c69('0x0'));var util=require(_0x4c69('0x1'));var _=require(_0x4c69('0x2'));var client=require(_0x4c69('0x3'));exports[_0x4c69('0x4')]=function(_0x4c6dd9){return client[_0x4c69('0x5')](_0x4c69('0x6'),{'body':_[_0x4c69('0x7')](_0x4c6dd9,{'source':_0x4c6dd9[_0x4c69('0x8')],'destinationcontext':_0x4c6dd9[_0x4c69('0x9')],'callerid':_0x4c6dd9[_0x4c69('0xa')],'amaflags':_0x4c69('0xb')}),'log':'CreateVoiceCallReport'});};exports[_0x4c69('0xc')]=function(){return function(){return client[_0x4c69('0x5')](_0x4c69('0xd'),{'options':{'where':{'type':[_0x4c69('0xe')],'createdAt':{'$between':[moment()['startOf'](_0x4c69('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x4c69('0x10')](_0x4c69('0xf'))[_0x4c69('0x11')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x4c69('0x12'),_0x4c69('0x13')]},'log':_0x4c69('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 490f998..86000fa 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 _0xfb1b=['../client','CreateVoiceDialReport'];(function(_0x3e18fc,_0x3ae02f){var _0x2c0d28=function(_0x3aa3bf){while(--_0x3aa3bf){_0x3e18fc['push'](_0x3e18fc['shift']());}};_0x2c0d28(++_0x3ae02f);}(_0xfb1b,0xda));var _0xbfb1=function(_0x2503b3,_0x2c22a5){_0x2503b3=_0x2503b3-0x0;var _0x3cfe68=_0xfb1b[_0x2503b3];return _0x3cfe68;};'use strict';var client=require(_0xbfb1('0x0'));exports['create']=function(_0x8be556){return client['Request'](_0xbfb1('0x1'),{'body':_0x8be556,'log':_0xbfb1('0x1')});}; \ No newline at end of file +var _0xb8c7=['create','../client'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0xb8c7,0x1a9));var _0x7b8c=function(_0x54005b,_0x1089fc){_0x54005b=_0x54005b-0x0;var _0x4d113f=_0xb8c7[_0x54005b];return _0x4d113f;};'use strict';var client=require(_0x7b8c('0x0'));exports[_0x7b8c('0x1')]=function(_0x3902ec){return client['Request']('CreateVoiceDialReport',{'body':_0x3902ec,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ed0dc3a..34d3239 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 _0xbc9d=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x56a616,_0x5a3c7c){var _0xe94844=function(_0x1d3816){while(--_0x1d3816){_0x56a616['push'](_0x56a616['shift']());}};_0xe94844(++_0x5a3c7c);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x48dbe0,_0x382761){_0x48dbe0=_0x48dbe0-0x0;var _0x412c2c=_0xbc9d[_0x48dbe0];return _0x412c2c;};'use strict';var client=require(_0xdbc9('0x0'));exports[_0xdbc9('0x1')]=function(){return function(){return client[_0xdbc9('0x2')](_0xdbc9('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdbc9('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xa249=['getVoiceExtensions','GetVoiceExtension','exten','../client'];(function(_0x19d47c,_0x2aa7ac){var _0x5a5dc5=function(_0x1a111e){while(--_0x1a111e){_0x19d47c['push'](_0x19d47c['shift']());}};_0x5a5dc5(++_0x2aa7ac);}(_0xa249,0x183));var _0x9a24=function(_0x4f3eb9,_0x28cd01){_0x4f3eb9=_0x4f3eb9-0x0;var _0x52b101=_0xa249[_0x4f3eb9];return _0x52b101;};'use strict';var client=require(_0x9a24('0x0'));exports[_0x9a24('0x1')]=function(){return function(){return client['Request'](_0x9a24('0x2'),{'options':{'raw':!![],'attributes':['id',_0x9a24('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x9a24('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index f5efcc8..c00f86e 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 _0x10d1=['type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','active','Pause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format'];(function(_0x4c1df8,_0x36b758){var _0x3deb52=function(_0x2350d0){while(--_0x2350d0){_0x4c1df8['push'](_0x4c1df8['shift']());}};_0x3deb52(++_0x36b758);}(_0x10d1,0xec));var _0x110d=function(_0x717974,_0x24b354){_0x717974=_0x717974-0x0;var _0x4b38fa=_0x10d1[_0x717974];return _0x4b38fa;};'use strict';var client=require(_0x110d('0x0'));exports[_0x110d('0x1')]=function(){return function(){return client[_0x110d('0x2')](_0x110d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x110d('0x4'),_0x110d('0x5'),_0x110d('0x6'),_0x110d('0x7'),_0x110d('0x8'),'dialActive','dialMethod',_0x110d('0x9'),_0x110d('0xa'),_0x110d('0xb'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x110d('0xc'),'dialOriginateCallerIdNumber',_0x110d('0xd'),_0x110d('0xe'),_0x110d('0xf'),'dialQueueProject',_0x110d('0x10'),_0x110d('0x11'),'dialBusyMaxRetry',_0x110d('0x12'),_0x110d('0x13'),_0x110d('0x14'),_0x110d('0x15'),_0x110d('0x16'),_0x110d('0x17'),_0x110d('0x18'),'dialCheckDuplicateType',_0x110d('0x19'),_0x110d('0x1a'),_0x110d('0x1b'),_0x110d('0x1c'),_0x110d('0x1d'),_0x110d('0x1e'),_0x110d('0x1f'),_0x110d('0x20'),'dialAMDSilenceThreshold',_0x110d('0x21'),'timeout',_0x110d('0x22'),_0x110d('0x23'),_0x110d('0x24'),_0x110d('0x25'),'dialAgiAfterHangupClient','dialQueueProject2','monitor_format',_0x110d('0x26'),_0x110d('0x27'),_0x110d('0x28'),_0x110d('0x29'),_0x110d('0x2a'),'dialDropMaxRetry',_0x110d('0x2b'),_0x110d('0x2c'),_0x110d('0x2d'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x110d('0x2e'),_0x110d('0x2f'),_0x110d('0x30'),'dialPredictiveIntervalMaxThreshold',_0x110d('0x31'),_0x110d('0x32'),_0x110d('0x33')],'include':[{'model':_0x110d('0x34'),'as':_0x110d('0x34'),'attributes':['id',_0x110d('0x35'),'callerid',_0x110d('0x36')]},{'model':_0x110d('0x37'),'as':'mandatoryDispositionPause','attributes':['id',_0x110d('0x35')]},{'model':_0x110d('0x34'),'as':_0x110d('0x38'),'attributes':['id',_0x110d('0x35'),_0x110d('0x39'),'active']},{'model':'Interval','as':_0x110d('0x3a'),'attributes':['id',_0x110d('0x35')],'include':[{'model':_0x110d('0x3a'),'as':_0x110d('0x3b'),'attributes':['id','name',_0x110d('0x3c')]}]}]},'log':_0x110d('0x1')});};}; \ No newline at end of file +var _0xe0d8=['dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','name','TrunkBackup','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xe0d8,0xfd));var _0x8e0d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xe0d8[_0x51020b];return _0x371e47;};'use strict';var client=require('../client');exports[_0x8e0d('0x0')]=function(){return function(){return client[_0x8e0d('0x1')](_0x8e0d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8e0d('0x3'),_0x8e0d('0x4'),_0x8e0d('0x5'),_0x8e0d('0x6'),_0x8e0d('0x7'),_0x8e0d('0x8'),_0x8e0d('0x9'),'dialLimitChannel',_0x8e0d('0xa'),_0x8e0d('0xb'),_0x8e0d('0xc'),_0x8e0d('0xd'),_0x8e0d('0xe'),_0x8e0d('0xf'),_0x8e0d('0x10'),_0x8e0d('0x11'),_0x8e0d('0x12'),'dialQueueTimeout',_0x8e0d('0x13'),_0x8e0d('0x14'),_0x8e0d('0x15'),'dialBusyMaxRetry',_0x8e0d('0x16'),'dialNoAnswerMaxRetry',_0x8e0d('0x17'),_0x8e0d('0x18'),'dialTimezone',_0x8e0d('0x19'),_0x8e0d('0x1a'),_0x8e0d('0x1b'),_0x8e0d('0x1c'),_0x8e0d('0x1d'),_0x8e0d('0x1e'),_0x8e0d('0x1f'),_0x8e0d('0x20'),_0x8e0d('0x21'),_0x8e0d('0x22'),'dialAMDMaximumNumberOfWords',_0x8e0d('0x23'),_0x8e0d('0x24'),'timeout',_0x8e0d('0x25'),_0x8e0d('0x26'),_0x8e0d('0x27'),'dialAgiAfterHangupAgent',_0x8e0d('0x28'),_0x8e0d('0x29'),'monitor_format',_0x8e0d('0x2a'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x8e0d('0x2b'),_0x8e0d('0x2c'),_0x8e0d('0x2d'),_0x8e0d('0x2e'),'dialAbandonedMaxRetry',_0x8e0d('0x2f'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x8e0d('0x30'),_0x8e0d('0x31'),_0x8e0d('0x32'),'dialPredictiveIntervalMaxThreshold',_0x8e0d('0x33'),'dialPreviewAutoRecallMe',_0x8e0d('0x34')],'include':[{'model':_0x8e0d('0x35'),'as':_0x8e0d('0x35'),'attributes':['id','name',_0x8e0d('0x36'),_0x8e0d('0x37')]},{'model':_0x8e0d('0x38'),'as':'mandatoryDispositionPause','attributes':['id',_0x8e0d('0x39')]},{'model':_0x8e0d('0x35'),'as':_0x8e0d('0x3a'),'attributes':['id',_0x8e0d('0x39'),_0x8e0d('0x36'),_0x8e0d('0x37')]},{'model':'Interval','as':_0x8e0d('0x3b'),'attributes':['id',_0x8e0d('0x39')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8e0d('0x39'),_0x8e0d('0x3c')]}]}]},'log':_0x8e0d('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 2031290..035d6b6 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(_0x527ba6,_0x436856){var _0x4fc507=function(_0x4d91f4){while(--_0x4d91f4){_0x527ba6['push'](_0x527ba6['shift']());}};_0x4fc507(++_0x436856);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x362f4a,_0x3f7743){var _0x34862d=function(_0x3f198f){while(--_0x3f198f){_0x362f4a['push'](_0x362f4a['shift']());}};_0x34862d(++_0x3f7743);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 1139808..4f69aef 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 _0x1f70=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x1f70,0x1a3));var _0x01f7=function(_0x1ebc0f,_0x12171a){_0x1ebc0f=_0x1ebc0f-0x0;var _0x5d9cbd=_0x1f70[_0x1ebc0f];return _0x5d9cbd;};'use strict';var client=require('../client');exports[_0x01f7('0x0')]=function(_0x988cbb){return function(){return client[_0x01f7('0x1')](_0x01f7('0x2'),{'options':{'where':{'VoiceQueueId':_0x988cbb,'paused':!![]},'raw':!![]},'log':_0x01f7('0x0')});};}; \ No newline at end of file +var _0x7a60=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0xccef9a,_0x12ce6e){var _0x315f64=function(_0x58c2a3){while(--_0x58c2a3){_0xccef9a['push'](_0xccef9a['shift']());}};_0x315f64(++_0x12ce6e);}(_0x7a60,0x8c));var _0x07a6=function(_0x613e8d,_0x20b70f){_0x613e8d=_0x613e8d-0x0;var _0x41c469=_0x7a60[_0x613e8d];return _0x41c469;};'use strict';var client=require(_0x07a6('0x0'));exports[_0x07a6('0x1')]=function(_0x201315){return function(){return client['Request'](_0x07a6('0x2'),{'options':{'where':{'VoiceQueueId':_0x201315,'paused':!![]},'raw':!![]},'log':_0x07a6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 50b7f6b..8222759 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x413eb2,_0x6d4001){var _0x2cd538=function(_0x12c8d0){while(--_0x12c8d0){_0x413eb2['push'](_0x413eb2['shift']());}};_0x2cd538(++_0x6d4001);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x28c3d1,_0x14c672){var _0x20cf1f=function(_0x21a5a1){while(--_0x21a5a1){_0x28c3d1['push'](_0x28c3d1['shift']());}};_0x20cf1f(++_0x14c672);}(_0x7a54,0x106));var _0x47a5=function(_0x37b684,_0x1797ff){_0x37b684=_0x37b684-0x0;var _0x1320c0=_0x7a54[_0x37b684];return _0x1320c0;};'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 90d75ed..8b28845 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 _0x0580=['transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','Request','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode'];(function(_0x5b67a3,_0x17f056){var _0x4a71d8=function(_0x48b775){while(--_0x48b775){_0x5b67a3['push'](_0x5b67a3['shift']());}};_0x4a71d8(++_0x17f056);}(_0x0580,0xe6));var _0x0058=function(_0x580d7f,_0x380a5a){_0x580d7f=_0x580d7f-0x0;var _0x4d5d9b=_0x0580[_0x580d7f];return _0x4d5d9b;};'use strict';var client=require(_0x0058('0x0'));exports['transfers']={};exports[_0x0058('0x1')]=function(_0x584d63){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x584d63[_0x0058('0x2')],'transfererchannel':_0x584d63[_0x0058('0x3')],'transferercalleridnum':_0x584d63['transferercalleridnum'],'transferercalleridname':_0x584d63[_0x0058('0x4')],'transfererconnectedlinenum':_0x584d63[_0x0058('0x5')],'transfererconnectedlinename':_0x584d63[_0x0058('0x6')],'transfereraccountcode':_0x584d63[_0x0058('0x7')],'transferercontext':_0x584d63['transferercontext'],'transfererexten':_0x584d63[_0x0058('0x8')],'transfererlinkedid':_0x584d63['transfererlinkedid'],'transfereechannel':_0x584d63['transfereechannel'],'transfereecalleridnum':_0x584d63[_0x0058('0x9')],'transfereecalleridname':_0x584d63[_0x0058('0xa')],'transfereeconnectedlinenum':_0x584d63['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x584d63[_0x0058('0xb')],'transfereeaccountcode':_0x584d63['transfereeaccountcode'],'transfereecontext':_0x584d63['transfereecontext'],'transfereeexten':_0x584d63['transfereeexten'],'transfereelinkedid':_0x584d63[_0x0058('0xc')],'isexternal':_0x584d63[_0x0058('0xd')],'context':_0x584d63[_0x0058('0xe')],'extension':_0x584d63[_0x0058('0xf')],'type':_0x0058('0x10')},'log':_0x0058('0x11')});};exports[_0x0058('0x12')]=function(_0x1486be){return client[_0x0058('0x13')]('CreateVoiceTransferReport',{'body':{'result':_0x1486be['result'],'transfererchannel':_0x1486be['origtransfererchannel'],'transferercalleridnum':_0x1486be['origtransferercalleridnum'],'transferercalleridname':_0x1486be[_0x0058('0x14')],'transfererconnectedlinenum':_0x1486be['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1486be[_0x0058('0x15')],'transfereraccountcode':_0x1486be[_0x0058('0x16')],'transferercontext':_0x1486be[_0x0058('0x17')],'transfererexten':_0x1486be['secondtransfererexten'],'transfererlinkedid':_0x1486be[_0x0058('0x18')],'transfereechannel':_0x1486be[_0x0058('0x19')],'transfereecalleridnum':_0x1486be[_0x0058('0x1a')],'transfereecalleridname':_0x1486be['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1486be['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1486be[_0x0058('0x1b')],'transfereeaccountcode':_0x1486be['transfertargetaccountcode'],'transfereecontext':_0x1486be[_0x0058('0x1c')],'transfereeexten':_0x1486be[_0x0058('0x1d')],'transfereelinkedid':_0x1486be[_0x0058('0x1e')],'isexternal':_0x1486be[_0x0058('0xd')],'context':_0x1486be[_0x0058('0x1f')],'extension':_0x1486be[_0x0058('0x20')],'type':_0x0058('0x21')},'log':_0x0058('0x11')});}; \ No newline at end of file +var _0xb55e=['origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer'];(function(_0x1a711e,_0x173c1d){var _0x3934a2=function(_0x2b8b11){while(--_0x2b8b11){_0x1a711e['push'](_0x1a711e['shift']());}};_0x3934a2(++_0x173c1d);}(_0xb55e,0xc8));var _0xeb55=function(_0x48989f,_0x26504b){_0x48989f=_0x48989f-0x0;var _0x16797d=_0xb55e[_0x48989f];return _0x16797d;};'use strict';var client=require(_0xeb55('0x0'));exports['transfers']={};exports[_0xeb55('0x1')]=function(_0x20ec02){return client[_0xeb55('0x2')](_0xeb55('0x3'),{'body':{'result':_0x20ec02[_0xeb55('0x4')],'transfererchannel':_0x20ec02[_0xeb55('0x5')],'transferercalleridnum':_0x20ec02['transferercalleridnum'],'transferercalleridname':_0x20ec02['transferercalleridname'],'transfererconnectedlinenum':_0x20ec02[_0xeb55('0x6')],'transfererconnectedlinename':_0x20ec02[_0xeb55('0x7')],'transfereraccountcode':_0x20ec02[_0xeb55('0x8')],'transferercontext':_0x20ec02[_0xeb55('0x9')],'transfererexten':_0x20ec02['transfererexten'],'transfererlinkedid':_0x20ec02['transfererlinkedid'],'transfereechannel':_0x20ec02['transfereechannel'],'transfereecalleridnum':_0x20ec02[_0xeb55('0xa')],'transfereecalleridname':_0x20ec02[_0xeb55('0xb')],'transfereeconnectedlinenum':_0x20ec02[_0xeb55('0xc')],'transfereeconnectedlinename':_0x20ec02[_0xeb55('0xd')],'transfereeaccountcode':_0x20ec02[_0xeb55('0xe')],'transfereecontext':_0x20ec02[_0xeb55('0xf')],'transfereeexten':_0x20ec02['transfereeexten'],'transfereelinkedid':_0x20ec02[_0xeb55('0x10')],'isexternal':_0x20ec02[_0xeb55('0x11')],'context':_0x20ec02[_0xeb55('0x12')],'extension':_0x20ec02[_0xeb55('0x13')],'type':_0xeb55('0x14')},'log':_0xeb55('0x3')});};exports[_0xeb55('0x15')]=function(_0x2844dd){return client[_0xeb55('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x2844dd[_0xeb55('0x4')],'transfererchannel':_0x2844dd[_0xeb55('0x16')],'transferercalleridnum':_0x2844dd[_0xeb55('0x17')],'transferercalleridname':_0x2844dd[_0xeb55('0x18')],'transfererconnectedlinenum':_0x2844dd[_0xeb55('0x19')],'transfererconnectedlinename':_0x2844dd['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2844dd['origtransfereraccountcode'],'transferercontext':_0x2844dd[_0xeb55('0x1a')],'transfererexten':_0x2844dd['secondtransfererexten'],'transfererlinkedid':_0x2844dd['origtransfererlinkedid'],'transfereechannel':_0x2844dd[_0xeb55('0x1b')],'transfereecalleridnum':_0x2844dd[_0xeb55('0x1c')],'transfereecalleridname':_0x2844dd[_0xeb55('0x1d')],'transfereeconnectedlinenum':_0x2844dd['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2844dd[_0xeb55('0x1e')],'transfereeaccountcode':_0x2844dd[_0xeb55('0x1f')],'transfereecontext':_0x2844dd[_0xeb55('0x20')],'transfereeexten':_0x2844dd[_0xeb55('0x21')],'transfereelinkedid':_0x2844dd['transfertargetlinkedid'],'isexternal':_0x2844dd[_0xeb55('0x11')],'context':_0x2844dd[_0xeb55('0x22')],'extension':_0x2844dd[_0xeb55('0x23')],'type':_0xeb55('0x24')},'log':_0xeb55('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index bbde725..a40f73f 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 _0x2bd8=['/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','outbound','includes','type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','queueChannels','voicequeuechannelhangup','Redirect','context','telephones','trunks','outboundChannels','event','Event\x20name\x20mandatory','emit','custom:','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','format','timers','timer','agents','pause','isConnected','error','asterisk','username','join','keys','reload','module','action','Reload','Action','then','message','catch','ami\x20disconnected','pick','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','values','channels','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors'];(function(_0x15b33d,_0x3a17b0){var _0x3b09b6=function(_0xe5870e){while(--_0xe5870e){_0x15b33d['push'](_0x15b33d['shift']());}};_0x3b09b6(++_0x3a17b0);}(_0x2bd8,0x130));var _0x82bd=function(_0x3c57de,_0x1cff78){_0x3c57de=_0x3c57de-0x0;var _0x490977=_0x2bd8[_0x3c57de];return _0x490977;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var jayson=require(_0x82bd('0x1'));var schema=require(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var config=require(_0x82bd('0x4'));var properties=require(_0x82bd('0x5'));var ami=require(_0x82bd('0x6'));var VoiceQueueSummary=require(_0x82bd('0x7'));exports['listen']=function(_0x41584e,_0x2e1a98,_0x3bf810){return new Promise(function(_0x5ceb60,_0x19dbb1){var _0x77d7a9={'QueuePause':function(_0x226f60){return new Promise(function(_0x1f7463){var _0x4dc3a6=util[_0x82bd('0x8')]('%s/%s','SIP',_0x226f60['name']);if(_0x41584e[_0x82bd('0x9')]&&_0x41584e['timers'][_0x4dc3a6]&&_0x41584e['timers'][_0x4dc3a6][_0x82bd('0xa')]){_0x41584e['timers'][_0x4dc3a6]['updateAcw']();}if(_0x41584e[_0x82bd('0xb')][_0x4dc3a6]){_0x41584e[_0x82bd('0xb')][_0x4dc3a6]['updateStatusRealtime']({'statePause':_0x226f60[_0x82bd('0xc')]?!![]:![]});}_0x1f7463({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0xfaccf7){var _0x51e17e=this;return new Promise(function(_0x338bb4,_0x3c4042){if(ami[_0x82bd('0xd')]()==![]){return _0x3c4042(_0x51e17e[_0x82bd('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],'ami\x20disconnected'][_0x82bd('0x11')]('\x20')));}_0xfaccf7=_['pick'](_0xfaccf7,_[_0x82bd('0x12')](properties[_0x82bd('0x13')][_0x82bd('0x14')]));_0xfaccf7[_0x82bd('0x15')]=_0x82bd('0x16');return ami[_0x82bd('0x17')](_0xfaccf7)[_0x82bd('0x18')](function(_0xb7a986){_0x338bb4({'code':0xc8,'message':_0xb7a986[_0x82bd('0x19')]});})[_0x82bd('0x1a')](function(_0x390107){_0x3c4042(_0x51e17e[_0x82bd('0xe')](0x1f5,_0x390107[_0x82bd('0x19')]));});});},'Command':function(_0x253741){var _0x4a1e62=this;return new Promise(function(_0x5688ed,_0x283ce7){if(ami[_0x82bd('0xd')]()==![]){return _0x283ce7(_0x4a1e62[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}_0x253741=_[_0x82bd('0x1c')](_0x253741,_0x82bd('0x1d'));_0x253741[_0x82bd('0x15')]=_0x82bd('0x1e');return ami[_0x82bd('0x17')](_0x253741)[_0x82bd('0x18')](function(_0x3d9f03){_0x5688ed({'code':0xc8,'message':_0x3d9f03[_0x82bd('0x1f')]});})[_0x82bd('0x1a')](function(_0x3b6b93){_0x283ce7(_0x4a1e62[_0x82bd('0xe')](0x1f5,_0x3b6b93['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x4b3215){var _0x4248be=[];for(var _0x436ecd in _0x41584e[_0x82bd('0x20')]){if(_0x41584e[_0x82bd('0x20')][_0x82bd('0x21')](_0x436ecd)){var _0x10d101=_0x41584e[_0x82bd('0x20')][_0x436ecd];var _0xbef23b=new VoiceQueueSummary(_0x10d101);_0x4248be[_0x82bd('0x22')](_0xbef23b);}}_0x4b3215({'count':_0x4248be[_0x82bd('0x23')],'rows':_0x4248be});});},'UpdateVoiceQueue':function(_0x53a2a6){return new Promise(function(_0x5bd22f,_0x5609b7){var _0x5d1015=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x20')],{'id':parseInt(_0x53a2a6['id'])});var _0x351d3d=_[_0x82bd('0x25')](_0x53a2a6,['id']);if(_0x5d1015){for(var _0x363ef9 in _0x351d3d){if(typeof _0x351d3d[_0x363ef9]!=='undefined'&&typeof _0x5d1015[_0x363ef9]!=='undefined'){_0x5d1015[_0x363ef9]=_0x351d3d[_0x363ef9];}}_0x5bd22f(_0x5d1015);}else{_0x5609b7();}});},'VoiceChannels':function(){return new Promise(function(_0x5b21ce){var _0x1e6866=_[_0x82bd('0x26')](_0x41584e[_0x82bd('0x27')]);_0x5b21ce({'count':_0x1e6866['length'],'rows':_0x1e6866});});},'VoiceChannelMixMonitor':function(_0x166c46){var _0x4f209e=this;return new Promise(function(_0x9cc69b,_0x1a1e24){if(ami[_0x82bd('0xd')]()==![]){return _0x1a1e24(_0x4f209e[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')]['username'],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}var _0x3a7d07=schema(properties['voicechannel'])[_0x82bd('0x2')](_0x166c46);if(_0x3a7d07['length']>0x0){return _0x1a1e24(_0x4f209e['error'](0x1f4,_[_0x82bd('0x28')](_0x3a7d07,_0x82bd('0x19'))[_0x82bd('0x11')](',\x20')));}var _0x44e1d9=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x27')],{'uniqueid':_0x166c46[_0x82bd('0x29')]});if(_0x44e1d9&&_0x44e1d9[_0x82bd('0x2a')]){var _0x42dc7f=util[_0x82bd('0x8')](_0x82bd('0x2b'),_0x166c46[_0x82bd('0x2c')]||_0x166c46[_0x82bd('0x29')],_0x166c46[_0x82bd('0x8')]||_0x82bd('0x2d'));return ami[_0x82bd('0x17')]({'action':_0x82bd('0x2e'),'channel':_0x44e1d9['channel'],'file':_0x42dc7f,'options':'ai(mixmonitorid)'})['then'](function(_0x3fea10){var _0x4420dc=_['find'](_0x44e1d9[_0x82bd('0x2f')],{'filename':'/var/spool/asterisk/monitor/'+_0x42dc7f['toLowerCase']()});if(_['isNil'](_0x4420dc)){_0x44e1d9[_0x82bd('0x2f')][_0x82bd('0x22')]({'filename':_0x82bd('0x30')+_0x42dc7f[_0x82bd('0x31')](),'createdAt':moment()[_0x82bd('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3fea10['mixmonitorid'],'status':'rec'});}else{_0x4420dc[_0x82bd('0x32')]=_0x3fea10['mixmonitorid'];_0x4420dc['status']=_0x82bd('0x33');}_0x9cc69b({'code':0xc8,'message':[_0x166c46[_0x82bd('0x29')],_0x82bd('0x34'),_0x3fea10[_0x82bd('0x32')]][_0x82bd('0x11')]('\x20'),'mixmonitorid':_0x3fea10[_0x82bd('0x32')]});})[_0x82bd('0x1a')](function(_0x1f27f5){_0x1a1e24(_0x4f209e[_0x82bd('0xe')](0x1f5,[_0x166c46['uniqueid'],_0x1f27f5['message'][_0x82bd('0x31')]()][_0x82bd('0x11')]('\x20')));});}else{return _0x1a1e24(_0x4f209e['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x277b7a){var _0x18a697=this;return new Promise(function(_0x4d310b,_0x121f1f){if(ami[_0x82bd('0xd')]()==![]){return _0x121f1f(_0x18a697[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}var _0x21d7d4=schema(properties[_0x82bd('0x35')])[_0x82bd('0x2')](_0x277b7a);if(_0x21d7d4[_0x82bd('0x23')]>0x0){return _0x121f1f(_0x18a697['error'](0x1f4,_[_0x82bd('0x28')](_0x21d7d4,_0x82bd('0x19'))['join'](',\x20')));}var _0x5b736e=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x27')],{'uniqueid':_0x277b7a[_0x82bd('0x29')]});if(_0x5b736e){return Promise[_0x82bd('0x36')]()[_0x82bd('0x18')](function(){if(_0x5b736e['channel']){return ami['Action']({'action':_0x82bd('0x37'),'channel':_0x5b736e[_0x82bd('0x2a')],'mixmonitorid':_0x277b7a['mixmonitorid']})[_0x82bd('0x1a')](function(){});}})['then'](function(){if(_0x5b736e[_0x82bd('0x38')]){return ami[_0x82bd('0x17')]({'action':'StopMixMonitor','channel':_0x5b736e[_0x82bd('0x38')],'mixmonitorid':_0x277b7a[_0x82bd('0x32')]})['catch'](function(){});}})['then'](function(){var _0x403afe=_['find'](_0x5b736e[_0x82bd('0x2f')],{'mixmonitorid':_0x277b7a[_0x82bd('0x32')]});if(_0x403afe){_0x403afe[_0x82bd('0x39')]=_0x82bd('0x3a');}})['then'](function(){var _0x53fd25=util[_0x82bd('0x8')](_0x82bd('0x2b'),_0x277b7a['filename']||_0x277b7a[_0x82bd('0x29')],_0x277b7a[_0x82bd('0x8')]||_0x82bd('0x2d'));var _0x4d58af=_[_0x82bd('0x24')](_0x5b736e[_0x82bd('0x2f')],{'filename':_0x82bd('0x30')+_0x53fd25[_0x82bd('0x31')]()});if(_0x4d58af){_0x4d58af[_0x82bd('0x39')]=_0x82bd('0x3a');}})[_0x82bd('0x18')](function(){_0x4d310b({'code':0xc8,'message':[_0x277b7a[_0x82bd('0x29')],_0x82bd('0x3b')][_0x82bd('0x11')]('\x20')});})[_0x82bd('0x1a')](function(_0x1c7e47){_0x121f1f(_0x18a697[_0x82bd('0xe')](0x1f5,[_0x277b7a['uniqueid'],_0x1c7e47[_0x82bd('0x19')][_0x82bd('0x31')]()]['join']('\x20')));});}else{return _0x121f1f(_0x18a697[_0x82bd('0xe')](0x1f5,_0x82bd('0x3c')));}});},'VoiceQueuesChannels':function(_0x8dfe63){var _0x4237ef=this;return new Promise(function(_0x55a2e6){var _0x5b4fd2=_[_0x82bd('0x26')](_0x41584e['queueChannels']);var _0x49ec28={'count':_0x5b4fd2[_0x82bd('0x23')],'rows':_0x5b4fd2};if(_0x8dfe63&&_0x8dfe63['type']){if(!['inbound',_0x82bd('0x3d')][_0x82bd('0x3e')](_0x8dfe63[_0x82bd('0x3f')])){return _0x19dbb1(_0x4237ef[_0x82bd('0xe')](0x190,_0x82bd('0x40')));}var _0x1a7402=_[_0x82bd('0x41')](_0x5b4fd2,function(_0x11a7bb){return _0x11a7bb[_0x82bd('0x3f')]===_0x8dfe63[_0x82bd('0x3f')];});_0x49ec28[_0x82bd('0x42')]=_0x1a7402[_0x82bd('0x23')];_0x49ec28[_0x82bd('0x43')]=_0x1a7402;}_0x55a2e6(_0x49ec28);});},'VoiceQueuesChannel':function(_0x1a1cdc){var _0x265f88=this;return new Promise(function(_0x589ea4,_0x16599d){var _0x459021=schema(properties[_0x82bd('0x44')])[_0x82bd('0x2')](_0x1a1cdc);if(_0x459021[_0x82bd('0x23')]>0x0){return _0x16599d(_0x265f88['error'](0x1f4,_['map'](_0x459021,'message')['join'](',\x20')));}var _0x3b91fb=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x45')],{'uniqueid':_0x1a1cdc[_0x82bd('0x29')]});if(_0x3b91fb){_0x589ea4(_0x3b91fb);}else{return _0x16599d(_0x265f88['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x26621c){var _0x6ef12d=this;return new Promise(function(_0x28121a,_0x4d7fb4){if(ami[_0x82bd('0xd')]()==![]){return _0x4d7fb4(_0x6ef12d[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}var _0x28b2be=schema(properties[_0x82bd('0x46')])[_0x82bd('0x2')](_0x26621c);if(_0x28b2be[_0x82bd('0x23')]>0x0){return _0x4d7fb4(_0x6ef12d[_0x82bd('0xe')](0x1f4,_[_0x82bd('0x28')](_0x28b2be,_0x82bd('0x19'))[_0x82bd('0x11')](',\x20')));}var _0x202477=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x45')],{'uniqueid':_0x26621c['uniqueid']});if(_0x202477&&_0x202477[_0x82bd('0x2a')]){return ami['Action']({'action':'Hangup','channel':_0x202477[_0x82bd('0x2a')]})['then'](function(_0x306247){_0x28121a({'code':0xc8,'message':[_0x26621c[_0x82bd('0x29')],_0x306247[_0x82bd('0x19')][_0x82bd('0x31')]()][_0x82bd('0x11')]('\x20')});})[_0x82bd('0x1a')](function(_0x39385f){_0x4d7fb4(_0x6ef12d[_0x82bd('0xe')](0x1f5,[_0x26621c[_0x82bd('0x29')],_0x39385f[_0x82bd('0x19')][_0x82bd('0x31')]()]['join']('\x20')));});}else{return _0x4d7fb4(_0x6ef12d['error'](0x1f5,_0x82bd('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0xd283d9){var _0x513e1d=this;return new Promise(function(_0x47d136,_0x227a08){if(ami[_0x82bd('0xd')]()==![]){return _0x227a08(_0x513e1d[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config['asterisk'][_0x82bd('0x10')],'ami\x20disconnected'][_0x82bd('0x11')]('\x20')));}var _0x6ff77c=schema(properties['voicequeuechannelredirect'])[_0x82bd('0x2')](_0xd283d9);if(_0x6ff77c[_0x82bd('0x23')]>0x0){return _0x227a08(_0x513e1d[_0x82bd('0xe')](0x1f4,_[_0x82bd('0x28')](_0x6ff77c,'message')[_0x82bd('0x11')](',\x20')));}var _0x5dc55=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x45')],{'uniqueid':_0xd283d9[_0x82bd('0x29')]});if(_0x5dc55&&_0x5dc55[_0x82bd('0x2a')]){return ami[_0x82bd('0x17')]({'action':_0x82bd('0x47'),'channel':_0x5dc55[_0x82bd('0x2a')],'exten':_0xd283d9['exten'],'context':_0xd283d9[_0x82bd('0x48')]||_0x5dc55['context'],'priority':0x1})['then'](function(_0x31b50e){_0x47d136({'code':0xc8,'message':[_0xd283d9[_0x82bd('0x29')],_0x31b50e['message'][_0x82bd('0x31')]()]['join']('\x20')});})[_0x82bd('0x1a')](function(_0x4f53a1){_0x227a08(_0x513e1d['error'](0x1f5,[_0xd283d9[_0x82bd('0x29')],_0x4f53a1[_0x82bd('0x19')]['toLowerCase']()]['join']('\x20')));});}else{return _0x227a08(_0x513e1d['error'](0x1f5,_0x82bd('0x3c')));}});},'Agents':function(_0x320559){return new Promise(function(_0x513b9c){var _0x1e9df2=_[_0x82bd('0x26')](_0x41584e['agents']);if(_0x320559&&_0x320559['id']){var _0x5591af=_[_0x82bd('0x24')](_0x1e9df2,function(_0x5357c4){return _0x5357c4['id']===_0x320559['id'];});_0x513b9c(_0x5591af);}else{_0x513b9c({'count':_0x1e9df2['length'],'rows':_0x1e9df2});}});},'Telephones':function(){return new Promise(function(_0x308b8e){var _0x130dc5=_[_0x82bd('0x26')](_0x41584e[_0x82bd('0x49')]);_0x308b8e({'count':_0x130dc5[_0x82bd('0x23')],'rows':_0x130dc5});});},'Trunks':function(){return new Promise(function(_0x537fdf){var _0xeeb228=_['values'](_0x41584e[_0x82bd('0x4a')]);_0x537fdf({'count':_0xeeb228['length'],'rows':_0xeeb228});});},'OutboundChannels':function(){return new Promise(function(_0x2fbf08){var _0x4e1d32=_['values'](_0x41584e[_0x82bd('0x4b')]);_0x2fbf08({'count':_0x4e1d32[_0x82bd('0x23')],'rows':_0x4e1d32});});},'Outbound':function(){return new Promise(function(_0x4c1136){_0x4c1136(_0x41584e[_0x82bd('0x3d')]);});},'Campaigns':function(){return new Promise(function(_0x15a849){var _0x16acb7=_['values'](_0x41584e['campaigns']);_0x15a849({'count':_0x16acb7[_0x82bd('0x23')],'rows':_0x16acb7});});},'VoiceQueuesPreview':function(_0x3c476d){var _0x528742=this;return new Promise(function(_0x222f9d,_0x26f0a2){_0x2e1a98['run'](_0x3c476d['id'])[_0x82bd('0x18')](function(_0x68653b){_0x222f9d({'code':0xc8,'message':_0x68653b[_0x82bd('0x19')]});})[_0x82bd('0x1a')](function(_0x3af021){_0x26f0a2(_0x528742[_0x82bd('0xe')](0x1f4,_0x3af021['message']));});});},'EventManager':function(_0x12cb53){var _0x11fa86=this;return new Promise(function(_0x12bc87,_0x4b91c6){if(!_0x12cb53[_0x82bd('0x4c')]){return _0x4b91c6(_0x11fa86['error'](0x1f4,_0x82bd('0x4d')));}ami[_0x82bd('0x4e')](_0x82bd('0x4f')+_0x12cb53[_0x82bd('0x4c')],_0x12cb53[_0x82bd('0x19')]);_0x12bc87({'code':0xc8,'message':_0x12cb53});});},'FaxAccounts':function(){return new Promise(function(_0x5de4dc){var _0x1177de=_[_0x82bd('0x26')](_0x41584e['faxAccounts']);_0x5de4dc({'count':_0x1177de[_0x82bd('0x23')],'rows':_0x1177de});});},'SendFax':function(_0x12dbeb){var _0x57858b=this;return new Promise(function(_0x38314e,_0x3d9a3e){_0x3bf810[_0x82bd('0x50')](_0x12dbeb)['then'](function(_0x533c42){_0x38314e({'code':0xc8,'message':_0x533c42[_0x82bd('0x19')]});})[_0x82bd('0x1a')](function(_0x3346c5){_0x3d9a3e(_0x57858b['error'](0x1f4,_0x3346c5[_0x82bd('0x19')]));});});},'CheckAfterSend':function(_0x4721c3){var _0x116fb6=this;return new Promise(function(_0x4f1ddb,_0x5d6291){_0x3bf810['checkAfterSend'](_0x4721c3)['then'](function(_0x437463){_0x4f1ddb({'code':0xc8,'message':_0x437463[_0x82bd('0x19')]});})['catch'](function(_0x35d111){_0x5d6291(_0x116fb6['error'](0x1f4,_0x35d111[_0x82bd('0x19')]));});});}};var _0x4a08d7=jayson[_0x82bd('0x51')](_0x77d7a9)[_0x82bd('0x52')]();_0x4a08d7['on'](_0x82bd('0xe'),function(_0x5ed3fb){return _0x19dbb1(_0x5ed3fb);});_0x4a08d7[_0x82bd('0x53')](0x232a,_0x82bd('0x54'),function(){console[_0x82bd('0x55')](_0x82bd('0x56'),0x232a);return _0x5ceb60(_0x82bd('0x57')+0x232a);});});}; \ No newline at end of file +var _0x5ad3=['action','Action','then','message','catch','ami\x20disconnected','pick','command','Command','content','voiceQueues','push','length','find','omit','values','channels','format','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','StopMixMonitor','destinationchannel','queueChannels','type','inbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','outbound','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','%s/%s','timers','timer','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','join','reload','module'];(function(_0xfc5aca,_0x12da42){var _0x1e2f94=function(_0x207736){while(--_0x207736){_0xfc5aca['push'](_0xfc5aca['shift']());}};_0x1e2f94(++_0x12da42);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x82f586,_0x382c19){_0x82f586=_0x82f586-0x0;var _0x591ec8=_0x5ad3[_0x82f586];return _0x591ec8;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var jayson=require(_0x35ad('0x2'));var schema=require(_0x35ad('0x3'));var moment=require('moment');var config=require(_0x35ad('0x4'));var properties=require(_0x35ad('0x5'));var ami=require(_0x35ad('0x6'));var VoiceQueueSummary=require(_0x35ad('0x7'));exports[_0x35ad('0x8')]=function(_0x1fed0d,_0x729a01,_0x436dcb){return new Promise(function(_0x36c606,_0x31cc6a){var _0x4edc59={'QueuePause':function(_0x292521){return new Promise(function(_0x3cec3e){var _0x3f1f55=util['format'](_0x35ad('0x9'),'SIP',_0x292521['name']);if(_0x1fed0d[_0x35ad('0xa')]&&_0x1fed0d[_0x35ad('0xa')][_0x3f1f55]&&_0x1fed0d['timers'][_0x3f1f55][_0x35ad('0xb')]){_0x1fed0d[_0x35ad('0xa')][_0x3f1f55]['updateAcw']();}if(_0x1fed0d['agents'][_0x3f1f55]){_0x1fed0d[_0x35ad('0xc')][_0x3f1f55][_0x35ad('0xd')]({'statePause':_0x292521['pause']?!![]:![]});}_0x3cec3e({'code':0xc8,'message':_0x35ad('0xe')});});},'Reload':function(_0x33e2ec){var _0x595fe8=this;return new Promise(function(_0x4f64d0,_0x5ba1aa){if(ami[_0x35ad('0xf')]()==![]){return _0x5ba1aa(_0x595fe8[_0x35ad('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x35ad('0x11')][_0x35ad('0x12')],'ami\x20disconnected'][_0x35ad('0x13')]('\x20')));}_0x33e2ec=_['pick'](_0x33e2ec,_['keys'](properties[_0x35ad('0x14')][_0x35ad('0x15')]));_0x33e2ec[_0x35ad('0x16')]='Reload';return ami[_0x35ad('0x17')](_0x33e2ec)[_0x35ad('0x18')](function(_0x233394){_0x4f64d0({'code':0xc8,'message':_0x233394[_0x35ad('0x19')]});})[_0x35ad('0x1a')](function(_0x418416){_0x5ba1aa(_0x595fe8['error'](0x1f5,_0x418416[_0x35ad('0x19')]));});});},'Command':function(_0x2876ad){var _0x574557=this;return new Promise(function(_0x53b8e3,_0x3251d9){if(ami[_0x35ad('0xf')]()==![]){return _0x3251d9(_0x574557['error'](0x1f4,[config[_0x35ad('0x11')]['ip'],config[_0x35ad('0x11')]['username'],_0x35ad('0x1b')][_0x35ad('0x13')]('\x20')));}_0x2876ad=_[_0x35ad('0x1c')](_0x2876ad,_0x35ad('0x1d'));_0x2876ad[_0x35ad('0x16')]=_0x35ad('0x1e');return ami[_0x35ad('0x17')](_0x2876ad)[_0x35ad('0x18')](function(_0x2fb296){_0x53b8e3({'code':0xc8,'message':_0x2fb296[_0x35ad('0x1f')]});})['catch'](function(_0x1cb9da){_0x3251d9(_0x574557[_0x35ad('0x10')](0x1f5,_0x1cb9da['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x43059e){var _0x6288a2=[];for(var _0xa3cb9f in _0x1fed0d[_0x35ad('0x20')]){if(_0x1fed0d[_0x35ad('0x20')]['hasOwnProperty'](_0xa3cb9f)){var _0x37e9bd=_0x1fed0d[_0x35ad('0x20')][_0xa3cb9f];var _0x3dc3c4=new VoiceQueueSummary(_0x37e9bd);_0x6288a2[_0x35ad('0x21')](_0x3dc3c4);}}_0x43059e({'count':_0x6288a2[_0x35ad('0x22')],'rows':_0x6288a2});});},'UpdateVoiceQueue':function(_0x20a682){return new Promise(function(_0x2e601a,_0xaf7237){var _0x5418c2=_[_0x35ad('0x23')](_0x1fed0d[_0x35ad('0x20')],{'id':parseInt(_0x20a682['id'])});var _0x2f8b3=_[_0x35ad('0x24')](_0x20a682,['id']);if(_0x5418c2){for(var _0x2c82f1 in _0x2f8b3){if(typeof _0x2f8b3[_0x2c82f1]!=='undefined'&&typeof _0x5418c2[_0x2c82f1]!=='undefined'){_0x5418c2[_0x2c82f1]=_0x2f8b3[_0x2c82f1];}}_0x2e601a(_0x5418c2);}else{_0xaf7237();}});},'VoiceChannels':function(){return new Promise(function(_0x131d65){var _0x4a2366=_[_0x35ad('0x25')](_0x1fed0d['channels']);_0x131d65({'count':_0x4a2366['length'],'rows':_0x4a2366});});},'VoiceChannelMixMonitor':function(_0x589e4a){var _0x5380e5=this;return new Promise(function(_0x55906e,_0x5a60e1){if(ami['isConnected']()==![]){return _0x5a60e1(_0x5380e5[_0x35ad('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x35ad('0x11')]['username'],_0x35ad('0x1b')]['join']('\x20')));}var _0x412b6b=schema(properties['voicechannel'])[_0x35ad('0x3')](_0x589e4a);if(_0x412b6b[_0x35ad('0x22')]>0x0){return _0x5a60e1(_0x5380e5[_0x35ad('0x10')](0x1f4,_['map'](_0x412b6b,_0x35ad('0x19'))[_0x35ad('0x13')](',\x20')));}var _0x129710=_[_0x35ad('0x23')](_0x1fed0d[_0x35ad('0x26')],{'uniqueid':_0x589e4a['uniqueid']});if(_0x129710&&_0x129710['channel']){var _0x371518=util[_0x35ad('0x27')](_0x35ad('0x28'),_0x589e4a[_0x35ad('0x29')]||_0x589e4a['uniqueid'],_0x589e4a[_0x35ad('0x27')]||_0x35ad('0x2a'));return ami[_0x35ad('0x17')]({'action':_0x35ad('0x2b'),'channel':_0x129710[_0x35ad('0x2c')],'file':_0x371518,'options':_0x35ad('0x2d')})['then'](function(_0x58250d){var _0x658444=_[_0x35ad('0x23')](_0x129710[_0x35ad('0x2e')],{'filename':_0x35ad('0x2f')+_0x371518[_0x35ad('0x30')]()});if(_[_0x35ad('0x31')](_0x658444)){_0x129710[_0x35ad('0x2e')][_0x35ad('0x21')]({'filename':_0x35ad('0x2f')+_0x371518['toLowerCase'](),'createdAt':moment()[_0x35ad('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x58250d[_0x35ad('0x32')],'status':_0x35ad('0x33')});}else{_0x658444[_0x35ad('0x32')]=_0x58250d[_0x35ad('0x32')];_0x658444[_0x35ad('0x34')]=_0x35ad('0x33');}_0x55906e({'code':0xc8,'message':[_0x589e4a[_0x35ad('0x35')],_0x35ad('0x36'),_0x58250d[_0x35ad('0x32')]]['join']('\x20'),'mixmonitorid':_0x58250d[_0x35ad('0x32')]});})[_0x35ad('0x1a')](function(_0x406934){_0x5a60e1(_0x5380e5['error'](0x1f5,[_0x589e4a[_0x35ad('0x35')],_0x406934[_0x35ad('0x19')][_0x35ad('0x30')]()][_0x35ad('0x13')]('\x20')));});}else{return _0x5a60e1(_0x5380e5[_0x35ad('0x10')](0x1f5,_0x35ad('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x36784f){var _0x116ad6=this;return new Promise(function(_0x11de09,_0x429470){if(ami[_0x35ad('0xf')]()==![]){return _0x429470(_0x116ad6['error'](0x1f4,[config[_0x35ad('0x11')]['ip'],config['asterisk'][_0x35ad('0x12')],_0x35ad('0x1b')][_0x35ad('0x13')]('\x20')));}var _0x2dfee9=schema(properties[_0x35ad('0x38')])[_0x35ad('0x3')](_0x36784f);if(_0x2dfee9[_0x35ad('0x22')]>0x0){return _0x429470(_0x116ad6[_0x35ad('0x10')](0x1f4,_[_0x35ad('0x39')](_0x2dfee9,'message')[_0x35ad('0x13')](',\x20')));}var _0x253d02=_[_0x35ad('0x23')](_0x1fed0d[_0x35ad('0x26')],{'uniqueid':_0x36784f[_0x35ad('0x35')]});if(_0x253d02){return Promise['resolve']()[_0x35ad('0x18')](function(){if(_0x253d02[_0x35ad('0x2c')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x253d02[_0x35ad('0x2c')],'mixmonitorid':_0x36784f[_0x35ad('0x32')]})[_0x35ad('0x1a')](function(){});}})[_0x35ad('0x18')](function(){if(_0x253d02['destinationchannel']){return ami[_0x35ad('0x17')]({'action':_0x35ad('0x3a'),'channel':_0x253d02[_0x35ad('0x3b')],'mixmonitorid':_0x36784f[_0x35ad('0x32')]})[_0x35ad('0x1a')](function(){});}})[_0x35ad('0x18')](function(){var _0x3ea556=_['find'](_0x253d02[_0x35ad('0x2e')],{'mixmonitorid':_0x36784f[_0x35ad('0x32')]});if(_0x3ea556){_0x3ea556[_0x35ad('0x34')]='stop';}})['then'](function(){var _0x5644c4=util[_0x35ad('0x27')](_0x35ad('0x28'),_0x36784f[_0x35ad('0x29')]||_0x36784f[_0x35ad('0x35')],_0x36784f['format']||_0x35ad('0x2a'));var _0x46c462=_[_0x35ad('0x23')](_0x253d02[_0x35ad('0x2e')],{'filename':_0x35ad('0x2f')+_0x5644c4[_0x35ad('0x30')]()});if(_0x46c462){_0x46c462['status']='stop';}})[_0x35ad('0x18')](function(){_0x11de09({'code':0xc8,'message':[_0x36784f[_0x35ad('0x35')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x35ad('0x1a')](function(_0x104ff9){_0x429470(_0x116ad6[_0x35ad('0x10')](0x1f5,[_0x36784f['uniqueid'],_0x104ff9['message'][_0x35ad('0x30')]()][_0x35ad('0x13')]('\x20')));});}else{return _0x429470(_0x116ad6[_0x35ad('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0xf394c5){var _0xfed799=this;return new Promise(function(_0x34061c){var _0x467887=_[_0x35ad('0x25')](_0x1fed0d[_0x35ad('0x3c')]);var _0x53a536={'count':_0x467887[_0x35ad('0x22')],'rows':_0x467887};if(_0xf394c5&&_0xf394c5[_0x35ad('0x3d')]){if(![_0x35ad('0x3e'),'outbound'][_0x35ad('0x3f')](_0xf394c5[_0x35ad('0x3d')])){return _0x31cc6a(_0xfed799[_0x35ad('0x10')](0x190,_0x35ad('0x40')));}var _0x564a01=_['filter'](_0x467887,function(_0x19ae62){return _0x19ae62[_0x35ad('0x3d')]===_0xf394c5[_0x35ad('0x3d')];});_0x53a536[_0x35ad('0x41')]=_0x564a01[_0x35ad('0x22')];_0x53a536['rows']=_0x564a01;}_0x34061c(_0x53a536);});},'VoiceQueuesChannel':function(_0x25d816){var _0x39fa94=this;return new Promise(function(_0x45a7e2,_0xae2c85){var _0x3b8004=schema(properties[_0x35ad('0x42')])['validate'](_0x25d816);if(_0x3b8004['length']>0x0){return _0xae2c85(_0x39fa94[_0x35ad('0x10')](0x1f4,_[_0x35ad('0x39')](_0x3b8004,_0x35ad('0x19'))[_0x35ad('0x13')](',\x20')));}var _0x1043cd=_[_0x35ad('0x23')](_0x1fed0d[_0x35ad('0x3c')],{'uniqueid':_0x25d816['uniqueid']});if(_0x1043cd){_0x45a7e2(_0x1043cd);}else{return _0xae2c85(_0x39fa94[_0x35ad('0x10')](0x1f5,_0x35ad('0x37')));}});},'VoiceQueuesChannelHangup':function(_0xa8f927){var _0x2ee8f1=this;return new Promise(function(_0x522054,_0x12735e){if(ami[_0x35ad('0xf')]()==![]){return _0x12735e(_0x2ee8f1['error'](0x1f4,[config[_0x35ad('0x11')]['ip'],config[_0x35ad('0x11')][_0x35ad('0x12')],_0x35ad('0x1b')][_0x35ad('0x13')]('\x20')));}var _0x402b6b=schema(properties[_0x35ad('0x43')])[_0x35ad('0x3')](_0xa8f927);if(_0x402b6b['length']>0x0){return _0x12735e(_0x2ee8f1[_0x35ad('0x10')](0x1f4,_[_0x35ad('0x39')](_0x402b6b,_0x35ad('0x19'))['join'](',\x20')));}var _0x18801c=_['find'](_0x1fed0d[_0x35ad('0x3c')],{'uniqueid':_0xa8f927[_0x35ad('0x35')]});if(_0x18801c&&_0x18801c[_0x35ad('0x2c')]){return ami[_0x35ad('0x17')]({'action':'Hangup','channel':_0x18801c[_0x35ad('0x2c')]})[_0x35ad('0x18')](function(_0x3e99f4){_0x522054({'code':0xc8,'message':[_0xa8f927[_0x35ad('0x35')],_0x3e99f4[_0x35ad('0x19')]['toLowerCase']()][_0x35ad('0x13')]('\x20')});})['catch'](function(_0xd4766f){_0x12735e(_0x2ee8f1[_0x35ad('0x10')](0x1f5,[_0xa8f927['uniqueid'],_0xd4766f[_0x35ad('0x19')]['toLowerCase']()][_0x35ad('0x13')]('\x20')));});}else{return _0x12735e(_0x2ee8f1[_0x35ad('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x258566){var _0x4609e0=this;return new Promise(function(_0x39f642,_0x4a9f53){if(ami[_0x35ad('0xf')]()==![]){return _0x4a9f53(_0x4609e0[_0x35ad('0x10')](0x1f4,[config[_0x35ad('0x11')]['ip'],config['asterisk'][_0x35ad('0x12')],_0x35ad('0x1b')][_0x35ad('0x13')]('\x20')));}var _0x3c7b45=schema(properties[_0x35ad('0x44')])[_0x35ad('0x3')](_0x258566);if(_0x3c7b45[_0x35ad('0x22')]>0x0){return _0x4a9f53(_0x4609e0['error'](0x1f4,_[_0x35ad('0x39')](_0x3c7b45,_0x35ad('0x19'))[_0x35ad('0x13')](',\x20')));}var _0x2517e2=_[_0x35ad('0x23')](_0x1fed0d['queueChannels'],{'uniqueid':_0x258566[_0x35ad('0x35')]});if(_0x2517e2&&_0x2517e2[_0x35ad('0x2c')]){return ami['Action']({'action':_0x35ad('0x45'),'channel':_0x2517e2[_0x35ad('0x2c')],'exten':_0x258566[_0x35ad('0x46')],'context':_0x258566[_0x35ad('0x47')]||_0x2517e2['context'],'priority':0x1})[_0x35ad('0x18')](function(_0x59fb4e){_0x39f642({'code':0xc8,'message':[_0x258566[_0x35ad('0x35')],_0x59fb4e[_0x35ad('0x19')][_0x35ad('0x30')]()]['join']('\x20')});})[_0x35ad('0x1a')](function(_0x5efcfe){_0x4a9f53(_0x4609e0[_0x35ad('0x10')](0x1f5,[_0x258566['uniqueid'],_0x5efcfe['message'][_0x35ad('0x30')]()][_0x35ad('0x13')]('\x20')));});}else{return _0x4a9f53(_0x4609e0['error'](0x1f5,_0x35ad('0x37')));}});},'Agents':function(_0x12d274){return new Promise(function(_0x1f4e7e){var _0x511bbb=_['values'](_0x1fed0d['agents']);if(_0x12d274&&_0x12d274['id']){var _0x54a89a=_[_0x35ad('0x23')](_0x511bbb,function(_0x1a9fbf){return _0x1a9fbf['id']===_0x12d274['id'];});_0x1f4e7e(_0x54a89a);}else{_0x1f4e7e({'count':_0x511bbb[_0x35ad('0x22')],'rows':_0x511bbb});}});},'Telephones':function(){return new Promise(function(_0x35bcc0){var _0x1dc9f0=_[_0x35ad('0x25')](_0x1fed0d['telephones']);_0x35bcc0({'count':_0x1dc9f0[_0x35ad('0x22')],'rows':_0x1dc9f0});});},'Trunks':function(){return new Promise(function(_0xda823){var _0x59fbea=_[_0x35ad('0x25')](_0x1fed0d[_0x35ad('0x48')]);_0xda823({'count':_0x59fbea['length'],'rows':_0x59fbea});});},'OutboundChannels':function(){return new Promise(function(_0x18436d){var _0x31f8bb=_[_0x35ad('0x25')](_0x1fed0d[_0x35ad('0x49')]);_0x18436d({'count':_0x31f8bb['length'],'rows':_0x31f8bb});});},'Outbound':function(){return new Promise(function(_0x1e7722){_0x1e7722(_0x1fed0d[_0x35ad('0x4a')]);});},'Campaigns':function(){return new Promise(function(_0x24927b){var _0x4a86a=_[_0x35ad('0x25')](_0x1fed0d[_0x35ad('0x4b')]);_0x24927b({'count':_0x4a86a[_0x35ad('0x22')],'rows':_0x4a86a});});},'VoiceQueuesPreview':function(_0x3dc5e5){var _0xd021df=this;return new Promise(function(_0x2bc48d,_0x4f8fe9){_0x729a01['run'](_0x3dc5e5['id'])[_0x35ad('0x18')](function(_0x1f457f){_0x2bc48d({'code':0xc8,'message':_0x1f457f['message']});})[_0x35ad('0x1a')](function(_0x1d4bdb){_0x4f8fe9(_0xd021df[_0x35ad('0x10')](0x1f4,_0x1d4bdb[_0x35ad('0x19')]));});});},'EventManager':function(_0x3602d4){var _0x44a9d4=this;return new Promise(function(_0x56bf56,_0x62e5bf){if(!_0x3602d4[_0x35ad('0x4c')]){return _0x62e5bf(_0x44a9d4[_0x35ad('0x10')](0x1f4,_0x35ad('0x4d')));}ami[_0x35ad('0x4e')](_0x35ad('0x4f')+_0x3602d4[_0x35ad('0x4c')],_0x3602d4[_0x35ad('0x19')]);_0x56bf56({'code':0xc8,'message':_0x3602d4});});},'FaxAccounts':function(){return new Promise(function(_0x4c4d06){var _0x3b2636=_[_0x35ad('0x25')](_0x1fed0d[_0x35ad('0x50')]);_0x4c4d06({'count':_0x3b2636[_0x35ad('0x22')],'rows':_0x3b2636});});},'SendFax':function(_0x4c89e3){var _0x44d0ff=this;return new Promise(function(_0x54c975,_0x120cbb){_0x436dcb['send'](_0x4c89e3)['then'](function(_0x7b2480){_0x54c975({'code':0xc8,'message':_0x7b2480[_0x35ad('0x19')]});})[_0x35ad('0x1a')](function(_0x5522d8){_0x120cbb(_0x44d0ff[_0x35ad('0x10')](0x1f4,_0x5522d8['message']));});});},'CheckAfterSend':function(_0x4125ed){var _0x1fd4d4=this;return new Promise(function(_0x4659c1,_0x36fe2b){_0x436dcb['checkAfterSend'](_0x4125ed)[_0x35ad('0x18')](function(_0x5a919f){_0x4659c1({'code':0xc8,'message':_0x5a919f[_0x35ad('0x19')]});})['catch'](function(_0x31682c){_0x36fe2b(_0x1fd4d4[_0x35ad('0x10')](0x1f4,_0x31682c['message']));});});}};var _0x4de62c=jayson['server'](_0x4edc59)[_0x35ad('0x51')]();_0x4de62c['on'](_0x35ad('0x10'),function(_0x141163){return _0x31cc6a(_0x141163);});_0x4de62c[_0x35ad('0x8')](0x232a,_0x35ad('0x52'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x36c606(_0x35ad('0x53')+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 e011215..006a195 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 _0xa1c9=['ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','$or','routeId','destcalleridnum','calleridnum','firstName','phone','mobile'];(function(_0x239e63,_0x446420){var _0x469c27=function(_0x1491ef){while(--_0x1491ef){_0x239e63['push'](_0x239e63['shift']());}};_0x469c27(++_0x446420);}(_0xa1c9,0x135));var _0x9a1c=function(_0x1dc0b9,_0x43ffca){_0x1dc0b9=_0x1dc0b9-0x0;var _0x20013a=_0xa1c9[_0x1dc0b9];return _0x20013a;};'use strict';var _=require(_0x9a1c('0x0'));var BPromise=require(_0x9a1c('0x1'));var Redis=require(_0x9a1c('0x2'));var util=require(_0x9a1c('0x3'));var config=require(_0x9a1c('0x4'));var logger=require(_0x9a1c('0x5'))(_0x9a1c('0x6'));var cmContactRpc=require(_0x9a1c('0x7'));config[_0x9a1c('0x8')]=_['defaults'](config[_0x9a1c('0x8')],{'host':_0x9a1c('0x9'),'port':0x18eb});var io=require(_0x9a1c('0xa'))(new Redis(config[_0x9a1c('0x8')]));function emit(_0xb1a3a4,_0x54ab19,_0x2aa263,_0x98387f,_0x586994){logger['info']('[CM][%s][%s]',_0xb1a3a4,_0x54ab19['id'],_0x2aa263,_0x98387f,JSON['stringify'](_0x586994));io['to'](_0x2aa263)[_0x9a1c('0xb')](_0x98387f,_0x586994);}exports[_0x9a1c('0xc')]=function(_0x5b02e3,_0x147962,_0x17ef35,_0x2524e3){var _0x3f955b,_0x12d101;var _0x63d80c={};var _0x4a18db;var _0x10e3bb=Number(_0x17ef35[_0x9a1c('0xd')]);var _0x5f4b4a=_0x17ef35['data2']?Boolean(Number(_0x17ef35[_0x9a1c('0xe')])):![];var _0x1783ff;var _0x518b1e=![];if(!_[_0x9a1c('0xf')](_0x17ef35[_0x9a1c('0x10')])){if(_0x17ef35[_0x9a1c('0x10')]=='1')_0x518b1e=!![];}if(!_0x518b1e){if(_0x2524e3[_0x9a1c('0x11')]){_0x63d80c['id']=_0x2524e3[_0x9a1c('0x11')];}}if(!_0x63d80c['id']){_0x63d80c['ListId']=_0x10e3bb;_0x1783ff=_0x17ef35[_0x9a1c('0x12')]&&_0x17ef35[_0x9a1c('0x12')]!=='0'?_0x17ef35['data3'][_0x9a1c('0x13')](','):['phone'];_0x63d80c[_0x9a1c('0x14')]=_['map'](_0x1783ff,function(_0x5bbfc){var _0x4980c9={};_0x4980c9[_0x5bbfc]=_0x2524e3[_0x9a1c('0x15')]?_0x2524e3[_0x9a1c('0x16')]:_0x2524e3['calleridnum'];return _0x4980c9;});_0x4a18db=_0x2524e3[_0x9a1c('0x15')]?_0x2524e3[_0x9a1c('0x16')]:_0x2524e3[_0x9a1c('0x17')];}var _0x3c8d9d=['id',_0x9a1c('0x18'),'lastName',_0x9a1c('0x19'),_0x9a1c('0x1a'),'fax',_0x9a1c('0x1b'),_0x9a1c('0x1c'),_0x9a1c('0x1d'),_0x9a1c('0x1e')];var _0x29293a=_[_0x9a1c('0x1f')](_0x3c8d9d,_0x1783ff);BPromise[_0x9a1c('0x20')]()[_0x9a1c('0x21')](cmContactRpc[_0x9a1c('0x22')]({'attributes':_0x29293a,'where':_0x63d80c,'phone':_0x4a18db}))[_0x9a1c('0x21')](function(_0x45fa32){_0x12d101=_0x45fa32;if(!_['isEmpty'](_0x12d101)){if(_0x12d101[_0x9a1c('0x23')]===0x1){_0x3f955b=_0x12d101[0x0];logger[_0x9a1c('0x24')](_0x9a1c('0x25'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id'],_0x3f955b['id']);}else{logger['info'](_0x9a1c('0x27'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id'],_[_0x9a1c('0x28')](_0x12d101,'id')[_0x9a1c('0x29')](','));}return;}else{logger[_0x9a1c('0x24')](_0x9a1c('0x2a'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id']);var _0x36194e={'ListId':_0x10e3bb};var _0x59ace4=_0x17ef35[_0x9a1c('0x2b')]&&_0x17ef35[_0x9a1c('0x2b')]!=='0'?_0x17ef35[_0x9a1c('0x2b')]:_0x9a1c('0x19');if(_0x5f4b4a){logger[_0x9a1c('0x24')](_0x9a1c('0x2c'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id']);_0x36194e[_0x59ace4]=_['isNil'](_0x2524e3[_0x9a1c('0x15')])?_0x2524e3[_0x9a1c('0x17')]:_0x2524e3[_0x9a1c('0x16')];if(_['isNil'](_0x2524e3[_0x9a1c('0x15')])){_0x36194e['firstName']=_0x2524e3['calleridname']&&_0x2524e3[_0x9a1c('0x2d')]!==''?_0x2524e3[_0x9a1c('0x2d')]:'Unknown';}else{_0x36194e[_0x9a1c('0x18')]=_0x2524e3['destcalleridname']&&_0x2524e3[_0x9a1c('0x2e')]!==''?_0x2524e3[_0x9a1c('0x2e')]:_0x9a1c('0x2f');}return BPromise[_0x9a1c('0x20')]()['then'](cmContactRpc[_0x9a1c('0x30')](_0x36194e))[_0x9a1c('0x21')](function(_0x12baf3){_0x3f955b=_0x12baf3;_0x12d101['push'](_0x12baf3);if(_0x3f955b){logger[_0x9a1c('0x24')](_0x9a1c('0x31'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id'],_0x3f955b['id']);}return;});}else{logger[_0x9a1c('0x24')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2524e3[_0x9a1c('0x26')],_0x147962['id']);_0x36194e[_0x59ace4]=_[_0x9a1c('0xf')](_0x2524e3[_0x9a1c('0x15')])?_0x2524e3['calleridnum']:_0x2524e3['destcalleridnum'];if(_[_0x9a1c('0xf')](_0x2524e3[_0x9a1c('0x15')])){_0x36194e[_0x9a1c('0x18')]=_0x2524e3['calleridname']&&_0x2524e3[_0x9a1c('0x2d')]!==''?_0x2524e3[_0x9a1c('0x2d')]:_0x9a1c('0x2f');}else{_0x36194e[_0x9a1c('0x18')]=_0x2524e3['destcalleridname']&&_0x2524e3[_0x9a1c('0x2e')]!==''?_0x2524e3[_0x9a1c('0x2e')]:'Unknown';}_0x3f955b=_0x36194e;_0x12d101['push'](_0x36194e);return;}}})[_0x9a1c('0x21')](function(){if(_0x5b02e3){emit(_0x2524e3[_0x9a1c('0x26')],_0x147962,util[_0x9a1c('0x32')](_0x9a1c('0x33'),_0x5b02e3[_0x9a1c('0x34')]),util['format'](_0x9a1c('0x35'),_0x17ef35['action'][_0x9a1c('0x36')]()),{'evt':_[_0x9a1c('0x37')](_0x2524e3,{'autoCreate':_0x5f4b4a}),'contact':_0x3f955b===undefined?{}:_0x3f955b,'contacts':_0x12d101['length']===0x0?undefined:_0x12d101});}});}; \ No newline at end of file +var _0x1aa9=['[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','trigger','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','length','info','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1aa9,0x197));var _0x91aa=function(_0x48b724,_0x5a8e26){_0x48b724=_0x48b724-0x0;var _0x4d38b3=_0x1aa9[_0x48b724];return _0x4d38b3;};'use strict';var _=require(_0x91aa('0x0'));var BPromise=require(_0x91aa('0x1'));var Redis=require(_0x91aa('0x2'));var util=require(_0x91aa('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x91aa('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x91aa('0x5')]=_[_0x91aa('0x6')](config[_0x91aa('0x5')],{'host':_0x91aa('0x7'),'port':0x18eb});var io=require(_0x91aa('0x8'))(new Redis(config['redis']));function emit(_0x1d9023,_0x597cb5,_0x1a7ff9,_0x29a4ba,_0x5095e4){logger['info']('[CM][%s][%s]',_0x1d9023,_0x597cb5['id'],_0x1a7ff9,_0x29a4ba,JSON[_0x91aa('0x9')](_0x5095e4));io['to'](_0x1a7ff9)[_0x91aa('0xa')](_0x29a4ba,_0x5095e4);}exports[_0x91aa('0xb')]=function(_0x5c6d0b,_0xb1910,_0x45d185,_0x41166c){var _0x4fbd3c,_0x36677c;var _0x2578fa={};var _0x5ad6af;var _0xdaed7d=Number(_0x45d185[_0x91aa('0xc')]);var _0x184396=_0x45d185['data2']?Boolean(Number(_0x45d185[_0x91aa('0xd')])):![];var _0x59778b;var _0x4726f4=![];if(!_[_0x91aa('0xe')](_0x45d185[_0x91aa('0xf')])){if(_0x45d185[_0x91aa('0xf')]=='1')_0x4726f4=!![];}if(!_0x4726f4){if(_0x41166c[_0x91aa('0x10')]){_0x2578fa['id']=_0x41166c[_0x91aa('0x10')];}}if(!_0x2578fa['id']){_0x2578fa[_0x91aa('0x11')]=_0xdaed7d;_0x59778b=_0x45d185[_0x91aa('0x12')]&&_0x45d185[_0x91aa('0x12')]!=='0'?_0x45d185['data3'][_0x91aa('0x13')](','):['phone'];_0x2578fa['$or']=_['map'](_0x59778b,function(_0xfeba20){var _0x47378b={};_0x47378b[_0xfeba20]=_0x41166c[_0x91aa('0x14')]?_0x41166c['destcalleridnum']:_0x41166c['calleridnum'];return _0x47378b;});_0x5ad6af=_0x41166c[_0x91aa('0x14')]?_0x41166c[_0x91aa('0x15')]:_0x41166c[_0x91aa('0x16')];}var _0x4de1f0=['id',_0x91aa('0x17'),_0x91aa('0x18'),_0x91aa('0x19'),_0x91aa('0x1a'),_0x91aa('0x1b'),_0x91aa('0x11'),_0x91aa('0x1c'),_0x91aa('0x1d'),'updatedAt'];var _0x2c7977=_[_0x91aa('0x1e')](_0x4de1f0,_0x59778b);BPromise[_0x91aa('0x1f')]()[_0x91aa('0x20')](cmContactRpc[_0x91aa('0x21')]({'attributes':_0x2c7977,'where':_0x2578fa,'phone':_0x5ad6af}))['then'](function(_0x7fc4ae){_0x36677c=_0x7fc4ae;if(!_[_0x91aa('0x22')](_0x36677c)){if(_0x36677c[_0x91aa('0x23')]===0x1){_0x4fbd3c=_0x36677c[0x0];logger[_0x91aa('0x24')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x41166c[_0x91aa('0x25')],_0xb1910['id'],_0x4fbd3c['id']);}else{logger['info'](_0x91aa('0x26'),_0x41166c[_0x91aa('0x25')],_0xb1910['id'],_[_0x91aa('0x27')](_0x36677c,'id')[_0x91aa('0x28')](','));}return;}else{logger[_0x91aa('0x24')](_0x91aa('0x29'),_0x41166c[_0x91aa('0x25')],_0xb1910['id']);var _0xa1f42={'ListId':_0xdaed7d};var _0x5dfce9=_0x45d185[_0x91aa('0x2a')]&&_0x45d185[_0x91aa('0x2a')]!=='0'?_0x45d185[_0x91aa('0x2a')]:_0x91aa('0x19');if(_0x184396){logger[_0x91aa('0x24')](_0x91aa('0x2b'),_0x41166c['uniqueid'],_0xb1910['id']);_0xa1f42[_0x5dfce9]=_['isNil'](_0x41166c[_0x91aa('0x14')])?_0x41166c[_0x91aa('0x16')]:_0x41166c['destcalleridnum'];if(_['isNil'](_0x41166c[_0x91aa('0x14')])){_0xa1f42[_0x91aa('0x17')]=_0x41166c[_0x91aa('0x2c')]&&_0x41166c[_0x91aa('0x2c')]!==_0x91aa('0x2d')?_0x41166c[_0x91aa('0x2c')]:_0x91aa('0x2e');}else{_0xa1f42[_0x91aa('0x17')]=_0x41166c[_0x91aa('0x2f')]&&_0x41166c['destcalleridname']!==_0x91aa('0x2d')?_0x41166c[_0x91aa('0x2f')]:_0x91aa('0x2e');}return BPromise[_0x91aa('0x1f')]()[_0x91aa('0x20')](cmContactRpc[_0x91aa('0x30')](_0xa1f42))['then'](function(_0x158502){_0x4fbd3c=_0x158502;_0x36677c['push'](_0x158502);if(_0x4fbd3c){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x41166c[_0x91aa('0x25')],_0xb1910['id'],_0x4fbd3c['id']);}return;});}else{logger['info'](_0x91aa('0x31'),_0x41166c[_0x91aa('0x25')],_0xb1910['id']);_0xa1f42[_0x5dfce9]=_[_0x91aa('0xe')](_0x41166c[_0x91aa('0x14')])?_0x41166c[_0x91aa('0x16')]:_0x41166c['destcalleridnum'];if(_[_0x91aa('0xe')](_0x41166c['routeId'])){_0xa1f42[_0x91aa('0x17')]=_0x41166c[_0x91aa('0x2c')]&&_0x41166c[_0x91aa('0x2c')]!==_0x91aa('0x2d')?_0x41166c['calleridname']:_0x91aa('0x2e');}else{_0xa1f42[_0x91aa('0x17')]=_0x41166c['destcalleridname']&&_0x41166c[_0x91aa('0x2f')]!==''?_0x41166c['destcalleridname']:_0x91aa('0x2e');}_0x4fbd3c=_0xa1f42;_0x36677c[_0x91aa('0x32')](_0xa1f42);return;}}})[_0x91aa('0x20')](function(){if(_0x5c6d0b){emit(_0x41166c[_0x91aa('0x25')],_0xb1910,util[_0x91aa('0x33')](_0x91aa('0x34'),_0x5c6d0b[_0x91aa('0x35')]),util[_0x91aa('0x33')](_0x91aa('0x36'),_0x45d185[_0x91aa('0x37')][_0x91aa('0x38')]()),{'evt':_['merge'](_0x41166c,{'autoCreate':_0x184396}),'contact':_0x4fbd3c===undefined?{}:_0x4fbd3c,'contacts':_0x36677c[_0x91aa('0x23')]===0x0?undefined:_0x36677c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index dbb0319..5fa3306 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 _0xbdb5=['AnyConditions','some','checkTrigger:\x20trigger','evt','field','account','chat','value','ChatWebsiteId','upperFirst','operator','AccountId','interaction','message','event','agent','membername','lastevent','null','undefined','substatus','offlineMessage','created','equals','util','lodash','url','mustache','./urlforward','./integration','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','voice','debug','inspect','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','interface','toLowerCase','motionbar','browser','data1','popup','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','windowHeight','data6','600','winapp','winApplication','render','winArguments','user:%s','name','action','format','trigger:%s','contactmanager','integration','exec','queue','routeId','urlforward','script','parse','query','replace','channel','AllConditions','every','checkConditions'];(function(_0x5c988c,_0x4beea7){var _0x3e80f1=function(_0x4ba689){while(--_0x4ba689){_0x5c988c['push'](_0x5c988c['shift']());}};_0x3e80f1(++_0x4beea7);}(_0xbdb5,0x122));var _0x5bdb=function(_0x21e18d,_0x2dd126){_0x21e18d=_0x21e18d-0x0;var _0x5644c9=_0xbdb5[_0x21e18d];return _0x5644c9;};'use strict';var util=require(_0x5bdb('0x0'));var _=require(_0x5bdb('0x1'));var url=require(_0x5bdb('0x2'));var Mustache=require(_0x5bdb('0x3'));var Redis=require('ioredis');var urlforward=require(_0x5bdb('0x4'));var integration=require(_0x5bdb('0x5'));var cmContact=require('./cmContact');var script=require(_0x5bdb('0x6'));var config=require(_0x5bdb('0x7'));var logger=require('../../../config/logger')(_0x5bdb('0x8'));var ami=require(_0x5bdb('0x9'));config[_0x5bdb('0xa')]=_[_0x5bdb('0xb')](config[_0x5bdb('0xa')],{'host':_0x5bdb('0xc'),'port':0x18eb});var io=require(_0x5bdb('0xd'))(new Redis(config[_0x5bdb('0xa')]));var operators={'equals':function(_0x47fa4f,_0x2202ef){return _0x47fa4f==_0x2202ef;},'not_equals':function(_0x4e5a5f,_0x122f8c){return _0x4e5a5f!=_0x122f8c;}};var barAndWebActions=['popup',_0x5bdb('0x2'),'winapp'];function Trigger(_0x15d8e6){this['triggers']=_0x15d8e6[_0x5bdb('0xe')];this['agents']=_0x15d8e6[_0x5bdb('0xf')];this[_0x5bdb('0x10')]=_0x15d8e6[_0x5bdb('0x10')];this['templates']=_0x15d8e6[_0x5bdb('0x11')];this[_0x5bdb('0x12')]=_0x15d8e6[_0x5bdb('0x12')];this[_0x5bdb('0x13')]=_0x15d8e6[_0x5bdb('0x13')];this[_0x5bdb('0x14')]=_0x15d8e6['freshdeskAccounts'];this[_0x5bdb('0x15')]=_0x15d8e6[_0x5bdb('0x15')];this[_0x5bdb('0x16')]=_0x15d8e6[_0x5bdb('0x16')];this[_0x5bdb('0x17')]=_0x15d8e6[_0x5bdb('0x17')];this['deskAccounts']=_0x15d8e6[_0x5bdb('0x18')];this['vtigerAccounts']=_0x15d8e6['vtigerAccounts'];this[_0x5bdb('0x19')]=_0x15d8e6[_0x5bdb('0x19')];this[_0x5bdb('0x1a')]=_0x15d8e6[_0x5bdb('0x1a')];this[_0x5bdb('0x1b')]=_0x15d8e6[_0x5bdb('0x1b')];this[_0x5bdb('0x1c')]={'zendesk':this[_0x5bdb('0x13')],'salesforce':this[_0x5bdb('0x15')],'freshdesk':this[_0x5bdb('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x5bdb('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x5bdb('0x1a')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x5bdb('0x19')]};ami['on'](_0x5bdb('0x1d'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x20'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x21'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x5bdb('0x1e')]['bind'](this));ami['on'](_0x5bdb('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5bdb('0x23'),this['syncCustomEvent'][_0x5bdb('0x1f')](this));ami['on']('custom:agentbusy',this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x24'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x25'),this[_0x5bdb('0x1e')]['bind'](this));ami['on'](_0x5bdb('0x26'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x27'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x28'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on']('custom:dialbegin',this[_0x5bdb('0x29')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x2a'),this['syncAgentDial'][_0x5bdb('0x1f')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0x5bdb('0x1f')](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0x5bdb('0x1f')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x2b'),this[_0x5bdb('0x1e')]['bind'](this));ami['on']('custom:incomingmessage',this[_0x5bdb('0x1e')]['bind'](this));ami['on'](_0x5bdb('0x2c'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));ami['on'](_0x5bdb('0x2d'),this['syncCustomEvent']['bind'](this));ami['on']('custom:rejectmessage',this[_0x5bdb('0x1e')]['bind'](this));ami['on'](_0x5bdb('0x2e'),this[_0x5bdb('0x1e')][_0x5bdb('0x1f')](this));}Trigger[_0x5bdb('0x2f')][_0x5bdb('0x30')]=function(_0x2c2844,_0x42988c,_0x4f6279){logger['info'](_0x2c2844,_0x42988c,JSON[_0x5bdb('0x31')](_0x4f6279));io['to'](_0x2c2844)[_0x5bdb('0x30')](_0x42988c,_0x4f6279);};Trigger[_0x5bdb('0x2f')][_0x5bdb('0x1e')]=function(_0x297c4b){var _0x3c6991=_[_0x5bdb('0x32')](_0x297c4b);if(typeof _0x3c6991[_0x5bdb('0x33')]==='undefined'){_0x3c6991[_0x5bdb('0x33')]=_0x5bdb('0x34');}logger[_0x5bdb('0x35')](_0x5bdb('0x1e'),util[_0x5bdb('0x36')](_0x3c6991,{'showHidden':!![],'depth':null}));this[_0x5bdb('0x37')](_0x3c6991);};Trigger[_0x5bdb('0x2f')]['syncAgentDial']=function(_0x2fae73){if(this[_0x5bdb('0xf')][_0x2fae73['interface']]){this[_0x5bdb('0x1e')](_0x2fae73);}};Trigger[_0x5bdb('0x2f')][_0x5bdb('0x37')]=function(_0x5d348b){var _0x3c709a;for(var _0x556e46 in this[_0x5bdb('0xe')]){if(this['triggers'][_0x5bdb('0x38')](_0x556e46)){if(this[_0x5bdb('0xe')][_0x556e46][_0x5bdb('0x39')]){_0x3c709a=this[_0x5bdb('0x3a')](this[_0x5bdb('0xe')][_0x556e46],_0x5d348b);if(_0x3c709a){_[_0x5bdb('0x3b')](_0x5d348b,_0x5d348b[_0x5bdb('0x3c')]);for(var _0x48a23a=0x0,_0x17adc8,_0x596a89,_0x139197;_0x48a23a0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x581e2b,_0x9f6722){var _0x14c2fd=function(_0xd9691b){while(--_0xd9691b){_0x581e2b['push'](_0x581e2b['shift']());}};_0x14c2fd(++_0x9f6722);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ 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 ef646e5..f1c9114 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 _0x229c=['destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','substring','lastIndexOf','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','value','enduserId','contactid','nothing',']\x20Enduser\x20created!','includes','picklist','type','nameField','customField','idField','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','ioredis','../../../../config/logger','localhost','socket.io-emitter','redis','modernAuthentication','CloudProvider','data2','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','isdisabled','info','systemuserid','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','message','toLowerCase','outbound'];(function(_0x361525,_0x43a30f){var _0x50b35b=function(_0x4b1634){while(--_0x4b1634){_0x361525['push'](_0x361525['shift']());}};_0x50b35b(++_0x43a30f);}(_0x229c,0x1ea));var _0xc229=function(_0x243e1e,_0x5c75ea){_0x243e1e=_0x243e1e-0x0;var _0x3a7cea=_0x229c[_0x243e1e];return _0x3a7cea;};'use strict';var _=require(_0xc229('0x0'));var rp=require(_0xc229('0x1'));var util=require('util');var intUtil=require('./util');var md5=require(_0xc229('0x2'));var Redis=require(_0xc229('0x3'));var logger=require(_0xc229('0x4'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0xc229('0x5'),'port':0x18eb});var io=require(_0xc229('0x6'))(new Redis(config[_0xc229('0x7')]));function getAuthToken(_0x57f68c,_0x49c9cc,_0x4e9af0){if(_0x57f68c[_0xc229('0x8')]){_0x57f68c['remoteUri']=_0x57f68c[_0xc229('0x9')]['data7'];_0x57f68c['tenantId']=_0x57f68c[_0xc229('0x9')][_0xc229('0xa')];return Promise[_0xc229('0xb')](_0x57f68c[_0xc229('0x9')][_0xc229('0xc')]);}var _0x19c5f2={'method':_0xc229('0xd'),'uri':_0x49c9cc,'form':{'client_id':_0x57f68c[_0xc229('0xe')],'resource':_0x57f68c[_0xc229('0xf')],'username':_0x57f68c[_0xc229('0x10')],'password':_0x57f68c[_0xc229('0x11')],'grant_type':'password','client_secret':_0x57f68c[_0xc229('0x12')]},'json':!![]};return rp(_0x19c5f2)[_0xc229('0x13')](function(_0x143886){return _0x143886[_0xc229('0x14')];})[_0xc229('0x15')](function(_0x2ea8e5){logger[_0xc229('0x16')]('['+[_0x4e9af0['toUpperCase']()]+_0xc229('0x17'));return _0x2ea8e5['message'];});}function getUser(_0x2e17b3,_0x56bf7f,_0xb0554e,_0x173589,_0x20adef,_0x17ccfe){return new Promise(function(_0x5f558f,_0x137481){return getAuthToken(_0x56bf7f,_0x173589,_0x17ccfe)[_0xc229('0x13')](function(_0x16c9cc){var _0x5e636d={'method':'GET','uri':_0x20adef+_0xc229('0x18'),'headers':{'Authorization':_0xc229('0x19')+_0x16c9cc,'OData-Version':_0xc229('0x1a')},'json':!![]};return rp(_0x5e636d);})[_0xc229('0x13')](function(_0x1911eb){var _0x1c5933=_0x1911eb['value'];var _0x4e1b22=![];var _0x2819a1=null;if(!_['isNil'](_0xb0554e)){if(intUtil[_0xc229('0x1b')](_0xb0554e[_0xc229('0x1c')])){_0x2e17b3[_0xc229('0x1d')]=_0xb0554e[_0xc229('0x1c')];for(_0x2819a1=0x0;_0x2819a1<_0x1c5933[_0xc229('0x1e')];_0x2819a1++){if(_0x1c5933[_0x2819a1]['internalemailaddress']===_0xb0554e[_0xc229('0x1c')]&&!_0x1c5933[_0x2819a1][_0xc229('0x1f')]){_0x4e1b22=!![];logger[_0xc229('0x20')]('['+[_0x17ccfe['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1c5933[_0x2819a1][_0xc229('0x21')]+'!');_0x2e17b3['userId']=_0x1c5933[_0x2819a1][_0xc229('0x21')];}}}}if(!_0x4e1b22){logger[_0xc229('0x20')]('['+[_0x17ccfe[_0xc229('0x22')]()]+_0xc229('0x23'));_0x2e17b3[_0xc229('0x1d')]=_0x56bf7f[_0xc229('0x10')];for(_0x2819a1=0x0;_0x2819a1<_0x1c5933[_0xc229('0x1e')];_0x2819a1++){if(_0x1c5933[_0x2819a1]['internalemailaddress']===_0x56bf7f['username']){_0x2e17b3[_0xc229('0x24')]=_0x1c5933[_0x2819a1][_0xc229('0x21')];}}}_0x5f558f(_0x2e17b3);})['catch'](function(_0x361e53){_0x137481(_0x361e53[_0xc229('0x25')]);});});}function createEndUser(_0x5e5f7f,_0x2d6f3c,_0x209dc8,_0x1f3ad7,_0x35f794,_0x989449,_0x6bb1c1){return new Promise(function(_0x2c742c,_0x30d96f){return getAuthToken(_0x2d6f3c,_0x209dc8,_0x989449)[_0xc229('0x13')](function(_0x5db44f){var _0x327405=_0x989449[_0xc229('0x26')]()===_0xc229('0x27')?_0x35f794[_0xc229('0x28')]:_0x35f794[_0xc229('0x29')];var _0x1a862c={'method':_0xc229('0xd'),'uri':_0x1f3ad7+_0xc229('0x2a'),'body':{'fullname':_0x327405,'firstname':_0x327405,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc229('0x2b')+_0x5e5f7f['userId']+')'},'headers':{'Authorization':_0xc229('0x19')+_0x5db44f,'OData-Version':_0xc229('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x1a862c[_0xc229('0x2c')][_0x6bb1c1]=_0x327405;return rp(_0x1a862c);})['then'](function(_0x42fd08){var _0x1b87d0=_0x42fd08[_0xc229('0x2d')]['odata-entityid'];var _0x4c9467=_0x1b87d0[_0xc229('0x2e')](_0x1b87d0[_0xc229('0x2f')]('(')+0x1,_0x1b87d0['lastIndexOf'](')'));_0x5e5f7f['enduserId']=_0x4c9467;_0x2c742c(_0x5e5f7f);})['catch'](function(_0x10ad2e){_0x30d96f(_0x10ad2e['message']);});});}function getEndUser(_0x1ff476,_0x4bd72d,_0x103a30,_0x567826,_0x49ed34,_0x41e710,_0x2f10d2,_0x4364fc){var _0xb812e3=_0x41e710[_0xc229('0x26')]()===_0xc229('0x27')?_0x49ed34['destcalleridnum']:_0x49ed34[_0xc229('0x29')];return getAuthToken(_0x4bd72d,_0x103a30,_0x41e710)[_0xc229('0x13')](function(_0x3174c4){_0x4364fc=_0x4364fc?_0x4364fc:_0xc229('0x30');var _0x36b522={'method':_0xc229('0x31'),'uri':_0x567826+_0xc229('0x32')+_0x4364fc+_0xc229('0x33')+_0x4364fc+_0xc229('0x34')+_0xb812e3[_0xc229('0x35')]('+',_0xc229('0x36'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3174c4,'If-None-Match':null,'OData-Version':_0xc229('0x1a')},'json':!![]};return rp(_0x36b522);})['then'](function(_0x20594f){var _0x4b4b9f=![];if(!_0x20594f)return _0x4b4b9f;var _0x5df05a=_0x20594f[_0xc229('0x37')];for(var _0x42f6b6=0x0;_0x42f6b6<_0x5df05a['length'];_0x42f6b6++){if(_0x5df05a[_0x42f6b6][_0x4364fc]===_0xb812e3){_0x4b4b9f=!![];_0x1ff476[_0xc229('0x38')]=_0x5df05a[_0x42f6b6][_0xc229('0x39')];}}return _0x4b4b9f;})[_0xc229('0x13')](function(_0x18b615){if(_0x18b615)return _0x1ff476;if(_0x2f10d2===_0xc229('0x3a')){logger['info']('['+[_0x41e710[_0xc229('0x22')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1ff476;}return createEndUser(_0x1ff476,_0x4bd72d,_0x103a30,_0x567826,_0x49ed34,_0x41e710,_0x4364fc)[_0xc229('0x13')](function(_0x54a37e){logger[_0xc229('0x20')]('['+[_0x41e710[_0xc229('0x22')]()]+_0xc229('0x3b'),_0x54a37e[_0xc229('0x38')]);return _0x54a37e;});});}function getCustomFields(_0x2e6915,_0x4638de,_0x365233){var _0x141ea9={};if(_0x2e6915['length']>0x0){_['forEach'](_0x2e6915,function(_0x19048a){if(_[_0xc229('0x3c')](['string',_0xc229('0x3d')],_0x19048a[_0xc229('0x3e')])&&_0x19048a[_0xc229('0x3f')]&&!_0x19048a[_0xc229('0x40')]){var _0x4ecc3e=_0x19048a[_0xc229('0x41')][_0xc229('0x26')]();var _0x2b4379=_0x4ecc3e[_0xc229('0x2e')](0x0,_0x4ecc3e[_0xc229('0x42')]('_'));var _0x4fb228=_0x4ecc3e[_0xc229('0x2e')](_0x4ecc3e[_0xc229('0x42')]('_')+0x1);if(_0x2b4379===_0x365233){_0x141ea9[_0x4fb228]=_0x19048a['content'];}}});}return _0x141ea9;}function getTicket(_0x412103,_0x483015,_0x505a81,_0x423ad7,_0x30bfbf,_0x365e3d,_0x2d3f44){return new Promise(function(_0x1bd9d5,_0x41418a){var _0x133b30;return getAuthToken(_0x483015,_0x505a81,_0x2d3f44)['then'](function(_0x45648d){if(_0x365e3d['ticketType']===_0xc229('0x43')){_0x133b30={'method':_0xc229('0xd'),'uri':_0x423ad7+_0xc229('0x44'),'body':Object[_0xc229('0x45')]({},{'title':intUtil[_0xc229('0x46')](_0x365e3d[_0xc229('0x47')],_0x30bfbf,'\x20'),'description':intUtil['getString'](_0x365e3d[_0xc229('0x48')],_0x30bfbf,'\x0a'),'customerid_contact@odata.bind':_0x412103[_0xc229('0x38')]?_0xc229('0x49')+_0x412103[_0xc229('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x412103[_0xc229('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x365e3d[_0xc229('0x4a')],_0x30bfbf,_0x365e3d['ticketType'])),'headers':{'Authorization':_0xc229('0x19')+_0x45648d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x365e3d[_0xc229('0x4b')]===_0xc229('0x4c')){var _0x3bc2a9=_0x412103[_0xc229('0x38')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x412103[_0xc229('0x24')]+')','participationtypemask':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x412103['enduserId']+')','participationtypemask':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc229('0x2b')+_0x412103[_0xc229('0x24')]+')','participationtypemask':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?0x2:0x1}];_0x133b30={'method':'POST','uri':_0x423ad7+_0xc229('0x4f'),'body':Object[_0xc229('0x45')]({},{'subject':intUtil[_0xc229('0x46')](_0x365e3d['Subjects'],_0x30bfbf,'\x20'),'phonenumber':String(_0x30bfbf[_0xc229('0x29')]),'description':intUtil[_0xc229('0x46')](_0x365e3d[_0xc229('0x48')],_0x30bfbf,'\x0a'),'regardingobjectid_contact@odata.bind':_0x412103[_0xc229('0x38')]?'/contacts('+_0x412103[_0xc229('0x38')]+')':undefined,'ownerid@odata.bind':_0xc229('0x2b')+_0x412103[_0xc229('0x24')]+')','directioncode':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?![]:!![],'phonecall_activity_parties':_0x3bc2a9},getCustomFields(_0x365e3d[_0xc229('0x4a')],_0x30bfbf,_0x365e3d[_0xc229('0x4b')])),'headers':{'Authorization':_0xc229('0x19')+_0x45648d,'OData-Version':_0xc229('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x133b30);})[_0xc229('0x13')](function(_0x2ba1c4){var _0x5edfc8=_0x2ba1c4['headers']['odata-entityid'];var _0x5773af=_0x5edfc8[_0xc229('0x2e')](_0x5edfc8['lastIndexOf']('(')+0x1,_0x5edfc8[_0xc229('0x2f')](')'));_0x412103[_0xc229('0x50')]=_0x5773af;_0x1bd9d5(_0x412103);})[_0xc229('0x15')](function(_0x35db2a){_0x41418a(_0x35db2a[_0xc229('0x25')]);});});}function emit(_0x43deb5,_0x1e8243,_0x4b7ef7,_0x262d66){var _0x30b351={'uri':util[_0xc229('0x51')](_0xc229('0x52'),_0x43deb5,_0x4b7ef7,_0x262d66)};io['to'](util[_0xc229('0x51')]('user:%s',_0x1e8243))['emit'](_0xc229('0x53'),_0x30b351);}exports['cs']=function(_0xbd043,_0x2bedde,_0x22efba,_0x3a308a,_0x2aba4f,_0x388378,_0x555a52,_0x41045d){var _0x4e111f={};_0x388378[_0xc229('0xf')]=_0x388378[_0xc229('0x8')]?intUtil[_0xc229('0x54')](_0x388378[_0xc229('0x9')][_0xc229('0x55')]):intUtil['stripTrailingSlash'](_0x388378[_0xc229('0xf')]);_0x388378[_0xc229('0x56')]=intUtil[_0xc229('0x54')](_0x388378[_0xc229('0x56')]);_0x4e111f['callDirection']=_0x41045d==='queue'||_0x41045d===_0xc229('0x57')?_0xc229('0x4e'):_0xc229('0x27');var _0x354f44=_0x388378['modernAuthentication']?util['format'](_0xc229('0x58'),_0x388378['CloudProvider'][_0xc229('0x55')]):util['format'](_0xc229('0x58'),_0x388378[_0xc229('0xf')]);var _0x33e931=util[_0xc229('0x51')]('https://login.microsoftonline.com/%s/oauth2/token',_0x388378[_0xc229('0x59')]);var _0x3ff65c=util[_0xc229('0x51')](_0xc229('0x5a'),_0x388378[_0xc229('0x56')],_0x2bedde[_0xc229('0x5b')],md5(_0x2bedde[_0xc229('0x5b')]));if(_0x2aba4f&&_0x2aba4f[_0xc229('0x5c')]){logger[_0xc229('0x20')](_0xc229('0x5d'),_0xc229('0x5e'));_0x2bedde[_0xc229('0x5f')]=_0x3ff65c;}else if(_0x555a52&&_0x555a52[_0xc229('0x60')]&&_0x555a52[_0xc229('0x60')]!=='none'){logger['info'](_0xc229('0x61'),'Recording\x20is\x20enabled!');_0x2bedde[_0xc229('0x5f')]=_0x3ff65c;}else{_0x2bedde[_0xc229('0x5f')]='';}return getUser(_0x4e111f,_0x388378,_0x3a308a,_0x33e931,_0x354f44,_0x41045d)[_0xc229('0x13')](function(_0x45ec8d){logger[_0xc229('0x20')]('['+_0x41045d[_0xc229('0x22')]()+_0xc229('0x62'),_0x45ec8d['userId']);logger['info']('['+_0x41045d[_0xc229('0x22')]()+_0xc229('0x63'),_0x45ec8d[_0xc229('0x1d')]);return getEndUser(_0x45ec8d,_0x388378,_0x33e931,_0x354f44,_0x2bedde,_0x41045d,_0x22efba[_0xc229('0x64')],_0x22efba[_0xc229('0x65')]);})[_0xc229('0x13')](function(_0x3e0451){logger[_0xc229('0x20')]('['+_0x41045d[_0xc229('0x22')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3e0451['enduserId']);logger['info']('['+_0x41045d[_0xc229('0x22')]()+_0xc229('0x66'),_0x2bedde[_0xc229('0x29')]);return getTicket(_0x3e0451,_0x388378,_0x33e931,_0x354f44,_0x2bedde,_0x22efba,_0x41045d);})[_0xc229('0x13')](function(_0xbdb4b9){logger[_0xc229('0x20')](util[_0xc229('0x51')]('['+_0x41045d[_0xc229('0x22')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x22efba['ticketType'],_0xbdb4b9[_0xc229('0x50')]));logger[_0xc229('0x20')](util['format']('['+_0x41045d['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x41045d));if(_0x41045d!==_0xc229('0x57')&&_0x22efba[_0xc229('0x67')]){logger[_0xc229('0x20')]('['+_0x41045d[_0xc229('0x22')]()+']',_0xc229('0x68'));emit(_0x388378['remoteUri'],_0x3a308a[_0xc229('0x69')],_0x22efba[_0xc229('0x4b')],_0xbdb4b9[_0xc229('0x50')]);}})[_0xc229('0x15')](function(_0x32e0ce){logger[_0xc229('0x16')]('['+_0x41045d[_0xc229('0x22')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x32e0ce[_0xc229('0x25')]);console[_0xc229('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x32e0ce);});}; \ No newline at end of file +var _0xb9a2=[']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','clientId','username','password','then','access_token','catch','error','toUpperCase','GET','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','systemuserid','userId','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','4.0','body','headers','substring','lastIndexOf','enduserId','message','telephone1','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','POST','incidents','getString','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','assign','Subjects','odata-entityid','ticketId','format','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:'];(function(_0xf25112,_0x2ef0c3){var _0x38b959=function(_0x1b2fa2){while(--_0x1b2fa2){_0xf25112['push'](_0xf25112['shift']());}};_0x38b959(++_0x2ef0c3);}(_0xb9a2,0x150));var _0x2b9a=function(_0x352e5e,_0x12a663){_0x352e5e=_0x352e5e-0x0;var _0x489e60=_0xb9a2[_0x352e5e];return _0x489e60;};'use strict';var _=require(_0x2b9a('0x0'));var rp=require(_0x2b9a('0x1'));var util=require(_0x2b9a('0x2'));var intUtil=require(_0x2b9a('0x3'));var md5=require(_0x2b9a('0x4'));var Redis=require('ioredis');var logger=require(_0x2b9a('0x5'))(_0x2b9a('0x6'));var config=require('../../../../config/environment');config[_0x2b9a('0x7')]=_[_0x2b9a('0x8')](config[_0x2b9a('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2b9a('0x9'))(new Redis(config[_0x2b9a('0x7')]));function getAuthToken(_0x55f9b7,_0x5587ca,_0xf2e802){if(_0x55f9b7[_0x2b9a('0xa')]){_0x55f9b7[_0x2b9a('0xb')]=_0x55f9b7[_0x2b9a('0xc')][_0x2b9a('0xd')];_0x55f9b7[_0x2b9a('0xe')]=_0x55f9b7[_0x2b9a('0xc')]['data2'];return Promise[_0x2b9a('0xf')](_0x55f9b7['CloudProvider']['data5']);}var _0x4c6e5f={'method':'POST','uri':_0x5587ca,'form':{'client_id':_0x55f9b7[_0x2b9a('0x10')],'resource':_0x55f9b7[_0x2b9a('0xb')],'username':_0x55f9b7[_0x2b9a('0x11')],'password':_0x55f9b7['password'],'grant_type':_0x2b9a('0x12'),'client_secret':_0x55f9b7['clientSecret']},'json':!![]};return rp(_0x4c6e5f)[_0x2b9a('0x13')](function(_0x39ae61){return _0x39ae61[_0x2b9a('0x14')];})[_0x2b9a('0x15')](function(_0x577d63){logger[_0x2b9a('0x16')]('['+[_0xf2e802[_0x2b9a('0x17')]()]+']\x20Wrong\x20credentials!');return _0x577d63['message'];});}function getUser(_0x2c4f39,_0x101222,_0x192e55,_0x30594d,_0x18c0ad,_0x525c55){return new Promise(function(_0x32cf15,_0x43ef44){return getAuthToken(_0x101222,_0x30594d,_0x525c55)[_0x2b9a('0x13')](function(_0x3ba21f){var _0x38ff2={'method':_0x2b9a('0x18'),'uri':_0x18c0ad+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x3ba21f,'OData-Version':'4.0'},'json':!![]};return rp(_0x38ff2);})[_0x2b9a('0x13')](function(_0x4f3a38){var _0x41ebda=_0x4f3a38[_0x2b9a('0x19')];var _0x1446df=![];var _0x281cd0=null;if(!_[_0x2b9a('0x1a')](_0x192e55)){if(intUtil[_0x2b9a('0x1b')](_0x192e55[_0x2b9a('0x1c')])){_0x2c4f39['userEmail']=_0x192e55[_0x2b9a('0x1c')];for(_0x281cd0=0x0;_0x281cd0<_0x41ebda[_0x2b9a('0x1d')];_0x281cd0++){if(_0x41ebda[_0x281cd0][_0x2b9a('0x1e')]===_0x192e55['email']&&!_0x41ebda[_0x281cd0][_0x2b9a('0x1f')]){_0x1446df=!![];logger[_0x2b9a('0x20')]('['+[_0x525c55[_0x2b9a('0x17')]()]+']\x20Agent\x20found\x20'+_0x41ebda[_0x281cd0][_0x2b9a('0x21')]+'!');_0x2c4f39[_0x2b9a('0x22')]=_0x41ebda[_0x281cd0][_0x2b9a('0x21')];}}}}if(!_0x1446df){logger[_0x2b9a('0x20')]('['+[_0x525c55[_0x2b9a('0x17')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2c4f39[_0x2b9a('0x23')]=_0x101222[_0x2b9a('0x11')];for(_0x281cd0=0x0;_0x281cd0<_0x41ebda['length'];_0x281cd0++){if(_0x41ebda[_0x281cd0][_0x2b9a('0x1e')]===_0x101222[_0x2b9a('0x11')]){_0x2c4f39[_0x2b9a('0x22')]=_0x41ebda[_0x281cd0][_0x2b9a('0x21')];}}}_0x32cf15(_0x2c4f39);})[_0x2b9a('0x15')](function(_0x175710){_0x43ef44(_0x175710['message']);});});}function createEndUser(_0x53f75f,_0x55ce0e,_0x3da54d,_0x3b7133,_0x5e17f9,_0x4bc394,_0x3b74ea){return new Promise(function(_0x2b74bd,_0x1471da){return getAuthToken(_0x55ce0e,_0x3da54d,_0x4bc394)[_0x2b9a('0x13')](function(_0x28fae3){var _0x2ffec2=_0x4bc394[_0x2b9a('0x24')]()===_0x2b9a('0x25')?_0x5e17f9[_0x2b9a('0x26')]:_0x5e17f9[_0x2b9a('0x27')];var _0x3acb76={'method':'POST','uri':_0x3b7133+_0x2b9a('0x28'),'body':{'fullname':_0x2ffec2,'firstname':_0x2ffec2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2b9a('0x29')+_0x53f75f[_0x2b9a('0x22')]+')'},'headers':{'Authorization':_0x2b9a('0x2a')+_0x28fae3,'OData-Version':_0x2b9a('0x2b')},'json':!![],'resolveWithFullResponse':!![]};_0x3acb76[_0x2b9a('0x2c')][_0x3b74ea]=_0x2ffec2;return rp(_0x3acb76);})['then'](function(_0x300d1a){var _0x341143=_0x300d1a[_0x2b9a('0x2d')]['odata-entityid'];var _0x119013=_0x341143[_0x2b9a('0x2e')](_0x341143[_0x2b9a('0x2f')]('(')+0x1,_0x341143[_0x2b9a('0x2f')](')'));_0x53f75f[_0x2b9a('0x30')]=_0x119013;_0x2b74bd(_0x53f75f);})[_0x2b9a('0x15')](function(_0x4e7b66){_0x1471da(_0x4e7b66[_0x2b9a('0x31')]);});});}function getEndUser(_0x2e7108,_0x9caa39,_0x2d597e,_0x2d7f1d,_0x172ed5,_0x47247e,_0x1ccde1,_0x1831e8){var _0x51546a=_0x47247e[_0x2b9a('0x24')]()==='outbound'?_0x172ed5[_0x2b9a('0x26')]:_0x172ed5[_0x2b9a('0x27')];return getAuthToken(_0x9caa39,_0x2d597e,_0x47247e)[_0x2b9a('0x13')](function(_0x45ed14){_0x1831e8=_0x1831e8?_0x1831e8:_0x2b9a('0x32');var _0x4eabc5={'method':'GET','uri':_0x2d7f1d+'contacts?$select='+_0x1831e8+'&$filter='+_0x1831e8+_0x2b9a('0x33')+_0x51546a[_0x2b9a('0x34')]('+',_0x2b9a('0x35'))+'\x27','headers':{'Authorization':_0x2b9a('0x2a')+_0x45ed14,'If-None-Match':null,'OData-Version':_0x2b9a('0x2b')},'json':!![]};return rp(_0x4eabc5);})[_0x2b9a('0x13')](function(_0x2b72b9){var _0x1ea139=![];if(!_0x2b72b9)return _0x1ea139;var _0x1f8e0a=_0x2b72b9['value'];for(var _0x8d8748=0x0;_0x8d8748<_0x1f8e0a['length'];_0x8d8748++){if(_0x1f8e0a[_0x8d8748][_0x1831e8]===_0x51546a){_0x1ea139=!![];_0x2e7108[_0x2b9a('0x30')]=_0x1f8e0a[_0x8d8748][_0x2b9a('0x36')];}}return _0x1ea139;})[_0x2b9a('0x13')](function(_0x22337e){if(_0x22337e)return _0x2e7108;if(_0x1ccde1===_0x2b9a('0x37')){logger[_0x2b9a('0x20')]('['+[_0x47247e[_0x2b9a('0x17')]()]+_0x2b9a('0x38'));return _0x2e7108;}return createEndUser(_0x2e7108,_0x9caa39,_0x2d597e,_0x2d7f1d,_0x172ed5,_0x47247e,_0x1831e8)['then'](function(_0x354259){logger[_0x2b9a('0x20')]('['+[_0x47247e[_0x2b9a('0x17')]()]+']\x20Enduser\x20created!',_0x354259['enduserId']);return _0x354259;});});}function getCustomFields(_0x263106,_0x3c3abf,_0x44056e){var _0x238d1e={};if(_0x263106[_0x2b9a('0x1d')]>0x0){_[_0x2b9a('0x39')](_0x263106,function(_0x1ffd9e){if(_[_0x2b9a('0x3a')]([_0x2b9a('0x3b'),_0x2b9a('0x3c')],_0x1ffd9e[_0x2b9a('0x3d')])&&_0x1ffd9e[_0x2b9a('0x3e')]&&!_0x1ffd9e[_0x2b9a('0x3f')]){var _0x43641a=_0x1ffd9e[_0x2b9a('0x40')][_0x2b9a('0x24')]();var _0x399115=_0x43641a[_0x2b9a('0x2e')](0x0,_0x43641a[_0x2b9a('0x41')]('_'));var _0x4b1f79=_0x43641a[_0x2b9a('0x2e')](_0x43641a[_0x2b9a('0x41')]('_')+0x1);if(_0x399115===_0x44056e){_0x238d1e[_0x4b1f79]=_0x1ffd9e[_0x2b9a('0x42')];}}});}return _0x238d1e;}function getTicket(_0x2db4d5,_0x33e487,_0x3af997,_0x52cb11,_0x48fd03,_0x35ab9f,_0x37d055){return new Promise(function(_0xa95210,_0x5cb5fd){var _0x578c77;return getAuthToken(_0x33e487,_0x3af997,_0x37d055)[_0x2b9a('0x13')](function(_0x4a3edf){if(_0x35ab9f[_0x2b9a('0x43')]==='incident'){_0x578c77={'method':_0x2b9a('0x44'),'uri':_0x52cb11+_0x2b9a('0x45'),'body':Object['assign']({},{'title':intUtil['getString'](_0x35ab9f['Subjects'],_0x48fd03,'\x20'),'description':intUtil[_0x2b9a('0x46')](_0x35ab9f[_0x2b9a('0x47')],_0x48fd03,'\x0a'),'customerid_contact@odata.bind':_0x2db4d5['enduserId']?_0x2b9a('0x48')+_0x2db4d5[_0x2b9a('0x30')]+')':undefined,'ownerid@odata.bind':_0x2b9a('0x29')+_0x2db4d5[_0x2b9a('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x35ab9f[_0x2b9a('0x49')],_0x48fd03,_0x35ab9f[_0x2b9a('0x43')])),'headers':{'Authorization':_0x2b9a('0x2a')+_0x4a3edf,'OData-Version':_0x2b9a('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x35ab9f[_0x2b9a('0x43')]==='phonecall'){var _0x189a1a=_0x2db4d5[_0x2b9a('0x30')]?[{'partyid_systemuser@odata.bind':_0x2b9a('0x29')+_0x2db4d5[_0x2b9a('0x22')]+')','participationtypemask':_0x2db4d5[_0x2b9a('0x4a')]===_0x2b9a('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x2b9a('0x48')+_0x2db4d5[_0x2b9a('0x30')]+')','participationtypemask':_0x2db4d5['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2b9a('0x29')+_0x2db4d5[_0x2b9a('0x22')]+')','participationtypemask':_0x2db4d5['callDirection']===_0x2b9a('0x4b')?0x2:0x1}];_0x578c77={'method':_0x2b9a('0x44'),'uri':_0x52cb11+_0x2b9a('0x4c'),'body':Object[_0x2b9a('0x4d')]({},{'subject':intUtil[_0x2b9a('0x46')](_0x35ab9f[_0x2b9a('0x4e')],_0x48fd03,'\x20'),'phonenumber':String(_0x48fd03[_0x2b9a('0x27')]),'description':intUtil['getString'](_0x35ab9f[_0x2b9a('0x47')],_0x48fd03,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2db4d5['enduserId']?'/contacts('+_0x2db4d5[_0x2b9a('0x30')]+')':undefined,'ownerid@odata.bind':_0x2b9a('0x29')+_0x2db4d5[_0x2b9a('0x22')]+')','directioncode':_0x2db4d5[_0x2b9a('0x4a')]===_0x2b9a('0x4b')?![]:!![],'phonecall_activity_parties':_0x189a1a},getCustomFields(_0x35ab9f[_0x2b9a('0x49')],_0x48fd03,_0x35ab9f['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x4a3edf,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x578c77);})[_0x2b9a('0x13')](function(_0x5ad21b){var _0x406e1e=_0x5ad21b['headers'][_0x2b9a('0x4f')];var _0x4a20b9=_0x406e1e[_0x2b9a('0x2e')](_0x406e1e[_0x2b9a('0x2f')]('(')+0x1,_0x406e1e['lastIndexOf'](')'));_0x2db4d5[_0x2b9a('0x50')]=_0x4a20b9;_0xa95210(_0x2db4d5);})[_0x2b9a('0x15')](function(_0x250fa8){_0x5cb5fd(_0x250fa8[_0x2b9a('0x31')]);});});}function emit(_0x21b8b3,_0x374431,_0x4d0232,_0x29bfee){var _0x233298={'uri':util[_0x2b9a('0x51')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x21b8b3,_0x4d0232,_0x29bfee)};io['to'](util[_0x2b9a('0x51')](_0x2b9a('0x52'),_0x374431))[_0x2b9a('0x53')]('trigger:browser:url',_0x233298);}exports['cs']=function(_0x49a654,_0x5be3b4,_0x2f47ce,_0x15a6e2,_0x59d0fd,_0x41d974,_0x1ec143,_0x314f26){var _0x520f59={};_0x41d974[_0x2b9a('0xb')]=_0x41d974['modernAuthentication']?intUtil[_0x2b9a('0x54')](_0x41d974[_0x2b9a('0xc')][_0x2b9a('0xd')]):intUtil[_0x2b9a('0x54')](_0x41d974['remoteUri']);_0x41d974[_0x2b9a('0x55')]=intUtil[_0x2b9a('0x54')](_0x41d974[_0x2b9a('0x55')]);_0x520f59[_0x2b9a('0x4a')]=_0x314f26===_0x2b9a('0x4b')||_0x314f26===_0x2b9a('0x56')?_0x2b9a('0x4b'):_0x2b9a('0x25');var _0x180409=_0x41d974[_0x2b9a('0xa')]?util['format'](_0x2b9a('0x57'),_0x41d974[_0x2b9a('0xc')][_0x2b9a('0xd')]):util['format'](_0x2b9a('0x57'),_0x41d974[_0x2b9a('0xb')]);var _0x4c7d6b=util['format'](_0x2b9a('0x58'),_0x41d974[_0x2b9a('0xe')]);var _0x22020e=util[_0x2b9a('0x51')](_0x2b9a('0x59'),_0x41d974[_0x2b9a('0x55')],_0x5be3b4[_0x2b9a('0x5a')],md5(_0x5be3b4['uniqueid']));if(_0x59d0fd&&_0x59d0fd[_0x2b9a('0x5b')]){logger['info'](_0x2b9a('0x5c'),_0x2b9a('0x5d'));_0x5be3b4['recordingURL']=_0x22020e;}else if(_0x1ec143&&_0x1ec143[_0x2b9a('0x5e')]&&_0x1ec143[_0x2b9a('0x5e')]!==_0x2b9a('0x5f')){logger[_0x2b9a('0x20')](_0x2b9a('0x60'),'Recording\x20is\x20enabled!');_0x5be3b4[_0x2b9a('0x61')]=_0x22020e;}else{_0x5be3b4[_0x2b9a('0x61')]='';}return getUser(_0x520f59,_0x41d974,_0x15a6e2,_0x4c7d6b,_0x180409,_0x314f26)[_0x2b9a('0x13')](function(_0x3aeef9){logger['info']('['+_0x314f26[_0x2b9a('0x17')]()+_0x2b9a('0x62'),_0x3aeef9['userId']);logger[_0x2b9a('0x20')]('['+_0x314f26[_0x2b9a('0x17')]()+_0x2b9a('0x63'),_0x3aeef9[_0x2b9a('0x23')]);return getEndUser(_0x3aeef9,_0x41d974,_0x4c7d6b,_0x180409,_0x5be3b4,_0x314f26,_0x2f47ce[_0x2b9a('0x64')],_0x2f47ce[_0x2b9a('0x65')]);})['then'](function(_0x8c8ac5){logger[_0x2b9a('0x20')]('['+_0x314f26[_0x2b9a('0x17')]()+_0x2b9a('0x66'),_0x8c8ac5['enduserId']);logger[_0x2b9a('0x20')]('['+_0x314f26[_0x2b9a('0x17')]()+_0x2b9a('0x67'),_0x5be3b4[_0x2b9a('0x27')]);return getTicket(_0x8c8ac5,_0x41d974,_0x4c7d6b,_0x180409,_0x5be3b4,_0x2f47ce,_0x314f26);})[_0x2b9a('0x13')](function(_0x2224b1){logger[_0x2b9a('0x20')](util[_0x2b9a('0x51')]('['+_0x314f26['toUpperCase']()+_0x2b9a('0x68'),_0x2f47ce['ticketType'],_0x2224b1[_0x2b9a('0x50')]));logger[_0x2b9a('0x20')](util[_0x2b9a('0x51')]('['+_0x314f26[_0x2b9a('0x17')]()+_0x2b9a('0x69'),_0x314f26));if(_0x314f26!==_0x2b9a('0x56')&&_0x2f47ce[_0x2b9a('0x6a')]){logger[_0x2b9a('0x20')]('['+_0x314f26[_0x2b9a('0x17')]()+']',_0x2b9a('0x6b'));emit(_0x41d974[_0x2b9a('0xb')],_0x15a6e2['name'],_0x2f47ce[_0x2b9a('0x43')],_0x2224b1['ticketId']);}})['catch'](function(_0x5f070d){logger[_0x2b9a('0x16')]('['+_0x314f26[_0x2b9a('0x17')]()+_0x2b9a('0x6c'),_0x5f070d['message']);console[_0x2b9a('0x16')](_0x2b9a('0x6d'),_0x5f070d);});}; \ 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 a156eab..0907712 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 _0xc136=['monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','Tags','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','base64','stringify','map','forEach','includes','string','type','nameField','customField','content','toString','picklist','idField','push','variableName','customVariable','Variable','toLowerCase','name','stripTrailingSlash','serverUrl'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xc136,0x6f));var _0x6c13=function(_0x58619b,_0x6bd8c7){_0x58619b=_0x58619b-0x0;var _0x507201=_0xc136[_0x58619b];return _0x507201;};'use strict';var _=require(_0x6c13('0x0'));var rp=require('request-promise');var md5=require(_0x6c13('0x1'));var util=require(_0x6c13('0x2'));var Redis=require(_0x6c13('0x3'));var intUtil=require(_0x6c13('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6c13('0x5'))('freshdesk');config[_0x6c13('0x6')]=_[_0x6c13('0x7')](config[_0x6c13('0x6')],{'host':_0x6c13('0x8'),'port':0x18eb});var io=require(_0x6c13('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x6c13('0xa'),'Accept':_0x6c13('0xa')};function emit(_0x1e0b5f,_0x39191d,_0x181f30){io['to'](_0x1e0b5f)[_0x6c13('0xb')](_0x39191d,_0x181f30);}function getTicket(_0x18d1aa,_0x4951cb,_0xf145d0,_0x5c4de5,_0x25d937){logger['info'](_0x6c13('0xc'));var _0x2b3b6c=_['merge']({'responder_id':_0x4951cb['id'],'requester_id':_0xf145d0['id'],'name':util[_0x6c13('0xd')](_0x6c13('0xe'),_0x25d937['calleridname']),'phone':_0x25d937[_0x6c13('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5c4de5[_0x6c13('0x10')],_0x25d937,'\x20'),'description':intUtil[_0x6c13('0x11')](_0x5c4de5[_0x6c13('0x12')],_0x25d937,'
'),'tags':getTags(_0x5c4de5[_0x6c13('0x13')],'name')},getCustomFields(_0x5c4de5[_0x6c13('0x14')],_0x25d937));_0x2b3b6c['custom_fields']=_[_0x6c13('0x15')](_[_0x6c13('0x16')](_0x2b3b6c[_0x6c13('0x17')],'id'),_0x6c13('0x18'));return request({'uri':util[_0x6c13('0xd')](_0x6c13('0x19'),_0x18d1aa[_0x6c13('0x1a')]),'method':_0x6c13('0x1b'),'body':_0x2b3b6c})[_0x6c13('0x1c')](function(_0x2ead3c){logger[_0x6c13('0x1d')](_0x6c13('0x1e'));return _0x2ead3c;});}function getUser(_0x555517,_0x32b81b){if(intUtil[_0x6c13('0x1f')](_0x32b81b)){return request({'uri':util['format']('%s/api/v2/agents',_0x555517[_0x6c13('0x1a')]),'qs':{'email':_0x32b81b}})['then'](function(_0x532063){if(_0x532063[_0x6c13('0x20')]){logger[_0x6c13('0x1d')](_0x6c13('0x21'));return _[_0x6c13('0x22')](_0x532063,function(_0x2350e6){return _0x2350e6[_0x6c13('0x23')][_0x6c13('0x24')]===_0x32b81b;});}else{logger[_0x6c13('0x1d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x6c13('0xd')](_0x6c13('0x25'),_0x555517[_0x6c13('0x1a')])})[_0x6c13('0x1c')](function(_0x5c0a15){logger[_0x6c13('0x1d')](_0x6c13('0x26'));return _0x5c0a15;});}});}else{logger[_0x6c13('0x1d')](_0x6c13('0x27'));return request({'uri':util[_0x6c13('0xd')]('%s/api/v2/agents/me',_0x555517['remoteUri'])})[_0x6c13('0x1c')](function(_0x1e310b){logger[_0x6c13('0x1d')](_0x6c13('0x26'));return _0x1e310b;});}}function getEndUser(_0x27c44e,_0x2ba87b,_0x41b34f){logger[_0x6c13('0x1d')]('Searching\x20enduser\x20with\x20phone',_0x41b34f);return request({'uri':util[_0x6c13('0xd')](_0x6c13('0x28'),_0x27c44e[_0x6c13('0x1a')]),'qs':{'phone':_0x41b34f}})[_0x6c13('0x1c')](function(_0x38a60f){if(_0x38a60f['length']){logger[_0x6c13('0x1d')]('Enduser\x20found!');return _['find'](_0x38a60f,{'phone':_0x41b34f});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x6c13('0xd')]('%s/api/v2/contacts',_0x27c44e[_0x6c13('0x1a')]),'method':_0x6c13('0x1b'),'body':{'name':_0x2ba87b,'phone':_0x41b34f}})[_0x6c13('0x1c')](function(_0x23a399){logger[_0x6c13('0x1d')](_0x6c13('0x29'));return _0x23a399;});}});}function getAuth(_0x56a44d){return util['format'](_0x6c13('0x2a'),new Buffer(_0x56a44d[_0x6c13('0x2b')]+':X')['toString'](_0x6c13('0x2c')));}function request(_0x4424ec){logger['debug']('[HTTP]',JSON[_0x6c13('0x2d')](_0x4424ec));return rp(_[_0x6c13('0x7')](_0x4424ec,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x225d53,_0x528621){var _0x302419=[];if(_0x225d53&&_0x225d53[_0x6c13('0x20')]>0x0){_0x302419=_[_0x6c13('0x2e')](_0x225d53,_0x528621);}return _0x302419;}function getCustomFields(_0x8bba3c,_0xcdab2d){var _0x4eb2d4=[];var _0x411cb7={'custom_fields':[]};if(_0x8bba3c[_0x6c13('0x20')]>0x0){_[_0x6c13('0x2f')](_0x8bba3c,function(_0x2c6f25){if(_[_0x6c13('0x30')]([_0x6c13('0x31'),'picklist'],_0x2c6f25[_0x6c13('0x32')])&&_0x2c6f25[_0x6c13('0x33')]&&!_0x2c6f25[_0x6c13('0x34')]){_0x411cb7[_0x2c6f25['nameField']['toLowerCase']()]=_0x2c6f25[_0x6c13('0x35')][_0x6c13('0x36')]();}else if(_['includes']([_0x6c13('0x31'),_0x6c13('0x37')],_0x2c6f25['type'])&&_0x2c6f25[_0x6c13('0x38')]&&_0x2c6f25[_0x6c13('0x34')]){_0x411cb7['custom_fields'][_0x6c13('0x39')]({'id':_0x2c6f25[_0x6c13('0x38')],'value':_0x2c6f25[_0x6c13('0x35')][_0x6c13('0x36')]()});}else if(_0x2c6f25['type']==='variable'&&_0x2c6f25[_0x6c13('0x3a')]&&_0x2c6f25['idField']&&_0x2c6f25[_0x6c13('0x34')]){_0xcdab2d[_0x2c6f25[_0x6c13('0x3a')]]&&_0x411cb7[_0x6c13('0x17')][_0x6c13('0x39')]({'id':_0x2c6f25[_0x6c13('0x38')],'value':_0xcdab2d[_0x2c6f25['variableName']][_0x6c13('0x36')]()});}else if(_0x2c6f25['type']===_0x6c13('0x3b')&&_0x2c6f25[_0x6c13('0x3c')]&&_0x2c6f25['Variable']['name']&&_0x2c6f25[_0x6c13('0x38')]&&_0x2c6f25[_0x6c13('0x34')]){_0xcdab2d[_0x2c6f25[_0x6c13('0x3c')]['name'][_0x6c13('0x3d')]()]&&_0x411cb7['custom_fields'][_0x6c13('0x39')]({'id':_0x2c6f25['idField'],'value':_0xcdab2d[_0x2c6f25[_0x6c13('0x3c')][_0x6c13('0x3e')][_0x6c13('0x3d')]()][_0x6c13('0x36')]()});}});}return _0x411cb7;}exports['queue']=function(_0x2d6a58,_0x407be6,_0x3755ef,_0x59e5c9,_0x168020,_0x128169){var _0xfea20b,_0xbe50df;_0x128169[_0x6c13('0x1a')]=intUtil[_0x6c13('0x3f')](_0x128169[_0x6c13('0x1a')]);_0x128169[_0x6c13('0x40')]=intUtil[_0x6c13('0x3f')](_0x128169['serverUrl']);if(_0x168020&&_0x168020[_0x6c13('0x41')]){logger[_0x6c13('0x1d')](_0x6c13('0x42'),'Recording\x20is\x20enabled!');_0x407be6[_0x6c13('0x43')]=util[_0x6c13('0xd')](_0x6c13('0x44'),_0x128169['serverUrl'],_0x407be6[_0x6c13('0x45')],md5(_0x407be6['uniqueid']));}else{_0x407be6[_0x6c13('0x43')]='';}headers[_0x6c13('0x46')]=getAuth(_0x128169);return getUser(_0x128169,_0x59e5c9[_0x6c13('0x24')])[_0x6c13('0x1c')](function(_0x313082){_0xfea20b=_0x313082;logger['info']('The\x20User\x20ID\x20is:',_0xfea20b['id']);return getEndUser(_0x128169,_0x407be6[_0x6c13('0x47')],_0x407be6[_0x6c13('0xf')]);})['then'](function(_0x35f5fc){_0xbe50df=_0x35f5fc;logger[_0x6c13('0x1d')](_0x6c13('0x48'),_0xbe50df['id']);return getTicket(_0x128169,_0xfea20b,_0xbe50df,_0x3755ef,_0x407be6);})[_0x6c13('0x1c')](function(_0x46a545){if(_0x46a545&&_0x46a545['id']){logger[_0x6c13('0x1d')](_0x6c13('0x1e'));logger['info'](_0x6c13('0x49'),_0x46a545['id']);logger['info'](_0x6c13('0x42'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x6c13('0x4a'),_0x59e5c9['name']),_0x6c13('0x4b'),{'uri':util['format'](_0x6c13('0x4c'),_0x128169[_0x6c13('0x1a')],_0x46a545['id'])});}})[_0x6c13('0x4d')](function(_0x162a02){logger[_0x6c13('0x4e')]('[QUEUE]',JSON[_0x6c13('0x2d')](_0x162a02));});};exports[_0x6c13('0x4f')]=function(_0x3a286d,_0x3031ce,_0x1dad5a,_0x5a1797,_0x15d8f7,_0x2c7ac9,_0x5e244d){var _0x13025a,_0x22cb7a;_0x2c7ac9['remoteUri']=intUtil[_0x6c13('0x3f')](_0x2c7ac9[_0x6c13('0x1a')]);_0x2c7ac9[_0x6c13('0x40')]=intUtil['stripTrailingSlash'](_0x2c7ac9['serverUrl']);if(_0x5e244d&&_0x5e244d['recordingFormat']&&_0x5e244d['recordingFormat']!==_0x6c13('0x50')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3031ce['recordingURL']=util[_0x6c13('0xd')](_0x6c13('0x44'),_0x2c7ac9[_0x6c13('0x40')],_0x3031ce['uniqueid'],md5(_0x3031ce[_0x6c13('0x45')]));}headers[_0x6c13('0x46')]=getAuth(_0x2c7ac9);return getUser(_0x2c7ac9,_0x5a1797[_0x6c13('0x24')])[_0x6c13('0x1c')](function(_0x3b02dc){_0x13025a=_0x3b02dc;logger[_0x6c13('0x1d')](_0x6c13('0x51'),_0x13025a['id']);return getEndUser(_0x2c7ac9,_0x3031ce[_0x6c13('0x52')],_0x3031ce[_0x6c13('0x53')]);})[_0x6c13('0x1c')](function(_0x99c366){_0x22cb7a=_0x99c366;logger[_0x6c13('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x22cb7a['id']);return getTicket(_0x2c7ac9,_0x13025a,_0x22cb7a,_0x1dad5a,_0x3031ce);})[_0x6c13('0x1c')](function(_0x534bab){if(_0x534bab&&_0x534bab['id']){logger[_0x6c13('0x1d')]('Ticket\x20created!');logger[_0x6c13('0x1d')](_0x6c13('0x49'),_0x534bab['id']);logger[_0x6c13('0x1d')](_0x6c13('0x54'),_0x6c13('0x55'));emit(util[_0x6c13('0xd')](_0x6c13('0x4a'),_0x5a1797[_0x6c13('0x3e')]),_0x6c13('0x4b'),{'uri':util[_0x6c13('0xd')](_0x6c13('0x4c'),_0x2c7ac9[_0x6c13('0x1a')],_0x534bab['id'])});}})[_0x6c13('0x4d')](function(_0x590d58){logger[_0x6c13('0x4e')](_0x6c13('0x54'),JSON[_0x6c13('0x2d')](_0x590d58));});};exports[_0x6c13('0x56')]=function(_0x4ec37d,_0x3d4368,_0x549f8e,_0x4bac0b,_0x18ed00,_0x7af771){var _0x11ab0e,_0x1a005f;_0x7af771[_0x6c13('0x1a')]=intUtil['stripTrailingSlash'](_0x7af771[_0x6c13('0x1a')]);_0x7af771[_0x6c13('0x40')]=intUtil[_0x6c13('0x3f')](_0x7af771[_0x6c13('0x40')]);if(_0x18ed00&&_0x18ed00[_0x6c13('0x41')]){logger[_0x6c13('0x1d')]('['+_0x3d4368['lastevent'][_0x6c13('0x57')]()+']','Recording\x20is\x20enabled!');_0x3d4368[_0x6c13('0x43')]=util[_0x6c13('0xd')](_0x6c13('0x44'),_0x7af771[_0x6c13('0x40')],_0x3d4368['uniqueid'],md5(_0x3d4368[_0x6c13('0x45')]));}else{_0x3d4368[_0x6c13('0x43')]='';}headers[_0x6c13('0x46')]=getAuth(_0x7af771);return getUser(_0x7af771,'')[_0x6c13('0x1c')](function(_0x35ce4d){_0x11ab0e=_0x35ce4d;logger['info'](_0x6c13('0x51'),_0x11ab0e['id']);return getEndUser(_0x7af771,_0x3d4368[_0x6c13('0x47')],_0x3d4368['calleridnum']);})['then'](function(_0x3197bf){_0x1a005f=_0x3197bf;logger[_0x6c13('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x1a005f['id']);return getTicket(_0x7af771,_0x11ab0e,_0x1a005f,_0x549f8e,_0x3d4368);})[_0x6c13('0x1c')](function(_0xceffed){if(_0xceffed){logger[_0x6c13('0x1d')](_0x6c13('0x1e'));logger[_0x6c13('0x1d')](_0x6c13('0x49'),_0xceffed['id']);}})['catch'](function(_0x11a65c){logger[_0x6c13('0x4e')]('['+_0x3d4368['lastevent']['toUpperCase']()+']',JSON[_0x6c13('0x2d')](_0x11a65c));});}; \ No newline at end of file +var _0xb87f=['destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','info','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Basic\x20%s','toString','base64','[HTTP]','stringify','defaults','length','map','forEach','includes','string','picklist','customField','toLowerCase','type','push','idField','content','variable','variableName','Variable','queue','serverUrl','[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:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb87f,0x15e));var _0xfb87=function(_0x45e769,_0x4a93bd){_0x45e769=_0x45e769-0x0;var _0x1fcf2e=_0xb87f[_0x45e769];return _0x1fcf2e;};'use strict';var _=require(_0xfb87('0x0'));var rp=require(_0xfb87('0x1'));var md5=require(_0xfb87('0x2'));var util=require('util');var Redis=require(_0xfb87('0x3'));var intUtil=require(_0xfb87('0x4'));var config=require(_0xfb87('0x5'));var logger=require(_0xfb87('0x6'))(_0xfb87('0x7'));config[_0xfb87('0x8')]=_['defaults'](config[_0xfb87('0x8')],{'host':_0xfb87('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfb87('0x8')]));var headers={'Content-Type':_0xfb87('0xa'),'Accept':_0xfb87('0xa')};function emit(_0x49cab9,_0xdbdb71,_0x59e24c){io['to'](_0x49cab9)['emit'](_0xdbdb71,_0x59e24c);}function getTicket(_0x1bb990,_0x2dfa74,_0xba89a6,_0x472967,_0xb012c0){logger[_0xfb87('0xb')]('Creating\x20new\x20ticket...');var _0x32be0b=_[_0xfb87('0xc')]({'responder_id':_0x2dfa74['id'],'requester_id':_0xba89a6['id'],'name':util[_0xfb87('0xd')]('Caller\x20-\x20%s',_0xb012c0[_0xfb87('0xe')]),'phone':_0xb012c0[_0xfb87('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xfb87('0x10')](_0x472967[_0xfb87('0x11')],_0xb012c0,'\x20'),'description':intUtil['getString'](_0x472967[_0xfb87('0x12')],_0xb012c0,'
'),'tags':getTags(_0x472967[_0xfb87('0x13')],_0xfb87('0x14'))},getCustomFields(_0x472967[_0xfb87('0x15')],_0xb012c0));_0x32be0b['custom_fields']=_[_0xfb87('0x16')](_['keyBy'](_0x32be0b[_0xfb87('0x17')],'id'),_0xfb87('0x18'));return request({'uri':util[_0xfb87('0xd')](_0xfb87('0x19'),_0x1bb990[_0xfb87('0x1a')]),'method':_0xfb87('0x1b'),'body':_0x32be0b})['then'](function(_0x321457){logger[_0xfb87('0xb')](_0xfb87('0x1c'));return _0x321457;});}function getUser(_0xcddc15,_0xf8e3ba){if(intUtil[_0xfb87('0x1d')](_0xf8e3ba)){return request({'uri':util[_0xfb87('0xd')](_0xfb87('0x1e'),_0xcddc15[_0xfb87('0x1a')]),'qs':{'email':_0xf8e3ba}})[_0xfb87('0x1f')](function(_0x4a756d){if(_0x4a756d['length']){logger[_0xfb87('0xb')]('Agent\x20found!');return _[_0xfb87('0x20')](_0x4a756d,function(_0x37dbf9){return _0x37dbf9['contact'][_0xfb87('0x21')]===_0xf8e3ba;});}else{logger['info'](_0xfb87('0x22'));return request({'uri':util[_0xfb87('0xd')](_0xfb87('0x23'),_0xcddc15[_0xfb87('0x1a')])})[_0xfb87('0x1f')](function(_0x3c9f72){logger[_0xfb87('0xb')]('Admin\x20account\x20selected.');return _0x3c9f72;});}});}else{logger[_0xfb87('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0xcddc15['remoteUri'])})['then'](function(_0x510b99){logger[_0xfb87('0xb')](_0xfb87('0x24'));return _0x510b99;});}}function getEndUser(_0x3533fd,_0x40fce9,_0x703f11){logger[_0xfb87('0xb')](_0xfb87('0x25'),_0x703f11);return request({'uri':util[_0xfb87('0xd')](_0xfb87('0x26'),_0x3533fd[_0xfb87('0x1a')]),'qs':{'phone':_0x703f11}})[_0xfb87('0x1f')](function(_0x386584){if(_0x386584['length']){logger['info']('Enduser\x20found!');return _[_0xfb87('0x20')](_0x386584,{'phone':_0x703f11});}else{logger[_0xfb87('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xfb87('0xd')](_0xfb87('0x26'),_0x3533fd[_0xfb87('0x1a')]),'method':_0xfb87('0x1b'),'body':{'name':_0x40fce9,'phone':_0x703f11}})[_0xfb87('0x1f')](function(_0x30ffd6){logger['info']('Enduser\x20created.');return _0x30ffd6;});}});}function getAuth(_0x490126){return util[_0xfb87('0xd')](_0xfb87('0x27'),new Buffer(_0x490126['apiKey']+':X')[_0xfb87('0x28')](_0xfb87('0x29')));}function request(_0x4b3ba2){logger['debug'](_0xfb87('0x2a'),JSON[_0xfb87('0x2b')](_0x4b3ba2));return rp(_[_0xfb87('0x2c')](_0x4b3ba2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3dbaeb,_0x12be6b){var _0x222f17=[];if(_0x3dbaeb&&_0x3dbaeb[_0xfb87('0x2d')]>0x0){_0x222f17=_[_0xfb87('0x2e')](_0x3dbaeb,_0x12be6b);}return _0x222f17;}function getCustomFields(_0x276504,_0x3f90f5){var _0x4edfc7=[];var _0x40ec2a={'custom_fields':[]};if(_0x276504[_0xfb87('0x2d')]>0x0){_[_0xfb87('0x2f')](_0x276504,function(_0x39225a){if(_[_0xfb87('0x30')]([_0xfb87('0x31'),_0xfb87('0x32')],_0x39225a['type'])&&_0x39225a['nameField']&&!_0x39225a[_0xfb87('0x33')]){_0x40ec2a[_0x39225a['nameField'][_0xfb87('0x34')]()]=_0x39225a['content'][_0xfb87('0x28')]();}else if(_['includes']([_0xfb87('0x31'),_0xfb87('0x32')],_0x39225a[_0xfb87('0x35')])&&_0x39225a['idField']&&_0x39225a[_0xfb87('0x33')]){_0x40ec2a[_0xfb87('0x17')][_0xfb87('0x36')]({'id':_0x39225a[_0xfb87('0x37')],'value':_0x39225a[_0xfb87('0x38')][_0xfb87('0x28')]()});}else if(_0x39225a[_0xfb87('0x35')]===_0xfb87('0x39')&&_0x39225a['variableName']&&_0x39225a['idField']&&_0x39225a['customField']){_0x3f90f5[_0x39225a[_0xfb87('0x3a')]]&&_0x40ec2a['custom_fields'][_0xfb87('0x36')]({'id':_0x39225a[_0xfb87('0x37')],'value':_0x3f90f5[_0x39225a[_0xfb87('0x3a')]][_0xfb87('0x28')]()});}else if(_0x39225a[_0xfb87('0x35')]==='customVariable'&&_0x39225a['Variable']&&_0x39225a[_0xfb87('0x3b')][_0xfb87('0x14')]&&_0x39225a[_0xfb87('0x37')]&&_0x39225a[_0xfb87('0x33')]){_0x3f90f5[_0x39225a[_0xfb87('0x3b')]['name'][_0xfb87('0x34')]()]&&_0x40ec2a['custom_fields'][_0xfb87('0x36')]({'id':_0x39225a[_0xfb87('0x37')],'value':_0x3f90f5[_0x39225a[_0xfb87('0x3b')]['name'][_0xfb87('0x34')]()][_0xfb87('0x28')]()});}});}return _0x40ec2a;}exports[_0xfb87('0x3c')]=function(_0x4f30ec,_0x286ff7,_0x4b8fbc,_0x2985c6,_0x297a84,_0x2f07ca){var _0x333276,_0x2f3e0e;_0x2f07ca[_0xfb87('0x1a')]=intUtil['stripTrailingSlash'](_0x2f07ca[_0xfb87('0x1a')]);_0x2f07ca[_0xfb87('0x3d')]=intUtil['stripTrailingSlash'](_0x2f07ca[_0xfb87('0x3d')]);if(_0x297a84&&_0x297a84['monitor_format']){logger[_0xfb87('0xb')](_0xfb87('0x3e'),_0xfb87('0x3f'));_0x286ff7[_0xfb87('0x40')]=util['format'](_0xfb87('0x41'),_0x2f07ca['serverUrl'],_0x286ff7[_0xfb87('0x42')],md5(_0x286ff7[_0xfb87('0x42')]));}else{_0x286ff7['recordingURL']='';}headers[_0xfb87('0x43')]=getAuth(_0x2f07ca);return getUser(_0x2f07ca,_0x2985c6[_0xfb87('0x21')])[_0xfb87('0x1f')](function(_0x31b951){_0x333276=_0x31b951;logger[_0xfb87('0xb')](_0xfb87('0x44'),_0x333276['id']);return getEndUser(_0x2f07ca,_0x286ff7['calleridname'],_0x286ff7[_0xfb87('0xf')]);})[_0xfb87('0x1f')](function(_0x3c5e1f){_0x2f3e0e=_0x3c5e1f;logger[_0xfb87('0xb')](_0xfb87('0x45'),_0x2f3e0e['id']);return getTicket(_0x2f07ca,_0x333276,_0x2f3e0e,_0x4b8fbc,_0x286ff7);})[_0xfb87('0x1f')](function(_0x96e1ea){if(_0x96e1ea&&_0x96e1ea['id']){logger[_0xfb87('0xb')](_0xfb87('0x1c'));logger[_0xfb87('0xb')]('The\x20Ticket\x20ID\x20is:',_0x96e1ea['id']);logger['info']('[QUEUE]',_0xfb87('0x46'));emit(util['format'](_0xfb87('0x47'),_0x2985c6[_0xfb87('0x14')]),_0xfb87('0x48'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x2f07ca['remoteUri'],_0x96e1ea['id'])});}})[_0xfb87('0x49')](function(_0x377df2){logger[_0xfb87('0x4a')]('[QUEUE]',JSON[_0xfb87('0x2b')](_0x377df2));});};exports[_0xfb87('0x4b')]=function(_0x2dac06,_0xfcee07,_0x203dc0,_0x1db1a7,_0x288ffb,_0x53d88e,_0x2fe724){var _0x40bc9d,_0x9d84b;_0x53d88e['remoteUri']=intUtil[_0xfb87('0x4c')](_0x53d88e[_0xfb87('0x1a')]);_0x53d88e[_0xfb87('0x3d')]=intUtil['stripTrailingSlash'](_0x53d88e[_0xfb87('0x3d')]);if(_0x2fe724&&_0x2fe724[_0xfb87('0x4d')]&&_0x2fe724[_0xfb87('0x4d')]!==_0xfb87('0x4e')){logger[_0xfb87('0xb')](_0xfb87('0x4f'),'Recording\x20is\x20enabled!');_0xfcee07['recordingURL']=util[_0xfb87('0xd')](_0xfb87('0x41'),_0x53d88e[_0xfb87('0x3d')],_0xfcee07['uniqueid'],md5(_0xfcee07[_0xfb87('0x42')]));}headers[_0xfb87('0x43')]=getAuth(_0x53d88e);return getUser(_0x53d88e,_0x1db1a7['email'])[_0xfb87('0x1f')](function(_0x414c1b){_0x40bc9d=_0x414c1b;logger[_0xfb87('0xb')]('The\x20User\x20ID\x20is:',_0x40bc9d['id']);return getEndUser(_0x53d88e,_0xfcee07[_0xfb87('0x50')],_0xfcee07[_0xfb87('0x51')]);})[_0xfb87('0x1f')](function(_0x67f015){_0x9d84b=_0x67f015;logger[_0xfb87('0xb')](_0xfb87('0x45'),_0x9d84b['id']);return getTicket(_0x53d88e,_0x40bc9d,_0x9d84b,_0x203dc0,_0xfcee07);})[_0xfb87('0x1f')](function(_0x33dfec){if(_0x33dfec&&_0x33dfec['id']){logger[_0xfb87('0xb')]('Ticket\x20created!');logger[_0xfb87('0xb')](_0xfb87('0x52'),_0x33dfec['id']);logger['info'](_0xfb87('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfb87('0xd')](_0xfb87('0x47'),_0x1db1a7[_0xfb87('0x14')]),_0xfb87('0x48'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x53d88e[_0xfb87('0x1a')],_0x33dfec['id'])});}})['catch'](function(_0x256d14){logger[_0xfb87('0x4a')](_0xfb87('0x4f'),JSON[_0xfb87('0x2b')](_0x256d14));});};exports[_0xfb87('0x53')]=function(_0x2142ff,_0x56d5e2,_0x1074dd,_0x519cec,_0xfc65e7,_0x5593a4){var _0x49bf3c,_0x153085;_0x5593a4[_0xfb87('0x1a')]=intUtil[_0xfb87('0x4c')](_0x5593a4[_0xfb87('0x1a')]);_0x5593a4['serverUrl']=intUtil[_0xfb87('0x4c')](_0x5593a4[_0xfb87('0x3d')]);if(_0xfc65e7&&_0xfc65e7['monitor_format']){logger[_0xfb87('0xb')]('['+_0x56d5e2['lastevent'][_0xfb87('0x54')]()+']',_0xfb87('0x3f'));_0x56d5e2[_0xfb87('0x40')]=util['format'](_0xfb87('0x41'),_0x5593a4[_0xfb87('0x3d')],_0x56d5e2[_0xfb87('0x42')],md5(_0x56d5e2['uniqueid']));}else{_0x56d5e2[_0xfb87('0x40')]='';}headers[_0xfb87('0x43')]=getAuth(_0x5593a4);return getUser(_0x5593a4,'')[_0xfb87('0x1f')](function(_0x235aee){_0x49bf3c=_0x235aee;logger[_0xfb87('0xb')](_0xfb87('0x44'),_0x49bf3c['id']);return getEndUser(_0x5593a4,_0x56d5e2[_0xfb87('0xe')],_0x56d5e2[_0xfb87('0xf')]);})['then'](function(_0x2c5ce6){_0x153085=_0x2c5ce6;logger['info'](_0xfb87('0x45'),_0x153085['id']);return getTicket(_0x5593a4,_0x49bf3c,_0x153085,_0x1074dd,_0x56d5e2);})[_0xfb87('0x1f')](function(_0x388873){if(_0x388873){logger[_0xfb87('0xb')](_0xfb87('0x1c'));logger[_0xfb87('0xb')](_0xfb87('0x52'),_0x388873['id']);}})[_0xfb87('0x49')](function(_0x96a55c){logger['error']('['+_0x56d5e2[_0xfb87('0x55')][_0xfb87('0x54')]()+']',JSON[_0xfb87('0x2b')](_0x96a55c));});}; \ 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 5f0505a..3654fcf 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 _0x105b=['serverUrl','remoteUri','username','toLowerCase','outbound','destcalleridnum','calleridnum','unmanaged','email','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','bluebird','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','length','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminId','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','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','format','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Contact','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','apiKey','stripTrailingSlash'];(function(_0x5873c3,_0x2ee2d1){var _0xf51d04=function(_0x3f5344){while(--_0x3f5344){_0x5873c3['push'](_0x5873c3['shift']());}};_0xf51d04(++_0x2ee2d1);}(_0x105b,0x15a));var _0xb105=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x105b[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xb105('0x0'));var util=require(_0xb105('0x1'));var moment=require('moment');var Promise=require(_0xb105('0x2'));var Redis=require('ioredis');var intUtil=require(_0xb105('0x3'));var config=require('../../../../config/environment');var logger=require(_0xb105('0x4'))('freshsales');config[_0xb105('0x5')]=_[_0xb105('0x6')](config[_0xb105('0x5')],{'host':_0xb105('0x7'),'port':0x18eb});var io=require(_0xb105('0x8'))(new Redis(config[_0xb105('0x5')]));function getAdminId(_0x500635,_0x17a309,_0x2c8b27,_0x45a9fa){return new Promise(function(_0x42d904,_0x16a031){var _0x5c874b=![];var _0x2c3c40={'method':_0xb105('0x9'),'uri':_0x45a9fa+_0xb105('0xa'),'json':!![]};_0x2c3c40['headers']=_0x2c8b27;logger[_0xb105('0xb')]('Getting\x20admin\x20information');return rp(_0x2c3c40)[_0xb105('0xc')](function(_0x45d264){if(_0x45d264){var _0x42ca13=_0x45d264['users'];var _0x4e18f7=null;for(_0x4e18f7=0x0;_0x4e18f7<_0x42ca13[_0xb105('0xd')];_0x4e18f7++){if(_0x42ca13[_0x4e18f7]['email']===_0x500635[_0xb105('0xe')]){_0x500635['adminId']=_0x42ca13[_0x4e18f7]['id'];_0x5c874b=!![];}}if(_0x5c874b){logger[_0xb105('0xb')](_0xb105('0xf'),_0x500635['adminId']);_0x42d904(_0x500635);}else{_0x16a031({'statusCode':0x194,'message':_0xb105('0x10')});}}else{_0x16a031({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xb105('0x11')](function(_0x235c83){logger[_0xb105('0x12')]('['+[_0x17a309['toUpperCase']()]+']',_0x235c83[_0xb105('0x13')]);_0x16a031(_0x235c83);});});}function getUser(_0x5b7ef7,_0x51a7c6,_0x4a924c){return function(_0x27ec31){return new Promise(function(_0x142aae,_0xb49268){var _0x3bf588={'method':_0xb105('0x9'),'uri':_0x4a924c+'/api/selector/owners','json':!![]};_0x3bf588['headers']=_0x51a7c6;logger[_0xb105('0xb')]('Getting\x20user\x20list');return rp(_0x3bf588)[_0xb105('0xc')](function(_0x107abc){if(_0x107abc){var _0x4a2140=_0x107abc['users'];var _0xf42f49=![];var _0x53e65f=null;if(_0x27ec31[_0xb105('0x14')]!==null){logger[_0xb105('0xb')](_0xb105('0x15'),_0x27ec31[_0xb105('0x14')]);_0x27ec31[_0xb105('0x16')]=_0x27ec31[_0xb105('0x14')];for(_0x53e65f=0x0;_0x53e65f<_0x4a2140[_0xb105('0xd')];_0x53e65f++){if(_0x4a2140[_0x53e65f]['email']===_0x27ec31['agentEmail']){_0xf42f49=!![];_0x27ec31[_0xb105('0x17')]=_0x4a2140[_0x53e65f]['id'];logger['info']('User\x20found:',_0x27ec31['userId']);}}}if(!_0xf42f49){logger['info'](_0xb105('0x18'));_0x27ec31[_0xb105('0x16')]=_0x27ec31[_0xb105('0xe')];_0x27ec31[_0xb105('0x17')]=_0x27ec31[_0xb105('0x19')];_0xf42f49=!![];}if(_0xf42f49){_0x142aae(_0x27ec31);}else{_0xb49268({'statusCode':0x194,'message':_0xb105('0x10')});}}else{_0xb49268({'statusCode':0x194,'message':_0xb105('0x10')});}})['catch'](function(_0x46a2ba){logger[_0xb105('0x12')]('['+[_0x5b7ef7[_0xb105('0x1a')]()]+']',_0x46a2ba[_0xb105('0x13')]);_0xb49268(_0x46a2ba);});});};}function searchContact(_0x4fb02f,_0x3f8bcf,_0x5e4c23,_0xfd1c0b){return new Promise(function(_0x2435ac,_0x267e8a){var _0x9438e6={'method':_0xb105('0x9'),'headers':_0x3f8bcf,'uri':_0x4fb02f+_0xb105('0x1b')+_0xfd1c0b+_0xb105('0x1c')+_0x5e4c23+_0xb105('0x1d'),'json':!![]};rp(_0x9438e6)[_0xb105('0xc')](function(_0x44a1c5){var _0xab8dfb=_[_0xb105('0x1e')](_0x44a1c5['contacts']['contacts'],[_0x5e4c23,_0xfd1c0b]);_0x2435ac(_0xab8dfb);})['catch'](function(_0x44e9ce){_0x267e8a(_0x44e9ce);});});}function getEndUser(_0x4d05d3,_0x47eaf0,_0x21d7ff){return function(_0x206e76){return new Promise(function(_0x5285dd,_0x1453d0){logger['info'](util['format'](_0xb105('0x1f'),_0x206e76[_0xb105('0x20')]));searchContact(_0x21d7ff,_0x47eaf0,_0xb105('0x21'),_0x206e76['contactNumber'])['then'](function(_0x59040d){if(_0x59040d){_0x206e76[_0xb105('0x22')]=_0x59040d['id'];logger[_0xb105('0xb')](_0xb105('0x23'),_0x206e76['endUserId']);return _0x5285dd(_0x206e76);}searchContact(_0x21d7ff,_0x47eaf0,_0xb105('0x24'),_0x206e76['contactNumber'])[_0xb105('0xc')](function(_0x2df641){if(_0x2df641){_0x206e76[_0xb105('0x22')]=_0x2df641['id'];logger[_0xb105('0xb')](_0xb105('0x25'),_0x206e76[_0xb105('0x22')]);return _0x5285dd(_0x206e76);}createEndUser(_0x206e76,_0x4d05d3,_0x47eaf0,_0x21d7ff)[_0xb105('0xc')](function(_0x12d059){logger[_0xb105('0xb')](_0xb105('0x26'),_0x12d059[_0xb105('0x22')]);return _0x5285dd(_0x12d059);});});})[_0xb105('0x11')](function(_0x3436f7){_0x1453d0(_0x3436f7);});});};}function createEndUser(_0x1d9daf,_0x345eff,_0x20aef5,_0x53dca8){return new Promise(function(_0x48d933,_0x19394c){var _0x32a4e4=moment();var _0x2ee99d={'method':_0xb105('0x27'),'uri':_0x53dca8+_0xb105('0x28'),'body':{'contact':{'last_name':_0x1d9daf[_0xb105('0x20')],'work_number':_0x1d9daf[_0xb105('0x20')],'mobile_number':_0x1d9daf['contactNumber'],'owner_id':_0x1d9daf[_0xb105('0x17')],'created_at':_0x32a4e4[_0xb105('0x29')](_0xb105('0x2a'))}},'json':!![]};_0x2ee99d[_0xb105('0x2b')]=_0x20aef5;logger[_0xb105('0xb')](_0xb105('0x2c'));return rp(_0x2ee99d)[_0xb105('0xc')](function(_0x42d778){_0x1d9daf[_0xb105('0x22')]=_0x42d778['contact']['id'];_0x48d933(_0x1d9daf);})[_0xb105('0x11')](function(_0x5193c0){logger[_0xb105('0x12')]('['+[_0x345eff[_0xb105('0x1a')]()]+']',_0x5193c0[_0xb105('0x13')]);_0x19394c(_0x5193c0[_0xb105('0x13')]);});});}function getTicket(_0x567cb1,_0xed33a0,_0x393a38,_0x2e88d3,_0x27e168){return function(_0x5a4c52){logger['info'](_0xb105('0x2d'));return new Promise(function(_0x10155d,_0x38f93e){var _0x239355=moment();var _0x4f09f4={'method':_0xb105('0x27'),'uri':_0x393a38+'/api/tasks','body':{'title':intUtil[_0xb105('0x2e')](_0x2e88d3[_0xb105('0x2f')],_0x27e168,'\x20'),'description':intUtil[_0xb105('0x2e')](_0x2e88d3['Descriptions'],_0x27e168,'\x0a'),'owner_id':_0x5a4c52['userId'],'creater_id':_0x5a4c52[_0xb105('0x19')],'targetable_id':_0x5a4c52[_0xb105('0x22')],'targetable_type':_0xb105('0x30'),'created_at':_0x239355[_0xb105('0x29')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x239355[_0xb105('0x31')](0x1e,'m')['format'](_0xb105('0x2a'))},'json':!![]};_0x4f09f4[_0xb105('0x2b')]=_0xed33a0;return rp(_0x4f09f4)['then'](function(_0x554de1){_0x5a4c52['ticketId']=_0x554de1[_0xb105('0x32')]['id'];logger[_0xb105('0xb')](_0xb105('0x33'),_0x5a4c52[_0xb105('0x34')]);_0x10155d(_0x5a4c52);})[_0xb105('0x11')](function(_0x4058a8){logger[_0xb105('0x12')]('['+[_0x567cb1[_0xb105('0x1a')]()]+']',_0x4058a8[_0xb105('0x13')]);_0x38f93e(_0x4058a8[_0xb105('0x13')]);});});};}function emit(_0x2e2cc4,_0x339703,_0x3a61dc){var _0x2a37ba={'uri':_0x2e2cc4+_0xb105('0x35')+_0x3a61dc};io['to'](util['format'](_0xb105('0x36'),_0x339703))[_0xb105('0x37')](_0xb105('0x38'),_0x2a37ba);}exports['cs']=function(_0x4d11c1,_0x57dcf6,_0x4be6a5,_0xfdd3e1,_0x499453,_0x5b2486,_0xc154f4,_0x1efbe2){var _0x59d172={};var _0x1294a2={'Authorization':'Token\x20token='+_0x5b2486[_0xb105('0x39')]};_0x5b2486['remoteUri']=intUtil[_0xb105('0x3a')](_0x5b2486['remoteUri']);_0x5b2486[_0xb105('0x3b')]=intUtil['stripTrailingSlash'](_0x5b2486[_0xb105('0x3b')]);var _0x2dbd65=_0x5b2486[_0xb105('0x3c')];_0x59d172[_0xb105('0xe')]=_0x5b2486[_0xb105('0x3d')];_0x59d172[_0xb105('0x20')]=_0x1efbe2[_0xb105('0x3e')]()===_0xb105('0x3f')?_0x57dcf6[_0xb105('0x40')]:_0x57dcf6[_0xb105('0x41')];_0x59d172['callDirection']=_0x1efbe2==='queue'||_0x1efbe2===_0xb105('0x42')?'queue':_0xb105('0x3f');if(_0xfdd3e1){_0x59d172[_0xb105('0x14')]=_0xfdd3e1[_0xb105('0x43')];}var _0x1c3210=util[_0xb105('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b2486[_0xb105('0x3b')],_0x57dcf6[_0xb105('0x44')],md5(_0x57dcf6[_0xb105('0x44')]));if(_0x499453&&_0x499453[_0xb105('0x45')]){logger['info'](_0xb105('0x46'),_0xb105('0x47'));_0x57dcf6[_0xb105('0x48')]=_0x1c3210;}else if(_0xc154f4&&_0xc154f4['recordingFormat']&&_0xc154f4[_0xb105('0x49')]!==_0xb105('0x4a')){logger[_0xb105('0xb')](_0xb105('0x4b'),_0xb105('0x47'));_0x57dcf6[_0xb105('0x48')]=_0x1c3210;}else{_0x57dcf6[_0xb105('0x48')]='';}return getAdminId(_0x59d172,_0x1efbe2,_0x1294a2,_0x2dbd65)['then'](getUser(_0x1efbe2,_0x1294a2,_0x2dbd65))[_0xb105('0xc')](getEndUser(_0x1efbe2,_0x1294a2,_0x2dbd65))[_0xb105('0xc')](getTicket(_0x1efbe2,_0x1294a2,_0x2dbd65,_0x4be6a5,_0x57dcf6))[_0xb105('0xc')](function(_0x227a3b){logger[_0xb105('0xb')](util['format'](_0xb105('0x4c'),_0x227a3b['ticketId']));if(_0x1efbe2!==_0xb105('0x42')){logger['info']('['+[_0x1efbe2[_0xb105('0x1a')]()]+']',_0xb105('0x4d'));emit(_0x2dbd65,_0xfdd3e1[_0xb105('0x4e')],_0x227a3b['endUserId']);}})[_0xb105('0x11')](function(_0x2d830c){logger[_0xb105('0x12')]('['+[_0x1efbe2[_0xb105('0x1a')]()]+_0xb105('0x4f'),util[_0xb105('0x50')](_0x2d830c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x746a=['moment','ioredis','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','GET','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','catch','message','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','getString','adminId','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','destcalleridnum','callDirection','queue','unmanaged','outbound','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x746a,0x1dc));var _0xa746=function(_0x2d6c33,_0x1f747f){_0x2d6c33=_0x2d6c33-0x0;var _0x9aad1b=_0x746a[_0x2d6c33];return _0x9aad1b;};'use strict';var _=require(_0xa746('0x0'));var rp=require(_0xa746('0x1'));var md5=require(_0xa746('0x2'));var util=require(_0xa746('0x3'));var moment=require(_0xa746('0x4'));var Promise=require('bluebird');var Redis=require(_0xa746('0x5'));var intUtil=require('./util');var config=require(_0xa746('0x6'));var logger=require('../../../../config/logger')(_0xa746('0x7'));config[_0xa746('0x8')]=_[_0xa746('0x9')](config[_0xa746('0x8')],{'host':_0xa746('0xa'),'port':0x18eb});var io=require(_0xa746('0xb'))(new Redis(config[_0xa746('0x8')]));function getAdminId(_0x9b7520,_0x39c49e,_0x8a2164,_0x514298){return new Promise(function(_0x3e2a94,_0x3122be){var _0x57d228=![];var _0x5a1d0d={'method':'GET','uri':_0x514298+'/api/selector/owners','json':!![]};_0x5a1d0d[_0xa746('0xc')]=_0x8a2164;logger[_0xa746('0xd')](_0xa746('0xe'));return rp(_0x5a1d0d)[_0xa746('0xf')](function(_0x89bb52){if(_0x89bb52){var _0x267782=_0x89bb52[_0xa746('0x10')];var _0x5e3515=null;for(_0x5e3515=0x0;_0x5e3515<_0x267782[_0xa746('0x11')];_0x5e3515++){if(_0x267782[_0x5e3515]['email']===_0x9b7520[_0xa746('0x12')]){_0x9b7520['adminId']=_0x267782[_0x5e3515]['id'];_0x57d228=!![];}}if(_0x57d228){logger[_0xa746('0xd')](_0xa746('0x13'),_0x9b7520['adminId']);_0x3e2a94(_0x9b7520);}else{_0x3122be({'statusCode':0x194,'message':_0xa746('0x14')});}}else{_0x3122be({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x129bc6){logger[_0xa746('0x15')]('['+[_0x39c49e[_0xa746('0x16')]()]+']',_0x129bc6['message']);_0x3122be(_0x129bc6);});});}function getUser(_0x269c3e,_0x1198e4,_0x48b879){return function(_0x438668){return new Promise(function(_0x4f22ce,_0x59c9ec){var _0x137dc1={'method':_0xa746('0x17'),'uri':_0x48b879+_0xa746('0x18'),'json':!![]};_0x137dc1[_0xa746('0xc')]=_0x1198e4;logger[_0xa746('0xd')](_0xa746('0x19'));return rp(_0x137dc1)[_0xa746('0xf')](function(_0x503c7a){if(_0x503c7a){var _0x36e36a=_0x503c7a[_0xa746('0x10')];var _0x312deb=![];var _0x1f5027=null;if(_0x438668['agentEmail']!==null){logger['info'](_0xa746('0x1a'),_0x438668[_0xa746('0x1b')]);_0x438668[_0xa746('0x1c')]=_0x438668[_0xa746('0x1b')];for(_0x1f5027=0x0;_0x1f5027<_0x36e36a[_0xa746('0x11')];_0x1f5027++){if(_0x36e36a[_0x1f5027]['email']===_0x438668[_0xa746('0x1b')]){_0x312deb=!![];_0x438668[_0xa746('0x1d')]=_0x36e36a[_0x1f5027]['id'];logger[_0xa746('0xd')](_0xa746('0x1e'),_0x438668[_0xa746('0x1d')]);}}}if(!_0x312deb){logger[_0xa746('0xd')]('Admin\x20selected');_0x438668[_0xa746('0x1c')]=_0x438668[_0xa746('0x12')];_0x438668[_0xa746('0x1d')]=_0x438668['adminId'];_0x312deb=!![];}if(_0x312deb){_0x4f22ce(_0x438668);}else{_0x59c9ec({'statusCode':0x194,'message':_0xa746('0x14')});}}else{_0x59c9ec({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xa746('0x1f')](function(_0x1106c4){logger[_0xa746('0x15')]('['+[_0x269c3e[_0xa746('0x16')]()]+']',_0x1106c4[_0xa746('0x20')]);_0x59c9ec(_0x1106c4);});});};}function searchContact(_0x2652a3,_0x44ba87,_0x229871,_0x1ff961){return new Promise(function(_0x465013,_0x35b94f){var _0x947705={'method':_0xa746('0x17'),'headers':_0x44ba87,'uri':_0x2652a3+_0xa746('0x21')+_0x1ff961+_0xa746('0x22')+_0x229871+'&entities=contact','json':!![]};rp(_0x947705)[_0xa746('0xf')](function(_0x2222ea){var _0x48f5c0=_[_0xa746('0x23')](_0x2222ea['contacts'][_0xa746('0x24')],[_0x229871,_0x1ff961]);_0x465013(_0x48f5c0);})[_0xa746('0x1f')](function(_0x1416a2){_0x35b94f(_0x1416a2);});});}function getEndUser(_0x35239c,_0x1600be,_0x440e60){return function(_0x36fd08){return new Promise(function(_0x221b98,_0x1a132e){logger['info'](util[_0xa746('0x25')](_0xa746('0x26'),_0x36fd08[_0xa746('0x27')]));searchContact(_0x440e60,_0x1600be,'mobile_number',_0x36fd08['contactNumber'])[_0xa746('0xf')](function(_0x5b65b9){if(_0x5b65b9){_0x36fd08['endUserId']=_0x5b65b9['id'];logger[_0xa746('0xd')]('Contact\x20found\x20mobile_number:',_0x36fd08[_0xa746('0x28')]);return _0x221b98(_0x36fd08);}searchContact(_0x440e60,_0x1600be,_0xa746('0x29'),_0x36fd08[_0xa746('0x27')])[_0xa746('0xf')](function(_0xe85985){if(_0xe85985){_0x36fd08['endUserId']=_0xe85985['id'];logger[_0xa746('0xd')](_0xa746('0x2a'),_0x36fd08['endUserId']);return _0x221b98(_0x36fd08);}createEndUser(_0x36fd08,_0x35239c,_0x1600be,_0x440e60)[_0xa746('0xf')](function(_0x2e09bc){logger[_0xa746('0xd')](_0xa746('0x2b'),_0x2e09bc['endUserId']);return _0x221b98(_0x2e09bc);});});})[_0xa746('0x1f')](function(_0x54e7c3){_0x1a132e(_0x54e7c3);});});};}function createEndUser(_0x4ede4c,_0x41245b,_0x3f9131,_0x4d8dd4){return new Promise(function(_0x291d96,_0x3a9ca4){var _0x5964a7=moment();var _0x2a0f06={'method':_0xa746('0x2c'),'uri':_0x4d8dd4+'/api/contacts','body':{'contact':{'last_name':_0x4ede4c['contactNumber'],'work_number':_0x4ede4c[_0xa746('0x27')],'mobile_number':_0x4ede4c[_0xa746('0x27')],'owner_id':_0x4ede4c[_0xa746('0x1d')],'created_at':_0x5964a7[_0xa746('0x25')](_0xa746('0x2d'))}},'json':!![]};_0x2a0f06['headers']=_0x3f9131;logger[_0xa746('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2a0f06)[_0xa746('0xf')](function(_0x30cc0d){_0x4ede4c[_0xa746('0x28')]=_0x30cc0d[_0xa746('0x2e')]['id'];_0x291d96(_0x4ede4c);})[_0xa746('0x1f')](function(_0x3bd4aa){logger[_0xa746('0x15')]('['+[_0x41245b[_0xa746('0x16')]()]+']',_0x3bd4aa[_0xa746('0x20')]);_0x3a9ca4(_0x3bd4aa[_0xa746('0x20')]);});});}function getTicket(_0x152a6a,_0x116ca0,_0x1543a0,_0x1f1f03,_0x1f0cd9){return function(_0x55050e){logger[_0xa746('0xd')](_0xa746('0x2f'));return new Promise(function(_0x3839e5,_0x307ad9){var _0x119042=moment();var _0xe2c4b3={'method':_0xa746('0x2c'),'uri':_0x1543a0+'/api/tasks','body':{'title':intUtil['getString'](_0x1f1f03['Subjects'],_0x1f0cd9,'\x20'),'description':intUtil[_0xa746('0x30')](_0x1f1f03['Descriptions'],_0x1f0cd9,'\x0a'),'owner_id':_0x55050e[_0xa746('0x1d')],'creater_id':_0x55050e[_0xa746('0x31')],'targetable_id':_0x55050e[_0xa746('0x28')],'targetable_type':_0xa746('0x32'),'created_at':_0x119042[_0xa746('0x25')](_0xa746('0x2d')),'due_date':_0x119042[_0xa746('0x33')](0x1e,'m')[_0xa746('0x25')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0xe2c4b3[_0xa746('0xc')]=_0x116ca0;return rp(_0xe2c4b3)['then'](function(_0x5d56d5){_0x55050e[_0xa746('0x34')]=_0x5d56d5[_0xa746('0x35')]['id'];logger['info'](_0xa746('0x36'),_0x55050e['ticketId']);_0x3839e5(_0x55050e);})[_0xa746('0x1f')](function(_0x2fdff9){logger['error']('['+[_0x152a6a[_0xa746('0x16')]()]+']',_0x2fdff9[_0xa746('0x20')]);_0x307ad9(_0x2fdff9[_0xa746('0x20')]);});});};}function emit(_0x20dadc,_0x1e0d71,_0xadfe3){var _0x3c701f={'uri':_0x20dadc+_0xa746('0x37')+_0xadfe3};io['to'](util[_0xa746('0x25')](_0xa746('0x38'),_0x1e0d71))[_0xa746('0x39')](_0xa746('0x3a'),_0x3c701f);}exports['cs']=function(_0x331758,_0x22637a,_0xc37d0d,_0x148820,_0x460641,_0x3e1cc4,_0x556360,_0x19f69d){var _0x330551={};var _0x48ce19={'Authorization':_0xa746('0x3b')+_0x3e1cc4[_0xa746('0x3c')]};_0x3e1cc4[_0xa746('0x3d')]=intUtil[_0xa746('0x3e')](_0x3e1cc4[_0xa746('0x3d')]);_0x3e1cc4['serverUrl']=intUtil['stripTrailingSlash'](_0x3e1cc4[_0xa746('0x3f')]);var _0x19324b=_0x3e1cc4[_0xa746('0x3d')];_0x330551[_0xa746('0x12')]=_0x3e1cc4['username'];_0x330551[_0xa746('0x27')]=_0x19f69d['toLowerCase']()==='outbound'?_0x22637a[_0xa746('0x40')]:_0x22637a['calleridnum'];_0x330551[_0xa746('0x41')]=_0x19f69d===_0xa746('0x42')||_0x19f69d===_0xa746('0x43')?'queue':_0xa746('0x44');if(_0x148820){_0x330551['agentEmail']=_0x148820[_0xa746('0x45')];}var _0x1509b6=util['format'](_0xa746('0x46'),_0x3e1cc4[_0xa746('0x3f')],_0x22637a[_0xa746('0x47')],md5(_0x22637a['uniqueid']));if(_0x460641&&_0x460641['monitor_format']){logger[_0xa746('0xd')](_0xa746('0x48'),_0xa746('0x49'));_0x22637a[_0xa746('0x4a')]=_0x1509b6;}else if(_0x556360&&_0x556360[_0xa746('0x4b')]&&_0x556360[_0xa746('0x4b')]!==_0xa746('0x4c')){logger['info'](_0xa746('0x4d'),_0xa746('0x49'));_0x22637a['recordingURL']=_0x1509b6;}else{_0x22637a[_0xa746('0x4a')]='';}return getAdminId(_0x330551,_0x19f69d,_0x48ce19,_0x19324b)[_0xa746('0xf')](getUser(_0x19f69d,_0x48ce19,_0x19324b))[_0xa746('0xf')](getEndUser(_0x19f69d,_0x48ce19,_0x19324b))[_0xa746('0xf')](getTicket(_0x19f69d,_0x48ce19,_0x19324b,_0xc37d0d,_0x22637a))[_0xa746('0xf')](function(_0x4fb2ef){logger[_0xa746('0xd')](util[_0xa746('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4fb2ef['ticketId']));if(_0x19f69d!==_0xa746('0x43')){logger['info']('['+[_0x19f69d[_0xa746('0x16')]()]+']',_0xa746('0x4e'));emit(_0x19324b,_0x148820['name'],_0x4fb2ef[_0xa746('0x28')]);}})['catch'](function(_0x322469){logger[_0xa746('0x15')]('['+[_0x19f69d[_0xa746('0x16')]()]+_0xa746('0x4f'),util['inspect'](_0x322469,{'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 0c7052c..3f616b3 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 _0x9f56=['error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','unmanaged','zendesk','freshdesk','freshsales','unknown\x20integration','../../../../config/logger'];(function(_0x229b13,_0x4ac627){var _0x4be521=function(_0x339a61){while(--_0x339a61){_0x229b13['push'](_0x229b13['shift']());}};_0x4be521(++_0x4ac627);}(_0x9f56,0x7a));var _0x69f5=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x9f56[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x69f5('0x0'));var util=require('util');var zendesk=require(_0x69f5('0x1'));var salesforce=require(_0x69f5('0x2'));var sugarcrm=require(_0x69f5('0x3'));var freshdesk=require(_0x69f5('0x4'));var zoho=require(_0x69f5('0x5'));var desk=require(_0x69f5('0x6'));var vtiger=require(_0x69f5('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0x69f5('0x8'));var freshsales=require(_0x69f5('0x9'));var integrations=['zendesk',_0x69f5('0xa'),_0x69f5('0xb'),'freshdesk',_0x69f5('0xc'),_0x69f5('0xd'),_0x69f5('0xe'),_0x69f5('0xf'),'freshsales',_0x69f5('0x10')];exports[_0x69f5('0x11')]=function(_0x80820f,_0x2f1a0b,_0x545004,_0x68da0,_0x4b1a07,_0x16e267){if(_0x545004){if(_[_0x69f5('0x12')](integrations,_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]())){try{var _0x4fa297=null;var _0x4ce2d4='';var _0x3d4f9d=_0x545004[_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]()];if(_0x3d4f9d){var _0x4c25b7=_0x3d4f9d[_0x80820f[_0x69f5('0x15')]];if(_0x4c25b7){var _0x4b6ab9=_[_0x69f5('0x16')](_0x4c25b7[_0x69f5('0x17')],{'id':parseInt(_0x80820f[_0x69f5('0x18')],0xa)});if(_0x4b6ab9){if(_0x68da0){if(_0x4b1a07&&_0x2f1a0b['queue']){_0x4ce2d4=_0x69f5('0x19');}else if(_0x2f1a0b['routeId']){_0x4ce2d4=_0x69f5('0x1a');}else{console[_0x69f5('0x1b')]('EVENT\x20UNKNOWN',_0x2f1a0b);}}else{_0x4ce2d4=_0x69f5('0x1c');}switch(_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]()){case _0x69f5('0x1d'):zendesk[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case'salesforce':salesforce[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xb'):sugarcrm[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0x1e'):freshdesk[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xc'):zoho[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xd'):desk[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xe'):vtiger[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0x1f'):freshsales['cs'](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267,_0x4ce2d4);break;case _0x69f5('0x10'):servicenow['cs'](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267,_0x4ce2d4);break;case _0x69f5('0xf'):dynamics365['cs'](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267,_0x4ce2d4);break;default:console[_0x69f5('0x1b')](_0x69f5('0x20'));}}else{_0x4fa297=require(_0x69f5('0x21'))(_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]());_0x4fa297[_0x69f5('0x22')]('[EXEC]',util['format'](_0x69f5('0x23'),_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')](),_0x80820f['data3']));}}else{_0x4fa297=require('../../../../config/logger')(_0x80820f['data1'][_0x69f5('0x14')]());_0x4fa297[_0x69f5('0x22')](_0x69f5('0x24'),util[_0x69f5('0x25')](_0x69f5('0x26'),_0x80820f['data1']['toLowerCase'](),_0x80820f['data2']));}}else{}}catch(_0x3edee6){console[_0x69f5('0x22')](_0x3edee6);}}}}; \ No newline at end of file +var _0x92bd=['routeId','log','EVENT\x20UNKNOWN','sugarcrm','zoho','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./vtiger','./servicenow','./freshsales','zendesk','salesforce','freshdesk','desk','freshsales','servicenow','exec','data1','toLowerCase','data2','Configurations','queue'];(function(_0x4da851,_0x1dac9d){var _0x46978e=function(_0x36a91b){while(--_0x36a91b){_0x4da851['push'](_0x4da851['shift']());}};_0x46978e(++_0x1dac9d);}(_0x92bd,0x13f));var _0xd92b=function(_0x2bc20e,_0x29ddd4){_0x2bc20e=_0x2bc20e-0x0;var _0x1115d8=_0x92bd[_0x2bc20e];return _0x1115d8;};'use strict';var _=require(_0xd92b('0x0'));var util=require(_0xd92b('0x1'));var zendesk=require(_0xd92b('0x2'));var salesforce=require(_0xd92b('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xd92b('0x4'));var zoho=require(_0xd92b('0x5'));var desk=require('./desk');var vtiger=require(_0xd92b('0x6'));var servicenow=require(_0xd92b('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0xd92b('0x8'));var integrations=[_0xd92b('0x9'),_0xd92b('0xa'),'sugarcrm',_0xd92b('0xb'),'zoho',_0xd92b('0xc'),'vtiger','dynamics365',_0xd92b('0xd'),_0xd92b('0xe')];exports[_0xd92b('0xf')]=function(_0x34b0d6,_0x3fcc50,_0x497e33,_0x47ba0b,_0x4b667d,_0x445167){if(_0x497e33){if(_['includes'](integrations,_0x34b0d6[_0xd92b('0x10')][_0xd92b('0x11')]())){try{var _0x5ec432=null;var _0x33c0c2='';var _0x7c5787=_0x497e33[_0x34b0d6[_0xd92b('0x10')][_0xd92b('0x11')]()];if(_0x7c5787){var _0x3dba06=_0x7c5787[_0x34b0d6[_0xd92b('0x12')]];if(_0x3dba06){var _0x404a47=_['find'](_0x3dba06[_0xd92b('0x13')],{'id':parseInt(_0x34b0d6['data3'],0xa)});if(_0x404a47){if(_0x47ba0b){if(_0x4b667d&&_0x3fcc50[_0xd92b('0x14')]){_0x33c0c2=_0xd92b('0x14');}else if(_0x3fcc50[_0xd92b('0x15')]){_0x33c0c2='outbound';}else{console[_0xd92b('0x16')](_0xd92b('0x17'),_0x3fcc50);}}else{_0x33c0c2='unmanaged';}switch(_0x34b0d6[_0xd92b('0x10')][_0xd92b('0x11')]()){case _0xd92b('0x9'):zendesk[_0x33c0c2](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167);break;case'salesforce':salesforce[_0x33c0c2](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167);break;case _0xd92b('0x18'):sugarcrm[_0x33c0c2](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167);break;case _0xd92b('0xb'):freshdesk[_0x33c0c2](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167);break;case _0xd92b('0x19'):zoho[_0x33c0c2](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167);break;case _0xd92b('0xc'):desk[_0x33c0c2](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167);break;case'vtiger':vtiger[_0x33c0c2](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167);break;case _0xd92b('0xd'):freshsales['cs'](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167,_0x33c0c2);break;case'servicenow':servicenow['cs'](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167,_0x33c0c2);break;case'dynamics365':dynamics365['cs'](_0x34b0d6,_0x3fcc50,_0x404a47,_0x47ba0b,_0x4b667d,_0x3dba06,_0x445167,_0x33c0c2);break;default:console[_0xd92b('0x16')](_0xd92b('0x1a'));}}else{_0x5ec432=require('../../../../config/logger')(_0x34b0d6[_0xd92b('0x10')]['toLowerCase']());_0x5ec432[_0xd92b('0x1b')](_0xd92b('0x1c'),util[_0xd92b('0x1d')](_0xd92b('0x1e'),_0x34b0d6[_0xd92b('0x10')][_0xd92b('0x11')](),_0x34b0d6[_0xd92b('0x1f')]));}}else{_0x5ec432=require(_0xd92b('0x20'))(_0x34b0d6[_0xd92b('0x10')]['toLowerCase']());_0x5ec432['error'](_0xd92b('0x1c'),util[_0xd92b('0x1d')](_0xd92b('0x21'),_0x34b0d6[_0xd92b('0x10')]['toLowerCase'](),_0x34b0d6[_0xd92b('0x12')]));}}else{}}catch(_0x33e192){console[_0xd92b('0x1b')](_0x33e192);}}}}; \ 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 f1854e5..d8ae081 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 _0xc0f4=['../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','getString','Subjects','ticketType','Task','utc','IsRecurrence','endUserType','contact','account','WhatId','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','$or','cloneDeep','additionalSearchLead','merge','Lead','additionalSearchAccount','Contact','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','variable','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','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','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','ioredis'];(function(_0x570c8a,_0x4a11cc){var _0x25dc12=function(_0x4585d9){while(--_0x4585d9){_0x570c8a['push'](_0x570c8a['shift']());}};_0x25dc12(++_0x4a11cc);}(_0xc0f4,0x75));var _0x4c0f=function(_0x452a25,_0x961997){_0x452a25=_0x452a25-0x0;var _0x1cb080=_0xc0f4[_0x452a25];return _0x1cb080;};'use strict';var _=require('lodash');var rp=require(_0x4c0f('0x0'));var moment=require(_0x4c0f('0x1'));var BPromise=require(_0x4c0f('0x2'));var md5=require('md5');var jsforce=require(_0x4c0f('0x3'));var util=require(_0x4c0f('0x4'));var Redis=require(_0x4c0f('0x5'));var intUtil=require('./util');var config=require(_0x4c0f('0x6'));var logger=require(_0x4c0f('0x7'))(_0x4c0f('0x8'));config[_0x4c0f('0x9')]=_[_0x4c0f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4c0f('0xb'))(new Redis(config['redis']));function emit(_0x5585ed,_0x297b39,_0x530cbb){io['to'](_0x5585ed)[_0x4c0f('0xc')](_0x297b39,_0x530cbb);}function getTicket(_0x55d42a,_0x474c35,_0x4f38a7,_0x58cdf8,_0x3ca1ef,_0x599f4e,_0x329e23,_0x8fd13d){var _0x4cd833=Object['assign']({},{'OwnerId':_0x474c35['id'],'Subject':intUtil[_0x4c0f('0xd')](_0x58cdf8[_0x4c0f('0xe')],_0x3ca1ef,'\x20'),'Description':intUtil[_0x4c0f('0xd')](_0x58cdf8['Descriptions'],_0x3ca1ef,'\x0a')},getCustomFields(_0x599f4e,_0x3ca1ef));if(_0x4f38a7){if(_0x58cdf8[_0x4c0f('0xf')]===_0x4c0f('0x10')){_0x4cd833['ActivityDate']=moment[_0x4c0f('0x11')]();_0x4cd833['IsReminderSet']=![];_0x4cd833[_0x4c0f('0x12')]=![];if(_0x4f38a7[_0x4c0f('0x13')]===_0x4c0f('0x14')||_0x4f38a7['endUserType']==='lead'){_0x4cd833['WhoId']=_0x4f38a7['id'];}else if(_0x4f38a7[_0x4c0f('0x13')]===_0x4c0f('0x15')){_0x4cd833[_0x4c0f('0x16')]=_0x4f38a7['id'];}}else if(_0x58cdf8[_0x4c0f('0xf')]==='Case'){if(_0x4f38a7[_0x4c0f('0x13')]===_0x4c0f('0x14')){_0x4cd833[_0x4c0f('0x17')]=_0x4f38a7['id'];}else if(_0x4f38a7['endUserType']==='account'){_0x4cd833[_0x4c0f('0x18')]=_0x4f38a7['id'];}else if(_0x4f38a7['endUserType']===_0x4c0f('0x19')&&_0x58cdf8[_0x4c0f('0x1a')]){_0x4cd833[_0x58cdf8[_0x4c0f('0x1a')]]=_0x4f38a7['id'];}else{logger[_0x4c0f('0x1b')](_0x4c0f('0x1c'));}}}return _0x329e23[_0x4c0f('0x1d')](_0x58cdf8['ticketType'])[_0x4c0f('0x1e')](_0x4cd833);}function getUser(_0x51e25f,_0x5cfc6e,_0x532793){if(!_[_0x4c0f('0x1f')](_0x5cfc6e)&&intUtil['validateEmail'](_0x5cfc6e)){var _0x398246={'Email':_0x5cfc6e};var _0x2d7cfc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x532793[_0x4c0f('0x1d')](_0x4c0f('0x20'))[_0x4c0f('0x21')](_0x398246,_0x2d7cfc)[_0x4c0f('0x22')]()[_0x4c0f('0x23')](function(_0x3d931b){if(_0x3d931b[_0x4c0f('0x24')]){var _0xb99e2e=_[_0x4c0f('0x21')](_0x3d931b,function(_0x4c4022){return _0x4c4022['Email']===_0x5cfc6e;});if(_0xb99e2e){logger[_0x4c0f('0x1b')](_0x4c0f('0x25'),_0x5cfc6e);return BPromise[_0x4c0f('0x26')]({'id':_0xb99e2e['Id'],'name':_0xb99e2e[_0x4c0f('0x27')]});}}else{logger[_0x4c0f('0x1b')](_0x4c0f('0x28'),_0x5cfc6e);return _0x532793[_0x4c0f('0x29')]()[_0x4c0f('0x23')](function(_0x43b004){return BPromise[_0x4c0f('0x26')]({'id':_0x43b004['user_id'],'name':_0x43b004[_0x4c0f('0x2a')]});});}});}else{logger[_0x4c0f('0x1b')](_0x4c0f('0x28'),_0x5cfc6e);return _0x532793[_0x4c0f('0x29')]()[_0x4c0f('0x23')](function(_0x54c34c){return BPromise[_0x4c0f('0x26')]({'id':_0x54c34c[_0x4c0f('0x2b')],'name':_0x54c34c[_0x4c0f('0x2a')]});});}}function getEndUser(_0x23b417,_0xceb5f0,_0x137610,_0x47b604,_0x4aa840){var _0x614617={'$or':{'Phone':_0x47b604}};var _0xf5af31={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4c0f('0x26')]()[_0x4c0f('0x23')](function(){logger[_0x4c0f('0x1b')](_0x4c0f('0x2c'),_0x47b604,_0xceb5f0['moduleSearch']);switch(_0xceb5f0[_0x4c0f('0x2d')]){case'contact_lead':var _0x1997c4=_['cloneDeep'](_0x614617);if(_0xceb5f0['additionalSearchContact']){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x2e')]]=_0x47b604;_['merge'](_0x1997c4[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840['sobject']('Contact')[_0x4c0f('0x21')](_0x1997c4,_0xf5af31)['execute']()[_0x4c0f('0x23')](function(_0x227f13){if(_0x227f13&&_0x227f13[_0x4c0f('0x24')]){return _0x227f13;}else{var _0xe054c=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x31')]){var _0x3df333={};_0x3df333[_0xceb5f0['additionalSearchLead']]=_0x47b604;_[_0x4c0f('0x32')](_0xe054c[_0x4c0f('0x2f')],_0x3df333);}return _0x4aa840['sobject'](_0x4c0f('0x33'))['find'](_0xe054c,_0xf5af31);}});case'account_contact_lead':var _0x44bdcf=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x34')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x34')]]=_0x47b604;_[_0x4c0f('0x32')](_0x44bdcf[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840['sobject']('Account')[_0x4c0f('0x21')](_0x44bdcf,_0xf5af31)['execute']()['then'](function(_0x12c9a6){if(_0x12c9a6&&_0x12c9a6[_0x4c0f('0x24')]){return _0x12c9a6;}else{var _0xc05af0=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x2e')]){var _0x2a8718={};_0x2a8718[_0xceb5f0[_0x4c0f('0x2e')]]=_0x47b604;_['merge'](_0xc05af0['$or'],_0x2a8718);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x35'))[_0x4c0f('0x21')](_0xc05af0,_0xf5af31)[_0x4c0f('0x23')](function(_0x51a1be){if(_0x51a1be&&_0x51a1be[_0x4c0f('0x24')]){return _0x51a1be;}else{var _0x6e4aff=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x31')]){var _0x5bf11c={};_0x5bf11c[_0xceb5f0['additionalSearchLead']]=_0x47b604;_[_0x4c0f('0x32')](_0x6e4aff[_0x4c0f('0x2f')],_0x5bf11c);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x33'))[_0x4c0f('0x21')](_0x6e4aff,_0xf5af31);}});}});case _0x4c0f('0x14'):var _0x1997c4=_['cloneDeep'](_0x614617);if(_0xceb5f0[_0x4c0f('0x2e')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0['additionalSearchContact']]=_0x47b604;_['merge'](_0x1997c4[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840['sobject']('Contact')[_0x4c0f('0x21')](_0x1997c4,_0xf5af31)[_0x4c0f('0x22')]();case _0x4c0f('0x19'):var _0x118b4e=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x31')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x31')]]=_0x47b604;_[_0x4c0f('0x32')](_0x118b4e[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x33'))[_0x4c0f('0x21')](_0x118b4e,_0xf5af31);case'account':var _0x44bdcf=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x34')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x34')]]=_0x47b604;_['merge'](_0x44bdcf[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x36'))[_0x4c0f('0x21')](_0x44bdcf,_0xf5af31);default:return null;}})[_0x4c0f('0x23')](function(_0x161474){if(_0x161474&&_0x161474[_0x4c0f('0x24')]){var _0x3d4ba0=_[_0x4c0f('0x37')](_0x161474);if(_0x3d4ba0){return BPromise[_0x4c0f('0x26')]({'id':_0x3d4ba0['Id'],'name':_0x3d4ba0['Name'],'phone':_0x3d4ba0[_0x4c0f('0x38')],'endUserType':_0x3d4ba0[_0x4c0f('0x39')][_0x4c0f('0x3a')][_0x4c0f('0x3b')]()});}}})[_0x4c0f('0x23')](function(_0x8feb01){if(_0x8feb01){logger[_0x4c0f('0x1b')](_0x4c0f('0x3c'),_0x8feb01[_0x4c0f('0x13')],_0x47b604);return BPromise['resolve'](_0x8feb01);}else{logger[_0x4c0f('0x1b')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x47b604);var _0x18d96d={'Phone':_0x47b604};if(_0xceb5f0[_0x4c0f('0x3d')]){if(_0xceb5f0[_0x4c0f('0x3d')]===_0x4c0f('0x14')){logger[_0x4c0f('0x1b')](_0x4c0f('0x3e'),_0x47b604,_0xceb5f0[_0x4c0f('0x3d')]);_0x18d96d['LastName']=_0x137610!==_0x4c0f('0x3f')?_0x137610:util[_0x4c0f('0x40')](_0x4c0f('0x41'),_0x47b604);}else if(_0xceb5f0[_0x4c0f('0x3d')]==='lead'){logger[_0x4c0f('0x1b')](_0x4c0f('0x3e'),_0x47b604,_0xceb5f0[_0x4c0f('0x3d')]);_0x18d96d[_0x4c0f('0x42')]=_0x137610!==_0x4c0f('0x3f')?_0x137610:util[_0x4c0f('0x40')]('Caller\x20-\x20%s',_0x47b604);_0x18d96d[_0x4c0f('0x43')]=_0x4c0f('0x44');}else if(_0xceb5f0[_0x4c0f('0x3d')]===_0x4c0f('0x15')){logger[_0x4c0f('0x1b')](_0x4c0f('0x3e'),_0x47b604,_0xceb5f0['moduleCreate']);_0x18d96d[_0x4c0f('0x27')]=_0x137610!==_0x4c0f('0x3f')?_0x137610:util[_0x4c0f('0x40')](_0x4c0f('0x41'),_0x47b604);}else{return null;}}return _0x4aa840[_0x4c0f('0x1d')](_[_0x4c0f('0x45')](_0xceb5f0[_0x4c0f('0x3d')]))[_0x4c0f('0x1e')](_0x18d96d)[_0x4c0f('0x23')](function(_0x4b3a95){return BPromise[_0x4c0f('0x26')]({'id':_0x4b3a95['id'],'endUserType':_0xceb5f0[_0x4c0f('0x3d')]});});}});}function getCustomFields(_0x277e45,_0x57a6e4){var _0x4f7ae5={};if(_0x277e45['length']>0x0){_[_0x4c0f('0x46')](_0x277e45,function(_0x45eb2e){if(_[_0x4c0f('0x47')]([_0x4c0f('0x48'),_0x4c0f('0x49')],_0x45eb2e[_0x4c0f('0x3a')])&&_0x45eb2e[_0x4c0f('0x4a')]){_0x4f7ae5[_0x45eb2e[_0x4c0f('0x4a')]]=_0x45eb2e['content']['toString']();}else if(_0x45eb2e[_0x4c0f('0x3a')]===_0x4c0f('0x4b')&&_0x45eb2e['variableName']&&_0x45eb2e[_0x4c0f('0x4a')]){_0x57a6e4[_0x45eb2e[_0x4c0f('0x4c')]]&&(_0x4f7ae5[_0x45eb2e['idField']]=_0x57a6e4[_0x45eb2e[_0x4c0f('0x4c')]][_0x4c0f('0x4d')]());}else if(_0x45eb2e[_0x4c0f('0x3a')]===_0x4c0f('0x4e')&&_0x45eb2e['Variable']&&_0x45eb2e[_0x4c0f('0x4f')][_0x4c0f('0x50')]&&_0x45eb2e[_0x4c0f('0x4a')]){_0x57a6e4[_0x45eb2e[_0x4c0f('0x4f')][_0x4c0f('0x50')][_0x4c0f('0x3b')]()]&&(_0x4f7ae5[_0x45eb2e[_0x4c0f('0x4a')]]=_0x57a6e4[_0x45eb2e[_0x4c0f('0x4f')]['name'][_0x4c0f('0x3b')]()][_0x4c0f('0x4d')]());}});}return _0x4f7ae5;}function getConnection(_0x37f051){var _0x3e6481=_0x37f051['password'][_0x4c0f('0x51')](_0x37f051[_0x4c0f('0x52')]);var _0x355841=new jsforce[(_0x4c0f('0x53'))]({'oauth2':{'loginUrl':_0x37f051['remoteUri']||'https://login.salesforce.com','clientId':_0x37f051['clientId'],'clientSecret':_0x37f051[_0x4c0f('0x54')]}});return _0x355841['login'](_0x37f051[_0x4c0f('0x55')],_0x3e6481)[_0x4c0f('0x23')](function(){logger[_0x4c0f('0x1b')](_0x4c0f('0x56'));return _0x355841;});}exports[_0x4c0f('0x57')]=function(_0x6e949d,_0x39c576,_0x20c55f,_0x18c22c,_0x40eb96,_0x4ecaf2){var _0x1546d9,_0xb772c6,_0x4a4bc8,_0x470fff;_0x4ecaf2[_0x4c0f('0x58')]=intUtil[_0x4c0f('0x59')](_0x4ecaf2[_0x4c0f('0x58')]);_0x4ecaf2[_0x4c0f('0x5a')]=intUtil[_0x4c0f('0x59')](_0x4ecaf2[_0x4c0f('0x5a')]);if(_0x40eb96&&_0x40eb96[_0x4c0f('0x5b')]){logger['info'](_0x4c0f('0x5c'),'Recording\x20is\x20enabled!');_0x39c576[_0x4c0f('0x5d')]=util['format'](_0x4c0f('0x5e'),_0x4ecaf2['serverUrl'],_0x39c576[_0x4c0f('0x5f')],md5(_0x39c576['uniqueid']));}else{_0x39c576[_0x4c0f('0x5d')]='';}return getConnection(_0x4ecaf2)[_0x4c0f('0x23')](function(_0x5e13f5){_0x470fff=_0x5e13f5;return getUser(_0x4ecaf2,_0x18c22c[_0x4c0f('0x60')],_0x470fff);})[_0x4c0f('0x23')](function(_0x253cc3){_0x1546d9=_0x253cc3;return getEndUser(_0x4ecaf2,_0x20c55f,_0x39c576[_0x4c0f('0x61')],_0x39c576[_0x4c0f('0x62')],_0x470fff);})[_0x4c0f('0x23')](function(_0x3475cf){_0xb772c6=_0x3475cf;return getTicket(_0x4ecaf2,_0x1546d9,_0xb772c6,_0x20c55f,_0x39c576,_0x20c55f[_0x4c0f('0x63')],_0x470fff,_0x4c0f('0x57'));})['then'](function(_0x49bb0b){_0x4a4bc8=_0x49bb0b;logger[_0x4c0f('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4a4bc8['id']);logger[_0x4c0f('0x1b')](_0x4c0f('0x64'),_0x4a4bc8['id'],_0x18c22c[_0x4c0f('0x50')],_0x4ecaf2[_0x4c0f('0x3a')]);switch(_0x4ecaf2['type']){case _0x4c0f('0x65'):emit(util['format']('user:%s',_0x18c22c[_0x4c0f('0x50')]),_0x4c0f('0x66'),{'recordId':_0x4a4bc8['id']});break;case _0x4c0f('0x67'):emit(util[_0x4c0f('0x40')]('user:%s',_0x18c22c[_0x4c0f('0x50')]),_0x4c0f('0x68'),{'uri':util[_0x4c0f('0x40')](_0x4c0f('0x69'),_0x470fff[_0x4c0f('0x6a')],_0x4a4bc8['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x4c0f('0x6b')](function(_0x2a5c87){logger[_0x4c0f('0x6c')]('[QUEUE]',_0x2a5c87);});};exports[_0x4c0f('0x6d')]=function(_0x3f0831,_0x474c8f,_0x4ccbec,_0x5cc58a,_0x3772b1,_0x20d104,_0xa90d96){var _0x2b63e9,_0x31d21f,_0x315a6c,_0x2db689;_0x20d104[_0x4c0f('0x58')]=intUtil[_0x4c0f('0x59')](_0x20d104[_0x4c0f('0x58')]);_0x20d104['remoteUri']=intUtil[_0x4c0f('0x59')](_0x20d104[_0x4c0f('0x5a')]);if(_0xa90d96&&_0xa90d96[_0x4c0f('0x6e')]&&_0xa90d96[_0x4c0f('0x6e')]!==_0x4c0f('0x6f')){logger[_0x4c0f('0x1b')](_0x4c0f('0x70'),_0x4c0f('0x71'));_0x474c8f[_0x4c0f('0x5d')]=util[_0x4c0f('0x40')](_0x4c0f('0x5e'),_0x20d104['serverUrl'],_0x474c8f[_0x4c0f('0x5f')],md5(_0x474c8f[_0x4c0f('0x5f')]));}return getConnection(_0x20d104)[_0x4c0f('0x23')](function(_0x260aec){_0x2db689=_0x260aec;return getUser(_0x20d104,_0x5cc58a['email'],_0x2db689);})[_0x4c0f('0x23')](function(_0x725919){_0x2b63e9=_0x725919;return getEndUser(_0x20d104,_0x4ccbec,_0x474c8f[_0x4c0f('0x72')],_0x474c8f[_0x4c0f('0x73')],_0x2db689);})['then'](function(_0x9ca579){_0x31d21f=_0x9ca579;return getTicket(_0x20d104,_0x2b63e9,_0x31d21f,_0x4ccbec,_0x474c8f,_0x4ccbec['Fields'],_0x2db689,_0x4c0f('0x6d'));})[_0x4c0f('0x23')](function(_0x52b4f1){_0x315a6c=_0x52b4f1;logger[_0x4c0f('0x1b')](_0x4c0f('0x74'),_0x315a6c['id']);logger['info'](_0x4c0f('0x75'),_0x315a6c['id'],_0x5cc58a[_0x4c0f('0x50')],_0x20d104['type']);switch(_0x20d104[_0x4c0f('0x3a')]){case _0x4c0f('0x65'):emit(util[_0x4c0f('0x40')]('user:%s',_0x5cc58a[_0x4c0f('0x50')]),_0x4c0f('0x66'),{'recordId':_0x315a6c['id']});break;case _0x4c0f('0x67'):emit(util['format']('user:%s',_0x5cc58a[_0x4c0f('0x50')]),_0x4c0f('0x68'),{'uri':util[_0x4c0f('0x40')]('%s/%s/e',_0x2db689[_0x4c0f('0x6a')],_0x315a6c['id'])});break;default:logger[_0x4c0f('0x6c')]('[OUTBOUND]',_0x4c0f('0x76'));}})['catch'](function(_0x326521){logger[_0x4c0f('0x6c')](_0x4c0f('0x70'),_0x326521);});};exports['unmanaged']=function(_0x29c9f9,_0x58ae8a,_0x2ad5cf,_0x12289a,_0x4d1d58,_0x1c7126){var _0x459cad,_0x27c11f,_0x3e15b8,_0x19820a;_0x1c7126[_0x4c0f('0x58')]=intUtil[_0x4c0f('0x59')](_0x1c7126[_0x4c0f('0x58')]);_0x1c7126[_0x4c0f('0x5a')]=intUtil[_0x4c0f('0x59')](_0x1c7126[_0x4c0f('0x5a')]);if(_0x4d1d58&&_0x4d1d58['monitor_format']){logger[_0x4c0f('0x1b')]('['+_0x58ae8a[_0x4c0f('0x77')][_0x4c0f('0x78')]()+']',_0x4c0f('0x71'));_0x58ae8a[_0x4c0f('0x5d')]=util[_0x4c0f('0x40')](_0x4c0f('0x5e'),_0x1c7126[_0x4c0f('0x58')],_0x58ae8a[_0x4c0f('0x5f')],md5(_0x58ae8a['uniqueid']));}else{_0x58ae8a[_0x4c0f('0x5d')]='';}return getConnection(_0x1c7126)[_0x4c0f('0x23')](function(_0x577045){_0x19820a=_0x577045;if(!_[_0x4c0f('0x1f')](_0x12289a)){return getUser(_0x1c7126,_0x12289a[_0x4c0f('0x50')],_0x19820a);}else{return getUser(_0x1c7126,null,_0x19820a);}})['then'](function(_0x1866aa){_0x459cad=_0x1866aa;return getEndUser(_0x1c7126,_0x2ad5cf,_0x58ae8a['calleridname'],_0x58ae8a['calleridnum'],_0x19820a);})['then'](function(_0x4a2b70){_0x27c11f=_0x4a2b70;return getTicket(_0x1c7126,_0x459cad,_0x27c11f,_0x2ad5cf,_0x58ae8a,_0x2ad5cf[_0x4c0f('0x63')],_0x19820a);})[_0x4c0f('0x23')](function(_0x468429){_0x3e15b8=_0x468429;logger[_0x4c0f('0x1b')]('['+_0x58ae8a[_0x4c0f('0x77')][_0x4c0f('0x78')]()+_0x4c0f('0x79'),_0x3e15b8['id']);logger[_0x4c0f('0x1b')]('['+_0x58ae8a['lastevent']['toUpperCase']()+_0x4c0f('0x7a'),_0x1c7126[_0x4c0f('0x3a')]);})['catch'](function(_0x16ba24){logger['error']('['+_0x58ae8a[_0x4c0f('0x77')][_0x4c0f('0x78')]()+']',_0x16ba24);});}; \ No newline at end of file +var _0xdf1f=['redis','socket.io-emitter','assign','getString','Descriptions','ticketType','Task','ActivityDate','IsRecurrence','endUserType','contact','account','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','execute','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','Account','additionalSearchAccount','first','attributes','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','username','Connection\x20established.','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','salesforce'];(function(_0x3699d4,_0x43f8e4){var _0x41b23b=function(_0x1b7e6c){while(--_0x1b7e6c){_0x3699d4['push'](_0x3699d4['shift']());}};_0x41b23b(++_0x43f8e4);}(_0xdf1f,0x16f));var _0xfdf1=function(_0x25f62f,_0x4e5419){_0x25f62f=_0x25f62f-0x0;var _0x4dad00=_0xdf1f[_0x25f62f];return _0x4dad00;};'use strict';var _=require(_0xfdf1('0x0'));var rp=require(_0xfdf1('0x1'));var moment=require('moment');var BPromise=require(_0xfdf1('0x2'));var md5=require(_0xfdf1('0x3'));var jsforce=require('jsforce');var util=require('util');var Redis=require(_0xfdf1('0x4'));var intUtil=require('./util');var config=require(_0xfdf1('0x5'));var logger=require(_0xfdf1('0x6'))(_0xfdf1('0x7'));config['redis']=_['defaults'](config[_0xfdf1('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xfdf1('0x9'))(new Redis(config['redis']));function emit(_0x36fc75,_0x4350fa,_0x41e9ad){io['to'](_0x36fc75)['emit'](_0x4350fa,_0x41e9ad);}function getTicket(_0x335cf8,_0x4dfdc3,_0x14ca02,_0x1f4c2c,_0x4b61c4,_0x1fea59,_0x4a4686,_0x3045e0){var _0x54d875=Object[_0xfdf1('0xa')]({},{'OwnerId':_0x4dfdc3['id'],'Subject':intUtil[_0xfdf1('0xb')](_0x1f4c2c['Subjects'],_0x4b61c4,'\x20'),'Description':intUtil[_0xfdf1('0xb')](_0x1f4c2c[_0xfdf1('0xc')],_0x4b61c4,'\x0a')},getCustomFields(_0x1fea59,_0x4b61c4));if(_0x14ca02){if(_0x1f4c2c[_0xfdf1('0xd')]===_0xfdf1('0xe')){_0x54d875[_0xfdf1('0xf')]=moment['utc']();_0x54d875['IsReminderSet']=![];_0x54d875[_0xfdf1('0x10')]=![];if(_0x14ca02[_0xfdf1('0x11')]===_0xfdf1('0x12')||_0x14ca02[_0xfdf1('0x11')]==='lead'){_0x54d875['WhoId']=_0x14ca02['id'];}else if(_0x14ca02['endUserType']===_0xfdf1('0x13')){_0x54d875['WhatId']=_0x14ca02['id'];}}else if(_0x1f4c2c['ticketType']==='Case'){if(_0x14ca02[_0xfdf1('0x11')]==='contact'){_0x54d875[_0xfdf1('0x14')]=_0x14ca02['id'];}else if(_0x14ca02['endUserType']===_0xfdf1('0x13')){_0x54d875[_0xfdf1('0x15')]=_0x14ca02['id'];}else if(_0x14ca02[_0xfdf1('0x11')]===_0xfdf1('0x16')&&_0x1f4c2c[_0xfdf1('0x17')]){_0x54d875[_0x1f4c2c['leadId']]=_0x14ca02['id'];}else{logger[_0xfdf1('0x18')](_0xfdf1('0x19'));}}}return _0x4a4686[_0xfdf1('0x1a')](_0x1f4c2c[_0xfdf1('0xd')])['create'](_0x54d875);}function getUser(_0x5d414f,_0x7cb511,_0x4e8501){if(!_[_0xfdf1('0x1b')](_0x7cb511)&&intUtil[_0xfdf1('0x1c')](_0x7cb511)){var _0x277383={'Email':_0x7cb511};var _0x232d0e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e8501[_0xfdf1('0x1a')]('User')['find'](_0x277383,_0x232d0e)[_0xfdf1('0x1d')]()['then'](function(_0x5b6e6a){if(_0x5b6e6a['length']){var _0x12a78c=_[_0xfdf1('0x1e')](_0x5b6e6a,function(_0x18eb86){return _0x18eb86[_0xfdf1('0x1f')]===_0x7cb511;});if(_0x12a78c){logger[_0xfdf1('0x18')](_0xfdf1('0x20'),_0x7cb511);return BPromise[_0xfdf1('0x21')]({'id':_0x12a78c['Id'],'name':_0x12a78c[_0xfdf1('0x22')]});}}else{logger[_0xfdf1('0x18')](_0xfdf1('0x23'),_0x7cb511);return _0x4e8501['identity']()[_0xfdf1('0x24')](function(_0x5b109b){return BPromise['resolve']({'id':_0x5b109b[_0xfdf1('0x25')],'name':_0x5b109b[_0xfdf1('0x26')]});});}});}else{logger[_0xfdf1('0x18')](_0xfdf1('0x23'),_0x7cb511);return _0x4e8501[_0xfdf1('0x27')]()[_0xfdf1('0x24')](function(_0x469c5e){return BPromise[_0xfdf1('0x21')]({'id':_0x469c5e[_0xfdf1('0x25')],'name':_0x469c5e['display_name']});});}}function getEndUser(_0x4e0348,_0x19d37d,_0x756fa4,_0x1b845f,_0x50bfd1){var _0x52fa6f={'$or':{'Phone':_0x1b845f}};var _0x81d761={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xfdf1('0x24')](function(){logger['info'](_0xfdf1('0x28'),_0x1b845f,_0x19d37d[_0xfdf1('0x29')]);switch(_0x19d37d[_0xfdf1('0x29')]){case _0xfdf1('0x2a'):var _0x33c658=_[_0xfdf1('0x2b')](_0x52fa6f);if(_0x19d37d['additionalSearchContact']){var _0x1af897={};_0x1af897[_0x19d37d[_0xfdf1('0x2c')]]=_0x1b845f;_[_0xfdf1('0x2d')](_0x33c658[_0xfdf1('0x2e')],_0x1af897);}return _0x50bfd1['sobject'](_0xfdf1('0x2f'))['find'](_0x33c658,_0x81d761)[_0xfdf1('0x1d')]()[_0xfdf1('0x24')](function(_0x4d4568){if(_0x4d4568&&_0x4d4568[_0xfdf1('0x30')]){return _0x4d4568;}else{var _0x2b4254=_[_0xfdf1('0x2b')](_0x52fa6f);if(_0x19d37d[_0xfdf1('0x31')]){var _0x1c4648={};_0x1c4648[_0x19d37d[_0xfdf1('0x31')]]=_0x1b845f;_[_0xfdf1('0x2d')](_0x2b4254['$or'],_0x1c4648);}return _0x50bfd1[_0xfdf1('0x1a')](_0xfdf1('0x32'))[_0xfdf1('0x1e')](_0x2b4254,_0x81d761);}});case _0xfdf1('0x33'):var _0x382f65=_[_0xfdf1('0x2b')](_0x52fa6f);if(_0x19d37d['additionalSearchAccount']){var _0x1af897={};_0x1af897[_0x19d37d['additionalSearchAccount']]=_0x1b845f;_['merge'](_0x382f65['$or'],_0x1af897);}return _0x50bfd1[_0xfdf1('0x1a')](_0xfdf1('0x34'))[_0xfdf1('0x1e')](_0x382f65,_0x81d761)['execute']()['then'](function(_0x556bff){if(_0x556bff&&_0x556bff['length']){return _0x556bff;}else{var _0x11e58f=_['cloneDeep'](_0x52fa6f);if(_0x19d37d[_0xfdf1('0x2c')]){var _0x47a116={};_0x47a116[_0x19d37d[_0xfdf1('0x2c')]]=_0x1b845f;_['merge'](_0x11e58f[_0xfdf1('0x2e')],_0x47a116);}return _0x50bfd1[_0xfdf1('0x1a')](_0xfdf1('0x2f'))[_0xfdf1('0x1e')](_0x11e58f,_0x81d761)[_0xfdf1('0x24')](function(_0x2ba3a2){if(_0x2ba3a2&&_0x2ba3a2[_0xfdf1('0x30')]){return _0x2ba3a2;}else{var _0x314661=_['cloneDeep'](_0x52fa6f);if(_0x19d37d[_0xfdf1('0x31')]){var _0x15e136={};_0x15e136[_0x19d37d['additionalSearchLead']]=_0x1b845f;_[_0xfdf1('0x2d')](_0x314661[_0xfdf1('0x2e')],_0x15e136);}return _0x50bfd1[_0xfdf1('0x1a')](_0xfdf1('0x32'))[_0xfdf1('0x1e')](_0x314661,_0x81d761);}});}});case'contact':var _0x33c658=_[_0xfdf1('0x2b')](_0x52fa6f);if(_0x19d37d[_0xfdf1('0x2c')]){var _0x1af897={};_0x1af897[_0x19d37d[_0xfdf1('0x2c')]]=_0x1b845f;_[_0xfdf1('0x2d')](_0x33c658[_0xfdf1('0x2e')],_0x1af897);}return _0x50bfd1[_0xfdf1('0x1a')](_0xfdf1('0x2f'))[_0xfdf1('0x1e')](_0x33c658,_0x81d761)['execute']();case _0xfdf1('0x16'):var _0x56fa5e=_[_0xfdf1('0x2b')](_0x52fa6f);if(_0x19d37d[_0xfdf1('0x31')]){var _0x1af897={};_0x1af897[_0x19d37d[_0xfdf1('0x31')]]=_0x1b845f;_[_0xfdf1('0x2d')](_0x56fa5e[_0xfdf1('0x2e')],_0x1af897);}return _0x50bfd1['sobject']('Lead')['find'](_0x56fa5e,_0x81d761);case _0xfdf1('0x13'):var _0x382f65=_[_0xfdf1('0x2b')](_0x52fa6f);if(_0x19d37d[_0xfdf1('0x35')]){var _0x1af897={};_0x1af897[_0x19d37d[_0xfdf1('0x35')]]=_0x1b845f;_[_0xfdf1('0x2d')](_0x382f65['$or'],_0x1af897);}return _0x50bfd1[_0xfdf1('0x1a')](_0xfdf1('0x34'))['find'](_0x382f65,_0x81d761);default:return null;}})[_0xfdf1('0x24')](function(_0x17e6c9){if(_0x17e6c9&&_0x17e6c9[_0xfdf1('0x30')]){var _0x51d546=_[_0xfdf1('0x36')](_0x17e6c9);if(_0x51d546){return BPromise[_0xfdf1('0x21')]({'id':_0x51d546['Id'],'name':_0x51d546[_0xfdf1('0x22')],'phone':_0x51d546['Phone'],'endUserType':_0x51d546[_0xfdf1('0x37')]['type'][_0xfdf1('0x38')]()});}}})[_0xfdf1('0x24')](function(_0x29e67){if(_0x29e67){logger[_0xfdf1('0x18')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x29e67[_0xfdf1('0x11')],_0x1b845f);return BPromise[_0xfdf1('0x21')](_0x29e67);}else{logger[_0xfdf1('0x18')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x1b845f);var _0x3bb3e8={'Phone':_0x1b845f};if(_0x19d37d[_0xfdf1('0x39')]){if(_0x19d37d[_0xfdf1('0x39')]==='contact'){logger[_0xfdf1('0x18')](_0xfdf1('0x3a'),_0x1b845f,_0x19d37d['moduleCreate']);_0x3bb3e8[_0xfdf1('0x3b')]=_0x756fa4!==_0xfdf1('0x3c')?_0x756fa4:util[_0xfdf1('0x3d')](_0xfdf1('0x3e'),_0x1b845f);}else if(_0x19d37d[_0xfdf1('0x39')]===_0xfdf1('0x16')){logger[_0xfdf1('0x18')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1b845f,_0x19d37d['moduleCreate']);_0x3bb3e8['LastName']=_0x756fa4!==_0xfdf1('0x3c')?_0x756fa4:util[_0xfdf1('0x3d')]('Caller\x20-\x20%s',_0x1b845f);_0x3bb3e8[_0xfdf1('0x3f')]=_0xfdf1('0x40');}else if(_0x19d37d[_0xfdf1('0x39')]===_0xfdf1('0x13')){logger['info'](_0xfdf1('0x3a'),_0x1b845f,_0x19d37d[_0xfdf1('0x39')]);_0x3bb3e8[_0xfdf1('0x22')]=_0x756fa4!==_0xfdf1('0x3c')?_0x756fa4:util['format'](_0xfdf1('0x3e'),_0x1b845f);}else{return null;}}return _0x50bfd1[_0xfdf1('0x1a')](_[_0xfdf1('0x41')](_0x19d37d[_0xfdf1('0x39')]))[_0xfdf1('0x42')](_0x3bb3e8)[_0xfdf1('0x24')](function(_0x37f2df){return BPromise[_0xfdf1('0x21')]({'id':_0x37f2df['id'],'endUserType':_0x19d37d[_0xfdf1('0x39')]});});}});}function getCustomFields(_0x42fc67,_0x1cd87f){var _0x34a70e={};if(_0x42fc67['length']>0x0){_[_0xfdf1('0x43')](_0x42fc67,function(_0x21c88f){if(_[_0xfdf1('0x44')]([_0xfdf1('0x45'),_0xfdf1('0x46')],_0x21c88f[_0xfdf1('0x47')])&&_0x21c88f[_0xfdf1('0x48')]){_0x34a70e[_0x21c88f[_0xfdf1('0x48')]]=_0x21c88f[_0xfdf1('0x49')]['toString']();}else if(_0x21c88f['type']===_0xfdf1('0x4a')&&_0x21c88f[_0xfdf1('0x4b')]&&_0x21c88f[_0xfdf1('0x48')]){_0x1cd87f[_0x21c88f[_0xfdf1('0x4b')]]&&(_0x34a70e[_0x21c88f[_0xfdf1('0x48')]]=_0x1cd87f[_0x21c88f[_0xfdf1('0x4b')]][_0xfdf1('0x4c')]());}else if(_0x21c88f['type']===_0xfdf1('0x4d')&&_0x21c88f[_0xfdf1('0x4e')]&&_0x21c88f[_0xfdf1('0x4e')][_0xfdf1('0x4f')]&&_0x21c88f['idField']){_0x1cd87f[_0x21c88f['Variable']['name'][_0xfdf1('0x38')]()]&&(_0x34a70e[_0x21c88f['idField']]=_0x1cd87f[_0x21c88f['Variable']['name'][_0xfdf1('0x38')]()][_0xfdf1('0x4c')]());}});}return _0x34a70e;}function getConnection(_0x3552a4){var _0x7efdbe=_0x3552a4[_0xfdf1('0x50')][_0xfdf1('0x51')](_0x3552a4[_0xfdf1('0x52')]);var _0x57221f=new jsforce[(_0xfdf1('0x53'))]({'oauth2':{'loginUrl':_0x3552a4[_0xfdf1('0x54')]||_0xfdf1('0x55'),'clientId':_0x3552a4[_0xfdf1('0x56')],'clientSecret':_0x3552a4['clientSecret']}});return _0x57221f['login'](_0x3552a4[_0xfdf1('0x57')],_0x7efdbe)[_0xfdf1('0x24')](function(){logger[_0xfdf1('0x18')](_0xfdf1('0x58'));return _0x57221f;});}exports['queue']=function(_0x562732,_0x331805,_0x3fee6d,_0x3d6d3c,_0x5cc289,_0xc9ae3a){var _0x30b73a,_0x24dfb0,_0x9ff1df,_0x562ac9;_0xc9ae3a[_0xfdf1('0x59')]=intUtil['stripTrailingSlash'](_0xc9ae3a[_0xfdf1('0x59')]);_0xc9ae3a['remoteUri']=intUtil[_0xfdf1('0x5a')](_0xc9ae3a[_0xfdf1('0x54')]);if(_0x5cc289&&_0x5cc289['monitor_format']){logger['info']('[QUEUE]',_0xfdf1('0x5b'));_0x331805[_0xfdf1('0x5c')]=util[_0xfdf1('0x3d')](_0xfdf1('0x5d'),_0xc9ae3a[_0xfdf1('0x59')],_0x331805[_0xfdf1('0x5e')],md5(_0x331805['uniqueid']));}else{_0x331805[_0xfdf1('0x5c')]='';}return getConnection(_0xc9ae3a)[_0xfdf1('0x24')](function(_0x1fc417){_0x562ac9=_0x1fc417;return getUser(_0xc9ae3a,_0x3d6d3c[_0xfdf1('0x5f')],_0x562ac9);})[_0xfdf1('0x24')](function(_0x1b59ed){_0x30b73a=_0x1b59ed;return getEndUser(_0xc9ae3a,_0x3fee6d,_0x331805['calleridname'],_0x331805['calleridnum'],_0x562ac9);})['then'](function(_0x1de9d2){_0x24dfb0=_0x1de9d2;return getTicket(_0xc9ae3a,_0x30b73a,_0x24dfb0,_0x3fee6d,_0x331805,_0x3fee6d[_0xfdf1('0x60')],_0x562ac9,'queue');})[_0xfdf1('0x24')](function(_0x4e8a34){_0x9ff1df=_0x4e8a34;logger[_0xfdf1('0x18')](_0xfdf1('0x61'),_0x9ff1df['id']);logger[_0xfdf1('0x18')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x9ff1df['id'],_0x3d6d3c['name'],_0xc9ae3a[_0xfdf1('0x47')]);switch(_0xc9ae3a['type']){case _0xfdf1('0x62'):emit(util[_0xfdf1('0x3d')](_0xfdf1('0x63'),_0x3d6d3c[_0xfdf1('0x4f')]),_0xfdf1('0x64'),{'recordId':_0x9ff1df['id']});break;case'newTab':emit(util[_0xfdf1('0x3d')]('user:%s',_0x3d6d3c['name']),_0xfdf1('0x65'),{'uri':util[_0xfdf1('0x3d')](_0xfdf1('0x66'),_0x562ac9[_0xfdf1('0x67')],_0x9ff1df['id'])});break;default:logger['error'](_0xfdf1('0x68'));}})['catch'](function(_0x23638e){logger[_0xfdf1('0x69')]('[QUEUE]',_0x23638e);});};exports[_0xfdf1('0x6a')]=function(_0x43d704,_0xf8f341,_0x3ca655,_0xd435c,_0x467561,_0x314a59,_0x58cbe8){var _0x231e05,_0x952cc9,_0x17106f,_0x1d4ad5;_0x314a59[_0xfdf1('0x59')]=intUtil[_0xfdf1('0x5a')](_0x314a59[_0xfdf1('0x59')]);_0x314a59['remoteUri']=intUtil['stripTrailingSlash'](_0x314a59['remoteUri']);if(_0x58cbe8&&_0x58cbe8[_0xfdf1('0x6b')]&&_0x58cbe8[_0xfdf1('0x6b')]!==_0xfdf1('0x6c')){logger['info'](_0xfdf1('0x6d'),_0xfdf1('0x5b'));_0xf8f341[_0xfdf1('0x5c')]=util[_0xfdf1('0x3d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x314a59[_0xfdf1('0x59')],_0xf8f341[_0xfdf1('0x5e')],md5(_0xf8f341[_0xfdf1('0x5e')]));}return getConnection(_0x314a59)[_0xfdf1('0x24')](function(_0x14e0d6){_0x1d4ad5=_0x14e0d6;return getUser(_0x314a59,_0xd435c['email'],_0x1d4ad5);})[_0xfdf1('0x24')](function(_0x59828f){_0x231e05=_0x59828f;return getEndUser(_0x314a59,_0x3ca655,_0xf8f341[_0xfdf1('0x6e')],_0xf8f341[_0xfdf1('0x6f')],_0x1d4ad5);})[_0xfdf1('0x24')](function(_0x5ed94c){_0x952cc9=_0x5ed94c;return getTicket(_0x314a59,_0x231e05,_0x952cc9,_0x3ca655,_0xf8f341,_0x3ca655[_0xfdf1('0x60')],_0x1d4ad5,_0xfdf1('0x6a'));})[_0xfdf1('0x24')](function(_0x385b32){_0x17106f=_0x385b32;logger[_0xfdf1('0x18')](_0xfdf1('0x70'),_0x17106f['id']);logger[_0xfdf1('0x18')](_0xfdf1('0x71'),_0x17106f['id'],_0xd435c['name'],_0x314a59[_0xfdf1('0x47')]);switch(_0x314a59[_0xfdf1('0x47')]){case _0xfdf1('0x62'):emit(util[_0xfdf1('0x3d')](_0xfdf1('0x63'),_0xd435c[_0xfdf1('0x4f')]),'trigger:salesforce:display',{'recordId':_0x17106f['id']});break;case _0xfdf1('0x72'):emit(util[_0xfdf1('0x3d')]('user:%s',_0xd435c[_0xfdf1('0x4f')]),_0xfdf1('0x65'),{'uri':util[_0xfdf1('0x3d')]('%s/%s/e',_0x1d4ad5[_0xfdf1('0x67')],_0x17106f['id'])});break;default:logger['error'](_0xfdf1('0x6d'),_0xfdf1('0x73'));}})[_0xfdf1('0x74')](function(_0x343241){logger[_0xfdf1('0x69')](_0xfdf1('0x6d'),_0x343241);});};exports[_0xfdf1('0x75')]=function(_0x50909a,_0x526b75,_0x5b3a54,_0x44d065,_0x1a59cd,_0x1904b8){var _0x543b67,_0x3805ea,_0x3dfb86,_0x456a35;_0x1904b8[_0xfdf1('0x59')]=intUtil[_0xfdf1('0x5a')](_0x1904b8[_0xfdf1('0x59')]);_0x1904b8[_0xfdf1('0x54')]=intUtil['stripTrailingSlash'](_0x1904b8[_0xfdf1('0x54')]);if(_0x1a59cd&&_0x1a59cd[_0xfdf1('0x76')]){logger[_0xfdf1('0x18')]('['+_0x526b75[_0xfdf1('0x77')][_0xfdf1('0x78')]()+']',_0xfdf1('0x5b'));_0x526b75[_0xfdf1('0x5c')]=util[_0xfdf1('0x3d')](_0xfdf1('0x5d'),_0x1904b8[_0xfdf1('0x59')],_0x526b75[_0xfdf1('0x5e')],md5(_0x526b75[_0xfdf1('0x5e')]));}else{_0x526b75[_0xfdf1('0x5c')]='';}return getConnection(_0x1904b8)['then'](function(_0x436448){_0x456a35=_0x436448;if(!_[_0xfdf1('0x1b')](_0x44d065)){return getUser(_0x1904b8,_0x44d065[_0xfdf1('0x4f')],_0x456a35);}else{return getUser(_0x1904b8,null,_0x456a35);}})[_0xfdf1('0x24')](function(_0x5556ee){_0x543b67=_0x5556ee;return getEndUser(_0x1904b8,_0x5b3a54,_0x526b75[_0xfdf1('0x79')],_0x526b75[_0xfdf1('0x7a')],_0x456a35);})[_0xfdf1('0x24')](function(_0x591d39){_0x3805ea=_0x591d39;return getTicket(_0x1904b8,_0x543b67,_0x3805ea,_0x5b3a54,_0x526b75,_0x5b3a54[_0xfdf1('0x60')],_0x456a35);})[_0xfdf1('0x24')](function(_0x160c72){_0x3dfb86=_0x160c72;logger[_0xfdf1('0x18')]('['+_0x526b75['lastevent']['toUpperCase']()+_0xfdf1('0x7b'),_0x3dfb86['id']);logger[_0xfdf1('0x18')]('['+_0x526b75[_0xfdf1('0x77')]['toUpperCase']()+_0xfdf1('0x7c'),_0x1904b8[_0xfdf1('0x47')]);})[_0xfdf1('0x74')](function(_0x101c8a){logger[_0xfdf1('0x69')]('['+_0x526b75[_0xfdf1('0x77')][_0xfdf1('0x78')]()+']',_0x101c8a);});}; \ 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 a4a78c5..28fba79 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 _0x7aaa=[']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','catch','length','forEach','includes','string','picklist','type','customField','content','toString','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','sys_id','toUpperCase','error','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','true','userId','adminId','adminEmail'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x7aaa,0xbd));var _0xa7aa=function(_0x159454,_0x29f4f9){_0x159454=_0x159454-0x0;var _0x4311bb=_0x7aaa[_0x159454];return _0x4311bb;};'use strict';var _=require(_0xa7aa('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xa7aa('0x1'));var md5=require(_0xa7aa('0x2'));var Redis=require(_0xa7aa('0x3'));var intUtil=require('./util');var config=require(_0xa7aa('0x4'));var logger=require(_0xa7aa('0x5'))(_0xa7aa('0x6'));config['redis']=_[_0xa7aa('0x7')](config[_0xa7aa('0x8')],{'host':_0xa7aa('0x9'),'port':0x18eb});var io=require(_0xa7aa('0xa'))(new Redis(config['redis']));function getAdminUser(_0x494652,_0x526c90,_0x3f440d,_0x13745d,_0x2568af,_0x1e0674){return new Promise(function(_0x4e0ed,_0x31578c){var _0x496178={'method':_0xa7aa('0xb'),'uri':_0x13745d+_0xa7aa('0xc')+'&'+_0x2568af+'&'+_0x1e0674,'auth':_0x526c90,'json':!![]};return rp(_0x496178)['then'](function(_0x222c18){if(_0x222c18[_0xa7aa('0xd')]['length']>0x0){_0x3f440d['adminId']=_0x222c18[_0xa7aa('0xd')][0x0][_0xa7aa('0xe')];}logger['info']('['+[_0x494652[_0xa7aa('0xf')]()]+'],\x20getAdminUser\x20crm',_0x3f440d);_0x4e0ed(_0x3f440d);})['catch'](function(_0x10659b){logger[_0xa7aa('0x10')]('['+[_0x494652[_0xa7aa('0xf')]()]+']',_0x10659b[_0xa7aa('0x11')]);_0x31578c(_0x10659b[_0xa7aa('0x11')]);});});}function getUser(_0x1cf0a2,_0x365550,_0x2fe472,_0x5570bc,_0x333f44){return function(_0x148c37){logger[_0xa7aa('0x12')]('['+[_0x1cf0a2['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x148c37);return new Promise(function(_0x643022,_0x2fabfd){if(intUtil[_0xa7aa('0x13')](_0x148c37[_0xa7aa('0x14')])){var _0x49c0c4={'method':_0xa7aa('0xb'),'uri':_0x2fe472+_0xa7aa('0x15')+_0x148c37[_0xa7aa('0x14')]+'&'+_0x5570bc+'&'+_0x333f44,'auth':_0x365550,'json':!![]};logger[_0xa7aa('0x12')]('['+[_0x1cf0a2['toUpperCase']()]+_0xa7aa('0x16'),_0x49c0c4);return rp(_0x49c0c4)[_0xa7aa('0x17')](function(_0x5e7b3c){logger['info']('['+[_0x1cf0a2[_0xa7aa('0xf')]()]+'],\x20getUser\x20entity',_0x5e7b3c);if(_0x5e7b3c[_0xa7aa('0xd')]['length']>0x0&&String(_0x5e7b3c[_0xa7aa('0xd')][0x0][_0xa7aa('0x18')])===_0xa7aa('0x19')){_0x148c37[_0xa7aa('0x1a')]=_0x5e7b3c[_0xa7aa('0xd')][0x0][_0xa7aa('0xe')];}else{_0x148c37['userId']=_0x148c37[_0xa7aa('0x1b')];_0x148c37[_0xa7aa('0x14')]=_0x148c37[_0xa7aa('0x1c')];}logger[_0xa7aa('0x12')]('['+[_0x1cf0a2[_0xa7aa('0xf')]()]+'],\x20getUser\x20crm',_0x148c37);_0x643022(_0x148c37);})['catch'](function(_0x84f076){logger[_0xa7aa('0x10')]('['+[_0x1cf0a2['toUpperCase']()]+']',_0x84f076[_0xa7aa('0x11')]);_0x2fabfd(_0x84f076[_0xa7aa('0x11')]);});}else{logger[_0xa7aa('0x12')]('['+[_0x1cf0a2[_0xa7aa('0xf')]()]+_0xa7aa('0x1d'));_0x148c37[_0xa7aa('0x1a')]=_0x148c37['adminId'];_0x148c37[_0xa7aa('0x14')]=_0x148c37['adminEmail'];_0x643022(_0x148c37);}});};}function createEndUser(_0x52c320,_0x29b6e6,_0x2836ba,_0x426314,_0x5964b3){logger[_0xa7aa('0x12')]('['+[_0x52c320['toUpperCase']()]+_0xa7aa('0x1e'),_0x2836ba);return new Promise(function(_0x427da4,_0x9fbc97){var _0x14d933={'method':_0xa7aa('0x1f'),'uri':_0x426314+_0xa7aa('0x20')+_0x5964b3,'body':{'user_name':_0x2836ba[_0xa7aa('0x21')],'roles':_0xa7aa('0x22'),'first_name':_0x2836ba[_0xa7aa('0x21')],'active':_0xa7aa('0x19'),'date_format':'System','phone':_0x2836ba[_0xa7aa('0x21')]},'auth':_0x29b6e6,'json':!![]};return rp(_0x14d933)[_0xa7aa('0x17')](function(_0x558b93){logger[_0xa7aa('0x12')]('['+[_0x52c320[_0xa7aa('0xf')]()]+_0xa7aa('0x23'),_0x558b93['result']);_0x2836ba[_0xa7aa('0x24')]=_0x558b93['result'][_0xa7aa('0xe')];_0x427da4(_0x2836ba);})['catch'](function(_0x1c0c0d){logger['error']('['+[_0x52c320[_0xa7aa('0xf')]()]+']',_0x1c0c0d[_0xa7aa('0x11')]);_0x9fbc97(_0x1c0c0d['message']);});});}function getEndUser(_0x3afb36,_0x11e503,_0x1d8c3a,_0x507e73,_0x3d5142){return function(_0x328ad3){logger['info']('['+[_0x3afb36[_0xa7aa('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0x328ad3);return new Promise(function(_0x4522f9,_0x37da00){var _0x397ce5={'method':'GET','uri':_0x1d8c3a+'sys_user?sysparm_query=phone%3D'+_0x328ad3[_0xa7aa('0x21')]+'&'+_0x507e73+'&'+_0x3d5142,'auth':_0x11e503,'json':!![]};return rp(_0x397ce5)[_0xa7aa('0x17')](function(_0x30fbda){if(_0x30fbda[_0xa7aa('0xd')]['length']>0x0){_0x328ad3[_0xa7aa('0x24')]=_0x30fbda[_0xa7aa('0xd')][0x0][_0xa7aa('0xe')];logger['info']('['+[_0x3afb36[_0xa7aa('0xf')]()]+_0xa7aa('0x25'),_0x328ad3);_0x4522f9(_0x328ad3);}else{return createEndUser(_0x3afb36,_0x11e503,_0x328ad3,_0x1d8c3a,_0x507e73)[_0xa7aa('0x17')](function(_0x569a11){logger[_0xa7aa('0x12')]('['+[_0x3afb36[_0xa7aa('0xf')]()]+_0xa7aa('0x26'),_0x569a11);_0x4522f9(_0x569a11);});}})[_0xa7aa('0x27')](function(_0x30d09e){logger[_0xa7aa('0x10')]('['+[_0x3afb36[_0xa7aa('0xf')]()]+']',_0x30d09e['message']);_0x37da00(_0x30d09e['message']);});});};}function getCustomFields(_0x1e9d91,_0x286bd1){var _0x51b4aa={};if(_0x1e9d91[_0xa7aa('0x28')]>0x0){_[_0xa7aa('0x29')](_0x1e9d91,function(_0x39a6ef){if(_[_0xa7aa('0x2a')]([_0xa7aa('0x2b'),_0xa7aa('0x2c')],_0x39a6ef[_0xa7aa('0x2d')])&&_0x39a6ef['nameField']&&!_0x39a6ef[_0xa7aa('0x2e')]){_0x51b4aa[_0x39a6ef['nameField']['toLowerCase']()]=_0x39a6ef[_0xa7aa('0x2f')][_0xa7aa('0x30')]();}else if(_['includes']([_0xa7aa('0x2b'),_0xa7aa('0x2c')],_0x39a6ef[_0xa7aa('0x2d')])&&_0x39a6ef[_0xa7aa('0x31')]&&_0x39a6ef['customField']){_0x51b4aa[_0x39a6ef[_0xa7aa('0x31')][_0xa7aa('0x32')]()]=_0x39a6ef['content']['toString']();}else if(_0x39a6ef[_0xa7aa('0x2d')]===_0xa7aa('0x33')&&_0x39a6ef[_0xa7aa('0x34')]&&_0x39a6ef[_0xa7aa('0x31')]&&_0x39a6ef['customField']){_0x51b4aa[_0x39a6ef[_0xa7aa('0x31')]['toLowerCase']()]=_0x286bd1[_0x39a6ef[_0xa7aa('0x34')]][_0xa7aa('0x30')]();}else if(_0x39a6ef[_0xa7aa('0x2d')]===_0xa7aa('0x35')&&_0x39a6ef['Variable']&&_0x39a6ef[_0xa7aa('0x36')][_0xa7aa('0x37')]&&_0x39a6ef[_0xa7aa('0x31')]&&_0x39a6ef['customField']){_0x51b4aa[_0x39a6ef[_0xa7aa('0x31')]['toLowerCase']()]=_0x286bd1[_0x39a6ef[_0xa7aa('0x36')][_0xa7aa('0x37')][_0xa7aa('0x32')]()][_0xa7aa('0x30')]();}});}return _0x51b4aa;}function getTicket(_0x1c1fb5,_0x29c863,_0x43df74,_0x152a46,_0x2af6e2,_0x5d69fa){return function(_0x3e1897){logger[_0xa7aa('0x12')]('['+[_0x1c1fb5['toUpperCase']()]+_0xa7aa('0x38'),_0x3e1897);return new Promise(function(_0x84d08c,_0x295d1e){var _0x51bb0f=_0x1c1fb5[_0xa7aa('0x32')]()===_0xa7aa('0x39')?_0x3e1897['userId']:_0x3e1897[_0xa7aa('0x24')];var _0x1bb845={'method':_0xa7aa('0x1f'),'uri':_0x43df74+_0xa7aa('0x3a')+'?'+_0x5d69fa,'body':Object[_0xa7aa('0x3b')]({},{'active':'true','caller_id':_0x51bb0f,'assigned_to':_0x3e1897[_0xa7aa('0x1a')],'short_description':intUtil[_0xa7aa('0x3c')](_0x152a46[_0xa7aa('0x3d')],_0x2af6e2,'\x20'),'description':intUtil[_0xa7aa('0x3c')](_0x152a46[_0xa7aa('0x3e')],_0x2af6e2,'\x0a')},getCustomFields(_0x152a46['Fields'],_0x2af6e2)),'auth':_0x29c863,'json':!![]};return rp(_0x1bb845)[_0xa7aa('0x17')](function(_0x7216e1){logger[_0xa7aa('0x12')]('['+[_0x1c1fb5['toUpperCase']()]+_0xa7aa('0x3f'),_0x7216e1[_0xa7aa('0xd')]);_0x3e1897[_0xa7aa('0x40')]=_0x7216e1['result']['sys_id'];_0x3e1897[_0xa7aa('0x41')]=_0x7216e1[_0xa7aa('0xd')][_0xa7aa('0x42')];logger[_0xa7aa('0x12')]('['+[_0x1c1fb5[_0xa7aa('0xf')]()]+_0xa7aa('0x43'),_0x3e1897);_0x84d08c(_0x3e1897);})[_0xa7aa('0x27')](function(_0x58386c){logger['error']('['+[_0x1c1fb5[_0xa7aa('0xf')]()]+']',_0x58386c[_0xa7aa('0x11')]);_0x295d1e(_0x58386c[_0xa7aa('0x11')]);});});};}function createRemoteTag(_0x5b0822,_0x5e8121,_0xa2ecb2,_0x578b7a){return new Promise(function(_0xc0201b,_0x2ed86e){var _0x274a00={'method':_0xa7aa('0x1f'),'uri':_0xa2ecb2+_0xa7aa('0x44')+'?'+_0x578b7a,'body':{'short_description':_0x5b0822,'global':!![],'active':!![],'name':_0x5b0822},'auth':_0x5e8121,'json':!![]};return rp(_0x274a00)[_0xa7aa('0x17')](function(_0x1fcb39){var _0xdb4ddc=_0x1fcb39[_0xa7aa('0xd')][_0xa7aa('0xe')];_0xc0201b(_0xdb4ddc);});});}function getRemoteTag(_0x4173fd,_0x535530,_0x59bc7b,_0x4974b2,_0x2d7a6c){return new Promise(function(_0x34a9c0,_0xb8412c){var _0x19b14b={'method':_0xa7aa('0xb'),'uri':_0x59bc7b+_0xa7aa('0x44')+'?sysparm_query=name%3D'+_0x4173fd+'&'+_0x4974b2,'auth':_0x535530,'json':!![]};return rp(_0x19b14b)[_0xa7aa('0x17')](function(_0x1e7635){if(_0x1e7635[_0xa7aa('0xd')][_0xa7aa('0x28')]>0x0){var _0x283e92=_0x1e7635['result'][0x0][_0xa7aa('0xe')];_0x34a9c0(_0x283e92);}else{return createRemoteTag(_0x4173fd,_0x535530,_0x59bc7b,_0x4974b2)[_0xa7aa('0x17')](function(_0x4a825a){_0x34a9c0(_0x4a825a);});}});});}function assignTagToIncident(_0x28f860,_0x475c3b,_0x4fada0,_0x40f397,_0x1e7c72){return new Promise(function(_0xc91516,_0x356edb){var _0x5e4ce8={'method':_0xa7aa('0x1f'),'uri':_0x4fada0+_0xa7aa('0x45')+'?'+_0x1e7c72,'body':{'label':_0x28f860,'table':'incident','id_type':_0xa7aa('0x46'),'table_key':_0x40f397[_0xa7aa('0x40')],'title':_0xa7aa('0x47')+_0x40f397[_0xa7aa('0x41')],'id_display':_0x40f397[_0xa7aa('0x41')]},'auth':_0x475c3b,'json':!![]};return rp(_0x5e4ce8)[_0xa7aa('0x17')](function(_0x737c6){_0xc91516();})['catch'](function(){_0xc91516();});});}function manageTags(_0x217483,_0x525bb9,_0x8d8f0,_0xe91be5,_0x57f779,_0x2c7f9f,_0x1c6154){return new Promise(function(_0x1c435c,_0x2f18a4){var _0x407243=[];_0x525bb9['forEach'](function(_0x2f552f){_0x407243[_0xa7aa('0x48')](getRemoteTag(_0x2f552f,_0x8d8f0,_0xe91be5,_0x2c7f9f,_0x1c6154));});return Promise[_0xa7aa('0x49')](_0x407243)[_0xa7aa('0x17')](function(_0x21a70c){if(_0x21a70c['length']){logger[_0xa7aa('0x12')]('['+[_0x217483[_0xa7aa('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x21a70c);var _0x5577ec=[];_0x21a70c[_0xa7aa('0x29')](function(_0x90c532){_0x5577ec[_0xa7aa('0x48')](assignTagToIncident(_0x90c532,_0x8d8f0,_0xe91be5,_0x57f779,_0x2c7f9f));});return Promise[_0xa7aa('0x49')](_0x5577ec)[_0xa7aa('0x17')](function(){_0x1c435c();})['catch'](function(){_0x1c435c();});}else{_0x1c435c();}});});}function getTags(_0x3b28ce,_0x59920e,_0x2852a2,_0x132766,_0xe4b3d9,_0x2261a8){return function(_0x2f4657){return new Promise(function(_0x4ab55a,_0x772d3f){var _0x2722dd=[];var _0x44fdfe=_0x132766[_0xa7aa('0x4a')];if(_0x44fdfe&&_0x44fdfe[_0xa7aa('0x28')]>0x0){_0x2722dd=_[_0xa7aa('0x4b')](_0x44fdfe,_0xa7aa('0x37'));}if(_0x2722dd[_0xa7aa('0x28')]>0x0){return manageTags(_0x3b28ce,_0x2722dd,_0x59920e,_0x2852a2,_0x2f4657,_0xe4b3d9,_0x2261a8)[_0xa7aa('0x17')](function(){_0x4ab55a(_0x2f4657);});}else{_0x4ab55a(_0x2f4657);}});};}function emit(_0x446b97,_0x4be2a0,_0x340fc1){var _0x5629e8=_0xa7aa('0x4c')+_0xa7aa('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xa7aa('0x4e');var _0x3d85b6={'uri':_0x446b97+_0xa7aa('0x4f')+_0x340fc1+_0x5629e8};io['to'](util['format']('user:%s',_0x4be2a0))[_0xa7aa('0x50')](_0xa7aa('0x51'),_0x3d85b6);}exports['cs']=function(_0x48078a,_0x421e8c,_0x25f5c5,_0x25b44a,_0x5def22,_0x3814cb,_0x2d8afa,_0x21eb0f){var _0x4e4de3={};var _0x167d85={'user':_0x3814cb[_0xa7aa('0x52')],'pass':_0x3814cb[_0xa7aa('0x53')]};var _0x4dd745=_0xa7aa('0x54');var _0x3c64ce=_0xa7aa('0x55');_0x3814cb[_0xa7aa('0x56')]=intUtil[_0xa7aa('0x57')](_0x3814cb[_0xa7aa('0x56')]);_0x3814cb['serverUrl']=intUtil['stripTrailingSlash'](_0x3814cb[_0xa7aa('0x58')]);var _0x553d8f=util[_0xa7aa('0x59')](_0xa7aa('0x5a'),_0x3814cb[_0xa7aa('0x56')]);_0x4e4de3[_0xa7aa('0x14')]=!_[_0xa7aa('0x5b')](_0x25b44a)?_0x25b44a[_0xa7aa('0x5c')]:null;_0x4e4de3['adminEmail']=_0x3814cb[_0xa7aa('0x5c')];_0x4e4de3[_0xa7aa('0x21')]=_0x21eb0f[_0xa7aa('0x32')]()===_0xa7aa('0x39')?_0x421e8c[_0xa7aa('0x5d')]:_0x421e8c[_0xa7aa('0x5e')];_0x4e4de3[_0xa7aa('0x5f')]=_0x21eb0f===_0xa7aa('0x60')||_0x21eb0f===_0xa7aa('0x61')?_0xa7aa('0x60'):_0xa7aa('0x39');var _0x319268=util[_0xa7aa('0x59')](_0xa7aa('0x62'),_0x3814cb[_0xa7aa('0x58')],_0x421e8c[_0xa7aa('0x63')],md5(_0x421e8c[_0xa7aa('0x63')]));if(_0x5def22&&_0x5def22['monitor_format']){logger['info'](_0xa7aa('0x64'),_0xa7aa('0x65'));_0x421e8c[_0xa7aa('0x66')]=_0x319268;}else if(_0x2d8afa&&_0x2d8afa['recordingFormat']&&_0x2d8afa['recordingFormat']!==_0xa7aa('0x67')){logger[_0xa7aa('0x12')](_0xa7aa('0x68'),_0xa7aa('0x65'));_0x421e8c[_0xa7aa('0x66')]=_0x319268;}else{_0x421e8c[_0xa7aa('0x66')]='';}return getAdminUser(_0x21eb0f,_0x167d85,_0x4e4de3,_0x553d8f,_0x3c64ce,_0x4dd745)[_0xa7aa('0x17')](getUser(_0x21eb0f,_0x167d85,_0x553d8f,_0x3c64ce,_0x4dd745))[_0xa7aa('0x17')](getEndUser(_0x21eb0f,_0x167d85,_0x553d8f,_0x3c64ce,_0x4dd745))[_0xa7aa('0x17')](getTicket(_0x21eb0f,_0x167d85,_0x553d8f,_0x25f5c5,_0x421e8c,_0x3c64ce))[_0xa7aa('0x17')](function(_0x19a4d8){logger[_0xa7aa('0x12')](util[_0xa7aa('0x59')](_0xa7aa('0x69'),_0x19a4d8[_0xa7aa('0x40')]));logger[_0xa7aa('0x12')](util['format']('call\x20direction:\x20%s',_0x21eb0f));if(_0x21eb0f!=='unmanaged'){logger[_0xa7aa('0x12')]('['+[_0x21eb0f['toUpperCase']()]+']',_0xa7aa('0x6a'));emit(_0x3814cb[_0xa7aa('0x56')],_0x25b44a[_0xa7aa('0x37')],_0x19a4d8['ticketId']);}})[_0xa7aa('0x27')](function(_0x5f3e22){logger[_0xa7aa('0x10')]('['+[_0x21eb0f[_0xa7aa('0xf')]()]+_0xa7aa('0x6b'),util[_0xa7aa('0x6c')](_0x5f3e22,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x231b=['email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','true','userId','adminEmail','],\x20getUser\x20crm','message','adminId','POST','sys_user?','System','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','nameField','toLowerCase','content','toString','picklist','type','idField','customField','variable','variableName','Variable','name','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil'];(function(_0x2b5505,_0x455597){var _0x26e1d8=function(_0xb24277){while(--_0xb24277){_0x2b5505['push'](_0x2b5505['shift']());}};_0x26e1d8(++_0x455597);}(_0x231b,0x1b7));var _0xb231=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x231b[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xb231('0x0'));var Promise=require(_0xb231('0x1'));var rp=require(_0xb231('0x2'));var util=require('util');var md5=require(_0xb231('0x3'));var Redis=require(_0xb231('0x4'));var intUtil=require(_0xb231('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xb231('0x6'));config['redis']=_[_0xb231('0x7')](config[_0xb231('0x8')],{'host':_0xb231('0x9'),'port':0x18eb});var io=require(_0xb231('0xa'))(new Redis(config[_0xb231('0x8')]));function getAdminUser(_0x3783fc,_0x33c9d7,_0x32c9c,_0x58aa30,_0x350eb0,_0x9d31c5){return new Promise(function(_0xb910cb,_0x391424){var _0x3c51e3={'method':_0xb231('0xb'),'uri':_0x58aa30+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x350eb0+'&'+_0x9d31c5,'auth':_0x33c9d7,'json':!![]};return rp(_0x3c51e3)[_0xb231('0xc')](function(_0x260865){if(_0x260865[_0xb231('0xd')]['length']>0x0){_0x32c9c['adminId']=_0x260865['result'][0x0][_0xb231('0xe')];}logger['info']('['+[_0x3783fc[_0xb231('0xf')]()]+_0xb231('0x10'),_0x32c9c);_0xb910cb(_0x32c9c);})[_0xb231('0x11')](function(_0x39514c){logger[_0xb231('0x12')]('['+[_0x3783fc[_0xb231('0xf')]()]+']',_0x39514c['message']);_0x391424(_0x39514c['message']);});});}function getUser(_0x861a,_0x3a5ce4,_0x13c625,_0x56f880,_0x104c9b){return function(_0x279bfa){logger[_0xb231('0x13')]('['+[_0x861a[_0xb231('0xf')]()]+'],\x20getUser\x20input\x20crm',_0x279bfa);return new Promise(function(_0xf41c7d,_0x40300e){if(intUtil[_0xb231('0x14')](_0x279bfa[_0xb231('0x15')])){var _0x3d6701={'method':_0xb231('0xb'),'uri':_0x13c625+_0xb231('0x16')+_0x279bfa[_0xb231('0x15')]+'&'+_0x56f880+'&'+_0x104c9b,'auth':_0x3a5ce4,'json':!![]};logger[_0xb231('0x13')]('['+[_0x861a['toUpperCase']()]+_0xb231('0x17'),_0x3d6701);return rp(_0x3d6701)['then'](function(_0x598990){logger[_0xb231('0x13')]('['+[_0x861a[_0xb231('0xf')]()]+_0xb231('0x18'),_0x598990);if(_0x598990[_0xb231('0xd')][_0xb231('0x19')]>0x0&&String(_0x598990[_0xb231('0xd')][0x0]['active'])===_0xb231('0x1a')){_0x279bfa[_0xb231('0x1b')]=_0x598990[_0xb231('0xd')][0x0]['sys_id'];}else{_0x279bfa['userId']=_0x279bfa['adminId'];_0x279bfa[_0xb231('0x15')]=_0x279bfa[_0xb231('0x1c')];}logger[_0xb231('0x13')]('['+[_0x861a[_0xb231('0xf')]()]+_0xb231('0x1d'),_0x279bfa);_0xf41c7d(_0x279bfa);})[_0xb231('0x11')](function(_0x55e2e9){logger['error']('['+[_0x861a[_0xb231('0xf')]()]+']',_0x55e2e9[_0xb231('0x1e')]);_0x40300e(_0x55e2e9['message']);});}else{logger['info']('['+[_0x861a[_0xb231('0xf')]()]+']\x20using\x20admin\x20profile');_0x279bfa['userId']=_0x279bfa[_0xb231('0x1f')];_0x279bfa['userEmail']=_0x279bfa[_0xb231('0x1c')];_0xf41c7d(_0x279bfa);}});};}function createEndUser(_0x24bf71,_0x28492d,_0xdac79b,_0xc4e534,_0x57290b){logger[_0xb231('0x13')]('['+[_0x24bf71['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0xdac79b);return new Promise(function(_0xe45de2,_0x34c39b){var _0x27fe78={'method':_0xb231('0x20'),'uri':_0xc4e534+_0xb231('0x21')+_0x57290b,'body':{'user_name':_0xdac79b['endUserNumber'],'roles':'user','first_name':_0xdac79b['endUserNumber'],'active':_0xb231('0x1a'),'date_format':_0xb231('0x22'),'phone':_0xdac79b[_0xb231('0x23')]},'auth':_0x28492d,'json':!![]};return rp(_0x27fe78)[_0xb231('0xc')](function(_0x3bd08c){logger[_0xb231('0x13')]('['+[_0x24bf71[_0xb231('0xf')]()]+_0xb231('0x24'),_0x3bd08c[_0xb231('0xd')]);_0xdac79b[_0xb231('0x25')]=_0x3bd08c['result'][_0xb231('0xe')];_0xe45de2(_0xdac79b);})[_0xb231('0x11')](function(_0x345e24){logger[_0xb231('0x12')]('['+[_0x24bf71['toUpperCase']()]+']',_0x345e24['message']);_0x34c39b(_0x345e24['message']);});});}function getEndUser(_0x3adafd,_0x491369,_0x2416d0,_0xf09a8e,_0x6ff91f){return function(_0xc8de18){logger[_0xb231('0x13')]('['+[_0x3adafd[_0xb231('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0xc8de18);return new Promise(function(_0x15390e,_0x167ad2){var _0x49c421={'method':'GET','uri':_0x2416d0+'sys_user?sysparm_query=phone%3D'+_0xc8de18[_0xb231('0x23')]+'&'+_0xf09a8e+'&'+_0x6ff91f,'auth':_0x491369,'json':!![]};return rp(_0x49c421)['then'](function(_0x44a98e){if(_0x44a98e['result']['length']>0x0){_0xc8de18[_0xb231('0x25')]=_0x44a98e['result'][0x0][_0xb231('0xe')];logger['info']('['+[_0x3adafd[_0xb231('0xf')]()]+_0xb231('0x26'),_0xc8de18);_0x15390e(_0xc8de18);}else{return createEndUser(_0x3adafd,_0x491369,_0xc8de18,_0x2416d0,_0xf09a8e)[_0xb231('0xc')](function(_0x534efb){logger[_0xb231('0x13')]('['+[_0x3adafd[_0xb231('0xf')]()]+_0xb231('0x27'),_0x534efb);_0x15390e(_0x534efb);});}})[_0xb231('0x11')](function(_0x57b794){logger[_0xb231('0x12')]('['+[_0x3adafd[_0xb231('0xf')]()]+']',_0x57b794[_0xb231('0x1e')]);_0x167ad2(_0x57b794[_0xb231('0x1e')]);});});};}function getCustomFields(_0x4e85e5,_0x1efda3){var _0x2bf27e={};if(_0x4e85e5[_0xb231('0x19')]>0x0){_['forEach'](_0x4e85e5,function(_0x20a108){if(_[_0xb231('0x28')]([_0xb231('0x29'),'picklist'],_0x20a108['type'])&&_0x20a108[_0xb231('0x2a')]&&!_0x20a108['customField']){_0x2bf27e[_0x20a108[_0xb231('0x2a')][_0xb231('0x2b')]()]=_0x20a108[_0xb231('0x2c')][_0xb231('0x2d')]();}else if(_[_0xb231('0x28')]([_0xb231('0x29'),_0xb231('0x2e')],_0x20a108[_0xb231('0x2f')])&&_0x20a108[_0xb231('0x30')]&&_0x20a108[_0xb231('0x31')]){_0x2bf27e[_0x20a108['idField'][_0xb231('0x2b')]()]=_0x20a108['content'][_0xb231('0x2d')]();}else if(_0x20a108['type']===_0xb231('0x32')&&_0x20a108[_0xb231('0x33')]&&_0x20a108[_0xb231('0x30')]&&_0x20a108[_0xb231('0x31')]){_0x2bf27e[_0x20a108[_0xb231('0x30')][_0xb231('0x2b')]()]=_0x1efda3[_0x20a108['variableName']]['toString']();}else if(_0x20a108[_0xb231('0x2f')]==='customVariable'&&_0x20a108[_0xb231('0x34')]&&_0x20a108[_0xb231('0x34')][_0xb231('0x35')]&&_0x20a108[_0xb231('0x30')]&&_0x20a108[_0xb231('0x31')]){_0x2bf27e[_0x20a108[_0xb231('0x30')][_0xb231('0x2b')]()]=_0x1efda3[_0x20a108[_0xb231('0x34')][_0xb231('0x35')][_0xb231('0x2b')]()][_0xb231('0x2d')]();}});}return _0x2bf27e;}function getTicket(_0x26b5ab,_0x299714,_0x13d6b6,_0x29adf5,_0x40d114,_0x4ef8c9){return function(_0x1f4344){logger[_0xb231('0x13')]('['+[_0x26b5ab[_0xb231('0xf')]()]+']\x20getTicket\x20input\x20crm',_0x1f4344);return new Promise(function(_0x3e7bce,_0x2f19e7){var _0x5bbc38=_0x26b5ab[_0xb231('0x2b')]()==='outbound'?_0x1f4344[_0xb231('0x1b')]:_0x1f4344[_0xb231('0x25')];var _0x241ffb={'method':_0xb231('0x20'),'uri':_0x13d6b6+'incident'+'?'+_0x4ef8c9,'body':Object[_0xb231('0x36')]({},{'active':'true','caller_id':_0x5bbc38,'assigned_to':_0x1f4344['userId'],'short_description':intUtil[_0xb231('0x37')](_0x29adf5[_0xb231('0x38')],_0x40d114,'\x20'),'description':intUtil[_0xb231('0x37')](_0x29adf5[_0xb231('0x39')],_0x40d114,'\x0a')},getCustomFields(_0x29adf5[_0xb231('0x3a')],_0x40d114)),'auth':_0x299714,'json':!![]};return rp(_0x241ffb)[_0xb231('0xc')](function(_0x16286d){logger[_0xb231('0x13')]('['+[_0x26b5ab[_0xb231('0xf')]()]+_0xb231('0x3b'),_0x16286d[_0xb231('0xd')]);_0x1f4344[_0xb231('0x3c')]=_0x16286d['result']['sys_id'];_0x1f4344[_0xb231('0x3d')]=_0x16286d['result'][_0xb231('0x3e')];logger[_0xb231('0x13')]('['+[_0x26b5ab[_0xb231('0xf')]()]+_0xb231('0x3f'),_0x1f4344);_0x3e7bce(_0x1f4344);})[_0xb231('0x11')](function(_0x217e9d){logger['error']('['+[_0x26b5ab[_0xb231('0xf')]()]+']',_0x217e9d[_0xb231('0x1e')]);_0x2f19e7(_0x217e9d[_0xb231('0x1e')]);});});};}function createRemoteTag(_0x59e025,_0x4e2960,_0x2c8fc1,_0x3b09e8){return new Promise(function(_0x580b3c,_0x14ac98){var _0x49f7c7={'method':_0xb231('0x20'),'uri':_0x2c8fc1+'label'+'?'+_0x3b09e8,'body':{'short_description':_0x59e025,'global':!![],'active':!![],'name':_0x59e025},'auth':_0x4e2960,'json':!![]};return rp(_0x49f7c7)[_0xb231('0xc')](function(_0x3de1de){var _0x5fcc42=_0x3de1de[_0xb231('0xd')]['sys_id'];_0x580b3c(_0x5fcc42);});});}function getRemoteTag(_0x1e46e9,_0x3efddd,_0x4c3b49,_0x5dd661,_0x3dd992){return new Promise(function(_0x2a1357,_0x4ed7a7){var _0x3f0be9={'method':_0xb231('0xb'),'uri':_0x4c3b49+'label'+_0xb231('0x40')+_0x1e46e9+'&'+_0x5dd661,'auth':_0x3efddd,'json':!![]};return rp(_0x3f0be9)[_0xb231('0xc')](function(_0x5b040c){if(_0x5b040c[_0xb231('0xd')][_0xb231('0x19')]>0x0){var _0x504e7f=_0x5b040c[_0xb231('0xd')][0x0][_0xb231('0xe')];_0x2a1357(_0x504e7f);}else{return createRemoteTag(_0x1e46e9,_0x3efddd,_0x4c3b49,_0x5dd661)['then'](function(_0x5d1621){_0x2a1357(_0x5d1621);});}});});}function assignTagToIncident(_0x4efd43,_0x387616,_0x39d149,_0x27100e,_0x500578){return new Promise(function(_0x40465e,_0x7d50f5){var _0x2bd307={'method':_0xb231('0x20'),'uri':_0x39d149+_0xb231('0x41')+'?'+_0x500578,'body':{'label':_0x4efd43,'table':'incident','id_type':_0xb231('0x42'),'table_key':_0x27100e[_0xb231('0x3c')],'title':_0xb231('0x43')+_0x27100e[_0xb231('0x3d')],'id_display':_0x27100e['ticketNumber']},'auth':_0x387616,'json':!![]};return rp(_0x2bd307)['then'](function(_0x5b3508){_0x40465e();})[_0xb231('0x11')](function(){_0x40465e();});});}function manageTags(_0x41bd7c,_0x5e0304,_0x9bc94,_0x5086fb,_0x57866a,_0x349c38,_0x543dc8){return new Promise(function(_0x5d57c3,_0xda564c){var _0x998612=[];_0x5e0304['forEach'](function(_0x429c09){_0x998612[_0xb231('0x44')](getRemoteTag(_0x429c09,_0x9bc94,_0x5086fb,_0x349c38,_0x543dc8));});return Promise[_0xb231('0x45')](_0x998612)[_0xb231('0xc')](function(_0x53e354){if(_0x53e354[_0xb231('0x19')]){logger['info']('['+[_0x41bd7c[_0xb231('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x53e354);var _0x200ae5=[];_0x53e354['forEach'](function(_0x509d3b){_0x200ae5['push'](assignTagToIncident(_0x509d3b,_0x9bc94,_0x5086fb,_0x57866a,_0x349c38));});return Promise[_0xb231('0x45')](_0x200ae5)[_0xb231('0xc')](function(){_0x5d57c3();})[_0xb231('0x11')](function(){_0x5d57c3();});}else{_0x5d57c3();}});});}function getTags(_0x597b65,_0x22c2ad,_0x49b31a,_0x35811b,_0x195703,_0x388f04){return function(_0x1f0652){return new Promise(function(_0x384c37,_0x1a4b59){var _0x1056a8=[];var _0x41d1aa=_0x35811b[_0xb231('0x46')];if(_0x41d1aa&&_0x41d1aa['length']>0x0){_0x1056a8=_['map'](_0x41d1aa,_0xb231('0x35'));}if(_0x1056a8[_0xb231('0x19')]>0x0){return manageTags(_0x597b65,_0x1056a8,_0x22c2ad,_0x49b31a,_0x1f0652,_0x195703,_0x388f04)['then'](function(){_0x384c37(_0x1f0652);});}else{_0x384c37(_0x1f0652);}});};}function emit(_0xb0865b,_0x1f1dd4,_0x5639e3){var _0x87c887='%26sysparm_record_target%3Dincident'+_0xb231('0x47')+_0xb231('0x48')+_0xb231('0x49');var _0x1ada9e={'uri':_0xb0865b+_0xb231('0x4a')+_0x5639e3+_0x87c887};io['to'](util[_0xb231('0x4b')]('user:%s',_0x1f1dd4))[_0xb231('0x4c')]('trigger:browser:url',_0x1ada9e);}exports['cs']=function(_0x53be53,_0x401521,_0x102f95,_0x1f8486,_0xb0cc70,_0x3e1f69,_0x126be3,_0x1c28f8){var _0x187813={};var _0x212145={'user':_0x3e1f69[_0xb231('0x4d')],'pass':_0x3e1f69[_0xb231('0x4e')]};var _0xb0be32=_0xb231('0x4f');var _0x36c10a=_0xb231('0x50');_0x3e1f69[_0xb231('0x51')]=intUtil[_0xb231('0x52')](_0x3e1f69['remoteUri']);_0x3e1f69[_0xb231('0x53')]=intUtil[_0xb231('0x52')](_0x3e1f69[_0xb231('0x53')]);var _0x4c6ac9=util[_0xb231('0x4b')](_0xb231('0x54'),_0x3e1f69[_0xb231('0x51')]);_0x187813[_0xb231('0x15')]=!_[_0xb231('0x55')](_0x1f8486)?_0x1f8486[_0xb231('0x56')]:null;_0x187813['adminEmail']=_0x3e1f69[_0xb231('0x56')];_0x187813[_0xb231('0x23')]=_0x1c28f8[_0xb231('0x2b')]()===_0xb231('0x57')?_0x401521[_0xb231('0x58')]:_0x401521[_0xb231('0x59')];_0x187813[_0xb231('0x5a')]=_0x1c28f8===_0xb231('0x5b')||_0x1c28f8===_0xb231('0x5c')?'queue':_0xb231('0x57');var _0x4f9412=util[_0xb231('0x4b')](_0xb231('0x5d'),_0x3e1f69[_0xb231('0x53')],_0x401521['uniqueid'],md5(_0x401521[_0xb231('0x5e')]));if(_0xb0cc70&&_0xb0cc70[_0xb231('0x5f')]){logger[_0xb231('0x13')](_0xb231('0x60'),_0xb231('0x61'));_0x401521[_0xb231('0x62')]=_0x4f9412;}else if(_0x126be3&&_0x126be3[_0xb231('0x63')]&&_0x126be3[_0xb231('0x63')]!==_0xb231('0x64')){logger[_0xb231('0x13')](_0xb231('0x65'),'Recording\x20is\x20enabled!');_0x401521['recordingURL']=_0x4f9412;}else{_0x401521['recordingURL']='';}return getAdminUser(_0x1c28f8,_0x212145,_0x187813,_0x4c6ac9,_0x36c10a,_0xb0be32)[_0xb231('0xc')](getUser(_0x1c28f8,_0x212145,_0x4c6ac9,_0x36c10a,_0xb0be32))[_0xb231('0xc')](getEndUser(_0x1c28f8,_0x212145,_0x4c6ac9,_0x36c10a,_0xb0be32))['then'](getTicket(_0x1c28f8,_0x212145,_0x4c6ac9,_0x102f95,_0x401521,_0x36c10a))['then'](function(_0xfb35b){logger['info'](util[_0xb231('0x4b')]('The\x20ticket\x20ID\x20is:\x20%s',_0xfb35b['ticketId']));logger[_0xb231('0x13')](util[_0xb231('0x4b')]('call\x20direction:\x20%s',_0x1c28f8));if(_0x1c28f8!=='unmanaged'){logger[_0xb231('0x13')]('['+[_0x1c28f8[_0xb231('0xf')]()]+']',_0xb231('0x66'));emit(_0x3e1f69[_0xb231('0x51')],_0x1f8486[_0xb231('0x35')],_0xfb35b['ticketId']);}})[_0xb231('0x11')](function(_0x417919){logger[_0xb231('0x12')]('['+[_0x1c28f8[_0xb231('0xf')]()]+_0xb231('0x67'),util[_0xb231('0x68')](_0x417919,{'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 8609ed6..0541fdb 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 _0x40f3=['md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','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','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','user_name','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','[HTTP]','map','type','string','nameField','customField','toLowerCase','content','custom_fields','toString','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','error','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','Inbound','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x40f3,0x17c));var _0x340f=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x40f3[_0x1fcaf1];return _0x55f464;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x340f('0x0'));var md5=require(_0x340f('0x1'));var util=require(_0x340f('0x2'));var Redis=require(_0x340f('0x3'));var intUtil=require(_0x340f('0x4'));var config=require('../../../../config/environment');var logger=require(_0x340f('0x5'))(_0x340f('0x6'));config[_0x340f('0x7')]=_['defaults'](config[_0x340f('0x7')],{'host':_0x340f('0x8'),'port':0x18eb});var io=require(_0x340f('0x9'))(new Redis(config[_0x340f('0x7')]));var def={'method':_0x340f('0xa'),'json':!![]};function emit(_0x5dd1b8,_0x2da9e8,_0x5a7090){io['to'](_0x5dd1b8)[_0x340f('0xb')](_0x2da9e8,_0x5a7090);}function getTicket(_0x364924,_0x45e051,_0x130253,_0x2937bd,_0x2e8fc2,_0x2a0a2c,_0x1da22b,_0xd89079){logger[_0x340f('0xc')](_0x340f('0xd'));var _0x4baa64=new Date();var _0x2ab695=[{'name':_0x340f('0xe'),'value':intUtil[_0x340f('0xf')](_0x2937bd['Subjects'],_0x2e8fc2,'\x20')},{'name':_0x340f('0x10'),'value':_0x45e051['id']},{'name':_0x340f('0x11'),'value':_0x45e051['id']},{'name':_0x340f('0x12'),'value':intUtil[_0x340f('0xf')](_0x2937bd[_0x340f('0x13')],_0x2e8fc2,'\x0a')},{'name':_0x340f('0x14'),'value':_0x4baa64[_0x340f('0x15')]()[_0x340f('0x16')](0x0,0x13)[_0x340f('0x17')]('T','\x20')},{'name':_0x340f('0x18'),'value':'0'},{'name':_0x340f('0x19'),'value':'15'},{'name':_0x340f('0x1a'),'value':_0x130253['id']},{'name':_0x340f('0x1b'),'value':_0x340f('0x1c')},{'name':_0x340f('0x1d'),'value':_0x130253[_0x340f('0xe')]},{'name':_0x340f('0x1e'),'value':_0xd89079}];if(_0x2a0a2c[_0x340f('0x1f')]){_[_0x340f('0x20')](_0x2a0a2c,function(_0x6786d1){if(_0x2e8fc2[_0x6786d1[_0x340f('0x21')]]){_0x2ab695[_0x340f('0x22')]({'name':_0x6786d1[_0x340f('0x23')],'value':_0x2e8fc2[_0x6786d1['variableName']]});}});}return request({'form':{'method':_0x340f('0x24'),'input_type':'JSON','response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x1da22b['id'],'module_name':_0x340f('0x27'),'name_value_list':_0x2ab695})}});}function getAuth(_0x3315fb){return util['format'](_0x340f('0x28'),new Buffer(_0x3315fb[_0x340f('0x29')]+':X')['toString'](_0x340f('0x2a')));}function getServerInfo(_0x2cd951){return request({'form':{'method':_0x340f('0x2b'),'input_type':_0x340f('0x25'),'response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x2cd951['id']})}});}function getUser(_0x13744f,_0xe7805b,_0xac4133){if(!_[_0x340f('0x2c')](_0xe7805b)){logger[_0x340f('0xc')](_0x340f('0x2d'),_0xe7805b);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x340f('0x25'),'rest_data':JSON['stringify']({'session':_0xac4133['id'],'module_name':'Employees','query':util['format'](_0x340f('0x2e'),_0xe7805b),'order_by':'','offset':'0','select_fields':['id',_0x340f('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4afd53){if(_0x4afd53[_0x340f('0x2f')][_0x340f('0x1f')]){var _0x8c986=_[_0x340f('0x30')](_0x4afd53[_0x340f('0x2f')],function(_0x2507ad){return _0x2507ad[_0x340f('0x31')][_0x340f('0x32')][_0x340f('0x33')]===_0xe7805b;});if(_0x8c986){logger['info'](_0x340f('0x34'));return BPromise['resolve']({'id':_0x8c986['name_value_list']['id'][_0x340f('0x33')],'name':_0x8c986['name_value_list'][_0x340f('0xe')]['value']});}}logger[_0x340f('0xc')](_0x340f('0x35'));return BPromise[_0x340f('0x36')]({'id':_0xac4133[_0x340f('0x31')][_0x340f('0x37')]['value'],'name':_0xac4133[_0x340f('0x31')][_0x340f('0x32')][_0x340f('0x33')]});});}else{logger[_0x340f('0xc')](_0x340f('0x38'));return BPromise[_0x340f('0x36')]({'id':_0xac4133[_0x340f('0x31')][_0x340f('0x37')][_0x340f('0x33')],'name':_0xac4133[_0x340f('0x31')][_0x340f('0x32')][_0x340f('0x33')]});}}function getEndUser(_0x54d5d0,_0x5d4153,_0x21700a,_0x197417){logger['info'](_0x340f('0x39'),_0x21700a);return request({'form':{'method':_0x340f('0x3a'),'input_type':_0x340f('0x25'),'response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x197417['id'],'module_name':'Contacts','query':util[_0x340f('0x3b')](_0x340f('0x3c'),_0x21700a),'order_by':'','offset':'0','select_fields':['id',_0x340f('0xe'),_0x340f('0x3d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x340f('0x3e')](function(_0x19a73d){if(_0x19a73d['entry_list'][_0x340f('0x1f')]){var _0x3d3b05=_[_0x340f('0x30')](_0x19a73d[_0x340f('0x2f')],function(_0x2ec5b6){return _0x2ec5b6[_0x340f('0x31')][_0x340f('0x3d')][_0x340f('0x33')]===_0x21700a;});if(_0x3d3b05){logger[_0x340f('0xc')](_0x340f('0x3f'));return BPromise[_0x340f('0x36')]({'id':_0x3d3b05[_0x340f('0x31')]['id'][_0x340f('0x33')],'name':_0x3d3b05[_0x340f('0x31')][_0x340f('0xe')][_0x340f('0x33')],'phone':_0x3d3b05[_0x340f('0x31')][_0x340f('0x3d')][_0x340f('0x33')]});}}else{logger[_0x340f('0xc')](_0x340f('0x40'));return request({'form':{'method':_0x340f('0x24'),'input_type':_0x340f('0x25'),'response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x197417['id'],'module_name':_0x340f('0x1c'),'name_value_list':[{'name':_0x340f('0x41'),'value':_0x5d4153!==_0x340f('0x42')?_0x5d4153:util[_0x340f('0x3b')]('Caller\x20-\x20%s',_0x21700a)},{'name':'phone_home','value':_0x21700a}]})}})[_0x340f('0x3e')](function(_0x3aeedf){logger[_0x340f('0xc')](_0x340f('0x43'));return BPromise[_0x340f('0x36')]({'id':_0x3aeedf['id'],'name':_0x3aeedf['entry_list']['first_name'][_0x340f('0x33')],'phone':_0x3aeedf['entry_list'][_0x340f('0x3d')][_0x340f('0x33')]});});}});}function request(_0x523b94){logger['debug'](_0x340f('0x44'),JSON[_0x340f('0x26')](_0x523b94));return rp(_['merge'](def,_0x523b94));}function getTags(_0x519427,_0x59dddd){var _0x22e5e1=[];if(_0x519427&&_0x519427[_0x340f('0x1f')]>0x0){_0x22e5e1=_[_0x340f('0x45')](_0x519427,_0x59dddd);}return _0x22e5e1;}function getCustomFields(_0x59f062,_0x494dbf){var _0x4a6b4c=[];var _0x46ef98={'custom_fields':[]};if(_0x59f062[_0x340f('0x1f')]>0x0){_['forEach'](_0x59f062,function(_0x146913){if(_0x146913[_0x340f('0x46')]===_0x340f('0x47')&&_0x146913[_0x340f('0x48')]&&!_0x146913[_0x340f('0x49')]){_0x46ef98[_0x146913['nameField'][_0x340f('0x4a')]()]=_0x146913[_0x340f('0x4b')]['toString']();}else if(_0x146913[_0x340f('0x46')]===_0x340f('0x47')&&_0x146913[_0x340f('0x23')]&&_0x146913[_0x340f('0x49')]){_0x46ef98[_0x340f('0x4c')][_0x340f('0x22')]({'id':_0x146913['idField'],'value':_0x146913['content'][_0x340f('0x4d')]()});}else if(_0x146913[_0x340f('0x46')]===_0x340f('0x4e')&&_0x146913[_0x340f('0x21')]&&_0x146913[_0x340f('0x23')]&&_0x146913[_0x340f('0x49')]){_0x494dbf[_0x146913[_0x340f('0x21')]]&&_0x46ef98['custom_fields']['push']({'id':_0x146913['idField'],'value':_0x494dbf[_0x146913['variableName']][_0x340f('0x4d')]()});}else if(_0x146913[_0x340f('0x46')]===_0x340f('0x4f')&&_0x146913['Variable']&&_0x146913[_0x340f('0x50')]['name']&&_0x146913['idField']&&_0x146913[_0x340f('0x49')]){_0x494dbf[_0x146913[_0x340f('0x50')][_0x340f('0xe')][_0x340f('0x4a')]()]&&_0x46ef98[_0x340f('0x4c')]['push']({'id':_0x146913[_0x340f('0x23')],'value':_0x494dbf[_0x146913[_0x340f('0x50')]['name'][_0x340f('0x4a')]()][_0x340f('0x4d')]()});}});}return _0x46ef98;}function getConnection(_0x42e238){return request({'method':_0x340f('0xa'),'form':{'method':_0x340f('0x51'),'input_type':'JSON','response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'user_auth':{'user_name':_0x42e238[_0x340f('0x52')],'password':_0x42e238['password'],'encryption':_0x340f('0x53')},'application':_0x340f('0x54')})}})['then'](function(_0x24c401){var _0x6702b8=_0x24c401;if(_0x6702b8['id']){def[_0x340f('0x55')]=_0x6702b8['id'];return BPromise['resolve'](_0x6702b8);}else{throw new Error(util[_0x340f('0x3b')](_0x340f('0x56'),_0x42e238['id']));}});}function setRelationship(_0x3042a5,_0x2fbd34,_0x31bd1a,_0x385905){return request({'form':{'method':'set_relationship','input_type':_0x340f('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3042a5['id'],'module_name':_0x340f('0x27'),'module_id':_0x31bd1a['id'],'link_field_name':_0x385905,'related_ids':[_0x2fbd34['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x340f('0x57')]=function(_0x2e8125,_0x251dfc,_0x3a72d5,_0x245373,_0x1cd6a9,_0x562e88){var _0x1ea170,_0x38782d,_0x3e9978,_0x31fc75;_0x562e88[_0x340f('0x58')]=intUtil[_0x340f('0x59')](_0x562e88[_0x340f('0x58')]);_0x562e88['serverUrl']=intUtil[_0x340f('0x59')](_0x562e88['serverUrl']);def[_0x340f('0x5a')]=util[_0x340f('0x3b')](_0x340f('0x5b'),_0x562e88[_0x340f('0x58')]);if(_0x1cd6a9&&_0x1cd6a9[_0x340f('0x5c')]){logger['info'](_0x340f('0x5d'),_0x340f('0x5e'));_0x251dfc[_0x340f('0x5f')]=util[_0x340f('0x3b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x562e88[_0x340f('0x60')],_0x251dfc[_0x340f('0x61')],md5(_0x251dfc['uniqueid']));}else{_0x251dfc['recordingURL']='';}return getConnection(_0x562e88)[_0x340f('0x3e')](function(_0x3ed142){_0x31fc75=_0x3ed142;return getUser(_0x562e88,_0x245373[_0x340f('0xe')],_0x31fc75);})['then'](function(_0xa89a41){_0x1ea170=_0xa89a41;logger[_0x340f('0xc')](_0x340f('0x62'),_0x1ea170['id']);return getEndUser(_0x562e88,_0x251dfc[_0x340f('0x63')],_0x251dfc['calleridnum'],_0x31fc75);})[_0x340f('0x3e')](function(_0x3a638e){_0x38782d=_0x3a638e;logger[_0x340f('0xc')](_0x340f('0x64'),_0x38782d['id']);return getTicket(_0x562e88,_0x1ea170,_0x38782d,_0x3a72d5,_0x251dfc,_0x3a72d5['Fields'],_0x31fc75,'Inbound');})[_0x340f('0x3e')](function(_0x3c8607){_0x3e9978=_0x3c8607;logger['info']('Ticket\x20created!');logger[_0x340f('0xc')](_0x340f('0x65'),_0x3e9978['id']);return setRelationship(_0x31fc75,_0x1ea170,_0x3e9978,_0x340f('0x66'));})[_0x340f('0x3e')](function(){return setRelationship(_0x31fc75,_0x38782d,_0x3e9978,_0x340f('0x67'));})['then'](function(){return getServerInfo(_0x31fc75);})['then'](function(_0xa93cd6){var _0x3acfb1=parseInt(_0xa93cd6['version'][_0x340f('0x68')](0x0));var _0xcd5341=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x562e88[_0x340f('0x58')],_0x3e9978['id']);if(_0x3acfb1>0x6){_0xcd5341=util['format'](_0x340f('0x69'),_0x562e88['remoteUri'],_0x3e9978['id']);}logger[_0x340f('0xc')]('[QUEUE]',_0x340f('0x6a'));emit(util[_0x340f('0x3b')](_0x340f('0x6b'),_0x245373[_0x340f('0xe')]),_0x340f('0x6c'),{'uri':_0xcd5341});})[_0x340f('0x6d')](function(_0x437e4c){logger['error'](_0x340f('0x5d'),JSON[_0x340f('0x26')](_0x437e4c));});};exports[_0x340f('0x6e')]=function(_0x1a337e,_0x5a86a1,_0x3ce5c2,_0xa0c6ef,_0x531fb6,_0xe1974a,_0x3e1bce){var _0x3530e3,_0x255038,_0x5bd8eb,_0x986485;_0xe1974a[_0x340f('0x58')]=intUtil['stripTrailingSlash'](_0xe1974a[_0x340f('0x58')]);_0xe1974a[_0x340f('0x60')]=intUtil[_0x340f('0x59')](_0xe1974a[_0x340f('0x60')]);def['uri']=util[_0x340f('0x3b')](_0x340f('0x5b'),_0xe1974a[_0x340f('0x58')]);if(_0x3e1bce&&_0x3e1bce[_0x340f('0x6f')]&&_0x3e1bce[_0x340f('0x6f')]!==_0x340f('0x70')){logger[_0x340f('0xc')](_0x340f('0x71'),'Recording\x20is\x20enabled!');_0x5a86a1[_0x340f('0x5f')]=util[_0x340f('0x3b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe1974a[_0x340f('0x60')],_0x5a86a1['uniqueid'],md5(_0x5a86a1['uniqueid']));}return getConnection(_0xe1974a)[_0x340f('0x3e')](function(_0x5d5bca){_0x986485=_0x5d5bca;return getUser(_0xe1974a,_0xa0c6ef['name'],_0x986485);})[_0x340f('0x3e')](function(_0x333708){_0x3530e3=_0x333708;logger[_0x340f('0xc')](_0x340f('0x62'),_0x3530e3['id']);return getEndUser(_0xe1974a,_0x5a86a1[_0x340f('0x72')],_0x5a86a1[_0x340f('0x73')],_0x986485);})[_0x340f('0x3e')](function(_0x573e74){_0x255038=_0x573e74;logger['info'](_0x340f('0x64'),_0x255038['id']);return getTicket(_0xe1974a,_0x3530e3,_0x255038,_0x3ce5c2,_0x5a86a1,_0x3ce5c2[_0x340f('0x74')],_0x986485,_0x340f('0x75'));})['then'](function(_0x43b591){_0x5bd8eb=_0x43b591;logger[_0x340f('0xc')](_0x340f('0x76'));logger[_0x340f('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5bd8eb['id']);return setRelationship(_0x986485,_0x3530e3,_0x5bd8eb,_0x340f('0x66'));})['then'](function(){return setRelationship(_0x986485,_0x255038,_0x5bd8eb,_0x340f('0x67'));})[_0x340f('0x3e')](function(){return getServerInfo(_0x986485);})[_0x340f('0x3e')](function(_0x711dc0){var _0x4c3196=parseInt(_0x711dc0['version'][_0x340f('0x68')](0x0));var _0x47136e=util[_0x340f('0x3b')](_0x340f('0x77'),_0xe1974a[_0x340f('0x58')],_0x5bd8eb['id']);if(_0x4c3196>0x6){_0x47136e=util[_0x340f('0x3b')](_0x340f('0x69'),_0xe1974a[_0x340f('0x58')],_0x5bd8eb['id']);}logger[_0x340f('0xc')](_0x340f('0x71'),_0x340f('0x6a'));emit(util[_0x340f('0x3b')](_0x340f('0x6b'),_0xa0c6ef[_0x340f('0xe')]),_0x340f('0x6c'),{'uri':_0x47136e});})[_0x340f('0x6d')](function(_0x1c2292){logger[_0x340f('0x78')](_0x340f('0x71'),JSON[_0x340f('0x26')](_0x1c2292));});};exports[_0x340f('0x79')]=function(_0x395fa3,_0x2993c4,_0x2b0523,_0x36fe41,_0x43df13,_0x5881ea){var _0x53e55f,_0x410309,_0x12a46a,_0x4f6cad;_0x5881ea[_0x340f('0x58')]=intUtil[_0x340f('0x59')](_0x5881ea['remoteUri']);_0x5881ea[_0x340f('0x60')]=intUtil['stripTrailingSlash'](_0x5881ea['serverUrl']);def[_0x340f('0x5a')]=util[_0x340f('0x3b')](_0x340f('0x5b'),_0x5881ea[_0x340f('0x58')]);if(_0x43df13&&_0x43df13[_0x340f('0x5c')]){logger[_0x340f('0xc')]('['+_0x2993c4[_0x340f('0x7a')][_0x340f('0x7b')]()+']',_0x340f('0x5e'));_0x2993c4['recordingURL']=util[_0x340f('0x3b')](_0x340f('0x7c'),_0x5881ea[_0x340f('0x60')],_0x2993c4[_0x340f('0x61')],md5(_0x2993c4[_0x340f('0x61')]));}else{_0x2993c4[_0x340f('0x5f')]='';}return getConnection(_0x5881ea)[_0x340f('0x3e')](function(_0x2c4872){_0x4f6cad=_0x2c4872;if(!_[_0x340f('0x2c')](_0x36fe41)){return getUser(_0x5881ea,_0x36fe41[_0x340f('0xe')],_0x4f6cad);}else{return getUser(_0x5881ea,null,_0x4f6cad);}})['then'](function(_0x45b39e){_0x53e55f=_0x45b39e;logger[_0x340f('0xc')](_0x340f('0x62'),_0x53e55f['id']);return getEndUser(_0x5881ea,_0x2993c4[_0x340f('0x63')],_0x2993c4[_0x340f('0x7d')],_0x4f6cad);})[_0x340f('0x3e')](function(_0x1d21eb){_0x410309=_0x1d21eb;logger[_0x340f('0xc')](_0x340f('0x64'),_0x410309['id']);return getTicket(_0x5881ea,_0x53e55f,_0x410309,_0x2b0523,_0x2993c4,_0x2b0523[_0x340f('0x74')],_0x4f6cad,_0x340f('0x7e'));})['then'](function(_0x366b0e){_0x12a46a=_0x366b0e;logger['info']('Ticket\x20created!');logger[_0x340f('0xc')](_0x340f('0x65'),_0x12a46a['id']);return setRelationship(_0x4f6cad,_0x53e55f,_0x12a46a,_0x340f('0x66'));})[_0x340f('0x3e')](function(){return setRelationship(_0x4f6cad,_0x410309,_0x12a46a,_0x340f('0x67'));})['then'](function(){return getServerInfo(_0x4f6cad);})[_0x340f('0x6d')](function(_0x3aa6da){logger[_0x340f('0x78')]('['+_0x2993c4[_0x340f('0x7a')][_0x340f('0x7b')]()+']',JSON[_0x340f('0x26')](_0x3aa6da));});}; \ No newline at end of file +var _0xe91e=['parent_type','Contacts','direction','length','forEach','variableName','push','idField','JSON','Calls','format','apiKey','base64','get_server_info','stringify','isNil','get_entry_list','Employees','user_name','then','find','entry_list','Agent\x20found!','resolve','name_value_list','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','variable','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','users','user:%s','catch','error','unmanaged','lastevent','toUpperCase','Inbound','The\x20Ticket\x20ID\x20is:','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','slice','duration_hours','parent_id'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0xe91e,0x1c7));var _0xee91=function(_0x1b591b,_0x6d2e2b){_0x1b591b=_0x1b591b-0x0;var _0x3c24f0=_0xe91e[_0x1b591b];return _0x3c24f0;};'use strict';var _=require(_0xee91('0x0'));var rp=require(_0xee91('0x1'));var BPromise=require(_0xee91('0x2'));var md5=require(_0xee91('0x3'));var util=require('util');var Redis=require(_0xee91('0x4'));var intUtil=require(_0xee91('0x5'));var config=require(_0xee91('0x6'));var logger=require(_0xee91('0x7'))('sugarcrm');config[_0xee91('0x8')]=_[_0xee91('0x9')](config[_0xee91('0x8')],{'host':_0xee91('0xa'),'port':0x18eb});var io=require(_0xee91('0xb'))(new Redis(config[_0xee91('0x8')]));var def={'method':_0xee91('0xc'),'json':!![]};function emit(_0x47ad62,_0x1a2f64,_0x1cdaa4){io['to'](_0x47ad62)[_0xee91('0xd')](_0x1a2f64,_0x1cdaa4);}function getTicket(_0x3511aa,_0x324c67,_0x259d75,_0xe16b5f,_0x4a3613,_0x10ef2f,_0xba1ddb,_0x279735){logger[_0xee91('0xe')](_0xee91('0xf'));var _0x4a3927=new Date();var _0x960d1e=[{'name':_0xee91('0x10'),'value':intUtil[_0xee91('0x11')](_0xe16b5f[_0xee91('0x12')],_0x4a3613,'\x20')},{'name':_0xee91('0x13'),'value':_0x324c67['id']},{'name':_0xee91('0x14'),'value':_0x324c67['id']},{'name':_0xee91('0x15'),'value':intUtil[_0xee91('0x11')](_0xe16b5f['Descriptions'],_0x4a3613,'\x0a')},{'name':'date_start','value':_0x4a3927['toISOString']()[_0xee91('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':_0xee91('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xee91('0x18'),'value':_0x259d75['id']},{'name':_0xee91('0x19'),'value':_0xee91('0x1a')},{'name':'parent_name','value':_0x259d75[_0xee91('0x10')]},{'name':_0xee91('0x1b'),'value':_0x279735}];if(_0x10ef2f[_0xee91('0x1c')]){_[_0xee91('0x1d')](_0x10ef2f,function(_0x11f637){if(_0x4a3613[_0x11f637[_0xee91('0x1e')]]){_0x960d1e[_0xee91('0x1f')]({'name':_0x11f637[_0xee91('0x20')],'value':_0x4a3613[_0x11f637[_0xee91('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xee91('0x21'),'response_type':_0xee91('0x21'),'rest_data':JSON['stringify']({'session':_0xba1ddb['id'],'module_name':_0xee91('0x22'),'name_value_list':_0x960d1e})}});}function getAuth(_0x50fab6){return util[_0xee91('0x23')]('Basic\x20%s',new Buffer(_0x50fab6[_0xee91('0x24')]+':X')['toString'](_0xee91('0x25')));}function getServerInfo(_0x2f2d71){return request({'form':{'method':_0xee91('0x26'),'input_type':_0xee91('0x21'),'response_type':'JSON','rest_data':JSON[_0xee91('0x27')]({'session':_0x2f2d71['id']})}});}function getUser(_0x1c221a,_0x4016b8,_0x530ad5){if(!_[_0xee91('0x28')](_0x4016b8)){logger[_0xee91('0xe')]('Getting\x20agent\x20with\x20name',_0x4016b8);return request({'form':{'method':_0xee91('0x29'),'input_type':_0xee91('0x21'),'response_type':_0xee91('0x21'),'rest_data':JSON['stringify']({'session':_0x530ad5['id'],'module_name':_0xee91('0x2a'),'query':util[_0xee91('0x23')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4016b8),'order_by':'','offset':'0','select_fields':['id',_0xee91('0x10'),_0xee91('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xee91('0x2c')](function(_0x22a883){if(_0x22a883['entry_list'][_0xee91('0x1c')]){var _0x41c216=_[_0xee91('0x2d')](_0x22a883[_0xee91('0x2e')],function(_0x5321e1){return _0x5321e1['name_value_list']['user_name']['value']===_0x4016b8;});if(_0x41c216){logger[_0xee91('0xe')](_0xee91('0x2f'));return BPromise[_0xee91('0x30')]({'id':_0x41c216[_0xee91('0x31')]['id']['value'],'name':_0x41c216['name_value_list']['name']['value']});}}logger[_0xee91('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xee91('0x30')]({'id':_0x530ad5[_0xee91('0x31')][_0xee91('0x32')][_0xee91('0x33')],'name':_0x530ad5[_0xee91('0x31')][_0xee91('0x2b')][_0xee91('0x33')]});});}else{logger[_0xee91('0xe')](_0xee91('0x34'));return BPromise[_0xee91('0x30')]({'id':_0x530ad5[_0xee91('0x31')][_0xee91('0x32')][_0xee91('0x33')],'name':_0x530ad5[_0xee91('0x31')][_0xee91('0x2b')][_0xee91('0x33')]});}}function getEndUser(_0xf04729,_0x317fca,_0x5ee9a9,_0x3e2d29){logger[_0xee91('0xe')](_0xee91('0x35'),_0x5ee9a9);return request({'form':{'method':_0xee91('0x29'),'input_type':_0xee91('0x21'),'response_type':'JSON','rest_data':JSON[_0xee91('0x27')]({'session':_0x3e2d29['id'],'module_name':'Contacts','query':util[_0xee91('0x23')](_0xee91('0x36'),_0x5ee9a9),'order_by':'','offset':'0','select_fields':['id',_0xee91('0x10'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3b4ace){if(_0x3b4ace[_0xee91('0x2e')][_0xee91('0x1c')]){var _0x339c27=_[_0xee91('0x2d')](_0x3b4ace['entry_list'],function(_0x21a383){return _0x21a383[_0xee91('0x31')][_0xee91('0x37')][_0xee91('0x33')]===_0x5ee9a9;});if(_0x339c27){logger[_0xee91('0xe')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x339c27[_0xee91('0x31')]['id'][_0xee91('0x33')],'name':_0x339c27[_0xee91('0x31')][_0xee91('0x10')][_0xee91('0x33')],'phone':_0x339c27['name_value_list']['phone_home'][_0xee91('0x33')]});}}else{logger[_0xee91('0xe')](_0xee91('0x38'));return request({'form':{'method':_0xee91('0x39'),'input_type':'JSON','response_type':_0xee91('0x21'),'rest_data':JSON['stringify']({'session':_0x3e2d29['id'],'module_name':_0xee91('0x1a'),'name_value_list':[{'name':_0xee91('0x3a'),'value':_0x317fca!==_0xee91('0x3b')?_0x317fca:util[_0xee91('0x23')]('Caller\x20-\x20%s',_0x5ee9a9)},{'name':_0xee91('0x37'),'value':_0x5ee9a9}]})}})[_0xee91('0x2c')](function(_0x380930){logger['info'](_0xee91('0x3c'));return BPromise[_0xee91('0x30')]({'id':_0x380930['id'],'name':_0x380930[_0xee91('0x2e')][_0xee91('0x3a')][_0xee91('0x33')],'phone':_0x380930[_0xee91('0x2e')][_0xee91('0x37')]['value']});});}});}function request(_0x265ec8){logger[_0xee91('0x3d')](_0xee91('0x3e'),JSON[_0xee91('0x27')](_0x265ec8));return rp(_['merge'](def,_0x265ec8));}function getTags(_0x430728,_0x108177){var _0x505a87=[];if(_0x430728&&_0x430728['length']>0x0){_0x505a87=_[_0xee91('0x3f')](_0x430728,_0x108177);}return _0x505a87;}function getCustomFields(_0xccb3d2,_0x5c6865){var _0x4aa2ed=[];var _0x138f0c={'custom_fields':[]};if(_0xccb3d2[_0xee91('0x1c')]>0x0){_[_0xee91('0x1d')](_0xccb3d2,function(_0x542f90){if(_0x542f90[_0xee91('0x40')]===_0xee91('0x41')&&_0x542f90[_0xee91('0x42')]&&!_0x542f90[_0xee91('0x43')]){_0x138f0c[_0x542f90[_0xee91('0x42')][_0xee91('0x44')]()]=_0x542f90[_0xee91('0x45')][_0xee91('0x46')]();}else if(_0x542f90['type']==='string'&&_0x542f90['idField']&&_0x542f90[_0xee91('0x43')]){_0x138f0c[_0xee91('0x47')][_0xee91('0x1f')]({'id':_0x542f90['idField'],'value':_0x542f90[_0xee91('0x45')]['toString']()});}else if(_0x542f90['type']===_0xee91('0x48')&&_0x542f90['variableName']&&_0x542f90[_0xee91('0x20')]&&_0x542f90[_0xee91('0x43')]){_0x5c6865[_0x542f90['variableName']]&&_0x138f0c[_0xee91('0x47')][_0xee91('0x1f')]({'id':_0x542f90[_0xee91('0x20')],'value':_0x5c6865[_0x542f90[_0xee91('0x1e')]][_0xee91('0x46')]()});}else if(_0x542f90[_0xee91('0x40')]===_0xee91('0x49')&&_0x542f90[_0xee91('0x4a')]&&_0x542f90[_0xee91('0x4a')][_0xee91('0x10')]&&_0x542f90['idField']&&_0x542f90[_0xee91('0x43')]){_0x5c6865[_0x542f90[_0xee91('0x4a')][_0xee91('0x10')]['toLowerCase']()]&&_0x138f0c['custom_fields']['push']({'id':_0x542f90['idField'],'value':_0x5c6865[_0x542f90['Variable'][_0xee91('0x10')][_0xee91('0x44')]()][_0xee91('0x46')]()});}});}return _0x138f0c;}function getConnection(_0x2990d1){return request({'method':_0xee91('0xc'),'form':{'method':_0xee91('0x4b'),'input_type':'JSON','response_type':_0xee91('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2990d1['username'],'password':_0x2990d1[_0xee91('0x4c')],'encryption':_0xee91('0x4d')},'application':_0xee91('0x4e')})}})[_0xee91('0x2c')](function(_0x309ef4){var _0x136781=_0x309ef4;if(_0x136781['id']){def[_0xee91('0x4f')]=_0x136781['id'];return BPromise[_0xee91('0x30')](_0x136781);}else{throw new Error(util[_0xee91('0x23')](_0xee91('0x50'),_0x2990d1['id']));}});}function setRelationship(_0x5724d8,_0xf2fa53,_0x190ad1,_0x4febd2){return request({'form':{'method':'set_relationship','input_type':_0xee91('0x21'),'response_type':_0xee91('0x21'),'rest_data':JSON[_0xee91('0x27')]({'session':_0x5724d8['id'],'module_name':'Calls','module_id':_0x190ad1['id'],'link_field_name':_0x4febd2,'related_ids':[_0xf2fa53['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xee91('0x51')]=function(_0x51b14d,_0xdc3030,_0x57bf4e,_0x3a6786,_0x4cdde2,_0x511c82){var _0x22600a,_0xd6fb4c,_0xca9d24,_0xdead16;_0x511c82['remoteUri']=intUtil[_0xee91('0x52')](_0x511c82['remoteUri']);_0x511c82[_0xee91('0x53')]=intUtil['stripTrailingSlash'](_0x511c82[_0xee91('0x53')]);def[_0xee91('0x54')]=util[_0xee91('0x23')](_0xee91('0x55'),_0x511c82[_0xee91('0x56')]);if(_0x4cdde2&&_0x4cdde2[_0xee91('0x57')]){logger[_0xee91('0xe')](_0xee91('0x58'),_0xee91('0x59'));_0xdc3030[_0xee91('0x5a')]=util['format'](_0xee91('0x5b'),_0x511c82[_0xee91('0x53')],_0xdc3030['uniqueid'],md5(_0xdc3030[_0xee91('0x5c')]));}else{_0xdc3030['recordingURL']='';}return getConnection(_0x511c82)[_0xee91('0x2c')](function(_0x234647){_0xdead16=_0x234647;return getUser(_0x511c82,_0x3a6786['name'],_0xdead16);})[_0xee91('0x2c')](function(_0x397459){_0x22600a=_0x397459;logger['info'](_0xee91('0x5d'),_0x22600a['id']);return getEndUser(_0x511c82,_0xdc3030['calleridname'],_0xdc3030[_0xee91('0x5e')],_0xdead16);})['then'](function(_0x4e8885){_0xd6fb4c=_0x4e8885;logger[_0xee91('0xe')](_0xee91('0x5f'),_0xd6fb4c['id']);return getTicket(_0x511c82,_0x22600a,_0xd6fb4c,_0x57bf4e,_0xdc3030,_0x57bf4e['Fields'],_0xdead16,'Inbound');})[_0xee91('0x2c')](function(_0x1f8939){_0xca9d24=_0x1f8939;logger[_0xee91('0xe')](_0xee91('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xca9d24['id']);return setRelationship(_0xdead16,_0x22600a,_0xca9d24,'users');})[_0xee91('0x2c')](function(){return setRelationship(_0xdead16,_0xd6fb4c,_0xca9d24,_0xee91('0x61'));})['then'](function(){return getServerInfo(_0xdead16);})[_0xee91('0x2c')](function(_0x2e85d0){var _0x19a702=parseInt(_0x2e85d0[_0xee91('0x62')][_0xee91('0x63')](0x0));var _0x31ed03=util[_0xee91('0x23')](_0xee91('0x64'),_0x511c82[_0xee91('0x56')],_0xca9d24['id']);if(_0x19a702>0x6){_0x31ed03=util[_0xee91('0x23')](_0xee91('0x65'),_0x511c82['remoteUri'],_0xca9d24['id']);}logger['info'](_0xee91('0x58'),_0xee91('0x66'));emit(util[_0xee91('0x23')]('user:%s',_0x3a6786[_0xee91('0x10')]),_0xee91('0x67'),{'uri':_0x31ed03});})['catch'](function(_0x1e37fc){logger['error'](_0xee91('0x58'),JSON[_0xee91('0x27')](_0x1e37fc));});};exports[_0xee91('0x68')]=function(_0x2ba92b,_0x1d7f81,_0x2e177d,_0x1e74ff,_0x511e4a,_0x4eb8d0,_0x17b857){var _0x582ef3,_0x5ce97a,_0x133abc,_0x59de43;_0x4eb8d0['remoteUri']=intUtil['stripTrailingSlash'](_0x4eb8d0[_0xee91('0x56')]);_0x4eb8d0[_0xee91('0x53')]=intUtil[_0xee91('0x52')](_0x4eb8d0[_0xee91('0x53')]);def[_0xee91('0x54')]=util[_0xee91('0x23')]('%s/service/v4_1/rest.php',_0x4eb8d0[_0xee91('0x56')]);if(_0x17b857&&_0x17b857[_0xee91('0x69')]&&_0x17b857[_0xee91('0x69')]!=='none'){logger[_0xee91('0xe')](_0xee91('0x6a'),_0xee91('0x59'));_0x1d7f81['recordingURL']=util[_0xee91('0x23')](_0xee91('0x5b'),_0x4eb8d0[_0xee91('0x53')],_0x1d7f81[_0xee91('0x5c')],md5(_0x1d7f81[_0xee91('0x5c')]));}return getConnection(_0x4eb8d0)[_0xee91('0x2c')](function(_0x1aeae3){_0x59de43=_0x1aeae3;return getUser(_0x4eb8d0,_0x1e74ff[_0xee91('0x10')],_0x59de43);})['then'](function(_0x49979b){_0x582ef3=_0x49979b;logger['info']('The\x20User\x20ID\x20is:',_0x582ef3['id']);return getEndUser(_0x4eb8d0,_0x1d7f81[_0xee91('0x6b')],_0x1d7f81[_0xee91('0x6c')],_0x59de43);})['then'](function(_0x3a654a){_0x5ce97a=_0x3a654a;logger['info'](_0xee91('0x5f'),_0x5ce97a['id']);return getTicket(_0x4eb8d0,_0x582ef3,_0x5ce97a,_0x2e177d,_0x1d7f81,_0x2e177d[_0xee91('0x6d')],_0x59de43,_0xee91('0x6e'));})[_0xee91('0x2c')](function(_0x14f8af){_0x133abc=_0x14f8af;logger['info'](_0xee91('0x60'));logger[_0xee91('0xe')]('The\x20Ticket\x20ID\x20is:',_0x133abc['id']);return setRelationship(_0x59de43,_0x582ef3,_0x133abc,_0xee91('0x6f'));})['then'](function(){return setRelationship(_0x59de43,_0x5ce97a,_0x133abc,_0xee91('0x61'));})['then'](function(){return getServerInfo(_0x59de43);})[_0xee91('0x2c')](function(_0x463e52){var _0x4ed3ed=parseInt(_0x463e52[_0xee91('0x62')][_0xee91('0x63')](0x0));var _0x4810b9=util[_0xee91('0x23')](_0xee91('0x64'),_0x4eb8d0[_0xee91('0x56')],_0x133abc['id']);if(_0x4ed3ed>0x6){_0x4810b9=util['format'](_0xee91('0x65'),_0x4eb8d0['remoteUri'],_0x133abc['id']);}logger[_0xee91('0xe')](_0xee91('0x6a'),_0xee91('0x66'));emit(util[_0xee91('0x23')](_0xee91('0x70'),_0x1e74ff[_0xee91('0x10')]),_0xee91('0x67'),{'uri':_0x4810b9});})[_0xee91('0x71')](function(_0x1a2132){logger[_0xee91('0x72')](_0xee91('0x6a'),JSON[_0xee91('0x27')](_0x1a2132));});};exports[_0xee91('0x73')]=function(_0x29d31b,_0x104aee,_0x1a251f,_0x589c75,_0x3b7f46,_0x137584){var _0x30d55f,_0xaae519,_0x7f1151,_0x190f7e;_0x137584['remoteUri']=intUtil[_0xee91('0x52')](_0x137584[_0xee91('0x56')]);_0x137584[_0xee91('0x53')]=intUtil[_0xee91('0x52')](_0x137584['serverUrl']);def[_0xee91('0x54')]=util['format']('%s/service/v4_1/rest.php',_0x137584[_0xee91('0x56')]);if(_0x3b7f46&&_0x3b7f46[_0xee91('0x57')]){logger[_0xee91('0xe')]('['+_0x104aee[_0xee91('0x74')][_0xee91('0x75')]()+']',_0xee91('0x59'));_0x104aee['recordingURL']=util[_0xee91('0x23')](_0xee91('0x5b'),_0x137584[_0xee91('0x53')],_0x104aee[_0xee91('0x5c')],md5(_0x104aee[_0xee91('0x5c')]));}else{_0x104aee[_0xee91('0x5a')]='';}return getConnection(_0x137584)[_0xee91('0x2c')](function(_0x370e70){_0x190f7e=_0x370e70;if(!_['isNil'](_0x589c75)){return getUser(_0x137584,_0x589c75['name'],_0x190f7e);}else{return getUser(_0x137584,null,_0x190f7e);}})[_0xee91('0x2c')](function(_0x2d6ddc){_0x30d55f=_0x2d6ddc;logger[_0xee91('0xe')]('The\x20User\x20ID\x20is:',_0x30d55f['id']);return getEndUser(_0x137584,_0x104aee['calleridname'],_0x104aee['calleridnum'],_0x190f7e);})[_0xee91('0x2c')](function(_0x5b3c7d){_0xaae519=_0x5b3c7d;logger['info'](_0xee91('0x5f'),_0xaae519['id']);return getTicket(_0x137584,_0x30d55f,_0xaae519,_0x1a251f,_0x104aee,_0x1a251f[_0xee91('0x6d')],_0x190f7e,_0xee91('0x76'));})[_0xee91('0x2c')](function(_0x55e9ca){_0x7f1151=_0x55e9ca;logger[_0xee91('0xe')]('Ticket\x20created!');logger[_0xee91('0xe')](_0xee91('0x77'),_0x7f1151['id']);return setRelationship(_0x190f7e,_0x30d55f,_0x7f1151,_0xee91('0x6f'));})['then'](function(){return setRelationship(_0x190f7e,_0xaae519,_0x7f1151,_0xee91('0x61'));})[_0xee91('0x2c')](function(){return getServerInfo(_0x190f7e);})[_0xee91('0x71')](function(_0x301bd1){logger[_0xee91('0x72')]('['+_0x104aee[_0xee91('0x74')]['toUpperCase']()+']',JSON[_0xee91('0x27')](_0x301bd1));});}; \ 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 6356886..9d3db80 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 _0x0814=['format','%s:\x20%s','key','keyContent','join','slice','lastIndexOf','validateEmail','isNil','test','util','type','push','content','variable','variableName','toString','customVariable','Variable','toLowerCase','name','keyValue','keyType','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0814,0xfa));var _0x4081=function(_0x2e2d03,_0x568948){_0x2e2d03=_0x2e2d03-0x0;var _0x5d1738=_0x0814[_0x2e2d03];return _0x5d1738;};'use strict';var _=require('lodash');var util=require(_0x4081('0x0'));exports['getString']=function(_0x619b8b,_0x5c0c42,_0x34c251){var _0x429326=[];if(_0x619b8b['length']>0x0){var _0x4daaab=_['sortBy'](_0x619b8b,['id']);for(var _0x11625c=0x0;_0x11625c<_0x4daaab['length'];_0x11625c++){var _0x574a6e=_0x4daaab[_0x11625c];if(_0x574a6e[_0x4081('0x1')]==='string'){_0x429326[_0x4081('0x2')](_0x574a6e[_0x4081('0x3')]);}else if(_0x574a6e['type']===_0x4081('0x4')&&_0x574a6e[_0x4081('0x5')]){_0x5c0c42[_0x574a6e[_0x4081('0x5')]]&&_0x429326[_0x4081('0x2')](_0x5c0c42[_0x574a6e[_0x4081('0x5')]][_0x4081('0x6')]());}else if(_0x574a6e['type']===_0x4081('0x7')&&_0x574a6e[_0x4081('0x8')]&&_0x574a6e['Variable']['name']){_0x5c0c42[_0x574a6e[_0x4081('0x8')]['name'][_0x4081('0x9')]()]&&_0x429326[_0x4081('0x2')](_0x5c0c42[_0x574a6e['Variable'][_0x4081('0xa')][_0x4081('0x9')]()]['toString']());}else if(_0x574a6e[_0x4081('0x1')]===_0x4081('0xb')){if(_0x574a6e[_0x4081('0xc')]===_0x4081('0xd')&&_0x574a6e['key']){_0x429326[_0x4081('0x2')](util[_0x4081('0xe')](_0x4081('0xf'),_0x574a6e[_0x4081('0x10')],_0x574a6e[_0x4081('0x11')]));}else if(_0x574a6e[_0x4081('0xc')]==='variable'&&_0x574a6e[_0x4081('0x5')]&&_0x574a6e[_0x4081('0x10')]){_0x5c0c42[_0x574a6e['variableName']]&&_0x429326[_0x4081('0x2')](util[_0x4081('0xe')](_0x4081('0xf'),_0x574a6e[_0x4081('0x10')],_0x5c0c42[_0x574a6e[_0x4081('0x5')]]));}else if(_0x574a6e['keyType']==='customVariable'&&_0x574a6e[_0x4081('0x8')]&&_0x574a6e['Variable'][_0x4081('0xa')]&&_0x574a6e[_0x4081('0x10')]){_0x5c0c42[_0x574a6e[_0x4081('0x8')]['name'][_0x4081('0x9')]()]&&_0x429326[_0x4081('0x2')](util[_0x4081('0xe')](_0x4081('0xf'),_0x574a6e[_0x4081('0x10')],_0x5c0c42[_0x574a6e[_0x4081('0x8')][_0x4081('0xa')][_0x4081('0x9')]()]));}}}}return _0x429326[_0x4081('0x12')](_0x34c251);};exports['stripTrailingSlash']=function(_0x5d91e2){var _0x1bb310=_0x5d91e2[_0x4081('0x13')](-0x1);if(_0x1bb310==='/'){_0x5d91e2=_0x5d91e2['substring'](0x0,_0x5d91e2[_0x4081('0x14')](_0x1bb310));}return _0x5d91e2;};exports[_0x4081('0x15')]=function(_0x193134){if(!_[_0x4081('0x16')](_0x193134)&&_0x193134!==''){var _0x3ae20d=/^(([^<>()\[\]\\.,;:\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 _0x3ae20d[_0x4081('0x17')](String(_0x193134)[_0x4081('0x9')]());}else{return![];}}; \ No newline at end of file +var _0xceff=['format','%s:\x20%s','keyContent','join','slice','lastIndexOf','isNil','test','lodash','sortBy','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key'];(function(_0x135573,_0x479526){var _0x13ea56=function(_0x49c990){while(--_0x49c990){_0x135573['push'](_0x135573['shift']());}};_0x13ea56(++_0x479526);}(_0xceff,0x1b1));var _0xfcef=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xceff[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xfcef('0x0'));var util=require('util');exports['getString']=function(_0x62f707,_0x16a01b,_0x5afbcd){var _0x94838c=[];if(_0x62f707['length']>0x0){var _0x80e2dd=_[_0xfcef('0x1')](_0x62f707,['id']);for(var _0x457792=0x0;_0x457792<_0x80e2dd[_0xfcef('0x2')];_0x457792++){var _0xc8335c=_0x80e2dd[_0x457792];if(_0xc8335c[_0xfcef('0x3')]===_0xfcef('0x4')){_0x94838c[_0xfcef('0x5')](_0xc8335c[_0xfcef('0x6')]);}else if(_0xc8335c['type']===_0xfcef('0x7')&&_0xc8335c[_0xfcef('0x8')]){_0x16a01b[_0xc8335c[_0xfcef('0x8')]]&&_0x94838c[_0xfcef('0x5')](_0x16a01b[_0xc8335c[_0xfcef('0x8')]][_0xfcef('0x9')]());}else if(_0xc8335c[_0xfcef('0x3')]===_0xfcef('0xa')&&_0xc8335c['Variable']&&_0xc8335c['Variable']['name']){_0x16a01b[_0xc8335c[_0xfcef('0xb')][_0xfcef('0xc')][_0xfcef('0xd')]()]&&_0x94838c[_0xfcef('0x5')](_0x16a01b[_0xc8335c[_0xfcef('0xb')][_0xfcef('0xc')][_0xfcef('0xd')]()][_0xfcef('0x9')]());}else if(_0xc8335c['type']===_0xfcef('0xe')){if(_0xc8335c[_0xfcef('0xf')]===_0xfcef('0x4')&&_0xc8335c[_0xfcef('0x10')]){_0x94838c[_0xfcef('0x5')](util[_0xfcef('0x11')](_0xfcef('0x12'),_0xc8335c[_0xfcef('0x10')],_0xc8335c[_0xfcef('0x13')]));}else if(_0xc8335c[_0xfcef('0xf')]===_0xfcef('0x7')&&_0xc8335c[_0xfcef('0x8')]&&_0xc8335c[_0xfcef('0x10')]){_0x16a01b[_0xc8335c[_0xfcef('0x8')]]&&_0x94838c[_0xfcef('0x5')](util[_0xfcef('0x11')]('%s:\x20%s',_0xc8335c[_0xfcef('0x10')],_0x16a01b[_0xc8335c['variableName']]));}else if(_0xc8335c[_0xfcef('0xf')]===_0xfcef('0xa')&&_0xc8335c[_0xfcef('0xb')]&&_0xc8335c[_0xfcef('0xb')][_0xfcef('0xc')]&&_0xc8335c[_0xfcef('0x10')]){_0x16a01b[_0xc8335c['Variable'][_0xfcef('0xc')][_0xfcef('0xd')]()]&&_0x94838c[_0xfcef('0x5')](util[_0xfcef('0x11')](_0xfcef('0x12'),_0xc8335c[_0xfcef('0x10')],_0x16a01b[_0xc8335c['Variable']['name'][_0xfcef('0xd')]()]));}}}}return _0x94838c[_0xfcef('0x14')](_0x5afbcd);};exports['stripTrailingSlash']=function(_0x7fa49e){var _0x5bf252=_0x7fa49e[_0xfcef('0x15')](-0x1);if(_0x5bf252==='/'){_0x7fa49e=_0x7fa49e['substring'](0x0,_0x7fa49e[_0xfcef('0x16')](_0x5bf252));}return _0x7fa49e;};exports['validateEmail']=function(_0x1261a1){if(!_[_0xfcef('0x17')](_0x1261a1)&&_0x1261a1!==''){var _0xbf96ee=/^(([^<>()\[\]\\.,;:\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 _0xbf96ee[_0xfcef('0x18')](String(_0x1261a1)[_0xfcef('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 3abf2a5..01a3520 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(_0x28630c,_0xfc9816){var _0x464065=function(_0x4edf30){while(--_0x4edf30){_0x28630c['push'](_0x28630c['shift']());}};_0x464065(++_0xfc9816);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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(_0x5b4ff7,_0x3adf3d){var _0x1d50f=function(_0x59b009){while(--_0x59b009){_0x5b4ff7['push'](_0x5b4ff7['shift']());}};_0x1d50f(++_0x3adf3d);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'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 4e859ee..0dd83e2 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 _0xa2a1=['../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','format','%s/tickets.json','POST','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','authType','username','token','Basic\x20%s','toString','base64','[HTTP]','GET','forEach','string','picklist','type','customField','nameField','toLowerCase','includes','custom_fields','idField','variable','variableName','push','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','lastevent','toUpperCase','calleridname','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util'];(function(_0x5b372b,_0x5f12d5){var _0x13d107=function(_0xc3e356){while(--_0xc3e356){_0x5b372b['push'](_0x5b372b['shift']());}};_0x13d107(++_0x5f12d5);}(_0xa2a1,0x144));var _0x1a2a=function(_0x4d9030,_0x580c89){_0x4d9030=_0x4d9030-0x0;var _0xb5e4b7=_0xa2a1[_0x4d9030];return _0xb5e4b7;};'use strict';var _=require(_0x1a2a('0x0'));var rp=require(_0x1a2a('0x1'));var md5=require(_0x1a2a('0x2'));var util=require(_0x1a2a('0x3'));var Redis=require(_0x1a2a('0x4'));var intUtil=require(_0x1a2a('0x5'));var config=require(_0x1a2a('0x6'));var logger=require('../../../../config/logger')(_0x1a2a('0x7'));config[_0x1a2a('0x8')]=_[_0x1a2a('0x9')](config['redis'],{'host':_0x1a2a('0xa'),'port':0x18eb});var io=require(_0x1a2a('0xb'))(new Redis(config[_0x1a2a('0x8')]));function emit(_0x2f4bb4,_0x3b4ed4,_0x49219a){io['to'](_0x2f4bb4)['emit'](_0x3b4ed4,_0x49219a);}var headers={'Content-Type':_0x1a2a('0xc'),'Accept':'application/json'};function getTicket(_0x4c7456,_0x3387c6,_0x2ae497,_0x44e826,_0x32b1ee){logger[_0x1a2a('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0xf'),_0x4c7456['remoteUri']),'method':_0x1a2a('0x10'),'body':{'ticket':_[_0x1a2a('0x11')]({'requester_id':_0x2ae497['id'],'submitter_id':_0x3387c6?_0x3387c6['id']:undefined,'assignee_id':_0x3387c6?_0x3387c6['id']:undefined,'tags':getTags(_0x44e826[_0x1a2a('0x12')],'name'),'subject':intUtil[_0x1a2a('0x13')](_0x44e826['Subjects'],_0x32b1ee,'\x20'),'description':intUtil[_0x1a2a('0x13')](_0x44e826[_0x1a2a('0x14')],_0x32b1ee,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1a2a('0x13')](_0x44e826[_0x1a2a('0x14')],_0x32b1ee,'\x0a')}},getCustomFields(_0x44e826[_0x1a2a('0x15')],_0x32b1ee))}})[_0x1a2a('0x16')](function(_0x980a84){logger['info'](_0x1a2a('0x17'));return _0x980a84[_0x1a2a('0x18')];});}function getUser(_0x34597a,_0x2c48b4){if(intUtil[_0x1a2a('0x19')](_0x2c48b4)){logger['info'](_0x1a2a('0x1a'),_0x2c48b4);return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x1b'),_0x34597a[_0x1a2a('0x1c')]),'qs':{'query':util[_0x1a2a('0xe')](_0x1a2a('0x1d'),_0x2c48b4)}})[_0x1a2a('0x16')](function(_0x5d4adb){if(_0x5d4adb[_0x1a2a('0x1e')]){logger[_0x1a2a('0xd')](_0x1a2a('0x1f'));return _[_0x1a2a('0x20')](_0x5d4adb[_0x1a2a('0x21')],{'email':_0x2c48b4,'role':'agent'});}else{logger[_0x1a2a('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x22'),_0x34597a[_0x1a2a('0x1c')])})['then'](function(_0x165581){logger['info'](_0x1a2a('0x23'));return _0x165581[_0x1a2a('0x24')];});}});}else{logger['info'](_0x1a2a('0x25'));return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x22'),_0x34597a[_0x1a2a('0x1c')])})[_0x1a2a('0x16')](function(_0x3fb333){logger[_0x1a2a('0xd')](_0x1a2a('0x23'));return _0x3fb333[_0x1a2a('0x24')];});}}function getEndUser(_0x57fb3d,_0x4a7d86,_0x154b7c){logger[_0x1a2a('0xd')]('Searching\x20enduser\x20with\x20phone',_0x154b7c);return request({'uri':util[_0x1a2a('0xe')]('%s/search.json',_0x57fb3d[_0x1a2a('0x1c')]),'qs':{'query':util[_0x1a2a('0xe')](_0x1a2a('0x26'),_0x154b7c)}})[_0x1a2a('0x16')](function(_0x17f735){var _0x269691;if(_0x17f735[_0x1a2a('0x21')][_0x1a2a('0x27')]){_0x17f735['results']=_[_0x1a2a('0x28')](_0x17f735[_0x1a2a('0x21')],{'suspended':![],'role':_0x1a2a('0x29')});if(_0x17f735[_0x1a2a('0x21')]['length']){_0x269691=_['first'](_0x17f735[_0x1a2a('0x21')]);}}if(_0x269691){logger[_0x1a2a('0xd')](_0x1a2a('0x2a'));return _0x269691;}else{logger[_0x1a2a('0xd')](_0x1a2a('0x2b'));return request({'uri':util[_0x1a2a('0xe')]('%s/users.json',_0x57fb3d['remoteUri']),'method':_0x1a2a('0x10'),'body':{'user':{'role':_0x1a2a('0x29'),'name':util[_0x1a2a('0xe')](_0x1a2a('0x2c'),_0x4a7d86||_0x154b7c),'phone':_0x154b7c}}})[_0x1a2a('0x16')](function(_0x3d586f){logger[_0x1a2a('0xd')](_0x1a2a('0x2d'));return _0x3d586f[_0x1a2a('0x24')];});}});}function getAuth(_0x13c79e){var _0x56f80d;if(_0x13c79e['authType']===_0x1a2a('0x2e')){_0x56f80d=util[_0x1a2a('0xe')](_0x1a2a('0x2f'),_0x13c79e['username'],_0x13c79e[_0x1a2a('0x2e')]);}else if(_0x13c79e[_0x1a2a('0x30')]==='token'){_0x56f80d=util[_0x1a2a('0xe')]('%s/token:%s',_0x13c79e[_0x1a2a('0x31')],_0x13c79e[_0x1a2a('0x32')]);}return util[_0x1a2a('0xe')](_0x1a2a('0x33'),new Buffer(_0x56f80d)[_0x1a2a('0x34')](_0x1a2a('0x35')));}function request(_0x265e7b){logger['debug'](_0x1a2a('0x36'),JSON['stringify'](_0x265e7b));return rp(_[_0x1a2a('0x9')](_0x265e7b,{'method':_0x1a2a('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x5b0cad,_0x221b00){var _0xcb2a7f=[];if(_0x5b0cad&&_0x5b0cad[_0x1a2a('0x27')]>0x0){_0xcb2a7f=_['map'](_0x5b0cad,_0x221b00);}return _0xcb2a7f;}function getCustomFields(_0x2f0056,_0x18056e){var _0x330f6f=[];var _0x1622c9={'custom_fields':[]};if(_0x2f0056[_0x1a2a('0x27')]>0x0){_[_0x1a2a('0x38')](_0x2f0056,function(_0x4c8305){if(_['includes']([_0x1a2a('0x39'),_0x1a2a('0x3a')],_0x4c8305[_0x1a2a('0x3b')])&&_0x4c8305['nameField']&&!_0x4c8305[_0x1a2a('0x3c')]){_0x1622c9[_0x4c8305[_0x1a2a('0x3d')][_0x1a2a('0x3e')]()]=_0x4c8305['content']['toString']();}else if(_[_0x1a2a('0x3f')]([_0x1a2a('0x39'),_0x1a2a('0x3a')],_0x4c8305['type'])&&_0x4c8305['idField']&&_0x4c8305['customField']){_0x1622c9[_0x1a2a('0x40')]['push']({'id':_0x4c8305[_0x1a2a('0x41')],'value':_0x4c8305['content'][_0x1a2a('0x34')]()});}else if(_0x4c8305[_0x1a2a('0x3b')]===_0x1a2a('0x42')&&_0x4c8305[_0x1a2a('0x43')]&&_0x4c8305[_0x1a2a('0x41')]&&_0x4c8305[_0x1a2a('0x3c')]){_0x18056e[_0x4c8305[_0x1a2a('0x43')]]&&_0x1622c9[_0x1a2a('0x40')][_0x1a2a('0x44')]({'id':_0x4c8305[_0x1a2a('0x41')],'value':_0x18056e[_0x4c8305['variableName']]['toString']()});}else if(_0x4c8305[_0x1a2a('0x3b')]==='customVariable'&&_0x4c8305['Variable']&&_0x4c8305[_0x1a2a('0x45')][_0x1a2a('0x46')]&&_0x4c8305[_0x1a2a('0x41')]&&_0x4c8305[_0x1a2a('0x3c')]){_0x18056e[_0x4c8305['Variable'][_0x1a2a('0x46')][_0x1a2a('0x3e')]()]&&_0x1622c9[_0x1a2a('0x40')][_0x1a2a('0x44')]({'id':_0x4c8305[_0x1a2a('0x41')],'value':_0x18056e[_0x4c8305[_0x1a2a('0x45')][_0x1a2a('0x46')][_0x1a2a('0x3e')]()][_0x1a2a('0x34')]()});}});}return _0x1622c9;}exports[_0x1a2a('0x47')]=function(_0x587499,_0x16c859,_0x3a3eef,_0x5cc74c,_0x598790,_0x245295){var _0x3fa607,_0x1e5a0f;_0x245295[_0x1a2a('0x1c')]=intUtil[_0x1a2a('0x48')](_0x245295[_0x1a2a('0x1c')]);_0x245295[_0x1a2a('0x49')]=intUtil['stripTrailingSlash'](_0x245295[_0x1a2a('0x49')]);if(_0x598790&&_0x598790[_0x1a2a('0x4a')]){logger['info'](_0x1a2a('0x4b'),_0x1a2a('0x4c'));_0x16c859['recordingURL']=util[_0x1a2a('0xe')](_0x1a2a('0x4d'),_0x245295[_0x1a2a('0x49')],_0x16c859[_0x1a2a('0x4e')],md5(_0x16c859[_0x1a2a('0x4e')]));}else{_0x16c859['recordingURL']='';}headers[_0x1a2a('0x4f')]=getAuth(_0x245295);return getUser(_0x245295,_0x5cc74c[_0x1a2a('0x50')])['then'](function(_0x15653f){_0x3fa607=_0x15653f;logger[_0x1a2a('0xd')](_0x1a2a('0x51'),_0x3fa607['id']);return getEndUser(_0x245295,_0x16c859['calleridname'],_0x16c859['calleridnum']);})[_0x1a2a('0x16')](function(_0x347360){_0x1e5a0f=_0x347360;logger['info'](_0x1a2a('0x52'),_0x1e5a0f['id']);return getTicket(_0x245295,_0x3fa607,_0x1e5a0f,_0x3a3eef,_0x16c859);})[_0x1a2a('0x16')](function(_0x21ba54){if(_0x21ba54){logger[_0x1a2a('0xd')](_0x1a2a('0x53'),_0x21ba54['id']);switch(_0x245295[_0x1a2a('0x3b')]){case _0x1a2a('0x54'):logger[_0x1a2a('0xd')](_0x1a2a('0x4b'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x55'),_0x245295[_0x1a2a('0x1c')],_0x3fa607['id'],_0x21ba54['id']),'method':'POST'});case _0x1a2a('0x56'):logger[_0x1a2a('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x1a2a('0x57'),_0x5cc74c[_0x1a2a('0x46')]),_0x1a2a('0x58'),{'uri':util[_0x1a2a('0xe')]('%s/agent/tickets/%s',_0x245295['remoteUri']['replace'](_0x1a2a('0x59'),''),_0x21ba54['id'])});break;default:logger[_0x1a2a('0x5a')](_0x1a2a('0x4b'),_0x1a2a('0x5b'));}}})[_0x1a2a('0x5c')](function(_0x45e66b){logger[_0x1a2a('0x5a')](_0x1a2a('0x5d'),util['inspect'](_0x45e66b,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x19a219,_0x118176,_0x2e8304,_0x22afa7,_0x3f60d3,_0x12574b,_0x4e11a2){var _0x1e8dd5,_0x4ae8b6;_0x12574b['remoteUri']=intUtil[_0x1a2a('0x48')](_0x12574b[_0x1a2a('0x1c')]);_0x12574b[_0x1a2a('0x49')]=intUtil['stripTrailingSlash'](_0x12574b[_0x1a2a('0x49')]);if(_0x4e11a2&&_0x4e11a2[_0x1a2a('0x5e')]&&_0x4e11a2['recordingFormat']!==_0x1a2a('0x5f')){logger[_0x1a2a('0xd')](_0x1a2a('0x60'),'Recording\x20is\x20enabled!');_0x118176[_0x1a2a('0x61')]=util[_0x1a2a('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12574b[_0x1a2a('0x49')],_0x118176[_0x1a2a('0x4e')],md5(_0x118176[_0x1a2a('0x4e')]));}headers['Authorization']=getAuth(_0x12574b);return getUser(_0x12574b,_0x22afa7[_0x1a2a('0x50')])[_0x1a2a('0x16')](function(_0x1e0c14){_0x1e8dd5=_0x1e0c14;logger[_0x1a2a('0xd')]('The\x20User\x20ID\x20is:',_0x1e8dd5['id']);return getEndUser(_0x12574b,_0x118176[_0x1a2a('0x62')],_0x118176[_0x1a2a('0x63')]);})[_0x1a2a('0x16')](function(_0x35444d){_0x4ae8b6=_0x35444d;logger[_0x1a2a('0xd')](_0x1a2a('0x52'),_0x4ae8b6['id']);return getTicket(_0x12574b,_0x1e8dd5,_0x4ae8b6,_0x2e8304,_0x118176);})[_0x1a2a('0x16')](function(_0xa64a8b){if(_0xa64a8b){logger['info'](_0x1a2a('0x53'),_0xa64a8b['id']);switch(_0x12574b[_0x1a2a('0x3b')]){case _0x1a2a('0x54'):logger[_0x1a2a('0xd')]('[OUTBOUND]',_0x1a2a('0x64'));return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x55'),_0x12574b['remoteUri'],_0x1e8dd5['id'],_0xa64a8b['id']),'method':_0x1a2a('0x10')});case'newTab':logger[_0x1a2a('0xd')](_0x1a2a('0x60'),_0x1a2a('0x65'));emit(util[_0x1a2a('0xe')](_0x1a2a('0x57'),_0x22afa7[_0x1a2a('0x46')]),_0x1a2a('0x58'),{'uri':util[_0x1a2a('0xe')](_0x1a2a('0x66'),_0x12574b['remoteUri']['replace']('/api/v2',''),_0xa64a8b['id'])});break;default:logger[_0x1a2a('0x5a')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x5397f1){logger['error'](_0x1a2a('0x67'),util[_0x1a2a('0x68')](_0x5397f1,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x23dd1f,_0x13db07,_0x42dd4d,_0x3e07c2,_0x38152d,_0xb0ff2c){var _0xb66d1f,_0x4bb8ce;_0xb0ff2c[_0x1a2a('0x1c')]=intUtil['stripTrailingSlash'](_0xb0ff2c['remoteUri']);_0xb0ff2c[_0x1a2a('0x49')]=intUtil['stripTrailingSlash'](_0xb0ff2c[_0x1a2a('0x49')]);if(_0x38152d&&_0x38152d[_0x1a2a('0x4a')]){logger['info']('['+_0x13db07[_0x1a2a('0x69')][_0x1a2a('0x6a')]()+']',_0x1a2a('0x4c'));_0x13db07[_0x1a2a('0x61')]=util[_0x1a2a('0xe')](_0x1a2a('0x4d'),_0xb0ff2c[_0x1a2a('0x49')],_0x13db07['uniqueid'],md5(_0x13db07[_0x1a2a('0x4e')]));}else{_0x13db07[_0x1a2a('0x61')]='';}headers[_0x1a2a('0x4f')]=getAuth(_0xb0ff2c);return getUser(_0xb0ff2c)[_0x1a2a('0x16')](function(_0x15b8c6){_0xb66d1f=_0x15b8c6;logger[_0x1a2a('0xd')]('The\x20User\x20ID\x20is:',_0xb66d1f['id']);return getEndUser(_0xb0ff2c,_0x13db07[_0x1a2a('0x6b')],_0x13db07[_0x1a2a('0x6c')]);})[_0x1a2a('0x16')](function(_0x266209){_0x4bb8ce=_0x266209;logger[_0x1a2a('0xd')](_0x1a2a('0x52'),_0x4bb8ce['id']);return getTicket(_0xb0ff2c,_0xb66d1f,_0x4bb8ce,_0x42dd4d,_0x13db07);})['then'](function(_0x568557){if(_0x568557){logger[_0x1a2a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x568557['id']);}})['catch'](function(_0x3c3241){logger[_0x1a2a('0x5a')]('['+_0x13db07['lastevent'][_0x1a2a('0x6a')]()+']'+_0x1a2a('0x6d'),util[_0x1a2a('0x68')](_0x3c3241,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8582=['Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','map','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','custom_fields','push','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]','%s/agent/tickets/%s','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','name','Subjects','getString','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.'];(function(_0x5412e4,_0x1f4bf7){var _0x8d39e6=function(_0x2997e0){while(--_0x2997e0){_0x5412e4['push'](_0x5412e4['shift']());}};_0x8d39e6(++_0x1f4bf7);}(_0x8582,0x1f0));var _0x2858=function(_0x2af766,_0x622121){_0x2af766=_0x2af766-0x0;var _0x384082=_0x8582[_0x2af766];return _0x384082;};'use strict';var _=require(_0x2858('0x0'));var rp=require(_0x2858('0x1'));var md5=require(_0x2858('0x2'));var util=require(_0x2858('0x3'));var Redis=require(_0x2858('0x4'));var intUtil=require(_0x2858('0x5'));var config=require(_0x2858('0x6'));var logger=require(_0x2858('0x7'))(_0x2858('0x8'));config[_0x2858('0x9')]=_[_0x2858('0xa')](config[_0x2858('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2858('0xb'))(new Redis(config[_0x2858('0x9')]));function emit(_0x39a86a,_0x3d0eb7,_0x26c438){io['to'](_0x39a86a)['emit'](_0x3d0eb7,_0x26c438);}var headers={'Content-Type':_0x2858('0xc'),'Accept':'application/json'};function getTicket(_0x31bb41,_0x2bc18e,_0x1a273a,_0x45f430,_0x20a398){logger[_0x2858('0xd')](_0x2858('0xe'));return request({'uri':util[_0x2858('0xf')](_0x2858('0x10'),_0x31bb41[_0x2858('0x11')]),'method':'POST','body':{'ticket':_[_0x2858('0x12')]({'requester_id':_0x1a273a['id'],'submitter_id':_0x2bc18e?_0x2bc18e['id']:undefined,'assignee_id':_0x2bc18e?_0x2bc18e['id']:undefined,'tags':getTags(_0x45f430['Tags'],_0x2858('0x13')),'subject':intUtil['getString'](_0x45f430[_0x2858('0x14')],_0x20a398,'\x20'),'description':intUtil[_0x2858('0x15')](_0x45f430['Descriptions'],_0x20a398,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2858('0x15')](_0x45f430['Descriptions'],_0x20a398,'\x0a')}},getCustomFields(_0x45f430[_0x2858('0x16')],_0x20a398))}})[_0x2858('0x17')](function(_0x5c08dd){logger['info'](_0x2858('0x18'));return _0x5c08dd[_0x2858('0x19')];});}function getUser(_0x3c1141,_0x16bf72){if(intUtil['validateEmail'](_0x16bf72)){logger[_0x2858('0xd')](_0x2858('0x1a'),_0x16bf72);return request({'uri':util[_0x2858('0xf')]('%s/search.json',_0x3c1141['remoteUri']),'qs':{'query':util[_0x2858('0xf')](_0x2858('0x1b'),_0x16bf72)}})[_0x2858('0x17')](function(_0x2bd417){if(_0x2bd417['count']){logger[_0x2858('0xd')]('Agent\x20found!');return _[_0x2858('0x1c')](_0x2bd417[_0x2858('0x1d')],{'email':_0x16bf72,'role':'agent'});}else{logger[_0x2858('0xd')](_0x2858('0x1e'));return request({'uri':util[_0x2858('0xf')](_0x2858('0x1f'),_0x3c1141[_0x2858('0x11')])})['then'](function(_0x382a8f){logger[_0x2858('0xd')]('Admin\x20account\x20selected.');return _0x382a8f[_0x2858('0x20')];});}});}else{logger[_0x2858('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x2858('0x1f'),_0x3c1141[_0x2858('0x11')])})[_0x2858('0x17')](function(_0x2a1666){logger[_0x2858('0xd')](_0x2858('0x21'));return _0x2a1666['user'];});}}function getEndUser(_0x5832cf,_0x5277a3,_0x499923){logger[_0x2858('0xd')](_0x2858('0x22'),_0x499923);return request({'uri':util[_0x2858('0xf')](_0x2858('0x23'),_0x5832cf[_0x2858('0x11')]),'qs':{'query':util[_0x2858('0xf')](_0x2858('0x24'),_0x499923)}})['then'](function(_0x5012c9){var _0x2d4ab5;if(_0x5012c9['results'][_0x2858('0x25')]){_0x5012c9[_0x2858('0x1d')]=_[_0x2858('0x26')](_0x5012c9[_0x2858('0x1d')],{'suspended':![],'role':_0x2858('0x27')});if(_0x5012c9[_0x2858('0x1d')][_0x2858('0x25')]){_0x2d4ab5=_['first'](_0x5012c9['results']);}}if(_0x2d4ab5){logger['info'](_0x2858('0x28'));return _0x2d4ab5;}else{logger[_0x2858('0xd')](_0x2858('0x29'));return request({'uri':util['format']('%s/users.json',_0x5832cf['remoteUri']),'method':_0x2858('0x2a'),'body':{'user':{'role':'end-user','name':util['format'](_0x2858('0x2b'),_0x5277a3||_0x499923),'phone':_0x499923}}})['then'](function(_0x16ae40){logger[_0x2858('0xd')](_0x2858('0x2c'));return _0x16ae40['user'];});}});}function getAuth(_0x17e9c2){var _0x15225a;if(_0x17e9c2['authType']===_0x2858('0x2d')){_0x15225a=util[_0x2858('0xf')]('%s:%s',_0x17e9c2[_0x2858('0x2e')],_0x17e9c2[_0x2858('0x2d')]);}else if(_0x17e9c2[_0x2858('0x2f')]===_0x2858('0x30')){_0x15225a=util[_0x2858('0xf')](_0x2858('0x31'),_0x17e9c2[_0x2858('0x2e')],_0x17e9c2[_0x2858('0x30')]);}return util[_0x2858('0xf')](_0x2858('0x32'),new Buffer(_0x15225a)[_0x2858('0x33')]('base64'));}function request(_0x5630ea){logger[_0x2858('0x34')](_0x2858('0x35'),JSON['stringify'](_0x5630ea));return rp(_[_0x2858('0xa')](_0x5630ea,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x494646,_0x1bdb7c){var _0x4f4c3e=[];if(_0x494646&&_0x494646[_0x2858('0x25')]>0x0){_0x4f4c3e=_[_0x2858('0x36')](_0x494646,_0x1bdb7c);}return _0x4f4c3e;}function getCustomFields(_0xc9d2f,_0x462b1f){var _0xb648bc=[];var _0x22b80d={'custom_fields':[]};if(_0xc9d2f[_0x2858('0x25')]>0x0){_['forEach'](_0xc9d2f,function(_0x414553){if(_[_0x2858('0x37')]([_0x2858('0x38'),_0x2858('0x39')],_0x414553[_0x2858('0x3a')])&&_0x414553['nameField']&&!_0x414553[_0x2858('0x3b')]){_0x22b80d[_0x414553[_0x2858('0x3c')][_0x2858('0x3d')]()]=_0x414553[_0x2858('0x3e')][_0x2858('0x33')]();}else if(_['includes']([_0x2858('0x38'),_0x2858('0x39')],_0x414553[_0x2858('0x3a')])&&_0x414553[_0x2858('0x3f')]&&_0x414553[_0x2858('0x3b')]){_0x22b80d[_0x2858('0x40')][_0x2858('0x41')]({'id':_0x414553[_0x2858('0x3f')],'value':_0x414553['content'][_0x2858('0x33')]()});}else if(_0x414553[_0x2858('0x3a')]==='variable'&&_0x414553['variableName']&&_0x414553[_0x2858('0x3f')]&&_0x414553['customField']){_0x462b1f[_0x414553[_0x2858('0x42')]]&&_0x22b80d['custom_fields'][_0x2858('0x41')]({'id':_0x414553[_0x2858('0x3f')],'value':_0x462b1f[_0x414553[_0x2858('0x42')]]['toString']()});}else if(_0x414553[_0x2858('0x3a')]==='customVariable'&&_0x414553['Variable']&&_0x414553[_0x2858('0x43')][_0x2858('0x13')]&&_0x414553['idField']&&_0x414553[_0x2858('0x3b')]){_0x462b1f[_0x414553[_0x2858('0x43')][_0x2858('0x13')][_0x2858('0x3d')]()]&&_0x22b80d[_0x2858('0x40')][_0x2858('0x41')]({'id':_0x414553[_0x2858('0x3f')],'value':_0x462b1f[_0x414553['Variable'][_0x2858('0x13')]['toLowerCase']()][_0x2858('0x33')]()});}});}return _0x22b80d;}exports['queue']=function(_0xe353ef,_0x48ad62,_0x210fe5,_0x338fea,_0x295da7,_0x3d660f){var _0x5ba891,_0x541085;_0x3d660f['remoteUri']=intUtil[_0x2858('0x44')](_0x3d660f[_0x2858('0x11')]);_0x3d660f[_0x2858('0x45')]=intUtil[_0x2858('0x44')](_0x3d660f['serverUrl']);if(_0x295da7&&_0x295da7[_0x2858('0x46')]){logger[_0x2858('0xd')](_0x2858('0x47'),_0x2858('0x48'));_0x48ad62[_0x2858('0x49')]=util['format'](_0x2858('0x4a'),_0x3d660f[_0x2858('0x45')],_0x48ad62[_0x2858('0x4b')],md5(_0x48ad62['uniqueid']));}else{_0x48ad62[_0x2858('0x49')]='';}headers[_0x2858('0x4c')]=getAuth(_0x3d660f);return getUser(_0x3d660f,_0x338fea[_0x2858('0x4d')])['then'](function(_0x34f3fd){_0x5ba891=_0x34f3fd;logger[_0x2858('0xd')]('The\x20User\x20ID\x20is:',_0x5ba891['id']);return getEndUser(_0x3d660f,_0x48ad62[_0x2858('0x4e')],_0x48ad62[_0x2858('0x4f')]);})[_0x2858('0x17')](function(_0x112ede){_0x541085=_0x112ede;logger['info'](_0x2858('0x50'),_0x541085['id']);return getTicket(_0x3d660f,_0x5ba891,_0x541085,_0x210fe5,_0x48ad62);})[_0x2858('0x17')](function(_0x1af0b2){if(_0x1af0b2){logger[_0x2858('0xd')](_0x2858('0x51'),_0x1af0b2['id']);switch(_0x3d660f[_0x2858('0x3a')]){case _0x2858('0x52'):logger[_0x2858('0xd')](_0x2858('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3d660f['remoteUri'],_0x5ba891['id'],_0x1af0b2['id']),'method':_0x2858('0x2a')});case _0x2858('0x53'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2858('0x54'),_0x338fea[_0x2858('0x13')]),_0x2858('0x55'),{'uri':util[_0x2858('0xf')]('%s/agent/tickets/%s',_0x3d660f[_0x2858('0x11')][_0x2858('0x56')](_0x2858('0x57'),''),_0x1af0b2['id'])});break;default:logger[_0x2858('0x58')]('[QUEUE]',_0x2858('0x59'));}}})[_0x2858('0x5a')](function(_0x46fee7){logger[_0x2858('0x58')](_0x2858('0x5b'),util[_0x2858('0x5c')](_0x46fee7,{'showHidden':!![],'depth':null}));});};exports[_0x2858('0x5d')]=function(_0x3c9f01,_0x3a337f,_0x4534d0,_0x5b23a9,_0x2960ab,_0x1cc4d3,_0x346cc5){var _0x2e3d84,_0x3dfc72;_0x1cc4d3[_0x2858('0x11')]=intUtil[_0x2858('0x44')](_0x1cc4d3[_0x2858('0x11')]);_0x1cc4d3[_0x2858('0x45')]=intUtil[_0x2858('0x44')](_0x1cc4d3['serverUrl']);if(_0x346cc5&&_0x346cc5[_0x2858('0x5e')]&&_0x346cc5[_0x2858('0x5e')]!==_0x2858('0x5f')){logger[_0x2858('0xd')]('[OUTBOUND]',_0x2858('0x48'));_0x3a337f['recordingURL']=util['format'](_0x2858('0x4a'),_0x1cc4d3[_0x2858('0x45')],_0x3a337f[_0x2858('0x4b')],md5(_0x3a337f[_0x2858('0x4b')]));}headers['Authorization']=getAuth(_0x1cc4d3);return getUser(_0x1cc4d3,_0x5b23a9[_0x2858('0x4d')])[_0x2858('0x17')](function(_0x29ef84){_0x2e3d84=_0x29ef84;logger[_0x2858('0xd')](_0x2858('0x60'),_0x2e3d84['id']);return getEndUser(_0x1cc4d3,_0x3a337f[_0x2858('0x61')],_0x3a337f[_0x2858('0x62')]);})['then'](function(_0x171083){_0x3dfc72=_0x171083;logger[_0x2858('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3dfc72['id']);return getTicket(_0x1cc4d3,_0x2e3d84,_0x3dfc72,_0x4534d0,_0x3a337f);})[_0x2858('0x17')](function(_0x4e3cf2){if(_0x4e3cf2){logger[_0x2858('0xd')](_0x2858('0x51'),_0x4e3cf2['id']);switch(_0x1cc4d3['type']){case _0x2858('0x52'):logger[_0x2858('0xd')]('[OUTBOUND]',_0x2858('0x63'));return request({'uri':util[_0x2858('0xf')](_0x2858('0x64'),_0x1cc4d3['remoteUri'],_0x2e3d84['id'],_0x4e3cf2['id']),'method':'POST'});case _0x2858('0x53'):logger[_0x2858('0xd')](_0x2858('0x65'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2858('0xf')](_0x2858('0x54'),_0x5b23a9[_0x2858('0x13')]),'trigger:browser:url',{'uri':util[_0x2858('0xf')](_0x2858('0x66'),_0x1cc4d3['remoteUri'][_0x2858('0x56')](_0x2858('0x57'),''),_0x4e3cf2['id'])});break;default:logger['error']('[OUTBOUND]',_0x2858('0x59'));}}})[_0x2858('0x5a')](function(_0x1965f5){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x2858('0x5c')](_0x1965f5,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x46be7a,_0x4a07c0,_0x41eb5c,_0x5c7356,_0x16dd41,_0x282333){var _0x1272ec,_0x10b31b;_0x282333[_0x2858('0x11')]=intUtil['stripTrailingSlash'](_0x282333[_0x2858('0x11')]);_0x282333[_0x2858('0x45')]=intUtil[_0x2858('0x44')](_0x282333[_0x2858('0x45')]);if(_0x16dd41&&_0x16dd41[_0x2858('0x46')]){logger[_0x2858('0xd')]('['+_0x4a07c0[_0x2858('0x67')][_0x2858('0x68')]()+']',_0x2858('0x48'));_0x4a07c0['recordingURL']=util['format'](_0x2858('0x4a'),_0x282333[_0x2858('0x45')],_0x4a07c0[_0x2858('0x4b')],md5(_0x4a07c0[_0x2858('0x4b')]));}else{_0x4a07c0[_0x2858('0x49')]='';}headers[_0x2858('0x4c')]=getAuth(_0x282333);return getUser(_0x282333)['then'](function(_0x47a893){_0x1272ec=_0x47a893;logger['info'](_0x2858('0x60'),_0x1272ec['id']);return getEndUser(_0x282333,_0x4a07c0[_0x2858('0x4e')],_0x4a07c0[_0x2858('0x4f')]);})[_0x2858('0x17')](function(_0x162cd5){_0x10b31b=_0x162cd5;logger[_0x2858('0xd')](_0x2858('0x50'),_0x10b31b['id']);return getTicket(_0x282333,_0x1272ec,_0x10b31b,_0x41eb5c,_0x4a07c0);})[_0x2858('0x17')](function(_0xd2e8de){if(_0xd2e8de){logger['info'](_0x2858('0x51'),_0xd2e8de['id']);}})['catch'](function(_0x1c1ff9){logger['error']('['+_0x4a07c0[_0x2858('0x67')][_0x2858('0x68')]()+']'+_0x2858('0x69'),util[_0x2858('0x5c')](_0x1c1ff9,{'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 2f29e3f..c7c7a4e 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 _0x3487=['getString','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','talktime','mm:ss','endtime','utc','diff','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned','Timeout','outbound','starttime','Call_Type','merge','Fields','/crm/v2/Calls','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','com','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','calleridname','Inbound','lodash','request-promise','md5','./util','moment','bluebird','../../../../config/environment','zoho','redis','defaults','socket.io-emitter','[HTTP]','stringify','length','forEach','includes','string','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','email','info','Agent\x20found!','users','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','administrator','first_name','Subject'];(function(_0x5f48bc,_0xb157dd){var _0x12ca6a=function(_0x2d287b){while(--_0x2d287b){_0x5f48bc['push'](_0x5f48bc['shift']());}};_0x12ca6a(++_0xb157dd);}(_0x3487,0xd8));var _0x7348=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x3487[_0x15ec4e];return _0xb5e5dd;};'use strict';var _=require(_0x7348('0x0'));var rp=require(_0x7348('0x1'));var md5=require(_0x7348('0x2'));var util=require('util');var intUtil=require(_0x7348('0x3'));var moment=require(_0x7348('0x4'));var Redis=require('ioredis');var BPromise=require(_0x7348('0x5'));var config=require(_0x7348('0x6'));var logger=require('../../../../config/logger')(_0x7348('0x7'));config[_0x7348('0x8')]=_[_0x7348('0x9')](config[_0x7348('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7348('0xa'))(new Redis(config['redis']));function emit(_0x4ddafb,_0x40e2d1,_0x21a0b6){io['to'](_0x4ddafb)['emit'](_0x40e2d1,_0x21a0b6);}function request(_0x5d1819){logger['debug'](_0x7348('0xb'),JSON[_0x7348('0xc')](_0x5d1819));return rp(_0x5d1819);}function getCustomFields(_0x313788,_0x3904b7){var _0x5cda08={};if(_0x313788[_0x7348('0xd')]>0x0){_[_0x7348('0xe')](_0x313788,function(_0x332de1){if(_[_0x7348('0xf')]([_0x7348('0x10'),'picklist'],_0x332de1[_0x7348('0x11')])&&_0x332de1[_0x7348('0x12')]){_0x5cda08[_0x332de1['idField']]=_0x332de1[_0x7348('0x13')][_0x7348('0x14')]();}else if(_0x332de1['type']===_0x7348('0x15')&&_0x332de1[_0x7348('0x16')]&&_0x332de1[_0x7348('0x12')]&&_0x3904b7[_0x332de1[_0x7348('0x16')]]){_0x5cda08[_0x332de1[_0x7348('0x12')]]=_0x3904b7[_0x332de1['variableName']][_0x7348('0x14')]();}else if(_0x332de1[_0x7348('0x11')]==='customVariable'&&_0x332de1[_0x7348('0x17')]&&_0x332de1[_0x7348('0x17')][_0x7348('0x18')]&&_0x332de1['idField']&&_0x3904b7[_0x332de1[_0x7348('0x17')][_0x7348('0x18')][_0x7348('0x19')]()]){_0x5cda08[_0x332de1[_0x7348('0x12')]]=_0x3904b7[_0x332de1[_0x7348('0x17')][_0x7348('0x18')][_0x7348('0x19')]()][_0x7348('0x14')]();}});}return _0x5cda08;}function getName(_0x259614){if(_0x259614['indexOf']('\x20')>0x0){var _0x595fcc=_0x259614['split'](/ (.+)/);if(_0x595fcc[0x1]){return _0x595fcc;}}return[_0x259614,_0x259614];}var accountsTokens={};function getAccessToken(_0x415178){return new Promise(function(_0x1b3df0,_0x51b248){if(!_[_0x7348('0x1a')](accountsTokens[_0x415178['id']])&&!_[_0x7348('0x1a')](accountsTokens[_0x415178['id']][_0x7348('0x1b')])){if(moment()[_0x7348('0x1c')](accountsTokens[_0x415178['id']]['expires_in'])){_0x1b3df0(accountsTokens[_0x415178['id']][_0x7348('0x1b')]);}}var _0x360c76;switch(_0x415178['zone']){case'US':_0x360c76=_0x7348('0x1d');break;case'AU':_0x360c76=_0x7348('0x1e');break;case'EU':_0x360c76='https://accounts.zoho.eu';break;case'IN':_0x360c76='https://accounts.zoho.in';break;case'CN':_0x360c76=_0x7348('0x1f');break;default:_0x360c76=_0x7348('0x20');break;}var _0x12e6cf={'method':_0x7348('0x21'),'uri':_0x360c76+_0x7348('0x22'),'qs':{'refresh_token':_0x415178[_0x7348('0x23')],'client_id':_0x415178[_0x7348('0x24')],'client_secret':_0x415178['clientSecret'],'grant_type':_0x7348('0x25')},'json':!![]};return rp(_0x12e6cf)[_0x7348('0x26')](function(_0x11213b){accountsTokens[_0x415178['id']]={'access_token':_0x11213b[_0x7348('0x1b')],'expires_in':moment()[_0x7348('0x27')](_0x11213b[_0x7348('0x28')],'seconds')};_0x1b3df0(_0x11213b[_0x7348('0x1b')]);})[_0x7348('0x29')](function(_0x553b51){logger[_0x7348('0x2a')](_0x7348('0x2b'),_0x553b51[_0x7348('0x2c')]);_0x51b248(_0x553b51);});});}function getUser(_0xb8a378,_0x33f614,_0x28352c,_0xd00b44){logger['info'](_0x7348('0x2d'));return request({'method':_0x7348('0x2e'),'uri':util[_0x7348('0x2f')](_0x7348('0x30'),_0x33f614),'qs':{'type':_0x7348('0x31')},'headers':{'Authorization':_0x7348('0x32')+_0xb8a378},'json':!![]})[_0x7348('0x26')](function(_0x37f01e){if(_0x37f01e['users']){var _0x25bc54=-0x1;if(_[_0x7348('0x33')](_0x37f01e['users'])){if(!_['isNil'](_0xd00b44)){_0x25bc54=_[_0x7348('0x34')](_0x37f01e['users'],function(_0x498649){return _0x498649[_0x7348('0x35')]===_0xd00b44;});}if(_0x25bc54>=0x0){logger[_0x7348('0x36')](_0x7348('0x37'));}else{logger[_0x7348('0x36')]('Using\x20the\x20admin\x20account!');_0x25bc54=_[_0x7348('0x34')](_0x37f01e[_0x7348('0x38')],function(_0x41ed87){return _0x41ed87['profile'][_0x7348('0x18')]===_0x7348('0x39');});}return _0x37f01e[_0x7348('0x38')][_0x25bc54];}else{if(_0x37f01e[_0x7348('0x3a')][_0x7348('0x3b')][_0x7348('0x18')]===_0x7348('0x39')){logger[_0x7348('0x36')](_0x7348('0x3c'));user=_0x37f01e['user'];return user;}else{logger[_0x7348('0x2a')](_0x7348('0x3d'),JSON[_0x7348('0xc')](_0x37f01e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x7348('0xc')](_0x37f01e));}}}else{logger[_0x7348('0x2a')](_0x7348('0x3d'),JSON[_0x7348('0xc')](_0x37f01e));throw new Error(_0x7348('0x3e')+JSON[_0x7348('0xc')](_0x37f01e));}})[_0x7348('0x29')](function(_0x3bcffb){console[_0x7348('0x2a')](_0x3bcffb);});}function getZohoUser(_0x16f2c7,_0xfe3675){return new BPromise(function(_0x45e538,_0x5ec487){request(_0x16f2c7)[_0x7348('0x26')](function(_0x202ff1){var _0x1ff962=null;if(_0x202ff1){_0x1ff962=_0x202ff1[_0x7348('0x3f')][0x0];_0x1ff962[_0x7348('0x40')]=_0xfe3675;}_0x45e538(_0x1ff962);})['catch'](function(_0x11304c){_0x5ec487(_0x11304c);});});}function createEndUser(_0x4d5f06,_0x19ab97,_0x371669,_0x1a0b95,_0x175992,_0x4b7539){var _0x371669=getName(_0x371669);return request({'method':_0x7348('0x21'),'uri':_0x7348('0x41')+_0x19ab97+_0x7348('0x42')+_[_0x7348('0x43')](_0x4b7539[_0x7348('0x44')])+'s','body':{'data':[{'Last_Name':_0x371669[0x1],'First_Name':_0x371669[0x0],'Phone':_0x1a0b95,'Owner':{'name':!_[_0x7348('0x1a')](_0x175992[_0x7348('0x45')][_0x7348('0x18')])?_0x175992[_0x7348('0x45')][_0x7348('0x18')]:!_[_0x7348('0x1a')](_0x175992['first_name'])?_0x175992['first_name']+'\x20'+_0x175992[_0x7348('0x46')]:_0x175992[_0x7348('0x46')],'id':_0x175992['id']}}]},'headers':{'Authorization':_0x7348('0x32')+_0x4d5f06},'json':!![]})['then'](function(_0x166ace){if(_0x166ace&&_0x166ace[_0x7348('0x3f')][0x0][_0x7348('0x47')]===_0x7348('0x48')){var _0x6b2cec=_0x166ace[_0x7348('0x3f')][0x0][_0x7348('0x49')];_0x6b2cec['enduserType']=_['startCase'](_0x4b7539['moduleCreate'])+'s';return _0x6b2cec;}logger[_0x7348('0x2a')](_0x7348('0x3d'),JSON[_0x7348('0xc')](data));throw new Error(_0x7348('0x4a')+JSON[_0x7348('0xc')](data));})[_0x7348('0x29')](function(_0x23c72d){console['log'](_0x7348('0x4b'),_0x23c72d);});}function getEndUser(_0x3a8ade,_0x324114,_0x1870e3,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800){var _0xd0a302={'method':_0x7348('0x2e'),'uri':'','headers':{'Authorization':_0x7348('0x32')+_0x3a8ade},'json':!![]};switch(_0x718800[_0x7348('0x4c')]){case'contact_lead':_0xd0a302[_0x7348('0x4d')]=_0x7348('0x41')+_0x324114+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x4e'))[_0x7348('0x26')](function(_0x53563c){if(_0x53563c)return _0x53563c;_0xd0a302[_0x7348('0x4d')]=_0x7348('0x41')+_0x324114+_0x7348('0x4f')+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x50'))['then'](function(_0xa26752){if(_0xa26752)return _0xa26752;if(_0x718800[_0x7348('0x44')]!=_0x7348('0x51')){return createEndUser(_0x3a8ade,_0x324114,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800);}else{return{};}});});break;case _0x7348('0x52'):_0xd0a302[_0x7348('0x4d')]=_0x7348('0x41')+_0x324114+_0x7348('0x53')+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x4e'))['then'](function(_0x505e22){if(_0x505e22)return _0x505e22;if(_0x718800[_0x7348('0x44')]!='nothing'){return createEndUser(_0x3a8ade,_0x324114,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800);}else{return{};}});break;case _0x7348('0x54'):_0xd0a302[_0x7348('0x4d')]='https://www.zohoapis.'+_0x324114+_0x7348('0x4f')+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x50'))[_0x7348('0x26')](function(_0x37c620){if(_0x37c620)return _0x37c620;if(_0x718800[_0x7348('0x44')]!=_0x7348('0x51')){return createEndUser(_0x3a8ade,_0x324114,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800);}else{return{};}});break;}}function getCall(_0x23b065,_0x196a6f,_0x1618a8,_0x46e6a0,_0x1e2ca7,_0x450331,_0x3fde09,_0x45a395){logger[_0x7348('0x36')](_0x7348('0x55'));var _0x24c899={};_0x24c899[_0x7348('0x56')]={'name':!_[_0x7348('0x1a')](_0x46e6a0['role']['name'])&&!_['isNil'](_0x46e6a0[_0x7348('0x3b')][_0x7348('0x18')])&&_0x46e6a0[_0x7348('0x3b')][_0x7348('0x18')]===_0x7348('0x57')?_0x46e6a0['role']['name']:!_['isNil'](_0x46e6a0[_0x7348('0x58')])?_0x46e6a0[_0x7348('0x58')]+'\x20'+_0x46e6a0[_0x7348('0x46')]:_0x46e6a0[_0x7348('0x46')],'id':_0x46e6a0['id']};_0x24c899[_0x7348('0x59')]=intUtil[_0x7348('0x5a')](_0x450331['Subjects'],_0x3fde09,'\x20');_0x24c899[_0x7348('0x5b')]=intUtil['getString'](_0x450331[_0x7348('0x5c')],_0x3fde09,'\x0a');if(_0x1e2ca7[_0x7348('0x40')]===_0x7348('0x4e')){_0x24c899['Who_Id']={'name':!_['isNil'](_0x1e2ca7[_0x7348('0x5d')])?_0x1e2ca7[_0x7348('0x5d')]:!_['isNil'](_0x1e2ca7[_0x7348('0x5e')])?_0x1e2ca7['First_Name']+'\x20'+_0x1e2ca7[_0x7348('0x5f')]:_0x1e2ca7['Last_Name'],'id':_0x1e2ca7['id']};}if(_0x1e2ca7[_0x7348('0x40')]===_0x7348('0x50')){_0x24c899[_0x7348('0x60')]={'name':!_[_0x7348('0x1a')](_0x1e2ca7[_0x7348('0x5d')])?_0x1e2ca7[_0x7348('0x5d')]:!_['isNil'](_0x1e2ca7['First_Name'])?_0x1e2ca7[_0x7348('0x5e')]+'\x20'+_0x1e2ca7['Last_Name']:_0x1e2ca7[_0x7348('0x5f')],'id':_0x1e2ca7['id']};_0x24c899[_0x7348('0x61')]=_[_0x7348('0x43')](_0x1e2ca7[_0x7348('0x40')]);}if(_0x3fde09['talktime']){_0x24c899[_0x7348('0x62')]=moment['utc'](parseInt(_0x3fde09[_0x7348('0x63')])*0x3e8)['format'](_0x7348('0x64'));}else if(_0x3fde09['answertime']&&_0x3fde09[_0x7348('0x65')]){_0x24c899[_0x7348('0x62')]=moment[_0x7348('0x66')](moment(_0x3fde09[_0x7348('0x65')],'YYYY-MM-DDTHH:mm:ss')[_0x7348('0x67')](moment(_0x3fde09['starttime'],_0x7348('0x68'))))[_0x7348('0x2f')](_0x7348('0x64'));}switch(_0x3fde09[_0x7348('0x69')]){case'called':_0x24c899[_0x7348('0x6a')]=_0x7348('0x6b');break;case _0x7348('0x6c'):case'connect':_0x24c899[_0x7348('0x6a')]=_0x7348('0x6d');break;case _0x7348('0x6e'):_0x24c899[_0x7348('0x6a')]='Rejected';break;case _0x7348('0x6f'):_0x24c899['Call_Result']=_0x7348('0x70');break;case'timeout':_0x24c899[_0x7348('0x6a')]=_0x7348('0x71');default:}_0x24c899['Call_Start_Time']=(_0x45a395===_0x7348('0x72')?moment(_0x3fde09[_0x7348('0x73')])[_0x7348('0x2f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x3fde09['agentcalledAt'])[_0x7348('0x2f')](_0x7348('0x68')))||moment()[_0x7348('0x2f')](_0x7348('0x68'));_0x24c899[_0x7348('0x74')]=_0x45a395||'Inbound';_0x24c899=_[_0x7348('0x75')](_0x24c899,getCustomFields(_0x450331[_0x7348('0x76')],_0x3fde09));return request({'method':_0x7348('0x21'),'uri':_0x7348('0x41')+_0x196a6f+_0x7348('0x77'),'headers':{'Authorization':_0x7348('0x32')+_0x23b065},'body':{'data':[_0x24c899]},'json':!![]})[_0x7348('0x26')](function(_0x452f04){if(_0x452f04&&_0x452f04[_0x7348('0x3f')][0x0][_0x7348('0x47')]===_0x7348('0x48')){logger[_0x7348('0x36')]('Call\x20created!');return{'id':_0x452f04[_0x7348('0x3f')][0x0][_0x7348('0x49')]['id']};}})['catch'](function(_0xd10b14){logger['info'](_0x7348('0x78'),_0xd10b14['stack']);console[_0x7348('0x79')](_0x7348('0x78'),_0xd10b14);});}exports[_0x7348('0x7a')]=function(_0x21284f,_0x281ff7,_0x1551bc,_0x3ebc79,_0x1160dd,_0x41708d){var _0x411adb,_0x2e41a7,_0xc02298;_0x41708d[_0x7348('0x7b')]=intUtil[_0x7348('0x7c')](_0x41708d['host']);_0x41708d[_0x7348('0x7d')]=intUtil[_0x7348('0x7c')](_0x41708d[_0x7348('0x7d')]);if(_0x1160dd&&_0x1160dd[_0x7348('0x7e')]){logger['info'](_0x7348('0x7f'),_0x7348('0x80'));_0x281ff7[_0x7348('0x81')]=_0x41708d[_0x7348('0x7d')]+_0x7348('0x82')+_0x281ff7['uniqueid']+_0x7348('0x83')+md5(_0x281ff7['uniqueid']);}else{_0x281ff7[_0x7348('0x81')]='';}var _0x2b3ced=_0x41708d[_0x7348('0x7b')]==='zoho.eu'?'eu':_0x7348('0x84');return getAccessToken(_0x41708d)[_0x7348('0x26')](function(_0x432491){_0xc02298=_0x432491;return getUser(_0xc02298,_0x2b3ced,_0x41708d,_0x3ebc79[_0x7348('0x35')]);})[_0x7348('0x26')](function(_0x46e60a){_0x411adb=_0x46e60a;logger[_0x7348('0x36')]('The\x20User\x20ID\x20is:',_0x411adb['id']);return getEndUser(_0xc02298,_0x2b3ced,_0x41708d,_0x281ff7['calleridname'],_0x281ff7[_0x7348('0x85')],_0x411adb,_0x1551bc);})[_0x7348('0x26')](function(_0x3cc907){_0x2e41a7=_0x3cc907;return getCall(_0xc02298,_0x2b3ced,_0x41708d,_0x411adb,_0x2e41a7,_0x1551bc,_0x281ff7,'Inbound');})['then'](function(_0x7da680){if(_0x7da680){logger['info'](_0x7348('0x86'),_0x7da680['id']);logger[_0x7348('0x36')](_0x7348('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7348('0x2f')]('user:%s',_0x3ebc79[_0x7348('0x18')]),_0x7348('0x87'),{'uri':_0x7348('0x88')+_0x41708d[_0x7348('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x7da680['id']});}})[_0x7348('0x29')](function(_0x7e1371){logger[_0x7348('0x2a')](_0x7348('0x7f'),JSON[_0x7348('0xc')](_0x7e1371));});};exports[_0x7348('0x72')]=function(_0x3c2518,_0x371288,_0x19cd50,_0x2525f5,_0xd29def,_0x45d568,_0x2a4e12){var _0x4e9f1b,_0xf7aad9,_0x5a334a;_0x45d568['host']=intUtil[_0x7348('0x7c')](_0x45d568['host']);_0x45d568['serverUrl']=intUtil[_0x7348('0x7c')](_0x45d568[_0x7348('0x7d')]);if(_0x2a4e12&&_0x2a4e12[_0x7348('0x89')]&&_0x2a4e12[_0x7348('0x89')]!==_0x7348('0x8a')){logger['info'](_0x7348('0x8b'),_0x7348('0x80'));_0x371288['recordingURL']=_0x45d568[_0x7348('0x7d')]+'/api/voice/recordings/'+_0x371288[_0x7348('0x8c')]+_0x7348('0x83')+md5(_0x371288['uniqueid']);}var _0x10b4e7=_0x45d568[_0x7348('0x7b')]===_0x7348('0x8d')?'eu':'com';return getAccessToken(_0x45d568)['then'](function(_0x265eef){_0x5a334a=_0x265eef;return getUser(_0x5a334a,_0x10b4e7,_0x45d568,_0x2525f5[_0x7348('0x35')]);})[_0x7348('0x26')](function(_0x5dd598){_0x4e9f1b=_0x5dd598;logger['info'](_0x7348('0x8e'),_0x4e9f1b['id']);return getEndUser(_0x5a334a,_0x10b4e7,_0x45d568,_0x371288[_0x7348('0x8f')],_0x371288[_0x7348('0x90')],_0x4e9f1b,_0x19cd50);})[_0x7348('0x26')](function(_0x2e7d5b){_0xf7aad9=_0x2e7d5b;return getCall(_0x5a334a,_0x10b4e7,_0x45d568,_0x4e9f1b,_0xf7aad9,_0x19cd50,_0x371288,_0x7348('0x91'));})[_0x7348('0x26')](function(_0x3d3ca0){if(_0x3d3ca0){logger[_0x7348('0x36')]('The\x20Call\x20ID\x20is:',_0x3d3ca0['id']);logger[_0x7348('0x36')]('[OUTBOUND]',_0x7348('0x92'));emit(util[_0x7348('0x2f')](_0x7348('0x93'),_0x2525f5[_0x7348('0x18')]),_0x7348('0x87'),{'uri':_0x7348('0x88')+_0x45d568['host']+_0x7348('0x94')+_0x3d3ca0['id']});}})[_0x7348('0x29')](function(_0x2adb6f){logger[_0x7348('0x2a')](_0x7348('0x8b'),JSON[_0x7348('0xc')](_0x2adb6f));});};exports[_0x7348('0x95')]=function(_0x58d0c0,_0x55376f,_0x3e1f93,_0x1f1255,_0x518fbb,_0x274df2){var _0x1cced5,_0x1c2791,_0x1a368c;_0x274df2['host']=intUtil['stripTrailingSlash'](_0x274df2[_0x7348('0x7b')]);_0x274df2[_0x7348('0x7d')]=intUtil['stripTrailingSlash'](_0x274df2['serverUrl']);if(_0x518fbb&&_0x518fbb[_0x7348('0x7e')]){logger[_0x7348('0x36')]('['+_0x55376f[_0x7348('0x69')][_0x7348('0x96')]()+']',_0x7348('0x80'));_0x55376f[_0x7348('0x81')]=_0x274df2[_0x7348('0x7d')]+'/api/voice/recordings/'+_0x55376f[_0x7348('0x8c')]+_0x7348('0x83')+md5(_0x55376f[_0x7348('0x8c')]);}else{_0x55376f[_0x7348('0x81')]='';}var _0x438881=_0x274df2[_0x7348('0x7b')]===_0x7348('0x8d')?'eu':'com';return getAccessToken(_0x274df2)[_0x7348('0x26')](function(_0x2f7263){_0x1a368c=_0x2f7263;return getUser(_0x1a368c,_0x438881,_0x274df2);})[_0x7348('0x26')](function(_0x46a818){_0x1cced5=_0x46a818;logger['info'](_0x7348('0x8e'),_0x1cced5['id']);return getEndUser(_0x1a368c,_0x438881,_0x274df2,_0x55376f[_0x7348('0x97')],_0x55376f['calleridnum'],_0x1cced5,_0x3e1f93);})[_0x7348('0x26')](function(_0x40bc1e){_0x1c2791=_0x40bc1e;return getCall(_0x1a368c,_0x438881,_0x274df2,_0x1cced5,_0x1c2791,_0x3e1f93,_0x55376f,_0x7348('0x98'));})['then'](function(_0xb2a4d6){if(_0xb2a4d6){logger['info']('The\x20Call\x20ID\x20is:',_0xb2a4d6['id']);}})[_0x7348('0x29')](function(_0x4348e6){logger[_0x7348('0x2a')]('['+_0x55376f['lastevent']['toUpperCase']()+']',JSON[_0x7348('0xc')](_0x4348e6));});}; \ No newline at end of file +var _0x20a9=['toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','add','seconds','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','info','Using\x20the\x20admin\x20account!','Administrator','profile','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','https://www.zohoapis.','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','log','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','lead','Creating\x20new\x20call...','administrator','Subject','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','startCase','Call_Duration','utc','talktime','format','endtime','diff','starttime','mm:ss','lastevent','called','Call_Result','complete','connect','rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','YYYY-MM-DDTHH:mm:ss','agentcalledAt','Call_Type','Fields','POST','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','monitor_format','toUpperCase','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name'];(function(_0x58e31b,_0x441684){var _0x4fe9e7=function(_0x5217a9){while(--_0x5217a9){_0x58e31b['push'](_0x58e31b['shift']());}};_0x4fe9e7(++_0x441684);}(_0x20a9,0x113));var _0x920a=function(_0x525b28,_0x5cf5a0){_0x525b28=_0x525b28-0x0;var _0x180178=_0x20a9[_0x525b28];return _0x180178;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x920a('0x0'));var util=require(_0x920a('0x1'));var intUtil=require(_0x920a('0x2'));var moment=require(_0x920a('0x3'));var Redis=require(_0x920a('0x4'));var BPromise=require(_0x920a('0x5'));var config=require(_0x920a('0x6'));var logger=require(_0x920a('0x7'))(_0x920a('0x8'));config[_0x920a('0x9')]=_[_0x920a('0xa')](config['redis'],{'host':_0x920a('0xb'),'port':0x18eb});var io=require(_0x920a('0xc'))(new Redis(config['redis']));function emit(_0xf86803,_0x5bbe44,_0x1eab7c){io['to'](_0xf86803)['emit'](_0x5bbe44,_0x1eab7c);}function request(_0x291c83){logger[_0x920a('0xd')](_0x920a('0xe'),JSON[_0x920a('0xf')](_0x291c83));return rp(_0x291c83);}function getCustomFields(_0x350f30,_0x2c0471){var _0x1ff32d={};if(_0x350f30[_0x920a('0x10')]>0x0){_[_0x920a('0x11')](_0x350f30,function(_0x3ceb11){if(_['includes']([_0x920a('0x12'),_0x920a('0x13')],_0x3ceb11[_0x920a('0x14')])&&_0x3ceb11[_0x920a('0x15')]){_0x1ff32d[_0x3ceb11[_0x920a('0x15')]]=_0x3ceb11[_0x920a('0x16')][_0x920a('0x17')]();}else if(_0x3ceb11[_0x920a('0x14')]===_0x920a('0x18')&&_0x3ceb11[_0x920a('0x19')]&&_0x3ceb11[_0x920a('0x15')]&&_0x2c0471[_0x3ceb11[_0x920a('0x19')]]){_0x1ff32d[_0x3ceb11[_0x920a('0x15')]]=_0x2c0471[_0x3ceb11[_0x920a('0x19')]]['toString']();}else if(_0x3ceb11['type']===_0x920a('0x1a')&&_0x3ceb11['Variable']&&_0x3ceb11[_0x920a('0x1b')][_0x920a('0x1c')]&&_0x3ceb11[_0x920a('0x15')]&&_0x2c0471[_0x3ceb11[_0x920a('0x1b')][_0x920a('0x1c')][_0x920a('0x1d')]()]){_0x1ff32d[_0x3ceb11[_0x920a('0x15')]]=_0x2c0471[_0x3ceb11[_0x920a('0x1b')][_0x920a('0x1c')][_0x920a('0x1d')]()][_0x920a('0x17')]();}});}return _0x1ff32d;}function getName(_0x3fb5cf){if(_0x3fb5cf['indexOf']('\x20')>0x0){var _0x294c46=_0x3fb5cf[_0x920a('0x1e')](/ (.+)/);if(_0x294c46[0x1]){return _0x294c46;}}return[_0x3fb5cf,_0x3fb5cf];}var accountsTokens={};function getAccessToken(_0x1c0c55){return new Promise(function(_0x5319ea,_0x5466ae){if(!_[_0x920a('0x1f')](accountsTokens[_0x1c0c55['id']])&&!_[_0x920a('0x1f')](accountsTokens[_0x1c0c55['id']][_0x920a('0x20')])){if(moment()[_0x920a('0x21')](accountsTokens[_0x1c0c55['id']][_0x920a('0x22')])){_0x5319ea(accountsTokens[_0x1c0c55['id']]['access_token']);}}var _0x568195;switch(_0x1c0c55[_0x920a('0x23')]){case'US':_0x568195=_0x920a('0x24');break;case'AU':_0x568195=_0x920a('0x25');break;case'EU':_0x568195=_0x920a('0x26');break;case'IN':_0x568195=_0x920a('0x27');break;case'CN':_0x568195=_0x920a('0x28');break;default:_0x568195=_0x920a('0x26');break;}var _0x5daf31={'method':'POST','uri':_0x568195+_0x920a('0x29'),'qs':{'refresh_token':_0x1c0c55['refreshToken'],'client_id':_0x1c0c55[_0x920a('0x2a')],'client_secret':_0x1c0c55[_0x920a('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5daf31)['then'](function(_0x45d0e1){accountsTokens[_0x1c0c55['id']]={'access_token':_0x45d0e1['access_token'],'expires_in':moment()[_0x920a('0x2c')](_0x45d0e1[_0x920a('0x22')],_0x920a('0x2d'))};_0x5319ea(_0x45d0e1[_0x920a('0x20')]);})['catch'](function(_0x5178e1){logger['error'](_0x920a('0x2e'),_0x5178e1[_0x920a('0x2f')]);_0x5466ae(_0x5178e1);});});}function getUser(_0x1aeaba,_0x357cda,_0x2705c7,_0x2ca94d){logger['info'](_0x920a('0x30'));return request({'method':_0x920a('0x31'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x357cda),'qs':{'type':_0x920a('0x32')},'headers':{'Authorization':_0x920a('0x33')+_0x1aeaba},'json':!![]})[_0x920a('0x34')](function(_0x1624e2){if(_0x1624e2[_0x920a('0x35')]){var _0x48dee3=-0x1;if(_[_0x920a('0x36')](_0x1624e2[_0x920a('0x35')])){if(!_[_0x920a('0x1f')](_0x2ca94d)){_0x48dee3=_[_0x920a('0x37')](_0x1624e2['users'],function(_0x505963){return _0x505963['email']===_0x2ca94d;});}if(_0x48dee3>=0x0){logger[_0x920a('0x38')]('Agent\x20found!');}else{logger[_0x920a('0x38')](_0x920a('0x39'));_0x48dee3=_[_0x920a('0x37')](_0x1624e2['users'],function(_0x2083f2){return _0x2083f2['profile'][_0x920a('0x1c')]===_0x920a('0x3a');});}return _0x1624e2[_0x920a('0x35')][_0x48dee3];}else{if(_0x1624e2['user'][_0x920a('0x3b')]['name']==='Administrator'){logger[_0x920a('0x38')](_0x920a('0x39'));user=_0x1624e2[_0x920a('0x3c')];return user;}else{logger[_0x920a('0x3d')](_0x920a('0x3e'),JSON[_0x920a('0xf')](_0x1624e2));throw new Error(_0x920a('0x3f')+JSON['stringify'](_0x1624e2));}}}else{logger[_0x920a('0x3d')](_0x920a('0x3e'),JSON[_0x920a('0xf')](_0x1624e2));throw new Error(_0x920a('0x3f')+JSON[_0x920a('0xf')](_0x1624e2));}})[_0x920a('0x40')](function(_0x85bc8c){console[_0x920a('0x3d')](_0x85bc8c);});}function getZohoUser(_0x2e511e,_0x4ee53b){return new BPromise(function(_0xbcba91,_0x2afbf5){request(_0x2e511e)[_0x920a('0x34')](function(_0x41e046){var _0x2eac31=null;if(_0x41e046){_0x2eac31=_0x41e046['data'][0x0];_0x2eac31['enduserType']=_0x4ee53b;}_0xbcba91(_0x2eac31);})[_0x920a('0x40')](function(_0x2a00e1){_0x2afbf5(_0x2a00e1);});});}function createEndUser(_0x3f5992,_0x393482,_0xc92e28,_0x22802c,_0x4ad632,_0x26d62a){var _0xc92e28=getName(_0xc92e28);return request({'method':'POST','uri':_0x920a('0x41')+_0x393482+'/crm/v2/'+_['startCase'](_0x26d62a['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xc92e28[0x1],'First_Name':_0xc92e28[0x0],'Phone':_0x22802c,'Owner':{'name':!_[_0x920a('0x1f')](_0x4ad632[_0x920a('0x42')]['name'])?_0x4ad632['role']['name']:!_[_0x920a('0x1f')](_0x4ad632['first_name'])?_0x4ad632[_0x920a('0x43')]+'\x20'+_0x4ad632[_0x920a('0x44')]:_0x4ad632[_0x920a('0x44')],'id':_0x4ad632['id']}}]},'headers':{'Authorization':_0x920a('0x33')+_0x3f5992},'json':!![]})[_0x920a('0x34')](function(_0x83dd0e){if(_0x83dd0e&&_0x83dd0e[_0x920a('0x45')][0x0][_0x920a('0x46')]===_0x920a('0x47')){var _0x2a4b08=_0x83dd0e[_0x920a('0x45')][0x0][_0x920a('0x48')];_0x2a4b08['enduserType']=_['startCase'](_0x26d62a['moduleCreate'])+'s';return _0x2a4b08;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x920a('0xf')](data));throw new Error(_0x920a('0x49')+JSON[_0x920a('0xf')](data));})[_0x920a('0x40')](function(_0x24bdf0){console[_0x920a('0x4a')]('CREATE\x20ERROR',_0x24bdf0);});}function getEndUser(_0x290042,_0x5ae9f6,_0x4a3de8,_0x85de61,_0xdb1bd,_0xccbbc0,_0x14a7e6){var _0x22115f={'method':_0x920a('0x31'),'uri':'','headers':{'Authorization':_0x920a('0x33')+_0x290042},'json':!![]};switch(_0x14a7e6[_0x920a('0x4b')]){case'contact_lead':_0x22115f[_0x920a('0x4c')]='https://www.zohoapis.'+_0x5ae9f6+_0x920a('0x4d')+_0xdb1bd+'))';return getZohoUser(_0x22115f,_0x920a('0x4e'))[_0x920a('0x34')](function(_0x2c8088){if(_0x2c8088)return _0x2c8088;_0x22115f[_0x920a('0x4c')]=_0x920a('0x41')+_0x5ae9f6+_0x920a('0x4f')+_0xdb1bd+'))';return getZohoUser(_0x22115f,_0x920a('0x50'))[_0x920a('0x34')](function(_0x43c6c3){if(_0x43c6c3)return _0x43c6c3;if(_0x14a7e6[_0x920a('0x51')]!=_0x920a('0x52')){return createEndUser(_0x290042,_0x5ae9f6,_0x85de61,_0xdb1bd,_0xccbbc0,_0x14a7e6);}else{return{};}});});break;case'contact':_0x22115f['uri']=_0x920a('0x41')+_0x5ae9f6+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xdb1bd+'))';return getZohoUser(_0x22115f,_0x920a('0x4e'))['then'](function(_0x52eeb2){if(_0x52eeb2)return _0x52eeb2;if(_0x14a7e6[_0x920a('0x51')]!=_0x920a('0x52')){return createEndUser(_0x290042,_0x5ae9f6,_0x85de61,_0xdb1bd,_0xccbbc0,_0x14a7e6);}else{return{};}});break;case _0x920a('0x53'):_0x22115f[_0x920a('0x4c')]=_0x920a('0x41')+_0x5ae9f6+_0x920a('0x4f')+_0xdb1bd+'))';return getZohoUser(_0x22115f,_0x920a('0x50'))[_0x920a('0x34')](function(_0x6ac0d1){if(_0x6ac0d1)return _0x6ac0d1;if(_0x14a7e6[_0x920a('0x51')]!=_0x920a('0x52')){return createEndUser(_0x290042,_0x5ae9f6,_0x85de61,_0xdb1bd,_0xccbbc0,_0x14a7e6);}else{return{};}});break;}}function getCall(_0x5821f6,_0x198198,_0x44b99a,_0x3203ab,_0x5138de,_0x165f0a,_0x21d92c,_0xfe3b9e){logger[_0x920a('0x38')](_0x920a('0x54'));var _0x228e36={};_0x228e36['Owner']={'name':!_[_0x920a('0x1f')](_0x3203ab[_0x920a('0x42')][_0x920a('0x1c')])&&!_[_0x920a('0x1f')](_0x3203ab[_0x920a('0x3b')][_0x920a('0x1c')])&&_0x3203ab[_0x920a('0x3b')][_0x920a('0x1c')]===_0x920a('0x55')?_0x3203ab[_0x920a('0x42')][_0x920a('0x1c')]:!_[_0x920a('0x1f')](_0x3203ab[_0x920a('0x43')])?_0x3203ab[_0x920a('0x43')]+'\x20'+_0x3203ab['last_name']:_0x3203ab[_0x920a('0x44')],'id':_0x3203ab['id']};_0x228e36[_0x920a('0x56')]=intUtil['getString'](_0x165f0a['Subjects'],_0x21d92c,'\x20');_0x228e36[_0x920a('0x57')]=intUtil[_0x920a('0x58')](_0x165f0a[_0x920a('0x59')],_0x21d92c,'\x0a');if(_0x5138de['enduserType']===_0x920a('0x4e')){_0x228e36[_0x920a('0x5a')]={'name':!_['isNil'](_0x5138de[_0x920a('0x5b')])?_0x5138de[_0x920a('0x5b')]:!_[_0x920a('0x1f')](_0x5138de[_0x920a('0x5c')])?_0x5138de[_0x920a('0x5c')]+'\x20'+_0x5138de['Last_Name']:_0x5138de['Last_Name'],'id':_0x5138de['id']};}if(_0x5138de['enduserType']===_0x920a('0x50')){_0x228e36['What_Id']={'name':!_['isNil'](_0x5138de[_0x920a('0x5b')])?_0x5138de[_0x920a('0x5b')]:!_[_0x920a('0x1f')](_0x5138de['First_Name'])?_0x5138de[_0x920a('0x5c')]+'\x20'+_0x5138de['Last_Name']:_0x5138de[_0x920a('0x5d')],'id':_0x5138de['id']};_0x228e36[_0x920a('0x5e')]=_[_0x920a('0x5f')](_0x5138de['enduserType']);}if(_0x21d92c['talktime']){_0x228e36[_0x920a('0x60')]=moment[_0x920a('0x61')](parseInt(_0x21d92c[_0x920a('0x62')])*0x3e8)[_0x920a('0x63')]('mm:ss');}else if(_0x21d92c['answertime']&&_0x21d92c[_0x920a('0x64')]){_0x228e36[_0x920a('0x60')]=moment[_0x920a('0x61')](moment(_0x21d92c[_0x920a('0x64')],'YYYY-MM-DDTHH:mm:ss')[_0x920a('0x65')](moment(_0x21d92c[_0x920a('0x66')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x920a('0x67'));}switch(_0x21d92c[_0x920a('0x68')]){case _0x920a('0x69'):_0x228e36[_0x920a('0x6a')]='Called';break;case _0x920a('0x6b'):case _0x920a('0x6c'):_0x228e36[_0x920a('0x6a')]='Answered';break;case _0x920a('0x6d'):_0x228e36[_0x920a('0x6a')]='Rejected';break;case _0x920a('0x6e'):_0x228e36['Call_Result']=_0x920a('0x6f');break;case'timeout':_0x228e36['Call_Result']=_0x920a('0x70');default:}_0x228e36[_0x920a('0x71')]=(_0xfe3b9e===_0x920a('0x72')?moment(_0x21d92c[_0x920a('0x66')])['format'](_0x920a('0x73')):moment(_0x21d92c[_0x920a('0x74')])['format'](_0x920a('0x73')))||moment()['format'](_0x920a('0x73'));_0x228e36[_0x920a('0x75')]=_0xfe3b9e||'Inbound';_0x228e36=_['merge'](_0x228e36,getCustomFields(_0x165f0a[_0x920a('0x76')],_0x21d92c));return request({'method':_0x920a('0x77'),'uri':'https://www.zohoapis.'+_0x198198+_0x920a('0x78'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5821f6},'body':{'data':[_0x228e36]},'json':!![]})[_0x920a('0x34')](function(_0x10b355){if(_0x10b355&&_0x10b355[_0x920a('0x45')][0x0]['code']===_0x920a('0x47')){logger[_0x920a('0x38')]('Call\x20created!');return{'id':_0x10b355[_0x920a('0x45')][0x0][_0x920a('0x48')]['id']};}})[_0x920a('0x40')](function(_0x1b588f){logger[_0x920a('0x38')](_0x920a('0x79'),_0x1b588f[_0x920a('0x2f')]);console['log'](_0x920a('0x79'),_0x1b588f);});}exports[_0x920a('0x7a')]=function(_0x1d7b36,_0x258eca,_0x2bc61f,_0x1219af,_0x9b38f6,_0x98abc8){var _0x50667f,_0x141bcc,_0x46a6a9;_0x98abc8[_0x920a('0x7b')]=intUtil[_0x920a('0x7c')](_0x98abc8[_0x920a('0x7b')]);_0x98abc8[_0x920a('0x7d')]=intUtil['stripTrailingSlash'](_0x98abc8[_0x920a('0x7d')]);if(_0x9b38f6&&_0x9b38f6['monitor_format']){logger[_0x920a('0x38')](_0x920a('0x7e'),'Recording\x20is\x20enabled!');_0x258eca['recordingURL']=_0x98abc8[_0x920a('0x7d')]+_0x920a('0x7f')+_0x258eca['uniqueid']+_0x920a('0x80')+md5(_0x258eca[_0x920a('0x81')]);}else{_0x258eca['recordingURL']='';}var _0x2a9179=_0x98abc8['host']===_0x920a('0x82')?'eu':_0x920a('0x83');return getAccessToken(_0x98abc8)['then'](function(_0x4d02fb){_0x46a6a9=_0x4d02fb;return getUser(_0x46a6a9,_0x2a9179,_0x98abc8,_0x1219af[_0x920a('0x84')]);})[_0x920a('0x34')](function(_0x48ecc0){_0x50667f=_0x48ecc0;logger[_0x920a('0x38')](_0x920a('0x85'),_0x50667f['id']);return getEndUser(_0x46a6a9,_0x2a9179,_0x98abc8,_0x258eca[_0x920a('0x86')],_0x258eca[_0x920a('0x87')],_0x50667f,_0x2bc61f);})[_0x920a('0x34')](function(_0x1d719f){_0x141bcc=_0x1d719f;return getCall(_0x46a6a9,_0x2a9179,_0x98abc8,_0x50667f,_0x141bcc,_0x2bc61f,_0x258eca,_0x920a('0x88'));})[_0x920a('0x34')](function(_0x1deaa1){if(_0x1deaa1){logger[_0x920a('0x38')](_0x920a('0x89'),_0x1deaa1['id']);logger[_0x920a('0x38')](_0x920a('0x7e'),_0x920a('0x8a'));emit(util[_0x920a('0x63')](_0x920a('0x8b'),_0x1219af['name']),'trigger:browser:url',{'uri':_0x920a('0x8c')+_0x98abc8[_0x920a('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1deaa1['id']});}})[_0x920a('0x40')](function(_0x179883){logger[_0x920a('0x3d')](_0x920a('0x7e'),JSON['stringify'](_0x179883));});};exports['outbound']=function(_0x204727,_0x5e96b1,_0x66cd5b,_0x5a6074,_0x4f76fa,_0x254177,_0x4771bd){var _0x15d1f6,_0x199372,_0x5bc6c0;_0x254177[_0x920a('0x7b')]=intUtil[_0x920a('0x7c')](_0x254177[_0x920a('0x7b')]);_0x254177['serverUrl']=intUtil[_0x920a('0x7c')](_0x254177[_0x920a('0x7d')]);if(_0x4771bd&&_0x4771bd['recordingFormat']&&_0x4771bd[_0x920a('0x8d')]!==_0x920a('0x8e')){logger[_0x920a('0x38')](_0x920a('0x8f'),_0x920a('0x90'));_0x5e96b1[_0x920a('0x91')]=_0x254177[_0x920a('0x7d')]+_0x920a('0x7f')+_0x5e96b1[_0x920a('0x81')]+_0x920a('0x80')+md5(_0x5e96b1[_0x920a('0x81')]);}var _0x17ba70=_0x254177[_0x920a('0x7b')]===_0x920a('0x82')?'eu':_0x920a('0x83');return getAccessToken(_0x254177)['then'](function(_0x2da021){_0x5bc6c0=_0x2da021;return getUser(_0x5bc6c0,_0x17ba70,_0x254177,_0x5a6074['email']);})[_0x920a('0x34')](function(_0xe1557e){_0x15d1f6=_0xe1557e;logger[_0x920a('0x38')](_0x920a('0x85'),_0x15d1f6['id']);return getEndUser(_0x5bc6c0,_0x17ba70,_0x254177,_0x5e96b1[_0x920a('0x92')],_0x5e96b1[_0x920a('0x93')],_0x15d1f6,_0x66cd5b);})['then'](function(_0x1eb7d4){_0x199372=_0x1eb7d4;return getCall(_0x5bc6c0,_0x17ba70,_0x254177,_0x15d1f6,_0x199372,_0x66cd5b,_0x5e96b1,_0x920a('0x94'));})['then'](function(_0x3e9ade){if(_0x3e9ade){logger[_0x920a('0x38')](_0x920a('0x89'),_0x3e9ade['id']);logger[_0x920a('0x38')](_0x920a('0x8f'),_0x920a('0x8a'));emit(util[_0x920a('0x63')](_0x920a('0x8b'),_0x5a6074['name']),_0x920a('0x95'),{'uri':_0x920a('0x8c')+_0x254177[_0x920a('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3e9ade['id']});}})[_0x920a('0x40')](function(_0x2a0a6f){logger['error'](_0x920a('0x8f'),JSON[_0x920a('0xf')](_0x2a0a6f));});};exports['unmanaged']=function(_0x206c7e,_0x4f13e6,_0x29852c,_0x535535,_0x3e710c,_0x52b0ce){var _0x3cb855,_0x22b022,_0x3ac010;_0x52b0ce[_0x920a('0x7b')]=intUtil[_0x920a('0x7c')](_0x52b0ce['host']);_0x52b0ce[_0x920a('0x7d')]=intUtil[_0x920a('0x7c')](_0x52b0ce[_0x920a('0x7d')]);if(_0x3e710c&&_0x3e710c[_0x920a('0x96')]){logger[_0x920a('0x38')]('['+_0x4f13e6['lastevent'][_0x920a('0x97')]()+']',_0x920a('0x90'));_0x4f13e6[_0x920a('0x91')]=_0x52b0ce[_0x920a('0x7d')]+_0x920a('0x7f')+_0x4f13e6[_0x920a('0x81')]+_0x920a('0x80')+md5(_0x4f13e6[_0x920a('0x81')]);}else{_0x4f13e6[_0x920a('0x91')]='';}var _0x428942=_0x52b0ce[_0x920a('0x7b')]===_0x920a('0x82')?'eu':_0x920a('0x83');return getAccessToken(_0x52b0ce)[_0x920a('0x34')](function(_0x4f6f4f){_0x3ac010=_0x4f6f4f;return getUser(_0x3ac010,_0x428942,_0x52b0ce);})['then'](function(_0x14c2f5){_0x3cb855=_0x14c2f5;logger[_0x920a('0x38')](_0x920a('0x85'),_0x3cb855['id']);return getEndUser(_0x3ac010,_0x428942,_0x52b0ce,_0x4f13e6[_0x920a('0x86')],_0x4f13e6[_0x920a('0x87')],_0x3cb855,_0x29852c);})['then'](function(_0x1c9f37){_0x22b022=_0x1c9f37;return getCall(_0x3ac010,_0x428942,_0x52b0ce,_0x3cb855,_0x22b022,_0x29852c,_0x4f13e6,_0x920a('0x88'));})['then'](function(_0x33b516){if(_0x33b516){logger[_0x920a('0x38')]('The\x20Call\x20ID\x20is:',_0x33b516['id']);}})[_0x920a('0x40')](function(_0x7bf688){logger[_0x920a('0x3d')]('['+_0x4f13e6['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x7bf688));});}; \ 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 6754c8b..eca276b 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 _0x671a=['info','../../../../config/logger','trigger','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x671a,0x118));var _0xa671=function(_0x3c78e7,_0x19a615){_0x3c78e7=_0x3c78e7-0x0;var _0x46c763=_0x671a[_0x3c78e7];return _0x46c763;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xa671('0x0'))(_0xa671('0x1'));exports['exec']=function(_0x4bfa24,_0x755009){var _0x228135=_0x4bfa24[_0xa671('0x2')]?_0x4bfa24[_0xa671('0x2')]:_0xa671('0x3');var _0x2fab28=_0x4bfa24[_0xa671('0x4')]?Mustache[_0xa671('0x5')](_0x4bfa24[_0xa671('0x4')],_0x755009):_0x755009;sh['exec'](_0x2fab28,function(_0x21ae3a,_0xf84045,_0x196861){if(_0x21ae3a!==0x0){logger[_0xa671('0x6')](util['format'](_0xa671('0x7'),_0x228135,_0x2fab28,_0x21ae3a,_0x196861));}else{logger[_0xa671('0x8')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x228135,_0x2fab28,_0xf84045));}});}; \ No newline at end of file +var _0x1a6e=['render','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','shelljs','../../../../config/logger','trigger','exec','data2'];(function(_0x12f8cc,_0x1c979f){var _0xe3a425=function(_0x129f37){while(--_0x129f37){_0x12f8cc['push'](_0x12f8cc['shift']());}};_0xe3a425(++_0x1c979f);}(_0x1a6e,0x13a));var _0xe1a6=function(_0x173eff,_0x55a7d0){_0x173eff=_0x173eff-0x0;var _0x119fbd=_0x1a6e[_0x173eff];return _0x119fbd;};'use strict';var util=require('util');var sh=require(_0xe1a6('0x0'));var Mustache=require('mustache');var logger=require(_0xe1a6('0x1'))(_0xe1a6('0x2'));exports[_0xe1a6('0x3')]=function(_0x31e557,_0x38fc8f){var _0x240534=_0x31e557[_0xe1a6('0x4')]?_0x31e557[_0xe1a6('0x4')]:'Script';var _0x2196df=_0x31e557['data3']?Mustache[_0xe1a6('0x5')](_0x31e557[_0xe1a6('0x6')],_0x38fc8f):_0x38fc8f;sh['exec'](_0x2196df,function(_0x3bba76,_0x2ece0b,_0x502c84){if(_0x3bba76!==0x0){logger[_0xe1a6('0x7')](util['format'](_0xe1a6('0x8'),_0x240534,_0x2196df,_0x3bba76,_0x502c84));}else{logger[_0xe1a6('0x9')](util[_0xe1a6('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x240534,_0x2196df,_0x2ece0b));}});}; \ 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 fe8a429..d813bca 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 _0xb2b8=['mustache','../../../../config/logger','trigger','data1','toUpperCase','render','number','data5','headers','data6','error','stack','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','%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'];(function(_0x5890b1,_0x5bbf0e){var _0xe77d95=function(_0x3e01f0){while(--_0x3e01f0){_0x5890b1['push'](_0x5890b1['shift']());}};_0xe77d95(++_0x5bbf0e);}(_0xb2b8,0x11f));var _0x8b2b=function(_0x260a19,_0x1c5a82){_0x260a19=_0x260a19-0x0;var _0x55ab6f=_0xb2b8[_0x260a19];return _0x55ab6f;};'use strict';var rp=require(_0x8b2b('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0x8b2b('0x1'));var logger=require(_0x8b2b('0x2'))(_0x8b2b('0x3'));exports['exec']=function(_0x4bc18e,_0x22bf4b){var _0x1c52d9,_0x59e827;var _0x50b780={'method':_0x4bc18e[_0x8b2b('0x4')][_0x8b2b('0x5')](),'uri':Mustache[_0x8b2b('0x6')](_0x4bc18e['data2'],_0x22bf4b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4bc18e['data5'])===_0x8b2b('0x7')&&parseInt(_0x4bc18e[_0x8b2b('0x8')])>=0x1&&parseInt(_0x4bc18e[_0x8b2b('0x8')])<=0xa?parseInt(_0x4bc18e['data5'])*0x3e8:0x5*0x3e8};try{_0x50b780[_0x8b2b('0x9')]=_0x4bc18e[_0x8b2b('0xa')]?JSON['parse'](Mustache[_0x8b2b('0x6')](_0x4bc18e[_0x8b2b('0xa')],_0x22bf4b)):{};}catch(_0x40da22){logger[_0x8b2b('0xb')](_0x40da22[_0x8b2b('0xc')]);}switch(_0x4bc18e[_0x8b2b('0x4')][_0x8b2b('0x5')]()){case'GET':case'DELETE':_0x1c52d9=null;_0x50b780['qs']=_0x22bf4b;break;case _0x8b2b('0xd'):case'PUT':if(_0x4bc18e['data7']){try{_0x1c52d9=JSON['parse'](Mustache[_0x8b2b('0x6')](_0x4bc18e[_0x8b2b('0xe')],_0x22bf4b));_0x50b780[_0x8b2b('0xf')]=_0x1c52d9;}catch(_0x10aeda){logger['error'](_0x10aeda[_0x8b2b('0xc')]);logger['error'](_0x8b2b('0x10'));}}else{_0x1c52d9=_0x22bf4b;_0x50b780[_0x8b2b('0xf')]=_0x1c52d9;}break;}logger[_0x8b2b('0x11')](util[_0x8b2b('0x12')](_0x8b2b('0x13'),_0x4bc18e[_0x8b2b('0x4')],_0x4bc18e[_0x8b2b('0x14')],JSON['stringify'](_0x50b780)));rp(_0x50b780)[_0x8b2b('0x15')](function(_0x7e18ed){_0x1c52d9=!_[_0x8b2b('0x16')](_0x1c52d9)?_0x8b2b('0x17')+_0x1c52d9:'';_0x59e827=typeof _0x7e18ed['body']===_0x8b2b('0x18')?JSON[_0x8b2b('0x19')](_0x7e18ed[_0x8b2b('0xf')]):_0x7e18ed[_0x8b2b('0xf')];logger[_0x8b2b('0x11')](util[_0x8b2b('0x12')](_0x8b2b('0x1a'),_0x4bc18e[_0x8b2b('0x4')],_0x4bc18e['data2'],_0x7e18ed[_0x8b2b('0x1b')],_0x59e827));})[_0x8b2b('0x1c')](function(_0x33bcda){logger[_0x8b2b('0xb')](util['format'](_0x8b2b('0x1d'),_0x4bc18e[_0x8b2b('0x4')],_0x4bc18e[_0x8b2b('0x14')],_0x33bcda['statusCode'],_0x33bcda[_0x8b2b('0x1e')],_0x33bcda[_0x8b2b('0x1f')]));});}; \ No newline at end of file +var _0x0935=['headers','parse','error','stack','data1','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data2','stringify','then','isNil',',\x20request\x20body:\x20','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','number','data5'];(function(_0x37931a,_0x37f53c){var _0x506e66=function(_0x414621){while(--_0x414621){_0x37931a['push'](_0x37931a['shift']());}};_0x506e66(++_0x37f53c);}(_0x0935,0x10d));var _0x5093=function(_0x2c3a4c,_0x250a5b){_0x2c3a4c=_0x2c3a4c-0x0;var _0xc74a32=_0x0935[_0x2c3a4c];return _0xc74a32;};'use strict';var rp=require(_0x5093('0x0'));var util=require('util');var _=require(_0x5093('0x1'));var Mustache=require(_0x5093('0x2'));var logger=require(_0x5093('0x3'))(_0x5093('0x4'));exports[_0x5093('0x5')]=function(_0x10d87b,_0x16a168){var _0x4f9ec2,_0xa5ea17;var _0x4aa19b={'method':_0x10d87b['data1'][_0x5093('0x6')](),'uri':Mustache[_0x5093('0x7')](_0x10d87b['data2'],_0x16a168),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x10d87b['data5'])===_0x5093('0x8')&&parseInt(_0x10d87b[_0x5093('0x9')])>=0x1&&parseInt(_0x10d87b[_0x5093('0x9')])<=0xa?parseInt(_0x10d87b[_0x5093('0x9')])*0x3e8:0x5*0x3e8};try{_0x4aa19b[_0x5093('0xa')]=_0x10d87b['data6']?JSON[_0x5093('0xb')](Mustache[_0x5093('0x7')](_0x10d87b['data6'],_0x16a168)):{};}catch(_0x4800b0){logger[_0x5093('0xc')](_0x4800b0[_0x5093('0xd')]);}switch(_0x10d87b[_0x5093('0xe')][_0x5093('0x6')]()){case'GET':case _0x5093('0xf'):_0x4f9ec2=null;_0x4aa19b['qs']=_0x16a168;break;case _0x5093('0x10'):case _0x5093('0x11'):if(_0x10d87b[_0x5093('0x12')]){try{_0x4f9ec2=JSON[_0x5093('0xb')](Mustache['render'](_0x10d87b['data7'],_0x16a168));_0x4aa19b[_0x5093('0x13')]=_0x4f9ec2;}catch(_0x5b7f9d){logger[_0x5093('0xc')](_0x5b7f9d['stack']);logger[_0x5093('0xc')](_0x5093('0x14'));}}else{_0x4f9ec2=_0x16a168;_0x4aa19b[_0x5093('0x13')]=_0x4f9ec2;}break;}logger[_0x5093('0x15')](util[_0x5093('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x10d87b[_0x5093('0xe')],_0x10d87b[_0x5093('0x17')],JSON[_0x5093('0x18')](_0x4aa19b)));rp(_0x4aa19b)[_0x5093('0x19')](function(_0x134847){_0x4f9ec2=!_[_0x5093('0x1a')](_0x4f9ec2)?_0x5093('0x1b')+_0x4f9ec2:'';_0xa5ea17=typeof _0x134847['body']==='object'?JSON[_0x5093('0x18')](_0x134847[_0x5093('0x13')]):_0x134847['body'];logger['info'](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x10d87b[_0x5093('0xe')],_0x10d87b[_0x5093('0x17')],_0x134847[_0x5093('0x1c')],_0xa5ea17));})['catch'](function(_0x5c0c5f){logger[_0x5093('0xc')](util[_0x5093('0x16')](_0x5093('0x1d'),_0x10d87b[_0x5093('0xe')],_0x10d87b['data2'],_0x5c0c5f['statusCode'],_0x5c0c5f[_0x5093('0x1e')],_0x5c0c5f['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 537e5f1..a1c42b8 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 _0x8e9c=['error','message','result','catch','exports','bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x8e9c,0x11d));var _0xc8e9=function(_0x6b809e,_0x5c6c4d){_0x6b809e=_0x6b809e-0x0;var _0x26bb44=_0x8e9c[_0x6b809e];return _0x26bb44;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc8e9('0x0'));var logger=require(_0xc8e9('0x1'))(_0xc8e9('0x2'));var client=jayson['client'][_0xc8e9('0x3')]({'port':0x2329});client[_0xc8e9('0x4')]=function(_0x31f50d,_0x2199f4){return new BPromise(function(_0x3f66b4,_0xf0f2a4){return client[_0xc8e9('0x5')](_0x31f50d,_0x2199f4)[_0xc8e9('0x6')](function(_0x60a68f){logger[_0xc8e9('0x7')](_0xc8e9('0x8'),'routing',_0x31f50d,_0x2199f4,_0x60a68f);if(_0x60a68f['error']){logger['error'](_0xc8e9('0x8'),_0xc8e9('0x2'),_0x31f50d,_0x60a68f[_0xc8e9('0x9')][_0xc8e9('0xa')],_0x2199f4);return _0xf0f2a4(_0x60a68f[_0xc8e9('0x9')]['message']);}else{return _0x3f66b4(_0x60a68f[_0xc8e9('0xb')]);}})[_0xc8e9('0xc')](function(_0x4e4065){logger[_0xc8e9('0x9')](_0xc8e9('0x8'),_0xc8e9('0x2'),_0x31f50d,_0x4e4065,_0x2199f4);return _0xf0f2a4(_0x4e4065);});});};module[_0xc8e9('0xd')]=client; \ No newline at end of file +var _0x8874=['message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','request','rpc','error'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8874,0x19c));var _0x4887=function(_0x1a1c87,_0x116a84){_0x1a1c87=_0x1a1c87-0x0;var _0x17e5ca=_0x8874[_0x1a1c87];return _0x17e5ca;};'use strict';var jayson=require(_0x4887('0x0'));var BPromise=require('bluebird');var logger=require(_0x4887('0x1'))(_0x4887('0x2'));var client=jayson[_0x4887('0x3')][_0x4887('0x4')]({'port':0x2329});client['Request']=function(_0x4eb4b4,_0x3c3860){return new BPromise(function(_0xe5adb6,_0x3281f9){return client[_0x4887('0x5')](_0x4eb4b4,_0x3c3860)['then'](function(_0x3e6a18){logger['debug'](_0x4887('0x6'),_0x4887('0x2'),_0x4eb4b4,_0x3c3860,_0x3e6a18);if(_0x3e6a18[_0x4887('0x7')]){logger['error'](_0x4887('0x6'),_0x4887('0x2'),_0x4eb4b4,_0x3e6a18[_0x4887('0x7')]['message'],_0x3c3860);return _0x3281f9(_0x3e6a18[_0x4887('0x7')][_0x4887('0x8')]);}else{return _0xe5adb6(_0x3e6a18[_0x4887('0x9')]);}})[_0x4887('0xa')](function(_0x64f433){logger[_0x4887('0x7')](_0x4887('0x6'),'routing',_0x4eb4b4,_0x64f433,_0x3c3860);return _0x3281f9(_0x64f433);});});};module[_0x4887('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 85f4d78..7bc46fb 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 _0x65ac=['catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','initMailAccounts','refresh','listen','getSettings','loginMailFrequency'];(function(_0x1602de,_0x3e083a){var _0x807947=function(_0x269b71){while(--_0x269b71){_0x1602de['push'](_0x1602de['shift']());}};_0x807947(++_0x3e083a);}(_0x65ac,0x113));var _0xc65a=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x65ac[_0x15bc81];return _0x59440e;};'use strict';var server=require(_0xc65a('0x0'));var Realtime=require(_0xc65a('0x1'));var EmailChannel=require(_0xc65a('0x2'));var mailAccount=require(_0xc65a('0x3'));var setting=require(_0xc65a('0x4'));var logger=require(_0xc65a('0x5'))(_0xc65a('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xc65a('0x7')](mailAccount['getMailAccounts']())['then'](realtime[_0xc65a('0x8')]())['then'](function(){email[_0xc65a('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xc65a('0xa')](realtime,email)[_0xc65a('0x7')](function(){return initRealtime();})[_0xc65a('0x7')](function(){return setting[_0xc65a('0xb')]();})[_0xc65a('0x7')](function(_0x581463){return setInterval(initRealtime,_0x581463[_0xc65a('0xc')]*0x3e8);})[_0xc65a('0xd')](function(_0xfe717e){logger[_0xc65a('0xe')](_0xc65a('0xf'),_0xfe717e);});}main(); \ No newline at end of file +var _0xccf2=['then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','error','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','email','resolve'];(function(_0x5cc7fd,_0x125682){var _0x5182ba=function(_0xd328bf){while(--_0xd328bf){_0x5cc7fd['push'](_0x5cc7fd['shift']());}};_0x5182ba(++_0x125682);}(_0xccf2,0x19d));var _0x2ccf=function(_0x110364,_0x4d93ff){_0x110364=_0x110364-0x0;var _0x458e88=_0xccf2[_0x110364];return _0x458e88;};'use strict';var server=require(_0x2ccf('0x0'));var Realtime=require(_0x2ccf('0x1'));var EmailChannel=require(_0x2ccf('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x2ccf('0x3'));var logger=require(_0x2ccf('0x4'))(_0x2ccf('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2ccf('0x6')]()[_0x2ccf('0x7')](mailAccount[_0x2ccf('0x8')]())['then'](realtime[_0x2ccf('0x9')]())[_0x2ccf('0x7')](function(){email['refresh'](realtime[_0x2ccf('0xa')]);return realtime;});}function main(){return server[_0x2ccf('0xb')](realtime,email)[_0x2ccf('0x7')](function(){return initRealtime();})[_0x2ccf('0x7')](function(){return setting[_0x2ccf('0xc')]();})[_0x2ccf('0x7')](function(_0x4ed39b){return setInterval(initRealtime,_0x4ed39b[_0x2ccf('0xd')]*0x3e8);})['catch'](function(_0x53a44f){logger[_0x2ccf('0xe')]('Email\x20service\x20initialization',_0x53a44f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a42dd23..a4e42ef 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 _0x305e=['catch','handleImapEnd','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','moment','md5','../../../config/environment','../../../config/logger','email','defaults','localhost','socket.io-emitter','redis','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','mailAccount:update','refresh','service','custom','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x305e,0x74));var _0xe305=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x305e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xe305('0x0'));var moment=require(_0xe305('0x1'));var BPromise=require('bluebird');var md5=require(_0xe305('0x2'));var Redis=require('ioredis');var config=require(_0xe305('0x3'));var logger=require(_0xe305('0x4'))(_0xe305('0x5'));config['redis']=_[_0xe305('0x6')](config['redis'],{'host':_0xe305('0x7'),'port':0x18eb});var io=require(_0xe305('0x8'))(new Redis(config[_0xe305('0x9')]));var EmailImap=require(_0xe305('0xa'));var EmailSmtp=require(_0xe305('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3b89ff){logger[_0xe305('0xc')](_0xe305('0xd'));this[_0xe305('0xe')]=_0x3b89ff['mailAccounts'];this[_0xe305('0xf')]={};this[_0xe305('0x10')]=new EmailSmtp();}EmailChannel[_0xe305('0x11')][_0xe305('0x12')]=function(_0x1fd990){var _0x55c041=this['mailAccounts'][_0x1fd990];var _0x420f9e={'id':_0x55c041['id'],'name':_0x55c041[_0xe305('0x13')],'key':_0x55c041[_0xe305('0x14')],'active':_0x55c041[_0xe305('0x15')],'Imap':{'status':_0x55c041[_0xe305('0x16')][_0xe305('0x17')],'messageStatus':_0x55c041[_0xe305('0x16')][_0xe305('0x18')],'total':_0x55c041['Imap']['total']}};if(_[_0xe305('0x19')](md5Accounts[_0x1fd990])){md5Accounts[_0x1fd990]={};}var _0x1be99b=md5(JSON[_0xe305('0x1a')](_0x420f9e));if(md5Accounts[_0x1fd990][_0xe305('0x2')]!==_0x1be99b){md5Accounts[_0x1fd990][_0xe305('0x2')]=_0x1be99b;io[_0xe305('0x12')](_0xe305('0x1b'),_0x420f9e);}};EmailChannel['prototype'][_0xe305('0x1c')]=function(_0x563914){for(var _0x107c43 in _0x563914){if(_0x563914['hasOwnProperty'](_0x107c43)){if(_0x563914[_0x107c43][_0xe305('0x16')]&&_0x563914[_0x107c43][_0xe305('0x15')]){var _0x327c1c=_0x563914[_0x107c43][_0xe305('0x16')];if(!_0x327c1c[_0xe305('0x1d')]&&_0x563914[_0x107c43]['provider']!==_0xe305('0x1e'))_0x327c1c[_0xe305('0x1d')]=_0x563914[_0x107c43]['provider'];if(!this[_0xe305('0xf')]['hasOwnProperty'](_0x327c1c['id'])){this[_0xe305('0xf')][_0x327c1c['id']]=new EmailImap(_0x327c1c,_0x563914[_0x107c43][_0xe305('0x5')]);this[_0xe305('0xf')][_0x327c1c['id']]['on'](_0xe305('0x1f'),this[_0xe305('0x20')][_0xe305('0x21')](this,_0x107c43));this[_0xe305('0xf')][_0x327c1c['id']]['on']('email',this[_0xe305('0x22')][_0xe305('0x21')](this,_0x107c43));this[_0xe305('0xf')][_0x327c1c['id']]['on'](_0xe305('0x23'),this['handleImapEnd'][_0xe305('0x21')](this,_0x107c43));this[_0xe305('0xf')][_0x327c1c['id']]['on'](_0xe305('0x24'),this[_0xe305('0x25')][_0xe305('0x21')](this,_0x107c43));}}else{if(_[_0xe305('0x19')](this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')])){this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')]={};}this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')]['status']='disabled';this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')][_0xe305('0x18')]='';this[_0xe305('0x12')](_0x107c43);}}}};EmailChannel[_0xe305('0x11')]['handleImapBox']=function(_0x442094,_0x4e68cb){if(this['mailAccounts'][_0x442094]){this['mailAccounts'][_0x442094]['Imap'][_0xe305('0x17')]='connected';this['mailAccounts'][_0x442094]['Imap'][_0xe305('0x18')]=_0x4e68cb[_0xe305('0x13')];if(_0x4e68cb[_0xe305('0x26')]){this['mailAccounts'][_0x442094][_0xe305('0x16')]['total']=_0x4e68cb[_0xe305('0x26')][_0xe305('0x27')];}return this[_0xe305('0x12')](_0x442094);}};EmailChannel[_0xe305('0x11')]['handleImapEmail']=function(_0x1e7eb4,_0x3e8de7){logger['info'](_0xe305('0x28'),_0x3e8de7[_0xe305('0x29')],_0x3e8de7[_0xe305('0x2a')],_0x3e8de7[_0xe305('0x2b')],_0x1e7eb4);if(this[_0xe305('0xe')][_0x1e7eb4]){return mailAccount['notify'](_0x1e7eb4,_0x3e8de7)[_0xe305('0x2c')](function(_0x3d4e2c){if(_0x3d4e2c){logger[_0xe305('0xc')](_0xe305('0x2d'));}})[_0xe305('0x2e')](function(_0x124eed){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xe305('0x1a')](_0x124eed));});}};EmailChannel['prototype'][_0xe305('0x2f')]=function(_0x40b48a){if(this[_0xe305('0xe')][_0x40b48a]&&this[_0xe305('0xe')][_0x40b48a]['Imap']){if(this[_0xe305('0xf')][this[_0xe305('0xe')][_0x40b48a][_0xe305('0x16')]['id']]){delete this[_0xe305('0xf')][this[_0xe305('0xe')][_0x40b48a][_0xe305('0x16')]['id']];}this[_0xe305('0xe')][_0x40b48a][_0xe305('0x16')]['lastSync']=moment();this[_0xe305('0x12')](_0x40b48a);}};EmailChannel['prototype'][_0xe305('0x25')]=function(_0x406b1d,_0x1afe34){if(this[_0xe305('0xe')][_0x406b1d]){this[_0xe305('0xe')][_0x406b1d]['Imap'][_0xe305('0x17')]='error';this[_0xe305('0xe')][_0x406b1d][_0xe305('0x16')][_0xe305('0x18')]=_0x1afe34;return this[_0xe305('0x12')](_0x406b1d);}};EmailChannel[_0xe305('0x11')][_0xe305('0x30')]=function(_0x42461e,_0x53f8dd){return this[_0xe305('0x10')][_0xe305('0x31')](_0x42461e,_0x53f8dd);};EmailChannel[_0xe305('0x11')][_0xe305('0x32')]=function(_0x3494fc){var _0x98f9cb=this;if(this[_0xe305('0xe')][_0x3494fc['id']]){if(_[_0xe305('0x19')](this[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')])){this[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')]={};}this[_0xe305('0xe')][_0x3494fc['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x447d55,_0x34f0e9){return _0x98f9cb[_0xe305('0x10')][_0xe305('0x34')](_0x3494fc)[_0xe305('0x2c')](function(_0x766af8){_0x98f9cb[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')][_0xe305('0x17')]=_0xe305('0x35');_0x98f9cb['mailAccounts'][_0x3494fc['id']][_0xe305('0x33')]['messageStatus']='';_0x98f9cb['emit'](_0x3494fc['id']);_0x447d55(_0x766af8);})[_0xe305('0x2e')](function(_0x368e65){_0x98f9cb[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')][_0xe305('0x17')]=_0xe305('0x24');_0x98f9cb['mailAccounts'][_0x3494fc['id']][_0xe305('0x33')][_0xe305('0x18')]=_0x368e65;_0x98f9cb[_0xe305('0x12')](_0x3494fc['id']);_0x34f0e9(_0x368e65);});});}return this[_0xe305('0x10')][_0xe305('0x34')](_0x3494fc);};module['exports']=EmailChannel; \ No newline at end of file +var _0xb84c=['redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','name','key','Imap','status','total','isNil','stringify','mailAccount:update','refresh','service','provider','custom','imapAccounts','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','messageStatus','emit','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','send','verifySmtp','Smtp','verified','verify','lodash','bluebird','md5','ioredis','email'];(function(_0x58db27,_0x56f094){var _0xe5cd9d=function(_0x33c534){while(--_0x33c534){_0x58db27['push'](_0x58db27['shift']());}};_0xe5cd9d(++_0x56f094);}(_0xb84c,0xc7));var _0xcb84=function(_0x3d7a74,_0x23464f){_0x3d7a74=_0x3d7a74-0x0;var _0x28b741=_0xb84c[_0x3d7a74];return _0x28b741;};'use strict';var _=require(_0xcb84('0x0'));var moment=require('moment');var BPromise=require(_0xcb84('0x1'));var md5=require(_0xcb84('0x2'));var Redis=require(_0xcb84('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xcb84('0x4'));config[_0xcb84('0x5')]=_[_0xcb84('0x6')](config[_0xcb84('0x5')],{'host':_0xcb84('0x7'),'port':0x18eb});var io=require(_0xcb84('0x8'))(new Redis(config[_0xcb84('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xcb84('0x9'));var md5Accounts={};function EmailChannel(_0xcb0e1c){logger[_0xcb84('0xa')](_0xcb84('0xb'));this[_0xcb84('0xc')]=_0xcb0e1c[_0xcb84('0xc')];this['imapAccounts']={};this[_0xcb84('0xd')]=new EmailSmtp();}EmailChannel[_0xcb84('0xe')]['emit']=function(_0x15ce0e){var _0x1a9918=this[_0xcb84('0xc')][_0x15ce0e];var _0x137d94={'id':_0x1a9918['id'],'name':_0x1a9918[_0xcb84('0xf')],'key':_0x1a9918[_0xcb84('0x10')],'active':_0x1a9918['active'],'Imap':{'status':_0x1a9918[_0xcb84('0x11')][_0xcb84('0x12')],'messageStatus':_0x1a9918[_0xcb84('0x11')]['messageStatus'],'total':_0x1a9918[_0xcb84('0x11')][_0xcb84('0x13')]}};if(_[_0xcb84('0x14')](md5Accounts[_0x15ce0e])){md5Accounts[_0x15ce0e]={};}var _0x52c39=md5(JSON[_0xcb84('0x15')](_0x137d94));if(md5Accounts[_0x15ce0e][_0xcb84('0x2')]!==_0x52c39){md5Accounts[_0x15ce0e][_0xcb84('0x2')]=_0x52c39;io['emit'](_0xcb84('0x16'),_0x137d94);}};EmailChannel[_0xcb84('0xe')][_0xcb84('0x17')]=function(_0x5736dd){for(var _0x155d70 in _0x5736dd){if(_0x5736dd['hasOwnProperty'](_0x155d70)){if(_0x5736dd[_0x155d70][_0xcb84('0x11')]&&_0x5736dd[_0x155d70]['active']){var _0x3bdc2a=_0x5736dd[_0x155d70][_0xcb84('0x11')];if(!_0x3bdc2a[_0xcb84('0x18')]&&_0x5736dd[_0x155d70][_0xcb84('0x19')]!==_0xcb84('0x1a'))_0x3bdc2a[_0xcb84('0x18')]=_0x5736dd[_0x155d70]['provider'];if(!this[_0xcb84('0x1b')]['hasOwnProperty'](_0x3bdc2a['id'])){this[_0xcb84('0x1b')][_0x3bdc2a['id']]=new EmailImap(_0x3bdc2a,_0x5736dd[_0x155d70][_0xcb84('0x4')]);this[_0xcb84('0x1b')][_0x3bdc2a['id']]['on']('box',this[_0xcb84('0x1c')][_0xcb84('0x1d')](this,_0x155d70));this[_0xcb84('0x1b')][_0x3bdc2a['id']]['on']('email',this[_0xcb84('0x1e')][_0xcb84('0x1d')](this,_0x155d70));this[_0xcb84('0x1b')][_0x3bdc2a['id']]['on'](_0xcb84('0x1f'),this[_0xcb84('0x20')][_0xcb84('0x1d')](this,_0x155d70));this[_0xcb84('0x1b')][_0x3bdc2a['id']]['on'](_0xcb84('0x21'),this[_0xcb84('0x22')][_0xcb84('0x1d')](this,_0x155d70));}}else{if(_['isNil'](this[_0xcb84('0xc')][_0x155d70][_0xcb84('0x11')])){this[_0xcb84('0xc')][_0x155d70][_0xcb84('0x11')]={};}this[_0xcb84('0xc')][_0x155d70][_0xcb84('0x11')][_0xcb84('0x12')]='disabled';this[_0xcb84('0xc')][_0x155d70][_0xcb84('0x11')][_0xcb84('0x23')]='';this[_0xcb84('0x24')](_0x155d70);}}}};EmailChannel[_0xcb84('0xe')][_0xcb84('0x1c')]=function(_0x2738fe,_0x478781){if(this[_0xcb84('0xc')][_0x2738fe]){this['mailAccounts'][_0x2738fe]['Imap'][_0xcb84('0x12')]=_0xcb84('0x25');this[_0xcb84('0xc')][_0x2738fe][_0xcb84('0x11')][_0xcb84('0x23')]=_0x478781[_0xcb84('0xf')];if(_0x478781[_0xcb84('0x26')]){this[_0xcb84('0xc')][_0x2738fe][_0xcb84('0x11')][_0xcb84('0x13')]=_0x478781[_0xcb84('0x26')][_0xcb84('0x13')];}return this['emit'](_0x2738fe);}};EmailChannel[_0xcb84('0xe')][_0xcb84('0x1e')]=function(_0x56c92d,_0x48312a){logger[_0xcb84('0xa')](_0xcb84('0x27'),_0x48312a['firstName'],_0x48312a[_0xcb84('0x28')],_0x48312a[_0xcb84('0x29')],_0x56c92d);if(this[_0xcb84('0xc')][_0x56c92d]){return mailAccount['notify'](_0x56c92d,_0x48312a)[_0xcb84('0x2a')](function(_0x38b6b4){if(_0x38b6b4){logger['info'](_0xcb84('0x2b'));}})[_0xcb84('0x2c')](function(_0x1de6f7){logger[_0xcb84('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xcb84('0x15')](_0x1de6f7));});}};EmailChannel[_0xcb84('0xe')][_0xcb84('0x20')]=function(_0x4d2862){if(this[_0xcb84('0xc')][_0x4d2862]&&this[_0xcb84('0xc')][_0x4d2862][_0xcb84('0x11')]){if(this[_0xcb84('0x1b')][this['mailAccounts'][_0x4d2862]['Imap']['id']]){delete this[_0xcb84('0x1b')][this['mailAccounts'][_0x4d2862]['Imap']['id']];}this[_0xcb84('0xc')][_0x4d2862][_0xcb84('0x11')][_0xcb84('0x2d')]=moment();this[_0xcb84('0x24')](_0x4d2862);}};EmailChannel[_0xcb84('0xe')][_0xcb84('0x22')]=function(_0x49c7d0,_0x14a402){if(this['mailAccounts'][_0x49c7d0]){this[_0xcb84('0xc')][_0x49c7d0][_0xcb84('0x11')]['status']='error';this[_0xcb84('0xc')][_0x49c7d0][_0xcb84('0x11')][_0xcb84('0x23')]=_0x14a402;return this['emit'](_0x49c7d0);}};EmailChannel[_0xcb84('0xe')]['sendMail']=function(_0x5d2388,_0x250bf5){return this[_0xcb84('0xd')][_0xcb84('0x2e')](_0x5d2388,_0x250bf5);};EmailChannel[_0xcb84('0xe')][_0xcb84('0x2f')]=function(_0x8cc1b){var _0x426682=this;if(this[_0xcb84('0xc')][_0x8cc1b['id']]){if(_[_0xcb84('0x14')](this[_0xcb84('0xc')][_0x8cc1b['id']][_0xcb84('0x30')])){this[_0xcb84('0xc')][_0x8cc1b['id']]['Smtp']={};}this[_0xcb84('0xc')][_0x8cc1b['id']][_0xcb84('0x30')]['lastSync']=moment();return new BPromise(function(_0x1b6b24,_0x2b13f0){return _0x426682[_0xcb84('0xd')]['verify'](_0x8cc1b)[_0xcb84('0x2a')](function(_0x29bdfe){_0x426682[_0xcb84('0xc')][_0x8cc1b['id']][_0xcb84('0x30')][_0xcb84('0x12')]=_0xcb84('0x31');_0x426682[_0xcb84('0xc')][_0x8cc1b['id']][_0xcb84('0x30')][_0xcb84('0x23')]='';_0x426682[_0xcb84('0x24')](_0x8cc1b['id']);_0x1b6b24(_0x29bdfe);})['catch'](function(_0x52b435){_0x426682[_0xcb84('0xc')][_0x8cc1b['id']][_0xcb84('0x30')][_0xcb84('0x12')]=_0xcb84('0x21');_0x426682[_0xcb84('0xc')][_0x8cc1b['id']][_0xcb84('0x30')]['messageStatus']=_0x52b435;_0x426682[_0xcb84('0x24')](_0x8cc1b['id']);_0x2b13f0(_0x52b435);});});}return this['smtp'][_0xcb84('0x32')](_0x8cc1b);};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 6ebcbf9..d13ed7a 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 _0xad8a=['mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','error','body','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','EventEmitter','../../../config/logger','email'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xad8a,0xb0));var _0xaad8=function(_0x29375e,_0x332ffc){_0x29375e=_0x29375e-0x0;var _0x48354b=_0xad8a[_0x29375e];return _0x48354b;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var Imap=require(_0xaad8('0x2'));var simpleParser=require(_0xaad8('0x3'))[_0xaad8('0x4')];var Iconv=require('iconv')[_0xaad8('0x5')];var EventEmitter=require(_0xaad8('0x6'))[_0xaad8('0x7')];var utils=require('./utils');var logger=require(_0xaad8('0x8'))(_0xaad8('0x9'));function EmailImap(_0x22c799,_0xeb5d15){this[_0xaad8('0xa')]=_0x22c799[_0xaad8('0xa')];this[_0xaad8('0xb')]=this[_0xaad8('0xc')](_0x22c799,_0xeb5d15);this[_0xaad8('0x2')]=new Imap(this[_0xaad8('0xb')]);this['imap']['once'](_0xaad8('0xd'),this[_0xaad8('0xe')][_0xaad8('0xf')](this));this[_0xaad8('0x2')][_0xaad8('0x10')](_0xaad8('0x11'),this[_0xaad8('0x12')][_0xaad8('0xf')](this));this[_0xaad8('0x2')]['on']('error',this[_0xaad8('0x13')][_0xaad8('0xf')](this));this[_0xaad8('0x2')][_0xaad8('0x14')]();}util[_0xaad8('0x15')](EmailImap,EventEmitter);EmailImap[_0xaad8('0x16')][_0xaad8('0xc')]=function(_0x357bf6,_0x1c70d3){var _0x4372fc={'connTimeout':_0x357bf6[_0xaad8('0x17')]?_0x357bf6[_0xaad8('0x17')]*0x3e8:0x2710,'authTimeout':_0x357bf6[_0xaad8('0x18')]?_0x357bf6['authTimeout']*0x3e8:0x1388};if(_0x357bf6[_0xaad8('0x19')]){_0x4372fc[_0xaad8('0x1a')]=_0x357bf6['user'];if(_0x357bf6[_0xaad8('0x1b')]){_0x4372fc[_0xaad8('0x1c')]=utils[_0xaad8('0x1d')](_0x357bf6[_0xaad8('0x1e')][_0xaad8('0x1f')],_0x357bf6[_0xaad8('0x1a')]);}else{_0x4372fc['password']=_0x357bf6[_0xaad8('0x20')];}}else{if(_0x357bf6[_0xaad8('0x21')]){_0x4372fc['user']=_0x357bf6[_0xaad8('0x1a')];_0x4372fc['password']=_0x357bf6[_0xaad8('0x20')];}}_0x4372fc[_0xaad8('0x9')]=_0x1c70d3||_0x357bf6[_0xaad8('0x1a')]||_0xaad8('0x22');_0x4372fc['host']=_0x357bf6[_0xaad8('0x23')];_0x4372fc[_0xaad8('0x24')]=_0x357bf6['port']||0x3e1;if(_0x357bf6[_0xaad8('0x25')]){_0x4372fc[_0xaad8('0x25')]=!![];}else{_0x4372fc[_0xaad8('0x25')]=![];_0x4372fc['autotls']='required';}return _0x4372fc;};EmailImap[_0xaad8('0x16')][_0xaad8('0xe')]=function(){this[_0xaad8('0x2')][_0xaad8('0x26')](this[_0xaad8('0xa')],![],this[_0xaad8('0x27')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')][_0xaad8('0x27')]=function(_0xba9919,_0x1bbac4){if(_0xba9919){this[_0xaad8('0x13')](_0xba9919,!![]);}else{this[_0xaad8('0x28')](_0xaad8('0x29'),_0x1bbac4);this[_0xaad8('0x2a')]();}};EmailImap['prototype'][_0xaad8('0x2b')]=function(_0x94e799){if(_0x94e799){this[_0xaad8('0x13')](_0x94e799,!![]);}else{this['imap'][_0xaad8('0x11')]();}};EmailImap[_0xaad8('0x16')][_0xaad8('0x2a')]=function(){this[_0xaad8('0x2')][_0xaad8('0x2c')](['UNSEEN'],this[_0xaad8('0x2d')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')][_0xaad8('0x2d')]=function(_0x151c26,_0x5bd911){if(_0x151c26){this[_0xaad8('0x13')](_0x151c26,!![]);}else{if(_0x5bd911[_0xaad8('0x2e')]){try{var _0x20ea82=this[_0xaad8('0x2')]['fetch'](_0x5bd911,{'bodies':'','markSeen':!![]});_0x20ea82['on'](_0xaad8('0x2f'),this[_0xaad8('0x30')][_0xaad8('0xf')](this));_0x20ea82[_0xaad8('0x10')](_0xaad8('0x31'),this['handleFetchError'][_0xaad8('0xf')](this));_0x20ea82[_0xaad8('0x10')]('end',this['handleFetchEnd'][_0xaad8('0xf')](this));}catch(_0x307fa7){logger[_0xaad8('0x31')](_0x307fa7);}}else{this[_0xaad8('0x2')]['closeBox'](!![],this[_0xaad8('0x2b')][_0xaad8('0xf')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x2fb533){_0x2fb533['on'](_0xaad8('0x32'),this['handleMessageBody'][_0xaad8('0xf')](this));_0x2fb533['once']('attributes',this[_0xaad8('0x33')][_0xaad8('0xf')](this));_0x2fb533['once'](_0xaad8('0x11'),this[_0xaad8('0x34')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')]['handleMessageBody']=function(_0xe72f69){simpleParser(_0xe72f69,{'Iconv':Iconv},this[_0xaad8('0x35')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')][_0xaad8('0x33')]=function(){};EmailImap[_0xaad8('0x16')]['handleMessageEnd']=function(){};EmailImap[_0xaad8('0x16')][_0xaad8('0x35')]=function(_0xe55ab3,_0x5a35bb){if(_0xe55ab3){logger[_0xaad8('0x31')](_0xe55ab3);}else{var _0x39374b=this;utils[_0xaad8('0x36')](this[_0xaad8('0xb')],_0x5a35bb,function(_0x146518){_0x39374b[_0xaad8('0x28')](_0xaad8('0x9'),_0x146518);});}};EmailImap['prototype'][_0xaad8('0x37')]=function(){this[_0xaad8('0x2')][_0xaad8('0x38')](!![],this[_0xaad8('0x2b')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')]['handleFetchError']=function(_0x354735){this[_0xaad8('0x13')](_0x354735);this[_0xaad8('0x2')][_0xaad8('0x38')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0xaad8('0x12')]=function(){this[_0xaad8('0x28')](_0xaad8('0x11'));};EmailImap['prototype'][_0xaad8('0x13')]=function(_0x355fc2,_0x4af930){logger[_0xaad8('0x31')](_0xaad8('0x13'),this[_0xaad8('0xb')][_0xaad8('0x9')],JSON[_0xaad8('0x39')](_0x355fc2));var _0x17fb2b='';if(_0x355fc2){if(_0x355fc2[_0xaad8('0x3a')]){_0x17fb2b=_0x355fc2[_0xaad8('0x3a')];}else{for(var _0x150436 in _0x355fc2){if(_0x355fc2[_0xaad8('0x3b')](_0x150436)){_0x17fb2b+=_[_0xaad8('0x3c')](_0x150436)+':\x20'+_0x355fc2[_0x150436]+'\x0a';}}}}if(_0x4af930){this[_0xaad8('0x2')]['end']();}else{this['emit']('error',_0x17fb2b);this[_0xaad8('0x28')]('end');}};module[_0xaad8('0x3d')]=EmailImap; \ No newline at end of file +var _0x58d5=['handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','data5','password','authentication','anonymous@xcally.com','port','tls','autotls','required','openBox','handleOpenBox','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','error','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','handleFetchError','closeBox','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','getAccount','account','once','ready','handleReady','bind','end'];(function(_0xb2778f,_0x5ec03e){var _0x5029a4=function(_0x307ef1){while(--_0x307ef1){_0xb2778f['push'](_0xb2778f['shift']());}};_0x5029a4(++_0x5ec03e);}(_0x58d5,0xea));var _0x558d=function(_0xad885c,_0x3fd8bb){_0xad885c=_0xad885c-0x0;var _0x3d3d45=_0x58d5[_0xad885c];return _0x3d3d45;};'use strict';var _=require('lodash');var util=require(_0x558d('0x0'));var Imap=require(_0x558d('0x1'));var simpleParser=require('mailparser')[_0x558d('0x2')];var Iconv=require(_0x558d('0x3'))[_0x558d('0x4')];var EventEmitter=require(_0x558d('0x5'))[_0x558d('0x6')];var utils=require(_0x558d('0x7'));var logger=require(_0x558d('0x8'))(_0x558d('0x9'));function EmailImap(_0x14b038,_0x2fdff8){this[_0x558d('0xa')]=_0x14b038[_0x558d('0xa')];this['account']=this[_0x558d('0xb')](_0x14b038,_0x2fdff8);this[_0x558d('0x1')]=new Imap(this[_0x558d('0xc')]);this[_0x558d('0x1')][_0x558d('0xd')](_0x558d('0xe'),this[_0x558d('0xf')][_0x558d('0x10')](this));this['imap'][_0x558d('0xd')](_0x558d('0x11'),this[_0x558d('0x12')]['bind'](this));this['imap']['on']('error',this[_0x558d('0x13')]['bind'](this));this[_0x558d('0x1')][_0x558d('0x14')]();}util[_0x558d('0x15')](EmailImap,EventEmitter);EmailImap[_0x558d('0x16')][_0x558d('0xb')]=function(_0x287caf,_0x55c0f1){var _0x1c5c93={'connTimeout':_0x287caf[_0x558d('0x17')]?_0x287caf[_0x558d('0x17')]*0x3e8:0x2710,'authTimeout':_0x287caf[_0x558d('0x18')]?_0x287caf[_0x558d('0x18')]*0x3e8:0x1388};if(_0x287caf[_0x558d('0x19')]){_0x1c5c93[_0x558d('0x1a')]=_0x287caf[_0x558d('0x1a')];if(_0x287caf[_0x558d('0x1b')]){_0x1c5c93[_0x558d('0x1c')]=utils['generateXOAuth2Token'](_0x287caf['CloudProvider'][_0x558d('0x1d')],_0x287caf['user']);}else{_0x1c5c93[_0x558d('0x1e')]=_0x287caf[_0x558d('0x1e')];}}else{if(_0x287caf[_0x558d('0x1f')]){_0x1c5c93[_0x558d('0x1a')]=_0x287caf[_0x558d('0x1a')];_0x1c5c93[_0x558d('0x1e')]=_0x287caf[_0x558d('0x1e')];}}_0x1c5c93[_0x558d('0x9')]=_0x55c0f1||_0x287caf[_0x558d('0x1a')]||_0x558d('0x20');_0x1c5c93['host']=_0x287caf['host'];_0x1c5c93[_0x558d('0x21')]=_0x287caf[_0x558d('0x21')]||0x3e1;if(_0x287caf[_0x558d('0x22')]){_0x1c5c93[_0x558d('0x22')]=!![];}else{_0x1c5c93[_0x558d('0x22')]=![];_0x1c5c93[_0x558d('0x23')]=_0x558d('0x24');}return _0x1c5c93;};EmailImap[_0x558d('0x16')][_0x558d('0xf')]=function(){this[_0x558d('0x1')][_0x558d('0x25')](this[_0x558d('0xa')],![],this[_0x558d('0x26')][_0x558d('0x10')](this));};EmailImap[_0x558d('0x16')][_0x558d('0x26')]=function(_0x1cb252,_0x138542){if(_0x1cb252){this['handleError'](_0x1cb252,!![]);}else{this['emit'](_0x558d('0x27'),_0x138542);this[_0x558d('0x28')]();}};EmailImap['prototype'][_0x558d('0x29')]=function(_0x5a5393){if(_0x5a5393){this[_0x558d('0x13')](_0x5a5393,!![]);}else{this[_0x558d('0x1')][_0x558d('0x11')]();}};EmailImap[_0x558d('0x16')][_0x558d('0x28')]=function(){this['imap']['search']([_0x558d('0x2a')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x558d('0x16')][_0x558d('0x2b')]=function(_0x5b7c36,_0x548672){if(_0x5b7c36){this['handleError'](_0x5b7c36,!![]);}else{if(_0x548672[_0x558d('0x2c')]){try{var _0xb7f350=this[_0x558d('0x1')][_0x558d('0x2d')](_0x548672,{'bodies':'','markSeen':!![]});_0xb7f350['on'](_0x558d('0x2e'),this['handleFetchMessage'][_0x558d('0x10')](this));_0xb7f350['once'](_0x558d('0x2f'),this['handleFetchError']['bind'](this));_0xb7f350['once'](_0x558d('0x11'),this['handleFetchEnd']['bind'](this));}catch(_0x22fed7){logger[_0x558d('0x2f')](_0x22fed7);}}else{this['imap']['closeBox'](!![],this[_0x558d('0x29')]['bind'](this));}}};EmailImap[_0x558d('0x16')]['handleFetchMessage']=function(_0x52c276){_0x52c276['on']('body',this[_0x558d('0x30')]['bind'](this));_0x52c276['once'](_0x558d('0x31'),this[_0x558d('0x32')][_0x558d('0x10')](this));_0x52c276[_0x558d('0xd')](_0x558d('0x11'),this[_0x558d('0x33')][_0x558d('0x10')](this));};EmailImap[_0x558d('0x16')][_0x558d('0x30')]=function(_0x2f95bb){simpleParser(_0x2f95bb,{'Iconv':Iconv},this[_0x558d('0x34')][_0x558d('0x10')](this));};EmailImap[_0x558d('0x16')]['handleMessageAttributes']=function(){};EmailImap[_0x558d('0x16')][_0x558d('0x33')]=function(){};EmailImap[_0x558d('0x16')][_0x558d('0x34')]=function(_0x43c8c1,_0xb04dfa){if(_0x43c8c1){logger[_0x558d('0x2f')](_0x43c8c1);}else{var _0x51ef25=this;utils[_0x558d('0x35')](this[_0x558d('0xc')],_0xb04dfa,function(_0x22a3a2){_0x51ef25['emit'](_0x558d('0x9'),_0x22a3a2);});}};EmailImap[_0x558d('0x16')][_0x558d('0x36')]=function(){this[_0x558d('0x1')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x558d('0x16')][_0x558d('0x37')]=function(_0x55c2b8){this[_0x558d('0x13')](_0x55c2b8);this['imap'][_0x558d('0x38')](!![],this[_0x558d('0x29')][_0x558d('0x10')](this));};EmailImap[_0x558d('0x16')][_0x558d('0x12')]=function(){this[_0x558d('0x39')](_0x558d('0x11'));};EmailImap[_0x558d('0x16')]['handleError']=function(_0x230e04,_0x1fff2a){logger[_0x558d('0x2f')]('handleError',this[_0x558d('0xc')][_0x558d('0x9')],JSON[_0x558d('0x3a')](_0x230e04));var _0xa1c8b0='';if(_0x230e04){if(_0x230e04['textCode']){_0xa1c8b0=_0x230e04[_0x558d('0x3b')];}else{for(var _0x14d7e6 in _0x230e04){if(_0x230e04[_0x558d('0x3c')](_0x14d7e6)){_0xa1c8b0+=_[_0x558d('0x3d')](_0x14d7e6)+':\x20'+_0x230e04[_0x14d7e6]+'\x0a';}}}}if(_0x1fff2a){this[_0x558d('0x1')][_0x558d('0x11')]();}else{this[_0x558d('0x39')](_0x558d('0x2f'),_0xa1c8b0);this[_0x558d('0x39')](_0x558d('0x11'));}};module[_0x558d('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 0f1119b..284fc99 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 _0xe1b5=['verify','createTransport','nodemailer-plugin-inline-base64','use','compile','toString'];(function(_0x223400,_0x29a1e0){var _0xcec92e=function(_0x20231f){while(--_0x20231f){_0x223400['push'](_0x223400['shift']());}};_0xcec92e(++_0x29a1e0);}(_0xe1b5,0x1ca));var _0x5e1b=function(_0x302f55,_0x31872f){_0x302f55=_0x302f55-0x0;var _0x55ca94=_0xe1b5[_0x302f55];return _0x55ca94;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x5e1b('0x0'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x52eddf,_0x4db86e){return new Promise(function(_0x25f6f7,_0x806c1f){var _0x4c54ef=nodemailer['createTransport'](_0x52eddf);_0x4c54ef[_0x5e1b('0x1')](_0x5e1b('0x2'),inlineBase64());_0x4c54ef['sendMail'](_0x4db86e,function(_0xed1c89,_0x5c69c5){if(_0xed1c89){_0x806c1f(_0xed1c89[_0x5e1b('0x3')]());}else{_0x25f6f7(_0x5c69c5);}});});};EmailSmtp['prototype'][_0x5e1b('0x4')]=function(_0x1965d3){return new Promise(function(_0x35e765,_0x285385){var _0x1a3c54=nodemailer[_0x5e1b('0x5')](_0x1965d3);_0x1a3c54['verify'](function(_0x372bdc,_0x166b97){if(_0x372bdc){_0x285385(_0x372bdc[_0x5e1b('0x3')]());}else{if(_0x166b97){_0x35e765(_0x166b97);}else{_0x285385('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x8c4a=['compile','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x5afaf0,_0x1fe683){var _0x1c9e43=function(_0x404d02){while(--_0x404d02){_0x5afaf0['push'](_0x5afaf0['shift']());}};_0x1c9e43(++_0x1fe683);}(_0x8c4a,0xe0));var _0xa8c4=function(_0x3681cf,_0x45aa03){_0x3681cf=_0x3681cf-0x0;var _0x2ee1dc=_0x8c4a[_0x3681cf];return _0x2ee1dc;};'use strict';var nodemailer=require(_0xa8c4('0x0'));var inlineBase64=require(_0xa8c4('0x1'));function EmailSmtp(){}EmailSmtp[_0xa8c4('0x2')][_0xa8c4('0x3')]=function(_0x49cbac,_0x58e6bc){return new Promise(function(_0x35eae6,_0x568d90){var _0x4ff533=nodemailer[_0xa8c4('0x4')](_0x49cbac);_0x4ff533[_0xa8c4('0x5')](_0xa8c4('0x6'),inlineBase64());_0x4ff533['sendMail'](_0x58e6bc,function(_0x4f8482,_0x3b7675){if(_0x4f8482){_0x568d90(_0x4f8482['toString']());}else{_0x35eae6(_0x3b7675);}});});};EmailSmtp[_0xa8c4('0x2')][_0xa8c4('0x7')]=function(_0x442740){return new Promise(function(_0x5d06b4,_0x534af3){var _0x3ecd3b=nodemailer[_0xa8c4('0x4')](_0x442740);_0x3ecd3b[_0xa8c4('0x7')](function(_0x4f049a,_0x184c4b){if(_0x4f049a){_0x534af3(_0x4f049a['toString']());}else{if(_0x184c4b){_0x5d06b4(_0x184c4b);}else{_0x534af3(_0xa8c4('0x8'));}}});});};module[_0xa8c4('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 7ced770..d65876e 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 _0x5c95=['forEach','filename','_IMG','\x20[Attachment:\x20','body','textAsHtml','message','originTo','originCc','bcc','attach','type','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','user=','auth=Bearer\x20','base64','lodash','randomstring','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','test','html','replace','includes','0x1?_0x377b21[_0x55c9('0x10')](0x0,-0x1)[_0x55c9('0x11')]('\x20'):_0x598dbf[_0x55c9('0xc')];}return _0x55c9('0x12');}function getLastName(_0x5700ce){var _0x3ab8a4=_[_0x55c9('0x6')](_0x5700ce[_0x55c9('0x7')]);if(_0x3ab8a4&&_0x3ab8a4[_0x55c9('0xc')]){var _0x58cbbf=_0x3ab8a4[_0x55c9('0xc')]['split'](/\s+/);return _0x58cbbf['length']>0x1?_0x58cbbf[_0x55c9('0x13')]():'';}return'';}function getMails(_0x55c7cb,_0x21d23d){var _0x9e9a7c='';for(var _0x3ee95d=0x0;_0x3ee95d<_0x21d23d[_0x55c9('0x7')]['length'];_0x3ee95d+=0x1){if(_0x21d23d['value'][_0x3ee95d][_0x55c9('0x8')]!==_0x55c7cb){if(!_[_0x55c9('0x14')](_0x9e9a7c)){_0x9e9a7c+=',';}_0x9e9a7c+=_0x21d23d['value'][_0x3ee95d][_0x55c9('0xc')]||_0x21d23d[_0x55c9('0x7')][_0x3ee95d][_0x55c9('0x8')]||'';_0x9e9a7c+='\x20<';_0x9e9a7c+=_0x21d23d['value'][_0x3ee95d][_0x55c9('0x8')]?_0x21d23d[_0x55c9('0x7')][_0x3ee95d][_0x55c9('0x8')]:_0x55c9('0x9')+random[_0x55c9('0xa')](0x6)+_0x55c9('0xb');_0x9e9a7c+='>';}}return _0x9e9a7c;}function parseEmail(_0x3a2e43,_0x5911a7,_0x12f09b){if(_0x5911a7['html']){var _0xea714c=/)<[^<]*)*<\/script>/gi;while(_0xea714c[_0x55c9('0x15')](_0x5911a7[_0x55c9('0x16')])){_0x5911a7[_0x55c9('0x16')]=_0x5911a7[_0x55c9('0x16')][_0x55c9('0x17')](_0xea714c,'');}if(_0x5911a7[_0x55c9('0x16')][_0x55c9('0x18')](_0x55c9('0x19'))){var _0x2f4a8e=[];_0x5911a7[_0x55c9('0x1a')][_0x55c9('0x1b')](_0x451fc4=>{_0x2f4a8e['push'](_0x451fc4[_0x55c9('0x1c')]);});var _0x134785=/]+>/g;var _0x12035c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2f41d0=_0x5911a7[_0x55c9('0x16')][_0x55c9('0x17')](_0x12035c,'_SRC');var _0x3a79f7=_0x2f41d0[_0x55c9('0x17')](_0x134785,'_IMG');for(let _0x3a63cb=0x0;_0x3a63cb<_0x2f4a8e['length'];_0x3a63cb++){var _0x5c254d=_0x3a79f7['replace'](_0x55c9('0x1d'),_0x55c9('0x1e')+_0x2f4a8e[_0x3a63cb]+'\x20]');_0x3a79f7=_0x5c254d;}_0x5911a7[_0x55c9('0x16')]=_0x3a79f7;}_0x12f09b[_0x55c9('0x1f')]=_0x5911a7[_0x55c9('0x16')];}else{_0x12f09b[_0x55c9('0x1f')]=_0x5911a7[_0x55c9('0x20')];}if(_0x12f09b[_0x55c9('0x1f')]){_0x12f09b['body']=_0x12f09b[_0x55c9('0x1f')][_0x55c9('0x17')](/0x0){var _0xaeb766=[_0x55c9('0x31'),_0x55c9('0x32'),_0x55c9('0x33')];for(var _0x1d2c1e=0x0;_0x1d2c1e<_0x5911a7[_0x55c9('0x30')]['length'];_0x1d2c1e++){var _0x3b8999=_[_0x55c9('0xd')](_0xaeb766,_0x5911a7[_0x55c9('0x30')][_0x1d2c1e][_0x55c9('0x34')]);if(_0x3b8999>=0x0){_0x12f09b[_0x55c9('0x35')]=!![];}}}return _0x12f09b;}exports[_0x55c9('0x36')]=function(_0x4c3eb3,_0x37cf05,_0x3ed5b5){var _0x229617={'from':getAddress(_0x37cf05[_0x55c9('0x37')]),'firstName':getFirstName(_0x37cf05[_0x55c9('0x37')]),'lastName':getLastName(_0x37cf05[_0x55c9('0x37')]),'mapKey':_0x55c9('0x4'),'message':{'from':getMails(_0x4c3eb3[_0x55c9('0x4')],_0x37cf05[_0x55c9('0x37')]),'to':_0x4c3eb3[_0x55c9('0x4')],'cc':'','subject':_0x37cf05[_0x55c9('0x38')]||'','messageId':_0x37cf05[_0x55c9('0x39')],'inReplyTo':_0x37cf05['inReplyTo'],'sentAt':moment(_0x37cf05[_0x55c9('0x3a')])['format'](_0x55c9('0x3b')),'attach':![],'attachments':[]}};if(!_0x37cf05[_0x55c9('0x16')]&&!_0x37cf05[_0x55c9('0x20')]){var _0x3cf6e5=_[_0x55c9('0x3c')](_0x37cf05['attachments'],{'contentType':'application/ms-tnef'});if(_0x3cf6e5['length']){logger[_0x55c9('0x3d')](util[_0x55c9('0x29')](_0x55c9('0x3e'),_0x37cf05['messageId']));tnef[_0x55c9('0x3f')](_[_0x55c9('0x40')](_0x3cf6e5)[_0x55c9('0x41')],function(_0x33994a,_0x2dfd8d){if(_0x2dfd8d){_0x37cf05[_0x55c9('0x16')]=_0x2dfd8d[_0x55c9('0x42')]||'

Empty\x20message

';if(_0x2dfd8d[_0x55c9('0x43')]){for(var _0x123407=0x0;_0x123407<_0x2dfd8d['Attachments'][_0x55c9('0xf')];_0x123407++){var _0x925ddf=_0x2dfd8d[_0x55c9('0x43')][_0x123407];_0x229617['message'][_0x55c9('0x1a')][_0x55c9('0x2e')]({'filename':_0x925ddf[_0x55c9('0x44')],'content':Buffer[_0x55c9('0x37')](_0x925ddf[_0x55c9('0x45')])});}}}_0x3ed5b5(parseEmail(_0x4c3eb3,_0x37cf05,_0x229617));});}else{_0x37cf05[_0x55c9('0x16')]=_0x55c9('0x46');_0x3ed5b5(parseEmail(_0x4c3eb3,_0x37cf05,_0x229617));}}else{_0x3ed5b5(parseEmail(_0x4c3eb3,_0x37cf05,_0x229617));}};exports[_0x55c9('0x47')]=function(_0x2257c2,_0x34b51a){var _0x184ebc=[_0x55c9('0x48')+(_0x34b51a||''),_0x55c9('0x49')+_0x2257c2,'',''];return Buffer[_0x55c9('0x37')](_0x184ebc['join'](''),'utf-8')['toString'](_0x55c9('0x4a'));}; \ No newline at end of file +var _0x3ddb=['YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','@xcally.com','name','substring','indexOf','length','slice','Anonymous','split','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x98d789[_0xb3dd('0xf')](0x0,-0x1)['join']('\x20'):_0x1ddffb[_0xb3dd('0xb')];}return _0xb3dd('0x10');}function getLastName(_0x20842f){var _0x1be536=_[_0xb3dd('0x6')](_0x20842f['value']);if(_0x1be536&&_0x1be536[_0xb3dd('0xb')]){var _0x40b0ab=_0x1be536['name'][_0xb3dd('0x11')](/\s+/);return _0x40b0ab['length']>0x1?_0x40b0ab['pop']():'';}return'';}function getMails(_0x4c3f57,_0x45be85){var _0x39daab='';for(var _0x358699=0x0;_0x358699<_0x45be85[_0xb3dd('0x7')][_0xb3dd('0xe')];_0x358699+=0x1){if(_0x45be85[_0xb3dd('0x7')][_0x358699]['address']!==_0x4c3f57){if(!_[_0xb3dd('0x12')](_0x39daab)){_0x39daab+=',';}_0x39daab+=_0x45be85[_0xb3dd('0x7')][_0x358699]['name']||_0x45be85[_0xb3dd('0x7')][_0x358699]['address']||'';_0x39daab+='\x20<';_0x39daab+=_0x45be85['value'][_0x358699][_0xb3dd('0x8')]?_0x45be85[_0xb3dd('0x7')][_0x358699][_0xb3dd('0x8')]:_0xb3dd('0x9')+random['generate'](0x6)+_0xb3dd('0xa');_0x39daab+='>';}}return _0x39daab;}function parseEmail(_0xf85d34,_0x282283,_0x2a8001){if(_0x282283[_0xb3dd('0x13')]){var _0x241967=/)<[^<]*)*<\/script>/gi;while(_0x241967[_0xb3dd('0x14')](_0x282283[_0xb3dd('0x13')])){_0x282283[_0xb3dd('0x13')]=_0x282283[_0xb3dd('0x13')][_0xb3dd('0x15')](_0x241967,'');}if(_0x282283[_0xb3dd('0x13')][_0xb3dd('0x16')](_0xb3dd('0x17'))){var _0x414989=[];_0x282283[_0xb3dd('0x18')][_0xb3dd('0x19')](_0x3db1d6=>{_0x414989[_0xb3dd('0x1a')](_0x3db1d6[_0xb3dd('0x1b')]);});var _0x5b8558=/]+>/g;var _0x3a4470=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x43cfa8=_0x282283[_0xb3dd('0x13')][_0xb3dd('0x15')](_0x3a4470,_0xb3dd('0x1c'));var _0x18fe8f=_0x43cfa8[_0xb3dd('0x15')](_0x5b8558,_0xb3dd('0x1d'));for(let _0x5d883e=0x0;_0x5d883e<_0x414989[_0xb3dd('0xe')];_0x5d883e++){var _0x5043cc=_0x18fe8f['replace'](_0xb3dd('0x1d'),_0xb3dd('0x1e')+_0x414989[_0x5d883e]+_0xb3dd('0x1f'));_0x18fe8f=_0x5043cc;}_0x282283['html']=_0x18fe8f;}_0x2a8001['body']=_0x282283[_0xb3dd('0x13')];}else{_0x2a8001[_0xb3dd('0x20')]=_0x282283['textAsHtml'];}if(_0x2a8001['body']){_0x2a8001[_0xb3dd('0x20')]=_0x2a8001[_0xb3dd('0x20')][_0xb3dd('0x15')](/0x0){var _0x49cc34=['Auto-Submitted:\x20auto-replied',_0xb3dd('0x30'),'Precedence:\x20auto_reply'];for(var _0x2ce025=0x0;_0x2ce025<_0x282283[_0xb3dd('0x2f')][_0xb3dd('0xe')];_0x2ce025++){var _0x407941=_[_0xb3dd('0xd')](_0x49cc34,_0x282283[_0xb3dd('0x2f')][_0x2ce025][_0xb3dd('0x31')]);if(_0x407941>=0x0){_0x2a8001[_0xb3dd('0x32')]=!![];}}}return _0x2a8001;}exports[_0xb3dd('0x33')]=function(_0x16e8c7,_0x15ff15,_0x58ab1e){var _0xfaaeeb={'from':getAddress(_0x15ff15[_0xb3dd('0x34')]),'firstName':getFirstName(_0x15ff15['from']),'lastName':getLastName(_0x15ff15['from']),'mapKey':_0xb3dd('0x5'),'message':{'from':getMails(_0x16e8c7[_0xb3dd('0x5')],_0x15ff15[_0xb3dd('0x34')]),'to':_0x16e8c7['email'],'cc':'','subject':_0x15ff15[_0xb3dd('0x35')]||'','messageId':_0x15ff15[_0xb3dd('0x36')],'inReplyTo':_0x15ff15[_0xb3dd('0x37')],'sentAt':moment(_0x15ff15[_0xb3dd('0x38')])[_0xb3dd('0x27')](_0xb3dd('0x39')),'attach':![],'attachments':[]}};if(!_0x15ff15[_0xb3dd('0x13')]&&!_0x15ff15['textAsHtml']){var _0x4084e1=_['filter'](_0x15ff15[_0xb3dd('0x18')],{'contentType':_0xb3dd('0x3a')});if(_0x4084e1['length']){logger[_0xb3dd('0x3b')](util['format'](_0xb3dd('0x3c'),_0x15ff15[_0xb3dd('0x36')]));tnef[_0xb3dd('0x3d')](_['first'](_0x4084e1)['content'],function(_0x42ab00,_0x4d5d90){if(_0x4d5d90){_0x15ff15['html']=_0x4d5d90[_0xb3dd('0x3e')]||_0xb3dd('0x3f');if(_0x4d5d90['Attachments']){for(var _0x13fce4=0x0;_0x13fce4<_0x4d5d90['Attachments']['length'];_0x13fce4++){var _0x29bc19=_0x4d5d90[_0xb3dd('0x40')][_0x13fce4];_0xfaaeeb['message'][_0xb3dd('0x18')][_0xb3dd('0x1a')]({'filename':_0x29bc19['Title'],'content':Buffer[_0xb3dd('0x34')](_0x29bc19[_0xb3dd('0x41')])});}}}_0x58ab1e(parseEmail(_0x16e8c7,_0x15ff15,_0xfaaeeb));});}else{_0x15ff15[_0xb3dd('0x13')]='

Empty\x20message

';_0x58ab1e(parseEmail(_0x16e8c7,_0x15ff15,_0xfaaeeb));}}else{_0x58ab1e(parseEmail(_0x16e8c7,_0x15ff15,_0xfaaeeb));}};exports[_0xb3dd('0x42')]=function(_0x26ee9f,_0x29aa52){var _0x1a0334=['user='+(_0x29aa52||''),_0xb3dd('0x43')+_0x26ee9f,'',''];return Buffer[_0xb3dd('0x34')](_0x1a0334[_0xb3dd('0x2a')](''),_0xb3dd('0x44'))[_0xb3dd('0x45')](_0xb3dd('0x46'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 7211c4f..a117639 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 _0x8d3a=['Imap','Smtp','exports','name','Service','key','active'];(function(_0x4b7253,_0x40f708){var _0x29f09a=function(_0x18d91c){while(--_0x18d91c){_0x4b7253['push'](_0x4b7253['shift']());}};_0x29f09a(++_0x40f708);}(_0x8d3a,0x16f));var _0xa8d3=function(_0x48f32b,_0x579905){_0x48f32b=_0x48f32b-0x0;var _0x505f99=_0x8d3a[_0x48f32b];return _0x505f99;};'use strict';var _=require('lodash');function MailAccount(_0x1648d3){this['id']=_0x1648d3['id']||0x0;this[_0xa8d3('0x0')]=_0x1648d3[_0xa8d3('0x0')]||_0xa8d3('0x1');this['key']=_0x1648d3[_0xa8d3('0x2')]||'SERV';this['active']=_0x1648d3[_0xa8d3('0x3')]||![];this[_0xa8d3('0x4')]=_0x1648d3[_0xa8d3('0x4')]||[];this[_0xa8d3('0x5')]=_0x1648d3[_0xa8d3('0x5')]||[];}module[_0xa8d3('0x6')]=MailAccount; \ No newline at end of file +var _0x6c04=['Imap','Smtp','exports','lodash','name','Service','key','active'];(function(_0x5b0fcc,_0x449df1){var _0x16eb1e=function(_0x24a12f){while(--_0x24a12f){_0x5b0fcc['push'](_0x5b0fcc['shift']());}};_0x16eb1e(++_0x449df1);}(_0x6c04,0x193));var _0x46c0=function(_0x53d121,_0x10f9c6){_0x53d121=_0x53d121-0x0;var _0x3c547f=_0x6c04[_0x53d121];return _0x3c547f;};'use strict';var _=require(_0x46c0('0x0'));function MailAccount(_0x4ce1e8){this['id']=_0x4ce1e8['id']||0x0;this[_0x46c0('0x1')]=_0x4ce1e8[_0x46c0('0x1')]||_0x46c0('0x2');this[_0x46c0('0x3')]=_0x4ce1e8[_0x46c0('0x3')]||'SERV';this['active']=_0x4ce1e8[_0x46c0('0x4')]||![];this[_0x46c0('0x5')]=_0x4ce1e8['Imap']||[];this['Smtp']=_0x4ce1e8[_0x46c0('0x6')]||[];}module[_0x46c0('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 1171d2a..5eb75aa 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 _0x4056=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x5dbc67,_0x12dd29){var _0x8782a5=function(_0x6df0d8){while(--_0x6df0d8){_0x5dbc67['push'](_0x5dbc67['shift']());}};_0x8782a5(++_0x12dd29);}(_0x4056,0x75));var _0x6405=function(_0xb53fb1,_0x58a815){_0xb53fb1=_0xb53fb1-0x0;var _0x5579b5=_0x4056[_0xb53fb1];return _0x5579b5;};'use strict';var _=require(_0x6405('0x0'));var MailAccount=require(_0x6405('0x1'));var Realtime=function(){this[_0x6405('0x2')]={};};function freeIsNotKey(_0x490cf1,_0x447c0b,_0x10d810){var _0x4f99ae=_[_0x6405('0x3')](_0x490cf1,function(_0x1cd633,_0x3bbe29){return _0x1cd633[_0x10d810];});for(var _0x33cd52 in _0x447c0b){if(_0x447c0b[_0x6405('0x4')](_0x33cd52)){if(!_0x4f99ae[_0x33cd52]){delete _0x447c0b[_0x33cd52];}}}}Realtime[_0x6405('0x5')][_0x6405('0x6')]=function(_0x15e53,_0x1f0bbf){for(var _0x1d6ba7 in _0x1f0bbf){if(_0x15e53['hasOwnProperty'](_0x1d6ba7)){_0x15e53[_0x1d6ba7]=_0x1f0bbf[_0x1d6ba7];}}};Realtime['prototype'][_0x6405('0x7')]=function(){var _0x50968d=this;return function(_0x35b77a){if(_0x35b77a){freeIsNotKey(_0x35b77a,_0x50968d[_0x6405('0x2')],'id');for(var _0xf66479=0x0,_0x347537={},_0x23adce={};_0xf66479<_0x35b77a[_0x6405('0x8')];_0xf66479+=0x1){_0x347537=_0x35b77a[_0xf66479];if(_[_0x6405('0x9')](_0x50968d[_0x6405('0x2')][_0x347537['id']])){_0x50968d[_0x6405('0x2')][_0x347537['id']]=new MailAccount(_0x347537);}else{_[_0x6405('0xa')](_0x50968d[_0x6405('0x2')][_0x347537['id']],_0x347537);}}}return _0x50968d[_0x6405('0x2')];};};module[_0x6405('0xb')]=Realtime; \ No newline at end of file +var _0x0d27=['length','mailAccounts','merge','lodash','../model/mailAccount','mapKeys','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d27,0x150));var _0x70d2=function(_0x460e76,_0xa429bf){_0x460e76=_0x460e76-0x0;var _0x2a906c=_0x0d27[_0x460e76];return _0x2a906c;};'use strict';var _=require(_0x70d2('0x0'));var MailAccount=require(_0x70d2('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1963c2,_0x1cbd93,_0x450989){var _0x28124c=_[_0x70d2('0x2')](_0x1963c2,function(_0x4f1e56,_0x1230bb){return _0x4f1e56[_0x450989];});for(var _0x80be02 in _0x1cbd93){if(_0x1cbd93['hasOwnProperty'](_0x80be02)){if(!_0x28124c[_0x80be02]){delete _0x1cbd93[_0x80be02];}}}}Realtime[_0x70d2('0x3')][_0x70d2('0x4')]=function(_0x72dc8c,_0x3d53aa){for(var _0x4c26be in _0x3d53aa){if(_0x72dc8c['hasOwnProperty'](_0x4c26be)){_0x72dc8c[_0x4c26be]=_0x3d53aa[_0x4c26be];}}};Realtime[_0x70d2('0x3')][_0x70d2('0x5')]=function(){var _0x557ece=this;return function(_0x2ff1d2){if(_0x2ff1d2){freeIsNotKey(_0x2ff1d2,_0x557ece['mailAccounts'],'id');for(var _0x79637f=0x0,_0x46389d={},_0x8be179={};_0x79637f<_0x2ff1d2[_0x70d2('0x6')];_0x79637f+=0x1){_0x46389d=_0x2ff1d2[_0x79637f];if(_['isUndefined'](_0x557ece[_0x70d2('0x7')][_0x46389d['id']])){_0x557ece[_0x70d2('0x7')][_0x46389d['id']]=new MailAccount(_0x46389d);}else{_[_0x70d2('0x8')](_0x557ece[_0x70d2('0x7')][_0x46389d['id']],_0x46389d);}}}return _0x557ece['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 128b86c..f502b77 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 _0x4af9=['active','key','ListId','MailServerIn','Imap','CloudProvider','type','data5','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','provider','service','email'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4af9,0x12c));var _0x94af=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4af9[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x94af('0x0'));exports[_0x94af('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x94af('0x2'),_0x94af('0x3'),_0x94af('0x4'),_0x94af('0x5'),_0x94af('0x6'),_0x94af('0x7'),_0x94af('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x94af('0x9'),'as':_0x94af('0xa'),'include':[{'model':_0x94af('0xb'),'attributes':['id',_0x94af('0x2'),'service',_0x94af('0xc'),_0x94af('0xd')],'as':_0x94af('0xb')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x94af('0xb'),'attributes':['id',_0x94af('0x2'),_0x94af('0x4'),_0x94af('0xc'),_0x94af('0xd')],'as':_0x94af('0xb')}]}]},'log':'getMailAccount'});};};exports[_0x94af('0xe')]=function(_0x3a1610,_0x5a67e5){return client[_0x94af('0xf')](_0x94af('0x10'),{'account':{'id':_0x3a1610},'body':_0x5a67e5,'log':_0x94af('0x10')});}; \ No newline at end of file +var _0x287e=['CloudProvider','data5','MailServerOut','Smtp','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','email','active','ListId','TemplateId'];(function(_0x29485b,_0x1aa6da){var _0x4c1de6=function(_0x4fc8ab){while(--_0x4fc8ab){_0x29485b['push'](_0x29485b['shift']());}};_0x4c1de6(++_0x1aa6da);}(_0x287e,0x1e3));var _0xe287=function(_0x188555,_0x12ef12){_0x188555=_0x188555-0x0;var _0xcbc876=_0x287e[_0x188555];return _0xcbc876;};'use strict';var client=require(_0xe287('0x0'));exports[_0xe287('0x1')]=function(){return function(){return client[_0xe287('0x2')](_0xe287('0x3'),{'options':{'attributes':['id',_0xe287('0x4'),_0xe287('0x5'),_0xe287('0x6'),_0xe287('0x7'),_0xe287('0x8'),'key',_0xe287('0x9'),_0xe287('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0xe287('0xb'),'attributes':['id','name','service','type',_0xe287('0xc')],'as':_0xe287('0xb')}]},{'model':_0xe287('0xd'),'as':_0xe287('0xe'),'include':[{'model':_0xe287('0xb'),'attributes':['id',_0xe287('0x4'),_0xe287('0x6'),_0xe287('0xf'),_0xe287('0xc')],'as':_0xe287('0xb')}]}]},'log':_0xe287('0x10')});};};exports[_0xe287('0x11')]=function(_0x515fc1,_0x69a860){return client['Request'](_0xe287('0x12'),{'account':{'id':_0x515fc1},'body':_0x69a860,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4260d4e..3e3a3ff 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 _0xdd6e=['GetSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x51655a,_0x428e93){var _0x47bc17=function(_0x453e9f){while(--_0x453e9f){_0x51655a['push'](_0x51655a['shift']());}};_0x47bc17(++_0x428e93);}(_0xdd6e,0xe5));var _0xedd6=function(_0x5baaf7,_0x3fa8b0){_0x5baaf7=_0x5baaf7-0x0;var _0x4406c6=_0xdd6e[_0x5baaf7];return _0x4406c6;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xedd6('0x0')](_0xedd6('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xedd6('0x2')]},'log':_0xedd6('0x3')});}; \ No newline at end of file +var _0x1628=['ShowSetting','loginMailFrequency','../client','Request'];(function(_0x1e115e,_0x757143){var _0x4e99c0=function(_0x57722d){while(--_0x57722d){_0x1e115e['push'](_0x1e115e['shift']());}};_0x4e99c0(++_0x757143);}(_0x1628,0x96));var _0x8162=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x1628[_0x468b0f];return _0x3e74d9;};'use strict';var client=require(_0x8162('0x0'));exports['getSettings']=function(){return client[_0x8162('0x1')](_0x8162('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8162('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 87d4bed..1f8b465 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 e9841bf..3650606 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 _0xb95e=['express','ioredis','createServer','timeout','listen','polling','redis','defaults','localhost','adapter','../../config/triggers','../../config/socketio','default','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http'];(function(_0x612d75,_0x429c60){var _0x42c85f=function(_0x2ba28f){while(--_0x2ba28f){_0x612d75['push'](_0x612d75['shift']());}};_0x42c85f(++_0x429c60);}(_0xb95e,0x132));var _0xeb95=function(_0x156193,_0x40ad2a){_0x156193=_0x156193-0x0;var _0x472822=_0xb95e[_0x156193];return _0x472822;};'use strict';var _=require(_0xeb95('0x0'));var http=require(_0xeb95('0x1'));var express=require(_0xeb95('0x2'));var sticky=require('sticky-session');var Redis=require(_0xeb95('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xeb95('0x4')](app);server[_0xeb95('0x5')]=0xdbba0;if(sticky[_0xeb95('0x6')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xeb95('0x7')]});config[_0xeb95('0x8')]=_[_0xeb95('0x9')](config[_0xeb95('0x8')],{'host':_0xeb95('0xa'),'port':0x18eb});socketio[_0xeb95('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xeb95('0xc'))['default']();require(_0xeb95('0xd'))[_0xeb95('0xe')](socketio);require(_0xeb95('0xf'))[_0xeb95('0xe')](app);require('../../routes')[_0xeb95('0xe')](app);}else{server[_0xeb95('0x10')](_0xeb95('0x11'),function(){console[_0xeb95('0x12')](_0xeb95('0x13'),config[_0xeb95('0x14')]);});}exports=module[_0xeb95('0x15')]=app; \ No newline at end of file +var _0x6a47=['exports','http','express','sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x4eba02,_0x2ee20a){var _0x4ca0c1=function(_0x54b8ae){while(--_0x54b8ae){_0x4eba02['push'](_0x4eba02['shift']());}};_0x4ca0c1(++_0x2ee20a);}(_0x6a47,0x187));var _0x76a4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6a47[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var http=require(_0x76a4('0x0'));var express=require(_0x76a4('0x1'));var sticky=require(_0x76a4('0x2'));var Redis=require('ioredis');var config=require(_0x76a4('0x3'));var app=express();var server=http[_0x76a4('0x4')](app);server[_0x76a4('0x5')]=0xdbba0;if(sticky[_0x76a4('0x6')](server,config[_0x76a4('0x7')])){var socketio=require(_0x76a4('0x8'))(server,{'transports':[_0x76a4('0x9'),_0x76a4('0xa')]});config[_0x76a4('0xb')]=_[_0x76a4('0xc')](config[_0x76a4('0xb')],{'host':_0x76a4('0xd'),'port':0x18eb});socketio[_0x76a4('0xe')](require(_0x76a4('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x76a4('0xb')])}));require(_0x76a4('0x10'))['default']();require(_0x76a4('0x11'))[_0x76a4('0x12')](socketio);require(_0x76a4('0x13'))['default'](app);require(_0x76a4('0x14'))[_0x76a4('0x12')](app);}else{server[_0x76a4('0x15')](_0x76a4('0x16'),function(){console[_0x76a4('0x17')](_0x76a4('0x18'),config['port']);});}exports=module[_0x76a4('0x19')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 37597f8..2824733 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 _0x2d85=['catch','exports','jayson/promise','../../config/logger','routing','http','Request','request','then','rpc','error'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0x2d85,0x91));var _0x52d8=function(_0x1d1d3c,_0x69ec46){_0x1d1d3c=_0x1d1d3c-0x0;var _0x409280=_0x2d85[_0x1d1d3c];return _0x409280;};'use strict';var jayson=require(_0x52d8('0x0'));var BPromise=require('bluebird');var logger=require(_0x52d8('0x1'))(_0x52d8('0x2'));var client=jayson['client'][_0x52d8('0x3')]({'port':0x2329});client[_0x52d8('0x4')]=function(_0x1c0b59,_0x4e0185){return new BPromise(function(_0x3af091,_0x3eb6f2){return client[_0x52d8('0x5')](_0x1c0b59,_0x4e0185)[_0x52d8('0x6')](function(_0x11c31b){logger['debug'](_0x52d8('0x7'),_0x52d8('0x2'),_0x1c0b59,_0x4e0185,_0x11c31b);if(_0x11c31b['error']){logger[_0x52d8('0x8')]('rpc',_0x52d8('0x2'),_0x1c0b59,_0x11c31b[_0x52d8('0x8')]['message'],_0x4e0185);return _0x3eb6f2(_0x11c31b[_0x52d8('0x8')]['message']);}else{return _0x3af091(_0x11c31b['result']);}})[_0x52d8('0x9')](function(_0x3636c5){logger[_0x52d8('0x8')]('rpc',_0x52d8('0x2'),_0x1c0b59,_0x3636c5,_0x4e0185);return _0x3eb6f2(_0x3636c5);});});};module[_0x52d8('0xa')]=client; \ No newline at end of file +var _0xccd4=['routing','client','rpc','error','message','result','jayson/promise','bluebird','../../config/logger'];(function(_0xf90c9f,_0x297ccb){var _0x6b6499=function(_0x539e4c){while(--_0x539e4c){_0xf90c9f['push'](_0xf90c9f['shift']());}};_0x6b6499(++_0x297ccb);}(_0xccd4,0x84));var _0x4ccd=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xccd4[_0xf71120];return _0xbe2fd3;};'use strict';var jayson=require(_0x4ccd('0x0'));var BPromise=require(_0x4ccd('0x1'));var logger=require(_0x4ccd('0x2'))(_0x4ccd('0x3'));var client=jayson[_0x4ccd('0x4')]['http']({'port':0x2329});client['Request']=function(_0x2e8d32,_0x1f1295){return new BPromise(function(_0x37429b,_0x285d87){return client['request'](_0x2e8d32,_0x1f1295)['then'](function(_0xd17398){logger['debug'](_0x4ccd('0x5'),'routing',_0x2e8d32,_0x1f1295,_0xd17398);if(_0xd17398[_0x4ccd('0x6')]){logger[_0x4ccd('0x6')]('rpc',_0x4ccd('0x3'),_0x2e8d32,_0xd17398[_0x4ccd('0x6')]['message'],_0x1f1295);return _0x285d87(_0xd17398[_0x4ccd('0x6')][_0x4ccd('0x7')]);}else{return _0x37429b(_0xd17398[_0x4ccd('0x8')]);}})['catch'](function(_0x277a14){logger['error'](_0x4ccd('0x5'),_0x4ccd('0x3'),_0x2e8d32,_0x277a14,_0x1f1295);return _0x285d87(_0x277a14);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index c245729..61b83b1 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 _0x894c=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','then'];(function(_0x45cbf3,_0x55fdc1){var _0x73323b=function(_0x502d20){while(--_0x502d20){_0x45cbf3['push'](_0x45cbf3['shift']());}};_0x73323b(++_0x55fdc1);}(_0x894c,0x7a));var _0xc894=function(_0x3aa73e,_0x33a0e8){_0x3aa73e=_0x3aa73e-0x0;var _0x2144db=_0x894c[_0x3aa73e];return _0x2144db;};'use strict';var BPromise=require(_0xc894('0x0'));var server=require(_0xc894('0x1'));var Realtime=require(_0xc894('0x2'));var user=require(_0xc894('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xc894('0x4'));var chatQueue=require(_0xc894('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xc894('0x6'));var faxQueue=require(_0xc894('0x7'));var whatsappQueue=require(_0xc894('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xc894('0x9')]()['then'](user[_0xc894('0xa')]())['then'](realtime[_0xc894('0xb')]())[_0xc894('0xc')](interval[_0xc894('0xd')]())[_0xc894('0xc')](realtime[_0xc894('0xe')]())[_0xc894('0xc')](openchannelQueue[_0xc894('0xf')]())[_0xc894('0xc')](realtime[_0xc894('0x10')]())['then'](chatQueue[_0xc894('0x11')]())[_0xc894('0xc')](realtime['initChatQueues']())[_0xc894('0xc')](smsQueue[_0xc894('0x12')]())['then'](realtime['initSmsQueues']())[_0xc894('0xc')](mailQueue[_0xc894('0x13')]())[_0xc894('0xc')](realtime['initMailQueues']())['then'](faxQueue[_0xc894('0x14')]())['then'](realtime[_0xc894('0x15')]())[_0xc894('0xc')](whatsappQueue[_0xc894('0x16')]())[_0xc894('0xc')](realtime[_0xc894('0x17')]())[_0xc894('0xc')](function(){return realtime;});}function main(){return server[_0xc894('0x18')](realtime)[_0xc894('0xc')](function(_0x3bd5c7){return initRealtime();})['then'](function(_0x282e79){return setInterval(initRealtime,0x1388);})[_0xc894('0x19')](function(_0x2a58b1){console[_0xc894('0x1a')](_0x2a58b1);});}main(); \ No newline at end of file +var _0x132d=['./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird'];(function(_0x4e106e,_0x73c8fb){var _0x5e3112=function(_0x64289f){while(--_0x64289f){_0x4e106e['push'](_0x4e106e['shift']());}};_0x5e3112(++_0x73c8fb);}(_0x132d,0x1ec));var _0xd132=function(_0x42a867,_0x56eac6){_0x42a867=_0x42a867-0x0;var _0x5abcdb=_0x132d[_0x42a867];return _0x5abcdb;};'use strict';var BPromise=require(_0xd132('0x0'));var server=require(_0xd132('0x1'));var Realtime=require('./realtime');var user=require(_0xd132('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xd132('0x3'));var chatQueue=require(_0xd132('0x4'));var smsQueue=require(_0xd132('0x5'));var mailQueue=require(_0xd132('0x6'));var faxQueue=require(_0xd132('0x7'));var whatsappQueue=require(_0xd132('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd132('0x9')]()['then'](user[_0xd132('0xa')]())['then'](realtime[_0xd132('0xb')]())[_0xd132('0xc')](interval[_0xd132('0xd')]())[_0xd132('0xc')](realtime[_0xd132('0xe')]())[_0xd132('0xc')](openchannelQueue[_0xd132('0xf')]())[_0xd132('0xc')](realtime[_0xd132('0x10')]())[_0xd132('0xc')](chatQueue[_0xd132('0x11')]())[_0xd132('0xc')](realtime[_0xd132('0x12')]())[_0xd132('0xc')](smsQueue[_0xd132('0x13')]())[_0xd132('0xc')](realtime[_0xd132('0x14')]())[_0xd132('0xc')](mailQueue[_0xd132('0x15')]())[_0xd132('0xc')](realtime[_0xd132('0x16')]())[_0xd132('0xc')](faxQueue[_0xd132('0x17')]())[_0xd132('0xc')](realtime[_0xd132('0x18')]())[_0xd132('0xc')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xd132('0x19')]())[_0xd132('0xc')](function(){return realtime;});}function main(){return server[_0xd132('0x1a')](realtime)['then'](function(_0x5510e9){return initRealtime();})[_0xd132('0xc')](function(_0x2bb0d6){return setInterval(initRealtime,0x1388);})[_0xd132('0x1b')](function(_0x4ec36e){console[_0xd132('0x1c')](_0x4ec36e);});}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 984d523..d67b9f8 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x24041a,_0xbd8af0){var _0x56fcae=function(_0x2538da){while(--_0x2538da){_0x24041a['push'](_0x24041a['shift']());}};_0x56fcae(++_0xbd8af0);}(_0x7a54,0x106));var _0x47a5=function(_0x331d13,_0xfa22c5){_0x331d13=_0x331d13-0x0;var _0x4af22e=_0x7a54[_0x331d13];return _0x4af22e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=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(_0x58c239,_0x1788bc){var _0x1cd7cb=function(_0x4359b5){while(--_0x4359b5){_0x58c239['push'](_0x58c239['shift']());}};_0x1cd7cb(++_0x1788bc);}(_0x326f,0xd1));var _0xf326=function(_0x21e13e,_0x2e394b){_0x21e13e=_0x21e13e-0x0;var _0x2ddc9e=_0x326f[_0x21e13e];return _0x2ddc9e;};'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 186e2ac..02fc4a5 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 _0x4bdb=['catch','sendMailMessage','jayson/promise','http','request','then','error','message','result'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4bdb,0x1df));var _0xb4bd=function(_0x41af5c,_0x48567a){_0x41af5c=_0x41af5c-0x0;var _0x29c2e6=_0x4bdb[_0x41af5c];return _0x29c2e6;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xb4bd('0x0'));var client=jayson['client'][_0xb4bd('0x1')]({'port':0x232b});function request(_0x187871,_0x5007ff){return new BPromise(function(_0x54524a,_0x3d6868){return client[_0xb4bd('0x2')](_0x187871,_0x5007ff)[_0xb4bd('0x3')](function(_0x38166d){if(_0x38166d[_0xb4bd('0x4')]){return _0x3d6868(_0x38166d[_0xb4bd('0x4')][_0xb4bd('0x5')]);}else{return _0x54524a(_0x38166d[_0xb4bd('0x6')]);}})[_0xb4bd('0x7')](function(_0x33ad4a){return _0x3d6868(_0x33ad4a);});});}exports[_0xb4bd('0x8')]=function(_0x585820,_0x5441e0){return request('SendMail',{'account':_0x585820,'message':_0x5441e0});}; \ No newline at end of file +var _0x1ce0=['catch','sendMailMessage','SendMail','jayson/promise','client','request','error','message','result'];(function(_0x1a610f,_0x16ebe2){var _0x319a02=function(_0x2ff499){while(--_0x2ff499){_0x1a610f['push'](_0x1a610f['shift']());}};_0x319a02(++_0x16ebe2);}(_0x1ce0,0xdb));var _0x01ce=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x1ce0[_0x4b2cc6];return _0x3e0b08;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x01ce('0x0'));var client=jayson[_0x01ce('0x1')]['http']({'port':0x232b});function request(_0xc838e1,_0x2588c3){return new BPromise(function(_0x21f452,_0xf7f1c5){return client[_0x01ce('0x2')](_0xc838e1,_0x2588c3)['then'](function(_0x29b65e){if(_0x29b65e['error']){return _0xf7f1c5(_0x29b65e[_0x01ce('0x3')][_0x01ce('0x4')]);}else{return _0x21f452(_0x29b65e[_0x01ce('0x5')]);}})[_0x01ce('0x6')](function(_0x19a975){return _0xf7f1c5(_0x19a975);});});}exports[_0x01ce('0x7')]=function(_0x624706,_0x18c557){return request(_0x01ce('0x8'),{'account':_0x624706,'message':_0x18c557});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 6578318..6a4488e 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 _0x1f70=['ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailPause','chatCurrentCapacity','mailCurrentCapacity','smsStatusTime','whatsappCurrentCapacity','busyQueue','smsWaitingInteractions','stringify','emit','user:save','exports','moment','md5'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0x1f70,0x1be));var _0x01f7=function(_0x5ae27c,_0x408069){_0x5ae27c=_0x5ae27c-0x0;var _0xd79b05=_0x1f70[_0x5ae27c];return _0xd79b05;};'use strict';var _=require('lodash');var moment=require(_0x01f7('0x0'));var md5=require(_0x01f7('0x1'));var Redis=require(_0x01f7('0x2'));var config=require(_0x01f7('0x3'));config[_0x01f7('0x4')]=_[_0x01f7('0x5')](config[_0x01f7('0x4')],{'host':_0x01f7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x01f7('0x4')]));function Agent(_0x239a06){this['id']=_0x239a06['id']||0x0;this[_0x01f7('0x7')]=_0x239a06['name']||'';this[_0x01f7('0x8')]=_0x239a06['online']||!![];this[_0x01f7('0x9')]=_0x239a06[_0x01f7('0x9')]||![];this[_0x01f7('0xa')]=_0x239a06[_0x01f7('0xa')]||![];this['mailPause']=_0x239a06['mailPause']||![];this['faxPause']=_0x239a06[_0x01f7('0xb')]||![];this[_0x01f7('0xc')]=_0x239a06[_0x01f7('0xc')]||![];this['openchannelPause']=_0x239a06[_0x01f7('0xd')]||![];this[_0x01f7('0xe')]=_0x01f7('0xf');this[_0x01f7('0x10')]=0x0;this[_0x01f7('0x11')]=_0x239a06[_0x01f7('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x01f7('0x12')]=_0x01f7('0xf');this['mailStatusTime']=0x0;this[_0x01f7('0x13')]=_0x239a06[_0x01f7('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x01f7('0x14')]=_0x01f7('0xf');this[_0x01f7('0x15')]=0x0;this[_0x01f7('0x16')]=_0x239a06[_0x01f7('0x16')]||0x0;this[_0x01f7('0x17')]=0x0;this[_0x01f7('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x01f7('0x19')]=_0x239a06[_0x01f7('0x19')]||0x0;this[_0x01f7('0x1a')]=0x0;this[_0x01f7('0x1b')]='unknown';this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x239a06[_0x01f7('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x01f7('0x1d')]='unknown';this['openchannelStatusTime']=0x0;this[_0x01f7('0x1e')]=_0x239a06[_0x01f7('0x1e')]||0x0;this[_0x01f7('0x1f')]=0x0;this[_0x01f7('0x20')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x01f7('0x21')]={};this[_0x01f7('0x22')]={};this[_0x01f7('0x23')]={};this[_0x01f7('0x24')]={};this['smsWaitingInteractions']={};this[_0x01f7('0x25')]={};this['updateRealtime']();}Agent['prototype'][_0x01f7('0x26')]=function(_0x45cc20){if(this[_0x45cc20+_0x01f7('0x27')]>0x0){if(this[_0x45cc20+'Capacity']>0x0&&this[_0x45cc20+'CurrentCapacity']>=this[_0x45cc20+_0x01f7('0x28')]){return _0x01f7('0x29');}else{return _0x01f7('0x2a');}}else{return _0x01f7('0x2b');}};Agent['prototype']['updateRealtime']=function(){var _0x2dd873=['mail','chat',_0x01f7('0x2c'),_0x01f7('0x2d'),_0x01f7('0x2e'),_0x01f7('0x2f')];for(var _0xa33143=0x0;_0xa33143<_0x2dd873[_0x01f7('0x30')];_0xa33143+=0x1){var _0x517ac3=this[_0x01f7('0x26')](_0x2dd873[_0xa33143]);if(this[_0x2dd873[_0xa33143]+_0x01f7('0x31')]!==_0x517ac3){this[_0x2dd873[_0xa33143]+_0x01f7('0x32')]=_[_0x01f7('0x33')](moment()[_0x01f7('0x34')]('x'));}this[_0x2dd873[_0xa33143]+_0x01f7('0x31')]=_0x517ac3;}var _0x4f1877={'id':this['id'],'name':this[_0x01f7('0x7')],'online':this[_0x01f7('0x8')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x01f7('0x35')],'smsPause':this[_0x01f7('0xc')],'faxPause':this[_0x01f7('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x01f7('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x01f7('0x11')],'chatCurrentCapacity':this[_0x01f7('0x36')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x01f7('0x37')],'faxStatus':this[_0x01f7('0x14')],'faxStatusTime':this[_0x01f7('0x15')],'faxCapacity':this[_0x01f7('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x01f7('0x18')],'smsStatusTime':this[_0x01f7('0x38')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x01f7('0x1a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x01f7('0x1c')],'whatsappCurrentCapacity':this[_0x01f7('0x39')],'openchannelStatus':this[_0x01f7('0x1d')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x01f7('0x1e')],'openchannelCurrentCapacity':this[_0x01f7('0x1f')],'busy':this[_0x01f7('0x20')],'busyQueue':this[_0x01f7('0x3a')],'chatWaitingInteractions':this[_0x01f7('0x21')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x01f7('0x23')],'openchannelWaitingInteractions':this[_0x01f7('0x24')],'smsWaitingInteractions':this[_0x01f7('0x3b')],'whatsappWaitingInteractions':this[_0x01f7('0x25')]};var _0x2eeccc=md5(JSON[_0x01f7('0x3c')](_0x4f1877));if(this[_0x01f7('0x1')]!==_0x2eeccc){this['md5']=_0x2eeccc;io[_0x01f7('0x3d')](_0x01f7('0x3e'),_0x4f1877);}};module[_0x01f7('0x3f')]=Agent; \ No newline at end of file +var _0x777c=['faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','length','getChannelStatus','Status','StatusTime','toNumber','format','online','faxStatus','smsCurrentCapacity','openchannelStatusTime','stringify','user:save','exports','lodash','moment','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity'];(function(_0x397e54,_0x1cb73a){var _0x29285b=function(_0x238412){while(--_0x238412){_0x397e54['push'](_0x397e54['shift']());}};_0x29285b(++_0x1cb73a);}(_0x777c,0xe7));var _0xc777=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x777c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc777('0x0'));var moment=require(_0xc777('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0xc777('0x2'),'port':0x18eb});var io=require(_0xc777('0x3'))(new Redis(config['redis']));function Agent(_0x2612c1){this['id']=_0x2612c1['id']||0x0;this[_0xc777('0x4')]=_0x2612c1[_0xc777('0x4')]||'';this['online']=_0x2612c1['online']||!![];this[_0xc777('0x5')]=_0x2612c1[_0xc777('0x5')]||![];this[_0xc777('0x6')]=_0x2612c1[_0xc777('0x6')]||![];this[_0xc777('0x7')]=_0x2612c1[_0xc777('0x7')]||![];this['faxPause']=_0x2612c1[_0xc777('0x8')]||![];this['smsPause']=_0x2612c1[_0xc777('0x9')]||![];this[_0xc777('0xa')]=_0x2612c1['openchannelPause']||![];this[_0xc777('0xb')]=_0xc777('0xc');this[_0xc777('0xd')]=0x0;this['chatCapacity']=_0x2612c1[_0xc777('0xe')]||0x0;this[_0xc777('0xf')]=0x0;this[_0xc777('0x10')]=_0xc777('0xc');this[_0xc777('0x11')]=0x0;this[_0xc777('0x12')]=_0x2612c1[_0xc777('0x12')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']='unknown';this[_0xc777('0x13')]=0x0;this[_0xc777('0x14')]=_0x2612c1[_0xc777('0x14')]||0x0;this[_0xc777('0x15')]=0x0;this[_0xc777('0x16')]='unknown';this[_0xc777('0x17')]=0x0;this[_0xc777('0x18')]=_0x2612c1['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xc777('0x19')]='unknown';this[_0xc777('0x1a')]=0x0;this[_0xc777('0x1b')]=_0x2612c1[_0xc777('0x1b')]||0x0;this[_0xc777('0x1c')]=0x0;this['openchannelStatus']=_0xc777('0xc');this['openchannelStatusTime']=0x0;this[_0xc777('0x1d')]=_0x2612c1[_0xc777('0x1d')]||0x0;this[_0xc777('0x1e')]=0x0;this[_0xc777('0x1f')]=![];this[_0xc777('0x20')]=undefined;this[_0xc777('0x21')]='';this[_0xc777('0x22')]={};this[_0xc777('0x23')]={};this[_0xc777('0x24')]={};this[_0xc777('0x25')]={};this[_0xc777('0x26')]={};this[_0xc777('0x27')]={};this[_0xc777('0x28')]();}Agent[_0xc777('0x29')]['getChannelStatus']=function(_0x430319){if(this[_0x430319+_0xc777('0x2a')]>0x0){if(this[_0x430319+'Capacity']>0x0&&this[_0x430319+_0xc777('0x2a')]>=this[_0x430319+_0xc777('0x2b')]){return _0xc777('0x2c');}else{return _0xc777('0x2d');}}else{return _0xc777('0x2e');}};Agent['prototype']['updateRealtime']=function(){var _0x379c1d=[_0xc777('0x2f'),_0xc777('0x30'),'openchannel',_0xc777('0x31'),'sms','whatsapp'];for(var _0x82a3fa=0x0;_0x82a3fa<_0x379c1d[_0xc777('0x32')];_0x82a3fa+=0x1){var _0xea9dd7=this[_0xc777('0x33')](_0x379c1d[_0x82a3fa]);if(this[_0x379c1d[_0x82a3fa]+_0xc777('0x34')]!==_0xea9dd7){this[_0x379c1d[_0x82a3fa]+_0xc777('0x35')]=_[_0xc777('0x36')](moment()[_0xc777('0x37')]('x'));}this[_0x379c1d[_0x82a3fa]+_0xc777('0x34')]=_0xea9dd7;}var _0x2a8233={'id':this['id'],'name':this['name'],'online':this[_0xc777('0x38')],'voicePause':this[_0xc777('0x5')],'chatPause':this[_0xc777('0x6')],'mailPause':this[_0xc777('0x7')],'smsPause':this[_0xc777('0x9')],'faxPause':this['faxPause'],'openchannelPause':this[_0xc777('0xa')],'chatStatus':this[_0xc777('0xb')],'chatStatusTime':this[_0xc777('0xd')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xc777('0xf')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xc777('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xc777('0x39')],'faxStatusTime':this[_0xc777('0x13')],'faxCapacity':this[_0xc777('0x14')],'faxCurrentCapacity':this[_0xc777('0x15')],'smsStatus':this[_0xc777('0x16')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xc777('0x18')],'smsCurrentCapacity':this[_0xc777('0x3a')],'whatsappStatus':this[_0xc777('0x19')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xc777('0x1b')],'whatsappCurrentCapacity':this[_0xc777('0x1c')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xc777('0x3b')],'openchannelCapacity':this[_0xc777('0x1d')],'openchannelCurrentCapacity':this[_0xc777('0x1e')],'busy':this[_0xc777('0x1f')],'busyQueue':this[_0xc777('0x20')],'chatWaitingInteractions':this[_0xc777('0x22')],'faxWaitingInteractions':this[_0xc777('0x23')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0xc777('0x26')],'whatsappWaitingInteractions':this[_0xc777('0x27')]};var _0x942677=md5(JSON[_0xc777('0x3c')](_0x2a8233));if(this[_0xc777('0x21')]!==_0x942677){this[_0xc777('0x21')]=_0x942677;io['emit'](_0xc777('0x3d'),_0x2a8233);}};module[_0xc777('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 98c1ec6..27de068 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 _0x8f21=['updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','chatPause','available','paused','stringify','chat:queue:%s','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x1598bb,_0x3fb456){var _0x135546=function(_0xf63a1a){while(--_0xf63a1a){_0x1598bb['push'](_0x1598bb['shift']());}};_0x135546(++_0x3fb456);}(_0x8f21,0xee));var _0x18f2=function(_0x15353c,_0x5d98a8){_0x15353c=_0x15353c-0x0;var _0x4622d7=_0x8f21[_0x15353c];return _0x4622d7;};'use strict';var _=require(_0x18f2('0x0'));var md5=require(_0x18f2('0x1'));var util=require('util');var Redis=require(_0x18f2('0x2'));var config=require(_0x18f2('0x3'));config[_0x18f2('0x4')]=_[_0x18f2('0x5')](config[_0x18f2('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x18f2('0x6'))(new Redis(config['redis']));function ChatQueue(_0x2ee7a5){this['id']=_0x2ee7a5['id']||0x0;this[_0x18f2('0x7')]=_0x2ee7a5['name']||'';this[_0x18f2('0x8')]=_0x2ee7a5[_0x18f2('0x8')]||0xa;this[_0x18f2('0x9')]=_0x2ee7a5[_0x18f2('0x9')]||_0x18f2('0xa');this[_0x18f2('0xb')]=_0x2ee7a5[_0x18f2('0xb')];this[_0x18f2('0xc')]={};this[_0x18f2('0xd')]=0x0;this['md5']='';this[_0x18f2('0xe')]();this[_0x18f2('0xf')]();}ChatQueue['prototype'][_0x18f2('0xe')]=function(){var _0x2142a5=this[_0x18f2('0xc')][_0x18f2('0x10')];this[_0x18f2('0xc')]=_[_0x18f2('0x11')](this[_0x18f2('0xb')],'id');this[_0x18f2('0xc')][_0x18f2('0x10')]=_0x2142a5;};ChatQueue[_0x18f2('0x12')][_0x18f2('0xf')]=function(){this[_0x18f2('0x13')]=0x0;this['paused']=0x0;for(var _0x4a2a1e=0x0;_0x4a2a1e=0x0?this[_0x18f2('0x16')]:0x0;var _0x370dbc={'id':this['id'],'available':this['available'],'loggedIn':this[_0x18f2('0x13')],'name':this[_0x18f2('0x7')],'paused':this['paused'],'waiting':this[_0x18f2('0xd')]};var _0x5544dc=md5(JSON[_0x18f2('0x18')](_0x370dbc));if(this[_0x18f2('0x1')]!==_0x5544dc){this[_0x18f2('0x1')]=_0x5544dc;io['to'](util['format'](_0x18f2('0x19'),_0x370dbc[_0x18f2('0x7')]))['emit'](_0x18f2('0x1a'),_0x370dbc);}};module[_0x18f2('0x1b')]=ChatQueue; \ No newline at end of file +var _0xdd4f=['Agents','online','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','md5','updateRealtime','updateRouting','map','_rr','prototype','loggedIn','length'];(function(_0xb02b7a,_0x2b4fa0){var _0x4d774f=function(_0x557b82){while(--_0x557b82){_0xb02b7a['push'](_0xb02b7a['shift']());}};_0x4d774f(++_0x2b4fa0);}(_0xdd4f,0x9a));var _0xfdd4=function(_0x167551,_0x20ec05){_0x167551=_0x167551-0x0;var _0x458c57=_0xdd4f[_0x167551];return _0x458c57;};'use strict';var _=require(_0xfdd4('0x0'));var md5=require('md5');var util=require(_0xfdd4('0x1'));var Redis=require(_0xfdd4('0x2'));var config=require(_0xfdd4('0x3'));config[_0xfdd4('0x4')]=_[_0xfdd4('0x5')](config[_0xfdd4('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xfdd4('0x6'))(new Redis(config['redis']));function ChatQueue(_0x248a24){this['id']=_0x248a24['id']||0x0;this[_0xfdd4('0x7')]=_0x248a24[_0xfdd4('0x7')]||'';this['timeout']=_0x248a24[_0xfdd4('0x8')]||0xa;this['strategy']=_0x248a24['strategy']||_0xfdd4('0x9');this['Agents']=_0x248a24['Agents'];this[_0xfdd4('0xa')]={};this[_0xfdd4('0xb')]=0x0;this[_0xfdd4('0xc')]='';this['updateRouting']();this[_0xfdd4('0xd')]();}ChatQueue['prototype'][_0xfdd4('0xe')]=function(){var _0xa0c3ea=this[_0xfdd4('0xa')]['_rr'];this[_0xfdd4('0xa')]=_[_0xfdd4('0xf')](this['Agents'],'id');this[_0xfdd4('0xa')][_0xfdd4('0x10')]=_0xa0c3ea;};ChatQueue[_0xfdd4('0x11')][_0xfdd4('0xd')]=function(){this[_0xfdd4('0x12')]=0x0;this['paused']=0x0;for(var _0x25f7a8=0x0;_0x25f7a8=0x0?this['available']:0x0;var _0x32d85b={'id':this['id'],'available':this[_0xfdd4('0x17')],'loggedIn':this[_0xfdd4('0x12')],'name':this[_0xfdd4('0x7')],'paused':this[_0xfdd4('0x16')],'waiting':this[_0xfdd4('0xb')]};var _0x2ff0dd=md5(JSON[_0xfdd4('0x18')](_0x32d85b));if(this[_0xfdd4('0xc')]!==_0x2ff0dd){this[_0xfdd4('0xc')]=_0x2ff0dd;io['to'](util[_0xfdd4('0x19')](_0xfdd4('0x1a'),_0x32d85b['name']))[_0xfdd4('0x1b')](_0xfdd4('0x1c'),_0x32d85b);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 247aab2..0b3371f 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 _0xcb10=['prototype','_rr','mapAgentsId','map','Agents','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','waiting','updateRouting','updateRealtime'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcb10,0x1be));var _0x0cb1=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xcb10[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x0cb1('0x0'));var md5=require(_0x0cb1('0x1'));var util=require(_0x0cb1('0x2'));var Redis=require(_0x0cb1('0x3'));var config=require('../../../config/environment');config[_0x0cb1('0x4')]=_['defaults'](config[_0x0cb1('0x4')],{'host':_0x0cb1('0x5'),'port':0x18eb});var io=require(_0x0cb1('0x6'))(new Redis(config['redis']));function FaxQueue(_0x52d19f){this['id']=_0x52d19f['id']||0x0;this[_0x0cb1('0x7')]=_0x52d19f['name']||'';this[_0x0cb1('0x8')]=_0x52d19f[_0x0cb1('0x8')]||0xa;this[_0x0cb1('0x9')]=_0x52d19f[_0x0cb1('0x9')]||'beepall';this['Agents']=_0x52d19f['Agents'];this['mapAgentsId']={};this[_0x0cb1('0xa')]=0x0;this['md5']='';this[_0x0cb1('0xb')]();this[_0x0cb1('0xc')]();}FaxQueue[_0x0cb1('0xd')]['updateRouting']=function(){var _0x44814e=this['mapAgentsId'][_0x0cb1('0xe')];this[_0x0cb1('0xf')]=_[_0x0cb1('0x10')](this[_0x0cb1('0x11')],'id');this[_0x0cb1('0xf')]['_rr']=_0x44814e;};FaxQueue[_0x0cb1('0xd')][_0x0cb1('0xc')]=function(){this[_0x0cb1('0x12')]=0x0;this[_0x0cb1('0x13')]=0x0;for(var _0x46f40c=0x0;_0x46f40c=0x0?this['available']:0x0;var _0x489dc2={'id':this['id'],'available':this[_0x0cb1('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x0cb1('0x13')],'waiting':this[_0x0cb1('0xa')]};var _0x3dc4d5=md5(JSON[_0x0cb1('0x18')](_0x489dc2));if(this[_0x0cb1('0x1')]!==_0x3dc4d5){this[_0x0cb1('0x1')]=_0x3dc4d5;io['to'](util['format'](_0x0cb1('0x19'),_0x489dc2[_0x0cb1('0x7')]))[_0x0cb1('0x1a')]('fax_queue:save',_0x489dc2);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x0cb5=['fax_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','loggedIn','paused','online','faxPause','available','stringify','format','emit'];(function(_0xd4810c,_0x5dfd17){var _0x54cebc=function(_0x525e71){while(--_0x525e71){_0xd4810c['push'](_0xd4810c['shift']());}};_0x54cebc(++_0x5dfd17);}(_0x0cb5,0x17b));var _0x50cb=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x0cb5[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x50cb('0x0'));var md5=require(_0x50cb('0x1'));var util=require(_0x50cb('0x2'));var Redis=require('ioredis');var config=require(_0x50cb('0x3'));config[_0x50cb('0x4')]=_[_0x50cb('0x5')](config[_0x50cb('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x50cb('0x6'))(new Redis(config[_0x50cb('0x4')]));function FaxQueue(_0x22999e){this['id']=_0x22999e['id']||0x0;this[_0x50cb('0x7')]=_0x22999e[_0x50cb('0x7')]||'';this['timeout']=_0x22999e[_0x50cb('0x8')]||0xa;this[_0x50cb('0x9')]=_0x22999e['strategy']||_0x50cb('0xa');this[_0x50cb('0xb')]=_0x22999e[_0x50cb('0xb')];this[_0x50cb('0xc')]={};this[_0x50cb('0xd')]=0x0;this[_0x50cb('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x50cb('0xe')][_0x50cb('0xf')]=function(){var _0x12ea70=this[_0x50cb('0xc')][_0x50cb('0x10')];this['mapAgentsId']=_[_0x50cb('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x50cb('0x10')]=_0x12ea70;};FaxQueue[_0x50cb('0xe')]['updateRealtime']=function(){this[_0x50cb('0x12')]=0x0;this[_0x50cb('0x13')]=0x0;for(var _0x2ff37f=0x0;_0x2ff37f=0x0?this[_0x50cb('0x16')]:0x0;var _0x11a98d={'id':this['id'],'available':this[_0x50cb('0x16')],'loggedIn':this[_0x50cb('0x12')],'name':this[_0x50cb('0x7')],'paused':this['paused'],'waiting':this[_0x50cb('0xd')]};var _0x44dc4b=md5(JSON[_0x50cb('0x17')](_0x11a98d));if(this[_0x50cb('0x1')]!==_0x44dc4b){this[_0x50cb('0x1')]=_0x44dc4b;io['to'](util[_0x50cb('0x18')]('fax:queue:%s',_0x11a98d[_0x50cb('0x7')]))[_0x50cb('0x19')](_0x50cb('0x1a'),_0x11a98d);}};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 fc42288..6f235db 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 _0xb9ab=['name','Intervals','exports'];(function(_0x5c365a,_0xd48ae){var _0xeb3924=function(_0xce5e22){while(--_0xce5e22){_0x5c365a['push'](_0x5c365a['shift']());}};_0xeb3924(++_0xd48ae);}(_0xb9ab,0x10e));var _0xbb9a=function(_0x5c0061,_0x58f643){_0x5c0061=_0x5c0061-0x0;var _0x490b55=_0xb9ab[_0x5c0061];return _0x490b55;};'use strict';function Interval(_0x22e984){this['id']=_0x22e984['id']||0x0;this[_0xbb9a('0x0')]=_0x22e984[_0xbb9a('0x0')]||'';this[_0xbb9a('0x1')]=_0x22e984[_0xbb9a('0x1')]||{};}module[_0xbb9a('0x2')]=Interval; \ No newline at end of file +var _0xf449=['name','Intervals','exports'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xf449,0x123));var _0x9f44=function(_0x58fed7,_0xf9c710){_0x58fed7=_0x58fed7-0x0;var _0x33efbf=_0xf449[_0x58fed7];return _0x33efbf;};'use strict';function Interval(_0x150036){this['id']=_0x150036['id']||0x0;this[_0x9f44('0x0')]=_0x150036[_0x9f44('0x0')]||'';this[_0x9f44('0x1')]=_0x150036[_0x9f44('0x1')]||{};}module[_0x9f44('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 6d17d7b..78b8206 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 _0xe601=['length','available','paused','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn'];(function(_0x5aa8d1,_0x276daf){var _0x550bba=function(_0x1eb972){while(--_0x1eb972){_0x5aa8d1['push'](_0x5aa8d1['shift']());}};_0x550bba(++_0x276daf);}(_0xe601,0x174));var _0x1e60=function(_0x15f578,_0x5cca58){_0x15f578=_0x15f578-0x0;var _0x5afcf9=_0xe601[_0x15f578];return _0x5afcf9;};'use strict';var _=require(_0x1e60('0x0'));var md5=require(_0x1e60('0x1'));var util=require('util');var Redis=require(_0x1e60('0x2'));var config=require(_0x1e60('0x3'));config[_0x1e60('0x4')]=_['defaults'](config['redis'],{'host':_0x1e60('0x5'),'port':0x18eb});var io=require(_0x1e60('0x6'))(new Redis(config['redis']));function MailQueue(_0x38cdac){this['id']=_0x38cdac['id']||0x0;this[_0x1e60('0x7')]=_0x38cdac[_0x1e60('0x7')]||'';this[_0x1e60('0x8')]=_0x38cdac['timeout']||0xa;this[_0x1e60('0x9')]=_0x38cdac[_0x1e60('0x9')]||_0x1e60('0xa');this[_0x1e60('0xb')]=_0x38cdac[_0x1e60('0xb')];this[_0x1e60('0xc')]={};this[_0x1e60('0xd')]=0x0;this[_0x1e60('0x1')]='';this[_0x1e60('0xe')]();this['updateRealtime']();}MailQueue['prototype'][_0x1e60('0xe')]=function(){var _0x313236=this[_0x1e60('0xc')][_0x1e60('0xf')];this['mapAgentsId']=_[_0x1e60('0x10')](this[_0x1e60('0xb')],'id');this[_0x1e60('0xc')]['_rr']=_0x313236;};MailQueue[_0x1e60('0x11')][_0x1e60('0x12')]=function(){this[_0x1e60('0x13')]=0x0;this['paused']=0x0;for(var _0xf6cf7f=0x0;_0xf6cf7f=0x0?this[_0x1e60('0x15')]:0x0;var _0x26fd2a={'id':this['id'],'available':this[_0x1e60('0x15')],'loggedIn':this[_0x1e60('0x13')],'name':this[_0x1e60('0x7')],'paused':this['paused'],'waiting':this[_0x1e60('0xd')]};var _0x3773c9=md5(JSON[_0x1e60('0x17')](_0x26fd2a));if(this[_0x1e60('0x1')]!==_0x3773c9){this[_0x1e60('0x1')]=_0x3773c9;io['to'](util[_0x1e60('0x18')](_0x1e60('0x19'),_0x26fd2a[_0x1e60('0x7')]))[_0x1e60('0x1a')](_0x1e60('0x1b'),_0x26fd2a);}};module['exports']=MailQueue; \ No newline at end of file +var _0x2265=['updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','mailPause','paused','available','name','waiting','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','redis','localhost','timeout','strategy','beepall','Agents'];(function(_0x3c089c,_0x31e2b5){var _0x3417b0=function(_0x32e653){while(--_0x32e653){_0x3c089c['push'](_0x3c089c['shift']());}};_0x3417b0(++_0x31e2b5);}(_0x2265,0x1b7));var _0x5226=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2265[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x5226('0x0'));var md5=require(_0x5226('0x1'));var util=require('util');var Redis=require(_0x5226('0x2'));var config=require('../../../config/environment');config[_0x5226('0x3')]=_['defaults'](config[_0x5226('0x3')],{'host':_0x5226('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5226('0x3')]));function MailQueue(_0x4e1694){this['id']=_0x4e1694['id']||0x0;this['name']=_0x4e1694['name']||'';this[_0x5226('0x5')]=_0x4e1694[_0x5226('0x5')]||0xa;this['strategy']=_0x4e1694[_0x5226('0x6')]||_0x5226('0x7');this[_0x5226('0x8')]=_0x4e1694[_0x5226('0x8')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x5226('0x1')]='';this[_0x5226('0x9')]();this[_0x5226('0xa')]();}MailQueue[_0x5226('0xb')][_0x5226('0x9')]=function(){var _0x3e4394=this[_0x5226('0xc')][_0x5226('0xd')];this['mapAgentsId']=_[_0x5226('0xe')](this[_0x5226('0x8')],'id');this[_0x5226('0xc')][_0x5226('0xd')]=_0x3e4394;};MailQueue['prototype'][_0x5226('0xa')]=function(){this[_0x5226('0xf')]=0x0;this['paused']=0x0;for(var _0x56b42a=0x0;_0x56b42a=0x0?this['available']:0x0;var _0x411f71={'id':this['id'],'available':this[_0x5226('0x14')],'loggedIn':this[_0x5226('0xf')],'name':this[_0x5226('0x15')],'paused':this['paused'],'waiting':this[_0x5226('0x16')]};var _0x2b7a92=md5(JSON['stringify'](_0x411f71));if(this[_0x5226('0x1')]!==_0x2b7a92){this[_0x5226('0x1')]=_0x2b7a92;io['to'](util[_0x5226('0x17')](_0x5226('0x18'),_0x411f71[_0x5226('0x15')]))[_0x5226('0x19')](_0x5226('0x1a'),_0x411f71);}};module[_0x5226('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 6d2e602..c3a5121 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x7a54,0x106));var _0x47a5=function(_0x1282bc,_0x2f1eed){_0x1282bc=_0x1282bc-0x0;var _0x4aa432=_0x7a54[_0x1282bc];return _0x4aa432;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +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(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x326f,0xd1));var _0xf326=function(_0x3fbb46,_0x2138f){_0x3fbb46=_0x3fbb46-0x0;var _0x172073=_0x326f[_0x3fbb46];return _0x172073;};'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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c274078..c8faaac 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 _0x063c=['paused','length','online','loggedIn','smsPause','available','waiting','stringify','format','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','updateRealtime'];(function(_0x3a2685,_0x1721b9){var _0x5b5300=function(_0x46acc2){while(--_0x46acc2){_0x3a2685['push'](_0x3a2685['shift']());}};_0x5b5300(++_0x1721b9);}(_0x063c,0xba));var _0xc063=function(_0x589786,_0x3b0a20){_0x589786=_0x589786-0x0;var _0x34519d=_0x063c[_0x589786];return _0x34519d;};'use strict';var _=require('lodash');var md5=require(_0xc063('0x0'));var util=require(_0xc063('0x1'));var Redis=require(_0xc063('0x2'));var config=require(_0xc063('0x3'));config[_0xc063('0x4')]=_[_0xc063('0x5')](config['redis'],{'host':_0xc063('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x59b81f){this['id']=_0x59b81f['id']||0x0;this[_0xc063('0x7')]=_0x59b81f[_0xc063('0x7')]||'';this['timeout']=_0x59b81f[_0xc063('0x8')]||0xa;this[_0xc063('0x9')]=_0x59b81f[_0xc063('0x9')]||_0xc063('0xa');this['Agents']=_0x59b81f[_0xc063('0xb')];this[_0xc063('0xc')]={};this['waiting']=0x0;this[_0xc063('0x0')]='';this[_0xc063('0xd')]();this['updateRealtime']();}SmsQueue[_0xc063('0xe')]['updateRouting']=function(){var _0x54c605=this['mapAgentsId'][_0xc063('0xf')];this[_0xc063('0xc')]=_['map'](this[_0xc063('0xb')],'id');this['mapAgentsId'][_0xc063('0xf')]=_0x54c605;};SmsQueue[_0xc063('0xe')][_0xc063('0x10')]=function(){this['loggedIn']=0x0;this[_0xc063('0x11')]=0x0;for(var _0x1249b2=0x0;_0x1249b2=0x0?this['available']:0x0;var _0x238ecb={'id':this['id'],'available':this[_0xc063('0x16')],'loggedIn':this[_0xc063('0x14')],'name':this[_0xc063('0x7')],'paused':this['paused'],'waiting':this[_0xc063('0x17')]};var _0x28d3ce=md5(JSON[_0xc063('0x18')](_0x238ecb));if(this['md5']!==_0x28d3ce){this[_0xc063('0x0')]=_0x28d3ce;io['to'](util[_0xc063('0x19')]('sms:queue:%s',_0x238ecb[_0xc063('0x7')]))[_0xc063('0x1a')](_0xc063('0x1b'),_0x238ecb);}};module[_0xc063('0x1c')]=SmsQueue; \ No newline at end of file +var _0x7f42=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7f42,0x1dd));var _0x27f4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7f42[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x27f4('0x0'));var md5=require('md5');var util=require(_0x27f4('0x1'));var Redis=require(_0x27f4('0x2'));var config=require('../../../config/environment');config[_0x27f4('0x3')]=_['defaults'](config[_0x27f4('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x27f4('0x4'))(new Redis(config['redis']));function SmsQueue(_0xe8eabe){this['id']=_0xe8eabe['id']||0x0;this['name']=_0xe8eabe[_0x27f4('0x5')]||'';this[_0x27f4('0x6')]=_0xe8eabe[_0x27f4('0x6')]||0xa;this[_0x27f4('0x7')]=_0xe8eabe[_0x27f4('0x7')]||_0x27f4('0x8');this[_0x27f4('0x9')]=_0xe8eabe[_0x27f4('0x9')];this[_0x27f4('0xa')]={};this[_0x27f4('0xb')]=0x0;this[_0x27f4('0xc')]='';this[_0x27f4('0xd')]();this[_0x27f4('0xe')]();}SmsQueue[_0x27f4('0xf')][_0x27f4('0xd')]=function(){var _0x369725=this[_0x27f4('0xa')][_0x27f4('0x10')];this['mapAgentsId']=_['map'](this[_0x27f4('0x9')],'id');this[_0x27f4('0xa')][_0x27f4('0x10')]=_0x369725;};SmsQueue[_0x27f4('0xf')][_0x27f4('0xe')]=function(){this[_0x27f4('0x11')]=0x0;this[_0x27f4('0x12')]=0x0;for(var _0x40393e=0x0;_0x40393e=0x0?this[_0x27f4('0x14')]:0x0;var _0x49e6c0={'id':this['id'],'available':this[_0x27f4('0x14')],'loggedIn':this[_0x27f4('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x27f4('0xb')]};var _0x2957a1=md5(JSON[_0x27f4('0x15')](_0x49e6c0));if(this[_0x27f4('0xc')]!==_0x2957a1){this[_0x27f4('0xc')]=_0x2957a1;io['to'](util[_0x27f4('0x16')](_0x27f4('0x17'),_0x49e6c0[_0x27f4('0x5')]))[_0x27f4('0x18')](_0x27f4('0x19'),_0x49e6c0);}};module[_0x27f4('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 735dec2..7a64f03 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 _0x3f60=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util'];(function(_0x3aec43,_0x1edcfd){var _0x58ad56=function(_0x17b251){while(--_0x17b251){_0x3aec43['push'](_0x3aec43['shift']());}};_0x58ad56(++_0x1edcfd);}(_0x3f60,0x159));var _0x03f6=function(_0x56f935,_0xbb3e13){_0x56f935=_0x56f935-0x0;var _0x25ff2f=_0x3f60[_0x56f935];return _0x25ff2f;};'use strict';var _=require(_0x03f6('0x0'));var md5=require(_0x03f6('0x1'));var util=require(_0x03f6('0x2'));var Redis=require(_0x03f6('0x3'));var config=require(_0x03f6('0x4'));config[_0x03f6('0x5')]=_[_0x03f6('0x6')](config['redis'],{'host':_0x03f6('0x7'),'port':0x18eb});var io=require(_0x03f6('0x8'))(new Redis(config[_0x03f6('0x5')]));function WhatsappQueue(_0x20e71f){this['id']=_0x20e71f['id']||0x0;this['name']=_0x20e71f[_0x03f6('0x9')]||'';this[_0x03f6('0xa')]=_0x20e71f[_0x03f6('0xa')]||0xa;this[_0x03f6('0xb')]=_0x20e71f[_0x03f6('0xb')]||_0x03f6('0xc');this[_0x03f6('0xd')]=_0x20e71f[_0x03f6('0xd')];this[_0x03f6('0xe')]={};this[_0x03f6('0xf')]=0x0;this[_0x03f6('0x1')]='';this[_0x03f6('0x10')]();this['updateRealtime']();}WhatsappQueue[_0x03f6('0x11')][_0x03f6('0x10')]=function(){var _0x2940e6=this[_0x03f6('0xe')][_0x03f6('0x12')];this[_0x03f6('0xe')]=_['map'](this[_0x03f6('0xd')],'id');this[_0x03f6('0xe')][_0x03f6('0x12')]=_0x2940e6;};WhatsappQueue[_0x03f6('0x11')]['updateRealtime']=function(){this[_0x03f6('0x13')]=0x0;this[_0x03f6('0x14')]=0x0;for(var _0x2e8da1=0x0;_0x2e8da1=0x0?this['available']:0x0;var _0x4e3915={'id':this['id'],'available':this[_0x03f6('0x17')],'loggedIn':this[_0x03f6('0x13')],'name':this[_0x03f6('0x9')],'paused':this[_0x03f6('0x14')],'waiting':this[_0x03f6('0xf')]};var _0x1b51c3=md5(JSON[_0x03f6('0x18')](_0x4e3915));if(this[_0x03f6('0x1')]!==_0x1b51c3){this[_0x03f6('0x1')]=_0x1b51c3;io['to'](util[_0x03f6('0x19')](_0x03f6('0x1a'),_0x4e3915[_0x03f6('0x9')]))['emit'](_0x03f6('0x1b'),_0x4e3915);}};module[_0x03f6('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x164d=['whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','Agents','loggedIn','length','online','whatsappPause','paused','available','stringify','format'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x164d,0xd5));var _0xd164=function(_0x35f6b4,_0x505966){_0x35f6b4=_0x35f6b4-0x0;var _0x10f072=_0x164d[_0x35f6b4];return _0x10f072;};'use strict';var _=require(_0xd164('0x0'));var md5=require(_0xd164('0x1'));var util=require(_0xd164('0x2'));var Redis=require(_0xd164('0x3'));var config=require(_0xd164('0x4'));config[_0xd164('0x5')]=_[_0xd164('0x6')](config[_0xd164('0x5')],{'host':_0xd164('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd164('0x5')]));function WhatsappQueue(_0x57ab10){this['id']=_0x57ab10['id']||0x0;this['name']=_0x57ab10[_0xd164('0x8')]||'';this[_0xd164('0x9')]=_0x57ab10['timeout']||0xa;this[_0xd164('0xa')]=_0x57ab10[_0xd164('0xa')]||'beepall';this['Agents']=_0x57ab10['Agents'];this['mapAgentsId']={};this[_0xd164('0xb')]=0x0;this['md5']='';this[_0xd164('0xc')]();this[_0xd164('0xd')]();}WhatsappQueue[_0xd164('0xe')][_0xd164('0xc')]=function(){var _0x3c6d9e=this[_0xd164('0xf')][_0xd164('0x10')];this[_0xd164('0xf')]=_[_0xd164('0x11')](this[_0xd164('0x12')],'id');this['mapAgentsId'][_0xd164('0x10')]=_0x3c6d9e;};WhatsappQueue[_0xd164('0xe')][_0xd164('0xd')]=function(){this[_0xd164('0x13')]=0x0;this['paused']=0x0;for(var _0xabbe5a=0x0;_0xabbe5a=0x0?this[_0xd164('0x18')]:0x0;var _0x502232={'id':this['id'],'available':this[_0xd164('0x18')],'loggedIn':this[_0xd164('0x13')],'name':this['name'],'paused':this[_0xd164('0x17')],'waiting':this[_0xd164('0xb')]};var _0x139de0=md5(JSON[_0xd164('0x19')](_0x502232));if(this[_0xd164('0x1')]!==_0x139de0){this[_0xd164('0x1')]=_0x139de0;io['to'](util[_0xd164('0x1a')](_0xd164('0x1b'),_0x502232[_0xd164('0x8')]))['emit'](_0xd164('0x1c'),_0x502232);}};module[_0xd164('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f91cc78..f4383df 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(_0x2d7446,_0x207652){var _0x26cf26=function(_0x4ebfbc){while(--_0x4ebfbc){_0x2d7446['push'](_0x2d7446['shift']());}};_0x26cf26(++_0x207652);}(_0xb10b,0x12a));var _0xbb10=function(_0xcbe787,_0x401e4c){_0xcbe787=_0xcbe787-0x0;var _0x4c78fa=_0xb10b[_0xcbe787];return _0x4c78fa;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 2d01393..03a45d4 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 _0x3403=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x3403,0xe5));var _0x3340=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x3403[_0x4ae6ef];return _0x3cbb4e;};'use strict';var client=require(_0x3340('0x0'));exports[_0x3340('0x1')]=function(_0x481be2,_0x35d566){return client['Request'](_0x3340('0x2'),{'body':_0x35d566,'options':{'where':{'id':_0x481be2}},'log':_0x3340('0x3')});};exports[_0x3340('0x4')]=function(_0x420cb8,_0x433af0){return client['Request'](_0x3340('0x5'),{'body':_0x433af0,'options':{'where':{'id':_0x420cb8}},'log':_0x3340('0x6')});}; \ No newline at end of file +var _0x88db=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x56127c,_0xb35ba4){var _0x273049=function(_0xd20c42){while(--_0xd20c42){_0x56127c['push'](_0x56127c['shift']());}};_0x273049(++_0xb35ba4);}(_0x88db,0x151));var _0xb88d=function(_0xaf3514,_0x1b790f){_0xaf3514=_0xaf3514-0x0;var _0x46b5cd=_0x88db[_0xaf3514];return _0x46b5cd;};'use strict';var client=require(_0xb88d('0x0'));exports[_0xb88d('0x1')]=function(_0x426e9e,_0x15db98){return client[_0xb88d('0x2')](_0xb88d('0x3'),{'body':_0x15db98,'options':{'where':{'id':_0x426e9e}},'log':_0xb88d('0x4')});};exports[_0xb88d('0x5')]=function(_0x57f011,_0x4be75c){return client[_0xb88d('0x2')](_0xb88d('0x6'),{'body':_0x4be75c,'options':{'where':{'id':_0x57f011}},'log':_0xb88d('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 91faf40..e3825ff 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 _0x9700=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x9700,0xa3));var _0x0970=function(_0x23daa6,_0x4cb95a){_0x23daa6=_0x23daa6-0x0;var _0xf8d7c8=_0x9700[_0x23daa6];return _0xf8d7c8;};'use strict';var client=require(_0x0970('0x0'));exports[_0x0970('0x1')]=function(_0xef709a){return client['Request'](_0x0970('0x2'),{'body':_0xef709a,'log':_0x0970('0x3')});}; \ No newline at end of file +var _0x5b7e=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x5b7e,0x1ae));var _0xe5b7=function(_0x2d5805,_0x21954e){_0x2d5805=_0x2d5805-0x0;var _0x1cae4f=_0x5b7e[_0x2d5805];return _0x1cae4f;};'use strict';var client=require('../client');exports[_0xe5b7('0x0')]=function(_0x1787cf){return client[_0xe5b7('0x1')](_0xe5b7('0x2'),{'body':_0x1787cf,'log':_0xe5b7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9f98f75..fd70ed3 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1dc=['strategy','Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x40b13e,_0x2837ab){var _0x3a949a=function(_0x2d1a86){while(--_0x2d1a86){_0x40b13e['push'](_0x40b13e['shift']());}};_0x3a949a(++_0x2837ab);}(_0xe1dc,0x8a));var _0xce1d=function(_0x50819b,_0x1e105b){_0x50819b=_0x50819b-0x0;var _0x2d42e6=_0xe1dc[_0x50819b];return _0x2d42e6;};'use strict';var client=require(_0xce1d('0x0'));exports[_0xce1d('0x1')]=function(){return function(){return client[_0xce1d('0x2')](_0xce1d('0x3'),{'options':{'raw':![],'attributes':['id',_0xce1d('0x4'),_0xce1d('0x5'),_0xce1d('0x6')],'include':[{'model':'User','as':_0xce1d('0x7'),'attributes':['id','name','online',_0xce1d('0x8')]}]},'log':_0xce1d('0x1')});};}; \ No newline at end of file +var _0x5b20=['strategy','User','Agents','online','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x3a05e7,_0x370933){var _0x48896b=function(_0x5c0f76){while(--_0x5c0f76){_0x3a05e7['push'](_0x3a05e7['shift']());}};_0x48896b(++_0x370933);}(_0x5b20,0x86));var _0x05b2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5b20[_0x2be8c2];return _0x97f531;};'use strict';var client=require(_0x05b2('0x0'));exports[_0x05b2('0x1')]=function(){return function(){return client[_0x05b2('0x2')](_0x05b2('0x3'),{'options':{'raw':![],'attributes':['id',_0x05b2('0x4'),_0x05b2('0x5'),_0x05b2('0x6')],'include':[{'model':_0x05b2('0x7'),'as':_0x05b2('0x8'),'attributes':['id',_0x05b2('0x4'),_0x05b2('0x9'),'chatPause']}]},'log':_0x05b2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d89633c..5bdd91d 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 _0xc1c4=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x2c3aa6,_0xa7f5b5){var _0x87b451=function(_0x490e09){while(--_0x490e09){_0x2c3aa6['push'](_0x2c3aa6['shift']());}};_0x87b451(++_0xa7f5b5);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x31b936,_0x1a05a6){_0x31b936=_0x31b936-0x0;var _0x5d5f19=_0xc1c4[_0x31b936];return _0x5d5f19;};'use strict';var client=require(_0x4c1c('0x0'));exports[_0x4c1c('0x1')]=function(_0x2fb284){return client[_0x4c1c('0x2')](_0x4c1c('0x3'),{'body':_0x2fb284,'log':_0x4c1c('0x3')});};exports[_0x4c1c('0x4')]=function(_0x5b8a39,_0x5c1e2c){return client[_0x4c1c('0x2')](_0x4c1c('0x5'),{'body':_0x5c1e2c,'options':{'where':{'uniqueid':_0x5b8a39},'order':[['id',_0x4c1c('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x0f69=['UpdateChatQueueReport','CreateChatQueueReport'];(function(_0x29f6ec,_0x267ee8){var _0x45574e=function(_0x42f0e9){while(--_0x42f0e9){_0x29f6ec['push'](_0x29f6ec['shift']());}};_0x45574e(++_0x267ee8);}(_0x0f69,0x173));var _0x90f6=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x0f69[_0x4b73a2];return _0x383c66;};'use strict';var client=require('../client');exports['create']=function(_0x33c3e1){return client['Request'](_0x90f6('0x0'),{'body':_0x33c3e1,'log':_0x90f6('0x0')});};exports['update']=function(_0xd26ab5,_0x86022b){return client['Request'](_0x90f6('0x1'),{'body':_0x86022b,'options':{'where':{'uniqueid':_0xd26ab5},'order':[['id','DESC']],'limit':0x1},'log':_0x90f6('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 6107790..16373bb 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(_0x500b07,_0x506e2b){var _0x588be9=function(_0x2baadb){while(--_0x2baadb){_0x500b07['push'](_0x500b07['shift']());}};_0x588be9(++_0x506e2b);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x7a54,0x106));var _0x47a5=function(_0x164ca3,_0x2cc616){_0x164ca3=_0x164ca3-0x0;var _0x58fd1e=_0x7a54[_0x164ca3];return _0x58fd1e;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 819b27e..48518bc 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 _0x8752=['../client','create','Request','CreateFaxMessage'];(function(_0x185377,_0x34ea56){var _0x56634e=function(_0x469dc1){while(--_0x469dc1){_0x185377['push'](_0x185377['shift']());}};_0x56634e(++_0x34ea56);}(_0x8752,0x1e4));var _0x2875=function(_0x1adb00,_0x38e2eb){_0x1adb00=_0x1adb00-0x0;var _0x46fb0e=_0x8752[_0x1adb00];return _0x46fb0e;};'use strict';var client=require(_0x2875('0x0'));exports[_0x2875('0x1')]=function(_0x2d8579){return client[_0x2875('0x2')](_0x2875('0x3'),{'body':_0x2d8579,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x64e6=['Request','createFaxMessage','../client'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0x64e6,0x128));var _0x664e=function(_0x30cf9e,_0xf2c7fc){_0x30cf9e=_0x30cf9e-0x0;var _0x23539e=_0x64e6[_0x30cf9e];return _0x23539e;};'use strict';var client=require(_0x664e('0x0'));exports['create']=function(_0x483baf){return client[_0x664e('0x1')]('CreateFaxMessage',{'body':_0x483baf,'log':_0x664e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index fd56722..28bf93f 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 _0x3b8b=['name','timeout','online','faxPause','getFaxQueues','Request','GetFaxQueue'];(function(_0x314448,_0x49f79c){var _0x983bbf=function(_0x37fcd0){while(--_0x37fcd0){_0x314448['push'](_0x314448['shift']());}};_0x983bbf(++_0x49f79c);}(_0x3b8b,0x193));var _0xb3b8=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x3b8b[_0x1f5a63];return _0x30bb7a;};'use strict';var client=require('../client');exports[_0xb3b8('0x0')]=function(){return function(){return client[_0xb3b8('0x1')](_0xb3b8('0x2'),{'options':{'raw':![],'attributes':['id',_0xb3b8('0x3'),_0xb3b8('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xb3b8('0x3'),_0xb3b8('0x5'),_0xb3b8('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x64af=['strategy','User','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x4ddbb4,_0x28b434){var _0x338389=function(_0x27e261){while(--_0x27e261){_0x4ddbb4['push'](_0x4ddbb4['shift']());}};_0x338389(++_0x28b434);}(_0x64af,0x1ea));var _0xf64a=function(_0x4b96bd,_0xe341d){_0x4b96bd=_0x4b96bd-0x0;var _0x515ad8=_0x64af[_0x4b96bd];return _0x515ad8;};'use strict';var client=require(_0xf64a('0x0'));exports[_0xf64a('0x1')]=function(){return function(){return client[_0xf64a('0x2')](_0xf64a('0x3'),{'options':{'raw':![],'attributes':['id',_0xf64a('0x4'),'timeout',_0xf64a('0x5')],'include':[{'model':_0xf64a('0x6'),'as':'Agents','attributes':['id',_0xf64a('0x4'),_0xf64a('0x7'),_0xf64a('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index f98f48c..e2da641 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 _0xa82c=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x10181,_0x477366){var _0xb6ea48=function(_0x43ef10){while(--_0x43ef10){_0x10181['push'](_0x10181['shift']());}};_0xb6ea48(++_0x477366);}(_0xa82c,0x197));var _0xca82=function(_0x2aee95,_0x23aeb6){_0x2aee95=_0x2aee95-0x0;var _0x31b9bf=_0xa82c[_0x2aee95];return _0x31b9bf;};'use strict';var client=require(_0xca82('0x0'));exports[_0xca82('0x1')]=function(_0x2248ff){return client[_0xca82('0x2')](_0xca82('0x3'),{'body':_0x2248ff,'log':_0xca82('0x3')});};exports[_0xca82('0x4')]=function(_0x21aed9,_0x368974){return client[_0xca82('0x2')](_0xca82('0x5'),{'body':_0x368974,'options':{'where':{'uniqueid':_0x21aed9},'order':[['id',_0xca82('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xeca4=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC','create'];(function(_0xe6894,_0x25d3ef){var _0x2cb14f=function(_0x12160d){while(--_0x12160d){_0xe6894['push'](_0xe6894['shift']());}};_0x2cb14f(++_0x25d3ef);}(_0xeca4,0x125));var _0x4eca=function(_0xeeac43,_0x54c3ec){_0xeeac43=_0xeeac43-0x0;var _0x2b7b2e=_0xeca4[_0xeeac43];return _0x2b7b2e;};'use strict';var client=require('../client');exports[_0x4eca('0x0')]=function(_0x21e1df){return client['Request'](_0x4eca('0x1'),{'body':_0x21e1df,'log':_0x4eca('0x1')});};exports[_0x4eca('0x2')]=function(_0xb34c21,_0x37de08){return client[_0x4eca('0x3')](_0x4eca('0x4'),{'body':_0x37de08,'options':{'where':{'uniqueid':_0xb34c21},'order':[['id',_0x4eca('0x5')]],'limit':0x1},'log':_0x4eca('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 0c38f5d..ad2a326 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 _0x1e1d=['getIntervals','GetInterval','name','interval'];(function(_0x4fddf2,_0x496587){var _0x115e13=function(_0x5db836){while(--_0x5db836){_0x4fddf2['push'](_0x4fddf2['shift']());}};_0x115e13(++_0x496587);}(_0x1e1d,0x1d4));var _0xd1e1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x1e1d[_0x5f309e];return _0x487b5e;};'use strict';var client=require('../client');exports[_0xd1e1('0x0')]=function(){return function(){return client['Request'](_0xd1e1('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd1e1('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xd1e1('0x2'),_0xd1e1('0x3')]}]},'log':_0xd1e1('0x0')});};}; \ No newline at end of file +var _0x5362=['getIntervals','name','interval','../client'];(function(_0x593295,_0x4c7458){var _0x42f480=function(_0x39df81){while(--_0x39df81){_0x593295['push'](_0x593295['shift']());}};_0x42f480(++_0x4c7458);}(_0x5362,0x8f));var _0x2536=function(_0x21ea20,_0x35d074){_0x21ea20=_0x21ea20-0x0;var _0x2f0606=_0x5362[_0x21ea20];return _0x2f0606;};'use strict';var client=require(_0x2536('0x0'));exports[_0x2536('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2536('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0x2536('0x3')]}]},'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 0c682b4..6c913e6 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 _0x056b=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x2c4c3e,_0x380a36){var _0x4a652b=function(_0x5a8796){while(--_0x5a8796){_0x2c4c3e['push'](_0x2c4c3e['shift']());}};_0x4a652b(++_0x380a36);}(_0x056b,0xb6));var _0xb056=function(_0x3733eb,_0x2d9450){_0x3733eb=_0x3733eb-0x0;var _0x4c80e3=_0x056b[_0x3733eb];return _0x4c80e3;};'use strict';var client=require('../client');exports[_0xb056('0x0')]=function(_0x556e84,_0xed6810){return client[_0xb056('0x1')](_0xb056('0x2'),{'body':_0xed6810,'options':{'where':{'id':_0x556e84}},'log':_0xb056('0x3')});};exports[_0xb056('0x4')]=function(_0x4157e0,_0x343d88){return client[_0xb056('0x1')](_0xb056('0x5'),{'body':_0x343d88,'options':{'where':{'id':_0x4157e0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xdd4f=['../client','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x808077,_0x15b3bb){_0x808077=_0x808077-0x0;var _0x359005=_0xdd4f[_0x808077];return _0x359005;};'use strict';var client=require(_0xfdd4('0x0'));exports['update']=function(_0x5656ab,_0x55d8f9){return client[_0xfdd4('0x1')](_0xfdd4('0x2'),{'body':_0x55d8f9,'options':{'where':{'id':_0x5656ab}},'log':'updateMailInteraction'});};exports[_0xfdd4('0x3')]=function(_0x3175f6,_0x6b2b0d){return client['Request'](_0xfdd4('0x4'),{'body':_0x6b2b0d,'options':{'where':{'id':_0x3175f6}},'log':_0xfdd4('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 2743f44..614e6c0 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 _0x27ea=['create','../client'];(function(_0x5d4fe5,_0x1484a0){var _0x46e677=function(_0x597626){while(--_0x597626){_0x5d4fe5['push'](_0x5d4fe5['shift']());}};_0x46e677(++_0x1484a0);}(_0x27ea,0x67));var _0xa27e=function(_0x296a28,_0x196683){_0x296a28=_0x296a28-0x0;var _0x4c2c02=_0x27ea[_0x296a28];return _0x4c2c02;};'use strict';var client=require(_0xa27e('0x0'));exports[_0xa27e('0x1')]=function(_0x1206a8){return client['Request']('CreateMailMessage',{'body':_0x1206a8,'log':'createMailMessage'});}; \ No newline at end of file +var _0xe4f6=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe4f6,0x17d));var _0x6e4f=function(_0x48753a,_0x37c938){_0x48753a=_0x48753a-0x0;var _0x451236=_0xe4f6[_0x48753a];return _0x451236;};'use strict';var client=require(_0x6e4f('0x0'));exports[_0x6e4f('0x1')]=function(_0x459066){return client[_0x6e4f('0x2')](_0x6e4f('0x3'),{'body':_0x459066,'log':_0x6e4f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 5a0a2a2..7beff67 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 _0x6799=['User','Agents','../client','Request','GetMailQueue','name','timeout','strategy'];(function(_0x125205,_0x2159a6){var _0x38e5de=function(_0x1cba72){while(--_0x1cba72){_0x125205['push'](_0x125205['shift']());}};_0x38e5de(++_0x2159a6);}(_0x6799,0x172));var _0x9679=function(_0x4b5a3d,_0x3438eb){_0x4b5a3d=_0x4b5a3d-0x0;var _0x7edab8=_0x6799[_0x4b5a3d];return _0x7edab8;};'use strict';var client=require(_0x9679('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x9679('0x1')](_0x9679('0x2'),{'options':{'raw':![],'attributes':['id',_0x9679('0x3'),_0x9679('0x4'),_0x9679('0x5')],'include':[{'model':_0x9679('0x6'),'as':_0x9679('0x7'),'attributes':['id',_0x9679('0x3'),'online','mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x7df7=['User','online','mailPause','../client','getMailQueues','name'];(function(_0x39cff5,_0x234f0c){var _0x430437=function(_0xb2375){while(--_0xb2375){_0x39cff5['push'](_0x39cff5['shift']());}};_0x430437(++_0x234f0c);}(_0x7df7,0x1b9));var _0x77df=function(_0x278bb6,_0x23228f){_0x278bb6=_0x278bb6-0x0;var _0x284402=_0x7df7[_0x278bb6];return _0x284402;};'use strict';var client=require(_0x77df('0x0'));exports[_0x77df('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x77df('0x2'),'timeout','strategy'],'include':[{'model':_0x77df('0x3'),'as':'Agents','attributes':['id',_0x77df('0x2'),_0x77df('0x4'),_0x77df('0x5')]}]},'log':_0x77df('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index cf14cbe..a827321 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 _0x3e88=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x2fe90e,_0x4cbf3c){var _0x46a4f4=function(_0x2187e1){while(--_0x2187e1){_0x2fe90e['push'](_0x2fe90e['shift']());}};_0x46a4f4(++_0x4cbf3c);}(_0x3e88,0x92));var _0x83e8=function(_0x5c26d7,_0x5ecd19){_0x5c26d7=_0x5c26d7-0x0;var _0x39b9f6=_0x3e88[_0x5c26d7];return _0x39b9f6;};'use strict';var client=require(_0x83e8('0x0'));exports[_0x83e8('0x1')]=function(_0x5b6377){return client[_0x83e8('0x2')](_0x83e8('0x3'),{'body':_0x5b6377,'log':_0x83e8('0x3')});};exports[_0x83e8('0x4')]=function(_0x39a7b1,_0x380b11){return client['Request'](_0x83e8('0x5'),{'body':_0x380b11,'options':{'where':{'uniqueid':_0x39a7b1},'order':[['id',_0x83e8('0x6')]],'limit':0x1},'log':_0x83e8('0x5')});}; \ No newline at end of file +var _0x1a8f=['DESC','../client','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x1a8f,0x169));var _0xf1a8=function(_0x34f1a2,_0x1f7b1c){_0x34f1a2=_0x34f1a2-0x0;var _0x2572b9=_0x1a8f[_0x34f1a2];return _0x2572b9;};'use strict';var client=require(_0xf1a8('0x0'));exports['create']=function(_0x2b4d22){return client['Request'](_0xf1a8('0x1'),{'body':_0x2b4d22,'log':_0xf1a8('0x1')});};exports[_0xf1a8('0x2')]=function(_0x3e3925,_0x31ea5b){return client['Request'](_0xf1a8('0x3'),{'body':_0x31ea5b,'options':{'where':{'uniqueid':_0x3e3925},'order':[['id',_0xf1a8('0x4')]],'limit':0x1},'log':_0xf1a8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 6095271..bf2dc44 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 _0x56cf=['AddTagsToOpenchannelInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x87d385,_0x1b2297){var _0x1d890f=function(_0x4a3060){while(--_0x4a3060){_0x87d385['push'](_0x87d385['shift']());}};_0x1d890f(++_0x1b2297);}(_0x56cf,0xeb));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xf56c('0x0')]=function(_0x16d177,_0x5728e4){return client[_0xf56c('0x1')](_0xf56c('0x2'),{'body':_0x5728e4,'options':{'where':{'id':_0x16d177}},'log':_0xf56c('0x3')});};exports[_0xf56c('0x4')]=function(_0x214312,_0x1efa8b){return client['Request'](_0xf56c('0x5'),{'body':_0x1efa8b,'options':{'where':{'id':_0x214312}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2356=['AddTagsToOpenchannelInteraction','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x2356,0x18c));var _0x6235=function(_0x58c48d,_0x1a2ce1){_0x58c48d=_0x58c48d-0x0;var _0x451050=_0x2356[_0x58c48d];return _0x451050;};'use strict';var client=require('../client');exports['update']=function(_0x4e7ee5,_0x117b3b){return client[_0x6235('0x0')](_0x6235('0x1'),{'body':_0x117b3b,'options':{'where':{'id':_0x4e7ee5}},'log':_0x6235('0x2')});};exports[_0x6235('0x3')]=function(_0x52cf73,_0x3d55a1){return client['Request'](_0x6235('0x4'),{'body':_0x3d55a1,'options':{'where':{'id':_0x52cf73}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b66e6f9..ba30b0b 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 _0xd23a=['CreateOpenchannelMessage','../client','Request'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0xd23a,0x6a));var _0xad23=function(_0x5b68df,_0x30d4d9){_0x5b68df=_0x5b68df-0x0;var _0x319c5d=_0xd23a[_0x5b68df];return _0x319c5d;};'use strict';var client=require(_0xad23('0x0'));exports['create']=function(_0xfcc40d){return client[_0xad23('0x1')](_0xad23('0x2'),{'body':_0xfcc40d,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x1c0a=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x49d53f,_0x205e3e){var _0x3351d8=function(_0x2742b0){while(--_0x2742b0){_0x49d53f['push'](_0x49d53f['shift']());}};_0x3351d8(++_0x205e3e);}(_0x1c0a,0x89));var _0xa1c0=function(_0x23aa68,_0x55ccb6){_0x23aa68=_0x23aa68-0x0;var _0x10e045=_0x1c0a[_0x23aa68];return _0x10e045;};'use strict';var client=require(_0xa1c0('0x0'));exports[_0xa1c0('0x1')]=function(_0x34ca93){return client[_0xa1c0('0x2')](_0xa1c0('0x3'),{'body':_0x34ca93,'log':_0xa1c0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 2f33104..395ebb0 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 _0x2e77=['GetOpenchannelQueue','name','strategy','User','Agents','online','../client','getOpenchannelQueues','Request'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x2e77,0x12f));var _0x72e7=function(_0x33292b,_0x5360a9){_0x33292b=_0x33292b-0x0;var _0x294aa1=_0x2e77[_0x33292b];return _0x294aa1;};'use strict';var client=require(_0x72e7('0x0'));exports[_0x72e7('0x1')]=function(){return function(){return client[_0x72e7('0x2')](_0x72e7('0x3'),{'options':{'raw':![],'attributes':['id',_0x72e7('0x4'),'timeout',_0x72e7('0x5')],'include':[{'model':_0x72e7('0x6'),'as':_0x72e7('0x7'),'attributes':['id','name',_0x72e7('0x8'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xdf22=['Request','GetOpenchannelQueue','name','timeout','User','Agents','online','openchannelPause','getOpenchannelQueues'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0xdf22,0x74));var _0x2df2=function(_0x1e16a5,_0x4fac99){_0x1e16a5=_0x1e16a5-0x0;var _0xc27406=_0xdf22[_0x1e16a5];return _0xc27406;};'use strict';var client=require('../client');exports[_0x2df2('0x0')]=function(){return function(){return client[_0x2df2('0x1')](_0x2df2('0x2'),{'options':{'raw':![],'attributes':['id',_0x2df2('0x3'),_0x2df2('0x4'),'strategy'],'include':[{'model':_0x2df2('0x5'),'as':_0x2df2('0x6'),'attributes':['id',_0x2df2('0x3'),_0x2df2('0x7'),_0x2df2('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index a98339e..a8a8422 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 _0xc9fb=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','../client','create'];(function(_0x49378e,_0xa42d4b){var _0x243264=function(_0xed1456){while(--_0xed1456){_0x49378e['push'](_0x49378e['shift']());}};_0x243264(++_0xa42d4b);}(_0xc9fb,0x148));var _0xbc9f=function(_0x3b1fb7,_0x2ea375){_0x3b1fb7=_0x3b1fb7-0x0;var _0x31d6c5=_0xc9fb[_0x3b1fb7];return _0x31d6c5;};'use strict';var client=require(_0xbc9f('0x0'));exports[_0xbc9f('0x1')]=function(_0x3b19e1){return client['Request'](_0xbc9f('0x2'),{'body':_0x3b19e1,'log':'CreateOpenchannelQueueReport'});};exports[_0xbc9f('0x3')]=function(_0x38a859,_0x347405){return client[_0xbc9f('0x4')](_0xbc9f('0x5'),{'body':_0x347405,'options':{'where':{'uniqueid':_0x38a859},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xc1ae=['../client','create','update','Request','DESC','UpdateOpenchannelQueueReport'];(function(_0x438bc2,_0x2f6217){var _0x450355=function(_0x230e17){while(--_0x230e17){_0x438bc2['push'](_0x438bc2['shift']());}};_0x450355(++_0x2f6217);}(_0xc1ae,0xae));var _0xec1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1ae[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xec1a('0x0'));exports[_0xec1a('0x1')]=function(_0x4834cc){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x4834cc,'log':'CreateOpenchannelQueueReport'});};exports[_0xec1a('0x2')]=function(_0x2dc83f,_0x3b6a57){return client[_0xec1a('0x3')]('UpdateOpenchannelQueueReport',{'body':_0x3b6a57,'options':{'where':{'uniqueid':_0x2dc83f},'order':[['id',_0xec1a('0x4')]],'limit':0x1},'log':_0xec1a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index fcbb9cd..628f611 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 _0x2209=['update','Request','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x297be0,_0x108af9){var _0x163430=function(_0x4ded27){while(--_0x4ded27){_0x297be0['push'](_0x297be0['shift']());}};_0x163430(++_0x108af9);}(_0x2209,0x95));var _0x9220=function(_0x3239ff,_0x2bd7da){_0x3239ff=_0x3239ff-0x0;var _0x4cf834=_0x2209[_0x3239ff];return _0x4cf834;};'use strict';var client=require(_0x9220('0x0'));exports[_0x9220('0x1')]=function(_0x165787,_0x19bb93){return client[_0x9220('0x2')]('UpdateSmsInteraction',{'body':_0x19bb93,'options':{'where':{'id':_0x165787}},'log':_0x9220('0x3')});};exports['addTags']=function(_0x348220,_0x2fddae){return client[_0x9220('0x2')](_0x9220('0x4'),{'body':_0x2fddae,'options':{'where':{'id':_0x348220}},'log':_0x9220('0x5')});}; \ No newline at end of file +var _0xf2ca=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0xf2ca[_0x213ed5];return _0x191514;};'use strict';var client=require(_0xaf2c('0x0'));exports[_0xaf2c('0x1')]=function(_0x26a8a7,_0x598667){return client[_0xaf2c('0x2')](_0xaf2c('0x3'),{'body':_0x598667,'options':{'where':{'id':_0x26a8a7}},'log':_0xaf2c('0x4')});};exports[_0xaf2c('0x5')]=function(_0x3a724c,_0x10c910){return client['Request'](_0xaf2c('0x6'),{'body':_0x10c910,'options':{'where':{'id':_0x3a724c}},'log':_0xaf2c('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 8581057..3d1ec8e 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 _0xcd16=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x2254a0,_0x41f33e){var _0x35cd31=function(_0x5242d5){while(--_0x5242d5){_0x2254a0['push'](_0x2254a0['shift']());}};_0x35cd31(++_0x41f33e);}(_0xcd16,0x1be));var _0x6cd1=function(_0x42ac9f,_0x3677c6){_0x42ac9f=_0x42ac9f-0x0;var _0xe2e7d0=_0xcd16[_0x42ac9f];return _0xe2e7d0;};'use strict';var client=require(_0x6cd1('0x0'));exports[_0x6cd1('0x1')]=function(_0x4103ac){return client[_0x6cd1('0x2')](_0x6cd1('0x3'),{'body':_0x4103ac,'log':_0x6cd1('0x4')});}; \ No newline at end of file +var _0x382d=['create','Request','createSmsMessage','../client'];(function(_0x3b7b4e,_0x391ed1){var _0x1341af=function(_0x1d22d7){while(--_0x1d22d7){_0x3b7b4e['push'](_0x3b7b4e['shift']());}};_0x1341af(++_0x391ed1);}(_0x382d,0x167));var _0xd382=function(_0x180596,_0x67ee7a){_0x180596=_0x180596-0x0;var _0x774976=_0x382d[_0x180596];return _0x774976;};'use strict';var client=require(_0xd382('0x0'));exports[_0xd382('0x1')]=function(_0x5c63fe){return client[_0xd382('0x2')]('CreateSmsMessage',{'body':_0x5c63fe,'log':_0xd382('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0a8e755..89495f2 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x26b59d,_0xbf2e8a){var _0x3c1f19=function(_0x3efa63){while(--_0x3efa63){_0x26b59d['push'](_0x26b59d['shift']());}};_0x3c1f19(++_0xbf2e8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x51b169,_0x5efbc2){var _0x12605a=function(_0x570f5e){while(--_0x570f5e){_0x51b169['push'](_0x51b169['shift']());}};_0x12605a(++_0x5efbc2);}(_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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 8c868f3..75447be 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(_0xf979e8,_0x42c7f3){var _0x9a7d69=function(_0x478713){while(--_0x478713){_0xf979e8['push'](_0xf979e8['shift']());}};_0x9a7d69(++_0x42c7f3);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0xedd9,0xfc));var _0x9edd=function(_0x39f686,_0x3e14c9){_0x39f686=_0x39f686-0x0;var _0x318997=_0xedd9[_0x39f686];return _0x318997;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2647409..df66f0f 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(_0x168094,_0x3a2cb1){var _0x2c2a7a=function(_0x277a85){while(--_0x277a85){_0x168094['push'](_0x168094['shift']());}};_0x2c2a7a(++_0x3a2cb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x1aee9b,_0xd66160){var _0x2b8ae0=function(_0x5327f8){while(--_0x5327f8){_0x1aee9b['push'](_0x1aee9b['shift']());}};_0x2b8ae0(++_0xd66160);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 99f7cda..e9656d5 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 _0x307e=['Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x43a65b,_0xf6f770){var _0x201e50=function(_0x8a9718){while(--_0x8a9718){_0x43a65b['push'](_0x43a65b['shift']());}};_0x201e50(++_0xf6f770);}(_0x307e,0xc9));var _0xe307=function(_0x2ca6ba,_0x35adc8){_0x2ca6ba=_0x2ca6ba-0x0;var _0x2ba5c1=_0x307e[_0x2ca6ba];return _0x2ba5c1;};'use strict';var client=require(_0xe307('0x0'));exports[_0xe307('0x1')]=function(_0x3104f1,_0x4689ed){return client[_0xe307('0x2')]('UpdateWhatsappInteraction',{'body':_0x4689ed,'options':{'where':{'id':_0x3104f1}},'log':_0xe307('0x3')});};exports[_0xe307('0x4')]=function(_0x516a1d,_0x1eee4d){return client['Request'](_0xe307('0x5'),{'body':_0x1eee4d,'options':{'where':{'id':_0x516a1d}},'log':_0xe307('0x6')});}; \ No newline at end of file +var _0x2525=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x1c642c,_0x22abdf){var _0x48b879=function(_0x48f6c5){while(--_0x48f6c5){_0x1c642c['push'](_0x1c642c['shift']());}};_0x48b879(++_0x22abdf);}(_0x2525,0x1f0));var _0x5252=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x2525[_0x298ed3];return _0x5aad28;};'use strict';var client=require(_0x5252('0x0'));exports[_0x5252('0x1')]=function(_0x5de98b,_0x166a72){return client[_0x5252('0x2')](_0x5252('0x3'),{'body':_0x166a72,'options':{'where':{'id':_0x5de98b}},'log':_0x5252('0x4')});};exports[_0x5252('0x5')]=function(_0x28efdd,_0x4907eb){return client['Request'](_0x5252('0x6'),{'body':_0x4907eb,'options':{'where':{'id':_0x28efdd}},'log':_0x5252('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4c8c1d9..1c4065b 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 _0xd64d=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x43fe70,_0xd87ace){var _0x4f8159=function(_0xb24446){while(--_0xb24446){_0x43fe70['push'](_0x43fe70['shift']());}};_0x4f8159(++_0xd87ace);}(_0xd64d,0x8a));var _0xdd64=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd64d[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xdd64('0x0'));exports[_0xdd64('0x1')]=function(_0xf3a83b){return client[_0xdd64('0x2')](_0xdd64('0x3'),{'body':_0xf3a83b,'log':_0xdd64('0x4')});}; \ No newline at end of file +var _0x7e1d=['createWhatsappMessage','../client','Request','CreateWhatsappMessage'];(function(_0x1162aa,_0x3badb9){var _0x31855a=function(_0x41707a){while(--_0x41707a){_0x1162aa['push'](_0x1162aa['shift']());}};_0x31855a(++_0x3badb9);}(_0x7e1d,0xc9));var _0xd7e1=function(_0x3cf641,_0x2fc19e){_0x3cf641=_0x3cf641-0x0;var _0xd8b828=_0x7e1d[_0x3cf641];return _0xd8b828;};'use strict';var client=require(_0xd7e1('0x0'));exports['create']=function(_0x22b8e9){return client[_0xd7e1('0x1')](_0xd7e1('0x2'),{'body':_0x22b8e9,'log':_0xd7e1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 66f77fd..8b50eb0 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 _0xa438=['whatsappPause','../client','Request','GetWhatsappQueue','name','timeout','strategy','Agents','online'];(function(_0x35927c,_0x176a39){var _0x28f630=function(_0x4d58e5){while(--_0x4d58e5){_0x35927c['push'](_0x35927c['shift']());}};_0x28f630(++_0x176a39);}(_0xa438,0x14e));var _0x8a43=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa438[_0x8de54f];return _0x14cba4;};'use strict';var client=require(_0x8a43('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x8a43('0x1')](_0x8a43('0x2'),{'options':{'raw':![],'attributes':['id',_0x8a43('0x3'),_0x8a43('0x4'),_0x8a43('0x5')],'include':[{'model':'User','as':_0x8a43('0x6'),'attributes':['id',_0x8a43('0x3'),_0x8a43('0x7'),_0x8a43('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xa366=['strategy','User','Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x2f7a8a,_0x25a845){var _0x55e5fb=function(_0x99fb23){while(--_0x99fb23){_0x2f7a8a['push'](_0x2f7a8a['shift']());}};_0x55e5fb(++_0x25a845);}(_0xa366,0x108));var _0x6a36=function(_0x45cc09,_0x57f3ac){_0x45cc09=_0x45cc09-0x0;var _0x3459a3=_0xa366[_0x45cc09];return _0x3459a3;};'use strict';var client=require(_0x6a36('0x0'));exports[_0x6a36('0x1')]=function(){return function(){return client[_0x6a36('0x2')](_0x6a36('0x3'),{'options':{'raw':![],'attributes':['id',_0x6a36('0x4'),_0x6a36('0x5'),_0x6a36('0x6')],'include':[{'model':_0x6a36('0x7'),'as':_0x6a36('0x8'),'attributes':['id',_0x6a36('0x4'),'online',_0x6a36('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index ee4a0cb..59c4fe6 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 _0x5312=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x3febf8,_0x3a20b1){var _0x56b67d=function(_0x123166){while(--_0x123166){_0x3febf8['push'](_0x3febf8['shift']());}};_0x56b67d(++_0x3a20b1);}(_0x5312,0x113));var _0x2531=function(_0x171cfc,_0x173a65){_0x171cfc=_0x171cfc-0x0;var _0x164df=_0x5312[_0x171cfc];return _0x164df;};'use strict';var client=require(_0x2531('0x0'));exports[_0x2531('0x1')]=function(_0xec8cab){return client[_0x2531('0x2')](_0x2531('0x3'),{'body':_0xec8cab,'log':_0x2531('0x3')});};exports['update']=function(_0x553b0d,_0x31e410){return client[_0x2531('0x2')](_0x2531('0x4'),{'body':_0x31e410,'options':{'where':{'uniqueid':_0x553b0d},'order':[['id',_0x2531('0x5')]],'limit':0x1},'log':_0x2531('0x4')});}; \ No newline at end of file +var _0x72e2=['DESC','../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x484676,_0x22ec2b){var _0x447980=function(_0x3ec77f){while(--_0x3ec77f){_0x484676['push'](_0x484676['shift']());}};_0x447980(++_0x22ec2b);}(_0x72e2,0x199));var _0x272e=function(_0x4d705a,_0x3f26c5){_0x4d705a=_0x4d705a-0x0;var _0xc6b748=_0x72e2[_0x4d705a];return _0xc6b748;};'use strict';var client=require(_0x272e('0x0'));exports['create']=function(_0x3107f0){return client[_0x272e('0x1')](_0x272e('0x2'),{'body':_0x3107f0,'log':'CreateWhatsappQueueReport'});};exports[_0x272e('0x3')]=function(_0x3b66a6,_0x111eae){return client['Request'](_0x272e('0x4'),{'body':_0x111eae,'options':{'where':{'uniqueid':_0x3b66a6},'order':[['id',_0x272e('0x5')]],'limit':0x1},'log':_0x272e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 0876704..5a86624 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 _0x6cf4=['stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','atimeout','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','agent','error','log'];(function(_0x5b99bb,_0x437f83){var _0x3cf721=function(_0x180f57){while(--_0x180f57){_0x5b99bb['push'](_0x5b99bb['shift']());}};_0x3cf721(++_0x437f83);}(_0x6cf4,0x14b));var _0x46cf=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x6cf4[_0x349367];return _0x14179b;};'use strict';var schema=require(_0x46cf('0x0'));var _=require(_0x46cf('0x1'));var util=require('util');var seqqueue=require(_0x46cf('0x2'));var logger=require(_0x46cf('0x3'))(_0x46cf('0x4'));var strategy=require(_0x46cf('0x5'));var queue=schema({'name':{'type':_0x46cf('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x46cf('0x7')}});function writeLog(_0x5c01ac,_0x525bda,_0x16d6e5){return logger['info'](util[_0x46cf('0x8')](_0x46cf('0x9'),_0x5c01ac,_0x525bda[_0x46cf('0xa')],_0x16d6e5));}function handleFindAgent(_0xf5ce9){return function(_0x6cbbd2){return _0x6cbbd2['name']['toLowerCase']()===_0xf5ce9[_0x46cf('0xb')]();};}exports[_0x46cf('0xc')]=function(_0x129967,_0x3dd385,_0x1e13bc,_0x4db7e0){return function(_0x277d6f){try{var _0x69b7d7={'name':_0x3dd385[0x0],'timeout':_0x3dd385[0x1]};var _0x2c96f3=queue['validate'](_0x69b7d7,{'typecast':!![]});if(_0x2c96f3['length']){logger['error'](_0x46cf('0xd'),_0x129967,_[_0x46cf('0xe')](_0x2c96f3,_0x46cf('0xf'))[_0x46cf('0x10')](',\x20'));_0x277d6f[_0x46cf('0x11')]();}else{var _0x17632d=_[_0x46cf('0x12')](_0x1e13bc[_0x46cf('0x13')],handleFindAgent(_0x69b7d7['name']));if(_0x17632d){var _0x3bc140=(_0x69b7d7[_0x46cf('0x14')]||0xa)*0x3e8;var _0x537e05,_0x2c9530;var _0x197876=seqqueue['createQueue'](_0x3bc140);_0x197876['id']=_0x129967;_0x197876[_0x46cf('0x15')]=_0x3bc140;_0x197876['channel']=_0x4db7e0[_0x46cf('0x16')];writeLog(_0x129967,_0x17632d,util['format']('START:%s',_0x3bc140));_0x1e13bc[_0x46cf('0x17')][_0x129967]['on'](_0x46cf('0x18'),function(){logger[_0x46cf('0x19')](_0x46cf('0x1a'),_0x129967);clearTimeout(_0x2c9530);_0x2c9530=undefined;_0x197876[_0x46cf('0x1b')]();if(_0x1e13bc['rules'][_0x129967]){delete _0x1e13bc[_0x46cf('0x17')][_0x129967];}_0x277d6f[_0x46cf('0x11')]();});_0x1e13bc[_0x46cf('0x17')][_0x129967]['on']('complete',function(){if(_0x1e13bc[_0x46cf('0x17')][_0x129967]){delete _0x1e13bc['rules'][_0x129967];}});_0x2c9530=setTimeout(function(){logger[_0x46cf('0x19')](_0x46cf('0x1c'),_0x129967);clearTimeout(_0x2c9530);_0x197876[_0x46cf('0x1b')]();_0x277d6f['next']();},_0x3bc140);strategy[_0x46cf('0x1d')](_0x197876,_0x17632d,_0x1e13bc,_0x4db7e0);}else{logger[_0x46cf('0x1e')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x129967,_0x69b7d7[_0x46cf('0xa')]);_0x277d6f[_0x46cf('0x11')]();}}}catch(_0x2833d0){console[_0x46cf('0x1f')](_0x2833d0);logger[_0x46cf('0x1e')]('[%s][QUEUE]\x20%s',_0x129967,_0x2833d0[_0x46cf('0x20')]);_0x277d6f[_0x46cf('0x11')]();}};}; \ No newline at end of file +var _0x6601=['stop','agents','createQueue','atimeout','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','seq-queue','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','error','[%s][AGENT]\x20%s','map','message'];(function(_0xb40eb7,_0x4de806){var _0x5909eb=function(_0x35acdc){while(--_0x35acdc){_0xb40eb7['push'](_0xb40eb7['shift']());}};_0x5909eb(++_0x4de806);}(_0x6601,0x12f));var _0x1660=function(_0x30b2b2,_0x326759){_0x30b2b2=_0x30b2b2-0x0;var _0xe33eb1=_0x6601[_0x30b2b2];return _0xe33eb1;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0x1660('0x0'));var logger=require('../../../../config/logger')(_0x1660('0x1'));var strategy=require(_0x1660('0x2'));var queue=schema({'name':{'type':_0x1660('0x3'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1660('0x4'),'message':_0x1660('0x5')}});function writeLog(_0x41bd14,_0x4ad15c,_0x2c7e41){return logger[_0x1660('0x6')](util[_0x1660('0x7')](_0x1660('0x8'),_0x41bd14,_0x4ad15c[_0x1660('0x9')],_0x2c7e41));}function handleFindAgent(_0x5a8826){return function(_0xc01f0d){return _0xc01f0d[_0x1660('0x9')][_0x1660('0xa')]()===_0x5a8826[_0x1660('0xa')]();};}exports[_0x1660('0xb')]=function(_0xf3aa55,_0x29049a,_0x41f0fa,_0xec13b){return function(_0x173247){try{var _0x2c247f={'name':_0x29049a[0x0],'timeout':_0x29049a[0x1]};var _0x391e44=queue[_0x1660('0xc')](_0x2c247f,{'typecast':!![]});if(_0x391e44['length']){logger[_0x1660('0xd')](_0x1660('0xe'),_0xf3aa55,_[_0x1660('0xf')](_0x391e44,_0x1660('0x10'))['join'](',\x20'));_0x173247[_0x1660('0x11')]();}else{var _0x2f8260=_['find'](_0x41f0fa[_0x1660('0x12')],handleFindAgent(_0x2c247f['name']));if(_0x2f8260){var _0x5d1cfc=(_0x2c247f['timeout']||0xa)*0x3e8;var _0x1edc81,_0x22e5f0;var _0x104235=seqqueue[_0x1660('0x13')](_0x5d1cfc);_0x104235['id']=_0xf3aa55;_0x104235[_0x1660('0x14')]=_0x5d1cfc;_0x104235['channel']=_0xec13b['channel'];writeLog(_0xf3aa55,_0x2f8260,util[_0x1660('0x7')]('START:%s',_0x5d1cfc));_0x41f0fa[_0x1660('0x15')][_0xf3aa55]['on'](_0x1660('0x16'),function(){logger[_0x1660('0x6')](_0x1660('0x17'),_0xf3aa55);clearTimeout(_0x22e5f0);_0x22e5f0=undefined;_0x104235[_0x1660('0x18')]();if(_0x41f0fa[_0x1660('0x15')][_0xf3aa55]){delete _0x41f0fa[_0x1660('0x15')][_0xf3aa55];}_0x173247[_0x1660('0x11')]();});_0x41f0fa[_0x1660('0x15')][_0xf3aa55]['on'](_0x1660('0x19'),function(){if(_0x41f0fa[_0x1660('0x15')][_0xf3aa55]){delete _0x41f0fa[_0x1660('0x15')][_0xf3aa55];}});_0x22e5f0=setTimeout(function(){logger[_0x1660('0x6')](_0x1660('0x1a'),_0xf3aa55);clearTimeout(_0x22e5f0);_0x104235[_0x1660('0x18')]();_0x173247[_0x1660('0x1b')]();},_0x5d1cfc);strategy['agent'](_0x104235,_0x2f8260,_0x41f0fa,_0xec13b);}else{logger[_0x1660('0xd')](_0x1660('0x1c'),_0xf3aa55,_0x2c247f['name']);_0x173247[_0x1660('0x11')]();}}}catch(_0x21c042){console[_0x1660('0x1d')](_0x21c042);logger['error'](_0x1660('0x1e'),_0xf3aa55,_0x21c042[_0x1660('0x1f')]);_0x173247[_0x1660('0x11')]();}};}; \ 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 29d0aa6..f2a4002 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 _0xb07b=['Failed','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','[%s][AMAZONLEX]\x20%s','stringify','stop','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','dialogState'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xb07b,0x189));var _0xbb07=function(_0x37473e,_0x4a1aa8){_0x37473e=_0x37473e-0x0;var _0x2635f7=_0xb07b[_0x37473e];return _0x2635f7;};'use strict';var _=require(_0xbb07('0x0'));var moment=require('moment');var AWS=require(_0xbb07('0x1'));var utils=require('./utils');var logger=require(_0xbb07('0x2'))(_0xbb07('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xbb07('0x4')),'mailMessage':require(_0xbb07('0x5')),'smsMessage':require(_0xbb07('0x6')),'faxMessage':require(_0xbb07('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xbb07('0x8')]=function(_0x533348,_0x2a05a3){return function(_0x444370){try{if(!_[_0xbb07('0x9')](this[_0xbb07('0xa')][_0xbb07('0xb')])){logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20%s',_0x533348,_0xbb07('0xd'));return _0x444370['next']();}var _0x3db203={'ContactId':this[_0xbb07('0xe')]['id'],'sentAt':moment()[_0xbb07('0xf')](_0xbb07('0x10')),'direction':'out'};if(this[_0xbb07('0x11')]===_0xbb07('0x12')||this[_0xbb07('0x11')]===_0xbb07('0x13')){_0x3db203['phone']=this[_0xbb07('0xa')][_0xbb07('0x14')];}var _0x22a552=this[_0xbb07('0x11')];if(_0x22a552==='chat'){_0x3db203[_0xbb07('0x15')]=this[_0xbb07('0x16')]['id'];}else{_0x3db203[_['upperFirst'](_0x22a552)+_0xbb07('0x17')]=this[_0xbb07('0x16')]['id'];}_0x3db203[_[_0xbb07('0x18')](_0x22a552)+_0xbb07('0x19')]=this['interaction']['id'];if(this['interaction'][_0xbb07('0x1a')]){var _0x1e0a56=_0x2a05a3[0x4];if(!_[_0xbb07('0x1b')](_0x1e0a56)){_0x3db203[_0xbb07('0x1c')]=utils[_0xbb07('0x1d')](_0x1e0a56,this);return rpc[_0x22a552+_0xbb07('0x1e')][_0xbb07('0x1f')](_0x3db203)[_0xbb07('0x20')](function(_0x4056da){logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20%s',_0x533348,_0x3db203['body']);})[_0xbb07('0x21')](function(_0x47f19f){logger[_0xbb07('0x22')](_0xbb07('0x23'),_0x533348,JSON[_0xbb07('0x24')](_0x47f19f));})['finally'](function(){logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x533348);_0x444370['stop']();});}else{logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x533348);_0x444370[_0xbb07('0x25')]();}}else{var _0xe408fb=this;var _0x220747=new AWS[(_0xbb07('0x26'))]({'accessKeyId':_0x2a05a3[0x0],'secretAccessKey':_0x2a05a3[0x1],'region':_0x2a05a3[0x2]});var _0x16bf34={'botAlias':_0xbb07('0x27'),'botName':_0x2a05a3[0x3],'inputText':this[_0xbb07('0x28')][_0xbb07('0x1c')],'userId':this[_0xbb07('0x11')]+':'+this[_0xbb07('0xa')]['id'][_0xbb07('0x29')]()};_0x220747[_0xbb07('0x2a')](_0x16bf34,function(_0x53ab03,_0x269cce){if(_0x53ab03){logger['error'](_0xbb07('0x23'),_0x533348,_0x53ab03[_0xbb07('0x28')]);_0x444370[_0xbb07('0x2b')]();}else if(_0x269cce&&_0x269cce['message']){_0xe408fb[_0xbb07('0x1c')][_0xbb07('0x2c')]=_0x269cce;_0x3db203[_0xbb07('0x1c')]=_0x269cce[_0xbb07('0x28')];_0x3db203[_0xbb07('0x2d')]=_0xbb07('0x2c');_0x3db203[_0xbb07('0x2e')]=JSON[_0xbb07('0x24')](_0x269cce);return rpc[_0x22a552+_0xbb07('0x1e')][_0xbb07('0x1f')](_0x3db203)[_0xbb07('0x20')](function(_0x3448f4){logger[_0xbb07('0xc')](_0xbb07('0x23'),_0x533348,_0x3db203[_0xbb07('0x1c')]);if(_0x269cce[_0xbb07('0x2f')]==_0xbb07('0x30')){_0x444370[_0xbb07('0x2b')]();}else{_0x444370[_0xbb07('0x25')]();}})[_0xbb07('0x21')](function(_0x564f31){logger['error'](_0xbb07('0x23'),_0x533348,JSON['stringify'](_0x564f31));_0x444370[_0xbb07('0x2b')]();});}else{_0x444370['next']();}});}}catch(_0x48ebfe){logger['error'](_0xbb07('0x23'),_0x533348,JSON[_0xbb07('0x24')](_0x48ebfe));_0x444370[_0xbb07('0x25')]();}};}; \ No newline at end of file +var _0x4844=['info','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','AccountId','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','[%s][AMAZONLEX]\x20%s','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','postText','error','next','amazonlex','providerName','providerResponse','then','dialogState','moment','aws-sdk','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId'];(function(_0x540e85,_0x3c0932){var _0x252981=function(_0x54bdfb){while(--_0x54bdfb){_0x540e85['push'](_0x540e85['shift']());}};_0x252981(++_0x3c0932);}(_0x4844,0xfe));var _0x4484=function(_0x5c357d,_0x195161){_0x5c357d=_0x5c357d-0x0;var _0x542f7e=_0x4844[_0x5c357d];return _0x542f7e;};'use strict';var _=require('lodash');var moment=require(_0x4484('0x0'));var AWS=require(_0x4484('0x1'));var utils=require('./utils');var logger=require(_0x4484('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4484('0x3')),'mailMessage':require(_0x4484('0x4')),'smsMessage':require(_0x4484('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4484('0x6')]=function(_0x598d58,_0x1fe8e0){return function(_0x197c8a){try{if(!_[_0x4484('0x7')](this[_0x4484('0x8')][_0x4484('0x9')])){logger[_0x4484('0xa')]('[%s][AMAZONLEX]\x20%s',_0x598d58,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x197c8a['next']();}var _0x4e41d7={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x4484('0xb')),'direction':_0x4484('0xc')};if(this[_0x4484('0xd')]===_0x4484('0xe')||this[_0x4484('0xd')]===_0x4484('0xf')){_0x4e41d7[_0x4484('0x10')]=this['interaction'][_0x4484('0x10')];}var _0x426dbd=this[_0x4484('0xd')];if(_0x426dbd===_0x4484('0x11')){_0x4e41d7['ChatWebsiteId']=this[_0x4484('0x12')]['id'];}else{_0x4e41d7[_['upperFirst'](_0x426dbd)+_0x4484('0x13')]=this[_0x4484('0x12')]['id'];}_0x4e41d7[_[_0x4484('0x14')](_0x426dbd)+_0x4484('0x15')]=this[_0x4484('0x8')]['id'];if(this[_0x4484('0x8')][_0x4484('0x16')]){var _0xececc1=_0x1fe8e0[0x4];if(!_['isEmpty'](_0xececc1)){_0x4e41d7[_0x4484('0x17')]=utils[_0x4484('0x18')](_0xececc1,this);return rpc[_0x426dbd+_0x4484('0x19')][_0x4484('0x1a')](_0x4e41d7)['then'](function(_0x595ee2){logger[_0x4484('0xa')](_0x4484('0x1b'),_0x598d58,_0x4e41d7['body']);})[_0x4484('0x1c')](function(_0x5db48d){logger['error'](_0x4484('0x1b'),_0x598d58,JSON[_0x4484('0x1d')](_0x5db48d));})[_0x4484('0x1e')](function(){logger[_0x4484('0xa')](_0x4484('0x1f'),_0x598d58);_0x197c8a[_0x4484('0x20')]();});}else{logger['info'](_0x4484('0x21'),_0x598d58);_0x197c8a[_0x4484('0x20')]();}}else{var _0x25e4bd=this;var _0x4be758=new AWS['LexRuntime']({'accessKeyId':_0x1fe8e0[0x0],'secretAccessKey':_0x1fe8e0[0x1],'region':_0x1fe8e0[0x2]});var _0x4f27aa={'botAlias':_0x4484('0x22'),'botName':_0x1fe8e0[0x3],'inputText':this[_0x4484('0x23')][_0x4484('0x17')],'userId':this[_0x4484('0xd')]+':'+this['interaction']['id']['toString']()};_0x4be758[_0x4484('0x24')](_0x4f27aa,function(_0x566303,_0xc76296){if(_0x566303){logger[_0x4484('0x25')]('[%s][AMAZONLEX]\x20%s',_0x598d58,_0x566303[_0x4484('0x23')]);_0x197c8a[_0x4484('0x26')]();}else if(_0xc76296&&_0xc76296[_0x4484('0x23')]){_0x25e4bd[_0x4484('0x17')][_0x4484('0x27')]=_0xc76296;_0x4e41d7[_0x4484('0x17')]=_0xc76296[_0x4484('0x23')];_0x4e41d7[_0x4484('0x28')]=_0x4484('0x27');_0x4e41d7[_0x4484('0x29')]=JSON[_0x4484('0x1d')](_0xc76296);return rpc[_0x426dbd+_0x4484('0x19')]['create'](_0x4e41d7)[_0x4484('0x2a')](function(_0x1de5a1){logger['info'](_0x4484('0x1b'),_0x598d58,_0x4e41d7[_0x4484('0x17')]);if(_0xc76296[_0x4484('0x2b')]=='Failed'){_0x197c8a[_0x4484('0x26')]();}else{_0x197c8a[_0x4484('0x20')]();}})[_0x4484('0x1c')](function(_0x5b013f){logger[_0x4484('0x25')](_0x4484('0x1b'),_0x598d58,JSON[_0x4484('0x1d')](_0x5b013f));_0x197c8a[_0x4484('0x26')]();});}else{_0x197c8a['next']();}});}}catch(_0xb048c8){logger[_0x4484('0x25')](_0x4484('0x1b'),_0x598d58,JSON[_0x4484('0x1d')](_0xb048c8));_0x197c8a[_0x4484('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 e0ff893..418cdef 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 _0x9437=['[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','finally','resolve','then','autoreplyExecuted','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','channel','getMustacheRender','message','from','phone','subject','Re:\x20','chat','account','upperFirst','AccountId','inReplyTo','messageId','html','','replace','';_0x5c99d2[_0x7943('0x31')]={'Auto-Submitted':_0x7943('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0x7943('0x33')};return mailRpc['sendMailMessage'](this['account'][_0x7943('0x34')],_0x5c99d2)['then'](function(_0x507527){logger['info'](_0x7943('0x35'),_0x17d08c);_0x5c99d2[_0x7943('0x2b')]=_0x507527[_0x7943('0x21')][_0x7943('0x2b')];return rpc[_0x303a5c+'Message'][_0x7943('0x36')](_0x5c99d2);})['then'](function(_0x411cbc){logger[_0x7943('0x13')](_0x7943('0x14'),_0x17d08c,JSON[_0x7943('0x37')](_0x411cbc));})['catch'](function(_0x1fceca){logger[_0x7943('0x38')]('[RPC][%s][AUTOREPLY]\x20%s',_0x17d08c,JSON['stringify'](_0x1fceca));})[_0x7943('0x39')](function(){Promise[_0x7943('0x3a')]()[_0x7943('0x3b')](function(){if(_0x254d1e[0x0]!=='2'||_0x37d230[_0x7943('0x3c')])return;return rpc[_0x303a5c+_0x7943('0x3d')][_0x7943('0x3e')](_0x37d230['id'],{'autoreplyExecuted':!![]})[_0x7943('0x3b')](function(_0x2cc828){logger['info'](_0x7943('0x1b'),_0x17d08c,JSON[_0x7943('0x37')](_0x2cc828));})[_0x7943('0x3f')](function(_0x52fa38){logger[_0x7943('0x38')](_0x7943('0x40'),_0x17d08c,JSON[_0x7943('0x37')](_0x52fa38));});})[_0x7943('0x3b')](function(){_0x5f2d51['next']();});});}else{return rpc[this['channel']+'Message'][_0x7943('0x36')](_0x5c99d2)['then'](function(){logger[_0x7943('0x13')](_0x7943('0x14'),_0x17d08c,_0x5c99d2[_0x7943('0x11')]);})[_0x7943('0x3f')](function(_0x53f03d){logger[_0x7943('0x38')](_0x7943('0x14'),_0x17d08c,JSON[_0x7943('0x37')](_0x53f03d));})[_0x7943('0x39')](function(){Promise[_0x7943('0x3a')]()[_0x7943('0x3b')](function(){if(_0x254d1e[0x0]!=='2'||_0x37d230[_0x7943('0x3c')])return;return rpc[_0x303a5c+_0x7943('0x3d')]['update'](_0x37d230['id'],{'autoreplyExecuted':!![]})[_0x7943('0x3b')](function(_0x5edcf4){logger[_0x7943('0x13')](_0x7943('0x1b'),_0x17d08c,JSON[_0x7943('0x37')](_0x5edcf4));})[_0x7943('0x3f')](function(_0x3391f5){logger[_0x7943('0x38')](_0x7943('0x40'),_0x17d08c,JSON[_0x7943('0x37')](_0x3391f5));});})[_0x7943('0x3b')](function(){_0x5f2d51[_0x7943('0x16')]();});});}}}catch(_0x35b961){logger[_0x7943('0x38')](_0x7943('0x14'),_0x17d08c,JSON[_0x7943('0x37')](_0x35b961));_0x5f2d51[_0x7943('0x41')]();}};}; \ No newline at end of file +var _0x1752=['catch','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','inReplyTo','messageId','html','','replace','body','';_0x5bce73[_0x2175('0x34')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x2175('0x35'),'Precedence':_0x2175('0x36')};return mailRpc[_0x2175('0x37')](this['account'][_0x2175('0x38')],_0x5bce73)['then'](function(_0x103b47){logger[_0x2175('0x12')](_0x2175('0x39'),_0x9ebf40);_0x5bce73[_0x2175('0x2d')]=_0x103b47['message'][_0x2175('0x2d')];return rpc[_0x161b20+_0x2175('0x2b')][_0x2175('0x3a')](_0x5bce73);})[_0x2175('0x3b')](function(_0xc31f02){logger[_0x2175('0x12')](_0x2175('0x13'),_0x9ebf40,JSON[_0x2175('0x3c')](_0xc31f02));})['catch'](function(_0x15c9ac){logger[_0x2175('0x3d')](_0x2175('0x3e'),_0x9ebf40,JSON[_0x2175('0x3c')](_0x15c9ac));})[_0x2175('0x3f')](function(){Promise[_0x2175('0x40')]()[_0x2175('0x3b')](function(){if(_0x3d1e83[0x0]!=='2'||_0x4c11b9[_0x2175('0x41')])return;return rpc[_0x161b20+'Interaction'][_0x2175('0x42')](_0x4c11b9['id'],{'autoreplyExecuted':!![]})[_0x2175('0x3b')](function(_0x4c306e){logger['info'](_0x2175('0x43'),_0x9ebf40,JSON[_0x2175('0x3c')](_0x4c306e));})[_0x2175('0x44')](function(_0x3ee081){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x9ebf40,JSON['stringify'](_0x3ee081));});})['then'](function(){_0x6147ad[_0x2175('0x14')]();});});}else{return rpc[this[_0x2175('0xf')]+_0x2175('0x2b')]['create'](_0x5bce73)[_0x2175('0x3b')](function(){logger[_0x2175('0x12')](_0x2175('0x13'),_0x9ebf40,_0x5bce73['body']);})[_0x2175('0x44')](function(_0x21390f){logger['error'](_0x2175('0x13'),_0x9ebf40,JSON['stringify'](_0x21390f));})[_0x2175('0x3f')](function(){Promise[_0x2175('0x40')]()['then'](function(){if(_0x3d1e83[0x0]!=='2'||_0x4c11b9[_0x2175('0x41')])return;return rpc[_0x161b20+'Interaction'][_0x2175('0x42')](_0x4c11b9['id'],{'autoreplyExecuted':!![]})[_0x2175('0x3b')](function(_0x1320c3){logger[_0x2175('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x9ebf40,JSON[_0x2175('0x3c')](_0x1320c3));})[_0x2175('0x44')](function(_0xa5aab){logger[_0x2175('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x9ebf40,JSON['stringify'](_0xa5aab));});})[_0x2175('0x3b')](function(){_0x6147ad['next']();});});}}}catch(_0x2aa303){logger[_0x2175('0x3d')](_0x2175('0x13'),_0x9ebf40,JSON['stringify'](_0x2aa303));_0x6147ad['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index d09d982..5e2512d 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa656=['[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','catch','error'];(function(_0x21d5a8,_0x237be5){var _0x25ce6d=function(_0x58963e){while(--_0x58963e){_0x21d5a8['push'](_0x21d5a8['shift']());}};_0x25ce6d(++_0x237be5);}(_0xa656,0x115));var _0x6a65=function(_0x93b6f6,_0x5e603d){_0x93b6f6=_0x93b6f6-0x0;var _0x142f15=_0xa656[_0x93b6f6];return _0x142f15;};'use strict';var moment=require(_0x6a65('0x0'));var logger=require(_0x6a65('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6a65('0x2')),'mailInteraction':require(_0x6a65('0x3')),'faxInteraction':require(_0x6a65('0x4')),'whatsappInteraction':require(_0x6a65('0x5'))};exports[_0x6a65('0x6')]=function(_0x30a559,_0x43f74a,_0x4d0a65,_0x42308a){return function(_0x2bb985){try{logger[_0x6a65('0x7')](_0x6a65('0x8'),_0x30a559,_0x43f74a[0x0]);var _0x1af64a={'closed':0x1,'closedAt':moment()['format'](_0x6a65('0x9')),'closeReason':'system','disposition':_0x43f74a[0x0]};if(rpc[_0x42308a[_0x6a65('0xa')]+_0x6a65('0xb')]){rpc[_0x42308a['channel']+'Interaction'][_0x6a65('0xc')](_0x42308a[_0x6a65('0xd')]['id'],_0x1af64a)[_0x6a65('0xe')](function(_0x21c154){logger[_0x6a65('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x30a559,_0x42308a[_0x6a65('0xd')]['id']);})[_0x6a65('0xf')](function(_0x5eb376){logger[_0x6a65('0x10')](_0x6a65('0x11'),_0x30a559,JSON[_0x6a65('0x12')](_0x5eb376));})[_0x6a65('0x13')](function(){_0x2bb985[_0x6a65('0x14')]();});}}catch(_0x3abde9){logger['error'](_0x6a65('0x11'),_0x30a559,JSON[_0x6a65('0x12')](_0x3abde9));_0x2bb985['stop']();}};}; \ No newline at end of file +var _0x76c5=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x126f23,_0x2be51c){var _0x401b6f=function(_0x1fd475){while(--_0x1fd475){_0x126f23['push'](_0x126f23['shift']());}};_0x401b6f(++_0x2be51c);}(_0x76c5,0xba));var _0x576c=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x76c5[_0x47568e];return _0x33815b;};'use strict';var moment=require(_0x576c('0x0'));var logger=require(_0x576c('0x1'))(_0x576c('0x2'));var rpc={'chatInteraction':require(_0x576c('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x576c('0x4')),'mailInteraction':require(_0x576c('0x5')),'faxInteraction':require(_0x576c('0x6')),'whatsappInteraction':require(_0x576c('0x7'))};exports[_0x576c('0x8')]=function(_0x13dab3,_0x32187a,_0x2620f0,_0x1518d9){return function(_0x400611){try{logger[_0x576c('0x9')](_0x576c('0xa'),_0x13dab3,_0x32187a[0x0]);var _0x30aaa1={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x576c('0xb'),'disposition':_0x32187a[0x0]};if(rpc[_0x1518d9[_0x576c('0xc')]+_0x576c('0xd')]){rpc[_0x1518d9[_0x576c('0xc')]+_0x576c('0xd')][_0x576c('0xe')](_0x1518d9[_0x576c('0xf')]['id'],_0x30aaa1)[_0x576c('0x10')](function(_0x276bc1){logger[_0x576c('0x9')](_0x576c('0x11'),_0x13dab3,_0x1518d9[_0x576c('0xf')]['id']);})[_0x576c('0x12')](function(_0x267eb8){logger[_0x576c('0x13')](_0x576c('0x14'),_0x13dab3,JSON['stringify'](_0x267eb8));})[_0x576c('0x15')](function(){_0x400611['stop']();});}}catch(_0xaedb08){logger[_0x576c('0x13')]('[%s][CLOSE]\x20%s',_0x13dab3,JSON[_0x576c('0x16')](_0xaedb08));_0x400611[_0x576c('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index d4a9eb8..6b1b885 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','created','isEmpty','create','body','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','then','fulfillment','speech','providerName','dialogflow','providerResponse','Message','result','catch'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x524e,0x15e));var _0xe524=function(_0x12489f,_0x7b7dd){_0x12489f=_0x12489f-0x0;var _0x316b12=_0x524e[_0x12489f];return _0x316b12;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xe524('0x0'));var md5=require(_0xe524('0x1'));var utils=require(_0xe524('0x2'));var logger=require(_0xe524('0x3'))(_0xe524('0x4'));var rpc={'chatMessage':require(_0xe524('0x5')),'openchannelMessage':require(_0xe524('0x6')),'mailMessage':require(_0xe524('0x7')),'smsMessage':require(_0xe524('0x8')),'faxMessage':require(_0xe524('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xe524('0xa')]=function(_0x41e1a3,_0x347bed){return function(_0x533c14){try{if(!_[_0xe524('0xb')](this[_0xe524('0xc')][_0xe524('0xd')])){logger[_0xe524('0xe')](_0xe524('0xf'),_0x41e1a3,_0xe524('0x10'));return _0x533c14[_0xe524('0x11')]();}var _0xb3eb9f={'ContactId':this[_0xe524('0x12')]['id'],'sentAt':moment()[_0xe524('0x13')](_0xe524('0x14')),'direction':_0xe524('0x15')};if(this[_0xe524('0x16')]===_0xe524('0x17')||this[_0xe524('0x16')]===_0xe524('0x18')){_0xb3eb9f['phone']=this['interaction'][_0xe524('0x19')];}var _0x1541d8=this[_0xe524('0x16')];if(_0x1541d8===_0xe524('0x1a')){_0xb3eb9f[_0xe524('0x1b')]=this['account']['id'];}else{_0xb3eb9f[_[_0xe524('0x1c')](_0x1541d8)+'AccountId']=this[_0xe524('0x1d')]['id'];}_0xb3eb9f[_[_0xe524('0x1c')](_0x1541d8)+'InteractionId']=this[_0xe524('0xc')]['id'];if(this['interaction'][_0xe524('0x1e')]){var _0x538754=_0x347bed[0x2];if(!_[_0xe524('0x1f')](_0x538754)){_0xb3eb9f['body']=utils['getMustacheRender'](_0x538754,this);return rpc[_0x1541d8+'Message'][_0xe524('0x20')](_0xb3eb9f)['then'](function(_0x11b2a1){logger[_0xe524('0xe')](_0xe524('0xf'),_0x41e1a3,_0xb3eb9f[_0xe524('0x21')]);})['catch'](function(_0x1fd93a){logger[_0xe524('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x41e1a3,JSON[_0xe524('0x23')](_0x1fd93a));})[_0xe524('0x24')](function(){logger[_0xe524('0xe')](_0xe524('0x25'),_0x41e1a3);_0x533c14[_0xe524('0x26')]();});}else{logger[_0xe524('0xe')](_0xe524('0x27'),_0x41e1a3);_0x533c14[_0xe524('0x26')]();}}else{var _0x7dfe97=this;var _0x5c4d21=apiai(_0x347bed[0x0],{'language':_0x347bed[0x1]||'en'});return _0x5c4d21[_0xe524('0x28')](this['message']['body'],{'sessionId':md5(this[_0xe524('0xc')]['id'])})[_0xe524('0x29')](function(_0x1ad106){_0x7dfe97[_0xe524('0x21')]['dialogflow']=_0x1ad106;_0xb3eb9f[_0xe524('0x21')]=_0x1ad106['result'][_0xe524('0x2a')][_0xe524('0x2b')];_0xb3eb9f[_0xe524('0x2c')]=_0xe524('0x2d');_0xb3eb9f[_0xe524('0x2e')]=JSON[_0xe524('0x23')](_0x1ad106);return rpc[_0x1541d8+_0xe524('0x2f')]['create'](_0xb3eb9f)['then'](function(_0x283f18){logger[_0xe524('0xe')](_0xe524('0xf'),_0x41e1a3,_0xb3eb9f[_0xe524('0x21')]);if(_0x1ad106[_0xe524('0x30')]['metadata']['endConversation']){_0x533c14[_0xe524('0x11')]();}else{_0x533c14[_0xe524('0x26')]();}})[_0xe524('0x31')](function(_0x8070e4){logger[_0xe524('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x41e1a3,JSON[_0xe524('0x23')](_0x8070e4));_0x533c14[_0xe524('0x11')]();});})['catch'](function(_0x5b7ded){logger[_0xe524('0x22')](_0xe524('0xf'),_0x41e1a3,_0x5b7ded['message']);_0x533c14[_0xe524('0x11')]();});}}catch(_0x535354){logger[_0xe524('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x41e1a3,JSON[_0xe524('0x23')](_0x535354));_0x533c14[_0xe524('0x26')]();}};}; \ No newline at end of file +var _0x0c75=['finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','then','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','error','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','sms','phone','interaction','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','body','catch','stringify'];(function(_0xaf6108,_0x46f44e){var _0x6946e4=function(_0x3e744f){while(--_0x3e744f){_0xaf6108['push'](_0xaf6108['shift']());}};_0x6946e4(++_0x46f44e);}(_0x0c75,0x6a));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require(_0x50c7('0x0'));var apiai=require('apiai-promise');var md5=require(_0x50c7('0x1'));var utils=require(_0x50c7('0x2'));var logger=require(_0x50c7('0x3'))(_0x50c7('0x4'));var rpc={'chatMessage':require(_0x50c7('0x5')),'openchannelMessage':require(_0x50c7('0x6')),'mailMessage':require(_0x50c7('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x50c7('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x50c7('0x9')]=function(_0x594830,_0x34a297){return function(_0x172856){try{if(!_[_0x50c7('0xa')](this['interaction']['UserId'])){logger[_0x50c7('0xb')](_0x50c7('0xc'),_0x594830,_0x50c7('0xd'));return _0x172856[_0x50c7('0xe')]();}var _0x3dcf76={'ContactId':this[_0x50c7('0xf')]['id'],'sentAt':moment()[_0x50c7('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x50c7('0x11')]===_0x50c7('0x12')||this[_0x50c7('0x11')]==='whatsapp'){_0x3dcf76[_0x50c7('0x13')]=this[_0x50c7('0x14')][_0x50c7('0x13')];}var _0x42b7e2=this[_0x50c7('0x11')];if(_0x42b7e2==='chat'){_0x3dcf76['ChatWebsiteId']=this[_0x50c7('0x15')]['id'];}else{_0x3dcf76[_[_0x50c7('0x16')](_0x42b7e2)+'AccountId']=this[_0x50c7('0x15')]['id'];}_0x3dcf76[_[_0x50c7('0x16')](_0x42b7e2)+_0x50c7('0x17')]=this[_0x50c7('0x14')]['id'];if(this['interaction'][_0x50c7('0x18')]){var _0x150095=_0x34a297[0x2];if(!_[_0x50c7('0x19')](_0x150095)){_0x3dcf76['body']=utils[_0x50c7('0x1a')](_0x150095,this);return rpc[_0x42b7e2+_0x50c7('0x1b')][_0x50c7('0x1c')](_0x3dcf76)['then'](function(_0xd5b365){logger['info'](_0x50c7('0xc'),_0x594830,_0x3dcf76[_0x50c7('0x1d')]);})[_0x50c7('0x1e')](function(_0x1e6098){logger['error'](_0x50c7('0xc'),_0x594830,JSON[_0x50c7('0x1f')](_0x1e6098));})[_0x50c7('0x20')](function(){logger[_0x50c7('0xb')](_0x50c7('0x21'),_0x594830);_0x172856[_0x50c7('0x22')]();});}else{logger['info'](_0x50c7('0x23'),_0x594830);_0x172856[_0x50c7('0x22')]();}}else{var _0x407610=this;var _0xf1d836=apiai(_0x34a297[0x0],{'language':_0x34a297[0x1]||'en'});return _0xf1d836['textRequest'](this[_0x50c7('0x24')]['body'],{'sessionId':md5(this[_0x50c7('0x14')]['id'])})[_0x50c7('0x25')](function(_0x3bfad2){_0x407610['body']['dialogflow']=_0x3bfad2;_0x3dcf76[_0x50c7('0x1d')]=_0x3bfad2[_0x50c7('0x26')][_0x50c7('0x27')][_0x50c7('0x28')];_0x3dcf76[_0x50c7('0x29')]='dialogflow';_0x3dcf76[_0x50c7('0x2a')]=JSON[_0x50c7('0x1f')](_0x3bfad2);return rpc[_0x42b7e2+'Message'][_0x50c7('0x1c')](_0x3dcf76)[_0x50c7('0x25')](function(_0x42411c){logger[_0x50c7('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x594830,_0x3dcf76[_0x50c7('0x1d')]);if(_0x3bfad2[_0x50c7('0x26')][_0x50c7('0x2b')][_0x50c7('0x2c')]){_0x172856[_0x50c7('0xe')]();}else{_0x172856[_0x50c7('0x22')]();}})[_0x50c7('0x1e')](function(_0x59045e){logger[_0x50c7('0x2d')](_0x50c7('0xc'),_0x594830,JSON[_0x50c7('0x1f')](_0x59045e));_0x172856[_0x50c7('0xe')]();});})[_0x50c7('0x1e')](function(_0x181e3e){logger['error'](_0x50c7('0xc'),_0x594830,_0x181e3e['message']);_0x172856['next']();});}}catch(_0x56d7b1){logger[_0x50c7('0x2d')](_0x50c7('0xc'),_0x594830,JSON[_0x50c7('0x1f')](_0x56d7b1));_0x172856['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 7a2f235..7dbe396 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5259=['getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','allRequiredParamsPresent','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','push','fulfillmentText','next','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst','InteractionId','isEmpty'];(function(_0x415b5d,_0x3b99f7){var _0x58b75e=function(_0x5f25fb){while(--_0x5f25fb){_0x415b5d['push'](_0x415b5d['shift']());}};_0x58b75e(++_0x3b99f7);}(_0x5259,0xae));var _0x9525=function(_0x53828f,_0x8772f1){_0x53828f=_0x53828f-0x0;var _0x2a897a=_0x5259[_0x53828f];return _0x2a897a;};'use strict';var _=require(_0x9525('0x0'));var dialogflow=require(_0x9525('0x1'));var md5=require(_0x9525('0x2'));var moment=require('moment');var Promise=require(_0x9525('0x3'));var logger=require(_0x9525('0x4'))(_0x9525('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x9525('0x6')),'openchannelMessage':require(_0x9525('0x7')),'mailMessage':require(_0x9525('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9525('0x9')),'whatsappMessage':require(_0x9525('0xa'))};function createMessage(_0x67e476,_0x38aea9,_0x450269,_0x1231fc){return new Promise(function(_0x3adc55,_0x348942){var _0x4dbf8d=_[_0x9525('0xb')](_0x450269);_0x4dbf8d[_0x9525('0xc')]=_0x1231fc;return rpc[_0x38aea9+_0x9525('0xd')][_0x9525('0xe')](_0x4dbf8d)[_0x9525('0xf')](function(){logger['info'](_0x9525('0x10'),_0x67e476,_0x4dbf8d[_0x9525('0xc')]);_0x3adc55();})[_0x9525('0x11')](function(_0x247db5){logger[_0x9525('0x12')](_0x9525('0x10'),_0x67e476,JSON[_0x9525('0x13')](_0x247db5));_0x348942(_0x247db5);});});}exports['consequence']=function(_0x5d18d3,_0x57bfd6){return function(_0xf6e11d){try{if(!_[_0x9525('0x14')](this['interaction'][_0x9525('0x15')])){logger[_0x9525('0x16')](_0x9525('0x10'),_0x5d18d3,_0x9525('0x17'));return _0xf6e11d['next']();}var _0xe07e2b={'ContactId':this[_0x9525('0x18')]['id'],'sentAt':moment()['format'](_0x9525('0x19')),'direction':'out'};if(this[_0x9525('0x1a')]===_0x9525('0x1b')||this[_0x9525('0x1a')]===_0x9525('0x1c')){_0xe07e2b[_0x9525('0x1d')]=this[_0x9525('0x1e')][_0x9525('0x1d')];}var _0x777386=this[_0x9525('0x1a')];if(_0x777386===_0x9525('0x1f')){_0xe07e2b['ChatWebsiteId']=this[_0x9525('0x20')]['id'];}else{_0xe07e2b[_[_0x9525('0x21')](_0x777386)+'AccountId']=this['account']['id'];}_0xe07e2b[_[_0x9525('0x21')](_0x777386)+_0x9525('0x22')]=this['interaction']['id'];if(this['interaction']['created']){var _0x3b96f2=_0x57bfd6[0x4];if(!_[_0x9525('0x23')](_0x3b96f2)){_0xe07e2b[_0x9525('0xc')]=utils[_0x9525('0x24')](_0x3b96f2,this);return rpc[_0x777386+_0x9525('0xd')][_0x9525('0xe')](_0xe07e2b)['then'](function(_0x22bc07){logger[_0x9525('0x16')](_0x9525('0x10'),_0x5d18d3,_0xe07e2b[_0x9525('0xc')]);})[_0x9525('0x11')](function(_0x144d5f){logger['error'](_0x9525('0x10'),_0x5d18d3,JSON[_0x9525('0x13')](_0x144d5f));})[_0x9525('0x25')](function(){logger[_0x9525('0x16')](_0x9525('0x26'),_0x5d18d3);_0xf6e11d[_0x9525('0x27')]();});}else{logger[_0x9525('0x16')](_0x9525('0x28'),_0x5d18d3);_0xf6e11d[_0x9525('0x27')]();}}else{var _0x74a0b=this;var _0x5bf5a9=_0x57bfd6[0x2][_0x9525('0x29')](/\\n/g,'\x0a');var _0x26d479={'credentials':{'private_key':_0x5bf5a9,'client_email':_0x57bfd6[0x1]}};var _0x1239a2=new dialogflow[(_0x9525('0x2a'))](_0x26d479);var _0x27a9b5=_0x1239a2['sessionPath'](_0x57bfd6[0x0],md5(_0x74a0b['interaction']['id']));var _0x14f581={'session':_0x27a9b5,'queryInput':{'text':{'text':_0x74a0b['message']['body'],'languageCode':_0x57bfd6[0x3]||'en'}}};return _0x1239a2[_0x9525('0x2b')](_0x14f581)[_0x9525('0xf')](function(_0xda32b3){if(_0xda32b3&&_0xda32b3[_0x9525('0x2c')]){_0x74a0b['body']['dialogflowV2']=_0xda32b3;var _0x42de76=_0xda32b3[0x0];var _0x42f588=_0x42de76[_0x9525('0x2d')][_0x9525('0x2e')]&&_0x42de76['queryResult'][_0x9525('0x2e')]['fields']?_0x42de76[_0x9525('0x2d')]['diagnosticInfo'][_0x9525('0x2f')][_0x9525('0x30')][_0x9525('0x31')]:![];_0x74a0b[_0x9525('0xc')]['DIALOGFLOWV2_ACTION']=_0x42de76[_0x9525('0x2d')][_0x9525('0x32')];_0x74a0b[_0x9525('0xc')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x42de76[_0x9525('0x2d')][_0x9525('0x33')];_0x74a0b['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x42de76['queryResult']['diagnosticInfo']&&_0x42de76[_0x9525('0x2d')]['diagnosticInfo']['fields']?_0x42de76['queryResult'][_0x9525('0x2e')][_0x9525('0x2f')]['end_conversation']['boolValue']:![];_0x74a0b[_0x9525('0xc')]['DIALOGFLOWV2_INTENTNAME']=_0x42de76[_0x9525('0x2d')][_0x9525('0x34')][_0x9525('0x35')];_0x74a0b[_0x9525('0xc')][_0x9525('0x36')]=_0x42de76['queryResult'][_0x9525('0x34')][_0x9525('0x37')];_0x74a0b[_0x9525('0xc')][_0x9525('0x38')]=_0x42de76[_0x9525('0x2d')]['intent'][_0x9525('0x39')];_0x74a0b[_0x9525('0xc')][_0x9525('0x3a')]=_0x42de76[_0x9525('0x2d')][_0x9525('0x3b')];_0x74a0b[_0x9525('0xc')][_0x9525('0x3c')]=_0x42de76[_0x9525('0x2d')]['queryText'];_0x74a0b['body'][_0x9525('0x3d')]=_0x42de76[_0x9525('0x2d')][_0x9525('0x3e')];_0xe07e2b[_0x9525('0x3f')]=_0x9525('0x40');_0xe07e2b[_0x9525('0x41')]=JSON['stringify'](_0xda32b3);var _0x119299=[];for(var _0x1716c1=0x0;_0x1716c1<_0xda32b3[_0x9525('0x2c')];_0x1716c1++){var _0x234c32=_0xda32b3[_0x1716c1];if(_0x234c32&&_0x234c32[_0x9525('0x2d')]&&_0x234c32[_0x9525('0x2d')]['fulfillmentText']){_0x119299[_0x9525('0x42')](createMessage(_0x5d18d3,_0x777386,_0xe07e2b,_0x234c32[_0x9525('0x2d')][_0x9525('0x43')]));}}return Promise['all'](_0x119299)['then'](function(){if(_0x42f588){_0xf6e11d['next']();}else{_0xf6e11d[_0x9525('0x27')]();}})[_0x9525('0x11')](function(_0x2aa0e6){logger[_0x9525('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x5d18d3,JSON[_0x9525('0x13')](_0x2aa0e6));_0xf6e11d[_0x9525('0x44')]();});}})['catch'](function(_0x3e256d){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5d18d3,_0x3e256d['message'],_0x3e256d[_0x9525('0x45')]);_0xf6e11d[_0x9525('0x44')]();});}}catch(_0x1b629c){logger[_0x9525('0x12')](_0x9525('0x10'),_0x5d18d3,JSON[_0x9525('0x13')](_0x1b629c));_0xf6e11d[_0x9525('0x27')]();}};}; \ No newline at end of file +var _0x01f8=['action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','intentDetectionConfidence','providerResponse','fulfillmentText','push','all','next','stack','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','isNil','interaction','UserId','info','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','Message','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION'];(function(_0x32fb90,_0x3ea5d1){var _0xf9a0d5=function(_0x284972){while(--_0x284972){_0x32fb90['push'](_0x32fb90['shift']());}};_0xf9a0d5(++_0x3ea5d1);}(_0x01f8,0x1f4));var _0x801f=function(_0x5acc16,_0x1dec88){_0x5acc16=_0x5acc16-0x0;var _0x4dbdd7=_0x01f8[_0x5acc16];return _0x4dbdd7;};'use strict';var _=require(_0x801f('0x0'));var dialogflow=require(_0x801f('0x1'));var md5=require(_0x801f('0x2'));var moment=require(_0x801f('0x3'));var Promise=require(_0x801f('0x4'));var logger=require(_0x801f('0x5'))(_0x801f('0x6'));var utils=require(_0x801f('0x7'));var rpc={'chatMessage':require(_0x801f('0x8')),'openchannelMessage':require(_0x801f('0x9')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x801f('0xa')),'whatsappMessage':require(_0x801f('0xb'))};function createMessage(_0x16eec0,_0x41d6ef,_0x2a5725,_0x5290ae){return new Promise(function(_0x128382,_0x24fd14){var _0x11e545=_[_0x801f('0xc')](_0x2a5725);_0x11e545['body']=_0x5290ae;return rpc[_0x41d6ef+'Message'][_0x801f('0xd')](_0x11e545)[_0x801f('0xe')](function(){logger['info'](_0x801f('0xf'),_0x16eec0,_0x11e545[_0x801f('0x10')]);_0x128382();})[_0x801f('0x11')](function(_0xf6945b){logger[_0x801f('0x12')](_0x801f('0xf'),_0x16eec0,JSON[_0x801f('0x13')](_0xf6945b));_0x24fd14(_0xf6945b);});});}exports['consequence']=function(_0xd961d2,_0x5b5d5d){return function(_0x4b9388){try{if(!_[_0x801f('0x14')](this[_0x801f('0x15')][_0x801f('0x16')])){logger[_0x801f('0x17')](_0x801f('0xf'),_0xd961d2,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4b9388['next']();}var _0x3090d5={'ContactId':this[_0x801f('0x18')]['id'],'sentAt':moment()[_0x801f('0x19')](_0x801f('0x1a')),'direction':_0x801f('0x1b')};if(this[_0x801f('0x1c')]==='sms'||this[_0x801f('0x1c')]===_0x801f('0x1d')){_0x3090d5[_0x801f('0x1e')]=this['interaction']['phone'];}var _0x267e06=this['channel'];if(_0x267e06===_0x801f('0x1f')){_0x3090d5[_0x801f('0x20')]=this[_0x801f('0x21')]['id'];}else{_0x3090d5[_[_0x801f('0x22')](_0x267e06)+_0x801f('0x23')]=this['account']['id'];}_0x3090d5[_[_0x801f('0x22')](_0x267e06)+_0x801f('0x24')]=this[_0x801f('0x15')]['id'];if(this['interaction'][_0x801f('0x25')]){var _0x380ec=_0x5b5d5d[0x4];if(!_['isEmpty'](_0x380ec)){_0x3090d5['body']=utils['getMustacheRender'](_0x380ec,this);return rpc[_0x267e06+_0x801f('0x26')][_0x801f('0xd')](_0x3090d5)[_0x801f('0xe')](function(_0x1276c5){logger['info'](_0x801f('0xf'),_0xd961d2,_0x3090d5[_0x801f('0x10')]);})[_0x801f('0x11')](function(_0x95ad17){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xd961d2,JSON['stringify'](_0x95ad17));})[_0x801f('0x27')](function(){logger[_0x801f('0x17')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xd961d2);_0x4b9388[_0x801f('0x28')]();});}else{logger[_0x801f('0x17')](_0x801f('0x29'),_0xd961d2);_0x4b9388[_0x801f('0x28')]();}}else{var _0x48a4f0=this;var _0x45d5ce=_0x5b5d5d[0x2]['replace'](/\\n/g,'\x0a');var _0x581b35={'credentials':{'private_key':_0x45d5ce,'client_email':_0x5b5d5d[0x1]}};var _0xec9952=new dialogflow[(_0x801f('0x2a'))](_0x581b35);var _0x55a30f=_0xec9952[_0x801f('0x2b')](_0x5b5d5d[0x0],md5(_0x48a4f0[_0x801f('0x15')]['id']));var _0x17c39b={'session':_0x55a30f,'queryInput':{'text':{'text':_0x48a4f0[_0x801f('0x2c')][_0x801f('0x10')],'languageCode':_0x5b5d5d[0x3]||'en'}}};return _0xec9952['detectIntent'](_0x17c39b)[_0x801f('0xe')](function(_0x1aa38d){if(_0x1aa38d&&_0x1aa38d[_0x801f('0x2d')]){_0x48a4f0[_0x801f('0x10')][_0x801f('0x2e')]=_0x1aa38d;var _0x296008=_0x1aa38d[0x0];var _0x44c0b0=_0x296008[_0x801f('0x2f')][_0x801f('0x30')]&&_0x296008['queryResult'][_0x801f('0x30')][_0x801f('0x31')]?_0x296008[_0x801f('0x2f')]['diagnosticInfo'][_0x801f('0x31')][_0x801f('0x32')]['boolValue']:![];_0x48a4f0[_0x801f('0x10')][_0x801f('0x33')]=_0x296008[_0x801f('0x2f')][_0x801f('0x34')];_0x48a4f0[_0x801f('0x10')][_0x801f('0x35')]=_0x296008[_0x801f('0x2f')]['allRequiredParamsPresent'];_0x48a4f0['body'][_0x801f('0x36')]=_0x296008[_0x801f('0x2f')]['diagnosticInfo']&&_0x296008[_0x801f('0x2f')][_0x801f('0x30')]['fields']?_0x296008[_0x801f('0x2f')][_0x801f('0x30')][_0x801f('0x31')]['end_conversation']['boolValue']:![];_0x48a4f0[_0x801f('0x10')][_0x801f('0x37')]=_0x296008[_0x801f('0x2f')][_0x801f('0x38')]['name'];_0x48a4f0['body'][_0x801f('0x39')]=_0x296008[_0x801f('0x2f')]['intent']['displayName'];_0x48a4f0[_0x801f('0x10')][_0x801f('0x3a')]=_0x296008['queryResult'][_0x801f('0x38')]['isFallback'];_0x48a4f0[_0x801f('0x10')][_0x801f('0x3b')]=_0x296008[_0x801f('0x2f')][_0x801f('0x3c')];_0x48a4f0[_0x801f('0x10')]['DIALOGFLOWV2_QUERYTEXT']=_0x296008[_0x801f('0x2f')][_0x801f('0x3d')];_0x48a4f0[_0x801f('0x10')]['DIALOGFLOWV2_SCORE']=_0x296008[_0x801f('0x2f')][_0x801f('0x3e')];_0x3090d5['providerName']=_0x801f('0x2e');_0x3090d5[_0x801f('0x3f')]=JSON['stringify'](_0x1aa38d);var _0xb0c01b=[];for(var _0x2577b0=0x0;_0x2577b0<_0x1aa38d[_0x801f('0x2d')];_0x2577b0++){var _0xdde415=_0x1aa38d[_0x2577b0];if(_0xdde415&&_0xdde415[_0x801f('0x2f')]&&_0xdde415[_0x801f('0x2f')][_0x801f('0x40')]){_0xb0c01b[_0x801f('0x41')](createMessage(_0xd961d2,_0x267e06,_0x3090d5,_0xdde415['queryResult'][_0x801f('0x40')]));}}return Promise[_0x801f('0x42')](_0xb0c01b)[_0x801f('0xe')](function(){if(_0x44c0b0){_0x4b9388['next']();}else{_0x4b9388[_0x801f('0x28')]();}})['catch'](function(_0x2a5a3d){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xd961d2,JSON['stringify'](_0x2a5a3d));_0x4b9388[_0x801f('0x43')]();});}})[_0x801f('0x11')](function(_0x46e890){logger['error'](_0x801f('0xf'),_0xd961d2,_0x46e890[_0x801f('0x2c')],_0x46e890[_0x801f('0x44')]);_0x4b9388[_0x801f('0x43')]();});}}catch(_0x39ddd7){logger[_0x801f('0x12')](_0x801f('0xf'),_0xd961d2,JSON[_0x801f('0x13')](_0x39ddd7));_0x4b9388[_0x801f('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index bba9946..4110159 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25f8=['../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','html-to-text','./utils'];(function(_0x1a6e1a,_0x4c1247){var _0x4c19fc=function(_0x24ecea){while(--_0x24ecea){_0x1a6e1a['push'](_0x1a6e1a['shift']());}};_0x4c19fc(++_0x4c1247);}(_0x25f8,0xdd));var _0x825f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x25f8[_0x178e48];return _0x440d7e;};'use strict';var schema=require(_0x825f('0x0'));var _=require(_0x825f('0x1'));var htmlToText=require(_0x825f('0x2'));var utils=require(_0x825f('0x3'));var logger=require(_0x825f('0x4'))(_0x825f('0x5'));var gotoif=schema({'condition':{'type':_0x825f('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x825f('0x7'),'message':_0x825f('0x8')},'priorityFalse':{'type':_0x825f('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x5ab192,_0x1ed3ac){return function(_0x48534b){try{var _0x23eb1c={'condition':htmlToText['fromString'](utils[_0x825f('0x9')](_0x1ed3ac[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ed3ac[0x1],'priorityFalse':_0x1ed3ac[0x2]};var _0x336e7a=gotoif[_0x825f('0x0')](_0x23eb1c,{'typecast':!![]});if(_0x336e7a[_0x825f('0xa')]){logger['error'](_0x825f('0xb'),_0x5ab192,_[_0x825f('0xc')](_0x336e7a,'message')['join'](',\x20'));_0x48534b[_0x825f('0xd')]();}else{try{var _0x45ced1=eval('('+_0x23eb1c[_0x825f('0xe')]+')');var _0x5ce3c4=_0x45ced1?_0x23eb1c[_0x825f('0xf')]:_0x23eb1c[_0x825f('0x10')];logger[_0x825f('0x11')](_0x825f('0x12'),_0x5ab192,_0x23eb1c[_0x825f('0xe')],_0x45ced1,_0x5ce3c4||_0x825f('0x13'));if(_0x5ce3c4){var _0xcdf411=_[_0x825f('0x14')](_0x48534b['rules'](),{'p':_0x5ce3c4});if(_0xcdf411>=0x0){logger[_0x825f('0x11')](_0x825f('0x15'),_0x5ab192,_0x5ce3c4||_0x825f('0x13'),_0xcdf411);_0x48534b[_0x825f('0x13')](_0xcdf411);}else{logger['info'](_0x825f('0x16'),_0x5ab192,_0x5ce3c4||_0x825f('0x13'));_0x48534b['stop']();}}else{_0x48534b[_0x825f('0x13')]();}}catch(_0x37d9f2){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5ab192,_0x37d9f2['message']);_0x48534b[_0x825f('0xd')]();}}}catch(_0x24a6c5){logger[_0x825f('0x17')](_0x825f('0xb'),_0x5ab192,JSON[_0x825f('0x18')](_0x24a6c5));_0x48534b[_0x825f('0xd')]();}};}; \ No newline at end of file +var _0x88bd=['[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','stop','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error'];(function(_0x5f4097,_0x5c78c0){var _0x14f43f=function(_0x1d081a){while(--_0x1d081a){_0x5f4097['push'](_0x5f4097['shift']());}};_0x14f43f(++_0x5c78c0);}(_0x88bd,0xc4));var _0xd88b=function(_0x2c624e,_0x1338f0){_0x2c624e=_0x2c624e-0x0;var _0x278868=_0x88bd[_0x2c624e];return _0x278868;};'use strict';var schema=require(_0xd88b('0x0'));var _=require('lodash');var htmlToText=require(_0xd88b('0x1'));var utils=require(_0xd88b('0x2'));var logger=require(_0xd88b('0x3'))(_0xd88b('0x4'));var gotoif=schema({'condition':{'type':_0xd88b('0x5'),'required':!![],'message':_0xd88b('0x6')},'priorityTrue':{'type':_0xd88b('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xd88b('0x7'),'message':_0xd88b('0x8')}});exports['consequence']=function(_0x3f23c6,_0x1e795b){return function(_0x4a82a2){try{var _0x2f66c8={'condition':htmlToText[_0xd88b('0x9')](utils[_0xd88b('0xa')](_0x1e795b[0x0],this),{'wordwrap':![]})[_0xd88b('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1e795b[0x1],'priorityFalse':_0x1e795b[0x2]};var _0x318af1=gotoif[_0xd88b('0x0')](_0x2f66c8,{'typecast':!![]});if(_0x318af1[_0xd88b('0xc')]){logger[_0xd88b('0xd')](_0xd88b('0xe'),_0x3f23c6,_[_0xd88b('0xf')](_0x318af1,_0xd88b('0x10'))[_0xd88b('0x11')](',\x20'));_0x4a82a2['stop']();}else{try{var _0x4b5b43=eval('('+_0x2f66c8[_0xd88b('0x12')]+')');var _0xdd44a7=_0x4b5b43?_0x2f66c8[_0xd88b('0x13')]:_0x2f66c8[_0xd88b('0x14')];logger[_0xd88b('0x15')](_0xd88b('0x16'),_0x3f23c6,_0x2f66c8[_0xd88b('0x12')],_0x4b5b43,_0xdd44a7||'next');if(_0xdd44a7){var _0x23802b=_['findIndex'](_0x4a82a2[_0xd88b('0x17')](),{'p':_0xdd44a7});if(_0x23802b>=0x0){logger[_0xd88b('0x15')](_0xd88b('0x18'),_0x3f23c6,_0xdd44a7||_0xd88b('0x19'),_0x23802b);_0x4a82a2[_0xd88b('0x19')](_0x23802b);}else{logger['info'](_0xd88b('0x1a'),_0x3f23c6,_0xdd44a7||_0xd88b('0x19'));_0x4a82a2['stop']();}}else{_0x4a82a2[_0xd88b('0x19')]();}}catch(_0x9253ad){logger[_0xd88b('0xd')](_0xd88b('0x1b'),_0x3f23c6,_0x9253ad[_0xd88b('0x10')]);_0x4a82a2['stop']();}}}catch(_0xc23839){logger[_0xd88b('0xd')](_0xd88b('0xe'),_0x3f23c6,JSON[_0xd88b('0x1c')](_0xc23839));_0x4a82a2[_0xd88b('0x1d')]();}};}; \ 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 f6a2dbc..74cc635 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 _0x0572=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','join','stop','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0572,0x156));var _0x2057=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0572[_0x4ff09b];return _0x3f5c2e;};'use strict';var schema=require(_0x2057('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x2057('0x1'));var gotop=schema({'priority':{'type':_0x2057('0x2'),'required':!![],'message':_0x2057('0x3')}});exports[_0x2057('0x4')]=function(_0x35baee,_0x26ce1f){return function(_0x10d7ab){try{var _0x5aa919={'priority':_0x26ce1f[0x0]};var _0x5ebdc5=gotop['validate'](_0x5aa919,{'typecast':!![]});if(_0x5ebdc5['length']){logger[_0x2057('0x5')](_0x2057('0x6'),_0x35baee,_['map'](_0x5ebdc5,'message')[_0x2057('0x7')](',\x20'));_0x10d7ab[_0x2057('0x8')]();}else{logger[_0x2057('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0x35baee,_0x5aa919[_0x2057('0xa')]);if(_0x5aa919['priority']){var _0x3f658f=_[_0x2057('0xb')](_0x10d7ab[_0x2057('0xc')](),{'p':_0x5aa919[_0x2057('0xa')]});if(_0x3f658f>=0x0){logger['info'](_0x2057('0xd'),_0x35baee,_0x5aa919['priority']||_0x2057('0xe'),_0x3f658f);_0x10d7ab[_0x2057('0xe')](_0x3f658f);}else{logger[_0x2057('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x35baee,_0x5aa919[_0x2057('0xa')]||_0x2057('0xe'));_0x10d7ab[_0x2057('0x8')]();}}else{_0x10d7ab[_0x2057('0xe')]();}}}catch(_0x21500f){logger[_0x2057('0x5')](_0x2057('0x6'),_0x35baee,JSON[_0x2057('0xf')](_0x21500f));_0x10d7ab[_0x2057('0x8')]();}};}; \ No newline at end of file +var _0x90cb=['consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x90cb,0xdf));var _0xb90c=function(_0x1cffe2,_0x5383e8){_0x1cffe2=_0x1cffe2-0x0;var _0x57030e=_0x90cb[_0x1cffe2];return _0x57030e;};'use strict';var schema=require(_0xb90c('0x0'));var _=require(_0xb90c('0x1'));var logger=require(_0xb90c('0x2'))(_0xb90c('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xb90c('0x4')}});exports[_0xb90c('0x5')]=function(_0x3bfa91,_0x345a73){return function(_0x48832b){try{var _0x951514={'priority':_0x345a73[0x0]};var _0x3e8728=gotop['validate'](_0x951514,{'typecast':!![]});if(_0x3e8728[_0xb90c('0x6')]){logger[_0xb90c('0x7')](_0xb90c('0x8'),_0x3bfa91,_[_0xb90c('0x9')](_0x3e8728,_0xb90c('0xa'))[_0xb90c('0xb')](',\x20'));_0x48832b[_0xb90c('0xc')]();}else{logger[_0xb90c('0xd')](_0xb90c('0xe'),_0x3bfa91,_0x951514[_0xb90c('0xf')]);if(_0x951514[_0xb90c('0xf')]){var _0x1b2428=_['findIndex'](_0x48832b[_0xb90c('0x10')](),{'p':_0x951514[_0xb90c('0xf')]});if(_0x1b2428>=0x0){logger[_0xb90c('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3bfa91,_0x951514[_0xb90c('0xf')]||_0xb90c('0x11'),_0x1b2428);_0x48832b['next'](_0x1b2428);}else{logger[_0xb90c('0xd')](_0xb90c('0x12'),_0x3bfa91,_0x951514[_0xb90c('0xf')]||'next');_0x48832b[_0xb90c('0xc')]();}}else{_0x48832b['next']();}}}catch(_0x5b2aaf){logger['error'](_0xb90c('0x8'),_0x3bfa91,JSON['stringify'](_0x5b2aaf));_0x48832b[_0xb90c('0xc')]();}};}; \ 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 e610b3a..276ae49 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 _0x34a4=['[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','upperFirst','account','InteractionId','interaction','Message','create'];(function(_0x1b8b1b,_0x1edbbe){var _0x1e536b=function(_0x3d6e3c){while(--_0x3d6e3c){_0x1b8b1b['push'](_0x1b8b1b['shift']());}};_0x1e536b(++_0x1edbbe);}(_0x34a4,0xec));var _0x434a=function(_0x5b013d,_0xc7691c){_0x5b013d=_0x5b013d-0x0;var _0x2b6eef=_0x34a4[_0x5b013d];return _0x2b6eef;};'use strict';var _=require(_0x434a('0x0'));var utils=require('./utils');var logger=require(_0x434a('0x1'))(_0x434a('0x2'));var rpc={'chatMessage':require(_0x434a('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x434a('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x434a('0x5'))};exports[_0x434a('0x6')]=function(_0x84dd73,_0x3e3636){return function(_0x12b6b6){try{var _0x338544={'body':utils[_0x434a('0x7')](_0x3e3636[0x0],this),'ContactId':this[_0x434a('0x8')]['id']};if(this[_0x434a('0x9')]===_0x434a('0xa')){_0x338544['ChatWebsiteId']=this['account']['id'];}else{_0x338544[_[_0x434a('0xb')](this['channel'])+'AccountId']=this[_0x434a('0xc')]['id'];}_0x338544[_[_0x434a('0xb')](this[_0x434a('0x9')])+_0x434a('0xd')]=this[_0x434a('0xe')]['id'];if(rpc[this[_0x434a('0x9')]+_0x434a('0xf')]){return rpc[this['channel']+_0x434a('0xf')][_0x434a('0x10')](_0x338544)['then'](function(_0x2c85c5){logger['info'](_0x434a('0x11'),_0x84dd73,_0x338544['body']);_0x12b6b6[_0x434a('0x12')]();})[_0x434a('0x13')](function(_0x3a2214){logger[_0x434a('0x14')](_0x434a('0x11'),_0x84dd73,JSON[_0x434a('0x15')](_0x3a2214));_0x12b6b6[_0x434a('0x16')]();});}}catch(_0x236442){logger['error']('[%s][MESSAGE]\x20%s',_0x84dd73,JSON[_0x434a('0x15')](_0x236442));_0x12b6b6[_0x434a('0x16')]();}};}; \ No newline at end of file +var _0x5044=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','body','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat'];(function(_0x4059e2,_0x80f0ee){var _0x52aa1d=function(_0x26e21a){while(--_0x26e21a){_0x4059e2['push'](_0x4059e2['shift']());}};_0x52aa1d(++_0x80f0ee);}(_0x5044,0x1ef));var _0x4504=function(_0x393d84,_0x106c79){_0x393d84=_0x393d84-0x0;var _0x5412fa=_0x5044[_0x393d84];return _0x5412fa;};'use strict';var _=require('lodash');var utils=require(_0x4504('0x0'));var logger=require('../../../../config/logger')(_0x4504('0x1'));var rpc={'chatMessage':require(_0x4504('0x2')),'openchannelMessage':require(_0x4504('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4504('0x4')),'faxMessage':require(_0x4504('0x5')),'whatsappMessage':require(_0x4504('0x6'))};exports[_0x4504('0x7')]=function(_0x2e2664,_0x562705){return function(_0x1c1a2d){try{var _0x431175={'body':utils['getMustacheRender'](_0x562705[0x0],this),'ContactId':this[_0x4504('0x8')]['id']};if(this[_0x4504('0x9')]===_0x4504('0xa')){_0x431175[_0x4504('0xb')]=this[_0x4504('0xc')]['id'];}else{_0x431175[_[_0x4504('0xd')](this['channel'])+_0x4504('0xe')]=this['account']['id'];}_0x431175[_['upperFirst'](this[_0x4504('0x9')])+_0x4504('0xf')]=this['interaction']['id'];if(rpc[this[_0x4504('0x9')]+_0x4504('0x10')]){return rpc[this['channel']+_0x4504('0x10')]['create'](_0x431175)['then'](function(_0x4c7b78){logger['info']('[%s][MESSAGE]\x20%s',_0x2e2664,_0x431175[_0x4504('0x11')]);_0x1c1a2d['next']();})[_0x4504('0x12')](function(_0x1735d4){logger[_0x4504('0x13')](_0x4504('0x14'),_0x2e2664,JSON[_0x4504('0x15')](_0x1735d4));_0x1c1a2d[_0x4504('0x16')]();});}}catch(_0x45abb2){logger[_0x4504('0x13')](_0x4504('0x14'),_0x2e2664,JSON[_0x4504('0x15')](_0x45abb2));_0x1c1a2d[_0x4504('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 797f3bb..1ece535 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 _0x994e=['next','error','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','routing','info'];(function(_0x15def9,_0x33453b){var _0x613ec4=function(_0x5ab902){while(--_0x5ab902){_0x15def9['push'](_0x15def9['shift']());}};_0x613ec4(++_0x33453b);}(_0x994e,0xa4));var _0xe994=function(_0x3f9ff0,_0x38fda0){_0x3f9ff0=_0x3f9ff0-0x0;var _0x423578=_0x994e[_0x3f9ff0];return _0x423578;};'use strict';var utils=require(_0xe994('0x0'));var logger=require(_0xe994('0x1'))(_0xe994('0x2'));exports['consequence']=function(_0x5daa8d,_0x565257){return function(_0x5af764){try{logger[_0xe994('0x3')]('[%s][NOOP]\x20%s',_0x5daa8d,utils['getMustacheRender'](_0x565257[0x0],this));_0x5af764[_0xe994('0x4')]();}catch(_0x1fca8b){logger[_0xe994('0x5')](_0xe994('0x6'),_0x5daa8d,JSON['stringify'](_0x1fca8b));_0x5af764[_0xe994('0x7')]();}};}; \ No newline at end of file +var _0xf6c7=['./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop'];(function(_0x5c08a6,_0x56da21){var _0x3266f3=function(_0x229e0d){while(--_0x229e0d){_0x5c08a6['push'](_0x5c08a6['shift']());}};_0x3266f3(++_0x56da21);}(_0xf6c7,0x17c));var _0x7f6c=function(_0x39d337,_0x3ab731){_0x39d337=_0x39d337-0x0;var _0x8075ea=_0xf6c7[_0x39d337];return _0x8075ea;};'use strict';var utils=require(_0x7f6c('0x0'));var logger=require(_0x7f6c('0x1'))(_0x7f6c('0x2'));exports[_0x7f6c('0x3')]=function(_0xa2c157,_0x5c8ed5){return function(_0x1588aa){try{logger['info'](_0x7f6c('0x4'),_0xa2c157,utils[_0x7f6c('0x5')](_0x5c8ed5[0x0],this));_0x1588aa[_0x7f6c('0x6')]();}catch(_0x4e864b){logger[_0x7f6c('0x7')]('[%s][NOOP]\x20%s',_0xa2c157,JSON[_0x7f6c('0x8')](_0x4e864b));_0x1588aa[_0x7f6c('0x9')]();}};}; \ 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 fc6d4d4..6fd3231 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 _0x224b=['update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','createQueue','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','beepall','stop','log','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update'];(function(_0xb4d928,_0x579093){var _0x47166e=function(_0x198064){while(--_0x198064){_0xb4d928['push'](_0xb4d928['shift']());}};_0x47166e(++_0x579093);}(_0x224b,0x66));var _0xb224=function(_0x52a16a,_0x5312cf){_0x52a16a=_0x52a16a-0x0;var _0x563194=_0x224b[_0x52a16a];return _0x563194;};'use strict';var schema=require(_0xb224('0x0'));var _=require(_0xb224('0x1'));var util=require(_0xb224('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xb224('0x3'));var Redis=require(_0xb224('0x4'));var config=require(_0xb224('0x5'));var logger=require(_0xb224('0x6'))(_0xb224('0x7'));var strategy=require(_0xb224('0x8'));config['redis']=_[_0xb224('0x9')](config[_0xb224('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xb224('0xb'))(new Redis(config[_0xb224('0xa')]));var attributes=['id','queue_id',_0xb224('0xc'),_0xb224('0xd'),_0xb224('0xe'),_0xb224('0xf')];function emit(_0x3a5acb,_0x508db3,_0x27c3f9){io['to'](_0x3a5acb)[_0xb224('0x10')](_0x508db3,_0x27c3f9);}function emitChannelQueueInteraction(_0x582779,_0x3bcbc8,_0x26c115,_0x3d2fb8,_0x35251a,_0x22e34c,_0x3d4940,_0x2b6b88){var _0x424b3b=_[_0xb224('0x11')](_0x26c115);_0x424b3b[_0xb224('0x12')]=_0x2b6b88;_0x424b3b['queue']=_0x3bcbc8;_0x424b3b[_0xb224('0xc')]=_0x3d2fb8;_0x424b3b['id']=_0x35251a;if(_0x22e34c){attributes[_0xb224('0x13')](_[_0xb224('0x14')](_0x582779)+_0xb224('0x15'));_0x3d4940[util[_0xb224('0x16')](_0xb224('0x17'),_0x582779)][_0x35251a]=_['pick'](_0x424b3b,attributes);}else{delete _0x3d4940[util['format']('%sQueuesWaitingInteractions',_0x582779)][_0x35251a];}emit(util[_0xb224('0x16')](_0xb224('0x18'),_0x582779,_0x3bcbc8),util[_0xb224('0x16')](_0xb224('0x19'),_0x582779,_0x22e34c?_0xb224('0x1a'):'remove'),_[_0xb224('0x1b')](_0x424b3b,attributes));}var rpc={'openchannelQueueReport':require(_0xb224('0x1c')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xb224('0x1d')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xb224('0x1e')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xb224('0x1f'),'required':!![],'message':_0xb224('0x20')},'timeout':{'type':_0xb224('0x21'),'message':_0xb224('0x22')}});function startRouting(_0x151700,_0x3ef675,_0x4a7472,_0x943dd8){if(_0x151700&&_0x3ef675&&_0x4a7472){_0x3ef675['waiting']+=0x1;var _0x27361c={'uniqueid':_0x151700,'from':_0x4a7472[_0xb224('0x23')]?_0x4a7472['body']['from']:'','joinAt':moment()[_0xb224('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a7472[_0xb224('0x24')]?_0x4a7472['contact']['id']:null,'ListId':_0x4a7472[_0xb224('0x25')]?_0x4a7472[_0xb224('0x25')]['id']:null};_0x27361c[_[_0xb224('0x26')](_0x4a7472[_0xb224('0x27')])+_0xb224('0x28')]=_0x3ef675['id']||null;_0x27361c[_['upperFirst'](_0x4a7472[_0xb224('0x27')])+'InteractionId']=_0x4a7472[_0xb224('0x29')]?_0x4a7472['interaction']['id']:null;_0x27361c[_['upperFirst'](_0x4a7472[_0xb224('0x27')])+_0xb224('0x2a')]=_0x4a7472[_0xb224('0x2b')]?_0x4a7472[_0xb224('0x2b')]['id']:null;_0x27361c[_[_0xb224('0x26')](_0x4a7472['channel'])+(_0x4a7472[_0xb224('0x27')]!=='chat'?_0xb224('0x2c'):_0xb224('0x2d'))]=_0x4a7472[_0xb224('0xc')]?_0x4a7472[_0xb224('0xc')]['id']:null;logger['info'](util[_0xb224('0x16')](_0xb224('0x2e'),_0x151700,_0x3ef675[_0xb224('0x2f')]));emitChannelQueueInteraction(_0x4a7472[_0xb224('0x27')],_0x3ef675[_0xb224('0x2f')],_0x27361c,_0x4a7472[_0xb224('0xc')][_0xb224('0x2f')],_0x4a7472[_0xb224('0x2b')]['id'],!![],_0x943dd8,_0x3ef675['id']);if(rpc[_0x4a7472['channel']+_0xb224('0x30')]){return rpc[_0x4a7472[_0xb224('0x27')]+_0xb224('0x30')]['create'](_0x27361c)[_0xb224('0x31')](function(_0x36cc37){logger[_0xb224('0x32')](_0xb224('0x33'));});}}}function stopRouting(_0x5cd215,_0xaa465b,_0x5605ab,_0x49a261){if(_0x5cd215&&_0xaa465b){_0xaa465b[_0xb224('0x34')]-=0x1;var _0x19b0d4={'leaveAt':moment()[_0xb224('0x16')](_0xb224('0x35')),'acceptAt':moment()['format'](_0xb224('0x35')),'reason':_0xb224('0x36')};logger[_0xb224('0x37')](util['format'](_0xb224('0x38'),_0x5cd215,_0xaa465b[_0xb224('0x2f')]));emitChannelQueueInteraction(_0x5605ab[_0xb224('0x27')],_0xaa465b[_0xb224('0x2f')],_0x5605ab[_0xb224('0x23')],_0x5605ab['account'][_0xb224('0x2f')],_0x5605ab[_0xb224('0x2b')]['id'],![],_0x49a261,_0xaa465b['id']);if(rpc[_0x5605ab[_0xb224('0x27')]+_0xb224('0x30')]){return rpc[_0x5605ab[_0xb224('0x27')]+_0xb224('0x30')][_0xb224('0x39')](_0x5cd215,_0x19b0d4)[_0xb224('0x31')](function(_0xffb317){logger[_0xb224('0x32')](_0xb224('0x3a'));});}}}function endRouting(_0x2d4a37,_0x4ddffb,_0x456ef8,_0x427d9a){if(_0x2d4a37&&_0x4ddffb){_0x4ddffb[_0xb224('0x34')]-=0x1;var _0x1dee45={'leaveAt':moment()[_0xb224('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xb224('0x35')),'reason':_0xb224('0x3b')};logger[_0xb224('0x37')](util[_0xb224('0x16')](_0xb224('0x3c'),_0x2d4a37,_0x4ddffb[_0xb224('0x2f')]));emitChannelQueueInteraction(_0x456ef8[_0xb224('0x27')],_0x4ddffb[_0xb224('0x2f')],_0x456ef8[_0xb224('0x23')],_0x456ef8['account']['name'],_0x456ef8[_0xb224('0x2b')]['id'],![],_0x427d9a);if(rpc[_0x456ef8['channel']+'QueueReport']){return rpc[_0x456ef8[_0xb224('0x27')]+'QueueReport']['update'](_0x2d4a37,_0x1dee45)[_0xb224('0x31')](function(_0x4c7408){logger[_0xb224('0x32')](_0xb224('0x3a'));});}}}function handleFindQueue(_0x4acfe5){return function(_0x465c03){return _0x465c03[_0xb224('0x2f')][_0xb224('0x3d')]()===_0x4acfe5[_0xb224('0x3d')]();};}exports[_0xb224('0x3e')]=function(_0x5bb881,_0x2d0fbf,_0x5e9d2f,_0x5d555f){return function(_0x273f21){try{var _0x3b28ca={'name':_0x2d0fbf[0x0],'timeout':_0x2d0fbf[0x1]};var _0x9629a3=queue[_0xb224('0x0')](_0x3b28ca,{'typecast':!![]});if(_0x9629a3[_0xb224('0x3f')]){logger[_0xb224('0x32')](_0xb224('0x40'),_0x5bb881,_[_0xb224('0x41')](_0x9629a3,_0xb224('0x2b'))[_0xb224('0x42')](',\x20'));_0x273f21['stop']();}else{var _0x47d7dd=_[_0xb224('0x43')](_0x5e9d2f[_0x5d555f[_0xb224('0x27')]+'Queues'],handleFindQueue(_0x3b28ca[_0xb224('0x2f')]));if(_0x47d7dd){startRouting(_0x5bb881,_0x47d7dd,_0x5d555f,_0x5e9d2f);var _0x252203=(_0x47d7dd['timeout']||0xa)*0x3e8;var _0x55c4fa=(_0x3b28ca[_0xb224('0x3b')]||0x14)*0x3e8;var _0x53753b;if(_0x252203>_0x55c4fa){_0x55c4fa=_0x252203;}var _0x13f95f=seqqueue[_0xb224('0x44')](_0x252203);_0x13f95f['id']=_0x5bb881;_0x13f95f['atimeout']=_0x252203;_0x13f95f['qtimeout']=_0x55c4fa;_0x13f95f['channel']=_0x5d555f[_0xb224('0x27')];_0x5e9d2f[_0xb224('0x45')][_0x5bb881]['on']('end',function(){logger['info'](_0xb224('0x46'),_0x5bb881);stopRouting(_0x5bb881,_0x47d7dd,_0x5d555f,_0x5e9d2f);clearTimeout(_0x53753b);_0x53753b=undefined;_0x13f95f[_0xb224('0x47')](!![]);if(_0x5e9d2f[_0xb224('0x45')][_0x5bb881]){delete _0x5e9d2f[_0xb224('0x45')][_0x5bb881];}_0x273f21['stop']();});_0x5e9d2f[_0xb224('0x45')][_0x5bb881]['on'](_0xb224('0x48'),function(){if(_0x5e9d2f[_0xb224('0x45')][_0x5bb881]){delete _0x5e9d2f['rules'][_0x5bb881];}});_0x53753b=setTimeout(function(){logger['info'](_0xb224('0x49'),_0x5bb881);endRouting(_0x5bb881,_0x47d7dd,_0x5d555f,_0x5e9d2f);clearTimeout(_0x53753b);_0x13f95f[_0xb224('0x47')](!![]);_0x273f21[_0xb224('0x4a')]();},_0x55c4fa);switch(_0x47d7dd[_0xb224('0x4b')]){case'rrmemory':strategy['rrmemory'](_0x13f95f,_0x47d7dd,_0x5e9d2f,_0x5d555f);break;default:strategy[_0xb224('0x4c')](_0x13f95f,_0x47d7dd,_0x5e9d2f,_0x5d555f);}}else{logger[_0xb224('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x5bb881,_0x3b28ca[_0xb224('0x2f')]);_0x273f21[_0xb224('0x4d')]();}}}catch(_0x5305f6){console[_0xb224('0x4e')](_0x5305f6);logger[_0xb224('0x32')]('[%s][QUEUE]\x20%s',_0x5bb881,_0x5305f6[_0xb224('0x4f')]);_0x273f21['stop']();}};}; \ No newline at end of file +var _0x4d43=['redis','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','toLowerCase','consequence','validate','length','map','join','stop','find','Queues','timeout','qtimeout','end','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','seq-queue','ioredis','../../../../config/environment','routing','./strategy'];(function(_0x5d2e61,_0x2fad32){var _0x136608=function(_0x2dda06){while(--_0x2dda06){_0x5d2e61['push'](_0x5d2e61['shift']());}};_0x136608(++_0x2fad32);}(_0x4d43,0x133));var _0x34d4=function(_0x2a8567,_0xf233b9){_0x2a8567=_0x2a8567-0x0;var _0x4b97da=_0x4d43[_0x2a8567];return _0x4b97da;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0x34d4('0x0'));var moment=require('moment');var Redis=require(_0x34d4('0x1'));var config=require(_0x34d4('0x2'));var logger=require('../../../../config/logger')(_0x34d4('0x3'));var strategy=require(_0x34d4('0x4'));config[_0x34d4('0x5')]=_['defaults'](config[_0x34d4('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x34d4('0x6'))(new Redis(config['redis']));var attributes=['id',_0x34d4('0x7'),_0x34d4('0x8'),_0x34d4('0x9'),_0x34d4('0xa'),_0x34d4('0xb')];function emit(_0x130713,_0x179a4b,_0x49e09d){io['to'](_0x130713)[_0x34d4('0xc')](_0x179a4b,_0x49e09d);}function emitChannelQueueInteraction(_0x1e0d12,_0x5bf1c6,_0x2e4d59,_0x2d231b,_0x45d982,_0x427e56,_0x4f964d,_0x2803df){var _0x1ca509=_[_0x34d4('0xd')](_0x2e4d59);_0x1ca509[_0x34d4('0x7')]=_0x2803df;_0x1ca509['queue']=_0x5bf1c6;_0x1ca509['account']=_0x2d231b;_0x1ca509['id']=_0x45d982;if(_0x427e56){attributes[_0x34d4('0xe')](_[_0x34d4('0xf')](_0x1e0d12)+_0x34d4('0x10'));_0x4f964d[util['format'](_0x34d4('0x11'),_0x1e0d12)][_0x45d982]=_[_0x34d4('0x12')](_0x1ca509,attributes);}else{delete _0x4f964d[util[_0x34d4('0x13')](_0x34d4('0x11'),_0x1e0d12)][_0x45d982];}emit(util[_0x34d4('0x13')](_0x34d4('0x14'),_0x1e0d12,_0x5bf1c6),util[_0x34d4('0x13')](_0x34d4('0x15'),_0x1e0d12,_0x427e56?_0x34d4('0x16'):_0x34d4('0x17')),_[_0x34d4('0x12')](_0x1ca509,attributes));}var rpc={'openchannelQueueReport':require(_0x34d4('0x18')),'mailQueueReport':require(_0x34d4('0x19')),'chatQueueReport':require(_0x34d4('0x1a')),'smsQueueReport':require(_0x34d4('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x34d4('0x1c'),'required':!![],'message':_0x34d4('0x1d')},'timeout':{'type':_0x34d4('0x1e'),'message':_0x34d4('0x1f')}});function startRouting(_0x1bb1fa,_0x8ef512,_0x35571e,_0x25fbb9){if(_0x1bb1fa&&_0x8ef512&&_0x35571e){_0x8ef512[_0x34d4('0x20')]+=0x1;var _0xa2c60b={'uniqueid':_0x1bb1fa,'from':_0x35571e[_0x34d4('0x21')]?_0x35571e[_0x34d4('0x21')][_0x34d4('0xa')]:'','joinAt':moment()[_0x34d4('0x13')](_0x34d4('0x22')),'ContactId':_0x35571e[_0x34d4('0x23')]?_0x35571e[_0x34d4('0x23')]['id']:null,'ListId':_0x35571e[_0x34d4('0x24')]?_0x35571e[_0x34d4('0x24')]['id']:null};_0xa2c60b[_[_0x34d4('0x25')](_0x35571e[_0x34d4('0x26')])+_0x34d4('0x27')]=_0x8ef512['id']||null;_0xa2c60b[_[_0x34d4('0x25')](_0x35571e[_0x34d4('0x26')])+_0x34d4('0x10')]=_0x35571e[_0x34d4('0x28')]?_0x35571e[_0x34d4('0x28')]['id']:null;_0xa2c60b[_['upperFirst'](_0x35571e[_0x34d4('0x26')])+_0x34d4('0x29')]=_0x35571e[_0x34d4('0x2a')]?_0x35571e[_0x34d4('0x2a')]['id']:null;_0xa2c60b[_[_0x34d4('0x25')](_0x35571e[_0x34d4('0x26')])+(_0x35571e['channel']!==_0x34d4('0x2b')?_0x34d4('0x2c'):'WebsiteId')]=_0x35571e['account']?_0x35571e[_0x34d4('0x8')]['id']:null;logger[_0x34d4('0x2d')](util[_0x34d4('0x13')](_0x34d4('0x2e'),_0x1bb1fa,_0x8ef512[_0x34d4('0x2f')]));emitChannelQueueInteraction(_0x35571e['channel'],_0x8ef512[_0x34d4('0x2f')],_0xa2c60b,_0x35571e['account'][_0x34d4('0x2f')],_0x35571e['message']['id'],!![],_0x25fbb9,_0x8ef512['id']);if(rpc[_0x35571e[_0x34d4('0x26')]+'QueueReport']){return rpc[_0x35571e['channel']+_0x34d4('0x30')][_0x34d4('0x31')](_0xa2c60b)['catch'](function(_0xf3cab7){logger[_0x34d4('0x32')](_0x34d4('0x33'));});}}}function stopRouting(_0x359f5f,_0x1a2b0e,_0x13b196,_0x5a7bd7){if(_0x359f5f&&_0x1a2b0e){_0x1a2b0e[_0x34d4('0x20')]-=0x1;var _0x2976f2={'leaveAt':moment()['format'](_0x34d4('0x22')),'acceptAt':moment()[_0x34d4('0x13')](_0x34d4('0x22')),'reason':_0x34d4('0x34')};logger[_0x34d4('0x2d')](util[_0x34d4('0x13')](_0x34d4('0x35'),_0x359f5f,_0x1a2b0e[_0x34d4('0x2f')]));emitChannelQueueInteraction(_0x13b196['channel'],_0x1a2b0e[_0x34d4('0x2f')],_0x13b196['body'],_0x13b196[_0x34d4('0x8')][_0x34d4('0x2f')],_0x13b196[_0x34d4('0x2a')]['id'],![],_0x5a7bd7,_0x1a2b0e['id']);if(rpc[_0x13b196[_0x34d4('0x26')]+_0x34d4('0x30')]){return rpc[_0x13b196[_0x34d4('0x26')]+'QueueReport'][_0x34d4('0x36')](_0x359f5f,_0x2976f2)[_0x34d4('0x37')](function(_0x5cb5a4){logger[_0x34d4('0x32')]('update\x20queue\x20report');});}}}function endRouting(_0x419d65,_0x3a9953,_0x44dd8e,_0xa3204f){if(_0x419d65&&_0x3a9953){_0x3a9953['waiting']-=0x1;var _0x255306={'leaveAt':moment()[_0x34d4('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x34d4('0x13')](_0x34d4('0x22')),'reason':'timeout'};logger[_0x34d4('0x2d')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x419d65,_0x3a9953['name']));emitChannelQueueInteraction(_0x44dd8e[_0x34d4('0x26')],_0x3a9953[_0x34d4('0x2f')],_0x44dd8e['body'],_0x44dd8e[_0x34d4('0x8')][_0x34d4('0x2f')],_0x44dd8e[_0x34d4('0x2a')]['id'],![],_0xa3204f);if(rpc[_0x44dd8e['channel']+_0x34d4('0x30')]){return rpc[_0x44dd8e[_0x34d4('0x26')]+_0x34d4('0x30')][_0x34d4('0x36')](_0x419d65,_0x255306)['catch'](function(_0x423908){logger['error'](_0x34d4('0x38'));});}}}function handleFindQueue(_0x283fb8){return function(_0x56c72b){return _0x56c72b['name'][_0x34d4('0x39')]()===_0x283fb8[_0x34d4('0x39')]();};}exports[_0x34d4('0x3a')]=function(_0x1dfe3b,_0x3e4d93,_0x77e6f1,_0x2dd9e2){return function(_0x4a171b){try{var _0x3a38ea={'name':_0x3e4d93[0x0],'timeout':_0x3e4d93[0x1]};var _0x520f1f=queue[_0x34d4('0x3b')](_0x3a38ea,{'typecast':!![]});if(_0x520f1f[_0x34d4('0x3c')]){logger[_0x34d4('0x32')]('[%s][QUEUE]\x20%s',_0x1dfe3b,_[_0x34d4('0x3d')](_0x520f1f,_0x34d4('0x2a'))[_0x34d4('0x3e')](',\x20'));_0x4a171b[_0x34d4('0x3f')]();}else{var _0x19deaa=_[_0x34d4('0x40')](_0x77e6f1[_0x2dd9e2['channel']+_0x34d4('0x41')],handleFindQueue(_0x3a38ea[_0x34d4('0x2f')]));if(_0x19deaa){startRouting(_0x1dfe3b,_0x19deaa,_0x2dd9e2,_0x77e6f1);var _0x4647a2=(_0x19deaa[_0x34d4('0x42')]||0xa)*0x3e8;var _0x2407b7=(_0x3a38ea[_0x34d4('0x42')]||0x14)*0x3e8;var _0x2f4125;if(_0x4647a2>_0x2407b7){_0x2407b7=_0x4647a2;}var _0x370003=seqqueue['createQueue'](_0x4647a2);_0x370003['id']=_0x1dfe3b;_0x370003['atimeout']=_0x4647a2;_0x370003[_0x34d4('0x43')]=_0x2407b7;_0x370003[_0x34d4('0x26')]=_0x2dd9e2[_0x34d4('0x26')];_0x77e6f1['rules'][_0x1dfe3b]['on'](_0x34d4('0x44'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1dfe3b);stopRouting(_0x1dfe3b,_0x19deaa,_0x2dd9e2,_0x77e6f1);clearTimeout(_0x2f4125);_0x2f4125=undefined;_0x370003[_0x34d4('0x45')](!![]);if(_0x77e6f1[_0x34d4('0x46')][_0x1dfe3b]){delete _0x77e6f1[_0x34d4('0x46')][_0x1dfe3b];}_0x4a171b[_0x34d4('0x3f')]();});_0x77e6f1[_0x34d4('0x46')][_0x1dfe3b]['on'](_0x34d4('0x47'),function(){if(_0x77e6f1['rules'][_0x1dfe3b]){delete _0x77e6f1[_0x34d4('0x46')][_0x1dfe3b];}});_0x2f4125=setTimeout(function(){logger[_0x34d4('0x2d')](_0x34d4('0x48'),_0x1dfe3b);endRouting(_0x1dfe3b,_0x19deaa,_0x2dd9e2,_0x77e6f1);clearTimeout(_0x2f4125);_0x370003['close'](!![]);_0x4a171b[_0x34d4('0x49')]();},_0x2407b7);switch(_0x19deaa[_0x34d4('0x4a')]){case _0x34d4('0x4b'):strategy[_0x34d4('0x4b')](_0x370003,_0x19deaa,_0x77e6f1,_0x2dd9e2);break;default:strategy['beepall'](_0x370003,_0x19deaa,_0x77e6f1,_0x2dd9e2);}}else{logger['error'](_0x34d4('0x4c'),_0x1dfe3b,_0x3a38ea[_0x34d4('0x2f')]);_0x4a171b[_0x34d4('0x3f')]();}}}catch(_0x460ef2){console['log'](_0x460ef2);logger[_0x34d4('0x32')](_0x34d4('0x4d'),_0x1dfe3b,_0x460ef2['stack']);_0x4a171b[_0x34d4('0x3f')]();}};}; \ 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 bd18ef4..bb35522 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 _0x4bc3=['hideNotification','STOP','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','bind','handleTimeout','timeout','drained','handleDrained','push','handleRun','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','busy','busyQueue','saveWaitingNotification','channel','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x2d8aae,_0x4dc2c5){var _0x4add8a=function(_0x2ba1d9){while(--_0x2ba1d9){_0x2d8aae['push'](_0x2d8aae['shift']());}};_0x4add8a(++_0x4dc2c5);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x4bc3[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x34bc('0x0'));var uuid=require(_0x34bc('0x1'));var util=require('./util');var logger=require(_0x34bc('0x2'))(_0x34bc('0x3'));var Agent=function(_0x5b45c7,_0x178fc0,_0x616014,_0x3ce1c3){this[_0x34bc('0x4')]=uuid['v4']();this[_0x34bc('0x5')]=_0x5b45c7;this[_0x34bc('0x6')]=_0x178fc0;this[_0x34bc('0x7')]=_0x616014;this['routing']=_0x3ce1c3;this[_0x34bc('0x5')]['push'](this['handleRun'][_0x34bc('0x8')](this),this[_0x34bc('0x9')][_0x34bc('0x8')](this));this[_0x34bc('0x5')]['on'](_0x34bc('0xa'),this[_0x34bc('0x9')]['bind'](this));this['squeue']['on'](_0x34bc('0xb'),this[_0x34bc('0xc')][_0x34bc('0x8')](this));};Agent['prototype'][_0x34bc('0xd')]=function(){this['squeue'][_0x34bc('0xd')](this[_0x34bc('0xe')][_0x34bc('0x8')](this),this['handleTimeout'][_0x34bc('0x8')](this));};Agent['prototype'][_0x34bc('0xc')]=function(){this[_0x34bc('0x9')](!![]);};Agent[_0x34bc('0xf')]['handleRun']=function(){logger['debug'](_0x34bc('0x10'),this['squeue']['id'],this[_0x34bc('0x6')]['id']);if(_[_0x34bc('0x11')](this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']])){logger[_0x34bc('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}else{if(this[_0x34bc('0x3')][_0x34bc('0x14')]||util['isAgentAvailable'](this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')]['agents'][this[_0x34bc('0x6')]['id']],this[_0x34bc('0x5')]['channel'],![])){this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']][_0x34bc('0x15')]=!![];this[_0x34bc('0x7')][_0x34bc('0x12')][this['agent']['id']][_0x34bc('0x16')]=undefined;util[_0x34bc('0x17')](this[_0x34bc('0x7')],this['routing'],this['agent'],this[_0x34bc('0x5')][_0x34bc('0x18')]);util[_0x34bc('0x19')](this[_0x34bc('0x4')],this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],null,this[_0x34bc('0x3')]);util[_0x34bc('0x1a')](this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')]['agents'][this[_0x34bc('0x6')]['id']],'RINGING'+(this['routing'][_0x34bc('0x14')]?':FORCED':''));}else{logger[_0x34bc('0x13')](_0x34bc('0x1b'),this[_0x34bc('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}}};Agent[_0x34bc('0xf')][_0x34bc('0x9')]=function(_0x2bb874){if(_[_0x34bc('0x11')](this['realtime'][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']])){return logger[_0x34bc('0x13')](_0x34bc('0x1c'),this[_0x34bc('0x5')]['id'],this[_0x34bc('0x6')]['id']);}else{logger['debug'](_0x34bc('0x1d'),this['squeue']['id'],this['agent']['id']);util[_0x34bc('0x1e')](this['notificationId'],this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],null,this[_0x34bc('0x3')]);this[_0x34bc('0x7')][_0x34bc('0x12')][this['agent']['id']][_0x34bc('0x15')]=![];this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']][_0x34bc('0x16')]=undefined;util['removeWaitingNotification'](this[_0x34bc('0x7')],this[_0x34bc('0x3')],this[_0x34bc('0x6')],this[_0x34bc('0x5')][_0x34bc('0x18')]);util['writeLog'](this['squeue']['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],_0x2bb874?_0x34bc('0x1f'):'TIMEOUT');}if(!_0x2bb874){setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}};function agent(_0x32cf3b,_0x5b6acd,_0x37cd30,_0x42d1eb){return new Agent(_0x32cf3b,_0x5b6acd,_0x37cd30,_0x42d1eb);}module[_0x34bc('0x20')]=agent; \ No newline at end of file +var _0x6334=['handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','handleTimeout','timeout','drained','prototype'];(function(_0x3f1d44,_0xd5acf3){var _0x321b40=function(_0x23b27f){while(--_0x23b27f){_0x3f1d44['push'](_0x3f1d44['shift']());}};_0x321b40(++_0xd5acf3);}(_0x6334,0x119));var _0x4633=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0x6334[_0x462fe4];return _0x82b23a;};'use strict';var _=require(_0x4633('0x0'));var uuid=require(_0x4633('0x1'));var util=require(_0x4633('0x2'));var logger=require(_0x4633('0x3'))(_0x4633('0x4'));var Agent=function(_0x47254b,_0x5109db,_0x1099be,_0x205442){this[_0x4633('0x5')]=uuid['v4']();this[_0x4633('0x6')]=_0x47254b;this[_0x4633('0x7')]=_0x5109db;this[_0x4633('0x8')]=_0x1099be;this[_0x4633('0x4')]=_0x205442;this['squeue'][_0x4633('0x9')](this['handleRun'][_0x4633('0xa')](this),this[_0x4633('0xb')]['bind'](this));this[_0x4633('0x6')]['on'](_0x4633('0xc'),this[_0x4633('0xb')]['bind'](this));this[_0x4633('0x6')]['on'](_0x4633('0xd'),this['handleDrained'][_0x4633('0xa')](this));};Agent[_0x4633('0xe')][_0x4633('0x9')]=function(){this[_0x4633('0x6')]['push'](this[_0x4633('0xf')][_0x4633('0xa')](this),this[_0x4633('0xb')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0x4633('0xb')](!![]);};Agent[_0x4633('0xe')]['handleRun']=function(){logger['debug'](_0x4633('0x10'),this['squeue']['id'],this[_0x4633('0x7')]['id']);if(_[_0x4633('0x11')](this[_0x4633('0x8')][_0x4633('0x12')][this['agent']['id']])){logger[_0x4633('0x13')](_0x4633('0x14'),this[_0x4633('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x4633('0x9')][_0x4633('0xa')](this),0x3e8);}else{if(this[_0x4633('0x4')][_0x4633('0x15')]||util[_0x4633('0x16')](this['squeue']['id'],this[_0x4633('0x8')][_0x4633('0x12')][this['agent']['id']],this['squeue'][_0x4633('0x17')],![])){this['realtime'][_0x4633('0x12')][this['agent']['id']]['busy']=!![];this[_0x4633('0x8')][_0x4633('0x12')][this[_0x4633('0x7')]['id']][_0x4633('0x18')]=undefined;util[_0x4633('0x19')](this[_0x4633('0x8')],this['routing'],this[_0x4633('0x7')],this['squeue'][_0x4633('0x17')]);util[_0x4633('0x1a')](this[_0x4633('0x5')],this[_0x4633('0x6')]['id'],this[_0x4633('0x8')]['agents'][this[_0x4633('0x7')]['id']],null,this[_0x4633('0x4')]);util[_0x4633('0x1b')](this[_0x4633('0x6')]['id'],this[_0x4633('0x8')][_0x4633('0x12')][this[_0x4633('0x7')]['id']],_0x4633('0x1c')+(this[_0x4633('0x4')][_0x4633('0x15')]?_0x4633('0x1d'):''));}else{logger[_0x4633('0x13')](_0x4633('0x1e'),this[_0x4633('0x6')]['id'],this[_0x4633('0x7')]['id']);setTimeout(this[_0x4633('0x9')][_0x4633('0xa')](this),0x3e8);}}};Agent[_0x4633('0xe')]['handleTimeout']=function(_0x197aa6){if(_[_0x4633('0x11')](this[_0x4633('0x8')][_0x4633('0x12')][this[_0x4633('0x7')]['id']])){return logger[_0x4633('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x4633('0x6')]['id'],this['agent']['id']);}else{logger[_0x4633('0x13')](_0x4633('0x1f'),this[_0x4633('0x6')]['id'],this[_0x4633('0x7')]['id']);util[_0x4633('0x20')](this[_0x4633('0x5')],this[_0x4633('0x6')]['id'],this[_0x4633('0x8')][_0x4633('0x12')][this[_0x4633('0x7')]['id']],null,this[_0x4633('0x4')]);this[_0x4633('0x8')][_0x4633('0x12')][this[_0x4633('0x7')]['id']]['busy']=![];this['realtime'][_0x4633('0x12')][this[_0x4633('0x7')]['id']]['busyQueue']=undefined;util[_0x4633('0x21')](this[_0x4633('0x8')],this[_0x4633('0x4')],this[_0x4633('0x7')],this['squeue'][_0x4633('0x17')]);util['writeLog'](this[_0x4633('0x6')]['id'],this[_0x4633('0x8')][_0x4633('0x12')][this[_0x4633('0x7')]['id']],_0x197aa6?_0x4633('0x22'):_0x4633('0x23'));}if(!_0x197aa6){setTimeout(this[_0x4633('0x9')][_0x4633('0xa')](this),0x3e8);}};function agent(_0x546390,_0x29b0b5,_0x107616,_0x51e3e8){return new Agent(_0x546390,_0x29b0b5,_0x107616,_0x51e3e8);}module[_0x4633('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 d73e356..07281a2 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 _0x0b0c=['length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','showNotification','hideNotification','STOP','TIMEOUT','removeWaitingNotification','lodash','routing','notificationId','queue','realtime','squeue','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','Agents'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0b0c,0xf0));var _0xc0b0=function(_0x188c88,_0x210793){_0x188c88=_0x188c88-0x0;var _0x4e4c38=_0x0b0c[_0x188c88];return _0x4e4c38;};'use strict';var _=require(_0xc0b0('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')(_0xc0b0('0x1'));var Beepall=function(_0x3bd869,_0x8233b,_0x5bcf8f,_0x8ebe79){this[_0xc0b0('0x2')]=uuid['v4']();this['squeue']=_0x3bd869;this[_0xc0b0('0x3')]=_0x8233b;this[_0xc0b0('0x4')]=_0x5bcf8f;this[_0xc0b0('0x1')]=_0x8ebe79;this[_0xc0b0('0x5')][_0xc0b0('0x6')](this['handleRun'][_0xc0b0('0x7')](this),this['handleTimeout'][_0xc0b0('0x7')](this));this['squeue']['on'](_0xc0b0('0x8'),this[_0xc0b0('0x9')][_0xc0b0('0x7')](this));this['squeue']['on'](_0xc0b0('0xa'),this[_0xc0b0('0xb')][_0xc0b0('0x7')](this));};Beepall[_0xc0b0('0xc')][_0xc0b0('0x6')]=function(){this[_0xc0b0('0x5')]['push'](this[_0xc0b0('0xd')][_0xc0b0('0x7')](this),this['handleTimeout']['bind'](this));};Beepall[_0xc0b0('0xc')]['handleDrained']=function(){this['handleTimeout'](!![]);};Beepall[_0xc0b0('0xc')]['handleRun']=function(){var _0x449066=!![];if(!_[_0xc0b0('0xe')](this['queue'])&&!_[_0xc0b0('0xe')](this['queue'][_0xc0b0('0xf')])&&this['queue'][_0xc0b0('0xf')][_0xc0b0('0x10')]>0x0){for(var _0x200683=0x0,_0x26c111;_0x2006830x0){for(var _0x2af92d=0x0,_0x3768c6;_0x2af92d0x0&&_0x16dc3f[_0x5413ec+_0x60cf('0x20')]>=_0x16dc3f[_0x5413ec+_0x60cf('0x1f')]){writeLog(_0x4d73b1,_0x16dc3f,_0x5413ec[_0x60cf('0x21')]()+_0x60cf('0x22'));return![];}}return!![];};exports[_0x60cf('0x23')]=function(_0xc14bb7,_0x424640,_0x1ef2d9,_0xdb76aa,_0x4f8467){return sendNotification(!![],_0xc14bb7,_0x424640,_0x1ef2d9,_0xdb76aa,_0x4f8467);};exports[_0x60cf('0x24')]=function(_0x54cd3e,_0x2a7b3d,_0x4665a4,_0x2e1557,_0x21f973){return sendNotification(![],_0x54cd3e,_0x2a7b3d,_0x4665a4,_0x2e1557,_0x21f973);};exports[_0x60cf('0x25')]=function(_0x328fac,_0x30667d,_0x3d7213){var _0x366a57=_0x30667d[_0x60cf('0x26')][_0x60cf('0x27')];if(!_0x366a57&&_0x3d7213){_0x366a57=_0x3d7213['id'];}var _0x44f307=_['some'](_0x328fac[_0x30667d[_0x60cf('0x28')]+_0x60cf('0x29')],function(_0x395336){var _0xc06ddc=_[_0x60cf('0x2a')](_0x30667d['channel'])+_0x60cf('0x2b');return _0x395336[_0xc06ddc]===_0x30667d[_0x60cf('0x26')]['id'];});if(!_0x44f307&&_0x366a57){_0x44f307=_[_0x60cf('0x2c')](_0x328fac[_0x60cf('0x2d')][_0x366a57][_0x30667d[_0x60cf('0x28')]+'WaitingInteractions'],function(_0x2526b1){return _0x2526b1['id']===_0x30667d[_0x60cf('0x26')]['id'];});}return _0x44f307;};exports[_0x60cf('0x2e')]=function(_0x5d4d9b,_0x452e40,_0x2df88f,_0x21b8f7){_0x5d4d9b['agents'][_0x2df88f['id']][_0x21b8f7+_0x60cf('0x2f')][_0x452e40[_0x60cf('0x14')]['id']]={'id':_0x452e40[_0x60cf('0x26')]['id']};};exports[_0x60cf('0x30')]=function(_0x1c6ea7,_0x51762f,_0xd80b3c,_0x5562d2){delete _0x1c6ea7[_0x60cf('0x2d')][_0xd80b3c['id']][_0x5562d2+_0x60cf('0x2f')][_0x51762f[_0x60cf('0x14')]['id']];};exports[_0x60cf('0x31')]=writeLog; \ No newline at end of file +var _0xe0b7=['\x20interaction','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','user:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','channel','QueuesWaitingInteractions','capitalize','InteractionId','interaction','some','WaitingInteractions','agents','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','name','emit','user:save','split'];(function(_0x5c3a3d,_0x22568d){var _0x18decf=function(_0x285a55){while(--_0x285a55){_0x5c3a3d['push'](_0x5c3a3d['shift']());}};_0x18decf(++_0x22568d);}(_0xe0b7,0xf5));var _0x7e0b=function(_0x139a7d,_0x32917f){_0x139a7d=_0x139a7d-0x0;var _0x16bc25=_0xe0b7[_0x139a7d];return _0x16bc25;};'use strict';var _=require(_0x7e0b('0x0'));var util=require(_0x7e0b('0x1'));var utils=require(_0x7e0b('0x2'));var Redis=require(_0x7e0b('0x3'));var config=require(_0x7e0b('0x4'));var logger=require(_0x7e0b('0x5'))('routing');config[_0x7e0b('0x6')]=_[_0x7e0b('0x7')](config[_0x7e0b('0x6')],{'host':_0x7e0b('0x8'),'port':0x18eb});var io=require(_0x7e0b('0x9'))(new Redis(config[_0x7e0b('0x6')]));function sendNotification(_0x196454,_0x3e543a,_0x3a68ee,_0x218771,_0x552bd1,_0x1549da){io['to'](util[_0x7e0b('0xa')]('user:%s',_0x218771[_0x7e0b('0xb')]))[_0x7e0b('0xc')](_0x7e0b('0xd'),_0x218771);var _0x57e8bd=_0x1549da||{};var _0x4bee64=_0x3a68ee[_0x7e0b('0xe')]('.');var _0x5de072={'uniqueid':_0x3e543a,'channel':_0x4bee64[0x0],'id':_0x4bee64[0x1],'title':_0x4bee64[0x0]+_0x7e0b('0xf'),'interactionId':_0x4bee64[0x2],'queue':_0x552bd1?_0x552bd1[_0x7e0b('0xb')]:null,'sound':_0x57e8bd[_0x7e0b('0x10')][_0x7e0b('0x11')],'shake':_0x57e8bd[_0x7e0b('0x10')][_0x7e0b('0x12')]};try{if(!_0x57e8bd['body']){_0x57e8bd[_0x7e0b('0x13')]={};}if(_0x552bd1){_0x57e8bd[_0x7e0b('0x13')][_0x7e0b('0x14')]=_0x552bd1;}else if(_0x57e8bd[_0x7e0b('0x13')][_0x7e0b('0x14')]){delete _0x57e8bd[_0x7e0b('0x13')][_0x7e0b('0x14')];}_0x5de072[_0x7e0b('0x15')]=utils['getMustacheRender'](_0x57e8bd['account'][_0x7e0b('0x16')],_0x57e8bd);}catch(_0x4f345c){_0x5de072['msg']=_0x7e0b('0x17');logger['error'](util['format'](_0x7e0b('0x18'),_0x3e543a,_0x4f345c[_0x7e0b('0x19')]));}io['to'](util['format'](_0x7e0b('0x1a'),_0x218771[_0x7e0b('0xb')]))['emit'](util[_0x7e0b('0xa')]('notification:%s',_0x196454?_0x7e0b('0x1b'):'remove'),_0x5de072);}function writeLog(_0x3b78d9,_0x2af4bb,_0x5c0d36){return logger[_0x7e0b('0x1c')](util[_0x7e0b('0xa')](_0x7e0b('0x1d'),_0x3b78d9,_0x2af4bb[_0x7e0b('0xb')],_0x5c0d36));}exports[_0x7e0b('0x1e')]=function(_0x1f8683,_0x1473f6,_0x4f108c,_0x4c0ce2){if(_0x1473f6[_0x7e0b('0x1f')]){writeLog(_0x1f8683,_0x1473f6,_0x7e0b('0x20'));return![];}if(!_0x1473f6[_0x7e0b('0x21')]){writeLog(_0x1f8683,_0x1473f6,'OFFLINE');return![];}if(_0x1473f6[_0x4f108c+'Pause']){writeLog(_0x1f8683,_0x1473f6,_0x7e0b('0x22'));return![];}if(_0x4c0ce2&&_0x1473f6[_0x7e0b('0x23')](_0x4f108c+_0x7e0b('0x24'))&&_0x1473f6['hasOwnProperty'](_0x4f108c+'CurrentCapacity')){if(_0x1473f6[_0x4f108c+_0x7e0b('0x24')]>0x0&&_0x1473f6[_0x4f108c+_0x7e0b('0x25')]>=_0x1473f6[_0x4f108c+_0x7e0b('0x24')]){writeLog(_0x1f8683,_0x1473f6,_0x4f108c[_0x7e0b('0x26')]()+_0x7e0b('0x27'));return![];}}return!![];};exports[_0x7e0b('0x28')]=function(_0x556402,_0x1cf19c,_0x53f914,_0x5b87fd,_0x271107){return sendNotification(!![],_0x556402,_0x1cf19c,_0x53f914,_0x5b87fd,_0x271107);};exports[_0x7e0b('0x29')]=function(_0x5b7952,_0x2cf3c3,_0xe75414,_0x2a60a2,_0x2b7651){return sendNotification(![],_0x5b7952,_0x2cf3c3,_0xe75414,_0x2a60a2,_0x2b7651);};exports['checkWaitingNotifications']=function(_0x3b3026,_0x38777a,_0x29e1d8){var _0x5a5018=_0x38777a['interaction']['UserId'];if(!_0x5a5018&&_0x29e1d8){_0x5a5018=_0x29e1d8['id'];}var _0xccc11a=_['some'](_0x3b3026[_0x38777a[_0x7e0b('0x2a')]+_0x7e0b('0x2b')],function(_0x33e060){var _0x6229f=_[_0x7e0b('0x2c')](_0x38777a[_0x7e0b('0x2a')])+_0x7e0b('0x2d');return _0x33e060[_0x6229f]===_0x38777a[_0x7e0b('0x2e')]['id'];});if(!_0xccc11a&&_0x5a5018){_0xccc11a=_[_0x7e0b('0x2f')](_0x3b3026['agents'][_0x5a5018][_0x38777a['channel']+_0x7e0b('0x30')],function(_0x73befc){return _0x73befc['id']===_0x38777a[_0x7e0b('0x2e')]['id'];});}return _0xccc11a;};exports['saveWaitingNotification']=function(_0x4a8d6a,_0x1fb8a4,_0x297374,_0x2145e2){_0x4a8d6a[_0x7e0b('0x31')][_0x297374['id']][_0x2145e2+'WaitingInteractions'][_0x1fb8a4[_0x7e0b('0x19')]['id']]={'id':_0x1fb8a4[_0x7e0b('0x2e')]['id']};};exports[_0x7e0b('0x32')]=function(_0x114533,_0x534722,_0x2d6507,_0x22eea2){delete _0x114533[_0x7e0b('0x31')][_0x2d6507['id']][_0x22eea2+_0x7e0b('0x30')][_0x534722[_0x7e0b('0x19')]['id']];};exports[_0x7e0b('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 d233e44..188b3ee 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 _0xa67b=['getMustacheRender','info','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','next'];(function(_0x424273,_0x628f19){var _0x3fb77d=function(_0x51c346){while(--_0x51c346){_0x424273['push'](_0x424273['shift']());}};_0x3fb77d(++_0x628f19);}(_0xa67b,0x14a));var _0xba67=function(_0x44fd07,_0x40f3e0){_0x44fd07=_0x44fd07-0x0;var _0x1e6808=_0xa67b[_0x44fd07];return _0x1e6808;};'use strict';var schema=require(_0xba67('0x0'));var sh=require(_0xba67('0x1'));var _=require(_0xba67('0x2'));var utils=require(_0xba67('0x3'));var logger=require(_0xba67('0x4'))(_0xba67('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xba67('0x6')}});exports[_0xba67('0x7')]=function(_0x5be871,_0x227c69){return function(_0x547272){try{var _0x39baa2={'command':_0x227c69[0x0]};var _0x351b19=system[_0xba67('0x0')](_0x39baa2,{'typecast':!![]});if(_0x351b19[_0xba67('0x8')]){logger[_0xba67('0x9')](_0xba67('0xa'),_0x5be871,_[_0xba67('0xb')](_0x351b19,_0xba67('0xc'))[_0xba67('0xd')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5be871);_0x547272[_0xba67('0xe')]();}else{var _0xb00962=this;var _0x573ce4=utils[_0xba67('0xf')](_0x227c69[0x0],this);logger[_0xba67('0x10')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5be871,_0x573ce4);sh['exec'](_[_0xba67('0x11')](_0x573ce4),function(_0x557cc3,_0x1bc7ac){logger[_0xba67('0x10')](_0xba67('0x12'),_0x5be871,_0x557cc3);if(_0x557cc3==0x0){var _0x413af7=_0x1bc7ac[_0xba67('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xba67('0x14')](_0x227c69[0x1])||_['isEmpty'](_0x227c69[0x1])){logger[_0xba67('0x10')]('[%s][SYSTEM]\x20no\x20variable',_0x5be871);_0xb00962[_0xba67('0x15')][_0x227c69[0x1]]=_0x413af7;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x5be871,_0x227c69[0x1],_0x413af7);_0xb00962[_0xba67('0x15')][_0x227c69[0x1]]=_0x413af7;}}_0x547272[_0xba67('0xe')]();});}}catch(_0x529634){logger['error'](_0xba67('0xa'),_0x5be871,_['isObject'](_0x529634)?JSON[_0xba67('0x16')](_0x529634):_0x529634);logger[_0xba67('0x10')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5be871);_0x547272[_0xba67('0xe')]();}};}; \ No newline at end of file +var _0x6400=['getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x574f63,_0x1d2a8f){var _0x2d2e62=function(_0x17a063){while(--_0x17a063){_0x574f63['push'](_0x574f63['shift']());}};_0x2d2e62(++_0x1d2a8f);}(_0x6400,0x1ee));var _0x0640=function(_0x140308,_0x3443fc){_0x140308=_0x140308-0x0;var _0xc1f132=_0x6400[_0x140308];return _0xc1f132;};'use strict';var schema=require(_0x0640('0x0'));var sh=require('shelljs');var _=require(_0x0640('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x0640('0x2'));var system=schema({'command':{'type':_0x0640('0x3'),'required':!![],'message':_0x0640('0x4')}});exports[_0x0640('0x5')]=function(_0x55dbd7,_0x145718){return function(_0x4d51d1){try{var _0x64924a={'command':_0x145718[0x0]};var _0x2fb7fa=system[_0x0640('0x0')](_0x64924a,{'typecast':!![]});if(_0x2fb7fa[_0x0640('0x6')]){logger[_0x0640('0x7')](_0x0640('0x8'),_0x55dbd7,_[_0x0640('0x9')](_0x2fb7fa,'message')['join'](',\x20'));logger[_0x0640('0xa')](_0x0640('0xb'),_0x55dbd7);_0x4d51d1['next']();}else{var _0xf38496=this;var _0xb83ba3=utils[_0x0640('0xc')](_0x145718[0x0],this);logger[_0x0640('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x55dbd7,_0xb83ba3);sh['exec'](_[_0x0640('0xd')](_0xb83ba3),function(_0x3480fe,_0x1498a2){logger[_0x0640('0xa')](_0x0640('0xe'),_0x55dbd7,_0x3480fe);if(_0x3480fe==0x0){var _0x349783=_0x1498a2['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x145718[0x1])||_[_0x0640('0xf')](_0x145718[0x1])){logger[_0x0640('0xa')](_0x0640('0x10'),_0x55dbd7);_0xf38496[_0x0640('0x11')][_0x145718[0x1]]=_0x349783;}else{logger['info'](_0x0640('0x12'),_0x55dbd7,_0x145718[0x1],_0x349783);_0xf38496['body'][_0x145718[0x1]]=_0x349783;}}_0x4d51d1[_0x0640('0x13')]();});}}catch(_0x4f211a){logger[_0x0640('0x7')](_0x0640('0x8'),_0x55dbd7,_[_0x0640('0x14')](_0x4f211a)?JSON[_0x0640('0x15')](_0x4f211a):_0x4f211a);logger[_0x0640('0xa')](_0x0640('0xb'),_0x55dbd7);_0x4d51d1[_0x0640('0x13')]();}};}; \ 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 e0c9eaa..26086e5 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 _0xe662=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','channel','Interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','stringify','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x3da2cc,_0x90820d){var _0x396973=function(_0x272f86){while(--_0x272f86){_0x3da2cc['push'](_0x3da2cc['shift']());}};_0x396973(++_0x90820d);}(_0xe662,0x1b6));var _0x2e66=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xe662[_0x5b561d];return _0x431060;};'use strict';var schema=require('validate');var _=require(_0x2e66('0x0'));var rpc={'chatInteraction':require(_0x2e66('0x1')),'openchannelInteraction':require(_0x2e66('0x2')),'smsInteraction':require(_0x2e66('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x2e66('0x4')),'whatsappInteraction':require(_0x2e66('0x5'))};var logger=require(_0x2e66('0x6'))(_0x2e66('0x7'));var tag=schema({'tag':{'type':_0x2e66('0x8'),'required':!![],'message':_0x2e66('0x9')}});exports['consequence']=function(_0x2f1e44,_0x3b9d28,_0x20c28f,_0x2abd9e){return function(_0x2235e2){try{var _0x59b5d4={'tag':_0x3b9d28[0x0]};var _0x2a78c8=tag['validate'](_0x59b5d4,{'typecast':!![]});if(_0x2a78c8['length']){logger[_0x2e66('0xa')](_0x2e66('0xb'),_0x2f1e44,_[_0x2e66('0xc')](_0x2a78c8,_0x2e66('0xd'))[_0x2e66('0xe')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2f1e44);_0x2235e2['next']();}else{var _0x40a12b={'ids':[_0x3b9d28[0x0]]};if(rpc[_0x2abd9e[_0x2e66('0xf')]+_0x2e66('0x10')]){rpc[_0x2abd9e[_0x2e66('0xf')]+'Interaction']['addTags'](_0x2abd9e['interaction']['id'],_0x40a12b)[_0x2e66('0x11')](function(_0x21600e){logger['info'](_0x2e66('0x12'),_0x2f1e44,_0x3b9d28[0x1],_0x2abd9e['channel'],_0x2abd9e[_0x2e66('0x13')]['id']);})['catch'](function(_0x28eca5){logger['error'](_0x2e66('0xb'),_0x2f1e44,JSON[_0x2e66('0x14')](_0x28eca5));logger[_0x2e66('0x15')](_0x2e66('0x16'),_0x2f1e44);})[_0x2e66('0x17')](function(){_0x2235e2[_0x2e66('0x18')]();});}}}catch(_0x50298d){logger['error'](_0x2e66('0xb'),_0x2f1e44,_[_0x2e66('0x19')](_0x50298d)?JSON[_0x2e66('0x14')](_0x50298d):_0x50298d);logger['info'](_0x2e66('0x16'),_0x2f1e44);_0x2235e2['next']();}};}; \ No newline at end of file +var _0xde9f=['error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','catch','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x5a6638,_0x59db60){var _0x3144f6=function(_0x27ae35){while(--_0x27ae35){_0x5a6638['push'](_0x5a6638['shift']());}};_0x3144f6(++_0x59db60);}(_0xde9f,0xd3));var _0xfde9=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0xde9f[_0x7d62cb];return _0x3a6266;};'use strict';var schema=require(_0xfde9('0x0'));var _=require(_0xfde9('0x1'));var rpc={'chatInteraction':require(_0xfde9('0x2')),'openchannelInteraction':require(_0xfde9('0x3')),'smsInteraction':require(_0xfde9('0x4')),'mailInteraction':require(_0xfde9('0x5')),'faxInteraction':require(_0xfde9('0x6')),'whatsappInteraction':require(_0xfde9('0x7'))};var logger=require('../../../../config/logger')(_0xfde9('0x8'));var tag=schema({'tag':{'type':_0xfde9('0x9'),'required':!![],'message':_0xfde9('0xa')}});exports[_0xfde9('0xb')]=function(_0x4ef765,_0x466b57,_0x1123d2,_0x10d332){return function(_0x582ba5){try{var _0x714c6b={'tag':_0x466b57[0x0]};var _0x1201c1=tag[_0xfde9('0x0')](_0x714c6b,{'typecast':!![]});if(_0x1201c1[_0xfde9('0xc')]){logger[_0xfde9('0xd')](_0xfde9('0xe'),_0x4ef765,_[_0xfde9('0xf')](_0x1201c1,'message')[_0xfde9('0x10')](',\x20'));logger[_0xfde9('0x11')](_0xfde9('0x12'),_0x4ef765);_0x582ba5[_0xfde9('0x13')]();}else{var _0x2f78aa={'ids':[_0x466b57[0x0]]};if(rpc[_0x10d332[_0xfde9('0x14')]+_0xfde9('0x15')]){rpc[_0x10d332[_0xfde9('0x14')]+_0xfde9('0x15')][_0xfde9('0x16')](_0x10d332[_0xfde9('0x17')]['id'],_0x2f78aa)['then'](function(_0x1e1fe3){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x4ef765,_0x466b57[0x1],_0x10d332['channel'],_0x10d332[_0xfde9('0x17')]['id']);})[_0xfde9('0x18')](function(_0x44fc3e){logger['error']('[%s][TAG]\x20%s',_0x4ef765,JSON['stringify'](_0x44fc3e));logger[_0xfde9('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4ef765);})[_0xfde9('0x19')](function(){_0x582ba5[_0xfde9('0x13')]();});}}}catch(_0x3e38c0){logger[_0xfde9('0xd')](_0xfde9('0xe'),_0x4ef765,_[_0xfde9('0x1a')](_0x3e38c0)?JSON[_0xfde9('0x1b')](_0x3e38c0):_0x3e38c0);logger[_0xfde9('0x11')](_0xfde9('0x12'),_0x4ef765);_0x582ba5[_0xfde9('0x13')]();}};}; \ 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 d998b50..e397fca 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 _0xd123=['stop','error','[%s][TVOX]\x20%s','isObject','stringify','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','urlOnAnswer','?params=','urlOnRing','2.0','method','login','push','params','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s'];(function(_0x2a46b2,_0x43ff46){var _0x53ae15=function(_0x54e167){while(--_0x54e167){_0x2a46b2['push'](_0x2a46b2['shift']());}};_0x53ae15(++_0x43ff46);}(_0xd123,0x13c));var _0x3d12=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xd123[_0x420f2a];return _0x28f802;};'use strict';var rp=require(_0x3d12('0x0'));var logger=require(_0x3d12('0x1'))(_0x3d12('0x2'));var _=require(_0x3d12('0x3'));var arr=[];exports[_0x3d12('0x4')]=function(_0x194950,_0x1fc5de){return function(_0x1db6f6){var _0x5a6ab4=_0x1fc5de[0xa];var _0x3592ce=_0x1fc5de[0xb];var _0x3535c7=_0x1fc5de[0xc];var _0x2e4f6c=_0x1fc5de[0xd];var _0x5c3c13=_0x1fc5de[0xe];var _0x120d3b=_0x1fc5de[0xf][_0x3d12('0x5')](/\n/g,'\x20-\x20');var _0x4291db=_0x1fc5de[0x10][_0x3d12('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x3592ce)){arr['push'](_0x3592ce);var _0x298da7=_0x1fc5de[0x3];var _0x5c69f6=_0x1fc5de[0x4];var _0x199a4f=_0x1fc5de[0x1];var _0x4ea79f=_0x1fc5de[0x0];var _0x3569ed={};_0x3569ed[_0x3d12('0x6')]=_0x1fc5de[0x8]+_0x3d12('0x7')+_0x3535c7+'|'+_0x5a6ab4+'|'+_0x2e4f6c+'|'+_0x3592ce+'|'+_0x5c3c13;_0x3569ed[_0x3d12('0x8')]=_0x1fc5de[0x7]+_0x3d12('0x7')+_0x3535c7+'|'+_0x5a6ab4+'|'+_0x2e4f6c+'|'+_0x3592ce+'|'+_0x5c3c13+'|'+_0x120d3b+'|'+_0x4291db;_0x3569ed['title']=_0x1fc5de[0x9];var _0x336a03={};_0x336a03['jsonrpc']=_0x3d12('0x9');_0x336a03[_0x3d12('0xa')]=_0x3d12('0xb');var _0x3b4359=[];_0x3b4359[_0x3d12('0xc')](_0x1fc5de[0x2]);_0x3b4359[_0x3d12('0xc')](_0x1fc5de[0x5]);_0x3b4359[_0x3d12('0xc')](_0x1fc5de[0x6]);_0x336a03[_0x3d12('0xd')]=_0x3b4359;_0x336a03['id']=0x1;var _0x44e6ad=JSON['stringify'](_0x336a03);var _0x59afb3={'encoding':_0x3d12('0xe'),'method':_0x3d12('0xf'),'timeout':0x2710,'url':_0x298da7,'headers':{'Content-Type':_0x3d12('0x10')},'body':_0x44e6ad};return rp(_0x59afb3)[_0x3d12('0x11')](function(_0x27daa9){const _0x1a8007=JSON[_0x3d12('0x12')](_0x27daa9);if(!_0x1a8007[_0x3d12('0x13')][_0x3d12('0x14')]){throw new Error(_0x3d12('0x15'));}var _0x160638=_0x3592ce;var _0x4e6215='channelId='+_0x199a4f+_0x3d12('0x16')+_0x4ea79f+'&sessionId='+_0x160638+'&data='+JSON['stringify'](_0x3569ed);var _0xd9da53=_0x5c69f6+'?'+_0x4e6215;return rp(_0xd9da53);})[_0x3d12('0x11')](function(_0x303c60){logger[_0x3d12('0x17')](_0x3d12('0x18'),_0x194950,_0x303c60);_0x1db6f6[_0x3d12('0x19')]();})['catch'](function(_0x3e8c8e){logger[_0x3d12('0x1a')](_0x3d12('0x1b'),_0x194950,_[_0x3d12('0x1c')](_0x3e8c8e)?JSON[_0x3d12('0x1d')](_0x3e8c8e):_0x3e8c8e);_0x1db6f6[_0x3d12('0x19')]();});}else{logger[_0x3d12('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x194950);_0x1db6f6[_0x3d12('0x1e')]();}};}; \ No newline at end of file +var _0x5ec2=['request-promise','../../../../config/logger','routing','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','params','stringify','utf8','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next'];(function(_0x4cfce3,_0x5cfba0){var _0xd71772=function(_0x315f71){while(--_0x315f71){_0x4cfce3['push'](_0x4cfce3['shift']());}};_0xd71772(++_0x5cfba0);}(_0x5ec2,0x1ea));var _0x25ec=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x5ec2[_0x427352];return _0x23e0e6;};'use strict';var rp=require(_0x25ec('0x0'));var logger=require(_0x25ec('0x1'))(_0x25ec('0x2'));var _=require('lodash');var arr=[];exports[_0x25ec('0x3')]=function(_0x1c290f,_0x5a5c8d){return function(_0x1a620d){var _0x3a8ce0=_0x5a5c8d[0xa];var _0x4d5226=_0x5a5c8d[0xb];var _0x2c2d89=_0x5a5c8d[0xc];var _0x490972=_0x5a5c8d[0xd];var _0x1480b9=_0x5a5c8d[0xe];var _0x474b30=_0x5a5c8d[0xf][_0x25ec('0x4')](/\n/g,'\x20-\x20');var _0x4da9ad=_0x5a5c8d[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x25ec('0x5')](_0x4d5226)){arr[_0x25ec('0x6')](_0x4d5226);var _0x566ea5=_0x5a5c8d[0x3];var _0x454e6f=_0x5a5c8d[0x4];var _0xf01441=_0x5a5c8d[0x1];var _0x311711=_0x5a5c8d[0x0];var _0x2a670d={};_0x2a670d[_0x25ec('0x7')]=_0x5a5c8d[0x8]+_0x25ec('0x8')+_0x2c2d89+'|'+_0x3a8ce0+'|'+_0x490972+'|'+_0x4d5226+'|'+_0x1480b9;_0x2a670d[_0x25ec('0x9')]=_0x5a5c8d[0x7]+_0x25ec('0x8')+_0x2c2d89+'|'+_0x3a8ce0+'|'+_0x490972+'|'+_0x4d5226+'|'+_0x1480b9+'|'+_0x474b30+'|'+_0x4da9ad;_0x2a670d[_0x25ec('0xa')]=_0x5a5c8d[0x9];var _0x2dce6={};_0x2dce6[_0x25ec('0xb')]=_0x25ec('0xc');_0x2dce6[_0x25ec('0xd')]='login';var _0x5c23cb=[];_0x5c23cb[_0x25ec('0x6')](_0x5a5c8d[0x2]);_0x5c23cb['push'](_0x5a5c8d[0x5]);_0x5c23cb['push'](_0x5a5c8d[0x6]);_0x2dce6[_0x25ec('0xe')]=_0x5c23cb;_0x2dce6['id']=0x1;var _0x5066d8=JSON[_0x25ec('0xf')](_0x2dce6);var _0x3da724={'encoding':_0x25ec('0x10'),'method':'POST','timeout':0x2710,'url':_0x566ea5,'headers':{'Content-Type':_0x25ec('0x11')},'body':_0x5066d8};return rp(_0x3da724)[_0x25ec('0x12')](function(_0xd0e4d){const _0x198a50=JSON[_0x25ec('0x13')](_0xd0e4d);if(!_0x198a50[_0x25ec('0x14')][_0x25ec('0x15')]){throw new Error(_0x25ec('0x16'));}var _0x2fa373=_0x4d5226;var _0x1f0fb0=_0x25ec('0x17')+_0xf01441+'&serviceId='+_0x311711+_0x25ec('0x18')+_0x2fa373+_0x25ec('0x19')+JSON[_0x25ec('0xf')](_0x2a670d);var _0x74eb2b=_0x454e6f+'?'+_0x1f0fb0;return rp(_0x74eb2b);})[_0x25ec('0x12')](function(_0x4e8602){logger[_0x25ec('0x1a')](_0x25ec('0x1b'),_0x1c290f,_0x4e8602);_0x1a620d[_0x25ec('0x1c')]();})[_0x25ec('0x1d')](function(_0x484095){logger[_0x25ec('0x1e')](_0x25ec('0x1f'),_0x1c290f,_[_0x25ec('0x20')](_0x484095)?JSON[_0x25ec('0xf')](_0x484095):_0x484095);_0x1a620d[_0x25ec('0x1c')]();});}else{logger[_0x25ec('0x1a')](_0x25ec('0x21'),_0x1c290f);_0x1a620d[_0x25ec('0x22')]();}};}; \ 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 8df8894..dbe3ee9 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x300b6b,_0x24fd66){var _0x25a363=function(_0x4fb7b3){while(--_0x4fb7b3){_0x300b6b['push'](_0x300b6b['shift']());}};_0x25a363(++_0x24fd66);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5dbd0f,_0x10eca4){var _0x536d49=function(_0x17b418){while(--_0x17b418){_0x5dbd0f['push'](_0x5dbd0f['shift']());}};_0x536d49(++_0x10eca4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d640f35..32b8e7c 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 _0x1aa7=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata','mail','push','join','split','slice','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','stack','busyQueue','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues'];(function(_0x2945bb,_0x236487){var _0x23707e=function(_0x767c7e){while(--_0x767c7e){_0x2945bb['push'](_0x2945bb['shift']());}};_0x23707e(++_0x236487);}(_0x1aa7,0x1a9));var _0x71aa=function(_0x124247,_0x117bc8){_0x124247=_0x124247-0x0;var _0x451e63=_0x1aa7[_0x124247];return _0x451e63;};'use strict';var _=require(_0x71aa('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x71aa('0x1'));var utils=require('./applications/utils');var sUtils=require(_0x71aa('0x2'));var logger=require(_0x71aa('0x3'))(_0x71aa('0x4'));var rpc={'openchannelQueueReport':require(_0x71aa('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x71aa('0x6')),'smsQueueReport':require(_0x71aa('0x7')),'faxQueueReport':require(_0x71aa('0x8')),'whatsappQueueReport':require(_0x71aa('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2773b1,_0x34cac7,_0x4deee4){return util[_0x71aa('0xa')]('%s.%s.%s',_0x2773b1,_0x34cac7||0x0,_0x4deee4||0x0);}function getIntervals(_0x31f3c0,_0x4c6a58){var _0x5a527a=[];if(!_[_0x71aa('0xb')](_0x4c6a58['IntervalId'])&&!_['isNil'](_0x31f3c0[_0x4c6a58['IntervalId']])&&!_['isNil'](_0x31f3c0[_0x4c6a58[_0x71aa('0xc')]][_0x71aa('0xd')])){_0x5a527a=_['map'](_0x31f3c0[_0x4c6a58['IntervalId']][_0x71aa('0xd')],_0x71aa('0xe'));}else if(!_[_0x71aa('0xb')](_0x4c6a58[_0x71aa('0xe')])){_0x5a527a=[_0x4c6a58['interval']];}return _0x5a527a;}exports[_0x71aa('0xf')]=function(_0x135c20){_0x135c20[_0x71aa('0x10')]={};return new BPromise(function(_0x2744a4,_0x152873){var _0x357fdc={'Start':function(_0x557d94){var _0x56af93=this;return new Promise(function(_0x3751ca,_0x2bda8e){if(_0x557d94){try{var _0x1da4e7=[];var _0x405ca1=getId(_0x557d94[_0x71aa('0x11')],_0x557d94[_0x71aa('0x12')]?_0x557d94[_0x71aa('0x12')]['id']:0x0,_0x557d94[_0x71aa('0x13')]?_0x557d94[_0x71aa('0x13')]['id']:0x0);var _0x36417e=sUtils['checkWaitingNotifications'](_0x135c20,_0x557d94);if(!_0x36417e&&_0x557d94[_0x71aa('0x14')]&&_[_0x71aa('0x15')](_0x557d94[_0x71aa('0x14')])&&_0x557d94[_0x71aa('0x14')][_0x71aa('0x16')]){for(var _0x5809e8=0x0;_0x5809e8<_0x557d94[_0x71aa('0x14')]['length'];_0x5809e8+=0x1){var _0x523bbf=_0x557d94['applications'][_0x5809e8];if(fs[_0x71aa('0x17')](path['join'](__dirname,'applications',_0x523bbf[_0x71aa('0x18')]+_0x71aa('0x19')))){var _0x3baa6d=[];switch(_0x523bbf[_0x71aa('0x18')][_0x71aa('0x1a')]()){case _0x71aa('0x1b'):var _0x5c9170=_0x523bbf[_0x71aa('0x1c')]['split'](',');if(_0x557d94[_0x71aa('0x11')]===_0x71aa('0x1d')){_0x3baa6d[_0x71aa('0x1e')](_0x5c9170[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x5c9170[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x5c9170['slice'](0x2,_0x5c9170['length'])[_0x71aa('0x1f')](','));}else{_0x3baa6d[_0x71aa('0x1e')](_0x5c9170[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x5c9170['slice'](0x1,_0x5c9170[_0x71aa('0x16')])[_0x71aa('0x1f')](','));}break;case'dialogflow':var _0x1244f9=_0x523bbf['appdata'][_0x71aa('0x20')](',');_0x3baa6d[_0x71aa('0x1e')](_0x1244f9[0x0]);_0x3baa6d['push'](_0x1244f9[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x1244f9[_0x71aa('0x21')](0x2,_0x1244f9[_0x71aa('0x16')])['join'](','));break;case _0x71aa('0x22'):var _0x52d2a8=_0x523bbf[_0x71aa('0x1c')]['split'](',');_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x2]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x3]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8['slice'](0x4,_0x52d2a8[_0x71aa('0x16')])['join'](','));break;case _0x71aa('0x23'):var _0x390578=_0x523bbf[_0x71aa('0x1c')][_0x71aa('0x20')](',');_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x2]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x3]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[_0x71aa('0x21')](0x4,_0x390578[_0x71aa('0x16')])[_0x71aa('0x1f')](','));break;case _0x71aa('0x12'):_0x3baa6d[_0x71aa('0x1e')](_0x523bbf['appdata']);break;case _0x71aa('0x24'):_0x3baa6d[_0x71aa('0x1e')](_0x523bbf[_0x71aa('0x25')]);_0x3baa6d['push'](_0x523bbf[_0x71aa('0x1c')]);break;case _0x71aa('0x26'):var _0x803277=utils[_0x71aa('0x27')](_0x557d94['account'][_0x71aa('0x28')],_0x557d94);var _0x3d0523=_0x523bbf['appdata'][_0x71aa('0x20')](',');_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x1]);_0x3baa6d['push'](_0x3d0523[0x2]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x3]);_0x3baa6d['push'](_0x3d0523[0x4]);_0x3baa6d['push'](_0x3d0523[0x5]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x6]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x7]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x8]);_0x3baa6d['push'](_0x3d0523[0x9]);_0x3baa6d['push'](_0x3d0523[0xa]);_0x3baa6d[_0x71aa('0x1e')](_0x557d94['interaction']['id']);_0x3baa6d[_0x71aa('0x1e')](_0x557d94[_0x71aa('0x12')]['id']);_0x3baa6d[_0x71aa('0x1e')](_0x523bbf[_0x71aa('0x29')]);_0x3baa6d['push'](_0x557d94[_0x71aa('0x13')][_0x71aa('0x2a')]);_0x3baa6d['push'](_0x557d94[_0x71aa('0x2b')][_0x71aa('0x2b')]);_0x3baa6d[_0x71aa('0x1e')](_0x803277);break;default:_0x3baa6d=_[_0x71aa('0xb')](_0x523bbf[_0x71aa('0x1c')])?[]:_0x523bbf[_0x71aa('0x1c')][_0x71aa('0x20')](',');}var _0x21f6c7={'id':util[_0x71aa('0xa')](_0x71aa('0x2c'),_0x405ca1,_0x523bbf['id'],_0x523bbf['app']),'condition':require(_0x71aa('0x2d'))['condition'](_0x405ca1,getIntervals(_0x135c20[_0x71aa('0x2e')],_0x523bbf),_0x135c20),'consequence':require(_0x71aa('0x2f')+_0x523bbf[_0x71aa('0x18')])[_0x71aa('0x30')](_0x405ca1,_0x3baa6d,_0x135c20,_0x557d94),'p':_0x523bbf[_0x71aa('0x31')]||0x0};logger[_0x71aa('0x32')](_0x71aa('0x33'),_0x21f6c7['id'],_0x71aa('0x34'),getIntervals(_0x135c20[_0x71aa('0x2e')],_0x523bbf)[_0x71aa('0x1f')](_0x71aa('0x35')));_0x1da4e7['push'](_0x21f6c7);}else{logger['error'](_0x71aa('0x36'),path['join'](__dirname,_0x71aa('0x14'),_0x523bbf[_0x71aa('0x18')]+_0x71aa('0x19')));}}_0x135c20[_0x71aa('0x10')][_0x405ca1]=new RuleEngine(_0x1da4e7);_0x135c20['rules'][_0x405ca1][_0x71aa('0x37')](_0x557d94,function(_0x5d58e5){logger[_0x71aa('0x32')](_0x71aa('0x38'),JSON[_0x71aa('0x39')](_0x5d58e5[_0x71aa('0x3a')]));if(_0x135c20[_0x71aa('0x10')][_0x405ca1]){_0x135c20[_0x71aa('0x10')][_0x405ca1][_0x71aa('0x3b')](_0x71aa('0x3c'));}});return _0x3751ca({'code':0xc8,'message':_0x557d94});}else{if(_0x36417e){logger[_0x71aa('0x32')](util[_0x71aa('0xa')](_0x71aa('0x3d'),_0x405ca1));}else{logger[_0x71aa('0x32')](_0x71aa('0x3e'));}return _0x3751ca({'code':0xc8,'message':_0x557d94});}}catch(_0x503723){logger[_0x71aa('0x3f')](_0x503723['stack']);return _0x2bda8e(_0x56af93[_0x71aa('0x3f')](0x1f4,_0x503723));}}return _0x2bda8e(_0x71aa('0x40'));});},'AcceptMessage':function(_0x5ddc2d){var _0x52cd0a=this;return new Promise(function(_0x2f3084,_0xc632e0){if(_0x5ddc2d[_0x71aa('0x41')]&&_0x5ddc2d['agent']['id']){if(_0x135c20[_0x71aa('0x42')][_0x5ddc2d[_0x71aa('0x41')]['id']]){_0x135c20[_0x71aa('0x42')][_0x5ddc2d[_0x71aa('0x41')]['id']][_0x71aa('0x43')]=![];_0x135c20[_0x71aa('0x42')][_0x5ddc2d[_0x71aa('0x41')]['id']]['busyQueue']=undefined;}}if(_0x5ddc2d[_0x71aa('0x12')]&&_0x5ddc2d[_0x71aa('0x12')]['id']){try{var _0x1e9cd7=getId(_0x5ddc2d[_0x71aa('0x11')],_0x5ddc2d[_0x71aa('0x12')]?_0x5ddc2d[_0x71aa('0x12')]['id']:0x0,_0x5ddc2d[_0x71aa('0x13')]?_0x5ddc2d[_0x71aa('0x13')]['id']:0x0);if(_0x135c20[_0x71aa('0x10')][_0x1e9cd7]){_0x135c20[_0x71aa('0x10')][_0x1e9cd7][_0x71aa('0x3b')](_0x71aa('0x44'));if(rpc[_0x5ddc2d[_0x71aa('0x11')]+_0x71aa('0x45')]){rpc[_0x5ddc2d['channel']+_0x71aa('0x45')][_0x71aa('0x46')](_0x1e9cd7,{'UserId':_0x5ddc2d['message'][_0x71aa('0x47')]})['catch'](function(){logger[_0x71aa('0x3f')]('error\x20update\x20queue\x20report');});}}return _0x2f3084({'code':0xc8,'message':_0x5ddc2d});}catch(_0x229211){logger['error'](_0x229211[_0x71aa('0x48')]);return _0xc632e0(_0x52cd0a['error'](0x1f4,_0x229211));}}logger[_0x71aa('0x3f')]('message\x20is\x20empty');return _0xc632e0(_0x52cd0a['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0xe8beb6){var _0x416a44=this;return new Promise(function(_0x503158,_0x49592c){if(_0xe8beb6['agent']&&_0xe8beb6[_0x71aa('0x41')]['id']){try{if(_0x135c20['agents'][_0xe8beb6[_0x71aa('0x41')]['id']]){_0x135c20[_0x71aa('0x42')][_0xe8beb6['agent']['id']][_0x71aa('0x43')]=![];_0x135c20[_0x71aa('0x42')][_0xe8beb6[_0x71aa('0x41')]['id']][_0x71aa('0x49')]=undefined;}return _0x503158({'code':0xc8,'message':_0xe8beb6});}catch(_0x5e81ec){logger[_0x71aa('0x3f')](_0x5e81ec['stack']);return _0x49592c(_0x416a44[_0x71aa('0x3f')](0x1f4,_0x5e81ec));}}logger[_0x71aa('0x3f')](_0x71aa('0x4a'));return _0x49592c(_0x416a44[_0x71aa('0x3f')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x56d7d0){var _0x1e2f38=this;return new Promise(function(_0x554d07,_0x28a648){if(_0x56d7d0[_0x71aa('0x11')]&&_0x56d7d0[_0x71aa('0x13')]&&_0x56d7d0['interaction']['id']){try{var _0x34b0a8=getId(_0x56d7d0['channel'],_0x56d7d0['message']?_0x56d7d0[_0x71aa('0x12')]['id']:0x0,_0x56d7d0[_0x71aa('0x13')]?_0x56d7d0[_0x71aa('0x13')]['id']:0x0);if(_0x135c20['rules'][_0x34b0a8]){_0x135c20[_0x71aa('0x10')][_0x34b0a8][_0x71aa('0x3b')](_0x71aa('0x44'));}return _0x554d07({'code':0xc8,'message':_0x56d7d0});}catch(_0x6d1588){logger[_0x71aa('0x3f')](_0x6d1588['stack']);return _0x28a648(_0x1e2f38[_0x71aa('0x3f')](0x1f4,_0x6d1588));}}logger[_0x71aa('0x3f')](_0x71aa('0x4a'));return _0x28a648(_0x1e2f38[_0x71aa('0x3f')](0x1f4,_0x71aa('0x4a')));});},'AgentCapacity':function(_0x50706d){var _0x177df8=this;return new Promise(function(_0x52b563,_0x4a0eec){if(_0x135c20[_0x71aa('0x42')][_0x71aa('0x4b')](_0x50706d['id'])){for(var _0x240f62 in _0x50706d[_0x71aa('0x4c')]){if(_0x50706d[_0x71aa('0x4c')][_0x71aa('0x4b')](_0x240f62)){if(_0x135c20[_0x71aa('0x42')][_0x50706d['id']][_0x71aa('0x4b')](_0x240f62+_0x71aa('0x4d'))){_0x135c20[_0x71aa('0x42')][_0x50706d['id']][_0x240f62+_0x71aa('0x4d')]=parseInt(_0x50706d[_0x71aa('0x4c')][_0x240f62],0xa);}}}_0x135c20['agents'][_0x50706d['id']][_0x71aa('0x4e')]();return _0x52b563({'code':0xc8,'message':_0x135c20[_0x71aa('0x42')][_0x50706d['id']]});}else{return _0x4a0eec(_0x177df8[_0x71aa('0x3f')](0x1f4,_0x71aa('0x4f')));}});},'Agents':function(_0xa37026){return new Promise(function(_0x4304b8){var _0x365966=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x42')]);if(_0xa37026&&_0xa37026['id']){var _0x23c6ea=_['find'](_0x365966,function(_0x173a1d){return _0x173a1d['id']===_0xa37026['id'];});_0x4304b8(_0x23c6ea);}else{_0x4304b8({'count':_0x365966[_0x71aa('0x16')],'rows':_0x365966});}});},'ChatQueues':function(){return new Promise(function(_0x516719){var _0x1fc1d8=[];for(var _0x27388f in _0x135c20[_0x71aa('0x51')]){if(_0x135c20[_0x71aa('0x51')][_0x71aa('0x4b')](_0x27388f)){var _0x2d255a=_0x135c20[_0x71aa('0x51')][_0x27388f];var _0x3a3e6f={'id':_0x2d255a['id'],'available':_0x2d255a[_0x71aa('0x52')],'loggedIn':_0x2d255a[_0x71aa('0x53')],'name':_0x2d255a[_0x71aa('0x54')],'paused':_0x2d255a[_0x71aa('0x55')],'waiting':_0x2d255a[_0x71aa('0x56')]};_0x1fc1d8[_0x71aa('0x1e')](_0x3a3e6f);}}_0x516719({'count':_0x1fc1d8[_0x71aa('0x16')],'rows':_0x1fc1d8});});},'MailQueues':function(){return new Promise(function(_0x4d142e){var _0x24b778=[];for(var _0x1a18b6 in _0x135c20[_0x71aa('0x57')]){if(_0x135c20[_0x71aa('0x57')]['hasOwnProperty'](_0x1a18b6)){var _0x5b2526=_0x135c20['mailQueues'][_0x1a18b6];var _0x37394c={'id':_0x5b2526['id'],'available':_0x5b2526[_0x71aa('0x52')],'loggedIn':_0x5b2526[_0x71aa('0x53')],'name':_0x5b2526[_0x71aa('0x54')],'paused':_0x5b2526[_0x71aa('0x55')],'waiting':_0x5b2526[_0x71aa('0x56')]};_0x24b778['push'](_0x37394c);}}_0x4d142e({'count':_0x24b778['length'],'rows':_0x24b778});});},'OpenchannelQueues':function(){return new Promise(function(_0x6b68aa){var _0x426f58=[];for(var _0x39cc26 in _0x135c20[_0x71aa('0x58')]){if(_0x135c20['openchannelQueues']['hasOwnProperty'](_0x39cc26)){var _0x37bb16=_0x135c20[_0x71aa('0x58')][_0x39cc26];var _0x63a07b={'id':_0x37bb16['id'],'available':_0x37bb16[_0x71aa('0x52')],'loggedIn':_0x37bb16['loggedIn'],'name':_0x37bb16[_0x71aa('0x54')],'paused':_0x37bb16[_0x71aa('0x55')],'waiting':_0x37bb16['waiting']};_0x426f58[_0x71aa('0x1e')](_0x63a07b);}}_0x6b68aa({'count':_0x426f58[_0x71aa('0x16')],'rows':_0x426f58});});},'SmsQueues':function(){return new Promise(function(_0x4d03f2){var _0x280519=[];for(var _0x35cd5a in _0x135c20[_0x71aa('0x59')]){if(_0x135c20[_0x71aa('0x59')]['hasOwnProperty'](_0x35cd5a)){var _0x5b4408=_0x135c20[_0x71aa('0x59')][_0x35cd5a];var _0x190911={'id':_0x5b4408['id'],'available':_0x5b4408[_0x71aa('0x52')],'loggedIn':_0x5b4408[_0x71aa('0x53')],'name':_0x5b4408[_0x71aa('0x54')],'paused':_0x5b4408[_0x71aa('0x55')],'waiting':_0x5b4408['waiting']};_0x280519[_0x71aa('0x1e')](_0x190911);}}_0x4d03f2({'count':_0x280519[_0x71aa('0x16')],'rows':_0x280519});});},'FaxQueues':function(){return new Promise(function(_0x2f7a60){var _0x186e2d=[];for(var _0x2ff2c8 in _0x135c20[_0x71aa('0x5a')]){if(_0x135c20[_0x71aa('0x5a')][_0x71aa('0x4b')](_0x2ff2c8)){var _0x5015f4=_0x135c20[_0x71aa('0x5a')][_0x2ff2c8];var _0x5ed482={'id':_0x5015f4['id'],'available':_0x5015f4[_0x71aa('0x52')],'loggedIn':_0x5015f4['loggedIn'],'name':_0x5015f4[_0x71aa('0x54')],'paused':_0x5015f4['paused'],'waiting':_0x5015f4[_0x71aa('0x56')]};_0x186e2d[_0x71aa('0x1e')](_0x5ed482);}}_0x2f7a60({'count':_0x186e2d[_0x71aa('0x16')],'rows':_0x186e2d});});},'WhatsappQueues':function(){return new Promise(function(_0xc7deac){var _0x1d3dfc=[];for(var _0x40fdea in _0x135c20['whatsappQueues']){if(_0x135c20[_0x71aa('0x5b')]['hasOwnProperty'](_0x40fdea)){var _0x234662=_0x135c20['whatsappQueues'][_0x40fdea];var _0x2c5344={'id':_0x234662['id'],'available':_0x234662[_0x71aa('0x52')],'loggedIn':_0x234662['loggedIn'],'name':_0x234662[_0x71aa('0x54')],'paused':_0x234662[_0x71aa('0x55')],'waiting':_0x234662[_0x71aa('0x56')]};_0x1d3dfc[_0x71aa('0x1e')](_0x2c5344);}}_0xc7deac({'count':_0x1d3dfc[_0x71aa('0x16')],'rows':_0x1d3dfc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xe85755){var _0x2d5528=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x5c')]);_0xe85755({'count':_0x2d5528[_0x71aa('0x16')],'rows':_0x2d5528});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x139178){var _0x2ad259=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x5d')]);_0x139178({'count':_0x2ad259['length'],'rows':_0x2ad259});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x589a00){var _0x204997=_['values'](_0x135c20[_0x71aa('0x5e')]);_0x589a00({'count':_0x204997[_0x71aa('0x16')],'rows':_0x204997});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2f6a13){var _0x5b1de1=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x5f')]);_0x2f6a13({'count':_0x5b1de1['length'],'rows':_0x5b1de1});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5d6141){var _0x8dfd51=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x60')]);_0x5d6141({'count':_0x8dfd51[_0x71aa('0x16')],'rows':_0x8dfd51});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3c67a1){var _0x195c49=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x61')]);_0x3c67a1({'count':_0x195c49[_0x71aa('0x16')],'rows':_0x195c49});});}};var _0x2d7a16=jayson[_0x71aa('0x62')](_0x357fdc)[_0x71aa('0x63')]();_0x2d7a16['on'](_0x71aa('0x3f'),function(_0x1f419d){logger[_0x71aa('0x3f')](JSON[_0x71aa('0x39')](_0x1f419d));return _0x152873(_0x1f419d);});_0x2d7a16[_0x71aa('0xf')](0x232c,_0x71aa('0x64'),function(){console['log'](_0x71aa('0x65'),0x232c);return _0x2744a4(_0x71aa('0x66')+0x232c);});});}; \ No newline at end of file +var _0x8724=['channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','app','toLowerCase','split','mail','push','slice','appdata','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','lodash','util','path','jayson/promise','bluebird','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','listen'];(function(_0x42f3a5,_0x3a4470){var _0x1a7d74=function(_0x43cc36){while(--_0x43cc36){_0x42f3a5['push'](_0x42f3a5['shift']());}};_0x1a7d74(++_0x3a4470);}(_0x8724,0x10c));var _0x4872=function(_0x281538,_0x3d9019){_0x281538=_0x281538-0x0;var _0x5b3245=_0x8724[_0x281538];return _0x5b3245;};'use strict';var _=require(_0x4872('0x0'));var util=require(_0x4872('0x1'));var path=require(_0x4872('0x2'));var fs=require('fs');var jayson=require(_0x4872('0x3'));var BPromise=require(_0x4872('0x4'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0x4872('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4872('0x6')),'chatQueueReport':require(_0x4872('0x7')),'smsQueueReport':require(_0x4872('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4872('0x9'))};var RuleEngine=require(_0x4872('0xa'));function getId(_0x3ac701,_0x335f31,_0x47285c){return util[_0x4872('0xb')]('%s.%s.%s',_0x3ac701,_0x335f31||0x0,_0x47285c||0x0);}function getIntervals(_0x2b31c4,_0x5aad7b){var _0x9516f2=[];if(!_[_0x4872('0xc')](_0x5aad7b[_0x4872('0xd')])&&!_[_0x4872('0xc')](_0x2b31c4[_0x5aad7b[_0x4872('0xd')]])&&!_[_0x4872('0xc')](_0x2b31c4[_0x5aad7b[_0x4872('0xd')]]['Intervals'])){_0x9516f2=_['map'](_0x2b31c4[_0x5aad7b['IntervalId']][_0x4872('0xe')],'interval');}else if(!_[_0x4872('0xc')](_0x5aad7b[_0x4872('0xf')])){_0x9516f2=[_0x5aad7b[_0x4872('0xf')]];}return _0x9516f2;}exports[_0x4872('0x10')]=function(_0x35a365){_0x35a365['rules']={};return new BPromise(function(_0x4956ed,_0x53d544){var _0x51e3b5={'Start':function(_0x46375a){var _0x946d63=this;return new Promise(function(_0x35bf3f,_0x52f491){if(_0x46375a){try{var _0x3627b9=[];var _0x553a85=getId(_0x46375a[_0x4872('0x11')],_0x46375a[_0x4872('0x12')]?_0x46375a['message']['id']:0x0,_0x46375a[_0x4872('0x13')]?_0x46375a[_0x4872('0x13')]['id']:0x0);var _0x307105=sUtils[_0x4872('0x14')](_0x35a365,_0x46375a);if(!_0x307105&&_0x46375a[_0x4872('0x15')]&&_['isArray'](_0x46375a[_0x4872('0x15')])&&_0x46375a[_0x4872('0x15')][_0x4872('0x16')]){for(var _0x93925c=0x0;_0x93925c<_0x46375a[_0x4872('0x15')]['length'];_0x93925c+=0x1){var _0x2c505d=_0x46375a[_0x4872('0x15')][_0x93925c];if(fs[_0x4872('0x17')](path[_0x4872('0x18')](__dirname,_0x4872('0x15'),_0x2c505d['app']+'.js'))){var _0x1d8f1f=[];switch(_0x2c505d[_0x4872('0x19')][_0x4872('0x1a')]()){case'autoreply':var _0x16a37=_0x2c505d['appdata'][_0x4872('0x1b')](',');if(_0x46375a['channel']===_0x4872('0x1c')){_0x1d8f1f[_0x4872('0x1d')](_0x16a37[0x0]);_0x1d8f1f['push'](_0x16a37[0x1]);_0x1d8f1f[_0x4872('0x1d')](_0x16a37[_0x4872('0x1e')](0x2,_0x16a37[_0x4872('0x16')])['join'](','));}else{_0x1d8f1f[_0x4872('0x1d')](_0x16a37[0x0]);_0x1d8f1f[_0x4872('0x1d')](_0x16a37[_0x4872('0x1e')](0x1,_0x16a37['length'])[_0x4872('0x18')](','));}break;case'dialogflow':var _0x35dcfa=_0x2c505d[_0x4872('0x1f')][_0x4872('0x1b')](',');_0x1d8f1f['push'](_0x35dcfa[0x0]);_0x1d8f1f[_0x4872('0x1d')](_0x35dcfa[0x1]);_0x1d8f1f[_0x4872('0x1d')](_0x35dcfa['slice'](0x2,_0x35dcfa['length'])['join'](','));break;case'dialogflowv2':var _0x23b5d8=_0x2c505d[_0x4872('0x1f')][_0x4872('0x1b')](',');_0x1d8f1f[_0x4872('0x1d')](_0x23b5d8[0x0]);_0x1d8f1f['push'](_0x23b5d8[0x1]);_0x1d8f1f[_0x4872('0x1d')](_0x23b5d8[0x2]);_0x1d8f1f[_0x4872('0x1d')](_0x23b5d8[0x3]);_0x1d8f1f['push'](_0x23b5d8[_0x4872('0x1e')](0x4,_0x23b5d8[_0x4872('0x16')])[_0x4872('0x18')](','));break;case'amazonlex':var _0x10a7f8=_0x2c505d['appdata'][_0x4872('0x1b')](',');_0x1d8f1f[_0x4872('0x1d')](_0x10a7f8[0x0]);_0x1d8f1f[_0x4872('0x1d')](_0x10a7f8[0x1]);_0x1d8f1f[_0x4872('0x1d')](_0x10a7f8[0x2]);_0x1d8f1f[_0x4872('0x1d')](_0x10a7f8[0x3]);_0x1d8f1f['push'](_0x10a7f8[_0x4872('0x1e')](0x4,_0x10a7f8[_0x4872('0x16')])[_0x4872('0x18')](','));break;case _0x4872('0x12'):_0x1d8f1f['push'](_0x2c505d[_0x4872('0x1f')]);break;case'tag':_0x1d8f1f[_0x4872('0x1d')](_0x2c505d[_0x4872('0x20')]);_0x1d8f1f[_0x4872('0x1d')](_0x2c505d[_0x4872('0x1f')]);break;case _0x4872('0x21'):var _0x1394d2=utils[_0x4872('0x22')](_0x46375a[_0x4872('0x23')]['notificationTemplate'],_0x46375a);var _0x446dd1=_0x2c505d[_0x4872('0x1f')]['split'](',');_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x0]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x1]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x2]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x3]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x4]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x5]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x6]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x7]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x8]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0x9]);_0x1d8f1f[_0x4872('0x1d')](_0x446dd1[0xa]);_0x1d8f1f[_0x4872('0x1d')](_0x46375a[_0x4872('0x13')]['id']);_0x1d8f1f[_0x4872('0x1d')](_0x46375a[_0x4872('0x12')]['id']);_0x1d8f1f[_0x4872('0x1d')](_0x2c505d[_0x4872('0x24')]);_0x1d8f1f['push'](_0x46375a[_0x4872('0x13')][_0x4872('0x25')]);_0x1d8f1f[_0x4872('0x1d')](_0x46375a[_0x4872('0x26')][_0x4872('0x26')]);_0x1d8f1f['push'](_0x1394d2);break;default:_0x1d8f1f=_[_0x4872('0xc')](_0x2c505d[_0x4872('0x1f')])?[]:_0x2c505d[_0x4872('0x1f')][_0x4872('0x1b')](',');}var _0x365f11={'id':util['format'](_0x4872('0x27'),_0x553a85,_0x2c505d['id'],_0x2c505d[_0x4872('0x19')]),'condition':require(_0x4872('0x28'))[_0x4872('0x29')](_0x553a85,getIntervals(_0x35a365[_0x4872('0x2a')],_0x2c505d),_0x35a365),'consequence':require('./applications/'+_0x2c505d[_0x4872('0x19')])[_0x4872('0x2b')](_0x553a85,_0x1d8f1f,_0x35a365,_0x46375a),'p':_0x2c505d[_0x4872('0x2c')]||0x0};logger[_0x4872('0x2d')](_0x4872('0x2e'),_0x365f11['id'],_0x4872('0x2f'),getIntervals(_0x35a365[_0x4872('0x2a')],_0x2c505d)[_0x4872('0x18')]('\x20|\x20'));_0x3627b9[_0x4872('0x1d')](_0x365f11);}else{logger[_0x4872('0x30')](_0x4872('0x31'),path[_0x4872('0x18')](__dirname,'applications',_0x2c505d['app']+_0x4872('0x32')));}}_0x35a365['rules'][_0x553a85]=new RuleEngine(_0x3627b9);_0x35a365[_0x4872('0x33')][_0x553a85][_0x4872('0x34')](_0x46375a,function(_0x4986ea){logger['info'](_0x4872('0x35'),JSON[_0x4872('0x36')](_0x4986ea[_0x4872('0x37')]));if(_0x35a365[_0x4872('0x33')][_0x553a85]){_0x35a365['rules'][_0x553a85][_0x4872('0x38')](_0x4872('0x39'));}});return _0x35bf3f({'code':0xc8,'message':_0x46375a});}else{if(_0x307105){logger[_0x4872('0x2d')](util['format'](_0x4872('0x3a'),_0x553a85));}else{logger[_0x4872('0x2d')]('No\x20applications\x20to\x20execute');}return _0x35bf3f({'code':0xc8,'message':_0x46375a});}}catch(_0x25facd){logger['error'](_0x25facd[_0x4872('0x3b')]);return _0x52f491(_0x946d63[_0x4872('0x30')](0x1f4,_0x25facd));}}return _0x52f491(_0x4872('0x3c'));});},'AcceptMessage':function(_0x4a31bc){var _0x4bd2fe=this;return new Promise(function(_0x103e29,_0xdfde59){if(_0x4a31bc['agent']&&_0x4a31bc[_0x4872('0x3d')]['id']){if(_0x35a365['agents'][_0x4a31bc[_0x4872('0x3d')]['id']]){_0x35a365[_0x4872('0x3e')][_0x4a31bc[_0x4872('0x3d')]['id']][_0x4872('0x3f')]=![];_0x35a365[_0x4872('0x3e')][_0x4a31bc['agent']['id']][_0x4872('0x40')]=undefined;}}if(_0x4a31bc[_0x4872('0x12')]&&_0x4a31bc[_0x4872('0x12')]['id']){try{var _0x1fafe0=getId(_0x4a31bc[_0x4872('0x11')],_0x4a31bc[_0x4872('0x12')]?_0x4a31bc[_0x4872('0x12')]['id']:0x0,_0x4a31bc[_0x4872('0x13')]?_0x4a31bc[_0x4872('0x13')]['id']:0x0);if(_0x35a365['rules'][_0x1fafe0]){_0x35a365[_0x4872('0x33')][_0x1fafe0][_0x4872('0x38')](_0x4872('0x41'));if(rpc[_0x4a31bc[_0x4872('0x11')]+_0x4872('0x42')]){rpc[_0x4a31bc[_0x4872('0x11')]+_0x4872('0x42')]['update'](_0x1fafe0,{'UserId':_0x4a31bc['message'][_0x4872('0x43')]})[_0x4872('0x44')](function(){logger[_0x4872('0x30')](_0x4872('0x45'));});}}return _0x103e29({'code':0xc8,'message':_0x4a31bc});}catch(_0x494c50){logger['error'](_0x494c50[_0x4872('0x3b')]);return _0xdfde59(_0x4bd2fe[_0x4872('0x30')](0x1f4,_0x494c50));}}logger[_0x4872('0x30')](_0x4872('0x46'));return _0xdfde59(_0x4bd2fe[_0x4872('0x30')](0x1f4,_0x4872('0x46')));});},'RejectMessage':function(_0x2a512b){var _0x529097=this;return new Promise(function(_0x432ee4,_0x29a653){if(_0x2a512b[_0x4872('0x3d')]&&_0x2a512b[_0x4872('0x3d')]['id']){try{if(_0x35a365[_0x4872('0x3e')][_0x2a512b[_0x4872('0x3d')]['id']]){_0x35a365[_0x4872('0x3e')][_0x2a512b[_0x4872('0x3d')]['id']]['busy']=![];_0x35a365[_0x4872('0x3e')][_0x2a512b['agent']['id']]['busyQueue']=undefined;}return _0x432ee4({'code':0xc8,'message':_0x2a512b});}catch(_0x33bbe8){logger['error'](_0x33bbe8['stack']);return _0x29a653(_0x529097['error'](0x1f4,_0x33bbe8));}}logger['error'](_0x4872('0x46'));return _0x29a653(_0x529097['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x131737){var _0x2ba35e=this;return new Promise(function(_0x10b7a1,_0x16c6dc){if(_0x131737[_0x4872('0x11')]&&_0x131737[_0x4872('0x13')]&&_0x131737[_0x4872('0x13')]['id']){try{var _0x73f4f8=getId(_0x131737[_0x4872('0x11')],_0x131737[_0x4872('0x12')]?_0x131737['message']['id']:0x0,_0x131737[_0x4872('0x13')]?_0x131737[_0x4872('0x13')]['id']:0x0);if(_0x35a365[_0x4872('0x33')][_0x73f4f8]){_0x35a365[_0x4872('0x33')][_0x73f4f8][_0x4872('0x38')]('end');}return _0x10b7a1({'code':0xc8,'message':_0x131737});}catch(_0x375d1b){logger[_0x4872('0x30')](_0x375d1b[_0x4872('0x3b')]);return _0x16c6dc(_0x2ba35e['error'](0x1f4,_0x375d1b));}}logger[_0x4872('0x30')](_0x4872('0x46'));return _0x16c6dc(_0x2ba35e[_0x4872('0x30')](0x1f4,_0x4872('0x46')));});},'AgentCapacity':function(_0xf65d08){var _0x15dbde=this;return new Promise(function(_0x33425f,_0x55e95d){if(_0x35a365[_0x4872('0x3e')]['hasOwnProperty'](_0xf65d08['id'])){for(var _0x18ff30 in _0xf65d08['capacity']){if(_0xf65d08[_0x4872('0x47')][_0x4872('0x48')](_0x18ff30)){if(_0x35a365['agents'][_0xf65d08['id']][_0x4872('0x48')](_0x18ff30+_0x4872('0x49'))){_0x35a365[_0x4872('0x3e')][_0xf65d08['id']][_0x18ff30+_0x4872('0x49')]=parseInt(_0xf65d08['capacity'][_0x18ff30],0xa);}}}_0x35a365[_0x4872('0x3e')][_0xf65d08['id']][_0x4872('0x4a')]();return _0x33425f({'code':0xc8,'message':_0x35a365['agents'][_0xf65d08['id']]});}else{return _0x55e95d(_0x15dbde[_0x4872('0x30')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x47fdbd){return new Promise(function(_0x42e9ea){var _0x3c9cab=_['values'](_0x35a365['agents']);if(_0x47fdbd&&_0x47fdbd['id']){var _0x1b6773=_[_0x4872('0x4b')](_0x3c9cab,function(_0x3ad01e){return _0x3ad01e['id']===_0x47fdbd['id'];});_0x42e9ea(_0x1b6773);}else{_0x42e9ea({'count':_0x3c9cab[_0x4872('0x16')],'rows':_0x3c9cab});}});},'ChatQueues':function(){return new Promise(function(_0x41a89a){var _0x70c823=[];for(var _0x14b466 in _0x35a365[_0x4872('0x4c')]){if(_0x35a365[_0x4872('0x4c')][_0x4872('0x48')](_0x14b466)){var _0x4951cc=_0x35a365[_0x4872('0x4c')][_0x14b466];var _0x45daba={'id':_0x4951cc['id'],'available':_0x4951cc[_0x4872('0x4d')],'loggedIn':_0x4951cc[_0x4872('0x4e')],'name':_0x4951cc[_0x4872('0x4f')],'paused':_0x4951cc[_0x4872('0x50')],'waiting':_0x4951cc[_0x4872('0x51')]};_0x70c823[_0x4872('0x1d')](_0x45daba);}}_0x41a89a({'count':_0x70c823[_0x4872('0x16')],'rows':_0x70c823});});},'MailQueues':function(){return new Promise(function(_0x2368d2){var _0x4e89f1=[];for(var _0x4aec00 in _0x35a365[_0x4872('0x52')]){if(_0x35a365['mailQueues'][_0x4872('0x48')](_0x4aec00)){var _0x22f3c1=_0x35a365[_0x4872('0x52')][_0x4aec00];var _0x13cece={'id':_0x22f3c1['id'],'available':_0x22f3c1['available'],'loggedIn':_0x22f3c1[_0x4872('0x4e')],'name':_0x22f3c1[_0x4872('0x4f')],'paused':_0x22f3c1['paused'],'waiting':_0x22f3c1[_0x4872('0x51')]};_0x4e89f1[_0x4872('0x1d')](_0x13cece);}}_0x2368d2({'count':_0x4e89f1[_0x4872('0x16')],'rows':_0x4e89f1});});},'OpenchannelQueues':function(){return new Promise(function(_0x57d45b){var _0x2ef23a=[];for(var _0x403bfb in _0x35a365[_0x4872('0x53')]){if(_0x35a365[_0x4872('0x53')]['hasOwnProperty'](_0x403bfb)){var _0x3cff6a=_0x35a365[_0x4872('0x53')][_0x403bfb];var _0x36009f={'id':_0x3cff6a['id'],'available':_0x3cff6a[_0x4872('0x4d')],'loggedIn':_0x3cff6a[_0x4872('0x4e')],'name':_0x3cff6a[_0x4872('0x4f')],'paused':_0x3cff6a[_0x4872('0x50')],'waiting':_0x3cff6a[_0x4872('0x51')]};_0x2ef23a[_0x4872('0x1d')](_0x36009f);}}_0x57d45b({'count':_0x2ef23a[_0x4872('0x16')],'rows':_0x2ef23a});});},'SmsQueues':function(){return new Promise(function(_0x2adb09){var _0x5d6c43=[];for(var _0x141392 in _0x35a365[_0x4872('0x54')]){if(_0x35a365['smsQueues'][_0x4872('0x48')](_0x141392)){var _0x52844f=_0x35a365[_0x4872('0x54')][_0x141392];var _0x31ce75={'id':_0x52844f['id'],'available':_0x52844f['available'],'loggedIn':_0x52844f[_0x4872('0x4e')],'name':_0x52844f['name'],'paused':_0x52844f['paused'],'waiting':_0x52844f[_0x4872('0x51')]};_0x5d6c43[_0x4872('0x1d')](_0x31ce75);}}_0x2adb09({'count':_0x5d6c43[_0x4872('0x16')],'rows':_0x5d6c43});});},'FaxQueues':function(){return new Promise(function(_0x1947cc){var _0x3f8109=[];for(var _0xd9a80e in _0x35a365[_0x4872('0x55')]){if(_0x35a365[_0x4872('0x55')][_0x4872('0x48')](_0xd9a80e)){var _0x336920=_0x35a365[_0x4872('0x55')][_0xd9a80e];var _0x3949e4={'id':_0x336920['id'],'available':_0x336920[_0x4872('0x4d')],'loggedIn':_0x336920[_0x4872('0x4e')],'name':_0x336920[_0x4872('0x4f')],'paused':_0x336920['paused'],'waiting':_0x336920[_0x4872('0x51')]};_0x3f8109[_0x4872('0x1d')](_0x3949e4);}}_0x1947cc({'count':_0x3f8109[_0x4872('0x16')],'rows':_0x3f8109});});},'WhatsappQueues':function(){return new Promise(function(_0xd73217){var _0x36178f=[];for(var _0x4f87eb in _0x35a365[_0x4872('0x56')]){if(_0x35a365[_0x4872('0x56')]['hasOwnProperty'](_0x4f87eb)){var _0x341bf8=_0x35a365[_0x4872('0x56')][_0x4f87eb];var _0x29e29b={'id':_0x341bf8['id'],'available':_0x341bf8[_0x4872('0x4d')],'loggedIn':_0x341bf8[_0x4872('0x4e')],'name':_0x341bf8[_0x4872('0x4f')],'paused':_0x341bf8[_0x4872('0x50')],'waiting':_0x341bf8[_0x4872('0x51')]};_0x36178f[_0x4872('0x1d')](_0x29e29b);}}_0xd73217({'count':_0x36178f[_0x4872('0x16')],'rows':_0x36178f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xe72268){var _0x2f2cf1=_['values'](_0x35a365[_0x4872('0x57')]);_0xe72268({'count':_0x2f2cf1[_0x4872('0x16')],'rows':_0x2f2cf1});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x482a79){var _0x3d22d9=_[_0x4872('0x58')](_0x35a365[_0x4872('0x59')]);_0x482a79({'count':_0x3d22d9[_0x4872('0x16')],'rows':_0x3d22d9});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x54b0bf){var _0x3047e3=_['values'](_0x35a365[_0x4872('0x5a')]);_0x54b0bf({'count':_0x3047e3['length'],'rows':_0x3047e3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x384b05){var _0x365064=_[_0x4872('0x58')](_0x35a365[_0x4872('0x5b')]);_0x384b05({'count':_0x365064[_0x4872('0x16')],'rows':_0x365064});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x18f410){var _0x26ba00=_[_0x4872('0x58')](_0x35a365[_0x4872('0x5c')]);_0x18f410({'count':_0x26ba00['length'],'rows':_0x26ba00});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2ae2a0){var _0x3ca2ec=_[_0x4872('0x58')](_0x35a365[_0x4872('0x5d')]);_0x2ae2a0({'count':_0x3ca2ec['length'],'rows':_0x3ca2ec});});}};var _0x229efb=jayson[_0x4872('0x5e')](_0x51e3b5)['http']();_0x229efb['on'](_0x4872('0x30'),function(_0x32b6a4){logger[_0x4872('0x30')](JSON[_0x4872('0x36')](_0x32b6a4));return _0x53d544(_0x32b6a4);});_0x229efb['listen'](0x232c,'127.0.0.1',function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4956ed('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 658b96a..50c01cc 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 _0x9a9f=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','catch','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','condition'];(function(_0x20fc27,_0x4dfaeb){var _0x5415ea=function(_0x3575b3){while(--_0x3575b3){_0x20fc27['push'](_0x20fc27['shift']());}};_0x5415ea(++_0x4dfaeb);}(_0x9a9f,0x101));var _0xf9a9=function(_0x2032b2,_0x23af78){_0x2032b2=_0x2032b2-0x0;var _0x24b2ea=_0x9a9f[_0x2032b2];return _0x24b2ea;};'use strict';var util=require(_0xf9a9('0x0'));var BPromise=require(_0xf9a9('0x1'));var jayson=require(_0xf9a9('0x2'));var _=require(_0xf9a9('0x3'));var logger=require(_0xf9a9('0x4'))(_0xf9a9('0x5'));var client=jayson['client'][_0xf9a9('0x6')]({'port':0x232a});function request(_0x3d9532,_0x39ee84){return new BPromise(function(_0x5d93ea,_0x50fcab){return client[_0xf9a9('0x7')](_0x3d9532,_0x39ee84)[_0xf9a9('0x8')](function(_0x19390a){if(_0x19390a[_0xf9a9('0x9')]){return _0x50fcab(_0x19390a[_0xf9a9('0x9')][_0xf9a9('0xa')]);}else{return _0x5d93ea(_0x19390a[_0xf9a9('0xb')]);}})['catch'](function(_0x8fcc7a){return _0x50fcab(_0x8fcc7a);});});}exports[_0xf9a9('0xc')]=function(_0x2708c8,_0x45092a,_0x37982e){return function(_0x577ab8){if(_0x37982e[_0xf9a9('0xd')]&&!_0x37982e[_0xf9a9('0xd')][_0x2708c8]){logger[_0xf9a9('0xe')](_0xf9a9('0xf'),_0x2708c8);return _0x577ab8[_0xf9a9('0x10')]();}var _0x24609a=[];for(var _0x143d27=0x0;_0x143d27<_0x45092a[_0xf9a9('0x11')];_0x143d27+=0x1){_0x24609a[_0xf9a9('0x12')](request(_0xf9a9('0x13'),{'command':util[_0xf9a9('0x14')](_0xf9a9('0x15'),_0x45092a[_0x143d27])})[_0xf9a9('0x8')](function(_0x542f28){return _0x542f28&&_0x542f28[_0xf9a9('0xa')]&&_0x542f28['message'][_0xf9a9('0x16')](_0xf9a9('0x17'))>=0x0?!![]:![];})['catch'](function(_0x321190){logger[_0xf9a9('0x9')]('[%s][INTERVAL]\x20%s',_0x2708c8,_0x45092a[_0x143d27]);}));}BPromise['all'](_0x24609a)[_0xf9a9('0x8')](function(_0x5d58fe){var _0xcd206e=_['some'](_0x5d58fe);logger['info'](_0xf9a9('0x18'),_0x2708c8,_0x45092a[_0xf9a9('0x19')](_0xf9a9('0x1a')),_0xcd206e);_0x577ab8['when'](_0xcd206e);})[_0xf9a9('0x1b')](function(_0xe14de){console[_0xf9a9('0x1c')](_0xe14de);logger['error'](_0xf9a9('0x18'),_0x2708c8,_0x45092a[_0xf9a9('0x19')]('\x20|\x20'),_0xe14de[_0xf9a9('0x1d')]);_0x577ab8['stop']();});};}; \ No newline at end of file +var _0xa2b0=['indexOf','[%s][INTERVAL]\x20%s','some','when','log','join','\x20|\x20','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','then','error','message','catch','condition','rules','info','stop','length','push','format'];(function(_0x5edb0e,_0x30e1fa){var _0x551e43=function(_0x241ce0){while(--_0x241ce0){_0x5edb0e['push'](_0x5edb0e['shift']());}};_0x551e43(++_0x30e1fa);}(_0xa2b0,0x1ca));var _0x0a2b=function(_0x212a97,_0x9d75db){_0x212a97=_0x212a97-0x0;var _0x1290ae=_0xa2b0[_0x212a97];return _0x1290ae;};'use strict';var util=require(_0x0a2b('0x0'));var BPromise=require('bluebird');var jayson=require(_0x0a2b('0x1'));var _=require(_0x0a2b('0x2'));var logger=require(_0x0a2b('0x3'))(_0x0a2b('0x4'));var client=jayson[_0x0a2b('0x5')]['http']({'port':0x232a});function request(_0xdaf243,_0x23e3f1){return new BPromise(function(_0x832df,_0x4b3888){return client['request'](_0xdaf243,_0x23e3f1)[_0x0a2b('0x6')](function(_0x148e27){if(_0x148e27[_0x0a2b('0x7')]){return _0x4b3888(_0x148e27[_0x0a2b('0x7')][_0x0a2b('0x8')]);}else{return _0x832df(_0x148e27['result']);}})[_0x0a2b('0x9')](function(_0x484b65){return _0x4b3888(_0x484b65);});});}exports[_0x0a2b('0xa')]=function(_0x53b35b,_0x3f7d1a,_0x34ad50){return function(_0x55f1d6){if(_0x34ad50['rules']&&!_0x34ad50[_0x0a2b('0xb')][_0x53b35b]){logger[_0x0a2b('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x53b35b);return _0x55f1d6[_0x0a2b('0xd')]();}var _0x3e81c6=[];for(var _0x1e7abd=0x0;_0x1e7abd<_0x3f7d1a[_0x0a2b('0xe')];_0x1e7abd+=0x1){_0x3e81c6[_0x0a2b('0xf')](request('Command',{'command':util[_0x0a2b('0x10')]('iftime\x20%s',_0x3f7d1a[_0x1e7abd])})['then'](function(_0x44ffef){return _0x44ffef&&_0x44ffef[_0x0a2b('0x8')]&&_0x44ffef[_0x0a2b('0x8')][_0x0a2b('0x11')]('true')>=0x0?!![]:![];})[_0x0a2b('0x9')](function(_0x52814f){logger['error'](_0x0a2b('0x12'),_0x53b35b,_0x3f7d1a[_0x1e7abd]);}));}BPromise['all'](_0x3e81c6)[_0x0a2b('0x6')](function(_0x18677f){var _0x32bc14=_[_0x0a2b('0x13')](_0x18677f);logger[_0x0a2b('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x53b35b,_0x3f7d1a['join']('\x20|\x20'),_0x32bc14);_0x55f1d6[_0x0a2b('0x14')](_0x32bc14);})[_0x0a2b('0x9')](function(_0x570646){console[_0x0a2b('0x15')](_0x570646);logger[_0x0a2b('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x53b35b,_0x3f7d1a[_0x0a2b('0x16')](_0x0a2b('0x17')),_0x570646[_0x0a2b('0x18')]);_0x55f1d6[_0x0a2b('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 31884f0..29d86a4 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 _0xa74f=['calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answered_elsewhere','[%s][agents][agentconnect]','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause','rejected','indexOf','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue'];(function(_0x31fa2f,_0x1cb4df){var _0x288b37=function(_0x185033){while(--_0x185033){_0x31fa2f['push'](_0x31fa2f['shift']());}};_0x288b37(++_0x1cb4df);}(_0xa74f,0x9a));var _0xfa74=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xa74f[_0xcfc44];return _0x307a25;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfa74('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4c4c00,_0x4b5765){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3'),_0x4c4c00[_0xfa74('0x4')],_0x4c4c00['channel'],_0x4c4c00[_0xfa74('0x5')],_0x4c4c00['membername'],_0x4c4c00['interface'],_0x4c4c00[_0xfa74('0x6')],_0x4c4c00[_0xfa74('0x7')],_0x4c4c00[_0xfa74('0x8')]));if(_0x4c4c00[_0xfa74('0x5')]){utils[_0xfa74('0x9')](_0x4c4c00[_0xfa74('0x5')])['then'](function(_0x32f55c){if(_0x32f55c){_0x4c4c00[_0xfa74('0xa')]=_0x32f55c[_0xfa74('0xa')];_0x4c4c00[_0xfa74('0xb')]=_0x4c4c00['agentcomplete']?_0x32f55c[_0xfa74('0xc')]:![];_0x4c4c00[_0xfa74('0xd')]=_0x4c4c00['agentacw']?_0x32f55c[_0xfa74('0xe')]:0x0;}utils[_0xfa74('0xf')](_0xfa74('0x10'),_0x4c4c00);});}else{utils[_0xfa74('0xf')]('CreateVoiceAgentReport',_0x4c4c00);}if(_0x4b5765){delete transfers[_0x4c4c00[_0xfa74('0x4')]];}else{delete agents[_0x4c4c00[_0xfa74('0x11')]];}}exports[_0xfa74('0x12')]=function(_0x278e8b){try{utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b[_0xfa74('0x4')]),_0x278e8b);agents[_0x278e8b[_0xfa74('0x11')]]=_0x278e8b;agents[_0x278e8b[_0xfa74('0x11')]]['agentcalledAt']=utils[_0xfa74('0x14')]();agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x8')]=_0xfa74('0x15');agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x7')]=null;agents[_0x278e8b[_0xfa74('0x11')]]['connectedlinename']=null;utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x278e8b['uniqueid'],agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x16')],_0x278e8b[_0xfa74('0x11')]));}catch(_0x5a863f){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b['uniqueid']),_0x5a863f);}};exports[_0xfa74('0x18')]=function(_0x302eb4){try{if(!_[_0xfa74('0x19')](agents[_0x302eb4['destuniqueid']])){utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x1a'),_0x302eb4[_0xfa74('0x4')]),_0x302eb4);utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x302eb4['uniqueid'],agents[_0x302eb4[_0xfa74('0x11')]]['membername'],_0x302eb4['destuniqueid']));agents[_0x302eb4['destuniqueid']][_0xfa74('0x18')]=!![];agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1b')]=utils['now']();agents[_0x302eb4['destuniqueid']][_0xfa74('0x8')]=_0xfa74('0x1c');agents[_0x302eb4['destuniqueid']][_0xfa74('0x1d')]='timeout';agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1e')]=_0x302eb4['ringtime']?parseInt(_0x302eb4[_0xfa74('0x1f')])/0x3e8:0x0;agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x20')]=0x0;unanswered[_0xfa74('0x21')](_0x302eb4['destuniqueid']);}}catch(_0xd9c55d){utils[_0xfa74('0x17')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]',_0x302eb4['uniqueid']),_0xd9c55d);}};exports[_0xfa74('0x22')]=function(_0x8b706e){try{_['forIn'](agents,function(_0x4b38fc,_0x343466){if(_0x4b38fc['uniqueid']==_0x8b706e[_0xfa74('0x4')]&&!_['includes'](unanswered,_0x4b38fc[_0xfa74('0x11')])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x8b706e);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x25'),_0x8b706e[_0xfa74('0x4')],_0x4b38fc[_0xfa74('0x16')],_0x4b38fc[_0xfa74('0x11')]));_0x4b38fc[_0xfa74('0x18')]=!![];_0x4b38fc['agentringnoanswerAt']=utils[_0xfa74('0x14')]();_0x4b38fc['lastevent']=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1d')]=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1e')]=_0x8b706e['holdtime'];_0x4b38fc['talktime']=0x0;writeDB(_0x4b38fc);}});}catch(_0x390ed4){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x390ed4);}};exports[_0xfa74('0x27')]=function(_0x231698){try{if(agents[_0x231698['destuniqueid']]){utils['debug'](util['format']('[%s][agents][agentconnect]',_0x231698['uniqueid']),_0x231698);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x28'),_0x231698[_0xfa74('0x4')],agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x16')],_0x231698[_0xfa74('0x11')]));agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x29')]=utils['now']();agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x7')]=_0x231698[_0xfa74('0x7')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x2a')]=_0x231698[_0xfa74('0x2a')];agents[_0x231698['destuniqueid']][_0xfa74('0x1e')]=_0x231698[_0xfa74('0x1f')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x8')]='connect';_[_0xfa74('0x2b')](agents,function(_0x13d9a5,_0xe8491b){if(_0x13d9a5[_0xfa74('0x11')]!=_0x231698['destuniqueid']&&_0x13d9a5[_0xfa74('0x4')]==_0x231698[_0xfa74('0x4')]){_0x13d9a5[_0xfa74('0x20')]=0x0;_0x13d9a5['holdtime']=_0x231698['ringtime'];_0x13d9a5[_0xfa74('0x18')]=!![];_0x13d9a5[_0xfa74('0x1b')]=utils[_0xfa74('0x14')]();_0x13d9a5[_0xfa74('0x8')]='answered_elsewhere';_0x13d9a5[_0xfa74('0x1d')]=_0xfa74('0x2c');_0x13d9a5['answeredelsewheredestinationuniqueid']=_0x231698['destuniqueid'];_0x13d9a5['answeredelsewheremembername']=_0x231698['membername'];writeDB(_0x13d9a5);}});}}catch(_0x95c891){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2d'),_0x231698[_0xfa74('0x4')]),_0x95c891);}};exports[_0xfa74('0x2e')]=function(_0x7735c5){try{if(!_['isNil'](agents[_0x7735c5[_0xfa74('0x11')]])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5[_0xfa74('0x4')]),_0x7735c5);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x30'),_0x7735c5[_0xfa74('0x4')],agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x16')],_0x7735c5[_0xfa74('0x11')]));agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x2e')]=!![];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')]=utils['now']();agents[_0x7735c5[_0xfa74('0x11')]]['talktime']=utils[_0xfa74('0x32')](agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')],agents[_0x7735c5[_0xfa74('0x11')]]['agentconnectAt']);agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x1d')]=_0x7735c5['reason'];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x8')]='complete';writeDB(agents[_0x7735c5[_0xfa74('0x11')]]);}}catch(_0x134d95){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5['uniqueid']),_0x134d95);}};exports['blindtransfer']=function(_0x36f6ca){try{if(!_[_0xfa74('0x19')](agents[_0x36f6ca['transfereruniqueid']])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca['uniqueid']),_0x36f6ca);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x34'),_0x36f6ca[_0xfa74('0x4')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x16')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')]));agents[_0x36f6ca[_0xfa74('0x35')]]['transfer']=!![];agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x36')]=_0xfa74('0x37');agents[_0x36f6ca[_0xfa74('0x35')]]['transferexten']=_0x36f6ca['extension'];agents[_0x36f6ca[_0xfa74('0x35')]]['transferuniqueid']=agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')];}}catch(_0x427469){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca[_0xfa74('0x4')]),_0x427469);}};exports['attendedtransfer']=function(_0x118cfc){try{utils['debug'](util[_0xfa74('0x2')]('[%s][agents][attendedtransfer]',_0x118cfc['origtransfereruniqueid']),_0x118cfc);if(_0x118cfc[_0xfa74('0x38')]==_0x118cfc[_0xfa74('0x39')]){if(!_['isNil'](agents[_0x118cfc['secondtransfereruniqueid']])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x36')]='ATTENDED';agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3d')]=_0x118cfc['origtransfererexten'];agents[_0x118cfc['secondtransfereruniqueid']][_0xfa74('0x3e')]=_0x118cfc[_0xfa74('0x38')];}if(_0x118cfc[_0xfa74('0x3f')]&&agents[_0x118cfc[_0xfa74('0x3f')]]){agents[_0x118cfc[_0xfa74('0x3f')]]['agententerreason']=0x1;transfers[_0x118cfc[_0xfa74('0x3f')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x3f')]]);transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x6')]=agents[_0x118cfc['secondtransfereruniqueid']]['calleridnum'];transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x40')];transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x29')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x1e')]=0x0;transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x42')]=0x2;}}else if(_0x118cfc['secondtransfereruniqueid']==_0x118cfc[_0xfa74('0x43')]){if(!_[_0xfa74('0x19')](agents[_0x118cfc[_0xfa74('0x38')]])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x36')]=_0xfa74('0x44');agents[_0x118cfc[_0xfa74('0x38')]]['transferexten']=_0x118cfc[_0xfa74('0x45')];agents[_0x118cfc[_0xfa74('0x38')]]['transferuniqueid']=_0x118cfc['secondtransfereruniqueid'];}if(_0x118cfc[_0xfa74('0x46')]&&agents[_0x118cfc['transfertargetuniqueid']]){agents[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x1;transfers[_0x118cfc[_0xfa74('0x46')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x46')]]);transfers[_0x118cfc['transfertargetuniqueid']]['calleridnum']=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x6')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x40')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x29')]=utils['now']();transfers[_0x118cfc[_0xfa74('0x46')]]['holdtime']=0x0;transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x2;}}}catch(_0x15b586){utils['error'](util[_0xfa74('0x2')](_0xfa74('0x47'),_0x118cfc[_0xfa74('0x38')]),_0x15b586);}};exports['hangup']=function(_0x1b8c06){try{utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x1b8c06);if(agents[_0x1b8c06['uniqueid']]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]===_0xfa74('0x1c')){if(_0x1b8c06[_0xfa74('0x49')]==='21'){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]=_0xfa74('0x4a');agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4a');}utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);var _0x491529=unanswered[_0xfa74('0x4b')](_0x1b8c06[_0xfa74('0x4')]);if(_0x491529>-0x1){unanswered[_0xfa74('0x4c')](_0x491529,0x1);}}if(transfers[_0x1b8c06[_0xfa74('0x4')]]){transfers[_0x1b8c06['uniqueid']][_0xfa74('0x2e')]=!![];transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();transfers[_0x1b8c06['uniqueid']][_0xfa74('0x20')]=utils['diffTime'](transfers[_0x1b8c06['uniqueid']][_0xfa74('0x31')],transfers[_0x1b8c06['uniqueid']][_0xfa74('0x29')]);transfers[_0x1b8c06[_0xfa74('0x4')]]['reason']='agent';transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06['uniqueid'],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],transfers[_0x1b8c06[_0xfa74('0x4')]]['lastevent']));writeDB(transfers[_0x1b8c06[_0xfa74('0x4')]],!![]);}if(agents[_0x1b8c06[_0xfa74('0x4')]]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x2e')]=!![];agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();agents[_0x1b8c06['uniqueid']]['talktime']=utils['diffTime'](agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]);agents[_0x1b8c06[_0xfa74('0x4')]]['reason']=agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x3c')]?'transfer':_0xfa74('0x4e');agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x4f'),_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06['uniqueid']]['reason'],agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);}}catch(_0x4d46e1){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x4d46e1);}}; \ No newline at end of file +var _0x96cc=['rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','debug','destuniqueid','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','agentringnoanswerAt','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause'];(function(_0x2d317d,_0x4fdb9a){var _0x1f691a=function(_0x5de02c){while(--_0x5de02c){_0x2d317d['push'](_0x2d317d['shift']());}};_0x1f691a(++_0x4fdb9a);}(_0x96cc,0x16c));var _0xc96c=function(_0x1d4fb5,_0x205c2f){_0x1d4fb5=_0x1d4fb5-0x0;var _0x566c83=_0x96cc[_0x1d4fb5];return _0x566c83;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var utils=require(_0xc96c('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f11f2,_0x30bf8a){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x4'),_0x5f11f2[_0xc96c('0x5')],_0x5f11f2[_0xc96c('0x6')],_0x5f11f2[_0xc96c('0x7')],_0x5f11f2[_0xc96c('0x8')],_0x5f11f2[_0xc96c('0x9')],_0x5f11f2['calleridnum'],_0x5f11f2[_0xc96c('0xa')],_0x5f11f2[_0xc96c('0xb')]));if(_0x5f11f2[_0xc96c('0x7')]){utils[_0xc96c('0xc')](_0x5f11f2[_0xc96c('0x7')])[_0xc96c('0xd')](function(_0x36b2b4){if(_0x36b2b4){_0x5f11f2['type']=_0x36b2b4[_0xc96c('0xe')];_0x5f11f2[_0xc96c('0xf')]=_0x5f11f2[_0xc96c('0x10')]?_0x36b2b4['acw']:![];_0x5f11f2[_0xc96c('0x11')]=_0x5f11f2['agentacw']?_0x36b2b4[_0xc96c('0x12')]:0x0;}utils['request'](_0xc96c('0x13'),_0x5f11f2);});}else{utils[_0xc96c('0x14')](_0xc96c('0x13'),_0x5f11f2);}if(_0x30bf8a){delete transfers[_0x5f11f2[_0xc96c('0x5')]];}else{delete agents[_0x5f11f2['destuniqueid']];}}exports[_0xc96c('0x15')]=function(_0x43fcaa){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')]('[%s][agents][agentcalled]',_0x43fcaa[_0xc96c('0x5')]),_0x43fcaa);agents[_0x43fcaa[_0xc96c('0x17')]]=_0x43fcaa;agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0x18')]=utils[_0xc96c('0x19')]();agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x1a');agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xa')]=null;agents[_0x43fcaa[_0xc96c('0x17')]]['connectedlinename']=null;utils['info'](util[_0xc96c('0x3')](_0xc96c('0x1b'),_0x43fcaa[_0xc96c('0x5')],agents[_0x43fcaa[_0xc96c('0x17')]]['membername'],_0x43fcaa[_0xc96c('0x17')]));}catch(_0x100fdb){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x1d'),_0x43fcaa[_0xc96c('0x5')]),_0x100fdb);}};exports[_0xc96c('0x1e')]=function(_0x41daba){try{if(!_[_0xc96c('0x1f')](agents[_0x41daba[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x41daba);utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x21'),_0x41daba['uniqueid'],agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x8')],_0x41daba[_0xc96c('0x17')]));agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x1e')]=!![];agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x22')]=utils[_0xc96c('0x19')]();agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0xb')]='timeout';agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x23')]=_0xc96c('0x24');agents[_0x41daba[_0xc96c('0x17')]]['holdtime']=_0x41daba['ringtime']?parseInt(_0x41daba[_0xc96c('0x25')])/0x3e8:0x0;agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x26')]=0x0;unanswered[_0xc96c('0x27')](_0x41daba[_0xc96c('0x17')]);}}catch(_0x5e1727){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x5e1727);}};exports[_0xc96c('0x28')]=function(_0x40c72b){try{_[_0xc96c('0x29')](agents,function(_0x328ee4,_0x556108){if(_0x328ee4[_0xc96c('0x5')]==_0x40c72b['uniqueid']&&!_[_0xc96c('0x2a')](unanswered,_0x328ee4[_0xc96c('0x17')])){utils[_0xc96c('0x16')](util['format'](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x40c72b);utils[_0xc96c('0x2')](util[_0xc96c('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x40c72b['uniqueid'],_0x328ee4[_0xc96c('0x8')],_0x328ee4[_0xc96c('0x17')]));_0x328ee4[_0xc96c('0x1e')]=!![];_0x328ee4['agentringnoanswerAt']=utils[_0xc96c('0x19')]();_0x328ee4[_0xc96c('0xb')]=_0xc96c('0x2c');_0x328ee4[_0xc96c('0x23')]='abandoned';_0x328ee4[_0xc96c('0x2d')]=_0x40c72b[_0xc96c('0x2d')];_0x328ee4['talktime']=0x0;writeDB(_0x328ee4);}});}catch(_0x2b1dec){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x2b1dec);}};exports[_0xc96c('0x2e')]=function(_0x4e8241){try{if(agents[_0x4e8241[_0xc96c('0x17')]]){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4e8241);utils[_0xc96c('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4e8241[_0xc96c('0x5')],agents[_0x4e8241[_0xc96c('0x17')]]['membername'],_0x4e8241['destuniqueid']));agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xa')]=_0x4e8241[_0xc96c('0xa')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x31')]=_0x4e8241[_0xc96c('0x31')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x2d')]=_0x4e8241['ringtime'];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x32');_[_0xc96c('0x29')](agents,function(_0x4eb180,_0x167671){if(_0x4eb180[_0xc96c('0x17')]!=_0x4e8241[_0xc96c('0x17')]&&_0x4eb180['uniqueid']==_0x4e8241['uniqueid']){_0x4eb180[_0xc96c('0x26')]=0x0;_0x4eb180[_0xc96c('0x2d')]=_0x4e8241[_0xc96c('0x25')];_0x4eb180['agentringnoanswer']=!![];_0x4eb180[_0xc96c('0x22')]=utils[_0xc96c('0x19')]();_0x4eb180[_0xc96c('0xb')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x23')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x34')]=_0x4e8241[_0xc96c('0x17')];_0x4eb180[_0xc96c('0x35')]=_0x4e8241['membername'];writeDB(_0x4eb180);}});}}catch(_0x4c3088){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4c3088);}};exports['agentcomplete']=function(_0x5ee6ac){try{if(!_[_0xc96c('0x1f')](agents[_0x5ee6ac[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x5ee6ac);utils[_0xc96c('0x2')](util['format'](_0xc96c('0x37'),_0x5ee6ac[_0xc96c('0x5')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x8')],_0x5ee6ac['destuniqueid']));agents[_0x5ee6ac['destuniqueid']][_0xc96c('0x10')]=!![];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x30')]);agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x23')]=_0x5ee6ac['reason'];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x3a');writeDB(agents[_0x5ee6ac[_0xc96c('0x17')]]);}}catch(_0x56bce1){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x56bce1);}};exports['blindtransfer']=function(_0x2581ae){try{if(!_[_0xc96c('0x1f')](agents[_0x2581ae[_0xc96c('0x3b')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x3c'),_0x2581ae['uniqueid']),_0x2581ae);utils['info'](util['format'](_0xc96c('0x3d'),_0x2581ae['uniqueid'],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x8')],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')]));agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3e')]=!![];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3f')]=_0xc96c('0x40');agents[_0x2581ae[_0xc96c('0x3b')]]['transferexten']=_0x2581ae[_0xc96c('0x41')];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x42')]=agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')];}}catch(_0xcde9){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][blindtransfer]',_0x2581ae['uniqueid']),_0xcde9);}};exports['attendedtransfer']=function(_0x5c3d95){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0x5c3d95);if(_0x5c3d95[_0xc96c('0x44')]==_0x5c3d95[_0xc96c('0x45')]){if(!_[_0xc96c('0x1f')](agents[_0x5c3d95['secondtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x8')]));agents[_0x5c3d95[_0xc96c('0x47')]]['transfer']=!![];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x3f')]=_0xc96c('0x48');agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x4a')];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x42')]=_0x5c3d95[_0xc96c('0x44')];}if(_0x5c3d95[_0xc96c('0x4b')]&&agents[_0x5c3d95[_0xc96c('0x4b')]]){agents[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x4b')]]=_['clone'](agents[_0x5c3d95[_0xc96c('0x4b')]]);transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4d')];transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x4e')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4e')];transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentcalledAt']=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x2;}}else if(_0x5c3d95[_0xc96c('0x47')]==_0x5c3d95[_0xc96c('0x4f')]){if(!_['isNil'](agents[_0x5c3d95['origtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x44')]]['membername']));agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3e')]=!![];agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3f')]='ATTENDED';agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x50')];agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x42')]=_0x5c3d95['secondtransfereruniqueid'];}if(_0x5c3d95[_0xc96c('0x51')]&&agents[_0x5c3d95[_0xc96c('0x51')]]){agents[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x51')]]=_[_0xc96c('0x52')](agents[_0x5c3d95[_0xc96c('0x51')]]);transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x44')]]['calleridnum'];transfers[_0x5c3d95[_0xc96c('0x51')]]['calleridname']=agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x4e')];transfers[_0x5c3d95['transfertargetuniqueid']][_0xc96c('0x18')]=utils['now']();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x2;}}}catch(_0xbd6525){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0xbd6525);}};exports[_0xc96c('0x53')]=function(_0x43f94e){try{utils['debug'](util[_0xc96c('0x3')](_0xc96c('0x54'),_0x43f94e['uniqueid']),_0x43f94e);if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]]['reason']===_0xc96c('0x24')){if(_0x43f94e[_0xc96c('0x55')]==='21'){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')]=_0xc96c('0x56');agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]=_0xc96c('0x56');}utils[_0xc96c('0x2')](util['format'](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e[_0xc96c('0x5')]]['membername'],agents[_0x43f94e['uniqueid']][_0xc96c('0x23')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);var _0x1efa88=unanswered[_0xc96c('0x58')](_0x43f94e[_0xc96c('0x5')]);if(_0x1efa88>-0x1){unanswered['splice'](_0x1efa88,0x1);}}if(transfers[_0x43f94e[_0xc96c('0x5')]]){transfers[_0x43f94e[_0xc96c('0x5')]]['agentcomplete']=!![];transfers[_0x43f94e[_0xc96c('0x5')]]['agentcompleteAt']=utils[_0xc96c('0x19')]();transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);transfers[_0x43f94e[_0xc96c('0x5')]]['reason']=_0xc96c('0x59');transfers[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils['info'](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],transfers[_0x43f94e['uniqueid']][_0xc96c('0x8')],transfers[_0x43f94e[_0xc96c('0x5')]]['reason'],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(transfers[_0x43f94e[_0xc96c('0x5')]],!![]);}if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x10')]=!![];agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);agents[_0x43f94e[_0xc96c('0x5')]]['reason']=agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x3e')]?_0xc96c('0x3e'):_0xc96c('0x59');agents[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e['uniqueid']]['membername'],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')],agents[_0x43f94e['uniqueid']][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);}}catch(_0x563449){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][hangup]',_0x43f94e[_0xc96c('0x5')]),_0x563449);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 2853385..5efaed3 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 _0x3e9c=['includes','noop','execif','gotoif','lastapplication','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','UserId','CreateVoiceCallReport','request','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','application','appdata','toLowerCase','set','split','substring','lastIndexOf'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e9c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc3e9('0x0'));var util=require(_0xc3e9('0x1'));var utils=require(_0xc3e9('0x2'));var transfers=require(_0xc3e9('0x3'));var dispositions=[_0xc3e9('0x4'),_0xc3e9('0x5'),_0xc3e9('0x5'),_0xc3e9('0x4'),_0xc3e9('0x4'),_0xc3e9('0x4'),_0xc3e9('0x6'),_0xc3e9('0x7'),_0xc3e9('0x5'),_0xc3e9('0x5'),_0xc3e9('0x5')];var channels={};function writeDB(_0x27eaf3){var _0x219e7a;if(transfers[_0xc3e9('0x8')][_0x27eaf3['uniqueid']]){_0x219e7a=_0x27eaf3[_0xc3e9('0x9')];_0x27eaf3[_0xc3e9('0x9')]=transfers[_0xc3e9('0x8')][_0x27eaf3[_0xc3e9('0x9')]]['transfereeuniqueid'];}utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0xb'),_0x27eaf3[_0xc3e9('0x9')],_0x27eaf3[_0xc3e9('0xc')],_0x27eaf3[_0xc3e9('0xd')],_0x27eaf3[_0xc3e9('0xe')],_0x27eaf3[_0xc3e9('0xf')],_0x27eaf3[_0xc3e9('0x10')],_0x27eaf3[_0xc3e9('0x11')],_0x27eaf3['lastevent']));if(_0x27eaf3[_0xc3e9('0x12')]){utils['getUserByInternal'](_0x27eaf3[_0xc3e9('0x12')])['then'](function(_0x3d9771){if(_0x3d9771){_0x27eaf3[_0xc3e9('0x13')]=_0x3d9771['id'];}utils['request'](_0xc3e9('0x14'),_0x27eaf3);});}else{utils[_0xc3e9('0x15')](_0xc3e9('0x14'),_0x27eaf3);}if(channels[_0x27eaf3[_0xc3e9('0x9')]]){delete channels[_0x27eaf3['uniqueid']];}else if(_0x219e7a&&channels[_0x219e7a]){if(!transfers[_0xc3e9('0x8')][_0x219e7a]['recording'])delete transfers[_0xc3e9('0x8')][_0x219e7a];delete channels[_0x219e7a];}}exports['newchannel']=function(_0x2c1e22){try{utils[_0xc3e9('0x16')](util[_0xc3e9('0x17')](_0xc3e9('0x18'),_0x2c1e22[_0xc3e9('0x9')]),_0x2c1e22);if(_0x2c1e22[_0xc3e9('0x9')]==_0x2c1e22[_0xc3e9('0x19')]&&_0x2c1e22[_0xc3e9('0xc')]!=_0xc3e9('0x1a')){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x1b'),_0x2c1e22[_0xc3e9('0x9')],_0x2c1e22[_0xc3e9('0x1c')],_0x2c1e22['exten']));channels[_0x2c1e22[_0xc3e9('0x9')]]={'uniqueid':_0x2c1e22[_0xc3e9('0x9')],'accountcode':_0x2c1e22['accountcode'],'source':_0x2c1e22[_0xc3e9('0x10')],'destination':_0x2c1e22[_0xc3e9('0x1d')],'destinationcontext':_0x2c1e22[_0xc3e9('0x1c')],'channel':_0x2c1e22[_0xc3e9('0xc')],'starttime':utils[_0xc3e9('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc3e9('0x4'),'amaflags':_0xc3e9('0x1f')};}}catch(_0x9908f5){utils[_0xc3e9('0x20')](util['format'](_0xc3e9('0x18'),_0x2c1e22[_0xc3e9('0x9')]),_0x9908f5);}};exports['newstate']=function(_0x53160a){try{utils[_0xc3e9('0x16')](util['format'](_0xc3e9('0x21'),_0x53160a[_0xc3e9('0x9')]),_0x53160a);if(!_[_0xc3e9('0x22')](channels[_0x53160a[_0xc3e9('0x9')]])&&_0x53160a[_0xc3e9('0x23')]==0x6){utils[_0xc3e9('0xa')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x53160a[_0xc3e9('0x9')],_0x53160a[_0xc3e9('0x1c')],_0x53160a['channel']));if(_[_0xc3e9('0x22')](channels[_0x53160a[_0xc3e9('0x9')]][_0xc3e9('0x24')])){channels[_0x53160a[_0xc3e9('0x9')]][_0xc3e9('0x24')]=utils[_0xc3e9('0x1e')]();}}else if(!_['isNil'](channels[_0x53160a[_0xc3e9('0x19')]])&&_0x53160a[_0xc3e9('0x23')]==0x6&&_0x53160a['context']!=_0xc3e9('0x25')){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x26'),_0x53160a['uniqueid'],_0x53160a[_0xc3e9('0x19')],_0x53160a[_0xc3e9('0x1c')],_0x53160a[_0xc3e9('0xc')]));channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x12')]=_0x53160a[_0xc3e9('0x12')];channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x27')]=_0x53160a[_0xc3e9('0xc')];if(_[_0xc3e9('0x22')](channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x28')])){channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x28')]=utils[_0xc3e9('0x1e')]();}channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x29')]=dispositions[_[_0xc3e9('0x2a')](_0x53160a[_0xc3e9('0x23')])]||'ANSWERED';}}catch(_0x4f1076){utils['error'](util['format'](_0xc3e9('0x21'),_0x53160a[_0xc3e9('0x9')]),_0x4f1076);}};exports[_0xc3e9('0x2b')]=function(_0x1f136f){try{if(!_[_0xc3e9('0x22')](channels[_0x1f136f[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util['format'](_0xc3e9('0x2c'),_0x1f136f[_0xc3e9('0x9')]),_0x1f136f);if(_['isNil'](channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x2d')])){channels[_0x1f136f['uniqueid']][_0xc3e9('0x2d')]=_0x1f136f[_0xc3e9('0x2e')]+'\x20<'+_0x1f136f[_0xc3e9('0x10')]+'>';}utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x2f'),_0x1f136f[_0xc3e9('0x9')],channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x2d')],_0x1f136f[_0xc3e9('0x30')]));channels[_0x1f136f['uniqueid']][_0xc3e9('0x31')]=utils[_0xc3e9('0x1e')]();channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x32')]=utils[_0xc3e9('0x33')](channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x31')],channels[_0x1f136f[_0xc3e9('0x9')]]['starttime']);channels[_0x1f136f['uniqueid']][_0xc3e9('0x34')]=channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x28')]?utils[_0xc3e9('0x33')](channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x31')],channels[_0x1f136f['uniqueid']][_0xc3e9('0x28')]):0x0;writeDB(channels[_0x1f136f[_0xc3e9('0x9')]]);}}catch(_0x520b72){utils[_0xc3e9('0x20')](util[_0xc3e9('0x17')]('[%s][calls][hangup]',_0x1f136f[_0xc3e9('0x9')]),_0x520b72);}};exports[_0xc3e9('0x35')]=function(_0xa02001){try{if(!_['isNil'](channels[_0xa02001['localtwolinkedid']])){utils['debug'](util[_0xc3e9('0x17')](_0xc3e9('0x36'),_0xa02001[_0xc3e9('0x37')]),_0xa02001);if(channels[_0xa02001[_0xc3e9('0x38')]][_0xc3e9('0xc')]==_0xa02001[_0xc3e9('0x39')]){utils['info'](util[_0xc3e9('0x17')](_0xc3e9('0x3a'),_0xa02001['origtransfereruniqueid'],_0xa02001['localtwolinkedid'],_0xa02001[_0xc3e9('0x3b')]));channels[_0xa02001[_0xc3e9('0x38')]]['destinationchannel']=_0xa02001[_0xc3e9('0x3b')];channels[_0xa02001[_0xc3e9('0x38')]]['userfield']=_0xc3e9('0x3c');}else if(channels[_0xa02001[_0xc3e9('0x38')]][_0xc3e9('0xc')]=_0xa02001[_0xc3e9('0x3d')]){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x3a'),_0xa02001[_0xc3e9('0x37')],_0xa02001[_0xc3e9('0x38')],_0xa02001[_0xc3e9('0x3e')]));channels[_0xa02001['localtwolinkedid']][_0xc3e9('0x27')]=_0xa02001['origtransfererchannel'];channels[_0xa02001[_0xc3e9('0x38')]]['userfield']=_0xc3e9('0x3c');}}}catch(_0x2865bb){utils[_0xc3e9('0x20')](util['format'](_0xc3e9('0x36'),_0xa02001['origtransfereruniqueid']),_0x2865bb);}};exports[_0xc3e9('0x3f')]=function(_0x1eb267){try{if(!_[_0xc3e9('0x22')](channels[_0x1eb267[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util['format'](_0xc3e9('0x40'),_0x1eb267[_0xc3e9('0x9')]),_0x1eb267);channels[_0x1eb267[_0xc3e9('0x9')]]['musiconholdstartAt']=utils[_0xc3e9('0x1e')]();utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0x41'),_0x1eb267[_0xc3e9('0x9')],channels[_0x1eb267[_0xc3e9('0x9')]][_0xc3e9('0x42')]));}}catch(_0x1771f0){utils['error'](util['format'](_0xc3e9('0x40'),_0x1eb267[_0xc3e9('0x9')]),_0x1771f0);}};exports['musiconholdstop']=function(_0x496f7c){try{if(!_[_0xc3e9('0x22')](channels[_0x496f7c[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util[_0xc3e9('0x17')](_0xc3e9('0x43'),_0x496f7c[_0xc3e9('0x9')]),_0x496f7c);if(!_['isNil'](channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x42')])){channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x44')]+=utils[_0xc3e9('0x33')](utils[_0xc3e9('0x1e')](),channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x42')]);utils['info'](util[_0xc3e9('0x17')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x496f7c['uniqueid'],channels[_0x496f7c['uniqueid']][_0xc3e9('0x44')]));delete channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x42')];}}}catch(_0x2f104a){utils['error'](util['format']('[%s][calls][musiconholdstop]',_0x496f7c[_0xc3e9('0x9')]),_0x2f104a);}};exports['varset']=function(_0x893462){try{if(!_[_0xc3e9('0x22')](channels[_0x893462[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util['format']('[%s][calls][varset]',_0x893462[_0xc3e9('0x9')]),_0x893462);if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['xmd-originatecalleridnum'])){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x46'),_0x893462['uniqueid'],_0x893462[_0xc3e9('0x47')]));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x48')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x49')])){utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0x4a'),_0x893462[_0xc3e9('0x9')],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x4b')]=_0x893462[_0xc3e9('0x47')];channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x2d')]='\x22'+_0x893462['value']+_0xc3e9('0x4c')+_0x893462[_0xc3e9('0x47')]+'>';}if(!_[_0xc3e9('0x22')](_0x893462['variable'][_0xc3e9('0x4d')])||!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x4e')])){utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0x4f'),_0x893462['uniqueid'],!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x4d')])?_0xc3e9('0x4d'):_0xc3e9('0x4e'),_0x893462[_0xc3e9('0x47')]));channels[_0x893462['uniqueid']][_0xc3e9('0x2d')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x50')])||!_['isNil'](_0x893462['variable'][_0xc3e9('0x51')])){utils[_0xc3e9('0xa')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x893462[_0xc3e9('0x9')],!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['xmd-queue'])?_0xc3e9('0x50'):_0xc3e9('0x51'),_0x893462[_0xc3e9('0x47')]));channels[_0x893462[_0xc3e9('0x9')]]['lastapplication']='Queue';channels[_0x893462[_0xc3e9('0x9')]]['lastdata']=_0x893462[_0xc3e9('0x47')];channels[_0x893462['uniqueid']]['queue']=!![];}if(!_[_0xc3e9('0x22')](_0x893462['variable'][_0xc3e9('0x52')])){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x53'),_0x893462['uniqueid'],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x54')]=_0x893462[_0xc3e9('0x47')];}if(!_['isNil'](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x55')])){utils['info'](util[_0xc3e9('0x17')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x893462[_0xc3e9('0x9')],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x56')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['outboundrouteid'])){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x57'),_0x893462['uniqueid'],_0x893462[_0xc3e9('0x47')]));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x58')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['sipcallid'])){utils['info'](util[_0xc3e9('0x17')](_0xc3e9('0x59'),_0x893462[_0xc3e9('0x9')],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]]['sipcallid']=_0x893462[_0xc3e9('0x47')];}}}catch(_0x582b72){utils[_0xc3e9('0x20')](util['format'](_0xc3e9('0x5a'),_0x893462[_0xc3e9('0x9')]),_0x582b72);}};exports['newexten']=function(_0x7292de){try{if(!_[_0xc3e9('0x22')](channels[_0x7292de[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util[_0xc3e9('0x17')](_0xc3e9('0x5b'),_0x7292de[_0xc3e9('0x9')]),_0x7292de);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x7292de[_0xc3e9('0x9')],_0x7292de[_0xc3e9('0x5c')],_0x7292de[_0xc3e9('0x5d')]));if(_0x7292de[_0xc3e9('0x5c')][_0xc3e9('0x5e')]()==_0xc3e9('0x5f')&&_['startsWith'](_0x7292de['appdata']['toLowerCase'](),'cdr')){var _0x3aa963=_0x7292de[_0xc3e9('0x5d')][_0xc3e9('0x60')]('=');var _0x33976e=_0x3aa963[0x0][_0xc3e9('0x61')](_0x3aa963[0x0]['lastIndexOf']('(')+0x1,_0x3aa963[0x0][_0xc3e9('0x62')](')'));var _0x1cb10b=_0x3aa963[0x1];channels[_0x7292de[_0xc3e9('0x9')]][_0x33976e]=_0x1cb10b;}if(!_[_0xc3e9('0x63')]([_0xc3e9('0x2b'),_0xc3e9('0x64'),_0xc3e9('0x65'),_0xc3e9('0x5f'),_0xc3e9('0x66')],_0x7292de[_0xc3e9('0x5c')][_0xc3e9('0x5e')]())){channels[_0x7292de[_0xc3e9('0x9')]][_0xc3e9('0x67')]=_0x7292de[_0xc3e9('0x5c')];channels[_0x7292de[_0xc3e9('0x9')]][_0xc3e9('0x68')]=_0x7292de[_0xc3e9('0x5d')];}}}catch(_0x2c2453){utils[_0xc3e9('0x20')](util[_0xc3e9('0x17')]('[%s][calls][newexten]',_0x7292de['uniqueid']),_0x2c2453);}}; \ No newline at end of file +var _0xd481=['varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd481,0x1e4));var _0x1d48=function(_0xe08bbd,_0x2c235f){_0xe08bbd=_0xe08bbd-0x0;var _0x1f9222=_0xd481[_0xe08bbd];return _0x1f9222;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var utils=require(_0x1d48('0x1'));var transfers=require(_0x1d48('0x2'));var dispositions=['NO\x20ANSWER',_0x1d48('0x3'),_0x1d48('0x3'),_0x1d48('0x4'),'NO\x20ANSWER',_0x1d48('0x4'),'ANSWERED',_0x1d48('0x5'),_0x1d48('0x3'),'FAILED',_0x1d48('0x3')];var channels={};function writeDB(_0x3099cc){var _0x3b8bd4;if(transfers[_0x1d48('0x6')][_0x3099cc[_0x1d48('0x7')]]){_0x3b8bd4=_0x3099cc[_0x1d48('0x7')];_0x3099cc[_0x1d48('0x7')]=transfers[_0x1d48('0x6')][_0x3099cc[_0x1d48('0x7')]][_0x1d48('0x8')];}utils[_0x1d48('0x9')](util[_0x1d48('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3099cc[_0x1d48('0x7')],_0x3099cc[_0x1d48('0xb')],_0x3099cc[_0x1d48('0xc')],_0x3099cc[_0x1d48('0xd')],_0x3099cc[_0x1d48('0xe')],_0x3099cc[_0x1d48('0xf')],_0x3099cc[_0x1d48('0x10')],_0x3099cc[_0x1d48('0x11')]));if(_0x3099cc[_0x1d48('0x12')]){utils[_0x1d48('0x13')](_0x3099cc['accountcode'])[_0x1d48('0x14')](function(_0x5f1ad8){if(_0x5f1ad8){_0x3099cc[_0x1d48('0x15')]=_0x5f1ad8['id'];}utils[_0x1d48('0x16')](_0x1d48('0x17'),_0x3099cc);});}else{utils[_0x1d48('0x16')]('CreateVoiceCallReport',_0x3099cc);}if(channels[_0x3099cc[_0x1d48('0x7')]]){delete channels[_0x3099cc[_0x1d48('0x7')]];}else if(_0x3b8bd4&&channels[_0x3b8bd4]){if(!transfers[_0x1d48('0x6')][_0x3b8bd4]['recording'])delete transfers[_0x1d48('0x6')][_0x3b8bd4];delete channels[_0x3b8bd4];}}exports[_0x1d48('0x18')]=function(_0x1b99e2){try{utils[_0x1d48('0x19')](util[_0x1d48('0xa')](_0x1d48('0x1a'),_0x1b99e2[_0x1d48('0x7')]),_0x1b99e2);if(_0x1b99e2[_0x1d48('0x7')]==_0x1b99e2[_0x1d48('0x1b')]&&_0x1b99e2['channel']!='OutgoingSpoolFailed'){utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x1c'),_0x1b99e2[_0x1d48('0x7')],_0x1b99e2[_0x1d48('0x1d')],_0x1b99e2[_0x1d48('0x1e')]));channels[_0x1b99e2[_0x1d48('0x7')]]={'uniqueid':_0x1b99e2[_0x1d48('0x7')],'accountcode':_0x1b99e2['accountcode'],'source':_0x1b99e2[_0x1d48('0xf')],'destination':_0x1b99e2[_0x1d48('0x1e')],'destinationcontext':_0x1b99e2['context'],'channel':_0x1b99e2['channel'],'starttime':utils[_0x1d48('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1d48('0x4'),'amaflags':_0x1d48('0x20')};}}catch(_0x20699a){utils[_0x1d48('0x21')](util[_0x1d48('0xa')](_0x1d48('0x1a'),_0x1b99e2[_0x1d48('0x7')]),_0x20699a);}};exports[_0x1d48('0x22')]=function(_0x1382d8){try{utils['debug'](util['format'](_0x1d48('0x23'),_0x1382d8[_0x1d48('0x7')]),_0x1382d8);if(!_[_0x1d48('0x24')](channels[_0x1382d8[_0x1d48('0x7')]])&&_0x1382d8[_0x1d48('0x25')]==0x6){utils[_0x1d48('0x9')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1382d8[_0x1d48('0x7')],_0x1382d8[_0x1d48('0x1d')],_0x1382d8['channel']));if(_[_0x1d48('0x24')](channels[_0x1382d8[_0x1d48('0x7')]][_0x1d48('0x26')])){channels[_0x1382d8[_0x1d48('0x7')]]['systemanswertime']=utils[_0x1d48('0x1f')]();}}else if(!_[_0x1d48('0x24')](channels[_0x1382d8[_0x1d48('0x1b')]])&&_0x1382d8[_0x1d48('0x25')]==0x6&&_0x1382d8[_0x1d48('0x1d')]!='transfer'){utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x27'),_0x1382d8[_0x1d48('0x7')],_0x1382d8[_0x1d48('0x1b')],_0x1382d8['context'],_0x1382d8[_0x1d48('0xb')]));channels[_0x1382d8[_0x1d48('0x1b')]][_0x1d48('0x12')]=_0x1382d8['accountcode'];channels[_0x1382d8[_0x1d48('0x1b')]]['destinationchannel']=_0x1382d8['channel'];if(_[_0x1d48('0x24')](channels[_0x1382d8[_0x1d48('0x1b')]][_0x1d48('0x28')])){channels[_0x1382d8['linkedid']][_0x1d48('0x28')]=utils[_0x1d48('0x1f')]();}channels[_0x1382d8['linkedid']][_0x1d48('0x29')]=dispositions[_[_0x1d48('0x2a')](_0x1382d8[_0x1d48('0x25')])]||'ANSWERED';}}catch(_0x3c6e09){utils['error'](util[_0x1d48('0xa')](_0x1d48('0x23'),_0x1382d8[_0x1d48('0x7')]),_0x3c6e09);}};exports['hangup']=function(_0x538df9){try{if(!_[_0x1d48('0x24')](channels[_0x538df9[_0x1d48('0x7')]])){utils[_0x1d48('0x19')](util[_0x1d48('0xa')](_0x1d48('0x2b'),_0x538df9[_0x1d48('0x7')]),_0x538df9);if(_[_0x1d48('0x24')](channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x2c')])){channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x2c')]=_0x538df9[_0x1d48('0x2d')]+'\x20<'+_0x538df9[_0x1d48('0xf')]+'>';}utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x2e'),_0x538df9[_0x1d48('0x7')],channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x2c')],_0x538df9[_0x1d48('0x2f')]));channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x30')]=utils[_0x1d48('0x1f')]();channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x31')]=utils[_0x1d48('0x32')](channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x30')],channels[_0x538df9['uniqueid']][_0x1d48('0x33')]);channels[_0x538df9['uniqueid']][_0x1d48('0x34')]=channels[_0x538df9[_0x1d48('0x7')]]['answertime']?utils[_0x1d48('0x32')](channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x30')],channels[_0x538df9[_0x1d48('0x7')]][_0x1d48('0x28')]):0x0;writeDB(channels[_0x538df9[_0x1d48('0x7')]]);}}catch(_0x5aaa3c){utils['error'](util['format'](_0x1d48('0x2b'),_0x538df9[_0x1d48('0x7')]),_0x5aaa3c);}};exports['attendedtransfer']=function(_0x290b9){try{if(!_[_0x1d48('0x24')](channels[_0x290b9['localtwolinkedid']])){utils[_0x1d48('0x19')](util[_0x1d48('0xa')](_0x1d48('0x35'),_0x290b9['origtransfereruniqueid']),_0x290b9);if(channels[_0x290b9['localtwolinkedid']][_0x1d48('0xb')]==_0x290b9[_0x1d48('0x36')]){utils[_0x1d48('0x9')](util['format'](_0x1d48('0x37'),_0x290b9['origtransfereruniqueid'],_0x290b9[_0x1d48('0x38')],_0x290b9[_0x1d48('0x39')]));channels[_0x290b9[_0x1d48('0x38')]][_0x1d48('0x3a')]=_0x290b9[_0x1d48('0x39')];channels[_0x290b9[_0x1d48('0x38')]]['userfield']=_0x1d48('0x3b');}else if(channels[_0x290b9[_0x1d48('0x38')]][_0x1d48('0xb')]=_0x290b9[_0x1d48('0x3c')]){utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x37'),_0x290b9[_0x1d48('0x3d')],_0x290b9[_0x1d48('0x38')],_0x290b9[_0x1d48('0x3e')]));channels[_0x290b9[_0x1d48('0x38')]][_0x1d48('0x3a')]=_0x290b9['origtransfererchannel'];channels[_0x290b9[_0x1d48('0x38')]]['userfield']=_0x1d48('0x3b');}}}catch(_0x2e38fd){utils[_0x1d48('0x21')](util['format']('[%s][calls][attendedtransfer]',_0x290b9[_0x1d48('0x3d')]),_0x2e38fd);}};exports[_0x1d48('0x3f')]=function(_0x5a8f63){try{if(!_[_0x1d48('0x24')](channels[_0x5a8f63[_0x1d48('0x7')]])){utils[_0x1d48('0x19')](util[_0x1d48('0xa')](_0x1d48('0x40'),_0x5a8f63[_0x1d48('0x7')]),_0x5a8f63);channels[_0x5a8f63['uniqueid']][_0x1d48('0x41')]=utils[_0x1d48('0x1f')]();utils[_0x1d48('0x9')](util['format'](_0x1d48('0x42'),_0x5a8f63[_0x1d48('0x7')],channels[_0x5a8f63[_0x1d48('0x7')]][_0x1d48('0x41')]));}}catch(_0x15a21c){utils[_0x1d48('0x21')](util[_0x1d48('0xa')]('[%s][calls][musiconholdstart]',_0x5a8f63['uniqueid']),_0x15a21c);}};exports[_0x1d48('0x43')]=function(_0x264090){try{if(!_[_0x1d48('0x24')](channels[_0x264090['uniqueid']])){utils['debug'](util['format']('[%s][calls][musiconholdstop]',_0x264090[_0x1d48('0x7')]),_0x264090);if(!_[_0x1d48('0x24')](channels[_0x264090[_0x1d48('0x7')]][_0x1d48('0x41')])){channels[_0x264090[_0x1d48('0x7')]][_0x1d48('0x44')]+=utils[_0x1d48('0x32')](utils[_0x1d48('0x1f')](),channels[_0x264090[_0x1d48('0x7')]][_0x1d48('0x41')]);utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x45'),_0x264090['uniqueid'],channels[_0x264090['uniqueid']][_0x1d48('0x44')]));delete channels[_0x264090['uniqueid']]['musiconholdstartAt'];}}}catch(_0x5cc792){utils[_0x1d48('0x21')](util['format'](_0x1d48('0x46'),_0x264090[_0x1d48('0x7')]),_0x5cc792);}};exports[_0x1d48('0x47')]=function(_0x293281){try{if(!_[_0x1d48('0x24')](channels[_0x293281[_0x1d48('0x7')]])){utils[_0x1d48('0x19')](util['format'](_0x1d48('0x48'),_0x293281[_0x1d48('0x7')]),_0x293281);if(!_[_0x1d48('0x24')](_0x293281[_0x1d48('0x49')][_0x1d48('0x4a')])){utils[_0x1d48('0x9')](util[_0x1d48('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x293281[_0x1d48('0x7')],_0x293281['value']));channels[_0x293281[_0x1d48('0x7')]]['source']=_0x293281[_0x1d48('0x4b')];}if(!_['isNil'](_0x293281[_0x1d48('0x49')][_0x1d48('0x4c')])){utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x4d'),_0x293281[_0x1d48('0x7')],_0x293281[_0x1d48('0x4b')]));channels[_0x293281[_0x1d48('0x7')]][_0x1d48('0x4e')]=_0x293281[_0x1d48('0x4b')];channels[_0x293281[_0x1d48('0x7')]]['callerid']='\x22'+_0x293281[_0x1d48('0x4b')]+_0x1d48('0x4f')+_0x293281['value']+'>';}if(!_['isNil'](_0x293281['variable'][_0x1d48('0x50')])||!_[_0x1d48('0x24')](_0x293281[_0x1d48('0x49')][_0x1d48('0x51')])){utils['info'](util['format'](_0x1d48('0x52'),_0x293281['uniqueid'],!_[_0x1d48('0x24')](_0x293281[_0x1d48('0x49')][_0x1d48('0x50')])?_0x1d48('0x50'):_0x1d48('0x51'),_0x293281[_0x1d48('0x4b')]));channels[_0x293281['uniqueid']][_0x1d48('0x2c')]=_0x293281[_0x1d48('0x4b')];}if(!_[_0x1d48('0x24')](_0x293281[_0x1d48('0x49')]['xmd-queue'])||!_['isNil'](_0x293281['variable'][_0x1d48('0x53')])){utils['info'](util[_0x1d48('0xa')](_0x1d48('0x52'),_0x293281[_0x1d48('0x7')],!_[_0x1d48('0x24')](_0x293281[_0x1d48('0x49')]['xmd-queue'])?_0x1d48('0x54'):_0x1d48('0x53'),_0x293281['value']));channels[_0x293281[_0x1d48('0x7')]][_0x1d48('0x55')]='Queue';channels[_0x293281[_0x1d48('0x7')]][_0x1d48('0x56')]=_0x293281['value'];channels[_0x293281[_0x1d48('0x7')]][_0x1d48('0xc')]=!![];}if(!_[_0x1d48('0x24')](_0x293281['variable']['xmd-contactid'])){utils['info'](util['format'](_0x1d48('0x57'),_0x293281[_0x1d48('0x7')],_0x293281[_0x1d48('0x4b')]));channels[_0x293281[_0x1d48('0x7')]][_0x1d48('0x58')]=_0x293281['value'];}if(!_[_0x1d48('0x24')](_0x293281['variable']['xmd-cdrtype'])){utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x59'),_0x293281[_0x1d48('0x7')],_0x293281[_0x1d48('0x4b')]));channels[_0x293281['uniqueid']][_0x1d48('0x5a')]=_0x293281['value'];}if(!_[_0x1d48('0x24')](_0x293281['variable'][_0x1d48('0x5b')])){utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x5c'),_0x293281[_0x1d48('0x7')],_0x293281[_0x1d48('0x4b')]));channels[_0x293281[_0x1d48('0x7')]][_0x1d48('0x5d')]=_0x293281['value'];}if(!_[_0x1d48('0x24')](_0x293281['variable'][_0x1d48('0x5e')])){utils['info'](util[_0x1d48('0xa')](_0x1d48('0x5f'),_0x293281[_0x1d48('0x7')],_0x293281['value']));channels[_0x293281[_0x1d48('0x7')]][_0x1d48('0x5e')]=_0x293281[_0x1d48('0x4b')];}}}catch(_0x3cc294){utils[_0x1d48('0x21')](util[_0x1d48('0xa')](_0x1d48('0x48'),_0x293281[_0x1d48('0x7')]),_0x3cc294);}};exports[_0x1d48('0x60')]=function(_0x19617e){try{if(!_[_0x1d48('0x24')](channels[_0x19617e['uniqueid']])){utils[_0x1d48('0x19')](util[_0x1d48('0xa')]('[%s][calls][newexten]',_0x19617e[_0x1d48('0x7')]),_0x19617e);utils[_0x1d48('0x9')](util[_0x1d48('0xa')](_0x1d48('0x61'),_0x19617e[_0x1d48('0x7')],_0x19617e[_0x1d48('0x62')],_0x19617e[_0x1d48('0x63')]));if(_0x19617e[_0x1d48('0x62')][_0x1d48('0x64')]()==_0x1d48('0x65')&&_[_0x1d48('0x66')](_0x19617e[_0x1d48('0x63')][_0x1d48('0x64')](),_0x1d48('0x67'))){var _0x548443=_0x19617e[_0x1d48('0x63')][_0x1d48('0x68')]('=');var _0x44f331=_0x548443[0x0][_0x1d48('0x69')](_0x548443[0x0][_0x1d48('0x6a')]('(')+0x1,_0x548443[0x0][_0x1d48('0x6a')](')'));var _0x330677=_0x548443[0x1];channels[_0x19617e['uniqueid']][_0x44f331]=_0x330677;}if(!_[_0x1d48('0x6b')](['hangup',_0x1d48('0x6c'),_0x1d48('0x6d'),_0x1d48('0x65'),_0x1d48('0x6e')],_0x19617e[_0x1d48('0x62')][_0x1d48('0x64')]())){channels[_0x19617e['uniqueid']][_0x1d48('0x55')]=_0x19617e[_0x1d48('0x62')];channels[_0x19617e[_0x1d48('0x7')]][_0x1d48('0x56')]=_0x19617e['appdata'];}}}catch(_0x1dd2cc){utils[_0x1d48('0x21')](util[_0x1d48('0xa')]('[%s][calls][newexten]',_0x19617e[_0x1d48('0x7')]),_0x1dd2cc);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 02ff21a..656ebca 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 _0xec56=['[core]\x20shutdown','fullybooted','error','[core]\x20close','managerevent','info','[core]\x20connected','shutdown'];(function(_0x4edfec,_0x581a4a){var _0x22c10b=function(_0x6c3054){while(--_0x6c3054){_0x4edfec['push'](_0x4edfec['shift']());}};_0x22c10b(++_0x581a4a);}(_0xec56,0x11d));var _0x6ec5=function(_0x43ae8f,_0x53b6df){_0x43ae8f=_0x43ae8f-0x0;var _0x334aa0=_0xec56[_0x43ae8f];return _0x334aa0;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x6ec5('0x0')](_0x6ec5('0x1'));};exports[_0x6ec5('0x2')]=function(){utils[_0x6ec5('0x0')](_0x6ec5('0x3'));};exports[_0x6ec5('0x4')]=function(){utils[_0x6ec5('0x0')]('[core]\x20fullybooted');};exports['error']=function(_0x8c1f80){utils[_0x6ec5('0x5')]('[core]\x20error',_0x8c1f80);};exports['close']=function(){utils[_0x6ec5('0x0')](_0x6ec5('0x6'));};exports[_0x6ec5('0x7')]=function(_0x15909d){}; \ No newline at end of file +var _0x4531=['fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown'];(function(_0x29c752,_0x359430){var _0x1d7927=function(_0xb3148c){while(--_0xb3148c){_0x29c752['push'](_0x29c752['shift']());}};_0x1d7927(++_0x359430);}(_0x4531,0x6a));var _0x1453=function(_0x3f81f2,_0x580577){_0x3f81f2=_0x3f81f2-0x0;var _0x3060d6=_0x4531[_0x3f81f2];return _0x3060d6;};'use strict';var utils=require('./utils');exports[_0x1453('0x0')]=function(){utils[_0x1453('0x1')](_0x1453('0x2'));};exports['shutdown']=function(){utils[_0x1453('0x1')](_0x1453('0x3'));};exports[_0x1453('0x4')]=function(){utils['info'](_0x1453('0x5'));};exports[_0x1453('0x6')]=function(_0x1490a9){utils[_0x1453('0x6')](_0x1453('0x7'),_0x1490a9);};exports[_0x1453('0x8')]=function(){utils[_0x1453('0x1')](_0x1453('0x9'));};exports[_0x1453('0xa')]=function(_0x6bec2){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 132bbce..cdbbe28 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 _0x5580=['calleridnum','connectedlinenum','dialstatus','request','uniqueid','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','[%s][dials][varset]','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','[%s][dials][hangup]','lodash','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring'];(function(_0x5503ef,_0x3539e5){var _0x134a35=function(_0x415981){while(--_0x415981){_0x5503ef['push'](_0x5503ef['shift']());}};_0x134a35(++_0x3539e5);}(_0x5580,0x15b));var _0x0558=function(_0x265ce1,_0x1ba6fe){_0x265ce1=_0x265ce1-0x0;var _0xa836dd=_0x5580[_0x265ce1];return _0xa836dd;};'use strict';var _=require(_0x0558('0x0'));var util=require('util');var utils=require(_0x0558('0x1'));var dials={};function writeDB(_0x498956){utils[_0x0558('0x2')](util['format'](_0x0558('0x3'),_0x498956['uniqueid'],_0x498956['channel'],_0x498956[_0x0558('0x4')],_0x498956[_0x0558('0x5')],_0x498956[_0x0558('0x6')],_0x498956[_0x0558('0x7')]));utils[_0x0558('0x8')]('CreateVoiceDialReport',_0x498956);delete dials[_0x498956[_0x0558('0x9')]];}exports['newexten']=function(_0x1b1d14){try{utils[_0x0558('0xa')](util[_0x0558('0xb')](_0x0558('0xc'),_0x1b1d14[_0x0558('0x9')]),_0x1b1d14);utils[_0x0558('0x2')](util['format'](_0x0558('0xd'),_0x1b1d14[_0x0558('0x9')],_0x1b1d14[_0x0558('0xe')],_0x1b1d14[_0x0558('0xf')]));if(_0x1b1d14[_0x0558('0xe')][_0x0558('0x10')]()==_0x0558('0x11')&&_[_0x0558('0x12')](_0x1b1d14[_0x0558('0xf')][_0x0558('0x10')](),_0x0558('0x13'))){var _0x18db3d=_0x1b1d14['appdata']['split']('=');dials[_0x1b1d14[_0x0558('0x9')]]={'routeId':_0x18db3d[0x1]};}}catch(_0x4a6686){utils[_0x0558('0x14')](util[_0x0558('0xb')](_0x0558('0xc'),_0x1b1d14[_0x0558('0x9')]),_0x4a6686);}};exports['varset']=function(_0x155311){try{utils[_0x0558('0xa')](util[_0x0558('0xb')](_0x0558('0x15'),_0x155311[_0x0558('0x9')]),_0x155311);if(!_['isNil'](_0x155311['variable']['outboundrouteid'])){utils[_0x0558('0x2')](util['format'](_0x0558('0x16'),_0x155311['uniqueid'],_0x155311[_0x0558('0x17')]));dials[_0x155311[_0x0558('0x9')]]={'routeId':_0x155311[_0x0558('0x17')]};}}catch(_0x75909e){utils['error'](util['format'](_0x0558('0x15'),_0x155311[_0x0558('0x9')]),_0x75909e);}};exports['dialbegin']=function(_0x1421b3){try{if(!_[_0x0558('0x18')](dials[_0x1421b3[_0x0558('0x9')]])){utils['debug'](util[_0x0558('0xb')]('[%s][dials][dialbegin]',_0x1421b3[_0x0558('0x9')]),_0x1421b3);dials[_0x1421b3[_0x0558('0x9')]]=_[_0x0558('0x19')](dials[_0x1421b3[_0x0558('0x9')]],_0x1421b3);dials[_0x1421b3[_0x0558('0x9')]][_0x0558('0x1a')]=utils[_0x0558('0x1b')]();dials[_0x1421b3[_0x0558('0x9')]]['lastevent']=_0x0558('0x1c');utils[_0x0558('0x2')](util['format'](_0x0558('0x1d'),_0x1421b3[_0x0558('0x9')],dials[_0x1421b3[_0x0558('0x9')]]['starttime']));}}catch(_0x19e712){utils[_0x0558('0x14')](util['format']('[%s][dials][dialbegin]',_0x1421b3[_0x0558('0x9')]),_0x19e712);}};exports['dialend']=function(_0x4abde0){try{if(!_[_0x0558('0x18')](dials[_0x4abde0[_0x0558('0x9')]])){utils[_0x0558('0xa')](util[_0x0558('0xb')](_0x0558('0x1e'),_0x4abde0[_0x0558('0x9')]),_0x4abde0);dials[_0x4abde0[_0x0558('0x9')]][_0x0558('0x7')]=_0x4abde0[_0x0558('0x7')];if(_0x4abde0[_0x0558('0x7')]==_0x0558('0x1f')){dials[_0x4abde0[_0x0558('0x9')]]=_[_0x0558('0x19')](dials[_0x4abde0['uniqueid']],_0x4abde0);dials[_0x4abde0['uniqueid']]['answertime']=utils['now']();dials[_0x4abde0['uniqueid']][_0x0558('0x20')]='connect';utils['info'](util[_0x0558('0xb')](_0x0558('0x21'),_0x4abde0['uniqueid'],_0x4abde0[_0x0558('0x7')],dials[_0x4abde0['uniqueid']][_0x0558('0x22')]));}else{utils['info'](util['format'](_0x0558('0x23'),_0x4abde0[_0x0558('0x9')],_0x4abde0['dialstatus']));}}}catch(_0x5489cf){utils[_0x0558('0x14')](util[_0x0558('0xb')](_0x0558('0x1e'),_0x4abde0[_0x0558('0x9')]),_0x5489cf);}};exports['hangup']=function(_0x55db81){try{if(!_[_0x0558('0x18')](dials[_0x55db81[_0x0558('0x9')]])){utils['debug'](util[_0x0558('0xb')]('[%s][dials][hangup]',_0x55db81[_0x0558('0x9')]),_0x55db81);utils['info'](util[_0x0558('0xb')](_0x0558('0x24'),_0x55db81[_0x0558('0x9')],_0x55db81['calleridnum'],_0x55db81[_0x0558('0x25')],_0x55db81[_0x0558('0x26')]));dials[_0x55db81[_0x0558('0x9')]]=_[_0x0558('0x19')](dials[_0x55db81[_0x0558('0x9')]],{'endtime':utils['now'](),'lastevent':_0x0558('0x27')});dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x28')]=utils[_0x0558('0x29')](dials[_0x55db81['uniqueid']][_0x0558('0x2a')],dials[_0x55db81['uniqueid']]['starttime']);dials[_0x55db81[_0x0558('0x9')]]['holdtime']=utils[_0x0558('0x29')](dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x22')]||dials[_0x55db81[_0x0558('0x9')]]['endtime'],dials[_0x55db81['uniqueid']][_0x0558('0x1a')]);dials[_0x55db81[_0x0558('0x9')]]['billableseconds']=dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x22')]?utils[_0x0558('0x29')](dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x2a')],dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x22')]):0x0;writeDB(dials[_0x55db81[_0x0558('0x9')]]);}}catch(_0x39cbd4){utils[_0x0558('0x14')](util[_0x0558('0xb')](_0x0558('0x2b'),_0x55db81[_0x0558('0x9')]),_0x39cbd4);}}; \ No newline at end of file +var _0x6945=['isNil','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','now','complete','duration','endtime','diffTime','billableseconds','[%s][dials][hangup]','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','debug','format','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][varset]','variable','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend'];(function(_0x1dd54f,_0x1a77ac){var _0x4c168d=function(_0x4a10e8){while(--_0x4a10e8){_0x1dd54f['push'](_0x1dd54f['shift']());}};_0x4c168d(++_0x1a77ac);}(_0x6945,0x74));var _0x5694=function(_0x4c9f4c,_0x567141){_0x4c9f4c=_0x4c9f4c-0x0;var _0x49b303=_0x6945[_0x4c9f4c];return _0x49b303;};'use strict';var _=require('lodash');var util=require(_0x5694('0x0'));var utils=require(_0x5694('0x1'));var dials={};function writeDB(_0x1595f3){utils['info'](util['format'](_0x5694('0x2'),_0x1595f3['uniqueid'],_0x1595f3['channel'],_0x1595f3['dialstring'],_0x1595f3['calleridnum'],_0x1595f3[_0x5694('0x3')],_0x1595f3[_0x5694('0x4')]));utils['request'](_0x5694('0x5'),_0x1595f3);delete dials[_0x1595f3[_0x5694('0x6')]];}exports['newexten']=function(_0xf25cc0){try{utils[_0x5694('0x7')](util[_0x5694('0x8')](_0x5694('0x9'),_0xf25cc0[_0x5694('0x6')]),_0xf25cc0);utils[_0x5694('0xa')](util[_0x5694('0x8')](_0x5694('0xb'),_0xf25cc0['uniqueid'],_0xf25cc0[_0x5694('0xc')],_0xf25cc0[_0x5694('0xd')]));if(_0xf25cc0[_0x5694('0xc')][_0x5694('0xe')]()==_0x5694('0xf')&&_[_0x5694('0x10')](_0xf25cc0[_0x5694('0xd')][_0x5694('0xe')](),_0x5694('0x11'))){var _0x306343=_0xf25cc0[_0x5694('0xd')][_0x5694('0x12')]('=');dials[_0xf25cc0[_0x5694('0x6')]]={'routeId':_0x306343[0x1]};}}catch(_0x499ec3){utils[_0x5694('0x13')](util[_0x5694('0x8')]('[%s][dials][newexten]',_0xf25cc0[_0x5694('0x6')]),_0x499ec3);}};exports['varset']=function(_0xeee888){try{utils[_0x5694('0x7')](util[_0x5694('0x8')](_0x5694('0x14'),_0xeee888['uniqueid']),_0xeee888);if(!_['isNil'](_0xeee888[_0x5694('0x15')]['outboundrouteid'])){utils['info'](util[_0x5694('0x8')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0xeee888[_0x5694('0x6')],_0xeee888[_0x5694('0x16')]));dials[_0xeee888[_0x5694('0x6')]]={'routeId':_0xeee888[_0x5694('0x16')]};}}catch(_0x49888e){utils[_0x5694('0x13')](util[_0x5694('0x8')](_0x5694('0x14'),_0xeee888[_0x5694('0x6')]),_0x49888e);}};exports[_0x5694('0x17')]=function(_0x135a60){try{if(!_['isNil'](dials[_0x135a60[_0x5694('0x6')]])){utils[_0x5694('0x7')](util['format'](_0x5694('0x18'),_0x135a60['uniqueid']),_0x135a60);dials[_0x135a60[_0x5694('0x6')]]=_[_0x5694('0x19')](dials[_0x135a60[_0x5694('0x6')]],_0x135a60);dials[_0x135a60[_0x5694('0x6')]][_0x5694('0x1a')]=utils['now']();dials[_0x135a60[_0x5694('0x6')]][_0x5694('0x1b')]=_0x5694('0x1c');utils[_0x5694('0xa')](util[_0x5694('0x8')](_0x5694('0x1d'),_0x135a60['uniqueid'],dials[_0x135a60['uniqueid']][_0x5694('0x1a')]));}}catch(_0x355ede){utils[_0x5694('0x13')](util['format']('[%s][dials][dialbegin]',_0x135a60[_0x5694('0x6')]),_0x355ede);}};exports[_0x5694('0x1e')]=function(_0x558a38){try{if(!_[_0x5694('0x1f')](dials[_0x558a38[_0x5694('0x6')]])){utils[_0x5694('0x7')](util[_0x5694('0x8')](_0x5694('0x20'),_0x558a38[_0x5694('0x6')]),_0x558a38);dials[_0x558a38[_0x5694('0x6')]][_0x5694('0x4')]=_0x558a38[_0x5694('0x4')];if(_0x558a38[_0x5694('0x4')]==_0x5694('0x21')){dials[_0x558a38[_0x5694('0x6')]]=_['assign'](dials[_0x558a38[_0x5694('0x6')]],_0x558a38);dials[_0x558a38['uniqueid']][_0x5694('0x22')]=utils['now']();dials[_0x558a38['uniqueid']]['lastevent']=_0x5694('0x23');utils['info'](util['format'](_0x5694('0x24'),_0x558a38[_0x5694('0x6')],_0x558a38[_0x5694('0x4')],dials[_0x558a38[_0x5694('0x6')]][_0x5694('0x22')]));}else{utils[_0x5694('0xa')](util[_0x5694('0x8')](_0x5694('0x25'),_0x558a38[_0x5694('0x6')],_0x558a38[_0x5694('0x4')]));}}}catch(_0x50ef92){utils[_0x5694('0x13')](util[_0x5694('0x8')](_0x5694('0x20'),_0x558a38[_0x5694('0x6')]),_0x50ef92);}};exports['hangup']=function(_0x1ffa40){try{if(!_[_0x5694('0x1f')](dials[_0x1ffa40[_0x5694('0x6')]])){utils[_0x5694('0x7')](util[_0x5694('0x8')]('[%s][dials][hangup]',_0x1ffa40[_0x5694('0x6')]),_0x1ffa40);utils[_0x5694('0xa')](util[_0x5694('0x8')](_0x5694('0x26'),_0x1ffa40[_0x5694('0x6')],_0x1ffa40[_0x5694('0x27')],_0x1ffa40[_0x5694('0x28')],_0x1ffa40[_0x5694('0x29')]));dials[_0x1ffa40['uniqueid']]=_['assign'](dials[_0x1ffa40[_0x5694('0x6')]],{'endtime':utils[_0x5694('0x2a')](),'lastevent':_0x5694('0x2b')});dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x2c')]=utils['diffTime'](dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x2d')],dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x1a')]);dials[_0x1ffa40[_0x5694('0x6')]]['holdtime']=utils[_0x5694('0x2e')](dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x22')]||dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x2d')],dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x1a')]);dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x2f')]=dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x22')]?utils[_0x5694('0x2e')](dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x2d')],dials[_0x1ffa40[_0x5694('0x6')]][_0x5694('0x22')]):0x0;writeDB(dials[_0x1ffa40[_0x5694('0x6')]]);}}catch(_0x128894){utils['error'](util[_0x5694('0x8')](_0x5694('0x30'),_0x1ffa40['uniqueid']),_0x128894);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index ef00541..58d98e0 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 _0x1e85=['queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','xdr','disabled','production','asterisk','port','username','password','keepConnected','info','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','managerevent','debug','device','devicestatechange','format','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]'];(function(_0xeaf29e,_0x4bdcad){var _0x44a815=function(_0x4ded7c){while(--_0x4ded7c){_0xeaf29e['push'](_0xeaf29e['shift']());}};_0x44a815(++_0x4bdcad);}(_0x1e85,0x116));var _0x51e8=function(_0x536418,_0x2cffec){_0x536418=_0x536418-0x0;var _0x2a6d6d=_0x1e85[_0x536418];return _0x2a6d6d;};var AsteriskManager=require(_0x51e8('0x0'));var config=require('../../config/environment');var utils=require(_0x51e8('0x1'));var util=require('util');var isXDREnabled=config[_0x51e8('0x2')]&&config[_0x51e8('0x2')][_0x51e8('0x3')]?!config[_0x51e8('0x2')][_0x51e8('0x3')]:!![];var isProduction=config['env']===_0x51e8('0x4')||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x51e8('0x5')][_0x51e8('0x6')],config['asterisk']['ip'],config[_0x51e8('0x5')][_0x51e8('0x7')],config[_0x51e8('0x5')][_0x51e8('0x8')],!![]);ami[_0x51e8('0x9')]();if(!isXDREnabled){utils[_0x51e8('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x51e8('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x51e8('0xb'));var queues=require(_0x51e8('0xc'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x51e8('0xd'));var transfers=require(_0x51e8('0xe'));var core=require('./core.controller');ami['on'](_0x51e8('0xf'),core[_0x51e8('0xf')]);ami['on'](_0x51e8('0x10'),core[_0x51e8('0x10')]);ami['on']('fullybooted',core[_0x51e8('0x11')]);ami['on']('error',core[_0x51e8('0x12')]);ami['on']('close',core['close']);ami['on'](_0x51e8('0x13'),core[_0x51e8('0x13')]);ami['on']('devicestatechange',function(_0xca479e){try{utils[_0x51e8('0x14')](util['format']('[%s][index][devicestatechange]',_0xca479e[_0x51e8('0x15')]),_0xca479e);members[_0x51e8('0x16')](_0xca479e);}catch(_0x4f7207){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x18'),_0xca479e[_0x51e8('0x15')]),_0x4f7207);}});ami['on']('agentcalled',function(_0x4cc691){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x19'),_0x4cc691[_0x51e8('0x1a')]),_0x4cc691);agents[_0x51e8('0x1b')](_0x4cc691);}catch(_0x39114c){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x19'),_0x4cc691[_0x51e8('0x1a')]),_0x39114c);}});ami['on']('agentringnoanswer',function(_0x5bf226){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x1c'),_0x5bf226[_0x51e8('0x1a')]),_0x5bf226);agents[_0x51e8('0x1d')](_0x5bf226);}catch(_0x515925){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x1c'),_0x5bf226[_0x51e8('0x1a')]),_0x515925);}});ami['on'](_0x51e8('0x1e'),function(_0x53dddc){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')]('[%s][index][agentconnect]',_0x53dddc[_0x51e8('0x1a')]),_0x53dddc);agents[_0x51e8('0x1e')](_0x53dddc);queues['agentconnect'](_0x53dddc);}catch(_0x326c7e){utils[_0x51e8('0x12')](util[_0x51e8('0x17')]('[%s][index][agentconnect]',_0x53dddc[_0x51e8('0x1a')]),_0x326c7e);}});ami['on'](_0x51e8('0x1f'),function(_0x41c51e){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x20'),_0x41c51e[_0x51e8('0x1a')]),_0x41c51e);agents[_0x51e8('0x1f')](_0x41c51e);queues[_0x51e8('0x1f')](_0x41c51e);members[_0x51e8('0x1f')](_0x41c51e);}catch(_0x3685c6){utils[_0x51e8('0x12')](util[_0x51e8('0x17')]('[%s][index][agentcomplete]',_0x41c51e[_0x51e8('0x1a')]),_0x3685c6);}});ami['on']('queuecallerabandon',function(_0x52d94d){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')]('[%s][index][queuecallerabandon]',_0x52d94d[_0x51e8('0x1a')]),_0x52d94d);agents[_0x51e8('0x21')](_0x52d94d);queues[_0x51e8('0x21')](_0x52d94d);}catch(_0x54e200){utils[_0x51e8('0x12')](util['format']('[%s][index][queuecallerabandon]',_0x52d94d[_0x51e8('0x1a')]),_0x54e200);}});ami['on'](_0x51e8('0x22'),function(_0x793c0d){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x23'),_0x793c0d['uniqueid']),_0x793c0d);queues[_0x51e8('0x22')](_0x793c0d);recordings[_0x51e8('0x22')](_0x793c0d);}catch(_0x2d4b06){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x23'),_0x793c0d[_0x51e8('0x1a')]),_0x2d4b06);}});ami['on']('queuecallerleave',function(_0x2f73af){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x24'),_0x2f73af[_0x51e8('0x1a')]),_0x2f73af);queues[_0x51e8('0x25')](_0x2f73af);}catch(_0x267ddb){utils['error'](util['format'](_0x51e8('0x24'),_0x2f73af[_0x51e8('0x1a')]),_0x267ddb);}});ami['on'](_0x51e8('0x26'),function(_0x4e4764){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x27'),_0x4e4764[_0x51e8('0x1a')]),_0x4e4764);queues['musiconholdstart'](_0x4e4764);calls[_0x51e8('0x26')](_0x4e4764);}catch(_0x58f26d){utils['error'](util[_0x51e8('0x17')](_0x51e8('0x27'),_0x4e4764[_0x51e8('0x1a')]),_0x58f26d);}});ami['on'](_0x51e8('0x28'),function(_0x4bc124){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x29'),_0x4bc124[_0x51e8('0x1a')]),_0x4bc124);queues['musiconholdstop'](_0x4bc124);calls['musiconholdstop'](_0x4bc124);}catch(_0xd1fe5d){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x29'),_0x4bc124['uniqueid']),_0xd1fe5d);}});ami['on'](_0x51e8('0x2a'),function(_0x211f9a){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x2b'),_0x211f9a[_0x51e8('0x1a')]),_0x211f9a);calls[_0x51e8('0x2a')](_0x211f9a);recordings['newstate'](_0x211f9a);}catch(_0x553c1f){utils[_0x51e8('0x12')](util['format'](_0x51e8('0x2b'),_0x211f9a['uniqueid']),_0x553c1f);}});ami['on']('hangup',function(_0x18ae4e){try{utils[_0x51e8('0x14')](util['format'](_0x51e8('0x2c'),_0x18ae4e[_0x51e8('0x1a')]),_0x18ae4e);calls[_0x51e8('0x2d')](_0x18ae4e);recordings[_0x51e8('0x2d')](_0x18ae4e);dials['hangup'](_0x18ae4e);agents[_0x51e8('0x2d')](_0x18ae4e);queues[_0x51e8('0x2d')](_0x18ae4e);}catch(_0x20dea0){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x2c'),_0x18ae4e[_0x51e8('0x1a')]),_0x20dea0);}});ami['on'](_0x51e8('0x2e'),function(_0x32a7b3){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x2f'),_0x32a7b3[_0x51e8('0x1a')]),_0x32a7b3);members[_0x51e8('0x2e')](_0x32a7b3);}catch(_0x3f9f91){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x2f'),_0x32a7b3[_0x51e8('0x1a')]),_0x3f9f91);}});ami['on'](_0x51e8('0x30'),function(_0x2d4b74){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x31'),_0x2d4b74[_0x51e8('0x1a')]),_0x2d4b74);queues[_0x51e8('0x30')](_0x2d4b74);agents[_0x51e8('0x30')](_0x2d4b74);transfers[_0x51e8('0x30')](_0x2d4b74);recordings['blindtransfer'](_0x2d4b74);}catch(_0x62eb16){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x31'),_0x2d4b74[_0x51e8('0x1a')]),_0x62eb16);}});ami['on'](_0x51e8('0x32'),function(_0x3fdd62){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x33'),_0x3fdd62[_0x51e8('0x34')]),_0x3fdd62);queues[_0x51e8('0x32')](_0x3fdd62);transfers[_0x51e8('0x32')](_0x3fdd62);agents[_0x51e8('0x32')](_0x3fdd62);calls[_0x51e8('0x32')](_0x3fdd62);}catch(_0x30aa69){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x33'),_0x3fdd62[_0x51e8('0x34')]),_0x30aa69);}});ami['on'](_0x51e8('0x35'),function(_0x3ed463){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x36'),_0x3ed463[_0x51e8('0x1a')]),_0x3ed463);queues[_0x51e8('0x35')](_0x3ed463);recordings['varset'](_0x3ed463);calls['varset'](_0x3ed463);dials[_0x51e8('0x35')](_0x3ed463);}catch(_0x392acb){utils[_0x51e8('0x12')](util[_0x51e8('0x17')]('[%s][index][varset]',_0x3ed463[_0x51e8('0x1a')]),_0x392acb);}});ami['on'](_0x51e8('0x37'),function(_0x591c1a){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x38'),_0x591c1a[_0x51e8('0x1a')]),_0x591c1a);calls[_0x51e8('0x37')](_0x591c1a);recordings[_0x51e8('0x37')](_0x591c1a);dials[_0x51e8('0x37')](_0x591c1a);}catch(_0x370378){utils['error'](util[_0x51e8('0x17')](_0x51e8('0x38'),_0x591c1a[_0x51e8('0x1a')]),_0x370378);}});ami['on'](_0x51e8('0x39'),function(_0x79c39f){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x3a'),_0x79c39f[_0x51e8('0x1a')]),_0x79c39f);calls[_0x51e8('0x39')](_0x79c39f);recordings[_0x51e8('0x39')](_0x79c39f);}catch(_0x4e6a79){utils[_0x51e8('0x12')](util['format'](_0x51e8('0x3a'),_0x79c39f[_0x51e8('0x1a')]),_0x4e6a79);}});ami['on'](_0x51e8('0x3b'),function(_0x583999){try{utils[_0x51e8('0x14')](util['format']('[%s][index][dialbegin]',_0x583999[_0x51e8('0x1a')]),_0x583999);dials[_0x51e8('0x3b')](_0x583999);}catch(_0x291ca8){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x3c'),_0x583999[_0x51e8('0x1a')]),_0x291ca8);}});ami['on'](_0x51e8('0x3d'),function(_0x676bb4){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x3e'),_0x676bb4[_0x51e8('0x1a')]),_0x676bb4);dials[_0x51e8('0x3d')](_0x676bb4);}catch(_0x41f032){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x3e'),_0x676bb4['uniqueid']),_0x41f032);}});} \ No newline at end of file +var _0x09d2=['port','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','uniqueid','agentringnoanswer','debug','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','production','local','asterisk'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x09d2,0x156));var _0x209d=function(_0x4a8ffc,_0x3ec208){_0x4a8ffc=_0x4a8ffc-0x0;var _0xa3dde1=_0x09d2[_0x4a8ffc];return _0xa3dde1;};var AsteriskManager=require(_0x209d('0x0'));var config=require(_0x209d('0x1'));var utils=require(_0x209d('0x2'));var util=require('util');var isXDREnabled=config[_0x209d('0x3')]&&config[_0x209d('0x3')][_0x209d('0x4')]?!config[_0x209d('0x3')]['disabled']:!![];var isProduction=config['env']===_0x209d('0x5')||![];var isLocalAsterisk=config[_0x209d('0x3')]&&config['xdr'][_0x209d('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x209d('0x7')][_0x209d('0x8')],config[_0x209d('0x7')]['ip'],config[_0x209d('0x7')][_0x209d('0x9')],config[_0x209d('0x7')][_0x209d('0xa')],!![]);ami[_0x209d('0xb')]();if(!isXDREnabled){utils['info'](_0x209d('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x209d('0xd')](_0x209d('0xe'));}else{var agents=require(_0x209d('0xf'));var calls=require(_0x209d('0x10'));var queues=require(_0x209d('0x11'));var recordings=require(_0x209d('0x12'));var members=require(_0x209d('0x13'));var dials=require(_0x209d('0x14'));var transfers=require('./transfers.controller');var core=require(_0x209d('0x15'));ami['on'](_0x209d('0x16'),core[_0x209d('0x16')]);ami['on'](_0x209d('0x17'),core[_0x209d('0x17')]);ami['on'](_0x209d('0x18'),core['fullybooted']);ami['on'](_0x209d('0x19'),core['error']);ami['on'](_0x209d('0x1a'),core[_0x209d('0x1a')]);ami['on'](_0x209d('0x1b'),core[_0x209d('0x1b')]);ami['on'](_0x209d('0x1c'),function(_0x4a59cb){try{utils['debug'](util['format'](_0x209d('0x1d'),_0x4a59cb[_0x209d('0x1e')]),_0x4a59cb);members[_0x209d('0x1c')](_0x4a59cb);}catch(_0x2ab909){utils[_0x209d('0x19')](util[_0x209d('0x1f')](_0x209d('0x1d'),_0x4a59cb[_0x209d('0x1e')]),_0x2ab909);}});ami['on'](_0x209d('0x20'),function(_0x1fd4f2){try{utils['debug'](util[_0x209d('0x1f')]('[%s][index][agentcalled]',_0x1fd4f2['uniqueid']),_0x1fd4f2);agents[_0x209d('0x20')](_0x1fd4f2);}catch(_0x595198){utils[_0x209d('0x19')](util[_0x209d('0x1f')]('[%s][index][agentcalled]',_0x1fd4f2[_0x209d('0x21')]),_0x595198);}});ami['on'](_0x209d('0x22'),function(_0x284108){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x24'),_0x284108[_0x209d('0x21')]),_0x284108);agents[_0x209d('0x22')](_0x284108);}catch(_0x5be013){utils['error'](util[_0x209d('0x1f')](_0x209d('0x24'),_0x284108['uniqueid']),_0x5be013);}});ami['on'](_0x209d('0x25'),function(_0x204885){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')]('[%s][index][agentconnect]',_0x204885[_0x209d('0x21')]),_0x204885);agents['agentconnect'](_0x204885);queues['agentconnect'](_0x204885);}catch(_0x3ce4d9){utils[_0x209d('0x19')](util['format'](_0x209d('0x26'),_0x204885[_0x209d('0x21')]),_0x3ce4d9);}});ami['on']('agentcomplete',function(_0x2422ef){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x27'),_0x2422ef['uniqueid']),_0x2422ef);agents[_0x209d('0x28')](_0x2422ef);queues[_0x209d('0x28')](_0x2422ef);members[_0x209d('0x28')](_0x2422ef);}catch(_0x51fa7b){utils[_0x209d('0x19')](util[_0x209d('0x1f')](_0x209d('0x27'),_0x2422ef[_0x209d('0x21')]),_0x51fa7b);}});ami['on'](_0x209d('0x29'),function(_0x76d169){try{utils[_0x209d('0x23')](util['format'](_0x209d('0x2a'),_0x76d169[_0x209d('0x21')]),_0x76d169);agents[_0x209d('0x29')](_0x76d169);queues[_0x209d('0x29')](_0x76d169);}catch(_0x1e716c){utils[_0x209d('0x19')](util[_0x209d('0x1f')]('[%s][index][queuecallerabandon]',_0x76d169['uniqueid']),_0x1e716c);}});ami['on'](_0x209d('0x2b'),function(_0x523296){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x2c'),_0x523296[_0x209d('0x21')]),_0x523296);queues[_0x209d('0x2b')](_0x523296);recordings[_0x209d('0x2b')](_0x523296);}catch(_0x4c5c9a){utils[_0x209d('0x19')](util[_0x209d('0x1f')]('[%s][index][queuecallerjoin]',_0x523296[_0x209d('0x21')]),_0x4c5c9a);}});ami['on'](_0x209d('0x2d'),function(_0x5747f2){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x2e'),_0x5747f2[_0x209d('0x21')]),_0x5747f2);queues[_0x209d('0x2d')](_0x5747f2);}catch(_0x340658){utils['error'](util[_0x209d('0x1f')]('[%s][index][queuecallerleave]',_0x5747f2[_0x209d('0x21')]),_0x340658);}});ami['on'](_0x209d('0x2f'),function(_0x57a41c){try{utils[_0x209d('0x23')](util['format'](_0x209d('0x30'),_0x57a41c[_0x209d('0x21')]),_0x57a41c);queues[_0x209d('0x2f')](_0x57a41c);calls['musiconholdstart'](_0x57a41c);}catch(_0x5b7e9a){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x57a41c['uniqueid']),_0x5b7e9a);}});ami['on'](_0x209d('0x31'),function(_0x34ce4e){try{utils[_0x209d('0x23')](util['format'](_0x209d('0x32'),_0x34ce4e[_0x209d('0x21')]),_0x34ce4e);queues['musiconholdstop'](_0x34ce4e);calls[_0x209d('0x31')](_0x34ce4e);}catch(_0x120f92){utils[_0x209d('0x19')](util['format']('[%s][index][musiconholdstop]',_0x34ce4e[_0x209d('0x21')]),_0x120f92);}});ami['on'](_0x209d('0x33'),function(_0x3b40c3){try{utils[_0x209d('0x23')](util['format'](_0x209d('0x34'),_0x3b40c3[_0x209d('0x21')]),_0x3b40c3);calls[_0x209d('0x33')](_0x3b40c3);recordings['newstate'](_0x3b40c3);}catch(_0x57e063){utils[_0x209d('0x19')](util[_0x209d('0x1f')]('[%s][index][newstate]',_0x3b40c3[_0x209d('0x21')]),_0x57e063);}});ami['on'](_0x209d('0x35'),function(_0x36fc26){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x36'),_0x36fc26['uniqueid']),_0x36fc26);calls['hangup'](_0x36fc26);recordings[_0x209d('0x35')](_0x36fc26);dials[_0x209d('0x35')](_0x36fc26);agents['hangup'](_0x36fc26);queues[_0x209d('0x35')](_0x36fc26);}catch(_0x5b8201){utils[_0x209d('0x19')](util[_0x209d('0x1f')](_0x209d('0x36'),_0x36fc26[_0x209d('0x21')]),_0x5b8201);}});ami['on'](_0x209d('0x37'),function(_0x350f9e){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x38'),_0x350f9e['uniqueid']),_0x350f9e);members[_0x209d('0x37')](_0x350f9e);}catch(_0x1bcc67){utils[_0x209d('0x19')](util[_0x209d('0x1f')](_0x209d('0x38'),_0x350f9e['uniqueid']),_0x1bcc67);}});ami['on'](_0x209d('0x39'),function(_0x9a65a2){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x3a'),_0x9a65a2[_0x209d('0x21')]),_0x9a65a2);queues[_0x209d('0x39')](_0x9a65a2);agents[_0x209d('0x39')](_0x9a65a2);transfers[_0x209d('0x39')](_0x9a65a2);recordings[_0x209d('0x39')](_0x9a65a2);}catch(_0x14bd1c){utils[_0x209d('0x19')](util[_0x209d('0x1f')]('[%s][index][blindtransfer]',_0x9a65a2[_0x209d('0x21')]),_0x14bd1c);}});ami['on'](_0x209d('0x3b'),function(_0xc23605){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x3c'),_0xc23605[_0x209d('0x3d')]),_0xc23605);queues['attendedtransfer'](_0xc23605);transfers[_0x209d('0x3b')](_0xc23605);agents[_0x209d('0x3b')](_0xc23605);calls['attendedtransfer'](_0xc23605);}catch(_0x4aa929){utils[_0x209d('0x19')](util[_0x209d('0x1f')]('[%s][index][attendedtransfer]',_0xc23605[_0x209d('0x3d')]),_0x4aa929);}});ami['on']('varset',function(_0x53d5d6){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x3e'),_0x53d5d6[_0x209d('0x21')]),_0x53d5d6);queues[_0x209d('0x3f')](_0x53d5d6);recordings[_0x209d('0x3f')](_0x53d5d6);calls[_0x209d('0x3f')](_0x53d5d6);dials[_0x209d('0x3f')](_0x53d5d6);}catch(_0x558a98){utils['error'](util['format'](_0x209d('0x3e'),_0x53d5d6[_0x209d('0x21')]),_0x558a98);}});ami['on']('newexten',function(_0x419413){try{utils['debug'](util['format']('[%s][index][newexten]',_0x419413[_0x209d('0x21')]),_0x419413);calls[_0x209d('0x40')](_0x419413);recordings[_0x209d('0x40')](_0x419413);dials[_0x209d('0x40')](_0x419413);}catch(_0x2752d3){utils['error'](util[_0x209d('0x1f')]('[%s][index][newexten]',_0x419413[_0x209d('0x21')]),_0x2752d3);}});ami['on'](_0x209d('0x41'),function(_0x3df743){try{utils[_0x209d('0x23')](util['format'](_0x209d('0x42'),_0x3df743['uniqueid']),_0x3df743);calls[_0x209d('0x41')](_0x3df743);recordings['newchannel'](_0x3df743);}catch(_0x128e80){utils[_0x209d('0x19')](util[_0x209d('0x1f')]('[%s][index][newchannel]',_0x3df743[_0x209d('0x21')]),_0x128e80);}});ami['on']('dialbegin',function(_0x53ff8d){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x43'),_0x53ff8d['uniqueid']),_0x53ff8d);dials['dialbegin'](_0x53ff8d);}catch(_0x34a389){utils['error'](util[_0x209d('0x1f')]('[%s]dialbegin',_0x53ff8d[_0x209d('0x21')]),_0x34a389);}});ami['on'](_0x209d('0x44'),function(_0x48c75b){try{utils[_0x209d('0x23')](util[_0x209d('0x1f')](_0x209d('0x45'),_0x48c75b['uniqueid']),_0x48c75b);dials[_0x209d('0x44')](_0x48c75b);}catch(_0x4d00de){utils[_0x209d('0x19')](util['format'](_0x209d('0x45'),_0x48c75b[_0x209d('0x21')]),_0x4d00de);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 0d81f79..d988648 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 _0xb01a=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','channel','split','data2','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','type','getUserByInterface','then','membername','internal','request','CreateMemberReport','getUserByName','name','catch','error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','state','BUSY','voice','TALKING','now'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb01a,0xe0));var _0xab01=function(_0xdc0c40,_0x18a854){_0xdc0c40=_0xdc0c40-0x0;var _0x12e045=_0xb01a[_0xdc0c40];return _0x12e045;};'use strict';var _=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var utils=require(_0xab01('0x2'));var members={};var exclude=[_0xab01('0x3'),_0xab01('0x4')];function writeDB(_0x189081){utils[_0xab01('0x5')](util[_0xab01('0x6')](_0xab01('0x7'),_0x189081[_0xab01('0x8')],_0x189081[_0xab01('0x9')],_0x189081['channel'],_0x189081['data2'],_0x189081['membername'],_0x189081[_0xab01('0xa')]));if(_0x189081['interface']){utils[_0xab01('0xb')](_0x189081[_0xab01('0x9')])[_0xab01('0xc')](function(_0x34ae06){if(_0x34ae06){_0x189081[_0xab01('0xd')]=_0x34ae06['name'];_0x189081[_0xab01('0xe')]=_0x34ae06[_0xab01('0xe')];utils[_0xab01('0xf')](_0xab01('0x10'),_0x189081);}else{utils[_0xab01('0x11')](_0x189081[_0xab01('0x9')]['split']('/')[0x1])[_0xab01('0xc')](function(_0x577075){if(_0x577075){_0x189081[_0xab01('0xd')]=_0x577075[_0xab01('0x12')];_0x189081[_0xab01('0xe')]=_0x577075[_0xab01('0xe')];utils[_0xab01('0xf')](_0xab01('0x10'),_0x189081);}});}})[_0xab01('0x13')](function(_0x58a121){utils[_0xab01('0x14')](util['format']('[%s][members][writeDB]',_0x189081[_0xab01('0x8')]),_0x58a121);});}delete members[_0x189081[_0xab01('0x9')]];}function startsWith(_0xd73f6a,_0x4f2e2d){return _[_0xab01('0x15')](_0xd73f6a,function(_0x1e366e){return _['startsWith'](_0x4f2e2d,_0x1e366e);});}exports[_0xab01('0x16')]=function(_0x4967a5){try{utils[_0xab01('0x17')](util['format'](_0xab01('0x18'),members[_0x4967a5['device']]?members[_0x4967a5['device']][_0xab01('0x8')]:_0x4967a5[_0xab01('0x19')]),_0x4967a5);utils[_0xab01('0x5')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4967a5[_0xab01('0x19')]]?members[_0x4967a5[_0xab01('0x19')]]['uniqueid']:_0x4967a5[_0xab01('0x19')],_0x4967a5[_0xab01('0x1a')],_0x4967a5[_0xab01('0x19')]));switch(_0x4967a5[_0xab01('0x1a')]){case'INUSE':case _0xab01('0x1b'):if(!startsWith(exclude,_0x4967a5[_0xab01('0x19')])){members[_0x4967a5[_0xab01('0x19')]]={'channel':_0xab01('0x1c'),'interface':_0x4967a5[_0xab01('0x19')],'type':_0xab01('0x1d'),'enterAt':utils[_0xab01('0x1e')](),'role':_0xab01('0x1f')};}break;case _0xab01('0x20'):if(!_[_0xab01('0x21')](members[_0x4967a5[_0xab01('0x19')]])){members[_0x4967a5['device']][_0xab01('0x22')]=utils[_0xab01('0x1e')]();members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x23')]=utils[_0xab01('0x24')](members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x22')],members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x25')]);if(members[_0x4967a5['device']][_0xab01('0x8')]){writeDB(members[_0x4967a5[_0xab01('0x19')]]);}}break;default:break;}}catch(_0x3cc5b9){utils[_0xab01('0x14')](util[_0xab01('0x6')](_0xab01('0x18'),members[_0x4967a5['device']]?members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x8')]:_0x4967a5[_0xab01('0x19')]),_0x3cc5b9);}};exports[_0xab01('0x26')]=function(_0x100375){try{if(!_[_0xab01('0x21')](members[_0x100375['interface']])){utils[_0xab01('0x17')](util[_0xab01('0x6')](_0xab01('0x27'),_0x100375[_0xab01('0x8')]),_0x100375);utils[_0xab01('0x5')](util[_0xab01('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x100375['uniqueid'],_0x100375['interface'],_0x100375[_0xab01('0x28')]));members[_0x100375[_0xab01('0x9')]]=_[_0xab01('0x29')](members[_0x100375[_0xab01('0x9')]],{'data4':_0x100375[_0xab01('0x28')],'uniqueid':_0x100375[_0xab01('0x8')]});}}catch(_0x123bd1){utils['error'](util[_0xab01('0x6')](_0xab01('0x27'),_0x100375[_0xab01('0x8')]),_0x123bd1);}};exports['cdr']=function(_0x378c97){try{utils[_0xab01('0x17')](util[_0xab01('0x6')](_0xab01('0x2a'),_0x378c97['uniqueid']),_0x378c97);if(_0x378c97[_0xab01('0x2b')]){var _0x13f8cb=_0x378c97[_0xab01('0x2b')][_0xab01('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x13f8cb])){members[_0x13f8cb]=_[_0xab01('0x29')](members[_0x13f8cb],{'data1':members[_0x13f8cb]['data1']||_0x378c97[_0xab01('0xa')],'data2':members[_0x13f8cb][_0xab01('0x2d')]||_0x378c97['source'],'data3':members[_0x13f8cb][_0xab01('0x2e')]||_0x378c97[_0xab01('0x2f')],'uniqueid':members[_0x13f8cb][_0xab01('0x8')]||_0x378c97['uniqueid']});utils['info'](util[_0xab01('0x6')](_0xab01('0x30'),_0x378c97[_0xab01('0x8')],members[_0x13f8cb][_0xab01('0x31')],members[_0x13f8cb][_0xab01('0x2d')],members[_0x13f8cb][_0xab01('0x2e')]));if(members[_0x13f8cb][_0xab01('0x22')]){writeDB(members[_0x13f8cb]);}}}if(_0x378c97[_0xab01('0x32')]){var _0x26c110=_0x378c97[_0xab01('0x32')][_0xab01('0x2c')]('-')[0x0];if(!_[_0xab01('0x21')](members[_0x26c110])){members[_0x26c110]=_[_0xab01('0x29')](members[_0x26c110],{'data1':members[_0x26c110]['data1']||_0x378c97[_0xab01('0xa')],'data2':members[_0x26c110][_0xab01('0x2d')]||_0x378c97['source'],'data3':members[_0x26c110][_0xab01('0x2e')]||_0x378c97[_0xab01('0x2f')],'uniqueid':members[_0x26c110][_0xab01('0x8')]||_0x378c97[_0xab01('0x8')]});utils[_0xab01('0x5')](util[_0xab01('0x6')](_0xab01('0x30'),_0x378c97[_0xab01('0x8')],members[_0x26c110][_0xab01('0x31')],members[_0x26c110][_0xab01('0x2d')],members[_0x26c110][_0xab01('0x2e')]));if(members[_0x26c110]['exitAt']){writeDB(members[_0x26c110]);}}}}catch(_0x31c740){utils['error'](util[_0xab01('0x6')]('[%s][members][cdr]',_0x378c97[_0xab01('0x8')]),_0x31c740);}}; \ No newline at end of file +var _0xb0bf=['data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','then','membername','name','internal','CreateMemberReport','getUserByName','split','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','error','[%s][members][agentcomplete]','info','assign','cdr','[%s][members][cdr]','data1','source'];(function(_0x2163e5,_0x1115a8){var _0x20195b=function(_0x19a0ef){while(--_0x19a0ef){_0x2163e5['push'](_0x2163e5['shift']());}};_0x20195b(++_0x1115a8);}(_0xb0bf,0xf4));var _0xfb0b=function(_0x3ee380,_0x575e48){_0x3ee380=_0x3ee380-0x0;var _0x7223bd=_0xb0bf[_0x3ee380];return _0x7223bd;};'use strict';var _=require('lodash');var util=require(_0xfb0b('0x0'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0xfb0b('0x1')];function writeDB(_0x49de17){utils['info'](util[_0xfb0b('0x2')](_0xfb0b('0x3'),_0x49de17[_0xfb0b('0x4')],_0x49de17[_0xfb0b('0x5')],_0x49de17[_0xfb0b('0x6')],_0x49de17[_0xfb0b('0x7')],_0x49de17['membername'],_0x49de17[_0xfb0b('0x8')]));if(_0x49de17[_0xfb0b('0x5')]){utils[_0xfb0b('0x9')](_0x49de17[_0xfb0b('0x5')])[_0xfb0b('0xa')](function(_0x5efb7d){if(_0x5efb7d){_0x49de17[_0xfb0b('0xb')]=_0x5efb7d[_0xfb0b('0xc')];_0x49de17[_0xfb0b('0xd')]=_0x5efb7d[_0xfb0b('0xd')];utils['request'](_0xfb0b('0xe'),_0x49de17);}else{utils[_0xfb0b('0xf')](_0x49de17[_0xfb0b('0x5')][_0xfb0b('0x10')]('/')[0x1])[_0xfb0b('0xa')](function(_0x5641c5){if(_0x5641c5){_0x49de17['membername']=_0x5641c5[_0xfb0b('0xc')];_0x49de17[_0xfb0b('0xd')]=_0x5641c5[_0xfb0b('0xd')];utils['request'](_0xfb0b('0xe'),_0x49de17);}});}})['catch'](function(_0x2bfe1d){utils['error'](util['format'](_0xfb0b('0x11'),_0x49de17['uniqueid']),_0x2bfe1d);});}delete members[_0x49de17['interface']];}function startsWith(_0x340119,_0x1988ae){return _[_0xfb0b('0x12')](_0x340119,function(_0x3384da){return _[_0xfb0b('0x13')](_0x1988ae,_0x3384da);});}exports[_0xfb0b('0x14')]=function(_0x4130a8){try{utils[_0xfb0b('0x15')](util[_0xfb0b('0x2')](_0xfb0b('0x16'),members[_0x4130a8[_0xfb0b('0x17')]]?members[_0x4130a8['device']]['uniqueid']:_0x4130a8['device']),_0x4130a8);utils['info'](util[_0xfb0b('0x2')](_0xfb0b('0x18'),members[_0x4130a8[_0xfb0b('0x17')]]?members[_0x4130a8[_0xfb0b('0x17')]][_0xfb0b('0x4')]:_0x4130a8[_0xfb0b('0x17')],_0x4130a8[_0xfb0b('0x19')],_0x4130a8[_0xfb0b('0x17')]));switch(_0x4130a8[_0xfb0b('0x19')]){case _0xfb0b('0x1a'):case'BUSY':if(!startsWith(exclude,_0x4130a8[_0xfb0b('0x17')])){members[_0x4130a8['device']]={'channel':_0xfb0b('0x1b'),'interface':_0x4130a8[_0xfb0b('0x17')],'type':_0xfb0b('0x1c'),'enterAt':utils['now'](),'role':_0xfb0b('0x1d')};}break;case _0xfb0b('0x1e'):if(!_[_0xfb0b('0x1f')](members[_0x4130a8[_0xfb0b('0x17')]])){members[_0x4130a8[_0xfb0b('0x17')]][_0xfb0b('0x20')]=utils[_0xfb0b('0x21')]();members[_0x4130a8[_0xfb0b('0x17')]][_0xfb0b('0x22')]=utils[_0xfb0b('0x23')](members[_0x4130a8[_0xfb0b('0x17')]]['exitAt'],members[_0x4130a8['device']]['enterAt']);if(members[_0x4130a8[_0xfb0b('0x17')]]['uniqueid']){writeDB(members[_0x4130a8[_0xfb0b('0x17')]]);}}break;default:break;}}catch(_0x5470f6){utils[_0xfb0b('0x24')](util['format']('[%s][members][devicestatechange]',members[_0x4130a8['device']]?members[_0x4130a8[_0xfb0b('0x17')]][_0xfb0b('0x4')]:_0x4130a8['device']),_0x5470f6);}};exports['agentcomplete']=function(_0x43e4c2){try{if(!_['isNil'](members[_0x43e4c2['interface']])){utils[_0xfb0b('0x15')](util['format'](_0xfb0b('0x25'),_0x43e4c2[_0xfb0b('0x4')]),_0x43e4c2);utils[_0xfb0b('0x26')](util[_0xfb0b('0x2')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x43e4c2[_0xfb0b('0x4')],_0x43e4c2[_0xfb0b('0x5')],_0x43e4c2['queue']));members[_0x43e4c2[_0xfb0b('0x5')]]=_[_0xfb0b('0x27')](members[_0x43e4c2[_0xfb0b('0x5')]],{'data4':_0x43e4c2['queue'],'uniqueid':_0x43e4c2[_0xfb0b('0x4')]});}}catch(_0x117c00){utils[_0xfb0b('0x24')](util['format']('[%s][members][agentcomplete]',_0x43e4c2[_0xfb0b('0x4')]),_0x117c00);}};exports[_0xfb0b('0x28')]=function(_0x3657ef){try{utils[_0xfb0b('0x15')](util['format'](_0xfb0b('0x29'),_0x3657ef['uniqueid']),_0x3657ef);if(_0x3657ef[_0xfb0b('0x6')]){var _0x4ad901=_0x3657ef[_0xfb0b('0x6')]['split']('-')[0x0];if(!_[_0xfb0b('0x1f')](members[_0x4ad901])){members[_0x4ad901]=_[_0xfb0b('0x27')](members[_0x4ad901],{'data1':members[_0x4ad901][_0xfb0b('0x2a')]||_0x3657ef[_0xfb0b('0x8')],'data2':members[_0x4ad901][_0xfb0b('0x7')]||_0x3657ef[_0xfb0b('0x2b')],'data3':members[_0x4ad901][_0xfb0b('0x2c')]||_0x3657ef[_0xfb0b('0x2d')],'uniqueid':members[_0x4ad901][_0xfb0b('0x4')]||_0x3657ef[_0xfb0b('0x4')]});utils[_0xfb0b('0x26')](util[_0xfb0b('0x2')](_0xfb0b('0x2e'),_0x3657ef[_0xfb0b('0x4')],members[_0x4ad901][_0xfb0b('0x2a')],members[_0x4ad901][_0xfb0b('0x7')],members[_0x4ad901][_0xfb0b('0x2c')]));if(members[_0x4ad901][_0xfb0b('0x20')]){writeDB(members[_0x4ad901]);}}}if(_0x3657ef['destinationchannel']){var _0x1e002e=_0x3657ef[_0xfb0b('0x2f')]['split']('-')[0x0];if(!_['isNil'](members[_0x1e002e])){members[_0x1e002e]=_[_0xfb0b('0x27')](members[_0x1e002e],{'data1':members[_0x1e002e][_0xfb0b('0x2a')]||_0x3657ef[_0xfb0b('0x8')],'data2':members[_0x1e002e][_0xfb0b('0x7')]||_0x3657ef[_0xfb0b('0x2b')],'data3':members[_0x1e002e][_0xfb0b('0x2c')]||_0x3657ef[_0xfb0b('0x2d')],'uniqueid':members[_0x1e002e][_0xfb0b('0x4')]||_0x3657ef[_0xfb0b('0x4')]});utils[_0xfb0b('0x26')](util[_0xfb0b('0x2')](_0xfb0b('0x2e'),_0x3657ef['uniqueid'],members[_0x1e002e][_0xfb0b('0x2a')],members[_0x1e002e][_0xfb0b('0x7')],members[_0x1e002e]['data3']));if(members[_0x1e002e]['exitAt']){writeDB(members[_0x1e002e]);}}}}catch(_0x272526){utils[_0xfb0b('0x24')](util[_0xfb0b('0x2')](_0xfb0b('0x29'),_0x3657ef['uniqueid']),_0x272526);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index bf6d5b8..577b1be 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 _0x5d9d=['connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','queuecallerenterreason','clone','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','request','transfereduniqueid','uniqueid','debug','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][queuecallerjoin]','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]'];(function(_0x34221b,_0x337748){var _0x5a421e=function(_0x14309c){while(--_0x14309c){_0x34221b['push'](_0x34221b['shift']());}};_0x5a421e(++_0x337748);}(_0x5d9d,0x9d));var _0xd5d9=function(_0x17d6c2,_0x3248b4){_0x17d6c2=_0x17d6c2-0x0;var _0x3e5168=_0x5d9d[_0x17d6c2];return _0x3e5168;};'use strict';var _=require(_0xd5d9('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x34c3aa){utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x2'),_0x34c3aa['uniqueid'],_0x34c3aa[_0xd5d9('0x3')],_0x34c3aa[_0xd5d9('0x4')],_0x34c3aa[_0xd5d9('0x5')],_0x34c3aa['calleridnum'],_0x34c3aa[_0xd5d9('0x6')],_0x34c3aa[_0xd5d9('0x7')]));if(_0x34c3aa[_0xd5d9('0x4')]){utils['getVoiceQueueByName'](_0x34c3aa[_0xd5d9('0x4')])[_0xd5d9('0x8')](function(_0x480dc6){if(_0x480dc6){_0x34c3aa[_0xd5d9('0x9')]=_0x480dc6['type'];}utils['request'](_0xd5d9('0xa'),_0x34c3aa);});}else{utils[_0xd5d9('0xb')]('CreateVoiceQueueReport',_0x34c3aa);}if(_0x34c3aa[_0xd5d9('0xc')]){delete queues[_0x34c3aa[_0xd5d9('0xc')]];}else{delete queues[_0x34c3aa[_0xd5d9('0xd')]];}}exports['queuecallerjoin']=function(_0x22f63b){try{utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')]('[%s][queues][queuecallerjoin]',_0x22f63b['uniqueid']),_0x22f63b);utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x10'),_0x22f63b['uniqueid'],_0x22f63b['queue'],_0x22f63b[_0xd5d9('0x11')]));queues[_0x22f63b[_0xd5d9('0xd')]]=_[_0xd5d9('0x12')](_0x22f63b,{'originalposition':_0x22f63b[_0xd5d9('0x11')],'queuecallerjoinAt':utils[_0xd5d9('0x13')](),'mohtime':0x0});}catch(_0x2c1885){utils['error'](util[_0xd5d9('0x1')](_0xd5d9('0x14'),_0x22f63b[_0xd5d9('0xd')]),_0x2c1885);}};exports['hangup']=function(_0x1cf5bf){try{if(!_['isNil'](queues[_0x1cf5bf['uniqueid']])){utils[_0xd5d9('0xe')](util['format'](_0xd5d9('0x15'),_0x1cf5bf['uniqueid']),_0x1cf5bf);if(queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x16')]){if(!queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x17')]&&!queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x18')]){queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x19')]=!![];queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x1a')]=utils[_0xd5d9('0x13')]();queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x7')]=_0xd5d9('0x1b');}utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x1c'),_0x1cf5bf[_0xd5d9('0xd')],queues[_0x1cf5bf['uniqueid']][_0xd5d9('0x1d')],queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x7')]));writeDB(queues[_0x1cf5bf[_0xd5d9('0xd')]]);}else if(queues[_0x1cf5bf['uniqueid']][_0xd5d9('0xc')]){utils[_0xd5d9('0xf')](util['format'](_0xd5d9('0x1e'),_0x1cf5bf[_0xd5d9('0xd')],queues[_0x1cf5bf['uniqueid']][_0xd5d9('0x1d')],queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0xc')]));queues[queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0xc')]]=queues[_0x1cf5bf[_0xd5d9('0xd')]];queues[queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0xc')]]['queuecallerenterreason']=0x2;delete queues[_0x1cf5bf['uniqueid']];}}}catch(_0x2762fc){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')]('[%s][queues][hangup]',_0x1cf5bf['uniqueid']),_0x2762fc);}};exports[_0xd5d9('0x20')]=function(_0x179360){try{utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x21'),_0x179360[_0xd5d9('0xd')]),_0x179360);if(!_[_0xd5d9('0x22')](_0x179360[_0xd5d9('0x23')]['queuestatus'])&&_0x179360[_0xd5d9('0x24')][_0xd5d9('0x25')]()!==_0xd5d9('0x26')){if(!_[_0xd5d9('0x22')](queues[_0x179360[_0xd5d9('0xd')]])){queues[_0x179360['uniqueid']]['queuecallerabandon']=![];queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x27')]=null;queues[_0x179360['uniqueid']][_0xd5d9('0x18')]=!![];queues[_0x179360[_0xd5d9('0xd')]]['queuecallerexitAt']=utils[_0xd5d9('0x13')]();queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x7')]=_0x179360['value'][_0xd5d9('0x25')]();utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x28'),_0x179360[_0xd5d9('0xd')],queues[_0x179360['uniqueid']]['name'],_0x179360['value'],queues[_0x179360['uniqueid']][_0xd5d9('0x7')]));writeDB(queues[_0x179360[_0xd5d9('0xd')]]);}}else if(!_['isNil'](_0x179360[_0xd5d9('0x23')][_0xd5d9('0x29')])){if(!_[_0xd5d9('0x22')](queues[_0x179360[_0xd5d9('0xd')]])&&!queues[_0x179360['uniqueid']][_0xd5d9('0x17')]){queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x17')]=![];queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x27')]=null;queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x18')]=!![];queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x2a')]=utils[_0xd5d9('0x13')]();queues[_0x179360['uniqueid']][_0xd5d9('0x7')]=_0xd5d9('0x2b');utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x179360['uniqueid'],queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x1d')],_0x179360[_0xd5d9('0x24')],queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x7')]));}}}catch(_0x1b36be){utils['error'](util[_0xd5d9('0x1')]('[%s][queues][varset]',_0x179360[_0xd5d9('0xd')]),_0x1b36be);}};exports['queuecallerabandon']=function(_0x191b7c){try{if(!_[_0xd5d9('0x22')](queues[_0x191b7c[_0xd5d9('0xd')]])){utils[_0xd5d9('0xe')](util['format'](_0xd5d9('0x2c'),_0x191b7c[_0xd5d9('0xd')]),_0x191b7c);queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x18')]=![];queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x2a')]=null;queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x17')]=!![];queues[_0x191b7c['uniqueid']][_0xd5d9('0x27')]=utils[_0xd5d9('0x13')]();queues[_0x191b7c['uniqueid']][_0xd5d9('0x7')]=_0xd5d9('0x2d');utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x2e'),_0x191b7c[_0xd5d9('0xd')],queues[_0x191b7c[_0xd5d9('0xd')]]['name'],queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x7')]));}}catch(_0x2ed92f){utils[_0xd5d9('0x1f')](util['format'](_0xd5d9('0x2c'),_0x191b7c[_0xd5d9('0xd')]),_0x2ed92f);}};exports[_0xd5d9('0x2f')]=function(_0x284d6f){try{if(!_[_0xd5d9('0x22')](queues[_0x284d6f[_0xd5d9('0xd')]])){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x30'),_0x284d6f[_0xd5d9('0xd')]),_0x284d6f);utils['info'](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x284d6f[_0xd5d9('0xd')],queues[_0x284d6f[_0xd5d9('0xd')]]['name'],_0x284d6f[_0xd5d9('0x31')],_0x284d6f['connectedlinename']));queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x2f')]=!![];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x16')]=utils[_0xd5d9('0x13')]();queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x32')]=utils[_0xd5d9('0x33')](queues[_0x284d6f['uniqueid']][_0xd5d9('0x16')],queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x34')]);queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x11')]=_0x284d6f['position'];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x35')]=_0x284d6f[_0xd5d9('0x35')];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x31')]=_0x284d6f[_0xd5d9('0x31')];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x36')]=_0x284d6f[_0xd5d9('0x36')];}}catch(_0x9c5125){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x30'),_0x284d6f[_0xd5d9('0xd')]),_0x9c5125);}};exports[_0xd5d9('0x37')]=function(_0x30b722){try{if(!_[_0xd5d9('0x22')](queues[_0x30b722['uniqueid']])){utils[_0xd5d9('0xe')](util['format'](_0xd5d9('0x38'),_0x30b722['uniqueid']),_0x30b722);utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x30b722[_0xd5d9('0xd')],queues[_0x30b722['uniqueid']]['name'],_0x30b722[_0xd5d9('0x39')],_0x30b722['destaccountcode']));queues[_0x30b722[_0xd5d9('0xd')]]['queuecallerabandon']=![];queues[_0x30b722['uniqueid']][_0xd5d9('0x17')]=![];queues[_0x30b722['uniqueid']][_0xd5d9('0x27')]=null;queues[_0x30b722['uniqueid']][_0xd5d9('0x18')]=![];queues[_0x30b722[_0xd5d9('0xd')]]['queuecallerexitreason']=null;queues[_0x30b722['uniqueid']][_0xd5d9('0x2a')]=null;queues[_0x30b722[_0xd5d9('0xd')]][_0xd5d9('0x3a')]=!![];queues[_0x30b722[_0xd5d9('0xd')]][_0xd5d9('0x6')]=_0x30b722[_0xd5d9('0x3b')];queues[_0x30b722[_0xd5d9('0xd')]][_0xd5d9('0x5')]=_0x30b722[_0xd5d9('0x39')];}}catch(_0x1e5b1d){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x38'),_0x30b722[_0xd5d9('0xd')]),_0x1e5b1d);}};exports[_0xd5d9('0x3c')]=function(_0xe3ed0d){try{if(!_['isNil'](queues[_0xe3ed0d[_0xd5d9('0xd')]])){if(queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x16')]){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x3d'),_0xe3ed0d[_0xd5d9('0xd')]),_0xe3ed0d);queues[_0xe3ed0d[_0xd5d9('0xd')]]['queuecallerabandon']=![];queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x17')]=![];queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x27')]=null;queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x18')]=![];queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x2a')]=null;queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x3a')]=!![];queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x5')]=_0xe3ed0d[_0xd5d9('0x39')];queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x19')]=!![];queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x1a')]=utils[_0xd5d9('0x13')]();if(_0xe3ed0d['reason']==_0xd5d9('0x3e')){if(!queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x3e')]){queues[_0xe3ed0d[_0xd5d9('0xd')]]['queuecallerexitreason']=_0xd5d9('0x3f');}}else{queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x7')]=_0xd5d9('0x40')+_0xe3ed0d[_0xd5d9('0x41')][_0xd5d9('0x25')]();}utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xe3ed0d[_0xd5d9('0xd')],queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x1d')],_0xe3ed0d[_0xd5d9('0x39')],queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x7')]));writeDB(queues[_0xe3ed0d[_0xd5d9('0xd')]]);}}}catch(_0x5baefa){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x3d'),_0xe3ed0d[_0xd5d9('0xd')]),_0x5baefa);}};exports[_0xd5d9('0x42')]=function(_0x4456db){try{if(!_['isNil'](queues[_0x4456db[_0xd5d9('0x43')]])){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x44'),_0x4456db[_0xd5d9('0xd')]),_0x4456db);queues[_0x4456db[_0xd5d9('0x43')]]['transfer']=!![];queues[_0x4456db['transfereeuniqueid']][_0xd5d9('0x45')]=_0xd5d9('0x46');queues[_0x4456db[_0xd5d9('0x43')]][_0xd5d9('0x47')]=_0x4456db['extension'];queues[_0x4456db['transfereeuniqueid']][_0xd5d9('0x48')]=_0x4456db[_0xd5d9('0x43')];queues[_0x4456db['transfereeuniqueid']][_0xd5d9('0x7')]=_0xd5d9('0x49');utils['info'](util['format'](_0xd5d9('0x4a'),_0x4456db['uniqueid'],queues[_0x4456db[_0xd5d9('0x43')]][_0xd5d9('0x1d')],_0x4456db['transfereeuniqueid'],_0x4456db['extension']));}}catch(_0x23cfe3){utils[_0xd5d9('0x1f')](util['format'](_0xd5d9('0x44'),_0x4456db[_0xd5d9('0xd')]),_0x23cfe3);}};exports[_0xd5d9('0x4b')]=function(_0xd193f6){try{utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x4c'),_0xd193f6['origtransfereruniqueid']),_0xd193f6);if(_0xd193f6[_0xd5d9('0x4d')]==_0xd193f6[_0xd5d9('0x4e')]){if(!_[_0xd5d9('0x22')](queues[_0xd193f6[_0xd5d9('0x4f')]])){utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x50'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x1d')],_0xd193f6[_0xd5d9('0x51')]));queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x3e')]=!![];queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x45')]=_0xd5d9('0x52');queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x47')]=_0xd193f6[_0xd5d9('0x51')];queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x48')]=_0xd193f6['origtransfereruniqueid'];queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xd5d9('0x22')](queues[_0xd193f6[_0xd5d9('0x4e')]])){if(_0xd193f6['transfereelinkedid']&&queues[_0xd193f6[_0xd5d9('0x53')]]){queues[_0xd193f6['transfereelinkedid']][_0xd5d9('0x54')]=0x1;queues[_0xd193f6['transfereeuniqueid']]=_[_0xd5d9('0x55')](queues[_0xd193f6[_0xd5d9('0x53')]]);queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0xc')]=_0xd193f6['transfertargetuniqueid'];queues[_0xd193f6[_0xd5d9('0x43')]][_0xd5d9('0x54')]=0x2;queues[_0xd193f6['transfereeuniqueid']]['calleridnum']=queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x56')];queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x57')]=queues[_0xd193f6['secondtransfererlinkedid']][_0xd5d9('0x57')];queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x34')]=utils[_0xd5d9('0x13')]();queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x16')]=utils[_0xd5d9('0x13')]();queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x32')]=0x0;queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x58')]=0x0;utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x59'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x43')]][_0xd5d9('0x1d')],queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x56')],queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x57')]));}else{utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x5a'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x4e')]]['name'],_0xd193f6[_0xd5d9('0x4f')]));queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0xc')]=_0xd193f6['secondtransfererlinkedid'];}}}else if(_0xd193f6[_0xd5d9('0x5b')]==_0xd193f6[_0xd5d9('0x4f')]){if(!_['isNil'](queues[_0xd193f6['origtransfererlinkedid']])){utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x5c'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6['origtransfererlinkedid']][_0xd5d9('0x1d')],_0xd193f6[_0xd5d9('0x5b')],_0xd193f6['secondtransfererexten']));queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x3e')]=!![];queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x45')]=_0xd5d9('0x52');queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x47')]=_0xd193f6[_0xd5d9('0x5d')];queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x48')]=_0xd193f6['secondtransfereruniqueid'];queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xd5d9('0x22')](queues[_0xd193f6['secondtransfererlinkedid']])){if(_0xd193f6[_0xd5d9('0x5e')]&&queues[_0xd193f6[_0xd5d9('0x5e')]]){queues[_0xd193f6[_0xd5d9('0x5e')]][_0xd5d9('0x54')]=0x1;queues[_0xd193f6[_0xd5d9('0x5f')]]=_[_0xd5d9('0x55')](queues[_0xd193f6['transfertargetlinkedid']]);queues[_0xd193f6[_0xd5d9('0x5f')]]['transfereduniqueid']=_0xd193f6[_0xd5d9('0x5f')];queues[_0xd193f6[_0xd5d9('0x5f')]]['queuecallerenterreason']=0x2;queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x56')]=queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x56')];queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x57')]=queues[_0xd193f6[_0xd5d9('0x4e')]]['calleridname'];queues[_0xd193f6[_0xd5d9('0x5f')]]['queuecallerjoinAt']=utils[_0xd5d9('0x13')]();queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x16')]=utils['now']();queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x32')]=0x0;queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x58')]=0x0;utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x60'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x1d')],queues[_0xd193f6['transfertargetuniqueid']]['transfereduniqueid'],queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x56')],queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x57')]));}else{utils[_0xd5d9('0xf')](util['format'](_0xd5d9('0x5a'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x4f')]]['name'],_0xd193f6[_0xd5d9('0x4e')]));queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0xc')]=_0xd193f6[_0xd5d9('0x4e')];}}}}catch(_0x3ca235){utils[_0xd5d9('0x1f')](util['format']('[%s][queues][attendedtransfer]',_0xd193f6[_0xd5d9('0x4d')]),_0x3ca235);}};exports[_0xd5d9('0x61')]=function(_0x433fc1){try{if(!_[_0xd5d9('0x22')](queues[_0x433fc1[_0xd5d9('0xd')]])){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x62'),_0x433fc1[_0xd5d9('0xd')]),_0x433fc1);queues[_0x433fc1[_0xd5d9('0xd')]][_0xd5d9('0x63')]=utils[_0xd5d9('0x13')]();utils[_0xd5d9('0xf')](util['format'](_0xd5d9('0x64'),_0x433fc1[_0xd5d9('0xd')],queues[_0x433fc1[_0xd5d9('0xd')]]['name'],queues[_0x433fc1[_0xd5d9('0xd')]][_0xd5d9('0x63')]));}}catch(_0x2b10d3){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x62'),_0x433fc1[_0xd5d9('0xd')]),_0x2b10d3);}};exports[_0xd5d9('0x65')]=function(_0x2deb49){try{if(!_['isNil'](queues[_0x2deb49[_0xd5d9('0xd')]])){if(!_['isNil'](queues[_0x2deb49[_0xd5d9('0xd')]][_0xd5d9('0x63')])){utils['debug'](util[_0xd5d9('0x1')]('[%s][queues][musiconholdstop]',_0x2deb49['uniqueid']),_0x2deb49);queues[_0x2deb49['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0xd5d9('0x13')](),queues[_0x2deb49[_0xd5d9('0xd')]]['musiconholdstartAt']);utils['info'](util['format'](_0xd5d9('0x66'),_0x2deb49[_0xd5d9('0xd')],queues[_0x2deb49[_0xd5d9('0xd')]][_0xd5d9('0x1d')],queues[_0x2deb49['uniqueid']][_0xd5d9('0x58')]));delete queues[_0x2deb49[_0xd5d9('0xd')]][_0xd5d9('0x63')];}}}catch(_0x273688){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')]('[%s][queues][musiconholdstop]',_0x2deb49[_0xd5d9('0xd')]),_0x273688);}}; \ No newline at end of file +var _0x2edd=['queuecallerabandon','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','queuecallerabandonAt','queuecallerexit','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','queuecallerexitAt','assigned','destaccountcode','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','isNil','[%s][queues][hangup]'];(function(_0x362105,_0xa593de){var _0x3c06c8=function(_0x129e5d){while(--_0x129e5d){_0x362105['push'](_0x362105['shift']());}};_0x3c06c8(++_0xa593de);}(_0x2edd,0xb2));var _0xd2ed=function(_0x3df445,_0x262ce7){_0x3df445=_0x3df445-0x0;var _0x52bb60=_0x2edd[_0x3df445];return _0x52bb60;};'use strict';var _=require(_0xd2ed('0x0'));var util=require(_0xd2ed('0x1'));var utils=require(_0xd2ed('0x2'));var queues={};function writeDB(_0x3d26af){utils['info'](util[_0xd2ed('0x3')](_0xd2ed('0x4'),_0x3d26af[_0xd2ed('0x5')],_0x3d26af['channel'],_0x3d26af[_0xd2ed('0x6')],_0x3d26af[_0xd2ed('0x7')],_0x3d26af[_0xd2ed('0x8')],_0x3d26af['accountcode'],_0x3d26af[_0xd2ed('0x9')]));if(_0x3d26af[_0xd2ed('0x6')]){utils[_0xd2ed('0xa')](_0x3d26af['queue'])[_0xd2ed('0xb')](function(_0x2e8cef){if(_0x2e8cef){_0x3d26af[_0xd2ed('0xc')]=_0x2e8cef[_0xd2ed('0xc')];}utils[_0xd2ed('0xd')]('CreateVoiceQueueReport',_0x3d26af);});}else{utils[_0xd2ed('0xd')](_0xd2ed('0xe'),_0x3d26af);}if(_0x3d26af['transfereduniqueid']){delete queues[_0x3d26af['transfereduniqueid']];}else{delete queues[_0x3d26af[_0xd2ed('0x5')]];}}exports[_0xd2ed('0xf')]=function(_0x156836){try{utils[_0xd2ed('0x10')](util[_0xd2ed('0x3')]('[%s][queues][queuecallerjoin]',_0x156836[_0xd2ed('0x5')]),_0x156836);utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x12'),_0x156836['uniqueid'],_0x156836['queue'],_0x156836[_0xd2ed('0x13')]));queues[_0x156836[_0xd2ed('0x5')]]=_[_0xd2ed('0x14')](_0x156836,{'originalposition':_0x156836['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x5b731e){utils[_0xd2ed('0x15')](util[_0xd2ed('0x3')]('[%s][queues][queuecallerjoin]',_0x156836[_0xd2ed('0x5')]),_0x5b731e);}};exports['hangup']=function(_0x3c4f16){try{if(!_[_0xd2ed('0x16')](queues[_0x3c4f16[_0xd2ed('0x5')]])){utils[_0xd2ed('0x10')](util[_0xd2ed('0x3')](_0xd2ed('0x17'),_0x3c4f16['uniqueid']),_0x3c4f16);if(queues[_0x3c4f16['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x3c4f16[_0xd2ed('0x5')]][_0xd2ed('0x18')]&&!queues[_0x3c4f16[_0xd2ed('0x5')]]['queuecallerexit']){queues[_0x3c4f16[_0xd2ed('0x5')]]['queuecallercomplete']=!![];queues[_0x3c4f16[_0xd2ed('0x5')]]['queuecallercompleteAt']=utils[_0xd2ed('0x19')]();queues[_0x3c4f16[_0xd2ed('0x5')]][_0xd2ed('0x9')]=_0xd2ed('0x1a');}utils['info'](util[_0xd2ed('0x3')](_0xd2ed('0x1b'),_0x3c4f16[_0xd2ed('0x5')],queues[_0x3c4f16[_0xd2ed('0x5')]][_0xd2ed('0x1c')],queues[_0x3c4f16[_0xd2ed('0x5')]][_0xd2ed('0x9')]));writeDB(queues[_0x3c4f16['uniqueid']]);}else if(queues[_0x3c4f16[_0xd2ed('0x5')]]['transfereduniqueid']){utils['info'](util[_0xd2ed('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x3c4f16[_0xd2ed('0x5')],queues[_0x3c4f16[_0xd2ed('0x5')]][_0xd2ed('0x1c')],queues[_0x3c4f16['uniqueid']][_0xd2ed('0x1d')]));queues[queues[_0x3c4f16[_0xd2ed('0x5')]][_0xd2ed('0x1d')]]=queues[_0x3c4f16[_0xd2ed('0x5')]];queues[queues[_0x3c4f16[_0xd2ed('0x5')]][_0xd2ed('0x1d')]][_0xd2ed('0x1e')]=0x2;delete queues[_0x3c4f16['uniqueid']];}}}catch(_0x29a06e){utils['error'](util[_0xd2ed('0x3')](_0xd2ed('0x17'),_0x3c4f16[_0xd2ed('0x5')]),_0x29a06e);}};exports['varset']=function(_0x44caef){try{utils['debug'](util['format'](_0xd2ed('0x1f'),_0x44caef[_0xd2ed('0x5')]),_0x44caef);if(!_[_0xd2ed('0x16')](_0x44caef[_0xd2ed('0x20')][_0xd2ed('0x21')])&&_0x44caef[_0xd2ed('0x22')]['toUpperCase']()!=='CONTINUE'){if(!_[_0xd2ed('0x16')](queues[_0x44caef[_0xd2ed('0x5')]])){queues[_0x44caef[_0xd2ed('0x5')]][_0xd2ed('0x18')]=![];queues[_0x44caef['uniqueid']][_0xd2ed('0x23')]=null;queues[_0x44caef[_0xd2ed('0x5')]][_0xd2ed('0x24')]=!![];queues[_0x44caef['uniqueid']]['queuecallerexitAt']=utils[_0xd2ed('0x19')]();queues[_0x44caef[_0xd2ed('0x5')]]['queuecallerexitreason']=_0x44caef[_0xd2ed('0x22')][_0xd2ed('0x25')]();utils['info'](util[_0xd2ed('0x3')](_0xd2ed('0x26'),_0x44caef['uniqueid'],queues[_0x44caef[_0xd2ed('0x5')]][_0xd2ed('0x1c')],_0x44caef[_0xd2ed('0x22')],queues[_0x44caef['uniqueid']][_0xd2ed('0x9')]));writeDB(queues[_0x44caef[_0xd2ed('0x5')]]);}}else if(!_[_0xd2ed('0x16')](_0x44caef[_0xd2ed('0x20')][_0xd2ed('0x27')])){if(!_[_0xd2ed('0x16')](queues[_0x44caef['uniqueid']])&&!queues[_0x44caef[_0xd2ed('0x5')]][_0xd2ed('0x18')]){queues[_0x44caef[_0xd2ed('0x5')]]['queuecallerabandon']=![];queues[_0x44caef[_0xd2ed('0x5')]]['queuecallerabandonAt']=null;queues[_0x44caef['uniqueid']][_0xd2ed('0x24')]=!![];queues[_0x44caef['uniqueid']]['queuecallerexitAt']=utils[_0xd2ed('0x19')]();queues[_0x44caef[_0xd2ed('0x5')]][_0xd2ed('0x9')]=_0xd2ed('0x28');utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x29'),_0x44caef['uniqueid'],queues[_0x44caef[_0xd2ed('0x5')]][_0xd2ed('0x1c')],_0x44caef[_0xd2ed('0x22')],queues[_0x44caef[_0xd2ed('0x5')]][_0xd2ed('0x9')]));}}}catch(_0x3abab6){utils[_0xd2ed('0x15')](util[_0xd2ed('0x3')](_0xd2ed('0x1f'),_0x44caef['uniqueid']),_0x3abab6);}};exports[_0xd2ed('0x18')]=function(_0x49858c){try{if(!_[_0xd2ed('0x16')](queues[_0x49858c[_0xd2ed('0x5')]])){utils[_0xd2ed('0x10')](util[_0xd2ed('0x3')](_0xd2ed('0x2a'),_0x49858c[_0xd2ed('0x5')]),_0x49858c);queues[_0x49858c[_0xd2ed('0x5')]][_0xd2ed('0x24')]=![];queues[_0x49858c[_0xd2ed('0x5')]]['queuecallerexitAt']=null;queues[_0x49858c[_0xd2ed('0x5')]]['queuecallerabandon']=!![];queues[_0x49858c['uniqueid']][_0xd2ed('0x23')]=utils[_0xd2ed('0x19')]();queues[_0x49858c[_0xd2ed('0x5')]]['queuecallerexitreason']='ABANDONED';utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x2b'),_0x49858c[_0xd2ed('0x5')],queues[_0x49858c[_0xd2ed('0x5')]][_0xd2ed('0x1c')],queues[_0x49858c[_0xd2ed('0x5')]][_0xd2ed('0x9')]));}}catch(_0x34ee01){utils['error'](util['format'](_0xd2ed('0x2a'),_0x49858c[_0xd2ed('0x5')]),_0x34ee01);}};exports[_0xd2ed('0x2c')]=function(_0x2a2380){try{if(!_[_0xd2ed('0x16')](queues[_0x2a2380[_0xd2ed('0x5')]])){utils['debug'](util['format']('[%s][queues][queuecallerleave]',_0x2a2380[_0xd2ed('0x5')]),_0x2a2380);utils['info'](util[_0xd2ed('0x3')](_0xd2ed('0x2d'),_0x2a2380[_0xd2ed('0x5')],queues[_0x2a2380[_0xd2ed('0x5')]][_0xd2ed('0x1c')],_0x2a2380['connectedlinenum'],_0x2a2380[_0xd2ed('0x2e')]));queues[_0x2a2380['uniqueid']][_0xd2ed('0x2c')]=!![];queues[_0x2a2380[_0xd2ed('0x5')]][_0xd2ed('0x2f')]=utils[_0xd2ed('0x19')]();queues[_0x2a2380[_0xd2ed('0x5')]][_0xd2ed('0x30')]=utils[_0xd2ed('0x31')](queues[_0x2a2380[_0xd2ed('0x5')]]['queuecallerleaveAt'],queues[_0x2a2380['uniqueid']][_0xd2ed('0x32')]);queues[_0x2a2380[_0xd2ed('0x5')]][_0xd2ed('0x13')]=_0x2a2380[_0xd2ed('0x13')];queues[_0x2a2380[_0xd2ed('0x5')]]['count']=_0x2a2380[_0xd2ed('0x33')];queues[_0x2a2380[_0xd2ed('0x5')]][_0xd2ed('0x34')]=_0x2a2380['connectedlinenum'];queues[_0x2a2380[_0xd2ed('0x5')]]['connectedlinename']=_0x2a2380[_0xd2ed('0x2e')];}}catch(_0x30ab2d){utils[_0xd2ed('0x15')](util[_0xd2ed('0x3')](_0xd2ed('0x35'),_0x2a2380[_0xd2ed('0x5')]),_0x30ab2d);}};exports['agentconnect']=function(_0x2b65fe){try{if(!_[_0xd2ed('0x16')](queues[_0x2b65fe[_0xd2ed('0x5')]])){utils[_0xd2ed('0x10')](util[_0xd2ed('0x3')]('[%s][queues][agentconnect]',_0x2b65fe['uniqueid']),_0x2b65fe);utils[_0xd2ed('0x11')](util['format'](_0xd2ed('0x36'),_0x2b65fe[_0xd2ed('0x5')],queues[_0x2b65fe['uniqueid']][_0xd2ed('0x1c')],_0x2b65fe[_0xd2ed('0x37')],_0x2b65fe['destaccountcode']));queues[_0x2b65fe[_0xd2ed('0x5')]][_0xd2ed('0x18')]=![];queues[_0x2b65fe['uniqueid']][_0xd2ed('0x18')]=![];queues[_0x2b65fe[_0xd2ed('0x5')]][_0xd2ed('0x23')]=null;queues[_0x2b65fe[_0xd2ed('0x5')]][_0xd2ed('0x24')]=![];queues[_0x2b65fe[_0xd2ed('0x5')]]['queuecallerexitreason']=null;queues[_0x2b65fe[_0xd2ed('0x5')]][_0xd2ed('0x38')]=null;queues[_0x2b65fe['uniqueid']][_0xd2ed('0x39')]=!![];queues[_0x2b65fe[_0xd2ed('0x5')]]['accountcode']=_0x2b65fe[_0xd2ed('0x3a')];queues[_0x2b65fe[_0xd2ed('0x5')]][_0xd2ed('0x7')]=_0x2b65fe[_0xd2ed('0x37')];}}catch(_0x1fb513){utils[_0xd2ed('0x15')](util[_0xd2ed('0x3')](_0xd2ed('0x3b'),_0x2b65fe[_0xd2ed('0x5')]),_0x1fb513);}};exports[_0xd2ed('0x3c')]=function(_0x3b29d4){try{if(!_['isNil'](queues[_0x3b29d4[_0xd2ed('0x5')]])){if(queues[_0x3b29d4['uniqueid']][_0xd2ed('0x2f')]){utils[_0xd2ed('0x10')](util[_0xd2ed('0x3')](_0xd2ed('0x3d'),_0x3b29d4[_0xd2ed('0x5')]),_0x3b29d4);queues[_0x3b29d4[_0xd2ed('0x5')]]['queuecallerabandon']=![];queues[_0x3b29d4[_0xd2ed('0x5')]]['queuecallerabandon']=![];queues[_0x3b29d4[_0xd2ed('0x5')]][_0xd2ed('0x23')]=null;queues[_0x3b29d4[_0xd2ed('0x5')]][_0xd2ed('0x24')]=![];queues[_0x3b29d4[_0xd2ed('0x5')]]['queuecallerexitAt']=null;queues[_0x3b29d4[_0xd2ed('0x5')]][_0xd2ed('0x39')]=!![];queues[_0x3b29d4[_0xd2ed('0x5')]][_0xd2ed('0x7')]=_0x3b29d4[_0xd2ed('0x37')];queues[_0x3b29d4['uniqueid']][_0xd2ed('0x3e')]=!![];queues[_0x3b29d4[_0xd2ed('0x5')]][_0xd2ed('0x3f')]=utils[_0xd2ed('0x19')]();if(_0x3b29d4[_0xd2ed('0x40')]==_0xd2ed('0x41')){if(!queues[_0x3b29d4['uniqueid']][_0xd2ed('0x41')]){queues[_0x3b29d4['uniqueid']][_0xd2ed('0x9')]=_0xd2ed('0x42');}}else{queues[_0x3b29d4[_0xd2ed('0x5')]]['queuecallerexitreason']='COMPLETEDBY'+_0x3b29d4['reason']['toUpperCase']();}utils['info'](util[_0xd2ed('0x3')](_0xd2ed('0x43'),_0x3b29d4[_0xd2ed('0x5')],queues[_0x3b29d4[_0xd2ed('0x5')]][_0xd2ed('0x1c')],_0x3b29d4[_0xd2ed('0x37')],queues[_0x3b29d4[_0xd2ed('0x5')]][_0xd2ed('0x9')]));writeDB(queues[_0x3b29d4[_0xd2ed('0x5')]]);}}}catch(_0x349f4b){utils[_0xd2ed('0x15')](util['format'](_0xd2ed('0x3d'),_0x3b29d4['uniqueid']),_0x349f4b);}};exports[_0xd2ed('0x44')]=function(_0x4ea41d){try{if(!_[_0xd2ed('0x16')](queues[_0x4ea41d[_0xd2ed('0x45')]])){utils[_0xd2ed('0x10')](util[_0xd2ed('0x3')]('[%s][queues][blindtransfer]',_0x4ea41d[_0xd2ed('0x5')]),_0x4ea41d);queues[_0x4ea41d['transfereeuniqueid']]['transfer']=!![];queues[_0x4ea41d[_0xd2ed('0x45')]][_0xd2ed('0x46')]=_0xd2ed('0x47');queues[_0x4ea41d[_0xd2ed('0x45')]]['transferexten']=_0x4ea41d[_0xd2ed('0x48')];queues[_0x4ea41d[_0xd2ed('0x45')]][_0xd2ed('0x49')]=_0x4ea41d['transfereeuniqueid'];queues[_0x4ea41d[_0xd2ed('0x45')]][_0xd2ed('0x9')]=_0xd2ed('0x4a');utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x4b'),_0x4ea41d['uniqueid'],queues[_0x4ea41d[_0xd2ed('0x45')]][_0xd2ed('0x1c')],_0x4ea41d[_0xd2ed('0x45')],_0x4ea41d['extension']));}}catch(_0x14691c){utils[_0xd2ed('0x15')](util[_0xd2ed('0x3')]('[%s][queues][blindtransfer]',_0x4ea41d['uniqueid']),_0x14691c);}};exports[_0xd2ed('0x4c')]=function(_0x2e9d9f){try{utils['debug'](util[_0xd2ed('0x3')](_0xd2ed('0x4d'),_0x2e9d9f['origtransfereruniqueid']),_0x2e9d9f);if(_0x2e9d9f[_0xd2ed('0x4e')]==_0x2e9d9f[_0xd2ed('0x4f')]){if(!_[_0xd2ed('0x16')](queues[_0x2e9d9f['secondtransfererlinkedid']])){utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x50'),_0x2e9d9f[_0xd2ed('0x4e')],queues[_0x2e9d9f[_0xd2ed('0x51')]][_0xd2ed('0x1c')],_0x2e9d9f['origtransfererexten']));queues[_0x2e9d9f[_0xd2ed('0x51')]][_0xd2ed('0x41')]=!![];queues[_0x2e9d9f[_0xd2ed('0x51')]]['transfertype']=_0xd2ed('0x52');queues[_0x2e9d9f[_0xd2ed('0x51')]][_0xd2ed('0x53')]=_0x2e9d9f[_0xd2ed('0x54')];queues[_0x2e9d9f[_0xd2ed('0x51')]][_0xd2ed('0x49')]=_0x2e9d9f[_0xd2ed('0x4e')];queues[_0x2e9d9f[_0xd2ed('0x51')]][_0xd2ed('0x9')]=_0xd2ed('0x55');}if(!_[_0xd2ed('0x16')](queues[_0x2e9d9f['origtransfererlinkedid']])){if(_0x2e9d9f['transfereelinkedid']&&queues[_0x2e9d9f[_0xd2ed('0x56')]]){queues[_0x2e9d9f[_0xd2ed('0x56')]]['queuecallerenterreason']=0x1;queues[_0x2e9d9f['transfereeuniqueid']]=_['clone'](queues[_0x2e9d9f[_0xd2ed('0x56')]]);queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x1d')]=_0x2e9d9f['transfertargetuniqueid'];queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x1e')]=0x2;queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x8')]=queues[_0x2e9d9f['secondtransfererlinkedid']]['calleridnum'];queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x57')]=queues[_0x2e9d9f[_0xd2ed('0x51')]]['calleridname'];queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x32')]=utils[_0xd2ed('0x19')]();queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x2f')]=utils[_0xd2ed('0x19')]();queues[_0x2e9d9f['transfereeuniqueid']][_0xd2ed('0x30')]=0x0;queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x58')]=0x0;utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x59'),_0x2e9d9f[_0xd2ed('0x4e')],queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x1c')],queues[_0x2e9d9f['transfereeuniqueid']][_0xd2ed('0x8')],queues[_0x2e9d9f[_0xd2ed('0x45')]][_0xd2ed('0x57')]));}else{utils[_0xd2ed('0x11')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2e9d9f[_0xd2ed('0x4e')],queues[_0x2e9d9f['origtransfererlinkedid']]['name'],_0x2e9d9f[_0xd2ed('0x51')]));queues[_0x2e9d9f['origtransfererlinkedid']][_0xd2ed('0x1d')]=_0x2e9d9f[_0xd2ed('0x51')];}}}else if(_0x2e9d9f['secondtransfereruniqueid']==_0x2e9d9f[_0xd2ed('0x51')]){if(!_['isNil'](queues[_0x2e9d9f[_0xd2ed('0x4f')]])){utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x5a'),_0x2e9d9f[_0xd2ed('0x4e')],queues[_0x2e9d9f[_0xd2ed('0x4f')]][_0xd2ed('0x1c')],_0x2e9d9f[_0xd2ed('0x5b')],_0x2e9d9f[_0xd2ed('0x5c')]));queues[_0x2e9d9f[_0xd2ed('0x4f')]]['transfer']=!![];queues[_0x2e9d9f['origtransfererlinkedid']][_0xd2ed('0x46')]=_0xd2ed('0x52');queues[_0x2e9d9f[_0xd2ed('0x4f')]]['transferexten']=_0x2e9d9f[_0xd2ed('0x5c')];queues[_0x2e9d9f[_0xd2ed('0x4f')]]['transferuniqueid']=_0x2e9d9f[_0xd2ed('0x5b')];queues[_0x2e9d9f[_0xd2ed('0x4f')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xd2ed('0x16')](queues[_0x2e9d9f[_0xd2ed('0x51')]])){if(_0x2e9d9f[_0xd2ed('0x5d')]&&queues[_0x2e9d9f[_0xd2ed('0x5d')]]){queues[_0x2e9d9f['transfertargetlinkedid']][_0xd2ed('0x1e')]=0x1;queues[_0x2e9d9f[_0xd2ed('0x5e')]]=_['clone'](queues[_0x2e9d9f['transfertargetlinkedid']]);queues[_0x2e9d9f[_0xd2ed('0x5e')]]['transfereduniqueid']=_0x2e9d9f[_0xd2ed('0x5e')];queues[_0x2e9d9f[_0xd2ed('0x5e')]][_0xd2ed('0x1e')]=0x2;queues[_0x2e9d9f[_0xd2ed('0x5e')]][_0xd2ed('0x8')]=queues[_0x2e9d9f[_0xd2ed('0x4f')]][_0xd2ed('0x8')];queues[_0x2e9d9f[_0xd2ed('0x5e')]][_0xd2ed('0x57')]=queues[_0x2e9d9f[_0xd2ed('0x4f')]][_0xd2ed('0x57')];queues[_0x2e9d9f[_0xd2ed('0x5e')]][_0xd2ed('0x32')]=utils[_0xd2ed('0x19')]();queues[_0x2e9d9f[_0xd2ed('0x5e')]][_0xd2ed('0x2f')]=utils[_0xd2ed('0x19')]();queues[_0x2e9d9f[_0xd2ed('0x5e')]]['holdtime']=0x0;queues[_0x2e9d9f['transfertargetuniqueid']][_0xd2ed('0x58')]=0x0;utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x5f'),_0x2e9d9f[_0xd2ed('0x4e')],queues[_0x2e9d9f[_0xd2ed('0x5e')]][_0xd2ed('0x1c')],queues[_0x2e9d9f['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x2e9d9f['transfertargetuniqueid']][_0xd2ed('0x8')],queues[_0x2e9d9f['transfertargetuniqueid']]['calleridname']));}else{utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x60'),_0x2e9d9f[_0xd2ed('0x4e')],queues[_0x2e9d9f['secondtransfererlinkedid']][_0xd2ed('0x1c')],_0x2e9d9f[_0xd2ed('0x4f')]));queues[_0x2e9d9f[_0xd2ed('0x51')]][_0xd2ed('0x1d')]=_0x2e9d9f[_0xd2ed('0x4f')];}}}}catch(_0x58bedb){utils['error'](util[_0xd2ed('0x3')](_0xd2ed('0x4d'),_0x2e9d9f[_0xd2ed('0x4e')]),_0x58bedb);}};exports['musiconholdstart']=function(_0x140100){try{if(!_[_0xd2ed('0x16')](queues[_0x140100[_0xd2ed('0x5')]])){utils[_0xd2ed('0x10')](util[_0xd2ed('0x3')](_0xd2ed('0x61'),_0x140100['uniqueid']),_0x140100);queues[_0x140100['uniqueid']]['musiconholdstartAt']=utils[_0xd2ed('0x19')]();utils[_0xd2ed('0x11')](util[_0xd2ed('0x3')](_0xd2ed('0x62'),_0x140100[_0xd2ed('0x5')],queues[_0x140100['uniqueid']][_0xd2ed('0x1c')],queues[_0x140100[_0xd2ed('0x5')]][_0xd2ed('0x63')]));}}catch(_0x1c5cf8){utils[_0xd2ed('0x15')](util[_0xd2ed('0x3')](_0xd2ed('0x61'),_0x140100[_0xd2ed('0x5')]),_0x1c5cf8);}};exports['musiconholdstop']=function(_0x366cc4){try{if(!_[_0xd2ed('0x16')](queues[_0x366cc4['uniqueid']])){if(!_['isNil'](queues[_0x366cc4[_0xd2ed('0x5')]][_0xd2ed('0x63')])){utils['debug'](util[_0xd2ed('0x3')](_0xd2ed('0x64'),_0x366cc4[_0xd2ed('0x5')]),_0x366cc4);queues[_0x366cc4[_0xd2ed('0x5')]]['mohtime']+=utils['diffTime'](utils[_0xd2ed('0x19')](),queues[_0x366cc4[_0xd2ed('0x5')]]['musiconholdstartAt']);utils[_0xd2ed('0x11')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x366cc4[_0xd2ed('0x5')],queues[_0x366cc4[_0xd2ed('0x5')]]['name'],queues[_0x366cc4[_0xd2ed('0x5')]][_0xd2ed('0x58')]));delete queues[_0x366cc4[_0xd2ed('0x5')]][_0xd2ed('0x63')];}}}catch(_0x140517){utils['error'](util['format'](_0xd2ed('0x64'),_0x366cc4[_0xd2ed('0x5')]),_0x140517);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 7d662e4..dc48079 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 _0x5808=['debug','[%s][recordings][newstate]','channelstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','context','exten','channel'];(function(_0x469510,_0x1bceac){var _0x3bc121=function(_0x5c300c){while(--_0x5c300c){_0x469510['push'](_0x469510['shift']());}};_0x3bc121(++_0x1bceac);}(_0x5808,0x1a6));var _0x8580=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0x5808[_0x356e8d];return _0x39e65a;};'use strict';var _=require(_0x8580('0x0'));var util=require(_0x8580('0x1'));var utils=require(_0x8580('0x2'));var transfers=require(_0x8580('0x3'));var recordings={};function writeDB(_0x4795b9){var _0x2adc7c;utils[_0x8580('0x4')](util[_0x8580('0x5')](_0x8580('0x6'),_0x4795b9['uniqueid']));if(transfers[_0x8580('0x7')][_0x4795b9[_0x8580('0x8')]]){_0x2adc7c=_0x4795b9[_0x8580('0x8')];_0x4795b9['uniqueid']=transfers[_0x8580('0x7')][_0x4795b9[_0x8580('0x8')]][_0x8580('0x9')];}if(_0x4795b9[_0x8580('0xa')]){utils[_0x8580('0xb')](_0x4795b9[_0x8580('0xa')])[_0x8580('0xc')](function(_0x3225d6){if(_0x3225d6){_0x4795b9[_0x8580('0xd')]=_0x3225d6['name'];_0x4795b9['UserId']=_0x3225d6['id'];}utils[_0x8580('0xe')](_0x8580('0xf'),_0x4795b9);});}else{utils[_0x8580('0xe')](_0x8580('0xf'),_0x4795b9);}if(_0x2adc7c)delete transfers[_0x8580('0x7')][_0x2adc7c];}exports[_0x8580('0x10')]=function(_0x118410){try{utils['debug'](util[_0x8580('0x5')](_0x8580('0x11'),_0x118410['uniqueid']),_0x118410);if(_0x118410['uniqueid']==_0x118410[_0x8580('0x12')]){utils[_0x8580('0x4')](util[_0x8580('0x5')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x118410['uniqueid'],_0x118410[_0x8580('0x13')],_0x118410['exten']));recordings[_0x118410[_0x8580('0x8')]]={'uniqueid':_0x118410[_0x8580('0x8')],'accountcode':_0x118410[_0x8580('0xa')],'exten':_0x118410[_0x8580('0x14')],'context':_0x118410[_0x8580('0x13')],'channel':_0x118410[_0x8580('0x15')],'monitors':[]};}}catch(_0xc7348a){utils['error'](util[_0x8580('0x5')](_0x8580('0x11'),_0x118410[_0x8580('0x8')]),_0xc7348a);}};exports['newstate']=function(_0x1b1b5b){try{utils[_0x8580('0x16')](util[_0x8580('0x5')](_0x8580('0x17'),_0x1b1b5b['uniqueid']),_0x1b1b5b);if(!_['isNil'](recordings[_0x1b1b5b[_0x8580('0x8')]])&&_0x1b1b5b[_0x8580('0x18')]==0x6){utils[_0x8580('0x4')](util[_0x8580('0x5')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1b1b5b[_0x8580('0x8')],_0x1b1b5b['context'],_0x1b1b5b[_0x8580('0x15')]));}else if(!_[_0x8580('0x19')](recordings[_0x1b1b5b[_0x8580('0x12')]])&&_0x1b1b5b[_0x8580('0x18')]==0x6&&_0x1b1b5b[_0x8580('0x13')]!=_0x8580('0x1a')){utils['info'](util[_0x8580('0x5')](_0x8580('0x1b'),_0x1b1b5b[_0x8580('0x8')],_0x1b1b5b[_0x8580('0x12')],_0x1b1b5b['context'],_0x1b1b5b['channel']));recordings[_0x1b1b5b[_0x8580('0x12')]][_0x8580('0xa')]=_0x1b1b5b[_0x8580('0xa')];}}catch(_0x16e667){utils[_0x8580('0x1c')](util[_0x8580('0x5')](_0x8580('0x17'),_0x1b1b5b[_0x8580('0x8')]),_0x16e667);}};exports[_0x8580('0x1d')]=function(_0x2ee78a){try{if(!_['isNil'](_0x2ee78a[_0x8580('0x1e')])&&!_[_0x8580('0x19')](_0x2ee78a[_0x8580('0x1e')][_0x8580('0x1f')])){utils[_0x8580('0x16')](util['format'](_0x8580('0x20'),_0x2ee78a[_0x8580('0x8')]),_0x2ee78a);utils[_0x8580('0x4')](util[_0x8580('0x5')](_0x8580('0x21'),_0x2ee78a[_0x8580('0x8')],_0x2ee78a[_0x8580('0x1e')],_0x2ee78a[_0x8580('0x22')]));if(_[_0x8580('0x23')](_0x2ee78a['value'],_0x8580('0x24'))){_0x2ee78a['value']=_0x2ee78a[_0x8580('0x22')][_0x8580('0x25')](_0x8580('0x24'),_0x8580('0x26'));}if(recordings[_0x2ee78a[_0x8580('0x12')]]){var _0x4fd8db=_[_0x8580('0x27')](recordings[_0x2ee78a[_0x8580('0x12')]]['monitors'],{'value':_0x2ee78a['value']});if(_[_0x8580('0x19')](_0x4fd8db)){recordings[_0x2ee78a['linkedid']][_0x8580('0x28')]['push']({'value':_0x2ee78a[_0x8580('0x22')]});}}}}catch(_0x2e0aa0){utils[_0x8580('0x1c')](util['format']('[%s][recordings][varset]',_0x2ee78a[_0x8580('0x8')]),_0x2e0aa0);}};exports[_0x8580('0x29')]=function(_0x538075){try{if(!_['isNil'](recordings[_0x538075[_0x8580('0x8')]])){utils[_0x8580('0x16')](util[_0x8580('0x5')](_0x8580('0x2a'),_0x538075[_0x8580('0x8')]),_0x538075);utils['info'](util['format'](_0x8580('0x2b'),_0x538075['uniqueid'],_0x538075[_0x8580('0x2c')],_0x538075[_0x8580('0x2d')],_0x538075[_0x8580('0x2e')]));recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x2c')]=_0x538075[_0x8580('0x2c')];recordings[_0x538075['uniqueid']][_0x8580('0x2d')]=_0x538075[_0x8580('0x2d')];recordings[_0x538075['uniqueid']][_0x8580('0x2f')]=_0x538075[_0x8580('0x2f')];recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x30')]=_0x538075[_0x8580('0x30')];if(recordings[_0x538075['uniqueid']][_0x8580('0x31')]==_0x8580('0x32')&&recordings[_0x538075[_0x8580('0x8')]]['accountcode']){recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x2f')]=recordings[_0x538075[_0x8580('0x8')]]['accountcode'];recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x30')]='';}recordings[_0x538075[_0x8580('0x8')]]['monitors'][_0x8580('0x33')](function(_0x4d7eea){var _0x6f13ce=_['clone'](recordings[_0x538075[_0x8580('0x8')]]);_0x6f13ce['value']=_0x4d7eea[_0x8580('0x22')];writeDB(_0x6f13ce);});delete recordings[_0x538075[_0x8580('0x8')]];}}catch(_0x1ec42f){utils[_0x8580('0x1c')](util[_0x8580('0x5')](_0x8580('0x2a'),_0x538075[_0x8580('0x8')]),_0x1ec42f);}};exports[_0x8580('0x34')]=function(_0x156798){try{if(!_[_0x8580('0x19')](recordings[_0x156798['uniqueid']])){utils[_0x8580('0x16')](util['format'](_0x8580('0x35'),_0x156798[_0x8580('0x8')]),_0x156798);utils[_0x8580('0x4')](util[_0x8580('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x156798[_0x8580('0x8')],_0x156798[_0x8580('0x36')],_0x156798[_0x8580('0x37')]));if(_0x156798[_0x8580('0x36')][_0x8580('0x38')]()=='set'&&_[_0x8580('0x39')](_0x156798[_0x8580('0x37')][_0x8580('0x38')](),_0x8580('0x3a'))){var _0x3e901d=_0x156798[_0x8580('0x37')][_0x8580('0x3b')]('=');var _0x35a990=_0x3e901d[0x0][_0x8580('0x3c')](_0x3e901d[0x0][_0x8580('0x3d')]('(')+0x1,_0x3e901d[0x0][_0x8580('0x3d')](')'));var _0x394cf8=_0x3e901d[0x1];recordings[_0x156798['uniqueid']][_0x35a990]=_0x394cf8;}}}catch(_0x214118){utils[_0x8580('0x1c')](util[_0x8580('0x5')]('[%s][recordings][newexten]',_0x156798[_0x8580('0x8')]),_0x214118);}};exports[_0x8580('0x3e')]=function(_0x1f5f10){try{if(!_[_0x8580('0x19')](recordings[_0x1f5f10[_0x8580('0x8')]])){utils[_0x8580('0x16')](util[_0x8580('0x5')](_0x8580('0x3f'),_0x1f5f10[_0x8580('0x8')]),_0x1f5f10);utils['info'](util[_0x8580('0x5')](_0x8580('0x40'),_0x1f5f10[_0x8580('0x8')],_0x1f5f10[_0x8580('0x41')]));recordings[_0x1f5f10[_0x8580('0x8')]][_0x8580('0x41')]=_0x1f5f10['queue'];}}catch(_0x92ef41){utils[_0x8580('0x1c')](util['format']('[%s][recordings][queuecallerjoin]',_0x1f5f10['uniqueid']),_0x92ef41);}};exports[_0x8580('0x42')]=function(_0x2b9615){try{utils[_0x8580('0x16')](util['format'](_0x8580('0x43'),_0x2b9615['uniqueid']),_0x2b9615);utils[_0x8580('0x4')](util[_0x8580('0x5')](_0x8580('0x44'),_0x2b9615[_0x8580('0x8')],_0x2b9615[_0x8580('0x45')],_0x2b9615[_0x8580('0x46')],_0x2b9615['transfereecalleridnum'],_0x2b9615[_0x8580('0x47')]));if(recordings[_0x2b9615[_0x8580('0x48')]]&&transfers[_0x8580('0x7')][_0x2b9615[_0x8580('0x48')]]){transfers['blinds'][_0x2b9615[_0x8580('0x48')]][_0x8580('0x49')]=!![];}}catch(_0x518bd5){utils[_0x8580('0x1c')](util['format']('[%s][recordings][blindtransfer]',_0x2b9615[_0x8580('0x8')]),_0x518bd5);}}; \ No newline at end of file +var _0xbf07=['UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','info','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinename','type','outbound','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername'];(function(_0x3b1b25,_0x470b2b){var _0x11d3d6=function(_0x39f6d2){while(--_0x39f6d2){_0x3b1b25['push'](_0x3b1b25['shift']());}};_0x11d3d6(++_0x470b2b);}(_0xbf07,0x1f3));var _0x7bf0=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xbf07[_0xbb14db];return _0x36bed7;};'use strict';var _=require('lodash');var util=require(_0x7bf0('0x0'));var utils=require(_0x7bf0('0x1'));var transfers=require(_0x7bf0('0x2'));var recordings={};function writeDB(_0x124359){var _0xb55380;utils['info'](util[_0x7bf0('0x3')](_0x7bf0('0x4'),_0x124359['uniqueid']));if(transfers[_0x7bf0('0x5')][_0x124359[_0x7bf0('0x6')]]){_0xb55380=_0x124359[_0x7bf0('0x6')];_0x124359[_0x7bf0('0x6')]=transfers[_0x7bf0('0x5')][_0x124359['uniqueid']][_0x7bf0('0x7')];}if(_0x124359[_0x7bf0('0x8')]){utils[_0x7bf0('0x9')](_0x124359['accountcode'])[_0x7bf0('0xa')](function(_0x37bdc6){if(_0x37bdc6){_0x124359[_0x7bf0('0xb')]=_0x37bdc6['name'];_0x124359[_0x7bf0('0xc')]=_0x37bdc6['id'];}utils[_0x7bf0('0xd')](_0x7bf0('0xe'),_0x124359);});}else{utils[_0x7bf0('0xd')](_0x7bf0('0xe'),_0x124359);}if(_0xb55380)delete transfers[_0x7bf0('0x5')][_0xb55380];}exports[_0x7bf0('0xf')]=function(_0xa0e96e){try{utils[_0x7bf0('0x10')](util['format'](_0x7bf0('0x11'),_0xa0e96e[_0x7bf0('0x6')]),_0xa0e96e);if(_0xa0e96e['uniqueid']==_0xa0e96e['linkedid']){utils['info'](util[_0x7bf0('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0xa0e96e[_0x7bf0('0x6')],_0xa0e96e[_0x7bf0('0x12')],_0xa0e96e[_0x7bf0('0x13')]));recordings[_0xa0e96e[_0x7bf0('0x6')]]={'uniqueid':_0xa0e96e[_0x7bf0('0x6')],'accountcode':_0xa0e96e[_0x7bf0('0x8')],'exten':_0xa0e96e[_0x7bf0('0x13')],'context':_0xa0e96e[_0x7bf0('0x12')],'channel':_0xa0e96e[_0x7bf0('0x14')],'monitors':[]};}}catch(_0x2ee6a7){utils[_0x7bf0('0x15')](util['format'](_0x7bf0('0x11'),_0xa0e96e[_0x7bf0('0x6')]),_0x2ee6a7);}};exports[_0x7bf0('0x16')]=function(_0x25994f){try{utils[_0x7bf0('0x10')](util[_0x7bf0('0x3')](_0x7bf0('0x17'),_0x25994f[_0x7bf0('0x6')]),_0x25994f);if(!_[_0x7bf0('0x18')](recordings[_0x25994f['uniqueid']])&&_0x25994f['channelstate']==0x6){utils['info'](util[_0x7bf0('0x3')](_0x7bf0('0x19'),_0x25994f['uniqueid'],_0x25994f[_0x7bf0('0x12')],_0x25994f[_0x7bf0('0x14')]));}else if(!_[_0x7bf0('0x18')](recordings[_0x25994f['linkedid']])&&_0x25994f[_0x7bf0('0x1a')]==0x6&&_0x25994f['context']!=_0x7bf0('0x1b')){utils[_0x7bf0('0x1c')](util[_0x7bf0('0x3')](_0x7bf0('0x1d'),_0x25994f['uniqueid'],_0x25994f[_0x7bf0('0x1e')],_0x25994f[_0x7bf0('0x12')],_0x25994f[_0x7bf0('0x14')]));recordings[_0x25994f[_0x7bf0('0x1e')]]['accountcode']=_0x25994f[_0x7bf0('0x8')];}}catch(_0xe68d38){utils[_0x7bf0('0x15')](util['format']('[%s][recordings][newstate]',_0x25994f[_0x7bf0('0x6')]),_0xe68d38);}};exports[_0x7bf0('0x1f')]=function(_0x523fd7){try{if(!_[_0x7bf0('0x18')](_0x523fd7[_0x7bf0('0x20')])&&!_[_0x7bf0('0x18')](_0x523fd7[_0x7bf0('0x20')][_0x7bf0('0x21')])){utils[_0x7bf0('0x10')](util['format'](_0x7bf0('0x22'),_0x523fd7[_0x7bf0('0x6')]),_0x523fd7);utils[_0x7bf0('0x1c')](util[_0x7bf0('0x3')](_0x7bf0('0x23'),_0x523fd7[_0x7bf0('0x6')],_0x523fd7[_0x7bf0('0x20')],_0x523fd7[_0x7bf0('0x24')]));if(_[_0x7bf0('0x25')](_0x523fd7[_0x7bf0('0x24')],'.wav49')){_0x523fd7[_0x7bf0('0x24')]=_0x523fd7[_0x7bf0('0x24')][_0x7bf0('0x26')]('.wav49','.WAV');}if(recordings[_0x523fd7[_0x7bf0('0x1e')]]){var _0x4dcda5=_[_0x7bf0('0x27')](recordings[_0x523fd7['linkedid']][_0x7bf0('0x28')],{'value':_0x523fd7[_0x7bf0('0x24')]});if(_['isNil'](_0x4dcda5)){recordings[_0x523fd7['linkedid']][_0x7bf0('0x28')]['push']({'value':_0x523fd7[_0x7bf0('0x24')]});}}}}catch(_0x15141d){utils[_0x7bf0('0x15')](util['format'](_0x7bf0('0x22'),_0x523fd7[_0x7bf0('0x6')]),_0x15141d);}};exports[_0x7bf0('0x29')]=function(_0x5d9c51){try{if(!_['isNil'](recordings[_0x5d9c51[_0x7bf0('0x6')]])){utils[_0x7bf0('0x10')](util['format'](_0x7bf0('0x2a'),_0x5d9c51[_0x7bf0('0x6')]),_0x5d9c51);utils[_0x7bf0('0x1c')](util[_0x7bf0('0x3')](_0x7bf0('0x2b'),_0x5d9c51['uniqueid'],_0x5d9c51[_0x7bf0('0x2c')],_0x5d9c51['calleridname'],_0x5d9c51[_0x7bf0('0x2d')]));recordings[_0x5d9c51[_0x7bf0('0x6')]]['calleridnum']=_0x5d9c51[_0x7bf0('0x2c')];recordings[_0x5d9c51['uniqueid']][_0x7bf0('0x2e')]=_0x5d9c51[_0x7bf0('0x2e')];recordings[_0x5d9c51[_0x7bf0('0x6')]]['connectedlinenum']=_0x5d9c51['connectedlinenum'];recordings[_0x5d9c51[_0x7bf0('0x6')]][_0x7bf0('0x2f')]=_0x5d9c51['connectedlinename'];if(recordings[_0x5d9c51['uniqueid']][_0x7bf0('0x30')]==_0x7bf0('0x31')&&recordings[_0x5d9c51[_0x7bf0('0x6')]]['accountcode']){recordings[_0x5d9c51[_0x7bf0('0x6')]][_0x7bf0('0x32')]=recordings[_0x5d9c51['uniqueid']][_0x7bf0('0x8')];recordings[_0x5d9c51[_0x7bf0('0x6')]][_0x7bf0('0x2f')]='';}recordings[_0x5d9c51[_0x7bf0('0x6')]][_0x7bf0('0x28')][_0x7bf0('0x33')](function(_0x435acb){var _0x270454=_[_0x7bf0('0x34')](recordings[_0x5d9c51[_0x7bf0('0x6')]]);_0x270454[_0x7bf0('0x24')]=_0x435acb[_0x7bf0('0x24')];writeDB(_0x270454);});delete recordings[_0x5d9c51[_0x7bf0('0x6')]];}}catch(_0x5288e9){utils[_0x7bf0('0x15')](util['format'](_0x7bf0('0x2a'),_0x5d9c51[_0x7bf0('0x6')]),_0x5288e9);}};exports[_0x7bf0('0x35')]=function(_0x4c659e){try{if(!_[_0x7bf0('0x18')](recordings[_0x4c659e['uniqueid']])){utils[_0x7bf0('0x10')](util[_0x7bf0('0x3')](_0x7bf0('0x36'),_0x4c659e[_0x7bf0('0x6')]),_0x4c659e);utils[_0x7bf0('0x1c')](util[_0x7bf0('0x3')](_0x7bf0('0x37'),_0x4c659e[_0x7bf0('0x6')],_0x4c659e[_0x7bf0('0x38')],_0x4c659e['appdata']));if(_0x4c659e['application'][_0x7bf0('0x39')]()=='set'&&_[_0x7bf0('0x3a')](_0x4c659e[_0x7bf0('0x3b')][_0x7bf0('0x39')](),_0x7bf0('0x3c'))){var _0x5cf85f=_0x4c659e[_0x7bf0('0x3b')]['split']('=');var _0x50f1d9=_0x5cf85f[0x0][_0x7bf0('0x3d')](_0x5cf85f[0x0][_0x7bf0('0x3e')]('(')+0x1,_0x5cf85f[0x0][_0x7bf0('0x3e')](')'));var _0x34599f=_0x5cf85f[0x1];recordings[_0x4c659e[_0x7bf0('0x6')]][_0x50f1d9]=_0x34599f;}}}catch(_0x339ba4){utils[_0x7bf0('0x15')](util['format']('[%s][recordings][newexten]',_0x4c659e[_0x7bf0('0x6')]),_0x339ba4);}};exports[_0x7bf0('0x3f')]=function(_0x4cc5e3){try{if(!_[_0x7bf0('0x18')](recordings[_0x4cc5e3[_0x7bf0('0x6')]])){utils[_0x7bf0('0x10')](util[_0x7bf0('0x3')](_0x7bf0('0x40'),_0x4cc5e3['uniqueid']),_0x4cc5e3);utils[_0x7bf0('0x1c')](util[_0x7bf0('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4cc5e3[_0x7bf0('0x6')],_0x4cc5e3[_0x7bf0('0x41')]));recordings[_0x4cc5e3[_0x7bf0('0x6')]]['queue']=_0x4cc5e3[_0x7bf0('0x41')];}}catch(_0x124ce3){utils['error'](util[_0x7bf0('0x3')](_0x7bf0('0x40'),_0x4cc5e3[_0x7bf0('0x6')]),_0x124ce3);}};exports['blindtransfer']=function(_0xb6f044){try{utils[_0x7bf0('0x10')](util['format'](_0x7bf0('0x42'),_0xb6f044[_0x7bf0('0x6')]),_0xb6f044);utils[_0x7bf0('0x1c')](util[_0x7bf0('0x3')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xb6f044[_0x7bf0('0x6')],_0xb6f044[_0x7bf0('0x43')],_0xb6f044[_0x7bf0('0x44')],_0xb6f044[_0x7bf0('0x45')],_0xb6f044[_0x7bf0('0x46')]));if(recordings[_0xb6f044[_0x7bf0('0x47')]]&&transfers[_0x7bf0('0x5')][_0xb6f044[_0x7bf0('0x47')]]){transfers[_0x7bf0('0x5')][_0xb6f044[_0x7bf0('0x47')]][_0x7bf0('0x48')]=!![];}}catch(_0x385390){utils[_0x7bf0('0x15')](util[_0x7bf0('0x3')]('[%s][recordings][blindtransfer]',_0xb6f044[_0x7bf0('0x6')]),_0x385390);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index bf7598f..e112d10 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 _0x098b=['origtransferercalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','util','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','debug','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x098b,0xd6));var _0xb098=function(_0x328088,_0x1d475b){_0x328088=_0x328088-0x0;var _0xb6662a=_0x098b[_0x328088];return _0xb6662a;};'use strict';var _=require('lodash');var util=require(_0xb098('0x0'));var utils=require('./utils');function writeDB(_0x49b68a){utils[_0xb098('0x1')](util[_0xb098('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x49b68a[_0xb098('0x3')]===_0xb098('0x4')?_0x49b68a[_0xb098('0x5')]:_0x49b68a[_0xb098('0x6')],_0x49b68a[_0xb098('0x3')]));utils[_0xb098('0x7')](_0xb098('0x8'),_0x49b68a);}exports[_0xb098('0x9')]={};exports['blindtransfer']=function(_0xd064e7){try{utils[_0xb098('0xa')](util[_0xb098('0x2')]('[%s][transfers][blindtransfer]',_0xd064e7[_0xb098('0x6')]),_0xd064e7);utils[_0xb098('0x1')](util[_0xb098('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xd064e7[_0xb098('0x6')],_0xd064e7['transferercalleridnum'],_0xd064e7[_0xb098('0xb')],_0xd064e7[_0xb098('0xc')],_0xd064e7[_0xb098('0xd')]));_0xd064e7[_0xb098('0x3')]='blind';exports['blinds'][_0xd064e7[_0xb098('0xe')]]=_0xd064e7;writeDB(_0xd064e7);}catch(_0x15bc31){utils[_0xb098('0xf')](util['format'](_0xb098('0x10'),_0xd064e7[_0xb098('0x6')]),_0x15bc31);}};exports[_0xb098('0x11')]=function(_0x54ed11){try{utils[_0xb098('0xa')](util['format']('[%s][transfers][attendedtransfer]',_0x54ed11[_0xb098('0x5')]),_0x54ed11);utils[_0xb098('0x1')](util['format'](_0xb098('0x12'),_0x54ed11[_0xb098('0x5')],_0x54ed11[_0xb098('0x13')],_0x54ed11[_0xb098('0x14')],_0x54ed11['transfertargetcalleridnum'],_0x54ed11['transfertargetcalleridname']));_0x54ed11=_[_0xb098('0x15')](_0x54ed11,{'transfererchannel':_0x54ed11[_0xb098('0x16')],'transferercalleridnum':_0x54ed11['origtransferercalleridnum'],'transferercalleridname':_0x54ed11[_0xb098('0x14')],'transfererconnectedlinenum':_0x54ed11[_0xb098('0x17')],'transfererconnectedlinename':_0x54ed11[_0xb098('0x18')],'transfereraccountcode':_0x54ed11[_0xb098('0x19')],'transferercontext':_0x54ed11['secondtransferercontext'],'transfererexten':_0x54ed11['secondtransfererexten'],'transfererlinkedid':_0x54ed11[_0xb098('0x1a')],'context':_0x54ed11[_0xb098('0x1b')],'extension':_0x54ed11[_0xb098('0x1c')],'type':_0xb098('0x4')});if(_[_0xb098('0x1d')](_0x54ed11[_0xb098('0x1e')])){_0x54ed11=_[_0xb098('0x15')](_0x54ed11,{'transfereechannel':_0x54ed11[_0xb098('0x1f')],'transfereecalleridnum':_0x54ed11['transfertargetcalleridnum'],'transfereecalleridname':_0x54ed11[_0xb098('0x20')],'transfereeconnectedlinenum':_0x54ed11[_0xb098('0x21')],'transfereeconnectedlinename':_0x54ed11[_0xb098('0x22')],'transfereeaccountcode':_0x54ed11['transfertargetaccountcode'],'transfereecontext':_0x54ed11[_0xb098('0x23')],'transfereeexten':_0x54ed11[_0xb098('0x24')],'transfereelinkedid':_0x54ed11[_0xb098('0x25')]});}writeDB(_0x54ed11);}catch(_0x5be054){utils['error'](util['format'](_0xb098('0x26'),_0x54ed11[_0xb098('0x5')]),_0x5be054);}}; \ No newline at end of file +var _0x3036=['transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','assign'];(function(_0x499001,_0x3f27ae){var _0x320c65=function(_0x121fea){while(--_0x121fea){_0x499001['push'](_0x499001['shift']());}};_0x320c65(++_0x3f27ae);}(_0x3036,0xaf));var _0x6303=function(_0x6d4766,_0x5e2c6e){_0x6d4766=_0x6d4766-0x0;var _0x180518=_0x3036[_0x6d4766];return _0x180518;};'use strict';var _=require(_0x6303('0x0'));var util=require(_0x6303('0x1'));var utils=require(_0x6303('0x2'));function writeDB(_0xb4da1b){utils['info'](util[_0x6303('0x3')](_0x6303('0x4'),_0xb4da1b[_0x6303('0x5')]==='attended'?_0xb4da1b[_0x6303('0x6')]:_0xb4da1b['uniqueid'],_0xb4da1b[_0x6303('0x5')]));utils['request'](_0x6303('0x7'),_0xb4da1b);}exports[_0x6303('0x8')]={};exports['blindtransfer']=function(_0x485729){try{utils[_0x6303('0x9')](util['format'](_0x6303('0xa'),_0x485729[_0x6303('0xb')]),_0x485729);utils[_0x6303('0xc')](util[_0x6303('0x3')](_0x6303('0xd'),_0x485729['uniqueid'],_0x485729[_0x6303('0xe')],_0x485729[_0x6303('0xf')],_0x485729[_0x6303('0x10')],_0x485729['transfereecalleridname']));_0x485729[_0x6303('0x5')]=_0x6303('0x11');exports[_0x6303('0x8')][_0x485729[_0x6303('0x12')]]=_0x485729;writeDB(_0x485729);}catch(_0x57b816){utils['error'](util['format'](_0x6303('0xa'),_0x485729[_0x6303('0xb')]),_0x57b816);}};exports['attendedtransfer']=function(_0x3820a5){try{utils[_0x6303('0x9')](util[_0x6303('0x3')](_0x6303('0x13'),_0x3820a5[_0x6303('0x6')]),_0x3820a5);utils[_0x6303('0xc')](util[_0x6303('0x3')](_0x6303('0x14'),_0x3820a5[_0x6303('0x6')],_0x3820a5['origtransferercalleridnum'],_0x3820a5[_0x6303('0x15')],_0x3820a5[_0x6303('0x16')],_0x3820a5[_0x6303('0x17')]));_0x3820a5=_['assign'](_0x3820a5,{'transfererchannel':_0x3820a5[_0x6303('0x18')],'transferercalleridnum':_0x3820a5[_0x6303('0x19')],'transferercalleridname':_0x3820a5['origtransferercalleridname'],'transfererconnectedlinenum':_0x3820a5[_0x6303('0x1a')],'transfererconnectedlinename':_0x3820a5[_0x6303('0x1b')],'transfereraccountcode':_0x3820a5['origtransfereraccountcode'],'transferercontext':_0x3820a5[_0x6303('0x1c')],'transfererexten':_0x3820a5[_0x6303('0x1d')],'transfererlinkedid':_0x3820a5[_0x6303('0x1e')],'context':_0x3820a5[_0x6303('0x1f')],'extension':_0x3820a5[_0x6303('0x20')],'type':'attended'});if(_[_0x6303('0x21')](_0x3820a5['transfereechannel'])){_0x3820a5=_[_0x6303('0x22')](_0x3820a5,{'transfereechannel':_0x3820a5[_0x6303('0x23')],'transfereecalleridnum':_0x3820a5[_0x6303('0x16')],'transfereecalleridname':_0x3820a5['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3820a5[_0x6303('0x24')],'transfereeconnectedlinename':_0x3820a5[_0x6303('0x25')],'transfereeaccountcode':_0x3820a5[_0x6303('0x26')],'transfereecontext':_0x3820a5[_0x6303('0x27')],'transfereeexten':_0x3820a5[_0x6303('0x28')],'transfereelinkedid':_0x3820a5[_0x6303('0x29')]});}writeDB(_0x3820a5);}catch(_0x5d6659){utils['error'](util['format'](_0x6303('0x13'),_0x3820a5[_0x6303('0x6')]),_0x5d6659);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8755129..d5a6f98 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 _0xc833=['notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','seconds','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xc833,0xfd));var _0x3c83=function(_0x2498d9,_0x274155){_0x2498d9=_0x2498d9-0x0;var _0x412f7b=_0xc833[_0x2498d9];return _0x412f7b;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3c83('0x0'));var moment=require(_0x3c83('0x1'));var util=require(_0x3c83('0x2'));var client=jayson[_0x3c83('0x3')][_0x3c83('0x4')]({'port':0x2329});var logger=require(_0x3c83('0x5'))('xdr');exports[_0x3c83('0x6')]=function(_0x4dfd9b,_0x1fa4ca){logger['info'](_0x4dfd9b,_0x1fa4ca?util[_0x3c83('0x7')](_0x1fa4ca,{'showHidden':![],'depth':null}):'');};exports[_0x3c83('0x8')]=function(_0x5af4cb,_0x582d3f){logger[_0x3c83('0x8')](_0x5af4cb,_0x582d3f?util[_0x3c83('0x7')](_0x582d3f,{'showHidden':![],'depth':null}):'');};exports[_0x3c83('0x9')]=function(_0x7a45fa,_0x122967){logger[_0x3c83('0x9')](_0x7a45fa,_0x122967?util[_0x3c83('0x7')](_0x122967,{'showHidden':![],'depth':null}):'');};exports[_0x3c83('0xa')]=function(_0x26a550,_0x1ca9b6){return client['request'](_0x26a550,{'body':_0x1ca9b6})[_0x3c83('0xb')](function(_0x3577d3){logger[_0x3c83('0x8')](_0x3c83('0xc'),_0x26a550,_0x3577d3?util[_0x3c83('0x7')](_0x3577d3,{'showHidden':![],'depth':null}):'');})[_0x3c83('0xd')](function(_0x521055){logger[_0x3c83('0x9')]('[utils][request]\x20name:%s',_0x26a550,_0x521055?util['inspect'](_0x521055,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1f33bb){return client[_0x3c83('0xa')](_0x3c83('0xe'),{'options':{'raw':!![],'attributes':['id',_0x3c83('0xf'),_0x3c83('0x10'),_0x3c83('0x11')],'where':_0x1f33bb,'limit':0x1}})[_0x3c83('0xb')](function(_0x8cf1){logger[_0x3c83('0x8')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x1f33bb),_0x8cf1?util[_0x3c83('0x7')](_0x8cf1,{'showHidden':![],'depth':null}):'');return _0x8cf1[_0x3c83('0x12')][_0x3c83('0x13')]?_0x8cf1[_0x3c83('0x12')][0x0]:null;});}exports[_0x3c83('0x14')]=function(_0x2273a){return new BPromise(function(_0x5f3d0a,_0x528d09){if(_0x2273a){return getUser({'internal':_0x2273a})[_0x3c83('0xb')](function(_0x38d6d7){logger[_0x3c83('0x6')](_0x3c83('0x15'),_0x2273a,_0x38d6d7?_0x3c83('0x16'):_0x3c83('0x17'));return _0x5f3d0a(_0x38d6d7);})['catch'](function(_0x3b6bf3){logger['error']('[utils][getUserByInternal]',_0x3b6bf3?util['inspect'](_0x3b6bf3,{'showHidden':![],'depth':null}):'');return _0x5f3d0a(null);});}return _0x5f3d0a(null);});};exports['getUserByInterface']=function(_0x291c41){return new BPromise(function(_0x187e58,_0xd25c6c){if(_0x291c41){return getUser({'interface':_0x291c41})[_0x3c83('0xb')](function(_0x3379f1){logger[_0x3c83('0x6')](_0x3c83('0x18'),_0x291c41,_0x3379f1?'found':_0x3c83('0x17'));return _0x187e58(_0x3379f1);})[_0x3c83('0xd')](function(_0x5e2eeb){logger[_0x3c83('0x9')](_0x3c83('0x19'),_0x5e2eeb?util[_0x3c83('0x7')](_0x5e2eeb,{'showHidden':![],'depth':null}):'');return _0x187e58(null);});}return _0x187e58(null);});};exports[_0x3c83('0x1a')]=function(_0x2b7f01){return new BPromise(function(_0x2bee89,_0xed9592){if(_0x2b7f01){return getUser({'name':_0x2b7f01})[_0x3c83('0xb')](function(_0x52a108){logger[_0x3c83('0x6')](_0x3c83('0x1b'),_0x2b7f01,_0x52a108?_0x3c83('0x16'):_0x3c83('0x17'));return _0x2bee89(_0x52a108);})[_0x3c83('0xd')](function(_0x1310d5){logger['error'](_0x3c83('0x1c'),_0x1310d5?util[_0x3c83('0x7')](_0x1310d5,{'showHidden':![],'depth':null}):'');return _0x2bee89(null);});}return _0x2bee89(null);});};exports[_0x3c83('0x1d')]=function(_0x20316d){return new BPromise(function(_0x57a4da,_0x3d6e14){if(_0x20316d){return client[_0x3c83('0xa')](_0x3c83('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x3c83('0x10'),_0x3c83('0x1f'),'acw',_0x3c83('0x20')],'where':{'name':_0x20316d},'limit':0x1}})['then'](function(_0x248e77){logger[_0x3c83('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x20316d,_0x248e77?util[_0x3c83('0x7')](_0x248e77,{'showHidden':![],'depth':null}):'');logger['info'](_0x3c83('0x21'),_0x20316d,_0x248e77?_0x3c83('0x16'):_0x3c83('0x17'));return _0x57a4da(_0x248e77[_0x3c83('0x12')]['length']?_0x248e77[_0x3c83('0x12')][0x0]:null);})[_0x3c83('0xd')](function(_0x190658){logger[_0x3c83('0x9')]('[utils][getVoiceQueueByName]',_0x190658?util['inspect'](_0x190658,{'showHidden':![],'depth':null}):'');return _0x57a4da(null);});}return _0x57a4da(null);});};exports[_0x3c83('0x22')]=function(_0x120949,_0x33e27a){return moment(_0x120949)[_0x3c83('0x23')](_0x33e27a,'seconds')['format'](_0x3c83('0x24'));};exports[_0x3c83('0x25')]=function(_0x1509f6,_0x3452a3){return moment(_0x1509f6)[_0x3c83('0x26')](_0x3452a3,'seconds')[_0x3c83('0x27')](_0x3c83('0x24'));};exports[_0x3c83('0x28')]=function(_0x425b25,_0x3cdf6b){return moment(_0x425b25)[_0x3c83('0x29')](moment(_0x3cdf6b),_0x3c83('0x2a'));};exports['sumTime']=function(_0x149091,_0x342c0c){return parseInt(_0x149091,0xa)+parseInt(_0x342c0c,0xa);};exports[_0x3c83('0x2b')]=function(){return moment()[_0x3c83('0x27')](_0x3c83('0x24'));};exports[_0x3c83('0x2c')]=function(_0x13579d,_0x46de54){if(_0x46de54){return moment(_0x13579d)['isAfter'](_0x46de54);}return!![];};exports[_0x3c83('0x2d')]=function(_0x3c4b9f,_0xf63c06){if(_0xf63c06){return moment(_0x3c4b9f)[_0x3c83('0x2d')](_0xf63c06);}else if(_0x3c4b9f){return!![];}return![];}; \ No newline at end of file +var _0xa51f=['[utils][getVoiceQueueByName]\x20name:%s','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','isAfter','isBefore','moment','client','http','../../config/logger','xdr','debug','error','inspect','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','acw'];(function(_0x28c015,_0xfb9ef5){var _0x206dab=function(_0x1310a8){while(--_0x1310a8){_0x28c015['push'](_0x28c015['shift']());}};_0x206dab(++_0xfb9ef5);}(_0xa51f,0x1d9));var _0xfa51=function(_0xbac1ec,_0x2f59dc){_0xbac1ec=_0xbac1ec-0x0;var _0x1d5ce9=_0xa51f[_0xbac1ec];return _0x1d5ce9;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xfa51('0x0'));var util=require('util');var client=jayson[_0xfa51('0x1')][_0xfa51('0x2')]({'port':0x2329});var logger=require(_0xfa51('0x3'))(_0xfa51('0x4'));exports['info']=function(_0x22eacd,_0x1b5eda){logger['info'](_0x22eacd,_0x1b5eda?util['inspect'](_0x1b5eda,{'showHidden':![],'depth':null}):'');};exports[_0xfa51('0x5')]=function(_0x4e034d,_0x5243ea){logger[_0xfa51('0x5')](_0x4e034d,_0x5243ea?util['inspect'](_0x5243ea,{'showHidden':![],'depth':null}):'');};exports[_0xfa51('0x6')]=function(_0x225c65,_0x40bd68){logger[_0xfa51('0x6')](_0x225c65,_0x40bd68?util[_0xfa51('0x7')](_0x40bd68,{'showHidden':![],'depth':null}):'');};exports[_0xfa51('0x8')]=function(_0x4265c0,_0x1e88a6){return client[_0xfa51('0x8')](_0x4265c0,{'body':_0x1e88a6})[_0xfa51('0x9')](function(_0x854ca6){logger[_0xfa51('0x5')](_0xfa51('0xa'),_0x4265c0,_0x854ca6?util[_0xfa51('0x7')](_0x854ca6,{'showHidden':![],'depth':null}):'');})[_0xfa51('0xb')](function(_0x346427){logger[_0xfa51('0x6')](_0xfa51('0xa'),_0x4265c0,_0x346427?util['inspect'](_0x346427,{'showHidden':![],'depth':null}):'');});};function getUser(_0x150bba){return client['request'](_0xfa51('0xc'),{'options':{'raw':!![],'attributes':['id',_0xfa51('0xd'),_0xfa51('0xe'),_0xfa51('0xf')],'where':_0x150bba,'limit':0x1}})[_0xfa51('0x9')](function(_0xce4241){logger[_0xfa51('0x5')](_0xfa51('0x10'),JSON['stringify'](_0x150bba),_0xce4241?util[_0xfa51('0x7')](_0xce4241,{'showHidden':![],'depth':null}):'');return _0xce4241[_0xfa51('0x11')][_0xfa51('0x12')]?_0xce4241[_0xfa51('0x11')][0x0]:null;});}exports[_0xfa51('0x13')]=function(_0x5de87e){return new BPromise(function(_0x423d34,_0x1af8ee){if(_0x5de87e){return getUser({'internal':_0x5de87e})['then'](function(_0x4db5d1){logger[_0xfa51('0x14')](_0xfa51('0x15'),_0x5de87e,_0x4db5d1?'found':_0xfa51('0x16'));return _0x423d34(_0x4db5d1);})[_0xfa51('0xb')](function(_0xeb1822){logger[_0xfa51('0x6')](_0xfa51('0x17'),_0xeb1822?util[_0xfa51('0x7')](_0xeb1822,{'showHidden':![],'depth':null}):'');return _0x423d34(null);});}return _0x423d34(null);});};exports['getUserByInterface']=function(_0x781a18){return new BPromise(function(_0x59481e,_0x1f06e4){if(_0x781a18){return getUser({'interface':_0x781a18})[_0xfa51('0x9')](function(_0x233949){logger[_0xfa51('0x14')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x781a18,_0x233949?_0xfa51('0x18'):_0xfa51('0x16'));return _0x59481e(_0x233949);})['catch'](function(_0x2f5114){logger[_0xfa51('0x6')](_0xfa51('0x19'),_0x2f5114?util['inspect'](_0x2f5114,{'showHidden':![],'depth':null}):'');return _0x59481e(null);});}return _0x59481e(null);});};exports[_0xfa51('0x1a')]=function(_0x2b66fd){return new BPromise(function(_0x4eb70d,_0x1aca2b){if(_0x2b66fd){return getUser({'name':_0x2b66fd})[_0xfa51('0x9')](function(_0x3b1df4){logger[_0xfa51('0x14')](_0xfa51('0x1b'),_0x2b66fd,_0x3b1df4?_0xfa51('0x18'):_0xfa51('0x16'));return _0x4eb70d(_0x3b1df4);})['catch'](function(_0x59703a){logger[_0xfa51('0x6')]('[utils][getUserByName]',_0x59703a?util['inspect'](_0x59703a,{'showHidden':![],'depth':null}):'');return _0x4eb70d(null);});}return _0x4eb70d(null);});};exports[_0xfa51('0x1c')]=function(_0x48bc0d){return new BPromise(function(_0x25c973,_0x2dd1d2){if(_0x48bc0d){return client[_0xfa51('0x8')](_0xfa51('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xfa51('0xe'),'type',_0xfa51('0x1e'),'acwTimeout'],'where':{'name':_0x48bc0d},'limit':0x1}})[_0xfa51('0x9')](function(_0x28c9dd){logger['debug'](_0xfa51('0x1f'),_0x48bc0d,_0x28c9dd?util[_0xfa51('0x7')](_0x28c9dd,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x48bc0d,_0x28c9dd?_0xfa51('0x18'):_0xfa51('0x16'));return _0x25c973(_0x28c9dd[_0xfa51('0x11')]['length']?_0x28c9dd[_0xfa51('0x11')][0x0]:null);})[_0xfa51('0xb')](function(_0x58c7b0){logger[_0xfa51('0x6')]('[utils][getVoiceQueueByName]',_0x58c7b0?util[_0xfa51('0x7')](_0x58c7b0,{'showHidden':![],'depth':null}):'');return _0x25c973(null);});}return _0x25c973(null);});};exports[_0xfa51('0x20')]=function(_0xd6b48c,_0x2c022b){return moment(_0xd6b48c)['add'](_0x2c022b,_0xfa51('0x21'))[_0xfa51('0x22')](_0xfa51('0x23'));};exports['subtractTime']=function(_0x3c7950,_0x1ecca6){return moment(_0x3c7950)[_0xfa51('0x24')](_0x1ecca6,_0xfa51('0x21'))['format'](_0xfa51('0x23'));};exports[_0xfa51('0x25')]=function(_0x523b5f,_0xa4f898){return moment(_0x523b5f)[_0xfa51('0x26')](moment(_0xa4f898),_0xfa51('0x21'));};exports[_0xfa51('0x27')]=function(_0x1062c7,_0x4e01dc){return parseInt(_0x1062c7,0xa)+parseInt(_0x4e01dc,0xa);};exports['now']=function(){return moment()[_0xfa51('0x22')](_0xfa51('0x23'));};exports[_0xfa51('0x28')]=function(_0x1da9a9,_0x43368c){if(_0x43368c){return moment(_0x1da9a9)['isAfter'](_0x43368c);}return!![];};exports[_0xfa51('0x29')]=function(_0x343b18,_0xb83b6a){if(_0xb83b6a){return moment(_0x343b18)[_0xfa51('0x29')](_0xb83b6a);}else if(_0x343b18){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 32ceb90..e117786 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 _0xe206=['x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','name','ensureDir','then','client','catch','user','data','error','api','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe206,0x127));var _0x6e20=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xe206[_0x8b8564];return _0x360c61;};var fs=require(_0x6e20('0x0'));var _=require(_0x6e20('0x1'));var ewinston=require('express-winston');var path=require(_0x6e20('0x2'));var util=require(_0x6e20('0x3'));var fileLogger=require(_0x6e20('0x4'))[_0x6e20('0x5')];var safeTemplate=require(_0x6e20('0x6'))[_0x6e20('0x7')];var maskSensitiveData=require(_0x6e20('0x8'))[_0x6e20('0x9')];function ClientSideLogger(){function _0x23020b(_0x2a0cee){var _0x141168=path[_0x6e20('0xa')](_0x6e20('0xb'),_0x6e20('0xc'),_0x6e20('0xd'));var _0x5eb9b8=path[_0x6e20('0xa')]('client',_0x2a0cee[_0x6e20('0xe')]+'-'+_0x2a0cee[_0x6e20('0xf')]);return fs[_0x6e20('0x10')](path[_0x6e20('0xa')](_0x141168,_0x5eb9b8))[_0x6e20('0x11')](function(){var _0x3c7648=fileLogger(_0x6e20('0x12'),path[_0x6e20('0xa')](_0x141168,_0x5eb9b8));return _0x3c7648;})[_0x6e20('0x13')](function(_0x15cbdd){throw _0x15cbdd;});}this[_0x6e20('0xc')]=function(_0x390743,_0x4780d5,_0x3a1f89,_0x25924b){return _0x23020b(_0x390743[_0x6e20('0x14')])[_0x6e20('0x11')](function(_0x8bf5f0){var _0x39c644=_0x8bf5f0[_0x4780d5];return _0x39c644;})['then'](function(_0x25288c){var _0x3e281a=_0x390743[_0x6e20('0x14')]?_0x390743[_0x6e20('0x14')]['id']:'no-user';var _0x5eafa9=_0x25924b[_0x6e20('0x15')];var _0xc59f3d=_0x25924b['timestamp'];var _0x1f6336=new Date(Number(_0xc59f3d));return _0x25288c(_0x3e281a,_0x1f6336,_0x3a1f89,_0x5eafa9);})[_0x6e20('0x13')](function(_0x1aa70a){fileLogger(_0x6e20('0x12'))[_0x6e20('0x16')](_0x1aa70a);});};}function setupLoggers(_0x538f81){return new Promise(function(_0x2c364d){var _0x404486=new ClientSideLogger();var _0x1d58b3=fileLogger(_0x6e20('0x17'));var _0x2d14ea=fileLogger(_0x6e20('0x18'));_0x538f81['set']('client-side-logger',_0x404486);_0x538f81[_0x6e20('0x19')](ewinston[_0x6e20('0x1a')]({'winstonInstance':_0x1d58b3,'meta':![],'statusLevels':!![],'msg':function(_0x463269,_0x18091d){var _0x51f2d0=_0x6e20('0x1b');if(!_[_0x6e20('0x1c')](_0x463269['body'])){_0x51f2d0+=_0x6e20('0x1d');var _0x1719eb=_0x463269[_0x6e20('0x1e')];maskSensitiveData(_0x1719eb);}return safeTemplate(util[_0x6e20('0x1f')](_0x51f2d0,_0x463269[_0x6e20('0x20')],_0x463269[_0x6e20('0x21')][_0x6e20('0x22')]?_0x463269[_0x6e20('0x21')]['x-forwarded-for']:_0x463269[_0x6e20('0x23')][_0x6e20('0x24')]||_0x463269['ip'],_0x463269[_0x6e20('0x25')],_0x18091d[_0x6e20('0x26')],_0x18091d[_0x6e20('0x27')],_0x463269['user']?_0x463269[_0x6e20('0x14')]['id']:null,_0x463269[_0x6e20('0x14')]?_0x463269[_0x6e20('0x14')][_0x6e20('0xf')]:null,_0x463269[_0x6e20('0x14')]?_0x463269['user']['role']:null,_0x1719eb?util[_0x6e20('0x28')](_0x1719eb,![],null):''));}}));_0x538f81[_0x6e20('0x19')](ewinston[_0x6e20('0x1a')]({'winstonInstance':_0x2d14ea,'meta':![],'statusLevels':!![],'msg':function(_0x1fe78b,_0x2bec12){var _0x420583='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1fe78b[_0x6e20('0x1e')]&&_0x1fe78b['body']['device']&&_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x29')]){_0x420583=_0x6e20('0x2a');}return util[_0x6e20('0x1f')](_0x420583,_0x1fe78b['method'],_0x1fe78b[_0x6e20('0x21')][_0x6e20('0x22')]?_0x1fe78b[_0x6e20('0x21')][_0x6e20('0x22')]:_0x1fe78b[_0x6e20('0x23')][_0x6e20('0x24')]||_0x1fe78b['ip'],_0x1fe78b[_0x6e20('0x25')],_0x2bec12[_0x6e20('0x26')],_0x2bec12[_0x6e20('0x27')],_0x1fe78b[_0x6e20('0x14')]?_0x1fe78b[_0x6e20('0x14')]['id']:null,_0x1fe78b[_0x6e20('0x14')]?_0x1fe78b[_0x6e20('0x14')][_0x6e20('0xf')]:null,_0x1fe78b[_0x6e20('0x14')]?_0x1fe78b['user'][_0x6e20('0xe')]:null,_0x1fe78b['body']&&_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x2b')]?_0x1fe78b[_0x6e20('0x1e')]['device']:_0x6e20('0x2c'),_0x1fe78b[_0x6e20('0x1e')]&&_0x1fe78b[_0x6e20('0x1e')]['agent_id']?_0x1fe78b[_0x6e20('0x1e')]['agent_id']:'',_0x1fe78b['body']&&_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x2d')]?_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x2d')]:'');},'ignoreRoute':function(_0x2f2063){var _0x5d6216=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5d6216[_0x6e20('0x2e')](_0x2f2063['url']);}}));return _0x2c364d();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x48ed=['set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','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','method','device','other','agent_id','agent_name','test','fs-extra','lodash','express-winston','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','/var','log','xcally','join','client','role','name','ensureDir','then','catch','user','no-user','timestamp','error','api'];(function(_0x27b4c7,_0xd847e6){var _0x3000b9=function(_0x57ef4b){while(--_0x57ef4b){_0x27b4c7['push'](_0x27b4c7['shift']());}};_0x3000b9(++_0xd847e6);}(_0x48ed,0xd4));var _0xd48e=function(_0x436b6e,_0x30ccab){_0x436b6e=_0x436b6e-0x0;var _0x3fe68d=_0x48ed[_0x436b6e];return _0x3fe68d;};var fs=require(_0xd48e('0x0'));var _=require(_0xd48e('0x1'));var ewinston=require(_0xd48e('0x2'));var path=require('path');var util=require(_0xd48e('0x3'));var fileLogger=require(_0xd48e('0x4'))[_0xd48e('0x5')];var safeTemplate=require(_0xd48e('0x6'))['safeTemplate'];var maskSensitiveData=require(_0xd48e('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x3b4ce3(_0x5c556f){var _0x5740ac=path['join'](_0xd48e('0x8'),_0xd48e('0x9'),_0xd48e('0xa'));var _0x36a8f5=path[_0xd48e('0xb')](_0xd48e('0xc'),_0x5c556f[_0xd48e('0xd')]+'-'+_0x5c556f[_0xd48e('0xe')]);return fs[_0xd48e('0xf')](path[_0xd48e('0xb')](_0x5740ac,_0x36a8f5))[_0xd48e('0x10')](function(){var _0x5d93d6=fileLogger(_0xd48e('0xc'),path[_0xd48e('0xb')](_0x5740ac,_0x36a8f5));return _0x5d93d6;})[_0xd48e('0x11')](function(_0xf6f986){throw _0xf6f986;});}this['log']=function(_0x42e96d,_0x3d6b1c,_0x158b37,_0x499eaf){return _0x3b4ce3(_0x42e96d[_0xd48e('0x12')])[_0xd48e('0x10')](function(_0x24d0ea){var _0x404c94=_0x24d0ea[_0x3d6b1c];return _0x404c94;})[_0xd48e('0x10')](function(_0x2377cd){var _0x1dedd4=_0x42e96d[_0xd48e('0x12')]?_0x42e96d[_0xd48e('0x12')]['id']:_0xd48e('0x13');var _0x29855a=_0x499eaf['data'];var _0x4d160b=_0x499eaf[_0xd48e('0x14')];var _0x33ba2b=new Date(Number(_0x4d160b));return _0x2377cd(_0x1dedd4,_0x33ba2b,_0x158b37,_0x29855a);})['catch'](function(_0x2297c1){fileLogger(_0xd48e('0xc'))[_0xd48e('0x15')](_0x2297c1);});};}function setupLoggers(_0x3d6fd7){return new Promise(function(_0x58c3bb){var _0x5b2e85=new ClientSideLogger();var _0x2392a4=fileLogger(_0xd48e('0x16'));var _0x56dc3c=fileLogger('auth');_0x3d6fd7[_0xd48e('0x17')](_0xd48e('0x18'),_0x5b2e85);_0x3d6fd7[_0xd48e('0x19')](ewinston[_0xd48e('0x1a')]({'winstonInstance':_0x2392a4,'meta':![],'statusLevels':!![],'msg':function(_0x2cedbb,_0x22cfdf){var _0x1a1936=_0xd48e('0x1b');if(!_[_0xd48e('0x1c')](_0x2cedbb[_0xd48e('0x1d')])){_0x1a1936+=_0xd48e('0x1e');var _0x3e9f74=_0x2cedbb[_0xd48e('0x1d')];maskSensitiveData(_0x3e9f74);}return safeTemplate(util[_0xd48e('0x1f')](_0x1a1936,_0x2cedbb['method'],_0x2cedbb[_0xd48e('0x20')]['x-forwarded-for']?_0x2cedbb[_0xd48e('0x20')][_0xd48e('0x21')]:_0x2cedbb[_0xd48e('0x22')][_0xd48e('0x23')]||_0x2cedbb['ip'],_0x2cedbb[_0xd48e('0x24')],_0x22cfdf[_0xd48e('0x25')],_0x22cfdf[_0xd48e('0x26')],_0x2cedbb[_0xd48e('0x12')]?_0x2cedbb[_0xd48e('0x12')]['id']:null,_0x2cedbb['user']?_0x2cedbb['user'][_0xd48e('0xe')]:null,_0x2cedbb[_0xd48e('0x12')]?_0x2cedbb[_0xd48e('0x12')][_0xd48e('0xd')]:null,_0x3e9f74?util[_0xd48e('0x27')](_0x3e9f74,![],null):''));}}));_0x3d6fd7[_0xd48e('0x19')](ewinston[_0xd48e('0x1a')]({'winstonInstance':_0x56dc3c,'meta':![],'statusLevels':!![],'msg':function(_0x489abf,_0x5a060e){var _0x21dca0=_0xd48e('0x28');if(_0x489abf['body']&&_0x489abf[_0xd48e('0x1d')]['device']&&_0x489abf['body']['agent_id']){_0x21dca0='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xd48e('0x1f')](_0x21dca0,_0x489abf[_0xd48e('0x29')],_0x489abf[_0xd48e('0x20')][_0xd48e('0x21')]?_0x489abf['headers']['x-forwarded-for']:_0x489abf['connection'][_0xd48e('0x23')]||_0x489abf['ip'],_0x489abf[_0xd48e('0x24')],_0x5a060e['statusCode'],_0x5a060e['responseTime'],_0x489abf[_0xd48e('0x12')]?_0x489abf[_0xd48e('0x12')]['id']:null,_0x489abf[_0xd48e('0x12')]?_0x489abf[_0xd48e('0x12')]['name']:null,_0x489abf['user']?_0x489abf[_0xd48e('0x12')]['role']:null,_0x489abf[_0xd48e('0x1d')]&&_0x489abf[_0xd48e('0x1d')][_0xd48e('0x2a')]?_0x489abf[_0xd48e('0x1d')]['device']:_0xd48e('0x2b'),_0x489abf[_0xd48e('0x1d')]&&_0x489abf['body'][_0xd48e('0x2c')]?_0x489abf[_0xd48e('0x1d')]['agent_id']:'',_0x489abf[_0xd48e('0x1d')]&&_0x489abf[_0xd48e('0x1d')][_0xd48e('0x2d')]?_0x489abf[_0xd48e('0x1d')]['agent_name']:'');},'ignoreRoute':function(_0x2e29b3){var _0x38eb7c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x38eb7c[_0xd48e('0x2e')](_0x2e29b3[_0xd48e('0x24')]);}}));return _0x58c3bb();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index a6198b2..76a6e07 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x001c=['guess','isMoment','padStart','length','iftime','lodash','map','join','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','concat','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','date','daysInMonth','min','domCompare','MMM','monthCompare'];(function(_0x3f1861,_0x7b4285){var _0x7ca70a=function(_0x119b09){while(--_0x119b09){_0x3f1861['push'](_0x3f1861['shift']());}};_0x7ca70a(++_0x7b4285);}(_0x001c,0x12d));var _0xc001=function(_0x3960e4,_0x58d123){_0x3960e4=_0x3960e4-0x0;var _0x4cbd7a=_0x001c[_0x3960e4];return _0x4cbd7a;};var _=require(_0xc001('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][_0xc001('0x1')](function(_0x174275){return _0x174275['source'];})[_0xc001('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xc001('0x3');function throwIfDateNotValid(_0x3ab0cd){if(!_0x3ab0cd[_0xc001('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5cfab3){var _0x24b4b5=_0x5cfab3[_0xc001('0x5')](':')[_0xc001('0x1')](function(_0x410302){return parseInt(_0x410302,0xa);});var _0x2e3814=_0x24b4b5[0x0];var _0x4690e5=_0x24b4b5[0x1];if(_0x2e3814<0x0||_0x2e3814>0x17||_0x4690e5<0x0||_0x4690e5>0x3b){throw new Error(EINVALID_DATE);}return[_0x2e3814,_0x4690e5];}function circularDoWInterval(_0x110d6b,_0x29c454){if(_0x110d6b===_0x29c454){return[_0x110d6b];}else{var _0x400234=moment[_0xc001('0x6')]();moment[_0xc001('0x6')]('en');var _0x127005=moment[_0xc001('0x7')]()[_0xc001('0x1')](function(_0x1b2a51){return _0x1b2a51[_0xc001('0x8')]();});moment[_0xc001('0x6')](_0x400234);var _0x438332=_0x127005[_0xc001('0x9')](_0x110d6b);var _0x3563a0=_0x127005[_0xc001('0x9')](_0x29c454);if(_0x3563a0>_0x438332){return _0x127005[_0xc001('0xa')](_0x438332,_0x3563a0+0x1);}else{var _0x51a372=_0x127005[_0xc001('0xa')](0x0,_0x3563a0+0x1);var _0x21881c=_0x127005[_0xc001('0xa')](_0x438332);return _0x21881c['concat'](_0x51a372);}}}module[_0xc001('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x19dccd,_0x112d34){if(_0x19dccd===_0x112d34){return[_0x19dccd];}else{var _0x5bcdde=moment[_0xc001('0x6')]();moment[_0xc001('0x6')]('en');var _0x565206=moment['monthsShort']()[_0xc001('0x1')](function(_0x4a2247){return _0x4a2247[_0xc001('0x8')]();});moment['locale'](_0x5bcdde);var _0x33856f=_0x565206[_0xc001('0x9')](_0x19dccd);var _0x5530fe=_0x565206['indexOf'](_0x112d34);if(_0x5530fe>_0x33856f){return _0x565206[_0xc001('0xa')](_0x33856f,_0x5530fe+0x1);}else{var _0x45b441=_0x565206[_0xc001('0xa')](0x0,_0x5530fe+0x1);var _0x482cc0=_0x565206['slice'](_0x33856f);return _0x482cc0[_0xc001('0xc')](_0x45b441);}}}module[_0xc001('0xb')][_0xc001('0xd')]=circularMonthInterval;function parseDom(_0x2eb4de){var _0x30358e=parseInt(_0x2eb4de,0xa);if(_0x30358e<0x1||_0x30358e>0x1f){throw new Error(EINVALID_DATE);}return _0x30358e;}function timeCompare(_0x47789f,_0x173844,_0x4ec33b){var _0x53afa9=_0x47789f[_0xc001('0xe')]();var _0x3a24fd=extractTime(_0x173844);var _0x95c651=_0x3a24fd[0x0];var _0x1f8608=_0x3a24fd[0x1];var _0x2cc2ed=_0x47789f[_0xc001('0xe')]()[_0xc001('0xf')](_0x95c651)['minutes'](_0x1f8608);throwIfDateNotValid(_0x2cc2ed);var _0x84f954=extractTime(_0x4ec33b);var _0x4be621=_0x84f954[0x0];var _0x40b885=_0x84f954[0x1];var _0x511cde=_0x47789f[_0xc001('0xe')]()[_0xc001('0xf')](_0x4be621)[_0xc001('0x10')](_0x40b885);throwIfDateNotValid(_0x511cde);if(_0x511cde[_0xc001('0x11')](_0x2cc2ed)){var _0x2ef67f=_0x53afa9[_0xc001('0xe')]()[_0xc001('0x12')](_0xc001('0x13'));var _0x325ef8=_0x53afa9[_0xc001('0xe')]()[_0xc001('0x14')](_0xc001('0x13'));return _0x53afa9[_0xc001('0x15')](_0x2cc2ed,_0x325ef8,undefined,'[]')||_0x53afa9['isBetween'](_0x2ef67f,_0x511cde,undefined,'[]');}else{return _0x53afa9[_0xc001('0x15')](_0x2cc2ed,_0x511cde,undefined,'[]');}}module[_0xc001('0xb')][_0xc001('0x16')]=timeCompare;function dowCompare(_0x58d223,_0x250490,_0x7fae86){var _0x447190=_0x58d223[_0xc001('0x6')]('en')[_0xc001('0x17')](_0xc001('0x18'))[_0xc001('0x8')]();return circularDoWInterval(_0x250490,_0x7fae86)[_0xc001('0x19')](_0x447190);}module[_0xc001('0xb')]['dowCompare']=dowCompare;function domCompare(_0x242168,_0x1c98af,_0x18b237){var _0x40ffe7=_0x242168[_0xc001('0x1a')]();if(_0x1c98af===_0x18b237){return _0x40ffe7===_0x1c98af;}else{var _0xb38a2d=_0x242168[_0xc001('0x1b')]();var _0x1c82e9=_0x1c98af<_0x18b237;let _0x3b34e7=![];var _0x1e0f3f=0x0;var _0x43b3cb=0x0;if(_0x1c82e9){_0x1e0f3f=Math['max'](0x1,_0x1c98af);_0x43b3cb=Math[_0xc001('0x1c')](_0x18b237,_0xb38a2d);_0x3b34e7=_0x40ffe7>=_0x1e0f3f&&_0x40ffe7<=_0x43b3cb;}else{_0x1e0f3f=Math['min'](_0x1c98af,_0xb38a2d);_0x43b3cb=Math['max'](0x1,_0x18b237);_0x3b34e7=_0x40ffe7>=_0x1e0f3f||_0x40ffe7<=_0x43b3cb;}return _0x3b34e7;}}module['exports'][_0xc001('0x1d')]=domCompare;function monthCompare(_0x3dad72,_0x318a52,_0x18ea61){var _0x2ad582=_0x3dad72[_0xc001('0x6')]('en')[_0xc001('0x17')](_0xc001('0x1e'))[_0xc001('0x8')]();return circularMonthInterval(_0x318a52,_0x18ea61)[_0xc001('0x19')](_0x2ad582);}module['exports'][_0xc001('0x1f')]=monthCompare;function iftime(_0x1e7667,_0x39c1a6=moment['tz'][_0xc001('0x20')](),_0x13bc33=moment()){if(!validateRx['test'](_0x1e7667)){throw new Error(EINVALID_STRING);}else{var _0x3d2dac=(moment[_0xc001('0x21')](_0x13bc33)?_0x13bc33[_0xc001('0xe')]():moment(_0x13bc33))['tz'](_0x39c1a6)[_0xc001('0x6')]('en');throwIfDateNotValid(_0x3d2dac);var _0xc9bde0=_0x1e7667[_0xc001('0x5')](',');var _0x83e28e=_0xc9bde0[0x0];var _0x1eafc9=_0xc9bde0[0x1];var _0x3a2163=_0xc9bde0[0x2];var _0x59dacb=_0xc9bde0[0x3];let _0x1553c2=!![];if(_0x83e28e!=='*'){var _0x2b3ed6=_0x83e28e[_0xc001('0x5')]('-');var _0x4b6c1e=_[_0xc001('0x22')](_0x2b3ed6[0x0],0x5,'0');var _0x1908c6=_0x2b3ed6[_0xc001('0x23')]===0x2?_['padStart'](_0x2b3ed6[0x1],0x5,'0'):_0x4b6c1e;_0x1553c2=timeCompare(_0x3d2dac,_0x4b6c1e,_0x1908c6);}let _0x2a04dd=!![];if(_0x1eafc9!=='*'){var _0x4cd08f=_0x1eafc9[_0xc001('0x5')]('-');var _0xa32a1c=_0x4cd08f[0x0];var _0x11b522=_0x4cd08f['length']===0x2?_0x4cd08f[0x1]:_0xa32a1c;_0x2a04dd=dowCompare(_0x3d2dac,_0xa32a1c,_0x11b522);}let _0x123ef5=!![];if(_0x3a2163!=='*'){var _0x1bd799=_0x3a2163[_0xc001('0x5')]('-');var _0x1133fc=parseDom(_0x1bd799[0x0]);var _0x4e0cca=_0x1bd799[_0xc001('0x23')]===0x2?parseDom(_0x1bd799[0x1]):_0x1133fc;_0x123ef5=domCompare(_0x3d2dac,_0x1133fc,_0x4e0cca);}let _0x34bffb=!![];if(_0x59dacb!=='*'){var _0x58c9e0=_0x59dacb['split']('-');var _0x2d91ec=_0x58c9e0[0x0];var _0x49d1dc=_0x58c9e0[_0xc001('0x23')]===0x2?_0x58c9e0[0x1]:_0x58c9e0[0x0];_0x34bffb=monthCompare(_0x3d2dac,_0x2d91ec,_0x49d1dc);}return _0x1553c2&&_0x2a04dd&&_0x123ef5&&_0x34bffb;}}module[_0xc001('0xb')][_0xc001('0x24')]=iftime; \ No newline at end of file +var _0xac25=['daysInMonth','max','min','domCompare','monthCompare','guess','isMoment','split','padStart','length','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','exports','clone','minutes','hours','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare'];(function(_0x3491d0,_0x2db1f7){var _0x48c9b8=function(_0x54df18){while(--_0x54df18){_0x3491d0['push'](_0x3491d0['shift']());}};_0x48c9b8(++_0x2db1f7);}(_0xac25,0x169));var _0x5ac2=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xac25[_0x1b349a];return _0x5d1f7c;};var _=require('lodash');var moment=require(_0x5ac2('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][_0x5ac2('0x1')](function(_0x5910e7){return _0x5910e7[_0x5ac2('0x2')];})[_0x5ac2('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5ac2('0x4');var EINVALID_DATE=_0x5ac2('0x5');function throwIfDateNotValid(_0x57dc39){if(!_0x57dc39[_0x5ac2('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5ac6a4){var _0x3bf1df=_0x5ac6a4['split'](':')[_0x5ac2('0x1')](function(_0x1a3005){return parseInt(_0x1a3005,0xa);});var _0x3339ec=_0x3bf1df[0x0];var _0x812ad2=_0x3bf1df[0x1];if(_0x3339ec<0x0||_0x3339ec>0x17||_0x812ad2<0x0||_0x812ad2>0x3b){throw new Error(EINVALID_DATE);}return[_0x3339ec,_0x812ad2];}function circularDoWInterval(_0x11f6f8,_0x29cbeb){if(_0x11f6f8===_0x29cbeb){return[_0x11f6f8];}else{var _0x376c79=moment['locale']();moment[_0x5ac2('0x7')]('en');var _0x18bf65=moment[_0x5ac2('0x8')]()[_0x5ac2('0x1')](function(_0x236834){return _0x236834[_0x5ac2('0x9')]();});moment[_0x5ac2('0x7')](_0x376c79);var _0x49cbbd=_0x18bf65[_0x5ac2('0xa')](_0x11f6f8);var _0xd905f4=_0x18bf65[_0x5ac2('0xa')](_0x29cbeb);if(_0xd905f4>_0x49cbbd){return _0x18bf65[_0x5ac2('0xb')](_0x49cbbd,_0xd905f4+0x1);}else{var _0x4187ff=_0x18bf65[_0x5ac2('0xb')](0x0,_0xd905f4+0x1);var _0x38281d=_0x18bf65[_0x5ac2('0xb')](_0x49cbbd);return _0x38281d[_0x5ac2('0xc')](_0x4187ff);}}}module['exports'][_0x5ac2('0xd')]=circularDoWInterval;function circularMonthInterval(_0x267e27,_0xd465f8){if(_0x267e27===_0xd465f8){return[_0x267e27];}else{var _0x24d4a8=moment['locale']();moment[_0x5ac2('0x7')]('en');var _0xf2c39a=moment[_0x5ac2('0xe')]()['map'](function(_0x399f27){return _0x399f27[_0x5ac2('0x9')]();});moment[_0x5ac2('0x7')](_0x24d4a8);var _0x5ceff3=_0xf2c39a[_0x5ac2('0xa')](_0x267e27);var _0x2acc3a=_0xf2c39a[_0x5ac2('0xa')](_0xd465f8);if(_0x2acc3a>_0x5ceff3){return _0xf2c39a['slice'](_0x5ceff3,_0x2acc3a+0x1);}else{var _0x2c22a1=_0xf2c39a[_0x5ac2('0xb')](0x0,_0x2acc3a+0x1);var _0x24779b=_0xf2c39a[_0x5ac2('0xb')](_0x5ceff3);return _0x24779b['concat'](_0x2c22a1);}}}module[_0x5ac2('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x376b33){var _0x431a03=parseInt(_0x376b33,0xa);if(_0x431a03<0x1||_0x431a03>0x1f){throw new Error(EINVALID_DATE);}return _0x431a03;}function timeCompare(_0x3f6d89,_0x3c5c50,_0x1eca06){var _0x4d4e09=_0x3f6d89[_0x5ac2('0x10')]();var _0x39f0f7=extractTime(_0x3c5c50);var _0x45f19e=_0x39f0f7[0x0];var _0x4ba076=_0x39f0f7[0x1];var _0x30397c=_0x3f6d89[_0x5ac2('0x10')]()['hours'](_0x45f19e)[_0x5ac2('0x11')](_0x4ba076);throwIfDateNotValid(_0x30397c);var _0x3b28e0=extractTime(_0x1eca06);var _0x25acbb=_0x3b28e0[0x0];var _0x3910a4=_0x3b28e0[0x1];var _0x100113=_0x3f6d89[_0x5ac2('0x10')]()[_0x5ac2('0x12')](_0x25acbb)['minutes'](_0x3910a4);throwIfDateNotValid(_0x100113);if(_0x100113[_0x5ac2('0x13')](_0x30397c)){var _0xe4ea78=_0x4d4e09[_0x5ac2('0x10')]()[_0x5ac2('0x14')](_0x5ac2('0x15'));var _0x505ae3=_0x4d4e09[_0x5ac2('0x10')]()[_0x5ac2('0x16')](_0x5ac2('0x15'));return _0x4d4e09[_0x5ac2('0x17')](_0x30397c,_0x505ae3,undefined,'[]')||_0x4d4e09[_0x5ac2('0x17')](_0xe4ea78,_0x100113,undefined,'[]');}else{return _0x4d4e09[_0x5ac2('0x17')](_0x30397c,_0x100113,undefined,'[]');}}module[_0x5ac2('0xf')][_0x5ac2('0x18')]=timeCompare;function dowCompare(_0x10e636,_0x358238,_0x24940f){var _0x32de0a=_0x10e636[_0x5ac2('0x7')]('en')[_0x5ac2('0x19')](_0x5ac2('0x1a'))[_0x5ac2('0x9')]();return circularDoWInterval(_0x358238,_0x24940f)[_0x5ac2('0x1b')](_0x32de0a);}module[_0x5ac2('0xf')][_0x5ac2('0x1c')]=dowCompare;function domCompare(_0x9c4177,_0x2cad72,_0x2aff3d){var _0x45655c=_0x9c4177['date']();if(_0x2cad72===_0x2aff3d){return _0x45655c===_0x2cad72;}else{var _0x3433bf=_0x9c4177[_0x5ac2('0x1d')]();var _0x1a303b=_0x2cad72<_0x2aff3d;let _0x288006=![];var _0x3bb054=0x0;var _0x2d0e5a=0x0;if(_0x1a303b){_0x3bb054=Math[_0x5ac2('0x1e')](0x1,_0x2cad72);_0x2d0e5a=Math[_0x5ac2('0x1f')](_0x2aff3d,_0x3433bf);_0x288006=_0x45655c>=_0x3bb054&&_0x45655c<=_0x2d0e5a;}else{_0x3bb054=Math['min'](_0x2cad72,_0x3433bf);_0x2d0e5a=Math['max'](0x1,_0x2aff3d);_0x288006=_0x45655c>=_0x3bb054||_0x45655c<=_0x2d0e5a;}return _0x288006;}}module[_0x5ac2('0xf')][_0x5ac2('0x20')]=domCompare;function monthCompare(_0x57e8a2,_0x24e943,_0x4d28a0){var _0x3e6cdc=_0x57e8a2[_0x5ac2('0x7')]('en')['format']('MMM')[_0x5ac2('0x9')]();return circularMonthInterval(_0x24e943,_0x4d28a0)[_0x5ac2('0x1b')](_0x3e6cdc);}module[_0x5ac2('0xf')][_0x5ac2('0x21')]=monthCompare;function iftime(_0x92b10e,_0x1699f9=moment['tz'][_0x5ac2('0x22')](),_0x287f42=moment()){if(!validateRx['test'](_0x92b10e)){throw new Error(EINVALID_STRING);}else{var _0x3498e6=(moment[_0x5ac2('0x23')](_0x287f42)?_0x287f42[_0x5ac2('0x10')]():moment(_0x287f42))['tz'](_0x1699f9)[_0x5ac2('0x7')]('en');throwIfDateNotValid(_0x3498e6);var _0x4ff716=_0x92b10e[_0x5ac2('0x24')](',');var _0x3e66b1=_0x4ff716[0x0];var _0x1ec2c7=_0x4ff716[0x1];var _0x316d08=_0x4ff716[0x2];var _0x44a29b=_0x4ff716[0x3];let _0x4a79fa=!![];if(_0x3e66b1!=='*'){var _0x58fa2f=_0x3e66b1[_0x5ac2('0x24')]('-');var _0x1c6c22=_[_0x5ac2('0x25')](_0x58fa2f[0x0],0x5,'0');var _0x42323f=_0x58fa2f[_0x5ac2('0x26')]===0x2?_[_0x5ac2('0x25')](_0x58fa2f[0x1],0x5,'0'):_0x1c6c22;_0x4a79fa=timeCompare(_0x3498e6,_0x1c6c22,_0x42323f);}let _0x419ffe=!![];if(_0x1ec2c7!=='*'){var _0x44920d=_0x1ec2c7[_0x5ac2('0x24')]('-');var _0x577d31=_0x44920d[0x0];var _0x9e1f9e=_0x44920d[_0x5ac2('0x26')]===0x2?_0x44920d[0x1]:_0x577d31;_0x419ffe=dowCompare(_0x3498e6,_0x577d31,_0x9e1f9e);}let _0x52468a=!![];if(_0x316d08!=='*'){var _0x1cd786=_0x316d08[_0x5ac2('0x24')]('-');var _0x1c45d4=parseDom(_0x1cd786[0x0]);var _0x51e34f=_0x1cd786[_0x5ac2('0x26')]===0x2?parseDom(_0x1cd786[0x1]):_0x1c45d4;_0x52468a=domCompare(_0x3498e6,_0x1c45d4,_0x51e34f);}let _0x42ca83=!![];if(_0x44a29b!=='*'){var _0x52f3e2=_0x44a29b[_0x5ac2('0x24')]('-');var _0x1dcfb1=_0x52f3e2[0x0];var _0x516560=_0x52f3e2[_0x5ac2('0x26')]===0x2?_0x52f3e2[0x1]:_0x52f3e2[0x0];_0x42ca83=monthCompare(_0x3498e6,_0x1dcfb1,_0x516560);}return _0x4a79fa&&_0x419ffe&&_0x52468a&&_0x42ca83;}}module[_0x5ac2('0xf')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 51fa985..d63e893 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc5=['util','moment','winston','../config/environment','debugLevel','toLowerCase','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','format','message','{{{','replace','}}}','level','toUpperCase','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','path'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xafc5,0x1e9));var _0x5afc=function(_0x47eddd,_0x405e8e){_0x47eddd=_0x47eddd-0x0;var _0x28f500=_0xafc5[_0x47eddd];return _0x28f500;};'use strict';var path=require(_0x5afc('0x0'));var util=require(_0x5afc('0x1'));var moment=require(_0x5afc('0x2'));var winston=require(_0x5afc('0x3'));var config=require(_0x5afc('0x4'));var debugLevel=config[_0x5afc('0x5')]?config[_0x5afc('0x5')][_0x5afc('0x6')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x5afc('0x7'),'warn':_0x5afc('0x8'),'info':_0x5afc('0x9'),'print':'bold\x20white','success':_0x5afc('0xa'),'http':_0x5afc('0xb'),'verbose':_0x5afc('0xc'),'debug':'bold\x20blue','silly':_0x5afc('0xd')};winston[_0x5afc('0xe')](XC_LOG_COLORS);function getLogFileName(_0xac68a1,_0x2f1af5,_0x2123d4){var _0x3aee6a=_0xac68a1||_0x5afc('0xf');return path['join'](_0x3aee6a,util[_0x5afc('0x10')]('%s-%s.log',_0x2f1af5,_0x2123d4));}function formatter(_0x40f255,_0x233a67){_0x233a67[_0x5afc('0x11')]=_0x233a67['message']['replace'](/@@{/g,_0x5afc('0x12'))[_0x5afc('0x13')](/}@@/g,_0x5afc('0x14'))[_0x5afc('0x13')](/@{/g,'{{')[_0x5afc('0x13')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x233a67[_0x5afc('0x15')][_0x5afc('0x16')](),_0x40f255,_0x233a67[_0x5afc('0x11')]);}function fileFormat(_0x4e00c2,_0x565b45){_0x565b45[_0x5afc('0x11')]=_0x565b45[_0x5afc('0x11')][_0x5afc('0x13')](/@@{/g,'{{{')[_0x5afc('0x13')](/}@@/g,_0x5afc('0x14'))[_0x5afc('0x13')](/@{/g,'{{')[_0x5afc('0x13')](/}@/g,'}}');var _0x4097bb=_0x565b45[_0x5afc('0x17')]&&Object['keys'](_0x565b45['meta'])[_0x5afc('0x18')]?'\x0a\x09'+JSON['stringify'](_0x565b45['meta']):'';return util['format'](_0x5afc('0x19'),moment()[_0x5afc('0x10')](_0x5afc('0x1a')),_0x565b45[_0x5afc('0x15')][_0x5afc('0x16')](),_0x4e00c2,_0x565b45['message'],_0x4097bb);}function consoleLogger(){var _0x3b02e7=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5afc('0x1b'))][(_0x5afc('0x1c'))]({'level':_0x5afc('0x1d'),'json':![],'formatter':function(_0x5b4ffe){return formatter('',_0x5b4ffe);}})]});return _0x3b02e7;}function fileLogger(_0x4dbf90,_0x2650a5){var _0x43c206=new winston[(_0x5afc('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5afc('0x1b'))][(_0x5afc('0x1f'))]({'name':util['format'](_0x5afc('0x20'),_0x4dbf90,_0x5afc('0x21')),'filename':getLogFileName(_0x2650a5,_0x4dbf90,_0x5afc('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1b11a0){return fileFormat(_0x4dbf90,_0x1b11a0);}}),new winston['transports'][(_0x5afc('0x1f'))]({'name':util[_0x5afc('0x10')]('%s-%s',_0x4dbf90,debugLevel),'filename':getLogFileName(_0x2650a5,_0x4dbf90,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x248b08){return fileFormat(_0x4dbf90,_0x248b08);}}),new winston[(_0x5afc('0x1b'))]['Console']({'level':_0x5afc('0x1d'),'json':![],'formatter':function(_0x3a6a78){return fileFormat(_0x4dbf90,_0x3a6a78);}})]});return _0x43c206;}exports[_0x5afc('0x22')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x8009=['red','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','}}}','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','Console','warn','transports','File','%s-%s','error','fileLogger','path','moment','../config/environment','debugLevel','toLowerCase','redBG\x20white'];(function(_0x5d0207,_0x4000c4){var _0xf3e249=function(_0x1a1fd9){while(--_0x1a1fd9){_0x5d0207['push'](_0x5d0207['shift']());}};_0xf3e249(++_0x4000c4);}(_0x8009,0x19c));var _0x9800=function(_0x5f0fe6,_0x5c418f){_0x5f0fe6=_0x5f0fe6-0x0;var _0x457a3b=_0x8009[_0x5f0fe6];return _0x457a3b;};'use strict';var path=require(_0x9800('0x0'));var util=require('util');var moment=require(_0x9800('0x1'));var winston=require('winston');var config=require(_0x9800('0x2'));var debugLevel=config['debugLevel']?config[_0x9800('0x3')][_0x9800('0x4')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x9800('0x5'),'error':_0x9800('0x6'),'warn':'bold\x20yellow','info':_0x9800('0x7'),'print':_0x9800('0x8'),'success':_0x9800('0x9'),'http':_0x9800('0xa'),'verbose':_0x9800('0xb'),'debug':_0x9800('0xc'),'silly':_0x9800('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x89c70,_0x4a798b,_0x3f432f){var _0x3a042a=_0x89c70||_0x9800('0xe');return path[_0x9800('0xf')](_0x3a042a,util[_0x9800('0x10')](_0x9800('0x11'),_0x4a798b,_0x3f432f));}function formatter(_0x2efdb8,_0x1b3d81){_0x1b3d81[_0x9800('0x12')]=_0x1b3d81[_0x9800('0x12')][_0x9800('0x13')](/@@{/g,_0x9800('0x14'))[_0x9800('0x13')](/}@@/g,'}}}')['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0x9800('0x15'),moment()[_0x9800('0x10')](_0x9800('0x16')),_0x1b3d81['level'][_0x9800('0x17')](),_0x2efdb8,_0x1b3d81[_0x9800('0x12')]);}function fileFormat(_0x353c07,_0x4e7f9f){_0x4e7f9f['message']=_0x4e7f9f['message'][_0x9800('0x13')](/@@{/g,_0x9800('0x14'))[_0x9800('0x13')](/}@@/g,_0x9800('0x18'))[_0x9800('0x13')](/@{/g,'{{')[_0x9800('0x13')](/}@/g,'}}');var _0x59d6af=_0x4e7f9f[_0x9800('0x19')]&&Object[_0x9800('0x1a')](_0x4e7f9f[_0x9800('0x19')])['length']?'\x0a\x09'+JSON[_0x9800('0x1b')](_0x4e7f9f['meta']):'';return util['format'](_0x9800('0x1c'),moment()[_0x9800('0x10')](_0x9800('0x16')),_0x4e7f9f[_0x9800('0x1d')][_0x9800('0x17')](),_0x353c07,_0x4e7f9f[_0x9800('0x12')],_0x59d6af);}function consoleLogger(){var _0xe16186=new winston[(_0x9800('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x9800('0x1f'))]({'level':_0x9800('0x20'),'json':![],'formatter':function(_0x4261a4){return formatter('',_0x4261a4);}})]});return _0xe16186;}function fileLogger(_0xa2f0ad,_0x1cedaa){var _0x5b30a0=new winston[(_0x9800('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9800('0x21'))][(_0x9800('0x22'))]({'name':util[_0x9800('0x10')](_0x9800('0x23'),_0xa2f0ad,'error'),'filename':getLogFileName(_0x1cedaa,_0xa2f0ad,_0x9800('0x24')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x16f7ab){return fileFormat(_0xa2f0ad,_0x16f7ab);}}),new winston[(_0x9800('0x21'))][(_0x9800('0x22'))]({'name':util[_0x9800('0x10')](_0x9800('0x23'),_0xa2f0ad,debugLevel),'filename':getLogFileName(_0x1cedaa,_0xa2f0ad,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3d2bd1){return fileFormat(_0xa2f0ad,_0x3d2bd1);}}),new winston[(_0x9800('0x21'))]['Console']({'level':_0x9800('0x20'),'json':![],'formatter':function(_0x5e58bc){return fileFormat(_0xa2f0ad,_0x5e58bc);}})]});return _0x5b30a0;}exports['consoleLogger']=consoleLogger;exports[_0x9800('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 9c033cb..3a7cb99 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 _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x23a96d,_0x3918d4){var _0x4a6288=function(_0x3f67ab){while(--_0x3f67ab){_0x23a96d['push'](_0x23a96d['shift']());}};_0x4a6288(++_0x3918d4);}(_0xadb5,0xad));var _0x5adb=function(_0x480535,_0x197a55){_0x480535=_0x480535-0x0;var _0x57886e=_0xadb5[_0x480535];return _0x57886e;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0x0295,0x1f0));var _0x5029=function(_0x5dbb3e,_0x4b494d){_0x5dbb3e=_0x5dbb3e-0x0;var _0x138d23=_0x0295[_0x5dbb3e];return _0x138d23;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 6c33f8a..75afadb 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 _0xd4a2=['exports','safeTemplate','lodash','\x20}\x20}','replace','map','isPlainObject','keys','reduce'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xd4a2,0x173));var _0x2d4a=function(_0x1dad6a,_0x3b8004){_0x1dad6a=_0x1dad6a-0x0;var _0x5f192a=_0xd4a2[_0x1dad6a];return _0x5f192a;};var _=require(_0x2d4a('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5d70e1){return _0x5d70e1==='{{'?'{\x20{\x20':_0x2d4a('0x1');}function safeTemplate(_0x576ffe){var _0x2a8a71=_0x576ffe;if(typeof _0x576ffe==='string'){_0x2a8a71=_0x576ffe[_0x2d4a('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x576ffe)){_0x2a8a71=_0x576ffe[_0x2d4a('0x3')](function(_0x40d744){return safeTemplate(_0x40d744);});}else if(_[_0x2d4a('0x4')](_0x576ffe)){_0x2a8a71=Object[_0x2d4a('0x5')](_0x576ffe)[_0x2d4a('0x6')](function(_0x57058f,_0x45fefb){_0x57058f[_0x45fefb]=safeTemplate(_0x576ffe[_0x45fefb]);return _0x57058f;},{});}return _0x2a8a71;}module[_0x2d4a('0x7')][_0x2d4a('0x8')]=safeTemplate; \ No newline at end of file +var _0x93e9=['string','map','isPlainObject','keys','reduce','exports','lodash','{\x20{\x20','\x20}\x20}'];(function(_0x499726,_0x14853e){var _0x465a69=function(_0x2e9ac8){while(--_0x2e9ac8){_0x499726['push'](_0x499726['shift']());}};_0x465a69(++_0x14853e);}(_0x93e9,0xcc));var _0x993e=function(_0x5a6bd2,_0x447fe7){_0x5a6bd2=_0x5a6bd2-0x0;var _0xdc89b9=_0x93e9[_0x5a6bd2];return _0xdc89b9;};var _=require(_0x993e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0xcf3bfd){return _0xcf3bfd==='{{'?_0x993e('0x1'):_0x993e('0x2');}function safeTemplate(_0x43b7b0){var _0x2a63eb=_0x43b7b0;if(typeof _0x43b7b0===_0x993e('0x3')){_0x2a63eb=_0x43b7b0['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x43b7b0)){_0x2a63eb=_0x43b7b0[_0x993e('0x4')](function(_0x255045){return safeTemplate(_0x255045);});}else if(_[_0x993e('0x5')](_0x43b7b0)){_0x2a63eb=Object[_0x993e('0x6')](_0x43b7b0)[_0x993e('0x7')](function(_0x2366d9,_0x12ac94){_0x2366d9[_0x12ac94]=safeTemplate(_0x43b7b0[_0x12ac94]);return _0x2366d9;},{});}return _0x2a63eb;}module[_0x993e('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index e7b78de..0c31528 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 _0x3efe=['../config/environment','root','resolve','server/app.json','legacy-libs','apps','findIndex','name','env','string','NODE_PATH','pathExists','readJSON','then','updated','info','writeJSON','fs-extra','path'];(function(_0x38c164,_0x235295){var _0x593a3c=function(_0x41c775){while(--_0x41c775){_0x38c164['push'](_0x38c164['shift']());}};_0x593a3c(++_0x235295);}(_0x3efe,0xa9));var _0xe3ef=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3efe[_0x42cae2];return _0x5f256f;};var fs=require(_0xe3ef('0x0'));var path=require(_0xe3ef('0x1'));var config=require(_0xe3ef('0x2'));var root=config[_0xe3ef('0x3')];var APP_JSON_PATH=path[_0xe3ef('0x4')](root,_0xe3ef('0x5'));var NODEPATH=path[_0xe3ef('0x4')](root,_0xe3ef('0x6'));function setLegacyLibsNodeEnvPath(_0x55702f){let _0x27d937=![];if(Array['isArray'](_0x55702f[_0xe3ef('0x7')])){var _0x102e4c=_0x55702f[_0xe3ef('0x7')][_0xe3ef('0x8')](function(_0x2d4e56){return _0x2d4e56[_0xe3ef('0x9')]==='motion2';});if(_0x102e4c>-0x1){var _0x4a63fa=_0x55702f[_0xe3ef('0x7')][_0x102e4c];if(typeof _0x4a63fa[_0xe3ef('0xa')]['NODE_PATH']!==_0xe3ef('0xb')){_0x4a63fa[_0xe3ef('0xa')][_0xe3ef('0xc')]=NODEPATH;_0x27d937=!![];}}return{'appConfig':_0x55702f,'updated':_0x27d937};}}function updateAppConfig(_0x17f0e4){return fs[_0xe3ef('0xd')](APP_JSON_PATH)['then'](function(_0x3d0f57){if(_0x3d0f57){return fs[_0xe3ef('0xe')](APP_JSON_PATH)[_0xe3ef('0xf')](function(_0x40eebf){var _0x44b8e1=setLegacyLibsNodeEnvPath(_0x40eebf);if(_0x44b8e1[_0xe3ef('0x10')]){_0x17f0e4[_0xe3ef('0x11')]('Updating\x20app.json');return fs[_0xe3ef('0x12')](APP_JSON_PATH,_0x40eebf,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xe3ef('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0x8562=['fs-extra','path','resolve','server/app.json','legacy-libs','isArray','apps','name','motion2','env','string','NODE_PATH','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports'];(function(_0x388bab,_0x8a2df8){var _0x1fca76=function(_0x247d77){while(--_0x247d77){_0x388bab['push'](_0x388bab['shift']());}};_0x1fca76(++_0x8a2df8);}(_0x8562,0x1f4));var _0x2856=function(_0x3831c8,_0x19525c){_0x3831c8=_0x3831c8-0x0;var _0x465c0b=_0x8562[_0x3831c8];return _0x465c0b;};var fs=require(_0x2856('0x0'));var path=require(_0x2856('0x1'));var config=require('../config/environment');var root=config['root'];var APP_JSON_PATH=path[_0x2856('0x2')](root,_0x2856('0x3'));var NODEPATH=path[_0x2856('0x2')](root,_0x2856('0x4'));function setLegacyLibsNodeEnvPath(_0x46eb40){let _0x26d984=![];if(Array[_0x2856('0x5')](_0x46eb40[_0x2856('0x6')])){var _0x1e2249=_0x46eb40[_0x2856('0x6')]['findIndex'](function(_0x136250){return _0x136250[_0x2856('0x7')]===_0x2856('0x8');});if(_0x1e2249>-0x1){var _0xc4aee4=_0x46eb40['apps'][_0x1e2249];if(typeof _0xc4aee4[_0x2856('0x9')]['NODE_PATH']!==_0x2856('0xa')){_0xc4aee4[_0x2856('0x9')][_0x2856('0xb')]=NODEPATH;_0x26d984=!![];}}return{'appConfig':_0x46eb40,'updated':_0x26d984};}}function updateAppConfig(_0xc4ea52){return fs[_0x2856('0xc')](APP_JSON_PATH)[_0x2856('0xd')](function(_0x4cd2df){if(_0x4cd2df){return fs[_0x2856('0xe')](APP_JSON_PATH)[_0x2856('0xd')](function(_0x4a3000){var _0x538560=setLegacyLibsNodeEnvPath(_0x4a3000);if(_0x538560[_0x2856('0xf')]){_0xc4ea52[_0x2856('0x10')](_0x2856('0x11'));return fs[_0x2856('0x12')](APP_JSON_PATH,_0x4a3000,{'spaces':0x2});}else{return Promise[_0x2856('0x2')]();}});}else{return Promise[_0x2856('0x2')]();}});}module[_0x2856('0x13')]=updateAppConfig; \ No newline at end of file -- 1.7.1